From: support Date: Mon, 16 May 2022 09:38:30 +0000 (+0000) Subject: Built motion from commit 621fbda2.|2.6.10 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=de2e125424d3fb4bf2130c64719364f60d454934;p=motion2.git Built motion from commit 621fbda2.|2.6.10 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4223f55..d866a39 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-05-16T09:09:11.682Z", + "time": "2022-05-16T09:31:00.710Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 6b29116..50f6411 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-05-16T09:09:11.682Z", + "time": "2022-05-16T09:31:00.710Z", "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 98bd4ac..75aa2f8 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 _0x872c=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x872c,0xba));var _0xc872=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x872c[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc872('0x0')],'get':function(_0x5045ba){return this[_0xc872('0x1')](_0xc872('0x2'));}},'action':{'type':Sequelize[_0xc872('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc872('0x4'),_0xc872('0x5'),_0xc872('0x6'),_0xc872('0x7'),_0xc872('0x8'),_0xc872('0x9'),_0xc872('0xa'),_0xc872('0xb')]],'msg':_0xc872('0xc')}},'comment':_0xc872('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc872('0xd')},'data2':{'type':Sequelize[_0xc872('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xc872('0x3')](0x1000),'comment':_0xc872('0xe')},'data4':{'type':Sequelize[_0xc872('0x3')](0x1000),'comments':_0xc872('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xc872('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0xc872('0x11')},'data7':{'type':Sequelize[_0xc872('0x12')],'comments':_0xc872('0x13')}}; \ No newline at end of file +var _0xa330=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue'];(function(_0x33228a,_0x1e459c){var _0x1b754c=function(_0x24f2e7){while(--_0x24f2e7){_0x33228a['push'](_0x33228a['shift']());}};_0x1b754c(++_0x1e459c);}(_0xa330,0xc5));var _0x0a33=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xa330[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require('sequelize');module[_0x0a33('0x0')]={'name':{'type':Sequelize[_0x0a33('0x1')],'get':function(_0x359188){return this[_0x0a33('0x2')](_0x0a33('0x3'));}},'action':{'type':Sequelize[_0x0a33('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0a33('0x5'),_0x0a33('0x6'),_0x0a33('0x7'),_0x0a33('0x8'),_0x0a33('0x9'),_0x0a33('0xa'),_0x0a33('0xb'),_0x0a33('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x0a33('0xd')},'data1':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0xe')},'data2':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0xf')},'data3':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0x10')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comments':_0x0a33('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x0a33('0x12')},'data7':{'type':Sequelize[_0x0a33('0x13')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c32c68c..c39fbf7 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 _0xc46b=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json'];(function(_0xce0f16,_0x2dd373){var _0x12ea26=function(_0x3e8cfd){while(--_0x3e8cfd){_0xce0f16['push'](_0xce0f16['shift']());}};_0x12ea26(++_0x2dd373);}(_0xc46b,0x19d));var _0xbc46=function(_0x3729e4,_0x4c9445){_0x3729e4=_0x3729e4-0x0;var _0x37c0e2=_0xc46b[_0x3729e4];return _0x37c0e2;};'use strict';var emlformat=require(_0xbc46('0x0'));var rimraf=require(_0xbc46('0x1'));var zipdir=require(_0xbc46('0x2'));var jsonpatch=require(_0xbc46('0x3'));var rp=require(_0xbc46('0x4'));var moment=require(_0xbc46('0x5'));var BPromise=require(_0xbc46('0x6'));var Mustache=require(_0xbc46('0x7'));var util=require('util');var path=require(_0xbc46('0x8'));var sox=require(_0xbc46('0x9'));var csv=require(_0xbc46('0xa'));var ejs=require(_0xbc46('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc46('0xc'));var squel=require(_0xbc46('0xd'));var crypto=require(_0xbc46('0xe'));var jsforce=require(_0xbc46('0xf'));var deskjs=require(_0xbc46('0x10'));var toCsv=require(_0xbc46('0xa'));var querystring=require('querystring');var Papa=require(_0xbc46('0x11'));var Redis=require('ioredis');var authService=require(_0xbc46('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc46('0x13'));var hardwareService=require(_0xbc46('0x14'));var logger=require(_0xbc46('0x15'))('api');var utils=require(_0xbc46('0x16'));var config=require(_0xbc46('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc46('0x18'))['db'];function respondWithStatusCode(_0x10a98a,_0x5bf532){_0x5bf532=_0x5bf532||0xcc;return function(_0x5b3bb7){if(_0x5b3bb7){return _0x10a98a['sendStatus'](_0x5bf532);}return _0x10a98a[_0xbc46('0x19')](_0x5bf532)[_0xbc46('0x1a')]();};}function respondWithResult(_0x29646a,_0x2a6842){_0x2a6842=_0x2a6842||0xc8;return function(_0x39c7f2){if(_0x39c7f2){return _0x29646a['status'](_0x2a6842)[_0xbc46('0x1b')](_0x39c7f2);}};}function respondWithFilteredResult(_0x46c1be,_0x331e10){return function(_0xcc5ea7){if(_0xcc5ea7){var _0x42c5b6=typeof _0x331e10[_0xbc46('0x1c')]===_0xbc46('0x1d')&&typeof _0x331e10[_0xbc46('0x1e')]===_0xbc46('0x1d');var _0x57093a=_0xcc5ea7[_0xbc46('0x1f')];var _0x26339b=_0x42c5b6?0x0:_0x331e10[_0xbc46('0x1c')];var _0xd3a9dd=_0x42c5b6?_0xcc5ea7[_0xbc46('0x1f')]:_0x331e10[_0xbc46('0x1c')]+_0x331e10[_0xbc46('0x1e')];var _0x253061;if(_0xd3a9dd>=_0x57093a){_0xd3a9dd=_0x57093a;_0x253061=0xc8;}else{_0x253061=0xce;}_0x46c1be[_0xbc46('0x19')](_0x253061);return _0x46c1be['set'](_0xbc46('0x20'),_0x26339b+'-'+_0xd3a9dd+'/'+_0x57093a)['json'](_0xcc5ea7);}return null;};}function patchUpdates(_0x33dcc6){return function(_0x212174){try{jsonpatch[_0xbc46('0x21')](_0x212174,_0x33dcc6,!![]);}catch(_0x4b08b7){return BPromise[_0xbc46('0x22')](_0x4b08b7);}return _0x212174[_0xbc46('0x23')]();};}function saveUpdates(_0x16dc71,_0x1b0989){return function(_0x48ba59){if(_0x48ba59){return _0x48ba59[_0xbc46('0x24')](_0x16dc71)[_0xbc46('0x25')](function(_0x53876f){return _0x53876f;});}return null;};}function removeEntity(_0x513496,_0x10ffb6){return function(_0x33b22e){if(_0x33b22e){return _0x33b22e[_0xbc46('0x26')]()[_0xbc46('0x25')](function(){_0x513496[_0xbc46('0x19')](0xcc)[_0xbc46('0x1a')]();});}};}function handleEntityNotFound(_0x547ad4,_0x3514cf){return function(_0x4faacd){if(!_0x4faacd){_0x547ad4[_0xbc46('0x27')](0x194);}return _0x4faacd;};}function handleError(_0x202581,_0x105a71){_0x105a71=_0x105a71||0x1f4;return function(_0x23534a){logger[_0xbc46('0x28')](_0x23534a[_0xbc46('0x29')]);if(_0x23534a[_0xbc46('0x2a')]){delete _0x23534a[_0xbc46('0x2a')];}_0x202581[_0xbc46('0x19')](_0x105a71)[_0xbc46('0x2b')](_0x23534a);};}exports[_0xbc46('0x24')]=function(_0x5b2284,_0x4401c6){if(_0x5b2284[_0xbc46('0x2c')]['id']){delete _0x5b2284[_0xbc46('0x2c')]['id'];}return db[_0xbc46('0x2d')][_0xbc46('0x2e')]({'where':{'id':_0x5b2284[_0xbc46('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4401c6,null))[_0xbc46('0x25')](saveUpdates(_0x5b2284[_0xbc46('0x2c')],null))['then'](respondWithResult(_0x4401c6,null))[_0xbc46('0x30')](handleError(_0x4401c6,null));};exports[_0xbc46('0x26')]=function(_0x26b308,_0x405620){return db[_0xbc46('0x2d')][_0xbc46('0x2e')]({'where':{'id':_0x26b308['params']['id']}})[_0xbc46('0x25')](handleEntityNotFound(_0x405620,null))[_0xbc46('0x25')](removeEntity(_0x405620,null))[_0xbc46('0x30')](handleError(_0x405620,null));}; \ No newline at end of file +var _0x46cb=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','body','find','catch','destroy','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x1abcff,_0x1e5f3b){var _0x4c9f20=function(_0x5e5e4a){while(--_0x5e5e4a){_0x1abcff['push'](_0x1abcff['shift']());}};_0x4c9f20(++_0x1e5f3b);}(_0x46cb,0x84));var _0xb46c=function(_0x598a6f,_0x263c42){_0x598a6f=_0x598a6f-0x0;var _0x47c368=_0x46cb[_0x598a6f];return _0x47c368;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x24')]=function(_0x4220a9,_0x2c8956){if(_0x4220a9[_0xb46c('0x2b')]['id']){delete _0x4220a9[_0xb46c('0x2b')]['id'];}return db['Action'][_0xb46c('0x2c')]({'where':{'id':_0x4220a9['params']['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x2c8956,null))['then'](saveUpdates(_0x4220a9['body'],null))[_0xb46c('0x25')](respondWithResult(_0x2c8956,null))[_0xb46c('0x2d')](handleError(_0x2c8956,null));};exports[_0xb46c('0x2e')]=function(_0x1a358f,_0x59adf2){return db[_0xb46c('0x2f')][_0xb46c('0x2c')]({'where':{'id':_0x1a358f[_0xb46c('0x30')]['id']}})['then'](handleEntityNotFound(_0x59adf2,null))[_0xb46c('0x25')](removeEntity(_0x59adf2,null))['catch'](handleError(_0x59adf2,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6d99f01..25c9d71 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 _0x7932=['rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x812968,_0x3bae64){var _0x1e9d9f=function(_0x14c452){while(--_0x14c452){_0x812968['push'](_0x812968['shift']());}};_0x1e9d9f(++_0x3bae64);}(_0x7932,0xf0));var _0x2793=function(_0x15d227,_0x457270){_0x15d227=_0x15d227-0x0;var _0x5f003e=_0x7932[_0x15d227];return _0x5f003e;};'use strict';var _=require(_0x2793('0x0'));var util=require(_0x2793('0x1'));var logger=require('../../config/logger')(_0x2793('0x2'));var moment=require(_0x2793('0x3'));var BPromise=require(_0x2793('0x4'));var rp=require(_0x2793('0x5'));var fs=require('fs');var path=require(_0x2793('0x6'));var rimraf=require(_0x2793('0x7'));var config=require(_0x2793('0x8'));var attributes=require('./action.attributes');module[_0x2793('0x9')]=function(_0xacd552,_0x45a3d2){return _0xacd552[_0x2793('0xa')](_0x2793('0xb'),attributes,{'tableName':_0x2793('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa57f=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Action','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa57f,0x77));var _0xfa57=function(_0x2225ed,_0x4cd999){_0x2225ed=_0x2225ed-0x0;var _0x42f7c8=_0xa57f[_0x2225ed];return _0x42f7c8;};'use strict';var _=require('lodash');var util=require(_0xfa57('0x0'));var logger=require(_0xfa57('0x1'))(_0xfa57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa57('0x3'));var fs=require('fs');var path=require(_0xfa57('0x4'));var rimraf=require(_0xfa57('0x5'));var config=require(_0xfa57('0x6'));var attributes=require('./action.attributes');module[_0xfa57('0x7')]=function(_0x54699d,_0x2ea796){return _0x54699d[_0xfa57('0x8')](_0xfa57('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 4728bf2..66441d7 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x4975,0x86));var _0x5497=function(_0x2e7113,_0x1bb9f2){_0x2e7113=_0x2e7113-0x0;var _0x2d634d=_0x4975[_0x2e7113];return _0x2d634d;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x577f23,_0x3113fb){var _0x285a05=function(_0x4cf77c){while(--_0x4cf77c){_0x577f23['push'](_0x577f23['shift']());}};_0x285a05(++_0x3113fb);}(_0x326f,0xd1));var _0xf326=function(_0x1be683,_0x206384){_0x1be683=_0x1be683-0x0;var _0x1e155e=_0x326f[_0x1be683];return _0x1e155e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index c1079da..f556788 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 _0xff0b=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xff0b,0xd3));var _0xbff0=function(_0x15758a,_0x45293c){_0x15758a=_0x15758a-0x0;var _0x3ec820=_0xff0b[_0x15758a];return _0x3ec820;};'use strict';var multer=require(_0xbff0('0x0'));var util=require(_0xbff0('0x1'));var path=require('path');var timeout=require(_0xbff0('0x2'));var express=require(_0xbff0('0x3'));var router=express['Router']();var fs_extra=require(_0xbff0('0x4'));var auth=require(_0xbff0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbff0('0x6'));var controller=require(_0xbff0('0x7'));router[_0xbff0('0x8')](_0xbff0('0x9'),auth[_0xbff0('0xa')](),controller[_0xbff0('0xb')]);router[_0xbff0('0xc')](_0xbff0('0x9'),auth[_0xbff0('0xa')](),controller[_0xbff0('0xd')]);module[_0xbff0('0xe')]=router; \ No newline at end of file +var _0xcd7f=['put','/:id','isAuthenticated','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x50a330,_0x2e003c){var _0x475636=function(_0x1ce9ab){while(--_0x1ce9ab){_0x50a330['push'](_0x50a330['shift']());}};_0x475636(++_0x2e003c);}(_0xcd7f,0x11e));var _0xfcd7=function(_0x4ea0e5,_0x2410c0){_0x4ea0e5=_0x4ea0e5-0x0;var _0x20e920=_0xcd7f[_0x4ea0e5];return _0x20e920;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcd7('0x0'));var timeout=require(_0xfcd7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfcd7('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfcd7('0x3'));var controller=require('./action.controller');router[_0xfcd7('0x4')](_0xfcd7('0x5'),auth[_0xfcd7('0x6')](),controller[_0xfcd7('0x7')]);router['delete'](_0xfcd7('0x5'),auth['isAuthenticated'](),controller[_0xfcd7('0x8')]);module[_0xfcd7('0x9')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2a70a6f..fd8dd6b 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2675=['sequelize','STRING','TEXT'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x2675,0x75));var _0x5267=function(_0x514cad,_0x3a557c){_0x514cad=_0x514cad-0x0;var _0x3d88a1=_0x2675[_0x514cad];return _0x3d88a1;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0x7c09=['exports','STRING','TEXT'];(function(_0x4f5740,_0x4f1c62){var _0x309591=function(_0x180093){while(--_0x180093){_0x4f5740['push'](_0x4f5740['shift']());}};_0x309591(++_0x4f1c62);}(_0x7c09,0x102));var _0x97c0=function(_0xfbb5fa,_0x261915){_0xfbb5fa=_0xfbb5fa-0x0;var _0x487ae1=_0x7c09[_0xfbb5fa];return _0x487ae1;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index b51b364..28d2644 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 _0xfa82=['rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','cross_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20EMPTY','operator','Sequelize','findAll','from','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','run','runReport','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','limit','undefined','save','update','then','destroy','CustomReports','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params'];(function(_0x5945b2,_0x10af61){var _0x56e363=function(_0x244992){while(--_0x244992){_0x5945b2['push'](_0x5945b2['shift']());}};_0x56e363(++_0x10af61);}(_0xfa82,0x1ac));var _0x2fa8=function(_0xef7803,_0x5e97fe){_0xef7803=_0xef7803-0x0;var _0x4829c7=_0xfa82[_0xef7803];return _0x4829c7;};'use strict';var emlformat=require(_0x2fa8('0x0'));var rimraf=require(_0x2fa8('0x1'));var zipdir=require(_0x2fa8('0x2'));var jsonpatch=require(_0x2fa8('0x3'));var rp=require(_0x2fa8('0x4'));var moment=require(_0x2fa8('0x5'));var BPromise=require(_0x2fa8('0x6'));var Mustache=require('mustache');var util=require(_0x2fa8('0x7'));var path=require('path');var sox=require(_0x2fa8('0x8'));var csv=require(_0x2fa8('0x9'));var ejs=require(_0x2fa8('0xa'));var fs=require('fs');var fs_extra=require(_0x2fa8('0xb'));var _=require(_0x2fa8('0xc'));var squel=require(_0x2fa8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2fa8('0xe'));var Papa=require(_0x2fa8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2fa8('0x10'));var hardwareService=require(_0x2fa8('0x11'));var logger=require(_0x2fa8('0x12'))(_0x2fa8('0x13'));var utils=require('../../config/utils');var config=require(_0x2fa8('0x14'));var licenseUtil=require(_0x2fa8('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2fa8('0x16'))[_0x2fa8('0x17')];function respondWithStatusCode(_0x4f6402,_0x509a1){_0x509a1=_0x509a1||0xcc;return function(_0x1f9ddc){if(_0x1f9ddc){return _0x4f6402['sendStatus'](_0x509a1);}return _0x4f6402[_0x2fa8('0x18')](_0x509a1)[_0x2fa8('0x19')]();};}function respondWithResult(_0x189a5c,_0x5f804b){_0x5f804b=_0x5f804b||0xc8;return function(_0x14de65){if(_0x14de65){return _0x189a5c['status'](_0x5f804b)[_0x2fa8('0x1a')](_0x14de65);}};}function respondWithFilteredResult(_0x4a0674,_0x407b0b){return function(_0x4c3f73){if(_0x4c3f73){var _0xf27001=typeof _0x407b0b[_0x2fa8('0x1b')]==='undefined'&&typeof _0x407b0b[_0x2fa8('0x1c')]===_0x2fa8('0x1d');var _0x1d21db=_0x4c3f73['count'];var _0x34a56d=_0xf27001?0x0:_0x407b0b['offset'];var _0x76813f=_0xf27001?_0x4c3f73['count']:_0x407b0b['offset']+_0x407b0b[_0x2fa8('0x1c')];var _0x499ffa;if(_0x76813f>=_0x1d21db){_0x76813f=_0x1d21db;_0x499ffa=0xc8;}else{_0x499ffa=0xce;}_0x4a0674[_0x2fa8('0x18')](_0x499ffa);return _0x4a0674['set']('Content-Range',_0x34a56d+'-'+_0x76813f+'/'+_0x1d21db)['json'](_0x4c3f73);}return null;};}function patchUpdates(_0x55e0a4){return function(_0x5aa3f7){try{jsonpatch['apply'](_0x5aa3f7,_0x55e0a4,!![]);}catch(_0x369965){return BPromise['reject'](_0x369965);}return _0x5aa3f7[_0x2fa8('0x1e')]();};}function saveUpdates(_0x478335,_0x5bdcf9){return function(_0x2412fa){if(_0x2412fa){return _0x2412fa[_0x2fa8('0x1f')](_0x478335)[_0x2fa8('0x20')](function(_0x1dbe55){return _0x1dbe55;});}return null;};}function removeEntity(_0x1f3551,_0x3eb19f){return function(_0x1ba90a){if(_0x1ba90a){return _0x1ba90a[_0x2fa8('0x21')]()['then'](function(){var _0x417c6d=_0x1ba90a['get']({'plain':!![]});var _0x5e5db3=_0x2fa8('0x22');return db[_0x2fa8('0x23')][_0x2fa8('0x21')]({'where':{'type':_0x5e5db3,'resourceId':_0x417c6d['id']}})[_0x2fa8('0x20')](function(){return _0x1ba90a;});})[_0x2fa8('0x20')](function(){_0x1f3551['status'](0xcc)[_0x2fa8('0x19')]();});}};}function handleEntityNotFound(_0x189108,_0x14a9d4){return function(_0x2fa8ef){if(!_0x2fa8ef){_0x189108['sendStatus'](0x194);}return _0x2fa8ef;};}function handleError(_0x341cb5,_0x48f43a){_0x48f43a=_0x48f43a||0x1f4;return function(_0x5069c7){logger[_0x2fa8('0x24')](_0x5069c7['stack']);if(_0x5069c7['name']){delete _0x5069c7[_0x2fa8('0x25')];}_0x341cb5['status'](_0x48f43a)[_0x2fa8('0x26')](_0x5069c7);};}exports[_0x2fa8('0x27')]=function(_0x110e6d,_0x36bdce){var _0x292048={},_0x46bc86={},_0x3b6355={'count':0x0,'rows':[]};var _0x4ee1b5=_[_0x2fa8('0x28')](db[_0x2fa8('0x29')]['rawAttributes'],function(_0x224a52){return{'name':_0x224a52[_0x2fa8('0x2a')],'type':_0x224a52[_0x2fa8('0x2b')][_0x2fa8('0x2c')]};});_0x46bc86[_0x2fa8('0x2d')]=_['map'](_0x4ee1b5,_0x2fa8('0x25'));_0x46bc86[_0x2fa8('0x2e')]=_[_0x2fa8('0x2f')](_0x110e6d[_0x2fa8('0x2e')]);_0x46bc86[_0x2fa8('0x30')]=_['intersection'](_0x46bc86[_0x2fa8('0x2d')],_0x46bc86[_0x2fa8('0x2e')]);_0x292048[_0x2fa8('0x31')]=_[_0x2fa8('0x32')](_0x46bc86['model'],qs[_0x2fa8('0x33')](_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x33')]));_0x292048[_0x2fa8('0x31')]=_0x292048['attributes']['length']?_0x292048[_0x2fa8('0x31')]:_0x46bc86['model'];if(!_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x34')]('nolimit')){_0x292048[_0x2fa8('0x1c')]=qs[_0x2fa8('0x1c')](_0x110e6d[_0x2fa8('0x2e')]['limit']);_0x292048[_0x2fa8('0x1b')]=qs[_0x2fa8('0x1b')](_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x1b')]);}_0x292048[_0x2fa8('0x35')]=qs[_0x2fa8('0x36')](_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x36')]);_0x292048[_0x2fa8('0x37')]=qs[_0x2fa8('0x30')](_[_0x2fa8('0x38')](_0x110e6d['query'],_0x46bc86[_0x2fa8('0x30')]),_0x4ee1b5);if(_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x39')]){_0x292048[_0x2fa8('0x37')]=_[_0x2fa8('0x3a')](_0x292048[_0x2fa8('0x37')],{'$or':_[_0x2fa8('0x28')](_0x4ee1b5,function(_0x2e676c){if(_0x2e676c[_0x2fa8('0x2b')]!==_0x2fa8('0x3b')){var _0x2b16b1={};_0x2b16b1[_0x2e676c['name']]={'$like':'%'+_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x39')]+'%'};return _0x2b16b1;}})});}_0x292048=_['merge']({},_0x292048,_0x110e6d[_0x2fa8('0x3c')]);var _0x2061b3={'where':_0x292048[_0x2fa8('0x37')]};return db[_0x2fa8('0x29')]['count'](_0x2061b3)['then'](function(_0x2ac289){_0x3b6355['count']=_0x2ac289;if(_0x110e6d[_0x2fa8('0x2e')][_0x2fa8('0x3d')]){_0x292048[_0x2fa8('0x3e')]=[{'all':!![]}];}return db[_0x2fa8('0x29')]['findAll'](_0x292048);})[_0x2fa8('0x20')](function(_0x13c6bd){_0x3b6355[_0x2fa8('0x3f')]=_0x13c6bd;return _0x3b6355;})[_0x2fa8('0x20')](respondWithFilteredResult(_0x36bdce,_0x292048))[_0x2fa8('0x40')](handleError(_0x36bdce,null));};exports[_0x2fa8('0x41')]=function(_0x1e1907,_0x99c2d9){var _0x2c7c8b={'raw':![],'where':{'id':_0x1e1907[_0x2fa8('0x42')]['id']}},_0xa9dbf7={};_0xa9dbf7[_0x2fa8('0x2d')]=_['keys'](db[_0x2fa8('0x29')][_0x2fa8('0x43')]);_0xa9dbf7['query']=_[_0x2fa8('0x2f')](_0x1e1907[_0x2fa8('0x2e')]);_0xa9dbf7[_0x2fa8('0x30')]=_['intersection'](_0xa9dbf7[_0x2fa8('0x2d')],_0xa9dbf7[_0x2fa8('0x2e')]);_0x2c7c8b[_0x2fa8('0x31')]=_[_0x2fa8('0x32')](_0xa9dbf7[_0x2fa8('0x2d')],qs[_0x2fa8('0x33')](_0x1e1907[_0x2fa8('0x2e')]['fields']));_0x2c7c8b[_0x2fa8('0x31')]=_0x2c7c8b['attributes'][_0x2fa8('0x44')]?_0x2c7c8b[_0x2fa8('0x31')]:_0xa9dbf7['model'];if(_0x1e1907[_0x2fa8('0x2e')]['includeAll']){_0x2c7c8b[_0x2fa8('0x3e')]=[{'all':!![]}];}_0x2c7c8b=_[_0x2fa8('0x3a')]({},_0x2c7c8b,_0x1e1907[_0x2fa8('0x3c')]);return db[_0x2fa8('0x29')][_0x2fa8('0x45')](_0x2c7c8b)['then'](handleEntityNotFound(_0x99c2d9,null))[_0x2fa8('0x20')](respondWithResult(_0x99c2d9,null))[_0x2fa8('0x40')](handleError(_0x99c2d9,null));};exports[_0x2fa8('0x46')]=function(_0x222011,_0x155124){return db[_0x2fa8('0x29')]['create'](_0x222011[_0x2fa8('0x47')],{})[_0x2fa8('0x20')](function(_0x220c08){var _0x29cc58=_0x222011[_0x2fa8('0x48')]['get']({'plain':!![]});if(!_0x29cc58)throw new Error(_0x2fa8('0x49'));if(_0x29cc58[_0x2fa8('0x4a')]===_0x2fa8('0x48')){var _0x49f7c2=_0x220c08[_0x2fa8('0x4b')]({'plain':!![]});var _0x27f3da=_0x2fa8('0x4c');return db[_0x2fa8('0x4d')][_0x2fa8('0x45')]({'where':{'name':_0x27f3da,'userProfileId':_0x29cc58['userProfileId']},'raw':!![]})[_0x2fa8('0x20')](function(_0x4a4e4c){if(_0x4a4e4c&&_0x4a4e4c['autoAssociation']===0x0){return db[_0x2fa8('0x23')][_0x2fa8('0x46')]({'name':_0x49f7c2['name'],'resourceId':_0x49f7c2['id'],'type':_0x2fa8('0x22'),'sectionId':_0x4a4e4c['id']},{})[_0x2fa8('0x20')](function(){return _0x220c08;});}else{return _0x220c08;}})[_0x2fa8('0x40')](function(_0xf7e8d4){logger['error'](_0x2fa8('0x4e'),_0xf7e8d4);throw _0xf7e8d4;});}return _0x220c08;})[_0x2fa8('0x20')](respondWithResult(_0x155124,0xc9))[_0x2fa8('0x40')](handleError(_0x155124,null));};exports[_0x2fa8('0x1f')]=function(_0x339952,_0x1d0f10){if(_0x339952[_0x2fa8('0x47')]['id']){delete _0x339952['body']['id'];}return db[_0x2fa8('0x29')][_0x2fa8('0x45')]({'where':{'id':_0x339952[_0x2fa8('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d0f10,null))['then'](saveUpdates(_0x339952[_0x2fa8('0x47')],null))[_0x2fa8('0x20')](respondWithResult(_0x1d0f10,null))['catch'](handleError(_0x1d0f10,null));};exports[_0x2fa8('0x21')]=function(_0x57e2bd,_0x135e4c){return db[_0x2fa8('0x29')][_0x2fa8('0x45')]({'where':{'id':_0x57e2bd[_0x2fa8('0x42')]['id']}})[_0x2fa8('0x20')](handleEntityNotFound(_0x135e4c,null))[_0x2fa8('0x20')](removeEntity(_0x135e4c,null))[_0x2fa8('0x40')](handleError(_0x135e4c,null));};exports[_0x2fa8('0x4f')]=function(_0x366c86,_0x1646fa){var _0x4d7601=0xa;var _0x3d9aa5=[_0x2fa8('0x50'),_0x2fa8('0x51'),_0x2fa8('0x52'),'cross_join'];var _0x411542={'SUM':_0x2fa8('0x53'),'COUNT':_0x2fa8('0x54'),'COUNT DISTINCT':_0x2fa8('0x55'),'MAX':_0x2fa8('0x56'),'MIN':_0x2fa8('0x57'),'AVG':_0x2fa8('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2fa8('0x59'),'GROUP_CONCAT DESC':_0x2fa8('0x5a')};var _0x4c3f1f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2fa8('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x2fa8('0x5c'),'UNIX_TIMESTAMP':_0x2fa8('0x5d')};var _0x3bb412=function(_0x1edacf){return!_[_0x2fa8('0x5e')]([_0x2fa8('0x5f'),_0x2fa8('0x60'),'IS\x20EMPTY',_0x2fa8('0x61')],_0x1edacf);};var _0x3e560f=function(_0x2505f9){if(!_0x2505f9||!_0x2505f9[_0x2fa8('0x62')][_0x2fa8('0x44')]){return'';}for(var _0x1a0025='(',_0x32895a=0x0;_0x32895a<_0x2505f9[_0x2fa8('0x62')]['length'];_0x32895a+=0x1){_0x32895a>0x0&&(_0x1a0025+='\x20'+_0x2505f9['operator']+'\x20');_0x1a0025+=_0x2505f9['rules'][_0x32895a][_0x2fa8('0x63')]?_0x3e560f(_0x2505f9['rules'][_0x32895a][_0x2fa8('0x63')]):_0x2505f9['rules'][_0x32895a]['field']+'\x20'+_0x2505f9[_0x2fa8('0x62')][_0x32895a][_0x2fa8('0x64')]+(_0x3bb412(_0x2505f9[_0x2fa8('0x62')][_0x32895a]['condition'])?'\x20'+_0x2505f9['rules'][_0x32895a][_0x2fa8('0x65')]:'');}return _0x1a0025+')';};var _0x243eb4={'where':{'id':_0x366c86[_0x2fa8('0x42')]['id']}},_0x2080b9,_0x335062,_0x4ca08c,_0x2ab10e,_0x5f0bcc;_0x243eb4=_[_0x2fa8('0x3a')]({},_0x243eb4,_0x366c86[_0x2fa8('0x3c')]);return db[_0x2fa8('0x29')][_0x2fa8('0x45')](_0x243eb4)[_0x2fa8('0x20')](function(_0x15a94a){if(_0x15a94a){_0x2080b9=_0x15a94a;return _0x15a94a['getFields']();}return null;})[_0x2fa8('0x20')](function(_0x366ade){if(_0x366ade){if(!_0x366ade[_0x2fa8('0x44')]){throw new db['Sequelize'][(_0x2fa8('0x66'))](_0x2fa8('0x67'),0x193);}_0x335062=_0x366ade;return db[_0x2fa8('0x68')]['findAll']({'raw':!![]});}return null;})[_0x2fa8('0x20')](function(_0x4cc360){if(_0x4cc360){_0x4ca08c=_[_0x2fa8('0x69')](_0x4cc360,'id');var _0x51db95;var _0x1c849b=squel[_0x2fa8('0x6a')]();_0x1c849b['from'](_0x2080b9[_0x2fa8('0x6b')]);for(var _0x3975ad=0x0;_0x3975ad<_0x335062[_0x2fa8('0x44')];_0x3975ad+=0x1){_0x51db95=_0x335062[_0x3975ad]['MetricId']?_0x4ca08c[_0x335062[_0x3975ad][_0x2fa8('0x6c')]][_0x2fa8('0x6d')]:_0x335062[_0x3975ad][_0x2fa8('0x6e')];_0x51db95=_0x335062[_0x3975ad][_0x2fa8('0x6f')]?_[_0x2fa8('0x70')](_0x411542[_0x335062[_0x3975ad][_0x2fa8('0x6f')]],'%s',_0x51db95):_0x51db95;_0x51db95=_0x335062[_0x3975ad][_0x2fa8('0x71')]?_[_0x2fa8('0x70')](_0x4c3f1f[_0x335062[_0x3975ad]['format']],'%s',_0x51db95):_0x51db95;if(_0x335062[_0x3975ad]['groupBy']){_0x1c849b[_0x2fa8('0x63')](_0x51db95);}_0x335062[_0x3975ad][_0x2fa8('0x72')]&&_0x1c849b[_0x2fa8('0x35')](_0x51db95,_0x335062[_0x3975ad][_0x2fa8('0x72')]===_0x2fa8('0x73')?![]:!![]);_0x1c849b[_0x2fa8('0x6e')](_0x51db95,_0x335062[_0x3975ad][_0x2fa8('0x74')]||_0x51db95);}if(_0x2080b9[_0x2fa8('0x75')]){_0x2080b9['joins']=JSON[_0x2fa8('0x76')](_0x2080b9['joins']);for(var _0x91cb99=0x0;_0x91cb99<_0x2080b9[_0x2fa8('0x75')][_0x2fa8('0x44')];_0x91cb99+=0x1){if(_0x2080b9[_0x2fa8('0x75')][_0x91cb99][_0x2fa8('0x2b')]&&_[_0x2fa8('0x5e')](_0x3d9aa5,_0x2080b9[_0x2fa8('0x75')][_0x91cb99][_0x2fa8('0x2b')])&&_0x2080b9['joins'][_0x91cb99]['parentKey']&&_0x2080b9[_0x2fa8('0x75')][_0x91cb99][_0x2fa8('0x77')]&&_0x2080b9[_0x2fa8('0x75')][_0x91cb99][_0x2fa8('0x78')]){_0x1c849b[_0x2080b9['joins'][_0x91cb99]['type']](_0x2080b9[_0x2fa8('0x75')][_0x91cb99][_0x2fa8('0x77')],null,util[_0x2fa8('0x71')](_0x2fa8('0x79'),_0x2080b9[_0x2fa8('0x6b')],_0x2080b9['joins'][_0x91cb99][_0x2fa8('0x7a')],_0x2080b9[_0x2fa8('0x75')][_0x91cb99]['foreignTable'],_0x2080b9['joins'][_0x91cb99][_0x2fa8('0x78')]));}}}if(_0x2080b9[_0x2fa8('0x7b')]){_0x2080b9[_0x2fa8('0x7b')]=JSON[_0x2fa8('0x76')](_0x2080b9[_0x2fa8('0x7b')]);_0x1c849b[_0x2fa8('0x37')](_0x3e560f(_0x2080b9[_0x2fa8('0x7b')][_0x2fa8('0x63')]));}_0x5f0bcc=_0x1c849b[_0x2fa8('0x7c')]();_0x1c849b[_0x2fa8('0x1c')](_0x4d7601);_0x1c849b[_0x2fa8('0x1b')](0x0);logger[_0x2fa8('0x7d')](_0x2fa8('0x7e'),_0x1c849b['toString']());return dbH[_0x2fa8('0x7f')]['query'](_0x1c849b[_0x2fa8('0x80')](),{'type':dbH[_0x2fa8('0x7f')]['QueryTypes'][_0x2fa8('0x81')]});}})[_0x2fa8('0x20')](respondWithResult(_0x1646fa,null))[_0x2fa8('0x40')](handleError(_0x1646fa,null));};function runReport(_0x4bd301,_0x18a51b,_0x153246){var _0x23c298=_0x18a51b[_0x2fa8('0x25')];var _0x31b0ad=0xa;var _0x3e6ba0=[_0x2fa8('0x50'),_0x2fa8('0x51'),_0x2fa8('0x52'),_0x2fa8('0x82')];var _0x3e8883={'SUM':_0x2fa8('0x53'),'COUNT':_0x2fa8('0x54'),'COUNT DISTINCT':_0x2fa8('0x55'),'MAX':_0x2fa8('0x56'),'MIN':_0x2fa8('0x57'),'AVG':_0x2fa8('0x58'),'GROUP_CONCAT':_0x2fa8('0x83'),'GROUP_CONCAT ASC':_0x2fa8('0x59'),'GROUP_CONCAT DESC':_0x2fa8('0x5a')};var _0x40800b={'SEC_TO_TIME':_0x2fa8('0x84'),'DATE':_0x2fa8('0x5b'),'HOUR':_0x2fa8('0x85'),'ROUND':_0x2fa8('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4be5eb=function(_0x32e033){return!_[_0x2fa8('0x5e')](['IS\x20NULL',_0x2fa8('0x60'),_0x2fa8('0x86'),_0x2fa8('0x61')],_0x32e033);};var _0x70d3ff=function(_0x1748ab){if(!_0x1748ab||!_0x1748ab[_0x2fa8('0x62')][_0x2fa8('0x44')]){return'';}for(var _0xe5ed48='(',_0x3ce78e=0x0;_0x3ce78e<_0x1748ab[_0x2fa8('0x62')][_0x2fa8('0x44')];_0x3ce78e+=0x1){_0x3ce78e>0x0&&(_0xe5ed48+='\x20'+_0x1748ab[_0x2fa8('0x87')]+'\x20');_0xe5ed48+=_0x1748ab['rules'][_0x3ce78e]['group']?_0x70d3ff(_0x1748ab[_0x2fa8('0x62')][_0x3ce78e]['group']):_0x1748ab['rules'][_0x3ce78e][_0x2fa8('0x6e')]+'\x20'+_0x1748ab['rules'][_0x3ce78e]['condition']+(_0x4be5eb(_0x1748ab[_0x2fa8('0x62')][_0x3ce78e][_0x2fa8('0x64')])?'\x20'+_0x1748ab[_0x2fa8('0x62')][_0x3ce78e][_0x2fa8('0x65')]:'');}return _0xe5ed48+')';};var _0x4e7a8f={'where':{'id':_0x4bd301['id']}},_0x469c42,_0x25eae6,_0x448561,_0x1cd948,_0x509cb3;_0x4e7a8f=_[_0x2fa8('0x3a')]({},_0x4e7a8f,_0x153246);return db[_0x2fa8('0x29')][_0x2fa8('0x45')](_0x4e7a8f)['then'](function(_0x2affb3){if(_0x2affb3){_0x469c42=_0x2affb3;return _0x2affb3['getFields']();}return null;})[_0x2fa8('0x20')](function(_0x25bb41){if(_0x25bb41){if(!_0x25bb41[_0x2fa8('0x44')]){throw new db[(_0x2fa8('0x88'))][(_0x2fa8('0x66'))](_0x2fa8('0x67'),0x193);}_0x25eae6=_0x25bb41;return db['AnalyticMetric'][_0x2fa8('0x89')]({'raw':!![]});}return null;})[_0x2fa8('0x20')](function(_0x4e22b3){if(_0x4e22b3){_0x448561=_['keyBy'](_0x4e22b3,'id');var _0xfe6864;var _0x319730=squel[_0x2fa8('0x6a')]();_0x319730[_0x2fa8('0x8a')](_0x469c42[_0x2fa8('0x6b')]);for(var _0x29238f=0x0;_0x29238f<_0x25eae6[_0x2fa8('0x44')];_0x29238f+=0x1){_0xfe6864=_0x25eae6[_0x29238f]['MetricId']?_0x448561[_0x25eae6[_0x29238f]['MetricId']]['metric']:_0x25eae6[_0x29238f][_0x2fa8('0x6e')];_0xfe6864=_0x25eae6[_0x29238f][_0x2fa8('0x6f')]?_['replace'](_0x3e8883[_0x25eae6[_0x29238f]['function']],'%s',_0xfe6864):_0xfe6864;_0xfe6864=_0x25eae6[_0x29238f][_0x2fa8('0x71')]?_[_0x2fa8('0x70')](_0x40800b[_0x25eae6[_0x29238f][_0x2fa8('0x71')]],'%s',_0xfe6864):_0xfe6864;if(_0x25eae6[_0x29238f][_0x2fa8('0x8b')]){_0x319730['group'](_0xfe6864);}_0x25eae6[_0x29238f][_0x2fa8('0x72')]&&_0x319730[_0x2fa8('0x35')](_0xfe6864,_0x25eae6[_0x29238f]['orderBy']==='DESC'?![]:!![]);_0x319730[_0x2fa8('0x6e')](_0xfe6864,_0x25eae6[_0x29238f][_0x2fa8('0x74')]||_0xfe6864);}if(_0x469c42[_0x2fa8('0x75')]){_0x469c42[_0x2fa8('0x75')]=JSON[_0x2fa8('0x76')](_0x469c42[_0x2fa8('0x75')]);for(var _0x3ecbc9=0x0;_0x3ecbc9<_0x469c42[_0x2fa8('0x75')][_0x2fa8('0x44')];_0x3ecbc9+=0x1){if(_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x2b')]&&_[_0x2fa8('0x5e')](_0x3e6ba0,_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x2b')])&&_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x7a')]&&_0x469c42[_0x2fa8('0x75')][_0x3ecbc9]['foreignTable']&&_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x78')]){_0x319730[_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x2b')]](_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x77')],null,util[_0x2fa8('0x71')](_0x2fa8('0x79'),_0x469c42[_0x2fa8('0x6b')],_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x7a')],_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x77')],_0x469c42[_0x2fa8('0x75')][_0x3ecbc9][_0x2fa8('0x78')]));}}}if(_0x469c42[_0x2fa8('0x7b')]){_0x469c42[_0x2fa8('0x7b')]=JSON['parse'](_0x469c42[_0x2fa8('0x7b')]);_0x319730['where'](_0x70d3ff(_0x469c42[_0x2fa8('0x7b')]['group']));}_0x509cb3=_0x319730[_0x2fa8('0x7c')]();_0x319730[_0x2fa8('0x1c')](_0x31b0ad);_0x319730[_0x2fa8('0x1b')](0x0);return;}})[_0x2fa8('0x20')](function(){if(_0x18a51b[_0x2fa8('0x8c')]===_0x2fa8('0x8d')){return null;}var _0x27c84f=_[_0x2fa8('0x3a')](_0x18a51b,{'name':_0x18a51b[_0x2fa8('0x8e')]||_0x18a51b[_0x2fa8('0x25')]||_0x469c42[_0x2fa8('0x25')],'basename':_0x23c298,'savename':util['format'](_0x2fa8('0x8f'),_0x18a51b['name']||_0x469c42[_0x2fa8('0x25')],require(_0x2fa8('0x90'))[_0x2fa8('0x91')](0x4),_0x18a51b['output']||_0x2fa8('0x92')),'reportId':_0x469c42['id'],'reportType':_0x2fa8('0x93')});return db[_0x2fa8('0x94')]['create'](_0x27c84f,{'raw':!![]});})[_0x2fa8('0x20')](function(_0x11bf5c){if(_0x469c42[_0x2fa8('0x6b')]===_0x2fa8('0x95')){_0x509cb3[_0x2fa8('0x37')](_0x469c42[_0x2fa8('0x6b')]+_0x2fa8('0x96'),_0x18a51b['startDate'],_0x18a51b[_0x2fa8('0x97')]);}else{_0x509cb3[_0x2fa8('0x37')](_0x469c42[_0x2fa8('0x6b')]+_0x2fa8('0x98'),_0x18a51b[_0x2fa8('0x99')],_0x18a51b['endDate']);}if(_0x11bf5c){logger[_0x2fa8('0x9a')](_0x2fa8('0x9b'),_0x509cb3[_0x2fa8('0x80')]());require(_0x2fa8('0x9c'))[_0x2fa8('0x9d')](path[_0x2fa8('0x50')](__dirname,_0x2fa8('0x9e'),_0x11bf5c[_0x2fa8('0x8c')]),[_0x11bf5c['id'],_0x509cb3[_0x2fa8('0x80')](),path['join'](__dirname,_0x2fa8('0x9f'),_0x11bf5c[_0x2fa8('0xa0')]),_0x23c298]);return _0x11bf5c;}else{var _0x51e85b=squel[_0x2fa8('0x6a')]();_0x51e85b[_0x2fa8('0x8a')]('('+_0x509cb3['toString']()+')','countTable');_0x51e85b[_0x2fa8('0x6e')]('COUNT(*)','count');_0x509cb3[_0x2fa8('0x1c')](_0x18a51b['limit']||_0x31b0ad);_0x509cb3[_0x2fa8('0x1b')](_0x18a51b['offset']||0x0);return dbH[_0x2fa8('0x7f')][_0x2fa8('0x2e')](_0x51e85b[_0x2fa8('0x80')](),{'type':dbH[_0x2fa8('0x7f')]['QueryTypes'][_0x2fa8('0x81')]})[_0x2fa8('0x20')](function(_0x22a600){if(!_0x22a600[_0x2fa8('0x44')]){_0x1cd948=0x0;}else{_0x1cd948=_0x22a600[0x0]['count']||0x0;}return dbH['sequelize'][_0x2fa8('0x2e')](_0x509cb3[_0x2fa8('0x80')](),{'type':dbH[_0x2fa8('0x7f')][_0x2fa8('0xa1')][_0x2fa8('0x81')]});})['then'](function(_0x45d448){return{'rows':_0x45d448||[],'count':_0x1cd948};});}});}exports[_0x2fa8('0xa2')]=function(_0xf2bc49,_0x32e567){return runReport(_0xf2bc49[_0x2fa8('0x42')],_0xf2bc49['query'],_0xf2bc49[_0x2fa8('0x3c')])[_0x2fa8('0x20')](respondWithResult(_0x32e567,null))[_0x2fa8('0x40')](handleError(_0x32e567,null));};exports[_0x2fa8('0xa3')]=runReport;exports[_0x2fa8('0x2e')]=function(_0x23eb40,_0x5c55cb){var _0x6cb001=0xa;var _0x345574=[_0x2fa8('0x50'),_0x2fa8('0x51'),'right_join',_0x2fa8('0x82')];var _0x35ff14={'SUM':_0x2fa8('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2fa8('0x55'),'MAX':_0x2fa8('0x56'),'MIN':_0x2fa8('0x57'),'AVG':_0x2fa8('0x58'),'GROUP_CONCAT':_0x2fa8('0x83'),'GROUP_CONCAT ASC':_0x2fa8('0x59'),'GROUP_CONCAT DESC':_0x2fa8('0x5a')};var _0x25fea6={'SEC_TO_TIME':_0x2fa8('0x84'),'DATE':_0x2fa8('0x5b'),'HOUR':_0x2fa8('0x85'),'ROUND':_0x2fa8('0x5c'),'UNIX_TIMESTAMP':_0x2fa8('0x5d')};var _0x13172a=function(_0x4df559){return!_[_0x2fa8('0x5e')]([_0x2fa8('0x5f'),_0x2fa8('0x60'),_0x2fa8('0x86'),_0x2fa8('0x61')],_0x4df559);};var _0x5d1d75=function(_0x1704f9){if(!_0x1704f9||!_0x1704f9[_0x2fa8('0x62')][_0x2fa8('0x44')]){return'';}for(var _0x5dec15='(',_0x452161=0x0;_0x452161<_0x1704f9[_0x2fa8('0x62')][_0x2fa8('0x44')];_0x452161+=0x1){_0x452161>0x0&&(_0x5dec15+='\x20'+_0x1704f9[_0x2fa8('0x87')]+'\x20');_0x5dec15+=_0x1704f9[_0x2fa8('0x62')][_0x452161][_0x2fa8('0x63')]?_0x5d1d75(_0x1704f9[_0x2fa8('0x62')][_0x452161][_0x2fa8('0x63')]):_0x1704f9[_0x2fa8('0x62')][_0x452161][_0x2fa8('0x6e')]+'\x20'+_0x1704f9[_0x2fa8('0x62')][_0x452161]['condition']+(_0x13172a(_0x1704f9[_0x2fa8('0x62')][_0x452161][_0x2fa8('0x64')])?'\x20'+_0x1704f9[_0x2fa8('0x62')][_0x452161][_0x2fa8('0x65')]:'');}return _0x5dec15+')';};var _0x2491f2={'where':{'id':_0x23eb40[_0x2fa8('0x42')]['id']}},_0x3ee711,_0x48fa8f,_0x354006,_0x17ce09,_0x5251dd;_0x2491f2=_[_0x2fa8('0x3a')]({},_0x2491f2,_0x23eb40[_0x2fa8('0x3c')]);return db[_0x2fa8('0x29')]['find'](_0x2491f2)['then'](function(_0x51bf59){if(_0x51bf59){_0x3ee711=_0x51bf59;return _0x51bf59[_0x2fa8('0xa4')]();}return null;})[_0x2fa8('0x20')](function(_0x25acdd){if(_0x25acdd){if(!_0x25acdd['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x2fa8('0x67'),0x193);}_0x48fa8f=_0x25acdd;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x2fa8('0x20')](function(_0x447cd0){if(_0x447cd0){_0x354006=_['keyBy'](_0x447cd0,'id');var _0x522c35;var _0x45f0bf=squel[_0x2fa8('0x6a')]();_0x45f0bf['from'](_0x3ee711[_0x2fa8('0x6b')]);for(var _0x3431a5=0x0;_0x3431a5<_0x48fa8f[_0x2fa8('0x44')];_0x3431a5+=0x1){_0x522c35=_0x48fa8f[_0x3431a5]['MetricId']?_0x354006[_0x48fa8f[_0x3431a5][_0x2fa8('0x6c')]]['metric']:_0x48fa8f[_0x3431a5][_0x2fa8('0x6e')];_0x522c35=_0x48fa8f[_0x3431a5]['function']?_[_0x2fa8('0x70')](_0x35ff14[_0x48fa8f[_0x3431a5][_0x2fa8('0x6f')]],'%s',_0x522c35):_0x522c35;_0x522c35=_0x48fa8f[_0x3431a5][_0x2fa8('0x71')]?_[_0x2fa8('0x70')](_0x25fea6[_0x48fa8f[_0x3431a5][_0x2fa8('0x71')]],'%s',_0x522c35):_0x522c35;if(_0x48fa8f[_0x3431a5][_0x2fa8('0x8b')]){_0x45f0bf[_0x2fa8('0x63')](_0x522c35);}_0x48fa8f[_0x3431a5]['orderBy']&&_0x45f0bf[_0x2fa8('0x35')](_0x522c35,_0x48fa8f[_0x3431a5][_0x2fa8('0x72')]===_0x2fa8('0x73')?![]:!![]);_0x45f0bf['field'](_0x522c35,_0x48fa8f[_0x3431a5][_0x2fa8('0x74')]||_0x522c35);}if(_0x3ee711[_0x2fa8('0x75')]){_0x3ee711[_0x2fa8('0x75')]=JSON[_0x2fa8('0x76')](_0x3ee711[_0x2fa8('0x75')]);for(var _0x104584=0x0;_0x104584<_0x3ee711[_0x2fa8('0x75')][_0x2fa8('0x44')];_0x104584+=0x1){if(_0x3ee711[_0x2fa8('0x75')][_0x104584]['type']&&_[_0x2fa8('0x5e')](_0x345574,_0x3ee711[_0x2fa8('0x75')][_0x104584]['type'])&&_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x7a')]&&_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x77')]&&_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x78')]){_0x45f0bf[_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x2b')]](_0x3ee711['joins'][_0x104584][_0x2fa8('0x77')],null,util[_0x2fa8('0x71')](_0x2fa8('0x79'),_0x3ee711[_0x2fa8('0x6b')],_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x7a')],_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x77')],_0x3ee711[_0x2fa8('0x75')][_0x104584][_0x2fa8('0x78')]));}}}if(_0x3ee711[_0x2fa8('0x7b')]){_0x3ee711[_0x2fa8('0x7b')]=JSON[_0x2fa8('0x76')](_0x3ee711[_0x2fa8('0x7b')]);_0x45f0bf[_0x2fa8('0x37')](_0x5d1d75(_0x3ee711[_0x2fa8('0x7b')][_0x2fa8('0x63')]));}_0x5251dd=_0x45f0bf[_0x2fa8('0x7c')]();_0x45f0bf[_0x2fa8('0x1c')](_0x6cb001);_0x45f0bf[_0x2fa8('0x1b')](0x0);logger[_0x2fa8('0x7d')](_0x2fa8('0x7e'),_0x45f0bf['toString']());return dbH['sequelize'][_0x2fa8('0x2e')](_0x45f0bf[_0x2fa8('0x80')](),{'type':dbH['sequelize'][_0x2fa8('0xa1')][_0x2fa8('0x81')]});}})['then'](function(){return{'sql':_0x5251dd[_0x2fa8('0x80')]()};})[_0x2fa8('0x20')](respondWithResult(_0x5c55cb,null))[_0x2fa8('0x40')](handleError(_0x5c55cb,null));}; \ No newline at end of file +var _0x40ed=['web','fullPath','%s-%s.%s','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','query','model','intersection','fields','length','attributes','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_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','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','order','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','SUM(%s)','AVG(%s)','operator','groupBy','output'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x40ed,0xb3));var _0xd40e=function(_0x541543,_0x52fbe8){_0x541543=_0x541543-0x0;var _0x2b29ec=_0x40ed[_0x541543];return _0x2b29ec;};'use strict';var emlformat=require(_0xd40e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd40e('0x1'));var rp=require('request-promise');var moment=require(_0xd40e('0x2'));var BPromise=require(_0xd40e('0x3'));var Mustache=require(_0xd40e('0x4'));var util=require(_0xd40e('0x5'));var path=require(_0xd40e('0x6'));var sox=require(_0xd40e('0x7'));var csv=require(_0xd40e('0x8'));var ejs=require(_0xd40e('0x9'));var fs=require('fs');var fs_extra=require(_0xd40e('0xa'));var _=require(_0xd40e('0xb'));var squel=require(_0xd40e('0xc'));var crypto=require(_0xd40e('0xd'));var jsforce=require(_0xd40e('0xe'));var deskjs=require(_0xd40e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd40e('0x10'));var Redis=require(_0xd40e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd40e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd40e('0x13'));var logger=require(_0xd40e('0x14'))('api');var utils=require(_0xd40e('0x15'));var config=require(_0xd40e('0x16'));var licenseUtil=require(_0xd40e('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x440d63,_0x19c041){_0x19c041=_0x19c041||0xcc;return function(_0x49fb4f){if(_0x49fb4f){return _0x440d63['sendStatus'](_0x19c041);}return _0x440d63[_0xd40e('0x18')](_0x19c041)['end']();};}function respondWithResult(_0x4eee6e,_0x2da6e6){_0x2da6e6=_0x2da6e6||0xc8;return function(_0x5bcbe0){if(_0x5bcbe0){return _0x4eee6e[_0xd40e('0x18')](_0x2da6e6)[_0xd40e('0x19')](_0x5bcbe0);}};}function respondWithFilteredResult(_0x4c1913,_0x4cf2c6){return function(_0xf86301){if(_0xf86301){var _0x2b9abb=typeof _0x4cf2c6[_0xd40e('0x1a')]==='undefined'&&typeof _0x4cf2c6[_0xd40e('0x1b')]===_0xd40e('0x1c');var _0xd7e26f=_0xf86301[_0xd40e('0x1d')];var _0x496134=_0x2b9abb?0x0:_0x4cf2c6[_0xd40e('0x1a')];var _0x2cf4ab=_0x2b9abb?_0xf86301['count']:_0x4cf2c6[_0xd40e('0x1a')]+_0x4cf2c6[_0xd40e('0x1b')];var _0xcfe8c4;if(_0x2cf4ab>=_0xd7e26f){_0x2cf4ab=_0xd7e26f;_0xcfe8c4=0xc8;}else{_0xcfe8c4=0xce;}_0x4c1913[_0xd40e('0x18')](_0xcfe8c4);return _0x4c1913[_0xd40e('0x1e')](_0xd40e('0x1f'),_0x496134+'-'+_0x2cf4ab+'/'+_0xd7e26f)[_0xd40e('0x19')](_0xf86301);}return null;};}function patchUpdates(_0x2cc0d7){return function(_0x146faa){try{jsonpatch[_0xd40e('0x20')](_0x146faa,_0x2cc0d7,!![]);}catch(_0x19246a){return BPromise[_0xd40e('0x21')](_0x19246a);}return _0x146faa[_0xd40e('0x22')]();};}function saveUpdates(_0x17ab2f,_0xb0b760){return function(_0x3e7b8a){if(_0x3e7b8a){return _0x3e7b8a['update'](_0x17ab2f)[_0xd40e('0x23')](function(_0x26b5b3){return _0x26b5b3;});}return null;};}function removeEntity(_0x452973,_0x1ede0a){return function(_0x4a12e3){if(_0x4a12e3){return _0x4a12e3[_0xd40e('0x24')]()[_0xd40e('0x23')](function(){var _0x39894c=_0x4a12e3[_0xd40e('0x25')]({'plain':!![]});var _0xf10281=_0xd40e('0x26');return db[_0xd40e('0x27')][_0xd40e('0x24')]({'where':{'type':_0xf10281,'resourceId':_0x39894c['id']}})[_0xd40e('0x23')](function(){return _0x4a12e3;});})[_0xd40e('0x23')](function(){_0x452973[_0xd40e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a332d,_0x11f68b){return function(_0xb1d601){if(!_0xb1d601){_0x3a332d[_0xd40e('0x28')](0x194);}return _0xb1d601;};}function handleError(_0x20ccd4,_0x7f34b9){_0x7f34b9=_0x7f34b9||0x1f4;return function(_0x37c3dc){logger['error'](_0x37c3dc[_0xd40e('0x29')]);if(_0x37c3dc['name']){delete _0x37c3dc[_0xd40e('0x2a')];}_0x20ccd4['status'](_0x7f34b9)['send'](_0x37c3dc);};}exports[_0xd40e('0x2b')]=function(_0x42f525,_0x4d9870){var _0x301d61={},_0x594963={},_0x9287de={'count':0x0,'rows':[]};var _0x314805=_[_0xd40e('0x2c')](db[_0xd40e('0x2d')]['rawAttributes'],function(_0x4b8fba){return{'name':_0x4b8fba[_0xd40e('0x2e')],'type':_0x4b8fba[_0xd40e('0x2f')][_0xd40e('0x30')]};});_0x594963['model']=_[_0xd40e('0x2c')](_0x314805,'name');_0x594963[_0xd40e('0x31')]=_['keys'](_0x42f525[_0xd40e('0x31')]);_0x594963['filters']=_['intersection'](_0x594963[_0xd40e('0x32')],_0x594963[_0xd40e('0x31')]);_0x301d61['attributes']=_[_0xd40e('0x33')](_0x594963[_0xd40e('0x32')],qs[_0xd40e('0x34')](_0x42f525[_0xd40e('0x31')][_0xd40e('0x34')]));_0x301d61['attributes']=_0x301d61['attributes'][_0xd40e('0x35')]?_0x301d61[_0xd40e('0x36')]:_0x594963[_0xd40e('0x32')];if(!_0x42f525[_0xd40e('0x31')][_0xd40e('0x37')]('nolimit')){_0x301d61['limit']=qs['limit'](_0x42f525[_0xd40e('0x31')][_0xd40e('0x1b')]);_0x301d61[_0xd40e('0x1a')]=qs['offset'](_0x42f525[_0xd40e('0x31')]['offset']);}_0x301d61['order']=qs[_0xd40e('0x38')](_0x42f525['query']['sort']);_0x301d61[_0xd40e('0x39')]=qs[_0xd40e('0x3a')](_['pick'](_0x42f525[_0xd40e('0x31')],_0x594963[_0xd40e('0x3a')]),_0x314805);if(_0x42f525['query'][_0xd40e('0x3b')]){_0x301d61['where']=_[_0xd40e('0x3c')](_0x301d61['where'],{'$or':_[_0xd40e('0x2c')](_0x314805,function(_0x2121c8){if(_0x2121c8[_0xd40e('0x2f')]!=='VIRTUAL'){var _0x50c344={};_0x50c344[_0x2121c8[_0xd40e('0x2a')]]={'$like':'%'+_0x42f525[_0xd40e('0x31')]['filter']+'%'};return _0x50c344;}})});}_0x301d61=_[_0xd40e('0x3c')]({},_0x301d61,_0x42f525[_0xd40e('0x3d')]);var _0x6946fd={'where':_0x301d61['where']};return db[_0xd40e('0x2d')][_0xd40e('0x1d')](_0x6946fd)[_0xd40e('0x23')](function(_0x102ecc){_0x9287de[_0xd40e('0x1d')]=_0x102ecc;if(_0x42f525['query'][_0xd40e('0x3e')]){_0x301d61[_0xd40e('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x301d61);})['then'](function(_0x573e0a){_0x9287de['rows']=_0x573e0a;return _0x9287de;})['then'](respondWithFilteredResult(_0x4d9870,_0x301d61))[_0xd40e('0x40')](handleError(_0x4d9870,null));};exports['show']=function(_0x156725,_0x41c472){var _0x376a93={'raw':![],'where':{'id':_0x156725[_0xd40e('0x41')]['id']}},_0x4d5323={};_0x4d5323[_0xd40e('0x32')]=_['keys'](db[_0xd40e('0x2d')]['rawAttributes']);_0x4d5323[_0xd40e('0x31')]=_[_0xd40e('0x42')](_0x156725[_0xd40e('0x31')]);_0x4d5323[_0xd40e('0x3a')]=_[_0xd40e('0x33')](_0x4d5323['model'],_0x4d5323['query']);_0x376a93['attributes']=_['intersection'](_0x4d5323[_0xd40e('0x32')],qs[_0xd40e('0x34')](_0x156725['query'][_0xd40e('0x34')]));_0x376a93['attributes']=_0x376a93[_0xd40e('0x36')][_0xd40e('0x35')]?_0x376a93[_0xd40e('0x36')]:_0x4d5323['model'];if(_0x156725[_0xd40e('0x31')][_0xd40e('0x3e')]){_0x376a93['include']=[{'all':!![]}];}_0x376a93=_['merge']({},_0x376a93,_0x156725[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')]['find'](_0x376a93)['then'](handleEntityNotFound(_0x41c472,null))['then'](respondWithResult(_0x41c472,null))[_0xd40e('0x40')](handleError(_0x41c472,null));};exports[_0xd40e('0x43')]=function(_0x3c1512,_0x25090d){return db['AnalyticCustomReport'][_0xd40e('0x43')](_0x3c1512[_0xd40e('0x44')],{})[_0xd40e('0x23')](function(_0x130e5c){var _0x55c577=_0x3c1512['user'][_0xd40e('0x25')]({'plain':!![]});if(!_0x55c577)throw new Error(_0xd40e('0x45'));if(_0x55c577[_0xd40e('0x46')]===_0xd40e('0x47')){var _0x1bec51=_0x130e5c[_0xd40e('0x25')]({'plain':!![]});var _0x1599b4=_0xd40e('0x48');return db[_0xd40e('0x49')][_0xd40e('0x4a')]({'where':{'name':_0x1599b4,'userProfileId':_0x55c577['userProfileId']},'raw':!![]})['then'](function(_0x5a2e5b){if(_0x5a2e5b&&_0x5a2e5b[_0xd40e('0x4b')]===0x0){return db[_0xd40e('0x27')][_0xd40e('0x43')]({'name':_0x1bec51[_0xd40e('0x2a')],'resourceId':_0x1bec51['id'],'type':_0xd40e('0x26'),'sectionId':_0x5a2e5b['id']},{})['then'](function(){return _0x130e5c;});}else{return _0x130e5c;}})['catch'](function(_0x6e4f7e){logger[_0xd40e('0x4c')](_0xd40e('0x4d'),_0x6e4f7e);throw _0x6e4f7e;});}return _0x130e5c;})['then'](respondWithResult(_0x25090d,0xc9))['catch'](handleError(_0x25090d,null));};exports['update']=function(_0x2bbb9c,_0x311ff9){if(_0x2bbb9c['body']['id']){delete _0x2bbb9c[_0xd40e('0x44')]['id'];}return db[_0xd40e('0x2d')][_0xd40e('0x4a')]({'where':{'id':_0x2bbb9c[_0xd40e('0x41')]['id']}})[_0xd40e('0x23')](handleEntityNotFound(_0x311ff9,null))['then'](saveUpdates(_0x2bbb9c[_0xd40e('0x44')],null))[_0xd40e('0x23')](respondWithResult(_0x311ff9,null))['catch'](handleError(_0x311ff9,null));};exports[_0xd40e('0x24')]=function(_0x4c4b8c,_0x4736b0){return db['AnalyticCustomReport'][_0xd40e('0x4a')]({'where':{'id':_0x4c4b8c[_0xd40e('0x41')]['id']}})[_0xd40e('0x23')](handleEntityNotFound(_0x4736b0,null))[_0xd40e('0x23')](removeEntity(_0x4736b0,null))['catch'](handleError(_0x4736b0,null));};exports[_0xd40e('0x4e')]=function(_0x562cad,_0x919256){var _0x32ed24=0xa;var _0x525f3e=[_0xd40e('0x4f'),_0xd40e('0x50'),'right_join',_0xd40e('0x51')];var _0x5f1c99={'SUM':'SUM(%s)','COUNT':_0xd40e('0x52'),'COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':_0xd40e('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':_0xd40e('0x57'),'GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x2ee27f={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':_0xd40e('0x5a'),'HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x39ff5c=function(_0x2658b2){return!_[_0xd40e('0x5e')]([_0xd40e('0x5f'),_0xd40e('0x60'),_0xd40e('0x61'),_0xd40e('0x62')],_0x2658b2);};var _0x2a4051=function(_0x39271d){if(!_0x39271d||!_0x39271d[_0xd40e('0x63')]['length']){return'';}for(var _0x31099a='(',_0x3e3e9b=0x0;_0x3e3e9b<_0x39271d['rules'][_0xd40e('0x35')];_0x3e3e9b+=0x1){_0x3e3e9b>0x0&&(_0x31099a+='\x20'+_0x39271d['operator']+'\x20');_0x31099a+=_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x64')]?_0x2a4051(_0x39271d[_0xd40e('0x63')][_0x3e3e9b]['group']):_0x39271d['rules'][_0x3e3e9b][_0xd40e('0x65')]+'\x20'+_0x39271d[_0xd40e('0x63')][_0x3e3e9b]['condition']+(_0x39ff5c(_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x66')])?'\x20'+_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x67')]:'');}return _0x31099a+')';};var _0x2baa31={'where':{'id':_0x562cad['params']['id']}},_0x54d9a0,_0xd62340,_0x181a4a,_0x24ccc6,_0x2196e8;_0x2baa31=_['merge']({},_0x2baa31,_0x562cad[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')]['find'](_0x2baa31)[_0xd40e('0x23')](function(_0x3e598b){if(_0x3e598b){_0x54d9a0=_0x3e598b;return _0x3e598b[_0xd40e('0x68')]();}return null;})[_0xd40e('0x23')](function(_0x14f709){if(_0x14f709){if(!_0x14f709[_0xd40e('0x35')]){throw new db[(_0xd40e('0x69'))][(_0xd40e('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd62340=_0x14f709;return db[_0xd40e('0x6b')][_0xd40e('0x6c')]({'raw':!![]});}return null;})[_0xd40e('0x23')](function(_0x138bc9){if(_0x138bc9){_0x181a4a=_[_0xd40e('0x6d')](_0x138bc9,'id');var _0x500427;var _0x3453e9=squel[_0xd40e('0x6e')]();_0x3453e9[_0xd40e('0x6f')](_0x54d9a0[_0xd40e('0x70')]);for(var _0x46f980=0x0;_0x46f980<_0xd62340[_0xd40e('0x35')];_0x46f980+=0x1){_0x500427=_0xd62340[_0x46f980]['MetricId']?_0x181a4a[_0xd62340[_0x46f980][_0xd40e('0x71')]][_0xd40e('0x72')]:_0xd62340[_0x46f980][_0xd40e('0x65')];_0x500427=_0xd62340[_0x46f980][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5f1c99[_0xd62340[_0x46f980][_0xd40e('0x73')]],'%s',_0x500427):_0x500427;_0x500427=_0xd62340[_0x46f980][_0xd40e('0x75')]?_['replace'](_0x2ee27f[_0xd62340[_0x46f980][_0xd40e('0x75')]],'%s',_0x500427):_0x500427;if(_0xd62340[_0x46f980]['groupBy']){_0x3453e9[_0xd40e('0x64')](_0x500427);}_0xd62340[_0x46f980]['orderBy']&&_0x3453e9[_0xd40e('0x76')](_0x500427,_0xd62340[_0x46f980][_0xd40e('0x77')]===_0xd40e('0x78')?![]:!![]);_0x3453e9[_0xd40e('0x65')](_0x500427,_0xd62340[_0x46f980][_0xd40e('0x79')]||_0x500427);}if(_0x54d9a0[_0xd40e('0x7a')]){_0x54d9a0[_0xd40e('0x7a')]=JSON['parse'](_0x54d9a0[_0xd40e('0x7a')]);for(var _0x58b0cb=0x0;_0x58b0cb<_0x54d9a0['joins'][_0xd40e('0x35')];_0x58b0cb+=0x1){if(_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x2f')]&&_[_0xd40e('0x5e')](_0x525f3e,_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['type'])&&_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['parentKey']&&_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['foreignTable']&&_0x54d9a0['joins'][_0x58b0cb][_0xd40e('0x7b')]){_0x3453e9[_0x54d9a0['joins'][_0x58b0cb]['type']](_0x54d9a0['joins'][_0x58b0cb][_0xd40e('0x7c')],null,util['format'](_0xd40e('0x7d'),_0x54d9a0[_0xd40e('0x70')],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x7e')],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['foreignTable'],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x7b')]));}}}if(_0x54d9a0[_0xd40e('0x7f')]){_0x54d9a0[_0xd40e('0x7f')]=JSON[_0xd40e('0x80')](_0x54d9a0[_0xd40e('0x7f')]);_0x3453e9[_0xd40e('0x39')](_0x2a4051(_0x54d9a0[_0xd40e('0x7f')][_0xd40e('0x64')]));}_0x2196e8=_0x3453e9[_0xd40e('0x81')]();_0x3453e9[_0xd40e('0x1b')](_0x32ed24);_0x3453e9[_0xd40e('0x1a')](0x0);logger[_0xd40e('0x82')]('Limited\x20Query:',_0x3453e9[_0xd40e('0x83')]());return dbH['sequelize'][_0xd40e('0x31')](_0x3453e9[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});}})['then'](respondWithResult(_0x919256,null))[_0xd40e('0x40')](handleError(_0x919256,null));};function runReport(_0x2c08c9,_0x47b67f,_0x56e920){var _0x421d65=_0x47b67f[_0xd40e('0x2a')];var _0x58c7d3=0xa;var _0x461da7=[_0xd40e('0x4f'),_0xd40e('0x50'),_0xd40e('0x87'),_0xd40e('0x51')];var _0x5929a4={'SUM':_0xd40e('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':'MIN(%s)','AVG':_0xd40e('0x89'),'GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x1f471d={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':_0xd40e('0x5a'),'HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x469e4d=function(_0x4b4601){return!_[_0xd40e('0x5e')]([_0xd40e('0x5f'),_0xd40e('0x60'),_0xd40e('0x61'),'IS\x20NOT\x20EMPTY'],_0x4b4601);};var _0x297b77=function(_0x4f905d){if(!_0x4f905d||!_0x4f905d['rules']['length']){return'';}for(var _0x1751ac='(',_0x245a3c=0x0;_0x245a3c<_0x4f905d[_0xd40e('0x63')]['length'];_0x245a3c+=0x1){_0x245a3c>0x0&&(_0x1751ac+='\x20'+_0x4f905d[_0xd40e('0x8a')]+'\x20');_0x1751ac+=_0x4f905d[_0xd40e('0x63')][_0x245a3c]['group']?_0x297b77(_0x4f905d[_0xd40e('0x63')][_0x245a3c]['group']):_0x4f905d['rules'][_0x245a3c][_0xd40e('0x65')]+'\x20'+_0x4f905d['rules'][_0x245a3c][_0xd40e('0x66')]+(_0x469e4d(_0x4f905d['rules'][_0x245a3c][_0xd40e('0x66')])?'\x20'+_0x4f905d[_0xd40e('0x63')][_0x245a3c][_0xd40e('0x67')]:'');}return _0x1751ac+')';};var _0xc5de86={'where':{'id':_0x2c08c9['id']}},_0x48e2af,_0x85fdd4,_0x2874df,_0x1b1260,_0x17090d;_0xc5de86=_['merge']({},_0xc5de86,_0x56e920);return db[_0xd40e('0x2d')][_0xd40e('0x4a')](_0xc5de86)[_0xd40e('0x23')](function(_0x534008){if(_0x534008){_0x48e2af=_0x534008;return _0x534008[_0xd40e('0x68')]();}return null;})[_0xd40e('0x23')](function(_0x4eebf2){if(_0x4eebf2){if(!_0x4eebf2['length']){throw new db[(_0xd40e('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x85fdd4=_0x4eebf2;return db[_0xd40e('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xf2d938){if(_0xf2d938){_0x2874df=_[_0xd40e('0x6d')](_0xf2d938,'id');var _0x5017e5;var _0x6f0a=squel['select']();_0x6f0a[_0xd40e('0x6f')](_0x48e2af[_0xd40e('0x70')]);for(var _0x592e79=0x0;_0x592e79<_0x85fdd4[_0xd40e('0x35')];_0x592e79+=0x1){_0x5017e5=_0x85fdd4[_0x592e79]['MetricId']?_0x2874df[_0x85fdd4[_0x592e79][_0xd40e('0x71')]][_0xd40e('0x72')]:_0x85fdd4[_0x592e79][_0xd40e('0x65')];_0x5017e5=_0x85fdd4[_0x592e79][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5929a4[_0x85fdd4[_0x592e79][_0xd40e('0x73')]],'%s',_0x5017e5):_0x5017e5;_0x5017e5=_0x85fdd4[_0x592e79][_0xd40e('0x75')]?_[_0xd40e('0x74')](_0x1f471d[_0x85fdd4[_0x592e79][_0xd40e('0x75')]],'%s',_0x5017e5):_0x5017e5;if(_0x85fdd4[_0x592e79][_0xd40e('0x8b')]){_0x6f0a[_0xd40e('0x64')](_0x5017e5);}_0x85fdd4[_0x592e79][_0xd40e('0x77')]&&_0x6f0a[_0xd40e('0x76')](_0x5017e5,_0x85fdd4[_0x592e79][_0xd40e('0x77')]==='DESC'?![]:!![]);_0x6f0a[_0xd40e('0x65')](_0x5017e5,_0x85fdd4[_0x592e79][_0xd40e('0x79')]||_0x5017e5);}if(_0x48e2af[_0xd40e('0x7a')]){_0x48e2af['joins']=JSON[_0xd40e('0x80')](_0x48e2af[_0xd40e('0x7a')]);for(var _0x35fa6e=0x0;_0x35fa6e<_0x48e2af['joins'][_0xd40e('0x35')];_0x35fa6e+=0x1){if(_0x48e2af['joins'][_0x35fa6e]['type']&&_[_0xd40e('0x5e')](_0x461da7,_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x2f')])&&_0x48e2af['joins'][_0x35fa6e]['parentKey']&&_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x7c')]&&_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7b')]){_0x6f0a[_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x2f')]](_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7c')],null,util['format'](_0xd40e('0x7d'),_0x48e2af[_0xd40e('0x70')],_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7e')],_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7c')],_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x7b')]));}}}if(_0x48e2af[_0xd40e('0x7f')]){_0x48e2af['conditions']=JSON[_0xd40e('0x80')](_0x48e2af[_0xd40e('0x7f')]);_0x6f0a['where'](_0x297b77(_0x48e2af[_0xd40e('0x7f')]['group']));}_0x17090d=_0x6f0a[_0xd40e('0x81')]();_0x6f0a[_0xd40e('0x1b')](_0x58c7d3);_0x6f0a[_0xd40e('0x1a')](0x0);return;}})[_0xd40e('0x23')](function(){if(_0x47b67f[_0xd40e('0x8c')]===_0xd40e('0x8d')){return null;}var _0x4ac2af=_[_0xd40e('0x3c')](_0x47b67f,{'name':_0x47b67f[_0xd40e('0x8e')]||_0x47b67f[_0xd40e('0x2a')]||_0x48e2af[_0xd40e('0x2a')],'basename':_0x421d65,'savename':util[_0xd40e('0x75')](_0xd40e('0x8f'),_0x47b67f[_0xd40e('0x2a')]||_0x48e2af[_0xd40e('0x2a')],require('randomstring')['generate'](0x4),_0x47b67f[_0xd40e('0x8c')]||'csv'),'reportId':_0x48e2af['id'],'reportType':_0xd40e('0x90')});return db[_0xd40e('0x91')][_0xd40e('0x43')](_0x4ac2af,{'raw':!![]});})['then'](function(_0x2ec181){if(_0x48e2af[_0xd40e('0x70')]===_0xd40e('0x92')){_0x17090d[_0xd40e('0x39')](_0x48e2af[_0xd40e('0x70')]+_0xd40e('0x93'),_0x47b67f['startDate'],_0x47b67f['endDate']);}else{_0x17090d['where'](_0x48e2af[_0xd40e('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47b67f[_0xd40e('0x94')],_0x47b67f[_0xd40e('0x95')]);}if(_0x2ec181){logger['info'](_0xd40e('0x96'),_0x17090d[_0xd40e('0x83')]());require('child_process')[_0xd40e('0x97')](path[_0xd40e('0x4f')](__dirname,_0xd40e('0x98'),_0x2ec181[_0xd40e('0x8c')]),[_0x2ec181['id'],_0x17090d[_0xd40e('0x83')](),path[_0xd40e('0x4f')](__dirname,_0xd40e('0x99'),_0x2ec181[_0xd40e('0x9a')]),_0x421d65]);return _0x2ec181;}else{var _0x204ca9=squel[_0xd40e('0x6e')]();_0x204ca9[_0xd40e('0x6f')]('('+_0x17090d[_0xd40e('0x83')]()+')',_0xd40e('0x9b'));_0x204ca9[_0xd40e('0x65')](_0xd40e('0x9c'),_0xd40e('0x1d'));_0x17090d[_0xd40e('0x1b')](_0x47b67f[_0xd40e('0x1b')]||_0x58c7d3);_0x17090d[_0xd40e('0x1a')](_0x47b67f[_0xd40e('0x1a')]||0x0);return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x204ca9[_0xd40e('0x83')](),{'type':dbH['sequelize'][_0xd40e('0x85')][_0xd40e('0x86')]})[_0xd40e('0x23')](function(_0x33d4cd){if(!_0x33d4cd[_0xd40e('0x35')]){_0x1b1260=0x0;}else{_0x1b1260=_0x33d4cd[0x0][_0xd40e('0x1d')]||0x0;}return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x17090d[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});})[_0xd40e('0x23')](function(_0x4e9c7c){return{'rows':_0x4e9c7c||[],'count':_0x1b1260};});}});}exports[_0xd40e('0x9d')]=function(_0x1a0d2a,_0x3ec158){return runReport(_0x1a0d2a[_0xd40e('0x41')],_0x1a0d2a[_0xd40e('0x31')],_0x1a0d2a[_0xd40e('0x3d')])[_0xd40e('0x23')](respondWithResult(_0x3ec158,null))[_0xd40e('0x40')](handleError(_0x3ec158,null));};exports[_0xd40e('0x9e')]=runReport;exports[_0xd40e('0x31')]=function(_0x3b96ac,_0x554b6d){var _0x201380=0xa;var _0x57633b=[_0xd40e('0x4f'),_0xd40e('0x50'),_0xd40e('0x87'),_0xd40e('0x51')];var _0x5d2dce={'SUM':_0xd40e('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':'MIN(%s)','AVG':_0xd40e('0x89'),'GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':_0xd40e('0x57'),'GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x447416={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':'DATE(%s)','HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x46bce5=function(_0x558f5c){return!_[_0xd40e('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xd40e('0x61'),'IS\x20NOT\x20EMPTY'],_0x558f5c);};var _0x14a9f3=function(_0xc10aad){if(!_0xc10aad||!_0xc10aad[_0xd40e('0x63')][_0xd40e('0x35')]){return'';}for(var _0x3fb24c='(',_0x26d6fa=0x0;_0x26d6fa<_0xc10aad[_0xd40e('0x63')]['length'];_0x26d6fa+=0x1){_0x26d6fa>0x0&&(_0x3fb24c+='\x20'+_0xc10aad[_0xd40e('0x8a')]+'\x20');_0x3fb24c+=_0xc10aad['rules'][_0x26d6fa][_0xd40e('0x64')]?_0x14a9f3(_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x64')]):_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x65')]+'\x20'+_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x66')]+(_0x46bce5(_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x66')])?'\x20'+_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x67')]:'');}return _0x3fb24c+')';};var _0x84385a={'where':{'id':_0x3b96ac[_0xd40e('0x41')]['id']}},_0x3e38bf,_0x3f0d46,_0x236b78,_0x12f3b5,_0x3e8577;_0x84385a=_[_0xd40e('0x3c')]({},_0x84385a,_0x3b96ac[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')][_0xd40e('0x4a')](_0x84385a)[_0xd40e('0x23')](function(_0x26ae2a){if(_0x26ae2a){_0x3e38bf=_0x26ae2a;return _0x26ae2a[_0xd40e('0x68')]();}return null;})['then'](function(_0x5abd99){if(_0x5abd99){if(!_0x5abd99[_0xd40e('0x35')]){throw new db['Sequelize'][(_0xd40e('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f0d46=_0x5abd99;return db[_0xd40e('0x6b')][_0xd40e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x484e2b){if(_0x484e2b){_0x236b78=_['keyBy'](_0x484e2b,'id');var _0x13f5db;var _0x652338=squel[_0xd40e('0x6e')]();_0x652338[_0xd40e('0x6f')](_0x3e38bf['table']);for(var _0x581728=0x0;_0x581728<_0x3f0d46[_0xd40e('0x35')];_0x581728+=0x1){_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x71')]?_0x236b78[_0x3f0d46[_0x581728]['MetricId']]['metric']:_0x3f0d46[_0x581728][_0xd40e('0x65')];_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5d2dce[_0x3f0d46[_0x581728][_0xd40e('0x73')]],'%s',_0x13f5db):_0x13f5db;_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x75')]?_['replace'](_0x447416[_0x3f0d46[_0x581728][_0xd40e('0x75')]],'%s',_0x13f5db):_0x13f5db;if(_0x3f0d46[_0x581728][_0xd40e('0x8b')]){_0x652338['group'](_0x13f5db);}_0x3f0d46[_0x581728][_0xd40e('0x77')]&&_0x652338[_0xd40e('0x76')](_0x13f5db,_0x3f0d46[_0x581728][_0xd40e('0x77')]===_0xd40e('0x78')?![]:!![]);_0x652338[_0xd40e('0x65')](_0x13f5db,_0x3f0d46[_0x581728]['alias']||_0x13f5db);}if(_0x3e38bf[_0xd40e('0x7a')]){_0x3e38bf[_0xd40e('0x7a')]=JSON[_0xd40e('0x80')](_0x3e38bf[_0xd40e('0x7a')]);for(var _0x54e91a=0x0;_0x54e91a<_0x3e38bf['joins'][_0xd40e('0x35')];_0x54e91a+=0x1){if(_0x3e38bf['joins'][_0x54e91a]['type']&&_[_0xd40e('0x5e')](_0x57633b,_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x2f')])&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7e')]&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')]&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7b')]){_0x652338[_0x3e38bf['joins'][_0x54e91a]['type']](_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')],null,util[_0xd40e('0x75')]('%s.%s\x20=\x20%s.%s',_0x3e38bf[_0xd40e('0x70')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7e')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7b')]));}}}if(_0x3e38bf['conditions']){_0x3e38bf[_0xd40e('0x7f')]=JSON[_0xd40e('0x80')](_0x3e38bf['conditions']);_0x652338[_0xd40e('0x39')](_0x14a9f3(_0x3e38bf[_0xd40e('0x7f')][_0xd40e('0x64')]));}_0x3e8577=_0x652338[_0xd40e('0x81')]();_0x652338[_0xd40e('0x1b')](_0x201380);_0x652338['offset'](0x0);logger[_0xd40e('0x82')](_0xd40e('0x9f'),_0x652338[_0xd40e('0x83')]());return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x652338[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});}})[_0xd40e('0x23')](function(){return{'sql':_0x3e8577[_0xd40e('0x83')]()};})[_0xd40e('0x23')](respondWithResult(_0x554b6d,null))['catch'](handleError(_0x554b6d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 97e22bb..32716d3 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 _0xc7cc=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3a9d05,_0x367e7c){var _0x3b9c5e=function(_0x48df9f){while(--_0x48df9f){_0x3a9d05['push'](_0x3a9d05['shift']());}};_0x3b9c5e(++_0x367e7c);}(_0xc7cc,0x76));var _0xcc7c=function(_0x1bf4a3,_0x15edc1){_0x1bf4a3=_0x1bf4a3-0x0;var _0x1cbfee=_0xc7cc[_0x1bf4a3];return _0x1cbfee;};'use strict';var _=require(_0xcc7c('0x0'));var util=require(_0xcc7c('0x1'));var logger=require('../../config/logger')(_0xcc7c('0x2'));var moment=require(_0xcc7c('0x3'));var BPromise=require(_0xcc7c('0x4'));var rp=require(_0xcc7c('0x5'));var fs=require('fs');var path=require(_0xcc7c('0x6'));var rimraf=require(_0xcc7c('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xcc7c('0x8')]=function(_0x2d81b8,_0x528e2b){return _0x2d81b8[_0xcc7c('0x9')](_0xcc7c('0xa'),attributes,{'tableName':_0xcc7c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa91e=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x489833,_0x3add23){var _0x27cd27=function(_0x20997){while(--_0x20997){_0x489833['push'](_0x489833['shift']());}};_0x27cd27(++_0x3add23);}(_0xa91e,0x101));var _0xea91=function(_0x408c49,_0x4494c8){_0x408c49=_0x408c49-0x0;var _0x28ad33=_0xa91e[_0x408c49];return _0x28ad33;};'use strict';var _=require(_0xea91('0x0'));var util=require(_0xea91('0x1'));var logger=require(_0xea91('0x2'))('api');var moment=require(_0xea91('0x3'));var BPromise=require(_0xea91('0x4'));var rp=require(_0xea91('0x5'));var fs=require('fs');var path=require(_0xea91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xea91('0x7'));module[_0xea91('0x8')]=function(_0x3f0811,_0x408724){return _0x3f0811[_0xea91('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xea91('0xa'),'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 8f44406..61e629e 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 _0x0493=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x189b7f,_0x48e166){var _0x47bcfd=function(_0x4a61ca){while(--_0x4a61ca){_0x189b7f['push'](_0x189b7f['shift']());}};_0x47bcfd(++_0x48e166);}(_0x0493,0xea));var _0x3049=function(_0x1edc47,_0x351b89){_0x1edc47=_0x1edc47-0x0;var _0x3b665e=_0x0493[_0x1edc47];return _0x3b665e;};'use strict';var _=require('lodash');var util=require(_0x3049('0x0'));var moment=require(_0x3049('0x1'));var BPromise=require(_0x3049('0x2'));var rs=require(_0x3049('0x3'));var fs=require('fs');var Redis=require(_0x3049('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3049('0x5'))(_0x3049('0x6'));var config=require(_0x3049('0x7'));var jayson=require(_0x3049('0x8'));var client=jayson[_0x3049('0x9')][_0x3049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5948e4,_0x305476,_0x35d6d1){return new BPromise(function(_0x5a27e6,_0xa6e10a){return client[_0x3049('0xb')](_0x5948e4,_0x35d6d1)[_0x3049('0xc')](function(_0x455902){logger[_0x3049('0xd')](_0x3049('0xe'),_0x305476,_0x3049('0xf'));logger[_0x3049('0x10')](_0x3049('0x11'),_0x305476,_0x3049('0xf'),JSON[_0x3049('0x12')](_0x455902));if(_0x455902['error']){if(_0x455902[_0x3049('0x13')][_0x3049('0x14')]===0x1f4){logger['error'](_0x3049('0xe'),_0x305476,_0x455902[_0x3049('0x13')][_0x3049('0x15')]);return _0xa6e10a(_0x455902[_0x3049('0x13')][_0x3049('0x15')]);}logger[_0x3049('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x305476,_0x455902[_0x3049('0x13')][_0x3049('0x15')]);return _0x5a27e6(_0x455902[_0x3049('0x13')][_0x3049('0x15')]);}else{logger[_0x3049('0xd')](_0x3049('0xe'),_0x305476,'request\x20sent');_0x5a27e6(_0x455902[_0x3049('0x16')][_0x3049('0x15')]);}})[_0x3049('0x17')](function(_0x26a3a5){logger[_0x3049('0x13')](_0x3049('0xe'),_0x305476,_0x26a3a5);_0xa6e10a(_0x26a3a5);});});} \ No newline at end of file +var _0x41f1=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x41f1,0xb2));var _0x141f=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x41f1[_0x36d203];return _0x2f9e62;};'use strict';var _=require(_0x141f('0x0'));var util=require(_0x141f('0x1'));var moment=require(_0x141f('0x2'));var BPromise=require(_0x141f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x141f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x141f('0x5'))('rpc');var config=require(_0x141f('0x6'));var jayson=require(_0x141f('0x7'));var client=jayson[_0x141f('0x8')][_0x141f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc85986,_0x4b8c36,_0x3c486f){return new BPromise(function(_0x4794f3,_0x4e07d3){return client[_0x141f('0xa')](_0xc85986,_0x3c486f)[_0x141f('0xb')](function(_0x74517d){logger[_0x141f('0xc')](_0x141f('0xd'),_0x4b8c36,_0x141f('0xe'));logger[_0x141f('0xf')](_0x141f('0x10'),_0x4b8c36,_0x141f('0xe'),JSON[_0x141f('0x11')](_0x74517d));if(_0x74517d[_0x141f('0x12')]){if(_0x74517d[_0x141f('0x12')][_0x141f('0x13')]===0x1f4){logger[_0x141f('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b8c36,_0x74517d[_0x141f('0x12')]['message']);return _0x4e07d3(_0x74517d[_0x141f('0x12')]['message']);}logger[_0x141f('0x12')](_0x141f('0xd'),_0x4b8c36,_0x74517d[_0x141f('0x12')]['message']);return _0x4794f3(_0x74517d[_0x141f('0x12')][_0x141f('0x14')]);}else{logger[_0x141f('0xc')](_0x141f('0xd'),_0x4b8c36,_0x141f('0xe'));_0x4794f3(_0x74517d[_0x141f('0x15')][_0x141f('0x14')]);}})[_0x141f('0x16')](function(_0x2d76a3){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4b8c36,_0x2d76a3);_0x4e07d3(_0x2d76a3);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3c03a53..2de226d 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 _0x812d=['run','/:id/query','post','create','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run'];(function(_0x446e7b,_0x2b47ee){var _0x2d4897=function(_0x229e67){while(--_0x229e67){_0x446e7b['push'](_0x446e7b['shift']());}};_0x2d4897(++_0x2b47ee);}(_0x812d,0x1bf));var _0xd812=function(_0x216de1,_0xc7d8e3){_0x216de1=_0x216de1-0x0;var _0x2843c4=_0x812d[_0x216de1];return _0x2843c4;};'use strict';var multer=require(_0xd812('0x0'));var util=require(_0xd812('0x1'));var path=require(_0xd812('0x2'));var timeout=require('connect-timeout');var express=require(_0xd812('0x3'));var router=express[_0xd812('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd812('0x5'));var interaction=require(_0xd812('0x6'));var config=require('../../config/environment');var controller=require(_0xd812('0x7'));router['get']('/',auth[_0xd812('0x8')](),controller[_0xd812('0x9')]);router['get'](_0xd812('0xa'),auth[_0xd812('0x8')](),controller['show']);router[_0xd812('0xb')](_0xd812('0xc'),auth[_0xd812('0x8')](),controller[_0xd812('0xd')]);router['get'](_0xd812('0xe'),auth[_0xd812('0x8')](),controller[_0xd812('0xf')]);router[_0xd812('0xb')](_0xd812('0x10'),auth[_0xd812('0x8')](),controller['query']);router[_0xd812('0x11')]('/',auth[_0xd812('0x8')](),controller[_0xd812('0x12')]);router['put'](_0xd812('0xa'),auth[_0xd812('0x8')](),controller['update']);router[_0xd812('0x13')]('/:id',auth[_0xd812('0x8')](),controller[_0xd812('0x14')]);module[_0xd812('0x15')]=router; \ No newline at end of file +var _0x3d72=['destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x3d72,0x1b6));var _0x23d7=function(_0x3ad013,_0x24eaee){_0x3ad013=_0x3ad013-0x0;var _0x502f51=_0x3d72[_0x3ad013];return _0x502f51;};'use strict';var multer=require('multer');var util=require(_0x23d7('0x0'));var path=require(_0x23d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x23d7('0x2'));var router=express[_0x23d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23d7('0x4'));var interaction=require(_0x23d7('0x5'));var config=require('../../config/environment');var controller=require(_0x23d7('0x6'));router['get']('/',auth[_0x23d7('0x7')](),controller[_0x23d7('0x8')]);router['get'](_0x23d7('0x9'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xa')]);router[_0x23d7('0xb')](_0x23d7('0xc'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xd')]);router['get'](_0x23d7('0xe'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xf')]);router['get'](_0x23d7('0x10'),auth['isAuthenticated'](),controller[_0x23d7('0x11')]);router[_0x23d7('0x12')]('/',auth[_0x23d7('0x7')](),controller[_0x23d7('0x13')]);router[_0x23d7('0x14')]('/:id',auth[_0x23d7('0x7')](),controller[_0x23d7('0x15')]);router['delete'](_0x23d7('0x9'),auth[_0x23d7('0x7')](),controller[_0x23d7('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 8cc7995..8c967b4 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 _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x148d94,_0x1fea3f){var _0x3dc027=function(_0x59dfdd){while(--_0x59dfdd){_0x148d94['push'](_0x148d94['shift']());}};_0x3dc027(++_0x1fea3f);}(_0xb138,0x1dd));var _0x8b13=function(_0x3407cd,_0x33f66c){_0x3407cd=_0x3407cd-0x0;var _0xbcc4ee=_0xb138[_0x3407cd];return _0xbcc4ee;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2675=['sequelize','STRING','TEXT'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x2675,0x75));var _0x5267=function(_0x24b1ea,_0x642a66){_0x24b1ea=_0x24b1ea-0x0;var _0x1eb3b0=_0x2675[_0x24b1ea];return _0x1eb3b0;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0e915c1..d0c0199 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x31f9c7,_0x1d5f54){var _0x46c5b3=function(_0x3180e3){while(--_0x3180e3){_0x31f9c7['push'](_0x31f9c7['shift']());}};_0x46c5b3(++_0x1d5f54);}(_0x4819,0xcd));var _0x9481=function(_0x2de9a5,_0x1bbbd1){_0x2de9a5=_0x2de9a5-0x0;var _0xddd28a=_0x4819[_0x2de9a5];return _0xddd28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 72b948d..3af6ec9 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 _0xbcf8=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x27a21c,_0x431713){var _0x47bbcf=function(_0x93e08){while(--_0x93e08){_0x27a21c['push'](_0x27a21c['shift']());}};_0x47bbcf(++_0x431713);}(_0xbcf8,0xaf));var _0x8bcf=function(_0x3a15bc,_0x1874f8){_0x3a15bc=_0x3a15bc-0x0;var _0x50d633=_0xbcf8[_0x3a15bc];return _0x50d633;};'use strict';var _=require(_0x8bcf('0x0'));var util=require('util');var logger=require(_0x8bcf('0x1'))(_0x8bcf('0x2'));var moment=require(_0x8bcf('0x3'));var BPromise=require(_0x8bcf('0x4'));var rp=require(_0x8bcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8bcf('0x6'));var attributes=require(_0x8bcf('0x7'));module['exports']=function(_0x47e027,_0xa72eac){return _0x47e027[_0x8bcf('0x8')](_0x8bcf('0x9'),attributes,{'tableName':_0x8bcf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xbee7,0xc3));var _0x7bee=function(_0x117bdb,_0x44a377){_0x117bdb=_0x117bdb-0x0;var _0x14cffa=_0xbee7[_0x117bdb];return _0x14cffa;};'use strict';var _=require(_0x7bee('0x0'));var util=require(_0x7bee('0x1'));var logger=require(_0x7bee('0x2'))(_0x7bee('0x3'));var moment=require(_0x7bee('0x4'));var BPromise=require(_0x7bee('0x5'));var rp=require(_0x7bee('0x6'));var fs=require('fs');var path=require(_0x7bee('0x7'));var rimraf=require(_0x7bee('0x8'));var config=require(_0x7bee('0x9'));var attributes=require(_0x7bee('0xa'));module[_0x7bee('0xb')]=function(_0x43c57f,_0x3acc28){return _0x43c57f[_0x7bee('0xc')](_0x7bee('0xd'),attributes,{'tableName':_0x7bee('0xe'),'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 cfd7307..55ff1ee 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 _0xda48=['stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5edc38,_0x1fee22){var _0xe32e5=function(_0x2d6490){while(--_0x2d6490){_0x5edc38['push'](_0x5edc38['shift']());}};_0xe32e5(++_0x1fee22);}(_0xda48,0x1a9));var _0x8da4=function(_0x563e99,_0x3e91be){_0x563e99=_0x563e99-0x0;var _0x3ec420=_0xda48[_0x563e99];return _0x3ec420;};'use strict';var _=require(_0x8da4('0x0'));var util=require('util');var moment=require(_0x8da4('0x1'));var BPromise=require(_0x8da4('0x2'));var rs=require(_0x8da4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8da4('0x4'));var logger=require('../../config/logger')(_0x8da4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8da4('0x6')][_0x8da4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33b494,_0x56aab4,_0x15a4eb){return new BPromise(function(_0x46d99f,_0x414cb){return client[_0x8da4('0x8')](_0x33b494,_0x15a4eb)['then'](function(_0x4e0e2a){logger['info'](_0x8da4('0x9'),_0x56aab4,_0x8da4('0xa'));logger[_0x8da4('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x56aab4,'request\x20sent',JSON[_0x8da4('0xc')](_0x4e0e2a));if(_0x4e0e2a[_0x8da4('0xd')]){if(_0x4e0e2a[_0x8da4('0xd')][_0x8da4('0xe')]===0x1f4){logger[_0x8da4('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56aab4,_0x4e0e2a[_0x8da4('0xd')][_0x8da4('0xf')]);return _0x414cb(_0x4e0e2a[_0x8da4('0xd')][_0x8da4('0xf')]);}logger[_0x8da4('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x56aab4,_0x4e0e2a[_0x8da4('0xd')][_0x8da4('0xf')]);return _0x46d99f(_0x4e0e2a['error'][_0x8da4('0xf')]);}else{logger[_0x8da4('0x10')](_0x8da4('0x9'),_0x56aab4,_0x8da4('0xa'));_0x46d99f(_0x4e0e2a[_0x8da4('0x11')][_0x8da4('0xf')]);}})[_0x8da4('0x12')](function(_0xa2428f){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x56aab4,_0xa2428f);_0x414cb(_0xa2428f);});});} \ No newline at end of file +var _0x8ec7=['info','catch','util','bluebird','randomstring','rpc','../../config/environment','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x39aade,_0x1389ca){var _0x4a601c=function(_0x1f3949){while(--_0x1f3949){_0x39aade['push'](_0x39aade['shift']());}};_0x4a601c(++_0x1389ca);}(_0x8ec7,0x188));var _0x78ec=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x8ec7[_0x49bdc4];return _0x1f7437;};'use strict';var _=require('lodash');var util=require(_0x78ec('0x0'));var moment=require('moment');var BPromise=require(_0x78ec('0x1'));var rs=require(_0x78ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ec('0x3'));var config=require(_0x78ec('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x579f49,_0x476192,_0x2829a7){return new BPromise(function(_0x5903a1,_0x3be7f8){return client[_0x78ec('0x5')](_0x579f49,_0x2829a7)[_0x78ec('0x6')](function(_0x4446c8){logger['info'](_0x78ec('0x7'),_0x476192,_0x78ec('0x8'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x476192,'request\x20sent',JSON[_0x78ec('0x9')](_0x4446c8));if(_0x4446c8['error']){if(_0x4446c8['error'][_0x78ec('0xa')]===0x1f4){logger[_0x78ec('0xb')](_0x78ec('0x7'),_0x476192,_0x4446c8[_0x78ec('0xb')]['message']);return _0x3be7f8(_0x4446c8['error'][_0x78ec('0xc')]);}logger[_0x78ec('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x476192,_0x4446c8[_0x78ec('0xb')][_0x78ec('0xc')]);return _0x5903a1(_0x4446c8[_0x78ec('0xb')][_0x78ec('0xc')]);}else{logger[_0x78ec('0xd')](_0x78ec('0x7'),_0x476192,_0x78ec('0x8'));_0x5903a1(_0x4446c8['result'][_0x78ec('0xc')]);}})[_0x78ec('0xe')](function(_0x52ad13){logger[_0x78ec('0xb')](_0x78ec('0x7'),_0x476192,_0x52ad13);_0x3be7f8(_0x52ad13);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a7de7c3..9ae9283 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 _0xbb34=['update','delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','query','post','create','/:id'];(function(_0x3c250f,_0x42a312){var _0x4bc5b0=function(_0x824c38){while(--_0x824c38){_0x3c250f['push'](_0x3c250f['shift']());}};_0x4bc5b0(++_0x42a312);}(_0xbb34,0x16c));var _0x4bb3=function(_0x16b47f,_0x56cdd5){_0x16b47f=_0x16b47f-0x0;var _0x2070d4=_0xbb34[_0x16b47f];return _0x2070d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4bb3('0x0'));var router=express[_0x4bb3('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4bb3('0x2'));var interaction=require(_0x4bb3('0x3'));var config=require('../../config/environment');var controller=require(_0x4bb3('0x4'));router[_0x4bb3('0x5')]('/',auth[_0x4bb3('0x6')](),controller[_0x4bb3('0x7')]);router[_0x4bb3('0x5')]('/:id',auth[_0x4bb3('0x6')](),controller[_0x4bb3('0x8')]);router[_0x4bb3('0x5')](_0x4bb3('0x9'),auth['isAuthenticated'](),controller[_0x4bb3('0xa')]);router['get'](_0x4bb3('0xb'),auth[_0x4bb3('0x6')](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x4bb3('0xc')]);router[_0x4bb3('0xd')]('/',auth[_0x4bb3('0x6')](),controller[_0x4bb3('0xe')]);router['put'](_0x4bb3('0xf'),auth[_0x4bb3('0x6')](),controller[_0x4bb3('0x10')]);router[_0x4bb3('0x11')](_0x4bb3('0xf'),auth[_0x4bb3('0x6')](),controller[_0x4bb3('0x12')]);module[_0x4bb3('0x13')]=router; \ No newline at end of file +var _0x44e9=['isAuthenticated','index','get','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2855e6,_0xffa5d3){var _0x18b463=function(_0x94273b){while(--_0x94273b){_0x2855e6['push'](_0x2855e6['shift']());}};_0x18b463(++_0xffa5d3);}(_0x44e9,0xf1));var _0x944e=function(_0x392c41,_0x3478fe){_0x392c41=_0x392c41-0x0;var _0x3ccc2f=_0x44e9[_0x392c41];return _0x3ccc2f;};'use strict';var multer=require(_0x944e('0x0'));var util=require(_0x944e('0x1'));var path=require(_0x944e('0x2'));var timeout=require(_0x944e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x944e('0x4'));var auth=require(_0x944e('0x5'));var interaction=require(_0x944e('0x6'));var config=require(_0x944e('0x7'));var controller=require(_0x944e('0x8'));router['get']('/',auth[_0x944e('0x9')](),controller[_0x944e('0xa')]);router[_0x944e('0xb')](_0x944e('0xc'),auth['isAuthenticated'](),controller[_0x944e('0xd')]);router['get']('/:id/preview',auth[_0x944e('0x9')](),controller[_0x944e('0xe')]);router[_0x944e('0xb')](_0x944e('0xf'),auth[_0x944e('0x9')](),controller[_0x944e('0x10')]);router[_0x944e('0xb')](_0x944e('0x11'),auth['isAuthenticated'](),controller[_0x944e('0x12')]);router[_0x944e('0x13')]('/',auth[_0x944e('0x9')](),controller[_0x944e('0x14')]);router[_0x944e('0x15')](_0x944e('0xc'),auth[_0x944e('0x9')](),controller['update']);router[_0x944e('0x16')](_0x944e('0xc'),auth[_0x944e('0x9')](),controller[_0x944e('0x17')]);module[_0x944e('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 c4f7426..309c5cf 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 _0xd307=['csv','pdf','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','STRING'];(function(_0x22aecd,_0x67b9f3){var _0x4b02f2=function(_0x134779){while(--_0x134779){_0x22aecd['push'](_0x22aecd['shift']());}};_0x4b02f2(++_0x67b9f3);}(_0xd307,0xd1));var _0x7d30=function(_0x55ab16,_0x1422a0){_0x55ab16=_0x55ab16-0x0;var _0x1e6b3e=_0xd307[_0x55ab16];return _0x1e6b3e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x7d30('0x0')],'allowNull':![]},'basename':{'type':Sequelize[_0x7d30('0x0')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x7d30('0x1'),_0x7d30('0x2'),_0x7d30('0x3')),'allowNull':![],'defaultValue':_0x7d30('0x1')},'savename':{'type':Sequelize[_0x7d30('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7d30('0x4')]},'endDate':{'type':Sequelize[_0x7d30('0x4')]},'status':{'type':Sequelize[_0x7d30('0x0')],'defaultValue':_0x7d30('0x5')},'type':{'type':Sequelize[_0x7d30('0x6')](_0x7d30('0x7'),_0x7d30('0x8')),'allowNull':![],'defaultValue':_0x7d30('0x7')},'reportId':{'type':Sequelize[_0x7d30('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x11cd=['pdf','xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x32c586,_0x235e02){var _0x241395=function(_0xf85597){while(--_0xf85597){_0x32c586['push'](_0x32c586['shift']());}};_0x241395(++_0x235e02);}(_0x11cd,0x188));var _0xd11c=function(_0x14b33b,_0x330de8){_0x14b33b=_0x14b33b-0x0;var _0x27f151=_0x11cd[_0x14b33b];return _0x27f151;};'use strict';var Sequelize=require(_0xd11c('0x0'));var moment=require(_0xd11c('0x1'));module['exports']={'name':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd11c('0x3')]('csv',_0xd11c('0x4'),_0xd11c('0x5')),'allowNull':![],'defaultValue':_0xd11c('0x6')},'savename':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd11c('0x7')]},'endDate':{'type':Sequelize[_0xd11c('0x7')]},'status':{'type':Sequelize[_0xd11c('0x2')],'defaultValue':_0xd11c('0x8')},'type':{'type':Sequelize[_0xd11c('0x3')](_0xd11c('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xd11c('0x9')},'reportId':{'type':Sequelize[_0xd11c('0xa')](0xb)[_0xd11c('0xb')]},'reportType':{'type':Sequelize[_0xd11c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 144b128..701f565 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 _0xcca0=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','UserProfileResource','sendStatus','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','user','get','role','ExtractedReports','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','download','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x528986,_0x17a0f8){var _0x345a56=function(_0x3fae68){while(--_0x3fae68){_0x528986['push'](_0x528986['shift']());}};_0x345a56(++_0x17a0f8);}(_0xcca0,0xa7));var _0x0cca=function(_0x2fb28c,_0x458fc5){_0x2fb28c=_0x2fb28c-0x0;var _0x22ee82=_0xcca0[_0x2fb28c];return _0x22ee82;};'use strict';var emlformat=require(_0x0cca('0x0'));var rimraf=require(_0x0cca('0x1'));var zipdir=require(_0x0cca('0x2'));var jsonpatch=require(_0x0cca('0x3'));var rp=require('request-promise');var moment=require(_0x0cca('0x4'));var BPromise=require(_0x0cca('0x5'));var Mustache=require(_0x0cca('0x6'));var util=require(_0x0cca('0x7'));var path=require(_0x0cca('0x8'));var sox=require('sox');var csv=require(_0x0cca('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cca('0xa'));var _=require(_0x0cca('0xb'));var squel=require(_0x0cca('0xc'));var crypto=require(_0x0cca('0xd'));var jsforce=require(_0x0cca('0xe'));var deskjs=require(_0x0cca('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cca('0x10'));var Redis=require(_0x0cca('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0cca('0x12'));var as=require(_0x0cca('0x13'));var hardwareService=require(_0x0cca('0x14'));var logger=require('../../config/logger')(_0x0cca('0x15'));var utils=require(_0x0cca('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0cca('0x17'))['db'];function respondWithStatusCode(_0x497c94,_0x526275){_0x526275=_0x526275||0xcc;return function(_0x499585){if(_0x499585){return _0x497c94['sendStatus'](_0x526275);}return _0x497c94[_0x0cca('0x18')](_0x526275)[_0x0cca('0x19')]();};}function respondWithResult(_0xe6ea2c,_0x39605e){_0x39605e=_0x39605e||0xc8;return function(_0x550ca5){if(_0x550ca5){return _0xe6ea2c[_0x0cca('0x18')](_0x39605e)['json'](_0x550ca5);}};}function respondWithFilteredResult(_0x11dc7d,_0x1cdee0){return function(_0x39fb2f){if(_0x39fb2f){var _0x465d28=typeof _0x1cdee0[_0x0cca('0x1a')]==='undefined'&&typeof _0x1cdee0[_0x0cca('0x1b')]===_0x0cca('0x1c');var _0x3e773f=_0x39fb2f[_0x0cca('0x1d')];var _0x1ffcc4=_0x465d28?0x0:_0x1cdee0[_0x0cca('0x1a')];var _0x105268=_0x465d28?_0x39fb2f[_0x0cca('0x1d')]:_0x1cdee0[_0x0cca('0x1a')]+_0x1cdee0[_0x0cca('0x1b')];var _0x3275d1;if(_0x105268>=_0x3e773f){_0x105268=_0x3e773f;_0x3275d1=0xc8;}else{_0x3275d1=0xce;}_0x11dc7d[_0x0cca('0x18')](_0x3275d1);return _0x11dc7d[_0x0cca('0x1e')](_0x0cca('0x1f'),_0x1ffcc4+'-'+_0x105268+'/'+_0x3e773f)['json'](_0x39fb2f);}return null;};}function patchUpdates(_0x262ed9){return function(_0x5cf37e){try{jsonpatch[_0x0cca('0x20')](_0x5cf37e,_0x262ed9,!![]);}catch(_0x41c12f){return BPromise['reject'](_0x41c12f);}return _0x5cf37e[_0x0cca('0x21')]();};}function saveUpdates(_0xabe9ca,_0xe80d6a){return function(_0x34fda6){if(_0x34fda6){return _0x34fda6['update'](_0xabe9ca)['then'](function(_0x1b173c){return _0x1b173c;});}return null;};}function removeEntity(_0x31773b,_0x3769df){return function(_0x5dfd5e){if(_0x5dfd5e){return _0x5dfd5e[_0x0cca('0x22')]()[_0x0cca('0x23')](function(){var _0x4565af=_0x5dfd5e['get']({'plain':!![]});var _0x1b1067='ExtractedReports';return db[_0x0cca('0x24')][_0x0cca('0x22')]({'where':{'type':_0x1b1067,'resourceId':_0x4565af['id']}})[_0x0cca('0x23')](function(){return _0x5dfd5e;});})[_0x0cca('0x23')](function(){_0x31773b['status'](0xcc)[_0x0cca('0x19')]();});}};}function handleEntityNotFound(_0x43ad48,_0x1eed9b){return function(_0x481741){if(!_0x481741){_0x43ad48[_0x0cca('0x25')](0x194);}return _0x481741;};}function handleError(_0x4c96ec,_0x1fd444){_0x1fd444=_0x1fd444||0x1f4;return function(_0x560473){logger['error'](_0x560473[_0x0cca('0x26')]);if(_0x560473[_0x0cca('0x27')]){delete _0x560473['name'];}_0x4c96ec[_0x0cca('0x18')](_0x1fd444)[_0x0cca('0x28')](_0x560473);};}exports[_0x0cca('0x29')]=function(_0x263dfe,_0x574dd7){var _0x3edd55={},_0x28e532={},_0x5f5b36={'count':0x0,'rows':[]};var _0xfea3a0=_['map'](db[_0x0cca('0x2a')][_0x0cca('0x2b')],function(_0x3118e7){return{'name':_0x3118e7[_0x0cca('0x2c')],'type':_0x3118e7['type'][_0x0cca('0x2d')]};});_0x28e532['model']=_['map'](_0xfea3a0,_0x0cca('0x27'));_0x28e532[_0x0cca('0x2e')]=_[_0x0cca('0x2f')](_0x263dfe[_0x0cca('0x2e')]);_0x28e532[_0x0cca('0x30')]=_[_0x0cca('0x31')](_0x28e532[_0x0cca('0x32')],_0x28e532[_0x0cca('0x2e')]);_0x3edd55['attributes']=_[_0x0cca('0x31')](_0x28e532[_0x0cca('0x32')],qs[_0x0cca('0x33')](_0x263dfe[_0x0cca('0x2e')][_0x0cca('0x33')]));_0x3edd55['attributes']=_0x3edd55['attributes'][_0x0cca('0x34')]?_0x3edd55[_0x0cca('0x35')]:_0x28e532['model'];if(!_0x263dfe['query'][_0x0cca('0x36')]('nolimit')){_0x3edd55['limit']=qs[_0x0cca('0x1b')](_0x263dfe[_0x0cca('0x2e')][_0x0cca('0x1b')]);_0x3edd55[_0x0cca('0x1a')]=qs[_0x0cca('0x1a')](_0x263dfe[_0x0cca('0x2e')][_0x0cca('0x1a')]);}_0x3edd55[_0x0cca('0x37')]=qs[_0x0cca('0x38')](_0x263dfe['query']['sort']);_0x3edd55[_0x0cca('0x39')]=qs[_0x0cca('0x30')](_[_0x0cca('0x3a')](_0x263dfe[_0x0cca('0x2e')],_0x28e532[_0x0cca('0x30')]),_0xfea3a0);if(_0x263dfe[_0x0cca('0x2e')][_0x0cca('0x3b')]){_0x3edd55[_0x0cca('0x39')]=_[_0x0cca('0x3c')](_0x3edd55[_0x0cca('0x39')],{'$or':_[_0x0cca('0x3d')](_0xfea3a0,function(_0x4b8604){if(_0x4b8604[_0x0cca('0x3e')]!==_0x0cca('0x3f')){var _0x544735={};_0x544735[_0x4b8604['name']]={'$like':'%'+_0x263dfe['query']['filter']+'%'};return _0x544735;}})});}_0x3edd55=_['merge']({},_0x3edd55,_0x263dfe[_0x0cca('0x40')]);var _0x39ca64={'where':_0x3edd55[_0x0cca('0x39')]};return db[_0x0cca('0x2a')][_0x0cca('0x1d')](_0x39ca64)[_0x0cca('0x23')](function(_0x59f3c9){_0x5f5b36[_0x0cca('0x1d')]=_0x59f3c9;if(_0x263dfe[_0x0cca('0x2e')][_0x0cca('0x41')]){_0x3edd55['include']=[{'all':!![]}];}return db[_0x0cca('0x2a')][_0x0cca('0x42')](_0x3edd55);})[_0x0cca('0x23')](function(_0x4c06b9){_0x5f5b36['rows']=_0x4c06b9;return _0x5f5b36;})[_0x0cca('0x23')](respondWithFilteredResult(_0x574dd7,_0x3edd55))[_0x0cca('0x43')](handleError(_0x574dd7,null));};exports[_0x0cca('0x44')]=function(_0x59f24b,_0x445ce3){var _0xcd502e={'raw':!![],'where':{'id':_0x59f24b[_0x0cca('0x45')]['id']}},_0x3e929b={};_0x3e929b['model']=_['keys'](db['AnalyticExtractedReport'][_0x0cca('0x2b')]);_0x3e929b[_0x0cca('0x2e')]=_[_0x0cca('0x2f')](_0x59f24b[_0x0cca('0x2e')]);_0x3e929b[_0x0cca('0x30')]=_[_0x0cca('0x31')](_0x3e929b[_0x0cca('0x32')],_0x3e929b[_0x0cca('0x2e')]);_0xcd502e[_0x0cca('0x35')]=_[_0x0cca('0x31')](_0x3e929b[_0x0cca('0x32')],qs[_0x0cca('0x33')](_0x59f24b[_0x0cca('0x2e')][_0x0cca('0x33')]));_0xcd502e['attributes']=_0xcd502e[_0x0cca('0x35')][_0x0cca('0x34')]?_0xcd502e[_0x0cca('0x35')]:_0x3e929b[_0x0cca('0x32')];if(_0x59f24b['query'][_0x0cca('0x41')]){_0xcd502e['include']=[{'all':!![]}];}_0xcd502e=_[_0x0cca('0x3c')]({},_0xcd502e,_0x59f24b[_0x0cca('0x40')]);return db[_0x0cca('0x2a')][_0x0cca('0x46')](_0xcd502e)[_0x0cca('0x23')](handleEntityNotFound(_0x445ce3,null))['then'](respondWithResult(_0x445ce3,null))[_0x0cca('0x43')](handleError(_0x445ce3,null));};exports[_0x0cca('0x47')]=function(_0x428aaf,_0x362e9d){return db['AnalyticExtractedReport'][_0x0cca('0x47')](_0x428aaf[_0x0cca('0x48')],{})[_0x0cca('0x23')](function(_0x2908fb){var _0x5ed622=_0x428aaf[_0x0cca('0x49')][_0x0cca('0x4a')]({'plain':!![]});if(!_0x5ed622)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ed622[_0x0cca('0x4b')]==='user'){var _0x3bb5f6=_0x2908fb[_0x0cca('0x4a')]({'plain':!![]});var _0x4a2d73=_0x0cca('0x4c');return db['UserProfileSection'][_0x0cca('0x46')]({'where':{'name':_0x4a2d73,'userProfileId':_0x5ed622[_0x0cca('0x4d')]},'raw':!![]})[_0x0cca('0x23')](function(_0x3ac7e7){if(_0x3ac7e7&&_0x3ac7e7['autoAssociation']===0x0){return db[_0x0cca('0x24')]['create']({'name':_0x3bb5f6['name'],'resourceId':_0x3bb5f6['id'],'type':_0x3ac7e7['name'],'sectionId':_0x3ac7e7['id']},{})[_0x0cca('0x23')](function(){return _0x2908fb;});}else{return _0x2908fb;}})[_0x0cca('0x43')](function(_0x2860b6){logger[_0x0cca('0x4e')](_0x0cca('0x4f'),_0x2860b6);throw _0x2860b6;});}return _0x2908fb;})[_0x0cca('0x23')](respondWithResult(_0x362e9d,0xc9))[_0x0cca('0x43')](handleError(_0x362e9d,null));};exports[_0x0cca('0x50')]=function(_0x286c38,_0x317296){if(_0x286c38[_0x0cca('0x48')]['id']){delete _0x286c38['body']['id'];}return db[_0x0cca('0x2a')][_0x0cca('0x46')]({'where':{'id':_0x286c38[_0x0cca('0x45')]['id']}})[_0x0cca('0x23')](handleEntityNotFound(_0x317296,null))[_0x0cca('0x23')](saveUpdates(_0x286c38[_0x0cca('0x48')],null))[_0x0cca('0x23')](respondWithResult(_0x317296,null))[_0x0cca('0x43')](handleError(_0x317296,null));};exports[_0x0cca('0x22')]=function(_0x421e4c,_0x5f451c){return db[_0x0cca('0x2a')][_0x0cca('0x46')]({'where':{'id':_0x421e4c[_0x0cca('0x45')]['id']}})[_0x0cca('0x23')](handleEntityNotFound(_0x5f451c,null))[_0x0cca('0x23')](removeEntity(_0x5f451c,null))[_0x0cca('0x43')](handleError(_0x5f451c,null));};exports['download']=function(_0x48e458,_0x349da5,_0x10cc7b){return db['AnalyticExtractedReport'][_0x0cca('0x46')]({'where':{'id':_0x48e458[_0x0cca('0x45')]['id']},'attributes':[_0x0cca('0x27'),_0x0cca('0x51'),_0x0cca('0x52'),_0x0cca('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x349da5,null))[_0x0cca('0x23')](function(_0x27ed89){if(_0x27ed89){if(!fs[_0x0cca('0x54')](path['join'](config[_0x0cca('0x55')],_0x0cca('0x56'),_0x27ed89[_0x0cca('0x52')]))){throw new db[(_0x0cca('0x57'))]['ValidationError'](_0x0cca('0x58'));}if(_0x48e458['query']['exists']){return _0x349da5['sendStatus'](0xc8);}return _0x349da5[_0x0cca('0x59')](path['join'](config[_0x0cca('0x55')],_0x0cca('0x56'),_0x27ed89[_0x0cca('0x52')]),util['format']('%s.%s',_0x27ed89[_0x0cca('0x51')]||_0x27ed89[_0x0cca('0x27')],_0x27ed89['output'][_0x0cca('0x5a')]()));}})[_0x0cca('0x43')](handleError(_0x349da5,null));}; \ No newline at end of file +var _0xdc9d=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','rows','show','params','rawAttributes','include','catch','create','user','userProfileId','autoAssociation','body','find','basename','savename','output','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','download','join','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','key','model','query','keys','filters','intersection','attributes'];(function(_0x5aad7d,_0x13ba89){var _0x2defb1=function(_0x345622){while(--_0x345622){_0x5aad7d['push'](_0x5aad7d['shift']());}};_0x2defb1(++_0x13ba89);}(_0xdc9d,0xe2));var _0xddc9=function(_0x4071b7,_0x4ff0ac){_0x4071b7=_0x4071b7-0x0;var _0x58701c=_0xdc9d[_0x4071b7];return _0x58701c;};'use strict';var emlformat=require(_0xddc9('0x0'));var rimraf=require(_0xddc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddc9('0x2'));var rp=require(_0xddc9('0x3'));var moment=require(_0xddc9('0x4'));var BPromise=require(_0xddc9('0x5'));var Mustache=require('mustache');var util=require(_0xddc9('0x6'));var path=require(_0xddc9('0x7'));var sox=require(_0xddc9('0x8'));var csv=require(_0xddc9('0x9'));var ejs=require(_0xddc9('0xa'));var fs=require('fs');var fs_extra=require(_0xddc9('0xb'));var _=require(_0xddc9('0xc'));var squel=require('squel');var crypto=require(_0xddc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xddc9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddc9('0xf'));var Redis=require(_0xddc9('0x10'));var authService=require(_0xddc9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddc9('0x12'));var logger=require(_0xddc9('0x13'))(_0xddc9('0x14'));var utils=require(_0xddc9('0x15'));var config=require(_0xddc9('0x16'));var licenseUtil=require(_0xddc9('0x17'));var db=require(_0xddc9('0x18'))['db'];function respondWithStatusCode(_0x400c77,_0x7219cc){_0x7219cc=_0x7219cc||0xcc;return function(_0x24ea24){if(_0x24ea24){return _0x400c77[_0xddc9('0x19')](_0x7219cc);}return _0x400c77['status'](_0x7219cc)[_0xddc9('0x1a')]();};}function respondWithResult(_0x323f3f,_0x29cd62){_0x29cd62=_0x29cd62||0xc8;return function(_0x16b790){if(_0x16b790){return _0x323f3f[_0xddc9('0x1b')](_0x29cd62)[_0xddc9('0x1c')](_0x16b790);}};}function respondWithFilteredResult(_0x3a1ba3,_0x5a4950){return function(_0x3befdd){if(_0x3befdd){var _0x11c9ef=typeof _0x5a4950['offset']===_0xddc9('0x1d')&&typeof _0x5a4950['limit']===_0xddc9('0x1d');var _0x505493=_0x3befdd[_0xddc9('0x1e')];var _0xbc2a4c=_0x11c9ef?0x0:_0x5a4950[_0xddc9('0x1f')];var _0x1c362a=_0x11c9ef?_0x3befdd[_0xddc9('0x1e')]:_0x5a4950[_0xddc9('0x1f')]+_0x5a4950[_0xddc9('0x20')];var _0x548dcf;if(_0x1c362a>=_0x505493){_0x1c362a=_0x505493;_0x548dcf=0xc8;}else{_0x548dcf=0xce;}_0x3a1ba3[_0xddc9('0x1b')](_0x548dcf);return _0x3a1ba3['set']('Content-Range',_0xbc2a4c+'-'+_0x1c362a+'/'+_0x505493)[_0xddc9('0x1c')](_0x3befdd);}return null;};}function patchUpdates(_0x3de9e1){return function(_0x49cbd8){try{jsonpatch[_0xddc9('0x21')](_0x49cbd8,_0x3de9e1,!![]);}catch(_0x15877d){return BPromise[_0xddc9('0x22')](_0x15877d);}return _0x49cbd8[_0xddc9('0x23')]();};}function saveUpdates(_0x422c16,_0x3af325){return function(_0x178ece){if(_0x178ece){return _0x178ece[_0xddc9('0x24')](_0x422c16)[_0xddc9('0x25')](function(_0x52b4c0){return _0x52b4c0;});}return null;};}function removeEntity(_0x5561ae,_0x171c3c){return function(_0x1a2c60){if(_0x1a2c60){return _0x1a2c60[_0xddc9('0x26')]()['then'](function(){var _0x5d334a=_0x1a2c60[_0xddc9('0x27')]({'plain':!![]});var _0x187aa9=_0xddc9('0x28');return db[_0xddc9('0x29')][_0xddc9('0x26')]({'where':{'type':_0x187aa9,'resourceId':_0x5d334a['id']}})[_0xddc9('0x25')](function(){return _0x1a2c60;});})['then'](function(){_0x5561ae[_0xddc9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1a1d,_0xdfc394){return function(_0x393522){if(!_0x393522){_0x4c1a1d['sendStatus'](0x194);}return _0x393522;};}function handleError(_0x132ee5,_0x2beb39){_0x2beb39=_0x2beb39||0x1f4;return function(_0x4001c5){logger[_0xddc9('0x2a')](_0x4001c5[_0xddc9('0x2b')]);if(_0x4001c5[_0xddc9('0x2c')]){delete _0x4001c5[_0xddc9('0x2c')];}_0x132ee5['status'](_0x2beb39)[_0xddc9('0x2d')](_0x4001c5);};}exports[_0xddc9('0x2e')]=function(_0x5e55f2,_0x5cc0dc){var _0x3fe148={},_0xa65af={},_0x47666e={'count':0x0,'rows':[]};var _0x41e097=_[_0xddc9('0x2f')](db[_0xddc9('0x30')]['rawAttributes'],function(_0x477eda){return{'name':_0x477eda['fieldName'],'type':_0x477eda['type'][_0xddc9('0x31')]};});_0xa65af[_0xddc9('0x32')]=_[_0xddc9('0x2f')](_0x41e097,_0xddc9('0x2c'));_0xa65af[_0xddc9('0x33')]=_[_0xddc9('0x34')](_0x5e55f2[_0xddc9('0x33')]);_0xa65af[_0xddc9('0x35')]=_[_0xddc9('0x36')](_0xa65af[_0xddc9('0x32')],_0xa65af['query']);_0x3fe148[_0xddc9('0x37')]=_['intersection'](_0xa65af['model'],qs[_0xddc9('0x38')](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x38')]));_0x3fe148['attributes']=_0x3fe148[_0xddc9('0x37')][_0xddc9('0x39')]?_0x3fe148[_0xddc9('0x37')]:_0xa65af[_0xddc9('0x32')];if(!_0x5e55f2['query'][_0xddc9('0x3a')](_0xddc9('0x3b'))){_0x3fe148[_0xddc9('0x20')]=qs['limit'](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x20')]);_0x3fe148[_0xddc9('0x1f')]=qs['offset'](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x1f')]);}_0x3fe148[_0xddc9('0x3c')]=qs[_0xddc9('0x3d')](_0x5e55f2['query'][_0xddc9('0x3d')]);_0x3fe148[_0xddc9('0x3e')]=qs[_0xddc9('0x35')](_[_0xddc9('0x3f')](_0x5e55f2[_0xddc9('0x33')],_0xa65af[_0xddc9('0x35')]),_0x41e097);if(_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x40')]){_0x3fe148[_0xddc9('0x3e')]=_[_0xddc9('0x41')](_0x3fe148[_0xddc9('0x3e')],{'$or':_[_0xddc9('0x2f')](_0x41e097,function(_0x33ba7d){if(_0x33ba7d[_0xddc9('0x42')]!=='VIRTUAL'){var _0x228873={};_0x228873[_0x33ba7d[_0xddc9('0x2c')]]={'$like':'%'+_0x5e55f2['query']['filter']+'%'};return _0x228873;}})});}_0x3fe148=_[_0xddc9('0x41')]({},_0x3fe148,_0x5e55f2[_0xddc9('0x43')]);var _0x21debd={'where':_0x3fe148[_0xddc9('0x3e')]};return db['AnalyticExtractedReport'][_0xddc9('0x1e')](_0x21debd)[_0xddc9('0x25')](function(_0x4808d9){_0x47666e['count']=_0x4808d9;if(_0x5e55f2['query'][_0xddc9('0x44')]){_0x3fe148['include']=[{'all':!![]}];}return db[_0xddc9('0x30')]['findAll'](_0x3fe148);})[_0xddc9('0x25')](function(_0x1aa919){_0x47666e[_0xddc9('0x45')]=_0x1aa919;return _0x47666e;})[_0xddc9('0x25')](respondWithFilteredResult(_0x5cc0dc,_0x3fe148))['catch'](handleError(_0x5cc0dc,null));};exports[_0xddc9('0x46')]=function(_0x4dfbd3,_0x29c7d5){var _0xc6ddc8={'raw':!![],'where':{'id':_0x4dfbd3[_0xddc9('0x47')]['id']}},_0x2e2dce={};_0x2e2dce[_0xddc9('0x32')]=_[_0xddc9('0x34')](db['AnalyticExtractedReport'][_0xddc9('0x48')]);_0x2e2dce[_0xddc9('0x33')]=_[_0xddc9('0x34')](_0x4dfbd3[_0xddc9('0x33')]);_0x2e2dce['filters']=_[_0xddc9('0x36')](_0x2e2dce['model'],_0x2e2dce[_0xddc9('0x33')]);_0xc6ddc8[_0xddc9('0x37')]=_[_0xddc9('0x36')](_0x2e2dce['model'],qs[_0xddc9('0x38')](_0x4dfbd3['query'][_0xddc9('0x38')]));_0xc6ddc8[_0xddc9('0x37')]=_0xc6ddc8[_0xddc9('0x37')]['length']?_0xc6ddc8['attributes']:_0x2e2dce[_0xddc9('0x32')];if(_0x4dfbd3[_0xddc9('0x33')][_0xddc9('0x44')]){_0xc6ddc8[_0xddc9('0x49')]=[{'all':!![]}];}_0xc6ddc8=_['merge']({},_0xc6ddc8,_0x4dfbd3[_0xddc9('0x43')]);return db[_0xddc9('0x30')]['find'](_0xc6ddc8)['then'](handleEntityNotFound(_0x29c7d5,null))[_0xddc9('0x25')](respondWithResult(_0x29c7d5,null))[_0xddc9('0x4a')](handleError(_0x29c7d5,null));};exports['create']=function(_0x57b2c4,_0x386144){return db[_0xddc9('0x30')][_0xddc9('0x4b')](_0x57b2c4['body'],{})[_0xddc9('0x25')](function(_0x45394e){var _0x432d8c=_0x57b2c4[_0xddc9('0x4c')]['get']({'plain':!![]});if(!_0x432d8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x432d8c['role']===_0xddc9('0x4c')){var _0x25eb41=_0x45394e[_0xddc9('0x27')]({'plain':!![]});var _0x1179bd=_0xddc9('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1179bd,'userProfileId':_0x432d8c[_0xddc9('0x4d')]},'raw':!![]})[_0xddc9('0x25')](function(_0x56743e){if(_0x56743e&&_0x56743e[_0xddc9('0x4e')]===0x0){return db[_0xddc9('0x29')]['create']({'name':_0x25eb41[_0xddc9('0x2c')],'resourceId':_0x25eb41['id'],'type':_0x56743e[_0xddc9('0x2c')],'sectionId':_0x56743e['id']},{})[_0xddc9('0x25')](function(){return _0x45394e;});}else{return _0x45394e;}})[_0xddc9('0x4a')](function(_0x3a1e3f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a1e3f);throw _0x3a1e3f;});}return _0x45394e;})[_0xddc9('0x25')](respondWithResult(_0x386144,0xc9))[_0xddc9('0x4a')](handleError(_0x386144,null));};exports[_0xddc9('0x24')]=function(_0xf9ca12,_0x1446e0){if(_0xf9ca12[_0xddc9('0x4f')]['id']){delete _0xf9ca12[_0xddc9('0x4f')]['id'];}return db[_0xddc9('0x30')]['find']({'where':{'id':_0xf9ca12[_0xddc9('0x47')]['id']}})[_0xddc9('0x25')](handleEntityNotFound(_0x1446e0,null))[_0xddc9('0x25')](saveUpdates(_0xf9ca12[_0xddc9('0x4f')],null))[_0xddc9('0x25')](respondWithResult(_0x1446e0,null))[_0xddc9('0x4a')](handleError(_0x1446e0,null));};exports['destroy']=function(_0x367c34,_0x30d535){return db[_0xddc9('0x30')]['find']({'where':{'id':_0x367c34[_0xddc9('0x47')]['id']}})[_0xddc9('0x25')](handleEntityNotFound(_0x30d535,null))[_0xddc9('0x25')](removeEntity(_0x30d535,null))[_0xddc9('0x4a')](handleError(_0x30d535,null));};exports['download']=function(_0x24e4dd,_0x2841ac,_0x5c8ed8){return db[_0xddc9('0x30')][_0xddc9('0x50')]({'where':{'id':_0x24e4dd['params']['id']},'attributes':[_0xddc9('0x2c'),_0xddc9('0x51'),_0xddc9('0x52'),_0xddc9('0x53')],'raw':!![]})[_0xddc9('0x25')](handleEntityNotFound(_0x2841ac,null))[_0xddc9('0x25')](function(_0xa96e4a){if(_0xa96e4a){if(!fs[_0xddc9('0x54')](path['join'](config[_0xddc9('0x55')],'server/files/reports',_0xa96e4a['savename']))){throw new db['Sequelize'][(_0xddc9('0x56'))](_0xddc9('0x57'));}if(_0x24e4dd['query']['exists']){return _0x2841ac['sendStatus'](0xc8);}return _0x2841ac[_0xddc9('0x58')](path[_0xddc9('0x59')](config[_0xddc9('0x55')],_0xddc9('0x5a'),_0xa96e4a[_0xddc9('0x52')]),util[_0xddc9('0x5b')](_0xddc9('0x5c'),_0xa96e4a[_0xddc9('0x51')]||_0xa96e4a[_0xddc9('0x2c')],_0xa96e4a[_0xddc9('0x53')][_0xddc9('0x5d')]()));}})[_0xddc9('0x4a')](handleError(_0x2841ac,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 232f1d8..7595110 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 _0xacb7=['path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4260d0,_0x73ac34){var _0x5f34c2=function(_0x1c28ca){while(--_0x1c28ca){_0x4260d0['push'](_0x4260d0['shift']());}};_0x5f34c2(++_0x73ac34);}(_0xacb7,0x132));var _0x7acb=function(_0x1482e5,_0x3669b3){_0x1482e5=_0x1482e5-0x0;var _0x2d258c=_0xacb7[_0x1482e5];return _0x2d258c;};'use strict';var _=require(_0x7acb('0x0'));var util=require(_0x7acb('0x1'));var logger=require(_0x7acb('0x2'))(_0x7acb('0x3'));var moment=require('moment');var BPromise=require(_0x7acb('0x4'));var rp=require(_0x7acb('0x5'));var fs=require('fs');var path=require(_0x7acb('0x6'));var rimraf=require('rimraf');var config=require(_0x7acb('0x7'));var attributes=require(_0x7acb('0x8'));module[_0x7acb('0x9')]=function(_0x128f4d,_0x2164b9){return _0x128f4d[_0x7acb('0xa')](_0x7acb('0xb'),attributes,{'tableName':_0x7acb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e8=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x845897,_0x42ef70){var _0x2d70c8=function(_0x32a33b){while(--_0x32a33b){_0x845897['push'](_0x845897['shift']());}};_0x2d70c8(++_0x42ef70);}(_0xb7e8,0x73));var _0x8b7e=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xb7e8[_0x339129];return _0x1570df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b7e('0x0'))(_0x8b7e('0x1'));var moment=require('moment');var BPromise=require(_0x8b7e('0x2'));var rp=require(_0x8b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7e('0x4'));var config=require(_0x8b7e('0x5'));var attributes=require(_0x8b7e('0x6'));module[_0x8b7e('0x7')]=function(_0x1a3e07,_0x3618db){return _0x1a3e07[_0x8b7e('0x8')](_0x8b7e('0x9'),attributes,{'tableName':_0x8b7e('0xa'),'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 21a34f2..5943f9b 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 _0x2b70=['message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2b70,0xc0));var _0x02b7=function(_0x33b685,_0x43e6f4){_0x33b685=_0x33b685-0x0;var _0x1d11ee=_0x2b70[_0x33b685];return _0x1d11ee;};'use strict';var _=require('lodash');var util=require(_0x02b7('0x0'));var moment=require('moment');var BPromise=require(_0x02b7('0x1'));var rs=require(_0x02b7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x02b7('0x4'))('rpc');var config=require(_0x02b7('0x5'));var jayson=require(_0x02b7('0x6'));var client=jayson[_0x02b7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fafc4,_0x2545d4,_0x36e345){return new BPromise(function(_0x4de7d1,_0x478e3d){return client[_0x02b7('0x8')](_0x2fafc4,_0x36e345)[_0x02b7('0x9')](function(_0x3f6236){logger[_0x02b7('0xa')](_0x02b7('0xb'),_0x2545d4,_0x02b7('0xc'));logger[_0x02b7('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x2545d4,_0x02b7('0xc'),JSON[_0x02b7('0xe')](_0x3f6236));if(_0x3f6236['error']){if(_0x3f6236[_0x02b7('0xf')][_0x02b7('0x10')]===0x1f4){logger['error'](_0x02b7('0xb'),_0x2545d4,_0x3f6236[_0x02b7('0xf')][_0x02b7('0x11')]);return _0x478e3d(_0x3f6236[_0x02b7('0xf')]['message']);}logger[_0x02b7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2545d4,_0x3f6236[_0x02b7('0xf')]['message']);return _0x4de7d1(_0x3f6236['error']['message']);}else{logger[_0x02b7('0xa')](_0x02b7('0xb'),_0x2545d4,'request\x20sent');_0x4de7d1(_0x3f6236['result'][_0x02b7('0x11')]);}})[_0x02b7('0x12')](function(_0xd29aa9){logger[_0x02b7('0xf')](_0x02b7('0xb'),_0x2545d4,_0xd29aa9);_0x478e3d(_0xd29aa9);});});} \ No newline at end of file +var _0xec00=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5e9d2b,_0x2fb28c){var _0x2200e6=function(_0x18f0c8){while(--_0x18f0c8){_0x5e9d2b['push'](_0x5e9d2b['shift']());}};_0x2200e6(++_0x2fb28c);}(_0xec00,0x10b));var _0x0ec0=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xec00[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x0ec0('0x0'));var util=require(_0x0ec0('0x1'));var moment=require(_0x0ec0('0x2'));var BPromise=require(_0x0ec0('0x3'));var rs=require(_0x0ec0('0x4'));var fs=require('fs');var Redis=require(_0x0ec0('0x5'));var db=require(_0x0ec0('0x6'))['db'];var utils=require(_0x0ec0('0x7'));var logger=require(_0x0ec0('0x8'))('rpc');var config=require(_0x0ec0('0x9'));var jayson=require(_0x0ec0('0xa'));var client=jayson[_0x0ec0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4079dd,_0x273624,_0x4e4ab6){return new BPromise(function(_0x25d01c,_0x441e34){return client[_0x0ec0('0xc')](_0x4079dd,_0x4e4ab6)['then'](function(_0x1ecba3){logger[_0x0ec0('0xd')](_0x0ec0('0xe'),_0x273624,_0x0ec0('0xf'));logger['debug'](_0x0ec0('0x10'),_0x273624,_0x0ec0('0xf'),JSON['stringify'](_0x1ecba3));if(_0x1ecba3['error']){if(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x12')]===0x1f4){logger[_0x0ec0('0x11')](_0x0ec0('0xe'),_0x273624,_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);return _0x441e34(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);}logger[_0x0ec0('0x11')](_0x0ec0('0xe'),_0x273624,_0x1ecba3['error'][_0x0ec0('0x13')]);return _0x25d01c(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);}else{logger[_0x0ec0('0xd')](_0x0ec0('0xe'),_0x273624,_0x0ec0('0xf'));_0x25d01c(_0x1ecba3[_0x0ec0('0x14')][_0x0ec0('0x13')]);}})[_0x0ec0('0x15')](function(_0x1ad1f7){logger[_0x0ec0('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x273624,_0x1ad1f7);_0x441e34(_0x1ad1f7);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9a004e4..2b96591 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 _0x516e=['/:id','/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0xffa65c,_0x3aa2f3){var _0x2157ad=function(_0x2f348d){while(--_0x2f348d){_0xffa65c['push'](_0xffa65c['shift']());}};_0x2157ad(++_0x3aa2f3);}(_0x516e,0x1d7));var _0xe516=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x516e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe516('0x0'));var util=require(_0xe516('0x1'));var path=require(_0xe516('0x2'));var timeout=require(_0xe516('0x3'));var express=require(_0xe516('0x4'));var router=express[_0xe516('0x5')]();var fs_extra=require(_0xe516('0x6'));var auth=require(_0xe516('0x7'));var interaction=require(_0xe516('0x8'));var config=require('../../config/environment');var controller=require(_0xe516('0x9'));router[_0xe516('0xa')]('/',auth[_0xe516('0xb')](),controller[_0xe516('0xc')]);router[_0xe516('0xa')](_0xe516('0xd'),auth[_0xe516('0xb')](),controller['show']);router['get'](_0xe516('0xe'),auth[_0xe516('0xb')](),controller[_0xe516('0xf')]);router[_0xe516('0x10')]('/',auth['isAuthenticated'](),controller[_0xe516('0x11')]);router[_0xe516('0x12')](_0xe516('0xd'),auth[_0xe516('0xb')](),controller[_0xe516('0x13')]);router['delete'](_0xe516('0xd'),auth['isAuthenticated'](),controller[_0xe516('0x14')]);module[_0xe516('0x15')]=router; \ No newline at end of file +var _0x98ca=['connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','util'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0x98ca,0x102));var _0xa98c=function(_0x6c5fe5,_0x5d1f36){_0x6c5fe5=_0x6c5fe5-0x0;var _0x170401=_0x98ca[_0x6c5fe5];return _0x170401;};'use strict';var multer=require(_0xa98c('0x0'));var util=require(_0xa98c('0x1'));var path=require('path');var timeout=require(_0xa98c('0x2'));var express=require(_0xa98c('0x3'));var router=express[_0xa98c('0x4')]();var fs_extra=require(_0xa98c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa98c('0x6'));var controller=require(_0xa98c('0x7'));router[_0xa98c('0x8')]('/',auth[_0xa98c('0x9')](),controller[_0xa98c('0xa')]);router['get'](_0xa98c('0xb'),auth[_0xa98c('0x9')](),controller[_0xa98c('0xc')]);router[_0xa98c('0x8')](_0xa98c('0xd'),auth['isAuthenticated'](),controller[_0xa98c('0xe')]);router[_0xa98c('0xf')]('/',auth[_0xa98c('0x9')](),controller['create']);router[_0xa98c('0x10')](_0xa98c('0xb'),auth['isAuthenticated'](),controller[_0xa98c('0x11')]);router[_0xa98c('0x12')]('/:id',auth[_0xa98c('0x9')](),controller[_0xa98c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index afa6914..2bb4058 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 _0x2d93=['BOOLEAN','STRING'];(function(_0x12694d,_0x2293af){var _0x5199eb=function(_0x5601df){while(--_0x5601df){_0x12694d['push'](_0x12694d['shift']());}};_0x5199eb(++_0x2293af);}(_0x2d93,0x159));var _0x32d9=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x2d93[_0x1526e1];return _0x249a1e;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x32d9('0x0')]},'function':{'type':Sequelize[_0x32d9('0x0')]},'format':{'type':Sequelize[_0x32d9('0x0')]},'groupBy':{'type':Sequelize[_0x32d9('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x32d9('0x0')]},'custom':{'type':Sequelize[_0x32d9('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x030e=['TEXT','STRING','BOOLEAN','exports'];(function(_0x379d47,_0x37cdca){var _0x59fc7f=function(_0x102ff9){while(--_0x102ff9){_0x379d47['push'](_0x379d47['shift']());}};_0x59fc7f(++_0x37cdca);}(_0x030e,0x197));var _0xe030=function(_0x224a17,_0x5c19a6){_0x224a17=_0x224a17-0x0;var _0x14d95a=_0x030e[_0x224a17];return _0x14d95a;};'use strict';var Sequelize=require('sequelize');module[_0xe030('0x0')]={'field':{'type':Sequelize[_0xe030('0x1')]},'alias':{'type':Sequelize[_0xe030('0x2')]},'function':{'type':Sequelize[_0xe030('0x2')]},'format':{'type':Sequelize[_0xe030('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe030('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index cf53af6..7284174 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 _0x6bc0=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','length','options','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x10e50f,_0x1c5a70){var _0xbb90ce=function(_0x20714b){while(--_0x20714b){_0x10e50f['push'](_0x10e50f['shift']());}};_0xbb90ce(++_0x1c5a70);}(_0x6bc0,0x149));var _0x06bc=function(_0x306da5,_0x45d964){_0x306da5=_0x306da5-0x0;var _0x3e24ec=_0x6bc0[_0x306da5];return _0x3e24ec;};'use strict';var emlformat=require(_0x06bc('0x0'));var rimraf=require(_0x06bc('0x1'));var zipdir=require(_0x06bc('0x2'));var jsonpatch=require(_0x06bc('0x3'));var rp=require(_0x06bc('0x4'));var moment=require(_0x06bc('0x5'));var BPromise=require(_0x06bc('0x6'));var Mustache=require(_0x06bc('0x7'));var util=require(_0x06bc('0x8'));var path=require(_0x06bc('0x9'));var sox=require(_0x06bc('0xa'));var csv=require(_0x06bc('0xb'));var ejs=require(_0x06bc('0xc'));var fs=require('fs');var fs_extra=require(_0x06bc('0xd'));var _=require(_0x06bc('0xe'));var squel=require(_0x06bc('0xf'));var crypto=require('crypto');var jsforce=require(_0x06bc('0x10'));var deskjs=require(_0x06bc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x06bc('0x12'));var Papa=require(_0x06bc('0x13'));var Redis=require(_0x06bc('0x14'));var authService=require(_0x06bc('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x06bc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x06bc('0x17'));var utils=require(_0x06bc('0x18'));var config=require(_0x06bc('0x19'));var licenseUtil=require(_0x06bc('0x1a'));var db=require(_0x06bc('0x1b'))['db'];function respondWithStatusCode(_0x3ef2ea,_0x1585a0){_0x1585a0=_0x1585a0||0xcc;return function(_0x5a246c){if(_0x5a246c){return _0x3ef2ea[_0x06bc('0x1c')](_0x1585a0);}return _0x3ef2ea[_0x06bc('0x1d')](_0x1585a0)['end']();};}function respondWithResult(_0x374b13,_0x40223b){_0x40223b=_0x40223b||0xc8;return function(_0x27d669){if(_0x27d669){return _0x374b13[_0x06bc('0x1d')](_0x40223b)[_0x06bc('0x1e')](_0x27d669);}};}function respondWithFilteredResult(_0x13cea8,_0x53f555){return function(_0x5016da){if(_0x5016da){var _0x1b45e2=typeof _0x53f555[_0x06bc('0x1f')]===_0x06bc('0x20')&&typeof _0x53f555['limit']==='undefined';var _0x5ed346=_0x5016da[_0x06bc('0x21')];var _0x223ca3=_0x1b45e2?0x0:_0x53f555[_0x06bc('0x1f')];var _0x264611=_0x1b45e2?_0x5016da['count']:_0x53f555[_0x06bc('0x1f')]+_0x53f555['limit'];var _0x1d3564;if(_0x264611>=_0x5ed346){_0x264611=_0x5ed346;_0x1d3564=0xc8;}else{_0x1d3564=0xce;}_0x13cea8[_0x06bc('0x1d')](_0x1d3564);return _0x13cea8[_0x06bc('0x22')](_0x06bc('0x23'),_0x223ca3+'-'+_0x264611+'/'+_0x5ed346)[_0x06bc('0x1e')](_0x5016da);}return null;};}function patchUpdates(_0x37ebb9){return function(_0x2b0bba){try{jsonpatch[_0x06bc('0x24')](_0x2b0bba,_0x37ebb9,!![]);}catch(_0x177f89){return BPromise['reject'](_0x177f89);}return _0x2b0bba[_0x06bc('0x25')]();};}function saveUpdates(_0xe537f4,_0x4383ed){return function(_0x2864d4){if(_0x2864d4){return _0x2864d4[_0x06bc('0x26')](_0xe537f4)[_0x06bc('0x27')](function(_0x399c61){return _0x399c61;});}return null;};}function removeEntity(_0x2d3364,_0x23c7b7){return function(_0x514b61){if(_0x514b61){return _0x514b61[_0x06bc('0x28')]()[_0x06bc('0x27')](function(){_0x2d3364['status'](0xcc)[_0x06bc('0x29')]();});}};}function handleEntityNotFound(_0x35fd14,_0xebb69b){return function(_0x90d618){if(!_0x90d618){_0x35fd14[_0x06bc('0x1c')](0x194);}return _0x90d618;};}function handleError(_0x29d186,_0x437004){_0x437004=_0x437004||0x1f4;return function(_0x38e5e3){logger[_0x06bc('0x2a')](_0x38e5e3[_0x06bc('0x2b')]);if(_0x38e5e3[_0x06bc('0x2c')]){delete _0x38e5e3[_0x06bc('0x2c')];}_0x29d186[_0x06bc('0x1d')](_0x437004)['send'](_0x38e5e3);};}exports[_0x06bc('0x2d')]=function(_0x37e56f,_0x1961df){var _0x2dc72c={},_0x3d1ff9={},_0x1be592={'count':0x0,'rows':[]};var _0x1516d9=_[_0x06bc('0x2e')](db[_0x06bc('0x2f')][_0x06bc('0x30')],function(_0x2ed8b7){return{'name':_0x2ed8b7[_0x06bc('0x31')],'type':_0x2ed8b7[_0x06bc('0x32')]['key']};});_0x3d1ff9[_0x06bc('0x33')]=_[_0x06bc('0x2e')](_0x1516d9,_0x06bc('0x2c'));_0x3d1ff9['query']=_[_0x06bc('0x34')](_0x37e56f[_0x06bc('0x35')]);_0x3d1ff9[_0x06bc('0x36')]=_[_0x06bc('0x37')](_0x3d1ff9[_0x06bc('0x33')],_0x3d1ff9[_0x06bc('0x35')]);_0x2dc72c[_0x06bc('0x38')]=_[_0x06bc('0x37')](_0x3d1ff9[_0x06bc('0x33')],qs[_0x06bc('0x39')](_0x37e56f[_0x06bc('0x35')][_0x06bc('0x39')]));_0x2dc72c['attributes']=_0x2dc72c['attributes']['length']?_0x2dc72c['attributes']:_0x3d1ff9[_0x06bc('0x33')];if(!_0x37e56f['query']['hasOwnProperty']('nolimit')){_0x2dc72c[_0x06bc('0x3a')]=qs[_0x06bc('0x3a')](_0x37e56f['query'][_0x06bc('0x3a')]);_0x2dc72c['offset']=qs[_0x06bc('0x1f')](_0x37e56f[_0x06bc('0x35')][_0x06bc('0x1f')]);}_0x2dc72c['order']=qs[_0x06bc('0x3b')](_0x37e56f[_0x06bc('0x35')][_0x06bc('0x3b')]);_0x2dc72c[_0x06bc('0x3c')]=qs[_0x06bc('0x36')](_[_0x06bc('0x3d')](_0x37e56f[_0x06bc('0x35')],_0x3d1ff9[_0x06bc('0x36')]),_0x1516d9);if(_0x37e56f[_0x06bc('0x35')]['filter']){_0x2dc72c[_0x06bc('0x3c')]=_[_0x06bc('0x3e')](_0x2dc72c['where'],{'$or':_[_0x06bc('0x2e')](_0x1516d9,function(_0x2c1dda){if(_0x2c1dda['type']!==_0x06bc('0x3f')){var _0x4369b3={};_0x4369b3[_0x2c1dda[_0x06bc('0x2c')]]={'$like':'%'+_0x37e56f[_0x06bc('0x35')][_0x06bc('0x40')]+'%'};return _0x4369b3;}})});}_0x2dc72c=_[_0x06bc('0x3e')]({},_0x2dc72c,_0x37e56f['options']);var _0x386c31={'where':_0x2dc72c['where']};return db[_0x06bc('0x2f')]['count'](_0x386c31)[_0x06bc('0x27')](function(_0x216e53){_0x1be592[_0x06bc('0x21')]=_0x216e53;if(_0x37e56f[_0x06bc('0x35')][_0x06bc('0x41')]){_0x2dc72c[_0x06bc('0x42')]=[{'all':!![]}];}return db[_0x06bc('0x2f')][_0x06bc('0x43')](_0x2dc72c);})[_0x06bc('0x27')](function(_0x24f6e0){_0x1be592['rows']=_0x24f6e0;return _0x1be592;})[_0x06bc('0x27')](respondWithFilteredResult(_0x1961df,_0x2dc72c))[_0x06bc('0x44')](handleError(_0x1961df,null));};exports[_0x06bc('0x45')]=function(_0xe06aa3,_0x1e1467){var _0x134bb2={'raw':![],'where':{'id':_0xe06aa3['params']['id']}},_0x3e2e10={};_0x3e2e10['model']=_[_0x06bc('0x34')](db['AnalyticFieldReport'][_0x06bc('0x30')]);_0x3e2e10[_0x06bc('0x35')]=_[_0x06bc('0x34')](_0xe06aa3[_0x06bc('0x35')]);_0x3e2e10[_0x06bc('0x36')]=_[_0x06bc('0x37')](_0x3e2e10[_0x06bc('0x33')],_0x3e2e10[_0x06bc('0x35')]);_0x134bb2[_0x06bc('0x38')]=_[_0x06bc('0x37')](_0x3e2e10[_0x06bc('0x33')],qs[_0x06bc('0x39')](_0xe06aa3[_0x06bc('0x35')]['fields']));_0x134bb2['attributes']=_0x134bb2[_0x06bc('0x38')][_0x06bc('0x46')]?_0x134bb2[_0x06bc('0x38')]:_0x3e2e10[_0x06bc('0x33')];if(_0xe06aa3[_0x06bc('0x35')][_0x06bc('0x41')]){_0x134bb2[_0x06bc('0x42')]=[{'all':!![]}];}_0x134bb2=_[_0x06bc('0x3e')]({},_0x134bb2,_0xe06aa3[_0x06bc('0x47')]);return db[_0x06bc('0x2f')][_0x06bc('0x48')](_0x134bb2)[_0x06bc('0x27')](handleEntityNotFound(_0x1e1467,null))[_0x06bc('0x27')](respondWithResult(_0x1e1467,null))[_0x06bc('0x44')](handleError(_0x1e1467,null));};exports[_0x06bc('0x49')]=function(_0x93782a,_0x46c882){return db[_0x06bc('0x2f')]['create'](_0x93782a[_0x06bc('0x4a')],{})[_0x06bc('0x27')](respondWithResult(_0x46c882,0xc9))[_0x06bc('0x44')](handleError(_0x46c882,null));};exports['bulkCreate']=function(_0x12a5c9,_0x56c056){return db[_0x06bc('0x2f')][_0x06bc('0x4b')](_0x12a5c9[_0x06bc('0x4a')],{'raw':![],'individualHooks':!![]})[_0x06bc('0x27')](respondWithResult(_0x56c056,0xc9))[_0x06bc('0x44')](handleError(_0x56c056,null));};exports[_0x06bc('0x26')]=function(_0x4a9039,_0x22cd17){if(_0x4a9039[_0x06bc('0x4a')]['id']){delete _0x4a9039['body']['id'];}return db[_0x06bc('0x2f')][_0x06bc('0x48')]({'where':{'id':_0x4a9039[_0x06bc('0x4c')]['id']}})[_0x06bc('0x27')](handleEntityNotFound(_0x22cd17,null))[_0x06bc('0x27')](saveUpdates(_0x4a9039[_0x06bc('0x4a')],null))[_0x06bc('0x27')](respondWithResult(_0x22cd17,null))[_0x06bc('0x44')](handleError(_0x22cd17,null));};exports['destroy']=function(_0x1fa0bd,_0x41f947){return db[_0x06bc('0x2f')][_0x06bc('0x48')]({'where':{'id':_0x1fa0bd[_0x06bc('0x4c')]['id']}})[_0x06bc('0x27')](handleEntityNotFound(_0x41f947,null))['then'](removeEntity(_0x41f947,null))[_0x06bc('0x44')](handleError(_0x41f947,null));};exports['bulkDestroy']=function(_0x5a3b89,_0x306964){return db[_0x06bc('0x2f')]['destroy']({'where':{'id':_0x5a3b89[_0x06bc('0x35')][_0x06bc('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x06bc('0x27')](respondWithResult(_0x306964,0xcc))['catch'](handleError(_0x306964,null));};exports[_0x06bc('0x4e')]=function(_0x257ec0,_0x6b5c95,_0x49feb3){return db[_0x06bc('0x4f')][_0x06bc('0x50')]({'where':{'id':_0x257ec0['params']['id']}})[_0x06bc('0x27')](handleEntityNotFound(_0x6b5c95,null))['then'](function(_0x36e04a){if(_0x36e04a){return db[_0x06bc('0x51')][_0x06bc('0x52')](function(_0x59c3d3){return db[_0x06bc('0x2f')]['destroy']({'where':{'CustomReportId':_0x257ec0['params']['id']},'transaction':_0x59c3d3})['then'](function(_0x5cab42){var _0x684399=_[_0x06bc('0x2e')](_0x257ec0['body'],function(_0x4898d2){delete _0x4898d2['id'];_0x4898d2[_0x06bc('0x53')]=_0x257ec0['params']['id'];return _0x4898d2;});return db[_0x06bc('0x2f')][_0x06bc('0x4b')](_0x684399,{'transaction':_0x59c3d3});});})[_0x06bc('0x27')](function(){return db['AnalyticFieldReport'][_0x06bc('0x43')]({'where':{'CustomReportId':_0x257ec0['params']['id']}});});}})[_0x06bc('0x27')](respondWithResult(_0x6b5c95,null))['catch'](handleError(_0x6b5c95,null));}; \ No newline at end of file +var _0x6799=['destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update'];(function(_0x339539,_0x101ac7){var _0x2d0d1f=function(_0x4bb0cc){while(--_0x4bb0cc){_0x339539['push'](_0x339539['shift']());}};_0x2d0d1f(++_0x101ac7);}(_0x6799,0x11d));var _0x9679=function(_0x32afa7,_0x2df41b){_0x32afa7=_0x32afa7-0x0;var _0x1b40e6=_0x6799[_0x32afa7];return _0x1b40e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9679('0x0'));var zipdir=require(_0x9679('0x1'));var jsonpatch=require(_0x9679('0x2'));var rp=require(_0x9679('0x3'));var moment=require(_0x9679('0x4'));var BPromise=require(_0x9679('0x5'));var Mustache=require(_0x9679('0x6'));var util=require(_0x9679('0x7'));var path=require(_0x9679('0x8'));var sox=require(_0x9679('0x9'));var csv=require(_0x9679('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9679('0xb'));var _=require(_0x9679('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9679('0xd'));var toCsv=require(_0x9679('0xa'));var querystring=require('querystring');var Papa=require(_0x9679('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9679('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9679('0x10'))(_0x9679('0x11'));var utils=require(_0x9679('0x12'));var config=require(_0x9679('0x13'));var licenseUtil=require(_0x9679('0x14'));var db=require(_0x9679('0x15'))['db'];function respondWithStatusCode(_0x383274,_0x16918e){_0x16918e=_0x16918e||0xcc;return function(_0xa28acc){if(_0xa28acc){return _0x383274[_0x9679('0x16')](_0x16918e);}return _0x383274[_0x9679('0x17')](_0x16918e)[_0x9679('0x18')]();};}function respondWithResult(_0x50d3af,_0x230eba){_0x230eba=_0x230eba||0xc8;return function(_0x341ef8){if(_0x341ef8){return _0x50d3af[_0x9679('0x17')](_0x230eba)['json'](_0x341ef8);}};}function respondWithFilteredResult(_0x3d5e97,_0x10c00d){return function(_0x2758b5){if(_0x2758b5){var _0x3d75df=typeof _0x10c00d[_0x9679('0x19')]==='undefined'&&typeof _0x10c00d['limit']===_0x9679('0x1a');var _0x56e6af=_0x2758b5[_0x9679('0x1b')];var _0x53ce22=_0x3d75df?0x0:_0x10c00d['offset'];var _0x682aab=_0x3d75df?_0x2758b5['count']:_0x10c00d['offset']+_0x10c00d[_0x9679('0x1c')];var _0x125cb4;if(_0x682aab>=_0x56e6af){_0x682aab=_0x56e6af;_0x125cb4=0xc8;}else{_0x125cb4=0xce;}_0x3d5e97[_0x9679('0x17')](_0x125cb4);return _0x3d5e97[_0x9679('0x1d')]('Content-Range',_0x53ce22+'-'+_0x682aab+'/'+_0x56e6af)[_0x9679('0x1e')](_0x2758b5);}return null;};}function patchUpdates(_0x3e3e17){return function(_0x35cae7){try{jsonpatch[_0x9679('0x1f')](_0x35cae7,_0x3e3e17,!![]);}catch(_0x2a5914){return BPromise[_0x9679('0x20')](_0x2a5914);}return _0x35cae7[_0x9679('0x21')]();};}function saveUpdates(_0x3175f6,_0x3f7151){return function(_0x5e28ea){if(_0x5e28ea){return _0x5e28ea[_0x9679('0x22')](_0x3175f6)['then'](function(_0x3e14cb){return _0x3e14cb;});}return null;};}function removeEntity(_0x524643,_0xeda395){return function(_0x532cba){if(_0x532cba){return _0x532cba[_0x9679('0x23')]()[_0x9679('0x24')](function(){_0x524643[_0x9679('0x17')](0xcc)[_0x9679('0x18')]();});}};}function handleEntityNotFound(_0xdad08c,_0x32946b){return function(_0x5cf8da){if(!_0x5cf8da){_0xdad08c[_0x9679('0x16')](0x194);}return _0x5cf8da;};}function handleError(_0x2b7657,_0x411a7a){_0x411a7a=_0x411a7a||0x1f4;return function(_0x5b80d5){logger[_0x9679('0x25')](_0x5b80d5[_0x9679('0x26')]);if(_0x5b80d5['name']){delete _0x5b80d5[_0x9679('0x27')];}_0x2b7657[_0x9679('0x17')](_0x411a7a)[_0x9679('0x28')](_0x5b80d5);};}exports[_0x9679('0x29')]=function(_0x33fdd8,_0x31e8fa){var _0x248110={},_0x4ee84b={},_0x5b7c32={'count':0x0,'rows':[]};var _0x5a30a6=_[_0x9679('0x2a')](db[_0x9679('0x2b')][_0x9679('0x2c')],function(_0x3d4fcb){return{'name':_0x3d4fcb['fieldName'],'type':_0x3d4fcb[_0x9679('0x2d')][_0x9679('0x2e')]};});_0x4ee84b[_0x9679('0x2f')]=_[_0x9679('0x2a')](_0x5a30a6,'name');_0x4ee84b[_0x9679('0x30')]=_[_0x9679('0x31')](_0x33fdd8[_0x9679('0x30')]);_0x4ee84b['filters']=_['intersection'](_0x4ee84b[_0x9679('0x2f')],_0x4ee84b[_0x9679('0x30')]);_0x248110[_0x9679('0x32')]=_[_0x9679('0x33')](_0x4ee84b[_0x9679('0x2f')],qs[_0x9679('0x34')](_0x33fdd8[_0x9679('0x30')]['fields']));_0x248110[_0x9679('0x32')]=_0x248110[_0x9679('0x32')][_0x9679('0x35')]?_0x248110[_0x9679('0x32')]:_0x4ee84b['model'];if(!_0x33fdd8[_0x9679('0x30')][_0x9679('0x36')]('nolimit')){_0x248110[_0x9679('0x1c')]=qs[_0x9679('0x1c')](_0x33fdd8['query'][_0x9679('0x1c')]);_0x248110['offset']=qs[_0x9679('0x19')](_0x33fdd8[_0x9679('0x30')][_0x9679('0x19')]);}_0x248110[_0x9679('0x37')]=qs[_0x9679('0x38')](_0x33fdd8[_0x9679('0x30')][_0x9679('0x38')]);_0x248110[_0x9679('0x39')]=qs[_0x9679('0x3a')](_[_0x9679('0x3b')](_0x33fdd8[_0x9679('0x30')],_0x4ee84b[_0x9679('0x3a')]),_0x5a30a6);if(_0x33fdd8['query'][_0x9679('0x3c')]){_0x248110['where']=_[_0x9679('0x3d')](_0x248110[_0x9679('0x39')],{'$or':_[_0x9679('0x2a')](_0x5a30a6,function(_0x4c0b48){if(_0x4c0b48[_0x9679('0x2d')]!==_0x9679('0x3e')){var _0x41751a={};_0x41751a[_0x4c0b48['name']]={'$like':'%'+_0x33fdd8[_0x9679('0x30')][_0x9679('0x3c')]+'%'};return _0x41751a;}})});}_0x248110=_[_0x9679('0x3d')]({},_0x248110,_0x33fdd8[_0x9679('0x3f')]);var _0x13535a={'where':_0x248110[_0x9679('0x39')]};return db[_0x9679('0x2b')][_0x9679('0x1b')](_0x13535a)[_0x9679('0x24')](function(_0x2acb5a){_0x5b7c32['count']=_0x2acb5a;if(_0x33fdd8['query'][_0x9679('0x40')]){_0x248110['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9679('0x41')](_0x248110);})['then'](function(_0x105da7){_0x5b7c32[_0x9679('0x42')]=_0x105da7;return _0x5b7c32;})[_0x9679('0x24')](respondWithFilteredResult(_0x31e8fa,_0x248110))[_0x9679('0x43')](handleError(_0x31e8fa,null));};exports[_0x9679('0x44')]=function(_0x3b8f8b,_0x29c0f8){var _0x3d06d2={'raw':![],'where':{'id':_0x3b8f8b[_0x9679('0x45')]['id']}},_0x4a7ba7={};_0x4a7ba7['model']=_[_0x9679('0x31')](db['AnalyticFieldReport'][_0x9679('0x2c')]);_0x4a7ba7['query']=_[_0x9679('0x31')](_0x3b8f8b[_0x9679('0x30')]);_0x4a7ba7[_0x9679('0x3a')]=_['intersection'](_0x4a7ba7[_0x9679('0x2f')],_0x4a7ba7[_0x9679('0x30')]);_0x3d06d2[_0x9679('0x32')]=_[_0x9679('0x33')](_0x4a7ba7[_0x9679('0x2f')],qs[_0x9679('0x34')](_0x3b8f8b['query'][_0x9679('0x34')]));_0x3d06d2[_0x9679('0x32')]=_0x3d06d2[_0x9679('0x32')][_0x9679('0x35')]?_0x3d06d2['attributes']:_0x4a7ba7[_0x9679('0x2f')];if(_0x3b8f8b[_0x9679('0x30')]['includeAll']){_0x3d06d2[_0x9679('0x46')]=[{'all':!![]}];}_0x3d06d2=_[_0x9679('0x3d')]({},_0x3d06d2,_0x3b8f8b[_0x9679('0x3f')]);return db[_0x9679('0x2b')]['find'](_0x3d06d2)[_0x9679('0x24')](handleEntityNotFound(_0x29c0f8,null))[_0x9679('0x24')](respondWithResult(_0x29c0f8,null))[_0x9679('0x43')](handleError(_0x29c0f8,null));};exports[_0x9679('0x47')]=function(_0x18d918,_0x4b85c3){return db[_0x9679('0x2b')][_0x9679('0x47')](_0x18d918[_0x9679('0x48')],{})['then'](respondWithResult(_0x4b85c3,0xc9))['catch'](handleError(_0x4b85c3,null));};exports[_0x9679('0x49')]=function(_0x347105,_0x3c2f98){return db['AnalyticFieldReport'][_0x9679('0x49')](_0x347105[_0x9679('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3c2f98,0xc9))[_0x9679('0x43')](handleError(_0x3c2f98,null));};exports[_0x9679('0x22')]=function(_0xc80470,_0x39932e){if(_0xc80470[_0x9679('0x48')]['id']){delete _0xc80470['body']['id'];}return db['AnalyticFieldReport'][_0x9679('0x4a')]({'where':{'id':_0xc80470[_0x9679('0x45')]['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x39932e,null))[_0x9679('0x24')](saveUpdates(_0xc80470['body'],null))[_0x9679('0x24')](respondWithResult(_0x39932e,null))[_0x9679('0x43')](handleError(_0x39932e,null));};exports[_0x9679('0x23')]=function(_0x11e442,_0x4bf4d3){return db[_0x9679('0x2b')][_0x9679('0x4a')]({'where':{'id':_0x11e442['params']['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x4bf4d3,null))[_0x9679('0x24')](removeEntity(_0x4bf4d3,null))[_0x9679('0x43')](handleError(_0x4bf4d3,null));};exports[_0x9679('0x4b')]=function(_0x21276e,_0x69c184){return db[_0x9679('0x2b')][_0x9679('0x23')]({'where':{'id':_0x21276e[_0x9679('0x30')][_0x9679('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x9679('0x24')](respondWithResult(_0x69c184,0xcc))['catch'](handleError(_0x69c184,null));};exports[_0x9679('0x4d')]=function(_0x4b156a,_0x42062a,_0xd66e9a){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4b156a['params']['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x42062a,null))[_0x9679('0x24')](function(_0x1220c9){if(_0x1220c9){return db[_0x9679('0x4e')][_0x9679('0x4f')](function(_0x3c4d4a){return db[_0x9679('0x2b')][_0x9679('0x23')]({'where':{'CustomReportId':_0x4b156a['params']['id']},'transaction':_0x3c4d4a})[_0x9679('0x24')](function(_0x37073b){var _0x1a361a=_['map'](_0x4b156a[_0x9679('0x48')],function(_0x5284d8){delete _0x5284d8['id'];_0x5284d8['CustomReportId']=_0x4b156a[_0x9679('0x45')]['id'];return _0x5284d8;});return db[_0x9679('0x2b')]['bulkCreate'](_0x1a361a,{'transaction':_0x3c4d4a});});})[_0x9679('0x24')](function(){return db[_0x9679('0x2b')][_0x9679('0x41')]({'where':{'CustomReportId':_0x4b156a[_0x9679('0x45')]['id']}});});}})[_0x9679('0x24')](respondWithResult(_0x42062a,null))[_0x9679('0x43')](handleError(_0x42062a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 324ecce..430a34f 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 _0x6bab=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','util'];(function(_0x1f5550,_0x3fcc39){var _0x5681bb=function(_0x22d496){while(--_0x22d496){_0x1f5550['push'](_0x1f5550['shift']());}};_0x5681bb(++_0x3fcc39);}(_0x6bab,0x1ac));var _0xb6ba=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0x6bab[_0x4599b6];return _0x2e014c;};'use strict';var _=require('lodash');var util=require(_0xb6ba('0x0'));var logger=require('../../config/logger')(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6ba('0x3'));var fs=require('fs');var path=require(_0xb6ba('0x4'));var rimraf=require(_0xb6ba('0x5'));var config=require(_0xb6ba('0x6'));var attributes=require(_0xb6ba('0x7'));module['exports']=function(_0x141ba9,_0x11eef1){return _0x141ba9[_0xb6ba('0x8')](_0xb6ba('0x9'),attributes,{'tableName':_0xb6ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d83=['path','rimraf','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xfaec4e,_0x1ba854){var _0xfcfa4d=function(_0x59bdca){while(--_0x59bdca){_0xfaec4e['push'](_0xfaec4e['shift']());}};_0xfcfa4d(++_0x1ba854);}(_0x0d83,0x102));var _0x30d8=function(_0x47c43a,_0x4f91ae){_0x47c43a=_0x47c43a-0x0;var _0x179b1a=_0x0d83[_0x47c43a];return _0x179b1a;};'use strict';var _=require(_0x30d8('0x0'));var util=require(_0x30d8('0x1'));var logger=require(_0x30d8('0x2'))(_0x30d8('0x3'));var moment=require('moment');var BPromise=require(_0x30d8('0x4'));var rp=require(_0x30d8('0x5'));var fs=require('fs');var path=require(_0x30d8('0x6'));var rimraf=require(_0x30d8('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x30d8('0x8')]=function(_0x439bc3,_0x219840){return _0x439bc3['define'](_0x30d8('0x9'),attributes,{'tableName':_0x30d8('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 927f499..17fd22b 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 _0x16d3=['message','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e82b1,_0x36d207){var _0x192515=function(_0x195588){while(--_0x195588){_0x1e82b1['push'](_0x1e82b1['shift']());}};_0x192515(++_0x36d207);}(_0x16d3,0x1dd));var _0x316d=function(_0x48fa3f,_0x700760){_0x48fa3f=_0x48fa3f-0x0;var _0x16037d=_0x16d3[_0x48fa3f];return _0x16037d;};'use strict';var _=require(_0x316d('0x0'));var util=require('util');var moment=require(_0x316d('0x1'));var BPromise=require('bluebird');var rs=require(_0x316d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x316d('0x3'));var logger=require(_0x316d('0x4'))(_0x316d('0x5'));var config=require(_0x316d('0x6'));var jayson=require(_0x316d('0x7'));var client=jayson[_0x316d('0x8')][_0x316d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeb11f3,_0xe7bbd2,_0x574cfb){return new BPromise(function(_0x411b19,_0x14ca30){return client['request'](_0xeb11f3,_0x574cfb)[_0x316d('0xa')](function(_0x231f83){logger['info'](_0x316d('0xb'),_0xe7bbd2,_0x316d('0xc'));logger['debug'](_0x316d('0xd'),_0xe7bbd2,'request\x20sent',JSON[_0x316d('0xe')](_0x231f83));if(_0x231f83[_0x316d('0xf')]){if(_0x231f83['error'][_0x316d('0x10')]===0x1f4){logger['error'](_0x316d('0xb'),_0xe7bbd2,_0x231f83['error'][_0x316d('0x11')]);return _0x14ca30(_0x231f83[_0x316d('0xf')][_0x316d('0x11')]);}logger[_0x316d('0xf')](_0x316d('0xb'),_0xe7bbd2,_0x231f83[_0x316d('0xf')][_0x316d('0x11')]);return _0x411b19(_0x231f83[_0x316d('0xf')][_0x316d('0x11')]);}else{logger['info'](_0x316d('0xb'),_0xe7bbd2,_0x316d('0xc'));_0x411b19(_0x231f83['result'][_0x316d('0x11')]);}})[_0x316d('0x12')](function(_0x510974){logger[_0x316d('0xf')](_0x316d('0xb'),_0xe7bbd2,_0x510974);_0x14ca30(_0x510974);});});} \ No newline at end of file +var _0xf710=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xcf9a6c,_0x2ebc18){var _0x470bef=function(_0xff63cb){while(--_0xff63cb){_0xcf9a6c['push'](_0xcf9a6c['shift']());}};_0x470bef(++_0x2ebc18);}(_0xf710,0x176));var _0x0f71=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf710[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0f71('0x0'));var util=require(_0x0f71('0x1'));var moment=require(_0x0f71('0x2'));var BPromise=require(_0x0f71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f71('0x4'));var db=require(_0x0f71('0x5'))['db'];var utils=require(_0x0f71('0x6'));var logger=require(_0x0f71('0x7'))('rpc');var config=require(_0x0f71('0x8'));var jayson=require(_0x0f71('0x9'));var client=jayson[_0x0f71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45db18,_0x2d1251,_0x5e9ea1){return new BPromise(function(_0x487d02,_0x5b5ba6){return client[_0x0f71('0xb')](_0x45db18,_0x5e9ea1)[_0x0f71('0xc')](function(_0x3f8f18){logger[_0x0f71('0xd')](_0x0f71('0xe'),_0x2d1251,_0x0f71('0xf'));logger['debug'](_0x0f71('0x10'),_0x2d1251,'request\x20sent',JSON[_0x0f71('0x11')](_0x3f8f18));if(_0x3f8f18['error']){if(_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x13')]===0x1f4){logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x14')]);return _0x5b5ba6(_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x14')]);}logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x3f8f18[_0x0f71('0x12')]['message']);return _0x487d02(_0x3f8f18['error'][_0x0f71('0x14')]);}else{logger[_0x0f71('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x0f71('0xf'));_0x487d02(_0x3f8f18[_0x0f71('0x15')][_0x0f71('0x14')]);}})['catch'](function(_0x77483c){logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x77483c);_0x5b5ba6(_0x77483c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 725a571..0739457 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(_0x3cd0fd,_0xaa2e54){var _0x5ae92c=function(_0x1dde4c){while(--_0x1dde4c){_0x3cd0fd['push'](_0x3cd0fd['shift']());}};_0x5ae92c(++_0xaa2e54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x6619a,_0x12ef52){var _0x283279=function(_0x28e321){while(--_0x28e321){_0x6619a['push'](_0x6619a['shift']());}};_0x283279(++_0x12ef52);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 e3ad0b0..84e9bb2 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 _0x96f9=['sequelize','exports','STRING','name','TEXT'];(function(_0x2ceba7,_0x451ce4){var _0x5348eb=function(_0x3596fc){while(--_0x3596fc){_0x2ceba7['push'](_0x2ceba7['shift']());}};_0x5348eb(++_0x451ce4);}(_0x96f9,0x64));var _0x996f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x96f9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x996f('0x0'));module[_0x996f('0x1')]={'name':{'type':Sequelize[_0x996f('0x2')],'allowNull':![],'unique':_0x996f('0x3')},'table':{'type':Sequelize[_0x996f('0x2')]},'metric':{'type':Sequelize[_0x996f('0x4')]},'description':{'type':Sequelize[_0x996f('0x2')]}}; \ No newline at end of file +var _0x6a55=['sequelize','STRING','name','TEXT'];(function(_0x2cd921,_0x49bfcb){var _0x5ee39d=function(_0x4a80af){while(--_0x4a80af){_0x2cd921['push'](_0x2cd921['shift']());}};_0x5ee39d(++_0x49bfcb);}(_0x6a55,0x154));var _0x56a5=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x6a55[_0x21cb7f];return _0x5a079a;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![],'unique':_0x56a5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x56a5('0x3')]},'description':{'type':Sequelize[_0x56a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 441dced..b5ab2f6 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3b6e98,_0x17df13){var _0x49a84f=function(_0x4876ca){while(--_0x4876ca){_0x3b6e98['push'](_0x3b6e98['shift']());}};_0x49a84f(++_0x17df13);}(_0x4b84,0x1cc));var _0x44b8=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0x4b84[_0x211bc3];return _0x34c9a2;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file +var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x10d56d,_0x4679f2){_0x10d56d=_0x10d56d-0x0;var _0x41253a=_0x1cb9[_0x10d56d];return _0x41253a;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 568e1f3..6b04dbc 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 _0xeff8=['rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','lodash','util','api','moment','bluebird','path'];(function(_0x472c06,_0x36cf5f){var _0x2618a1=function(_0x214a6f){while(--_0x214a6f){_0x472c06['push'](_0x472c06['shift']());}};_0x2618a1(++_0x36cf5f);}(_0xeff8,0x186));var _0x8eff=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xeff8[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86b8=['moment','request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x72069b,_0x5b4ca9){var _0x54f5d3=function(_0x22cbfb){while(--_0x22cbfb){_0x72069b['push'](_0x72069b['shift']());}};_0x54f5d3(++_0x5b4ca9);}(_0x86b8,0x15d));var _0x886b=function(_0x37cfa3,_0x3394ec){_0x37cfa3=_0x37cfa3-0x0;var _0x4bfa5c=_0x86b8[_0x37cfa3];return _0x4bfa5c;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var logger=require(_0x886b('0x2'))('api');var moment=require(_0x886b('0x3'));var BPromise=require('bluebird');var rp=require(_0x886b('0x4'));var fs=require('fs');var path=require(_0x886b('0x5'));var rimraf=require(_0x886b('0x6'));var config=require('../../config/environment');var attributes=require(_0x886b('0x7'));module['exports']=function(_0x5b5ff5,_0x2c32bc){return _0x5b5ff5[_0x886b('0x8')](_0x886b('0x9'),attributes,{'tableName':_0x886b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 4363308..d2b4e79 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 _0x1fe1=['client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1fe1,0xc4));var _0x11fe=function(_0x43a6ea,_0x212ea1){_0x43a6ea=_0x43a6ea-0x0;var _0x5e402f=_0x1fe1[_0x43a6ea];return _0x5e402f;};'use strict';var _=require(_0x11fe('0x0'));var util=require(_0x11fe('0x1'));var moment=require(_0x11fe('0x2'));var BPromise=require(_0x11fe('0x3'));var rs=require(_0x11fe('0x4'));var fs=require('fs');var Redis=require(_0x11fe('0x5'));var db=require(_0x11fe('0x6'))['db'];var utils=require(_0x11fe('0x7'));var logger=require(_0x11fe('0x8'))(_0x11fe('0x9'));var config=require(_0x11fe('0xa'));var jayson=require(_0x11fe('0xb'));var client=jayson[_0x11fe('0xc')][_0x11fe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x50a847,_0x1629e0,_0x29b866){return new BPromise(function(_0x20ee5b,_0x297530){return client[_0x11fe('0xe')](_0x50a847,_0x29b866)['then'](function(_0x52563c){logger[_0x11fe('0xf')](_0x11fe('0x10'),_0x1629e0,_0x11fe('0x11'));logger[_0x11fe('0x12')](_0x11fe('0x13'),_0x1629e0,_0x11fe('0x11'),JSON[_0x11fe('0x14')](_0x52563c));if(_0x52563c[_0x11fe('0x15')]){if(_0x52563c[_0x11fe('0x15')][_0x11fe('0x16')]===0x1f4){logger[_0x11fe('0x15')](_0x11fe('0x10'),_0x1629e0,_0x52563c[_0x11fe('0x15')][_0x11fe('0x17')]);return _0x297530(_0x52563c[_0x11fe('0x15')]['message']);}logger[_0x11fe('0x15')](_0x11fe('0x10'),_0x1629e0,_0x52563c[_0x11fe('0x15')][_0x11fe('0x17')]);return _0x20ee5b(_0x52563c[_0x11fe('0x15')][_0x11fe('0x17')]);}else{logger['info'](_0x11fe('0x10'),_0x1629e0,_0x11fe('0x11'));_0x20ee5b(_0x52563c[_0x11fe('0x18')][_0x11fe('0x17')]);}})[_0x11fe('0x19')](function(_0x5ee1f8){logger[_0x11fe('0x15')](_0x11fe('0x10'),_0x1629e0,_0x5ee1f8);_0x297530(_0x5ee1f8);});});} \ No newline at end of file +var _0x61ed=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x10e0f,_0x1aa508){var _0x1e0536=function(_0xa1ebe7){while(--_0xa1ebe7){_0x10e0f['push'](_0x10e0f['shift']());}};_0x1e0536(++_0x1aa508);}(_0x61ed,0xd2));var _0xd61e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x61ed[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd61e('0x0'));var util=require('util');var moment=require(_0xd61e('0x1'));var BPromise=require(_0xd61e('0x2'));var rs=require(_0xd61e('0x3'));var fs=require('fs');var Redis=require(_0xd61e('0x4'));var db=require(_0xd61e('0x5'))['db'];var utils=require(_0xd61e('0x6'));var logger=require('../../config/logger')(_0xd61e('0x7'));var config=require(_0xd61e('0x8'));var jayson=require(_0xd61e('0x9'));var client=jayson['client'][_0xd61e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb90a,_0x43da59,_0x47604d){return new BPromise(function(_0x1a5691,_0x80f8b7){return client['request'](_0x4fb90a,_0x47604d)['then'](function(_0xbf82a9){logger['info'](_0xd61e('0xb'),_0x43da59,_0xd61e('0xc'));logger[_0xd61e('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43da59,'request\x20sent',JSON[_0xd61e('0xe')](_0xbf82a9));if(_0xbf82a9[_0xd61e('0xf')]){if(_0xbf82a9['error']['code']===0x1f4){logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0xbf82a9[_0xd61e('0xf')][_0xd61e('0x10')]);return _0x80f8b7(_0xbf82a9[_0xd61e('0xf')][_0xd61e('0x10')]);}logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0xbf82a9['error'][_0xd61e('0x10')]);return _0x1a5691(_0xbf82a9[_0xd61e('0xf')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x43da59,_0xd61e('0xc'));_0x1a5691(_0xbf82a9[_0xd61e('0x11')]['message']);}})[_0xd61e('0x12')](function(_0x3cff0b){logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0x3cff0b);_0x80f8b7(_0x3cff0b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 36e3007..5a7f681 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 _0x624c=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x24d908,_0x3def2b){var _0x3019cd=function(_0x3eb670){while(--_0x3eb670){_0x24d908['push'](_0x24d908['shift']());}};_0x3019cd(++_0x3def2b);}(_0x624c,0x1ee));var _0xc624=function(_0x402baf,_0x1ef0ba){_0x402baf=_0x402baf-0x0;var _0x1974d8=_0x624c[_0x402baf];return _0x1974d8;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./analyticMetric.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['post']('/',auth[_0xc624('0x8')](),controller[_0xc624('0xc')]);router[_0xc624('0xd')]('/:id',auth[_0xc624('0x8')](),controller[_0xc624('0xe')]);router['delete'](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xf')]);module[_0xc624('0x10')]=router; \ No newline at end of file +var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','create','put','/:id','update','destroy','exports','multer','path','connect-timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x277c,0x153));var _0xc277=function(_0x4565c5,_0x5b944c){_0x4565c5=_0x4565c5-0x0;var _0x1a5484=_0x277c[_0x4565c5];return _0x1a5484;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['post']('/',auth[_0xc277('0x9')](),controller[_0xc277('0xc')]);router[_0xc277('0xd')](_0xc277('0xe'),auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['delete']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);module[_0xc277('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ebcc64f..1e9fee2 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 _0xf14f=['sequelize','exports','TEXT'];(function(_0x16b24f,_0x59fc8d){var _0x57e2ec=function(_0x25e4b6){while(--_0x25e4b6){_0x16b24f['push'](_0x16b24f['shift']());}};_0x57e2ec(++_0x59fc8d);}(_0xf14f,0x78));var _0xff14=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0xf14f[_0x7a112];return _0x136dc5;};'use strict';var Sequelize=require(_0xff14('0x0'));module[_0xff14('0x1')]={'tree':{'type':Sequelize[_0xff14('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe16b=['TEXT','exports'];(function(_0x56a309,_0x4edef0){var _0x39f130=function(_0x437978){while(--_0x437978){_0x56a309['push'](_0x56a309['shift']());}};_0x39f130(++_0x4edef0);}(_0xe16b,0x155));var _0xbe16=function(_0x43f4c8,_0x22a037){_0x43f4c8=_0x43f4c8-0x0;var _0x3a2e0c=_0xe16b[_0x43f4c8];return _0x3a2e0c;};'use strict';var Sequelize=require('sequelize');module[_0xbe16('0x0')]={'tree':{'type':Sequelize[_0xbe16('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 8551474..89e8a06 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 _0x618c=['send','index','map','AnalyticTreeReport','rawAttributes','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x519e67,_0x2cedae){var _0x2ec3ac=function(_0x4b3a5f){while(--_0x4b3a5f){_0x519e67['push'](_0x519e67['shift']());}};_0x2ec3ac(++_0x2cedae);}(_0x618c,0xfd));var _0xc618=function(_0xb4873d,_0x5ec2bc){_0xb4873d=_0xb4873d-0x0;var _0x2b4552=_0x618c[_0xb4873d];return _0x2b4552;};'use strict';var emlformat=require(_0xc618('0x0'));var rimraf=require(_0xc618('0x1'));var zipdir=require(_0xc618('0x2'));var jsonpatch=require(_0xc618('0x3'));var rp=require(_0xc618('0x4'));var moment=require(_0xc618('0x5'));var BPromise=require(_0xc618('0x6'));var Mustache=require(_0xc618('0x7'));var util=require(_0xc618('0x8'));var path=require(_0xc618('0x9'));var sox=require(_0xc618('0xa'));var csv=require('to-csv');var ejs=require(_0xc618('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc618('0xc'));var squel=require('squel');var crypto=require(_0xc618('0xd'));var jsforce=require(_0xc618('0xe'));var deskjs=require(_0xc618('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc618('0x10'));var Papa=require(_0xc618('0x11'));var Redis=require(_0xc618('0x12'));var authService=require(_0xc618('0x13'));var qs=require(_0xc618('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc618('0x15'));var logger=require('../../config/logger')(_0xc618('0x16'));var utils=require(_0xc618('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc618('0x18'))['db'];function respondWithStatusCode(_0x249429,_0x129752){_0x129752=_0x129752||0xcc;return function(_0x43778e){if(_0x43778e){return _0x249429[_0xc618('0x19')](_0x129752);}return _0x249429[_0xc618('0x1a')](_0x129752)['end']();};}function respondWithResult(_0x4b67e0,_0x96e199){_0x96e199=_0x96e199||0xc8;return function(_0x36dc56){if(_0x36dc56){return _0x4b67e0[_0xc618('0x1a')](_0x96e199)[_0xc618('0x1b')](_0x36dc56);}};}function respondWithFilteredResult(_0x3f61b3,_0x5dc5fd){return function(_0x1d45b6){if(_0x1d45b6){var _0x5ab21b=typeof _0x5dc5fd['offset']===_0xc618('0x1c')&&typeof _0x5dc5fd[_0xc618('0x1d')]===_0xc618('0x1c');var _0x4dd5c6=_0x1d45b6[_0xc618('0x1e')];var _0xccd8c1=_0x5ab21b?0x0:_0x5dc5fd['offset'];var _0x12c50a=_0x5ab21b?_0x1d45b6[_0xc618('0x1e')]:_0x5dc5fd['offset']+_0x5dc5fd[_0xc618('0x1d')];var _0x44da8c;if(_0x12c50a>=_0x4dd5c6){_0x12c50a=_0x4dd5c6;_0x44da8c=0xc8;}else{_0x44da8c=0xce;}_0x3f61b3[_0xc618('0x1a')](_0x44da8c);return _0x3f61b3[_0xc618('0x1f')](_0xc618('0x20'),_0xccd8c1+'-'+_0x12c50a+'/'+_0x4dd5c6)[_0xc618('0x1b')](_0x1d45b6);}return null;};}function patchUpdates(_0x1ecd1f){return function(_0x5277a4){try{jsonpatch[_0xc618('0x21')](_0x5277a4,_0x1ecd1f,!![]);}catch(_0x1f0d0f){return BPromise[_0xc618('0x22')](_0x1f0d0f);}return _0x5277a4[_0xc618('0x23')]();};}function saveUpdates(_0x5bb776,_0x595178){return function(_0x1efa37){if(_0x1efa37){return _0x1efa37[_0xc618('0x24')](_0x5bb776)[_0xc618('0x25')](function(_0x2d8613){return _0x2d8613;});}return null;};}function removeEntity(_0xb73c12,_0x3e2375){return function(_0xa1db6b){if(_0xa1db6b){return _0xa1db6b[_0xc618('0x26')]()[_0xc618('0x25')](function(){_0xb73c12[_0xc618('0x1a')](0xcc)[_0xc618('0x27')]();});}};}function handleEntityNotFound(_0x2cc7be,_0xafc909){return function(_0x3b51e8){if(!_0x3b51e8){_0x2cc7be[_0xc618('0x19')](0x194);}return _0x3b51e8;};}function handleError(_0x15d2d8,_0x4a235c){_0x4a235c=_0x4a235c||0x1f4;return function(_0x4a0fb0){logger[_0xc618('0x28')](_0x4a0fb0[_0xc618('0x29')]);if(_0x4a0fb0[_0xc618('0x2a')]){delete _0x4a0fb0['name'];}_0x15d2d8[_0xc618('0x1a')](_0x4a235c)[_0xc618('0x2b')](_0x4a0fb0);};}exports[_0xc618('0x2c')]=function(_0x434507,_0x1fc8e1){var _0x4c25ec={},_0x3cda55={},_0x121971={'count':0x0,'rows':[]};var _0x4107d7=_[_0xc618('0x2d')](db[_0xc618('0x2e')][_0xc618('0x2f')],function(_0x2337c0){return{'name':_0x2337c0['fieldName'],'type':_0x2337c0['type']['key']};});_0x3cda55['model']=_['map'](_0x4107d7,'name');_0x3cda55[_0xc618('0x30')]=_[_0xc618('0x31')](_0x434507[_0xc618('0x30')]);_0x3cda55[_0xc618('0x32')]=_[_0xc618('0x33')](_0x3cda55['model'],_0x3cda55[_0xc618('0x30')]);_0x4c25ec[_0xc618('0x34')]=_[_0xc618('0x33')](_0x3cda55[_0xc618('0x35')],qs[_0xc618('0x36')](_0x434507['query'][_0xc618('0x36')]));_0x4c25ec[_0xc618('0x34')]=_0x4c25ec['attributes']['length']?_0x4c25ec[_0xc618('0x34')]:_0x3cda55['model'];if(!_0x434507[_0xc618('0x30')][_0xc618('0x37')](_0xc618('0x38'))){_0x4c25ec['limit']=qs[_0xc618('0x1d')](_0x434507[_0xc618('0x30')][_0xc618('0x1d')]);_0x4c25ec[_0xc618('0x39')]=qs['offset'](_0x434507[_0xc618('0x30')][_0xc618('0x39')]);}_0x4c25ec['order']=qs[_0xc618('0x3a')](_0x434507['query'][_0xc618('0x3a')]);_0x4c25ec[_0xc618('0x3b')]=qs[_0xc618('0x32')](_[_0xc618('0x3c')](_0x434507[_0xc618('0x30')],_0x3cda55[_0xc618('0x32')]),_0x4107d7);if(_0x434507[_0xc618('0x30')]['filter']){_0x4c25ec[_0xc618('0x3b')]=_[_0xc618('0x3d')](_0x4c25ec['where'],{'$or':_[_0xc618('0x2d')](_0x4107d7,function(_0x5e33bf){if(_0x5e33bf[_0xc618('0x3e')]!==_0xc618('0x3f')){var _0x3410a8={};_0x3410a8[_0x5e33bf[_0xc618('0x2a')]]={'$like':'%'+_0x434507[_0xc618('0x30')][_0xc618('0x40')]+'%'};return _0x3410a8;}})});}_0x4c25ec=_[_0xc618('0x3d')]({},_0x4c25ec,_0x434507[_0xc618('0x41')]);var _0xc12db7={'where':_0x4c25ec[_0xc618('0x3b')]};return db['AnalyticTreeReport'][_0xc618('0x1e')](_0xc12db7)['then'](function(_0x36dc95){_0x121971['count']=_0x36dc95;if(_0x434507[_0xc618('0x30')][_0xc618('0x42')]){_0x4c25ec[_0xc618('0x43')]=[{'all':!![]}];}return db[_0xc618('0x2e')]['findAll'](_0x4c25ec);})['then'](function(_0x26f660){_0x121971[_0xc618('0x44')]=_0x26f660;return _0x121971;})[_0xc618('0x25')](respondWithFilteredResult(_0x1fc8e1,_0x4c25ec))[_0xc618('0x45')](handleError(_0x1fc8e1,null));};exports['show']=function(_0x191ec2,_0x1e9fc1){var _0x127156={'raw':!![],'where':{'id':_0x191ec2[_0xc618('0x46')]['id']}},_0x47ee5b={};_0x47ee5b[_0xc618('0x35')]=_['keys'](db['AnalyticTreeReport'][_0xc618('0x2f')]);_0x47ee5b['query']=_[_0xc618('0x31')](_0x191ec2['query']);_0x47ee5b[_0xc618('0x32')]=_['intersection'](_0x47ee5b['model'],_0x47ee5b[_0xc618('0x30')]);_0x127156[_0xc618('0x34')]=_['intersection'](_0x47ee5b[_0xc618('0x35')],qs[_0xc618('0x36')](_0x191ec2[_0xc618('0x30')][_0xc618('0x36')]));_0x127156[_0xc618('0x34')]=_0x127156[_0xc618('0x34')]['length']?_0x127156[_0xc618('0x34')]:_0x47ee5b[_0xc618('0x35')];if(_0x191ec2[_0xc618('0x30')][_0xc618('0x42')]){_0x127156['include']=[{'all':!![]}];}_0x127156=_[_0xc618('0x3d')]({},_0x127156,_0x191ec2['options']);return db[_0xc618('0x2e')][_0xc618('0x47')](_0x127156)[_0xc618('0x25')](handleEntityNotFound(_0x1e9fc1,null))[_0xc618('0x25')](respondWithResult(_0x1e9fc1,null))[_0xc618('0x45')](handleError(_0x1e9fc1,null));};exports['create']=function(_0x165455,_0x34b3a8){return db[_0xc618('0x2e')][_0xc618('0x48')](_0x165455[_0xc618('0x49')],{})[_0xc618('0x25')](respondWithResult(_0x34b3a8,0xc9))[_0xc618('0x45')](handleError(_0x34b3a8,null));};exports[_0xc618('0x24')]=function(_0x530f51,_0x246722){if(_0x530f51[_0xc618('0x49')]['id']){delete _0x530f51[_0xc618('0x49')]['id'];}return db[_0xc618('0x2e')][_0xc618('0x47')]({'where':{'id':_0x530f51[_0xc618('0x46')]['id']}})[_0xc618('0x25')](handleEntityNotFound(_0x246722,null))['then'](saveUpdates(_0x530f51[_0xc618('0x49')],null))[_0xc618('0x25')](respondWithResult(_0x246722,null))[_0xc618('0x45')](handleError(_0x246722,null));};exports[_0xc618('0x26')]=function(_0x28066b,_0x209acf){return db[_0xc618('0x2e')][_0xc618('0x47')]({'where':{'id':_0x28066b['params']['id']}})['then'](handleEntityNotFound(_0x209acf,null))[_0xc618('0x25')](removeEntity(_0x209acf,null))['catch'](handleError(_0x209acf,null));}; \ No newline at end of file +var _0xb0ad=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','body','rimraf'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xb0ad,0x99));var _0xdb0a=function(_0x2ff72b,_0x8f2059){_0x2ff72b=_0x2ff72b-0x0;var _0x1b0854=_0xb0ad[_0x2ff72b];return _0x1b0854;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb0a('0x0'));var zipdir=require(_0xdb0a('0x1'));var jsonpatch=require(_0xdb0a('0x2'));var rp=require('request-promise');var moment=require(_0xdb0a('0x3'));var BPromise=require(_0xdb0a('0x4'));var Mustache=require(_0xdb0a('0x5'));var util=require(_0xdb0a('0x6'));var path=require('path');var sox=require(_0xdb0a('0x7'));var csv=require(_0xdb0a('0x8'));var ejs=require(_0xdb0a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb0a('0xa'));var _=require(_0xdb0a('0xb'));var squel=require(_0xdb0a('0xc'));var crypto=require(_0xdb0a('0xd'));var jsforce=require(_0xdb0a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb0a('0xf'));var Redis=require(_0xdb0a('0x10'));var authService=require(_0xdb0a('0x11'));var qs=require(_0xdb0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb0a('0x13'));var logger=require(_0xdb0a('0x14'))(_0xdb0a('0x15'));var utils=require(_0xdb0a('0x16'));var config=require(_0xdb0a('0x17'));var licenseUtil=require(_0xdb0a('0x18'));var db=require(_0xdb0a('0x19'))['db'];function respondWithStatusCode(_0x465ca5,_0xe2dc0b){_0xe2dc0b=_0xe2dc0b||0xcc;return function(_0x1917fd){if(_0x1917fd){return _0x465ca5[_0xdb0a('0x1a')](_0xe2dc0b);}return _0x465ca5['status'](_0xe2dc0b)[_0xdb0a('0x1b')]();};}function respondWithResult(_0x2fb2f3,_0x3677b0){_0x3677b0=_0x3677b0||0xc8;return function(_0xa75ecc){if(_0xa75ecc){return _0x2fb2f3[_0xdb0a('0x1c')](_0x3677b0)[_0xdb0a('0x1d')](_0xa75ecc);}};}function respondWithFilteredResult(_0xd77d58,_0x3c904a){return function(_0xc171f0){if(_0xc171f0){var _0x1cda7e=typeof _0x3c904a[_0xdb0a('0x1e')]===_0xdb0a('0x1f')&&typeof _0x3c904a[_0xdb0a('0x20')]===_0xdb0a('0x1f');var _0x13e51b=_0xc171f0[_0xdb0a('0x21')];var _0x4d05a3=_0x1cda7e?0x0:_0x3c904a[_0xdb0a('0x1e')];var _0x3d51b7=_0x1cda7e?_0xc171f0['count']:_0x3c904a[_0xdb0a('0x1e')]+_0x3c904a[_0xdb0a('0x20')];var _0xa2e185;if(_0x3d51b7>=_0x13e51b){_0x3d51b7=_0x13e51b;_0xa2e185=0xc8;}else{_0xa2e185=0xce;}_0xd77d58[_0xdb0a('0x1c')](_0xa2e185);return _0xd77d58[_0xdb0a('0x22')](_0xdb0a('0x23'),_0x4d05a3+'-'+_0x3d51b7+'/'+_0x13e51b)['json'](_0xc171f0);}return null;};}function patchUpdates(_0x4b1f65){return function(_0x9a242e){try{jsonpatch[_0xdb0a('0x24')](_0x9a242e,_0x4b1f65,!![]);}catch(_0x35424b){return BPromise[_0xdb0a('0x25')](_0x35424b);}return _0x9a242e[_0xdb0a('0x26')]();};}function saveUpdates(_0x16355d,_0x1ad4cd){return function(_0x45eaa7){if(_0x45eaa7){return _0x45eaa7[_0xdb0a('0x27')](_0x16355d)[_0xdb0a('0x28')](function(_0xfc85fd){return _0xfc85fd;});}return null;};}function removeEntity(_0x68b9dc,_0x27abaa){return function(_0x7f7a82){if(_0x7f7a82){return _0x7f7a82[_0xdb0a('0x29')]()['then'](function(){_0x68b9dc[_0xdb0a('0x1c')](0xcc)[_0xdb0a('0x1b')]();});}};}function handleEntityNotFound(_0x205cb3,_0x10a4b6){return function(_0x5aac2f){if(!_0x5aac2f){_0x205cb3[_0xdb0a('0x1a')](0x194);}return _0x5aac2f;};}function handleError(_0x376f7b,_0xe4024){_0xe4024=_0xe4024||0x1f4;return function(_0x1aa11a){logger[_0xdb0a('0x2a')](_0x1aa11a[_0xdb0a('0x2b')]);if(_0x1aa11a[_0xdb0a('0x2c')]){delete _0x1aa11a[_0xdb0a('0x2c')];}_0x376f7b[_0xdb0a('0x1c')](_0xe4024)[_0xdb0a('0x2d')](_0x1aa11a);};}exports[_0xdb0a('0x2e')]=function(_0x527136,_0x8fb45c){var _0x41c34b={},_0xc2de0f={},_0x43d70e={'count':0x0,'rows':[]};var _0x23fa46=_[_0xdb0a('0x2f')](db[_0xdb0a('0x30')]['rawAttributes'],function(_0x65d5cf){return{'name':_0x65d5cf[_0xdb0a('0x31')],'type':_0x65d5cf[_0xdb0a('0x32')][_0xdb0a('0x33')]};});_0xc2de0f[_0xdb0a('0x34')]=_[_0xdb0a('0x2f')](_0x23fa46,'name');_0xc2de0f['query']=_['keys'](_0x527136['query']);_0xc2de0f[_0xdb0a('0x35')]=_[_0xdb0a('0x36')](_0xc2de0f[_0xdb0a('0x34')],_0xc2de0f['query']);_0x41c34b[_0xdb0a('0x37')]=_[_0xdb0a('0x36')](_0xc2de0f[_0xdb0a('0x34')],qs[_0xdb0a('0x38')](_0x527136[_0xdb0a('0x39')][_0xdb0a('0x38')]));_0x41c34b[_0xdb0a('0x37')]=_0x41c34b[_0xdb0a('0x37')]['length']?_0x41c34b[_0xdb0a('0x37')]:_0xc2de0f['model'];if(!_0x527136[_0xdb0a('0x39')][_0xdb0a('0x3a')](_0xdb0a('0x3b'))){_0x41c34b[_0xdb0a('0x20')]=qs[_0xdb0a('0x20')](_0x527136[_0xdb0a('0x39')]['limit']);_0x41c34b[_0xdb0a('0x1e')]=qs[_0xdb0a('0x1e')](_0x527136['query'][_0xdb0a('0x1e')]);}_0x41c34b[_0xdb0a('0x3c')]=qs['sort'](_0x527136[_0xdb0a('0x39')][_0xdb0a('0x3d')]);_0x41c34b['where']=qs[_0xdb0a('0x35')](_['pick'](_0x527136[_0xdb0a('0x39')],_0xc2de0f[_0xdb0a('0x35')]),_0x23fa46);if(_0x527136[_0xdb0a('0x39')]['filter']){_0x41c34b['where']=_[_0xdb0a('0x3e')](_0x41c34b[_0xdb0a('0x3f')],{'$or':_['map'](_0x23fa46,function(_0x38aa17){if(_0x38aa17[_0xdb0a('0x32')]!==_0xdb0a('0x40')){var _0x1e3046={};_0x1e3046[_0x38aa17[_0xdb0a('0x2c')]]={'$like':'%'+_0x527136[_0xdb0a('0x39')][_0xdb0a('0x41')]+'%'};return _0x1e3046;}})});}_0x41c34b=_['merge']({},_0x41c34b,_0x527136[_0xdb0a('0x42')]);var _0x220816={'where':_0x41c34b[_0xdb0a('0x3f')]};return db[_0xdb0a('0x30')]['count'](_0x220816)[_0xdb0a('0x28')](function(_0x63f5a1){_0x43d70e[_0xdb0a('0x21')]=_0x63f5a1;if(_0x527136[_0xdb0a('0x39')]['includeAll']){_0x41c34b[_0xdb0a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x41c34b);})['then'](function(_0xb76f4c){_0x43d70e[_0xdb0a('0x44')]=_0xb76f4c;return _0x43d70e;})[_0xdb0a('0x28')](respondWithFilteredResult(_0x8fb45c,_0x41c34b))[_0xdb0a('0x45')](handleError(_0x8fb45c,null));};exports[_0xdb0a('0x46')]=function(_0x2495a7,_0x1cacae){var _0x2a20c1={'raw':!![],'where':{'id':_0x2495a7[_0xdb0a('0x47')]['id']}},_0x15d5eb={};_0x15d5eb[_0xdb0a('0x34')]=_[_0xdb0a('0x48')](db['AnalyticTreeReport'][_0xdb0a('0x49')]);_0x15d5eb[_0xdb0a('0x39')]=_[_0xdb0a('0x48')](_0x2495a7[_0xdb0a('0x39')]);_0x15d5eb[_0xdb0a('0x35')]=_['intersection'](_0x15d5eb[_0xdb0a('0x34')],_0x15d5eb[_0xdb0a('0x39')]);_0x2a20c1[_0xdb0a('0x37')]=_[_0xdb0a('0x36')](_0x15d5eb[_0xdb0a('0x34')],qs[_0xdb0a('0x38')](_0x2495a7[_0xdb0a('0x39')][_0xdb0a('0x38')]));_0x2a20c1[_0xdb0a('0x37')]=_0x2a20c1[_0xdb0a('0x37')]['length']?_0x2a20c1['attributes']:_0x15d5eb[_0xdb0a('0x34')];if(_0x2495a7['query'][_0xdb0a('0x4a')]){_0x2a20c1['include']=[{'all':!![]}];}_0x2a20c1=_[_0xdb0a('0x3e')]({},_0x2a20c1,_0x2495a7[_0xdb0a('0x42')]);return db[_0xdb0a('0x30')][_0xdb0a('0x4b')](_0x2a20c1)['then'](handleEntityNotFound(_0x1cacae,null))[_0xdb0a('0x28')](respondWithResult(_0x1cacae,null))['catch'](handleError(_0x1cacae,null));};exports['create']=function(_0x1b0d87,_0x4ecaaa){return db[_0xdb0a('0x30')]['create'](_0x1b0d87[_0xdb0a('0x4c')],{})['then'](respondWithResult(_0x4ecaaa,0xc9))[_0xdb0a('0x45')](handleError(_0x4ecaaa,null));};exports[_0xdb0a('0x27')]=function(_0x121d8b,_0x11ebfb){if(_0x121d8b[_0xdb0a('0x4c')]['id']){delete _0x121d8b['body']['id'];}return db[_0xdb0a('0x30')][_0xdb0a('0x4b')]({'where':{'id':_0x121d8b[_0xdb0a('0x47')]['id']}})['then'](handleEntityNotFound(_0x11ebfb,null))[_0xdb0a('0x28')](saveUpdates(_0x121d8b[_0xdb0a('0x4c')],null))[_0xdb0a('0x28')](respondWithResult(_0x11ebfb,null))[_0xdb0a('0x45')](handleError(_0x11ebfb,null));};exports[_0xdb0a('0x29')]=function(_0x27ef8d,_0x98fd76){return db[_0xdb0a('0x30')][_0xdb0a('0x4b')]({'where':{'id':_0x27ef8d['params']['id']}})[_0xdb0a('0x28')](handleEntityNotFound(_0x98fd76,null))[_0xdb0a('0x28')](removeEntity(_0x98fd76,null))[_0xdb0a('0x45')](handleError(_0x98fd76,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 524e0ea..ab0607b 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 _0xd00d=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x45b807,_0xd7efbf){var _0x20dabf=function(_0x251161){while(--_0x251161){_0x45b807['push'](_0x45b807['shift']());}};_0x20dabf(++_0xd7efbf);}(_0xd00d,0x78));var _0xdd00=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xd00d[_0x836465];return _0x2150ea;};'use strict';var _=require(_0xdd00('0x0'));var util=require(_0xdd00('0x1'));var logger=require(_0xdd00('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd00('0x4'));var rimraf=require(_0xdd00('0x5'));var config=require(_0xdd00('0x6'));var attributes=require(_0xdd00('0x7'));module[_0xdd00('0x8')]=function(_0x1de738,_0x17e870){return _0x1de738['define'](_0xdd00('0x9'),attributes,{'tableName':_0xdd00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa80f=['bluebird','request-promise','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa80f,0x1dc));var _0xfa80=function(_0x1817b0,_0x3aaaa1){_0x1817b0=_0x1817b0-0x0;var _0x5c10e6=_0xa80f[_0x1817b0];return _0x5c10e6;};'use strict';var _=require(_0xfa80('0x0'));var util=require('util');var logger=require(_0xfa80('0x1'))(_0xfa80('0x2'));var moment=require(_0xfa80('0x3'));var BPromise=require(_0xfa80('0x4'));var rp=require(_0xfa80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfa80('0x6'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3137b5,_0x31c07f){return _0x3137b5[_0xfa80('0x7')](_0xfa80('0x8'),attributes,{'tableName':_0xfa80('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 94bbb8c..a3a65b0 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x3576fd,_0x418b6d){_0x3576fd=_0x3576fd-0x0;var _0x4756e4=_0x7a54[_0x3576fd];return _0x4756e4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1ce0c8,_0x1bf13a){var _0x194f0d=function(_0x275093){while(--_0x275093){_0x1ce0c8['push'](_0x1ce0c8['shift']());}};_0x194f0d(++_0x1bf13a);}(_0xadb5,0xad));var _0x5adb=function(_0x1ebb6c,_0x1c02fd){_0x1ebb6c=_0x1ebb6c-0x0;var _0x23ff5c=_0xadb5[_0x1ebb6c];return _0x23ff5c;};'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']('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 15f16a7..c68d363 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 _0xf32d=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post'];(function(_0x3e5261,_0x43a042){var _0x221481=function(_0x1d46d0){while(--_0x1d46d0){_0x3e5261['push'](_0x3e5261['shift']());}};_0x221481(++_0x43a042);}(_0xf32d,0x1ab));var _0xdf32=function(_0x41d52a,_0x1702e4){_0x41d52a=_0x41d52a-0x0;var _0x330ad4=_0xf32d[_0x41d52a];return _0x330ad4;};'use strict';var multer=require(_0xdf32('0x0'));var util=require(_0xdf32('0x1'));var path=require(_0xdf32('0x2'));var timeout=require(_0xdf32('0x3'));var express=require(_0xdf32('0x4'));var router=express[_0xdf32('0x5')]();var fs_extra=require(_0xdf32('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdf32('0x7'));var config=require(_0xdf32('0x8'));var controller=require(_0xdf32('0x9'));router[_0xdf32('0xa')]('/',auth[_0xdf32('0xb')](),controller[_0xdf32('0xc')]);router[_0xdf32('0xa')]('/:id',auth[_0xdf32('0xb')](),controller['show']);router[_0xdf32('0xd')]('/',auth[_0xdf32('0xb')](),controller[_0xdf32('0xe')]);router[_0xdf32('0xf')](_0xdf32('0x10'),auth[_0xdf32('0xb')](),controller[_0xdf32('0x11')]);router[_0xdf32('0x12')](_0xdf32('0x10'),auth[_0xdf32('0xb')](),controller[_0xdf32('0x13')]);module[_0xdf32('0x14')]=router; \ No newline at end of file +var _0x9ccc=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','create','update','delete','destroy'];(function(_0x186961,_0x20370e){var _0x350de8=function(_0xe98f13){while(--_0xe98f13){_0x186961['push'](_0x186961['shift']());}};_0x350de8(++_0x20370e);}(_0x9ccc,0x121));var _0xc9cc=function(_0x44efbc,_0x2e4836){_0x44efbc=_0x44efbc-0x0;var _0xf45590=_0x9ccc[_0x44efbc];return _0xf45590;};'use strict';var multer=require(_0xc9cc('0x0'));var util=require(_0xc9cc('0x1'));var path=require(_0xc9cc('0x2'));var timeout=require(_0xc9cc('0x3'));var express=require(_0xc9cc('0x4'));var router=express['Router']();var fs_extra=require(_0xc9cc('0x5'));var auth=require(_0xc9cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9cc('0x7'));var controller=require(_0xc9cc('0x8'));router['get']('/',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xa')]);router[_0xc9cc('0xb')](_0xc9cc('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xd')]);router['put']('/:id',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xe')]);router[_0xc9cc('0xf')](_0xc9cc('0xc'),auth[_0xc9cc('0x9')](),controller[_0xc9cc('0x10')]);module[_0xc9cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index ad5e929..f69ae3c 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 _0xed8a=['exports','STRING','sequelize'];(function(_0x47bb47,_0x3d85ef){var _0x4c9138=function(_0x16542a){while(--_0x16542a){_0x47bb47['push'](_0x47bb47['shift']());}};_0x4c9138(++_0x3d85ef);}(_0xed8a,0xc5));var _0xaed8=function(_0x3b6a04,_0x3069e1){_0x3b6a04=_0x3b6a04-0x0;var _0x2b020f=_0xed8a[_0x3b6a04];return _0x2b020f;};'use strict';var Sequelize=require(_0xaed8('0x0'));module[_0xaed8('0x1')]={'name':{'type':Sequelize[_0xaed8('0x2')]},'basename':{'type':Sequelize[_0xaed8('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0e35=['exports','STRING','sequelize'];(function(_0x539d47,_0x2c363a){var _0x1364fc=function(_0xfca11a){while(--_0xfca11a){_0x539d47['push'](_0x539d47['shift']());}};_0x1364fc(++_0x2c363a);}(_0x0e35,0xc2));var _0x50e3=function(_0x2c621d,_0x1e7ba6){_0x2c621d=_0x2c621d-0x0;var _0x482ada=_0x0e35[_0x2c621d];return _0x482ada;};'use strict';var Sequelize=require(_0x50e3('0x0'));module[_0x50e3('0x1')]={'name':{'type':Sequelize[_0x50e3('0x2')]},'basename':{'type':Sequelize[_0x50e3('0x2')]},'type':{'type':Sequelize[_0x50e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d92fdc2..2d3ccbd 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 _0x1b44=['get','omit','updatedAt','body','createdAt','create','update','file','originalname','basename','filename','download','findOne','root','server/files/attachments/','offline-chat/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','show','fields','find','catch','params'];(function(_0x492714,_0x2560ee){var _0x2dc519=function(_0x2ad633){while(--_0x2ad633){_0x492714['push'](_0x492714['shift']());}};_0x2dc519(++_0x2560ee);}(_0x1b44,0x70));var _0x41b4=function(_0x9927cb,_0x2b2529){_0x9927cb=_0x9927cb-0x0;var _0x5152fe=_0x1b44[_0x9927cb];return _0x5152fe;};'use strict';var emlformat=require(_0x41b4('0x0'));var rimraf=require(_0x41b4('0x1'));var zipdir=require(_0x41b4('0x2'));var jsonpatch=require(_0x41b4('0x3'));var rp=require(_0x41b4('0x4'));var moment=require(_0x41b4('0x5'));var BPromise=require(_0x41b4('0x6'));var Mustache=require(_0x41b4('0x7'));var util=require(_0x41b4('0x8'));var path=require(_0x41b4('0x9'));var sox=require(_0x41b4('0xa'));var csv=require(_0x41b4('0xb'));var ejs=require(_0x41b4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41b4('0xd'));var squel=require(_0x41b4('0xe'));var crypto=require(_0x41b4('0xf'));var jsforce=require(_0x41b4('0x10'));var deskjs=require(_0x41b4('0x11'));var toCsv=require('to-csv');var querystring=require(_0x41b4('0x12'));var Papa=require(_0x41b4('0x13'));var Redis=require(_0x41b4('0x14'));var authService=require(_0x41b4('0x15'));var qs=require(_0x41b4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41b4('0x17'));var logger=require(_0x41b4('0x18'))(_0x41b4('0x19'));var utils=require(_0x41b4('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x41b4('0x1b'))['db'];function respondWithStatusCode(_0x52f81b,_0x4c5584){_0x4c5584=_0x4c5584||0xcc;return function(_0x4eeb30){if(_0x4eeb30){return _0x52f81b['sendStatus'](_0x4c5584);}return _0x52f81b[_0x41b4('0x1c')](_0x4c5584)[_0x41b4('0x1d')]();};}function respondWithResult(_0x5cdc81,_0x25d1ee){_0x25d1ee=_0x25d1ee||0xc8;return function(_0xa2caa5){if(_0xa2caa5){return _0x5cdc81['status'](_0x25d1ee)[_0x41b4('0x1e')](_0xa2caa5);}};}function respondWithFilteredResult(_0x2336ef,_0x478a19){return function(_0x21c735){if(_0x21c735){var _0x3b6dc6=typeof _0x478a19['offset']==='undefined'&&typeof _0x478a19['limit']===_0x41b4('0x1f');var _0x5518ab=_0x21c735[_0x41b4('0x20')];var _0x2a74ba=_0x3b6dc6?0x0:_0x478a19[_0x41b4('0x21')];var _0x355e05=_0x3b6dc6?_0x21c735[_0x41b4('0x20')]:_0x478a19['offset']+_0x478a19['limit'];var _0x5a5021;if(_0x355e05>=_0x5518ab){_0x355e05=_0x5518ab;_0x5a5021=0xc8;}else{_0x5a5021=0xce;}_0x2336ef['status'](_0x5a5021);return _0x2336ef[_0x41b4('0x22')](_0x41b4('0x23'),_0x2a74ba+'-'+_0x355e05+'/'+_0x5518ab)['json'](_0x21c735);}return null;};}function patchUpdates(_0x568b8b){return function(_0x280692){try{jsonpatch[_0x41b4('0x24')](_0x280692,_0x568b8b,!![]);}catch(_0x3c3167){return BPromise[_0x41b4('0x25')](_0x3c3167);}return _0x280692[_0x41b4('0x26')]();};}function saveUpdates(_0xb936e3,_0xc2bcaa){return function(_0x25a7ef){if(_0x25a7ef){return _0x25a7ef['update'](_0xb936e3)[_0x41b4('0x27')](function(_0x40c164){return _0x40c164;});}return null;};}function removeEntity(_0xfec0ce,_0x4ed38a){return function(_0x7f6110){if(_0x7f6110){return _0x7f6110[_0x41b4('0x28')]()[_0x41b4('0x27')](function(){_0xfec0ce[_0x41b4('0x1c')](0xcc)[_0x41b4('0x1d')]();});}};}function handleEntityNotFound(_0x436b50,_0x49656e){return function(_0x54d8f9){if(!_0x54d8f9){_0x436b50[_0x41b4('0x29')](0x194);}return _0x54d8f9;};}function handleError(_0x2b9aef,_0x3b8c0c){_0x3b8c0c=_0x3b8c0c||0x1f4;return function(_0x40104e){logger[_0x41b4('0x2a')](_0x40104e['stack']);if(_0x40104e[_0x41b4('0x2b')]){delete _0x40104e[_0x41b4('0x2b')];}_0x2b9aef[_0x41b4('0x1c')](_0x3b8c0c)[_0x41b4('0x2c')](_0x40104e);};}exports[_0x41b4('0x2d')]=function(_0xbd555,_0x4b0f2e){var _0x29f7fb={},_0x28bf3b={},_0x3010d8={'count':0x0,'rows':[]};var _0x1c32fd=_[_0x41b4('0x2e')](db['Attachment'][_0x41b4('0x2f')],function(_0x206848){return{'name':_0x206848[_0x41b4('0x30')],'type':_0x206848[_0x41b4('0x31')][_0x41b4('0x32')]};});_0x28bf3b[_0x41b4('0x33')]=_[_0x41b4('0x2e')](_0x1c32fd,_0x41b4('0x2b'));_0x28bf3b[_0x41b4('0x34')]=_[_0x41b4('0x35')](_0xbd555[_0x41b4('0x34')]);_0x28bf3b[_0x41b4('0x36')]=_[_0x41b4('0x37')](_0x28bf3b['model'],_0x28bf3b['query']);_0x29f7fb[_0x41b4('0x38')]=_[_0x41b4('0x37')](_0x28bf3b[_0x41b4('0x33')],qs['fields'](_0xbd555[_0x41b4('0x34')]['fields']));_0x29f7fb[_0x41b4('0x38')]=_0x29f7fb[_0x41b4('0x38')][_0x41b4('0x39')]?_0x29f7fb[_0x41b4('0x38')]:_0x28bf3b[_0x41b4('0x33')];if(!_0xbd555[_0x41b4('0x34')][_0x41b4('0x3a')](_0x41b4('0x3b'))){_0x29f7fb[_0x41b4('0x3c')]=qs[_0x41b4('0x3c')](_0xbd555[_0x41b4('0x34')][_0x41b4('0x3c')]);_0x29f7fb[_0x41b4('0x21')]=qs['offset'](_0xbd555['query'][_0x41b4('0x21')]);}_0x29f7fb[_0x41b4('0x3d')]=qs[_0x41b4('0x3e')](_0xbd555[_0x41b4('0x34')][_0x41b4('0x3e')]);_0x29f7fb[_0x41b4('0x3f')]=qs[_0x41b4('0x36')](_['pick'](_0xbd555['query'],_0x28bf3b['filters']),_0x1c32fd);if(_0xbd555[_0x41b4('0x34')][_0x41b4('0x40')]){_0x29f7fb[_0x41b4('0x3f')]=_[_0x41b4('0x41')](_0x29f7fb[_0x41b4('0x3f')],{'$or':_[_0x41b4('0x2e')](_0x1c32fd,function(_0x114547){if(_0x114547[_0x41b4('0x31')]!==_0x41b4('0x42')){var _0x227011={};_0x227011[_0x114547['name']]={'$like':'%'+_0xbd555['query'][_0x41b4('0x40')]+'%'};return _0x227011;}})});}_0x29f7fb=_[_0x41b4('0x41')]({},_0x29f7fb,_0xbd555[_0x41b4('0x43')]);var _0x41d164={'where':_0x29f7fb[_0x41b4('0x3f')]};return db[_0x41b4('0x44')][_0x41b4('0x20')](_0x41d164)['then'](function(_0x4bda49){_0x3010d8[_0x41b4('0x20')]=_0x4bda49;if(_0xbd555[_0x41b4('0x34')][_0x41b4('0x45')]){_0x29f7fb[_0x41b4('0x46')]=[{'all':!![]}];}return db['Attachment'][_0x41b4('0x47')](_0x29f7fb);})[_0x41b4('0x27')](function(_0x5f0849){_0x3010d8[_0x41b4('0x48')]=_0x5f0849;return _0x3010d8;})[_0x41b4('0x27')](respondWithFilteredResult(_0x4b0f2e,_0x29f7fb))['catch'](handleError(_0x4b0f2e,null));};exports[_0x41b4('0x49')]=function(_0x350402,_0x508e1e){var _0x322aec={'raw':!![],'where':{'id':_0x350402['params']['id']}},_0x58f62d={};_0x58f62d[_0x41b4('0x33')]=_['keys'](db[_0x41b4('0x44')]['rawAttributes']);_0x58f62d[_0x41b4('0x34')]=_['keys'](_0x350402['query']);_0x58f62d[_0x41b4('0x36')]=_['intersection'](_0x58f62d[_0x41b4('0x33')],_0x58f62d[_0x41b4('0x34')]);_0x322aec['attributes']=_[_0x41b4('0x37')](_0x58f62d[_0x41b4('0x33')],qs[_0x41b4('0x4a')](_0x350402[_0x41b4('0x34')][_0x41b4('0x4a')]));_0x322aec[_0x41b4('0x38')]=_0x322aec[_0x41b4('0x38')][_0x41b4('0x39')]?_0x322aec[_0x41b4('0x38')]:_0x58f62d[_0x41b4('0x33')];if(_0x350402[_0x41b4('0x34')]['includeAll']){_0x322aec['include']=[{'all':!![]}];}_0x322aec=_[_0x41b4('0x41')]({},_0x322aec,_0x350402['options']);return db[_0x41b4('0x44')][_0x41b4('0x4b')](_0x322aec)[_0x41b4('0x27')](handleEntityNotFound(_0x508e1e,null))[_0x41b4('0x27')](respondWithResult(_0x508e1e,null))[_0x41b4('0x4c')](handleError(_0x508e1e,null));};exports['clone']=function(_0x421db8,_0x5dce28){var _0x5b3727={'where':{'id':_0x421db8[_0x41b4('0x4d')]['id']}},_0x2dbc1f={};_0x2dbc1f['model']=_[_0x41b4('0x35')](db[_0x41b4('0x44')][_0x41b4('0x2f')]);_0x5b3727[_0x41b4('0x38')]=_[_0x41b4('0x37')](_0x2dbc1f[_0x41b4('0x33')],qs[_0x41b4('0x4a')](_0x421db8['query'][_0x41b4('0x4a')]));_0x5b3727[_0x41b4('0x38')]=_0x5b3727[_0x41b4('0x38')][_0x41b4('0x39')]?_0x5b3727[_0x41b4('0x38')]:_0x2dbc1f[_0x41b4('0x33')];if(_0x421db8[_0x41b4('0x34')][_0x41b4('0x45')]){_0x5b3727[_0x41b4('0x46')]=[{'all':!![]}];}_0x5b3727=_[_0x41b4('0x41')]({},_0x5b3727,_0x421db8[_0x41b4('0x43')]);return db[_0x41b4('0x44')][_0x41b4('0x4b')](_0x5b3727)[_0x41b4('0x27')](handleEntityNotFound(_0x5dce28,null))[_0x41b4('0x27')](function(_0x1e5083){if(_0x1e5083){var _0x3c3cda=_0x1e5083[_0x41b4('0x4e')]({'plain':!![]});_0x3c3cda=qs[_0x41b4('0x4f')](_0x3c3cda,['id','createdAt',_0x41b4('0x50')]);_0x421db8[_0x41b4('0x51')]=_['omit'](_0x421db8[_0x41b4('0x51')],['id',_0x41b4('0x52'),_0x41b4('0x50')]);return db[_0x41b4('0x44')][_0x41b4('0x53')](_[_0x41b4('0x41')](_0x3c3cda,_0x421db8['body']),{'include':_0x421db8[_0x41b4('0x34')][_0x41b4('0x45')]?[{'all':!![]}]:undefined});}})[_0x41b4('0x27')](respondWithResult(_0x5dce28,0xc9))['catch'](handleError(_0x5dce28,null));};exports[_0x41b4('0x54')]=function(_0x3f1bd1,_0x10ce26){if(_0x3f1bd1[_0x41b4('0x51')]['id']){delete _0x3f1bd1['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x3f1bd1[_0x41b4('0x4d')]['id']}})[_0x41b4('0x27')](handleEntityNotFound(_0x10ce26,null))[_0x41b4('0x27')](saveUpdates(_0x3f1bd1[_0x41b4('0x51')],null))[_0x41b4('0x27')](respondWithResult(_0x10ce26,null))[_0x41b4('0x4c')](handleError(_0x10ce26,null));};exports['destroy']=function(_0x40bd43,_0x20923c){return db['Attachment'][_0x41b4('0x4b')]({'where':{'id':_0x40bd43[_0x41b4('0x4d')]['id']}})[_0x41b4('0x27')](handleEntityNotFound(_0x20923c,null))['then'](removeEntity(_0x20923c,null))[_0x41b4('0x4c')](handleError(_0x20923c,null));};exports[_0x41b4('0x53')]=function(_0x5a3498,_0x418c2f,_0x1b229a){_0x5a3498[_0x41b4('0x51')][_0x41b4('0x2b')]=_0x5a3498[_0x41b4('0x55')][_0x41b4('0x56')];_0x5a3498['body'][_0x41b4('0x57')]=_0x5a3498[_0x41b4('0x55')][_0x41b4('0x58')];_0x5a3498[_0x41b4('0x51')][_0x41b4('0x31')]=_0x5a3498[_0x41b4('0x55')]['mimetype'];return db['Attachment'][_0x41b4('0x53')](_0x5a3498[_0x41b4('0x51')])['then'](respondWithResult(_0x418c2f,0xc9))[_0x41b4('0x4c')](handleError(_0x418c2f,null));};exports[_0x41b4('0x59')]=function(_0x51e64f,_0x3ddd05,_0x50460d){return db[_0x41b4('0x44')][_0x41b4('0x5a')]({'where':{'id':_0x51e64f[_0x41b4('0x4d')]['id']},'raw':!![]})[_0x41b4('0x27')](handleEntityNotFound(_0x3ddd05,null))[_0x41b4('0x27')](function(_0x5aa4d1){if(_0x5aa4d1){var _0xdfd7de=_0x5aa4d1['ChatOfflineMessageId']!==null;var _0x234056=path['join'](config[_0x41b4('0x5b')],_0x41b4('0x5c'));if(_0xdfd7de){_0x234056=path['join'](_0x234056,_0x41b4('0x5d'));}var _0x141dfa=path[_0x41b4('0x5e')](_0x234056,_0x5aa4d1[_0x41b4('0x57')]);return _0x3ddd05[_0x41b4('0x59')](_0x141dfa);}})[_0x41b4('0x4c')](handleError(_0x3ddd05,null));}; \ No newline at end of file +var _0xa96f=['set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','Attachment','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xa96f,0x142));var _0xfa96=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xa96f[_0x4ca333];return _0x13b2e1;};'use strict';var emlformat=require(_0xfa96('0x0'));var rimraf=require(_0xfa96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa96('0x2'));var rp=require(_0xfa96('0x3'));var moment=require(_0xfa96('0x4'));var BPromise=require(_0xfa96('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa96('0x6'));var sox=require(_0xfa96('0x7'));var csv=require('to-csv');var ejs=require(_0xfa96('0x8'));var fs=require('fs');var fs_extra=require(_0xfa96('0x9'));var _=require('lodash');var squel=require(_0xfa96('0xa'));var crypto=require(_0xfa96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa96('0xc'));var toCsv=require(_0xfa96('0xd'));var querystring=require('querystring');var Papa=require(_0xfa96('0xe'));var Redis=require(_0xfa96('0xf'));var authService=require(_0xfa96('0x10'));var qs=require(_0xfa96('0x11'));var as=require(_0xfa96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa96('0x13'))(_0xfa96('0x14'));var utils=require('../../config/utils');var config=require(_0xfa96('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa96('0x16'))['db'];function respondWithStatusCode(_0x1151f7,_0x65ebb0){_0x65ebb0=_0x65ebb0||0xcc;return function(_0x267054){if(_0x267054){return _0x1151f7[_0xfa96('0x17')](_0x65ebb0);}return _0x1151f7['status'](_0x65ebb0)['end']();};}function respondWithResult(_0x2f0a8e,_0x246c61){_0x246c61=_0x246c61||0xc8;return function(_0x142cd3){if(_0x142cd3){return _0x2f0a8e[_0xfa96('0x18')](_0x246c61)[_0xfa96('0x19')](_0x142cd3);}};}function respondWithFilteredResult(_0x23ef55,_0x325ffe){return function(_0x40aba7){if(_0x40aba7){var _0x1394af=typeof _0x325ffe[_0xfa96('0x1a')]===_0xfa96('0x1b')&&typeof _0x325ffe[_0xfa96('0x1c')]==='undefined';var _0x3cf43d=_0x40aba7[_0xfa96('0x1d')];var _0x4902c7=_0x1394af?0x0:_0x325ffe[_0xfa96('0x1a')];var _0x208808=_0x1394af?_0x40aba7[_0xfa96('0x1d')]:_0x325ffe['offset']+_0x325ffe[_0xfa96('0x1c')];var _0x3c293a;if(_0x208808>=_0x3cf43d){_0x208808=_0x3cf43d;_0x3c293a=0xc8;}else{_0x3c293a=0xce;}_0x23ef55['status'](_0x3c293a);return _0x23ef55[_0xfa96('0x1e')](_0xfa96('0x1f'),_0x4902c7+'-'+_0x208808+'/'+_0x3cf43d)[_0xfa96('0x19')](_0x40aba7);}return null;};}function patchUpdates(_0x20cb96){return function(_0x10e707){try{jsonpatch[_0xfa96('0x20')](_0x10e707,_0x20cb96,!![]);}catch(_0x23ec3d){return BPromise[_0xfa96('0x21')](_0x23ec3d);}return _0x10e707[_0xfa96('0x22')]();};}function saveUpdates(_0x6ccf35,_0x3c2f84){return function(_0x5e139d){if(_0x5e139d){return _0x5e139d[_0xfa96('0x23')](_0x6ccf35)['then'](function(_0x4a2dd9){return _0x4a2dd9;});}return null;};}function removeEntity(_0x638e6c,_0x25899e){return function(_0x23211c){if(_0x23211c){return _0x23211c[_0xfa96('0x24')]()['then'](function(){_0x638e6c[_0xfa96('0x18')](0xcc)[_0xfa96('0x25')]();});}};}function handleEntityNotFound(_0x4cbc92,_0x56e0eb){return function(_0xa67841){if(!_0xa67841){_0x4cbc92[_0xfa96('0x17')](0x194);}return _0xa67841;};}function handleError(_0x1232c9,_0x2035bf){_0x2035bf=_0x2035bf||0x1f4;return function(_0x27be01){logger[_0xfa96('0x26')](_0x27be01[_0xfa96('0x27')]);if(_0x27be01[_0xfa96('0x28')]){delete _0x27be01[_0xfa96('0x28')];}_0x1232c9['status'](_0x2035bf)['send'](_0x27be01);};}exports[_0xfa96('0x29')]=function(_0x3c3e1f,_0xff14f5){var _0x43d9da={},_0x582274={},_0x5df60d={'count':0x0,'rows':[]};var _0x3c4ed1=_['map'](db['Attachment'][_0xfa96('0x2a')],function(_0x2a12f0){return{'name':_0x2a12f0[_0xfa96('0x2b')],'type':_0x2a12f0[_0xfa96('0x2c')]['key']};});_0x582274[_0xfa96('0x2d')]=_[_0xfa96('0x2e')](_0x3c4ed1,_0xfa96('0x28'));_0x582274['query']=_[_0xfa96('0x2f')](_0x3c3e1f[_0xfa96('0x30')]);_0x582274[_0xfa96('0x31')]=_[_0xfa96('0x32')](_0x582274[_0xfa96('0x2d')],_0x582274[_0xfa96('0x30')]);_0x43d9da[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x582274['model'],qs[_0xfa96('0x34')](_0x3c3e1f['query'][_0xfa96('0x34')]));_0x43d9da['attributes']=_0x43d9da['attributes'][_0xfa96('0x35')]?_0x43d9da[_0xfa96('0x33')]:_0x582274[_0xfa96('0x2d')];if(!_0x3c3e1f['query'][_0xfa96('0x36')]('nolimit')){_0x43d9da['limit']=qs[_0xfa96('0x1c')](_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x1c')]);_0x43d9da[_0xfa96('0x1a')]=qs[_0xfa96('0x1a')](_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x1a')]);}_0x43d9da['order']=qs['sort'](_0x3c3e1f['query']['sort']);_0x43d9da['where']=qs[_0xfa96('0x31')](_[_0xfa96('0x37')](_0x3c3e1f['query'],_0x582274['filters']),_0x3c4ed1);if(_0x3c3e1f['query'][_0xfa96('0x38')]){_0x43d9da[_0xfa96('0x39')]=_[_0xfa96('0x3a')](_0x43d9da[_0xfa96('0x39')],{'$or':_[_0xfa96('0x2e')](_0x3c4ed1,function(_0x1f10d2){if(_0x1f10d2['type']!==_0xfa96('0x3b')){var _0x170fee={};_0x170fee[_0x1f10d2[_0xfa96('0x28')]]={'$like':'%'+_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x38')]+'%'};return _0x170fee;}})});}_0x43d9da=_[_0xfa96('0x3a')]({},_0x43d9da,_0x3c3e1f[_0xfa96('0x3c')]);var _0x684b98={'where':_0x43d9da['where']};return db['Attachment']['count'](_0x684b98)[_0xfa96('0x3d')](function(_0x5b0a1b){_0x5df60d[_0xfa96('0x1d')]=_0x5b0a1b;if(_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x3e')]){_0x43d9da[_0xfa96('0x3f')]=[{'all':!![]}];}return db[_0xfa96('0x40')][_0xfa96('0x41')](_0x43d9da);})[_0xfa96('0x3d')](function(_0x474b1a){_0x5df60d[_0xfa96('0x42')]=_0x474b1a;return _0x5df60d;})['then'](respondWithFilteredResult(_0xff14f5,_0x43d9da))[_0xfa96('0x43')](handleError(_0xff14f5,null));};exports[_0xfa96('0x44')]=function(_0x54d136,_0x375b48){var _0x38d8d8={'raw':!![],'where':{'id':_0x54d136[_0xfa96('0x45')]['id']}},_0x217109={};_0x217109[_0xfa96('0x2d')]=_[_0xfa96('0x2f')](db['Attachment'][_0xfa96('0x2a')]);_0x217109[_0xfa96('0x30')]=_[_0xfa96('0x2f')](_0x54d136[_0xfa96('0x30')]);_0x217109[_0xfa96('0x31')]=_[_0xfa96('0x32')](_0x217109[_0xfa96('0x2d')],_0x217109[_0xfa96('0x30')]);_0x38d8d8[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x217109[_0xfa96('0x2d')],qs[_0xfa96('0x34')](_0x54d136['query'][_0xfa96('0x34')]));_0x38d8d8[_0xfa96('0x33')]=_0x38d8d8['attributes'][_0xfa96('0x35')]?_0x38d8d8['attributes']:_0x217109[_0xfa96('0x2d')];if(_0x54d136[_0xfa96('0x30')]['includeAll']){_0x38d8d8['include']=[{'all':!![]}];}_0x38d8d8=_[_0xfa96('0x3a')]({},_0x38d8d8,_0x54d136[_0xfa96('0x3c')]);return db[_0xfa96('0x40')][_0xfa96('0x46')](_0x38d8d8)[_0xfa96('0x3d')](handleEntityNotFound(_0x375b48,null))[_0xfa96('0x3d')](respondWithResult(_0x375b48,null))[_0xfa96('0x43')](handleError(_0x375b48,null));};exports[_0xfa96('0x47')]=function(_0x148f44,_0x1fb7af){var _0x5ba98d={'where':{'id':_0x148f44[_0xfa96('0x45')]['id']}},_0x8b38ff={};_0x8b38ff[_0xfa96('0x2d')]=_[_0xfa96('0x2f')](db[_0xfa96('0x40')][_0xfa96('0x2a')]);_0x5ba98d[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x8b38ff['model'],qs[_0xfa96('0x34')](_0x148f44['query'][_0xfa96('0x34')]));_0x5ba98d[_0xfa96('0x33')]=_0x5ba98d[_0xfa96('0x33')]['length']?_0x5ba98d[_0xfa96('0x33')]:_0x8b38ff['model'];if(_0x148f44[_0xfa96('0x30')][_0xfa96('0x3e')]){_0x5ba98d[_0xfa96('0x3f')]=[{'all':!![]}];}_0x5ba98d=_[_0xfa96('0x3a')]({},_0x5ba98d,_0x148f44[_0xfa96('0x3c')]);return db[_0xfa96('0x40')][_0xfa96('0x46')](_0x5ba98d)[_0xfa96('0x3d')](handleEntityNotFound(_0x1fb7af,null))[_0xfa96('0x3d')](function(_0x459dd6){if(_0x459dd6){var _0x300f5a=_0x459dd6[_0xfa96('0x48')]({'plain':!![]});_0x300f5a=qs[_0xfa96('0x49')](_0x300f5a,['id',_0xfa96('0x4a'),_0xfa96('0x4b')]);_0x148f44['body']=_[_0xfa96('0x49')](_0x148f44[_0xfa96('0x4c')],['id','createdAt','updatedAt']);return db[_0xfa96('0x40')][_0xfa96('0x4d')](_[_0xfa96('0x3a')](_0x300f5a,_0x148f44[_0xfa96('0x4c')]),{'include':_0x148f44[_0xfa96('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xfa96('0x3d')](respondWithResult(_0x1fb7af,0xc9))[_0xfa96('0x43')](handleError(_0x1fb7af,null));};exports[_0xfa96('0x23')]=function(_0x4c99e8,_0x7cd0ef){if(_0x4c99e8['body']['id']){delete _0x4c99e8['body']['id'];}return db['Attachment'][_0xfa96('0x46')]({'where':{'id':_0x4c99e8[_0xfa96('0x45')]['id']}})['then'](handleEntityNotFound(_0x7cd0ef,null))['then'](saveUpdates(_0x4c99e8[_0xfa96('0x4c')],null))[_0xfa96('0x3d')](respondWithResult(_0x7cd0ef,null))[_0xfa96('0x43')](handleError(_0x7cd0ef,null));};exports['destroy']=function(_0x2911e7,_0x308b81){return db[_0xfa96('0x40')]['find']({'where':{'id':_0x2911e7[_0xfa96('0x45')]['id']}})[_0xfa96('0x3d')](handleEntityNotFound(_0x308b81,null))['then'](removeEntity(_0x308b81,null))[_0xfa96('0x43')](handleError(_0x308b81,null));};exports[_0xfa96('0x4d')]=function(_0x187464,_0x3d19fd,_0xee46aa){_0x187464[_0xfa96('0x4c')][_0xfa96('0x28')]=_0x187464[_0xfa96('0x4e')][_0xfa96('0x4f')];_0x187464[_0xfa96('0x4c')][_0xfa96('0x50')]=_0x187464[_0xfa96('0x4e')][_0xfa96('0x51')];_0x187464[_0xfa96('0x4c')]['type']=_0x187464['file']['mimetype'];return db[_0xfa96('0x40')]['create'](_0x187464[_0xfa96('0x4c')])[_0xfa96('0x3d')](respondWithResult(_0x3d19fd,0xc9))[_0xfa96('0x43')](handleError(_0x3d19fd,null));};exports[_0xfa96('0x52')]=function(_0x1320be,_0x14bfed,_0x185463){return db[_0xfa96('0x40')][_0xfa96('0x53')]({'where':{'id':_0x1320be['params']['id']},'raw':!![]})[_0xfa96('0x3d')](handleEntityNotFound(_0x14bfed,null))['then'](function(_0x39fc89){if(_0x39fc89){var _0x4bb9d9=_0x39fc89[_0xfa96('0x54')]!==null;var _0x59570d=path[_0xfa96('0x55')](config[_0xfa96('0x56')],'server/files/attachments/');if(_0x4bb9d9){_0x59570d=path[_0xfa96('0x55')](_0x59570d,_0xfa96('0x57'));}var _0xf263cb=path[_0xfa96('0x55')](_0x59570d,_0x39fc89['basename']);return _0x14bfed[_0xfa96('0x52')](_0xf263cb);}})[_0xfa96('0x43')](handleError(_0x14bfed,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a1c4631..71d19e4 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 _0x9126=['./attachment.attributes','exports','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x454cd6,_0x21d123){var _0x2c0f96=function(_0x50a9a2){while(--_0x50a9a2){_0x454cd6['push'](_0x454cd6['shift']());}};_0x2c0f96(++_0x21d123);}(_0x9126,0x130));var _0x6912=function(_0x145266,_0x9b6850){_0x145266=_0x145266-0x0;var _0x546273=_0x9126[_0x145266];return _0x546273;};'use strict';var _=require('lodash');var util=require(_0x6912('0x0'));var logger=require(_0x6912('0x1'))(_0x6912('0x2'));var moment=require(_0x6912('0x3'));var BPromise=require(_0x6912('0x4'));var rp=require(_0x6912('0x5'));var fs=require('fs');var path=require(_0x6912('0x6'));var rimraf=require(_0x6912('0x7'));var config=require('../../config/environment');var attributes=require(_0x6912('0x8'));module[_0x6912('0x9')]=function(_0x517c13,_0x38e058){return _0x517c13['define'](_0x6912('0xa'),attributes,{'tableName':_0x6912('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x020f=['exports','Attachment','attachments','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x020f,0x14d));var _0xf020=function(_0x59b912,_0x16b82d){_0x59b912=_0x59b912-0x0;var _0x4f2226=_0x020f[_0x59b912];return _0x4f2226;};'use strict';var _=require('lodash');var util=require(_0xf020('0x0'));var logger=require(_0xf020('0x1'))(_0xf020('0x2'));var moment=require(_0xf020('0x3'));var BPromise=require('bluebird');var rp=require(_0xf020('0x4'));var fs=require('fs');var path=require(_0xf020('0x5'));var rimraf=require(_0xf020('0x6'));var config=require(_0xf020('0x7'));var attributes=require('./attachment.attributes');module[_0xf020('0x8')]=function(_0x1b65c9,_0x4b119e){return _0x1b65c9['define'](_0xf020('0x9'),attributes,{'tableName':_0xf020('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 0a49c04..0894348 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 _0x1bb2=['http','request','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','create','body','options','raw','then','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x1bb2,0x152));var _0x21bb=function(_0x1889fb,_0x20414f){_0x1889fb=_0x1889fb-0x0;var _0x284a16=_0x1bb2[_0x1889fb];return _0x284a16;};'use strict';var _=require('lodash');var util=require(_0x21bb('0x0'));var moment=require(_0x21bb('0x1'));var BPromise=require(_0x21bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21bb('0x3'))['db'];var utils=require(_0x21bb('0x4'));var logger=require(_0x21bb('0x5'))(_0x21bb('0x6'));var config=require(_0x21bb('0x7'));var jayson=require(_0x21bb('0x8'));var client=jayson[_0x21bb('0x9')][_0x21bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36217b,_0x330447,_0x642998){return new BPromise(function(_0x316b77,_0x5af85f){return client[_0x21bb('0xb')](_0x36217b,_0x642998)['then'](function(_0x300c15){logger['info']('Attachment,\x20%s,\x20%s',_0x330447,_0x21bb('0xc'));logger[_0x21bb('0xd')](_0x21bb('0xe'),_0x330447,_0x21bb('0xc'),JSON[_0x21bb('0xf')](_0x300c15));if(_0x300c15[_0x21bb('0x10')]){if(_0x300c15[_0x21bb('0x10')][_0x21bb('0x11')]===0x1f4){logger['error'](_0x21bb('0x12'),_0x330447,_0x300c15[_0x21bb('0x10')]['message']);return _0x5af85f(_0x300c15[_0x21bb('0x10')][_0x21bb('0x13')]);}logger['error'](_0x21bb('0x12'),_0x330447,_0x300c15[_0x21bb('0x10')][_0x21bb('0x13')]);return _0x316b77(_0x300c15[_0x21bb('0x10')]['message']);}else{logger[_0x21bb('0x14')]('Attachment,\x20%s,\x20%s',_0x330447,'request\x20sent');_0x316b77(_0x300c15[_0x21bb('0x15')][_0x21bb('0x13')]);}})[_0x21bb('0x16')](function(_0x465f5e){logger[_0x21bb('0x10')](_0x21bb('0x12'),_0x330447,_0x465f5e);_0x5af85f(_0x465f5e);});});}exports[_0x21bb('0x17')]=function(_0x15fc36){var _0x4393d8=this;return new Promise(function(_0x17ee1d,_0x4699b0){return db['Attachment'][_0x21bb('0x18')](_0x15fc36[_0x21bb('0x19')],{'raw':_0x15fc36[_0x21bb('0x1a')]?_0x15fc36['options'][_0x21bb('0x1b')]===undefined?!![]:![]:!![]})[_0x21bb('0x1c')](function(_0x271a9f){logger[_0x21bb('0x14')](_0x21bb('0x17'),_0x15fc36);logger[_0x21bb('0xd')](_0x21bb('0x17'),_0x15fc36,JSON[_0x21bb('0xf')](_0x271a9f));_0x17ee1d(_0x271a9f);})[_0x21bb('0x16')](function(_0x3d4814){logger[_0x21bb('0x10')](_0x21bb('0x17'),_0x3d4814['message'],_0x15fc36);_0x4699b0(_0x4393d8[_0x21bb('0x10')](0x1f4,_0x3d4814[_0x21bb('0x13')]));});});}; \ No newline at end of file +var _0x1752=['error','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x3c6678,_0x5b7a3a){var _0x4cdff2=function(_0x3c761b){while(--_0x3c761b){_0x3c6678['push'](_0x3c6678['shift']());}};_0x4cdff2(++_0x5b7a3a);}(_0x1752,0xa5));var _0x2175=function(_0x1ccc56,_0x26d7c1){_0x1ccc56=_0x1ccc56-0x0;var _0xf831ab=_0x1752[_0x1ccc56];return _0xf831ab;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var moment=require(_0x2175('0x1'));var BPromise=require(_0x2175('0x2'));var rs=require(_0x2175('0x3'));var fs=require('fs');var Redis=require(_0x2175('0x4'));var db=require(_0x2175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2175('0x6'))(_0x2175('0x7'));var config=require(_0x2175('0x8'));var jayson=require(_0x2175('0x9'));var client=jayson[_0x2175('0xa')][_0x2175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ca87,_0x1bd937,_0x339e4d){return new BPromise(function(_0x672ff1,_0x516ccc){return client[_0x2175('0xc')](_0x19ca87,_0x339e4d)[_0x2175('0xd')](function(_0x407a71){logger[_0x2175('0xe')](_0x2175('0xf'),_0x1bd937,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x1bd937,_0x2175('0x10'),JSON['stringify'](_0x407a71));if(_0x407a71['error']){if(_0x407a71['error']['code']===0x1f4){logger[_0x2175('0x11')]('Attachment,\x20%s,\x20%s',_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x516ccc(_0x407a71['error'][_0x2175('0x12')]);}logger[_0x2175('0x11')](_0x2175('0xf'),_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x672ff1(_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);}else{logger[_0x2175('0xe')]('Attachment,\x20%s,\x20%s',_0x1bd937,'request\x20sent');_0x672ff1(_0x407a71[_0x2175('0x13')][_0x2175('0x12')]);}})[_0x2175('0x14')](function(_0x4e7cf1){logger['error']('Attachment,\x20%s,\x20%s',_0x1bd937,_0x4e7cf1);_0x516ccc(_0x4e7cf1);});});}exports[_0x2175('0x15')]=function(_0x377586){var _0x4cb089=this;return new Promise(function(_0x53576c,_0x405fb1){return db[_0x2175('0x16')][_0x2175('0x17')](_0x377586['body'],{'raw':_0x377586[_0x2175('0x18')]?_0x377586['options'][_0x2175('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x37818a){logger['info']('CreateAttachment',_0x377586);logger['debug'](_0x2175('0x15'),_0x377586,JSON['stringify'](_0x37818a));_0x53576c(_0x37818a);})[_0x2175('0x14')](function(_0x46ea57){logger[_0x2175('0x11')](_0x2175('0x15'),_0x46ea57[_0x2175('0x12')],_0x377586);_0x405fb1(_0x4cb089[_0x2175('0x11')](0x1f4,_0x46ea57['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 4d8c2a6..f48adaf 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4f9f5a,_0x19c14a){var _0x103607=function(_0x36d204){while(--_0x36d204){_0x4f9f5a['push'](_0x4f9f5a['shift']());}};_0x103607(++_0x19c14a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x532933,_0x53c681){_0x532933=_0x532933-0x0;var _0xb373fa=_0x5f2f[_0x532933];return _0xb373fa;};'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('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x321e04,_0x10d235){var _0x44f9c0=function(_0x12fda8){while(--_0x12fda8){_0x321e04['push'](_0x321e04['shift']());}};_0x44f9c0(++_0x10d235);}(_0x5f2f,0x73));var _0xf5f2=function(_0x297d0c,_0x37be75){_0x297d0c=_0x297d0c-0x0;var _0x540053=_0x5f2f[_0x297d0c];return _0x540053;};'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('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('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 ac541e8..0a6a661 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 _0x801f=['getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport-local','bluebird','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','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','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blockedAt','online','user','then','name','blockDuration','blocked','add','minutes','clearBlockUser'];(function(_0x26baef,_0xcac795){var _0x443b21=function(_0xe81168){while(--_0xe81168){_0x26baef['push'](_0x26baef['shift']());}};_0x443b21(++_0xcac795);}(_0x801f,0x153));var _0xf801=function(_0x18ff42,_0x4a3b2d){_0x18ff42=_0x18ff42-0x0;var _0x1b850c=_0x801f[_0x18ff42];return _0x1b850c;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xf801('0x0'))['Strategy'];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xf801('0x1'));var util=require('util');var db=require(_0xf801('0x2'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xf801('0x3'));var config=require(_0xf801('0x4'));var logger=require(_0xf801('0x5'))('api');function isActiveDirectoryConfigured(_0x2faf40){var _0x4cf509=![];if(typeof _0x2faf40[_0xf801('0x6')]!=='undefined'){_0x4cf509=_0x2faf40[_0xf801('0x6')][_0xf801('0x7')]&&_0x2faf40[_0xf801('0x6')][_0xf801('0x8')]&&_0x2faf40['activedirectory'][_0xf801('0x9')];}return _0x4cf509;}function adAuthenticate(_0x1c341e,_0x3b5f0f,_0x59c03b){return new BPromise(function(_0x42565c,_0x16eec8){try{var _0x31e9d4=new ActiveDirectory(_0x1c341e);_0x31e9d4[_0xf801('0xa')](_0x3b5f0f,_0x59c03b,function(_0x2dbec7,_0x15c5a7){if(_0x2dbec7){logger[_0xf801('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x3b5f0f,util['inspect'](_0x2dbec7,{'showHidden':![],'depth':null}));_0x16eec8(_0xf801('0xc'));}else if(!_0x15c5a7){logger[_0xf801('0xb')](_0xf801('0xd'),_0x3b5f0f);_0x16eec8(_0xf801('0xc'));}else{_0x42565c(_0x15c5a7);}});}catch(_0x289599){_0x16eec8(_0x289599);}});}function ActiveDirectoryAuthenticate(_0x31c0a5,_0x2bbe7c,_0x33a921,_0x196321){var _0x2e768f,_0x207aaa;if(!isActiveDirectoryConfigured(config)){logger[_0xf801('0xb')](_0xf801('0xe'),_0x2bbe7c);return _0x196321(null,![],{'message':_0xf801('0xc')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xf801('0xf'),'blockDuration'],'raw':!![]})['then'](function(_0x1481d2){_0x2e768f=_0x1481d2;if(!_0x2e768f[_0xf801('0xf')]){logger['error'](_0xf801('0x10'),_0x2bbe7c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x31c0a5['findOne']({'attributes':['id','name',_0xf801('0x11'),_0xf801('0x12'),_0xf801('0x13'),'disabled','blocked',_0xf801('0x14'),_0xf801('0x15')],'where':{'name':_0x2bbe7c,'role':{'$or':['admin',_0xf801('0x16'),'agent']},'adSsoEnabled':!![]}});})[_0xf801('0x17')](function(_0x5a10c4){if(!_0x5a10c4||_0x5a10c4&&_0x5a10c4[_0xf801('0x18')]!==_0x2bbe7c){throw new Error(_0xf801('0xc'));}_0x207aaa=_0x5a10c4;var _0x3e3773=_0x207aaa[_0xf801('0x18')]+'@'+config[_0xf801('0x6')][_0xf801('0x9')];return adAuthenticate(config[_0xf801('0x6')],_0x3e3773,_0x33a921);})[_0xf801('0x17')](function(_0x505a1e){if(_0x207aaa['disabled']){throw new Error(_0xf801('0xc'));}if(_0x2e768f[_0xf801('0x19')]>0x0){if(_0x207aaa[_0xf801('0x1a')]){if(moment(_0x207aaa[_0xf801('0x14')])[_0xf801('0x1b')](_0x2e768f['blockDuration'],_0xf801('0x1c'))>moment()){throw new Error(_0xf801('0xc'));}return utils[_0xf801('0x1d')](_0x207aaa,0x0,![],null)[_0xf801('0x17')](function(){return utils[_0xf801('0x1e')](_0x207aaa);})[_0xf801('0x17')](function(){return _0x196321(null,_0x207aaa);});}else{return utils['getLicense'](_0x207aaa)[_0xf801('0x17')](function(){return _0x196321(null,_0x207aaa);});}}else{return utils['getLicense'](_0x207aaa)[_0xf801('0x17')](function(){return _0x196321(null,_0x207aaa);});}})[_0xf801('0x1f')](function(_0x15bacf){return _0x196321(null,![],_0x15bacf);});}function handleError(_0x3998be,_0x1871ba,_0x4534aa){return _0x3998be[_0xf801('0x20')](_0x1871ba||0x1f4)[_0xf801('0x21')]({'message':_0x4534aa?_0x4534aa[_0xf801('0x22')]||_0x4534aa:''});}exports[_0xf801('0x23')]=function(_0x228752,_0xce362c,_0x597e44){passport[_0xf801('0xa')](_0xf801('0x24'),function(_0x3dc8f1,_0x681c80,_0x57d2a7){var _0x23c5ab=_0x3dc8f1||_0x57d2a7;if(_0x23c5ab){return handleError(_0xce362c,0x191,_0x23c5ab);}if(!_0x681c80){return handleError(_0xce362c,0x194,{'message':_0xf801('0x25')});}else{var _0x3d4f76={'payload':{'id':_0x681c80['id'],'role':_0x681c80[_0xf801('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xf801('0x26')](_0x3d4f76)['then'](function(_0x3164e7){_0xce362c['json']({'id':_0x681c80['id'],'token':_0x3164e7,'statusCall':'','isAlreadyLogged':_0x681c80[_0xf801('0x15')]});});}})(_0x228752,_0xce362c,_0x597e44);};passport[_0xf801('0x27')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3b731f,_0xdc69b3,_0x4be2db){return ActiveDirectoryAuthenticate(db[_0xf801('0x28')],_0x3b731f,_0xdc69b3,_0x4be2db);})); \ No newline at end of file +var _0x78ba=['../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','agent','domain','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util'];(function(_0x299bc8,_0x43d635){var _0xf6846c=function(_0x4763ec){while(--_0x4763ec){_0x299bc8['push'](_0x299bc8['shift']());}};_0xf6846c(++_0x43d635);}(_0x78ba,0x19a));var _0xa78b=function(_0x3a9ec7,_0x325adb){_0x3a9ec7=_0x3a9ec7-0x0;var _0x3aca73=_0x78ba[_0x3a9ec7];return _0x3aca73;};'use strict';var passport=require(_0xa78b('0x0'));var LocalStrategy=require(_0xa78b('0x1'))[_0xa78b('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xa78b('0x3'));var BPromise=require(_0xa78b('0x4'));var util=require(_0xa78b('0x5'));var db=require(_0xa78b('0x6'))['db'];var authService=require(_0xa78b('0x7'));var utils=require(_0xa78b('0x8'));var config=require(_0xa78b('0x9'));var logger=require(_0xa78b('0xa'))(_0xa78b('0xb'));function isActiveDirectoryConfigured(_0x399593){var _0x5d0fac=![];if(typeof _0x399593[_0xa78b('0xc')]!==_0xa78b('0xd')){_0x5d0fac=_0x399593[_0xa78b('0xc')][_0xa78b('0xe')]&&_0x399593[_0xa78b('0xc')][_0xa78b('0xf')]&&_0x399593[_0xa78b('0xc')]['domain'];}return _0x5d0fac;}function adAuthenticate(_0x495fe3,_0x5df609,_0x4fd99a){return new BPromise(function(_0x526723,_0x5c24e1){try{var _0x182668=new ActiveDirectory(_0x495fe3);_0x182668[_0xa78b('0x10')](_0x5df609,_0x4fd99a,function(_0x3bc9f7,_0x26ca4d){if(_0x3bc9f7){logger['error'](_0xa78b('0x11'),_0x5df609,util[_0xa78b('0x12')](_0x3bc9f7,{'showHidden':![],'depth':null}));_0x5c24e1(_0xa78b('0x13'));}else if(!_0x26ca4d){logger[_0xa78b('0x14')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5df609);_0x5c24e1(_0xa78b('0x13'));}else{_0x526723(_0x26ca4d);}});}catch(_0x3d2596){_0x5c24e1(_0x3d2596);}});}function ActiveDirectoryAuthenticate(_0x2a3dfd,_0x45706d,_0x597bf0,_0x1a2481){var _0xf2e215,_0x524d39;if(!isActiveDirectoryConfigured(config)){logger[_0xa78b('0x14')](_0xa78b('0x15'),_0x45706d);return _0x1a2481(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xa78b('0x16')][_0xa78b('0x17')]({'where':{'id':0x1},'attributes':[_0xa78b('0x18'),'blockDuration'],'raw':!![]})[_0xa78b('0x19')](function(_0xd6fc03){_0xf2e215=_0xd6fc03;if(!_0xf2e215['adSsoEnabled']){logger[_0xa78b('0x14')](_0xa78b('0x1a'),_0x45706d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2a3dfd['findOne']({'attributes':['id',_0xa78b('0x1b'),_0xa78b('0x1c'),_0xa78b('0x1d'),_0xa78b('0x1e'),_0xa78b('0x1f'),'blocked',_0xa78b('0x20'),_0xa78b('0x21')],'where':{'name':_0x45706d,'role':{'$or':[_0xa78b('0x22'),'user',_0xa78b('0x23')]},'adSsoEnabled':!![]}});})[_0xa78b('0x19')](function(_0x2f560d){if(!_0x2f560d||_0x2f560d&&_0x2f560d[_0xa78b('0x1b')]!==_0x45706d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x524d39=_0x2f560d;var _0x28fff6=_0x524d39[_0xa78b('0x1b')]+'@'+config[_0xa78b('0xc')][_0xa78b('0x24')];return adAuthenticate(config[_0xa78b('0xc')],_0x28fff6,_0x597bf0);})['then'](function(_0x558ec0){if(_0x524d39[_0xa78b('0x1f')]){throw new Error(_0xa78b('0x13'));}if(_0xf2e215['blockDuration']>0x0){if(_0x524d39['blocked']){if(moment(_0x524d39['blockedAt'])[_0xa78b('0x25')](_0xf2e215['blockDuration'],_0xa78b('0x26'))>moment()){throw new Error(_0xa78b('0x13'));}return utils[_0xa78b('0x27')](_0x524d39,0x0,![],null)[_0xa78b('0x19')](function(){return utils[_0xa78b('0x28')](_0x524d39);})[_0xa78b('0x19')](function(){return _0x1a2481(null,_0x524d39);});}else{return utils['getLicense'](_0x524d39)['then'](function(){return _0x1a2481(null,_0x524d39);});}}else{return utils['getLicense'](_0x524d39)[_0xa78b('0x19')](function(){return _0x1a2481(null,_0x524d39);});}})[_0xa78b('0x29')](function(_0x813a49){return _0x1a2481(null,![],_0x813a49);});}function handleError(_0x1b47f6,_0x31ecc2,_0x2d7f09){return _0x1b47f6[_0xa78b('0x2a')](_0x31ecc2||0x1f4)[_0xa78b('0x2b')]({'message':_0x2d7f09?_0x2d7f09[_0xa78b('0x2c')]||_0x2d7f09:''});}exports[_0xa78b('0x2d')]=function(_0x4a0a33,_0xccd60b,_0x362830){passport['authenticate'](_0xa78b('0x2e'),function(_0x4588de,_0x229996,_0x224505){var _0x4a1e00=_0x4588de||_0x224505;if(_0x4a1e00){return handleError(_0xccd60b,0x191,_0x4a1e00);}if(!_0x229996){return handleError(_0xccd60b,0x194,{'message':_0xa78b('0x2f')});}else{var _0x254c21={'payload':{'id':_0x229996['id'],'role':_0x229996[_0xa78b('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0xa78b('0x30')](_0x254c21)['then'](function(_0x5a1fb6){_0xccd60b[_0xa78b('0x31')]({'id':_0x229996['id'],'token':_0x5a1fb6,'statusCall':'','isAlreadyLogged':_0x229996[_0xa78b('0x21')]});});}})(_0x4a0a33,_0xccd60b,_0x362830);};passport[_0xa78b('0x32')](_0xa78b('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0xa78b('0x1c')},function(_0x4379e8,_0x57df4d,_0x53a776){return ActiveDirectoryAuthenticate(db[_0xa78b('0x33')],_0x4379e8,_0x57df4d,_0x53a776);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 3a8870c..334fb82 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 _0x6c5c=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x2b9691,_0x590a56){var _0x4d2866=function(_0xd95354){while(--_0xd95354){_0x2b9691['push'](_0x2b9691['shift']());}};_0x4d2866(++_0x590a56);}(_0x6c5c,0xe2));var _0xc6c5=function(_0x16d16e,_0x47d32b){_0x16d16e=_0x16d16e-0x0;var _0x2fbaf7=_0x6c5c[_0x16d16e];return _0x2fbaf7;};'use strict';var express=require(_0xc6c5('0x0'));var router=express['Router']();var controller=require(_0xc6c5('0x1'));router[_0xc6c5('0x2')]('/',controller[_0xc6c5('0x3')]);module[_0xc6c5('0x4')]=router; \ No newline at end of file +var _0xa50d=['express','Router','./authActiveDirectory.controller','login'];(function(_0x253cdb,_0x142a36){var _0x1ae7f4=function(_0x476a82){while(--_0x476a82){_0x253cdb['push'](_0x253cdb['shift']());}};_0x1ae7f4(++_0x142a36);}(_0xa50d,0x1ec));var _0xda50=function(_0x53e32a,_0x3c7964){_0x53e32a=_0x53e32a-0x0;var _0x15a8bf=_0xa50d[_0x53e32a];return _0x15a8bf;};'use strict';var express=require(_0xda50('0x0'));var router=express[_0xda50('0x1')]();var controller=require(_0xda50('0x2'));router['post']('/',controller[_0xda50('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 72ed8c9..958917c 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x35a3bd,_0x251b15){_0x35a3bd=_0x35a3bd-0x0;var _0x440c6d=_0x7a54[_0x35a3bd];return _0x440c6d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _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(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x3a3a5f,_0x4ea757){_0x3a3a5f=_0x3a3a5f-0x0;var _0x545227=_0x7a54[_0x3a3a5f];return _0x545227;};'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 d181745..cb5d93f 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 _0x0b8d=['passport','Router','./authGoogle.controller','get','login','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0b8d,0xbd));var _0xd0b8=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x0b8d[_0x1762b4];return _0x29beda;};'use strict';var express=require(_0xd0b8('0x0'));var passport=require(_0xd0b8('0x1'));var router=express[_0xd0b8('0x2')]();var controller=require(_0xd0b8('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xd0b8('0x4')]('/',controller[_0xd0b8('0x5')]);router[_0xd0b8('0x4')](_0xd0b8('0x6'),controller[_0xd0b8('0x7')],authService[_0xd0b8('0x8')],userController[_0xd0b8('0x5')],authService[_0xd0b8('0x9')]);module['exports']=router; \ No newline at end of file +var _0x6e12=['passport','Router','./authGoogle.controller','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x18be7e,_0x32fd6c){var _0x44139b=function(_0x219c43){while(--_0x219c43){_0x18be7e['push'](_0x18be7e['shift']());}};_0x44139b(++_0x32fd6c);}(_0x6e12,0x154));var _0x26e1=function(_0x40376f,_0x53f0e8){_0x40376f=_0x40376f-0x0;var _0x2db0e4=_0x6e12[_0x40376f];return _0x2db0e4;};'use strict';var express=require(_0x26e1('0x0'));var passport=require(_0x26e1('0x1'));var router=express[_0x26e1('0x2')]();var controller=require(_0x26e1('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x26e1('0x4'));router[_0x26e1('0x5')]('/',controller[_0x26e1('0x6')]);router['get']('/callback',controller[_0x26e1('0x7')],authService[_0x26e1('0x8')],userController[_0x26e1('0x6')],authService[_0x26e1('0x9')]);module[_0x26e1('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e6da28f..6774cb3 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 _0xd71b=['getSmtpOptions','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','signToken','online','forgot','body','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','password','resetPasswordExpires','save','Password\x20reset!','local-login','util','passport','passport-local','randomstring','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','blocked','blockedAt','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0xd71b,0xc0));var _0xbd71=function(_0x247875,_0x26b111){_0x247875=_0x247875-0x0;var _0x1ebf7e=_0xd71b[_0x247875];return _0x1ebf7e;};'use strict';var util=require(_0xbd71('0x0'));var passport=require(_0xbd71('0x1'));var LocalStrategy=require(_0xbd71('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xbd71('0x3'));var moment=require('moment');var db=require(_0xbd71('0x4'))['db'];var authService=require(_0xbd71('0x5'));var utils=require('../../config/utils');var client=jayson[_0xbd71('0x6')][_0xbd71('0x7')]({'port':0x232b});function localAuthenticate(_0x269792,_0x554ac9,_0x5576a8,_0x34a9cc){var _0xf923e6,_0x52ff7d;return db[_0xbd71('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xbd71('0x9'),_0xbd71('0xa')],'raw':!![]})[_0xbd71('0xb')](function(_0x5111db){_0xf923e6=_0x5111db;return _0x269792[_0xbd71('0xc')]({'attributes':['id',_0xbd71('0xd'),'password',_0xbd71('0xe'),_0xbd71('0xf'),'disabled',_0xbd71('0x10'),_0xbd71('0x11'),_0xbd71('0x12')],'where':{'name':_0x554ac9,'role':{'$or':['admin',_0xbd71('0x13'),'agent']}}});})['then'](function(_0x80231c){if(!_0x80231c||_0x80231c&&_0x80231c['name']!==_0x554ac9){throw new Error(_0xbd71('0x14'));}else{_0x52ff7d=_0x80231c;return _0x52ff7d;}})[_0xbd71('0xb')](function(){_0x52ff7d[_0xbd71('0x15')](_0x5576a8,function(_0x2375d7,_0x38473c){var _0x3f6f79=_0x52ff7d[_0xbd71('0x12')]+0x1;if(_0x2375d7){return _0x34a9cc(_0x2375d7);}else if(!_0x38473c){if(_0x52ff7d[_0xbd71('0x16')]){return _0x34a9cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xf923e6['allowedLoginAttempts']>0x0){if(_0x52ff7d['blocked']){if(_0xf923e6['blockDuration']>0x0){if(moment(_0x52ff7d[_0xbd71('0x11')])[_0xbd71('0x17')](_0xf923e6[_0xbd71('0xa')],'minutes')>moment()){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}else{return utils[_0xbd71('0x18')](_0x52ff7d,_0x3f6f79,![],null)[_0xbd71('0xb')](function(){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});});}}else{return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}}else{if(_0x3f6f79>=_0xf923e6[_0xbd71('0x9')]){return utils[_0xbd71('0x18')](_0x52ff7d,0x0,!![],moment())[_0xbd71('0xb')](function(){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});});}else{return utils[_0xbd71('0x18')](_0x52ff7d,_0x3f6f79,![],null)[_0xbd71('0xb')](function(){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});});}}}else{return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}}else{if(_0x52ff7d['disabled']){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}else if(_0xf923e6[_0xbd71('0x9')]>0x0){if(_0x52ff7d[_0xbd71('0x10')]){if(_0xf923e6[_0xbd71('0xa')]>0x0){if(moment(_0x52ff7d[_0xbd71('0x11')])[_0xbd71('0x17')](_0xf923e6[_0xbd71('0xa')],_0xbd71('0x19'))>moment()){return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}else{return utils[_0xbd71('0x18')](_0x52ff7d,0x0,![],null)[_0xbd71('0xb')](function(){return utils[_0xbd71('0x1a')](_0x52ff7d);})[_0xbd71('0xb')](function(){return _0x34a9cc(null,_0x52ff7d);});}}else{return _0x34a9cc(null,![],{'message':_0xbd71('0x14')});}}else{return utils[_0xbd71('0x18')](_0x52ff7d,0x0,![],null)['then'](function(){return utils[_0xbd71('0x1a')](_0x52ff7d);})[_0xbd71('0xb')](function(){return _0x34a9cc(null,_0x52ff7d);})[_0xbd71('0x1b')](function(_0x26953d){return _0x34a9cc(null,![],_0x26953d);});}}else{if(_0x52ff7d['blocked']){return _0x34a9cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xbd71('0x1a')](_0x52ff7d)[_0xbd71('0xb')](function(){return _0x34a9cc(null,_0x52ff7d);});}}}});})[_0xbd71('0x1b')](function(_0x429990){return _0x34a9cc(null,![],_0x429990);});}function sendServiceMail(_0x48798e){return db[_0xbd71('0x1c')][_0xbd71('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xbd71('0xd'),_0xbd71('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0xbd71('0x1f'),'include':[{'model':db[_0xbd71('0x20')],'as':_0xbd71('0x20')}]}]})[_0xbd71('0xb')](function(_0x3b7db7){if(!_0x3b7db7){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3ee4b6=_0x3b7db7[_0xbd71('0x21')]();var _0x3a3761={'account':_0x3ee4b6,'message':_['merge']({'from':util[_0xbd71('0x22')]('\x22%s\x22\x20<%s>',_0x3b7db7['name'],_0x3b7db7['email']||_0x3b7db7[_0xbd71('0x1f')][_0xbd71('0x13')])},_0x48798e)};return client[_0xbd71('0x23')](_0xbd71('0x24'),_0x3a3761);})[_0xbd71('0xb')](function(_0x458469){if(_0x458469[_0xbd71('0x25')]){throw new Error(util[_0xbd71('0x22')](_0xbd71('0x26'),_0x458469['error']['message']||JSON[_0xbd71('0x27')](_0x458469['error'])));}return!![];});}function handleError(_0x528852,_0x9cdaf1,_0x9dad5c){return _0x528852['status'](_0x9cdaf1||0x1f4)[_0xbd71('0x28')]({'message':_0x9dad5c?_0x9dad5c[_0xbd71('0x29')]||_0x9dad5c:''});}exports[_0xbd71('0x2a')]=function(_0x57c09e,_0x1ebe36,_0x1cbe56){passport[_0xbd71('0x15')]('local-login',function(_0xe24155,_0x2b215c,_0x4f22c1){var _0x1c6ae3=_0xe24155||_0x4f22c1;if(_0x1c6ae3){return handleError(_0x1ebe36,0x191,_0x1c6ae3);}if(!_0x2b215c){return handleError(_0x1ebe36,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x268993={'payload':{'id':_0x2b215c['id'],'role':_0x2b215c[_0xbd71('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xbd71('0x2b')](_0x268993)[_0xbd71('0xb')](function(_0x2e852a){_0x1ebe36['json']({'id':_0x2b215c['id'],'token':_0x2e852a,'statusCall':'','isAlreadyLogged':_0x2b215c[_0xbd71('0x2c')]});});}})(_0x57c09e,_0x1ebe36,_0x1cbe56);};exports[_0xbd71('0x2d')]=function(_0x29ae33,_0x228985){if(!_0x29ae33[_0xbd71('0x2e')][_0xbd71('0x1e')]){return handleError(_0x228985,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4464bd=rs['generate']();_0x29ae33[_0xbd71('0x2e')][_0xbd71('0x1e')]=_0x29ae33[_0xbd71('0x2e')][_0xbd71('0x1e')][_0xbd71('0x2f')]()[_0xbd71('0x30')]();var _0x8199ba;return db[_0xbd71('0x8')][_0xbd71('0xc')]({'where':{'id':0x1},'attributes':[_0xbd71('0x9'),_0xbd71('0xa')],'raw':!![]})[_0xbd71('0xb')](function(_0x25c64c){_0x8199ba=_0x25c64c;return db['User'][_0xbd71('0x1d')]({'where':{'email':_0x29ae33[_0xbd71('0x2e')][_0xbd71('0x1e')]}});})[_0xbd71('0xb')](function(_0x54ba28){if(!_0x54ba28){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x54ba28[_0xbd71('0x16')]){throw new Error(_0xbd71('0x31'));}if(_0x54ba28[_0xbd71('0x10')]){if(moment(_0x54ba28[_0xbd71('0x11')])['add'](_0x8199ba[_0xbd71('0xa')],'minutes')>moment()){throw new Error(_0xbd71('0x32'));}else{_0x54ba28[_0xbd71('0x10')]=![];_0x54ba28[_0xbd71('0x11')]=null;}}_0x54ba28[_0xbd71('0x33')]=_0x4464bd;_0x54ba28['resetPasswordExpires']=Date[_0xbd71('0x34')]()+0x36ee80;return _0x54ba28['save']();})[_0xbd71('0xb')](function(){return sendServiceMail({'to':_0x29ae33['body'][_0xbd71('0x1e')],'subject':_0xbd71('0x35'),'text':_0xbd71('0x36')+_0xbd71('0x37')+_0xbd71('0x38')+_0x29ae33['headers'][_0xbd71('0x39')]+'/reset/'+_0x4464bd+'\x0a\x0a'+_0xbd71('0x3a')});})[_0xbd71('0xb')](function(){_0x228985[_0xbd71('0x3b')](0xc8)[_0xbd71('0x28')]({'message':_0xbd71('0x3c')});})[_0xbd71('0x1b')](function(_0xf75cfb){return handleError(_0x228985,0x1f4,_0xf75cfb);});};exports[_0xbd71('0x3d')]=function(_0x2d98b2,_0x1fd166){return db[_0xbd71('0x3e')][_0xbd71('0x1d')]({'where':{'resetPasswordToken':_0x2d98b2['params'][_0xbd71('0x3f')],'resetPasswordExpires':{'$gt':Date[_0xbd71('0x34')]()}}})[_0xbd71('0xb')](function(_0x1f13e1){if(!_0x1f13e1){throw new Error(_0xbd71('0x40'));}return db[_0xbd71('0x8')]['findOne']({'attributes':['id','securePassword',_0xbd71('0x41'),_0xbd71('0x42')]})[_0xbd71('0xb')](function(_0x43bed0){if(_0x43bed0[_0xbd71('0x43')])authService[_0xbd71('0x44')](_0x2d98b2[_0xbd71('0x2e')]['password']);if(!_0x43bed0[_0xbd71('0x41')]||!_0x1f13e1[_0xbd71('0x45')])return _0x1f13e1;authService['validatePasswordHistory'](_0x2d98b2['body'][_0xbd71('0x46')],_0x1f13e1[_0xbd71('0x45')],_0x43bed0[_0xbd71('0x42')]);return _0x1f13e1;})[_0xbd71('0xb')](function(){_0x1f13e1[_0xbd71('0x46')]=_0x2d98b2[_0xbd71('0x2e')][_0xbd71('0x46')];_0x1f13e1['resetPasswordToken']=null;_0x1f13e1[_0xbd71('0x47')]=null;return _0x1f13e1[_0xbd71('0x48')]();});})['then'](function(){_0x1fd166[_0xbd71('0x3b')](0xc8)['send']({'message':_0xbd71('0x49')});})['catch'](function(_0x196623){return handleError(_0x1fd166,0x1f4,_0x196623);});};passport['use'](_0xbd71('0x4a'),new LocalStrategy({'usernameField':_0xbd71('0xd'),'passwordField':_0xbd71('0x46')},function(_0x58c272,_0xc4a9eb,_0x69ab6){return localAuthenticate(db[_0xbd71('0x3e')],_0x58c272,_0xc4a9eb,_0x69ab6);})); \ No newline at end of file +var _0x9815=['blockDuration','add','minutes','clearBlockUser','getLicense','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','catch','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','blocked','blockedAt','loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9815,0x1cc));var _0x5981=function(_0x49c3e2,_0x1dcade){_0x49c3e2=_0x49c3e2-0x0;var _0x3cafda=_0x9815[_0x49c3e2];return _0x3cafda;};'use strict';var util=require('util');var passport=require(_0x5981('0x0'));var LocalStrategy=require(_0x5981('0x1'))['Strategy'];var jayson=require(_0x5981('0x2'));var _=require(_0x5981('0x3'));var rs=require(_0x5981('0x4'));var moment=require('moment');var db=require(_0x5981('0x5'))['db'];var authService=require(_0x5981('0x6'));var utils=require(_0x5981('0x7'));var client=jayson[_0x5981('0x8')][_0x5981('0x9')]({'port':0x232b});function localAuthenticate(_0x2490da,_0x1003cb,_0x5e3eea,_0x4b251a){var _0x4c1231,_0x336c0a;return db[_0x5981('0xa')][_0x5981('0xb')]({'where':{'id':0x1},'attributes':[_0x5981('0xc'),'blockDuration'],'raw':!![]})[_0x5981('0xd')](function(_0x3a500e){_0x4c1231=_0x3a500e;return _0x2490da[_0x5981('0xb')]({'attributes':['id','name',_0x5981('0xe'),_0x5981('0xf'),_0x5981('0x10'),'disabled',_0x5981('0x11'),_0x5981('0x12'),_0x5981('0x13')],'where':{'name':_0x1003cb,'role':{'$or':['admin',_0x5981('0x14'),_0x5981('0x15')]}}});})[_0x5981('0xd')](function(_0x5b1707){if(!_0x5b1707||_0x5b1707&&_0x5b1707[_0x5981('0x16')]!==_0x1003cb){throw new Error(_0x5981('0x17'));}else{_0x336c0a=_0x5b1707;return _0x336c0a;}})[_0x5981('0xd')](function(){_0x336c0a[_0x5981('0x18')](_0x5e3eea,function(_0x556c84,_0x1e3af9){var _0x12d603=_0x336c0a[_0x5981('0x13')]+0x1;if(_0x556c84){return _0x4b251a(_0x556c84);}else if(!_0x1e3af9){if(_0x336c0a[_0x5981('0x19')]){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else if(_0x4c1231[_0x5981('0xc')]>0x0){if(_0x336c0a[_0x5981('0x11')]){if(_0x4c1231[_0x5981('0x1a')]>0x0){if(moment(_0x336c0a[_0x5981('0x12')])[_0x5981('0x1b')](_0x4c1231[_0x5981('0x1a')],_0x5981('0x1c'))>moment()){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1d')](_0x336c0a,_0x12d603,![],null)[_0x5981('0xd')](function(){return _0x4b251a(null,![],{'message':_0x5981('0x17')});});}}else{return _0x4b251a(null,![],{'message':_0x5981('0x17')});}}else{if(_0x12d603>=_0x4c1231[_0x5981('0xc')]){return utils['clearBlockUser'](_0x336c0a,0x0,!![],moment())[_0x5981('0xd')](function(){return _0x4b251a(null,![],{'message':_0x5981('0x17')});});}else{return utils['clearBlockUser'](_0x336c0a,_0x12d603,![],null)['then'](function(){return _0x4b251a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4b251a(null,![],{'message':_0x5981('0x17')});}}else{if(_0x336c0a['disabled']){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else if(_0x4c1231[_0x5981('0xc')]>0x0){if(_0x336c0a[_0x5981('0x11')]){if(_0x4c1231[_0x5981('0x1a')]>0x0){if(moment(_0x336c0a[_0x5981('0x12')])[_0x5981('0x1b')](_0x4c1231[_0x5981('0x1a')],_0x5981('0x1c'))>moment()){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1d')](_0x336c0a,0x0,![],null)[_0x5981('0xd')](function(){return utils[_0x5981('0x1e')](_0x336c0a);})[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);});}}else{return _0x4b251a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5981('0x1d')](_0x336c0a,0x0,![],null)[_0x5981('0xd')](function(){return utils[_0x5981('0x1e')](_0x336c0a);})[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);})['catch'](function(_0x5eee9c){return _0x4b251a(null,![],_0x5eee9c);});}}else{if(_0x336c0a[_0x5981('0x11')]){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1e')](_0x336c0a)[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);});}}}});})['catch'](function(_0x3f1c49){return _0x4b251a(null,![],_0x3f1c49);});}function sendServiceMail(_0x413d2a){return db[_0x5981('0x1f')][_0x5981('0x20')]({'where':{'service':!![]},'attributes':['id',_0x5981('0x16'),_0x5981('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x5981('0x22')],'as':'CloudProvider'}]}]})[_0x5981('0xd')](function(_0x5565a4){if(!_0x5565a4){throw new Error(_0x5981('0x23'));}var _0x270318=_0x5565a4[_0x5981('0x24')]();var _0x3319fd={'account':_0x270318,'message':_[_0x5981('0x25')]({'from':util[_0x5981('0x26')](_0x5981('0x27'),_0x5565a4[_0x5981('0x16')],_0x5565a4[_0x5981('0x21')]||_0x5565a4[_0x5981('0x28')][_0x5981('0x14')])},_0x413d2a)};return client[_0x5981('0x29')]('SendMail',_0x3319fd);})[_0x5981('0xd')](function(_0x5330bb){if(_0x5330bb[_0x5981('0x2a')]){throw new Error(util[_0x5981('0x26')](_0x5981('0x2b'),_0x5330bb[_0x5981('0x2a')]['message']||JSON['stringify'](_0x5330bb['error'])));}return!![];});}function handleError(_0x2da7c3,_0x2a6275,_0x517e91){return _0x2da7c3[_0x5981('0x2c')](_0x2a6275||0x1f4)[_0x5981('0x2d')]({'message':_0x517e91?_0x517e91['message']||_0x517e91:''});}exports[_0x5981('0x2e')]=function(_0x2e200a,_0xe57a89,_0x416031){passport[_0x5981('0x18')](_0x5981('0x2f'),function(_0x837a64,_0x3866c4,_0x1161a9){var _0x288a1f=_0x837a64||_0x1161a9;if(_0x288a1f){return handleError(_0xe57a89,0x191,_0x288a1f);}if(!_0x3866c4){return handleError(_0xe57a89,0x194,{'message':_0x5981('0x30')});}else{var _0x21ba15={'payload':{'id':_0x3866c4['id'],'role':_0x3866c4[_0x5981('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x5981('0x31')](_0x21ba15)[_0x5981('0xd')](function(_0x5b1228){_0xe57a89[_0x5981('0x32')]({'id':_0x3866c4['id'],'token':_0x5b1228,'statusCall':'','isAlreadyLogged':_0x3866c4[_0x5981('0x33')]});});}})(_0x2e200a,_0xe57a89,_0x416031);};exports[_0x5981('0x34')]=function(_0x5395e8,_0xeb3024){if(!_0x5395e8['body']['email']){return handleError(_0xeb3024,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x749e55=rs[_0x5981('0x35')]();_0x5395e8[_0x5981('0x36')]['email']=_0x5395e8[_0x5981('0x36')]['email'][_0x5981('0x37')]()[_0x5981('0x38')]();var _0x12e1e5;return db[_0x5981('0xa')][_0x5981('0xb')]({'where':{'id':0x1},'attributes':[_0x5981('0xc'),'blockDuration'],'raw':!![]})[_0x5981('0xd')](function(_0x2d18e0){_0x12e1e5=_0x2d18e0;return db[_0x5981('0x39')][_0x5981('0x20')]({'where':{'email':_0x5395e8[_0x5981('0x36')][_0x5981('0x21')]}});})[_0x5981('0xd')](function(_0x59e9be){if(!_0x59e9be){throw new Error(_0x5981('0x3a'));}if(_0x59e9be['disabled']){throw new Error(_0x5981('0x3b'));}if(_0x59e9be[_0x5981('0x11')]){if(moment(_0x59e9be['blockedAt'])[_0x5981('0x1b')](_0x12e1e5[_0x5981('0x1a')],'minutes')>moment()){throw new Error(_0x5981('0x3c'));}else{_0x59e9be[_0x5981('0x11')]=![];_0x59e9be[_0x5981('0x12')]=null;}}_0x59e9be[_0x5981('0x3d')]=_0x749e55;_0x59e9be[_0x5981('0x3e')]=Date[_0x5981('0x3f')]()+0x36ee80;return _0x59e9be[_0x5981('0x40')]();})[_0x5981('0xd')](function(){return sendServiceMail({'to':_0x5395e8['body'][_0x5981('0x21')],'subject':_0x5981('0x41'),'text':_0x5981('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x5395e8[_0x5981('0x43')][_0x5981('0x44')]+_0x5981('0x45')+_0x749e55+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5981('0xd')](function(){_0xeb3024[_0x5981('0x2c')](0xc8)[_0x5981('0x2d')]({'message':_0x5981('0x46')});})[_0x5981('0x47')](function(_0x1efbb6){return handleError(_0xeb3024,0x1f4,_0x1efbb6);});};exports['reset']=function(_0x554097,_0x2b3cf0){return db[_0x5981('0x39')][_0x5981('0x20')]({'where':{'resetPasswordToken':_0x554097['params'][_0x5981('0x48')],'resetPasswordExpires':{'$gt':Date[_0x5981('0x3f')]()}}})[_0x5981('0xd')](function(_0x495c47){if(!_0x495c47){throw new Error(_0x5981('0x49'));}return db[_0x5981('0xa')][_0x5981('0xb')]({'attributes':['id',_0x5981('0x4a'),_0x5981('0x4b'),_0x5981('0x4c')]})[_0x5981('0xd')](function(_0x5cdfda){if(_0x5cdfda[_0x5981('0x4a')])authService[_0x5981('0x4d')](_0x554097[_0x5981('0x36')][_0x5981('0xe')]);if(!_0x5cdfda['enforcePasswordHistory']||!_0x495c47[_0x5981('0x4e')])return _0x495c47;authService[_0x5981('0x4f')](_0x554097['body'][_0x5981('0xe')],_0x495c47['previousPasswords'],_0x5cdfda[_0x5981('0x4c')]);return _0x495c47;})[_0x5981('0xd')](function(){_0x495c47['password']=_0x554097['body'][_0x5981('0xe')];_0x495c47[_0x5981('0x3d')]=null;_0x495c47[_0x5981('0x3e')]=null;return _0x495c47[_0x5981('0x40')]();});})[_0x5981('0xd')](function(){_0x2b3cf0[_0x5981('0x2c')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x5981('0x47')](function(_0x33e35a){return handleError(_0x2b3cf0,0x1f4,_0x33e35a);});};passport[_0x5981('0x50')](_0x5981('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x5981('0xe')},function(_0x5774cc,_0x7027f8,_0x3e28da){return localAuthenticate(db[_0x5981('0x39')],_0x5774cc,_0x7027f8,_0x3e28da);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 5024ea5..574a780 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 _0xeef3=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','express','Router'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xeef3,0x130));var _0x3eef=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0xeef3[_0x296923];return _0x29af70;};'use strict';var express=require(_0x3eef('0x0'));var router=express[_0x3eef('0x1')]();var controller=require(_0x3eef('0x2'));router[_0x3eef('0x3')]('/',controller[_0x3eef('0x4')]);router[_0x3eef('0x3')](_0x3eef('0x5'),controller[_0x3eef('0x6')]);router[_0x3eef('0x3')](_0x3eef('0x7'),controller[_0x3eef('0x8')]);module['exports']=router; \ No newline at end of file +var _0x20e8=['/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller','post','login'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x20e8,0xdd));var _0x820e=function(_0xd37cdd,_0x3ae26a){_0xd37cdd=_0xd37cdd-0x0;var _0x5f47d2=_0x20e8[_0xd37cdd];return _0x5f47d2;};'use strict';var express=require(_0x820e('0x0'));var router=express['Router']();var controller=require(_0x820e('0x1'));router[_0x820e('0x2')]('/',controller[_0x820e('0x3')]);router[_0x820e('0x2')](_0x820e('0x4'),controller[_0x820e('0x5')]);router[_0x820e('0x2')](_0x820e('0x6'),controller[_0x820e('0x7')]);module[_0x820e('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f62a92b..6316dc9 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 _0x2c4f=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1d997f,_0x259b5a){var _0x307704=function(_0x4358a8){while(--_0x4358a8){_0x1d997f['push'](_0x1d997f['shift']());}};_0x307704(++_0x259b5a);}(_0x2c4f,0x1b9));var _0xf2c4=function(_0x290ac2,_0xa32757){_0x290ac2=_0x290ac2-0x0;var _0x177613=_0x2c4f[_0x290ac2];return _0x177613;};'use strict';var Sequelize=require(_0xf2c4('0x0'));module[_0xf2c4('0x1')]={'name':{'type':Sequelize[_0xf2c4('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf2c4('0x2')]},'status':{'type':Sequelize[_0xf2c4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf2c4('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3ebb=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x11c235,_0x48e6ad){var _0x21d8ba=function(_0x3dc758){while(--_0x3dc758){_0x11c235['push'](_0x11c235['shift']());}};_0x21d8ba(++_0x48e6ad);}(_0x3ebb,0xcb));var _0xb3eb=function(_0x30a561,_0x22ed97){_0x30a561=_0x30a561-0x0;var _0x18ee3a=_0x3ebb[_0x30a561];return _0x18ee3a;};'use strict';var Sequelize=require(_0xb3eb('0x0'));module[_0xb3eb('0x1')]={'name':{'type':Sequelize[_0xb3eb('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb3eb('0x2')]},'description':{'type':Sequelize[_0xb3eb('0x2')]},'status':{'type':Sequelize[_0xb3eb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb3eb('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index f105065..f51e518 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 _0xa7f8=['index','map','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','Condition','addConditions','ids','getConditions','findOne','pick','nolimit','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','end','stack','name','send'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa7f8,0x135));var _0x8a7f=function(_0x59ed0e,_0x41a60f){_0x59ed0e=_0x59ed0e-0x0;var _0x9a8307=_0xa7f8[_0x59ed0e];return _0x9a8307;};'use strict';var emlformat=require(_0x8a7f('0x0'));var rimraf=require(_0x8a7f('0x1'));var zipdir=require(_0x8a7f('0x2'));var jsonpatch=require(_0x8a7f('0x3'));var rp=require(_0x8a7f('0x4'));var moment=require(_0x8a7f('0x5'));var BPromise=require(_0x8a7f('0x6'));var Mustache=require(_0x8a7f('0x7'));var util=require(_0x8a7f('0x8'));var path=require(_0x8a7f('0x9'));var sox=require(_0x8a7f('0xa'));var csv=require(_0x8a7f('0xb'));var ejs=require(_0x8a7f('0xc'));var fs=require('fs');var fs_extra=require(_0x8a7f('0xd'));var _=require(_0x8a7f('0xe'));var squel=require(_0x8a7f('0xf'));var crypto=require(_0x8a7f('0x10'));var jsforce=require(_0x8a7f('0x11'));var deskjs=require(_0x8a7f('0x12'));var toCsv=require('to-csv');var querystring=require(_0x8a7f('0x13'));var Papa=require(_0x8a7f('0x14'));var Redis=require(_0x8a7f('0x15'));var authService=require(_0x8a7f('0x16'));var qs=require(_0x8a7f('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a7f('0x18'));var logger=require('../../config/logger')(_0x8a7f('0x19'));var utils=require(_0x8a7f('0x1a'));var config=require(_0x8a7f('0x1b'));var licenseUtil=require(_0x8a7f('0x1c'));var db=require(_0x8a7f('0x1d'))['db'];function respondWithStatusCode(_0x2b9365,_0x3a6a89){_0x3a6a89=_0x3a6a89||0xcc;return function(_0x4407cd){if(_0x4407cd){return _0x2b9365[_0x8a7f('0x1e')](_0x3a6a89);}return _0x2b9365[_0x8a7f('0x1f')](_0x3a6a89)['end']();};}function respondWithResult(_0x9994b3,_0x256c66){_0x256c66=_0x256c66||0xc8;return function(_0x4e3bde){if(_0x4e3bde){return _0x9994b3[_0x8a7f('0x1f')](_0x256c66)['json'](_0x4e3bde);}};}function respondWithFilteredResult(_0x5002fe,_0xe4291){return function(_0x5a0cfe){if(_0x5a0cfe){var _0x30f2d1=typeof _0xe4291[_0x8a7f('0x20')]===_0x8a7f('0x21')&&typeof _0xe4291[_0x8a7f('0x22')]===_0x8a7f('0x21');var _0x5d2890=_0x5a0cfe[_0x8a7f('0x23')];var _0xd1f947=_0x30f2d1?0x0:_0xe4291[_0x8a7f('0x20')];var _0x5a2107=_0x30f2d1?_0x5a0cfe['count']:_0xe4291[_0x8a7f('0x20')]+_0xe4291[_0x8a7f('0x22')];var _0x3a35cf;if(_0x5a2107>=_0x5d2890){_0x5a2107=_0x5d2890;_0x3a35cf=0xc8;}else{_0x3a35cf=0xce;}_0x5002fe['status'](_0x3a35cf);return _0x5002fe[_0x8a7f('0x24')](_0x8a7f('0x25'),_0xd1f947+'-'+_0x5a2107+'/'+_0x5d2890)[_0x8a7f('0x26')](_0x5a0cfe);}return null;};}function patchUpdates(_0x6d12b1){return function(_0x4dbe1d){try{jsonpatch['apply'](_0x4dbe1d,_0x6d12b1,!![]);}catch(_0x2635d2){return BPromise[_0x8a7f('0x27')](_0x2635d2);}return _0x4dbe1d[_0x8a7f('0x28')]();};}function saveUpdates(_0x266db6,_0x16a7e7){return function(_0x11520e){if(_0x11520e){return _0x11520e['update'](_0x266db6)[_0x8a7f('0x29')](function(_0x3603fd){return _0x3603fd;});}return null;};}function removeEntity(_0x6bc31a,_0x25e7e5){return function(_0x243c3d){if(_0x243c3d){return _0x243c3d[_0x8a7f('0x2a')]()[_0x8a7f('0x29')](function(){_0x6bc31a['status'](0xcc)[_0x8a7f('0x2b')]();});}};}function handleEntityNotFound(_0x2991b1,_0x222a32){return function(_0x2abdc4){if(!_0x2abdc4){_0x2991b1['sendStatus'](0x194);}return _0x2abdc4;};}function handleError(_0x3c6601,_0x66c601){_0x66c601=_0x66c601||0x1f4;return function(_0x4c1f92){logger['error'](_0x4c1f92[_0x8a7f('0x2c')]);if(_0x4c1f92[_0x8a7f('0x2d')]){delete _0x4c1f92['name'];}_0x3c6601[_0x8a7f('0x1f')](_0x66c601)[_0x8a7f('0x2e')](_0x4c1f92);};}exports[_0x8a7f('0x2f')]=function(_0x4d63a3,_0x502f62){var _0x312f03={},_0x4fff42={},_0x4c452b={'count':0x0,'rows':[]};var _0x58a125=_[_0x8a7f('0x30')](db['Automation']['rawAttributes'],function(_0x30790c){return{'name':_0x30790c['fieldName'],'type':_0x30790c[_0x8a7f('0x31')]['key']};});_0x4fff42[_0x8a7f('0x32')]=_[_0x8a7f('0x30')](_0x58a125,_0x8a7f('0x2d'));_0x4fff42['query']=_[_0x8a7f('0x33')](_0x4d63a3[_0x8a7f('0x34')]);_0x4fff42['filters']=_[_0x8a7f('0x35')](_0x4fff42[_0x8a7f('0x32')],_0x4fff42[_0x8a7f('0x34')]);_0x312f03[_0x8a7f('0x36')]=_[_0x8a7f('0x35')](_0x4fff42[_0x8a7f('0x32')],qs[_0x8a7f('0x37')](_0x4d63a3['query'][_0x8a7f('0x37')]));_0x312f03[_0x8a7f('0x36')]=_0x312f03[_0x8a7f('0x36')][_0x8a7f('0x38')]?_0x312f03[_0x8a7f('0x36')]:_0x4fff42[_0x8a7f('0x32')];if(!_0x4d63a3['query'][_0x8a7f('0x39')]('nolimit')){_0x312f03[_0x8a7f('0x22')]=qs[_0x8a7f('0x22')](_0x4d63a3[_0x8a7f('0x34')][_0x8a7f('0x22')]);_0x312f03[_0x8a7f('0x20')]=qs[_0x8a7f('0x20')](_0x4d63a3['query'][_0x8a7f('0x20')]);}_0x312f03[_0x8a7f('0x3a')]=qs[_0x8a7f('0x3b')](_0x4d63a3['query'][_0x8a7f('0x3b')]);_0x312f03[_0x8a7f('0x3c')]=qs['filters'](_['pick'](_0x4d63a3['query'],_0x4fff42[_0x8a7f('0x3d')]),_0x58a125);if(_0x4d63a3['query'][_0x8a7f('0x3e')]){_0x312f03[_0x8a7f('0x3c')]=_[_0x8a7f('0x3f')](_0x312f03[_0x8a7f('0x3c')],{'$or':_['map'](_0x58a125,function(_0x282bfc){if(_0x282bfc['type']!==_0x8a7f('0x40')){var _0x538ad2={};_0x538ad2[_0x282bfc[_0x8a7f('0x2d')]]={'$like':'%'+_0x4d63a3[_0x8a7f('0x34')][_0x8a7f('0x3e')]+'%'};return _0x538ad2;}})});}_0x312f03=_[_0x8a7f('0x3f')]({},_0x312f03,_0x4d63a3[_0x8a7f('0x41')]);var _0x46b520={'where':_0x312f03[_0x8a7f('0x3c')]};return db[_0x8a7f('0x42')]['count'](_0x46b520)[_0x8a7f('0x29')](function(_0x13d600){_0x4c452b[_0x8a7f('0x23')]=_0x13d600;if(_0x4d63a3[_0x8a7f('0x34')][_0x8a7f('0x43')]){_0x312f03[_0x8a7f('0x44')]=[{'all':!![]}];}return db[_0x8a7f('0x42')][_0x8a7f('0x45')](_0x312f03);})[_0x8a7f('0x29')](function(_0x25c8e9){_0x4c452b[_0x8a7f('0x46')]=_0x25c8e9;return _0x4c452b;})['then'](respondWithFilteredResult(_0x502f62,_0x312f03))[_0x8a7f('0x47')](handleError(_0x502f62,null));};exports[_0x8a7f('0x48')]=function(_0x1d5165,_0x418786){var _0x4a3d0d={'raw':![],'where':{'id':_0x1d5165[_0x8a7f('0x49')]['id']}},_0x566e1f={};_0x566e1f['model']=_['keys'](db[_0x8a7f('0x42')][_0x8a7f('0x4a')]);_0x566e1f['query']=_[_0x8a7f('0x33')](_0x1d5165[_0x8a7f('0x34')]);_0x566e1f['filters']=_['intersection'](_0x566e1f['model'],_0x566e1f['query']);_0x4a3d0d['attributes']=_[_0x8a7f('0x35')](_0x566e1f[_0x8a7f('0x32')],qs[_0x8a7f('0x37')](_0x1d5165['query'][_0x8a7f('0x37')]));_0x4a3d0d[_0x8a7f('0x36')]=_0x4a3d0d[_0x8a7f('0x36')][_0x8a7f('0x38')]?_0x4a3d0d[_0x8a7f('0x36')]:_0x566e1f[_0x8a7f('0x32')];if(_0x1d5165[_0x8a7f('0x34')][_0x8a7f('0x43')]){_0x4a3d0d[_0x8a7f('0x44')]=[{'all':!![]}];}_0x4a3d0d=_[_0x8a7f('0x3f')]({},_0x4a3d0d,_0x1d5165[_0x8a7f('0x41')]);return db[_0x8a7f('0x42')]['find'](_0x4a3d0d)[_0x8a7f('0x29')](handleEntityNotFound(_0x418786,null))['then'](respondWithResult(_0x418786,null))[_0x8a7f('0x47')](handleError(_0x418786,null));};exports[_0x8a7f('0x4b')]=function(_0x1843de,_0x33d044){return db[_0x8a7f('0x42')][_0x8a7f('0x4b')](_0x1843de[_0x8a7f('0x4c')],{})['then'](respondWithResult(_0x33d044,0xc9))['catch'](handleError(_0x33d044,null));};exports['update']=function(_0x4807a3,_0x1c5e37){if(_0x4807a3['body']['id']){delete _0x4807a3[_0x8a7f('0x4c')]['id'];}return db[_0x8a7f('0x42')][_0x8a7f('0x4d')]({'where':{'id':_0x4807a3[_0x8a7f('0x49')]['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x1c5e37,null))[_0x8a7f('0x29')](saveUpdates(_0x4807a3[_0x8a7f('0x4c')],null))[_0x8a7f('0x29')](respondWithResult(_0x1c5e37,null))['catch'](handleError(_0x1c5e37,null));};exports[_0x8a7f('0x2a')]=function(_0x438cef,_0x1c6c77){return db[_0x8a7f('0x42')]['find']({'where':{'id':_0x438cef['params']['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x1c6c77,null))[_0x8a7f('0x29')](removeEntity(_0x1c6c77,null))[_0x8a7f('0x47')](handleError(_0x1c6c77,null));};exports['addConditions']=function(_0x321654,_0x5caac0,_0x575782){return db[_0x8a7f('0x4e')]['find']({'where':{'id':_0x321654[_0x8a7f('0x49')]['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x5caac0,null))['then'](function(_0x5da7a3){if(_0x5da7a3){return _0x5da7a3[_0x8a7f('0x4f')](_0x321654[_0x8a7f('0x4c')][_0x8a7f('0x50')],_['omit'](_0x321654[_0x8a7f('0x4c')],[_0x8a7f('0x50'),'id'])||{});}})[_0x8a7f('0x29')](respondWithResult(_0x5caac0,null))[_0x8a7f('0x47')](handleError(_0x5caac0,null));};exports[_0x8a7f('0x51')]=function(_0x3c98d9,_0x5a6179,_0x23d5a7){var _0x3b874a={};var _0x1b09bd={};var _0x363529;var _0x861112;return db[_0x8a7f('0x42')][_0x8a7f('0x52')]({'where':{'id':_0x3c98d9['params']['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x5a6179,null))[_0x8a7f('0x29')](function(_0x2dffe3){if(_0x2dffe3){_0x363529=_0x2dffe3;_0x1b09bd[_0x8a7f('0x32')]=_[_0x8a7f('0x33')](db[_0x8a7f('0x4e')][_0x8a7f('0x4a')]);_0x1b09bd[_0x8a7f('0x34')]=_[_0x8a7f('0x33')](_0x3c98d9[_0x8a7f('0x34')]);_0x1b09bd['filters']=_[_0x8a7f('0x35')](_0x1b09bd['model'],_0x1b09bd[_0x8a7f('0x34')]);_0x3b874a['attributes']=_[_0x8a7f('0x35')](_0x1b09bd[_0x8a7f('0x32')],qs['fields'](_0x3c98d9[_0x8a7f('0x34')][_0x8a7f('0x37')]));_0x3b874a[_0x8a7f('0x36')]=_0x3b874a['attributes'][_0x8a7f('0x38')]?_0x3b874a[_0x8a7f('0x36')]:_0x1b09bd['model'];_0x3b874a['order']=qs[_0x8a7f('0x3b')](_0x3c98d9[_0x8a7f('0x34')]['sort']);_0x3b874a['where']=qs[_0x8a7f('0x3d')](_[_0x8a7f('0x53')](_0x3c98d9[_0x8a7f('0x34')],_0x1b09bd[_0x8a7f('0x3d')]));if(_0x3c98d9[_0x8a7f('0x34')][_0x8a7f('0x3e')]){_0x3b874a[_0x8a7f('0x3c')]=_[_0x8a7f('0x3f')](_0x3b874a[_0x8a7f('0x3c')],{'$or':_[_0x8a7f('0x30')](_0x3b874a[_0x8a7f('0x36')],function(_0x4c7ed3){var _0x101c78={};_0x101c78[_0x4c7ed3]={'$like':'%'+_0x3c98d9[_0x8a7f('0x34')]['filter']+'%'};return _0x101c78;})});}_0x3b874a=_['merge']({},_0x3b874a,_0x3c98d9[_0x8a7f('0x41')]);return _0x363529['getConditions'](_0x3b874a);}})[_0x8a7f('0x29')](function(_0x134496){if(_0x134496){_0x861112=_0x134496[_0x8a7f('0x38')];if(!_0x3c98d9[_0x8a7f('0x34')][_0x8a7f('0x39')](_0x8a7f('0x54'))){_0x3b874a['limit']=qs[_0x8a7f('0x22')](_0x3c98d9[_0x8a7f('0x34')][_0x8a7f('0x22')]);_0x3b874a[_0x8a7f('0x20')]=qs[_0x8a7f('0x20')](_0x3c98d9['query'][_0x8a7f('0x20')]);}return _0x363529[_0x8a7f('0x51')](_0x3b874a);}})[_0x8a7f('0x29')](function(_0xff09d3){if(_0xff09d3){return _0xff09d3?{'count':_0x861112,'rows':_0xff09d3}:null;}})[_0x8a7f('0x29')](respondWithResult(_0x5a6179,null))['catch'](handleError(_0x5a6179,null));};exports[_0x8a7f('0x55')]=function(_0x3727cc,_0x37d362,_0x134a6d){return db[_0x8a7f('0x56')]['find']({'where':{'id':_0x3727cc['params']['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x37d362,null))['then'](function(_0x383a30){if(_0x383a30){return _0x383a30[_0x8a7f('0x55')](_0x3727cc[_0x8a7f('0x4c')][_0x8a7f('0x50')],_[_0x8a7f('0x57')](_0x3727cc['body'],[_0x8a7f('0x50'),'id'])||{});}})['then'](respondWithResult(_0x37d362,null))[_0x8a7f('0x47')](handleError(_0x37d362,null));};exports[_0x8a7f('0x58')]=function(_0x17e8f2,_0x5afd14,_0x31c652){var _0x429cac={};var _0x501650={};var _0x2a28dc;var _0x10cb77;return db[_0x8a7f('0x42')]['findOne']({'where':{'id':_0x17e8f2[_0x8a7f('0x49')]['id']}})[_0x8a7f('0x29')](handleEntityNotFound(_0x5afd14,null))[_0x8a7f('0x29')](function(_0x42e579){if(_0x42e579){_0x2a28dc=_0x42e579;_0x501650['model']=_['keys'](db[_0x8a7f('0x56')][_0x8a7f('0x4a')]);_0x501650[_0x8a7f('0x34')]=_[_0x8a7f('0x33')](_0x17e8f2[_0x8a7f('0x34')]);_0x501650[_0x8a7f('0x3d')]=_[_0x8a7f('0x35')](_0x501650[_0x8a7f('0x32')],_0x501650['query']);_0x429cac[_0x8a7f('0x36')]=_[_0x8a7f('0x35')](_0x501650['model'],qs[_0x8a7f('0x37')](_0x17e8f2[_0x8a7f('0x34')][_0x8a7f('0x37')]));_0x429cac[_0x8a7f('0x36')]=_0x429cac[_0x8a7f('0x36')][_0x8a7f('0x38')]?_0x429cac[_0x8a7f('0x36')]:_0x501650['model'];_0x429cac[_0x8a7f('0x3a')]=qs[_0x8a7f('0x3b')](_0x17e8f2[_0x8a7f('0x34')]['sort']);_0x429cac[_0x8a7f('0x3c')]=qs[_0x8a7f('0x3d')](_['pick'](_0x17e8f2['query'],_0x501650[_0x8a7f('0x3d')]));if(_0x17e8f2[_0x8a7f('0x34')][_0x8a7f('0x3e')]){_0x429cac[_0x8a7f('0x3c')]=_[_0x8a7f('0x3f')](_0x429cac[_0x8a7f('0x3c')],{'$or':_[_0x8a7f('0x30')](_0x429cac['attributes'],function(_0x20c0db){var _0x430e67={};_0x430e67[_0x20c0db]={'$like':'%'+_0x17e8f2['query'][_0x8a7f('0x3e')]+'%'};return _0x430e67;})});}_0x429cac=_[_0x8a7f('0x3f')]({},_0x429cac,_0x17e8f2[_0x8a7f('0x41')]);return _0x2a28dc[_0x8a7f('0x58')](_0x429cac);}})[_0x8a7f('0x29')](function(_0x349b7b){if(_0x349b7b){_0x10cb77=_0x349b7b[_0x8a7f('0x38')];if(!_0x17e8f2[_0x8a7f('0x34')][_0x8a7f('0x39')]('nolimit')){_0x429cac['limit']=qs[_0x8a7f('0x22')](_0x17e8f2['query'][_0x8a7f('0x22')]);_0x429cac[_0x8a7f('0x20')]=qs[_0x8a7f('0x20')](_0x17e8f2['query']['offset']);}return _0x2a28dc[_0x8a7f('0x58')](_0x429cac);}})[_0x8a7f('0x29')](function(_0x38471c){if(_0x38471c){return _0x38471c?{'count':_0x10cb77,'rows':_0x38471c}:null;}})[_0x8a7f('0x29')](respondWithResult(_0x5afd14,null))[_0x8a7f('0x47')](handleError(_0x5afd14,null));}; \ No newline at end of file +var _0x6f0c=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','Automation','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','addConditions','Condition','omit','ids','findOne','pick','options','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb'];(function(_0x5e6750,_0x1b6aa4){var _0x16dd66=function(_0x35e55d){while(--_0x35e55d){_0x5e6750['push'](_0x5e6750['shift']());}};_0x16dd66(++_0x1b6aa4);}(_0x6f0c,0x1e1));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc6f0('0x0'));var rimraf=require(_0xc6f0('0x1'));var zipdir=require(_0xc6f0('0x2'));var jsonpatch=require(_0xc6f0('0x3'));var rp=require(_0xc6f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc6f0('0x5'));var path=require(_0xc6f0('0x6'));var sox=require(_0xc6f0('0x7'));var csv=require(_0xc6f0('0x8'));var ejs=require(_0xc6f0('0x9'));var fs=require('fs');var fs_extra=require(_0xc6f0('0xa'));var _=require(_0xc6f0('0xb'));var squel=require(_0xc6f0('0xc'));var crypto=require(_0xc6f0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc6f0('0xe'));var toCsv=require(_0xc6f0('0x8'));var querystring=require(_0xc6f0('0xf'));var Papa=require(_0xc6f0('0x10'));var Redis=require('ioredis');var authService=require(_0xc6f0('0x11'));var qs=require(_0xc6f0('0x12'));var as=require(_0xc6f0('0x13'));var hardwareService=require(_0xc6f0('0x14'));var logger=require('../../config/logger')(_0xc6f0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6f0('0x16'))['db'];function respondWithStatusCode(_0x5ed0f3,_0x2088f4){_0x2088f4=_0x2088f4||0xcc;return function(_0x4adf25){if(_0x4adf25){return _0x5ed0f3[_0xc6f0('0x17')](_0x2088f4);}return _0x5ed0f3[_0xc6f0('0x18')](_0x2088f4)[_0xc6f0('0x19')]();};}function respondWithResult(_0x37951f,_0x588c47){_0x588c47=_0x588c47||0xc8;return function(_0x5b7fd8){if(_0x5b7fd8){return _0x37951f['status'](_0x588c47)[_0xc6f0('0x1a')](_0x5b7fd8);}};}function respondWithFilteredResult(_0x33c926,_0x53aacb){return function(_0x539c4d){if(_0x539c4d){var _0x4a68f7=typeof _0x53aacb[_0xc6f0('0x1b')]==='undefined'&&typeof _0x53aacb[_0xc6f0('0x1c')]==='undefined';var _0x450408=_0x539c4d[_0xc6f0('0x1d')];var _0x41112b=_0x4a68f7?0x0:_0x53aacb[_0xc6f0('0x1b')];var _0x52d9eb=_0x4a68f7?_0x539c4d[_0xc6f0('0x1d')]:_0x53aacb[_0xc6f0('0x1b')]+_0x53aacb[_0xc6f0('0x1c')];var _0x7b48c0;if(_0x52d9eb>=_0x450408){_0x52d9eb=_0x450408;_0x7b48c0=0xc8;}else{_0x7b48c0=0xce;}_0x33c926['status'](_0x7b48c0);return _0x33c926[_0xc6f0('0x1e')](_0xc6f0('0x1f'),_0x41112b+'-'+_0x52d9eb+'/'+_0x450408)['json'](_0x539c4d);}return null;};}function patchUpdates(_0x3ad29e){return function(_0x87a395){try{jsonpatch[_0xc6f0('0x20')](_0x87a395,_0x3ad29e,!![]);}catch(_0x14445e){return BPromise[_0xc6f0('0x21')](_0x14445e);}return _0x87a395[_0xc6f0('0x22')]();};}function saveUpdates(_0x3e72fb,_0x3857bb){return function(_0x567bfc){if(_0x567bfc){return _0x567bfc['update'](_0x3e72fb)[_0xc6f0('0x23')](function(_0x47d31e){return _0x47d31e;});}return null;};}function removeEntity(_0x28c8f6,_0x4be188){return function(_0x472465){if(_0x472465){return _0x472465[_0xc6f0('0x24')]()[_0xc6f0('0x23')](function(){_0x28c8f6[_0xc6f0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc128,_0x5f0d37){return function(_0x3e4796){if(!_0x3e4796){_0x5dc128[_0xc6f0('0x17')](0x194);}return _0x3e4796;};}function handleError(_0x445fa0,_0x3385ab){_0x3385ab=_0x3385ab||0x1f4;return function(_0x42f205){logger[_0xc6f0('0x25')](_0x42f205[_0xc6f0('0x26')]);if(_0x42f205[_0xc6f0('0x27')]){delete _0x42f205['name'];}_0x445fa0['status'](_0x3385ab)[_0xc6f0('0x28')](_0x42f205);};}exports[_0xc6f0('0x29')]=function(_0xddb3a4,_0x49ab36){var _0x1ce4de={},_0x1cd5ce={},_0x1c616f={'count':0x0,'rows':[]};var _0x20f82b=_[_0xc6f0('0x2a')](db['Automation']['rawAttributes'],function(_0xb97884){return{'name':_0xb97884[_0xc6f0('0x2b')],'type':_0xb97884[_0xc6f0('0x2c')]['key']};});_0x1cd5ce['model']=_['map'](_0x20f82b,'name');_0x1cd5ce[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0xddb3a4[_0xc6f0('0x2d')]);_0x1cd5ce[_0xc6f0('0x2f')]=_[_0xc6f0('0x30')](_0x1cd5ce[_0xc6f0('0x31')],_0x1cd5ce['query']);_0x1ce4de[_0xc6f0('0x32')]=_['intersection'](_0x1cd5ce[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0xddb3a4[_0xc6f0('0x2d')]['fields']));_0x1ce4de[_0xc6f0('0x32')]=_0x1ce4de['attributes'][_0xc6f0('0x34')]?_0x1ce4de['attributes']:_0x1cd5ce[_0xc6f0('0x31')];if(!_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x1ce4de[_0xc6f0('0x1c')]=qs[_0xc6f0('0x1c')](_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x1c')]);_0x1ce4de[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0xddb3a4['query'][_0xc6f0('0x1b')]);}_0x1ce4de[_0xc6f0('0x37')]=qs['sort'](_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x38')]);_0x1ce4de[_0xc6f0('0x39')]=qs[_0xc6f0('0x2f')](_['pick'](_0xddb3a4[_0xc6f0('0x2d')],_0x1cd5ce[_0xc6f0('0x2f')]),_0x20f82b);if(_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x3a')]){_0x1ce4de[_0xc6f0('0x39')]=_['merge'](_0x1ce4de['where'],{'$or':_[_0xc6f0('0x2a')](_0x20f82b,function(_0x40a26f){if(_0x40a26f[_0xc6f0('0x2c')]!==_0xc6f0('0x3b')){var _0x1e818d={};_0x1e818d[_0x40a26f['name']]={'$like':'%'+_0xddb3a4['query'][_0xc6f0('0x3a')]+'%'};return _0x1e818d;}})});}_0x1ce4de=_[_0xc6f0('0x3c')]({},_0x1ce4de,_0xddb3a4['options']);var _0x2840a8={'where':_0x1ce4de['where']};return db[_0xc6f0('0x3d')][_0xc6f0('0x1d')](_0x2840a8)[_0xc6f0('0x23')](function(_0x5e5775){_0x1c616f[_0xc6f0('0x1d')]=_0x5e5775;if(_0xddb3a4['query']['includeAll']){_0x1ce4de[_0xc6f0('0x3e')]=[{'all':!![]}];}return db['Automation'][_0xc6f0('0x3f')](_0x1ce4de);})[_0xc6f0('0x23')](function(_0x18536b){_0x1c616f[_0xc6f0('0x40')]=_0x18536b;return _0x1c616f;})[_0xc6f0('0x23')](respondWithFilteredResult(_0x49ab36,_0x1ce4de))[_0xc6f0('0x41')](handleError(_0x49ab36,null));};exports[_0xc6f0('0x42')]=function(_0x5d5efb,_0x2630a6){var _0x4df59d={'raw':![],'where':{'id':_0x5d5efb[_0xc6f0('0x43')]['id']}},_0x2ab5c5={};_0x2ab5c5[_0xc6f0('0x31')]=_[_0xc6f0('0x2e')](db[_0xc6f0('0x3d')][_0xc6f0('0x44')]);_0x2ab5c5[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0x5d5efb[_0xc6f0('0x2d')]);_0x2ab5c5[_0xc6f0('0x2f')]=_[_0xc6f0('0x30')](_0x2ab5c5[_0xc6f0('0x31')],_0x2ab5c5[_0xc6f0('0x2d')]);_0x4df59d[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0x2ab5c5[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x5d5efb[_0xc6f0('0x2d')]['fields']));_0x4df59d[_0xc6f0('0x32')]=_0x4df59d[_0xc6f0('0x32')][_0xc6f0('0x34')]?_0x4df59d[_0xc6f0('0x32')]:_0x2ab5c5[_0xc6f0('0x31')];if(_0x5d5efb[_0xc6f0('0x2d')][_0xc6f0('0x45')]){_0x4df59d[_0xc6f0('0x3e')]=[{'all':!![]}];}_0x4df59d=_[_0xc6f0('0x3c')]({},_0x4df59d,_0x5d5efb['options']);return db[_0xc6f0('0x3d')][_0xc6f0('0x46')](_0x4df59d)[_0xc6f0('0x23')](handleEntityNotFound(_0x2630a6,null))[_0xc6f0('0x23')](respondWithResult(_0x2630a6,null))[_0xc6f0('0x41')](handleError(_0x2630a6,null));};exports[_0xc6f0('0x47')]=function(_0x2f3d6a,_0xc29ea3){return db[_0xc6f0('0x3d')][_0xc6f0('0x47')](_0x2f3d6a[_0xc6f0('0x48')],{})['then'](respondWithResult(_0xc29ea3,0xc9))['catch'](handleError(_0xc29ea3,null));};exports[_0xc6f0('0x49')]=function(_0x2f4364,_0x4e1f03){if(_0x2f4364[_0xc6f0('0x48')]['id']){delete _0x2f4364[_0xc6f0('0x48')]['id'];}return db[_0xc6f0('0x3d')]['find']({'where':{'id':_0x2f4364[_0xc6f0('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e1f03,null))['then'](saveUpdates(_0x2f4364[_0xc6f0('0x48')],null))[_0xc6f0('0x23')](respondWithResult(_0x4e1f03,null))[_0xc6f0('0x41')](handleError(_0x4e1f03,null));};exports[_0xc6f0('0x24')]=function(_0x19316b,_0x2f89ff){return db[_0xc6f0('0x3d')][_0xc6f0('0x46')]({'where':{'id':_0x19316b['params']['id']}})['then'](handleEntityNotFound(_0x2f89ff,null))[_0xc6f0('0x23')](removeEntity(_0x2f89ff,null))[_0xc6f0('0x41')](handleError(_0x2f89ff,null));};exports[_0xc6f0('0x4a')]=function(_0x1135df,_0x209c6d,_0x4ca655){return db[_0xc6f0('0x4b')][_0xc6f0('0x46')]({'where':{'id':_0x1135df[_0xc6f0('0x43')]['id']}})['then'](handleEntityNotFound(_0x209c6d,null))[_0xc6f0('0x23')](function(_0x588ea5){if(_0x588ea5){return _0x588ea5[_0xc6f0('0x4a')](_0x1135df[_0xc6f0('0x48')]['ids'],_[_0xc6f0('0x4c')](_0x1135df[_0xc6f0('0x48')],[_0xc6f0('0x4d'),'id'])||{});}})[_0xc6f0('0x23')](respondWithResult(_0x209c6d,null))[_0xc6f0('0x41')](handleError(_0x209c6d,null));};exports['getConditions']=function(_0x2a8785,_0x4e324c,_0xb63646){var _0x1414a9={};var _0x41ed72={};var _0x3f1e91;var _0x4d45a2;return db[_0xc6f0('0x3d')][_0xc6f0('0x4e')]({'where':{'id':_0x2a8785[_0xc6f0('0x43')]['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x4e324c,null))[_0xc6f0('0x23')](function(_0x505a9b){if(_0x505a9b){_0x3f1e91=_0x505a9b;_0x41ed72['model']=_[_0xc6f0('0x2e')](db[_0xc6f0('0x4b')][_0xc6f0('0x44')]);_0x41ed72[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0x2a8785['query']);_0x41ed72['filters']=_[_0xc6f0('0x30')](_0x41ed72[_0xc6f0('0x31')],_0x41ed72[_0xc6f0('0x2d')]);_0x1414a9[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0x41ed72[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x2a8785['query']['fields']));_0x1414a9[_0xc6f0('0x32')]=_0x1414a9[_0xc6f0('0x32')]['length']?_0x1414a9[_0xc6f0('0x32')]:_0x41ed72[_0xc6f0('0x31')];_0x1414a9[_0xc6f0('0x37')]=qs[_0xc6f0('0x38')](_0x2a8785[_0xc6f0('0x2d')][_0xc6f0('0x38')]);_0x1414a9[_0xc6f0('0x39')]=qs[_0xc6f0('0x2f')](_[_0xc6f0('0x4f')](_0x2a8785[_0xc6f0('0x2d')],_0x41ed72[_0xc6f0('0x2f')]));if(_0x2a8785['query']['filter']){_0x1414a9[_0xc6f0('0x39')]=_[_0xc6f0('0x3c')](_0x1414a9[_0xc6f0('0x39')],{'$or':_['map'](_0x1414a9[_0xc6f0('0x32')],function(_0x28f2cc){var _0x308742={};_0x308742[_0x28f2cc]={'$like':'%'+_0x2a8785[_0xc6f0('0x2d')][_0xc6f0('0x3a')]+'%'};return _0x308742;})});}_0x1414a9=_[_0xc6f0('0x3c')]({},_0x1414a9,_0x2a8785[_0xc6f0('0x50')]);return _0x3f1e91['getConditions'](_0x1414a9);}})[_0xc6f0('0x23')](function(_0x5b5c89){if(_0x5b5c89){_0x4d45a2=_0x5b5c89['length'];if(!_0x2a8785['query'][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x1414a9[_0xc6f0('0x1c')]=qs['limit'](_0x2a8785['query']['limit']);_0x1414a9[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0x2a8785['query'][_0xc6f0('0x1b')]);}return _0x3f1e91['getConditions'](_0x1414a9);}})['then'](function(_0x18e530){if(_0x18e530){return _0x18e530?{'count':_0x4d45a2,'rows':_0x18e530}:null;}})[_0xc6f0('0x23')](respondWithResult(_0x4e324c,null))[_0xc6f0('0x41')](handleError(_0x4e324c,null));};exports['addActions']=function(_0x33181e,_0x1986ed,_0xaa63f6){return db[_0xc6f0('0x51')][_0xc6f0('0x46')]({'where':{'id':_0x33181e['params']['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x1986ed,null))[_0xc6f0('0x23')](function(_0x4bf5a5){if(_0x4bf5a5){return _0x4bf5a5[_0xc6f0('0x52')](_0x33181e[_0xc6f0('0x48')][_0xc6f0('0x4d')],_[_0xc6f0('0x4c')](_0x33181e['body'],[_0xc6f0('0x4d'),'id'])||{});}})[_0xc6f0('0x23')](respondWithResult(_0x1986ed,null))[_0xc6f0('0x41')](handleError(_0x1986ed,null));};exports[_0xc6f0('0x53')]=function(_0x2e2b1a,_0x19f674,_0xacda7c){var _0x52bdbf={};var _0xcc9b14={};var _0x50b648;var _0x57cf84;return db[_0xc6f0('0x3d')][_0xc6f0('0x4e')]({'where':{'id':_0x2e2b1a[_0xc6f0('0x43')]['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x19f674,null))[_0xc6f0('0x23')](function(_0x2cf501){if(_0x2cf501){_0x50b648=_0x2cf501;_0xcc9b14[_0xc6f0('0x31')]=_[_0xc6f0('0x2e')](db[_0xc6f0('0x51')][_0xc6f0('0x44')]);_0xcc9b14[_0xc6f0('0x2d')]=_['keys'](_0x2e2b1a['query']);_0xcc9b14['filters']=_[_0xc6f0('0x30')](_0xcc9b14[_0xc6f0('0x31')],_0xcc9b14['query']);_0x52bdbf[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0xcc9b14[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x2e2b1a['query'][_0xc6f0('0x33')]));_0x52bdbf[_0xc6f0('0x32')]=_0x52bdbf[_0xc6f0('0x32')][_0xc6f0('0x34')]?_0x52bdbf[_0xc6f0('0x32')]:_0xcc9b14[_0xc6f0('0x31')];_0x52bdbf['order']=qs[_0xc6f0('0x38')](_0x2e2b1a[_0xc6f0('0x2d')]['sort']);_0x52bdbf['where']=qs[_0xc6f0('0x2f')](_['pick'](_0x2e2b1a[_0xc6f0('0x2d')],_0xcc9b14[_0xc6f0('0x2f')]));if(_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x3a')]){_0x52bdbf[_0xc6f0('0x39')]=_['merge'](_0x52bdbf['where'],{'$or':_[_0xc6f0('0x2a')](_0x52bdbf[_0xc6f0('0x32')],function(_0x2d9115){var _0x59cb13={};_0x59cb13[_0x2d9115]={'$like':'%'+_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x3a')]+'%'};return _0x59cb13;})});}_0x52bdbf=_[_0xc6f0('0x3c')]({},_0x52bdbf,_0x2e2b1a[_0xc6f0('0x50')]);return _0x50b648[_0xc6f0('0x53')](_0x52bdbf);}})[_0xc6f0('0x23')](function(_0x5a9e37){if(_0x5a9e37){_0x57cf84=_0x5a9e37[_0xc6f0('0x34')];if(!_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x52bdbf[_0xc6f0('0x1c')]=qs['limit'](_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x1c')]);_0x52bdbf[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x1b')]);}return _0x50b648[_0xc6f0('0x53')](_0x52bdbf);}})[_0xc6f0('0x23')](function(_0x225475){if(_0x225475){return _0x225475?{'count':_0x57cf84,'rows':_0x225475}:null;}})[_0xc6f0('0x23')](respondWithResult(_0x19f674,null))['catch'](handleError(_0x19f674,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index deaef62..b19efc8 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 _0xe472=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','moment'];(function(_0x4c5598,_0x17e12b){var _0x123533=function(_0x31ceba){while(--_0x31ceba){_0x4c5598['push'](_0x4c5598['shift']());}};_0x123533(++_0x17e12b);}(_0xe472,0x105));var _0x2e47=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe472[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2e47('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2e47('0x1'));var moment=require(_0x2e47('0x2'));var BPromise=require(_0x2e47('0x3'));var rp=require(_0x2e47('0x4'));var fs=require('fs');var path=require(_0x2e47('0x5'));var rimraf=require(_0x2e47('0x6'));var config=require('../../config/environment');var attributes=require(_0x2e47('0x7'));module[_0x2e47('0x8')]=function(_0x13c21c,_0x47d786){return _0x13c21c[_0x2e47('0x9')](_0x2e47('0xa'),attributes,{'tableName':_0x2e47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x309c=['../../config/environment','./automation.attributes','define','Automation','tools_automations','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x309c,0x9b));var _0xc309=function(_0x47f9c3,_0x139d6e){_0x47f9c3=_0x47f9c3-0x0;var _0x29a3aa=_0x309c[_0x47f9c3];return _0x29a3aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc309('0x0'))('api');var moment=require(_0xc309('0x1'));var BPromise=require(_0xc309('0x2'));var rp=require(_0xc309('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc309('0x4'));var config=require(_0xc309('0x5'));var attributes=require(_0xc309('0x6'));module['exports']=function(_0x43cb57,_0x4dd6c1){return _0x43cb57[_0xc309('0x7')](_0xc309('0x8'),attributes,{'tableName':_0xc309('0x9'),'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 3b60871..ea88740 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 _0xd3f5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x190e3c,_0x3c6a23){var _0x598713=function(_0x5e4e1b){while(--_0x5e4e1b){_0x190e3c['push'](_0x190e3c['shift']());}};_0x598713(++_0x3c6a23);}(_0xd3f5,0x147));var _0x5d3f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd3f5[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5d3f('0x0'));var util=require(_0x5d3f('0x1'));var moment=require('moment');var BPromise=require(_0x5d3f('0x2'));var rs=require(_0x5d3f('0x3'));var fs=require('fs');var Redis=require(_0x5d3f('0x4'));var db=require(_0x5d3f('0x5'))['db'];var utils=require(_0x5d3f('0x6'));var logger=require(_0x5d3f('0x7'))(_0x5d3f('0x8'));var config=require(_0x5d3f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e0ad6,_0x432033,_0x5791d4){return new BPromise(function(_0x1b18bb,_0x4f64d0){return client[_0x5d3f('0xb')](_0x2e0ad6,_0x5791d4)['then'](function(_0x3f29c9){logger['info'](_0x5d3f('0xc'),_0x432033,_0x5d3f('0xd'));logger[_0x5d3f('0xe')](_0x5d3f('0xf'),_0x432033,_0x5d3f('0xd'),JSON[_0x5d3f('0x10')](_0x3f29c9));if(_0x3f29c9[_0x5d3f('0x11')]){if(_0x3f29c9[_0x5d3f('0x11')][_0x5d3f('0x12')]===0x1f4){logger[_0x5d3f('0x11')](_0x5d3f('0xc'),_0x432033,_0x3f29c9['error'][_0x5d3f('0x13')]);return _0x4f64d0(_0x3f29c9[_0x5d3f('0x11')][_0x5d3f('0x13')]);}logger[_0x5d3f('0x11')]('Automation,\x20%s,\x20%s',_0x432033,_0x3f29c9[_0x5d3f('0x11')][_0x5d3f('0x13')]);return _0x1b18bb(_0x3f29c9['error'][_0x5d3f('0x13')]);}else{logger['info'](_0x5d3f('0xc'),_0x432033,_0x5d3f('0xd'));_0x1b18bb(_0x3f29c9[_0x5d3f('0x14')][_0x5d3f('0x13')]);}})[_0x5d3f('0x15')](function(_0x10156f){logger[_0x5d3f('0x11')]('Automation,\x20%s,\x20%s',_0x432033,_0x10156f);_0x4f64d0(_0x10156f);});});} \ No newline at end of file +var _0x4af8=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','Automation,\x20%s,\x20%s','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x7b4bd8,_0x383ae8){var _0x1b70ce=function(_0x597000){while(--_0x597000){_0x7b4bd8['push'](_0x7b4bd8['shift']());}};_0x1b70ce(++_0x383ae8);}(_0x4af8,0x1ad));var _0x84af=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x4af8[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x550ee6,_0x422c5b,_0x294bc8){return new BPromise(function(_0x483ecc,_0x5b5e45){return client[_0x84af('0x8')](_0x550ee6,_0x294bc8)[_0x84af('0x9')](function(_0x479e1b){logger[_0x84af('0xa')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x84af('0xb'));logger[_0x84af('0xc')](_0x84af('0xd'),_0x422c5b,_0x84af('0xb'),JSON['stringify'](_0x479e1b));if(_0x479e1b[_0x84af('0xe')]){if(_0x479e1b['error'][_0x84af('0xf')]===0x1f4){logger[_0x84af('0xe')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);return _0x5b5e45(_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);}logger['error'](_0x84af('0x11'),_0x422c5b,_0x479e1b['error'][_0x84af('0x10')]);return _0x483ecc(_0x479e1b[_0x84af('0xe')]['message']);}else{logger[_0x84af('0xa')](_0x84af('0x11'),_0x422c5b,'request\x20sent');_0x483ecc(_0x479e1b[_0x84af('0x12')]['message']);}})[_0x84af('0x13')](function(_0x33baf1){logger['error']('Automation,\x20%s,\x20%s',_0x422c5b,_0x33baf1);_0x5b5e45(_0x33baf1);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c5ffd20..5158733 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 _0x7e16=['get','isAuthenticated','index','/:id','/:id/conditions','getConditions','getActions','post','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x386fb0,_0x352a8b){var _0x47df67=function(_0x109e0d){while(--_0x109e0d){_0x386fb0['push'](_0x386fb0['shift']());}};_0x47df67(++_0x352a8b);}(_0x7e16,0x16f));var _0x67e1=function(_0x1cb5f7,_0x42549c){_0x1cb5f7=_0x1cb5f7-0x0;var _0x451201=_0x7e16[_0x1cb5f7];return _0x451201;};'use strict';var multer=require(_0x67e1('0x0'));var util=require(_0x67e1('0x1'));var path=require(_0x67e1('0x2'));var timeout=require(_0x67e1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x67e1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x67e1('0x5'));var config=require(_0x67e1('0x6'));var controller=require('./automation.controller');router[_0x67e1('0x7')]('/',auth[_0x67e1('0x8')](),controller[_0x67e1('0x9')]);router[_0x67e1('0x7')](_0x67e1('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x67e1('0xb'),auth[_0x67e1('0x8')](),controller[_0x67e1('0xc')]);router[_0x67e1('0x7')]('/:id/actions',auth[_0x67e1('0x8')](),controller[_0x67e1('0xd')]);router[_0x67e1('0xe')]('/',auth[_0x67e1('0x8')](),controller['create']);router[_0x67e1('0xe')]('/:id/conditions',auth[_0x67e1('0x8')](),controller['addConditions']);router['post'](_0x67e1('0xf'),auth[_0x67e1('0x8')](),controller[_0x67e1('0x10')]);router[_0x67e1('0x11')]('/:id',auth[_0x67e1('0x8')](),controller[_0x67e1('0x12')]);router[_0x67e1('0x13')]('/:id',auth[_0x67e1('0x8')](),controller[_0x67e1('0x14')]);module[_0x67e1('0x15')]=router; \ No newline at end of file +var _0x7b47=['./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19f074,_0x208bb3){var _0xe1a2ec=function(_0x3163cb){while(--_0x3163cb){_0x19f074['push'](_0x19f074['shift']());}};_0xe1a2ec(++_0x208bb3);}(_0x7b47,0x118));var _0x77b4=function(_0xc3ef36,_0x34dfa1){_0xc3ef36=_0xc3ef36-0x0;var _0x16b8e8=_0x7b47[_0xc3ef36];return _0x16b8e8;};'use strict';var multer=require('multer');var util=require(_0x77b4('0x0'));var path=require('path');var timeout=require(_0x77b4('0x1'));var express=require(_0x77b4('0x2'));var router=express[_0x77b4('0x3')]();var fs_extra=require(_0x77b4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77b4('0x5'));var config=require('../../config/environment');var controller=require(_0x77b4('0x6'));router[_0x77b4('0x7')]('/',auth[_0x77b4('0x8')](),controller[_0x77b4('0x9')]);router[_0x77b4('0x7')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller['show']);router[_0x77b4('0x7')](_0x77b4('0xb'),auth[_0x77b4('0x8')](),controller['getConditions']);router[_0x77b4('0x7')](_0x77b4('0xc'),auth[_0x77b4('0x8')](),controller[_0x77b4('0xd')]);router[_0x77b4('0xe')]('/',auth[_0x77b4('0x8')](),controller[_0x77b4('0xf')]);router[_0x77b4('0xe')](_0x77b4('0xb'),auth['isAuthenticated'](),controller[_0x77b4('0x10')]);router[_0x77b4('0xe')](_0x77b4('0xc'),auth[_0x77b4('0x8')](),controller['addActions']);router[_0x77b4('0x11')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller[_0x77b4('0x12')]);router[_0x77b4('0x13')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller[_0x77b4('0x14')]);module[_0x77b4('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index af53b34..5cb5c7a 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 _0xbdb8=['ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x4e0faf,_0x268f50){var _0x59096b=function(_0x1261ff){while(--_0x1261ff){_0x4e0faf['push'](_0x4e0faf['shift']());}};_0x59096b(++_0x268f50);}(_0xbdb8,0x13b));var _0x8bdb=function(_0x41232a,_0x20440d){_0x41232a=_0x41232a-0x0;var _0x1ab731=_0xbdb8[_0x41232a];return _0x1ab731;};'use strict';var Sequelize=require(_0x8bdb('0x0'));module[_0x8bdb('0x1')]={'name':{'type':Sequelize[_0x8bdb('0x2')],'unique':_0x8bdb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8bdb('0x4')](_0x8bdb('0x5')),'allowNull':![],'defaultValue':_0x8bdb('0x5')},'description':{'type':Sequelize[_0x8bdb('0x2')]},'active':{'type':Sequelize[_0x8bdb('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8bdb('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8bdb('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8bdb('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8bdb('0x2')]},'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[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8bdb('0x9')](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8bdb('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8bdb('0x2')],'defaultValue':_0x8bdb('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8bdb('0x10'),_0x8bdb('0x11'),'onlyIfOpen'),'defaultValue':_0x8bdb('0x10')},'dialAMDActive':{'type':Sequelize[_0x8bdb('0x6')],'defaultValue':0x0,'comment':_0x8bdb('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x8bdb('0x9')](0x9)[_0x8bdb('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8bdb('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x8bdb('0x9')](0x9)[_0x8bdb('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8bdb('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8bdb('0x9')](0x9)[_0x8bdb('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bdb('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8bdb('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8bdb('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8bdb('0x9')](0x9)[_0x8bdb('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8bdb('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8bdb('0x9')](0x9)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8bdb('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8bdb('0x9')](0x5)[_0x8bdb('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8bdb('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8bdb('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8bdb('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8bdb('0x4')](_0x8bdb('0x1b'),'ASC'),'defaultValue':_0x8bdb('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bdb('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8bdb('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8bdb('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x8bdb('0x9')](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8bdb('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8bdb('0x9')](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8bdb('0x9')](0x3)[_0x8bdb('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8bdb('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8bdb('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8bdb('0x27')}}; \ No newline at end of file +var _0x7e08=['Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0x7e08,0xcc));var _0x87e0=function(_0x5a8432,_0x213916){_0x5a8432=_0x5a8432-0x0;var _0x2cadb0=_0x7e08[_0x5a8432];return _0x2cadb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x87e0('0x0')],'unique':_0x87e0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x87e0('0x2')),'allowNull':![],'defaultValue':_0x87e0('0x2')},'description':{'type':Sequelize[_0x87e0('0x0')]},'active':{'type':Sequelize[_0x87e0('0x3')],'defaultValue':0x0,'comment':_0x87e0('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x87e0('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x87e0('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x87e0('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x87e0('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'comment':_0x87e0('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':_0x87e0('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x87e0('0xd')](_0x87e0('0xe'),_0x87e0('0xf'),_0x87e0('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x87e0('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x87e0('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x87e0('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x87e0('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87e0('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x87e0('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x87e0('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x87e0('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x87e0('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x87e0('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87e0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x87e0('0x1a'),_0x87e0('0x1b')),'defaultValue':_0x87e0('0x1a')},'dialPrefix':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index bd56c37..f7694bd 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 _0x35ff=['CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','into','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','merge','VIRTUAL','options','where','include','findAll','params','keys','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()'];(function(_0x3e15d5,_0x5f1fbd){var _0xb48007=function(_0x312435){while(--_0x312435){_0x3e15d5['push'](_0x3e15d5['shift']());}};_0xb48007(++_0x5f1fbd);}(_0x35ff,0xb3));var _0xf35f=function(_0x43fac7,_0x158f20){_0x43fac7=_0x43fac7-0x0;var _0x9a9a6=_0x35ff[_0x43fac7];return _0x9a9a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf35f('0x0'));var zipdir=require(_0xf35f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf35f('0x2'));var moment=require(_0xf35f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf35f('0x4'));var util=require('util');var path=require(_0xf35f('0x5'));var sox=require(_0xf35f('0x6'));var csv=require(_0xf35f('0x7'));var ejs=require(_0xf35f('0x8'));var fs=require('fs');var fs_extra=require(_0xf35f('0x9'));var _=require(_0xf35f('0xa'));var squel=require('squel');var crypto=require(_0xf35f('0xb'));var jsforce=require(_0xf35f('0xc'));var deskjs=require(_0xf35f('0xd'));var toCsv=require(_0xf35f('0x7'));var querystring=require('querystring');var Papa=require(_0xf35f('0xe'));var Redis=require(_0xf35f('0xf'));var authService=require(_0xf35f('0x10'));var qs=require(_0xf35f('0x11'));var as=require(_0xf35f('0x12'));var hardwareService=require(_0xf35f('0x13'));var logger=require(_0xf35f('0x14'))('api');var utils=require(_0xf35f('0x15'));var config=require(_0xf35f('0x16'));var licenseUtil=require(_0xf35f('0x17'));var db=require(_0xf35f('0x18'))['db'];function respondWithStatusCode(_0x2a5109,_0xf33700){_0xf33700=_0xf33700||0xcc;return function(_0x26588a){if(_0x26588a){return _0x2a5109[_0xf35f('0x19')](_0xf33700);}return _0x2a5109['status'](_0xf33700)[_0xf35f('0x1a')]();};}function respondWithResult(_0x47b652,_0xe29ff7){_0xe29ff7=_0xe29ff7||0xc8;return function(_0x335c9a){if(_0x335c9a){return _0x47b652['status'](_0xe29ff7)[_0xf35f('0x1b')](_0x335c9a);}};}function respondWithFilteredResult(_0x378009,_0x83110d){return function(_0x2fff4c){if(_0x2fff4c){var _0x246cc8=typeof _0x83110d['offset']===_0xf35f('0x1c')&&typeof _0x83110d[_0xf35f('0x1d')]===_0xf35f('0x1c');var _0x1ec2c3=_0x2fff4c['count'];var _0x7c0c72=_0x246cc8?0x0:_0x83110d[_0xf35f('0x1e')];var _0x3c76ee=_0x246cc8?_0x2fff4c[_0xf35f('0x1f')]:_0x83110d[_0xf35f('0x1e')]+_0x83110d['limit'];var _0x4348af;if(_0x3c76ee>=_0x1ec2c3){_0x3c76ee=_0x1ec2c3;_0x4348af=0xc8;}else{_0x4348af=0xce;}_0x378009[_0xf35f('0x20')](_0x4348af);return _0x378009[_0xf35f('0x21')](_0xf35f('0x22'),_0x7c0c72+'-'+_0x3c76ee+'/'+_0x1ec2c3)[_0xf35f('0x1b')](_0x2fff4c);}return null;};}function patchUpdates(_0x2b86b7){return function(_0x4712b1){try{jsonpatch['apply'](_0x4712b1,_0x2b86b7,!![]);}catch(_0x111519){return BPromise[_0xf35f('0x23')](_0x111519);}return _0x4712b1['save']();};}function saveUpdates(_0x319a63,_0x4c7c5a){return function(_0x37ae89){if(_0x37ae89){return _0x37ae89['update'](_0x319a63)[_0xf35f('0x24')](function(_0x31ac01){return _0x31ac01;});}return null;};}function removeEntity(_0x43e723,_0x577c4b){return function(_0x27e223){if(_0x27e223){return _0x27e223[_0xf35f('0x25')]()[_0xf35f('0x24')](function(){var _0x30a846=_0x27e223[_0xf35f('0x26')]({'plain':!![]});var _0x5f2383='IvrCampaigns';return db[_0xf35f('0x27')][_0xf35f('0x25')]({'where':{'type':_0x5f2383,'resourceId':_0x30a846['id']}})[_0xf35f('0x24')](function(){return _0x27e223;});})[_0xf35f('0x24')](function(){_0x43e723[_0xf35f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c0e3,_0x4e9741){return function(_0x24a76c){if(!_0x24a76c){_0x16c0e3[_0xf35f('0x19')](0x194);}return _0x24a76c;};}function handleError(_0x5282b2,_0x3e2ce9){_0x3e2ce9=_0x3e2ce9||0x1f4;return function(_0x3f88dc){logger[_0xf35f('0x28')](_0x3f88dc[_0xf35f('0x29')]);if(_0x3f88dc[_0xf35f('0x2a')]){delete _0x3f88dc[_0xf35f('0x2a')];}_0x5282b2[_0xf35f('0x20')](_0x3e2ce9)[_0xf35f('0x2b')](_0x3f88dc);};}exports[_0xf35f('0x2c')]=function(_0x2054a3,_0x41a4af){var _0x399d63={},_0xeac473={},_0x3be48e={'count':0x0,'rows':[]};var _0x5a7879=_[_0xf35f('0x2d')](db[_0xf35f('0x2e')][_0xf35f('0x2f')],function(_0x20c391){return{'name':_0x20c391[_0xf35f('0x30')],'type':_0x20c391[_0xf35f('0x31')][_0xf35f('0x32')]};});_0xeac473[_0xf35f('0x33')]=_[_0xf35f('0x2d')](_0x5a7879,'name');_0xeac473[_0xf35f('0x34')]=_['keys'](_0x2054a3[_0xf35f('0x34')]);_0xeac473[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0xeac473['model'],_0xeac473[_0xf35f('0x34')]);_0x399d63[_0xf35f('0x37')]=_[_0xf35f('0x36')](_0xeac473[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x2054a3[_0xf35f('0x34')][_0xf35f('0x38')]));_0x399d63[_0xf35f('0x37')]=_0x399d63['attributes'][_0xf35f('0x39')]?_0x399d63[_0xf35f('0x37')]:_0xeac473['model'];if(!_0x2054a3['query']['hasOwnProperty']('nolimit')){_0x399d63[_0xf35f('0x1d')]=qs['limit'](_0x2054a3[_0xf35f('0x34')][_0xf35f('0x1d')]);_0x399d63[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x2054a3[_0xf35f('0x34')][_0xf35f('0x1e')]);}_0x399d63[_0xf35f('0x3a')]=qs['sort'](_0x2054a3[_0xf35f('0x34')][_0xf35f('0x3b')]);_0x399d63['where']=qs['filters'](_[_0xf35f('0x3c')](_0x2054a3[_0xf35f('0x34')],_0xeac473[_0xf35f('0x35')]),_0x5a7879);if(_0x2054a3[_0xf35f('0x34')][_0xf35f('0x3d')]){_0x399d63['where']=_[_0xf35f('0x3e')](_0x399d63['where'],{'$or':_['map'](_0x5a7879,function(_0x26b2bc){if(_0x26b2bc['type']!==_0xf35f('0x3f')){var _0x2c9d19={};_0x2c9d19[_0x26b2bc[_0xf35f('0x2a')]]={'$like':'%'+_0x2054a3[_0xf35f('0x34')]['filter']+'%'};return _0x2c9d19;}})});}_0x399d63=_[_0xf35f('0x3e')]({},_0x399d63,_0x2054a3[_0xf35f('0x40')]);var _0x4071a2={'where':_0x399d63[_0xf35f('0x41')]};return db['Campaign']['count'](_0x4071a2)[_0xf35f('0x24')](function(_0x3fb1bd){_0x3be48e['count']=_0x3fb1bd;if(_0x2054a3[_0xf35f('0x34')]['includeAll']){_0x399d63[_0xf35f('0x42')]=[{'all':!![]}];}return db[_0xf35f('0x2e')][_0xf35f('0x43')](_0x399d63);})[_0xf35f('0x24')](function(_0xc90488){_0x3be48e['rows']=_0xc90488;return _0x3be48e;})['then'](respondWithFilteredResult(_0x41a4af,_0x399d63))['catch'](handleError(_0x41a4af,null));};exports['show']=function(_0x15b0d7,_0x35cca3){var _0x1b8b96={'raw':![],'where':{'id':_0x15b0d7[_0xf35f('0x44')]['id']}},_0x44bc58={};_0x44bc58[_0xf35f('0x33')]=_[_0xf35f('0x45')](db[_0xf35f('0x2e')][_0xf35f('0x2f')]);_0x44bc58[_0xf35f('0x34')]=_[_0xf35f('0x45')](_0x15b0d7[_0xf35f('0x34')]);_0x44bc58[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0x44bc58['model'],_0x44bc58[_0xf35f('0x34')]);_0x1b8b96[_0xf35f('0x37')]=_[_0xf35f('0x36')](_0x44bc58[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x15b0d7[_0xf35f('0x34')][_0xf35f('0x38')]));_0x1b8b96['attributes']=_0x1b8b96[_0xf35f('0x37')][_0xf35f('0x39')]?_0x1b8b96[_0xf35f('0x37')]:_0x44bc58['model'];if(_0x15b0d7['query'][_0xf35f('0x46')]){_0x1b8b96[_0xf35f('0x42')]=[{'all':!![]}];}_0x1b8b96=_[_0xf35f('0x3e')]({},_0x1b8b96,_0x15b0d7['options']);return db[_0xf35f('0x2e')][_0xf35f('0x47')](_0x1b8b96)[_0xf35f('0x24')](handleEntityNotFound(_0x35cca3,null))[_0xf35f('0x24')](respondWithResult(_0x35cca3,null))[_0xf35f('0x48')](handleError(_0x35cca3,null));};exports['create']=function(_0x28cd8d,_0x5978e1){return db[_0xf35f('0x2e')][_0xf35f('0x49')](_0x28cd8d['body'],{})[_0xf35f('0x24')](function(_0x4c225c){var _0x3cf328=_0x28cd8d[_0xf35f('0x4a')][_0xf35f('0x26')]({'plain':!![]});if(!_0x3cf328)throw new Error(_0xf35f('0x4b'));if(_0x3cf328[_0xf35f('0x4c')]===_0xf35f('0x4a')){var _0xe835f1=_0x4c225c[_0xf35f('0x26')]({'plain':!![]});var _0x41d545=_0xf35f('0x4d');return db[_0xf35f('0x4e')][_0xf35f('0x47')]({'where':{'name':_0x41d545,'userProfileId':_0x3cf328['userProfileId']},'raw':!![]})[_0xf35f('0x24')](function(_0x416275){if(_0x416275&&_0x416275[_0xf35f('0x4f')]===0x0){return db[_0xf35f('0x27')][_0xf35f('0x49')]({'name':_0xe835f1[_0xf35f('0x2a')],'resourceId':_0xe835f1['id'],'type':_0x416275[_0xf35f('0x2a')],'sectionId':_0x416275['id']},{})[_0xf35f('0x24')](function(){return _0x4c225c;});}else{return _0x4c225c;}})['catch'](function(_0x1e687e){logger[_0xf35f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e687e);throw _0x1e687e;});}return _0x4c225c;})[_0xf35f('0x24')](respondWithResult(_0x5978e1,0xc9))[_0xf35f('0x48')](handleError(_0x5978e1,null));};exports[_0xf35f('0x50')]=function(_0x199826,_0x3b5528){var _0x57d3d0={'where':{'id':_0x199826[_0xf35f('0x44')]['id']}},_0x4a1894={};_0x4a1894[_0xf35f('0x33')]=_[_0xf35f('0x45')](db[_0xf35f('0x2e')][_0xf35f('0x2f')]);_0x57d3d0['attributes']=_[_0xf35f('0x36')](_0x4a1894[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x199826[_0xf35f('0x34')][_0xf35f('0x38')]));_0x57d3d0[_0xf35f('0x37')]=_0x57d3d0[_0xf35f('0x37')][_0xf35f('0x39')]?_0x57d3d0[_0xf35f('0x37')]:_0x4a1894['model'];if(_0x199826[_0xf35f('0x34')]['includeAll']){_0x57d3d0['include']=[{'all':!![]}];}_0x57d3d0=_[_0xf35f('0x3e')]({},_0x57d3d0,_0x199826[_0xf35f('0x40')]);return db[_0xf35f('0x2e')][_0xf35f('0x47')](_0x57d3d0)[_0xf35f('0x24')](handleEntityNotFound(_0x3b5528,null))[_0xf35f('0x24')](function(_0x96ee0d){if(_0x96ee0d){var _0x5a6641=_0x96ee0d[_0xf35f('0x26')]({'plain':!![]});_0x5a6641=qs[_0xf35f('0x51')](_0x5a6641,['id',_0xf35f('0x52'),_0xf35f('0x53')]);_0x199826[_0xf35f('0x54')]=_[_0xf35f('0x51')](_0x199826[_0xf35f('0x54')],['id',_0xf35f('0x52'),_0xf35f('0x53')]);return db[_0xf35f('0x2e')]['create'](_[_0xf35f('0x3e')](_0x5a6641,_0x199826[_0xf35f('0x54')]),{'include':_0x199826['query'][_0xf35f('0x46')]?[{'all':!![]}]:undefined})[_0xf35f('0x24')](function(_0x42ef37){var _0x7bbc13=_0x199826[_0xf35f('0x4a')][_0xf35f('0x26')]({'plain':!![]});if(!_0x7bbc13)throw new Error(_0xf35f('0x4b'));if(_0x7bbc13[_0xf35f('0x4c')]===_0xf35f('0x4a')){var _0x11a664=_0x42ef37[_0xf35f('0x26')]({'plain':!![]});var _0x56b42a=_0xf35f('0x4d');return db[_0xf35f('0x4e')][_0xf35f('0x47')]({'where':{'name':_0x56b42a,'userProfileId':_0x7bbc13['userProfileId']},'raw':!![]})[_0xf35f('0x24')](function(_0x935e25){if(_0x935e25&&_0x935e25[_0xf35f('0x4f')]===0x0){return db[_0xf35f('0x27')][_0xf35f('0x49')]({'name':_0x11a664['name'],'resourceId':_0x11a664['id'],'type':_0x935e25['name'],'sectionId':_0x935e25['id']},{})[_0xf35f('0x24')](function(){return _0x42ef37;});}else{return _0x42ef37;}})[_0xf35f('0x48')](function(_0x56a80d){logger[_0xf35f('0x28')](_0xf35f('0x55'),_0x56a80d);throw _0x56a80d;});}return _0x42ef37;});}})[_0xf35f('0x24')](respondWithResult(_0x3b5528,0xc9))[_0xf35f('0x48')](handleError(_0x3b5528,null));};exports[_0xf35f('0x56')]=function(_0x440066,_0x26fb0b){if(_0x440066[_0xf35f('0x54')]['id']){delete _0x440066[_0xf35f('0x54')]['id'];}return db['Campaign'][_0xf35f('0x47')]({'where':{'id':_0x440066['params']['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x26fb0b,null))[_0xf35f('0x24')](saveUpdates(_0x440066[_0xf35f('0x54')],null))[_0xf35f('0x24')](respondWithResult(_0x26fb0b,null))[_0xf35f('0x48')](handleError(_0x26fb0b,null));};exports['destroy']=function(_0x22d2d7,_0xc9e0f5){return db['Campaign']['find']({'where':{'id':_0x22d2d7['params']['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0xc9e0f5,null))[_0xf35f('0x24')](removeEntity(_0xc9e0f5,null))[_0xf35f('0x48')](handleError(_0xc9e0f5,null));};exports[_0xf35f('0x57')]=function(_0x21c1f6,_0x5199ac,_0x2044d0){var _0x1ad669={'raw':!![],'where':{}};var _0x29381c={};var _0x498706={'count':0x0,'rows':[]};return db[_0xf35f('0x2e')][_0xf35f('0x58')]({'where':{'id':_0x21c1f6[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x5199ac,null))[_0xf35f('0x24')](function(_0x399b0f){if(_0x399b0f){_0x29381c[_0xf35f('0x33')]=_[_0xf35f('0x45')](db[_0xf35f('0x59')][_0xf35f('0x2f')]);_0x29381c[_0xf35f('0x34')]=_[_0xf35f('0x45')](_0x21c1f6[_0xf35f('0x34')]);_0x29381c[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0x29381c[_0xf35f('0x33')],_0x29381c[_0xf35f('0x34')]);_0x1ad669[_0xf35f('0x37')]=_[_0xf35f('0x36')](_0x29381c[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x21c1f6['query'][_0xf35f('0x38')]));_0x1ad669[_0xf35f('0x37')]=_0x1ad669[_0xf35f('0x37')][_0xf35f('0x39')]?_0x1ad669[_0xf35f('0x37')]:_0x29381c[_0xf35f('0x33')];if(!_0x21c1f6[_0xf35f('0x34')][_0xf35f('0x5a')](_0xf35f('0x5b'))){_0x1ad669[_0xf35f('0x1d')]=qs[_0xf35f('0x1d')](_0x21c1f6[_0xf35f('0x34')][_0xf35f('0x1d')]);_0x1ad669[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x21c1f6[_0xf35f('0x34')]['offset']);}_0x1ad669[_0xf35f('0x3a')]=qs[_0xf35f('0x3b')](_0x21c1f6['query'][_0xf35f('0x3b')]);_0x1ad669['where']=qs[_0xf35f('0x35')](_[_0xf35f('0x3c')](_0x21c1f6[_0xf35f('0x34')],_0x29381c[_0xf35f('0x35')]));_0x1ad669['where'][_0xf35f('0x5c')]=_0x399b0f['id'];if(_0x21c1f6[_0xf35f('0x34')]['filter']){_0x1ad669[_0xf35f('0x41')]=_[_0xf35f('0x3e')](_0x1ad669[_0xf35f('0x41')],{'$or':_[_0xf35f('0x2d')](_0x1ad669[_0xf35f('0x37')],function(_0x21cb72){var _0x55c037={};_0x55c037[_0x21cb72]={'$like':'%'+_0x21c1f6['query']['filter']+'%'};return _0x55c037;})});}_0x1ad669=_[_0xf35f('0x3e')]({},_0x1ad669,_0x21c1f6['options']);return db[_0xf35f('0x59')]['count']({'where':_0x1ad669['where']})['then'](function(_0x56531e){_0x498706[_0xf35f('0x1f')]=_0x56531e;if(_0x21c1f6[_0xf35f('0x34')][_0xf35f('0x46')]){_0x1ad669[_0xf35f('0x42')]=[{'all':!![]}];}return db[_0xf35f('0x59')]['findAll'](_0x1ad669);})['then'](function(_0x1a5708){_0x498706[_0xf35f('0x5d')]=_0x1a5708;return _0x498706;});}})['then'](respondWithFilteredResult(_0x5199ac,_0x1ad669))[_0xf35f('0x48')](handleError(_0x5199ac,null));};exports['getHopperHistories']=function(_0x4f59bf,_0x259093,_0x4a51d5){var _0xda3b82={'raw':!![],'where':{}};var _0x3db528={};var _0x15aac5={'count':0x0,'rows':[]};return db[_0xf35f('0x2e')][_0xf35f('0x58')]({'where':{'id':_0x4f59bf[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x259093,null))['then'](function(_0xebafaf){if(_0xebafaf){_0x3db528[_0xf35f('0x33')]=_[_0xf35f('0x45')](db['CmHopperHistory'][_0xf35f('0x2f')]);_0x3db528[_0xf35f('0x34')]=_['keys'](_0x4f59bf[_0xf35f('0x34')]);_0x3db528[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0x3db528['model'],_0x3db528['query']);_0xda3b82[_0xf35f('0x37')]=_['intersection'](_0x3db528[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x4f59bf['query'][_0xf35f('0x38')]));_0xda3b82[_0xf35f('0x37')]=_0xda3b82['attributes'][_0xf35f('0x39')]?_0xda3b82['attributes']:_0x3db528[_0xf35f('0x33')];if(!_0x4f59bf[_0xf35f('0x34')][_0xf35f('0x5a')](_0xf35f('0x5b'))){_0xda3b82[_0xf35f('0x1d')]=qs[_0xf35f('0x1d')](_0x4f59bf['query'][_0xf35f('0x1d')]);_0xda3b82[_0xf35f('0x1e')]=qs['offset'](_0x4f59bf['query']['offset']);}_0xda3b82[_0xf35f('0x3a')]=qs[_0xf35f('0x3b')](_0x4f59bf['query']['sort']);_0xda3b82[_0xf35f('0x41')]=qs['filters'](_[_0xf35f('0x3c')](_0x4f59bf[_0xf35f('0x34')],_0x3db528[_0xf35f('0x35')]));_0xda3b82[_0xf35f('0x41')]['CampaignId']=_0xebafaf['id'];if(_0x4f59bf[_0xf35f('0x34')]['filter']){_0xda3b82['where']=_[_0xf35f('0x3e')](_0xda3b82[_0xf35f('0x41')],{'$or':_[_0xf35f('0x2d')](_0xda3b82[_0xf35f('0x37')],function(_0x5cc7c1){var _0x42eca8={};_0x42eca8[_0x5cc7c1]={'$like':'%'+_0x4f59bf[_0xf35f('0x34')]['filter']+'%'};return _0x42eca8;})});}_0xda3b82=_[_0xf35f('0x3e')]({},_0xda3b82,_0x4f59bf[_0xf35f('0x40')]);return db['CmHopperHistory'][_0xf35f('0x1f')]({'where':_0xda3b82[_0xf35f('0x41')]})[_0xf35f('0x24')](function(_0x5ab947){_0x15aac5[_0xf35f('0x1f')]=_0x5ab947;if(_0x4f59bf[_0xf35f('0x34')][_0xf35f('0x46')]){_0xda3b82[_0xf35f('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xda3b82);})[_0xf35f('0x24')](function(_0x457423){_0x15aac5[_0xf35f('0x5d')]=_0x457423;return _0x15aac5;});}})[_0xf35f('0x24')](respondWithFilteredResult(_0x259093,_0xda3b82))[_0xf35f('0x48')](handleError(_0x259093,null));};exports[_0xf35f('0x5e')]=function(_0x21a9f4,_0x229a7f,_0x385afe){var _0x28817a={'raw':!![],'where':{}};var _0x2ba220={};var _0x51ae78={'count':0x0,'rows':[]};return db['Campaign'][_0xf35f('0x58')]({'where':{'id':_0x21a9f4[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x229a7f,null))[_0xf35f('0x24')](function(_0x24fbfc){if(_0x24fbfc){_0x2ba220[_0xf35f('0x33')]=_['keys'](db[_0xf35f('0x5f')][_0xf35f('0x2f')]);_0x2ba220['query']=_[_0xf35f('0x45')](_0x21a9f4[_0xf35f('0x34')]);_0x2ba220['filters']=_[_0xf35f('0x36')](_0x2ba220[_0xf35f('0x33')],_0x2ba220['query']);_0x28817a['attributes']=_['intersection'](_0x2ba220['model'],qs[_0xf35f('0x38')](_0x21a9f4[_0xf35f('0x34')]['fields']));_0x28817a[_0xf35f('0x37')]=_0x28817a[_0xf35f('0x37')]['length']?_0x28817a[_0xf35f('0x37')]:_0x2ba220[_0xf35f('0x33')];if(!_0x21a9f4[_0xf35f('0x34')][_0xf35f('0x5a')](_0xf35f('0x5b'))){_0x28817a[_0xf35f('0x1d')]=qs[_0xf35f('0x1d')](_0x21a9f4[_0xf35f('0x34')]['limit']);_0x28817a[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x21a9f4[_0xf35f('0x34')]['offset']);}_0x28817a[_0xf35f('0x3a')]=qs[_0xf35f('0x3b')](_0x21a9f4[_0xf35f('0x34')]['sort']);_0x28817a[_0xf35f('0x41')]=qs[_0xf35f('0x35')](_[_0xf35f('0x3c')](_0x21a9f4[_0xf35f('0x34')],_0x2ba220[_0xf35f('0x35')]));_0x28817a[_0xf35f('0x41')]['CampaignId']=_0x24fbfc['id'];if(_0x21a9f4[_0xf35f('0x34')]['filter']){_0x28817a['where']=_[_0xf35f('0x3e')](_0x28817a[_0xf35f('0x41')],{'$or':_['map'](_0x28817a[_0xf35f('0x37')],function(_0x4c5751){var _0x407454={};_0x407454[_0x4c5751]={'$like':'%'+_0x21a9f4['query'][_0xf35f('0x3d')]+'%'};return _0x407454;})});}_0x28817a=_[_0xf35f('0x3e')]({},_0x28817a,_0x21a9f4['options']);return db['CmHopperFinal'][_0xf35f('0x1f')]({'where':_0x28817a[_0xf35f('0x41')]})[_0xf35f('0x24')](function(_0x5c82c3){_0x51ae78[_0xf35f('0x1f')]=_0x5c82c3;if(_0x21a9f4[_0xf35f('0x34')][_0xf35f('0x46')]){_0x28817a[_0xf35f('0x42')]=[{'all':!![]}];}return db[_0xf35f('0x5f')]['findAll'](_0x28817a);})[_0xf35f('0x24')](function(_0x2376bb){_0x51ae78[_0xf35f('0x5d')]=_0x2376bb;return _0x51ae78;});}})[_0xf35f('0x24')](respondWithFilteredResult(_0x229a7f,_0x28817a))['catch'](handleError(_0x229a7f,null));};exports['getHopperBlacks']=function(_0x300216,_0x16e68c,_0x2c3e9a){var _0x102824={'raw':!![],'where':{}};var _0x47ff4e={};var _0x12e247={'count':0x0,'rows':[]};return db[_0xf35f('0x2e')]['findOne']({'where':{'id':_0x300216['params']['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x16e68c,null))[_0xf35f('0x24')](function(_0x2a21b2){if(_0x2a21b2){_0x47ff4e[_0xf35f('0x33')]=_[_0xf35f('0x45')](db[_0xf35f('0x60')]['rawAttributes']);_0x47ff4e['query']=_['keys'](_0x300216[_0xf35f('0x34')]);_0x47ff4e['filters']=_[_0xf35f('0x36')](_0x47ff4e[_0xf35f('0x33')],_0x47ff4e[_0xf35f('0x34')]);_0x102824['attributes']=_[_0xf35f('0x36')](_0x47ff4e[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x300216[_0xf35f('0x34')][_0xf35f('0x38')]));_0x102824[_0xf35f('0x37')]=_0x102824[_0xf35f('0x37')]['length']?_0x102824[_0xf35f('0x37')]:_0x47ff4e['model'];if(!_0x300216[_0xf35f('0x34')][_0xf35f('0x5a')]('nolimit')){_0x102824[_0xf35f('0x1d')]=qs[_0xf35f('0x1d')](_0x300216[_0xf35f('0x34')]['limit']);_0x102824[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x300216[_0xf35f('0x34')][_0xf35f('0x1e')]);}_0x102824[_0xf35f('0x3a')]=qs[_0xf35f('0x3b')](_0x300216[_0xf35f('0x34')][_0xf35f('0x3b')]);_0x102824['where']=qs[_0xf35f('0x35')](_[_0xf35f('0x3c')](_0x300216[_0xf35f('0x34')],_0x47ff4e['filters']));_0x102824['where'][_0xf35f('0x5c')]=_0x2a21b2['id'];if(_0x300216[_0xf35f('0x34')]['filter']){_0x102824[_0xf35f('0x41')]=_[_0xf35f('0x3e')](_0x102824[_0xf35f('0x41')],{'$or':_['map'](_0x102824[_0xf35f('0x37')],function(_0x2b905a){var _0x18be1c={};_0x18be1c[_0x2b905a]={'$like':'%'+_0x300216[_0xf35f('0x34')][_0xf35f('0x3d')]+'%'};return _0x18be1c;})});}_0x102824=_[_0xf35f('0x3e')]({},_0x102824,_0x300216[_0xf35f('0x40')]);return db[_0xf35f('0x60')][_0xf35f('0x1f')]({'where':_0x102824[_0xf35f('0x41')]})[_0xf35f('0x24')](function(_0x2ecc9d){_0x12e247[_0xf35f('0x1f')]=_0x2ecc9d;if(_0x300216['query']['includeAll']){_0x102824[_0xf35f('0x42')]=[{'all':!![]}];}return db[_0xf35f('0x60')]['findAll'](_0x102824);})[_0xf35f('0x24')](function(_0x53be16){_0x12e247[_0xf35f('0x5d')]=_0x53be16;return _0x12e247;});}})[_0xf35f('0x24')](respondWithFilteredResult(_0x16e68c,_0x102824))[_0xf35f('0x48')](handleError(_0x16e68c,null));};exports['getLists']=function(_0x1a35a9,_0x2ad24b,_0x383337){var _0x10242a={};var _0x8a6c55={};var _0x32f49b;var _0x3f4ef4;return db[_0xf35f('0x2e')][_0xf35f('0x58')]({'where':{'id':_0x1a35a9['params']['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x2ad24b,null))['then'](function(_0x249148){if(_0x249148){_0x32f49b=_0x249148;_0x8a6c55[_0xf35f('0x33')]=_[_0xf35f('0x45')](db[_0xf35f('0x61')][_0xf35f('0x2f')]);_0x8a6c55[_0xf35f('0x34')]=_[_0xf35f('0x45')](_0x1a35a9['query']);_0x8a6c55[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0x8a6c55[_0xf35f('0x33')],_0x8a6c55[_0xf35f('0x34')]);_0x10242a['attributes']=_[_0xf35f('0x36')](_0x8a6c55[_0xf35f('0x33')],qs[_0xf35f('0x38')](_0x1a35a9[_0xf35f('0x34')]['fields']));_0x10242a[_0xf35f('0x37')]=_0x10242a['attributes']['length']?_0x10242a[_0xf35f('0x37')]:_0x8a6c55[_0xf35f('0x33')];_0x10242a[_0xf35f('0x3a')]=qs[_0xf35f('0x3b')](_0x1a35a9[_0xf35f('0x34')][_0xf35f('0x3b')]);_0x10242a[_0xf35f('0x41')]=qs['filters'](_[_0xf35f('0x3c')](_0x1a35a9[_0xf35f('0x34')],_0x8a6c55[_0xf35f('0x35')]));if(_0x1a35a9[_0xf35f('0x34')]['filter']){_0x10242a['where']=_[_0xf35f('0x3e')](_0x10242a['where'],{'$or':_['map'](_0x10242a[_0xf35f('0x37')],function(_0x290afa){var _0x59b1e8={};_0x59b1e8[_0x290afa]={'$like':'%'+_0x1a35a9[_0xf35f('0x34')]['filter']+'%'};return _0x59b1e8;})});}_0x10242a=_[_0xf35f('0x3e')]({},_0x10242a,_0x1a35a9[_0xf35f('0x40')]);return _0x32f49b['getLists'](_0x10242a);}})[_0xf35f('0x24')](function(_0x14f471){if(_0x14f471){_0x3f4ef4=_0x14f471[_0xf35f('0x39')];if(!_0x1a35a9[_0xf35f('0x34')]['hasOwnProperty'](_0xf35f('0x5b'))){_0x10242a[_0xf35f('0x1d')]=qs['limit'](_0x1a35a9[_0xf35f('0x34')][_0xf35f('0x1d')]);_0x10242a[_0xf35f('0x1e')]=qs['offset'](_0x1a35a9['query'][_0xf35f('0x1e')]);}return _0x32f49b[_0xf35f('0x62')](_0x10242a);}})[_0xf35f('0x24')](function(_0x5c051e){if(_0x5c051e){return _0x5c051e?{'count':_0x3f4ef4,'rows':_0x5c051e}:null;}})['then'](respondWithResult(_0x2ad24b,null))[_0xf35f('0x48')](handleError(_0x2ad24b,null));};exports[_0xf35f('0x63')]=function(_0x43cafa,_0xec603e,_0x587736){var _0x18dd45,_0x2dcf49;var _0x361a80=[];var _0x224b99=moment()[_0xf35f('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign']['find']({'where':{'id':_0x43cafa[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0xec603e,null))[_0xf35f('0x24')](function(_0x5c8475){if(_0x5c8475){_0x2dcf49=_0x5c8475;return _0x5c8475['addLists'](_0x43cafa[_0xf35f('0x54')]['ids'],_['omit'](_0x43cafa[_0xf35f('0x54')],[_0xf35f('0x65'),'id'])||{});}return null;})[_0xf35f('0x66')](function(_0x285510){var _0x6e669d;var _0x1dd8e4;_0x18dd45=_0x285510||[];var _0x766cc5=[];if(_0x285510){for(var _0x27524a=0x0;_0x27524a<_0x285510[_0xf35f('0x39')];_0x27524a+=0x1){var _0x3182a0=_0x285510[_0x27524a][_0xf35f('0x26')]({'plain':!![]});_0x2dcf49[_0xf35f('0x67')]=_0x43cafa[_0xf35f('0x54')][_0xf35f('0x67')]?_0x43cafa[_0xf35f('0x54')][_0xf35f('0x67')]:_0x2dcf49[_0xf35f('0x67')];switch(_0x2dcf49[_0xf35f('0x67')]){case _0xf35f('0x68'):_0x6e669d=squel[_0xf35f('0x69')]()['into'](_0xf35f('0x6a'))[_0xf35f('0x6b')]([_0xf35f('0x6c'),_0xf35f('0x6d'),_0xf35f('0x6e'),_0xf35f('0x6f'),_0xf35f('0x5c'),_0xf35f('0x52'),_0xf35f('0x53')],squel[_0xf35f('0x70')]()[_0xf35f('0x71')](_0xf35f('0x6c'),_0xf35f('0x6c'))['field'](_0xf35f('0x72'),_0xf35f('0x6d'))[_0xf35f('0x71')]('id','ContactId')['field'](_0x3182a0[_0xf35f('0x73')][_0xf35f('0x74')](),_0xf35f('0x6f'))[_0xf35f('0x71')](_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')](),_0xf35f('0x5c'))[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27','createdAt')[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x53'))[_0xf35f('0x75')](_0xf35f('0x76'))['where'](_0xf35f('0x77'))[_0xf35f('0x41')](_0xf35f('0x78'),_0x3182a0[_0xf35f('0x73')][_0xf35f('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xf35f('0x79'),squel['select']()[_0xf35f('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0xf35f('0x75')](_0xf35f('0x7a'))[_0xf35f('0x41')](_0xf35f('0x7b'),_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')]()))['where'](_0xf35f('0x79'),squel[_0xf35f('0x70')]()['field'](_0xf35f('0x7c'))[_0xf35f('0x75')](_0xf35f('0x6a'))[_0xf35f('0x41')]('CampaignId\x20=\x20?',_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')]())))[_0xf35f('0x74')]();break;case'onlyIfOpen':_0x6e669d=squel[_0xf35f('0x69')]()[_0xf35f('0x7d')](_0xf35f('0x6a'))[_0xf35f('0x6b')]([_0xf35f('0x6c'),_0xf35f('0x6d'),_0xf35f('0x6e'),_0xf35f('0x6f'),_0xf35f('0x5c'),_0xf35f('0x52'),_0xf35f('0x53')],squel['select']()['field'](_0xf35f('0x6c'),_0xf35f('0x6c'))[_0xf35f('0x71')]('NOW()','scheduledAt')[_0xf35f('0x71')]('id',_0xf35f('0x6e'))['field'](_0x3182a0['CmListId']['toString'](),_0xf35f('0x6f'))[_0xf35f('0x71')](_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')](),'CampaignId')[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x52'))[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x53'))['from'](_0xf35f('0x76'))[_0xf35f('0x41')](_0xf35f('0x77'))[_0xf35f('0x41')](_0xf35f('0x78'),_0x3182a0['CmListId']['toString']())[_0xf35f('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0xf35f('0x41')](_0xf35f('0x79'),squel[_0xf35f('0x70')]()[_0xf35f('0x71')]('COALESCE(phone,\x27\x27)')[_0xf35f('0x75')]('cm_hopper')[_0xf35f('0x41')]('CampaignId\x20=\x20?',_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')]())))[_0xf35f('0x74')]();break;default:_0x6e669d=squel['insert']()[_0xf35f('0x7d')](_0xf35f('0x6a'))[_0xf35f('0x6b')]([_0xf35f('0x6c'),_0xf35f('0x6d'),_0xf35f('0x6e'),'ListId',_0xf35f('0x5c'),_0xf35f('0x52'),_0xf35f('0x53')],squel[_0xf35f('0x70')]()['field'](_0xf35f('0x6c'),'phone')[_0xf35f('0x71')](_0xf35f('0x72'),_0xf35f('0x6d'))['field']('id',_0xf35f('0x6e'))[_0xf35f('0x71')](_0x3182a0[_0xf35f('0x73')][_0xf35f('0x74')](),'ListId')[_0xf35f('0x71')](_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')](),_0xf35f('0x5c'))[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x52'))[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x53'))[_0xf35f('0x75')](_0xf35f('0x76'))[_0xf35f('0x41')](_0xf35f('0x77'))[_0xf35f('0x41')](_0xf35f('0x78'),_0x3182a0[_0xf35f('0x73')]['toString']())[_0xf35f('0x41')](_0xf35f('0x7e')))[_0xf35f('0x74')]();}_0x1dd8e4=squel[_0xf35f('0x69')]()[_0xf35f('0x7d')](_0xf35f('0x7f'))[_0xf35f('0x6b')]([_0xf35f('0x80'),_0xf35f('0x6d'),_0xf35f('0x6c'),_0xf35f('0x81'),_0xf35f('0x52'),_0xf35f('0x53')],squel[_0xf35f('0x70')]()['field'](_0xf35f('0x82'),'id')[_0xf35f('0x71')]('NOW()','scheduledAt')['field'](_0xf35f('0x83'),_0xf35f('0x6c'))['field'](_0xf35f('0x84'),_0xf35f('0x81'))['field']('\x27'+_0x224b99+'\x27',_0xf35f('0x52'))[_0xf35f('0x71')]('\x27'+_0x224b99+'\x27',_0xf35f('0x53'))[_0xf35f('0x75')](_0xf35f('0x85'),'ci')[_0xf35f('0x86')](_0xf35f('0x6a'),'h',_0xf35f('0x87'))[_0xf35f('0x41')](_0xf35f('0x88'),_0x3182a0[_0xf35f('0x73')][_0xf35f('0x74')]())[_0xf35f('0x41')](_0xf35f('0x89'),_0x43cafa[_0xf35f('0x44')]['id'][_0xf35f('0x74')]())['where']('h.createdAt\x20=\x20?',_0x224b99))[_0xf35f('0x74')]();_0x766cc5[_0xf35f('0x8a')](db[_0xf35f('0x8b')][_0xf35f('0x34')](_0x6e669d));_0x361a80[_0xf35f('0x8a')](db[_0xf35f('0x8b')]['query'](_0x1dd8e4));}return BPromise[_0xf35f('0x8c')](_0x766cc5);}})[_0xf35f('0x24')](function(){return BPromise[_0xf35f('0x8c')](_0x361a80);})[_0xf35f('0x24')](function(){return _0x18dd45;})['then'](respondWithResult(_0xec603e,null))[_0xf35f('0x48')](handleError(_0xec603e,null));};exports['removeLists']=function(_0x38f7aa,_0x16d15c,_0x3dcccf){return db['Campaign'][_0xf35f('0x47')]({'where':{'id':_0x38f7aa[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x16d15c,null))[_0xf35f('0x24')](function(_0x14b05b){if(_0x14b05b){return _0x14b05b[_0xf35f('0x8d')](_0x38f7aa['query'][_0xf35f('0x65')]);}})[_0xf35f('0x24')](function(_0x47044a){if(_0x47044a){return db['CmHopper']['destroy']({'where':{'ListId':_0x38f7aa['query'][_0xf35f('0x65')],'CampaignId':_0x38f7aa[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](function(){return _0x47044a;});}})[_0xf35f('0x24')](respondWithStatusCode(_0x16d15c,null))[_0xf35f('0x48')](handleError(_0x16d15c,null));};exports[_0xf35f('0x8e')]=function(_0x14a5ae,_0x555e04,_0x381fdd){var _0x4a5ebf={};var _0x4b61fd={};var _0x3bccfa;var _0x11a21b;return db[_0xf35f('0x2e')]['findOne']({'where':{'id':_0x14a5ae['params']['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x555e04,null))[_0xf35f('0x24')](function(_0x281f02){if(_0x281f02){_0x3bccfa=_0x281f02;_0x4b61fd[_0xf35f('0x33')]=_['keys'](db['CmList'][_0xf35f('0x2f')]);_0x4b61fd['query']=_[_0xf35f('0x45')](_0x14a5ae[_0xf35f('0x34')]);_0x4b61fd[_0xf35f('0x35')]=_[_0xf35f('0x36')](_0x4b61fd[_0xf35f('0x33')],_0x4b61fd[_0xf35f('0x34')]);_0x4a5ebf['attributes']=_[_0xf35f('0x36')](_0x4b61fd['model'],qs[_0xf35f('0x38')](_0x14a5ae[_0xf35f('0x34')][_0xf35f('0x38')]));_0x4a5ebf[_0xf35f('0x37')]=_0x4a5ebf['attributes'][_0xf35f('0x39')]?_0x4a5ebf[_0xf35f('0x37')]:_0x4b61fd['model'];_0x4a5ebf['order']=qs['sort'](_0x14a5ae[_0xf35f('0x34')]['sort']);_0x4a5ebf['where']=qs[_0xf35f('0x35')](_['pick'](_0x14a5ae[_0xf35f('0x34')],_0x4b61fd[_0xf35f('0x35')]));if(_0x14a5ae['query'][_0xf35f('0x3d')]){_0x4a5ebf[_0xf35f('0x41')]=_[_0xf35f('0x3e')](_0x4a5ebf['where'],{'$or':_[_0xf35f('0x2d')](_0x4a5ebf['attributes'],function(_0x12aa85){var _0x7107d2={};_0x7107d2[_0x12aa85]={'$like':'%'+_0x14a5ae['query'][_0xf35f('0x3d')]+'%'};return _0x7107d2;})});}_0x4a5ebf=_['merge']({},_0x4a5ebf,_0x14a5ae[_0xf35f('0x40')]);return _0x3bccfa[_0xf35f('0x8e')](_0x4a5ebf);}})['then'](function(_0x48e805){if(_0x48e805){_0x11a21b=_0x48e805[_0xf35f('0x39')];if(!_0x14a5ae['query']['hasOwnProperty'](_0xf35f('0x5b'))){_0x4a5ebf['limit']=qs[_0xf35f('0x1d')](_0x14a5ae[_0xf35f('0x34')][_0xf35f('0x1d')]);_0x4a5ebf[_0xf35f('0x1e')]=qs[_0xf35f('0x1e')](_0x14a5ae['query'][_0xf35f('0x1e')]);}return _0x3bccfa['getBlackLists'](_0x4a5ebf);}})[_0xf35f('0x24')](function(_0x364cc5){if(_0x364cc5){return _0x364cc5?{'count':_0x11a21b,'rows':_0x364cc5}:null;}})['then'](respondWithResult(_0x555e04,null))['catch'](handleError(_0x555e04,null));};exports[_0xf35f('0x8f')]=function(_0x1e5224,_0x19ed4f,_0x4966fd){var _0x57d6ac,_0xcd9cd6;var _0x16b12c=[];var _0x8f4ee4=moment()[_0xf35f('0x64')](_0xf35f('0x90'));return db[_0xf35f('0x2e')][_0xf35f('0x47')]({'where':{'id':_0x1e5224[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x19ed4f,null))[_0xf35f('0x24')](function(_0x3c6fe1){if(_0x3c6fe1){_0xcd9cd6=_0x3c6fe1;return _0x3c6fe1[_0xf35f('0x8f')](_0x1e5224[_0xf35f('0x54')][_0xf35f('0x65')],_[_0xf35f('0x51')](_0x1e5224[_0xf35f('0x54')],['ids','id'])||{});}return null;})[_0xf35f('0x66')](function(_0x3b4068){var _0x4c258d;var _0x525839;_0x57d6ac=_0x3b4068||[];var _0x4ad03f=[];if(_0x3b4068){for(var _0x25a712=0x0;_0x25a712<_0x3b4068[_0xf35f('0x39')];_0x25a712+=0x1){var _0x12b8a6=_0x3b4068[_0x25a712][_0xf35f('0x26')]({'plain':!![]});_0x4c258d=squel[_0xf35f('0x69')]()['into'](_0xf35f('0x91'))[_0xf35f('0x6b')]([_0xf35f('0x6c'),'ContactId',_0xf35f('0x6f'),_0xf35f('0x5c'),_0xf35f('0x52'),_0xf35f('0x53')],squel[_0xf35f('0x70')]()[_0xf35f('0x71')](_0xf35f('0x6c'),_0xf35f('0x6c'))[_0xf35f('0x71')]('id',_0xf35f('0x6e'))[_0xf35f('0x71')](_0x12b8a6[_0xf35f('0x73')][_0xf35f('0x74')](),'ListId')[_0xf35f('0x71')](_0x1e5224[_0xf35f('0x44')]['id'][_0xf35f('0x74')](),_0xf35f('0x5c'))[_0xf35f('0x71')](_0xf35f('0x72'),_0xf35f('0x52'))[_0xf35f('0x71')](_0xf35f('0x72'),_0xf35f('0x53'))[_0xf35f('0x75')](_0xf35f('0x76'))[_0xf35f('0x41')](_0xf35f('0x77'))[_0xf35f('0x41')]('ListId\x20=\x20?',_0x12b8a6['CmListId'][_0xf35f('0x74')]())[_0xf35f('0x41')](_0xf35f('0x7e')))[_0xf35f('0x74')]();_0x4ad03f[_0xf35f('0x8a')](db['sequelize'][_0xf35f('0x34')](_0x4c258d));}return BPromise[_0xf35f('0x8c')](_0x4ad03f);}})['then'](function(){return _0x57d6ac;})[_0xf35f('0x24')](respondWithResult(_0x19ed4f,null))[_0xf35f('0x48')](handleError(_0x19ed4f,null));};exports[_0xf35f('0x92')]=function(_0x40e129,_0x21ec2f,_0x1b6d76){return db['Campaign']['find']({'where':{'id':_0x40e129[_0xf35f('0x44')]['id']}})[_0xf35f('0x24')](handleEntityNotFound(_0x21ec2f,null))[_0xf35f('0x24')](function(_0x281b39){if(_0x281b39){return _0x281b39[_0xf35f('0x92')](_0x40e129[_0xf35f('0x34')][_0xf35f('0x65')]);}})[_0xf35f('0x24')](function(_0x49c428){if(_0x49c428){return db[_0xf35f('0x60')][_0xf35f('0x25')]({'where':{'ListId':_0x40e129['query'][_0xf35f('0x65')],'CampaignId':_0x40e129[_0xf35f('0x44')]['id']}})['then'](function(){return _0x49c428;});}})[_0xf35f('0x24')](respondWithStatusCode(_0x21ec2f,null))[_0xf35f('0x48')](handleError(_0x21ec2f,null));}; \ No newline at end of file +var _0xf150=['undefined','limit','count','set','Content-Range','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','map','Campaign','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','autoAssociation','update','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset'];(function(_0x2c9c70,_0x4ab4cb){var _0x3546bf=function(_0x318108){while(--_0x318108){_0x2c9c70['push'](_0x2c9c70['shift']());}};_0x3546bf(++_0x4ab4cb);}(_0xf150,0x106));var _0x0f15=function(_0x5a1321,_0x1de7b0){_0x5a1321=_0x5a1321-0x0;var _0x126ffe=_0xf150[_0x5a1321];return _0x126ffe;};'use strict';var emlformat=require(_0x0f15('0x0'));var rimraf=require(_0x0f15('0x1'));var zipdir=require(_0x0f15('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f15('0x3'));var moment=require(_0x0f15('0x4'));var BPromise=require(_0x0f15('0x5'));var Mustache=require(_0x0f15('0x6'));var util=require(_0x0f15('0x7'));var path=require(_0x0f15('0x8'));var sox=require(_0x0f15('0x9'));var csv=require(_0x0f15('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f15('0xb'));var squel=require(_0x0f15('0xc'));var crypto=require(_0x0f15('0xd'));var jsforce=require(_0x0f15('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f15('0xa'));var querystring=require('querystring');var Papa=require(_0x0f15('0xf'));var Redis=require(_0x0f15('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f15('0x11'));var hardwareService=require(_0x0f15('0x12'));var logger=require(_0x0f15('0x13'))('api');var utils=require(_0x0f15('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f15('0x15'))['db'];function respondWithStatusCode(_0x2d9cc1,_0x3146d2){_0x3146d2=_0x3146d2||0xcc;return function(_0x446cce){if(_0x446cce){return _0x2d9cc1['sendStatus'](_0x3146d2);}return _0x2d9cc1[_0x0f15('0x16')](_0x3146d2)[_0x0f15('0x17')]();};}function respondWithResult(_0x47060d,_0x4a54ea){_0x4a54ea=_0x4a54ea||0xc8;return function(_0x5ab21b){if(_0x5ab21b){return _0x47060d['status'](_0x4a54ea)[_0x0f15('0x18')](_0x5ab21b);}};}function respondWithFilteredResult(_0x33b604,_0x48138c){return function(_0x5827a9){if(_0x5827a9){var _0x46d54b=typeof _0x48138c[_0x0f15('0x19')]===_0x0f15('0x1a')&&typeof _0x48138c[_0x0f15('0x1b')]===_0x0f15('0x1a');var _0x1657e2=_0x5827a9[_0x0f15('0x1c')];var _0x47fb13=_0x46d54b?0x0:_0x48138c[_0x0f15('0x19')];var _0xae2a06=_0x46d54b?_0x5827a9['count']:_0x48138c[_0x0f15('0x19')]+_0x48138c['limit'];var _0x40e739;if(_0xae2a06>=_0x1657e2){_0xae2a06=_0x1657e2;_0x40e739=0xc8;}else{_0x40e739=0xce;}_0x33b604['status'](_0x40e739);return _0x33b604[_0x0f15('0x1d')](_0x0f15('0x1e'),_0x47fb13+'-'+_0xae2a06+'/'+_0x1657e2)['json'](_0x5827a9);}return null;};}function patchUpdates(_0x45b7ed){return function(_0x2b10fd){try{jsonpatch['apply'](_0x2b10fd,_0x45b7ed,!![]);}catch(_0x179c70){return BPromise['reject'](_0x179c70);}return _0x2b10fd['save']();};}function saveUpdates(_0x8e5c1,_0x5d5adf){return function(_0x55a9d8){if(_0x55a9d8){return _0x55a9d8['update'](_0x8e5c1)[_0x0f15('0x1f')](function(_0x179c15){return _0x179c15;});}return null;};}function removeEntity(_0x349de2,_0x2ace21){return function(_0x159ba6){if(_0x159ba6){return _0x159ba6[_0x0f15('0x20')]()[_0x0f15('0x1f')](function(){var _0x26008e=_0x159ba6[_0x0f15('0x21')]({'plain':!![]});var _0x5c9187=_0x0f15('0x22');return db[_0x0f15('0x23')][_0x0f15('0x20')]({'where':{'type':_0x5c9187,'resourceId':_0x26008e['id']}})['then'](function(){return _0x159ba6;});})[_0x0f15('0x1f')](function(){_0x349de2[_0x0f15('0x16')](0xcc)[_0x0f15('0x17')]();});}};}function handleEntityNotFound(_0x23b58e,_0x262a11){return function(_0x455139){if(!_0x455139){_0x23b58e[_0x0f15('0x24')](0x194);}return _0x455139;};}function handleError(_0x1940dd,_0xdc54c3){_0xdc54c3=_0xdc54c3||0x1f4;return function(_0xcc9776){logger[_0x0f15('0x25')](_0xcc9776['stack']);if(_0xcc9776[_0x0f15('0x26')]){delete _0xcc9776[_0x0f15('0x26')];}_0x1940dd[_0x0f15('0x16')](_0xdc54c3)[_0x0f15('0x27')](_0xcc9776);};}exports[_0x0f15('0x28')]=function(_0x38759a,_0x552c80){var _0xa3177c={},_0x57ea7c={},_0x12fea1={'count':0x0,'rows':[]};var _0x32a284=_[_0x0f15('0x29')](db[_0x0f15('0x2a')]['rawAttributes'],function(_0x56d7ff){return{'name':_0x56d7ff['fieldName'],'type':_0x56d7ff[_0x0f15('0x2b')][_0x0f15('0x2c')]};});_0x57ea7c['model']=_[_0x0f15('0x29')](_0x32a284,_0x0f15('0x26'));_0x57ea7c[_0x0f15('0x2d')]=_['keys'](_0x38759a[_0x0f15('0x2d')]);_0x57ea7c[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x57ea7c[_0x0f15('0x30')],_0x57ea7c['query']);_0xa3177c['attributes']=_[_0x0f15('0x2f')](_0x57ea7c[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x38759a[_0x0f15('0x2d')][_0x0f15('0x31')]));_0xa3177c[_0x0f15('0x32')]=_0xa3177c[_0x0f15('0x32')][_0x0f15('0x33')]?_0xa3177c[_0x0f15('0x32')]:_0x57ea7c[_0x0f15('0x30')];if(!_0x38759a[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0xa3177c['limit']=qs[_0x0f15('0x1b')](_0x38759a['query']['limit']);_0xa3177c[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x38759a['query'][_0x0f15('0x19')]);}_0xa3177c['order']=qs['sort'](_0x38759a['query'][_0x0f15('0x36')]);_0xa3177c[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x38759a[_0x0f15('0x2d')],_0x57ea7c[_0x0f15('0x2e')]),_0x32a284);if(_0x38759a['query'][_0x0f15('0x39')]){_0xa3177c[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0xa3177c[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x32a284,function(_0x4e21f4){if(_0x4e21f4[_0x0f15('0x2b')]!==_0x0f15('0x3b')){var _0x3fe0c0={};_0x3fe0c0[_0x4e21f4[_0x0f15('0x26')]]={'$like':'%'+_0x38759a['query']['filter']+'%'};return _0x3fe0c0;}})});}_0xa3177c=_[_0x0f15('0x3a')]({},_0xa3177c,_0x38759a[_0x0f15('0x3c')]);var _0x12ba44={'where':_0xa3177c['where']};return db[_0x0f15('0x2a')][_0x0f15('0x1c')](_0x12ba44)[_0x0f15('0x1f')](function(_0x15cc38){_0x12fea1['count']=_0x15cc38;if(_0x38759a[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0xa3177c[_0x0f15('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x0f15('0x3f')](_0xa3177c);})[_0x0f15('0x1f')](function(_0x1f80a4){_0x12fea1[_0x0f15('0x40')]=_0x1f80a4;return _0x12fea1;})[_0x0f15('0x1f')](respondWithFilteredResult(_0x552c80,_0xa3177c))[_0x0f15('0x41')](handleError(_0x552c80,null));};exports[_0x0f15('0x42')]=function(_0x203255,_0x3348c2){var _0x3cdf3={'raw':![],'where':{'id':_0x203255[_0x0f15('0x43')]['id']}},_0x5ae190={};_0x5ae190[_0x0f15('0x30')]=_['keys'](db[_0x0f15('0x2a')][_0x0f15('0x44')]);_0x5ae190['query']=_['keys'](_0x203255[_0x0f15('0x2d')]);_0x5ae190[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x5ae190['model'],_0x5ae190['query']);_0x3cdf3[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x5ae190[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x203255[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x3cdf3[_0x0f15('0x32')]=_0x3cdf3['attributes'][_0x0f15('0x33')]?_0x3cdf3[_0x0f15('0x32')]:_0x5ae190[_0x0f15('0x30')];if(_0x203255['query']['includeAll']){_0x3cdf3[_0x0f15('0x3e')]=[{'all':!![]}];}_0x3cdf3=_['merge']({},_0x3cdf3,_0x203255[_0x0f15('0x3c')]);return db['Campaign'][_0x0f15('0x45')](_0x3cdf3)[_0x0f15('0x1f')](handleEntityNotFound(_0x3348c2,null))[_0x0f15('0x1f')](respondWithResult(_0x3348c2,null))[_0x0f15('0x41')](handleError(_0x3348c2,null));};exports[_0x0f15('0x46')]=function(_0x40e051,_0x5ec882){return db[_0x0f15('0x2a')][_0x0f15('0x46')](_0x40e051[_0x0f15('0x47')],{})['then'](function(_0x4de6d9){var _0x505882=_0x40e051[_0x0f15('0x48')][_0x0f15('0x21')]({'plain':!![]});if(!_0x505882)throw new Error(_0x0f15('0x49'));if(_0x505882[_0x0f15('0x4a')]===_0x0f15('0x48')){var _0x21a6a7=_0x4de6d9[_0x0f15('0x21')]({'plain':!![]});var _0x406eda='IvrCampaigns';return db[_0x0f15('0x4b')]['find']({'where':{'name':_0x406eda,'userProfileId':_0x505882[_0x0f15('0x4c')]},'raw':!![]})[_0x0f15('0x1f')](function(_0x1301b2){if(_0x1301b2&&_0x1301b2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0f15('0x46')]({'name':_0x21a6a7[_0x0f15('0x26')],'resourceId':_0x21a6a7['id'],'type':_0x1301b2[_0x0f15('0x26')],'sectionId':_0x1301b2['id']},{})[_0x0f15('0x1f')](function(){return _0x4de6d9;});}else{return _0x4de6d9;}})['catch'](function(_0x5156d0){logger[_0x0f15('0x25')](_0x0f15('0x4d'),_0x5156d0);throw _0x5156d0;});}return _0x4de6d9;})[_0x0f15('0x1f')](respondWithResult(_0x5ec882,0xc9))[_0x0f15('0x41')](handleError(_0x5ec882,null));};exports[_0x0f15('0x4e')]=function(_0x1a1a39,_0x3d4eb0){var _0x354719={'where':{'id':_0x1a1a39[_0x0f15('0x43')]['id']}},_0x362d9b={};_0x362d9b['model']=_[_0x0f15('0x4f')](db['Campaign'][_0x0f15('0x44')]);_0x354719['attributes']=_[_0x0f15('0x2f')](_0x362d9b['model'],qs[_0x0f15('0x31')](_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x354719[_0x0f15('0x32')]=_0x354719[_0x0f15('0x32')][_0x0f15('0x33')]?_0x354719[_0x0f15('0x32')]:_0x362d9b[_0x0f15('0x30')];if(_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x354719[_0x0f15('0x3e')]=[{'all':!![]}];}_0x354719=_[_0x0f15('0x3a')]({},_0x354719,_0x1a1a39[_0x0f15('0x3c')]);return db[_0x0f15('0x2a')]['find'](_0x354719)['then'](handleEntityNotFound(_0x3d4eb0,null))[_0x0f15('0x1f')](function(_0x5f7b10){if(_0x5f7b10){var _0x509b42=_0x5f7b10[_0x0f15('0x21')]({'plain':!![]});_0x509b42=qs[_0x0f15('0x50')](_0x509b42,['id',_0x0f15('0x51'),_0x0f15('0x52')]);_0x1a1a39[_0x0f15('0x47')]=_[_0x0f15('0x50')](_0x1a1a39[_0x0f15('0x47')],['id',_0x0f15('0x51'),_0x0f15('0x52')]);return db[_0x0f15('0x2a')][_0x0f15('0x46')](_['merge'](_0x509b42,_0x1a1a39[_0x0f15('0x47')]),{'include':_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x3d')]?[{'all':!![]}]:undefined})[_0x0f15('0x1f')](function(_0x425a9c){var _0x272977=_0x1a1a39[_0x0f15('0x48')][_0x0f15('0x21')]({'plain':!![]});if(!_0x272977)throw new Error(_0x0f15('0x49'));if(_0x272977['role']==='user'){var _0x48eb5a=_0x425a9c['get']({'plain':!![]});var _0x54dfd8='IvrCampaigns';return db[_0x0f15('0x4b')][_0x0f15('0x45')]({'where':{'name':_0x54dfd8,'userProfileId':_0x272977[_0x0f15('0x4c')]},'raw':!![]})[_0x0f15('0x1f')](function(_0x26341a){if(_0x26341a&&_0x26341a[_0x0f15('0x53')]===0x0){return db[_0x0f15('0x23')][_0x0f15('0x46')]({'name':_0x48eb5a['name'],'resourceId':_0x48eb5a['id'],'type':_0x26341a[_0x0f15('0x26')],'sectionId':_0x26341a['id']},{})[_0x0f15('0x1f')](function(){return _0x425a9c;});}else{return _0x425a9c;}})[_0x0f15('0x41')](function(_0x3c8960){logger[_0x0f15('0x25')](_0x0f15('0x4d'),_0x3c8960);throw _0x3c8960;});}return _0x425a9c;});}})[_0x0f15('0x1f')](respondWithResult(_0x3d4eb0,0xc9))[_0x0f15('0x41')](handleError(_0x3d4eb0,null));};exports[_0x0f15('0x54')]=function(_0x5374d0,_0x113531){if(_0x5374d0['body']['id']){delete _0x5374d0[_0x0f15('0x47')]['id'];}return db[_0x0f15('0x2a')]['find']({'where':{'id':_0x5374d0[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x113531,null))[_0x0f15('0x1f')](saveUpdates(_0x5374d0[_0x0f15('0x47')],null))['then'](respondWithResult(_0x113531,null))['catch'](handleError(_0x113531,null));};exports[_0x0f15('0x20')]=function(_0x2395c6,_0x1ded63){return db['Campaign'][_0x0f15('0x45')]({'where':{'id':_0x2395c6[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x1ded63,null))[_0x0f15('0x1f')](removeEntity(_0x1ded63,null))[_0x0f15('0x41')](handleError(_0x1ded63,null));};exports['getHoppers']=function(_0x1b4b64,_0x51ad6d,_0x30b3f2){var _0xc17fee={'raw':!![],'where':{}};var _0x2d8a39={};var _0x46cb18={'count':0x0,'rows':[]};return db['Campaign'][_0x0f15('0x55')]({'where':{'id':_0x1b4b64[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x51ad6d,null))[_0x0f15('0x1f')](function(_0x4408e){if(_0x4408e){_0x2d8a39[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x56')][_0x0f15('0x44')]);_0x2d8a39[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x1b4b64[_0x0f15('0x2d')]);_0x2d8a39[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x2d8a39[_0x0f15('0x30')],_0x2d8a39['query']);_0xc17fee[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x2d8a39[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x1b4b64['query'][_0x0f15('0x31')]));_0xc17fee['attributes']=_0xc17fee[_0x0f15('0x32')][_0x0f15('0x33')]?_0xc17fee[_0x0f15('0x32')]:_0x2d8a39[_0x0f15('0x30')];if(!_0x1b4b64['query'][_0x0f15('0x34')](_0x0f15('0x35'))){_0xc17fee[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x1b4b64[_0x0f15('0x2d')]['limit']);_0xc17fee[_0x0f15('0x19')]=qs['offset'](_0x1b4b64['query'][_0x0f15('0x19')]);}_0xc17fee['order']=qs[_0x0f15('0x36')](_0x1b4b64['query'][_0x0f15('0x36')]);_0xc17fee[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x1b4b64[_0x0f15('0x2d')],_0x2d8a39['filters']));_0xc17fee[_0x0f15('0x37')][_0x0f15('0x57')]=_0x4408e['id'];if(_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x39')]){_0xc17fee['where']=_[_0x0f15('0x3a')](_0xc17fee[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0xc17fee[_0x0f15('0x32')],function(_0x537f80){var _0x370c04={};_0x370c04[_0x537f80]={'$like':'%'+_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x370c04;})});}_0xc17fee=_[_0x0f15('0x3a')]({},_0xc17fee,_0x1b4b64[_0x0f15('0x3c')]);return db[_0x0f15('0x56')][_0x0f15('0x1c')]({'where':_0xc17fee[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x51082a){_0x46cb18['count']=_0x51082a;if(_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0xc17fee[_0x0f15('0x3e')]=[{'all':!![]}];}return db[_0x0f15('0x56')]['findAll'](_0xc17fee);})[_0x0f15('0x1f')](function(_0x2b0fd6){_0x46cb18[_0x0f15('0x40')]=_0x2b0fd6;return _0x46cb18;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x51ad6d,_0xc17fee))['catch'](handleError(_0x51ad6d,null));};exports[_0x0f15('0x58')]=function(_0xad1b45,_0x388c62,_0x1319fd){var _0x1e198c={'raw':!![],'where':{}};var _0x26ee7b={};var _0x22ac0e={'count':0x0,'rows':[]};return db[_0x0f15('0x2a')][_0x0f15('0x55')]({'where':{'id':_0xad1b45[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x388c62,null))[_0x0f15('0x1f')](function(_0x24cd99){if(_0x24cd99){_0x26ee7b['model']=_['keys'](db[_0x0f15('0x59')]['rawAttributes']);_0x26ee7b[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0xad1b45['query']);_0x26ee7b[_0x0f15('0x2e')]=_['intersection'](_0x26ee7b['model'],_0x26ee7b[_0x0f15('0x2d')]);_0x1e198c[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x26ee7b[_0x0f15('0x30')],qs['fields'](_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x1e198c[_0x0f15('0x32')]=_0x1e198c[_0x0f15('0x32')]['length']?_0x1e198c[_0x0f15('0x32')]:_0x26ee7b[_0x0f15('0x30')];if(!_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x1e198c[_0x0f15('0x1b')]=qs['limit'](_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x1e198c[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0xad1b45['query']['offset']);}_0x1e198c[_0x0f15('0x5a')]=qs[_0x0f15('0x36')](_0xad1b45['query'][_0x0f15('0x36')]);_0x1e198c[_0x0f15('0x37')]=qs['filters'](_['pick'](_0xad1b45[_0x0f15('0x2d')],_0x26ee7b[_0x0f15('0x2e')]));_0x1e198c[_0x0f15('0x37')]['CampaignId']=_0x24cd99['id'];if(_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x39')]){_0x1e198c[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x1e198c[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x1e198c[_0x0f15('0x32')],function(_0x1166ef){var _0x467368={};_0x467368[_0x1166ef]={'$like':'%'+_0xad1b45[_0x0f15('0x2d')]['filter']+'%'};return _0x467368;})});}_0x1e198c=_['merge']({},_0x1e198c,_0xad1b45[_0x0f15('0x3c')]);return db[_0x0f15('0x59')]['count']({'where':_0x1e198c[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x33861b){_0x22ac0e[_0x0f15('0x1c')]=_0x33861b;if(_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x1e198c[_0x0f15('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0f15('0x3f')](_0x1e198c);})[_0x0f15('0x1f')](function(_0x55ee1e){_0x22ac0e[_0x0f15('0x40')]=_0x55ee1e;return _0x22ac0e;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x388c62,_0x1e198c))[_0x0f15('0x41')](handleError(_0x388c62,null));};exports['getHopperFinals']=function(_0x3e5ab0,_0xf82f66,_0x331300){var _0x2571e8={'raw':!![],'where':{}};var _0x1c2ed7={};var _0x5ad3c5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3e5ab0[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0xf82f66,null))['then'](function(_0x52bea2){if(_0x52bea2){_0x1c2ed7[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db['CmHopperFinal']['rawAttributes']);_0x1c2ed7[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x3e5ab0[_0x0f15('0x2d')]);_0x1c2ed7[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x1c2ed7[_0x0f15('0x30')],_0x1c2ed7['query']);_0x2571e8['attributes']=_['intersection'](_0x1c2ed7[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x2571e8['attributes']=_0x2571e8[_0x0f15('0x32')]['length']?_0x2571e8['attributes']:_0x1c2ed7[_0x0f15('0x30')];if(!_0x3e5ab0['query'][_0x0f15('0x34')](_0x0f15('0x35'))){_0x2571e8[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x3e5ab0[_0x0f15('0x2d')]['limit']);_0x2571e8[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x19')]);}_0x2571e8['order']=qs[_0x0f15('0x36')](_0x3e5ab0['query'][_0x0f15('0x36')]);_0x2571e8[_0x0f15('0x37')]=qs['filters'](_[_0x0f15('0x38')](_0x3e5ab0[_0x0f15('0x2d')],_0x1c2ed7['filters']));_0x2571e8[_0x0f15('0x37')][_0x0f15('0x57')]=_0x52bea2['id'];if(_0x3e5ab0[_0x0f15('0x2d')]['filter']){_0x2571e8[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x2571e8[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x2571e8[_0x0f15('0x32')],function(_0x69aca7){var _0x9f511c={};_0x9f511c[_0x69aca7]={'$like':'%'+_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x9f511c;})});}_0x2571e8=_[_0x0f15('0x3a')]({},_0x2571e8,_0x3e5ab0[_0x0f15('0x3c')]);return db[_0x0f15('0x5b')][_0x0f15('0x1c')]({'where':_0x2571e8[_0x0f15('0x37')]})['then'](function(_0x4a68a8){_0x5ad3c5[_0x0f15('0x1c')]=_0x4a68a8;if(_0x3e5ab0['query'][_0x0f15('0x3d')]){_0x2571e8[_0x0f15('0x3e')]=[{'all':!![]}];}return db[_0x0f15('0x5b')][_0x0f15('0x3f')](_0x2571e8);})['then'](function(_0x352f5d){_0x5ad3c5['rows']=_0x352f5d;return _0x5ad3c5;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0xf82f66,_0x2571e8))[_0x0f15('0x41')](handleError(_0xf82f66,null));};exports[_0x0f15('0x5c')]=function(_0xc8d0cb,_0x198650,_0x50f2ea){var _0x4286d6={'raw':!![],'where':{}};var _0x26a1b2={};var _0x3ec85d={'count':0x0,'rows':[]};return db[_0x0f15('0x2a')]['findOne']({'where':{'id':_0xc8d0cb[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x198650,null))[_0x0f15('0x1f')](function(_0x21bce5){if(_0x21bce5){_0x26a1b2[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x5d')]['rawAttributes']);_0x26a1b2[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0xc8d0cb[_0x0f15('0x2d')]);_0x26a1b2[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x26a1b2['model'],_0x26a1b2[_0x0f15('0x2d')]);_0x4286d6['attributes']=_[_0x0f15('0x2f')](_0x26a1b2[_0x0f15('0x30')],qs['fields'](_0xc8d0cb['query'][_0x0f15('0x31')]));_0x4286d6[_0x0f15('0x32')]=_0x4286d6['attributes']['length']?_0x4286d6[_0x0f15('0x32')]:_0x26a1b2['model'];if(!_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x4286d6[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x4286d6['offset']=qs[_0x0f15('0x19')](_0xc8d0cb[_0x0f15('0x2d')]['offset']);}_0x4286d6[_0x0f15('0x5a')]=qs[_0x0f15('0x36')](_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x36')]);_0x4286d6['where']=qs[_0x0f15('0x2e')](_['pick'](_0xc8d0cb[_0x0f15('0x2d')],_0x26a1b2[_0x0f15('0x2e')]));_0x4286d6[_0x0f15('0x37')][_0x0f15('0x57')]=_0x21bce5['id'];if(_0xc8d0cb[_0x0f15('0x2d')]['filter']){_0x4286d6['where']=_['merge'](_0x4286d6[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x4286d6[_0x0f15('0x32')],function(_0x1b6554){var _0x3789a5={};_0x3789a5[_0x1b6554]={'$like':'%'+_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x3789a5;})});}_0x4286d6=_['merge']({},_0x4286d6,_0xc8d0cb[_0x0f15('0x3c')]);return db[_0x0f15('0x5d')][_0x0f15('0x1c')]({'where':_0x4286d6[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x3f3608){_0x3ec85d[_0x0f15('0x1c')]=_0x3f3608;if(_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x4286d6[_0x0f15('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x4286d6);})[_0x0f15('0x1f')](function(_0x279ac5){_0x3ec85d[_0x0f15('0x40')]=_0x279ac5;return _0x3ec85d;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x198650,_0x4286d6))[_0x0f15('0x41')](handleError(_0x198650,null));};exports['getLists']=function(_0x40e1e4,_0x45db14,_0x2f1969){var _0x33b2f2={};var _0x2b72a7={};var _0x3c0387;var _0x20b219;return db[_0x0f15('0x2a')][_0x0f15('0x55')]({'where':{'id':_0x40e1e4[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x45db14,null))[_0x0f15('0x1f')](function(_0x21deec){if(_0x21deec){_0x3c0387=_0x21deec;_0x2b72a7[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x5e')]['rawAttributes']);_0x2b72a7[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x40e1e4[_0x0f15('0x2d')]);_0x2b72a7[_0x0f15('0x2e')]=_['intersection'](_0x2b72a7[_0x0f15('0x30')],_0x2b72a7[_0x0f15('0x2d')]);_0x33b2f2[_0x0f15('0x32')]=_['intersection'](_0x2b72a7[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x33b2f2['attributes']=_0x33b2f2['attributes'][_0x0f15('0x33')]?_0x33b2f2[_0x0f15('0x32')]:_0x2b72a7['model'];_0x33b2f2['order']=qs[_0x0f15('0x36')](_0x40e1e4['query'][_0x0f15('0x36')]);_0x33b2f2[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x40e1e4[_0x0f15('0x2d')],_0x2b72a7[_0x0f15('0x2e')]));if(_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x39')]){_0x33b2f2[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x33b2f2[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x33b2f2[_0x0f15('0x32')],function(_0x21e48c){var _0x587cde={};_0x587cde[_0x21e48c]={'$like':'%'+_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x587cde;})});}_0x33b2f2=_[_0x0f15('0x3a')]({},_0x33b2f2,_0x40e1e4[_0x0f15('0x3c')]);return _0x3c0387['getLists'](_0x33b2f2);}})[_0x0f15('0x1f')](function(_0x1a3352){if(_0x1a3352){_0x20b219=_0x1a3352[_0x0f15('0x33')];if(!_0x40e1e4[_0x0f15('0x2d')]['hasOwnProperty']('nolimit')){_0x33b2f2['limit']=qs[_0x0f15('0x1b')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x33b2f2[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x19')]);}return _0x3c0387['getLists'](_0x33b2f2);}})[_0x0f15('0x1f')](function(_0x3442d6){if(_0x3442d6){return _0x3442d6?{'count':_0x20b219,'rows':_0x3442d6}:null;}})[_0x0f15('0x1f')](respondWithResult(_0x45db14,null))[_0x0f15('0x41')](handleError(_0x45db14,null));};exports[_0x0f15('0x5f')]=function(_0x4b3747,_0x2da705,_0x62a577){var _0x38bd84,_0xadcce8;var _0x1ec4fb=[];var _0x4ea4a3=moment()['format'](_0x0f15('0x60'));return db['Campaign'][_0x0f15('0x45')]({'where':{'id':_0x4b3747['params']['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x2da705,null))[_0x0f15('0x1f')](function(_0x284d9a){if(_0x284d9a){_0xadcce8=_0x284d9a;return _0x284d9a[_0x0f15('0x5f')](_0x4b3747[_0x0f15('0x47')][_0x0f15('0x61')],_['omit'](_0x4b3747['body'],['ids','id'])||{});}return null;})[_0x0f15('0x62')](function(_0x342516){var _0x30c890;var _0x3d985c;_0x38bd84=_0x342516||[];var _0x2382ab=[];if(_0x342516){for(var _0x54bdc6=0x0;_0x54bdc6<_0x342516['length'];_0x54bdc6+=0x1){var _0x1f2a6f=_0x342516[_0x54bdc6][_0x0f15('0x21')]({'plain':!![]});_0xadcce8[_0x0f15('0x63')]=_0x4b3747[_0x0f15('0x47')][_0x0f15('0x63')]?_0x4b3747[_0x0f15('0x47')][_0x0f15('0x63')]:_0xadcce8[_0x0f15('0x63')];switch(_0xadcce8[_0x0f15('0x63')]){case'always':_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x66'))[_0x0f15('0x67')]([_0x0f15('0x68'),'scheduledAt',_0x0f15('0x69'),_0x0f15('0x6a'),'CampaignId',_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')]('phone',_0x0f15('0x68'))[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')]('id','ContactId')[_0x0f15('0x6c')](_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')](),_0x0f15('0x6a'))['field'](_0x4b3747[_0x0f15('0x43')]['id']['toString'](),'CampaignId')[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')](_0x0f15('0x73'))[_0x0f15('0x37')]('ListId\x20=\x20?',_0x1f2a6f['CmListId'][_0x0f15('0x70')]())[_0x0f15('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0x0f15('0x37')](_0x0f15('0x74'),squel['select']()[_0x0f15('0x6c')](_0x0f15('0x75'))[_0x0f15('0x71')](_0x0f15('0x76'))[_0x0f15('0x37')](_0x0f15('0x77'),_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')]()))['where'](_0x0f15('0x74'),squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')](_0x0f15('0x78'))[_0x0f15('0x71')](_0x0f15('0x66'))[_0x0f15('0x37')]('CampaignId\x20=\x20?',_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')]())))[_0x0f15('0x70')]();break;case _0x0f15('0x79'):_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')]('cm_hopper')[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x6e'),_0x0f15('0x69'),_0x0f15('0x6a'),_0x0f15('0x57'),'createdAt',_0x0f15('0x52')],squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')]('phone',_0x0f15('0x68'))['field'](_0x0f15('0x6d'),'scheduledAt')[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x1f2a6f[_0x0f15('0x6f')]['toString'](),'ListId')[_0x0f15('0x6c')](_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')]('deletedAt\x20IS\x20NULL')[_0x0f15('0x37')](_0x0f15('0x7a'),_0x1f2a6f['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x0f15('0x37')](_0x0f15('0x74'),squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')](_0x0f15('0x78'))['from'](_0x0f15('0x66'))[_0x0f15('0x37')](_0x0f15('0x77'),_0x4b3747['params']['id'][_0x0f15('0x70')]())))[_0x0f15('0x70')]();break;default:_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x66'))[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x6e'),'ContactId',_0x0f15('0x6a'),_0x0f15('0x57'),_0x0f15('0x51'),_0x0f15('0x52')],squel['select']()[_0x0f15('0x6c')](_0x0f15('0x68'),'phone')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')](),_0x0f15('0x6a'))[_0x0f15('0x6c')](_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27','createdAt')[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27','updatedAt')[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')](_0x0f15('0x73'))[_0x0f15('0x37')](_0x0f15('0x7a'),_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')]())['where'](_0x0f15('0x7b')))[_0x0f15('0x70')]();}_0x3d985c=squel[_0x0f15('0x64')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x0f15('0x7c'),_0x0f15('0x6e'),_0x0f15('0x68'),'OrderBy',_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()['field'](_0x0f15('0x7d'),'id')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')](_0x0f15('0x7e'),_0x0f15('0x68'))[_0x0f15('0x6c')](_0x0f15('0x7f'),_0x0f15('0x80'))['field']('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x81'),'ci')[_0x0f15('0x82')]('cm_hopper','h',_0x0f15('0x83'))[_0x0f15('0x37')](_0x0f15('0x84'),_0x1f2a6f[_0x0f15('0x6f')]['toString']())[_0x0f15('0x37')](_0x0f15('0x85'),_0x4b3747[_0x0f15('0x43')]['id']['toString']())[_0x0f15('0x37')](_0x0f15('0x86'),_0x4ea4a3))[_0x0f15('0x70')]();_0x2382ab[_0x0f15('0x87')](db['sequelize'][_0x0f15('0x2d')](_0x30c890));_0x1ec4fb[_0x0f15('0x87')](db[_0x0f15('0x88')][_0x0f15('0x2d')](_0x3d985c));}return BPromise[_0x0f15('0x89')](_0x2382ab);}})[_0x0f15('0x1f')](function(){return BPromise[_0x0f15('0x89')](_0x1ec4fb);})[_0x0f15('0x1f')](function(){return _0x38bd84;})[_0x0f15('0x1f')](respondWithResult(_0x2da705,null))[_0x0f15('0x41')](handleError(_0x2da705,null));};exports[_0x0f15('0x8a')]=function(_0x5e1ec9,_0x4a291e,_0x361b46){return db[_0x0f15('0x2a')][_0x0f15('0x45')]({'where':{'id':_0x5e1ec9[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x4a291e,null))['then'](function(_0x593b4a){if(_0x593b4a){return _0x593b4a[_0x0f15('0x8a')](_0x5e1ec9[_0x0f15('0x2d')][_0x0f15('0x61')]);}})[_0x0f15('0x1f')](function(_0x42e655){if(_0x42e655){return db[_0x0f15('0x56')][_0x0f15('0x20')]({'where':{'ListId':_0x5e1ec9[_0x0f15('0x2d')]['ids'],'CampaignId':_0x5e1ec9[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](function(){return _0x42e655;});}})[_0x0f15('0x1f')](respondWithStatusCode(_0x4a291e,null))[_0x0f15('0x41')](handleError(_0x4a291e,null));};exports[_0x0f15('0x8b')]=function(_0x2d7b10,_0x4c5fce,_0x18d4a0){var _0x4cdf30={};var _0x31b1be={};var _0x32f15b;var _0x181426;return db['Campaign']['findOne']({'where':{'id':_0x2d7b10[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c5fce,null))[_0x0f15('0x1f')](function(_0x9e1991){if(_0x9e1991){_0x32f15b=_0x9e1991;_0x31b1be[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db['CmList'][_0x0f15('0x44')]);_0x31b1be['query']=_['keys'](_0x2d7b10[_0x0f15('0x2d')]);_0x31b1be[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x31b1be[_0x0f15('0x30')],_0x31b1be[_0x0f15('0x2d')]);_0x4cdf30['attributes']=_['intersection'](_0x31b1be['model'],qs['fields'](_0x2d7b10['query'][_0x0f15('0x31')]));_0x4cdf30['attributes']=_0x4cdf30[_0x0f15('0x32')]['length']?_0x4cdf30[_0x0f15('0x32')]:_0x31b1be[_0x0f15('0x30')];_0x4cdf30['order']=qs[_0x0f15('0x36')](_0x2d7b10['query'][_0x0f15('0x36')]);_0x4cdf30[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_['pick'](_0x2d7b10[_0x0f15('0x2d')],_0x31b1be[_0x0f15('0x2e')]));if(_0x2d7b10[_0x0f15('0x2d')]['filter']){_0x4cdf30[_0x0f15('0x37')]=_['merge'](_0x4cdf30['where'],{'$or':_[_0x0f15('0x29')](_0x4cdf30[_0x0f15('0x32')],function(_0x3e68a6){var _0x43024f={};_0x43024f[_0x3e68a6]={'$like':'%'+_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x43024f;})});}_0x4cdf30=_[_0x0f15('0x3a')]({},_0x4cdf30,_0x2d7b10[_0x0f15('0x3c')]);return _0x32f15b[_0x0f15('0x8b')](_0x4cdf30);}})['then'](function(_0xf4d29b){if(_0xf4d29b){_0x181426=_0xf4d29b[_0x0f15('0x33')];if(!_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x4cdf30[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x4cdf30[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x2d7b10['query'][_0x0f15('0x19')]);}return _0x32f15b['getBlackLists'](_0x4cdf30);}})[_0x0f15('0x1f')](function(_0x5e4c0e){if(_0x5e4c0e){return _0x5e4c0e?{'count':_0x181426,'rows':_0x5e4c0e}:null;}})['then'](respondWithResult(_0x4c5fce,null))['catch'](handleError(_0x4c5fce,null));};exports[_0x0f15('0x8c')]=function(_0x76969a,_0x5488b7,_0x3d0fa2){var _0x1aefa1,_0x4ed614;var _0x52dc22=[];var _0x13af67=moment()[_0x0f15('0x8d')](_0x0f15('0x60'));return db[_0x0f15('0x2a')][_0x0f15('0x45')]({'where':{'id':_0x76969a['params']['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x5488b7,null))[_0x0f15('0x1f')](function(_0x3f051f){if(_0x3f051f){_0x4ed614=_0x3f051f;return _0x3f051f[_0x0f15('0x8c')](_0x76969a['body'][_0x0f15('0x61')],_[_0x0f15('0x50')](_0x76969a[_0x0f15('0x47')],[_0x0f15('0x61'),'id'])||{});}return null;})[_0x0f15('0x62')](function(_0x51e994){var _0x4f85ec;var _0x2ec92a;_0x1aefa1=_0x51e994||[];var _0x2996bd=[];if(_0x51e994){for(var _0x36d9c0=0x0;_0x36d9c0<_0x51e994['length'];_0x36d9c0+=0x1){var _0x23c9c6=_0x51e994[_0x36d9c0][_0x0f15('0x21')]({'plain':!![]});_0x4f85ec=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x8e'))[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x69'),_0x0f15('0x6a'),_0x0f15('0x57'),_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()['field'](_0x0f15('0x68'),'phone')[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x23c9c6[_0x0f15('0x6f')][_0x0f15('0x70')](),'ListId')['field'](_0x76969a[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')](_0x0f15('0x6d'),'createdAt')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x52'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x0f15('0x37')]('ListId\x20=\x20?',_0x23c9c6[_0x0f15('0x6f')][_0x0f15('0x70')]())[_0x0f15('0x37')](_0x0f15('0x7b')))['toString']();_0x2996bd[_0x0f15('0x87')](db[_0x0f15('0x88')][_0x0f15('0x2d')](_0x4f85ec));}return BPromise[_0x0f15('0x89')](_0x2996bd);}})[_0x0f15('0x1f')](function(){return _0x1aefa1;})[_0x0f15('0x1f')](respondWithResult(_0x5488b7,null))[_0x0f15('0x41')](handleError(_0x5488b7,null));};exports[_0x0f15('0x8f')]=function(_0x625c73,_0x5f0f4b,_0x589af0){return db[_0x0f15('0x2a')]['find']({'where':{'id':_0x625c73[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x5f0f4b,null))[_0x0f15('0x1f')](function(_0x28662c){if(_0x28662c){return _0x28662c[_0x0f15('0x8f')](_0x625c73['query'][_0x0f15('0x61')]);}})[_0x0f15('0x1f')](function(_0xd86a3){if(_0xd86a3){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x625c73[_0x0f15('0x2d')][_0x0f15('0x61')],'CampaignId':_0x625c73['params']['id']}})[_0x0f15('0x1f')](function(){return _0xd86a3;});}})['then'](respondWithStatusCode(_0x5f0f4b,null))[_0x0f15('0x41')](handleError(_0x5f0f4b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a28b382..030bd8e 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3bf8c3,_0x374e06){var _0x2b381c=function(_0x2bcfd2){while(--_0x2bcfd2){_0x3bf8c3['push'](_0x3bf8c3['shift']());}};_0x2b381c(++_0x374e06);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6ee2,_0x2cca13){_0x5e6ee2=_0x5e6ee2-0x0;var _0x5c6e59=_0x7a54[_0x5e6ee2];return _0x5c6e59;};'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 e57473e..bd4b30d 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 _0x6183=['include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit'];(function(_0x4cfb6f,_0x230c48){var _0x29ca2d=function(_0x39bb09){while(--_0x39bb09){_0x4cfb6f['push'](_0x4cfb6f['shift']());}};_0x29ca2d(++_0x230c48);}(_0x6183,0x19b));var _0x3618=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0x6183[_0x3df9dd];return _0x4f11e4;};'use strict';var _=require('lodash');var util=require(_0x3618('0x0'));var moment=require(_0x3618('0x1'));var BPromise=require(_0x3618('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3618('0x3'));var db=require(_0x3618('0x4'))['db'];var utils=require(_0x3618('0x5'));var logger=require(_0x3618('0x6'))(_0x3618('0x7'));var config=require(_0x3618('0x8'));var jayson=require(_0x3618('0x9'));var client=jayson[_0x3618('0xa')][_0x3618('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fe4b5,_0x4f910c,_0x50b4ab){return new BPromise(function(_0x42e73a,_0x1b03fc){return client[_0x3618('0xc')](_0x1fe4b5,_0x50b4ab)[_0x3618('0xd')](function(_0x2cee16){logger[_0x3618('0xe')](_0x3618('0xf'),_0x4f910c,_0x3618('0x10'));logger[_0x3618('0x11')](_0x3618('0x12'),_0x4f910c,_0x3618('0x10'),JSON[_0x3618('0x13')](_0x2cee16));if(_0x2cee16['error']){if(_0x2cee16['error'][_0x3618('0x14')]===0x1f4){logger['error'](_0x3618('0xf'),_0x4f910c,_0x2cee16[_0x3618('0x15')]['message']);return _0x1b03fc(_0x2cee16[_0x3618('0x15')][_0x3618('0x16')]);}logger[_0x3618('0x15')](_0x3618('0xf'),_0x4f910c,_0x2cee16[_0x3618('0x15')][_0x3618('0x16')]);return _0x42e73a(_0x2cee16[_0x3618('0x15')][_0x3618('0x16')]);}else{logger['info'](_0x3618('0xf'),_0x4f910c,'request\x20sent');_0x42e73a(_0x2cee16[_0x3618('0x17')][_0x3618('0x16')]);}})[_0x3618('0x18')](function(_0x57e005){logger['error']('Campaign,\x20%s,\x20%s',_0x4f910c,_0x57e005);_0x1b03fc(_0x57e005);});});}exports[_0x3618('0x19')]=function(_0x115ef3){var _0x261f7f=this;return new Promise(function(_0x188dd7,_0x41e1f5){return db[_0x3618('0x1a')]['findAll']({'raw':_0x115ef3[_0x3618('0x1b')]?_0x115ef3[_0x3618('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x115ef3[_0x3618('0x1b')]?_0x115ef3[_0x3618('0x1b')][_0x3618('0x1c')]||null:null,'attributes':_0x115ef3['options']?_0x115ef3[_0x3618('0x1b')][_0x3618('0x1d')]||null:null,'limit':_0x115ef3['options']?_0x115ef3[_0x3618('0x1b')][_0x3618('0x1e')]||null:null,'include':_0x115ef3[_0x3618('0x1b')]?_0x115ef3['options'][_0x3618('0x1f')]?_[_0x3618('0x20')](_0x115ef3[_0x3618('0x1b')][_0x3618('0x1f')],function(_0x150bbd){return{'model':db[_0x150bbd[_0x3618('0x21')]],'as':_0x150bbd['as'],'attributes':_0x150bbd['attributes'],'include':_0x150bbd['include']?_[_0x3618('0x20')](_0x150bbd[_0x3618('0x1f')],function(_0x333e9a){return{'model':db[_0x333e9a['model']],'as':_0x333e9a['as'],'attributes':_0x333e9a[_0x3618('0x1d')],'include':_0x333e9a[_0x3618('0x1f')]?_[_0x3618('0x20')](_0x333e9a['include'],function(_0x379dde){return{'model':db[_0x379dde[_0x3618('0x21')]],'as':_0x379dde['as'],'attributes':_0x379dde[_0x3618('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3618('0xd')](function(_0x343137){logger[_0x3618('0xe')](_0x3618('0x19'),_0x115ef3);logger['debug'](_0x3618('0x19'),_0x115ef3,JSON[_0x3618('0x13')](_0x343137));_0x188dd7(_0x343137);})[_0x3618('0x18')](function(_0x976933){logger[_0x3618('0x15')](_0x3618('0x19'),_0x976933[_0x3618('0x16')],_0x115ef3);_0x41e1f5(_0x261f7f[_0x3618('0x15')](0x1f4,_0x976933['message']));});});}; \ No newline at end of file +var _0xf403=['debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0xf403,0x1d3));var _0x3f40=function(_0x519623,_0x201512){_0x519623=_0x519623-0x0;var _0x295909=_0xf403[_0x519623];return _0x295909;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require(_0x3f40('0x7'))(_0x3f40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x9')][_0x3f40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24fb9e,_0x1f21fa,_0x5878f9){return new BPromise(function(_0x1dffe8,_0x4c1694){return client['request'](_0x24fb9e,_0x5878f9)[_0x3f40('0xb')](function(_0xb4a314){logger[_0x3f40('0xc')]('Campaign,\x20%s,\x20%s',_0x1f21fa,'request\x20sent');logger[_0x3f40('0xd')](_0x3f40('0xe'),_0x1f21fa,_0x3f40('0xf'),JSON['stringify'](_0xb4a314));if(_0xb4a314[_0x3f40('0x10')]){if(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x11')]===0x1f4){logger['error'](_0x3f40('0x12'),_0x1f21fa,_0xb4a314['error'][_0x3f40('0x13')]);return _0x4c1694(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}logger[_0x3f40('0x10')]('Campaign,\x20%s,\x20%s',_0x1f21fa,_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);return _0x1dffe8(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}else{logger[_0x3f40('0xc')]('Campaign,\x20%s,\x20%s',_0x1f21fa,_0x3f40('0xf'));_0x1dffe8(_0xb4a314[_0x3f40('0x14')]['message']);}})['catch'](function(_0x54f596){logger[_0x3f40('0x10')](_0x3f40('0x12'),_0x1f21fa,_0x54f596);_0x4c1694(_0x54f596);});});}exports[_0x3f40('0x15')]=function(_0x131e55){var _0x374644=this;return new Promise(function(_0x5b4ebc,_0x2639ef){return db[_0x3f40('0x16')][_0x3f40('0x17')]({'raw':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x131e55[_0x3f40('0x18')]?_0x131e55['options'][_0x3f40('0x19')]||null:null,'attributes':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')][_0x3f40('0x1a')]||null:null,'limit':_0x131e55[_0x3f40('0x18')]?_0x131e55['options'][_0x3f40('0x1b')]||null:null,'include':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')][_0x3f40('0x1c')]?_[_0x3f40('0x1d')](_0x131e55[_0x3f40('0x18')]['include'],function(_0x31fc91){return{'model':db[_0x31fc91[_0x3f40('0x1e')]],'as':_0x31fc91['as'],'attributes':_0x31fc91[_0x3f40('0x1a')],'include':_0x31fc91['include']?_[_0x3f40('0x1d')](_0x31fc91['include'],function(_0x37b47e){return{'model':db[_0x37b47e['model']],'as':_0x37b47e['as'],'attributes':_0x37b47e['attributes'],'include':_0x37b47e['include']?_[_0x3f40('0x1d')](_0x37b47e[_0x3f40('0x1c')],function(_0x140044){return{'model':db[_0x140044[_0x3f40('0x1e')]],'as':_0x140044['as'],'attributes':_0x140044['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f40('0xb')](function(_0x47ec1c){logger[_0x3f40('0xc')](_0x3f40('0x15'),_0x131e55);logger[_0x3f40('0xd')]('GetCampaign',_0x131e55,JSON[_0x3f40('0x1f')](_0x47ec1c));_0x5b4ebc(_0x47ec1c);})['catch'](function(_0x1cab5c){logger['error']('GetCampaign',_0x1cab5c[_0x3f40('0x13')],_0x131e55);_0x2639ef(_0x374644[_0x3f40('0x10')](0x1f4,_0x1cab5c[_0x3f40('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 966cb32..c2c58f7 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 _0xd7ae=['removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','put','update','delete','destroy'];(function(_0x2744f5,_0x32139f){var _0x274cd5=function(_0x886516){while(--_0x886516){_0x2744f5['push'](_0x2744f5['shift']());}};_0x274cd5(++_0x32139f);}(_0xd7ae,0x10b));var _0xed7a=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd7ae[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xed7a('0x0'));var util=require(_0xed7a('0x1'));var path=require(_0xed7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xed7a('0x3'));var router=express[_0xed7a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed7a('0x5'));var config=require(_0xed7a('0x6'));var controller=require(_0xed7a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xed7a('0x8')]);router[_0xed7a('0x9')](_0xed7a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xed7a('0x9')](_0xed7a('0xb'),auth[_0xed7a('0xc')](),controller[_0xed7a('0xd')]);router[_0xed7a('0x9')]('/:id/hopper_histories',auth[_0xed7a('0xc')](),controller[_0xed7a('0xe')]);router[_0xed7a('0x9')](_0xed7a('0xf'),auth[_0xed7a('0xc')](),controller[_0xed7a('0x10')]);router[_0xed7a('0x9')](_0xed7a('0x11'),auth['isAuthenticated'](),controller[_0xed7a('0x12')]);router[_0xed7a('0x9')]('/:id/lists',auth[_0xed7a('0xc')](),controller[_0xed7a('0x13')]);router['get'](_0xed7a('0x14'),auth[_0xed7a('0xc')](),controller[_0xed7a('0x15')]);router[_0xed7a('0x16')]('/',auth[_0xed7a('0xc')](),controller[_0xed7a('0x17')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xed7a('0x18')]);router['post'](_0xed7a('0x19'),auth[_0xed7a('0xc')](),controller['addLists']);router[_0xed7a('0x16')](_0xed7a('0x14'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xed7a('0x1a')](_0xed7a('0xa'),auth[_0xed7a('0xc')](),controller[_0xed7a('0x1b')]);router[_0xed7a('0x1c')](_0xed7a('0xa'),auth[_0xed7a('0xc')](),controller[_0xed7a('0x1d')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0xed7a('0x1e')]);router[_0xed7a('0x1c')](_0xed7a('0x14'),auth[_0xed7a('0xc')](),controller[_0xed7a('0x1f')]);module[_0xed7a('0x20')]=router; \ No newline at end of file +var _0x994b=['/:id','destroy','removeLists','removeBlackLists','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/hoppers','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','addLists','addBlackLists','put','update','delete'];(function(_0x58a7b5,_0x4469bb){var _0x35c14c=function(_0x6fdbf1){while(--_0x6fdbf1){_0x58a7b5['push'](_0x58a7b5['shift']());}};_0x35c14c(++_0x4469bb);}(_0x994b,0x198));var _0xb994=function(_0x5ee73b,_0x282c4c){_0x5ee73b=_0x5ee73b-0x0;var _0x22948a=_0x994b[_0x5ee73b];return _0x22948a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb994('0x0'));var express=require(_0xb994('0x1'));var router=express['Router']();var fs_extra=require(_0xb994('0x2'));var auth=require(_0xb994('0x3'));var interaction=require(_0xb994('0x4'));var config=require(_0xb994('0x5'));var controller=require('./campaign.controller');router[_0xb994('0x6')]('/',auth['isAuthenticated'](),controller[_0xb994('0x7')]);router[_0xb994('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb994('0x8')]);router[_0xb994('0x6')](_0xb994('0x9'),auth[_0xb994('0xa')](),controller['getHoppers']);router[_0xb994('0x6')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xb994('0xb')]);router[_0xb994('0x6')](_0xb994('0xc'),auth[_0xb994('0xa')](),controller[_0xb994('0xd')]);router[_0xb994('0x6')](_0xb994('0xe'),auth['isAuthenticated'](),controller[_0xb994('0xf')]);router[_0xb994('0x6')](_0xb994('0x10'),auth[_0xb994('0xa')](),controller[_0xb994('0x11')]);router[_0xb994('0x6')](_0xb994('0x12'),auth[_0xb994('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0xb994('0xa')](),controller[_0xb994('0x13')]);router['post'](_0xb994('0x14'),auth[_0xb994('0xa')](),controller['clone']);router['post'](_0xb994('0x10'),auth[_0xb994('0xa')](),controller[_0xb994('0x15')]);router['post']('/:id/blacklists',auth[_0xb994('0xa')](),controller[_0xb994('0x16')]);router[_0xb994('0x17')]('/:id',auth[_0xb994('0xa')](),controller[_0xb994('0x18')]);router[_0xb994('0x19')](_0xb994('0x1a'),auth[_0xb994('0xa')](),controller[_0xb994('0x1b')]);router[_0xb994('0x19')](_0xb994('0x10'),auth['isAuthenticated'](),controller[_0xb994('0x1c')]);router[_0xb994('0x19')](_0xb994('0x12'),auth[_0xb994('0xa')](),controller[_0xb994('0x1d')]);module[_0xb994('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index adf193a..4631e98 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 _0x2dfb=['VIRTUAL','sequelize','exports','STRING','TEXT'];(function(_0x39996e,_0x88d4a5){var _0x4c6179=function(_0xf2be31){while(--_0xf2be31){_0x39996e['push'](_0x39996e['shift']());}};_0x4c6179(++_0x88d4a5);}(_0x2dfb,0xbf));var _0xb2df=function(_0x45d177,_0x1e769b){_0x45d177=_0x45d177-0x0;var _0x1ab0aa=_0x2dfb[_0x45d177];return _0x1ab0aa;};'use strict';var Sequelize=require(_0xb2df('0x0'));module[_0xb2df('0x1')]={'key':{'type':Sequelize[_0xb2df('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb2df('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb2df('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xf19c=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x3c2060,_0x446ca5){var _0x5eb6cc=function(_0x480d68){while(--_0x480d68){_0x3c2060['push'](_0x3c2060['shift']());}};_0x5eb6cc(++_0x446ca5);}(_0xf19c,0x196));var _0xcf19=function(_0x1d0fbb,_0x40fb97){_0x1d0fbb=_0x1d0fbb-0x0;var _0x2235bb=_0xf19c[_0x1d0fbb];return _0x2235bb;};'use strict';var Sequelize=require(_0xcf19('0x0'));module[_0xcf19('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xcf19('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcf19('0x3')]},'name':{'type':Sequelize[_0xcf19('0x4')],'get':function(){return this['getDataValue'](_0xcf19('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f9fcfb8..05ae3ea 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 _0xdcda=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','CannedAnswer','findAll','rows','catch','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0xdcda,0x1ad));var _0xadcd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdcda[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadcd('0x0'));var zipdir=require(_0xadcd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadcd('0x2'));var moment=require(_0xadcd('0x3'));var BPromise=require(_0xadcd('0x4'));var Mustache=require(_0xadcd('0x5'));var util=require(_0xadcd('0x6'));var path=require(_0xadcd('0x7'));var sox=require(_0xadcd('0x8'));var csv=require(_0xadcd('0x9'));var ejs=require(_0xadcd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadcd('0xb'));var squel=require(_0xadcd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadcd('0xd'));var toCsv=require(_0xadcd('0x9'));var querystring=require(_0xadcd('0xe'));var Papa=require(_0xadcd('0xf'));var Redis=require('ioredis');var authService=require(_0xadcd('0x10'));var qs=require(_0xadcd('0x11'));var as=require(_0xadcd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xadcd('0x13'));var config=require(_0xadcd('0x14'));var licenseUtil=require(_0xadcd('0x15'));var db=require(_0xadcd('0x16'))['db'];function respondWithStatusCode(_0x557d5d,_0x58f1b8){_0x58f1b8=_0x58f1b8||0xcc;return function(_0x1ccc5a){if(_0x1ccc5a){return _0x557d5d[_0xadcd('0x17')](_0x58f1b8);}return _0x557d5d[_0xadcd('0x18')](_0x58f1b8)[_0xadcd('0x19')]();};}function respondWithResult(_0x4ecd0b,_0x5da0e9){_0x5da0e9=_0x5da0e9||0xc8;return function(_0x57572a){if(_0x57572a){return _0x4ecd0b[_0xadcd('0x18')](_0x5da0e9)[_0xadcd('0x1a')](_0x57572a);}};}function respondWithFilteredResult(_0x56c248,_0x2e05b1){return function(_0xa727c7){if(_0xa727c7){var _0x1a8f33=typeof _0x2e05b1[_0xadcd('0x1b')]===_0xadcd('0x1c')&&typeof _0x2e05b1['limit']===_0xadcd('0x1c');var _0x36e8a7=_0xa727c7['count'];var _0x9161a2=_0x1a8f33?0x0:_0x2e05b1[_0xadcd('0x1b')];var _0x148bc8=_0x1a8f33?_0xa727c7[_0xadcd('0x1d')]:_0x2e05b1['offset']+_0x2e05b1[_0xadcd('0x1e')];var _0x4f356b;if(_0x148bc8>=_0x36e8a7){_0x148bc8=_0x36e8a7;_0x4f356b=0xc8;}else{_0x4f356b=0xce;}_0x56c248[_0xadcd('0x18')](_0x4f356b);return _0x56c248[_0xadcd('0x1f')](_0xadcd('0x20'),_0x9161a2+'-'+_0x148bc8+'/'+_0x36e8a7)[_0xadcd('0x1a')](_0xa727c7);}return null;};}function patchUpdates(_0x1a9b15){return function(_0x588810){try{jsonpatch[_0xadcd('0x21')](_0x588810,_0x1a9b15,!![]);}catch(_0x64d251){return BPromise['reject'](_0x64d251);}return _0x588810[_0xadcd('0x22')]();};}function saveUpdates(_0x38c23f,_0x3b6c4d){return function(_0xe170e7){if(_0xe170e7){return _0xe170e7[_0xadcd('0x23')](_0x38c23f)[_0xadcd('0x24')](function(_0x5227a2){return _0x5227a2;});}return null;};}function removeEntity(_0x27016e,_0x223573){return function(_0x9af696){if(_0x9af696){return _0x9af696[_0xadcd('0x25')]()[_0xadcd('0x24')](function(){var _0x5813be=_0x9af696[_0xadcd('0x26')]({'plain':!![]});var _0x5be99d=_0xadcd('0x27');return db[_0xadcd('0x28')][_0xadcd('0x25')]({'where':{'type':_0x5be99d,'resourceId':_0x5813be['id']}})[_0xadcd('0x24')](function(){return _0x9af696;});})[_0xadcd('0x24')](function(){_0x27016e['status'](0xcc)[_0xadcd('0x19')]();});}};}function handleEntityNotFound(_0x3e8023,_0x1a9be0){return function(_0x2273f2){if(!_0x2273f2){_0x3e8023[_0xadcd('0x17')](0x194);}return _0x2273f2;};}function handleError(_0x5be04a,_0x43bb71){_0x43bb71=_0x43bb71||0x1f4;return function(_0x532e83){logger[_0xadcd('0x29')](_0x532e83[_0xadcd('0x2a')]);if(_0x532e83[_0xadcd('0x2b')]){delete _0x532e83[_0xadcd('0x2b')];}_0x5be04a[_0xadcd('0x18')](_0x43bb71)['send'](_0x532e83);};}exports[_0xadcd('0x2c')]=function(_0x5b2aa9,_0x5599eb){var _0x4a60ad={},_0x5d1a4a={},_0x1ee4f5={'count':0x0,'rows':[]};var _0x4c2346=_[_0xadcd('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x6c4751){return{'name':_0x6c4751[_0xadcd('0x2e')],'type':_0x6c4751[_0xadcd('0x2f')]['key']};});_0x5d1a4a[_0xadcd('0x30')]=_[_0xadcd('0x2d')](_0x4c2346,'name');_0x5d1a4a[_0xadcd('0x31')]=_[_0xadcd('0x32')](_0x5b2aa9[_0xadcd('0x31')]);_0x5d1a4a['filters']=_[_0xadcd('0x33')](_0x5d1a4a[_0xadcd('0x30')],_0x5d1a4a[_0xadcd('0x31')]);_0x4a60ad[_0xadcd('0x34')]=_[_0xadcd('0x33')](_0x5d1a4a['model'],qs[_0xadcd('0x35')](_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x35')]));_0x4a60ad['attributes']=_0x4a60ad[_0xadcd('0x34')][_0xadcd('0x36')]?_0x4a60ad[_0xadcd('0x34')]:_0x5d1a4a[_0xadcd('0x30')];if(!_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x37')](_0xadcd('0x38'))){_0x4a60ad['limit']=qs['limit'](_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x1e')]);_0x4a60ad[_0xadcd('0x1b')]=qs[_0xadcd('0x1b')](_0x5b2aa9[_0xadcd('0x31')]['offset']);}_0x4a60ad[_0xadcd('0x39')]=qs['sort'](_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x3a')]);_0x4a60ad[_0xadcd('0x3b')]=qs[_0xadcd('0x3c')](_[_0xadcd('0x3d')](_0x5b2aa9[_0xadcd('0x31')],_0x5d1a4a[_0xadcd('0x3c')]),_0x4c2346);if(_0x5b2aa9['query'][_0xadcd('0x3e')]){_0x4a60ad[_0xadcd('0x3b')]=_[_0xadcd('0x3f')](_0x4a60ad[_0xadcd('0x3b')],{'$or':[{'key':{'$like':'%'+_0x5b2aa9['query']['filter']+'%'}},{'value':{'$like':'%'+_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x3e')]+'%'}}]});}_0x4a60ad=_[_0xadcd('0x3f')]({},_0x4a60ad,_0x5b2aa9[_0xadcd('0x40')]);var _0x4d9246={'where':_0x4a60ad['where']};return db['CannedAnswer'][_0xadcd('0x1d')](_0x4d9246)[_0xadcd('0x24')](function(_0x3f09e9){_0x1ee4f5[_0xadcd('0x1d')]=_0x3f09e9;if(_0x5b2aa9[_0xadcd('0x31')][_0xadcd('0x41')]){_0x4a60ad[_0xadcd('0x42')]=[{'all':!![]}];}return db[_0xadcd('0x43')][_0xadcd('0x44')](_0x4a60ad);})['then'](function(_0x76161e){_0x1ee4f5[_0xadcd('0x45')]=_0x76161e;return _0x1ee4f5;})[_0xadcd('0x24')](respondWithFilteredResult(_0x5599eb,_0x4a60ad))[_0xadcd('0x46')](handleError(_0x5599eb,null));};exports['show']=function(_0x1edddb,_0xba4534){var _0x3ece63={'raw':!![],'where':{'id':_0x1edddb['params']['id']}},_0x552290={};_0x552290[_0xadcd('0x30')]=_[_0xadcd('0x32')](db[_0xadcd('0x43')][_0xadcd('0x47')]);_0x552290['query']=_[_0xadcd('0x32')](_0x1edddb['query']);_0x552290['filters']=_['intersection'](_0x552290[_0xadcd('0x30')],_0x552290['query']);_0x3ece63[_0xadcd('0x34')]=_[_0xadcd('0x33')](_0x552290[_0xadcd('0x30')],qs['fields'](_0x1edddb[_0xadcd('0x31')][_0xadcd('0x35')]));_0x3ece63[_0xadcd('0x34')]=_0x3ece63[_0xadcd('0x34')]['length']?_0x3ece63[_0xadcd('0x34')]:_0x552290[_0xadcd('0x30')];if(_0x1edddb[_0xadcd('0x31')][_0xadcd('0x41')]){_0x3ece63[_0xadcd('0x42')]=[{'all':!![]}];}_0x3ece63=_['merge']({},_0x3ece63,_0x1edddb['options']);return db[_0xadcd('0x43')][_0xadcd('0x48')](_0x3ece63)[_0xadcd('0x24')](handleEntityNotFound(_0xba4534,null))[_0xadcd('0x24')](respondWithResult(_0xba4534,null))['catch'](handleError(_0xba4534,null));};exports['update']=function(_0x3ac70e,_0x35aaed){if(_0x3ac70e[_0xadcd('0x49')]['id']){delete _0x3ac70e['body']['id'];}return db['CannedAnswer'][_0xadcd('0x48')]({'where':{'id':_0x3ac70e['params']['id']}})['then'](handleEntityNotFound(_0x35aaed,null))[_0xadcd('0x24')](saveUpdates(_0x3ac70e[_0xadcd('0x49')],null))['then'](respondWithResult(_0x35aaed,null))[_0xadcd('0x46')](handleError(_0x35aaed,null));};exports['destroy']=function(_0x15d6ae,_0x3ebb37){return db[_0xadcd('0x43')][_0xadcd('0x48')]({'where':{'id':_0x15d6ae['params']['id']}})[_0xadcd('0x24')](handleEntityNotFound(_0x3ebb37,null))[_0xadcd('0x24')](removeEntity(_0x3ebb37,null))[_0xadcd('0x46')](handleError(_0x3ebb37,null));};exports[_0xadcd('0x4a')]=function(_0x15b0a2,_0x523137){var _0x4368d0={'key':_0x15b0a2['body']['key']};if(_0x15b0a2[_0xadcd('0x49')][_0xadcd('0x4b')]){_0x4368d0[_0xadcd('0x4b')]=_0x15b0a2['body']['MailAccountId'];}else if(_0x15b0a2['body'][_0xadcd('0x4c')]){_0x4368d0[_0xadcd('0x4c')]=_0x15b0a2[_0xadcd('0x49')][_0xadcd('0x4c')];}else if(_0x15b0a2[_0xadcd('0x49')][_0xadcd('0x4d')]){_0x4368d0[_0xadcd('0x4d')]=_0x15b0a2[_0xadcd('0x49')]['OpenchannelAccountId'];}else if(_0x15b0a2[_0xadcd('0x49')][_0xadcd('0x4e')]){_0x4368d0[_0xadcd('0x4e')]=_0x15b0a2[_0xadcd('0x49')][_0xadcd('0x4e')];}return db['CannedAnswer'][_0xadcd('0x48')]({'where':_0x4368d0})[_0xadcd('0x24')](function(_0x29b95d){if(_0x29b95d){throw new db[(_0xadcd('0x4f'))][(_0xadcd('0x50'))](_0xadcd('0x51'));}return db[_0xadcd('0x43')][_0xadcd('0x4a')](_0x15b0a2[_0xadcd('0x49')]);})[_0xadcd('0x24')](function(_0x65a332){var _0x1e037c=_0x15b0a2[_0xadcd('0x52')][_0xadcd('0x26')]({'plain':!![]});if(!_0x1e037c)throw new Error(_0xadcd('0x53'));if(_0x1e037c[_0xadcd('0x54')]===_0xadcd('0x52')){var _0x41ff21=_0x65a332[_0xadcd('0x26')]({'plain':!![]});return db[_0xadcd('0x55')][_0xadcd('0x48')]({'where':{'name':_0xadcd('0x27'),'userProfileId':_0x1e037c[_0xadcd('0x56')]},'raw':!![]})[_0xadcd('0x24')](function(_0x14edc0){if(_0x14edc0&&_0x14edc0[_0xadcd('0x57')]===0x0){return db[_0xadcd('0x28')][_0xadcd('0x4a')]({'name':_0x41ff21[_0xadcd('0x2b')],'resourceId':_0x41ff21['id'],'type':_0x14edc0[_0xadcd('0x2b')],'sectionId':_0x14edc0['id']},{})[_0xadcd('0x24')](function(){return _0x65a332;});}else{return _0x65a332;}})[_0xadcd('0x46')](function(_0x1f22cf){logger[_0xadcd('0x29')](_0xadcd('0x58'),_0x1f22cf);throw _0x1f22cf;});}return _0x65a332;})['then'](respondWithResult(_0x523137,0xc9))[_0xadcd('0x46')](handleError(_0x523137,null));}; \ No newline at end of file +var _0xf972=['The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','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','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','update','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','ValidationError'];(function(_0x1530f3,_0x2540ad){var _0x1d32bb=function(_0x2ddc8e){while(--_0x2ddc8e){_0x1530f3['push'](_0x1530f3['shift']());}};_0x1d32bb(++_0x2540ad);}(_0xf972,0x180));var _0x2f97=function(_0x33e564,_0x4edab3){_0x33e564=_0x33e564-0x0;var _0x18c12e=_0xf972[_0x33e564];return _0x18c12e;};'use strict';var emlformat=require(_0x2f97('0x0'));var rimraf=require(_0x2f97('0x1'));var zipdir=require(_0x2f97('0x2'));var jsonpatch=require(_0x2f97('0x3'));var rp=require(_0x2f97('0x4'));var moment=require(_0x2f97('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2f97('0x6'));var util=require(_0x2f97('0x7'));var path=require(_0x2f97('0x8'));var sox=require(_0x2f97('0x9'));var csv=require(_0x2f97('0xa'));var ejs=require(_0x2f97('0xb'));var fs=require('fs');var fs_extra=require(_0x2f97('0xc'));var _=require(_0x2f97('0xd'));var squel=require(_0x2f97('0xe'));var crypto=require(_0x2f97('0xf'));var jsforce=require(_0x2f97('0x10'));var deskjs=require(_0x2f97('0x11'));var toCsv=require(_0x2f97('0xa'));var querystring=require(_0x2f97('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2f97('0x13'));var qs=require(_0x2f97('0x14'));var as=require(_0x2f97('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f97('0x16'))(_0x2f97('0x17'));var utils=require(_0x2f97('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2f97('0x19'));var db=require(_0x2f97('0x1a'))['db'];function respondWithStatusCode(_0x186e07,_0x57bdf9){_0x57bdf9=_0x57bdf9||0xcc;return function(_0x5d9215){if(_0x5d9215){return _0x186e07[_0x2f97('0x1b')](_0x57bdf9);}return _0x186e07[_0x2f97('0x1c')](_0x57bdf9)[_0x2f97('0x1d')]();};}function respondWithResult(_0x1b6ce3,_0x5aed95){_0x5aed95=_0x5aed95||0xc8;return function(_0x500b42){if(_0x500b42){return _0x1b6ce3['status'](_0x5aed95)['json'](_0x500b42);}};}function respondWithFilteredResult(_0x27f4a9,_0x3586de){return function(_0x8bacb1){if(_0x8bacb1){var _0x336147=typeof _0x3586de[_0x2f97('0x1e')]===_0x2f97('0x1f')&&typeof _0x3586de[_0x2f97('0x20')]===_0x2f97('0x1f');var _0xccfd1=_0x8bacb1['count'];var _0x193fbc=_0x336147?0x0:_0x3586de[_0x2f97('0x1e')];var _0x526364=_0x336147?_0x8bacb1[_0x2f97('0x21')]:_0x3586de[_0x2f97('0x1e')]+_0x3586de['limit'];var _0x12b141;if(_0x526364>=_0xccfd1){_0x526364=_0xccfd1;_0x12b141=0xc8;}else{_0x12b141=0xce;}_0x27f4a9['status'](_0x12b141);return _0x27f4a9[_0x2f97('0x22')](_0x2f97('0x23'),_0x193fbc+'-'+_0x526364+'/'+_0xccfd1)[_0x2f97('0x24')](_0x8bacb1);}return null;};}function patchUpdates(_0x583a53){return function(_0x3fd520){try{jsonpatch[_0x2f97('0x25')](_0x3fd520,_0x583a53,!![]);}catch(_0xddb628){return BPromise[_0x2f97('0x26')](_0xddb628);}return _0x3fd520[_0x2f97('0x27')]();};}function saveUpdates(_0x37dffd,_0x541728){return function(_0x11f445){if(_0x11f445){return _0x11f445['update'](_0x37dffd)[_0x2f97('0x28')](function(_0x37f5fe){return _0x37f5fe;});}return null;};}function removeEntity(_0x5b4fa2,_0x4bed38){return function(_0xd37982){if(_0xd37982){return _0xd37982[_0x2f97('0x29')]()[_0x2f97('0x28')](function(){var _0x499472=_0xd37982[_0x2f97('0x2a')]({'plain':!![]});var _0x31c37f=_0x2f97('0x2b');return db[_0x2f97('0x2c')][_0x2f97('0x29')]({'where':{'type':_0x31c37f,'resourceId':_0x499472['id']}})[_0x2f97('0x28')](function(){return _0xd37982;});})[_0x2f97('0x28')](function(){_0x5b4fa2[_0x2f97('0x1c')](0xcc)[_0x2f97('0x1d')]();});}};}function handleEntityNotFound(_0x31bf65,_0x1c7cbc){return function(_0xc34815){if(!_0xc34815){_0x31bf65[_0x2f97('0x1b')](0x194);}return _0xc34815;};}function handleError(_0x47cfe6,_0x1b4100){_0x1b4100=_0x1b4100||0x1f4;return function(_0x2a3fa2){logger['error'](_0x2a3fa2[_0x2f97('0x2d')]);if(_0x2a3fa2['name']){delete _0x2a3fa2['name'];}_0x47cfe6[_0x2f97('0x1c')](_0x1b4100)[_0x2f97('0x2e')](_0x2a3fa2);};}exports[_0x2f97('0x2f')]=function(_0x2807d7,_0x1719db){var _0x316518={},_0x367999={},_0x4b7e6e={'count':0x0,'rows':[]};var _0x139df8=_[_0x2f97('0x30')](db[_0x2f97('0x31')][_0x2f97('0x32')],function(_0x50e7be){return{'name':_0x50e7be[_0x2f97('0x33')],'type':_0x50e7be['type'][_0x2f97('0x34')]};});_0x367999[_0x2f97('0x35')]=_[_0x2f97('0x30')](_0x139df8,_0x2f97('0x36'));_0x367999[_0x2f97('0x37')]=_['keys'](_0x2807d7[_0x2f97('0x37')]);_0x367999[_0x2f97('0x38')]=_[_0x2f97('0x39')](_0x367999[_0x2f97('0x35')],_0x367999[_0x2f97('0x37')]);_0x316518[_0x2f97('0x3a')]=_[_0x2f97('0x39')](_0x367999[_0x2f97('0x35')],qs[_0x2f97('0x3b')](_0x2807d7[_0x2f97('0x37')][_0x2f97('0x3b')]));_0x316518[_0x2f97('0x3a')]=_0x316518['attributes'][_0x2f97('0x3c')]?_0x316518[_0x2f97('0x3a')]:_0x367999[_0x2f97('0x35')];if(!_0x2807d7[_0x2f97('0x37')][_0x2f97('0x3d')](_0x2f97('0x3e'))){_0x316518[_0x2f97('0x20')]=qs[_0x2f97('0x20')](_0x2807d7[_0x2f97('0x37')]['limit']);_0x316518['offset']=qs[_0x2f97('0x1e')](_0x2807d7[_0x2f97('0x37')]['offset']);}_0x316518[_0x2f97('0x3f')]=qs[_0x2f97('0x40')](_0x2807d7[_0x2f97('0x37')]['sort']);_0x316518[_0x2f97('0x41')]=qs[_0x2f97('0x38')](_[_0x2f97('0x42')](_0x2807d7[_0x2f97('0x37')],_0x367999[_0x2f97('0x38')]),_0x139df8);if(_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]){_0x316518['where']=_[_0x2f97('0x44')](_0x316518[_0x2f97('0x41')],{'$or':[{'key':{'$like':'%'+_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]+'%'}},{'value':{'$like':'%'+_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]+'%'}}]});}_0x316518=_[_0x2f97('0x44')]({},_0x316518,_0x2807d7[_0x2f97('0x45')]);var _0x517ceb={'where':_0x316518[_0x2f97('0x41')]};return db['CannedAnswer'][_0x2f97('0x21')](_0x517ceb)[_0x2f97('0x28')](function(_0x228c57){_0x4b7e6e[_0x2f97('0x21')]=_0x228c57;if(_0x2807d7['query'][_0x2f97('0x46')]){_0x316518[_0x2f97('0x47')]=[{'all':!![]}];}return db[_0x2f97('0x31')][_0x2f97('0x48')](_0x316518);})[_0x2f97('0x28')](function(_0x2ba80e){_0x4b7e6e[_0x2f97('0x49')]=_0x2ba80e;return _0x4b7e6e;})[_0x2f97('0x28')](respondWithFilteredResult(_0x1719db,_0x316518))[_0x2f97('0x4a')](handleError(_0x1719db,null));};exports['show']=function(_0x423d04,_0x75bf98){var _0x4cd005={'raw':!![],'where':{'id':_0x423d04['params']['id']}},_0x3cc17f={};_0x3cc17f[_0x2f97('0x35')]=_[_0x2f97('0x4b')](db[_0x2f97('0x31')][_0x2f97('0x32')]);_0x3cc17f['query']=_['keys'](_0x423d04[_0x2f97('0x37')]);_0x3cc17f[_0x2f97('0x38')]=_[_0x2f97('0x39')](_0x3cc17f['model'],_0x3cc17f['query']);_0x4cd005[_0x2f97('0x3a')]=_[_0x2f97('0x39')](_0x3cc17f[_0x2f97('0x35')],qs['fields'](_0x423d04[_0x2f97('0x37')][_0x2f97('0x3b')]));_0x4cd005[_0x2f97('0x3a')]=_0x4cd005[_0x2f97('0x3a')][_0x2f97('0x3c')]?_0x4cd005[_0x2f97('0x3a')]:_0x3cc17f[_0x2f97('0x35')];if(_0x423d04[_0x2f97('0x37')]['includeAll']){_0x4cd005[_0x2f97('0x47')]=[{'all':!![]}];}_0x4cd005=_['merge']({},_0x4cd005,_0x423d04[_0x2f97('0x45')]);return db['CannedAnswer']['find'](_0x4cd005)[_0x2f97('0x28')](handleEntityNotFound(_0x75bf98,null))['then'](respondWithResult(_0x75bf98,null))[_0x2f97('0x4a')](handleError(_0x75bf98,null));};exports[_0x2f97('0x4c')]=function(_0xe108cb,_0x2d44fc){if(_0xe108cb['body']['id']){delete _0xe108cb['body']['id'];}return db[_0x2f97('0x31')]['find']({'where':{'id':_0xe108cb[_0x2f97('0x4d')]['id']}})[_0x2f97('0x28')](handleEntityNotFound(_0x2d44fc,null))[_0x2f97('0x28')](saveUpdates(_0xe108cb['body'],null))[_0x2f97('0x28')](respondWithResult(_0x2d44fc,null))['catch'](handleError(_0x2d44fc,null));};exports[_0x2f97('0x29')]=function(_0x4979c1,_0x42ed3d){return db[_0x2f97('0x31')]['find']({'where':{'id':_0x4979c1[_0x2f97('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42ed3d,null))['then'](removeEntity(_0x42ed3d,null))[_0x2f97('0x4a')](handleError(_0x42ed3d,null));};exports[_0x2f97('0x4e')]=function(_0x4916f8,_0x4ce908){var _0x5ab061={'key':_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x34')]};if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x50')]){_0x5ab061[_0x2f97('0x50')]=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x50')];}else if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x51')]){_0x5ab061[_0x2f97('0x51')]=_0x4916f8['body'][_0x2f97('0x51')];}else if(_0x4916f8[_0x2f97('0x4f')]['OpenchannelAccountId']){_0x5ab061[_0x2f97('0x52')]=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x52')];}else if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x53')]){_0x5ab061['ChatWebsiteId']=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x53')];}return db[_0x2f97('0x31')][_0x2f97('0x54')]({'where':_0x5ab061})['then'](function(_0x561fb4){if(_0x561fb4){throw new db['Sequelize'][(_0x2f97('0x55'))](_0x2f97('0x56'));}return db['CannedAnswer'][_0x2f97('0x4e')](_0x4916f8['body']);})['then'](function(_0x27f359){var _0x5a9207=_0x4916f8[_0x2f97('0x57')][_0x2f97('0x2a')]({'plain':!![]});if(!_0x5a9207)throw new Error(_0x2f97('0x58'));if(_0x5a9207[_0x2f97('0x59')]===_0x2f97('0x57')){var _0x1bd0a2=_0x27f359[_0x2f97('0x2a')]({'plain':!![]});return db[_0x2f97('0x5a')][_0x2f97('0x54')]({'where':{'name':'CannedAnswers','userProfileId':_0x5a9207['userProfileId']},'raw':!![]})[_0x2f97('0x28')](function(_0x201612){if(_0x201612&&_0x201612[_0x2f97('0x5b')]===0x0){return db[_0x2f97('0x2c')][_0x2f97('0x4e')]({'name':_0x1bd0a2[_0x2f97('0x36')],'resourceId':_0x1bd0a2['id'],'type':_0x201612[_0x2f97('0x36')],'sectionId':_0x201612['id']},{})[_0x2f97('0x28')](function(){return _0x27f359;});}else{return _0x27f359;}})[_0x2f97('0x4a')](function(_0x21f17d){logger[_0x2f97('0x5c')](_0x2f97('0x5d'),_0x21f17d);throw _0x21f17d;});}return _0x27f359;})[_0x2f97('0x28')](respondWithResult(_0x4ce908,0xc9))['catch'](handleError(_0x4ce908,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6f3ba27..a526c9c 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 _0x6777=['rimraf','exports','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x54ab66,_0x258854){var _0x2a90fb=function(_0x430638){while(--_0x430638){_0x54ab66['push'](_0x54ab66['shift']());}};_0x2a90fb(++_0x258854);}(_0x6777,0xb9));var _0x7677=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x6777[_0x4bb2b9];return _0x40e2a2;};'use strict';var _=require(_0x7677('0x0'));var util=require(_0x7677('0x1'));var logger=require(_0x7677('0x2'))('api');var moment=require(_0x7677('0x3'));var BPromise=require(_0x7677('0x4'));var rp=require(_0x7677('0x5'));var fs=require('fs');var path=require(_0x7677('0x6'));var rimraf=require(_0x7677('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x7677('0x8')]=function(_0x1f0322,_0x2dfb20){return _0x1f0322['define']('CannedAnswer',attributes,{'tableName':_0x7677('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7677('0xa'),'collate':_0x7677('0xb')});}; \ No newline at end of file +var _0xb861=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x55276f,_0x19a1d5){var _0x238cb8=function(_0x12c9b1){while(--_0x12c9b1){_0x55276f['push'](_0x55276f['shift']());}};_0x238cb8(++_0x19a1d5);}(_0xb861,0x9c));var _0x1b86=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0xb861[_0x868b7c];return _0x21683c;};'use strict';var _=require(_0x1b86('0x0'));var util=require(_0x1b86('0x1'));var logger=require(_0x1b86('0x2'))('api');var moment=require(_0x1b86('0x3'));var BPromise=require(_0x1b86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b86('0x5'));var rimraf=require(_0x1b86('0x6'));var config=require(_0x1b86('0x7'));var attributes=require(_0x1b86('0x8'));module['exports']=function(_0x13191c,_0x274531){return _0x13191c[_0x1b86('0x9')](_0x1b86('0xa'),attributes,{'tableName':_0x1b86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1b86('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 44263f5..cae42df 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(_0x3511a9,_0x5d730f){var _0x8f0f70=function(_0x4ed748){while(--_0x4ed748){_0x3511a9['push'](_0x3511a9['shift']());}};_0x8f0f70(++_0x5d730f);}(_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 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(_0x53c71b,_0x4584d3){var _0x3cfbc2=function(_0x1901cb){while(--_0x1901cb){_0x53c71b['push'](_0x53c71b['shift']());}};_0x3cfbc2(++_0x4584d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 37591b1..87de7f2 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 _0xd114=['/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','create'];(function(_0x3b1477,_0x2b1b57){var _0x3b74a0=function(_0x26bb64){while(--_0x26bb64){_0x3b1477['push'](_0x3b1477['shift']());}};_0x3b74a0(++_0x2b1b57);}(_0xd114,0x183));var _0x4d11=function(_0x58a4fb,_0x137141){_0x58a4fb=_0x58a4fb-0x0;var _0x3f0a72=_0xd114[_0x58a4fb];return _0x3f0a72;};'use strict';var multer=require(_0x4d11('0x0'));var util=require(_0x4d11('0x1'));var path=require(_0x4d11('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d11('0x3')]();var fs_extra=require(_0x4d11('0x4'));var auth=require(_0x4d11('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d11('0x6'));var controller=require(_0x4d11('0x7'));router[_0x4d11('0x8')]('/',auth[_0x4d11('0x9')](),controller['index']);router['get']('/:id',auth[_0x4d11('0x9')](),controller[_0x4d11('0xa')]);router[_0x4d11('0xb')]('/',auth[_0x4d11('0x9')](),controller[_0x4d11('0xc')]);router['put'](_0x4d11('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x4d11('0xe')](_0x4d11('0xd'),auth[_0x4d11('0x9')](),controller['destroy']);module[_0x4d11('0xf')]=router; \ No newline at end of file +var _0x3c17=['../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3c17,0xfc));var _0x73c1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3c17[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x73c1('0x0'));var util=require(_0x73c1('0x1'));var path=require(_0x73c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x73c1('0x3'));var interaction=require(_0x73c1('0x4'));var config=require('../../config/environment');var controller=require(_0x73c1('0x5'));router[_0x73c1('0x6')]('/',auth[_0x73c1('0x7')](),controller[_0x73c1('0x8')]);router['get'](_0x73c1('0x9'),auth[_0x73c1('0x7')](),controller['show']);router[_0x73c1('0xa')]('/',auth[_0x73c1('0x7')](),controller[_0x73c1('0xb')]);router[_0x73c1('0xc')]('/:id',auth[_0x73c1('0x7')](),controller[_0x73c1('0xd')]);router[_0x73c1('0xe')](_0x73c1('0x9'),auth[_0x73c1('0x7')](),controller[_0x73c1('0xf')]);module[_0x73c1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 5f0212d..1722faa 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 _0x74a1=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x74a1,0xff));var _0x174a=function(_0xf1ceb4,_0x3443e6){_0xf1ceb4=_0xf1ceb4-0x0;var _0x42ed45=_0x74a1[_0xf1ceb4];return _0x42ed45;};'use strict';var Sequelize=require(_0x174a('0x0'));module[_0x174a('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x174a('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x174a('0x3')]},'dst':{'type':Sequelize[_0x174a('0x3')]},'dcontext':{'type':Sequelize[_0x174a('0x3')]},'channel':{'type':Sequelize[_0x174a('0x3')]},'dstchannel':{'type':Sequelize[_0x174a('0x3')]},'lastapp':{'type':Sequelize[_0x174a('0x3')]},'lastdata':{'type':Sequelize[_0x174a('0x3')]},'duration':{'type':Sequelize[_0x174a('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x174a('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x174a('0x3')]},'amaflags':{'type':Sequelize[_0x174a('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x174a('0x3')]},'userfield':{'type':Sequelize[_0x174a('0x3')]},'uniqueid':{'type':Sequelize[_0x174a('0x3')]},'linkedid':{'type':Sequelize[_0x174a('0x3')]},'sequence':{'type':Sequelize[_0x174a('0x3')]},'peeraccount':{'type':Sequelize[_0x174a('0x3')]},'type':{'type':Sequelize[_0x174a('0x3')]},'tag':{'type':Sequelize[_0x174a('0x3')]}}; \ No newline at end of file +var _0x520e=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0x520e,0x90));var _0xe520=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x520e[_0x4dbba7];return _0x43ef83;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'calldate':{'type':Sequelize[_0xe520('0x2')],'allowNull':![],'defaultValue':_0xe520('0x3')},'clid':{'type':Sequelize[_0xe520('0x4')]},'src':{'type':Sequelize[_0xe520('0x4')]},'dst':{'type':Sequelize[_0xe520('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe520('0x4')]},'dstchannel':{'type':Sequelize[_0xe520('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe520('0x4')]},'duration':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe520('0x4')]},'amaflags':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe520('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe520('0x4')]},'linkedid':{'type':Sequelize[_0xe520('0x4')]},'sequence':{'type':Sequelize[_0xe520('0x4')]},'peeraccount':{'type':Sequelize[_0xe520('0x4')]},'type':{'type':Sequelize[_0xe520('0x4')]},'tag':{'type':Sequelize[_0xe520('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 873fa66..60d17a8 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 _0xa23f=['../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','sendStatus','stack','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','length','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0xa23f,0x7c));var _0xfa23=function(_0x1a0141,_0x4c7e18){_0x1a0141=_0x1a0141-0x0;var _0x305a35=_0xa23f[_0x1a0141];return _0x305a35;};'use strict';var emlformat=require(_0xfa23('0x0'));var rimraf=require(_0xfa23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa23('0x2'));var moment=require(_0xfa23('0x3'));var BPromise=require(_0xfa23('0x4'));var Mustache=require(_0xfa23('0x5'));var util=require('util');var path=require(_0xfa23('0x6'));var sox=require('sox');var csv=require(_0xfa23('0x7'));var ejs=require(_0xfa23('0x8'));var fs=require('fs');var fs_extra=require(_0xfa23('0x9'));var _=require(_0xfa23('0xa'));var squel=require('squel');var crypto=require(_0xfa23('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa23('0xc'));var toCsv=require(_0xfa23('0x7'));var querystring=require(_0xfa23('0xd'));var Papa=require(_0xfa23('0xe'));var Redis=require(_0xfa23('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa23('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa23('0x11'))('api');var utils=require(_0xfa23('0x12'));var config=require(_0xfa23('0x13'));var licenseUtil=require(_0xfa23('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5ffe,_0x42380){_0x42380=_0x42380||0xcc;return function(_0x46f991){if(_0x46f991){return _0x1e5ffe['sendStatus'](_0x42380);}return _0x1e5ffe['status'](_0x42380)[_0xfa23('0x15')]();};}function respondWithResult(_0x23712b,_0x3f50f0){_0x3f50f0=_0x3f50f0||0xc8;return function(_0x36252c){if(_0x36252c){return _0x23712b['status'](_0x3f50f0)[_0xfa23('0x16')](_0x36252c);}};}function respondWithFilteredResult(_0xb7d11a,_0x2095a5){return function(_0x9611e0){if(_0x9611e0){var _0x542d9a=typeof _0x2095a5[_0xfa23('0x17')]===_0xfa23('0x18')&&typeof _0x2095a5[_0xfa23('0x19')]===_0xfa23('0x18');var _0x3fa5f6=_0x9611e0['count'];var _0x59610c=_0x542d9a?0x0:_0x2095a5['offset'];var _0x445bd0=_0x542d9a?_0x9611e0[_0xfa23('0x1a')]:_0x2095a5['offset']+_0x2095a5[_0xfa23('0x19')];var _0x2c456b;if(_0x445bd0>=_0x3fa5f6){_0x445bd0=_0x3fa5f6;_0x2c456b=0xc8;}else{_0x2c456b=0xce;}_0xb7d11a[_0xfa23('0x1b')](_0x2c456b);return _0xb7d11a['set'](_0xfa23('0x1c'),_0x59610c+'-'+_0x445bd0+'/'+_0x3fa5f6)[_0xfa23('0x16')](_0x9611e0);}return null;};}function patchUpdates(_0x47c323){return function(_0x16e4f9){try{jsonpatch[_0xfa23('0x1d')](_0x16e4f9,_0x47c323,!![]);}catch(_0x148f3b){return BPromise[_0xfa23('0x1e')](_0x148f3b);}return _0x16e4f9[_0xfa23('0x1f')]();};}function saveUpdates(_0x10ef95,_0x31eedb){return function(_0x485838){if(_0x485838){return _0x485838[_0xfa23('0x20')](_0x10ef95)[_0xfa23('0x21')](function(_0x34a2ce){return _0x34a2ce;});}return null;};}function removeEntity(_0xe4680f,_0x542cde){return function(_0x4500a2){if(_0x4500a2){return _0x4500a2['destroy']()[_0xfa23('0x21')](function(){_0xe4680f[_0xfa23('0x1b')](0xcc)[_0xfa23('0x15')]();});}};}function handleEntityNotFound(_0x26bdce,_0x3362f3){return function(_0x1340d9){if(!_0x1340d9){_0x26bdce[_0xfa23('0x22')](0x194);}return _0x1340d9;};}function handleError(_0x499407,_0x5e1780){_0x5e1780=_0x5e1780||0x1f4;return function(_0x2ae826){logger['error'](_0x2ae826[_0xfa23('0x23')]);if(_0x2ae826['name']){delete _0x2ae826['name'];}_0x499407[_0xfa23('0x1b')](_0x5e1780)[_0xfa23('0x24')](_0x2ae826);};}exports[_0xfa23('0x25')]=function(_0x3b00a8,_0x374169){var _0x24da31={},_0x3c9d9d={},_0x4c1ab0={'count':0x0,'rows':[]};var _0x591797=_['map'](db[_0xfa23('0x26')][_0xfa23('0x27')],function(_0x5df1f9){return{'name':_0x5df1f9[_0xfa23('0x28')],'type':_0x5df1f9[_0xfa23('0x29')][_0xfa23('0x2a')]};});_0x3c9d9d[_0xfa23('0x2b')]=_[_0xfa23('0x2c')](_0x591797,_0xfa23('0x2d'));_0x3c9d9d[_0xfa23('0x2e')]=_[_0xfa23('0x2f')](_0x3b00a8[_0xfa23('0x2e')]);_0x3c9d9d['filters']=_[_0xfa23('0x30')](_0x3c9d9d['model'],_0x3c9d9d[_0xfa23('0x2e')]);_0x24da31[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x3c9d9d[_0xfa23('0x2b')],qs[_0xfa23('0x32')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x32')]));_0x24da31[_0xfa23('0x31')]=_0x24da31[_0xfa23('0x31')]['length']?_0x24da31[_0xfa23('0x31')]:_0x3c9d9d['model'];if(!_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x33')](_0xfa23('0x34'))){_0x24da31[_0xfa23('0x19')]=qs[_0xfa23('0x19')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x19')]);_0x24da31['offset']=qs[_0xfa23('0x17')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x17')]);}_0x24da31[_0xfa23('0x35')]=qs['sort'](_0x3b00a8['query']['sort']);_0x24da31[_0xfa23('0x36')]=qs[_0xfa23('0x37')](_['pick'](_0x3b00a8[_0xfa23('0x2e')],_0x3c9d9d[_0xfa23('0x37')]),_0x591797);if(_0x3b00a8[_0xfa23('0x2e')]['filter']){_0x24da31[_0xfa23('0x36')]=_['merge'](_0x24da31[_0xfa23('0x36')],{'$or':_[_0xfa23('0x2c')](_0x591797,function(_0x329985){if(_0x329985[_0xfa23('0x29')]!==_0xfa23('0x38')){var _0x80827f={};_0x80827f[_0x329985['name']]={'$like':'%'+_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x39')]+'%'};return _0x80827f;}})});}_0x24da31=_[_0xfa23('0x3a')]({},_0x24da31,_0x3b00a8[_0xfa23('0x3b')]);var _0x48c3a4={'where':_0x24da31[_0xfa23('0x36')]};return db[_0xfa23('0x26')][_0xfa23('0x1a')](_0x48c3a4)[_0xfa23('0x21')](function(_0x113552){_0x4c1ab0[_0xfa23('0x1a')]=_0x113552;if(_0x3b00a8['query'][_0xfa23('0x3c')]){_0x24da31['include']=[{'all':!![]}];}return db['Cdr'][_0xfa23('0x3d')](_0x24da31);})[_0xfa23('0x21')](function(_0x5937e0){_0x4c1ab0[_0xfa23('0x3e')]=_0x5937e0;return _0x4c1ab0;})[_0xfa23('0x21')](respondWithFilteredResult(_0x374169,_0x24da31))[_0xfa23('0x3f')](handleError(_0x374169,null));};exports['show']=function(_0x3de346,_0x37f4c5){var _0xb73ed9={'raw':!![],'where':{'id':_0x3de346['params']['id']}},_0x539271={};_0x539271[_0xfa23('0x2b')]=_['keys'](db[_0xfa23('0x26')][_0xfa23('0x27')]);_0x539271[_0xfa23('0x2e')]=_['keys'](_0x3de346[_0xfa23('0x2e')]);_0x539271[_0xfa23('0x37')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],_0x539271['query']);_0xb73ed9[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],qs['fields'](_0x3de346['query'][_0xfa23('0x32')]));_0xb73ed9['attributes']=_0xb73ed9[_0xfa23('0x31')][_0xfa23('0x40')]?_0xb73ed9[_0xfa23('0x31')]:_0x539271[_0xfa23('0x2b')];if(_0x3de346[_0xfa23('0x2e')][_0xfa23('0x3c')]){_0xb73ed9['include']=[{'all':!![]}];}_0xb73ed9=_[_0xfa23('0x3a')]({},_0xb73ed9,_0x3de346[_0xfa23('0x3b')]);return db[_0xfa23('0x26')][_0xfa23('0x41')](_0xb73ed9)[_0xfa23('0x21')](handleEntityNotFound(_0x37f4c5,null))[_0xfa23('0x21')](respondWithResult(_0x37f4c5,null))['catch'](handleError(_0x37f4c5,null));};exports[_0xfa23('0x42')]=function(_0x36a02c,_0x6ba64c){return db[_0xfa23('0x26')][_0xfa23('0x42')](_0x36a02c['body'],{})[_0xfa23('0x21')](respondWithResult(_0x6ba64c,0xc9))[_0xfa23('0x3f')](handleError(_0x6ba64c,null));};exports[_0xfa23('0x20')]=function(_0x5e4633,_0x253faf){if(_0x5e4633[_0xfa23('0x43')]['id']){delete _0x5e4633[_0xfa23('0x43')]['id'];}return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x5e4633[_0xfa23('0x44')]['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0x253faf,null))['then'](saveUpdates(_0x5e4633[_0xfa23('0x43')],null))['then'](respondWithResult(_0x253faf,null))[_0xfa23('0x3f')](handleError(_0x253faf,null));};exports[_0xfa23('0x45')]=function(_0x3824a9,_0xf24dd5){return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x3824a9['params']['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0xf24dd5,null))[_0xfa23('0x21')](removeEntity(_0xf24dd5,null))[_0xfa23('0x3f')](handleError(_0xf24dd5,null));};exports[_0xfa23('0x46')]=function(_0x13c37d,_0x22be14){return db[_0xfa23('0x26')]['describe']()[_0xfa23('0x21')](respondWithResult(_0x22be14,null))[_0xfa23('0x3f')](handleError(_0x22be14,null));}; \ No newline at end of file +var _0xe132=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xe132,0x162));var _0x2e13=function(_0x13bf6e,_0x5751dd){_0x13bf6e=_0x13bf6e-0x0;var _0x546a7d=_0xe132[_0x13bf6e];return _0x546a7d;};'use strict';var emlformat=require(_0x2e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e13('0x1'));var jsonpatch=require(_0x2e13('0x2'));var rp=require(_0x2e13('0x3'));var moment=require(_0x2e13('0x4'));var BPromise=require(_0x2e13('0x5'));var Mustache=require('mustache');var util=require(_0x2e13('0x6'));var path=require(_0x2e13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e13('0x8'));var fs=require('fs');var fs_extra=require(_0x2e13('0x9'));var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0xf'));var querystring=require(_0x2e13('0x10'));var Papa=require(_0x2e13('0x11'));var Redis=require('ioredis');var authService=require(_0x2e13('0x12'));var qs=require(_0x2e13('0x13'));var as=require(_0x2e13('0x14'));var hardwareService=require(_0x2e13('0x15'));var logger=require(_0x2e13('0x16'))(_0x2e13('0x17'));var utils=require(_0x2e13('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e13('0x19'));var db=require(_0x2e13('0x1a'))['db'];function respondWithStatusCode(_0x320303,_0x299dd3){_0x299dd3=_0x299dd3||0xcc;return function(_0x424e58){if(_0x424e58){return _0x320303[_0x2e13('0x1b')](_0x299dd3);}return _0x320303[_0x2e13('0x1c')](_0x299dd3)['end']();};}function respondWithResult(_0xb70eb8,_0xea6c20){_0xea6c20=_0xea6c20||0xc8;return function(_0xfaca18){if(_0xfaca18){return _0xb70eb8['status'](_0xea6c20)[_0x2e13('0x1d')](_0xfaca18);}};}function respondWithFilteredResult(_0x2a58e5,_0x433bbd){return function(_0x5e96a5){if(_0x5e96a5){var _0xd25628=typeof _0x433bbd[_0x2e13('0x1e')]===_0x2e13('0x1f')&&typeof _0x433bbd['limit']==='undefined';var _0x2a3007=_0x5e96a5[_0x2e13('0x20')];var _0x336a10=_0xd25628?0x0:_0x433bbd[_0x2e13('0x1e')];var _0x399ce2=_0xd25628?_0x5e96a5[_0x2e13('0x20')]:_0x433bbd[_0x2e13('0x1e')]+_0x433bbd[_0x2e13('0x21')];var _0x4ae5e5;if(_0x399ce2>=_0x2a3007){_0x399ce2=_0x2a3007;_0x4ae5e5=0xc8;}else{_0x4ae5e5=0xce;}_0x2a58e5[_0x2e13('0x1c')](_0x4ae5e5);return _0x2a58e5[_0x2e13('0x22')](_0x2e13('0x23'),_0x336a10+'-'+_0x399ce2+'/'+_0x2a3007)[_0x2e13('0x1d')](_0x5e96a5);}return null;};}function patchUpdates(_0x479013){return function(_0x5d6938){try{jsonpatch[_0x2e13('0x24')](_0x5d6938,_0x479013,!![]);}catch(_0x1a05a4){return BPromise['reject'](_0x1a05a4);}return _0x5d6938['save']();};}function saveUpdates(_0x584040,_0x30f744){return function(_0x2b55a7){if(_0x2b55a7){return _0x2b55a7[_0x2e13('0x25')](_0x584040)[_0x2e13('0x26')](function(_0x17b453){return _0x17b453;});}return null;};}function removeEntity(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(_0x1482fc){return _0x1482fc[_0x2e13('0x27')]()[_0x2e13('0x26')](function(){_0x2416b3[_0x2e13('0x1c')](0xcc)[_0x2e13('0x28')]();});}};}function handleEntityNotFound(_0x3e5c24,_0x5cad4b){return function(_0x341ae7){if(!_0x341ae7){_0x3e5c24[_0x2e13('0x1b')](0x194);}return _0x341ae7;};}function handleError(_0x57aab0,_0x538984){_0x538984=_0x538984||0x1f4;return function(_0x15c555){logger[_0x2e13('0x29')](_0x15c555[_0x2e13('0x2a')]);if(_0x15c555['name']){delete _0x15c555[_0x2e13('0x2b')];}_0x57aab0[_0x2e13('0x1c')](_0x538984)[_0x2e13('0x2c')](_0x15c555);};}exports[_0x2e13('0x2d')]=function(_0x2c6e04,_0x428289){var _0x103867={},_0x19ee97={},_0x31f448={'count':0x0,'rows':[]};var _0x6e09d9=_[_0x2e13('0x2e')](db[_0x2e13('0x2f')][_0x2e13('0x30')],function(_0x28e2bf){return{'name':_0x28e2bf[_0x2e13('0x31')],'type':_0x28e2bf['type'][_0x2e13('0x32')]};});_0x19ee97[_0x2e13('0x33')]=_[_0x2e13('0x2e')](_0x6e09d9,'name');_0x19ee97['query']=_[_0x2e13('0x34')](_0x2c6e04[_0x2e13('0x35')]);_0x19ee97[_0x2e13('0x36')]=_[_0x2e13('0x37')](_0x19ee97[_0x2e13('0x33')],_0x19ee97[_0x2e13('0x35')]);_0x103867['attributes']=_['intersection'](_0x19ee97[_0x2e13('0x33')],qs[_0x2e13('0x38')](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x38')]));_0x103867[_0x2e13('0x39')]=_0x103867[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x103867[_0x2e13('0x39')]:_0x19ee97['model'];if(!_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3b')](_0x2e13('0x3c'))){_0x103867[_0x2e13('0x21')]=qs[_0x2e13('0x21')](_0x2c6e04['query'][_0x2e13('0x21')]);_0x103867[_0x2e13('0x1e')]=qs['offset'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x1e')]);}_0x103867[_0x2e13('0x3d')]=qs['sort'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3e')]);_0x103867['where']=qs[_0x2e13('0x36')](_[_0x2e13('0x3f')](_0x2c6e04['query'],_0x19ee97[_0x2e13('0x36')]),_0x6e09d9);if(_0x2c6e04['query'][_0x2e13('0x40')]){_0x103867[_0x2e13('0x41')]=_['merge'](_0x103867[_0x2e13('0x41')],{'$or':_[_0x2e13('0x2e')](_0x6e09d9,function(_0x3839b9){if(_0x3839b9[_0x2e13('0x42')]!==_0x2e13('0x43')){var _0x778214={};_0x778214[_0x3839b9[_0x2e13('0x2b')]]={'$like':'%'+_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x40')]+'%'};return _0x778214;}})});}_0x103867=_[_0x2e13('0x44')]({},_0x103867,_0x2c6e04['options']);var _0x24ebb6={'where':_0x103867[_0x2e13('0x41')]};return db[_0x2e13('0x2f')][_0x2e13('0x20')](_0x24ebb6)[_0x2e13('0x26')](function(_0x4b23ca){_0x31f448[_0x2e13('0x20')]=_0x4b23ca;if(_0x2c6e04['query'][_0x2e13('0x45')]){_0x103867[_0x2e13('0x46')]=[{'all':!![]}];}return db['Cdr'][_0x2e13('0x47')](_0x103867);})['then'](function(_0x73f6a2){_0x31f448[_0x2e13('0x48')]=_0x73f6a2;return _0x31f448;})[_0x2e13('0x26')](respondWithFilteredResult(_0x428289,_0x103867))[_0x2e13('0x49')](handleError(_0x428289,null));};exports[_0x2e13('0x4a')]=function(_0x52b1a0,_0x425c97){var _0x499a56={'raw':!![],'where':{'id':_0x52b1a0[_0x2e13('0x4b')]['id']}},_0x10a1ab={};_0x10a1ab[_0x2e13('0x33')]=_[_0x2e13('0x34')](db[_0x2e13('0x2f')][_0x2e13('0x30')]);_0x10a1ab['query']=_['keys'](_0x52b1a0[_0x2e13('0x35')]);_0x10a1ab[_0x2e13('0x36')]=_['intersection'](_0x10a1ab[_0x2e13('0x33')],_0x10a1ab[_0x2e13('0x35')]);_0x499a56[_0x2e13('0x39')]=_['intersection'](_0x10a1ab['model'],qs[_0x2e13('0x38')](_0x52b1a0['query']['fields']));_0x499a56[_0x2e13('0x39')]=_0x499a56[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x499a56['attributes']:_0x10a1ab[_0x2e13('0x33')];if(_0x52b1a0[_0x2e13('0x35')][_0x2e13('0x45')]){_0x499a56[_0x2e13('0x46')]=[{'all':!![]}];}_0x499a56=_['merge']({},_0x499a56,_0x52b1a0[_0x2e13('0x4c')]);return db['Cdr'][_0x2e13('0x4d')](_0x499a56)[_0x2e13('0x26')](handleEntityNotFound(_0x425c97,null))[_0x2e13('0x26')](respondWithResult(_0x425c97,null))[_0x2e13('0x49')](handleError(_0x425c97,null));};exports[_0x2e13('0x4e')]=function(_0x3be877,_0x961af7){return db[_0x2e13('0x2f')][_0x2e13('0x4e')](_0x3be877[_0x2e13('0x4f')],{})['then'](respondWithResult(_0x961af7,0xc9))[_0x2e13('0x49')](handleError(_0x961af7,null));};exports[_0x2e13('0x25')]=function(_0x4780b7,_0x1d13ec){if(_0x4780b7[_0x2e13('0x4f')]['id']){delete _0x4780b7[_0x2e13('0x4f')]['id'];}return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x4780b7[_0x2e13('0x4b')]['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0x26')](saveUpdates(_0x4780b7[_0x2e13('0x4f')],null))['then'](respondWithResult(_0x1d13ec,null))[_0x2e13('0x49')](handleError(_0x1d13ec,null));};exports[_0x2e13('0x27')]=function(_0x39cef0,_0xf40f35){return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x39cef0['params']['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0xf40f35,null))[_0x2e13('0x26')](removeEntity(_0xf40f35,null))[_0x2e13('0x49')](handleError(_0xf40f35,null));};exports[_0x2e13('0x50')]=function(_0x2a9587,_0x13b4f4){return db[_0x2e13('0x2f')]['describe']()[_0x2e13('0x26')](respondWithResult(_0x13b4f4,null))[_0x2e13('0x49')](handleError(_0x13b4f4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 8a2b016..288bf76 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3946b6,_0x377798){var _0x170bae=function(_0x4449c3){while(--_0x4449c3){_0x3946b6['push'](_0x3946b6['shift']());}};_0x170bae(++_0x377798);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5a4a1f,_0x3f90b6){var _0x43db26=function(_0x2824f5){while(--_0x2824f5){_0x5a4a1f['push'](_0x5a4a1f['shift']());}};_0x43db26(++_0x3f90b6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index d12d2a2..88a528d 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 _0x2961=['stringify','error','code','message','result','util','moment','randomstring','../../config/logger','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2961,0x1c7));var _0x1296=function(_0x37cb77,_0x52eddf){_0x37cb77=_0x37cb77-0x0;var _0x52db4f=_0x2961[_0x37cb77];return _0x52db4f;};'use strict';var _=require('lodash');var util=require(_0x1296('0x0'));var moment=require(_0x1296('0x1'));var BPromise=require('bluebird');var rs=require(_0x1296('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1296('0x3'))('rpc');var config=require(_0x1296('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x1296('0x5')][_0x1296('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a0c5f,_0x3899ed,_0x4f15cd){return new BPromise(function(_0x30072b,_0x321173){return client[_0x1296('0x7')](_0x1a0c5f,_0x4f15cd)[_0x1296('0x8')](function(_0x14bd77){logger[_0x1296('0x9')](_0x1296('0xa'),_0x3899ed,_0x1296('0xb'));logger['debug'](_0x1296('0xc'),_0x3899ed,_0x1296('0xb'),JSON[_0x1296('0xd')](_0x14bd77));if(_0x14bd77[_0x1296('0xe')]){if(_0x14bd77[_0x1296('0xe')][_0x1296('0xf')]===0x1f4){logger[_0x1296('0xe')](_0x1296('0xa'),_0x3899ed,_0x14bd77[_0x1296('0xe')]['message']);return _0x321173(_0x14bd77[_0x1296('0xe')][_0x1296('0x10')]);}logger[_0x1296('0xe')](_0x1296('0xa'),_0x3899ed,_0x14bd77[_0x1296('0xe')][_0x1296('0x10')]);return _0x30072b(_0x14bd77['error']['message']);}else{logger[_0x1296('0x9')](_0x1296('0xa'),_0x3899ed,_0x1296('0xb'));_0x30072b(_0x14bd77[_0x1296('0x11')][_0x1296('0x10')]);}})['catch'](function(_0x28f50e){logger[_0x1296('0xe')](_0x1296('0xa'),_0x3899ed,_0x28f50e);_0x321173(_0x28f50e);});});} \ No newline at end of file +var _0x136b=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x136b,0xe5));var _0xb136=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x136b[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require(_0xb136('0x0'));var moment=require('moment');var BPromise=require(_0xb136('0x1'));var rs=require(_0xb136('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb136('0x3'))['db'];var utils=require(_0xb136('0x4'));var logger=require('../../config/logger')(_0xb136('0x5'));var config=require(_0xb136('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb136('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7963,_0x48b747,_0x3222ab){return new BPromise(function(_0x39d57d,_0x1aa303){return client[_0xb136('0x8')](_0x4f7963,_0x3222ab)[_0xb136('0x9')](function(_0x29ff77){logger[_0xb136('0xa')](_0xb136('0xb'),_0x48b747,_0xb136('0xc'));logger[_0xb136('0xd')](_0xb136('0xe'),_0x48b747,_0xb136('0xc'),JSON[_0xb136('0xf')](_0x29ff77));if(_0x29ff77[_0xb136('0x10')]){if(_0x29ff77[_0xb136('0x10')][_0xb136('0x11')]===0x1f4){logger['error'](_0xb136('0xb'),_0x48b747,_0x29ff77[_0xb136('0x10')]['message']);return _0x1aa303(_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);}logger[_0xb136('0x10')]('Cdr,\x20%s,\x20%s',_0x48b747,_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);return _0x39d57d(_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);}else{logger[_0xb136('0xa')]('Cdr,\x20%s,\x20%s',_0x48b747,'request\x20sent');_0x39d57d(_0x29ff77[_0xb136('0x13')][_0xb136('0x12')]);}})['catch'](function(_0x365079){logger[_0xb136('0x10')](_0xb136('0xb'),_0x48b747,_0x365079);_0x1aa303(_0x365079);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d0571ec..a362249 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(_0x26d823,_0x3f2031){var _0x5c24b1=function(_0x205a09){while(--_0x205a09){_0x26d823['push'](_0x26d823['shift']());}};_0x5c24b1(++_0x3f2031);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x566667,_0x3f99c2){var _0x277136=function(_0x129ea0){while(--_0x129ea0){_0x566667['push'](_0x566667['shift']());}};_0x277136(++_0x3f99c2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c8462fa..11d7793 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 _0x9c17=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4ef6f4,_0x14602f){var _0x3af815=function(_0x42e9a8){while(--_0x42e9a8){_0x4ef6f4['push'](_0x4ef6f4['shift']());}};_0x3af815(++_0x14602f);}(_0x9c17,0xe6));var _0x79c1=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x9c17[_0x5be7aa];return _0x215408;};'use strict';var Sequelize=require(_0x79c1('0x0'));module[_0x79c1('0x1')]={'priority':{'type':Sequelize[_0x79c1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x79c1('0x3')],'allowNull':![],'defaultValue':_0x79c1('0x4')},'appdata':{'type':Sequelize[_0x79c1('0x5')]()},'description':{'type':Sequelize[_0x79c1('0x3')]},'interval':{'type':Sequelize[_0x79c1('0x3')],'defaultValue':_0x79c1('0x6')}}; \ No newline at end of file +var _0xd060=['exports','STRING','noop','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd060,0x117));var _0x0d06=function(_0x4a2dbe,_0x4557db){_0x4a2dbe=_0x4a2dbe-0x0;var _0xdd1cad=_0xd060[_0x4a2dbe];return _0xdd1cad;};'use strict';var Sequelize=require(_0x0d06('0x0'));module[_0x0d06('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0d06('0x2')],'allowNull':![],'defaultValue':_0x0d06('0x3')},'appdata':{'type':Sequelize[_0x0d06('0x4')]()},'description':{'type':Sequelize[_0x0d06('0x2')]},'interval':{'type':Sequelize[_0x0d06('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 212216b..1a8fb81 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 _0xe920=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','save','update','destroy','then','sendStatus','stack','name','send'];(function(_0x42f3c9,_0x463996){var _0x301530=function(_0x5406e2){while(--_0x5406e2){_0x42f3c9['push'](_0x42f3c9['shift']());}};_0x301530(++_0x463996);}(_0xe920,0xbe));var _0x0e92=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xe920[_0x2b91c5];return _0xbd5531;};'use strict';var emlformat=require(_0x0e92('0x0'));var rimraf=require(_0x0e92('0x1'));var zipdir=require(_0x0e92('0x2'));var jsonpatch=require(_0x0e92('0x3'));var rp=require(_0x0e92('0x4'));var moment=require(_0x0e92('0x5'));var BPromise=require(_0x0e92('0x6'));var Mustache=require(_0x0e92('0x7'));var util=require(_0x0e92('0x8'));var path=require(_0x0e92('0x9'));var sox=require('sox');var csv=require(_0x0e92('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e92('0xb'));var _=require(_0x0e92('0xc'));var squel=require(_0x0e92('0xd'));var crypto=require(_0x0e92('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0e92('0xf'));var toCsv=require(_0x0e92('0xa'));var querystring=require(_0x0e92('0x10'));var Papa=require(_0x0e92('0x11'));var Redis=require(_0x0e92('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e92('0x13'));var logger=require(_0x0e92('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e92('0x15'));var db=require(_0x0e92('0x16'))['db'];function respondWithStatusCode(_0x4e411f,_0x3a88f1){_0x3a88f1=_0x3a88f1||0xcc;return function(_0x12113d){if(_0x12113d){return _0x4e411f['sendStatus'](_0x3a88f1);}return _0x4e411f[_0x0e92('0x17')](_0x3a88f1)[_0x0e92('0x18')]();};}function respondWithResult(_0x4e9dc0,_0x3bc59f){_0x3bc59f=_0x3bc59f||0xc8;return function(_0x218f02){if(_0x218f02){return _0x4e9dc0[_0x0e92('0x17')](_0x3bc59f)[_0x0e92('0x19')](_0x218f02);}};}function respondWithFilteredResult(_0x5cce2d,_0x5e70ab){return function(_0x333faf){if(_0x333faf){var _0x211716=typeof _0x5e70ab['offset']==='undefined'&&typeof _0x5e70ab[_0x0e92('0x1a')]==='undefined';var _0x9ecd13=_0x333faf[_0x0e92('0x1b')];var _0x3316a5=_0x211716?0x0:_0x5e70ab[_0x0e92('0x1c')];var _0x153002=_0x211716?_0x333faf[_0x0e92('0x1b')]:_0x5e70ab[_0x0e92('0x1c')]+_0x5e70ab['limit'];var _0x1412ef;if(_0x153002>=_0x9ecd13){_0x153002=_0x9ecd13;_0x1412ef=0xc8;}else{_0x1412ef=0xce;}_0x5cce2d['status'](_0x1412ef);return _0x5cce2d[_0x0e92('0x1d')]('Content-Range',_0x3316a5+'-'+_0x153002+'/'+_0x9ecd13)['json'](_0x333faf);}return null;};}function patchUpdates(_0x47a265){return function(_0x263ba1){try{jsonpatch['apply'](_0x263ba1,_0x47a265,!![]);}catch(_0x433c05){return BPromise['reject'](_0x433c05);}return _0x263ba1[_0x0e92('0x1e')]();};}function saveUpdates(_0x198c5a,_0x5d44e2){return function(_0x3f2105){if(_0x3f2105){return _0x3f2105[_0x0e92('0x1f')](_0x198c5a)['then'](function(_0x3a18e1){return _0x3a18e1;});}return null;};}function removeEntity(_0x53de77,_0x43c54c){return function(_0x40375c){if(_0x40375c){return _0x40375c[_0x0e92('0x20')]()[_0x0e92('0x21')](function(){_0x53de77[_0x0e92('0x17')](0xcc)[_0x0e92('0x18')]();});}};}function handleEntityNotFound(_0xc34ae4,_0x42c5bc){return function(_0x32d258){if(!_0x32d258){_0xc34ae4[_0x0e92('0x22')](0x194);}return _0x32d258;};}function handleError(_0x538bac,_0x3eb532){_0x3eb532=_0x3eb532||0x1f4;return function(_0x47f156){logger['error'](_0x47f156[_0x0e92('0x23')]);if(_0x47f156[_0x0e92('0x24')]){delete _0x47f156['name'];}_0x538bac['status'](_0x3eb532)[_0x0e92('0x25')](_0x47f156);};}exports[_0x0e92('0x26')]=function(_0x5af9b4,_0x515bd9){var _0x140666={'raw':!![],'where':{'id':_0x5af9b4[_0x0e92('0x27')]['id']}},_0x329c5f={};_0x329c5f[_0x0e92('0x28')]=_[_0x0e92('0x29')](db[_0x0e92('0x2a')][_0x0e92('0x2b')]);_0x329c5f[_0x0e92('0x2c')]=_[_0x0e92('0x29')](_0x5af9b4[_0x0e92('0x2c')]);_0x329c5f[_0x0e92('0x2d')]=_[_0x0e92('0x2e')](_0x329c5f[_0x0e92('0x28')],_0x329c5f[_0x0e92('0x2c')]);_0x140666[_0x0e92('0x2f')]=_[_0x0e92('0x2e')](_0x329c5f[_0x0e92('0x28')],qs[_0x0e92('0x30')](_0x5af9b4[_0x0e92('0x2c')][_0x0e92('0x30')]));_0x140666['attributes']=_0x140666[_0x0e92('0x2f')][_0x0e92('0x31')]?_0x140666['attributes']:_0x329c5f['model'];if(_0x5af9b4[_0x0e92('0x2c')][_0x0e92('0x32')]){_0x140666[_0x0e92('0x33')]=[{'all':!![]}];}_0x140666=_[_0x0e92('0x34')]({},_0x140666,_0x5af9b4[_0x0e92('0x35')]);return db[_0x0e92('0x2a')][_0x0e92('0x36')](_0x140666)[_0x0e92('0x21')](handleEntityNotFound(_0x515bd9,null))['then'](respondWithResult(_0x515bd9,null))[_0x0e92('0x37')](handleError(_0x515bd9,null));};exports[_0x0e92('0x1f')]=function(_0x3b0814,_0x3327dc){if(_0x3b0814[_0x0e92('0x38')]['id']){delete _0x3b0814[_0x0e92('0x38')]['id'];}return db[_0x0e92('0x2a')][_0x0e92('0x36')]({'where':{'id':_0x3b0814[_0x0e92('0x27')]['id']}})['then'](handleEntityNotFound(_0x3327dc,null))['then'](saveUpdates(_0x3b0814[_0x0e92('0x38')],null))[_0x0e92('0x21')](respondWithResult(_0x3327dc,null))['catch'](handleError(_0x3327dc,null));};exports[_0x0e92('0x20')]=function(_0x5df24d,_0x3eef0f){return db['ChatApplication'][_0x0e92('0x36')]({'where':{'id':_0x5df24d['params']['id']}})[_0x0e92('0x21')](handleEntityNotFound(_0x3eef0f,null))[_0x0e92('0x21')](removeEntity(_0x3eef0f,null))[_0x0e92('0x37')](handleError(_0x3eef0f,null));}; \ No newline at end of file +var _0x2572=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x53d415,_0x253c03){var _0x325d61=function(_0x5a44b2){while(--_0x5a44b2){_0x53d415['push'](_0x53d415['shift']());}};_0x325d61(++_0x253c03);}(_0x2572,0x110));var _0x2257=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2572[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require(_0x2257('0x6'));var Mustache=require(_0x2257('0x7'));var util=require(_0x2257('0x8'));var path=require('path');var sox=require(_0x2257('0x9'));var csv=require(_0x2257('0xa'));var ejs=require(_0x2257('0xb'));var fs=require('fs');var fs_extra=require(_0x2257('0xc'));var _=require(_0x2257('0xd'));var squel=require(_0x2257('0xe'));var crypto=require(_0x2257('0xf'));var jsforce=require(_0x2257('0x10'));var deskjs=require(_0x2257('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2257('0x12'));var Papa=require(_0x2257('0x13'));var Redis=require('ioredis');var authService=require(_0x2257('0x14'));var qs=require(_0x2257('0x15'));var as=require(_0x2257('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2257('0x17'))(_0x2257('0x18'));var utils=require(_0x2257('0x19'));var config=require(_0x2257('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1b'))['db'];function respondWithStatusCode(_0x5131bd,_0x578d2f){_0x578d2f=_0x578d2f||0xcc;return function(_0x7f8b71){if(_0x7f8b71){return _0x5131bd[_0x2257('0x1c')](_0x578d2f);}return _0x5131bd[_0x2257('0x1d')](_0x578d2f)[_0x2257('0x1e')]();};}function respondWithResult(_0x2e610e,_0x32fdfe){_0x32fdfe=_0x32fdfe||0xc8;return function(_0x1738a3){if(_0x1738a3){return _0x2e610e['status'](_0x32fdfe)['json'](_0x1738a3);}};}function respondWithFilteredResult(_0x3578db,_0x45efee){return function(_0x2b4102){if(_0x2b4102){var _0x156d68=typeof _0x45efee['offset']==='undefined'&&typeof _0x45efee[_0x2257('0x1f')]==='undefined';var _0x4cd932=_0x2b4102['count'];var _0x31c8c6=_0x156d68?0x0:_0x45efee[_0x2257('0x20')];var _0x31e8d0=_0x156d68?_0x2b4102[_0x2257('0x21')]:_0x45efee[_0x2257('0x20')]+_0x45efee[_0x2257('0x1f')];var _0x36224b;if(_0x31e8d0>=_0x4cd932){_0x31e8d0=_0x4cd932;_0x36224b=0xc8;}else{_0x36224b=0xce;}_0x3578db[_0x2257('0x1d')](_0x36224b);return _0x3578db[_0x2257('0x22')](_0x2257('0x23'),_0x31c8c6+'-'+_0x31e8d0+'/'+_0x4cd932)[_0x2257('0x24')](_0x2b4102);}return null;};}function patchUpdates(_0x263108){return function(_0x482240){try{jsonpatch[_0x2257('0x25')](_0x482240,_0x263108,!![]);}catch(_0x2e3d19){return BPromise['reject'](_0x2e3d19);}return _0x482240['save']();};}function saveUpdates(_0x56e513,_0x5ae577){return function(_0x31cd98){if(_0x31cd98){return _0x31cd98[_0x2257('0x26')](_0x56e513)[_0x2257('0x27')](function(_0x2a1aa7){return _0x2a1aa7;});}return null;};}function removeEntity(_0x137d53,_0x1e220c){return function(_0x1549aa){if(_0x1549aa){return _0x1549aa[_0x2257('0x28')]()[_0x2257('0x27')](function(){_0x137d53[_0x2257('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab173,_0x227155){return function(_0x58e30d){if(!_0x58e30d){_0x3ab173[_0x2257('0x1c')](0x194);}return _0x58e30d;};}function handleError(_0x1590a6,_0x4e0eaf){_0x4e0eaf=_0x4e0eaf||0x1f4;return function(_0x1c1a76){logger[_0x2257('0x29')](_0x1c1a76['stack']);if(_0x1c1a76[_0x2257('0x2a')]){delete _0x1c1a76[_0x2257('0x2a')];}_0x1590a6[_0x2257('0x1d')](_0x4e0eaf)[_0x2257('0x2b')](_0x1c1a76);};}exports['show']=function(_0x8b9b1b,_0x8952ad){var _0x508cad={'raw':!![],'where':{'id':_0x8b9b1b[_0x2257('0x2c')]['id']}},_0x38e581={};_0x38e581[_0x2257('0x2d')]=_[_0x2257('0x2e')](db[_0x2257('0x2f')][_0x2257('0x30')]);_0x38e581[_0x2257('0x31')]=_[_0x2257('0x2e')](_0x8b9b1b[_0x2257('0x31')]);_0x38e581['filters']=_[_0x2257('0x32')](_0x38e581[_0x2257('0x2d')],_0x38e581['query']);_0x508cad['attributes']=_[_0x2257('0x32')](_0x38e581[_0x2257('0x2d')],qs[_0x2257('0x33')](_0x8b9b1b[_0x2257('0x31')][_0x2257('0x33')]));_0x508cad[_0x2257('0x34')]=_0x508cad['attributes'][_0x2257('0x35')]?_0x508cad[_0x2257('0x34')]:_0x38e581[_0x2257('0x2d')];if(_0x8b9b1b[_0x2257('0x31')]['includeAll']){_0x508cad[_0x2257('0x36')]=[{'all':!![]}];}_0x508cad=_['merge']({},_0x508cad,_0x8b9b1b['options']);return db[_0x2257('0x2f')][_0x2257('0x37')](_0x508cad)[_0x2257('0x27')](handleEntityNotFound(_0x8952ad,null))[_0x2257('0x27')](respondWithResult(_0x8952ad,null))[_0x2257('0x38')](handleError(_0x8952ad,null));};exports[_0x2257('0x26')]=function(_0x1d088c,_0x283d55){if(_0x1d088c[_0x2257('0x39')]['id']){delete _0x1d088c[_0x2257('0x39')]['id'];}return db[_0x2257('0x2f')][_0x2257('0x37')]({'where':{'id':_0x1d088c[_0x2257('0x2c')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x283d55,null))['then'](saveUpdates(_0x1d088c[_0x2257('0x39')],null))[_0x2257('0x27')](respondWithResult(_0x283d55,null))[_0x2257('0x38')](handleError(_0x283d55,null));};exports[_0x2257('0x28')]=function(_0x24edea,_0x4fd5e5){return db[_0x2257('0x2f')][_0x2257('0x37')]({'where':{'id':_0x24edea[_0x2257('0x2c')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x4fd5e5,null))[_0x2257('0x27')](removeEntity(_0x4fd5e5,null))[_0x2257('0x38')](handleError(_0x4fd5e5,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 17edf5d..14a94bb 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 _0x0082=['rimraf','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1df9ce,_0x6b5121){var _0x5cb94a=function(_0xe22b6f){while(--_0xe22b6f){_0x1df9ce['push'](_0x1df9ce['shift']());}};_0x5cb94a(++_0x6b5121);}(_0x0082,0x73));var _0x2008=function(_0x54cd25,_0x462584){_0x54cd25=_0x54cd25-0x0;var _0x5068a8=_0x0082[_0x54cd25];return _0x5068a8;};'use strict';var _=require(_0x2008('0x0'));var util=require('util');var logger=require(_0x2008('0x1'))('api');var moment=require(_0x2008('0x2'));var BPromise=require(_0x2008('0x3'));var rp=require(_0x2008('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2008('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x22bb43,_0x152e3f){return _0x22bb43[_0x2008('0x6')]('ChatApplication',attributes,{'tableName':_0x2008('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2008('0x8'),'collate':_0x2008('0x9')});}; \ No newline at end of file +var _0x296f=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','chat_applications','utf8mb4','lodash','util'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x296f,0xf0));var _0xf296=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x296f[_0x45c262];return _0x4f2ba6;};'use strict';var _=require(_0xf296('0x0'));var util=require(_0xf296('0x1'));var logger=require(_0xf296('0x2'))(_0xf296('0x3'));var moment=require(_0xf296('0x4'));var BPromise=require(_0xf296('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf296('0x6'));var config=require(_0xf296('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x4c9620,_0x41a1b3){return _0x4c9620[_0xf296('0x8')]('ChatApplication',attributes,{'tableName':_0xf296('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf296('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 89eacce..06d1318 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 _0x1794=['../../config/utils','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1794,0x163));var _0x4179=function(_0x57d931,_0x828d5c){_0x57d931=_0x57d931-0x0;var _0x3b1ae6=_0x1794[_0x57d931];return _0x3b1ae6;};'use strict';var _=require(_0x4179('0x0'));var util=require('util');var moment=require(_0x4179('0x1'));var BPromise=require(_0x4179('0x2'));var rs=require(_0x4179('0x3'));var fs=require('fs');var Redis=require(_0x4179('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4179('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4179('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4179('0x7')][_0x4179('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4871,_0x57307b,_0x37f0c2){return new BPromise(function(_0x1e2b71,_0x17c632){return client['request'](_0x3c4871,_0x37f0c2)[_0x4179('0x9')](function(_0x9f453c){logger[_0x4179('0xa')](_0x4179('0xb'),_0x57307b,_0x4179('0xc'));logger['debug'](_0x4179('0xd'),_0x57307b,_0x4179('0xc'),JSON[_0x4179('0xe')](_0x9f453c));if(_0x9f453c['error']){if(_0x9f453c[_0x4179('0xf')][_0x4179('0x10')]===0x1f4){logger['error'](_0x4179('0xb'),_0x57307b,_0x9f453c[_0x4179('0xf')][_0x4179('0x11')]);return _0x17c632(_0x9f453c[_0x4179('0xf')]['message']);}logger[_0x4179('0xf')](_0x4179('0xb'),_0x57307b,_0x9f453c[_0x4179('0xf')][_0x4179('0x11')]);return _0x1e2b71(_0x9f453c['error']['message']);}else{logger[_0x4179('0xa')](_0x4179('0xb'),_0x57307b,_0x4179('0xc'));_0x1e2b71(_0x9f453c[_0x4179('0x12')]['message']);}})[_0x4179('0x13')](function(_0x466529){logger[_0x4179('0xf')](_0x4179('0xb'),_0x57307b,_0x466529);_0x17c632(_0x466529);});});} \ No newline at end of file +var _0x73b1=['request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug'];(function(_0x5ca5b4,_0xde6b66){var _0x1294d9=function(_0x543a84){while(--_0x543a84){_0x5ca5b4['push'](_0x5ca5b4['shift']());}};_0x1294d9(++_0xde6b66);}(_0x73b1,0xd8));var _0x173b=function(_0x35fc6b,_0x29dc0e){_0x35fc6b=_0x35fc6b-0x0;var _0x135553=_0x73b1[_0x35fc6b];return _0x135553;};'use strict';var _=require(_0x173b('0x0'));var util=require('util');var moment=require(_0x173b('0x1'));var BPromise=require('bluebird');var rs=require(_0x173b('0x2'));var fs=require('fs');var Redis=require(_0x173b('0x3'));var db=require(_0x173b('0x4'))['db'];var utils=require(_0x173b('0x5'));var logger=require(_0x173b('0x6'))('rpc');var config=require(_0x173b('0x7'));var jayson=require(_0x173b('0x8'));var client=jayson[_0x173b('0x9')][_0x173b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x281759,_0x5b042b,_0x32f94a){return new BPromise(function(_0x2509c5,_0x16945d){return client[_0x173b('0xb')](_0x281759,_0x32f94a)['then'](function(_0x3ade8b){logger[_0x173b('0xc')](_0x173b('0xd'),_0x5b042b,'request\x20sent');logger[_0x173b('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5b042b,_0x173b('0xf'),JSON['stringify'](_0x3ade8b));if(_0x3ade8b[_0x173b('0x10')]){if(_0x3ade8b[_0x173b('0x10')][_0x173b('0x11')]===0x1f4){logger[_0x173b('0x10')](_0x173b('0xd'),_0x5b042b,_0x3ade8b['error'][_0x173b('0x12')]);return _0x16945d(_0x3ade8b['error'][_0x173b('0x12')]);}logger[_0x173b('0x10')]('ChatApplication,\x20%s,\x20%s',_0x5b042b,_0x3ade8b[_0x173b('0x10')][_0x173b('0x12')]);return _0x2509c5(_0x3ade8b[_0x173b('0x10')]['message']);}else{logger[_0x173b('0xc')](_0x173b('0xd'),_0x5b042b,_0x173b('0xf'));_0x2509c5(_0x3ade8b[_0x173b('0x13')]['message']);}})[_0x173b('0x14')](function(_0x47eba9){logger[_0x173b('0x10')](_0x173b('0xd'),_0x5b042b,_0x47eba9);_0x16945d(_0x47eba9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2a3cdb8..7c65414 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 _0xb23a=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','put','isAuthenticated','update','delete','/:id','destroy','exports','path','connect-timeout','express'];(function(_0xc6b8cf,_0x3c4f85){var _0x3f73c3=function(_0x75aba2){while(--_0x75aba2){_0xc6b8cf['push'](_0xc6b8cf['shift']());}};_0x3f73c3(++_0x3c4f85);}(_0xb23a,0x1ed));var _0xab23=function(_0x216137,_0x18e6a7){_0x216137=_0x216137-0x0;var _0x38f6ba=_0xb23a[_0x216137];return _0x38f6ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab23('0x0'));var timeout=require(_0xab23('0x1'));var express=require(_0xab23('0x2'));var router=express[_0xab23('0x3')]();var fs_extra=require(_0xab23('0x4'));var auth=require(_0xab23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab23('0x6'));var controller=require(_0xab23('0x7'));router[_0xab23('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab23('0x9')]('/:id',auth[_0xab23('0xa')](),controller[_0xab23('0xb')]);router[_0xab23('0xc')](_0xab23('0xd'),auth[_0xab23('0xa')](),controller[_0xab23('0xe')]);module[_0xab23('0xf')]=router; \ No newline at end of file +var _0xd51e=['express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4a2246,_0x4244c1){var _0x8855e8=function(_0x30dc2d){while(--_0x30dc2d){_0x4a2246['push'](_0x4a2246['shift']());}};_0x8855e8(++_0x4244c1);}(_0xd51e,0x11c));var _0xed51=function(_0x25d9dd,_0x4bf73a){_0x25d9dd=_0x25d9dd-0x0;var _0x27fb38=_0xd51e[_0x25d9dd];return _0x27fb38;};'use strict';var multer=require(_0xed51('0x0'));var util=require(_0xed51('0x1'));var path=require(_0xed51('0x2'));var timeout=require(_0xed51('0x3'));var express=require(_0xed51('0x4'));var router=express[_0xed51('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed51('0x6'));var interaction=require(_0xed51('0x7'));var config=require('../../config/environment');var controller=require(_0xed51('0x8'));router[_0xed51('0x9')]('/:id',auth[_0xed51('0xa')](),controller['show']);router[_0xed51('0xb')](_0xed51('0xc'),auth[_0xed51('0xa')](),controller['update']);router[_0xed51('0xd')]('/:id',auth[_0xed51('0xa')](),controller[_0xed51('0xe')]);module[_0xed51('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a3e8335..56f4471 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 _0x2229=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4e72a5,_0x59d207){var _0x5c608f=function(_0x5e0632){while(--_0x5e0632){_0x4e72a5['push'](_0x4e72a5['shift']());}};_0x5c608f(++_0x59d207);}(_0x2229,0xde));var _0x9222=function(_0x5f3730,_0x968294){_0x5f3730=_0x5f3730-0x0;var _0x387506=_0x2229[_0x5f3730];return _0x387506;};'use strict';var Sequelize=require(_0x9222('0x0'));module[_0x9222('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9222('0x2')]},'write':{'type':Sequelize[_0x9222('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x717b=['BOOLEAN','STRING'];(function(_0x4cbad3,_0xf08e47){var _0x5b26f6=function(_0x1ecb5d){while(--_0x1ecb5d){_0x4cbad3['push'](_0x4cbad3['shift']());}};_0x5b26f6(++_0xf08e47);}(_0x717b,0x111));var _0xb717=function(_0x2a27d9,_0x478fef){_0x2a27d9=_0x2a27d9-0x0;var _0xa4b646=_0x717b[_0x2a27d9];return _0xa4b646;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb717('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb717('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 42d435d..e74b066 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 _0x9864=['fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','params','create','body','catch','find','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0x9864,0x1f1));var _0x4986=function(_0x9acf66,_0x4b140a){_0x9acf66=_0x9acf66-0x0;var _0x42291a=_0x9864[_0x9acf66];return _0x42291a;};'use strict';var emlformat=require(_0x4986('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4986('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4986('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4986('0x3'));var path=require(_0x4986('0x4'));var sox=require(_0x4986('0x5'));var csv=require(_0x4986('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4986('0x7'));var _=require(_0x4986('0x8'));var squel=require(_0x4986('0x9'));var crypto=require(_0x4986('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4986('0x6'));var querystring=require('querystring');var Papa=require(_0x4986('0xb'));var Redis=require(_0x4986('0xc'));var authService=require(_0x4986('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x4986('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4986('0xf'))(_0x4986('0x10'));var utils=require(_0x4986('0x11'));var config=require(_0x4986('0x12'));var licenseUtil=require(_0x4986('0x13'));var db=require(_0x4986('0x14'))['db'];config[_0x4986('0x15')]=_[_0x4986('0x16')](config[_0x4986('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4986('0x17'))(new Redis(config[_0x4986('0x15')]));require(_0x4986('0x18'))[_0x4986('0x19')](socket);function respondWithStatusCode(_0x167720,_0x1fc76a){_0x1fc76a=_0x1fc76a||0xcc;return function(_0x588411){if(_0x588411){return _0x167720[_0x4986('0x1a')](_0x1fc76a);}return _0x167720[_0x4986('0x1b')](_0x1fc76a)[_0x4986('0x1c')]();};}function respondWithResult(_0x457cec,_0x23c93){_0x23c93=_0x23c93||0xc8;return function(_0x4bf263){if(_0x4bf263){return _0x457cec[_0x4986('0x1b')](_0x23c93)[_0x4986('0x1d')](_0x4bf263);}};}function respondWithFilteredResult(_0x35caf9,_0x3a428d){return function(_0x26d48c){if(_0x26d48c){var _0x3f980b=typeof _0x3a428d[_0x4986('0x1e')]===_0x4986('0x1f')&&typeof _0x3a428d['limit']===_0x4986('0x1f');var _0x5ac438=_0x26d48c[_0x4986('0x20')];var _0x4716e3=_0x3f980b?0x0:_0x3a428d[_0x4986('0x1e')];var _0x45a514=_0x3f980b?_0x26d48c[_0x4986('0x20')]:_0x3a428d[_0x4986('0x1e')]+_0x3a428d[_0x4986('0x21')];var _0x12b5dc;if(_0x45a514>=_0x5ac438){_0x45a514=_0x5ac438;_0x12b5dc=0xc8;}else{_0x12b5dc=0xce;}_0x35caf9[_0x4986('0x1b')](_0x12b5dc);return _0x35caf9['set'](_0x4986('0x22'),_0x4716e3+'-'+_0x45a514+'/'+_0x5ac438)[_0x4986('0x1d')](_0x26d48c);}return null;};}function patchUpdates(_0x372a46){return function(_0x5f2ac4){try{jsonpatch['apply'](_0x5f2ac4,_0x372a46,!![]);}catch(_0x3197c7){return BPromise[_0x4986('0x23')](_0x3197c7);}return _0x5f2ac4[_0x4986('0x24')]();};}function saveUpdates(_0x3d74fa,_0x2ab63b){return function(_0x4dd5ff){if(_0x4dd5ff){return _0x4dd5ff[_0x4986('0x25')](_0x3d74fa)[_0x4986('0x26')](function(_0x5694d4){return _0x5694d4;});}return null;};}function removeEntity(_0x30ab24,_0x407fba){return function(_0x4007b8){if(_0x4007b8){return _0x4007b8[_0x4986('0x27')]()[_0x4986('0x26')](function(){_0x30ab24[_0x4986('0x1b')](0xcc)[_0x4986('0x1c')]();});}};}function handleEntityNotFound(_0x564416,_0xcf6fe1){return function(_0x3b1916){if(!_0x3b1916){_0x564416[_0x4986('0x1a')](0x194);}return _0x3b1916;};}function handleError(_0x34d63d,_0x4b40e8){_0x4b40e8=_0x4b40e8||0x1f4;return function(_0x37fee1){logger[_0x4986('0x28')](_0x37fee1['stack']);if(_0x37fee1[_0x4986('0x29')]){delete _0x37fee1[_0x4986('0x29')];}_0x34d63d[_0x4986('0x1b')](_0x4b40e8)['send'](_0x37fee1);};}exports[_0x4986('0x2a')]=function(_0x49c92d,_0xcd2162){var _0x13bfe4={},_0x5b12d5={},_0x2e66db={'count':0x0,'rows':[]};var _0x20ff62=_[_0x4986('0x2b')](db[_0x4986('0x2c')][_0x4986('0x2d')],function(_0x1fa0b7){return{'name':_0x1fa0b7[_0x4986('0x2e')],'type':_0x1fa0b7[_0x4986('0x2f')][_0x4986('0x30')]};});_0x5b12d5[_0x4986('0x31')]=_[_0x4986('0x2b')](_0x20ff62,_0x4986('0x29'));_0x5b12d5['query']=_[_0x4986('0x32')](_0x49c92d[_0x4986('0x33')]);_0x5b12d5[_0x4986('0x34')]=_[_0x4986('0x35')](_0x5b12d5['model'],_0x5b12d5[_0x4986('0x33')]);_0x13bfe4[_0x4986('0x36')]=_[_0x4986('0x35')](_0x5b12d5[_0x4986('0x31')],qs[_0x4986('0x37')](_0x49c92d[_0x4986('0x33')]['fields']));_0x13bfe4[_0x4986('0x36')]=_0x13bfe4[_0x4986('0x36')][_0x4986('0x38')]?_0x13bfe4[_0x4986('0x36')]:_0x5b12d5[_0x4986('0x31')];if(!_0x49c92d[_0x4986('0x33')][_0x4986('0x39')]('nolimit')){_0x13bfe4[_0x4986('0x21')]=qs['limit'](_0x49c92d[_0x4986('0x33')][_0x4986('0x21')]);_0x13bfe4[_0x4986('0x1e')]=qs[_0x4986('0x1e')](_0x49c92d[_0x4986('0x33')][_0x4986('0x1e')]);}_0x13bfe4['order']=qs[_0x4986('0x3a')](_0x49c92d[_0x4986('0x33')][_0x4986('0x3a')]);_0x13bfe4['where']=qs[_0x4986('0x34')](_[_0x4986('0x3b')](_0x49c92d[_0x4986('0x33')],_0x5b12d5[_0x4986('0x34')]),_0x20ff62);if(_0x49c92d['query'][_0x4986('0x3c')]){_0x13bfe4[_0x4986('0x3d')]=_['merge'](_0x13bfe4[_0x4986('0x3d')],{'$or':_[_0x4986('0x2b')](_0x20ff62,function(_0x3e6791){if(_0x3e6791['type']!==_0x4986('0x3e')){var _0x710eac={};_0x710eac[_0x3e6791[_0x4986('0x29')]]={'$like':'%'+_0x49c92d[_0x4986('0x33')][_0x4986('0x3c')]+'%'};return _0x710eac;}})});}_0x13bfe4=_[_0x4986('0x3f')]({},_0x13bfe4,_0x49c92d[_0x4986('0x40')]);var _0x282cd3={'where':_0x13bfe4[_0x4986('0x3d')]};return db['ChatGroup'][_0x4986('0x20')](_0x282cd3)[_0x4986('0x26')](function(_0x2adeb5){_0x2e66db[_0x4986('0x20')]=_0x2adeb5;if(_0x49c92d[_0x4986('0x33')][_0x4986('0x41')]){_0x13bfe4[_0x4986('0x42')]=[{'all':!![]}];}return db[_0x4986('0x2c')]['findAll'](_0x13bfe4);})['then'](function(_0x45b71a){_0x2e66db[_0x4986('0x43')]=_0x45b71a;return _0x2e66db;})[_0x4986('0x26')](respondWithFilteredResult(_0xcd2162,_0x13bfe4))['catch'](handleError(_0xcd2162,null));};exports['show']=function(_0x5069e1,_0x53ea7b){var _0x561f73={'raw':!![],'where':{'id':_0x5069e1[_0x4986('0x44')]['id']}},_0x22655d={};_0x22655d[_0x4986('0x31')]=_[_0x4986('0x32')](db[_0x4986('0x2c')][_0x4986('0x2d')]);_0x22655d[_0x4986('0x33')]=_['keys'](_0x5069e1['query']);_0x22655d[_0x4986('0x34')]=_['intersection'](_0x22655d['model'],_0x22655d['query']);_0x561f73['attributes']=_[_0x4986('0x35')](_0x22655d[_0x4986('0x31')],qs[_0x4986('0x37')](_0x5069e1['query'][_0x4986('0x37')]));_0x561f73['attributes']=_0x561f73[_0x4986('0x36')][_0x4986('0x38')]?_0x561f73[_0x4986('0x36')]:_0x22655d[_0x4986('0x31')];if(_0x5069e1[_0x4986('0x33')][_0x4986('0x41')]){_0x561f73[_0x4986('0x42')]=[{'all':!![]}];}_0x561f73=_[_0x4986('0x3f')]({},_0x561f73,_0x5069e1[_0x4986('0x40')]);return db['ChatGroup']['find'](_0x561f73)['then'](handleEntityNotFound(_0x53ea7b,null))[_0x4986('0x26')](respondWithResult(_0x53ea7b,null))['catch'](handleError(_0x53ea7b,null));};exports[_0x4986('0x45')]=function(_0x149d54,_0x5f2350){return db[_0x4986('0x2c')]['create'](_0x149d54[_0x4986('0x46')],{})[_0x4986('0x26')](respondWithResult(_0x5f2350,0xc9))[_0x4986('0x47')](handleError(_0x5f2350,null));};exports['update']=function(_0x433d2,_0x3f77f3){if(_0x433d2[_0x4986('0x46')]['id']){delete _0x433d2[_0x4986('0x46')]['id'];}return db['ChatGroup'][_0x4986('0x48')]({'where':{'id':_0x433d2[_0x4986('0x44')]['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x3f77f3,null))[_0x4986('0x26')](saveUpdates(_0x433d2[_0x4986('0x46')],null))[_0x4986('0x26')](respondWithResult(_0x3f77f3,null))['catch'](handleError(_0x3f77f3,null));};exports[_0x4986('0x27')]=function(_0x23e6d5,_0x5a8b41){return db['ChatGroup'][_0x4986('0x48')]({'where':{'id':_0x23e6d5[_0x4986('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a8b41,null))['then'](removeEntity(_0x5a8b41,null))[_0x4986('0x47')](handleError(_0x5a8b41,null));};exports[_0x4986('0x49')]=function(_0x180754,_0x17da7d){return db[_0x4986('0x2c')][_0x4986('0x49')]()[_0x4986('0x26')](respondWithResult(_0x17da7d,null))[_0x4986('0x47')](handleError(_0x17da7d,null));};exports['getUnread']=function(_0x4df7fa,_0x308712,_0x795e10){return db[_0x4986('0x4a')][_0x4986('0x20')]({'where':{'ChatGroupId':_0x4df7fa[_0x4986('0x44')]['id'],'ToId':_0x4df7fa[_0x4986('0x4b')]['id'],'read':![]}})['then'](function(_0x5e5daa){return{'id':_['toInteger'](_0x4df7fa[_0x4986('0x44')]['id']),'count':_0x5e5daa};})[_0x4986('0x26')](respondWithResult(_0x308712,null))[_0x4986('0x47')](handleError(_0x308712,null));};exports[_0x4986('0x4c')]=function(_0x5ee8ce,_0x713a82,_0x302e68){return db[_0x4986('0x2c')][_0x4986('0x48')]({'where':{'id':_0x5ee8ce['params']['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x713a82,null))[_0x4986('0x26')](function(_0x512ef4){if(_0x512ef4){return _0x512ef4['addMembers'](_0x5ee8ce[_0x4986('0x46')][_0x4986('0x4d')],_[_0x4986('0x4e')](_0x5ee8ce[_0x4986('0x46')],[_0x4986('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x713a82,null))[_0x4986('0x47')](handleError(_0x713a82,null));};exports[_0x4986('0x4f')]=function(_0x289219,_0x1be8be,_0x1c48df){var _0x36ded4={};var _0x5e8a78={};var _0x5ee7e6;var _0x409ccb;return db[_0x4986('0x2c')][_0x4986('0x50')]({'where':{'id':_0x289219[_0x4986('0x44')]['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x1be8be,null))[_0x4986('0x26')](function(_0x327d27){if(_0x327d27){_0x5ee7e6=_0x327d27;_0x5e8a78['model']=_['keys'](db[_0x4986('0x51')][_0x4986('0x2d')]);_0x5e8a78[_0x4986('0x33')]=_['keys'](_0x289219[_0x4986('0x33')]);_0x5e8a78['filters']=_[_0x4986('0x35')](_0x5e8a78[_0x4986('0x31')],_0x5e8a78[_0x4986('0x33')]);_0x36ded4['attributes']=_[_0x4986('0x35')](_0x5e8a78[_0x4986('0x31')],qs[_0x4986('0x37')](_0x289219[_0x4986('0x33')][_0x4986('0x37')]));_0x36ded4[_0x4986('0x36')]=_0x36ded4[_0x4986('0x36')]['length']?_0x36ded4[_0x4986('0x36')]:_0x5e8a78[_0x4986('0x31')];_0x36ded4[_0x4986('0x52')]=qs[_0x4986('0x3a')](_0x289219[_0x4986('0x33')]['sort']);_0x36ded4[_0x4986('0x3d')]=qs[_0x4986('0x34')](_[_0x4986('0x3b')](_0x289219[_0x4986('0x33')],_0x5e8a78[_0x4986('0x34')]));if(_0x289219['query'][_0x4986('0x3c')]){_0x36ded4[_0x4986('0x3d')]=_[_0x4986('0x3f')](_0x36ded4[_0x4986('0x3d')],{'$or':_['map'](_0x36ded4['attributes'],function(_0x42ffda){var _0x36805b={};_0x36805b[_0x42ffda]={'$like':'%'+_0x289219['query'][_0x4986('0x3c')]+'%'};return _0x36805b;})});}_0x36ded4=_[_0x4986('0x3f')]({},_0x36ded4,_0x289219[_0x4986('0x40')]);return _0x5ee7e6[_0x4986('0x4f')](_0x36ded4);}})[_0x4986('0x26')](function(_0x52b727){if(_0x52b727){_0x409ccb=_0x52b727[_0x4986('0x38')];if(!_0x289219[_0x4986('0x33')]['hasOwnProperty'](_0x4986('0x53'))){_0x36ded4[_0x4986('0x21')]=qs[_0x4986('0x21')](_0x289219['query'][_0x4986('0x21')]);_0x36ded4[_0x4986('0x1e')]=qs[_0x4986('0x1e')](_0x289219[_0x4986('0x33')][_0x4986('0x1e')]);}return _0x5ee7e6[_0x4986('0x4f')](_0x36ded4);}})[_0x4986('0x26')](function(_0x1c011a){if(_0x1c011a){return _0x1c011a?{'count':_0x409ccb,'rows':_0x1c011a}:null;}})[_0x4986('0x26')](respondWithResult(_0x1be8be,null))['catch'](handleError(_0x1be8be,null));};exports['removeMembers']=function(_0x1955a4,_0x4924e2,_0x1ad4a8){return db['ChatGroup']['find']({'where':{'id':_0x1955a4[_0x4986('0x44')]['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x4924e2,null))[_0x4986('0x26')](function(_0xe71e1a){if(_0xe71e1a){return _0xe71e1a[_0x4986('0x54')](_0x1955a4[_0x4986('0x33')][_0x4986('0x4d')]);}})['then'](respondWithStatusCode(_0x4924e2,null))[_0x4986('0x47')](handleError(_0x4924e2,null));};exports[_0x4986('0x55')]=function(_0x41b0e3,_0x1d2a66,_0xdd781c){if(_0x41b0e3[_0x4986('0x46')]['id']){delete _0x41b0e3[_0x4986('0x46')]['id'];}return db[_0x4986('0x2c')]['find']({'where':{'id':_0x41b0e3[_0x4986('0x44')]['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x1d2a66,null))[_0x4986('0x26')](function(_0x39b95e){if(_0x39b95e){_0x41b0e3[_0x4986('0x46')][_0x4986('0x56')]=_0x39b95e['id'];return db[_0x4986('0x4a')][_0x4986('0x45')](_0x41b0e3['body']);}})[_0x4986('0x26')](respondWithResult(_0x1d2a66,null))[_0x4986('0x47')](handleError(_0x1d2a66,null));};exports[_0x4986('0x57')]=function(_0xe994a4,_0x5258be,_0x5b44a5){var _0x2a182d={};var _0x420bc2={};var _0xf61ed0;var _0x4540f1;return db[_0x4986('0x2c')][_0x4986('0x50')]({'where':{'id':_0xe994a4[_0x4986('0x44')]['id']}})[_0x4986('0x26')](handleEntityNotFound(_0x5258be,null))[_0x4986('0x26')](function(_0x445487){if(_0x445487){_0xf61ed0=_0x445487;_0x420bc2[_0x4986('0x31')]=_[_0x4986('0x32')](db['ChatInternalMessage'][_0x4986('0x2d')]);_0x420bc2['query']=_[_0x4986('0x32')](_0xe994a4[_0x4986('0x33')]);_0x420bc2[_0x4986('0x34')]=_[_0x4986('0x35')](_0x420bc2['model'],_0x420bc2[_0x4986('0x33')]);_0x2a182d[_0x4986('0x36')]=_['intersection'](_0x420bc2[_0x4986('0x31')],qs[_0x4986('0x37')](_0xe994a4[_0x4986('0x33')][_0x4986('0x37')]));_0x2a182d['attributes']=_0x2a182d[_0x4986('0x36')][_0x4986('0x38')]?_0x2a182d[_0x4986('0x36')]:_0x420bc2[_0x4986('0x31')];_0x2a182d[_0x4986('0x52')]=qs[_0x4986('0x3a')](_0xe994a4['query'][_0x4986('0x3a')]);_0x2a182d[_0x4986('0x3d')]=qs['filters'](_[_0x4986('0x3b')](_0xe994a4[_0x4986('0x33')],_0x420bc2[_0x4986('0x34')]));if(_0xe994a4[_0x4986('0x33')][_0x4986('0x3c')]){_0x2a182d[_0x4986('0x3d')]=_[_0x4986('0x3f')](_0x2a182d[_0x4986('0x3d')],{'$or':_[_0x4986('0x2b')](_0x2a182d['attributes'],function(_0x109025){var _0x2644a1={};_0x2644a1[_0x109025]={'$like':'%'+_0xe994a4[_0x4986('0x33')]['filter']+'%'};return _0x2644a1;})});}if(_0xe994a4[_0x4986('0x33')][_0x4986('0x58')]){var _0x4bef15=_0xe994a4[_0x4986('0x33')][_0x4986('0x58')][_0x4986('0x59')](',');var _0x4fef0a={};_0x4fef0a[_0x4bef15[0x0]]={'$gte':moment(_0x4bef15[0x1])[_0x4986('0x5a')](_0x4986('0x5b'))};_0x2a182d[_0x4986('0x3d')]=_[_0x4986('0x3f')](_0x2a182d['where'],_0x4fef0a);}_0x2a182d=_['merge']({},_0x2a182d,_0xe994a4[_0x4986('0x40')]);return _0xf61ed0[_0x4986('0x57')](_0x2a182d);}})['then'](function(_0x1d8129){if(_0x1d8129){_0x4540f1=_0x1d8129[_0x4986('0x38')];if(!_0xe994a4[_0x4986('0x33')]['hasOwnProperty'](_0x4986('0x53'))){_0x2a182d[_0x4986('0x21')]=qs[_0x4986('0x21')](_0xe994a4['query'][_0x4986('0x21')]);_0x2a182d[_0x4986('0x1e')]=qs['offset'](_0xe994a4['query'][_0x4986('0x1e')]);}return _0xf61ed0['getMessages'](_0x2a182d);}})['then'](function(_0x336f56){if(_0x336f56){return _0x336f56?{'count':_0x4540f1,'rows':_0x336f56}:null;}})[_0x4986('0x26')](respondWithResult(_0x5258be,null))[_0x4986('0x47')](handleError(_0x5258be,null));}; \ No newline at end of file +var _0xa823=['index','map','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','type','merge','options','ChatGroup','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xa823,0x1c6));var _0x3a82=function(_0x5a0585,_0x4d8839){_0x5a0585=_0x5a0585-0x0;var _0x46010c=_0xa823[_0x5a0585];return _0x46010c;};'use strict';var emlformat=require(_0x3a82('0x0'));var rimraf=require(_0x3a82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a82('0x2'));var rp=require(_0x3a82('0x3'));var moment=require(_0x3a82('0x4'));var BPromise=require(_0x3a82('0x5'));var Mustache=require(_0x3a82('0x6'));var util=require(_0x3a82('0x7'));var path=require('path');var sox=require(_0x3a82('0x8'));var csv=require(_0x3a82('0x9'));var ejs=require(_0x3a82('0xa'));var fs=require('fs');var fs_extra=require(_0x3a82('0xb'));var _=require(_0x3a82('0xc'));var squel=require(_0x3a82('0xd'));var crypto=require(_0x3a82('0xe'));var jsforce=require(_0x3a82('0xf'));var deskjs=require(_0x3a82('0x10'));var toCsv=require(_0x3a82('0x9'));var querystring=require(_0x3a82('0x11'));var Papa=require(_0x3a82('0x12'));var Redis=require(_0x3a82('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a82('0x14'));var as=require(_0x3a82('0x15'));var hardwareService=require(_0x3a82('0x16'));var logger=require(_0x3a82('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3a82('0x18'));var licenseUtil=require(_0x3a82('0x19'));var db=require(_0x3a82('0x1a'))['db'];config['redis']=_[_0x3a82('0x1b')](config[_0x3a82('0x1c')],{'host':_0x3a82('0x1d'),'port':0x18eb});var socket=require(_0x3a82('0x1e'))(new Redis(config[_0x3a82('0x1c')]));require(_0x3a82('0x1f'))[_0x3a82('0x20')](socket);function respondWithStatusCode(_0x310557,_0x1e92dc){_0x1e92dc=_0x1e92dc||0xcc;return function(_0x2512ce){if(_0x2512ce){return _0x310557[_0x3a82('0x21')](_0x1e92dc);}return _0x310557['status'](_0x1e92dc)[_0x3a82('0x22')]();};}function respondWithResult(_0x26f212,_0x40d838){_0x40d838=_0x40d838||0xc8;return function(_0x5d225c){if(_0x5d225c){return _0x26f212[_0x3a82('0x23')](_0x40d838)['json'](_0x5d225c);}};}function respondWithFilteredResult(_0x24f805,_0x45e867){return function(_0x57e499){if(_0x57e499){var _0x10f088=typeof _0x45e867['offset']===_0x3a82('0x24')&&typeof _0x45e867[_0x3a82('0x25')]===_0x3a82('0x24');var _0xa02da3=_0x57e499[_0x3a82('0x26')];var _0x17acf6=_0x10f088?0x0:_0x45e867[_0x3a82('0x27')];var _0x39eced=_0x10f088?_0x57e499['count']:_0x45e867[_0x3a82('0x27')]+_0x45e867[_0x3a82('0x25')];var _0x57f47e;if(_0x39eced>=_0xa02da3){_0x39eced=_0xa02da3;_0x57f47e=0xc8;}else{_0x57f47e=0xce;}_0x24f805[_0x3a82('0x23')](_0x57f47e);return _0x24f805[_0x3a82('0x28')](_0x3a82('0x29'),_0x17acf6+'-'+_0x39eced+'/'+_0xa02da3)['json'](_0x57e499);}return null;};}function patchUpdates(_0x3e33a6){return function(_0xc88d90){try{jsonpatch[_0x3a82('0x2a')](_0xc88d90,_0x3e33a6,!![]);}catch(_0x5eb662){return BPromise[_0x3a82('0x2b')](_0x5eb662);}return _0xc88d90[_0x3a82('0x2c')]();};}function saveUpdates(_0x40aa88,_0x25d47d){return function(_0x521433){if(_0x521433){return _0x521433[_0x3a82('0x2d')](_0x40aa88)['then'](function(_0xdcc239){return _0xdcc239;});}return null;};}function removeEntity(_0x38f51e,_0x44f505){return function(_0x4e864a){if(_0x4e864a){return _0x4e864a['destroy']()[_0x3a82('0x2e')](function(){_0x38f51e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x380adb,_0x3505ff){return function(_0x145d76){if(!_0x145d76){_0x380adb[_0x3a82('0x21')](0x194);}return _0x145d76;};}function handleError(_0x4a8941,_0x468ac7){_0x468ac7=_0x468ac7||0x1f4;return function(_0x29405e){logger[_0x3a82('0x2f')](_0x29405e[_0x3a82('0x30')]);if(_0x29405e[_0x3a82('0x31')]){delete _0x29405e['name'];}_0x4a8941[_0x3a82('0x23')](_0x468ac7)[_0x3a82('0x32')](_0x29405e);};}exports[_0x3a82('0x33')]=function(_0x2f4772,_0x309369){var _0x2ea10b={},_0x15f2e2={},_0x535c75={'count':0x0,'rows':[]};var _0x496d71=_[_0x3a82('0x34')](db['ChatGroup'][_0x3a82('0x35')],function(_0x264882){return{'name':_0x264882['fieldName'],'type':_0x264882['type'][_0x3a82('0x36')]};});_0x15f2e2[_0x3a82('0x37')]=_[_0x3a82('0x34')](_0x496d71,_0x3a82('0x31'));_0x15f2e2[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x2f4772[_0x3a82('0x38')]);_0x15f2e2['filters']=_['intersection'](_0x15f2e2[_0x3a82('0x37')],_0x15f2e2[_0x3a82('0x38')]);_0x2ea10b[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x15f2e2['model'],qs['fields'](_0x2f4772['query'][_0x3a82('0x3c')]));_0x2ea10b[_0x3a82('0x3a')]=_0x2ea10b[_0x3a82('0x3a')][_0x3a82('0x3d')]?_0x2ea10b['attributes']:_0x15f2e2[_0x3a82('0x37')];if(!_0x2f4772[_0x3a82('0x38')]['hasOwnProperty'](_0x3a82('0x3e'))){_0x2ea10b['limit']=qs[_0x3a82('0x25')](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x25')]);_0x2ea10b['offset']=qs[_0x3a82('0x27')](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x27')]);}_0x2ea10b[_0x3a82('0x3f')]=qs['sort'](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x40')]);_0x2ea10b[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x2f4772[_0x3a82('0x38')],_0x15f2e2[_0x3a82('0x42')]),_0x496d71);if(_0x2f4772['query'][_0x3a82('0x44')]){_0x2ea10b[_0x3a82('0x41')]=_['merge'](_0x2ea10b[_0x3a82('0x41')],{'$or':_[_0x3a82('0x34')](_0x496d71,function(_0x48f9de){if(_0x48f9de[_0x3a82('0x45')]!=='VIRTUAL'){var _0x2cfb66={};_0x2cfb66[_0x48f9de[_0x3a82('0x31')]]={'$like':'%'+_0x2f4772[_0x3a82('0x38')]['filter']+'%'};return _0x2cfb66;}})});}_0x2ea10b=_[_0x3a82('0x46')]({},_0x2ea10b,_0x2f4772[_0x3a82('0x47')]);var _0x2eb349={'where':_0x2ea10b[_0x3a82('0x41')]};return db[_0x3a82('0x48')]['count'](_0x2eb349)[_0x3a82('0x2e')](function(_0x59c7f0){_0x535c75[_0x3a82('0x26')]=_0x59c7f0;if(_0x2f4772[_0x3a82('0x38')][_0x3a82('0x49')]){_0x2ea10b['include']=[{'all':!![]}];}return db[_0x3a82('0x48')][_0x3a82('0x4a')](_0x2ea10b);})[_0x3a82('0x2e')](function(_0x5251f6){_0x535c75[_0x3a82('0x4b')]=_0x5251f6;return _0x535c75;})[_0x3a82('0x2e')](respondWithFilteredResult(_0x309369,_0x2ea10b))[_0x3a82('0x4c')](handleError(_0x309369,null));};exports[_0x3a82('0x4d')]=function(_0x38ed85,_0x4eab6b){var _0x12f90a={'raw':!![],'where':{'id':_0x38ed85[_0x3a82('0x4e')]['id']}},_0x333443={};_0x333443[_0x3a82('0x37')]=_[_0x3a82('0x39')](db[_0x3a82('0x48')]['rawAttributes']);_0x333443[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x38ed85[_0x3a82('0x38')]);_0x333443[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x333443['model'],_0x333443['query']);_0x12f90a[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x333443[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x38ed85[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x12f90a[_0x3a82('0x3a')]=_0x12f90a[_0x3a82('0x3a')][_0x3a82('0x3d')]?_0x12f90a[_0x3a82('0x3a')]:_0x333443[_0x3a82('0x37')];if(_0x38ed85[_0x3a82('0x38')][_0x3a82('0x49')]){_0x12f90a[_0x3a82('0x4f')]=[{'all':!![]}];}_0x12f90a=_['merge']({},_0x12f90a,_0x38ed85[_0x3a82('0x47')]);return db[_0x3a82('0x48')][_0x3a82('0x50')](_0x12f90a)[_0x3a82('0x2e')](handleEntityNotFound(_0x4eab6b,null))['then'](respondWithResult(_0x4eab6b,null))['catch'](handleError(_0x4eab6b,null));};exports[_0x3a82('0x51')]=function(_0x96309c,_0x410a05){return db['ChatGroup'][_0x3a82('0x51')](_0x96309c[_0x3a82('0x52')],{})[_0x3a82('0x2e')](respondWithResult(_0x410a05,0xc9))[_0x3a82('0x4c')](handleError(_0x410a05,null));};exports[_0x3a82('0x2d')]=function(_0x592da4,_0x4f166b){if(_0x592da4['body']['id']){delete _0x592da4['body']['id'];}return db[_0x3a82('0x48')][_0x3a82('0x50')]({'where':{'id':_0x592da4[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x4f166b,null))[_0x3a82('0x2e')](saveUpdates(_0x592da4[_0x3a82('0x52')],null))[_0x3a82('0x2e')](respondWithResult(_0x4f166b,null))['catch'](handleError(_0x4f166b,null));};exports[_0x3a82('0x53')]=function(_0x292835,_0x2e9d54){return db['ChatGroup'][_0x3a82('0x50')]({'where':{'id':_0x292835[_0x3a82('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e9d54,null))['then'](removeEntity(_0x2e9d54,null))[_0x3a82('0x4c')](handleError(_0x2e9d54,null));};exports[_0x3a82('0x54')]=function(_0x333d5e,_0x868fd7){return db[_0x3a82('0x48')][_0x3a82('0x54')]()[_0x3a82('0x2e')](respondWithResult(_0x868fd7,null))['catch'](handleError(_0x868fd7,null));};exports['getUnread']=function(_0x11a6f4,_0x14b0ed,_0x344027){return db[_0x3a82('0x55')][_0x3a82('0x26')]({'where':{'ChatGroupId':_0x11a6f4[_0x3a82('0x4e')]['id'],'ToId':_0x11a6f4[_0x3a82('0x56')]['id'],'read':![]}})[_0x3a82('0x2e')](function(_0x5149a1){return{'id':_[_0x3a82('0x57')](_0x11a6f4[_0x3a82('0x4e')]['id']),'count':_0x5149a1};})['then'](respondWithResult(_0x14b0ed,null))['catch'](handleError(_0x14b0ed,null));};exports[_0x3a82('0x58')]=function(_0x28266b,_0x2a1fa0,_0x2438cf){return db['ChatGroup'][_0x3a82('0x50')]({'where':{'id':_0x28266b[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x2a1fa0,null))[_0x3a82('0x2e')](function(_0x382e49){if(_0x382e49){return _0x382e49[_0x3a82('0x58')](_0x28266b[_0x3a82('0x52')][_0x3a82('0x59')],_[_0x3a82('0x5a')](_0x28266b['body'],['ids','id'])||{});}})[_0x3a82('0x2e')](respondWithResult(_0x2a1fa0,null))[_0x3a82('0x4c')](handleError(_0x2a1fa0,null));};exports[_0x3a82('0x5b')]=function(_0x5962f8,_0xbcac10,_0x1f7f0c){var _0x130d9c={};var _0x217704={};var _0x114a57;var _0x4a26aa;return db['ChatGroup'][_0x3a82('0x5c')]({'where':{'id':_0x5962f8['params']['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0xbcac10,null))['then'](function(_0x4fd7fa){if(_0x4fd7fa){_0x114a57=_0x4fd7fa;_0x217704[_0x3a82('0x37')]=_[_0x3a82('0x39')](db[_0x3a82('0x5d')][_0x3a82('0x35')]);_0x217704['query']=_[_0x3a82('0x39')](_0x5962f8[_0x3a82('0x38')]);_0x217704[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x217704[_0x3a82('0x37')],_0x217704['query']);_0x130d9c[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x217704[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x130d9c[_0x3a82('0x3a')]=_0x130d9c['attributes'][_0x3a82('0x3d')]?_0x130d9c[_0x3a82('0x3a')]:_0x217704[_0x3a82('0x37')];_0x130d9c[_0x3a82('0x3f')]=qs[_0x3a82('0x40')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x40')]);_0x130d9c[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x5962f8[_0x3a82('0x38')],_0x217704[_0x3a82('0x42')]));if(_0x5962f8[_0x3a82('0x38')][_0x3a82('0x44')]){_0x130d9c['where']=_[_0x3a82('0x46')](_0x130d9c[_0x3a82('0x41')],{'$or':_['map'](_0x130d9c[_0x3a82('0x3a')],function(_0x2921c9){var _0x22af61={};_0x22af61[_0x2921c9]={'$like':'%'+_0x5962f8[_0x3a82('0x38')][_0x3a82('0x44')]+'%'};return _0x22af61;})});}_0x130d9c=_['merge']({},_0x130d9c,_0x5962f8[_0x3a82('0x47')]);return _0x114a57[_0x3a82('0x5b')](_0x130d9c);}})['then'](function(_0x2c3222){if(_0x2c3222){_0x4a26aa=_0x2c3222['length'];if(!_0x5962f8[_0x3a82('0x38')][_0x3a82('0x5e')](_0x3a82('0x3e'))){_0x130d9c['limit']=qs[_0x3a82('0x25')](_0x5962f8[_0x3a82('0x38')]['limit']);_0x130d9c['offset']=qs[_0x3a82('0x27')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x27')]);}return _0x114a57[_0x3a82('0x5b')](_0x130d9c);}})['then'](function(_0x12dbf4){if(_0x12dbf4){return _0x12dbf4?{'count':_0x4a26aa,'rows':_0x12dbf4}:null;}})[_0x3a82('0x2e')](respondWithResult(_0xbcac10,null))[_0x3a82('0x4c')](handleError(_0xbcac10,null));};exports['removeMembers']=function(_0x5d475d,_0x2fc29e,_0x35f2a8){return db[_0x3a82('0x48')]['find']({'where':{'id':_0x5d475d[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x2fc29e,null))[_0x3a82('0x2e')](function(_0x455f58){if(_0x455f58){return _0x455f58[_0x3a82('0x5f')](_0x5d475d['query'][_0x3a82('0x59')]);}})[_0x3a82('0x2e')](respondWithStatusCode(_0x2fc29e,null))['catch'](handleError(_0x2fc29e,null));};exports[_0x3a82('0x60')]=function(_0x4d43d7,_0x1b2c13,_0x5fd544){if(_0x4d43d7['body']['id']){delete _0x4d43d7['body']['id'];}return db[_0x3a82('0x48')][_0x3a82('0x50')]({'where':{'id':_0x4d43d7[_0x3a82('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b2c13,null))[_0x3a82('0x2e')](function(_0x58468e){if(_0x58468e){_0x4d43d7[_0x3a82('0x52')]['ChatGroupId']=_0x58468e['id'];return db[_0x3a82('0x55')][_0x3a82('0x51')](_0x4d43d7[_0x3a82('0x52')]);}})['then'](respondWithResult(_0x1b2c13,null))[_0x3a82('0x4c')](handleError(_0x1b2c13,null));};exports[_0x3a82('0x61')]=function(_0x83e067,_0x5948f9,_0x40bc98){var _0x322318={};var _0x20966={};var _0x22c888;var _0x1d9908;return db[_0x3a82('0x48')][_0x3a82('0x5c')]({'where':{'id':_0x83e067[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x5948f9,null))[_0x3a82('0x2e')](function(_0x96f62a){if(_0x96f62a){_0x22c888=_0x96f62a;_0x20966['model']=_['keys'](db[_0x3a82('0x55')][_0x3a82('0x35')]);_0x20966[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x83e067['query']);_0x20966[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x20966[_0x3a82('0x37')],_0x20966['query']);_0x322318['attributes']=_[_0x3a82('0x3b')](_0x20966[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x83e067[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x322318[_0x3a82('0x3a')]=_0x322318['attributes'][_0x3a82('0x3d')]?_0x322318[_0x3a82('0x3a')]:_0x20966[_0x3a82('0x37')];_0x322318[_0x3a82('0x3f')]=qs[_0x3a82('0x40')](_0x83e067['query'][_0x3a82('0x40')]);_0x322318[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x83e067[_0x3a82('0x38')],_0x20966[_0x3a82('0x42')]));if(_0x83e067[_0x3a82('0x38')][_0x3a82('0x44')]){_0x322318['where']=_[_0x3a82('0x46')](_0x322318[_0x3a82('0x41')],{'$or':_[_0x3a82('0x34')](_0x322318[_0x3a82('0x3a')],function(_0x1c0cd7){var _0x2a2f93={};_0x2a2f93[_0x1c0cd7]={'$like':'%'+_0x83e067['query']['filter']+'%'};return _0x2a2f93;})});}if(_0x83e067[_0x3a82('0x38')]['$gte']){var _0x3e8ad3=_0x83e067[_0x3a82('0x38')]['$gte'][_0x3a82('0x62')](',');var _0x5a2105={};_0x5a2105[_0x3e8ad3[0x0]]={'$gte':moment(_0x3e8ad3[0x1])[_0x3a82('0x63')](_0x3a82('0x64'))};_0x322318[_0x3a82('0x41')]=_[_0x3a82('0x46')](_0x322318[_0x3a82('0x41')],_0x5a2105);}_0x322318=_[_0x3a82('0x46')]({},_0x322318,_0x83e067[_0x3a82('0x47')]);return _0x22c888['getMessages'](_0x322318);}})[_0x3a82('0x2e')](function(_0x55dc7b){if(_0x55dc7b){_0x1d9908=_0x55dc7b[_0x3a82('0x3d')];if(!_0x83e067['query'][_0x3a82('0x5e')](_0x3a82('0x3e'))){_0x322318[_0x3a82('0x25')]=qs[_0x3a82('0x25')](_0x83e067['query'][_0x3a82('0x25')]);_0x322318[_0x3a82('0x27')]=qs[_0x3a82('0x27')](_0x83e067[_0x3a82('0x38')][_0x3a82('0x27')]);}return _0x22c888[_0x3a82('0x61')](_0x322318);}})['then'](function(_0x5798a3){if(_0x5798a3){return _0x5798a3?{'count':_0x1d9908,'rows':_0x5798a3}:null;}})[_0x3a82('0x2e')](respondWithResult(_0x5948f9,null))[_0x3a82('0x4c')](handleError(_0x5948f9,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 9db542c..8089a48 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 _0xe666=['update','emit','hasOwnProperty','events','setMaxListeners'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe666,0x189));var _0x6e66=function(_0x27d17b,_0x1bc267){_0x27d17b=_0x27d17b-0x0;var _0x6a66c0=_0xe666[_0x27d17b];return _0x6a66c0;};'use strict';var EventEmitter=require(_0x6e66('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6e66('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e66('0x2'),'afterDestroy':'remove'};function emitEvent(_0x205f6d){return function(_0x51cc32,_0x3399ba,_0x247dc0){ChatGroupEvents[_0x6e66('0x3')](_0x205f6d+':'+_0x51cc32['id'],_0x51cc32);ChatGroupEvents[_0x6e66('0x3')](_0x205f6d,_0x51cc32);_0x247dc0(null);};}for(var e in events){if(events[_0x6e66('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x7df7=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x12af14,_0x135bc5){var _0x100286=function(_0x49ba84){while(--_0x49ba84){_0x12af14['push'](_0x12af14['shift']());}};_0x100286(++_0x135bc5);}(_0x7df7,0x1b9));var _0x77df=function(_0x62d2a,_0x487183){_0x62d2a=_0x62d2a-0x0;var _0x1591c2=_0x7df7[_0x62d2a];return _0x1591c2;};'use strict';var EventEmitter=require(_0x77df('0x0'));var ChatGroup=require(_0x77df('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77df('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x285d75){return function(_0x5b091b,_0x1c65b7,_0x4719d9){ChatGroupEvents[_0x77df('0x3')](_0x285d75+':'+_0x5b091b['id'],_0x5b091b);ChatGroupEvents[_0x77df('0x3')](_0x285d75,_0x5b091b);_0x4719d9(null);};}for(var e in events){if(events[_0x77df('0x4')](e)){var event=events[e];ChatGroup[_0x77df('0x5')](e,emitEvent(event));}}module[_0x77df('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index f2a9c58..945e690 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 _0x9233=['../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','moment','request-promise'];(function(_0x129d52,_0x1beadf){var _0x79ef89=function(_0x4913bb){while(--_0x4913bb){_0x129d52['push'](_0x129d52['shift']());}};_0x79ef89(++_0x1beadf);}(_0x9233,0x1a5));var _0x3923=function(_0x56186d,_0x5257fd){_0x56186d=_0x56186d-0x0;var _0x5e03d7=_0x9233[_0x56186d];return _0x5e03d7;};'use strict';var _=require(_0x3923('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3923('0x1'));var BPromise=require('bluebird');var rp=require(_0x3923('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3923('0x3'));var attributes=require(_0x3923('0x4'));module[_0x3923('0x5')]=function(_0x34bbcf,_0x17aeff){return _0x34bbcf['define'](_0x3923('0x6'),attributes,{'tableName':_0x3923('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x013d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x013d,0x83));var _0xd013=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x013d[_0x349148];return _0x2f2b0f;};'use strict';var _=require('lodash');var util=require(_0xd013('0x0'));var logger=require('../../config/logger')(_0xd013('0x1'));var moment=require('moment');var BPromise=require(_0xd013('0x2'));var rp=require(_0xd013('0x3'));var fs=require('fs');var path=require(_0xd013('0x4'));var rimraf=require(_0xd013('0x5'));var config=require(_0xd013('0x6'));var attributes=require(_0xd013('0x7'));module[_0xd013('0x8')]=function(_0x46a9dc,_0x910a50){return _0x46a9dc[_0xd013('0x9')]('ChatGroup',attributes,{'tableName':_0xd013('0xa'),'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 6f0d533..b762ae3 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 _0xe35c=['localhost','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x5c16e1,_0x12ea72){var _0x4f59d0=function(_0x48ed32){while(--_0x48ed32){_0x5c16e1['push'](_0x5c16e1['shift']());}};_0x4f59d0(++_0x12ea72);}(_0xe35c,0x146));var _0xce35=function(_0x1e4715,_0x5b797e){_0x1e4715=_0x1e4715-0x0;var _0x57be20=_0xe35c[_0x1e4715];return _0x57be20;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var moment=require(_0xce35('0x2'));var BPromise=require(_0xce35('0x3'));var rs=require(_0xce35('0x4'));var fs=require('fs');var Redis=require(_0xce35('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce35('0x6'))('rpc');var config=require(_0xce35('0x7'));var jayson=require(_0xce35('0x8'));var client=jayson[_0xce35('0x9')]['http']({'port':0x232a});config[_0xce35('0xa')]=_[_0xce35('0xb')](config[_0xce35('0xa')],{'host':_0xce35('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce35('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x31de15,_0x584cc6,_0x478ce1){return new BPromise(function(_0x3bd7fc,_0x46647b){return client[_0xce35('0xd')](_0x31de15,_0x478ce1)[_0xce35('0xe')](function(_0x3a1981){logger['info']('ChatGroup,\x20%s,\x20%s',_0x584cc6,_0xce35('0xf'));logger[_0xce35('0x10')](_0xce35('0x11'),_0x584cc6,_0xce35('0xf'),JSON[_0xce35('0x12')](_0x3a1981));if(_0x3a1981['error']){if(_0x3a1981['error'][_0xce35('0x13')]===0x1f4){logger[_0xce35('0x14')]('ChatGroup,\x20%s,\x20%s',_0x584cc6,_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);return _0x46647b(_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);}logger[_0xce35('0x14')](_0xce35('0x16'),_0x584cc6,_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);return _0x3bd7fc(_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);}else{logger[_0xce35('0x17')]('ChatGroup,\x20%s,\x20%s',_0x584cc6,_0xce35('0xf'));_0x3bd7fc(_0x3a1981[_0xce35('0x18')][_0xce35('0x15')]);}})[_0xce35('0x19')](function(_0x2b4b24){logger['error'](_0xce35('0x16'),_0x584cc6,_0x2b4b24);_0x46647b(_0x2b4b24);});});} \ No newline at end of file +var _0x8403=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2fa300,_0x2303bb){var _0x3efb0a=function(_0x58dc71){while(--_0x58dc71){_0x2fa300['push'](_0x2fa300['shift']());}};_0x3efb0a(++_0x2303bb);}(_0x8403,0x1a5));var _0x3840=function(_0x3ab768,_0x3ff75c){_0x3ab768=_0x3ab768-0x0;var _0x1c2137=_0x8403[_0x3ab768];return _0x1c2137;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var moment=require(_0x3840('0x2'));var BPromise=require(_0x3840('0x3'));var rs=require(_0x3840('0x4'));var fs=require('fs');var Redis=require(_0x3840('0x5'));var db=require(_0x3840('0x6'))['db'];var utils=require(_0x3840('0x7'));var logger=require(_0x3840('0x8'))('rpc');var config=require(_0x3840('0x9'));var jayson=require(_0x3840('0xa'));var client=jayson[_0x3840('0xb')][_0x3840('0xc')]({'port':0x232a});config[_0x3840('0xd')]=_[_0x3840('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3840('0xf'))(new Redis(config[_0x3840('0xd')]));require(_0x3840('0x10'))['register'](socket);function respondWithRpcPromise(_0x485084,_0x30ba1a,_0x3d2002){return new BPromise(function(_0x24da73,_0x129b36){return client[_0x3840('0x11')](_0x485084,_0x3d2002)[_0x3840('0x12')](function(_0x11b330){logger[_0x3840('0x13')](_0x3840('0x14'),_0x30ba1a,_0x3840('0x15'));logger['debug'](_0x3840('0x16'),_0x30ba1a,_0x3840('0x15'),JSON[_0x3840('0x17')](_0x11b330));if(_0x11b330['error']){if(_0x11b330[_0x3840('0x18')][_0x3840('0x19')]===0x1f4){logger['error'](_0x3840('0x14'),_0x30ba1a,_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);return _0x129b36(_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);}logger[_0x3840('0x18')](_0x3840('0x14'),_0x30ba1a,_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);return _0x24da73(_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x30ba1a,_0x3840('0x15'));_0x24da73(_0x11b330['result'][_0x3840('0x1a')]);}})[_0x3840('0x1b')](function(_0x4a6f6e){logger['error'](_0x3840('0x14'),_0x30ba1a,_0x4a6f6e);_0x129b36(_0x4a6f6e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 2f69d83..b168396 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 _0xabda=['remove','update','emit','removeListener','register','chatGroup:','./chatGroup.events','save'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xabda,0x126));var _0xaabd=function(_0x1dcf37,_0x150062){_0x1dcf37=_0x1dcf37-0x0;var _0x4323ea=_0xabda[_0x1dcf37];return _0x4323ea;};'use strict';var ChatGroupEvents=require(_0xaabd('0x0'));var events=[_0xaabd('0x1'),_0xaabd('0x2'),_0xaabd('0x3')];function createListener(_0x399cd3,_0x55e30a){return function(_0x2257ef){_0x55e30a[_0xaabd('0x4')](_0x399cd3,_0x2257ef);};}function removeListener(_0x1e3dc9,_0x1fed75){return function(){ChatGroupEvents[_0xaabd('0x5')](_0x1e3dc9,_0x1fed75);};}exports[_0xaabd('0x6')]=function(_0x255816){for(var _0x4f0aba=0x0,_0x2d7e28=events['length'];_0x4f0aba<_0x2d7e28;_0x4f0aba++){var _0x2ab0a7=events[_0x4f0aba];var _0x46c24b=createListener(_0xaabd('0x7')+_0x2ab0a7,_0x255816);ChatGroupEvents['on'](_0x2ab0a7,_0x46c24b);}}; \ No newline at end of file +var _0xe42c=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x2d4158,_0x336010){var _0x2b93eb=function(_0x28efc3){while(--_0x28efc3){_0x2d4158['push'](_0x2d4158['shift']());}};_0x2b93eb(++_0x336010);}(_0xe42c,0x149));var _0xce42=function(_0x1fc02e,_0x1a7391){_0x1fc02e=_0x1fc02e-0x0;var _0x1875e9=_0xe42c[_0x1fc02e];return _0x1875e9;};'use strict';var ChatGroupEvents=require(_0xce42('0x0'));var events=[_0xce42('0x1'),_0xce42('0x2'),_0xce42('0x3')];function createListener(_0x467c4f,_0x28066c){return function(_0x18c4a3){_0x28066c[_0xce42('0x4')](_0x467c4f,_0x18c4a3);};}function removeListener(_0x474e7e,_0x5a93d5){return function(){ChatGroupEvents[_0xce42('0x5')](_0x474e7e,_0x5a93d5);};}exports[_0xce42('0x6')]=function(_0x1c727a){for(var _0x2b25bf=0x0,_0x1cb98b=events[_0xce42('0x7')];_0x2b25bf<_0x1cb98b;_0x2b25bf++){var _0x442644=events[_0x2b25bf];var _0xf0dde5=createListener(_0xce42('0x8')+_0x442644,_0x1c727a);ChatGroupEvents['on'](_0x442644,_0xf0dde5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 06134e6..f73b4d9 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 _0xabd8=['isAuthenticated','describe','/:id','show','getUnread','/:id/messages','post','create','/:id/members','put','delete','removeMembers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe'];(function(_0x5ad4c9,_0x541163){var _0x14178c=function(_0x57dc0e){while(--_0x57dc0e){_0x5ad4c9['push'](_0x5ad4c9['shift']());}};_0x14178c(++_0x541163);}(_0xabd8,0x9c));var _0x8abd=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0xabd8[_0x3f3f40];return _0x403b7a;};'use strict';var multer=require(_0x8abd('0x0'));var util=require(_0x8abd('0x1'));var path=require(_0x8abd('0x2'));var timeout=require(_0x8abd('0x3'));var express=require(_0x8abd('0x4'));var router=express['Router']();var fs_extra=require(_0x8abd('0x5'));var auth=require(_0x8abd('0x6'));var interaction=require(_0x8abd('0x7'));var config=require(_0x8abd('0x8'));var controller=require(_0x8abd('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8abd('0xa')](_0x8abd('0xb'),auth[_0x8abd('0xc')](),controller[_0x8abd('0xd')]);router['get'](_0x8abd('0xe'),auth['isAuthenticated'](),controller[_0x8abd('0xf')]);router[_0x8abd('0xa')]('/:id/unread',auth[_0x8abd('0xc')](),controller[_0x8abd('0x10')]);router[_0x8abd('0xa')]('/:id/members',auth[_0x8abd('0xc')](),controller['getMembers']);router[_0x8abd('0xa')](_0x8abd('0x11'),auth[_0x8abd('0xc')](),controller['getMessages']);router[_0x8abd('0x12')]('/',auth[_0x8abd('0xc')](),controller[_0x8abd('0x13')]);router[_0x8abd('0x12')](_0x8abd('0x14'),auth[_0x8abd('0xc')](),controller['addMembers']);router[_0x8abd('0x12')](_0x8abd('0x11'),auth[_0x8abd('0xc')](),controller['addMessage']);router[_0x8abd('0x15')](_0x8abd('0xe'),auth[_0x8abd('0xc')](),controller['update']);router[_0x8abd('0x16')](_0x8abd('0xe'),auth[_0x8abd('0xc')](),controller['destroy']);router[_0x8abd('0x16')]('/:id/members',auth[_0x8abd('0xc')](),controller[_0x8abd('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf60b=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36a224,_0x63b472){var _0x4de1d9=function(_0x3db956){while(--_0x3db956){_0x36a224['push'](_0x36a224['shift']());}};_0x4de1d9(++_0x63b472);}(_0xf60b,0xda));var _0xbf60=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xf60b[_0x1c0991];return _0x5034de;};'use strict';var multer=require(_0xbf60('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbf60('0x1'));var express=require(_0xbf60('0x2'));var router=express[_0xbf60('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf60('0x4'));var interaction=require(_0xbf60('0x5'));var config=require(_0xbf60('0x6'));var controller=require('./chatGroup.controller');router[_0xbf60('0x7')]('/',auth['isAuthenticated'](),controller[_0xbf60('0x8')]);router[_0xbf60('0x7')](_0xbf60('0x9'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xb')]);router['get'](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xd')]);router[_0xbf60('0x7')]('/:id/unread',auth[_0xbf60('0xa')](),controller['getUnread']);router['get'](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xf')]);router['get'](_0xbf60('0x10'),auth[_0xbf60('0xa')](),controller['getMessages']);router[_0xbf60('0x11')]('/',auth[_0xbf60('0xa')](),controller[_0xbf60('0x12')]);router[_0xbf60('0x11')](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x13')]);router[_0xbf60('0x11')](_0xbf60('0x10'),auth['isAuthenticated'](),controller[_0xbf60('0x14')]);router['put'](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x15')]);router[_0xbf60('0x16')](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x17')]);router[_0xbf60('0x16')](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller['removeMembers']);module[_0xbf60('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 908261f..928ba0a 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 _0x6ea9=['TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star'];(function(_0x187681,_0x30c9f2){var _0x13ddae=function(_0xee459d){while(--_0xee459d){_0x187681['push'](_0x187681['shift']());}};_0x13ddae(++_0x30c9f2);}(_0x6ea9,0x89));var _0x96ea=function(_0x571294,_0x240c34){_0x571294=_0x571294-0x0;var _0x4dbbb2=_0x6ea9[_0x571294];return _0x4dbbb2;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'closed':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x96ea('0x3')]},'ratingType':{'type':Sequelize[_0x96ea('0x4')]('star',_0x96ea('0x5')),'defaultValue':_0x96ea('0x6')},'ratingMessage':{'type':Sequelize[_0x96ea('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x96ea('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x96ea('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x96ea('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x96ea('0x8')]},'browserVersion':{'type':Sequelize[_0x96ea('0x8')]},'osName':{'type':Sequelize[_0x96ea('0x8')]},'osVersion':{'type':Sequelize[_0x96ea('0x8')]},'deviceModel':{'type':Sequelize[_0x96ea('0x8')]},'deviceVendor':{'type':Sequelize[_0x96ea('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x96ea('0x7')]},'customerIp':{'type':Sequelize[_0x96ea('0x8')]},'formData':{'type':Sequelize[_0x96ea('0x7')](_0x96ea('0x9'))},'read1stAt':{'type':Sequelize[_0x96ea('0xa')]},'lastMsgAt':{'type':Sequelize[_0x96ea('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x96ea('0x4')]('in',_0x96ea('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x96ea('0x8')]},'customerPort':{'type':Sequelize[_0x96ea('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7af2=['out','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE'];(function(_0xbf54aa,_0x242ccf){var _0x5a7478=function(_0x3eb1d1){while(--_0x3eb1d1){_0xbf54aa['push'](_0xbf54aa['shift']());}};_0x5a7478(++_0x242ccf);}(_0x7af2,0x119));var _0x27af=function(_0x22d6f8,_0x4bbab4){_0x22d6f8=_0x22d6f8-0x0;var _0xdff824=_0x7af2[_0x22d6f8];return _0xdff824;};'use strict';var Sequelize=require('sequelize');module[_0x27af('0x0')]={'closed':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x27af('0x2')]},'ratingType':{'type':Sequelize[_0x27af('0x3')]('star',_0x27af('0x4')),'defaultValue':_0x27af('0x5')},'ratingMessage':{'type':Sequelize[_0x27af('0x6')]},'pathTranscript':{'type':Sequelize[_0x27af('0x6')]},'mailTranscript':{'type':Sequelize[_0x27af('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x27af('0x8')]},'disposition':{'type':Sequelize[_0x27af('0x7')]},'secondDisposition':{'type':Sequelize[_0x27af('0x7')]},'thirdDisposition':{'type':Sequelize[_0x27af('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x27af('0x7')]},'browserVersion':{'type':Sequelize[_0x27af('0x7')]},'osName':{'type':Sequelize[_0x27af('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x27af('0x7')]},'deviceVendor':{'type':Sequelize[_0x27af('0x7')]},'deviceType':{'type':Sequelize[_0x27af('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x27af('0x7')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x27af('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x27af('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x27af('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ca91e81..a2b294f 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 _0x12f8=['follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','originalname','basename','file','filename','type','mimetype','attachmentDownload','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','server/files/chat/upload/','format','now','pathTranscript','User','ChatWebsite','ContactId','Messages','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','omit','getMessages','keys','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','includeAll','findAll','rows','getMyMessages','includeAgent','push','setTags','ids','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','createdAt','Owner','mkdirSync','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','unlinkSync','rimraf','zip-dir','request-promise','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','limit','undefined','offset','Content-Range','update','destroy','stack','name','merge','body','contact','agent','interaction','account','map','rawAttributes','key','chat','query','user','show','params','model','ChatInteraction','filters','intersection','attributes','fields','length','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull'];(function(_0x81024b,_0x1437bf){var _0x4ee29c=function(_0x3dc297){while(--_0x3dc297){_0x81024b['push'](_0x81024b['shift']());}};_0x4ee29c(++_0x1437bf);}(_0x12f8,0x7e));var _0x812f=function(_0x19feac,_0x65a150){_0x19feac=_0x19feac-0x0;var _0xa67fa=_0x12f8[_0x19feac];return _0xa67fa;};'use strict';var rimraf=require(_0x812f('0x0'));var zipdir=require(_0x812f('0x1'));var rp=require(_0x812f('0x2'));var moment=require(_0x812f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x812f('0x4'));var ejs=require(_0x812f('0x5'));var fs=require('fs');var _=require(_0x812f('0x6'));var Redis=require('ioredis');var interaction=require(_0x812f('0x7'));var qs=require(_0x812f('0x8'));var pdf=require(_0x812f('0x9'));var logger=require(_0x812f('0xa'))(_0x812f('0xb'));var config=require('../../config/environment');var db=require(_0x812f('0xc'))['db'];config['redis']=_['defaults'](config[_0x812f('0xd')],{'host':_0x812f('0xe'),'port':0x18eb});var socket=require(_0x812f('0xf'))(new Redis(config[_0x812f('0xd')]));require(_0x812f('0x10'))['register'](socket);var jayson=require(_0x812f('0x11'));var client=jayson[_0x812f('0x12')]['http']({'port':0x232b});var client9004=jayson[_0x812f('0x12')][_0x812f('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x104c22,_0x14103f,_0x102d1e,_0x25bb21){return new BPromise(function(_0x1adb53,_0xd468e3){var _0x2d8345=_0x25bb21||client;return _0x2d8345[_0x812f('0x14')](_0x104c22,_0x102d1e)[_0x812f('0x15')](function(_0xcb6e5c){logger['info'](_0x812f('0x16'),_0x14103f,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x14103f,_0x812f('0x17'),JSON[_0x812f('0x18')](_0xcb6e5c));if(_0xcb6e5c[_0x812f('0x19')]){if(_0xcb6e5c[_0x812f('0x19')]['code']===0x1f4){logger['error'](_0x812f('0x16'),_0x14103f,_0xcb6e5c[_0x812f('0x19')][_0x812f('0x1a')]);return _0xd468e3(_0xcb6e5c[_0x812f('0x19')][_0x812f('0x1a')]);}logger[_0x812f('0x19')](_0x812f('0x16'),_0x14103f,_0xcb6e5c[_0x812f('0x19')]['message']);return _0x1adb53(_0xcb6e5c[_0x812f('0x19')][_0x812f('0x1a')]);}else{logger[_0x812f('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x14103f,_0x812f('0x17'));_0x1adb53(_0xcb6e5c[_0x812f('0x1c')][_0x812f('0x1a')]);}})[_0x812f('0x1d')](function(_0x111807){logger['error'](_0x812f('0x16'),_0x14103f,_0x111807);_0xd468e3(_0x111807);});});}function respondWithStatusCode(_0x5737e8,_0x41aef7){_0x41aef7=_0x41aef7||0xcc;return function(_0x299924){if(_0x299924){return _0x5737e8[_0x812f('0x1e')](_0x41aef7);}return _0x5737e8[_0x812f('0x1f')](_0x41aef7)['end']();};}function respondWithResult(_0x58e1f7,_0xd95934){_0xd95934=_0xd95934||0xc8;return function(_0x54288b){if(_0x54288b){return _0x58e1f7[_0x812f('0x1f')](_0xd95934)[_0x812f('0x20')](_0x54288b);}};}function respondWithFilteredResult(_0x13de31,_0x495c00){return function(_0x4b69d0){if(_0x4b69d0){var _0x50de96=typeof _0x495c00['offset']==='undefined'&&typeof _0x495c00[_0x812f('0x21')]===_0x812f('0x22');var _0x4adf7a=_0x4b69d0['count'];var _0x1f86b0=_0x50de96?0x0:_0x495c00[_0x812f('0x23')];var _0x115d32=_0x50de96?_0x4b69d0['count']:_0x495c00[_0x812f('0x23')]+_0x495c00[_0x812f('0x21')];var _0x742684;if(_0x115d32>=_0x4adf7a){_0x115d32=_0x4adf7a;_0x742684=0xc8;}else{_0x742684=0xce;}_0x13de31[_0x812f('0x1f')](_0x742684);return _0x13de31['set'](_0x812f('0x24'),_0x1f86b0+'-'+_0x115d32+'/'+_0x4adf7a)[_0x812f('0x20')](_0x4b69d0);}return null;};}function saveUpdates(_0x28f018){return function(_0x40292d){if(_0x40292d){return _0x40292d[_0x812f('0x25')](_0x28f018)[_0x812f('0x15')](function(_0x105914){return _0x105914;});}return null;};}function removeEntity(_0x49deae){return function(_0x5a61f1){if(_0x5a61f1){return _0x5a61f1[_0x812f('0x26')]()[_0x812f('0x15')](function(){_0x49deae[_0x812f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x535514){return function(_0x2a6f12){if(!_0x2a6f12){_0x535514['sendStatus'](0x194);}return _0x2a6f12;};}function handleError(_0x31c0d8,_0x4870b4){_0x4870b4=_0x4870b4||0x1f4;return function(_0x188ee6){logger[_0x812f('0x19')](_0x188ee6[_0x812f('0x27')]);if(_0x188ee6[_0x812f('0x28')]){delete _0x188ee6[_0x812f('0x28')];}_0x31c0d8[_0x812f('0x1f')](_0x4870b4)['send'](_0x188ee6);};}function getMustacheRender(_0xc6ace3,_0x4ef46f){return Mustache['render'](_0xc6ace3,_[_0x812f('0x29')](_0x4ef46f[_0x812f('0x2a')],{'contact':_0x4ef46f[_0x812f('0x2b')],'message':_0x4ef46f[_0x812f('0x1a')],'agent':_0x4ef46f[_0x812f('0x2c')],'interaction':_0x4ef46f[_0x812f('0x2d')],'account':_0x4ef46f[_0x812f('0x2e')]}))||'';}exports['index']=function(_0x193db7,_0x4abff3){var _0x2eef35={};var _0x4eb026=_[_0x812f('0x2f')](db['ChatInteraction'][_0x812f('0x30')],function(_0x35e9a2){return{'name':_0x35e9a2['fieldName'],'type':_0x35e9a2['type'][_0x812f('0x31')]};});_0x2eef35=qs['getOptions'](_0x4eb026,_0x193db7);return interaction['findAll'](_0x812f('0x32'),_0x193db7[_0x812f('0x33')],_0x193db7[_0x812f('0x34')],_0x2eef35,_0x4eb026)[_0x812f('0x15')](respondWithFilteredResult(_0x4abff3,_0x2eef35))[_0x812f('0x1d')](handleError(_0x4abff3,null));};exports[_0x812f('0x35')]=function(_0x202614,_0x57ebc6){var _0x57c27b={'raw':![],'where':{'id':_0x202614[_0x812f('0x36')]['id']}},_0xbad942={};_0xbad942[_0x812f('0x37')]=_['keys'](db[_0x812f('0x38')]['rawAttributes']);_0xbad942['query']=_['keys'](_0x202614[_0x812f('0x33')]);_0xbad942[_0x812f('0x39')]=_[_0x812f('0x3a')](_0xbad942[_0x812f('0x37')],_0xbad942['query']);_0x57c27b[_0x812f('0x3b')]=_[_0x812f('0x3a')](_0xbad942[_0x812f('0x37')],qs[_0x812f('0x3c')](_0x202614[_0x812f('0x33')][_0x812f('0x3c')]));_0x57c27b[_0x812f('0x3b')]=_0x57c27b['attributes'][_0x812f('0x3d')]?_0x57c27b[_0x812f('0x3b')]:_0xbad942['model'];if(_0x202614[_0x812f('0x33')]['includeAll']){_0x57c27b[_0x812f('0x3e')]=[{'all':!![]}];}_0x57c27b=_['merge']({},_0x57c27b,_0x202614[_0x812f('0x3f')]);return db[_0x812f('0x38')][_0x812f('0x40')](_0x57c27b)['then'](handleEntityNotFound(_0x57ebc6,null))[_0x812f('0x15')](respondWithResult(_0x57ebc6,null))[_0x812f('0x1d')](handleError(_0x57ebc6,null));};exports[_0x812f('0x41')]=function(_0x41abf5,_0x38dd32){return db[_0x812f('0x38')]['create'](_0x41abf5[_0x812f('0x2a')],{})[_0x812f('0x15')](respondWithResult(_0x38dd32,0xc9))['catch'](handleError(_0x38dd32,null));};exports[_0x812f('0x25')]=function(_0x41e700,_0xfff620){if(_0x41e700['body']['id']){delete _0x41e700[_0x812f('0x2a')]['id'];}return db[_0x812f('0x38')][_0x812f('0x40')]({'where':{'id':_0x41e700[_0x812f('0x36')]['id']}})[_0x812f('0x15')](handleEntityNotFound(_0xfff620,null))['then'](saveUpdates(_0x41e700[_0x812f('0x2a')],null))[_0x812f('0x15')](respondWithResult(_0xfff620,null))['catch'](handleError(_0xfff620,null));};exports['destroy']=function(_0x3353d7,_0x38cc08){return db[_0x812f('0x38')][_0x812f('0x40')]({'where':{'id':_0x3353d7['params']['id']}})[_0x812f('0x15')](handleEntityNotFound(_0x38cc08,null))[_0x812f('0x15')](removeEntity(_0x38cc08,null))[_0x812f('0x1d')](handleError(_0x38cc08,null));};exports[_0x812f('0x42')]=function(_0x2e93c6,_0x3ca3bc){return db['ChatInteraction'][_0x812f('0x42')]()[_0x812f('0x15')](respondWithResult(_0x3ca3bc,null))[_0x812f('0x1d')](handleError(_0x3ca3bc,null));};exports[_0x812f('0x43')]=function(_0xd0e13e,_0x5739fe){var _0x19dc62=_0xd0e13e[_0x812f('0x36')]['id'];var _0x69a65d;var _0x2d187f;var _0x5074b4;return db[_0x812f('0x38')][_0x812f('0x44')]({'where':{'id':_0x19dc62}})[_0x812f('0x15')](function(_0xf44df6){_0x69a65d=_0xf44df6;return db['ChatWebsite'][_0x812f('0x44')]({'where':{'id':_0xf44df6[_0x812f('0x45')]},'attributes':['id',_0x812f('0x46'),_0x812f('0x47'),'vidaooTopic',_0x812f('0x48'),'vidaooMetadata'],'raw':!![]});})[_0x812f('0x15')](function(_0x7bba02){if(_0x7bba02&&_0x7bba02[_0x812f('0x46')]&&_0x7bba02[_0x812f('0x47')]){_0x2d187f=_0x7bba02;var _0x221601={'interaction':{'id':_0x19dc62},'agent':{'id':_0xd0e13e[_0x812f('0x34')]['id'],'name':_0xd0e13e[_0x812f('0x34')][_0x812f('0x28')],'fullname':_0xd0e13e[_0x812f('0x34')]['fullname'],'email':_0xd0e13e[_0x812f('0x34')][_0x812f('0x49')]},'contact':_0xd0e13e[_0x812f('0x2a')][_0x812f('0x2b')],'account':_0xd0e13e[_0x812f('0x2a')][_0x812f('0x2e')]};var _0x370565={'rejectUnauthorized':![],'method':_0x812f('0x4a'),'url':_0x812f('0x4b'),'headers':{'X-APIKEY':_0x7bba02[_0x812f('0x46')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xd0e13e['user'][_0x812f('0x49')]],'buttons':null,'topic':_0x2d187f[_0x812f('0x4c')],'note':_[_0x812f('0x4d')](_0x2d187f[_0x812f('0x48')])?null:getMustacheRender(_0x2d187f['vidaooNote'],_0x221601),'metadata':null},'redirect':_0x812f('0x4e'),'json':!![]};try{if(!_[_0x812f('0x4d')](_0x2d187f[_0x812f('0x4f')])){var _0x3253b0=getMustacheRender(_0x2d187f[_0x812f('0x4f')],_0x221601);var _0x505169=JSON[_0x812f('0x50')](_0x3253b0);_0x370565[_0x812f('0x2a')][_0x812f('0x51')]=_0x505169;}}catch(_0x5c1222){throw new db[(_0x812f('0x52'))][(_0x812f('0x53'))](_0x812f('0x54'));}return rp(_0x370565);}else{throw new db[(_0x812f('0x52'))][(_0x812f('0x53'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x812f('0x15')](function(_0x36d756){_0x5074b4=_0x36d756;if(_0x5074b4['id']){var _0x5cb4ee={'body':_0x5074b4['join_url'],'ChatWebsiteId':_0x2d187f['id'],'ChatInteractionId':_0x69a65d['id'],'direction':_0x812f('0x55'),'UserId':_0xd0e13e[_0x812f('0x34')]['id']};return db[_0x812f('0x56')][_0x812f('0x41')](_0x5cb4ee,{});}else{throw new db['Sequelize'][(_0x812f('0x53'))](_0x812f('0x57'));}})[_0x812f('0x15')](function(){return _0x69a65d[_0x812f('0x58')]({'vidaooSessionId':_0x5074b4['id']});})[_0x812f('0x15')](respondWithResult(_0x5739fe,null))[_0x812f('0x1d')](handleError(_0x5739fe,null));};exports['customUpdate']=function(_0x1c1282,_0x5ee581){if(_0x1c1282['body']['id']){delete _0x1c1282['body']['id'];}return db['ChatInteraction'][_0x812f('0x40')]({'where':{'id':_0x1c1282[_0x812f('0x36')]['id']},'include':[{'model':db[_0x812f('0x59')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x5ee581,null))['then'](saveUpdates(_0x1c1282[_0x812f('0x2a')],null))['then'](respondWithResult(_0x5ee581,null))[_0x812f('0x1d')](handleError(_0x5ee581,null));};exports['abandon']=function(_0x145a11,_0x331370){if(_0x145a11['body']['id']){delete _0x145a11[_0x812f('0x2a')]['id'];}return db[_0x812f('0x38')][_0x812f('0x40')]({'where':{'id':_0x145a11[_0x812f('0x36')]['id']}})[_0x812f('0x15')](function(_0x502446){if(!_0x502446){logger[_0x812f('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x812f('0x5a'));_0x331370[_0x812f('0x1e')](0x194);}else{if(_0x502446[_0x812f('0x5b')]){throw new db[(_0x812f('0x52'))][(_0x812f('0x53'))](_0x812f('0x5c'));}}return _0x502446;})[_0x812f('0x15')](function(_0x3f0573){if(_0x3f0573){return _0x3f0573[_0x812f('0x25')]({'closed':_0x145a11[_0x812f('0x2a')][_0x812f('0x5d')],'disposition':_0x145a11[_0x812f('0x2a')][_0x812f('0x5e')]})[_0x812f('0x15')](function(_0x338998){return _0x338998;});}})[_0x812f('0x15')](function(){return respondWithRpcPromise(_0x812f('0x5f'),_0x812f('0x60'),_0x145a11[_0x812f('0x2a')],client9004);})['then'](respondWithResult(_0x331370,null))[_0x812f('0x1d')](handleError(_0x331370,null));};exports[_0x812f('0x61')]=function(_0x2d5035,_0x4b293c){_0x2d5035[_0x812f('0x2a')][_0x812f('0x28')]=_0x2d5035['file'][_0x812f('0x62')];_0x2d5035['body'][_0x812f('0x63')]=_0x2d5035[_0x812f('0x64')][_0x812f('0x65')];_0x2d5035[_0x812f('0x2a')][_0x812f('0x66')]=_0x2d5035[_0x812f('0x64')][_0x812f('0x67')];return db['Attachment'][_0x812f('0x41')](_0x2d5035['body'])[_0x812f('0x15')](respondWithResult(_0x4b293c,0xc9))[_0x812f('0x1d')](handleError(_0x4b293c,null));};exports[_0x812f('0x68')]=function(_0x585a3a,_0x312235){return db['ChatInteraction'][_0x812f('0x44')]({'where':{'id':_0x585a3a[_0x812f('0x36')]['id']},'raw':!![]})[_0x812f('0x15')](handleEntityNotFound(_0x312235,null))[_0x812f('0x15')](function(_0x4c68c4){if(_0x4c68c4){if(_0x4c68c4['closed']){return _0x312235[_0x812f('0x1f')](0x193)[_0x812f('0x20')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x812f('0x44')]({'where':{'id':_0x585a3a[_0x812f('0x33')]['attachId']},'raw':!![]})[_0x812f('0x15')](handleEntityNotFound(_0x312235,null));}})[_0x812f('0x15')](function(_0x47be9){if(_0x47be9){var _0x12b2bc=_0x47be9[_0x812f('0x69')]!==null;var _0x23c9a5=path[_0x812f('0x6a')](config[_0x812f('0x6b')],_0x812f('0x6c'));if(_0x12b2bc){_0x23c9a5=path[_0x812f('0x6a')](_0x23c9a5,'offline-chat/');}var _0x1bb02c=path[_0x812f('0x6a')](_0x23c9a5,_0x47be9[_0x812f('0x63')]);return _0x312235[_0x812f('0x6d')](_0x1bb02c);}})['catch'](handleError(_0x312235,null));};exports[_0x812f('0x6e')]=function(_0x29e3c3,_0x307157){var _0x3fd50d=null;var _0x1354c9=null;var _0x15f162=null;if(_0x29e3c3[_0x812f('0x2a')]['id']){delete _0x29e3c3['body']['id'];}if(_0x29e3c3[_0x812f('0x2a')]['mailTranscript']){_0x15f162=path[_0x812f('0x6a')](config['root'],_0x812f('0x6f'),util[_0x812f('0x70')]('transcript-%s.txt',Date[_0x812f('0x71')]()));_0x29e3c3['body'][_0x812f('0x72')]=_0x15f162;}return db['ChatInteraction'][_0x812f('0x40')]({'where':{'id':_0x29e3c3[_0x812f('0x36')]['id']},'include':[{'model':db[_0x812f('0x56')],'as':'Messages','include':[{'model':db[_0x812f('0x73')],'as':'User'}]}]})[_0x812f('0x15')](handleEntityNotFound(_0x307157,null))[_0x812f('0x15')](saveUpdates(_0x29e3c3['body'],null))['then'](function(_0xbbade9){if(_0xbbade9){_0x3fd50d=_0xbbade9;return db[_0x812f('0x74')][_0x812f('0x40')]({'where':{'id':_0x3fd50d[_0x812f('0x45')]}});}})[_0x812f('0x15')](function(_0x22f040){if(_0x22f040){_0x1354c9=_0x22f040;return db['CmContact'][_0x812f('0x40')]({'where':{'id':_0x3fd50d[_0x812f('0x75')]}});}})[_0x812f('0x15')](function(_0x45d25d){if(_0x45d25d){if(_0x15f162){var _0x3f72ef=null;for(var _0x364af7=0x1;_0x364af7<_0x3fd50d[_0x812f('0x76')]['length'];++_0x364af7){_0x3f72ef=_0x3fd50d['Messages'][_0x364af7];var _0x5ccb93=_0x3f72ef[_0x812f('0x5b')]?util[_0x812f('0x70')](_0x812f('0x77'),_0x1354c9[_0x812f('0x78')],_0x3f72ef[_0x812f('0x5b')]):_0x812f('0x79');var _0x230338=_0x29e3c3[_0x812f('0x2a')][_0x812f('0x7a')]||util[_0x812f('0x70')](_0x812f('0x77'),'Visitor',_0x3f72ef[_0x812f('0x75')]);switch(_0x1354c9[_0x812f('0x7b')]){case _0x812f('0x7c'):_0x5ccb93=_0x3f72ef[_0x812f('0x5b')]?util[_0x812f('0x70')](_0x812f('0x77'),_0x1354c9[_0x812f('0x78')],_0x3f72ef[_0x812f('0x5b')]):'System';break;case _0x812f('0x7d'):_0x5ccb93=_0x3f72ef[_0x812f('0x5b')]?_0x3f72ef['User']['alias']||_0x3f72ef['User'][_0x812f('0x7e')]:_0x812f('0x79');break;case _0x812f('0x7f'):_0x5ccb93=_0x3f72ef[_0x812f('0x5b')]?_0x3f72ef[_0x812f('0x73')][_0x812f('0x7e')]:_0x812f('0x79');break;default:_0x5ccb93=_0x3f72ef[_0x812f('0x5b')]?util[_0x812f('0x70')](_0x812f('0x77'),_0x1354c9[_0x812f('0x78')],_0x3f72ef[_0x812f('0x5b')]):'System';}var _0x28af1e=util[_0x812f('0x70')](_0x812f('0x80'),moment(_0x3f72ef['createdAt'])[_0x812f('0x70')](_0x812f('0x81')),_0x3f72ef[_0x812f('0x82')]==='in'?_0x230338:_0x5ccb93,_0x3f72ef[_0x812f('0x2a')]);if(!_0x3f72ef[_0x812f('0x83')]){fs[_0x812f('0x84')](_0x15f162,_0x28af1e);}}return db[_0x812f('0x85')][_0x812f('0x44')]({'where':{'service':!![]},'include':[{'model':db[_0x812f('0x86')],'as':_0x812f('0x87'),'raw':!![],'include':[{'model':db[_0x812f('0x88')],'as':_0x812f('0x88'),'raw':!![]}]}]});}}})[_0x812f('0x15')](function(_0xfeac33){if(!_0xfeac33||!_0xfeac33[_0x812f('0x87')]||!_0x29e3c3[_0x812f('0x2a')])return _0x3fd50d;var _0x197530=_0xfeac33[_0x812f('0x89')]();return respondWithRpcPromise(_0x812f('0x8a'),_0x812f('0x8b'),{'account':_0x197530,'message':{'from':util[_0x812f('0x70')](_0x812f('0x8c'),_0xfeac33[_0x812f('0x28')],_0xfeac33['email']||_0xfeac33[_0x812f('0x87')]['user']),'to':_0x29e3c3[_0x812f('0x2a')][_0x812f('0x8d')],'subject':_0x812f('0x8e'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29e3c3[_0x812f('0x2a')]['mailTranscript']),'attachments':[{'path':_0x15f162}]}})['then'](function(){return _0x3fd50d;})[_0x812f('0x1d')](function(_0x4f52b6){logger['error'](_0x4f52b6);});})['then'](respondWithStatusCode(_0x307157,0xc8))[_0x812f('0x1d')](handleError(_0x307157,null));};exports[_0x812f('0x8f')]=function(_0x322d05,_0x3e4ea2){return db[_0x812f('0x56')][_0x812f('0x40')]({'where':{'id':_0x322d05[_0x812f('0x36')]['id']}})['then'](handleEntityNotFound(_0x3e4ea2,null))['then'](function(_0x552e56){if(_0x552e56){return _0x552e56[_0x812f('0x8f')](_0x322d05[_0x812f('0x2a')]['ids'],_[_0x812f('0x90')](_0x322d05[_0x812f('0x2a')],['ids','id'])||{});}})[_0x812f('0x15')](respondWithResult(_0x3e4ea2,null))[_0x812f('0x1d')](handleError(_0x3e4ea2,null));};exports[_0x812f('0x91')]=function(_0x156339,_0x114fe0){var _0x2eaad1={'raw':![],'where':{}};var _0x26fa0a={};var _0x596058={'count':0x0,'rows':[]};return db[_0x812f('0x38')][_0x812f('0x44')]({'where':{'id':_0x156339[_0x812f('0x36')]['id']}})[_0x812f('0x15')](handleEntityNotFound(_0x114fe0,null))['then'](function(_0x16364a){if(_0x16364a){_0x26fa0a['model']=_[_0x812f('0x92')](db[_0x812f('0x56')]['rawAttributes']);_0x26fa0a[_0x812f('0x33')]=_[_0x812f('0x92')](_0x156339['query']);_0x26fa0a[_0x812f('0x39')]=_['intersection'](_0x26fa0a['model'],_0x26fa0a[_0x812f('0x33')]);_0x2eaad1[_0x812f('0x3b')]=_[_0x812f('0x3a')](_0x26fa0a[_0x812f('0x37')],qs['fields'](_0x156339['query'][_0x812f('0x3c')]));_0x2eaad1['attributes']=_0x2eaad1[_0x812f('0x3b')][_0x812f('0x3d')]?_0x2eaad1['attributes']:_0x26fa0a[_0x812f('0x37')];if(!_0x156339[_0x812f('0x33')][_0x812f('0x93')]('nolimit')){_0x2eaad1[_0x812f('0x21')]=qs[_0x812f('0x21')](_0x156339[_0x812f('0x33')]['limit']);_0x2eaad1[_0x812f('0x23')]=qs[_0x812f('0x23')](_0x156339[_0x812f('0x33')][_0x812f('0x23')]);}_0x2eaad1[_0x812f('0x94')]=qs[_0x812f('0x95')](_0x156339[_0x812f('0x33')][_0x812f('0x95')]);_0x2eaad1[_0x812f('0x96')]=qs[_0x812f('0x39')](_[_0x812f('0x97')](_0x156339[_0x812f('0x33')],_0x26fa0a[_0x812f('0x39')]));_0x2eaad1[_0x812f('0x96')][_0x812f('0x98')]=_0x16364a['id'];if(_0x156339['query'][_0x812f('0x99')]){_0x2eaad1[_0x812f('0x96')]=_[_0x812f('0x29')](_0x2eaad1[_0x812f('0x96')],{'$or':_[_0x812f('0x2f')](_0x2eaad1[_0x812f('0x3b')],function(_0x35de77){var _0x3e446e={};_0x3e446e[_0x35de77]={'$like':'%'+_0x156339[_0x812f('0x33')][_0x812f('0x99')]+'%'};return _0x3e446e;})});}if(_0x156339[_0x812f('0x33')][_0x812f('0x9a')]){var _0x370a75=_0x156339[_0x812f('0x33')][_0x812f('0x9a')][_0x812f('0x9b')](',');var _0x67a072={};_0x67a072[_0x370a75[0x0]]={'$gte':moment(_0x370a75[0x1])['format'](_0x812f('0x9c'))};_0x2eaad1[_0x812f('0x96')]=_['merge'](_0x2eaad1[_0x812f('0x96')],_0x67a072);}_0x2eaad1=_[_0x812f('0x29')]({},_0x2eaad1,_0x156339[_0x812f('0x3f')]);return db[_0x812f('0x56')][_0x812f('0x9d')]({'where':_0x2eaad1[_0x812f('0x96')]})[_0x812f('0x15')](function(_0x238ea1){_0x596058[_0x812f('0x9d')]=_0x238ea1;if(_0x156339['query'][_0x812f('0x9e')]){_0x2eaad1[_0x812f('0x3e')]=[{'all':!![]}];}return db[_0x812f('0x56')][_0x812f('0x9f')](_0x2eaad1);})['then'](function(_0x2f9360){_0x596058[_0x812f('0xa0')]=_0x2f9360;return _0x596058;});}})['then'](respondWithFilteredResult(_0x114fe0,_0x2eaad1))['catch'](handleError(_0x114fe0,null));};exports[_0x812f('0xa1')]=function(_0x31ad25,_0x38e7b2){var _0x31e0c5={'where':{}},_0x325e36={},_0x574b27={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x812f('0x44')]({'where':{'id':_0x31ad25['params']['id']}})[_0x812f('0x15')](handleEntityNotFound(_0x38e7b2,null))[_0x812f('0x15')](function(_0x5a992a){if(_0x5a992a){_0x325e36[_0x812f('0x37')]=_['keys'](db['ChatMessage'][_0x812f('0x30')]);_0x325e36[_0x812f('0x33')]=_[_0x812f('0x92')](_0x31ad25[_0x812f('0x33')]);_0x325e36['filters']=_[_0x812f('0x3a')](_0x325e36[_0x812f('0x37')],_0x325e36[_0x812f('0x33')]);_0x31e0c5[_0x812f('0x3b')]=_['intersection'](_0x325e36[_0x812f('0x37')],qs[_0x812f('0x3c')](_0x31ad25['query'][_0x812f('0x3c')]));_0x31e0c5[_0x812f('0x3b')]=_0x31e0c5[_0x812f('0x3b')][_0x812f('0x3d')]?_0x31e0c5['attributes']:_0x325e36['model'];if(!_0x31ad25[_0x812f('0x33')][_0x812f('0x93')]('nolimit')){_0x31e0c5['limit']=qs[_0x812f('0x21')](_0x31ad25[_0x812f('0x33')][_0x812f('0x21')]);_0x31e0c5['offset']=qs[_0x812f('0x23')](_0x31ad25['query'][_0x812f('0x23')]);}_0x31e0c5[_0x812f('0x94')]=qs[_0x812f('0x95')](_0x31ad25['query'][_0x812f('0x95')]);_0x31e0c5['where']=qs['filters'](_[_0x812f('0x97')](_0x31ad25['query'],_0x325e36[_0x812f('0x39')]));_0x31e0c5[_0x812f('0x96')][_0x812f('0x98')]=_0x5a992a['id'];if(_0x31ad25[_0x812f('0x33')][_0x812f('0x99')]){_0x31e0c5[_0x812f('0x96')]=_[_0x812f('0x29')](_0x31e0c5[_0x812f('0x96')],{'$or':_[_0x812f('0x2f')](_0x31e0c5[_0x812f('0x3b')],function(_0x40d6ad){var _0x2e6fff={};_0x2e6fff[_0x40d6ad]={'$like':'%'+_0x31ad25['query']['filter']+'%'};return _0x2e6fff;})});}_0x31e0c5[_0x812f('0x96')]['secret']=![];if(_0x31ad25[_0x812f('0x33')]['id']){_0x31e0c5[_0x812f('0x96')]['id']={'$gt':_0x31ad25[_0x812f('0x33')]['id']};}_0x31e0c5=_['merge']({},_0x31e0c5,_0x31ad25[_0x812f('0x3f')]);return db[_0x812f('0x56')][_0x812f('0x9d')]({'where':_0x31e0c5[_0x812f('0x96')]})['then'](function(_0x46f22a){_0x574b27[_0x812f('0x9d')]=_0x46f22a;_0x31e0c5[_0x812f('0x3e')]=[];if(_0x31ad25['query'][_0x812f('0xa2')]){_0x31e0c5[_0x812f('0x3e')][_0x812f('0xa3')]({'model':db[_0x812f('0x73')],'as':_0x812f('0x73'),'attributes':['id',_0x812f('0x7e'),'alias']});}if(_0x31ad25[_0x812f('0x33')][_0x812f('0x9e')]){_0x31e0c5[_0x812f('0x3e')]=[{'all':!![]}];}return db['ChatMessage'][_0x812f('0x9f')](_0x31e0c5);})[_0x812f('0x15')](function(_0x468004){_0x574b27[_0x812f('0xa0')]=_0x468004;return _0x574b27;});}})[_0x812f('0x15')](respondWithFilteredResult(_0x38e7b2,_0x31e0c5))['catch'](handleError(_0x38e7b2,null));};exports['addTags']=function(_0x27ceb0,_0xd9780c){return db[_0x812f('0x38')]['find']({'where':{'id':_0x27ceb0[_0x812f('0x36')]['id']}})[_0x812f('0x15')](handleEntityNotFound(_0xd9780c,null))[_0x812f('0x15')](function(_0x275465){if(_0x275465){return _0x275465[_0x812f('0xa4')](_0x27ceb0[_0x812f('0x2a')][_0x812f('0xa5')],_[_0x812f('0x90')](_0x27ceb0[_0x812f('0x2a')],['ids','id'])||{})[_0x812f('0xa6')](function(){return db[_0x812f('0xa7')]['findAll']({'attributes':['id',_0x812f('0x28'),_0x812f('0xa8')],'where':{'id':_0x27ceb0[_0x812f('0x2a')][_0x812f('0xa5')]}});})['then'](function(_0x428709){socket[_0x812f('0xa9')](_0x812f('0xaa'),{'id':Number(_0x27ceb0[_0x812f('0x36')]['id']),'tags':_0x428709||[]});return{'id':Number(_0x27ceb0[_0x812f('0x36')]['id']),'tags':_0x428709||[]};});}})['then'](respondWithResult(_0xd9780c,null))[_0x812f('0x1d')](handleError(_0xd9780c,null));};exports[_0x812f('0xab')]=function(_0x1ff1fb,_0x16b39c){return db[_0x812f('0x38')]['find']({'where':{'id':_0x1ff1fb[_0x812f('0x36')]['id']}})[_0x812f('0x15')](handleEntityNotFound(_0x16b39c,null))[_0x812f('0x15')](function(_0x24a0b3){if(_0x24a0b3){return _0x24a0b3[_0x812f('0xab')](_0x1ff1fb[_0x812f('0x33')]['ids']);}})[_0x812f('0x15')](respondWithStatusCode(_0x16b39c,null))['catch'](handleError(_0x16b39c,null));};exports[_0x812f('0x6d')]=function(_0x270d41,_0x550169){var _0x4bd425=moment()['unix']()[_0x812f('0xac')]();var _0x550878=path[_0x812f('0x6a')](config['root'],_0x812f('0xad'),_0x812f('0xae'),_0x812f('0xaf'));var _0x4eedda=path[_0x812f('0x6a')](config[_0x812f('0x6b')],_0x812f('0xad'),'files',_0x812f('0xb0'));var _0x9237a4=path[_0x812f('0x6a')](_0x550878,_0x4bd425);var _0xac8e3e=util[_0x812f('0x70')](_0x812f('0xb1'),_0x270d41[_0x812f('0x36')]['id'],_0x4bd425);var _0x47b925=path[_0x812f('0x6a')](_0x550878,_0xac8e3e);var _0x2a43d1=[];_0x2a43d1[_0x812f('0xa3')]({'model':db[_0x812f('0x73')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2a43d1[_0x812f('0xa3')]({'model':db[_0x812f('0x59')],'as':_0x812f('0xb2'),'attributes':['id',_0x812f('0xb3'),_0x812f('0xb4')],'raw':!![]});if(_0x270d41[_0x812f('0x33')][_0x812f('0xb0')]){_0x2a43d1[_0x812f('0xa3')]({'model':db[_0x812f('0xb5')],'as':_0x812f('0xb5'),'raw':!![]});}var _0x81b395=[{'model':db[_0x812f('0x56')],'as':_0x812f('0x76'),'attributes':['id',_0x812f('0x2a'),_0x812f('0xb6'),'direction',_0x812f('0x83'),'read'],'include':_0x2a43d1}];_0x81b395['push']({'model':db[_0x812f('0x74')],'as':'Account','attributes':['id','name']});_0x81b395[_0x812f('0xa3')]({'model':db['User'],'as':_0x812f('0xb7'),'attributes':['id',_0x812f('0x7e')]});return db[_0x812f('0x38')][_0x812f('0x40')]({'where':{'id':_0x270d41[_0x812f('0x36')]['id']},'include':_0x81b395})[_0x812f('0x15')](handleEntityNotFound(_0x550169,null))[_0x812f('0x15')](function(_0x523498){if(_0x523498){var _0x5205e0=_0x523498['get']({'plain':!![]});fs[_0x812f('0xb8')](_0x9237a4);var _0x32e1c9={'channel':'Chat','account':_0x5205e0[_0x812f('0xb9')][_0x812f('0x28')],'agent':_0x5205e0[_0x812f('0xb7')]?_0x5205e0['Owner'][_0x812f('0x7e')]:_0x812f('0xba'),'createdAt':moment(_0x5205e0[_0x812f('0xb6')])[_0x812f('0x70')](_0x812f('0x9c'))[_0x812f('0xac')](),'closedAt':_0x5205e0['closed']?moment(_0x5205e0[_0x812f('0xbb')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x812f('0xac')]():'','disposition':_0x5205e0[_0x812f('0x5e')],'chatInfo':{'browser':_0x5205e0[_0x812f('0xbc')],'os':_0x5205e0[_0x812f('0xbd')],'referer':_0x5205e0[_0x812f('0xbe')],'customerIp':_0x5205e0[_0x812f('0xbf')],'customerPort':_0x5205e0['customerPort']?_0x5205e0[_0x812f('0xc0')]:'N.A.'},'messages':_(_0x5205e0[_0x812f('0x76')])[_0x812f('0xc1')]()[_0x812f('0x99')]({'secret':![]})[_0x812f('0x2f')](function(_0x266b52){if(_0x266b52['Attachment']){var _0x2ca33d=path[_0x812f('0x6a')](_0x4eedda,_0x266b52[_0x812f('0xb5')][_0x812f('0x63')]);if(fs['existsSync'](_0x2ca33d)){fs[_0x812f('0xc2')](_0x2ca33d)[_0x812f('0xc3')](fs[_0x812f('0xc4')](path[_0x812f('0x6a')](_0x9237a4,_0x266b52[_0x812f('0xb5')]['basename'])));}}return{'date':moment(_0x266b52[_0x812f('0xb6')])[_0x812f('0x70')](_0x812f('0x9c'))[_0x812f('0xac')](),'sender':_0x266b52[_0x812f('0x82')]===_0x812f('0x55')?_0x266b52[_0x812f('0x73')]?_0x266b52['User'][_0x812f('0x7e')]:_0x812f('0x79'):_0x266b52['Contact'][_0x812f('0xb3')]+(_0x266b52['Contact'][_0x812f('0xb4')]?'\x20'+_0x266b52[_0x812f('0xb2')][_0x812f('0xb4')]:''),'body':_0x266b52['Attachment']?_0x266b52[_0x812f('0xb5')][_0x812f('0x63')]:_0x266b52['body'],'direction':_0x266b52['direction']===_0x812f('0x55')?'A':'C','secret':_0x266b52[_0x812f('0x83')],'read':_0x266b52[_0x812f('0xc5')],'attachment':_0x266b52[_0x812f('0xb5')]};})[_0x812f('0xc6')]()};return ejs[_0x812f('0xc7')](path[_0x812f('0x6a')](config[_0x812f('0x6b')],_0x812f('0xad'),_0x812f('0xc8'),_0x812f('0xc9')),{'interaction':_0x32e1c9})[_0x812f('0x15')](function(_0xfcee2c){var _0x18b654=path['join'](_0x9237a4,_0x812f('0xca')+_0x5205e0['id']+'-'+_0x4bd425+'.pdf');var _0x5a5123={'path':_0x18b654,'channel':'Chat','interactionId':_0x5205e0['id']};return pdf['createPdfFromHTML'](_0xfcee2c,_0x5a5123);})[_0x812f('0x15')](function(){return new Promise(function(_0x2875c9,_0x235cd1){zipdir(_0x9237a4,{'saveTo':_0x47b925},function(_0x4c91ab,_0x4232c3){if(_0x4c91ab)return _0x235cd1(_0x4c91ab);return _0x2875c9(_0x4232c3);});})[_0x812f('0x15')](function(){return new BPromise(function(_0x1d9cce,_0x4795f6){rimraf(_0x9237a4,function(_0x30aa7a){if(_0x30aa7a)_0x4795f6(_0x30aa7a);return _0x1d9cce();});});})[_0x812f('0x15')](function(){return _0x550169[_0x812f('0x6d')](_0x47b925,_0xac8e3e,function(_0x556814){if(_0x556814){logger[_0x812f('0x19')]('err',_0x556814);}else{fs[_0x812f('0xcb')](_0x47b925);}});});});}else{return _0x550169['sendStatus'](0xc8);}})['catch'](handleError(_0x550169,null));}; \ No newline at end of file +var _0x3ea5=['agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','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','intersection','hasOwnProperty','nolimit','order','sort','where','filters','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','includeAgent','push','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','firstName','lastName','attachments','createdAt','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','referer','customerPort','tail','existsSync','createReadStream','pipe','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','getOptions','user','catch','show','params','model','keys','query','attributes','fields','length','includeAll','include','merge','options','find','create','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','Sequelize','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','type','Attachment','attachmentDownload','closed','attachId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','CmContact','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias'];(function(_0x491faf,_0x60487e){var _0x10090d=function(_0x594c84){while(--_0x594c84){_0x491faf['push'](_0x491faf['shift']());}};_0x10090d(++_0x60487e);}(_0x3ea5,0x1f3));var _0x53ea=function(_0xaac72c,_0x5d943f){_0xaac72c=_0xaac72c-0x0;var _0x1e7923=_0x3ea5[_0xaac72c];return _0x1e7923;};'use strict';var rimraf=require(_0x53ea('0x0'));var zipdir=require(_0x53ea('0x1'));var rp=require('request-promise');var moment=require(_0x53ea('0x2'));var BPromise=require(_0x53ea('0x3'));var Mustache=require(_0x53ea('0x4'));var util=require(_0x53ea('0x5'));var path=require(_0x53ea('0x6'));var ejs=require(_0x53ea('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x53ea('0x8'));var interaction=require(_0x53ea('0x9'));var qs=require(_0x53ea('0xa'));var pdf=require(_0x53ea('0xb'));var logger=require(_0x53ea('0xc'))(_0x53ea('0xd'));var config=require('../../config/environment');var db=require(_0x53ea('0xe'))['db'];config[_0x53ea('0xf')]=_[_0x53ea('0x10')](config[_0x53ea('0xf')],{'host':_0x53ea('0x11'),'port':0x18eb});var socket=require(_0x53ea('0x12'))(new Redis(config[_0x53ea('0xf')]));require(_0x53ea('0x13'))[_0x53ea('0x14')](socket);var jayson=require(_0x53ea('0x15'));var client=jayson[_0x53ea('0x16')]['http']({'port':0x232b});var client9004=jayson[_0x53ea('0x16')][_0x53ea('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x15d15f,_0x3d7fe6,_0x396f9b,_0x3738e9){return new BPromise(function(_0x2fa6ef,_0x5ee29d){var _0x42fce1=_0x3738e9||client;return _0x42fce1['request'](_0x15d15f,_0x396f9b)[_0x53ea('0x18')](function(_0x57fda6){logger[_0x53ea('0x19')](_0x53ea('0x1a'),_0x3d7fe6,_0x53ea('0x1b'));logger[_0x53ea('0x1c')](_0x53ea('0x1d'),_0x3d7fe6,_0x53ea('0x1b'),JSON[_0x53ea('0x1e')](_0x57fda6));if(_0x57fda6[_0x53ea('0x1f')]){if(_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x20')]===0x1f4){logger[_0x53ea('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x3d7fe6,_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x21')]);return _0x5ee29d(_0x57fda6['error'][_0x53ea('0x21')]);}logger[_0x53ea('0x1f')](_0x53ea('0x1a'),_0x3d7fe6,_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x21')]);return _0x2fa6ef(_0x57fda6[_0x53ea('0x1f')]['message']);}else{logger['info'](_0x53ea('0x1a'),_0x3d7fe6,_0x53ea('0x1b'));_0x2fa6ef(_0x57fda6[_0x53ea('0x22')]['message']);}})['catch'](function(_0x4d8406){logger[_0x53ea('0x1f')](_0x53ea('0x1a'),_0x3d7fe6,_0x4d8406);_0x5ee29d(_0x4d8406);});});}function respondWithStatusCode(_0x2ea8f8,_0x178bbe){_0x178bbe=_0x178bbe||0xcc;return function(_0xdec1e5){if(_0xdec1e5){return _0x2ea8f8[_0x53ea('0x23')](_0x178bbe);}return _0x2ea8f8[_0x53ea('0x24')](_0x178bbe)[_0x53ea('0x25')]();};}function respondWithResult(_0x1f35a6,_0x3a2d16){_0x3a2d16=_0x3a2d16||0xc8;return function(_0x49eb43){if(_0x49eb43){return _0x1f35a6[_0x53ea('0x24')](_0x3a2d16)[_0x53ea('0x26')](_0x49eb43);}};}function respondWithFilteredResult(_0x3652be,_0x5813ca){return function(_0x3de18e){if(_0x3de18e){var _0xac9162=typeof _0x5813ca[_0x53ea('0x27')]===_0x53ea('0x28')&&typeof _0x5813ca[_0x53ea('0x29')]===_0x53ea('0x28');var _0x29be2f=_0x3de18e[_0x53ea('0x2a')];var _0x148c67=_0xac9162?0x0:_0x5813ca[_0x53ea('0x27')];var _0x112243=_0xac9162?_0x3de18e[_0x53ea('0x2a')]:_0x5813ca[_0x53ea('0x27')]+_0x5813ca[_0x53ea('0x29')];var _0x9112d7;if(_0x112243>=_0x29be2f){_0x112243=_0x29be2f;_0x9112d7=0xc8;}else{_0x9112d7=0xce;}_0x3652be['status'](_0x9112d7);return _0x3652be[_0x53ea('0x2b')](_0x53ea('0x2c'),_0x148c67+'-'+_0x112243+'/'+_0x29be2f)[_0x53ea('0x26')](_0x3de18e);}return null;};}function saveUpdates(_0x4c7609){return function(_0x59e42c){if(_0x59e42c){return _0x59e42c['update'](_0x4c7609)[_0x53ea('0x18')](function(_0x43d6db){return _0x43d6db;});}return null;};}function removeEntity(_0x3c6d72){return function(_0x166755){if(_0x166755){return _0x166755[_0x53ea('0x2d')]()['then'](function(){_0x3c6d72[_0x53ea('0x24')](0xcc)[_0x53ea('0x25')]();});}};}function handleEntityNotFound(_0x69c5d6){return function(_0x229848){if(!_0x229848){_0x69c5d6[_0x53ea('0x23')](0x194);}return _0x229848;};}function handleError(_0x3933a4,_0x27a64e){_0x27a64e=_0x27a64e||0x1f4;return function(_0x5f19c6){logger[_0x53ea('0x1f')](_0x5f19c6[_0x53ea('0x2e')]);if(_0x5f19c6[_0x53ea('0x2f')]){delete _0x5f19c6[_0x53ea('0x2f')];}_0x3933a4['status'](_0x27a64e)[_0x53ea('0x30')](_0x5f19c6);};}function getMustacheRender(_0x264bda,_0x56ed2b){return Mustache['render'](_0x264bda,_['merge'](_0x56ed2b[_0x53ea('0x31')],{'contact':_0x56ed2b[_0x53ea('0x32')],'message':_0x56ed2b[_0x53ea('0x21')],'agent':_0x56ed2b[_0x53ea('0x33')],'interaction':_0x56ed2b['interaction'],'account':_0x56ed2b[_0x53ea('0x34')]}))||'';}exports[_0x53ea('0x35')]=function(_0x396feb,_0x297468){var _0x388ccc={};var _0x1ef520=_[_0x53ea('0x36')](db[_0x53ea('0x37')][_0x53ea('0x38')],function(_0x513024){return{'name':_0x513024[_0x53ea('0x39')],'type':_0x513024['type']['key']};});_0x388ccc=qs[_0x53ea('0x3a')](_0x1ef520,_0x396feb);return interaction['findAll']('chat',_0x396feb['query'],_0x396feb[_0x53ea('0x3b')],_0x388ccc,_0x1ef520)[_0x53ea('0x18')](respondWithFilteredResult(_0x297468,_0x388ccc))[_0x53ea('0x3c')](handleError(_0x297468,null));};exports[_0x53ea('0x3d')]=function(_0x38a7e9,_0x157644){var _0x54e2d2={'raw':![],'where':{'id':_0x38a7e9[_0x53ea('0x3e')]['id']}},_0x1eee8b={};_0x1eee8b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db[_0x53ea('0x37')][_0x53ea('0x38')]);_0x1eee8b[_0x53ea('0x41')]=_['keys'](_0x38a7e9[_0x53ea('0x41')]);_0x1eee8b['filters']=_['intersection'](_0x1eee8b[_0x53ea('0x3f')],_0x1eee8b[_0x53ea('0x41')]);_0x54e2d2[_0x53ea('0x42')]=_['intersection'](_0x1eee8b['model'],qs[_0x53ea('0x43')](_0x38a7e9['query'][_0x53ea('0x43')]));_0x54e2d2[_0x53ea('0x42')]=_0x54e2d2['attributes'][_0x53ea('0x44')]?_0x54e2d2[_0x53ea('0x42')]:_0x1eee8b[_0x53ea('0x3f')];if(_0x38a7e9[_0x53ea('0x41')][_0x53ea('0x45')]){_0x54e2d2[_0x53ea('0x46')]=[{'all':!![]}];}_0x54e2d2=_[_0x53ea('0x47')]({},_0x54e2d2,_0x38a7e9[_0x53ea('0x48')]);return db[_0x53ea('0x37')][_0x53ea('0x49')](_0x54e2d2)['then'](handleEntityNotFound(_0x157644,null))[_0x53ea('0x18')](respondWithResult(_0x157644,null))[_0x53ea('0x3c')](handleError(_0x157644,null));};exports['create']=function(_0x47a71b,_0x1ad256){return db[_0x53ea('0x37')][_0x53ea('0x4a')](_0x47a71b[_0x53ea('0x31')],{})[_0x53ea('0x18')](respondWithResult(_0x1ad256,0xc9))[_0x53ea('0x3c')](handleError(_0x1ad256,null));};exports['update']=function(_0x78e813,_0x13fb7c){if(_0x78e813[_0x53ea('0x31')]['id']){delete _0x78e813[_0x53ea('0x31')]['id'];}return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x78e813['params']['id']}})['then'](handleEntityNotFound(_0x13fb7c,null))[_0x53ea('0x18')](saveUpdates(_0x78e813[_0x53ea('0x31')],null))[_0x53ea('0x18')](respondWithResult(_0x13fb7c,null))[_0x53ea('0x3c')](handleError(_0x13fb7c,null));};exports[_0x53ea('0x2d')]=function(_0x1a68fb,_0x4bd9da){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x1a68fb[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x4bd9da,null))['then'](removeEntity(_0x4bd9da,null))[_0x53ea('0x3c')](handleError(_0x4bd9da,null));};exports[_0x53ea('0x4b')]=function(_0x437dcd,_0xa8f3b7){return db[_0x53ea('0x37')][_0x53ea('0x4b')]()[_0x53ea('0x18')](respondWithResult(_0xa8f3b7,null))['catch'](handleError(_0xa8f3b7,null));};exports[_0x53ea('0x4c')]=function(_0x5d3b6d,_0x1fe553){var _0x3603b9=_0x5d3b6d['params']['id'];var _0x35d287;var _0x4b8b5c;var _0x1515a0;return db[_0x53ea('0x37')]['findOne']({'where':{'id':_0x3603b9}})[_0x53ea('0x18')](function(_0xca55e3){_0x35d287=_0xca55e3;return db[_0x53ea('0x4d')][_0x53ea('0x4e')]({'where':{'id':_0xca55e3[_0x53ea('0x4f')]},'attributes':['id',_0x53ea('0x50'),'vidaooEscalation',_0x53ea('0x51'),_0x53ea('0x52'),'vidaooMetadata'],'raw':!![]});})[_0x53ea('0x18')](function(_0x44c2bd){if(_0x44c2bd&&_0x44c2bd[_0x53ea('0x50')]&&_0x44c2bd[_0x53ea('0x53')]){_0x4b8b5c=_0x44c2bd;var _0x515256={'interaction':{'id':_0x3603b9},'agent':{'id':_0x5d3b6d[_0x53ea('0x3b')]['id'],'name':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x2f')],'fullname':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x54')],'email':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x55')]},'contact':_0x5d3b6d[_0x53ea('0x31')]['contact'],'account':_0x5d3b6d[_0x53ea('0x31')][_0x53ea('0x34')]};var _0x28d2bd={'rejectUnauthorized':![],'method':_0x53ea('0x56'),'url':_0x53ea('0x57'),'headers':{'X-APIKEY':_0x44c2bd[_0x53ea('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d3b6d['user'][_0x53ea('0x55')]],'buttons':null,'topic':_0x4b8b5c[_0x53ea('0x51')],'note':_[_0x53ea('0x58')](_0x4b8b5c[_0x53ea('0x52')])?null:getMustacheRender(_0x4b8b5c['vidaooNote'],_0x515256),'metadata':null},'redirect':_0x53ea('0x59'),'json':!![]};try{if(!_[_0x53ea('0x58')](_0x4b8b5c[_0x53ea('0x5a')])){var _0x4f6db5=getMustacheRender(_0x4b8b5c['vidaooMetadata'],_0x515256);var _0x34a1bc=JSON['parse'](_0x4f6db5);_0x28d2bd[_0x53ea('0x31')]['metadata']=_0x34a1bc;}}catch(_0x2572ad){throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x5c'));}return rp(_0x28d2bd);}else{throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x5d'));}})[_0x53ea('0x18')](function(_0xd9df0a){_0x1515a0=_0xd9df0a;if(_0x1515a0['id']){var _0x5d8cca={'body':_0x1515a0['join_url'],'ChatWebsiteId':_0x4b8b5c['id'],'ChatInteractionId':_0x35d287['id'],'direction':_0x53ea('0x5e'),'UserId':_0x5d3b6d[_0x53ea('0x3b')]['id']};return db[_0x53ea('0x5f')][_0x53ea('0x4a')](_0x5d8cca,{});}else{throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x60'));}})[_0x53ea('0x18')](function(){return _0x35d287[_0x53ea('0x61')]({'vidaooSessionId':_0x1515a0['id']});})[_0x53ea('0x18')](respondWithResult(_0x1fe553,null))[_0x53ea('0x3c')](handleError(_0x1fe553,null));};exports[_0x53ea('0x62')]=function(_0x50b2cd,_0x2ed55b){if(_0x50b2cd[_0x53ea('0x31')]['id']){delete _0x50b2cd['body']['id'];}return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x50b2cd[_0x53ea('0x3e')]['id']},'include':[{'model':db['CmContact'],'as':_0x53ea('0x63')}]})[_0x53ea('0x18')](handleEntityNotFound(_0x2ed55b,null))[_0x53ea('0x18')](saveUpdates(_0x50b2cd[_0x53ea('0x31')],null))['then'](respondWithResult(_0x2ed55b,null))[_0x53ea('0x3c')](handleError(_0x2ed55b,null));};exports['abandon']=function(_0x1b0acb,_0x7614de){if(_0x1b0acb['body']['id']){delete _0x1b0acb[_0x53ea('0x31')]['id'];}return db['ChatInteraction'][_0x53ea('0x49')]({'where':{'id':_0x1b0acb['params']['id']}})[_0x53ea('0x18')](function(_0x475bae){if(!_0x475bae){logger['error'](_0x53ea('0x64'),'abandon',0x194,'entity\x20not\x20found');_0x7614de[_0x53ea('0x23')](0x194);}else{if(_0x475bae['UserId']){throw new db[(_0x53ea('0x65'))][(_0x53ea('0x5b'))](_0x53ea('0x66'));}}return _0x475bae;})['then'](function(_0x1c1647){if(_0x1c1647){return _0x1c1647[_0x53ea('0x67')]({'closed':_0x1b0acb['body']['closed'],'disposition':_0x1b0acb[_0x53ea('0x31')][_0x53ea('0x68')]})[_0x53ea('0x18')](function(_0x361bcb){return _0x361bcb;});}})[_0x53ea('0x18')](function(){return respondWithRpcPromise(_0x53ea('0x69'),_0x53ea('0x6a'),_0x1b0acb[_0x53ea('0x31')],client9004);})[_0x53ea('0x18')](respondWithResult(_0x7614de,null))[_0x53ea('0x3c')](handleError(_0x7614de,null));};exports[_0x53ea('0x6b')]=function(_0x406774,_0x4efb65){_0x406774['body'][_0x53ea('0x2f')]=_0x406774[_0x53ea('0x6c')][_0x53ea('0x6d')];_0x406774['body']['basename']=_0x406774[_0x53ea('0x6c')]['filename'];_0x406774[_0x53ea('0x31')][_0x53ea('0x6e')]=_0x406774['file']['mimetype'];return db[_0x53ea('0x6f')][_0x53ea('0x4a')](_0x406774[_0x53ea('0x31')])['then'](respondWithResult(_0x4efb65,0xc9))[_0x53ea('0x3c')](handleError(_0x4efb65,null));};exports[_0x53ea('0x70')]=function(_0x50ebdd,_0x478124){return db[_0x53ea('0x37')][_0x53ea('0x4e')]({'where':{'id':_0x50ebdd[_0x53ea('0x3e')]['id']},'raw':!![]})[_0x53ea('0x18')](handleEntityNotFound(_0x478124,null))[_0x53ea('0x18')](function(_0x332144){if(_0x332144){if(_0x332144[_0x53ea('0x71')]){return _0x478124[_0x53ea('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x50ebdd['query'][_0x53ea('0x72')]},'raw':!![]})[_0x53ea('0x18')](handleEntityNotFound(_0x478124,null));}})[_0x53ea('0x18')](function(_0x10b728){if(_0x10b728){var _0x4d309d=_0x10b728['ChatOfflineMessageId']!==null;var _0x517c8a=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0x75'));if(_0x4d309d){_0x517c8a=path['join'](_0x517c8a,_0x53ea('0x76'));}var _0x34f0a2=path['join'](_0x517c8a,_0x10b728[_0x53ea('0x77')]);return _0x478124['download'](_0x34f0a2);}})[_0x53ea('0x3c')](handleError(_0x478124,null));};exports[_0x53ea('0x78')]=function(_0x340450,_0x2e6df1){var _0x2bc850=null;var _0x21bbac=null;var _0xb510df=null;if(_0x340450[_0x53ea('0x31')]['id']){delete _0x340450[_0x53ea('0x31')]['id'];}if(_0x340450[_0x53ea('0x31')][_0x53ea('0x79')]){_0xb510df=path['join'](config[_0x53ea('0x74')],_0x53ea('0x7a'),util[_0x53ea('0x7b')](_0x53ea('0x7c'),Date[_0x53ea('0x7d')]()));_0x340450['body'][_0x53ea('0x7e')]=_0xb510df;}return db['ChatInteraction'][_0x53ea('0x49')]({'where':{'id':_0x340450['params']['id']},'include':[{'model':db[_0x53ea('0x5f')],'as':'Messages','include':[{'model':db[_0x53ea('0x7f')],'as':_0x53ea('0x7f')}]}]})['then'](handleEntityNotFound(_0x2e6df1,null))[_0x53ea('0x18')](saveUpdates(_0x340450['body'],null))[_0x53ea('0x18')](function(_0x4218f5){if(_0x4218f5){_0x2bc850=_0x4218f5;return db[_0x53ea('0x4d')][_0x53ea('0x49')]({'where':{'id':_0x2bc850[_0x53ea('0x4f')]}});}})['then'](function(_0x119532){if(_0x119532){_0x21bbac=_0x119532;return db[_0x53ea('0x80')]['find']({'where':{'id':_0x2bc850['ContactId']}});}})[_0x53ea('0x18')](function(_0x310eaf){if(_0x310eaf){if(_0xb510df){var _0x3ea7b2=null;for(var _0x10156e=0x1;_0x10156e<_0x2bc850[_0x53ea('0x81')][_0x53ea('0x44')];++_0x10156e){_0x3ea7b2=_0x2bc850[_0x53ea('0x81')][_0x10156e];var _0x39c1bf=_0x3ea7b2['UserId']?util[_0x53ea('0x7b')](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');var _0x4777fc=_0x340450[_0x53ea('0x31')][_0x53ea('0x86')]||util[_0x53ea('0x7b')]('%s%d',_0x53ea('0x87'),_0x3ea7b2['ContactId']);switch(_0x21bbac[_0x53ea('0x88')]){case _0x53ea('0x89'):_0x39c1bf=_0x3ea7b2[_0x53ea('0x84')]?util[_0x53ea('0x7b')](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');break;case _0x53ea('0x8a'):_0x39c1bf=_0x3ea7b2['UserId']?_0x3ea7b2[_0x53ea('0x7f')][_0x53ea('0x8b')]||_0x3ea7b2['User'][_0x53ea('0x54')]:_0x53ea('0x85');break;case _0x53ea('0x8c'):_0x39c1bf=_0x3ea7b2['UserId']?_0x3ea7b2[_0x53ea('0x7f')][_0x53ea('0x54')]:_0x53ea('0x85');break;default:_0x39c1bf=_0x3ea7b2['UserId']?util['format'](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');}var _0x27dc98=util['format'](_0x53ea('0x8d'),moment(_0x3ea7b2['createdAt'])['format'](_0x53ea('0x8e')),_0x3ea7b2[_0x53ea('0x8f')]==='in'?_0x4777fc:_0x39c1bf,_0x3ea7b2[_0x53ea('0x31')]);if(!_0x3ea7b2[_0x53ea('0x90')]){fs[_0x53ea('0x91')](_0xb510df,_0x27dc98);}}return db[_0x53ea('0x92')][_0x53ea('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x53ea('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x53ea('0x94')],'as':_0x53ea('0x94'),'raw':!![]}]}]});}}})[_0x53ea('0x18')](function(_0x58f0c3){if(!_0x58f0c3||!_0x58f0c3[_0x53ea('0x95')]||!_0x340450[_0x53ea('0x31')])return _0x2bc850;var _0x397828=_0x58f0c3[_0x53ea('0x96')]();return respondWithRpcPromise(_0x53ea('0x97'),_0x53ea('0x98'),{'account':_0x397828,'message':{'from':util['format'](_0x53ea('0x99'),_0x58f0c3[_0x53ea('0x2f')],_0x58f0c3['email']||_0x58f0c3['Smtp'][_0x53ea('0x3b')]),'to':_0x340450[_0x53ea('0x31')]['mailTranscript'],'subject':_0x53ea('0x9a'),'text':util[_0x53ea('0x7b')](_0x53ea('0x9b'),_0x340450[_0x53ea('0x31')]['mailTranscript']),'attachments':[{'path':_0xb510df}]}})[_0x53ea('0x18')](function(){return _0x2bc850;})[_0x53ea('0x3c')](function(_0x1bb151){logger[_0x53ea('0x1f')](_0x1bb151);});})[_0x53ea('0x18')](respondWithStatusCode(_0x2e6df1,0xc8))[_0x53ea('0x3c')](handleError(_0x2e6df1,null));};exports[_0x53ea('0x9c')]=function(_0x1cdd1d,_0x49f589){return db[_0x53ea('0x5f')][_0x53ea('0x49')]({'where':{'id':_0x1cdd1d[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49f589,null))[_0x53ea('0x18')](function(_0x2af03b){if(_0x2af03b){return _0x2af03b[_0x53ea('0x9c')](_0x1cdd1d[_0x53ea('0x31')][_0x53ea('0x9d')],_[_0x53ea('0x9e')](_0x1cdd1d['body'],[_0x53ea('0x9d'),'id'])||{});}})[_0x53ea('0x18')](respondWithResult(_0x49f589,null))[_0x53ea('0x3c')](handleError(_0x49f589,null));};exports[_0x53ea('0x9f')]=function(_0x477964,_0x535a06){var _0x53e6ae={'raw':![],'where':{}};var _0x24008b={};var _0x5909d4={'count':0x0,'rows':[]};return db[_0x53ea('0x37')]['findOne']({'where':{'id':_0x477964[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x535a06,null))['then'](function(_0x4016c8){if(_0x4016c8){_0x24008b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db['ChatMessage'][_0x53ea('0x38')]);_0x24008b[_0x53ea('0x41')]=_['keys'](_0x477964['query']);_0x24008b['filters']=_[_0x53ea('0xa0')](_0x24008b[_0x53ea('0x3f')],_0x24008b[_0x53ea('0x41')]);_0x53e6ae[_0x53ea('0x42')]=_['intersection'](_0x24008b[_0x53ea('0x3f')],qs[_0x53ea('0x43')](_0x477964['query']['fields']));_0x53e6ae[_0x53ea('0x42')]=_0x53e6ae['attributes']['length']?_0x53e6ae[_0x53ea('0x42')]:_0x24008b[_0x53ea('0x3f')];if(!_0x477964[_0x53ea('0x41')][_0x53ea('0xa1')](_0x53ea('0xa2'))){_0x53e6ae['limit']=qs[_0x53ea('0x29')](_0x477964[_0x53ea('0x41')]['limit']);_0x53e6ae[_0x53ea('0x27')]=qs[_0x53ea('0x27')](_0x477964[_0x53ea('0x41')][_0x53ea('0x27')]);}_0x53e6ae[_0x53ea('0xa3')]=qs[_0x53ea('0xa4')](_0x477964[_0x53ea('0x41')][_0x53ea('0xa4')]);_0x53e6ae[_0x53ea('0xa5')]=qs['filters'](_['pick'](_0x477964['query'],_0x24008b[_0x53ea('0xa6')]));_0x53e6ae[_0x53ea('0xa5')]['ChatInteractionId']=_0x4016c8['id'];if(_0x477964[_0x53ea('0x41')][_0x53ea('0xa7')]){_0x53e6ae[_0x53ea('0xa5')]=_['merge'](_0x53e6ae[_0x53ea('0xa5')],{'$or':_[_0x53ea('0x36')](_0x53e6ae[_0x53ea('0x42')],function(_0x25c17a){var _0x1da591={};_0x1da591[_0x25c17a]={'$like':'%'+_0x477964['query']['filter']+'%'};return _0x1da591;})});}if(_0x477964[_0x53ea('0x41')][_0x53ea('0xa8')]){var _0x224438=_0x477964[_0x53ea('0x41')][_0x53ea('0xa8')]['split'](',');var _0x3a7485={};_0x3a7485[_0x224438[0x0]]={'$gte':moment(_0x224438[0x1])['format'](_0x53ea('0xa9'))};_0x53e6ae['where']=_[_0x53ea('0x47')](_0x53e6ae[_0x53ea('0xa5')],_0x3a7485);}_0x53e6ae=_[_0x53ea('0x47')]({},_0x53e6ae,_0x477964[_0x53ea('0x48')]);return db['ChatMessage'][_0x53ea('0x2a')]({'where':_0x53e6ae[_0x53ea('0xa5')]})['then'](function(_0x4d1aa5){_0x5909d4[_0x53ea('0x2a')]=_0x4d1aa5;if(_0x477964[_0x53ea('0x41')]['includeAll']){_0x53e6ae[_0x53ea('0x46')]=[{'all':!![]}];}return db[_0x53ea('0x5f')][_0x53ea('0xaa')](_0x53e6ae);})[_0x53ea('0x18')](function(_0x500903){_0x5909d4[_0x53ea('0xab')]=_0x500903;return _0x5909d4;});}})[_0x53ea('0x18')](respondWithFilteredResult(_0x535a06,_0x53e6ae))['catch'](handleError(_0x535a06,null));};exports[_0x53ea('0xac')]=function(_0x459599,_0x1fc9cd){var _0x154aac={'where':{}},_0xc4586b={},_0x5be87d={'count':0x0,'rows':[]};return db[_0x53ea('0x37')][_0x53ea('0x4e')]({'where':{'id':_0x459599[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x1fc9cd,null))['then'](function(_0x25f912){if(_0x25f912){_0xc4586b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db[_0x53ea('0x5f')][_0x53ea('0x38')]);_0xc4586b[_0x53ea('0x41')]=_[_0x53ea('0x40')](_0x459599['query']);_0xc4586b[_0x53ea('0xa6')]=_[_0x53ea('0xa0')](_0xc4586b[_0x53ea('0x3f')],_0xc4586b[_0x53ea('0x41')]);_0x154aac['attributes']=_['intersection'](_0xc4586b[_0x53ea('0x3f')],qs[_0x53ea('0x43')](_0x459599[_0x53ea('0x41')][_0x53ea('0x43')]));_0x154aac[_0x53ea('0x42')]=_0x154aac[_0x53ea('0x42')]['length']?_0x154aac[_0x53ea('0x42')]:_0xc4586b[_0x53ea('0x3f')];if(!_0x459599[_0x53ea('0x41')][_0x53ea('0xa1')]('nolimit')){_0x154aac[_0x53ea('0x29')]=qs[_0x53ea('0x29')](_0x459599[_0x53ea('0x41')][_0x53ea('0x29')]);_0x154aac[_0x53ea('0x27')]=qs[_0x53ea('0x27')](_0x459599['query'][_0x53ea('0x27')]);}_0x154aac[_0x53ea('0xa3')]=qs[_0x53ea('0xa4')](_0x459599['query'][_0x53ea('0xa4')]);_0x154aac[_0x53ea('0xa5')]=qs['filters'](_[_0x53ea('0xad')](_0x459599['query'],_0xc4586b[_0x53ea('0xa6')]));_0x154aac[_0x53ea('0xa5')]['ChatInteractionId']=_0x25f912['id'];if(_0x459599['query'][_0x53ea('0xa7')]){_0x154aac['where']=_[_0x53ea('0x47')](_0x154aac[_0x53ea('0xa5')],{'$or':_['map'](_0x154aac[_0x53ea('0x42')],function(_0x459b0c){var _0x15ca15={};_0x15ca15[_0x459b0c]={'$like':'%'+_0x459599[_0x53ea('0x41')][_0x53ea('0xa7')]+'%'};return _0x15ca15;})});}_0x154aac[_0x53ea('0xa5')][_0x53ea('0x90')]=![];if(_0x459599[_0x53ea('0x41')]['id']){_0x154aac[_0x53ea('0xa5')]['id']={'$gt':_0x459599[_0x53ea('0x41')]['id']};}_0x154aac=_[_0x53ea('0x47')]({},_0x154aac,_0x459599['options']);return db[_0x53ea('0x5f')]['count']({'where':_0x154aac[_0x53ea('0xa5')]})[_0x53ea('0x18')](function(_0x44e3f0){_0x5be87d[_0x53ea('0x2a')]=_0x44e3f0;_0x154aac['include']=[];if(_0x459599['query'][_0x53ea('0xae')]){_0x154aac[_0x53ea('0x46')][_0x53ea('0xaf')]({'model':db[_0x53ea('0x7f')],'as':'User','attributes':['id',_0x53ea('0x54'),_0x53ea('0x8b')]});}if(_0x459599[_0x53ea('0x41')][_0x53ea('0x45')]){_0x154aac[_0x53ea('0x46')]=[{'all':!![]}];}return db[_0x53ea('0x5f')][_0x53ea('0xaa')](_0x154aac);})[_0x53ea('0x18')](function(_0x2cdfc0){_0x5be87d[_0x53ea('0xab')]=_0x2cdfc0;return _0x5be87d;});}})[_0x53ea('0x18')](respondWithFilteredResult(_0x1fc9cd,_0x154aac))[_0x53ea('0x3c')](handleError(_0x1fc9cd,null));};exports['addTags']=function(_0x190c98,_0x2e9090){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x190c98[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2e9090,null))['then'](function(_0x4e1292){if(_0x4e1292){return _0x4e1292['setTags'](_0x190c98[_0x53ea('0x31')][_0x53ea('0x9d')],_[_0x53ea('0x9e')](_0x190c98[_0x53ea('0x31')],[_0x53ea('0x9d'),'id'])||{})[_0x53ea('0xb0')](function(){return db[_0x53ea('0xb1')][_0x53ea('0xaa')]({'attributes':['id','name',_0x53ea('0xb2')],'where':{'id':_0x190c98[_0x53ea('0x31')]['ids']}});})[_0x53ea('0x18')](function(_0x5f2f8f){socket[_0x53ea('0xb3')](_0x53ea('0xb4'),{'id':Number(_0x190c98[_0x53ea('0x3e')]['id']),'tags':_0x5f2f8f||[]});return{'id':Number(_0x190c98[_0x53ea('0x3e')]['id']),'tags':_0x5f2f8f||[]};});}})[_0x53ea('0x18')](respondWithResult(_0x2e9090,null))[_0x53ea('0x3c')](handleError(_0x2e9090,null));};exports[_0x53ea('0xb5')]=function(_0x3ef2b7,_0x1ccb05){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x3ef2b7[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ccb05,null))[_0x53ea('0x18')](function(_0x20af70){if(_0x20af70){return _0x20af70[_0x53ea('0xb5')](_0x3ef2b7[_0x53ea('0x41')][_0x53ea('0x9d')]);}})['then'](respondWithStatusCode(_0x1ccb05,null))[_0x53ea('0x3c')](handleError(_0x1ccb05,null));};exports[_0x53ea('0xb6')]=function(_0x514bcf,_0x5eb1e1){var _0xa324f=moment()['unix']()[_0x53ea('0xb7')]();var _0x902ac5=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),_0x53ea('0xb9'),_0x53ea('0xba'));var _0x2f8a35=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),_0x53ea('0xb9'),'attachments');var _0x36bdbf=path[_0x53ea('0x73')](_0x902ac5,_0xa324f);var _0x1f728e=util[_0x53ea('0x7b')]('transcript-%d-%s.zip',_0x514bcf[_0x53ea('0x3e')]['id'],_0xa324f);var _0x4c2f35=path[_0x53ea('0x73')](_0x902ac5,_0x1f728e);var _0xa2226=[];_0xa2226[_0x53ea('0xaf')]({'model':db[_0x53ea('0x7f')],'as':_0x53ea('0x7f'),'attributes':['id',_0x53ea('0x54')],'raw':!![]});_0xa2226['push']({'model':db['CmContact'],'as':_0x53ea('0x63'),'attributes':['id',_0x53ea('0xbb'),_0x53ea('0xbc')],'raw':!![]});if(_0x514bcf[_0x53ea('0x41')][_0x53ea('0xbd')]){_0xa2226[_0x53ea('0xaf')]({'model':db[_0x53ea('0x6f')],'as':_0x53ea('0x6f'),'raw':!![]});}var _0x49c8b0=[{'model':db['ChatMessage'],'as':_0x53ea('0x81'),'attributes':['id','body',_0x53ea('0xbe'),_0x53ea('0x8f'),'secret',_0x53ea('0xbf')],'include':_0xa2226}];_0x49c8b0['push']({'model':db[_0x53ea('0x4d')],'as':_0x53ea('0xc0'),'attributes':['id','name']});_0x49c8b0[_0x53ea('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x514bcf[_0x53ea('0x3e')]['id']},'include':_0x49c8b0})[_0x53ea('0x18')](handleEntityNotFound(_0x5eb1e1,null))[_0x53ea('0x18')](function(_0x3b2408){if(_0x3b2408){var _0x295d71=_0x3b2408[_0x53ea('0xc1')]({'plain':!![]});fs[_0x53ea('0xc2')](_0x36bdbf);var _0x5a3f3b={'channel':_0x53ea('0xc3'),'account':_0x295d71[_0x53ea('0xc0')]['name'],'agent':_0x295d71[_0x53ea('0xc4')]?_0x295d71[_0x53ea('0xc4')][_0x53ea('0x54')]:_0x53ea('0xc5'),'createdAt':moment(_0x295d71[_0x53ea('0xbe')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')](),'closedAt':_0x295d71['closed']?moment(_0x295d71[_0x53ea('0xc6')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')]():'','disposition':_0x295d71[_0x53ea('0x68')],'chatInfo':{'browser':_0x295d71['browserName'],'os':_0x295d71['osName'],'referer':_0x295d71[_0x53ea('0xc7')],'customerIp':_0x295d71['customerIp'],'customerPort':_0x295d71[_0x53ea('0xc8')]?_0x295d71['customerPort']:_0x53ea('0xc5')},'messages':_(_0x295d71['Messages'])[_0x53ea('0xc9')]()[_0x53ea('0xa7')]({'secret':![]})[_0x53ea('0x36')](function(_0x1e340d){if(_0x1e340d[_0x53ea('0x6f')]){var _0x3bab6c=path[_0x53ea('0x73')](_0x2f8a35,_0x1e340d[_0x53ea('0x6f')]['basename']);if(fs[_0x53ea('0xca')](_0x3bab6c)){fs[_0x53ea('0xcb')](_0x3bab6c)[_0x53ea('0xcc')](fs['createWriteStream'](path[_0x53ea('0x73')](_0x36bdbf,_0x1e340d[_0x53ea('0x6f')][_0x53ea('0x77')])));}}return{'date':moment(_0x1e340d[_0x53ea('0xbe')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')](),'sender':_0x1e340d[_0x53ea('0x8f')]==='out'?_0x1e340d[_0x53ea('0x7f')]?_0x1e340d[_0x53ea('0x7f')][_0x53ea('0x54')]:_0x53ea('0x85'):_0x1e340d[_0x53ea('0x63')][_0x53ea('0xbb')]+(_0x1e340d['Contact']['lastName']?'\x20'+_0x1e340d[_0x53ea('0x63')][_0x53ea('0xbc')]:''),'body':_0x1e340d['Attachment']?_0x1e340d[_0x53ea('0x6f')][_0x53ea('0x77')]:_0x1e340d[_0x53ea('0x31')],'direction':_0x1e340d['direction']===_0x53ea('0x5e')?'A':'C','secret':_0x1e340d[_0x53ea('0x90')],'read':_0x1e340d['read'],'attachment':_0x1e340d[_0x53ea('0x6f')]};})[_0x53ea('0xcd')]()};return ejs[_0x53ea('0xce')](path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),'views',_0x53ea('0xcf')),{'interaction':_0x5a3f3b})[_0x53ea('0x18')](function(_0x499fb1){var _0x32c690=path[_0x53ea('0x73')](_0x36bdbf,_0x53ea('0xd0')+_0x295d71['id']+'-'+_0xa324f+_0x53ea('0xd1'));var _0x569d9f={'path':_0x32c690,'channel':_0x53ea('0xc3'),'interactionId':_0x295d71['id']};return pdf[_0x53ea('0xd2')](_0x499fb1,_0x569d9f);})[_0x53ea('0x18')](function(){return new Promise(function(_0x48167e,_0x5350d1){zipdir(_0x36bdbf,{'saveTo':_0x4c2f35},function(_0x28817b,_0x3a3248){if(_0x28817b)return _0x5350d1(_0x28817b);return _0x48167e(_0x3a3248);});})[_0x53ea('0x18')](function(){return new BPromise(function(_0x5283c7,_0x14a310){rimraf(_0x36bdbf,function(_0x1caa9a){if(_0x1caa9a)_0x14a310(_0x1caa9a);return _0x5283c7();});});})['then'](function(){return _0x5eb1e1['download'](_0x4c2f35,_0x1f728e,function(_0x183dc7){if(_0x183dc7){logger[_0x53ea('0x1f')](_0x53ea('0xd3'),_0x183dc7);}else{fs[_0x53ea('0xd4')](_0x4c2f35);}});});});}else{return _0x5eb1e1[_0x53ea('0x23')](0xc8);}})[_0x53ea('0x3c')](handleError(_0x5eb1e1,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 8d1fbeb..305ec26 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 _0x0a3c=['unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','then'];(function(_0x22957d,_0x32f0df){var _0x15fbed=function(_0x56b0a0){while(--_0x56b0a0){_0x22957d['push'](_0x22957d['shift']());}};_0x15fbed(++_0x32f0df);}(_0x0a3c,0xba));var _0xc0a3=function(_0xb0b6ad,_0x41947a){_0xb0b6ad=_0xb0b6ad-0x0;var _0x16a975=_0x0a3c[_0xb0b6ad];return _0x16a975;};'use strict';var EventEmitter=require(_0xc0a3('0x0'));var ChatInteraction=require(_0xc0a3('0x1'))['db'][_0xc0a3('0x2')];var ChatMessage=require(_0xc0a3('0x1'))['db'][_0xc0a3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc0a3('0x4')](0x0);var events={'afterCreate':_0xc0a3('0x5'),'afterUpdate':_0xc0a3('0x6'),'afterDestroy':_0xc0a3('0x7')};function emitEvent(_0x3328b9){return function(_0x409a92,_0x51fdea,_0x16f0e9){_0x409a92[_0xc0a3('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x333044){_0x409a92['setDataValue'](_0xc0a3('0x9'),_0x333044[_0xc0a3('0xa')](function(_0x37e67a){return{'id':_0x37e67a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x409a92['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0a3('0xb')](function(_0x22b938){_0x409a92['setDataValue'](_0xc0a3('0xc'),_0x22b938[_0xc0a3('0xd')]);ChatInteractionEvents[_0xc0a3('0xe')](_0x3328b9+':'+_0x409a92['id'],_0x409a92);ChatInteractionEvents['emit'](_0x3328b9,_0x409a92);_0x16f0e9(null);})[_0xc0a3('0xf')](_0x16f0e9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xc0a3('0x10')](e,emitEvent(event));}}module[_0xc0a3('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x03d1=['../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','emit','hasOwnProperty','exports','events'];(function(_0x327d5a,_0x16bba0){var _0x49d8ff=function(_0x214620){while(--_0x214620){_0x327d5a['push'](_0x327d5a['shift']());}};_0x49d8ff(++_0x16bba0);}(_0x03d1,0x1d0));var _0x103d=function(_0x5bbf42,_0x492f04){_0x5bbf42=_0x5bbf42-0x0;var _0x5ae1fd=_0x03d1[_0x5bbf42];return _0x5ae1fd;};'use strict';var EventEmitter=require(_0x103d('0x0'));var ChatInteraction=require(_0x103d('0x1'))['db'][_0x103d('0x2')];var ChatMessage=require(_0x103d('0x1'))['db'][_0x103d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x103d('0x4'),'afterUpdate':_0x103d('0x5'),'afterDestroy':_0x103d('0x6')};function emitEvent(_0x501fe0){return function(_0x4fd7be,_0x373874,_0xae16e2){_0x4fd7be[_0x103d('0x7')]({'attributes':['id'],'raw':!![]})[_0x103d('0x8')](function(_0xe4fe28){_0x4fd7be[_0x103d('0x9')]('Users',_0xe4fe28[_0x103d('0xa')](function(_0x3aa24e){return{'id':_0x3aa24e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4fd7be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x103d('0x8')](function(_0x1cb177){_0x4fd7be[_0x103d('0x9')](_0x103d('0xb'),_0x1cb177['length']);ChatInteractionEvents[_0x103d('0xc')](_0x501fe0+':'+_0x4fd7be['id'],_0x4fd7be);ChatInteractionEvents[_0x103d('0xc')](_0x501fe0,_0x4fd7be);_0xae16e2(null);})['catch'](_0xae16e2(null));};}for(var e in events){if(events[_0x103d('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x103d('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 81dbc32..299ef12 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 _0xddf3=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt'];(function(_0x1fb978,_0x3fa6a2){var _0x14fd1d=function(_0x229382){while(--_0x229382){_0x1fb978['push'](_0x1fb978['shift']());}};_0x14fd1d(++_0x3fa6a2);}(_0xddf3,0xcf));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ddf('0x0'));var util=require(_0x3ddf('0x1'));var logger=require(_0x3ddf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3ddf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ddf('0x4'));var rimraf=require(_0x3ddf('0x5'));var config=require(_0x3ddf('0x6'));var attributes=require(_0x3ddf('0x7'));module[_0x3ddf('0x8')]=function(_0xad3fc7,_0x1c5414){return _0xad3fc7[_0x3ddf('0x9')](_0x3ddf('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x342f3f,_0x300a55,_0x26f565){if(_0x342f3f[_0x3ddf('0xb')](_0x3ddf('0xc'))){_0x342f3f[_0x3ddf('0xd')]=moment()[_0x3ddf('0xe')](_0x3ddf('0xf'));}_0x26f565(null,_0x342f3f);}},'charset':'utf8mb4','collate':_0x3ddf('0x10')});}; \ No newline at end of file +var _0x15cd=['closedAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x15cd,0x193));var _0xd15c=function(_0x4a30b7,_0x3dabc8){_0x4a30b7=_0x4a30b7-0x0;var _0xe48f3c=_0x15cd[_0x4a30b7];return _0xe48f3c;};'use strict';var _=require('lodash');var util=require(_0xd15c('0x0'));var logger=require(_0xd15c('0x1'))(_0xd15c('0x2'));var moment=require(_0xd15c('0x3'));var BPromise=require(_0xd15c('0x4'));var rp=require(_0xd15c('0x5'));var fs=require('fs');var path=require(_0xd15c('0x6'));var rimraf=require(_0xd15c('0x7'));var config=require(_0xd15c('0x8'));var attributes=require(_0xd15c('0x9'));module['exports']=function(_0x5c9dc1,_0xc4d508){return _0x5c9dc1['define'](_0xd15c('0xa'),attributes,{'tableName':_0xd15c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e7f73,_0x104e67,_0x3b5002){if(_0x5e7f73['changed'](_0xd15c('0xc'))){_0x5e7f73[_0xd15c('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3b5002(null,_0x5e7f73);}},'charset':_0xd15c('0xe'),'collate':_0xd15c('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 77ef597..907a90b 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 _0x1cc1=['AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','body','options','raw','where','attributes','limit'];(function(_0x56103b,_0x3a38ec){var _0x3cb4d9=function(_0x65ddc0){while(--_0x65ddc0){_0x56103b['push'](_0x56103b['shift']());}};_0x3cb4d9(++_0x3a38ec);}(_0x1cc1,0xf3));var _0x11cc=function(_0x43e168,_0x321f35){_0x43e168=_0x43e168-0x0;var _0x14a949=_0x1cc1[_0x43e168];return _0x14a949;};'use strict';var _=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var moment=require(_0x11cc('0x2'));var BPromise=require(_0x11cc('0x3'));var rs=require(_0x11cc('0x4'));var fs=require('fs');var Redis=require(_0x11cc('0x5'));var db=require(_0x11cc('0x6'))['db'];var utils=require(_0x11cc('0x7'));var logger=require(_0x11cc('0x8'))(_0x11cc('0x9'));var config=require(_0x11cc('0xa'));var jayson=require(_0x11cc('0xb'));var client=jayson[_0x11cc('0xc')][_0x11cc('0xd')]({'port':0x232a});config['redis']=_[_0x11cc('0xe')](config['redis'],{'host':_0x11cc('0xf'),'port':0x18eb});var socket=require(_0x11cc('0x10'))(new Redis(config[_0x11cc('0x11')]));require(_0x11cc('0x12'))[_0x11cc('0x13')](socket);function respondWithRpcPromise(_0x1b04d1,_0x4b21e5,_0x48045b){return new BPromise(function(_0x5b390b,_0x331155){return client[_0x11cc('0x14')](_0x1b04d1,_0x48045b)[_0x11cc('0x15')](function(_0x3c7681){logger[_0x11cc('0x16')](_0x11cc('0x17'),_0x4b21e5,'request\x20sent');logger[_0x11cc('0x18')](_0x11cc('0x19'),_0x4b21e5,_0x11cc('0x1a'),JSON['stringify'](_0x3c7681));if(_0x3c7681[_0x11cc('0x1b')]){if(_0x3c7681[_0x11cc('0x1b')][_0x11cc('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4b21e5,_0x3c7681[_0x11cc('0x1b')][_0x11cc('0x1d')]);return _0x331155(_0x3c7681[_0x11cc('0x1b')]['message']);}logger['error'](_0x11cc('0x17'),_0x4b21e5,_0x3c7681['error']['message']);return _0x5b390b(_0x3c7681[_0x11cc('0x1b')][_0x11cc('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4b21e5,_0x11cc('0x1a'));_0x5b390b(_0x3c7681[_0x11cc('0x1e')][_0x11cc('0x1d')]);}})[_0x11cc('0x1f')](function(_0x2e15ba){logger[_0x11cc('0x1b')](_0x11cc('0x17'),_0x4b21e5,_0x2e15ba);_0x331155(_0x2e15ba);});});}exports[_0x11cc('0x20')]=function(_0x506aa7){var _0x25751a=this;return new Promise(function(_0x1c7c2a,_0x3a91d4){return db['ChatInteraction']['update'](_0x506aa7[_0x11cc('0x21')],{'raw':_0x506aa7[_0x11cc('0x22')]?_0x506aa7[_0x11cc('0x22')][_0x11cc('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x506aa7[_0x11cc('0x22')]?_0x506aa7[_0x11cc('0x22')][_0x11cc('0x24')]||null:null,'attributes':_0x506aa7[_0x11cc('0x22')]?_0x506aa7[_0x11cc('0x22')][_0x11cc('0x25')]||null:null,'limit':_0x506aa7[_0x11cc('0x22')]?_0x506aa7['options'][_0x11cc('0x26')]||null:null})[_0x11cc('0x15')](function(_0x4d4d25){logger[_0x11cc('0x16')](_0x11cc('0x20'),_0x506aa7);logger[_0x11cc('0x18')](_0x11cc('0x20'),_0x506aa7,JSON['stringify'](_0x4d4d25));_0x1c7c2a(_0x4d4d25);})[_0x11cc('0x1f')](function(_0x26f521){logger[_0x11cc('0x1b')](_0x11cc('0x20'),_0x26f521[_0x11cc('0x1d')],_0x506aa7);_0x3a91d4(_0x25751a[_0x11cc('0x1b')](0x1f4,_0x26f521[_0x11cc('0x1d')]));});});};exports[_0x11cc('0x27')]=function(_0x7018af){return new Promise(function(_0x427732,_0x38eeb8){return db[_0x11cc('0x28')][_0x11cc('0x29')]({'where':_0x7018af[_0x11cc('0x22')]?_0x7018af[_0x11cc('0x22')][_0x11cc('0x24')]||null:null})[_0x11cc('0x15')](function(_0x23a411){if(_0x23a411){return _0x23a411[_0x11cc('0x2a')](_0x7018af['body'][_0x11cc('0x2b')],_[_0x11cc('0x2c')](_0x7018af[_0x11cc('0x21')],[_0x11cc('0x2b'),'id'])||{});}})['spread'](function(_0x11bc8c){logger[_0x11cc('0x16')]('AddTags',_0x7018af);logger[_0x11cc('0x18')](_0x11cc('0x2d'),_0x7018af,JSON[_0x11cc('0x2e')](_0x11bc8c));_0x427732(_0x11bc8c);})[_0x11cc('0x1f')](function(_0x40626e){logger[_0x11cc('0x1b')]('AddTags',_0x40626e[_0x11cc('0x1d')],_0x7018af);_0x38eeb8(_this['error'](0x1f4,_0x40626e[_0x11cc('0x1d')]));});});}; \ No newline at end of file +var _0x26bb=['update','options','raw','where','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x26bb,0x1a7));var _0xb26b=function(_0x46672d,_0x359677){_0x46672d=_0x46672d-0x0;var _0x4294d5=_0x26bb[_0x46672d];return _0x4294d5;};'use strict';var _=require(_0xb26b('0x0'));var util=require(_0xb26b('0x1'));var moment=require(_0xb26b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb26b('0x3'));var fs=require('fs');var Redis=require(_0xb26b('0x4'));var db=require(_0xb26b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb26b('0x6'))('rpc');var config=require(_0xb26b('0x7'));var jayson=require(_0xb26b('0x8'));var client=jayson[_0xb26b('0x9')][_0xb26b('0xa')]({'port':0x232a});config[_0xb26b('0xb')]=_[_0xb26b('0xc')](config[_0xb26b('0xb')],{'host':_0xb26b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb26b('0xb')]));require('./chatInteraction.socket')[_0xb26b('0xe')](socket);function respondWithRpcPromise(_0x1ac10d,_0x414731,_0x42216f){return new BPromise(function(_0x9628d3,_0x242129){return client[_0xb26b('0xf')](_0x1ac10d,_0x42216f)[_0xb26b('0x10')](function(_0x3af66b){logger[_0xb26b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x414731,'request\x20sent');logger[_0xb26b('0x12')](_0xb26b('0x13'),_0x414731,_0xb26b('0x14'),JSON[_0xb26b('0x15')](_0x3af66b));if(_0x3af66b[_0xb26b('0x16')]){if(_0x3af66b['error'][_0xb26b('0x17')]===0x1f4){logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x3af66b[_0xb26b('0x16')][_0xb26b('0x19')]);return _0x242129(_0x3af66b[_0xb26b('0x16')][_0xb26b('0x19')]);}logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x3af66b[_0xb26b('0x16')]['message']);return _0x9628d3(_0x3af66b[_0xb26b('0x16')]['message']);}else{logger[_0xb26b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x414731,'request\x20sent');_0x9628d3(_0x3af66b[_0xb26b('0x1a')]['message']);}})[_0xb26b('0x1b')](function(_0x5b4378){logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x5b4378);_0x242129(_0x5b4378);});});}exports['UpdateChatInteraction']=function(_0x548898){var _0x331495=this;return new Promise(function(_0x379336,_0xa5257c){return db['ChatInteraction'][_0xb26b('0x1c')](_0x548898['body'],{'raw':_0x548898[_0xb26b('0x1d')]?_0x548898[_0xb26b('0x1d')][_0xb26b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548898['options']?_0x548898['options'][_0xb26b('0x1f')]||null:null,'attributes':_0x548898['options']?_0x548898[_0xb26b('0x1d')]['attributes']||null:null,'limit':_0x548898[_0xb26b('0x1d')]?_0x548898[_0xb26b('0x1d')]['limit']||null:null})[_0xb26b('0x10')](function(_0x34eb9f){logger['info'](_0xb26b('0x20'),_0x548898);logger[_0xb26b('0x12')](_0xb26b('0x20'),_0x548898,JSON[_0xb26b('0x15')](_0x34eb9f));_0x379336(_0x34eb9f);})[_0xb26b('0x1b')](function(_0x1df2ee){logger[_0xb26b('0x16')]('UpdateChatInteraction',_0x1df2ee['message'],_0x548898);_0xa5257c(_0x331495[_0xb26b('0x16')](0x1f4,_0x1df2ee[_0xb26b('0x19')]));});});};exports[_0xb26b('0x21')]=function(_0x2e6388){return new Promise(function(_0x56e9f4,_0xd4cc6e){return db[_0xb26b('0x22')][_0xb26b('0x23')]({'where':_0x2e6388['options']?_0x2e6388[_0xb26b('0x1d')][_0xb26b('0x1f')]||null:null})[_0xb26b('0x10')](function(_0x226a9a){if(_0x226a9a){return _0x226a9a[_0xb26b('0x24')](_0x2e6388[_0xb26b('0x25')]['ids'],_['omit'](_0x2e6388['body'],[_0xb26b('0x26'),'id'])||{});}})[_0xb26b('0x27')](function(_0x286bec){logger[_0xb26b('0x11')](_0xb26b('0x28'),_0x2e6388);logger[_0xb26b('0x12')](_0xb26b('0x28'),_0x2e6388,JSON[_0xb26b('0x15')](_0x286bec));_0x56e9f4(_0x286bec);})['catch'](function(_0x42a46e){logger[_0xb26b('0x16')](_0xb26b('0x28'),_0x42a46e[_0xb26b('0x19')],_0x2e6388);_0xd4cc6e(_this[_0xb26b('0x16')](0x1f4,_0x42a46e[_0xb26b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 6d4c6ce..0ed11f3 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 _0xc6eb=['length','./chatInteraction.events','remove','update','emit','removeListener','register'];(function(_0x344c05,_0x3326c9){var _0x5416e1=function(_0x2cab13){while(--_0x2cab13){_0x344c05['push'](_0x344c05['shift']());}};_0x5416e1(++_0x3326c9);}(_0xc6eb,0x104));var _0xbc6e=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0xc6eb[_0xb4e052];return _0x5197e7;};'use strict';var ChatInteractionEvents=require(_0xbc6e('0x0'));var events=['save',_0xbc6e('0x1'),_0xbc6e('0x2')];function createListener(_0x47acb4,_0x6b3d6c){return function(_0x4de55e){_0x6b3d6c[_0xbc6e('0x3')](_0x47acb4,_0x4de55e);};}function removeListener(_0x23c9dc,_0x4b5d64){return function(){ChatInteractionEvents[_0xbc6e('0x4')](_0x23c9dc,_0x4b5d64);};}exports[_0xbc6e('0x5')]=function(_0x5e45e9){for(var _0x4ab297=0x0,_0x2b42b3=events[_0xbc6e('0x6')];_0x4ab297<_0x2b42b3;_0x4ab297++){var _0x460b90=events[_0x4ab297];var _0x35cdf7=createListener('chatInteraction:'+_0x460b90,_0x5e45e9);ChatInteractionEvents['on'](_0x460b90,_0x35cdf7);}}; \ No newline at end of file +var _0x21d4=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0xd4d8ef,_0x59f96d){var _0x26a687=function(_0xaf8c26){while(--_0xaf8c26){_0xd4d8ef['push'](_0xd4d8ef['shift']());}};_0x26a687(++_0x59f96d);}(_0x21d4,0x14d));var _0x421d=function(_0x475941,_0x1bdf17){_0x475941=_0x475941-0x0;var _0x3ccc75=_0x21d4[_0x475941];return _0x3ccc75;};'use strict';var ChatInteractionEvents=require(_0x421d('0x0'));var events=[_0x421d('0x1'),'remove',_0x421d('0x2')];function createListener(_0x242c4b,_0x115465){return function(_0x26ec2d){_0x115465[_0x421d('0x3')](_0x242c4b,_0x26ec2d);};}function removeListener(_0x377e4c,_0x5c8686){return function(){ChatInteractionEvents[_0x421d('0x4')](_0x377e4c,_0x5c8686);};}exports[_0x421d('0x5')]=function(_0x324d54){for(var _0x128afb=0x0,_0x2f52ea=events[_0x421d('0x6')];_0x128afb<_0x2f52ea;_0x128afb++){var _0x1cdb5f=events[_0x128afb];var _0x4e24a2=createListener(_0x421d('0x7')+_0x1cdb5f,_0x324d54);ChatInteractionEvents['on'](_0x1cdb5f,_0x4e24a2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 1db46d4..a73086b 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 _0x4c1b=['customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update'];(function(_0x4ebe23,_0x1b5740){var _0x105ae1=function(_0x184df2){while(--_0x184df2){_0x4ebe23['push'](_0x4ebe23['shift']());}};_0x105ae1(++_0x1b5740);}(_0x4c1b,0x1e5));var _0xb4c1=function(_0x36882b,_0x2a414f){_0x36882b=_0x36882b-0x0;var _0x2d9c67=_0x4c1b[_0x36882b];return _0x2d9c67;};'use strict';var multer=require(_0xb4c1('0x0'));var util=require('util');var path=require(_0xb4c1('0x1'));var timeout=require(_0xb4c1('0x2'));var express=require(_0xb4c1('0x3'));var router=express[_0xb4c1('0x4')]();var fs_extra=require(_0xb4c1('0x5'));var auth=require(_0xb4c1('0x6'));var interaction=require(_0xb4c1('0x7'));var config=require(_0xb4c1('0x8'));var controller=require(_0xb4c1('0x9'));router['get']('/',auth[_0xb4c1('0xa')](),controller[_0xb4c1('0xb')]);router[_0xb4c1('0xc')]('/describe',auth[_0xb4c1('0xa')](),controller[_0xb4c1('0xd')]);router['get'](_0xb4c1('0xe'),auth[_0xb4c1('0xf')](),controller[_0xb4c1('0x10')]);router[_0xb4c1('0xc')](_0xb4c1('0x11'),auth[_0xb4c1('0xf')](),controller[_0xb4c1('0x12')]);router[_0xb4c1('0xc')](_0xb4c1('0x13'),auth[_0xb4c1('0xa')](),controller['getMessages']);router[_0xb4c1('0xc')](_0xb4c1('0x14'),auth['isChatInteractionAuthorized'](),controller[_0xb4c1('0x15')]);router['get']('/:id/download',auth[_0xb4c1('0xa')](),controller[_0xb4c1('0x16')]);router['post']('/',auth[_0xb4c1('0xa')](),controller[_0xb4c1('0x17')]);router[_0xb4c1('0x18')](_0xb4c1('0x19'),auth[_0xb4c1('0xa')](),controller[_0xb4c1('0x1a')]);var upload=multer({'storage':multer[_0xb4c1('0x1b')]({'destination':function(_0x361721,_0x11b7d9,_0xc42118){_0xc42118(null,path['join'](config['root'],_0xb4c1('0x1c')));},'filename':function(_0xba8b57,_0x3432a3,_0x368efe){_0x368efe(null,util[_0xb4c1('0x1d')](_0xb4c1('0x1e'),Date['now'](),_0x3432a3[_0xb4c1('0x1f')][_0xb4c1('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb4c1('0x21'),upload['single'](_0xb4c1('0x22')),controller['attachmentUpload']);router[_0xb4c1('0x18')]('/:id/messages',auth[_0xb4c1('0xf')](),controller[_0xb4c1('0x23')]);router[_0xb4c1('0x18')](_0xb4c1('0x24'),auth[_0xb4c1('0xa')](),interaction[_0xb4c1('0x25')]('chat',_0xb4c1('0x26')),controller[_0xb4c1('0x27')]);router[_0xb4c1('0x28')](_0xb4c1('0xe'),auth[_0xb4c1('0xa')](),interaction[_0xb4c1('0x25')](_0xb4c1('0x29'),_0xb4c1('0x2a')),controller[_0xb4c1('0x2b')]);router[_0xb4c1('0x28')](_0xb4c1('0x2c'),controller[_0xb4c1('0x2d')]);router[_0xb4c1('0x28')]('/:id/abandon',auth[_0xb4c1('0xf')](),controller[_0xb4c1('0x2e')]);router[_0xb4c1('0x28')](_0xb4c1('0x2f'),controller[_0xb4c1('0x30')]);router[_0xb4c1('0x31')]('/:id',auth[_0xb4c1('0xa')](),interaction[_0xb4c1('0x25')](_0xb4c1('0x29'),_0xb4c1('0x32')),controller[_0xb4c1('0x33')]);router[_0xb4c1('0x31')](_0xb4c1('0x24'),auth[_0xb4c1('0xa')](),controller['removeTags']);module[_0xb4c1('0x34')]=router; \ No newline at end of file +var _0x69fb=['abandon','/:id/close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','single','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon'];(function(_0x16a5f3,_0x57fddc){var _0x184742=function(_0x4efd0e){while(--_0x4efd0e){_0x16a5f3['push'](_0x16a5f3['shift']());}};_0x184742(++_0x57fddc);}(_0x69fb,0x95));var _0xb69f=function(_0x57b1a3,_0x1da974){_0x57b1a3=_0x57b1a3-0x0;var _0x54b8a6=_0x69fb[_0x57b1a3];return _0x54b8a6;};'use strict';var multer=require(_0xb69f('0x0'));var util=require(_0xb69f('0x1'));var path=require(_0xb69f('0x2'));var timeout=require(_0xb69f('0x3'));var express=require(_0xb69f('0x4'));var router=express[_0xb69f('0x5')]();var fs_extra=require(_0xb69f('0x6'));var auth=require(_0xb69f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb69f('0x8'));var controller=require('./chatInteraction.controller');router[_0xb69f('0x9')]('/',auth[_0xb69f('0xa')](),controller[_0xb69f('0xb')]);router[_0xb69f('0x9')](_0xb69f('0xc'),auth[_0xb69f('0xa')](),controller[_0xb69f('0xd')]);router[_0xb69f('0x9')](_0xb69f('0xe'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x10')]);router[_0xb69f('0x9')](_0xb69f('0x11'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x12')]);router[_0xb69f('0x9')](_0xb69f('0x13'),auth[_0xb69f('0xa')](),controller[_0xb69f('0x14')]);router[_0xb69f('0x9')](_0xb69f('0x15'),auth[_0xb69f('0xf')](),controller['getMyMessages']);router[_0xb69f('0x9')](_0xb69f('0x16'),auth['isAuthenticated'](),controller[_0xb69f('0x17')]);router[_0xb69f('0x18')]('/',auth[_0xb69f('0xa')](),controller['create']);router[_0xb69f('0x18')](_0xb69f('0x19'),auth[_0xb69f('0xa')](),controller[_0xb69f('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x482a08,_0x55bede,_0x320d0a){_0x320d0a(null,path[_0xb69f('0x1b')](config[_0xb69f('0x1c')],'server/files/attachments/'));},'filename':function(_0x3c2337,_0x249cff,_0x324c61){_0x324c61(null,util[_0xb69f('0x1d')](_0xb69f('0x1e'),Date[_0xb69f('0x1f')](),_0x249cff['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb69f('0x18')]('/:id/attachment_upload',upload[_0xb69f('0x20')]('file'),controller[_0xb69f('0x21')]);router[_0xb69f('0x18')](_0xb69f('0x13'),auth[_0xb69f('0xf')](),controller['addMessage']);router[_0xb69f('0x18')]('/:id/tags',auth[_0xb69f('0xa')](),interaction[_0xb69f('0x22')]('chat',_0xb69f('0x23')),controller[_0xb69f('0x24')]);router[_0xb69f('0x25')](_0xb69f('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xb69f('0x26'),_0xb69f('0x27')),controller[_0xb69f('0x28')]);router['put'](_0xb69f('0x29'),controller['customUpdate']);router[_0xb69f('0x25')](_0xb69f('0x2a'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x2b')]);router[_0xb69f('0x25')](_0xb69f('0x2c'),controller['close']);router[_0xb69f('0x2d')](_0xb69f('0xe'),auth[_0xb69f('0xa')](),interaction[_0xb69f('0x22')](_0xb69f('0x26'),'chatinteraction:destroy'),controller[_0xb69f('0x2e')]);router[_0xb69f('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb69f('0x2f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 96802cb..6a37d66 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 _0x2983=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x16ae27,_0x458176){var _0x2aaa4f=function(_0x205b71){while(--_0x205b71){_0x16ae27['push'](_0x16ae27['shift']());}};_0x2aaa4f(++_0x458176);}(_0x2983,0x1a0));var _0x3298=function(_0x5f1d65,_0x16e36f){_0x5f1d65=_0x5f1d65-0x0;var _0x255933=_0x2983[_0x5f1d65];return _0x255933;};'use strict';var Sequelize=require(_0x3298('0x0'));module[_0x3298('0x1')]={'body':{'type':Sequelize[_0x3298('0x2')](_0x3298('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3298('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8bff=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x378c8a,_0x102f13){var _0x221dec=function(_0x44fa56){while(--_0x44fa56){_0x378c8a['push'](_0x378c8a['shift']());}};_0x221dec(++_0x102f13);}(_0x8bff,0xc4));var _0xf8bf=function(_0x161c43,_0x421946){_0x161c43=_0x161c43-0x0;var _0x936761=_0x8bff[_0x161c43];return _0x936761;};'use strict';var Sequelize=require(_0xf8bf('0x0'));module[_0xf8bf('0x1')]={'body':{'type':Sequelize[_0xf8bf('0x2')](_0xf8bf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf8bf('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf8bf('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 886fc45..96d5aef 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 _0xe903=['../../config/license/util','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','undefined','offset','count','limit','set','apply','reject','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','User','agent','user','fullname','role','userpic','lastLoginAt','showWebBar','-online','type','Agents','userProfileId','autoAssociation','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x28ee77,_0x5898a1){var _0x40d6b3=function(_0x29f5c6){while(--_0x29f5c6){_0x28ee77['push'](_0x28ee77['shift']());}};_0x40d6b3(++_0x5898a1);}(_0xe903,0xb7));var _0x3e90=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe903[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0x3e90('0x0'));var rimraf=require(_0x3e90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e90('0x2'));var rp=require(_0x3e90('0x3'));var moment=require(_0x3e90('0x4'));var BPromise=require(_0x3e90('0x5'));var Mustache=require('mustache');var util=require(_0x3e90('0x6'));var path=require(_0x3e90('0x7'));var sox=require('sox');var csv=require(_0x3e90('0x8'));var ejs=require(_0x3e90('0x9'));var fs=require('fs');var fs_extra=require(_0x3e90('0xa'));var _=require(_0x3e90('0xb'));var squel=require(_0x3e90('0xc'));var crypto=require(_0x3e90('0xd'));var jsforce=require(_0x3e90('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e90('0xf'));var Papa=require(_0x3e90('0x10'));var Redis=require(_0x3e90('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3e90('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e90('0x13'))(_0x3e90('0x14'));var utils=require(_0x3e90('0x15'));var config=require(_0x3e90('0x16'));var licenseUtil=require(_0x3e90('0x17'));var db=require('../../mysqldb')['db'];config[_0x3e90('0x18')]=_[_0x3e90('0x19')](config[_0x3e90('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e90('0x1a'))(new Redis(config[_0x3e90('0x18')]));require(_0x3e90('0x1b'))['register'](socket);function respondWithStatusCode(_0x107451,_0x417096){_0x417096=_0x417096||0xcc;return function(_0x356858){if(_0x356858){return _0x107451[_0x3e90('0x1c')](_0x417096);}return _0x107451['status'](_0x417096)[_0x3e90('0x1d')]();};}function respondWithResult(_0x4108a7,_0x2946a9){_0x2946a9=_0x2946a9||0xc8;return function(_0x2e8931){if(_0x2e8931){return _0x4108a7[_0x3e90('0x1e')](_0x2946a9)[_0x3e90('0x1f')](_0x2e8931);}};}function respondWithFilteredResult(_0x8507b1,_0x9d6bc2){return function(_0x3ca23d){if(_0x3ca23d){var _0xfc289c=typeof _0x9d6bc2['offset']==='undefined'&&typeof _0x9d6bc2['limit']===_0x3e90('0x20');var _0xeb6f14=_0x3ca23d['count'];var _0x191a77=_0xfc289c?0x0:_0x9d6bc2[_0x3e90('0x21')];var _0x7ce587=_0xfc289c?_0x3ca23d[_0x3e90('0x22')]:_0x9d6bc2[_0x3e90('0x21')]+_0x9d6bc2[_0x3e90('0x23')];var _0xed6a7;if(_0x7ce587>=_0xeb6f14){_0x7ce587=_0xeb6f14;_0xed6a7=0xc8;}else{_0xed6a7=0xce;}_0x8507b1[_0x3e90('0x1e')](_0xed6a7);return _0x8507b1[_0x3e90('0x24')]('Content-Range',_0x191a77+'-'+_0x7ce587+'/'+_0xeb6f14)[_0x3e90('0x1f')](_0x3ca23d);}return null;};}function patchUpdates(_0x10d9d4){return function(_0x2650e8){try{jsonpatch[_0x3e90('0x25')](_0x2650e8,_0x10d9d4,!![]);}catch(_0xfd68c4){return BPromise[_0x3e90('0x26')](_0xfd68c4);}return _0x2650e8['save']();};}function saveUpdates(_0x1b1193,_0x3b00ca){return function(_0x54196a){if(_0x54196a){return _0x54196a['update'](_0x1b1193)[_0x3e90('0x27')](function(_0x6b38b3){return _0x6b38b3;});}return null;};}function removeEntity(_0x22bf54,_0x5d2241){return function(_0x39e94e){if(_0x39e94e){return _0x39e94e[_0x3e90('0x28')]()[_0x3e90('0x27')](function(){_0x22bf54[_0x3e90('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edb1e,_0x56ab20){return function(_0x4c3361){if(!_0x4c3361){_0x4edb1e['sendStatus'](0x194);}return _0x4c3361;};}function handleError(_0x2b2284,_0xcc9c34){_0xcc9c34=_0xcc9c34||0x1f4;return function(_0x38c247){logger[_0x3e90('0x29')](_0x38c247[_0x3e90('0x2a')]);if(_0x38c247[_0x3e90('0x2b')]){delete _0x38c247[_0x3e90('0x2b')];}_0x2b2284[_0x3e90('0x1e')](_0xcc9c34)['send'](_0x38c247);};}exports[_0x3e90('0x2c')]=function(_0x12ff60,_0x537dc4){var _0x385cc4={},_0x1a8487={},_0x114a81={'count':0x0,'rows':[]};var _0x5c4613=_[_0x3e90('0x2d')](db[_0x3e90('0x2e')][_0x3e90('0x2f')],function(_0x5482f4){return{'name':_0x5482f4[_0x3e90('0x30')],'type':_0x5482f4['type']['key']};});_0x1a8487[_0x3e90('0x31')]=_[_0x3e90('0x2d')](_0x5c4613,_0x3e90('0x2b'));_0x1a8487[_0x3e90('0x32')]=_[_0x3e90('0x33')](_0x12ff60['query']);_0x1a8487[_0x3e90('0x34')]=_[_0x3e90('0x35')](_0x1a8487['model'],_0x1a8487[_0x3e90('0x32')]);_0x385cc4[_0x3e90('0x36')]=_[_0x3e90('0x35')](_0x1a8487[_0x3e90('0x31')],qs[_0x3e90('0x37')](_0x12ff60[_0x3e90('0x32')][_0x3e90('0x37')]));_0x385cc4[_0x3e90('0x36')]=_0x385cc4[_0x3e90('0x36')][_0x3e90('0x38')]?_0x385cc4[_0x3e90('0x36')]:_0x1a8487[_0x3e90('0x31')];if(!_0x12ff60[_0x3e90('0x32')][_0x3e90('0x39')](_0x3e90('0x3a'))){_0x385cc4['limit']=qs['limit'](_0x12ff60['query'][_0x3e90('0x23')]);_0x385cc4['offset']=qs[_0x3e90('0x21')](_0x12ff60[_0x3e90('0x32')][_0x3e90('0x21')]);}_0x385cc4[_0x3e90('0x3b')]=qs[_0x3e90('0x3c')](_0x12ff60[_0x3e90('0x32')]['sort']);_0x385cc4[_0x3e90('0x3d')]=qs[_0x3e90('0x34')](_[_0x3e90('0x3e')](_0x12ff60[_0x3e90('0x32')],_0x1a8487['filters']),_0x5c4613);if(_0x12ff60['query'][_0x3e90('0x3f')]){_0x385cc4[_0x3e90('0x3d')]=_[_0x3e90('0x40')](_0x385cc4[_0x3e90('0x3d')],{'$or':_[_0x3e90('0x2d')](_0x5c4613,function(_0xdb2622){if(_0xdb2622['type']!==_0x3e90('0x41')){var _0x291394={};_0x291394[_0xdb2622[_0x3e90('0x2b')]]={'$like':'%'+_0x12ff60[_0x3e90('0x32')][_0x3e90('0x3f')]+'%'};return _0x291394;}})});}_0x385cc4=_[_0x3e90('0x40')]({},_0x385cc4,_0x12ff60[_0x3e90('0x42')]);var _0xd95023={'where':_0x385cc4['where']};return db['ChatInternalMessage']['count'](_0xd95023)[_0x3e90('0x27')](function(_0x2934fe){_0x114a81[_0x3e90('0x22')]=_0x2934fe;if(_0x12ff60[_0x3e90('0x32')][_0x3e90('0x43')]){_0x385cc4[_0x3e90('0x44')]=[{'all':!![]}];}return db[_0x3e90('0x2e')][_0x3e90('0x45')](_0x385cc4);})['then'](function(_0x4c12bb){_0x114a81[_0x3e90('0x46')]=_0x4c12bb;return _0x114a81;})[_0x3e90('0x27')](respondWithFilteredResult(_0x537dc4,_0x385cc4))[_0x3e90('0x47')](handleError(_0x537dc4,null));};exports[_0x3e90('0x48')]=function(_0x199720,_0xd05027){var _0x579ca3={'raw':!![],'where':{'id':_0x199720['params']['id']}},_0x546d9c={};_0x546d9c[_0x3e90('0x31')]=_[_0x3e90('0x33')](db[_0x3e90('0x2e')]['rawAttributes']);_0x546d9c[_0x3e90('0x32')]=_[_0x3e90('0x33')](_0x199720[_0x3e90('0x32')]);_0x546d9c[_0x3e90('0x34')]=_[_0x3e90('0x35')](_0x546d9c[_0x3e90('0x31')],_0x546d9c[_0x3e90('0x32')]);_0x579ca3['attributes']=_['intersection'](_0x546d9c[_0x3e90('0x31')],qs[_0x3e90('0x37')](_0x199720['query'][_0x3e90('0x37')]));_0x579ca3[_0x3e90('0x36')]=_0x579ca3[_0x3e90('0x36')][_0x3e90('0x38')]?_0x579ca3['attributes']:_0x546d9c[_0x3e90('0x31')];if(_0x199720[_0x3e90('0x32')][_0x3e90('0x43')]){_0x579ca3['include']=[{'all':!![]}];}_0x579ca3=_[_0x3e90('0x40')]({},_0x579ca3,_0x199720['options']);return db[_0x3e90('0x2e')][_0x3e90('0x49')](_0x579ca3)['then'](handleEntityNotFound(_0xd05027,null))['then'](respondWithResult(_0xd05027,null))['catch'](handleError(_0xd05027,null));};exports['create']=function(_0x477b90,_0x1d5167){return db[_0x3e90('0x2e')][_0x3e90('0x4a')](_0x477b90[_0x3e90('0x4b')],{})[_0x3e90('0x27')](respondWithResult(_0x1d5167,0xc9))[_0x3e90('0x47')](handleError(_0x1d5167,null));};exports['update']=function(_0x56b102,_0x3447a6){if(_0x56b102[_0x3e90('0x4b')]['id']){delete _0x56b102[_0x3e90('0x4b')]['id'];}return db[_0x3e90('0x2e')][_0x3e90('0x49')]({'where':{'id':_0x56b102[_0x3e90('0x4c')]['id']}})[_0x3e90('0x27')](handleEntityNotFound(_0x3447a6,null))['then'](saveUpdates(_0x56b102['body'],null))[_0x3e90('0x27')](respondWithResult(_0x3447a6,null))[_0x3e90('0x47')](handleError(_0x3447a6,null));};exports[_0x3e90('0x28')]=function(_0x93e30,_0x3d5fde){return db[_0x3e90('0x2e')][_0x3e90('0x49')]({'where':{'id':_0x93e30[_0x3e90('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d5fde,null))[_0x3e90('0x27')](removeEntity(_0x3d5fde,null))[_0x3e90('0x47')](handleError(_0x3d5fde,null));};exports[_0x3e90('0x4d')]=function(_0x523fe5,_0x52492b){return db['ChatInternalMessage'][_0x3e90('0x4d')]()['then'](respondWithResult(_0x52492b,null))[_0x3e90('0x47')](handleError(_0x52492b,null));};function wrapUser(_0x5c6e67){return function(_0x480eff){var _0x4a2f10=_0x5c6e67[_0x3e90('0x4e')]({'plain':!![]});_0x4a2f10[_0x3e90('0x4f')]=[];if(_0x480eff){_0x4a2f10['lastMessageAt']=_0x480eff[_0x3e90('0x50')];_0x4a2f10[_0x3e90('0x51')]=_0x480eff;}else{_0x4a2f10[_0x3e90('0x52')]=moment(0x0)[_0x3e90('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a2f10[_0x3e90('0x51')]={};}return _0x4a2f10;};}exports['getUsers']=function(_0x3b99e0,_0x4c993e,_0x3bb8aa){var _0x3f9dc5=[];return db[_0x3e90('0x54')][_0x3e90('0x45')]({'where':{'role':[_0x3e90('0x55'),'admin',_0x3e90('0x56')]},'attributes':['id',_0x3e90('0x57'),_0x3e90('0x2b'),_0x3e90('0x58'),_0x3e90('0x59'),'internal','online',_0x3e90('0x5a'),'allowmessenger',_0x3e90('0x5b')],'order':qs[_0x3e90('0x3c')](_0x3e90('0x5c')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x3e90('0x5d')],'through':{'attributes':[]}}]})[_0x3e90('0x27')](function(_0x15b527){if(_0x15b527){var _0xa45923=_0x3b99e0[_0x3e90('0x56')]['get']({'plain':!![]});if(!_0xa45923)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa45923[_0x3e90('0x58')]===_0x3e90('0x56')){return db['UserProfileSection'][_0x3e90('0x49')]({'where':{'name':_0x3e90('0x5e'),'userProfileId':_0xa45923[_0x3e90('0x5f')]},'raw':!![]})[_0x3e90('0x27')](function(_0x1c6881){if(_0x1c6881){if(_0x1c6881[_0x3e90('0x60')]===0x0){return db['UserProfileResource'][_0x3e90('0x45')]({'where':{'sectionId':_0x1c6881['id']},'raw':!![]})[_0x3e90('0x27')](function(_0x1a2fb4){var _0x32d18d=[];if(_['isEmpty'](_0x1a2fb4)){_0x32d18d=_[_0x3e90('0x3f')](_0x15b527,function(_0x32e3c9){if(_0x32e3c9[_0x3e90('0x58')]!==_0x3e90('0x55')){return _0x32e3c9;}});return _0x32d18d;}else{for(var _0xa2d1ea=0x0;_0xa2d1ea<_0x15b527['length'];_0xa2d1ea++){var _0x179471=_0x15b527[_0xa2d1ea];if(_0x179471[_0x3e90('0x58')]===_0x3e90('0x55')){var _0x3d043a=_[_0x3e90('0x49')](_0x1a2fb4,function(_0x347d15){return _0x347d15[_0x3e90('0x61')]===_0x179471['id'];});if(_0x3d043a)_0x32d18d['push'](_0x179471);}else{_0x32d18d[_0x3e90('0x62')](_0x179471);}}return _0x32d18d;}});}else{return _0x15b527;}}else{var _0x260067=_[_0x3e90('0x3f')](_0x15b527,function(_0x5add36){if(_0x5add36[_0x3e90('0x58')]!=='agent'){return _0x5add36;}});return _0x260067;}});}else{return _0x15b527;}}})[_0x3e90('0x27')](function(_0x4983c0){var _0x7bdf4e=[];if(_0x4983c0){_0x3f9dc5=_0x4983c0;for(var _0x9bfa8=0x0;_0x9bfa8<_0x4983c0[_0x3e90('0x38')];_0x9bfa8+=0x1){_0x3f9dc5[_0x9bfa8][_0x3e90('0x4f')]=[];_0x7bdf4e[_0x3e90('0x62')](db[_0x3e90('0x2e')][_0x3e90('0x49')]({'where':{'FromId':[_0x3b99e0[_0x3e90('0x56')]['id'],_0x4983c0[_0x9bfa8]['id']],'ToId':[_0x3b99e0[_0x3e90('0x56')]['id'],_0x4983c0[_0x9bfa8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x3e90('0x63'),_0x3e90('0x64'),_0x3e90('0x65'),_0x3e90('0x4b')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3e90('0x27')](wrapUser(_0x4983c0[_0x9bfa8])));}return BPromise[_0x3e90('0x66')](_0x7bdf4e);}return[];})[_0x3e90('0x27')](function(_0x3f61b5){return{'rows':_0x3f61b5,'count':_0x3f61b5[_0x3e90('0x38')]};})[_0x3e90('0x27')](respondWithResult(_0x4c993e,null))[_0x3e90('0x47')](handleError(_0x4c993e,null));}; \ No newline at end of file +var _0x9d7b=['./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','destroy','describe','get','messages','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','push','ToId','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x266f2c,_0x16e1a7){var _0x161e37=function(_0x238377){while(--_0x238377){_0x266f2c['push'](_0x266f2c['shift']());}};_0x161e37(++_0x16e1a7);}(_0x9d7b,0x19a));var _0xb9d7=function(_0x46ea96,_0x2ada2a){_0x46ea96=_0x46ea96-0x0;var _0x23be1a=_0x9d7b[_0x46ea96];return _0x23be1a;};'use strict';var emlformat=require(_0xb9d7('0x0'));var rimraf=require(_0xb9d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9d7('0x2'));var rp=require(_0xb9d7('0x3'));var moment=require('moment');var BPromise=require(_0xb9d7('0x4'));var Mustache=require(_0xb9d7('0x5'));var util=require(_0xb9d7('0x6'));var path=require(_0xb9d7('0x7'));var sox=require(_0xb9d7('0x8'));var csv=require(_0xb9d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9d7('0xa'));var _=require(_0xb9d7('0xb'));var squel=require(_0xb9d7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9d7('0xd'));var toCsv=require(_0xb9d7('0x9'));var querystring=require(_0xb9d7('0xe'));var Papa=require(_0xb9d7('0xf'));var Redis=require(_0xb9d7('0x10'));var authService=require(_0xb9d7('0x11'));var qs=require(_0xb9d7('0x12'));var as=require(_0xb9d7('0x13'));var hardwareService=require(_0xb9d7('0x14'));var logger=require(_0xb9d7('0x15'))('api');var utils=require(_0xb9d7('0x16'));var config=require(_0xb9d7('0x17'));var licenseUtil=require(_0xb9d7('0x18'));var db=require(_0xb9d7('0x19'))['db'];config[_0xb9d7('0x1a')]=_[_0xb9d7('0x1b')](config[_0xb9d7('0x1a')],{'host':_0xb9d7('0x1c'),'port':0x18eb});var socket=require(_0xb9d7('0x1d'))(new Redis(config[_0xb9d7('0x1a')]));require(_0xb9d7('0x1e'))[_0xb9d7('0x1f')](socket);function respondWithStatusCode(_0x37b69f,_0x305f93){_0x305f93=_0x305f93||0xcc;return function(_0x193d8c){if(_0x193d8c){return _0x37b69f[_0xb9d7('0x20')](_0x305f93);}return _0x37b69f['status'](_0x305f93)[_0xb9d7('0x21')]();};}function respondWithResult(_0x2bb1af,_0x1f65b1){_0x1f65b1=_0x1f65b1||0xc8;return function(_0x3bcd01){if(_0x3bcd01){return _0x2bb1af[_0xb9d7('0x22')](_0x1f65b1)[_0xb9d7('0x23')](_0x3bcd01);}};}function respondWithFilteredResult(_0x29b97a,_0x208740){return function(_0x207610){if(_0x207610){var _0x45b249=typeof _0x208740[_0xb9d7('0x24')]===_0xb9d7('0x25')&&typeof _0x208740[_0xb9d7('0x26')]===_0xb9d7('0x25');var _0x3cfe33=_0x207610['count'];var _0x3c3130=_0x45b249?0x0:_0x208740[_0xb9d7('0x24')];var _0x5bbadc=_0x45b249?_0x207610[_0xb9d7('0x27')]:_0x208740[_0xb9d7('0x24')]+_0x208740[_0xb9d7('0x26')];var _0x3d3a40;if(_0x5bbadc>=_0x3cfe33){_0x5bbadc=_0x3cfe33;_0x3d3a40=0xc8;}else{_0x3d3a40=0xce;}_0x29b97a[_0xb9d7('0x22')](_0x3d3a40);return _0x29b97a[_0xb9d7('0x28')](_0xb9d7('0x29'),_0x3c3130+'-'+_0x5bbadc+'/'+_0x3cfe33)[_0xb9d7('0x23')](_0x207610);}return null;};}function patchUpdates(_0x244c51){return function(_0x504e03){try{jsonpatch[_0xb9d7('0x2a')](_0x504e03,_0x244c51,!![]);}catch(_0x204490){return BPromise['reject'](_0x204490);}return _0x504e03[_0xb9d7('0x2b')]();};}function saveUpdates(_0x4014ac,_0x59b762){return function(_0x27ab0){if(_0x27ab0){return _0x27ab0[_0xb9d7('0x2c')](_0x4014ac)[_0xb9d7('0x2d')](function(_0x1794f2){return _0x1794f2;});}return null;};}function removeEntity(_0x5d0bee,_0x4e5770){return function(_0x4af258){if(_0x4af258){return _0x4af258['destroy']()['then'](function(){_0x5d0bee[_0xb9d7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b0bca,_0x13eb6b){return function(_0x5c7d43){if(!_0x5c7d43){_0x5b0bca[_0xb9d7('0x20')](0x194);}return _0x5c7d43;};}function handleError(_0x1e5e41,_0x4a340a){_0x4a340a=_0x4a340a||0x1f4;return function(_0x160055){logger[_0xb9d7('0x2e')](_0x160055[_0xb9d7('0x2f')]);if(_0x160055[_0xb9d7('0x30')]){delete _0x160055['name'];}_0x1e5e41['status'](_0x4a340a)[_0xb9d7('0x31')](_0x160055);};}exports[_0xb9d7('0x32')]=function(_0x5945c5,_0x232123){var _0x29574c={},_0x42051a={},_0x45152={'count':0x0,'rows':[]};var _0x543e1e=_[_0xb9d7('0x33')](db[_0xb9d7('0x34')]['rawAttributes'],function(_0x53ce0e){return{'name':_0x53ce0e['fieldName'],'type':_0x53ce0e[_0xb9d7('0x35')]['key']};});_0x42051a[_0xb9d7('0x36')]=_[_0xb9d7('0x33')](_0x543e1e,'name');_0x42051a[_0xb9d7('0x37')]=_[_0xb9d7('0x38')](_0x5945c5['query']);_0x42051a[_0xb9d7('0x39')]=_[_0xb9d7('0x3a')](_0x42051a[_0xb9d7('0x36')],_0x42051a[_0xb9d7('0x37')]);_0x29574c['attributes']=_[_0xb9d7('0x3a')](_0x42051a['model'],qs[_0xb9d7('0x3b')](_0x5945c5[_0xb9d7('0x37')]['fields']));_0x29574c[_0xb9d7('0x3c')]=_0x29574c[_0xb9d7('0x3c')][_0xb9d7('0x3d')]?_0x29574c[_0xb9d7('0x3c')]:_0x42051a[_0xb9d7('0x36')];if(!_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x3e')](_0xb9d7('0x3f'))){_0x29574c[_0xb9d7('0x26')]=qs[_0xb9d7('0x26')](_0x5945c5['query'][_0xb9d7('0x26')]);_0x29574c[_0xb9d7('0x24')]=qs[_0xb9d7('0x24')](_0x5945c5['query'][_0xb9d7('0x24')]);}_0x29574c[_0xb9d7('0x40')]=qs[_0xb9d7('0x41')](_0x5945c5[_0xb9d7('0x37')]['sort']);_0x29574c[_0xb9d7('0x42')]=qs[_0xb9d7('0x39')](_[_0xb9d7('0x43')](_0x5945c5['query'],_0x42051a['filters']),_0x543e1e);if(_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x44')]){_0x29574c[_0xb9d7('0x42')]=_['merge'](_0x29574c['where'],{'$or':_[_0xb9d7('0x33')](_0x543e1e,function(_0x1a609e){if(_0x1a609e['type']!==_0xb9d7('0x45')){var _0x52755b={};_0x52755b[_0x1a609e[_0xb9d7('0x30')]]={'$like':'%'+_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x44')]+'%'};return _0x52755b;}})});}_0x29574c=_['merge']({},_0x29574c,_0x5945c5['options']);var _0x4a8e0a={'where':_0x29574c[_0xb9d7('0x42')]};return db[_0xb9d7('0x34')][_0xb9d7('0x27')](_0x4a8e0a)[_0xb9d7('0x2d')](function(_0x32bee7){_0x45152[_0xb9d7('0x27')]=_0x32bee7;if(_0x5945c5[_0xb9d7('0x37')]['includeAll']){_0x29574c[_0xb9d7('0x46')]=[{'all':!![]}];}return db[_0xb9d7('0x34')][_0xb9d7('0x47')](_0x29574c);})[_0xb9d7('0x2d')](function(_0x3f6f76){_0x45152[_0xb9d7('0x48')]=_0x3f6f76;return _0x45152;})[_0xb9d7('0x2d')](respondWithFilteredResult(_0x232123,_0x29574c))[_0xb9d7('0x49')](handleError(_0x232123,null));};exports[_0xb9d7('0x4a')]=function(_0x5321e7,_0x51b06e){var _0x526bc6={'raw':!![],'where':{'id':_0x5321e7[_0xb9d7('0x4b')]['id']}},_0x412abe={};_0x412abe[_0xb9d7('0x36')]=_['keys'](db[_0xb9d7('0x34')][_0xb9d7('0x4c')]);_0x412abe[_0xb9d7('0x37')]=_[_0xb9d7('0x38')](_0x5321e7['query']);_0x412abe['filters']=_[_0xb9d7('0x3a')](_0x412abe[_0xb9d7('0x36')],_0x412abe[_0xb9d7('0x37')]);_0x526bc6[_0xb9d7('0x3c')]=_[_0xb9d7('0x3a')](_0x412abe[_0xb9d7('0x36')],qs[_0xb9d7('0x3b')](_0x5321e7[_0xb9d7('0x37')][_0xb9d7('0x3b')]));_0x526bc6[_0xb9d7('0x3c')]=_0x526bc6[_0xb9d7('0x3c')][_0xb9d7('0x3d')]?_0x526bc6[_0xb9d7('0x3c')]:_0x412abe['model'];if(_0x5321e7['query']['includeAll']){_0x526bc6['include']=[{'all':!![]}];}_0x526bc6=_[_0xb9d7('0x4d')]({},_0x526bc6,_0x5321e7[_0xb9d7('0x4e')]);return db[_0xb9d7('0x34')][_0xb9d7('0x4f')](_0x526bc6)[_0xb9d7('0x2d')](handleEntityNotFound(_0x51b06e,null))[_0xb9d7('0x2d')](respondWithResult(_0x51b06e,null))[_0xb9d7('0x49')](handleError(_0x51b06e,null));};exports[_0xb9d7('0x50')]=function(_0x1dc346,_0x2aa9f6){return db[_0xb9d7('0x34')][_0xb9d7('0x50')](_0x1dc346[_0xb9d7('0x51')],{})[_0xb9d7('0x2d')](respondWithResult(_0x2aa9f6,0xc9))[_0xb9d7('0x49')](handleError(_0x2aa9f6,null));};exports[_0xb9d7('0x2c')]=function(_0x3fc7e5,_0x3e8a92){if(_0x3fc7e5[_0xb9d7('0x51')]['id']){delete _0x3fc7e5['body']['id'];}return db[_0xb9d7('0x34')]['find']({'where':{'id':_0x3fc7e5[_0xb9d7('0x4b')]['id']}})[_0xb9d7('0x2d')](handleEntityNotFound(_0x3e8a92,null))[_0xb9d7('0x2d')](saveUpdates(_0x3fc7e5[_0xb9d7('0x51')],null))['then'](respondWithResult(_0x3e8a92,null))['catch'](handleError(_0x3e8a92,null));};exports[_0xb9d7('0x52')]=function(_0x1e6eb6,_0x191e0d){return db[_0xb9d7('0x34')][_0xb9d7('0x4f')]({'where':{'id':_0x1e6eb6[_0xb9d7('0x4b')]['id']}})[_0xb9d7('0x2d')](handleEntityNotFound(_0x191e0d,null))[_0xb9d7('0x2d')](removeEntity(_0x191e0d,null))['catch'](handleError(_0x191e0d,null));};exports['describe']=function(_0x3bb5fb,_0x1d5679){return db[_0xb9d7('0x34')][_0xb9d7('0x53')]()[_0xb9d7('0x2d')](respondWithResult(_0x1d5679,null))['catch'](handleError(_0x1d5679,null));};function wrapUser(_0x240031){return function(_0x541f47){var _0x5de417=_0x240031[_0xb9d7('0x54')]({'plain':!![]});_0x5de417[_0xb9d7('0x55')]=[];if(_0x541f47){_0x5de417['lastMessageAt']=_0x541f47['createdAt'];_0x5de417[_0xb9d7('0x56')]=_0x541f47;}else{_0x5de417['lastMessageAt']=moment(0x0)[_0xb9d7('0x57')](_0xb9d7('0x58'));_0x5de417[_0xb9d7('0x56')]={};}return _0x5de417;};}exports[_0xb9d7('0x59')]=function(_0x17f72e,_0x5585e3,_0x392215){var _0xb9b66=[];return db[_0xb9d7('0x5a')][_0xb9d7('0x47')]({'where':{'role':['agent',_0xb9d7('0x5b'),_0xb9d7('0x5c')]},'attributes':['id',_0xb9d7('0x5d'),'name',_0xb9d7('0x5e'),'userpic',_0xb9d7('0x5f'),'online',_0xb9d7('0x60'),_0xb9d7('0x61'),_0xb9d7('0x62')],'order':qs[_0xb9d7('0x41')](_0xb9d7('0x63')),'include':[{'model':db[_0xb9d7('0x64')],'as':'VoiceQueues','attributes':['id',_0xb9d7('0x30'),_0xb9d7('0x35')],'through':{'attributes':[]}}]})[_0xb9d7('0x2d')](function(_0x5c269a){if(_0x5c269a){var _0x2af106=_0x17f72e[_0xb9d7('0x5c')][_0xb9d7('0x54')]({'plain':!![]});if(!_0x2af106)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2af106[_0xb9d7('0x5e')]===_0xb9d7('0x5c')){return db[_0xb9d7('0x65')][_0xb9d7('0x4f')]({'where':{'name':_0xb9d7('0x66'),'userProfileId':_0x2af106[_0xb9d7('0x67')]},'raw':!![]})[_0xb9d7('0x2d')](function(_0x4bda25){if(_0x4bda25){if(_0x4bda25[_0xb9d7('0x68')]===0x0){return db[_0xb9d7('0x69')][_0xb9d7('0x47')]({'where':{'sectionId':_0x4bda25['id']},'raw':!![]})[_0xb9d7('0x2d')](function(_0x150373){var _0x3e2b43=[];if(_['isEmpty'](_0x150373)){_0x3e2b43=_[_0xb9d7('0x44')](_0x5c269a,function(_0x7da95d){if(_0x7da95d[_0xb9d7('0x5e')]!==_0xb9d7('0x6a')){return _0x7da95d;}});return _0x3e2b43;}else{for(var _0x5e2c6b=0x0;_0x5e2c6b<_0x5c269a[_0xb9d7('0x3d')];_0x5e2c6b++){var _0x2d1e9f=_0x5c269a[_0x5e2c6b];if(_0x2d1e9f[_0xb9d7('0x5e')]===_0xb9d7('0x6a')){var _0x41fcc3=_[_0xb9d7('0x4f')](_0x150373,function(_0x5d3c63){return _0x5d3c63['resourceId']===_0x2d1e9f['id'];});if(_0x41fcc3)_0x3e2b43['push'](_0x2d1e9f);}else{_0x3e2b43[_0xb9d7('0x6b')](_0x2d1e9f);}}return _0x3e2b43;}});}else{return _0x5c269a;}}else{var _0x2f7b90=_[_0xb9d7('0x44')](_0x5c269a,function(_0x20b828){if(_0x20b828['role']!==_0xb9d7('0x6a')){return _0x20b828;}});return _0x2f7b90;}});}else{return _0x5c269a;}}})['then'](function(_0x590bfc){var _0x16670e=[];if(_0x590bfc){_0xb9b66=_0x590bfc;for(var _0x555d17=0x0;_0x555d17<_0x590bfc[_0xb9d7('0x3d')];_0x555d17+=0x1){_0xb9b66[_0x555d17][_0xb9d7('0x55')]=[];_0x16670e[_0xb9d7('0x6b')](db[_0xb9d7('0x34')]['find']({'where':{'FromId':[_0x17f72e[_0xb9d7('0x5c')]['id'],_0x590bfc[_0x555d17]['id']],'ToId':[_0x17f72e[_0xb9d7('0x5c')]['id'],_0x590bfc[_0x555d17]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xb9d7('0x6c'),'read',_0xb9d7('0x51')],'order':qs[_0xb9d7('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x590bfc[_0x555d17])));}return BPromise[_0xb9d7('0x6d')](_0x16670e);}return[];})[_0xb9d7('0x2d')](function(_0x466510){return{'rows':_0x466510,'count':_0x466510[_0xb9d7('0x3d')]};})[_0xb9d7('0x2d')](respondWithResult(_0x5585e3,null))[_0xb9d7('0x49')](handleError(_0x5585e3,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index feeca88..408dd75 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 _0x6ace=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x6ace,0x17c));var _0xe6ac=function(_0x57977b,_0x189126){_0x57977b=_0x57977b-0x0;var _0x59e9ad=_0x6ace[_0x57977b];return _0x59e9ad;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe6ac('0x0'))['db'][_0xe6ac('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe6ac('0x2')](0x0);var events={'afterCreate':_0xe6ac('0x3'),'afterUpdate':_0xe6ac('0x4'),'afterDestroy':_0xe6ac('0x5')};function emitEvent(_0x15ae55){return function(_0x44cbe7,_0xc0a15f,_0x38032c){ChatInternalMessageEvents[_0xe6ac('0x6')](_0x15ae55+':'+_0x44cbe7['id'],_0x44cbe7);ChatInternalMessageEvents[_0xe6ac('0x6')](_0x15ae55,_0x44cbe7);_0x38032c(null);};}for(var e in events){if(events[_0xe6ac('0x7')](e)){var event=events[e];ChatInternalMessage[_0xe6ac('0x8')](e,emitEvent(event));}}module[_0xe6ac('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x35e4=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x15425a,_0x311d63){var _0x326c57=function(_0x57a452){while(--_0x57a452){_0x15425a['push'](_0x15425a['shift']());}};_0x326c57(++_0x311d63);}(_0x35e4,0x9f));var _0x435e=function(_0xa35f37,_0x26cde4){_0xa35f37=_0xa35f37-0x0;var _0x9ad5aa=_0x35e4[_0xa35f37];return _0x9ad5aa;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x435e('0x0'))['db'][_0x435e('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x435e('0x2')](0x0);var events={'afterCreate':_0x435e('0x3'),'afterUpdate':_0x435e('0x4'),'afterDestroy':_0x435e('0x5')};function emitEvent(_0x57939e){return function(_0x421228,_0x59e056,_0x3e9787){ChatInternalMessageEvents[_0x435e('0x6')](_0x57939e+':'+_0x421228['id'],_0x421228);ChatInternalMessageEvents[_0x435e('0x6')](_0x57939e,_0x421228);_0x3e9787(null);};}for(var e in events){if(events[_0x435e('0x7')](e)){var event=events[e];ChatInternalMessage[_0x435e('0x8')](e,emitEvent(event));}}module[_0x435e('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 8c9a7fb..3c291e6 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 _0xf8c5=['utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatInternalMessage.attributes','define','ChatInternalMessage'];(function(_0x511786,_0x5acdfa){var _0x515100=function(_0x176305){while(--_0x176305){_0x511786['push'](_0x511786['shift']());}};_0x515100(++_0x5acdfa);}(_0xf8c5,0x1da));var _0x5f8c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xf8c5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x5f8c('0x0'));var util=require(_0x5f8c('0x1'));var logger=require(_0x5f8c('0x2'))(_0x5f8c('0x3'));var moment=require('moment');var BPromise=require(_0x5f8c('0x4'));var rp=require(_0x5f8c('0x5'));var fs=require('fs');var path=require(_0x5f8c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f8c('0x7'));module['exports']=function(_0x3e8696,_0x494947){return _0x3e8696[_0x5f8c('0x8')](_0x5f8c('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f8c('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa11b=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x48c989,_0x489c25){var _0x16c57c=function(_0x44975c){while(--_0x44975c){_0x48c989['push'](_0x48c989['shift']());}};_0x16c57c(++_0x489c25);}(_0xa11b,0x1d8));var _0xba11=function(_0x4a1382,_0x5271ff){_0x4a1382=_0x4a1382-0x0;var _0x179b9b=_0xa11b[_0x4a1382];return _0x179b9b;};'use strict';var _=require(_0xba11('0x0'));var util=require(_0xba11('0x1'));var logger=require(_0xba11('0x2'))('api');var moment=require(_0xba11('0x3'));var BPromise=require(_0xba11('0x4'));var rp=require(_0xba11('0x5'));var fs=require('fs');var path=require(_0xba11('0x6'));var rimraf=require('rimraf');var config=require(_0xba11('0x7'));var attributes=require(_0xba11('0x8'));module[_0xba11('0x9')]=function(_0x274314,_0x2ce405){return _0x274314[_0xba11('0xa')](_0xba11('0xb'),attributes,{'tableName':_0xba11('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba11('0xd'),'collate':_0xba11('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 7e8d3e6..a77b3b5 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 _0x3ffb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x53ac45,_0x54b927){var _0x44f99b=function(_0x14c47c){while(--_0x14c47c){_0x53ac45['push'](_0x53ac45['shift']());}};_0x44f99b(++_0x54b927);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x2b2de9,_0x26baa0){_0x2b2de9=_0x2b2de9-0x0;var _0x3ed6bc=_0x3ffb[_0x2b2de9];return _0x3ed6bc;};'use strict';var _=require(_0xb3ff('0x0'));var util=require(_0xb3ff('0x1'));var moment=require(_0xb3ff('0x2'));var BPromise=require(_0xb3ff('0x3'));var rs=require(_0xb3ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3ff('0x5'))['db'];var utils=require(_0xb3ff('0x6'));var logger=require(_0xb3ff('0x7'))(_0xb3ff('0x8'));var config=require(_0xb3ff('0x9'));var jayson=require(_0xb3ff('0xa'));var client=jayson[_0xb3ff('0xb')]['http']({'port':0x232a});config[_0xb3ff('0xc')]=_[_0xb3ff('0xd')](config[_0xb3ff('0xc')],{'host':_0xb3ff('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb3ff('0xf'))[_0xb3ff('0x10')](socket);function respondWithRpcPromise(_0x46c205,_0x59d890,_0x4ced35){return new BPromise(function(_0x392502,_0x2a8696){return client['request'](_0x46c205,_0x4ced35)[_0xb3ff('0x11')](function(_0x2b6ecb){logger[_0xb3ff('0x12')](_0xb3ff('0x13'),_0x59d890,_0xb3ff('0x14'));logger[_0xb3ff('0x15')](_0xb3ff('0x16'),_0x59d890,_0xb3ff('0x14'),JSON['stringify'](_0x2b6ecb));if(_0x2b6ecb[_0xb3ff('0x17')]){if(_0x2b6ecb[_0xb3ff('0x17')][_0xb3ff('0x18')]===0x1f4){logger[_0xb3ff('0x17')](_0xb3ff('0x13'),_0x59d890,_0x2b6ecb[_0xb3ff('0x17')]['message']);return _0x2a8696(_0x2b6ecb[_0xb3ff('0x17')]['message']);}logger[_0xb3ff('0x17')](_0xb3ff('0x13'),_0x59d890,_0x2b6ecb['error'][_0xb3ff('0x19')]);return _0x392502(_0x2b6ecb[_0xb3ff('0x17')][_0xb3ff('0x19')]);}else{logger[_0xb3ff('0x12')](_0xb3ff('0x13'),_0x59d890,_0xb3ff('0x14'));_0x392502(_0x2b6ecb[_0xb3ff('0x1a')][_0xb3ff('0x19')]);}})['catch'](function(_0x16c06b){logger['error'](_0xb3ff('0x13'),_0x59d890,_0x16c06b);_0x2a8696(_0x16c06b);});});} \ No newline at end of file +var _0x8ea8=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x1c49a1,_0x112b7d){var _0x4dfd7d=function(_0x59e401){while(--_0x59e401){_0x1c49a1['push'](_0x1c49a1['shift']());}};_0x4dfd7d(++_0x112b7d);}(_0x8ea8,0xca));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x88ea('0x0'));var moment=require('moment');var BPromise=require(_0x88ea('0x1'));var rs=require(_0x88ea('0x2'));var fs=require('fs');var Redis=require(_0x88ea('0x3'));var db=require(_0x88ea('0x4'))['db'];var utils=require(_0x88ea('0x5'));var logger=require('../../config/logger')(_0x88ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88ea('0x7')][_0x88ea('0x8')]({'port':0x232a});config[_0x88ea('0x9')]=_[_0x88ea('0xa')](config['redis'],{'host':_0x88ea('0xb'),'port':0x18eb});var socket=require(_0x88ea('0xc'))(new Redis(config[_0x88ea('0x9')]));require(_0x88ea('0xd'))[_0x88ea('0xe')](socket);function respondWithRpcPromise(_0x494b33,_0x1cdab9,_0x515aa0){return new BPromise(function(_0x1a3865,_0x512459){return client[_0x88ea('0xf')](_0x494b33,_0x515aa0)[_0x88ea('0x10')](function(_0x13918e){logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));logger[_0x88ea('0x14')](_0x88ea('0x15'),_0x1cdab9,_0x88ea('0x13'),JSON[_0x88ea('0x16')](_0x13918e));if(_0x13918e[_0x88ea('0x17')]){if(_0x13918e[_0x88ea('0x17')][_0x88ea('0x18')]===0x1f4){logger['error'](_0x88ea('0x12'),_0x1cdab9,_0x13918e['error'][_0x88ea('0x19')]);return _0x512459(_0x13918e['error'][_0x88ea('0x19')]);}logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x13918e[_0x88ea('0x17')][_0x88ea('0x19')]);return _0x1a3865(_0x13918e['error'][_0x88ea('0x19')]);}else{logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));_0x1a3865(_0x13918e[_0x88ea('0x1a')][_0x88ea('0x19')]);}})['catch'](function(_0x39f3b7){logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x39f3b7);_0x512459(_0x39f3b7);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ebd5948..61f3653 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 _0x030c=['removeListener','length','chatInternalMessage:','save','update'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x030c,0x1d4));var _0xc030=function(_0x45730c,_0x5aa7a1){_0x45730c=_0x45730c-0x0;var _0xf66e31=_0x030c[_0x45730c];return _0xf66e31;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xc030('0x0'),'remove',_0xc030('0x1')];function createListener(_0x2fa2ae,_0x4c10d3){return function(_0x5ff6ef){_0x4c10d3['emit'](_0x2fa2ae,_0x5ff6ef);};}function removeListener(_0x52fd5c,_0x573646){return function(){ChatInternalMessageEvents[_0xc030('0x2')](_0x52fd5c,_0x573646);};}exports['register']=function(_0x453a92){for(var _0x419cac=0x0,_0x4359c1=events[_0xc030('0x3')];_0x419cac<_0x4359c1;_0x419cac++){var _0x193523=events[_0x419cac];var _0x295920=createListener(_0xc030('0x4')+_0x193523,_0x453a92);ChatInternalMessageEvents['on'](_0x193523,_0x295920);}}; \ No newline at end of file +var _0x656e=['remove','update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x498107,_0x4359b4){var _0x107c7c=function(_0x12097d){while(--_0x12097d){_0x498107['push'](_0x498107['shift']());}};_0x107c7c(++_0x4359b4);}(_0x656e,0x17e));var _0xe656=function(_0x2e5011,_0x2ed248){_0x2e5011=_0x2e5011-0x0;var _0x4fed64=_0x656e[_0x2e5011];return _0x4fed64;};'use strict';var ChatInternalMessageEvents=require(_0xe656('0x0'));var events=[_0xe656('0x1'),_0xe656('0x2'),_0xe656('0x3')];function createListener(_0x49d47a,_0x36709b){return function(_0x28988a){_0x36709b[_0xe656('0x4')](_0x49d47a,_0x28988a);};}function removeListener(_0x1d5c24,_0x48650d){return function(){ChatInternalMessageEvents[_0xe656('0x5')](_0x1d5c24,_0x48650d);};}exports[_0xe656('0x6')]=function(_0x216c69){for(var _0x1a4d14=0x0,_0x3f0c33=events['length'];_0x1a4d14<_0x3f0c33;_0x1a4d14++){var _0x117c71=events[_0x1a4d14];var _0x41ee33=createListener(_0xe656('0x7')+_0x117c71,_0x216c69);ChatInternalMessageEvents['on'](_0x117c71,_0x41ee33);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7789b74..f1de49d 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 _0x17d0=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x51e1d5,_0x399588){var _0x105666=function(_0x325128){while(--_0x325128){_0x51e1d5['push'](_0x51e1d5['shift']());}};_0x105666(++_0x399588);}(_0x17d0,0x1f0));var _0x017d=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x17d0[_0x514c15];return _0x16283e;};'use strict';var multer=require(_0x017d('0x0'));var util=require(_0x017d('0x1'));var path=require(_0x017d('0x2'));var timeout=require(_0x017d('0x3'));var express=require('express');var router=express[_0x017d('0x4')]();var fs_extra=require(_0x017d('0x5'));var auth=require(_0x017d('0x6'));var interaction=require(_0x017d('0x7'));var config=require('../../config/environment');var controller=require(_0x017d('0x8'));router[_0x017d('0x9')]('/',auth[_0x017d('0xa')](),controller[_0x017d('0xb')]);router[_0x017d('0x9')](_0x017d('0xc'),auth['isAuthenticated'](),controller[_0x017d('0xd')]);router['get'](_0x017d('0xe'),auth['isAuthenticated'](),controller[_0x017d('0xf')]);router[_0x017d('0x9')](_0x017d('0x10'),auth[_0x017d('0xa')](),controller[_0x017d('0x11')]);router[_0x017d('0x12')]('/',auth[_0x017d('0xa')](),controller['create']);router[_0x017d('0x13')](_0x017d('0x10'),controller[_0x017d('0x14')]);router[_0x017d('0x15')](_0x017d('0x10'),auth['isAuthenticated'](),controller[_0x017d('0x16')]);module[_0x017d('0x17')]=router; \ No newline at end of file +var _0xb31e=['get','/describe','describe','isAuthenticated','getUsers','show','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x9bca53,_0x59b4f8){var _0x3894bc=function(_0x1ae67d){while(--_0x1ae67d){_0x9bca53['push'](_0x9bca53['shift']());}};_0x3894bc(++_0x59b4f8);}(_0xb31e,0x186));var _0xeb31=function(_0xb437bb,_0x30631d){_0xb437bb=_0xb437bb-0x0;var _0x1bc5ec=_0xb31e[_0xb437bb];return _0x1bc5ec;};'use strict';var multer=require(_0xeb31('0x0'));var util=require(_0xeb31('0x1'));var path=require(_0xeb31('0x2'));var timeout=require(_0xeb31('0x3'));var express=require(_0xeb31('0x4'));var router=express[_0xeb31('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb31('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb31('0x7'));var controller=require(_0xeb31('0x8'));router[_0xeb31('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xeb31('0xa'),auth['isAuthenticated'](),controller[_0xeb31('0xb')]);router['get']('/users',auth[_0xeb31('0xc')](),controller[_0xeb31('0xd')]);router[_0xeb31('0x9')]('/:id',auth[_0xeb31('0xc')](),controller[_0xeb31('0xe')]);router['post']('/',auth[_0xeb31('0xc')](),controller[_0xeb31('0xf')]);router[_0xeb31('0x10')](_0xeb31('0x11'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xeb31('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index e27f82d..160c216 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 _0x4b0f=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x45b89e,_0x426d42){var _0x1fdb9a=function(_0xd62d53){while(--_0xd62d53){_0x45b89e['push'](_0x45b89e['shift']());}};_0x1fdb9a(++_0x426d42);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x6e17f2,_0xcc4a45){_0x6e17f2=_0x6e17f2-0x0;var _0x1cc6b5=_0x4b0f[_0x6e17f2];return _0x1cc6b5;};'use strict';var Sequelize=require('sequelize');module[_0xf4b0('0x0')]={'body':{'type':Sequelize[_0xf4b0('0x1')](_0xf4b0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf4b0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf4b0('0x4')]('in',_0xf4b0('0x5')),'defaultValue':_0xf4b0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf4b0('0x6')]},'providerName':{'type':Sequelize[_0xf4b0('0x7')]},'providerResponse':{'type':Sequelize[_0xf4b0('0x1')]}}; \ No newline at end of file +var _0x9a2d=['out','DATE','STRING','TEXT','BOOLEAN','ENUM'];(function(_0x1593a7,_0x2b7304){var _0x1aaa80=function(_0x14cb95){while(--_0x14cb95){_0x1593a7['push'](_0x1593a7['shift']());}};_0x1aaa80(++_0x2b7304);}(_0x9a2d,0x123));var _0xd9a2=function(_0x19d64d,_0x4ee42e){_0x19d64d=_0x19d64d-0x0;var _0x560c5a=_0x9a2d[_0x19d64d];return _0x560c5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd9a2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9a2('0x2')]('in',_0xd9a2('0x3')),'defaultValue':_0xd9a2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9a2('0x4')]},'providerName':{'type':Sequelize[_0xd9a2('0x5')]},'providerResponse':{'type':Sequelize[_0xd9a2('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1ab5c14..df34f6f 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 _0x7383=['fields','length','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','internal','interface','channel','motionChannel','accept','EventManager','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','SIP/%s','event','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','name','send','map','ChatMessage','fieldName','key','keys','query','intersection','model','attributes'];(function(_0x1a4bc5,_0x327698){var _0x773cd6=function(_0x162dfd){while(--_0x162dfd){_0x1a4bc5['push'](_0x1a4bc5['shift']());}};_0x773cd6(++_0x327698);}(_0x7383,0x1c5));var _0x3738=function(_0x23280e,_0x2467e4){_0x23280e=_0x23280e-0x0;var _0x47f3b7=_0x7383[_0x23280e];return _0x47f3b7;};'use strict';var emlformat=require(_0x3738('0x0'));var rimraf=require(_0x3738('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3738('0x2'));var rp=require(_0x3738('0x3'));var moment=require(_0x3738('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3738('0x5'));var path=require(_0x3738('0x6'));var sox=require(_0x3738('0x7'));var csv=require(_0x3738('0x8'));var ejs=require(_0x3738('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3738('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3738('0xb'));var deskjs=require(_0x3738('0xc'));var toCsv=require(_0x3738('0x8'));var querystring=require(_0x3738('0xd'));var Papa=require(_0x3738('0xe'));var Redis=require('ioredis');var authService=require(_0x3738('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3738('0x10'));var hardwareService=require(_0x3738('0x11'));var logger=require(_0x3738('0x12'))(_0x3738('0x13'));var utils=require('../../config/utils');var config=require(_0x3738('0x14'));var licenseUtil=require(_0x3738('0x15'));var db=require(_0x3738('0x16'))['db'];config[_0x3738('0x17')]=_[_0x3738('0x18')](config[_0x3738('0x17')],{'host':_0x3738('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3738('0x17')]));require(_0x3738('0x1a'))[_0x3738('0x1b')](socket);var jayson=require(_0x3738('0x1c'));var client=jayson['client'][_0x3738('0x1d')]({'port':0x232c});var client9002=jayson[_0x3738('0x1e')][_0x3738('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x22107b,_0x2f2e49,_0xf98b6e,_0xcfdc72){return new BPromise(function(_0x392496,_0xc701dd){var _0x130102=_0xcfdc72||client;return _0x130102[_0x3738('0x1f')](_0x22107b,_0xf98b6e)['then'](function(_0x45e152){logger[_0x3738('0x20')]('ChatMessage,\x20%s,\x20%s',_0x2f2e49,_0x3738('0x21'));logger[_0x3738('0x22')](_0x3738('0x23'),_0x2f2e49,_0x3738('0x21'),JSON[_0x3738('0x24')](_0x45e152));if(_0x45e152[_0x3738('0x25')]){if(_0x45e152[_0x3738('0x25')][_0x3738('0x26')]===0x1f4){logger[_0x3738('0x25')](_0x3738('0x27'),_0x2f2e49,_0x45e152[_0x3738('0x25')][_0x3738('0x28')]);return _0xc701dd(_0x45e152[_0x3738('0x25')][_0x3738('0x28')]);}logger[_0x3738('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2f2e49,_0x45e152['error'][_0x3738('0x28')]);return _0x392496(_0x45e152[_0x3738('0x25')]['message']);}else{logger['info'](_0x3738('0x27'),_0x2f2e49,'request\x20sent');_0x392496(_0x45e152[_0x3738('0x29')][_0x3738('0x28')]);}})[_0x3738('0x2a')](function(_0x32f887){logger['error'](_0x3738('0x27'),_0x2f2e49,_0x32f887);_0xc701dd(_0x32f887);});});}function respondWithStatusCode(_0x1a1bec,_0x299288){_0x299288=_0x299288||0xcc;return function(_0x4606a3){if(_0x4606a3){return _0x1a1bec[_0x3738('0x2b')](_0x299288);}return _0x1a1bec[_0x3738('0x2c')](_0x299288)['end']();};}function respondWithResult(_0x39478b,_0x5072b0){_0x5072b0=_0x5072b0||0xc8;return function(_0x4f61d9){if(_0x4f61d9){return _0x39478b[_0x3738('0x2c')](_0x5072b0)[_0x3738('0x2d')](_0x4f61d9);}};}function respondWithFilteredResult(_0x1fb5a3,_0xc2eb12){return function(_0x59d12a){if(_0x59d12a){var _0x3fb8f2=typeof _0xc2eb12[_0x3738('0x2e')]===_0x3738('0x2f')&&typeof _0xc2eb12[_0x3738('0x30')]===_0x3738('0x2f');var _0x4a2a81=_0x59d12a[_0x3738('0x31')];var _0x234be3=_0x3fb8f2?0x0:_0xc2eb12[_0x3738('0x2e')];var _0x3c7ba7=_0x3fb8f2?_0x59d12a[_0x3738('0x31')]:_0xc2eb12[_0x3738('0x2e')]+_0xc2eb12['limit'];var _0x2d734d;if(_0x3c7ba7>=_0x4a2a81){_0x3c7ba7=_0x4a2a81;_0x2d734d=0xc8;}else{_0x2d734d=0xce;}_0x1fb5a3[_0x3738('0x2c')](_0x2d734d);return _0x1fb5a3['set'](_0x3738('0x32'),_0x234be3+'-'+_0x3c7ba7+'/'+_0x4a2a81)[_0x3738('0x2d')](_0x59d12a);}return null;};}function patchUpdates(_0x5d7380){return function(_0x54bc8a){try{jsonpatch['apply'](_0x54bc8a,_0x5d7380,!![]);}catch(_0x411a8c){return BPromise[_0x3738('0x33')](_0x411a8c);}return _0x54bc8a['save']();};}function saveUpdates(_0x46693e,_0x12c900){return function(_0x2583db){if(_0x2583db){return _0x2583db[_0x3738('0x34')](_0x46693e)[_0x3738('0x35')](function(_0x35f924){return _0x35f924;});}return null;};}function removeEntity(_0x29fcda,_0x43c1ad){return function(_0x41a245){if(_0x41a245){return _0x41a245[_0x3738('0x36')]()[_0x3738('0x35')](function(){_0x29fcda['status'](0xcc)[_0x3738('0x37')]();});}};}function handleEntityNotFound(_0x188872,_0x63c29a){return function(_0x491ea6){if(!_0x491ea6){_0x188872[_0x3738('0x2b')](0x194);}return _0x491ea6;};}function handleError(_0x553224,_0x512af7){_0x512af7=_0x512af7||0x1f4;return function(_0x1b7fc9){logger['error'](_0x1b7fc9['stack']);if(_0x1b7fc9[_0x3738('0x38')]){delete _0x1b7fc9['name'];}_0x553224[_0x3738('0x2c')](_0x512af7)[_0x3738('0x39')](_0x1b7fc9);};}exports['index']=function(_0x4d7fcd,_0x15b68f){var _0x5ef3ea={},_0x3e811a={},_0x3b98c4={'count':0x0,'rows':[]};var _0x3ec952=_[_0x3738('0x3a')](db[_0x3738('0x3b')]['rawAttributes'],function(_0x1f0dd1){return{'name':_0x1f0dd1[_0x3738('0x3c')],'type':_0x1f0dd1['type'][_0x3738('0x3d')]};});_0x3e811a['model']=_[_0x3738('0x3a')](_0x3ec952,_0x3738('0x38'));_0x3e811a['query']=_[_0x3738('0x3e')](_0x4d7fcd[_0x3738('0x3f')]);_0x3e811a['filters']=_[_0x3738('0x40')](_0x3e811a[_0x3738('0x41')],_0x3e811a['query']);_0x5ef3ea[_0x3738('0x42')]=_[_0x3738('0x40')](_0x3e811a['model'],qs[_0x3738('0x43')](_0x4d7fcd[_0x3738('0x3f')][_0x3738('0x43')]));_0x5ef3ea[_0x3738('0x42')]=_0x5ef3ea['attributes'][_0x3738('0x44')]?_0x5ef3ea[_0x3738('0x42')]:_0x3e811a[_0x3738('0x41')];if(!_0x4d7fcd[_0x3738('0x3f')]['hasOwnProperty']('nolimit')){_0x5ef3ea[_0x3738('0x30')]=qs[_0x3738('0x30')](_0x4d7fcd['query'][_0x3738('0x30')]);_0x5ef3ea[_0x3738('0x2e')]=qs[_0x3738('0x2e')](_0x4d7fcd[_0x3738('0x3f')]['offset']);}_0x5ef3ea[_0x3738('0x45')]=qs[_0x3738('0x46')](_0x4d7fcd[_0x3738('0x3f')]['sort']);_0x5ef3ea['where']=qs[_0x3738('0x47')](_[_0x3738('0x48')](_0x4d7fcd['query'],_0x3e811a[_0x3738('0x47')]),_0x3ec952);if(_0x4d7fcd[_0x3738('0x3f')][_0x3738('0x49')]){_0x5ef3ea[_0x3738('0x4a')]=_[_0x3738('0x4b')](_0x5ef3ea[_0x3738('0x4a')],{'$or':_[_0x3738('0x3a')](_0x3ec952,function(_0xc2ede5){if(_0xc2ede5[_0x3738('0x4c')]!==_0x3738('0x4d')){var _0x12c913={};_0x12c913[_0xc2ede5['name']]={'$like':'%'+_0x4d7fcd[_0x3738('0x3f')][_0x3738('0x49')]+'%'};return _0x12c913;}})});}_0x5ef3ea=_[_0x3738('0x4b')]({},_0x5ef3ea,_0x4d7fcd[_0x3738('0x4e')]);var _0x24bfcd={'where':_0x5ef3ea['where']};return db[_0x3738('0x3b')][_0x3738('0x31')](_0x24bfcd)[_0x3738('0x35')](function(_0x5314f8){_0x3b98c4[_0x3738('0x31')]=_0x5314f8;if(_0x4d7fcd['query'][_0x3738('0x4f')]){_0x5ef3ea[_0x3738('0x50')]=[{'all':!![]}];}return db[_0x3738('0x3b')][_0x3738('0x51')](_0x5ef3ea);})[_0x3738('0x35')](function(_0x542c67){_0x3b98c4[_0x3738('0x52')]=_0x542c67;return _0x3b98c4;})[_0x3738('0x35')](respondWithFilteredResult(_0x15b68f,_0x5ef3ea))[_0x3738('0x2a')](handleError(_0x15b68f,null));};exports[_0x3738('0x53')]=function(_0x215e98,_0x17e180){var _0x1996ff={'raw':!![],'where':{'id':_0x215e98[_0x3738('0x54')]['id']}},_0x4f2753={};_0x4f2753['model']=_[_0x3738('0x3e')](db[_0x3738('0x3b')][_0x3738('0x55')]);_0x4f2753['query']=_[_0x3738('0x3e')](_0x215e98[_0x3738('0x3f')]);_0x4f2753[_0x3738('0x47')]=_['intersection'](_0x4f2753[_0x3738('0x41')],_0x4f2753[_0x3738('0x3f')]);_0x1996ff[_0x3738('0x42')]=_[_0x3738('0x40')](_0x4f2753[_0x3738('0x41')],qs[_0x3738('0x43')](_0x215e98[_0x3738('0x3f')][_0x3738('0x43')]));_0x1996ff[_0x3738('0x42')]=_0x1996ff[_0x3738('0x42')]['length']?_0x1996ff[_0x3738('0x42')]:_0x4f2753['model'];if(_0x215e98[_0x3738('0x3f')]['includeAll']){_0x1996ff[_0x3738('0x50')]=[{'all':!![]}];}_0x1996ff=_[_0x3738('0x4b')]({},_0x1996ff,_0x215e98[_0x3738('0x4e')]);return db[_0x3738('0x3b')][_0x3738('0x56')](_0x1996ff)[_0x3738('0x35')](handleEntityNotFound(_0x17e180,null))['then'](respondWithResult(_0x17e180,null))[_0x3738('0x2a')](handleError(_0x17e180,null));};exports['create']=function(_0x4bec3b,_0x21fe37){return db[_0x3738('0x3b')][_0x3738('0x57')](_0x4bec3b[_0x3738('0x58')],{})[_0x3738('0x35')](respondWithResult(_0x21fe37,0xc9))['catch'](handleError(_0x21fe37,null));};exports[_0x3738('0x34')]=function(_0x32df0c,_0x406bed){if(_0x32df0c[_0x3738('0x58')]['id']){delete _0x32df0c[_0x3738('0x58')]['id'];}return db[_0x3738('0x3b')]['find']({'where':{'id':_0x32df0c[_0x3738('0x54')]['id']}})['then'](handleEntityNotFound(_0x406bed,null))['then'](saveUpdates(_0x32df0c[_0x3738('0x58')],null))[_0x3738('0x35')](respondWithResult(_0x406bed,null))['catch'](handleError(_0x406bed,null));};exports['destroy']=function(_0x2d9a0a,_0x323d8b){return db['ChatMessage'][_0x3738('0x56')]({'where':{'id':_0x2d9a0a[_0x3738('0x54')]['id']}})[_0x3738('0x35')](handleEntityNotFound(_0x323d8b,null))[_0x3738('0x35')](removeEntity(_0x323d8b,null))[_0x3738('0x2a')](handleError(_0x323d8b,null));};exports[_0x3738('0x59')]=function(_0x45c226,_0x3d50ce){return db[_0x3738('0x3b')]['describe']()[_0x3738('0x35')](respondWithResult(_0x3d50ce,null))[_0x3738('0x2a')](handleError(_0x3d50ce,null));};var interaction_log=require(_0x3738('0x12'))(_0x3738('0x5a'));exports['accept']=function(_0x402c28,_0x5b9960,_0x252a80){var _0x51bb5e={'agent':{},'channel':_0x3738('0x5b')};if(_0x402c28[_0x3738('0x58')]['id']){delete _0x402c28[_0x3738('0x58')]['id'];}_0x402c28[_0x3738('0x58')][_0x3738('0x5c')]=!![];_0x402c28[_0x3738('0x58')][_0x3738('0x5d')]=moment()[_0x3738('0x5e')](_0x3738('0x5f'));_0x402c28[_0x3738('0x58')][_0x3738('0x60')]=_0x402c28[_0x3738('0x58')][_0x3738('0x60')]||_0x402c28[_0x3738('0x61')]['id'];_0x51bb5e[_0x3738('0x62')]['id']=_0x402c28[_0x3738('0x58')][_0x3738('0x60')];return db[_0x3738('0x3b')][_0x3738('0x56')]({'where':{'id':_0x402c28['params']['id'],'UserId':null}})[_0x3738('0x35')](handleEntityNotFound(_0x5b9960,null))[_0x3738('0x35')](saveUpdates(_0x402c28['body'],null))[_0x3738('0x35')](function(_0x5e6d16){if(_0x5e6d16){_0x51bb5e[_0x3738('0x28')]=_0x5e6d16['get']({'plain':!![]});return db[_0x3738('0x63')][_0x3738('0x56')]({'where':{'id':_0x5e6d16[_0x3738('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x5b9960,null))[_0x3738('0x35')](function(_0x3d16ac){if(_0x3d16ac){return _0x3d16ac[_0x3738('0x34')]({'UserId':_0x402c28[_0x3738('0x58')][_0x3738('0x60')],'read1stAt':_[_0x3738('0x65')](_0x3d16ac[_0x3738('0x66')])?moment()[_0x3738('0x5e')](_0x3738('0x5f')):undefined});}return null;})[_0x3738('0x35')](function(_0x5d0ebe){if(_0x5d0ebe){_0x51bb5e[_0x3738('0x67')]=_0x5d0ebe[_0x3738('0x68')]({'plain':!![]});interaction_log['info'](_0x3738('0x69'),_0x402c28[_0x3738('0x61')]['id'],_0x402c28['user']['name'],_0x402c28[_0x3738('0x61')]['role'],_0x51bb5e[_0x3738('0x67')]['id'],_0x402c28[_0x3738('0x58')]?JSON[_0x3738('0x24')](_0x402c28[_0x3738('0x58')]):_0x3738('0x6a'));return respondWithRpcPromise(_0x3738('0x6b'),_0x3738('0x6c'),_0x51bb5e);}return null;})[_0x3738('0x35')](function(_0x1e3c28){var _0x29b587=_0x3738('0x6d')+_0x1e3c28[_0x3738('0x28')][_0x3738('0x6e')];return db[_0x3738('0x6f')]['query'](_0x29b587,{'type':db[_0x3738('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3738('0x35')](function(_0x2a22dd){return _0x2a22dd;});})[_0x3738('0x35')](function(_0x5cc852){if(_0x5cc852){_0x51bb5e[_0x3738('0x28')][_0x3738('0x71')]=_0x5cc852[0x0];if(!_0x402c28['body'][_0x3738('0x60')])return;return db[_0x3738('0x72')]['find']({'where':{'id':_0x402c28[_0x3738('0x58')][_0x3738('0x60')],'role':_0x3738('0x62')},'attributes':['id',_0x3738('0x38'),_0x3738('0x73'),'email',_0x3738('0x74')],'raw':!![]});}return null;})[_0x3738('0x35')](function(_0x2e1dfc){if(!_0x2e1dfc)return null;_0x51bb5e[_0x3738('0x28')][_0x3738('0x62')]=_0x2e1dfc;return _0x51bb5e;})[_0x3738('0x35')](function(_0x52defa){if(_0x52defa){if(_0x402c28[_0x3738('0x58')]['manual']){_0x51bb5e['message'][_0x3738('0x75')]=util[_0x3738('0x5e')]('SIP/%s',_0x402c28[_0x3738('0x61')]['name']);_0x51bb5e[_0x3738('0x28')][_0x3738('0x76')]=_0x51bb5e['channel'];_0x51bb5e[_0x3738('0x28')][_0x3738('0x77')]=_0x51bb5e['channel'];_0x51bb5e['message']['event']=_0x3738('0x78');return respondWithRpcPromise(_0x3738('0x79'),_0x3738('0x79'),{'event':'acceptmessage','message':_[_0x3738('0x4b')](_0x51bb5e[_0x3738('0x28')],JSON[_0x3738('0x7a')](_0x51bb5e['interaction'][_0x3738('0x7b')]))},client9002)[_0x3738('0x35')](function(){return _0x51bb5e;});}return _0x51bb5e;}return null;})[_0x3738('0x35')](respondWithResult(_0x5b9960,null))[_0x3738('0x2a')](handleError(_0x5b9960,null));};var interaction_log=require(_0x3738('0x12'))(_0x3738('0x5a'));exports['reject']=function(_0x536ea9,_0x3c2675,_0x4fc715){var _0x5bf821={'agent':{},'channel':_0x3738('0x5b')};if(_0x536ea9[_0x3738('0x58')]['id']){delete _0x536ea9['body']['id'];}_0x536ea9[_0x3738('0x58')]['UserId']=_0x536ea9[_0x3738('0x58')][_0x3738('0x60')]||_0x536ea9[_0x3738('0x61')]['id'];_0x5bf821['agent']['id']=_0x536ea9[_0x3738('0x58')]['UserId'];return db['ChatMessage'][_0x3738('0x56')]({'where':{'id':_0x536ea9[_0x3738('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c2675,null))[_0x3738('0x35')](function(_0x18cc6b){if(_0x18cc6b){_0x5bf821[_0x3738('0x28')]=_0x18cc6b[_0x3738('0x68')]({'plain':!![]});return db[_0x3738('0x63')]['find']({'where':{'id':_0x18cc6b['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3c2675,null))[_0x3738('0x35')](function(_0x3e0945){if(_0x3e0945){_0x5bf821[_0x3738('0x67')]=_0x3e0945['get']({'plain':!![]});interaction_log[_0x3738('0x20')](_0x3738('0x7c'),_0x536ea9[_0x3738('0x61')]['id'],_0x536ea9[_0x3738('0x61')][_0x3738('0x38')],_0x536ea9[_0x3738('0x61')]['role'],_0x5bf821[_0x3738('0x67')]['id'],_0x536ea9[_0x3738('0x58')]?JSON[_0x3738('0x24')](_0x536ea9[_0x3738('0x58')]):_0x3738('0x6a'));return respondWithRpcPromise(_0x3738('0x7d'),'rejectMessage',_0x5bf821);}return null;})[_0x3738('0x35')](function(_0x1d0d08){var _0x4ef0da=_0x3738('0x6d')+_0x1d0d08['message'][_0x3738('0x6e')];return db['sequelize']['query'](_0x4ef0da,{'type':db['Sequelize'][_0x3738('0x7e')]['SELECT'],'raw':!![]})[_0x3738('0x35')](function(_0x368c69){return _0x368c69;});})[_0x3738('0x35')](function(_0x3d1eff){if(_0x3d1eff){_0x5bf821[_0x3738('0x28')][_0x3738('0x71')]=_0x3d1eff[0x0];if(!_0x536ea9[_0x3738('0x58')][_0x3738('0x60')])return;return db['User'][_0x3738('0x56')]({'where':{'id':_0x536ea9[_0x3738('0x58')][_0x3738('0x60')],'role':_0x3738('0x62')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0xc13f58){if(!_0xc13f58)return null;_0x5bf821[_0x3738('0x28')]['agent']=_0xc13f58;return _0x5bf821;})[_0x3738('0x35')](function(_0x47d42b){if(_0x47d42b){_0x47d42b['message']['interface']=util[_0x3738('0x5e')](_0x3738('0x7f'),_0x536ea9[_0x3738('0x61')][_0x3738('0x38')]);_0x47d42b[_0x3738('0x28')]['channel']=_0x5bf821[_0x3738('0x76')];_0x47d42b[_0x3738('0x28')][_0x3738('0x77')]=_0x5bf821['channel'];_0x47d42b[_0x3738('0x28')][_0x3738('0x80')]='reject';respondWithRpcPromise(_0x3738('0x79'),'EventManager',{'event':_0x3738('0x81'),'message':_[_0x3738('0x4b')](_0x5bf821[_0x3738('0x28')],JSON[_0x3738('0x7a')](_0x5bf821[_0x3738('0x67')][_0x3738('0x7b')]))},client9002);return _0x5bf821;}return null;})[_0x3738('0x35')](respondWithResult(_0x3c2675,null))[_0x3738('0x2a')](handleError(_0x3c2675,null));}; \ No newline at end of file +var _0xb5d8=['read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','chat','interaction','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','end','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','create','body','update','destroy','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil'];(function(_0xfd08aa,_0x7aacdb){var _0x1b177d=function(_0x191215){while(--_0x191215){_0xfd08aa['push'](_0xfd08aa['shift']());}};_0x1b177d(++_0x7aacdb);}(_0xb5d8,0x1a8));var _0x8b5d=function(_0x24d3bf,_0x342400){_0x24d3bf=_0x24d3bf-0x0;var _0x11bd65=_0xb5d8[_0x24d3bf];return _0x11bd65;};'use strict';var emlformat=require(_0x8b5d('0x0'));var rimraf=require(_0x8b5d('0x1'));var zipdir=require(_0x8b5d('0x2'));var jsonpatch=require(_0x8b5d('0x3'));var rp=require(_0x8b5d('0x4'));var moment=require(_0x8b5d('0x5'));var BPromise=require(_0x8b5d('0x6'));var Mustache=require('mustache');var util=require(_0x8b5d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8b5d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b5d('0x9'));var _=require('lodash');var squel=require(_0x8b5d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8b5d('0xb'));var deskjs=require(_0x8b5d('0xc'));var toCsv=require(_0x8b5d('0x8'));var querystring=require(_0x8b5d('0xd'));var Papa=require(_0x8b5d('0xe'));var Redis=require(_0x8b5d('0xf'));var authService=require(_0x8b5d('0x10'));var qs=require(_0x8b5d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b5d('0x12'));var logger=require('../../config/logger')(_0x8b5d('0x13'));var utils=require(_0x8b5d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8b5d('0x15'));var db=require(_0x8b5d('0x16'))['db'];config[_0x8b5d('0x17')]=_[_0x8b5d('0x18')](config[_0x8b5d('0x17')],{'host':_0x8b5d('0x19'),'port':0x18eb});var socket=require(_0x8b5d('0x1a'))(new Redis(config[_0x8b5d('0x17')]));require(_0x8b5d('0x1b'))[_0x8b5d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8b5d('0x1d')][_0x8b5d('0x1e')]({'port':0x232c});var client9002=jayson[_0x8b5d('0x1d')][_0x8b5d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xebb7e5,_0x3d0899,_0xc86920,_0x47faf2){return new BPromise(function(_0x554572,_0x553f05){var _0x1b50de=_0x47faf2||client;return _0x1b50de[_0x8b5d('0x1f')](_0xebb7e5,_0xc86920)['then'](function(_0x21c263){logger[_0x8b5d('0x20')](_0x8b5d('0x21'),_0x3d0899,_0x8b5d('0x22'));logger[_0x8b5d('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d0899,_0x8b5d('0x22'),JSON[_0x8b5d('0x24')](_0x21c263));if(_0x21c263[_0x8b5d('0x25')]){if(_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x26')]===0x1f4){logger[_0x8b5d('0x25')](_0x8b5d('0x21'),_0x3d0899,_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x27')]);return _0x553f05(_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x27')]);}logger['error'](_0x8b5d('0x21'),_0x3d0899,_0x21c263[_0x8b5d('0x25')]['message']);return _0x554572(_0x21c263['error']['message']);}else{logger[_0x8b5d('0x20')](_0x8b5d('0x21'),_0x3d0899,_0x8b5d('0x22'));_0x554572(_0x21c263[_0x8b5d('0x28')][_0x8b5d('0x27')]);}})[_0x8b5d('0x29')](function(_0x172064){logger['error'](_0x8b5d('0x21'),_0x3d0899,_0x172064);_0x553f05(_0x172064);});});}function respondWithStatusCode(_0x317978,_0x345c53){_0x345c53=_0x345c53||0xcc;return function(_0x47812f){if(_0x47812f){return _0x317978[_0x8b5d('0x2a')](_0x345c53);}return _0x317978[_0x8b5d('0x2b')](_0x345c53)['end']();};}function respondWithResult(_0x435036,_0x429133){_0x429133=_0x429133||0xc8;return function(_0xb585d1){if(_0xb585d1){return _0x435036[_0x8b5d('0x2b')](_0x429133)[_0x8b5d('0x2c')](_0xb585d1);}};}function respondWithFilteredResult(_0x481f37,_0x137fcd){return function(_0x494cc8){if(_0x494cc8){var _0x5d71f2=typeof _0x137fcd[_0x8b5d('0x2d')]==='undefined'&&typeof _0x137fcd[_0x8b5d('0x2e')]===_0x8b5d('0x2f');var _0x5b106d=_0x494cc8[_0x8b5d('0x30')];var _0xd98181=_0x5d71f2?0x0:_0x137fcd[_0x8b5d('0x2d')];var _0x4129fc=_0x5d71f2?_0x494cc8[_0x8b5d('0x30')]:_0x137fcd['offset']+_0x137fcd[_0x8b5d('0x2e')];var _0x25f2c8;if(_0x4129fc>=_0x5b106d){_0x4129fc=_0x5b106d;_0x25f2c8=0xc8;}else{_0x25f2c8=0xce;}_0x481f37[_0x8b5d('0x2b')](_0x25f2c8);return _0x481f37[_0x8b5d('0x31')](_0x8b5d('0x32'),_0xd98181+'-'+_0x4129fc+'/'+_0x5b106d)[_0x8b5d('0x2c')](_0x494cc8);}return null;};}function patchUpdates(_0x2aa7ee){return function(_0x8a5ecb){try{jsonpatch['apply'](_0x8a5ecb,_0x2aa7ee,!![]);}catch(_0x1154ed){return BPromise[_0x8b5d('0x33')](_0x1154ed);}return _0x8a5ecb[_0x8b5d('0x34')]();};}function saveUpdates(_0x4effbf,_0x2fbabf){return function(_0x49a351){if(_0x49a351){return _0x49a351['update'](_0x4effbf)['then'](function(_0x2712b7){return _0x2712b7;});}return null;};}function removeEntity(_0x259c4b,_0x35d39e){return function(_0x2c05fa){if(_0x2c05fa){return _0x2c05fa['destroy']()[_0x8b5d('0x35')](function(){_0x259c4b[_0x8b5d('0x2b')](0xcc)[_0x8b5d('0x36')]();});}};}function handleEntityNotFound(_0x488450,_0x38d671){return function(_0x5b5f99){if(!_0x5b5f99){_0x488450[_0x8b5d('0x2a')](0x194);}return _0x5b5f99;};}function handleError(_0x1142cf,_0x49c933){_0x49c933=_0x49c933||0x1f4;return function(_0x339eaf){logger[_0x8b5d('0x25')](_0x339eaf['stack']);if(_0x339eaf[_0x8b5d('0x37')]){delete _0x339eaf[_0x8b5d('0x37')];}_0x1142cf[_0x8b5d('0x2b')](_0x49c933)[_0x8b5d('0x38')](_0x339eaf);};}exports[_0x8b5d('0x39')]=function(_0x5e79db,_0x3505d4){var _0x2b172f={},_0x133501={},_0x383eb6={'count':0x0,'rows':[]};var _0x1633d9=_[_0x8b5d('0x3a')](db[_0x8b5d('0x3b')][_0x8b5d('0x3c')],function(_0x2a16ac){return{'name':_0x2a16ac[_0x8b5d('0x3d')],'type':_0x2a16ac[_0x8b5d('0x3e')][_0x8b5d('0x3f')]};});_0x133501['model']=_[_0x8b5d('0x3a')](_0x1633d9,_0x8b5d('0x37'));_0x133501[_0x8b5d('0x40')]=_[_0x8b5d('0x41')](_0x5e79db[_0x8b5d('0x40')]);_0x133501['filters']=_[_0x8b5d('0x42')](_0x133501[_0x8b5d('0x43')],_0x133501[_0x8b5d('0x40')]);_0x2b172f[_0x8b5d('0x44')]=_['intersection'](_0x133501['model'],qs[_0x8b5d('0x45')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x45')]));_0x2b172f['attributes']=_0x2b172f[_0x8b5d('0x44')]['length']?_0x2b172f[_0x8b5d('0x44')]:_0x133501['model'];if(!_0x5e79db[_0x8b5d('0x40')]['hasOwnProperty']('nolimit')){_0x2b172f[_0x8b5d('0x2e')]=qs[_0x8b5d('0x2e')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x2e')]);_0x2b172f[_0x8b5d('0x2d')]=qs[_0x8b5d('0x2d')](_0x5e79db[_0x8b5d('0x40')]['offset']);}_0x2b172f[_0x8b5d('0x46')]=qs[_0x8b5d('0x47')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x47')]);_0x2b172f[_0x8b5d('0x48')]=qs[_0x8b5d('0x49')](_[_0x8b5d('0x4a')](_0x5e79db['query'],_0x133501[_0x8b5d('0x49')]),_0x1633d9);if(_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x4b')]){_0x2b172f[_0x8b5d('0x48')]=_['merge'](_0x2b172f[_0x8b5d('0x48')],{'$or':_[_0x8b5d('0x3a')](_0x1633d9,function(_0x47f370){if(_0x47f370[_0x8b5d('0x3e')]!==_0x8b5d('0x4c')){var _0x4e7cd1={};_0x4e7cd1[_0x47f370[_0x8b5d('0x37')]]={'$like':'%'+_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x4b')]+'%'};return _0x4e7cd1;}})});}_0x2b172f=_[_0x8b5d('0x4d')]({},_0x2b172f,_0x5e79db[_0x8b5d('0x4e')]);var _0x3c7921={'where':_0x2b172f['where']};return db[_0x8b5d('0x3b')][_0x8b5d('0x30')](_0x3c7921)[_0x8b5d('0x35')](function(_0x3b8576){_0x383eb6[_0x8b5d('0x30')]=_0x3b8576;if(_0x5e79db['query'][_0x8b5d('0x4f')]){_0x2b172f[_0x8b5d('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x8b5d('0x51')](_0x2b172f);})[_0x8b5d('0x35')](function(_0x56e1c7){_0x383eb6['rows']=_0x56e1c7;return _0x383eb6;})[_0x8b5d('0x35')](respondWithFilteredResult(_0x3505d4,_0x2b172f))[_0x8b5d('0x29')](handleError(_0x3505d4,null));};exports[_0x8b5d('0x52')]=function(_0x5d1213,_0x155bae){var _0x2defe1={'raw':!![],'where':{'id':_0x5d1213[_0x8b5d('0x53')]['id']}},_0x598c75={};_0x598c75['model']=_['keys'](db[_0x8b5d('0x3b')][_0x8b5d('0x3c')]);_0x598c75[_0x8b5d('0x40')]=_['keys'](_0x5d1213[_0x8b5d('0x40')]);_0x598c75['filters']=_[_0x8b5d('0x42')](_0x598c75[_0x8b5d('0x43')],_0x598c75['query']);_0x2defe1[_0x8b5d('0x44')]=_['intersection'](_0x598c75[_0x8b5d('0x43')],qs[_0x8b5d('0x45')](_0x5d1213['query'][_0x8b5d('0x45')]));_0x2defe1[_0x8b5d('0x44')]=_0x2defe1[_0x8b5d('0x44')][_0x8b5d('0x54')]?_0x2defe1[_0x8b5d('0x44')]:_0x598c75['model'];if(_0x5d1213[_0x8b5d('0x40')][_0x8b5d('0x4f')]){_0x2defe1[_0x8b5d('0x50')]=[{'all':!![]}];}_0x2defe1=_[_0x8b5d('0x4d')]({},_0x2defe1,_0x5d1213['options']);return db[_0x8b5d('0x3b')][_0x8b5d('0x55')](_0x2defe1)[_0x8b5d('0x35')](handleEntityNotFound(_0x155bae,null))[_0x8b5d('0x35')](respondWithResult(_0x155bae,null))['catch'](handleError(_0x155bae,null));};exports[_0x8b5d('0x56')]=function(_0x13ad71,_0xb3a873){return db[_0x8b5d('0x3b')][_0x8b5d('0x56')](_0x13ad71[_0x8b5d('0x57')],{})[_0x8b5d('0x35')](respondWithResult(_0xb3a873,0xc9))['catch'](handleError(_0xb3a873,null));};exports[_0x8b5d('0x58')]=function(_0x3c0009,_0x109107){if(_0x3c0009['body']['id']){delete _0x3c0009['body']['id'];}return db[_0x8b5d('0x3b')]['find']({'where':{'id':_0x3c0009[_0x8b5d('0x53')]['id']}})[_0x8b5d('0x35')](handleEntityNotFound(_0x109107,null))['then'](saveUpdates(_0x3c0009[_0x8b5d('0x57')],null))[_0x8b5d('0x35')](respondWithResult(_0x109107,null))[_0x8b5d('0x29')](handleError(_0x109107,null));};exports[_0x8b5d('0x59')]=function(_0x51915d,_0xee710a){return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x51915d[_0x8b5d('0x53')]['id']}})['then'](handleEntityNotFound(_0xee710a,null))[_0x8b5d('0x35')](removeEntity(_0xee710a,null))[_0x8b5d('0x29')](handleError(_0xee710a,null));};exports[_0x8b5d('0x5a')]=function(_0x21a94a,_0x1d8bfc){return db[_0x8b5d('0x3b')][_0x8b5d('0x5a')]()['then'](respondWithResult(_0x1d8bfc,null))['catch'](handleError(_0x1d8bfc,null));};var interaction_log=require(_0x8b5d('0x5b'))('chat-interactions');exports[_0x8b5d('0x5c')]=function(_0x5801cc,_0x2f810d,_0x355694){var _0x400afc={'agent':{},'channel':'chat'};if(_0x5801cc[_0x8b5d('0x57')]['id']){delete _0x5801cc['body']['id'];}_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x5d')]=!![];_0x5801cc['body'][_0x8b5d('0x5e')]=moment()[_0x8b5d('0x5f')](_0x8b5d('0x60'));_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')]=_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')]||_0x5801cc[_0x8b5d('0x62')]['id'];_0x400afc[_0x8b5d('0x63')]['id']=_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')];return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x5801cc[_0x8b5d('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f810d,null))[_0x8b5d('0x35')](saveUpdates(_0x5801cc['body'],null))['then'](function(_0x1d40c0){if(_0x1d40c0){_0x400afc[_0x8b5d('0x27')]=_0x1d40c0[_0x8b5d('0x64')]({'plain':!![]});return db[_0x8b5d('0x65')]['find']({'where':{'id':_0x1d40c0[_0x8b5d('0x66')]}});}return null;})[_0x8b5d('0x35')](handleEntityNotFound(_0x2f810d,null))[_0x8b5d('0x35')](function(_0x4a1cee){if(_0x4a1cee){return _0x4a1cee['update']({'UserId':_0x5801cc['body']['UserId'],'read1stAt':_[_0x8b5d('0x67')](_0x4a1cee[_0x8b5d('0x68')])?moment()[_0x8b5d('0x5f')](_0x8b5d('0x60')):undefined});}return null;})[_0x8b5d('0x35')](function(_0xc8fdf2){if(_0xc8fdf2){_0x400afc['interaction']=_0xc8fdf2[_0x8b5d('0x64')]({'plain':!![]});interaction_log[_0x8b5d('0x20')](_0x8b5d('0x69'),_0x5801cc[_0x8b5d('0x62')]['id'],_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x37')],_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x6a')],_0x400afc['interaction']['id'],_0x5801cc[_0x8b5d('0x57')]?JSON[_0x8b5d('0x24')](_0x5801cc['body']):_0x8b5d('0x6b'));return respondWithRpcPromise(_0x8b5d('0x6c'),_0x8b5d('0x6d'),_0x400afc);}return null;})['then'](function(_0x13b402){var _0x5c96ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13b402[_0x8b5d('0x27')][_0x8b5d('0x6e')];return db['sequelize']['query'](_0x5c96ff,{'type':db[_0x8b5d('0x6f')][_0x8b5d('0x70')][_0x8b5d('0x71')],'raw':!![]})[_0x8b5d('0x35')](function(_0x48b523){return _0x48b523;});})[_0x8b5d('0x35')](function(_0x457f6a){if(_0x457f6a){_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x72')]=_0x457f6a[0x0];if(!_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')])return;return db[_0x8b5d('0x73')][_0x8b5d('0x55')]({'where':{'id':_0x5801cc['body']['UserId'],'role':_0x8b5d('0x63')},'attributes':['id',_0x8b5d('0x37'),_0x8b5d('0x74'),'email',_0x8b5d('0x75')],'raw':!![]});}return null;})[_0x8b5d('0x35')](function(_0x294dec){if(!_0x294dec)return null;_0x400afc['message']['agent']=_0x294dec;return _0x400afc;})['then'](function(_0x8313be){if(_0x8313be){if(_0x5801cc[_0x8b5d('0x57')]['manual']){_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x76')]=util[_0x8b5d('0x5f')]('SIP/%s',_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x37')]);_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x77')]=_0x400afc['channel'];_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x78')]=_0x400afc[_0x8b5d('0x77')];_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x79')]=_0x8b5d('0x5c');return respondWithRpcPromise(_0x8b5d('0x7a'),_0x8b5d('0x7a'),{'event':_0x8b5d('0x7b'),'message':_[_0x8b5d('0x4d')](_0x400afc[_0x8b5d('0x27')],JSON['parse'](_0x400afc['interaction'][_0x8b5d('0x7c')]))},client9002)[_0x8b5d('0x35')](function(){return _0x400afc;});}return _0x400afc;}return null;})['then'](respondWithResult(_0x2f810d,null))[_0x8b5d('0x29')](handleError(_0x2f810d,null));};var interaction_log=require('../../config/logger')(_0x8b5d('0x7d'));exports[_0x8b5d('0x33')]=function(_0x1414f0,_0x581f1f,_0x51b704){var _0x230f45={'agent':{},'channel':_0x8b5d('0x7e')};if(_0x1414f0[_0x8b5d('0x57')]['id']){delete _0x1414f0[_0x8b5d('0x57')]['id'];}_0x1414f0[_0x8b5d('0x57')][_0x8b5d('0x61')]=_0x1414f0[_0x8b5d('0x57')]['UserId']||_0x1414f0[_0x8b5d('0x62')]['id'];_0x230f45[_0x8b5d('0x63')]['id']=_0x1414f0['body']['UserId'];return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x1414f0[_0x8b5d('0x53')]['id'],'UserId':null}})[_0x8b5d('0x35')](handleEntityNotFound(_0x581f1f,null))['then'](function(_0x58131e){if(_0x58131e){_0x230f45[_0x8b5d('0x27')]=_0x58131e[_0x8b5d('0x64')]({'plain':!![]});return db[_0x8b5d('0x65')][_0x8b5d('0x55')]({'where':{'id':_0x58131e['ChatInteractionId']}});}return null;})[_0x8b5d('0x35')](handleEntityNotFound(_0x581f1f,null))[_0x8b5d('0x35')](function(_0x428f31){if(_0x428f31){_0x230f45[_0x8b5d('0x7f')]=_0x428f31['get']({'plain':!![]});interaction_log[_0x8b5d('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1414f0['user']['id'],_0x1414f0[_0x8b5d('0x62')][_0x8b5d('0x37')],_0x1414f0[_0x8b5d('0x62')][_0x8b5d('0x6a')],_0x230f45[_0x8b5d('0x7f')]['id'],_0x1414f0[_0x8b5d('0x57')]?JSON[_0x8b5d('0x24')](_0x1414f0['body']):'null');return respondWithRpcPromise(_0x8b5d('0x80'),'rejectMessage',_0x230f45);}return null;})[_0x8b5d('0x35')](function(_0x4fcc64){var _0x3e8501=_0x8b5d('0x81')+_0x4fcc64['message'][_0x8b5d('0x6e')];return db['sequelize'][_0x8b5d('0x40')](_0x3e8501,{'type':db[_0x8b5d('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8b5d('0x35')](function(_0x683b7f){return _0x683b7f;});})[_0x8b5d('0x35')](function(_0x10c437){if(_0x10c437){_0x230f45[_0x8b5d('0x27')][_0x8b5d('0x72')]=_0x10c437[0x0];if(!_0x1414f0[_0x8b5d('0x57')]['UserId'])return;return db[_0x8b5d('0x73')]['find']({'where':{'id':_0x1414f0[_0x8b5d('0x57')][_0x8b5d('0x61')],'role':_0x8b5d('0x63')},'attributes':['id',_0x8b5d('0x37'),_0x8b5d('0x74'),_0x8b5d('0x82'),'internal'],'raw':!![]});}return null;})[_0x8b5d('0x35')](function(_0x5b9ca0){if(!_0x5b9ca0)return null;_0x230f45['message'][_0x8b5d('0x63')]=_0x5b9ca0;return _0x230f45;})[_0x8b5d('0x35')](function(_0x15a661){if(_0x15a661){_0x15a661[_0x8b5d('0x27')][_0x8b5d('0x76')]=util['format']('SIP/%s',_0x1414f0['user']['name']);_0x15a661[_0x8b5d('0x27')][_0x8b5d('0x77')]=_0x230f45[_0x8b5d('0x77')];_0x15a661[_0x8b5d('0x27')]['motionChannel']=_0x230f45[_0x8b5d('0x77')];_0x15a661['message'][_0x8b5d('0x79')]=_0x8b5d('0x33');respondWithRpcPromise(_0x8b5d('0x7a'),_0x8b5d('0x7a'),{'event':_0x8b5d('0x83'),'message':_[_0x8b5d('0x4d')](_0x230f45[_0x8b5d('0x27')],JSON['parse'](_0x230f45[_0x8b5d('0x7f')][_0x8b5d('0x7c')]))},client9002);return _0x230f45;}return null;})[_0x8b5d('0x35')](respondWithResult(_0x581f1f,null))['catch'](handleError(_0x581f1f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c0154e8..3d271fb 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 _0x1d28=['hasOwnProperty','hook','events','setMaxListeners','save','update','remove','emit'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x1d28,0x12a));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x81d2('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x81d2('0x1')](0x0);var events={'afterCreate':_0x81d2('0x2'),'afterUpdate':_0x81d2('0x3'),'afterDestroy':_0x81d2('0x4')};function emitEvent(_0x1cd931){return function(_0x5c7497,_0x13137a,_0x3bffdd){ChatMessageEvents['emit'](_0x1cd931+':'+_0x5c7497['id'],_0x5c7497);ChatMessageEvents[_0x81d2('0x5')](_0x1cd931,_0x5c7497);_0x3bffdd(null);};}for(var e in events){if(events[_0x81d2('0x6')](e)){var event=events[e];ChatMessage[_0x81d2('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xdfaa=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x42d525,_0x1247cb){var _0x7f0c3c=function(_0x5016f1){while(--_0x5016f1){_0x42d525['push'](_0x42d525['shift']());}};_0x7f0c3c(++_0x1247cb);}(_0xdfaa,0x1ad));var _0xadfa=function(_0x418bda,_0x1da79c){_0x418bda=_0x418bda-0x0;var _0x14ee24=_0xdfaa[_0x418bda];return _0x14ee24;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xadfa('0x0'))['db'][_0xadfa('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xadfa('0x2')](0x0);var events={'afterCreate':_0xadfa('0x3'),'afterUpdate':_0xadfa('0x4'),'afterDestroy':_0xadfa('0x5')};function emitEvent(_0x480e64){return function(_0xc6f73e,_0x2abff7,_0x2f3933){ChatMessageEvents['emit'](_0x480e64+':'+_0xc6f73e['id'],_0xc6f73e);ChatMessageEvents[_0xadfa('0x6')](_0x480e64,_0xc6f73e);_0x2f3933(null);};}for(var e in events){if(events[_0xadfa('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xadfa('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 1345e9f..e0117e9 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 _0x6785=['util','../../config/logger','api','path','rimraf','../../config/environment','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3f4513,_0x1a69c2){var _0x392aa1=function(_0x457e36){while(--_0x457e36){_0x3f4513['push'](_0x3f4513['shift']());}};_0x392aa1(++_0x1a69c2);}(_0x6785,0xa0));var _0x5678=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6785[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x5678('0x0'));var util=require(_0x5678('0x1'));var logger=require(_0x5678('0x2'))(_0x5678('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5678('0x4'));var rimraf=require(_0x5678('0x5'));var config=require(_0x5678('0x6'));var attributes=require(_0x5678('0x7'));module[_0x5678('0x8')]=function(_0x358ae0,_0x423702){return _0x358ae0['define']('ChatMessage',attributes,{'tableName':_0x5678('0x9'),'paranoid':![],'indexes':[{'name':_0x5678('0xa'),'fields':['body'],'type':_0x5678('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x212337,_0x3ff65d,_0x5e92e6){var _0x3eb9ad=_0x358ae0[_0x5678('0xc')];var _0x3c35e4=_0x212337['get']({'plain':!![]});if(_0x3c35e4[_0x5678('0xd')][_0x5678('0xe')]()==='in'||_0x3c35e4[_0x5678('0xd')][_0x5678('0xe')]()===_0x5678('0xf')&&!_0x3c35e4[_0x5678('0x10')]&&!_['isNil'](_0x3c35e4[_0x5678('0x11')])){_0x3eb9ad[_0x5678('0x12')]['findOne']({'where':{'id':_0x3c35e4[_0x5678('0x13')]}})['then'](function(_0x1cdf8f){if(_0x1cdf8f){_0x1cdf8f['update']({'lastMsgAt':_0x3c35e4['createdAt'],'lastMsgDirection':_0x3c35e4[_0x5678('0xd')][_0x5678('0xe')]()});}})['catch'](function(_0x241202){console[_0x5678('0x14')](_0x241202);});}_0x5e92e6();}},'charset':_0x5678('0x15'),'collate':_0x5678('0x16')});}; \ No newline at end of file +var _0x6a9d=['toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','utf8mb4','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction'];(function(_0x4ca0de,_0x77e8e3){var _0x149378=function(_0x137f90){while(--_0x137f90){_0x4ca0de['push'](_0x4ca0de['shift']());}};_0x149378(++_0x77e8e3);}(_0x6a9d,0x111));var _0xd6a9=function(_0x5b85d7,_0x57260a){_0x5b85d7=_0x5b85d7-0x0;var _0x1dd5d5=_0x6a9d[_0x5b85d7];return _0x1dd5d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd6a9('0x0'));var moment=require(_0xd6a9('0x1'));var BPromise=require(_0xd6a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6a9('0x3'));var rimraf=require(_0xd6a9('0x4'));var config=require(_0xd6a9('0x5'));var attributes=require(_0xd6a9('0x6'));module['exports']=function(_0x21228e,_0x2462cb){return _0x21228e[_0xd6a9('0x7')](_0xd6a9('0x8'),attributes,{'tableName':_0xd6a9('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xd6a9('0xa')],'type':_0xd6a9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36bdda,_0x204ada,_0x28a869){var _0x1c6cb2=_0x21228e[_0xd6a9('0xc')];var _0x1d8048=_0x36bdda[_0xd6a9('0xd')]({'plain':!![]});if(_0x1d8048[_0xd6a9('0xe')][_0xd6a9('0xf')]()==='in'||_0x1d8048[_0xd6a9('0xe')]['toLowerCase']()===_0xd6a9('0x10')&&!_0x1d8048['secret']&&!_[_0xd6a9('0x11')](_0x1d8048[_0xd6a9('0x12')])){_0x1c6cb2[_0xd6a9('0x13')]['findOne']({'where':{'id':_0x1d8048[_0xd6a9('0x14')]}})['then'](function(_0x2e70ff){if(_0x2e70ff){_0x2e70ff['update']({'lastMsgAt':_0x1d8048[_0xd6a9('0x15')],'lastMsgDirection':_0x1d8048[_0xd6a9('0xe')][_0xd6a9('0xf')]()});}})[_0xd6a9('0x16')](function(_0x4c383b){console['error'](_0x4c383b);});}_0x28a869();}},'charset':_0xd6a9('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 63dbd18..c612cc6 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 _0x7faa=['options','raw','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create'];(function(_0x24a62c,_0xefafb7){var _0x26cda0=function(_0x2736b1){while(--_0x2736b1){_0x24a62c['push'](_0x24a62c['shift']());}};_0x26cda0(++_0xefafb7);}(_0x7faa,0xeb));var _0xa7fa=function(_0x47a413,_0x4f1184){_0x47a413=_0x47a413-0x0;var _0x956c7e=_0x7faa[_0x47a413];return _0x956c7e;};'use strict';var _=require(_0xa7fa('0x0'));var util=require('util');var moment=require(_0xa7fa('0x1'));var BPromise=require(_0xa7fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7fa('0x3'));var db=require(_0xa7fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7fa('0x5'))(_0xa7fa('0x6'));var config=require(_0xa7fa('0x7'));var jayson=require(_0xa7fa('0x8'));var client=jayson[_0xa7fa('0x9')][_0xa7fa('0xa')]({'port':0x232a});config[_0xa7fa('0xb')]=_[_0xa7fa('0xc')](config[_0xa7fa('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7fa('0xd'))(new Redis(config[_0xa7fa('0xb')]));require(_0xa7fa('0xe'))['register'](socket);function respondWithRpcPromise(_0x26a864,_0x14661d,_0x391014){return new BPromise(function(_0x1c3c07,_0x54f95a){return client[_0xa7fa('0xf')](_0x26a864,_0x391014)[_0xa7fa('0x10')](function(_0x43b924){logger[_0xa7fa('0x11')](_0xa7fa('0x12'),_0x14661d,_0xa7fa('0x13'));logger['debug'](_0xa7fa('0x14'),_0x14661d,_0xa7fa('0x13'),JSON[_0xa7fa('0x15')](_0x43b924));if(_0x43b924[_0xa7fa('0x16')]){if(_0x43b924[_0xa7fa('0x16')][_0xa7fa('0x17')]===0x1f4){logger['error'](_0xa7fa('0x12'),_0x14661d,_0x43b924[_0xa7fa('0x16')]['message']);return _0x54f95a(_0x43b924[_0xa7fa('0x16')][_0xa7fa('0x18')]);}logger[_0xa7fa('0x16')](_0xa7fa('0x12'),_0x14661d,_0x43b924[_0xa7fa('0x16')]['message']);return _0x1c3c07(_0x43b924['error'][_0xa7fa('0x18')]);}else{logger[_0xa7fa('0x11')](_0xa7fa('0x12'),_0x14661d,_0xa7fa('0x13'));_0x1c3c07(_0x43b924[_0xa7fa('0x19')][_0xa7fa('0x18')]);}})['catch'](function(_0x303ecc){logger[_0xa7fa('0x16')](_0xa7fa('0x12'),_0x14661d,_0x303ecc);_0x54f95a(_0x303ecc);});});}exports[_0xa7fa('0x1a')]=function(_0x107474){var _0x4955da=this;return new Promise(function(_0x39f29b,_0x2e6eb2){return db[_0xa7fa('0x1b')][_0xa7fa('0x1c')](_0x107474['body'],{'raw':_0x107474[_0xa7fa('0x1d')]?_0x107474['options'][_0xa7fa('0x1e')]===undefined?!![]:![]:!![]})[_0xa7fa('0x10')](function(_0x3fea79){logger[_0xa7fa('0x11')](_0xa7fa('0x1a'),_0x107474);logger[_0xa7fa('0x1f')](_0xa7fa('0x1a'),_0x107474,JSON[_0xa7fa('0x15')](_0x3fea79));_0x39f29b(_0x3fea79);})[_0xa7fa('0x20')](function(_0x4d5002){logger[_0xa7fa('0x16')](_0xa7fa('0x1a'),_0x4d5002[_0xa7fa('0x18')],_0x107474);_0x2e6eb2(_0x4955da[_0xa7fa('0x16')](0x1f4,_0x4d5002[_0xa7fa('0x18')]));});});}; \ No newline at end of file +var _0x3f46=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x36aaba,_0x403929){var _0x52e01a=function(_0x31fcd5){while(--_0x31fcd5){_0x36aaba['push'](_0x36aaba['shift']());}};_0x52e01a(++_0x403929);}(_0x3f46,0xac));var _0x63f4=function(_0xb50c0a,_0x583cf3){_0xb50c0a=_0xb50c0a-0x0;var _0x168fb8=_0x3f46[_0xb50c0a];return _0x168fb8;};'use strict';var _=require('lodash');var util=require(_0x63f4('0x0'));var moment=require(_0x63f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x63f4('0x2'));var fs=require('fs');var Redis=require(_0x63f4('0x3'));var db=require(_0x63f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x63f4('0x5'))(_0x63f4('0x6'));var config=require('../../config/environment');var jayson=require(_0x63f4('0x7'));var client=jayson[_0x63f4('0x8')][_0x63f4('0x9')]({'port':0x232a});config[_0x63f4('0xa')]=_['defaults'](config['redis'],{'host':_0x63f4('0xb'),'port':0x18eb});var socket=require(_0x63f4('0xc'))(new Redis(config[_0x63f4('0xa')]));require(_0x63f4('0xd'))[_0x63f4('0xe')](socket);function respondWithRpcPromise(_0x263929,_0xfba268,_0x544d12){return new BPromise(function(_0x467487,_0x170789){return client[_0x63f4('0xf')](_0x263929,_0x544d12)[_0x63f4('0x10')](function(_0x3b8dbd){logger[_0x63f4('0x11')](_0x63f4('0x12'),_0xfba268,'request\x20sent');logger[_0x63f4('0x13')](_0x63f4('0x14'),_0xfba268,_0x63f4('0x15'),JSON[_0x63f4('0x16')](_0x3b8dbd));if(_0x3b8dbd[_0x63f4('0x17')]){if(_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x18')]===0x1f4){logger[_0x63f4('0x17')](_0x63f4('0x12'),_0xfba268,_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x19')]);return _0x170789(_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0xfba268,_0x3b8dbd[_0x63f4('0x17')]['message']);return _0x467487(_0x3b8dbd[_0x63f4('0x17')]['message']);}else{logger['info'](_0x63f4('0x12'),_0xfba268,_0x63f4('0x15'));_0x467487(_0x3b8dbd['result']['message']);}})['catch'](function(_0xa234b5){logger[_0x63f4('0x17')](_0x63f4('0x12'),_0xfba268,_0xa234b5);_0x170789(_0xa234b5);});});}exports[_0x63f4('0x1a')]=function(_0x264d6){var _0x7135ec=this;return new Promise(function(_0x1fa4ba,_0x2b2f36){return db[_0x63f4('0x1b')]['create'](_0x264d6[_0x63f4('0x1c')],{'raw':_0x264d6['options']?_0x264d6[_0x63f4('0x1d')][_0x63f4('0x1e')]===undefined?!![]:![]:!![]})[_0x63f4('0x10')](function(_0x25a831){logger[_0x63f4('0x11')](_0x63f4('0x1a'),_0x264d6);logger[_0x63f4('0x13')](_0x63f4('0x1a'),_0x264d6,JSON['stringify'](_0x25a831));_0x1fa4ba(_0x25a831);})[_0x63f4('0x1f')](function(_0x5cb31f){logger[_0x63f4('0x17')](_0x63f4('0x1a'),_0x5cb31f['message'],_0x264d6);_0x2b2f36(_0x7135ec[_0x63f4('0x17')](0x1f4,_0x5cb31f[_0x63f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index e9425b1..c5a989d 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 _0x33c5=['remove','emit','removeListener','register','length','chatMessage:','save'];(function(_0x36b611,_0x1e42e7){var _0x2d6dd8=function(_0x370d48){while(--_0x370d48){_0x36b611['push'](_0x36b611['shift']());}};_0x2d6dd8(++_0x1e42e7);}(_0x33c5,0xe6));var _0x533c=function(_0x4574d9,_0x224f1a){_0x4574d9=_0x4574d9-0x0;var _0x30cea4=_0x33c5[_0x4574d9];return _0x30cea4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x533c('0x0'),_0x533c('0x1'),'update'];function createListener(_0x9dafa,_0x26b916){return function(_0x221e43){_0x26b916[_0x533c('0x2')](_0x9dafa,_0x221e43);};}function removeListener(_0x358127,_0x49609e){return function(){ChatMessageEvents[_0x533c('0x3')](_0x358127,_0x49609e);};}exports[_0x533c('0x4')]=function(_0x31d912){for(var _0x151732=0x0,_0x34ca89=events[_0x533c('0x5')];_0x151732<_0x34ca89;_0x151732++){var _0x3a009b=events[_0x151732];var _0x36d74e=createListener(_0x533c('0x6')+_0x3a009b,_0x31d912);ChatMessageEvents['on'](_0x3a009b,_0x36d74e);}}; \ No newline at end of file +var _0xab86=['remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x1f3cf1,_0x528a06){var _0x3820da=function(_0x55a04d){while(--_0x55a04d){_0x1f3cf1['push'](_0x1f3cf1['shift']());}};_0x3820da(++_0x528a06);}(_0xab86,0x13e));var _0x6ab8=function(_0x1fb08e,_0x21b8eb){_0x1fb08e=_0x1fb08e-0x0;var _0x570d0c=_0xab86[_0x1fb08e];return _0x570d0c;};'use strict';var ChatMessageEvents=require(_0x6ab8('0x0'));var events=[_0x6ab8('0x1'),_0x6ab8('0x2'),'update'];function createListener(_0x548007,_0xfa522f){return function(_0x4bcc45){_0xfa522f[_0x6ab8('0x3')](_0x548007,_0x4bcc45);};}function removeListener(_0x48cb6a,_0xf27ba7){return function(){ChatMessageEvents[_0x6ab8('0x4')](_0x48cb6a,_0xf27ba7);};}exports[_0x6ab8('0x5')]=function(_0x154d17){for(var _0x6f41f=0x0,_0x265771=events[_0x6ab8('0x6')];_0x6f41f<_0x265771;_0x6f41f++){var _0x2a452=events[_0x6f41f];var _0x363c5e=createListener(_0x6ab8('0x7')+_0x2a452,_0x154d17);ChatMessageEvents['on'](_0x2a452,_0x363c5e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 4eb5a74..301476b 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 _0xafbe=['show','post','tracked','chat','chatmessage:create','create','put','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x99f838,_0xe376e2){var _0x432cd7=function(_0x2cd5dc){while(--_0x2cd5dc){_0x99f838['push'](_0x99f838['shift']());}};_0x432cd7(++_0xe376e2);}(_0xafbe,0x178));var _0xeafb=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0xafbe[_0x1a595a];return _0x33f008;};'use strict';var multer=require(_0xeafb('0x0'));var util=require(_0xeafb('0x1'));var path=require(_0xeafb('0x2'));var timeout=require(_0xeafb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeafb('0x4'));var auth=require(_0xeafb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeafb('0x6'));var controller=require(_0xeafb('0x7'));router[_0xeafb('0x8')]('/',auth[_0xeafb('0x9')](),controller[_0xeafb('0xa')]);router[_0xeafb('0x8')](_0xeafb('0xb'),auth['isAuthenticated'](),controller[_0xeafb('0xc')]);router[_0xeafb('0x8')](_0xeafb('0xd'),auth[_0xeafb('0x9')](),controller[_0xeafb('0xe')]);router[_0xeafb('0xf')]('/',auth[_0xeafb('0x9')](),interaction[_0xeafb('0x10')](_0xeafb('0x11'),_0xeafb('0x12')),controller[_0xeafb('0x13')]);router['put'](_0xeafb('0xd'),controller['update']);router[_0xeafb('0x14')](_0xeafb('0x15'),auth[_0xeafb('0x9')](),controller['accept']);router['put'](_0xeafb('0x16'),auth[_0xeafb('0x9')](),controller['reject']);router[_0xeafb('0x17')](_0xeafb('0xd'),auth['isAuthenticated'](),controller[_0xeafb('0x18')]);module[_0xeafb('0x19')]=router; \ No newline at end of file +var _0x2c9e=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','get','/:id','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x5037fc,_0x2361f9){var _0x7e718b=function(_0x37bcbc){while(--_0x37bcbc){_0x5037fc['push'](_0x5037fc['shift']());}};_0x7e718b(++_0x2361f9);}(_0x2c9e,0x17a));var _0xe2c9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c9e[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xe2c9('0x0'));var path=require(_0xe2c9('0x1'));var timeout=require(_0xe2c9('0x2'));var express=require(_0xe2c9('0x3'));var router=express['Router']();var fs_extra=require(_0xe2c9('0x4'));var auth=require(_0xe2c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2c9('0x6'));var controller=require(_0xe2c9('0x7'));router['get']('/',auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x9')]);router['get'](_0xe2c9('0xa'),auth[_0xe2c9('0x8')](),controller['describe']);router[_0xe2c9('0xb')](_0xe2c9('0xc'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0xd')]);router[_0xe2c9('0xe')]('/',auth[_0xe2c9('0x8')](),interaction[_0xe2c9('0xf')](_0xe2c9('0x10'),_0xe2c9('0x11')),controller['create']);router[_0xe2c9('0x12')](_0xe2c9('0xc'),controller[_0xe2c9('0x13')]);router[_0xe2c9('0x12')](_0xe2c9('0x14'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x15')]);router[_0xe2c9('0x12')](_0xe2c9('0x16'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x17')]);router[_0xe2c9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xe2c9('0x19')]);module[_0xe2c9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index f202091..8327ae0 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 _0xadb5=['medium','TEXT','exports'];(function(_0x4f657e,_0x4b6e39){var _0xeab1b0=function(_0x2a3183){while(--_0x2a3183){_0x4f657e['push'](_0x4f657e['shift']());}};_0xeab1b0(++_0x4b6e39);}(_0xadb5,0xad));var _0x5adb=function(_0x5db2cb,_0x61d9f4){_0x5db2cb=_0x5db2cb-0x0;var _0xa03d12=_0xadb5[_0x5db2cb];return _0xa03d12;};'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 +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x17ad16,_0x5dd802){var _0x24a8b5=function(_0x1ecc4a){while(--_0x1ecc4a){_0x17ad16['push'](_0x17ad16['shift']());}};_0x24a8b5(++_0x5dd802);}(_0x5f2f,0x73));var _0xf5f2=function(_0x548cd9,_0x39a9d4){_0x548cd9=_0x548cd9-0x0;var _0x228451=_0x5f2f[_0x548cd9];return _0x228451;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a6cc5b3..7b0a5c0 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4743cd,_0x15057c){var _0x32fcb1=function(_0x1d4728){while(--_0x1d4728){_0x4743cd['push'](_0x4743cd['shift']());}};_0x32fcb1(++_0x15057c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b2516,_0x10579a){_0x5b2516=_0x5b2516-0x0;var _0x78a6f3=_0x7a54[_0x5b2516];return _0x78a6f3;};'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 57a15d1..42126b6 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 _0x0d55=['ChatOfflineMessage','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x42c903,_0x5c81bc){var _0xcfd717=function(_0x34fd31){while(--_0x34fd31){_0x42c903['push'](_0x42c903['shift']());}};_0xcfd717(++_0x5c81bc);}(_0x0d55,0x179));var _0x50d5=function(_0x2c9c70,_0x4ab4cb){_0x2c9c70=_0x2c9c70-0x0;var _0x3546bf=_0x0d55[_0x2c9c70];return _0x3546bf;};'use strict';var EventEmitter=require(_0x50d5('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x50d5('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50d5('0x2'),'afterUpdate':'update','afterDestroy':_0x50d5('0x3')};function emitEvent(_0x417a0d){return function(_0x1d4fb6,_0x16d217,_0x3320fc){ChatOfflineMessageEvents[_0x50d5('0x4')](_0x417a0d+':'+_0x1d4fb6['id'],_0x1d4fb6);ChatOfflineMessageEvents[_0x50d5('0x4')](_0x417a0d,_0x1d4fb6);_0x3320fc(null);};}for(var e in events){if(events[_0x50d5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x50d5('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x4569=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x2f408b,_0xbfdb00){var _0x38d16f=function(_0x5a45cc){while(--_0x5a45cc){_0x2f408b['push'](_0x2f408b['shift']());}};_0x38d16f(++_0xbfdb00);}(_0x4569,0xed));var _0x9456=function(_0x56f052,_0x3256b4){_0x56f052=_0x56f052-0x0;var _0x28d3d1=_0x4569[_0x56f052];return _0x28d3d1;};'use strict';var EventEmitter=require(_0x9456('0x0'));var ChatOfflineMessage=require(_0x9456('0x1'))['db'][_0x9456('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9456('0x3')](0x0);var events={'afterCreate':_0x9456('0x4'),'afterUpdate':_0x9456('0x5'),'afterDestroy':_0x9456('0x6')};function emitEvent(_0x2dd08c){return function(_0x5f084d,_0x3a0796,_0x289107){ChatOfflineMessageEvents[_0x9456('0x7')](_0x2dd08c+':'+_0x5f084d['id'],_0x5f084d);ChatOfflineMessageEvents['emit'](_0x2dd08c,_0x5f084d);_0x289107(null);};}for(var e in events){if(events[_0x9456('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x9456('0x9')](e,emitEvent(event));}}module[_0x9456('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ad8fe6a..81ab42e 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 _0x6030=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4'];(function(_0xc70c63,_0x5f1f33){var _0x1e3d41=function(_0x214c61){while(--_0x214c61){_0xc70c63['push'](_0xc70c63['shift']());}};_0x1e3d41(++_0x5f1f33);}(_0x6030,0x19b));var _0x0603=function(_0x200e17,_0x1b3d80){_0x200e17=_0x200e17-0x0;var _0x5537fa=_0x6030[_0x200e17];return _0x5537fa;};'use strict';var attributes=require(_0x0603('0x0'));module['exports']=function(_0x255f00){return _0x255f00[_0x0603('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x0603('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0603('0x3'),'collate':_0x0603('0x4')});}; \ No newline at end of file +var _0x374d=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0x374d,0xd7));var _0xd374=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x374d[_0xa1e3e3];return _0xc980e9;};'use strict';var attributes=require(_0xd374('0x0'));module[_0xd374('0x1')]=function(_0x1ff0dc){return _0x1ff0dc[_0xd374('0x2')](_0xd374('0x3'),attributes,{'tableName':_0xd374('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd374('0x5'),'collate':_0xd374('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ccc393f..1b456a1 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 _0xe253=['../../config/logger','rpc','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14b5a2,_0x1cb070){var _0x5bc205=function(_0x2e9ce6){while(--_0x2e9ce6){_0x14b5a2['push'](_0x14b5a2['shift']());}};_0x5bc205(++_0x1cb070);}(_0xe253,0x134));var _0x3e25=function(_0x1bea83,_0x2f7dfd){_0x1bea83=_0x1bea83-0x0;var _0x173dc3=_0xe253[_0x1bea83];return _0x173dc3;};'use strict';var _=require(_0x3e25('0x0'));var util=require(_0x3e25('0x1'));var moment=require('moment');var BPromise=require(_0x3e25('0x2'));var rs=require(_0x3e25('0x3'));var fs=require('fs');var Redis=require(_0x3e25('0x4'));var db=require(_0x3e25('0x5'))['db'];var utils=require(_0x3e25('0x6'));var logger=require(_0x3e25('0x7'))(_0x3e25('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e25('0x9')][_0x3e25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c0399,_0x24a9f3,_0x110c56){return new BPromise(function(_0x4cba7a,_0x2e92e7){return client[_0x3e25('0xb')](_0x2c0399,_0x110c56)['then'](function(_0x416883){logger[_0x3e25('0xc')](_0x3e25('0xd'),_0x24a9f3,_0x3e25('0xe'));logger[_0x3e25('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x24a9f3,_0x3e25('0xe'),JSON['stringify'](_0x416883));if(_0x416883[_0x3e25('0x10')]){if(_0x416883[_0x3e25('0x10')][_0x3e25('0x11')]===0x1f4){logger[_0x3e25('0x10')](_0x3e25('0xd'),_0x24a9f3,_0x416883[_0x3e25('0x10')][_0x3e25('0x12')]);return _0x2e92e7(_0x416883[_0x3e25('0x10')][_0x3e25('0x12')]);}logger[_0x3e25('0x10')](_0x3e25('0xd'),_0x24a9f3,_0x416883[_0x3e25('0x10')][_0x3e25('0x12')]);return _0x4cba7a(_0x416883[_0x3e25('0x10')][_0x3e25('0x12')]);}else{logger[_0x3e25('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x24a9f3,_0x3e25('0xe'));_0x4cba7a(_0x416883[_0x3e25('0x13')][_0x3e25('0x12')]);}})[_0x3e25('0x14')](function(_0x31cf3f){logger['error'](_0x3e25('0xd'),_0x24a9f3,_0x31cf3f);_0x2e92e7(_0x31cf3f);});});} \ 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','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7b8f0e,_0x43c018){var _0x539030=function(_0x65161c){while(--_0x65161c){_0x7b8f0e['push'](_0x7b8f0e['shift']());}};_0x539030(++_0x43c018);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatOfflineMessage,\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/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 54663b1..24f8124 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 _0xf9d4=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','exports','multer'];(function(_0x1bf963,_0xe78141){var _0x17d83c=function(_0x15b510){while(--_0x15b510){_0x1bf963['push'](_0x1bf963['shift']());}};_0x17d83c(++_0xe78141);}(_0xf9d4,0x13f));var _0x4f9d=function(_0x32701a,_0x1af85d){_0x32701a=_0x32701a-0x0;var _0x10571d=_0xf9d4[_0x32701a];return _0x10571d;};'use strict';var multer=require(_0x4f9d('0x0'));var util=require(_0x4f9d('0x1'));var path=require('path');var timeout=require(_0x4f9d('0x2'));var express=require(_0x4f9d('0x3'));var router=express[_0x4f9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4f9d('0x5'));var interaction=require(_0x4f9d('0x6'));var config=require(_0x4f9d('0x7'));var controller=require(_0x4f9d('0x8'));router[_0x4f9d('0x9')]('/',auth[_0x4f9d('0xa')](),controller[_0x4f9d('0xb')]);router[_0x4f9d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x4f9d('0xc')]);router[_0x4f9d('0x9')](_0x4f9d('0xd'),auth['isAuthenticated'](),controller[_0x4f9d('0xe')]);router[_0x4f9d('0xf')]('/',auth[_0x4f9d('0xa')](),controller[_0x4f9d('0x10')]);router['put'](_0x4f9d('0xd'),auth[_0x4f9d('0xa')](),controller[_0x4f9d('0x11')]);router[_0x4f9d('0x12')](_0x4f9d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f9d('0x13')]=router; \ No newline at end of file +var _0xa9e3=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x307a0c,_0x548aa1){var _0x41269c=function(_0x54134a){while(--_0x54134a){_0x307a0c['push'](_0x307a0c['shift']());}};_0x41269c(++_0x548aa1);}(_0xa9e3,0xf1));var _0x3a9e=function(_0x18553d,_0x2133ab){_0x18553d=_0x18553d-0x0;var _0x2e0f22=_0xa9e3[_0x18553d];return _0x2e0f22;};'use strict';var multer=require(_0x3a9e('0x0'));var util=require(_0x3a9e('0x1'));var path=require(_0x3a9e('0x2'));var timeout=require(_0x3a9e('0x3'));var express=require('express');var router=express[_0x3a9e('0x4')]();var fs_extra=require(_0x3a9e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3a9e('0x6'));var config=require('../../config/environment');var controller=require(_0x3a9e('0x7'));router[_0x3a9e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a9e('0x8')](_0x3a9e('0x9'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0xb')]);router[_0x3a9e('0x8')](_0x3a9e('0xc'),auth['isAuthenticated'](),controller[_0x3a9e('0xd')]);router[_0x3a9e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3a9e('0xf')](_0x3a9e('0xc'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0x10')]);router[_0x3a9e('0x11')](_0x3a9e('0xc'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0x12')]);module[_0x3a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 17420b4..1b3ef2d 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 _0xcba1=['ENUM','timeout','exports','STRING'];(function(_0xdf0a10,_0x47d8f1){var _0x9179c8=function(_0x1c66b4){while(--_0x1c66b4){_0xdf0a10['push'](_0xdf0a10['shift']());}};_0x9179c8(++_0x47d8f1);}(_0xcba1,0x122));var _0x1cba=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xcba1[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require('sequelize');module[_0x1cba('0x0')]={'name':{'type':Sequelize[_0x1cba('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cba('0x2')]('mouseOver',_0x1cba('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x1cba('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x68cc=['sequelize','exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x68cc,0xe7));var _0xc68c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x68cc[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xc68c('0x0'));module[_0xc68c('0x1')]={'name':{'type':Sequelize[_0xc68c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc68c('0x3')]('mouseOver',_0xc68c('0x4')),'defaultValue':_0xc68c('0x5')},'selector':{'type':Sequelize[_0xc68c('0x2')]},'timeout':{'type':Sequelize[_0xc68c('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d38d696..af95edf 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 _0x78b7=['rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','destroy','error','stack','name','send','params','keys','ChatProactiveAction'];(function(_0x2442dd,_0x269ded){var _0x9d4594=function(_0x4964ff){while(--_0x4964ff){_0x2442dd['push'](_0x2442dd['shift']());}};_0x9d4594(++_0x269ded);}(_0x78b7,0x194));var _0x778b=function(_0x2c8c31,_0x123590){_0x2c8c31=_0x2c8c31-0x0;var _0x3c8817=_0x78b7[_0x2c8c31];return _0x3c8817;};'use strict';var emlformat=require(_0x778b('0x0'));var rimraf=require(_0x778b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x778b('0x2'));var rp=require(_0x778b('0x3'));var moment=require(_0x778b('0x4'));var BPromise=require(_0x778b('0x5'));var Mustache=require(_0x778b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x778b('0x7'));var csv=require(_0x778b('0x8'));var ejs=require(_0x778b('0x9'));var fs=require('fs');var fs_extra=require(_0x778b('0xa'));var _=require(_0x778b('0xb'));var squel=require(_0x778b('0xc'));var crypto=require('crypto');var jsforce=require(_0x778b('0xd'));var deskjs=require(_0x778b('0xe'));var toCsv=require(_0x778b('0x8'));var querystring=require(_0x778b('0xf'));var Papa=require(_0x778b('0x10'));var Redis=require('ioredis');var authService=require(_0x778b('0x11'));var qs=require(_0x778b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x778b('0x13'));var logger=require(_0x778b('0x14'))(_0x778b('0x15'));var utils=require(_0x778b('0x16'));var config=require(_0x778b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7ca7,_0x8ae3a9){_0x8ae3a9=_0x8ae3a9||0xcc;return function(_0x39584a){if(_0x39584a){return _0x2f7ca7[_0x778b('0x18')](_0x8ae3a9);}return _0x2f7ca7[_0x778b('0x19')](_0x8ae3a9)[_0x778b('0x1a')]();};}function respondWithResult(_0x47026b,_0x5c09c9){_0x5c09c9=_0x5c09c9||0xc8;return function(_0x1a7672){if(_0x1a7672){return _0x47026b[_0x778b('0x19')](_0x5c09c9)[_0x778b('0x1b')](_0x1a7672);}};}function respondWithFilteredResult(_0x389d63,_0x7aa12){return function(_0x52be17){if(_0x52be17){var _0x1bf480=typeof _0x7aa12['offset']===_0x778b('0x1c')&&typeof _0x7aa12[_0x778b('0x1d')]==='undefined';var _0x23069d=_0x52be17['count'];var _0x2d2732=_0x1bf480?0x0:_0x7aa12[_0x778b('0x1e')];var _0x5d9376=_0x1bf480?_0x52be17[_0x778b('0x1f')]:_0x7aa12[_0x778b('0x1e')]+_0x7aa12[_0x778b('0x1d')];var _0x5d4c05;if(_0x5d9376>=_0x23069d){_0x5d9376=_0x23069d;_0x5d4c05=0xc8;}else{_0x5d4c05=0xce;}_0x389d63[_0x778b('0x19')](_0x5d4c05);return _0x389d63[_0x778b('0x20')](_0x778b('0x21'),_0x2d2732+'-'+_0x5d9376+'/'+_0x23069d)[_0x778b('0x1b')](_0x52be17);}return null;};}function patchUpdates(_0x128388){return function(_0xa9c869){try{jsonpatch['apply'](_0xa9c869,_0x128388,!![]);}catch(_0x3f7282){return BPromise[_0x778b('0x22')](_0x3f7282);}return _0xa9c869['save']();};}function saveUpdates(_0x4083c2,_0x4a9564){return function(_0x3736f1){if(_0x3736f1){return _0x3736f1['update'](_0x4083c2)[_0x778b('0x23')](function(_0x4efc37){return _0x4efc37;});}return null;};}function removeEntity(_0x5bf9bb,_0xcef5c){return function(_0x578252){if(_0x578252){return _0x578252[_0x778b('0x24')]()[_0x778b('0x23')](function(){_0x5bf9bb[_0x778b('0x19')](0xcc)[_0x778b('0x1a')]();});}};}function handleEntityNotFound(_0x2095af,_0x4f1b03){return function(_0xa9083a){if(!_0xa9083a){_0x2095af[_0x778b('0x18')](0x194);}return _0xa9083a;};}function handleError(_0x1bc22f,_0x4ce74d){_0x4ce74d=_0x4ce74d||0x1f4;return function(_0x554c67){logger[_0x778b('0x25')](_0x554c67[_0x778b('0x26')]);if(_0x554c67[_0x778b('0x27')]){delete _0x554c67[_0x778b('0x27')];}_0x1bc22f[_0x778b('0x19')](_0x4ce74d)[_0x778b('0x28')](_0x554c67);};}exports['show']=function(_0x527051,_0x480714){var _0x17721e={'raw':!![],'where':{'id':_0x527051[_0x778b('0x29')]['id']}},_0xccca67={};_0xccca67['model']=_[_0x778b('0x2a')](db[_0x778b('0x2b')][_0x778b('0x2c')]);_0xccca67[_0x778b('0x2d')]=_[_0x778b('0x2a')](_0x527051['query']);_0xccca67[_0x778b('0x2e')]=_[_0x778b('0x2f')](_0xccca67['model'],_0xccca67['query']);_0x17721e[_0x778b('0x30')]=_[_0x778b('0x2f')](_0xccca67['model'],qs[_0x778b('0x31')](_0x527051[_0x778b('0x2d')][_0x778b('0x31')]));_0x17721e[_0x778b('0x30')]=_0x17721e[_0x778b('0x30')][_0x778b('0x32')]?_0x17721e['attributes']:_0xccca67['model'];if(_0x527051[_0x778b('0x2d')][_0x778b('0x33')]){_0x17721e['include']=[{'all':!![]}];}_0x17721e=_['merge']({},_0x17721e,_0x527051['options']);return db[_0x778b('0x2b')]['find'](_0x17721e)[_0x778b('0x23')](handleEntityNotFound(_0x480714,null))['then'](respondWithResult(_0x480714,null))[_0x778b('0x34')](handleError(_0x480714,null));};exports[_0x778b('0x35')]=function(_0x51b580,_0x179e51){return db['ChatProactiveAction'][_0x778b('0x35')](_0x51b580[_0x778b('0x36')],{})[_0x778b('0x23')](respondWithResult(_0x179e51,0xc9))[_0x778b('0x34')](handleError(_0x179e51,null));};exports['update']=function(_0x4d49e9,_0x2feb02){if(_0x4d49e9['body']['id']){delete _0x4d49e9[_0x778b('0x36')]['id'];}return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x4d49e9[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x2feb02,null))[_0x778b('0x23')](saveUpdates(_0x4d49e9['body'],null))['then'](respondWithResult(_0x2feb02,null))[_0x778b('0x34')](handleError(_0x2feb02,null));};exports[_0x778b('0x24')]=function(_0x57aaac,_0x1b3da5){return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x57aaac[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x1b3da5,null))[_0x778b('0x23')](removeEntity(_0x1b3da5,null))[_0x778b('0x34')](handleError(_0x1b3da5,null));}; \ No newline at end of file +var _0x8917=['../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x167dc3,_0xca04f5){var _0x211e11=function(_0x556fcc){while(--_0x556fcc){_0x167dc3['push'](_0x167dc3['shift']());}};_0x211e11(++_0xca04f5);}(_0x8917,0x1d7));var _0x7891=function(_0x4e321d,_0x262567){_0x4e321d=_0x4e321d-0x0;var _0x102521=_0x8917[_0x4e321d];return _0x102521;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['show']=function(_0x4009f8,_0x1a6bef){var _0x44442f={'raw':!![],'where':{'id':_0x4009f8[_0x7891('0x2c')]['id']}},_0x263f13={};_0x263f13[_0x7891('0x2d')]=_[_0x7891('0x2e')](db['ChatProactiveAction'][_0x7891('0x2f')]);_0x263f13['query']=_[_0x7891('0x2e')](_0x4009f8[_0x7891('0x30')]);_0x263f13[_0x7891('0x31')]=_[_0x7891('0x32')](_0x263f13[_0x7891('0x2d')],_0x263f13[_0x7891('0x30')]);_0x44442f[_0x7891('0x33')]=_['intersection'](_0x263f13[_0x7891('0x2d')],qs[_0x7891('0x34')](_0x4009f8[_0x7891('0x30')][_0x7891('0x34')]));_0x44442f[_0x7891('0x33')]=_0x44442f[_0x7891('0x33')][_0x7891('0x35')]?_0x44442f['attributes']:_0x263f13['model'];if(_0x4009f8['query']['includeAll']){_0x44442f[_0x7891('0x36')]=[{'all':!![]}];}_0x44442f=_[_0x7891('0x37')]({},_0x44442f,_0x4009f8[_0x7891('0x38')]);return db[_0x7891('0x39')][_0x7891('0x3a')](_0x44442f)[_0x7891('0x27')](handleEntityNotFound(_0x1a6bef,null))['then'](respondWithResult(_0x1a6bef,null))[_0x7891('0x3b')](handleError(_0x1a6bef,null));};exports[_0x7891('0x3c')]=function(_0x19e258,_0x2c1c67){return db[_0x7891('0x39')][_0x7891('0x3c')](_0x19e258[_0x7891('0x3d')],{})['then'](respondWithResult(_0x2c1c67,0xc9))[_0x7891('0x3b')](handleError(_0x2c1c67,null));};exports['update']=function(_0x16ca6d,_0x5ba995){if(_0x16ca6d[_0x7891('0x3d')]['id']){delete _0x16ca6d[_0x7891('0x3d')]['id'];}return db[_0x7891('0x39')][_0x7891('0x3a')]({'where':{'id':_0x16ca6d[_0x7891('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5ba995,null))[_0x7891('0x27')](saveUpdates(_0x16ca6d[_0x7891('0x3d')],null))[_0x7891('0x27')](respondWithResult(_0x5ba995,null))[_0x7891('0x3b')](handleError(_0x5ba995,null));};exports[_0x7891('0x26')]=function(_0x516d5c,_0x4e63ee){return db['ChatProactiveAction'][_0x7891('0x3a')]({'where':{'id':_0x516d5c[_0x7891('0x2c')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x4e63ee,null))[_0x7891('0x27')](removeEntity(_0x4e63ee,null))[_0x7891('0x3b')](handleError(_0x4e63ee,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 55f6bad..0b1cd60 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 _0x4563=['util','api','bluebird','request-promise','../../config/environment','exports','ChatProactiveAction','lodash'];(function(_0x4b078b,_0x53030c){var _0x4bc65c=function(_0x3103b0){while(--_0x3103b0){_0x4b078b['push'](_0x4b078b['shift']());}};_0x4bc65c(++_0x53030c);}(_0x4563,0x87));var _0x3456=function(_0x2de7c,_0x30028e){_0x2de7c=_0x2de7c-0x0;var _0x298e75=_0x4563[_0x2de7c];return _0x298e75;};'use strict';var _=require(_0x3456('0x0'));var util=require(_0x3456('0x1'));var logger=require('../../config/logger')(_0x3456('0x2'));var moment=require('moment');var BPromise=require(_0x3456('0x3'));var rp=require(_0x3456('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3456('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x3456('0x6')]=function(_0xd319e3,_0x4fb2cd){return _0xd319e3['define'](_0x3456('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37d3=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger'];(function(_0xa31177,_0x2ca0b1){var _0x3969a0=function(_0x29f315){while(--_0x29f315){_0xa31177['push'](_0xa31177['shift']());}};_0x3969a0(++_0x2ca0b1);}(_0x37d3,0xf0));var _0x337d=function(_0x505eb5,_0x195087){_0x505eb5=_0x505eb5-0x0;var _0x17cd53=_0x37d3[_0x505eb5];return _0x17cd53;};'use strict';var _=require(_0x337d('0x0'));var util=require('util');var logger=require(_0x337d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x337d('0x2'));var rp=require(_0x337d('0x3'));var fs=require('fs');var path=require(_0x337d('0x4'));var rimraf=require(_0x337d('0x5'));var config=require(_0x337d('0x6'));var attributes=require(_0x337d('0x7'));module[_0x337d('0x8')]=function(_0x3603f9,_0x266835){return _0x3603f9['define'](_0x337d('0x9'),attributes,{'tableName':_0x337d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 6d027a7..b8480e9 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 _0x0fdf=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c5a53,_0x3e3994){var _0x1534b6=function(_0x1cb4ba){while(--_0x1cb4ba){_0x4c5a53['push'](_0x4c5a53['shift']());}};_0x1534b6(++_0x3e3994);}(_0x0fdf,0x1f0));var _0xf0fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fdf[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf0fd('0x0'));var util=require(_0xf0fd('0x1'));var moment=require(_0xf0fd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0fd('0x3'));var fs=require('fs');var Redis=require(_0xf0fd('0x4'));var db=require(_0xf0fd('0x5'))['db'];var utils=require(_0xf0fd('0x6'));var logger=require(_0xf0fd('0x7'))(_0xf0fd('0x8'));var config=require(_0xf0fd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf0fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f622,_0x1ae491,_0x5d9cc3){return new BPromise(function(_0x7344e,_0x39a093){return client[_0xf0fd('0xb')](_0x30f622,_0x5d9cc3)[_0xf0fd('0xc')](function(_0x4c51cb){logger[_0xf0fd('0xd')](_0xf0fd('0xe'),_0x1ae491,_0xf0fd('0xf'));logger['debug'](_0xf0fd('0x10'),_0x1ae491,_0xf0fd('0xf'),JSON[_0xf0fd('0x11')](_0x4c51cb));if(_0x4c51cb[_0xf0fd('0x12')]){if(_0x4c51cb[_0xf0fd('0x12')][_0xf0fd('0x13')]===0x1f4){logger[_0xf0fd('0x12')](_0xf0fd('0xe'),_0x1ae491,_0x4c51cb[_0xf0fd('0x12')][_0xf0fd('0x14')]);return _0x39a093(_0x4c51cb[_0xf0fd('0x12')][_0xf0fd('0x14')]);}logger['error'](_0xf0fd('0xe'),_0x1ae491,_0x4c51cb[_0xf0fd('0x12')][_0xf0fd('0x14')]);return _0x7344e(_0x4c51cb[_0xf0fd('0x12')][_0xf0fd('0x14')]);}else{logger[_0xf0fd('0xd')](_0xf0fd('0xe'),_0x1ae491,'request\x20sent');_0x7344e(_0x4c51cb[_0xf0fd('0x15')][_0xf0fd('0x14')]);}})[_0xf0fd('0x16')](function(_0x447283){logger[_0xf0fd('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1ae491,_0x447283);_0x39a093(_0x447283);});});} \ No newline at end of file +var _0x4309=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2fd419,_0x366bda){var _0x5f9ebf=function(_0x5a1544){while(--_0x5a1544){_0x2fd419['push'](_0x2fd419['shift']());}};_0x5f9ebf(++_0x366bda);}(_0x4309,0x1f3));var _0x9430=function(_0xf0e2bd,_0x2e38e5){_0xf0e2bd=_0xf0e2bd-0x0;var _0x57ddaa=_0x4309[_0xf0e2bd];return _0x57ddaa;};'use strict';var _=require('lodash');var util=require(_0x9430('0x0'));var moment=require(_0x9430('0x1'));var BPromise=require(_0x9430('0x2'));var rs=require(_0x9430('0x3'));var fs=require('fs');var Redis=require(_0x9430('0x4'));var db=require(_0x9430('0x5'))['db'];var utils=require(_0x9430('0x6'));var logger=require(_0x9430('0x7'))(_0x9430('0x8'));var config=require(_0x9430('0x9'));var jayson=require(_0x9430('0xa'));var client=jayson[_0x9430('0xb')][_0x9430('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4be11d,_0x48a5c1,_0x182f7c){return new BPromise(function(_0x31cd40,_0x414be9){return client['request'](_0x4be11d,_0x182f7c)[_0x9430('0xd')](function(_0x209e67){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x48a5c1,'request\x20sent');logger[_0x9430('0xe')](_0x9430('0xf'),_0x48a5c1,_0x9430('0x10'),JSON['stringify'](_0x209e67));if(_0x209e67['error']){if(_0x209e67[_0x9430('0x11')][_0x9430('0x12')]===0x1f4){logger[_0x9430('0x11')](_0x9430('0x13'),_0x48a5c1,_0x209e67['error'][_0x9430('0x14')]);return _0x414be9(_0x209e67['error']['message']);}logger['error'](_0x9430('0x13'),_0x48a5c1,_0x209e67[_0x9430('0x11')][_0x9430('0x14')]);return _0x31cd40(_0x209e67[_0x9430('0x11')][_0x9430('0x14')]);}else{logger[_0x9430('0x15')](_0x9430('0x13'),_0x48a5c1,_0x9430('0x10'));_0x31cd40(_0x209e67[_0x9430('0x16')]['message']);}})[_0x9430('0x17')](function(_0x330465){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x48a5c1,_0x330465);_0x414be9(_0x330465);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 4dbdca5..5fc5743 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 _0x3f8a=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x32fd2d,_0x5658de){var _0x321c78=function(_0x10bbef){while(--_0x10bbef){_0x32fd2d['push'](_0x32fd2d['shift']());}};_0x321c78(++_0x5658de);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x13c130,_0x14dd19){_0x13c130=_0x13c130-0x0;var _0x140506=_0x3f8a[_0x13c130];return _0x140506;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xc')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x11')]);router['delete'](_0xa3f8('0xb'),auth[_0xa3f8('0xc')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router; \ No newline at end of file +var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xabce,0x103));var _0xeabc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xabce[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 5f5b695..28f4b46 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 _0xb6f7=['exports','name','STRING','INTEGER','beepall','roundrobin','sequelize'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xb6f7,0x13a));var _0x7b6f=function(_0x2deba2,_0x2b4424){_0x2deba2=_0x2deba2-0x0;var _0x1fde16=_0xb6f7[_0x2deba2];return _0x1fde16;};'use strict';var Sequelize=require(_0x7b6f('0x0'));module[_0x7b6f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7b6f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b6f('0x3')]},'timeout':{'type':Sequelize[_0x7b6f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7b6f('0x5'),_0x7b6f('0x6'))}}; \ No newline at end of file +var _0x850c=['INTEGER','ENUM','beepall','exports','STRING','name'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x850c,0x1b3));var _0xc850=function(_0x2cc21e,_0x5c649e){_0x2cc21e=_0x2cc21e-0x0;var _0x5c0ce0=_0x850c[_0x2cc21e];return _0x5c0ce0;};'use strict';var Sequelize=require('sequelize');module[_0xc850('0x0')]={'name':{'type':Sequelize[_0xc850('0x1')],'unique':_0xc850('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc850('0x1')]},'timeout':{'type':Sequelize[_0xc850('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc850('0x4')]('rrmemory',_0xc850('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 3bfdfb6..b965313 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 _0x3b6a=['compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','show','params','intersection','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x3b6a,0x1c9));var _0xa3b6=function(_0x325ee2,_0xaf1371){_0x325ee2=_0x325ee2-0x0;var _0x7f2741=_0x3b6a[_0x325ee2];return _0x7f2741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3b6('0x0'));var zipdir=require(_0xa3b6('0x1'));var jsonpatch=require(_0xa3b6('0x2'));var rp=require(_0xa3b6('0x3'));var moment=require(_0xa3b6('0x4'));var BPromise=require(_0xa3b6('0x5'));var Mustache=require(_0xa3b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa3b6('0x7'));var csv=require(_0xa3b6('0x8'));var ejs=require(_0xa3b6('0x9'));var fs=require('fs');var fs_extra=require(_0xa3b6('0xa'));var _=require(_0xa3b6('0xb'));var squel=require(_0xa3b6('0xc'));var crypto=require(_0xa3b6('0xd'));var jsforce=require(_0xa3b6('0xe'));var deskjs=require(_0xa3b6('0xf'));var toCsv=require(_0xa3b6('0x8'));var querystring=require(_0xa3b6('0x10'));var Papa=require(_0xa3b6('0x11'));var Redis=require(_0xa3b6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa3b6('0x13'));var as=require(_0xa3b6('0x14'));var hardwareService=require(_0xa3b6('0x15'));var logger=require(_0xa3b6('0x16'))('api');var utils=require(_0xa3b6('0x17'));var config=require(_0xa3b6('0x18'));var licenseUtil=require(_0xa3b6('0x19'));var db=require(_0xa3b6('0x1a'))['db'];config['redis']=_['defaults'](config[_0xa3b6('0x1b')],{'host':_0xa3b6('0x1c'),'port':0x18eb});var socket=require(_0xa3b6('0x1d'))(new Redis(config[_0xa3b6('0x1b')]));require(_0xa3b6('0x1e'))[_0xa3b6('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa3b6('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x787d77,_0xf69c52,_0x1fab05,_0x525dd6){return new BPromise(function(_0x1ebe5f,_0x48127c){var _0x156cf5=_0x525dd6||client;return _0x156cf5['request'](_0x787d77,_0x1fab05)[_0xa3b6('0x21')](function(_0x5d1eaf){logger[_0xa3b6('0x22')](_0xa3b6('0x23'),_0xf69c52,_0xa3b6('0x24'));logger[_0xa3b6('0x25')](_0xa3b6('0x26'),_0xf69c52,_0xa3b6('0x24'),JSON[_0xa3b6('0x27')](_0x5d1eaf));if(_0x5d1eaf[_0xa3b6('0x28')]){if(_0x5d1eaf[_0xa3b6('0x28')]['code']===0x1f4){logger[_0xa3b6('0x28')]('ChatQueue,\x20%s,\x20%s',_0xf69c52,_0x5d1eaf[_0xa3b6('0x28')]['message']);return _0x48127c(_0x5d1eaf[_0xa3b6('0x28')]['message']);}logger[_0xa3b6('0x28')](_0xa3b6('0x23'),_0xf69c52,_0x5d1eaf['error'][_0xa3b6('0x29')]);return _0x1ebe5f(_0x5d1eaf[_0xa3b6('0x28')][_0xa3b6('0x29')]);}else{logger[_0xa3b6('0x22')](_0xa3b6('0x23'),_0xf69c52,_0xa3b6('0x24'));_0x1ebe5f(_0x5d1eaf['result'][_0xa3b6('0x29')]);}})[_0xa3b6('0x2a')](function(_0xd8a102){logger[_0xa3b6('0x28')](_0xa3b6('0x23'),_0xf69c52,_0xd8a102);_0x48127c(_0xd8a102);});});}function respondWithStatusCode(_0x6227cd,_0x2aa6ee){_0x2aa6ee=_0x2aa6ee||0xcc;return function(_0x1741f8){if(_0x1741f8){return _0x6227cd[_0xa3b6('0x2b')](_0x2aa6ee);}return _0x6227cd[_0xa3b6('0x2c')](_0x2aa6ee)[_0xa3b6('0x2d')]();};}function respondWithResult(_0x1a4625,_0x5ba6dd){_0x5ba6dd=_0x5ba6dd||0xc8;return function(_0x7ddb4f){if(_0x7ddb4f){return _0x1a4625['status'](_0x5ba6dd)[_0xa3b6('0x2e')](_0x7ddb4f);}};}function respondWithFilteredResult(_0x26dfdc,_0x19331c){return function(_0x4a1f3e){if(_0x4a1f3e){var _0x31f675=typeof _0x19331c[_0xa3b6('0x2f')]===_0xa3b6('0x30')&&typeof _0x19331c[_0xa3b6('0x31')]===_0xa3b6('0x30');var _0x365bb4=_0x4a1f3e[_0xa3b6('0x32')];var _0x4230bd=_0x31f675?0x0:_0x19331c[_0xa3b6('0x2f')];var _0xef67ab=_0x31f675?_0x4a1f3e[_0xa3b6('0x32')]:_0x19331c[_0xa3b6('0x2f')]+_0x19331c[_0xa3b6('0x31')];var _0x8fb53a;if(_0xef67ab>=_0x365bb4){_0xef67ab=_0x365bb4;_0x8fb53a=0xc8;}else{_0x8fb53a=0xce;}_0x26dfdc[_0xa3b6('0x2c')](_0x8fb53a);return _0x26dfdc['set'](_0xa3b6('0x33'),_0x4230bd+'-'+_0xef67ab+'/'+_0x365bb4)[_0xa3b6('0x2e')](_0x4a1f3e);}return null;};}function patchUpdates(_0x1f8a24){return function(_0x5dab7c){try{jsonpatch[_0xa3b6('0x34')](_0x5dab7c,_0x1f8a24,!![]);}catch(_0x4295fd){return BPromise[_0xa3b6('0x35')](_0x4295fd);}return _0x5dab7c['save']();};}function saveUpdates(_0x466812,_0x5c8524){return function(_0x46b241){if(_0x46b241){return _0x46b241[_0xa3b6('0x36')](_0x466812)['then'](function(_0x2a81ac){return _0x2a81ac;});}return null;};}function removeEntity(_0x557710,_0x54c851){return function(_0x3d49d0){if(_0x3d49d0){return _0x3d49d0[_0xa3b6('0x37')]()[_0xa3b6('0x21')](function(){var _0x56c628=_0x3d49d0[_0xa3b6('0x38')]({'plain':!![]});var _0x43bbc5=_0xa3b6('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x43bbc5,'resourceId':_0x56c628['id']}})[_0xa3b6('0x21')](function(){return _0x3d49d0;});})[_0xa3b6('0x21')](function(){_0x557710[_0xa3b6('0x2c')](0xcc)[_0xa3b6('0x2d')]();});}};}function handleEntityNotFound(_0x1c3b04,_0x44b3ab){return function(_0x43e2a6){if(!_0x43e2a6){_0x1c3b04['sendStatus'](0x194);}return _0x43e2a6;};}function handleError(_0x902926,_0x428d38){_0x428d38=_0x428d38||0x1f4;return function(_0x4ef3f7){logger[_0xa3b6('0x28')](_0x4ef3f7[_0xa3b6('0x3a')]);if(_0x4ef3f7[_0xa3b6('0x3b')]){delete _0x4ef3f7[_0xa3b6('0x3b')];}_0x902926['status'](_0x428d38)['send'](_0x4ef3f7);};}exports[_0xa3b6('0x3c')]=function(_0x8f7934,_0x5e34e4){var _0x47431e={},_0x1e6255={},_0x1cffc0={'count':0x0,'rows':[]};var _0x2cad68=_[_0xa3b6('0x3d')](db[_0xa3b6('0x3e')][_0xa3b6('0x3f')],function(_0x3e0cb6){return{'name':_0x3e0cb6[_0xa3b6('0x40')],'type':_0x3e0cb6[_0xa3b6('0x41')]['key']};});_0x1e6255[_0xa3b6('0x42')]=_['map'](_0x2cad68,'name');_0x1e6255[_0xa3b6('0x43')]=_[_0xa3b6('0x44')](_0x8f7934['query']);_0x1e6255[_0xa3b6('0x45')]=_['intersection'](_0x1e6255['model'],_0x1e6255[_0xa3b6('0x43')]);_0x47431e['attributes']=_['intersection'](_0x1e6255['model'],qs[_0xa3b6('0x46')](_0x8f7934[_0xa3b6('0x43')]['fields']));_0x47431e['attributes']=_0x47431e[_0xa3b6('0x47')][_0xa3b6('0x48')]?_0x47431e[_0xa3b6('0x47')]:_0x1e6255[_0xa3b6('0x42')];if(!_0x8f7934[_0xa3b6('0x43')]['hasOwnProperty'](_0xa3b6('0x49'))){_0x47431e['limit']=qs[_0xa3b6('0x31')](_0x8f7934['query'][_0xa3b6('0x31')]);_0x47431e['offset']=qs['offset'](_0x8f7934[_0xa3b6('0x43')][_0xa3b6('0x2f')]);}_0x47431e[_0xa3b6('0x4a')]=qs[_0xa3b6('0x4b')](_0x8f7934[_0xa3b6('0x43')][_0xa3b6('0x4b')]);_0x47431e[_0xa3b6('0x4c')]=qs[_0xa3b6('0x45')](_[_0xa3b6('0x4d')](_0x8f7934['query'],_0x1e6255[_0xa3b6('0x45')]),_0x2cad68);if(_0x8f7934['query'][_0xa3b6('0x4e')]){_0x47431e[_0xa3b6('0x4c')]=_['merge'](_0x47431e['where'],{'$or':_[_0xa3b6('0x3d')](_0x2cad68,function(_0xd8d86b){if(_0xd8d86b[_0xa3b6('0x41')]!=='VIRTUAL'){var _0x30def6={};_0x30def6[_0xd8d86b[_0xa3b6('0x3b')]]={'$like':'%'+_0x8f7934[_0xa3b6('0x43')][_0xa3b6('0x4e')]+'%'};return _0x30def6;}})});}_0x47431e=_[_0xa3b6('0x4f')]({},_0x47431e,_0x8f7934['options']);var _0x428ab5={'where':_0x47431e[_0xa3b6('0x4c')]};return db[_0xa3b6('0x3e')][_0xa3b6('0x32')](_0x428ab5)['then'](function(_0x2f8e29){_0x1cffc0[_0xa3b6('0x32')]=_0x2f8e29;if(_0x8f7934[_0xa3b6('0x43')]['includeAll']){_0x47431e[_0xa3b6('0x50')]=[{'all':!![]}];}return db[_0xa3b6('0x3e')][_0xa3b6('0x51')](_0x47431e);})['then'](function(_0x261ce6){_0x1cffc0[_0xa3b6('0x52')]=_0x261ce6;return _0x1cffc0;})[_0xa3b6('0x21')](respondWithFilteredResult(_0x5e34e4,_0x47431e))[_0xa3b6('0x2a')](handleError(_0x5e34e4,null));};exports[_0xa3b6('0x53')]=function(_0x18fd13,_0x4cca18){var _0x2fadfc={'raw':!![],'where':{'id':_0x18fd13[_0xa3b6('0x54')]['id']}},_0x218d39={};_0x218d39[_0xa3b6('0x42')]=_['keys'](db[_0xa3b6('0x3e')]['rawAttributes']);_0x218d39['query']=_['keys'](_0x18fd13['query']);_0x218d39[_0xa3b6('0x45')]=_['intersection'](_0x218d39[_0xa3b6('0x42')],_0x218d39[_0xa3b6('0x43')]);_0x2fadfc[_0xa3b6('0x47')]=_[_0xa3b6('0x55')](_0x218d39['model'],qs[_0xa3b6('0x46')](_0x18fd13[_0xa3b6('0x43')]['fields']));_0x2fadfc['attributes']=_0x2fadfc[_0xa3b6('0x47')][_0xa3b6('0x48')]?_0x2fadfc[_0xa3b6('0x47')]:_0x218d39[_0xa3b6('0x42')];if(_0x18fd13[_0xa3b6('0x43')][_0xa3b6('0x56')]){_0x2fadfc[_0xa3b6('0x50')]=[{'all':!![]}];}_0x2fadfc=_[_0xa3b6('0x4f')]({},_0x2fadfc,_0x18fd13[_0xa3b6('0x57')]);return db[_0xa3b6('0x3e')][_0xa3b6('0x58')](_0x2fadfc)[_0xa3b6('0x21')](handleEntityNotFound(_0x4cca18,null))[_0xa3b6('0x21')](respondWithResult(_0x4cca18,null))['catch'](handleError(_0x4cca18,null));};exports[_0xa3b6('0x59')]=function(_0x5ccefe,_0xc445be){return db[_0xa3b6('0x3e')][_0xa3b6('0x59')](_0x5ccefe[_0xa3b6('0x5a')],{})[_0xa3b6('0x21')](function(_0x4cf59b){var _0x36a7a1=_0x5ccefe['user'][_0xa3b6('0x38')]({'plain':!![]});if(!_0x36a7a1)throw new Error(_0xa3b6('0x5b'));if(_0x36a7a1[_0xa3b6('0x5c')]===_0xa3b6('0x5d')){var _0x4b3c64=_0x4cf59b[_0xa3b6('0x38')]({'plain':!![]});var _0x3369a8=_0xa3b6('0x39');return db[_0xa3b6('0x5e')][_0xa3b6('0x58')]({'where':{'name':_0x3369a8,'userProfileId':_0x36a7a1[_0xa3b6('0x5f')]},'raw':!![]})[_0xa3b6('0x21')](function(_0x3c4d22){if(_0x3c4d22&&_0x3c4d22[_0xa3b6('0x60')]===0x0){return db[_0xa3b6('0x61')][_0xa3b6('0x59')]({'name':_0x4b3c64[_0xa3b6('0x3b')],'resourceId':_0x4b3c64['id'],'type':_0x3c4d22[_0xa3b6('0x3b')],'sectionId':_0x3c4d22['id']},{})[_0xa3b6('0x21')](function(){return _0x4cf59b;});}else{return _0x4cf59b;}})[_0xa3b6('0x2a')](function(_0x33da3f){logger['error'](_0xa3b6('0x62'),_0x33da3f);throw _0x33da3f;});}return _0x4cf59b;})[_0xa3b6('0x21')](respondWithResult(_0xc445be,0xc9))['catch'](handleError(_0xc445be,null));};exports[_0xa3b6('0x36')]=function(_0x3e9689,_0x5f1c39){if(_0x3e9689['body']['id']){delete _0x3e9689['body']['id'];}return db['ChatQueue'][_0xa3b6('0x58')]({'where':{'id':_0x3e9689[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](handleEntityNotFound(_0x5f1c39,null))['then'](saveUpdates(_0x3e9689[_0xa3b6('0x5a')],null))[_0xa3b6('0x21')](respondWithResult(_0x5f1c39,null))[_0xa3b6('0x2a')](handleError(_0x5f1c39,null));};exports[_0xa3b6('0x37')]=function(_0x2570bb,_0x2ea354){return db['ChatQueue'][_0xa3b6('0x58')]({'where':{'id':_0x2570bb[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](handleEntityNotFound(_0x2ea354,null))[_0xa3b6('0x21')](removeEntity(_0x2ea354,null))[_0xa3b6('0x2a')](handleError(_0x2ea354,null));};exports['describe']=function(_0x177ccc,_0x9e5869){return db[_0xa3b6('0x3e')][_0xa3b6('0x63')]()[_0xa3b6('0x21')](respondWithResult(_0x9e5869,null))[_0xa3b6('0x2a')](handleError(_0x9e5869,null));};exports[_0xa3b6('0x64')]=function(_0xa9ae61,_0x589071,_0x4a06e4){var _0x16e049={'raw':!![],'where':{}},_0x3b2faa={},_0x1c8735;return db[_0xa3b6('0x3e')][_0xa3b6('0x65')]({'where':{'id':_0xa9ae61[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](handleEntityNotFound(_0x589071,null))[_0xa3b6('0x21')](function(_0x1f5093){if(_0x1f5093){_0x1c8735=_0x1f5093[_0xa3b6('0x38')]({'plain':!![]});_0x3b2faa[_0xa3b6('0x42')]=_[_0xa3b6('0x44')](db[_0xa3b6('0x66')][_0xa3b6('0x3f')]);_0x3b2faa['query']=_[_0xa3b6('0x44')](_0xa9ae61[_0xa3b6('0x43')]);_0x3b2faa[_0xa3b6('0x45')]=_[_0xa3b6('0x55')](_0x3b2faa[_0xa3b6('0x42')],_0x3b2faa[_0xa3b6('0x43')]);_0x16e049['attributes']=_[_0xa3b6('0x55')](_0x3b2faa['model'],qs[_0xa3b6('0x46')](_0xa9ae61['query']['fields']));_0x16e049[_0xa3b6('0x47')]=_0x16e049[_0xa3b6('0x47')][_0xa3b6('0x48')]?_0x16e049[_0xa3b6('0x47')]:_0x3b2faa[_0xa3b6('0x42')];if(!_0xa9ae61[_0xa3b6('0x43')]['hasOwnProperty'](_0xa3b6('0x49'))){_0x16e049['limit']=qs[_0xa3b6('0x31')](_0xa9ae61[_0xa3b6('0x43')][_0xa3b6('0x31')]);_0x16e049[_0xa3b6('0x2f')]=qs[_0xa3b6('0x2f')](_0xa9ae61[_0xa3b6('0x43')][_0xa3b6('0x2f')]);}_0x16e049[_0xa3b6('0x4a')]=qs['sort'](_0xa9ae61[_0xa3b6('0x43')][_0xa3b6('0x4b')]);_0x16e049[_0xa3b6('0x4c')]=qs['filters'](_[_0xa3b6('0x4d')](_0xa9ae61[_0xa3b6('0x43')],_0x3b2faa['filters']));_0x16e049[_0xa3b6('0x4c')][_0xa3b6('0x67')]=_0x1f5093['id'];if(_0xa9ae61[_0xa3b6('0x43')][_0xa3b6('0x4e')]){_0x16e049[_0xa3b6('0x4c')]=_['merge'](_0x16e049[_0xa3b6('0x4c')],{'$or':_[_0xa3b6('0x3d')](_0x16e049[_0xa3b6('0x47')],function(_0x1dfb83){var _0x5114d6={};_0x5114d6[_0x1dfb83]={'$like':'%'+_0xa9ae61[_0xa3b6('0x43')][_0xa3b6('0x4e')]+'%'};return _0x5114d6;})});}_0x16e049=_[_0xa3b6('0x4f')]({},_0x16e049,_0xa9ae61[_0xa3b6('0x57')]);return db[_0xa3b6('0x66')]['findAll'](_0x16e049);}})[_0xa3b6('0x21')](function(_0x5994f7){if(_0x5994f7){return db[_0xa3b6('0x68')][_0xa3b6('0x69')]({'where':{'id':_[_0xa3b6('0x3d')](_0x5994f7,'UserId'),'role':'agent'},'attributes':['id',_0xa3b6('0x3b'),_0xa3b6('0x6a'),_0xa3b6('0x6b'),_0xa3b6('0x6c')]});}})['then'](function(_0x5b2335){if(_0x5b2335){return{'count':_0x5b2335['count'],'rows':_['map'](_0x5b2335[_0xa3b6('0x52')],function(_0x42dfda){return{'membername':_0x42dfda['name'],'UserId':_0x42dfda['id'],'queue_name':_0x1c8735['name'],'ChatQueueId':_0x1c8735['id'],'interface':util['format'](_0xa3b6('0x6d'),_0xa3b6('0x6e'),_0x42dfda[_0xa3b6('0x3b')]),'penalty':0x0,'paused':_0x42dfda[_0xa3b6('0x6a')],'createdAt':_0x42dfda[_0xa3b6('0x6c')],'updatedAt':_0x42dfda[_0xa3b6('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x589071,_0x16e049))[_0xa3b6('0x2a')](handleError(_0x589071,null));};exports[_0xa3b6('0x6f')]=function(_0xee00a2,_0x44a35b,_0x45cb30){var _0x3fd970={};var _0x10c608={};var _0xca947d;var _0x623380;return db[_0xa3b6('0x3e')][_0xa3b6('0x65')]({'where':{'id':_0xee00a2[_0xa3b6('0x54')]['id']}})['then'](handleEntityNotFound(_0x44a35b,null))[_0xa3b6('0x21')](function(_0x20dc8e){if(_0x20dc8e){_0xca947d=_0x20dc8e;_0x10c608['model']=_[_0xa3b6('0x44')](db[_0xa3b6('0x70')][_0xa3b6('0x3f')]);_0x10c608[_0xa3b6('0x43')]=_[_0xa3b6('0x44')](_0xee00a2[_0xa3b6('0x43')]);_0x10c608[_0xa3b6('0x45')]=_['intersection'](_0x10c608[_0xa3b6('0x42')],_0x10c608['query']);_0x3fd970[_0xa3b6('0x47')]=_[_0xa3b6('0x55')](_0x10c608[_0xa3b6('0x42')],qs[_0xa3b6('0x46')](_0xee00a2[_0xa3b6('0x43')][_0xa3b6('0x46')]));_0x3fd970[_0xa3b6('0x47')]=_0x3fd970[_0xa3b6('0x47')]['length']?_0x3fd970[_0xa3b6('0x47')]:_0x10c608['model'];_0x3fd970[_0xa3b6('0x4a')]=qs[_0xa3b6('0x4b')](_0xee00a2[_0xa3b6('0x43')]['sort']);_0x3fd970['where']=qs['filters'](_[_0xa3b6('0x4d')](_0xee00a2[_0xa3b6('0x43')],_0x10c608[_0xa3b6('0x45')]));if(_0xee00a2['query'][_0xa3b6('0x4e')]){_0x3fd970[_0xa3b6('0x4c')]=_[_0xa3b6('0x4f')](_0x3fd970[_0xa3b6('0x4c')],{'$or':_[_0xa3b6('0x3d')](_0x3fd970['attributes'],function(_0x6d94aa){var _0x37103b={};_0x37103b[_0x6d94aa]={'$like':'%'+_0xee00a2[_0xa3b6('0x43')][_0xa3b6('0x4e')]+'%'};return _0x37103b;})});}_0x3fd970=_[_0xa3b6('0x4f')]({},_0x3fd970,_0xee00a2[_0xa3b6('0x57')]);return _0xca947d['getTeams'](_0x3fd970);}})['then'](function(_0x563bd2){if(_0x563bd2){_0x623380=_0x563bd2[_0xa3b6('0x48')];if(!_0xee00a2['query']['hasOwnProperty'](_0xa3b6('0x49'))){_0x3fd970[_0xa3b6('0x31')]=qs[_0xa3b6('0x31')](_0xee00a2['query'][_0xa3b6('0x31')]);_0x3fd970[_0xa3b6('0x2f')]=qs[_0xa3b6('0x2f')](_0xee00a2[_0xa3b6('0x43')]['offset']);}return _0xca947d[_0xa3b6('0x6f')](_0x3fd970);}})[_0xa3b6('0x21')](function(_0xe2e363){if(_0xe2e363){return _0xe2e363?{'count':_0x623380,'rows':_0xe2e363}:null;}})[_0xa3b6('0x21')](respondWithResult(_0x44a35b,null))[_0xa3b6('0x2a')](handleError(_0x44a35b,null));};exports['addTeams']=function(_0x472e91,_0x17e349,_0x5926d7){var _0x1f9dbe=_0x472e91[_0xa3b6('0x5a')]['ids'];return db[_0xa3b6('0x70')][_0xa3b6('0x51')]({'where':{'id':_0x1f9dbe},'attributes':['id'],'include':[{'model':db[_0xa3b6('0x68')],'as':_0xa3b6('0x71'),'attributes':['id',_0xa3b6('0x3b'),_0xa3b6('0x72'),'voicePause',_0xa3b6('0x73')],'raw':!![]}]})['then'](function(_0x162c9c){if(_0x162c9c){var _0x483bd3=_[_0xa3b6('0x74')](_0x162c9c,function(_0x280d44){var _0xb4d84f=_0x280d44[_0xa3b6('0x38')]({'plain':!![]});return _0xb4d84f[_0xa3b6('0x71')];});return db[_0xa3b6('0x3e')][_0xa3b6('0x58')]({'where':{'id':_0x472e91['params']['id']}})['then'](function(_0x5d1a29){return db[_0xa3b6('0x75')][_0xa3b6('0x76')](function(_0x5536b8){return _0x5d1a29[_0xa3b6('0x77')](_0x1f9dbe,{'transaction':_0x5536b8})[_0xa3b6('0x21')](function(){return BPromise[_0xa3b6('0x78')](_0x483bd3,function(_0x415e16){return db['UserChatQueue'][_0xa3b6('0x79')]({'where':{'UserId':_0x415e16['id'],'ChatQueueId':_0x472e91[_0xa3b6('0x54')]['id']},'transaction':_0x5536b8});});})['then'](function(){_0x483bd3[_0xa3b6('0x7a')](function(_0x5f2a58){socket[_0xa3b6('0x7b')](_0xa3b6('0x7c'),{'UserId':_0x5f2a58['id'],'ChatQueueId':_0x5d1a29['id']});});});});});}})[_0xa3b6('0x21')](respondWithStatusCode(_0x17e349,null))[_0xa3b6('0x2a')](handleError(_0x17e349,null));};exports[_0xa3b6('0x7d')]=function(_0x86b86f,_0x2b8f92,_0x1d937a){return db[_0xa3b6('0x70')]['findAll']({'where':{'id':_0x86b86f[_0xa3b6('0x43')][_0xa3b6('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xa3b6('0x68')],'as':_0xa3b6('0x71'),'attributes':['id'],'raw':!![]}]})[_0xa3b6('0x21')](handleEntityNotFound(_0x2b8f92,null))[_0xa3b6('0x21')](function(_0x4f7031){var _0x424c40=_[_0xa3b6('0x3d')](_0x4f7031,'id');var _0x15f05a=[];var _0x140491=[];var _0x11a54b=squel['select']();_0x11a54b['field']('tq.TeamId')[_0xa3b6('0x7f')]('team_has_chat_queues','tq')[_0xa3b6('0x80')]('user_has_teams','ut',_0xa3b6('0x81'))['where']('ChatQueueId\x20=\x20?',_0x86b86f[_0xa3b6('0x54')]['id']);for(var _0x2d98c5=0x0;_0x2d98c5<_0x4f7031[_0xa3b6('0x48')];_0x2d98c5+=0x1){let _0x38bcad=_0x4f7031[_0x2d98c5];for(var _0x47be91=0x0;_0x47be91<_0x38bcad[_0xa3b6('0x71')][_0xa3b6('0x48')];_0x47be91+=0x1){let _0x24c682=_0x38bcad[_0xa3b6('0x71')][_0x47be91];var _0x3a3c90=_0x11a54b[_0xa3b6('0x82')]();_0x3a3c90[_0xa3b6('0x4c')](_0xa3b6('0x83'),_0x24c682['id']);_0x140491[_0xa3b6('0x84')](db[_0xa3b6('0x75')][_0xa3b6('0x43')](_0x3a3c90['toString'](),{'type':db[_0xa3b6('0x75')][_0xa3b6('0x85')][_0xa3b6('0x86')]})[_0xa3b6('0x21')](function(_0x2b806f){if(_0x2b806f[_0xa3b6('0x48')]===0x1){return _0x24c682['id'];}else{var _0x2c22a2=_[_0xa3b6('0x87')](_[_0xa3b6('0x3d')](_0x2b806f,_0xa3b6('0x88')),function(_0x123e14){return _[_0xa3b6('0x89')](_0x424c40,_0x123e14);});if(_0x2c22a2){return _0x24c682['id'];}}}));}}return BPromise[_0xa3b6('0x8a')](_0x140491)[_0xa3b6('0x21')](function(_0xed8367){_0x15f05a=_(_0x15f05a)['union'](_0xed8367)[_0xa3b6('0x8b')]()[_0xa3b6('0x8c')]();return db[_0xa3b6('0x3e')][_0xa3b6('0x58')]({'where':{'id':_0x86b86f[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](function(_0x5245c9){return db[_0xa3b6('0x75')][_0xa3b6('0x76')](function(_0x6ff448){return _0x5245c9[_0xa3b6('0x7d')](_0x86b86f[_0xa3b6('0x43')][_0xa3b6('0x7e')],{'transaction':_0x6ff448})[_0xa3b6('0x21')](function(){if(!_[_0xa3b6('0x8d')](_0x15f05a)){return _0x5245c9[_0xa3b6('0x8e')](_0x15f05a,{'transaction':_0x6ff448});}})[_0xa3b6('0x21')](function(){_0x15f05a['forEach'](function(_0x39a62d){socket[_0xa3b6('0x7b')](_0xa3b6('0x8f'),{'UserId':_0x39a62d,'ChatQueueId':_0x5245c9['id']});});});});});});})[_0xa3b6('0x21')](respondWithStatusCode(_0x2b8f92,null))[_0xa3b6('0x2a')](handleError(_0x2b8f92,null));};exports[_0xa3b6('0x90')]=function(_0x4f49f9,_0x354ed1,_0x3c261f){return db[_0xa3b6('0x3e')][_0xa3b6('0x58')]({'where':{'id':_0x4f49f9[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](handleEntityNotFound(_0x354ed1,null))[_0xa3b6('0x21')](function(_0x2b1bec){if(_0x2b1bec){return _0x2b1bec[_0xa3b6('0x90')](_0x4f49f9[_0xa3b6('0x5a')]['ids'],_[_0xa3b6('0x91')](_0x4f49f9[_0xa3b6('0x5a')],['ids','id'])||{})['spread'](function(_0x1187f4){for(var _0x2a922f=0x0;_0x2a922f<_0x4f49f9[_0xa3b6('0x5a')][_0xa3b6('0x7e')][_0xa3b6('0x48')];_0x2a922f+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4f49f9[_0xa3b6('0x5a')][_0xa3b6('0x7e')][_0x2a922f]),'ChatQueueId':Number(_0x4f49f9['params']['id'])});}return _0x1187f4;});}})[_0xa3b6('0x21')](respondWithResult(_0x354ed1,null))['catch'](handleError(_0x354ed1,null));};exports['removeAgents']=function(_0x2e4dc8,_0x2d74a3,_0x1f8859){return db[_0xa3b6('0x3e')][_0xa3b6('0x58')]({'where':{'id':_0x2e4dc8[_0xa3b6('0x54')]['id']}})['then'](handleEntityNotFound(_0x2d74a3,null))[_0xa3b6('0x21')](function(_0x197603){if(_0x197603){return _0x197603[_0xa3b6('0x8e')](_0x2e4dc8[_0xa3b6('0x43')]['ids'])[_0xa3b6('0x21')](function(){if(_[_0xa3b6('0x92')](_0x2e4dc8[_0xa3b6('0x43')]['ids'])){for(var _0x34d530=0x0;_0x34d530<_0x2e4dc8['query']['ids'][_0xa3b6('0x48')];_0x34d530+=0x1){socket[_0xa3b6('0x7b')](_0xa3b6('0x8f'),{'UserId':Number(_0x2e4dc8[_0xa3b6('0x43')][_0xa3b6('0x7e')][_0x34d530]),'ChatQueueId':Number(_0x2e4dc8['params']['id'])});}}else{socket[_0xa3b6('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x2e4dc8[_0xa3b6('0x43')][_0xa3b6('0x7e')]),'ChatQueueId':Number(_0x2e4dc8[_0xa3b6('0x54')]['id'])});}});}})[_0xa3b6('0x21')](respondWithStatusCode(_0x2d74a3,null))['catch'](handleError(_0x2d74a3,null));};exports[_0xa3b6('0x93')]=function(_0x56e886,_0x4a63cc,_0x4f1e2f){var _0x220b1f={};var _0x5c9e2e={};var _0x15fba1;var _0x129315;return db['ChatQueue'][_0xa3b6('0x65')]({'where':{'id':_0x56e886[_0xa3b6('0x54')]['id']}})[_0xa3b6('0x21')](handleEntityNotFound(_0x4a63cc,null))['then'](function(_0x56353d){if(_0x56353d){_0x15fba1=_0x56353d;_0x5c9e2e['model']=_['keys'](db[_0xa3b6('0x68')][_0xa3b6('0x3f')]);_0x5c9e2e['query']=_[_0xa3b6('0x44')](_0x56e886[_0xa3b6('0x43')]);_0x5c9e2e[_0xa3b6('0x45')]=_[_0xa3b6('0x55')](_0x5c9e2e['model'],_0x5c9e2e['query']);_0x220b1f[_0xa3b6('0x47')]=_[_0xa3b6('0x55')](_0x5c9e2e[_0xa3b6('0x42')],qs[_0xa3b6('0x46')](_0x56e886['query']['fields']));_0x220b1f[_0xa3b6('0x47')]=_0x220b1f[_0xa3b6('0x47')][_0xa3b6('0x48')]?_0x220b1f[_0xa3b6('0x47')]:_0x5c9e2e[_0xa3b6('0x42')];_0x220b1f['order']=qs['sort'](_0x56e886['query'][_0xa3b6('0x4b')]);_0x220b1f[_0xa3b6('0x4c')]=qs[_0xa3b6('0x45')](_[_0xa3b6('0x4d')](_0x56e886[_0xa3b6('0x43')],_0x5c9e2e[_0xa3b6('0x45')]));if(_0x56e886['query'][_0xa3b6('0x4e')]){_0x220b1f[_0xa3b6('0x4c')]=_['merge'](_0x220b1f[_0xa3b6('0x4c')],{'$or':_[_0xa3b6('0x3d')](_0x220b1f[_0xa3b6('0x47')],function(_0x3ba63b){var _0x2d833f={};_0x2d833f[_0x3ba63b]={'$like':'%'+_0x56e886[_0xa3b6('0x43')][_0xa3b6('0x4e')]+'%'};return _0x2d833f;})});}_0x220b1f=_[_0xa3b6('0x4f')]({},_0x220b1f,_0x56e886[_0xa3b6('0x57')]);return _0x15fba1[_0xa3b6('0x93')](_0x220b1f);}})[_0xa3b6('0x21')](function(_0xd48588){if(_0xd48588){_0x129315=_0xd48588[_0xa3b6('0x48')];if(!_0x56e886[_0xa3b6('0x43')][_0xa3b6('0x94')](_0xa3b6('0x49'))){_0x220b1f['limit']=qs['limit'](_0x56e886[_0xa3b6('0x43')][_0xa3b6('0x31')]);_0x220b1f[_0xa3b6('0x2f')]=qs[_0xa3b6('0x2f')](_0x56e886[_0xa3b6('0x43')][_0xa3b6('0x2f')]);}return _0x15fba1['getAgents'](_0x220b1f);}})['then'](function(_0x33fbae){if(_0x33fbae){return _0x33fbae?{'count':_0x129315,'rows':_0x33fbae}:null;}})[_0xa3b6('0x21')](respondWithResult(_0x4a63cc,null))[_0xa3b6('0x2a')](handleError(_0x4a63cc,null));}; \ No newline at end of file +var _0xa2ce=['include','findAll','rows','show','params','length','merge','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','agent','updatedAt','createdAt','format','SIP','chatPause','getTeams','ids','Team','online','voicePause','interface','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','every','TeamId','includes','all','union','value','removeAgents','addAgents','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','ChatQueues','UserProfileResource','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll'];(function(_0x138230,_0x540929){var _0x2a290e=function(_0x4b62ec){while(--_0x4b62ec){_0x138230['push'](_0x138230['shift']());}};_0x2a290e(++_0x540929);}(_0xa2ce,0xd1));var _0xea2c=function(_0x4c04c0,_0x19ee1a){_0x4c04c0=_0x4c04c0-0x0;var _0x3f7818=_0xa2ce[_0x4c04c0];return _0x3f7818;};'use strict';var emlformat=require(_0xea2c('0x0'));var rimraf=require(_0xea2c('0x1'));var zipdir=require(_0xea2c('0x2'));var jsonpatch=require(_0xea2c('0x3'));var rp=require(_0xea2c('0x4'));var moment=require(_0xea2c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea2c('0x6'));var util=require('util');var path=require(_0xea2c('0x7'));var sox=require(_0xea2c('0x8'));var csv=require(_0xea2c('0x9'));var ejs=require(_0xea2c('0xa'));var fs=require('fs');var fs_extra=require(_0xea2c('0xb'));var _=require(_0xea2c('0xc'));var squel=require(_0xea2c('0xd'));var crypto=require('crypto');var jsforce=require(_0xea2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xea2c('0x9'));var querystring=require(_0xea2c('0xf'));var Papa=require(_0xea2c('0x10'));var Redis=require('ioredis');var authService=require(_0xea2c('0x11'));var qs=require(_0xea2c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea2c('0x13'));var logger=require(_0xea2c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xea2c('0x15'));var licenseUtil=require(_0xea2c('0x16'));var db=require(_0xea2c('0x17'))['db'];config[_0xea2c('0x18')]=_[_0xea2c('0x19')](config[_0xea2c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xea2c('0x1a'))(new Redis(config[_0xea2c('0x18')]));require('./chatQueue.socket')[_0xea2c('0x1b')](socket);var jayson=require(_0xea2c('0x1c'));var client=jayson[_0xea2c('0x1d')][_0xea2c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2f2912,_0x266279,_0x1c8167,_0xb133de){return new BPromise(function(_0x1202ac,_0x35b60e){var _0x12e9eb=_0xb133de||client;return _0x12e9eb['request'](_0x2f2912,_0x1c8167)['then'](function(_0x479b40){logger[_0xea2c('0x1f')](_0xea2c('0x20'),_0x266279,_0xea2c('0x21'));logger[_0xea2c('0x22')](_0xea2c('0x23'),_0x266279,_0xea2c('0x21'),JSON[_0xea2c('0x24')](_0x479b40));if(_0x479b40['error']){if(_0x479b40[_0xea2c('0x25')][_0xea2c('0x26')]===0x1f4){logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);return _0x35b60e(_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);}logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x479b40['error']['message']);return _0x1202ac(_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);}else{logger[_0xea2c('0x1f')](_0xea2c('0x20'),_0x266279,'request\x20sent');_0x1202ac(_0x479b40[_0xea2c('0x28')][_0xea2c('0x27')]);}})[_0xea2c('0x29')](function(_0x25ad15){logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x25ad15);_0x35b60e(_0x25ad15);});});}function respondWithStatusCode(_0x437cbc,_0x53dd67){_0x53dd67=_0x53dd67||0xcc;return function(_0x3aec14){if(_0x3aec14){return _0x437cbc[_0xea2c('0x2a')](_0x53dd67);}return _0x437cbc[_0xea2c('0x2b')](_0x53dd67)[_0xea2c('0x2c')]();};}function respondWithResult(_0x18c896,_0x4162cb){_0x4162cb=_0x4162cb||0xc8;return function(_0x57424f){if(_0x57424f){return _0x18c896[_0xea2c('0x2b')](_0x4162cb)[_0xea2c('0x2d')](_0x57424f);}};}function respondWithFilteredResult(_0xf119e0,_0x56b828){return function(_0x209248){if(_0x209248){var _0x45e0a2=typeof _0x56b828[_0xea2c('0x2e')]==='undefined'&&typeof _0x56b828[_0xea2c('0x2f')]===_0xea2c('0x30');var _0x56a282=_0x209248[_0xea2c('0x31')];var _0x277aa4=_0x45e0a2?0x0:_0x56b828[_0xea2c('0x2e')];var _0x46af70=_0x45e0a2?_0x209248[_0xea2c('0x31')]:_0x56b828['offset']+_0x56b828[_0xea2c('0x2f')];var _0x160bac;if(_0x46af70>=_0x56a282){_0x46af70=_0x56a282;_0x160bac=0xc8;}else{_0x160bac=0xce;}_0xf119e0[_0xea2c('0x2b')](_0x160bac);return _0xf119e0[_0xea2c('0x32')](_0xea2c('0x33'),_0x277aa4+'-'+_0x46af70+'/'+_0x56a282)['json'](_0x209248);}return null;};}function patchUpdates(_0x2f5d29){return function(_0x27c839){try{jsonpatch[_0xea2c('0x34')](_0x27c839,_0x2f5d29,!![]);}catch(_0x4d3878){return BPromise['reject'](_0x4d3878);}return _0x27c839[_0xea2c('0x35')]();};}function saveUpdates(_0x4eeae5,_0x5db364){return function(_0x5e5cf8){if(_0x5e5cf8){return _0x5e5cf8[_0xea2c('0x36')](_0x4eeae5)['then'](function(_0x1bf33d){return _0x1bf33d;});}return null;};}function removeEntity(_0x3d88de,_0x592796){return function(_0xc562ec){if(_0xc562ec){return _0xc562ec['destroy']()[_0xea2c('0x37')](function(){var _0x4b4307=_0xc562ec[_0xea2c('0x38')]({'plain':!![]});var _0x1a591d=_0xea2c('0x39');return db[_0xea2c('0x3a')][_0xea2c('0x3b')]({'where':{'type':_0x1a591d,'resourceId':_0x4b4307['id']}})[_0xea2c('0x37')](function(){return _0xc562ec;});})[_0xea2c('0x37')](function(){_0x3d88de['status'](0xcc)[_0xea2c('0x2c')]();});}};}function handleEntityNotFound(_0x4e459e,_0x3a1025){return function(_0xc234f7){if(!_0xc234f7){_0x4e459e[_0xea2c('0x2a')](0x194);}return _0xc234f7;};}function handleError(_0x3d2f8f,_0x3d73d5){_0x3d73d5=_0x3d73d5||0x1f4;return function(_0x2888e9){logger[_0xea2c('0x25')](_0x2888e9['stack']);if(_0x2888e9[_0xea2c('0x3c')]){delete _0x2888e9[_0xea2c('0x3c')];}_0x3d2f8f[_0xea2c('0x2b')](_0x3d73d5)[_0xea2c('0x3d')](_0x2888e9);};}exports[_0xea2c('0x3e')]=function(_0x31a9a2,_0x397702){var _0x179ea0={},_0x1e8721={},_0x2b3f4b={'count':0x0,'rows':[]};var _0x2d8fbc=_[_0xea2c('0x3f')](db[_0xea2c('0x40')][_0xea2c('0x41')],function(_0x39fb85){return{'name':_0x39fb85[_0xea2c('0x42')],'type':_0x39fb85['type']['key']};});_0x1e8721['model']=_['map'](_0x2d8fbc,'name');_0x1e8721[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x31a9a2[_0xea2c('0x43')]);_0x1e8721[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x1e8721[_0xea2c('0x47')],_0x1e8721['query']);_0x179ea0[_0xea2c('0x48')]=_[_0xea2c('0x46')](_0x1e8721[_0xea2c('0x47')],qs[_0xea2c('0x49')](_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x49')]));_0x179ea0[_0xea2c('0x48')]=_0x179ea0[_0xea2c('0x48')]['length']?_0x179ea0['attributes']:_0x1e8721[_0xea2c('0x47')];if(!_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x4a')](_0xea2c('0x4b'))){_0x179ea0[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x31a9a2['query'][_0xea2c('0x2f')]);_0x179ea0['offset']=qs[_0xea2c('0x2e')](_0x31a9a2['query'][_0xea2c('0x2e')]);}_0x179ea0[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x31a9a2[_0xea2c('0x43')]['sort']);_0x179ea0['where']=qs[_0xea2c('0x45')](_[_0xea2c('0x4e')](_0x31a9a2['query'],_0x1e8721[_0xea2c('0x45')]),_0x2d8fbc);if(_0x31a9a2['query'][_0xea2c('0x4f')]){_0x179ea0[_0xea2c('0x50')]=_['merge'](_0x179ea0[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x2d8fbc,function(_0x21eef1){if(_0x21eef1[_0xea2c('0x51')]!==_0xea2c('0x52')){var _0x44dccc={};_0x44dccc[_0x21eef1[_0xea2c('0x3c')]]={'$like':'%'+_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x44dccc;}})});}_0x179ea0=_['merge']({},_0x179ea0,_0x31a9a2[_0xea2c('0x53')]);var _0x3a09c4={'where':_0x179ea0[_0xea2c('0x50')]};return db[_0xea2c('0x40')][_0xea2c('0x31')](_0x3a09c4)[_0xea2c('0x37')](function(_0x4dda2a){_0x2b3f4b[_0xea2c('0x31')]=_0x4dda2a;if(_0x31a9a2['query'][_0xea2c('0x54')]){_0x179ea0[_0xea2c('0x55')]=[{'all':!![]}];}return db[_0xea2c('0x40')][_0xea2c('0x56')](_0x179ea0);})[_0xea2c('0x37')](function(_0x12f83e){_0x2b3f4b[_0xea2c('0x57')]=_0x12f83e;return _0x2b3f4b;})[_0xea2c('0x37')](respondWithFilteredResult(_0x397702,_0x179ea0))[_0xea2c('0x29')](handleError(_0x397702,null));};exports[_0xea2c('0x58')]=function(_0x7e8e15,_0x1b5ab2){var _0x2cac1d={'raw':!![],'where':{'id':_0x7e8e15[_0xea2c('0x59')]['id']}},_0x2c4be3={};_0x2c4be3[_0xea2c('0x47')]=_[_0xea2c('0x44')](db['ChatQueue'][_0xea2c('0x41')]);_0x2c4be3['query']=_[_0xea2c('0x44')](_0x7e8e15[_0xea2c('0x43')]);_0x2c4be3[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x2c4be3['model'],_0x2c4be3['query']);_0x2cac1d['attributes']=_[_0xea2c('0x46')](_0x2c4be3[_0xea2c('0x47')],qs['fields'](_0x7e8e15[_0xea2c('0x43')][_0xea2c('0x49')]));_0x2cac1d[_0xea2c('0x48')]=_0x2cac1d[_0xea2c('0x48')][_0xea2c('0x5a')]?_0x2cac1d[_0xea2c('0x48')]:_0x2c4be3[_0xea2c('0x47')];if(_0x7e8e15[_0xea2c('0x43')]['includeAll']){_0x2cac1d['include']=[{'all':!![]}];}_0x2cac1d=_[_0xea2c('0x5b')]({},_0x2cac1d,_0x7e8e15[_0xea2c('0x53')]);return db['ChatQueue'][_0xea2c('0x5c')](_0x2cac1d)['then'](handleEntityNotFound(_0x1b5ab2,null))[_0xea2c('0x37')](respondWithResult(_0x1b5ab2,null))[_0xea2c('0x29')](handleError(_0x1b5ab2,null));};exports[_0xea2c('0x5d')]=function(_0x3d6c32,_0x1aa58c){return db[_0xea2c('0x40')][_0xea2c('0x5d')](_0x3d6c32['body'],{})[_0xea2c('0x37')](function(_0x500057){var _0x2b1a99=_0x3d6c32['user']['get']({'plain':!![]});if(!_0x2b1a99)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b1a99[_0xea2c('0x5e')]===_0xea2c('0x5f')){var _0x23dd2b=_0x500057[_0xea2c('0x38')]({'plain':!![]});var _0x1623dd=_0xea2c('0x39');return db[_0xea2c('0x60')][_0xea2c('0x5c')]({'where':{'name':_0x1623dd,'userProfileId':_0x2b1a99['userProfileId']},'raw':!![]})[_0xea2c('0x37')](function(_0x68185c){if(_0x68185c&&_0x68185c[_0xea2c('0x61')]===0x0){return db[_0xea2c('0x3a')][_0xea2c('0x5d')]({'name':_0x23dd2b[_0xea2c('0x3c')],'resourceId':_0x23dd2b['id'],'type':_0x68185c['name'],'sectionId':_0x68185c['id']},{})[_0xea2c('0x37')](function(){return _0x500057;});}else{return _0x500057;}})['catch'](function(_0x3aa5b2){logger[_0xea2c('0x25')](_0xea2c('0x62'),_0x3aa5b2);throw _0x3aa5b2;});}return _0x500057;})['then'](respondWithResult(_0x1aa58c,0xc9))[_0xea2c('0x29')](handleError(_0x1aa58c,null));};exports[_0xea2c('0x36')]=function(_0x2bd56e,_0x138bef){if(_0x2bd56e[_0xea2c('0x63')]['id']){delete _0x2bd56e[_0xea2c('0x63')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x2bd56e['params']['id']}})['then'](handleEntityNotFound(_0x138bef,null))[_0xea2c('0x37')](saveUpdates(_0x2bd56e[_0xea2c('0x63')],null))[_0xea2c('0x37')](respondWithResult(_0x138bef,null))[_0xea2c('0x29')](handleError(_0x138bef,null));};exports[_0xea2c('0x3b')]=function(_0x2eaf5f,_0x4152dc){return db[_0xea2c('0x40')]['find']({'where':{'id':_0x2eaf5f[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x4152dc,null))[_0xea2c('0x37')](removeEntity(_0x4152dc,null))[_0xea2c('0x29')](handleError(_0x4152dc,null));};exports[_0xea2c('0x64')]=function(_0x3d7cb1,_0x1edd37){return db['ChatQueue'][_0xea2c('0x64')]()[_0xea2c('0x37')](respondWithResult(_0x1edd37,null))[_0xea2c('0x29')](handleError(_0x1edd37,null));};exports[_0xea2c('0x65')]=function(_0x192f72,_0x294ebd,_0x50cbb9){var _0x20e5f1={'raw':!![],'where':{}},_0x48cc62={},_0x3acaab;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x192f72['params']['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x294ebd,null))[_0xea2c('0x37')](function(_0x510f62){if(_0x510f62){_0x3acaab=_0x510f62['get']({'plain':!![]});_0x48cc62[_0xea2c('0x47')]=_[_0xea2c('0x44')](db[_0xea2c('0x67')]['rawAttributes']);_0x48cc62[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x192f72[_0xea2c('0x43')]);_0x48cc62[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x48cc62['model'],_0x48cc62[_0xea2c('0x43')]);_0x20e5f1['attributes']=_['intersection'](_0x48cc62[_0xea2c('0x47')],qs['fields'](_0x192f72[_0xea2c('0x43')]['fields']));_0x20e5f1[_0xea2c('0x48')]=_0x20e5f1[_0xea2c('0x48')]['length']?_0x20e5f1[_0xea2c('0x48')]:_0x48cc62[_0xea2c('0x47')];if(!_0x192f72[_0xea2c('0x43')][_0xea2c('0x4a')]('nolimit')){_0x20e5f1[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x192f72[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x20e5f1['offset']=qs['offset'](_0x192f72[_0xea2c('0x43')][_0xea2c('0x2e')]);}_0x20e5f1[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x192f72['query'][_0xea2c('0x4d')]);_0x20e5f1['where']=qs['filters'](_['pick'](_0x192f72['query'],_0x48cc62['filters']));_0x20e5f1[_0xea2c('0x50')][_0xea2c('0x68')]=_0x510f62['id'];if(_0x192f72[_0xea2c('0x43')]['filter']){_0x20e5f1[_0xea2c('0x50')]=_['merge'](_0x20e5f1[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x20e5f1[_0xea2c('0x48')],function(_0x1d4c88){var _0x29cba6={};_0x29cba6[_0x1d4c88]={'$like':'%'+_0x192f72[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x29cba6;})});}_0x20e5f1=_[_0xea2c('0x5b')]({},_0x20e5f1,_0x192f72[_0xea2c('0x53')]);return db[_0xea2c('0x67')][_0xea2c('0x56')](_0x20e5f1);}})[_0xea2c('0x37')](function(_0xd1283d){if(_0xd1283d){return db[_0xea2c('0x69')]['findAndCountAll']({'where':{'id':_[_0xea2c('0x3f')](_0xd1283d,_0xea2c('0x6a')),'role':_0xea2c('0x6b')},'attributes':['id',_0xea2c('0x3c'),'chatPause',_0xea2c('0x6c'),_0xea2c('0x6d')]});}})[_0xea2c('0x37')](function(_0x7c0f91){if(_0x7c0f91){return{'count':_0x7c0f91[_0xea2c('0x31')],'rows':_[_0xea2c('0x3f')](_0x7c0f91[_0xea2c('0x57')],function(_0x2eb63f){return{'membername':_0x2eb63f[_0xea2c('0x3c')],'UserId':_0x2eb63f['id'],'queue_name':_0x3acaab[_0xea2c('0x3c')],'ChatQueueId':_0x3acaab['id'],'interface':util[_0xea2c('0x6e')]('%s/%s',_0xea2c('0x6f'),_0x2eb63f[_0xea2c('0x3c')]),'penalty':0x0,'paused':_0x2eb63f[_0xea2c('0x70')],'createdAt':_0x2eb63f['createdAt'],'updatedAt':_0x2eb63f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xea2c('0x37')](respondWithFilteredResult(_0x294ebd,_0x20e5f1))[_0xea2c('0x29')](handleError(_0x294ebd,null));};exports[_0xea2c('0x71')]=function(_0x195ff7,_0x324ea3,_0x3ca63b){var _0x4aa542={};var _0x30c181={};var _0x4c464e;var _0x5a2dc6;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x195ff7[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x324ea3,null))[_0xea2c('0x37')](function(_0x19164e){if(_0x19164e){_0x4c464e=_0x19164e;_0x30c181['model']=_[_0xea2c('0x44')](db['Team'][_0xea2c('0x41')]);_0x30c181[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x195ff7[_0xea2c('0x43')]);_0x30c181[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x30c181[_0xea2c('0x47')],_0x30c181[_0xea2c('0x43')]);_0x4aa542[_0xea2c('0x48')]=_[_0xea2c('0x46')](_0x30c181[_0xea2c('0x47')],qs[_0xea2c('0x49')](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x49')]));_0x4aa542[_0xea2c('0x48')]=_0x4aa542[_0xea2c('0x48')]['length']?_0x4aa542['attributes']:_0x30c181[_0xea2c('0x47')];_0x4aa542[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x195ff7['query'][_0xea2c('0x4d')]);_0x4aa542[_0xea2c('0x50')]=qs[_0xea2c('0x45')](_[_0xea2c('0x4e')](_0x195ff7[_0xea2c('0x43')],_0x30c181[_0xea2c('0x45')]));if(_0x195ff7[_0xea2c('0x43')][_0xea2c('0x4f')]){_0x4aa542['where']=_[_0xea2c('0x5b')](_0x4aa542[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x4aa542['attributes'],function(_0x536f06){var _0x294633={};_0x294633[_0x536f06]={'$like':'%'+_0x195ff7[_0xea2c('0x43')]['filter']+'%'};return _0x294633;})});}_0x4aa542=_[_0xea2c('0x5b')]({},_0x4aa542,_0x195ff7[_0xea2c('0x53')]);return _0x4c464e[_0xea2c('0x71')](_0x4aa542);}})[_0xea2c('0x37')](function(_0x1dd6d2){if(_0x1dd6d2){_0x5a2dc6=_0x1dd6d2['length'];if(!_0x195ff7[_0xea2c('0x43')][_0xea2c('0x4a')]('nolimit')){_0x4aa542['limit']=qs['limit'](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x4aa542[_0xea2c('0x2e')]=qs[_0xea2c('0x2e')](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x2e')]);}return _0x4c464e[_0xea2c('0x71')](_0x4aa542);}})[_0xea2c('0x37')](function(_0x19ebee){if(_0x19ebee){return _0x19ebee?{'count':_0x5a2dc6,'rows':_0x19ebee}:null;}})['then'](respondWithResult(_0x324ea3,null))[_0xea2c('0x29')](handleError(_0x324ea3,null));};exports['addTeams']=function(_0x4f7b27,_0x2d612a,_0xd96850){var _0x3a6421=_0x4f7b27[_0xea2c('0x63')][_0xea2c('0x72')];return db[_0xea2c('0x73')]['findAll']({'where':{'id':_0x3a6421},'attributes':['id'],'include':[{'model':db[_0xea2c('0x69')],'as':'Agents','attributes':['id',_0xea2c('0x3c'),_0xea2c('0x74'),_0xea2c('0x75'),_0xea2c('0x76')],'raw':!![]}]})[_0xea2c('0x37')](function(_0x39e14f){if(_0x39e14f){var _0xd5dc8c=_['flatMap'](_0x39e14f,function(_0x4fe1ec){var _0xd97616=_0x4fe1ec[_0xea2c('0x38')]({'plain':!![]});return _0xd97616['Agents'];});return db['ChatQueue'][_0xea2c('0x5c')]({'where':{'id':_0x4f7b27[_0xea2c('0x59')]['id']}})['then'](function(_0x3ee3d2){return db['sequelize'][_0xea2c('0x77')](function(_0x553bd9){return _0x3ee3d2[_0xea2c('0x78')](_0x3a6421,{'transaction':_0x553bd9})[_0xea2c('0x37')](function(){return BPromise['each'](_0xd5dc8c,function(_0x44d580){return db[_0xea2c('0x67')][_0xea2c('0x79')]({'where':{'UserId':_0x44d580['id'],'ChatQueueId':_0x4f7b27[_0xea2c('0x59')]['id']},'transaction':_0x553bd9});});})[_0xea2c('0x37')](function(){_0xd5dc8c[_0xea2c('0x7a')](function(_0x2f7f37){socket[_0xea2c('0x7b')](_0xea2c('0x7c'),{'UserId':_0x2f7f37['id'],'ChatQueueId':_0x3ee3d2['id']});});});});});}})[_0xea2c('0x37')](respondWithStatusCode(_0x2d612a,null))[_0xea2c('0x29')](handleError(_0x2d612a,null));};exports[_0xea2c('0x7d')]=function(_0x2d14b2,_0x192006,_0x2464fb){return db[_0xea2c('0x73')]['findAll']({'where':{'id':_0x2d14b2['query'][_0xea2c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xea2c('0x69')],'as':_0xea2c('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xea2c('0x37')](handleEntityNotFound(_0x192006,null))[_0xea2c('0x37')](function(_0x1bffeb){var _0xaf15b4=_['map'](_0x1bffeb,'id');var _0x596a8c=[];var _0xd81ac9=[];var _0x308157=squel[_0xea2c('0x7f')]();_0x308157[_0xea2c('0x80')]('tq.TeamId')[_0xea2c('0x81')](_0xea2c('0x82'),'tq')['join'](_0xea2c('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xea2c('0x50')](_0xea2c('0x84'),_0x2d14b2[_0xea2c('0x59')]['id']);for(var _0x25c708=0x0;_0x25c708<_0x1bffeb[_0xea2c('0x5a')];_0x25c708+=0x1){let _0x5ee0eb=_0x1bffeb[_0x25c708];for(var _0x326d1d=0x0;_0x326d1d<_0x5ee0eb[_0xea2c('0x7e')][_0xea2c('0x5a')];_0x326d1d+=0x1){let _0x3b32d0=_0x5ee0eb[_0xea2c('0x7e')][_0x326d1d];var _0x1a58c4=_0x308157[_0xea2c('0x85')]();_0x1a58c4['where'](_0xea2c('0x86'),_0x3b32d0['id']);_0xd81ac9[_0xea2c('0x87')](db[_0xea2c('0x88')]['query'](_0x1a58c4['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xea2c('0x37')](function(_0x7375dd){if(_0x7375dd['length']===0x1){return _0x3b32d0['id'];}else{var _0x4ac335=_[_0xea2c('0x89')](_['map'](_0x7375dd,_0xea2c('0x8a')),function(_0x4c584a){return _[_0xea2c('0x8b')](_0xaf15b4,_0x4c584a);});if(_0x4ac335){return _0x3b32d0['id'];}}}));}}return BPromise[_0xea2c('0x8c')](_0xd81ac9)[_0xea2c('0x37')](function(_0x1e9ac3){_0x596a8c=_(_0x596a8c)[_0xea2c('0x8d')](_0x1e9ac3)['compact']()[_0xea2c('0x8e')]();return db[_0xea2c('0x40')][_0xea2c('0x5c')]({'where':{'id':_0x2d14b2[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](function(_0x2a2b9f){return db[_0xea2c('0x88')][_0xea2c('0x77')](function(_0x182cbc){return _0x2a2b9f[_0xea2c('0x7d')](_0x2d14b2[_0xea2c('0x43')][_0xea2c('0x72')],{'transaction':_0x182cbc})[_0xea2c('0x37')](function(){if(!_['isEmpty'](_0x596a8c)){return _0x2a2b9f[_0xea2c('0x8f')](_0x596a8c,{'transaction':_0x182cbc});}})['then'](function(){_0x596a8c[_0xea2c('0x7a')](function(_0x26a141){socket['emit']('userChatQueue:remove',{'UserId':_0x26a141,'ChatQueueId':_0x2a2b9f['id']});});});});});});})[_0xea2c('0x37')](respondWithStatusCode(_0x192006,null))[_0xea2c('0x29')](handleError(_0x192006,null));};exports[_0xea2c('0x90')]=function(_0x572a59,_0x1b4e73,_0x44eb71){return db['ChatQueue'][_0xea2c('0x5c')]({'where':{'id':_0x572a59[_0xea2c('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b4e73,null))[_0xea2c('0x37')](function(_0x128a55){if(_0x128a55){return _0x128a55[_0xea2c('0x90')](_0x572a59['body'][_0xea2c('0x72')],_['omit'](_0x572a59[_0xea2c('0x63')],[_0xea2c('0x72'),'id'])||{})['spread'](function(_0x46867e){for(var _0x29a6e9=0x0;_0x29a6e9<_0x572a59[_0xea2c('0x63')]['ids'][_0xea2c('0x5a')];_0x29a6e9+=0x1){socket[_0xea2c('0x7b')]('userChatQueue:save',{'UserId':Number(_0x572a59['body'][_0xea2c('0x72')][_0x29a6e9]),'ChatQueueId':Number(_0x572a59['params']['id'])});}return _0x46867e;});}})[_0xea2c('0x37')](respondWithResult(_0x1b4e73,null))[_0xea2c('0x29')](handleError(_0x1b4e73,null));};exports[_0xea2c('0x8f')]=function(_0x5aa52f,_0x22f5ae,_0x1ba35b){return db[_0xea2c('0x40')]['find']({'where':{'id':_0x5aa52f[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x22f5ae,null))['then'](function(_0x58bb10){if(_0x58bb10){return _0x58bb10[_0xea2c('0x8f')](_0x5aa52f[_0xea2c('0x43')][_0xea2c('0x72')])[_0xea2c('0x37')](function(){if(_['isArray'](_0x5aa52f[_0xea2c('0x43')]['ids'])){for(var _0x14120c=0x0;_0x14120c<_0x5aa52f['query'][_0xea2c('0x72')][_0xea2c('0x5a')];_0x14120c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x5aa52f[_0xea2c('0x43')]['ids'][_0x14120c]),'ChatQueueId':Number(_0x5aa52f['params']['id'])});}}else{socket[_0xea2c('0x7b')](_0xea2c('0x91'),{'UserId':Number(_0x5aa52f[_0xea2c('0x43')][_0xea2c('0x72')]),'ChatQueueId':Number(_0x5aa52f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22f5ae,null))['catch'](handleError(_0x22f5ae,null));};exports[_0xea2c('0x92')]=function(_0x506184,_0x3337b2,_0x55b2fc){var _0x2f4d87={};var _0x471993={};var _0x25baad;var _0x59c50c;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x506184[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x3337b2,null))[_0xea2c('0x37')](function(_0x3e6da6){if(_0x3e6da6){_0x25baad=_0x3e6da6;_0x471993['model']=_[_0xea2c('0x44')](db[_0xea2c('0x69')][_0xea2c('0x41')]);_0x471993[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x506184['query']);_0x471993[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x471993['model'],_0x471993[_0xea2c('0x43')]);_0x2f4d87['attributes']=_[_0xea2c('0x46')](_0x471993[_0xea2c('0x47')],qs['fields'](_0x506184[_0xea2c('0x43')][_0xea2c('0x49')]));_0x2f4d87['attributes']=_0x2f4d87[_0xea2c('0x48')][_0xea2c('0x5a')]?_0x2f4d87[_0xea2c('0x48')]:_0x471993[_0xea2c('0x47')];_0x2f4d87['order']=qs[_0xea2c('0x4d')](_0x506184[_0xea2c('0x43')][_0xea2c('0x4d')]);_0x2f4d87[_0xea2c('0x50')]=qs[_0xea2c('0x45')](_['pick'](_0x506184[_0xea2c('0x43')],_0x471993[_0xea2c('0x45')]));if(_0x506184[_0xea2c('0x43')][_0xea2c('0x4f')]){_0x2f4d87[_0xea2c('0x50')]=_[_0xea2c('0x5b')](_0x2f4d87['where'],{'$or':_[_0xea2c('0x3f')](_0x2f4d87[_0xea2c('0x48')],function(_0x30975e){var _0x145598={};_0x145598[_0x30975e]={'$like':'%'+_0x506184[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x145598;})});}_0x2f4d87=_['merge']({},_0x2f4d87,_0x506184['options']);return _0x25baad[_0xea2c('0x92')](_0x2f4d87);}})[_0xea2c('0x37')](function(_0x120fea){if(_0x120fea){_0x59c50c=_0x120fea['length'];if(!_0x506184[_0xea2c('0x43')][_0xea2c('0x4a')](_0xea2c('0x4b'))){_0x2f4d87[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x506184[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x2f4d87[_0xea2c('0x2e')]=qs['offset'](_0x506184[_0xea2c('0x43')][_0xea2c('0x2e')]);}return _0x25baad[_0xea2c('0x92')](_0x2f4d87);}})['then'](function(_0x38100c){if(_0x38100c){return _0x38100c?{'count':_0x59c50c,'rows':_0x38100c}:null;}})[_0xea2c('0x37')](respondWithResult(_0x3337b2,null))[_0xea2c('0x29')](handleError(_0x3337b2,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4331e63..9c9ef94 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 _0x726c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x44cf11,_0x2b3e94){var _0x340b46=function(_0x239e00){while(--_0x239e00){_0x44cf11['push'](_0x44cf11['shift']());}};_0x340b46(++_0x2b3e94);}(_0x726c,0x145));var _0xc726=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x726c[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc726('0x0'))['db'][_0xc726('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc726('0x2')](0x0);var events={'afterCreate':_0xc726('0x3'),'afterUpdate':_0xc726('0x4'),'afterDestroy':_0xc726('0x5')};function emitEvent(_0x5861a0){return function(_0x22d12b,_0x321687,_0x57a162){ChatQueueEvents[_0xc726('0x6')](_0x5861a0+':'+_0x22d12b['id'],_0x22d12b);ChatQueueEvents[_0xc726('0x6')](_0x5861a0,_0x22d12b);_0x57a162(null);};}for(var e in events){if(events[_0xc726('0x7')](e)){var event=events[e];ChatQueue[_0xc726('0x8')](e,emitEvent(event));}}module[_0xc726('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x01ab=['events','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7eab53,_0x2b8714){var _0xe489d=function(_0x63d657){while(--_0x63d657){_0x7eab53['push'](_0x7eab53['shift']());}};_0xe489d(++_0x2b8714);}(_0x01ab,0xaa));var _0xb01a=function(_0x241c21,_0x11b64b){_0x241c21=_0x241c21-0x0;var _0x1ffb9e=_0x01ab[_0x241c21];return _0x1ffb9e;};'use strict';var EventEmitter=require(_0xb01a('0x0'));var ChatQueue=require(_0xb01a('0x1'))['db'][_0xb01a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb01a('0x3'),'afterUpdate':_0xb01a('0x4'),'afterDestroy':_0xb01a('0x5')};function emitEvent(_0x296e28){return function(_0x1b642d,_0x3974ea,_0xe75b33){ChatQueueEvents[_0xb01a('0x6')](_0x296e28+':'+_0x1b642d['id'],_0x1b642d);ChatQueueEvents[_0xb01a('0x6')](_0x296e28,_0x1b642d);_0xe75b33(null);};}for(var e in events){if(events[_0xb01a('0x7')](e)){var event=events[e];ChatQueue[_0xb01a('0x8')](e,emitEvent(event));}}module[_0xb01a('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0050f1d..c5885a3 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 _0x5e91=['exports','ChatQueue','chat_queues','util','api','moment','bluebird','../../config/environment','./chatQueue.attributes'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5e91,0x6f));var _0x15e9=function(_0x137ad9,_0x23e259){_0x137ad9=_0x137ad9-0x0;var _0x365cf9=_0x5e91[_0x137ad9];return _0x365cf9;};'use strict';var _=require('lodash');var util=require(_0x15e9('0x0'));var logger=require('../../config/logger')(_0x15e9('0x1'));var moment=require(_0x15e9('0x2'));var BPromise=require(_0x15e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15e9('0x4'));var attributes=require(_0x15e9('0x5'));module[_0x15e9('0x6')]=function(_0x354426,_0x178139){return _0x354426['define'](_0x15e9('0x7'),attributes,{'tableName':_0x15e9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c0d=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x2f3d9f,_0x376b82){var _0x2e28d0=function(_0x521731){while(--_0x521731){_0x2f3d9f['push'](_0x2f3d9f['shift']());}};_0x2e28d0(++_0x376b82);}(_0x7c0d,0x11e));var _0xd7c0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c0d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd7c0('0x0'));var util=require('util');var logger=require(_0xd7c0('0x1'))(_0xd7c0('0x2'));var moment=require(_0xd7c0('0x3'));var BPromise=require(_0xd7c0('0x4'));var rp=require(_0xd7c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7c0('0x7'));module[_0xd7c0('0x8')]=function(_0x2ffc46,_0x4f73f8){return _0x2ffc46[_0xd7c0('0x9')](_0xd7c0('0xa'),attributes,{'tableName':'chat_queues','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 2aabb28..b8a1458 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 _0xcb10=['result','ChatQueue','findAll','options','raw','where','limit','include','model','attributes','GetChatQueue','debug','ShowChatQueue','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xcb10,0x104));var _0x0cb1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcb10[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var moment=require('moment');var BPromise=require(_0x0cb1('0x2'));var rs=require(_0x0cb1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cb1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cb1('0x5'))(_0x0cb1('0x6'));var config=require(_0x0cb1('0x7'));var jayson=require(_0x0cb1('0x8'));var client=jayson[_0x0cb1('0x9')][_0x0cb1('0xa')]({'port':0x232a});config[_0x0cb1('0xb')]=_[_0x0cb1('0xc')](config['redis'],{'host':_0x0cb1('0xd'),'port':0x18eb});var socket=require(_0x0cb1('0xe'))(new Redis(config[_0x0cb1('0xb')]));require(_0x0cb1('0xf'))[_0x0cb1('0x10')](socket);function respondWithRpcPromise(_0x82508f,_0x2f05a8,_0x488a4f){return new BPromise(function(_0x4eae6f,_0x555c10){return client[_0x0cb1('0x11')](_0x82508f,_0x488a4f)[_0x0cb1('0x12')](function(_0x59c936){logger['info']('ChatQueue,\x20%s,\x20%s',_0x2f05a8,_0x0cb1('0x13'));logger['debug'](_0x0cb1('0x14'),_0x2f05a8,_0x0cb1('0x13'),JSON[_0x0cb1('0x15')](_0x59c936));if(_0x59c936[_0x0cb1('0x16')]){if(_0x59c936[_0x0cb1('0x16')][_0x0cb1('0x17')]===0x1f4){logger['error'](_0x0cb1('0x18'),_0x2f05a8,_0x59c936[_0x0cb1('0x16')]['message']);return _0x555c10(_0x59c936[_0x0cb1('0x16')]['message']);}logger[_0x0cb1('0x16')](_0x0cb1('0x18'),_0x2f05a8,_0x59c936['error'][_0x0cb1('0x19')]);return _0x4eae6f(_0x59c936[_0x0cb1('0x16')][_0x0cb1('0x19')]);}else{logger[_0x0cb1('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x2f05a8,_0x0cb1('0x13'));_0x4eae6f(_0x59c936[_0x0cb1('0x1b')][_0x0cb1('0x19')]);}})['catch'](function(_0x5a88b7){logger[_0x0cb1('0x16')](_0x0cb1('0x18'),_0x2f05a8,_0x5a88b7);_0x555c10(_0x5a88b7);});});}exports['GetChatQueue']=function(_0x33c33b){var _0x5b587b=this;return new Promise(function(_0x63e5ef,_0x5d77c2){return db[_0x0cb1('0x1c')][_0x0cb1('0x1d')]({'raw':_0x33c33b[_0x0cb1('0x1e')]?_0x33c33b['options'][_0x0cb1('0x1f')]===undefined?!![]:![]:!![],'where':_0x33c33b[_0x0cb1('0x1e')]?_0x33c33b[_0x0cb1('0x1e')][_0x0cb1('0x20')]||null:null,'attributes':_0x33c33b['options']?_0x33c33b[_0x0cb1('0x1e')]['attributes']||null:null,'limit':_0x33c33b[_0x0cb1('0x1e')]?_0x33c33b[_0x0cb1('0x1e')][_0x0cb1('0x21')]||null:null,'include':_0x33c33b[_0x0cb1('0x1e')]?_0x33c33b[_0x0cb1('0x1e')][_0x0cb1('0x22')]?_['map'](_0x33c33b[_0x0cb1('0x1e')][_0x0cb1('0x22')],function(_0x2cde9c){return{'model':db[_0x2cde9c[_0x0cb1('0x23')]],'as':_0x2cde9c['as'],'attributes':_0x2cde9c[_0x0cb1('0x24')],'include':_0x2cde9c[_0x0cb1('0x22')]?_['map'](_0x2cde9c[_0x0cb1('0x22')],function(_0x3f8dcd){return{'model':db[_0x3f8dcd[_0x0cb1('0x23')]],'as':_0x3f8dcd['as'],'attributes':_0x3f8dcd['attributes'],'include':_0x3f8dcd[_0x0cb1('0x22')]?_['map'](_0x3f8dcd[_0x0cb1('0x22')],function(_0x2fe61a){return{'model':db[_0x2fe61a[_0x0cb1('0x23')]],'as':_0x2fe61a['as'],'attributes':_0x2fe61a[_0x0cb1('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0cb1('0x12')](function(_0x4c61dd){logger[_0x0cb1('0x1a')](_0x0cb1('0x25'),_0x33c33b);logger[_0x0cb1('0x26')](_0x0cb1('0x25'),_0x33c33b,JSON['stringify'](_0x4c61dd));_0x63e5ef(_0x4c61dd);})['catch'](function(_0x3cbcc8){logger[_0x0cb1('0x16')](_0x0cb1('0x25'),_0x3cbcc8[_0x0cb1('0x19')],_0x33c33b);_0x5d77c2(_0x5b587b[_0x0cb1('0x16')](0x1f4,_0x3cbcc8[_0x0cb1('0x19')]));});});};exports[_0x0cb1('0x27')]=function(_0x369f30){var _0x36622f=this;return new Promise(function(_0x2d4f12,_0x56698e){return db[_0x0cb1('0x1c')]['find']({'raw':_0x369f30['options']?_0x369f30[_0x0cb1('0x1e')][_0x0cb1('0x1f')]===undefined?!![]:![]:!![],'where':_0x369f30[_0x0cb1('0x1e')]?_0x369f30[_0x0cb1('0x1e')][_0x0cb1('0x20')]||null:null,'attributes':_0x369f30[_0x0cb1('0x1e')]?_0x369f30['options'][_0x0cb1('0x24')]||null:null,'include':_0x369f30[_0x0cb1('0x1e')]?_0x369f30[_0x0cb1('0x1e')]['include']?_[_0x0cb1('0x28')](_0x369f30[_0x0cb1('0x1e')][_0x0cb1('0x22')],function(_0x4006c2){return{'model':db[_0x4006c2[_0x0cb1('0x23')]],'as':_0x4006c2['as'],'attributes':_0x4006c2['attributes'],'include':_0x4006c2[_0x0cb1('0x22')]?_[_0x0cb1('0x28')](_0x4006c2['include'],function(_0x4e29e8){return{'model':db[_0x4e29e8[_0x0cb1('0x23')]],'as':_0x4e29e8['as'],'attributes':_0x4e29e8[_0x0cb1('0x24')],'include':_0x4e29e8['include']?_['map'](_0x4e29e8['include'],function(_0x28e67d){return{'model':db[_0x28e67d[_0x0cb1('0x23')]],'as':_0x28e67d['as'],'attributes':_0x28e67d[_0x0cb1('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0cb1('0x12')](function(_0x2f6e45){logger[_0x0cb1('0x1a')](_0x0cb1('0x27'),_0x369f30);logger[_0x0cb1('0x26')]('ShowChatQueue',_0x369f30,JSON['stringify'](_0x2f6e45));_0x2d4f12(_0x2f6e45);})['catch'](function(_0x214d41){logger['error'](_0x0cb1('0x27'),_0x214d41[_0x0cb1('0x19')],_0x369f30);_0x56698e(_0x36622f[_0x0cb1('0x16')](0x1f4,_0x214d41[_0x0cb1('0x19')]));});});}; \ No newline at end of file +var _0x6c9c=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','attributes','map','then','ShowChatQueue','find','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x6c9c,0x12a));var _0xc6c9=function(_0xff721f,_0x2cb568){_0xff721f=_0xff721f-0x0;var _0x15ec8e=_0x6c9c[_0xff721f];return _0x15ec8e;};'use strict';var _=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var moment=require('moment');var BPromise=require(_0xc6c9('0x2'));var rs=require(_0xc6c9('0x3'));var fs=require('fs');var Redis=require(_0xc6c9('0x4'));var db=require(_0xc6c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6c9('0x6'))(_0xc6c9('0x7'));var config=require(_0xc6c9('0x8'));var jayson=require(_0xc6c9('0x9'));var client=jayson[_0xc6c9('0xa')][_0xc6c9('0xb')]({'port':0x232a});config[_0xc6c9('0xc')]=_[_0xc6c9('0xd')](config[_0xc6c9('0xc')],{'host':_0xc6c9('0xe'),'port':0x18eb});var socket=require(_0xc6c9('0xf'))(new Redis(config[_0xc6c9('0xc')]));require(_0xc6c9('0x10'))[_0xc6c9('0x11')](socket);function respondWithRpcPromise(_0x2fb627,_0x10a3d4,_0x190435){return new BPromise(function(_0x239e72,_0x577848){return client[_0xc6c9('0x12')](_0x2fb627,_0x190435)['then'](function(_0x5aac6b){logger['info'](_0xc6c9('0x13'),_0x10a3d4,_0xc6c9('0x14'));logger[_0xc6c9('0x15')](_0xc6c9('0x16'),_0x10a3d4,_0xc6c9('0x14'),JSON[_0xc6c9('0x17')](_0x5aac6b));if(_0x5aac6b['error']){if(_0x5aac6b['error'][_0xc6c9('0x18')]===0x1f4){logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);return _0x577848(_0x5aac6b[_0xc6c9('0x19')]['message']);}logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);return _0x239e72(_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);}else{logger[_0xc6c9('0x1b')](_0xc6c9('0x13'),_0x10a3d4,_0xc6c9('0x14'));_0x239e72(_0x5aac6b[_0xc6c9('0x1c')][_0xc6c9('0x1a')]);}})['catch'](function(_0x5e5dd0){logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5e5dd0);_0x577848(_0x5e5dd0);});});}exports[_0xc6c9('0x1d')]=function(_0x5153c3){var _0x49a9bd=this;return new Promise(function(_0x5617c7,_0x5f0733){return db[_0xc6c9('0x1e')][_0xc6c9('0x1f')]({'raw':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x21')]===undefined?!![]:![]:!![],'where':_0x5153c3['options']?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x22')]||null:null,'attributes':_0x5153c3['options']?_0x5153c3['options']['attributes']||null:null,'limit':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x23')]||null:null,'include':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')]['include']?_['map'](_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x24')],function(_0x3ab712){return{'model':db[_0x3ab712['model']],'as':_0x3ab712['as'],'attributes':_0x3ab712[_0xc6c9('0x25')],'include':_0x3ab712[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x3ab712['include'],function(_0x4ee416){return{'model':db[_0x4ee416['model']],'as':_0x4ee416['as'],'attributes':_0x4ee416[_0xc6c9('0x25')],'include':_0x4ee416[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x4ee416[_0xc6c9('0x24')],function(_0x460fb5){return{'model':db[_0x460fb5['model']],'as':_0x460fb5['as'],'attributes':_0x460fb5[_0xc6c9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc6c9('0x27')](function(_0x5a6848){logger[_0xc6c9('0x1b')](_0xc6c9('0x1d'),_0x5153c3);logger[_0xc6c9('0x15')](_0xc6c9('0x1d'),_0x5153c3,JSON[_0xc6c9('0x17')](_0x5a6848));_0x5617c7(_0x5a6848);})['catch'](function(_0x31e08c){logger[_0xc6c9('0x19')](_0xc6c9('0x1d'),_0x31e08c['message'],_0x5153c3);_0x5f0733(_0x49a9bd[_0xc6c9('0x19')](0x1f4,_0x31e08c[_0xc6c9('0x1a')]));});});};exports[_0xc6c9('0x28')]=function(_0x3e1ea8){var _0x465f9c=this;return new Promise(function(_0x39cb25,_0x1b6fd7){return db[_0xc6c9('0x1e')][_0xc6c9('0x29')]({'raw':_0x3e1ea8[_0xc6c9('0x20')]?_0x3e1ea8['options'][_0xc6c9('0x21')]===undefined?!![]:![]:!![],'where':_0x3e1ea8['options']?_0x3e1ea8[_0xc6c9('0x20')]['where']||null:null,'attributes':_0x3e1ea8['options']?_0x3e1ea8[_0xc6c9('0x20')][_0xc6c9('0x25')]||null:null,'include':_0x3e1ea8[_0xc6c9('0x20')]?_0x3e1ea8['options'][_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x3e1ea8[_0xc6c9('0x20')][_0xc6c9('0x24')],function(_0x34dcc1){return{'model':db[_0x34dcc1['model']],'as':_0x34dcc1['as'],'attributes':_0x34dcc1[_0xc6c9('0x25')],'include':_0x34dcc1[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x34dcc1['include'],function(_0x2e3b2c){return{'model':db[_0x2e3b2c[_0xc6c9('0x2a')]],'as':_0x2e3b2c['as'],'attributes':_0x2e3b2c[_0xc6c9('0x25')],'include':_0x2e3b2c[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x2e3b2c[_0xc6c9('0x24')],function(_0x375576){return{'model':db[_0x375576[_0xc6c9('0x2a')]],'as':_0x375576['as'],'attributes':_0x375576[_0xc6c9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc6c9('0x27')](function(_0x126785){logger['info'](_0xc6c9('0x28'),_0x3e1ea8);logger[_0xc6c9('0x15')](_0xc6c9('0x28'),_0x3e1ea8,JSON[_0xc6c9('0x17')](_0x126785));_0x39cb25(_0x126785);})[_0xc6c9('0x2b')](function(_0xfc8f67){logger[_0xc6c9('0x19')](_0xc6c9('0x28'),_0xfc8f67['message'],_0x3e1ea8);_0x1b6fd7(_0x465f9c[_0xc6c9('0x19')](0x1f4,_0xfc8f67['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 85be6a4..64e71b2 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 _0x2bc6=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x542d6b,_0x1615bd){var _0x22d616=function(_0x1db71f){while(--_0x1db71f){_0x542d6b['push'](_0x542d6b['shift']());}};_0x22d616(++_0x1615bd);}(_0x2bc6,0x163));var _0x62bc=function(_0x3a17b0,_0x32a3b6){_0x3a17b0=_0x3a17b0-0x0;var _0xda8c4=_0x2bc6[_0x3a17b0];return _0xda8c4;};'use strict';var ChatQueueEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){ChatQueueEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('chatQueue:'+_0x3ed6ad,_0x3cce26);ChatQueueEvents['on'](_0x3ed6ad,_0x3f625c);}}; \ No newline at end of file +var _0x5178=['remove','update','register','length','save'];(function(_0x40031e,_0x531329){var _0xa2664e=function(_0x2171b3){while(--_0x2171b3){_0x40031e['push'](_0x40031e['shift']());}};_0xa2664e(++_0x531329);}(_0x5178,0x171));var _0x8517=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5178[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 3869eac..4755ff5 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x70a2f8,_0x2e9893){var _0x1140ac=function(_0x3bd38f){while(--_0x3bd38f){_0x70a2f8['push'](_0x70a2f8['shift']());}};_0x1140ac(++_0x2e9893);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x46d947,_0x511391){var _0x793b7a=function(_0x5a4dae){while(--_0x5a4dae){_0x46d947['push'](_0x46d947['shift']());}};_0x793b7a(++_0x511391);}(_0xe14b,0x93));var _0xbe14=function(_0x6a513a,_0x4353ff){_0x6a513a=_0x6a513a-0x0;var _0x1ad61e=_0xe14b[_0x6a513a];return _0x1ad61e;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2a0d48b..0f078a5 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 _0x4634=['exports','STRING','DATE','moment'];(function(_0x175723,_0x163b68){var _0xf2cd28=function(_0x37bf60){while(--_0x37bf60){_0x175723['push'](_0x175723['shift']());}};_0xf2cd28(++_0x163b68);}(_0x4634,0x163));var _0x4463=function(_0x9adf4c,_0x50419c){_0x9adf4c=_0x9adf4c-0x0;var _0x1c80a2=_0x4634[_0x9adf4c];return _0x1c80a2;};'use strict';var moment=require(_0x4463('0x0'));var Sequelize=require('sequelize');module[_0x4463('0x1')]={'uniqueid':{'type':Sequelize[_0x4463('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4463('0x2')]},'joinAt':{'type':Sequelize[_0x4463('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4463('0x3')]},'exitAt':{'type':Sequelize[_0x4463('0x3')]},'reason':{'type':Sequelize[_0x4463('0x2')]}}; \ No newline at end of file +var _0x6a2f=['DATE','sequelize','exports','STRING'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x6a2f,0xc1));var _0xf6a2=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x6a2f[_0x95942];return _0x6d7f81;};'use strict';var moment=require('moment');var Sequelize=require(_0xf6a2('0x0'));module[_0xf6a2('0x1')]={'uniqueid':{'type':Sequelize[_0xf6a2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf6a2('0x2')]},'joinAt':{'type':Sequelize[_0xf6a2('0x3')]},'leaveAt':{'type':Sequelize[_0xf6a2('0x3')]},'acceptAt':{'type':Sequelize[_0xf6a2('0x3')]},'exitAt':{'type':Sequelize[_0xf6a2('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 62b181d..b9a8692 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 _0xde81=['reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply'];(function(_0x221362,_0x5db566){var _0x1983cd=function(_0x491eb2){while(--_0x491eb2){_0x221362['push'](_0x221362['shift']());}};_0x1983cd(++_0x5db566);}(_0xde81,0x109));var _0x1de8=function(_0x5d2e9d,_0xf6d965){_0x5d2e9d=_0x5d2e9d-0x0;var _0x4e0a11=_0xde81[_0x5d2e9d];return _0x4e0a11;};'use strict';var emlformat=require(_0x1de8('0x0'));var rimraf=require(_0x1de8('0x1'));var zipdir=require(_0x1de8('0x2'));var jsonpatch=require(_0x1de8('0x3'));var rp=require(_0x1de8('0x4'));var moment=require(_0x1de8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1de8('0x6'));var path=require('path');var sox=require(_0x1de8('0x7'));var csv=require(_0x1de8('0x8'));var ejs=require(_0x1de8('0x9'));var fs=require('fs');var fs_extra=require(_0x1de8('0xa'));var _=require(_0x1de8('0xb'));var squel=require(_0x1de8('0xc'));var crypto=require(_0x1de8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1de8('0x8'));var querystring=require('querystring');var Papa=require(_0x1de8('0xe'));var Redis=require(_0x1de8('0xf'));var authService=require(_0x1de8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1de8('0x11'));var hardwareService=require(_0x1de8('0x12'));var logger=require(_0x1de8('0x13'))(_0x1de8('0x14'));var utils=require(_0x1de8('0x15'));var config=require(_0x1de8('0x16'));var licenseUtil=require(_0x1de8('0x17'));var db=require(_0x1de8('0x18'))['db'];function respondWithStatusCode(_0x17096a,_0x430fcf){_0x430fcf=_0x430fcf||0xcc;return function(_0x56126e){if(_0x56126e){return _0x17096a[_0x1de8('0x19')](_0x430fcf);}return _0x17096a['status'](_0x430fcf)[_0x1de8('0x1a')]();};}function respondWithResult(_0x2cf750,_0x4d0ed6){_0x4d0ed6=_0x4d0ed6||0xc8;return function(_0x547627){if(_0x547627){return _0x2cf750[_0x1de8('0x1b')](_0x4d0ed6)[_0x1de8('0x1c')](_0x547627);}};}function respondWithFilteredResult(_0x17f089,_0x1b6ca1){return function(_0x578dbc){if(_0x578dbc){var _0x297130=typeof _0x1b6ca1[_0x1de8('0x1d')]===_0x1de8('0x1e')&&typeof _0x1b6ca1['limit']===_0x1de8('0x1e');var _0x197595=_0x578dbc['count'];var _0x322b64=_0x297130?0x0:_0x1b6ca1['offset'];var _0x4b166c=_0x297130?_0x578dbc[_0x1de8('0x1f')]:_0x1b6ca1['offset']+_0x1b6ca1[_0x1de8('0x20')];var _0x475c40;if(_0x4b166c>=_0x197595){_0x4b166c=_0x197595;_0x475c40=0xc8;}else{_0x475c40=0xce;}_0x17f089[_0x1de8('0x1b')](_0x475c40);return _0x17f089['set'](_0x1de8('0x21'),_0x322b64+'-'+_0x4b166c+'/'+_0x197595)[_0x1de8('0x1c')](_0x578dbc);}return null;};}function patchUpdates(_0xdf5e83){return function(_0x1e0dcf){try{jsonpatch[_0x1de8('0x22')](_0x1e0dcf,_0xdf5e83,!![]);}catch(_0x307426){return BPromise[_0x1de8('0x23')](_0x307426);}return _0x1e0dcf[_0x1de8('0x24')]();};}function saveUpdates(_0x4af449,_0x9d0996){return function(_0x441fcd){if(_0x441fcd){return _0x441fcd[_0x1de8('0x25')](_0x4af449)[_0x1de8('0x26')](function(_0x19f6fd){return _0x19f6fd;});}return null;};}function removeEntity(_0x240e87,_0x116942){return function(_0x4ee74f){if(_0x4ee74f){return _0x4ee74f[_0x1de8('0x27')]()['then'](function(){_0x240e87['status'](0xcc)[_0x1de8('0x1a')]();});}};}function handleEntityNotFound(_0x4600c7,_0x1a4f2f){return function(_0x1fa81a){if(!_0x1fa81a){_0x4600c7[_0x1de8('0x19')](0x194);}return _0x1fa81a;};}function handleError(_0x138dc7,_0x37cd96){_0x37cd96=_0x37cd96||0x1f4;return function(_0x49f8a6){logger[_0x1de8('0x28')](_0x49f8a6[_0x1de8('0x29')]);if(_0x49f8a6[_0x1de8('0x2a')]){delete _0x49f8a6[_0x1de8('0x2a')];}_0x138dc7[_0x1de8('0x1b')](_0x37cd96)['send'](_0x49f8a6);};}exports['index']=function(_0x9fcd44,_0x10fdf3){var _0x4229f8={},_0x2bd4b7={},_0x5aee91={'count':0x0,'rows':[]};var _0x402467=_[_0x1de8('0x2b')](db['ChatQueueReport'][_0x1de8('0x2c')],function(_0x30cb0c){return{'name':_0x30cb0c[_0x1de8('0x2d')],'type':_0x30cb0c[_0x1de8('0x2e')][_0x1de8('0x2f')]};});_0x2bd4b7[_0x1de8('0x30')]=_[_0x1de8('0x2b')](_0x402467,_0x1de8('0x2a'));_0x2bd4b7[_0x1de8('0x31')]=_[_0x1de8('0x32')](_0x9fcd44[_0x1de8('0x31')]);_0x2bd4b7[_0x1de8('0x33')]=_[_0x1de8('0x34')](_0x2bd4b7[_0x1de8('0x30')],_0x2bd4b7[_0x1de8('0x31')]);_0x4229f8['attributes']=_[_0x1de8('0x34')](_0x2bd4b7[_0x1de8('0x30')],qs[_0x1de8('0x35')](_0x9fcd44[_0x1de8('0x31')][_0x1de8('0x35')]));_0x4229f8[_0x1de8('0x36')]=_0x4229f8['attributes']['length']?_0x4229f8[_0x1de8('0x36')]:_0x2bd4b7[_0x1de8('0x30')];if(!_0x9fcd44[_0x1de8('0x31')][_0x1de8('0x37')](_0x1de8('0x38'))){_0x4229f8['limit']=qs[_0x1de8('0x20')](_0x9fcd44['query'][_0x1de8('0x20')]);_0x4229f8[_0x1de8('0x1d')]=qs[_0x1de8('0x1d')](_0x9fcd44['query']['offset']);}_0x4229f8[_0x1de8('0x39')]=qs[_0x1de8('0x3a')](_0x9fcd44[_0x1de8('0x31')]['sort']);_0x4229f8['where']=qs[_0x1de8('0x33')](_[_0x1de8('0x3b')](_0x9fcd44[_0x1de8('0x31')],_0x2bd4b7[_0x1de8('0x33')]),_0x402467);if(_0x9fcd44['query'][_0x1de8('0x3c')]){_0x4229f8[_0x1de8('0x3d')]=_[_0x1de8('0x3e')](_0x4229f8[_0x1de8('0x3d')],{'$or':_[_0x1de8('0x2b')](_0x402467,function(_0x32cf97){if(_0x32cf97[_0x1de8('0x2e')]!=='VIRTUAL'){var _0x17e7df={};_0x17e7df[_0x32cf97['name']]={'$like':'%'+_0x9fcd44['query'][_0x1de8('0x3c')]+'%'};return _0x17e7df;}})});}_0x4229f8=_[_0x1de8('0x3e')]({},_0x4229f8,_0x9fcd44[_0x1de8('0x3f')]);var _0x319034={'where':_0x4229f8['where']};return db[_0x1de8('0x40')]['count'](_0x319034)[_0x1de8('0x26')](function(_0x12cf7b){_0x5aee91[_0x1de8('0x1f')]=_0x12cf7b;if(_0x9fcd44[_0x1de8('0x31')][_0x1de8('0x41')]){_0x4229f8[_0x1de8('0x42')]=[{'all':!![]}];}return db[_0x1de8('0x40')][_0x1de8('0x43')](_0x4229f8);})['then'](function(_0x5bba82){_0x5aee91[_0x1de8('0x44')]=_0x5bba82;return _0x5aee91;})['then'](respondWithFilteredResult(_0x10fdf3,_0x4229f8))[_0x1de8('0x45')](handleError(_0x10fdf3,null));};exports['show']=function(_0x3b49eb,_0x5f4232){var _0x3adacd={'raw':!![],'where':{'id':_0x3b49eb['params']['id']}},_0x364a13={};_0x364a13['model']=_[_0x1de8('0x32')](db[_0x1de8('0x40')][_0x1de8('0x2c')]);_0x364a13[_0x1de8('0x31')]=_[_0x1de8('0x32')](_0x3b49eb[_0x1de8('0x31')]);_0x364a13[_0x1de8('0x33')]=_[_0x1de8('0x34')](_0x364a13['model'],_0x364a13[_0x1de8('0x31')]);_0x3adacd['attributes']=_[_0x1de8('0x34')](_0x364a13[_0x1de8('0x30')],qs[_0x1de8('0x35')](_0x3b49eb['query'][_0x1de8('0x35')]));_0x3adacd[_0x1de8('0x36')]=_0x3adacd[_0x1de8('0x36')]['length']?_0x3adacd['attributes']:_0x364a13[_0x1de8('0x30')];if(_0x3b49eb[_0x1de8('0x31')][_0x1de8('0x41')]){_0x3adacd[_0x1de8('0x42')]=[{'all':!![]}];}_0x3adacd=_[_0x1de8('0x3e')]({},_0x3adacd,_0x3b49eb[_0x1de8('0x3f')]);return db['ChatQueueReport']['find'](_0x3adacd)[_0x1de8('0x26')](handleEntityNotFound(_0x5f4232,null))['then'](respondWithResult(_0x5f4232,null))['catch'](handleError(_0x5f4232,null));};exports[_0x1de8('0x46')]=function(_0x14855b,_0xa4de0e){return db['ChatQueueReport'][_0x1de8('0x46')](_0x14855b[_0x1de8('0x47')],{})[_0x1de8('0x26')](respondWithResult(_0xa4de0e,0xc9))['catch'](handleError(_0xa4de0e,null));};exports[_0x1de8('0x25')]=function(_0x3ce31e,_0x5e5357){if(_0x3ce31e['body']['id']){delete _0x3ce31e[_0x1de8('0x47')]['id'];}return db['ChatQueueReport'][_0x1de8('0x48')]({'where':{'id':_0x3ce31e['params']['id']}})[_0x1de8('0x26')](handleEntityNotFound(_0x5e5357,null))['then'](saveUpdates(_0x3ce31e['body'],null))['then'](respondWithResult(_0x5e5357,null))['catch'](handleError(_0x5e5357,null));};exports[_0x1de8('0x27')]=function(_0x3840b7,_0x299d74){return db['ChatQueueReport'][_0x1de8('0x48')]({'where':{'id':_0x3840b7[_0x1de8('0x49')]['id']}})[_0x1de8('0x26')](handleEntityNotFound(_0x299d74,null))[_0x1de8('0x26')](removeEntity(_0x299d74,null))[_0x1de8('0x45')](handleError(_0x299d74,null));};exports[_0x1de8('0x4a')]=function(_0x13ba26,_0x482cb2){return db[_0x1de8('0x40')][_0x1de8('0x4a')]()[_0x1de8('0x26')](respondWithResult(_0x482cb2,null))[_0x1de8('0x45')](handleError(_0x482cb2,null));}; \ No newline at end of file +var _0x7412=['moment','ejs','fs-extra','lodash','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','json','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','fields','find','create','body','describe','eml-format','fast-json-patch'];(function(_0x3c4d52,_0x22a489){var _0x435bd3=function(_0x5f03bc){while(--_0x5f03bc){_0x3c4d52['push'](_0x3c4d52['shift']());}};_0x435bd3(++_0x22a489);}(_0x7412,0x161));var _0x2741=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x7412[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x2741('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2741('0x1'));var rp=require('request-promise');var moment=require(_0x2741('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2741('0x3'));var fs=require('fs');var fs_extra=require(_0x2741('0x4'));var _=require(_0x2741('0x5'));var squel=require('squel');var crypto=require(_0x2741('0x6'));var jsforce=require(_0x2741('0x7'));var deskjs=require(_0x2741('0x8'));var toCsv=require(_0x2741('0x9'));var querystring=require('querystring');var Papa=require(_0x2741('0xa'));var Redis=require(_0x2741('0xb'));var authService=require(_0x2741('0xc'));var qs=require(_0x2741('0xd'));var as=require(_0x2741('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2741('0xf'))(_0x2741('0x10'));var utils=require(_0x2741('0x11'));var config=require(_0x2741('0x12'));var licenseUtil=require(_0x2741('0x13'));var db=require(_0x2741('0x14'))['db'];function respondWithStatusCode(_0x1f70d6,_0x431309){_0x431309=_0x431309||0xcc;return function(_0x5115e9){if(_0x5115e9){return _0x1f70d6[_0x2741('0x15')](_0x431309);}return _0x1f70d6[_0x2741('0x16')](_0x431309)[_0x2741('0x17')]();};}function respondWithResult(_0x4347d5,_0x494073){_0x494073=_0x494073||0xc8;return function(_0xc535ee){if(_0xc535ee){return _0x4347d5[_0x2741('0x16')](_0x494073)[_0x2741('0x18')](_0xc535ee);}};}function respondWithFilteredResult(_0x39bcb6,_0x56a04c){return function(_0x1f7ef5){if(_0x1f7ef5){var _0x27eacd=typeof _0x56a04c['offset']===_0x2741('0x19')&&typeof _0x56a04c[_0x2741('0x1a')]==='undefined';var _0x482f99=_0x1f7ef5[_0x2741('0x1b')];var _0x8fb51f=_0x27eacd?0x0:_0x56a04c[_0x2741('0x1c')];var _0x27feb7=_0x27eacd?_0x1f7ef5[_0x2741('0x1b')]:_0x56a04c[_0x2741('0x1c')]+_0x56a04c[_0x2741('0x1a')];var _0x22d0d7;if(_0x27feb7>=_0x482f99){_0x27feb7=_0x482f99;_0x22d0d7=0xc8;}else{_0x22d0d7=0xce;}_0x39bcb6['status'](_0x22d0d7);return _0x39bcb6[_0x2741('0x1d')]('Content-Range',_0x8fb51f+'-'+_0x27feb7+'/'+_0x482f99)[_0x2741('0x18')](_0x1f7ef5);}return null;};}function patchUpdates(_0x592e7c){return function(_0x556142){try{jsonpatch[_0x2741('0x1e')](_0x556142,_0x592e7c,!![]);}catch(_0x826ce1){return BPromise[_0x2741('0x1f')](_0x826ce1);}return _0x556142['save']();};}function saveUpdates(_0x2bab85,_0xf6861e){return function(_0x462c1e){if(_0x462c1e){return _0x462c1e[_0x2741('0x20')](_0x2bab85)['then'](function(_0x398aeb){return _0x398aeb;});}return null;};}function removeEntity(_0x1dd0ef,_0x5e54fb){return function(_0x5c0054){if(_0x5c0054){return _0x5c0054[_0x2741('0x21')]()['then'](function(){_0x1dd0ef['status'](0xcc)[_0x2741('0x17')]();});}};}function handleEntityNotFound(_0x4d09c9,_0x52f2ab){return function(_0x23cb80){if(!_0x23cb80){_0x4d09c9[_0x2741('0x15')](0x194);}return _0x23cb80;};}function handleError(_0x1e95d8,_0x40bfd5){_0x40bfd5=_0x40bfd5||0x1f4;return function(_0x53aab8){logger[_0x2741('0x22')](_0x53aab8[_0x2741('0x23')]);if(_0x53aab8['name']){delete _0x53aab8[_0x2741('0x24')];}_0x1e95d8[_0x2741('0x16')](_0x40bfd5)['send'](_0x53aab8);};}exports[_0x2741('0x25')]=function(_0x5398bf,_0x1ed9ac){var _0x57b16d={},_0x1440e5={},_0x53ad58={'count':0x0,'rows':[]};var _0x358d06=_[_0x2741('0x26')](db[_0x2741('0x27')][_0x2741('0x28')],function(_0xe1239f){return{'name':_0xe1239f[_0x2741('0x29')],'type':_0xe1239f[_0x2741('0x2a')][_0x2741('0x2b')]};});_0x1440e5[_0x2741('0x2c')]=_[_0x2741('0x26')](_0x358d06,_0x2741('0x24'));_0x1440e5['query']=_[_0x2741('0x2d')](_0x5398bf[_0x2741('0x2e')]);_0x1440e5[_0x2741('0x2f')]=_[_0x2741('0x30')](_0x1440e5[_0x2741('0x2c')],_0x1440e5[_0x2741('0x2e')]);_0x57b16d['attributes']=_[_0x2741('0x30')](_0x1440e5['model'],qs['fields'](_0x5398bf[_0x2741('0x2e')]['fields']));_0x57b16d[_0x2741('0x31')]=_0x57b16d[_0x2741('0x31')][_0x2741('0x32')]?_0x57b16d['attributes']:_0x1440e5[_0x2741('0x2c')];if(!_0x5398bf['query'][_0x2741('0x33')](_0x2741('0x34'))){_0x57b16d[_0x2741('0x1a')]=qs['limit'](_0x5398bf['query'][_0x2741('0x1a')]);_0x57b16d[_0x2741('0x1c')]=qs[_0x2741('0x1c')](_0x5398bf[_0x2741('0x2e')][_0x2741('0x1c')]);}_0x57b16d['order']=qs[_0x2741('0x35')](_0x5398bf['query'][_0x2741('0x35')]);_0x57b16d[_0x2741('0x36')]=qs[_0x2741('0x2f')](_[_0x2741('0x37')](_0x5398bf['query'],_0x1440e5[_0x2741('0x2f')]),_0x358d06);if(_0x5398bf[_0x2741('0x2e')][_0x2741('0x38')]){_0x57b16d[_0x2741('0x36')]=_[_0x2741('0x39')](_0x57b16d['where'],{'$or':_[_0x2741('0x26')](_0x358d06,function(_0x1b1d5a){if(_0x1b1d5a[_0x2741('0x2a')]!==_0x2741('0x3a')){var _0x57b3e0={};_0x57b3e0[_0x1b1d5a[_0x2741('0x24')]]={'$like':'%'+_0x5398bf[_0x2741('0x2e')][_0x2741('0x38')]+'%'};return _0x57b3e0;}})});}_0x57b16d=_[_0x2741('0x39')]({},_0x57b16d,_0x5398bf[_0x2741('0x3b')]);var _0x5a5734={'where':_0x57b16d['where']};return db['ChatQueueReport']['count'](_0x5a5734)[_0x2741('0x3c')](function(_0x3781f3){_0x53ad58[_0x2741('0x1b')]=_0x3781f3;if(_0x5398bf[_0x2741('0x2e')][_0x2741('0x3d')]){_0x57b16d[_0x2741('0x3e')]=[{'all':!![]}];}return db[_0x2741('0x27')]['findAll'](_0x57b16d);})[_0x2741('0x3c')](function(_0x3f7301){_0x53ad58['rows']=_0x3f7301;return _0x53ad58;})[_0x2741('0x3c')](respondWithFilteredResult(_0x1ed9ac,_0x57b16d))[_0x2741('0x3f')](handleError(_0x1ed9ac,null));};exports[_0x2741('0x40')]=function(_0x106b26,_0x1ac4c2){var _0x4dc9fa={'raw':!![],'where':{'id':_0x106b26[_0x2741('0x41')]['id']}},_0x35c218={};_0x35c218['model']=_[_0x2741('0x2d')](db[_0x2741('0x27')]['rawAttributes']);_0x35c218[_0x2741('0x2e')]=_['keys'](_0x106b26[_0x2741('0x2e')]);_0x35c218['filters']=_[_0x2741('0x30')](_0x35c218['model'],_0x35c218[_0x2741('0x2e')]);_0x4dc9fa[_0x2741('0x31')]=_[_0x2741('0x30')](_0x35c218[_0x2741('0x2c')],qs[_0x2741('0x42')](_0x106b26[_0x2741('0x2e')][_0x2741('0x42')]));_0x4dc9fa['attributes']=_0x4dc9fa[_0x2741('0x31')][_0x2741('0x32')]?_0x4dc9fa[_0x2741('0x31')]:_0x35c218[_0x2741('0x2c')];if(_0x106b26[_0x2741('0x2e')][_0x2741('0x3d')]){_0x4dc9fa[_0x2741('0x3e')]=[{'all':!![]}];}_0x4dc9fa=_[_0x2741('0x39')]({},_0x4dc9fa,_0x106b26[_0x2741('0x3b')]);return db[_0x2741('0x27')][_0x2741('0x43')](_0x4dc9fa)[_0x2741('0x3c')](handleEntityNotFound(_0x1ac4c2,null))[_0x2741('0x3c')](respondWithResult(_0x1ac4c2,null))['catch'](handleError(_0x1ac4c2,null));};exports[_0x2741('0x44')]=function(_0x514842,_0x2f653b){return db[_0x2741('0x27')]['create'](_0x514842[_0x2741('0x45')],{})[_0x2741('0x3c')](respondWithResult(_0x2f653b,0xc9))[_0x2741('0x3f')](handleError(_0x2f653b,null));};exports['update']=function(_0x1eed59,_0x3342e5){if(_0x1eed59[_0x2741('0x45')]['id']){delete _0x1eed59['body']['id'];}return db['ChatQueueReport'][_0x2741('0x43')]({'where':{'id':_0x1eed59[_0x2741('0x41')]['id']}})['then'](handleEntityNotFound(_0x3342e5,null))[_0x2741('0x3c')](saveUpdates(_0x1eed59['body'],null))[_0x2741('0x3c')](respondWithResult(_0x3342e5,null))[_0x2741('0x3f')](handleError(_0x3342e5,null));};exports[_0x2741('0x21')]=function(_0x38a43f,_0x35ba3a){return db[_0x2741('0x27')][_0x2741('0x43')]({'where':{'id':_0x38a43f[_0x2741('0x41')]['id']}})[_0x2741('0x3c')](handleEntityNotFound(_0x35ba3a,null))[_0x2741('0x3c')](removeEntity(_0x35ba3a,null))[_0x2741('0x3f')](handleError(_0x35ba3a,null));};exports[_0x2741('0x46')]=function(_0x453cdc,_0x54e165){return db[_0x2741('0x27')][_0x2741('0x46')]()[_0x2741('0x3c')](respondWithResult(_0x54e165,null))[_0x2741('0x3f')](handleError(_0x54e165,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 972c27b..4acfb52 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1534db,_0x788313){var _0x46d9d9=function(_0x410b8f){while(--_0x410b8f){_0x1534db['push'](_0x1534db['shift']());}};_0x46d9d9(++_0x788313);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0xcb91[_0x4c7d8b];return _0x187158;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'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(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_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 6462cb5..f628367 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 _0xa45c=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','limit','lodash','util','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x4e9641,_0x1faeca){var _0x4822ab=function(_0x50ad27){while(--_0x50ad27){_0x4e9641['push'](_0x4e9641['shift']());}};_0x4822ab(++_0x1faeca);}(_0xa45c,0x6d));var _0xca45=function(_0x105266,_0x3e1790){_0x105266=_0x105266-0x0;var _0x124d36=_0xa45c[_0x105266];return _0x124d36;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca45('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca45('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca45('0x5'));var client=jayson[_0xca45('0x6')][_0xca45('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15628b,_0x578a7b,_0x1a8b9c){return new BPromise(function(_0x276897,_0x7ceab1){return client[_0xca45('0x8')](_0x15628b,_0x1a8b9c)[_0xca45('0x9')](function(_0x5c18b9){logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));logger[_0xca45('0xd')](_0xca45('0xe'),_0x578a7b,_0xca45('0xc'),JSON[_0xca45('0xf')](_0x5c18b9));if(_0x5c18b9['error']){if(_0x5c18b9[_0xca45('0x10')][_0xca45('0x11')]===0x1f4){logger[_0xca45('0x10')](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x7ceab1(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}logger['error'](_0xca45('0xb'),_0x578a7b,_0x5c18b9['error'][_0xca45('0x12')]);return _0x276897(_0x5c18b9[_0xca45('0x10')][_0xca45('0x12')]);}else{logger[_0xca45('0xa')](_0xca45('0xb'),_0x578a7b,_0xca45('0xc'));_0x276897(_0x5c18b9[_0xca45('0x13')]['message']);}})[_0xca45('0x14')](function(_0x5b4e29){logger['error'](_0xca45('0xb'),_0x578a7b,_0x5b4e29);_0x7ceab1(_0x5b4e29);});});}exports[_0xca45('0x15')]=function(_0x553af4){var _0x2e18aa=this;return new Promise(function(_0x184bbf,_0x5820c8){return db[_0xca45('0x16')][_0xca45('0x17')](_0x553af4[_0xca45('0x18')],{'raw':_0x553af4[_0xca45('0x19')]?_0x553af4['options'][_0xca45('0x1a')]===undefined?!![]:![]:!![]})[_0xca45('0x9')](function(_0x1a16f1){logger[_0xca45('0xa')]('CreateChatQueueReport',_0x553af4);logger[_0xca45('0xd')](_0xca45('0x15'),_0x553af4,JSON[_0xca45('0xf')](_0x1a16f1));_0x184bbf(_0x1a16f1);})[_0xca45('0x14')](function(_0x2068df){logger[_0xca45('0x10')](_0xca45('0x15'),_0x2068df[_0xca45('0x12')],_0x553af4);_0x5820c8(_0x2e18aa[_0xca45('0x10')](0x1f4,_0x2068df['message']));});});};exports[_0xca45('0x1b')]=function(_0x1acb89){var _0x2cac3d=this;return new Promise(function(_0x295403,_0x242cb1){return db['ChatQueueReport']['update'](_0x1acb89['body'],{'raw':_0x1acb89[_0xca45('0x19')]?_0x1acb89['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acb89[_0xca45('0x19')]?_0x1acb89[_0xca45('0x19')][_0xca45('0x1c')]||null:null,'attributes':_0x1acb89[_0xca45('0x19')]?_0x1acb89[_0xca45('0x19')]['attributes']||null:null,'limit':_0x1acb89[_0xca45('0x19')]?_0x1acb89[_0xca45('0x19')][_0xca45('0x1d')]||null:null})['then'](function(_0x4da9b6){logger['info'](_0xca45('0x1b'),_0x1acb89);logger[_0xca45('0xd')]('UpdateChatQueueReport',_0x1acb89,JSON[_0xca45('0xf')](_0x4da9b6));_0x295403(_0x4da9b6);})[_0xca45('0x14')](function(_0x177ad9){logger[_0xca45('0x10')]('UpdateChatQueueReport',_0x177ad9['message'],_0x1acb89);_0x242cb1(_0x2cac3d['error'](0x1f4,_0x177ad9[_0xca45('0x12')]));});});}; \ No newline at end of file +var _0x5baf=['../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','debug','where','limit','UpdateChatQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x5baf,0xae));var _0xf5ba=function(_0x3806cd,_0x52ca5d){_0x3806cd=_0x3806cd-0x0;var _0x4d61fd=_0x5baf[_0x3806cd];return _0x4d61fd;};'use strict';var _=require(_0xf5ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf5ba('0x1'));var rs=require(_0xf5ba('0x2'));var fs=require('fs');var Redis=require(_0xf5ba('0x3'));var db=require(_0xf5ba('0x4'))['db'];var utils=require(_0xf5ba('0x5'));var logger=require(_0xf5ba('0x6'))('rpc');var config=require(_0xf5ba('0x7'));var jayson=require(_0xf5ba('0x8'));var client=jayson[_0xf5ba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a4db8,_0x45e669,_0x5deae9){return new BPromise(function(_0x21f0c6,_0x1eac81){return client[_0xf5ba('0xa')](_0x1a4db8,_0x5deae9)['then'](function(_0x29602c){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x45e669,_0xf5ba('0xb'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x45e669,_0xf5ba('0xb'),JSON[_0xf5ba('0xc')](_0x29602c));if(_0x29602c[_0xf5ba('0xd')]){if(_0x29602c['error'][_0xf5ba('0xe')]===0x1f4){logger[_0xf5ba('0xd')](_0xf5ba('0xf'),_0x45e669,_0x29602c['error'][_0xf5ba('0x10')]);return _0x1eac81(_0x29602c[_0xf5ba('0xd')][_0xf5ba('0x10')]);}logger[_0xf5ba('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x45e669,_0x29602c[_0xf5ba('0xd')]['message']);return _0x21f0c6(_0x29602c[_0xf5ba('0xd')][_0xf5ba('0x10')]);}else{logger[_0xf5ba('0x11')](_0xf5ba('0xf'),_0x45e669,_0xf5ba('0xb'));_0x21f0c6(_0x29602c[_0xf5ba('0x12')][_0xf5ba('0x10')]);}})[_0xf5ba('0x13')](function(_0x5ca464){logger[_0xf5ba('0xd')](_0xf5ba('0xf'),_0x45e669,_0x5ca464);_0x1eac81(_0x5ca464);});});}exports[_0xf5ba('0x14')]=function(_0x20d0be){var _0x431e80=this;return new Promise(function(_0x4d74c5,_0x3c6437){return db[_0xf5ba('0x15')]['create'](_0x20d0be[_0xf5ba('0x16')],{'raw':_0x20d0be['options']?_0x20d0be[_0xf5ba('0x17')][_0xf5ba('0x18')]===undefined?!![]:![]:!![]})[_0xf5ba('0x19')](function(_0x2d752d){logger['info'](_0xf5ba('0x14'),_0x20d0be);logger[_0xf5ba('0x1a')](_0xf5ba('0x14'),_0x20d0be,JSON[_0xf5ba('0xc')](_0x2d752d));_0x4d74c5(_0x2d752d);})['catch'](function(_0x62a088){logger[_0xf5ba('0xd')](_0xf5ba('0x14'),_0x62a088[_0xf5ba('0x10')],_0x20d0be);_0x3c6437(_0x431e80['error'](0x1f4,_0x62a088[_0xf5ba('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x346f4b){var _0x5b146e=this;return new Promise(function(_0x4da369,_0x3ceb0f){return db[_0xf5ba('0x15')]['update'](_0x346f4b[_0xf5ba('0x16')],{'raw':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b[_0xf5ba('0x17')][_0xf5ba('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b[_0xf5ba('0x17')][_0xf5ba('0x1b')]||null:null,'attributes':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b['options']['attributes']||null:null,'limit':_0x346f4b['options']?_0x346f4b['options'][_0xf5ba('0x1c')]||null:null})[_0xf5ba('0x19')](function(_0x2af807){logger[_0xf5ba('0x11')]('UpdateChatQueueReport',_0x346f4b);logger[_0xf5ba('0x1a')](_0xf5ba('0x1d'),_0x346f4b,JSON[_0xf5ba('0xc')](_0x2af807));_0x4da369(_0x2af807);})[_0xf5ba('0x13')](function(_0x56e02e){logger[_0xf5ba('0xd')]('UpdateChatQueueReport',_0x56e02e[_0xf5ba('0x10')],_0x346f4b);_0x3ceb0f(_0x5b146e['error'](0x1f4,_0x56e02e[_0xf5ba('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 345b515..8d5bdfe 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 _0x4d54=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','get','/describe','/:id','post','create','put'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x4d54,0x1a1));var _0x44d5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4d54[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x44d5('0x0'));var util=require('util');var path=require(_0x44d5('0x1'));var timeout=require(_0x44d5('0x2'));var express=require('express');var router=express[_0x44d5('0x3')]();var fs_extra=require(_0x44d5('0x4'));var auth=require(_0x44d5('0x5'));var interaction=require(_0x44d5('0x6'));var config=require('../../config/environment');var controller=require(_0x44d5('0x7'));router['get']('/',auth[_0x44d5('0x8')](),controller['index']);router[_0x44d5('0x9')](_0x44d5('0xa'),auth[_0x44d5('0x8')](),controller['describe']);router[_0x44d5('0x9')](_0x44d5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x44d5('0xc')]('/',auth[_0x44d5('0x8')](),controller[_0x44d5('0xd')]);router[_0x44d5('0xe')](_0x44d5('0xb'),auth[_0x44d5('0x8')](),controller['update']);router[_0x44d5('0xf')](_0x44d5('0xb'),auth['isAuthenticated'](),controller[_0x44d5('0x10')]);module[_0x44d5('0x11')]=router; \ No newline at end of file +var _0x30ad=['/:id','post','create','put','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x46808b,_0x1398c0){var _0x4f04fa=function(_0x295ffe){while(--_0x295ffe){_0x46808b['push'](_0x46808b['shift']());}};_0x4f04fa(++_0x1398c0);}(_0x30ad,0x131));var _0xd30a=function(_0x579d89,_0x5656b2){_0x579d89=_0x579d89-0x0;var _0x4e4522=_0x30ad[_0x579d89];return _0x4e4522;};'use strict';var multer=require(_0xd30a('0x0'));var util=require(_0xd30a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd30a('0x2'));var auth=require(_0xd30a('0x3'));var interaction=require(_0xd30a('0x4'));var config=require(_0xd30a('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xd30a('0x6')](),controller['index']);router[_0xd30a('0x7')](_0xd30a('0x8'),auth['isAuthenticated'](),controller[_0xd30a('0x9')]);router[_0xd30a('0x7')](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['show']);router[_0xd30a('0xb')]('/',auth[_0xd30a('0x6')](),controller[_0xd30a('0xc')]);router[_0xd30a('0xd')](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['update']);router['delete'](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['destroy']);module[_0xd30a('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 09c275c..fbb1217 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x16e3e0,_0x4bdfd7){var _0x2c5f21=function(_0x1d4960){while(--_0x1d4960){_0x16e3e0['push'](_0x16e3e0['shift']());}};_0x2c5f21(++_0x4bdfd7);}(_0x70e0,0x17b));var _0x070e=function(_0xffa714,_0x7e9428){_0xffa714=_0xffa714-0x0;var _0x4c8676=_0x70e0[_0xffa714];return _0x4c8676;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x9bde,0xe1));var _0xe9bd=function(_0x107c0f,_0x2ab67c){_0x107c0f=_0x107c0f-0x0;var _0x1f236a=_0x9bde[_0x107c0f];return _0x1f236a;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 73bc95f..d32f2df 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 _0x7130=['status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3bf166,_0x194fa5){var _0x5f4ea9=function(_0x2b3b0e){while(--_0x2b3b0e){_0x3bf166['push'](_0x3bf166['shift']());}};_0x5f4ea9(++_0x194fa5);}(_0x7130,0x1a7));var _0x0713=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x7130[_0x44946b];return _0x249bc4;};'use strict';var emlformat=require(_0x0713('0x0'));var rimraf=require(_0x0713('0x1'));var zipdir=require(_0x0713('0x2'));var jsonpatch=require(_0x0713('0x3'));var rp=require('request-promise');var moment=require(_0x0713('0x4'));var BPromise=require(_0x0713('0x5'));var Mustache=require(_0x0713('0x6'));var util=require(_0x0713('0x7'));var path=require(_0x0713('0x8'));var sox=require(_0x0713('0x9'));var csv=require(_0x0713('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0713('0xb'));var _=require(_0x0713('0xc'));var squel=require(_0x0713('0xd'));var crypto=require(_0x0713('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0713('0xf'));var toCsv=require(_0x0713('0xa'));var querystring=require(_0x0713('0x10'));var Papa=require('papaparse');var Redis=require(_0x0713('0x11'));var authService=require(_0x0713('0x12'));var qs=require(_0x0713('0x13'));var as=require(_0x0713('0x14'));var hardwareService=require(_0x0713('0x15'));var logger=require('../../config/logger')(_0x0713('0x16'));var utils=require(_0x0713('0x17'));var config=require(_0x0713('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0713('0x19'))['db'];function respondWithStatusCode(_0x15d013,_0x8583dc){_0x8583dc=_0x8583dc||0xcc;return function(_0x542629){if(_0x542629){return _0x15d013[_0x0713('0x1a')](_0x8583dc);}return _0x15d013[_0x0713('0x1b')](_0x8583dc)[_0x0713('0x1c')]();};}function respondWithResult(_0x5cb7ea,_0x2cd715){_0x2cd715=_0x2cd715||0xc8;return function(_0x290475){if(_0x290475){return _0x5cb7ea[_0x0713('0x1b')](_0x2cd715)[_0x0713('0x1d')](_0x290475);}};}function respondWithFilteredResult(_0x2832ea,_0x292550){return function(_0x54d823){if(_0x54d823){var _0x163564=typeof _0x292550['offset']==='undefined'&&typeof _0x292550['limit']===_0x0713('0x1e');var _0x335c94=_0x54d823[_0x0713('0x1f')];var _0x43f053=_0x163564?0x0:_0x292550[_0x0713('0x20')];var _0x51d771=_0x163564?_0x54d823[_0x0713('0x1f')]:_0x292550[_0x0713('0x20')]+_0x292550[_0x0713('0x21')];var _0x3b18b2;if(_0x51d771>=_0x335c94){_0x51d771=_0x335c94;_0x3b18b2=0xc8;}else{_0x3b18b2=0xce;}_0x2832ea[_0x0713('0x1b')](_0x3b18b2);return _0x2832ea[_0x0713('0x22')](_0x0713('0x23'),_0x43f053+'-'+_0x51d771+'/'+_0x335c94)[_0x0713('0x1d')](_0x54d823);}return null;};}function patchUpdates(_0x50e1ec){return function(_0x140894){try{jsonpatch[_0x0713('0x24')](_0x140894,_0x50e1ec,!![]);}catch(_0x23cbf9){return BPromise[_0x0713('0x25')](_0x23cbf9);}return _0x140894[_0x0713('0x26')]();};}function saveUpdates(_0x41f14b,_0xe53e28){return function(_0x14d25a){if(_0x14d25a){return _0x14d25a[_0x0713('0x27')](_0x41f14b)[_0x0713('0x28')](function(_0x3374c8){return _0x3374c8;});}return null;};}function removeEntity(_0x494649,_0x1b2d89){return function(_0x4fedba){if(_0x4fedba){return _0x4fedba[_0x0713('0x29')]()['then'](function(){_0x494649['status'](0xcc)[_0x0713('0x1c')]();});}};}function handleEntityNotFound(_0x6b8efd,_0x4854b7){return function(_0x38a51e){if(!_0x38a51e){_0x6b8efd[_0x0713('0x1a')](0x194);}return _0x38a51e;};}function handleError(_0x119e9c,_0x1f4679){_0x1f4679=_0x1f4679||0x1f4;return function(_0x36a5dc){logger[_0x0713('0x2a')](_0x36a5dc[_0x0713('0x2b')]);if(_0x36a5dc[_0x0713('0x2c')]){delete _0x36a5dc[_0x0713('0x2c')];}_0x119e9c[_0x0713('0x1b')](_0x1f4679)[_0x0713('0x2d')](_0x36a5dc);};}exports[_0x0713('0x2e')]=function(_0x474bab,_0x293393){var _0x35fd60={},_0x3d1108={},_0x324111={'count':0x0,'rows':[]};var _0x48bb8a=_[_0x0713('0x2f')](db[_0x0713('0x30')]['rawAttributes'],function(_0x11d9e6){return{'name':_0x11d9e6['fieldName'],'type':_0x11d9e6['type'][_0x0713('0x31')]};});_0x3d1108['model']=_[_0x0713('0x2f')](_0x48bb8a,_0x0713('0x2c'));_0x3d1108[_0x0713('0x32')]=_[_0x0713('0x33')](_0x474bab[_0x0713('0x32')]);_0x3d1108[_0x0713('0x34')]=_[_0x0713('0x35')](_0x3d1108[_0x0713('0x36')],_0x3d1108[_0x0713('0x32')]);_0x35fd60[_0x0713('0x37')]=_[_0x0713('0x35')](_0x3d1108['model'],qs[_0x0713('0x38')](_0x474bab[_0x0713('0x32')][_0x0713('0x38')]));_0x35fd60['attributes']=_0x35fd60[_0x0713('0x37')][_0x0713('0x39')]?_0x35fd60[_0x0713('0x37')]:_0x3d1108[_0x0713('0x36')];if(!_0x474bab[_0x0713('0x32')][_0x0713('0x3a')]('nolimit')){_0x35fd60[_0x0713('0x21')]=qs['limit'](_0x474bab[_0x0713('0x32')]['limit']);_0x35fd60[_0x0713('0x20')]=qs['offset'](_0x474bab[_0x0713('0x32')]['offset']);}_0x35fd60['order']=qs['sort'](_0x474bab[_0x0713('0x32')][_0x0713('0x3b')]);_0x35fd60[_0x0713('0x3c')]=qs[_0x0713('0x34')](_[_0x0713('0x3d')](_0x474bab[_0x0713('0x32')],_0x3d1108[_0x0713('0x34')]),_0x48bb8a);if(_0x474bab[_0x0713('0x32')]['filter']){_0x35fd60[_0x0713('0x3c')]=_[_0x0713('0x3e')](_0x35fd60[_0x0713('0x3c')],{'$or':_['map'](_0x48bb8a,function(_0x25aa89){if(_0x25aa89[_0x0713('0x3f')]!==_0x0713('0x40')){var _0x48be2b={};_0x48be2b[_0x25aa89[_0x0713('0x2c')]]={'$like':'%'+_0x474bab[_0x0713('0x32')][_0x0713('0x41')]+'%'};return _0x48be2b;}})});}_0x35fd60=_[_0x0713('0x3e')]({},_0x35fd60,_0x474bab[_0x0713('0x42')]);var _0x3bf029={'where':_0x35fd60[_0x0713('0x3c')]};return db['ChatTransferReport'][_0x0713('0x1f')](_0x3bf029)[_0x0713('0x28')](function(_0x3e6764){_0x324111[_0x0713('0x1f')]=_0x3e6764;if(_0x474bab[_0x0713('0x32')][_0x0713('0x43')]){_0x35fd60[_0x0713('0x44')]=[{'all':!![]}];}return db[_0x0713('0x30')]['findAll'](_0x35fd60);})[_0x0713('0x28')](function(_0x2d4d1e){_0x324111['rows']=_0x2d4d1e;return _0x324111;})[_0x0713('0x28')](respondWithFilteredResult(_0x293393,_0x35fd60))[_0x0713('0x45')](handleError(_0x293393,null));};exports['show']=function(_0x26b928,_0x4ba1fb){var _0x26bb7f={'raw':!![],'where':{'id':_0x26b928[_0x0713('0x46')]['id']}},_0x2120c7={};_0x2120c7[_0x0713('0x36')]=_[_0x0713('0x33')](db[_0x0713('0x30')][_0x0713('0x47')]);_0x2120c7[_0x0713('0x32')]=_[_0x0713('0x33')](_0x26b928[_0x0713('0x32')]);_0x2120c7['filters']=_[_0x0713('0x35')](_0x2120c7[_0x0713('0x36')],_0x2120c7[_0x0713('0x32')]);_0x26bb7f[_0x0713('0x37')]=_[_0x0713('0x35')](_0x2120c7[_0x0713('0x36')],qs['fields'](_0x26b928[_0x0713('0x32')][_0x0713('0x38')]));_0x26bb7f['attributes']=_0x26bb7f['attributes'][_0x0713('0x39')]?_0x26bb7f['attributes']:_0x2120c7[_0x0713('0x36')];if(_0x26b928['query'][_0x0713('0x43')]){_0x26bb7f['include']=[{'all':!![]}];}_0x26bb7f=_['merge']({},_0x26bb7f,_0x26b928[_0x0713('0x42')]);return db[_0x0713('0x30')]['find'](_0x26bb7f)[_0x0713('0x28')](handleEntityNotFound(_0x4ba1fb,null))[_0x0713('0x28')](respondWithResult(_0x4ba1fb,null))[_0x0713('0x45')](handleError(_0x4ba1fb,null));};exports['create']=function(_0x9b404c,_0x2a1cbc){return db[_0x0713('0x30')][_0x0713('0x48')](_0x9b404c['body'],{})[_0x0713('0x28')](respondWithResult(_0x2a1cbc,0xc9))[_0x0713('0x45')](handleError(_0x2a1cbc,null));};exports[_0x0713('0x27')]=function(_0xe0d568,_0x149c91){if(_0xe0d568[_0x0713('0x49')]['id']){delete _0xe0d568[_0x0713('0x49')]['id'];}return db['ChatTransferReport'][_0x0713('0x4a')]({'where':{'id':_0xe0d568[_0x0713('0x46')]['id']}})[_0x0713('0x28')](handleEntityNotFound(_0x149c91,null))[_0x0713('0x28')](saveUpdates(_0xe0d568[_0x0713('0x49')],null))[_0x0713('0x28')](respondWithResult(_0x149c91,null))[_0x0713('0x45')](handleError(_0x149c91,null));};exports['destroy']=function(_0x1cdc8f,_0x1b0a5d){return db[_0x0713('0x30')][_0x0713('0x4a')]({'where':{'id':_0x1cdc8f[_0x0713('0x46')]['id']}})[_0x0713('0x28')](handleEntityNotFound(_0x1b0a5d,null))[_0x0713('0x28')](removeEntity(_0x1b0a5d,null))[_0x0713('0x45')](handleError(_0x1b0a5d,null));};exports['describe']=function(_0x641771,_0x45492b){return db['ChatTransferReport']['describe']()[_0x0713('0x28')](respondWithResult(_0x45492b,null))[_0x0713('0x45')](handleError(_0x45492b,null));}; \ No newline at end of file +var _0x19c5=['params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','options','find','create','body'];(function(_0x407e90,_0x2453cf){var _0x288761=function(_0xb56607){while(--_0xb56607){_0x407e90['push'](_0x407e90['shift']());}};_0x288761(++_0x2453cf);}(_0x19c5,0x126));var _0x519c=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x19c5[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0x519c('0x0'));var rimraf=require(_0x519c('0x1'));var zipdir=require(_0x519c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x519c('0x3'));var moment=require('moment');var BPromise=require(_0x519c('0x4'));var Mustache=require('mustache');var util=require(_0x519c('0x5'));var path=require(_0x519c('0x6'));var sox=require(_0x519c('0x7'));var csv=require('to-csv');var ejs=require(_0x519c('0x8'));var fs=require('fs');var fs_extra=require(_0x519c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x519c('0xa'));var deskjs=require(_0x519c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x519c('0xc'));var Redis=require(_0x519c('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x519c('0xe'));var hardwareService=require(_0x519c('0xf'));var logger=require(_0x519c('0x10'))(_0x519c('0x11'));var utils=require(_0x519c('0x12'));var config=require(_0x519c('0x13'));var licenseUtil=require(_0x519c('0x14'));var db=require(_0x519c('0x15'))['db'];function respondWithStatusCode(_0x12e65,_0x298cdc){_0x298cdc=_0x298cdc||0xcc;return function(_0x3ce1aa){if(_0x3ce1aa){return _0x12e65['sendStatus'](_0x298cdc);}return _0x12e65['status'](_0x298cdc)[_0x519c('0x16')]();};}function respondWithResult(_0x3f471b,_0x2c7ab6){_0x2c7ab6=_0x2c7ab6||0xc8;return function(_0xbe48bb){if(_0xbe48bb){return _0x3f471b[_0x519c('0x17')](_0x2c7ab6)[_0x519c('0x18')](_0xbe48bb);}};}function respondWithFilteredResult(_0x2e5973,_0x497a33){return function(_0x3d56ae){if(_0x3d56ae){var _0x32a62d=typeof _0x497a33['offset']===_0x519c('0x19')&&typeof _0x497a33[_0x519c('0x1a')]==='undefined';var _0x1ab740=_0x3d56ae[_0x519c('0x1b')];var _0x1539b5=_0x32a62d?0x0:_0x497a33[_0x519c('0x1c')];var _0x154458=_0x32a62d?_0x3d56ae['count']:_0x497a33[_0x519c('0x1c')]+_0x497a33[_0x519c('0x1a')];var _0x4e11e0;if(_0x154458>=_0x1ab740){_0x154458=_0x1ab740;_0x4e11e0=0xc8;}else{_0x4e11e0=0xce;}_0x2e5973[_0x519c('0x17')](_0x4e11e0);return _0x2e5973[_0x519c('0x1d')](_0x519c('0x1e'),_0x1539b5+'-'+_0x154458+'/'+_0x1ab740)['json'](_0x3d56ae);}return null;};}function patchUpdates(_0x3f3571){return function(_0x5689a5){try{jsonpatch[_0x519c('0x1f')](_0x5689a5,_0x3f3571,!![]);}catch(_0xefa893){return BPromise[_0x519c('0x20')](_0xefa893);}return _0x5689a5['save']();};}function saveUpdates(_0xf98019,_0x3bceba){return function(_0x58d3dd){if(_0x58d3dd){return _0x58d3dd[_0x519c('0x21')](_0xf98019)[_0x519c('0x22')](function(_0x36aa98){return _0x36aa98;});}return null;};}function removeEntity(_0x35bf9c,_0x36b0ed){return function(_0x39fe68){if(_0x39fe68){return _0x39fe68[_0x519c('0x23')]()[_0x519c('0x22')](function(){_0x35bf9c['status'](0xcc)[_0x519c('0x16')]();});}};}function handleEntityNotFound(_0x29b0b3,_0x360274){return function(_0x33077a){if(!_0x33077a){_0x29b0b3[_0x519c('0x24')](0x194);}return _0x33077a;};}function handleError(_0x54cfd8,_0x1cc17f){_0x1cc17f=_0x1cc17f||0x1f4;return function(_0x718ffb){logger[_0x519c('0x25')](_0x718ffb[_0x519c('0x26')]);if(_0x718ffb[_0x519c('0x27')]){delete _0x718ffb[_0x519c('0x27')];}_0x54cfd8[_0x519c('0x17')](_0x1cc17f)[_0x519c('0x28')](_0x718ffb);};}exports[_0x519c('0x29')]=function(_0x441ed1,_0x500429){var _0x5eafb1={},_0x5decb9={},_0x4f50ee={'count':0x0,'rows':[]};var _0x7dbc1f=_[_0x519c('0x2a')](db[_0x519c('0x2b')][_0x519c('0x2c')],function(_0x30859b){return{'name':_0x30859b[_0x519c('0x2d')],'type':_0x30859b[_0x519c('0x2e')]['key']};});_0x5decb9[_0x519c('0x2f')]=_['map'](_0x7dbc1f,_0x519c('0x27'));_0x5decb9[_0x519c('0x30')]=_[_0x519c('0x31')](_0x441ed1[_0x519c('0x30')]);_0x5decb9[_0x519c('0x32')]=_[_0x519c('0x33')](_0x5decb9['model'],_0x5decb9[_0x519c('0x30')]);_0x5eafb1[_0x519c('0x34')]=_[_0x519c('0x33')](_0x5decb9[_0x519c('0x2f')],qs[_0x519c('0x35')](_0x441ed1[_0x519c('0x30')][_0x519c('0x35')]));_0x5eafb1['attributes']=_0x5eafb1[_0x519c('0x34')][_0x519c('0x36')]?_0x5eafb1[_0x519c('0x34')]:_0x5decb9[_0x519c('0x2f')];if(!_0x441ed1['query'][_0x519c('0x37')](_0x519c('0x38'))){_0x5eafb1['limit']=qs['limit'](_0x441ed1[_0x519c('0x30')][_0x519c('0x1a')]);_0x5eafb1['offset']=qs['offset'](_0x441ed1['query'][_0x519c('0x1c')]);}_0x5eafb1['order']=qs[_0x519c('0x39')](_0x441ed1[_0x519c('0x30')][_0x519c('0x39')]);_0x5eafb1[_0x519c('0x3a')]=qs[_0x519c('0x32')](_[_0x519c('0x3b')](_0x441ed1[_0x519c('0x30')],_0x5decb9[_0x519c('0x32')]),_0x7dbc1f);if(_0x441ed1[_0x519c('0x30')][_0x519c('0x3c')]){_0x5eafb1[_0x519c('0x3a')]=_[_0x519c('0x3d')](_0x5eafb1[_0x519c('0x3a')],{'$or':_[_0x519c('0x2a')](_0x7dbc1f,function(_0x5962f9){if(_0x5962f9[_0x519c('0x2e')]!=='VIRTUAL'){var _0x5f0a7f={};_0x5f0a7f[_0x5962f9[_0x519c('0x27')]]={'$like':'%'+_0x441ed1[_0x519c('0x30')]['filter']+'%'};return _0x5f0a7f;}})});}_0x5eafb1=_[_0x519c('0x3d')]({},_0x5eafb1,_0x441ed1['options']);var _0x1b5df5={'where':_0x5eafb1['where']};return db[_0x519c('0x2b')][_0x519c('0x1b')](_0x1b5df5)['then'](function(_0xaff238){_0x4f50ee[_0x519c('0x1b')]=_0xaff238;if(_0x441ed1[_0x519c('0x30')][_0x519c('0x3e')]){_0x5eafb1['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x519c('0x3f')](_0x5eafb1);})[_0x519c('0x22')](function(_0x4817fd){_0x4f50ee[_0x519c('0x40')]=_0x4817fd;return _0x4f50ee;})['then'](respondWithFilteredResult(_0x500429,_0x5eafb1))[_0x519c('0x41')](handleError(_0x500429,null));};exports[_0x519c('0x42')]=function(_0x5a155b,_0x301bc1){var _0x32f012={'raw':!![],'where':{'id':_0x5a155b['params']['id']}},_0x152736={};_0x152736[_0x519c('0x2f')]=_[_0x519c('0x31')](db[_0x519c('0x2b')][_0x519c('0x2c')]);_0x152736[_0x519c('0x30')]=_[_0x519c('0x31')](_0x5a155b[_0x519c('0x30')]);_0x152736[_0x519c('0x32')]=_[_0x519c('0x33')](_0x152736[_0x519c('0x2f')],_0x152736[_0x519c('0x30')]);_0x32f012['attributes']=_['intersection'](_0x152736[_0x519c('0x2f')],qs[_0x519c('0x35')](_0x5a155b[_0x519c('0x30')][_0x519c('0x35')]));_0x32f012[_0x519c('0x34')]=_0x32f012[_0x519c('0x34')][_0x519c('0x36')]?_0x32f012[_0x519c('0x34')]:_0x152736[_0x519c('0x2f')];if(_0x5a155b['query']['includeAll']){_0x32f012['include']=[{'all':!![]}];}_0x32f012=_[_0x519c('0x3d')]({},_0x32f012,_0x5a155b[_0x519c('0x43')]);return db[_0x519c('0x2b')][_0x519c('0x44')](_0x32f012)[_0x519c('0x22')](handleEntityNotFound(_0x301bc1,null))[_0x519c('0x22')](respondWithResult(_0x301bc1,null))['catch'](handleError(_0x301bc1,null));};exports[_0x519c('0x45')]=function(_0x91dfa9,_0x4a12ee){return db[_0x519c('0x2b')][_0x519c('0x45')](_0x91dfa9[_0x519c('0x46')],{})[_0x519c('0x22')](respondWithResult(_0x4a12ee,0xc9))[_0x519c('0x41')](handleError(_0x4a12ee,null));};exports[_0x519c('0x21')]=function(_0x5dde54,_0xc175d9){if(_0x5dde54[_0x519c('0x46')]['id']){delete _0x5dde54[_0x519c('0x46')]['id'];}return db[_0x519c('0x2b')][_0x519c('0x44')]({'where':{'id':_0x5dde54['params']['id']}})[_0x519c('0x22')](handleEntityNotFound(_0xc175d9,null))[_0x519c('0x22')](saveUpdates(_0x5dde54['body'],null))[_0x519c('0x22')](respondWithResult(_0xc175d9,null))[_0x519c('0x41')](handleError(_0xc175d9,null));};exports[_0x519c('0x23')]=function(_0x29197f,_0x4de2c0){return db[_0x519c('0x2b')][_0x519c('0x44')]({'where':{'id':_0x29197f[_0x519c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4de2c0,null))['then'](removeEntity(_0x4de2c0,null))[_0x519c('0x41')](handleError(_0x4de2c0,null));};exports[_0x519c('0x48')]=function(_0x55f3ef,_0x22fceb){return db[_0x519c('0x2b')]['describe']()['then'](respondWithResult(_0x22fceb,null))['catch'](handleError(_0x22fceb,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b224b95..b877ef1 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 _0xaa4a=['./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5d84cb,_0x1bd87b){var _0x4542cb=function(_0x4599ec){while(--_0x4599ec){_0x5d84cb['push'](_0x5d84cb['shift']());}};_0x4542cb(++_0x1bd87b);}(_0xaa4a,0xac));var _0xaaa4=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xaa4a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xaaa4('0x0'));var util=require(_0xaaa4('0x1'));var logger=require('../../config/logger')(_0xaaa4('0x2'));var moment=require(_0xaaa4('0x3'));var BPromise=require(_0xaaa4('0x4'));var rp=require(_0xaaa4('0x5'));var fs=require('fs');var path=require(_0xaaa4('0x6'));var rimraf=require('rimraf');var config=require(_0xaaa4('0x7'));var attributes=require(_0xaaa4('0x8'));module[_0xaaa4('0x9')]=function(_0x569103,_0x20e10e){return _0x569103['define']('ChatTransferReport',attributes,{'tableName':_0xaaa4('0xa'),'paranoid':![],'indexes':[{'name':_0xaaa4('0xb'),'fields':[_0xaaa4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a0f=['ChatTransferReport','report_chat_transfer','uniqueid','api','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x2cd29b,_0x2217ab){var _0x1217d8=function(_0x3e59fc){while(--_0x3e59fc){_0x2cd29b['push'](_0x2cd29b['shift']());}};_0x1217d8(++_0x2217ab);}(_0x7a0f,0xd4));var _0xf7a0=function(_0x34cda8,_0x45f93c){_0x34cda8=_0x34cda8-0x0;var _0x241d9c=_0x7a0f[_0x34cda8];return _0x241d9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf7a0('0x0'));var moment=require('moment');var BPromise=require(_0xf7a0('0x1'));var rp=require(_0xf7a0('0x2'));var fs=require('fs');var path=require(_0xf7a0('0x3'));var rimraf=require('rimraf');var config=require(_0xf7a0('0x4'));var attributes=require(_0xf7a0('0x5'));module[_0xf7a0('0x6')]=function(_0xa96b6a,_0x2a0aaf){return _0xa96b6a[_0xf7a0('0x7')](_0xf7a0('0x8'),attributes,{'tableName':_0xf7a0('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7a0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 303414a..e793376 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 _0x3b24=['../../config/logger','rpc','../../config/environment','client','http','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x4f59c9,_0x5b1670){var _0x4a27e3=function(_0x57ee40){while(--_0x57ee40){_0x4f59c9['push'](_0x4f59c9['shift']());}};_0x4a27e3(++_0x5b1670);}(_0x3b24,0xd9));var _0x43b2=function(_0x341025,_0x29d6a3){_0x341025=_0x341025-0x0;var _0x26e9b5=_0x3b24[_0x341025];return _0x26e9b5;};'use strict';var _=require('lodash');var util=require(_0x43b2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43b2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43b2('0x2'))['db'];var utils=require(_0x43b2('0x3'));var logger=require(_0x43b2('0x4'))(_0x43b2('0x5'));var config=require(_0x43b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x43b2('0x7')][_0x43b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39917d,_0x1a7e05,_0x304878){return new BPromise(function(_0x57d907,_0x3b7c23){return client['request'](_0x39917d,_0x304878)[_0x43b2('0x9')](function(_0x42a8e2){logger['info'](_0x43b2('0xa'),_0x1a7e05,_0x43b2('0xb'));logger[_0x43b2('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1a7e05,'request\x20sent',JSON['stringify'](_0x42a8e2));if(_0x42a8e2[_0x43b2('0xd')]){if(_0x42a8e2[_0x43b2('0xd')]['code']===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1a7e05,_0x42a8e2[_0x43b2('0xd')][_0x43b2('0xe')]);return _0x3b7c23(_0x42a8e2['error'][_0x43b2('0xe')]);}logger[_0x43b2('0xd')](_0x43b2('0xa'),_0x1a7e05,_0x42a8e2['error'][_0x43b2('0xe')]);return _0x57d907(_0x42a8e2[_0x43b2('0xd')]['message']);}else{logger[_0x43b2('0xf')](_0x43b2('0xa'),_0x1a7e05,_0x43b2('0xb'));_0x57d907(_0x42a8e2['result'][_0x43b2('0xe')]);}})[_0x43b2('0x10')](function(_0x4cad73){logger[_0x43b2('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x1a7e05,_0x4cad73);_0x3b7c23(_0x4cad73);});});} \ No newline at end of file +var _0x250e=['code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xa5c51b,_0x4000c0){var _0x8a1da4=function(_0x1c950c){while(--_0x1c950c){_0xa5c51b['push'](_0xa5c51b['shift']());}};_0x8a1da4(++_0x4000c0);}(_0x250e,0x174));var _0xe250=function(_0x179407,_0x3f49c7){_0x179407=_0x179407-0x0;var _0x249c29=_0x250e[_0x179407];return _0x249c29;};'use strict';var _=require('lodash');var util=require(_0xe250('0x0'));var moment=require(_0xe250('0x1'));var BPromise=require(_0xe250('0x2'));var rs=require(_0xe250('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe250('0x4'))['db'];var utils=require(_0xe250('0x5'));var logger=require(_0xe250('0x6'))(_0xe250('0x7'));var config=require(_0xe250('0x8'));var jayson=require(_0xe250('0x9'));var client=jayson['client'][_0xe250('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1feffb,_0x4ea7d6,_0x3e35f0){return new BPromise(function(_0x24281d,_0x58961c){return client[_0xe250('0xb')](_0x1feffb,_0x3e35f0)[_0xe250('0xc')](function(_0x35c0fb){logger[_0xe250('0xd')](_0xe250('0xe'),_0x4ea7d6,_0xe250('0xf'));logger[_0xe250('0x10')](_0xe250('0x11'),_0x4ea7d6,_0xe250('0xf'),JSON['stringify'](_0x35c0fb));if(_0x35c0fb[_0xe250('0x12')]){if(_0x35c0fb['error'][_0xe250('0x13')]===0x1f4){logger[_0xe250('0x12')](_0xe250('0xe'),_0x4ea7d6,_0x35c0fb['error'][_0xe250('0x14')]);return _0x58961c(_0x35c0fb['error'][_0xe250('0x14')]);}logger[_0xe250('0x12')](_0xe250('0xe'),_0x4ea7d6,_0x35c0fb[_0xe250('0x12')][_0xe250('0x14')]);return _0x24281d(_0x35c0fb['error'][_0xe250('0x14')]);}else{logger[_0xe250('0xd')](_0xe250('0xe'),_0x4ea7d6,_0xe250('0xf'));_0x24281d(_0x35c0fb[_0xe250('0x15')][_0xe250('0x14')]);}})[_0xe250('0x16')](function(_0x2bd6a8){logger[_0xe250('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4ea7d6,_0x2bd6a8);_0x58961c(_0x2bd6a8);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d195192..0c2ef46 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 _0x4bba=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/:id','show','create','put'];(function(_0x2ce786,_0x5cb4d5){var _0x9cf7fe=function(_0xdaa929){while(--_0xdaa929){_0x2ce786['push'](_0x2ce786['shift']());}};_0x9cf7fe(++_0x5cb4d5);}(_0x4bba,0x113));var _0xa4bb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4bba[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa4bb('0x0'));var util=require(_0xa4bb('0x1'));var path=require(_0xa4bb('0x2'));var timeout=require(_0xa4bb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa4bb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa4bb('0x5'));var controller=require(_0xa4bb('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa4bb('0x7')]('/describe',auth[_0xa4bb('0x8')](),controller['describe']);router['get'](_0xa4bb('0x9'),auth[_0xa4bb('0x8')](),controller[_0xa4bb('0xa')]);router['post']('/',auth[_0xa4bb('0x8')](),controller[_0xa4bb('0xb')]);router[_0xa4bb('0xc')](_0xa4bb('0x9'),auth[_0xa4bb('0x8')](),controller['update']);router[_0xa4bb('0xd')](_0xa4bb('0x9'),auth[_0xa4bb('0x8')](),controller[_0xa4bb('0xe')]);module[_0xa4bb('0xf')]=router; \ No newline at end of file +var _0x4341=['get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x2cb99a,_0x512933){var _0x3a1881=function(_0x305584){while(--_0x305584){_0x2cb99a['push'](_0x2cb99a['shift']());}};_0x3a1881(++_0x512933);}(_0x4341,0x13c));var _0x1434=function(_0x2233be,_0xd10120){_0x2233be=_0x2233be-0x0;var _0x1a6468=_0x4341[_0x2233be];return _0x1a6468;};'use strict';var multer=require(_0x1434('0x0'));var util=require(_0x1434('0x1'));var path=require(_0x1434('0x2'));var timeout=require(_0x1434('0x3'));var express=require('express');var router=express[_0x1434('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1434('0x5'));var config=require(_0x1434('0x6'));var controller=require(_0x1434('0x7'));router[_0x1434('0x8')]('/',auth[_0x1434('0x9')](),controller[_0x1434('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1434('0xb'),auth[_0x1434('0x9')](),controller[_0x1434('0xc')]);router['post']('/',auth[_0x1434('0x9')](),controller[_0x1434('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1434('0xe')]);router[_0x1434('0xf')](_0x1434('0xb'),auth['isAuthenticated'](),controller[_0x1434('0x10')]);module[_0x1434('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 0e37498..9c9f0c8 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 _0xfd28=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT'];(function(_0x6836b4,_0x41102b){var _0x18ad8b=function(_0x225ff5){while(--_0x225ff5){_0x6836b4['push'](_0x6836b4['shift']());}};_0x18ad8b(++_0x41102b);}(_0xfd28,0x148));var _0x8fd2=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xfd28[_0x11a220];return _0x20d8fe;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8fd2('0x0'));module[_0x8fd2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8fd2('0x2')]},'mapKey':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x3')},'key':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x4')},'customerAlias':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![],'defaultValue':_0x8fd2('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8fd2('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8fd2('0x8'),'squared'),'defaultValue':_0x8fd2('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x9')},'start_chat_button':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xa')},'offline_chat_button':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xb')},'header_offline':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xc')},'download_transcript':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8fd2('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8fd2('0xe')]},'closingQuestion':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x11')},'placeholderMessage':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x12')},'closingMessage':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0xb')},'skipMessageButton':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x13')},'conditionAgreement':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x8fd2('0x15'),_0x8fd2('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x8fd2('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x8fd2('0x17')]({'items':[{'type':_0x8fd2('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8fd2('0x19'),'required':!![]},'props':{'title':_0x8fd2('0x1a'),'helpText':''}},{'type':_0x8fd2('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8fd2('0x3'),'type':_0x8fd2('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8fd2('0x1b')](_0x8fd2('0x1c'))?JSON[_0x8fd2('0x1d')](this[_0x8fd2('0x1b')](_0x8fd2('0x1c'))):{};},'set':function(_0x398925){return this[_0x8fd2('0x1e')](_0x8fd2('0x1c'),JSON[_0x8fd2('0x17')](_0x398925));}},'offlineForm':{'type':Sequelize[_0x8fd2('0xe')],'defaultValue':function(){return JSON[_0x8fd2('0x17')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8fd2('0x3'),'type':_0x8fd2('0x3')},'variable':null},{'type':_0x8fd2('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x8fd2('0x20'),'helpText':_0x8fd2('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x8fd2('0x1b')](_0x8fd2('0x22'))?JSON[_0x8fd2('0x1d')](this[_0x8fd2('0x1b')](_0x8fd2('0x22'))):{};},'set':function(_0x5bfaa4){return this[_0x8fd2('0x1e')](_0x8fd2('0x22'),JSON[_0x8fd2('0x17')](_0x5bfaa4));}},'token':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':function(){return rs[_0x8fd2('0x23')]();}},'autoclose':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8fd2('0x2')]},'waitingTitle':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x24')},'waitingMessage':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8fd2('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8fd2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8fd2('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x8fd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':_0x8fd2('0x29')},'messagesAlignment':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8fd2('0x2')]},'customerAvatar':{'type':Sequelize[_0x8fd2('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8fd2('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8fd2('0x2')],'allowNull':![],'defaultValue':_0x8fd2('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8fd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8fd2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8fd2('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8fd2('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![],'comment':_0x8fd2('0x2d'),'set':function(_0x2edcfd){if(!_0x2edcfd)this[_0x8fd2('0x1e')](_0x8fd2('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x2edcfd);}},'vidaooEscalation':{'type':Sequelize[_0x8fd2('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8fd2('0x2f')},'vidaooNote':{'type':Sequelize[_0x8fd2('0x2')],'defaultValue':function(){return _0x8fd2('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8fd2('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8fd2('0xe')]}}; \ No newline at end of file +var _0xb58b=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x14d63b,_0x30da49){var _0x22fadd=function(_0x44e81d){while(--_0x44e81d){_0x14d63b['push'](_0x14d63b['shift']());}};_0x22fadd(++_0x30da49);}(_0xb58b,0x1f1));var _0xbb58=function(_0x259c3b,_0x493ca0){_0x259c3b=_0x259c3b-0x0;var _0xe0d619=_0xb58b[_0x259c3b];return _0xe0d619;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbb58('0x0'));module[_0xbb58('0x1')]={'name':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb58('0x3')},'description':{'type':Sequelize[_0xbb58('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'key':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb58('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb58('0x8')]('rounded',_0xbb58('0x9')),'defaultValue':_0xbb58('0xa')},'header_online':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0xc')},'offline_chat_button':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xd')},'download_transcript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbb58('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x11')},'closingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x12')},'conditionAgreement':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbb58('0x8')](_0xbb58('0x13'),_0xbb58('0x14')),'defaultValue':_0xbb58('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'variable':null,'config':{'placeholder':_0xbb58('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb58('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x19'))?JSON[_0xbb58('0x1a')](this[_0xbb58('0x18')](_0xbb58('0x19'))):{};},'set':function(_0x4e0303){return this[_0xbb58('0x1b')](_0xbb58('0x19'),JSON[_0xbb58('0x15')](_0x4e0303));}},'offlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null},{'type':_0xbb58('0x1c'),'config':{'placeholder':_0xbb58('0x1d')},'props':{'title':_0xbb58('0x1d'),'helpText':_0xbb58('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x1f'))?JSON['parse'](this[_0xbb58('0x18')](_0xbb58('0x1f'))):{};},'set':function(_0x12b3eb){return this[_0xbb58('0x1b')](_0xbb58('0x1f'),JSON[_0xbb58('0x15')](_0x12b3eb));}},'token':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return rs[_0xbb58('0x20')]();}},'autoclose':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbb58('0x2')]},'forwardOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb58('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x21')},'waitingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x23')},'offlineMessageBody':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x25')},'enableCustomerAttachment':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb58('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbb58('0x26');}},'notificationSound':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x29')},'messagesAlignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x2a')},'defaultTitle':{'type':Sequelize[_0xbb58('0x2')]},'customerAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb58('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb58('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb58('0x7')],'comment':_0xbb58('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xc29171){if(!_0xc29171)this[_0xbb58('0x1b')](_0xbb58('0x2d'),null);this[_0xbb58('0x1b')](_0xbb58('0x2e'),_0xc29171);}},'vidaooEscalation':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x2f')},'vidaooNote':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return _0xbb58('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 258705a..2d144ac 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 _0xe101=['spread','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','files','offline-chat','basename','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','internal','Tags','color','tag','getSnippet','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','License','increment','all','some','remote','remoteAddress','replace','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','online','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','ChatWebsites','stack','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','Pause','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','existsSync','getAvatar','isNil','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','CmContact','contact','cf-connecting-ip','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ContactId','interaction','ChatInteraction'];(function(_0x1049fb,_0x39c9be){var _0x5c30b8=function(_0x57883d){while(--_0x57883d){_0x1049fb['push'](_0x1049fb['shift']());}};_0x5c30b8(++_0x39c9be);}(_0xe101,0x18f));var _0x1e10=function(_0x2e32c8,_0x569eb1){_0x2e32c8=_0x2e32c8-0x0;var _0x179da5=_0xe101[_0x2e32c8];return _0x179da5;};'use strict';var BPromise=require(_0x1e10('0x0'));var Mustache=require(_0x1e10('0x1'));var util=require(_0x1e10('0x2'));var path=require(_0x1e10('0x3'));var ejs=require(_0x1e10('0x4'));var fs=require('fs');var fs_extra=require(_0x1e10('0x5'));var _=require('lodash');var querystring=require(_0x1e10('0x6'));var Redis=require(_0x1e10('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x1e10('0x8'))('api');var config=require(_0x1e10('0x9'));var db=require('../../mysqldb')['db'];config[_0x1e10('0xa')]=_[_0x1e10('0xb')](config[_0x1e10('0xa')],{'host':_0x1e10('0xc'),'port':0x18eb});var socket=require(_0x1e10('0xd'))(new Redis(config[_0x1e10('0xa')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x1e10('0xe'));var client=jayson['client'][_0x1e10('0xf')]({'port':0x232c});var client9002=jayson[_0x1e10('0x10')][_0x1e10('0xf')]({'port':0x232a});var client9003=jayson[_0x1e10('0x10')][_0x1e10('0xf')]({'port':0x232b});var client9001=jayson[_0x1e10('0x10')][_0x1e10('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x521cd0,_0x854bda,_0x3000b5,_0x43ca75){return new BPromise(function(_0x2a9c66,_0x89c478){var _0x236fc4=_0x43ca75||client;return _0x236fc4[_0x1e10('0x11')](_0x521cd0,_0x3000b5)['then'](function(_0xabd7d0){logger['info'](_0x1e10('0x12'),_0x854bda,'request\x20sent');logger[_0x1e10('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x854bda,_0x1e10('0x14'),JSON['stringify'](_0xabd7d0));if(_0xabd7d0[_0x1e10('0x15')]){if(_0xabd7d0[_0x1e10('0x15')][_0x1e10('0x16')]===0x1f4){logger[_0x1e10('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x854bda,_0xabd7d0['error'][_0x1e10('0x17')]);return _0x89c478(_0xabd7d0[_0x1e10('0x15')]['message']);}logger[_0x1e10('0x15')](_0x1e10('0x12'),_0x854bda,_0xabd7d0['error']['message']);return _0x2a9c66(_0xabd7d0[_0x1e10('0x15')][_0x1e10('0x17')]);}else{logger[_0x1e10('0x18')](_0x1e10('0x12'),_0x854bda,_0x1e10('0x14'));_0x2a9c66(_0xabd7d0[_0x1e10('0x19')]['message']);}})[_0x1e10('0x1a')](function(_0x1e7937){logger['error'](_0x1e10('0x12'),_0x854bda,_0x1e7937);_0x89c478(_0x1e7937);});});}function respondWithStatusCode(_0x45e9f7,_0x36db66){_0x36db66=_0x36db66||0xcc;return function(_0x48a782){if(_0x48a782){return _0x45e9f7[_0x1e10('0x1b')](_0x36db66);}return _0x45e9f7[_0x1e10('0x1c')](_0x36db66)[_0x1e10('0x1d')]();};}function respondWithResult(_0x24765d,_0x1dbf1f){_0x1dbf1f=_0x1dbf1f||0xc8;return function(_0x86756b){if(_0x86756b){return _0x24765d[_0x1e10('0x1c')](_0x1dbf1f)[_0x1e10('0x1e')](_0x86756b);}};}function respondWithFilteredResult(_0x56a27e,_0x2f31be){return function(_0x3ce1f9){if(_0x3ce1f9){var _0x45e5a0=typeof _0x2f31be[_0x1e10('0x1f')]==='undefined'&&typeof _0x2f31be[_0x1e10('0x20')]===_0x1e10('0x21');var _0x4e839f=_0x3ce1f9[_0x1e10('0x22')];var _0x48a658=_0x45e5a0?0x0:_0x2f31be[_0x1e10('0x1f')];var _0x58f255=_0x45e5a0?_0x3ce1f9[_0x1e10('0x22')]:_0x2f31be[_0x1e10('0x1f')]+_0x2f31be[_0x1e10('0x20')];var _0x3d9794;if(_0x58f255>=_0x4e839f){_0x58f255=_0x4e839f;_0x3d9794=0xc8;}else{_0x3d9794=0xce;}_0x56a27e[_0x1e10('0x1c')](_0x3d9794);return _0x56a27e['set'](_0x1e10('0x23'),_0x48a658+'-'+_0x58f255+'/'+_0x4e839f)['json'](_0x3ce1f9);}return null;};}function saveUpdates(_0x276499){return function(_0x428c5a){if(_0x428c5a){return _0x428c5a[_0x1e10('0x24')](_0x276499)[_0x1e10('0x25')](function(_0x2dc1d2){return _0x2dc1d2;});}return null;};}function removeEntity(_0x4f3bc2){return function(_0x437ddb){if(_0x437ddb){return _0x437ddb[_0x1e10('0x26')]()[_0x1e10('0x25')](function(){var _0x2be26c=_0x437ddb[_0x1e10('0x27')]({'plain':!![]});var _0x51d2aa=_0x1e10('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x51d2aa,'resourceId':_0x2be26c['id']}})[_0x1e10('0x25')](function(){return _0x437ddb;});})['then'](function(){_0x4f3bc2[_0x1e10('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ee83){return function(_0x58c9be){if(!_0x58c9be){_0x12ee83[_0x1e10('0x1b')](0x194);}return _0x58c9be;};}function handleError(_0x2ac261,_0x1c3d04){_0x1c3d04=_0x1c3d04||0x1f4;return function(_0x44fd68){logger[_0x1e10('0x15')](_0x44fd68[_0x1e10('0x29')]);if(_0x44fd68['name']){delete _0x44fd68[_0x1e10('0x2a')];}_0x2ac261[_0x1e10('0x1c')](_0x1c3d04)[_0x1e10('0x2b')](_0x44fd68);};}exports['index']=function(_0x2fd379,_0x547295){var _0x21886d={'include':[{'model':db['Pause'],'as':_0x1e10('0x2c')}]},_0x4e9352={},_0x4988df={'count':0x0,'rows':[]};var _0x1ecd7d=_[_0x1e10('0x2d')](db[_0x1e10('0x2e')][_0x1e10('0x2f')],function(_0x5a5bad){return{'name':_0x5a5bad['fieldName'],'type':_0x5a5bad['type'][_0x1e10('0x30')]};});_0x4e9352[_0x1e10('0x31')]=_[_0x1e10('0x2d')](_0x1ecd7d,_0x1e10('0x2a'));_0x4e9352[_0x1e10('0x32')]=_['keys'](_0x2fd379['query']);_0x4e9352[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x4e9352[_0x1e10('0x31')],_0x4e9352[_0x1e10('0x32')]);_0x21886d[_0x1e10('0x35')]=_[_0x1e10('0x34')](_0x4e9352[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0x2fd379['query'][_0x1e10('0x36')]));_0x21886d[_0x1e10('0x35')]=_0x21886d['attributes'][_0x1e10('0x37')]?_0x21886d[_0x1e10('0x35')]:_0x4e9352['model'];if(!_0x2fd379['query'][_0x1e10('0x38')](_0x1e10('0x39'))){_0x21886d[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x2fd379[_0x1e10('0x32')][_0x1e10('0x20')]);_0x21886d[_0x1e10('0x1f')]=qs[_0x1e10('0x1f')](_0x2fd379[_0x1e10('0x32')][_0x1e10('0x1f')]);}_0x21886d['order']=qs[_0x1e10('0x3a')](_0x2fd379[_0x1e10('0x32')][_0x1e10('0x3a')]);_0x21886d[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_[_0x1e10('0x3c')](_0x2fd379[_0x1e10('0x32')],_0x4e9352['filters']),_0x1ecd7d);if(_0x2fd379['query'][_0x1e10('0x3d')]){_0x21886d['where']=_[_0x1e10('0x3e')](_0x21886d[_0x1e10('0x3b')],{'$or':_[_0x1e10('0x2d')](_0x1ecd7d,function(_0x4e0185){if(_0x4e0185[_0x1e10('0x3f')]!==_0x1e10('0x40')){var _0x3efe01={};_0x3efe01[_0x4e0185[_0x1e10('0x2a')]]={'$like':'%'+_0x2fd379[_0x1e10('0x32')][_0x1e10('0x3d')]+'%'};return _0x3efe01;}})});}_0x21886d=_[_0x1e10('0x3e')]({},_0x21886d,_0x2fd379[_0x1e10('0x41')]);var _0x2c5b10={'where':_0x21886d[_0x1e10('0x3b')]};return db[_0x1e10('0x2e')][_0x1e10('0x22')](_0x2c5b10)[_0x1e10('0x25')](function(_0x24bbdb){_0x4988df[_0x1e10('0x22')]=_0x24bbdb;if(_0x2fd379[_0x1e10('0x32')][_0x1e10('0x42')]){_0x21886d['include']=[{'all':!![]}];}return db[_0x1e10('0x2e')][_0x1e10('0x43')](_0x21886d);})[_0x1e10('0x25')](function(_0x312aca){_0x4988df[_0x1e10('0x44')]=_0x312aca;return _0x4988df;})['then'](respondWithFilteredResult(_0x547295,_0x21886d))[_0x1e10('0x1a')](handleError(_0x547295,null));};exports['show']=function(_0xbba63,_0x4242a7){var _0x33f034={'raw':![],'where':{'id':_0xbba63['params']['id']},'include':[{'model':db[_0x1e10('0x45')],'as':_0x1e10('0x2c')}]},_0x4ebb51={};_0x4ebb51['model']=_[_0x1e10('0x46')](db['ChatWebsite'][_0x1e10('0x2f')]);_0x4ebb51[_0x1e10('0x32')]=_['keys'](_0xbba63['query']);_0x4ebb51['filters']=_[_0x1e10('0x34')](_0x4ebb51['model'],_0x4ebb51[_0x1e10('0x32')]);_0x33f034['attributes']=_[_0x1e10('0x34')](_0x4ebb51['model'],qs[_0x1e10('0x36')](_0xbba63[_0x1e10('0x32')][_0x1e10('0x36')]));_0x33f034[_0x1e10('0x35')]=_0x33f034['attributes']['length']?_0x33f034[_0x1e10('0x35')]:_0x4ebb51[_0x1e10('0x31')];if(_0xbba63[_0x1e10('0x32')]['includeAll']){_0x33f034[_0x1e10('0x47')]=[{'all':!![]}];}_0x33f034=_['merge']({},_0x33f034,_0xbba63['options']);return db['ChatWebsite'][_0x1e10('0x48')](_0x33f034)[_0x1e10('0x25')](handleEntityNotFound(_0x4242a7,null))['then'](respondWithResult(_0x4242a7,null))[_0x1e10('0x1a')](handleError(_0x4242a7,null));};exports[_0x1e10('0x49')]=function(_0x57c1d7,_0x56ba95){return db[_0x1e10('0x2e')]['create'](_0x57c1d7[_0x1e10('0x4a')],{})['then'](function(_0x4bb21b){var _0x2d521a=_0x57c1d7[_0x1e10('0x4b')][_0x1e10('0x27')]({'plain':!![]});if(!_0x2d521a)throw new Error(_0x1e10('0x4c'));if(_0x2d521a[_0x1e10('0x4d')]===_0x1e10('0x4b')){var _0x488ed6=_0x4bb21b[_0x1e10('0x27')]({'plain':!![]});var _0x4dcb0a=_0x1e10('0x28');return db[_0x1e10('0x4e')][_0x1e10('0x48')]({'where':{'name':_0x4dcb0a,'userProfileId':_0x2d521a[_0x1e10('0x4f')]},'raw':!![]})[_0x1e10('0x25')](function(_0x7423e){if(_0x7423e&&_0x7423e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x488ed6[_0x1e10('0x2a')],'resourceId':_0x488ed6['id'],'type':_0x7423e[_0x1e10('0x2a')],'sectionId':_0x7423e['id']},{})['then'](function(){return _0x4bb21b;});}else{return _0x4bb21b;}})[_0x1e10('0x1a')](function(_0x54f204){logger['error'](_0x1e10('0x50'),_0x54f204);throw _0x54f204;});}return _0x4bb21b;})[_0x1e10('0x25')](respondWithResult(_0x56ba95,0xc9))['catch'](handleError(_0x56ba95,null));};exports[_0x1e10('0x24')]=function(_0x3e6998,_0x5c5813){if(_0x3e6998[_0x1e10('0x4a')]['id']){delete _0x3e6998[_0x1e10('0x4a')]['id'];}return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x3e6998['params']['id']},'include':[{'model':db[_0x1e10('0x45')],'as':_0x1e10('0x2c')}]})[_0x1e10('0x25')](handleEntityNotFound(_0x5c5813,null))[_0x1e10('0x25')](saveUpdates(_0x3e6998['body'],null))[_0x1e10('0x25')](respondWithResult(_0x5c5813,null))[_0x1e10('0x1a')](handleError(_0x5c5813,null));};exports[_0x1e10('0x26')]=function(_0x19fa5e,_0x191bf4){return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x19fa5e[_0x1e10('0x51')]['id']}})['then'](handleEntityNotFound(_0x191bf4,null))['then'](removeEntity(_0x191bf4,null))[_0x1e10('0x1a')](handleError(_0x191bf4,null));};exports[_0x1e10('0x52')]=function(_0xc5f997,_0x53bc3f){return db['ChatWebsite'][_0x1e10('0x52')]()[_0x1e10('0x25')](respondWithResult(_0x53bc3f,null))['catch'](handleError(_0x53bc3f,null));};exports[_0x1e10('0x53')]=function(_0x1f9295,_0x1c2c42){if(_0x1f9295['body']['id']){delete _0x1f9295[_0x1e10('0x4a')]['id'];}return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x1f9295[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x1c2c42,null))[_0x1e10('0x25')](function(_0x15038c){if(_0x15038c){_0x1f9295[_0x1e10('0x4a')]['ChatWebsiteId']=_0x15038c['id'];return db[_0x1e10('0x54')]['create'](_0x1f9295['body']);}})['then'](respondWithResult(_0x1c2c42,null))['catch'](handleError(_0x1c2c42,null));};exports[_0x1e10('0x55')]=function(_0x413510,_0x55d5d8){var _0x269693={'raw':![],'where':{}};var _0x2645f6={};var _0x1a96aa={'count':0x0,'rows':[]};return db[_0x1e10('0x2e')][_0x1e10('0x56')]({'where':{'id':_0x413510['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x55d5d8,null))['then'](function(_0x58f4d2){if(_0x58f4d2){_0x2645f6[_0x1e10('0x31')]=_[_0x1e10('0x46')](db[_0x1e10('0x54')][_0x1e10('0x2f')]);_0x2645f6[_0x1e10('0x32')]=_['keys'](_0x413510[_0x1e10('0x32')]);_0x2645f6[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x2645f6[_0x1e10('0x31')],_0x2645f6['query']);_0x269693['attributes']=_[_0x1e10('0x34')](_0x2645f6['model'],qs['fields'](_0x413510['query']['fields']));_0x269693[_0x1e10('0x35')]=_0x269693['attributes'][_0x1e10('0x37')]?_0x269693[_0x1e10('0x35')]:_0x2645f6['model'];if(!_0x413510[_0x1e10('0x32')][_0x1e10('0x38')](_0x1e10('0x39'))){_0x269693[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x413510[_0x1e10('0x32')][_0x1e10('0x20')]);_0x269693[_0x1e10('0x1f')]=qs['offset'](_0x413510[_0x1e10('0x32')][_0x1e10('0x1f')]);}_0x269693[_0x1e10('0x57')]=qs[_0x1e10('0x3a')](_0x413510[_0x1e10('0x32')]['sort']);_0x269693[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_['pick'](_0x413510[_0x1e10('0x32')],_0x2645f6[_0x1e10('0x33')]));_0x269693['where'][_0x1e10('0x58')]=_0x58f4d2['id'];if(_0x413510[_0x1e10('0x32')][_0x1e10('0x3d')]){_0x269693['where']=_[_0x1e10('0x3e')](_0x269693[_0x1e10('0x3b')],{'$or':_[_0x1e10('0x2d')](_0x269693['attributes'],function(_0x285e7e){var _0x3c7d25={};_0x3c7d25[_0x285e7e]={'$like':'%'+_0x413510['query'][_0x1e10('0x3d')]+'%'};return _0x3c7d25;})});}_0x269693=_[_0x1e10('0x3e')]({},_0x269693,_0x413510['options']);return db[_0x1e10('0x54')][_0x1e10('0x22')]({'where':_0x269693[_0x1e10('0x3b')]})[_0x1e10('0x25')](function(_0x489d6f){_0x1a96aa[_0x1e10('0x22')]=_0x489d6f;if(_0x413510['query'][_0x1e10('0x42')]){_0x269693['include']=[{'all':!![]}];}return db[_0x1e10('0x54')][_0x1e10('0x43')](_0x269693);})[_0x1e10('0x25')](function(_0x28e642){_0x1a96aa[_0x1e10('0x44')]=_0x28e642;return _0x1a96aa;});}})[_0x1e10('0x25')](respondWithFilteredResult(_0x55d5d8,_0x269693))[_0x1e10('0x1a')](handleError(_0x55d5d8,null));};exports[_0x1e10('0x59')]=function(_0x85f01f,_0x285889){return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x85f01f['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x285889,null))[_0x1e10('0x25')](function(_0x3683d1){if(_0x3683d1){return _0x3683d1[_0x1e10('0x59')](_0x85f01f[_0x1e10('0x32')][_0x1e10('0x5a')]);}})['then'](respondWithStatusCode(_0x285889,null))[_0x1e10('0x1a')](handleError(_0x285889,null));};exports[_0x1e10('0x5b')]=function(_0x576645,_0x351904){if(_0x576645[_0x1e10('0x4a')]['id']){delete _0x576645[_0x1e10('0x4a')]['id'];}return db['ChatWebsite'][_0x1e10('0x48')]({'where':{'id':_0x576645[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x351904,null))[_0x1e10('0x25')](function(_0x5e05f5){if(_0x5e05f5){_0x576645['body'][_0x1e10('0x58')]=_0x5e05f5['id'];return db[_0x1e10('0x5c')]['create'](_0x576645[_0x1e10('0x4a')]);}})['then'](respondWithResult(_0x351904,null))[_0x1e10('0x1a')](handleError(_0x351904,null));};exports[_0x1e10('0x5d')]=function(_0x59c019,_0x1d0bab){var _0x5da079={'raw':![],'where':{}};var _0x4e2782={};var _0x20913f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1e10('0x56')]({'where':{'id':_0x59c019[_0x1e10('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d0bab,null))[_0x1e10('0x25')](function(_0x99556f){if(_0x99556f){_0x4e2782[_0x1e10('0x31')]=_[_0x1e10('0x46')](db[_0x1e10('0x5c')][_0x1e10('0x2f')]);_0x4e2782['query']=_[_0x1e10('0x46')](_0x59c019['query']);_0x4e2782[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x4e2782['model'],_0x4e2782[_0x1e10('0x32')]);_0x5da079[_0x1e10('0x35')]=_[_0x1e10('0x34')](_0x4e2782[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0x59c019['query'][_0x1e10('0x36')]));_0x5da079[_0x1e10('0x35')]=_0x5da079[_0x1e10('0x35')]['length']?_0x5da079[_0x1e10('0x35')]:_0x4e2782[_0x1e10('0x31')];if(!_0x59c019[_0x1e10('0x32')][_0x1e10('0x38')](_0x1e10('0x39'))){_0x5da079[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x59c019[_0x1e10('0x32')][_0x1e10('0x20')]);_0x5da079[_0x1e10('0x1f')]=qs[_0x1e10('0x1f')](_0x59c019[_0x1e10('0x32')][_0x1e10('0x1f')]);}_0x5da079[_0x1e10('0x57')]=qs[_0x1e10('0x3a')](_0x59c019[_0x1e10('0x32')][_0x1e10('0x3a')]);_0x5da079[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_[_0x1e10('0x3c')](_0x59c019[_0x1e10('0x32')],_0x4e2782['filters']));_0x5da079['where']['ChatWebsiteId']=_0x99556f['id'];if(_0x59c019[_0x1e10('0x32')][_0x1e10('0x3d')]){_0x5da079[_0x1e10('0x3b')]=_[_0x1e10('0x3e')](_0x5da079[_0x1e10('0x3b')],{'$or':_[_0x1e10('0x2d')](_0x5da079[_0x1e10('0x35')],function(_0xd4d6a1){var _0x14b558={};_0x14b558[_0xd4d6a1]={'$like':'%'+_0x59c019[_0x1e10('0x32')][_0x1e10('0x3d')]+'%'};return _0x14b558;})});}_0x5da079=_[_0x1e10('0x3e')]({},_0x5da079,_0x59c019['options']);return db['CannedAnswer'][_0x1e10('0x22')]({'where':_0x5da079['where']})[_0x1e10('0x25')](function(_0x44264e){_0x20913f['count']=_0x44264e;if(_0x59c019[_0x1e10('0x32')]['includeAll']){_0x5da079[_0x1e10('0x47')]=[{'all':!![]}];}return db[_0x1e10('0x5c')][_0x1e10('0x43')](_0x5da079);})[_0x1e10('0x25')](function(_0x2fa0fc){_0x20913f[_0x1e10('0x44')]=_0x2fa0fc;return _0x20913f;});}})[_0x1e10('0x25')](respondWithFilteredResult(_0x1d0bab,_0x5da079))[_0x1e10('0x1a')](handleError(_0x1d0bab,null));};exports['removeAnswers']=function(_0x5d1e86,_0xdf4c78){return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x5d1e86[_0x1e10('0x51')]['id']}})['then'](handleEntityNotFound(_0xdf4c78,null))[_0x1e10('0x25')](function(_0x1227d5){if(_0x1227d5){return _0x1227d5['removeAnswers'](_0x5d1e86[_0x1e10('0x32')][_0x1e10('0x5a')]);}})[_0x1e10('0x25')](respondWithStatusCode(_0xdf4c78,null))['catch'](handleError(_0xdf4c78,null));};exports[_0x1e10('0x5e')]=function(_0x235ccd,_0x5ad0dd){_0x235ccd[_0x1e10('0x4a')][_0x1e10('0x5f')]=_0x235ccd[_0x1e10('0x60')][_0x1e10('0x61')];return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x235ccd[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x5ad0dd,null))[_0x1e10('0x25')](saveUpdates(_0x235ccd[_0x1e10('0x4a')],null))[_0x1e10('0x25')](respondWithResult(_0x5ad0dd,null))[_0x1e10('0x1a')](handleError(_0x5ad0dd,null));};exports[_0x1e10('0x62')]=function(_0x48e75f,_0x1b49b8){_0x48e75f[_0x1e10('0x4a')][_0x1e10('0x63')]=_0x48e75f[_0x1e10('0x60')][_0x1e10('0x61')];return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x48e75f[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x1b49b8,null))[_0x1e10('0x25')](saveUpdates(_0x48e75f[_0x1e10('0x4a')],null))[_0x1e10('0x25')](respondWithResult(_0x1b49b8,null))['catch'](handleError(_0x1b49b8,null));};exports[_0x1e10('0x64')]=function(_0x59184e,_0x227b0c){_0x59184e[_0x1e10('0x4a')][_0x1e10('0x65')]=_0x59184e['file'][_0x1e10('0x61')];return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x59184e[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x227b0c,null))[_0x1e10('0x25')](saveUpdates(_0x59184e[_0x1e10('0x4a')],null))[_0x1e10('0x25')](respondWithResult(_0x227b0c,null))[_0x1e10('0x1a')](handleError(_0x227b0c,null));};exports[_0x1e10('0x66')]=function(_0x3a9aed,_0x11eb44){_0x3a9aed['body'][_0x1e10('0x67')]=_0x3a9aed[_0x1e10('0x60')]['filename'];return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x3a9aed['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x11eb44,null))[_0x1e10('0x25')](saveUpdates(_0x3a9aed[_0x1e10('0x4a')],null))['then'](respondWithResult(_0x11eb44,null))[_0x1e10('0x1a')](handleError(_0x11eb44,null));};exports[_0x1e10('0x68')]=function(_0x3a3765,_0x4d7d68){var _0x502bb0=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x6b'));var _0x426ac2={'where':{'id':_0x3a3765[_0x1e10('0x51')]['id']},'attributes':['id',_0x1e10('0x5f')],'raw':!![]};var _0x32f6de=![];return require(_0x1e10('0x6c'))['getLicense']()['then'](function(_0x1779db){if(_0x1779db){_0x32f6de=_0x1779db['custom'];}})[_0x1e10('0x25')](function(){return db['ChatWebsite'][_0x1e10('0x48')](_0x426ac2);})[_0x1e10('0x25')](handleEntityNotFound(_0x4d7d68,null))['then'](function(_0x51c148){if(_0x51c148){if(!_['isNil'](_0x51c148['sitepic'])){if(fs[_0x1e10('0x6d')](path[_0x1e10('0x69')](config[_0x1e10('0x6a')],'server/files/images/logos/',_0x51c148[_0x1e10('0x5f')]))&&_0x32f6de){_0x502bb0=path['join'](config[_0x1e10('0x6a')],'server/files/images/logos/',_0x51c148['sitepic']);}}return _0x4d7d68['download'](_0x502bb0);}})[_0x1e10('0x1a')](handleError(_0x4d7d68,null));};exports[_0x1e10('0x6e')]=function(_0x29ea7b,_0x1d549b){var _0x56c915=path[_0x1e10('0x69')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x36abb5={'where':{'id':_0x29ea7b['params']['id']},'attributes':['id',_0x1e10('0x63')],'raw':!![]};return db[_0x1e10('0x2e')][_0x1e10('0x48')](_0x36abb5)[_0x1e10('0x25')](handleEntityNotFound(_0x1d549b,null))['then'](function(_0x403af8){if(_0x403af8){if(!_[_0x1e10('0x6f')](_0x403af8[_0x1e10('0x63')])){if(fs[_0x1e10('0x6d')](path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x70'),_0x403af8['agentAvatar']))){_0x56c915=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x70'),_0x403af8[_0x1e10('0x63')]);}}return _0x1d549b['download'](_0x56c915);}})[_0x1e10('0x1a')](handleError(_0x1d549b,null));};exports['getCustomerAvatar']=function(_0x52287d,_0x4e7bdd){var _0x214ca7=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x71'));var _0x1ce708={'where':{'id':_0x52287d[_0x1e10('0x51')]['id']},'attributes':['id',_0x1e10('0x65'),_0x1e10('0x72')],'raw':!![]};return db[_0x1e10('0x2e')]['find'](_0x1ce708)[_0x1e10('0x25')](handleEntityNotFound(_0x4e7bdd,null))[_0x1e10('0x25')](function(_0x3ed6b7){if(_0x3ed6b7){if(!_[_0x1e10('0x6f')](_0x3ed6b7[_0x1e10('0x65')])){if(fs['existsSync'](path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x70'),_0x3ed6b7[_0x1e10('0x65')]))&&_0x3ed6b7[_0x1e10('0x72')]){_0x214ca7=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x70'),_0x3ed6b7[_0x1e10('0x65')]);}}return _0x4e7bdd[_0x1e10('0x73')](_0x214ca7);}})[_0x1e10('0x1a')](handleError(_0x4e7bdd,null));};exports[_0x1e10('0x74')]=function(_0x14574c,_0x525508){var _0x57ea9b=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x75'));var _0xfd675b={'where':{'id':_0x14574c[_0x1e10('0x51')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1e10('0x2e')]['find'](_0xfd675b)[_0x1e10('0x25')](handleEntityNotFound(_0x525508,null))[_0x1e10('0x25')](function(_0x3be1d1){if(_0x3be1d1){if(!_['isNil'](_0x3be1d1[_0x1e10('0x67')])){if(fs[_0x1e10('0x6d')](path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0x70'),_0x3be1d1['systemAvatar']))){_0x57ea9b=path[_0x1e10('0x69')](config['root'],_0x1e10('0x70'),_0x3be1d1['systemAvatar']);}}return _0x525508[_0x1e10('0x73')](_0x57ea9b);}})[_0x1e10('0x1a')](handleError(_0x525508,null));};exports[_0x1e10('0x76')]=function(_0x36ab13,_0x318566){var _0x404e59=require(_0x1e10('0x77'));var _0x3d1bed=new _0x404e59();var _0x438fff=_0x3d1bed[_0x1e10('0x78')](_0x36ab13[_0x1e10('0x79')][_0x1e10('0x7a')])[_0x1e10('0x7b')]();var _0x4ffc18={'body':_0x36ab13[_0x1e10('0x4a')],'channel':_0x1e10('0x7c')};var _0x1c3455=[];var _0x343e54=[];var _0x2cd32b={};var _0x4610f0=![];return db['CmContact']['describe']()[_0x1e10('0x25')](function(_0x9132ad){if(!_0x9132ad){throw new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x7f'));}_0x1c3455=_[_0x1e10('0x80')](_[_0x1e10('0x46')](_0x9132ad),[_0x1e10('0x81'),_0x1e10('0x82')]);_0x343e54=_[_0x1e10('0x80')](_[_0x1e10('0x46')](_0x9132ad),[_0x1e10('0x81'),'updatedAt',_0x1e10('0x83'),_0x1e10('0x84')]);if(_0x36ab13[_0x1e10('0x4a')]['id']){delete _0x36ab13[_0x1e10('0x4a')]['id'];}if(_['isNil'](_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x85')])){throw new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x86'));}if(_['isNil'](_0x36ab13['body'][_0x1e10('0x4a')])||_0x36ab13['body']['body']===''){throw new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x87'));}if(_['isNil'](_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x88')])){throw new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x89')+_0x343e54);}if(!_[_0x1e10('0x8a')](_0x343e54,_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x88')])){throw new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x8b')+_0x343e54);}_0x2cd32b[_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x88')]]=_0x36ab13['body'][_0x1e10('0x85')];})[_0x1e10('0x25')](function(){return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x36ab13['params']['id']},'include':[{'model':db[_0x1e10('0x8c')],'as':_0x1e10('0x8d'),'include':[{'model':db['CmContact'],'as':_0x1e10('0x8e'),'where':_0x2cd32b,'limit':0x1,'order':[[_0x1e10('0x82'),_0x1e10('0x8f')]]}]},{'model':db[_0x1e10('0x90')],'as':'Applications'}]});})[_0x1e10('0x25')](handleEntityNotFound(_0x318566,null))[_0x1e10('0x25')](function(_0x2e6ed8){if(_0x2e6ed8&&_0x2e6ed8[_0x1e10('0x8d')]){_0x4ffc18[_0x1e10('0x91')]=_0x2e6ed8;_0x4ffc18[_0x1e10('0x92')]=_0x2e6ed8[_0x1e10('0x93')];_0x4ffc18[_0x1e10('0x94')]=_0x2e6ed8['List'];_0x4ffc18['applications']=_[_0x1e10('0x95')](_0x4ffc18[_0x1e10('0x92')],[_0x1e10('0x96')],[_0x1e10('0x97')]);if(_0x4ffc18[_0x1e10('0x91')][_0x1e10('0x93')]){delete _0x4ffc18[_0x1e10('0x91')]['Applications'];}if(_0x4ffc18['account'][_0x1e10('0x8d')]&&_0x4ffc18[_0x1e10('0x91')][_0x1e10('0x8d')][_0x1e10('0x8e')]['length']){return _0x4ffc18[_0x1e10('0x91')][_0x1e10('0x8d')][_0x1e10('0x8e')][0x0];}var _0x5d90e0=_[_0x1e10('0xb')](_0x36ab13[_0x1e10('0x4a')],{'firstName':_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x85')],'ListId':_0x2e6ed8[_0x1e10('0x84')]});_0x5d90e0[_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x88')]]=_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x85')];return db[_0x1e10('0x98')][_0x1e10('0x49')](_0x5d90e0,{'fields':_0x1c3455,'raw':!![]});}})['then'](handleEntityNotFound(_0x318566,null))[_0x1e10('0x25')](function(_0x5d838e){_0x4ffc18[_0x1e10('0x99')]=_0x5d838e;var _0x375d75=_0x36ab13[_0x1e10('0x4a')]['customerIp'];if(_0x36ab13[_0x1e10('0x79')][_0x1e10('0x9a')]){_0x375d75=_0x36ab13['headers']['cf-connecting-ip'];}else if(_0x36ab13[_0x1e10('0x79')]['x-forwarded-for']){_0x375d75=_['first'](_0x36ab13[_0x1e10('0x79')]['x-forwarded-for'][_0x1e10('0x9b')](','));}if(_0x5d838e){var _0x583267={'ContactId':_0x5d838e['id'],'ChatWebsiteId':_0x36ab13[_0x1e10('0x51')]['id'],'from':(_0x5d838e['firstName']||'')+'\x20'+(_0x5d838e[_0x1e10('0x9c')]||''),'customerIp':_0x375d75,'customerPort':_0x36ab13[_0x1e10('0x79')]['x-real-port']?_0x36ab13[_0x1e10('0x79')][_0x1e10('0x9d')]:null,'referer':_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x9e')],'browserName':_0x438fff['browser'][_0x1e10('0x2a')]&&_0x438fff[_0x1e10('0x9f')][_0x1e10('0xa0')]?util[_0x1e10('0xa1')]('%s\x20%s',_0x438fff['browser'][_0x1e10('0x2a')],_0x438fff[_0x1e10('0x9f')][_0x1e10('0xa0')]):_0x1e10('0xa2'),'browserVersion':_0x438fff[_0x1e10('0x9f')]['version']||_0x1e10('0xa2'),'osName':util['format'](_0x1e10('0xa3'),_0x438fff['os'][_0x1e10('0x2a')],_0x438fff['os'][_0x1e10('0xa0')]),'osVersion':_0x438fff['os'][_0x1e10('0xa0')],'deviceModel':_0x438fff[_0x1e10('0xa4')][_0x1e10('0x31')]&&_0x438fff[_0x1e10('0xa4')][_0x1e10('0xa5')]?util[_0x1e10('0xa1')](_0x1e10('0xa6'),_0x438fff[_0x1e10('0xa4')][_0x1e10('0x31')],_0x438fff['device'][_0x1e10('0xa5')],_0x438fff['device'][_0x1e10('0x3f')]):null,'deviceVendor':_0x438fff[_0x1e10('0xa4')]['vendor'],'deviceType':_0x438fff[_0x1e10('0xa4')][_0x1e10('0x3f')],'formData':JSON[_0x1e10('0xa7')](_0x36ab13[_0x1e10('0x4a')])};var _0xd8cb55={'ChatWebsiteId':_0x36ab13['params']['id'],'closed':![]};if(_0x36ab13['body'][_0x1e10('0xa8')]){_0xd8cb55[_0x1e10('0xa8')]=_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xa8')];return db['ChatInteraction'][_0x1e10('0x48')]({'where':_0xd8cb55})['then'](function(_0x235b32){if(_0x235b32){return[_0x235b32,![]];}_0x583267[_0x1e10('0xa8')]=_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xa8')];_0x583267[_0x1e10('0xa9')]=_0x36ab13['body'][_0x1e10('0xa9')];return db['ChatInteraction']['create'](_0x583267)['then'](function(_0x417c35){return[_0x417c35,!![]];});});}_0xd8cb55[_0x1e10('0xaa')]=_0x5d838e['id'];if(_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xab')]&&_0x36ab13[_0x1e10('0x4a')]['interaction']['id']){_0xd8cb55['id']=_0x36ab13['body']['interaction']['id'];return db[_0x1e10('0xac')]['find']({'where':_0xd8cb55})[_0x1e10('0x25')](function(_0x1fa776){if(_0x1fa776){return[_0x1fa776,![]];}return db[_0x1e10('0xac')][_0x1e10('0x49')](_0x583267)[_0x1e10('0x25')](function(_0x57e1b1){return[_0x57e1b1,!![]];});});}return db[_0x1e10('0xac')]['create'](_0x583267)['then'](function(_0x4eed93){return[_0x4eed93,!![]];});}})[_0x1e10('0xad')](function(_0x48a17f,_0x46b352){if(_0x48a17f){_0x4610f0=_0x46b352;if(!_0x46b352){var _0x51205e={'from':(_0x4ffc18[_0x1e10('0x99')][_0x1e10('0xae')]||'')+'\x20'+(_0x4ffc18[_0x1e10('0x99')]['lastName']||'')};if(_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xa8')]&&_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xaf')]&&_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xa8')]!=_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xaf')]){_0x51205e[_0x1e10('0xa8')]=_0x36ab13[_0x1e10('0x4a')][_0x1e10('0xaf')];}return _0x48a17f[_0x1e10('0x24')](_0x51205e);}else{return _0x48a17f;}}})['then'](function(_0x2d1a69){_0x4ffc18[_0x1e10('0xab')]=_0x2d1a69[_0x1e10('0x27')]({'plain':!![]});_0x4ffc18[_0x1e10('0xab')][_0x1e10('0xb0')]=_0x4610f0;if(_0x4ffc18[_0x1e10('0xab')][_0x1e10('0xb0')]){if(_0x4ffc18[_0x1e10('0x91')][_0x1e10('0xb1')]){_0x4ffc18[_0x1e10('0x92')][_0x1e10('0xb2')]({'id':0x0,'priority':_0x4ffc18['applications']['length']+0x1,'app':_0x1e10('0xb3'),'appdata':_0x1e10('0xb4'),'interval':_0x1e10('0xb5')});}}return db[_0x1e10('0xb6')][_0x1e10('0x49')]({'body':_0x36ab13[_0x1e10('0x4a')][_0x1e10('0x4a')],'ChatWebsiteId':_0x36ab13['params']['id'],'ChatInteractionId':_0x2d1a69['id'],'direction':'in','ContactId':_0x4ffc18['contact']['id'],'AttachmentId':_0x36ab13['body'][_0x1e10('0xb7')]});})[_0x1e10('0x25')](function(_0x3b11f8){_0x4ffc18[_0x1e10('0x17')]=_0x3b11f8;if(_0x4ffc18[_0x1e10('0xab')]['UserId']){return db[_0x1e10('0xb8')][_0x1e10('0x48')]({'attributes':['id',_0x1e10('0x2a')],'where':{'id':_0x4ffc18[_0x1e10('0xab')][_0x1e10('0xb9')]}})[_0x1e10('0x25')](function(_0x169a9c){if(_0x169a9c){_0x4ffc18[_0x1e10('0x92')][_0x1e10('0xba')]({'id':0x0,'priority':0x0,'app':_0x1e10('0xbb'),'appdata':_0x169a9c[_0x1e10('0x2a')]+','+(_0x4ffc18[_0x1e10('0x91')][_0x1e10('0xbc')]||0xa),'interval':'*,*,*,*'});_0x4ffc18[_0x1e10('0xbd')]=!![];}return respondWithRpcPromise('Start',_0x1e10('0xbe'),_0x4ffc18);});}return respondWithRpcPromise('Start',_0x1e10('0xbe'),_0x4ffc18);})[_0x1e10('0x25')](function(_0x4d3aff){respondWithRpcPromise('EventManager',_0x1e10('0xbf'),{'event':_0x1e10('0x76'),'message':_0x4d3aff},client9002);return _0x4d3aff;})[_0x1e10('0x25')](respondWithResult(_0x318566,null))['catch'](handleError(_0x318566,null));};exports[_0x1e10('0xc0')]=function(_0x133c5f,_0x1aad5d){var _0x6072a0,_0x40f254,_0x27f2e3;var _0x46e85a=[];var _0x260b86={};var _0x3fd858=_0x133c5f['files']||[];var _0x333d35=[];var _0x13276d;return db[_0x1e10('0x98')][_0x1e10('0x52')]()[_0x1e10('0x25')](function(_0x179d9b){if(!_0x179d9b){throw new db[(_0x1e10('0x7d'))]['ValidationError'](_0x1e10('0x7f'));}_0x46e85a=_['difference'](_[_0x1e10('0x46')](_0x179d9b),['createdAt','updatedAt',_0x1e10('0x83'),_0x1e10('0x84')]);if(_0x133c5f[_0x1e10('0x4a')]['id']){delete _0x133c5f['body']['id'];}if(_[_0x1e10('0x6f')](_0x133c5f[_0x1e10('0x4a')]['from'])){throw _0x1aad5d[_0x1e10('0x1c')](0x1f4)[_0x1e10('0x2b')](new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0x86')));}if(_[_0x1e10('0x6f')](_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x4a')])||_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x4a')]===''){throw _0x1aad5d['status'](0x1f4)['send'](new db['Sequelize'][(_0x1e10('0x7e'))](_0x1e10('0x87')));}if(_[_0x1e10('0x6f')](_0x133c5f[_0x1e10('0x4a')]['mapKeyOffline'])){throw _0x1aad5d[_0x1e10('0x1c')](0x1f4)['send'](new db[(_0x1e10('0x7d'))]['ValidationError'](_0x1e10('0xc1')+_0x46e85a));}if(!_[_0x1e10('0x8a')](_0x46e85a,_0x133c5f[_0x1e10('0x4a')][_0x1e10('0xc2')])){throw _0x1aad5d[_0x1e10('0x1c')](0x1f4)[_0x1e10('0x2b')](new db[(_0x1e10('0x7d'))][(_0x1e10('0x7e'))](_0x1e10('0xc3')+_0x46e85a));}_0x260b86[_0x133c5f[_0x1e10('0x4a')][_0x1e10('0xc2')]]=_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x85')];})[_0x1e10('0x25')](function(){return db['ChatWebsite'][_0x1e10('0x48')]({'where':{'id':_0x133c5f[_0x1e10('0x51')]['id']},'include':[{'model':db[_0x1e10('0x8c')],'as':'List'},{'model':db[_0x1e10('0xc4')],'as':'MailAccount'}]});})[_0x1e10('0x25')](handleEntityNotFound(_0x1aad5d,null))[_0x1e10('0x25')](function(_0x3313e7){if(_0x3313e7&&_0x3313e7[_0x1e10('0x8d')]){_0x40f254=_0x3313e7;var _0x8d8a5f=_[_0x1e10('0xb')](_0x133c5f[_0x1e10('0x4a')],{'firstName':_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x85')],'phone':_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x85')],'ListId':_0x3313e7[_0x1e10('0x84')]});_0x8d8a5f[_0x133c5f[_0x1e10('0x4a')]['mapKeyOffline']]=_0x133c5f['body'][_0x1e10('0x85')];return db[_0x1e10('0x98')]['findOrCreate']({'where':_0x260b86,'defaults':_0x8d8a5f});}})[_0x1e10('0xad')](function(_0x5b5e06){if(_0x5b5e06){_0x27f2e3=_0x5b5e06;var _0x3406c8=fs['readFileSync'](path[_0x1e10('0x69')](config['root'],_0x1e10('0xc5')),_0x1e10('0xc6'));var _0x4944f2=ejs[_0x1e10('0xc7')](_0x3406c8,{'body':_[_0x1e10('0xc8')](_0x133c5f[_0x1e10('0x4a')][_0x1e10('0x4a')]),'bodyTitle':_0x40f254[_0x1e10('0xc9')]});return db['ChatOfflineMessage'][_0x1e10('0x49')]({'body':_0x4944f2,'plainBody':htmlToText[_0x1e10('0xca')](_0x4944f2),'ContactId':_0x5b5e06['id'],'ChatWebsiteId':_0x40f254['id']});}})['then'](function(_0x1665b7){_0x13276d=_0x1665b7;if(_0x3fd858['length']){var _0x58d7e1=_0x3fd858[_0x1e10('0x2d')](function(_0x341fb1){return{'name':_0x341fb1[_0x1e10('0xcb')],'basename':_0x341fb1[_0x1e10('0x61')],'type':_0x341fb1[_0x1e10('0xcc')],'ChatOfflineMessageId':_0x1665b7['id']};});_0x333d35=_0x58d7e1[_0x1e10('0x2d')](_0x487614=>{var _0x281701={'filename':_0x487614['name'],'path':path[_0x1e10('0x69')](config[_0x1e10('0x6a')],_0x1e10('0xcd'),_0x1e10('0xce'),'attachments',_0x1e10('0xcf'),_0x487614[_0x1e10('0xd0')])};return _0x281701;});if(!_0x40f254['openNewInteraction']){return db['sequelize'][_0x1e10('0xd1')](function(_0x13339d){return db[_0x1e10('0xd2')]['bulkCreate'](_0x58d7e1,{'transaction':_0x13339d});});}}})[_0x1e10('0x25')](function(){if(_0x13276d){_0x6072a0=_0x13276d;return db[_0x1e10('0xc4')][_0x1e10('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x1e10('0xd3')],'as':_0x1e10('0xd4'),'raw':!![],'include':[{'model':db[_0x1e10('0xd5')],'as':_0x1e10('0xd5'),'raw':!![]}]}]});}})[_0x1e10('0x25')](function(_0x2d6a44){if(_0x2d6a44&&_0x2d6a44['Smtp']&&_0x40f254[_0x1e10('0xd6')]&&_0x40f254[_0x1e10('0xd7')]){var _0x4609af=_0x2d6a44[_0x1e10('0xd8')]();return respondWithRpcPromise(_0x1e10('0xd9'),_0x1e10('0xda'),{'account':_0x4609af,'message':{'from':util[_0x1e10('0xa1')](_0x1e10('0xdb'),_0x2d6a44[_0x1e10('0x2a')],_0x2d6a44[_0x1e10('0xdc')]||_0x2d6a44[_0x1e10('0xd4')]['user']),'to':_0x40f254['forwardOfflineAddress'],'subject':_0x40f254['offlineMessageSubject'],'html':_0x6072a0['body'],'attachments':_0x333d35}},client9003)[_0x1e10('0x25')](function(){return _0x6072a0;})[_0x1e10('0x1a')](function(_0x260134){logger[_0x1e10('0x15')](_0x260134);});}})[_0x1e10('0x25')](function(){if(_0x40f254&&_0x40f254[_0x1e10('0xdd')]&&_0x40f254[_0x1e10('0xde')]){var _0x406861=[];if(_0x3fd858['length']){_0x406861=_0x3fd858[_0x1e10('0x2d')](function(_0x5a90e4){return{'name':_0x5a90e4[_0x1e10('0xcb')],'basename':_0x5a90e4[_0x1e10('0x61')],'type':_0x5a90e4[_0x1e10('0xcc')],'ChatOfflineMessageId':_0x13276d['id']};});}var _0x37c1f8;if(!_['isNil'](_0x40f254[_0x1e10('0xdf')])){var _0x18f317=_[_0x1e10('0x2d')](_0x133c5f['body'],function(_0x2231d8){return _0x2231d8;});var _0x527458=_[_0x1e10('0xe0')](_0x18f317)[0x0];var _0x5631a7=_['mapValues'](_0x527458,function(_0x1e1a57){return _0x1e1a57;});_0x37c1f8=_0x5631a7[0x1][_0x40f254[_0x1e10('0xdf')]];}var _0xd9ce61={'from':_0x27f2e3['email'],'firstName':_0x27f2e3[_0x1e10('0xae')],'lastName':_0x27f2e3[_0x1e10('0x9c')],'mapKey':_0x1e10('0xdc'),'message':{'from':_0x27f2e3[_0x1e10('0xdc')],'to':_0x40f254[_0x1e10('0xc4')][_0x1e10('0xdc')],'cc':'','subject':_['isNil'](_0x37c1f8)?_0x40f254[_0x1e10('0xe1')]:_0x37c1f8,'messageId':'','sentAt':new Date(),'attach':_0x406861[_0x1e10('0x37')],'attachments':_0x406861,'originChannel':_0x1e10('0xe2'),'ChatWebsiteId':_0x40f254['id'],'ChatOfflineMessageId':_0x6072a0['id'],'originTo':_0x40f254[_0x1e10('0xc4')][_0x1e10('0xdc')]},'body':_0x6072a0[_0x1e10('0x4a')]};var _0x56fc03={'account':{'id':_0x40f254[_0x1e10('0xde')]},'body':_0xd9ce61,'log':_0x1e10('0xe3')};return respondWithRpcPromise('NotifyMailAccount',_0x1e10('0xe4'),_0x56fc03,client9001)[_0x1e10('0x25')](function(){return _0x6072a0;})[_0x1e10('0x1a')](function(_0xbef018){logger['error'](_0xbef018);});}return;})[_0x1e10('0x25')](function(){if(_0x6072a0){return _0x6072a0;}})['then'](respondWithResult(_0x1aad5d,null))[_0x1e10('0x1a')](function(_0x55fbb6){logger[_0x1e10('0x15')](_0x1e10('0x1a'),_0x55fbb6);for(var _0x22526f of _0x3fd858){var _0x5d54ec=path[_0x1e10('0x69')](config[_0x1e10('0x6a')],'server',_0x1e10('0xce'),_0x1e10('0xe5'),_0x1e10('0xcf'),_0x22526f[_0x1e10('0x61')]);fs_extra['remove'](_0x5d54ec)['catch'](function(_0x1fb70){logger['error'](_0x1e10('0xe6'),_0x5d54ec,_0x1fb70);});}});};exports[_0x1e10('0xe7')]=function(_0x51a8f5,_0x32c019){return db[_0x1e10('0xac')][_0x1e10('0x48')]({'where':{'id':_0x51a8f5['params']['id']}})['then'](handleEntityNotFound(_0x32c019,null))[_0x1e10('0x25')](function(_0x122acc){if(_0x122acc){return _0x122acc['addInteraction'](_0x51a8f5[_0x1e10('0x4a')]['ids'],_[_0x1e10('0xe8')](_0x51a8f5[_0x1e10('0x4a')],[_0x1e10('0x5a'),'id'])||{});}})[_0x1e10('0x25')](respondWithResult(_0x32c019,null))[_0x1e10('0x1a')](handleError(_0x32c019,null));};exports['getInteractions']=function(_0x594c5b,_0x2087a7){var _0x17231b={'raw':![],'where':{}};var _0x38a8ad={};var _0x141479={'count':0x0,'rows':[]};return db[_0x1e10('0x2e')]['findOne']({'where':{'id':_0x594c5b[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x2087a7,null))[_0x1e10('0x25')](function(_0x13f8fd){if(_0x13f8fd){_0x38a8ad[_0x1e10('0x31')]=_['keys'](db[_0x1e10('0xac')][_0x1e10('0x2f')]);_0x38a8ad[_0x1e10('0x32')]=_[_0x1e10('0x46')](_0x594c5b[_0x1e10('0x32')]);_0x38a8ad[_0x1e10('0x33')]=_['intersection'](_0x38a8ad[_0x1e10('0x31')],_0x38a8ad['query']);_0x17231b[_0x1e10('0x35')]=_['intersection'](_0x38a8ad[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0x594c5b[_0x1e10('0x32')][_0x1e10('0x36')]));_0x17231b[_0x1e10('0x35')]=_0x17231b['attributes']['length']?_0x17231b[_0x1e10('0x35')]:_0x38a8ad[_0x1e10('0x31')];if(!_0x594c5b[_0x1e10('0x32')]['hasOwnProperty']('nolimit')){_0x17231b[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x594c5b[_0x1e10('0x32')][_0x1e10('0x20')]);_0x17231b[_0x1e10('0x1f')]=qs['offset'](_0x594c5b[_0x1e10('0x32')]['offset']);}_0x17231b[_0x1e10('0x57')]=qs['sort'](_0x594c5b['query']['sort']);_0x17231b['where']=qs[_0x1e10('0x33')](_[_0x1e10('0x3c')](_0x594c5b[_0x1e10('0x32')],_0x38a8ad['filters']));_0x17231b[_0x1e10('0x3b')][_0x1e10('0x58')]=_0x13f8fd['id'];if(_0x594c5b[_0x1e10('0x32')][_0x1e10('0x3d')]){_0x17231b[_0x1e10('0x3b')]=_['merge'](_0x17231b[_0x1e10('0x3b')],{'$or':_[_0x1e10('0x2d')](_0x17231b[_0x1e10('0x35')],function(_0x93a847){var _0x2d78ef={};_0x2d78ef[_0x93a847]={'$like':'%'+_0x594c5b[_0x1e10('0x32')][_0x1e10('0x3d')]+'%'};return _0x2d78ef;})});}_0x17231b=_['merge']({},_0x17231b,_0x594c5b['options']);return db[_0x1e10('0xac')][_0x1e10('0x22')]({'where':_0x17231b[_0x1e10('0x3b')]})[_0x1e10('0x25')](function(_0x32f476){_0x141479[_0x1e10('0x22')]=_0x32f476;if(_0x594c5b[_0x1e10('0x32')][_0x1e10('0x42')]){_0x17231b[_0x1e10('0x47')]=[{'model':db[_0x1e10('0x98')],'as':_0x1e10('0xe9'),'required':![]},{'model':db[_0x1e10('0xb8')],'as':_0x1e10('0xea'),'attributes':[_0x1e10('0x2a'),'fullname',_0x1e10('0xeb')],'required':![]},{'model':db['Tag'],'as':_0x1e10('0xec'),'attributes':['id',_0x1e10('0x2a'),_0x1e10('0xed')],'where':_0x594c5b[_0x1e10('0x32')][_0x1e10('0xee')]?{'id':_0x594c5b[_0x1e10('0x32')][_0x1e10('0xee')]}:undefined,'required':_0x594c5b['query'][_0x1e10('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0x1e10('0x43')](_0x17231b);})[_0x1e10('0x25')](function(_0x177538){_0x141479[_0x1e10('0x44')]=_0x177538;return _0x141479;});}})[_0x1e10('0x25')](respondWithFilteredResult(_0x2087a7,_0x17231b))[_0x1e10('0x1a')](handleError(_0x2087a7,null));};function iftimePromise(_0x37c5f6,_0x237761){return respondWithRpcPromise('Command',_0x1e10('0xef'),{'command':_0x237761['timezone']?util[_0x1e10('0xa1')]('iftime\x20%s,%s',_0x37c5f6[_0x1e10('0xf0')],_0x237761[_0x1e10('0xf1')]):util[_0x1e10('0xa1')](_0x1e10('0xf2'),_0x37c5f6['interval'])},client9002)['then'](function(_0x2b48af){var _0x388bc8=_0x2b48af&&_0x2b48af['indexOf']('true')>=0x0?!![]:![];logger[_0x1e10('0x18')](_0x1e10('0xf3'),_0x237761['id'],_0x37c5f6['id'],_0x37c5f6['interval'],_0x388bc8?_0x1e10('0xf4'):'OFFLINE',_0x237761[_0x1e10('0xf1')]?_0x237761['timezone']:_0x1e10('0xf5'));return _0x388bc8;})[_0x1e10('0x1a')](function(_0xf9b889){logger[_0x1e10('0x15')](_0x1e10('0xf3'),_0x237761['id'],_0x37c5f6['id'],_0x37c5f6[_0x1e10('0xf0')],util[_0x1e10('0xf6')](_0xf9b889,{'showHidden':![],'depth':null}),_0x237761[_0x1e10('0xf1')]?_0x237761[_0x1e10('0xf1')]:_0x1e10('0xf5'));return![];});}exports[_0x1e10('0xef')]=function(_0x4022e0,_0x413a75){var _0x2cfebc=0x0;var _0xb0853d=0x0;var _0x66527e=![];var _0x556ce2;var _0x3c2b31;return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x4022e0['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x1e10('0xf7')],'as':_0x1e10('0xf8'),'attributes':['id',_0x1e10('0xf0')],'raw':!![]}]}]})[_0x1e10('0x25')](handleEntityNotFound(_0x413a75,null))[_0x1e10('0x25')](function(_0x11c4e4){if(_0x11c4e4){_0x556ce2=_0x11c4e4;return _0x11c4e4[_0x1e10('0xf9')]({'raw':!![]});}})[_0x1e10('0x25')](function(_0x4e504e){if(_0x556ce2){if(_0x4e504e){_0x3c2b31=_0x4e504e;}}return require('../../config/license/util')[_0x1e10('0xfa')]();})[_0x1e10('0x25')](function(_0xc10bb3){if(_0xc10bb3){_0xb0853d=_0xc10bb3[_0x1e10('0xfb')];_0x66527e=_0xc10bb3[_0x1e10('0xfc')];}})[_0x1e10('0x25')](function(){return db[_0x1e10('0xac')][_0x1e10('0x22')]({'where':{'closed':![]}});})['then'](function(_0x5a3812){_0x2cfebc=_0x5a3812;if(_0xb0853d&&_0x5a3812>_0xb0853d){return db[_0x1e10('0xfd')][_0x1e10('0x56')]({'where':{'id':0x1}})['then'](function(_0xecb7d7){if(_0xecb7d7){_0xecb7d7[_0x1e10('0xfe')]('chatLicenseExceeded');}});}})[_0x1e10('0x25')](function(){if(_0x556ce2[_0x1e10('0xf7')]&&_0x556ce2['Interval'][_0x1e10('0xf8')]){var _0x332829=[];for(var _0x405f49=0x0;_0x405f49<_0x556ce2['Interval'][_0x1e10('0xf8')]['length'];_0x405f49++){var _0x59cb61=_0x556ce2['Interval'][_0x1e10('0xf8')][_0x405f49][_0x1e10('0x27')]({'plain':!![]});_0x332829[_0x1e10('0xb2')](iftimePromise(_0x59cb61,_0x556ce2));}return BPromise[_0x1e10('0xff')](_0x332829)[_0x1e10('0x25')](function(_0x4b007e){return _[_0x1e10('0x100')](_0x4b007e);});}else{return!![];}})[_0x1e10('0x25')](function(_0x318993){var _0x537f2d=fs['readFileSync'](path[_0x1e10('0x69')](config[_0x1e10('0x6a')],'server/files/chat/iframe.ejs'),_0x1e10('0xc6'));var _0x2eed22={'remote':_0x556ce2[_0x1e10('0x101')],'query':querystring['stringify'](_[_0x1e10('0x3e')](_0x556ce2[_0x1e10('0x27')]({'plain':!![]}),{'customerIp':_0x4022e0[_0x1e10('0x79')]['x-forwarded-for']||_0x4022e0[_0x1e10('0x79')]['x-real-ip']||_0x4022e0['connection'][_0x1e10('0x102')]||_0x4022e0['ip'],'referer':_0x4022e0[_0x1e10('0x79')][_0x1e10('0x9e')],'openedInteractions':_0x2cfebc,'maxInteractions':_0xb0853d,'virtual':_0x66527e[_0x1e10('0xfb')],'online':_0x318993,'custom':_0x66527e}))[_0x1e10('0x103')](/'/g,'\x5c\x27')};_0x413a75[_0x1e10('0x2b')](ejs[_0x1e10('0xc7')](Mustache[_0x1e10('0xc7')](_0x537f2d,_0x2eed22),{'proactiveActions':_0x3c2b31,'alignment':_0x556ce2['alignment'],'verticalAlignment':_0x556ce2['verticalAlignment'],'div_color':_0x556ce2[_0x1e10('0xed')],'labelText':_0x556ce2['labelText'],'text_color':_0x556ce2[_0x1e10('0x104')],'text_button_color':_0x556ce2[_0x1e10('0x105')],'button_color':_0x556ce2[_0x1e10('0x106')],'background_color':_0x556ce2[_0x1e10('0x107')],'hideWhenOffline':_0x556ce2[_0x1e10('0x108')],'interval':_0x556ce2['IntervalId']}));})[_0x1e10('0x1a')](handleError(_0x413a75,null));};exports[_0x1e10('0x109')]=function(_0x1c4a59,_0x185d36){var _0x556ec3=_0x1c4a59[_0x1e10('0x51')]['id'];var _0x799a1f=_0x1c4a59[_0x1e10('0x4a')];var _0x10de51=0xc8;var _0x30233f=null;return db['sequelize'][_0x1e10('0xd1')]({'isolationLevel':db[_0x1e10('0x10a')][_0x1e10('0x10b')]['ISOLATION_LEVELS'][_0x1e10('0x10c')]},function(_0x3fd8aa){return db[_0x1e10('0x2e')][_0x1e10('0x56')]({'where':{'id':_0x556ec3},'transaction':_0x3fd8aa})['then'](function(_0x35cbd3){if(_0x35cbd3){return db[_0x1e10('0x90')][_0x1e10('0x26')]({'where':{'ChatWebsiteId':_0x556ec3},'transaction':_0x3fd8aa})[_0x1e10('0x25')](function(){var _0x3c766c=_[_0x1e10('0x2d')](_0x799a1f,function(_0x408ec2){_0x408ec2[_0x1e10('0x58')]=_0x556ec3;return _0x408ec2;});return db[_0x1e10('0x90')][_0x1e10('0x10d')](_0x3c766c,{'transaction':_0x3fd8aa});});}else{_0x10de51=0x194;_0x30233f=[];}});})[_0x1e10('0x25')](function(){if(_0x10de51!==0x194){return db[_0x1e10('0x90')][_0x1e10('0x10e')]({'where':{'ChatWebsiteId':_0x556ec3},'order':_0x1e10('0x96')})[_0x1e10('0x25')](function(_0x438d54){_0x30233f=_0x438d54;});}})[_0x1e10('0x1a')](function(_0x10f27a){_0x10de51=0x1f4;logger[_0x1e10('0x15')](_0x10f27a[_0x1e10('0x29')]);if(_0x10f27a[_0x1e10('0x2a')]){delete _0x10f27a[_0x1e10('0x2a')];}_0x30233f=_0x10f27a;})[_0x1e10('0x10f')](function(){if(_0x30233f===null){_0x185d36[_0x1e10('0x1b')](_0x10de51);}else{if(_0x10de51===0x1f4){_0x185d36[_0x1e10('0x1c')](_0x10de51)['send'](_0x30233f);}else{_0x185d36[_0x1e10('0x1c')](_0x10de51)[_0x1e10('0x1e')](_0x30233f);}}});};exports[_0x1e10('0x110')]=function(_0x3bc654,_0x3e2267){var _0x29c2bb={};var _0x1729fb={};var _0x43e6b5;var _0x33b630;return db[_0x1e10('0x2e')][_0x1e10('0x56')]({'where':{'id':_0x3bc654['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x3e2267,null))[_0x1e10('0x25')](function(_0x2ed35f){if(_0x2ed35f){_0x43e6b5=_0x2ed35f;_0x1729fb[_0x1e10('0x31')]=_[_0x1e10('0x46')](db[_0x1e10('0x90')][_0x1e10('0x2f')]);_0x1729fb[_0x1e10('0x32')]=_[_0x1e10('0x46')](_0x3bc654['query']);_0x1729fb[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x1729fb['model'],_0x1729fb[_0x1e10('0x32')]);_0x29c2bb[_0x1e10('0x35')]=_[_0x1e10('0x34')](_0x1729fb[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0x3bc654[_0x1e10('0x32')][_0x1e10('0x36')]));_0x29c2bb['attributes']=_0x29c2bb[_0x1e10('0x35')][_0x1e10('0x37')]?_0x29c2bb[_0x1e10('0x35')]:_0x1729fb[_0x1e10('0x31')];_0x29c2bb[_0x1e10('0x57')]=qs[_0x1e10('0x3a')](_0x3bc654['query']['sort']);_0x29c2bb[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_['pick'](_0x3bc654[_0x1e10('0x32')],_0x1729fb[_0x1e10('0x33')]));if(_0x3bc654['query'][_0x1e10('0x3d')]){_0x29c2bb['where']=_[_0x1e10('0x3e')](_0x29c2bb[_0x1e10('0x3b')],{'$or':_['map'](_0x29c2bb[_0x1e10('0x35')],function(_0xfe7309){var _0x2300a2={};_0x2300a2[_0xfe7309]={'$like':'%'+_0x3bc654['query']['filter']+'%'};return _0x2300a2;})});}_0x29c2bb=_[_0x1e10('0x3e')]({},_0x29c2bb,_0x3bc654['options']);return _0x43e6b5['getApplications'](_0x29c2bb);}})[_0x1e10('0x25')](function(_0x41cb8a){if(_0x41cb8a){_0x33b630=_0x41cb8a['length'];if(!_0x3bc654[_0x1e10('0x32')][_0x1e10('0x38')](_0x1e10('0x39'))){_0x29c2bb[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x3bc654[_0x1e10('0x32')][_0x1e10('0x20')]);_0x29c2bb[_0x1e10('0x1f')]=qs[_0x1e10('0x1f')](_0x3bc654[_0x1e10('0x32')][_0x1e10('0x1f')]);}return _0x43e6b5[_0x1e10('0x110')](_0x29c2bb);}})[_0x1e10('0x25')](function(_0x4d6acd){if(_0x4d6acd){return _0x4d6acd?{'count':_0x33b630,'rows':_0x4d6acd}:null;}})['then'](respondWithResult(_0x3e2267,null))['catch'](handleError(_0x3e2267,null));};exports[_0x1e10('0x111')]=function(_0x199b34,_0x5f0d20){return db['chatProactiveAction'][_0x1e10('0x48')]({'where':{'id':_0x199b34[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x5f0d20,null))[_0x1e10('0x25')](function(_0x1bf652){if(_0x1bf652){return _0x1bf652[_0x1e10('0x111')](_0x199b34[_0x1e10('0x4a')][_0x1e10('0x5a')],_[_0x1e10('0xe8')](_0x199b34[_0x1e10('0x4a')],[_0x1e10('0x5a'),'id'])||{});}})[_0x1e10('0x25')](respondWithResult(_0x5f0d20,null))[_0x1e10('0x1a')](handleError(_0x5f0d20,null));};exports['getProactiveActions']=function(_0x1203a5,_0x8ec1fc){var _0x2b7d9b={};var _0x5c26d8={};var _0xa38bec;var _0x473673;return db['ChatWebsite'][_0x1e10('0x56')]({'where':{'id':_0x1203a5[_0x1e10('0x51')]['id']}})['then'](handleEntityNotFound(_0x8ec1fc,null))['then'](function(_0x25b77a){if(_0x25b77a){_0xa38bec=_0x25b77a;_0x5c26d8[_0x1e10('0x31')]=_[_0x1e10('0x46')](db['ChatProactiveAction'][_0x1e10('0x2f')]);_0x5c26d8[_0x1e10('0x32')]=_[_0x1e10('0x46')](_0x1203a5[_0x1e10('0x32')]);_0x5c26d8['filters']=_[_0x1e10('0x34')](_0x5c26d8['model'],_0x5c26d8[_0x1e10('0x32')]);_0x2b7d9b[_0x1e10('0x35')]=_[_0x1e10('0x34')](_0x5c26d8['model'],qs[_0x1e10('0x36')](_0x1203a5[_0x1e10('0x32')]['fields']));_0x2b7d9b[_0x1e10('0x35')]=_0x2b7d9b[_0x1e10('0x35')][_0x1e10('0x37')]?_0x2b7d9b[_0x1e10('0x35')]:_0x5c26d8[_0x1e10('0x31')];_0x2b7d9b[_0x1e10('0x57')]=qs[_0x1e10('0x3a')](_0x1203a5[_0x1e10('0x32')]['sort']);_0x2b7d9b[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_['pick'](_0x1203a5[_0x1e10('0x32')],_0x5c26d8['filters']));if(_0x1203a5['query'][_0x1e10('0x3d')]){_0x2b7d9b[_0x1e10('0x3b')]=_[_0x1e10('0x3e')](_0x2b7d9b[_0x1e10('0x3b')],{'$or':_[_0x1e10('0x2d')](_0x2b7d9b['attributes'],function(_0x3e6c1a){var _0x598298={};_0x598298[_0x3e6c1a]={'$like':'%'+_0x1203a5['query'][_0x1e10('0x3d')]+'%'};return _0x598298;})});}_0x2b7d9b=_[_0x1e10('0x3e')]({},_0x2b7d9b,_0x1203a5[_0x1e10('0x41')]);return _0xa38bec[_0x1e10('0xf9')](_0x2b7d9b);}})['then'](function(_0x8e5c1e){if(_0x8e5c1e){_0x473673=_0x8e5c1e[_0x1e10('0x37')];if(!_0x1203a5[_0x1e10('0x32')][_0x1e10('0x38')]('nolimit')){_0x2b7d9b[_0x1e10('0x20')]=qs[_0x1e10('0x20')](_0x1203a5[_0x1e10('0x32')][_0x1e10('0x20')]);_0x2b7d9b[_0x1e10('0x1f')]=qs[_0x1e10('0x1f')](_0x1203a5[_0x1e10('0x32')][_0x1e10('0x1f')]);}return _0xa38bec['getProactiveActions'](_0x2b7d9b);}})[_0x1e10('0x25')](function(_0x31031e){if(_0x31031e){return _0x31031e?{'count':_0x473673,'rows':_0x31031e}:null;}})[_0x1e10('0x25')](respondWithResult(_0x8ec1fc,null))[_0x1e10('0x1a')](handleError(_0x8ec1fc,null));};exports['getFields']=function(_0x484550,_0x9650dd){var _0x86c66f=_0x484550['query'][_0x1e10('0x112')]==='false'?_0x1e10('0x113'):'onlineForm';return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'attributes':['id',_0x86c66f],'where':{'id':_0x484550[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x9650dd,null))[_0x1e10('0x25')](function(_0x7caaed){if(_0x7caaed){var _0x796570=_0x7caaed[_0x86c66f];var _0x1ae831=_0x796570&&_0x796570['items']?_0x796570[_0x1e10('0x114')]:[];_0x9650dd[_0x1e10('0x2b')]({'fromKey':_[_0x1e10('0x6f')](_0x796570['fromKey'])?undefined:_0x796570[_0x1e10('0x115')],'count':_0x1ae831[_0x1e10('0x37')],'rows':_0x1ae831});}})[_0x1e10('0x1a')](handleError(_0x9650dd,null));};exports[_0x1e10('0x116')]=function(_0xc5f6c,_0x54f232){var _0x3ba04c={'raw':![],'where':{}};var _0x3b37d9={};var _0x5e40d0={'count':0x0,'rows':[]};return db[_0x1e10('0x2e')][_0x1e10('0x56')]({'where':{'id':_0xc5f6c['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x54f232,null))[_0x1e10('0x25')](function(_0x1dcde5){if(_0x1dcde5){_0x3b37d9[_0x1e10('0x31')]=_['keys'](db[_0x1e10('0x117')][_0x1e10('0x2f')]);_0x3b37d9[_0x1e10('0x32')]=_[_0x1e10('0x46')](_0xc5f6c[_0x1e10('0x32')]);_0x3b37d9[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x3b37d9['model'],_0x3b37d9[_0x1e10('0x32')]);_0x3ba04c['attributes']=_[_0x1e10('0x34')](_0x3b37d9[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0xc5f6c[_0x1e10('0x32')][_0x1e10('0x36')]));_0x3ba04c[_0x1e10('0x35')]=_0x3ba04c[_0x1e10('0x35')][_0x1e10('0x37')]?_0x3ba04c[_0x1e10('0x35')]:_0x3b37d9[_0x1e10('0x31')];if(!_0xc5f6c[_0x1e10('0x32')][_0x1e10('0x38')](_0x1e10('0x39'))){_0x3ba04c['limit']=qs[_0x1e10('0x20')](_0xc5f6c[_0x1e10('0x32')][_0x1e10('0x20')]);_0x3ba04c[_0x1e10('0x1f')]=qs[_0x1e10('0x1f')](_0xc5f6c['query'][_0x1e10('0x1f')]);}_0x3ba04c['order']=qs[_0x1e10('0x3a')](_0xc5f6c['query']['sort']);_0x3ba04c[_0x1e10('0x3b')]=qs[_0x1e10('0x33')](_[_0x1e10('0x3c')](_0xc5f6c[_0x1e10('0x32')],_0x3b37d9['filters']));_0x3ba04c['where'][_0x1e10('0x58')]=_0x1dcde5['id'];if(_0xc5f6c[_0x1e10('0x32')][_0x1e10('0x3d')]){_0x3ba04c[_0x1e10('0x3b')]=_[_0x1e10('0x3e')](_0x3ba04c[_0x1e10('0x3b')],{'$or':_['map'](_0x3ba04c[_0x1e10('0x35')],function(_0x486d25){var _0x457f1e={};_0x457f1e[_0x486d25]={'$like':'%'+_0xc5f6c[_0x1e10('0x32')]['filter']+'%'};return _0x457f1e;})});}_0x3ba04c=_[_0x1e10('0x3e')]({},_0x3ba04c,_0xc5f6c[_0x1e10('0x41')]);return db['ChatOfflineMessage']['count']({'where':_0x3ba04c['where']})[_0x1e10('0x25')](function(_0x177d43){_0x5e40d0['count']=_0x177d43;if(_0xc5f6c[_0x1e10('0x32')][_0x1e10('0x42')]){_0x3ba04c[_0x1e10('0x47')]=[{'all':!![]}];}else{_0x3ba04c[_0x1e10('0x47')]=[{'model':db[_0x1e10('0x98')],'as':'Contact','required':![]},{'model':db[_0x1e10('0xd2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x1e10('0x43')](_0x3ba04c);})[_0x1e10('0x25')](function(_0x3e6bd5){_0x5e40d0['rows']=_0x3e6bd5;return _0x5e40d0;});}})[_0x1e10('0x25')](respondWithFilteredResult(_0x54f232,_0x3ba04c))[_0x1e10('0x1a')](handleError(_0x54f232,null));};exports['addAgents']=function(_0x1c9cd4,_0x4b67f2){return db[_0x1e10('0x2e')][_0x1e10('0x48')]({'where':{'id':_0x1c9cd4[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x4b67f2,null))[_0x1e10('0x25')](function(_0x5d15de){if(_0x5d15de){return _0x5d15de[_0x1e10('0x118')](_0x1c9cd4['body']['ids'],_[_0x1e10('0xe8')](_0x1c9cd4[_0x1e10('0x4a')],[_0x1e10('0x5a'),'id'])||{})[_0x1e10('0xad')](function(_0x3bf312){for(var _0x2c9cc5=0x0;_0x2c9cc5<_0x1c9cd4['body'][_0x1e10('0x5a')]['length'];_0x2c9cc5+=0x1){socket[_0x1e10('0x119')]('userChatWebsite:save',{'UserId':Number(_0x1c9cd4[_0x1e10('0x4a')][_0x1e10('0x5a')][_0x2c9cc5]),'ChatWebsiteId':Number(_0x1c9cd4[_0x1e10('0x51')]['id'])});}return _0x3bf312;});}})['then'](respondWithResult(_0x4b67f2,null))[_0x1e10('0x1a')](handleError(_0x4b67f2,null));};exports['removeAgents']=function(_0x3a6704,_0xb8364a){return db['ChatWebsite']['find']({'where':{'id':_0x3a6704['params']['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0xb8364a,null))[_0x1e10('0x25')](function(_0x2b935c){if(_0x2b935c){return _0x2b935c[_0x1e10('0x11a')](_0x3a6704[_0x1e10('0x32')][_0x1e10('0x5a')])['then'](function(){if(_[_0x1e10('0x11b')](_0x3a6704[_0x1e10('0x32')][_0x1e10('0x5a')])){for(var _0x163ac1=0x0;_0x163ac1<_0x3a6704[_0x1e10('0x32')][_0x1e10('0x5a')][_0x1e10('0x37')];_0x163ac1+=0x1){socket[_0x1e10('0x119')](_0x1e10('0x11c'),{'UserId':Number(_0x3a6704['query'][_0x1e10('0x5a')][_0x163ac1]),'ChatWebsiteId':Number(_0x3a6704['params']['id'])});}}else{socket[_0x1e10('0x119')](_0x1e10('0x11c'),{'UserId':Number(_0x3a6704['query']['ids']),'ChatWebsiteId':Number(_0x3a6704[_0x1e10('0x51')]['id'])});}});}})[_0x1e10('0x25')](respondWithStatusCode(_0xb8364a,null))[_0x1e10('0x1a')](handleError(_0xb8364a,null));};exports[_0x1e10('0x11d')]=function(_0x2ed4b2,_0x3d5c9a){var _0x5d7179={};var _0x87bca9={};var _0x1e36d3;var _0xf39a1f;return db[_0x1e10('0x2e')][_0x1e10('0x56')]({'where':{'id':_0x2ed4b2[_0x1e10('0x51')]['id']}})[_0x1e10('0x25')](handleEntityNotFound(_0x3d5c9a,null))['then'](function(_0x90582){if(_0x90582){_0x1e36d3=_0x90582;_0x87bca9[_0x1e10('0x31')]=_[_0x1e10('0x46')](db[_0x1e10('0xb8')][_0x1e10('0x2f')]);_0x87bca9['query']=_['keys'](_0x2ed4b2[_0x1e10('0x32')]);_0x87bca9[_0x1e10('0x33')]=_[_0x1e10('0x34')](_0x87bca9[_0x1e10('0x31')],_0x87bca9['query']);_0x5d7179[_0x1e10('0x35')]=_['intersection'](_0x87bca9[_0x1e10('0x31')],qs[_0x1e10('0x36')](_0x2ed4b2[_0x1e10('0x32')][_0x1e10('0x36')]));_0x5d7179['attributes']=_0x5d7179[_0x1e10('0x35')][_0x1e10('0x37')]?_0x5d7179[_0x1e10('0x35')]:_0x87bca9['model'];_0x5d7179[_0x1e10('0x57')]=qs['sort'](_0x2ed4b2[_0x1e10('0x32')][_0x1e10('0x3a')]);_0x5d7179[_0x1e10('0x3b')]=qs['filters'](_['pick'](_0x2ed4b2[_0x1e10('0x32')],_0x87bca9[_0x1e10('0x33')]));if(_0x2ed4b2[_0x1e10('0x32')][_0x1e10('0x3d')]){_0x5d7179['where']=_['merge'](_0x5d7179['where'],{'$or':_['map'](_0x5d7179[_0x1e10('0x35')],function(_0x201e7e){var _0x19c39e={};_0x19c39e[_0x201e7e]={'$like':'%'+_0x2ed4b2[_0x1e10('0x32')][_0x1e10('0x3d')]+'%'};return _0x19c39e;})});}_0x5d7179=_[_0x1e10('0x3e')]({},_0x5d7179,_0x2ed4b2[_0x1e10('0x41')]);return _0x1e36d3[_0x1e10('0x11d')](_0x5d7179);}})[_0x1e10('0x25')](function(_0x2993cf){if(_0x2993cf){_0xf39a1f=_0x2993cf[_0x1e10('0x37')];if(!_0x2ed4b2[_0x1e10('0x32')][_0x1e10('0x38')]('nolimit')){_0x5d7179[_0x1e10('0x20')]=qs['limit'](_0x2ed4b2[_0x1e10('0x32')]['limit']);_0x5d7179['offset']=qs[_0x1e10('0x1f')](_0x2ed4b2['query']['offset']);}return _0x1e36d3[_0x1e10('0x11d')](_0x5d7179);}})[_0x1e10('0x25')](function(_0x4b053b){if(_0x4b053b){return _0x4b053b?{'count':_0xf39a1f,'rows':_0x4b053b}:null;}})[_0x1e10('0x25')](respondWithResult(_0x3d5c9a,null))[_0x1e10('0x1a')](handleError(_0x3d5c9a,null));}; \ No newline at end of file +var _0x4120=['count','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','ChatWebsite','includeAll','include','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ContactId','interaction','ChatInteraction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','Tag','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','stringify','connection','remoteAddress','replace','labelText','textColor','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','limit','undefined'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x4120,0x106));var _0x0412=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4120[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x0412('0x0'));var Mustache=require(_0x0412('0x1'));var util=require(_0x0412('0x2'));var path=require(_0x0412('0x3'));var ejs=require(_0x0412('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0412('0x5'));var querystring=require(_0x0412('0x6'));var Redis=require(_0x0412('0x7'));var qs=require(_0x0412('0x8'));var logger=require(_0x0412('0x9'))(_0x0412('0xa'));var config=require(_0x0412('0xb'));var db=require(_0x0412('0xc'))['db'];config[_0x0412('0xd')]=_[_0x0412('0xe')](config[_0x0412('0xd')],{'host':_0x0412('0xf'),'port':0x18eb});var socket=require(_0x0412('0x10'))(new Redis(config[_0x0412('0xd')]));require(_0x0412('0x11'))[_0x0412('0x12')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x0412('0x13'));var client=jayson[_0x0412('0x14')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x0412('0x14')][_0x0412('0x15')]({'port':0x232b});var client9001=jayson[_0x0412('0x14')][_0x0412('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x51dd7e,_0x2d0ad8,_0x425e19,_0x237cbc){return new BPromise(function(_0xb2dbd,_0x3d927a){var _0x58527a=_0x237cbc||client;return _0x58527a[_0x0412('0x16')](_0x51dd7e,_0x425e19)[_0x0412('0x17')](function(_0x4a2f39){logger[_0x0412('0x18')](_0x0412('0x19'),_0x2d0ad8,_0x0412('0x1a'));logger[_0x0412('0x1b')](_0x0412('0x1c'),_0x2d0ad8,_0x0412('0x1a'),JSON['stringify'](_0x4a2f39));if(_0x4a2f39['error']){if(_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1e')]===0x1f4){logger[_0x0412('0x1d')](_0x0412('0x19'),_0x2d0ad8,_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1f')]);return _0x3d927a(_0x4a2f39[_0x0412('0x1d')]['message']);}logger['error'](_0x0412('0x19'),_0x2d0ad8,_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1f')]);return _0xb2dbd(_0x4a2f39[_0x0412('0x1d')]['message']);}else{logger[_0x0412('0x18')](_0x0412('0x19'),_0x2d0ad8,'request\x20sent');_0xb2dbd(_0x4a2f39[_0x0412('0x20')][_0x0412('0x1f')]);}})[_0x0412('0x21')](function(_0x5682c9){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2d0ad8,_0x5682c9);_0x3d927a(_0x5682c9);});});}function respondWithStatusCode(_0x406747,_0x3f5cd8){_0x3f5cd8=_0x3f5cd8||0xcc;return function(_0x4f74e2){if(_0x4f74e2){return _0x406747['sendStatus'](_0x3f5cd8);}return _0x406747[_0x0412('0x22')](_0x3f5cd8)[_0x0412('0x23')]();};}function respondWithResult(_0x52109d,_0x6c2fbb){_0x6c2fbb=_0x6c2fbb||0xc8;return function(_0x121dfb){if(_0x121dfb){return _0x52109d[_0x0412('0x22')](_0x6c2fbb)[_0x0412('0x24')](_0x121dfb);}};}function respondWithFilteredResult(_0x378808,_0x25fc74){return function(_0x81f558){if(_0x81f558){var _0x4ac899=typeof _0x25fc74[_0x0412('0x25')]==='undefined'&&typeof _0x25fc74[_0x0412('0x26')]===_0x0412('0x27');var _0x319c5=_0x81f558['count'];var _0x234bd1=_0x4ac899?0x0:_0x25fc74['offset'];var _0x5318b1=_0x4ac899?_0x81f558[_0x0412('0x28')]:_0x25fc74['offset']+_0x25fc74[_0x0412('0x26')];var _0x115ea2;if(_0x5318b1>=_0x319c5){_0x5318b1=_0x319c5;_0x115ea2=0xc8;}else{_0x115ea2=0xce;}_0x378808['status'](_0x115ea2);return _0x378808['set'](_0x0412('0x29'),_0x234bd1+'-'+_0x5318b1+'/'+_0x319c5)[_0x0412('0x24')](_0x81f558);}return null;};}function saveUpdates(_0x1881bc){return function(_0x497d77){if(_0x497d77){return _0x497d77[_0x0412('0x2a')](_0x1881bc)[_0x0412('0x17')](function(_0x12ab77){return _0x12ab77;});}return null;};}function removeEntity(_0x19b83d){return function(_0x39e362){if(_0x39e362){return _0x39e362[_0x0412('0x2b')]()[_0x0412('0x17')](function(){var _0x52dbfc=_0x39e362[_0x0412('0x2c')]({'plain':!![]});var _0x70e3cf=_0x0412('0x2d');return db['UserProfileResource'][_0x0412('0x2b')]({'where':{'type':_0x70e3cf,'resourceId':_0x52dbfc['id']}})[_0x0412('0x17')](function(){return _0x39e362;});})[_0x0412('0x17')](function(){_0x19b83d[_0x0412('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed552){return function(_0x36e8fc){if(!_0x36e8fc){_0x1ed552[_0x0412('0x2e')](0x194);}return _0x36e8fc;};}function handleError(_0xf55227,_0x494493){_0x494493=_0x494493||0x1f4;return function(_0x58ca71){logger[_0x0412('0x1d')](_0x58ca71[_0x0412('0x2f')]);if(_0x58ca71[_0x0412('0x30')]){delete _0x58ca71[_0x0412('0x30')];}_0xf55227[_0x0412('0x22')](_0x494493)[_0x0412('0x31')](_0x58ca71);};}exports[_0x0412('0x32')]=function(_0xd127bf,_0x47e8ba){var _0x423054={'include':[{'model':db[_0x0412('0x33')],'as':_0x0412('0x34')}]},_0xfd1b7f={},_0xc6f203={'count':0x0,'rows':[]};var _0x5acd2e=_[_0x0412('0x35')](db['ChatWebsite']['rawAttributes'],function(_0x1d620d){return{'name':_0x1d620d[_0x0412('0x36')],'type':_0x1d620d[_0x0412('0x37')][_0x0412('0x38')]};});_0xfd1b7f[_0x0412('0x39')]=_[_0x0412('0x35')](_0x5acd2e,'name');_0xfd1b7f[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0xd127bf[_0x0412('0x3a')]);_0xfd1b7f[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0xfd1b7f[_0x0412('0x39')],_0xfd1b7f['query']);_0x423054[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0xfd1b7f[_0x0412('0x39')],qs[_0x0412('0x3f')](_0xd127bf[_0x0412('0x3a')][_0x0412('0x3f')]));_0x423054['attributes']=_0x423054['attributes'][_0x0412('0x40')]?_0x423054[_0x0412('0x3e')]:_0xfd1b7f[_0x0412('0x39')];if(!_0xd127bf['query'][_0x0412('0x41')](_0x0412('0x42'))){_0x423054[_0x0412('0x26')]=qs['limit'](_0xd127bf[_0x0412('0x3a')]['limit']);_0x423054[_0x0412('0x25')]=qs[_0x0412('0x25')](_0xd127bf[_0x0412('0x3a')]['offset']);}_0x423054[_0x0412('0x43')]=qs['sort'](_0xd127bf[_0x0412('0x3a')][_0x0412('0x44')]);_0x423054['where']=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0xd127bf['query'],_0xfd1b7f[_0x0412('0x3c')]),_0x5acd2e);if(_0xd127bf[_0x0412('0x3a')]['filter']){_0x423054['where']=_[_0x0412('0x46')](_0x423054[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x5acd2e,function(_0x510bb9){if(_0x510bb9['type']!==_0x0412('0x48')){var _0x404dc6={};_0x404dc6[_0x510bb9[_0x0412('0x30')]]={'$like':'%'+_0xd127bf[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x404dc6;}})});}_0x423054=_[_0x0412('0x46')]({},_0x423054,_0xd127bf[_0x0412('0x4a')]);var _0x5aa7e4={'where':_0x423054['where']};return db[_0x0412('0x4b')]['count'](_0x5aa7e4)['then'](function(_0x393b69){_0xc6f203[_0x0412('0x28')]=_0x393b69;if(_0xd127bf[_0x0412('0x3a')][_0x0412('0x4c')]){_0x423054[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x4b')]['findAll'](_0x423054);})[_0x0412('0x17')](function(_0x1f52a8){_0xc6f203['rows']=_0x1f52a8;return _0xc6f203;})[_0x0412('0x17')](respondWithFilteredResult(_0x47e8ba,_0x423054))['catch'](handleError(_0x47e8ba,null));};exports[_0x0412('0x4e')]=function(_0x5737dd,_0x288b09){var _0x2f2ed2={'raw':![],'where':{'id':_0x5737dd[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x33')],'as':'mandatoryDispositionPause'}]},_0x2e6601={};_0x2e6601[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0x4b')][_0x0412('0x50')]);_0x2e6601[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x5737dd['query']);_0x2e6601[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x2e6601['model'],_0x2e6601[_0x0412('0x3a')]);_0x2f2ed2[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x2e6601['model'],qs[_0x0412('0x3f')](_0x5737dd[_0x0412('0x3a')][_0x0412('0x3f')]));_0x2f2ed2[_0x0412('0x3e')]=_0x2f2ed2['attributes'][_0x0412('0x40')]?_0x2f2ed2[_0x0412('0x3e')]:_0x2e6601[_0x0412('0x39')];if(_0x5737dd[_0x0412('0x3a')][_0x0412('0x4c')]){_0x2f2ed2['include']=[{'all':!![]}];}_0x2f2ed2=_[_0x0412('0x46')]({},_0x2f2ed2,_0x5737dd['options']);return db[_0x0412('0x4b')][_0x0412('0x51')](_0x2f2ed2)[_0x0412('0x17')](handleEntityNotFound(_0x288b09,null))['then'](respondWithResult(_0x288b09,null))['catch'](handleError(_0x288b09,null));};exports[_0x0412('0x52')]=function(_0x3f7e61,_0x1739fc){return db[_0x0412('0x4b')][_0x0412('0x52')](_0x3f7e61[_0x0412('0x53')],{})[_0x0412('0x17')](function(_0x339c36){var _0x4b7f4e=_0x3f7e61['user'][_0x0412('0x2c')]({'plain':!![]});if(!_0x4b7f4e)throw new Error(_0x0412('0x54'));if(_0x4b7f4e[_0x0412('0x55')]===_0x0412('0x56')){var _0x34151d=_0x339c36[_0x0412('0x2c')]({'plain':!![]});var _0x221381=_0x0412('0x2d');return db[_0x0412('0x57')][_0x0412('0x51')]({'where':{'name':_0x221381,'userProfileId':_0x4b7f4e[_0x0412('0x58')]},'raw':!![]})[_0x0412('0x17')](function(_0x371690){if(_0x371690&&_0x371690[_0x0412('0x59')]===0x0){return db[_0x0412('0x5a')][_0x0412('0x52')]({'name':_0x34151d[_0x0412('0x30')],'resourceId':_0x34151d['id'],'type':_0x371690[_0x0412('0x30')],'sectionId':_0x371690['id']},{})[_0x0412('0x17')](function(){return _0x339c36;});}else{return _0x339c36;}})[_0x0412('0x21')](function(_0xc3b176){logger[_0x0412('0x1d')](_0x0412('0x5b'),_0xc3b176);throw _0xc3b176;});}return _0x339c36;})['then'](respondWithResult(_0x1739fc,0xc9))[_0x0412('0x21')](handleError(_0x1739fc,null));};exports[_0x0412('0x2a')]=function(_0x478336,_0x875b7b){if(_0x478336[_0x0412('0x53')]['id']){delete _0x478336[_0x0412('0x53')]['id'];}return db[_0x0412('0x4b')]['find']({'where':{'id':_0x478336[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x33')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x875b7b,null))[_0x0412('0x17')](saveUpdates(_0x478336[_0x0412('0x53')],null))['then'](respondWithResult(_0x875b7b,null))[_0x0412('0x21')](handleError(_0x875b7b,null));};exports[_0x0412('0x2b')]=function(_0x31950c,_0x4a81fc){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x31950c['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4a81fc,null))[_0x0412('0x17')](removeEntity(_0x4a81fc,null))['catch'](handleError(_0x4a81fc,null));};exports[_0x0412('0x5c')]=function(_0x392206,_0x50a59a){return db['ChatWebsite'][_0x0412('0x5c')]()[_0x0412('0x17')](respondWithResult(_0x50a59a,null))[_0x0412('0x21')](handleError(_0x50a59a,null));};exports[_0x0412('0x5d')]=function(_0x2a50b,_0x3543d2){if(_0x2a50b[_0x0412('0x53')]['id']){delete _0x2a50b[_0x0412('0x53')]['id'];}return db['ChatWebsite'][_0x0412('0x51')]({'where':{'id':_0x2a50b[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3543d2,null))[_0x0412('0x17')](function(_0x5891f0){if(_0x5891f0){_0x2a50b[_0x0412('0x53')][_0x0412('0x5e')]=_0x5891f0['id'];return db[_0x0412('0x5f')][_0x0412('0x52')](_0x2a50b[_0x0412('0x53')]);}})['then'](respondWithResult(_0x3543d2,null))[_0x0412('0x21')](handleError(_0x3543d2,null));};exports[_0x0412('0x60')]=function(_0x44f845,_0x13ec39){var _0x156f3c={'raw':![],'where':{}};var _0x426cc2={};var _0x3a420d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0412('0x61')]({'where':{'id':_0x44f845[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x13ec39,null))[_0x0412('0x17')](function(_0x3e47a1){if(_0x3e47a1){_0x426cc2[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0x5f')][_0x0412('0x50')]);_0x426cc2['query']=_[_0x0412('0x3b')](_0x44f845[_0x0412('0x3a')]);_0x426cc2['filters']=_[_0x0412('0x3d')](_0x426cc2[_0x0412('0x39')],_0x426cc2['query']);_0x156f3c[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x426cc2['model'],qs[_0x0412('0x3f')](_0x44f845['query'][_0x0412('0x3f')]));_0x156f3c['attributes']=_0x156f3c[_0x0412('0x3e')][_0x0412('0x40')]?_0x156f3c[_0x0412('0x3e')]:_0x426cc2[_0x0412('0x39')];if(!_0x44f845['query']['hasOwnProperty'](_0x0412('0x42'))){_0x156f3c['limit']=qs['limit'](_0x44f845[_0x0412('0x3a')]['limit']);_0x156f3c[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x44f845[_0x0412('0x3a')][_0x0412('0x25')]);}_0x156f3c[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x44f845[_0x0412('0x3a')]['sort']);_0x156f3c[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x44f845[_0x0412('0x3a')],_0x426cc2[_0x0412('0x3c')]));_0x156f3c[_0x0412('0x47')][_0x0412('0x5e')]=_0x3e47a1['id'];if(_0x44f845['query']['filter']){_0x156f3c[_0x0412('0x47')]=_[_0x0412('0x46')](_0x156f3c[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x156f3c[_0x0412('0x3e')],function(_0x4dcb78){var _0x29b7de={};_0x29b7de[_0x4dcb78]={'$like':'%'+_0x44f845[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x29b7de;})});}_0x156f3c=_[_0x0412('0x46')]({},_0x156f3c,_0x44f845[_0x0412('0x4a')]);return db[_0x0412('0x5f')][_0x0412('0x28')]({'where':_0x156f3c['where']})['then'](function(_0x49daf8){_0x3a420d['count']=_0x49daf8;if(_0x44f845[_0x0412('0x3a')][_0x0412('0x4c')]){_0x156f3c[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x5f')][_0x0412('0x62')](_0x156f3c);})[_0x0412('0x17')](function(_0x2d0c3e){_0x3a420d[_0x0412('0x63')]=_0x2d0c3e;return _0x3a420d;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x13ec39,_0x156f3c))[_0x0412('0x21')](handleError(_0x13ec39,null));};exports[_0x0412('0x64')]=function(_0x4a993a,_0x564421){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x4a993a[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x564421,null))[_0x0412('0x17')](function(_0xe94a5d){if(_0xe94a5d){return _0xe94a5d[_0x0412('0x64')](_0x4a993a['query']['ids']);}})[_0x0412('0x17')](respondWithStatusCode(_0x564421,null))[_0x0412('0x21')](handleError(_0x564421,null));};exports[_0x0412('0x65')]=function(_0x3de0c1,_0x47d8c6){if(_0x3de0c1['body']['id']){delete _0x3de0c1[_0x0412('0x53')]['id'];}return db[_0x0412('0x4b')]['find']({'where':{'id':_0x3de0c1[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x47d8c6,null))[_0x0412('0x17')](function(_0x3a07c8){if(_0x3a07c8){_0x3de0c1['body']['ChatWebsiteId']=_0x3a07c8['id'];return db[_0x0412('0x66')]['create'](_0x3de0c1[_0x0412('0x53')]);}})[_0x0412('0x17')](respondWithResult(_0x47d8c6,null))[_0x0412('0x21')](handleError(_0x47d8c6,null));};exports[_0x0412('0x67')]=function(_0x53bcd2,_0x3af7e6){var _0x5e2b63={'raw':![],'where':{}};var _0x3ddd8b={};var _0x1e6be6={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x53bcd2['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3af7e6,null))['then'](function(_0x14f3d5){if(_0x14f3d5){_0x3ddd8b['model']=_[_0x0412('0x3b')](db['CannedAnswer']['rawAttributes']);_0x3ddd8b['query']=_['keys'](_0x53bcd2['query']);_0x3ddd8b[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x3ddd8b[_0x0412('0x39')],_0x3ddd8b[_0x0412('0x3a')]);_0x5e2b63['attributes']=_[_0x0412('0x3d')](_0x3ddd8b[_0x0412('0x39')],qs[_0x0412('0x3f')](_0x53bcd2[_0x0412('0x3a')]['fields']));_0x5e2b63[_0x0412('0x3e')]=_0x5e2b63[_0x0412('0x3e')][_0x0412('0x40')]?_0x5e2b63[_0x0412('0x3e')]:_0x3ddd8b[_0x0412('0x39')];if(!_0x53bcd2[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x5e2b63[_0x0412('0x26')]=qs['limit'](_0x53bcd2[_0x0412('0x3a')][_0x0412('0x26')]);_0x5e2b63[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x53bcd2[_0x0412('0x3a')][_0x0412('0x25')]);}_0x5e2b63[_0x0412('0x43')]=qs['sort'](_0x53bcd2['query'][_0x0412('0x44')]);_0x5e2b63[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x53bcd2[_0x0412('0x3a')],_0x3ddd8b[_0x0412('0x3c')]));_0x5e2b63['where']['ChatWebsiteId']=_0x14f3d5['id'];if(_0x53bcd2['query'][_0x0412('0x49')]){_0x5e2b63[_0x0412('0x47')]=_[_0x0412('0x46')](_0x5e2b63[_0x0412('0x47')],{'$or':_['map'](_0x5e2b63[_0x0412('0x3e')],function(_0x12ff59){var _0x38434b={};_0x38434b[_0x12ff59]={'$like':'%'+_0x53bcd2[_0x0412('0x3a')]['filter']+'%'};return _0x38434b;})});}_0x5e2b63=_[_0x0412('0x46')]({},_0x5e2b63,_0x53bcd2['options']);return db[_0x0412('0x66')][_0x0412('0x28')]({'where':_0x5e2b63[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x35aecc){_0x1e6be6[_0x0412('0x28')]=_0x35aecc;if(_0x53bcd2[_0x0412('0x3a')][_0x0412('0x4c')]){_0x5e2b63[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x66')][_0x0412('0x62')](_0x5e2b63);})[_0x0412('0x17')](function(_0x3d9c90){_0x1e6be6[_0x0412('0x63')]=_0x3d9c90;return _0x1e6be6;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x3af7e6,_0x5e2b63))[_0x0412('0x21')](handleError(_0x3af7e6,null));};exports[_0x0412('0x68')]=function(_0x4228bb,_0x3b15d3){return db['ChatWebsite'][_0x0412('0x51')]({'where':{'id':_0x4228bb[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3b15d3,null))[_0x0412('0x17')](function(_0x476b76){if(_0x476b76){return _0x476b76[_0x0412('0x68')](_0x4228bb[_0x0412('0x3a')][_0x0412('0x69')]);}})[_0x0412('0x17')](respondWithStatusCode(_0x3b15d3,null))['catch'](handleError(_0x3b15d3,null));};exports[_0x0412('0x6a')]=function(_0x30bee2,_0x332183){_0x30bee2[_0x0412('0x53')]['sitepic']=_0x30bee2[_0x0412('0x6b')][_0x0412('0x6c')];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x30bee2[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x332183,null))[_0x0412('0x17')](saveUpdates(_0x30bee2['body'],null))[_0x0412('0x17')](respondWithResult(_0x332183,null))[_0x0412('0x21')](handleError(_0x332183,null));};exports[_0x0412('0x6d')]=function(_0x2f56de,_0x4a86ba){_0x2f56de['body'][_0x0412('0x6e')]=_0x2f56de['file'][_0x0412('0x6c')];return db[_0x0412('0x4b')]['find']({'where':{'id':_0x2f56de['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4a86ba,null))['then'](saveUpdates(_0x2f56de[_0x0412('0x53')],null))[_0x0412('0x17')](respondWithResult(_0x4a86ba,null))[_0x0412('0x21')](handleError(_0x4a86ba,null));};exports[_0x0412('0x6f')]=function(_0x4164ce,_0x4642b9){_0x4164ce[_0x0412('0x53')][_0x0412('0x70')]=_0x4164ce[_0x0412('0x6b')][_0x0412('0x6c')];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x4164ce['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4642b9,null))['then'](saveUpdates(_0x4164ce[_0x0412('0x53')],null))['then'](respondWithResult(_0x4642b9,null))[_0x0412('0x21')](handleError(_0x4642b9,null));};exports[_0x0412('0x71')]=function(_0x56a594,_0x30c3f2){_0x56a594['body']['systemAvatar']=_0x56a594[_0x0412('0x6b')]['filename'];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x56a594['params']['id']}})['then'](handleEntityNotFound(_0x30c3f2,null))[_0x0412('0x17')](saveUpdates(_0x56a594[_0x0412('0x53')],null))[_0x0412('0x17')](respondWithResult(_0x30c3f2,null))[_0x0412('0x21')](handleError(_0x30c3f2,null));};exports[_0x0412('0x72')]=function(_0x4f0d26,_0x4d40e1){var _0x4f7629=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x75'));var _0x4c2442={'where':{'id':_0x4f0d26[_0x0412('0x4f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x589b03=![];return require(_0x0412('0x76'))[_0x0412('0x77')]()[_0x0412('0x17')](function(_0x1b804f){if(_0x1b804f){_0x589b03=_0x1b804f['custom'];}})[_0x0412('0x17')](function(){return db[_0x0412('0x4b')][_0x0412('0x51')](_0x4c2442);})[_0x0412('0x17')](handleEntityNotFound(_0x4d40e1,null))[_0x0412('0x17')](function(_0x67bb65){if(_0x67bb65){if(!_['isNil'](_0x67bb65[_0x0412('0x78')])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config['root'],_0x0412('0x7a'),_0x67bb65[_0x0412('0x78')]))&&_0x589b03){_0x4f7629=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/logos/',_0x67bb65[_0x0412('0x78')]);}}return _0x4d40e1[_0x0412('0x7b')](_0x4f7629);}})[_0x0412('0x21')](handleError(_0x4d40e1,null));};exports[_0x0412('0x7c')]=function(_0x11d9d4,_0x214cc8){var _0xf92d6=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x7d'));var _0x21680b={'where':{'id':_0x11d9d4[_0x0412('0x4f')]['id']},'attributes':['id',_0x0412('0x6e')],'raw':!![]};return db[_0x0412('0x4b')][_0x0412('0x51')](_0x21680b)[_0x0412('0x17')](handleEntityNotFound(_0x214cc8,null))[_0x0412('0x17')](function(_0x254883){if(_0x254883){if(!_[_0x0412('0x7e')](_0x254883['agentAvatar'])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config['root'],'server/files/images/avatars/',_0x254883[_0x0412('0x6e')]))){_0xf92d6=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/',_0x254883['agentAvatar']);}}return _0x214cc8[_0x0412('0x7b')](_0xf92d6);}})[_0x0412('0x21')](handleError(_0x214cc8,null));};exports[_0x0412('0x7f')]=function(_0x586e5b,_0x4e2510){var _0x248e9a=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/customer_avatar.png');var _0x201a5c={'where':{'id':_0x586e5b['params']['id']},'attributes':['id',_0x0412('0x70'),_0x0412('0x80')],'raw':!![]};return db['ChatWebsite'][_0x0412('0x51')](_0x201a5c)[_0x0412('0x17')](handleEntityNotFound(_0x4e2510,null))[_0x0412('0x17')](function(_0x3f59f6){if(_0x3f59f6){if(!_[_0x0412('0x7e')](_0x3f59f6[_0x0412('0x70')])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/',_0x3f59f6[_0x0412('0x70')]))&&_0x3f59f6[_0x0412('0x80')]){_0x248e9a=path['join'](config[_0x0412('0x74')],_0x0412('0x81'),_0x3f59f6['customerAvatar']);}}return _0x4e2510['download'](_0x248e9a);}})[_0x0412('0x21')](handleError(_0x4e2510,null));};exports[_0x0412('0x82')]=function(_0x5590c4,_0x35d151){var _0x41017c=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x83'));var _0x2c2700={'where':{'id':_0x5590c4[_0x0412('0x4f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x0412('0x4b')]['find'](_0x2c2700)[_0x0412('0x17')](handleEntityNotFound(_0x35d151,null))[_0x0412('0x17')](function(_0x444984){if(_0x444984){if(!_[_0x0412('0x7e')](_0x444984['systemAvatar'])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x81'),_0x444984[_0x0412('0x84')]))){_0x41017c=path['join'](config['root'],_0x0412('0x81'),_0x444984['systemAvatar']);}}return _0x35d151[_0x0412('0x7b')](_0x41017c);}})['catch'](handleError(_0x35d151,null));};exports[_0x0412('0x85')]=function(_0x24a0ad,_0x14821b){var _0xc1cfcc=require(_0x0412('0x86'));var _0x5152b1=new _0xc1cfcc();var _0x5a0ce3=_0x5152b1[_0x0412('0x87')](_0x24a0ad['headers'][_0x0412('0x88')])['getResult']();var _0x2f5742={'body':_0x24a0ad['body'],'channel':_0x0412('0x89')};var _0x18fb34=[];var _0x3f040e=[];var _0x11ef24={};var _0x3e9d52=![];return db[_0x0412('0x8a')][_0x0412('0x5c')]()[_0x0412('0x17')](function(_0x25628c){if(!_0x25628c){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x8d'));}_0x18fb34=_[_0x0412('0x8e')](_[_0x0412('0x3b')](_0x25628c),[_0x0412('0x8f'),_0x0412('0x90')]);_0x3f040e=_[_0x0412('0x8e')](_[_0x0412('0x3b')](_0x25628c),[_0x0412('0x8f'),'updatedAt','CompanyId','ListId']);if(_0x24a0ad[_0x0412('0x53')]['id']){delete _0x24a0ad['body']['id'];}if(_[_0x0412('0x7e')](_0x24a0ad['body']['from'])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x91'));}if(_['isNil'](_0x24a0ad[_0x0412('0x53')][_0x0412('0x53')])||_0x24a0ad['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x0412('0x92'));}if(_[_0x0412('0x7e')](_0x24a0ad[_0x0412('0x53')][_0x0412('0x93')])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x94')+_0x3f040e);}if(!_[_0x0412('0x95')](_0x3f040e,_0x24a0ad[_0x0412('0x53')]['mapKey'])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x96')+_0x3f040e);}_0x11ef24[_0x24a0ad['body'][_0x0412('0x93')]]=_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')];})[_0x0412('0x17')](function(){return db[_0x0412('0x4b')]['find']({'where':{'id':_0x24a0ad[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x98')],'as':_0x0412('0x99'),'include':[{'model':db['CmContact'],'as':_0x0412('0x9a'),'where':_0x11ef24,'limit':0x1,'order':[[_0x0412('0x90'),_0x0412('0x9b')]]}]},{'model':db[_0x0412('0x9c')],'as':_0x0412('0x9d')}]});})['then'](handleEntityNotFound(_0x14821b,null))[_0x0412('0x17')](function(_0xa330ea){if(_0xa330ea&&_0xa330ea['List']){_0x2f5742[_0x0412('0x9e')]=_0xa330ea;_0x2f5742[_0x0412('0x9f')]=_0xa330ea['Applications'];_0x2f5742['list']=_0xa330ea[_0x0412('0x99')];_0x2f5742[_0x0412('0x9f')]=_[_0x0412('0xa0')](_0x2f5742[_0x0412('0x9f')],[_0x0412('0xa1')],[_0x0412('0xa2')]);if(_0x2f5742['account'][_0x0412('0x9d')]){delete _0x2f5742['account'][_0x0412('0x9d')];}if(_0x2f5742[_0x0412('0x9e')][_0x0412('0x99')]&&_0x2f5742[_0x0412('0x9e')]['List'][_0x0412('0x9a')][_0x0412('0x40')]){return _0x2f5742['account']['List'][_0x0412('0x9a')][0x0];}var _0x473591=_[_0x0412('0xe')](_0x24a0ad[_0x0412('0x53')],{'firstName':_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')],'ListId':_0xa330ea[_0x0412('0xa3')]});_0x473591[_0x24a0ad['body']['mapKey']]=_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')];return db[_0x0412('0x8a')][_0x0412('0x52')](_0x473591,{'fields':_0x18fb34,'raw':!![]});}})[_0x0412('0x17')](handleEntityNotFound(_0x14821b,null))[_0x0412('0x17')](function(_0x1bae97){_0x2f5742[_0x0412('0xa4')]=_0x1bae97;var _0x1906f8=_0x24a0ad[_0x0412('0x53')][_0x0412('0xa5')];if(_0x24a0ad['headers'][_0x0412('0xa6')]){_0x1906f8=_0x24a0ad['headers'][_0x0412('0xa6')];}else if(_0x24a0ad[_0x0412('0xa7')]['x-forwarded-for']){_0x1906f8=_[_0x0412('0xa8')](_0x24a0ad[_0x0412('0xa7')][_0x0412('0xa9')][_0x0412('0xaa')](','));}if(_0x1bae97){var _0x3aad64={'ContactId':_0x1bae97['id'],'ChatWebsiteId':_0x24a0ad['params']['id'],'from':(_0x1bae97[_0x0412('0xab')]||'')+'\x20'+(_0x1bae97[_0x0412('0xac')]||''),'customerIp':_0x1906f8,'customerPort':_0x24a0ad[_0x0412('0xa7')][_0x0412('0xad')]?_0x24a0ad[_0x0412('0xa7')][_0x0412('0xad')]:null,'referer':_0x24a0ad[_0x0412('0x53')][_0x0412('0xae')],'browserName':_0x5a0ce3[_0x0412('0xaf')]['name']&&_0x5a0ce3[_0x0412('0xaf')]['version']?util['format'](_0x0412('0xb0'),_0x5a0ce3[_0x0412('0xaf')][_0x0412('0x30')],_0x5a0ce3[_0x0412('0xaf')][_0x0412('0xb1')]):'unknown','browserVersion':_0x5a0ce3['browser'][_0x0412('0xb1')]||_0x0412('0xb2'),'osName':util[_0x0412('0xb3')](_0x0412('0xb0'),_0x5a0ce3['os'][_0x0412('0x30')],_0x5a0ce3['os'][_0x0412('0xb1')]),'osVersion':_0x5a0ce3['os'][_0x0412('0xb1')],'deviceModel':_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x39')]&&_0x5a0ce3[_0x0412('0xb4')][_0x0412('0xb5')]?util[_0x0412('0xb3')](_0x0412('0xb6'),_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x39')],_0x5a0ce3[_0x0412('0xb4')]['vendor'],_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x37')]):null,'deviceVendor':_0x5a0ce3['device'][_0x0412('0xb5')],'deviceType':_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x37')],'formData':JSON['stringify'](_0x24a0ad[_0x0412('0x53')])};var _0xae22f5={'ChatWebsiteId':_0x24a0ad['params']['id'],'closed':![]};if(_0x24a0ad[_0x0412('0x53')]['threadId']){_0xae22f5[_0x0412('0xb7')]=_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')];return db['ChatInteraction'][_0x0412('0x51')]({'where':_0xae22f5})[_0x0412('0x17')](function(_0x522092){if(_0x522092){return[_0x522092,![]];}_0x3aad64['threadId']=_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')];_0x3aad64[_0x0412('0xb8')]=_0x24a0ad['body']['externalUrl'];return db['ChatInteraction'][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x2ab7f9){return[_0x2ab7f9,!![]];});});}_0xae22f5[_0x0412('0xb9')]=_0x1bae97['id'];if(_0x24a0ad[_0x0412('0x53')][_0x0412('0xba')]&&_0x24a0ad[_0x0412('0x53')][_0x0412('0xba')]['id']){_0xae22f5['id']=_0x24a0ad['body'][_0x0412('0xba')]['id'];return db[_0x0412('0xbb')][_0x0412('0x51')]({'where':_0xae22f5})[_0x0412('0x17')](function(_0x170cbb){if(_0x170cbb){return[_0x170cbb,![]];}return db['ChatInteraction'][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x1d2581){return[_0x1d2581,!![]];});});}return db[_0x0412('0xbb')][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x5e6121){return[_0x5e6121,!![]];});}})['spread'](function(_0x1d4b8c,_0x4dfcc0){if(_0x1d4b8c){_0x3e9d52=_0x4dfcc0;if(!_0x4dfcc0){var _0xae3465={'from':(_0x2f5742[_0x0412('0xa4')][_0x0412('0xab')]||'')+'\x20'+(_0x2f5742[_0x0412('0xa4')][_0x0412('0xac')]||'')};if(_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')]&&_0x24a0ad[_0x0412('0x53')]['messageId']&&_0x24a0ad['body']['threadId']!=_0x24a0ad[_0x0412('0x53')]['messageId']){_0xae3465['threadId']=_0x24a0ad[_0x0412('0x53')][_0x0412('0xbc')];}return _0x1d4b8c[_0x0412('0x2a')](_0xae3465);}else{return _0x1d4b8c;}}})[_0x0412('0x17')](function(_0x3a3617){_0x2f5742[_0x0412('0xba')]=_0x3a3617[_0x0412('0x2c')]({'plain':!![]});_0x2f5742['interaction'][_0x0412('0xbd')]=_0x3e9d52;if(_0x2f5742[_0x0412('0xba')][_0x0412('0xbd')]){if(_0x2f5742[_0x0412('0x9e')][_0x0412('0xbe')]){_0x2f5742[_0x0412('0x9f')][_0x0412('0xbf')]({'id':0x0,'priority':_0x2f5742['applications']['length']+0x1,'app':_0x0412('0xc0'),'appdata':'unmanaged','interval':_0x0412('0xc1')});}}return db[_0x0412('0xc2')][_0x0412('0x52')]({'body':_0x24a0ad['body'][_0x0412('0x53')],'ChatWebsiteId':_0x24a0ad['params']['id'],'ChatInteractionId':_0x3a3617['id'],'direction':'in','ContactId':_0x2f5742['contact']['id'],'AttachmentId':_0x24a0ad[_0x0412('0x53')][_0x0412('0xc3')]});})[_0x0412('0x17')](function(_0x3ab0f4){_0x2f5742[_0x0412('0x1f')]=_0x3ab0f4;if(_0x2f5742['interaction']['UserId']){return db[_0x0412('0xc4')]['find']({'attributes':['id',_0x0412('0x30')],'where':{'id':_0x2f5742['interaction']['UserId']}})['then'](function(_0x36ab38){if(_0x36ab38){_0x2f5742[_0x0412('0x9f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0412('0xc5'),'appdata':_0x36ab38[_0x0412('0x30')]+','+(_0x2f5742['account'][_0x0412('0xc6')]||0xa),'interval':_0x0412('0xc1')});_0x2f5742[_0x0412('0xc7')]=!![];}return respondWithRpcPromise(_0x0412('0xc8'),_0x0412('0xc9'),_0x2f5742);});}return respondWithRpcPromise(_0x0412('0xc8'),_0x0412('0xc9'),_0x2f5742);})[_0x0412('0x17')](function(_0x1d60ba){respondWithRpcPromise(_0x0412('0xca'),_0x0412('0xca'),{'event':_0x0412('0x85'),'message':_0x1d60ba},client9002);return _0x1d60ba;})[_0x0412('0x17')](respondWithResult(_0x14821b,null))['catch'](handleError(_0x14821b,null));};exports[_0x0412('0xcb')]=function(_0x1cf320,_0x4bfe05){var _0x3cf5c6,_0x52cff8,_0x5a7f11;var _0xbf7421=[];var _0x323a29={};var _0x140b02=_0x1cf320[_0x0412('0xcc')]||[];var _0x2ec01b=[];var _0x55498f;return db['CmContact'][_0x0412('0x5c')]()[_0x0412('0x17')](function(_0x34dbfe){if(!_0x34dbfe){throw new db[(_0x0412('0x8b'))]['ValidationError']('no\x20available\x20attributes');}_0xbf7421=_['difference'](_[_0x0412('0x3b')](_0x34dbfe),[_0x0412('0x8f'),_0x0412('0x90'),'CompanyId',_0x0412('0xa3')]);if(_0x1cf320[_0x0412('0x53')]['id']){delete _0x1cf320[_0x0412('0x53')]['id'];}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0x97')])){throw _0x4bfe05['status'](0x1f4)[_0x0412('0x31')](new db['Sequelize'][(_0x0412('0x8c'))](_0x0412('0x91')));}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0x53')])||_0x1cf320[_0x0412('0x53')][_0x0412('0x53')]===''){throw _0x4bfe05['status'](0x1f4)[_0x0412('0x31')](new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x92')));}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0xcd')])){throw _0x4bfe05[_0x0412('0x22')](0x1f4)[_0x0412('0x31')](new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0xce')+_0xbf7421));}if(!_[_0x0412('0x95')](_0xbf7421,_0x1cf320[_0x0412('0x53')]['mapKeyOffline'])){throw _0x4bfe05[_0x0412('0x22')](0x1f4)['send'](new db[(_0x0412('0x8b'))]['ValidationError'](_0x0412('0xcf')+_0xbf7421));}_0x323a29[_0x1cf320[_0x0412('0x53')][_0x0412('0xcd')]]=_0x1cf320['body'][_0x0412('0x97')];})['then'](function(){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x1cf320['params']['id']},'include':[{'model':db[_0x0412('0x98')],'as':_0x0412('0x99')},{'model':db[_0x0412('0xd0')],'as':_0x0412('0xd0')}]});})['then'](handleEntityNotFound(_0x4bfe05,null))[_0x0412('0x17')](function(_0x3f4d03){if(_0x3f4d03&&_0x3f4d03[_0x0412('0x99')]){_0x52cff8=_0x3f4d03;var _0x56321d=_[_0x0412('0xe')](_0x1cf320['body'],{'firstName':_0x1cf320[_0x0412('0x53')][_0x0412('0x97')],'phone':_0x1cf320[_0x0412('0x53')]['from'],'ListId':_0x3f4d03[_0x0412('0xa3')]});_0x56321d[_0x1cf320['body'][_0x0412('0xcd')]]=_0x1cf320[_0x0412('0x53')][_0x0412('0x97')];return db['CmContact'][_0x0412('0xd1')]({'where':_0x323a29,'defaults':_0x56321d});}})[_0x0412('0xd2')](function(_0x5e4a9d){if(_0x5e4a9d){_0x5a7f11=_0x5e4a9d;var _0x5b426f=fs[_0x0412('0xd3')](path['join'](config[_0x0412('0x74')],'server/files/templates/chatOfflineMessage.ejs'),_0x0412('0xd4'));var _0xf7f8d5=ejs[_0x0412('0xd5')](_0x5b426f,{'body':_['toPairs'](_0x1cf320['body'][_0x0412('0x53')]),'bodyTitle':_0x52cff8[_0x0412('0xd6')]});return db[_0x0412('0xd7')]['create']({'body':_0xf7f8d5,'plainBody':htmlToText[_0x0412('0xd8')](_0xf7f8d5),'ContactId':_0x5e4a9d['id'],'ChatWebsiteId':_0x52cff8['id']});}})['then'](function(_0x359662){_0x55498f=_0x359662;if(_0x140b02[_0x0412('0x40')]){var _0x2f0ded=_0x140b02['map'](function(_0x263fb1){return{'name':_0x263fb1[_0x0412('0xd9')],'basename':_0x263fb1['filename'],'type':_0x263fb1[_0x0412('0xda')],'ChatOfflineMessageId':_0x359662['id']};});_0x2ec01b=_0x2f0ded[_0x0412('0x35')](_0x225cc3=>{var _0x4ab8e7={'filename':_0x225cc3['name'],'path':path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0xdb'),_0x0412('0xcc'),'attachments',_0x0412('0xdc'),_0x225cc3[_0x0412('0xdd')])};return _0x4ab8e7;});if(!_0x52cff8[_0x0412('0xde')]){return db[_0x0412('0xdf')]['transaction'](function(_0x5ceece){return db[_0x0412('0xe0')][_0x0412('0xe1')](_0x2f0ded,{'transaction':_0x5ceece});});}}})[_0x0412('0x17')](function(){if(_0x55498f){_0x3cf5c6=_0x55498f;return db['MailAccount'][_0x0412('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0x0412('0xe2')],'as':_0x0412('0xe3'),'raw':!![],'include':[{'model':db[_0x0412('0xe4')],'as':_0x0412('0xe4'),'raw':!![]}]}]});}})[_0x0412('0x17')](function(_0x4f8b23){if(_0x4f8b23&&_0x4f8b23[_0x0412('0xe3')]&&_0x52cff8[_0x0412('0xe5')]&&_0x52cff8[_0x0412('0xe6')]){var _0x24e6f7=_0x4f8b23[_0x0412('0xe7')]();return respondWithRpcPromise('SendMail',_0x0412('0xe8'),{'account':_0x24e6f7,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4f8b23[_0x0412('0x30')],_0x4f8b23[_0x0412('0xe9')]||_0x4f8b23['Smtp']['user']),'to':_0x52cff8['forwardOfflineAddress'],'subject':_0x52cff8[_0x0412('0xea')],'html':_0x3cf5c6['body'],'attachments':_0x2ec01b}},client9003)['then'](function(){return _0x3cf5c6;})[_0x0412('0x21')](function(_0x59170f){logger[_0x0412('0x1d')](_0x59170f);});}})[_0x0412('0x17')](function(){if(_0x52cff8&&_0x52cff8[_0x0412('0xde')]&&_0x52cff8[_0x0412('0xeb')]){var _0x8c99f2=[];if(_0x140b02[_0x0412('0x40')]){_0x8c99f2=_0x140b02[_0x0412('0x35')](function(_0x13fdce){return{'name':_0x13fdce['originalname'],'basename':_0x13fdce[_0x0412('0x6c')],'type':_0x13fdce[_0x0412('0xda')],'ChatOfflineMessageId':_0x55498f['id']};});}var _0x5aa2dd;if(!_[_0x0412('0x7e')](_0x52cff8[_0x0412('0xec')])){var _0x1e8de9=_[_0x0412('0x35')](_0x1cf320[_0x0412('0x53')],function(_0x377979){return _0x377979;});var _0x3116bf=_[_0x0412('0xed')](_0x1e8de9)[0x0];var _0x45bfef=_[_0x0412('0xee')](_0x3116bf,function(_0x52fc0e){return _0x52fc0e;});_0x5aa2dd=_0x45bfef[0x1][_0x52cff8[_0x0412('0xec')]];}var _0x1a8735={'from':_0x5a7f11['email'],'firstName':_0x5a7f11[_0x0412('0xab')],'lastName':_0x5a7f11[_0x0412('0xac')],'mapKey':'email','message':{'from':_0x5a7f11[_0x0412('0xe9')],'to':_0x52cff8[_0x0412('0xd0')]['email'],'cc':'','subject':_[_0x0412('0x7e')](_0x5aa2dd)?_0x52cff8[_0x0412('0xea')]:_0x5aa2dd,'messageId':'','sentAt':new Date(),'attach':_0x8c99f2[_0x0412('0x40')],'attachments':_0x8c99f2,'originChannel':_0x0412('0xef'),'ChatWebsiteId':_0x52cff8['id'],'ChatOfflineMessageId':_0x3cf5c6['id'],'originTo':_0x52cff8[_0x0412('0xd0')][_0x0412('0xe9')]},'body':_0x3cf5c6[_0x0412('0x53')]};var _0x5bf56d={'account':{'id':_0x52cff8[_0x0412('0xeb')]},'body':_0x1a8735,'log':_0x0412('0xf0')};return respondWithRpcPromise(_0x0412('0xf0'),_0x0412('0xf1'),_0x5bf56d,client9001)[_0x0412('0x17')](function(){return _0x3cf5c6;})['catch'](function(_0x4ea6c6){logger[_0x0412('0x1d')](_0x4ea6c6);});}return;})[_0x0412('0x17')](function(){if(_0x3cf5c6){return _0x3cf5c6;}})[_0x0412('0x17')](respondWithResult(_0x4bfe05,null))[_0x0412('0x21')](function(_0x1aa549){logger['error'](_0x0412('0x21'),_0x1aa549);for(var _0x562f06 of _0x140b02){var _0x2f9498=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0xdb'),_0x0412('0xcc'),'attachments',_0x0412('0xdc'),_0x562f06[_0x0412('0x6c')]);fs_extra[_0x0412('0xf2')](_0x2f9498)['catch'](function(_0x49c378){logger[_0x0412('0x1d')](_0x0412('0xf3'),_0x2f9498,_0x49c378);});}});};exports[_0x0412('0xf4')]=function(_0x4564c4,_0x2b7665){return db[_0x0412('0xbb')][_0x0412('0x51')]({'where':{'id':_0x4564c4[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x2b7665,null))[_0x0412('0x17')](function(_0x3155c2){if(_0x3155c2){return _0x3155c2['addInteraction'](_0x4564c4[_0x0412('0x53')][_0x0412('0x69')],_[_0x0412('0xf5')](_0x4564c4[_0x0412('0x53')],[_0x0412('0x69'),'id'])||{});}})[_0x0412('0x17')](respondWithResult(_0x2b7665,null))[_0x0412('0x21')](handleError(_0x2b7665,null));};exports[_0x0412('0xf6')]=function(_0x1d3e03,_0xa73737){var _0x10fc45={'raw':![],'where':{}};var _0x59676e={};var _0x568e84={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x1d3e03['params']['id']}})['then'](handleEntityNotFound(_0xa73737,null))[_0x0412('0x17')](function(_0x2ab21c){if(_0x2ab21c){_0x59676e[_0x0412('0x39')]=_['keys'](db[_0x0412('0xbb')][_0x0412('0x50')]);_0x59676e[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x1d3e03[_0x0412('0x3a')]);_0x59676e[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x59676e['model'],_0x59676e[_0x0412('0x3a')]);_0x10fc45['attributes']=_[_0x0412('0x3d')](_0x59676e[_0x0412('0x39')],qs[_0x0412('0x3f')](_0x1d3e03[_0x0412('0x3a')]['fields']));_0x10fc45['attributes']=_0x10fc45[_0x0412('0x3e')][_0x0412('0x40')]?_0x10fc45[_0x0412('0x3e')]:_0x59676e[_0x0412('0x39')];if(!_0x1d3e03[_0x0412('0x3a')]['hasOwnProperty']('nolimit')){_0x10fc45[_0x0412('0x26')]=qs['limit'](_0x1d3e03['query'][_0x0412('0x26')]);_0x10fc45[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x1d3e03[_0x0412('0x3a')]['offset']);}_0x10fc45['order']=qs[_0x0412('0x44')](_0x1d3e03['query'][_0x0412('0x44')]);_0x10fc45[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x1d3e03[_0x0412('0x3a')],_0x59676e[_0x0412('0x3c')]));_0x10fc45[_0x0412('0x47')][_0x0412('0x5e')]=_0x2ab21c['id'];if(_0x1d3e03['query'][_0x0412('0x49')]){_0x10fc45[_0x0412('0x47')]=_[_0x0412('0x46')](_0x10fc45[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x10fc45['attributes'],function(_0x14d23f){var _0x73085f={};_0x73085f[_0x14d23f]={'$like':'%'+_0x1d3e03[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x73085f;})});}_0x10fc45=_['merge']({},_0x10fc45,_0x1d3e03[_0x0412('0x4a')]);return db['ChatInteraction'][_0x0412('0x28')]({'where':_0x10fc45[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x18d159){_0x568e84[_0x0412('0x28')]=_0x18d159;if(_0x1d3e03[_0x0412('0x3a')][_0x0412('0x4c')]){_0x10fc45[_0x0412('0x4d')]=[{'model':db[_0x0412('0x8a')],'as':_0x0412('0xf7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x0412('0xf8'),'internal'],'required':![]},{'model':db[_0x0412('0xf9')],'as':'Tags','attributes':['id',_0x0412('0x30'),_0x0412('0xfa')],'where':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]?{'id':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]}:undefined,'required':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x10fc45);})[_0x0412('0x17')](function(_0x39b577){_0x568e84[_0x0412('0x63')]=_0x39b577;return _0x568e84;});}})[_0x0412('0x17')](respondWithFilteredResult(_0xa73737,_0x10fc45))[_0x0412('0x21')](handleError(_0xa73737,null));};function iftimePromise(_0x25c27b,_0xf509f5){return respondWithRpcPromise('Command',_0x0412('0xfc'),{'command':_0xf509f5['timezone']?util[_0x0412('0xb3')](_0x0412('0xfd'),_0x25c27b[_0x0412('0xfe')],_0xf509f5[_0x0412('0xff')]):util['format'](_0x0412('0x100'),_0x25c27b[_0x0412('0xfe')])},client9002)[_0x0412('0x17')](function(_0x51bf99){var _0x4ac84e=_0x51bf99&&_0x51bf99['indexOf'](_0x0412('0x101'))>=0x0?!![]:![];logger[_0x0412('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf509f5['id'],_0x25c27b['id'],_0x25c27b[_0x0412('0xfe')],_0x4ac84e?_0x0412('0x102'):_0x0412('0x103'),_0xf509f5[_0x0412('0xff')]?_0xf509f5[_0x0412('0xff')]:_0x0412('0x104'));return _0x4ac84e;})[_0x0412('0x21')](function(_0x5c1ff3){logger[_0x0412('0x1d')](_0x0412('0x105'),_0xf509f5['id'],_0x25c27b['id'],_0x25c27b['interval'],util[_0x0412('0x106')](_0x5c1ff3,{'showHidden':![],'depth':null}),_0xf509f5[_0x0412('0xff')]?_0xf509f5[_0x0412('0xff')]:'No\x20timezone');return![];});}exports[_0x0412('0xfc')]=function(_0x51e6b8,_0x33c615){var _0x407ab2=0x0;var _0x1ded51=0x0;var _0x45d314=![];var _0x4f1984;var _0x32376e;return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x51e6b8[_0x0412('0x4f')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x0412('0x107')],'as':_0x0412('0x108'),'attributes':['id',_0x0412('0xfe')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x33c615,null))[_0x0412('0x17')](function(_0x38cce7){if(_0x38cce7){_0x4f1984=_0x38cce7;return _0x38cce7[_0x0412('0x109')]({'raw':!![]});}})[_0x0412('0x17')](function(_0x384d60){if(_0x4f1984){if(_0x384d60){_0x32376e=_0x384d60;}}return require(_0x0412('0x76'))[_0x0412('0x77')]();})[_0x0412('0x17')](function(_0x21cf2b){if(_0x21cf2b){_0x1ded51=_0x21cf2b[_0x0412('0x10a')];_0x45d314=_0x21cf2b[_0x0412('0x10b')];}})[_0x0412('0x17')](function(){return db[_0x0412('0xbb')][_0x0412('0x28')]({'where':{'closed':![]}});})['then'](function(_0x84a226){_0x407ab2=_0x84a226;if(_0x1ded51&&_0x84a226>_0x1ded51){return db[_0x0412('0x10c')]['findOne']({'where':{'id':0x1}})[_0x0412('0x17')](function(_0x2e8fa6){if(_0x2e8fa6){_0x2e8fa6[_0x0412('0x10d')](_0x0412('0x10e'));}});}})[_0x0412('0x17')](function(){if(_0x4f1984[_0x0412('0x107')]&&_0x4f1984[_0x0412('0x107')][_0x0412('0x108')]){var _0x3fa839=[];for(var _0x3b66cb=0x0;_0x3b66cb<_0x4f1984[_0x0412('0x107')][_0x0412('0x108')][_0x0412('0x40')];_0x3b66cb++){var _0x96e60f=_0x4f1984['Interval'][_0x0412('0x108')][_0x3b66cb][_0x0412('0x2c')]({'plain':!![]});_0x3fa839[_0x0412('0xbf')](iftimePromise(_0x96e60f,_0x4f1984));}return BPromise[_0x0412('0x10f')](_0x3fa839)[_0x0412('0x17')](function(_0x12bd3a){return _['some'](_0x12bd3a);});}else{return!![];}})[_0x0412('0x17')](function(_0x380d03){var _0x1cfde6=fs[_0x0412('0xd3')](path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x110')),_0x0412('0xd4'));var _0x9b45b5={'remote':_0x4f1984['remote'],'query':querystring[_0x0412('0x111')](_[_0x0412('0x46')](_0x4f1984[_0x0412('0x2c')]({'plain':!![]}),{'customerIp':_0x51e6b8[_0x0412('0xa7')]['x-forwarded-for']||_0x51e6b8['headers']['x-real-ip']||_0x51e6b8[_0x0412('0x112')][_0x0412('0x113')]||_0x51e6b8['ip'],'referer':_0x51e6b8[_0x0412('0xa7')][_0x0412('0xae')],'openedInteractions':_0x407ab2,'maxInteractions':_0x1ded51,'virtual':_0x45d314[_0x0412('0x10a')],'online':_0x380d03,'custom':_0x45d314}))[_0x0412('0x114')](/'/g,'\x5c\x27')};_0x33c615[_0x0412('0x31')](ejs[_0x0412('0xd5')](Mustache['render'](_0x1cfde6,_0x9b45b5),{'proactiveActions':_0x32376e,'alignment':_0x4f1984['alignment'],'verticalAlignment':_0x4f1984['verticalAlignment'],'div_color':_0x4f1984[_0x0412('0xfa')],'labelText':_0x4f1984[_0x0412('0x115')],'text_color':_0x4f1984[_0x0412('0x116')],'text_button_color':_0x4f1984['textButtonColor'],'button_color':_0x4f1984['color_button'],'background_color':_0x4f1984['backgroundColor'],'hideWhenOffline':_0x4f1984[_0x0412('0x117')],'interval':_0x4f1984[_0x0412('0x118')]}));})[_0x0412('0x21')](handleError(_0x33c615,null));};exports[_0x0412('0x119')]=function(_0x2e4933,_0x46f54d){var _0x3e6e39=_0x2e4933['params']['id'];var _0x40685b=_0x2e4933[_0x0412('0x53')];var _0x5342b2=0xc8;var _0x29b99a=null;return db[_0x0412('0xdf')][_0x0412('0x11a')]({'isolationLevel':db[_0x0412('0xdf')]['Transaction'][_0x0412('0x11b')][_0x0412('0x11c')]},function(_0x22425c){return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x3e6e39},'transaction':_0x22425c})['then'](function(_0x5245f6){if(_0x5245f6){return db[_0x0412('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3e6e39},'transaction':_0x22425c})[_0x0412('0x17')](function(){var _0x248bd8=_[_0x0412('0x35')](_0x40685b,function(_0x43c752){_0x43c752[_0x0412('0x5e')]=_0x3e6e39;return _0x43c752;});return db[_0x0412('0x9c')][_0x0412('0xe1')](_0x248bd8,{'transaction':_0x22425c});});}else{_0x5342b2=0x194;_0x29b99a=[];}});})[_0x0412('0x17')](function(){if(_0x5342b2!==0x194){return db[_0x0412('0x9c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3e6e39},'order':_0x0412('0xa1')})['then'](function(_0x5b8bb2){_0x29b99a=_0x5b8bb2;});}})['catch'](function(_0x5cdc79){_0x5342b2=0x1f4;logger[_0x0412('0x1d')](_0x5cdc79['stack']);if(_0x5cdc79['name']){delete _0x5cdc79[_0x0412('0x30')];}_0x29b99a=_0x5cdc79;})[_0x0412('0x11d')](function(){if(_0x29b99a===null){_0x46f54d[_0x0412('0x2e')](_0x5342b2);}else{if(_0x5342b2===0x1f4){_0x46f54d['status'](_0x5342b2)['send'](_0x29b99a);}else{_0x46f54d[_0x0412('0x22')](_0x5342b2)['json'](_0x29b99a);}}});};exports[_0x0412('0x11e')]=function(_0x339178,_0x3a37aa){var _0x51eef4={};var _0xbf4afb={};var _0x5e7883;var _0x565d3d;return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x339178[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3a37aa,null))[_0x0412('0x17')](function(_0x5e154c){if(_0x5e154c){_0x5e7883=_0x5e154c;_0xbf4afb[_0x0412('0x39')]=_['keys'](db[_0x0412('0x9c')][_0x0412('0x50')]);_0xbf4afb['query']=_[_0x0412('0x3b')](_0x339178[_0x0412('0x3a')]);_0xbf4afb['filters']=_['intersection'](_0xbf4afb[_0x0412('0x39')],_0xbf4afb[_0x0412('0x3a')]);_0x51eef4[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0xbf4afb['model'],qs[_0x0412('0x3f')](_0x339178[_0x0412('0x3a')][_0x0412('0x3f')]));_0x51eef4['attributes']=_0x51eef4[_0x0412('0x3e')]['length']?_0x51eef4['attributes']:_0xbf4afb[_0x0412('0x39')];_0x51eef4[_0x0412('0x43')]=qs['sort'](_0x339178[_0x0412('0x3a')]['sort']);_0x51eef4[_0x0412('0x47')]=qs['filters'](_[_0x0412('0x45')](_0x339178[_0x0412('0x3a')],_0xbf4afb['filters']));if(_0x339178[_0x0412('0x3a')]['filter']){_0x51eef4[_0x0412('0x47')]=_['merge'](_0x51eef4[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x51eef4[_0x0412('0x3e')],function(_0x22ddb4){var _0xfad51e={};_0xfad51e[_0x22ddb4]={'$like':'%'+_0x339178[_0x0412('0x3a')]['filter']+'%'};return _0xfad51e;})});}_0x51eef4=_[_0x0412('0x46')]({},_0x51eef4,_0x339178[_0x0412('0x4a')]);return _0x5e7883[_0x0412('0x11e')](_0x51eef4);}})['then'](function(_0x246ffa){if(_0x246ffa){_0x565d3d=_0x246ffa[_0x0412('0x40')];if(!_0x339178[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x51eef4[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x339178[_0x0412('0x3a')][_0x0412('0x26')]);_0x51eef4[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x339178[_0x0412('0x3a')]['offset']);}return _0x5e7883[_0x0412('0x11e')](_0x51eef4);}})[_0x0412('0x17')](function(_0x3cc549){if(_0x3cc549){return _0x3cc549?{'count':_0x565d3d,'rows':_0x3cc549}:null;}})['then'](respondWithResult(_0x3a37aa,null))[_0x0412('0x21')](handleError(_0x3a37aa,null));};exports[_0x0412('0x11f')]=function(_0x93860f,_0x3ca41d){return db[_0x0412('0x120')][_0x0412('0x51')]({'where':{'id':_0x93860f['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3ca41d,null))[_0x0412('0x17')](function(_0x2004f4){if(_0x2004f4){return _0x2004f4['addProactiveActions'](_0x93860f['body'][_0x0412('0x69')],_['omit'](_0x93860f[_0x0412('0x53')],[_0x0412('0x69'),'id'])||{});}})[_0x0412('0x17')](respondWithResult(_0x3ca41d,null))['catch'](handleError(_0x3ca41d,null));};exports[_0x0412('0x109')]=function(_0x4380c5,_0x47155c){var _0x3ca051={};var _0xf892f3={};var _0x121594;var _0x1dea1c;return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x4380c5[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x47155c,null))[_0x0412('0x17')](function(_0x1a2245){if(_0x1a2245){_0x121594=_0x1a2245;_0xf892f3[_0x0412('0x39')]=_['keys'](db[_0x0412('0x121')][_0x0412('0x50')]);_0xf892f3[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x4380c5[_0x0412('0x3a')]);_0xf892f3['filters']=_['intersection'](_0xf892f3[_0x0412('0x39')],_0xf892f3[_0x0412('0x3a')]);_0x3ca051[_0x0412('0x3e')]=_['intersection'](_0xf892f3['model'],qs[_0x0412('0x3f')](_0x4380c5['query']['fields']));_0x3ca051[_0x0412('0x3e')]=_0x3ca051['attributes']['length']?_0x3ca051['attributes']:_0xf892f3[_0x0412('0x39')];_0x3ca051[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x4380c5[_0x0412('0x3a')][_0x0412('0x44')]);_0x3ca051[_0x0412('0x47')]=qs['filters'](_[_0x0412('0x45')](_0x4380c5['query'],_0xf892f3[_0x0412('0x3c')]));if(_0x4380c5[_0x0412('0x3a')][_0x0412('0x49')]){_0x3ca051['where']=_['merge'](_0x3ca051[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x3ca051[_0x0412('0x3e')],function(_0x26d8f8){var _0x41b134={};_0x41b134[_0x26d8f8]={'$like':'%'+_0x4380c5[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x41b134;})});}_0x3ca051=_[_0x0412('0x46')]({},_0x3ca051,_0x4380c5[_0x0412('0x4a')]);return _0x121594['getProactiveActions'](_0x3ca051);}})['then'](function(_0x42608c){if(_0x42608c){_0x1dea1c=_0x42608c[_0x0412('0x40')];if(!_0x4380c5['query'][_0x0412('0x41')](_0x0412('0x42'))){_0x3ca051[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x4380c5['query']['limit']);_0x3ca051[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x4380c5[_0x0412('0x3a')][_0x0412('0x25')]);}return _0x121594[_0x0412('0x109')](_0x3ca051);}})[_0x0412('0x17')](function(_0x3f0bb5){if(_0x3f0bb5){return _0x3f0bb5?{'count':_0x1dea1c,'rows':_0x3f0bb5}:null;}})[_0x0412('0x17')](respondWithResult(_0x47155c,null))['catch'](handleError(_0x47155c,null));};exports[_0x0412('0x122')]=function(_0x227840,_0x42f9c7){var _0x1cdb91=_0x227840[_0x0412('0x3a')][_0x0412('0x123')]===_0x0412('0x124')?'offlineForm':_0x0412('0x125');return db[_0x0412('0x4b')][_0x0412('0x51')]({'attributes':['id',_0x1cdb91],'where':{'id':_0x227840[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x42f9c7,null))[_0x0412('0x17')](function(_0x39ec88){if(_0x39ec88){var _0x2f7f58=_0x39ec88[_0x1cdb91];var _0x29f086=_0x2f7f58&&_0x2f7f58[_0x0412('0x126')]?_0x2f7f58[_0x0412('0x126')]:[];_0x42f9c7[_0x0412('0x31')]({'fromKey':_[_0x0412('0x7e')](_0x2f7f58[_0x0412('0x127')])?undefined:_0x2f7f58[_0x0412('0x127')],'count':_0x29f086[_0x0412('0x40')],'rows':_0x29f086});}})[_0x0412('0x21')](handleError(_0x42f9c7,null));};exports['getOfflineMessages']=function(_0x586450,_0x5d8c51){var _0x65ca43={'raw':![],'where':{}};var _0x1e3f2d={};var _0x1256a3={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x586450[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x5d8c51,null))[_0x0412('0x17')](function(_0x5d855e){if(_0x5d855e){_0x1e3f2d[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0xd7')]['rawAttributes']);_0x1e3f2d[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x586450[_0x0412('0x3a')]);_0x1e3f2d['filters']=_['intersection'](_0x1e3f2d[_0x0412('0x39')],_0x1e3f2d[_0x0412('0x3a')]);_0x65ca43['attributes']=_['intersection'](_0x1e3f2d['model'],qs[_0x0412('0x3f')](_0x586450[_0x0412('0x3a')][_0x0412('0x3f')]));_0x65ca43['attributes']=_0x65ca43[_0x0412('0x3e')]['length']?_0x65ca43[_0x0412('0x3e')]:_0x1e3f2d[_0x0412('0x39')];if(!_0x586450[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x65ca43[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x586450[_0x0412('0x3a')][_0x0412('0x26')]);_0x65ca43[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x586450[_0x0412('0x3a')][_0x0412('0x25')]);}_0x65ca43[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x586450['query']['sort']);_0x65ca43[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x586450[_0x0412('0x3a')],_0x1e3f2d[_0x0412('0x3c')]));_0x65ca43[_0x0412('0x47')]['ChatWebsiteId']=_0x5d855e['id'];if(_0x586450['query'][_0x0412('0x49')]){_0x65ca43[_0x0412('0x47')]=_[_0x0412('0x46')](_0x65ca43['where'],{'$or':_[_0x0412('0x35')](_0x65ca43[_0x0412('0x3e')],function(_0x52e1bf){var _0x6af435={};_0x6af435[_0x52e1bf]={'$like':'%'+_0x586450['query'][_0x0412('0x49')]+'%'};return _0x6af435;})});}_0x65ca43=_['merge']({},_0x65ca43,_0x586450[_0x0412('0x4a')]);return db[_0x0412('0xd7')][_0x0412('0x28')]({'where':_0x65ca43[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x778324){_0x1256a3['count']=_0x778324;if(_0x586450[_0x0412('0x3a')][_0x0412('0x4c')]){_0x65ca43[_0x0412('0x4d')]=[{'all':!![]}];}else{_0x65ca43[_0x0412('0x4d')]=[{'model':db['CmContact'],'as':_0x0412('0xf7'),'required':![]},{'model':db[_0x0412('0xe0')],'as':'Attachments','required':![]}];}return db[_0x0412('0xd7')][_0x0412('0x62')](_0x65ca43);})[_0x0412('0x17')](function(_0x25e307){_0x1256a3['rows']=_0x25e307;return _0x1256a3;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x5d8c51,_0x65ca43))[_0x0412('0x21')](handleError(_0x5d8c51,null));};exports[_0x0412('0x128')]=function(_0x23b5bd,_0x2686ec){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x23b5bd['params']['id']}})['then'](handleEntityNotFound(_0x2686ec,null))['then'](function(_0xc55c0f){if(_0xc55c0f){return _0xc55c0f[_0x0412('0x128')](_0x23b5bd['body'][_0x0412('0x69')],_[_0x0412('0xf5')](_0x23b5bd['body'],['ids','id'])||{})[_0x0412('0xd2')](function(_0x2235be){for(var _0x4ca72f=0x0;_0x4ca72f<_0x23b5bd['body']['ids'][_0x0412('0x40')];_0x4ca72f+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x23b5bd[_0x0412('0x53')][_0x0412('0x69')][_0x4ca72f]),'ChatWebsiteId':Number(_0x23b5bd[_0x0412('0x4f')]['id'])});}return _0x2235be;});}})[_0x0412('0x17')](respondWithResult(_0x2686ec,null))[_0x0412('0x21')](handleError(_0x2686ec,null));};exports[_0x0412('0x129')]=function(_0xad3ee8,_0x1ca879){return db[_0x0412('0x4b')]['find']({'where':{'id':_0xad3ee8['params']['id']}})['then'](handleEntityNotFound(_0x1ca879,null))[_0x0412('0x17')](function(_0x6ff73a){if(_0x6ff73a){return _0x6ff73a['removeAgents'](_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')])[_0x0412('0x17')](function(){if(_[_0x0412('0x12a')](_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')])){for(var _0x2fa9e0=0x0;_0x2fa9e0<_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')][_0x0412('0x40')];_0x2fa9e0+=0x1){socket[_0x0412('0x12b')](_0x0412('0x12c'),{'UserId':Number(_0xad3ee8['query'][_0x0412('0x69')][_0x2fa9e0]),'ChatWebsiteId':Number(_0xad3ee8[_0x0412('0x4f')]['id'])});}}else{socket[_0x0412('0x12b')](_0x0412('0x12c'),{'UserId':Number(_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')]),'ChatWebsiteId':Number(_0xad3ee8[_0x0412('0x4f')]['id'])});}});}})[_0x0412('0x17')](respondWithStatusCode(_0x1ca879,null))[_0x0412('0x21')](handleError(_0x1ca879,null));};exports[_0x0412('0x12d')]=function(_0xbf4945,_0x2a96cb){var _0x486558={};var _0x310d19={};var _0x120ba2;var _0x4733f6;return db['ChatWebsite']['findOne']({'where':{'id':_0xbf4945['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x2a96cb,null))[_0x0412('0x17')](function(_0x338a0b){if(_0x338a0b){_0x120ba2=_0x338a0b;_0x310d19['model']=_[_0x0412('0x3b')](db['User']['rawAttributes']);_0x310d19[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0xbf4945[_0x0412('0x3a')]);_0x310d19[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x310d19[_0x0412('0x39')],_0x310d19[_0x0412('0x3a')]);_0x486558[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x310d19[_0x0412('0x39')],qs[_0x0412('0x3f')](_0xbf4945[_0x0412('0x3a')][_0x0412('0x3f')]));_0x486558[_0x0412('0x3e')]=_0x486558['attributes'][_0x0412('0x40')]?_0x486558['attributes']:_0x310d19[_0x0412('0x39')];_0x486558[_0x0412('0x43')]=qs['sort'](_0xbf4945[_0x0412('0x3a')][_0x0412('0x44')]);_0x486558[_0x0412('0x47')]=qs['filters'](_['pick'](_0xbf4945[_0x0412('0x3a')],_0x310d19[_0x0412('0x3c')]));if(_0xbf4945[_0x0412('0x3a')][_0x0412('0x49')]){_0x486558[_0x0412('0x47')]=_[_0x0412('0x46')](_0x486558[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x486558[_0x0412('0x3e')],function(_0x3d0093){var _0x3ba2c4={};_0x3ba2c4[_0x3d0093]={'$like':'%'+_0xbf4945[_0x0412('0x3a')]['filter']+'%'};return _0x3ba2c4;})});}_0x486558=_[_0x0412('0x46')]({},_0x486558,_0xbf4945[_0x0412('0x4a')]);return _0x120ba2[_0x0412('0x12d')](_0x486558);}})['then'](function(_0xa540d8){if(_0xa540d8){_0x4733f6=_0xa540d8[_0x0412('0x40')];if(!_0xbf4945[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x486558[_0x0412('0x26')]=qs['limit'](_0xbf4945[_0x0412('0x3a')][_0x0412('0x26')]);_0x486558[_0x0412('0x25')]=qs[_0x0412('0x25')](_0xbf4945[_0x0412('0x3a')]['offset']);}return _0x120ba2['getAgents'](_0x486558);}})['then'](function(_0x235ebb){if(_0x235ebb){return _0x235ebb?{'count':_0x4733f6,'rows':_0x235ebb}:null;}})['then'](respondWithResult(_0x2a96cb,null))['catch'](handleError(_0x2a96cb,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 38bf80a..b7d34d3 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 _0x95f4=['ChatWebsite','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x95f4,0xf1));var _0x495f=function(_0x27cbe6,_0x55bece){_0x27cbe6=_0x27cbe6-0x0;var _0x222146=_0x95f4[_0x27cbe6];return _0x222146;};'use strict';var EventEmitter=require(_0x495f('0x0'));var ChatWebsite=require(_0x495f('0x1'))['db'][_0x495f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x495f('0x3'),'afterDestroy':_0x495f('0x4')};function emitEvent(_0x5edb36){return function(_0x501377,_0x87cc22,_0x22465d){ChatWebsiteEvents[_0x495f('0x5')](_0x5edb36+':'+_0x501377['id'],_0x501377);ChatWebsiteEvents['emit'](_0x5edb36,_0x501377);_0x22465d(null);};}for(var e in events){if(events[_0x495f('0x6')](e)){var event=events[e];ChatWebsite[_0x495f('0x7')](e,emitEvent(event));}}module[_0x495f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3d6d=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0xcd20dc,_0x155eca){var _0xae33d5=function(_0x1add3f){while(--_0x1add3f){_0xcd20dc['push'](_0xcd20dc['shift']());}};_0xae33d5(++_0x155eca);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x3d6d[_0x13187a];return _0x65b85f;};'use strict';var EventEmitter=require(_0xd3d6('0x0'));var ChatWebsite=require(_0xd3d6('0x1'))['db'][_0xd3d6('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd3d6('0x3')](0x0);var events={'afterCreate':_0xd3d6('0x4'),'afterUpdate':_0xd3d6('0x5'),'afterDestroy':_0xd3d6('0x6')};function emitEvent(_0x15e35a){return function(_0x297bd6,_0x3d5e37,_0xee81c0){ChatWebsiteEvents['emit'](_0x15e35a+':'+_0x297bd6['id'],_0x297bd6);ChatWebsiteEvents['emit'](_0x15e35a,_0x297bd6);_0xee81c0(null);};}for(var e in events){if(events[_0xd3d6('0x7')](e)){var event=events[e];ChatWebsite[_0xd3d6('0x8')](e,emitEvent(event));}}module[_0xd3d6('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a20f557..5790082 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 _0x9c09=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0xac2ff1,_0x26f6ad){var _0x222180=function(_0x1d0baa){while(--_0x1d0baa){_0xac2ff1['push'](_0xac2ff1['shift']());}};_0x222180(++_0x26f6ad);}(_0x9c09,0x158));var _0x99c0=function(_0x25d9d7,_0x2c5cbb){_0x25d9d7=_0x25d9d7-0x0;var _0xdcb28=_0x9c09[_0x25d9d7];return _0xdcb28;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x99c0('0x0'))('api');var moment=require(_0x99c0('0x1'));var BPromise=require(_0x99c0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x99c0('0x3'));var config=require(_0x99c0('0x4'));var attributes=require(_0x99c0('0x5'));module[_0x99c0('0x6')]=function(_0x1a2690,_0x2f6a61){return _0x1a2690['define'](_0x99c0('0x7'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97ac=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0xc7f8c1,_0x12576f){var _0x137f57=function(_0x487c50){while(--_0x487c50){_0xc7f8c1['push'](_0xc7f8c1['shift']());}};_0x137f57(++_0x12576f);}(_0x97ac,0xbe));var _0xc97a=function(_0x3ac392,_0x57126b){_0x3ac392=_0x3ac392-0x0;var _0x788ab8=_0x97ac[_0x3ac392];return _0x788ab8;};'use strict';var _=require(_0xc97a('0x0'));var util=require(_0xc97a('0x1'));var logger=require(_0xc97a('0x2'))(_0xc97a('0x3'));var moment=require(_0xc97a('0x4'));var BPromise=require(_0xc97a('0x5'));var rp=require(_0xc97a('0x6'));var fs=require('fs');var path=require(_0xc97a('0x7'));var rimraf=require(_0xc97a('0x8'));var config=require(_0xc97a('0x9'));var attributes=require(_0xc97a('0xa'));module[_0xc97a('0xb')]=function(_0x5eda35,_0x42b436){return _0x5eda35[_0xc97a('0xc')](_0xc97a('0xd'),attributes,{'tableName':_0xc97a('0xe'),'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 0b3e3f5..4a9a198 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 _0xc36a=['../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf911e5,_0x2909ee){var _0x26e8f4=function(_0x331ede){while(--_0x331ede){_0xf911e5['push'](_0xf911e5['shift']());}};_0x26e8f4(++_0x2909ee);}(_0xc36a,0xae));var _0xac36=function(_0x4026eb,_0x61d79e){_0x4026eb=_0x4026eb-0x0;var _0x206f3c=_0xc36a[_0x4026eb];return _0x206f3c;};'use strict';var _=require(_0xac36('0x0'));var util=require(_0xac36('0x1'));var moment=require(_0xac36('0x2'));var BPromise=require(_0xac36('0x3'));var rs=require(_0xac36('0x4'));var fs=require('fs');var Redis=require(_0xac36('0x5'));var db=require(_0xac36('0x6'))['db'];var utils=require(_0xac36('0x7'));var logger=require(_0xac36('0x8'))('rpc');var config=require(_0xac36('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xac36('0xa')]['http']({'port':0x232a});config[_0xac36('0xb')]=_['defaults'](config[_0xac36('0xb')],{'host':_0xac36('0xc'),'port':0x18eb});var socket=require(_0xac36('0xd'))(new Redis(config[_0xac36('0xb')]));require(_0xac36('0xe'))[_0xac36('0xf')](socket);function respondWithRpcPromise(_0x2074f5,_0x16b5d2,_0x14f6c3){return new BPromise(function(_0x1df4b7,_0x5b641c){return client['request'](_0x2074f5,_0x14f6c3)[_0xac36('0x10')](function(_0x4c51a9){logger['info'](_0xac36('0x11'),_0x16b5d2,_0xac36('0x12'));logger['debug'](_0xac36('0x13'),_0x16b5d2,'request\x20sent',JSON[_0xac36('0x14')](_0x4c51a9));if(_0x4c51a9[_0xac36('0x15')]){if(_0x4c51a9[_0xac36('0x15')][_0xac36('0x16')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x16b5d2,_0x4c51a9[_0xac36('0x15')]['message']);return _0x5b641c(_0x4c51a9[_0xac36('0x15')]['message']);}logger[_0xac36('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x16b5d2,_0x4c51a9[_0xac36('0x15')][_0xac36('0x17')]);return _0x1df4b7(_0x4c51a9['error']['message']);}else{logger[_0xac36('0x18')](_0xac36('0x11'),_0x16b5d2,_0xac36('0x12'));_0x1df4b7(_0x4c51a9[_0xac36('0x19')][_0xac36('0x17')]);}})['catch'](function(_0x50d208){logger[_0xac36('0x15')](_0xac36('0x11'),_0x16b5d2,_0x50d208);_0x5b641c(_0x50d208);});});} \ No newline at end of file +var _0xef0e=['ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent'];(function(_0x2d7842,_0x5e1932){var _0x35485d=function(_0x56843a){while(--_0x56843a){_0x2d7842['push'](_0x2d7842['shift']());}};_0x35485d(++_0x5e1932);}(_0xef0e,0x129));var _0xeef0=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xef0e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xeef0('0x0'));var util=require(_0xeef0('0x1'));var moment=require(_0xeef0('0x2'));var BPromise=require(_0xeef0('0x3'));var rs=require(_0xeef0('0x4'));var fs=require('fs');var Redis=require(_0xeef0('0x5'));var db=require(_0xeef0('0x6'))['db'];var utils=require(_0xeef0('0x7'));var logger=require(_0xeef0('0x8'))(_0xeef0('0x9'));var config=require(_0xeef0('0xa'));var jayson=require(_0xeef0('0xb'));var client=jayson['client'][_0xeef0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeef0('0xd')],{'host':_0xeef0('0xe'),'port':0x18eb});var socket=require(_0xeef0('0xf'))(new Redis(config['redis']));require(_0xeef0('0x10'))[_0xeef0('0x11')](socket);function respondWithRpcPromise(_0x1f44ca,_0x44f12f,_0x327064){return new BPromise(function(_0x2514ab,_0x4bb600){return client[_0xeef0('0x12')](_0x1f44ca,_0x327064)[_0xeef0('0x13')](function(_0x291b28){logger[_0xeef0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x44f12f,_0xeef0('0x15'));logger['debug'](_0xeef0('0x16'),_0x44f12f,'request\x20sent',JSON['stringify'](_0x291b28));if(_0x291b28[_0xeef0('0x17')]){if(_0x291b28[_0xeef0('0x17')][_0xeef0('0x18')]===0x1f4){logger[_0xeef0('0x17')](_0xeef0('0x19'),_0x44f12f,_0x291b28[_0xeef0('0x17')]['message']);return _0x4bb600(_0x291b28['error']['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x44f12f,_0x291b28[_0xeef0('0x17')][_0xeef0('0x1a')]);return _0x2514ab(_0x291b28['error'][_0xeef0('0x1a')]);}else{logger['info'](_0xeef0('0x19'),_0x44f12f,_0xeef0('0x15'));_0x2514ab(_0x291b28[_0xeef0('0x1b')][_0xeef0('0x1a')]);}})[_0xeef0('0x1c')](function(_0x4ebc33){logger[_0xeef0('0x17')](_0xeef0('0x19'),_0x44f12f,_0x4ebc33);_0x4bb600(_0x4ebc33);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 435aec5..876441a 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 _0xf822=['register','length','chatWebsite:','./chatWebsite.events','save','remove','removeListener'];(function(_0x532c54,_0x54f860){var _0x5887e5=function(_0xbf8d0a){while(--_0xbf8d0a){_0x532c54['push'](_0x532c54['shift']());}};_0x5887e5(++_0x54f860);}(_0xf822,0x1df));var _0x2f82=function(_0x4b3e92,_0x5ebeb8){_0x4b3e92=_0x4b3e92-0x0;var _0x434aa6=_0xf822[_0x4b3e92];return _0x434aa6;};'use strict';var ChatWebsiteEvents=require(_0x2f82('0x0'));var events=[_0x2f82('0x1'),_0x2f82('0x2'),'update'];function createListener(_0x3c59ea,_0x21d886){return function(_0xbc2043){_0x21d886['emit'](_0x3c59ea,_0xbc2043);};}function removeListener(_0x59af3c,_0x5cd861){return function(){ChatWebsiteEvents[_0x2f82('0x3')](_0x59af3c,_0x5cd861);};}exports[_0x2f82('0x4')]=function(_0x183242){for(var _0x107237=0x0,_0x38c006=events[_0x2f82('0x5')];_0x107237<_0x38c006;_0x107237++){var _0x4da9c6=events[_0x107237];var _0x503c43=createListener(_0x2f82('0x6')+_0x4da9c6,_0x183242);ChatWebsiteEvents['on'](_0x4da9c6,_0x503c43);}}; \ No newline at end of file +var _0xd032=['./chatWebsite.events','save','remove','chatWebsite:'];(function(_0x250441,_0x4a1f85){var _0x1fbace=function(_0x148356){while(--_0x148356){_0x250441['push'](_0x250441['shift']());}};_0x1fbace(++_0x4a1f85);}(_0xd032,0xf0));var _0x2d03=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd032[_0x2070da];return _0x4f9fe1;};'use strict';var ChatWebsiteEvents=require(_0x2d03('0x0'));var events=[_0x2d03('0x1'),_0x2d03('0x2'),'update'];function createListener(_0x3b5924,_0x55a9f4){return function(_0x5a0f14){_0x55a9f4['emit'](_0x3b5924,_0x5a0f14);};}function removeListener(_0x1bc5cc,_0x18e738){return function(){ChatWebsiteEvents['removeListener'](_0x1bc5cc,_0x18e738);};}exports['register']=function(_0x7f54ae){for(var _0x3256dd=0x0,_0x3ff60e=events['length'];_0x3256dd<_0x3ff60e;_0x3256dd++){var _0x440605=events[_0x3256dd];var _0x491b57=createListener(_0x2d03('0x3')+_0x440605,_0x7f54ae);ChatWebsiteEvents['on'](_0x440605,_0x491b57);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index e977451..a378bd0 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 _0x03e2=['replace','extname','/:id/offline','any','offline','addInteraction','addApplications','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','join','server/files/images/avatars/','format','/:id/avatar','addCustomerAvatar','server/files','attachments','offline-chat'];(function(_0x501695,_0xda9d02){var _0xca4b6c=function(_0x362f34){while(--_0x362f34){_0x501695['push'](_0x501695['shift']());}};_0xca4b6c(++_0xda9d02);}(_0x03e2,0x1a1));var _0x203e=function(_0x5dba29,_0x175d69){_0x5dba29=_0x5dba29-0x0;var _0x40a177=_0x03e2[_0x5dba29];return _0x40a177;};'use strict';var multer=require('multer');var util=require(_0x203e('0x0'));var path=require(_0x203e('0x1'));var timeout=require(_0x203e('0x2'));var express=require(_0x203e('0x3'));var router=express[_0x203e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x203e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x203e('0x6'));var controller=require('./chatWebsite.controller');router[_0x203e('0x7')]('/',auth[_0x203e('0x8')](),controller[_0x203e('0x9')]);router[_0x203e('0x7')]('/describe',auth[_0x203e('0x8')](),controller['describe']);router[_0x203e('0x7')](_0x203e('0xa'),auth[_0x203e('0x8')](),controller[_0x203e('0xb')]);router['get'](_0x203e('0xc'),auth[_0x203e('0x8')](),controller['getDispositions']);router['get'](_0x203e('0xd'),auth[_0x203e('0x8')](),controller[_0x203e('0xe')]);router[_0x203e('0x7')](_0x203e('0xf'),controller[_0x203e('0x10')]);router[_0x203e('0x7')]('/:id/avatar',controller[_0x203e('0x11')]);router[_0x203e('0x7')](_0x203e('0x12'),controller['getCustomerAvatar']);router[_0x203e('0x7')](_0x203e('0x13'),controller[_0x203e('0x14')]);router[_0x203e('0x7')](_0x203e('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x203e('0x16')]);router[_0x203e('0x7')](_0x203e('0x17'),auth[_0x203e('0x8')](),controller[_0x203e('0x18')]);router[_0x203e('0x7')]('/:id/proactive_actions',auth[_0x203e('0x8')](),controller[_0x203e('0x19')]);router[_0x203e('0x7')](_0x203e('0x1a'),controller[_0x203e('0x1b')]);router[_0x203e('0x7')](_0x203e('0x1c'),auth[_0x203e('0x8')](),controller[_0x203e('0x1d')]);router[_0x203e('0x7')](_0x203e('0x1e'),auth[_0x203e('0x8')](),controller[_0x203e('0x1f')]);router[_0x203e('0x20')]('/',auth[_0x203e('0x8')](),controller[_0x203e('0x21')]);router['post'](_0x203e('0xc'),auth['isAuthenticated'](),controller[_0x203e('0x22')]);router[_0x203e('0x20')](_0x203e('0xd'),auth[_0x203e('0x8')](),controller[_0x203e('0x23')]);var upload=multer({'storage':multer[_0x203e('0x24')]({'destination':function(_0x376a35,_0xb8cb10,_0x4f99b0){_0x4f99b0(null,path['join'](config[_0x203e('0x25')],_0x203e('0x26')));},'filename':function(_0x6e71f8,_0x453122,_0x52c72e){_0x52c72e(null,util['format'](_0x203e('0x27'),Date[_0x203e('0x28')](),_0x453122[_0x203e('0x29')]));}})});router[_0x203e('0x20')]('/:id/logo',upload[_0x203e('0x2a')](_0x203e('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x203e('0x24')]({'destination':function(_0x2ef486,_0x340292,_0x159883){_0x159883(null,path[_0x203e('0x2c')](config['root'],_0x203e('0x2d')));},'filename':function(_0x48b093,_0x5aa561,_0x5b22bb){_0x5b22bb(null,util[_0x203e('0x2e')](_0x203e('0x27'),Date[_0x203e('0x28')](),_0x5aa561[_0x203e('0x29')]));}})});router[_0x203e('0x20')](_0x203e('0x2f'),upload[_0x203e('0x2a')](_0x203e('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x203e('0x24')]({'destination':function(_0x554453,_0x246df1,_0x441eb5){_0x441eb5(null,path[_0x203e('0x2c')](config[_0x203e('0x25')],_0x203e('0x2d')));},'filename':function(_0xcd29b,_0x1c3d36,_0x15f124){_0x15f124(null,util[_0x203e('0x2e')](_0x203e('0x27'),Date[_0x203e('0x28')](),_0x1c3d36[_0x203e('0x29')]));}})});router[_0x203e('0x20')]('/:id/customer_avatar',upload[_0x203e('0x2a')](_0x203e('0x2b')),controller[_0x203e('0x30')]);var upload=multer({'storage':multer[_0x203e('0x24')]({'destination':function(_0xac71a,_0x50503b,_0x19525c){_0x19525c(null,path[_0x203e('0x2c')](config[_0x203e('0x25')],_0x203e('0x2d')));},'filename':function(_0x5f2fe5,_0x5611ab,_0x12c7e4){_0x12c7e4(null,util[_0x203e('0x2e')]('%s-%s',Date[_0x203e('0x28')](),_0x5611ab['originalname']));}})});router[_0x203e('0x20')](_0x203e('0x13'),upload[_0x203e('0x2a')](_0x203e('0x2b')),controller['addSystemAvatar']);router[_0x203e('0x20')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x203e('0x24')]({'destination':function(_0x92af98,_0x4011e6,_0x48af38){const _0x2211bc=path[_0x203e('0x2c')](config[_0x203e('0x25')],_0x203e('0x31'),_0x203e('0x32'),_0x203e('0x33'));fs_extra['ensureDir'](_0x2211bc,function(){_0x48af38(null,_0x2211bc);});},'filename':function(_0x89bb4a,_0x33b78a,_0x3c27ff){const _0x24b301=_0x33b78a['originalname'][_0x203e('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6aee0d=path[_0x203e('0x35')](_0x24b301);const _0x38fa3d=Date[_0x203e('0x28')]()+'-'+_0x24b301['replace'](_0x6aee0d,'')+_0x6aee0d;_0x3c27ff(null,_0x38fa3d);}})});router[_0x203e('0x20')](_0x203e('0x36'),offlineUploadMulter[_0x203e('0x37')](),controller[_0x203e('0x38')]);router[_0x203e('0x20')]('/:id/interactions',auth[_0x203e('0x8')](),controller[_0x203e('0x39')]);router['post']('/:id/applications',auth[_0x203e('0x8')](),controller[_0x203e('0x3a')]);router[_0x203e('0x20')]('/:id/proactive_actions',auth[_0x203e('0x8')](),controller['addProactiveActions']);router[_0x203e('0x20')](_0x203e('0x1e'),auth[_0x203e('0x8')](),controller['addAgents']);router[_0x203e('0x3b')](_0x203e('0xa'),auth[_0x203e('0x8')](),controller[_0x203e('0x3c')]);router[_0x203e('0x3d')](_0x203e('0xa'),auth[_0x203e('0x8')](),controller[_0x203e('0x3e')]);router[_0x203e('0x3d')]('/:id/dispositions',auth[_0x203e('0x8')](),controller[_0x203e('0x3f')]);router['delete'](_0x203e('0xd'),auth[_0x203e('0x8')](),controller[_0x203e('0x40')]);router[_0x203e('0x3d')](_0x203e('0x1e'),auth[_0x203e('0x8')](),controller[_0x203e('0x41')]);module[_0x203e('0x42')]=router; \ No newline at end of file +var _0xdded=['/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','now','originalname','file','addLogo','diskStorage','format','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','notify','server/files','ensureDir','replace','extname','any','offline','addInteraction','addApplications'];(function(_0x35e409,_0x5bcdec){var _0x37e869=function(_0x5a9aed){while(--_0x5a9aed){_0x35e409['push'](_0x35e409['shift']());}};_0x37e869(++_0x5bcdec);}(_0xdded,0x1f4));var _0xddde=function(_0x39e461,_0x85ac0d){_0x39e461=_0x39e461-0x0;var _0x1a9f27=_0xdded[_0x39e461];return _0x1a9f27;};'use strict';var multer=require('multer');var util=require(_0xddde('0x0'));var path=require(_0xddde('0x1'));var timeout=require(_0xddde('0x2'));var express=require('express');var router=express[_0xddde('0x3')]();var fs_extra=require(_0xddde('0x4'));var auth=require(_0xddde('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddde('0x6'));var controller=require(_0xddde('0x7'));router[_0xddde('0x8')]('/',auth[_0xddde('0x9')](),controller[_0xddde('0xa')]);router[_0xddde('0x8')](_0xddde('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xddde('0xc'),auth['isAuthenticated'](),controller[_0xddde('0xd')]);router[_0xddde('0x8')](_0xddde('0xe'),auth[_0xddde('0x9')](),controller['getDispositions']);router[_0xddde('0x8')](_0xddde('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xddde('0x8')](_0xddde('0x10'),controller[_0xddde('0x11')]);router[_0xddde('0x8')](_0xddde('0x12'),controller[_0xddde('0x13')]);router[_0xddde('0x8')](_0xddde('0x14'),controller['getCustomerAvatar']);router[_0xddde('0x8')]('/:id/system_avatar',controller[_0xddde('0x15')]);router[_0xddde('0x8')](_0xddde('0x16'),auth['isAuthenticated'](),controller[_0xddde('0x17')]);router['get'](_0xddde('0x18'),controller[_0xddde('0x19')]);router[_0xddde('0x8')](_0xddde('0x1a'),auth['isAuthenticated'](),controller[_0xddde('0x1b')]);router[_0xddde('0x8')]('/:id/proactive_actions',auth[_0xddde('0x9')](),controller[_0xddde('0x1c')]);router[_0xddde('0x8')](_0xddde('0x1d'),controller[_0xddde('0x1e')]);router[_0xddde('0x8')](_0xddde('0x1f'),auth[_0xddde('0x9')](),controller[_0xddde('0x20')]);router['get'](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x22')]);router[_0xddde('0x23')]('/',auth[_0xddde('0x9')](),controller['create']);router['post'](_0xddde('0xe'),auth[_0xddde('0x9')](),controller[_0xddde('0x24')]);router['post'](_0xddde('0xf'),auth[_0xddde('0x9')](),controller[_0xddde('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x231338,_0x1a00d7,_0x4ce295){_0x4ce295(null,path[_0xddde('0x26')](config[_0xddde('0x27')],_0xddde('0x28')));},'filename':function(_0x395451,_0x18c825,_0x2f54f3){_0x2f54f3(null,util['format']('%s-%s',Date[_0xddde('0x29')](),_0x18c825[_0xddde('0x2a')]));}})});router[_0xddde('0x23')](_0xddde('0x10'),upload['single'](_0xddde('0x2b')),controller[_0xddde('0x2c')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x49c711,_0x2fa2ef,_0x4915d9){_0x4915d9(null,path[_0xddde('0x26')](config[_0xddde('0x27')],'server/files/images/avatars/'));},'filename':function(_0x566dad,_0x20c625,_0x5a7ad1){_0x5a7ad1(null,util[_0xddde('0x2e')]('%s-%s',Date[_0xddde('0x29')](),_0x20c625[_0xddde('0x2a')]));}})});router['post'](_0xddde('0x12'),upload['single'](_0xddde('0x2b')),controller[_0xddde('0x2f')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x43b197,_0x2bbb21,_0x5e900d){_0x5e900d(null,path[_0xddde('0x26')](config['root'],_0xddde('0x30')));},'filename':function(_0xe7ea38,_0x50fb21,_0xc2d98b){_0xc2d98b(null,util[_0xddde('0x2e')]('%s-%s',Date[_0xddde('0x29')](),_0x50fb21[_0xddde('0x2a')]));}})});router['post'](_0xddde('0x14'),upload[_0xddde('0x31')](_0xddde('0x2b')),controller[_0xddde('0x32')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x5a4866,_0x4af352,_0x25b2d7){_0x25b2d7(null,path[_0xddde('0x26')](config[_0xddde('0x27')],'server/files/images/avatars/'));},'filename':function(_0x4b7ea9,_0x4a3c24,_0x5ec35b){_0x5ec35b(null,util[_0xddde('0x2e')]('%s-%s',Date['now'](),_0x4a3c24['originalname']));}})});router[_0xddde('0x23')]('/:id/system_avatar',upload[_0xddde('0x31')](_0xddde('0x2b')),controller['addSystemAvatar']);router[_0xddde('0x23')]('/:id/notify',controller[_0xddde('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x50f6d2,_0x5696e8,_0x3a5683){const _0x2b2107=path[_0xddde('0x26')](config[_0xddde('0x27')],_0xddde('0x34'),'attachments','offline-chat');fs_extra[_0xddde('0x35')](_0x2b2107,function(){_0x3a5683(null,_0x2b2107);});},'filename':function(_0x4f827e,_0x731055,_0x188a14){const _0x13f04b=_0x731055[_0xddde('0x2a')][_0xddde('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1997d9=path[_0xddde('0x37')](_0x13f04b);const _0xc5aa18=Date[_0xddde('0x29')]()+'-'+_0x13f04b[_0xddde('0x36')](_0x1997d9,'')+_0x1997d9;_0x188a14(null,_0xc5aa18);}})});router['post']('/:id/offline',offlineUploadMulter[_0xddde('0x38')](),controller[_0xddde('0x39')]);router[_0xddde('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xddde('0x3a')]);router[_0xddde('0x23')](_0xddde('0x1a'),auth[_0xddde('0x9')](),controller[_0xddde('0x3b')]);router[_0xddde('0x23')](_0xddde('0x3c'),auth[_0xddde('0x9')](),controller[_0xddde('0x3d')]);router[_0xddde('0x23')](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x3e')]);router[_0xddde('0x3f')]('/:id',auth[_0xddde('0x9')](),controller[_0xddde('0x40')]);router[_0xddde('0x41')]('/:id',auth[_0xddde('0x9')](),controller[_0xddde('0x42')]);router['delete']('/:id/dispositions',auth[_0xddde('0x9')](),controller[_0xddde('0x43')]);router[_0xddde('0x41')](_0xddde('0xf'),auth['isAuthenticated'](),controller[_0xddde('0x44')]);router[_0xddde('0x41')](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x45')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 214c1f2..a7fca8c 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 _0x6b69=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','app','get'];(function(_0x5404e9,_0x132866){var _0x2d7c75=function(_0x3a3db9){while(--_0x3a3db9){_0x5404e9['push'](_0x5404e9['shift']());}};_0x2d7c75(++_0x132866);}(_0x6b69,0x7e));var _0x96b6=function(_0x559fe8,_0x42c64a){_0x559fe8=_0x559fe8-0x0;var _0x3df040=_0x6b69[_0x559fe8];return _0x3df040;};var beaverLogger=require(_0x96b6('0x0'));var express=require(_0x96b6('0x1'));var auth=require('../components/auth/service');var config=require(_0x96b6('0x2'));var router=express['Router']();var isProduction=config[_0x96b6('0x3')]==='production'||![];function clientSideLogs(_0x21e091,_0x230089,_0x10fbec){var _0xa7ad5=_0x21e091[_0x96b6('0x4')][_0x96b6('0x5')](_0x96b6('0x6'));if(!_0xa7ad5){throw new Error(_0x96b6('0x7'));}return beaverLogger[_0x96b6('0x8')]({'uri':'/client-logs','logger':_0xa7ad5,'enableCors':!isProduction})(_0x21e091,_0x230089,_0x10fbec);}router[_0x96b6('0x9')](auth[_0x96b6('0xa')](),clientSideLogs);module[_0x96b6('0xb')]=router; \ No newline at end of file +var _0x3b73=['isAuthenticated','express','../components/auth/service','../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x5b2bbb,_0x569892){var _0x4a6a5e=function(_0x261878){while(--_0x261878){_0x5b2bbb['push'](_0x5b2bbb['shift']());}};_0x4a6a5e(++_0x569892);}(_0x3b73,0xd9));var _0x33b7=function(_0x9abce3,_0x462518){_0x9abce3=_0x9abce3-0x0;var _0x15c3a8=_0x3b73[_0x9abce3];return _0x15c3a8;};var beaverLogger=require('beaver-logger/server');var express=require(_0x33b7('0x0'));var auth=require(_0x33b7('0x1'));var config=require(_0x33b7('0x2'));var router=express[_0x33b7('0x3')]();var isProduction=config[_0x33b7('0x4')]===_0x33b7('0x5')||![];function clientSideLogs(_0x39d988,_0x3fb027,_0x4bf4f3){var _0x4419f2=_0x39d988[_0x33b7('0x6')]['get']('client-side-logger');if(!_0x4419f2){throw new Error(_0x33b7('0x7'));}return beaverLogger[_0x33b7('0x8')]({'uri':_0x33b7('0x9'),'logger':_0x4419f2,'enableCors':!isProduction})(_0x39d988,_0x3fb027,_0x4bf4f3);}router[_0x33b7('0xa')](auth[_0x33b7('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 2209919..7738f7b 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 _0xc9d0=['STRING','AmazonAWS','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports'];(function(_0x544b3f,_0x4d8b66){var _0x15787f=function(_0x12467e){while(--_0x12467e){_0x544b3f['push'](_0x544b3f['shift']());}};_0x15787f(++_0x4d8b66);}(_0xc9d0,0xdb));var _0x0c9d=function(_0x7f9f9b,_0x172554){_0x7f9f9b=_0x7f9f9b-0x0;var _0x7f5eb1=_0xc9d0[_0x7f9f9b];return _0x7f5eb1;};'use strict';var Sequelize=require('sequelize');module[_0x0c9d('0x0')]={'name':{'type':Sequelize[_0x0c9d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x0c9d('0x2'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x0c9d('0x3')]('Outlook365',_0x0c9d('0x4'))},'data1':{'type':Sequelize[_0x0c9d('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x0c9d('0x1')],'comment':_0x0c9d('0x5')},'data3':{'type':Sequelize[_0x0c9d('0x1')],'comment':_0x0c9d('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0x0c9d('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':_0x0c9d('0x8')},'data6':{'type':Sequelize[_0x0c9d('0x9')],'comment':_0x0c9d('0xa')},'data7':{'type':Sequelize[_0x0c9d('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xe4d7=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0xe4d7,0x84));var _0x7e4d=function(_0x313cbb,_0x800c66){_0x313cbb=_0x313cbb-0x0;var _0x785bc8=_0xe4d7[_0x313cbb];return _0x785bc8;};'use strict';var Sequelize=require(_0x7e4d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e4d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x7e4d('0x2'),_0x7e4d('0x3'),_0x7e4d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7e4d('0x5')](_0x7e4d('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x7')},'data2':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x8')},'data3':{'type':Sequelize[_0x7e4d('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x9')},'data5':{'type':Sequelize[_0x7e4d('0xa')],'comment':_0x7e4d('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7e4d('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7e4d('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index e4f30b5..0939e46 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 _0xf6c9=['nolimit','order','sort','where','filter','merge','map','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','includeAll','find','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','state','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x11225e,_0x2659f8){var _0x32f595=function(_0x23b9e1){while(--_0x23b9e1){_0x11225e['push'](_0x11225e['shift']());}};_0x32f595(++_0x2659f8);}(_0xf6c9,0x150));var _0x9f6c=function(_0x153221,_0x6b3572){_0x153221=_0x153221-0x0;var _0x1c1186=_0xf6c9[_0x153221];return _0x1c1186;};'use strict';var _=require(_0x9f6c('0x0'));var Redis=require(_0x9f6c('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x9f6c('0x2'));var config=require(_0x9f6c('0x3'));var logger=require(_0x9f6c('0x4'))(_0x9f6c('0x5'));var db=require(_0x9f6c('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x9f6c('0x7')]=_[_0x9f6c('0x8')](config[_0x9f6c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f6c('0x9'))(new Redis(config[_0x9f6c('0x7')]));var redis=new Redis(config[_0x9f6c('0x7')]);function respondWithStatusCode(_0x896236,_0x2b14bf){_0x2b14bf=_0x2b14bf||0xcc;return function(_0x3fd4b7){if(_0x3fd4b7){return _0x896236[_0x9f6c('0xa')](_0x2b14bf);}return _0x896236['status'](_0x2b14bf)[_0x9f6c('0xb')]();};}function respondWithResult(_0x338122,_0x2b8194){_0x2b8194=_0x2b8194||0xc8;return function(_0x23caa6){if(_0x23caa6){return _0x338122[_0x9f6c('0xc')](_0x2b8194)[_0x9f6c('0xd')](_0x23caa6);}};}function respondWithFilteredResult(_0x11b50c,_0x5603c0){return function(_0x45a593){if(_0x45a593){var _0x40b051=typeof _0x5603c0['offset']===_0x9f6c('0xe')&&typeof _0x5603c0[_0x9f6c('0xf')]==='undefined';var _0x3ada6f=_0x45a593[_0x9f6c('0x10')];var _0x2d95ea=_0x40b051?0x0:_0x5603c0[_0x9f6c('0x11')];var _0x2113b1=_0x40b051?_0x45a593[_0x9f6c('0x10')]:_0x5603c0[_0x9f6c('0x11')]+_0x5603c0['limit'];var _0x289f16;if(_0x2113b1>=_0x3ada6f){_0x2113b1=_0x3ada6f;_0x289f16=0xc8;}else{_0x289f16=0xce;}_0x11b50c['status'](_0x289f16);return _0x11b50c[_0x9f6c('0x12')](_0x9f6c('0x13'),_0x2d95ea+'-'+_0x2113b1+'/'+_0x3ada6f)[_0x9f6c('0xd')](_0x45a593);}return null;};}function saveUpdates(_0x2f5655){return function(_0x19e73c){if(_0x19e73c){return _0x19e73c[_0x9f6c('0x14')](_0x2f5655)['then'](function(_0x798f47){return _0x798f47;});}return null;};}function removeEntity(_0x258bf0){return function(_0x2113f2){if(_0x2113f2){return _0x2113f2[_0x9f6c('0x15')]()[_0x9f6c('0x16')](function(){_0x258bf0[_0x9f6c('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x491d04){return function(_0x41b5fa){if(!_0x41b5fa){_0x491d04[_0x9f6c('0xa')](0x194);}return _0x41b5fa;};}function handleError(_0x5d9455,_0x2ec332){_0x2ec332=_0x2ec332||0x1f4;return function(_0xe5369){logger[_0x9f6c('0x17')](_0xe5369[_0x9f6c('0x18')]);if(_0xe5369[_0x9f6c('0x19')]){delete _0xe5369['name'];}_0x5d9455[_0x9f6c('0xc')](_0x2ec332)[_0x9f6c('0x1a')](_0xe5369);};}function maskClientSecret(_0x50e2d1){return _[_0x9f6c('0x1b')](_0x50e2d1[_0x9f6c('0x1c')](0x0,0x3),0x14,'*');}exports[_0x9f6c('0x1d')]=function(_0x705df,_0x4e2e29){var _0x4e8f2d={},_0x5c32e2={},_0x53aaea={'count':0x0,'rows':[]};var _0x5516da=_['map'](db[_0x9f6c('0x1e')][_0x9f6c('0x1f')],function(_0x4d7488){return{'name':_0x4d7488[_0x9f6c('0x20')],'type':_0x4d7488[_0x9f6c('0x21')][_0x9f6c('0x22')]};});_0x5c32e2['model']=_['map'](_0x5516da,_0x9f6c('0x19'));_0x5c32e2[_0x9f6c('0x23')]=_[_0x9f6c('0x24')](_0x705df['query']);_0x5c32e2[_0x9f6c('0x25')]=_[_0x9f6c('0x26')](_0x5c32e2[_0x9f6c('0x27')],_0x5c32e2[_0x9f6c('0x23')]);_0x4e8f2d[_0x9f6c('0x28')]=_[_0x9f6c('0x26')](_0x5c32e2[_0x9f6c('0x27')],qs[_0x9f6c('0x29')](_0x705df[_0x9f6c('0x23')][_0x9f6c('0x29')]));_0x4e8f2d['attributes']=_0x4e8f2d[_0x9f6c('0x28')][_0x9f6c('0x2a')]?_0x4e8f2d[_0x9f6c('0x28')]:_0x5c32e2[_0x9f6c('0x27')];if(!_0x705df['query'][_0x9f6c('0x2b')](_0x9f6c('0x2c'))){_0x4e8f2d[_0x9f6c('0xf')]=qs[_0x9f6c('0xf')](_0x705df[_0x9f6c('0x23')][_0x9f6c('0xf')]);_0x4e8f2d['offset']=qs[_0x9f6c('0x11')](_0x705df[_0x9f6c('0x23')][_0x9f6c('0x11')]);}_0x4e8f2d[_0x9f6c('0x2d')]=qs[_0x9f6c('0x2e')](_0x705df['query'][_0x9f6c('0x2e')]);_0x4e8f2d[_0x9f6c('0x2f')]=qs['filters'](_['pick'](_0x705df[_0x9f6c('0x23')],_0x5c32e2['filters']),_0x5516da);if(_0x705df[_0x9f6c('0x23')][_0x9f6c('0x30')]){_0x4e8f2d[_0x9f6c('0x2f')]=_[_0x9f6c('0x31')](_0x4e8f2d[_0x9f6c('0x2f')],{'$or':_[_0x9f6c('0x32')](_0x5516da,function(_0x3417ee){if(_0x3417ee[_0x9f6c('0x21')]!=='VIRTUAL'){var _0x7eb90b={};_0x7eb90b[_0x3417ee[_0x9f6c('0x19')]]={'$like':'%'+_0x705df[_0x9f6c('0x23')][_0x9f6c('0x30')]+'%'};return _0x7eb90b;}})});}_0x4e8f2d=_[_0x9f6c('0x31')]({},_0x4e8f2d,_0x705df[_0x9f6c('0x33')]);var _0x39379c={'where':_0x4e8f2d[_0x9f6c('0x2f')]};return db[_0x9f6c('0x1e')][_0x9f6c('0x10')](_0x39379c)[_0x9f6c('0x16')](function(_0xea76cb){_0x53aaea['count']=_0xea76cb;if(_0x705df[_0x9f6c('0x23')]['includeAll']){_0x4e8f2d[_0x9f6c('0x34')]=[{'all':!![]}];}return db[_0x9f6c('0x1e')][_0x9f6c('0x35')](_0x4e8f2d);})['then'](function(_0x1fb981){_0x53aaea[_0x9f6c('0x36')]=_['map'](_0x1fb981,function(_0x3fa596){if(_0x3fa596[_0x9f6c('0x37')]===_0x9f6c('0x38')){var _0x55c8cc=encryptor[_0x9f6c('0x39')](_0x3fa596[_0x9f6c('0x3a')]);_0x3fa596[_0x9f6c('0x3a')]=maskClientSecret(_0x55c8cc);}return _0x3fa596;});return _0x53aaea;})['then'](respondWithFilteredResult(_0x4e2e29,_0x4e8f2d))[_0x9f6c('0x3b')](handleError(_0x4e2e29,null));};exports[_0x9f6c('0x3c')]=function(_0x3e9838,_0x398f18){var _0x39a6a9={'raw':!![],'where':{'id':_0x3e9838['params']['id']}},_0x1707f4={};_0x1707f4[_0x9f6c('0x27')]=_[_0x9f6c('0x24')](db[_0x9f6c('0x1e')][_0x9f6c('0x1f')]);_0x1707f4[_0x9f6c('0x23')]=_[_0x9f6c('0x24')](_0x3e9838['query']);_0x1707f4[_0x9f6c('0x25')]=_[_0x9f6c('0x26')](_0x1707f4['model'],_0x1707f4['query']);_0x39a6a9[_0x9f6c('0x28')]=_[_0x9f6c('0x26')](_0x1707f4[_0x9f6c('0x27')],qs[_0x9f6c('0x29')](_0x3e9838['query'][_0x9f6c('0x29')]));_0x39a6a9[_0x9f6c('0x28')]=_0x39a6a9[_0x9f6c('0x28')][_0x9f6c('0x2a')]?_0x39a6a9[_0x9f6c('0x28')]:_0x1707f4[_0x9f6c('0x27')];if(_0x3e9838['query'][_0x9f6c('0x3d')]){_0x39a6a9['include']=[{'all':!![]}];}_0x39a6a9=_['merge']({},_0x39a6a9,_0x3e9838['options']);return db['CloudProvider'][_0x9f6c('0x3e')](_0x39a6a9)[_0x9f6c('0x16')](handleEntityNotFound(_0x398f18,null))[_0x9f6c('0x16')](function(_0x5440ed){if(_0x5440ed[_0x9f6c('0x37')]===_0x9f6c('0x38')){var _0x529648=encryptor['decryptString'](_0x5440ed[_0x9f6c('0x3a')]);_0x5440ed['data3']=maskClientSecret(_0x529648);}return _0x5440ed;})['then'](respondWithResult(_0x398f18,null))[_0x9f6c('0x3b')](handleError(_0x398f18,null));};exports['create']=function(_0x236631,_0x1755a2){if(!_0x236631[_0x9f6c('0x3f')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x236631[_0x9f6c('0x3f')]['service'])throw new Error(_0x9f6c('0x40'));var _0x5cee60=db[_0x9f6c('0x1e')]['rawAttributes'][_0x9f6c('0x37')][_0x9f6c('0x41')];if(!_0x5cee60[_0x9f6c('0x42')](_0x236631[_0x9f6c('0x3f')][_0x9f6c('0x37')]))throw new Error(_0x9f6c('0x43')+_0x5cee60[_0x9f6c('0x44')](',\x20'));if(_0x236631[_0x9f6c('0x3f')][_0x9f6c('0x37')]===_0x9f6c('0x38')&&_0x236631[_0x9f6c('0x3f')][_0x9f6c('0x3a')]){_0x236631['body'][_0x9f6c('0x3a')]=encryptor[_0x9f6c('0x45')](_0x236631['body'][_0x9f6c('0x3a')]);}return db['CloudProvider'][_0x9f6c('0x46')](_0x236631[_0x9f6c('0x3f')],{})[_0x9f6c('0x16')](respondWithResult(_0x1755a2,0xc9))[_0x9f6c('0x3b')](handleError(_0x1755a2,null));};exports[_0x9f6c('0x14')]=function(_0x40a7d5,_0x174acb){if(_0x40a7d5[_0x9f6c('0x3f')]['id']){delete _0x40a7d5[_0x9f6c('0x3f')]['id'];}return db[_0x9f6c('0x1e')][_0x9f6c('0x3e')]({'where':{'id':_0x40a7d5['params']['id']}})[_0x9f6c('0x16')](handleEntityNotFound(_0x174acb,null))[_0x9f6c('0x16')](function(_0xa055b){if(_0xa055b[_0x9f6c('0x37')]==='MicrosoftAzure'&&_0x40a7d5[_0x9f6c('0x3f')][_0x9f6c('0x3a')]){_0x40a7d5[_0x9f6c('0x3f')][_0x9f6c('0x3a')]=encryptor[_0x9f6c('0x45')](_0x40a7d5[_0x9f6c('0x3f')][_0x9f6c('0x3a')]);}return _0xa055b;})[_0x9f6c('0x16')](saveUpdates(_0x40a7d5[_0x9f6c('0x3f')],null))['then'](respondWithResult(_0x174acb,null))[_0x9f6c('0x3b')](handleError(_0x174acb,null));};exports[_0x9f6c('0x15')]=function(_0x4a4d19,_0x5431ec){return db[_0x9f6c('0x1e')][_0x9f6c('0x3e')]({'where':{'id':_0x4a4d19[_0x9f6c('0x47')]['id']}})[_0x9f6c('0x16')](handleEntityNotFound(_0x5431ec,null))[_0x9f6c('0x16')](removeEntity(_0x5431ec,null))[_0x9f6c('0x3b')](handleError(_0x5431ec,null));};exports[_0x9f6c('0x48')]=function(_0x5024b3,_0x5d532d){return db['CloudProvider']['findOne']({'where':{'id':_0x5024b3[_0x9f6c('0x47')]['id']},'raw':!![]})[_0x9f6c('0x16')](function(_0x3829cf){if(!_0x3829cf)return _0x5d532d[_0x9f6c('0xa')](0x194);return{'url':oauth[_0x9f6c('0x49')](_0x3829cf,_0x5024b3[_0x9f6c('0x4a')]['id'])};})['then'](respondWithResult(_0x5d532d,null))[_0x9f6c('0x3b')](handleError(_0x5d532d,null));};exports['oauth2MicrosoftCallback']=function(_0x1b1713,_0x3c257b){var _0x38064c=_0x1b1713[_0x9f6c('0x3f')];var _0x1393b3;var _0x500b7d;if(_0x38064c[_0x9f6c('0x17')])throw _0x38064c;redis['get'](_0x38064c[_0x9f6c('0x4b')])[_0x9f6c('0x16')](function(_0x5c00fa){if(!_0x5c00fa)throw new Error('Invalid\x20state\x20parameter');_0x1393b3=JSON['parse'](_0x5c00fa);var _0x4e2cc8=Buffer['from'](_0x38064c[_0x9f6c('0x4b')],_0x9f6c('0x4c'))[_0x9f6c('0x4d')](_0x9f6c('0x4e'));_0x500b7d=JSON[_0x9f6c('0x4f')](_0x4e2cc8);if(!oauth[_0x9f6c('0x50')](_0x38064c[_0x9f6c('0x51')],_0x1393b3[_0x9f6c('0x52')]))throw new Error(_0x9f6c('0x53'));redis['del'](_0x38064c['state']);return oauth[_0x9f6c('0x54')](_0x38064c[_0x9f6c('0x55')],_0x1393b3);})[_0x9f6c('0x16')](function(_0x27a773){_0x1393b3['data5']=_0x27a773[_0x9f6c('0x56')];_0x1393b3[_0x9f6c('0x57')]=_0x27a773[_0x9f6c('0x58')];return db[_0x9f6c('0x1e')][_0x9f6c('0x14')]({'data5':_0x1393b3[_0x9f6c('0x59')],'data6':_0x1393b3['data6']},{'where':{'id':_0x1393b3['id']}});})[_0x9f6c('0x16')](function(){oauth['startRefreshInterval'](_0x1393b3);socket['emit'](_0x9f6c('0x5a'),{'id':_0x500b7d['id']});return;})['then'](respondWithStatusCode(_0x3c257b,null))[_0x9f6c('0x3b')](function(_0x5a2743){if(_0x500b7d){socket[_0x9f6c('0x5b')](_0x9f6c('0x5c'),{'id':_0x500b7d['id']});}if(!_0x1393b3){logger['error'](_0x9f6c('0x5d'),_0x5a2743);return _0x3c257b[_0x9f6c('0xc')](0x1f4)[_0x9f6c('0x1a')](_0x5a2743['message']);}logger[_0x9f6c('0x17')](_0x9f6c('0x5e'),_0x1393b3['id'],JSON['stringify'](_0x5a2743));});}; \ No newline at end of file +var _0x0f1f=['join','find','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','oauth2Claims','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','json','limit','undefined','count','set','Content-Range','update','then','end','error','stack','name','send','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','rows','service','decryptString','data3','show','includeAll','include','MicrosoftAzure','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes'];(function(_0x467fb9,_0x30f4b4){var _0x4d6499=function(_0x4ff293){while(--_0x4ff293){_0x467fb9['push'](_0x467fb9['shift']());}};_0x4d6499(++_0x30f4b4);}(_0x0f1f,0x1a0));var _0xf0f1=function(_0x1758f1,_0x35446f){_0x1758f1=_0x1758f1-0x0;var _0x173003=_0x0f1f[_0x1758f1];return _0x173003;};'use strict';var _=require(_0xf0f1('0x0'));var Redis=require(_0xf0f1('0x1'));var qs=require(_0xf0f1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xf0f1('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xf0f1('0x4'));config[_0xf0f1('0x5')]=_['defaults'](config[_0xf0f1('0x5')],{'host':_0xf0f1('0x6'),'port':0x18eb});var socket=require(_0xf0f1('0x7'))(new Redis(config[_0xf0f1('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x522428,_0x24109e){_0x24109e=_0x24109e||0xcc;return function(_0x91a098){if(_0x91a098){return _0x522428[_0xf0f1('0x8')](_0x24109e);}return _0x522428[_0xf0f1('0x9')](_0x24109e)['end']();};}function respondWithResult(_0x5b245b,_0x5cf839){_0x5cf839=_0x5cf839||0xc8;return function(_0x3dcd64){if(_0x3dcd64){return _0x5b245b[_0xf0f1('0x9')](_0x5cf839)[_0xf0f1('0xa')](_0x3dcd64);}};}function respondWithFilteredResult(_0x39a0fb,_0x2844b8){return function(_0x446e87){if(_0x446e87){var _0x362f39=typeof _0x2844b8['offset']==='undefined'&&typeof _0x2844b8[_0xf0f1('0xb')]===_0xf0f1('0xc');var _0x40e9d4=_0x446e87[_0xf0f1('0xd')];var _0x4eaee8=_0x362f39?0x0:_0x2844b8['offset'];var _0x12efaa=_0x362f39?_0x446e87[_0xf0f1('0xd')]:_0x2844b8['offset']+_0x2844b8[_0xf0f1('0xb')];var _0x51539a;if(_0x12efaa>=_0x40e9d4){_0x12efaa=_0x40e9d4;_0x51539a=0xc8;}else{_0x51539a=0xce;}_0x39a0fb['status'](_0x51539a);return _0x39a0fb[_0xf0f1('0xe')](_0xf0f1('0xf'),_0x4eaee8+'-'+_0x12efaa+'/'+_0x40e9d4)[_0xf0f1('0xa')](_0x446e87);}return null;};}function saveUpdates(_0x3ac7f4){return function(_0xc8df9e){if(_0xc8df9e){return _0xc8df9e[_0xf0f1('0x10')](_0x3ac7f4)[_0xf0f1('0x11')](function(_0x21f6bb){return _0x21f6bb;});}return null;};}function removeEntity(_0x54d690){return function(_0x2be29c){if(_0x2be29c){return _0x2be29c['destroy']()[_0xf0f1('0x11')](function(){_0x54d690[_0xf0f1('0x9')](0xcc)[_0xf0f1('0x12')]();});}};}function handleEntityNotFound(_0x4ecb11){return function(_0xdacdb7){if(!_0xdacdb7){_0x4ecb11[_0xf0f1('0x8')](0x194);}return _0xdacdb7;};}function handleError(_0x26d6e1,_0x41e85b){_0x41e85b=_0x41e85b||0x1f4;return function(_0x58f310){logger[_0xf0f1('0x13')](_0x58f310[_0xf0f1('0x14')]);if(_0x58f310[_0xf0f1('0x15')]){delete _0x58f310['name'];}_0x26d6e1[_0xf0f1('0x9')](_0x41e85b)[_0xf0f1('0x16')](_0x58f310);};}function maskClientSecret(_0x4ba4ae){return _[_0xf0f1('0x17')](_0x4ba4ae['slice'](0x0,0x3),0x14,'*');}exports[_0xf0f1('0x18')]=function(_0xaec399,_0x4f4fd3){var _0x4bc19a={},_0x47390b={},_0x1ad7ad={'count':0x0,'rows':[]};var _0x53e13f=_['map'](db[_0xf0f1('0x19')][_0xf0f1('0x1a')],function(_0x260425){return{'name':_0x260425[_0xf0f1('0x1b')],'type':_0x260425[_0xf0f1('0x1c')][_0xf0f1('0x1d')]};});_0x47390b[_0xf0f1('0x1e')]=_['map'](_0x53e13f,_0xf0f1('0x15'));_0x47390b[_0xf0f1('0x1f')]=_[_0xf0f1('0x20')](_0xaec399[_0xf0f1('0x1f')]);_0x47390b['filters']=_[_0xf0f1('0x21')](_0x47390b[_0xf0f1('0x1e')],_0x47390b[_0xf0f1('0x1f')]);_0x4bc19a['attributes']=_[_0xf0f1('0x21')](_0x47390b[_0xf0f1('0x1e')],qs['fields'](_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x22')]));_0x4bc19a[_0xf0f1('0x23')]=_0x4bc19a[_0xf0f1('0x23')][_0xf0f1('0x24')]?_0x4bc19a[_0xf0f1('0x23')]:_0x47390b[_0xf0f1('0x1e')];if(!_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x25')](_0xf0f1('0x26'))){_0x4bc19a['limit']=qs[_0xf0f1('0xb')](_0xaec399['query'][_0xf0f1('0xb')]);_0x4bc19a[_0xf0f1('0x27')]=qs[_0xf0f1('0x27')](_0xaec399['query'][_0xf0f1('0x27')]);}_0x4bc19a[_0xf0f1('0x28')]=qs['sort'](_0xaec399['query'][_0xf0f1('0x29')]);_0x4bc19a[_0xf0f1('0x2a')]=qs[_0xf0f1('0x2b')](_[_0xf0f1('0x2c')](_0xaec399[_0xf0f1('0x1f')],_0x47390b[_0xf0f1('0x2b')]),_0x53e13f);if(_0xaec399[_0xf0f1('0x1f')]['filter']){_0x4bc19a[_0xf0f1('0x2a')]=_['merge'](_0x4bc19a[_0xf0f1('0x2a')],{'$or':_[_0xf0f1('0x2d')](_0x53e13f,function(_0x472cfb){if(_0x472cfb[_0xf0f1('0x1c')]!==_0xf0f1('0x2e')){var _0x378fe9={};_0x378fe9[_0x472cfb['name']]={'$like':'%'+_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x2f')]+'%'};return _0x378fe9;}})});}_0x4bc19a=_[_0xf0f1('0x30')]({},_0x4bc19a,_0xaec399[_0xf0f1('0x31')]);var _0x2baa97={'where':_0x4bc19a[_0xf0f1('0x2a')]};return db['CloudProvider'][_0xf0f1('0xd')](_0x2baa97)[_0xf0f1('0x11')](function(_0x3ce20b){_0x1ad7ad['count']=_0x3ce20b;if(_0xaec399[_0xf0f1('0x1f')]['includeAll']){_0x4bc19a['include']=[{'all':!![]}];}return db[_0xf0f1('0x19')]['findAll'](_0x4bc19a);})['then'](function(_0x27c21c){_0x1ad7ad[_0xf0f1('0x32')]=_[_0xf0f1('0x2d')](_0x27c21c,function(_0x2db873){if(_0x2db873[_0xf0f1('0x33')]==='MicrosoftAzure'){var _0x22656c=encryptor[_0xf0f1('0x34')](_0x2db873[_0xf0f1('0x35')]);_0x2db873[_0xf0f1('0x35')]=maskClientSecret(_0x22656c);}return _0x2db873;});return _0x1ad7ad;})['then'](respondWithFilteredResult(_0x4f4fd3,_0x4bc19a))['catch'](handleError(_0x4f4fd3,null));};exports[_0xf0f1('0x36')]=function(_0x1106e0,_0x2556c5){var _0x3ff4fc={'raw':!![],'where':{'id':_0x1106e0['params']['id']}},_0x2426fe={};_0x2426fe['model']=_[_0xf0f1('0x20')](db[_0xf0f1('0x19')][_0xf0f1('0x1a')]);_0x2426fe[_0xf0f1('0x1f')]=_[_0xf0f1('0x20')](_0x1106e0[_0xf0f1('0x1f')]);_0x2426fe[_0xf0f1('0x2b')]=_[_0xf0f1('0x21')](_0x2426fe[_0xf0f1('0x1e')],_0x2426fe[_0xf0f1('0x1f')]);_0x3ff4fc[_0xf0f1('0x23')]=_[_0xf0f1('0x21')](_0x2426fe['model'],qs[_0xf0f1('0x22')](_0x1106e0[_0xf0f1('0x1f')]['fields']));_0x3ff4fc[_0xf0f1('0x23')]=_0x3ff4fc[_0xf0f1('0x23')][_0xf0f1('0x24')]?_0x3ff4fc['attributes']:_0x2426fe[_0xf0f1('0x1e')];if(_0x1106e0[_0xf0f1('0x1f')][_0xf0f1('0x37')]){_0x3ff4fc[_0xf0f1('0x38')]=[{'all':!![]}];}_0x3ff4fc=_[_0xf0f1('0x30')]({},_0x3ff4fc,_0x1106e0[_0xf0f1('0x31')]);return db[_0xf0f1('0x19')]['find'](_0x3ff4fc)[_0xf0f1('0x11')](handleEntityNotFound(_0x2556c5,null))[_0xf0f1('0x11')](function(_0x12e16e){if(_0x12e16e[_0xf0f1('0x33')]===_0xf0f1('0x39')){var _0x5b31e9=encryptor[_0xf0f1('0x34')](_0x12e16e[_0xf0f1('0x35')]);_0x12e16e[_0xf0f1('0x35')]=maskClientSecret(_0x5b31e9);}return _0x12e16e;})[_0xf0f1('0x11')](respondWithResult(_0x2556c5,null))[_0xf0f1('0x3a')](handleError(_0x2556c5,null));};exports[_0xf0f1('0x3b')]=function(_0x55c4cf,_0x20c283){if(!_0x55c4cf[_0xf0f1('0x3c')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x55c4cf['body'][_0xf0f1('0x33')])throw new Error(_0xf0f1('0x3d'));var _0x302ab5=db['CloudProvider'][_0xf0f1('0x1a')]['service'][_0xf0f1('0x3e')];if(!_0x302ab5[_0xf0f1('0x3f')](_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x302ab5[_0xf0f1('0x40')](',\x20'));if(_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x33')]===_0xf0f1('0x39')&&_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]){_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]=encryptor['encryptString'](_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]);}return db['CloudProvider'][_0xf0f1('0x3b')](_0x55c4cf['body'],{})['then'](respondWithResult(_0x20c283,0xc9))['catch'](handleError(_0x20c283,null));};exports[_0xf0f1('0x10')]=function(_0x15db7d,_0x46a841){if(_0x15db7d[_0xf0f1('0x3c')]['id']){delete _0x15db7d['body']['id'];}return db[_0xf0f1('0x19')][_0xf0f1('0x41')]({'where':{'id':_0x15db7d[_0xf0f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x46a841,null))[_0xf0f1('0x11')](function(_0x3e4d76){if(_0x3e4d76[_0xf0f1('0x33')]===_0xf0f1('0x39')&&_0x15db7d[_0xf0f1('0x3c')]['data3']){_0x15db7d[_0xf0f1('0x3c')][_0xf0f1('0x35')]=encryptor['encryptString'](_0x15db7d[_0xf0f1('0x3c')][_0xf0f1('0x35')]);}return _0x3e4d76;})[_0xf0f1('0x11')](saveUpdates(_0x15db7d['body'],null))['then'](respondWithResult(_0x46a841,null))[_0xf0f1('0x3a')](handleError(_0x46a841,null));};exports[_0xf0f1('0x43')]=function(_0xa23beb,_0x1619c5){return db[_0xf0f1('0x19')][_0xf0f1('0x41')]({'where':{'id':_0xa23beb[_0xf0f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x1619c5,null))[_0xf0f1('0x11')](removeEntity(_0x1619c5,null))[_0xf0f1('0x3a')](handleError(_0x1619c5,null));};exports[_0xf0f1('0x44')]=function(_0x46868e,_0x462a4a){return db['CloudProvider'][_0xf0f1('0x45')]({'where':{'id':_0x46868e[_0xf0f1('0x42')]['id']},'raw':!![]})['then'](function(_0x32b548){if(!_0x32b548)return _0x462a4a[_0xf0f1('0x8')](0x194);return{'url':oauth[_0xf0f1('0x46')](_0x32b548,_0x46868e[_0xf0f1('0x47')]['id'])};})[_0xf0f1('0x11')](respondWithResult(_0x462a4a,null))[_0xf0f1('0x3a')](handleError(_0x462a4a,null));};exports[_0xf0f1('0x48')]=function(_0x1bfbfe,_0x2a8215){var _0x30c1ac=_0x1bfbfe[_0xf0f1('0x3c')];var _0x3e94fc;var _0x215ac0;if(_0x30c1ac[_0xf0f1('0x13')])throw _0x30c1ac;redis[_0xf0f1('0x49')](_0x30c1ac['state'])[_0xf0f1('0x11')](function(_0x38bab4){if(!_0x38bab4)throw new Error(_0xf0f1('0x4a'));_0x3e94fc=JSON[_0xf0f1('0x4b')](_0x38bab4);var _0x945f5c=Buffer[_0xf0f1('0x4c')](_0x30c1ac['state'],'base64')[_0xf0f1('0x4d')](_0xf0f1('0x4e'));_0x215ac0=JSON[_0xf0f1('0x4b')](_0x945f5c);if(!oauth['isValidIdToken'](_0x30c1ac[_0xf0f1('0x4f')],_0x3e94fc[_0xf0f1('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xf0f1('0x51')](_0x30c1ac[_0xf0f1('0x52')]);return oauth[_0xf0f1('0x53')](_0x30c1ac[_0xf0f1('0x54')],_0x3e94fc);})['then'](function(_0x27c71d){_0x3e94fc[_0xf0f1('0x55')]=_0x27c71d[_0xf0f1('0x56')];_0x3e94fc[_0xf0f1('0x57')]=_0x27c71d[_0xf0f1('0x58')];return db[_0xf0f1('0x19')][_0xf0f1('0x10')]({'data5':_0x3e94fc[_0xf0f1('0x55')],'data6':_0x3e94fc[_0xf0f1('0x57')]},{'where':{'id':_0x3e94fc['id']}});})[_0xf0f1('0x11')](function(){oauth[_0xf0f1('0x59')](_0x3e94fc);socket[_0xf0f1('0x5a')](_0xf0f1('0x5b'),{'id':_0x215ac0['id']});return;})[_0xf0f1('0x11')](respondWithStatusCode(_0x2a8215,null))[_0xf0f1('0x3a')](function(_0x1038bb){if(_0x215ac0){socket[_0xf0f1('0x5a')]('microsoftAuthorization:error',{'id':_0x215ac0['id']});}if(!_0x3e94fc){logger[_0xf0f1('0x13')](_0xf0f1('0x5c'),_0x1038bb);return _0x2a8215[_0xf0f1('0x9')](0x1f4)[_0xf0f1('0x16')](_0x1038bb[_0xf0f1('0x5d')]);}logger[_0xf0f1('0x13')](_0xf0f1('0x5e'),_0x3e94fc['id'],JSON[_0xf0f1('0x5f')](_0x1038bb));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 750b9f3..cd9d96c 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 _0x62c2=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CloudProvider'];(function(_0x52b417,_0x18a2fc){var _0x97eb41=function(_0x462dd8){while(--_0x462dd8){_0x52b417['push'](_0x52b417['shift']());}};_0x97eb41(++_0x18a2fc);}(_0x62c2,0xd2));var _0x262c=function(_0x8e5431,_0xac0957){_0x8e5431=_0x8e5431-0x0;var _0x259c87=_0x62c2[_0x8e5431];return _0x259c87;};'use strict';var _=require('lodash');var util=require(_0x262c('0x0'));var logger=require(_0x262c('0x1'))(_0x262c('0x2'));var moment=require(_0x262c('0x3'));var BPromise=require('bluebird');var rp=require(_0x262c('0x4'));var fs=require('fs');var path=require(_0x262c('0x5'));var rimraf=require(_0x262c('0x6'));var config=require(_0x262c('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x262c('0x8')]=function(_0x74fff4,_0x829e1f){return _0x74fff4['define'](_0x262c('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf07a=['../../config/environment','exports','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xf07a,0x86));var _0xaf07=function(_0x5447a8,_0x45c8e9){_0x5447a8=_0x5447a8-0x0;var _0x4c586b=_0xf07a[_0x5447a8];return _0x4c586b;};'use strict';var _=require(_0xaf07('0x0'));var util=require(_0xaf07('0x1'));var logger=require('../../config/logger')(_0xaf07('0x2'));var moment=require(_0xaf07('0x3'));var BPromise=require(_0xaf07('0x4'));var rp=require(_0xaf07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf07('0x6'));var attributes=require('./cloudProvider.attributes');module[_0xaf07('0x7')]=function(_0x53d90e,_0x2ae16d){return _0x53d90e['define'](_0xaf07('0x8'),attributes,{'tableName':_0xaf07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index dc36fa0..ae71949 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 _0xe451=['email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','data7','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','data4','response_mode','state','key','value','oauth2/','set','decode','payload','iss','aud','audience','nonce','isAfter','unix','exp','resolve','data3','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','then','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile'];(function(_0x357a73,_0x4a581e){var _0x52e68b=function(_0x2a4c4b){while(--_0x2a4c4b){_0x357a73['push'](_0x357a73['shift']());}};_0x52e68b(++_0x4a581e);}(_0xe451,0x136));var _0x1e45=function(_0x2659e1,_0x41cd66){_0x2659e1=_0x2659e1-0x0;var _0x5bd9fe=_0xe451[_0x2659e1];return _0x5bd9fe;};'use strict';var _=require(_0x1e45('0x0'));var crypto=require(_0x1e45('0x1'));var jwt=require(_0x1e45('0x2'));var moment=require(_0x1e45('0x3'));var Redis=require('ioredis');var rp=require(_0x1e45('0x4'));var util=require(_0x1e45('0x5'));var encryptor=require(_0x1e45('0x6'));var config=require(_0x1e45('0x7'));var logger=require(_0x1e45('0x8'))(_0x1e45('0x9'));var schedule=require(_0x1e45('0xa'));var db=require(_0x1e45('0xb'))['db'];config[_0x1e45('0xc')]=_[_0x1e45('0xd')](config[_0x1e45('0xc')],{'host':_0x1e45('0xe'),'port':0x18eb});var redis=new Redis(config[_0x1e45('0xc')]);var MICROSOFT_AUTH_URL=_0x1e45('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1e45('0x10'),_0x1e45('0x11'),_0x1e45('0x12'),_0x1e45('0x13'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1e45('0x14'),_0x1e45('0x15')],'Dynamics365':[_0x1e45('0x10'),_0x1e45('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x1e45('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x1e45('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x131dbc){var _0x38f64a=_[_0x1e45('0x18')](AZURE_AUTH_SCOPES[_0x131dbc[_0x1e45('0x19')]]);if(_0x131dbc[_0x1e45('0x19')]==='Dynamics365')_0x38f64a[_0x1e45('0x1a')](_0x131dbc['data7']+_0x1e45('0x1b'));return _0x38f64a[_0x1e45('0x1c')]('\x20');}function getAccessTokenScope(_0x4ed20d){if(_0x4ed20d[_0x1e45('0x19')]===_0x1e45('0x1d'))return _0x1e45('0x1e');if(_0x4ed20d[_0x1e45('0x19')]==='Dynamics365')return _0x4ed20d[_0x1e45('0x1f')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x19fa9f,_0x3c86af){var _0x1fb19f=MICROSOFT_AUTH_URL[_0x1e45('0x20')]('{TENANT_ID}',_0x19fa9f[_0x1e45('0x21')]);var _0x8560af=[_0x1e45('0x22'),_0x1e45('0x23')];var _0x28df60=Buffer[_0x1e45('0x24')](JSON[_0x1e45('0x25')]({'id':_0x3c86af}))[_0x1e45('0x26')]('base64');var _0x46fd11=crypto[_0x1e45('0x27')](0x10)[_0x1e45('0x26')](_0x1e45('0x28'));var _0x5482ed=getAuthorizationScopes(_0x19fa9f);var _0x5410b5=[{'key':_0x1e45('0x29'),'value':_0x19fa9f[_0x1e45('0x2a')]},{'key':_0x1e45('0x2b'),'value':encodeURIComponent(_0x8560af[_0x1e45('0x1c')]('\x20'))},{'key':'redirect_uri','value':_0x19fa9f[_0x1e45('0x2c')]},{'key':_0x1e45('0x2d'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x5482ed)},{'key':_0x1e45('0x2e'),'value':_0x28df60},{'key':'nonce','value':_0x46fd11},{'key':'prompt','value':'login'}];var _0x76172=_0x1fb19f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1e45('0x18')](_0x5410b5,function(_0x1af1c0){return _0x1af1c0[_0x1e45('0x2f')]+'='+_0x1af1c0[_0x1e45('0x30')];})['join']('&');_0x19fa9f['oauth2Claims']={'issuer':_0x1fb19f[_0x1e45('0x20')](_0x1e45('0x31'),''),'audience':_0x19fa9f['data1'],'state':_0x28df60,'nonce':_0x46fd11};redis[_0x1e45('0x32')](_0x28df60,JSON[_0x1e45('0x25')](_0x19fa9f));return _0x76172;}function isValidIdToken(_0x34eb61,_0x10d68c){try{var _0x52ac60=jwt[_0x1e45('0x33')](_0x34eb61,{'complete':!![]});var _0x339fa7=_0x52ac60[_0x1e45('0x34')];if(_0x339fa7[_0x1e45('0x35')]!==_0x10d68c['issuer'])return![];if(_0x339fa7[_0x1e45('0x36')]!==_0x10d68c[_0x1e45('0x37')])return![];if(_0x339fa7[_0x1e45('0x38')]!==_0x10d68c['nonce'])return![];if(moment()[_0x1e45('0x39')](moment[_0x1e45('0x3a')](_0x339fa7[_0x1e45('0x3b')])))return![];return!![];}catch(_0x1c499){throw _0x1c499;}}function refreshOauth2MicrosoftAccessToken(_0x29f5f1){return Promise[_0x1e45('0x3c')]()['then'](function(){if(_0x29f5f1[_0x1e45('0x3d')])return _0x29f5f1;return db['CloudProvider'][_0x1e45('0x3e')]({'where':{'id':_0x29f5f1['id']},'raw':!![]});})['then'](function(_0x37543c){var _0x229b75={'grant_type':_0x1e45('0x3f'),'refresh_token':_0x37543c[_0x1e45('0x40')],'scope':getAccessTokenScope(_0x37543c),'redirect_uri':_0x37543c[_0x1e45('0x2c')],'client_id':_0x37543c['data1'],'client_secret':encryptor[_0x1e45('0x41')](_0x37543c[_0x1e45('0x3d')])};var _0x1ba3c2={'method':_0x1e45('0x42'),'uri':MICROSOFT_AUTH_URL[_0x1e45('0x20')](_0x1e45('0x43'),_0x37543c[_0x1e45('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x229b75,'json':!![]};return rp(_0x1ba3c2);})[_0x1e45('0x44')](function(_0x5256f5){_0x29f5f1[_0x1e45('0x45')]=_0x5256f5[_0x1e45('0x46')];_0x29f5f1[_0x1e45('0x40')]=_0x5256f5[_0x1e45('0x3f')];return db[_0x1e45('0x47')][_0x1e45('0x48')]({'data5':_0x29f5f1[_0x1e45('0x45')],'data6':_0x29f5f1[_0x1e45('0x40')]},{'where':{'id':_0x29f5f1['id']}});})[_0x1e45('0x44')](function(){return _0x29f5f1;})[_0x1e45('0x49')](function(_0x45f0ef){logger['error'](_0x1e45('0x4a'),_0x29f5f1['id'],_0x45f0ef);});}function getOauth2MicrosoftAccessToken(_0x4b5b05,_0x42914b){var _0x2001fe={'grant_type':_0x1e45('0x4b'),'code':_0x4b5b05,'scope':getAccessTokenScope(_0x42914b),'redirect_uri':_0x42914b[_0x1e45('0x2c')],'client_id':_0x42914b['data1'],'client_secret':encryptor['decryptString'](_0x42914b[_0x1e45('0x3d')])};var _0x1b78bc={'method':_0x1e45('0x42'),'uri':MICROSOFT_AUTH_URL[_0x1e45('0x20')](_0x1e45('0x43'),_0x42914b[_0x1e45('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2001fe,'json':!![]};return rp(_0x1b78bc);}function startRefreshInterval(_0x206ff0){var _0x37d724=schedule[_0x1e45('0x4c')];if(_0x37d724[_0x206ff0['id']])clearInterval(_0x37d724[_0x206ff0['id']]);_0x37d724[_0x206ff0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1e45('0x4d')](this,{'id':_0x206ff0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x37d724;}function startAllRefreshIntervals(){return db[_0x1e45('0x47')][_0x1e45('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1e45('0x44')](function(_0x328616){var _0x325be6=_0x328616[_0x1e45('0x18')](function(_0xa92d5f){return refreshOauth2MicrosoftAccessToken(_0xa92d5f)['then'](function(_0x3f993b){startRefreshInterval(_0x3f993b);});});return Promise[_0x1e45('0x4f')](_0x325be6);})[_0x1e45('0x49')](function(_0x11f146){var _0x30ee5f=_0x11f146?util[_0x1e45('0x50')](_0x11f146,{'showHidden':![],'depth':null}):'';logger['error'](_0x1e45('0x51'),_0x30ee5f);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7ab2=['login','map','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','replace','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','type','Dynamics365','/.default','join','Outlook365','data7','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7ab2,0x76));var _0x27ab=function(_0x162754,_0x511159){_0x162754=_0x162754-0x0;var _0xe8f232=_0x7ab2[_0x162754];return _0xe8f232;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x27ab('0x0'));var Redis=require(_0x27ab('0x1'));var rp=require(_0x27ab('0x2'));var util=require(_0x27ab('0x3'));var encryptor=require(_0x27ab('0x4'));var config=require('../../config/environment');var logger=require(_0x27ab('0x5'))(_0x27ab('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x27ab('0x7'))['db'];config[_0x27ab('0x8')]=_[_0x27ab('0x9')](config[_0x27ab('0x8')],{'host':_0x27ab('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x27ab('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x27ab('0xc'),_0x27ab('0xd'),_0x27ab('0xe'),_0x27ab('0xf'),_0x27ab('0x10'),_0x27ab('0x11')],'Dynamics365':[_0x27ab('0x12'),_0x27ab('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x27ab('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x27ab('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b551c){var _0x3d713e=_['map'](AZURE_AUTH_SCOPES[_0x5b551c['type']]);if(_0x5b551c[_0x27ab('0x15')]===_0x27ab('0x16'))_0x3d713e['push'](_0x5b551c['data7']+_0x27ab('0x17'));return _0x3d713e[_0x27ab('0x18')]('\x20');}function getAccessTokenScope(_0x5795fd){if(_0x5795fd[_0x27ab('0x15')]===_0x27ab('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5795fd[_0x27ab('0x15')]==='Dynamics365')return _0x5795fd[_0x27ab('0x1a')]+_0x27ab('0x17');}function generateMicrosoftAuthorizationUrl(_0x2b1e54,_0x3daafe){var _0x3cdbc0=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x2b1e54[_0x27ab('0x1b')]);var _0x3c1719=[_0x27ab('0x1c'),_0x27ab('0x1d')];var _0x5b059a=Buffer['from'](JSON[_0x27ab('0x1e')]({'id':_0x3daafe}))[_0x27ab('0x1f')](_0x27ab('0x20'));var _0x184bf2=crypto[_0x27ab('0x21')](0x10)[_0x27ab('0x1f')](_0x27ab('0x22'));var _0x501046=getAuthorizationScopes(_0x2b1e54);var _0xbd499e=[{'key':_0x27ab('0x23'),'value':_0x2b1e54[_0x27ab('0x24')]},{'key':_0x27ab('0x25'),'value':encodeURIComponent(_0x3c1719[_0x27ab('0x18')]('\x20'))},{'key':_0x27ab('0x26'),'value':_0x2b1e54[_0x27ab('0x27')]},{'key':_0x27ab('0x28'),'value':_0x27ab('0x29')},{'key':'scope','value':encodeURIComponent(_0x501046)},{'key':_0x27ab('0x2a'),'value':_0x5b059a},{'key':_0x27ab('0x2b'),'value':_0x184bf2},{'key':'prompt','value':_0x27ab('0x2c')}];var _0x51e59f=_0x3cdbc0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x27ab('0x2d')](_0xbd499e,function(_0x2cee4f){return _0x2cee4f[_0x27ab('0x2e')]+'='+_0x2cee4f['value'];})[_0x27ab('0x18')]('&');_0x2b1e54[_0x27ab('0x2f')]={'issuer':_0x3cdbc0['replace'](_0x27ab('0x30'),''),'audience':_0x2b1e54[_0x27ab('0x24')],'state':_0x5b059a,'nonce':_0x184bf2};redis[_0x27ab('0x31')](_0x5b059a,JSON[_0x27ab('0x1e')](_0x2b1e54));return _0x51e59f;}function isValidIdToken(_0x4a4fd7,_0x277945){try{var _0x5b0ebc=jwt[_0x27ab('0x32')](_0x4a4fd7,{'complete':!![]});var _0x4f2a04=_0x5b0ebc[_0x27ab('0x33')];if(_0x4f2a04[_0x27ab('0x34')]!==_0x277945['issuer'])return![];if(_0x4f2a04[_0x27ab('0x35')]!==_0x277945[_0x27ab('0x36')])return![];if(_0x4f2a04[_0x27ab('0x2b')]!==_0x277945[_0x27ab('0x2b')])return![];if(moment()[_0x27ab('0x37')](moment[_0x27ab('0x38')](_0x4f2a04['exp'])))return![];return!![];}catch(_0x2be9c4){throw _0x2be9c4;}}function refreshOauth2MicrosoftAccessToken(_0x109eb2){return Promise[_0x27ab('0x39')]()[_0x27ab('0x3a')](function(){if(_0x109eb2[_0x27ab('0x3b')])return _0x109eb2;return db[_0x27ab('0x3c')][_0x27ab('0x3d')]({'where':{'id':_0x109eb2['id']},'raw':!![]});})[_0x27ab('0x3a')](function(_0x180df4){var _0x26bfb7={'grant_type':_0x27ab('0x3e'),'refresh_token':_0x180df4[_0x27ab('0x3f')],'scope':getAccessTokenScope(_0x180df4),'redirect_uri':_0x180df4['data4'],'client_id':_0x180df4[_0x27ab('0x24')],'client_secret':encryptor[_0x27ab('0x40')](_0x180df4[_0x27ab('0x3b')])};var _0x174940={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x27ab('0x41'),_0x180df4[_0x27ab('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x26bfb7,'json':!![]};return rp(_0x174940);})['then'](function(_0x429624){_0x109eb2[_0x27ab('0x42')]=_0x429624[_0x27ab('0x43')];_0x109eb2['data6']=_0x429624['refresh_token'];return db[_0x27ab('0x3c')][_0x27ab('0x44')]({'data5':_0x109eb2['data5'],'data6':_0x109eb2[_0x27ab('0x3f')]},{'where':{'id':_0x109eb2['id']}});})[_0x27ab('0x3a')](function(){return _0x109eb2;})[_0x27ab('0x45')](function(_0x47ddc6){logger[_0x27ab('0x46')](_0x27ab('0x47'),_0x109eb2['id'],_0x47ddc6);});}function getOauth2MicrosoftAccessToken(_0x286542,_0xb5f4e0){var _0xaacbd5={'grant_type':_0x27ab('0x48'),'code':_0x286542,'scope':getAccessTokenScope(_0xb5f4e0),'redirect_uri':_0xb5f4e0[_0x27ab('0x27')],'client_id':_0xb5f4e0[_0x27ab('0x24')],'client_secret':encryptor[_0x27ab('0x40')](_0xb5f4e0[_0x27ab('0x3b')])};var _0x473974={'method':_0x27ab('0x49'),'uri':MICROSOFT_AUTH_URL[_0x27ab('0x4a')](_0x27ab('0x41'),_0xb5f4e0[_0x27ab('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xaacbd5,'json':!![]};return rp(_0x473974);}function startRefreshInterval(_0x738534){var _0x40f7e9=schedule['intervals'];if(_0x40f7e9[_0x738534['id']])clearInterval(_0x40f7e9[_0x738534['id']]);_0x40f7e9[_0x738534['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x738534['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x27ab('0x4b')]=_0x40f7e9;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x27ab('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x27ab('0x3a')](function(_0x242999){var _0xbe3317=_0x242999[_0x27ab('0x2d')](function(_0x77258e){return refreshOauth2MicrosoftAccessToken(_0x77258e)[_0x27ab('0x3a')](function(_0x2260b1){startRefreshInterval(_0x2260b1);});});return Promise[_0x27ab('0x4d')](_0xbe3317);})['catch'](function(_0x36af37){var _0x218682=_0x36af37?util[_0x27ab('0x4e')](_0x36af37,{'showHidden':![],'depth':null}):'';logger[_0x27ab('0x46')](_0x27ab('0x4f'),_0x218682);});}module[_0x27ab('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 d53db74..cb7f2e6 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 _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x479ac0,_0x5fbce9){var _0xff3165=function(_0x478423){while(--_0x478423){_0x479ac0['push'](_0x479ac0['shift']());}};_0xff3165(++_0x5fbce9);}(_0x9582,0x95));var _0x2958=function(_0x192839,_0x3854a4){_0x192839=_0x192839-0x0;var _0x4123a5=_0x9582[_0x192839];return _0x4123a5;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('CloudProvider,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('CloudProvider,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0x1516=['../../config/environment','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1516,0xb0));var _0x6151=function(_0x27330b,_0x1383dc){_0x27330b=_0x27330b-0x0;var _0x5d09da=_0x1516[_0x27330b];return _0x5d09da;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f1acdb1..7f343ed 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x212ba7,_0x41be40){var _0x5bb562=function(_0x1d8dca){while(--_0x1d8dca){_0x212ba7['push'](_0x212ba7['shift']());}};_0x5bb562(++_0x41be40);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x5f2f,0x73));var _0xf5f2=function(_0xac6102,_0xde290a){_0xac6102=_0xac6102-0x0;var _0x2c444b=_0x5f2f[_0xac6102];return _0x2c444b;};'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')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index cf23a05..6db649d 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 _0xc5ba=['name','sequelize','exports','STRING'];(function(_0x4532a3,_0x550437){var _0x24fac5=function(_0x3a7937){while(--_0x3a7937){_0x4532a3['push'](_0x4532a3['shift']());}};_0x24fac5(++_0x550437);}(_0xc5ba,0xb9));var _0xac5b=function(_0x42a778,_0x3cde9f){_0x42a778=_0x42a778-0x0;var _0x216581=_0xc5ba[_0x42a778];return _0x216581;};'use strict';var Sequelize=require(_0xac5b('0x0'));module[_0xac5b('0x1')]={'name':{'type':Sequelize[_0xac5b('0x2')],'unique':_0xac5b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xac5b('0x2')]},'companyId':{'type':Sequelize[_0xac5b('0x2')]},'website':{'type':Sequelize[_0xac5b('0x2')]},'phone':{'type':Sequelize[_0xac5b('0x2')]},'fax':{'type':Sequelize[_0xac5b('0x2')]},'type':{'type':Sequelize[_0xac5b('0x2')]},'street':{'type':Sequelize[_0xac5b('0x2')]},'postalCode':{'type':Sequelize[_0xac5b('0x2')]},'city':{'type':Sequelize[_0xac5b('0x2')]},'country':{'type':Sequelize[_0xac5b('0x2')]},'email':{'type':Sequelize[_0xac5b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xac5b('0x2')]},'sStreet':{'type':Sequelize[_0xac5b('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xac5b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2188=['name','STRING','sequelize'];(function(_0x4c3515,_0x405fa2){var _0x585d6e=function(_0x2729a6){while(--_0x2729a6){_0x4c3515['push'](_0x4c3515['shift']());}};_0x585d6e(++_0x405fa2);}(_0x2188,0x1d6));var _0x8218=function(_0x4e19d9,_0x490aa0){_0x4e19d9=_0x4e19d9-0x0;var _0x27caa3=_0x2188[_0x4e19d9];return _0x27caa3;};'use strict';var Sequelize=require(_0x8218('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8218('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8218('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8218('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8218('0x2')]},'type':{'type':Sequelize[_0x8218('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8218('0x2')]},'country':{'type':Sequelize[_0x8218('0x2')]},'email':{'type':Sequelize[_0x8218('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8218('0x2')]},'sStreet':{'type':Sequelize[_0x8218('0x2')]},'sPostalCode':{'type':Sequelize[_0x8218('0x2')]},'sCity':{'type':Sequelize[_0x8218('0x2')]},'sCountry':{'type':Sequelize[_0x8218('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 1ce7aaf..46a3fee 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 _0x6d00=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','nolimit','order','sort','pick','where','merge','map','filter','options','includeAll','include','findAll','catch','params','rawAttributes','fields','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','getContacts','findOne','CmContact','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x6d00,0xf7));var _0x06d0=function(_0x2f479d,_0x1d6836){_0x2f479d=_0x2f479d-0x0;var _0x300d48=_0x6d00[_0x2f479d];return _0x300d48;};'use strict';var emlformat=require(_0x06d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06d0('0x1'));var jsonpatch=require(_0x06d0('0x2'));var rp=require(_0x06d0('0x3'));var moment=require(_0x06d0('0x4'));var BPromise=require(_0x06d0('0x5'));var Mustache=require(_0x06d0('0x6'));var util=require(_0x06d0('0x7'));var path=require(_0x06d0('0x8'));var sox=require(_0x06d0('0x9'));var csv=require(_0x06d0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06d0('0xb'));var _=require(_0x06d0('0xc'));var squel=require(_0x06d0('0xd'));var crypto=require('crypto');var jsforce=require(_0x06d0('0xe'));var deskjs=require(_0x06d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x06d0('0x10'));var Papa=require('papaparse');var Redis=require(_0x06d0('0x11'));var authService=require(_0x06d0('0x12'));var qs=require(_0x06d0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06d0('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x06d0('0x15'));var config=require(_0x06d0('0x16'));var licenseUtil=require(_0x06d0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b043c,_0x2a8d0e){_0x2a8d0e=_0x2a8d0e||0xcc;return function(_0x26e3fe){if(_0x26e3fe){return _0x3b043c['sendStatus'](_0x2a8d0e);}return _0x3b043c[_0x06d0('0x18')](_0x2a8d0e)[_0x06d0('0x19')]();};}function respondWithResult(_0x486bc5,_0x16dec2){_0x16dec2=_0x16dec2||0xc8;return function(_0x2beaf9){if(_0x2beaf9){return _0x486bc5[_0x06d0('0x18')](_0x16dec2)[_0x06d0('0x1a')](_0x2beaf9);}};}function respondWithFilteredResult(_0x534bbb,_0x35b373){return function(_0x32a3d9){if(_0x32a3d9){var _0x56b177=typeof _0x35b373[_0x06d0('0x1b')]==='undefined'&&typeof _0x35b373[_0x06d0('0x1c')]===_0x06d0('0x1d');var _0x29039b=_0x32a3d9['count'];var _0x456aa8=_0x56b177?0x0:_0x35b373['offset'];var _0xf4f19a=_0x56b177?_0x32a3d9[_0x06d0('0x1e')]:_0x35b373[_0x06d0('0x1b')]+_0x35b373[_0x06d0('0x1c')];var _0x4ba2a4;if(_0xf4f19a>=_0x29039b){_0xf4f19a=_0x29039b;_0x4ba2a4=0xc8;}else{_0x4ba2a4=0xce;}_0x534bbb[_0x06d0('0x18')](_0x4ba2a4);return _0x534bbb[_0x06d0('0x1f')](_0x06d0('0x20'),_0x456aa8+'-'+_0xf4f19a+'/'+_0x29039b)[_0x06d0('0x1a')](_0x32a3d9);}return null;};}function patchUpdates(_0x1039c5){return function(_0x28f827){try{jsonpatch['apply'](_0x28f827,_0x1039c5,!![]);}catch(_0x168cf4){return BPromise['reject'](_0x168cf4);}return _0x28f827[_0x06d0('0x21')]();};}function saveUpdates(_0x29cecf,_0x1bb9f1){return function(_0xa4592d){if(_0xa4592d){return _0xa4592d[_0x06d0('0x22')](_0x29cecf)[_0x06d0('0x23')](function(_0x52091a){return _0x52091a;});}return null;};}function removeEntity(_0x21b391,_0x4705f4){return function(_0x2f4f6c){if(_0x2f4f6c){return _0x2f4f6c[_0x06d0('0x24')]()[_0x06d0('0x23')](function(){var _0x148327=_0x2f4f6c[_0x06d0('0x25')]({'plain':!![]});var _0x20485e=_0x06d0('0x26');return db[_0x06d0('0x27')]['destroy']({'where':{'type':_0x20485e,'resourceId':_0x148327['id']}})[_0x06d0('0x23')](function(){return _0x2f4f6c;});})[_0x06d0('0x23')](function(){_0x21b391['status'](0xcc)[_0x06d0('0x19')]();});}};}function handleEntityNotFound(_0x1af2b2,_0x5d9fb3){return function(_0x4cacc4){if(!_0x4cacc4){_0x1af2b2[_0x06d0('0x28')](0x194);}return _0x4cacc4;};}function handleError(_0x8a82b,_0x4ceca8){_0x4ceca8=_0x4ceca8||0x1f4;return function(_0x1b1b6b){logger['error'](_0x1b1b6b[_0x06d0('0x29')]);if(_0x1b1b6b[_0x06d0('0x2a')]){delete _0x1b1b6b[_0x06d0('0x2a')];}_0x8a82b[_0x06d0('0x18')](_0x4ceca8)[_0x06d0('0x2b')](_0x1b1b6b);};}exports[_0x06d0('0x2c')]=function(_0x192983,_0x3343a3){var _0x52a233={},_0x5524d2={},_0x3b16cb={'count':0x0,'rows':[]};return db[_0x06d0('0x2d')][_0x06d0('0x2e')]()[_0x06d0('0x23')](function(_0x333d35){_0x5524d2[_0x06d0('0x2f')]=_[_0x06d0('0x30')](_0x333d35);_0x5524d2[_0x06d0('0x31')]=_[_0x06d0('0x30')](_0x192983[_0x06d0('0x31')]);_0x5524d2[_0x06d0('0x32')]=_[_0x06d0('0x33')](_0x5524d2[_0x06d0('0x2f')],_0x5524d2[_0x06d0('0x31')]);_0x52a233['attributes']=_['intersection'](_0x5524d2[_0x06d0('0x2f')],qs['fields'](_0x192983[_0x06d0('0x31')]['fields']));_0x52a233[_0x06d0('0x34')]=_0x52a233[_0x06d0('0x34')]['length']?_0x52a233[_0x06d0('0x34')]:_0x5524d2['model'];if(!_0x192983['query']['hasOwnProperty'](_0x06d0('0x35'))){_0x52a233[_0x06d0('0x1c')]=qs[_0x06d0('0x1c')](_0x192983[_0x06d0('0x31')]['limit']);_0x52a233[_0x06d0('0x1b')]=qs[_0x06d0('0x1b')](_0x192983[_0x06d0('0x31')][_0x06d0('0x1b')]);}_0x52a233[_0x06d0('0x36')]=qs[_0x06d0('0x37')](_0x192983['query'][_0x06d0('0x37')]);_0x52a233['where']=qs['filters'](_[_0x06d0('0x38')](_0x192983['query'],_0x5524d2['filters']),_0x333d35);if(_0x192983[_0x06d0('0x31')]['filter']){_0x52a233[_0x06d0('0x39')]=_[_0x06d0('0x3a')](_0x52a233[_0x06d0('0x39')],{'$or':_[_0x06d0('0x3b')](_0x52a233[_0x06d0('0x34')],function(_0x4eb0e4){var _0x23e566={};_0x23e566[_0x4eb0e4]={'$like':'%'+_0x192983['query'][_0x06d0('0x3c')]+'%'};return _0x23e566;})});}_0x52a233=_[_0x06d0('0x3a')]({},_0x52a233,_0x192983[_0x06d0('0x3d')]);var _0x21e4ce={'where':_0x52a233['where']};return db[_0x06d0('0x2d')][_0x06d0('0x1e')](_0x21e4ce)[_0x06d0('0x23')](function(_0x2de04b){_0x3b16cb[_0x06d0('0x1e')]=_0x2de04b;if(_0x192983[_0x06d0('0x31')][_0x06d0('0x3e')]){_0x52a233[_0x06d0('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x06d0('0x40')](_0x52a233);})[_0x06d0('0x23')](function(_0x42f2c9){_0x3b16cb['rows']=_0x42f2c9;return _0x3b16cb;})['then'](respondWithFilteredResult(_0x3343a3,_0x52a233))[_0x06d0('0x41')](handleError(_0x3343a3,null));})[_0x06d0('0x41')](handleError(_0x3343a3,null));};exports['show']=function(_0x5dac47,_0x438ee4){var _0x295b54={'raw':![],'where':{'id':_0x5dac47[_0x06d0('0x42')]['id']}},_0x6ed7fc={};_0x6ed7fc['model']=_[_0x06d0('0x30')](db[_0x06d0('0x2d')][_0x06d0('0x43')]);_0x6ed7fc[_0x06d0('0x31')]=_[_0x06d0('0x30')](_0x5dac47[_0x06d0('0x31')]);_0x6ed7fc['filters']=_[_0x06d0('0x33')](_0x6ed7fc[_0x06d0('0x2f')],_0x6ed7fc[_0x06d0('0x31')]);_0x295b54['attributes']=_[_0x06d0('0x33')](_0x6ed7fc[_0x06d0('0x2f')],qs[_0x06d0('0x44')](_0x5dac47[_0x06d0('0x31')][_0x06d0('0x44')]));_0x295b54[_0x06d0('0x34')]=_0x295b54[_0x06d0('0x34')][_0x06d0('0x45')]?_0x295b54['attributes']:_0x6ed7fc[_0x06d0('0x2f')];if(_0x5dac47['query']['includeAll']){_0x295b54[_0x06d0('0x3f')]=[{'all':!![]}];}_0x295b54=_[_0x06d0('0x3a')]({},_0x295b54,_0x5dac47[_0x06d0('0x3d')]);return db[_0x06d0('0x2d')][_0x06d0('0x46')](_0x295b54)['then'](handleEntityNotFound(_0x438ee4,null))[_0x06d0('0x23')](respondWithResult(_0x438ee4,null))[_0x06d0('0x41')](handleError(_0x438ee4,null));};exports[_0x06d0('0x47')]=function(_0x904c46,_0x5d3af3){return db[_0x06d0('0x2d')][_0x06d0('0x47')](_0x904c46[_0x06d0('0x48')],{})[_0x06d0('0x23')](function(_0x553a1a){var _0x601dd6=_0x904c46['user'][_0x06d0('0x25')]({'plain':!![]});if(!_0x601dd6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x601dd6[_0x06d0('0x49')]===_0x06d0('0x4a')){var _0x2274bd=_0x553a1a[_0x06d0('0x25')]({'plain':!![]});var _0x686b6d='Companies';return db[_0x06d0('0x4b')]['find']({'where':{'name':_0x686b6d,'userProfileId':_0x601dd6[_0x06d0('0x4c')]},'raw':!![]})['then'](function(_0x4a9ba3){if(_0x4a9ba3&&_0x4a9ba3[_0x06d0('0x4d')]===0x0){return db[_0x06d0('0x27')][_0x06d0('0x47')]({'name':_0x2274bd[_0x06d0('0x2a')],'resourceId':_0x2274bd['id'],'type':_0x4a9ba3[_0x06d0('0x2a')],'sectionId':_0x4a9ba3['id']},{})[_0x06d0('0x23')](function(){return _0x553a1a;});}else{return _0x553a1a;}})[_0x06d0('0x41')](function(_0x3075a4){logger[_0x06d0('0x4e')](_0x06d0('0x4f'),_0x3075a4);throw _0x3075a4;});}return _0x553a1a;})[_0x06d0('0x23')](respondWithResult(_0x5d3af3,0xc9))['catch'](handleError(_0x5d3af3,null));};exports[_0x06d0('0x22')]=function(_0x5c6b96,_0xf8d846){if(_0x5c6b96[_0x06d0('0x48')]['id']){delete _0x5c6b96['body']['id'];}return db[_0x06d0('0x2d')][_0x06d0('0x46')]({'where':{'id':_0x5c6b96[_0x06d0('0x42')]['id']}})[_0x06d0('0x23')](handleEntityNotFound(_0xf8d846,null))[_0x06d0('0x23')](saveUpdates(_0x5c6b96[_0x06d0('0x48')],null))[_0x06d0('0x23')](respondWithResult(_0xf8d846,null))[_0x06d0('0x41')](handleError(_0xf8d846,null));};exports[_0x06d0('0x24')]=function(_0x3e00b8,_0x3e93f0){return db[_0x06d0('0x2d')]['find']({'where':{'id':_0x3e00b8['params']['id']}})[_0x06d0('0x23')](handleEntityNotFound(_0x3e93f0,null))[_0x06d0('0x23')](removeEntity(_0x3e93f0,null))['catch'](handleError(_0x3e93f0,null));};exports['describe']=function(_0x45275b,_0x2953d5){return db[_0x06d0('0x2d')][_0x06d0('0x2e')]()[_0x06d0('0x23')](respondWithResult(_0x2953d5,null))[_0x06d0('0x41')](handleError(_0x2953d5,null));};exports[_0x06d0('0x50')]=function(_0x5eb41e,_0x556786,_0xaced76){return db['CmContact']['find']({'where':{'id':_0x5eb41e[_0x06d0('0x42')]['id']}})['then'](handleEntityNotFound(_0x556786,null))['then'](function(_0x3bb172){if(_0x3bb172){return _0x3bb172[_0x06d0('0x50')](_0x5eb41e[_0x06d0('0x48')]['ids'],_[_0x06d0('0x51')](_0x5eb41e[_0x06d0('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x556786,null))['catch'](handleError(_0x556786,null));};exports[_0x06d0('0x52')]=function(_0x5c780b,_0x1a5743,_0x523131){var _0x14027d={};var _0x4e6852={};var _0x2eef67;var _0x45d93b;return db[_0x06d0('0x2d')][_0x06d0('0x53')]({'where':{'id':_0x5c780b[_0x06d0('0x42')]['id']}})[_0x06d0('0x23')](handleEntityNotFound(_0x1a5743,null))[_0x06d0('0x23')](function(_0x5eceb4){if(_0x5eceb4){_0x2eef67=_0x5eceb4;_0x4e6852['model']=_[_0x06d0('0x30')](db[_0x06d0('0x54')][_0x06d0('0x43')]);_0x4e6852[_0x06d0('0x31')]=_['keys'](_0x5c780b[_0x06d0('0x31')]);_0x4e6852[_0x06d0('0x32')]=_[_0x06d0('0x33')](_0x4e6852[_0x06d0('0x2f')],_0x4e6852['query']);_0x14027d[_0x06d0('0x34')]=_['intersection'](_0x4e6852[_0x06d0('0x2f')],qs[_0x06d0('0x44')](_0x5c780b[_0x06d0('0x31')][_0x06d0('0x44')]));_0x14027d[_0x06d0('0x34')]=_0x14027d[_0x06d0('0x34')][_0x06d0('0x45')]?_0x14027d['attributes']:_0x4e6852[_0x06d0('0x2f')];_0x14027d[_0x06d0('0x36')]=qs[_0x06d0('0x37')](_0x5c780b['query']['sort']);_0x14027d[_0x06d0('0x39')]=qs[_0x06d0('0x32')](_[_0x06d0('0x38')](_0x5c780b[_0x06d0('0x31')],_0x4e6852[_0x06d0('0x32')]));if(_0x5c780b['query']['filter']){_0x14027d[_0x06d0('0x39')]=_['merge'](_0x14027d['where'],{'$or':_[_0x06d0('0x3b')](_0x14027d[_0x06d0('0x34')],function(_0x19c7dd){var _0x29564c={};_0x29564c[_0x19c7dd]={'$like':'%'+_0x5c780b['query'][_0x06d0('0x3c')]+'%'};return _0x29564c;})});}_0x14027d=_[_0x06d0('0x3a')]({},_0x14027d,_0x5c780b['options']);return _0x2eef67['getContacts'](_0x14027d);}})[_0x06d0('0x23')](function(_0x2ff383){if(_0x2ff383){_0x45d93b=_0x2ff383[_0x06d0('0x45')];if(!_0x5c780b['query']['hasOwnProperty'](_0x06d0('0x35'))){_0x14027d[_0x06d0('0x1c')]=qs['limit'](_0x5c780b['query'][_0x06d0('0x1c')]);_0x14027d['offset']=qs[_0x06d0('0x1b')](_0x5c780b['query'][_0x06d0('0x1b')]);}return _0x2eef67[_0x06d0('0x52')](_0x14027d);}})[_0x06d0('0x23')](function(_0x2c223a){if(_0x2c223a){return _0x2c223a?{'count':_0x45d93b,'rows':_0x2c223a}:null;}})[_0x06d0('0x23')](respondWithResult(_0x1a5743,null))[_0x06d0('0x41')](handleError(_0x1a5743,null));}; \ No newline at end of file +var _0x9c7b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','map'];(function(_0x12a4b4,_0x27a87b){var _0x4f8880=function(_0x1ff658){while(--_0x1ff658){_0x12a4b4['push'](_0x12a4b4['shift']());}};_0x4f8880(++_0x27a87b);}(_0x9c7b,0x108));var _0xb9c7=function(_0x547deb,_0x1dcb7a){_0x547deb=_0x547deb-0x0;var _0x200d00=_0x9c7b[_0x547deb];return _0x200d00;};'use strict';var emlformat=require(_0xb9c7('0x0'));var rimraf=require(_0xb9c7('0x1'));var zipdir=require(_0xb9c7('0x2'));var jsonpatch=require(_0xb9c7('0x3'));var rp=require(_0xb9c7('0x4'));var moment=require('moment');var BPromise=require(_0xb9c7('0x5'));var Mustache=require('mustache');var util=require(_0xb9c7('0x6'));var path=require(_0xb9c7('0x7'));var sox=require(_0xb9c7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9c7('0x9'));var _=require(_0xb9c7('0xa'));var squel=require(_0xb9c7('0xb'));var crypto=require(_0xb9c7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9c7('0xd'));var toCsv=require(_0xb9c7('0xe'));var querystring=require(_0xb9c7('0xf'));var Papa=require(_0xb9c7('0x10'));var Redis=require(_0xb9c7('0x11'));var authService=require(_0xb9c7('0x12'));var qs=require(_0xb9c7('0x13'));var as=require(_0xb9c7('0x14'));var hardwareService=require(_0xb9c7('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9c7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9c7('0x17'))['db'];function respondWithStatusCode(_0x113642,_0x2133c7){_0x2133c7=_0x2133c7||0xcc;return function(_0x1f449e){if(_0x1f449e){return _0x113642['sendStatus'](_0x2133c7);}return _0x113642['status'](_0x2133c7)['end']();};}function respondWithResult(_0x482de,_0x28c446){_0x28c446=_0x28c446||0xc8;return function(_0x2bef81){if(_0x2bef81){return _0x482de[_0xb9c7('0x18')](_0x28c446)[_0xb9c7('0x19')](_0x2bef81);}};}function respondWithFilteredResult(_0x4ff94b,_0x3ce22a){return function(_0x1ec538){if(_0x1ec538){var _0xd74583=typeof _0x3ce22a['offset']==='undefined'&&typeof _0x3ce22a[_0xb9c7('0x1a')]===_0xb9c7('0x1b');var _0x563b84=_0x1ec538[_0xb9c7('0x1c')];var _0x43d6e6=_0xd74583?0x0:_0x3ce22a['offset'];var _0x265877=_0xd74583?_0x1ec538[_0xb9c7('0x1c')]:_0x3ce22a['offset']+_0x3ce22a['limit'];var _0x35c4de;if(_0x265877>=_0x563b84){_0x265877=_0x563b84;_0x35c4de=0xc8;}else{_0x35c4de=0xce;}_0x4ff94b[_0xb9c7('0x18')](_0x35c4de);return _0x4ff94b[_0xb9c7('0x1d')](_0xb9c7('0x1e'),_0x43d6e6+'-'+_0x265877+'/'+_0x563b84)[_0xb9c7('0x19')](_0x1ec538);}return null;};}function patchUpdates(_0x353596){return function(_0x4c05b8){try{jsonpatch[_0xb9c7('0x1f')](_0x4c05b8,_0x353596,!![]);}catch(_0x33d567){return BPromise[_0xb9c7('0x20')](_0x33d567);}return _0x4c05b8[_0xb9c7('0x21')]();};}function saveUpdates(_0x153034,_0x225e81){return function(_0x43bb8e){if(_0x43bb8e){return _0x43bb8e[_0xb9c7('0x22')](_0x153034)[_0xb9c7('0x23')](function(_0x14264e){return _0x14264e;});}return null;};}function removeEntity(_0x27a263,_0x1f5648){return function(_0x5e2b2a){if(_0x5e2b2a){return _0x5e2b2a['destroy']()[_0xb9c7('0x23')](function(){var _0x27010d=_0x5e2b2a['get']({'plain':!![]});var _0x4d31dc=_0xb9c7('0x24');return db[_0xb9c7('0x25')][_0xb9c7('0x26')]({'where':{'type':_0x4d31dc,'resourceId':_0x27010d['id']}})[_0xb9c7('0x23')](function(){return _0x5e2b2a;});})[_0xb9c7('0x23')](function(){_0x27a263['status'](0xcc)[_0xb9c7('0x27')]();});}};}function handleEntityNotFound(_0x31ecbc,_0x1d9b04){return function(_0x3cc68d){if(!_0x3cc68d){_0x31ecbc[_0xb9c7('0x28')](0x194);}return _0x3cc68d;};}function handleError(_0x3d62c3,_0x45e311){_0x45e311=_0x45e311||0x1f4;return function(_0x117b66){logger[_0xb9c7('0x29')](_0x117b66[_0xb9c7('0x2a')]);if(_0x117b66['name']){delete _0x117b66[_0xb9c7('0x2b')];}_0x3d62c3[_0xb9c7('0x18')](_0x45e311)[_0xb9c7('0x2c')](_0x117b66);};}exports['index']=function(_0x32110c,_0x3f4ba1){var _0x23af4a={},_0x4bf3bd={},_0x30129e={'count':0x0,'rows':[]};return db[_0xb9c7('0x2d')][_0xb9c7('0x2e')]()[_0xb9c7('0x23')](function(_0xe4c4b4){_0x4bf3bd[_0xb9c7('0x2f')]=_['keys'](_0xe4c4b4);_0x4bf3bd['query']=_['keys'](_0x32110c[_0xb9c7('0x30')]);_0x4bf3bd[_0xb9c7('0x31')]=_[_0xb9c7('0x32')](_0x4bf3bd[_0xb9c7('0x2f')],_0x4bf3bd[_0xb9c7('0x30')]);_0x23af4a[_0xb9c7('0x33')]=_[_0xb9c7('0x32')](_0x4bf3bd[_0xb9c7('0x2f')],qs[_0xb9c7('0x34')](_0x32110c['query'][_0xb9c7('0x34')]));_0x23af4a[_0xb9c7('0x33')]=_0x23af4a[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x23af4a[_0xb9c7('0x33')]:_0x4bf3bd[_0xb9c7('0x2f')];if(!_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x36')](_0xb9c7('0x37'))){_0x23af4a[_0xb9c7('0x1a')]=qs['limit'](_0x32110c['query']['limit']);_0x23af4a['offset']=qs['offset'](_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x38')]);}_0x23af4a[_0xb9c7('0x39')]=qs['sort'](_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3a')]);_0x23af4a[_0xb9c7('0x3b')]=qs[_0xb9c7('0x31')](_[_0xb9c7('0x3c')](_0x32110c[_0xb9c7('0x30')],_0x4bf3bd[_0xb9c7('0x31')]),_0xe4c4b4);if(_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3d')]){_0x23af4a[_0xb9c7('0x3b')]=_['merge'](_0x23af4a[_0xb9c7('0x3b')],{'$or':_['map'](_0x23af4a[_0xb9c7('0x33')],function(_0x10a7a3){var _0x451608={};_0x451608[_0x10a7a3]={'$like':'%'+_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3d')]+'%'};return _0x451608;})});}_0x23af4a=_[_0xb9c7('0x3e')]({},_0x23af4a,_0x32110c[_0xb9c7('0x3f')]);var _0x3eb4c1={'where':_0x23af4a[_0xb9c7('0x3b')]};return db[_0xb9c7('0x2d')][_0xb9c7('0x1c')](_0x3eb4c1)[_0xb9c7('0x23')](function(_0x38181f){_0x30129e[_0xb9c7('0x1c')]=_0x38181f;if(_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x40')]){_0x23af4a[_0xb9c7('0x41')]=[{'all':!![]}];}return db[_0xb9c7('0x2d')][_0xb9c7('0x42')](_0x23af4a);})['then'](function(_0x17863c){_0x30129e[_0xb9c7('0x43')]=_0x17863c;return _0x30129e;})[_0xb9c7('0x23')](respondWithFilteredResult(_0x3f4ba1,_0x23af4a))['catch'](handleError(_0x3f4ba1,null));})[_0xb9c7('0x44')](handleError(_0x3f4ba1,null));};exports[_0xb9c7('0x45')]=function(_0x75430d,_0x3c0258){var _0x991ba8={'raw':![],'where':{'id':_0x75430d[_0xb9c7('0x46')]['id']}},_0x1b6b14={};_0x1b6b14[_0xb9c7('0x2f')]=_['keys'](db[_0xb9c7('0x2d')][_0xb9c7('0x47')]);_0x1b6b14[_0xb9c7('0x30')]=_[_0xb9c7('0x48')](_0x75430d[_0xb9c7('0x30')]);_0x1b6b14[_0xb9c7('0x31')]=_[_0xb9c7('0x32')](_0x1b6b14['model'],_0x1b6b14[_0xb9c7('0x30')]);_0x991ba8['attributes']=_[_0xb9c7('0x32')](_0x1b6b14['model'],qs[_0xb9c7('0x34')](_0x75430d[_0xb9c7('0x30')][_0xb9c7('0x34')]));_0x991ba8['attributes']=_0x991ba8[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x991ba8[_0xb9c7('0x33')]:_0x1b6b14[_0xb9c7('0x2f')];if(_0x75430d[_0xb9c7('0x30')][_0xb9c7('0x40')]){_0x991ba8[_0xb9c7('0x41')]=[{'all':!![]}];}_0x991ba8=_[_0xb9c7('0x3e')]({},_0x991ba8,_0x75430d[_0xb9c7('0x3f')]);return db[_0xb9c7('0x2d')][_0xb9c7('0x49')](_0x991ba8)[_0xb9c7('0x23')](handleEntityNotFound(_0x3c0258,null))['then'](respondWithResult(_0x3c0258,null))['catch'](handleError(_0x3c0258,null));};exports['create']=function(_0x3f24b6,_0x1cc0a0){return db[_0xb9c7('0x2d')][_0xb9c7('0x4a')](_0x3f24b6[_0xb9c7('0x4b')],{})[_0xb9c7('0x23')](function(_0x1af641){var _0x1d43f1=_0x3f24b6['user'][_0xb9c7('0x4c')]({'plain':!![]});if(!_0x1d43f1)throw new Error(_0xb9c7('0x4d'));if(_0x1d43f1[_0xb9c7('0x4e')]==='user'){var _0x343c7c=_0x1af641['get']({'plain':!![]});var _0x553a4e=_0xb9c7('0x24');return db[_0xb9c7('0x4f')][_0xb9c7('0x49')]({'where':{'name':_0x553a4e,'userProfileId':_0x1d43f1[_0xb9c7('0x50')]},'raw':!![]})['then'](function(_0x4ba88a){if(_0x4ba88a&&_0x4ba88a['autoAssociation']===0x0){return db[_0xb9c7('0x25')][_0xb9c7('0x4a')]({'name':_0x343c7c[_0xb9c7('0x2b')],'resourceId':_0x343c7c['id'],'type':_0x4ba88a[_0xb9c7('0x2b')],'sectionId':_0x4ba88a['id']},{})['then'](function(){return _0x1af641;});}else{return _0x1af641;}})['catch'](function(_0x5e9f4d){logger[_0xb9c7('0x29')](_0xb9c7('0x51'),_0x5e9f4d);throw _0x5e9f4d;});}return _0x1af641;})['then'](respondWithResult(_0x1cc0a0,0xc9))[_0xb9c7('0x44')](handleError(_0x1cc0a0,null));};exports[_0xb9c7('0x22')]=function(_0x5ccca0,_0x1148fa){if(_0x5ccca0[_0xb9c7('0x4b')]['id']){delete _0x5ccca0[_0xb9c7('0x4b')]['id'];}return db[_0xb9c7('0x2d')]['find']({'where':{'id':_0x5ccca0[_0xb9c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x1148fa,null))[_0xb9c7('0x23')](saveUpdates(_0x5ccca0[_0xb9c7('0x4b')],null))[_0xb9c7('0x23')](respondWithResult(_0x1148fa,null))['catch'](handleError(_0x1148fa,null));};exports[_0xb9c7('0x26')]=function(_0x231aa3,_0x19b4b2){return db[_0xb9c7('0x2d')][_0xb9c7('0x49')]({'where':{'id':_0x231aa3[_0xb9c7('0x46')]['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x19b4b2,null))[_0xb9c7('0x23')](removeEntity(_0x19b4b2,null))['catch'](handleError(_0x19b4b2,null));};exports['describe']=function(_0x21711b,_0x298787){return db[_0xb9c7('0x2d')][_0xb9c7('0x2e')]()[_0xb9c7('0x23')](respondWithResult(_0x298787,null))['catch'](handleError(_0x298787,null));};exports[_0xb9c7('0x52')]=function(_0x3d6dfc,_0x2378bb,_0x5141a1){return db['CmContact'][_0xb9c7('0x49')]({'where':{'id':_0x3d6dfc[_0xb9c7('0x46')]['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x2378bb,null))[_0xb9c7('0x23')](function(_0x327b19){if(_0x327b19){return _0x327b19['addContacts'](_0x3d6dfc['body'][_0xb9c7('0x53')],_['omit'](_0x3d6dfc[_0xb9c7('0x4b')],[_0xb9c7('0x53'),'id'])||{});}})[_0xb9c7('0x23')](respondWithResult(_0x2378bb,null))['catch'](handleError(_0x2378bb,null));};exports[_0xb9c7('0x54')]=function(_0x5766ac,_0x278ec1,_0x10926a){var _0x59addd={};var _0xaac992={};var _0x5ad3a1;var _0x38754e;return db['CmCompany'][_0xb9c7('0x55')]({'where':{'id':_0x5766ac['params']['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x278ec1,null))[_0xb9c7('0x23')](function(_0x1c2d3f){if(_0x1c2d3f){_0x5ad3a1=_0x1c2d3f;_0xaac992[_0xb9c7('0x2f')]=_[_0xb9c7('0x48')](db[_0xb9c7('0x56')][_0xb9c7('0x47')]);_0xaac992[_0xb9c7('0x30')]=_[_0xb9c7('0x48')](_0x5766ac['query']);_0xaac992['filters']=_[_0xb9c7('0x32')](_0xaac992[_0xb9c7('0x2f')],_0xaac992[_0xb9c7('0x30')]);_0x59addd[_0xb9c7('0x33')]=_[_0xb9c7('0x32')](_0xaac992[_0xb9c7('0x2f')],qs['fields'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x34')]));_0x59addd[_0xb9c7('0x33')]=_0x59addd[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x59addd[_0xb9c7('0x33')]:_0xaac992[_0xb9c7('0x2f')];_0x59addd[_0xb9c7('0x39')]=qs[_0xb9c7('0x3a')](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x3a')]);_0x59addd[_0xb9c7('0x3b')]=qs['filters'](_[_0xb9c7('0x3c')](_0x5766ac[_0xb9c7('0x30')],_0xaac992['filters']));if(_0x5766ac['query'][_0xb9c7('0x3d')]){_0x59addd[_0xb9c7('0x3b')]=_['merge'](_0x59addd['where'],{'$or':_[_0xb9c7('0x57')](_0x59addd[_0xb9c7('0x33')],function(_0x38a801){var _0x2f50dd={};_0x2f50dd[_0x38a801]={'$like':'%'+_0x5766ac['query'][_0xb9c7('0x3d')]+'%'};return _0x2f50dd;})});}_0x59addd=_['merge']({},_0x59addd,_0x5766ac[_0xb9c7('0x3f')]);return _0x5ad3a1[_0xb9c7('0x54')](_0x59addd);}})[_0xb9c7('0x23')](function(_0x1cf7b2){if(_0x1cf7b2){_0x38754e=_0x1cf7b2[_0xb9c7('0x35')];if(!_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x36')](_0xb9c7('0x37'))){_0x59addd[_0xb9c7('0x1a')]=qs['limit'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x1a')]);_0x59addd[_0xb9c7('0x38')]=qs['offset'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x38')]);}return _0x5ad3a1[_0xb9c7('0x54')](_0x59addd);}})[_0xb9c7('0x23')](function(_0x116298){if(_0x116298){return _0x116298?{'count':_0x38754e,'rows':_0x116298}:null;}})[_0xb9c7('0x23')](respondWithResult(_0x278ec1,null))[_0xb9c7('0x44')](handleError(_0x278ec1,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5562dd5..1ab31fb 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 _0x0e1b=['bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x5b3044,_0x5dbd51){var _0x4896d5=function(_0x1b1c79){while(--_0x1b1c79){_0x5b3044['push'](_0x5b3044['shift']());}};_0x4896d5(++_0x5dbd51);}(_0x0e1b,0x191));var _0xb0e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e1b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb0e1('0x0'));var util=require(_0xb0e1('0x1'));var logger=require(_0xb0e1('0x2'))(_0xb0e1('0x3'));var moment=require(_0xb0e1('0x4'));var BPromise=require(_0xb0e1('0x5'));var rp=require(_0xb0e1('0x6'));var fs=require('fs');var path=require(_0xb0e1('0x7'));var rimraf=require(_0xb0e1('0x8'));var config=require('../../config/environment');var attributes=require(_0xb0e1('0x9'));module[_0xb0e1('0xa')]=function(_0x26dcfa,_0xd23d4e){return _0x26dcfa[_0xb0e1('0xb')](_0xb0e1('0xc'),attributes,{'tableName':_0xb0e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff8a=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xff8a,0x125));var _0xaff8=function(_0x4cc7e2,_0x2e0da0){_0x4cc7e2=_0x4cc7e2-0x0;var _0x421758=_0xff8a[_0x4cc7e2];return _0x421758;};'use strict';var _=require(_0xaff8('0x0'));var util=require(_0xaff8('0x1'));var logger=require(_0xaff8('0x2'))(_0xaff8('0x3'));var moment=require('moment');var BPromise=require(_0xaff8('0x4'));var rp=require(_0xaff8('0x5'));var fs=require('fs');var path=require(_0xaff8('0x6'));var rimraf=require(_0xaff8('0x7'));var config=require('../../config/environment');var attributes=require(_0xaff8('0x8'));module[_0xaff8('0x9')]=function(_0x3fc12e,_0x2c0419){return _0x3fc12e[_0xaff8('0xa')](_0xaff8('0xb'),attributes,{'tableName':_0xaff8('0xc'),'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 34bae5a..6ce9c37 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 _0xb875=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0xb875,0x167));var _0x5b87=function(_0x48b5dd,_0x41cae6){_0x48b5dd=_0x48b5dd-0x0;var _0x3b1e44=_0xb875[_0x48b5dd];return _0x3b1e44;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b87('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b87('0x2'))['db'];var utils=require(_0x5b87('0x3'));var logger=require('../../config/logger')(_0x5b87('0x4'));var config=require(_0x5b87('0x5'));var jayson=require(_0x5b87('0x6'));var client=jayson[_0x5b87('0x7')][_0x5b87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b27af,_0x1fc1a8,_0x46b1bf){return new BPromise(function(_0x1fb944,_0xb2888){return client['request'](_0x5b27af,_0x46b1bf)[_0x5b87('0x9')](function(_0x537f81){logger[_0x5b87('0xa')](_0x5b87('0xb'),_0x1fc1a8,_0x5b87('0xc'));logger[_0x5b87('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent',JSON[_0x5b87('0xe')](_0x537f81));if(_0x537f81[_0x5b87('0xf')]){if(_0x537f81['error'][_0x5b87('0x10')]===0x1f4){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);return _0xb2888(_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);}logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81['error'][_0x5b87('0x11')]);return _0x1fb944(_0x537f81['error'][_0x5b87('0x11')]);}else{logger[_0x5b87('0xa')]('CmCompany,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent');_0x1fb944(_0x537f81[_0x5b87('0x12')]['message']);}})[_0x5b87('0x13')](function(_0x175452){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x175452);_0xb2888(_0x175452);});});} \ No newline at end of file +var _0x4805=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','util'];(function(_0x254af0,_0x377502){var _0x1334d6=function(_0x39efd1){while(--_0x39efd1){_0x254af0['push'](_0x254af0['shift']());}};_0x1334d6(++_0x377502);}(_0x4805,0x175));var _0x5480=function(_0x40ae49,_0x47c4b7){_0x40ae49=_0x40ae49-0x0;var _0x4a9b15=_0x4805[_0x40ae49];return _0x4a9b15;};'use strict';var _=require('lodash');var util=require(_0x5480('0x0'));var moment=require('moment');var BPromise=require(_0x5480('0x1'));var rs=require(_0x5480('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5480('0x3'))['db'];var utils=require(_0x5480('0x4'));var logger=require('../../config/logger')(_0x5480('0x5'));var config=require(_0x5480('0x6'));var jayson=require(_0x5480('0x7'));var client=jayson[_0x5480('0x8')][_0x5480('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8bf87,_0x208dd6,_0x228fe9){return new BPromise(function(_0x2a0907,_0x125126){return client[_0x5480('0xa')](_0xf8bf87,_0x228fe9)[_0x5480('0xb')](function(_0x251085){logger[_0x5480('0xc')]('CmCompany,\x20%s,\x20%s',_0x208dd6,_0x5480('0xd'));logger[_0x5480('0xe')](_0x5480('0xf'),_0x208dd6,_0x5480('0xd'),JSON[_0x5480('0x10')](_0x251085));if(_0x251085[_0x5480('0x11')]){if(_0x251085['error'][_0x5480('0x12')]===0x1f4){logger[_0x5480('0x11')](_0x5480('0x13'),_0x208dd6,_0x251085[_0x5480('0x11')][_0x5480('0x14')]);return _0x125126(_0x251085['error'][_0x5480('0x14')]);}logger['error'](_0x5480('0x13'),_0x208dd6,_0x251085['error'][_0x5480('0x14')]);return _0x2a0907(_0x251085[_0x5480('0x11')][_0x5480('0x14')]);}else{logger[_0x5480('0xc')](_0x5480('0x13'),_0x208dd6,_0x5480('0xd'));_0x2a0907(_0x251085[_0x5480('0x15')][_0x5480('0x14')]);}})['catch'](function(_0x1d501b){logger['error']('CmCompany,\x20%s,\x20%s',_0x208dd6,_0x1d501b);_0x125126(_0x1d501b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9b250f0..02bc18e 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 _0x34c0=['addContacts','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe','show','/:id/contacts','create','post'];(function(_0x135573,_0x479526){var _0x13ea56=function(_0x49c990){while(--_0x49c990){_0x135573['push'](_0x135573['shift']());}};_0x13ea56(++_0x479526);}(_0x34c0,0x96));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x034c('0x0'));var util=require(_0x034c('0x1'));var path=require(_0x034c('0x2'));var timeout=require(_0x034c('0x3'));var express=require(_0x034c('0x4'));var router=express['Router']();var fs_extra=require(_0x034c('0x5'));var auth=require(_0x034c('0x6'));var interaction=require(_0x034c('0x7'));var config=require(_0x034c('0x8'));var controller=require(_0x034c('0x9'));router['get']('/',auth[_0x034c('0xa')](),controller[_0x034c('0xb')]);router[_0x034c('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x034c('0xd')]);router[_0x034c('0xc')]('/:id',auth[_0x034c('0xa')](),controller[_0x034c('0xe')]);router[_0x034c('0xc')](_0x034c('0xf'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0x034c('0xa')](),controller[_0x034c('0x10')]);router[_0x034c('0x11')](_0x034c('0xf'),auth[_0x034c('0xa')](),controller[_0x034c('0x12')]);router[_0x034c('0x13')](_0x034c('0x14'),auth[_0x034c('0xa')](),controller[_0x034c('0x15')]);router[_0x034c('0x16')](_0x034c('0x14'),auth['isAuthenticated'](),controller[_0x034c('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbac8=['/:id/contacts','getContacts','post','addContacts','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbac8,0x1ec));var _0x8bac=function(_0x308ce1,_0x3420c7){_0x308ce1=_0x308ce1-0x0;var _0xdd1bf7=_0xbac8[_0x308ce1];return _0xdd1bf7;};'use strict';var multer=require('multer');var util=require(_0x8bac('0x0'));var path=require(_0x8bac('0x1'));var timeout=require(_0x8bac('0x2'));var express=require(_0x8bac('0x3'));var router=express[_0x8bac('0x4')]();var fs_extra=require(_0x8bac('0x5'));var auth=require(_0x8bac('0x6'));var interaction=require(_0x8bac('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x8bac('0x8')](),controller[_0x8bac('0x9')]);router[_0x8bac('0xa')](_0x8bac('0xb'),auth[_0x8bac('0x8')](),controller['describe']);router[_0x8bac('0xa')](_0x8bac('0xc'),auth[_0x8bac('0x8')](),controller[_0x8bac('0xd')]);router[_0x8bac('0xa')](_0x8bac('0xe'),auth[_0x8bac('0x8')](),controller[_0x8bac('0xf')]);router['post']('/',auth[_0x8bac('0x8')](),controller['create']);router[_0x8bac('0x10')](_0x8bac('0xe'),auth[_0x8bac('0x8')](),controller[_0x8bac('0x11')]);router[_0x8bac('0x12')]('/:id',auth[_0x8bac('0x8')](),controller[_0x8bac('0x13')]);router['delete'](_0x8bac('0xc'),auth['isAuthenticated'](),controller[_0x8bac('0x14')]);module[_0x8bac('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index ad8de5e..25f28cb 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 _0x75e0=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x13c22c,_0x170015){var _0x16237c=function(_0x2ef781){while(--_0x2ef781){_0x13c22c['push'](_0x13c22c['shift']());}};_0x16237c(++_0x170015);}(_0x75e0,0x67));var _0x075e=function(_0x6effa8,_0x316e86){_0x6effa8=_0x6effa8-0x0;var _0x2f8a97=_0x75e0[_0x6effa8];return _0x2f8a97;};'use strict';var _=require(_0x075e('0x0'));var Sequelize=require(_0x075e('0x1'));module[_0x075e('0x2')]={'firstName':{'type':Sequelize[_0x075e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x075e('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x075e('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x075e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x075e('0x3')]},'fax':{'type':Sequelize[_0x075e('0x3')]},'email':{'type':Sequelize[_0x075e('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x075e('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x075e('0x3')]},'skype':{'type':Sequelize[_0x075e('0x3')]},'teams':{'type':Sequelize[_0x075e('0x3')]},'viber':{'type':Sequelize[_0x075e('0x3')]},'line':{'type':Sequelize[_0x075e('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x075e('0x3')]},'UserId':{'type':Sequelize[_0x075e('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x075e('0x3')]},'priority':{'type':Sequelize[_0x075e('0x5')](0x2)[_0x075e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x075e('0x7')]},'dialTimezone':{'type':Sequelize[_0x075e('0x3')]},'utcOffset':{'type':Sequelize[_0x075e('0x5')]}}; \ No newline at end of file +var _0x6b2a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x35cc19,_0x3deb10){var _0x4d0efa=function(_0x5e96d8){while(--_0x5e96d8){_0x35cc19['push'](_0x35cc19['shift']());}};_0x4d0efa(++_0x3deb10);}(_0x6b2a,0x146));var _0xa6b2=function(_0x3bd5fb,_0x1e5220){_0x3bd5fb=_0x3bd5fb-0x0;var _0x4849d4=_0x6b2a[_0x3bd5fb];return _0x4849d4;};'use strict';var _=require('lodash');var Sequelize=require(_0xa6b2('0x0'));module[_0xa6b2('0x1')]={'firstName':{'type':Sequelize[_0xa6b2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa6b2('0x2')]},'postalCode':{'type':Sequelize[_0xa6b2('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa6b2('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa6b2('0x2')]},'description':{'type':Sequelize[_0xa6b2('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa6b2('0x2')]},'fax':{'type':Sequelize[_0xa6b2('0x2')]},'email':{'type':Sequelize[_0xa6b2('0x2')]},'url':{'type':Sequelize[_0xa6b2('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa6b2('0x2')]},'teams':{'type':Sequelize[_0xa6b2('0x2')]},'viber':{'type':Sequelize[_0xa6b2('0x2')]},'line':{'type':Sequelize[_0xa6b2('0x2')]},'wechat':{'type':Sequelize[_0xa6b2('0x2')]},'telegram':{'type':Sequelize[_0xa6b2('0x2')]},'UserId':{'type':Sequelize[_0xa6b2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xa6b2('0x2')]},'priority':{'type':Sequelize[_0xa6b2('0x4')](0x2)[_0xa6b2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa6b2('0x6')],'defaultValue':Sequelize[_0xa6b2('0x7')]},'dialTimezone':{'type':Sequelize[_0xa6b2('0x2')]},'utcOffset':{'type':Sequelize[_0xa6b2('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 917d272..8151b41 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 7267005..56f8bf9 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 _0x5e2f=['CmContact','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x376d87,_0x4fc6f9){var _0x18dc19=function(_0x2d7347){while(--_0x2d7347){_0x376d87['push'](_0x376d87['shift']());}};_0x18dc19(++_0x4fc6f9);}(_0x5e2f,0x147));var _0xf5e2=function(_0x558e1e,_0x3fd803){_0x558e1e=_0x558e1e-0x0;var _0x5ba193=_0x5e2f[_0x558e1e];return _0x5ba193;};'use strict';var EventEmitter=require(_0xf5e2('0x0'));var CmContact=require('../../mysqldb')['db'][_0xf5e2('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf5e2('0x2')](0x0);var events={'afterCreate':_0xf5e2('0x3'),'afterUpdate':_0xf5e2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x379a03){return function(_0x39e5ec,_0x10363e,_0x14c0a2){CmContactEvents[_0xf5e2('0x5')](_0x379a03+':'+_0x39e5ec['id'],_0x39e5ec);CmContactEvents[_0xf5e2('0x5')](_0x379a03,_0x39e5ec);_0x14c0a2(null);};}for(var e in events){if(events[_0xf5e2('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xf5e2('0x7')]=CmContactEvents; \ No newline at end of file +var _0xda8e=['emit','hook','exports','events','../../mysqldb','CmContact','save','update','remove'];(function(_0x520f7e,_0x67518d){var _0x587f49=function(_0x226a93){while(--_0x226a93){_0x520f7e['push'](_0x520f7e['shift']());}};_0x587f49(++_0x67518d);}(_0xda8e,0x174));var _0xeda8=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xda8e[_0x1e48d3];return _0x2852b1;};'use strict';var EventEmitter=require(_0xeda8('0x0'));var CmContact=require(_0xeda8('0x1'))['db'][_0xeda8('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeda8('0x3'),'afterUpdate':_0xeda8('0x4'),'afterDestroy':_0xeda8('0x5')};function emitEvent(_0x3cec5f){return function(_0x5e1d2,_0x43fcfe,_0x51bdb4){CmContactEvents[_0xeda8('0x6')](_0x3cec5f+':'+_0x5e1d2['id'],_0x5e1d2);CmContactEvents[_0xeda8('0x6')](_0x3cec5f,_0x5e1d2);_0x51bdb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xeda8('0x7')](e,emitEvent(event));}}module[_0xeda8('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 9bd1e27..3164204 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 _0x152a=['callbackUniqueid','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','catch','Campaign','\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','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','onlyIfOpen','BlackLists','cmContact,\x20%s,\x20%s','afterCreate','message','Lists','CmHopperBlack','isEmpty','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','priority'];(function(_0x43eea6,_0x2dff7e){var _0x1df761=function(_0x1730e5){while(--_0x1730e5){_0x43eea6['push'](_0x43eea6['shift']());}};_0x1df761(++_0x2dff7e);}(_0x152a,0x191));var _0xa152=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x152a[_0x1d87fc];return _0x492b56;};'use strict';var _=require(_0xa152('0x0'));var util=require(_0xa152('0x1'));var logger=require('../../config/logger')(_0xa152('0x2'));var moment=require(_0xa152('0x3'));var BPromise=require(_0xa152('0x4'));var rp=require(_0xa152('0x5'));var fs=require('fs');var path=require(_0xa152('0x6'));var rimraf=require(_0xa152('0x7'));var config=require(_0xa152('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0xa152('0x9'));module[_0xa152('0xa')]=function(_0xa58401,_0x2061c5){return _0xa58401[_0xa152('0xb')](_0xa152('0xc'),attributes,{'tableName':_0xa152('0xd'),'paranoid':!![],'indexes':[{'name':_0xa152('0xe'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0xa152('0xf'),_0xa152('0x10'),_0xa152('0xe'),_0xa152('0x11'),'fax',_0xa152('0x12')],'type':_0xa152('0x13')}],'timestamps':!![],'charset':_0xa152('0x14'),'collate':_0xa152('0x15'),'hooks':{'afterCreate':function(_0x26345f,_0x59bacb,_0x2b9875){var _0x51e3a8=_0xa58401['models'];var _0x4d5c69=_0x26345f[_0xa152('0x16')]({'plain':!![]});function _0x157360(){return function(_0x209c80){logger[_0xa152('0x17')](_0xa152('0x18'),'afterCreate',util[_0xa152('0x19')](_0x209c80,{'showHidden':![],'depth':null}));};}function _0x80cc5d(_0x31b8bd,_0x1c9209){var _0x1eb55e=_0x1c9209[_0xa152('0x1a')]?_0x1c9209['scheduledat']:moment()[_0xa152('0x1b')](_0xa152('0x1c'));return new BPromise(function(_0x2516d2,_0x393822){if(_[_0xa152('0x1d')](_0x1c9209[_0xa152('0x1e')])){_0x2516d2({'ret':_0x1eb55e});}else{_0x51e3a8[_0xa152('0x1f')][_0xa152('0x20')]({'where':{'id':_0x31b8bd['id']}})[_0xa152('0x21')](function(_0x5ec1b9){if(!_[_0xa152('0x1d')](_0x5ec1b9)){var _0x4108e5=_0x5ec1b9[_0xa152('0x1e')];if(!_[_0xa152('0x1d')](_0x4108e5)){var _0x2571cc=shared[_0xa152('0x22')];var _0x1a8d52=_0x2571cc[_0x4108e5];var _0x1fca56=_0x2571cc[_0x1c9209[_0xa152('0x1e')]];if(!_[_0xa152('0x1d')](_0x1a8d52)&&!_['isNil'](_0x1fca56)){var _0x33d63d=_0x1a8d52[_0xa152('0x23')]-_0x1fca56[_0xa152('0x23')];_0x1eb55e=_0x1c9209[_0xa152('0x1a')]?_0x1c9209[_0xa152('0x1a')]:moment();var _0x552179=moment(_0x1eb55e)[_0xa152('0x24')](_0x33d63d,_0xa152('0x25'));_0x2516d2({'ret':_0x552179[_0xa152('0x1b')](_0xa152('0x1c'))});}else _0x2516d2({'ret':_0x1eb55e});}else _0x2516d2({'ret':_0x1eb55e});}else{_0x2516d2({'ret':_0x1eb55e});}});}});return 0xa;}var _0x1304e8=function(_0x4abc47){return new BPromise(function(_0x310429,_0x1d6c50){_0x80cc5d(_0x4abc47,_0x4d5c69)[_0xa152('0x21')](function(_0xdf1327){_0x4d5c69['scheduledat']=_0xdf1327[_0xa152('0x26')];_0x51e3a8['CmHopper'][_0xa152('0x20')]({'where':{'phone':_0x4d5c69[_0xa152('0xe')],'VoiceQueueId':_0x4abc47['id']}})[_0xa152('0x21')](function(_0x223f01){if(!_[_0xa152('0x1d')](_0x223f01)){throw new Error(_0xa152('0x27')+_0x4d5c69[_0xa152('0xe')]+_0xa152('0x28')+_0x4abc47['id']);}return _0x51e3a8[_0xa152('0x29')]['create']({'phone':_0x4d5c69[_0xa152('0xe')],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69['ListId'],'priority':_0x4d5c69[_0xa152('0x2a')]?_0x4d5c69[_0xa152('0x2a')]:0x2,'scheduledat':_0x4d5c69[_0xa152('0x1a')]?_0x4d5c69['scheduledat']:moment()['format'](_0xa152('0x1c')),'callback':_0x4d5c69['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69[_0xa152('0x2b')]:undefined,'callbackat':_0x4d5c69['callbackUniqueid']?moment()[_0xa152('0x1b')](_0xa152('0x1c')):undefined,'VoiceQueueId':_0x4abc47['id']});})['catch'](function(_0x27b625){_0x1d6c50(_0x27b625);});});});};var _0x465027=function(_0x231173){return new BPromise(function(_0x2d2482,_0x3a872c){_0x80cc5d(_0x231173,_0x4d5c69)[_0xa152('0x21')](function(_0x291528){_0x4d5c69[_0xa152('0x1a')]=_0x291528['ret'];_0x51e3a8[_0xa152('0x29')][_0xa152('0x20')]({'where':{'phone':_0x4d5c69[_0xa152('0xe')],'VoiceQueueId':_0x231173['id']}})[_0xa152('0x21')](function(_0x110bf6){if(!_['isNil'](_0x110bf6)){throw new Error(_0xa152('0x27')+_0x4d5c69[_0xa152('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x231173['id']);}return _0x51e3a8[_0xa152('0x2c')][_0xa152('0x20')]({'where':{'calleridnum':_0x4d5c69[_0xa152('0xe')],'VoiceQueueId':_0x231173['id']}});})[_0xa152('0x21')](function(_0x363f6f){if(!_[_0xa152('0x1d')](_0x363f6f)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4d5c69[_0xa152('0xe')]+_0xa152('0x2d')+_0x231173['id']);}return _0x51e3a8[_0xa152('0x29')][_0xa152('0x2e')]({'phone':_0x4d5c69[_0xa152('0xe')],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69[_0xa152('0x2f')],'priority':_0x4d5c69['priority']?_0x4d5c69[_0xa152('0x2a')]:0x2,'scheduledat':_0x4d5c69['scheduledat']?_0x4d5c69['scheduledat']:moment()['format'](_0xa152('0x1c')),'callback':_0x4d5c69[_0xa152('0x2b')]?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69['callbackUniqueid']:undefined,'callbackat':_0x4d5c69[_0xa152('0x2b')]?moment()[_0xa152('0x1b')](_0xa152('0x1c')):undefined,'VoiceQueueId':_0x231173['id']});})[_0xa152('0x30')](function(_0x5ecc8c){_0x3a872c(_0x5ecc8c);});});});};function _0x9df674(){return function(_0xc78968){logger[_0xa152('0x17')](_0xa152('0x18'),'afterCreate',util[_0xa152('0x19')](_0xc78968,{'showHidden':![],'depth':null}));};}function _0x316058(_0x2900f5,_0x1239ba){var _0x30dbc5=_0x1239ba['scheduledat']?_0x1239ba[_0xa152('0x1a')]:moment()[_0xa152('0x1b')](_0xa152('0x1c'));return new BPromise(function(_0x5f57d5,_0x2d0291){if(_[_0xa152('0x1d')](_0x1239ba[_0xa152('0x1e')])){_0x5f57d5({'ret':_0x30dbc5});}else{_0x51e3a8[_0xa152('0x31')][_0xa152('0x20')]({'where':{'id':_0x2900f5['id']}})[_0xa152('0x21')](function(_0x35b6f4){if(!_[_0xa152('0x1d')](_0x35b6f4)){var _0x49c3b5=_0x35b6f4[_0xa152('0x1e')];if(!_[_0xa152('0x1d')](_0x49c3b5)){var _0x24c8b6=shared['timezones'];var _0x1f664a=_0x24c8b6[_0x49c3b5];var _0x270451=_0x24c8b6[_0x1239ba[_0xa152('0x1e')]];if(!_[_0xa152('0x1d')](_0x1f664a)&&!_[_0xa152('0x1d')](_0x270451)){var _0x41e722=_0x1f664a[_0xa152('0x23')]-_0x270451[_0xa152('0x23')];_0x30dbc5=_0x1239ba['scheduledat']?_0x1239ba['scheduledat']:moment();var _0x5b9e5e=moment(_0x30dbc5)[_0xa152('0x24')](_0x41e722,_0xa152('0x25'));_0x5f57d5({'ret':_0x5b9e5e[_0xa152('0x1b')](_0xa152('0x1c'))});}else _0x5f57d5({'ret':_0x30dbc5});}else _0x5f57d5({'ret':_0x30dbc5});}else{_0x5f57d5({'ret':_0x30dbc5});}});}});return 0xa;}var _0x4d6e9e=function(_0x32eb22){return new BPromise(function(_0x50af2c,_0x42704d){_0x316058(_0x32eb22,_0x4d5c69)[_0xa152('0x21')](function(_0x2c7195){_0x4d5c69[_0xa152('0x1a')]=_0x2c7195[_0xa152('0x26')];_0x51e3a8[_0xa152('0x29')][_0xa152('0x20')]({'where':{'phone':_0x4d5c69['phone'],'CampaignId':_0x32eb22['id']}})['then'](function(_0x3bc762){if(!_[_0xa152('0x1d')](_0x3bc762)){throw new Error(_0xa152('0x27')+_0x4d5c69[_0xa152('0xe')]+_0xa152('0x32')+_0x32eb22['id']);}return _0x51e3a8[_0xa152('0x29')][_0xa152('0x2e')]({'phone':_0x4d5c69[_0xa152('0xe')],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69['ListId'],'priority':_0x4d5c69[_0xa152('0x2a')]?_0x4d5c69[_0xa152('0x2a')]:0x2,'scheduledat':_0x4d5c69[_0xa152('0x1a')]?_0x4d5c69[_0xa152('0x1a')]:moment()['format'](_0xa152('0x1c')),'callback':_0x4d5c69['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69[_0xa152('0x2b')]:undefined,'callbackat':_0x4d5c69[_0xa152('0x2b')]?moment()['format'](_0xa152('0x1c')):undefined,'CampaignId':_0x32eb22['id']});})[_0xa152('0x30')](function(_0x3604c5){_0x42704d(_0x3604c5);});});});};var _0x53188d=function(_0x48a330){return new BPromise(function(_0x339aba,_0x12d75a){_0x316058(_0x48a330,_0x4d5c69)['then'](function(_0x122ecb){_0x4d5c69[_0xa152('0x1a')]=_0x122ecb['ret'];_0x51e3a8[_0xa152('0x29')][_0xa152('0x20')]({'where':{'phone':_0x4d5c69[_0xa152('0xe')],'CampaignId':_0x48a330['id']}})['then'](function(_0x29e2b2){if(!_[_0xa152('0x1d')](_0x29e2b2)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4d5c69[_0xa152('0xe')]+_0xa152('0x33')+_0x48a330['id']);}return _0x51e3a8[_0xa152('0x2c')][_0xa152('0x20')]({'where':{'calleridnum':_0x4d5c69[_0xa152('0xe')],'CampaignId':_0x48a330['id']}});})[_0xa152('0x21')](function(_0x302a42){if(!_[_0xa152('0x1d')](_0x302a42)){throw new Error(_0xa152('0x34')+_0x4d5c69[_0xa152('0xe')]+_0xa152('0x35')+_0x48a330['id']);}return _0x51e3a8[_0xa152('0x29')][_0xa152('0x2e')]({'phone':_0x4d5c69['phone'],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69['ListId'],'priority':_0x4d5c69[_0xa152('0x2a')]?_0x4d5c69['priority']:0x2,'scheduledat':_0x4d5c69[_0xa152('0x1a')]?_0x4d5c69['scheduledat']:moment()[_0xa152('0x1b')](_0xa152('0x1c')),'callback':_0x4d5c69[_0xa152('0x2b')]?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69[_0xa152('0x2b')]:undefined,'callbackat':_0x4d5c69['callbackUniqueid']?moment()[_0xa152('0x1b')](_0xa152('0x1c')):undefined,'CampaignId':_0x48a330['id']});})['catch'](function(_0x339cb7){_0x12d75a(_0x339cb7);});});});};if(_0x4d5c69[_0xa152('0x2f')]){_0x51e3a8[_0xa152('0x1f')][_0xa152('0x36')]({'where':{'type':_0xa152('0x37')},'attributes':['id',_0xa152('0x38'),'dialTimezone'],'include':[{'model':_0x51e3a8[_0xa152('0x39')],'as':'Lists','where':{'id':_0x4d5c69[_0xa152('0x2f')]}}]})[_0xa152('0x21')](function(_0x4694b7){if(_0x4694b7){var _0x4d937b=[];for(var _0x44b478=0x0,_0x3a8aaf;_0x44b478<_0x4694b7[_0xa152('0x3a')];_0x44b478+=0x1){_0x3a8aaf=_0x4694b7[_0x44b478]['get']({'plain':!![]});switch(_0x3a8aaf[_0xa152('0x38')]){case _0xa152('0x3b'):_0x465027(_0x3a8aaf)[_0xa152('0x30')](_0x157360());break;case _0xa152('0x3c'):_0x1304e8(_0x3a8aaf)[_0xa152('0x30')](_0x157360());break;default:_0x316058(_0x3a8aaf,_0x4d5c69)[_0xa152('0x21')](function(_0x1cf267){_0x4d5c69[_0xa152('0x1a')]=_0x1cf267['ret'];_0x51e3a8[_0xa152('0x29')]['create']({'phone':_0x4d5c69['phone'],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69[_0xa152('0x2f')],'scheduledat':_0x4d5c69[_0xa152('0x1a')]?_0x4d5c69[_0xa152('0x1a')]:moment()[_0xa152('0x1b')](_0xa152('0x1c')),'priority':_0x4d5c69['priority']?_0x4d5c69[_0xa152('0x2a')]:0x2,'callback':_0x4d5c69['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69[_0xa152('0x2b')]:undefined,'callbackat':_0x4d5c69['callbackUniqueid']?moment()['format'](_0xa152('0x1c')):undefined,'VoiceQueueId':_0x3a8aaf['id']})[_0xa152('0x30')](_0x157360());});}}}})[_0xa152('0x21')](function(){return _0x51e3a8[_0xa152('0x1f')][_0xa152('0x36')]({'where':{'type':_0xa152('0x37')},'attributes':['id'],'include':[{'model':_0x51e3a8[_0xa152('0x39')],'as':_0xa152('0x3d'),'where':{'id':_0x4d5c69['ListId']}}]})[_0xa152('0x21')](function(_0x5791ee){if(_0x5791ee){var _0x2af9cd=[];for(var _0x4b1034=0x0,_0x147bc5;_0x4b1034<_0x5791ee[_0xa152('0x3a')];_0x4b1034+=0x1){_0x147bc5=_0x5791ee[_0x4b1034][_0xa152('0x16')]({'plain':!![]});_0x51e3a8['CmHopperBlack'][_0xa152('0x2e')]({'phone':_0x4d5c69[_0xa152('0xe')],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69[_0xa152('0x2f')],'VoiceQueueId':_0x147bc5['id']})[_0xa152('0x30')](function(_0x3208d5){logger[_0xa152('0x17')](_0xa152('0x3e'),_0xa152('0x3f'),_0x3208d5[_0xa152('0x40')]);});}}});})[_0xa152('0x21')](function(){return _0x51e3a8['Campaign'][_0xa152('0x36')]({'attributes':['id',_0xa152('0x38'),'dialTimezone'],'include':[{'model':_0x51e3a8[_0xa152('0x39')],'as':_0xa152('0x41'),'where':{'id':_0x4d5c69[_0xa152('0x2f')]}}]})[_0xa152('0x21')](function(_0x2adcf7){if(_0x2adcf7){var _0x3e2c48=[];for(var _0x33fe39=0x0,_0x31b5b8;_0x33fe39<_0x2adcf7[_0xa152('0x3a')];_0x33fe39+=0x1){_0x31b5b8=_0x2adcf7[_0x33fe39][_0xa152('0x16')]({'plain':!![]});switch(_0x31b5b8['dialCheckDuplicateType']){case'always':_0x53188d(_0x31b5b8)[_0xa152('0x30')](_0x9df674());break;case _0xa152('0x3c'):_0x4d6e9e(_0x31b5b8)[_0xa152('0x30')](_0x9df674());break;default:_0x51e3a8[_0xa152('0x29')][_0xa152('0x2e')]({'phone':_0x4d5c69[_0xa152('0xe')],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69[_0xa152('0x2f')],'scheduledat':_0x4d5c69[_0xa152('0x1a')]?_0x4d5c69[_0xa152('0x1a')]:moment()[_0xa152('0x1b')](_0xa152('0x1c')),'priority':_0x4d5c69['priority']?_0x4d5c69[_0xa152('0x2a')]:0x2,'callback':_0x4d5c69['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4d5c69[_0xa152('0x2b')]?_0x4d5c69[_0xa152('0x2b')]:undefined,'callbackat':_0x4d5c69[_0xa152('0x2b')]?moment()[_0xa152('0x1b')](_0xa152('0x1c')):undefined,'CampaignId':_0x31b5b8['id']})[_0xa152('0x30')](_0x9df674());}}}});})[_0xa152('0x21')](function(){return _0x51e3a8[_0xa152('0x31')]['findAll']({'attributes':['id'],'include':[{'model':_0x51e3a8[_0xa152('0x39')],'as':_0xa152('0x3d'),'where':{'id':_0x4d5c69[_0xa152('0x2f')]}}]})[_0xa152('0x21')](function(_0x4274b7){if(_0x4274b7){var _0x1ef8c1=[];for(var _0x597bab=0x0,_0x55c029;_0x597bab<_0x4274b7[_0xa152('0x3a')];_0x597bab+=0x1){_0x55c029=_0x4274b7[_0x597bab]['get']({'plain':!![]});_0x51e3a8[_0xa152('0x42')][_0xa152('0x2e')]({'phone':_0x4d5c69['phone'],'ContactId':_0x4d5c69['id'],'ListId':_0x4d5c69[_0xa152('0x2f')],'CampaignId':_0x55c029['id']})[_0xa152('0x30')](function(_0xd4a108){logger[_0xa152('0x17')](_0xa152('0x3e'),_0xa152('0x3f'),_0xd4a108[_0xa152('0x40')]);});}}});})[_0xa152('0x21')](function(){_0x2b9875();})['catch'](function(_0x19e629){logger[_0xa152('0x17')]('cmContact,\x20%s,\x20%s',_0xa152('0x3f'),_0x19e629[_0xa152('0x40')]);_0x2b9875(_0x19e629);});}else{_0x2b9875(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x5d66ad,_0x1cc273,_0x458f4c){var _0x542701=_0xa58401['models'];var _0x58a135=_0x5d66ad[_0xa152('0x16')]({'plain':!![]});return _0x542701[_0xa152('0x29')][_0xa152('0x36')]({'raw':!![],'where':{'ListId':_0x58a135['ListId'],'ContactId':_0x58a135['id']}})[_0xa152('0x21')](function(_0x31a784){if(!_[_0xa152('0x43')](_0x31a784)){var _0x263bc3=[];for(var _0x56dfe0=0x0;_0x56dfe0<_0x31a784['length'];_0x56dfe0+=0x1){var _0x22cdad=_0x542701[_0xa152('0x29')]['destroy']({'where':{'ListId':_0x31a784[_0x56dfe0][_0xa152('0x2f')],'ContactId':_0x31a784[_0x56dfe0][_0xa152('0x44')],'VoiceQueueId':_0x31a784[_0x56dfe0][_0xa152('0x45')],'CampaignId':_0x31a784[_0x56dfe0][_0xa152('0x46')]}});_0x263bc3['push'](_0x22cdad);}return BPromise[_0xa152('0x47')](_0x263bc3);}})[_0xa152('0x21')](function(_0x5b83d8){logger[_0xa152('0x48')]('[CmContact][afterDestroy][Succesfull]',util[_0xa152('0x19')](_0x5b83d8,{'showHidden':![],'depth':null}));_0x458f4c();})['catch'](function(_0x4bf14a){logger['error'](_0xa152('0x49'),util[_0xa152('0x19')](_0x4bf14a,{'showHidden':![],'depth':null}));_0x458f4c(_0x4bf14a);});}}});}; \ No newline at end of file +var _0x19ec=['CmList','Lists','length','onlyIfOpen','BlackLists','CmHopperBlack','always','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','then','isNil','utcOffset','add','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','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','cmContact','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x19ec,0x13a));var _0xc19e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x19ec[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xc19e('0x0'));var util=require(_0xc19e('0x1'));var logger=require('../../config/logger')(_0xc19e('0x2'));var moment=require(_0xc19e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc19e('0x4'));var fs=require('fs');var path=require(_0xc19e('0x5'));var rimraf=require(_0xc19e('0x6'));var config=require(_0xc19e('0x7'));var shared=require(_0xc19e('0x8'));var attributes=require('./cmContact.attributes');module[_0xc19e('0x9')]=function(_0x1ab753,_0xad33f8){return _0x1ab753['define']('CmContact',attributes,{'tableName':_0xc19e('0xa'),'paranoid':!![],'indexes':[{'name':_0xc19e('0xb'),'fields':['phone']},{'name':_0xc19e('0xc'),'fields':[_0xc19e('0xd'),_0xc19e('0xe'),_0xc19e('0xb'),_0xc19e('0xf'),_0xc19e('0x10'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xc19e('0x11'),'collate':_0xc19e('0x12'),'hooks':{'afterCreate':function(_0xb65c4b,_0xa7bb80,_0x49c3de){var _0x12910d=_0x1ab753[_0xc19e('0x13')];var _0x255254=_0xb65c4b[_0xc19e('0x14')]({'plain':!![]});function _0x22c0be(){return function(_0x2ecc14){logger[_0xc19e('0x15')]('cmContact',_0xc19e('0x16'),util[_0xc19e('0x17')](_0x2ecc14,{'showHidden':![],'depth':null}));};}function _0x145ad1(_0x192b95,_0x302c67){var _0x19d159=_0x302c67[_0xc19e('0x18')]?_0x302c67[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a'));return new BPromise(function(_0x28e979,_0x490c53){if(_['isNil'](_0x302c67[_0xc19e('0x1b')])){_0x28e979({'ret':_0x19d159});}else{_0x12910d['VoiceQueue']['findOne']({'where':{'id':_0x192b95['id']}})[_0xc19e('0x1c')](function(_0x58878f){if(!_[_0xc19e('0x1d')](_0x58878f)){var _0x2b7912=_0x58878f['dialTimezone'];if(!_['isNil'](_0x2b7912)){var _0x3cfde2=shared['timezones'];var _0x1e5b6e=_0x3cfde2[_0x2b7912];var _0x4e1374=_0x3cfde2[_0x302c67[_0xc19e('0x1b')]];if(!_[_0xc19e('0x1d')](_0x1e5b6e)&&!_[_0xc19e('0x1d')](_0x4e1374)){var _0x282dca=_0x1e5b6e['utcOffset']-_0x4e1374[_0xc19e('0x1e')];_0x19d159=_0x302c67[_0xc19e('0x18')]?_0x302c67[_0xc19e('0x18')]:moment();var _0x52edc3=moment(_0x19d159)[_0xc19e('0x1f')](_0x282dca,'minutes');_0x28e979({'ret':_0x52edc3['format'](_0xc19e('0x1a'))});}else _0x28e979({'ret':_0x19d159});}else _0x28e979({'ret':_0x19d159});}else{_0x28e979({'ret':_0x19d159});}});}});return 0xa;}var _0x214402=function(_0xf6a63c){return new BPromise(function(_0x2e1415,_0x406f32){_0x145ad1(_0xf6a63c,_0x255254)[_0xc19e('0x1c')](function(_0x22dec7){_0x255254[_0xc19e('0x18')]=_0x22dec7['ret'];_0x12910d[_0xc19e('0x20')][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'VoiceQueueId':_0xf6a63c['id']}})[_0xc19e('0x1c')](function(_0x1ec198){if(!_[_0xc19e('0x1d')](_0x1ec198)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x23')+_0xf6a63c['id']);}return _0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'scheduledat':_0x255254['scheduledat']?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'VoiceQueueId':_0xf6a63c['id']});})['catch'](function(_0x3048c6){_0x406f32(_0x3048c6);});});});};var _0x5b8a98=function(_0x51b8ee){return new BPromise(function(_0x593890,_0x251b80){_0x145ad1(_0x51b8ee,_0x255254)['then'](function(_0x1fe5fe){_0x255254[_0xc19e('0x18')]=_0x1fe5fe[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254['phone'],'VoiceQueueId':_0x51b8ee['id']}})[_0xc19e('0x1c')](function(_0x38153d){if(!_['isNil'](_0x38153d)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x29')+_0x51b8ee['id']);}return _0x12910d[_0xc19e('0x2a')][_0xc19e('0x21')]({'where':{'calleridnum':_0x255254['phone'],'VoiceQueueId':_0x51b8ee['id']}});})[_0xc19e('0x1c')](function(_0xd82502){if(!_[_0xc19e('0x1d')](_0xd82502)){throw new Error(_0xc19e('0x2b')+_0x255254['phone']+_0xc19e('0x2c')+_0x51b8ee['id']);}return _0x12910d['CmHopper'][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254['priority']:0x2,'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x51b8ee['id']});})['catch'](function(_0x3bbf21){_0x251b80(_0x3bbf21);});});});};function _0x465ca2(){return function(_0x57a5a4){logger[_0xc19e('0x15')](_0xc19e('0x2d'),_0xc19e('0x16'),util[_0xc19e('0x17')](_0x57a5a4,{'showHidden':![],'depth':null}));};}function _0x518131(_0x3284a3,_0x1b2ea0){var _0x132a3b=_0x1b2ea0['scheduledat']?_0x1b2ea0[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a'));return new BPromise(function(_0x1d7434,_0x460038){if(_[_0xc19e('0x1d')](_0x1b2ea0[_0xc19e('0x1b')])){_0x1d7434({'ret':_0x132a3b});}else{_0x12910d[_0xc19e('0x2e')]['findOne']({'where':{'id':_0x3284a3['id']}})[_0xc19e('0x1c')](function(_0x3c466b){if(!_['isNil'](_0x3c466b)){var _0x5e116f=_0x3c466b['dialTimezone'];if(!_[_0xc19e('0x1d')](_0x5e116f)){var _0xb5e8f3=shared[_0xc19e('0x2f')];var _0x10df14=_0xb5e8f3[_0x5e116f];var _0x39f3d5=_0xb5e8f3[_0x1b2ea0['dialTimezone']];if(!_['isNil'](_0x10df14)&&!_[_0xc19e('0x1d')](_0x39f3d5)){var _0x571629=_0x10df14['utcOffset']-_0x39f3d5[_0xc19e('0x1e')];_0x132a3b=_0x1b2ea0[_0xc19e('0x18')]?_0x1b2ea0['scheduledat']:moment();var _0xbb7ca=moment(_0x132a3b)[_0xc19e('0x1f')](_0x571629,_0xc19e('0x30'));_0x1d7434({'ret':_0xbb7ca['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1d7434({'ret':_0x132a3b});}else _0x1d7434({'ret':_0x132a3b});}else{_0x1d7434({'ret':_0x132a3b});}});}});return 0xa;}var _0x28e72c=function(_0x82ac){return new BPromise(function(_0x4d0b21,_0x3b5b9d){_0x518131(_0x82ac,_0x255254)[_0xc19e('0x1c')](function(_0x185231){_0x255254[_0xc19e('0x18')]=_0x185231[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'CampaignId':_0x82ac['id']}})[_0xc19e('0x1c')](function(_0x1edbd6){if(!_[_0xc19e('0x1d')](_0x1edbd6)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x31')+_0x82ac['id']);}return _0x12910d['CmHopper']['create']({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254['priority']:0x2,'scheduledat':_0x255254['scheduledat']?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'CampaignId':_0x82ac['id']});})[_0xc19e('0x32')](function(_0x35029f){_0x3b5b9d(_0x35029f);});});});};var _0x1e2256=function(_0x1a55b4){return new BPromise(function(_0x68205d,_0x54d2b3){_0x518131(_0x1a55b4,_0x255254)[_0xc19e('0x1c')](function(_0x3f71c2){_0x255254['scheduledat']=_0x3f71c2[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'CampaignId':_0x1a55b4['id']}})[_0xc19e('0x1c')](function(_0x4f1c0a){if(!_['isNil'](_0x4f1c0a)){throw new Error(_0xc19e('0x22')+_0x255254['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1a55b4['id']);}return _0x12910d['CmHopperFinal'][_0xc19e('0x21')]({'where':{'calleridnum':_0x255254[_0xc19e('0xb')],'CampaignId':_0x1a55b4['id']}});})[_0xc19e('0x1c')](function(_0x4ac989){if(!_[_0xc19e('0x1d')](_0x4ac989)){throw new Error(_0xc19e('0x2b')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x33')+_0x1a55b4['id']);}return _0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()['format'](_0xc19e('0x1a')):undefined,'CampaignId':_0x1a55b4['id']});})[_0xc19e('0x32')](function(_0x51f71f){_0x54d2b3(_0x51f71f);});});});};if(_0x255254['ListId']){_0x12910d[_0xc19e('0x34')][_0xc19e('0x35')]({'where':{'type':_0xc19e('0x36')},'attributes':['id',_0xc19e('0x37'),_0xc19e('0x1b')],'include':[{'model':_0x12910d[_0xc19e('0x38')],'as':_0xc19e('0x39'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x1c2314){if(_0x1c2314){var _0x21776c=[];for(var _0x548cf4=0x0,_0xfcab94;_0x548cf4<_0x1c2314[_0xc19e('0x3a')];_0x548cf4+=0x1){_0xfcab94=_0x1c2314[_0x548cf4][_0xc19e('0x14')]({'plain':!![]});switch(_0xfcab94[_0xc19e('0x37')]){case'always':_0x5b8a98(_0xfcab94)[_0xc19e('0x32')](_0x22c0be());break;case _0xc19e('0x3b'):_0x214402(_0xfcab94)['catch'](_0x22c0be());break;default:_0x518131(_0xfcab94,_0x255254)[_0xc19e('0x1c')](function(_0x2f94fe){_0x255254[_0xc19e('0x18')]=_0x2f94fe[_0xc19e('0x28')];_0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254['scheduledat']:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'VoiceQueueId':_0xfcab94['id']})[_0xc19e('0x32')](_0x22c0be());});}}}})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x34')][_0xc19e('0x35')]({'where':{'type':_0xc19e('0x36')},'attributes':['id'],'include':[{'model':_0x12910d[_0xc19e('0x38')],'as':_0xc19e('0x3c'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})['then'](function(_0x2142d0){if(_0x2142d0){var _0x262f3a=[];for(var _0xdccbea=0x0,_0x353c4b;_0xdccbea<_0x2142d0[_0xc19e('0x3a')];_0xdccbea+=0x1){_0x353c4b=_0x2142d0[_0xdccbea][_0xc19e('0x14')]({'plain':!![]});_0x12910d[_0xc19e('0x3d')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'VoiceQueueId':_0x353c4b['id']})['catch'](function(_0x56b826){logger[_0xc19e('0x15')]('cmContact,\x20%s,\x20%s','afterCreate',_0x56b826['message']);});}}});})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x2e')][_0xc19e('0x35')]({'attributes':['id',_0xc19e('0x37'),_0xc19e('0x1b')],'include':[{'model':_0x12910d['CmList'],'as':_0xc19e('0x39'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x1c6944){if(_0x1c6944){var _0x1f2a99=[];for(var _0x498a68=0x0,_0x5b62a9;_0x498a68<_0x1c6944[_0xc19e('0x3a')];_0x498a68+=0x1){_0x5b62a9=_0x1c6944[_0x498a68][_0xc19e('0x14')]({'plain':!![]});switch(_0x5b62a9[_0xc19e('0x37')]){case _0xc19e('0x3e'):_0x1e2256(_0x5b62a9)[_0xc19e('0x32')](_0x465ca2());break;case _0xc19e('0x3b'):_0x28e72c(_0x5b62a9)[_0xc19e('0x32')](_0x465ca2());break;default:_0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'CampaignId':_0x5b62a9['id']})[_0xc19e('0x32')](_0x465ca2());}}}});})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x2e')][_0xc19e('0x35')]({'attributes':['id'],'include':[{'model':_0x12910d['CmList'],'as':_0xc19e('0x3c'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x412010){if(_0x412010){var _0x26dace=[];for(var _0x94e94a=0x0,_0x33ba23;_0x94e94a<_0x412010[_0xc19e('0x3a')];_0x94e94a+=0x1){_0x33ba23=_0x412010[_0x94e94a][_0xc19e('0x14')]({'plain':!![]});_0x12910d[_0xc19e('0x3d')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'CampaignId':_0x33ba23['id']})['catch'](function(_0x5dc263){logger[_0xc19e('0x15')](_0xc19e('0x3f'),_0xc19e('0x16'),_0x5dc263[_0xc19e('0x40')]);});}}});})[_0xc19e('0x1c')](function(){_0x49c3de();})['catch'](function(_0x2c4991){logger[_0xc19e('0x15')](_0xc19e('0x3f'),'afterCreate',_0x2c4991[_0xc19e('0x40')]);_0x49c3de(_0x2c4991);});}else{_0x49c3de(new Error(_0xc19e('0x41')));}},'afterDestroy':function(_0x222655,_0x3697b,_0x1d950a){var _0x370f6a=_0x1ab753[_0xc19e('0x13')];var _0x289465=_0x222655[_0xc19e('0x14')]({'plain':!![]});return _0x370f6a[_0xc19e('0x20')]['findAll']({'raw':!![],'where':{'ListId':_0x289465[_0xc19e('0x25')],'ContactId':_0x289465['id']}})['then'](function(_0x4615d6){if(!_[_0xc19e('0x42')](_0x4615d6)){var _0x11aac5=[];for(var _0x16c0ab=0x0;_0x16c0ab<_0x4615d6[_0xc19e('0x3a')];_0x16c0ab+=0x1){var _0x2d47b0=_0x370f6a[_0xc19e('0x20')][_0xc19e('0x43')]({'where':{'ListId':_0x4615d6[_0x16c0ab][_0xc19e('0x25')],'ContactId':_0x4615d6[_0x16c0ab]['ContactId'],'VoiceQueueId':_0x4615d6[_0x16c0ab][_0xc19e('0x44')],'CampaignId':_0x4615d6[_0x16c0ab][_0xc19e('0x45')]}});_0x11aac5[_0xc19e('0x46')](_0x2d47b0);}return BPromise['all'](_0x11aac5);}})[_0xc19e('0x1c')](function(_0x15cf3e){logger[_0xc19e('0x47')](_0xc19e('0x48'),util[_0xc19e('0x17')](_0x15cf3e,{'showHidden':![],'depth':null}));_0x1d950a();})[_0xc19e('0x32')](function(_0x4aa356){logger[_0xc19e('0x15')](_0xc19e('0x49'),util[_0xc19e('0x17')](_0x4aa356,{'showHidden':![],'depth':null}));_0x1d950a(_0x4aa356);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 35a0a2b..8c8cd95 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 _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x157cda,_0x37406c){var _0x4fdc81=function(_0x37bca5){while(--_0x37bca5){_0x157cda['push'](_0x157cda['shift']());}};_0x4fdc81(++_0x37406c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\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(_0x474a8c,_0x1af07f){var _0x7fbdab=function(_0x337c43){while(--_0x337c43){_0x474a8c['push'](_0x474a8c['shift']());}};_0x7fbdab(++_0x1af07f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 e02101a..6d4b26e 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 _0x949d=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x55e5b9,_0x1be20e){var _0x58d1e7=function(_0x3cba6d){while(--_0x3cba6d){_0x55e5b9['push'](_0x55e5b9['shift']());}};_0x58d1e7(++_0x1be20e);}(_0x949d,0x162));var _0xd949=function(_0x557942,_0x325c85){_0x557942=_0x557942-0x0;var _0x1e2b8b=_0x949d[_0x557942];return _0x1e2b8b;};'use strict';var Sequelize=require(_0xd949('0x0'));module[_0xd949('0x1')]={'CmContactId':{'type':Sequelize[_0xd949('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd949('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd949('0x4')},'OrderBy':{'type':Sequelize[_0xd949('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xde56=['sequelize','INTEGER','STRING','PHONE'];(function(_0x8cd5cc,_0x48185e){var _0x315d95=function(_0x57db22){while(--_0x57db22){_0x8cd5cc['push'](_0x8cd5cc['shift']());}};_0x315d95(++_0x48185e);}(_0xde56,0x144));var _0x6de5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xde56[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x6de5('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x6de5('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x6de5('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x6de5('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6de5('0x2')],'defaultValue':_0x6de5('0x3')},'OrderBy':{'type':Sequelize[_0x6de5('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x6de5('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 58f7444..ed6d53a 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 _0x532f=['undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x15b461,_0x2efcaa){var _0x55ea91=function(_0x54b573){while(--_0x54b573){_0x15b461['push'](_0x15b461['shift']());}};_0x55ea91(++_0x2efcaa);}(_0x532f,0x87));var _0xf532=function(_0x5815b5,_0x1085ae){_0x5815b5=_0x5815b5-0x0;var _0x1a00f8=_0x532f[_0x5815b5];return _0x1a00f8;};'use strict';var emlformat=require(_0xf532('0x0'));var rimraf=require(_0xf532('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf532('0x2'));var rp=require(_0xf532('0x3'));var moment=require(_0xf532('0x4'));var BPromise=require(_0xf532('0x5'));var Mustache=require(_0xf532('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf532('0x7'));var csv=require(_0xf532('0x8'));var ejs=require(_0xf532('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf532('0xa'));var squel=require(_0xf532('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf532('0xc'));var toCsv=require(_0xf532('0x8'));var querystring=require(_0xf532('0xd'));var Papa=require(_0xf532('0xe'));var Redis=require(_0xf532('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf532('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf532('0x11'))(_0xf532('0x12'));var utils=require(_0xf532('0x13'));var config=require(_0xf532('0x14'));var licenseUtil=require(_0xf532('0x15'));var db=require(_0xf532('0x16'))['db'];function respondWithStatusCode(_0x142c78,_0x4a7e19){_0x4a7e19=_0x4a7e19||0xcc;return function(_0x5b87dd){if(_0x5b87dd){return _0x142c78[_0xf532('0x17')](_0x4a7e19);}return _0x142c78['status'](_0x4a7e19)[_0xf532('0x18')]();};}function respondWithResult(_0x426da4,_0x2a59ef){_0x2a59ef=_0x2a59ef||0xc8;return function(_0x4a61ed){if(_0x4a61ed){return _0x426da4['status'](_0x2a59ef)[_0xf532('0x19')](_0x4a61ed);}};}function respondWithFilteredResult(_0x18764b,_0x5d394e){return function(_0xe1c0e9){if(_0xe1c0e9){var _0x2eadf7=typeof _0x5d394e[_0xf532('0x1a')]===_0xf532('0x1b')&&typeof _0x5d394e[_0xf532('0x1c')]===_0xf532('0x1b');var _0x943ff8=_0xe1c0e9[_0xf532('0x1d')];var _0x47e082=_0x2eadf7?0x0:_0x5d394e[_0xf532('0x1a')];var _0x597fa6=_0x2eadf7?_0xe1c0e9[_0xf532('0x1d')]:_0x5d394e[_0xf532('0x1a')]+_0x5d394e['limit'];var _0x43c26c;if(_0x597fa6>=_0x943ff8){_0x597fa6=_0x943ff8;_0x43c26c=0xc8;}else{_0x43c26c=0xce;}_0x18764b[_0xf532('0x1e')](_0x43c26c);return _0x18764b['set'](_0xf532('0x1f'),_0x47e082+'-'+_0x597fa6+'/'+_0x943ff8)[_0xf532('0x19')](_0xe1c0e9);}return null;};}function patchUpdates(_0x36ad23){return function(_0x13193e){try{jsonpatch[_0xf532('0x20')](_0x13193e,_0x36ad23,!![]);}catch(_0x3e8f4b){return BPromise[_0xf532('0x21')](_0x3e8f4b);}return _0x13193e[_0xf532('0x22')]();};}function saveUpdates(_0x343af8,_0x3d884f){return function(_0x191565){if(_0x191565){return _0x191565[_0xf532('0x23')](_0x343af8)[_0xf532('0x24')](function(_0x9e41ea){return _0x9e41ea;});}return null;};}function removeEntity(_0x3ee515,_0x46fbeb){return function(_0x4c4676){if(_0x4c4676){return _0x4c4676[_0xf532('0x25')]()[_0xf532('0x24')](function(){var _0x10d980=_0x4c4676[_0xf532('0x26')]({'plain':!![]});var _0x44bf2a=_0xf532('0x27');return db[_0xf532('0x28')][_0xf532('0x25')]({'where':{'type':_0x44bf2a,'resourceId':_0x10d980['id']}})[_0xf532('0x24')](function(){return _0x4c4676;});})[_0xf532('0x24')](function(){_0x3ee515[_0xf532('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8352d,_0x427b25){return function(_0x2a278c){if(!_0x2a278c){_0x8352d['sendStatus'](0x194);}return _0x2a278c;};}function handleError(_0x44511a,_0x42a827){_0x42a827=_0x42a827||0x1f4;return function(_0x3f1f20){logger['error'](_0x3f1f20['stack']);if(_0x3f1f20[_0xf532('0x29')]){delete _0x3f1f20[_0xf532('0x29')];}_0x44511a[_0xf532('0x1e')](_0x42a827)[_0xf532('0x2a')](_0x3f1f20);};}exports[_0xf532('0x2b')]=function(_0xc4c7c8,_0x6554da){var _0x34f9f5={},_0x943906={},_0x3cc897={'count':0x0,'rows':[]};var _0x39366f=_[_0xf532('0x2c')](db[_0xf532('0x2d')][_0xf532('0x2e')],function(_0x238d7d){return{'name':_0x238d7d[_0xf532('0x2f')],'type':_0x238d7d[_0xf532('0x30')][_0xf532('0x31')]};});_0x943906['model']=_[_0xf532('0x2c')](_0x39366f,_0xf532('0x29'));_0x943906[_0xf532('0x32')]=_[_0xf532('0x33')](_0xc4c7c8[_0xf532('0x32')]);_0x943906[_0xf532('0x34')]=_['intersection'](_0x943906['model'],_0x943906[_0xf532('0x32')]);_0x34f9f5[_0xf532('0x35')]=_[_0xf532('0x36')](_0x943906[_0xf532('0x37')],qs[_0xf532('0x38')](_0xc4c7c8['query'][_0xf532('0x38')]));_0x34f9f5[_0xf532('0x35')]=_0x34f9f5[_0xf532('0x35')][_0xf532('0x39')]?_0x34f9f5[_0xf532('0x35')]:_0x943906[_0xf532('0x37')];if(!_0xc4c7c8[_0xf532('0x32')][_0xf532('0x3a')]('nolimit')){_0x34f9f5[_0xf532('0x1c')]=qs[_0xf532('0x1c')](_0xc4c7c8['query']['limit']);_0x34f9f5[_0xf532('0x1a')]=qs[_0xf532('0x1a')](_0xc4c7c8[_0xf532('0x32')][_0xf532('0x1a')]);}_0x34f9f5['order']=qs['sort'](_0xc4c7c8[_0xf532('0x32')]['sort']);_0x34f9f5[_0xf532('0x3b')]=qs[_0xf532('0x34')](_[_0xf532('0x3c')](_0xc4c7c8[_0xf532('0x32')],_0x943906[_0xf532('0x34')]),_0x39366f);if(_0xc4c7c8[_0xf532('0x32')][_0xf532('0x3d')]){_0x34f9f5[_0xf532('0x3b')]=_[_0xf532('0x3e')](_0x34f9f5['where'],{'$or':_[_0xf532('0x2c')](_0x39366f,function(_0x5533e2){if(_0x5533e2[_0xf532('0x30')]!==_0xf532('0x3f')){var _0x30f5f7={};_0x30f5f7[_0x5533e2['name']]={'$like':'%'+_0xc4c7c8[_0xf532('0x32')][_0xf532('0x3d')]+'%'};return _0x30f5f7;}})});}_0x34f9f5=_['merge']({},_0x34f9f5,_0xc4c7c8[_0xf532('0x40')]);var _0x2eb65c={'where':_0x34f9f5[_0xf532('0x3b')]};return db['CmContactHasItem'][_0xf532('0x1d')](_0x2eb65c)['then'](function(_0x3a915f){_0x3cc897[_0xf532('0x1d')]=_0x3a915f;if(_0xc4c7c8['query'][_0xf532('0x41')]){_0x34f9f5[_0xf532('0x42')]=[{'all':!![]}];}return db[_0xf532('0x2d')]['findAll'](_0x34f9f5);})[_0xf532('0x24')](function(_0x49d4d7){_0x3cc897[_0xf532('0x43')]=_0x49d4d7;return _0x3cc897;})[_0xf532('0x24')](respondWithFilteredResult(_0x6554da,_0x34f9f5))[_0xf532('0x44')](handleError(_0x6554da,null));};exports[_0xf532('0x45')]=function(_0x4afa02,_0x1909aa){var _0x35ce72={'raw':!![],'where':{'id':_0x4afa02[_0xf532('0x46')]['id']}},_0x452082={};_0x452082['model']=_[_0xf532('0x33')](db[_0xf532('0x2d')][_0xf532('0x2e')]);_0x452082[_0xf532('0x32')]=_[_0xf532('0x33')](_0x4afa02['query']);_0x452082[_0xf532('0x34')]=_[_0xf532('0x36')](_0x452082[_0xf532('0x37')],_0x452082['query']);_0x35ce72[_0xf532('0x35')]=_[_0xf532('0x36')](_0x452082['model'],qs[_0xf532('0x38')](_0x4afa02[_0xf532('0x32')][_0xf532('0x38')]));_0x35ce72[_0xf532('0x35')]=_0x35ce72['attributes'][_0xf532('0x39')]?_0x35ce72[_0xf532('0x35')]:_0x452082[_0xf532('0x37')];if(_0x4afa02[_0xf532('0x32')][_0xf532('0x41')]){_0x35ce72['include']=[{'all':!![]}];}_0x35ce72=_['merge']({},_0x35ce72,_0x4afa02[_0xf532('0x40')]);return db['CmContactHasItem'][_0xf532('0x47')](_0x35ce72)[_0xf532('0x24')](handleEntityNotFound(_0x1909aa,null))[_0xf532('0x24')](respondWithResult(_0x1909aa,null))['catch'](handleError(_0x1909aa,null));};exports['create']=function(_0x398dbf,_0x565b56){return db[_0xf532('0x2d')][_0xf532('0x48')](_0x398dbf[_0xf532('0x49')],{})['then'](function(_0x20dfef){var _0x4c1370=_0x398dbf[_0xf532('0x4a')][_0xf532('0x26')]({'plain':!![]});if(!_0x4c1370)throw new Error(_0xf532('0x4b'));if(_0x4c1370[_0xf532('0x4c')]===_0xf532('0x4a')){var _0x9ea0d=_0x20dfef[_0xf532('0x26')]({'plain':!![]});var _0x17db92=_0xf532('0x27');return db[_0xf532('0x4d')][_0xf532('0x47')]({'where':{'name':_0x17db92,'userProfileId':_0x4c1370[_0xf532('0x4e')]},'raw':!![]})[_0xf532('0x24')](function(_0x166581){if(_0x166581&&_0x166581[_0xf532('0x4f')]===0x0){return db['UserProfileResource'][_0xf532('0x48')]({'name':_0x9ea0d[_0xf532('0x29')],'resourceId':_0x9ea0d['id'],'type':_0x166581[_0xf532('0x29')],'sectionId':_0x166581['id']},{})['then'](function(){return _0x20dfef;});}else{return _0x20dfef;}})[_0xf532('0x44')](function(_0x5af287){logger['error'](_0xf532('0x50'),_0x5af287);throw _0x5af287;});}return _0x20dfef;})[_0xf532('0x24')](respondWithResult(_0x565b56,0xc9))[_0xf532('0x44')](handleError(_0x565b56,null));};exports[_0xf532('0x23')]=function(_0x2a0014,_0x2f0083){if(_0x2a0014[_0xf532('0x49')]['id']){delete _0x2a0014[_0xf532('0x49')]['id'];}return db[_0xf532('0x2d')][_0xf532('0x47')]({'where':{'id':_0x2a0014[_0xf532('0x46')]['id']}})[_0xf532('0x24')](handleEntityNotFound(_0x2f0083,null))[_0xf532('0x24')](saveUpdates(_0x2a0014['body'],null))[_0xf532('0x24')](respondWithResult(_0x2f0083,null))[_0xf532('0x44')](handleError(_0x2f0083,null));};exports[_0xf532('0x25')]=function(_0x24993,_0x2551b5){return db['CmContactHasItem'][_0xf532('0x47')]({'where':{'id':_0x24993[_0xf532('0x46')]['id']}})[_0xf532('0x24')](handleEntityNotFound(_0x2551b5,null))[_0xf532('0x24')](removeEntity(_0x2551b5,null))[_0xf532('0x44')](handleError(_0x2551b5,null));}; \ No newline at end of file +var _0xee61=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','UserProfileResource','destroy','error','stack','name','send','map','CmContactHasItem','fieldName','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','fields','include','find','create','body','get','role','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee61,0x91));var _0x1ee6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee61[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1ee6('0x0'));var rimraf=require(_0x1ee6('0x1'));var zipdir=require(_0x1ee6('0x2'));var jsonpatch=require(_0x1ee6('0x3'));var rp=require(_0x1ee6('0x4'));var moment=require(_0x1ee6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ee6('0x6'));var path=require(_0x1ee6('0x7'));var sox=require(_0x1ee6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ee6('0x9'));var _=require(_0x1ee6('0xa'));var squel=require(_0x1ee6('0xb'));var crypto=require(_0x1ee6('0xc'));var jsforce=require(_0x1ee6('0xd'));var deskjs=require(_0x1ee6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ee6('0xf'));var Papa=require(_0x1ee6('0x10'));var Redis=require(_0x1ee6('0x11'));var authService=require(_0x1ee6('0x12'));var qs=require(_0x1ee6('0x13'));var as=require(_0x1ee6('0x14'));var hardwareService=require(_0x1ee6('0x15'));var logger=require('../../config/logger')(_0x1ee6('0x16'));var utils=require(_0x1ee6('0x17'));var config=require(_0x1ee6('0x18'));var licenseUtil=require(_0x1ee6('0x19'));var db=require(_0x1ee6('0x1a'))['db'];function respondWithStatusCode(_0xe6d621,_0x3b5a06){_0x3b5a06=_0x3b5a06||0xcc;return function(_0xd3e57a){if(_0xd3e57a){return _0xe6d621[_0x1ee6('0x1b')](_0x3b5a06);}return _0xe6d621[_0x1ee6('0x1c')](_0x3b5a06)[_0x1ee6('0x1d')]();};}function respondWithResult(_0x2361b1,_0xfcdafa){_0xfcdafa=_0xfcdafa||0xc8;return function(_0x14e987){if(_0x14e987){return _0x2361b1[_0x1ee6('0x1c')](_0xfcdafa)[_0x1ee6('0x1e')](_0x14e987);}};}function respondWithFilteredResult(_0x416013,_0x2b1ade){return function(_0x321296){if(_0x321296){var _0x33f3d0=typeof _0x2b1ade[_0x1ee6('0x1f')]===_0x1ee6('0x20')&&typeof _0x2b1ade[_0x1ee6('0x21')]==='undefined';var _0x3ba9d1=_0x321296[_0x1ee6('0x22')];var _0x114b7f=_0x33f3d0?0x0:_0x2b1ade['offset'];var _0x1ce62b=_0x33f3d0?_0x321296[_0x1ee6('0x22')]:_0x2b1ade[_0x1ee6('0x1f')]+_0x2b1ade[_0x1ee6('0x21')];var _0x178206;if(_0x1ce62b>=_0x3ba9d1){_0x1ce62b=_0x3ba9d1;_0x178206=0xc8;}else{_0x178206=0xce;}_0x416013['status'](_0x178206);return _0x416013['set'](_0x1ee6('0x23'),_0x114b7f+'-'+_0x1ce62b+'/'+_0x3ba9d1)[_0x1ee6('0x1e')](_0x321296);}return null;};}function patchUpdates(_0x69e766){return function(_0x2bcf6d){try{jsonpatch[_0x1ee6('0x24')](_0x2bcf6d,_0x69e766,!![]);}catch(_0x2232ab){return BPromise['reject'](_0x2232ab);}return _0x2bcf6d[_0x1ee6('0x25')]();};}function saveUpdates(_0x240b4c,_0x553f7e){return function(_0x4d996a){if(_0x4d996a){return _0x4d996a[_0x1ee6('0x26')](_0x240b4c)[_0x1ee6('0x27')](function(_0x655e1e){return _0x655e1e;});}return null;};}function removeEntity(_0x55bc02,_0x4ea1aa){return function(_0x306853){if(_0x306853){return _0x306853['destroy']()[_0x1ee6('0x27')](function(){var _0x2b52c3=_0x306853['get']({'plain':!![]});var _0xbaf549='CmContactHasItems';return db[_0x1ee6('0x28')][_0x1ee6('0x29')]({'where':{'type':_0xbaf549,'resourceId':_0x2b52c3['id']}})['then'](function(){return _0x306853;});})[_0x1ee6('0x27')](function(){_0x55bc02[_0x1ee6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0e57,_0x4ed7b1){return function(_0x2d5983){if(!_0x2d5983){_0x5d0e57[_0x1ee6('0x1b')](0x194);}return _0x2d5983;};}function handleError(_0x470236,_0x43bf62){_0x43bf62=_0x43bf62||0x1f4;return function(_0x4344b2){logger[_0x1ee6('0x2a')](_0x4344b2[_0x1ee6('0x2b')]);if(_0x4344b2['name']){delete _0x4344b2[_0x1ee6('0x2c')];}_0x470236[_0x1ee6('0x1c')](_0x43bf62)[_0x1ee6('0x2d')](_0x4344b2);};}exports['index']=function(_0x51a501,_0x4d2cde){var _0x43b4f6={},_0xe03559={},_0x5a6260={'count':0x0,'rows':[]};var _0x3715bf=_[_0x1ee6('0x2e')](db[_0x1ee6('0x2f')]['rawAttributes'],function(_0x33e0cd){return{'name':_0x33e0cd[_0x1ee6('0x30')],'type':_0x33e0cd[_0x1ee6('0x31')][_0x1ee6('0x32')]};});_0xe03559[_0x1ee6('0x33')]=_[_0x1ee6('0x2e')](_0x3715bf,_0x1ee6('0x2c'));_0xe03559['query']=_[_0x1ee6('0x34')](_0x51a501[_0x1ee6('0x35')]);_0xe03559['filters']=_['intersection'](_0xe03559[_0x1ee6('0x33')],_0xe03559[_0x1ee6('0x35')]);_0x43b4f6[_0x1ee6('0x36')]=_[_0x1ee6('0x37')](_0xe03559[_0x1ee6('0x33')],qs['fields'](_0x51a501[_0x1ee6('0x35')]['fields']));_0x43b4f6[_0x1ee6('0x36')]=_0x43b4f6[_0x1ee6('0x36')][_0x1ee6('0x38')]?_0x43b4f6[_0x1ee6('0x36')]:_0xe03559['model'];if(!_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x39')](_0x1ee6('0x3a'))){_0x43b4f6[_0x1ee6('0x21')]=qs[_0x1ee6('0x21')](_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x21')]);_0x43b4f6['offset']=qs['offset'](_0x51a501['query'][_0x1ee6('0x1f')]);}_0x43b4f6[_0x1ee6('0x3b')]=qs[_0x1ee6('0x3c')](_0x51a501['query']['sort']);_0x43b4f6[_0x1ee6('0x3d')]=qs[_0x1ee6('0x3e')](_[_0x1ee6('0x3f')](_0x51a501[_0x1ee6('0x35')],_0xe03559[_0x1ee6('0x3e')]),_0x3715bf);if(_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x40')]){_0x43b4f6[_0x1ee6('0x3d')]=_['merge'](_0x43b4f6[_0x1ee6('0x3d')],{'$or':_[_0x1ee6('0x2e')](_0x3715bf,function(_0x1f8e8f){if(_0x1f8e8f['type']!==_0x1ee6('0x41')){var _0x137201={};_0x137201[_0x1f8e8f[_0x1ee6('0x2c')]]={'$like':'%'+_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x40')]+'%'};return _0x137201;}})});}_0x43b4f6=_[_0x1ee6('0x42')]({},_0x43b4f6,_0x51a501[_0x1ee6('0x43')]);var _0xb1b705={'where':_0x43b4f6[_0x1ee6('0x3d')]};return db[_0x1ee6('0x2f')][_0x1ee6('0x22')](_0xb1b705)[_0x1ee6('0x27')](function(_0x1c8d2b){_0x5a6260[_0x1ee6('0x22')]=_0x1c8d2b;if(_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x44')]){_0x43b4f6['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x1ee6('0x45')](_0x43b4f6);})[_0x1ee6('0x27')](function(_0x13d2a3){_0x5a6260[_0x1ee6('0x46')]=_0x13d2a3;return _0x5a6260;})['then'](respondWithFilteredResult(_0x4d2cde,_0x43b4f6))[_0x1ee6('0x47')](handleError(_0x4d2cde,null));};exports['show']=function(_0x3663dd,_0x281254){var _0x5abb90={'raw':!![],'where':{'id':_0x3663dd[_0x1ee6('0x48')]['id']}},_0x4a7e0d={};_0x4a7e0d[_0x1ee6('0x33')]=_[_0x1ee6('0x34')](db[_0x1ee6('0x2f')][_0x1ee6('0x49')]);_0x4a7e0d[_0x1ee6('0x35')]=_[_0x1ee6('0x34')](_0x3663dd[_0x1ee6('0x35')]);_0x4a7e0d[_0x1ee6('0x3e')]=_['intersection'](_0x4a7e0d[_0x1ee6('0x33')],_0x4a7e0d[_0x1ee6('0x35')]);_0x5abb90[_0x1ee6('0x36')]=_[_0x1ee6('0x37')](_0x4a7e0d[_0x1ee6('0x33')],qs['fields'](_0x3663dd['query'][_0x1ee6('0x4a')]));_0x5abb90[_0x1ee6('0x36')]=_0x5abb90[_0x1ee6('0x36')][_0x1ee6('0x38')]?_0x5abb90[_0x1ee6('0x36')]:_0x4a7e0d['model'];if(_0x3663dd[_0x1ee6('0x35')][_0x1ee6('0x44')]){_0x5abb90[_0x1ee6('0x4b')]=[{'all':!![]}];}_0x5abb90=_[_0x1ee6('0x42')]({},_0x5abb90,_0x3663dd[_0x1ee6('0x43')]);return db[_0x1ee6('0x2f')][_0x1ee6('0x4c')](_0x5abb90)[_0x1ee6('0x27')](handleEntityNotFound(_0x281254,null))[_0x1ee6('0x27')](respondWithResult(_0x281254,null))[_0x1ee6('0x47')](handleError(_0x281254,null));};exports[_0x1ee6('0x4d')]=function(_0x1aa544,_0x4444bc){return db[_0x1ee6('0x2f')]['create'](_0x1aa544[_0x1ee6('0x4e')],{})[_0x1ee6('0x27')](function(_0x637e1c){var _0x3f3032=_0x1aa544['user'][_0x1ee6('0x4f')]({'plain':!![]});if(!_0x3f3032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f3032[_0x1ee6('0x50')]==='user'){var _0x127ffd=_0x637e1c[_0x1ee6('0x4f')]({'plain':!![]});var _0x55b89a=_0x1ee6('0x51');return db[_0x1ee6('0x52')][_0x1ee6('0x4c')]({'where':{'name':_0x55b89a,'userProfileId':_0x3f3032[_0x1ee6('0x53')]},'raw':!![]})[_0x1ee6('0x27')](function(_0x461a1c){if(_0x461a1c&&_0x461a1c[_0x1ee6('0x54')]===0x0){return db[_0x1ee6('0x28')][_0x1ee6('0x4d')]({'name':_0x127ffd[_0x1ee6('0x2c')],'resourceId':_0x127ffd['id'],'type':_0x461a1c[_0x1ee6('0x2c')],'sectionId':_0x461a1c['id']},{})['then'](function(){return _0x637e1c;});}else{return _0x637e1c;}})[_0x1ee6('0x47')](function(_0x49bf0b){logger[_0x1ee6('0x2a')](_0x1ee6('0x55'),_0x49bf0b);throw _0x49bf0b;});}return _0x637e1c;})[_0x1ee6('0x27')](respondWithResult(_0x4444bc,0xc9))['catch'](handleError(_0x4444bc,null));};exports[_0x1ee6('0x26')]=function(_0x220295,_0x171206){if(_0x220295[_0x1ee6('0x4e')]['id']){delete _0x220295[_0x1ee6('0x4e')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x220295['params']['id']}})[_0x1ee6('0x27')](handleEntityNotFound(_0x171206,null))[_0x1ee6('0x27')](saveUpdates(_0x220295[_0x1ee6('0x4e')],null))[_0x1ee6('0x27')](respondWithResult(_0x171206,null))[_0x1ee6('0x47')](handleError(_0x171206,null));};exports['destroy']=function(_0x27b47e,_0x594612){return db[_0x1ee6('0x2f')][_0x1ee6('0x4c')]({'where':{'id':_0x27b47e[_0x1ee6('0x48')]['id']}})['then'](handleEntityNotFound(_0x594612,null))['then'](removeEntity(_0x594612,null))[_0x1ee6('0x47')](handleError(_0x594612,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 408299f..6835614 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 _0x2034=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items'];(function(_0xaecbe2,_0x594e18){var _0x4dba56=function(_0xd38699){while(--_0xd38699){_0xaecbe2['push'](_0xaecbe2['shift']());}};_0x4dba56(++_0x594e18);}(_0x2034,0x144));var _0x4203=function(_0x10f2c1,_0x166979){_0x10f2c1=_0x10f2c1-0x0;var _0x11715b=_0x2034[_0x10f2c1];return _0x11715b;};'use strict';var _=require(_0x4203('0x0'));var util=require(_0x4203('0x1'));var logger=require(_0x4203('0x2'))('api');var moment=require(_0x4203('0x3'));var BPromise=require('bluebird');var rp=require(_0x4203('0x4'));var fs=require('fs');var path=require(_0x4203('0x5'));var rimraf=require(_0x4203('0x6'));var config=require('../../config/environment');var attributes=require(_0x4203('0x7'));module[_0x4203('0x8')]=function(_0x2207e5,_0x5b679d){return _0x2207e5[_0x4203('0x9')](_0x4203('0xa'),attributes,{'tableName':_0x4203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59d8=['api','moment','bluebird','request-promise','path','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x59d8,0x95));var _0x859d=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x59d8[_0x46800d];return _0x3824cd;};'use strict';var _=require(_0x859d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x859d('0x1'));var moment=require(_0x859d('0x2'));var BPromise=require(_0x859d('0x3'));var rp=require(_0x859d('0x4'));var fs=require('fs');var path=require(_0x859d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x859d('0x6')]=function(_0x41d5d0,_0xeb8264){return _0x41d5d0[_0x859d('0x7')](_0x859d('0x8'),attributes,{'tableName':_0x859d('0x9'),'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 2dad4a6..231b15e 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 _0x19a9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch'];(function(_0x582ad0,_0x189012){var _0x1cc2a6=function(_0x2fe061){while(--_0x2fe061){_0x582ad0['push'](_0x582ad0['shift']());}};_0x1cc2a6(++_0x189012);}(_0x19a9,0xdc));var _0x919a=function(_0x38f5a4,_0x28aff7){_0x38f5a4=_0x38f5a4-0x0;var _0x3bc520=_0x19a9[_0x38f5a4];return _0x3bc520;};'use strict';var _=require(_0x919a('0x0'));var util=require(_0x919a('0x1'));var moment=require(_0x919a('0x2'));var BPromise=require(_0x919a('0x3'));var rs=require(_0x919a('0x4'));var fs=require('fs');var Redis=require(_0x919a('0x5'));var db=require(_0x919a('0x6'))['db'];var utils=require(_0x919a('0x7'));var logger=require(_0x919a('0x8'))('rpc');var config=require(_0x919a('0x9'));var jayson=require(_0x919a('0xa'));var client=jayson['client'][_0x919a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a1674,_0x16e66c,_0x64602f){return new BPromise(function(_0x45e0dc,_0x209f53){return client['request'](_0x4a1674,_0x64602f)[_0x919a('0xc')](function(_0x192ee9){logger[_0x919a('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x16e66c,_0x919a('0xe'));logger[_0x919a('0xf')](_0x919a('0x10'),_0x16e66c,_0x919a('0xe'),JSON['stringify'](_0x192ee9));if(_0x192ee9[_0x919a('0x11')]){if(_0x192ee9[_0x919a('0x11')][_0x919a('0x12')]===0x1f4){logger[_0x919a('0x11')](_0x919a('0x13'),_0x16e66c,_0x192ee9['error'][_0x919a('0x14')]);return _0x209f53(_0x192ee9[_0x919a('0x11')][_0x919a('0x14')]);}logger[_0x919a('0x11')](_0x919a('0x13'),_0x16e66c,_0x192ee9[_0x919a('0x11')][_0x919a('0x14')]);return _0x45e0dc(_0x192ee9[_0x919a('0x11')][_0x919a('0x14')]);}else{logger[_0x919a('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x16e66c,_0x919a('0xe'));_0x45e0dc(_0x192ee9['result'][_0x919a('0x14')]);}})[_0x919a('0x15')](function(_0x4409cb){logger[_0x919a('0x11')](_0x919a('0x13'),_0x16e66c,_0x4409cb);_0x209f53(_0x4409cb);});});} \ No newline at end of file +var _0x85f5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','code','error','CmContactHasItem,\x20%s,\x20%s','message'];(function(_0x1426c1,_0xd60edc){var _0x5881a2=function(_0x41b337){while(--_0x41b337){_0x1426c1['push'](_0x1426c1['shift']());}};_0x5881a2(++_0xd60edc);}(_0x85f5,0x1d0));var _0x585f=function(_0x2cb1df,_0x4b439c){_0x2cb1df=_0x2cb1df-0x0;var _0x30e674=_0x85f5[_0x2cb1df];return _0x30e674;};'use strict';var _=require(_0x585f('0x0'));var util=require('util');var moment=require(_0x585f('0x1'));var BPromise=require(_0x585f('0x2'));var rs=require(_0x585f('0x3'));var fs=require('fs');var Redis=require(_0x585f('0x4'));var db=require(_0x585f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x585f('0x6'));var jayson=require(_0x585f('0x7'));var client=jayson[_0x585f('0x8')][_0x585f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ede3a,_0x22a02b,_0x7345c8){return new BPromise(function(_0x3a6b8e,_0x30c5b7){return client[_0x585f('0xa')](_0x2ede3a,_0x7345c8)['then'](function(_0x71ace5){logger[_0x585f('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x22a02b,_0x585f('0xc'));logger[_0x585f('0xd')](_0x585f('0xe'),_0x22a02b,_0x585f('0xc'),JSON[_0x585f('0xf')](_0x71ace5));if(_0x71ace5['error']){if(_0x71ace5['error'][_0x585f('0x10')]===0x1f4){logger[_0x585f('0x11')](_0x585f('0x12'),_0x22a02b,_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);return _0x30c5b7(_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);}logger[_0x585f('0x11')](_0x585f('0x12'),_0x22a02b,_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);return _0x3a6b8e(_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);}else{logger[_0x585f('0xb')](_0x585f('0x12'),_0x22a02b,_0x585f('0xc'));_0x3a6b8e(_0x71ace5[_0x585f('0x14')][_0x585f('0x13')]);}})[_0x585f('0x15')](function(_0x54160b){logger[_0x585f('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x22a02b,_0x54160b);_0x30c5b7(_0x54160b);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e774d85..17fdfd5 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 _0xc0b1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id','destroy','util','path'];(function(_0x54eb61,_0x54e192){var _0x1c6c04=function(_0x2b2cf4){while(--_0x2b2cf4){_0x54eb61['push'](_0x54eb61['shift']());}};_0x1c6c04(++_0x54e192);}(_0xc0b1,0x1b3));var _0x1c0b=function(_0x3a8d5a,_0xe54840){_0x3a8d5a=_0x3a8d5a-0x0;var _0x308361=_0xc0b1[_0x3a8d5a];return _0x308361;};'use strict';var multer=require('multer');var util=require(_0x1c0b('0x0'));var path=require(_0x1c0b('0x1'));var timeout=require(_0x1c0b('0x2'));var express=require(_0x1c0b('0x3'));var router=express[_0x1c0b('0x4')]();var fs_extra=require(_0x1c0b('0x5'));var auth=require(_0x1c0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1c0b('0x7'));var controller=require(_0x1c0b('0x8'));router[_0x1c0b('0x9')]('/',auth[_0x1c0b('0xa')](),controller[_0x1c0b('0xb')]);router['get']('/:id',auth[_0x1c0b('0xa')](),controller['show']);router[_0x1c0b('0xc')]('/',auth[_0x1c0b('0xa')](),controller[_0x1c0b('0xd')]);router[_0x1c0b('0xe')]('/:id',auth[_0x1c0b('0xa')](),controller[_0x1c0b('0xf')]);router[_0x1c0b('0x10')](_0x1c0b('0x11'),auth[_0x1c0b('0xa')](),controller[_0x1c0b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6f02=['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','./cmContactHasItem.controller','get','/:id'];(function(_0x5f23e5,_0x3a8db7){var _0x32c209=function(_0x4eaa38){while(--_0x4eaa38){_0x5f23e5['push'](_0x5f23e5['shift']());}};_0x32c209(++_0x3a8db7);}(_0x6f02,0xf0));var _0x26f0=function(_0x3e32df,_0x32b6df){_0x3e32df=_0x3e32df-0x0;var _0x5bde2b=_0x6f02[_0x3e32df];return _0x5bde2b;};'use strict';var multer=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var path=require('path');var timeout=require(_0x26f0('0x2'));var express=require(_0x26f0('0x3'));var router=express[_0x26f0('0x4')]();var fs_extra=require(_0x26f0('0x5'));var auth=require(_0x26f0('0x6'));var interaction=require(_0x26f0('0x7'));var config=require(_0x26f0('0x8'));var controller=require(_0x26f0('0x9'));router[_0x26f0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x26f0('0xa')](_0x26f0('0xb'),auth[_0x26f0('0xc')](),controller[_0x26f0('0xd')]);router[_0x26f0('0xe')]('/',auth['isAuthenticated'](),controller[_0x26f0('0xf')]);router[_0x26f0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x26f0('0x11')]);router[_0x26f0('0x12')](_0x26f0('0xb'),auth[_0x26f0('0xc')](),controller[_0x26f0('0x13')]);module[_0x26f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4fdd03d..056d81b 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 _0x9a08=['VIRTUAL','getDataValue','alias','STRING','setDataValue','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports'];(function(_0x1b3a71,_0x689013){var _0x4f73c6=function(_0x591129){while(--_0x591129){_0x1b3a71['push'](_0x1b3a71['shift']());}};_0x4f73c6(++_0x689013);}(_0x9a08,0x152));var _0x89a0=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0x9a08[_0x3e8930];return _0x15b38f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x89a0('0x0'));module[_0x89a0('0x1')]={'name':{'type':Sequelize[_0x89a0('0x2')],'get':function(_0x121100){return this[_0x89a0('0x3')](_0x89a0('0x4'));}},'alias':{'type':Sequelize[_0x89a0('0x5')],'allowNull':![],'set':function(_0x56ca5c){this[_0x89a0('0x6')](_0x89a0('0x4'),_0x56ca5c?_0x56ca5c:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x89a0('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x89a0('0x7')),'get':function(){if(this[_0x89a0('0x3')](_0x89a0('0x8'))===_0x89a0('0x9')){return JSON[_0x89a0('0xa')](this['getDataValue']('values'));}else{return this[_0x89a0('0x3')](_0x89a0('0xb'));}},'set':function(_0x342118){if(Array[_0x89a0('0xc')](_0x342118)){this[_0x89a0('0x6')](_0x89a0('0xb'),JSON[_0x89a0('0xd')](_0x342118));}else{this[_0x89a0('0x6')](_0x89a0('0xb'),_0x342118);}}},'required':{'type':Sequelize[_0x89a0('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x89a0('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x89a0('0xf')](_0x89a0('0x10'))}}; \ No newline at end of file +var _0xf532=['TEXT','long','type','select','parse','isArray','setDataValue','values','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','name','STRING'];(function(_0x4af8a5,_0x235b51){var _0x2f73a0=function(_0x62bae6){while(--_0x62bae6){_0x4af8a5['push'](_0x4af8a5['shift']());}};_0x2f73a0(++_0x235b51);}(_0xf532,0x11b));var _0x2f53=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf532[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x2f53('0x0'));var _=require(_0x2f53('0x1'));module[_0x2f53('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17e805){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x15c78b){this['setDataValue']('alias',_0x15c78b?_0x15c78b:this[_0x2f53('0x3')](_0x2f53('0x4')));}},'type':{'type':Sequelize[_0x2f53('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x2f53('0x6')](_0x2f53('0x7')),'get':function(){if(this['getDataValue'](_0x2f53('0x8'))===_0x2f53('0x9')){return JSON[_0x2f53('0xa')](this[_0x2f53('0x3')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x1bbe0b){if(Array[_0x2f53('0xb')](_0x1bbe0b)){this[_0x2f53('0xc')](_0x2f53('0xd'),JSON[_0x2f53('0xe')](_0x1bbe0b));}else{this[_0x2f53('0xc')](_0x2f53('0xd'),_0x1bbe0b);}}},'required':{'type':Sequelize[_0x2f53('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2f53('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 0bc3f4a..95ef77c 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 _0xf0d3=['options','includeAll','include','rows','params','rawAttributes','catch','body','find','create','transaction','TEXT','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','map','CmCustomField','fieldName','type','differenceBy','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge'];(function(_0x300385,_0x31b65){var _0x442f17=function(_0x2ce7d5){while(--_0x2ce7d5){_0x300385['push'](_0x300385['shift']());}};_0x442f17(++_0x31b65);}(_0xf0d3,0x108));var _0x3f0d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0d3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3f0d('0x0'));var rimraf=require(_0x3f0d('0x1'));var zipdir=require(_0x3f0d('0x2'));var jsonpatch=require(_0x3f0d('0x3'));var rp=require(_0x3f0d('0x4'));var moment=require(_0x3f0d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3f0d('0x6'));var util=require('util');var path=require(_0x3f0d('0x7'));var sox=require(_0x3f0d('0x8'));var csv=require(_0x3f0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f0d('0xa'));var _=require(_0x3f0d('0xb'));var squel=require(_0x3f0d('0xc'));var crypto=require(_0x3f0d('0xd'));var jsforce=require(_0x3f0d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3f0d('0x9'));var querystring=require('querystring');var Papa=require(_0x3f0d('0xf'));var Redis=require(_0x3f0d('0x10'));var authService=require(_0x3f0d('0x11'));var qs=require(_0x3f0d('0x12'));var as=require(_0x3f0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f0d('0x14'))(_0x3f0d('0x15'));var utils=require(_0x3f0d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3f0d('0x17'))['db'];function respondWithStatusCode(_0x8bdafb,_0x55ba33){_0x55ba33=_0x55ba33||0xcc;return function(_0x1feec4){if(_0x1feec4){return _0x8bdafb[_0x3f0d('0x18')](_0x55ba33);}return _0x8bdafb[_0x3f0d('0x19')](_0x55ba33)[_0x3f0d('0x1a')]();};}function respondWithResult(_0x4fe89c,_0x1d48d3){_0x1d48d3=_0x1d48d3||0xc8;return function(_0x335b5f){if(_0x335b5f){return _0x4fe89c[_0x3f0d('0x19')](_0x1d48d3)[_0x3f0d('0x1b')](_0x335b5f);}};}function respondWithFilteredResult(_0x4c17cc,_0x4300c1){return function(_0x29b1e2){if(_0x29b1e2){var _0x1bf7ee=typeof _0x4300c1[_0x3f0d('0x1c')]===_0x3f0d('0x1d')&&typeof _0x4300c1[_0x3f0d('0x1e')]===_0x3f0d('0x1d');var _0x3fcdb1=_0x29b1e2[_0x3f0d('0x1f')];var _0x1f5e70=_0x1bf7ee?0x0:_0x4300c1['offset'];var _0x565b9d=_0x1bf7ee?_0x29b1e2[_0x3f0d('0x1f')]:_0x4300c1[_0x3f0d('0x1c')]+_0x4300c1['limit'];var _0x5c5d50;if(_0x565b9d>=_0x3fcdb1){_0x565b9d=_0x3fcdb1;_0x5c5d50=0xc8;}else{_0x5c5d50=0xce;}_0x4c17cc[_0x3f0d('0x19')](_0x5c5d50);return _0x4c17cc['set']('Content-Range',_0x1f5e70+'-'+_0x565b9d+'/'+_0x3fcdb1)[_0x3f0d('0x1b')](_0x29b1e2);}return null;};}function patchUpdates(_0x3d1e40){return function(_0x313e21){try{jsonpatch[_0x3f0d('0x20')](_0x313e21,_0x3d1e40,!![]);}catch(_0x160fc0){return BPromise[_0x3f0d('0x21')](_0x160fc0);}return _0x313e21[_0x3f0d('0x22')]();};}function saveUpdates(_0x1ba7df,_0x3b315a){return function(_0x3f984e){if(_0x3f984e){return _0x3f984e[_0x3f0d('0x23')](_0x1ba7df)['then'](function(_0x559e0d){return _0x559e0d;});}return null;};}function removeEntity(_0x5230a7,_0x5886c1){return function(_0x21892f){if(_0x21892f){return _0x21892f[_0x3f0d('0x24')]()[_0x3f0d('0x25')](function(){_0x5230a7[_0x3f0d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x345c94,_0x4209c1){return function(_0x5419ce){if(!_0x5419ce){_0x345c94[_0x3f0d('0x18')](0x194);}return _0x5419ce;};}function handleError(_0x33ff74,_0xfd2c70){_0xfd2c70=_0xfd2c70||0x1f4;return function(_0x1bf365){logger[_0x3f0d('0x26')](_0x1bf365[_0x3f0d('0x27')]);if(_0x1bf365['name']){delete _0x1bf365[_0x3f0d('0x28')];}_0x33ff74['status'](_0xfd2c70)['send'](_0x1bf365);};}exports[_0x3f0d('0x29')]=function(_0x5800d6,_0x15b82e){var _0x487b04={},_0x2678f3={},_0x255a80={'count':0x0,'rows':[]};var _0x47d340=_[_0x3f0d('0x2a')](db[_0x3f0d('0x2b')]['rawAttributes'],function(_0x1218d7){return{'name':_0x1218d7[_0x3f0d('0x2c')],'type':_0x1218d7[_0x3f0d('0x2d')]['key']};});_0x2678f3['model']=_[_0x3f0d('0x2e')](_['map'](_0x47d340,_0x3f0d('0x28')),[_0x3f0d('0x28')]);_0x2678f3[_0x3f0d('0x2f')]=_[_0x3f0d('0x30')](_0x5800d6[_0x3f0d('0x2f')]);_0x2678f3[_0x3f0d('0x31')]=_['intersection'](_0x2678f3[_0x3f0d('0x32')],_0x2678f3['query']);_0x487b04[_0x3f0d('0x33')]=_[_0x3f0d('0x34')](_0x2678f3[_0x3f0d('0x32')],qs[_0x3f0d('0x35')](_0x5800d6[_0x3f0d('0x2f')][_0x3f0d('0x35')]));_0x487b04[_0x3f0d('0x33')]=_0x487b04[_0x3f0d('0x33')][_0x3f0d('0x36')]?_0x487b04[_0x3f0d('0x33')]:_0x2678f3[_0x3f0d('0x32')];if(!_0x5800d6[_0x3f0d('0x2f')][_0x3f0d('0x37')]('nolimit')){_0x487b04[_0x3f0d('0x1e')]=qs[_0x3f0d('0x1e')](_0x5800d6[_0x3f0d('0x2f')]['limit']);_0x487b04[_0x3f0d('0x1c')]=qs[_0x3f0d('0x1c')](_0x5800d6[_0x3f0d('0x2f')][_0x3f0d('0x1c')]);}_0x487b04['order']=qs['sort'](_0x5800d6['query'][_0x3f0d('0x38')]);_0x487b04[_0x3f0d('0x39')]=qs[_0x3f0d('0x31')](_['pick'](_0x5800d6[_0x3f0d('0x2f')],_0x2678f3[_0x3f0d('0x31')]),_0x47d340);if(_0x5800d6[_0x3f0d('0x2f')][_0x3f0d('0x3a')]){_0x487b04['where']=_[_0x3f0d('0x3b')](_0x487b04[_0x3f0d('0x39')],{'$or':_[_0x3f0d('0x2a')](_0x47d340,function(_0x5138e5){if(_0x5138e5['type']!=='VIRTUAL'){var _0x1b6420={};_0x1b6420[_0x5138e5[_0x3f0d('0x28')]]={'$like':'%'+_0x5800d6['query'][_0x3f0d('0x3a')]+'%'};return _0x1b6420;}})});}_0x487b04=_['merge']({},_0x487b04,_0x5800d6[_0x3f0d('0x3c')]);var _0x1e63e1={'where':_0x487b04[_0x3f0d('0x39')]};return db['CmCustomField'][_0x3f0d('0x1f')](_0x1e63e1)[_0x3f0d('0x25')](function(_0x54d967){_0x255a80[_0x3f0d('0x1f')]=_0x54d967;if(_0x5800d6['query'][_0x3f0d('0x3d')]){_0x487b04[_0x3f0d('0x3e')]=[{'all':!![]}];}return db[_0x3f0d('0x2b')]['findAll'](_0x487b04);})['then'](function(_0x3179a3){_0x255a80[_0x3f0d('0x3f')]=_0x3179a3;return _0x255a80;})[_0x3f0d('0x25')](respondWithFilteredResult(_0x15b82e,_0x487b04))['catch'](handleError(_0x15b82e,null));};exports['show']=function(_0xc7f4b3,_0x337f49){var _0x449c8d={'raw':!![],'where':{'id':_0xc7f4b3[_0x3f0d('0x40')]['id']}},_0x3057ab={};_0x3057ab[_0x3f0d('0x32')]=_[_0x3f0d('0x30')](db[_0x3f0d('0x2b')][_0x3f0d('0x41')]);_0x3057ab[_0x3f0d('0x2f')]=_['keys'](_0xc7f4b3[_0x3f0d('0x2f')]);_0x3057ab['filters']=_['intersection'](_0x3057ab['model'],_0x3057ab['query']);_0x449c8d['attributes']=_[_0x3f0d('0x34')](_0x3057ab[_0x3f0d('0x32')],qs[_0x3f0d('0x35')](_0xc7f4b3[_0x3f0d('0x2f')]['fields']));_0x449c8d[_0x3f0d('0x33')]=_0x449c8d[_0x3f0d('0x33')][_0x3f0d('0x36')]?_0x449c8d['attributes']:_0x3057ab['model'];if(_0xc7f4b3[_0x3f0d('0x2f')]['includeAll']){_0x449c8d[_0x3f0d('0x3e')]=[{'all':!![]}];}_0x449c8d=_[_0x3f0d('0x3b')]({},_0x449c8d,_0xc7f4b3[_0x3f0d('0x3c')]);return db[_0x3f0d('0x2b')]['find'](_0x449c8d)[_0x3f0d('0x25')](handleEntityNotFound(_0x337f49,null))[_0x3f0d('0x25')](respondWithResult(_0x337f49,null))[_0x3f0d('0x42')](handleError(_0x337f49,null));};exports[_0x3f0d('0x23')]=function(_0xef21e4,_0x3cdd14){if(_0xef21e4[_0x3f0d('0x43')]['id']){delete _0xef21e4[_0x3f0d('0x43')]['id'];}return db[_0x3f0d('0x2b')][_0x3f0d('0x44')]({'where':{'id':_0xef21e4[_0x3f0d('0x40')]['id']}})[_0x3f0d('0x25')](handleEntityNotFound(_0x3cdd14,null))[_0x3f0d('0x25')](saveUpdates(_0xef21e4[_0x3f0d('0x43')],null))[_0x3f0d('0x25')](respondWithResult(_0x3cdd14,null))[_0x3f0d('0x42')](handleError(_0x3cdd14,null));};exports['destroy']=function(_0x484ff0,_0x128e85){return db['CmCustomField'][_0x3f0d('0x44')]({'where':{'id':_0x484ff0['params']['id']}})[_0x3f0d('0x25')](handleEntityNotFound(_0x128e85,null))[_0x3f0d('0x25')](removeEntity(_0x128e85,null))[_0x3f0d('0x42')](handleError(_0x128e85,null));};exports[_0x3f0d('0x45')]=function(_0x44fd33,_0x4f469c){var _0x38a2d7;return db['sequelize'][_0x3f0d('0x46')](function(_0x4a5e8a){return db[_0x3f0d('0x2b')]['create'](_0x44fd33[_0x3f0d('0x43')],{'transaction':_0x4a5e8a})[_0x3f0d('0x25')](function(_0x45c841){_0x38a2d7=_0x45c841;var _0x23c908={'type':db['Sequelize'][_0x3f0d('0x47')],'transaction':_0x4a5e8a};switch(_0x44fd33['body']['type']){case'text':_0x23c908[_0x3f0d('0x2d')]=db[_0x3f0d('0x48')]['TEXT'];break;case _0x3f0d('0x49'):_0x23c908[_0x3f0d('0x2d')]=db[_0x3f0d('0x48')]['INTEGER'];break;case _0x3f0d('0x4a'):_0x23c908[_0x3f0d('0x2d')]=db[_0x3f0d('0x48')][_0x3f0d('0x4b')];_0x23c908[_0x3f0d('0x4c')]=![];break;default:}return db['sequelize'][_0x3f0d('0x4d')][_0x3f0d('0x4e')]('cm_contacts',util[_0x3f0d('0x4f')](_0x3f0d('0x50'),_0x38a2d7['id']),_0x23c908);})[_0x3f0d('0x25')](function(){return _0x38a2d7;});})[_0x3f0d('0x25')](respondWithResult(_0x4f469c,0xc9))[_0x3f0d('0x42')](handleError(_0x4f469c,null));}; \ No newline at end of file +var _0x6fd8=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','fields','options','update','body','find','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x6fd8,0x9d));var _0x86fd=function(_0x108bfc,_0x3b635a){_0x108bfc=_0x108bfc-0x0;var _0x12ca03=_0x6fd8[_0x108bfc];return _0x12ca03;};'use strict';var emlformat=require(_0x86fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86fd('0x2'));var BPromise=require(_0x86fd('0x3'));var Mustache=require(_0x86fd('0x4'));var util=require(_0x86fd('0x5'));var path=require(_0x86fd('0x6'));var sox=require('sox');var csv=require(_0x86fd('0x7'));var ejs=require(_0x86fd('0x8'));var fs=require('fs');var fs_extra=require(_0x86fd('0x9'));var _=require('lodash');var squel=require(_0x86fd('0xa'));var crypto=require(_0x86fd('0xb'));var jsforce=require(_0x86fd('0xc'));var deskjs=require(_0x86fd('0xd'));var toCsv=require(_0x86fd('0x7'));var querystring=require(_0x86fd('0xe'));var Papa=require(_0x86fd('0xf'));var Redis=require(_0x86fd('0x10'));var authService=require(_0x86fd('0x11'));var qs=require(_0x86fd('0x12'));var as=require(_0x86fd('0x13'));var hardwareService=require(_0x86fd('0x14'));var logger=require(_0x86fd('0x15'))(_0x86fd('0x16'));var utils=require(_0x86fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x86fd('0x18'));var db=require(_0x86fd('0x19'))['db'];function respondWithStatusCode(_0x3cf119,_0x311e9c){_0x311e9c=_0x311e9c||0xcc;return function(_0x2a71dd){if(_0x2a71dd){return _0x3cf119['sendStatus'](_0x311e9c);}return _0x3cf119[_0x86fd('0x1a')](_0x311e9c)[_0x86fd('0x1b')]();};}function respondWithResult(_0x47c810,_0x2b3410){_0x2b3410=_0x2b3410||0xc8;return function(_0x37dc47){if(_0x37dc47){return _0x47c810[_0x86fd('0x1a')](_0x2b3410)[_0x86fd('0x1c')](_0x37dc47);}};}function respondWithFilteredResult(_0x3d3723,_0x5ee684){return function(_0x3b99c0){if(_0x3b99c0){var _0x1b7e90=typeof _0x5ee684[_0x86fd('0x1d')]===_0x86fd('0x1e')&&typeof _0x5ee684[_0x86fd('0x1f')]===_0x86fd('0x1e');var _0x474ef3=_0x3b99c0['count'];var _0x28a832=_0x1b7e90?0x0:_0x5ee684[_0x86fd('0x1d')];var _0xc591eb=_0x1b7e90?_0x3b99c0[_0x86fd('0x20')]:_0x5ee684[_0x86fd('0x1d')]+_0x5ee684[_0x86fd('0x1f')];var _0x2898f1;if(_0xc591eb>=_0x474ef3){_0xc591eb=_0x474ef3;_0x2898f1=0xc8;}else{_0x2898f1=0xce;}_0x3d3723[_0x86fd('0x1a')](_0x2898f1);return _0x3d3723['set'](_0x86fd('0x21'),_0x28a832+'-'+_0xc591eb+'/'+_0x474ef3)[_0x86fd('0x1c')](_0x3b99c0);}return null;};}function patchUpdates(_0xa7d2dd){return function(_0x5a94ea){try{jsonpatch[_0x86fd('0x22')](_0x5a94ea,_0xa7d2dd,!![]);}catch(_0x441c51){return BPromise[_0x86fd('0x23')](_0x441c51);}return _0x5a94ea[_0x86fd('0x24')]();};}function saveUpdates(_0x1f6dba,_0x1b3cfd){return function(_0x3d37b7){if(_0x3d37b7){return _0x3d37b7['update'](_0x1f6dba)['then'](function(_0x376645){return _0x376645;});}return null;};}function removeEntity(_0x5455c3,_0x1bfdcb){return function(_0x38cd33){if(_0x38cd33){return _0x38cd33['destroy']()[_0x86fd('0x25')](function(){_0x5455c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x390d83,_0x70dbdf){return function(_0x2d9d4d){if(!_0x2d9d4d){_0x390d83[_0x86fd('0x26')](0x194);}return _0x2d9d4d;};}function handleError(_0x450353,_0x130ee3){_0x130ee3=_0x130ee3||0x1f4;return function(_0x4097bc){logger['error'](_0x4097bc[_0x86fd('0x27')]);if(_0x4097bc[_0x86fd('0x28')]){delete _0x4097bc[_0x86fd('0x28')];}_0x450353[_0x86fd('0x1a')](_0x130ee3)[_0x86fd('0x29')](_0x4097bc);};}exports[_0x86fd('0x2a')]=function(_0x40bba9,_0x3124de){var _0x1d5452={},_0xa4bba={},_0x3740ae={'count':0x0,'rows':[]};var _0x51194f=_[_0x86fd('0x2b')](db[_0x86fd('0x2c')][_0x86fd('0x2d')],function(_0x4d6288){return{'name':_0x4d6288[_0x86fd('0x2e')],'type':_0x4d6288[_0x86fd('0x2f')][_0x86fd('0x30')]};});_0xa4bba[_0x86fd('0x31')]=_[_0x86fd('0x32')](_[_0x86fd('0x2b')](_0x51194f,_0x86fd('0x28')),[_0x86fd('0x28')]);_0xa4bba['query']=_['keys'](_0x40bba9[_0x86fd('0x33')]);_0xa4bba[_0x86fd('0x34')]=_[_0x86fd('0x35')](_0xa4bba[_0x86fd('0x31')],_0xa4bba['query']);_0x1d5452['attributes']=_['intersection'](_0xa4bba[_0x86fd('0x31')],qs['fields'](_0x40bba9[_0x86fd('0x33')]['fields']));_0x1d5452['attributes']=_0x1d5452['attributes'][_0x86fd('0x36')]?_0x1d5452[_0x86fd('0x37')]:_0xa4bba['model'];if(!_0x40bba9[_0x86fd('0x33')][_0x86fd('0x38')]('nolimit')){_0x1d5452[_0x86fd('0x1f')]=qs[_0x86fd('0x1f')](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x1f')]);_0x1d5452[_0x86fd('0x1d')]=qs[_0x86fd('0x1d')](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x1d')]);}_0x1d5452[_0x86fd('0x39')]=qs['sort'](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x3a')]);_0x1d5452[_0x86fd('0x3b')]=qs['filters'](_['pick'](_0x40bba9[_0x86fd('0x33')],_0xa4bba[_0x86fd('0x34')]),_0x51194f);if(_0x40bba9[_0x86fd('0x33')][_0x86fd('0x3c')]){_0x1d5452['where']=_[_0x86fd('0x3d')](_0x1d5452['where'],{'$or':_[_0x86fd('0x2b')](_0x51194f,function(_0x3a4b86){if(_0x3a4b86[_0x86fd('0x2f')]!==_0x86fd('0x3e')){var _0x285f58={};_0x285f58[_0x3a4b86[_0x86fd('0x28')]]={'$like':'%'+_0x40bba9['query'][_0x86fd('0x3c')]+'%'};return _0x285f58;}})});}_0x1d5452=_[_0x86fd('0x3d')]({},_0x1d5452,_0x40bba9['options']);var _0x3e7453={'where':_0x1d5452[_0x86fd('0x3b')]};return db['CmCustomField'][_0x86fd('0x20')](_0x3e7453)[_0x86fd('0x25')](function(_0x509b39){_0x3740ae['count']=_0x509b39;if(_0x40bba9['query'][_0x86fd('0x3f')]){_0x1d5452[_0x86fd('0x40')]=[{'all':!![]}];}return db[_0x86fd('0x2c')]['findAll'](_0x1d5452);})['then'](function(_0x231572){_0x3740ae[_0x86fd('0x41')]=_0x231572;return _0x3740ae;})[_0x86fd('0x25')](respondWithFilteredResult(_0x3124de,_0x1d5452))[_0x86fd('0x42')](handleError(_0x3124de,null));};exports[_0x86fd('0x43')]=function(_0x5d9018,_0x405fc1){var _0x42673f={'raw':!![],'where':{'id':_0x5d9018['params']['id']}},_0x98aacb={};_0x98aacb['model']=_[_0x86fd('0x44')](db[_0x86fd('0x2c')]['rawAttributes']);_0x98aacb['query']=_[_0x86fd('0x44')](_0x5d9018[_0x86fd('0x33')]);_0x98aacb[_0x86fd('0x34')]=_[_0x86fd('0x35')](_0x98aacb[_0x86fd('0x31')],_0x98aacb['query']);_0x42673f[_0x86fd('0x37')]=_['intersection'](_0x98aacb['model'],qs[_0x86fd('0x45')](_0x5d9018[_0x86fd('0x33')][_0x86fd('0x45')]));_0x42673f[_0x86fd('0x37')]=_0x42673f[_0x86fd('0x37')][_0x86fd('0x36')]?_0x42673f['attributes']:_0x98aacb[_0x86fd('0x31')];if(_0x5d9018[_0x86fd('0x33')]['includeAll']){_0x42673f[_0x86fd('0x40')]=[{'all':!![]}];}_0x42673f=_['merge']({},_0x42673f,_0x5d9018[_0x86fd('0x46')]);return db[_0x86fd('0x2c')]['find'](_0x42673f)[_0x86fd('0x25')](handleEntityNotFound(_0x405fc1,null))[_0x86fd('0x25')](respondWithResult(_0x405fc1,null))[_0x86fd('0x42')](handleError(_0x405fc1,null));};exports[_0x86fd('0x47')]=function(_0x12afb1,_0x1f8461){if(_0x12afb1[_0x86fd('0x48')]['id']){delete _0x12afb1['body']['id'];}return db[_0x86fd('0x2c')][_0x86fd('0x49')]({'where':{'id':_0x12afb1[_0x86fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f8461,null))['then'](saveUpdates(_0x12afb1[_0x86fd('0x48')],null))[_0x86fd('0x25')](respondWithResult(_0x1f8461,null))[_0x86fd('0x42')](handleError(_0x1f8461,null));};exports['destroy']=function(_0x2550d8,_0x161025){return db[_0x86fd('0x2c')]['find']({'where':{'id':_0x2550d8['params']['id']}})[_0x86fd('0x25')](handleEntityNotFound(_0x161025,null))[_0x86fd('0x25')](removeEntity(_0x161025,null))[_0x86fd('0x42')](handleError(_0x161025,null));};exports[_0x86fd('0x4b')]=function(_0x254aac,_0x4d4497){var _0x352c5a;return db[_0x86fd('0x4c')][_0x86fd('0x4d')](function(_0x27e25b){return db[_0x86fd('0x2c')][_0x86fd('0x4b')](_0x254aac['body'],{'transaction':_0x27e25b})[_0x86fd('0x25')](function(_0x1202db){_0x352c5a=_0x1202db;var _0x448909={'type':db[_0x86fd('0x4e')][_0x86fd('0x4f')],'transaction':_0x27e25b};switch(_0x254aac['body'][_0x86fd('0x2f')]){case _0x86fd('0x50'):_0x448909[_0x86fd('0x2f')]=db['Sequelize'][_0x86fd('0x4f')];break;case _0x86fd('0x51'):_0x448909['type']=db[_0x86fd('0x4e')][_0x86fd('0x52')];break;case'switch':_0x448909[_0x86fd('0x2f')]=db[_0x86fd('0x4e')][_0x86fd('0x53')];_0x448909[_0x86fd('0x54')]=![];break;default:}return db['sequelize'][_0x86fd('0x55')][_0x86fd('0x56')](_0x86fd('0x57'),util['format'](_0x86fd('0x58'),_0x352c5a['id']),_0x448909);})[_0x86fd('0x25')](function(){return _0x352c5a;});})[_0x86fd('0x25')](respondWithResult(_0x4d4497,0xc9))[_0x86fd('0x42')](handleError(_0x4d4497,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8b3eff1..329c600 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 _0x8938=['moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','../../config/logger','api'];(function(_0x4893d5,_0x51c956){var _0x501fa7=function(_0x4a9f18){while(--_0x4a9f18){_0x4893d5['push'](_0x4893d5['shift']());}};_0x501fa7(++_0x51c956);}(_0x8938,0x1e2));var _0x8893=function(_0x546895,_0xb414da){_0x546895=_0x546895-0x0;var _0x3b5a09=_0x8938[_0x546895];return _0x3b5a09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8893('0x0'))(_0x8893('0x1'));var moment=require(_0x8893('0x2'));var BPromise=require(_0x8893('0x3'));var rp=require(_0x8893('0x4'));var fs=require('fs');var path=require(_0x8893('0x5'));var rimraf=require('rimraf');var config=require(_0x8893('0x6'));var attributes=require(_0x8893('0x7'));module['exports']=function(_0x49da7d,_0x202df0){return _0x49da7d[_0x8893('0x8')](_0x8893('0x9'),attributes,{'tableName':_0x8893('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5311=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4054e7,_0xe59978){var _0x30f9d7=function(_0x1603b3){while(--_0x1603b3){_0x4054e7['push'](_0x4054e7['shift']());}};_0x30f9d7(++_0xe59978);}(_0x5311,0xd0));var _0x1531=function(_0x50ca8b,_0x8e7428){_0x50ca8b=_0x50ca8b-0x0;var _0x43bc78=_0x5311[_0x50ca8b];return _0x43bc78;};'use strict';var _=require(_0x1531('0x0'));var util=require('util');var logger=require(_0x1531('0x1'))('api');var moment=require(_0x1531('0x2'));var BPromise=require(_0x1531('0x3'));var rp=require(_0x1531('0x4'));var fs=require('fs');var path=require(_0x1531('0x5'));var rimraf=require(_0x1531('0x6'));var config=require(_0x1531('0x7'));var attributes=require(_0x1531('0x8'));module[_0x1531('0x9')]=function(_0x52e613,_0x20b505){return _0x52e613[_0x1531('0xa')]('CmCustomField',attributes,{'tableName':_0x1531('0xb'),'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 534e6bd..cd543a5 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 _0xbddc=['request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','jayson/promise','client','http'];(function(_0x2a42cf,_0x4020ac){var _0x5af7fd=function(_0x38e874){while(--_0x38e874){_0x2a42cf['push'](_0x2a42cf['shift']());}};_0x5af7fd(++_0x4020ac);}(_0xbddc,0x14e));var _0xcbdd=function(_0x293970,_0x1dd47b){_0x293970=_0x293970-0x0;var _0x5d206f=_0xbddc[_0x293970];return _0x5d206f;};'use strict';var _=require('lodash');var util=require(_0xcbdd('0x0'));var moment=require(_0xcbdd('0x1'));var BPromise=require('bluebird');var rs=require(_0xcbdd('0x2'));var fs=require('fs');var Redis=require(_0xcbdd('0x3'));var db=require(_0xcbdd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbdd('0x5'));var client=jayson[_0xcbdd('0x6')][_0xcbdd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x922016,_0xfad2d7,_0x58588b){return new BPromise(function(_0x28f8a6,_0x19afd2){return client[_0xcbdd('0x8')](_0x922016,_0x58588b)[_0xcbdd('0x9')](function(_0x373d51){logger[_0xcbdd('0xa')](_0xcbdd('0xb'),_0xfad2d7,'request\x20sent');logger[_0xcbdd('0xc')](_0xcbdd('0xd'),_0xfad2d7,_0xcbdd('0xe'),JSON[_0xcbdd('0xf')](_0x373d51));if(_0x373d51[_0xcbdd('0x10')]){if(_0x373d51['error']['code']===0x1f4){logger['error'](_0xcbdd('0xb'),_0xfad2d7,_0x373d51[_0xcbdd('0x10')][_0xcbdd('0x11')]);return _0x19afd2(_0x373d51[_0xcbdd('0x10')][_0xcbdd('0x11')]);}logger[_0xcbdd('0x10')](_0xcbdd('0xb'),_0xfad2d7,_0x373d51[_0xcbdd('0x10')][_0xcbdd('0x11')]);return _0x28f8a6(_0x373d51['error'][_0xcbdd('0x11')]);}else{logger['info'](_0xcbdd('0xb'),_0xfad2d7,'request\x20sent');_0x28f8a6(_0x373d51[_0xcbdd('0x12')][_0xcbdd('0x11')]);}})['catch'](function(_0x503d4c){logger[_0xcbdd('0x10')](_0xcbdd('0xb'),_0xfad2d7,_0x503d4c);_0x19afd2(_0x503d4c);});});} \ No newline at end of file +var _0x19ab=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x460114,_0x3f7aba){var _0x3c681f=function(_0x49a168){while(--_0x49a168){_0x460114['push'](_0x460114['shift']());}};_0x3c681f(++_0x3f7aba);}(_0x19ab,0x74));var _0xb19a=function(_0x12796b,_0xceeb0a){_0x12796b=_0x12796b-0x0;var _0x396fd3=_0x19ab[_0x12796b];return _0x396fd3;};'use strict';var _=require(_0xb19a('0x0'));var util=require(_0xb19a('0x1'));var moment=require(_0xb19a('0x2'));var BPromise=require(_0xb19a('0x3'));var rs=require(_0xb19a('0x4'));var fs=require('fs');var Redis=require(_0xb19a('0x5'));var db=require(_0xb19a('0x6'))['db'];var utils=require(_0xb19a('0x7'));var logger=require(_0xb19a('0x8'))(_0xb19a('0x9'));var config=require(_0xb19a('0xa'));var jayson=require(_0xb19a('0xb'));var client=jayson[_0xb19a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44915e,_0x34f725,_0x298a3b){return new BPromise(function(_0x445b35,_0x29b67c){return client[_0xb19a('0xd')](_0x44915e,_0x298a3b)[_0xb19a('0xe')](function(_0x32fe92){logger[_0xb19a('0xf')](_0xb19a('0x10'),_0x34f725,_0xb19a('0x11'));logger[_0xb19a('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x34f725,_0xb19a('0x11'),JSON[_0xb19a('0x13')](_0x32fe92));if(_0x32fe92['error']){if(_0x32fe92[_0xb19a('0x14')]['code']===0x1f4){logger[_0xb19a('0x14')]('CmCustomField,\x20%s,\x20%s',_0x34f725,_0x32fe92['error']['message']);return _0x29b67c(_0x32fe92[_0xb19a('0x14')][_0xb19a('0x15')]);}logger[_0xb19a('0x14')]('CmCustomField,\x20%s,\x20%s',_0x34f725,_0x32fe92['error']['message']);return _0x445b35(_0x32fe92[_0xb19a('0x14')][_0xb19a('0x15')]);}else{logger[_0xb19a('0xf')](_0xb19a('0x10'),_0x34f725,_0xb19a('0x11'));_0x445b35(_0x32fe92[_0xb19a('0x16')][_0xb19a('0x15')]);}})[_0xb19a('0x17')](function(_0x3f57ff){logger[_0xb19a('0x14')](_0xb19a('0x10'),_0x34f725,_0x3f57ff);_0x29b67c(_0x3f57ff);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3875624..b78fbeb 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 _0xd051=['index','/:id','show','post','create','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x45310c,_0x106a46){var _0x5e941f=function(_0x17f122){while(--_0x17f122){_0x45310c['push'](_0x45310c['shift']());}};_0x5e941f(++_0x106a46);}(_0xd051,0xc5));var _0x1d05=function(_0x16f026,_0x2baae7){_0x16f026=_0x16f026-0x0;var _0x380606=_0xd051[_0x16f026];return _0x380606;};'use strict';var multer=require(_0x1d05('0x0'));var util=require(_0x1d05('0x1'));var path=require(_0x1d05('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d05('0x3'));var router=express[_0x1d05('0x4')]();var fs_extra=require(_0x1d05('0x5'));var auth=require(_0x1d05('0x6'));var interaction=require(_0x1d05('0x7'));var config=require(_0x1d05('0x8'));var controller=require(_0x1d05('0x9'));router[_0x1d05('0xa')]('/',auth[_0x1d05('0xb')](),controller[_0x1d05('0xc')]);router[_0x1d05('0xa')](_0x1d05('0xd'),auth[_0x1d05('0xb')](),controller[_0x1d05('0xe')]);router[_0x1d05('0xf')]('/',auth[_0x1d05('0xb')](),controller[_0x1d05('0x10')]);router['put']('/:id',auth[_0x1d05('0xb')](),controller['update']);router[_0x1d05('0x11')](_0x1d05('0xd'),auth['isAuthenticated'](),controller[_0x1d05('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf849=['fs-extra','./cmCustomField.controller','index','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x98ee08,_0x53bbb0){var _0x2b9401=function(_0x3d3f21){while(--_0x3d3f21){_0x98ee08['push'](_0x98ee08['shift']());}};_0x2b9401(++_0x53bbb0);}(_0xf849,0x193));var _0x9f84=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xf849[_0x422be2];return _0x1b820e;};'use strict';var multer=require(_0x9f84('0x0'));var util=require(_0x9f84('0x1'));var path=require(_0x9f84('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f84('0x3'));var router=express[_0x9f84('0x4')]();var fs_extra=require(_0x9f84('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f84('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f84('0x7')]);router['get']('/:id',auth[_0x9f84('0x8')](),controller['show']);router[_0x9f84('0x9')]('/',auth[_0x9f84('0x8')](),controller[_0x9f84('0xa')]);router[_0x9f84('0xb')](_0x9f84('0xc'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xd')]);router[_0x9f84('0xe')](_0x9f84('0xc'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xf')]);module[_0x9f84('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 6d1cc17..7e4935b 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 _0xb368=['format','YYYY-MM-DD\x20HH:mm:ss','BOOLEAN','INTEGER','contactListQueue','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb368,0x135));var _0x8b36=function(_0x2132da,_0x3d5ce4){_0x2132da=_0x2132da-0x0;var _0x8ac12c=_0xb368[_0x2132da];return _0x8ac12c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8b36('0x0')]={'phone':{'type':Sequelize[_0x8b36('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8b36('0x2')],'defaultValue':moment()[_0x8b36('0x3')](_0x8b36('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8b36('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8b36('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x8b36('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8b36('0x6')],'unique':_0x8b36('0x7')},'ListId':{'type':Sequelize[_0x8b36('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8b36('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x8b36('0x6')],'unique':_0x8b36('0x7')},'CampaignId':{'type':Sequelize[_0x8b36('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x8b36('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8b36('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8b36('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8b36('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8b36('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x8b36('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x8b36('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x75ae=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x9fbe5b,_0xded2ab){var _0x23f73e=function(_0x5c1421){while(--_0x5c1421){_0x9fbe5b['push'](_0x9fbe5b['shift']());}};_0x23f73e(++_0xded2ab);}(_0x75ae,0xa8));var _0xe75a=function(_0x418ee1,_0x1a82de){_0x418ee1=_0x418ee1-0x0;var _0x4aa098=_0x75ae[_0x418ee1];return _0x4aa098;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xe75a('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe75a('0x2')],'defaultValue':moment()[_0xe75a('0x3')](_0xe75a('0x4'))},'countbusyretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe75a('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe75a('0x2')]},'priority':{'type':Sequelize[_0xe75a('0x5')](0x2)[_0xe75a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe75a('0x5')],'unique':_0xe75a('0x7')},'ListId':{'type':Sequelize[_0xe75a('0x5')],'unique':_0xe75a('0x7')},'UserId':{'type':Sequelize[_0xe75a('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe75a('0x7')},'CampaignId':{'type':Sequelize[_0xe75a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe75a('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe75a('0x0')]},'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 4fe4965..0e10a1f 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 _0x1670=['scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','getPreviewRecall','findOne','Queue','dialActive','getOpenContacts','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$contains','$contained','$any','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','then','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','user','value','direction','isEmpty','priority','scheduledAt','DESC','ASC','literal','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1670,0x9a));var _0x0167=function(_0x2668d4,_0x2bbebc){_0x2668d4=_0x2668d4-0x0;var _0x341317=_0x1670[_0x2668d4];return _0x341317;};'use strict';var moment=require(_0x0167('0x0'));var _=require(_0x0167('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x0167('0x2'))('api');var shared=require(_0x0167('0x3'));var db=require(_0x0167('0x4'))['db'];function respondWithResult(_0x377590,_0x6f87ae){_0x6f87ae=_0x6f87ae||0xc8;return function(_0x5786d8){if(_0x5786d8){return _0x377590['status'](_0x6f87ae)[_0x0167('0x5')](_0x5786d8);}};}function respondWithFilteredResult(_0x1ae650,_0x295e51){return function(_0x3e1507){if(_0x3e1507){var _0x2120f2=typeof _0x295e51[_0x0167('0x6')]===_0x0167('0x7')&&typeof _0x295e51[_0x0167('0x8')]==='undefined';var _0x4c6b78=_0x3e1507[_0x0167('0x9')];var _0x178f5f=_0x2120f2?0x0:_0x295e51[_0x0167('0x6')];var _0x1632d4=_0x2120f2?_0x3e1507[_0x0167('0x9')]:_0x295e51[_0x0167('0x6')]+_0x295e51[_0x0167('0x8')];var _0x194af9;if(_0x1632d4>=_0x4c6b78){_0x1632d4=_0x4c6b78;_0x194af9=0xc8;}else{_0x194af9=0xce;}_0x1ae650[_0x0167('0xa')](_0x194af9);return _0x1ae650[_0x0167('0xb')](_0x0167('0xc'),_0x178f5f+'-'+_0x1632d4+'/'+_0x4c6b78)[_0x0167('0x5')](_0x3e1507);}return null;};}function saveUpdates(_0x34ac02,_0x2ebfa3){return function(_0x570965){if(_0x570965){return _0x570965[_0x0167('0xd')](_0x34ac02)['then'](function(_0x25e5d4){return _0x25e5d4;});}return null;};}function handleEntityNotFound(_0x5eb5f9,_0x7744d1){return function(_0x39e644){if(!_0x39e644){_0x5eb5f9[_0x0167('0xe')](0x194);}return _0x39e644;};}function handleError(_0x57c0e0,_0x50c1a3){_0x50c1a3=_0x50c1a3||0x1f4;return function(_0x547dea){logger[_0x0167('0xf')](_0x547dea[_0x0167('0x10')]);if(_0x547dea['name']){delete _0x547dea[_0x0167('0x11')];}_0x57c0e0['status'](_0x50c1a3)['send'](_0x547dea);};}exports[_0x0167('0x12')]=function(_0x574f04,_0x22f07c){var _0x4c0e4f={},_0x16094a={},_0x2740b5={'count':0x0,'rows':[]};var _0x170207=_[_0x0167('0x13')](db[_0x0167('0x14')][_0x0167('0x15')],function(_0xa384d9){return{'name':_0xa384d9[_0x0167('0x16')],'type':_0xa384d9[_0x0167('0x17')][_0x0167('0x18')]};});_0x16094a[_0x0167('0x19')]=_[_0x0167('0x13')](_0x170207,'name');_0x16094a[_0x0167('0x1a')]=_[_0x0167('0x1b')](_0x574f04[_0x0167('0x1a')]);_0x16094a['filters']=_[_0x0167('0x1c')](_0x16094a[_0x0167('0x19')],_0x16094a[_0x0167('0x1a')]);_0x16094a[_0x0167('0x1d')]=_['concat'](_0x16094a[_0x0167('0x1d')],['$and',_0x0167('0x1e'),_0x0167('0x1f'),_0x0167('0x20'),_0x0167('0x21'),_0x0167('0x22'),_0x0167('0x23'),_0x0167('0x24'),'$not',_0x0167('0x25'),_0x0167('0x26'),_0x0167('0x27'),'$notIn',_0x0167('0x28'),_0x0167('0x29'),'$iLike',_0x0167('0x2a'),_0x0167('0x28'),'$overlap',_0x0167('0x2b'),_0x0167('0x2c'),_0x0167('0x2d')]);_0x4c0e4f['attributes']=_[_0x0167('0x1c')](_0x16094a[_0x0167('0x19')],qs['fields'](_0x574f04['query'][_0x0167('0x2e')]));_0x4c0e4f[_0x0167('0x2f')]=_0x4c0e4f[_0x0167('0x2f')][_0x0167('0x30')]?_0x4c0e4f['attributes']:_0x16094a['model'];if(!_0x574f04[_0x0167('0x1a')]['hasOwnProperty']('nolimit')){_0x4c0e4f[_0x0167('0x8')]=qs[_0x0167('0x8')](_0x574f04[_0x0167('0x1a')][_0x0167('0x8')]);_0x4c0e4f[_0x0167('0x6')]=qs[_0x0167('0x6')](_0x574f04[_0x0167('0x1a')]['offset']);}_0x4c0e4f['order']=qs[_0x0167('0x31')](_0x574f04[_0x0167('0x1a')][_0x0167('0x31')]);_0x4c0e4f[_0x0167('0x32')]=qs[_0x0167('0x1d')](_[_0x0167('0x33')](_0x574f04['query'],_0x16094a[_0x0167('0x1d')]),_0x170207);if(_0x574f04['query']['filter']){_0x4c0e4f[_0x0167('0x32')]=_[_0x0167('0x34')](_0x4c0e4f[_0x0167('0x32')],{'$or':_['map'](_0x170207,function(_0x29355d){if(_0x29355d[_0x0167('0x17')]!==_0x0167('0x35')){var _0xb0cc5c={};_0xb0cc5c[_0x29355d['name']]={'$like':'%'+_0x574f04[_0x0167('0x1a')][_0x0167('0x36')]+'%'};return _0xb0cc5c;}})});}_0x4c0e4f=_[_0x0167('0x34')]({},_0x4c0e4f,_0x574f04['options']);var _0x2ba723={'where':_0x4c0e4f[_0x0167('0x32')]};return db[_0x0167('0x14')][_0x0167('0x9')](_0x2ba723)[_0x0167('0x37')](function(_0x5ef495){_0x2740b5[_0x0167('0x9')]=_0x5ef495;if(_0x574f04[_0x0167('0x1a')]['includeAll']){_0x4c0e4f[_0x0167('0x38')]=[{'all':!![]}];}return db[_0x0167('0x14')][_0x0167('0x39')](_0x4c0e4f);})[_0x0167('0x37')](function(_0x1280b4){_0x2740b5[_0x0167('0x3a')]=_0x1280b4;return _0x2740b5;})['then'](respondWithFilteredResult(_0x22f07c,_0x4c0e4f))[_0x0167('0x3b')](handleError(_0x22f07c,null));};exports[_0x0167('0x3c')]=function(_0x3bf14c,_0x34981a){var _0x49dc4d={'raw':!![],'where':{'id':_0x3bf14c[_0x0167('0x3d')]['id']}},_0x42cfe1={};_0x42cfe1['model']=_[_0x0167('0x1b')](db[_0x0167('0x14')][_0x0167('0x15')]);_0x42cfe1['query']=_[_0x0167('0x1b')](_0x3bf14c[_0x0167('0x1a')]);_0x42cfe1[_0x0167('0x1d')]=_[_0x0167('0x1c')](_0x42cfe1[_0x0167('0x19')],_0x42cfe1[_0x0167('0x1a')]);_0x49dc4d[_0x0167('0x2f')]=_[_0x0167('0x1c')](_0x42cfe1['model'],qs[_0x0167('0x2e')](_0x3bf14c['query'][_0x0167('0x2e')]));_0x49dc4d[_0x0167('0x2f')]=_0x49dc4d[_0x0167('0x2f')]['length']?_0x49dc4d['attributes']:_0x42cfe1['model'];if(_0x3bf14c[_0x0167('0x1a')][_0x0167('0x3e')]){_0x49dc4d[_0x0167('0x38')]=[{'all':!![]}];}_0x49dc4d=_[_0x0167('0x34')]({},_0x49dc4d,_0x3bf14c[_0x0167('0x3f')]);return db[_0x0167('0x14')]['find'](_0x49dc4d)['then'](handleEntityNotFound(_0x34981a,null))['then'](respondWithResult(_0x34981a,null))[_0x0167('0x3b')](handleError(_0x34981a,null));};exports['create']=function(_0x117123,_0x20c350){return db[_0x0167('0x14')][_0x0167('0x40')](_0x117123['body'],{})[_0x0167('0x37')](respondWithResult(_0x20c350,0xc9))[_0x0167('0x3b')](handleError(_0x20c350,null));};exports[_0x0167('0xd')]=function(_0x431cb7,_0x2c910a){if(_0x431cb7[_0x0167('0x41')]['id']){delete _0x431cb7[_0x0167('0x41')]['id'];}return db[_0x0167('0x14')][_0x0167('0x42')]({'where':{'id':_0x431cb7[_0x0167('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2c910a,null))['then'](saveUpdates(_0x431cb7[_0x0167('0x41')],null))['then'](respondWithResult(_0x2c910a,null))[_0x0167('0x3b')](handleError(_0x2c910a,null));};exports['describe']=function(_0x2c3efc,_0x52b720){return db[_0x0167('0x14')][_0x0167('0x43')]()['then'](respondWithResult(_0x52b720,null))['catch'](handleError(_0x52b720,null));};exports['destroy']=function(_0x174a7a,_0x55aaa0){var _0x5e3746;var _0x18d29d=_0x174a7a['params']['id'];return db[_0x0167('0x14')][_0x0167('0x42')]({'where':{'id':_0x174a7a[_0x0167('0x3d')]['id']}})['then'](handleEntityNotFound(_0x55aaa0,null))[_0x0167('0x37')](function(_0x5d1bbd){if(_0x5d1bbd){return _0x5d1bbd['destroy']()['then'](function(_0xecc47d){return _0xecc47d;});}})[_0x0167('0x37')](function(_0x3bb496){_0x5e3746=_0x3bb496;if(_0x3bb496){if(_0x3bb496[_0x0167('0x44')]||_0x3bb496[_0x0167('0x45')]){return db[_0x3bb496['VoiceQueueId']?_0x0167('0x46'):_0x0167('0x47')][_0x0167('0x42')]({'where':{'id':_0x3bb496[_0x0167('0x44')]?_0x3bb496['VoiceQueueId']:_0x3bb496['CampaignId']},'attributes':['id',_0x0167('0x11')],'raw':!![]});}}})['then'](function(_0x3a9e01){var _0x1deb9c={};if(_0x3a9e01){_[_0x0167('0x34')](_0x1deb9c,_[_0x0167('0x48')](_0x5e3746[_0x0167('0x49')],[_0x0167('0x4a'),_0x0167('0x4b'),'id']));_0x1deb9c[_0x0167('0x4c')]=0x15;_0x1deb9c[_0x0167('0x4d')]=_0x0167('0x4e');_0x1deb9c['campaign']=_0x3a9e01['name'];_0x1deb9c[_0x0167('0x4f')]=_0x174a7a['user'][_0x0167('0x11')];_0x1deb9c[_0x0167('0x50')]=_0x174a7a['user']['id'];_0x1deb9c[_0x0167('0x4e')]=!![];_0x1deb9c[_0x0167('0x51')]=moment()['format'](_0x0167('0x52'));_0x1deb9c[_0x0167('0x53')]=_0x5e3746[_0x0167('0x54')];_0x1deb9c[_0x0167('0x55')]=_0x5e3746['VoiceQueueId']?_0x0167('0x56'):_0x0167('0x57');return db[_0x0167('0x58')]['find']({'where':{'id':_0x1deb9c[_0x0167('0x59')]},'attributes':[_0x0167('0x5a'),_0x0167('0x5b')]})[_0x0167('0x37')](function(_0x35ceda){if(!_[_0x0167('0x5c')](_0x55aaa0)&&!_[_0x0167('0x5c')](_0x35ceda[_0x0167('0x5a')])){_0x1deb9c[_0x0167('0x5d')]=_0x35ceda['firstName'];if(!_[_0x0167('0x5c')](_0x35ceda[_0x0167('0x5b')])){_0x1deb9c[_0x0167('0x5d')]+='\x20'+_0x35ceda[_0x0167('0x5b')];}}})[_0x0167('0x5e')](function(){return db[_0x0167('0x5f')]['create'](_0x1deb9c);});}})[_0x0167('0x37')](function(_0x4da582){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x18d29d}});})[_0x0167('0x37')](function(){return _0x55aaa0[_0x0167('0xa')](0xcc)[_0x0167('0x60')]();})[_0x0167('0x3b')](handleError(_0x55aaa0,null));};exports[_0x0167('0x61')]=function(_0x5ad0ba,_0x20140b){var _0x38994f=[];return db['CmContact'][_0x0167('0x43')]()[_0x0167('0x37')](function(_0x3c46a0){_0x38994f=_[_0x0167('0x1b')](_0x3c46a0);return _0x5ad0ba['user']['getVoiceQueues']({'where':{'type':_0x0167('0x62'),'dialActive':!![],'dialMethod':_0x0167('0x63')},'attributes':['id',_0x0167('0x64'),_0x0167('0x65')],'raw':!![]});})[_0x0167('0x37')](function(_0x123df4){if(_0x123df4&&_0x123df4[_0x0167('0x30')]){return db[_0x0167('0x66')][_0x0167('0x67')](function(_0x3b5c80){var _0x5ed240={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0167('0x68')](_0x0167('0x52'))},'VoiceQueueId':{'$in':_[_0x0167('0x13')](_0x123df4,'id')},'$or':[{'UserId':null},{'UserId':_0x5ad0ba[_0x0167('0x69')]['id']}]};var _0x3b56ec={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x123df4)[_0x0167('0x36')]([_0x0167('0x65'),0x0])['map']('id')[_0x0167('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x5ad0ba[_0x0167('0x69')]['id']}]};var _0x547538={'$or':[_0x5ed240,_0x3b56ec]};var _0x1c46ce=[];if(_0x5ad0ba['body'][_0x0167('0x6b')]&&_0x5ad0ba[_0x0167('0x41')][_0x0167('0x6b')]==='prev'){if(!_[_0x0167('0x6c')](_0x5ad0ba[_0x0167('0x41')]['hopperIds'])){_0x547538['id']={'$in':_0x5ad0ba[_0x0167('0x41')]['hopperIds']};}_0x1c46ce=[[_0x0167('0x6d'),'ASC'],[_0x0167('0x6e'),_0x123df4[0x0][_0x0167('0x64')]==='ASC'?_0x0167('0x6f'):_0x0167('0x70')],db[_0x0167('0x66')][_0x0167('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x0167('0x6c')](_0x5ad0ba[_0x0167('0x41')][_0x0167('0x72')])){_0x547538['id']={'$notIn':_0x5ad0ba[_0x0167('0x41')]['hopperIds']};}_0x1c46ce=[[_0x0167('0x6d'),'DESC'],[_0x0167('0x6e'),_0x123df4[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x0167('0x71')](_0x0167('0x73')),['id',_0x0167('0x70')]];}return db[_0x0167('0x14')]['findOne']({'attributes':['id',_0x0167('0x74'),_0x0167('0x54'),_0x0167('0x75')],'where':_0x547538,'order':_0x1c46ce,'transaction':_0x3b5c80,'lock':_0x3b5c80[_0x0167('0x76')][_0x0167('0x77')],'include':[{'model':db[_0x0167('0x58')],'as':_0x0167('0x78'),'attributes':_0x38994f,'include':[{'model':db[_0x0167('0x79')],'as':_0x0167('0x7a'),'attributes':['id','name']}]},{'model':db[_0x0167('0x7b')],'as':'List','attributes':['id',_0x0167('0x11')]},{'model':db[_0x0167('0x46')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x0167('0x37')](function(_0x383085){if(_0x383085){return _0x383085['update']({'UserId':_0x5ad0ba['user']['id']},{'transaction':_0x3b5c80});}});});}})[_0x0167('0x37')](handleEntityNotFound(_0x20140b,null))[_0x0167('0x37')](respondWithResult(_0x20140b,null))['catch'](handleError(_0x20140b,null));};exports[_0x0167('0x7c')]=function(_0x255f88,_0x19c717,_0x30d32e){var _0x426bf4=[];var _0x3c0bca=_0x255f88['params']['id'];var _0x25b543=_0x255f88[_0x0167('0x69')]['id'];return db['CmContact'][_0x0167('0x43')]()[_0x0167('0x37')](function(_0xa7b06b){_0x426bf4=_[_0x0167('0x1b')](_0xa7b06b);return db[_0x0167('0x66')]['transaction'](function(_0x52bed0){const _0x557693={'id':_0x3c0bca};return db[_0x0167('0x14')][_0x0167('0x7d')]({'attributes':['id',_0x0167('0x74'),_0x0167('0x75')],'where':_0x557693,'transaction':_0x52bed0,'lock':_0x52bed0[_0x0167('0x76')]['UPDATE'],'include':[{'model':db[_0x0167('0x58')],'as':_0x0167('0x78'),'attributes':_0x426bf4,'include':[{'model':db[_0x0167('0x79')],'as':_0x0167('0x7a'),'attributes':['id',_0x0167('0x11')]}]},{'model':db[_0x0167('0x7b')],'as':'List','attributes':['id','name']},{'model':db[_0x0167('0x46')],'as':_0x0167('0x7e'),'attributes':['id','name',_0x0167('0x7f')]}]})[_0x0167('0x37')](function(_0x442e99){if(_0x442e99){return _0x442e99[_0x0167('0xd')]({'UserId':_0x25b543},{'transaction':_0x52bed0});}});});})[_0x0167('0x37')](handleEntityNotFound(_0x19c717,null))[_0x0167('0x37')](respondWithResult(_0x19c717,null))[_0x0167('0x3b')](handleError(_0x19c717,null));};exports[_0x0167('0x80')]=function(_0x4ba0c4,_0x427a7e){return _0x4ba0c4[_0x0167('0x69')][_0x0167('0x81')]({'where':{'type':_0x0167('0x62'),'dialActive':!![],'dialMethod':_0x0167('0x63')},'attributes':['id'],'raw':!![]})[_0x0167('0x37')](function(_0x344120){if(_0x344120&&_0x344120['length']){return db[_0x0167('0x14')][_0x0167('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x0167('0x13')](_0x344120,'id')},'$or':[{'UserId':null},{'UserId':_0x4ba0c4[_0x0167('0x69')]['id']}]}});}return 0x0;})[_0x0167('0x37')](function(_0x11cf46){if(!_['isNil'](_0x11cf46)&&_['isNumber'](_0x11cf46)){return _0x427a7e[_0x0167('0xa')](0xc8)['json']({'contacts':_0x11cf46});}else{logger['error'](_0x0167('0x82'),_0x0167('0x80'),0x194,'entity\x20not\x20found');_0x427a7e['sendStatus'](0x194);}})[_0x0167('0x3b')](handleError(_0x427a7e,null));};exports['getTimezones']=function(_0x1a1eba,_0x19adef){var _0x9980e3=shared[_0x0167('0x83')];var _0x3c5cdf=[];_[_0x0167('0x13')](_0x9980e3,function(_0x189f8a){_0x3c5cdf[_0x0167('0x84')]({'id':_0x189f8a[_0x0167('0x11')],'name':_0x189f8a[_0x0167('0x11')],'utcOffset':_0x189f8a[_0x0167('0x85')]});});return _0x19adef['status'](0xc8)['json']({'tz':_0x3c5cdf});};exports[_0x0167('0x86')]=function(_0x15ad6e,_0x2fb81e){var _0x5b0e7b=shared[_0x0167('0x83')];var _0x6421b0={};if(!_[_0x0167('0x5c')](_0x5b0e7b[_0x15ad6e[_0x0167('0x41')]['id']]))_0x6421b0=_0x5b0e7b[_0x15ad6e[_0x0167('0x41')]['id']];return _0x2fb81e[_0x0167('0xa')](0xc8)['json'](_0x6421b0);}; \ No newline at end of file +var _0xc492=['$iLike','$overlap','$contained','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmHopper','count','include','show','find','body','params','catch','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','CmContact','firstName','isNil','lastName','finally','create','CmHopperAdditionalPhone','end','getPreview','describe','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','transaction','CmCompany','getOpenContacts','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/environment','json','offset','undefined','limit','status','set','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$or','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$notIn','$like'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xc492,0xd7));var _0x2c49=function(_0x32790a,_0x40eb8c){_0x32790a=_0x32790a-0x0;var _0x365aa0=_0xc492[_0x32790a];return _0x365aa0;};'use strict';var moment=require(_0x2c49('0x0'));var _=require(_0x2c49('0x1'));var qs=require(_0x2c49('0x2'));var logger=require('../../config/logger')('api');var shared=require(_0x2c49('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x4c9b2d,_0x555cba){_0x555cba=_0x555cba||0xc8;return function(_0x1de940){if(_0x1de940){return _0x4c9b2d['status'](_0x555cba)[_0x2c49('0x4')](_0x1de940);}};}function respondWithFilteredResult(_0x499c4e,_0x3ad911){return function(_0x9c10f7){if(_0x9c10f7){var _0x4c76dd=typeof _0x3ad911[_0x2c49('0x5')]===_0x2c49('0x6')&&typeof _0x3ad911[_0x2c49('0x7')]===_0x2c49('0x6');var _0x326287=_0x9c10f7['count'];var _0x3d3e2a=_0x4c76dd?0x0:_0x3ad911['offset'];var _0x493cd2=_0x4c76dd?_0x9c10f7['count']:_0x3ad911['offset']+_0x3ad911[_0x2c49('0x7')];var _0x4d07b6;if(_0x493cd2>=_0x326287){_0x493cd2=_0x326287;_0x4d07b6=0xc8;}else{_0x4d07b6=0xce;}_0x499c4e[_0x2c49('0x8')](_0x4d07b6);return _0x499c4e[_0x2c49('0x9')]('Content-Range',_0x3d3e2a+'-'+_0x493cd2+'/'+_0x326287)[_0x2c49('0x4')](_0x9c10f7);}return null;};}function saveUpdates(_0x1cc78b,_0x19f7d9){return function(_0x1e2210){if(_0x1e2210){return _0x1e2210[_0x2c49('0xa')](_0x1cc78b)[_0x2c49('0xb')](function(_0x560c76){return _0x560c76;});}return null;};}function handleEntityNotFound(_0x2006cf,_0x5af5e7){return function(_0x2eeb10){if(!_0x2eeb10){_0x2006cf[_0x2c49('0xc')](0x194);}return _0x2eeb10;};}function handleError(_0x14f529,_0x561d83){_0x561d83=_0x561d83||0x1f4;return function(_0x19f59b){logger[_0x2c49('0xd')](_0x19f59b[_0x2c49('0xe')]);if(_0x19f59b[_0x2c49('0xf')]){delete _0x19f59b[_0x2c49('0xf')];}_0x14f529[_0x2c49('0x8')](_0x561d83)[_0x2c49('0x10')](_0x19f59b);};}exports[_0x2c49('0x11')]=function(_0x1fe9f8,_0x89bcb){var _0x4f6063={},_0x3001af={},_0x3fe920={'count':0x0,'rows':[]};var _0x3dfb36=_[_0x2c49('0x12')](db['CmHopper'][_0x2c49('0x13')],function(_0x578c07){return{'name':_0x578c07[_0x2c49('0x14')],'type':_0x578c07[_0x2c49('0x15')]['key']};});_0x3001af['model']=_[_0x2c49('0x12')](_0x3dfb36,_0x2c49('0xf'));_0x3001af[_0x2c49('0x16')]=_[_0x2c49('0x17')](_0x1fe9f8[_0x2c49('0x16')]);_0x3001af[_0x2c49('0x18')]=_[_0x2c49('0x19')](_0x3001af[_0x2c49('0x1a')],_0x3001af[_0x2c49('0x16')]);_0x3001af['filters']=_[_0x2c49('0x1b')](_0x3001af[_0x2c49('0x18')],[_0x2c49('0x1c'),_0x2c49('0x1d'),'$gt',_0x2c49('0x1e'),_0x2c49('0x1f'),_0x2c49('0x20'),_0x2c49('0x21'),'$eq',_0x2c49('0x22'),_0x2c49('0x23'),_0x2c49('0x24'),'$in',_0x2c49('0x25'),_0x2c49('0x26'),'$notLike',_0x2c49('0x27'),'$notILike','$like',_0x2c49('0x28'),'$contains',_0x2c49('0x29'),'$any']);_0x4f6063[_0x2c49('0x2a')]=_[_0x2c49('0x19')](_0x3001af[_0x2c49('0x1a')],qs[_0x2c49('0x2b')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x2b')]));_0x4f6063[_0x2c49('0x2a')]=_0x4f6063[_0x2c49('0x2a')][_0x2c49('0x2c')]?_0x4f6063[_0x2c49('0x2a')]:_0x3001af['model'];if(!_0x1fe9f8[_0x2c49('0x16')]['hasOwnProperty'](_0x2c49('0x2d'))){_0x4f6063[_0x2c49('0x7')]=qs[_0x2c49('0x7')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x7')]);_0x4f6063[_0x2c49('0x5')]=qs[_0x2c49('0x5')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x5')]);}_0x4f6063[_0x2c49('0x2e')]=qs[_0x2c49('0x2f')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x2f')]);_0x4f6063[_0x2c49('0x30')]=qs['filters'](_['pick'](_0x1fe9f8[_0x2c49('0x16')],_0x3001af[_0x2c49('0x18')]),_0x3dfb36);if(_0x1fe9f8['query'][_0x2c49('0x31')]){_0x4f6063[_0x2c49('0x30')]=_[_0x2c49('0x32')](_0x4f6063[_0x2c49('0x30')],{'$or':_[_0x2c49('0x12')](_0x3dfb36,function(_0x1df5de){if(_0x1df5de[_0x2c49('0x15')]!==_0x2c49('0x33')){var _0x4ed053={};_0x4ed053[_0x1df5de[_0x2c49('0xf')]]={'$like':'%'+_0x1fe9f8[_0x2c49('0x16')]['filter']+'%'};return _0x4ed053;}})});}_0x4f6063=_[_0x2c49('0x32')]({},_0x4f6063,_0x1fe9f8[_0x2c49('0x34')]);var _0xddfe1a={'where':_0x4f6063['where']};return db[_0x2c49('0x35')][_0x2c49('0x36')](_0xddfe1a)[_0x2c49('0xb')](function(_0x321fa3){_0x3fe920[_0x2c49('0x36')]=_0x321fa3;if(_0x1fe9f8[_0x2c49('0x16')]['includeAll']){_0x4f6063[_0x2c49('0x37')]=[{'all':!![]}];}return db[_0x2c49('0x35')]['findAll'](_0x4f6063);})[_0x2c49('0xb')](function(_0x438486){_0x3fe920['rows']=_0x438486;return _0x3fe920;})[_0x2c49('0xb')](respondWithFilteredResult(_0x89bcb,_0x4f6063))['catch'](handleError(_0x89bcb,null));};exports[_0x2c49('0x38')]=function(_0x47773e,_0x477efc){var _0x5a6822={'raw':!![],'where':{'id':_0x47773e['params']['id']}},_0x472d84={};_0x472d84[_0x2c49('0x1a')]=_[_0x2c49('0x17')](db[_0x2c49('0x35')][_0x2c49('0x13')]);_0x472d84[_0x2c49('0x16')]=_['keys'](_0x47773e[_0x2c49('0x16')]);_0x472d84[_0x2c49('0x18')]=_[_0x2c49('0x19')](_0x472d84[_0x2c49('0x1a')],_0x472d84[_0x2c49('0x16')]);_0x5a6822[_0x2c49('0x2a')]=_[_0x2c49('0x19')](_0x472d84[_0x2c49('0x1a')],qs['fields'](_0x47773e[_0x2c49('0x16')][_0x2c49('0x2b')]));_0x5a6822['attributes']=_0x5a6822[_0x2c49('0x2a')][_0x2c49('0x2c')]?_0x5a6822['attributes']:_0x472d84[_0x2c49('0x1a')];if(_0x47773e['query']['includeAll']){_0x5a6822['include']=[{'all':!![]}];}_0x5a6822=_['merge']({},_0x5a6822,_0x47773e[_0x2c49('0x34')]);return db[_0x2c49('0x35')][_0x2c49('0x39')](_0x5a6822)[_0x2c49('0xb')](handleEntityNotFound(_0x477efc,null))[_0x2c49('0xb')](respondWithResult(_0x477efc,null))['catch'](handleError(_0x477efc,null));};exports['create']=function(_0x5757e5,_0x5ee329){return db[_0x2c49('0x35')]['create'](_0x5757e5[_0x2c49('0x3a')],{})['then'](respondWithResult(_0x5ee329,0xc9))['catch'](handleError(_0x5ee329,null));};exports['update']=function(_0x1d4d7b,_0x51e7e5){if(_0x1d4d7b[_0x2c49('0x3a')]['id']){delete _0x1d4d7b[_0x2c49('0x3a')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x1d4d7b[_0x2c49('0x3b')]['id']}})[_0x2c49('0xb')](handleEntityNotFound(_0x51e7e5,null))[_0x2c49('0xb')](saveUpdates(_0x1d4d7b[_0x2c49('0x3a')],null))[_0x2c49('0xb')](respondWithResult(_0x51e7e5,null))['catch'](handleError(_0x51e7e5,null));};exports['describe']=function(_0x426c8a,_0x2587c6){return db['CmHopper']['describe']()['then'](respondWithResult(_0x2587c6,null))[_0x2c49('0x3c')](handleError(_0x2587c6,null));};exports[_0x2c49('0x3d')]=function(_0x98fc90,_0x55e4cd){var _0xf4c2c2;var _0xea11c4=_0x98fc90[_0x2c49('0x3b')]['id'];return db[_0x2c49('0x35')][_0x2c49('0x39')]({'where':{'id':_0x98fc90[_0x2c49('0x3b')]['id']}})[_0x2c49('0xb')](handleEntityNotFound(_0x55e4cd,null))['then'](function(_0x5f2267){if(_0x5f2267){return _0x5f2267['destroy']()[_0x2c49('0xb')](function(_0x1aa034){return _0x1aa034;});}})['then'](function(_0x1ea344){_0xf4c2c2=_0x1ea344;if(_0x1ea344){if(_0x1ea344[_0x2c49('0x3e')]||_0x1ea344[_0x2c49('0x3f')]){return db[_0x1ea344[_0x2c49('0x3e')]?_0x2c49('0x40'):_0x2c49('0x41')][_0x2c49('0x39')]({'where':{'id':_0x1ea344[_0x2c49('0x3e')]?_0x1ea344[_0x2c49('0x3e')]:_0x1ea344[_0x2c49('0x3f')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2c49('0xb')](function(_0xe026bf){var _0xfcdbaf={};if(_0xe026bf){_['merge'](_0xfcdbaf,_[_0x2c49('0x42')](_0xf4c2c2[_0x2c49('0x43')],['createdAt',_0x2c49('0x44'),'id']));_0xfcdbaf[_0x2c49('0x45')]=0x15;_0xfcdbaf[_0x2c49('0x46')]=_0x2c49('0x47');_0xfcdbaf['campaign']=_0xe026bf[_0x2c49('0xf')];_0xfcdbaf[_0x2c49('0x48')]=_0x98fc90[_0x2c49('0x49')][_0x2c49('0xf')];_0xfcdbaf['UserId']=_0x98fc90[_0x2c49('0x49')]['id'];_0xfcdbaf[_0x2c49('0x47')]=!![];_0xfcdbaf[_0x2c49('0x4a')]=moment()[_0x2c49('0x4b')](_0x2c49('0x4c'));_0xfcdbaf[_0x2c49('0x4d')]=_0xf4c2c2[_0x2c49('0x4e')];_0xfcdbaf[_0x2c49('0x4f')]=_0xf4c2c2[_0x2c49('0x3e')]?'queue':'ivr';return db[_0x2c49('0x50')][_0x2c49('0x39')]({'where':{'id':_0xfcdbaf['ContactId']},'attributes':[_0x2c49('0x51'),'lastName']})[_0x2c49('0xb')](function(_0x32b4fd){if(!_[_0x2c49('0x52')](_0x55e4cd)&&!_[_0x2c49('0x52')](_0x32b4fd[_0x2c49('0x51')])){_0xfcdbaf['calleridname']=_0x32b4fd[_0x2c49('0x51')];if(!_[_0x2c49('0x52')](_0x32b4fd[_0x2c49('0x53')])){_0xfcdbaf['calleridname']+='\x20'+_0x32b4fd[_0x2c49('0x53')];}}})[_0x2c49('0x54')](function(){return db['CmHopperFinal'][_0x2c49('0x55')](_0xfcdbaf);});}})[_0x2c49('0xb')](function(_0x547311){return db[_0x2c49('0x56')]['destroy']({'where':{'CmHopperId':_0xea11c4}});})[_0x2c49('0xb')](function(){return _0x55e4cd[_0x2c49('0x8')](0xcc)[_0x2c49('0x57')]();})[_0x2c49('0x3c')](handleError(_0x55e4cd,null));};exports[_0x2c49('0x58')]=function(_0x144658,_0x4a4a2f){var _0xbc3817=[];return db[_0x2c49('0x50')][_0x2c49('0x59')]()['then'](function(_0x1a71da){_0xbc3817=_['keys'](_0x1a71da);return _0x144658['user']['getVoiceQueues']({'where':{'type':_0x2c49('0x5a'),'dialActive':!![],'dialMethod':_0x2c49('0x5b')},'attributes':['id',_0x2c49('0x5c'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x2c49('0xb')](function(_0x57237c){if(_0x57237c&&_0x57237c['length']){return db['sequelize']['transaction'](function(_0x5ae15e){var _0x127dea={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c49('0x12')](_0x57237c,'id')},'$or':[{'UserId':null},{'UserId':_0x144658['user']['id']}]};var _0x5f28b7={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x57237c)['filter']([_0x2c49('0x5d'),0x0])[_0x2c49('0x12')]('id')[_0x2c49('0x5e')]()},'$or':[{'UserId':null},{'UserId':_0x144658[_0x2c49('0x49')]['id']}]};var _0x3fd55e={'$or':[_0x127dea,_0x5f28b7]};var _0x4fef4f=[];if(_0x144658[_0x2c49('0x3a')][_0x2c49('0x5f')]&&_0x144658[_0x2c49('0x3a')][_0x2c49('0x5f')]===_0x2c49('0x60')){if(!_[_0x2c49('0x61')](_0x144658[_0x2c49('0x3a')][_0x2c49('0x62')])){_0x3fd55e['id']={'$in':_0x144658[_0x2c49('0x3a')]['hopperIds']};}_0x4fef4f=[[_0x2c49('0x63'),_0x2c49('0x64')],['scheduledAt',_0x57237c[0x0][_0x2c49('0x5c')]===_0x2c49('0x64')?_0x2c49('0x65'):_0x2c49('0x64')],db[_0x2c49('0x66')][_0x2c49('0x67')](_0x2c49('0x68')),['id',_0x2c49('0x65')]];}else{if(!_[_0x2c49('0x61')](_0x144658[_0x2c49('0x3a')][_0x2c49('0x62')])){_0x3fd55e['id']={'$notIn':_0x144658[_0x2c49('0x3a')]['hopperIds']};}_0x4fef4f=[[_0x2c49('0x63'),_0x2c49('0x65')],[_0x2c49('0x69'),_0x57237c[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x2c49('0x35')][_0x2c49('0x6a')]({'attributes':['id',_0x2c49('0x6b'),_0x2c49('0x4e'),'recallme'],'where':_0x3fd55e,'order':_0x4fef4f,'transaction':_0x5ae15e,'lock':_0x5ae15e[_0x2c49('0x6c')][_0x2c49('0x6d')],'include':[{'model':db[_0x2c49('0x50')],'as':_0x2c49('0x6e'),'attributes':_0xbc3817,'include':[{'model':db['CmCompany'],'as':_0x2c49('0x6f'),'attributes':['id',_0x2c49('0xf')]}]},{'model':db[_0x2c49('0x70')],'as':_0x2c49('0x71'),'attributes':['id','name']},{'model':db[_0x2c49('0x40')],'as':_0x2c49('0x72'),'attributes':['id',_0x2c49('0xf'),_0x2c49('0x73')]}]})['then'](function(_0x7fd1b){if(_0x7fd1b){return _0x7fd1b[_0x2c49('0xa')]({'UserId':_0x144658[_0x2c49('0x49')]['id']},{'transaction':_0x5ae15e});}});});}})[_0x2c49('0xb')](handleEntityNotFound(_0x4a4a2f,null))['then'](respondWithResult(_0x4a4a2f,null))[_0x2c49('0x3c')](handleError(_0x4a4a2f,null));};exports[_0x2c49('0x74')]=function(_0x2df60c,_0x5da8d5,_0x3e7410){var _0x2f0818=[];var _0x2d658c=_0x2df60c[_0x2c49('0x3b')]['id'];var _0x39ce2d=_0x2df60c[_0x2c49('0x49')]['id'];return db[_0x2c49('0x50')][_0x2c49('0x59')]()[_0x2c49('0xb')](function(_0x53b169){_0x2f0818=_[_0x2c49('0x17')](_0x53b169);return db[_0x2c49('0x66')][_0x2c49('0x75')](function(_0x16fd93){const _0xe1417f={'id':_0x2d658c};return db[_0x2c49('0x35')][_0x2c49('0x6a')]({'attributes':['id',_0x2c49('0x6b'),'recallme'],'where':_0xe1417f,'transaction':_0x16fd93,'lock':_0x16fd93[_0x2c49('0x6c')][_0x2c49('0x6d')],'include':[{'model':db[_0x2c49('0x50')],'as':'Contact','attributes':_0x2f0818,'include':[{'model':db[_0x2c49('0x76')],'as':'Company','attributes':['id',_0x2c49('0xf')]}]},{'model':db['CmList'],'as':_0x2c49('0x71'),'attributes':['id',_0x2c49('0xf')]},{'model':db[_0x2c49('0x40')],'as':_0x2c49('0x72'),'attributes':['id',_0x2c49('0xf'),_0x2c49('0x73')]}]})[_0x2c49('0xb')](function(_0x56e8be){if(_0x56e8be){return _0x56e8be[_0x2c49('0xa')]({'UserId':_0x39ce2d},{'transaction':_0x16fd93});}});});})[_0x2c49('0xb')](handleEntityNotFound(_0x5da8d5,null))[_0x2c49('0xb')](respondWithResult(_0x5da8d5,null))[_0x2c49('0x3c')](handleError(_0x5da8d5,null));};exports[_0x2c49('0x77')]=function(_0x19a496,_0x2c5efa){return _0x19a496[_0x2c49('0x49')][_0x2c49('0x78')]({'where':{'type':_0x2c49('0x5a'),'dialActive':!![],'dialMethod':_0x2c49('0x5b')},'attributes':['id'],'raw':!![]})['then'](function(_0x577edb){if(_0x577edb&&_0x577edb[_0x2c49('0x2c')]){return db[_0x2c49('0x35')][_0x2c49('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c49('0x4b')](_0x2c49('0x4c'))},'VoiceQueueId':{'$in':_[_0x2c49('0x12')](_0x577edb,'id')},'$or':[{'UserId':null},{'UserId':_0x19a496[_0x2c49('0x49')]['id']}]}});}return 0x0;})['then'](function(_0x1ff359){if(!_[_0x2c49('0x52')](_0x1ff359)&&_['isNumber'](_0x1ff359)){return _0x2c5efa[_0x2c49('0x8')](0xc8)[_0x2c49('0x4')]({'contacts':_0x1ff359});}else{logger[_0x2c49('0xd')](_0x2c49('0x79'),_0x2c49('0x77'),0x194,_0x2c49('0x7a'));_0x2c5efa['sendStatus'](0x194);}})['catch'](handleError(_0x2c5efa,null));};exports[_0x2c49('0x7b')]=function(_0x37ccd9,_0x2b30aa){var _0x4cb76b=shared[_0x2c49('0x7c')];var _0x37d09c=[];_[_0x2c49('0x12')](_0x4cb76b,function(_0x2d9a45){_0x37d09c['push']({'id':_0x2d9a45[_0x2c49('0xf')],'name':_0x2d9a45[_0x2c49('0xf')],'utcOffset':_0x2d9a45[_0x2c49('0x7d')]});});return _0x2b30aa[_0x2c49('0x8')](0xc8)[_0x2c49('0x4')]({'tz':_0x37d09c});};exports[_0x2c49('0x7e')]=function(_0x4fcd43,_0x48e935){var _0x1a477f=shared[_0x2c49('0x7c')];var _0x11a53b={};if(!_[_0x2c49('0x52')](_0x1a477f[_0x4fcd43[_0x2c49('0x3a')]['id']]))_0x11a53b=_0x1a477f[_0x4fcd43['body']['id']];return _0x48e935[_0x2c49('0x8')](0xc8)['json'](_0x11a53b);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 3afd248..ad1bbaf 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 _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x447627,_0x12e5d6){var _0x40e722=function(_0x5e1b4d){while(--_0x5e1b4d){_0x447627['push'](_0x447627['shift']());}};_0x40e722(++_0x12e5d6);}(_0xeda8,0x104));var _0x8eda=function(_0x35a1d0,_0x52d080){_0x35a1d0=_0x35a1d0-0x0;var _0x2c3d5d=_0xeda8[_0x35a1d0];return _0x2c3d5d;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7096=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api'];(function(_0x11a274,_0x42184a){var _0x5ac05d=function(_0x5bebf2){while(--_0x5bebf2){_0x11a274['push'](_0x11a274['shift']());}};_0x5ac05d(++_0x42184a);}(_0x7096,0x10c));var _0x6709=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7096[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x6709('0xd')]},{'name':_0x6709('0xe'),'fields':[_0x6709('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bbf8273..fef487b 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 _0x8c8b=['bluebird','../../config/logger','rpc','GetCmHopper','findAll','options','where','attributes','limit','include','map','then','info','debug','catch','error','message','ShowCmHopper','CmHopper','find','raw','model','stringify','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','LOCK','Contact','keys','User','Agent','name','voicePause','UserId','push','update','includes','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','UPDATE','all','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','\x20MINUTE','NOW()','CmList','util','moment'];(function(_0x17bdf0,_0x6693ca){var _0x57a9d4=function(_0xb52548){while(--_0xb52548){_0x17bdf0['push'](_0x17bdf0['shift']());}};_0x57a9d4(++_0x6693ca);}(_0x8c8b,0x184));var _0xb8c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c8b[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xb8c8('0x0'));var moment=require(_0xb8c8('0x1'));var BPromise=require(_0xb8c8('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb8c8('0x3'))(_0xb8c8('0x4'));exports[_0xb8c8('0x5')]=function(_0x467f13){var _0x592830=this;return new Promise(function(_0x375d75,_0x1cd684){return db['CmHopper'][_0xb8c8('0x6')]({'raw':_0x467f13[_0xb8c8('0x7')]?_0x467f13[_0xb8c8('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x467f13[_0xb8c8('0x7')]?_0x467f13[_0xb8c8('0x7')][_0xb8c8('0x8')]||null:null,'attributes':_0x467f13[_0xb8c8('0x7')]?_0x467f13[_0xb8c8('0x7')][_0xb8c8('0x9')]||null:null,'limit':_0x467f13[_0xb8c8('0x7')]?_0x467f13[_0xb8c8('0x7')][_0xb8c8('0xa')]||null:null,'include':_0x467f13[_0xb8c8('0x7')]?_0x467f13[_0xb8c8('0x7')][_0xb8c8('0xb')]?_['map'](_0x467f13[_0xb8c8('0x7')]['include'],function(_0x49ca8d){return{'model':db[_0x49ca8d['model']],'as':_0x49ca8d['as'],'attributes':_0x49ca8d['attributes'],'include':_0x49ca8d[_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x49ca8d[_0xb8c8('0xb')],function(_0x377afd){return{'model':db[_0x377afd['model']],'as':_0x377afd['as'],'attributes':_0x377afd['attributes'],'include':_0x377afd[_0xb8c8('0xb')]?_['map'](_0x377afd[_0xb8c8('0xb')],function(_0x5c0c25){return{'model':db[_0x5c0c25['model']],'as':_0x5c0c25['as'],'attributes':_0x5c0c25[_0xb8c8('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb8c8('0xd')](function(_0x6f5966){logger[_0xb8c8('0xe')](_0xb8c8('0x5'),_0x467f13);logger[_0xb8c8('0xf')](_0xb8c8('0x5'),_0x467f13,JSON['stringify'](_0x6f5966));_0x375d75(_0x6f5966);})[_0xb8c8('0x10')](function(_0x2d424a){logger[_0xb8c8('0x11')](_0xb8c8('0x5'),_0x2d424a[_0xb8c8('0x12')],_0x467f13);_0x1cd684(_0x592830[_0xb8c8('0x11')](0x1f4,_0x2d424a['message']));});});};exports[_0xb8c8('0x13')]=function(_0x3a26ca){var _0x42cc7c=this;return new Promise(function(_0x144964,_0x2427a2){return db[_0xb8c8('0x14')][_0xb8c8('0x15')]({'raw':_0x3a26ca[_0xb8c8('0x7')]?_0x3a26ca[_0xb8c8('0x7')][_0xb8c8('0x16')]===undefined?!![]:![]:!![],'where':_0x3a26ca['options']?_0x3a26ca[_0xb8c8('0x7')][_0xb8c8('0x8')]||null:null,'attributes':_0x3a26ca['options']?_0x3a26ca['options'][_0xb8c8('0x9')]||null:null,'include':_0x3a26ca[_0xb8c8('0x7')]?_0x3a26ca[_0xb8c8('0x7')][_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x3a26ca[_0xb8c8('0x7')]['include'],function(_0x10d1b7){return{'model':db[_0x10d1b7[_0xb8c8('0x17')]],'as':_0x10d1b7['as'],'attributes':_0x10d1b7[_0xb8c8('0x9')],'include':_0x10d1b7[_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x10d1b7[_0xb8c8('0xb')],function(_0x18c428){return{'model':db[_0x18c428[_0xb8c8('0x17')]],'as':_0x18c428['as'],'attributes':_0x18c428['attributes'],'include':_0x18c428['include']?_[_0xb8c8('0xc')](_0x18c428[_0xb8c8('0xb')],function(_0x333bee){return{'model':db[_0x333bee[_0xb8c8('0x17')]],'as':_0x333bee['as'],'attributes':_0x333bee[_0xb8c8('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb8c8('0xd')](function(_0x5e9010){logger[_0xb8c8('0xe')]('ShowCmHopper',_0x3a26ca);logger[_0xb8c8('0xf')](_0xb8c8('0x13'),_0x3a26ca,JSON[_0xb8c8('0x18')](_0x5e9010));_0x144964(_0x5e9010);})[_0xb8c8('0x10')](function(_0x5b56a9){logger[_0xb8c8('0x11')](_0xb8c8('0x13'),_0x5b56a9[_0xb8c8('0x12')],_0x3a26ca);_0x2427a2(_0x42cc7c[_0xb8c8('0x11')](0x1f4,_0x5b56a9[_0xb8c8('0x12')]));});});};exports[_0xb8c8('0x19')]=function(_0x42f565){var _0x14b9ae=this;return new Promise(function(_0x4f4205,_0x224ccc){return db[_0xb8c8('0x14')][_0xb8c8('0x1a')](_0x42f565[_0xb8c8('0x1b')],{'raw':_0x42f565[_0xb8c8('0x7')]?_0x42f565['options'][_0xb8c8('0x16')]===undefined?!![]:![]:!![]})[_0xb8c8('0xd')](function(_0x1db843){logger[_0xb8c8('0xe')](_0xb8c8('0x19'),_0x42f565);logger[_0xb8c8('0xf')](_0xb8c8('0x19'),_0x42f565,JSON['stringify'](_0x1db843));_0x4f4205(_0x1db843);})[_0xb8c8('0x10')](function(_0x24271a){logger['error'](_0xb8c8('0x19'),_0x24271a[_0xb8c8('0x12')],_0x42f565);_0x224ccc(_0x14b9ae[_0xb8c8('0x11')](0x1f4,_0x24271a[_0xb8c8('0x12')]));});});};exports[_0xb8c8('0x1c')]=function(_0x2ef4ec){var _0x270f51=this;return new Promise(function(_0x5e79c8,_0x249ebb){return db[_0xb8c8('0x14')]['update'](_0x2ef4ec[_0xb8c8('0x1b')],{'raw':_0x2ef4ec[_0xb8c8('0x7')]?_0x2ef4ec['options'][_0xb8c8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef4ec['options']?_0x2ef4ec['options'][_0xb8c8('0x8')]||null:null,'attributes':_0x2ef4ec[_0xb8c8('0x7')]?_0x2ef4ec['options'][_0xb8c8('0x9')]||null:null,'limit':_0x2ef4ec[_0xb8c8('0x7')]?_0x2ef4ec[_0xb8c8('0x7')][_0xb8c8('0xa')]||null:null})[_0xb8c8('0xd')](function(_0x342772){logger[_0xb8c8('0xe')](_0xb8c8('0x1c'),_0x2ef4ec);logger[_0xb8c8('0xe')](_0xb8c8('0x1d'),JSON[_0xb8c8('0x18')](_0x2ef4ec[_0xb8c8('0x7')][_0xb8c8('0x8')]),_0x2ef4ec['body'][_0xb8c8('0x1e')]);logger[_0xb8c8('0xf')]('UpdateCmHopper',_0x2ef4ec,JSON[_0xb8c8('0x18')](_0x342772));_0x5e79c8(_0x342772);})[_0xb8c8('0x10')](function(_0x22478b){logger[_0xb8c8('0x11')](_0xb8c8('0x1c'),_0x22478b[_0xb8c8('0x12')],_0x2ef4ec);_0x249ebb(_0x270f51[_0xb8c8('0x11')](0x1f4,_0x22478b[_0xb8c8('0x12')]));});});};exports['DestroyCmHopper']=function(_0x5e3fc4){var _0x59f47a=this;return new Promise(function(_0x422963,_0x463880){return db['CmHopper']['destroy']({'where':_0x5e3fc4['options']?_0x5e3fc4[_0xb8c8('0x7')]['where']||null:null})[_0xb8c8('0xd')](function(_0x4693a1){logger[_0xb8c8('0xe')](_0xb8c8('0x1f'),_0x5e3fc4);logger['debug']('DestroyCmHopper',_0x5e3fc4,JSON['stringify'](_0x4693a1));_0x422963(_0x4693a1);})[_0xb8c8('0x10')](function(_0x2a41df){logger[_0xb8c8('0x11')]('DestroyCmHopper',_0x2a41df[_0xb8c8('0x12')],_0x5e3fc4);_0x463880(_0x59f47a[_0xb8c8('0x11')](0x1f4,_0x2a41df[_0xb8c8('0x12')]));});});};exports[_0xb8c8('0x20')]=function(_0x334571){var _0xb697b4=this;return new Promise(function(_0x47a62f,_0x4434ba){return db[_0xb8c8('0x21')][_0xb8c8('0x22')]()[_0xb8c8('0xd')](function(_0x57f24e){return db[_0xb8c8('0x23')]['transaction'](function(_0x10fcb7){return db[_0xb8c8('0x14')][_0xb8c8('0x6')]({'where':_0x334571[_0xb8c8('0x7')]?_0x334571[_0xb8c8('0x7')][_0xb8c8('0x8')]||null:null,'attributes':_0x334571['options']?_0x334571[_0xb8c8('0x7')][_0xb8c8('0x9')]||null:null,'limit':_0x334571[_0xb8c8('0x7')]?_0x334571[_0xb8c8('0x7')][_0xb8c8('0xa')]||null:null,'order':_0x334571[_0xb8c8('0x7')]?_0x334571['options'][_0xb8c8('0x24')]||null:null,'transaction':_0x10fcb7,'lock':_0x10fcb7[_0xb8c8('0x25')]['UPDATE'],'include':[{'model':db[_0xb8c8('0x21')],'as':_0xb8c8('0x26'),'attributes':_[_0xb8c8('0x27')](_0x57f24e)},{'model':db[_0xb8c8('0x28')],'as':_0xb8c8('0x29'),'attributes':['id',_0xb8c8('0x2a'),_0xb8c8('0x2b')]}]})['then'](function(_0x12793a){var _0x2c9fc6=[];var _0x56e2b2=[];for(var _0x171436=0x0;_0x171436<_0x12793a['length'];_0x171436+=0x1){var _0x36f6f6=_0x12793a[_0x171436][_0xb8c8('0x2c')];if(_0x36f6f6===null){_0x2c9fc6[_0xb8c8('0x2d')](_0x12793a[_0x171436][_0xb8c8('0x2e')](_0x334571[_0xb8c8('0x1b')],{'transaction':_0x10fcb7}));}else if(!_0x56e2b2[_0xb8c8('0x2f')](_0x36f6f6)){_0x56e2b2[_0xb8c8('0x2d')](_0x36f6f6);_0x2c9fc6[_0xb8c8('0x2d')](_0x12793a[_0x171436][_0xb8c8('0x2e')](_0x334571['body'],{'transaction':_0x10fcb7}));}}return BPromise['all'](_0x2c9fc6);});})[_0xb8c8('0xd')](function(_0x572a18){logger[_0xb8c8('0xe')](_0xb8c8('0x20'),_0x334571);if(_0x572a18[_0xb8c8('0x30')]>0x0){logger[_0xb8c8('0xe')](_0xb8c8('0x31'),_0x572a18[0x0][_0xb8c8('0x32')]['id'],_0x572a18[0x0][_0xb8c8('0x32')][_0xb8c8('0x33')],_0x572a18[0x0][_0xb8c8('0x32')][_0xb8c8('0x1e')]);}logger[_0xb8c8('0xf')](_0xb8c8('0x20'),_0x334571,JSON['stringify'](_0x572a18));_0x47a62f(_0x572a18);})[_0xb8c8('0x10')](function(_0xc275d7){logger[_0xb8c8('0x11')]('GetContactDialer',_0xc275d7[_0xb8c8('0x12')],_0x334571);_0x4434ba(_0xb697b4[_0xb8c8('0x11')](0x1f4,_0xc275d7[_0xb8c8('0x12')]));});});});};exports[_0xb8c8('0x34')]=function(_0xdd39ad){var _0x10f426=this;return new Promise(function(_0x313c17,_0x17f454){return db['sequelize'][_0xb8c8('0x35')](function(_0x3d1be4){return db[_0xb8c8('0x36')][_0xb8c8('0x1a')](_0xdd39ad[_0xb8c8('0x1b')],{'raw':_0xdd39ad[_0xb8c8('0x7')]?_0xdd39ad['options'][_0xb8c8('0x16')]===undefined?!![]:![]:!![],'transaction':_0x3d1be4})[_0xb8c8('0xd')](function(){logger['info'](_0xb8c8('0x37'),JSON[_0xb8c8('0x18')](_0xdd39ad[_0xb8c8('0x7')][_0xb8c8('0x8')]),_0xdd39ad[_0xb8c8('0x7')][_0xb8c8('0x8')][_0xb8c8('0x1e')]);return db[_0xb8c8('0x14')][_0xb8c8('0x38')]({'where':_0xdd39ad[_0xb8c8('0x7')]?_0xdd39ad['options'][_0xb8c8('0x8')]||null:null,'transaction':_0x3d1be4});});})[_0xb8c8('0xd')](function(_0x3a29d5){logger[_0xb8c8('0xe')](_0xb8c8('0x34'),_0xdd39ad);logger[_0xb8c8('0xf')]('MoveContactManagedDialer',_0xdd39ad,JSON['stringify'](_0x3a29d5));_0x313c17(_0x3a29d5);})[_0xb8c8('0x10')](function(_0x3c6a30){logger[_0xb8c8('0x11')](_0xb8c8('0x34'),_0x3c6a30[_0xb8c8('0x12')],_0xdd39ad);_0x17f454(_0x10f426[_0xb8c8('0x11')](0x1f4,_0x3c6a30['message']));});});};exports['CountReScheduled']=function(_0x4a41bf){var _0x1687c9=this;return new Promise(function(_0x5692d2,_0x3369b3){return db[_0xb8c8('0x14')][_0xb8c8('0x6')]({'raw':_0x4a41bf[_0xb8c8('0x7')]?_0x4a41bf[_0xb8c8('0x7')][_0xb8c8('0x16')]===undefined?!![]:![]:!![],'where':_0x4a41bf[_0xb8c8('0x7')]?_0x4a41bf[_0xb8c8('0x7')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb8c8('0x23')][_0xb8c8('0x39')](_0xb8c8('0x3a')+util[_0xb8c8('0x3b')](_0xb8c8('0x3c'),moment()[_0xb8c8('0x3b')](_0xb8c8('0x3d')))+'\x20,\x201,\x20null'))),_0xb8c8('0x3e')]]})[_0xb8c8('0xd')](function(_0x4e32b9){logger['info']('CountReScheduled',_0x4a41bf);logger[_0xb8c8('0xf')](_0xb8c8('0x3f'),_0x4a41bf,JSON[_0xb8c8('0x18')](_0x4e32b9));_0x5692d2(_0x4e32b9);})[_0xb8c8('0x10')](function(_0xdd7eb7){logger['error'](_0xb8c8('0x3f'),_0xdd7eb7[_0xb8c8('0x12')],_0x4a41bf);_0x3369b3(_0x1687c9[_0xb8c8('0x11')](0x1f4,_0xdd7eb7['message']));});});};exports['GetContactRecallMe']=function(_0xc5bab2){var _0x3987d4=this;return new Promise(function(_0x5bb962,_0x5e130b){return db[_0xb8c8('0x21')]['describe']()['then'](function(){return db['sequelize']['transaction'](function(_0x5a28ba){return db['CmHopper'][_0xb8c8('0x6')]({'where':_0xc5bab2[_0xb8c8('0x7')]?_0xc5bab2[_0xb8c8('0x7')][_0xb8c8('0x8')]||null:null,'attributes':_0xc5bab2['options']?_0xc5bab2[_0xb8c8('0x7')]['attributes']||null:null,'limit':0x1,'order':_0xc5bab2[_0xb8c8('0x7')]?_0xc5bab2[_0xb8c8('0x7')][_0xb8c8('0x24')]||null:null,'group':db[_0xb8c8('0x14')][_0xb8c8('0x2c')],'transaction':_0x5a28ba,'lock':_0x5a28ba[_0xb8c8('0x25')][_0xb8c8('0x40')],'include':_0xc5bab2[_0xb8c8('0x7')]?_0xc5bab2[_0xb8c8('0x7')]['include']?_[_0xb8c8('0xc')](_0xc5bab2[_0xb8c8('0x7')][_0xb8c8('0xb')],function(_0x2324be){return{'model':db[_0x2324be[_0xb8c8('0x17')]],'as':_0x2324be['as'],'attributes':_0x2324be[_0xb8c8('0x9')],'include':_0x2324be[_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x2324be[_0xb8c8('0xb')],function(_0x2e88cc){return{'model':db[_0x2e88cc[_0xb8c8('0x17')]],'as':_0x2e88cc['as'],'attributes':_0x2e88cc[_0xb8c8('0x9')],'include':_0x2e88cc[_0xb8c8('0xb')]?_['map'](_0x2e88cc[_0xb8c8('0xb')],function(_0x2358f9){return{'model':db[_0x2358f9[_0xb8c8('0x17')]],'as':_0x2358f9['as'],'attributes':_0x2358f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb8c8('0xd')](function(_0x204b62){var _0x13f222=[];for(var _0xfa27b7=0x0;_0xfa27b7<_0x204b62[_0xb8c8('0x30')];_0xfa27b7+=0x1){_0x13f222[_0xb8c8('0x2d')](_0x204b62[_0xfa27b7][_0xb8c8('0x2e')](_0xc5bab2[_0xb8c8('0x1b')],{'transaction':_0x5a28ba}));}return BPromise[_0xb8c8('0x41')](_0x13f222);});})[_0xb8c8('0xd')](function(_0x997a74){logger[_0xb8c8('0xe')](_0xb8c8('0x42'),_0xc5bab2);logger[_0xb8c8('0xf')](_0xb8c8('0x42'),_0xc5bab2,JSON[_0xb8c8('0x18')](_0x997a74));_0x5bb962(_0x997a74);})['catch'](function(_0x2b2147){logger[_0xb8c8('0x11')](_0xb8c8('0x42'),_0x2b2147['message'],_0xc5bab2);_0x5e130b(_0x3987d4[_0xb8c8('0x11')](0x1f4,_0x2b2147[_0xb8c8('0x12')]));});});});};exports[_0xb8c8('0x43')]=function(_0x2a356c){var _0x11588c=this;return new Promise(function(_0x44ff8f,_0x1cf4af){db[_0xb8c8('0x21')][_0xb8c8('0x22')]()['then'](function(_0x363e20){return db[_0xb8c8('0x14')]['findAll']({'raw':_0x2a356c[_0xb8c8('0x7')]?_0x2a356c[_0xb8c8('0x7')][_0xb8c8('0x16')]===undefined?!![]:![]:!![],'where':_0x2a356c[_0xb8c8('0x7')]?_0x2a356c['options'][_0xb8c8('0x8')]||null:null,'attributes':_0x2a356c[_0xb8c8('0x7')]?_0x2a356c[_0xb8c8('0x7')][_0xb8c8('0x9')]||null:null,'limit':_0x2a356c[_0xb8c8('0x7')]?_0x2a356c[_0xb8c8('0x7')][_0xb8c8('0xa')]||null:null,'include':_0x2a356c['options']?_0x2a356c[_0xb8c8('0x7')]['include']?_[_0xb8c8('0xc')](_0x2a356c['options'][_0xb8c8('0xb')],function(_0x4c0517){return{'model':db[_0x4c0517[_0xb8c8('0x17')]],'as':_0x4c0517['as'],'attributes':_0x4c0517['as']===_0xb8c8('0x26')?_[_0xb8c8('0x27')](_0x363e20):_0x4c0517['attributes'],'include':_0x4c0517[_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x4c0517[_0xb8c8('0xb')],function(_0x16668a){return{'model':db[_0x16668a[_0xb8c8('0x17')]],'as':_0x16668a['as'],'attributes':_0x16668a[_0xb8c8('0x9')],'include':_0x16668a[_0xb8c8('0xb')]?_[_0xb8c8('0xc')](_0x16668a[_0xb8c8('0xb')],function(_0x43fb19){return{'model':db[_0x43fb19[_0xb8c8('0x17')]],'as':_0x43fb19['as'],'attributes':_0x43fb19[_0xb8c8('0x9')]};}):[]};}):[]};}):[]:[]})[_0xb8c8('0xd')](function(_0x58fb96){logger[_0xb8c8('0xe')]('GetCmHopper',_0x2a356c);logger['debug']('GetCmHopper',_0x2a356c,JSON[_0xb8c8('0x18')](_0x58fb96));_0x44ff8f(_0x58fb96);})[_0xb8c8('0x10')](function(_0x538882){logger['error'](_0xb8c8('0x5'),_0x538882[_0xb8c8('0x12')],_0x2a356c);_0x1cf4af(_0x11588c[_0xb8c8('0x11')](0x1f4,_0x538882[_0xb8c8('0x12')]));});});});};exports['GetContactByPhone']=function(_0x11830b){var _0x1ac893=this;return new Promise(function(_0x5ad94b,_0x329688){return db['CmContact'][_0xb8c8('0x44')]({'raw':!![],'where':{'phone':_0x11830b['options'][_0xb8c8('0x8')][_0xb8c8('0x45')]},'attributes':['id',_0xb8c8('0x46')],'order':[['id','DESC']]})[_0xb8c8('0xd')](function(_0x130974){logger[_0xb8c8('0xe')](_0xb8c8('0x47'),_0x11830b);logger[_0xb8c8('0xf')](_0xb8c8('0x47'),_0x11830b,JSON[_0xb8c8('0x18')](_0x130974));_0x5ad94b(_0x130974);})[_0xb8c8('0x10')](function(_0x2b258d){logger['error'](_0xb8c8('0x47'),_0x2b258d['message'],_0x11830b);_0x329688(_0x1ac893[_0xb8c8('0x11')](0x1f4,_0x2b258d['message']));});});};exports['ResetActiveCalls']=function(_0x207834){var _0x44ff40=this;return new Promise(function(_0x2d99ca,_0x11402f){return db[_0xb8c8('0x23')][_0xb8c8('0x35')](function(_0x336502){var _0x38e432=_0x207834['options']&&_0x207834[_0xb8c8('0x7')][_0xb8c8('0x8')]?_0x207834['options'][_0xb8c8('0x8')]:{};return db[_0xb8c8('0x14')][_0xb8c8('0x2e')](_0x207834[_0xb8c8('0x1b')],{'where':_0x38e432,'transaction':_0x336502})[_0xb8c8('0xd')](function(_0xf299ab){logger['info'](_0xb8c8('0x48'),_0x207834);logger[_0xb8c8('0xf')](_0xb8c8('0x48'),_0x207834,JSON[_0xb8c8('0x18')](_0xf299ab));_0x2d99ca(_0xf299ab);})[_0xb8c8('0x10')](function(_0x416bf9){logger[_0xb8c8('0x11')](_0xb8c8('0x48'),_0x416bf9[_0xb8c8('0x12')],_0x207834);_0x11402f(_0x44ff40[_0xb8c8('0x11')](0x1f4,_0x416bf9['message']));});});});};exports[_0xb8c8('0x49')]=function(_0x2213e7){var _0x93083f=this;var _0x6f662f=_0x2213e7[_0xb8c8('0x1b')][_0xb8c8('0x8')]['voiceQueueIds'];var _0x19e245=_0x2213e7[_0xb8c8('0x1b')]['where'][_0xb8c8('0x4a')];var _0xaee025=_0x2213e7[_0xb8c8('0x1b')][_0xb8c8('0x8')]['availableAgentsIds'];return new Promise(function(_0x278868,_0x187506){return db[_0xb8c8('0x14')][_0xb8c8('0x6')]({'where':{'voiceQueueId':{'$in':_0x6f662f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb8c8('0x23')][_0xb8c8('0x39')]('NOW()\x20+\x20INTERVAL\x20'+_0x19e245+_0xb8c8('0x4b')),'$gt':db[_0xb8c8('0x23')][_0xb8c8('0x39')](_0xb8c8('0x4c'))}},'UserId':{'$in':_0xaee025}},'include':[{'model':db[_0xb8c8('0x21')],'as':_0xb8c8('0x26')},{'model':db[_0xb8c8('0x28')],'as':_0xb8c8('0x29'),'attributes':['id','name','voicePause']},{'model':db[_0xb8c8('0x4d')],'as':'List'}]})['then'](function(_0x2acd1c){if(_0x2acd1c[_0xb8c8('0x30')]>0x0){return db[_0xb8c8('0x23')][_0xb8c8('0x35')](function(_0x46ad7e){return db[_0xb8c8('0x14')][_0xb8c8('0x2e')]({'recallmeNotifiedDate':db[_0xb8c8('0x23')][_0xb8c8('0x39')](_0xb8c8('0x4c'))},{'where':{'id':{'$in':_['map'](_0x2acd1c,'id')}},'transaction':_0x46ad7e})[_0xb8c8('0xd')](function(){_0x278868(_0x2acd1c);})['catch'](function(_0x39527d){logger[_0xb8c8('0x11')]('CmHopperHandlePreviewRecallNotifications',_0x39527d[_0xb8c8('0x12')],_0x2213e7);_0x187506(_0x93083f['error'](0x1f4,_0x39527d['message']));});})[_0xb8c8('0x10')](function(_0x518ffd){logger[_0xb8c8('0x11')](_0xb8c8('0x49'),_0x518ffd['message'],_0x2213e7);_0x187506(_0x93083f['error'](0x1f4,_0x518ffd[_0xb8c8('0x12')]));});}else{_0x278868(_0x2acd1c);}});});}; \ No newline at end of file +var _0xc3b1=['update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','findAll','order','LOCK','UPDATE','Contact','keys','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','GetCmHopperPreview','GetContactByPhone','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','name','List','NOW()','lodash','util','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','info','stringify','catch','error','message','find','ShowCmHopper','debug','CreateCmHopper','create','body','UpdateCmHopper'];(function(_0x3afa8a,_0x5f565e){var _0x434238=function(_0xe2bbdc){while(--_0xe2bbdc){_0x3afa8a['push'](_0x3afa8a['shift']());}};_0x434238(++_0x5f565e);}(_0xc3b1,0xcb));var _0x1c3b=function(_0x191216,_0x4027ea){_0x191216=_0x191216-0x0;var _0x17832e=_0xc3b1[_0x191216];return _0x17832e;};'use strict';var _=require(_0x1c3b('0x0'));var util=require(_0x1c3b('0x1'));var moment=require('moment');var BPromise=require(_0x1c3b('0x2'));var db=require(_0x1c3b('0x3'))['db'];var logger=require('../../config/logger')(_0x1c3b('0x4'));exports[_0x1c3b('0x5')]=function(_0x27f16c){var _0x1dfe54=this;return new Promise(function(_0x5ba226,_0x5f9d31){return db[_0x1c3b('0x6')]['findAll']({'raw':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c['options'][_0x1c3b('0x9')]||null:null,'attributes':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':_0x27f16c['options']?_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xb')]||null:null,'include':_0x27f16c['options']?_0x27f16c['options']['include']?_[_0x1c3b('0xc')](_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xd')],function(_0xe0b0bf){return{'model':db[_0xe0b0bf[_0x1c3b('0xe')]],'as':_0xe0b0bf['as'],'attributes':_0xe0b0bf[_0x1c3b('0xa')],'include':_0xe0b0bf['include']?_[_0x1c3b('0xc')](_0xe0b0bf[_0x1c3b('0xd')],function(_0x570b85){return{'model':db[_0x570b85[_0x1c3b('0xe')]],'as':_0x570b85['as'],'attributes':_0x570b85['attributes'],'include':_0x570b85[_0x1c3b('0xd')]?_['map'](_0x570b85['include'],function(_0x1dc402){return{'model':db[_0x1dc402[_0x1c3b('0xe')]],'as':_0x1dc402['as'],'attributes':_0x1dc402[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x380930){logger[_0x1c3b('0x10')]('GetCmHopper',_0x27f16c);logger['debug'](_0x1c3b('0x5'),_0x27f16c,JSON[_0x1c3b('0x11')](_0x380930));_0x5ba226(_0x380930);})[_0x1c3b('0x12')](function(_0x9129e0){logger[_0x1c3b('0x13')](_0x1c3b('0x5'),_0x9129e0[_0x1c3b('0x14')],_0x27f16c);_0x5f9d31(_0x1dfe54['error'](0x1f4,_0x9129e0[_0x1c3b('0x14')]));});});};exports['ShowCmHopper']=function(_0xe622c){var _0x4305ff=this;return new Promise(function(_0x41136e,_0xd0d9c1){return db[_0x1c3b('0x6')][_0x1c3b('0x15')]({'raw':_0xe622c[_0x1c3b('0x7')]?_0xe622c[_0x1c3b('0x7')][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0xe622c['options']?_0xe622c[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0xe622c[_0x1c3b('0x7')]?_0xe622c['options'][_0x1c3b('0xa')]||null:null,'include':_0xe622c[_0x1c3b('0x7')]?_0xe622c['options'][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0xe622c[_0x1c3b('0x7')][_0x1c3b('0xd')],function(_0x182fd7){return{'model':db[_0x182fd7[_0x1c3b('0xe')]],'as':_0x182fd7['as'],'attributes':_0x182fd7[_0x1c3b('0xa')],'include':_0x182fd7[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x182fd7[_0x1c3b('0xd')],function(_0x5da1f8){return{'model':db[_0x5da1f8[_0x1c3b('0xe')]],'as':_0x5da1f8['as'],'attributes':_0x5da1f8['attributes'],'include':_0x5da1f8[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x5da1f8[_0x1c3b('0xd')],function(_0x1588b1){return{'model':db[_0x1588b1[_0x1c3b('0xe')]],'as':_0x1588b1['as'],'attributes':_0x1588b1[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x14c8f3){logger['info'](_0x1c3b('0x16'),_0xe622c);logger[_0x1c3b('0x17')]('ShowCmHopper',_0xe622c,JSON[_0x1c3b('0x11')](_0x14c8f3));_0x41136e(_0x14c8f3);})[_0x1c3b('0x12')](function(_0x551764){logger[_0x1c3b('0x13')](_0x1c3b('0x16'),_0x551764['message'],_0xe622c);_0xd0d9c1(_0x4305ff[_0x1c3b('0x13')](0x1f4,_0x551764[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x18')]=function(_0x435be8){var _0x1b8239=this;return new Promise(function(_0x393513,_0x37918b){return db['CmHopper'][_0x1c3b('0x19')](_0x435be8[_0x1c3b('0x1a')],{'raw':_0x435be8[_0x1c3b('0x7')]?_0x435be8['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![]})[_0x1c3b('0xf')](function(_0x5997af){logger[_0x1c3b('0x10')]('CreateCmHopper',_0x435be8);logger[_0x1c3b('0x17')]('CreateCmHopper',_0x435be8,JSON['stringify'](_0x5997af));_0x393513(_0x5997af);})[_0x1c3b('0x12')](function(_0x1e1dc4){logger['error'](_0x1c3b('0x18'),_0x1e1dc4['message'],_0x435be8);_0x37918b(_0x1b8239[_0x1c3b('0x13')](0x1f4,_0x1e1dc4['message']));});});};exports[_0x1c3b('0x1b')]=function(_0x420f80){var _0x500d95=this;return new Promise(function(_0x21d62d,_0x2c73eb){return db[_0x1c3b('0x6')][_0x1c3b('0x1c')](_0x420f80[_0x1c3b('0x1a')],{'raw':_0x420f80[_0x1c3b('0x7')]?_0x420f80['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420f80[_0x1c3b('0x7')]?_0x420f80[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x420f80[_0x1c3b('0x7')]?_0x420f80[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':_0x420f80[_0x1c3b('0x7')]?_0x420f80['options'][_0x1c3b('0xb')]||null:null})[_0x1c3b('0xf')](function(_0x514905){logger[_0x1c3b('0x10')](_0x1c3b('0x1b'),_0x420f80);logger['info'](_0x1c3b('0x1d'),JSON[_0x1c3b('0x11')](_0x420f80[_0x1c3b('0x7')]['where']),_0x420f80[_0x1c3b('0x1a')][_0x1c3b('0x1e')]);logger[_0x1c3b('0x17')](_0x1c3b('0x1b'),_0x420f80,JSON[_0x1c3b('0x11')](_0x514905));_0x21d62d(_0x514905);})[_0x1c3b('0x12')](function(_0x255a00){logger[_0x1c3b('0x13')](_0x1c3b('0x1b'),_0x255a00[_0x1c3b('0x14')],_0x420f80);_0x2c73eb(_0x500d95[_0x1c3b('0x13')](0x1f4,_0x255a00['message']));});});};exports[_0x1c3b('0x1f')]=function(_0x26ed76){var _0x480371=this;return new Promise(function(_0x4c98fb,_0xa5bcf4){return db[_0x1c3b('0x6')][_0x1c3b('0x20')]({'where':_0x26ed76['options']?_0x26ed76[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null})[_0x1c3b('0xf')](function(_0x3d83a3){logger[_0x1c3b('0x10')](_0x1c3b('0x1f'),_0x26ed76);logger['debug'](_0x1c3b('0x1f'),_0x26ed76,JSON[_0x1c3b('0x11')](_0x3d83a3));_0x4c98fb(_0x3d83a3);})[_0x1c3b('0x12')](function(_0x5693b4){logger['error'](_0x1c3b('0x1f'),_0x5693b4['message'],_0x26ed76);_0xa5bcf4(_0x480371['error'](0x1f4,_0x5693b4[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x21')]=function(_0x2ed742){var _0x39c239=this;return new Promise(function(_0x14b478,_0x4ff5d8){return db[_0x1c3b('0x22')]['describe']()['then'](function(_0x5193a0){return db['sequelize']['transaction'](function(_0x12746a){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'where':_0x2ed742['options']?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x2ed742[_0x1c3b('0x7')]?_0x2ed742['options']['attributes']||null:null,'limit':_0x2ed742[_0x1c3b('0x7')]?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0xb')]||null:null,'order':_0x2ed742['options']?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0x24')]||null:null,'transaction':_0x12746a,'lock':_0x12746a[_0x1c3b('0x25')][_0x1c3b('0x26')],'include':[{'model':db[_0x1c3b('0x22')],'as':_0x1c3b('0x27'),'attributes':_[_0x1c3b('0x28')](_0x5193a0)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x1c3b('0x29')]}]})[_0x1c3b('0xf')](function(_0x2ba3e1){var _0xbea2c5=[];var _0x45216f=[];for(var _0x598345=0x0;_0x598345<_0x2ba3e1[_0x1c3b('0x2a')];_0x598345+=0x1){var _0x197d1c=_0x2ba3e1[_0x598345][_0x1c3b('0x2b')];if(_0x197d1c===null){_0xbea2c5[_0x1c3b('0x2c')](_0x2ba3e1[_0x598345][_0x1c3b('0x1c')](_0x2ed742[_0x1c3b('0x1a')],{'transaction':_0x12746a}));}else if(!_0x45216f[_0x1c3b('0x2d')](_0x197d1c)){_0x45216f[_0x1c3b('0x2c')](_0x197d1c);_0xbea2c5['push'](_0x2ba3e1[_0x598345]['update'](_0x2ed742['body'],{'transaction':_0x12746a}));}}return BPromise[_0x1c3b('0x2e')](_0xbea2c5);});})[_0x1c3b('0xf')](function(_0x54fda9){logger[_0x1c3b('0x10')](_0x1c3b('0x21'),_0x2ed742);if(_0x54fda9[_0x1c3b('0x2a')]>0x0){logger[_0x1c3b('0x10')](_0x1c3b('0x2f'),_0x54fda9[0x0]['dataValues']['id'],_0x54fda9[0x0][_0x1c3b('0x30')]['ContactId'],_0x54fda9[0x0][_0x1c3b('0x30')][_0x1c3b('0x1e')]);}logger[_0x1c3b('0x17')]('GetContactDialer',_0x2ed742,JSON['stringify'](_0x54fda9));_0x14b478(_0x54fda9);})[_0x1c3b('0x12')](function(_0x3eb6ce){logger[_0x1c3b('0x13')](_0x1c3b('0x21'),_0x3eb6ce[_0x1c3b('0x14')],_0x2ed742);_0x4ff5d8(_0x39c239[_0x1c3b('0x13')](0x1f4,_0x3eb6ce['message']));});});});};exports[_0x1c3b('0x31')]=function(_0x267517){var _0x50b26e=this;return new Promise(function(_0x576a7d,_0x1aa011){return db['sequelize'][_0x1c3b('0x32')](function(_0xb25adb){return db[_0x1c3b('0x33')][_0x1c3b('0x19')](_0x267517[_0x1c3b('0x1a')],{'raw':_0x267517[_0x1c3b('0x7')]?_0x267517['options']['raw']===undefined?!![]:![]:!![],'transaction':_0xb25adb})[_0x1c3b('0xf')](function(){logger['info'](_0x1c3b('0x34'),JSON[_0x1c3b('0x11')](_0x267517[_0x1c3b('0x7')]['where']),_0x267517[_0x1c3b('0x7')][_0x1c3b('0x9')][_0x1c3b('0x1e')]);return db['CmHopper']['destroy']({'where':_0x267517['options']?_0x267517[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'transaction':_0xb25adb});});})[_0x1c3b('0xf')](function(_0x283432){logger[_0x1c3b('0x10')]('MoveContactManagedDialer',_0x267517);logger[_0x1c3b('0x17')](_0x1c3b('0x31'),_0x267517,JSON['stringify'](_0x283432));_0x576a7d(_0x283432);})[_0x1c3b('0x12')](function(_0x4df5b7){logger[_0x1c3b('0x13')]('MoveContactManagedDialer',_0x4df5b7['message'],_0x267517);_0x1aa011(_0x50b26e[_0x1c3b('0x13')](0x1f4,_0x4df5b7['message']));});});};exports['CountReScheduled']=function(_0x44cf6b){var _0x68685e=this;return new Promise(function(_0x314eec,_0xd3901e){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'raw':_0x44cf6b['options']?_0x44cf6b['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x44cf6b[_0x1c3b('0x7')]?_0x44cf6b[_0x1c3b('0x7')]['where']||null:null,'attributes':[[db[_0x1c3b('0x35')]['fn']('COUNT',db[_0x1c3b('0x35')]['fn']('IF',db[_0x1c3b('0x35')][_0x1c3b('0x36')](_0x1c3b('0x37')+util[_0x1c3b('0x38')](_0x1c3b('0x39'),moment()[_0x1c3b('0x38')](_0x1c3b('0x3a')))+'\x20,\x201,\x20null'))),_0x1c3b('0x3b')]]})[_0x1c3b('0xf')](function(_0x23d44a){logger['info'](_0x1c3b('0x3c'),_0x44cf6b);logger[_0x1c3b('0x17')]('CountReScheduled',_0x44cf6b,JSON['stringify'](_0x23d44a));_0x314eec(_0x23d44a);})[_0x1c3b('0x12')](function(_0x5b39b0){logger['error'](_0x1c3b('0x3c'),_0x5b39b0[_0x1c3b('0x14')],_0x44cf6b);_0xd3901e(_0x68685e[_0x1c3b('0x13')](0x1f4,_0x5b39b0[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x3d')]=function(_0x24ec4e){var _0x589777=this;return new Promise(function(_0x8713ca,_0x317a2f){return db[_0x1c3b('0x22')][_0x1c3b('0x3e')]()[_0x1c3b('0xf')](function(){return db[_0x1c3b('0x35')]['transaction'](function(_0x20181e){return db[_0x1c3b('0x6')]['findAll']({'where':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':0x1,'order':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e['options']['order']||null:null,'group':db['CmHopper'][_0x1c3b('0x2b')],'transaction':_0x20181e,'lock':_0x20181e[_0x1c3b('0x25')][_0x1c3b('0x26')],'include':_0x24ec4e['options']?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x24ec4e[_0x1c3b('0x7')]['include'],function(_0x2c651f){return{'model':db[_0x2c651f[_0x1c3b('0xe')]],'as':_0x2c651f['as'],'attributes':_0x2c651f[_0x1c3b('0xa')],'include':_0x2c651f[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x2c651f['include'],function(_0x1928e6){return{'model':db[_0x1928e6['model']],'as':_0x1928e6['as'],'attributes':_0x1928e6['attributes'],'include':_0x1928e6[_0x1c3b('0xd')]?_['map'](_0x1928e6[_0x1c3b('0xd')],function(_0x5ecb88){return{'model':db[_0x5ecb88[_0x1c3b('0xe')]],'as':_0x5ecb88['as'],'attributes':_0x5ecb88[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x27c738){var _0x58d665=[];for(var _0xcbbbd4=0x0;_0xcbbbd4<_0x27c738['length'];_0xcbbbd4+=0x1){_0x58d665[_0x1c3b('0x2c')](_0x27c738[_0xcbbbd4][_0x1c3b('0x1c')](_0x24ec4e[_0x1c3b('0x1a')],{'transaction':_0x20181e}));}return BPromise['all'](_0x58d665);});})[_0x1c3b('0xf')](function(_0x5b4c0e){logger['info'](_0x1c3b('0x3d'),_0x24ec4e);logger[_0x1c3b('0x17')](_0x1c3b('0x3d'),_0x24ec4e,JSON['stringify'](_0x5b4c0e));_0x8713ca(_0x5b4c0e);})[_0x1c3b('0x12')](function(_0x420be8){logger[_0x1c3b('0x13')](_0x1c3b('0x3d'),_0x420be8[_0x1c3b('0x14')],_0x24ec4e);_0x317a2f(_0x589777[_0x1c3b('0x13')](0x1f4,_0x420be8[_0x1c3b('0x14')]));});});});};exports[_0x1c3b('0x3f')]=function(_0x3cada3){var _0x2b4a5f=this;return new Promise(function(_0x46b03a,_0x154195){db[_0x1c3b('0x22')][_0x1c3b('0x3e')]()[_0x1c3b('0xf')](function(_0x42c977){return db['CmHopper'][_0x1c3b('0x23')]({'raw':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x3cada3['options']?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')]['attributes']||null:null,'limit':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3['options'][_0x1c3b('0xb')]||null:null,'include':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x3cada3['options']['include'],function(_0x3f0904){return{'model':db[_0x3f0904['model']],'as':_0x3f0904['as'],'attributes':_0x3f0904['as']==='Contact'?_[_0x1c3b('0x28')](_0x42c977):_0x3f0904['attributes'],'include':_0x3f0904[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x3f0904['include'],function(_0x4788e0){return{'model':db[_0x4788e0[_0x1c3b('0xe')]],'as':_0x4788e0['as'],'attributes':_0x4788e0[_0x1c3b('0xa')],'include':_0x4788e0[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x4788e0[_0x1c3b('0xd')],function(_0x4bdb34){return{'model':db[_0x4bdb34['model']],'as':_0x4bdb34['as'],'attributes':_0x4bdb34[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0xa77b31){logger[_0x1c3b('0x10')]('GetCmHopper',_0x3cada3);logger[_0x1c3b('0x17')](_0x1c3b('0x5'),_0x3cada3,JSON[_0x1c3b('0x11')](_0xa77b31));_0x46b03a(_0xa77b31);})[_0x1c3b('0x12')](function(_0x1f615d){logger[_0x1c3b('0x13')](_0x1c3b('0x5'),_0x1f615d[_0x1c3b('0x14')],_0x3cada3);_0x154195(_0x2b4a5f[_0x1c3b('0x13')](0x1f4,_0x1f615d['message']));});});});};exports[_0x1c3b('0x40')]=function(_0x236c33){var _0x3fb928=this;return new Promise(function(_0x4ddf3f,_0x173e1a){return db[_0x1c3b('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x236c33[_0x1c3b('0x7')][_0x1c3b('0x9')][_0x1c3b('0x41')]},'attributes':['id','dialTimezone'],'order':[['id',_0x1c3b('0x42')]]})[_0x1c3b('0xf')](function(_0x23fbf5){logger[_0x1c3b('0x10')](_0x1c3b('0x43'),_0x236c33);logger[_0x1c3b('0x17')](_0x1c3b('0x43'),_0x236c33,JSON[_0x1c3b('0x11')](_0x23fbf5));_0x4ddf3f(_0x23fbf5);})['catch'](function(_0x2f5609){logger[_0x1c3b('0x13')](_0x1c3b('0x43'),_0x2f5609[_0x1c3b('0x14')],_0x236c33);_0x173e1a(_0x3fb928[_0x1c3b('0x13')](0x1f4,_0x2f5609['message']));});});};exports['ResetActiveCalls']=function(_0x544855){var _0x2d9261=this;return new Promise(function(_0x4d1f6c,_0x17db3e){return db[_0x1c3b('0x35')][_0x1c3b('0x32')](function(_0x3a09ed){var _0x45eeae=_0x544855[_0x1c3b('0x7')]&&_0x544855[_0x1c3b('0x7')]['where']?_0x544855['options'][_0x1c3b('0x9')]:{};return db[_0x1c3b('0x6')][_0x1c3b('0x1c')](_0x544855['body'],{'where':_0x45eeae,'transaction':_0x3a09ed})[_0x1c3b('0xf')](function(_0x56afc0){logger[_0x1c3b('0x10')](_0x1c3b('0x44'),_0x544855);logger['debug']('ResetActiveCalls',_0x544855,JSON['stringify'](_0x56afc0));_0x4d1f6c(_0x56afc0);})[_0x1c3b('0x12')](function(_0x221bc4){logger[_0x1c3b('0x13')](_0x1c3b('0x44'),_0x221bc4[_0x1c3b('0x14')],_0x544855);_0x17db3e(_0x2d9261[_0x1c3b('0x13')](0x1f4,_0x221bc4[_0x1c3b('0x14')]));});});});};exports[_0x1c3b('0x45')]=function(_0x18bb0f){var _0x37c23c=this;var _0x5bea42=_0x18bb0f[_0x1c3b('0x1a')]['where'][_0x1c3b('0x46')];var _0x3a90d6=_0x18bb0f[_0x1c3b('0x1a')][_0x1c3b('0x9')][_0x1c3b('0x47')];var _0x1ccca8=_0x18bb0f[_0x1c3b('0x1a')][_0x1c3b('0x9')][_0x1c3b('0x48')];return new Promise(function(_0x473a82,_0x169362){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'where':{'voiceQueueId':{'$in':_0x5bea42},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x3a90d6+_0x1c3b('0x49')),'$gt':db[_0x1c3b('0x35')][_0x1c3b('0x36')]('NOW()')}},'UserId':{'$in':_0x1ccca8}},'include':[{'model':db[_0x1c3b('0x22')],'as':_0x1c3b('0x27')},{'model':db['User'],'as':'Agent','attributes':['id',_0x1c3b('0x4a'),_0x1c3b('0x29')]},{'model':db['CmList'],'as':_0x1c3b('0x4b')}]})['then'](function(_0x45a46a){if(_0x45a46a['length']>0x0){return db[_0x1c3b('0x35')][_0x1c3b('0x32')](function(_0x4d85ef){return db[_0x1c3b('0x6')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x1c3b('0x36')](_0x1c3b('0x4c'))},{'where':{'id':{'$in':_['map'](_0x45a46a,'id')}},'transaction':_0x4d85ef})['then'](function(){_0x473a82(_0x45a46a);})[_0x1c3b('0x12')](function(_0x1a9482){logger[_0x1c3b('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x1a9482[_0x1c3b('0x14')],_0x18bb0f);_0x169362(_0x37c23c[_0x1c3b('0x13')](0x1f4,_0x1a9482[_0x1c3b('0x14')]));});})[_0x1c3b('0x12')](function(_0x51c5a5){logger[_0x1c3b('0x13')](_0x1c3b('0x45'),_0x51c5a5[_0x1c3b('0x14')],_0x18bb0f);_0x169362(_0x37c23c[_0x1c3b('0x13')](0x1f4,_0x51c5a5['message']));});}else{_0x473a82(_0x45a46a);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d3a436d..41d4fb2 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 _0x3f73=['post','create','/preview','getPreview','getTimezone','put','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/:id','show','/:id/previewrecall','getPreviewRecall'];(function(_0x4b8bbc,_0x2cc1d2){var _0x4e0ed0=function(_0x3fce96){while(--_0x3fce96){_0x4b8bbc['push'](_0x4b8bbc['shift']());}};_0x4e0ed0(++_0x2cc1d2);}(_0x3f73,0x87));var _0x33f7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f73[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x33f7('0x0'));var controller=require(_0x33f7('0x1'));router[_0x33f7('0x2')]('/',auth[_0x33f7('0x3')](),controller['index']);router['get'](_0x33f7('0x4'),auth[_0x33f7('0x3')](),controller[_0x33f7('0x5')]);router[_0x33f7('0x2')](_0x33f7('0x6'),auth[_0x33f7('0x3')](),controller[_0x33f7('0x7')]);router[_0x33f7('0x2')]('/timezones',auth[_0x33f7('0x3')](),controller['getTimezones']);router['get'](_0x33f7('0x8'),auth[_0x33f7('0x3')](),controller[_0x33f7('0x9')]);router[_0x33f7('0x2')](_0x33f7('0xa'),auth[_0x33f7('0x3')](),controller[_0x33f7('0xb')]);router[_0x33f7('0xc')]('/',auth[_0x33f7('0x3')](),controller[_0x33f7('0xd')]);router['post'](_0x33f7('0xe'),auth[_0x33f7('0x3')](),controller[_0x33f7('0xf')]);router[_0x33f7('0xc')]('/timezone',auth[_0x33f7('0x3')](),controller[_0x33f7('0x10')]);router[_0x33f7('0x11')](_0x33f7('0x8'),auth[_0x33f7('0x3')](),controller['update']);router[_0x33f7('0x12')](_0x33f7('0x8'),auth[_0x33f7('0x3')](),controller[_0x33f7('0x13')]);module[_0x33f7('0x14')]=router; \ No newline at end of file +var _0x9f20=['/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x18fec8,_0x31d0cd){var _0x5e400c=function(_0x1f3bc0){while(--_0x1f3bc0){_0x18fec8['push'](_0x18fec8['shift']());}};_0x5e400c(++_0x31d0cd);}(_0x9f20,0x17f));var _0x09f2=function(_0x2c22b5,_0x4e38a2){_0x2c22b5=_0x2c22b5-0x0;var _0x1728eb=_0x9f20[_0x2c22b5];return _0x1728eb;};'use strict';var express=require(_0x09f2('0x0'));var router=express[_0x09f2('0x1')]();var auth=require(_0x09f2('0x2'));var controller=require(_0x09f2('0x3'));router[_0x09f2('0x4')]('/',auth[_0x09f2('0x5')](),controller[_0x09f2('0x6')]);router[_0x09f2('0x4')](_0x09f2('0x7'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x8')]);router['get'](_0x09f2('0x9'),auth[_0x09f2('0x5')](),controller[_0x09f2('0xa')]);router[_0x09f2('0x4')](_0x09f2('0xb'),auth[_0x09f2('0x5')](),controller['getTimezones']);router['get'](_0x09f2('0xc'),auth['isAuthenticated'](),controller[_0x09f2('0xd')]);router[_0x09f2('0x4')](_0x09f2('0xe'),auth[_0x09f2('0x5')](),controller[_0x09f2('0xf')]);router[_0x09f2('0x10')]('/',auth[_0x09f2('0x5')](),controller[_0x09f2('0x11')]);router['post'](_0x09f2('0x12'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x13')]);router[_0x09f2('0x10')](_0x09f2('0x14'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x15')]);router[_0x09f2('0x16')]('/:id',auth[_0x09f2('0x5')](),controller['update']);router[_0x09f2('0x17')](_0x09f2('0xc'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x18')]);module[_0x09f2('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index a8c0f19..0bc6245 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 _0x0e65=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5de58a,_0x23d58e){var _0x589a6d=function(_0x4069ec){while(--_0x4069ec){_0x5de58a['push'](_0x5de58a['shift']());}};_0x589a6d(++_0x23d58e);}(_0x0e65,0x1cf));var _0x50e6=function(_0x5a495f,_0x90083e){_0x5a495f=_0x5a495f-0x0;var _0x11e7bc=_0x0e65[_0x5a495f];return _0x11e7bc;};'use strict';var moment=require('moment');var Sequelize=require(_0x50e6('0x0'));module[_0x50e6('0x1')]={'CmHopperId':{'type':Sequelize[_0x50e6('0x2')]},'phone':{'type':Sequelize[_0x50e6('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x50e6('0x4')],'defaultValue':moment()['format'](_0x50e6('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x50e6('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x50e6('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x50e6('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x50e6('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x50e6('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x720f=['STRING','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x720f,0xda));var _0xf720=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x720f[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0xf720('0x0'));var Sequelize=require(_0xf720('0x1'));module[_0xf720('0x2')]={'CmHopperId':{'type':Sequelize[_0xf720('0x3')]},'phone':{'type':Sequelize[_0xf720('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xf720('0x5'))},'countbusyretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf720('0x3')],'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 7845311..e2a6d15 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 _0xa7b4=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','params','keys','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4771ae,_0x1a89b6){var _0x5bdce1=function(_0x975c1c){while(--_0x975c1c){_0x4771ae['push'](_0x4771ae['shift']());}};_0x5bdce1(++_0x1a89b6);}(_0xa7b4,0x187));var _0x4a7b=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xa7b4[_0x13606d];return _0x1b85b0;};'use strict';var emlformat=require(_0x4a7b('0x0'));var rimraf=require(_0x4a7b('0x1'));var zipdir=require(_0x4a7b('0x2'));var jsonpatch=require(_0x4a7b('0x3'));var rp=require(_0x4a7b('0x4'));var moment=require(_0x4a7b('0x5'));var BPromise=require(_0x4a7b('0x6'));var Mustache=require(_0x4a7b('0x7'));var util=require(_0x4a7b('0x8'));var path=require(_0x4a7b('0x9'));var sox=require('sox');var csv=require(_0x4a7b('0xa'));var ejs=require(_0x4a7b('0xb'));var fs=require('fs');var fs_extra=require(_0x4a7b('0xc'));var _=require('lodash');var squel=require(_0x4a7b('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a7b('0xe'));var deskjs=require(_0x4a7b('0xf'));var toCsv=require(_0x4a7b('0xa'));var querystring=require(_0x4a7b('0x10'));var Papa=require(_0x4a7b('0x11'));var Redis=require(_0x4a7b('0x12'));var authService=require(_0x4a7b('0x13'));var qs=require(_0x4a7b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a7b('0x15'));var logger=require(_0x4a7b('0x16'))(_0x4a7b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a7b('0x18'));var db=require(_0x4a7b('0x19'))['db'];function respondWithStatusCode(_0x4c4d3a,_0x4b7aa4){_0x4b7aa4=_0x4b7aa4||0xcc;return function(_0x1318fb){if(_0x1318fb){return _0x4c4d3a[_0x4a7b('0x1a')](_0x4b7aa4);}return _0x4c4d3a['status'](_0x4b7aa4)['end']();};}function respondWithResult(_0xe7b6a4,_0x3a4cb3){_0x3a4cb3=_0x3a4cb3||0xc8;return function(_0x3ff0db){if(_0x3ff0db){return _0xe7b6a4[_0x4a7b('0x1b')](_0x3a4cb3)['json'](_0x3ff0db);}};}function respondWithFilteredResult(_0x519f1c,_0x421c17){return function(_0x2cdb52){if(_0x2cdb52){var _0x5937d0=typeof _0x421c17[_0x4a7b('0x1c')]===_0x4a7b('0x1d')&&typeof _0x421c17['limit']===_0x4a7b('0x1d');var _0x42d526=_0x2cdb52[_0x4a7b('0x1e')];var _0x50d904=_0x5937d0?0x0:_0x421c17[_0x4a7b('0x1c')];var _0x33dded=_0x5937d0?_0x2cdb52[_0x4a7b('0x1e')]:_0x421c17['offset']+_0x421c17['limit'];var _0x531715;if(_0x33dded>=_0x42d526){_0x33dded=_0x42d526;_0x531715=0xc8;}else{_0x531715=0xce;}_0x519f1c[_0x4a7b('0x1b')](_0x531715);return _0x519f1c[_0x4a7b('0x1f')](_0x4a7b('0x20'),_0x50d904+'-'+_0x33dded+'/'+_0x42d526)['json'](_0x2cdb52);}return null;};}function patchUpdates(_0xd1a4b5){return function(_0x1e65fb){try{jsonpatch[_0x4a7b('0x21')](_0x1e65fb,_0xd1a4b5,!![]);}catch(_0x27060f){return BPromise[_0x4a7b('0x22')](_0x27060f);}return _0x1e65fb[_0x4a7b('0x23')]();};}function saveUpdates(_0xf0546b,_0x1b6541){return function(_0x3a18d8){if(_0x3a18d8){return _0x3a18d8[_0x4a7b('0x24')](_0xf0546b)[_0x4a7b('0x25')](function(_0x3be006){return _0x3be006;});}return null;};}function removeEntity(_0x3f4fab,_0x354d6f){return function(_0x3bd6a7){if(_0x3bd6a7){return _0x3bd6a7[_0x4a7b('0x26')]()[_0x4a7b('0x25')](function(){var _0x3b924c=_0x3bd6a7[_0x4a7b('0x27')]({'plain':!![]});var _0x3bf711='CmHopperAdditionalPhones';return db[_0x4a7b('0x28')][_0x4a7b('0x26')]({'where':{'type':_0x3bf711,'resourceId':_0x3b924c['id']}})[_0x4a7b('0x25')](function(){return _0x3bd6a7;});})[_0x4a7b('0x25')](function(){_0x3f4fab[_0x4a7b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4822c7,_0x34426f){return function(_0x567a78){if(!_0x567a78){_0x4822c7[_0x4a7b('0x1a')](0x194);}return _0x567a78;};}function handleError(_0x2a73e4,_0x1c2c55){_0x1c2c55=_0x1c2c55||0x1f4;return function(_0x25915b){logger[_0x4a7b('0x29')](_0x25915b['stack']);if(_0x25915b[_0x4a7b('0x2a')]){delete _0x25915b[_0x4a7b('0x2a')];}_0x2a73e4[_0x4a7b('0x1b')](_0x1c2c55)['send'](_0x25915b);};}exports[_0x4a7b('0x2b')]=function(_0x5810a7,_0xf7f33d){var _0x26bb56={},_0x31bcdb={},_0x4863ba={'count':0x0,'rows':[]};var _0x319755=_[_0x4a7b('0x2c')](db[_0x4a7b('0x2d')][_0x4a7b('0x2e')],function(_0x17c170){return{'name':_0x17c170[_0x4a7b('0x2f')],'type':_0x17c170['type']['key']};});_0x31bcdb[_0x4a7b('0x30')]=_[_0x4a7b('0x2c')](_0x319755,_0x4a7b('0x2a'));_0x31bcdb[_0x4a7b('0x31')]=_['keys'](_0x5810a7[_0x4a7b('0x31')]);_0x31bcdb[_0x4a7b('0x32')]=_[_0x4a7b('0x33')](_0x31bcdb[_0x4a7b('0x30')],_0x31bcdb[_0x4a7b('0x31')]);_0x26bb56[_0x4a7b('0x34')]=_[_0x4a7b('0x33')](_0x31bcdb[_0x4a7b('0x30')],qs[_0x4a7b('0x35')](_0x5810a7[_0x4a7b('0x31')]['fields']));_0x26bb56[_0x4a7b('0x34')]=_0x26bb56[_0x4a7b('0x34')][_0x4a7b('0x36')]?_0x26bb56[_0x4a7b('0x34')]:_0x31bcdb[_0x4a7b('0x30')];if(!_0x5810a7[_0x4a7b('0x31')][_0x4a7b('0x37')](_0x4a7b('0x38'))){_0x26bb56['limit']=qs[_0x4a7b('0x39')](_0x5810a7[_0x4a7b('0x31')][_0x4a7b('0x39')]);_0x26bb56[_0x4a7b('0x1c')]=qs[_0x4a7b('0x1c')](_0x5810a7['query']['offset']);}_0x26bb56[_0x4a7b('0x3a')]=qs[_0x4a7b('0x3b')](_0x5810a7[_0x4a7b('0x31')][_0x4a7b('0x3b')]);_0x26bb56[_0x4a7b('0x3c')]=qs['filters'](_[_0x4a7b('0x3d')](_0x5810a7[_0x4a7b('0x31')],_0x31bcdb[_0x4a7b('0x32')]),_0x319755);if(_0x5810a7[_0x4a7b('0x31')][_0x4a7b('0x3e')]){_0x26bb56[_0x4a7b('0x3c')]=_['merge'](_0x26bb56[_0x4a7b('0x3c')],{'$or':_[_0x4a7b('0x2c')](_0x319755,function(_0xc8e24c){if(_0xc8e24c['type']!==_0x4a7b('0x3f')){var _0xe48155={};_0xe48155[_0xc8e24c[_0x4a7b('0x2a')]]={'$like':'%'+_0x5810a7['query'][_0x4a7b('0x3e')]+'%'};return _0xe48155;}})});}_0x26bb56=_[_0x4a7b('0x40')]({},_0x26bb56,_0x5810a7[_0x4a7b('0x41')]);var _0x4dc26b={'where':_0x26bb56[_0x4a7b('0x3c')]};return db[_0x4a7b('0x2d')][_0x4a7b('0x1e')](_0x4dc26b)[_0x4a7b('0x25')](function(_0x1b4790){_0x4863ba[_0x4a7b('0x1e')]=_0x1b4790;if(_0x5810a7['query']['includeAll']){_0x26bb56[_0x4a7b('0x42')]=[{'all':!![]}];}return db[_0x4a7b('0x2d')][_0x4a7b('0x43')](_0x26bb56);})[_0x4a7b('0x25')](function(_0x17be14){_0x4863ba[_0x4a7b('0x44')]=_0x17be14;return _0x4863ba;})[_0x4a7b('0x25')](respondWithFilteredResult(_0xf7f33d,_0x26bb56))['catch'](handleError(_0xf7f33d,null));};exports['show']=function(_0x29145d,_0x487d02){var _0x59530b={'raw':!![],'where':{'id':_0x29145d[_0x4a7b('0x45')]['id']}},_0x3019eb={};_0x3019eb[_0x4a7b('0x30')]=_[_0x4a7b('0x46')](db[_0x4a7b('0x2d')][_0x4a7b('0x2e')]);_0x3019eb[_0x4a7b('0x31')]=_[_0x4a7b('0x46')](_0x29145d[_0x4a7b('0x31')]);_0x3019eb['filters']=_[_0x4a7b('0x33')](_0x3019eb[_0x4a7b('0x30')],_0x3019eb[_0x4a7b('0x31')]);_0x59530b[_0x4a7b('0x34')]=_['intersection'](_0x3019eb[_0x4a7b('0x30')],qs[_0x4a7b('0x35')](_0x29145d[_0x4a7b('0x31')][_0x4a7b('0x35')]));_0x59530b[_0x4a7b('0x34')]=_0x59530b[_0x4a7b('0x34')][_0x4a7b('0x36')]?_0x59530b[_0x4a7b('0x34')]:_0x3019eb[_0x4a7b('0x30')];if(_0x29145d[_0x4a7b('0x31')][_0x4a7b('0x47')]){_0x59530b[_0x4a7b('0x42')]=[{'all':!![]}];}_0x59530b=_[_0x4a7b('0x40')]({},_0x59530b,_0x29145d['options']);return db[_0x4a7b('0x2d')][_0x4a7b('0x48')](_0x59530b)[_0x4a7b('0x25')](handleEntityNotFound(_0x487d02,null))['then'](respondWithResult(_0x487d02,null))[_0x4a7b('0x49')](handleError(_0x487d02,null));};exports['create']=function(_0x22a9d,_0x34d530){return db[_0x4a7b('0x2d')][_0x4a7b('0x4a')](_0x22a9d['body'],{})['then'](function(_0x53ea30){var _0x31e793=_0x22a9d[_0x4a7b('0x4b')][_0x4a7b('0x27')]({'plain':!![]});if(!_0x31e793)throw new Error(_0x4a7b('0x4c'));if(_0x31e793[_0x4a7b('0x4d')]===_0x4a7b('0x4b')){var _0x42e364=_0x53ea30[_0x4a7b('0x27')]({'plain':!![]});var _0x10f5d3=_0x4a7b('0x4e');return db['UserProfileSection'][_0x4a7b('0x48')]({'where':{'name':_0x10f5d3,'userProfileId':_0x31e793[_0x4a7b('0x4f')]},'raw':!![]})['then'](function(_0xa0a93f){if(_0xa0a93f&&_0xa0a93f['autoAssociation']===0x0){return db[_0x4a7b('0x28')][_0x4a7b('0x4a')]({'name':_0x42e364[_0x4a7b('0x2a')],'resourceId':_0x42e364['id'],'type':_0xa0a93f[_0x4a7b('0x2a')],'sectionId':_0xa0a93f['id']},{})[_0x4a7b('0x25')](function(){return _0x53ea30;});}else{return _0x53ea30;}})[_0x4a7b('0x49')](function(_0x457193){logger['error'](_0x4a7b('0x50'),_0x457193);throw _0x457193;});}return _0x53ea30;})[_0x4a7b('0x25')](respondWithResult(_0x34d530,0xc9))[_0x4a7b('0x49')](handleError(_0x34d530,null));};exports[_0x4a7b('0x24')]=function(_0x54752d,_0x5562bd){if(_0x54752d[_0x4a7b('0x51')]['id']){delete _0x54752d[_0x4a7b('0x51')]['id'];}return db[_0x4a7b('0x2d')][_0x4a7b('0x48')]({'where':{'id':_0x54752d[_0x4a7b('0x45')]['id']}})[_0x4a7b('0x25')](handleEntityNotFound(_0x5562bd,null))[_0x4a7b('0x25')](saveUpdates(_0x54752d['body'],null))[_0x4a7b('0x25')](respondWithResult(_0x5562bd,null))['catch'](handleError(_0x5562bd,null));};exports[_0x4a7b('0x26')]=function(_0x3b12bc,_0x2d7620){return db[_0x4a7b('0x2d')][_0x4a7b('0x48')]({'where':{'id':_0x3b12bc[_0x4a7b('0x45')]['id']}})[_0x4a7b('0x25')](handleEntityNotFound(_0x2d7620,null))[_0x4a7b('0x25')](removeEntity(_0x2d7620,null))[_0x4a7b('0x49')](handleError(_0x2d7620,null));}; \ No newline at end of file +var _0xbfa8=['includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','bluebird','mustache','util','sox','ejs','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','end','error','stack','name','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','VIRTUAL','merge','options','where','CmHopperAdditionalPhone'];(function(_0x3343bb,_0x34a0f3){var _0xcf6d1b=function(_0x30576e){while(--_0x30576e){_0x3343bb['push'](_0x3343bb['shift']());}};_0xcf6d1b(++_0x34a0f3);}(_0xbfa8,0x181));var _0x8bfa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbfa8[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x8bfa('0x0'));var rimraf=require(_0x8bfa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8bfa('0x2'));var Mustache=require(_0x8bfa('0x3'));var util=require(_0x8bfa('0x4'));var path=require('path');var sox=require(_0x8bfa('0x5'));var csv=require('to-csv');var ejs=require(_0x8bfa('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8bfa('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8bfa('0x8'));var toCsv=require(_0x8bfa('0x9'));var querystring=require(_0x8bfa('0xa'));var Papa=require('papaparse');var Redis=require(_0x8bfa('0xb'));var authService=require(_0x8bfa('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bfa('0xd'));var logger=require(_0x8bfa('0xe'))(_0x8bfa('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bfa('0x10'))['db'];function respondWithStatusCode(_0x8dbe7d,_0x4d65d0){_0x4d65d0=_0x4d65d0||0xcc;return function(_0x1b56cb){if(_0x1b56cb){return _0x8dbe7d[_0x8bfa('0x11')](_0x4d65d0);}return _0x8dbe7d['status'](_0x4d65d0)['end']();};}function respondWithResult(_0x5bc6d0,_0x52036b){_0x52036b=_0x52036b||0xc8;return function(_0x18a6ff){if(_0x18a6ff){return _0x5bc6d0[_0x8bfa('0x12')](_0x52036b)[_0x8bfa('0x13')](_0x18a6ff);}};}function respondWithFilteredResult(_0x118aba,_0x51ebf9){return function(_0x1031a3){if(_0x1031a3){var _0x14dc07=typeof _0x51ebf9[_0x8bfa('0x14')]==='undefined'&&typeof _0x51ebf9['limit']===_0x8bfa('0x15');var _0x48b51d=_0x1031a3[_0x8bfa('0x16')];var _0x35f811=_0x14dc07?0x0:_0x51ebf9['offset'];var _0xe265e4=_0x14dc07?_0x1031a3[_0x8bfa('0x16')]:_0x51ebf9['offset']+_0x51ebf9[_0x8bfa('0x17')];var _0xe87fec;if(_0xe265e4>=_0x48b51d){_0xe265e4=_0x48b51d;_0xe87fec=0xc8;}else{_0xe87fec=0xce;}_0x118aba[_0x8bfa('0x12')](_0xe87fec);return _0x118aba[_0x8bfa('0x18')](_0x8bfa('0x19'),_0x35f811+'-'+_0xe265e4+'/'+_0x48b51d)[_0x8bfa('0x13')](_0x1031a3);}return null;};}function patchUpdates(_0x13c217){return function(_0x21236c){try{jsonpatch['apply'](_0x21236c,_0x13c217,!![]);}catch(_0x1c9a0c){return BPromise[_0x8bfa('0x1a')](_0x1c9a0c);}return _0x21236c[_0x8bfa('0x1b')]();};}function saveUpdates(_0x430ed3,_0x529b4a){return function(_0xd4fbb7){if(_0xd4fbb7){return _0xd4fbb7[_0x8bfa('0x1c')](_0x430ed3)[_0x8bfa('0x1d')](function(_0x1f498c){return _0x1f498c;});}return null;};}function removeEntity(_0x2091e2,_0x1d3da7){return function(_0x41f71a){if(_0x41f71a){return _0x41f71a[_0x8bfa('0x1e')]()[_0x8bfa('0x1d')](function(){var _0x106779=_0x41f71a[_0x8bfa('0x1f')]({'plain':!![]});var _0x377ce8=_0x8bfa('0x20');return db['UserProfileResource'][_0x8bfa('0x1e')]({'where':{'type':_0x377ce8,'resourceId':_0x106779['id']}})['then'](function(){return _0x41f71a;});})[_0x8bfa('0x1d')](function(){_0x2091e2[_0x8bfa('0x12')](0xcc)[_0x8bfa('0x21')]();});}};}function handleEntityNotFound(_0x59065e,_0x2bf4a6){return function(_0x506957){if(!_0x506957){_0x59065e[_0x8bfa('0x11')](0x194);}return _0x506957;};}function handleError(_0x4f1d2c,_0x4afaa8){_0x4afaa8=_0x4afaa8||0x1f4;return function(_0x3380bd){logger[_0x8bfa('0x22')](_0x3380bd[_0x8bfa('0x23')]);if(_0x3380bd['name']){delete _0x3380bd[_0x8bfa('0x24')];}_0x4f1d2c[_0x8bfa('0x12')](_0x4afaa8)['send'](_0x3380bd);};}exports[_0x8bfa('0x25')]=function(_0x2259a9,_0x19fd5e){var _0x2f5c6a={},_0x31278f={},_0x2cd38a={'count':0x0,'rows':[]};var _0x32d42d=_[_0x8bfa('0x26')](db['CmHopperAdditionalPhone'][_0x8bfa('0x27')],function(_0x3b41b4){return{'name':_0x3b41b4['fieldName'],'type':_0x3b41b4[_0x8bfa('0x28')][_0x8bfa('0x29')]};});_0x31278f[_0x8bfa('0x2a')]=_[_0x8bfa('0x26')](_0x32d42d,_0x8bfa('0x24'));_0x31278f[_0x8bfa('0x2b')]=_['keys'](_0x2259a9[_0x8bfa('0x2b')]);_0x31278f['filters']=_[_0x8bfa('0x2c')](_0x31278f[_0x8bfa('0x2a')],_0x31278f[_0x8bfa('0x2b')]);_0x2f5c6a[_0x8bfa('0x2d')]=_[_0x8bfa('0x2c')](_0x31278f[_0x8bfa('0x2a')],qs[_0x8bfa('0x2e')](_0x2259a9[_0x8bfa('0x2b')]['fields']));_0x2f5c6a[_0x8bfa('0x2d')]=_0x2f5c6a[_0x8bfa('0x2d')][_0x8bfa('0x2f')]?_0x2f5c6a[_0x8bfa('0x2d')]:_0x31278f[_0x8bfa('0x2a')];if(!_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x30')](_0x8bfa('0x31'))){_0x2f5c6a[_0x8bfa('0x17')]=qs[_0x8bfa('0x17')](_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x17')]);_0x2f5c6a[_0x8bfa('0x14')]=qs[_0x8bfa('0x14')](_0x2259a9[_0x8bfa('0x2b')]['offset']);}_0x2f5c6a[_0x8bfa('0x32')]=qs[_0x8bfa('0x33')](_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x33')]);_0x2f5c6a['where']=qs['filters'](_['pick'](_0x2259a9[_0x8bfa('0x2b')],_0x31278f[_0x8bfa('0x34')]),_0x32d42d);if(_0x2259a9['query'][_0x8bfa('0x35')]){_0x2f5c6a['where']=_['merge'](_0x2f5c6a['where'],{'$or':_[_0x8bfa('0x26')](_0x32d42d,function(_0x396730){if(_0x396730[_0x8bfa('0x28')]!==_0x8bfa('0x36')){var _0x8f5731={};_0x8f5731[_0x396730[_0x8bfa('0x24')]]={'$like':'%'+_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x35')]+'%'};return _0x8f5731;}})});}_0x2f5c6a=_[_0x8bfa('0x37')]({},_0x2f5c6a,_0x2259a9[_0x8bfa('0x38')]);var _0x25919e={'where':_0x2f5c6a[_0x8bfa('0x39')]};return db[_0x8bfa('0x3a')][_0x8bfa('0x16')](_0x25919e)[_0x8bfa('0x1d')](function(_0x22bdd9){_0x2cd38a['count']=_0x22bdd9;if(_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x3b')]){_0x2f5c6a[_0x8bfa('0x3c')]=[{'all':!![]}];}return db[_0x8bfa('0x3a')]['findAll'](_0x2f5c6a);})[_0x8bfa('0x1d')](function(_0x508c8b){_0x2cd38a[_0x8bfa('0x3d')]=_0x508c8b;return _0x2cd38a;})[_0x8bfa('0x1d')](respondWithFilteredResult(_0x19fd5e,_0x2f5c6a))[_0x8bfa('0x3e')](handleError(_0x19fd5e,null));};exports[_0x8bfa('0x3f')]=function(_0x3f0e80,_0x526c92){var _0x3531f5={'raw':!![],'where':{'id':_0x3f0e80[_0x8bfa('0x40')]['id']}},_0x4cfd96={};_0x4cfd96['model']=_['keys'](db[_0x8bfa('0x3a')][_0x8bfa('0x27')]);_0x4cfd96['query']=_[_0x8bfa('0x41')](_0x3f0e80['query']);_0x4cfd96['filters']=_[_0x8bfa('0x2c')](_0x4cfd96[_0x8bfa('0x2a')],_0x4cfd96[_0x8bfa('0x2b')]);_0x3531f5[_0x8bfa('0x2d')]=_[_0x8bfa('0x2c')](_0x4cfd96[_0x8bfa('0x2a')],qs[_0x8bfa('0x2e')](_0x3f0e80[_0x8bfa('0x2b')][_0x8bfa('0x2e')]));_0x3531f5[_0x8bfa('0x2d')]=_0x3531f5[_0x8bfa('0x2d')][_0x8bfa('0x2f')]?_0x3531f5[_0x8bfa('0x2d')]:_0x4cfd96[_0x8bfa('0x2a')];if(_0x3f0e80[_0x8bfa('0x2b')][_0x8bfa('0x3b')]){_0x3531f5[_0x8bfa('0x3c')]=[{'all':!![]}];}_0x3531f5=_['merge']({},_0x3531f5,_0x3f0e80[_0x8bfa('0x38')]);return db[_0x8bfa('0x3a')][_0x8bfa('0x42')](_0x3531f5)[_0x8bfa('0x1d')](handleEntityNotFound(_0x526c92,null))['then'](respondWithResult(_0x526c92,null))['catch'](handleError(_0x526c92,null));};exports[_0x8bfa('0x43')]=function(_0x11d372,_0x44e118){return db['CmHopperAdditionalPhone']['create'](_0x11d372[_0x8bfa('0x44')],{})[_0x8bfa('0x1d')](function(_0x597c71){var _0x49a9ca=_0x11d372['user'][_0x8bfa('0x1f')]({'plain':!![]});if(!_0x49a9ca)throw new Error(_0x8bfa('0x45'));if(_0x49a9ca[_0x8bfa('0x46')]==='user'){var _0x5e2b80=_0x597c71['get']({'plain':!![]});var _0x3b7e1e=_0x8bfa('0x20');return db[_0x8bfa('0x47')]['find']({'where':{'name':_0x3b7e1e,'userProfileId':_0x49a9ca['userProfileId']},'raw':!![]})[_0x8bfa('0x1d')](function(_0x33e1d5){if(_0x33e1d5&&_0x33e1d5[_0x8bfa('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e2b80[_0x8bfa('0x24')],'resourceId':_0x5e2b80['id'],'type':_0x33e1d5[_0x8bfa('0x24')],'sectionId':_0x33e1d5['id']},{})[_0x8bfa('0x1d')](function(){return _0x597c71;});}else{return _0x597c71;}})[_0x8bfa('0x3e')](function(_0x66016c){logger[_0x8bfa('0x22')](_0x8bfa('0x49'),_0x66016c);throw _0x66016c;});}return _0x597c71;})[_0x8bfa('0x1d')](respondWithResult(_0x44e118,0xc9))[_0x8bfa('0x3e')](handleError(_0x44e118,null));};exports['update']=function(_0x3a8d82,_0x454dfa){if(_0x3a8d82[_0x8bfa('0x44')]['id']){delete _0x3a8d82[_0x8bfa('0x44')]['id'];}return db[_0x8bfa('0x3a')]['find']({'where':{'id':_0x3a8d82[_0x8bfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x454dfa,null))[_0x8bfa('0x1d')](saveUpdates(_0x3a8d82[_0x8bfa('0x44')],null))[_0x8bfa('0x1d')](respondWithResult(_0x454dfa,null))['catch'](handleError(_0x454dfa,null));};exports[_0x8bfa('0x1e')]=function(_0x29ce81,_0x87328a){return db[_0x8bfa('0x3a')][_0x8bfa('0x42')]({'where':{'id':_0x29ce81[_0x8bfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x87328a,null))[_0x8bfa('0x1d')](removeEntity(_0x87328a,null))[_0x8bfa('0x3e')](handleError(_0x87328a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 80aa7a5..12ca93f 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 _0xf150=['moment','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','CmHopperAdditionalPhone','lodash','util','../../config/logger','api'];(function(_0x56d686,_0x20709e){var _0xb6a5b7=function(_0x28ff71){while(--_0x28ff71){_0x56d686['push'](_0x56d686['shift']());}};_0xb6a5b7(++_0x20709e);}(_0xf150,0x196));var _0x0f15=function(_0x447d6c,_0x43c5ee){_0x447d6c=_0x447d6c-0x0;var _0x281be8=_0xf150[_0x447d6c];return _0x281be8;};'use strict';var _=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var logger=require(_0x0f15('0x2'))(_0x0f15('0x3'));var moment=require(_0x0f15('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f15('0x5'));var rimraf=require(_0x0f15('0x6'));var config=require(_0x0f15('0x7'));var attributes=require(_0x0f15('0x8'));module['exports']=function(_0xd88f20,_0x437b6f){return _0xd88f20['define'](_0x0f15('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0686=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger'];(function(_0x167205,_0x5b7425){var _0x24a7e9=function(_0xbb5306){while(--_0xbb5306){_0x167205['push'](_0x167205['shift']());}};_0x24a7e9(++_0x5b7425);}(_0x0686,0x123));var _0x6068=function(_0x4b5f33,_0x32f9a2){_0x4b5f33=_0x4b5f33-0x0;var _0x300939=_0x0686[_0x4b5f33];return _0x300939;};'use strict';var _=require(_0x6068('0x0'));var util=require(_0x6068('0x1'));var logger=require(_0x6068('0x2'))(_0x6068('0x3'));var moment=require(_0x6068('0x4'));var BPromise=require(_0x6068('0x5'));var rp=require(_0x6068('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6068('0x7'));var config=require(_0x6068('0x8'));var attributes=require(_0x6068('0x9'));module[_0x6068('0xa')]=function(_0x2d4dd0,_0x3e5dfd){return _0x2d4dd0[_0x6068('0xb')](_0x6068('0xc'),attributes,{'tableName':_0x6068('0xd'),'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 ef78f5b..ba5af15 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 _0x27c2=['bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','findOne','ContactId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','countmachineretry','countagentrejectretry','entity','SwapAdditionalPhones','ListId','waitTime','VerifyAdditionalPhones','isNil','scheduledat','add','minutes','phone','countabandonedretry','updatedAt','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x27c2,0x71));var _0x227c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27c2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x227c('0x0'));var util=require(_0x227c('0x1'));var moment=require(_0x227c('0x2'));var BPromise=require(_0x227c('0x3'));var rs=require(_0x227c('0x4'));var fs=require('fs');var Redis=require(_0x227c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x227c('0x6'))(_0x227c('0x7'));var config=require('../../config/environment');var jayson=require(_0x227c('0x8'));var client=jayson[_0x227c('0x9')][_0x227c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ba86,_0x232803,_0x260dd7){return new BPromise(function(_0x591a38,_0x4c6a8f){return client['request'](_0x45ba86,_0x260dd7)[_0x227c('0xb')](function(_0x25d081){logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));logger[_0x227c('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x232803,_0x227c('0xe'),JSON[_0x227c('0x10')](_0x25d081));if(_0x25d081[_0x227c('0x11')]){if(_0x25d081[_0x227c('0x11')][_0x227c('0x12')]===0x1f4){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);return _0x4c6a8f(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081['error']['message']);return _0x591a38(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}else{logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));_0x591a38(_0x25d081[_0x227c('0x14')][_0x227c('0x13')]);}})[_0x227c('0x15')](function(_0x52e8bc){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x52e8bc);_0x4c6a8f(_0x52e8bc);});});}exports['VerifyAdditionalPhones']=function(_0x4a9182){var _0x2dd773=this;return new Promise(function(_0x5be9fc,_0x85a96){return db[_0x227c('0x16')][_0x227c('0x17')]({'raw':!![],'where':{'ContactId':_0x4a9182['body'][_0x227c('0x18')],'ListId':_0x4a9182[_0x227c('0x19')]['ListId'],'VoiceQueueId':_0x4a9182[_0x227c('0x19')]['VoiceQueueId']===undefined?null:_0x4a9182['body'][_0x227c('0x1a')],'CampaignId':_0x4a9182[_0x227c('0x19')][_0x227c('0x1b')]===undefined?null:_0x4a9182[_0x227c('0x19')][_0x227c('0x1b')]}})[_0x227c('0xb')](function(_0x4e72df){if(_0x4e72df!=null){return db[_0x227c('0x1c')][_0x227c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x4e72df['id'],'OrderBy':{'$gt':_0x4e72df['OrderBy']}},'order':[[_0x227c('0x1d'),_0x227c('0x1e')]]})['then'](function(_0x867772){var _0x3b5cf0=0x0;if(_0x867772){if(_0x867772[_0x227c('0x1f')]+_0x867772[_0x227c('0x20')]+_0x867772[_0x227c('0x21')]+_0x867772[_0x227c('0x22')]+_0x867772[_0x227c('0x23')]+_0x867772['countabandonedretry']+_0x867772['countmachineretry']+_0x867772['countagentrejectretry']<_0x4a9182['entity'][_0x227c('0x24')])_0x3b5cf0=0x1;_0x5be9fc({'additional':_0x3b5cf0});}else{return db['CmHopperAdditionalPhone'][_0x227c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x4e72df['id']},'order':[['OrderBy',_0x227c('0x1e')]]})[_0x227c('0xb')](function(_0x88c6de){var _0x3b23d4=0x0;if(_0x88c6de){if(_0x88c6de[_0x227c('0x1f')]+_0x88c6de[_0x227c('0x20')]+_0x88c6de[_0x227c('0x21')]+_0x88c6de[_0x227c('0x22')]+_0x88c6de[_0x227c('0x23')]+_0x88c6de['countabandonedretry']+_0x88c6de[_0x227c('0x25')]+_0x88c6de[_0x227c('0x26')]<_0x4a9182[_0x227c('0x27')][_0x227c('0x24')])_0x3b23d4=0x1;_0x5be9fc({'additional':_0x3b23d4});}else{_0x5be9fc({'additional':0x0});}})[_0x227c('0x15')](function(_0x496eec){logger[_0x227c('0x11')]('VerifyAdditionalPhones',_0x496eec[_0x227c('0x13')]);_0x85a96(_0x2dd773[_0x227c('0x11')](0x1f4,_0x496eec[_0x227c('0x13')]));});}})[_0x227c('0x15')](function(_0x248866){logger['error']('VerifyAdditionalPhones',_0x248866[_0x227c('0x13')]);_0x85a96(_0x2dd773[_0x227c('0x11')](0x1f4,_0x248866['message']));});}else _0x5be9fc({'additional':0x0});});});};exports[_0x227c('0x28')]=function(_0x2df12c){var _0x3094df=this;return new Promise(function(_0x2deac3,_0x24dbaa){return db[_0x227c('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x2df12c['body']['ContactId'],'ListId':_0x2df12c[_0x227c('0x19')][_0x227c('0x29')],'VoiceQueueId':_0x2df12c[_0x227c('0x19')][_0x227c('0x1a')]===undefined?null:_0x2df12c[_0x227c('0x19')][_0x227c('0x1a')],'CampaignId':_0x2df12c[_0x227c('0x19')]['CampaignId']===undefined?null:_0x2df12c[_0x227c('0x19')][_0x227c('0x1b')]}})[_0x227c('0xb')](function(_0x4f4b68){if(_0x4f4b68!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4f4b68['id'],'OrderBy':{'$gte':_0x4f4b68[_0x227c('0x1d')]}},'order':[['OrderBy',_0x227c('0x1e')]]})[_0x227c('0xb')](function(_0x45b42e){if(_0x45b42e)return activateAdditionalPhone(_0x4f4b68,_0x2df12c[_0x227c('0x19')],_0x45b42e,_0x2df12c['duration'],_0x2df12c['waitTime'])[_0x227c('0xb')](function(_0x2e16cd){_0x2deac3(_0x2e16cd);});else{return db[_0x227c('0x1c')][_0x227c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x4f4b68['id']},'order':[[_0x227c('0x1d'),_0x227c('0x1e')]]})[_0x227c('0xb')](function(_0x4d2afc){if(_0x4d2afc)return activateAdditionalPhone(_0x4f4b68,_0x2df12c[_0x227c('0x19')],_0x4d2afc,_0x2df12c['duration'],_0x2df12c[_0x227c('0x2a')])[_0x227c('0xb')](function(_0x365de0){_0x2deac3(_0x365de0);});else{_0x2deac3({'id':_0x4f4b68['id'],'phone':''});}})['catch'](function(_0x24265b){logger[_0x227c('0x11')]('VerifyAdditionalPhones',_0x24265b[_0x227c('0x13')]);_0x24dbaa(_0x3094df['error'](0x1f4,_0x24265b[_0x227c('0x13')]));});}})[_0x227c('0x15')](function(_0x3a5297){logger[_0x227c('0x11')](_0x227c('0x2b'),_0x3a5297[_0x227c('0x13')]);_0x24dbaa(_0x3094df[_0x227c('0x11')](0x1f4,_0x3a5297[_0x227c('0x13')]));});}else _0x2deac3(0x1);});});};function activateAdditionalPhone(_0x5bd363,_0x46f8b3,_0x2fd992,_0x1a2e2a,_0x577a42){return new Promise(function(_0x80175d,_0x574dae){var _0x5cbe15;if(_[_0x227c('0x2c')](_0x2fd992[_0x227c('0x2d')])){_0x2fd992[_0x227c('0x2d')]=moment();}if(moment()>moment(_0x2fd992[_0x227c('0x2d')])){_0x5cbe15=moment()[_0x227c('0x2e')](_0x577a42||0x3,_0x227c('0x2f'));}else{if(_0x2fd992[_0x227c('0x1d')]==0x0){_0x5cbe15=moment(_0x2fd992[_0x227c('0x2d')]);}else{_0x5cbe15=moment()[_0x227c('0x2e')](_0x577a42||0x3,_0x227c('0x2f'));}}if(_['isNil'](_0x5cbe15)){_0x5cbe15=moment()[_0x227c('0x2e')](_0x577a42||0x3,'minutes');}var _0x312b15={'phone':_0x5bd363[_0x227c('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x5bd363[_0x227c('0x1d')])?0x0:_0x5bd363[_0x227c('0x1d')],'scheduledat':moment()[_0x227c('0x2e')](_0x1a2e2a||0x1,_0x227c('0x2f')),'countbusyretry':_0x46f8b3['countbusyretry'],'countcongestionretry':_0x46f8b3[_0x227c('0x20')],'countnoanswerretry':_0x46f8b3[_0x227c('0x21')],'countnosuchnumberretry':_0x46f8b3[_0x227c('0x22')],'countdropretry':_0x46f8b3[_0x227c('0x23')],'countabandonedretry':_0x46f8b3[_0x227c('0x31')],'countmachineretry':_0x46f8b3[_0x227c('0x25')],'countagentrejectretry':_0x46f8b3[_0x227c('0x26')],'createdAt':_0x46f8b3['createdAt'],'updatedAt':_0x46f8b3[_0x227c('0x32')]};var _0x1487ed={'CmHopperId':_0x5bd363['id'],'phone':_0x2fd992[_0x227c('0x30')],'active':0x0,'OrderBy':_[_0x227c('0x2c')](_0x2fd992[_0x227c('0x1d')])?0x0:_0x2fd992[_0x227c('0x1d')],'scheduledat':_0x5cbe15,'countbusyretry':_0x2fd992[_0x227c('0x1f')],'countcongestionretry':_0x2fd992['countcongestionretry'],'countnoanswerretry':_0x2fd992[_0x227c('0x21')],'countnosuchnumberretry':_0x2fd992['countnosuchnumberretry'],'countdropretry':_0x2fd992['countdropretry'],'countabandonedretry':_0x2fd992[_0x227c('0x31')],'countmachineretry':_0x2fd992[_0x227c('0x25')],'countagentrejectretry':_0x2fd992[_0x227c('0x26')],'createdAt':_0x2fd992[_0x227c('0x33')],'updatedAt':_0x2fd992['updatedAt']};return db[_0x227c('0x34')][_0x227c('0x35')](function(_0x3edb2b){return db[_0x227c('0x1c')][_0x227c('0x36')](_0x312b15,{'where':{'id':_0x2fd992['id']}},{'transaction':_0x3edb2b})['then'](function(){return db[_0x227c('0x16')][_0x227c('0x36')](_0x1487ed,{'where':{'id':_0x5bd363['id']}},{'transaction':_0x3edb2b});});})['then'](function(_0x35fb4d){_0x80175d({'id':_0x5bd363['id'],'phone':_0x2fd992[_0x227c('0x30')]});})['catch'](function(_0x143501){logger[_0x227c('0x11')](_0x227c('0x37'),_0x143501[_0x227c('0x13')]);_0x574dae({'error':_0x143501[_0x227c('0x13')]});});});}exports[_0x227c('0x38')]=function(_0x110856){var _0x2d0075=this;return new Promise(function(_0xd40e22,_0x4f8c01){return db[_0x227c('0x16')]['update'](_0x110856[_0x227c('0x19')][_0x227c('0x39')],{'where':{'id':_0x110856[_0x227c('0x19')]['id']}})[_0x227c('0xb')](function(_0x4073ec){_0xd40e22(_0x4073ec);})[_0x227c('0x15')](function(_0x55011d){logger[_0x227c('0x11')](_0x227c('0x38'),_0x55011d['message']);_0x4f8c01(_0x2d0075[_0x227c('0x11')](0x1f4,_0x55011d[_0x227c('0x13')]));});});}; \ No newline at end of file +var _0x97f5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','CmHopperAdditionalPhone','countnoanswerretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','transaction','update','IncrementPreviewCounters','field'];(function(_0x4d12b0,_0x664307){var _0x30cecd=function(_0x59a309){while(--_0x59a309){_0x4d12b0['push'](_0x4d12b0['shift']());}};_0x30cecd(++_0x664307);}(_0x97f5,0x72));var _0x597f=function(_0x1c952e,_0x3fb65a){_0x1c952e=_0x1c952e-0x0;var _0x2e807e=_0x97f5[_0x1c952e];return _0x2e807e;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var moment=require(_0x597f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require(_0x597f('0x6'))(_0x597f('0x7'));var config=require(_0x597f('0x8'));var jayson=require(_0x597f('0x9'));var client=jayson[_0x597f('0xa')][_0x597f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f4eb9,_0x22b5d0,_0x20f0fc){return new BPromise(function(_0x1098e6,_0x40b1cd){return client[_0x597f('0xc')](_0x5f4eb9,_0x20f0fc)[_0x597f('0xd')](function(_0x5b293a){logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,_0x597f('0x10'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x22b5d0,_0x597f('0x10'),JSON['stringify'](_0x5b293a));if(_0x5b293a[_0x597f('0x11')]){if(_0x5b293a[_0x597f('0x11')][_0x597f('0x12')]===0x1f4){logger['error'](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x40b1cd(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}logger[_0x597f('0x11')](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x1098e6(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}else{logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,'request\x20sent');_0x1098e6(_0x5b293a[_0x597f('0x14')][_0x597f('0x13')]);}})[_0x597f('0x15')](function(_0x55eed9){logger[_0x597f('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x22b5d0,_0x55eed9);_0x40b1cd(_0x55eed9);});});}exports['VerifyAdditionalPhones']=function(_0x507552){var _0x50f89a=this;return new Promise(function(_0x49f12b,_0x4dcc95){return db[_0x597f('0x16')][_0x597f('0x17')]({'raw':!![],'where':{'ContactId':_0x507552['body'][_0x597f('0x18')],'ListId':_0x507552[_0x597f('0x19')][_0x597f('0x1a')],'VoiceQueueId':_0x507552[_0x597f('0x19')]['VoiceQueueId']===undefined?null:_0x507552['body'][_0x597f('0x1b')],'CampaignId':_0x507552[_0x597f('0x19')][_0x597f('0x1c')]===undefined?null:_0x507552[_0x597f('0x19')]['CampaignId']}})['then'](function(_0x376b5f){if(_0x376b5f!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x376b5f['id'],'OrderBy':{'$gt':_0x376b5f[_0x597f('0x1d')]}},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})['then'](function(_0x553e9c){var _0x51bc3c=0x0;if(_0x553e9c){if(_0x553e9c[_0x597f('0x1f')]+_0x553e9c[_0x597f('0x20')]+_0x553e9c['countnoanswerretry']+_0x553e9c[_0x597f('0x21')]+_0x553e9c[_0x597f('0x22')]+_0x553e9c[_0x597f('0x23')]+_0x553e9c['countmachineretry']+_0x553e9c['countagentrejectretry']<_0x507552[_0x597f('0x24')]['dialGlobalMaxRetry'])_0x51bc3c=0x1;_0x49f12b({'additional':_0x51bc3c});}else{return db[_0x597f('0x25')][_0x597f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x376b5f['id']},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x10509d){var _0x1c5300=0x0;if(_0x10509d){if(_0x10509d['countbusyretry']+_0x10509d['countcongestionretry']+_0x10509d[_0x597f('0x26')]+_0x10509d['countnosuchnumberretry']+_0x10509d[_0x597f('0x22')]+_0x10509d[_0x597f('0x23')]+_0x10509d[_0x597f('0x27')]+_0x10509d[_0x597f('0x28')]<_0x507552[_0x597f('0x24')][_0x597f('0x29')])_0x1c5300=0x1;_0x49f12b({'additional':_0x1c5300});}else{_0x49f12b({'additional':0x0});}})[_0x597f('0x15')](function(_0x591a8e){logger['error'](_0x597f('0x2a'),_0x591a8e['message']);_0x4dcc95(_0x50f89a[_0x597f('0x11')](0x1f4,_0x591a8e[_0x597f('0x13')]));});}})[_0x597f('0x15')](function(_0x6a05f){logger['error'](_0x597f('0x2a'),_0x6a05f[_0x597f('0x13')]);_0x4dcc95(_0x50f89a['error'](0x1f4,_0x6a05f[_0x597f('0x13')]));});}else _0x49f12b({'additional':0x0});});});};exports[_0x597f('0x2b')]=function(_0x402d84){var _0x4e91a1=this;return new Promise(function(_0x4eb733,_0xb9c3c9){return db[_0x597f('0x16')][_0x597f('0x17')]({'raw':!![],'where':{'ContactId':_0x402d84['body']['ContactId'],'ListId':_0x402d84[_0x597f('0x19')][_0x597f('0x1a')],'VoiceQueueId':_0x402d84[_0x597f('0x19')][_0x597f('0x1b')]===undefined?null:_0x402d84[_0x597f('0x19')]['VoiceQueueId'],'CampaignId':_0x402d84[_0x597f('0x19')][_0x597f('0x1c')]===undefined?null:_0x402d84[_0x597f('0x19')][_0x597f('0x1c')]}})[_0x597f('0xd')](function(_0x75eb9f){if(_0x75eb9f!=null){return db[_0x597f('0x25')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x75eb9f['id'],'OrderBy':{'$gte':_0x75eb9f[_0x597f('0x1d')]}},'order':[['OrderBy',_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x3e3505){if(_0x3e3505)return activateAdditionalPhone(_0x75eb9f,_0x402d84['body'],_0x3e3505,_0x402d84[_0x597f('0x2c')],_0x402d84['waitTime'])[_0x597f('0xd')](function(_0x1e71de){_0x4eb733(_0x1e71de);});else{return db[_0x597f('0x25')][_0x597f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x75eb9f['id']},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x25f103){if(_0x25f103)return activateAdditionalPhone(_0x75eb9f,_0x402d84['body'],_0x25f103,_0x402d84[_0x597f('0x2c')],_0x402d84[_0x597f('0x2d')])[_0x597f('0xd')](function(_0x5e20d9){_0x4eb733(_0x5e20d9);});else{_0x4eb733({'id':_0x75eb9f['id'],'phone':''});}})['catch'](function(_0x52c995){logger[_0x597f('0x11')](_0x597f('0x2a'),_0x52c995[_0x597f('0x13')]);_0xb9c3c9(_0x4e91a1['error'](0x1f4,_0x52c995[_0x597f('0x13')]));});}})[_0x597f('0x15')](function(_0x50b5a3){logger[_0x597f('0x11')](_0x597f('0x2a'),_0x50b5a3[_0x597f('0x13')]);_0xb9c3c9(_0x4e91a1['error'](0x1f4,_0x50b5a3['message']));});}else _0x4eb733(0x1);});});};function activateAdditionalPhone(_0x5916f6,_0x1976f8,_0xc62652,_0xe610bd,_0x4485ff){return new Promise(function(_0x2e484e,_0x2f4b15){var _0x3e11a2;if(_[_0x597f('0x2e')](_0xc62652[_0x597f('0x2f')])){_0xc62652[_0x597f('0x2f')]=moment();}if(moment()>moment(_0xc62652['scheduledat'])){_0x3e11a2=moment()['add'](_0x4485ff||0x3,_0x597f('0x30'));}else{if(_0xc62652[_0x597f('0x1d')]==0x0){_0x3e11a2=moment(_0xc62652[_0x597f('0x2f')]);}else{_0x3e11a2=moment()[_0x597f('0x31')](_0x4485ff||0x3,_0x597f('0x30'));}}if(_[_0x597f('0x2e')](_0x3e11a2)){_0x3e11a2=moment()[_0x597f('0x31')](_0x4485ff||0x3,'minutes');}var _0x15cf35={'phone':_0x5916f6[_0x597f('0x32')],'active':0x0,'OrderBy':_[_0x597f('0x2e')](_0x5916f6[_0x597f('0x1d')])?0x0:_0x5916f6[_0x597f('0x1d')],'scheduledat':moment()[_0x597f('0x31')](_0xe610bd||0x1,'minutes'),'countbusyretry':_0x1976f8[_0x597f('0x1f')],'countcongestionretry':_0x1976f8[_0x597f('0x20')],'countnoanswerretry':_0x1976f8[_0x597f('0x26')],'countnosuchnumberretry':_0x1976f8[_0x597f('0x21')],'countdropretry':_0x1976f8['countdropretry'],'countabandonedretry':_0x1976f8[_0x597f('0x23')],'countmachineretry':_0x1976f8['countmachineretry'],'countagentrejectretry':_0x1976f8['countagentrejectretry'],'createdAt':_0x1976f8[_0x597f('0x33')],'updatedAt':_0x1976f8[_0x597f('0x34')]};var _0x34df0f={'CmHopperId':_0x5916f6['id'],'phone':_0xc62652[_0x597f('0x32')],'active':0x0,'OrderBy':_[_0x597f('0x2e')](_0xc62652['OrderBy'])?0x0:_0xc62652[_0x597f('0x1d')],'scheduledat':_0x3e11a2,'countbusyretry':_0xc62652[_0x597f('0x1f')],'countcongestionretry':_0xc62652[_0x597f('0x20')],'countnoanswerretry':_0xc62652[_0x597f('0x26')],'countnosuchnumberretry':_0xc62652[_0x597f('0x21')],'countdropretry':_0xc62652[_0x597f('0x22')],'countabandonedretry':_0xc62652['countabandonedretry'],'countmachineretry':_0xc62652[_0x597f('0x27')],'countagentrejectretry':_0xc62652[_0x597f('0x28')],'createdAt':_0xc62652[_0x597f('0x33')],'updatedAt':_0xc62652['updatedAt']};return db['sequelize'][_0x597f('0x35')](function(_0x8e52cf){return db['CmHopperAdditionalPhone'][_0x597f('0x36')](_0x15cf35,{'where':{'id':_0xc62652['id']}},{'transaction':_0x8e52cf})['then'](function(){return db[_0x597f('0x16')][_0x597f('0x36')](_0x34df0f,{'where':{'id':_0x5916f6['id']}},{'transaction':_0x8e52cf});});})[_0x597f('0xd')](function(_0x42a80a){_0x2e484e({'id':_0x5916f6['id'],'phone':_0xc62652['phone']});})[_0x597f('0x15')](function(_0x32137c){logger[_0x597f('0x11')]('activateAdditionalPhone',_0x32137c[_0x597f('0x13')]);_0x2f4b15({'error':_0x32137c['message']});});});}exports[_0x597f('0x37')]=function(_0x589bae){var _0x274e88=this;return new Promise(function(_0x5cc1de,_0xfd183e){return db[_0x597f('0x16')][_0x597f('0x36')](_0x589bae[_0x597f('0x19')][_0x597f('0x38')],{'where':{'id':_0x589bae[_0x597f('0x19')]['id']}})[_0x597f('0xd')](function(_0x240f90){_0x5cc1de(_0x240f90);})[_0x597f('0x15')](function(_0x526b39){logger[_0x597f('0x11')]('IncrementPreviewCounters',_0x526b39[_0x597f('0x13')]);_0xfd183e(_0x274e88[_0x597f('0x11')](0x1f4,_0x526b39['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f425b63..9d0f6d7 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 _0xf612=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x46c7e8,_0x5f4205){var _0x57e72c=function(_0x23762b){while(--_0x23762b){_0x46c7e8['push'](_0x46c7e8['shift']());}};_0x57e72c(++_0x5f4205);}(_0xf612,0x14b));var _0x2f61=function(_0x330a1e,_0x5c3a01){_0x330a1e=_0x330a1e-0x0;var _0x15ff19=_0xf612[_0x330a1e];return _0x15ff19;};'use strict';var multer=require(_0x2f61('0x0'));var util=require('util');var path=require(_0x2f61('0x1'));var timeout=require(_0x2f61('0x2'));var express=require(_0x2f61('0x3'));var router=express[_0x2f61('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f61('0x5'));var interaction=require(_0x2f61('0x6'));var config=require(_0x2f61('0x7'));var controller=require(_0x2f61('0x8'));router[_0x2f61('0x9')]('/',auth[_0x2f61('0xa')](),controller['index']);router[_0x2f61('0x9')](_0x2f61('0xb'),auth[_0x2f61('0xa')](),controller['show']);router[_0x2f61('0xc')]('/',auth[_0x2f61('0xa')](),controller[_0x2f61('0xd')]);router[_0x2f61('0xe')](_0x2f61('0xb'),auth[_0x2f61('0xa')](),controller[_0x2f61('0xf')]);router[_0x2f61('0x10')](_0x2f61('0xb'),auth['isAuthenticated'](),controller[_0x2f61('0x11')]);module[_0x2f61('0x12')]=router; \ No newline at end of file +var _0x6460=['../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14baad,_0x1dba8d){var _0x3dc4ec=function(_0x7c63c7){while(--_0x7c63c7){_0x14baad['push'](_0x14baad['shift']());}};_0x3dc4ec(++_0x1dba8d);}(_0x6460,0x1f1));var _0x0646=function(_0x297528,_0x9d3b4b){_0x297528=_0x297528-0x0;var _0x27fc0d=_0x6460[_0x297528];return _0x27fc0d;};'use strict';var multer=require('multer');var util=require(_0x0646('0x0'));var path=require(_0x0646('0x1'));var timeout=require('connect-timeout');var express=require(_0x0646('0x2'));var router=express[_0x0646('0x3')]();var fs_extra=require(_0x0646('0x4'));var auth=require(_0x0646('0x5'));var interaction=require(_0x0646('0x6'));var config=require(_0x0646('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0646('0x8')]('/',auth[_0x0646('0x9')](),controller['index']);router[_0x0646('0x8')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0xb')]);router[_0x0646('0xc')]('/',auth[_0x0646('0x9')](),controller['create']);router[_0x0646('0xd')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0xe')]);router[_0x0646('0xf')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0x10')]);module[_0x0646('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a765594..84465b4 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 _0xfc91=['contactListQueue','sequelize','STRING','INTEGER'];(function(_0x165c96,_0x5069d0){var _0x588015=function(_0x5062c9){while(--_0x5062c9){_0x165c96['push'](_0x165c96['shift']());}};_0x588015(++_0x5069d0);}(_0xfc91,0xb5));var _0x1fc9=function(_0x1a7872,_0x363b52){_0x1a7872=_0x1a7872-0x0;var _0x47f2fb=_0xfc91[_0x1a7872];return _0x47f2fb;};'use strict';var moment=require('moment');var Sequelize=require(_0x1fc9('0x0'));module['exports']={'phone':{'type':Sequelize[_0x1fc9('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1fc9('0x2')],'unique':_0x1fc9('0x3')},'ListId':{'type':Sequelize[_0x1fc9('0x2')],'unique':_0x1fc9('0x3')},'VoiceQueueId':{'type':Sequelize[_0x1fc9('0x2')],'unique':_0x1fc9('0x3')}}; \ No newline at end of file +var _0x1b20=['contactListQueue','INTEGER','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1b20,0x66));var _0x01b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b20[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x01b2('0x0'));module[_0x01b2('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x01b2('0x2')},'ListId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')},'VoiceQueueId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4861d48..5d17d2f 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 _0x15b3=['set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperBlack','includeAll','include','findAll','rows','show','params','find','catch','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x15b3,0x1b5));var _0x315b=function(_0x24e8d9,_0x43ddb2){_0x24e8d9=_0x24e8d9-0x0;var _0x1a369e=_0x15b3[_0x24e8d9];return _0x1a369e;};'use strict';var emlformat=require(_0x315b('0x0'));var rimraf=require(_0x315b('0x1'));var zipdir=require(_0x315b('0x2'));var jsonpatch=require(_0x315b('0x3'));var rp=require(_0x315b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x315b('0x5'));var util=require('util');var path=require(_0x315b('0x6'));var sox=require(_0x315b('0x7'));var csv=require(_0x315b('0x8'));var ejs=require(_0x315b('0x9'));var fs=require('fs');var fs_extra=require(_0x315b('0xa'));var _=require(_0x315b('0xb'));var squel=require(_0x315b('0xc'));var crypto=require(_0x315b('0xd'));var jsforce=require(_0x315b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x315b('0x8'));var querystring=require('querystring');var Papa=require(_0x315b('0xf'));var Redis=require('ioredis');var authService=require(_0x315b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x315b('0x11'));var hardwareService=require(_0x315b('0x12'));var logger=require(_0x315b('0x13'))(_0x315b('0x14'));var utils=require(_0x315b('0x15'));var config=require(_0x315b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x315b('0x17'))['db'];function respondWithStatusCode(_0x521407,_0x1b69a6){_0x1b69a6=_0x1b69a6||0xcc;return function(_0x503d07){if(_0x503d07){return _0x521407['sendStatus'](_0x1b69a6);}return _0x521407[_0x315b('0x18')](_0x1b69a6)[_0x315b('0x19')]();};}function respondWithResult(_0x8fde7b,_0x3c012c){_0x3c012c=_0x3c012c||0xc8;return function(_0x3bee1e){if(_0x3bee1e){return _0x8fde7b[_0x315b('0x18')](_0x3c012c)[_0x315b('0x1a')](_0x3bee1e);}};}function respondWithFilteredResult(_0x4ec361,_0x2d1d8b){return function(_0x352648){if(_0x352648){var _0x347d9b=typeof _0x2d1d8b[_0x315b('0x1b')]===_0x315b('0x1c')&&typeof _0x2d1d8b[_0x315b('0x1d')]===_0x315b('0x1c');var _0x4c520d=_0x352648[_0x315b('0x1e')];var _0xaaea9=_0x347d9b?0x0:_0x2d1d8b[_0x315b('0x1b')];var _0x18fb63=_0x347d9b?_0x352648[_0x315b('0x1e')]:_0x2d1d8b['offset']+_0x2d1d8b[_0x315b('0x1d')];var _0x58d7fb;if(_0x18fb63>=_0x4c520d){_0x18fb63=_0x4c520d;_0x58d7fb=0xc8;}else{_0x58d7fb=0xce;}_0x4ec361[_0x315b('0x18')](_0x58d7fb);return _0x4ec361[_0x315b('0x1f')](_0x315b('0x20'),_0xaaea9+'-'+_0x18fb63+'/'+_0x4c520d)[_0x315b('0x1a')](_0x352648);}return null;};}function patchUpdates(_0x75b1fc){return function(_0x3d13dd){try{jsonpatch[_0x315b('0x21')](_0x3d13dd,_0x75b1fc,!![]);}catch(_0x47d36f){return BPromise[_0x315b('0x22')](_0x47d36f);}return _0x3d13dd[_0x315b('0x23')]();};}function saveUpdates(_0x26a544,_0x12cdea){return function(_0x4d1e1c){if(_0x4d1e1c){return _0x4d1e1c['update'](_0x26a544)[_0x315b('0x24')](function(_0x112c99){return _0x112c99;});}return null;};}function removeEntity(_0x2e1900,_0x4f19dd){return function(_0x5a4e5f){if(_0x5a4e5f){return _0x5a4e5f[_0x315b('0x25')]()[_0x315b('0x24')](function(){_0x2e1900[_0x315b('0x18')](0xcc)[_0x315b('0x19')]();});}};}function handleEntityNotFound(_0x2d9a8c,_0x49ffd3){return function(_0x16b980){if(!_0x16b980){_0x2d9a8c[_0x315b('0x26')](0x194);}return _0x16b980;};}function handleError(_0x925c48,_0x416f18){_0x416f18=_0x416f18||0x1f4;return function(_0x9bb996){logger[_0x315b('0x27')](_0x9bb996[_0x315b('0x28')]);if(_0x9bb996['name']){delete _0x9bb996['name'];}_0x925c48['status'](_0x416f18)[_0x315b('0x29')](_0x9bb996);};}exports[_0x315b('0x2a')]=function(_0x2890e2,_0x49ed7f){var _0xafc4d6={},_0x3e4dae={},_0x242e57={'count':0x0,'rows':[]};var _0x5257e8=_[_0x315b('0x2b')](db['CmHopperBlack'][_0x315b('0x2c')],function(_0x593f49){return{'name':_0x593f49[_0x315b('0x2d')],'type':_0x593f49[_0x315b('0x2e')][_0x315b('0x2f')]};});_0x3e4dae['model']=_[_0x315b('0x2b')](_0x5257e8,_0x315b('0x30'));_0x3e4dae[_0x315b('0x31')]=_[_0x315b('0x32')](_0x2890e2[_0x315b('0x31')]);_0x3e4dae[_0x315b('0x33')]=_[_0x315b('0x34')](_0x3e4dae[_0x315b('0x35')],_0x3e4dae[_0x315b('0x31')]);_0xafc4d6[_0x315b('0x36')]=_['intersection'](_0x3e4dae[_0x315b('0x35')],qs[_0x315b('0x37')](_0x2890e2['query']['fields']));_0xafc4d6[_0x315b('0x36')]=_0xafc4d6[_0x315b('0x36')]['length']?_0xafc4d6[_0x315b('0x36')]:_0x3e4dae['model'];if(!_0x2890e2[_0x315b('0x31')][_0x315b('0x38')](_0x315b('0x39'))){_0xafc4d6[_0x315b('0x1d')]=qs['limit'](_0x2890e2[_0x315b('0x31')]['limit']);_0xafc4d6[_0x315b('0x1b')]=qs['offset'](_0x2890e2[_0x315b('0x31')]['offset']);}_0xafc4d6[_0x315b('0x3a')]=qs[_0x315b('0x3b')](_0x2890e2[_0x315b('0x31')]['sort']);_0xafc4d6[_0x315b('0x3c')]=qs[_0x315b('0x33')](_[_0x315b('0x3d')](_0x2890e2['query'],_0x3e4dae['filters']),_0x5257e8);if(_0x2890e2[_0x315b('0x31')][_0x315b('0x3e')]){_0xafc4d6[_0x315b('0x3c')]=_['merge'](_0xafc4d6[_0x315b('0x3c')],{'$or':_[_0x315b('0x2b')](_0x5257e8,function(_0x457b5c){if(_0x457b5c['type']!==_0x315b('0x3f')){var _0x350661={};_0x350661[_0x457b5c[_0x315b('0x30')]]={'$like':'%'+_0x2890e2[_0x315b('0x31')][_0x315b('0x3e')]+'%'};return _0x350661;}})});}_0xafc4d6=_[_0x315b('0x40')]({},_0xafc4d6,_0x2890e2[_0x315b('0x41')]);var _0x5b6895={'where':_0xafc4d6[_0x315b('0x3c')]};return db[_0x315b('0x42')][_0x315b('0x1e')](_0x5b6895)['then'](function(_0x1a2559){_0x242e57[_0x315b('0x1e')]=_0x1a2559;if(_0x2890e2[_0x315b('0x31')][_0x315b('0x43')]){_0xafc4d6[_0x315b('0x44')]=[{'all':!![]}];}return db[_0x315b('0x42')][_0x315b('0x45')](_0xafc4d6);})[_0x315b('0x24')](function(_0x1c3c86){_0x242e57[_0x315b('0x46')]=_0x1c3c86;return _0x242e57;})[_0x315b('0x24')](respondWithFilteredResult(_0x49ed7f,_0xafc4d6))['catch'](handleError(_0x49ed7f,null));};exports[_0x315b('0x47')]=function(_0x2596fc,_0x34062e){var _0x3c2de9={'raw':!![],'where':{'id':_0x2596fc[_0x315b('0x48')]['id']}},_0x4ef0a4={};_0x4ef0a4['model']=_['keys'](db[_0x315b('0x42')][_0x315b('0x2c')]);_0x4ef0a4[_0x315b('0x31')]=_['keys'](_0x2596fc[_0x315b('0x31')]);_0x4ef0a4[_0x315b('0x33')]=_[_0x315b('0x34')](_0x4ef0a4[_0x315b('0x35')],_0x4ef0a4[_0x315b('0x31')]);_0x3c2de9[_0x315b('0x36')]=_['intersection'](_0x4ef0a4[_0x315b('0x35')],qs['fields'](_0x2596fc[_0x315b('0x31')][_0x315b('0x37')]));_0x3c2de9[_0x315b('0x36')]=_0x3c2de9[_0x315b('0x36')]['length']?_0x3c2de9[_0x315b('0x36')]:_0x4ef0a4[_0x315b('0x35')];if(_0x2596fc[_0x315b('0x31')][_0x315b('0x43')]){_0x3c2de9['include']=[{'all':!![]}];}_0x3c2de9=_['merge']({},_0x3c2de9,_0x2596fc[_0x315b('0x41')]);return db[_0x315b('0x42')][_0x315b('0x49')](_0x3c2de9)['then'](handleEntityNotFound(_0x34062e,null))['then'](respondWithResult(_0x34062e,null))[_0x315b('0x4a')](handleError(_0x34062e,null));};exports[_0x315b('0x4b')]=function(_0x584947,_0x5e9b2d){if(_0x584947[_0x315b('0x4c')]['id']){delete _0x584947['body']['id'];}return db['CmHopperBlack'][_0x315b('0x49')]({'where':{'id':_0x584947[_0x315b('0x48')]['id']}})[_0x315b('0x24')](handleEntityNotFound(_0x5e9b2d,null))[_0x315b('0x24')](saveUpdates(_0x584947['body'],null))['then'](respondWithResult(_0x5e9b2d,null))['catch'](handleError(_0x5e9b2d,null));};exports['destroy']=function(_0x525eae,_0x30f0bb){return db['CmHopperBlack']['find']({'where':{'id':_0x525eae[_0x315b('0x48')]['id']}})[_0x315b('0x24')](handleEntityNotFound(_0x30f0bb,null))[_0x315b('0x24')](removeEntity(_0x30f0bb,null))[_0x315b('0x4a')](handleError(_0x30f0bb,null));};exports[_0x315b('0x4d')]=function(_0x5e6261,_0x33d65a){return db[_0x315b('0x42')][_0x315b('0x4d')]()['then'](respondWithResult(_0x33d65a,null))[_0x315b('0x4a')](handleError(_0x33d65a,null));}; \ No newline at end of file +var _0x29bb=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','CmHopperBlack','rawAttributes','fieldName','key','model','map','query','keys','filters'];(function(_0x4c3fb,_0x1e1896){var _0x1a5ca1=function(_0x5e1a0a){while(--_0x5e1a0a){_0x4c3fb['push'](_0x4c3fb['shift']());}};_0x1a5ca1(++_0x1e1896);}(_0x29bb,0x13d));var _0xb29b=function(_0x1ad34f,_0x5bdf04){_0x1ad34f=_0x1ad34f-0x0;var _0x2bd8a1=_0x29bb[_0x1ad34f];return _0x2bd8a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb29b('0x0'));var zipdir=require(_0xb29b('0x1'));var jsonpatch=require(_0xb29b('0x2'));var rp=require(_0xb29b('0x3'));var moment=require(_0xb29b('0x4'));var BPromise=require(_0xb29b('0x5'));var Mustache=require('mustache');var util=require(_0xb29b('0x6'));var path=require(_0xb29b('0x7'));var sox=require('sox');var csv=require(_0xb29b('0x8'));var ejs=require(_0xb29b('0x9'));var fs=require('fs');var fs_extra=require(_0xb29b('0xa'));var _=require(_0xb29b('0xb'));var squel=require('squel');var crypto=require(_0xb29b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb29b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb29b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb29b('0xf'));var as=require(_0xb29b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb29b('0x11'))('api');var utils=require(_0xb29b('0x12'));var config=require(_0xb29b('0x13'));var licenseUtil=require(_0xb29b('0x14'));var db=require(_0xb29b('0x15'))['db'];function respondWithStatusCode(_0x1fdcf0,_0x4ada32){_0x4ada32=_0x4ada32||0xcc;return function(_0x29a9d3){if(_0x29a9d3){return _0x1fdcf0[_0xb29b('0x16')](_0x4ada32);}return _0x1fdcf0['status'](_0x4ada32)[_0xb29b('0x17')]();};}function respondWithResult(_0x4a084b,_0x3216d5){_0x3216d5=_0x3216d5||0xc8;return function(_0x5bb483){if(_0x5bb483){return _0x4a084b[_0xb29b('0x18')](_0x3216d5)[_0xb29b('0x19')](_0x5bb483);}};}function respondWithFilteredResult(_0xb67a63,_0x123858){return function(_0x5c2cbb){if(_0x5c2cbb){var _0x31c921=typeof _0x123858[_0xb29b('0x1a')]==='undefined'&&typeof _0x123858[_0xb29b('0x1b')]==='undefined';var _0x53f6a6=_0x5c2cbb[_0xb29b('0x1c')];var _0xd27442=_0x31c921?0x0:_0x123858[_0xb29b('0x1a')];var _0x2fefa5=_0x31c921?_0x5c2cbb[_0xb29b('0x1c')]:_0x123858[_0xb29b('0x1a')]+_0x123858[_0xb29b('0x1b')];var _0x287ae1;if(_0x2fefa5>=_0x53f6a6){_0x2fefa5=_0x53f6a6;_0x287ae1=0xc8;}else{_0x287ae1=0xce;}_0xb67a63[_0xb29b('0x18')](_0x287ae1);return _0xb67a63[_0xb29b('0x1d')]('Content-Range',_0xd27442+'-'+_0x2fefa5+'/'+_0x53f6a6)[_0xb29b('0x19')](_0x5c2cbb);}return null;};}function patchUpdates(_0x4a7e45){return function(_0x46902f){try{jsonpatch['apply'](_0x46902f,_0x4a7e45,!![]);}catch(_0x3a1b05){return BPromise[_0xb29b('0x1e')](_0x3a1b05);}return _0x46902f[_0xb29b('0x1f')]();};}function saveUpdates(_0xce5193,_0x425719){return function(_0x140921){if(_0x140921){return _0x140921[_0xb29b('0x20')](_0xce5193)[_0xb29b('0x21')](function(_0x3bd83d){return _0x3bd83d;});}return null;};}function removeEntity(_0xb083b9,_0x2b21b0){return function(_0x40b983){if(_0x40b983){return _0x40b983[_0xb29b('0x22')]()[_0xb29b('0x21')](function(){_0xb083b9[_0xb29b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15af89,_0x5c0a97){return function(_0x40b3f7){if(!_0x40b3f7){_0x15af89[_0xb29b('0x16')](0x194);}return _0x40b3f7;};}function handleError(_0x35e2f0,_0x2a817b){_0x2a817b=_0x2a817b||0x1f4;return function(_0x37151c){logger[_0xb29b('0x23')](_0x37151c[_0xb29b('0x24')]);if(_0x37151c['name']){delete _0x37151c[_0xb29b('0x25')];}_0x35e2f0['status'](_0x2a817b)[_0xb29b('0x26')](_0x37151c);};}exports['index']=function(_0x5017f1,_0x4b8244){var _0x479eb7={},_0x3418ee={},_0x7f4951={'count':0x0,'rows':[]};var _0x1797c1=_['map'](db[_0xb29b('0x27')][_0xb29b('0x28')],function(_0x4f0f07){return{'name':_0x4f0f07[_0xb29b('0x29')],'type':_0x4f0f07['type'][_0xb29b('0x2a')]};});_0x3418ee[_0xb29b('0x2b')]=_[_0xb29b('0x2c')](_0x1797c1,_0xb29b('0x25'));_0x3418ee[_0xb29b('0x2d')]=_[_0xb29b('0x2e')](_0x5017f1[_0xb29b('0x2d')]);_0x3418ee[_0xb29b('0x2f')]=_[_0xb29b('0x30')](_0x3418ee[_0xb29b('0x2b')],_0x3418ee[_0xb29b('0x2d')]);_0x479eb7[_0xb29b('0x31')]=_['intersection'](_0x3418ee[_0xb29b('0x2b')],qs[_0xb29b('0x32')](_0x5017f1['query'][_0xb29b('0x32')]));_0x479eb7[_0xb29b('0x31')]=_0x479eb7[_0xb29b('0x31')]['length']?_0x479eb7[_0xb29b('0x31')]:_0x3418ee[_0xb29b('0x2b')];if(!_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x33')](_0xb29b('0x34'))){_0x479eb7[_0xb29b('0x1b')]=qs[_0xb29b('0x1b')](_0x5017f1['query'][_0xb29b('0x1b')]);_0x479eb7[_0xb29b('0x1a')]=qs[_0xb29b('0x1a')](_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x1a')]);}_0x479eb7[_0xb29b('0x35')]=qs[_0xb29b('0x36')](_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x36')]);_0x479eb7[_0xb29b('0x37')]=qs[_0xb29b('0x2f')](_[_0xb29b('0x38')](_0x5017f1[_0xb29b('0x2d')],_0x3418ee[_0xb29b('0x2f')]),_0x1797c1);if(_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x39')]){_0x479eb7['where']=_[_0xb29b('0x3a')](_0x479eb7[_0xb29b('0x37')],{'$or':_[_0xb29b('0x2c')](_0x1797c1,function(_0x709396){if(_0x709396[_0xb29b('0x3b')]!==_0xb29b('0x3c')){var _0x4333ba={};_0x4333ba[_0x709396[_0xb29b('0x25')]]={'$like':'%'+_0x5017f1['query']['filter']+'%'};return _0x4333ba;}})});}_0x479eb7=_[_0xb29b('0x3a')]({},_0x479eb7,_0x5017f1['options']);var _0x2e6145={'where':_0x479eb7[_0xb29b('0x37')]};return db[_0xb29b('0x27')][_0xb29b('0x1c')](_0x2e6145)[_0xb29b('0x21')](function(_0x33c24f){_0x7f4951[_0xb29b('0x1c')]=_0x33c24f;if(_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x3d')]){_0x479eb7[_0xb29b('0x3e')]=[{'all':!![]}];}return db[_0xb29b('0x27')][_0xb29b('0x3f')](_0x479eb7);})[_0xb29b('0x21')](function(_0xae6b11){_0x7f4951[_0xb29b('0x40')]=_0xae6b11;return _0x7f4951;})[_0xb29b('0x21')](respondWithFilteredResult(_0x4b8244,_0x479eb7))[_0xb29b('0x41')](handleError(_0x4b8244,null));};exports[_0xb29b('0x42')]=function(_0x5b12ed,_0x4fe3b4){var _0x41f767={'raw':!![],'where':{'id':_0x5b12ed[_0xb29b('0x43')]['id']}},_0x4df48b={};_0x4df48b[_0xb29b('0x2b')]=_[_0xb29b('0x2e')](db['CmHopperBlack'][_0xb29b('0x28')]);_0x4df48b['query']=_[_0xb29b('0x2e')](_0x5b12ed[_0xb29b('0x2d')]);_0x4df48b[_0xb29b('0x2f')]=_[_0xb29b('0x30')](_0x4df48b[_0xb29b('0x2b')],_0x4df48b[_0xb29b('0x2d')]);_0x41f767['attributes']=_[_0xb29b('0x30')](_0x4df48b[_0xb29b('0x2b')],qs[_0xb29b('0x32')](_0x5b12ed[_0xb29b('0x2d')][_0xb29b('0x32')]));_0x41f767[_0xb29b('0x31')]=_0x41f767['attributes'][_0xb29b('0x44')]?_0x41f767[_0xb29b('0x31')]:_0x4df48b[_0xb29b('0x2b')];if(_0x5b12ed[_0xb29b('0x2d')][_0xb29b('0x3d')]){_0x41f767[_0xb29b('0x3e')]=[{'all':!![]}];}_0x41f767=_[_0xb29b('0x3a')]({},_0x41f767,_0x5b12ed[_0xb29b('0x45')]);return db['CmHopperBlack'][_0xb29b('0x46')](_0x41f767)[_0xb29b('0x21')](handleEntityNotFound(_0x4fe3b4,null))[_0xb29b('0x21')](respondWithResult(_0x4fe3b4,null))['catch'](handleError(_0x4fe3b4,null));};exports['update']=function(_0x30f5f6,_0x34eddf){if(_0x30f5f6[_0xb29b('0x47')]['id']){delete _0x30f5f6[_0xb29b('0x47')]['id'];}return db['CmHopperBlack'][_0xb29b('0x46')]({'where':{'id':_0x30f5f6[_0xb29b('0x43')]['id']}})['then'](handleEntityNotFound(_0x34eddf,null))[_0xb29b('0x21')](saveUpdates(_0x30f5f6[_0xb29b('0x47')],null))[_0xb29b('0x21')](respondWithResult(_0x34eddf,null))['catch'](handleError(_0x34eddf,null));};exports[_0xb29b('0x22')]=function(_0x71913d,_0x2946bd){return db[_0xb29b('0x27')][_0xb29b('0x46')]({'where':{'id':_0x71913d[_0xb29b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2946bd,null))['then'](removeEntity(_0x2946bd,null))['catch'](handleError(_0x2946bd,null));};exports[_0xb29b('0x48')]=function(_0x4cc064,_0x40547f){return db[_0xb29b('0x27')][_0xb29b('0x48')]()[_0xb29b('0x21')](respondWithResult(_0x40547f,null))[_0xb29b('0x41')](handleError(_0x40547f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 8242c2d..f2db4f4 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 _0xb386=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','path'];(function(_0x482f2c,_0x50315b){var _0x4637dc=function(_0x56c610){while(--_0x56c610){_0x482f2c['push'](_0x482f2c['shift']());}};_0x4637dc(++_0x50315b);}(_0xb386,0x8a));var _0x6b38=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xb386[_0x44bcb0];return _0xfaf881;};'use strict';var _=require('lodash');var util=require(_0x6b38('0x0'));var logger=require(_0x6b38('0x1'))(_0x6b38('0x2'));var moment=require(_0x6b38('0x3'));var BPromise=require(_0x6b38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b38('0x5'));var rimraf=require(_0x6b38('0x6'));var config=require(_0x6b38('0x7'));var attributes=require(_0x6b38('0x8'));module[_0x6b38('0x9')]=function(_0x42d897,_0xe60aae){return _0x42d897['define'](_0x6b38('0xa'),attributes,{'tableName':_0x6b38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b46=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','moment'];(function(_0xbb36a0,_0x1cb1e4){var _0x306db2=function(_0xc63ad3){while(--_0xc63ad3){_0xbb36a0['push'](_0xbb36a0['shift']());}};_0x306db2(++_0x1cb1e4);}(_0x8b46,0x69));var _0x68b4=function(_0x4a0719,_0x5bdc5a){_0x4a0719=_0x4a0719-0x0;var _0x1c0447=_0x8b46[_0x4a0719];return _0x1c0447;};'use strict';var _=require(_0x68b4('0x0'));var util=require(_0x68b4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x68b4('0x2'));var BPromise=require(_0x68b4('0x3'));var rp=require(_0x68b4('0x4'));var fs=require('fs');var path=require(_0x68b4('0x5'));var rimraf=require(_0x68b4('0x6'));var config=require(_0x68b4('0x7'));var attributes=require(_0x68b4('0x8'));module[_0x68b4('0x9')]=function(_0x46f321,_0x36cc03){return _0x46f321['define'](_0x68b4('0xa'),attributes,{'tableName':_0x68b4('0xb'),'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 c62252f..09634a4 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 _0x364d=['../../config/utils','../../config/logger','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','then','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','CmHopperBlack','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x12e011,_0x17e4c7){var _0x5d8f5b=function(_0x33f338){while(--_0x33f338){_0x12e011['push'](_0x12e011['shift']());}};_0x5d8f5b(++_0x17e4c7);}(_0x364d,0x1b6));var _0xd364=function(_0x17d20a,_0x22507f){_0x17d20a=_0x17d20a-0x0;var _0x45464f=_0x364d[_0x17d20a];return _0x45464f;};'use strict';var _=require(_0xd364('0x0'));var util=require(_0xd364('0x1'));var moment=require(_0xd364('0x2'));var BPromise=require(_0xd364('0x3'));var rs=require(_0xd364('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd364('0x5'))['db'];var utils=require(_0xd364('0x6'));var logger=require(_0xd364('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd364('0x8')][_0xd364('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x588944,_0x233afb,_0x324de7){return new BPromise(function(_0x58fd17,_0x504831){return client[_0xd364('0xa')](_0x588944,_0x324de7)['then'](function(_0x3d3f90){logger[_0xd364('0xb')](_0xd364('0xc'),_0x233afb,_0xd364('0xd'));logger[_0xd364('0xe')](_0xd364('0xf'),_0x233afb,_0xd364('0xd'),JSON[_0xd364('0x10')](_0x3d3f90));if(_0x3d3f90[_0xd364('0x11')]){if(_0x3d3f90[_0xd364('0x11')]['code']===0x1f4){logger[_0xd364('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x233afb,_0x3d3f90[_0xd364('0x11')][_0xd364('0x12')]);return _0x504831(_0x3d3f90[_0xd364('0x11')][_0xd364('0x12')]);}logger[_0xd364('0x11')](_0xd364('0xc'),_0x233afb,_0x3d3f90['error']['message']);return _0x58fd17(_0x3d3f90[_0xd364('0x11')]['message']);}else{logger[_0xd364('0xb')](_0xd364('0xc'),_0x233afb,_0xd364('0xd'));_0x58fd17(_0x3d3f90[_0xd364('0x13')][_0xd364('0x12')]);}})[_0xd364('0x14')](function(_0x2f1882){logger[_0xd364('0x11')](_0xd364('0xc'),_0x233afb,_0x2f1882);_0x504831(_0x2f1882);});});}exports[_0xd364('0x15')]=function(_0x6d02a8){var _0x5cb159=this;return new Promise(function(_0x2e298c,_0x1399f7){return db['CmHopperBlack'][_0xd364('0x16')]({'raw':_0x6d02a8[_0xd364('0x17')]?_0x6d02a8[_0xd364('0x17')][_0xd364('0x18')]===undefined?!![]:![]:!![],'where':_0x6d02a8['options']?_0x6d02a8['options'][_0xd364('0x19')]||null:null,'attributes':_0x6d02a8[_0xd364('0x17')]?_0x6d02a8['options'][_0xd364('0x1a')]||null:null,'limit':_0x6d02a8[_0xd364('0x17')]?_0x6d02a8['options'][_0xd364('0x1b')]||null:null,'include':_0x6d02a8['options']?_0x6d02a8[_0xd364('0x17')][_0xd364('0x1c')]?_[_0xd364('0x1d')](_0x6d02a8[_0xd364('0x17')]['include'],function(_0x4fb3d2){return{'model':db[_0x4fb3d2[_0xd364('0x1e')]],'as':_0x4fb3d2['as'],'attributes':_0x4fb3d2[_0xd364('0x1a')],'include':_0x4fb3d2[_0xd364('0x1c')]?_['map'](_0x4fb3d2[_0xd364('0x1c')],function(_0x59f7bb){return{'model':db[_0x59f7bb['model']],'as':_0x59f7bb['as'],'attributes':_0x59f7bb[_0xd364('0x1a')],'include':_0x59f7bb[_0xd364('0x1c')]?_[_0xd364('0x1d')](_0x59f7bb['include'],function(_0x264f77){return{'model':db[_0x264f77[_0xd364('0x1e')]],'as':_0x264f77['as'],'attributes':_0x264f77['attributes']};}):[]};}):[]};}):[]:[]})[_0xd364('0x1f')](function(_0x1273fa){logger['info'](_0xd364('0x15'),_0x6d02a8);logger[_0xd364('0xe')]('GetCmHopperBlack',_0x6d02a8,JSON[_0xd364('0x10')](_0x1273fa));_0x2e298c(_0x1273fa);})[_0xd364('0x14')](function(_0x7d56a6){logger[_0xd364('0x11')](_0xd364('0x15'),_0x7d56a6['message'],_0x6d02a8);_0x1399f7(_0x5cb159['error'](0x1f4,_0x7d56a6[_0xd364('0x12')]));});});};exports[_0xd364('0x20')]=function(_0x1e8328){var _0x328b55=this;return new Promise(function(_0x221eb3,_0x506edf){return db['CmHopperBlack'][_0xd364('0x21')](_0x1e8328[_0xd364('0x22')],{'raw':_0x1e8328[_0xd364('0x17')]?_0x1e8328[_0xd364('0x17')][_0xd364('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8328[_0xd364('0x17')]?_0x1e8328[_0xd364('0x17')][_0xd364('0x19')]||null:null,'attributes':_0x1e8328[_0xd364('0x17')]?_0x1e8328[_0xd364('0x17')][_0xd364('0x1a')]||null:null,'limit':_0x1e8328[_0xd364('0x17')]?_0x1e8328[_0xd364('0x17')][_0xd364('0x1b')]||null:null})[_0xd364('0x1f')](function(_0x14cc60){logger[_0xd364('0xb')]('UpdateCmHopperBlack',_0x1e8328);logger[_0xd364('0xe')]('UpdateCmHopperBlack',_0x1e8328,JSON[_0xd364('0x10')](_0x14cc60));_0x221eb3(_0x14cc60);})[_0xd364('0x14')](function(_0x289257){logger['error'](_0xd364('0x20'),_0x289257[_0xd364('0x12')],_0x1e8328);_0x506edf(_0x328b55[_0xd364('0x11')](0x1f4,_0x289257[_0xd364('0x12')]));});});};exports[_0xd364('0x23')]=function(_0x14b7b5){var _0xb201c3=this;return new Promise(function(_0x14e5a1,_0x1a4f21){return db[_0xd364('0x24')]['destroy']({'where':_0x14b7b5[_0xd364('0x17')]?_0x14b7b5[_0xd364('0x17')]['where']||null:null})[_0xd364('0x1f')](function(_0x3351d6){logger[_0xd364('0xb')](_0xd364('0x23'),_0x14b7b5);logger[_0xd364('0xe')](_0xd364('0x23'),_0x14b7b5,JSON['stringify'](_0x3351d6));_0x14e5a1(_0x3351d6);})[_0xd364('0x14')](function(_0x63d2ef){logger['error'](_0xd364('0x23'),_0x63d2ef[_0xd364('0x12')],_0x14b7b5);_0x1a4f21(_0xb201c3[_0xd364('0x11')](0x1f4,_0x63d2ef[_0xd364('0x12')]));});});}; \ No newline at end of file +var _0x9b36=['request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x7584cb,_0x2a13ff){var _0x40256c=function(_0x111065){while(--_0x111065){_0x7584cb['push'](_0x7584cb['shift']());}};_0x40256c(++_0x2a13ff);}(_0x9b36,0x108));var _0x69b3=function(_0x112e48,_0x478649){_0x112e48=_0x112e48-0x0;var _0x3c80c0=_0x9b36[_0x112e48];return _0x3c80c0;};'use strict';var _=require('lodash');var util=require(_0x69b3('0x0'));var moment=require(_0x69b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x69b3('0x3'));var logger=require(_0x69b3('0x4'))(_0x69b3('0x5'));var config=require(_0x69b3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x69b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15ce13,_0x4f6fd6,_0x2da3e9){return new BPromise(function(_0xc1980b,_0x30cfbd){return client[_0x69b3('0x8')](_0x15ce13,_0x2da3e9)[_0x69b3('0x9')](function(_0x289535){logger[_0x69b3('0xa')](_0x69b3('0xb'),_0x4f6fd6,'request\x20sent');logger['debug'](_0x69b3('0xc'),_0x4f6fd6,_0x69b3('0xd'),JSON[_0x69b3('0xe')](_0x289535));if(_0x289535['error']){if(_0x289535[_0x69b3('0xf')]['code']===0x1f4){logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x289535[_0x69b3('0xf')][_0x69b3('0x10')]);return _0x30cfbd(_0x289535['error'][_0x69b3('0x10')]);}logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x289535['error'][_0x69b3('0x10')]);return _0xc1980b(_0x289535['error']['message']);}else{logger[_0x69b3('0xa')](_0x69b3('0xb'),_0x4f6fd6,_0x69b3('0xd'));_0xc1980b(_0x289535[_0x69b3('0x11')][_0x69b3('0x10')]);}})[_0x69b3('0x12')](function(_0x1f0535){logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x1f0535);_0x30cfbd(_0x1f0535);});});}exports[_0x69b3('0x13')]=function(_0x386ce0){var _0x231cba=this;return new Promise(function(_0x7c2796,_0xbc5135){return db[_0x69b3('0x14')][_0x69b3('0x15')]({'raw':_0x386ce0['options']?_0x386ce0[_0x69b3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x386ce0[_0x69b3('0x16')]?_0x386ce0[_0x69b3('0x16')][_0x69b3('0x17')]||null:null,'attributes':_0x386ce0[_0x69b3('0x16')]?_0x386ce0['options'][_0x69b3('0x18')]||null:null,'limit':_0x386ce0[_0x69b3('0x16')]?_0x386ce0['options'][_0x69b3('0x19')]||null:null,'include':_0x386ce0[_0x69b3('0x16')]?_0x386ce0[_0x69b3('0x16')][_0x69b3('0x1a')]?_[_0x69b3('0x1b')](_0x386ce0[_0x69b3('0x16')][_0x69b3('0x1a')],function(_0x5a3dd6){return{'model':db[_0x5a3dd6['model']],'as':_0x5a3dd6['as'],'attributes':_0x5a3dd6[_0x69b3('0x18')],'include':_0x5a3dd6[_0x69b3('0x1a')]?_['map'](_0x5a3dd6[_0x69b3('0x1a')],function(_0x83eda8){return{'model':db[_0x83eda8[_0x69b3('0x1c')]],'as':_0x83eda8['as'],'attributes':_0x83eda8[_0x69b3('0x18')],'include':_0x83eda8['include']?_['map'](_0x83eda8[_0x69b3('0x1a')],function(_0x55acba){return{'model':db[_0x55acba[_0x69b3('0x1c')]],'as':_0x55acba['as'],'attributes':_0x55acba[_0x69b3('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ed1ba){logger['info'](_0x69b3('0x13'),_0x386ce0);logger[_0x69b3('0x1d')](_0x69b3('0x13'),_0x386ce0,JSON[_0x69b3('0xe')](_0x4ed1ba));_0x7c2796(_0x4ed1ba);})['catch'](function(_0x228f39){logger[_0x69b3('0xf')](_0x69b3('0x13'),_0x228f39[_0x69b3('0x10')],_0x386ce0);_0xbc5135(_0x231cba[_0x69b3('0xf')](0x1f4,_0x228f39[_0x69b3('0x10')]));});});};exports[_0x69b3('0x1e')]=function(_0x1bbe21){var _0x4d2b93=this;return new Promise(function(_0xcd1360,_0xb9a3dc){return db[_0x69b3('0x14')][_0x69b3('0x1f')](_0x1bbe21[_0x69b3('0x20')],{'raw':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bbe21['options']?_0x1bbe21[_0x69b3('0x16')][_0x69b3('0x17')]||null:null,'attributes':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')][_0x69b3('0x18')]||null:null,'limit':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')]['limit']||null:null})['then'](function(_0x1d75ea){logger['info'](_0x69b3('0x1e'),_0x1bbe21);logger['debug'](_0x69b3('0x1e'),_0x1bbe21,JSON[_0x69b3('0xe')](_0x1d75ea));_0xcd1360(_0x1d75ea);})['catch'](function(_0x403605){logger[_0x69b3('0xf')]('UpdateCmHopperBlack',_0x403605[_0x69b3('0x10')],_0x1bbe21);_0xb9a3dc(_0x4d2b93['error'](0x1f4,_0x403605[_0x69b3('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x4ca159){var _0x2356da=this;return new Promise(function(_0x28b8a3,_0xdadaf8){return db[_0x69b3('0x14')]['destroy']({'where':_0x4ca159['options']?_0x4ca159[_0x69b3('0x16')]['where']||null:null})['then'](function(_0xa2e1dc){logger[_0x69b3('0xa')](_0x69b3('0x21'),_0x4ca159);logger[_0x69b3('0x1d')](_0x69b3('0x21'),_0x4ca159,JSON[_0x69b3('0xe')](_0xa2e1dc));_0x28b8a3(_0xa2e1dc);})[_0x69b3('0x12')](function(_0x59acab){logger[_0x69b3('0xf')](_0x69b3('0x21'),_0x59acab[_0x69b3('0x10')],_0x4ca159);_0xdadaf8(_0x2356da[_0x69b3('0xf')](0x1f4,_0x59acab[_0x69b3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 08be388..79460e3 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 _0x7a54=['./cmHopperBlack.controller','get','index','/describe','isAuthenticated','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x58fba6,_0x2b2ae4){var _0xb4f7bb=function(_0x10f7a5){while(--_0x10f7a5){_0x58fba6['push'](_0x58fba6['shift']());}};_0xb4f7bb(++_0x2b2ae4);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1fab,_0x2198cf){_0x1c1fab=_0x1c1fab-0x0;var _0x1e0131=_0x7a54[_0x1c1fab];return _0x1e0131;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router['delete']('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x10')]);module[_0x47a5('0x11')]=router; \ No newline at end of file +var _0x9a5a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x214943,_0x3c9fd9){var _0x35b759=function(_0x4be178){while(--_0x4be178){_0x214943['push'](_0x214943['shift']());}};_0x35b759(++_0x3c9fd9);}(_0x9a5a,0x194));var _0xa9a5=function(_0xe6ed26,_0x309afb){_0xe6ed26=_0xe6ed26-0x0;var _0x20e59a=_0x9a5a[_0xe6ed26];return _0x20e59a;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')](_0xa9a5('0x11'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x12')]);router[_0xa9a5('0x13')](_0xa9a5('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 44b7ff8..bd2ba79 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 _0x0451=['moment','exports','STRING','DATE','INTEGER','getDataValue','followuptime','diff','BOOLEAN','sequelize'];(function(_0x403a0c,_0x16c578){var _0x5c34b6=function(_0x4fe6e7){while(--_0x4fe6e7){_0x403a0c['push'](_0x403a0c['shift']());}};_0x5c34b6(++_0x16c578);}(_0x0451,0x1e9));var _0x1045=function(_0x27830a,_0x4e8504){_0x27830a=_0x27830a-0x0;var _0x32ccc3=_0x0451[_0x27830a];return _0x32ccc3;};'use strict';var Sequelize=require(_0x1045('0x0'));var moment=require(_0x1045('0x1'));module[_0x1045('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x1045('0x3')]},'scheduledat':{'type':Sequelize[_0x1045('0x4')]},'countbusyretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1045('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x1045('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1045('0x3')]},'starttime':{'type':Sequelize[_0x1045('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1045('0x4')]},'endtime':{'type':Sequelize[_0x1045('0x4')]},'ringtime':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1045('0x3')]},'campaign':{'type':Sequelize[_0x1045('0x3')]},'campaigntype':{'type':Sequelize[_0x1045('0x3')]},'membername':{'type':Sequelize[_0x1045('0x3')]},'reason':{'type':Sequelize[_0x1045('0x3')]},'disposition':{'type':Sequelize[_0x1045('0x3')]},'secondDisposition':{'type':Sequelize[_0x1045('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1045('0x3')]},'dispositionat':{'type':Sequelize[_0x1045('0x4')],'set':function(_0x147323){var _0x8d8a4a=this[_0x1045('0x6')]('endtime');if(_0x8d8a4a&&_0x147323){this['setDataValue'](_0x1045('0x7'),moment(_0x147323)[_0x1045('0x8')](moment(_0x8d8a4a),'seconds'));}}},'amd':{'type':Sequelize[_0x1045('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1045('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1045('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1045('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1045('0x4')]},'deleted':{'type':Sequelize[_0x1045('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1045('0x4')]},'recallme':{'type':Sequelize[_0x1045('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1045('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x264b=['DATE','getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2f8bc6,_0x4dc869){var _0x2d008a=function(_0x276072){while(--_0x276072){_0x2f8bc6['push'](_0x2f8bc6['shift']());}};_0x2d008a(++_0x4dc869);}(_0x264b,0x7e));var _0xb264=function(_0xa8f4e9,_0x3d27d2){_0xa8f4e9=_0xa8f4e9-0x0;var _0x15a8fc=_0x264b[_0xa8f4e9];return _0x15a8fc;};'use strict';var Sequelize=require(_0xb264('0x0'));var moment=require('moment');module[_0xb264('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb264('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb264('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb264('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb264('0x2')]},'calleridname':{'type':Sequelize[_0xb264('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb264('0x4')]},'droptime':{'type':Sequelize[_0xb264('0x4')]},'endtime':{'type':Sequelize[_0xb264('0x4')]},'ringtime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb264('0x2')]},'campaign':{'type':Sequelize[_0xb264('0x2')]},'campaigntype':{'type':Sequelize[_0xb264('0x2')]},'membername':{'type':Sequelize[_0xb264('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb264('0x2')]},'secondDisposition':{'type':Sequelize[_0xb264('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb264('0x2')]},'dispositionat':{'type':Sequelize[_0xb264('0x4')],'set':function(_0xed8f5){var _0x387158=this[_0xb264('0x5')]('endtime');if(_0x387158&&_0xed8f5){this[_0xb264('0x6')](_0xb264('0x7'),moment(_0xed8f5)['diff'](moment(_0x387158),_0xb264('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb264('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb264('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb264('0x4')]},'recallme':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb264('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index c009c73..2fdf179 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 _0xe2fe=['calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','select','calleridnum','state\x20=\x204','group','scheduledAt','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','CmHopperFinal','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state'];(function(_0x4bb674,_0x54df68){var _0x3a0789=function(_0x675178){while(--_0x675178){_0x4bb674['push'](_0x4bb674['shift']());}};_0x3a0789(++_0x54df68);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['CmHopperFinal']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':!![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['describe']=function(_0x1609f0,_0x54cc44){return db['CmHopperFinal']['describe']()['then'](respondWithResult(_0x54cc44,null))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x32da72,_0x584383){if(_0x32da72[_0xee2f('0x3e')]['uniqueid']){delete _0x32da72[_0xee2f('0x3e')][_0xee2f('0x3f')];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'uniqueid':_0x32da72[_0xee2f('0x40')]['id']}})['then'](handleEntityNotFound(_0x584383,null))['then'](saveUpdates(_0x32da72[_0xee2f('0x3e')],null))['then'](respondWithResult(_0x584383,null))[_0xee2f('0x3b')](handleError(_0x584383,null));};exports[_0xee2f('0x41')]=function(_0x1928f8,_0x88e683,_0x4fb3a0){return db['CmHopperFinal'][_0xee2f('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x1928f8[_0xee2f('0x40')]['id']},'attributes':[[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x46')))),_0xee2f('0x47')],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db['sequelize'][_0xee2f('0x45')](_0xee2f('0x48')))),_0xee2f('0x49')],[db[_0xee2f('0x43')]['fn']('COUNT',db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x4a')))),_0xee2f('0x4b')],[db['sequelize']['fn'](_0xee2f('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0xee2f('0x45')](_0xee2f('0x4c')))),_0xee2f('0x4d')],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')]['literal'](_0xee2f('0x4e')))),_0xee2f('0x4f')],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x50')))),_0xee2f('0x51')],[db['sequelize']['fn'](_0xee2f('0x44'),db['sequelize']['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x52')))),_0xee2f('0x53')],[db[_0xee2f('0x43')]['fn']('COUNT',db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x54')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x88e683,null))['then'](respondWithResult(_0x88e683,null))['catch'](handleError(_0x88e683,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x8f90e6,_0x511e54,_0x2891ed){return db[_0xee2f('0x23')][_0xee2f('0x42')]({'raw':![],'where':{'CampaignId':_0x8f90e6[_0xee2f('0x40')]['id']},'attributes':[[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0xee2f('0x45')]('`state`\x20=\x200,\x201,\x20null'))),_0xee2f('0x47')],[db['sequelize']['fn'](_0xee2f('0x44'),db['sequelize']['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x48')))),'noAnswerContacts'],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x4a')))),_0xee2f('0x4b')],[db['sequelize']['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')](_0xee2f('0x4c')))),_0xee2f('0x4d')],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xee2f('0x4f')],[db[_0xee2f('0x43')]['fn']('COUNT',db[_0xee2f('0x43')]['fn']('IF',db['sequelize'][_0xee2f('0x45')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db[_0xee2f('0x43')]['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')]('`state`\x20=\x2022,\x201,\x20null'))),_0xee2f('0x53')],[db[_0xee2f('0x43')]['fn'](_0xee2f('0x44'),db['sequelize']['fn']('IF',db[_0xee2f('0x43')][_0xee2f('0x45')]('`state`\x20=\x2019,\x201,\x20null'))),_0xee2f('0x55')]]})[_0xee2f('0x1c')](handleEntityNotFound(_0x511e54,null))[_0xee2f('0x1c')](respondWithResult(_0x511e54,null))[_0xee2f('0x3b')](handleError(_0x511e54,null));};exports[_0xee2f('0x56')]=function(_0x2adcc6,_0x43b883,_0x97edb2){return db[_0xee2f('0x57')]['find']({'where':{'id':_0x2adcc6['params']['id']}})['then'](handleEntityNotFound(_0x43b883,null))[_0xee2f('0x1c')](function(_0x19ce25){var _0x4288eb;if(_0x19ce25){_0x4288eb=squel[_0xee2f('0x58')]()[_0xee2f('0x59')]('cm_hopper')[_0xee2f('0x5a')]([_0xee2f('0x5b'),'scheduledAt',_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x5e'),'createdAt',_0xee2f('0x5f')],squel['select']()[_0xee2f('0x60')](_0xee2f('0x61'),'phone')[_0xee2f('0x60')](_0xee2f('0x62'),'scheduledAt')['field']('ANY_VALUE(ContactId)',_0xee2f('0x5c'))['field']('ANY_VALUE(ListId)',_0xee2f('0x5d'))[_0xee2f('0x60')]('ANY_VALUE(VoiceQueueId)',_0xee2f('0x5e'))['field'](_0xee2f('0x62'),_0xee2f('0x63'))[_0xee2f('0x60')](_0xee2f('0x62'),_0xee2f('0x5f'))[_0xee2f('0x64')](_0xee2f('0x65'))['where'](_0xee2f('0x66'),_0x2adcc6[_0xee2f('0x40')]['id'][_0xee2f('0x67')]())[_0xee2f('0x32')](_0xee2f('0x68'),_0x2adcc6['body'][_0xee2f('0x69')][_0xee2f('0x67')]())[_0xee2f('0x32')](_0xee2f('0x6a'))[_0xee2f('0x32')](_0xee2f('0x6b'),squel['select']()['field'](_0xee2f('0x5b'))[_0xee2f('0x64')](_0xee2f('0x6c'))[_0xee2f('0x32')](_0xee2f('0x66'),_0x2adcc6[_0xee2f('0x40')]['id'][_0xee2f('0x67')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xee2f('0x6d')]()[_0xee2f('0x60')](_0xee2f('0x6e'))[_0xee2f('0x64')](_0xee2f('0x65'))[_0xee2f('0x32')](_0xee2f('0x66'),_0x2adcc6[_0xee2f('0x40')]['id'][_0xee2f('0x67')]())[_0xee2f('0x32')](_0xee2f('0x6f')))[_0xee2f('0x70')]('ContactId'))['toString']();return db[_0xee2f('0x43')]['query'](_0x4288eb);}return[];})['then'](respondWithResult(_0x43b883,null))['catch'](handleError(_0x43b883,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2ea31f,_0x277507,_0x500459){return db['Campaign'][_0xee2f('0x3d')]({'where':{'id':_0x2ea31f[_0xee2f('0x40')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x277507,null))['then'](function(_0x4aeae5){var _0x2b6f0f;if(_0x4aeae5){_0x2b6f0f=squel[_0xee2f('0x58')]()[_0xee2f('0x59')]('cm_hopper')[_0xee2f('0x5a')](['phone',_0xee2f('0x71'),'ContactId',_0xee2f('0x5d'),_0xee2f('0x72'),_0xee2f('0x63'),'updatedAt'],squel['select']()[_0xee2f('0x60')](_0xee2f('0x61'),_0xee2f('0x5b'))['field'](_0xee2f('0x62'),_0xee2f('0x71'))[_0xee2f('0x60')](_0xee2f('0x73'),_0xee2f('0x5c'))[_0xee2f('0x60')](_0xee2f('0x74'),_0xee2f('0x5d'))[_0xee2f('0x60')](_0xee2f('0x75'),_0xee2f('0x72'))[_0xee2f('0x60')](_0xee2f('0x62'),_0xee2f('0x63'))['field'](_0xee2f('0x62'),_0xee2f('0x5f'))[_0xee2f('0x64')](_0xee2f('0x65'))[_0xee2f('0x32')](_0xee2f('0x76'),_0x2ea31f[_0xee2f('0x40')]['id'][_0xee2f('0x67')]())[_0xee2f('0x32')](_0xee2f('0x68'),_0x2ea31f[_0xee2f('0x3e')]['state'][_0xee2f('0x67')]())[_0xee2f('0x32')](_0xee2f('0x6a'))[_0xee2f('0x32')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xee2f('0x6d')]()[_0xee2f('0x60')](_0xee2f('0x5b'))['from']('cm_hopper')[_0xee2f('0x32')]('CampaignId\x20=\x20?',_0x2ea31f['params']['id']['toString']()))[_0xee2f('0x32')](_0xee2f('0x6b'),squel[_0xee2f('0x6d')]()[_0xee2f('0x60')]('calleridnum')[_0xee2f('0x64')](_0xee2f('0x65'))[_0xee2f('0x32')]('CampaignId\x20=\x20?',_0x2ea31f[_0xee2f('0x40')]['id']['toString']())[_0xee2f('0x32')]('state\x20=\x204'))['group'](_0xee2f('0x5c')))['toString']();return db[_0xee2f('0x43')]['query'](_0x2b6f0f);}return[];})['then'](respondWithResult(_0x277507,null))[_0xee2f('0x3b')](handleError(_0x277507,null));};exports[_0xee2f('0x77')]=function(_0x4fed80,_0x2685ed,_0x34f882){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x4fed80[_0xee2f('0x3e')][_0xee2f('0x5e')],'CampaignId':_0x4fed80['body'][_0xee2f('0x72')],'ContactId':_0x4fed80[_0xee2f('0x3e')][_0xee2f('0x5c')]}})[_0xee2f('0x1c')](handleEntityNotFound(_0x2685ed,null))[_0xee2f('0x1c')](function(_0x4f20e9){if(_0x4f20e9){return _0x4f20e9;}return null;})['then'](respondWithResult(_0x2685ed,null))['catch'](handleError(_0x2685ed,null));}; \ No newline at end of file +var _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4975,0x86));var _0x5497=function(_0x1b8ee9,_0xf49a87){_0x1b8ee9=_0x1b8ee9-0x0;var _0x370d33=_0x4975[_0x1b8ee9];return _0x370d33;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2236914..2d81737 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 _0xe341=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x495cd9,_0x473944){var _0x47caf1=function(_0x58de3f){while(--_0x58de3f){_0x495cd9['push'](_0x495cd9['shift']());}};_0x47caf1(++_0x473944);}(_0xe341,0x1a7));var _0x1e34=function(_0x31d5cf,_0x5f09dc){_0x31d5cf=_0x31d5cf-0x0;var _0x41457d=_0xe341[_0x31d5cf];return _0x41457d;};'use strict';var _=require(_0x1e34('0x0'));var util=require('util');var logger=require(_0x1e34('0x1'))(_0x1e34('0x2'));var moment=require(_0x1e34('0x3'));var BPromise=require(_0x1e34('0x4'));var rp=require(_0x1e34('0x5'));var fs=require('fs');var path=require(_0x1e34('0x6'));var rimraf=require('rimraf');var config=require(_0x1e34('0x7'));var attributes=require(_0x1e34('0x8'));module[_0x1e34('0x9')]=function(_0xc479e5,_0x2431bd){return _0xc479e5[_0x1e34('0xa')](_0x1e34('0xb'),attributes,{'tableName':_0x1e34('0xc'),'paranoid':![],'indexes':[{'name':_0x1e34('0xd'),'fields':[_0x1e34('0xd')]},{'name':'uniqueid','fields':[_0x1e34('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a6b=['request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x7a6b,0x10b));var _0xb7a6=function(_0x363593,_0x3b4415){_0x363593=_0x363593-0x0;var _0x439351=_0x7a6b[_0x363593];return _0x439351;};'use strict';var _=require(_0xb7a6('0x0'));var util=require(_0xb7a6('0x1'));var logger=require('../../config/logger')(_0xb7a6('0x2'));var moment=require(_0xb7a6('0x3'));var BPromise=require(_0xb7a6('0x4'));var rp=require(_0xb7a6('0x5'));var fs=require('fs');var path=require(_0xb7a6('0x6'));var rimraf=require(_0xb7a6('0x7'));var config=require(_0xb7a6('0x8'));var attributes=require(_0xb7a6('0x9'));module[_0xb7a6('0xa')]=function(_0x426d51,_0x2288cb){return _0x426d51[_0xb7a6('0xb')](_0xb7a6('0xc'),attributes,{'tableName':_0xb7a6('0xd'),'paranoid':![],'indexes':[{'name':_0xb7a6('0xe'),'fields':[_0xb7a6('0xe')]},{'name':_0xb7a6('0xf'),'fields':[_0xb7a6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 17cccbd..56bc194 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x505fb9,_0x523d8c){var _0xe92130=function(_0x84aedd){while(--_0x84aedd){_0x505fb9['push'](_0x505fb9['shift']());}};_0xe92130(++_0x523d8c);}(_0x7a54,0x106));var _0x47a5=function(_0x5f83b0,_0x42c10b){_0x5f83b0=_0x5f83b0-0x0;var _0x269210=_0x7a54[_0x5f83b0];return _0x269210;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x5b99cc,_0x859705){var _0x16023c=function(_0x633bb3){while(--_0x633bb3){_0x5b99cc['push'](_0x5b99cc['shift']());}};_0x16023c(++_0x859705);}(_0xb10b,0x12a));var _0xbb10=function(_0x323c59,_0x2fa7f5){_0x323c59=_0x323c59-0x0;var _0x4b2831=_0xb10b[_0x323c59];return _0x4b2831;};'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 9f388de..8037589 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 _0x3a40=['moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id'];(function(_0x418c22,_0x4e5aca){var _0x301349=function(_0x3c1fa8){while(--_0x3c1fa8){_0x418c22['push'](_0x418c22['shift']());}};_0x301349(++_0x4e5aca);}(_0x3a40,0x1ab));var _0x03a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a40[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x03a4('0x0'));var util=require(_0x03a4('0x1'));var path=require(_0x03a4('0x2'));var timeout=require(_0x03a4('0x3'));var express=require(_0x03a4('0x4'));var router=express[_0x03a4('0x5')]();var fs_extra=require(_0x03a4('0x6'));var auth=require(_0x03a4('0x7'));var interaction=require(_0x03a4('0x8'));var config=require(_0x03a4('0x9'));var controller=require(_0x03a4('0xa'));router[_0x03a4('0xb')]('/',auth[_0x03a4('0xc')](),controller[_0x03a4('0xd')]);router[_0x03a4('0xb')](_0x03a4('0xe'),auth[_0x03a4('0xc')](),controller[_0x03a4('0xf')]);router[_0x03a4('0xb')]('/:id',auth[_0x03a4('0xc')](),controller[_0x03a4('0x10')]);router[_0x03a4('0xb')](_0x03a4('0x11'),auth[_0x03a4('0xc')](),controller[_0x03a4('0x12')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x03a4('0x13')](_0x03a4('0x14'),auth[_0x03a4('0xc')](),controller[_0x03a4('0x15')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0x03a4('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x03a4('0x16'),auth[_0x03a4('0xc')](),controller[_0x03a4('0x17')]);router[_0x03a4('0x18')](_0x03a4('0x19'),auth[_0x03a4('0xc')](),controller[_0x03a4('0x1a')]);module[_0x03a4('0x1b')]=router; \ No newline at end of file +var _0x7985=['/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index'];(function(_0x3f724c,_0x387c3b){var _0x31b1e4=function(_0xe51cb3){while(--_0xe51cb3){_0x3f724c['push'](_0x3f724c['shift']());}};_0x31b1e4(++_0x387c3b);}(_0x7985,0x128));var _0x5798=function(_0xc721f5,_0x42404b){_0xc721f5=_0xc721f5-0x0;var _0x1bc1bd=_0x7985[_0xc721f5];return _0x1bc1bd;};'use strict';var multer=require(_0x5798('0x0'));var util=require(_0x5798('0x1'));var path=require(_0x5798('0x2'));var timeout=require(_0x5798('0x3'));var express=require(_0x5798('0x4'));var router=express['Router']();var fs_extra=require(_0x5798('0x5'));var auth=require(_0x5798('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5798('0x7'));var controller=require(_0x5798('0x8'));router[_0x5798('0x9')]('/',auth[_0x5798('0xa')](),controller[_0x5798('0xb')]);router[_0x5798('0x9')](_0x5798('0xc'),auth[_0x5798('0xa')](),controller[_0x5798('0xd')]);router['get'](_0x5798('0xe'),auth[_0x5798('0xa')](),controller[_0x5798('0xf')]);router[_0x5798('0x9')](_0x5798('0x10'),auth[_0x5798('0xa')](),controller[_0x5798('0x11')]);router[_0x5798('0x9')](_0x5798('0x12'),auth['isAuthenticated'](),controller[_0x5798('0x13')]);router[_0x5798('0x14')](_0x5798('0x15'),auth[_0x5798('0xa')](),controller[_0x5798('0x16')]);router[_0x5798('0x14')](_0x5798('0x17'),auth[_0x5798('0xa')](),controller[_0x5798('0x18')]);router[_0x5798('0x14')](_0x5798('0x19'),auth[_0x5798('0xa')](),controller[_0x5798('0x1a')]);router['put'](_0x5798('0xe'),auth[_0x5798('0xa')](),controller['update']);module[_0x5798('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 145f97f..c843554 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 _0xd5a2=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x5553c4,_0x72f674){var _0x18984f=function(_0x2d1ec2){while(--_0x2d1ec2){_0x5553c4['push'](_0x5553c4['shift']());}};_0x18984f(++_0x72f674);}(_0xd5a2,0x93));var _0x2d5a=function(_0x2f551c,_0x42e92e){_0x2f551c=_0x2f551c-0x0;var _0x55a4a3=_0xd5a2[_0x2f551c];return _0x55a4a3;};'use strict';var Sequelize=require(_0x2d5a('0x0'));module[_0x2d5a('0x1')]={'state':{'type':Sequelize[_0x2d5a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2d5a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x2d5a('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2d5a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2d5a('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2d5a('0x4')]},'endtime':{'type':Sequelize[_0x2d5a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2d5a('0x3')]},'campaign':{'type':Sequelize[_0x2d5a('0x3')]},'campaigntype':{'type':Sequelize[_0x2d5a('0x3')]},'membername':{'type':Sequelize[_0x2d5a('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2d5a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2d5a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2d5a('0x4')]},'recallme':{'type':Sequelize[_0x2d5a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2d5a('0x4')]},'edited':{'type':Sequelize[_0x2d5a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2d5a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2d5a('0x3')]}}; \ No newline at end of file +var _0x9e78=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x9e78,0xb8));var _0x89e7=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9e78[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require(_0x89e7('0x0'));module[_0x89e7('0x1')]={'state':{'type':Sequelize[_0x89e7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x89e7('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x89e7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x89e7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x89e7('0x3')]},'calleridnum':{'type':Sequelize[_0x89e7('0x3')]},'calleridname':{'type':Sequelize[_0x89e7('0x3')]},'starttime':{'type':Sequelize[_0x89e7('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x89e7('0x4')]},'droptime':{'type':Sequelize[_0x89e7('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x89e7('0x3')]},'campaign':{'type':Sequelize[_0x89e7('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x89e7('0x3')]},'reason':{'type':Sequelize[_0x89e7('0x3')]},'amd':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x89e7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x89e7('0x4')]},'recallme':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x89e7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2d67634..cff6e4f 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 _0x727d=['hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','find','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','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','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x727d,0xae));var _0xd727=function(_0xa3ff70,_0x4a8609){_0xa3ff70=_0xa3ff70-0x0;var _0x538dbb=_0x727d[_0xa3ff70];return _0x538dbb;};'use strict';var emlformat=require(_0xd727('0x0'));var rimraf=require(_0xd727('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd727('0x2'));var rp=require(_0xd727('0x3'));var moment=require('moment');var BPromise=require(_0xd727('0x4'));var Mustache=require(_0xd727('0x5'));var util=require(_0xd727('0x6'));var path=require('path');var sox=require(_0xd727('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd727('0x8'));var _=require(_0xd727('0x9'));var squel=require('squel');var crypto=require(_0xd727('0xa'));var jsforce=require(_0xd727('0xb'));var deskjs=require(_0xd727('0xc'));var toCsv=require(_0xd727('0xd'));var querystring=require(_0xd727('0xe'));var Papa=require(_0xd727('0xf'));var Redis=require(_0xd727('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd727('0x11'));var as=require(_0xd727('0x12'));var hardwareService=require(_0xd727('0x13'));var logger=require(_0xd727('0x14'))('api');var utils=require(_0xd727('0x15'));var config=require(_0xd727('0x16'));var licenseUtil=require(_0xd727('0x17'));var db=require(_0xd727('0x18'))['db'];function respondWithStatusCode(_0x38e8a7,_0x568272){_0x568272=_0x568272||0xcc;return function(_0x118506){if(_0x118506){return _0x38e8a7[_0xd727('0x19')](_0x568272);}return _0x38e8a7[_0xd727('0x1a')](_0x568272)[_0xd727('0x1b')]();};}function respondWithResult(_0x3aee2d,_0x12499e){_0x12499e=_0x12499e||0xc8;return function(_0x20f56d){if(_0x20f56d){return _0x3aee2d['status'](_0x12499e)[_0xd727('0x1c')](_0x20f56d);}};}function respondWithFilteredResult(_0x31b376,_0x12891b){return function(_0x2efb15){if(_0x2efb15){var _0x3b71cd=typeof _0x12891b['offset']===_0xd727('0x1d')&&typeof _0x12891b[_0xd727('0x1e')]===_0xd727('0x1d');var _0x2932d7=_0x2efb15[_0xd727('0x1f')];var _0x24f537=_0x3b71cd?0x0:_0x12891b[_0xd727('0x20')];var _0x35b741=_0x3b71cd?_0x2efb15[_0xd727('0x1f')]:_0x12891b[_0xd727('0x20')]+_0x12891b[_0xd727('0x1e')];var _0x25c1c8;if(_0x35b741>=_0x2932d7){_0x35b741=_0x2932d7;_0x25c1c8=0xc8;}else{_0x25c1c8=0xce;}_0x31b376[_0xd727('0x1a')](_0x25c1c8);return _0x31b376[_0xd727('0x21')](_0xd727('0x22'),_0x24f537+'-'+_0x35b741+'/'+_0x2932d7)[_0xd727('0x1c')](_0x2efb15);}return null;};}function patchUpdates(_0x49cc6b){return function(_0x57c5f7){try{jsonpatch[_0xd727('0x23')](_0x57c5f7,_0x49cc6b,!![]);}catch(_0x5e5422){return BPromise[_0xd727('0x24')](_0x5e5422);}return _0x57c5f7[_0xd727('0x25')]();};}function saveUpdates(_0xaf145a,_0x2fa914){return function(_0x589145){if(_0x589145){return _0x589145[_0xd727('0x26')](_0xaf145a)[_0xd727('0x27')](function(_0x5aea81){return _0x5aea81;});}return null;};}function removeEntity(_0x283eee,_0x20d506){return function(_0x675f69){if(_0x675f69){return _0x675f69[_0xd727('0x28')]()[_0xd727('0x27')](function(){_0x283eee[_0xd727('0x1a')](0xcc)[_0xd727('0x1b')]();});}};}function handleEntityNotFound(_0x99af5b,_0x4169b7){return function(_0x1c9576){if(!_0x1c9576){_0x99af5b[_0xd727('0x19')](0x194);}return _0x1c9576;};}function handleError(_0xe4526b,_0x23e4a6){_0x23e4a6=_0x23e4a6||0x1f4;return function(_0x54f554){logger['error'](_0x54f554['stack']);if(_0x54f554[_0xd727('0x29')]){delete _0x54f554['name'];}_0xe4526b[_0xd727('0x1a')](_0x23e4a6)[_0xd727('0x2a')](_0x54f554);};}exports[_0xd727('0x2b')]=function(_0x4ae374,_0x375c40){var _0x4c174f={},_0x1aa8af={},_0x40dde1={'count':0x0,'rows':[]};var _0x545a75=_[_0xd727('0x2c')](db[_0xd727('0x2d')][_0xd727('0x2e')],function(_0x17c8f9){return{'name':_0x17c8f9[_0xd727('0x2f')],'type':_0x17c8f9[_0xd727('0x30')][_0xd727('0x31')]};});_0x1aa8af[_0xd727('0x32')]=_[_0xd727('0x2c')](_0x545a75,_0xd727('0x29'));_0x1aa8af[_0xd727('0x33')]=_['keys'](_0x4ae374[_0xd727('0x33')]);_0x1aa8af[_0xd727('0x34')]=_[_0xd727('0x35')](_0x1aa8af[_0xd727('0x32')],_0x1aa8af[_0xd727('0x33')]);_0x4c174f[_0xd727('0x36')]=_[_0xd727('0x35')](_0x1aa8af['model'],qs[_0xd727('0x37')](_0x4ae374[_0xd727('0x33')]['fields']));_0x4c174f[_0xd727('0x36')]=_0x4c174f[_0xd727('0x36')][_0xd727('0x38')]?_0x4c174f['attributes']:_0x1aa8af[_0xd727('0x32')];if(!_0x4ae374['query'][_0xd727('0x39')](_0xd727('0x3a'))){_0x4c174f[_0xd727('0x1e')]=qs[_0xd727('0x1e')](_0x4ae374[_0xd727('0x33')][_0xd727('0x1e')]);_0x4c174f[_0xd727('0x20')]=qs[_0xd727('0x20')](_0x4ae374['query'][_0xd727('0x20')]);}_0x4c174f[_0xd727('0x3b')]=qs['sort'](_0x4ae374[_0xd727('0x33')][_0xd727('0x3c')]);_0x4c174f[_0xd727('0x3d')]=qs['filters'](_[_0xd727('0x3e')](_0x4ae374[_0xd727('0x33')],_0x1aa8af[_0xd727('0x34')]),_0x545a75);if(_0x4ae374['query']['filter']){_0x4c174f['where']=_['merge'](_0x4c174f[_0xd727('0x3d')],{'$or':_['map'](_0x545a75,function(_0x52080d){if(_0x52080d[_0xd727('0x30')]!==_0xd727('0x3f')){var _0x42dc59={};_0x42dc59[_0x52080d[_0xd727('0x29')]]={'$like':'%'+_0x4ae374[_0xd727('0x33')]['filter']+'%'};return _0x42dc59;}})});}_0x4c174f=_[_0xd727('0x40')]({},_0x4c174f,_0x4ae374[_0xd727('0x41')]);var _0x1498d4={'where':_0x4c174f[_0xd727('0x3d')]};return db['CmHopperHistory'][_0xd727('0x1f')](_0x1498d4)[_0xd727('0x27')](function(_0x24f976){_0x40dde1[_0xd727('0x1f')]=_0x24f976;if(_0x4ae374[_0xd727('0x33')][_0xd727('0x42')]){_0x4c174f[_0xd727('0x43')]=[{'all':!![]}];}return db[_0xd727('0x2d')]['findAll'](_0x4c174f);})[_0xd727('0x27')](function(_0x52aa2b){_0x40dde1['rows']=_0x52aa2b;return _0x40dde1;})[_0xd727('0x27')](respondWithFilteredResult(_0x375c40,_0x4c174f))[_0xd727('0x44')](handleError(_0x375c40,null));};exports[_0xd727('0x45')]=function(_0x5580e7,_0x16b6ec){var _0x4dbcd7={'raw':!![],'where':{'id':_0x5580e7[_0xd727('0x46')]['id']}},_0x37a9ae={};_0x37a9ae[_0xd727('0x32')]=_['keys'](db[_0xd727('0x2d')][_0xd727('0x2e')]);_0x37a9ae[_0xd727('0x33')]=_[_0xd727('0x47')](_0x5580e7['query']);_0x37a9ae['filters']=_[_0xd727('0x35')](_0x37a9ae[_0xd727('0x32')],_0x37a9ae[_0xd727('0x33')]);_0x4dbcd7[_0xd727('0x36')]=_['intersection'](_0x37a9ae[_0xd727('0x32')],qs['fields'](_0x5580e7[_0xd727('0x33')][_0xd727('0x37')]));_0x4dbcd7[_0xd727('0x36')]=_0x4dbcd7[_0xd727('0x36')][_0xd727('0x38')]?_0x4dbcd7[_0xd727('0x36')]:_0x37a9ae[_0xd727('0x32')];if(_0x5580e7[_0xd727('0x33')][_0xd727('0x42')]){_0x4dbcd7[_0xd727('0x43')]=[{'all':!![]}];}_0x4dbcd7=_['merge']({},_0x4dbcd7,_0x5580e7['options']);return db[_0xd727('0x2d')][_0xd727('0x48')](_0x4dbcd7)[_0xd727('0x27')](handleEntityNotFound(_0x16b6ec,null))[_0xd727('0x27')](respondWithResult(_0x16b6ec,null))['catch'](handleError(_0x16b6ec,null));};exports[_0xd727('0x49')]=function(_0x1c479b,_0x34754e){return db[_0xd727('0x2d')][_0xd727('0x49')](_0x1c479b[_0xd727('0x4a')],{})['then'](respondWithResult(_0x34754e,0xc9))[_0xd727('0x44')](handleError(_0x34754e,null));};exports['describe']=function(_0x1f94ad,_0x5c8da2){return db['CmHopperHistory'][_0xd727('0x4b')]()[_0xd727('0x27')](respondWithResult(_0x5c8da2,null))['catch'](handleError(_0x5c8da2,null));};exports[_0xd727('0x26')]=function(_0x552bd7,_0x613ae6){if(_0x552bd7['body'][_0xd727('0x4c')]){delete _0x552bd7[_0xd727('0x4a')]['uniqueid'];}return db[_0xd727('0x2d')][_0xd727('0x48')]({'where':{'uniqueid':_0x552bd7[_0xd727('0x46')]['id']}})[_0xd727('0x27')](handleEntityNotFound(_0x613ae6,null))[_0xd727('0x27')](saveUpdates(_0x552bd7['body'],null))[_0xd727('0x27')](respondWithResult(_0x613ae6,null))[_0xd727('0x44')](handleError(_0x613ae6,null));}; \ No newline at end of file +var _0x33f0=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','status','name','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','keys','include','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5f5a2d,_0x1d9fca){var _0x4c3b2c=function(_0x369ba){while(--_0x369ba){_0x5f5a2d['push'](_0x5f5a2d['shift']());}};_0x4c3b2c(++_0x1d9fca);}(_0x33f0,0x78));var _0x033f=function(_0x9befbe,_0x51b723){_0x9befbe=_0x9befbe-0x0;var _0x5138ca=_0x33f0[_0x9befbe];return _0x5138ca;};'use strict';var emlformat=require(_0x033f('0x0'));var rimraf=require(_0x033f('0x1'));var zipdir=require(_0x033f('0x2'));var jsonpatch=require(_0x033f('0x3'));var rp=require(_0x033f('0x4'));var moment=require(_0x033f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x033f('0x6'));var util=require(_0x033f('0x7'));var path=require(_0x033f('0x8'));var sox=require(_0x033f('0x9'));var csv=require(_0x033f('0xa'));var ejs=require(_0x033f('0xb'));var fs=require('fs');var fs_extra=require(_0x033f('0xc'));var _=require(_0x033f('0xd'));var squel=require(_0x033f('0xe'));var crypto=require('crypto');var jsforce=require(_0x033f('0xf'));var deskjs=require(_0x033f('0x10'));var toCsv=require(_0x033f('0xa'));var querystring=require(_0x033f('0x11'));var Papa=require(_0x033f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x033f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x033f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x033f('0x15'));var licenseUtil=require(_0x033f('0x16'));var db=require(_0x033f('0x17'))['db'];function respondWithStatusCode(_0x3a6b58,_0x3343f8){_0x3343f8=_0x3343f8||0xcc;return function(_0x1344c5){if(_0x1344c5){return _0x3a6b58['sendStatus'](_0x3343f8);}return _0x3a6b58['status'](_0x3343f8)[_0x033f('0x18')]();};}function respondWithResult(_0x42a385,_0x26bcb2){_0x26bcb2=_0x26bcb2||0xc8;return function(_0x5873c9){if(_0x5873c9){return _0x42a385['status'](_0x26bcb2)['json'](_0x5873c9);}};}function respondWithFilteredResult(_0x522bac,_0x586c3d){return function(_0xfb8b13){if(_0xfb8b13){var _0x582c5e=typeof _0x586c3d[_0x033f('0x19')]===_0x033f('0x1a')&&typeof _0x586c3d[_0x033f('0x1b')]===_0x033f('0x1a');var _0x1c2309=_0xfb8b13[_0x033f('0x1c')];var _0x264564=_0x582c5e?0x0:_0x586c3d[_0x033f('0x19')];var _0x182cb9=_0x582c5e?_0xfb8b13[_0x033f('0x1c')]:_0x586c3d[_0x033f('0x19')]+_0x586c3d[_0x033f('0x1b')];var _0x515053;if(_0x182cb9>=_0x1c2309){_0x182cb9=_0x1c2309;_0x515053=0xc8;}else{_0x515053=0xce;}_0x522bac['status'](_0x515053);return _0x522bac[_0x033f('0x1d')](_0x033f('0x1e'),_0x264564+'-'+_0x182cb9+'/'+_0x1c2309)[_0x033f('0x1f')](_0xfb8b13);}return null;};}function patchUpdates(_0x40923){return function(_0x2abe3a){try{jsonpatch['apply'](_0x2abe3a,_0x40923,!![]);}catch(_0x2a730f){return BPromise[_0x033f('0x20')](_0x2a730f);}return _0x2abe3a[_0x033f('0x21')]();};}function saveUpdates(_0x181ac3,_0x3efa30){return function(_0x5f1ddd){if(_0x5f1ddd){return _0x5f1ddd[_0x033f('0x22')](_0x181ac3)[_0x033f('0x23')](function(_0x59e75f){return _0x59e75f;});}return null;};}function removeEntity(_0x23fa45,_0x573ae8){return function(_0x4ee129){if(_0x4ee129){return _0x4ee129['destroy']()[_0x033f('0x23')](function(){_0x23fa45[_0x033f('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1606b7,_0x3c63d0){return function(_0x14d486){if(!_0x14d486){_0x1606b7['sendStatus'](0x194);}return _0x14d486;};}function handleError(_0x290baf,_0x5dcb0e){_0x5dcb0e=_0x5dcb0e||0x1f4;return function(_0x566bde){logger['error'](_0x566bde['stack']);if(_0x566bde[_0x033f('0x25')]){delete _0x566bde[_0x033f('0x25')];}_0x290baf['status'](_0x5dcb0e)['send'](_0x566bde);};}exports['index']=function(_0x4e766e,_0x4dd45f){var _0x21e8fc={},_0x158600={},_0x412cf2={'count':0x0,'rows':[]};var _0x361933=_[_0x033f('0x26')](db[_0x033f('0x27')][_0x033f('0x28')],function(_0x37721d){return{'name':_0x37721d[_0x033f('0x29')],'type':_0x37721d[_0x033f('0x2a')]['key']};});_0x158600[_0x033f('0x2b')]=_[_0x033f('0x26')](_0x361933,_0x033f('0x25'));_0x158600[_0x033f('0x2c')]=_['keys'](_0x4e766e[_0x033f('0x2c')]);_0x158600[_0x033f('0x2d')]=_['intersection'](_0x158600[_0x033f('0x2b')],_0x158600['query']);_0x21e8fc[_0x033f('0x2e')]=_[_0x033f('0x2f')](_0x158600['model'],qs[_0x033f('0x30')](_0x4e766e['query']['fields']));_0x21e8fc[_0x033f('0x2e')]=_0x21e8fc[_0x033f('0x2e')]['length']?_0x21e8fc[_0x033f('0x2e')]:_0x158600[_0x033f('0x2b')];if(!_0x4e766e[_0x033f('0x2c')][_0x033f('0x31')]('nolimit')){_0x21e8fc[_0x033f('0x1b')]=qs[_0x033f('0x1b')](_0x4e766e[_0x033f('0x2c')][_0x033f('0x1b')]);_0x21e8fc[_0x033f('0x19')]=qs[_0x033f('0x19')](_0x4e766e['query']['offset']);}_0x21e8fc[_0x033f('0x32')]=qs[_0x033f('0x33')](_0x4e766e[_0x033f('0x2c')][_0x033f('0x33')]);_0x21e8fc[_0x033f('0x34')]=qs[_0x033f('0x2d')](_['pick'](_0x4e766e['query'],_0x158600[_0x033f('0x2d')]),_0x361933);if(_0x4e766e[_0x033f('0x2c')][_0x033f('0x35')]){_0x21e8fc[_0x033f('0x34')]=_[_0x033f('0x36')](_0x21e8fc[_0x033f('0x34')],{'$or':_['map'](_0x361933,function(_0x22f968){if(_0x22f968['type']!==_0x033f('0x37')){var _0x6c3400={};_0x6c3400[_0x22f968['name']]={'$like':'%'+_0x4e766e[_0x033f('0x2c')][_0x033f('0x35')]+'%'};return _0x6c3400;}})});}_0x21e8fc=_[_0x033f('0x36')]({},_0x21e8fc,_0x4e766e[_0x033f('0x38')]);var _0x647290={'where':_0x21e8fc[_0x033f('0x34')]};return db[_0x033f('0x27')][_0x033f('0x1c')](_0x647290)[_0x033f('0x23')](function(_0x3868ef){_0x412cf2[_0x033f('0x1c')]=_0x3868ef;if(_0x4e766e[_0x033f('0x2c')][_0x033f('0x39')]){_0x21e8fc['include']=[{'all':!![]}];}return db[_0x033f('0x27')][_0x033f('0x3a')](_0x21e8fc);})[_0x033f('0x23')](function(_0x12c5fc){_0x412cf2['rows']=_0x12c5fc;return _0x412cf2;})[_0x033f('0x23')](respondWithFilteredResult(_0x4dd45f,_0x21e8fc))['catch'](handleError(_0x4dd45f,null));};exports['show']=function(_0x17ca9d,_0x41fd96){var _0x29ca83={'raw':!![],'where':{'id':_0x17ca9d['params']['id']}},_0x3bd1b3={};_0x3bd1b3[_0x033f('0x2b')]=_[_0x033f('0x3b')](db['CmHopperHistory'][_0x033f('0x28')]);_0x3bd1b3[_0x033f('0x2c')]=_['keys'](_0x17ca9d[_0x033f('0x2c')]);_0x3bd1b3['filters']=_[_0x033f('0x2f')](_0x3bd1b3[_0x033f('0x2b')],_0x3bd1b3[_0x033f('0x2c')]);_0x29ca83[_0x033f('0x2e')]=_['intersection'](_0x3bd1b3[_0x033f('0x2b')],qs[_0x033f('0x30')](_0x17ca9d[_0x033f('0x2c')][_0x033f('0x30')]));_0x29ca83['attributes']=_0x29ca83[_0x033f('0x2e')]['length']?_0x29ca83[_0x033f('0x2e')]:_0x3bd1b3[_0x033f('0x2b')];if(_0x17ca9d[_0x033f('0x2c')][_0x033f('0x39')]){_0x29ca83[_0x033f('0x3c')]=[{'all':!![]}];}_0x29ca83=_[_0x033f('0x36')]({},_0x29ca83,_0x17ca9d['options']);return db[_0x033f('0x27')][_0x033f('0x3d')](_0x29ca83)[_0x033f('0x23')](handleEntityNotFound(_0x41fd96,null))[_0x033f('0x23')](respondWithResult(_0x41fd96,null))[_0x033f('0x3e')](handleError(_0x41fd96,null));};exports[_0x033f('0x3f')]=function(_0x1dc91d,_0x4f0218){return db[_0x033f('0x27')][_0x033f('0x3f')](_0x1dc91d[_0x033f('0x40')],{})[_0x033f('0x23')](respondWithResult(_0x4f0218,0xc9))['catch'](handleError(_0x4f0218,null));};exports[_0x033f('0x41')]=function(_0x50740c,_0x288190){return db[_0x033f('0x27')][_0x033f('0x41')]()[_0x033f('0x23')](respondWithResult(_0x288190,null))[_0x033f('0x3e')](handleError(_0x288190,null));};exports[_0x033f('0x22')]=function(_0x2c5946,_0x95981c){if(_0x2c5946[_0x033f('0x40')][_0x033f('0x42')]){delete _0x2c5946[_0x033f('0x40')][_0x033f('0x42')];}return db[_0x033f('0x27')][_0x033f('0x3d')]({'where':{'uniqueid':_0x2c5946['params']['id']}})[_0x033f('0x23')](handleEntityNotFound(_0x95981c,null))['then'](saveUpdates(_0x2c5946[_0x033f('0x40')],null))['then'](respondWithResult(_0x95981c,null))['catch'](handleError(_0x95981c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9b1ba17..28c2e00 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 _0xfef9=['rimraf','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xfef9,0xd3));var _0x9fef=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0xfef9[_0x383158];return _0x507985;};'use strict';var _=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var logger=require('../../config/logger')(_0x9fef('0x2'));var moment=require(_0x9fef('0x3'));var BPromise=require('bluebird');var rp=require(_0x9fef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x9fef('0x6'));module[_0x9fef('0x7')]=function(_0x4d86cb,_0x366ea9){return _0x4d86cb[_0x9fef('0x8')]('CmHopperHistory',attributes,{'tableName':_0x9fef('0x9'),'paranoid':![],'indexes':[{'name':_0x9fef('0xa'),'fields':[_0x9fef('0xa')]},{'name':'uniqueid','fields':[_0x9fef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9962=['endtime','uniqueid','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9962,0xb8));var _0x2996=function(_0x27a378,_0x1cd0ad){_0x27a378=_0x27a378-0x0;var _0x89114a=_0x9962[_0x27a378];return _0x89114a;};'use strict';var _=require(_0x2996('0x0'));var util=require('util');var logger=require(_0x2996('0x1'))(_0x2996('0x2'));var moment=require(_0x2996('0x3'));var BPromise=require('bluebird');var rp=require(_0x2996('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2996('0x5'));var config=require(_0x2996('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x2996('0x7')]=function(_0x196d1e,_0x5609bc){return _0x196d1e[_0x2996('0x8')](_0x2996('0x9'),attributes,{'tableName':_0x2996('0xa'),'paranoid':![],'indexes':[{'name':_0x2996('0xb'),'fields':[_0x2996('0xb')]},{'name':'uniqueid','fields':[_0x2996('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9846450..e34d3b3 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 _0xa6e2=['name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xa6e2,0x132));var _0x2a6e=function(_0x56f08b,_0x1a3f68){_0x56f08b=_0x56f08b-0x0;var _0x271df1=_0xa6e2[_0x56f08b];return _0x271df1;};'use strict';var _=require(_0x2a6e('0x0'));var util=require(_0x2a6e('0x1'));var moment=require('moment');var BPromise=require(_0x2a6e('0x2'));var rs=require(_0x2a6e('0x3'));var fs=require('fs');var Redis=require(_0x2a6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a6e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2a6e('0x6'));var client=jayson[_0x2a6e('0x7')][_0x2a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10ec91,_0x478a8e,_0x238615){return new BPromise(function(_0x272ec4,_0x5212e4){return client[_0x2a6e('0x9')](_0x10ec91,_0x238615)[_0x2a6e('0xa')](function(_0x1af5f1){logger[_0x2a6e('0xb')](_0x2a6e('0xc'),_0x478a8e,_0x2a6e('0xd'));logger[_0x2a6e('0xe')](_0x2a6e('0xf'),_0x478a8e,_0x2a6e('0xd'),JSON[_0x2a6e('0x10')](_0x1af5f1));if(_0x1af5f1['error']){if(_0x1af5f1[_0x2a6e('0x11')]['code']===0x1f4){logger[_0x2a6e('0x11')](_0x2a6e('0xc'),_0x478a8e,_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);return _0x5212e4(_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);}logger[_0x2a6e('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x478a8e,_0x1af5f1[_0x2a6e('0x11')][_0x2a6e('0x12')]);return _0x272ec4(_0x1af5f1['error'][_0x2a6e('0x12')]);}else{logger[_0x2a6e('0xb')](_0x2a6e('0xc'),_0x478a8e,_0x2a6e('0xd'));_0x272ec4(_0x1af5f1['result'][_0x2a6e('0x12')]);}})[_0x2a6e('0x13')](function(_0x33193a){logger[_0x2a6e('0x11')](_0x2a6e('0xc'),_0x478a8e,_0x33193a);_0x5212e4(_0x33193a);});});}exports['CreateCmHopperHistory']=function(_0x144a14){var _0x11316f=this;return new Promise(function(_0x37f5b5,_0x4510e7){return db[_0x2a6e('0x14')][_0x2a6e('0x15')](_0x144a14['body'],{'raw':_0x144a14[_0x2a6e('0x16')]?_0x144a14[_0x2a6e('0x16')][_0x2a6e('0x17')]===undefined?!![]:![]:!![]})[_0x2a6e('0xa')](function(_0x41202e){logger[_0x2a6e('0xb')]('CreateCmHopperHistory',_0x144a14);logger[_0x2a6e('0xe')](_0x2a6e('0x18'),_0x144a14,JSON[_0x2a6e('0x10')](_0x41202e));_0x37f5b5(_0x41202e);})[_0x2a6e('0x13')](function(_0x3dfb3b){logger['error'](_0x2a6e('0x18'),_0x3dfb3b['message'],_0x144a14);_0x4510e7(_0x11316f[_0x2a6e('0x11')](0x1f4,_0x3dfb3b[_0x2a6e('0x12')]));});});};exports['AvgHandleTime']=function(_0xbbaf17){var _0x489f4c=this;return new Promise(function(_0x5bad16,_0x17f4dd){return db[_0x2a6e('0x14')][_0x2a6e('0x19')]({'raw':_0xbbaf17[_0x2a6e('0x16')]?_0xbbaf17[_0x2a6e('0x16')][_0x2a6e('0x17')]===undefined?!![]:![]:!![],'where':_0xbbaf17[_0x2a6e('0x16')]?_0xbbaf17['options'][_0x2a6e('0x1a')]||null:null,'attributes':[[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')][_0x2a6e('0x1d')]('id')),_0x2a6e('0x1e')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x20')))),_0x2a6e('0x21')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x22')))),_0x2a6e('0x23')],[db['sequelize']['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x24')))),_0x2a6e('0x25')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x26'),db['sequelize']['fn']('IF',db[_0x2a6e('0x1b')]['literal'](_0x2a6e('0x27')))),_0x2a6e('0x28')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x26'),db[_0x2a6e('0x1b')]['fn']('IF',db['sequelize'][_0x2a6e('0x1f')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x2a6e('0xa')](function(_0x126129){logger[_0x2a6e('0xb')](_0x2a6e('0x29'),_0xbbaf17);logger[_0x2a6e('0xe')]('AvgHandleTime',_0xbbaf17,JSON[_0x2a6e('0x10')](_0x126129));_0x5bad16(_0x126129);})['catch'](function(_0x75e3aa){logger[_0x2a6e('0x11')]('AvgHandleTime',_0x75e3aa[_0x2a6e('0x12')],_0xbbaf17);_0x17f4dd(_0x489f4c[_0x2a6e('0x11')](0x1f4,_0x75e3aa[_0x2a6e('0x12')]));});});};exports[_0x2a6e('0x2a')]=function(_0x4a2617){var _0x1b854a=this;return new Promise(function(_0x5dd7d7,_0x43e116){return db['CmHopperHistory']['findAll']({'raw':_0x4a2617[_0x2a6e('0x16')]?_0x4a2617[_0x2a6e('0x16')][_0x2a6e('0x17')]===undefined?!![]:![]:!![],'where':_0x4a2617[_0x2a6e('0x16')]?_0x4a2617[_0x2a6e('0x16')][_0x2a6e('0x1a')]||null:null,'attributes':[[_0x2a6e('0x2b'),_0x2a6e('0x2c')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')]['literal'](_0x2a6e('0x2d')))),_0x2a6e('0x2e')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x2f')))),_0x2a6e('0x30')],[db[_0x2a6e('0x1b')]['fn']('COUNT',db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')]['literal'](_0x2a6e('0x20')))),_0x2a6e('0x31')],[db['sequelize']['fn'](_0x2a6e('0x1c'),db['sequelize']['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x32')))),_0x2a6e('0x33')],[db['sequelize']['fn']('COUNT',db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')]['literal'](_0x2a6e('0x34')))),_0x2a6e('0x35')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x36')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x37')))),_0x2a6e('0x38')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2a6e('0x39')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db['sequelize']['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x3a')))),_0x2a6e('0x3b')],[db['sequelize']['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x3c')))),_0x2a6e('0x3d')],[db['sequelize']['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x3e')))),_0x2a6e('0x3f')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db['sequelize'][_0x2a6e('0x1f')](_0x2a6e('0x40')))),_0x2a6e('0x41')],[db[_0x2a6e('0x1b')]['fn'](_0x2a6e('0x1c'),db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),_0x2a6e('0x3f')],[db[_0x2a6e('0x1b')]['fn']('COUNT',db[_0x2a6e('0x1b')]['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x42')))),'outboundReCallsDay']],'group':[_0x2a6e('0x2b')]})[_0x2a6e('0xa')](function(_0x247a69){logger[_0x2a6e('0xb')]('GetVoiceQueueHopperHistory',_0x4a2617);logger[_0x2a6e('0xe')](_0x2a6e('0x2a'),_0x4a2617,JSON[_0x2a6e('0x10')](_0x247a69));_0x5dd7d7(_0x247a69);})[_0x2a6e('0x13')](function(_0x283c40){logger[_0x2a6e('0x11')]('GetVoiceQueueHopperHistory',_0x283c40[_0x2a6e('0x12')],_0x4a2617);_0x43e116(_0x1b854a[_0x2a6e('0x11')](0x1f4,_0x283c40['message']));});});};exports['GetCampaignHopperHistory']=function(_0x3a1a6f){var _0x4d3d4c=this;return new Promise(function(_0x11b697,_0x566b21){return db[_0x2a6e('0x14')][_0x2a6e('0x19')]({'raw':_0x3a1a6f[_0x2a6e('0x16')]?_0x3a1a6f[_0x2a6e('0x16')][_0x2a6e('0x17')]===undefined?!![]:![]:!![],'where':_0x3a1a6f['options']?_0x3a1a6f[_0x2a6e('0x16')][_0x2a6e('0x1a')]||null:null,'attributes':[[_0x2a6e('0x2b'),_0x2a6e('0x2c')],[db[_0x2a6e('0x1b')]['fn']('COUNT',db['sequelize']['col']('id')),_0x2a6e('0x43')],[db[_0x2a6e('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2a6e('0x1b')][_0x2a6e('0x1f')](_0x2a6e('0x20')))),_0x2a6e('0x44')]],'group':[_0x2a6e('0x2b')]})[_0x2a6e('0xa')](function(_0x101088){logger['info'](_0x2a6e('0x45'),_0x3a1a6f);logger[_0x2a6e('0xe')](_0x2a6e('0x45'),_0x3a1a6f,JSON[_0x2a6e('0x10')](_0x101088));_0x11b697(_0x101088);})[_0x2a6e('0x13')](function(_0xb25b12){logger[_0x2a6e('0x11')](_0x2a6e('0x45'),_0xb25b12['message'],_0x3a1a6f);_0x566b21(_0x4d3d4c['error'](0x1f4,_0xb25b12[_0x2a6e('0x12')]));});});}; \ No newline at end of file +var _0xe6eb=['outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay'];(function(_0x785659,_0xdbbb04){var _0x411b88=function(_0x532e0a){while(--_0x532e0a){_0x785659['push'](_0x785659['shift']());}};_0x411b88(++_0xdbbb04);}(_0xe6eb,0xd7));var _0xbe6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbe6e('0x0'));var util=require(_0xbe6e('0x1'));var moment=require(_0xbe6e('0x2'));var BPromise=require(_0xbe6e('0x3'));var rs=require(_0xbe6e('0x4'));var fs=require('fs');var Redis=require(_0xbe6e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe6e('0x6'));var logger=require(_0xbe6e('0x7'))(_0xbe6e('0x8'));var config=require('../../config/environment');var jayson=require(_0xbe6e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b281e,_0x39f88f,_0x8459d6){return new BPromise(function(_0x50cad9,_0x4e49bd){return client['request'](_0x5b281e,_0x8459d6)[_0xbe6e('0xa')](function(_0x1a4bb6){logger[_0xbe6e('0xb')](_0xbe6e('0xc'),_0x39f88f,_0xbe6e('0xd'));logger[_0xbe6e('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x39f88f,_0xbe6e('0xd'),JSON[_0xbe6e('0xf')](_0x1a4bb6));if(_0x1a4bb6[_0xbe6e('0x10')]){if(_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x11')]===0x1f4){logger[_0xbe6e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x39f88f,_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x12')]);return _0x4e49bd(_0x1a4bb6['error'][_0xbe6e('0x12')]);}logger[_0xbe6e('0x10')](_0xbe6e('0xc'),_0x39f88f,_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x12')]);return _0x50cad9(_0x1a4bb6['error'][_0xbe6e('0x12')]);}else{logger[_0xbe6e('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x39f88f,_0xbe6e('0xd'));_0x50cad9(_0x1a4bb6[_0xbe6e('0x13')][_0xbe6e('0x12')]);}})['catch'](function(_0x49ee2a){logger['error'](_0xbe6e('0xc'),_0x39f88f,_0x49ee2a);_0x4e49bd(_0x49ee2a);});});}exports[_0xbe6e('0x14')]=function(_0x4835ec){var _0x2665fc=this;return new Promise(function(_0x130438,_0x1251e2){return db[_0xbe6e('0x15')]['create'](_0x4835ec['body'],{'raw':_0x4835ec[_0xbe6e('0x16')]?_0x4835ec[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![]})[_0xbe6e('0xa')](function(_0x278e29){logger[_0xbe6e('0xb')](_0xbe6e('0x14'),_0x4835ec);logger['debug']('CreateCmHopperHistory',_0x4835ec,JSON[_0xbe6e('0xf')](_0x278e29));_0x130438(_0x278e29);})[_0xbe6e('0x18')](function(_0x2059c4){logger[_0xbe6e('0x10')]('CreateCmHopperHistory',_0x2059c4[_0xbe6e('0x12')],_0x4835ec);_0x1251e2(_0x2665fc[_0xbe6e('0x10')](0x1f4,_0x2059c4['message']));});});};exports[_0xbe6e('0x19')]=function(_0x5c73be){var _0x42965f=this;return new Promise(function(_0x290ada,_0x18f1c5){return db[_0xbe6e('0x15')][_0xbe6e('0x1a')]({'raw':_0x5c73be[_0xbe6e('0x16')]?_0x5c73be[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x5c73be[_0xbe6e('0x16')]?_0x5c73be[_0xbe6e('0x16')][_0xbe6e('0x1b')]||null:null,'attributes':[[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')][_0xbe6e('0x1d')]('id')),_0xbe6e('0x1e')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x22')))),_0xbe6e('0x23')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')]['literal'](_0xbe6e('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xbe6e('0x1c')]['fn']('AVG',db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbe6e('0x25')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x26'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x27')))),_0xbe6e('0x28')]]})['then'](function(_0x4c23f6){logger['info'](_0xbe6e('0x19'),_0x5c73be);logger[_0xbe6e('0xe')]('AvgHandleTime',_0x5c73be,JSON[_0xbe6e('0xf')](_0x4c23f6));_0x290ada(_0x4c23f6);})[_0xbe6e('0x18')](function(_0x51be94){logger['error'](_0xbe6e('0x19'),_0x51be94[_0xbe6e('0x12')],_0x5c73be);_0x18f1c5(_0x42965f[_0xbe6e('0x10')](0x1f4,_0x51be94[_0xbe6e('0x12')]));});});};exports[_0xbe6e('0x29')]=function(_0x56be1f){var _0x42a3ae=this;return new Promise(function(_0x31391d,_0x404dba){return db[_0xbe6e('0x15')]['findAll']({'raw':_0x56be1f[_0xbe6e('0x16')]?_0x56be1f['options'][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x56be1f['options']?_0x56be1f[_0xbe6e('0x16')]['where']||null:null,'attributes':[[_0xbe6e('0x2a'),'name'],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x2b')))),_0xbe6e('0x2c')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x2d')))),_0xbe6e('0x2e')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),_0xbe6e('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')](_0xbe6e('0x30')))),_0xbe6e('0x31')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')](_0xbe6e('0x32')))),_0xbe6e('0x33')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x34')))),_0xbe6e('0x35')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x36')))),_0xbe6e('0x37')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbe6e('0x38')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x39')))),_0xbe6e('0x3a')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3b')))),_0xbe6e('0x3c')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xbe6e('0x3d')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3e')))),_0xbe6e('0x3c')],[db['sequelize']['fn'](_0xbe6e('0x21'),db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3f')))),_0xbe6e('0x40')]],'group':['campaign']})['then'](function(_0x515069){logger['info'](_0xbe6e('0x29'),_0x56be1f);logger[_0xbe6e('0xe')](_0xbe6e('0x29'),_0x56be1f,JSON[_0xbe6e('0xf')](_0x515069));_0x31391d(_0x515069);})[_0xbe6e('0x18')](function(_0x452ccc){logger[_0xbe6e('0x10')](_0xbe6e('0x29'),_0x452ccc[_0xbe6e('0x12')],_0x56be1f);_0x404dba(_0x42a3ae[_0xbe6e('0x10')](0x1f4,_0x452ccc[_0xbe6e('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x34a181){var _0x10a5c0=this;return new Promise(function(_0x24f59c,_0x3a6b6b){return db[_0xbe6e('0x15')][_0xbe6e('0x1a')]({'raw':_0x34a181['options']?_0x34a181[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x34a181['options']?_0x34a181[_0xbe6e('0x16')]['where']||null:null,'attributes':[[_0xbe6e('0x2a'),_0xbe6e('0x41')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')][_0xbe6e('0x1d')]('id')),_0xbe6e('0x42')],[db['sequelize']['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),_0xbe6e('0x43')]],'group':[_0xbe6e('0x2a')]})['then'](function(_0x4fefce){logger[_0xbe6e('0xb')](_0xbe6e('0x44'),_0x34a181);logger[_0xbe6e('0xe')](_0xbe6e('0x44'),_0x34a181,JSON[_0xbe6e('0xf')](_0x4fefce));_0x24f59c(_0x4fefce);})[_0xbe6e('0x18')](function(_0x58b616){logger[_0xbe6e('0x10')](_0xbe6e('0x44'),_0x58b616['message'],_0x34a181);_0x3a6b6b(_0x10a5c0[_0xbe6e('0x10')](0x1f4,_0x58b616[_0xbe6e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1187ab9..1502a39 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 _0x6246=['describe','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x6246,0x1aa));var _0x6624=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x6246[_0x586fa2];return _0x515be9;};'use strict';var multer=require(_0x6624('0x0'));var util=require(_0x6624('0x1'));var path=require('path');var timeout=require(_0x6624('0x2'));var express=require(_0x6624('0x3'));var router=express[_0x6624('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6624('0x5'));var config=require(_0x6624('0x6'));var controller=require(_0x6624('0x7'));router[_0x6624('0x8')]('/',auth[_0x6624('0x9')](),controller['index']);router[_0x6624('0x8')](_0x6624('0xa'),auth[_0x6624('0x9')](),controller[_0x6624('0xb')]);router[_0x6624('0x8')](_0x6624('0xc'),auth[_0x6624('0x9')](),controller[_0x6624('0xd')]);router[_0x6624('0xe')]('/',auth[_0x6624('0x9')](),controller[_0x6624('0xf')]);router[_0x6624('0x10')](_0x6624('0xc'),auth[_0x6624('0x9')](),controller[_0x6624('0x11')]);module[_0x6624('0x12')]=router; \ No newline at end of file +var _0x6fc7=['put','exports','multer','connect-timeout','express','Router','fs-extra','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x23228f,_0x5ed680){var _0x2c07e8=function(_0xcfc1d9){while(--_0xcfc1d9){_0x23228f['push'](_0x23228f['shift']());}};_0x2c07e8(++_0x5ed680);}(_0x6fc7,0xf0));var _0x76fc=function(_0x1451f8,_0x1e537f){_0x1451f8=_0x1451f8-0x0;var _0x392bc9=_0x6fc7[_0x1451f8];return _0x392bc9;};'use strict';var multer=require(_0x76fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x76fc('0x1'));var express=require(_0x76fc('0x2'));var router=express[_0x76fc('0x3')]();var fs_extra=require(_0x76fc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x76fc('0x5'));router[_0x76fc('0x6')]('/',auth[_0x76fc('0x7')](),controller[_0x76fc('0x8')]);router[_0x76fc('0x6')](_0x76fc('0x9'),auth['isAuthenticated'](),controller[_0x76fc('0xa')]);router['get'](_0x76fc('0xb'),auth['isAuthenticated'](),controller[_0x76fc('0xc')]);router[_0x76fc('0xd')]('/',auth[_0x76fc('0x7')](),controller[_0x76fc('0xe')]);router[_0x76fc('0xf')](_0x76fc('0xb'),auth[_0x76fc('0x7')](),controller['update']);module[_0x76fc('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 2f9ada2..ab2b12d 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 _0xbe02=['name','exports','STRING'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xbe02,0x124));var _0x2be0=function(_0x3ba24a,_0x45749e){_0x3ba24a=_0x3ba24a-0x0;var _0x348fcc=_0xbe02[_0x3ba24a];return _0x348fcc;};'use strict';var Sequelize=require('sequelize');module[_0x2be0('0x0')]={'name':{'type':Sequelize[_0x2be0('0x1')],'unique':_0x2be0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x67a2=['exports','name','STRING','sequelize'];(function(_0x546032,_0x53ad39){var _0x3b580e=function(_0x5940ee){while(--_0x5940ee){_0x546032['push'](_0x546032['shift']());}};_0x3b580e(++_0x53ad39);}(_0x67a2,0xd3));var _0x267a=function(_0x7bb99c,_0x50aeaa){_0x7bb99c=_0x7bb99c-0x0;var _0x4bb802=_0x67a2[_0x7bb99c];return _0x4bb802;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x267a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x267a('0x3')]},'dialPrefix':{'type':Sequelize[_0x267a('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 1cd1da3..bc3bdbc 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 _0x82cc=['Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findOne','findAndCountAll','getGlobalCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','spread','message','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','CmList','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','body','ListId','Disposition','getDispositions','removeDispositions','ids','tags','isArray','join','push','each','CmContact','omit','success','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','ContactItemType','OrderBy','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','alias','select','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','toString','isEmpty','writeFileSync','setHeader'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82cc,0xc8));var _0xc82c=function(_0x2c894f,_0xaa2988){_0x2c894f=_0x2c894f-0x0;var _0x329465=_0x82cc[_0x2c894f];return _0x329465;};'use strict';var emlformat=require(_0xc82c('0x0'));var rimraf=require(_0xc82c('0x1'));var zipdir=require(_0xc82c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc82c('0x3'));var BPromise=require(_0xc82c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc82c('0x5'));var sox=require('sox');var csv=require(_0xc82c('0x6'));var ejs=require(_0xc82c('0x7'));var fs=require('fs');var fs_extra=require(_0xc82c('0x8'));var _=require(_0xc82c('0x9'));var squel=require(_0xc82c('0xa'));var crypto=require(_0xc82c('0xb'));var jsforce=require(_0xc82c('0xc'));var deskjs=require(_0xc82c('0xd'));var toCsv=require(_0xc82c('0x6'));var querystring=require(_0xc82c('0xe'));var Papa=require('papaparse');var Redis=require(_0xc82c('0xf'));var authService=require(_0xc82c('0x10'));var qs=require(_0xc82c('0x11'));var as=require(_0xc82c('0x12'));var hardwareService=require(_0xc82c('0x13'));var logger=require(_0xc82c('0x14'))('api');var utils=require(_0xc82c('0x15'));var config=require(_0xc82c('0x16'));var licenseUtil=require(_0xc82c('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xc82c('0x18')]=_['defaults'](config['redis'],{'host':_0xc82c('0x19'),'port':0x18eb});var socket=require(_0xc82c('0x1a'))(new Redis(config[_0xc82c('0x18')]));require(_0xc82c('0x1b'))[_0xc82c('0x1c')](socket);function respondWithStatusCode(_0x505dcc,_0x3fe2ed){_0x3fe2ed=_0x3fe2ed||0xcc;return function(_0x511daf){if(_0x511daf){return _0x505dcc['sendStatus'](_0x3fe2ed);}return _0x505dcc[_0xc82c('0x1d')](_0x3fe2ed)[_0xc82c('0x1e')]();};}function respondWithResult(_0xd08f87,_0x27f55b){_0x27f55b=_0x27f55b||0xc8;return function(_0x3d49da){if(_0x3d49da){return _0xd08f87[_0xc82c('0x1d')](_0x27f55b)['json'](_0x3d49da);}};}function respondWithFilteredResult(_0x4235bd,_0x261e50){return function(_0x46eefb){if(_0x46eefb){var _0x47a3a9=typeof _0x261e50['offset']===_0xc82c('0x1f')&&typeof _0x261e50['limit']===_0xc82c('0x1f');var _0x477fc8=_0x46eefb[_0xc82c('0x20')];var _0x5dfddb=_0x47a3a9?0x0:_0x261e50[_0xc82c('0x21')];var _0x11d9e1=_0x47a3a9?_0x46eefb['count']:_0x261e50[_0xc82c('0x21')]+_0x261e50[_0xc82c('0x22')];var _0x349043;if(_0x11d9e1>=_0x477fc8){_0x11d9e1=_0x477fc8;_0x349043=0xc8;}else{_0x349043=0xce;}_0x4235bd[_0xc82c('0x1d')](_0x349043);return _0x4235bd[_0xc82c('0x23')](_0xc82c('0x24'),_0x5dfddb+'-'+_0x11d9e1+'/'+_0x477fc8)[_0xc82c('0x25')](_0x46eefb);}return null;};}function patchUpdates(_0x128231){return function(_0x36049a){try{jsonpatch[_0xc82c('0x26')](_0x36049a,_0x128231,!![]);}catch(_0x3c7359){return BPromise[_0xc82c('0x27')](_0x3c7359);}return _0x36049a['save']();};}function saveUpdates(_0x90c1cd,_0x434e2f){return function(_0x1bf51c){if(_0x1bf51c){return _0x1bf51c[_0xc82c('0x28')](_0x90c1cd)[_0xc82c('0x29')](function(_0x1e9d1a){return _0x1e9d1a;});}return null;};}function removeEntity(_0x88bd39,_0x296b04){return function(_0x20aa03){if(_0x20aa03){return _0x20aa03[_0xc82c('0x2a')]()[_0xc82c('0x29')](function(){var _0x266205=_0x20aa03[_0xc82c('0x2b')]({'plain':!![]});var _0x40a0cb=_0xc82c('0x2c');return db[_0xc82c('0x2d')]['destroy']({'where':{'type':_0x40a0cb,'resourceId':_0x266205['id']}})[_0xc82c('0x29')](function(){return _0x20aa03;});})['then'](function(){_0x88bd39[_0xc82c('0x1d')](0xcc)[_0xc82c('0x1e')]();});}};}function handleEntityNotFound(_0x3eecd6,_0x566b4d){return function(_0x1a4498){if(!_0x1a4498){_0x3eecd6[_0xc82c('0x2e')](0x194);}return _0x1a4498;};}function handleError(_0xabdb1b,_0x6846f3){_0x6846f3=_0x6846f3||0x1f4;return function(_0x51e71c){logger[_0xc82c('0x2f')](_0x51e71c[_0xc82c('0x30')]);if(_0x51e71c[_0xc82c('0x31')]){delete _0x51e71c[_0xc82c('0x31')];}_0xabdb1b[_0xc82c('0x1d')](_0x6846f3)[_0xc82c('0x32')](_0x51e71c);};}exports[_0xc82c('0x33')]=function(_0x371e3f,_0x31c35a){var _0x284927={},_0x389c62={},_0x313c4c={'count':0x0,'rows':[]};var _0x2fad36=_[_0xc82c('0x34')](db['CmList'][_0xc82c('0x35')],function(_0x1e4b1c){return{'name':_0x1e4b1c['fieldName'],'type':_0x1e4b1c[_0xc82c('0x36')][_0xc82c('0x37')]};});_0x389c62[_0xc82c('0x38')]=_[_0xc82c('0x34')](_0x2fad36,_0xc82c('0x31'));_0x389c62[_0xc82c('0x39')]=_[_0xc82c('0x3a')](_0x371e3f['query']);_0x389c62[_0xc82c('0x3b')]=_['intersection'](_0x389c62[_0xc82c('0x38')],_0x389c62['query']);_0x284927[_0xc82c('0x3c')]=_['intersection'](_0x389c62[_0xc82c('0x38')],qs['fields'](_0x371e3f[_0xc82c('0x39')][_0xc82c('0x3d')]));_0x284927['attributes']=_0x284927[_0xc82c('0x3c')][_0xc82c('0x3e')]?_0x284927['attributes']:_0x389c62[_0xc82c('0x38')];if(!_0x371e3f['query'][_0xc82c('0x3f')](_0xc82c('0x40'))){_0x284927['limit']=qs[_0xc82c('0x22')](_0x371e3f['query'][_0xc82c('0x22')]);_0x284927['offset']=qs['offset'](_0x371e3f[_0xc82c('0x39')]['offset']);}_0x284927[_0xc82c('0x41')]=qs[_0xc82c('0x42')](_0x371e3f[_0xc82c('0x39')][_0xc82c('0x42')]);_0x284927[_0xc82c('0x43')]=qs[_0xc82c('0x3b')](_[_0xc82c('0x44')](_0x371e3f['query'],_0x389c62['filters']),_0x2fad36);if(_0x371e3f['query'][_0xc82c('0x45')]){_0x284927['where']=_['merge'](_0x284927[_0xc82c('0x43')],{'$or':_['map'](_0x2fad36,function(_0xac6506){if(_0xac6506[_0xc82c('0x36')]!==_0xc82c('0x46')){var _0x514c4a={};_0x514c4a[_0xac6506[_0xc82c('0x31')]]={'$like':'%'+_0x371e3f['query'][_0xc82c('0x45')]+'%'};return _0x514c4a;}})});}_0x284927=_[_0xc82c('0x47')]({},_0x284927,_0x371e3f['options']);var _0xf84cb={'where':_0x284927['where']};return db[_0xc82c('0x48')][_0xc82c('0x20')](_0xf84cb)['then'](function(_0x376244){_0x313c4c[_0xc82c('0x20')]=_0x376244;if(_0x371e3f['query'][_0xc82c('0x49')]){_0x284927[_0xc82c('0x4a')]=[{'all':!![]}];}return db[_0xc82c('0x48')][_0xc82c('0x4b')](_0x284927);})[_0xc82c('0x29')](function(_0x5d7bed){_0x313c4c[_0xc82c('0x4c')]=_0x5d7bed;return _0x313c4c;})[_0xc82c('0x29')](respondWithFilteredResult(_0x31c35a,_0x284927))[_0xc82c('0x4d')](handleError(_0x31c35a,null));};exports[_0xc82c('0x4e')]=function(_0x1fb13f,_0x34e29e){var _0x50bf74={'raw':![],'where':{'id':_0x1fb13f[_0xc82c('0x4f')]['id']}},_0x2f696d={};_0x2f696d['model']=_['keys'](db[_0xc82c('0x48')]['rawAttributes']);_0x2f696d['query']=_['keys'](_0x1fb13f[_0xc82c('0x39')]);_0x2f696d['filters']=_[_0xc82c('0x50')](_0x2f696d[_0xc82c('0x38')],_0x2f696d[_0xc82c('0x39')]);_0x50bf74[_0xc82c('0x3c')]=_['intersection'](_0x2f696d[_0xc82c('0x38')],qs[_0xc82c('0x3d')](_0x1fb13f[_0xc82c('0x39')]['fields']));_0x50bf74[_0xc82c('0x3c')]=_0x50bf74['attributes']['length']?_0x50bf74[_0xc82c('0x3c')]:_0x2f696d[_0xc82c('0x38')];if(_0x1fb13f[_0xc82c('0x39')][_0xc82c('0x49')]){_0x50bf74[_0xc82c('0x4a')]=[{'all':!![]}];}_0x50bf74=_[_0xc82c('0x47')]({},_0x50bf74,_0x1fb13f[_0xc82c('0x51')]);return db['CmList'][_0xc82c('0x52')](_0x50bf74)[_0xc82c('0x29')](handleEntityNotFound(_0x34e29e,null))[_0xc82c('0x29')](respondWithResult(_0x34e29e,null))['catch'](handleError(_0x34e29e,null));};exports[_0xc82c('0x53')]=function(_0x1772b9,_0x1d0084){return db[_0xc82c('0x48')]['create'](_0x1772b9['body'],{})[_0xc82c('0x29')](function(_0x5d64a6){var _0x1f146b=_0x1772b9[_0xc82c('0x54')]['get']({'plain':!![]});if(!_0x1f146b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f146b['role']===_0xc82c('0x54')){var _0x202407=_0x5d64a6[_0xc82c('0x2b')]({'plain':!![]});var _0x199054=_0xc82c('0x2c');return db[_0xc82c('0x55')][_0xc82c('0x52')]({'where':{'name':_0x199054,'userProfileId':_0x1f146b['userProfileId']},'raw':!![]})['then'](function(_0x1cfdfa){if(_0x1cfdfa&&_0x1cfdfa[_0xc82c('0x56')]===0x0){return db[_0xc82c('0x2d')][_0xc82c('0x53')]({'name':_0x202407[_0xc82c('0x31')],'resourceId':_0x202407['id'],'type':_0x1cfdfa['name'],'sectionId':_0x1cfdfa['id']},{})['then'](function(){return _0x5d64a6;});}else{return _0x5d64a6;}})[_0xc82c('0x4d')](function(_0x42ba71){logger['error'](_0xc82c('0x57'),_0x42ba71);throw _0x42ba71;});}return _0x5d64a6;})['then'](respondWithResult(_0x1d0084,0xc9))['catch'](handleError(_0x1d0084,null));};exports[_0xc82c('0x28')]=function(_0x4e19ea,_0x1d5836){if(_0x4e19ea['body']['id']){delete _0x4e19ea['body']['id'];}return db[_0xc82c('0x48')]['find']({'where':{'id':_0x4e19ea[_0xc82c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d5836,null))[_0xc82c('0x29')](saveUpdates(_0x4e19ea['body'],null))[_0xc82c('0x29')](respondWithResult(_0x1d5836,null))[_0xc82c('0x4d')](handleError(_0x1d5836,null));};exports['destroy']=function(_0x3b3a77,_0x3f19f6){return db[_0xc82c('0x48')][_0xc82c('0x52')]({'where':{'id':_0x3b3a77[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x3f19f6,null))[_0xc82c('0x29')](removeEntity(_0x3f19f6,null))[_0xc82c('0x4d')](handleError(_0x3f19f6,null));};exports[_0xc82c('0x58')]=function(_0x1dde0f,_0xbf71cd){return db[_0xc82c('0x48')][_0xc82c('0x58')]()[_0xc82c('0x29')](respondWithResult(_0xbf71cd,null))[_0xc82c('0x4d')](handleError(_0xbf71cd,null));};exports['addDisposition']=function(_0x4c9e9d,_0x1b29d7,_0x134f52){if(_0x4c9e9d[_0xc82c('0x59')]['id']){delete _0x4c9e9d['body']['id'];}return db[_0xc82c('0x48')]['find']({'where':{'id':_0x4c9e9d[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x1b29d7,null))[_0xc82c('0x29')](function(_0x5d177f){if(_0x5d177f){_0x4c9e9d['body'][_0xc82c('0x5a')]=_0x5d177f['id'];return db[_0xc82c('0x5b')][_0xc82c('0x53')](_0x4c9e9d['body']);}})['then'](respondWithResult(_0x1b29d7,null))[_0xc82c('0x4d')](handleError(_0x1b29d7,null));};exports[_0xc82c('0x5c')]=function(_0x22249b,_0x436c3f,_0x326150){var _0x301554={'raw':![],'where':{}};var _0x56edc5={};var _0x5af04e={'count':0x0,'rows':[]};return db[_0xc82c('0x48')]['findOne']({'where':{'id':_0x22249b[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x436c3f,null))['then'](function(_0x597ffb){if(_0x597ffb){_0x56edc5[_0xc82c('0x38')]=_['keys'](db[_0xc82c('0x5b')][_0xc82c('0x35')]);_0x56edc5[_0xc82c('0x39')]=_[_0xc82c('0x3a')](_0x22249b[_0xc82c('0x39')]);_0x56edc5['filters']=_[_0xc82c('0x50')](_0x56edc5[_0xc82c('0x38')],_0x56edc5[_0xc82c('0x39')]);_0x301554['attributes']=_['intersection'](_0x56edc5[_0xc82c('0x38')],qs[_0xc82c('0x3d')](_0x22249b[_0xc82c('0x39')]['fields']));_0x301554[_0xc82c('0x3c')]=_0x301554[_0xc82c('0x3c')]['length']?_0x301554['attributes']:_0x56edc5['model'];if(!_0x22249b[_0xc82c('0x39')][_0xc82c('0x3f')](_0xc82c('0x40'))){_0x301554['limit']=qs[_0xc82c('0x22')](_0x22249b[_0xc82c('0x39')]['limit']);_0x301554[_0xc82c('0x21')]=qs[_0xc82c('0x21')](_0x22249b[_0xc82c('0x39')][_0xc82c('0x21')]);}_0x301554[_0xc82c('0x41')]=qs[_0xc82c('0x42')](_0x22249b[_0xc82c('0x39')][_0xc82c('0x42')]);_0x301554[_0xc82c('0x43')]=qs[_0xc82c('0x3b')](_[_0xc82c('0x44')](_0x22249b[_0xc82c('0x39')],_0x56edc5[_0xc82c('0x3b')]));_0x301554[_0xc82c('0x43')][_0xc82c('0x5a')]=_0x597ffb['id'];if(_0x22249b[_0xc82c('0x39')][_0xc82c('0x45')]){_0x301554[_0xc82c('0x43')]=_[_0xc82c('0x47')](_0x301554[_0xc82c('0x43')],{'$or':_[_0xc82c('0x34')](_0x301554[_0xc82c('0x3c')],function(_0x138d5b){var _0x494b80={};_0x494b80[_0x138d5b]={'$like':'%'+_0x22249b[_0xc82c('0x39')]['filter']+'%'};return _0x494b80;})});}_0x301554=_[_0xc82c('0x47')]({},_0x301554,_0x22249b[_0xc82c('0x51')]);return db[_0xc82c('0x5b')]['count']({'where':_0x301554[_0xc82c('0x43')]})[_0xc82c('0x29')](function(_0x2e6a0a){_0x5af04e[_0xc82c('0x20')]=_0x2e6a0a;if(_0x22249b[_0xc82c('0x39')][_0xc82c('0x49')]){_0x301554[_0xc82c('0x4a')]=[{'all':!![]}];}return db[_0xc82c('0x5b')][_0xc82c('0x4b')](_0x301554);})[_0xc82c('0x29')](function(_0x34ae1b){_0x5af04e[_0xc82c('0x4c')]=_0x34ae1b;return _0x5af04e;});}})[_0xc82c('0x29')](respondWithFilteredResult(_0x436c3f,_0x301554))[_0xc82c('0x4d')](handleError(_0x436c3f,null));};exports[_0xc82c('0x5d')]=function(_0x210153,_0x4e90fb,_0xfcdbd2){return db[_0xc82c('0x48')][_0xc82c('0x52')]({'where':{'id':_0x210153[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x4e90fb,null))['then'](function(_0x1904db){if(_0x1904db){return _0x1904db[_0xc82c('0x5d')](_0x210153[_0xc82c('0x39')][_0xc82c('0x5e')]);}})[_0xc82c('0x29')](respondWithStatusCode(_0x4e90fb,null))[_0xc82c('0x4d')](handleError(_0x4e90fb,null));};exports['addContacts']=function(_0x58cf50,_0x149ec7,_0x5c45d7){return db['CmList'][_0xc82c('0x52')]({'where':{'id':_0x58cf50[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x149ec7,null))[_0xc82c('0x29')](function(_0x1020d1){if(_0x1020d1){var _0x381798=[];var _0x44c4a1={'success':[],'errors':[]};return db['CmContact'][_0xc82c('0x58')]()['then'](function(_0x1cc0f9){if(_0x58cf50['body'][_0xc82c('0x5f')]&&_[_0xc82c('0x60')](_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')])){if(_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')]['length']){_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')]=_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')][_0xc82c('0x61')](';')+';';}else{_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')]=null;}}else{_0x58cf50[_0xc82c('0x59')][_0xc82c('0x5f')]=null;}if(_0x58cf50['body']&&_[_0xc82c('0x60')](_0x58cf50[_0xc82c('0x59')])){for(var _0x570dfb=0x0;_0x570dfb<_0x58cf50[_0xc82c('0x59')][_0xc82c('0x3e')];_0x570dfb+=0x1){_0x58cf50['body'][_0x570dfb][_0xc82c('0x5a')]=_0x58cf50[_0xc82c('0x4f')]['id'];_0x381798[_0xc82c('0x62')](_0x58cf50[_0xc82c('0x59')][_0x570dfb]);}return BPromise[_0xc82c('0x63')](_0x381798,function(_0x3611d2){return db[_0xc82c('0x64')][_0xc82c('0x53')](_[_0xc82c('0x65')](_0x3611d2,[_0xc82c('0x5e'),'id'])||{},{'fields':_[_0xc82c('0x3a')](_0x1cc0f9),'raw':!![]})['then'](function(_0x3ca802){_0x44c4a1[_0xc82c('0x66')][_0xc82c('0x62')](_0x3ca802['dataValues']);})['catch'](function(_0x34a929){_0x44c4a1['errors'][_0xc82c('0x62')]({'data':_0x3611d2,'error':_0x34a929['message']});});})[_0xc82c('0x29')](function(_0x18b25c){return _0x44c4a1;})['catch'](function(_0x4398b9){return _0x4398b9;});}else{_0x149ec7[_0xc82c('0x1d')](0x190)[_0xc82c('0x25')]({'message':_0xc82c('0x67')});}});}})[_0xc82c('0x29')](respondWithResult(_0x149ec7,null))[_0xc82c('0x4d')](handleError(_0x149ec7,null));};exports[_0xc82c('0x68')]=function(_0x3d478e,_0x474a3f,_0x328762){var _0x488a4d;return db[_0xc82c('0x48')]['find']({'where':{'id':_0x3d478e[_0xc82c('0x4f')]['id']},'include':[{'model':db[_0xc82c('0x69')],'as':_0xc82c('0x6a')}]})['then'](handleEntityNotFound(_0x474a3f,null))[_0xc82c('0x29')](function(_0x106b63){if(_0x106b63){_0x488a4d=_0x106b63;return db[_0xc82c('0x64')][_0xc82c('0x35')];}})[_0xc82c('0x29')](function(_0x18933f){if(_0x18933f){var _0xbf82df={};var _0x1a37f9={};_0x1a37f9[_0xc82c('0x38')]=_[_0xc82c('0x6b')](_[_0xc82c('0x3a')](_0x18933f),_[_0xc82c('0x34')](_0x488a4d['CustomFields'],function(_0x597871){return util[_0xc82c('0x6c')](_0xc82c('0x6d'),_0x597871['id']);}));_0x1a37f9['query']=_[_0xc82c('0x3a')](_0x3d478e[_0xc82c('0x39')]);_0x1a37f9[_0xc82c('0x3b')]=_['intersection'](_0x1a37f9[_0xc82c('0x38')],_0x1a37f9[_0xc82c('0x39')]);_0xbf82df['attributes']=_['intersection'](_0x1a37f9[_0xc82c('0x38')],qs[_0xc82c('0x3d')](_0x3d478e[_0xc82c('0x39')][_0xc82c('0x3d')]));_0xbf82df[_0xc82c('0x3c')]=_0xbf82df['attributes']['length']?_0xbf82df[_0xc82c('0x3c')]:_0x1a37f9[_0xc82c('0x38')];if(!_0x3d478e[_0xc82c('0x39')][_0xc82c('0x3f')](_0xc82c('0x40'))){_0xbf82df[_0xc82c('0x22')]=qs['limit'](_0x3d478e[_0xc82c('0x39')][_0xc82c('0x22')]);_0xbf82df[_0xc82c('0x21')]=qs['offset'](_0x3d478e[_0xc82c('0x39')][_0xc82c('0x21')]);}_0xbf82df[_0xc82c('0x41')]=qs[_0xc82c('0x42')](_0x3d478e[_0xc82c('0x39')]['sort']);_0xbf82df[_0xc82c('0x43')]=qs[_0xc82c('0x3b')](_['pick'](_0x3d478e[_0xc82c('0x39')],_0x1a37f9[_0xc82c('0x3b')]));_0xbf82df[_0xc82c('0x6e')]=!![];if(_0x3d478e[_0xc82c('0x39')][_0xc82c('0x45')]){_0xbf82df[_0xc82c('0x43')]=_[_0xc82c('0x47')](_0xbf82df['where'],{'$or':_[_0xc82c('0x34')](_0xbf82df['attributes'],function(_0xff2e19){var _0x87694b={};_0x87694b[_0xff2e19]={'$like':'%'+_0x3d478e[_0xc82c('0x39')][_0xc82c('0x45')]+'%'};return _0x87694b;})});}_0xbf82df=_[_0xc82c('0x47')]({},_0xbf82df,_0x3d478e['options']);return _0x488a4d[_0xc82c('0x68')](_0xbf82df);}})['then'](respondWithResult(_0x474a3f,null))['catch'](handleError(_0x474a3f,null));};exports['getContactsCsv']=function(_0x291787,_0x872062,_0x2d984a){var _0x34487a;var _0x22585a;var _0xdb2922;var _0x5a4ec1=_0x291787['params']['id'];csv_results=[];return db[_0xc82c('0x6f')][_0xc82c('0x4b')]({'attributes':['id','name'],'raw':!![],'order':[_0xc82c('0x70')]})[_0xc82c('0x29')](function(_0x4ad113){_0x34487a=_0x4ad113;var _0xb06a=_[_0xc82c('0x3a')](db[_0xc82c('0x64')]['rawAttributes']);return db[_0xc82c('0x69')][_0xc82c('0x4b')]({'raw':!![],'attributes':['id','alias']})[_0xc82c('0x29')](function(_0x1588f9){_0x22585a=_0x1588f9;var _0x1ed159=squel['select']()[_0xc82c('0x3d')](_0xb06a)[_0xc82c('0x71')](_0xc82c('0x72'),'c')[_0xc82c('0x43')](_0xc82c('0x73'),_0x5a4ec1)[_0xc82c('0x43')]('c.deletedAt\x20is\x20null')[_0xc82c('0x74')]();for(var _0x51a67c=0x0;_0x51a67c<_0x22585a[_0xc82c('0x3e')];_0x51a67c++){_0x1ed159[_0xc82c('0x75')](_0xc82c('0x76')+_0x22585a[_0x51a67c]['id'],'customField_'+_0x22585a[_0x51a67c][_0xc82c('0x77')]);}for(var _0x51a67c=0x0;_0x51a67c<_0x34487a['length'];_0x51a67c++){_0x1ed159['field'](squel[_0xc82c('0x78')]()[_0xc82c('0x75')](_0xc82c('0x79'))[_0xc82c('0x71')]('cm_contact_has_items')[_0xc82c('0x43')](_0xc82c('0x7a'),_0x34487a[_0x51a67c]['id'])[_0xc82c('0x43')](_0xc82c('0x7b')),_0xc82c('0x7c')+_0x34487a[_0x51a67c][_0xc82c('0x31')]);_0x1ed159[_0xc82c('0x75')](squel[_0xc82c('0x78')]()[_0xc82c('0x75')](_0xc82c('0x7d'))[_0xc82c('0x71')](_0xc82c('0x7e'))[_0xc82c('0x43')]('ItemTypeId\x20=\x20?',_0x34487a[_0x51a67c]['id'])[_0xc82c('0x43')](_0xc82c('0x7b')),_0xc82c('0x7f')+_0x34487a[_0x51a67c]['name']);}var _0x9946c4=[];_0x9946c4[_0xc82c('0x62')](_0x1ed159[_0xc82c('0x80')]());BPromise[_0xc82c('0x63')](_0x9946c4,handleQuery)['then'](function(_0x2c8e73){handleQuery(_0x1ed159[_0xc82c('0x80')]());var _0x2aa7ff=csv_results[0x0];if(!_[_0xc82c('0x81')](_0x2aa7ff)){var _0x536057=toCsv(_0x2aa7ff);var _0x150554=Date['now']();fs[_0xc82c('0x82')](util[_0xc82c('0x6c')]('/tmp/list_%d_%s.csv',_0x5a4ec1,_0x150554),_0x536057);_0x872062[_0xc82c('0x83')](_0xc82c('0x84'),'attachment;\x20filename='+util['format'](_0xc82c('0x85'),_0x5a4ec1,_0x150554));_0x872062['setHeader'](_0xc82c('0x86'),_0xc82c('0x87'));return _0x872062[_0xc82c('0x88')](util[_0xc82c('0x6c')](_0xc82c('0x89'),_0x5a4ec1,_0x150554));}else{return _0x872062[_0xc82c('0x2e')](0xcc);}});});});};exports[_0xc82c('0x8a')]=function(_0x1662cb,_0x2e8232,_0x315552){var _0x38cb23;delete _0x1662cb[_0xc82c('0x59')]['id'];return db[_0xc82c('0x48')]['findOne']({'where':{'id':_0x1662cb['params']['id']}})['then'](handleEntityNotFound(_0x2e8232,null))[_0xc82c('0x29')](function(_0x5e79c1){if(_0x5e79c1){return db[_0xc82c('0x8b')][_0xc82c('0x8c')](function(_0x4168bf){return db[_0xc82c('0x69')][_0xc82c('0x53')](_0x1662cb[_0xc82c('0x59')],{'transaction':_0x4168bf})['then'](function(_0x42c0b3){_0x38cb23=_0x42c0b3;return _0x5e79c1[_0xc82c('0x8d')](_0x42c0b3,{'transaction':_0x4168bf});})[_0xc82c('0x29')](function(){var _0x427e0d={'type':db['Sequelize'][_0xc82c('0x8e')],'transaction':_0x4168bf};switch(_0x1662cb[_0xc82c('0x59')]['type']){case _0xc82c('0x8f'):_0x427e0d[_0xc82c('0x36')]=db[_0xc82c('0x90')][_0xc82c('0x8e')];break;case'number':_0x427e0d[_0xc82c('0x36')]=db[_0xc82c('0x90')][_0xc82c('0x91')];break;case _0xc82c('0x92'):_0x427e0d[_0xc82c('0x36')]=db[_0xc82c('0x90')][_0xc82c('0x93')];_0x427e0d[_0xc82c('0x94')]=![];break;default:}return db[_0xc82c('0x8b')][_0xc82c('0x95')][_0xc82c('0x96')]('cm_contacts',util['format'](_0xc82c('0x97'),_0x38cb23['id']),_0x427e0d);})['then'](function(){return _0x38cb23;});});}})[_0xc82c('0x29')](respondWithResult(_0x2e8232,null))[_0xc82c('0x4d')](handleError(_0x2e8232,null));};exports[_0xc82c('0x98')]=function(_0x588fb4,_0x20c32f,_0xea3197){var _0x2bc7d8={};var _0x42f835={};var _0x547deb;var _0x10ede6;return db[_0xc82c('0x48')][_0xc82c('0x99')]({'where':{'id':_0x588fb4[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x20c32f,null))[_0xc82c('0x29')](function(_0x10250d){if(_0x10250d){_0x547deb=_0x10250d;_0x42f835[_0xc82c('0x38')]=_['keys'](db[_0xc82c('0x69')][_0xc82c('0x35')]);_0x42f835[_0xc82c('0x39')]=_['keys'](_0x588fb4[_0xc82c('0x39')]);_0x42f835['filters']=_[_0xc82c('0x50')](_0x42f835[_0xc82c('0x38')],_0x42f835['query']);_0x2bc7d8['attributes']=_[_0xc82c('0x50')](_0x42f835[_0xc82c('0x38')],qs['fields'](_0x588fb4[_0xc82c('0x39')]['fields']));_0x2bc7d8['attributes']=_0x2bc7d8['attributes'][_0xc82c('0x3e')]?_0x2bc7d8[_0xc82c('0x3c')]:_0x42f835['model'];_0x2bc7d8[_0xc82c('0x41')]=qs[_0xc82c('0x42')](_0x588fb4[_0xc82c('0x39')][_0xc82c('0x42')]);_0x2bc7d8[_0xc82c('0x43')]=qs[_0xc82c('0x3b')](_[_0xc82c('0x44')](_0x588fb4[_0xc82c('0x39')],_0x42f835[_0xc82c('0x3b')]));_0x2bc7d8[_0xc82c('0x43')]=_[_0xc82c('0x47')](_0x2bc7d8[_0xc82c('0x43')],{'$or':[{'ListId':_0x10250d['id']},{'ListId':null}]});if(_0x588fb4[_0xc82c('0x39')][_0xc82c('0x45')]){_0x2bc7d8[_0xc82c('0x43')]=_[_0xc82c('0x47')](_0x2bc7d8[_0xc82c('0x43')],{'$or':_[_0xc82c('0x34')](_0x2bc7d8[_0xc82c('0x3c')],function(_0x1a4cd9){var _0x36d2fa={};_0x36d2fa[_0x1a4cd9]={'$like':'%'+_0x588fb4['query'][_0xc82c('0x45')]+'%'};return _0x36d2fa;})});}_0x2bc7d8=_[_0xc82c('0x47')]({},_0x2bc7d8,_0x588fb4[_0xc82c('0x51')]);return db[_0xc82c('0x69')][_0xc82c('0x9a')](_0x2bc7d8);}})['then'](respondWithResult(_0x20c32f,null))[_0xc82c('0x4d')](handleError(_0x20c32f,null));};exports[_0xc82c('0x9b')]=function(_0x2a6705,_0x897517){return db[_0xc82c('0x69')]['findAndCountAll']({'where':{'ListId':null}})[_0xc82c('0x29')](handleEntityNotFound(_0x897517,null))[_0xc82c('0x29')](function(_0x16f10c){return _0x16f10c;})[_0xc82c('0x29')](respondWithResult(_0x897517,null))[_0xc82c('0x4d')](handleError(_0x897517,null));};exports[_0xc82c('0x9c')]=function(_0x385d6a,_0x282fd7,_0x547c45){return db[_0xc82c('0x48')][_0xc82c('0x52')]({'where':{'id':_0x385d6a[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x282fd7,null))['then'](function(_0x45a47e){if(_0x45a47e){return _0x45a47e[_0xc82c('0x9c')](_0x385d6a['body'][_0xc82c('0x5e')],_[_0xc82c('0x65')](_0x385d6a[_0xc82c('0x59')],[_0xc82c('0x5e'),'id'])||{})['spread'](function(_0x2ba0fa){for(var _0x4a8e1a=0x0;_0x4a8e1a<_0x385d6a[_0xc82c('0x59')][_0xc82c('0x5e')]['length'];_0x4a8e1a+=0x1){socket[_0xc82c('0x9d')](_0xc82c('0x9e'),{'UserId':Number(_0x385d6a['body'][_0xc82c('0x5e')][_0x4a8e1a]),'CmListId':Number(_0x385d6a[_0xc82c('0x4f')]['id'])});}return _0x2ba0fa;});}})[_0xc82c('0x29')](respondWithResult(_0x282fd7,null))[_0xc82c('0x4d')](handleError(_0x282fd7,null));};exports[_0xc82c('0x9f')]=function(_0x352e6a,_0x52061c,_0x6cf69e){return db[_0xc82c('0x48')][_0xc82c('0x52')]({'where':{'id':_0x352e6a[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x52061c,null))[_0xc82c('0x29')](function(_0x4c22d8){if(_0x4c22d8){return _0x4c22d8['removeAgents'](_0x352e6a[_0xc82c('0x39')][_0xc82c('0x5e')])[_0xc82c('0x29')](function(){if(_[_0xc82c('0x60')](_0x352e6a['query']['ids'])){for(var _0x132a12=0x0;_0x132a12<_0x352e6a[_0xc82c('0x39')]['ids'][_0xc82c('0x3e')];_0x132a12+=0x1){socket[_0xc82c('0x9d')](_0xc82c('0xa0'),{'UserId':Number(_0x352e6a[_0xc82c('0x39')][_0xc82c('0x5e')][_0x132a12]),'CmListId':Number(_0x352e6a[_0xc82c('0x4f')]['id'])});}}else{socket[_0xc82c('0x9d')](_0xc82c('0xa0'),{'UserId':Number(_0x352e6a[_0xc82c('0x39')][_0xc82c('0x5e')]),'CmListId':Number(_0x352e6a[_0xc82c('0x4f')]['id'])});}});}})[_0xc82c('0x29')](respondWithStatusCode(_0x52061c,null))[_0xc82c('0x4d')](handleError(_0x52061c,null));};exports[_0xc82c('0xa1')]=function(_0x15c83e,_0x1d0801,_0x33f600){var _0x20ee43={};var _0xa35492={};var _0x327c39;var _0x553cb7;return db['CmList']['findOne']({'where':{'id':_0x15c83e[_0xc82c('0x4f')]['id']}})[_0xc82c('0x29')](handleEntityNotFound(_0x1d0801,null))[_0xc82c('0x29')](function(_0x4d7433){if(_0x4d7433){_0x327c39=_0x4d7433;_0xa35492[_0xc82c('0x38')]=_[_0xc82c('0x3a')](db[_0xc82c('0xa2')]['rawAttributes']);_0xa35492[_0xc82c('0x39')]=_[_0xc82c('0x3a')](_0x15c83e[_0xc82c('0x39')]);_0xa35492[_0xc82c('0x3b')]=_[_0xc82c('0x50')](_0xa35492['model'],_0xa35492['query']);_0x20ee43['attributes']=_['intersection'](_0xa35492['model'],qs[_0xc82c('0x3d')](_0x15c83e['query'][_0xc82c('0x3d')]));_0x20ee43[_0xc82c('0x3c')]=_0x20ee43[_0xc82c('0x3c')][_0xc82c('0x3e')]?_0x20ee43[_0xc82c('0x3c')]:_0xa35492[_0xc82c('0x38')];_0x20ee43[_0xc82c('0x41')]=qs[_0xc82c('0x42')](_0x15c83e[_0xc82c('0x39')][_0xc82c('0x42')]);_0x20ee43[_0xc82c('0x43')]=qs[_0xc82c('0x3b')](_[_0xc82c('0x44')](_0x15c83e[_0xc82c('0x39')],_0xa35492[_0xc82c('0x3b')]));if(_0x15c83e[_0xc82c('0x39')][_0xc82c('0x45')]){_0x20ee43[_0xc82c('0x43')]=_[_0xc82c('0x47')](_0x20ee43[_0xc82c('0x43')],{'$or':_[_0xc82c('0x34')](_0x20ee43[_0xc82c('0x3c')],function(_0x136ef2){var _0x20dd99={};_0x20dd99[_0x136ef2]={'$like':'%'+_0x15c83e[_0xc82c('0x39')][_0xc82c('0x45')]+'%'};return _0x20dd99;})});}_0x20ee43=_[_0xc82c('0x47')]({},_0x20ee43,_0x15c83e[_0xc82c('0x51')]);return _0x327c39['getAgents'](_0x20ee43);}})[_0xc82c('0x29')](function(_0x3134f7){if(_0x3134f7){_0x553cb7=_0x3134f7[_0xc82c('0x3e')];if(!_0x15c83e[_0xc82c('0x39')][_0xc82c('0x3f')](_0xc82c('0x40'))){_0x20ee43[_0xc82c('0x22')]=qs[_0xc82c('0x22')](_0x15c83e[_0xc82c('0x39')][_0xc82c('0x22')]);_0x20ee43[_0xc82c('0x21')]=qs[_0xc82c('0x21')](_0x15c83e[_0xc82c('0x39')]['offset']);}return _0x327c39['getAgents'](_0x20ee43);}})[_0xc82c('0x29')](function(_0x1953d7){if(_0x1953d7){return _0x1953d7?{'count':_0x553cb7,'rows':_0x1953d7}:null;}})[_0xc82c('0x29')](respondWithResult(_0x1d0801,null))[_0xc82c('0x4d')](handleError(_0x1d0801,null));};function handleQuery(_0x130780){logger[_0xc82c('0xa3')](_0x130780);return db['sequelize'][_0xc82c('0x39')](_0x130780)[_0xc82c('0xa4')](function(_0x47ab75){csv_results[_0xc82c('0x62')](_0x47ab75);})[_0xc82c('0x4d')](function(_0x297245){logger[_0xc82c('0x2f')](_0x297245[_0xc82c('0xa5')]);});} \ No newline at end of file +var _0x1d99=['getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','sendStatus','addCustomField','findOne','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','isArray','userCmList:remove','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','fields','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','create','Disposition','hasOwnProperty','include','ids','addContacts','CmContact','tags','join','push','each','success','errors','message','Malformed\x20request\x20syntax'];(function(_0x3b7fc4,_0x442564){var _0x1c6ccf=function(_0x16579d){while(--_0x16579d){_0x3b7fc4['push'](_0x3b7fc4['shift']());}};_0x1c6ccf(++_0x442564);}(_0x1d99,0x18a));var _0x91d9=function(_0x3cc02f,_0x210421){_0x3cc02f=_0x3cc02f-0x0;var _0x11bf29=_0x1d99[_0x3cc02f];return _0x11bf29;};'use strict';var emlformat=require(_0x91d9('0x0'));var rimraf=require(_0x91d9('0x1'));var zipdir=require(_0x91d9('0x2'));var jsonpatch=require(_0x91d9('0x3'));var rp=require(_0x91d9('0x4'));var moment=require(_0x91d9('0x5'));var BPromise=require(_0x91d9('0x6'));var Mustache=require(_0x91d9('0x7'));var util=require(_0x91d9('0x8'));var path=require(_0x91d9('0x9'));var sox=require('sox');var csv=require(_0x91d9('0xa'));var ejs=require(_0x91d9('0xb'));var fs=require('fs');var fs_extra=require(_0x91d9('0xc'));var _=require('lodash');var squel=require(_0x91d9('0xd'));var crypto=require(_0x91d9('0xe'));var jsforce=require(_0x91d9('0xf'));var deskjs=require(_0x91d9('0x10'));var toCsv=require(_0x91d9('0xa'));var querystring=require(_0x91d9('0x11'));var Papa=require(_0x91d9('0x12'));var Redis=require(_0x91d9('0x13'));var authService=require(_0x91d9('0x14'));var qs=require(_0x91d9('0x15'));var as=require(_0x91d9('0x16'));var hardwareService=require(_0x91d9('0x17'));var logger=require(_0x91d9('0x18'))(_0x91d9('0x19'));var utils=require(_0x91d9('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x91d9('0x1b'));var db=require(_0x91d9('0x1c'))['db'];var csv_results;config[_0x91d9('0x1d')]=_[_0x91d9('0x1e')](config[_0x91d9('0x1d')],{'host':_0x91d9('0x1f'),'port':0x18eb});var socket=require(_0x91d9('0x20'))(new Redis(config[_0x91d9('0x1d')]));require(_0x91d9('0x21'))[_0x91d9('0x22')](socket);function respondWithStatusCode(_0x25296e,_0x55e7a3){_0x55e7a3=_0x55e7a3||0xcc;return function(_0x21e44c){if(_0x21e44c){return _0x25296e['sendStatus'](_0x55e7a3);}return _0x25296e[_0x91d9('0x23')](_0x55e7a3)['end']();};}function respondWithResult(_0x3e867f,_0x455796){_0x455796=_0x455796||0xc8;return function(_0x3cd190){if(_0x3cd190){return _0x3e867f[_0x91d9('0x23')](_0x455796)[_0x91d9('0x24')](_0x3cd190);}};}function respondWithFilteredResult(_0x3c8cce,_0x59ce56){return function(_0x367457){if(_0x367457){var _0x10f2e8=typeof _0x59ce56[_0x91d9('0x25')]===_0x91d9('0x26')&&typeof _0x59ce56[_0x91d9('0x27')]===_0x91d9('0x26');var _0x3e72e7=_0x367457[_0x91d9('0x28')];var _0x3049f4=_0x10f2e8?0x0:_0x59ce56[_0x91d9('0x25')];var _0x1afefd=_0x10f2e8?_0x367457[_0x91d9('0x28')]:_0x59ce56[_0x91d9('0x25')]+_0x59ce56[_0x91d9('0x27')];var _0x1efc9c;if(_0x1afefd>=_0x3e72e7){_0x1afefd=_0x3e72e7;_0x1efc9c=0xc8;}else{_0x1efc9c=0xce;}_0x3c8cce[_0x91d9('0x23')](_0x1efc9c);return _0x3c8cce[_0x91d9('0x29')]('Content-Range',_0x3049f4+'-'+_0x1afefd+'/'+_0x3e72e7)[_0x91d9('0x24')](_0x367457);}return null;};}function patchUpdates(_0x23fc3f){return function(_0x56562d){try{jsonpatch[_0x91d9('0x2a')](_0x56562d,_0x23fc3f,!![]);}catch(_0x54bbd6){return BPromise[_0x91d9('0x2b')](_0x54bbd6);}return _0x56562d[_0x91d9('0x2c')]();};}function saveUpdates(_0x21c4ef,_0x234daa){return function(_0x129c3b){if(_0x129c3b){return _0x129c3b[_0x91d9('0x2d')](_0x21c4ef)['then'](function(_0x143488){return _0x143488;});}return null;};}function removeEntity(_0x56381a,_0x27c327){return function(_0x1ddb66){if(_0x1ddb66){return _0x1ddb66[_0x91d9('0x2e')]()['then'](function(){var _0x115849=_0x1ddb66[_0x91d9('0x2f')]({'plain':!![]});var _0x128eb4='Lists';return db[_0x91d9('0x30')][_0x91d9('0x2e')]({'where':{'type':_0x128eb4,'resourceId':_0x115849['id']}})[_0x91d9('0x31')](function(){return _0x1ddb66;});})[_0x91d9('0x31')](function(){_0x56381a[_0x91d9('0x23')](0xcc)[_0x91d9('0x32')]();});}};}function handleEntityNotFound(_0x37c859,_0x2a3051){return function(_0x5f2c4f){if(!_0x5f2c4f){_0x37c859['sendStatus'](0x194);}return _0x5f2c4f;};}function handleError(_0x4315e7,_0xe10ae){_0xe10ae=_0xe10ae||0x1f4;return function(_0x2fada0){logger[_0x91d9('0x33')](_0x2fada0['stack']);if(_0x2fada0['name']){delete _0x2fada0[_0x91d9('0x34')];}_0x4315e7[_0x91d9('0x23')](_0xe10ae)[_0x91d9('0x35')](_0x2fada0);};}exports[_0x91d9('0x36')]=function(_0x1d89cd,_0x2f2350){var _0x408f2c={},_0x1e4ee9={},_0x313a09={'count':0x0,'rows':[]};var _0x49aae1=_[_0x91d9('0x37')](db[_0x91d9('0x38')][_0x91d9('0x39')],function(_0x27db61){return{'name':_0x27db61[_0x91d9('0x3a')],'type':_0x27db61[_0x91d9('0x3b')][_0x91d9('0x3c')]};});_0x1e4ee9['model']=_['map'](_0x49aae1,_0x91d9('0x34'));_0x1e4ee9[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x1d89cd['query']);_0x1e4ee9['filters']=_[_0x91d9('0x3f')](_0x1e4ee9[_0x91d9('0x40')],_0x1e4ee9['query']);_0x408f2c[_0x91d9('0x41')]=_['intersection'](_0x1e4ee9[_0x91d9('0x40')],qs['fields'](_0x1d89cd[_0x91d9('0x3d')]['fields']));_0x408f2c['attributes']=_0x408f2c['attributes']['length']?_0x408f2c['attributes']:_0x1e4ee9['model'];if(!_0x1d89cd[_0x91d9('0x3d')]['hasOwnProperty'](_0x91d9('0x42'))){_0x408f2c[_0x91d9('0x27')]=qs['limit'](_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x27')]);_0x408f2c[_0x91d9('0x25')]=qs[_0x91d9('0x25')](_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x25')]);}_0x408f2c[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x1d89cd[_0x91d9('0x3d')]['sort']);_0x408f2c[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x1d89cd[_0x91d9('0x3d')],_0x1e4ee9['filters']),_0x49aae1);if(_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x408f2c[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x408f2c[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x49aae1,function(_0x581245){if(_0x581245[_0x91d9('0x3b')]!=='VIRTUAL'){var _0x5f2d7e={};_0x5f2d7e[_0x581245[_0x91d9('0x34')]]={'$like':'%'+_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x48')]+'%'};return _0x5f2d7e;}})});}_0x408f2c=_['merge']({},_0x408f2c,_0x1d89cd[_0x91d9('0x4a')]);var _0x2ce977={'where':_0x408f2c[_0x91d9('0x45')]};return db['CmList'][_0x91d9('0x28')](_0x2ce977)[_0x91d9('0x31')](function(_0x2f410e){_0x313a09[_0x91d9('0x28')]=_0x2f410e;if(_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x408f2c['include']=[{'all':!![]}];}return db['CmList'][_0x91d9('0x4c')](_0x408f2c);})[_0x91d9('0x31')](function(_0x4656c2){_0x313a09[_0x91d9('0x4d')]=_0x4656c2;return _0x313a09;})['then'](respondWithFilteredResult(_0x2f2350,_0x408f2c))[_0x91d9('0x4e')](handleError(_0x2f2350,null));};exports['show']=function(_0x33f91d,_0x13b007){var _0x2fc38e={'raw':![],'where':{'id':_0x33f91d[_0x91d9('0x4f')]['id']}},_0x170ad5={};_0x170ad5[_0x91d9('0x40')]=_[_0x91d9('0x3e')](db[_0x91d9('0x38')][_0x91d9('0x39')]);_0x170ad5[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x33f91d[_0x91d9('0x3d')]);_0x170ad5[_0x91d9('0x46')]=_['intersection'](_0x170ad5[_0x91d9('0x40')],_0x170ad5[_0x91d9('0x3d')]);_0x2fc38e[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x170ad5[_0x91d9('0x40')],qs['fields'](_0x33f91d[_0x91d9('0x3d')][_0x91d9('0x50')]));_0x2fc38e['attributes']=_0x2fc38e['attributes'][_0x91d9('0x51')]?_0x2fc38e[_0x91d9('0x41')]:_0x170ad5[_0x91d9('0x40')];if(_0x33f91d[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x2fc38e['include']=[{'all':!![]}];}_0x2fc38e=_[_0x91d9('0x49')]({},_0x2fc38e,_0x33f91d[_0x91d9('0x4a')]);return db[_0x91d9('0x38')][_0x91d9('0x52')](_0x2fc38e)[_0x91d9('0x31')](handleEntityNotFound(_0x13b007,null))[_0x91d9('0x31')](respondWithResult(_0x13b007,null))['catch'](handleError(_0x13b007,null));};exports['create']=function(_0x7c8266,_0x5a538f){return db[_0x91d9('0x38')]['create'](_0x7c8266[_0x91d9('0x53')],{})[_0x91d9('0x31')](function(_0x9789c4){var _0x34b9cb=_0x7c8266[_0x91d9('0x54')]['get']({'plain':!![]});if(!_0x34b9cb)throw new Error(_0x91d9('0x55'));if(_0x34b9cb[_0x91d9('0x56')]==='user'){var _0xe63553=_0x9789c4[_0x91d9('0x2f')]({'plain':!![]});var _0x2b4239=_0x91d9('0x57');return db['UserProfileSection'][_0x91d9('0x52')]({'where':{'name':_0x2b4239,'userProfileId':_0x34b9cb['userProfileId']},'raw':!![]})[_0x91d9('0x31')](function(_0x135dc6){if(_0x135dc6&&_0x135dc6[_0x91d9('0x58')]===0x0){return db[_0x91d9('0x30')]['create']({'name':_0xe63553[_0x91d9('0x34')],'resourceId':_0xe63553['id'],'type':_0x135dc6['name'],'sectionId':_0x135dc6['id']},{})['then'](function(){return _0x9789c4;});}else{return _0x9789c4;}})[_0x91d9('0x4e')](function(_0x278299){logger['error'](_0x91d9('0x59'),_0x278299);throw _0x278299;});}return _0x9789c4;})['then'](respondWithResult(_0x5a538f,0xc9))[_0x91d9('0x4e')](handleError(_0x5a538f,null));};exports[_0x91d9('0x2d')]=function(_0x1e44ad,_0x1c79d){if(_0x1e44ad[_0x91d9('0x53')]['id']){delete _0x1e44ad[_0x91d9('0x53')]['id'];}return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x1e44ad[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c79d,null))[_0x91d9('0x31')](saveUpdates(_0x1e44ad[_0x91d9('0x53')],null))[_0x91d9('0x31')](respondWithResult(_0x1c79d,null))[_0x91d9('0x4e')](handleError(_0x1c79d,null));};exports[_0x91d9('0x2e')]=function(_0x15bb2f,_0x4bba1e){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x15bb2f[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x4bba1e,null))[_0x91d9('0x31')](removeEntity(_0x4bba1e,null))[_0x91d9('0x4e')](handleError(_0x4bba1e,null));};exports[_0x91d9('0x5a')]=function(_0x4c1514,_0x2db87f){return db[_0x91d9('0x38')][_0x91d9('0x5a')]()[_0x91d9('0x31')](respondWithResult(_0x2db87f,null))[_0x91d9('0x4e')](handleError(_0x2db87f,null));};exports['addDisposition']=function(_0xc74d96,_0x2006c1,_0x2a496c){if(_0xc74d96['body']['id']){delete _0xc74d96[_0x91d9('0x53')]['id'];}return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0xc74d96[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x2006c1,null))[_0x91d9('0x31')](function(_0x9c2790){if(_0x9c2790){_0xc74d96['body'][_0x91d9('0x5b')]=_0x9c2790['id'];return db['Disposition'][_0x91d9('0x5c')](_0xc74d96[_0x91d9('0x53')]);}})['then'](respondWithResult(_0x2006c1,null))[_0x91d9('0x4e')](handleError(_0x2006c1,null));};exports['getDispositions']=function(_0xfcb799,_0x4a0f81,_0x13b57a){var _0x49b206={'raw':![],'where':{}};var _0x38642a={};var _0x4fdf2d={'count':0x0,'rows':[]};return db[_0x91d9('0x38')]['findOne']({'where':{'id':_0xfcb799[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a0f81,null))[_0x91d9('0x31')](function(_0x1fe6bf){if(_0x1fe6bf){_0x38642a[_0x91d9('0x40')]=_[_0x91d9('0x3e')](db[_0x91d9('0x5d')][_0x91d9('0x39')]);_0x38642a[_0x91d9('0x3d')]=_['keys'](_0xfcb799[_0x91d9('0x3d')]);_0x38642a[_0x91d9('0x46')]=_[_0x91d9('0x3f')](_0x38642a[_0x91d9('0x40')],_0x38642a[_0x91d9('0x3d')]);_0x49b206['attributes']=_[_0x91d9('0x3f')](_0x38642a[_0x91d9('0x40')],qs['fields'](_0xfcb799[_0x91d9('0x3d')]['fields']));_0x49b206[_0x91d9('0x41')]=_0x49b206[_0x91d9('0x41')]['length']?_0x49b206[_0x91d9('0x41')]:_0x38642a[_0x91d9('0x40')];if(!_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x5e')]('nolimit')){_0x49b206[_0x91d9('0x27')]=qs[_0x91d9('0x27')](_0xfcb799[_0x91d9('0x3d')]['limit']);_0x49b206['offset']=qs[_0x91d9('0x25')](_0xfcb799[_0x91d9('0x3d')]['offset']);}_0x49b206['order']=qs['sort'](_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x49b206[_0x91d9('0x45')]=qs['filters'](_[_0x91d9('0x47')](_0xfcb799[_0x91d9('0x3d')],_0x38642a['filters']));_0x49b206[_0x91d9('0x45')][_0x91d9('0x5b')]=_0x1fe6bf['id'];if(_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x49b206[_0x91d9('0x45')]=_['merge'](_0x49b206[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x49b206[_0x91d9('0x41')],function(_0x3c4b63){var _0x89c8fd={};_0x89c8fd[_0x3c4b63]={'$like':'%'+_0xfcb799[_0x91d9('0x3d')]['filter']+'%'};return _0x89c8fd;})});}_0x49b206=_[_0x91d9('0x49')]({},_0x49b206,_0xfcb799['options']);return db['Disposition'][_0x91d9('0x28')]({'where':_0x49b206[_0x91d9('0x45')]})['then'](function(_0x2a4bf5){_0x4fdf2d[_0x91d9('0x28')]=_0x2a4bf5;if(_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x49b206[_0x91d9('0x5f')]=[{'all':!![]}];}return db[_0x91d9('0x5d')][_0x91d9('0x4c')](_0x49b206);})[_0x91d9('0x31')](function(_0x161bb4){_0x4fdf2d[_0x91d9('0x4d')]=_0x161bb4;return _0x4fdf2d;});}})[_0x91d9('0x31')](respondWithFilteredResult(_0x4a0f81,_0x49b206))['catch'](handleError(_0x4a0f81,null));};exports['removeDispositions']=function(_0x332f8b,_0x37739f,_0x596625){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x332f8b['params']['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x37739f,null))[_0x91d9('0x31')](function(_0x2ee6de){if(_0x2ee6de){return _0x2ee6de['removeDispositions'](_0x332f8b[_0x91d9('0x3d')][_0x91d9('0x60')]);}})[_0x91d9('0x31')](respondWithStatusCode(_0x37739f,null))[_0x91d9('0x4e')](handleError(_0x37739f,null));};exports[_0x91d9('0x61')]=function(_0x444897,_0xc06895,_0x1c47b3){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x444897[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0xc06895,null))[_0x91d9('0x31')](function(_0x42fbec){if(_0x42fbec){var _0x8512b4=[];var _0x305085={'success':[],'errors':[]};return db[_0x91d9('0x62')][_0x91d9('0x5a')]()[_0x91d9('0x31')](function(_0x3414fc){if(_0x444897[_0x91d9('0x53')]['tags']&&_['isArray'](_0x444897[_0x91d9('0x53')][_0x91d9('0x63')])){if(_0x444897[_0x91d9('0x53')]['tags'][_0x91d9('0x51')]){_0x444897[_0x91d9('0x53')][_0x91d9('0x63')]=_0x444897[_0x91d9('0x53')][_0x91d9('0x63')][_0x91d9('0x64')](';')+';';}else{_0x444897[_0x91d9('0x53')]['tags']=null;}}else{_0x444897[_0x91d9('0x53')][_0x91d9('0x63')]=null;}if(_0x444897[_0x91d9('0x53')]&&_['isArray'](_0x444897[_0x91d9('0x53')])){for(var _0x509c6a=0x0;_0x509c6a<_0x444897[_0x91d9('0x53')][_0x91d9('0x51')];_0x509c6a+=0x1){_0x444897['body'][_0x509c6a]['ListId']=_0x444897['params']['id'];_0x8512b4[_0x91d9('0x65')](_0x444897[_0x91d9('0x53')][_0x509c6a]);}return BPromise[_0x91d9('0x66')](_0x8512b4,function(_0x478f2c){return db[_0x91d9('0x62')][_0x91d9('0x5c')](_['omit'](_0x478f2c,[_0x91d9('0x60'),'id'])||{},{'fields':_[_0x91d9('0x3e')](_0x3414fc),'raw':!![]})[_0x91d9('0x31')](function(_0x2783b6){_0x305085[_0x91d9('0x67')]['push'](_0x2783b6['dataValues']);})[_0x91d9('0x4e')](function(_0x113fc7){_0x305085[_0x91d9('0x68')][_0x91d9('0x65')]({'data':_0x478f2c,'error':_0x113fc7[_0x91d9('0x69')]});});})[_0x91d9('0x31')](function(_0x2b9aaf){return _0x305085;})[_0x91d9('0x4e')](function(_0x307329){return _0x307329;});}else{_0xc06895['status'](0x190)[_0x91d9('0x24')]({'message':_0x91d9('0x6a')});}});}})[_0x91d9('0x31')](respondWithResult(_0xc06895,null))[_0x91d9('0x4e')](handleError(_0xc06895,null));};exports[_0x91d9('0x6b')]=function(_0x42bcf3,_0x39f57c,_0x1db43a){var _0x54374c;return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x42bcf3[_0x91d9('0x4f')]['id']},'include':[{'model':db[_0x91d9('0x6c')],'as':_0x91d9('0x6d')}]})['then'](handleEntityNotFound(_0x39f57c,null))[_0x91d9('0x31')](function(_0x3c04aa){if(_0x3c04aa){_0x54374c=_0x3c04aa;return db[_0x91d9('0x62')][_0x91d9('0x39')];}})['then'](function(_0x7e26e0){if(_0x7e26e0){var _0x129c09={};var _0x53f7b={};_0x53f7b[_0x91d9('0x40')]=_[_0x91d9('0x6e')](_[_0x91d9('0x3e')](_0x7e26e0),_[_0x91d9('0x37')](_0x54374c[_0x91d9('0x6d')],function(_0xc033dc){return util[_0x91d9('0x6f')](_0x91d9('0x70'),_0xc033dc['id']);}));_0x53f7b[_0x91d9('0x3d')]=_['keys'](_0x42bcf3[_0x91d9('0x3d')]);_0x53f7b['filters']=_['intersection'](_0x53f7b[_0x91d9('0x40')],_0x53f7b['query']);_0x129c09[_0x91d9('0x41')]=_['intersection'](_0x53f7b[_0x91d9('0x40')],qs['fields'](_0x42bcf3[_0x91d9('0x3d')]['fields']));_0x129c09[_0x91d9('0x41')]=_0x129c09[_0x91d9('0x41')][_0x91d9('0x51')]?_0x129c09['attributes']:_0x53f7b[_0x91d9('0x40')];if(!_0x42bcf3['query']['hasOwnProperty']('nolimit')){_0x129c09['limit']=qs[_0x91d9('0x27')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x27')]);_0x129c09[_0x91d9('0x25')]=qs[_0x91d9('0x25')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x25')]);}_0x129c09['order']=qs[_0x91d9('0x44')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x129c09[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x42bcf3[_0x91d9('0x3d')],_0x53f7b[_0x91d9('0x46')]));_0x129c09['raw']=!![];if(_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x129c09[_0x91d9('0x45')]=_['merge'](_0x129c09[_0x91d9('0x45')],{'$or':_['map'](_0x129c09['attributes'],function(_0x213050){var _0x3a5b02={};_0x3a5b02[_0x213050]={'$like':'%'+_0x42bcf3[_0x91d9('0x3d')]['filter']+'%'};return _0x3a5b02;})});}_0x129c09=_[_0x91d9('0x49')]({},_0x129c09,_0x42bcf3[_0x91d9('0x4a')]);return _0x54374c['getContacts'](_0x129c09);}})[_0x91d9('0x31')](respondWithResult(_0x39f57c,null))[_0x91d9('0x4e')](handleError(_0x39f57c,null));};exports[_0x91d9('0x71')]=function(_0x132868,_0x44ee53,_0x29e6d7){var _0x52a28a;var _0x3d72af;var _0x548926;var _0x557e8a=_0x132868['params']['id'];csv_results=[];return db[_0x91d9('0x72')][_0x91d9('0x4c')]({'attributes':['id',_0x91d9('0x34')],'raw':!![],'order':[_0x91d9('0x73')]})['then'](function(_0x3bbc99){_0x52a28a=_0x3bbc99;var _0x1b7764=_[_0x91d9('0x3e')](db['CmContact'][_0x91d9('0x39')]);return db[_0x91d9('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x91d9('0x74')]})['then'](function(_0x52f759){_0x3d72af=_0x52f759;var _0x118dc8=squel[_0x91d9('0x75')]()[_0x91d9('0x50')](_0x1b7764)[_0x91d9('0x76')](_0x91d9('0x77'),'c')['where']('c.ListId\x20=\x20?',_0x557e8a)[_0x91d9('0x45')](_0x91d9('0x78'))['distinct']();for(var _0x42b04e=0x0;_0x42b04e<_0x3d72af[_0x91d9('0x51')];_0x42b04e++){_0x118dc8[_0x91d9('0x79')](_0x91d9('0x7a')+_0x3d72af[_0x42b04e]['id'],_0x91d9('0x7b')+_0x3d72af[_0x42b04e][_0x91d9('0x74')]);}for(var _0x42b04e=0x0;_0x42b04e<_0x52a28a[_0x91d9('0x51')];_0x42b04e++){_0x118dc8['field'](squel[_0x91d9('0x75')]()[_0x91d9('0x79')](_0x91d9('0x7c'))[_0x91d9('0x76')](_0x91d9('0x7d'))[_0x91d9('0x45')](_0x91d9('0x7e'),_0x52a28a[_0x42b04e]['id'])['where']('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x52a28a[_0x42b04e][_0x91d9('0x34')]);_0x118dc8[_0x91d9('0x79')](squel[_0x91d9('0x75')]()[_0x91d9('0x79')](_0x91d9('0x7f'))[_0x91d9('0x76')](_0x91d9('0x7d'))['where'](_0x91d9('0x7e'),_0x52a28a[_0x42b04e]['id'])['where'](_0x91d9('0x80')),_0x91d9('0x81')+_0x52a28a[_0x42b04e][_0x91d9('0x34')]);}var _0x30cd45=[];_0x30cd45[_0x91d9('0x65')](_0x118dc8[_0x91d9('0x82')]());BPromise[_0x91d9('0x66')](_0x30cd45,handleQuery)['then'](function(_0x3301a3){handleQuery(_0x118dc8[_0x91d9('0x82')]());var _0x2ae474=csv_results[0x0];if(!_[_0x91d9('0x83')](_0x2ae474)){var _0x299db2=toCsv(_0x2ae474);var _0x2b4ac0=Date[_0x91d9('0x84')]();fs['writeFileSync'](util[_0x91d9('0x6f')](_0x91d9('0x85'),_0x557e8a,_0x2b4ac0),_0x299db2);_0x44ee53[_0x91d9('0x86')](_0x91d9('0x87'),'attachment;\x20filename='+util[_0x91d9('0x6f')](_0x91d9('0x88'),_0x557e8a,_0x2b4ac0));_0x44ee53['setHeader'](_0x91d9('0x89'),_0x91d9('0x8a'));return _0x44ee53['download'](util[_0x91d9('0x6f')](_0x91d9('0x85'),_0x557e8a,_0x2b4ac0));}else{return _0x44ee53[_0x91d9('0x8b')](0xcc);}});});});};exports[_0x91d9('0x8c')]=function(_0xf7ce03,_0x5e6175,_0x5f145c){var _0x5bf694;delete _0xf7ce03[_0x91d9('0x53')]['id'];return db[_0x91d9('0x38')][_0x91d9('0x8d')]({'where':{'id':_0xf7ce03[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x5e6175,null))[_0x91d9('0x31')](function(_0x439432){if(_0x439432){return db[_0x91d9('0x8e')][_0x91d9('0x8f')](function(_0x4988be){return db['CmCustomField'][_0x91d9('0x5c')](_0xf7ce03[_0x91d9('0x53')],{'transaction':_0x4988be})['then'](function(_0x59619f){_0x5bf694=_0x59619f;return _0x439432[_0x91d9('0x90')](_0x59619f,{'transaction':_0x4988be});})['then'](function(){var _0x192a5e={'type':db['Sequelize'][_0x91d9('0x91')],'transaction':_0x4988be};switch(_0xf7ce03['body'][_0x91d9('0x3b')]){case _0x91d9('0x92'):_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x91')];break;case _0x91d9('0x94'):_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x95')];break;case'switch':_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x96')];_0x192a5e[_0x91d9('0x97')]=![];break;default:}return db['sequelize'][_0x91d9('0x98')][_0x91d9('0x99')]('cm_contacts',util['format'](_0x91d9('0x9a'),_0x5bf694['id']),_0x192a5e);})[_0x91d9('0x31')](function(){return _0x5bf694;});});}})[_0x91d9('0x31')](respondWithResult(_0x5e6175,null))[_0x91d9('0x4e')](handleError(_0x5e6175,null));};exports[_0x91d9('0x9b')]=function(_0x18e221,_0x49572f,_0x1972b4){var _0x34acb4={};var _0x1e09d9={};var _0x533631;var _0x531feb;return db['CmList'][_0x91d9('0x8d')]({'where':{'id':_0x18e221[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x49572f,null))[_0x91d9('0x31')](function(_0x345176){if(_0x345176){_0x533631=_0x345176;_0x1e09d9['model']=_['keys'](db[_0x91d9('0x6c')][_0x91d9('0x39')]);_0x1e09d9[_0x91d9('0x3d')]=_['keys'](_0x18e221['query']);_0x1e09d9[_0x91d9('0x46')]=_[_0x91d9('0x3f')](_0x1e09d9['model'],_0x1e09d9[_0x91d9('0x3d')]);_0x34acb4[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x1e09d9[_0x91d9('0x40')],qs[_0x91d9('0x50')](_0x18e221[_0x91d9('0x3d')]['fields']));_0x34acb4[_0x91d9('0x41')]=_0x34acb4[_0x91d9('0x41')][_0x91d9('0x51')]?_0x34acb4['attributes']:_0x1e09d9[_0x91d9('0x40')];_0x34acb4[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x18e221[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x34acb4[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_['pick'](_0x18e221[_0x91d9('0x3d')],_0x1e09d9[_0x91d9('0x46')]));_0x34acb4[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x34acb4[_0x91d9('0x45')],{'$or':[{'ListId':_0x345176['id']},{'ListId':null}]});if(_0x18e221['query'][_0x91d9('0x48')]){_0x34acb4[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x34acb4[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x34acb4[_0x91d9('0x41')],function(_0x47f014){var _0x243136={};_0x243136[_0x47f014]={'$like':'%'+_0x18e221[_0x91d9('0x3d')]['filter']+'%'};return _0x243136;})});}_0x34acb4=_[_0x91d9('0x49')]({},_0x34acb4,_0x18e221['options']);return db[_0x91d9('0x6c')]['findAndCountAll'](_0x34acb4);}})[_0x91d9('0x31')](respondWithResult(_0x49572f,null))[_0x91d9('0x4e')](handleError(_0x49572f,null));};exports['getGlobalCustomFields']=function(_0x1ab39e,_0x1227b1){return db[_0x91d9('0x6c')][_0x91d9('0x9c')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1227b1,null))[_0x91d9('0x31')](function(_0x49fd3c){return _0x49fd3c;})[_0x91d9('0x31')](respondWithResult(_0x1227b1,null))[_0x91d9('0x4e')](handleError(_0x1227b1,null));};exports[_0x91d9('0x9d')]=function(_0x1e54a4,_0x361e1a,_0x3ae674){return db[_0x91d9('0x38')]['find']({'where':{'id':_0x1e54a4[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x361e1a,null))[_0x91d9('0x31')](function(_0x428031){if(_0x428031){return _0x428031[_0x91d9('0x9d')](_0x1e54a4['body'][_0x91d9('0x60')],_[_0x91d9('0x9e')](_0x1e54a4['body'],[_0x91d9('0x60'),'id'])||{})[_0x91d9('0x9f')](function(_0x5cf4bf){for(var _0x1e390f=0x0;_0x1e390f<_0x1e54a4[_0x91d9('0x53')]['ids'][_0x91d9('0x51')];_0x1e390f+=0x1){socket[_0x91d9('0xa0')](_0x91d9('0xa1'),{'UserId':Number(_0x1e54a4[_0x91d9('0x53')][_0x91d9('0x60')][_0x1e390f]),'CmListId':Number(_0x1e54a4[_0x91d9('0x4f')]['id'])});}return _0x5cf4bf;});}})[_0x91d9('0x31')](respondWithResult(_0x361e1a,null))[_0x91d9('0x4e')](handleError(_0x361e1a,null));};exports['removeAgents']=function(_0x1b2a8b,_0x8ddbbc,_0x4e346e){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x1b2a8b[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x8ddbbc,null))[_0x91d9('0x31')](function(_0x64c5b5){if(_0x64c5b5){return _0x64c5b5['removeAgents'](_0x1b2a8b[_0x91d9('0x3d')][_0x91d9('0x60')])[_0x91d9('0x31')](function(){if(_[_0x91d9('0xa2')](_0x1b2a8b['query']['ids'])){for(var _0x452099=0x0;_0x452099<_0x1b2a8b[_0x91d9('0x3d')]['ids'][_0x91d9('0x51')];_0x452099+=0x1){socket[_0x91d9('0xa0')](_0x91d9('0xa3'),{'UserId':Number(_0x1b2a8b[_0x91d9('0x3d')]['ids'][_0x452099]),'CmListId':Number(_0x1b2a8b['params']['id'])});}}else{socket['emit'](_0x91d9('0xa3'),{'UserId':Number(_0x1b2a8b[_0x91d9('0x3d')][_0x91d9('0x60')]),'CmListId':Number(_0x1b2a8b['params']['id'])});}});}})[_0x91d9('0x31')](respondWithStatusCode(_0x8ddbbc,null))[_0x91d9('0x4e')](handleError(_0x8ddbbc,null));};exports['getAgents']=function(_0x3b159a,_0x39bee2,_0x2ff164){var _0x7aafc4={};var _0x39c25b={};var _0x56d9cd;var _0x46b9db;return db[_0x91d9('0x38')][_0x91d9('0x8d')]({'where':{'id':_0x3b159a[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39bee2,null))[_0x91d9('0x31')](function(_0x5a31be){if(_0x5a31be){_0x56d9cd=_0x5a31be;_0x39c25b['model']=_[_0x91d9('0x3e')](db[_0x91d9('0xa4')]['rawAttributes']);_0x39c25b[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x3b159a[_0x91d9('0x3d')]);_0x39c25b[_0x91d9('0x46')]=_['intersection'](_0x39c25b[_0x91d9('0x40')],_0x39c25b[_0x91d9('0x3d')]);_0x7aafc4[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x39c25b[_0x91d9('0x40')],qs[_0x91d9('0x50')](_0x3b159a['query']['fields']));_0x7aafc4[_0x91d9('0x41')]=_0x7aafc4[_0x91d9('0x41')]['length']?_0x7aafc4[_0x91d9('0x41')]:_0x39c25b[_0x91d9('0x40')];_0x7aafc4[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x7aafc4[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x3b159a[_0x91d9('0x3d')],_0x39c25b[_0x91d9('0x46')]));if(_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x7aafc4[_0x91d9('0x45')]=_['merge'](_0x7aafc4[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x7aafc4['attributes'],function(_0x4f9b6c){var _0xb52fa3={};_0xb52fa3[_0x4f9b6c]={'$like':'%'+_0x3b159a[_0x91d9('0x3d')]['filter']+'%'};return _0xb52fa3;})});}_0x7aafc4=_[_0x91d9('0x49')]({},_0x7aafc4,_0x3b159a[_0x91d9('0x4a')]);return _0x56d9cd[_0x91d9('0xa5')](_0x7aafc4);}})[_0x91d9('0x31')](function(_0x387346){if(_0x387346){_0x46b9db=_0x387346[_0x91d9('0x51')];if(!_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x5e')](_0x91d9('0x42'))){_0x7aafc4['limit']=qs[_0x91d9('0x27')](_0x3b159a['query']['limit']);_0x7aafc4['offset']=qs['offset'](_0x3b159a['query']['offset']);}return _0x56d9cd[_0x91d9('0xa5')](_0x7aafc4);}})[_0x91d9('0x31')](function(_0x5efd3b){if(_0x5efd3b){return _0x5efd3b?{'count':_0x46b9db,'rows':_0x5efd3b}:null;}})[_0x91d9('0x31')](respondWithResult(_0x39bee2,null))[_0x91d9('0x4e')](handleError(_0x39bee2,null));};function handleQuery(_0x151cc0){logger[_0x91d9('0xa6')](_0x151cc0);return db[_0x91d9('0x8e')][_0x91d9('0x3d')](_0x151cc0)[_0x91d9('0x9f')](function(_0x57fc7d){csv_results['push'](_0x57fc7d);})[_0x91d9('0x4e')](function(_0x4d8fa8){logger[_0x91d9('0x33')](_0x4d8fa8[_0x91d9('0x69')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7d7baf4..03723d1 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(_0x456200,_0x3d4c03){var _0x551f2e=function(_0x807f2d){while(--_0x807f2d){_0x456200['push'](_0x456200['shift']());}};_0x551f2e(++_0x3d4c03);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x30aa8a,_0x8b1742){var _0x4c4340=function(_0x6b999a){while(--_0x6b999a){_0x30aa8a['push'](_0x30aa8a['shift']());}};_0x4c4340(++_0x8b1742);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 171071c..abb0577 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 _0x750a=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','moment','bluebird','request-promise'];(function(_0x4fe525,_0xe793e9){var _0x453924=function(_0x36ed91){while(--_0x36ed91){_0x4fe525['push'](_0x4fe525['shift']());}};_0x453924(++_0xe793e9);}(_0x750a,0x140));var _0xa750=function(_0x4d4f0d,_0x1845eb){_0x4d4f0d=_0x4d4f0d-0x0;var _0x13129b=_0x750a[_0x4d4f0d];return _0x13129b;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x1b58e3,_0x4e4566){var _0x2f3de2=function(_0x268703){while(--_0x268703){_0x1b58e3['push'](_0x1b58e3['shift']());}};_0x2f3de2(++_0x4e4566);}(_0xf109,0xce));var _0x9f10=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf109[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 182d441..e85743b 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 _0x7a22=['client','http','redis','defaults','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4cf4aa,_0x329b25){var _0x26eb2f=function(_0x470e75){while(--_0x470e75){_0x4cf4aa['push'](_0x4cf4aa['shift']());}};_0x26eb2f(++_0x329b25);}(_0x7a22,0x1f3));var _0x27a2=function(_0x4e9c00,_0x27c715){_0x4e9c00=_0x4e9c00-0x0;var _0x4d7b5c=_0x7a22[_0x4e9c00];return _0x4d7b5c;};'use strict';var _=require(_0x27a2('0x0'));var util=require(_0x27a2('0x1'));var moment=require(_0x27a2('0x2'));var BPromise=require(_0x27a2('0x3'));var rs=require(_0x27a2('0x4'));var fs=require('fs');var Redis=require(_0x27a2('0x5'));var db=require(_0x27a2('0x6'))['db'];var utils=require(_0x27a2('0x7'));var logger=require(_0x27a2('0x8'))('rpc');var config=require(_0x27a2('0x9'));var jayson=require(_0x27a2('0xa'));var client=jayson[_0x27a2('0xb')][_0x27a2('0xc')]({'port':0x232a});config[_0x27a2('0xd')]=_[_0x27a2('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x27a2('0xf'))(new Redis(config[_0x27a2('0xd')]));require(_0x27a2('0x10'))['register'](socket);function respondWithRpcPromise(_0x5d3ad4,_0xc6d052,_0x32f519){return new BPromise(function(_0x17fbec,_0x3d032e){return client[_0x27a2('0x11')](_0x5d3ad4,_0x32f519)[_0x27a2('0x12')](function(_0x31644b){logger[_0x27a2('0x13')](_0x27a2('0x14'),_0xc6d052,'request\x20sent');logger[_0x27a2('0x15')](_0x27a2('0x16'),_0xc6d052,_0x27a2('0x17'),JSON[_0x27a2('0x18')](_0x31644b));if(_0x31644b[_0x27a2('0x19')]){if(_0x31644b[_0x27a2('0x19')][_0x27a2('0x1a')]===0x1f4){logger[_0x27a2('0x19')](_0x27a2('0x14'),_0xc6d052,_0x31644b[_0x27a2('0x19')][_0x27a2('0x1b')]);return _0x3d032e(_0x31644b[_0x27a2('0x19')][_0x27a2('0x1b')]);}logger['error'](_0x27a2('0x14'),_0xc6d052,_0x31644b[_0x27a2('0x19')]['message']);return _0x17fbec(_0x31644b[_0x27a2('0x19')][_0x27a2('0x1b')]);}else{logger['info'](_0x27a2('0x14'),_0xc6d052,_0x27a2('0x17'));_0x17fbec(_0x31644b[_0x27a2('0x1c')]['message']);}})[_0x27a2('0x1d')](function(_0x5cdc50){logger[_0x27a2('0x19')](_0x27a2('0x14'),_0xc6d052,_0x5cdc50);_0x3d032e(_0x5cdc50);});});} \ No newline at end of file +var _0xe0f0=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring'];(function(_0x528b78,_0x549ea2){var _0x6b01ee=function(_0x4f1db4){while(--_0x4f1db4){_0x528b78['push'](_0x528b78['shift']());}};_0x6b01ee(++_0x549ea2);}(_0xe0f0,0x16c));var _0x0e0f=function(_0x9a307,_0x502f7b){_0x9a307=_0x9a307-0x0;var _0x254590=_0xe0f0[_0x9a307];return _0x254590;};'use strict';var _=require(_0x0e0f('0x0'));var util=require(_0x0e0f('0x1'));var moment=require(_0x0e0f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e0f('0x3'));var fs=require('fs');var Redis=require(_0x0e0f('0x4'));var db=require(_0x0e0f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e0f('0x6'))(_0x0e0f('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e0f('0x8'));var client=jayson['client'][_0x0e0f('0x9')]({'port':0x232a});config[_0x0e0f('0xa')]=_[_0x0e0f('0xb')](config[_0x0e0f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e0f('0xc'))(new Redis(config[_0x0e0f('0xa')]));require(_0x0e0f('0xd'))[_0x0e0f('0xe')](socket);function respondWithRpcPromise(_0x44bab8,_0x40b909,_0x3cb1b4){return new BPromise(function(_0x4888f1,_0x1a5119){return client[_0x0e0f('0xf')](_0x44bab8,_0x3cb1b4)['then'](function(_0x47c140){logger[_0x0e0f('0x10')](_0x0e0f('0x11'),_0x40b909,_0x0e0f('0x12'));logger[_0x0e0f('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x40b909,_0x0e0f('0x12'),JSON['stringify'](_0x47c140));if(_0x47c140[_0x0e0f('0x14')]){if(_0x47c140[_0x0e0f('0x14')]['code']===0x1f4){logger[_0x0e0f('0x14')](_0x0e0f('0x11'),_0x40b909,_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);return _0x1a5119(_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);}logger[_0x0e0f('0x14')](_0x0e0f('0x11'),_0x40b909,_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);return _0x4888f1(_0x47c140['error'][_0x0e0f('0x15')]);}else{logger[_0x0e0f('0x10')]('CmList,\x20%s,\x20%s',_0x40b909,_0x0e0f('0x12'));_0x4888f1(_0x47c140['result'][_0x0e0f('0x15')]);}})[_0x0e0f('0x16')](function(_0x1e7138){logger[_0x0e0f('0x14')]('CmList,\x20%s,\x20%s',_0x40b909,_0x1e7138);_0x1a5119(_0x1e7138);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 18704cd..e3f47b0 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 _0xf697=['./cmList.events','save','remove','update','removeListener','register','cmList:'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xf697,0x126));var _0x7f69=function(_0x34e725,_0x5633f8){_0x34e725=_0x34e725-0x0;var _0x57acc4=_0xf697[_0x34e725];return _0x57acc4;};'use strict';var CmListEvents=require(_0x7f69('0x0'));var events=[_0x7f69('0x1'),_0x7f69('0x2'),_0x7f69('0x3')];function createListener(_0x394476,_0x432c7d){return function(_0x3b201a){_0x432c7d['emit'](_0x394476,_0x3b201a);};}function removeListener(_0x301f8f,_0x47b967){return function(){CmListEvents[_0x7f69('0x4')](_0x301f8f,_0x47b967);};}exports[_0x7f69('0x5')]=function(_0x6352a0){for(var _0x41c6c4=0x0,_0x1882c5=events['length'];_0x41c6c4<_0x1882c5;_0x41c6c4++){var _0x37cd5a=events[_0x41c6c4];var _0x3f0685=createListener(_0x7f69('0x6')+_0x37cd5a,_0x6352a0);CmListEvents['on'](_0x37cd5a,_0x3f0685);}}; \ No newline at end of file +var _0x2cf7=['./cmList.events','save','update','emit','removeListener','register','length','cmList:'];(function(_0xa1c675,_0x3a51c2){var _0x5ad15b=function(_0x25c030){while(--_0x25c030){_0xa1c675['push'](_0xa1c675['shift']());}};_0x5ad15b(++_0x3a51c2);}(_0x2cf7,0x120));var _0x72cf=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x2cf7[_0x2dacca];return _0x4e8745;};'use strict';var CmListEvents=require(_0x72cf('0x0'));var events=[_0x72cf('0x1'),'remove',_0x72cf('0x2')];function createListener(_0x46946a,_0x1c4bb6){return function(_0x18798e){_0x1c4bb6[_0x72cf('0x3')](_0x46946a,_0x18798e);};}function removeListener(_0x5b2645,_0x15f504){return function(){CmListEvents[_0x72cf('0x4')](_0x5b2645,_0x15f504);};}exports[_0x72cf('0x5')]=function(_0x1da313){for(var _0x54200c=0x0,_0x3435f2=events[_0x72cf('0x6')];_0x54200c<_0x3435f2;_0x54200c++){var _0x18e4dd=events[_0x54200c];var _0x27831a=createListener(_0x72cf('0x7')+_0x18e4dd,_0x1da313);CmListEvents['on'](_0x18e4dd,_0x27831a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9bfad83..b4f57f9 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 _0xb04a=['/:id/contacts','addContacts','addCustomField','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post'];(function(_0x28e286,_0x10abcd){var _0xfc8d38=function(_0x1cf7ca){while(--_0x1cf7ca){_0x28e286['push'](_0x28e286['shift']());}};_0xfc8d38(++_0x10abcd);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab04('0x0'));var util=require(_0xab04('0x1'));var path=require(_0xab04('0x2'));var timeout=require(_0xab04('0x3'));var express=require('express');var router=express[_0xab04('0x4')]();var fs_extra=require(_0xab04('0x5'));var auth=require(_0xab04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab04('0x7'));var controller=require(_0xab04('0x8'));router[_0xab04('0x9')]('/',auth['isAuthenticated'](),controller[_0xab04('0xa')]);router[_0xab04('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xab04('0x9')]('/global_fields',auth['isAuthenticated'](),controller['getGlobalCustomFields']);router[_0xab04('0x9')](_0xab04('0xb'),auth[_0xab04('0xc')](),controller[_0xab04('0xd')]);router[_0xab04('0x9')](_0xab04('0xe'),auth[_0xab04('0xc')](),controller[_0xab04('0xf')]);router[_0xab04('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xab04('0x10')]);router[_0xab04('0x9')](_0xab04('0x11'),auth[_0xab04('0xc')](),controller['getContactsCsv']);router[_0xab04('0x9')](_0xab04('0x12'),auth['isAuthenticated'](),controller[_0xab04('0x13')]);router[_0xab04('0x9')](_0xab04('0x14'),auth[_0xab04('0xc')](),controller[_0xab04('0x15')]);router['post']('/',auth[_0xab04('0xc')](),controller[_0xab04('0x16')]);router[_0xab04('0x17')](_0xab04('0xe'),auth[_0xab04('0xc')](),controller['addDisposition']);router['post'](_0xab04('0x18'),auth[_0xab04('0xc')](),controller[_0xab04('0x19')]);router['post']('/:id/fields',auth[_0xab04('0xc')](),controller[_0xab04('0x1a')]);router[_0xab04('0x17')]('/:id/users',auth[_0xab04('0xc')](),controller['addAgents']);router[_0xab04('0x1b')](_0xab04('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xab04('0x1c')](_0xab04('0xb'),auth['isAuthenticated'](),controller[_0xab04('0x1d')]);router[_0xab04('0x1c')](_0xab04('0xe'),auth[_0xab04('0xc')](),controller[_0xab04('0x1e')]);router['delete'](_0xab04('0x14'),auth['isAuthenticated'](),controller[_0xab04('0x1f')]);module[_0xab04('0x20')]=router; \ No newline at end of file +var _0xb6e4=['./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','create','addDisposition','addContacts','/:id/users','addAgents','put','update','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bdd0c,_0x124964){var _0x598cd6=function(_0x4b8c28){while(--_0x4b8c28){_0x3bdd0c['push'](_0x3bdd0c['shift']());}};_0x598cd6(++_0x124964);}(_0xb6e4,0x117));var _0x4b6e=function(_0x3dea6d,_0x642e){_0x3dea6d=_0x3dea6d-0x0;var _0xc1001c=_0xb6e4[_0x3dea6d];return _0xc1001c;};'use strict';var multer=require(_0x4b6e('0x0'));var util=require(_0x4b6e('0x1'));var path=require(_0x4b6e('0x2'));var timeout=require(_0x4b6e('0x3'));var express=require(_0x4b6e('0x4'));var router=express['Router']();var fs_extra=require(_0x4b6e('0x5'));var auth=require(_0x4b6e('0x6'));var interaction=require(_0x4b6e('0x7'));var config=require(_0x4b6e('0x8'));var controller=require(_0x4b6e('0x9'));router[_0x4b6e('0xa')]('/',auth[_0x4b6e('0xb')](),controller['index']);router[_0x4b6e('0xa')](_0x4b6e('0xc'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0xd')]);router[_0x4b6e('0xa')](_0x4b6e('0xe'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0xf')]);router[_0x4b6e('0xa')](_0x4b6e('0x10'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x11')]);router[_0x4b6e('0xa')](_0x4b6e('0x12'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x4b6e('0xa')](_0x4b6e('0x13'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x14')]);router['get'](_0x4b6e('0x15'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x16')]);router['get'](_0x4b6e('0x17'),auth[_0x4b6e('0xb')](),controller['getCustomFields']);router[_0x4b6e('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x4b6e('0x18')]);router[_0x4b6e('0x19')]('/',auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1a')]);router[_0x4b6e('0x19')](_0x4b6e('0x12'),auth['isAuthenticated'](),controller[_0x4b6e('0x1b')]);router[_0x4b6e('0x19')](_0x4b6e('0x13'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1c')]);router[_0x4b6e('0x19')](_0x4b6e('0x17'),auth[_0x4b6e('0xb')](),controller['addCustomField']);router['post'](_0x4b6e('0x1d'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1e')]);router[_0x4b6e('0x1f')](_0x4b6e('0x10'),auth['isAuthenticated'](),controller[_0x4b6e('0x20')]);router['delete'](_0x4b6e('0x10'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x21')]);router[_0x4b6e('0x22')](_0x4b6e('0x12'),auth[_0x4b6e('0xb')](),controller['removeDispositions']);router[_0x4b6e('0x22')](_0x4b6e('0x1d'),auth['isAuthenticated'](),controller[_0x4b6e('0x23')]);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 00d2890..0a14369 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 _0xa0d5=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0x36056c,_0x3b9da2){var _0xf10963=function(_0x549aef){while(--_0x549aef){_0x36056c['push'](_0x36056c['shift']());}};_0xf10963(++_0x3b9da2);}(_0xa0d5,0x1bb));var _0x5a0d=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0xa0d5[_0x45ee03];return _0x13d535;};'use strict';var Sequelize=require(_0x5a0d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a0d('0x1')],'get':function(_0x5d6087){return this[_0x5a0d('0x2')](_0x5a0d('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x5a0d('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x5a0d('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x53df=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x5427a0,_0x1cc3c2){var _0x8a3f26=function(_0x2837a9){while(--_0x2837a9){_0x5427a0['push'](_0x5427a0['shift']());}};_0x8a3f26(++_0x1cc3c2);}(_0x53df,0x156));var _0xf53d=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x53df[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0xf53d('0x0'));module[_0xf53d('0x1')]={'name':{'type':Sequelize[_0xf53d('0x2')],'get':function(_0x58133e){return this[_0xf53d('0x3')](_0xf53d('0x4'));}},'field':{'type':Sequelize[_0xf53d('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf53d('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c9864d3..3fba9a5 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(_0x229c68,_0x1e24f4){var _0x76c64=function(_0x347b8f){while(--_0x347b8f){_0x229c68['push'](_0x229c68['shift']());}};_0x76c64(++_0x1e24f4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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(_0x34d53c,_0x20b5b2){var _0x2d7cd5=function(_0x30d63b){while(--_0x30d63b){_0x34d53c['push'](_0x34d53c['shift']());}};_0x2d7cd5(++_0x20b5b2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 e87fdee..8fc8532 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 _0x630e=['../../config/logger','moment','bluebird','request-promise','rimraf','exports','define','Condition','tools_conditions','util'];(function(_0x4d770d,_0x5af4ce){var _0x11dc7a=function(_0x27d3f7){while(--_0x27d3f7){_0x4d770d['push'](_0x4d770d['shift']());}};_0x11dc7a(++_0x5af4ce);}(_0x630e,0xef));var _0xe630=function(_0x1e9c6b,_0x1a10dd){_0x1e9c6b=_0x1e9c6b-0x0;var _0xccbb02=_0x630e[_0x1e9c6b];return _0xccbb02;};'use strict';var _=require('lodash');var util=require(_0xe630('0x0'));var logger=require(_0xe630('0x1'))('api');var moment=require(_0xe630('0x2'));var BPromise=require(_0xe630('0x3'));var rp=require(_0xe630('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe630('0x5'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0xe630('0x6')]=function(_0x52253f,_0x98e014){return _0x52253f[_0xe630('0x7')](_0xe630('0x8'),attributes,{'tableName':_0xe630('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2219=['path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','bluebird','request-promise'];(function(_0x6e4d51,_0x27cacf){var _0x2adffe=function(_0x85bbe3){while(--_0x85bbe3){_0x6e4d51['push'](_0x6e4d51['shift']());}};_0x2adffe(++_0x27cacf);}(_0x2219,0x128));var _0x9221=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0x2219[_0x1e9e56];return _0x5d5e2e;};'use strict';var _=require(_0x9221('0x0'));var util=require(_0x9221('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9221('0x2'));var rp=require(_0x9221('0x3'));var fs=require('fs');var path=require(_0x9221('0x4'));var rimraf=require(_0x9221('0x5'));var config=require(_0x9221('0x6'));var attributes=require(_0x9221('0x7'));module[_0x9221('0x8')]=function(_0x4a7ee6,_0x1d6fa2){return _0x4a7ee6[_0x9221('0x9')](_0x9221('0xa'),attributes,{'tableName':_0x9221('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 67b66c9..d00d12c 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 _0x4065=['../../config/utils','rpc','../../config/environment','client','http','then','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','bluebird','randomstring'];(function(_0x50a206,_0x5b2b32){var _0x53d576=function(_0x3e70d5){while(--_0x3e70d5){_0x50a206['push'](_0x50a206['shift']());}};_0x53d576(++_0x5b2b32);}(_0x4065,0xee));var _0x5406=function(_0x33702f,_0x3863a1){_0x33702f=_0x33702f-0x0;var _0xd77ca1=_0x4065[_0x33702f];return _0xd77ca1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5406('0x0'));var rs=require(_0x5406('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5406('0x2'));var logger=require('../../config/logger')(_0x5406('0x3'));var config=require(_0x5406('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x5406('0x5')][_0x5406('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d0d5c,_0x4c7495,_0x116730){return new BPromise(function(_0x523e84,_0x4b0078){return client['request'](_0x3d0d5c,_0x116730)[_0x5406('0x7')](function(_0x42e144){logger['info'](_0x5406('0x8'),_0x4c7495,'request\x20sent');logger[_0x5406('0x9')]('Condition,\x20%s,\x20%s,\x20%s',_0x4c7495,_0x5406('0xa'),JSON[_0x5406('0xb')](_0x42e144));if(_0x42e144[_0x5406('0xc')]){if(_0x42e144[_0x5406('0xc')]['code']===0x1f4){logger[_0x5406('0xc')](_0x5406('0x8'),_0x4c7495,_0x42e144['error'][_0x5406('0xd')]);return _0x4b0078(_0x42e144[_0x5406('0xc')][_0x5406('0xd')]);}logger[_0x5406('0xc')](_0x5406('0x8'),_0x4c7495,_0x42e144[_0x5406('0xc')][_0x5406('0xd')]);return _0x523e84(_0x42e144[_0x5406('0xc')][_0x5406('0xd')]);}else{logger[_0x5406('0xe')](_0x5406('0x8'),_0x4c7495,'request\x20sent');_0x523e84(_0x42e144['result'][_0x5406('0xd')]);}})[_0x5406('0xf')](function(_0x2a375c){logger[_0x5406('0xc')](_0x5406('0x8'),_0x4c7495,_0x2a375c);_0x4b0078(_0x2a375c);});});} \ No newline at end of file +var _0xe8a4=['../../config/logger','../../config/environment','jayson/promise','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xbc78a0,_0xab1e8d){var _0x79a306=function(_0x3039f0){while(--_0x3039f0){_0xbc78a0['push'](_0xbc78a0['shift']());}};_0x79a306(++_0xab1e8d);}(_0xe8a4,0x1f2));var _0x4e8a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe8a4[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x4e8a('0x0'));var util=require(_0x4e8a('0x1'));var moment=require(_0x4e8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e8a('0x4'))['db'];var utils=require(_0x4e8a('0x5'));var logger=require(_0x4e8a('0x6'))('rpc');var config=require(_0x4e8a('0x7'));var jayson=require(_0x4e8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x273bde,_0x3020a5,_0x5838f0){return new BPromise(function(_0x14186e,_0x4486dc){return client[_0x4e8a('0x9')](_0x273bde,_0x5838f0)['then'](function(_0x4cd28f){logger['info'](_0x4e8a('0xa'),_0x3020a5,_0x4e8a('0xb'));logger[_0x4e8a('0xc')](_0x4e8a('0xd'),_0x3020a5,'request\x20sent',JSON[_0x4e8a('0xe')](_0x4cd28f));if(_0x4cd28f['error']){if(_0x4cd28f['error']['code']===0x1f4){logger['error'](_0x4e8a('0xa'),_0x3020a5,_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);return _0x4486dc(_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);}logger[_0x4e8a('0xf')](_0x4e8a('0xa'),_0x3020a5,_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);return _0x14186e(_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3020a5,'request\x20sent');_0x14186e(_0x4cd28f[_0x4e8a('0x11')][_0x4e8a('0x10')]);}})['catch'](function(_0x5322a4){logger['error'](_0x4e8a('0xa'),_0x3020a5,_0x5322a4);_0x4486dc(_0x5322a4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 6751097..87dbbbc 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 _0x580b=['put','isAuthenticated','update','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x580b,0xf0));var _0xb580=function(_0x2a618a,_0x23c93d){_0x2a618a=_0x2a618a-0x0;var _0x66f28f=_0x580b[_0x2a618a];return _0x66f28f;};'use strict';var multer=require(_0xb580('0x0'));var util=require('util');var path=require(_0xb580('0x1'));var timeout=require('connect-timeout');var express=require(_0xb580('0x2'));var router=express[_0xb580('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb580('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb580('0x5'));var controller=require(_0xb580('0x6'));router[_0xb580('0x7')]('/:id',auth[_0xb580('0x8')](),controller[_0xb580('0x9')]);router['delete'](_0xb580('0xa'),auth[_0xb580('0x8')](),controller[_0xb580('0xb')]);module[_0xb580('0xc')]=router; \ No newline at end of file +var _0x8a30=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports'];(function(_0x1daf07,_0x57c650){var _0x179038=function(_0x43be03){while(--_0x43be03){_0x1daf07['push'](_0x1daf07['shift']());}};_0x179038(++_0x57c650);}(_0x8a30,0x121));var _0x08a3=function(_0xc4ec73,_0x39eaeb){_0xc4ec73=_0xc4ec73-0x0;var _0x108483=_0x8a30[_0xc4ec73];return _0x108483;};'use strict';var multer=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var path=require(_0x08a3('0x2'));var timeout=require(_0x08a3('0x3'));var express=require(_0x08a3('0x4'));var router=express[_0x08a3('0x5')]();var fs_extra=require(_0x08a3('0x6'));var auth=require(_0x08a3('0x7'));var interaction=require(_0x08a3('0x8'));var config=require(_0x08a3('0x9'));var controller=require(_0x08a3('0xa'));router[_0x08a3('0xb')](_0x08a3('0xc'),auth[_0x08a3('0xd')](),controller[_0x08a3('0xe')]);router['delete'](_0x08a3('0xc'),auth['isAuthenticated'](),controller[_0x08a3('0xf')]);module[_0x08a3('0x10')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f780c95..75a6ba5 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 _0x61ee=['exports','STRING'];(function(_0x2bf227,_0x1ca0bd){var _0x31e1bd=function(_0x9a6529){while(--_0x9a6529){_0x2bf227['push'](_0x2bf227['shift']());}};_0x31e1bd(++_0x1ca0bd);}(_0x61ee,0xee));var _0xe61e=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0x61ee[_0x3f993e];return _0x39c135;};'use strict';var Sequelize=require('sequelize');module[_0xe61e('0x0')]={'name':{'type':Sequelize[_0xe61e('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xe61e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xfd90=['exports','STRING','sequelize'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xfd90,0x1c4));var _0x0fd9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfd90[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x0fd9('0x0'));module[_0x0fd9('0x1')]={'name':{'type':Sequelize[_0x0fd9('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 660f6f7..97be91f 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 _0xfef3=['catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','ContactItemTypes','UserProfileResource','then','error','stack','name','send','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xfef3,0x118));var _0x3fef=function(_0x462b3a,_0x52fa71){_0x462b3a=_0x462b3a-0x0;var _0xbc5daa=_0xfef3[_0x462b3a];return _0xbc5daa;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){var _0x4d462c=_0x3ba38d['get']({'plain':!![]});var _0x45464b=_0x3fef('0x28');return db[_0x3fef('0x29')][_0x3fef('0x27')]({'where':{'type':_0x45464b,'resourceId':_0x4d462c['id']}})[_0x3fef('0x2a')](function(){return _0x3ba38d;});})['then'](function(){_0x50025f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x121ff0,_0x3baa52){return function(_0x4ea2ab){if(!_0x4ea2ab){_0x121ff0[_0x3fef('0x19')](0x194);}return _0x4ea2ab;};}function handleError(_0x6d08cd,_0x4e08d8){_0x4e08d8=_0x4e08d8||0x1f4;return function(_0x30a954){logger[_0x3fef('0x2b')](_0x30a954[_0x3fef('0x2c')]);if(_0x30a954[_0x3fef('0x2d')]){delete _0x30a954[_0x3fef('0x2d')];}_0x6d08cd[_0x3fef('0x20')](_0x4e08d8)[_0x3fef('0x2e')](_0x30a954);};}exports['index']=function(_0x34576a,_0xc20ce5){var _0x21aad4={},_0x11bd40={},_0x5dbbc0={'count':0x0,'rows':[]};var _0xcd635d=_['map'](db[_0x3fef('0x2f')][_0x3fef('0x30')],function(_0x16009a){return{'name':_0x16009a[_0x3fef('0x31')],'type':_0x16009a[_0x3fef('0x32')][_0x3fef('0x33')]};});_0x11bd40[_0x3fef('0x34')]=_[_0x3fef('0x35')](_0xcd635d,_0x3fef('0x2d'));_0x11bd40[_0x3fef('0x36')]=_['keys'](_0x34576a['query']);_0x11bd40[_0x3fef('0x37')]=_['intersection'](_0x11bd40[_0x3fef('0x34')],_0x11bd40[_0x3fef('0x36')]);_0x21aad4[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x11bd40[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x21aad4[_0x3fef('0x38')]=_0x21aad4[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x21aad4[_0x3fef('0x38')]:_0x11bd40[_0x3fef('0x34')];if(!_0x34576a[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x21aad4[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x21aad4[_0x3fef('0x1c')]=qs['offset'](_0x34576a['query'][_0x3fef('0x1c')]);}_0x21aad4[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x21aad4[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x34576a[_0x3fef('0x36')],_0x11bd40[_0x3fef('0x37')]),_0xcd635d);if(_0x34576a[_0x3fef('0x36')]['filter']){_0x21aad4[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x21aad4['where'],{'$or':_['map'](_0xcd635d,function(_0x37c4af){if(_0x37c4af[_0x3fef('0x32')]!==_0x3fef('0x42')){var _0x21c531={};_0x21c531[_0x37c4af[_0x3fef('0x2d')]]={'$like':'%'+_0x34576a[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x21c531;}})});}_0x21aad4=_[_0x3fef('0x41')]({},_0x21aad4,_0x34576a['options']);var _0x107d42={'where':_0x21aad4[_0x3fef('0x3f')]};return db[_0x3fef('0x2f')][_0x3fef('0x1f')](_0x107d42)[_0x3fef('0x2a')](function(_0x2143ec){_0x5dbbc0[_0x3fef('0x1f')]=_0x2143ec;if(_0x34576a[_0x3fef('0x36')][_0x3fef('0x44')]){_0x21aad4[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x2f')][_0x3fef('0x46')](_0x21aad4);})[_0x3fef('0x2a')](function(_0x15d2c7){_0x5dbbc0[_0x3fef('0x47')]=_0x15d2c7;return _0x5dbbc0;})['then'](respondWithFilteredResult(_0xc20ce5,_0x21aad4))[_0x3fef('0x48')](handleError(_0xc20ce5,null));};exports[_0x3fef('0x49')]=function(_0x421fd1,_0x2120fd){var _0x1879c1={'raw':!![],'where':{'id':_0x421fd1['params']['id']}},_0x33b145={};_0x33b145[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x2f')][_0x3fef('0x30')]);_0x33b145['query']=_[_0x3fef('0x4a')](_0x421fd1['query']);_0x33b145[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],_0x33b145[_0x3fef('0x36')]);_0x1879c1[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x421fd1[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x1879c1[_0x3fef('0x38')]=_0x1879c1[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x1879c1['attributes']:_0x33b145[_0x3fef('0x34')];if(_0x421fd1[_0x3fef('0x36')]['includeAll']){_0x1879c1[_0x3fef('0x45')]=[{'all':!![]}];}_0x1879c1=_[_0x3fef('0x41')]({},_0x1879c1,_0x421fd1[_0x3fef('0x4b')]);return db['ContactItemType'][_0x3fef('0x4c')](_0x1879c1)[_0x3fef('0x2a')](handleEntityNotFound(_0x2120fd,null))['then'](respondWithResult(_0x2120fd,null))[_0x3fef('0x48')](handleError(_0x2120fd,null));};exports['create']=function(_0x48322c,_0x15fb2c){return db['ContactItemType'][_0x3fef('0x4d')](_0x48322c[_0x3fef('0x4e')],{})['then'](function(_0x4535e8){var _0x2823f4=_0x48322c[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x2823f4)throw new Error(_0x3fef('0x50'));if(_0x2823f4[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0x5b1acb=_0x4535e8[_0x3fef('0x52')]({'plain':!![]});var _0x154311=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x154311,'userProfileId':_0x2823f4['userProfileId']},'raw':!![]})[_0x3fef('0x2a')](function(_0xbbf255){if(_0xbbf255&&_0xbbf255[_0x3fef('0x54')]===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0x5b1acb[_0x3fef('0x2d')],'resourceId':_0x5b1acb['id'],'type':_0xbbf255[_0x3fef('0x2d')],'sectionId':_0xbbf255['id']},{})[_0x3fef('0x2a')](function(){return _0x4535e8;});}else{return _0x4535e8;}})[_0x3fef('0x48')](function(_0x4862a5){logger['error'](_0x3fef('0x55'),_0x4862a5);throw _0x4862a5;});}return _0x4535e8;})[_0x3fef('0x2a')](respondWithResult(_0x15fb2c,0xc9))[_0x3fef('0x48')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x26')]=function(_0xd57af2,_0x192f91){if(_0xd57af2[_0x3fef('0x4e')]['id']){delete _0xd57af2[_0x3fef('0x4e')]['id'];}return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0xd57af2[_0x3fef('0x56')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x192f91,null))['then'](saveUpdates(_0xd57af2[_0x3fef('0x4e')],null))[_0x3fef('0x2a')](respondWithResult(_0x192f91,null))[_0x3fef('0x48')](handleError(_0x192f91,null));};exports[_0x3fef('0x27')]=function(_0x5b0415,_0x114191){return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x5b0415[_0x3fef('0x56')]['id']}})['then'](handleEntityNotFound(_0x114191,null))[_0x3fef('0x2a')](db[_0x3fef('0x57')][_0x3fef('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5b0415['params']['id']}}))['then'](removeEntity(_0x114191,null))[_0x3fef('0x48')](handleError(_0x114191,null));}; \ No newline at end of file +var _0xef0f=['rows','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','ContactItemTypes','UserProfileResource','error','stack','name','send','index','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','ContactItemType'];(function(_0x2ded31,_0x3d3da1){var _0x49cffc=function(_0xe2ba9){while(--_0xe2ba9){_0x2ded31['push'](_0x2ded31['shift']());}};_0x49cffc(++_0x3d3da1);}(_0xef0f,0x168));var _0xfef0=function(_0x3f3835,_0x4ad60c){_0x3f3835=_0x3f3835-0x0;var _0x131b9c=_0xef0f[_0x3f3835];return _0x131b9c;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){var _0x5c9085=_0x4483f2['get']({'plain':!![]});var _0x316e20=_0xfef0('0x2a');return db[_0xfef0('0x2b')][_0xfef0('0x28')]({'where':{'type':_0x316e20,'resourceId':_0x5c9085['id']}})[_0xfef0('0x29')](function(){return _0x4483f2;});})[_0xfef0('0x29')](function(){_0x46b34a[_0xfef0('0x1c')](0xcc)[_0xfef0('0x1d')]();});}};}function handleEntityNotFound(_0x391279,_0x529d86){return function(_0x1a6758){if(!_0x1a6758){_0x391279[_0xfef0('0x1b')](0x194);}return _0x1a6758;};}function handleError(_0xca0cce,_0x956de8){_0x956de8=_0x956de8||0x1f4;return function(_0x37921f){logger[_0xfef0('0x2c')](_0x37921f[_0xfef0('0x2d')]);if(_0x37921f[_0xfef0('0x2e')]){delete _0x37921f[_0xfef0('0x2e')];}_0xca0cce[_0xfef0('0x1c')](_0x956de8)[_0xfef0('0x2f')](_0x37921f);};}exports[_0xfef0('0x30')]=function(_0x51af0f,_0x445625){var _0x5806bd={},_0x4eaf74={},_0x7d1692={'count':0x0,'rows':[]};var _0x2ae54a=_['map'](db['ContactItemType']['rawAttributes'],function(_0x4f65cd){return{'name':_0x4f65cd['fieldName'],'type':_0x4f65cd[_0xfef0('0x31')][_0xfef0('0x32')]};});_0x4eaf74[_0xfef0('0x33')]=_['map'](_0x2ae54a,'name');_0x4eaf74['query']=_[_0xfef0('0x34')](_0x51af0f['query']);_0x4eaf74[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x4eaf74[_0xfef0('0x33')],_0x4eaf74['query']);_0x5806bd[_0xfef0('0x37')]=_['intersection'](_0x4eaf74[_0xfef0('0x33')],qs[_0xfef0('0x38')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x38')]));_0x5806bd[_0xfef0('0x37')]=_0x5806bd[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x5806bd[_0xfef0('0x37')]:_0x4eaf74['model'];if(!_0x51af0f[_0xfef0('0x39')][_0xfef0('0x3b')](_0xfef0('0x3c'))){_0x5806bd[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x20')]);_0x5806bd[_0xfef0('0x1e')]=qs[_0xfef0('0x1e')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x1e')]);}_0x5806bd[_0xfef0('0x3d')]=qs[_0xfef0('0x3e')](_0x51af0f['query'][_0xfef0('0x3e')]);_0x5806bd['where']=qs[_0xfef0('0x35')](_[_0xfef0('0x3f')](_0x51af0f[_0xfef0('0x39')],_0x4eaf74['filters']),_0x2ae54a);if(_0x51af0f[_0xfef0('0x39')][_0xfef0('0x40')]){_0x5806bd[_0xfef0('0x41')]=_['merge'](_0x5806bd[_0xfef0('0x41')],{'$or':_[_0xfef0('0x42')](_0x2ae54a,function(_0x39b5c2){if(_0x39b5c2['type']!==_0xfef0('0x43')){var _0x492b90={};_0x492b90[_0x39b5c2['name']]={'$like':'%'+_0x51af0f[_0xfef0('0x39')]['filter']+'%'};return _0x492b90;}})});}_0x5806bd=_['merge']({},_0x5806bd,_0x51af0f[_0xfef0('0x44')]);var _0x61f1ce={'where':_0x5806bd[_0xfef0('0x41')]};return db[_0xfef0('0x45')][_0xfef0('0x21')](_0x61f1ce)[_0xfef0('0x29')](function(_0x4dd8f8){_0x7d1692[_0xfef0('0x21')]=_0x4dd8f8;if(_0x51af0f[_0xfef0('0x39')]['includeAll']){_0x5806bd['include']=[{'all':!![]}];}return db[_0xfef0('0x45')]['findAll'](_0x5806bd);})[_0xfef0('0x29')](function(_0x22c940){_0x7d1692[_0xfef0('0x46')]=_0x22c940;return _0x7d1692;})[_0xfef0('0x29')](respondWithFilteredResult(_0x445625,_0x5806bd))[_0xfef0('0x47')](handleError(_0x445625,null));};exports[_0xfef0('0x48')]=function(_0x166a7b,_0x15b4a6){var _0x4e63f3={'raw':!![],'where':{'id':_0x166a7b['params']['id']}},_0x1813dc={};_0x1813dc['model']=_[_0xfef0('0x34')](db[_0xfef0('0x45')]['rawAttributes']);_0x1813dc[_0xfef0('0x39')]=_['keys'](_0x166a7b[_0xfef0('0x39')]);_0x1813dc[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x1813dc[_0xfef0('0x33')],_0x1813dc['query']);_0x4e63f3[_0xfef0('0x37')]=_[_0xfef0('0x36')](_0x1813dc['model'],qs['fields'](_0x166a7b[_0xfef0('0x39')]['fields']));_0x4e63f3[_0xfef0('0x37')]=_0x4e63f3[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x4e63f3[_0xfef0('0x37')]:_0x1813dc[_0xfef0('0x33')];if(_0x166a7b[_0xfef0('0x39')]['includeAll']){_0x4e63f3[_0xfef0('0x49')]=[{'all':!![]}];}_0x4e63f3=_['merge']({},_0x4e63f3,_0x166a7b['options']);return db[_0xfef0('0x45')][_0xfef0('0x4a')](_0x4e63f3)[_0xfef0('0x29')](handleEntityNotFound(_0x15b4a6,null))['then'](respondWithResult(_0x15b4a6,null))[_0xfef0('0x47')](handleError(_0x15b4a6,null));};exports['create']=function(_0x5dd26b,_0x51f207){return db[_0xfef0('0x45')][_0xfef0('0x4b')](_0x5dd26b[_0xfef0('0x4c')],{})[_0xfef0('0x29')](function(_0x2712e9){var _0xa23cc8=_0x5dd26b[_0xfef0('0x4d')][_0xfef0('0x4e')]({'plain':!![]});if(!_0xa23cc8)throw new Error(_0xfef0('0x4f'));if(_0xa23cc8['role']==='user'){var _0x2bebec=_0x2712e9[_0xfef0('0x4e')]({'plain':!![]});var _0x34e9ed=_0xfef0('0x2a');return db[_0xfef0('0x50')][_0xfef0('0x4a')]({'where':{'name':_0x34e9ed,'userProfileId':_0xa23cc8[_0xfef0('0x51')]},'raw':!![]})[_0xfef0('0x29')](function(_0x5e989f){if(_0x5e989f&&_0x5e989f[_0xfef0('0x52')]===0x0){return db[_0xfef0('0x2b')][_0xfef0('0x4b')]({'name':_0x2bebec[_0xfef0('0x2e')],'resourceId':_0x2bebec['id'],'type':_0x5e989f[_0xfef0('0x2e')],'sectionId':_0x5e989f['id']},{})['then'](function(){return _0x2712e9;});}else{return _0x2712e9;}})['catch'](function(_0x523763){logger[_0xfef0('0x2c')](_0xfef0('0x53'),_0x523763);throw _0x523763;});}return _0x2712e9;})[_0xfef0('0x29')](respondWithResult(_0x51f207,0xc9))[_0xfef0('0x47')](handleError(_0x51f207,null));};exports['update']=function(_0x18a6ee,_0x2b5c33){if(_0x18a6ee[_0xfef0('0x4c')]['id']){delete _0x18a6ee[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x45')][_0xfef0('0x4a')]({'where':{'id':_0x18a6ee[_0xfef0('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b5c33,null))[_0xfef0('0x29')](saveUpdates(_0x18a6ee[_0xfef0('0x4c')],null))['then'](respondWithResult(_0x2b5c33,null))[_0xfef0('0x47')](handleError(_0x2b5c33,null));};exports['destroy']=function(_0x175e97,_0x3f3fd5){return db['ContactItemType'][_0xfef0('0x4a')]({'where':{'id':_0x175e97['params']['id']}})['then'](handleEntityNotFound(_0x3f3fd5,null))['then'](db[_0xfef0('0x55')][_0xfef0('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x175e97[_0xfef0('0x54')]['id']}}))[_0xfef0('0x29')](removeEntity(_0x3f3fd5,null))[_0xfef0('0x47')](handleError(_0x3f3fd5,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index ce58de7..b2bf1f5 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 _0xb25f=['../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','../../config/logger','path','rimraf'];(function(_0x3644c5,_0x399736){var _0x1d7d67=function(_0x3c8a7a){while(--_0x3c8a7a){_0x3644c5['push'](_0x3644c5['shift']());}};_0x1d7d67(++_0x399736);}(_0xb25f,0x1db));var _0xfb25=function(_0x524ef5,_0x25acbe){_0x524ef5=_0x524ef5-0x0;var _0x49bece=_0xb25f[_0x524ef5];return _0x49bece;};'use strict';var _=require(_0xfb25('0x0'));var util=require(_0xfb25('0x1'));var logger=require(_0xfb25('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb25('0x3'));var rimraf=require(_0xfb25('0x4'));var config=require(_0xfb25('0x5'));var attributes=require(_0xfb25('0x6'));module[_0xfb25('0x7')]=function(_0xa1d0a8,_0x311e86){return _0xa1d0a8[_0xfb25('0x8')]('ContactItemType',attributes,{'tableName':_0xfb25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbae0=['request-promise','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b7d49,_0x52bd2b){var _0x2adbd7=function(_0xe602f9){while(--_0xe602f9){_0x5b7d49['push'](_0x5b7d49['shift']());}};_0x2adbd7(++_0x52bd2b);}(_0xbae0,0x1c6));var _0x0bae=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0xbae0[_0x48c615];return _0x3d9e22;};'use strict';var _=require(_0x0bae('0x0'));var util=require(_0x0bae('0x1'));var logger=require(_0x0bae('0x2'))(_0x0bae('0x3'));var moment=require(_0x0bae('0x4'));var BPromise=require(_0x0bae('0x5'));var rp=require(_0x0bae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bae('0x7'));var attributes=require('./contactItemType.attributes');module[_0x0bae('0x8')]=function(_0x3dda4d,_0x45af52){return _0x3dda4d[_0x0bae('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 1a27e9b..58cb10b 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 _0x9863=['jayson/promise','info','ContactItemType,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9863,0x160));var _0x3986=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9863[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3986('0x0'));var util=require(_0x3986('0x1'));var moment=require(_0x3986('0x2'));var BPromise=require(_0x3986('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3986('0x4'));var db=require(_0x3986('0x5'))['db'];var utils=require(_0x3986('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3986('0x7'));var jayson=require(_0x3986('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39495e,_0x57c79e,_0x373e1a){return new BPromise(function(_0x4e0987,_0x23a729){return client['request'](_0x39495e,_0x373e1a)['then'](function(_0x47d319){logger[_0x3986('0x9')](_0x3986('0xa'),_0x57c79e,'request\x20sent');logger[_0x3986('0xb')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x57c79e,_0x3986('0xc'),JSON[_0x3986('0xd')](_0x47d319));if(_0x47d319[_0x3986('0xe')]){if(_0x47d319['error']['code']===0x1f4){logger[_0x3986('0xe')](_0x3986('0xa'),_0x57c79e,_0x47d319['error'][_0x3986('0xf')]);return _0x23a729(_0x47d319[_0x3986('0xe')][_0x3986('0xf')]);}logger['error'](_0x3986('0xa'),_0x57c79e,_0x47d319[_0x3986('0xe')][_0x3986('0xf')]);return _0x4e0987(_0x47d319[_0x3986('0xe')][_0x3986('0xf')]);}else{logger[_0x3986('0x9')]('ContactItemType,\x20%s,\x20%s',_0x57c79e,_0x3986('0xc'));_0x4e0987(_0x47d319[_0x3986('0x10')]['message']);}})[_0x3986('0x11')](function(_0x2b4cc0){logger[_0x3986('0xe')](_0x3986('0xa'),_0x57c79e,_0x2b4cc0);_0x23a729(_0x2b4cc0);});});} \ No newline at end of file +var _0x45d5=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x109cfd,_0x156695){var _0x285452=function(_0xdfb414){while(--_0xdfb414){_0x109cfd['push'](_0x109cfd['shift']());}};_0x285452(++_0x156695);}(_0x45d5,0x1d1));var _0x545d=function(_0x2f23cb,_0x699234){_0x2f23cb=_0x2f23cb-0x0;var _0x581dce=_0x45d5[_0x2f23cb];return _0x581dce;};'use strict';var _=require('lodash');var util=require(_0x545d('0x0'));var moment=require(_0x545d('0x1'));var BPromise=require(_0x545d('0x2'));var rs=require(_0x545d('0x3'));var fs=require('fs');var Redis=require(_0x545d('0x4'));var db=require(_0x545d('0x5'))['db'];var utils=require(_0x545d('0x6'));var logger=require('../../config/logger')(_0x545d('0x7'));var config=require(_0x545d('0x8'));var jayson=require(_0x545d('0x9'));var client=jayson[_0x545d('0xa')][_0x545d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e00a3,_0xee0060,_0x3095d6){return new BPromise(function(_0x2effbd,_0x38619d){return client[_0x545d('0xc')](_0x2e00a3,_0x3095d6)[_0x545d('0xd')](function(_0x91526f){logger[_0x545d('0xe')](_0x545d('0xf'),_0xee0060,_0x545d('0x10'));logger['debug'](_0x545d('0x11'),_0xee0060,_0x545d('0x10'),JSON[_0x545d('0x12')](_0x91526f));if(_0x91526f[_0x545d('0x13')]){if(_0x91526f[_0x545d('0x13')][_0x545d('0x14')]===0x1f4){logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0x91526f[_0x545d('0x13')][_0x545d('0x15')]);return _0x38619d(_0x91526f['error'][_0x545d('0x15')]);}logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0x91526f[_0x545d('0x13')]['message']);return _0x2effbd(_0x91526f[_0x545d('0x13')][_0x545d('0x15')]);}else{logger[_0x545d('0xe')](_0x545d('0xf'),_0xee0060,_0x545d('0x10'));_0x2effbd(_0x91526f['result'][_0x545d('0x15')]);}})[_0x545d('0x16')](function(_0xdfe445){logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0xdfe445);_0x38619d(_0xdfe445);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index e237a54..ee56228 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 _0x1cfd=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c6b93,_0x19880d){var _0x119770=function(_0x2a8cea){while(--_0x2a8cea){_0x4c6b93['push'](_0x4c6b93['shift']());}};_0x119770(++_0x19880d);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x5b2f9f,_0x2f1b0c){_0x5b2f9f=_0x5b2f9f-0x0;var _0x375d65=_0x1cfd[_0x5b2f9f];return _0x375d65;};'use strict';var multer=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var path=require(_0xd1cf('0x2'));var timeout=require(_0xd1cf('0x3'));var express=require(_0xd1cf('0x4'));var router=express['Router']();var fs_extra=require(_0xd1cf('0x5'));var auth=require(_0xd1cf('0x6'));var interaction=require(_0xd1cf('0x7'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0xd1cf('0x8')]('/',auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xa')]);router['get'](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xc')]);router[_0xd1cf('0xd')]('/',auth['isAuthenticated'](),controller[_0xd1cf('0xe')]);router[_0xd1cf('0xf')](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0x10')]);router[_0xd1cf('0x11')](_0xd1cf('0xb'),auth['isAuthenticated'](),controller[_0xd1cf('0x12')]);module[_0xd1cf('0x13')]=router; \ No newline at end of file +var _0x2a29=['../../components/interaction/service','../../config/environment','./contactItemType.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5622a1,_0x117688){var _0x407601=function(_0x49ac69){while(--_0x49ac69){_0x5622a1['push'](_0x5622a1['shift']());}};_0x407601(++_0x117688);}(_0x2a29,0x175));var _0x92a2=function(_0x2b0a1a,_0x799148){_0x2b0a1a=_0x2b0a1a-0x0;var _0x22fed9=_0x2a29[_0x2b0a1a];return _0x22fed9;};'use strict';var multer=require(_0x92a2('0x0'));var util=require('util');var path=require(_0x92a2('0x1'));var timeout=require(_0x92a2('0x2'));var express=require(_0x92a2('0x3'));var router=express[_0x92a2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x92a2('0x5'));var config=require(_0x92a2('0x6'));var controller=require(_0x92a2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x92a2('0x8')]);router[_0x92a2('0x9')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller['show']);router[_0x92a2('0xc')]('/',auth[_0x92a2('0xb')](),controller[_0x92a2('0xd')]);router[_0x92a2('0xe')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller['update']);router[_0x92a2('0xf')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller[_0x92a2('0x10')]);module[_0x92a2('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 d88fe56..4a1b2dd 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe706,0xa3));var _0x6e70=function(_0x4e502e,_0x2a7c94){_0x4e502e=_0x4e502e-0x0;var _0x25c957=_0xe706[_0x4e502e];return _0x25c957;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 824111e..f831ba0 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 _0x5842=['pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardItem','getItems','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','status','undefined','limit','offset','count','set','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','update','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart'];(function(_0x1fac9e,_0x31f7e8){var _0x5d8712=function(_0x218fd2){while(--_0x218fd2){_0x1fac9e['push'](_0x1fac9e['shift']());}};_0x5d8712(++_0x31f7e8);}(_0x5842,0x10d));var _0x2584=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x5842[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2584('0x0'));var zipdir=require(_0x2584('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2584('0x2'));var moment=require('moment');var BPromise=require(_0x2584('0x3'));var Mustache=require(_0x2584('0x4'));var util=require(_0x2584('0x5'));var path=require(_0x2584('0x6'));var sox=require(_0x2584('0x7'));var csv=require(_0x2584('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2584('0x9'));var _=require(_0x2584('0xa'));var squel=require(_0x2584('0xb'));var crypto=require(_0x2584('0xc'));var jsforce=require(_0x2584('0xd'));var deskjs=require(_0x2584('0xe'));var toCsv=require(_0x2584('0x8'));var querystring=require(_0x2584('0xf'));var Papa=require(_0x2584('0x10'));var Redis=require(_0x2584('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2584('0x12'));var as=require(_0x2584('0x13'));var hardwareService=require(_0x2584('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2584('0x15'));var config=require(_0x2584('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2584('0x17')],{'host':_0x2584('0x18'),'port':0x18eb});var socket=require(_0x2584('0x19'))(new Redis(config[_0x2584('0x17')]));require(_0x2584('0x1a'))['register'](socket);function respondWithStatusCode(_0x581607,_0x448ddf){_0x448ddf=_0x448ddf||0xcc;return function(_0x9afeff){if(_0x9afeff){return _0x581607[_0x2584('0x1b')](_0x448ddf);}return _0x581607['status'](_0x448ddf)[_0x2584('0x1c')]();};}function respondWithResult(_0x4aae9e,_0x47fb3a){_0x47fb3a=_0x47fb3a||0xc8;return function(_0x25d9fe){if(_0x25d9fe){return _0x4aae9e[_0x2584('0x1d')](_0x47fb3a)['json'](_0x25d9fe);}};}function respondWithFilteredResult(_0x1cdc9f,_0xf9f012){return function(_0x5d1495){if(_0x5d1495){var _0x4f7965=typeof _0xf9f012['offset']===_0x2584('0x1e')&&typeof _0xf9f012[_0x2584('0x1f')]===_0x2584('0x1e');var _0xf80eea=_0x5d1495['count'];var _0x13c339=_0x4f7965?0x0:_0xf9f012[_0x2584('0x20')];var _0x42a889=_0x4f7965?_0x5d1495[_0x2584('0x21')]:_0xf9f012[_0x2584('0x20')]+_0xf9f012['limit'];var _0x39b4ad;if(_0x42a889>=_0xf80eea){_0x42a889=_0xf80eea;_0x39b4ad=0xc8;}else{_0x39b4ad=0xce;}_0x1cdc9f[_0x2584('0x1d')](_0x39b4ad);return _0x1cdc9f[_0x2584('0x22')]('Content-Range',_0x13c339+'-'+_0x42a889+'/'+_0xf80eea)['json'](_0x5d1495);}return null;};}function patchUpdates(_0x5b3995){return function(_0x1da7e9){try{jsonpatch[_0x2584('0x23')](_0x1da7e9,_0x5b3995,!![]);}catch(_0x32ec3f){return BPromise[_0x2584('0x24')](_0x32ec3f);}return _0x1da7e9[_0x2584('0x25')]();};}function saveUpdates(_0x1f265e,_0x44564a){return function(_0x554ba8){if(_0x554ba8){return _0x554ba8['update'](_0x1f265e)[_0x2584('0x26')](function(_0x40fa05){return _0x40fa05;});}return null;};}function removeEntity(_0x375336,_0x436150){return function(_0x5cde59){if(_0x5cde59){return _0x5cde59[_0x2584('0x27')]()['then'](function(){var _0xde6fd3=_0x5cde59[_0x2584('0x28')]({'plain':!![]});var _0x2476cd=_0x2584('0x29');return db[_0x2584('0x2a')][_0x2584('0x27')]({'where':{'type':_0x2476cd,'resourceId':_0xde6fd3['id']}})[_0x2584('0x26')](function(){return _0x5cde59;});})[_0x2584('0x26')](function(){_0x375336[_0x2584('0x1d')](0xcc)[_0x2584('0x1c')]();});}};}function handleEntityNotFound(_0x1048ce,_0x701b29){return function(_0x182b32){if(!_0x182b32){_0x1048ce[_0x2584('0x1b')](0x194);}return _0x182b32;};}function handleError(_0x4dbd2c,_0x4e8c60){_0x4e8c60=_0x4e8c60||0x1f4;return function(_0x4e23b6){logger[_0x2584('0x2b')](_0x4e23b6[_0x2584('0x2c')]);if(_0x4e23b6[_0x2584('0x2d')]){delete _0x4e23b6[_0x2584('0x2d')];}_0x4dbd2c[_0x2584('0x1d')](_0x4e8c60)[_0x2584('0x2e')](_0x4e23b6);};}exports[_0x2584('0x2f')]=function(_0x1d56fc,_0x4795c6){var _0x12f518={},_0x4f8ac8={},_0x178024={'count':0x0,'rows':[]};var _0x2ae8b2=_['map'](db[_0x2584('0x30')][_0x2584('0x31')],function(_0x2fb9ff){return{'name':_0x2fb9ff['fieldName'],'type':_0x2fb9ff['type'][_0x2584('0x32')]};});_0x4f8ac8[_0x2584('0x33')]=_[_0x2584('0x34')](_0x2ae8b2,_0x2584('0x2d'));_0x4f8ac8['query']=_[_0x2584('0x35')](_0x1d56fc[_0x2584('0x36')]);_0x4f8ac8[_0x2584('0x37')]=_['intersection'](_0x4f8ac8[_0x2584('0x33')],_0x4f8ac8[_0x2584('0x36')]);_0x12f518[_0x2584('0x38')]=_[_0x2584('0x39')](_0x4f8ac8[_0x2584('0x33')],qs[_0x2584('0x3a')](_0x1d56fc[_0x2584('0x36')][_0x2584('0x3a')]));_0x12f518[_0x2584('0x38')]=_0x12f518['attributes']['length']?_0x12f518[_0x2584('0x38')]:_0x4f8ac8[_0x2584('0x33')];if(!_0x1d56fc['query'][_0x2584('0x3b')](_0x2584('0x3c'))){_0x12f518['limit']=qs['limit'](_0x1d56fc[_0x2584('0x36')][_0x2584('0x1f')]);_0x12f518[_0x2584('0x20')]=qs[_0x2584('0x20')](_0x1d56fc[_0x2584('0x36')][_0x2584('0x20')]);}_0x12f518[_0x2584('0x3d')]=qs[_0x2584('0x3e')](_0x1d56fc[_0x2584('0x36')][_0x2584('0x3e')]);_0x12f518[_0x2584('0x3f')]=qs[_0x2584('0x37')](_[_0x2584('0x40')](_0x1d56fc['query'],_0x4f8ac8['filters']),_0x2ae8b2);if(_0x1d56fc['query'][_0x2584('0x41')]){_0x12f518[_0x2584('0x3f')]=_['merge'](_0x12f518['where'],{'$or':_['map'](_0x2ae8b2,function(_0x5c7414){if(_0x5c7414['type']!==_0x2584('0x42')){var _0x5c2c48={};_0x5c2c48[_0x5c7414[_0x2584('0x2d')]]={'$like':'%'+_0x1d56fc[_0x2584('0x36')]['filter']+'%'};return _0x5c2c48;}})});}_0x12f518=_[_0x2584('0x43')]({},_0x12f518,_0x1d56fc[_0x2584('0x44')]);var _0x2a0b95={'where':_0x12f518['where']};return db[_0x2584('0x30')][_0x2584('0x21')](_0x2a0b95)[_0x2584('0x26')](function(_0x21687c){_0x178024[_0x2584('0x21')]=_0x21687c;if(_0x1d56fc[_0x2584('0x36')][_0x2584('0x45')]){_0x12f518[_0x2584('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x2584('0x47')](_0x12f518);})['then'](function(_0x1b3a89){_0x178024[_0x2584('0x48')]=_0x1b3a89;return _0x178024;})[_0x2584('0x26')](respondWithFilteredResult(_0x4795c6,_0x12f518))[_0x2584('0x49')](handleError(_0x4795c6,null));};exports[_0x2584('0x4a')]=function(_0x537f85,_0x3436b4){var _0x192672={'raw':![],'where':{'id':_0x537f85[_0x2584('0x4b')]['id']}},_0xe5238d={};_0xe5238d[_0x2584('0x33')]=_['keys'](db[_0x2584('0x30')]['rawAttributes']);_0xe5238d[_0x2584('0x36')]=_[_0x2584('0x35')](_0x537f85[_0x2584('0x36')]);_0xe5238d[_0x2584('0x37')]=_[_0x2584('0x39')](_0xe5238d[_0x2584('0x33')],_0xe5238d[_0x2584('0x36')]);_0x192672[_0x2584('0x38')]=_[_0x2584('0x39')](_0xe5238d['model'],qs[_0x2584('0x3a')](_0x537f85[_0x2584('0x36')]['fields']));_0x192672[_0x2584('0x38')]=_0x192672['attributes'][_0x2584('0x4c')]?_0x192672[_0x2584('0x38')]:_0xe5238d[_0x2584('0x33')];if(_0x537f85[_0x2584('0x36')]['includeAll']){_0x192672[_0x2584('0x46')]=[{'all':!![]}];}_0x192672=_[_0x2584('0x43')]({},_0x192672,_0x537f85[_0x2584('0x44')]);return db['Dashboard']['find'](_0x192672)[_0x2584('0x26')](handleEntityNotFound(_0x3436b4,null))[_0x2584('0x26')](respondWithResult(_0x3436b4,null))['catch'](handleError(_0x3436b4,null));};exports['create']=function(_0x5abb77,_0x116e48){return db[_0x2584('0x30')][_0x2584('0x4d')](_0x5abb77[_0x2584('0x4e')],{})[_0x2584('0x26')](function(_0x451bb2){var _0x4e8ab5=_0x5abb77[_0x2584('0x4f')][_0x2584('0x28')]({'plain':!![]});if(!_0x4e8ab5)throw new Error(_0x2584('0x50'));if(_0x4e8ab5[_0x2584('0x51')]===_0x2584('0x4f')){var _0x4ce3bf=_0x451bb2[_0x2584('0x28')]({'plain':!![]});var _0x22866c=_0x2584('0x29');return db['UserProfileSection'][_0x2584('0x52')]({'where':{'name':_0x22866c,'userProfileId':_0x4e8ab5[_0x2584('0x53')]},'raw':!![]})[_0x2584('0x26')](function(_0x237cf2){if(_0x237cf2&&_0x237cf2[_0x2584('0x54')]===0x0){return db[_0x2584('0x2a')][_0x2584('0x4d')]({'name':_0x4ce3bf['name'],'resourceId':_0x4ce3bf['id'],'type':_0x237cf2['name'],'sectionId':_0x237cf2['id']},{})[_0x2584('0x26')](function(){return _0x451bb2;});}else{return _0x451bb2;}})[_0x2584('0x49')](function(_0x350dba){logger[_0x2584('0x2b')](_0x2584('0x55'),_0x350dba);throw _0x350dba;});}return _0x451bb2;})[_0x2584('0x26')](respondWithResult(_0x116e48,0xc9))['catch'](handleError(_0x116e48,null));};exports[_0x2584('0x56')]=function(_0x307d25,_0x89d3b9){var _0x2332da={'where':{'id':_0x307d25[_0x2584('0x4b')]['id']}},_0x5ce174={};_0x5ce174[_0x2584('0x33')]=_['keys'](db[_0x2584('0x30')][_0x2584('0x31')]);_0x2332da[_0x2584('0x38')]=_[_0x2584('0x39')](_0x5ce174[_0x2584('0x33')],qs[_0x2584('0x3a')](_0x307d25[_0x2584('0x36')][_0x2584('0x3a')]));_0x2332da[_0x2584('0x38')]=_0x2332da[_0x2584('0x38')][_0x2584('0x4c')]?_0x2332da[_0x2584('0x38')]:_0x5ce174[_0x2584('0x33')];if(_0x307d25[_0x2584('0x36')][_0x2584('0x45')]){_0x2332da[_0x2584('0x46')]=[{'all':!![]}];}_0x2332da=_['merge']({},_0x2332da,_0x307d25[_0x2584('0x44')]);return db[_0x2584('0x30')]['find'](_0x2332da)[_0x2584('0x26')](handleEntityNotFound(_0x89d3b9,null))[_0x2584('0x26')](function(_0x2a19a6){if(_0x2a19a6){var _0x67c30b=_0x2a19a6[_0x2584('0x28')]({'plain':!![]});_0x67c30b=qs[_0x2584('0x57')](_0x67c30b,['id',_0x2584('0x58'),_0x2584('0x59')]);_0x307d25[_0x2584('0x4e')]=_[_0x2584('0x57')](_0x307d25[_0x2584('0x4e')],['id',_0x2584('0x58'),_0x2584('0x59')]);return db[_0x2584('0x30')]['create'](_[_0x2584('0x43')](_0x67c30b,_0x307d25[_0x2584('0x4e')]),{'include':_0x307d25[_0x2584('0x36')][_0x2584('0x45')]?[{'all':!![]}]:undefined})[_0x2584('0x26')](function(_0xdf6583){var _0x3090ea=_0x307d25['user'][_0x2584('0x28')]({'plain':!![]});if(!_0x3090ea)throw new Error(_0x2584('0x50'));if(_0x3090ea['role']===_0x2584('0x4f')){var _0x5748ec=_0xdf6583[_0x2584('0x28')]({'plain':!![]});var _0x56e767=_0x2584('0x29');return db[_0x2584('0x5a')][_0x2584('0x52')]({'where':{'name':_0x56e767,'userProfileId':_0x3090ea[_0x2584('0x53')]},'raw':!![]})['then'](function(_0x280e3d){if(_0x280e3d&&_0x280e3d['autoAssociation']===0x0){return db[_0x2584('0x2a')][_0x2584('0x4d')]({'name':_0x5748ec[_0x2584('0x2d')],'resourceId':_0x5748ec['id'],'type':_0x280e3d['name'],'sectionId':_0x280e3d['id']},{})[_0x2584('0x26')](function(){return _0xdf6583;});}else{return _0xdf6583;}})['catch'](function(_0x493aa6){logger[_0x2584('0x2b')](_0x2584('0x55'),_0x493aa6);throw _0x493aa6;});}return _0xdf6583;});}})[_0x2584('0x26')](respondWithResult(_0x89d3b9,0xc9))[_0x2584('0x49')](handleError(_0x89d3b9,null));};exports[_0x2584('0x5b')]=function(_0x3ba20a,_0x25ad54){if(_0x3ba20a[_0x2584('0x4e')]['id']){delete _0x3ba20a[_0x2584('0x4e')]['id'];}return db['Dashboard'][_0x2584('0x52')]({'where':{'id':_0x3ba20a['params']['id']}})[_0x2584('0x26')](handleEntityNotFound(_0x25ad54,null))[_0x2584('0x26')](saveUpdates(_0x3ba20a[_0x2584('0x4e')],null))['then'](respondWithResult(_0x25ad54,null))[_0x2584('0x49')](handleError(_0x25ad54,null));};exports['destroy']=function(_0x1f4798,_0x1d61a4){return db[_0x2584('0x30')]['find']({'where':{'id':_0x1f4798[_0x2584('0x4b')]['id']}})[_0x2584('0x26')](handleEntityNotFound(_0x1d61a4,null))['then'](removeEntity(_0x1d61a4,null))[_0x2584('0x49')](handleError(_0x1d61a4,null));};function widgetAttributes(_0xab3a09){try{switch(_0xab3a09[_0x2584('0x5c')]){case'iframe':return[{'name':_0x2584('0x5d'),'value':_0xab3a09[_0x2584('0x5d')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0x0]?_0xab3a09['attrs'][0x0][_0x2584('0x5f')]:undefined)||_0x2584('0x60')}];case _0x2584('0x61'):return[{'name':_0x2584('0x62'),'value':_0xab3a09[_0x2584('0x62')]||(_0xab3a09['attrs']&&_0xab3a09[_0x2584('0x5e')][0x0]?_0xab3a09[_0x2584('0x5e')][0x0][_0x2584('0x5f')]:undefined)||''}];case _0x2584('0x63'):return[{'name':_0x2584('0x64'),'value':_0xab3a09[_0x2584('0x64')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x0]?_0xab3a09[_0x2584('0x5e')][0x0][_0x2584('0x5f')]:undefined)||_0x2584('0x65')},{'name':_0x2584('0x66'),'value':_0xab3a09['attrTimezone']||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x1]?_0xab3a09[_0x2584('0x5e')][0x1]['value']:undefined)||_0x2584('0x67')},{'name':_0x2584('0x68'),'value':_0xab3a09[_0x2584('0x68')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0x2]?_0xab3a09['attrs'][0x2][_0x2584('0x5f')]:undefined)||0xc}];case _0x2584('0x69'):return[{'name':_0x2584('0x6a'),'value':_0xab3a09['attrMetric']||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x0]?_0xab3a09[_0x2584('0x5e')][0x0][_0x2584('0x5f')]:undefined)||_0x2584('0x6b')},{'name':_0x2584('0x6c'),'value':_0xab3a09[_0x2584('0x6c')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x1]?_0xab3a09[_0x2584('0x5e')][0x1][_0x2584('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0xab3a09[_0x2584('0x68')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x2]?_0xab3a09[_0x2584('0x5e')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0xab3a09[_0x2584('0x6d')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x3]?_0xab3a09[_0x2584('0x5e')][0x3][_0x2584('0x5f')]:undefined)||_0x2584('0x6e')},{'name':_0x2584('0x6f'),'value':_0xab3a09[_0x2584('0x6f')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x4]?_0xab3a09[_0x2584('0x5e')][0x4]['value']:undefined)||''},{'name':_0x2584('0x70'),'value':_0xab3a09[_0x2584('0x70')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x5]?_0xab3a09[_0x2584('0x5e')][0x5][_0x2584('0x5f')]:undefined)||''},{'name':_0x2584('0x71'),'value':_0xab3a09[_0x2584('0x71')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x6]?_0xab3a09['attrs'][0x6][_0x2584('0x5f')]:undefined)||''},{'name':_0x2584('0x72'),'value':_0xab3a09[_0x2584('0x72')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x7]?_0xab3a09[_0x2584('0x5e')][0x7]['value']:undefined)||''},{'name':_0x2584('0x73'),'value':_0xab3a09[_0x2584('0x73')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x8]?_0xab3a09[_0x2584('0x5e')][0x8][_0x2584('0x5f')]:undefined)||''},{'name':_0x2584('0x74'),'value':_0xab3a09[_0x2584('0x74')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0x9]?_0xab3a09[_0x2584('0x5e')][0x9][_0x2584('0x5f')]:undefined)||''}];case _0x2584('0x75'):case _0x2584('0x76'):return[{'name':_0x2584('0x77'),'value':_0xab3a09[_0x2584('0x77')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x0]?_0xab3a09['attrs'][0x0][_0x2584('0x5f')]:undefined)||_0x2584('0x6b')},{'name':'attrSerie2','value':_0xab3a09[_0x2584('0x78')]||(_0xab3a09['attrs']&&_0xab3a09['attrs'][0x1]?_0xab3a09['attrs'][0x1]['value']:undefined)||null},{'name':_0x2584('0x79'),'value':_0xab3a09['attrSerie3']||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x2]?_0xab3a09['attrs'][0x2]['value']:undefined)||null},{'name':_0x2584('0x6c'),'value':_0xab3a09[_0x2584('0x6c')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x3]?_0xab3a09[_0x2584('0x5e')][0x3][_0x2584('0x5f')]:undefined)||[]},{'name':_0x2584('0x6d'),'value':_0xab3a09[_0x2584('0x6d')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x4]?_0xab3a09[_0x2584('0x5e')][0x4][_0x2584('0x5f')]:undefined)||_0x2584('0x6e')},{'name':_0x2584('0x6f'),'value':_0xab3a09['attrEmailAccounts']||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x5]?_0xab3a09['attrs'][0x5][_0x2584('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xab3a09[_0x2584('0x70')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x6]?_0xab3a09[_0x2584('0x5e')][0x6][_0x2584('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xab3a09['attrSmsAccounts']||(_0xab3a09['attrs']&&_0xab3a09[_0x2584('0x5e')][0x7]?_0xab3a09[_0x2584('0x5e')][0x7]['value']:undefined)||''},{'name':_0x2584('0x72'),'value':_0xab3a09[_0x2584('0x72')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x8]?_0xab3a09[_0x2584('0x5e')][0x8][_0x2584('0x5f')]:undefined)||''},{'name':_0x2584('0x73'),'value':_0xab3a09[_0x2584('0x73')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x9]?_0xab3a09[_0x2584('0x5e')][0x9][_0x2584('0x5f')]:undefined)||''},{'name':_0x2584('0x74'),'value':_0xab3a09[_0x2584('0x74')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0xa]?_0xab3a09[_0x2584('0x5e')][0xa][_0x2584('0x5f')]:undefined)||''}];case _0x2584('0x7a'):return[{'name':_0x2584('0x7b'),'type':_0xab3a09[_0x2584('0x7c')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0x0]?_0xab3a09[_0x2584('0x5e')][0x0][_0x2584('0x5c')]:undefined)||null,'value':_0xab3a09['attrReport']||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09['attrs'][0x0]?_0xab3a09[_0x2584('0x5e')][0x0][_0x2584('0x5f')]:undefined)||null},{'name':_0x2584('0x7d'),'value':_0xab3a09[_0x2584('0x7d')]||(_0xab3a09[_0x2584('0x5e')]&&_0xab3a09[_0x2584('0x5e')][0x1]?_0xab3a09[_0x2584('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4be73e){logger[_0x2584('0x2b')](_0x2584('0x7e'),JSON['stringify'](_0x4be73e));return[];}}exports['addItem']=function(_0x406975,_0x5e2384,_0x2205bf){if(_0x406975[_0x2584('0x4e')]['id']){delete _0x406975[_0x2584('0x4e')]['id'];}return db['Dashboard'][_0x2584('0x52')]({'where':{'id':_0x406975[_0x2584('0x4b')]['id']}})[_0x2584('0x26')](handleEntityNotFound(_0x5e2384,null))[_0x2584('0x26')](function(_0x33e54b){if(_0x33e54b){_0x406975[_0x2584('0x4e')]['DashboardId']=_0x33e54b['id'];_0x406975[_0x2584('0x4e')][_0x2584('0x5e')]=widgetAttributes(_0x406975[_0x2584('0x4e')]);return db[_0x2584('0x7f')]['create'](_0x406975[_0x2584('0x4e')]);}})[_0x2584('0x26')](respondWithResult(_0x5e2384,null))['catch'](handleError(_0x5e2384,null));};exports[_0x2584('0x80')]=function(_0x157b4e,_0x2aba37,_0x1bbb23){var _0x160617={};var _0x59cd87={};var _0x157928;var _0x26cdc8;return db[_0x2584('0x30')]['findOne']({'where':{'id':_0x157b4e['params']['id']}})[_0x2584('0x26')](handleEntityNotFound(_0x2aba37,null))['then'](function(_0x37036e){if(_0x37036e){_0x157928=_0x37036e;_0x59cd87[_0x2584('0x33')]=_['keys'](db[_0x2584('0x7f')]['rawAttributes']);_0x59cd87['query']=_[_0x2584('0x35')](_0x157b4e[_0x2584('0x36')]);_0x59cd87[_0x2584('0x37')]=_[_0x2584('0x39')](_0x59cd87[_0x2584('0x33')],_0x59cd87[_0x2584('0x36')]);_0x160617[_0x2584('0x38')]=_[_0x2584('0x39')](_0x59cd87[_0x2584('0x33')],qs[_0x2584('0x3a')](_0x157b4e['query']['fields']));_0x160617[_0x2584('0x38')]=_0x160617[_0x2584('0x38')]['length']?_0x160617['attributes']:_0x59cd87[_0x2584('0x33')];_0x160617[_0x2584('0x3d')]=qs['sort'](_0x157b4e[_0x2584('0x36')]['sort']);_0x160617['where']=qs['filters'](_[_0x2584('0x40')](_0x157b4e['query'],_0x59cd87[_0x2584('0x37')]));if(_0x157b4e['query'][_0x2584('0x41')]){_0x160617['where']=_['merge'](_0x160617['where'],{'$or':_[_0x2584('0x34')](_0x160617[_0x2584('0x38')],function(_0x4c1388){var _0x256ba2={};_0x256ba2[_0x4c1388]={'$like':'%'+_0x157b4e['query'][_0x2584('0x41')]+'%'};return _0x256ba2;})});}_0x160617=_[_0x2584('0x43')]({},_0x160617,_0x157b4e[_0x2584('0x44')]);return _0x157928[_0x2584('0x80')](_0x160617);}})['then'](function(_0x59c7eb){if(_0x59c7eb){_0x26cdc8=_0x59c7eb['length'];if(!_0x157b4e['query']['hasOwnProperty']('nolimit')){_0x160617[_0x2584('0x1f')]=qs[_0x2584('0x1f')](_0x157b4e[_0x2584('0x36')][_0x2584('0x1f')]);_0x160617[_0x2584('0x20')]=qs[_0x2584('0x20')](_0x157b4e[_0x2584('0x36')][_0x2584('0x20')]);}return _0x157928[_0x2584('0x80')](_0x160617);}})['then'](function(_0x4f3351){if(_0x4f3351){return _0x4f3351?{'count':_0x26cdc8,'rows':_0x4f3351}:null;}})[_0x2584('0x26')](respondWithResult(_0x2aba37,null))['catch'](handleError(_0x2aba37,null));}; \ No newline at end of file +var _0xa3bc=['show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','Dashboard','rows','catch'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xa3bc,0xb8));var _0xca3b=function(_0x41bc1e,_0x5e9b8f){_0x41bc1e=_0x41bc1e-0x0;var _0xca6740=_0xa3bc[_0x41bc1e];return _0xca6740;};'use strict';var emlformat=require(_0xca3b('0x0'));var rimraf=require(_0xca3b('0x1'));var zipdir=require(_0xca3b('0x2'));var jsonpatch=require(_0xca3b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xca3b('0x4'));var Mustache=require(_0xca3b('0x5'));var util=require(_0xca3b('0x6'));var path=require('path');var sox=require(_0xca3b('0x7'));var csv=require(_0xca3b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca3b('0x9'));var _=require(_0xca3b('0xa'));var squel=require('squel');var crypto=require(_0xca3b('0xb'));var jsforce=require(_0xca3b('0xc'));var deskjs=require(_0xca3b('0xd'));var toCsv=require(_0xca3b('0x8'));var querystring=require(_0xca3b('0xe'));var Papa=require(_0xca3b('0xf'));var Redis=require(_0xca3b('0x10'));var authService=require(_0xca3b('0x11'));var qs=require(_0xca3b('0x12'));var as=require(_0xca3b('0x13'));var hardwareService=require(_0xca3b('0x14'));var logger=require(_0xca3b('0x15'))('api');var utils=require(_0xca3b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xca3b('0x17'));var db=require(_0xca3b('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xca3b('0x19'))(new Redis(config[_0xca3b('0x1a')]));require('./dashboard.socket')[_0xca3b('0x1b')](socket);function respondWithStatusCode(_0x539186,_0x4b1043){_0x4b1043=_0x4b1043||0xcc;return function(_0x496011){if(_0x496011){return _0x539186[_0xca3b('0x1c')](_0x4b1043);}return _0x539186[_0xca3b('0x1d')](_0x4b1043)[_0xca3b('0x1e')]();};}function respondWithResult(_0x26fa9b,_0x3aa5ad){_0x3aa5ad=_0x3aa5ad||0xc8;return function(_0x314971){if(_0x314971){return _0x26fa9b[_0xca3b('0x1d')](_0x3aa5ad)[_0xca3b('0x1f')](_0x314971);}};}function respondWithFilteredResult(_0x85f0e4,_0x57f75c){return function(_0x183fb1){if(_0x183fb1){var _0x58ed68=typeof _0x57f75c[_0xca3b('0x20')]===_0xca3b('0x21')&&typeof _0x57f75c[_0xca3b('0x22')]===_0xca3b('0x21');var _0x53ed0d=_0x183fb1[_0xca3b('0x23')];var _0x2545e3=_0x58ed68?0x0:_0x57f75c['offset'];var _0x6fe34b=_0x58ed68?_0x183fb1[_0xca3b('0x23')]:_0x57f75c[_0xca3b('0x20')]+_0x57f75c[_0xca3b('0x22')];var _0x461b5b;if(_0x6fe34b>=_0x53ed0d){_0x6fe34b=_0x53ed0d;_0x461b5b=0xc8;}else{_0x461b5b=0xce;}_0x85f0e4[_0xca3b('0x1d')](_0x461b5b);return _0x85f0e4['set'](_0xca3b('0x24'),_0x2545e3+'-'+_0x6fe34b+'/'+_0x53ed0d)['json'](_0x183fb1);}return null;};}function patchUpdates(_0x3c76d1){return function(_0x959ac4){try{jsonpatch[_0xca3b('0x25')](_0x959ac4,_0x3c76d1,!![]);}catch(_0x51a605){return BPromise[_0xca3b('0x26')](_0x51a605);}return _0x959ac4[_0xca3b('0x27')]();};}function saveUpdates(_0x4149ed,_0x1df02f){return function(_0x217bf1){if(_0x217bf1){return _0x217bf1['update'](_0x4149ed)[_0xca3b('0x28')](function(_0x4198e7){return _0x4198e7;});}return null;};}function removeEntity(_0x17e226,_0xe974ba){return function(_0xd43426){if(_0xd43426){return _0xd43426['destroy']()[_0xca3b('0x28')](function(){var _0xb6f83d=_0xd43426[_0xca3b('0x29')]({'plain':!![]});var _0x1768bd='CustomDashboards';return db[_0xca3b('0x2a')]['destroy']({'where':{'type':_0x1768bd,'resourceId':_0xb6f83d['id']}})[_0xca3b('0x28')](function(){return _0xd43426;});})['then'](function(){_0x17e226[_0xca3b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186ce5,_0x3da0fe){return function(_0x3f33b4){if(!_0x3f33b4){_0x186ce5[_0xca3b('0x1c')](0x194);}return _0x3f33b4;};}function handleError(_0x375acc,_0x3703bf){_0x3703bf=_0x3703bf||0x1f4;return function(_0x90dc57){logger[_0xca3b('0x2b')](_0x90dc57[_0xca3b('0x2c')]);if(_0x90dc57[_0xca3b('0x2d')]){delete _0x90dc57[_0xca3b('0x2d')];}_0x375acc['status'](_0x3703bf)[_0xca3b('0x2e')](_0x90dc57);};}exports[_0xca3b('0x2f')]=function(_0x48c92,_0x327dcf){var _0x21eaa8={},_0x4634b1={},_0x1121a9={'count':0x0,'rows':[]};var _0x3ede32=_[_0xca3b('0x30')](db['Dashboard'][_0xca3b('0x31')],function(_0x8dace0){return{'name':_0x8dace0[_0xca3b('0x32')],'type':_0x8dace0[_0xca3b('0x33')][_0xca3b('0x34')]};});_0x4634b1[_0xca3b('0x35')]=_[_0xca3b('0x30')](_0x3ede32,_0xca3b('0x2d'));_0x4634b1[_0xca3b('0x36')]=_[_0xca3b('0x37')](_0x48c92[_0xca3b('0x36')]);_0x4634b1[_0xca3b('0x38')]=_['intersection'](_0x4634b1[_0xca3b('0x35')],_0x4634b1[_0xca3b('0x36')]);_0x21eaa8['attributes']=_[_0xca3b('0x39')](_0x4634b1['model'],qs[_0xca3b('0x3a')](_0x48c92['query'][_0xca3b('0x3a')]));_0x21eaa8[_0xca3b('0x3b')]=_0x21eaa8['attributes'][_0xca3b('0x3c')]?_0x21eaa8['attributes']:_0x4634b1['model'];if(!_0x48c92[_0xca3b('0x36')][_0xca3b('0x3d')](_0xca3b('0x3e'))){_0x21eaa8[_0xca3b('0x22')]=qs[_0xca3b('0x22')](_0x48c92[_0xca3b('0x36')][_0xca3b('0x22')]);_0x21eaa8[_0xca3b('0x20')]=qs[_0xca3b('0x20')](_0x48c92[_0xca3b('0x36')][_0xca3b('0x20')]);}_0x21eaa8['order']=qs[_0xca3b('0x3f')](_0x48c92['query'][_0xca3b('0x3f')]);_0x21eaa8[_0xca3b('0x40')]=qs['filters'](_[_0xca3b('0x41')](_0x48c92[_0xca3b('0x36')],_0x4634b1[_0xca3b('0x38')]),_0x3ede32);if(_0x48c92[_0xca3b('0x36')][_0xca3b('0x42')]){_0x21eaa8[_0xca3b('0x40')]=_[_0xca3b('0x43')](_0x21eaa8[_0xca3b('0x40')],{'$or':_['map'](_0x3ede32,function(_0x18a65b){if(_0x18a65b[_0xca3b('0x33')]!==_0xca3b('0x44')){var _0x2f7492={};_0x2f7492[_0x18a65b[_0xca3b('0x2d')]]={'$like':'%'+_0x48c92['query']['filter']+'%'};return _0x2f7492;}})});}_0x21eaa8=_[_0xca3b('0x43')]({},_0x21eaa8,_0x48c92[_0xca3b('0x45')]);var _0x1a13d7={'where':_0x21eaa8[_0xca3b('0x40')]};return db['Dashboard'][_0xca3b('0x23')](_0x1a13d7)[_0xca3b('0x28')](function(_0x5240f9){_0x1121a9[_0xca3b('0x23')]=_0x5240f9;if(_0x48c92['query'][_0xca3b('0x46')]){_0x21eaa8['include']=[{'all':!![]}];}return db[_0xca3b('0x47')]['findAll'](_0x21eaa8);})[_0xca3b('0x28')](function(_0x3a42fa){_0x1121a9[_0xca3b('0x48')]=_0x3a42fa;return _0x1121a9;})['then'](respondWithFilteredResult(_0x327dcf,_0x21eaa8))[_0xca3b('0x49')](handleError(_0x327dcf,null));};exports[_0xca3b('0x4a')]=function(_0x1bd08d,_0x150c11){var _0x2b7d39={'raw':![],'where':{'id':_0x1bd08d[_0xca3b('0x4b')]['id']}},_0x10f320={};_0x10f320['model']=_['keys'](db[_0xca3b('0x47')]['rawAttributes']);_0x10f320[_0xca3b('0x36')]=_[_0xca3b('0x37')](_0x1bd08d[_0xca3b('0x36')]);_0x10f320['filters']=_['intersection'](_0x10f320[_0xca3b('0x35')],_0x10f320[_0xca3b('0x36')]);_0x2b7d39[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x10f320[_0xca3b('0x35')],qs['fields'](_0x1bd08d[_0xca3b('0x36')][_0xca3b('0x3a')]));_0x2b7d39[_0xca3b('0x3b')]=_0x2b7d39[_0xca3b('0x3b')]['length']?_0x2b7d39[_0xca3b('0x3b')]:_0x10f320[_0xca3b('0x35')];if(_0x1bd08d[_0xca3b('0x36')]['includeAll']){_0x2b7d39[_0xca3b('0x4c')]=[{'all':!![]}];}_0x2b7d39=_[_0xca3b('0x43')]({},_0x2b7d39,_0x1bd08d[_0xca3b('0x45')]);return db[_0xca3b('0x47')][_0xca3b('0x4d')](_0x2b7d39)['then'](handleEntityNotFound(_0x150c11,null))[_0xca3b('0x28')](respondWithResult(_0x150c11,null))[_0xca3b('0x49')](handleError(_0x150c11,null));};exports['create']=function(_0x196a53,_0x1e6cd3){return db[_0xca3b('0x47')]['create'](_0x196a53[_0xca3b('0x4e')],{})[_0xca3b('0x28')](function(_0xb6c7c){var _0x257e48=_0x196a53[_0xca3b('0x4f')][_0xca3b('0x29')]({'plain':!![]});if(!_0x257e48)throw new Error(_0xca3b('0x50'));if(_0x257e48[_0xca3b('0x51')]===_0xca3b('0x4f')){var _0x4c262f=_0xb6c7c[_0xca3b('0x29')]({'plain':!![]});var _0x118b22=_0xca3b('0x52');return db[_0xca3b('0x53')][_0xca3b('0x4d')]({'where':{'name':_0x118b22,'userProfileId':_0x257e48[_0xca3b('0x54')]},'raw':!![]})[_0xca3b('0x28')](function(_0x4101b9){if(_0x4101b9&&_0x4101b9[_0xca3b('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c262f[_0xca3b('0x2d')],'resourceId':_0x4c262f['id'],'type':_0x4101b9['name'],'sectionId':_0x4101b9['id']},{})[_0xca3b('0x28')](function(){return _0xb6c7c;});}else{return _0xb6c7c;}})[_0xca3b('0x49')](function(_0x320c86){logger[_0xca3b('0x2b')](_0xca3b('0x56'),_0x320c86);throw _0x320c86;});}return _0xb6c7c;})[_0xca3b('0x28')](respondWithResult(_0x1e6cd3,0xc9))[_0xca3b('0x49')](handleError(_0x1e6cd3,null));};exports[_0xca3b('0x57')]=function(_0x5aab0e,_0x223492){var _0x46676b={'where':{'id':_0x5aab0e[_0xca3b('0x4b')]['id']}},_0x92a660={};_0x92a660[_0xca3b('0x35')]=_[_0xca3b('0x37')](db['Dashboard']['rawAttributes']);_0x46676b[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x92a660[_0xca3b('0x35')],qs[_0xca3b('0x3a')](_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x3a')]));_0x46676b['attributes']=_0x46676b[_0xca3b('0x3b')][_0xca3b('0x3c')]?_0x46676b[_0xca3b('0x3b')]:_0x92a660[_0xca3b('0x35')];if(_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x46')]){_0x46676b[_0xca3b('0x4c')]=[{'all':!![]}];}_0x46676b=_[_0xca3b('0x43')]({},_0x46676b,_0x5aab0e[_0xca3b('0x45')]);return db[_0xca3b('0x47')][_0xca3b('0x4d')](_0x46676b)[_0xca3b('0x28')](handleEntityNotFound(_0x223492,null))[_0xca3b('0x28')](function(_0x890d14){if(_0x890d14){var _0x1ef3cd=_0x890d14[_0xca3b('0x29')]({'plain':!![]});_0x1ef3cd=qs['omit'](_0x1ef3cd,['id',_0xca3b('0x58'),_0xca3b('0x59')]);_0x5aab0e[_0xca3b('0x4e')]=_[_0xca3b('0x5a')](_0x5aab0e[_0xca3b('0x4e')],['id',_0xca3b('0x58'),'updatedAt']);return db[_0xca3b('0x47')]['create'](_['merge'](_0x1ef3cd,_0x5aab0e[_0xca3b('0x4e')]),{'include':_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x365967){var _0x4336bc=_0x5aab0e[_0xca3b('0x4f')][_0xca3b('0x29')]({'plain':!![]});if(!_0x4336bc)throw new Error(_0xca3b('0x50'));if(_0x4336bc[_0xca3b('0x51')]===_0xca3b('0x4f')){var _0x58fd7c=_0x365967[_0xca3b('0x29')]({'plain':!![]});var _0x1e32e4=_0xca3b('0x52');return db[_0xca3b('0x53')]['find']({'where':{'name':_0x1e32e4,'userProfileId':_0x4336bc[_0xca3b('0x54')]},'raw':!![]})[_0xca3b('0x28')](function(_0x5e1c75){if(_0x5e1c75&&_0x5e1c75['autoAssociation']===0x0){return db[_0xca3b('0x2a')][_0xca3b('0x5b')]({'name':_0x58fd7c[_0xca3b('0x2d')],'resourceId':_0x58fd7c['id'],'type':_0x5e1c75[_0xca3b('0x2d')],'sectionId':_0x5e1c75['id']},{})[_0xca3b('0x28')](function(){return _0x365967;});}else{return _0x365967;}})[_0xca3b('0x49')](function(_0x21828a){logger[_0xca3b('0x2b')](_0xca3b('0x56'),_0x21828a);throw _0x21828a;});}return _0x365967;});}})['then'](respondWithResult(_0x223492,0xc9))[_0xca3b('0x49')](handleError(_0x223492,null));};exports['update']=function(_0x23c34f,_0x4ed5c6){if(_0x23c34f[_0xca3b('0x4e')]['id']){delete _0x23c34f[_0xca3b('0x4e')]['id'];}return db['Dashboard'][_0xca3b('0x4d')]({'where':{'id':_0x23c34f['params']['id']}})['then'](handleEntityNotFound(_0x4ed5c6,null))['then'](saveUpdates(_0x23c34f[_0xca3b('0x4e')],null))[_0xca3b('0x28')](respondWithResult(_0x4ed5c6,null))['catch'](handleError(_0x4ed5c6,null));};exports[_0xca3b('0x5c')]=function(_0x408f56,_0x118238){return db[_0xca3b('0x47')][_0xca3b('0x4d')]({'where':{'id':_0x408f56[_0xca3b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x118238,null))['then'](removeEntity(_0x118238,null))['catch'](handleError(_0x118238,null));};function widgetAttributes(_0x3ad081){try{switch(_0x3ad081[_0xca3b('0x33')]){case _0xca3b('0x5d'):return[{'name':_0xca3b('0x5e'),'value':_0x3ad081[_0xca3b('0x5e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x61')}];case _0xca3b('0x62'):return[{'name':'attrPath','value':_0x3ad081[_0xca3b('0x63')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081['attrs'][0x0]['value']:undefined)||''}];case _0xca3b('0x64'):return[{'name':_0xca3b('0x65'),'value':_0x3ad081['attrHourFormat']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0]['value']:undefined)||_0xca3b('0x66')},{'name':_0xca3b('0x67'),'value':_0x3ad081[_0xca3b('0x67')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x1]?_0x3ad081['attrs'][0x1][_0xca3b('0x60')]:undefined)||_0xca3b('0x68')},{'name':_0xca3b('0x69'),'value':_0x3ad081[_0xca3b('0x69')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2][_0xca3b('0x60')]:undefined)||0xc}];case _0xca3b('0x6a'):return[{'name':_0xca3b('0x6b'),'value':_0x3ad081[_0xca3b('0x6b')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x6c')},{'name':'attrVoiceQueues','value':_0x3ad081[_0xca3b('0x6d')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1][_0xca3b('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x3ad081[_0xca3b('0x69')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0xca3b('0x6e'),'value':_0x3ad081[_0xca3b('0x6e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x3]?_0x3ad081[_0xca3b('0x5f')][0x3]['value']:undefined)||'voice'},{'name':_0xca3b('0x6f'),'value':_0x3ad081[_0xca3b('0x6f')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x4]?_0x3ad081[_0xca3b('0x5f')][0x4][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x70'),'value':_0x3ad081['attrFaxAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x5]?_0x3ad081[_0xca3b('0x5f')][0x5][_0xca3b('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3ad081[_0xca3b('0x71')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x6]?_0x3ad081[_0xca3b('0x5f')][0x6][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x72'),'value':_0x3ad081['attrOpenchannelAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x7]?_0x3ad081[_0xca3b('0x5f')][0x7][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x73'),'value':_0x3ad081[_0xca3b('0x73')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x8]?_0x3ad081[_0xca3b('0x5f')][0x8][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x74'),'value':_0x3ad081[_0xca3b('0x74')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x9]?_0x3ad081[_0xca3b('0x5f')][0x9][_0xca3b('0x60')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x3ad081['attrSerie1']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x0]?_0x3ad081['attrs'][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x6c')},{'name':'attrSerie2','value':_0x3ad081[_0xca3b('0x75')]||(_0x3ad081['attrs']&&_0x3ad081['attrs'][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1][_0xca3b('0x60')]:undefined)||null},{'name':_0xca3b('0x76'),'value':_0x3ad081['attrSerie3']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2][_0xca3b('0x60')]:undefined)||null},{'name':_0xca3b('0x6d'),'value':_0x3ad081[_0xca3b('0x6d')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x3]?_0x3ad081['attrs'][0x3][_0xca3b('0x60')]:undefined)||[]},{'name':'attrChannel','value':_0x3ad081[_0xca3b('0x6e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x4]?_0x3ad081['attrs'][0x4]['value']:undefined)||_0xca3b('0x77')},{'name':_0xca3b('0x6f'),'value':_0x3ad081[_0xca3b('0x6f')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x5]?_0x3ad081[_0xca3b('0x5f')][0x5][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x70'),'value':_0x3ad081[_0xca3b('0x70')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x6]?_0x3ad081[_0xca3b('0x5f')][0x6][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x71'),'value':_0x3ad081['attrSmsAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x7]?_0x3ad081[_0xca3b('0x5f')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3ad081[_0xca3b('0x72')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x8]?_0x3ad081['attrs'][0x8]['value']:undefined)||''},{'name':_0xca3b('0x73'),'value':_0x3ad081[_0xca3b('0x73')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x9]?_0x3ad081[_0xca3b('0x5f')][0x9][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x74'),'value':_0x3ad081['attrChatWebsites']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0xa]?_0x3ad081[_0xca3b('0x5f')][0xa]['value']:undefined)||''}];case _0xca3b('0x78'):return[{'name':_0xca3b('0x79'),'type':_0x3ad081[_0xca3b('0x7a')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081['attrs'][0x0][_0xca3b('0x33')]:undefined)||null,'value':_0x3ad081[_0xca3b('0x79')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x3ad081[_0xca3b('0x7b')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x175ddc){logger[_0xca3b('0x2b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x175ddc));return[];}}exports[_0xca3b('0x7c')]=function(_0x183c15,_0x1fd255,_0x14788a){if(_0x183c15[_0xca3b('0x4e')]['id']){delete _0x183c15['body']['id'];}return db['Dashboard'][_0xca3b('0x4d')]({'where':{'id':_0x183c15[_0xca3b('0x4b')]['id']}})[_0xca3b('0x28')](handleEntityNotFound(_0x1fd255,null))['then'](function(_0x576381){if(_0x576381){_0x183c15[_0xca3b('0x4e')][_0xca3b('0x7d')]=_0x576381['id'];_0x183c15['body'][_0xca3b('0x5f')]=widgetAttributes(_0x183c15[_0xca3b('0x4e')]);return db[_0xca3b('0x7e')]['create'](_0x183c15['body']);}})[_0xca3b('0x28')](respondWithResult(_0x1fd255,null))[_0xca3b('0x49')](handleError(_0x1fd255,null));};exports[_0xca3b('0x7f')]=function(_0x47cec8,_0x42f4e8,_0x18fcb7){var _0x100d24={};var _0x5e7dbd={};var _0x1e49cf;var _0x2667d4;return db['Dashboard'][_0xca3b('0x80')]({'where':{'id':_0x47cec8[_0xca3b('0x4b')]['id']}})[_0xca3b('0x28')](handleEntityNotFound(_0x42f4e8,null))['then'](function(_0x2c11b5){if(_0x2c11b5){_0x1e49cf=_0x2c11b5;_0x5e7dbd[_0xca3b('0x35')]=_[_0xca3b('0x37')](db[_0xca3b('0x7e')][_0xca3b('0x31')]);_0x5e7dbd['query']=_[_0xca3b('0x37')](_0x47cec8[_0xca3b('0x36')]);_0x5e7dbd[_0xca3b('0x38')]=_[_0xca3b('0x39')](_0x5e7dbd[_0xca3b('0x35')],_0x5e7dbd[_0xca3b('0x36')]);_0x100d24[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x5e7dbd[_0xca3b('0x35')],qs[_0xca3b('0x3a')](_0x47cec8[_0xca3b('0x36')]['fields']));_0x100d24[_0xca3b('0x3b')]=_0x100d24[_0xca3b('0x3b')][_0xca3b('0x3c')]?_0x100d24[_0xca3b('0x3b')]:_0x5e7dbd[_0xca3b('0x35')];_0x100d24['order']=qs[_0xca3b('0x3f')](_0x47cec8['query']['sort']);_0x100d24[_0xca3b('0x40')]=qs[_0xca3b('0x38')](_[_0xca3b('0x41')](_0x47cec8['query'],_0x5e7dbd[_0xca3b('0x38')]));if(_0x47cec8[_0xca3b('0x36')][_0xca3b('0x42')]){_0x100d24['where']=_[_0xca3b('0x43')](_0x100d24[_0xca3b('0x40')],{'$or':_[_0xca3b('0x30')](_0x100d24[_0xca3b('0x3b')],function(_0x35b717){var _0x4e9aba={};_0x4e9aba[_0x35b717]={'$like':'%'+_0x47cec8[_0xca3b('0x36')][_0xca3b('0x42')]+'%'};return _0x4e9aba;})});}_0x100d24=_[_0xca3b('0x43')]({},_0x100d24,_0x47cec8[_0xca3b('0x45')]);return _0x1e49cf[_0xca3b('0x7f')](_0x100d24);}})[_0xca3b('0x28')](function(_0x318ce9){if(_0x318ce9){_0x2667d4=_0x318ce9[_0xca3b('0x3c')];if(!_0x47cec8[_0xca3b('0x36')][_0xca3b('0x3d')]('nolimit')){_0x100d24[_0xca3b('0x22')]=qs[_0xca3b('0x22')](_0x47cec8['query']['limit']);_0x100d24[_0xca3b('0x20')]=qs[_0xca3b('0x20')](_0x47cec8[_0xca3b('0x36')][_0xca3b('0x20')]);}return _0x1e49cf[_0xca3b('0x7f')](_0x100d24);}})[_0xca3b('0x28')](function(_0x20e33c){if(_0x20e33c){return _0x20e33c?{'count':_0x2667d4,'rows':_0x20e33c}:null;}})['then'](respondWithResult(_0x42f4e8,null))[_0xca3b('0x49')](handleError(_0x42f4e8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 336a42d..f5a03f5 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 _0x638e=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3ae260,_0xb767ec){var _0x588590=function(_0x5c620d){while(--_0x5c620d){_0x3ae260['push'](_0x3ae260['shift']());}};_0x588590(++_0xb767ec);}(_0x638e,0x93));var _0xe638=function(_0x6a23aa,_0x3797ab){_0x6a23aa=_0x6a23aa-0x0;var _0x5ad153=_0x638e[_0x6a23aa];return _0x5ad153;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xe638('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe638('0x1')](0x0);var events={'afterCreate':_0xe638('0x2'),'afterUpdate':_0xe638('0x3'),'afterDestroy':_0xe638('0x4')};function emitEvent(_0x504047){return function(_0x3c373a,_0x17aad2,_0xcdfd26){DashboardEvents[_0xe638('0x5')](_0x504047+':'+_0x3c373a['id'],_0x3c373a);DashboardEvents[_0xe638('0x5')](_0x504047,_0x3c373a);_0xcdfd26(null);};}for(var e in events){if(events[_0xe638('0x6')](e)){var event=events[e];Dashboard[_0xe638('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x9ac9=['emit','hasOwnProperty','hook','exports','events','Dashboard','save','update','remove'];(function(_0x357a72,_0x5c32ff){var _0x3820b0=function(_0x2c9896){while(--_0x2c9896){_0x357a72['push'](_0x357a72['shift']());}};_0x3820b0(++_0x5c32ff);}(_0x9ac9,0x190));var _0x99ac=function(_0x1176d9,_0x2a1b64){_0x1176d9=_0x1176d9-0x0;var _0x3d1cb6=_0x9ac9[_0x1176d9];return _0x3d1cb6;};'use strict';var EventEmitter=require(_0x99ac('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x99ac('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x99ac('0x2'),'afterUpdate':_0x99ac('0x3'),'afterDestroy':_0x99ac('0x4')};function emitEvent(_0x2a2474){return function(_0x4f2015,_0x182dab,_0x262871){DashboardEvents['emit'](_0x2a2474+':'+_0x4f2015['id'],_0x4f2015);DashboardEvents[_0x99ac('0x5')](_0x2a2474,_0x4f2015);_0x262871(null);};}for(var e in events){if(events[_0x99ac('0x6')](e)){var event=events[e];Dashboard[_0x99ac('0x7')](e,emitEvent(event));}}module[_0x99ac('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 398274b..2bba9b5 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 _0x232a=['exports','define','Dashboard','lodash','bluebird','request-promise','rimraf','./dashboard.attributes'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x232a,0x1ab));var _0xa232=function(_0x3ed4d5,_0x501814){_0x3ed4d5=_0x3ed4d5-0x0;var _0x3dbb99=_0x232a[_0x3ed4d5];return _0x3dbb99;};'use strict';var _=require(_0xa232('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa232('0x1'));var rp=require(_0xa232('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa232('0x3'));var config=require('../../config/environment');var attributes=require(_0xa232('0x4'));module[_0xa232('0x5')]=function(_0x5e0f44,_0x3f36f5){return _0x5e0f44[_0xa232('0x6')](_0xa232('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be0=['moment','request-promise','path','rimraf','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x2be0,0x128));var _0x02be=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2be0[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x02be('0x0'));var util=require(_0x02be('0x1'));var logger=require(_0x02be('0x2'))(_0x02be('0x3'));var moment=require(_0x02be('0x4'));var BPromise=require('bluebird');var rp=require(_0x02be('0x5'));var fs=require('fs');var path=require(_0x02be('0x6'));var rimraf=require(_0x02be('0x7'));var config=require('../../config/environment');var attributes=require(_0x02be('0x8'));module[_0x02be('0x9')]=function(_0x46392d,_0x184bf6){return _0x46392d['define'](_0x02be('0xa'),attributes,{'tableName':_0x02be('0xb'),'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 562f023..d322396 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 _0x07a0=['stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0xe82142,_0x5adb3b){var _0x87d40f=function(_0x11b40d){while(--_0x11b40d){_0xe82142['push'](_0xe82142['shift']());}};_0x87d40f(++_0x5adb3b);}(_0x07a0,0x14f));var _0x007a=function(_0x3367b7,_0x1e0234){_0x3367b7=_0x3367b7-0x0;var _0x52bb97=_0x07a0[_0x3367b7];return _0x52bb97;};'use strict';var _=require(_0x007a('0x0'));var util=require(_0x007a('0x1'));var moment=require('moment');var BPromise=require(_0x007a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x007a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x007a('0x4'))(_0x007a('0x5'));var config=require('../../config/environment');var jayson=require(_0x007a('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x007a('0x7')]=_[_0x007a('0x8')](config[_0x007a('0x7')],{'host':_0x007a('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x007a('0xa')](socket);function respondWithRpcPromise(_0x1a5ea8,_0x349ce0,_0x1632df){return new BPromise(function(_0x493d2f,_0x15d778){return client[_0x007a('0xb')](_0x1a5ea8,_0x1632df)['then'](function(_0x1c2d7b){logger[_0x007a('0xc')](_0x007a('0xd'),_0x349ce0,_0x007a('0xe'));logger[_0x007a('0xf')](_0x007a('0x10'),_0x349ce0,'request\x20sent',JSON[_0x007a('0x11')](_0x1c2d7b));if(_0x1c2d7b['error']){if(_0x1c2d7b['error']['code']===0x1f4){logger[_0x007a('0x12')](_0x007a('0xd'),_0x349ce0,_0x1c2d7b[_0x007a('0x12')][_0x007a('0x13')]);return _0x15d778(_0x1c2d7b[_0x007a('0x12')][_0x007a('0x13')]);}logger[_0x007a('0x12')](_0x007a('0xd'),_0x349ce0,_0x1c2d7b[_0x007a('0x12')][_0x007a('0x13')]);return _0x493d2f(_0x1c2d7b['error'][_0x007a('0x13')]);}else{logger['info'](_0x007a('0xd'),_0x349ce0,'request\x20sent');_0x493d2f(_0x1c2d7b[_0x007a('0x14')][_0x007a('0x13')]);}})[_0x007a('0x15')](function(_0x21e897){logger[_0x007a('0x12')](_0x007a('0xd'),_0x349ce0,_0x21e897);_0x15d778(_0x21e897);});});} \ No newline at end of file +var _0x2698=['stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe094ab,_0x3aa511){var _0x3ad8ed=function(_0x231c63){while(--_0x231c63){_0xe094ab['push'](_0xe094ab['shift']());}};_0x3ad8ed(++_0x3aa511);}(_0x2698,0x124));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8269('0x0'));var util=require('util');var moment=require(_0x8269('0x1'));var BPromise=require(_0x8269('0x2'));var rs=require(_0x8269('0x3'));var fs=require('fs');var Redis=require(_0x8269('0x4'));var db=require(_0x8269('0x5'))['db'];var utils=require(_0x8269('0x6'));var logger=require(_0x8269('0x7'))(_0x8269('0x8'));var config=require(_0x8269('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8269('0xa')]({'port':0x232a});config[_0x8269('0xb')]=_['defaults'](config[_0x8269('0xb')],{'host':_0x8269('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8269('0xb')]));require(_0x8269('0xd'))[_0x8269('0xe')](socket);function respondWithRpcPromise(_0x59621c,_0x8747df,_0x3f9d63){return new BPromise(function(_0x5ea467,_0x2e70f4){return client['request'](_0x59621c,_0x3f9d63)[_0x8269('0xf')](function(_0x295c0f){logger[_0x8269('0x10')](_0x8269('0x11'),_0x8747df,_0x8269('0x12'));logger[_0x8269('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x8747df,_0x8269('0x12'),JSON[_0x8269('0x14')](_0x295c0f));if(_0x295c0f['error']){if(_0x295c0f['error'][_0x8269('0x15')]===0x1f4){logger[_0x8269('0x16')](_0x8269('0x11'),_0x8747df,_0x295c0f[_0x8269('0x16')][_0x8269('0x17')]);return _0x2e70f4(_0x295c0f[_0x8269('0x16')][_0x8269('0x17')]);}logger[_0x8269('0x16')](_0x8269('0x11'),_0x8747df,_0x295c0f['error'][_0x8269('0x17')]);return _0x5ea467(_0x295c0f[_0x8269('0x16')]['message']);}else{logger['info'](_0x8269('0x11'),_0x8747df,_0x8269('0x12'));_0x5ea467(_0x295c0f[_0x8269('0x18')][_0x8269('0x17')]);}})[_0x8269('0x19')](function(_0x437670){logger[_0x8269('0x16')]('Dashboard,\x20%s,\x20%s',_0x8747df,_0x437670);_0x2e70f4(_0x437670);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 39dea28..2d3641e 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 _0xa333=['length','dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0xbd85ff,_0x3aabdc){var _0x13fd89=function(_0x9b7c9e){while(--_0x9b7c9e){_0xbd85ff['push'](_0xbd85ff['shift']());}};_0x13fd89(++_0x3aabdc);}(_0xa333,0xc8));var _0x3a33=function(_0x1ed81e,_0x21590e){_0x1ed81e=_0x1ed81e-0x0;var _0x19fa31=_0xa333[_0x1ed81e];return _0x19fa31;};'use strict';var DashboardEvents=require(_0x3a33('0x0'));var events=[_0x3a33('0x1'),_0x3a33('0x2'),_0x3a33('0x3')];function createListener(_0x500744,_0x4e6488){return function(_0x5d0dce){_0x4e6488[_0x3a33('0x4')](_0x500744,_0x5d0dce);};}function removeListener(_0x31b4ee,_0x406523){return function(){DashboardEvents[_0x3a33('0x5')](_0x31b4ee,_0x406523);};}exports[_0x3a33('0x6')]=function(_0x1b3aad){for(var _0x1993ef=0x0,_0x309d5e=events[_0x3a33('0x7')];_0x1993ef<_0x309d5e;_0x1993ef++){var _0x4e3c56=events[_0x1993ef];var _0x504ab3=createListener(_0x3a33('0x8')+_0x4e3c56,_0x1b3aad);DashboardEvents['on'](_0x4e3c56,_0x504ab3);}}; \ No newline at end of file +var _0x5b0d=['dashboard:','save','remove','update','emit','removeListener','register','length'];(function(_0x496f9e,_0x48b53f){var _0x2ef07e=function(_0x32ec73){while(--_0x32ec73){_0x496f9e['push'](_0x496f9e['shift']());}};_0x2ef07e(++_0x48b53f);}(_0x5b0d,0x1b9));var _0xd5b0=function(_0x7b6b1,_0x2b9af7){_0x7b6b1=_0x7b6b1-0x0;var _0x4b57ee=_0x5b0d[_0x7b6b1];return _0x4b57ee;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xd5b0('0x0'),_0xd5b0('0x1'),_0xd5b0('0x2')];function createListener(_0x247350,_0x52e7c6){return function(_0x53f8f0){_0x52e7c6[_0xd5b0('0x3')](_0x247350,_0x53f8f0);};}function removeListener(_0x5c3d4a,_0x1512db){return function(){DashboardEvents[_0xd5b0('0x4')](_0x5c3d4a,_0x1512db);};}exports[_0xd5b0('0x5')]=function(_0x2b9c0b){for(var _0x113042=0x0,_0x53cf91=events[_0xd5b0('0x6')];_0x113042<_0x53cf91;_0x113042++){var _0x3760fe=events[_0x113042];var _0x3d649f=createListener(_0xd5b0('0x7')+_0x3760fe,_0x2b9c0b);DashboardEvents['on'](_0x3760fe,_0x3d649f);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index cba3d03..3ae3e1f 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 _0x0e30=['create','clone','addItem','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0e30,0xf7));var _0x00e3=function(_0xb301ce,_0x4bc865){_0xb301ce=_0xb301ce-0x0;var _0x2eaabb=_0x0e30[_0xb301ce];return _0x2eaabb;};'use strict';var multer=require('multer');var util=require(_0x00e3('0x0'));var path=require(_0x00e3('0x1'));var timeout=require(_0x00e3('0x2'));var express=require(_0x00e3('0x3'));var router=express[_0x00e3('0x4')]();var fs_extra=require(_0x00e3('0x5'));var auth=require(_0x00e3('0x6'));var interaction=require(_0x00e3('0x7'));var config=require(_0x00e3('0x8'));var controller=require(_0x00e3('0x9'));router[_0x00e3('0xa')]('/',auth[_0x00e3('0xb')](),controller[_0x00e3('0xc')]);router[_0x00e3('0xa')](_0x00e3('0xd'),auth['isAuthenticated'](),controller[_0x00e3('0xe')]);router[_0x00e3('0xa')](_0x00e3('0xf'),auth[_0x00e3('0xb')](),controller['getItems']);router[_0x00e3('0x10')]('/',auth[_0x00e3('0xb')](),controller[_0x00e3('0x11')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x00e3('0x12')]);router[_0x00e3('0x10')](_0x00e3('0xf'),auth[_0x00e3('0xb')](),controller[_0x00e3('0x13')]);router['put'](_0x00e3('0xd'),auth['isAuthenticated'](),controller[_0x00e3('0x14')]);router[_0x00e3('0x15')](_0x00e3('0xd'),auth[_0x00e3('0xb')](),controller[_0x00e3('0x16')]);module[_0x00e3('0x17')]=router; \ No newline at end of file +var _0x6a4c=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/items','getItems','post','create','clone','addItem','put','/:id','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x453323,_0x495f1d){var _0x108773=function(_0x1d9070){while(--_0x1d9070){_0x453323['push'](_0x453323['shift']());}};_0x108773(++_0x495f1d);}(_0x6a4c,0x68));var _0xc6a4=function(_0x4bb1ac,_0x4ba10d){_0x4bb1ac=_0x4bb1ac-0x0;var _0x289ced=_0x6a4c[_0x4bb1ac];return _0x289ced;};'use strict';var multer=require('multer');var util=require(_0xc6a4('0x0'));var path=require('path');var timeout=require(_0xc6a4('0x1'));var express=require(_0xc6a4('0x2'));var router=express[_0xc6a4('0x3')]();var fs_extra=require(_0xc6a4('0x4'));var auth=require(_0xc6a4('0x5'));var interaction=require(_0xc6a4('0x6'));var config=require(_0xc6a4('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x9')]);router[_0xc6a4('0xa')]('/:id',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xb')]);router['get'](_0xc6a4('0xc'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xd')]);router[_0xc6a4('0xe')]('/',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xf')]);router['post']('/:id/clone',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x10')]);router[_0xc6a4('0xe')](_0xc6a4('0xc'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x11')]);router[_0xc6a4('0x12')](_0xc6a4('0x13'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x14')]);router['delete'](_0xc6a4('0x13'),auth[_0xc6a4('0x8')](),controller['destroy']);module[_0xc6a4('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index c2e0f6f..f713ceb 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 _0x2a07=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x4b8968,_0x5c9b44){var _0x3a0ab7=function(_0x4dade2){while(--_0x4dade2){_0x4b8968['push'](_0x4b8968['shift']());}};_0x3a0ab7(++_0x5c9b44);}(_0x2a07,0x74));var _0x72a0=function(_0x282536,_0x3ba66a){_0x282536=_0x282536-0x0;var _0x76aa80=_0x2a07[_0x282536];return _0x76aa80;};'use strict';var Sequelize=require(_0x72a0('0x0'));var squel=require(_0x72a0('0x1'));var _=require(_0x72a0('0x2'));module[_0x72a0('0x3')]={'title':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x72a0('0x5')](_0x72a0('0x6')),'get':function(){try{return JSON[_0x72a0('0x7')](this[_0x72a0('0x8')](_0x72a0('0x9')));}catch(_0xce74c){return[];}},'set':function(_0x3ccf6d){try{this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')](_0x3ccf6d));}catch(_0x21c819){this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x72a0('0xc')]},'background':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':_0x72a0('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x72a0('0x4')]},'titleFontSize':{'type':Sequelize[_0x72a0('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5496,0x175));var _0x6549=function(_0x5772b1,_0x133969){_0x5772b1=_0x5772b1-0x0;var _0x4c01c5=_0x5496[_0x5772b1];return _0x4c01c5;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index e686ded..4bdee05 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 _0x251b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','then','end','sendStatus','error','name','show','params','model','DashboardItem','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','reportType','attrReport','attrRefresh','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x251b,0x185));var _0xb251=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x251b[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0xb251('0x0'));var rimraf=require(_0xb251('0x1'));var zipdir=require(_0xb251('0x2'));var jsonpatch=require(_0xb251('0x3'));var rp=require(_0xb251('0x4'));var moment=require(_0xb251('0x5'));var BPromise=require(_0xb251('0x6'));var Mustache=require(_0xb251('0x7'));var util=require(_0xb251('0x8'));var path=require(_0xb251('0x9'));var sox=require(_0xb251('0xa'));var csv=require(_0xb251('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb251('0xc'));var _=require('lodash');var squel=require(_0xb251('0xd'));var crypto=require(_0xb251('0xe'));var jsforce=require(_0xb251('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb251('0xb'));var querystring=require(_0xb251('0x10'));var Papa=require(_0xb251('0x11'));var Redis=require('ioredis');var authService=require(_0xb251('0x12'));var qs=require(_0xb251('0x13'));var as=require(_0xb251('0x14'));var hardwareService=require(_0xb251('0x15'));var logger=require('../../config/logger')(_0xb251('0x16'));var utils=require(_0xb251('0x17'));var config=require(_0xb251('0x18'));var licenseUtil=require(_0xb251('0x19'));var db=require(_0xb251('0x1a'))['db'];config[_0xb251('0x1b')]=_[_0xb251('0x1c')](config[_0xb251('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb251('0x1d'))(new Redis(config[_0xb251('0x1b')]));require(_0xb251('0x1e'))[_0xb251('0x1f')](socket);function respondWithStatusCode(_0x2c91e9,_0x5337d4){_0x5337d4=_0x5337d4||0xcc;return function(_0x2707c8){if(_0x2707c8){return _0x2c91e9['sendStatus'](_0x5337d4);}return _0x2c91e9[_0xb251('0x20')](_0x5337d4)['end']();};}function respondWithResult(_0x335295,_0x4314a1){_0x4314a1=_0x4314a1||0xc8;return function(_0x168e9e){if(_0x168e9e){return _0x335295[_0xb251('0x20')](_0x4314a1)[_0xb251('0x21')](_0x168e9e);}};}function respondWithFilteredResult(_0xb07d0,_0x45a43a){return function(_0x3130a4){if(_0x3130a4){var _0x4aa9f2=typeof _0x45a43a['offset']===_0xb251('0x22')&&typeof _0x45a43a[_0xb251('0x23')]===_0xb251('0x22');var _0x58d47c=_0x3130a4['count'];var _0x485b2f=_0x4aa9f2?0x0:_0x45a43a[_0xb251('0x24')];var _0xf462f2=_0x4aa9f2?_0x3130a4['count']:_0x45a43a[_0xb251('0x24')]+_0x45a43a['limit'];var _0xc6473f;if(_0xf462f2>=_0x58d47c){_0xf462f2=_0x58d47c;_0xc6473f=0xc8;}else{_0xc6473f=0xce;}_0xb07d0[_0xb251('0x20')](_0xc6473f);return _0xb07d0[_0xb251('0x25')](_0xb251('0x26'),_0x485b2f+'-'+_0xf462f2+'/'+_0x58d47c)[_0xb251('0x21')](_0x3130a4);}return null;};}function patchUpdates(_0x35db59){return function(_0x3fa826){try{jsonpatch[_0xb251('0x27')](_0x3fa826,_0x35db59,!![]);}catch(_0x2df1be){return BPromise[_0xb251('0x28')](_0x2df1be);}return _0x3fa826[_0xb251('0x29')]();};}function saveUpdates(_0x2bcb77,_0x4bf3c4){return function(_0x45448f){if(_0x45448f){return _0x45448f['update'](_0x2bcb77)[_0xb251('0x2a')](function(_0x436f3b){return _0x436f3b;});}return null;};}function removeEntity(_0x453f8e,_0x1e7785){return function(_0x41a6b9){if(_0x41a6b9){return _0x41a6b9['destroy']()['then'](function(){_0x453f8e[_0xb251('0x20')](0xcc)[_0xb251('0x2b')]();});}};}function handleEntityNotFound(_0x1712b4,_0x23910a){return function(_0x532ddd){if(!_0x532ddd){_0x1712b4[_0xb251('0x2c')](0x194);}return _0x532ddd;};}function handleError(_0x4f76c1,_0x522ea0){_0x522ea0=_0x522ea0||0x1f4;return function(_0x3a873d){logger[_0xb251('0x2d')](_0x3a873d['stack']);if(_0x3a873d[_0xb251('0x2e')]){delete _0x3a873d[_0xb251('0x2e')];}_0x4f76c1[_0xb251('0x20')](_0x522ea0)['send'](_0x3a873d);};}exports[_0xb251('0x2f')]=function(_0x578e1e,_0x1014ad){var _0x3cd902={'raw':![],'where':{'id':_0x578e1e[_0xb251('0x30')]['id']}},_0x77298d={};_0x77298d[_0xb251('0x31')]=_['keys'](db[_0xb251('0x32')]['rawAttributes']);_0x77298d[_0xb251('0x33')]=_['keys'](_0x578e1e[_0xb251('0x33')]);_0x77298d[_0xb251('0x34')]=_['intersection'](_0x77298d[_0xb251('0x31')],_0x77298d[_0xb251('0x33')]);_0x3cd902[_0xb251('0x35')]=_[_0xb251('0x36')](_0x77298d[_0xb251('0x31')],qs[_0xb251('0x37')](_0x578e1e['query'][_0xb251('0x37')]));_0x3cd902[_0xb251('0x35')]=_0x3cd902['attributes'][_0xb251('0x38')]?_0x3cd902['attributes']:_0x77298d['model'];if(_0x578e1e[_0xb251('0x33')][_0xb251('0x39')]){_0x3cd902[_0xb251('0x3a')]=[{'all':!![]}];}_0x3cd902=_[_0xb251('0x3b')]({},_0x3cd902,_0x578e1e[_0xb251('0x3c')]);return db[_0xb251('0x32')][_0xb251('0x3d')](_0x3cd902)[_0xb251('0x2a')](handleEntityNotFound(_0x1014ad,null))[_0xb251('0x2a')](respondWithResult(_0x1014ad,null))[_0xb251('0x3e')](handleError(_0x1014ad,null));};exports[_0xb251('0x3f')]=function(_0x13c5f4,_0x26e9a3){return db[_0xb251('0x32')][_0xb251('0x3d')]({'where':{'id':_0x13c5f4['params']['id']}})[_0xb251('0x2a')](handleEntityNotFound(_0x26e9a3,null))[_0xb251('0x2a')](removeEntity(_0x26e9a3,null))['catch'](handleError(_0x26e9a3,null));};function widgetAttributes(_0x47dd9d){try{switch(_0x47dd9d[_0xb251('0x40')]){case _0xb251('0x41'):return[{'name':_0xb251('0x42'),'value':_0x47dd9d[_0xb251('0x42')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x44')]:undefined)||_0xb251('0x45')}];case _0xb251('0x46'):return[{'name':_0xb251('0x47'),'value':_0x47dd9d[_0xb251('0x47')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x44')]:undefined)||''}];case _0xb251('0x48'):return[{'name':_0xb251('0x49'),'value':_0x47dd9d[_0xb251('0x49')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x44')]:undefined)||_0xb251('0x4a')},{'name':_0xb251('0x4b'),'value':_0x47dd9d[_0xb251('0x4b')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x1]?_0x47dd9d[_0xb251('0x43')][0x1]['value']:undefined)||'0.00'},{'name':_0xb251('0x4c'),'value':_0x47dd9d[_0xb251('0x4c')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x2]?_0x47dd9d[_0xb251('0x43')][0x2]['value']:undefined)||0xc}];case _0xb251('0x4d'):return[{'name':_0xb251('0x4e'),'value':_0x47dd9d[_0xb251('0x4e')]||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0]['value']:undefined)||_0xb251('0x4f')},{'name':'attrVoiceQueues','value':_0x47dd9d[_0xb251('0x50')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x1]?_0x47dd9d['attrs'][0x1]['value']:undefined)||[]},{'name':_0xb251('0x4c'),'value':_0x47dd9d['attrFontSize']||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x2]?_0x47dd9d[_0xb251('0x43')][0x2][_0xb251('0x44')]:undefined)||0x14},{'name':_0xb251('0x51'),'value':_0x47dd9d[_0xb251('0x51')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x3]?_0x47dd9d[_0xb251('0x43')][0x3][_0xb251('0x44')]:undefined)||_0xb251('0x52')},{'name':_0xb251('0x53'),'value':_0x47dd9d['attrEmailAccounts']||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x4]?_0x47dd9d['attrs'][0x4][_0xb251('0x44')]:undefined)||''},{'name':_0xb251('0x54'),'value':_0x47dd9d['attrFaxAccounts']||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x5]?_0x47dd9d[_0xb251('0x43')][0x5][_0xb251('0x44')]:undefined)||''},{'name':_0xb251('0x55'),'value':_0x47dd9d['attrSmsAccounts']||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x6]?_0x47dd9d['attrs'][0x6][_0xb251('0x44')]:undefined)||''},{'name':_0xb251('0x56'),'value':_0x47dd9d[_0xb251('0x56')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x7]?_0x47dd9d[_0xb251('0x43')][0x7][_0xb251('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x47dd9d[_0xb251('0x57')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d['attrs'][0x8]?_0x47dd9d[_0xb251('0x43')][0x8][_0xb251('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x47dd9d['attrChatWebsites']||(_0x47dd9d['attrs']&&_0x47dd9d['attrs'][0x9]?_0x47dd9d[_0xb251('0x43')][0x9]['value']:undefined)||''}];case _0xb251('0x58'):case _0xb251('0x59'):return[{'name':'attrSerie1','value':_0x47dd9d[_0xb251('0x5a')]||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x44')]:undefined)||_0xb251('0x4f')},{'name':_0xb251('0x5b'),'value':_0x47dd9d[_0xb251('0x5b')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d['attrs'][0x1]?_0x47dd9d[_0xb251('0x43')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x47dd9d[_0xb251('0x5c')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x2]?_0x47dd9d['attrs'][0x2][_0xb251('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x47dd9d[_0xb251('0x50')]||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x3]?_0x47dd9d[_0xb251('0x43')][0x3][_0xb251('0x44')]:undefined)||[]},{'name':_0xb251('0x51'),'value':_0x47dd9d['attrChannel']||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x4]?_0x47dd9d[_0xb251('0x43')][0x4]['value']:undefined)||'voice'},{'name':_0xb251('0x53'),'value':_0x47dd9d['attrEmailAccounts']||(_0x47dd9d['attrs']&&_0x47dd9d['attrs'][0x5]?_0x47dd9d[_0xb251('0x43')][0x5][_0xb251('0x44')]:undefined)||''},{'name':_0xb251('0x54'),'value':_0x47dd9d[_0xb251('0x54')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d['attrs'][0x6]?_0x47dd9d['attrs'][0x6][_0xb251('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x47dd9d[_0xb251('0x55')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x7]?_0x47dd9d[_0xb251('0x43')][0x7][_0xb251('0x44')]:undefined)||''},{'name':_0xb251('0x56'),'value':_0x47dd9d[_0xb251('0x56')]||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x8]?_0x47dd9d[_0xb251('0x43')][0x8]['value']:undefined)||''},{'name':_0xb251('0x57'),'value':_0x47dd9d[_0xb251('0x57')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x9]?_0x47dd9d[_0xb251('0x43')][0x9]['value']:undefined)||''},{'name':_0xb251('0x5d'),'value':_0x47dd9d['attrChatWebsites']||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0xa]?_0x47dd9d[_0xb251('0x43')][0xa][_0xb251('0x44')]:undefined)||''}];case _0xb251('0x5e'):return[{'name':'attrReport','type':_0x47dd9d[_0xb251('0x5f')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x40')]:undefined)||null,'value':_0x47dd9d[_0xb251('0x60')]||(_0x47dd9d['attrs']&&_0x47dd9d[_0xb251('0x43')][0x0]?_0x47dd9d[_0xb251('0x43')][0x0][_0xb251('0x44')]:undefined)||null},{'name':_0xb251('0x61'),'value':_0x47dd9d[_0xb251('0x61')]||(_0x47dd9d[_0xb251('0x43')]&&_0x47dd9d[_0xb251('0x43')][0x1]?_0x47dd9d[_0xb251('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x499a29){logger[_0xb251('0x2d')]('widgetAttributes:\x20%s',JSON[_0xb251('0x62')](_0x499a29));return[];}}exports[_0xb251('0x63')]=function(_0xbbe6a4,_0x4343fb){if(_0xbbe6a4['body']){_0xbbe6a4[_0xb251('0x64')][_0xb251('0x43')]=widgetAttributes(_0xbbe6a4[_0xb251('0x64')]);}return db['DashboardItem']['create'](_0xbbe6a4[_0xb251('0x64')],{})[_0xb251('0x2a')](respondWithResult(_0x4343fb,0xc9))[_0xb251('0x3e')](handleError(_0x4343fb,null));};exports[_0xb251('0x65')]=function(_0x18da90,_0x5afbb3){if(_0x18da90[_0xb251('0x64')]['id']){delete _0x18da90['body']['id'];}_0x18da90['body'][_0xb251('0x43')]=widgetAttributes(_0x18da90[_0xb251('0x64')]);return db[_0xb251('0x32')][_0xb251('0x3d')]({'where':{'id':_0x18da90['params']['id']}})['then'](handleEntityNotFound(_0x5afbb3,null))['then'](saveUpdates(_0x18da90[_0xb251('0x64')],null))[_0xb251('0x2a')](respondWithResult(_0x5afbb3,null))['catch'](handleError(_0x5afbb3,null));}; \ No newline at end of file +var _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','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','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x4da1ef,_0x203c6b){var _0x4c2e99=function(_0xeb4ecc){while(--_0xeb4ecc){_0x4da1ef['push'](_0x4da1ef['shift']());}};_0x4c2e99(++_0x203c6b);}(_0xf8af,0x8b));var _0xff8a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf8af[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7cf5812..7002126 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 _0x624d=['remove','emit','exports','DashboardItem','setMaxListeners'];(function(_0x3ea7ea,_0x4b578b){var _0xe18615=function(_0x2b793f){while(--_0x2b793f){_0x3ea7ea['push'](_0x3ea7ea['shift']());}};_0xe18615(++_0x4b578b);}(_0x624d,0xbc));var _0xd624=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0x624d[_0x481af3];return _0x3354ea;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xd624('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd624('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd624('0x2')};function emitEvent(_0x5b2cce){return function(_0x1be98e,_0x25e2a8,_0x5eba22){DashboardItemEvents[_0xd624('0x3')](_0x5b2cce+':'+_0x1be98e['id'],_0x1be98e);DashboardItemEvents[_0xd624('0x3')](_0x5b2cce,_0x1be98e);_0x5eba22(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xd624('0x4')]=DashboardItemEvents; \ No newline at end of file +var _0x568d=['../../mysqldb','DashboardItem','update','emit','hasOwnProperty','hook','exports'];(function(_0x19e023,_0x1ea14d){var _0xa87e83=function(_0x1a0ddb){while(--_0x1a0ddb){_0x19e023['push'](_0x19e023['shift']());}};_0xa87e83(++_0x1ea14d);}(_0x568d,0xaf));var _0xd568=function(_0x18d3d2,_0x48809e){_0x18d3d2=_0x18d3d2-0x0;var _0x582ee2=_0x568d[_0x18d3d2];return _0x582ee2;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xd568('0x0'))['db'][_0xd568('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd568('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5365b8){return function(_0x20051b,_0xe39fe,_0xd35d24){DashboardItemEvents[_0xd568('0x3')](_0x5365b8+':'+_0x20051b['id'],_0x20051b);DashboardItemEvents[_0xd568('0x3')](_0x5365b8,_0x20051b);_0xd35d24(null);};}for(var e in events){if(events[_0xd568('0x4')](e)){var event=events[e];DashboardItem[_0xd568('0x5')](e,emitEvent(event));}}module[_0xd568('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 38cd72e..50d5bb8 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 _0x8deb=['api','moment','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x8deb,0xf0));var _0xb8de=function(_0x1b8957,_0x36bbd8){_0x1b8957=_0x1b8957-0x0;var _0x42aed3=_0x8deb[_0x1b8957];return _0x42aed3;};'use strict';var _=require(_0xb8de('0x0'));var util=require(_0xb8de('0x1'));var logger=require('../../config/logger')(_0xb8de('0x2'));var moment=require(_0xb8de('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8de('0x5'));var config=require(_0xb8de('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xb8de('0x7')]=function(_0x17a743,_0x1cfcd4){return _0x17a743[_0xb8de('0x8')](_0xb8de('0x9'),attributes,{'tableName':_0xb8de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7707=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','path','exports'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x7707,0x158));var _0x7770=function(_0x488bc0,_0x21d46c){_0x488bc0=_0x488bc0-0x0;var _0x399194=_0x7707[_0x488bc0];return _0x399194;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var logger=require(_0x7770('0x2'))(_0x7770('0x3'));var moment=require(_0x7770('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7770('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x7770('0x6')]=function(_0x251dae,_0x115d50){return _0x251dae['define'](_0x7770('0x7'),attributes,{'tableName':_0x7770('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 72571b9..0a1b0a9 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 _0x5e4d=['defaults','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x455f3c,_0x3211b7){var _0x29ab1b=function(_0x16f591){while(--_0x16f591){_0x455f3c['push'](_0x455f3c['shift']());}};_0x29ab1b(++_0x3211b7);}(_0x5e4d,0x9b));var _0xd5e4=function(_0x1f3fe5,_0x5bd674){_0x1f3fe5=_0x1f3fe5-0x0;var _0x498635=_0x5e4d[_0x1f3fe5];return _0x498635;};'use strict';var _=require(_0xd5e4('0x0'));var util=require(_0xd5e4('0x1'));var moment=require(_0xd5e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5e4('0x3'));var fs=require('fs');var Redis=require(_0xd5e4('0x4'));var db=require(_0xd5e4('0x5'))['db'];var utils=require(_0xd5e4('0x6'));var logger=require('../../config/logger')(_0xd5e4('0x7'));var config=require(_0xd5e4('0x8'));var jayson=require(_0xd5e4('0x9'));var client=jayson[_0xd5e4('0xa')][_0xd5e4('0xb')]({'port':0x232a});config[_0xd5e4('0xc')]=_[_0xd5e4('0xd')](config[_0xd5e4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd5e4('0xe'))(new Redis(config[_0xd5e4('0xc')]));require(_0xd5e4('0xf'))[_0xd5e4('0x10')](socket);function respondWithRpcPromise(_0x3dfec1,_0x580e4e,_0x48f140){return new BPromise(function(_0x1e4de4,_0xbe36f6){return client['request'](_0x3dfec1,_0x48f140)[_0xd5e4('0x11')](function(_0x3923d2){logger[_0xd5e4('0x12')](_0xd5e4('0x13'),_0x580e4e,_0xd5e4('0x14'));logger[_0xd5e4('0x15')](_0xd5e4('0x16'),_0x580e4e,_0xd5e4('0x14'),JSON[_0xd5e4('0x17')](_0x3923d2));if(_0x3923d2[_0xd5e4('0x18')]){if(_0x3923d2[_0xd5e4('0x18')][_0xd5e4('0x19')]===0x1f4){logger[_0xd5e4('0x18')](_0xd5e4('0x13'),_0x580e4e,_0x3923d2[_0xd5e4('0x18')][_0xd5e4('0x1a')]);return _0xbe36f6(_0x3923d2[_0xd5e4('0x18')][_0xd5e4('0x1a')]);}logger[_0xd5e4('0x18')](_0xd5e4('0x13'),_0x580e4e,_0x3923d2['error'][_0xd5e4('0x1a')]);return _0x1e4de4(_0x3923d2[_0xd5e4('0x18')][_0xd5e4('0x1a')]);}else{logger[_0xd5e4('0x12')](_0xd5e4('0x13'),_0x580e4e,'request\x20sent');_0x1e4de4(_0x3923d2['result'][_0xd5e4('0x1a')]);}})[_0xd5e4('0x1b')](function(_0x494392){logger[_0xd5e4('0x18')](_0xd5e4('0x13'),_0x580e4e,_0x494392);_0xbe36f6(_0x494392);});});} \ No newline at end of file +var _0x1e44=['stringify','error','code','message','info','catch','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x10ac22,_0x1b8314){var _0x2452ee=function(_0x4d8260){while(--_0x4d8260){_0x10ac22['push'](_0x10ac22['shift']());}};_0x2452ee(++_0x1b8314);}(_0x1e44,0x96));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x41e4('0x2'));var logger=require(_0x41e4('0x3'))(_0x41e4('0x4'));var config=require(_0x41e4('0x5'));var jayson=require(_0x41e4('0x6'));var client=jayson['client'][_0x41e4('0x7')]({'port':0x232a});config[_0x41e4('0x8')]=_['defaults'](config[_0x41e4('0x8')],{'host':_0x41e4('0x9'),'port':0x18eb});var socket=require(_0x41e4('0xa'))(new Redis(config[_0x41e4('0x8')]));require(_0x41e4('0xb'))['register'](socket);function respondWithRpcPromise(_0x25f327,_0x2a0d79,_0x5aca33){return new BPromise(function(_0xce94a8,_0x26f1ff){return client[_0x41e4('0xc')](_0x25f327,_0x5aca33)[_0x41e4('0xd')](function(_0x51efe9){logger['info'](_0x41e4('0xe'),_0x2a0d79,_0x41e4('0xf'));logger[_0x41e4('0x10')](_0x41e4('0x11'),_0x2a0d79,_0x41e4('0xf'),JSON[_0x41e4('0x12')](_0x51efe9));if(_0x51efe9['error']){if(_0x51efe9[_0x41e4('0x13')][_0x41e4('0x14')]===0x1f4){logger['error'](_0x41e4('0xe'),_0x2a0d79,_0x51efe9['error']['message']);return _0x26f1ff(_0x51efe9['error'][_0x41e4('0x15')]);}logger[_0x41e4('0x13')]('DashboardItem,\x20%s,\x20%s',_0x2a0d79,_0x51efe9[_0x41e4('0x13')][_0x41e4('0x15')]);return _0xce94a8(_0x51efe9[_0x41e4('0x13')][_0x41e4('0x15')]);}else{logger[_0x41e4('0x16')](_0x41e4('0xe'),_0x2a0d79,_0x41e4('0xf'));_0xce94a8(_0x51efe9['result'][_0x41e4('0x15')]);}})[_0x41e4('0x17')](function(_0x389473){logger[_0x41e4('0x13')](_0x41e4('0xe'),_0x2a0d79,_0x389473);_0x26f1ff(_0x389473);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 3349587..52ee148 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 _0xeeb8=['emit','removeListener','register','length','dashboardItem:','save','remove','update'];(function(_0x15b2a1,_0x359184){var _0x392761=function(_0x2c17c9){while(--_0x2c17c9){_0x15b2a1['push'](_0x15b2a1['shift']());}};_0x392761(++_0x359184);}(_0xeeb8,0x7d));var _0x8eeb=function(_0x4d9c91,_0x4b3f46){_0x4d9c91=_0x4d9c91-0x0;var _0x44ec59=_0xeeb8[_0x4d9c91];return _0x44ec59;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x8eeb('0x0'),_0x8eeb('0x1'),_0x8eeb('0x2')];function createListener(_0x3b78d3,_0x3ed8d5){return function(_0x5c7ca9){_0x3ed8d5[_0x8eeb('0x3')](_0x3b78d3,_0x5c7ca9);};}function removeListener(_0x3dc8d2,_0x5727c4){return function(){DashboardItemEvents[_0x8eeb('0x4')](_0x3dc8d2,_0x5727c4);};}exports[_0x8eeb('0x5')]=function(_0x40074c){for(var _0x3de8d5=0x0,_0x56bd3b=events[_0x8eeb('0x6')];_0x3de8d5<_0x56bd3b;_0x3de8d5++){var _0x140f40=events[_0x3de8d5];var _0x52dac5=createListener(_0x8eeb('0x7')+_0x140f40,_0x40074c);DashboardItemEvents['on'](_0x140f40,_0x52dac5);}}; \ No newline at end of file +var _0xcbe3=['emit','register','./dashboardItem.events','save','update'];(function(_0x5af0fc,_0x1be68a){var _0x9cbafa=function(_0x2d52b1){while(--_0x2d52b1){_0x5af0fc['push'](_0x5af0fc['shift']());}};_0x9cbafa(++_0x1be68a);}(_0xcbe3,0x1dd));var _0x3cbe=function(_0x4b0156,_0x3d8d34){_0x4b0156=_0x4b0156-0x0;var _0x4705c0=_0xcbe3[_0x4b0156];return _0x4705c0;};'use strict';var DashboardItemEvents=require(_0x3cbe('0x0'));var events=[_0x3cbe('0x1'),'remove',_0x3cbe('0x2')];function createListener(_0x529ef4,_0xf7d185){return function(_0x22a687){_0xf7d185[_0x3cbe('0x3')](_0x529ef4,_0x22a687);};}function removeListener(_0x1287bf,_0x5aeeff){return function(){DashboardItemEvents['removeListener'](_0x1287bf,_0x5aeeff);};}exports[_0x3cbe('0x4')]=function(_0x25ebad){for(var _0x1ff706=0x0,_0x48375c=events['length'];_0x1ff706<_0x48375c;_0x1ff706++){var _0x143a82=events[_0x1ff706];var _0x49ed00=createListener('dashboardItem:'+_0x143a82,_0x25ebad);DashboardItemEvents['on'](_0x143a82,_0x49ed00);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 34b9106..24b700f 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 _0x6314=['../../config/environment','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c4f32,_0xe61558){var _0x53da62=function(_0x54a268){while(--_0x54a268){_0x4c4f32['push'](_0x4c4f32['shift']());}};_0x53da62(++_0xe61558);}(_0x6314,0x1de));var _0x4631=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6314[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x4631('0x0'));var util=require(_0x4631('0x1'));var path=require(_0x4631('0x2'));var timeout=require(_0x4631('0x3'));var express=require('express');var router=express[_0x4631('0x4')]();var fs_extra=require(_0x4631('0x5'));var auth=require(_0x4631('0x6'));var interaction=require(_0x4631('0x7'));var config=require(_0x4631('0x8'));var controller=require('./dashboardItem.controller');router[_0x4631('0x9')](_0x4631('0xa'),auth[_0x4631('0xb')](),controller[_0x4631('0xc')]);router[_0x4631('0xd')]('/',auth[_0x4631('0xb')](),controller[_0x4631('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4631('0xf')]);router[_0x4631('0x10')](_0x4631('0xa'),auth[_0x4631('0xb')](),controller[_0x4631('0x11')]);module['exports']=router; \ No newline at end of file +var _0x524c=['get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller'];(function(_0x53c238,_0x33da60){var _0x5a105d=function(_0x11934f){while(--_0x11934f){_0x53c238['push'](_0x53c238['shift']());}};_0x5a105d(++_0x33da60);}(_0x524c,0x117));var _0xc524=function(_0x204adb,_0x57ecfd){_0x204adb=_0x204adb-0x0;var _0x3ad9cc=_0x524c[_0x204adb];return _0x3ad9cc;};'use strict';var multer=require(_0xc524('0x0'));var util=require(_0xc524('0x1'));var path=require(_0xc524('0x2'));var timeout=require(_0xc524('0x3'));var express=require(_0xc524('0x4'));var router=express['Router']();var fs_extra=require(_0xc524('0x5'));var auth=require(_0xc524('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc524('0x7'));var controller=require(_0xc524('0x8'));router[_0xc524('0x9')](_0xc524('0xa'),auth[_0xc524('0xb')](),controller[_0xc524('0xc')]);router[_0xc524('0xd')]('/',auth['isAuthenticated'](),controller[_0xc524('0xe')]);router['put'](_0xc524('0xa'),auth['isAuthenticated'](),controller[_0xc524('0xf')]);router[_0xc524('0x10')](_0xc524('0xa'),auth[_0xc524('0xb')](),controller['destroy']);module[_0xc524('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8469021..1012d1e 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 _0xa595=['first','third','sequelize','exports','STRING','ENUM'];(function(_0x8da1a6,_0x4d007e){var _0x2ee464=function(_0x31f468){while(--_0x31f468){_0x8da1a6['push'](_0x8da1a6['shift']());}};_0x2ee464(++_0x4d007e);}(_0xa595,0x140));var _0x5a59=function(_0x337b9f,_0x35501d){_0x337b9f=_0x337b9f-0x0;var _0x57cecd=_0xa595[_0x337b9f];return _0x57cecd;};'use strict';var Sequelize=require(_0x5a59('0x0'));module[_0x5a59('0x1')]={'name':{'type':Sequelize[_0x5a59('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x5a59('0x3')](_0x5a59('0x4'),'second',_0x5a59('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x5a59('0x2')]}}; \ No newline at end of file +var _0xef9f=['second','sequelize','STRING','ENUM','first'];(function(_0x1d04c0,_0x404899){var _0x2fae2e=function(_0x15f2f3){while(--_0x15f2f3){_0x1d04c0['push'](_0x1d04c0['shift']());}};_0x2fae2e(++_0x404899);}(_0xef9f,0x7e));var _0xfef9=function(_0x5a6208,_0x12c7d9){_0x5a6208=_0x5a6208-0x0;var _0x4aa670=_0xef9f[_0x5a6208];return _0x4aa670;};'use strict';var Sequelize=require(_0xfef9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef9('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xfef9('0x2')](_0xfef9('0x3'),_0xfef9('0x4'),'third'),'allowNull':![],'defaultValue':_0xfef9('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e92ac94..18c0c5e 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 _0x53f8=['get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','filters','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','merge','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','destroy'];(function(_0x42f2cc,_0x17fbc9){var _0x2b8361=function(_0x4859d5){while(--_0x4859d5){_0x42f2cc['push'](_0x42f2cc['shift']());}};_0x2b8361(++_0x17fbc9);}(_0x53f8,0x7a));var _0x853f=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x53f8[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x853f('0x0'));var zipdir=require(_0x853f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x853f('0x2'));var moment=require(_0x853f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x853f('0x4'));var util=require(_0x853f('0x5'));var path=require(_0x853f('0x6'));var sox=require(_0x853f('0x7'));var csv=require('to-csv');var ejs=require(_0x853f('0x8'));var fs=require('fs');var fs_extra=require(_0x853f('0x9'));var _=require(_0x853f('0xa'));var squel=require(_0x853f('0xb'));var crypto=require('crypto');var jsforce=require(_0x853f('0xc'));var deskjs=require(_0x853f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x853f('0xe'));var Papa=require(_0x853f('0xf'));var Redis=require('ioredis');var authService=require(_0x853f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x853f('0x11'));var hardwareService=require(_0x853f('0x12'));var logger=require(_0x853f('0x13'))(_0x853f('0x14'));var utils=require(_0x853f('0x15'));var config=require(_0x853f('0x16'));var licenseUtil=require(_0x853f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x265ccd,_0x500c8b){_0x500c8b=_0x500c8b||0xcc;return function(_0x20e3a3){if(_0x20e3a3){return _0x265ccd[_0x853f('0x18')](_0x500c8b);}return _0x265ccd[_0x853f('0x19')](_0x500c8b)[_0x853f('0x1a')]();};}function respondWithResult(_0x362d59,_0x3f90c0){_0x3f90c0=_0x3f90c0||0xc8;return function(_0x4be257){if(_0x4be257){return _0x362d59[_0x853f('0x19')](_0x3f90c0)[_0x853f('0x1b')](_0x4be257);}};}function respondWithFilteredResult(_0x38af84,_0x2f8848){return function(_0x21d061){if(_0x21d061){var _0x2de959=typeof _0x2f8848['offset']==='undefined'&&typeof _0x2f8848[_0x853f('0x1c')]===_0x853f('0x1d');var _0x511057=_0x21d061[_0x853f('0x1e')];var _0x82495e=_0x2de959?0x0:_0x2f8848['offset'];var _0x5c22e0=_0x2de959?_0x21d061[_0x853f('0x1e')]:_0x2f8848[_0x853f('0x1f')]+_0x2f8848[_0x853f('0x1c')];var _0x2f5293;if(_0x5c22e0>=_0x511057){_0x5c22e0=_0x511057;_0x2f5293=0xc8;}else{_0x2f5293=0xce;}_0x38af84[_0x853f('0x19')](_0x2f5293);return _0x38af84[_0x853f('0x20')](_0x853f('0x21'),_0x82495e+'-'+_0x5c22e0+'/'+_0x511057)['json'](_0x21d061);}return null;};}function patchUpdates(_0x40742e){return function(_0x181b9e){try{jsonpatch[_0x853f('0x22')](_0x181b9e,_0x40742e,!![]);}catch(_0x3d7904){return BPromise[_0x853f('0x23')](_0x3d7904);}return _0x181b9e['save']();};}function saveUpdates(_0x37d907,_0x42469f){return function(_0xf00a99){if(_0xf00a99){return _0xf00a99['update'](_0x37d907)[_0x853f('0x24')](function(_0x202308){return _0x202308;});}return null;};}function removeEntity(_0x63d0e7,_0x341e76){return function(_0x5c478f){if(_0x5c478f){return _0x5c478f[_0x853f('0x25')]()[_0x853f('0x24')](function(){var _0x49a3a4=_0x5c478f[_0x853f('0x26')]({'plain':!![]});var _0x483733=_0x853f('0x27');return db[_0x853f('0x28')][_0x853f('0x25')]({'where':{'type':_0x483733,'resourceId':_0x49a3a4['id']}})[_0x853f('0x24')](function(){return _0x5c478f;});})[_0x853f('0x24')](function(){_0x63d0e7['status'](0xcc)[_0x853f('0x1a')]();});}};}function handleEntityNotFound(_0x13f796,_0x5be516){return function(_0x329e20){if(!_0x329e20){_0x13f796[_0x853f('0x18')](0x194);}return _0x329e20;};}function handleError(_0x1f7c31,_0x5abe53){_0x5abe53=_0x5abe53||0x1f4;return function(_0x114266){logger[_0x853f('0x29')](_0x114266[_0x853f('0x2a')]);if(_0x114266[_0x853f('0x2b')]){delete _0x114266[_0x853f('0x2b')];}_0x1f7c31['status'](_0x5abe53)[_0x853f('0x2c')](_0x114266);};}exports[_0x853f('0x2d')]=function(_0x5285f2,_0x4d6d56){var _0x5b74b0={},_0x20b27a={},_0x482ef2={'count':0x0,'rows':[]};var _0x41b09c=_['map'](db[_0x853f('0x2e')][_0x853f('0x2f')],function(_0x17b283){return{'name':_0x17b283[_0x853f('0x30')],'type':_0x17b283[_0x853f('0x31')][_0x853f('0x32')]};});_0x20b27a[_0x853f('0x33')]=_[_0x853f('0x34')](_0x41b09c,_0x853f('0x2b'));_0x20b27a[_0x853f('0x35')]=_[_0x853f('0x36')](_0x5285f2[_0x853f('0x35')]);_0x20b27a['filters']=_[_0x853f('0x37')](_0x20b27a[_0x853f('0x33')],_0x20b27a[_0x853f('0x35')]);_0x5b74b0[_0x853f('0x38')]=_[_0x853f('0x37')](_0x20b27a['model'],qs[_0x853f('0x39')](_0x5285f2[_0x853f('0x35')][_0x853f('0x39')]));_0x5b74b0[_0x853f('0x38')]=_0x5b74b0[_0x853f('0x38')][_0x853f('0x3a')]?_0x5b74b0['attributes']:_0x20b27a[_0x853f('0x33')];if(!_0x5285f2[_0x853f('0x35')]['hasOwnProperty'](_0x853f('0x3b'))){_0x5b74b0[_0x853f('0x1c')]=qs[_0x853f('0x1c')](_0x5285f2['query'][_0x853f('0x1c')]);_0x5b74b0[_0x853f('0x1f')]=qs['offset'](_0x5285f2[_0x853f('0x35')][_0x853f('0x1f')]);}_0x5b74b0['order']=qs['sort'](_0x5285f2[_0x853f('0x35')]['sort']);_0x5b74b0['where']=qs['filters'](_['pick'](_0x5285f2[_0x853f('0x35')],_0x20b27a[_0x853f('0x3c')]),_0x41b09c);if(_0x5285f2[_0x853f('0x35')]['filter']){_0x5b74b0[_0x853f('0x3d')]=_['merge'](_0x5b74b0[_0x853f('0x3d')],{'$or':_['map'](_0x41b09c,function(_0x527575){if(_0x527575['type']!==_0x853f('0x3e')){var _0x3171d1={};_0x3171d1[_0x527575[_0x853f('0x2b')]]={'$like':'%'+_0x5285f2['query'][_0x853f('0x3f')]+'%'};return _0x3171d1;}})});}_0x5b74b0=_['merge']({},_0x5b74b0,_0x5285f2[_0x853f('0x40')]);var _0x24071e={'where':_0x5b74b0[_0x853f('0x3d')]};return db[_0x853f('0x2e')][_0x853f('0x1e')](_0x24071e)[_0x853f('0x24')](function(_0x230231){_0x482ef2['count']=_0x230231;if(_0x5285f2['query'][_0x853f('0x41')]){_0x5b74b0[_0x853f('0x42')]=[{'all':!![]}];}return db[_0x853f('0x2e')][_0x853f('0x43')](_0x5b74b0);})[_0x853f('0x24')](function(_0x2f7fce){_0x482ef2[_0x853f('0x44')]=_0x2f7fce;return _0x482ef2;})['then'](respondWithFilteredResult(_0x4d6d56,_0x5b74b0))['catch'](handleError(_0x4d6d56,null));};exports[_0x853f('0x45')]=function(_0xa3d7c1,_0x5c2cd2){var _0x3bfe9c={'raw':!![],'where':{'id':_0xa3d7c1[_0x853f('0x46')]['id']}},_0x2e0090={};_0x2e0090[_0x853f('0x33')]=_['keys'](db['Disposition'][_0x853f('0x2f')]);_0x2e0090[_0x853f('0x35')]=_[_0x853f('0x36')](_0xa3d7c1['query']);_0x2e0090['filters']=_[_0x853f('0x37')](_0x2e0090[_0x853f('0x33')],_0x2e0090['query']);_0x3bfe9c[_0x853f('0x38')]=_['intersection'](_0x2e0090[_0x853f('0x33')],qs[_0x853f('0x39')](_0xa3d7c1['query'][_0x853f('0x39')]));_0x3bfe9c[_0x853f('0x38')]=_0x3bfe9c['attributes'][_0x853f('0x3a')]?_0x3bfe9c[_0x853f('0x38')]:_0x2e0090[_0x853f('0x33')];if(_0xa3d7c1[_0x853f('0x35')][_0x853f('0x41')]){_0x3bfe9c['include']=[{'all':!![]}];}_0x3bfe9c=_[_0x853f('0x47')]({},_0x3bfe9c,_0xa3d7c1[_0x853f('0x40')]);return db[_0x853f('0x2e')]['find'](_0x3bfe9c)[_0x853f('0x24')](handleEntityNotFound(_0x5c2cd2,null))[_0x853f('0x24')](respondWithResult(_0x5c2cd2,null))[_0x853f('0x48')](handleError(_0x5c2cd2,null));};exports[_0x853f('0x49')]=function(_0x119fce,_0x337f5b){return db[_0x853f('0x2e')][_0x853f('0x49')](_0x119fce[_0x853f('0x4a')],{})[_0x853f('0x24')](function(_0x1c9632){var _0x57c258=_0x119fce['user'][_0x853f('0x26')]({'plain':!![]});if(!_0x57c258)throw new Error(_0x853f('0x4b'));if(_0x57c258[_0x853f('0x4c')]==='user'){var _0x49dd5c=_0x1c9632['get']({'plain':!![]});var _0x1009ed=_0x853f('0x27');return db[_0x853f('0x4d')][_0x853f('0x4e')]({'where':{'name':_0x1009ed,'userProfileId':_0x57c258[_0x853f('0x4f')]},'raw':!![]})['then'](function(_0x54d100){if(_0x54d100&&_0x54d100['autoAssociation']===0x0){return db['UserProfileResource'][_0x853f('0x49')]({'name':_0x49dd5c[_0x853f('0x2b')],'resourceId':_0x49dd5c['id'],'type':_0x54d100[_0x853f('0x2b')],'sectionId':_0x54d100['id']},{})[_0x853f('0x24')](function(){return _0x1c9632;});}else{return _0x1c9632;}})[_0x853f('0x48')](function(_0x5a114d){logger[_0x853f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a114d);throw _0x5a114d;});}return _0x1c9632;})[_0x853f('0x24')](respondWithResult(_0x337f5b,0xc9))[_0x853f('0x48')](handleError(_0x337f5b,null));};exports['update']=function(_0x255df1,_0x1b5ec2){if(_0x255df1[_0x853f('0x4a')]['id']){delete _0x255df1[_0x853f('0x4a')]['id'];}return db['Disposition'][_0x853f('0x4e')]({'where':{'id':_0x255df1[_0x853f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b5ec2,null))[_0x853f('0x24')](saveUpdates(_0x255df1[_0x853f('0x4a')],null))[_0x853f('0x24')](respondWithResult(_0x1b5ec2,null))[_0x853f('0x48')](handleError(_0x1b5ec2,null));};exports[_0x853f('0x25')]=function(_0x4ded8b,_0x3c1d74){return db['Disposition']['find']({'where':{'id':_0x4ded8b[_0x853f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c1d74,null))['then'](removeEntity(_0x3c1d74,null))[_0x853f('0x48')](handleError(_0x3c1d74,null));}; \ No newline at end of file +var _0xe567=['options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Dispositions','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x1dbbce,_0x48410a){var _0x30b20d=function(_0x239d3e){while(--_0x239d3e){_0x1dbbce['push'](_0x1dbbce['shift']());}};_0x30b20d(++_0x48410a);}(_0xe567,0xa6));var _0x7e56=function(_0x58a526,_0x17a90a){_0x58a526=_0x58a526-0x0;var _0x1489ca=_0xe567[_0x58a526];return _0x1489ca;};'use strict';var emlformat=require(_0x7e56('0x0'));var rimraf=require(_0x7e56('0x1'));var zipdir=require(_0x7e56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e56('0x3'));var Mustache=require('mustache');var util=require(_0x7e56('0x4'));var path=require('path');var sox=require(_0x7e56('0x5'));var csv=require(_0x7e56('0x6'));var ejs=require(_0x7e56('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e56('0x8'));var squel=require(_0x7e56('0x9'));var crypto=require(_0x7e56('0xa'));var jsforce=require(_0x7e56('0xb'));var deskjs=require(_0x7e56('0xc'));var toCsv=require(_0x7e56('0x6'));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(_0x7e56('0xd'));var hardwareService=require(_0x7e56('0xe'));var logger=require(_0x7e56('0xf'))('api');var utils=require(_0x7e56('0x10'));var config=require(_0x7e56('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e56('0x12'))['db'];function respondWithStatusCode(_0x1e77b5,_0x1e6dbc){_0x1e6dbc=_0x1e6dbc||0xcc;return function(_0x3295c2){if(_0x3295c2){return _0x1e77b5[_0x7e56('0x13')](_0x1e6dbc);}return _0x1e77b5[_0x7e56('0x14')](_0x1e6dbc)[_0x7e56('0x15')]();};}function respondWithResult(_0x132d1f,_0x597afc){_0x597afc=_0x597afc||0xc8;return function(_0x3dfe3a){if(_0x3dfe3a){return _0x132d1f[_0x7e56('0x14')](_0x597afc)[_0x7e56('0x16')](_0x3dfe3a);}};}function respondWithFilteredResult(_0x135b7a,_0x435217){return function(_0x135dae){if(_0x135dae){var _0xcb286f=typeof _0x435217[_0x7e56('0x17')]===_0x7e56('0x18')&&typeof _0x435217[_0x7e56('0x19')]===_0x7e56('0x18');var _0x48f70a=_0x135dae['count'];var _0x24b502=_0xcb286f?0x0:_0x435217[_0x7e56('0x17')];var _0x35defc=_0xcb286f?_0x135dae[_0x7e56('0x1a')]:_0x435217[_0x7e56('0x17')]+_0x435217[_0x7e56('0x19')];var _0x3178fa;if(_0x35defc>=_0x48f70a){_0x35defc=_0x48f70a;_0x3178fa=0xc8;}else{_0x3178fa=0xce;}_0x135b7a[_0x7e56('0x14')](_0x3178fa);return _0x135b7a['set'](_0x7e56('0x1b'),_0x24b502+'-'+_0x35defc+'/'+_0x48f70a)[_0x7e56('0x16')](_0x135dae);}return null;};}function patchUpdates(_0x355b1b){return function(_0x1c47f3){try{jsonpatch['apply'](_0x1c47f3,_0x355b1b,!![]);}catch(_0x190f44){return BPromise[_0x7e56('0x1c')](_0x190f44);}return _0x1c47f3[_0x7e56('0x1d')]();};}function saveUpdates(_0x592df8,_0x40f99b){return function(_0x2f3138){if(_0x2f3138){return _0x2f3138[_0x7e56('0x1e')](_0x592df8)['then'](function(_0x3a9449){return _0x3a9449;});}return null;};}function removeEntity(_0x9a5bed,_0x534b21){return function(_0x471ebb){if(_0x471ebb){return _0x471ebb[_0x7e56('0x1f')]()[_0x7e56('0x20')](function(){var _0x53f77b=_0x471ebb[_0x7e56('0x21')]({'plain':!![]});var _0x41d8ba='Dispositions';return db['UserProfileResource']['destroy']({'where':{'type':_0x41d8ba,'resourceId':_0x53f77b['id']}})[_0x7e56('0x20')](function(){return _0x471ebb;});})[_0x7e56('0x20')](function(){_0x9a5bed[_0x7e56('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d894,_0x1081e9){return function(_0x5819ac){if(!_0x5819ac){_0x55d894[_0x7e56('0x13')](0x194);}return _0x5819ac;};}function handleError(_0x1d3249,_0x3977ef){_0x3977ef=_0x3977ef||0x1f4;return function(_0x3d8909){logger[_0x7e56('0x22')](_0x3d8909[_0x7e56('0x23')]);if(_0x3d8909[_0x7e56('0x24')]){delete _0x3d8909['name'];}_0x1d3249[_0x7e56('0x14')](_0x3977ef)[_0x7e56('0x25')](_0x3d8909);};}exports[_0x7e56('0x26')]=function(_0x16df47,_0x2d3edd){var _0x378a91={},_0x163e30={},_0x2b71c1={'count':0x0,'rows':[]};var _0x13631a=_[_0x7e56('0x27')](db[_0x7e56('0x28')]['rawAttributes'],function(_0x6d30ae){return{'name':_0x6d30ae[_0x7e56('0x29')],'type':_0x6d30ae[_0x7e56('0x2a')]['key']};});_0x163e30[_0x7e56('0x2b')]=_[_0x7e56('0x27')](_0x13631a,_0x7e56('0x24'));_0x163e30['query']=_['keys'](_0x16df47[_0x7e56('0x2c')]);_0x163e30['filters']=_[_0x7e56('0x2d')](_0x163e30[_0x7e56('0x2b')],_0x163e30[_0x7e56('0x2c')]);_0x378a91[_0x7e56('0x2e')]=_[_0x7e56('0x2d')](_0x163e30[_0x7e56('0x2b')],qs[_0x7e56('0x2f')](_0x16df47['query']['fields']));_0x378a91[_0x7e56('0x2e')]=_0x378a91[_0x7e56('0x2e')][_0x7e56('0x30')]?_0x378a91['attributes']:_0x163e30[_0x7e56('0x2b')];if(!_0x16df47['query']['hasOwnProperty'](_0x7e56('0x31'))){_0x378a91[_0x7e56('0x19')]=qs[_0x7e56('0x19')](_0x16df47[_0x7e56('0x2c')][_0x7e56('0x19')]);_0x378a91[_0x7e56('0x17')]=qs[_0x7e56('0x17')](_0x16df47['query'][_0x7e56('0x17')]);}_0x378a91['order']=qs[_0x7e56('0x32')](_0x16df47[_0x7e56('0x2c')][_0x7e56('0x32')]);_0x378a91[_0x7e56('0x33')]=qs['filters'](_['pick'](_0x16df47[_0x7e56('0x2c')],_0x163e30[_0x7e56('0x34')]),_0x13631a);if(_0x16df47[_0x7e56('0x2c')][_0x7e56('0x35')]){_0x378a91[_0x7e56('0x33')]=_[_0x7e56('0x36')](_0x378a91[_0x7e56('0x33')],{'$or':_['map'](_0x13631a,function(_0x3dde85){if(_0x3dde85[_0x7e56('0x2a')]!==_0x7e56('0x37')){var _0x20d841={};_0x20d841[_0x3dde85[_0x7e56('0x24')]]={'$like':'%'+_0x16df47[_0x7e56('0x2c')][_0x7e56('0x35')]+'%'};return _0x20d841;}})});}_0x378a91=_[_0x7e56('0x36')]({},_0x378a91,_0x16df47[_0x7e56('0x38')]);var _0x180086={'where':_0x378a91[_0x7e56('0x33')]};return db[_0x7e56('0x28')][_0x7e56('0x1a')](_0x180086)[_0x7e56('0x20')](function(_0x26a005){_0x2b71c1['count']=_0x26a005;if(_0x16df47[_0x7e56('0x2c')][_0x7e56('0x39')]){_0x378a91[_0x7e56('0x3a')]=[{'all':!![]}];}return db[_0x7e56('0x28')][_0x7e56('0x3b')](_0x378a91);})[_0x7e56('0x20')](function(_0x42a728){_0x2b71c1[_0x7e56('0x3c')]=_0x42a728;return _0x2b71c1;})['then'](respondWithFilteredResult(_0x2d3edd,_0x378a91))[_0x7e56('0x3d')](handleError(_0x2d3edd,null));};exports['show']=function(_0xda3e5c,_0x478dea){var _0x1e7278={'raw':!![],'where':{'id':_0xda3e5c[_0x7e56('0x3e')]['id']}},_0x2086e0={};_0x2086e0[_0x7e56('0x2b')]=_['keys'](db[_0x7e56('0x28')]['rawAttributes']);_0x2086e0[_0x7e56('0x2c')]=_[_0x7e56('0x3f')](_0xda3e5c[_0x7e56('0x2c')]);_0x2086e0[_0x7e56('0x34')]=_[_0x7e56('0x2d')](_0x2086e0[_0x7e56('0x2b')],_0x2086e0[_0x7e56('0x2c')]);_0x1e7278[_0x7e56('0x2e')]=_['intersection'](_0x2086e0[_0x7e56('0x2b')],qs[_0x7e56('0x2f')](_0xda3e5c['query'][_0x7e56('0x2f')]));_0x1e7278[_0x7e56('0x2e')]=_0x1e7278[_0x7e56('0x2e')][_0x7e56('0x30')]?_0x1e7278['attributes']:_0x2086e0[_0x7e56('0x2b')];if(_0xda3e5c[_0x7e56('0x2c')][_0x7e56('0x39')]){_0x1e7278[_0x7e56('0x3a')]=[{'all':!![]}];}_0x1e7278=_[_0x7e56('0x36')]({},_0x1e7278,_0xda3e5c['options']);return db[_0x7e56('0x28')][_0x7e56('0x40')](_0x1e7278)[_0x7e56('0x20')](handleEntityNotFound(_0x478dea,null))['then'](respondWithResult(_0x478dea,null))['catch'](handleError(_0x478dea,null));};exports[_0x7e56('0x41')]=function(_0x428340,_0x3b7cf8){return db['Disposition'][_0x7e56('0x41')](_0x428340[_0x7e56('0x42')],{})['then'](function(_0x33a23a){var _0x375fad=_0x428340['user'][_0x7e56('0x21')]({'plain':!![]});if(!_0x375fad)throw new Error(_0x7e56('0x43'));if(_0x375fad[_0x7e56('0x44')]===_0x7e56('0x45')){var _0x471240=_0x33a23a[_0x7e56('0x21')]({'plain':!![]});var _0x25c083=_0x7e56('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x25c083,'userProfileId':_0x375fad['userProfileId']},'raw':!![]})[_0x7e56('0x20')](function(_0x21083c){if(_0x21083c&&_0x21083c[_0x7e56('0x47')]===0x0){return db[_0x7e56('0x48')]['create']({'name':_0x471240[_0x7e56('0x24')],'resourceId':_0x471240['id'],'type':_0x21083c[_0x7e56('0x24')],'sectionId':_0x21083c['id']},{})[_0x7e56('0x20')](function(){return _0x33a23a;});}else{return _0x33a23a;}})[_0x7e56('0x3d')](function(_0x33f30d){logger['error'](_0x7e56('0x49'),_0x33f30d);throw _0x33f30d;});}return _0x33a23a;})[_0x7e56('0x20')](respondWithResult(_0x3b7cf8,0xc9))[_0x7e56('0x3d')](handleError(_0x3b7cf8,null));};exports[_0x7e56('0x1e')]=function(_0x3920dd,_0x3f61d6){if(_0x3920dd[_0x7e56('0x42')]['id']){delete _0x3920dd[_0x7e56('0x42')]['id'];}return db[_0x7e56('0x28')][_0x7e56('0x40')]({'where':{'id':_0x3920dd[_0x7e56('0x3e')]['id']}})[_0x7e56('0x20')](handleEntityNotFound(_0x3f61d6,null))['then'](saveUpdates(_0x3920dd['body'],null))[_0x7e56('0x20')](respondWithResult(_0x3f61d6,null))[_0x7e56('0x3d')](handleError(_0x3f61d6,null));};exports[_0x7e56('0x1f')]=function(_0x3b4b1f,_0x294a8b){return db['Disposition'][_0x7e56('0x40')]({'where':{'id':_0x3b4b1f[_0x7e56('0x3e')]['id']}})['then'](handleEntityNotFound(_0x294a8b,null))[_0x7e56('0x20')](removeEntity(_0x294a8b,null))['catch'](handleError(_0x294a8b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index aa05391..eadcf3b 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 _0xb3a9=['name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId'];(function(_0x195a3b,_0x6e9cf1){var _0x3b915f=function(_0x89f215){while(--_0x89f215){_0x195a3b['push'](_0x195a3b['shift']());}};_0x3b915f(++_0x6e9cf1);}(_0xb3a9,0xa2));var _0x9b3a=function(_0x16be95,_0x5ee906){_0x16be95=_0x16be95-0x0;var _0x53410e=_0xb3a9[_0x16be95];return _0x53410e;};'use strict';var _=require(_0x9b3a('0x0'));var util=require(_0x9b3a('0x1'));var logger=require(_0x9b3a('0x2'))(_0x9b3a('0x3'));var moment=require(_0x9b3a('0x4'));var BPromise=require(_0x9b3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b3a('0x6'));var rimraf=require(_0x9b3a('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b3a('0x8'));module[_0x9b3a('0x9')]=function(_0x1e6735,_0x2f6367){return _0x1e6735[_0x9b3a('0xa')](_0x9b3a('0xb'),attributes,{'tableName':_0x9b3a('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x9b3a('0xd'),'ListId']},{'unique':!![],'name':_0x9b3a('0xe'),'fields':[_0x9b3a('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x9b3a('0xf'),'fields':[_0x9b3a('0xd'),_0x9b3a('0x10')]},{'unique':!![],'name':_0x9b3a('0x11'),'fields':[_0x9b3a('0xd'),_0x9b3a('0x12')]},{'unique':!![],'name':_0x9b3a('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x9b3a('0x14'),'fields':[_0x9b3a('0xd'),_0x9b3a('0x15')]},{'unique':!![],'name':_0x9b3a('0x16'),'fields':[_0x9b3a('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x133f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger'];(function(_0x42bbdc,_0x459dfa){var _0x37f0c5=function(_0x1c0240){while(--_0x1c0240){_0x42bbdc['push'](_0x42bbdc['shift']());}};_0x37f0c5(++_0x459dfa);}(_0x133f,0xdb));var _0xf133=function(_0x12182a,_0xa8b3bf){_0x12182a=_0x12182a-0x0;var _0x3007aa=_0x133f[_0x12182a];return _0x3007aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf133('0x0'))('api');var moment=require(_0xf133('0x1'));var BPromise=require(_0xf133('0x2'));var rp=require(_0xf133('0x3'));var fs=require('fs');var path=require(_0xf133('0x4'));var rimraf=require(_0xf133('0x5'));var config=require(_0xf133('0x6'));var attributes=require(_0xf133('0x7'));module[_0xf133('0x8')]=function(_0x2b691a,_0x4c15a0){return _0x2b691a[_0xf133('0x9')]('Disposition',attributes,{'tableName':_0xf133('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf133('0xb'),'fields':[_0xf133('0xc'),_0xf133('0xd')]},{'unique':!![],'name':'name_chat','fields':['name',_0xf133('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xf133('0xc'),_0xf133('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0xf133('0xc'),_0xf133('0x10')]},{'unique':!![],'name':_0xf133('0x11'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xf133('0x12'),'fields':[_0xf133('0xc'),_0xf133('0x13')]},{'unique':!![],'name':_0xf133('0x14'),'fields':[_0xf133('0xc'),_0xf133('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 7b19e78..d7e9f19 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(_0xa77475,_0x244ab1){var _0x31b191=function(_0x70ce0a){while(--_0x70ce0a){_0xa77475['push'](_0xa77475['shift']());}};_0x31b191(++_0x244ab1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x2ac6c6,_0x5370fc){var _0x56b1be=function(_0x330e80){while(--_0x330e80){_0x2ac6c6['push'](_0x2ac6c6['shift']());}};_0x56b1be(++_0x5370fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 4977352..aad79bf 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 _0x5afc=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5afc,0xdb));var _0xc5af=function(_0x5973cf,_0x59b4b9){_0x5973cf=_0x5973cf-0x0;var _0x436deb=_0x5afc[_0x5973cf];return _0x436deb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc5af('0x0'));var timeout=require(_0xc5af('0x1'));var express=require(_0xc5af('0x2'));var router=express[_0xc5af('0x3')]();var fs_extra=require(_0xc5af('0x4'));var auth=require(_0xc5af('0x5'));var interaction=require(_0xc5af('0x6'));var config=require(_0xc5af('0x7'));var controller=require('./disposition.controller');router[_0xc5af('0x8')]('/',auth[_0xc5af('0x9')](),controller['index']);router[_0xc5af('0x8')](_0xc5af('0xa'),auth[_0xc5af('0x9')](),controller[_0xc5af('0xb')]);router['post']('/',auth[_0xc5af('0x9')](),controller['create']);router[_0xc5af('0xc')](_0xc5af('0xa'),auth[_0xc5af('0x9')](),controller[_0xc5af('0xd')]);router['delete'](_0xc5af('0xa'),auth[_0xc5af('0x9')](),controller['destroy']);module[_0xc5af('0xe')]=router; \ No newline at end of file +var _0x3ef0=['../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ef0,0x14b));var _0x03ef=function(_0x539f6d,_0x1e973b){_0x539f6d=_0x539f6d-0x0;var _0x288e50=_0x3ef0[_0x539f6d];return _0x288e50;};'use strict';var multer=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var path=require(_0x03ef('0x2'));var timeout=require(_0x03ef('0x3'));var express=require(_0x03ef('0x4'));var router=express[_0x03ef('0x5')]();var fs_extra=require(_0x03ef('0x6'));var auth=require(_0x03ef('0x7'));var interaction=require(_0x03ef('0x8'));var config=require(_0x03ef('0x9'));var controller=require(_0x03ef('0xa'));router[_0x03ef('0xb')]('/',auth['isAuthenticated'](),controller[_0x03ef('0xc')]);router[_0x03ef('0xb')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller[_0x03ef('0xf')]);router[_0x03ef('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03ef('0x11')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller['update']);router[_0x03ef('0x12')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller[_0x03ef('0x13')]);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 4494209..723885a 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 _0x31ef=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT'];(function(_0x4b3045,_0x2b7d44){var _0x57fd2d=function(_0x255819){while(--_0x255819){_0x4b3045['push'](_0x4b3045['shift']());}};_0x57fd2d(++_0x2b7d44);}(_0x31ef,0xd4));var _0xf31e=function(_0x1caa6a,_0x1511da){_0x1caa6a=_0x1caa6a-0x0;var _0x4aa8ec=_0x31ef[_0x1caa6a];return _0x4aa8ec;};'use strict';var Sequelize=require(_0xf31e('0x0'));module[_0xf31e('0x1')]={'name':{'type':Sequelize[_0xf31e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf31e('0x2')]},'ecm':{'type':Sequelize[_0xf31e('0x3')](_0xf31e('0x4'),'no'),'defaultValue':_0xf31e('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xf31e('0x5')},'localstationid':{'type':Sequelize[_0xf31e('0x2')],'unique':_0xf31e('0x6')},'minrate':{'type':Sequelize[_0xf31e('0x3')](_0xf31e('0x7'),_0xf31e('0x8'),_0xf31e('0x9'),_0xf31e('0xa'),_0xf31e('0xb'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xf31e('0x3')](_0xf31e('0x7'),_0xf31e('0x8'),'7200','9600','12000','14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xf31e('0x2')],'defaultValue':_0xf31e('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf31e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf31e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf31e('0x3')](_0xf31e('0xe'),'IAX',_0xf31e('0xf'),_0xf31e('0x10')),'defaultValue':_0xf31e('0xe')},'key':{'type':Sequelize[_0xf31e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf31e('0x11')],'defaultValue':function(){return _0xf31e('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf31e('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf31e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf31e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf31e('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf31e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf31e('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xf31e('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x489384){if(!_0x489384)this[_0xf31e('0x15')](_0xf31e('0x16'),null);this[_0xf31e('0x15')]('mandatoryDisposition',_0x489384);}}}; \ No newline at end of file +var _0xe30a=['mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','DADHI','SIP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0x2cf100,_0x1f2318){var _0x29f436=function(_0x140b60){while(--_0x140b60){_0x2cf100['push'](_0x2cf100['shift']());}};_0x29f436(++_0x1f2318);}(_0xe30a,0x141));var _0xae30=function(_0x46cc65,_0x1a73d3){_0x46cc65=_0x46cc65-0x0;var _0x1e9d97=_0xe30a[_0x46cc65];return _0x1e9d97;};'use strict';var Sequelize=require(_0xae30('0x0'));module[_0xae30('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae30('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xae30('0x3'),'no'),'defaultValue':_0xae30('0x3')},'headerinfo':{'type':Sequelize[_0xae30('0x2')],'defaultValue':_0xae30('0x4')},'localstationid':{'type':Sequelize[_0xae30('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xae30('0x5')](_0xae30('0x6'),_0xae30('0x7'),_0xae30('0x8'),_0xae30('0x9'),_0xae30('0xa'),_0xae30('0xb')),'defaultValue':_0xae30('0x7')},'maxrate':{'type':Sequelize[_0xae30('0x5')](_0xae30('0x6'),_0xae30('0x7'),_0xae30('0x8'),_0xae30('0x9'),_0xae30('0xa'),_0xae30('0xb')),'defaultValue':_0xae30('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xae30('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xae30('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xae30('0x5')]('SIP','IAX',_0xae30('0xe'),'KHOMP'),'defaultValue':_0xae30('0xf')},'key':{'type':Sequelize[_0xae30('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xae30('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xae30('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xae30('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3e7336){if(!_0x3e7336)this['setDataValue'](_0xae30('0x12'),null);this['setDataValue'](_0xae30('0x13'),_0x3e7336);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index fc6d8ee..cfa9302 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 _0x7e94=['tech','createdAt','findById','getMessages','FaxMessage','format','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','stack','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','options','include','findAll','rows','show','params','Pause','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','color','tag','sequelize','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','json','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','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','transaction','VoiceExtension','updateAccountApplications','omit'];(function(_0x3644b9,_0x5cd3a6){var _0x4d196d=function(_0x2bb4ef){while(--_0x2bb4ef){_0x3644b9['push'](_0x3644b9['shift']());}};_0x4d196d(++_0x5cd3a6);}(_0x7e94,0x1b5));var _0x47e9=function(_0x6fbb7f,_0x2a996e){_0x6fbb7f=_0x6fbb7f-0x0;var _0x27fd80=_0x7e94[_0x6fbb7f];return _0x27fd80;};'use strict';var emlformat=require(_0x47e9('0x0'));var rimraf=require(_0x47e9('0x1'));var zipdir=require(_0x47e9('0x2'));var jsonpatch=require(_0x47e9('0x3'));var rp=require(_0x47e9('0x4'));var moment=require(_0x47e9('0x5'));var BPromise=require(_0x47e9('0x6'));var Mustache=require(_0x47e9('0x7'));var util=require('util');var path=require(_0x47e9('0x8'));var sox=require(_0x47e9('0x9'));var csv=require('to-csv');var ejs=require(_0x47e9('0xa'));var fs=require('fs');var fs_extra=require(_0x47e9('0xb'));var _=require(_0x47e9('0xc'));var squel=require(_0x47e9('0xd'));var crypto=require('crypto');var jsforce=require(_0x47e9('0xe'));var deskjs=require(_0x47e9('0xf'));var toCsv=require(_0x47e9('0x10'));var querystring=require(_0x47e9('0x11'));var Papa=require(_0x47e9('0x12'));var Redis=require(_0x47e9('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x47e9('0x14'));var as=require(_0x47e9('0x15'));var hardwareService=require(_0x47e9('0x16'));var logger=require(_0x47e9('0x17'))(_0x47e9('0x18'));var utils=require('../../config/utils');var config=require(_0x47e9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x47e9('0x1a'))['db'];config['redis']=_[_0x47e9('0x1b')](config['redis'],{'host':_0x47e9('0x1c'),'port':0x18eb});var socket=require(_0x47e9('0x1d'))(new Redis(config[_0x47e9('0x1e')]));require('./faxAccount.socket')[_0x47e9('0x1f')](socket);var jayson=require(_0x47e9('0x20'));var client=jayson[_0x47e9('0x21')][_0x47e9('0x22')]({'port':0x232c});var client9002=jayson[_0x47e9('0x21')][_0x47e9('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x481eb8,_0x300489,_0x4fb37f,_0x112cc1){return new BPromise(function(_0x36f463,_0x3dd85a){var _0x3439c0=_0x112cc1||client;return _0x3439c0[_0x47e9('0x23')](_0x481eb8,_0x4fb37f)[_0x47e9('0x24')](function(_0x32aefc){logger[_0x47e9('0x25')](_0x47e9('0x26'),_0x300489,_0x47e9('0x27'));logger[_0x47e9('0x28')](_0x47e9('0x29'),_0x300489,'request\x20sent',JSON['stringify'](_0x32aefc));if(_0x32aefc[_0x47e9('0x2a')]){if(_0x32aefc[_0x47e9('0x2a')][_0x47e9('0x2b')]===0x1f4){logger['error'](_0x47e9('0x26'),_0x300489,_0x32aefc[_0x47e9('0x2a')][_0x47e9('0x2c')]);return _0x3dd85a(_0x32aefc[_0x47e9('0x2a')][_0x47e9('0x2c')]);}logger[_0x47e9('0x2a')](_0x47e9('0x26'),_0x300489,_0x32aefc[_0x47e9('0x2a')][_0x47e9('0x2c')]);return _0x36f463(_0x32aefc['error']['message']);}else{logger[_0x47e9('0x25')]('FaxAccount,\x20%s,\x20%s',_0x300489,_0x47e9('0x27'));_0x36f463(_0x32aefc[_0x47e9('0x2d')][_0x47e9('0x2c')]);}})[_0x47e9('0x2e')](function(_0x5c4370){logger['error'](_0x47e9('0x26'),_0x300489,_0x5c4370);_0x3dd85a(_0x5c4370);});});}function respondWithStatusCode(_0x9f2d7e,_0x35d141){_0x35d141=_0x35d141||0xcc;return function(_0x49034b){if(_0x49034b){return _0x9f2d7e[_0x47e9('0x2f')](_0x35d141);}return _0x9f2d7e[_0x47e9('0x30')](_0x35d141)[_0x47e9('0x31')]();};}function respondWithResult(_0x34a8b6,_0x85987c){_0x85987c=_0x85987c||0xc8;return function(_0x321dfc){if(_0x321dfc){return _0x34a8b6[_0x47e9('0x30')](_0x85987c)['json'](_0x321dfc);}};}function respondWithFilteredResult(_0x4a47ec,_0x46c4a4){return function(_0x1abaae){if(_0x1abaae){var _0x5890e4=typeof _0x46c4a4['offset']==='undefined'&&typeof _0x46c4a4[_0x47e9('0x32')]===_0x47e9('0x33');var _0x526da8=_0x1abaae[_0x47e9('0x34')];var _0x4b05d3=_0x5890e4?0x0:_0x46c4a4['offset'];var _0x3ee322=_0x5890e4?_0x1abaae['count']:_0x46c4a4[_0x47e9('0x35')]+_0x46c4a4[_0x47e9('0x32')];var _0x277c86;if(_0x3ee322>=_0x526da8){_0x3ee322=_0x526da8;_0x277c86=0xc8;}else{_0x277c86=0xce;}_0x4a47ec[_0x47e9('0x30')](_0x277c86);return _0x4a47ec[_0x47e9('0x36')](_0x47e9('0x37'),_0x4b05d3+'-'+_0x3ee322+'/'+_0x526da8)['json'](_0x1abaae);}return null;};}function patchUpdates(_0x38fb49){return function(_0x446f4f){try{jsonpatch['apply'](_0x446f4f,_0x38fb49,!![]);}catch(_0x3d109c){return BPromise[_0x47e9('0x38')](_0x3d109c);}return _0x446f4f[_0x47e9('0x39')]();};}function saveUpdates(_0xe84003,_0x26d5b2){return function(_0xd14e91){if(_0xd14e91){return _0xd14e91[_0x47e9('0x3a')](_0xe84003)[_0x47e9('0x24')](function(_0x105016){return _0x105016;});}return null;};}function removeEntity(_0x462224,_0x251554){return function(_0x1083d2){if(_0x1083d2){return _0x1083d2[_0x47e9('0x3b')]()[_0x47e9('0x24')](function(){var _0x5b0545=_0x1083d2['get']({'plain':!![]});var _0x5e95bf='FaxAccounts';return db['UserProfileResource'][_0x47e9('0x3b')]({'where':{'type':_0x5e95bf,'resourceId':_0x5b0545['id']}})[_0x47e9('0x24')](function(){return _0x1083d2;});})[_0x47e9('0x24')](function(){_0x462224[_0x47e9('0x30')](0xcc)[_0x47e9('0x31')]();});}};}function handleEntityNotFound(_0x5edf7a,_0x173ba6){return function(_0x10ed12){if(!_0x10ed12){_0x5edf7a[_0x47e9('0x2f')](0x194);}return _0x10ed12;};}function handleError(_0xd78838,_0x27b6e3){_0x27b6e3=_0x27b6e3||0x1f4;return function(_0x277a9b){logger[_0x47e9('0x2a')](_0x277a9b[_0x47e9('0x3c')]);if(_0x277a9b['name']){delete _0x277a9b['name'];}_0xd78838[_0x47e9('0x30')](_0x27b6e3)['send'](_0x277a9b);};}exports[_0x47e9('0x3d')]=function(_0x26545c,_0x4a9968){var _0x425b8d={'include':[{'model':db['Pause'],'as':_0x47e9('0x3e')}]},_0x392ae5={},_0x2b6c4d={'count':0x0,'rows':[]};var _0x459243=_[_0x47e9('0x3f')](db[_0x47e9('0x40')][_0x47e9('0x41')],function(_0x27daee){return{'name':_0x27daee[_0x47e9('0x42')],'type':_0x27daee[_0x47e9('0x43')][_0x47e9('0x44')]};});_0x392ae5[_0x47e9('0x45')]=_[_0x47e9('0x3f')](_0x459243,'name');_0x392ae5[_0x47e9('0x46')]=_[_0x47e9('0x47')](_0x26545c[_0x47e9('0x46')]);_0x392ae5[_0x47e9('0x48')]=_[_0x47e9('0x49')](_0x392ae5[_0x47e9('0x45')],_0x392ae5['query']);_0x425b8d[_0x47e9('0x4a')]=_['intersection'](_0x392ae5[_0x47e9('0x45')],qs[_0x47e9('0x4b')](_0x26545c[_0x47e9('0x46')]['fields']));_0x425b8d['attributes']=_0x425b8d[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0x425b8d[_0x47e9('0x4a')]:_0x392ae5[_0x47e9('0x45')];if(!_0x26545c['query']['hasOwnProperty'](_0x47e9('0x4d'))){_0x425b8d[_0x47e9('0x32')]=qs['limit'](_0x26545c[_0x47e9('0x46')][_0x47e9('0x32')]);_0x425b8d[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x26545c['query'][_0x47e9('0x35')]);}_0x425b8d[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x26545c['query'][_0x47e9('0x4f')]);_0x425b8d[_0x47e9('0x50')]=qs[_0x47e9('0x48')](_[_0x47e9('0x51')](_0x26545c[_0x47e9('0x46')],_0x392ae5[_0x47e9('0x48')]),_0x459243);if(_0x26545c['query'][_0x47e9('0x52')]){_0x425b8d[_0x47e9('0x50')]=_['merge'](_0x425b8d[_0x47e9('0x50')],{'$or':_[_0x47e9('0x3f')](_0x459243,function(_0xd2ab2c){if(_0xd2ab2c['type']!==_0x47e9('0x53')){var _0x40957e={};_0x40957e[_0xd2ab2c[_0x47e9('0x54')]]={'$like':'%'+_0x26545c[_0x47e9('0x46')]['filter']+'%'};return _0x40957e;}})});}_0x425b8d=_[_0x47e9('0x55')]({},_0x425b8d,_0x26545c[_0x47e9('0x56')]);var _0x462e83={'where':_0x425b8d['where']};return db[_0x47e9('0x40')][_0x47e9('0x34')](_0x462e83)[_0x47e9('0x24')](function(_0x8ad382){_0x2b6c4d[_0x47e9('0x34')]=_0x8ad382;if(_0x26545c[_0x47e9('0x46')]['includeAll']){_0x425b8d[_0x47e9('0x57')]=[{'all':!![]}];}return db[_0x47e9('0x40')][_0x47e9('0x58')](_0x425b8d);})[_0x47e9('0x24')](function(_0x7ee96a){_0x2b6c4d[_0x47e9('0x59')]=_0x7ee96a;return _0x2b6c4d;})[_0x47e9('0x24')](respondWithFilteredResult(_0x4a9968,_0x425b8d))[_0x47e9('0x2e')](handleError(_0x4a9968,null));};exports[_0x47e9('0x5a')]=function(_0x270048,_0x32442f){var _0x4b95b3={'raw':![],'where':{'id':_0x270048[_0x47e9('0x5b')]['id']},'include':[{'model':db[_0x47e9('0x5c')],'as':'mandatoryDispositionPause'}]},_0x5433bb={};_0x5433bb[_0x47e9('0x45')]=_[_0x47e9('0x47')](db['FaxAccount'][_0x47e9('0x41')]);_0x5433bb['query']=_[_0x47e9('0x47')](_0x270048[_0x47e9('0x46')]);_0x5433bb[_0x47e9('0x48')]=_['intersection'](_0x5433bb[_0x47e9('0x45')],_0x5433bb[_0x47e9('0x46')]);_0x4b95b3[_0x47e9('0x4a')]=_['intersection'](_0x5433bb[_0x47e9('0x45')],qs['fields'](_0x270048[_0x47e9('0x46')][_0x47e9('0x4b')]));_0x4b95b3[_0x47e9('0x4a')]=_0x4b95b3[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0x4b95b3['attributes']:_0x5433bb[_0x47e9('0x45')];if(_0x270048[_0x47e9('0x46')][_0x47e9('0x5d')]){_0x4b95b3[_0x47e9('0x57')]=[{'all':!![]}];}_0x4b95b3=_[_0x47e9('0x55')]({},_0x4b95b3,_0x270048[_0x47e9('0x56')]);return db[_0x47e9('0x40')][_0x47e9('0x5e')](_0x4b95b3)[_0x47e9('0x24')](handleEntityNotFound(_0x32442f,null))['then'](respondWithResult(_0x32442f,null))['catch'](handleError(_0x32442f,null));};exports[_0x47e9('0x5f')]=function(_0x3954d0,_0x408383){return db[_0x47e9('0x40')][_0x47e9('0x5f')](_0x3954d0['body'],{})[_0x47e9('0x24')](function(_0x2bfaa0){var _0x5c0936=_0x3954d0[_0x47e9('0x60')][_0x47e9('0x61')]({'plain':!![]});if(!_0x5c0936)throw new Error(_0x47e9('0x62'));if(_0x5c0936[_0x47e9('0x63')]==='user'){var _0x4891c3=_0x2bfaa0[_0x47e9('0x61')]({'plain':!![]});var _0x23a4c4=_0x47e9('0x64');return db[_0x47e9('0x65')][_0x47e9('0x5e')]({'where':{'name':_0x23a4c4,'userProfileId':_0x5c0936[_0x47e9('0x66')]},'raw':!![]})[_0x47e9('0x24')](function(_0x39fb61){if(_0x39fb61&&_0x39fb61[_0x47e9('0x67')]===0x0){return db[_0x47e9('0x68')][_0x47e9('0x5f')]({'name':_0x4891c3[_0x47e9('0x54')],'resourceId':_0x4891c3['id'],'type':_0x39fb61[_0x47e9('0x54')],'sectionId':_0x39fb61['id']},{})[_0x47e9('0x24')](function(){return _0x2bfaa0;});}else{return _0x2bfaa0;}})[_0x47e9('0x2e')](function(_0x47d84a){logger['error'](_0x47e9('0x69'),_0x47d84a);throw _0x47d84a;});}return _0x2bfaa0;})[_0x47e9('0x24')](respondWithResult(_0x408383,0xc9))['catch'](handleError(_0x408383,null));};exports['update']=function(_0x204f0a,_0x2c148b){if(_0x204f0a[_0x47e9('0x6a')]['id']){delete _0x204f0a[_0x47e9('0x6a')]['id'];}return db[_0x47e9('0x40')]['find']({'where':{'id':_0x204f0a[_0x47e9('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x47e9('0x24')](handleEntityNotFound(_0x2c148b,null))[_0x47e9('0x24')](saveUpdates(_0x204f0a[_0x47e9('0x6a')],null))[_0x47e9('0x24')](respondWithResult(_0x2c148b,null))[_0x47e9('0x2e')](handleError(_0x2c148b,null));};exports[_0x47e9('0x3b')]=function(_0x7f7891,_0x59a3e7){return db[_0x47e9('0x40')]['find']({'where':{'id':_0x7f7891['params']['id']}})['then'](handleEntityNotFound(_0x59a3e7,null))[_0x47e9('0x24')](removeEntity(_0x59a3e7,null))[_0x47e9('0x2e')](handleError(_0x59a3e7,null));};exports[_0x47e9('0x6b')]=function(_0xa022d1,_0x4392a8){return db[_0x47e9('0x40')][_0x47e9('0x6b')]()[_0x47e9('0x24')](respondWithResult(_0x4392a8,null))[_0x47e9('0x2e')](handleError(_0x4392a8,null));};exports[_0x47e9('0x6c')]=function(_0x4b68d1,_0x3e9a4d,_0x2d0070){if(_0x4b68d1[_0x47e9('0x6a')]['id']){delete _0x4b68d1[_0x47e9('0x6a')]['id'];}return db[_0x47e9('0x40')]['find']({'where':{'id':_0x4b68d1['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x3e9a4d,null))[_0x47e9('0x24')](function(_0xb0be5a){if(_0xb0be5a){_0x4b68d1[_0x47e9('0x6a')][_0x47e9('0x6d')]=_0xb0be5a['id'];return db[_0x47e9('0x6e')][_0x47e9('0x5f')](_0x4b68d1[_0x47e9('0x6a')]);}})['then'](respondWithResult(_0x3e9a4d,null))['catch'](handleError(_0x3e9a4d,null));};exports[_0x47e9('0x6f')]=function(_0x31391d,_0x458132,_0x445a86){var _0x33fc18={'raw':![],'where':{}};var _0x44ff5e={};var _0x42b172={'count':0x0,'rows':[]};return db[_0x47e9('0x40')][_0x47e9('0x70')]({'where':{'id':_0x31391d[_0x47e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x458132,null))['then'](function(_0xb85d01){if(_0xb85d01){_0x44ff5e['model']=_['keys'](db[_0x47e9('0x6e')][_0x47e9('0x41')]);_0x44ff5e[_0x47e9('0x46')]=_[_0x47e9('0x47')](_0x31391d[_0x47e9('0x46')]);_0x44ff5e[_0x47e9('0x48')]=_[_0x47e9('0x49')](_0x44ff5e['model'],_0x44ff5e[_0x47e9('0x46')]);_0x33fc18['attributes']=_[_0x47e9('0x49')](_0x44ff5e['model'],qs[_0x47e9('0x4b')](_0x31391d['query'][_0x47e9('0x4b')]));_0x33fc18[_0x47e9('0x4a')]=_0x33fc18[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0x33fc18[_0x47e9('0x4a')]:_0x44ff5e['model'];if(!_0x31391d[_0x47e9('0x46')]['hasOwnProperty'](_0x47e9('0x4d'))){_0x33fc18[_0x47e9('0x32')]=qs['limit'](_0x31391d[_0x47e9('0x46')][_0x47e9('0x32')]);_0x33fc18[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x31391d[_0x47e9('0x46')][_0x47e9('0x35')]);}_0x33fc18[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x31391d['query'][_0x47e9('0x4f')]);_0x33fc18[_0x47e9('0x50')]=qs['filters'](_[_0x47e9('0x51')](_0x31391d['query'],_0x44ff5e[_0x47e9('0x48')]));_0x33fc18[_0x47e9('0x50')]['FaxAccountId']=_0xb85d01['id'];if(_0x31391d[_0x47e9('0x46')][_0x47e9('0x52')]){_0x33fc18[_0x47e9('0x50')]=_[_0x47e9('0x55')](_0x33fc18['where'],{'$or':_['map'](_0x33fc18[_0x47e9('0x4a')],function(_0x52fff6){var _0x3afe04={};_0x3afe04[_0x52fff6]={'$like':'%'+_0x31391d[_0x47e9('0x46')][_0x47e9('0x52')]+'%'};return _0x3afe04;})});}_0x33fc18=_[_0x47e9('0x55')]({},_0x33fc18,_0x31391d['options']);return db[_0x47e9('0x6e')][_0x47e9('0x34')]({'where':_0x33fc18[_0x47e9('0x50')]})[_0x47e9('0x24')](function(_0x404b0e){_0x42b172[_0x47e9('0x34')]=_0x404b0e;if(_0x31391d[_0x47e9('0x46')][_0x47e9('0x5d')]){_0x33fc18[_0x47e9('0x57')]=[{'all':!![]}];}return db[_0x47e9('0x6e')]['findAll'](_0x33fc18);})[_0x47e9('0x24')](function(_0x25e12c){_0x42b172[_0x47e9('0x59')]=_0x25e12c;return _0x42b172;});}})[_0x47e9('0x24')](respondWithFilteredResult(_0x458132,_0x33fc18))['catch'](handleError(_0x458132,null));};exports['removeDispositions']=function(_0x24519f,_0x44369d,_0x37a865){return db[_0x47e9('0x40')]['find']({'where':{'id':_0x24519f['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x44369d,null))[_0x47e9('0x24')](function(_0x25ef38){if(_0x25ef38){return _0x25ef38[_0x47e9('0x71')](_0x24519f[_0x47e9('0x46')][_0x47e9('0x72')]);}})[_0x47e9('0x24')](respondWithStatusCode(_0x44369d,null))[_0x47e9('0x2e')](handleError(_0x44369d,null));};exports[_0x47e9('0x73')]=function(_0x3c9e06,_0x1bc570,_0x13f0cc){if(_0x3c9e06['body']['id']){delete _0x3c9e06[_0x47e9('0x6a')]['id'];}return db[_0x47e9('0x40')][_0x47e9('0x5e')]({'where':{'id':_0x3c9e06[_0x47e9('0x5b')]['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x1bc570,null))[_0x47e9('0x24')](function(_0x3c0cd7){if(_0x3c0cd7){_0x3c9e06[_0x47e9('0x6a')][_0x47e9('0x6d')]=_0x3c0cd7['id'];return db[_0x47e9('0x74')]['create'](_0x3c9e06[_0x47e9('0x6a')]);}})[_0x47e9('0x24')](respondWithResult(_0x1bc570,null))[_0x47e9('0x2e')](handleError(_0x1bc570,null));};exports['getAnswers']=function(_0x2a8bdb,_0x50b214,_0x3d7c89){var _0xd2af6d={'raw':![],'where':{}};var _0x533e4c={};var _0x5df449={'count':0x0,'rows':[]};return db[_0x47e9('0x40')][_0x47e9('0x70')]({'where':{'id':_0x2a8bdb[_0x47e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x50b214,null))[_0x47e9('0x24')](function(_0x547029){if(_0x547029){_0x533e4c[_0x47e9('0x45')]=_[_0x47e9('0x47')](db['CannedAnswer'][_0x47e9('0x41')]);_0x533e4c['query']=_[_0x47e9('0x47')](_0x2a8bdb[_0x47e9('0x46')]);_0x533e4c[_0x47e9('0x48')]=_[_0x47e9('0x49')](_0x533e4c[_0x47e9('0x45')],_0x533e4c[_0x47e9('0x46')]);_0xd2af6d[_0x47e9('0x4a')]=_[_0x47e9('0x49')](_0x533e4c['model'],qs[_0x47e9('0x4b')](_0x2a8bdb['query'][_0x47e9('0x4b')]));_0xd2af6d[_0x47e9('0x4a')]=_0xd2af6d[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0xd2af6d[_0x47e9('0x4a')]:_0x533e4c['model'];if(!_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x75')](_0x47e9('0x4d'))){_0xd2af6d[_0x47e9('0x32')]=qs['limit'](_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x32')]);_0xd2af6d[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x35')]);}_0xd2af6d[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x4f')]);_0xd2af6d['where']=qs[_0x47e9('0x48')](_[_0x47e9('0x51')](_0x2a8bdb[_0x47e9('0x46')],_0x533e4c[_0x47e9('0x48')]));_0xd2af6d[_0x47e9('0x50')][_0x47e9('0x6d')]=_0x547029['id'];if(_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x52')]){_0xd2af6d[_0x47e9('0x50')]=_[_0x47e9('0x55')](_0xd2af6d[_0x47e9('0x50')],{'$or':_[_0x47e9('0x3f')](_0xd2af6d[_0x47e9('0x4a')],function(_0x21c618){var _0x33bc8e={};_0x33bc8e[_0x21c618]={'$like':'%'+_0x2a8bdb['query']['filter']+'%'};return _0x33bc8e;})});}_0xd2af6d=_[_0x47e9('0x55')]({},_0xd2af6d,_0x2a8bdb[_0x47e9('0x56')]);return db[_0x47e9('0x74')]['count']({'where':_0xd2af6d[_0x47e9('0x50')]})[_0x47e9('0x24')](function(_0x2d270b){_0x5df449[_0x47e9('0x34')]=_0x2d270b;if(_0x2a8bdb[_0x47e9('0x46')][_0x47e9('0x5d')]){_0xd2af6d[_0x47e9('0x57')]=[{'all':!![]}];}return db[_0x47e9('0x74')][_0x47e9('0x58')](_0xd2af6d);})[_0x47e9('0x24')](function(_0x246872){_0x5df449[_0x47e9('0x59')]=_0x246872;return _0x5df449;});}})[_0x47e9('0x24')](respondWithFilteredResult(_0x50b214,_0xd2af6d))[_0x47e9('0x2e')](handleError(_0x50b214,null));};exports[_0x47e9('0x76')]=function(_0x546c21,_0x472f58,_0x5d92d0){return db[_0x47e9('0x40')][_0x47e9('0x5e')]({'where':{'id':_0x546c21['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x472f58,null))[_0x47e9('0x24')](function(_0x2928a0){if(_0x2928a0){return _0x2928a0[_0x47e9('0x76')](_0x546c21[_0x47e9('0x46')][_0x47e9('0x72')]);}})[_0x47e9('0x24')](respondWithStatusCode(_0x472f58,null))['catch'](handleError(_0x472f58,null));};exports[_0x47e9('0x77')]=function(_0x4872cf,_0x272aa5,_0x34dafe){return db[_0x47e9('0x78')][_0x47e9('0x5e')]({'where':{'id':_0x4872cf['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x272aa5,null))[_0x47e9('0x24')](function(_0x19e568){if(_0x19e568){return _0x19e568[_0x47e9('0x77')](_0x4872cf[_0x47e9('0x6a')][_0x47e9('0x72')],_['omit'](_0x4872cf['body'],[_0x47e9('0x72'),'id'])||{});}})[_0x47e9('0x24')](respondWithResult(_0x272aa5,null))['catch'](handleError(_0x272aa5,null));};exports[_0x47e9('0x79')]=function(_0x3896c6,_0x1f9611,_0x4bceac){var _0x4d02ea={'raw':![],'where':{}};var _0x1127c4={};var _0x36bf41={'count':0x0,'rows':[]};return db['FaxAccount'][_0x47e9('0x70')]({'where':{'id':_0x3896c6['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x1f9611,null))[_0x47e9('0x24')](function(_0x51ed8c){if(_0x51ed8c){_0x1127c4['model']=_['keys'](db[_0x47e9('0x78')][_0x47e9('0x41')]);_0x1127c4['query']=_[_0x47e9('0x47')](_0x3896c6[_0x47e9('0x46')]);_0x1127c4[_0x47e9('0x48')]=_[_0x47e9('0x49')](_0x1127c4[_0x47e9('0x45')],_0x1127c4[_0x47e9('0x46')]);_0x4d02ea[_0x47e9('0x4a')]=_[_0x47e9('0x49')](_0x1127c4['model'],qs[_0x47e9('0x4b')](_0x3896c6[_0x47e9('0x46')][_0x47e9('0x4b')]));_0x4d02ea[_0x47e9('0x4a')]=_0x4d02ea[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0x4d02ea[_0x47e9('0x4a')]:_0x1127c4[_0x47e9('0x45')];if(!_0x3896c6[_0x47e9('0x46')][_0x47e9('0x75')](_0x47e9('0x4d'))){_0x4d02ea['limit']=qs[_0x47e9('0x32')](_0x3896c6[_0x47e9('0x46')][_0x47e9('0x32')]);_0x4d02ea[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x3896c6[_0x47e9('0x46')][_0x47e9('0x35')]);}_0x4d02ea[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x3896c6['query'][_0x47e9('0x4f')]);_0x4d02ea['where']=qs[_0x47e9('0x48')](_[_0x47e9('0x51')](_0x3896c6[_0x47e9('0x46')],_0x1127c4[_0x47e9('0x48')]));_0x4d02ea[_0x47e9('0x50')][_0x47e9('0x6d')]=_0x51ed8c['id'];if(_0x3896c6['query'][_0x47e9('0x52')]){_0x4d02ea[_0x47e9('0x50')]=_['merge'](_0x4d02ea['where'],{'$or':_[_0x47e9('0x3f')](_0x4d02ea['attributes'],function(_0x5d7953){var _0xe80a34={};_0xe80a34[_0x5d7953]={'$like':'%'+_0x3896c6[_0x47e9('0x46')][_0x47e9('0x52')]+'%'};return _0xe80a34;})});}_0x4d02ea=_['merge']({},_0x4d02ea,_0x3896c6['options']);return db[_0x47e9('0x78')]['count']({'where':_0x4d02ea[_0x47e9('0x50')]})[_0x47e9('0x24')](function(_0x4c6374){_0x36bf41[_0x47e9('0x34')]=_0x4c6374;if(_0x3896c6[_0x47e9('0x46')][_0x47e9('0x5d')]){_0x4d02ea[_0x47e9('0x57')]=[{'model':db[_0x47e9('0x7a')],'as':_0x47e9('0x7b'),'required':![]},{'model':db[_0x47e9('0x7c')],'as':_0x47e9('0x7d'),'attributes':[_0x47e9('0x54'),_0x47e9('0x7e'),_0x47e9('0x7f')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x47e9('0x54'),_0x47e9('0x80')],'where':_0x3896c6[_0x47e9('0x46')][_0x47e9('0x81')]?{'id':_0x3896c6[_0x47e9('0x46')]['tag']}:undefined,'required':_0x3896c6['query']['tag']?!![]:![]}];}return db[_0x47e9('0x78')][_0x47e9('0x58')](_0x4d02ea);})[_0x47e9('0x24')](function(_0x154d5a){_0x36bf41[_0x47e9('0x59')]=_0x154d5a;return _0x36bf41;});}})[_0x47e9('0x24')](respondWithFilteredResult(_0x1f9611,_0x4d02ea))[_0x47e9('0x2e')](handleError(_0x1f9611,null));};exports['addApplications']=function(_0x23138e,_0x599fd5){var _0x553ad5=_0x23138e['params']['id'];var _0x20eeb5=_0x23138e['body'];var _0x33aa44=0xc8;var _0x2abddc=null;return db[_0x47e9('0x82')]['transaction']({'isolationLevel':db[_0x47e9('0x82')][_0x47e9('0x83')]['ISOLATION_LEVELS'][_0x47e9('0x84')]},function(_0x523ffc){return db['FaxAccount'][_0x47e9('0x70')]({'where':{'id':_0x553ad5},'transaction':_0x523ffc})[_0x47e9('0x24')](function(_0x42f591){if(_0x42f591){return db[_0x47e9('0x85')][_0x47e9('0x3b')]({'where':{'FaxAccountId':_0x553ad5},'transaction':_0x523ffc})['then'](function(){var _0x282dc6=_[_0x47e9('0x3f')](_0x20eeb5,function(_0x3737f0){_0x3737f0['FaxAccountId']=_0x553ad5;return _0x3737f0;});return db[_0x47e9('0x85')][_0x47e9('0x86')](_0x282dc6,{'transaction':_0x523ffc});});}else{_0x33aa44=0x194;_0x2abddc=[];}});})[_0x47e9('0x24')](function(){if(_0x33aa44!==0x194){return db[_0x47e9('0x85')][_0x47e9('0x87')]({'where':{'FaxAccountId':_0x553ad5},'order':_0x47e9('0x88')})[_0x47e9('0x24')](function(_0xcaa2a7){_0x2abddc=_0xcaa2a7;});}})['catch'](function(_0x506de2){_0x33aa44=0x1f4;logger[_0x47e9('0x2a')](_0x506de2[_0x47e9('0x3c')]);if(_0x506de2['name']){delete _0x506de2[_0x47e9('0x54')];}_0x2abddc=_0x506de2;})[_0x47e9('0x89')](function(){if(_0x2abddc===null){_0x599fd5[_0x47e9('0x2f')](_0x33aa44);}else{if(_0x33aa44===0x1f4){_0x599fd5[_0x47e9('0x30')](_0x33aa44)[_0x47e9('0x8a')](_0x2abddc);}else{_0x599fd5[_0x47e9('0x30')](_0x33aa44)[_0x47e9('0x8b')](_0x2abddc);}}});};exports[_0x47e9('0x8c')]=function(_0x5d7d68,_0x3a46af,_0x534c4b){var _0x531d56={};var _0x5c379d={};var _0x5a6141;var _0x1b2419;return db[_0x47e9('0x40')]['findOne']({'where':{'id':_0x5d7d68['params']['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x3a46af,null))['then'](function(_0x5b0f2a){if(_0x5b0f2a){_0x5a6141=_0x5b0f2a;_0x5c379d[_0x47e9('0x45')]=_['keys'](db[_0x47e9('0x85')]['rawAttributes']);_0x5c379d['query']=_[_0x47e9('0x47')](_0x5d7d68[_0x47e9('0x46')]);_0x5c379d[_0x47e9('0x48')]=_[_0x47e9('0x49')](_0x5c379d[_0x47e9('0x45')],_0x5c379d[_0x47e9('0x46')]);_0x531d56['attributes']=_[_0x47e9('0x49')](_0x5c379d[_0x47e9('0x45')],qs[_0x47e9('0x4b')](_0x5d7d68[_0x47e9('0x46')]['fields']));_0x531d56['attributes']=_0x531d56['attributes']['length']?_0x531d56[_0x47e9('0x4a')]:_0x5c379d[_0x47e9('0x45')];_0x531d56[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x5d7d68[_0x47e9('0x46')][_0x47e9('0x4f')]);_0x531d56[_0x47e9('0x50')]=qs['filters'](_['pick'](_0x5d7d68[_0x47e9('0x46')],_0x5c379d[_0x47e9('0x48')]));if(_0x5d7d68[_0x47e9('0x46')][_0x47e9('0x52')]){_0x531d56[_0x47e9('0x50')]=_[_0x47e9('0x55')](_0x531d56[_0x47e9('0x50')],{'$or':_[_0x47e9('0x3f')](_0x531d56['attributes'],function(_0x131cd9){var _0x4ab12d={};_0x4ab12d[_0x131cd9]={'$like':'%'+_0x5d7d68[_0x47e9('0x46')][_0x47e9('0x52')]+'%'};return _0x4ab12d;})});}_0x531d56=_[_0x47e9('0x55')]({},_0x531d56,_0x5d7d68[_0x47e9('0x56')]);return _0x5a6141[_0x47e9('0x8c')](_0x531d56);}})['then'](function(_0x179925){if(_0x179925){_0x1b2419=_0x179925['length'];if(!_0x5d7d68[_0x47e9('0x46')][_0x47e9('0x75')]('nolimit')){_0x531d56[_0x47e9('0x32')]=qs[_0x47e9('0x32')](_0x5d7d68[_0x47e9('0x46')][_0x47e9('0x32')]);_0x531d56[_0x47e9('0x35')]=qs['offset'](_0x5d7d68[_0x47e9('0x46')]['offset']);}return _0x5a6141[_0x47e9('0x8c')](_0x531d56);}})[_0x47e9('0x24')](function(_0x430321){if(_0x430321){return _0x430321?{'count':_0x1b2419,'rows':_0x430321}:null;}})[_0x47e9('0x24')](respondWithResult(_0x3a46af,null))[_0x47e9('0x2e')](handleError(_0x3a46af,null));};function Extension(_0x498067,_0x59cc93,_0x50a750,_0x17d230){this[_0x47e9('0x8d')]='from-voip-provider';this[_0x47e9('0x8e')]=_0x498067[_0x47e9('0x8f')];this[_0x47e9('0x90')]=_0x17d230;this[_0x47e9('0x43')]='system';this[_0x47e9('0x91')]=_0x47e9('0x92');this[_0x47e9('0x6d')]=_0x498067['id'];this[_0x47e9('0x88')]=_0x59cc93;this[_0x47e9('0x93')]=_0x50a750;}function createExtensionsReciveFax(_0xfc99c1){var _0x5314a8=0x1;var _0x41beeb=[];_0x41beeb['push'](new Extension(_0xfc99c1,_0x5314a8,'',_0x47e9('0x94')));_0x5314a8+=0x1;_0x41beeb[_0x47e9('0x95')](new Extension(_0xfc99c1,_0x5314a8,_0x47e9('0x96'),_0x47e9('0x97')));_0x5314a8+=0x1;for(var _0x3671d9 in _0xfc99c1){if(_0xfc99c1[_0x47e9('0x75')](_0x3671d9)&&(_0x3671d9===_0x47e9('0x98')||_0x3671d9===_0x47e9('0x8f')||_0x3671d9===_0x47e9('0x99')||_0x3671d9===_0x47e9('0x9a')||_0x3671d9===_0x47e9('0x9b')||_0x3671d9==='maxrate'||_0x3671d9===_0x47e9('0x9c')||_0x3671d9==='modem'||_0x3671d9===_0x47e9('0x9d'))){_0x41beeb[_0x47e9('0x95')](new Extension(_0xfc99c1,_0x5314a8,'FAXOPT('+_0x3671d9+')='+_0xfc99c1[_0x3671d9],'Set'));_0x5314a8+=0x1;}}_0x41beeb[_0x47e9('0x95')](new Extension(_0xfc99c1,_0x5314a8,'6','Wait'));_0x5314a8+=0x1;_0x41beeb[_0x47e9('0x95')](new Extension(_0xfc99c1,_0x5314a8,_0x47e9('0x9e'),'ReceiveFax'));_0x5314a8=0x0;return _0x41beeb;}exports['addAccountApplications']=function(_0x231424,_0x48b823,_0x3e18ca){var _0x4e1f2e;return db[_0x47e9('0x82')][_0x47e9('0x9f')](function(_0x48d0f3){return db[_0x47e9('0x40')][_0x47e9('0x5f')](_0x231424[_0x47e9('0x6a')],{'transaction':_0x48d0f3})[_0x47e9('0x24')](function(_0x50f43b){_0x4e1f2e=_0x50f43b[_0x47e9('0x61')]({'plain':!![]});return db[_0x47e9('0xa0')][_0x47e9('0x86')](createExtensionsReciveFax(_0x4e1f2e),{'transaction':_0x48d0f3});});})[_0x47e9('0x24')](function(){return _0x4e1f2e;})[_0x47e9('0x24')](respondWithResult(_0x48b823,null))[_0x47e9('0x2e')](handleError(_0x48b823,null));};exports[_0x47e9('0xa1')]=function(_0x249957,_0x8bac2d,_0x29c640){var _0x16dd18;return db[_0x47e9('0x82')][_0x47e9('0x9f')](function(_0x481697){return db[_0x47e9('0x40')]['update'](_0x249957[_0x47e9('0x6a')],{'where':{'id':_0x249957[_0x47e9('0x6a')]['id']},'transaction':_0x481697})[_0x47e9('0x24')](function(_0x436dfc){return db['VoiceExtension'][_0x47e9('0x3b')]({'where':{'FaxAccountId':_0x249957[_0x47e9('0x6a')]['id']},'transaction':_0x481697})[_0x47e9('0x24')](function(_0x24d844){return db[_0x47e9('0xa0')][_0x47e9('0x86')](createExtensionsReciveFax(_[_0x47e9('0xa2')](_0x249957[_0x47e9('0x6a')],[_0x47e9('0xa3'),_0x47e9('0x44'),_0x47e9('0xa4'),'updatedAt','TrunkId','ListId'])),{'transaction':_0x481697});});});})['then'](function(){return db[_0x47e9('0x40')][_0x47e9('0xa5')](_0x249957[_0x47e9('0x6a')]['id']);})[_0x47e9('0x24')](respondWithResult(_0x8bac2d,null))[_0x47e9('0x2e')](handleError(_0x8bac2d,null));};exports[_0x47e9('0xa6')]=function(_0x527fec,_0x117f1e,_0x3f4598){var _0x545cdd={'raw':!![],'where':{}};var _0x10066d={};var _0x245bb6={'count':0x0,'rows':[]};return db[_0x47e9('0x40')][_0x47e9('0x70')]({'where':{'id':_0x527fec[_0x47e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x117f1e,null))[_0x47e9('0x24')](function(_0x50e55d){if(_0x50e55d){_0x10066d[_0x47e9('0x45')]=_[_0x47e9('0x47')](db[_0x47e9('0xa7')][_0x47e9('0x41')]);_0x10066d[_0x47e9('0x46')]=_[_0x47e9('0x47')](_0x527fec[_0x47e9('0x46')]);_0x10066d[_0x47e9('0x48')]=_['intersection'](_0x10066d[_0x47e9('0x45')],_0x10066d[_0x47e9('0x46')]);_0x545cdd['attributes']=_[_0x47e9('0x49')](_0x10066d[_0x47e9('0x45')],qs['fields'](_0x527fec[_0x47e9('0x46')][_0x47e9('0x4b')]));_0x545cdd[_0x47e9('0x4a')]=_0x545cdd[_0x47e9('0x4a')][_0x47e9('0x4c')]?_0x545cdd['attributes']:_0x10066d[_0x47e9('0x45')];if(!_0x527fec['query'][_0x47e9('0x75')](_0x47e9('0x4d'))){_0x545cdd[_0x47e9('0x32')]=qs[_0x47e9('0x32')](_0x527fec[_0x47e9('0x46')][_0x47e9('0x32')]);_0x545cdd[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x527fec[_0x47e9('0x46')][_0x47e9('0x35')]);}_0x545cdd[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x527fec[_0x47e9('0x46')][_0x47e9('0x4f')]);_0x545cdd[_0x47e9('0x50')]=qs[_0x47e9('0x48')](_[_0x47e9('0x51')](_0x527fec[_0x47e9('0x46')],_0x10066d[_0x47e9('0x48')]));_0x545cdd['where'][_0x47e9('0x6d')]=_0x50e55d['id'];if(_0x527fec['query'][_0x47e9('0x52')]){_0x545cdd['where']=_[_0x47e9('0x55')](_0x545cdd['where'],{'$or':_[_0x47e9('0x3f')](_0x545cdd[_0x47e9('0x4a')],function(_0x115c3b){var _0x4f7550={};_0x4f7550[_0x115c3b]={'$like':'%'+_0x527fec[_0x47e9('0x46')][_0x47e9('0x52')]+'%'};return _0x4f7550;})});}if(_0x527fec['query']['$gte']){var _0x44b090=_0x527fec['query']['$gte']['split'](',');var _0x219eee={};_0x219eee[_0x44b090[0x0]]={'$gte':moment(_0x44b090[0x1])[_0x47e9('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x545cdd['where']=_[_0x47e9('0x55')](_0x545cdd['where'],_0x219eee);}_0x545cdd=_[_0x47e9('0x55')]({},_0x545cdd,_0x527fec['options']);return db[_0x47e9('0xa7')][_0x47e9('0x34')]({'where':_0x545cdd[_0x47e9('0x50')]})[_0x47e9('0x24')](function(_0x401b00){_0x245bb6['count']=_0x401b00;if(_0x527fec[_0x47e9('0x46')]['includeAll']){_0x545cdd[_0x47e9('0x57')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x545cdd);})[_0x47e9('0x24')](function(_0x4f8f09){_0x245bb6['rows']=_0x4f8f09;return _0x245bb6;});}})[_0x47e9('0x24')](respondWithFilteredResult(_0x117f1e,_0x545cdd))[_0x47e9('0x2e')](handleError(_0x117f1e,null));};exports[_0x47e9('0x8a')]=function(_0x36419e,_0xdfc4ff,_0x3bdf52){var _0x3f7d9a,_0x472abb={},_0x3bf410;if(_0x36419e[_0x47e9('0x6a')]['to']){_0x3bf410=_0x36419e['body']['to'][0x0];}return db[_0x47e9('0x40')][_0x47e9('0x5e')]({'where':{'id':_0x36419e[_0x47e9('0x5b')]['id']},'include':[{'model':db[_0x47e9('0xa9')],'as':_0x47e9('0xaa'),'include':[{'model':db[_0x47e9('0x7a')],'as':_0x47e9('0xab'),'where':{'fax':_0x3bf410},'limit':0x1,'order':[[_0x47e9('0xac'),_0x47e9('0xad')]]}]}]})['then'](handleEntityNotFound(_0xdfc4ff,null))[_0x47e9('0x24')](function(_0x1f4dbc){_0x3f7d9a=_0x1f4dbc;if(_0x36419e['body'][_0x47e9('0xae')]&&_0x36419e['body'][_0x47e9('0xae')]['length']){for(var _0x357218=0x0;_0x357218<_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][_0x47e9('0x4c')];_0x357218+=0x1){_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][_0x357218]={'filename':_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][_0x357218][_0x47e9('0x54')],'id':_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][_0x357218]['id'],'path':path[_0x47e9('0xaf')](config[_0x47e9('0xb0')],'server/files/attachments',_0x36419e[_0x47e9('0x6a')]['attachments'][_0x357218][_0x47e9('0xb1')])};}}return respondWithRpcPromise(_0x47e9('0xb2'),_0x47e9('0xb2'),{'FaxAccountId':_[_0x47e9('0xb3')](_0x36419e[_0x47e9('0x5b')]['id'])?undefined:_0x36419e[_0x47e9('0x5b')]['id'],'path':_[_0x47e9('0xb3')](_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0][_0x47e9('0x8')])?undefined:_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0][_0x47e9('0x8')],'fax':_[_0x47e9('0xb3')](_0x36419e[_0x47e9('0x6a')]['to'][0x0])?undefined:_0x36419e[_0x47e9('0x6a')]['to'][0x0]},client9002);})[_0x47e9('0x24')](function(){if(_0x3f7d9a){if(_['isNil'](_0x36419e[_0x47e9('0x6a')][_0x47e9('0xb4')])){_0x36419e[_0x47e9('0x6a')][_0x47e9('0xb4')]=util[_0x47e9('0xa8')](_0x47e9('0xb5'),_0x3f7d9a[_0x47e9('0x54')],_0x3f7d9a[_0x47e9('0xb6')]);}if(_0x3f7d9a[_0x47e9('0xaa')]){if(_0x3f7d9a[_0x47e9('0xaa')][_0x47e9('0xab')]['length']){return _0x3f7d9a[_0x47e9('0xaa')][_0x47e9('0xab')][0x0];}else{return db[_0x47e9('0x7a')][_0x47e9('0x5f')](_[_0x47e9('0x1b')](_0x36419e[_0x47e9('0x6a')],{'firstName':_0x36419e[_0x47e9('0x6a')]['to'][0x0],'phone':_0x36419e[_0x47e9('0x6a')]['to'][0x0],'fax':_0x36419e['body']['to'][0x0],'ListId':_0x3f7d9a[_0x47e9('0xb7')]}));}}else{throw new Error(_0x47e9('0xb8'));}}else{throw new Error(_0x47e9('0xb9'));}})['then'](function(_0x44ff88){if(_0x44ff88){return db[_0x47e9('0x78')][_0x47e9('0x5e')]({'where':{'ContactId':_0x44ff88['id'],'closed':![],'FaxAccountId':_0x3f7d9a['id']}})[_0x47e9('0x24')](function(_0x20324e){if(_0x20324e){return[_0x20324e,![]];}return db[_0x47e9('0x78')][_0x47e9('0x5f')]({'UserId':_0x36419e[_0x47e9('0x60')]['id'],'ContactId':_0x44ff88['id'],'FaxAccountId':_0x3f7d9a['id'],'fax':_0x36419e[_0x47e9('0x6a')]['to'][0x0],'firstMsgDirection':_0x47e9('0xba'),'Messages':[_['merge'](_0x36419e['body'],{'read':![],'body':_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0][_0x47e9('0xbb')],'FaxAccountId':_0x3f7d9a['id'],'UserId':_0x36419e[_0x47e9('0x60')]['id'],'ContactId':_0x44ff88['id'],'AttachmentId':_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0]['id']})]},{'include':[{'model':db[_0x47e9('0xa7')],'as':'Messages'}]})[_0x47e9('0x24')](function(_0x293d4c){return[_0x293d4c,!![]];});});}else{throw new Error(_0x47e9('0xbc'));}})[_0x47e9('0xbd')](function(_0x27e712,_0x2f81a6){if(_0x2f81a6){return _0x27e712;}return db[_0x47e9('0xa7')][_0x47e9('0x5f')]({'direction':'out','read':![],'body':_0x36419e['body'][_0x47e9('0xae')][0x0]['filename'],'FaxAccountId':_0x3f7d9a['id'],'FaxInteractionId':_0x27e712['id'],'UserId':_0x36419e[_0x47e9('0x60')]['id'],'ContactId':_0x27e712['ContactId'],'AttachmentId':_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0]['id']})[_0x47e9('0x24')](function(_0x46cba0){_0x27e712[_0x47e9('0xbe')][_0x47e9('0xbf')]=[];_0x27e712[_0x47e9('0xbe')][_0x47e9('0xbf')]['push'](_0x46cba0[_0x47e9('0xbe')]);return _0x27e712;});})[_0x47e9('0x24')](function(_0x176175){respondWithRpcPromise(_0x47e9('0xc0'),_0x47e9('0xc0'),{'FaxAccountId':_[_0x47e9('0xb3')](_0x36419e[_0x47e9('0x5b')]['id'])?undefined:_0x36419e[_0x47e9('0x5b')]['id'],'path':_['isNil'](_0x36419e['body']['attachments'][0x0][_0x47e9('0x8')])?undefined:_0x36419e[_0x47e9('0x6a')][_0x47e9('0xae')][0x0]['path'],'fax':_[_0x47e9('0xb3')](_0x36419e[_0x47e9('0x6a')]['to'][0x0])?undefined:_0x36419e['body']['to'][0x0],'AttachmentId':_0x36419e['body'][_0x47e9('0xae')][0x0]['id']},client9002)['then'](function(_0x196a91){logger['info'](_0x47e9('0xc1'),_0x196a91);})['catch'](function(_0x5c0331){logger[_0x47e9('0x25')](_0x47e9('0xc1'),_0x5c0331);});return _0x176175;})[_0x47e9('0x24')](respondWithResult(_0xdfc4ff,null))[_0x47e9('0x2e')](handleError(_0xdfc4ff,null));};exports[_0x47e9('0xc2')]=function(_0x193662,_0x468a38,_0x587aa0){return db['FaxAccount']['find']({'where':{'id':_0x193662[_0x47e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x468a38,null))[_0x47e9('0x24')](function(_0x82c218){if(_0x82c218){return _0x82c218[_0x47e9('0xc2')](_0x193662[_0x47e9('0x6a')][_0x47e9('0x72')],_[_0x47e9('0xa2')](_0x193662[_0x47e9('0x6a')],['ids','id'])||{})[_0x47e9('0xbd')](function(_0xfab285){for(var _0x1f8859=0x0;_0x1f8859<_0x193662[_0x47e9('0x6a')][_0x47e9('0x72')]['length'];_0x1f8859+=0x1){socket[_0x47e9('0xc3')](_0x47e9('0xc4'),{'UserId':Number(_0x193662[_0x47e9('0x6a')][_0x47e9('0x72')][_0x1f8859]),'FaxAccountId':Number(_0x193662[_0x47e9('0x5b')]['id'])});}return _0xfab285;});}})[_0x47e9('0x24')](respondWithResult(_0x468a38,null))[_0x47e9('0x2e')](handleError(_0x468a38,null));};exports['removeAgents']=function(_0x2f4bb3,_0x3b58fc,_0x11e39b){return db[_0x47e9('0x40')][_0x47e9('0x5e')]({'where':{'id':_0x2f4bb3[_0x47e9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b58fc,null))[_0x47e9('0x24')](function(_0x5a46b8){if(_0x5a46b8){return _0x5a46b8['removeAgents'](_0x2f4bb3[_0x47e9('0x46')]['ids'])[_0x47e9('0x24')](function(){if(_[_0x47e9('0xc5')](_0x2f4bb3[_0x47e9('0x46')][_0x47e9('0x72')])){for(var _0x388729=0x0;_0x388729<_0x2f4bb3[_0x47e9('0x46')][_0x47e9('0x72')]['length'];_0x388729+=0x1){socket[_0x47e9('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x2f4bb3[_0x47e9('0x46')][_0x47e9('0x72')][_0x388729]),'FaxAccountId':Number(_0x2f4bb3[_0x47e9('0x5b')]['id'])});}}else{socket[_0x47e9('0xc3')](_0x47e9('0xc6'),{'UserId':Number(_0x2f4bb3[_0x47e9('0x46')][_0x47e9('0x72')]),'FaxAccountId':Number(_0x2f4bb3[_0x47e9('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3b58fc,null))[_0x47e9('0x2e')](handleError(_0x3b58fc,null));};exports[_0x47e9('0xc7')]=function(_0x3950e6,_0x247edb,_0x23bb25){var _0x362b57={};var _0x27c207={};var _0x297281;var _0x40545b;return db[_0x47e9('0x40')]['findOne']({'where':{'id':_0x3950e6[_0x47e9('0x5b')]['id']}})[_0x47e9('0x24')](handleEntityNotFound(_0x247edb,null))[_0x47e9('0x24')](function(_0xe02497){if(_0xe02497){_0x297281=_0xe02497;_0x27c207[_0x47e9('0x45')]=_[_0x47e9('0x47')](db[_0x47e9('0x7c')][_0x47e9('0x41')]);_0x27c207[_0x47e9('0x46')]=_['keys'](_0x3950e6['query']);_0x27c207['filters']=_[_0x47e9('0x49')](_0x27c207['model'],_0x27c207[_0x47e9('0x46')]);_0x362b57[_0x47e9('0x4a')]=_[_0x47e9('0x49')](_0x27c207['model'],qs[_0x47e9('0x4b')](_0x3950e6[_0x47e9('0x46')][_0x47e9('0x4b')]));_0x362b57[_0x47e9('0x4a')]=_0x362b57[_0x47e9('0x4a')]['length']?_0x362b57[_0x47e9('0x4a')]:_0x27c207['model'];_0x362b57[_0x47e9('0x4e')]=qs[_0x47e9('0x4f')](_0x3950e6[_0x47e9('0x46')]['sort']);_0x362b57[_0x47e9('0x50')]=qs[_0x47e9('0x48')](_[_0x47e9('0x51')](_0x3950e6[_0x47e9('0x46')],_0x27c207['filters']));if(_0x3950e6[_0x47e9('0x46')][_0x47e9('0x52')]){_0x362b57[_0x47e9('0x50')]=_['merge'](_0x362b57[_0x47e9('0x50')],{'$or':_[_0x47e9('0x3f')](_0x362b57[_0x47e9('0x4a')],function(_0x50a8bb){var _0x2b9bd6={};_0x2b9bd6[_0x50a8bb]={'$like':'%'+_0x3950e6[_0x47e9('0x46')][_0x47e9('0x52')]+'%'};return _0x2b9bd6;})});}_0x362b57=_[_0x47e9('0x55')]({},_0x362b57,_0x3950e6[_0x47e9('0x56')]);return _0x297281['getAgents'](_0x362b57);}})[_0x47e9('0x24')](function(_0x1d9d29){if(_0x1d9d29){_0x40545b=_0x1d9d29[_0x47e9('0x4c')];if(!_0x3950e6[_0x47e9('0x46')][_0x47e9('0x75')](_0x47e9('0x4d'))){_0x362b57[_0x47e9('0x32')]=qs[_0x47e9('0x32')](_0x3950e6[_0x47e9('0x46')][_0x47e9('0x32')]);_0x362b57[_0x47e9('0x35')]=qs[_0x47e9('0x35')](_0x3950e6['query'][_0x47e9('0x35')]);}return _0x297281[_0x47e9('0xc7')](_0x362b57);}})[_0x47e9('0x24')](function(_0x2febc0){if(_0x2febc0){return _0x2febc0?{'count':_0x40545b,'rows':_0x2febc0}:null;}})[_0x47e9('0x24')](respondWithResult(_0x247edb,null))[_0x47e9('0x2e')](handleError(_0x247edb,null));}; \ No newline at end of file +var _0x2531=['priority','finally','getApplications','from-voip-provider','localstationid','system','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/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','bulkCreate','updateAccountApplications','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','merge','type','VIRTUAL','filter','options','where','include','findAll','rows','catch','show','keys','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addDisposition','getDispositions','findOne','rawAttributes','length','pick','FaxAccountId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll'];(function(_0x59a549,_0x2fe2bb){var _0x12adbe=function(_0x2ccd1e){while(--_0x2ccd1e){_0x59a549['push'](_0x59a549['shift']());}};_0x12adbe(++_0x2fe2bb);}(_0x2531,0x101));var _0x1253=function(_0x21341d,_0x584b18){_0x21341d=_0x21341d-0x0;var _0x312dc8=_0x2531[_0x21341d];return _0x312dc8;};'use strict';var emlformat=require(_0x1253('0x0'));var rimraf=require(_0x1253('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1253('0x2'));var moment=require(_0x1253('0x3'));var BPromise=require(_0x1253('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1253('0x5'));var csv=require(_0x1253('0x6'));var ejs=require(_0x1253('0x7'));var fs=require('fs');var fs_extra=require(_0x1253('0x8'));var _=require(_0x1253('0x9'));var squel=require(_0x1253('0xa'));var crypto=require('crypto');var jsforce=require(_0x1253('0xb'));var deskjs=require(_0x1253('0xc'));var toCsv=require(_0x1253('0x6'));var querystring=require(_0x1253('0xd'));var Papa=require(_0x1253('0xe'));var Redis=require(_0x1253('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1253('0x10'));var as=require(_0x1253('0x11'));var hardwareService=require(_0x1253('0x12'));var logger=require('../../config/logger')(_0x1253('0x13'));var utils=require(_0x1253('0x14'));var config=require(_0x1253('0x15'));var licenseUtil=require(_0x1253('0x16'));var db=require(_0x1253('0x17'))['db'];config[_0x1253('0x18')]=_[_0x1253('0x19')](config['redis'],{'host':_0x1253('0x1a'),'port':0x18eb});var socket=require(_0x1253('0x1b'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x1253('0x1c')](socket);var jayson=require(_0x1253('0x1d'));var client=jayson[_0x1253('0x1e')][_0x1253('0x1f')]({'port':0x232c});var client9002=jayson[_0x1253('0x1e')][_0x1253('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x320508,_0x1af02d,_0xaa3aa7,_0x542ce2){return new BPromise(function(_0x3164dd,_0x29595c){var _0x777ef=_0x542ce2||client;return _0x777ef['request'](_0x320508,_0xaa3aa7)[_0x1253('0x20')](function(_0x481513){logger[_0x1253('0x21')](_0x1253('0x22'),_0x1af02d,_0x1253('0x23'));logger[_0x1253('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1af02d,_0x1253('0x23'),JSON['stringify'](_0x481513));if(_0x481513[_0x1253('0x25')]){if(_0x481513[_0x1253('0x25')][_0x1253('0x26')]===0x1f4){logger['error'](_0x1253('0x22'),_0x1af02d,_0x481513[_0x1253('0x25')][_0x1253('0x27')]);return _0x29595c(_0x481513[_0x1253('0x25')][_0x1253('0x27')]);}logger[_0x1253('0x25')](_0x1253('0x22'),_0x1af02d,_0x481513[_0x1253('0x25')][_0x1253('0x27')]);return _0x3164dd(_0x481513[_0x1253('0x25')]['message']);}else{logger[_0x1253('0x21')](_0x1253('0x22'),_0x1af02d,_0x1253('0x23'));_0x3164dd(_0x481513[_0x1253('0x28')][_0x1253('0x27')]);}})['catch'](function(_0x392ac9){logger[_0x1253('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1af02d,_0x392ac9);_0x29595c(_0x392ac9);});});}function respondWithStatusCode(_0x289147,_0x21e59c){_0x21e59c=_0x21e59c||0xcc;return function(_0x66cc94){if(_0x66cc94){return _0x289147[_0x1253('0x29')](_0x21e59c);}return _0x289147[_0x1253('0x2a')](_0x21e59c)[_0x1253('0x2b')]();};}function respondWithResult(_0x13d562,_0x3619f7){_0x3619f7=_0x3619f7||0xc8;return function(_0x12e8b3){if(_0x12e8b3){return _0x13d562[_0x1253('0x2a')](_0x3619f7)[_0x1253('0x2c')](_0x12e8b3);}};}function respondWithFilteredResult(_0x27d943,_0x12f009){return function(_0x5d1d4f){if(_0x5d1d4f){var _0x4674cb=typeof _0x12f009[_0x1253('0x2d')]==='undefined'&&typeof _0x12f009[_0x1253('0x2e')]===_0x1253('0x2f');var _0x41b064=_0x5d1d4f['count'];var _0x2db692=_0x4674cb?0x0:_0x12f009[_0x1253('0x2d')];var _0x43804c=_0x4674cb?_0x5d1d4f[_0x1253('0x30')]:_0x12f009[_0x1253('0x2d')]+_0x12f009[_0x1253('0x2e')];var _0xb7e480;if(_0x43804c>=_0x41b064){_0x43804c=_0x41b064;_0xb7e480=0xc8;}else{_0xb7e480=0xce;}_0x27d943[_0x1253('0x2a')](_0xb7e480);return _0x27d943[_0x1253('0x31')](_0x1253('0x32'),_0x2db692+'-'+_0x43804c+'/'+_0x41b064)[_0x1253('0x2c')](_0x5d1d4f);}return null;};}function patchUpdates(_0x43046c){return function(_0x9b39af){try{jsonpatch['apply'](_0x9b39af,_0x43046c,!![]);}catch(_0x32ecd7){return BPromise['reject'](_0x32ecd7);}return _0x9b39af[_0x1253('0x33')]();};}function saveUpdates(_0x45dc7e,_0x53a321){return function(_0x15bb88){if(_0x15bb88){return _0x15bb88['update'](_0x45dc7e)[_0x1253('0x20')](function(_0x21308f){return _0x21308f;});}return null;};}function removeEntity(_0x203fdf,_0x483a58){return function(_0xde245c){if(_0xde245c){return _0xde245c[_0x1253('0x34')]()[_0x1253('0x20')](function(){var _0x198863=_0xde245c[_0x1253('0x35')]({'plain':!![]});var _0x45826d=_0x1253('0x36');return db[_0x1253('0x37')][_0x1253('0x34')]({'where':{'type':_0x45826d,'resourceId':_0x198863['id']}})[_0x1253('0x20')](function(){return _0xde245c;});})[_0x1253('0x20')](function(){_0x203fdf[_0x1253('0x2a')](0xcc)[_0x1253('0x2b')]();});}};}function handleEntityNotFound(_0x2f7938,_0x1ae4e0){return function(_0x39e282){if(!_0x39e282){_0x2f7938[_0x1253('0x29')](0x194);}return _0x39e282;};}function handleError(_0x35dcd9,_0x57fc8c){_0x57fc8c=_0x57fc8c||0x1f4;return function(_0xdbab48){logger[_0x1253('0x25')](_0xdbab48[_0x1253('0x38')]);if(_0xdbab48['name']){delete _0xdbab48[_0x1253('0x39')];}_0x35dcd9['status'](_0x57fc8c)[_0x1253('0x3a')](_0xdbab48);};}exports[_0x1253('0x3b')]=function(_0xe31ac0,_0x31b920){var _0x1765a6={'include':[{'model':db[_0x1253('0x3c')],'as':_0x1253('0x3d')}]},_0xd68b20={},_0x504d7e={'count':0x0,'rows':[]};var _0x34372c=_['map'](db[_0x1253('0x3e')]['rawAttributes'],function(_0x16df2e){return{'name':_0x16df2e[_0x1253('0x3f')],'type':_0x16df2e['type'][_0x1253('0x40')]};});_0xd68b20[_0x1253('0x41')]=_[_0x1253('0x42')](_0x34372c,_0x1253('0x39'));_0xd68b20[_0x1253('0x43')]=_['keys'](_0xe31ac0[_0x1253('0x43')]);_0xd68b20['filters']=_[_0x1253('0x44')](_0xd68b20[_0x1253('0x41')],_0xd68b20['query']);_0x1765a6[_0x1253('0x45')]=_[_0x1253('0x44')](_0xd68b20[_0x1253('0x41')],qs[_0x1253('0x46')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x46')]));_0x1765a6[_0x1253('0x45')]=_0x1765a6['attributes']['length']?_0x1765a6[_0x1253('0x45')]:_0xd68b20['model'];if(!_0xe31ac0['query'][_0x1253('0x47')](_0x1253('0x48'))){_0x1765a6[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x2e')]);_0x1765a6[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x2d')]);}_0x1765a6[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x4a')]);_0x1765a6['where']=qs[_0x1253('0x4b')](_['pick'](_0xe31ac0[_0x1253('0x43')],_0xd68b20['filters']),_0x34372c);if(_0xe31ac0[_0x1253('0x43')]['filter']){_0x1765a6['where']=_[_0x1253('0x4c')](_0x1765a6['where'],{'$or':_['map'](_0x34372c,function(_0x4d6103){if(_0x4d6103[_0x1253('0x4d')]!==_0x1253('0x4e')){var _0x2134cb={};_0x2134cb[_0x4d6103[_0x1253('0x39')]]={'$like':'%'+_0xe31ac0[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x2134cb;}})});}_0x1765a6=_[_0x1253('0x4c')]({},_0x1765a6,_0xe31ac0[_0x1253('0x50')]);var _0x31be93={'where':_0x1765a6[_0x1253('0x51')]};return db[_0x1253('0x3e')][_0x1253('0x30')](_0x31be93)[_0x1253('0x20')](function(_0x1c2154){_0x504d7e[_0x1253('0x30')]=_0x1c2154;if(_0xe31ac0[_0x1253('0x43')]['includeAll']){_0x1765a6[_0x1253('0x52')]=[{'all':!![]}];}return db[_0x1253('0x3e')][_0x1253('0x53')](_0x1765a6);})[_0x1253('0x20')](function(_0x943348){_0x504d7e[_0x1253('0x54')]=_0x943348;return _0x504d7e;})[_0x1253('0x20')](respondWithFilteredResult(_0x31b920,_0x1765a6))[_0x1253('0x55')](handleError(_0x31b920,null));};exports[_0x1253('0x56')]=function(_0x2ac5da,_0xdb04af){var _0x5bcadf={'raw':![],'where':{'id':_0x2ac5da['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3d2c26={};_0x3d2c26[_0x1253('0x41')]=_[_0x1253('0x57')](db[_0x1253('0x3e')]['rawAttributes']);_0x3d2c26['query']=_[_0x1253('0x57')](_0x2ac5da[_0x1253('0x43')]);_0x3d2c26[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3d2c26[_0x1253('0x41')],_0x3d2c26[_0x1253('0x43')]);_0x5bcadf[_0x1253('0x45')]=_[_0x1253('0x44')](_0x3d2c26['model'],qs['fields'](_0x2ac5da[_0x1253('0x43')]['fields']));_0x5bcadf[_0x1253('0x45')]=_0x5bcadf[_0x1253('0x45')]['length']?_0x5bcadf['attributes']:_0x3d2c26[_0x1253('0x41')];if(_0x2ac5da['query'][_0x1253('0x58')]){_0x5bcadf[_0x1253('0x52')]=[{'all':!![]}];}_0x5bcadf=_['merge']({},_0x5bcadf,_0x2ac5da['options']);return db[_0x1253('0x3e')]['find'](_0x5bcadf)[_0x1253('0x20')](handleEntityNotFound(_0xdb04af,null))['then'](respondWithResult(_0xdb04af,null))[_0x1253('0x55')](handleError(_0xdb04af,null));};exports[_0x1253('0x59')]=function(_0x10bc2a,_0x52b8a5){return db[_0x1253('0x3e')][_0x1253('0x59')](_0x10bc2a['body'],{})[_0x1253('0x20')](function(_0x995a55){var _0x316359=_0x10bc2a['user'][_0x1253('0x35')]({'plain':!![]});if(!_0x316359)throw new Error(_0x1253('0x5a'));if(_0x316359[_0x1253('0x5b')]===_0x1253('0x5c')){var _0x2b6037=_0x995a55[_0x1253('0x35')]({'plain':!![]});var _0x1f6fca=_0x1253('0x36');return db[_0x1253('0x5d')][_0x1253('0x5e')]({'where':{'name':_0x1f6fca,'userProfileId':_0x316359[_0x1253('0x5f')]},'raw':!![]})[_0x1253('0x20')](function(_0x186307){if(_0x186307&&_0x186307[_0x1253('0x60')]===0x0){return db[_0x1253('0x37')][_0x1253('0x59')]({'name':_0x2b6037[_0x1253('0x39')],'resourceId':_0x2b6037['id'],'type':_0x186307[_0x1253('0x39')],'sectionId':_0x186307['id']},{})[_0x1253('0x20')](function(){return _0x995a55;});}else{return _0x995a55;}})[_0x1253('0x55')](function(_0x55559b){logger[_0x1253('0x25')](_0x1253('0x61'),_0x55559b);throw _0x55559b;});}return _0x995a55;})[_0x1253('0x20')](respondWithResult(_0x52b8a5,0xc9))['catch'](handleError(_0x52b8a5,null));};exports[_0x1253('0x62')]=function(_0x347607,_0x54808a){if(_0x347607[_0x1253('0x63')]['id']){delete _0x347607['body']['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x347607['params']['id']},'include':[{'model':db[_0x1253('0x3c')],'as':_0x1253('0x3d')}]})[_0x1253('0x20')](handleEntityNotFound(_0x54808a,null))[_0x1253('0x20')](saveUpdates(_0x347607['body'],null))[_0x1253('0x20')](respondWithResult(_0x54808a,null))[_0x1253('0x55')](handleError(_0x54808a,null));};exports[_0x1253('0x34')]=function(_0x1e2c84,_0x4c2415){return db['FaxAccount'][_0x1253('0x5e')]({'where':{'id':_0x1e2c84[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0x4c2415,null))['then'](removeEntity(_0x4c2415,null))['catch'](handleError(_0x4c2415,null));};exports['describe']=function(_0x32ac3b,_0x23acae){return db[_0x1253('0x3e')]['describe']()[_0x1253('0x20')](respondWithResult(_0x23acae,null))[_0x1253('0x55')](handleError(_0x23acae,null));};exports[_0x1253('0x65')]=function(_0x3b84c8,_0x59e1f1,_0x52788e){if(_0x3b84c8['body']['id']){delete _0x3b84c8[_0x1253('0x63')]['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x3b84c8[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x59e1f1,null))['then'](function(_0x5b27aa){if(_0x5b27aa){_0x3b84c8[_0x1253('0x63')]['FaxAccountId']=_0x5b27aa['id'];return db['Disposition'][_0x1253('0x59')](_0x3b84c8[_0x1253('0x63')]);}})['then'](respondWithResult(_0x59e1f1,null))[_0x1253('0x55')](handleError(_0x59e1f1,null));};exports[_0x1253('0x66')]=function(_0x1f1b12,_0x5cff51,_0x36a957){var _0x6460e2={'raw':![],'where':{}};var _0x1d452c={};var _0x5a1d91={'count':0x0,'rows':[]};return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x1f1b12[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0x5cff51,null))[_0x1253('0x20')](function(_0x3fa535){if(_0x3fa535){_0x1d452c[_0x1253('0x41')]=_[_0x1253('0x57')](db['Disposition'][_0x1253('0x68')]);_0x1d452c[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1f1b12[_0x1253('0x43')]);_0x1d452c[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x1d452c[_0x1253('0x41')],_0x1d452c[_0x1253('0x43')]);_0x6460e2[_0x1253('0x45')]=_['intersection'](_0x1d452c[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1f1b12[_0x1253('0x43')][_0x1253('0x46')]));_0x6460e2[_0x1253('0x45')]=_0x6460e2[_0x1253('0x45')][_0x1253('0x69')]?_0x6460e2[_0x1253('0x45')]:_0x1d452c[_0x1253('0x41')];if(!_0x1f1b12[_0x1253('0x43')][_0x1253('0x47')]('nolimit')){_0x6460e2[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x1f1b12['query'][_0x1253('0x2e')]);_0x6460e2[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x1f1b12[_0x1253('0x43')]['offset']);}_0x6460e2[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1f1b12[_0x1253('0x43')]['sort']);_0x6460e2[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x1f1b12['query'],_0x1d452c[_0x1253('0x4b')]));_0x6460e2[_0x1253('0x51')][_0x1253('0x6b')]=_0x3fa535['id'];if(_0x1f1b12[_0x1253('0x43')]['filter']){_0x6460e2['where']=_[_0x1253('0x4c')](_0x6460e2['where'],{'$or':_[_0x1253('0x42')](_0x6460e2[_0x1253('0x45')],function(_0x590d63){var _0x2304b2={};_0x2304b2[_0x590d63]={'$like':'%'+_0x1f1b12[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x2304b2;})});}_0x6460e2=_[_0x1253('0x4c')]({},_0x6460e2,_0x1f1b12[_0x1253('0x50')]);return db[_0x1253('0x6c')][_0x1253('0x30')]({'where':_0x6460e2[_0x1253('0x51')]})[_0x1253('0x20')](function(_0x3742c6){_0x5a1d91[_0x1253('0x30')]=_0x3742c6;if(_0x1f1b12[_0x1253('0x43')][_0x1253('0x58')]){_0x6460e2['include']=[{'all':!![]}];}return db['Disposition'][_0x1253('0x53')](_0x6460e2);})[_0x1253('0x20')](function(_0x4a840f){_0x5a1d91[_0x1253('0x54')]=_0x4a840f;return _0x5a1d91;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x5cff51,_0x6460e2))[_0x1253('0x55')](handleError(_0x5cff51,null));};exports[_0x1253('0x6d')]=function(_0x62ad31,_0x1ba3d8,_0x499dc0){return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x62ad31['params']['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x1ba3d8,null))[_0x1253('0x20')](function(_0x4a701f){if(_0x4a701f){return _0x4a701f['removeDispositions'](_0x62ad31[_0x1253('0x43')][_0x1253('0x6e')]);}})['then'](respondWithStatusCode(_0x1ba3d8,null))[_0x1253('0x55')](handleError(_0x1ba3d8,null));};exports['addAnswer']=function(_0x449506,_0x12af88,_0x20e7fb){if(_0x449506[_0x1253('0x63')]['id']){delete _0x449506[_0x1253('0x63')]['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x449506[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x12af88,null))[_0x1253('0x20')](function(_0x57dbd4){if(_0x57dbd4){_0x449506[_0x1253('0x63')][_0x1253('0x6b')]=_0x57dbd4['id'];return db[_0x1253('0x6f')][_0x1253('0x59')](_0x449506[_0x1253('0x63')]);}})['then'](respondWithResult(_0x12af88,null))[_0x1253('0x55')](handleError(_0x12af88,null));};exports[_0x1253('0x70')]=function(_0x1a3ea6,_0x2540e3,_0x47d304){var _0x15e16d={'raw':![],'where':{}};var _0x3a4c9d={};var _0x2b3d18={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x1a3ea6[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x2540e3,null))[_0x1253('0x20')](function(_0x14daee){if(_0x14daee){_0x3a4c9d['model']=_['keys'](db[_0x1253('0x6f')][_0x1253('0x68')]);_0x3a4c9d[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1a3ea6[_0x1253('0x43')]);_0x3a4c9d[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3a4c9d[_0x1253('0x41')],_0x3a4c9d[_0x1253('0x43')]);_0x15e16d['attributes']=_[_0x1253('0x44')](_0x3a4c9d[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x46')]));_0x15e16d['attributes']=_0x15e16d[_0x1253('0x45')][_0x1253('0x69')]?_0x15e16d['attributes']:_0x3a4c9d[_0x1253('0x41')];if(!_0x1a3ea6[_0x1253('0x43')][_0x1253('0x47')](_0x1253('0x48'))){_0x15e16d[_0x1253('0x2e')]=qs['limit'](_0x1a3ea6['query'][_0x1253('0x2e')]);_0x15e16d['offset']=qs[_0x1253('0x2d')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x2d')]);}_0x15e16d[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4a')]);_0x15e16d[_0x1253('0x51')]=qs[_0x1253('0x4b')](_['pick'](_0x1a3ea6[_0x1253('0x43')],_0x3a4c9d[_0x1253('0x4b')]));_0x15e16d[_0x1253('0x51')][_0x1253('0x6b')]=_0x14daee['id'];if(_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4f')]){_0x15e16d[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x15e16d[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x15e16d[_0x1253('0x45')],function(_0x344fd2){var _0x13fa28={};_0x13fa28[_0x344fd2]={'$like':'%'+_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x13fa28;})});}_0x15e16d=_[_0x1253('0x4c')]({},_0x15e16d,_0x1a3ea6[_0x1253('0x50')]);return db[_0x1253('0x6f')]['count']({'where':_0x15e16d['where']})[_0x1253('0x20')](function(_0x1e7a6f){_0x2b3d18[_0x1253('0x30')]=_0x1e7a6f;if(_0x1a3ea6[_0x1253('0x43')][_0x1253('0x58')]){_0x15e16d['include']=[{'all':!![]}];}return db[_0x1253('0x6f')][_0x1253('0x53')](_0x15e16d);})[_0x1253('0x20')](function(_0x1a483f){_0x2b3d18['rows']=_0x1a483f;return _0x2b3d18;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x2540e3,_0x15e16d))[_0x1253('0x55')](handleError(_0x2540e3,null));};exports[_0x1253('0x71')]=function(_0x507746,_0xe1f492,_0x1844df){return db[_0x1253('0x3e')]['find']({'where':{'id':_0x507746[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0xe1f492,null))[_0x1253('0x20')](function(_0xd8419b){if(_0xd8419b){return _0xd8419b[_0x1253('0x71')](_0x507746['query'][_0x1253('0x6e')]);}})[_0x1253('0x20')](respondWithStatusCode(_0xe1f492,null))[_0x1253('0x55')](handleError(_0xe1f492,null));};exports[_0x1253('0x72')]=function(_0x4473e4,_0x40e41e,_0x4cb167){return db[_0x1253('0x73')][_0x1253('0x5e')]({'where':{'id':_0x4473e4['params']['id']}})['then'](handleEntityNotFound(_0x40e41e,null))[_0x1253('0x20')](function(_0x9ec1eb){if(_0x9ec1eb){return _0x9ec1eb[_0x1253('0x72')](_0x4473e4[_0x1253('0x63')][_0x1253('0x6e')],_[_0x1253('0x74')](_0x4473e4[_0x1253('0x63')],[_0x1253('0x6e'),'id'])||{});}})[_0x1253('0x20')](respondWithResult(_0x40e41e,null))[_0x1253('0x55')](handleError(_0x40e41e,null));};exports[_0x1253('0x75')]=function(_0x86d8de,_0x318e2f,_0xae0481){var _0x41f6f0={'raw':![],'where':{}};var _0x2df2fd={};var _0x87eec5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x86d8de[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x318e2f,null))[_0x1253('0x20')](function(_0x2620c2){if(_0x2620c2){_0x2df2fd[_0x1253('0x41')]=_['keys'](db[_0x1253('0x73')][_0x1253('0x68')]);_0x2df2fd['query']=_[_0x1253('0x57')](_0x86d8de['query']);_0x2df2fd[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x2df2fd[_0x1253('0x41')],_0x2df2fd[_0x1253('0x43')]);_0x41f6f0[_0x1253('0x45')]=_[_0x1253('0x44')](_0x2df2fd['model'],qs[_0x1253('0x46')](_0x86d8de[_0x1253('0x43')][_0x1253('0x46')]));_0x41f6f0[_0x1253('0x45')]=_0x41f6f0['attributes'][_0x1253('0x69')]?_0x41f6f0[_0x1253('0x45')]:_0x2df2fd[_0x1253('0x41')];if(!_0x86d8de[_0x1253('0x43')]['hasOwnProperty'](_0x1253('0x48'))){_0x41f6f0[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x86d8de['query'][_0x1253('0x2e')]);_0x41f6f0[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x86d8de['query']['offset']);}_0x41f6f0[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x86d8de[_0x1253('0x43')][_0x1253('0x4a')]);_0x41f6f0[_0x1253('0x51')]=qs[_0x1253('0x4b')](_['pick'](_0x86d8de[_0x1253('0x43')],_0x2df2fd[_0x1253('0x4b')]));_0x41f6f0[_0x1253('0x51')]['FaxAccountId']=_0x2620c2['id'];if(_0x86d8de[_0x1253('0x43')][_0x1253('0x4f')]){_0x41f6f0[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x41f6f0[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x41f6f0[_0x1253('0x45')],function(_0x1b66e0){var _0x27c1dd={};_0x27c1dd[_0x1b66e0]={'$like':'%'+_0x86d8de[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x27c1dd;})});}_0x41f6f0=_[_0x1253('0x4c')]({},_0x41f6f0,_0x86d8de['options']);return db[_0x1253('0x73')]['count']({'where':_0x41f6f0[_0x1253('0x51')]})['then'](function(_0xc02cd7){_0x87eec5[_0x1253('0x30')]=_0xc02cd7;if(_0x86d8de[_0x1253('0x43')][_0x1253('0x58')]){_0x41f6f0[_0x1253('0x52')]=[{'model':db[_0x1253('0x76')],'as':_0x1253('0x77'),'required':![]},{'model':db['User'],'as':_0x1253('0x78'),'attributes':[_0x1253('0x39'),_0x1253('0x79'),_0x1253('0x7a')],'required':![]},{'model':db[_0x1253('0x7b')],'as':_0x1253('0x7c'),'attributes':['id',_0x1253('0x39'),'color'],'where':_0x86d8de[_0x1253('0x43')]['tag']?{'id':_0x86d8de[_0x1253('0x43')][_0x1253('0x7d')]}:undefined,'required':_0x86d8de['query'][_0x1253('0x7d')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x41f6f0);})[_0x1253('0x20')](function(_0x32bbb1){_0x87eec5[_0x1253('0x54')]=_0x32bbb1;return _0x87eec5;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x318e2f,_0x41f6f0))[_0x1253('0x55')](handleError(_0x318e2f,null));};exports[_0x1253('0x7e')]=function(_0x50c110,_0x55a92e){var _0xe7fee0=_0x50c110[_0x1253('0x64')]['id'];var _0x33595c=_0x50c110[_0x1253('0x63')];var _0x13516f=0xc8;var _0xeb78b5=null;return db['sequelize'][_0x1253('0x7f')]({'isolationLevel':db[_0x1253('0x80')][_0x1253('0x81')][_0x1253('0x82')]['READ_COMMITTED']},function(_0xd04ebe){return db[_0x1253('0x3e')]['findOne']({'where':{'id':_0xe7fee0},'transaction':_0xd04ebe})['then'](function(_0x502c93){if(_0x502c93){return db[_0x1253('0x83')][_0x1253('0x34')]({'where':{'FaxAccountId':_0xe7fee0},'transaction':_0xd04ebe})[_0x1253('0x20')](function(){var _0x5138dc=_['map'](_0x33595c,function(_0x5bebce){_0x5bebce['FaxAccountId']=_0xe7fee0;return _0x5bebce;});return db['FaxApplication']['bulkCreate'](_0x5138dc,{'transaction':_0xd04ebe});});}else{_0x13516f=0x194;_0xeb78b5=[];}});})[_0x1253('0x20')](function(){if(_0x13516f!==0x194){return db[_0x1253('0x83')][_0x1253('0x84')]({'where':{'FaxAccountId':_0xe7fee0},'order':_0x1253('0x85')})[_0x1253('0x20')](function(_0x16c874){_0xeb78b5=_0x16c874;});}})[_0x1253('0x55')](function(_0x53a15c){_0x13516f=0x1f4;logger[_0x1253('0x25')](_0x53a15c[_0x1253('0x38')]);if(_0x53a15c[_0x1253('0x39')]){delete _0x53a15c['name'];}_0xeb78b5=_0x53a15c;})[_0x1253('0x86')](function(){if(_0xeb78b5===null){_0x55a92e[_0x1253('0x29')](_0x13516f);}else{if(_0x13516f===0x1f4){_0x55a92e[_0x1253('0x2a')](_0x13516f)['send'](_0xeb78b5);}else{_0x55a92e[_0x1253('0x2a')](_0x13516f)[_0x1253('0x2c')](_0xeb78b5);}}});};exports['getApplications']=function(_0x1cfc4c,_0x111ac8,_0x4dc0dd){var _0x5225ea={};var _0x4f2ac5={};var _0x16b314;var _0x2114e1;return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x1cfc4c[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x111ac8,null))[_0x1253('0x20')](function(_0x2b9aad){if(_0x2b9aad){_0x16b314=_0x2b9aad;_0x4f2ac5[_0x1253('0x41')]=_[_0x1253('0x57')](db[_0x1253('0x83')][_0x1253('0x68')]);_0x4f2ac5[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1cfc4c[_0x1253('0x43')]);_0x4f2ac5[_0x1253('0x4b')]=_['intersection'](_0x4f2ac5[_0x1253('0x41')],_0x4f2ac5[_0x1253('0x43')]);_0x5225ea[_0x1253('0x45')]=_[_0x1253('0x44')](_0x4f2ac5[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1cfc4c[_0x1253('0x43')][_0x1253('0x46')]));_0x5225ea['attributes']=_0x5225ea[_0x1253('0x45')][_0x1253('0x69')]?_0x5225ea['attributes']:_0x4f2ac5['model'];_0x5225ea[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1cfc4c[_0x1253('0x43')][_0x1253('0x4a')]);_0x5225ea[_0x1253('0x51')]=qs['filters'](_[_0x1253('0x6a')](_0x1cfc4c['query'],_0x4f2ac5['filters']));if(_0x1cfc4c[_0x1253('0x43')][_0x1253('0x4f')]){_0x5225ea['where']=_[_0x1253('0x4c')](_0x5225ea[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x5225ea['attributes'],function(_0x1d0f7d){var _0xd6aa96={};_0xd6aa96[_0x1d0f7d]={'$like':'%'+_0x1cfc4c['query'][_0x1253('0x4f')]+'%'};return _0xd6aa96;})});}_0x5225ea=_['merge']({},_0x5225ea,_0x1cfc4c['options']);return _0x16b314['getApplications'](_0x5225ea);}})[_0x1253('0x20')](function(_0x3222ca){if(_0x3222ca){_0x2114e1=_0x3222ca['length'];if(!_0x1cfc4c[_0x1253('0x43')][_0x1253('0x47')](_0x1253('0x48'))){_0x5225ea[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x1cfc4c['query'][_0x1253('0x2e')]);_0x5225ea[_0x1253('0x2d')]=qs['offset'](_0x1cfc4c['query'][_0x1253('0x2d')]);}return _0x16b314[_0x1253('0x87')](_0x5225ea);}})[_0x1253('0x20')](function(_0x576a6b){if(_0x576a6b){return _0x576a6b?{'count':_0x2114e1,'rows':_0x576a6b}:null;}})[_0x1253('0x20')](respondWithResult(_0x111ac8,null))['catch'](handleError(_0x111ac8,null));};function Extension(_0x2a6c09,_0x3518e9,_0x24766e,_0x46a2f5){this['context']=_0x1253('0x88');this['exten']=_0x2a6c09[_0x1253('0x89')];this['app']=_0x46a2f5;this[_0x1253('0x4d')]=_0x1253('0x8a');this['description']=_0x1253('0x8b');this['FaxAccountId']=_0x2a6c09['id'];this['priority']=_0x3518e9;this['appdata']=_0x24766e;}function createExtensionsReciveFax(_0x5aaa65){var _0x2e6b5a=0x1;var _0x255553=[];_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,'','Answer'));_0x2e6b5a+=0x1;_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x8d'),_0x1253('0x8e')));_0x2e6b5a+=0x1;for(var _0x2ca94e in _0x5aaa65){if(_0x5aaa65['hasOwnProperty'](_0x2ca94e)&&(_0x2ca94e===_0x1253('0x8f')||_0x2ca94e===_0x1253('0x89')||_0x2ca94e===_0x1253('0x90')||_0x2ca94e===_0x1253('0x91')||_0x2ca94e===_0x1253('0x92')||_0x2ca94e===_0x1253('0x93')||_0x2ca94e===_0x1253('0x94')||_0x2ca94e===_0x1253('0x95')||_0x2ca94e==='t38timeout')){_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x96')+_0x2ca94e+')='+_0x5aaa65[_0x2ca94e],_0x1253('0x8e')));_0x2e6b5a+=0x1;}}_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,'6','Wait'));_0x2e6b5a+=0x1;_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x97'),'ReceiveFax'));_0x2e6b5a=0x0;return _0x255553;}exports[_0x1253('0x98')]=function(_0x349b81,_0x8a4d26,_0x565570){var _0x13fc43;return db['sequelize'][_0x1253('0x7f')](function(_0x2c7385){return db[_0x1253('0x3e')][_0x1253('0x59')](_0x349b81['body'],{'transaction':_0x2c7385})[_0x1253('0x20')](function(_0x57831f){_0x13fc43=_0x57831f[_0x1253('0x35')]({'plain':!![]});return db['VoiceExtension'][_0x1253('0x99')](createExtensionsReciveFax(_0x13fc43),{'transaction':_0x2c7385});});})['then'](function(){return _0x13fc43;})[_0x1253('0x20')](respondWithResult(_0x8a4d26,null))[_0x1253('0x55')](handleError(_0x8a4d26,null));};exports[_0x1253('0x9a')]=function(_0x295843,_0x5f381e,_0xab9fc9){var _0x2ee218;return db['sequelize'][_0x1253('0x7f')](function(_0x3a89d4){return db['FaxAccount']['update'](_0x295843[_0x1253('0x63')],{'where':{'id':_0x295843[_0x1253('0x63')]['id']},'transaction':_0x3a89d4})[_0x1253('0x20')](function(_0x3428e1){return db[_0x1253('0x9b')][_0x1253('0x34')]({'where':{'FaxAccountId':_0x295843[_0x1253('0x63')]['id']},'transaction':_0x3a89d4})[_0x1253('0x20')](function(_0xd5d037){return db[_0x1253('0x9b')][_0x1253('0x99')](createExtensionsReciveFax(_[_0x1253('0x74')](_0x295843[_0x1253('0x63')],['tech','key',_0x1253('0x9c'),_0x1253('0x9d'),_0x1253('0x9e'),_0x1253('0x9f')])),{'transaction':_0x3a89d4});});});})[_0x1253('0x20')](function(){return db[_0x1253('0x3e')]['findById'](_0x295843['body']['id']);})[_0x1253('0x20')](respondWithResult(_0x5f381e,null))[_0x1253('0x55')](handleError(_0x5f381e,null));};exports[_0x1253('0xa0')]=function(_0x5e12b9,_0x36c643,_0x53b536){var _0x5737fd={'raw':!![],'where':{}};var _0x3905cb={};var _0x3adbe1={'count':0x0,'rows':[]};return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x5e12b9[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x36c643,null))[_0x1253('0x20')](function(_0xc627ca){if(_0xc627ca){_0x3905cb[_0x1253('0x41')]=_[_0x1253('0x57')](db['FaxMessage'][_0x1253('0x68')]);_0x3905cb['query']=_[_0x1253('0x57')](_0x5e12b9[_0x1253('0x43')]);_0x3905cb[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3905cb[_0x1253('0x41')],_0x3905cb['query']);_0x5737fd[_0x1253('0x45')]=_['intersection'](_0x3905cb['model'],qs[_0x1253('0x46')](_0x5e12b9['query']['fields']));_0x5737fd[_0x1253('0x45')]=_0x5737fd[_0x1253('0x45')][_0x1253('0x69')]?_0x5737fd[_0x1253('0x45')]:_0x3905cb[_0x1253('0x41')];if(!_0x5e12b9[_0x1253('0x43')]['hasOwnProperty'](_0x1253('0x48'))){_0x5737fd[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x5e12b9[_0x1253('0x43')][_0x1253('0x2e')]);_0x5737fd['offset']=qs['offset'](_0x5e12b9[_0x1253('0x43')][_0x1253('0x2d')]);}_0x5737fd[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x5e12b9[_0x1253('0x43')][_0x1253('0x4a')]);_0x5737fd[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x5e12b9[_0x1253('0x43')],_0x3905cb[_0x1253('0x4b')]));_0x5737fd[_0x1253('0x51')][_0x1253('0x6b')]=_0xc627ca['id'];if(_0x5e12b9[_0x1253('0x43')][_0x1253('0x4f')]){_0x5737fd[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x5737fd[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x5737fd[_0x1253('0x45')],function(_0x3e2ccd){var _0x45e69d={};_0x45e69d[_0x3e2ccd]={'$like':'%'+_0x5e12b9[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x45e69d;})});}if(_0x5e12b9['query'][_0x1253('0xa1')]){var _0x3608ef=_0x5e12b9[_0x1253('0x43')][_0x1253('0xa1')][_0x1253('0xa2')](',');var _0x4079f1={};_0x4079f1[_0x3608ef[0x0]]={'$gte':moment(_0x3608ef[0x1])[_0x1253('0xa3')](_0x1253('0xa4'))};_0x5737fd[_0x1253('0x51')]=_['merge'](_0x5737fd[_0x1253('0x51')],_0x4079f1);}_0x5737fd=_[_0x1253('0x4c')]({},_0x5737fd,_0x5e12b9[_0x1253('0x50')]);return db[_0x1253('0xa5')][_0x1253('0x30')]({'where':_0x5737fd[_0x1253('0x51')]})['then'](function(_0x1cfbe0){_0x3adbe1[_0x1253('0x30')]=_0x1cfbe0;if(_0x5e12b9[_0x1253('0x43')][_0x1253('0x58')]){_0x5737fd[_0x1253('0x52')]=[{'all':!![]}];}return db[_0x1253('0xa5')][_0x1253('0x53')](_0x5737fd);})[_0x1253('0x20')](function(_0x18996f){_0x3adbe1[_0x1253('0x54')]=_0x18996f;return _0x3adbe1;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x36c643,_0x5737fd))[_0x1253('0x55')](handleError(_0x36c643,null));};exports[_0x1253('0x3a')]=function(_0x465c34,_0xc9083d,_0x3bfacc){var _0x2bcad6,_0x26ecbc={},_0x10785f;if(_0x465c34[_0x1253('0x63')]['to']){_0x10785f=_0x465c34[_0x1253('0x63')]['to'][0x0];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x465c34[_0x1253('0x64')]['id']},'include':[{'model':db[_0x1253('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x10785f},'limit':0x1,'order':[[_0x1253('0x9d'),_0x1253('0xa7')]]}]}]})['then'](handleEntityNotFound(_0xc9083d,null))[_0x1253('0x20')](function(_0x142142){_0x2bcad6=_0x142142;if(_0x465c34[_0x1253('0x63')]['attachments']&&_0x465c34['body']['attachments'][_0x1253('0x69')]){for(var _0x2f31a0=0x0;_0x2f31a0<_0x465c34['body'][_0x1253('0xa8')]['length'];_0x2f31a0+=0x1){_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0]={'filename':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0][_0x1253('0x39')],'id':_0x465c34['body']['attachments'][_0x2f31a0]['id'],'path':path[_0x1253('0xa9')](config['root'],_0x1253('0xaa'),_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0][_0x1253('0xab')])};}}return respondWithRpcPromise(_0x1253('0xac'),_0x1253('0xac'),{'FaxAccountId':_[_0x1253('0xad')](_0x465c34[_0x1253('0x64')]['id'])?undefined:_0x465c34[_0x1253('0x64')]['id'],'path':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')]['attachments'][0x0][_0x1253('0xae')])?undefined:_0x465c34['body'][_0x1253('0xa8')][0x0][_0x1253('0xae')],'fax':_['isNil'](_0x465c34[_0x1253('0x63')]['to'][0x0])?undefined:_0x465c34[_0x1253('0x63')]['to'][0x0]},client9002);})[_0x1253('0x20')](function(){if(_0x2bcad6){if(_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')][_0x1253('0xaf')])){_0x465c34['body']['from']=util[_0x1253('0xa3')]('\x22%s\x22\x20<%s>',_0x2bcad6['name'],_0x2bcad6[_0x1253('0xb0')]);}if(_0x2bcad6[_0x1253('0xb1')]){if(_0x2bcad6[_0x1253('0xb1')][_0x1253('0xb2')][_0x1253('0x69')]){return _0x2bcad6[_0x1253('0xb1')][_0x1253('0xb2')][0x0];}else{return db[_0x1253('0x76')][_0x1253('0x59')](_[_0x1253('0x19')](_0x465c34[_0x1253('0x63')],{'firstName':_0x465c34[_0x1253('0x63')]['to'][0x0],'phone':_0x465c34[_0x1253('0x63')]['to'][0x0],'fax':_0x465c34['body']['to'][0x0],'ListId':_0x2bcad6[_0x1253('0x9f')]}));}}else{throw new Error(_0x1253('0xb3'));}}else{throw new Error(_0x1253('0xb4'));}})[_0x1253('0x20')](function(_0x145656){if(_0x145656){return db[_0x1253('0x73')]['find']({'where':{'ContactId':_0x145656['id'],'closed':![],'FaxAccountId':_0x2bcad6['id']}})[_0x1253('0x20')](function(_0x4f0791){if(_0x4f0791){return[_0x4f0791,![]];}return db[_0x1253('0x73')]['create']({'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x145656['id'],'FaxAccountId':_0x2bcad6['id'],'fax':_0x465c34[_0x1253('0x63')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1253('0x4c')](_0x465c34[_0x1253('0x63')],{'read':![],'body':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xb5')],'FaxAccountId':_0x2bcad6['id'],'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x145656['id'],'AttachmentId':_0x465c34['body'][_0x1253('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x1253('0xa5')],'as':_0x1253('0xb6')}]})[_0x1253('0x20')](function(_0x384244){return[_0x384244,!![]];});});}else{throw new Error(_0x1253('0xb7'));}})['spread'](function(_0x502381,_0x5695ac){if(_0x5695ac){return _0x502381;}return db[_0x1253('0xa5')][_0x1253('0x59')]({'direction':_0x1253('0xb8'),'read':![],'body':_0x465c34[_0x1253('0x63')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2bcad6['id'],'FaxInteractionId':_0x502381['id'],'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x502381['ContactId'],'AttachmentId':_0x465c34['body'][_0x1253('0xa8')][0x0]['id']})[_0x1253('0x20')](function(_0x11099d){_0x502381[_0x1253('0xb9')][_0x1253('0xb6')]=[];_0x502381[_0x1253('0xb9')][_0x1253('0xb6')][_0x1253('0x8c')](_0x11099d[_0x1253('0xb9')]);return _0x502381;});})[_0x1253('0x20')](function(_0x2de371){respondWithRpcPromise(_0x1253('0xba'),_0x1253('0xba'),{'FaxAccountId':_[_0x1253('0xad')](_0x465c34['params']['id'])?undefined:_0x465c34['params']['id'],'path':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xae')])?undefined:_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xae')],'fax':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')]['to'][0x0])?undefined:_0x465c34[_0x1253('0x63')]['to'][0x0],'AttachmentId':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0]['id']},client9002)['then'](function(_0x49c151){logger[_0x1253('0x21')](_0x1253('0xbb'),_0x49c151);})['catch'](function(_0x57b67b){logger['info'](_0x1253('0xbb'),_0x57b67b);});return _0x2de371;})['then'](respondWithResult(_0xc9083d,null))[_0x1253('0x55')](handleError(_0xc9083d,null));};exports[_0x1253('0xbc')]=function(_0x4d4fe9,_0x33df3b,_0x5ccb81){return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x4d4fe9[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x33df3b,null))[_0x1253('0x20')](function(_0x934a4e){if(_0x934a4e){return _0x934a4e['addAgents'](_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')],_[_0x1253('0x74')](_0x4d4fe9['body'],[_0x1253('0x6e'),'id'])||{})['spread'](function(_0x31df9b){for(var _0xdaf3d=0x0;_0xdaf3d<_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')][_0x1253('0x69')];_0xdaf3d+=0x1){socket['emit'](_0x1253('0xbd'),{'UserId':Number(_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')][_0xdaf3d]),'FaxAccountId':Number(_0x4d4fe9[_0x1253('0x64')]['id'])});}return _0x31df9b;});}})[_0x1253('0x20')](respondWithResult(_0x33df3b,null))[_0x1253('0x55')](handleError(_0x33df3b,null));};exports[_0x1253('0xbe')]=function(_0x19e132,_0x12ced5,_0x50de58){return db[_0x1253('0x3e')]['find']({'where':{'id':_0x19e132[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x12ced5,null))[_0x1253('0x20')](function(_0x5b3a1e){if(_0x5b3a1e){return _0x5b3a1e[_0x1253('0xbe')](_0x19e132[_0x1253('0x43')]['ids'])[_0x1253('0x20')](function(){if(_[_0x1253('0xbf')](_0x19e132[_0x1253('0x43')][_0x1253('0x6e')])){for(var _0xf4c2f6=0x0;_0xf4c2f6<_0x19e132[_0x1253('0x43')][_0x1253('0x6e')][_0x1253('0x69')];_0xf4c2f6+=0x1){socket[_0x1253('0xc0')](_0x1253('0xc1'),{'UserId':Number(_0x19e132[_0x1253('0x43')][_0x1253('0x6e')][_0xf4c2f6]),'FaxAccountId':Number(_0x19e132[_0x1253('0x64')]['id'])});}}else{socket['emit'](_0x1253('0xc1'),{'UserId':Number(_0x19e132[_0x1253('0x43')][_0x1253('0x6e')]),'FaxAccountId':Number(_0x19e132['params']['id'])});}});}})[_0x1253('0x20')](respondWithStatusCode(_0x12ced5,null))[_0x1253('0x55')](handleError(_0x12ced5,null));};exports[_0x1253('0xc2')]=function(_0x34ccd5,_0x45fbdb,_0x2c53de){var _0x4f566d={};var _0x54476d={};var _0xa0a452;var _0x241013;return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x34ccd5[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x45fbdb,null))[_0x1253('0x20')](function(_0x5ab4ab){if(_0x5ab4ab){_0xa0a452=_0x5ab4ab;_0x54476d[_0x1253('0x41')]=_[_0x1253('0x57')](db['User'][_0x1253('0x68')]);_0x54476d[_0x1253('0x43')]=_[_0x1253('0x57')](_0x34ccd5[_0x1253('0x43')]);_0x54476d[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x54476d['model'],_0x54476d[_0x1253('0x43')]);_0x4f566d[_0x1253('0x45')]=_['intersection'](_0x54476d[_0x1253('0x41')],qs[_0x1253('0x46')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x46')]));_0x4f566d[_0x1253('0x45')]=_0x4f566d['attributes']['length']?_0x4f566d[_0x1253('0x45')]:_0x54476d[_0x1253('0x41')];_0x4f566d['order']=qs[_0x1253('0x4a')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x4a')]);_0x4f566d[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x34ccd5[_0x1253('0x43')],_0x54476d[_0x1253('0x4b')]));if(_0x34ccd5[_0x1253('0x43')][_0x1253('0x4f')]){_0x4f566d[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x4f566d['where'],{'$or':_[_0x1253('0x42')](_0x4f566d['attributes'],function(_0x5d0973){var _0x14d0bc={};_0x14d0bc[_0x5d0973]={'$like':'%'+_0x34ccd5[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x14d0bc;})});}_0x4f566d=_[_0x1253('0x4c')]({},_0x4f566d,_0x34ccd5[_0x1253('0x50')]);return _0xa0a452[_0x1253('0xc2')](_0x4f566d);}})[_0x1253('0x20')](function(_0xca589b){if(_0xca589b){_0x241013=_0xca589b['length'];if(!_0x34ccd5[_0x1253('0x43')][_0x1253('0x47')]('nolimit')){_0x4f566d['limit']=qs[_0x1253('0x2e')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x2e')]);_0x4f566d[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x34ccd5['query'][_0x1253('0x2d')]);}return _0xa0a452[_0x1253('0xc2')](_0x4f566d);}})[_0x1253('0x20')](function(_0x551093){if(_0x551093){return _0x551093?{'count':_0x241013,'rows':_0x551093}:null;}})[_0x1253('0x20')](respondWithResult(_0x45fbdb,null))[_0x1253('0x55')](handleError(_0x45fbdb,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 48059d8..50e03dd 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 _0x3af7=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3af7,0xb3));var _0x73af=function(_0x1cf169,_0x10b35a){_0x1cf169=_0x1cf169-0x0;var _0x101952=_0x3af7[_0x1cf169];return _0x101952;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x73af('0x0'))['db'][_0x73af('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x73af('0x2')](0x0);var events={'afterCreate':_0x73af('0x3'),'afterUpdate':_0x73af('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ad7a0){return function(_0x572ef9,_0x1685bc,_0x380a95){FaxAccountEvents['emit'](_0x1ad7a0+':'+_0x572ef9['id'],_0x572ef9);FaxAccountEvents[_0x73af('0x5')](_0x1ad7a0,_0x572ef9);_0x380a95(null);};}for(var e in events){if(events[_0x73af('0x6')](e)){var event=events[e];FaxAccount[_0x73af('0x7')](e,emitEvent(event));}}module[_0x73af('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xe149=['hook','exports','events','save','emit','hasOwnProperty'];(function(_0x974a75,_0x1acfc3){var _0x150cf6=function(_0x202c96){while(--_0x202c96){_0x974a75['push'](_0x974a75['shift']());}};_0x150cf6(++_0x1acfc3);}(_0xe149,0x7a));var _0x9e14=function(_0x54ff33,_0x35a087){_0x54ff33=_0x54ff33-0x0;var _0xa81ed0=_0xe149[_0x54ff33];return _0xa81ed0;};'use strict';var EventEmitter=require(_0x9e14('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e14('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc27309){return function(_0x42f9f4,_0x4d4482,_0x127777){FaxAccountEvents[_0x9e14('0x2')](_0xc27309+':'+_0x42f9f4['id'],_0x42f9f4);FaxAccountEvents[_0x9e14('0x2')](_0xc27309,_0x42f9f4);_0x127777(null);};}for(var e in events){if(events[_0x9e14('0x3')](e)){var event=events[e];FaxAccount[_0x9e14('0x4')](e,emitEvent(event));}}module[_0x9e14('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 05e9d0f..a827cef 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 _0xcd51=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts','lodash'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xcd51,0xef));var _0x1cd5=function(_0xf806b0,_0x3c9581){_0xf806b0=_0xf806b0-0x0;var _0x424250=_0xcd51[_0xf806b0];return _0x424250;};'use strict';var _=require(_0x1cd5('0x0'));var util=require('util');var logger=require(_0x1cd5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1cd5('0x2'));var rp=require(_0x1cd5('0x3'));var fs=require('fs');var path=require(_0x1cd5('0x4'));var rimraf=require(_0x1cd5('0x5'));var config=require(_0x1cd5('0x6'));var attributes=require(_0x1cd5('0x7'));module['exports']=function(_0x16100c,_0x74c7ce){return _0x16100c['define'](_0x1cd5('0x8'),attributes,{'tableName':_0x1cd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e64=['bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x18228a,_0x2a371b){var _0x5d973c=function(_0x8bc4a8){while(--_0x8bc4a8){_0x18228a['push'](_0x18228a['shift']());}};_0x5d973c(++_0x2a371b);}(_0x7e64,0xc0));var _0x47e6=function(_0x34f271,_0x26b85f){_0x34f271=_0x34f271-0x0;var _0x5067d5=_0x7e64[_0x34f271];return _0x5067d5;};'use strict';var _=require(_0x47e6('0x0'));var util=require(_0x47e6('0x1'));var logger=require(_0x47e6('0x2'))(_0x47e6('0x3'));var moment=require('moment');var BPromise=require(_0x47e6('0x4'));var rp=require(_0x47e6('0x5'));var fs=require('fs');var path=require(_0x47e6('0x6'));var rimraf=require(_0x47e6('0x7'));var config=require(_0x47e6('0x8'));var attributes=require(_0x47e6('0x9'));module[_0x47e6('0xa')]=function(_0x17379a,_0x45d9d6){return _0x17379a[_0x47e6('0xb')](_0x47e6('0xc'),attributes,{'tableName':_0x47e6('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 150874a..8f22f23 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 _0xc0af=['FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','find','CmList','List','Contacts','FaxApplication','Applications','applications','list','orderBy','priority','asc','account','length','create','contact','FaxInteraction','spread','get','autoclose','push','close','unmanaged','*,*,*,*','interaction','AttachmentId','UserId','User','name','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxAccount'];(function(_0x3c02b9,_0x2debea){var _0x329d98=function(_0x65078a){while(--_0x65078a){_0x3c02b9['push'](_0x3c02b9['shift']());}};_0x329d98(++_0x2debea);}(_0xc0af,0x149));var _0xfc0a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc0af[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfc0a('0x0'));var util=require(_0xfc0a('0x1'));var moment=require(_0xfc0a('0x2'));var BPromise=require(_0xfc0a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc0a('0x4'));var db=require(_0xfc0a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc0a('0x6'))('rpc');var config=require(_0xfc0a('0x7'));var jayson=require(_0xfc0a('0x8'));var client=jayson[_0xfc0a('0x9')][_0xfc0a('0xa')]({'port':0x232c});config['redis']=_[_0xfc0a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfc0a('0xc'))(new Redis(config['redis']));require(_0xfc0a('0xd'))[_0xfc0a('0xe')](socket);function respondWithRpcPromise(_0xe8603b,_0x2fdf3e,_0x474914){return new BPromise(function(_0x13a06c,_0x565f34){return client[_0xfc0a('0xf')](_0xe8603b,_0x474914)[_0xfc0a('0x10')](function(_0x444f51){logger['info'](_0xfc0a('0x11'),_0x2fdf3e,_0xfc0a('0x12'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2fdf3e,_0xfc0a('0x12'),JSON[_0xfc0a('0x13')](_0x444f51));if(_0x444f51[_0xfc0a('0x14')]){if(_0x444f51[_0xfc0a('0x14')][_0xfc0a('0x15')]===0x1f4){logger['error'](_0xfc0a('0x11'),_0x2fdf3e,_0x444f51[_0xfc0a('0x14')][_0xfc0a('0x16')]);return _0x565f34(_0x444f51['error'][_0xfc0a('0x16')]);}logger[_0xfc0a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x2fdf3e,_0x444f51[_0xfc0a('0x14')][_0xfc0a('0x16')]);return _0x13a06c(_0x444f51[_0xfc0a('0x14')][_0xfc0a('0x16')]);}else{logger[_0xfc0a('0x17')](_0xfc0a('0x11'),_0x2fdf3e,'request\x20sent');_0x13a06c(_0x444f51[_0xfc0a('0x18')][_0xfc0a('0x16')]);}})[_0xfc0a('0x19')](function(_0x1d7e0b){logger[_0xfc0a('0x14')](_0xfc0a('0x11'),_0x2fdf3e,_0x1d7e0b);_0x565f34(_0x1d7e0b);});});}exports[_0xfc0a('0x1a')]=function(_0x548796){var _0x53496d=this;return new Promise(function(_0x18a90a,_0x56d41b){return db[_0xfc0a('0x1b')][_0xfc0a('0x1c')]({'raw':_0x548796[_0xfc0a('0x1d')]?_0x548796[_0xfc0a('0x1d')][_0xfc0a('0x1e')]===undefined?!![]:![]:!![],'where':_0x548796[_0xfc0a('0x1d')]?_0x548796['options'][_0xfc0a('0x1f')]||null:null,'attributes':_0x548796[_0xfc0a('0x1d')]?_0x548796['options'][_0xfc0a('0x20')]||null:null,'limit':_0x548796['options']?_0x548796[_0xfc0a('0x1d')][_0xfc0a('0x21')]||null:null,'include':_0x548796[_0xfc0a('0x1d')]?_0x548796['options'][_0xfc0a('0x22')]?_[_0xfc0a('0x23')](_0x548796[_0xfc0a('0x1d')][_0xfc0a('0x22')],function(_0x5c4091){return{'model':db[_0x5c4091['model']],'as':_0x5c4091['as'],'attributes':_0x5c4091['attributes'],'include':_0x5c4091[_0xfc0a('0x22')]?_[_0xfc0a('0x23')](_0x5c4091[_0xfc0a('0x22')],function(_0x2e5137){return{'model':db[_0x2e5137[_0xfc0a('0x24')]],'as':_0x2e5137['as'],'attributes':_0x2e5137[_0xfc0a('0x20')],'include':_0x2e5137[_0xfc0a('0x22')]?_['map'](_0x2e5137['include'],function(_0x2b8af2){return{'model':db[_0x2b8af2[_0xfc0a('0x24')]],'as':_0x2b8af2['as'],'attributes':_0x2b8af2[_0xfc0a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfc0a('0x10')](function(_0x106b5b){logger[_0xfc0a('0x17')](_0xfc0a('0x1a'),_0x548796);logger[_0xfc0a('0x25')](_0xfc0a('0x1a'),_0x548796,JSON[_0xfc0a('0x13')](_0x106b5b));_0x18a90a(_0x106b5b);})[_0xfc0a('0x19')](function(_0x2d3e5b){logger[_0xfc0a('0x14')](_0xfc0a('0x1a'),_0x2d3e5b[_0xfc0a('0x16')],_0x548796);_0x56d41b(_0x53496d[_0xfc0a('0x14')](0x1f4,_0x2d3e5b[_0xfc0a('0x16')]));});});};exports[_0xfc0a('0x26')]=function(_0x4ebb67,_0xb3044,_0x48615e){var _0x31b568=this;return new Promise(function(_0x3b185c,_0x424051){var _0x33d28e={'body':_0x4ebb67[_0xfc0a('0x27')],'channel':_0xfc0a('0x28')};var _0xa2fad5=[];var _0x4d58c0=[];var _0x191bfd={};return db[_0xfc0a('0x29')][_0xfc0a('0x2a')]()[_0xfc0a('0x10')](function(_0x2c1b67){if(!_0x2c1b67){throw new db[(_0xfc0a('0x2b'))][(_0xfc0a('0x2c'))](_0xfc0a('0x2d'));}_0xa2fad5=_[_0xfc0a('0x2e')](_[_0xfc0a('0x2f')](_0x2c1b67),['createdAt',_0xfc0a('0x30')]);_0x4d58c0=_['difference'](_[_0xfc0a('0x2f')](_0x2c1b67),[_0xfc0a('0x31'),_0xfc0a('0x30'),_0xfc0a('0x32'),_0xfc0a('0x33')]);if(_0x4ebb67['body']['id']){delete _0x4ebb67[_0xfc0a('0x27')]['id'];}if(_[_0xfc0a('0x34')](_0x4ebb67['body']['from'])){throw new db[(_0xfc0a('0x2b'))][(_0xfc0a('0x2c'))]('from\x20is\x20mandatory');}if(_[_0xfc0a('0x34')](_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x27')])||_0x4ebb67['body'][_0xfc0a('0x27')]===''){throw new db[(_0xfc0a('0x2b'))][(_0xfc0a('0x2c'))](_0xfc0a('0x35'));}if(_['isNil'](_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x36')])){throw new db[(_0xfc0a('0x2b'))][(_0xfc0a('0x2c'))](_0xfc0a('0x37')+_0x4d58c0);}if(!_[_0xfc0a('0x38')](_0x4d58c0,_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x36')])){throw new db[(_0xfc0a('0x2b'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d58c0);}_0x191bfd[_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x36')]]=_0x4ebb67['body'][_0xfc0a('0x39')];})[_0xfc0a('0x10')](function(){return db[_0xfc0a('0x1b')][_0xfc0a('0x3a')]({'where':{'id':_0x4ebb67['account']['id']},'include':[{'model':db[_0xfc0a('0x3b')],'as':_0xfc0a('0x3c'),'include':[{'model':db['CmContact'],'as':_0xfc0a('0x3d'),'where':_0x191bfd,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfc0a('0x3e')],'as':_0xfc0a('0x3f')}]});})[_0xfc0a('0x10')](function(_0x467782){if(_0x467782&&_0x467782[_0xfc0a('0x3c')]){var _0x4c0353=_0x467782['get']({'plain':!![]});_0x33d28e['account']=_0x4c0353;_0x33d28e[_0xfc0a('0x40')]=_0x4c0353['Applications'];_0x33d28e[_0xfc0a('0x41')]=_0x4c0353['List'];_0x33d28e[_0xfc0a('0x40')]=_[_0xfc0a('0x42')](_0x33d28e['applications'],[_0xfc0a('0x43')],[_0xfc0a('0x44')]);if(_0x33d28e[_0xfc0a('0x45')][_0xfc0a('0x3f')]){delete _0x33d28e['account'][_0xfc0a('0x3f')];}if(_0x33d28e[_0xfc0a('0x45')]['List']&&_0x33d28e[_0xfc0a('0x45')][_0xfc0a('0x3c')][_0xfc0a('0x3d')][_0xfc0a('0x46')]){return _0x33d28e[_0xfc0a('0x45')][_0xfc0a('0x3c')][_0xfc0a('0x3d')][0x0];}var _0x57f3c1=_['defaults'](_0x4ebb67[_0xfc0a('0x27')],{'firstName':_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x39')],'ListId':_0x4c0353['ListId']});_0x57f3c1[_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x36')]]=_0x4ebb67[_0xfc0a('0x27')]['from'];return db[_0xfc0a('0x29')][_0xfc0a('0x47')](_0x57f3c1,{'fields':_0xa2fad5,'raw':!![]});}})[_0xfc0a('0x10')](function(_0x91069f){_0x33d28e[_0xfc0a('0x48')]=_0x91069f;if(_0x91069f){var _0x5f52d5={'ContactId':_0x91069f['id'],'FaxAccountId':_0x4ebb67[_0xfc0a('0x45')]['id'],'fax':_0x91069f[_0xfc0a('0x28')]};return db['FaxInteraction'][_0xfc0a('0x3a')]({'where':{'ContactId':_0x91069f['id'],'closed':![],'FaxAccountId':_0x4ebb67['account']['id']}})['then'](function(_0x2e0781){if(_0x2e0781){return[_0x2e0781,![]];}return db[_0xfc0a('0x49')][_0xfc0a('0x47')](_0x5f52d5)[_0xfc0a('0x10')](function(_0xc5ffd7){return[_0xc5ffd7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfc0a('0x4a')](function(_0x4ad6f2,_0x45ae06){var _0x30818c=_0x4ad6f2[_0xfc0a('0x4b')]({'plain':!![]});if(_0x45ae06){if(_0x33d28e['account'][_0xfc0a('0x4c')]){_0x33d28e['applications'][_0xfc0a('0x4d')]({'id':0x0,'priority':_0x33d28e[_0xfc0a('0x40')][_0xfc0a('0x46')]+0x1,'app':_0xfc0a('0x4e'),'appdata':_0xfc0a('0x4f'),'interval':_0xfc0a('0x50')});}_0x30818c['created']=!![];}else{_0x30818c['created']=![];}_0x33d28e[_0xfc0a('0x51')]=_0x30818c;return db['FaxMessage'][_0xfc0a('0x47')]({'body':_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x27')],'FaxAccountId':_0x4ebb67[_0xfc0a('0x45')]['id'],'FaxInteractionId':_0x4ad6f2['id'],'direction':'in','ContactId':_0x4ad6f2['ContactId'],'AttachmentId':_0x4ebb67[_0xfc0a('0x27')][_0xfc0a('0x52')]});})['then'](function(_0xdc90b1){_0x33d28e[_0xfc0a('0x16')]=_0xdc90b1;if(_0x33d28e[_0xfc0a('0x51')][_0xfc0a('0x53')]){return db[_0xfc0a('0x54')]['find']({'attributes':['id',_0xfc0a('0x55')],'where':{'id':_0x33d28e[_0xfc0a('0x51')]['UserId']}})['then'](function(_0x3d7dd4){if(_0x3d7dd4){_0x33d28e[_0xfc0a('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfc0a('0x56'),'appdata':_0x3d7dd4['name']+','+(_0x33d28e[_0xfc0a('0x45')]['waitForTheAssignedAgent']||0xa),'interval':_0xfc0a('0x50')});}return respondWithRpcPromise(_0xfc0a('0x57'),_0xfc0a('0x58'),_0x33d28e);});}return respondWithRpcPromise(_0xfc0a('0x57'),'startRouting',_0x33d28e);})[_0xfc0a('0x10')](function(_0x66bf27){_0x3b185c(_0x66bf27);})[_0xfc0a('0x19')](function(_0x28f682){_0x424051(_0x31b568['error'](0x1f4,_0x28f682[_0xfc0a('0x16')]));});});}; \ No newline at end of file +var _0xaac4=['where','limit','include','map','attributes','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','*,*,*,*','created','FaxMessage','interaction','User','unshift','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xaac4,0x140));var _0x4aac=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0xaac4[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4aac('0x0'));var util=require('util');var moment=require(_0x4aac('0x1'));var BPromise=require(_0x4aac('0x2'));var rs=require(_0x4aac('0x3'));var fs=require('fs');var Redis=require(_0x4aac('0x4'));var db=require(_0x4aac('0x5'))['db'];var utils=require(_0x4aac('0x6'));var logger=require(_0x4aac('0x7'))(_0x4aac('0x8'));var config=require('../../config/environment');var jayson=require(_0x4aac('0x9'));var client=jayson[_0x4aac('0xa')][_0x4aac('0xb')]({'port':0x232c});config[_0x4aac('0xc')]=_[_0x4aac('0xd')](config[_0x4aac('0xc')],{'host':_0x4aac('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aac('0xc')]));require(_0x4aac('0xf'))[_0x4aac('0x10')](socket);function respondWithRpcPromise(_0x24efcf,_0x3be45b,_0x4213a1){return new BPromise(function(_0x2efae1,_0x5e2506){return client[_0x4aac('0x11')](_0x24efcf,_0x4213a1)[_0x4aac('0x12')](function(_0x2a1ed7){logger[_0x4aac('0x13')](_0x4aac('0x14'),_0x3be45b,'request\x20sent');logger['debug'](_0x4aac('0x15'),_0x3be45b,'request\x20sent',JSON[_0x4aac('0x16')](_0x2a1ed7));if(_0x2a1ed7[_0x4aac('0x17')]){if(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x18')]===0x1f4){logger[_0x4aac('0x17')](_0x4aac('0x14'),_0x3be45b,_0x2a1ed7[_0x4aac('0x17')]['message']);return _0x5e2506(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);}logger[_0x4aac('0x17')]('FaxAccount,\x20%s,\x20%s',_0x3be45b,_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);return _0x2efae1(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);}else{logger[_0x4aac('0x13')](_0x4aac('0x14'),_0x3be45b,'request\x20sent');_0x2efae1(_0x2a1ed7['result'][_0x4aac('0x19')]);}})[_0x4aac('0x1a')](function(_0x598f70){logger['error'](_0x4aac('0x14'),_0x3be45b,_0x598f70);_0x5e2506(_0x598f70);});});}exports[_0x4aac('0x1b')]=function(_0x237a0f){var _0xd39b3c=this;return new Promise(function(_0x124773,_0x5ac4a9){return db[_0x4aac('0x1c')][_0x4aac('0x1d')]({'raw':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x1f')]===undefined?!![]:![]:!![],'where':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x20')]||null:null,'attributes':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')]['attributes']||null:null,'limit':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x21')]||null:null,'include':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f['options'][_0x4aac('0x22')]?_[_0x4aac('0x23')](_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x22')],function(_0xc99bdc){return{'model':db[_0xc99bdc['model']],'as':_0xc99bdc['as'],'attributes':_0xc99bdc[_0x4aac('0x24')],'include':_0xc99bdc[_0x4aac('0x22')]?_[_0x4aac('0x23')](_0xc99bdc[_0x4aac('0x22')],function(_0x897004){return{'model':db[_0x897004['model']],'as':_0x897004['as'],'attributes':_0x897004['attributes'],'include':_0x897004['include']?_[_0x4aac('0x23')](_0x897004['include'],function(_0x2aa4bd){return{'model':db[_0x2aa4bd['model']],'as':_0x2aa4bd['as'],'attributes':_0x2aa4bd[_0x4aac('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9497){logger['info']('GetFaxAccount',_0x237a0f);logger['debug'](_0x4aac('0x1b'),_0x237a0f,JSON[_0x4aac('0x16')](_0x1f9497));_0x124773(_0x1f9497);})[_0x4aac('0x1a')](function(_0x584c37){logger[_0x4aac('0x17')]('GetFaxAccount',_0x584c37[_0x4aac('0x19')],_0x237a0f);_0x5ac4a9(_0xd39b3c[_0x4aac('0x17')](0x1f4,_0x584c37[_0x4aac('0x19')]));});});};exports[_0x4aac('0x25')]=function(_0x3c426f,_0x2f11f2,_0x3fa796){var _0x36d8b2=this;return new Promise(function(_0x58f6aa,_0x16a0f3){var _0x3adae3={'body':_0x3c426f[_0x4aac('0x26')],'channel':_0x4aac('0x27')};var _0x18149b=[];var _0x2a3160=[];var _0x33e063={};return db[_0x4aac('0x28')]['describe']()[_0x4aac('0x12')](function(_0x4b5393){if(!_0x4b5393){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))](_0x4aac('0x2b'));}_0x18149b=_[_0x4aac('0x2c')](_[_0x4aac('0x2d')](_0x4b5393),[_0x4aac('0x2e'),_0x4aac('0x2f')]);_0x2a3160=_[_0x4aac('0x2c')](_[_0x4aac('0x2d')](_0x4b5393),[_0x4aac('0x2e'),'updatedAt',_0x4aac('0x30'),_0x4aac('0x31')]);if(_0x3c426f[_0x4aac('0x26')]['id']){delete _0x3c426f['body']['id'];}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')])){throw new db['Sequelize'][(_0x4aac('0x2a'))](_0x4aac('0x34'));}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')]['body'])||_0x3c426f[_0x4aac('0x26')][_0x4aac('0x26')]===''){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')]['mapKey'])){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a3160);}if(!_[_0x4aac('0x35')](_0x2a3160,_0x3c426f[_0x4aac('0x26')][_0x4aac('0x36')])){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))](_0x4aac('0x37')+_0x2a3160);}_0x33e063[_0x3c426f[_0x4aac('0x26')][_0x4aac('0x36')]]=_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')];})[_0x4aac('0x12')](function(){return db['FaxAccount'][_0x4aac('0x38')]({'where':{'id':_0x3c426f[_0x4aac('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x4aac('0x3a'),'include':[{'model':db[_0x4aac('0x28')],'as':_0x4aac('0x3b'),'where':_0x33e063,'limit':0x1,'order':[[_0x4aac('0x2f'),_0x4aac('0x3c')]]}]},{'model':db[_0x4aac('0x3d')],'as':_0x4aac('0x3e')}]});})[_0x4aac('0x12')](function(_0x1a56c2){if(_0x1a56c2&&_0x1a56c2[_0x4aac('0x3a')]){var _0xad4c5f=_0x1a56c2[_0x4aac('0x3f')]({'plain':!![]});_0x3adae3[_0x4aac('0x39')]=_0xad4c5f;_0x3adae3['applications']=_0xad4c5f[_0x4aac('0x3e')];_0x3adae3[_0x4aac('0x40')]=_0xad4c5f[_0x4aac('0x3a')];_0x3adae3[_0x4aac('0x41')]=_[_0x4aac('0x42')](_0x3adae3[_0x4aac('0x41')],[_0x4aac('0x43')],[_0x4aac('0x44')]);if(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3e')]){delete _0x3adae3[_0x4aac('0x39')]['Applications'];}if(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3a')]&&_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3a')]['Contacts'][_0x4aac('0x45')]){return _0x3adae3['account'][_0x4aac('0x3a')][_0x4aac('0x3b')][0x0];}var _0x2f9f7e=_['defaults'](_0x3c426f['body'],{'firstName':_0x3c426f['body'][_0x4aac('0x33')],'ListId':_0xad4c5f[_0x4aac('0x31')]});_0x2f9f7e[_0x3c426f['body'][_0x4aac('0x36')]]=_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')];return db[_0x4aac('0x28')][_0x4aac('0x46')](_0x2f9f7e,{'fields':_0x18149b,'raw':!![]});}})[_0x4aac('0x12')](function(_0x19db16){_0x3adae3[_0x4aac('0x47')]=_0x19db16;if(_0x19db16){var _0x405131={'ContactId':_0x19db16['id'],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id'],'fax':_0x19db16[_0x4aac('0x27')]};return db[_0x4aac('0x48')][_0x4aac('0x38')]({'where':{'ContactId':_0x19db16['id'],'closed':![],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id']}})[_0x4aac('0x12')](function(_0x54914c){if(_0x54914c){return[_0x54914c,![]];}return db[_0x4aac('0x48')]['create'](_0x405131)[_0x4aac('0x12')](function(_0x4e6cce){return[_0x4e6cce,!![]];});});}else{throw new Error(_0x4aac('0x49'));}})[_0x4aac('0x4a')](function(_0x416a65,_0x3e7edd){var _0x2cd203=_0x416a65['get']({'plain':!![]});if(_0x3e7edd){if(_0x3adae3[_0x4aac('0x39')]['autoclose']){_0x3adae3[_0x4aac('0x41')][_0x4aac('0x4b')]({'id':0x0,'priority':_0x3adae3[_0x4aac('0x41')][_0x4aac('0x45')]+0x1,'app':_0x4aac('0x4c'),'appdata':'unmanaged','interval':_0x4aac('0x4d')});}_0x2cd203[_0x4aac('0x4e')]=!![];}else{_0x2cd203[_0x4aac('0x4e')]=![];}_0x3adae3['interaction']=_0x2cd203;return db[_0x4aac('0x4f')][_0x4aac('0x46')]({'body':_0x3c426f[_0x4aac('0x26')]['body'],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id'],'FaxInteractionId':_0x416a65['id'],'direction':'in','ContactId':_0x416a65['ContactId'],'AttachmentId':_0x3c426f[_0x4aac('0x26')]['AttachmentId']});})[_0x4aac('0x12')](function(_0x560e0c){_0x3adae3[_0x4aac('0x19')]=_0x560e0c;if(_0x3adae3[_0x4aac('0x50')]['UserId']){return db[_0x4aac('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x3adae3['interaction']['UserId']}})[_0x4aac('0x12')](function(_0x5b623c){if(_0x5b623c){_0x3adae3[_0x4aac('0x41')][_0x4aac('0x52')]({'id':0x0,'priority':0x0,'app':_0x4aac('0x53'),'appdata':_0x5b623c[_0x4aac('0x54')]+','+(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4aac('0x56'),_0x3adae3);});}return respondWithRpcPromise(_0x4aac('0x57'),_0x4aac('0x56'),_0x3adae3);})[_0x4aac('0x12')](function(_0x18f77f){_0x58f6aa(_0x18f77f);})['catch'](function(_0x232f0f){_0x16a0f3(_0x36d8b2[_0x4aac('0x17')](0x1f4,_0x232f0f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 31c2471..21f86af 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 _0x8ed6=['faxAccount:','save','remove','update','emit','register'];(function(_0x4c94ba,_0x1f64f4){var _0x57949b=function(_0x6e5fb6){while(--_0x6e5fb6){_0x4c94ba['push'](_0x4c94ba['shift']());}};_0x57949b(++_0x1f64f4);}(_0x8ed6,0x1e7));var _0x68ed=function(_0x3e36d5,_0xfa60a){_0x3e36d5=_0x3e36d5-0x0;var _0x477a44=_0x8ed6[_0x3e36d5];return _0x477a44;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x68ed('0x0'),_0x68ed('0x1'),_0x68ed('0x2')];function createListener(_0x56fec8,_0x121281){return function(_0x2eb857){_0x121281[_0x68ed('0x3')](_0x56fec8,_0x2eb857);};}function removeListener(_0x4c9682,_0x20f275){return function(){FaxAccountEvents['removeListener'](_0x4c9682,_0x20f275);};}exports[_0x68ed('0x4')]=function(_0xc58fd0){for(var _0x4559b5=0x0,_0x132fd8=events['length'];_0x4559b5<_0x132fd8;_0x4559b5++){var _0x280f43=events[_0x4559b5];var _0x28a72c=createListener(_0x68ed('0x5')+_0x280f43,_0xc58fd0);FaxAccountEvents['on'](_0x280f43,_0x28a72c);}}; \ No newline at end of file +var _0x38b5=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x33a1b0,_0x1b1217){var _0x65d239=function(_0x320a0a){while(--_0x320a0a){_0x33a1b0['push'](_0x33a1b0['shift']());}};_0x65d239(++_0x1b1217);}(_0x38b5,0x188));var _0x538b=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x38b5[_0x3e2fcf];return _0x497db7;};'use strict';var FaxAccountEvents=require(_0x538b('0x0'));var events=[_0x538b('0x1'),_0x538b('0x2'),_0x538b('0x3')];function createListener(_0x1b87f1,_0x396d30){return function(_0x3b5087){_0x396d30[_0x538b('0x4')](_0x1b87f1,_0x3b5087);};}function removeListener(_0x5c1ed4,_0x415f24){return function(){FaxAccountEvents[_0x538b('0x5')](_0x5c1ed4,_0x415f24);};}exports[_0x538b('0x6')]=function(_0x1b6e04){for(var _0x2cb255=0x0,_0x36b871=events[_0x538b('0x7')];_0x2cb255<_0x36b871;_0x2cb255++){var _0x6a773b=events[_0x2cb255];var _0x38fe59=createListener(_0x538b('0x8')+_0x6a773b,_0x1b6e04);FaxAccountEvents['on'](_0x6a773b,_0x38fe59);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 64b90b3..340511d 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(_0xdf05cb,_0x38a188){var _0x1fe6ac=function(_0x34a864){while(--_0x34a864){_0xdf05cb['push'](_0xdf05cb['shift']());}};_0x1fe6ac(++_0x38a188);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x4a0cd1,_0x23c60e){var _0x1826d3=function(_0x14f84a){while(--_0x14f84a){_0x4a0cd1['push'](_0x4a0cd1['shift']());}};_0x1826d3(++_0x23c60e);}(_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('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 73b3d16..b9b58c1 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 _0x736f=['noop','exports','INTEGER','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x736f,0x185));var _0xf736=function(_0x66e8c6,_0x559e25){_0x66e8c6=_0x66e8c6-0x0;var _0x3af129=_0x736f[_0x66e8c6];return _0x3af129;};'use strict';var Sequelize=require('sequelize');module[_0xf736('0x0')]={'priority':{'type':Sequelize[_0xf736('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf736('0x2')],'allowNull':![],'defaultValue':_0xf736('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf736('0x2')]},'interval':{'type':Sequelize[_0xf736('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x9a1c=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x5c2f35,_0x1872d2){var _0x4a434d=function(_0x2c2309){while(--_0x2c2309){_0x5c2f35['push'](_0x5c2f35['shift']());}};_0x4a434d(++_0x1872d2);}(_0x9a1c,0x1cb));var _0xc9a1=function(_0x505674,_0x561904){_0x505674=_0x505674-0x0;var _0x4fd89d=_0x9a1c[_0x505674];return _0x4fd89d;};'use strict';var Sequelize=require(_0xc9a1('0x0'));module[_0xc9a1('0x1')]={'priority':{'type':Sequelize[_0xc9a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc9a1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc9a1('0x3')]},'interval':{'type':Sequelize[_0xc9a1('0x3')],'defaultValue':_0xc9a1('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6d72f1b..9f864e5 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 _0xc458=['length','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','update','destroy','then','end','sendStatus','error','stack','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','findAll','rows','show','params'];(function(_0x3be5bd,_0x2f4503){var _0x44dc15=function(_0x115d85){while(--_0x115d85){_0x3be5bd['push'](_0x3be5bd['shift']());}};_0x44dc15(++_0x2f4503);}(_0xc458,0x182));var _0x8c45=function(_0x546b6e,_0x246ec1){_0x546b6e=_0x546b6e-0x0;var _0x561b9e=_0xc458[_0x546b6e];return _0x561b9e;};'use strict';var emlformat=require(_0x8c45('0x0'));var rimraf=require(_0x8c45('0x1'));var zipdir=require(_0x8c45('0x2'));var jsonpatch=require(_0x8c45('0x3'));var rp=require(_0x8c45('0x4'));var moment=require(_0x8c45('0x5'));var BPromise=require(_0x8c45('0x6'));var Mustache=require(_0x8c45('0x7'));var util=require(_0x8c45('0x8'));var path=require(_0x8c45('0x9'));var sox=require(_0x8c45('0xa'));var csv=require(_0x8c45('0xb'));var ejs=require(_0x8c45('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c45('0xd'));var crypto=require(_0x8c45('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8c45('0xf'));var toCsv=require(_0x8c45('0xb'));var querystring=require(_0x8c45('0x10'));var Papa=require('papaparse');var Redis=require(_0x8c45('0x11'));var authService=require(_0x8c45('0x12'));var qs=require(_0x8c45('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c45('0x14'));var logger=require(_0x8c45('0x15'))(_0x8c45('0x16'));var utils=require('../../config/utils');var config=require(_0x8c45('0x17'));var licenseUtil=require(_0x8c45('0x18'));var db=require(_0x8c45('0x19'))['db'];function respondWithStatusCode(_0x255ca6,_0x5be6e1){_0x5be6e1=_0x5be6e1||0xcc;return function(_0x2a6265){if(_0x2a6265){return _0x255ca6['sendStatus'](_0x5be6e1);}return _0x255ca6[_0x8c45('0x1a')](_0x5be6e1)['end']();};}function respondWithResult(_0x123f82,_0x39b46e){_0x39b46e=_0x39b46e||0xc8;return function(_0x4364fd){if(_0x4364fd){return _0x123f82[_0x8c45('0x1a')](_0x39b46e)[_0x8c45('0x1b')](_0x4364fd);}};}function respondWithFilteredResult(_0x814ecd,_0x337ec4){return function(_0x1f7a41){if(_0x1f7a41){var _0x1afb66=typeof _0x337ec4[_0x8c45('0x1c')]===_0x8c45('0x1d')&&typeof _0x337ec4[_0x8c45('0x1e')]===_0x8c45('0x1d');var _0x18e9be=_0x1f7a41[_0x8c45('0x1f')];var _0x5930f5=_0x1afb66?0x0:_0x337ec4[_0x8c45('0x1c')];var _0x2e89aa=_0x1afb66?_0x1f7a41[_0x8c45('0x1f')]:_0x337ec4['offset']+_0x337ec4['limit'];var _0x3c3064;if(_0x2e89aa>=_0x18e9be){_0x2e89aa=_0x18e9be;_0x3c3064=0xc8;}else{_0x3c3064=0xce;}_0x814ecd['status'](_0x3c3064);return _0x814ecd['set']('Content-Range',_0x5930f5+'-'+_0x2e89aa+'/'+_0x18e9be)[_0x8c45('0x1b')](_0x1f7a41);}return null;};}function patchUpdates(_0x219f99){return function(_0x15ae8d){try{jsonpatch[_0x8c45('0x20')](_0x15ae8d,_0x219f99,!![]);}catch(_0xcf84a5){return BPromise[_0x8c45('0x21')](_0xcf84a5);}return _0x15ae8d['save']();};}function saveUpdates(_0x230bfb,_0xa5161a){return function(_0x5e12a9){if(_0x5e12a9){return _0x5e12a9[_0x8c45('0x22')](_0x230bfb)['then'](function(_0x35ef53){return _0x35ef53;});}return null;};}function removeEntity(_0x2ad28d,_0x20ef39){return function(_0x24d8cd){if(_0x24d8cd){return _0x24d8cd[_0x8c45('0x23')]()[_0x8c45('0x24')](function(){_0x2ad28d[_0x8c45('0x1a')](0xcc)[_0x8c45('0x25')]();});}};}function handleEntityNotFound(_0x2a02d1,_0xd25773){return function(_0x37239e){if(!_0x37239e){_0x2a02d1[_0x8c45('0x26')](0x194);}return _0x37239e;};}function handleError(_0x105663,_0x41a951){_0x41a951=_0x41a951||0x1f4;return function(_0x3b908b){logger[_0x8c45('0x27')](_0x3b908b[_0x8c45('0x28')]);if(_0x3b908b['name']){delete _0x3b908b['name'];}_0x105663[_0x8c45('0x1a')](_0x41a951)[_0x8c45('0x29')](_0x3b908b);};}exports[_0x8c45('0x2a')]=function(_0x38e4e6,_0x567930){var _0x1076ce={},_0xc8e2a7={},_0x52e43c={'count':0x0,'rows':[]};var _0x21b52a=_[_0x8c45('0x2b')](db[_0x8c45('0x2c')][_0x8c45('0x2d')],function(_0x2fcb2b){return{'name':_0x2fcb2b[_0x8c45('0x2e')],'type':_0x2fcb2b['type'][_0x8c45('0x2f')]};});_0xc8e2a7[_0x8c45('0x30')]=_[_0x8c45('0x2b')](_0x21b52a,'name');_0xc8e2a7[_0x8c45('0x31')]=_[_0x8c45('0x32')](_0x38e4e6[_0x8c45('0x31')]);_0xc8e2a7[_0x8c45('0x33')]=_[_0x8c45('0x34')](_0xc8e2a7[_0x8c45('0x30')],_0xc8e2a7['query']);_0x1076ce[_0x8c45('0x35')]=_[_0x8c45('0x34')](_0xc8e2a7['model'],qs['fields'](_0x38e4e6[_0x8c45('0x31')][_0x8c45('0x36')]));_0x1076ce[_0x8c45('0x35')]=_0x1076ce[_0x8c45('0x35')]['length']?_0x1076ce['attributes']:_0xc8e2a7[_0x8c45('0x30')];if(!_0x38e4e6['query'][_0x8c45('0x37')](_0x8c45('0x38'))){_0x1076ce[_0x8c45('0x1e')]=qs[_0x8c45('0x1e')](_0x38e4e6['query'][_0x8c45('0x1e')]);_0x1076ce['offset']=qs[_0x8c45('0x1c')](_0x38e4e6[_0x8c45('0x31')]['offset']);}_0x1076ce[_0x8c45('0x39')]=qs[_0x8c45('0x3a')](_0x38e4e6[_0x8c45('0x31')]['sort']);_0x1076ce[_0x8c45('0x3b')]=qs['filters'](_[_0x8c45('0x3c')](_0x38e4e6[_0x8c45('0x31')],_0xc8e2a7[_0x8c45('0x33')]),_0x21b52a);if(_0x38e4e6[_0x8c45('0x31')][_0x8c45('0x3d')]){_0x1076ce[_0x8c45('0x3b')]=_[_0x8c45('0x3e')](_0x1076ce['where'],{'$or':_[_0x8c45('0x2b')](_0x21b52a,function(_0x3fcf8a){if(_0x3fcf8a['type']!=='VIRTUAL'){var _0x28f5ee={};_0x28f5ee[_0x3fcf8a[_0x8c45('0x3f')]]={'$like':'%'+_0x38e4e6[_0x8c45('0x31')][_0x8c45('0x3d')]+'%'};return _0x28f5ee;}})});}_0x1076ce=_['merge']({},_0x1076ce,_0x38e4e6[_0x8c45('0x40')]);var _0x579630={'where':_0x1076ce[_0x8c45('0x3b')]};return db['FaxApplication'][_0x8c45('0x1f')](_0x579630)[_0x8c45('0x24')](function(_0x50e3c0){_0x52e43c[_0x8c45('0x1f')]=_0x50e3c0;if(_0x38e4e6['query'][_0x8c45('0x41')]){_0x1076ce['include']=[{'all':!![]}];}return db[_0x8c45('0x2c')][_0x8c45('0x42')](_0x1076ce);})[_0x8c45('0x24')](function(_0x1921dd){_0x52e43c[_0x8c45('0x43')]=_0x1921dd;return _0x52e43c;})[_0x8c45('0x24')](respondWithFilteredResult(_0x567930,_0x1076ce))['catch'](handleError(_0x567930,null));};exports[_0x8c45('0x44')]=function(_0x940b73,_0x39dca3){var _0x1a9707={'raw':!![],'where':{'id':_0x940b73[_0x8c45('0x45')]['id']}},_0x392d24={};_0x392d24[_0x8c45('0x30')]=_['keys'](db[_0x8c45('0x2c')]['rawAttributes']);_0x392d24['query']=_[_0x8c45('0x32')](_0x940b73[_0x8c45('0x31')]);_0x392d24[_0x8c45('0x33')]=_['intersection'](_0x392d24[_0x8c45('0x30')],_0x392d24[_0x8c45('0x31')]);_0x1a9707[_0x8c45('0x35')]=_[_0x8c45('0x34')](_0x392d24['model'],qs[_0x8c45('0x36')](_0x940b73['query'][_0x8c45('0x36')]));_0x1a9707[_0x8c45('0x35')]=_0x1a9707[_0x8c45('0x35')][_0x8c45('0x46')]?_0x1a9707[_0x8c45('0x35')]:_0x392d24['model'];if(_0x940b73[_0x8c45('0x31')][_0x8c45('0x41')]){_0x1a9707[_0x8c45('0x47')]=[{'all':!![]}];}_0x1a9707=_[_0x8c45('0x3e')]({},_0x1a9707,_0x940b73[_0x8c45('0x40')]);return db['FaxApplication'][_0x8c45('0x48')](_0x1a9707)['then'](handleEntityNotFound(_0x39dca3,null))[_0x8c45('0x24')](respondWithResult(_0x39dca3,null))[_0x8c45('0x49')](handleError(_0x39dca3,null));};exports[_0x8c45('0x4a')]=function(_0x1e08a6,_0x40a55d){return db[_0x8c45('0x2c')][_0x8c45('0x4a')](_0x1e08a6[_0x8c45('0x4b')],{})[_0x8c45('0x24')](respondWithResult(_0x40a55d,0xc9))[_0x8c45('0x49')](handleError(_0x40a55d,null));};exports[_0x8c45('0x22')]=function(_0x54a05e,_0x31513c){if(_0x54a05e[_0x8c45('0x4b')]['id']){delete _0x54a05e[_0x8c45('0x4b')]['id'];}return db['FaxApplication'][_0x8c45('0x48')]({'where':{'id':_0x54a05e[_0x8c45('0x45')]['id']}})[_0x8c45('0x24')](handleEntityNotFound(_0x31513c,null))[_0x8c45('0x24')](saveUpdates(_0x54a05e['body'],null))['then'](respondWithResult(_0x31513c,null))['catch'](handleError(_0x31513c,null));};exports['destroy']=function(_0x119432,_0x37e0b8){return db['FaxApplication'][_0x8c45('0x48')]({'where':{'id':_0x119432[_0x8c45('0x45')]['id']}})[_0x8c45('0x24')](handleEntityNotFound(_0x37e0b8,null))[_0x8c45('0x24')](removeEntity(_0x37e0b8,null))[_0x8c45('0x49')](handleError(_0x37e0b8,null));}; \ No newline at end of file +var _0x7adc=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','FaxApplication','findAll','rows','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','index','map','rawAttributes','fieldName','type','model'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x7adc,0x1d6));var _0xc7ad=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7adc[_0x2085f3];return _0x384e3c;};'use strict';var emlformat=require(_0xc7ad('0x0'));var rimraf=require(_0xc7ad('0x1'));var zipdir=require(_0xc7ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc7ad('0x3'));var BPromise=require(_0xc7ad('0x4'));var Mustache=require('mustache');var util=require(_0xc7ad('0x5'));var path=require(_0xc7ad('0x6'));var sox=require(_0xc7ad('0x7'));var csv=require(_0xc7ad('0x8'));var ejs=require(_0xc7ad('0x9'));var fs=require('fs');var fs_extra=require(_0xc7ad('0xa'));var _=require('lodash');var squel=require(_0xc7ad('0xb'));var crypto=require(_0xc7ad('0xc'));var jsforce=require(_0xc7ad('0xd'));var deskjs=require(_0xc7ad('0xe'));var toCsv=require(_0xc7ad('0x8'));var querystring=require(_0xc7ad('0xf'));var Papa=require('papaparse');var Redis=require(_0xc7ad('0x10'));var authService=require(_0xc7ad('0x11'));var qs=require(_0xc7ad('0x12'));var as=require(_0xc7ad('0x13'));var hardwareService=require(_0xc7ad('0x14'));var logger=require(_0xc7ad('0x15'))('api');var utils=require(_0xc7ad('0x16'));var config=require(_0xc7ad('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ad('0x18'))['db'];function respondWithStatusCode(_0x338740,_0x34d6c3){_0x34d6c3=_0x34d6c3||0xcc;return function(_0x1dcd50){if(_0x1dcd50){return _0x338740[_0xc7ad('0x19')](_0x34d6c3);}return _0x338740[_0xc7ad('0x1a')](_0x34d6c3)['end']();};}function respondWithResult(_0xf85968,_0xb6532a){_0xb6532a=_0xb6532a||0xc8;return function(_0x27b1ab){if(_0x27b1ab){return _0xf85968['status'](_0xb6532a)[_0xc7ad('0x1b')](_0x27b1ab);}};}function respondWithFilteredResult(_0x3ca710,_0xa8763e){return function(_0x57f81c){if(_0x57f81c){var _0x547de0=typeof _0xa8763e['offset']===_0xc7ad('0x1c')&&typeof _0xa8763e['limit']===_0xc7ad('0x1c');var _0x1c0123=_0x57f81c[_0xc7ad('0x1d')];var _0x4c9da6=_0x547de0?0x0:_0xa8763e[_0xc7ad('0x1e')];var _0x3418a5=_0x547de0?_0x57f81c['count']:_0xa8763e[_0xc7ad('0x1e')]+_0xa8763e[_0xc7ad('0x1f')];var _0x37ee11;if(_0x3418a5>=_0x1c0123){_0x3418a5=_0x1c0123;_0x37ee11=0xc8;}else{_0x37ee11=0xce;}_0x3ca710[_0xc7ad('0x1a')](_0x37ee11);return _0x3ca710[_0xc7ad('0x20')](_0xc7ad('0x21'),_0x4c9da6+'-'+_0x3418a5+'/'+_0x1c0123)['json'](_0x57f81c);}return null;};}function patchUpdates(_0x2c424b){return function(_0x564f6f){try{jsonpatch[_0xc7ad('0x22')](_0x564f6f,_0x2c424b,!![]);}catch(_0x439452){return BPromise[_0xc7ad('0x23')](_0x439452);}return _0x564f6f['save']();};}function saveUpdates(_0x148378,_0x3f17d0){return function(_0x539b00){if(_0x539b00){return _0x539b00[_0xc7ad('0x24')](_0x148378)['then'](function(_0x55d0c2){return _0x55d0c2;});}return null;};}function removeEntity(_0x1f98a6,_0x3ad0bf){return function(_0x1e6a1d){if(_0x1e6a1d){return _0x1e6a1d[_0xc7ad('0x25')]()[_0xc7ad('0x26')](function(){_0x1f98a6[_0xc7ad('0x1a')](0xcc)[_0xc7ad('0x27')]();});}};}function handleEntityNotFound(_0x43ff06,_0x4a501b){return function(_0x41c283){if(!_0x41c283){_0x43ff06['sendStatus'](0x194);}return _0x41c283;};}function handleError(_0x4758ab,_0x523cf8){_0x523cf8=_0x523cf8||0x1f4;return function(_0x3f9238){logger[_0xc7ad('0x28')](_0x3f9238[_0xc7ad('0x29')]);if(_0x3f9238['name']){delete _0x3f9238['name'];}_0x4758ab[_0xc7ad('0x1a')](_0x523cf8)['send'](_0x3f9238);};}exports[_0xc7ad('0x2a')]=function(_0x3eb0d2,_0xb4bec0){var _0x42ce50={},_0x4cfe76={},_0x4faa40={'count':0x0,'rows':[]};var _0x57b8e9=_[_0xc7ad('0x2b')](db['FaxApplication'][_0xc7ad('0x2c')],function(_0x26e17d){return{'name':_0x26e17d[_0xc7ad('0x2d')],'type':_0x26e17d[_0xc7ad('0x2e')]['key']};});_0x4cfe76[_0xc7ad('0x2f')]=_[_0xc7ad('0x2b')](_0x57b8e9,'name');_0x4cfe76[_0xc7ad('0x30')]=_['keys'](_0x3eb0d2[_0xc7ad('0x30')]);_0x4cfe76[_0xc7ad('0x31')]=_[_0xc7ad('0x32')](_0x4cfe76[_0xc7ad('0x2f')],_0x4cfe76['query']);_0x42ce50[_0xc7ad('0x33')]=_[_0xc7ad('0x32')](_0x4cfe76[_0xc7ad('0x2f')],qs['fields'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x34')]));_0x42ce50[_0xc7ad('0x33')]=_0x42ce50[_0xc7ad('0x33')][_0xc7ad('0x35')]?_0x42ce50['attributes']:_0x4cfe76[_0xc7ad('0x2f')];if(!_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x36')](_0xc7ad('0x37'))){_0x42ce50[_0xc7ad('0x1f')]=qs['limit'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x1f')]);_0x42ce50['offset']=qs['offset'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x1e')]);}_0x42ce50[_0xc7ad('0x38')]=qs[_0xc7ad('0x39')](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x39')]);_0x42ce50[_0xc7ad('0x3a')]=qs['filters'](_[_0xc7ad('0x3b')](_0x3eb0d2[_0xc7ad('0x30')],_0x4cfe76['filters']),_0x57b8e9);if(_0x3eb0d2[_0xc7ad('0x30')]['filter']){_0x42ce50[_0xc7ad('0x3a')]=_[_0xc7ad('0x3c')](_0x42ce50['where'],{'$or':_[_0xc7ad('0x2b')](_0x57b8e9,function(_0x4be6e5){if(_0x4be6e5['type']!==_0xc7ad('0x3d')){var _0x1afef6={};_0x1afef6[_0x4be6e5['name']]={'$like':'%'+_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x3e')]+'%'};return _0x1afef6;}})});}_0x42ce50=_[_0xc7ad('0x3c')]({},_0x42ce50,_0x3eb0d2[_0xc7ad('0x3f')]);var _0x9dbb62={'where':_0x42ce50['where']};return db['FaxApplication'][_0xc7ad('0x1d')](_0x9dbb62)[_0xc7ad('0x26')](function(_0x4cddaf){_0x4faa40['count']=_0x4cddaf;if(_0x3eb0d2[_0xc7ad('0x30')]['includeAll']){_0x42ce50[_0xc7ad('0x40')]=[{'all':!![]}];}return db[_0xc7ad('0x41')][_0xc7ad('0x42')](_0x42ce50);})[_0xc7ad('0x26')](function(_0x3bdff9){_0x4faa40[_0xc7ad('0x43')]=_0x3bdff9;return _0x4faa40;})[_0xc7ad('0x26')](respondWithFilteredResult(_0xb4bec0,_0x42ce50))['catch'](handleError(_0xb4bec0,null));};exports['show']=function(_0x27fedd,_0x5b48fb){var _0x13d190={'raw':!![],'where':{'id':_0x27fedd[_0xc7ad('0x44')]['id']}},_0x4975d5={};_0x4975d5['model']=_['keys'](db[_0xc7ad('0x41')][_0xc7ad('0x2c')]);_0x4975d5['query']=_['keys'](_0x27fedd[_0xc7ad('0x30')]);_0x4975d5['filters']=_['intersection'](_0x4975d5[_0xc7ad('0x2f')],_0x4975d5[_0xc7ad('0x30')]);_0x13d190['attributes']=_[_0xc7ad('0x32')](_0x4975d5[_0xc7ad('0x2f')],qs['fields'](_0x27fedd[_0xc7ad('0x30')][_0xc7ad('0x34')]));_0x13d190[_0xc7ad('0x33')]=_0x13d190[_0xc7ad('0x33')][_0xc7ad('0x35')]?_0x13d190[_0xc7ad('0x33')]:_0x4975d5['model'];if(_0x27fedd[_0xc7ad('0x30')][_0xc7ad('0x45')]){_0x13d190[_0xc7ad('0x40')]=[{'all':!![]}];}_0x13d190=_[_0xc7ad('0x3c')]({},_0x13d190,_0x27fedd[_0xc7ad('0x3f')]);return db[_0xc7ad('0x41')][_0xc7ad('0x46')](_0x13d190)[_0xc7ad('0x26')](handleEntityNotFound(_0x5b48fb,null))[_0xc7ad('0x26')](respondWithResult(_0x5b48fb,null))[_0xc7ad('0x47')](handleError(_0x5b48fb,null));};exports[_0xc7ad('0x48')]=function(_0x23fa75,_0x3d5565){return db['FaxApplication'][_0xc7ad('0x48')](_0x23fa75[_0xc7ad('0x49')],{})[_0xc7ad('0x26')](respondWithResult(_0x3d5565,0xc9))['catch'](handleError(_0x3d5565,null));};exports['update']=function(_0x3e0f5d,_0x1e4fa3){if(_0x3e0f5d[_0xc7ad('0x49')]['id']){delete _0x3e0f5d['body']['id'];}return db[_0xc7ad('0x41')][_0xc7ad('0x46')]({'where':{'id':_0x3e0f5d[_0xc7ad('0x44')]['id']}})[_0xc7ad('0x26')](handleEntityNotFound(_0x1e4fa3,null))['then'](saveUpdates(_0x3e0f5d['body'],null))[_0xc7ad('0x26')](respondWithResult(_0x1e4fa3,null))[_0xc7ad('0x47')](handleError(_0x1e4fa3,null));};exports[_0xc7ad('0x25')]=function(_0x21578c,_0x28cb44){return db[_0xc7ad('0x41')][_0xc7ad('0x46')]({'where':{'id':_0x21578c[_0xc7ad('0x44')]['id']}})[_0xc7ad('0x26')](handleEntityNotFound(_0x28cb44,null))['then'](removeEntity(_0x28cb44,null))[_0xc7ad('0x47')](handleError(_0x28cb44,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ed1ffe7..772bd18 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 _0xed83=['./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4167a0,_0x2f5fb4){var _0xc2eef9=function(_0x4878bb){while(--_0x4878bb){_0x4167a0['push'](_0x4167a0['shift']());}};_0xc2eef9(++_0x2f5fb4);}(_0xed83,0x130));var _0x3ed8=function(_0x53e7cb,_0x2d5c30){_0x53e7cb=_0x53e7cb-0x0;var _0x1327b1=_0xed83[_0x53e7cb];return _0x1327b1;};'use strict';var _=require(_0x3ed8('0x0'));var util=require('util');var logger=require(_0x3ed8('0x1'))(_0x3ed8('0x2'));var moment=require(_0x3ed8('0x3'));var BPromise=require(_0x3ed8('0x4'));var rp=require(_0x3ed8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ed8('0x6'));var config=require(_0x3ed8('0x7'));var attributes=require(_0x3ed8('0x8'));module['exports']=function(_0x157068,_0x4bf56a){return _0x157068[_0x3ed8('0x9')](_0x3ed8('0xa'),attributes,{'tableName':_0x3ed8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3ed8('0xc')});}; \ No newline at end of file +var _0x93cb=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x93cb,0x19a));var _0xb93c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x93cb[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xb93c('0x0'));var util=require(_0xb93c('0x1'));var logger=require(_0xb93c('0x2'))('api');var moment=require(_0xb93c('0x3'));var BPromise=require(_0xb93c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb93c('0x5'));var rimraf=require('rimraf');var config=require(_0xb93c('0x6'));var attributes=require(_0xb93c('0x7'));module[_0xb93c('0x8')]=function(_0x54df71,_0x9ff58a){return _0x54df71[_0xb93c('0x9')](_0xb93c('0xa'),attributes,{'tableName':_0xb93c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb93c('0xc'),'collate':_0xb93c('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0fb776c..3ee4cf7 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 _0xddd3=['where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','update','body','options','raw'];(function(_0x57f330,_0x3f4879){var _0x348bce=function(_0x3c3367){while(--_0x3c3367){_0x57f330['push'](_0x57f330['shift']());}};_0x348bce(++_0x3f4879);}(_0xddd3,0x1b1));var _0x3ddd=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xddd3[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x3ddd('0x0'));var util=require(_0x3ddd('0x1'));var moment=require(_0x3ddd('0x2'));var BPromise=require(_0x3ddd('0x3'));var rs=require(_0x3ddd('0x4'));var fs=require('fs');var Redis=require(_0x3ddd('0x5'));var db=require(_0x3ddd('0x6'))['db'];var utils=require(_0x3ddd('0x7'));var logger=require('../../config/logger')(_0x3ddd('0x8'));var config=require(_0x3ddd('0x9'));var jayson=require(_0x3ddd('0xa'));var client=jayson[_0x3ddd('0xb')][_0x3ddd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x464bff,_0x20a192,_0x4bbb67){return new BPromise(function(_0x539c2f,_0x54a097){return client[_0x3ddd('0xd')](_0x464bff,_0x4bbb67)['then'](function(_0x39262d){logger[_0x3ddd('0xe')]('FaxApplication,\x20%s,\x20%s',_0x20a192,'request\x20sent');logger[_0x3ddd('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x20a192,_0x3ddd('0x10'),JSON[_0x3ddd('0x11')](_0x39262d));if(_0x39262d[_0x3ddd('0x12')]){if(_0x39262d[_0x3ddd('0x12')][_0x3ddd('0x13')]===0x1f4){logger[_0x3ddd('0x12')]('FaxApplication,\x20%s,\x20%s',_0x20a192,_0x39262d[_0x3ddd('0x12')][_0x3ddd('0x14')]);return _0x54a097(_0x39262d['error']['message']);}logger['error'](_0x3ddd('0x15'),_0x20a192,_0x39262d[_0x3ddd('0x12')]['message']);return _0x539c2f(_0x39262d[_0x3ddd('0x12')]['message']);}else{logger[_0x3ddd('0xe')](_0x3ddd('0x15'),_0x20a192,'request\x20sent');_0x539c2f(_0x39262d[_0x3ddd('0x16')][_0x3ddd('0x14')]);}})[_0x3ddd('0x17')](function(_0x2e4d14){logger[_0x3ddd('0x12')]('FaxApplication,\x20%s,\x20%s',_0x20a192,_0x2e4d14);_0x54a097(_0x2e4d14);});});}exports[_0x3ddd('0x18')]=function(_0x33ceb4){var _0x14cba3=this;return new Promise(function(_0x2dedba,_0x14c845){return db['FaxApplication'][_0x3ddd('0x19')](_0x33ceb4[_0x3ddd('0x1a')],{'raw':_0x33ceb4['options']?_0x33ceb4[_0x3ddd('0x1b')][_0x3ddd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33ceb4[_0x3ddd('0x1b')]?_0x33ceb4[_0x3ddd('0x1b')][_0x3ddd('0x1d')]||null:null,'attributes':_0x33ceb4[_0x3ddd('0x1b')]?_0x33ceb4[_0x3ddd('0x1b')][_0x3ddd('0x1e')]||null:null,'limit':_0x33ceb4[_0x3ddd('0x1b')]?_0x33ceb4['options'][_0x3ddd('0x1f')]||null:null})[_0x3ddd('0x20')](function(_0x176d3d){logger['info'](_0x3ddd('0x18'),_0x33ceb4);logger[_0x3ddd('0xf')](_0x3ddd('0x18'),_0x33ceb4,JSON[_0x3ddd('0x11')](_0x176d3d));_0x2dedba(_0x176d3d);})['catch'](function(_0x1e368e){logger[_0x3ddd('0x12')](_0x3ddd('0x18'),_0x1e368e[_0x3ddd('0x14')],_0x33ceb4);_0x14c845(_0x14cba3['error'](0x1f4,_0x1e368e['message']));});});}; \ No newline at end of file +var _0x438d=['options','raw','where','attributes','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0x438d,0x161));var _0xd438=function(_0x1c2434,_0x28868c){_0x1c2434=_0x1c2434-0x0;var _0x3a601=_0x438d[_0x1c2434];return _0x3a601;};'use strict';var _=require(_0xd438('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd438('0x1'));var db=require(_0xd438('0x2'))['db'];var utils=require(_0xd438('0x3'));var logger=require('../../config/logger')(_0xd438('0x4'));var config=require(_0xd438('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd438('0x6')][_0xd438('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x285a18,_0x36ab5e,_0x1b61a2){return new BPromise(function(_0x186e77,_0x219560){return client[_0xd438('0x8')](_0x285a18,_0x1b61a2)[_0xd438('0x9')](function(_0x21107d){logger[_0xd438('0xa')](_0xd438('0xb'),_0x36ab5e,_0xd438('0xc'));logger[_0xd438('0xd')](_0xd438('0xe'),_0x36ab5e,_0xd438('0xc'),JSON[_0xd438('0xf')](_0x21107d));if(_0x21107d[_0xd438('0x10')]){if(_0x21107d[_0xd438('0x10')][_0xd438('0x11')]===0x1f4){logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x21107d['error'][_0xd438('0x12')]);return _0x219560(_0x21107d[_0xd438('0x10')]['message']);}logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x21107d[_0xd438('0x10')]['message']);return _0x186e77(_0x21107d[_0xd438('0x10')][_0xd438('0x12')]);}else{logger[_0xd438('0xa')](_0xd438('0xb'),_0x36ab5e,_0xd438('0xc'));_0x186e77(_0x21107d[_0xd438('0x13')][_0xd438('0x12')]);}})['catch'](function(_0x109fb4){logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x109fb4);_0x219560(_0x109fb4);});});}exports[_0xd438('0x14')]=function(_0x160df3){var _0xb24217=this;return new Promise(function(_0x483bd2,_0x252e13){return db[_0xd438('0x15')][_0xd438('0x16')](_0x160df3[_0xd438('0x17')],{'raw':_0x160df3[_0xd438('0x18')]?_0x160df3[_0xd438('0x18')][_0xd438('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x160df3['options']?_0x160df3[_0xd438('0x18')][_0xd438('0x1a')]||null:null,'attributes':_0x160df3[_0xd438('0x18')]?_0x160df3[_0xd438('0x18')][_0xd438('0x1b')]||null:null,'limit':_0x160df3[_0xd438('0x18')]?_0x160df3['options']['limit']||null:null})[_0xd438('0x9')](function(_0x43244f){logger[_0xd438('0xa')](_0xd438('0x14'),_0x160df3);logger['debug'](_0xd438('0x14'),_0x160df3,JSON['stringify'](_0x43244f));_0x483bd2(_0x43244f);})[_0xd438('0x1c')](function(_0x15bb16){logger['error']('UpdateFaxApplication',_0x15bb16[_0xd438('0x12')],_0x160df3);_0x252e13(_0xb24217[_0xd438('0x10')](0x1f4,_0x15bb16[_0xd438('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 012fa3d..208e38d 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 _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x2bc1af,_0x2c01a1){var _0x74a50f=function(_0x148d13){while(--_0x148d13){_0x2bc1af['push'](_0x2bc1af['shift']());}};_0x74a50f(++_0x2c01a1);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file +var _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x4cf8[_0x4d230c];return _0x16b044;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 203f957..f2bb172 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 _0x36d2=['sequelize','exports','STRING','ENUM','out','DATE'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x36d2,0xa2));var _0x236d=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x36d2[_0x2085f3];return _0x384e3c;};'use strict';var Sequelize=require(_0x236d('0x0'));module[_0x236d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x236d('0x2')]},'secondDisposition':{'type':Sequelize[_0x236d('0x2')]},'thirdDisposition':{'type':Sequelize[_0x236d('0x2')]},'note':{'type':Sequelize[_0x236d('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x236d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x236d('0x3')]('in',_0x236d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x236d('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x236d('0x3')]('in',_0x236d('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6299=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0xed158b,_0x5ab842){var _0x485232=function(_0x5b50e1){while(--_0x5b50e1){_0xed158b['push'](_0xed158b['shift']());}};_0x485232(++_0x5ab842);}(_0x6299,0x1d7));var _0x9629=function(_0x24e505,_0x5616fe){_0x24e505=_0x24e505-0x0;var _0x206815=_0x6299[_0x24e505];return _0x206815;};'use strict';var Sequelize=require(_0x9629('0x0'));module[_0x9629('0x1')]={'closed':{'type':Sequelize[_0x9629('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9629('0x3')]},'disposition':{'type':Sequelize[_0x9629('0x4')]},'secondDisposition':{'type':Sequelize[_0x9629('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9629('0x4')]},'note':{'type':Sequelize[_0x9629('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x9629('0x5')]('in',_0x9629('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9629('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9629('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 2b158ce..d0e7b19 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 _0x4eb9=['unlinkSync','rimraf','zip-dir','moment','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','type','fax','query','user','show','params','keys','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','filters','intersection','hasOwnProperty','nolimit','limit','order','sort','pick','FaxInteractionId','filter','where','$gte','split','findAll','rows','addTags','setTags','Tag','color','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve'];(function(_0x2bb89f,_0x4fb41b){var _0x29c411=function(_0x3d111e){while(--_0x3d111e){_0x2bb89f['push'](_0x2bb89f['shift']());}};_0x29c411(++_0x4fb41b);}(_0x4eb9,0x6b));var _0x94eb=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4eb9[_0x1d24eb];return _0x1dc576;};'use strict';var rimraf=require(_0x94eb('0x0'));var zipdir=require(_0x94eb('0x1'));var moment=require(_0x94eb('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x94eb('0x3'));var fs=require('fs');var _=require(_0x94eb('0x4'));var Redis=require(_0x94eb('0x5'));var interaction=require(_0x94eb('0x6'));var qs=require(_0x94eb('0x7'));var logger=require(_0x94eb('0x8'))(_0x94eb('0x9'));var config=require(_0x94eb('0xa'));var db=require(_0x94eb('0xb'))['db'];config[_0x94eb('0xc')]=_[_0x94eb('0xd')](config['redis'],{'host':_0x94eb('0xe'),'port':0x18eb});var socket=require(_0x94eb('0xf'))(new Redis(config[_0x94eb('0xc')]));require(_0x94eb('0x10'))['register'](socket);function respondWithStatusCode(_0x4b0999,_0x44ed4e){_0x44ed4e=_0x44ed4e||0xcc;return function(_0x3c5cd5){if(_0x3c5cd5){return _0x4b0999[_0x94eb('0x11')](_0x44ed4e);}return _0x4b0999['status'](_0x44ed4e)[_0x94eb('0x12')]();};}function respondWithResult(_0x47c7d7,_0x445407){_0x445407=_0x445407||0xc8;return function(_0x5194ca){if(_0x5194ca){return _0x47c7d7[_0x94eb('0x13')](_0x445407)[_0x94eb('0x14')](_0x5194ca);}};}function respondWithFilteredResult(_0x415d52,_0x26de17){return function(_0x1c3471){if(_0x1c3471){var _0x52e8a5=typeof _0x26de17['offset']===_0x94eb('0x15')&&typeof _0x26de17['limit']===_0x94eb('0x15');var _0x1f3871=_0x1c3471[_0x94eb('0x16')];var _0x353717=_0x52e8a5?0x0:_0x26de17[_0x94eb('0x17')];var _0x223176=_0x52e8a5?_0x1c3471['count']:_0x26de17[_0x94eb('0x17')]+_0x26de17['limit'];var _0x31b7cc;if(_0x223176>=_0x1f3871){_0x223176=_0x1f3871;_0x31b7cc=0xc8;}else{_0x31b7cc=0xce;}_0x415d52[_0x94eb('0x13')](_0x31b7cc);return _0x415d52[_0x94eb('0x18')](_0x94eb('0x19'),_0x353717+'-'+_0x223176+'/'+_0x1f3871)[_0x94eb('0x14')](_0x1c3471);}return null;};}function saveUpdates(_0x2d9e5d){return function(_0x496cd6){if(_0x496cd6){return _0x496cd6[_0x94eb('0x1a')](_0x2d9e5d)[_0x94eb('0x1b')](function(_0x2844c0){return _0x2844c0;});}return null;};}function removeEntity(_0x3be5a0){return function(_0x1d8655){if(_0x1d8655){return _0x1d8655[_0x94eb('0x1c')]()[_0x94eb('0x1b')](function(){_0x3be5a0[_0x94eb('0x13')](0xcc)[_0x94eb('0x12')]();});}};}function handleEntityNotFound(_0x33c6c8){return function(_0x596f97){if(!_0x596f97){_0x33c6c8[_0x94eb('0x11')](0x194);}return _0x596f97;};}function handleError(_0xfc2dd8,_0x4e7662){_0x4e7662=_0x4e7662||0x1f4;return function(_0x97609b){logger[_0x94eb('0x1d')](_0x97609b[_0x94eb('0x1e')]);if(_0x97609b[_0x94eb('0x1f')]){delete _0x97609b['name'];}_0xfc2dd8['status'](_0x4e7662)[_0x94eb('0x20')](_0x97609b);};}exports['index']=function(_0x1e637d,_0x540bfc){var _0x1ecec2={};var _0x27054b=_[_0x94eb('0x21')](db[_0x94eb('0x22')][_0x94eb('0x23')],function(_0x2ffbb0){return{'name':_0x2ffbb0[_0x94eb('0x24')],'type':_0x2ffbb0[_0x94eb('0x25')]['key']};});_0x1ecec2=qs['getOptions'](_0x27054b,_0x1e637d);return interaction['findAll'](_0x94eb('0x26'),_0x1e637d[_0x94eb('0x27')],_0x1e637d[_0x94eb('0x28')],_0x1ecec2,_0x27054b)[_0x94eb('0x1b')](respondWithFilteredResult(_0x540bfc,_0x1ecec2))['catch'](handleError(_0x540bfc,null));};exports[_0x94eb('0x29')]=function(_0x2dfc5f,_0xe81f5a){var _0x481f4f={'raw':![],'where':{'id':_0x2dfc5f[_0x94eb('0x2a')]['id']}},_0x5de7a1={};_0x5de7a1['model']=_[_0x94eb('0x2b')](db[_0x94eb('0x22')][_0x94eb('0x23')]);_0x5de7a1[_0x94eb('0x27')]=_[_0x94eb('0x2b')](_0x2dfc5f['query']);_0x5de7a1['filters']=_['intersection'](_0x5de7a1[_0x94eb('0x2c')],_0x5de7a1[_0x94eb('0x27')]);_0x481f4f[_0x94eb('0x2d')]=_['intersection'](_0x5de7a1[_0x94eb('0x2c')],qs[_0x94eb('0x2e')](_0x2dfc5f[_0x94eb('0x27')][_0x94eb('0x2e')]));_0x481f4f['attributes']=_0x481f4f[_0x94eb('0x2d')][_0x94eb('0x2f')]?_0x481f4f[_0x94eb('0x2d')]:_0x5de7a1['model'];if(_0x2dfc5f[_0x94eb('0x27')][_0x94eb('0x30')]){_0x481f4f[_0x94eb('0x31')]=[{'all':!![]}];}_0x481f4f=_[_0x94eb('0x32')]({},_0x481f4f,_0x2dfc5f[_0x94eb('0x33')]);return db[_0x94eb('0x22')][_0x94eb('0x34')](_0x481f4f)[_0x94eb('0x1b')](handleEntityNotFound(_0xe81f5a,null))['then'](respondWithResult(_0xe81f5a,null))[_0x94eb('0x35')](handleError(_0xe81f5a,null));};exports['create']=function(_0x2cd745,_0x29758a){return db[_0x94eb('0x22')][_0x94eb('0x36')](_0x2cd745[_0x94eb('0x37')],{})[_0x94eb('0x1b')](respondWithResult(_0x29758a,0xc9))[_0x94eb('0x35')](handleError(_0x29758a,null));};exports[_0x94eb('0x1a')]=function(_0x4d7601,_0x28be0a){if(_0x4d7601[_0x94eb('0x37')]['id']){delete _0x4d7601['body']['id'];}return db[_0x94eb('0x22')]['find']({'where':{'id':_0x4d7601[_0x94eb('0x2a')]['id']}})['then'](handleEntityNotFound(_0x28be0a,null))[_0x94eb('0x1b')](saveUpdates(_0x4d7601[_0x94eb('0x37')],null))[_0x94eb('0x1b')](respondWithResult(_0x28be0a,null))[_0x94eb('0x35')](handleError(_0x28be0a,null));};exports['destroy']=function(_0x228bbc,_0x119179){return db[_0x94eb('0x22')][_0x94eb('0x34')]({'where':{'id':_0x228bbc[_0x94eb('0x2a')]['id']}})['then'](handleEntityNotFound(_0x119179,null))['then'](removeEntity(_0x119179,null))[_0x94eb('0x35')](handleError(_0x119179,null));};exports[_0x94eb('0x38')]=function(_0x3adb1f,_0x380884){return db[_0x94eb('0x22')][_0x94eb('0x38')]()['then'](respondWithResult(_0x380884,null))[_0x94eb('0x35')](handleError(_0x380884,null));};exports[_0x94eb('0x39')]=function(_0x31d9b2,_0x374992){return db[_0x94eb('0x3a')][_0x94eb('0x34')]({'where':{'id':_0x31d9b2['params']['id']}})['then'](handleEntityNotFound(_0x374992,null))['then'](function(_0x4c8a71){if(_0x4c8a71){return _0x4c8a71['addMessage'](_0x31d9b2[_0x94eb('0x37')][_0x94eb('0x3b')],_[_0x94eb('0x3c')](_0x31d9b2[_0x94eb('0x37')],['ids','id'])||{});}})[_0x94eb('0x1b')](respondWithResult(_0x374992,null))[_0x94eb('0x35')](handleError(_0x374992,null));};exports[_0x94eb('0x3d')]=function(_0x8c0f04,_0x47c860){var _0x5882b4={'raw':![],'where':{}};var _0x38e4a4={};var _0x24aee4={'count':0x0,'rows':[]};return db[_0x94eb('0x22')][_0x94eb('0x3e')]({'where':{'id':_0x8c0f04['params']['id']}})[_0x94eb('0x1b')](handleEntityNotFound(_0x47c860,null))[_0x94eb('0x1b')](function(_0x17326d){if(_0x17326d){_0x38e4a4[_0x94eb('0x2c')]=_[_0x94eb('0x2b')](db[_0x94eb('0x3a')]['rawAttributes']);_0x38e4a4[_0x94eb('0x27')]=_[_0x94eb('0x2b')](_0x8c0f04['query']);_0x38e4a4[_0x94eb('0x3f')]=_[_0x94eb('0x40')](_0x38e4a4['model'],_0x38e4a4[_0x94eb('0x27')]);_0x5882b4[_0x94eb('0x2d')]=_[_0x94eb('0x40')](_0x38e4a4[_0x94eb('0x2c')],qs[_0x94eb('0x2e')](_0x8c0f04[_0x94eb('0x27')][_0x94eb('0x2e')]));_0x5882b4['attributes']=_0x5882b4[_0x94eb('0x2d')][_0x94eb('0x2f')]?_0x5882b4['attributes']:_0x38e4a4[_0x94eb('0x2c')];if(!_0x8c0f04[_0x94eb('0x27')][_0x94eb('0x41')](_0x94eb('0x42'))){_0x5882b4[_0x94eb('0x43')]=qs[_0x94eb('0x43')](_0x8c0f04['query']['limit']);_0x5882b4[_0x94eb('0x17')]=qs[_0x94eb('0x17')](_0x8c0f04[_0x94eb('0x27')]['offset']);}_0x5882b4[_0x94eb('0x44')]=qs[_0x94eb('0x45')](_0x8c0f04[_0x94eb('0x27')][_0x94eb('0x45')]);_0x5882b4['where']=qs[_0x94eb('0x3f')](_[_0x94eb('0x46')](_0x8c0f04[_0x94eb('0x27')],_0x38e4a4['filters']));_0x5882b4['where'][_0x94eb('0x47')]=_0x17326d['id'];if(_0x8c0f04['query'][_0x94eb('0x48')]){_0x5882b4['where']=_['merge'](_0x5882b4[_0x94eb('0x49')],{'$or':_[_0x94eb('0x21')](_0x5882b4[_0x94eb('0x2d')],function(_0x3fa11a){var _0x1a25d4={};_0x1a25d4[_0x3fa11a]={'$like':'%'+_0x8c0f04[_0x94eb('0x27')]['filter']+'%'};return _0x1a25d4;})});}if(_0x8c0f04[_0x94eb('0x27')][_0x94eb('0x4a')]){var _0x5989ef=_0x8c0f04['query'][_0x94eb('0x4a')][_0x94eb('0x4b')](',');var _0x168b3d={};_0x168b3d[_0x5989ef[0x0]]={'$gte':moment(_0x5989ef[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5882b4[_0x94eb('0x49')]=_['merge'](_0x5882b4[_0x94eb('0x49')],_0x168b3d);}_0x5882b4=_[_0x94eb('0x32')]({},_0x5882b4,_0x8c0f04['options']);return db[_0x94eb('0x3a')][_0x94eb('0x16')]({'where':_0x5882b4[_0x94eb('0x49')]})[_0x94eb('0x1b')](function(_0x566aa7){_0x24aee4[_0x94eb('0x16')]=_0x566aa7;if(_0x8c0f04[_0x94eb('0x27')][_0x94eb('0x30')]){_0x5882b4[_0x94eb('0x31')]=[{'all':!![]}];}return db[_0x94eb('0x3a')][_0x94eb('0x4c')](_0x5882b4);})[_0x94eb('0x1b')](function(_0x503585){_0x24aee4[_0x94eb('0x4d')]=_0x503585;return _0x24aee4;});}})[_0x94eb('0x1b')](respondWithFilteredResult(_0x47c860,_0x5882b4))[_0x94eb('0x35')](handleError(_0x47c860,null));};exports[_0x94eb('0x4e')]=function(_0x3d6f16,_0x2d26fb){return db[_0x94eb('0x22')][_0x94eb('0x34')]({'where':{'id':_0x3d6f16[_0x94eb('0x2a')]['id']}})[_0x94eb('0x1b')](handleEntityNotFound(_0x2d26fb,null))['then'](function(_0x5ee3c7){if(_0x5ee3c7){return _0x5ee3c7[_0x94eb('0x4f')](_0x3d6f16[_0x94eb('0x37')][_0x94eb('0x3b')],_[_0x94eb('0x3c')](_0x3d6f16[_0x94eb('0x37')],[_0x94eb('0x3b'),'id'])||{})['spread'](function(){return db[_0x94eb('0x50')][_0x94eb('0x4c')]({'attributes':['id','name',_0x94eb('0x51')],'where':{'id':_0x3d6f16[_0x94eb('0x37')][_0x94eb('0x3b')]}});})[_0x94eb('0x1b')](function(_0x5257c7){socket['emit']('faxInteractionTags:save',{'id':Number(_0x3d6f16[_0x94eb('0x2a')]['id']),'tags':_0x5257c7||[]});return{'id':Number(_0x3d6f16[_0x94eb('0x2a')]['id']),'tags':_0x5257c7||[]};});}})['then'](respondWithResult(_0x2d26fb,null))[_0x94eb('0x35')](handleError(_0x2d26fb,null));};exports[_0x94eb('0x52')]=function(_0x324508,_0x33ab5f){return db[_0x94eb('0x22')]['find']({'where':{'id':_0x324508['params']['id']}})[_0x94eb('0x1b')](handleEntityNotFound(_0x33ab5f,null))[_0x94eb('0x1b')](function(_0x591186){if(_0x591186){return _0x591186[_0x94eb('0x52')](_0x324508[_0x94eb('0x27')][_0x94eb('0x3b')]);}})['then'](respondWithStatusCode(_0x33ab5f,null))[_0x94eb('0x35')](handleError(_0x33ab5f,null));};exports[_0x94eb('0x53')]=function(_0x486f3f,_0x123a10){var _0x328adf=moment()[_0x94eb('0x54')]()['toString']();var _0x5551d3=path['join'](config[_0x94eb('0x55')],_0x94eb('0x56'),_0x94eb('0x57'),_0x94eb('0x58'));var _0x377770=path[_0x94eb('0x59')](config[_0x94eb('0x55')],_0x94eb('0x56'),_0x94eb('0x57'),_0x94eb('0x5a'));var _0x35ba29=path[_0x94eb('0x59')](_0x5551d3,_0x328adf);var _0x1e9a91=util[_0x94eb('0x5b')](_0x94eb('0x5c'),_0x486f3f[_0x94eb('0x2a')]['id'],_0x328adf);var _0x738879=path[_0x94eb('0x59')](_0x5551d3,_0x1e9a91);var _0x4abe40=[];_0x4abe40[_0x94eb('0x5d')]({'model':db[_0x94eb('0x5e')],'as':_0x94eb('0x5e'),'raw':!![]});var _0x53dfce=[{'model':db['FaxMessage'],'as':_0x94eb('0x5f'),'attributes':['id',_0x94eb('0x37'),_0x94eb('0x60')],'include':_0x4abe40}];return db['FaxInteraction'][_0x94eb('0x34')]({'where':{'id':_0x486f3f[_0x94eb('0x2a')]['id']},'include':_0x53dfce})['then'](handleEntityNotFound(_0x123a10,null))[_0x94eb('0x1b')](function(_0x4dae0d){if(_0x4dae0d&&_0x4dae0d[_0x94eb('0x5f')]){var _0x2d3500=_0x4dae0d[_0x94eb('0x61')]({'plain':!![]});fs[_0x94eb('0x62')](_0x35ba29);for(var _0x20f113=0x0;_0x20f113<_0x2d3500[_0x94eb('0x5f')][_0x94eb('0x2f')];_0x20f113++){var _0x384150=_0x2d3500[_0x94eb('0x5f')][_0x20f113][_0x94eb('0x5e')];if(_0x384150){var _0x4c6397=path['join'](_0x377770,_0x384150[_0x94eb('0x63')]);if(fs[_0x94eb('0x64')](_0x4c6397)){fs[_0x94eb('0x65')](_0x4c6397)[_0x94eb('0x66')](fs[_0x94eb('0x67')](path[_0x94eb('0x59')](_0x35ba29,_0x384150['basename'])));}}}return BPromise[_0x94eb('0x68')]()[_0x94eb('0x1b')](function(){return new BPromise(function(_0xb369c0,_0xc3b882){zipdir(_0x35ba29,{'saveTo':_0x738879},function(_0xe548fb,_0x4773c1){if(_0xe548fb)return _0xc3b882(_0xe548fb);return _0xb369c0(_0x4773c1);});})[_0x94eb('0x1b')](function(){return new BPromise(function(_0x5c6bd0,_0x3191f9){rimraf(_0x35ba29,function(_0x253de0){if(_0x253de0)_0x3191f9(_0x253de0);return _0x5c6bd0();});});})[_0x94eb('0x1b')](function(){return _0x123a10[_0x94eb('0x53')](_0x738879,_0x1e9a91,function(_0x1d5412){if(_0x1d5412){console['log']('err',_0x1d5412);}else{fs[_0x94eb('0x69')](_0x738879);}});});});}else{return _0x123a10[_0x94eb('0x11')](0xc8);}})[_0x94eb('0x35')](handleError(_0x123a10,null));}; \ No newline at end of file +var _0x2935=['util','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','redis','localhost','./faxInteraction.socket','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','findAll','fax','user','catch','model','keys','FaxInteraction','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','params','describe','addMessage','ids','findOne','FaxMessage','sort','where','FaxInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird'];(function(_0x3e381c,_0x3e5ae9){var _0x1f4252=function(_0x25f0a3){while(--_0x25f0a3){_0x3e381c['push'](_0x3e381c['shift']());}};_0x1f4252(++_0x3e5ae9);}(_0x2935,0x184));var _0x5293=function(_0x544729,_0x20d30d){_0x544729=_0x544729-0x0;var _0x539484=_0x2935[_0x544729];return _0x539484;};'use strict';var rimraf=require(_0x5293('0x0'));var zipdir=require(_0x5293('0x1'));var moment=require(_0x5293('0x2'));var BPromise=require(_0x5293('0x3'));var util=require(_0x5293('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x5293('0x5'));var Redis=require(_0x5293('0x6'));var interaction=require(_0x5293('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x5293('0x8'))('api');var config=require(_0x5293('0x9'));var db=require('../../mysqldb')['db'];config[_0x5293('0xa')]=_['defaults'](config[_0x5293('0xa')],{'host':_0x5293('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5293('0xa')]));require(_0x5293('0xc'))['register'](socket);function respondWithStatusCode(_0x25c674,_0x2e35f3){_0x2e35f3=_0x2e35f3||0xcc;return function(_0x3ddb15){if(_0x3ddb15){return _0x25c674[_0x5293('0xd')](_0x2e35f3);}return _0x25c674[_0x5293('0xe')](_0x2e35f3)[_0x5293('0xf')]();};}function respondWithResult(_0xf0aeb3,_0x179d43){_0x179d43=_0x179d43||0xc8;return function(_0x27e0d3){if(_0x27e0d3){return _0xf0aeb3[_0x5293('0xe')](_0x179d43)[_0x5293('0x10')](_0x27e0d3);}};}function respondWithFilteredResult(_0x51fcfc,_0x3cb48e){return function(_0x4fde4f){if(_0x4fde4f){var _0x83e0fe=typeof _0x3cb48e['offset']===_0x5293('0x11')&&typeof _0x3cb48e['limit']===_0x5293('0x11');var _0x14c515=_0x4fde4f['count'];var _0x1a2138=_0x83e0fe?0x0:_0x3cb48e[_0x5293('0x12')];var _0x5bf7b1=_0x83e0fe?_0x4fde4f[_0x5293('0x13')]:_0x3cb48e[_0x5293('0x12')]+_0x3cb48e[_0x5293('0x14')];var _0x440f56;if(_0x5bf7b1>=_0x14c515){_0x5bf7b1=_0x14c515;_0x440f56=0xc8;}else{_0x440f56=0xce;}_0x51fcfc[_0x5293('0xe')](_0x440f56);return _0x51fcfc[_0x5293('0x15')](_0x5293('0x16'),_0x1a2138+'-'+_0x5bf7b1+'/'+_0x14c515)[_0x5293('0x10')](_0x4fde4f);}return null;};}function saveUpdates(_0x5a8b54){return function(_0x564163){if(_0x564163){return _0x564163[_0x5293('0x17')](_0x5a8b54)[_0x5293('0x18')](function(_0xac346d){return _0xac346d;});}return null;};}function removeEntity(_0x5c6941){return function(_0x4f7d73){if(_0x4f7d73){return _0x4f7d73[_0x5293('0x19')]()['then'](function(){_0x5c6941[_0x5293('0xe')](0xcc)[_0x5293('0xf')]();});}};}function handleEntityNotFound(_0x4368bf){return function(_0x4d8bfe){if(!_0x4d8bfe){_0x4368bf['sendStatus'](0x194);}return _0x4d8bfe;};}function handleError(_0x468d2e,_0x1b71f2){_0x1b71f2=_0x1b71f2||0x1f4;return function(_0x5c23a9){logger[_0x5293('0x1a')](_0x5c23a9[_0x5293('0x1b')]);if(_0x5c23a9[_0x5293('0x1c')]){delete _0x5c23a9[_0x5293('0x1c')];}_0x468d2e[_0x5293('0xe')](_0x1b71f2)[_0x5293('0x1d')](_0x5c23a9);};}exports[_0x5293('0x1e')]=function(_0x2b6001,_0x441e92){var _0x594446={};var _0x166e40=_[_0x5293('0x1f')](db['FaxInteraction'][_0x5293('0x20')],function(_0x42d99b){return{'name':_0x42d99b[_0x5293('0x21')],'type':_0x42d99b[_0x5293('0x22')]['key']};});_0x594446=qs[_0x5293('0x23')](_0x166e40,_0x2b6001);return interaction[_0x5293('0x24')](_0x5293('0x25'),_0x2b6001['query'],_0x2b6001[_0x5293('0x26')],_0x594446,_0x166e40)['then'](respondWithFilteredResult(_0x441e92,_0x594446))[_0x5293('0x27')](handleError(_0x441e92,null));};exports['show']=function(_0x12feeb,_0x59052e){var _0x7c7f78={'raw':![],'where':{'id':_0x12feeb['params']['id']}},_0x4be98c={};_0x4be98c[_0x5293('0x28')]=_[_0x5293('0x29')](db[_0x5293('0x2a')][_0x5293('0x20')]);_0x4be98c[_0x5293('0x2b')]=_[_0x5293('0x29')](_0x12feeb[_0x5293('0x2b')]);_0x4be98c[_0x5293('0x2c')]=_[_0x5293('0x2d')](_0x4be98c[_0x5293('0x28')],_0x4be98c[_0x5293('0x2b')]);_0x7c7f78[_0x5293('0x2e')]=_['intersection'](_0x4be98c[_0x5293('0x28')],qs['fields'](_0x12feeb[_0x5293('0x2b')][_0x5293('0x2f')]));_0x7c7f78['attributes']=_0x7c7f78[_0x5293('0x2e')][_0x5293('0x30')]?_0x7c7f78[_0x5293('0x2e')]:_0x4be98c[_0x5293('0x28')];if(_0x12feeb[_0x5293('0x2b')][_0x5293('0x31')]){_0x7c7f78[_0x5293('0x32')]=[{'all':!![]}];}_0x7c7f78=_['merge']({},_0x7c7f78,_0x12feeb[_0x5293('0x33')]);return db[_0x5293('0x2a')][_0x5293('0x34')](_0x7c7f78)[_0x5293('0x18')](handleEntityNotFound(_0x59052e,null))['then'](respondWithResult(_0x59052e,null))[_0x5293('0x27')](handleError(_0x59052e,null));};exports[_0x5293('0x35')]=function(_0x19848b,_0x5468d3){return db[_0x5293('0x2a')][_0x5293('0x35')](_0x19848b[_0x5293('0x36')],{})['then'](respondWithResult(_0x5468d3,0xc9))[_0x5293('0x27')](handleError(_0x5468d3,null));};exports[_0x5293('0x17')]=function(_0x48f727,_0x3368ba){if(_0x48f727[_0x5293('0x36')]['id']){delete _0x48f727['body']['id'];}return db[_0x5293('0x2a')][_0x5293('0x34')]({'where':{'id':_0x48f727[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x3368ba,null))['then'](saveUpdates(_0x48f727[_0x5293('0x36')],null))['then'](respondWithResult(_0x3368ba,null))[_0x5293('0x27')](handleError(_0x3368ba,null));};exports[_0x5293('0x19')]=function(_0x2ccbf8,_0x35fdca){return db['FaxInteraction']['find']({'where':{'id':_0x2ccbf8['params']['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x35fdca,null))['then'](removeEntity(_0x35fdca,null))['catch'](handleError(_0x35fdca,null));};exports[_0x5293('0x38')]=function(_0x48b514,_0x2bc7e2){return db[_0x5293('0x2a')][_0x5293('0x38')]()[_0x5293('0x18')](respondWithResult(_0x2bc7e2,null))[_0x5293('0x27')](handleError(_0x2bc7e2,null));};exports[_0x5293('0x39')]=function(_0x112bf2,_0xae76db){return db['FaxMessage']['find']({'where':{'id':_0x112bf2[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0xae76db,null))[_0x5293('0x18')](function(_0x34e585){if(_0x34e585){return _0x34e585['addMessage'](_0x112bf2[_0x5293('0x36')][_0x5293('0x3a')],_['omit'](_0x112bf2['body'],[_0x5293('0x3a'),'id'])||{});}})[_0x5293('0x18')](respondWithResult(_0xae76db,null))[_0x5293('0x27')](handleError(_0xae76db,null));};exports['getMessages']=function(_0x371b99,_0x1ee6dd){var _0x253b24={'raw':![],'where':{}};var _0x56e658={};var _0x2281cd={'count':0x0,'rows':[]};return db[_0x5293('0x2a')][_0x5293('0x3b')]({'where':{'id':_0x371b99['params']['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x1ee6dd,null))[_0x5293('0x18')](function(_0x1a9e5a){if(_0x1a9e5a){_0x56e658[_0x5293('0x28')]=_[_0x5293('0x29')](db[_0x5293('0x3c')][_0x5293('0x20')]);_0x56e658[_0x5293('0x2b')]=_[_0x5293('0x29')](_0x371b99[_0x5293('0x2b')]);_0x56e658[_0x5293('0x2c')]=_['intersection'](_0x56e658[_0x5293('0x28')],_0x56e658[_0x5293('0x2b')]);_0x253b24['attributes']=_['intersection'](_0x56e658[_0x5293('0x28')],qs['fields'](_0x371b99['query']['fields']));_0x253b24[_0x5293('0x2e')]=_0x253b24[_0x5293('0x2e')][_0x5293('0x30')]?_0x253b24[_0x5293('0x2e')]:_0x56e658[_0x5293('0x28')];if(!_0x371b99[_0x5293('0x2b')]['hasOwnProperty']('nolimit')){_0x253b24[_0x5293('0x14')]=qs[_0x5293('0x14')](_0x371b99[_0x5293('0x2b')]['limit']);_0x253b24[_0x5293('0x12')]=qs['offset'](_0x371b99[_0x5293('0x2b')][_0x5293('0x12')]);}_0x253b24['order']=qs[_0x5293('0x3d')](_0x371b99['query'][_0x5293('0x3d')]);_0x253b24['where']=qs['filters'](_['pick'](_0x371b99[_0x5293('0x2b')],_0x56e658[_0x5293('0x2c')]));_0x253b24[_0x5293('0x3e')][_0x5293('0x3f')]=_0x1a9e5a['id'];if(_0x371b99['query'][_0x5293('0x40')]){_0x253b24[_0x5293('0x3e')]=_[_0x5293('0x41')](_0x253b24[_0x5293('0x3e')],{'$or':_[_0x5293('0x1f')](_0x253b24[_0x5293('0x2e')],function(_0x41190c){var _0x3e71f9={};_0x3e71f9[_0x41190c]={'$like':'%'+_0x371b99[_0x5293('0x2b')][_0x5293('0x40')]+'%'};return _0x3e71f9;})});}if(_0x371b99['query']['$gte']){var _0x4518b1=_0x371b99[_0x5293('0x2b')][_0x5293('0x42')][_0x5293('0x43')](',');var _0x450caf={};_0x450caf[_0x4518b1[0x0]]={'$gte':moment(_0x4518b1[0x1])['format'](_0x5293('0x44'))};_0x253b24[_0x5293('0x3e')]=_[_0x5293('0x41')](_0x253b24[_0x5293('0x3e')],_0x450caf);}_0x253b24=_[_0x5293('0x41')]({},_0x253b24,_0x371b99[_0x5293('0x33')]);return db['FaxMessage'][_0x5293('0x13')]({'where':_0x253b24['where']})[_0x5293('0x18')](function(_0x4e69b2){_0x2281cd[_0x5293('0x13')]=_0x4e69b2;if(_0x371b99['query'][_0x5293('0x31')]){_0x253b24[_0x5293('0x32')]=[{'all':!![]}];}return db[_0x5293('0x3c')]['findAll'](_0x253b24);})[_0x5293('0x18')](function(_0x1739a3){_0x2281cd[_0x5293('0x45')]=_0x1739a3;return _0x2281cd;});}})['then'](respondWithFilteredResult(_0x1ee6dd,_0x253b24))[_0x5293('0x27')](handleError(_0x1ee6dd,null));};exports['addTags']=function(_0x21f479,_0xd841e7){return db[_0x5293('0x2a')][_0x5293('0x34')]({'where':{'id':_0x21f479[_0x5293('0x37')]['id']}})['then'](handleEntityNotFound(_0xd841e7,null))[_0x5293('0x18')](function(_0x14fae7){if(_0x14fae7){return _0x14fae7[_0x5293('0x46')](_0x21f479[_0x5293('0x36')][_0x5293('0x3a')],_[_0x5293('0x47')](_0x21f479[_0x5293('0x36')],[_0x5293('0x3a'),'id'])||{})[_0x5293('0x48')](function(){return db['Tag'][_0x5293('0x24')]({'attributes':['id','name','color'],'where':{'id':_0x21f479[_0x5293('0x36')][_0x5293('0x3a')]}});})[_0x5293('0x18')](function(_0x3ba09e){socket[_0x5293('0x49')](_0x5293('0x4a'),{'id':Number(_0x21f479[_0x5293('0x37')]['id']),'tags':_0x3ba09e||[]});return{'id':Number(_0x21f479[_0x5293('0x37')]['id']),'tags':_0x3ba09e||[]};});}})[_0x5293('0x18')](respondWithResult(_0xd841e7,null))[_0x5293('0x27')](handleError(_0xd841e7,null));};exports['removeTags']=function(_0x174a72,_0x2214cd){return db['FaxInteraction'][_0x5293('0x34')]({'where':{'id':_0x174a72[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x2214cd,null))[_0x5293('0x18')](function(_0x433eac){if(_0x433eac){return _0x433eac[_0x5293('0x4b')](_0x174a72[_0x5293('0x2b')][_0x5293('0x3a')]);}})[_0x5293('0x18')](respondWithStatusCode(_0x2214cd,null))[_0x5293('0x27')](handleError(_0x2214cd,null));};exports[_0x5293('0x4c')]=function(_0x33bf23,_0x51ff2a){var _0x4b3ba0=moment()[_0x5293('0x4d')]()['toString']();var _0xbe24ad=path[_0x5293('0x4e')](config[_0x5293('0x4f')],_0x5293('0x50'),'files',_0x5293('0x51'));var _0x17ae22=path[_0x5293('0x4e')](config['root'],_0x5293('0x50'),_0x5293('0x52'),_0x5293('0x53'));var _0x1f9b27=path[_0x5293('0x4e')](_0xbe24ad,_0x4b3ba0);var _0x582c5c=util[_0x5293('0x54')](_0x5293('0x55'),_0x33bf23[_0x5293('0x37')]['id'],_0x4b3ba0);var _0xd6f786=path[_0x5293('0x4e')](_0xbe24ad,_0x582c5c);var _0x599a2f=[];_0x599a2f[_0x5293('0x56')]({'model':db[_0x5293('0x57')],'as':_0x5293('0x57'),'raw':!![]});var _0x5f3bae=[{'model':db[_0x5293('0x3c')],'as':_0x5293('0x58'),'attributes':['id','body','createdAt'],'include':_0x599a2f}];return db[_0x5293('0x2a')]['find']({'where':{'id':_0x33bf23[_0x5293('0x37')]['id']},'include':_0x5f3bae})[_0x5293('0x18')](handleEntityNotFound(_0x51ff2a,null))['then'](function(_0x44e0b1){if(_0x44e0b1&&_0x44e0b1[_0x5293('0x58')]){var _0x2fef69=_0x44e0b1[_0x5293('0x59')]({'plain':!![]});fs[_0x5293('0x5a')](_0x1f9b27);for(var _0x468924=0x0;_0x468924<_0x2fef69[_0x5293('0x58')][_0x5293('0x30')];_0x468924++){var _0x158470=_0x2fef69[_0x5293('0x58')][_0x468924][_0x5293('0x57')];if(_0x158470){var _0x18147=path[_0x5293('0x4e')](_0x17ae22,_0x158470[_0x5293('0x5b')]);if(fs[_0x5293('0x5c')](_0x18147)){fs[_0x5293('0x5d')](_0x18147)[_0x5293('0x5e')](fs['createWriteStream'](path['join'](_0x1f9b27,_0x158470[_0x5293('0x5b')])));}}}return BPromise[_0x5293('0x5f')]()[_0x5293('0x18')](function(){return new BPromise(function(_0x5815fe,_0x16316f){zipdir(_0x1f9b27,{'saveTo':_0xd6f786},function(_0x2e4896,_0x1e7dbf){if(_0x2e4896)return _0x16316f(_0x2e4896);return _0x5815fe(_0x1e7dbf);});})[_0x5293('0x18')](function(){return new BPromise(function(_0x3da2e2,_0x230c07){rimraf(_0x1f9b27,function(_0x35b80f){if(_0x35b80f)_0x230c07(_0x35b80f);return _0x3da2e2();});});})[_0x5293('0x18')](function(){return _0x51ff2a[_0x5293('0x4c')](_0xd6f786,_0x582c5c,function(_0x3fffc0){if(_0x3fffc0){console['log'](_0x5293('0x60'),_0x3fffc0);}else{fs[_0x5293('0x61')](_0xd6f786);}});});});}else{return _0x51ff2a[_0x5293('0xd')](0xc8);}})[_0x5293('0x27')](handleError(_0x51ff2a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 348a726..0cc360e 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 _0xaa96=['FaxInteraction','FaxMessage','setMaxListeners','save','getUsers','Users','findAll','then','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xf3e445,_0x1e5964){var _0x42ee55=function(_0x8a173c){while(--_0x8a173c){_0xf3e445['push'](_0xf3e445['shift']());}};_0x42ee55(++_0x1e5964);}(_0xaa96,0x14e));var _0x6aa9=function(_0x5152bd,_0x52d717){_0x5152bd=_0x5152bd-0x0;var _0x31d784=_0xaa96[_0x5152bd];return _0x31d784;};'use strict';var EventEmitter=require(_0x6aa9('0x0'));var FaxInteraction=require(_0x6aa9('0x1'))['db'][_0x6aa9('0x2')];var FaxMessage=require(_0x6aa9('0x1'))['db'][_0x6aa9('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6aa9('0x4')](0x0);var events={'afterCreate':_0x6aa9('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8521cf){return function(_0x19a4b4,_0x3f4670,_0x452496){_0x19a4b4[_0x6aa9('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2fab46){_0x19a4b4['setDataValue'](_0x6aa9('0x7'),_0x2fab46['map'](function(_0x3013f4){return{'id':_0x3013f4['id']};}));return FaxMessage[_0x6aa9('0x8')]({'where':{'FaxInteractionId':_0x19a4b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6aa9('0x9')](function(_0x2d9201){_0x19a4b4[_0x6aa9('0xa')](_0x6aa9('0xb'),_0x2d9201[_0x6aa9('0xc')]);FaxInteractionEvents[_0x6aa9('0xd')](_0x8521cf+':'+_0x19a4b4['id'],_0x19a4b4);FaxInteractionEvents[_0x6aa9('0xd')](_0x8521cf,_0x19a4b4);_0x452496(null);})['catch'](_0x452496(null));};}for(var e in events){if(events[_0x6aa9('0xe')](e)){var event=events[e];FaxInteraction[_0x6aa9('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x33ae=['map','findAll','setDataValue','unreadMessages','emit','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','Users'];(function(_0x1cdb84,_0x508f70){var _0x3a4513=function(_0x55cce7){while(--_0x55cce7){_0x1cdb84['push'](_0x1cdb84['shift']());}};_0x3a4513(++_0x508f70);}(_0x33ae,0x18e));var _0xe33a=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x33ae[_0x5e3bb1];return _0x4c1278;};'use strict';var EventEmitter=require(_0xe33a('0x0'));var FaxInteraction=require(_0xe33a('0x1'))['db'][_0xe33a('0x2')];var FaxMessage=require(_0xe33a('0x1'))['db'][_0xe33a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe33a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe33a('0x5'),'afterDestroy':_0xe33a('0x6')};function emitEvent(_0x5f318f){return function(_0x59a44e,_0x5e1dc6,_0x235a8f){_0x59a44e[_0xe33a('0x7')]({'attributes':['id'],'raw':!![]})[_0xe33a('0x8')](function(_0x27ad09){_0x59a44e['setDataValue'](_0xe33a('0x9'),_0x27ad09[_0xe33a('0xa')](function(_0x41afb4){return{'id':_0x41afb4['id']};}));return FaxMessage[_0xe33a('0xb')]({'where':{'FaxInteractionId':_0x59a44e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xa1233){_0x59a44e[_0xe33a('0xc')](_0xe33a('0xd'),_0xa1233['length']);FaxInteractionEvents['emit'](_0x5f318f+':'+_0x59a44e['id'],_0x59a44e);FaxInteractionEvents[_0xe33a('0xe')](_0x5f318f,_0x59a44e);_0x235a8f(null);})['catch'](_0x235a8f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe33a('0xf')](e,emitEvent(event));}}module[_0xe33a('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index acdde13..ef21624 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 _0x4bab=['./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26cf55,_0x7a332e){var _0x403b06=function(_0x4e8e6a){while(--_0x4e8e6a){_0x26cf55['push'](_0x26cf55['shift']());}};_0x403b06(++_0x7a332e);}(_0x4bab,0xc8));var _0xb4ba=function(_0x5c11a9,_0x36dde1){_0x5c11a9=_0x5c11a9-0x0;var _0x376bd0=_0x4bab[_0x5c11a9];return _0x376bd0;};'use strict';var _=require('lodash');var util=require(_0xb4ba('0x0'));var logger=require(_0xb4ba('0x1'))(_0xb4ba('0x2'));var moment=require(_0xb4ba('0x3'));var BPromise=require(_0xb4ba('0x4'));var rp=require(_0xb4ba('0x5'));var fs=require('fs');var path=require(_0xb4ba('0x6'));var rimraf=require(_0xb4ba('0x7'));var config=require('../../config/environment');var attributes=require(_0xb4ba('0x8'));module[_0xb4ba('0x9')]=function(_0x1621cc,_0x53a860){return _0x1621cc[_0xb4ba('0xa')](_0xb4ba('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cfc52,_0x5d7245,_0x182fa7){if(_0x4cfc52[_0xb4ba('0xc')](_0xb4ba('0xd'))){_0x4cfc52[_0xb4ba('0xe')]=moment()[_0xb4ba('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x182fa7(null,_0x4cfc52);}}});}; \ No newline at end of file +var _0xad5f=['../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xad5f,0x1a8));var _0xfad5=function(_0x489618,_0x233987){_0x489618=_0x489618-0x0;var _0x3d34b8=_0xad5f[_0x489618];return _0x3d34b8;};'use strict';var _=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var logger=require(_0xfad5('0x2'))(_0xfad5('0x3'));var moment=require(_0xfad5('0x4'));var BPromise=require(_0xfad5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfad5('0x6'));var rimraf=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var attributes=require(_0xfad5('0x9'));module[_0xfad5('0xa')]=function(_0x180450,_0x43cae5){return _0x180450['define'](_0xfad5('0xb'),attributes,{'tableName':_0xfad5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39d228,_0xbe8f56,_0x535cb5){if(_0x39d228[_0xfad5('0xd')](_0xfad5('0xe'))){_0x39d228[_0xfad5('0xf')]=moment()[_0xfad5('0x10')](_0xfad5('0x11'));}_0x535cb5(null,_0x39d228);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5d3910d..7e8c5cb 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 _0x41ba=['request\x20sent','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','catch','AddTagsToFaxInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x41ba,0x6a));var _0xa41b=function(_0x5653c8,_0x2b4780){_0x5653c8=_0x5653c8-0x0;var _0x336904=_0x41ba[_0x5653c8];return _0x336904;};'use strict';var _=require(_0xa41b('0x0'));var util=require(_0xa41b('0x1'));var moment=require(_0xa41b('0x2'));var BPromise=require(_0xa41b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa41b('0x4'));var db=require(_0xa41b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa41b('0x6'));var config=require(_0xa41b('0x7'));var jayson=require(_0xa41b('0x8'));var client=jayson[_0xa41b('0x9')][_0xa41b('0xa')]({'port':0x232a});config['redis']=_[_0xa41b('0xb')](config[_0xa41b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa41b('0xd'))(new Redis(config[_0xa41b('0xc')]));require(_0xa41b('0xe'))[_0xa41b('0xf')](socket);function respondWithRpcPromise(_0x20b2ce,_0x5cfdeb,_0x34d0aa){return new BPromise(function(_0x51b49b,_0x54be62){return client[_0xa41b('0x10')](_0x20b2ce,_0x34d0aa)[_0xa41b('0x11')](function(_0xf6d1b0){logger[_0xa41b('0x12')](_0xa41b('0x13'),_0x5cfdeb,'request\x20sent');logger[_0xa41b('0x14')](_0xa41b('0x15'),_0x5cfdeb,'request\x20sent',JSON[_0xa41b('0x16')](_0xf6d1b0));if(_0xf6d1b0['error']){if(_0xf6d1b0['error'][_0xa41b('0x17')]===0x1f4){logger['error'](_0xa41b('0x13'),_0x5cfdeb,_0xf6d1b0[_0xa41b('0x18')][_0xa41b('0x19')]);return _0x54be62(_0xf6d1b0[_0xa41b('0x18')][_0xa41b('0x19')]);}logger[_0xa41b('0x18')](_0xa41b('0x13'),_0x5cfdeb,_0xf6d1b0[_0xa41b('0x18')]['message']);return _0x51b49b(_0xf6d1b0[_0xa41b('0x18')][_0xa41b('0x19')]);}else{logger[_0xa41b('0x12')](_0xa41b('0x13'),_0x5cfdeb,_0xa41b('0x1a'));_0x51b49b(_0xf6d1b0[_0xa41b('0x1b')][_0xa41b('0x19')]);}})['catch'](function(_0x8fcf6a){logger['error'](_0xa41b('0x13'),_0x5cfdeb,_0x8fcf6a);_0x54be62(_0x8fcf6a);});});}exports[_0xa41b('0x1c')]=function(_0x422795){var _0x3f2a8b=this;return new Promise(function(_0x399a95,_0x196182){return db[_0xa41b('0x1d')][_0xa41b('0x1e')](_0x422795['body'],{'raw':_0x422795['options']?_0x422795[_0xa41b('0x1f')][_0xa41b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422795[_0xa41b('0x1f')]?_0x422795[_0xa41b('0x1f')][_0xa41b('0x21')]||null:null,'attributes':_0x422795[_0xa41b('0x1f')]?_0x422795[_0xa41b('0x1f')][_0xa41b('0x22')]||null:null,'limit':_0x422795[_0xa41b('0x1f')]?_0x422795['options']['limit']||null:null})['then'](function(_0x3a5e98){logger[_0xa41b('0x12')](_0xa41b('0x1c'),_0x422795);logger[_0xa41b('0x14')](_0xa41b('0x1c'),_0x422795,JSON[_0xa41b('0x16')](_0x3a5e98));_0x399a95(_0x3a5e98);})[_0xa41b('0x23')](function(_0x1ed276){logger['error'](_0xa41b('0x1c'),_0x1ed276[_0xa41b('0x19')],_0x422795);_0x196182(_0x3f2a8b[_0xa41b('0x18')](0x1f4,_0x1ed276[_0xa41b('0x19')]));});});};exports[_0xa41b('0x24')]=function(_0x5ca839){return new Promise(function(_0x54aa7d,_0x2e4d6c){return db[_0xa41b('0x1d')][_0xa41b('0x25')]({'where':_0x5ca839[_0xa41b('0x1f')]?_0x5ca839[_0xa41b('0x1f')][_0xa41b('0x21')]||null:null})[_0xa41b('0x11')](function(_0x46bb32){if(_0x46bb32){return _0x46bb32[_0xa41b('0x26')](_0x5ca839[_0xa41b('0x27')][_0xa41b('0x28')],_[_0xa41b('0x29')](_0x5ca839[_0xa41b('0x27')],[_0xa41b('0x28'),'id'])||{});}})[_0xa41b('0x2a')](function(_0x6d598f){logger[_0xa41b('0x12')](_0xa41b('0x2b'),_0x5ca839);logger[_0xa41b('0x14')](_0xa41b('0x2b'),_0x5ca839,JSON[_0xa41b('0x16')](_0x6d598f));_0x54aa7d(_0x6d598f);})[_0xa41b('0x23')](function(_0x26dfb0){logger[_0xa41b('0x18')](_0xa41b('0x2b'),_0x26dfb0[_0xa41b('0x19')],_0x5ca839);_0x2e4d6c(_this[_0xa41b('0x18')](0x1f4,_0x26dfb0[_0xa41b('0x19')]));});});}; \ No newline at end of file +var _0x89c8=['redis','defaults','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x3ffa3b,_0xd9f4ec){var _0x3a8f92=function(_0x16c7af){while(--_0x16c7af){_0x3ffa3b['push'](_0x3ffa3b['shift']());}};_0x3a8f92(++_0xd9f4ec);}(_0x89c8,0x99));var _0x889c=function(_0x2b9a87,_0x2622aa){_0x2b9a87=_0x2b9a87-0x0;var _0x471592=_0x89c8[_0x2b9a87];return _0x471592;};'use strict';var _=require(_0x889c('0x0'));var util=require(_0x889c('0x1'));var moment=require(_0x889c('0x2'));var BPromise=require(_0x889c('0x3'));var rs=require(_0x889c('0x4'));var fs=require('fs');var Redis=require(_0x889c('0x5'));var db=require(_0x889c('0x6'))['db'];var utils=require(_0x889c('0x7'));var logger=require(_0x889c('0x8'))(_0x889c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x889c('0xa')]['http']({'port':0x232a});config[_0x889c('0xb')]=_[_0x889c('0xc')](config[_0x889c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x889c('0xd'))(new Redis(config[_0x889c('0xb')]));require(_0x889c('0xe'))[_0x889c('0xf')](socket);function respondWithRpcPromise(_0x39695a,_0x2f05fd,_0x3dac4f){return new BPromise(function(_0x27e94e,_0x497b57){return client['request'](_0x39695a,_0x3dac4f)[_0x889c('0x10')](function(_0x13247f){logger[_0x889c('0x11')](_0x889c('0x12'),_0x2f05fd,_0x889c('0x13'));logger[_0x889c('0x14')](_0x889c('0x15'),_0x2f05fd,_0x889c('0x13'),JSON[_0x889c('0x16')](_0x13247f));if(_0x13247f[_0x889c('0x17')]){if(_0x13247f[_0x889c('0x17')][_0x889c('0x18')]===0x1f4){logger['error'](_0x889c('0x12'),_0x2f05fd,_0x13247f[_0x889c('0x17')][_0x889c('0x19')]);return _0x497b57(_0x13247f['error'][_0x889c('0x19')]);}logger[_0x889c('0x17')](_0x889c('0x12'),_0x2f05fd,_0x13247f[_0x889c('0x17')][_0x889c('0x19')]);return _0x27e94e(_0x13247f['error'][_0x889c('0x19')]);}else{logger[_0x889c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2f05fd,'request\x20sent');_0x27e94e(_0x13247f['result'][_0x889c('0x19')]);}})[_0x889c('0x1a')](function(_0x51a0a5){logger[_0x889c('0x17')](_0x889c('0x12'),_0x2f05fd,_0x51a0a5);_0x497b57(_0x51a0a5);});});}exports[_0x889c('0x1b')]=function(_0x51e645){var _0x5d737f=this;return new Promise(function(_0x201ad9,_0x6302b4){return db[_0x889c('0x1c')][_0x889c('0x1d')](_0x51e645[_0x889c('0x1e')],{'raw':_0x51e645[_0x889c('0x1f')]?_0x51e645[_0x889c('0x1f')][_0x889c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e645[_0x889c('0x1f')]?_0x51e645[_0x889c('0x1f')][_0x889c('0x21')]||null:null,'attributes':_0x51e645['options']?_0x51e645[_0x889c('0x1f')]['attributes']||null:null,'limit':_0x51e645['options']?_0x51e645[_0x889c('0x1f')][_0x889c('0x22')]||null:null})[_0x889c('0x10')](function(_0x345122){logger['info'](_0x889c('0x1b'),_0x51e645);logger[_0x889c('0x14')](_0x889c('0x1b'),_0x51e645,JSON['stringify'](_0x345122));_0x201ad9(_0x345122);})[_0x889c('0x1a')](function(_0x3c7c6b){logger[_0x889c('0x17')](_0x889c('0x1b'),_0x3c7c6b['message'],_0x51e645);_0x6302b4(_0x5d737f[_0x889c('0x17')](0x1f4,_0x3c7c6b[_0x889c('0x19')]));});});};exports[_0x889c('0x23')]=function(_0x19199a){return new Promise(function(_0xd03322,_0x23c20e){return db['FaxInteraction'][_0x889c('0x24')]({'where':_0x19199a[_0x889c('0x1f')]?_0x19199a[_0x889c('0x1f')]['where']||null:null})['then'](function(_0x4e5f04){if(_0x4e5f04){return _0x4e5f04[_0x889c('0x25')](_0x19199a[_0x889c('0x1e')][_0x889c('0x26')],_['omit'](_0x19199a['body'],[_0x889c('0x26'),'id'])||{});}})[_0x889c('0x27')](function(_0x42864d){logger[_0x889c('0x11')](_0x889c('0x28'),_0x19199a);logger[_0x889c('0x14')](_0x889c('0x28'),_0x19199a,JSON[_0x889c('0x16')](_0x42864d));_0xd03322(_0x42864d);})['catch'](function(_0x3e37ef){logger[_0x889c('0x17')](_0x889c('0x28'),_0x3e37ef['message'],_0x19199a);_0x23c20e(_this[_0x889c('0x17')](0x1f4,_0x3e37ef[_0x889c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index b94af59..e093b3e 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 _0x72cb=['faxInteraction:','./faxInteraction.events','remove','emit','register','length'];(function(_0xb942b5,_0x2cc3d0){var _0x1e6c45=function(_0x15b738){while(--_0x15b738){_0xb942b5['push'](_0xb942b5['shift']());}};_0x1e6c45(++_0x2cc3d0);}(_0x72cb,0x1a5));var _0xb72c=function(_0x5f5b69,_0x591e87){_0x5f5b69=_0x5f5b69-0x0;var _0x52c0e7=_0x72cb[_0x5f5b69];return _0x52c0e7;};'use strict';var FaxInteractionEvents=require(_0xb72c('0x0'));var events=['save',_0xb72c('0x1'),'update'];function createListener(_0x33d67b,_0x1afa3b){return function(_0x35c773){_0x1afa3b[_0xb72c('0x2')](_0x33d67b,_0x35c773);};}function removeListener(_0x167690,_0x5f48f0){return function(){FaxInteractionEvents['removeListener'](_0x167690,_0x5f48f0);};}exports[_0xb72c('0x3')]=function(_0xcc58b0){for(var _0x41dc1c=0x0,_0x395be2=events[_0xb72c('0x4')];_0x41dc1c<_0x395be2;_0x41dc1c++){var _0x54f89f=events[_0x41dc1c];var _0x21784f=createListener(_0xb72c('0x5')+_0x54f89f,_0xcc58b0);FaxInteractionEvents['on'](_0x54f89f,_0x21784f);}}; \ No newline at end of file +var _0x32ff=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x48643b,_0x46f978){var _0x233542=function(_0x35d17d){while(--_0x35d17d){_0x48643b['push'](_0x48643b['shift']());}};_0x233542(++_0x46f978);}(_0x32ff,0x73));var _0xf32f=function(_0x44b3e2,_0x4df17f){_0x44b3e2=_0x44b3e2-0x0;var _0x32b21e=_0x32ff[_0x44b3e2];return _0x32b21e;};'use strict';var FaxInteractionEvents=require(_0xf32f('0x0'));var events=[_0xf32f('0x1'),_0xf32f('0x2'),_0xf32f('0x3')];function createListener(_0x13bf94,_0x634e2b){return function(_0xb588ad){_0x634e2b[_0xf32f('0x4')](_0x13bf94,_0xb588ad);};}function removeListener(_0x17652a,_0x525fe8){return function(){FaxInteractionEvents[_0xf32f('0x5')](_0x17652a,_0x525fe8);};}exports[_0xf32f('0x6')]=function(_0x40cb78){for(var _0x2a070e=0x0,_0x85963d=events['length'];_0x2a070e<_0x85963d;_0x2a070e++){var _0x3e4159=events[_0x2a070e];var _0x1a6594=createListener(_0xf32f('0x7')+_0x3e4159,_0x40cb78);FaxInteractionEvents['on'](_0x3e4159,_0x1a6594);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 614c244..7234857 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 _0xed48=['isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','put','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x25710d,_0x2d1644){var _0x2d0e15=function(_0xfb7369){while(--_0xfb7369){_0x25710d['push'](_0x25710d['shift']());}};_0x2d0e15(++_0x2d1644);}(_0xed48,0x176));var _0x8ed4=function(_0x4ef826,_0x2e0ac8){_0x4ef826=_0x4ef826-0x0;var _0x154b8=_0xed48[_0x4ef826];return _0x154b8;};'use strict';var multer=require(_0x8ed4('0x0'));var util=require(_0x8ed4('0x1'));var path=require('path');var timeout=require(_0x8ed4('0x2'));var express=require(_0x8ed4('0x3'));var router=express[_0x8ed4('0x4')]();var fs_extra=require(_0x8ed4('0x5'));var auth=require(_0x8ed4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8ed4('0x7'));var controller=require(_0x8ed4('0x8'));router[_0x8ed4('0x9')]('/',auth[_0x8ed4('0xa')](),controller[_0x8ed4('0xb')]);router[_0x8ed4('0x9')](_0x8ed4('0xc'),auth[_0x8ed4('0xa')](),controller['describe']);router[_0x8ed4('0x9')](_0x8ed4('0xd'),auth[_0x8ed4('0xa')](),controller[_0x8ed4('0xe')]);router['get'](_0x8ed4('0xf'),auth[_0x8ed4('0xa')](),controller[_0x8ed4('0x10')]);router['get'](_0x8ed4('0x11'),auth[_0x8ed4('0xa')](),controller[_0x8ed4('0x12')]);router['post']('/',auth[_0x8ed4('0xa')](),controller[_0x8ed4('0x13')]);router[_0x8ed4('0x14')](_0x8ed4('0xf'),auth['isAuthenticated'](),controller[_0x8ed4('0x15')]);router[_0x8ed4('0x14')](_0x8ed4('0x16'),auth[_0x8ed4('0xa')](),interaction[_0x8ed4('0x17')]('fax','faxinteraction:addtags'),controller['addTags']);router[_0x8ed4('0x18')](_0x8ed4('0xd'),auth[_0x8ed4('0xa')](),interaction[_0x8ed4('0x17')](_0x8ed4('0x19'),_0x8ed4('0x1a')),controller['update']);router[_0x8ed4('0x1b')](_0x8ed4('0xd'),auth['isAuthenticated'](),interaction[_0x8ed4('0x17')](_0x8ed4('0x19'),_0x8ed4('0x1c')),controller[_0x8ed4('0x1d')]);router['delete'](_0x8ed4('0x16'),auth[_0x8ed4('0xa')](),controller[_0x8ed4('0x1e')]);module[_0x8ed4('0x1f')]=router; \ No newline at end of file +var _0x23c9=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','destroy','removeTags'];(function(_0x295743,_0x39c842){var _0xcb6e35=function(_0x4a365d){while(--_0x4a365d){_0x295743['push'](_0x295743['shift']());}};_0xcb6e35(++_0x39c842);}(_0x23c9,0x1a1));var _0x923c=function(_0x54be74,_0x37c908){_0x54be74=_0x54be74-0x0;var _0x47da47=_0x23c9[_0x54be74];return _0x47da47;};'use strict';var multer=require('multer');var util=require(_0x923c('0x0'));var path=require(_0x923c('0x1'));var timeout=require(_0x923c('0x2'));var express=require(_0x923c('0x3'));var router=express['Router']();var fs_extra=require(_0x923c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x923c('0x5'));var config=require(_0x923c('0x6'));var controller=require(_0x923c('0x7'));router['get']('/',auth[_0x923c('0x8')](),controller[_0x923c('0x9')]);router[_0x923c('0xa')]('/describe',auth[_0x923c('0x8')](),controller[_0x923c('0xb')]);router['get'](_0x923c('0xc'),auth[_0x923c('0x8')](),controller[_0x923c('0xd')]);router[_0x923c('0xa')](_0x923c('0xe'),auth[_0x923c('0x8')](),controller[_0x923c('0xf')]);router['get'](_0x923c('0x10'),auth['isAuthenticated'](),controller[_0x923c('0x11')]);router[_0x923c('0x12')]('/',auth[_0x923c('0x8')](),controller[_0x923c('0x13')]);router[_0x923c('0x12')](_0x923c('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x923c('0x14'),auth[_0x923c('0x8')](),interaction[_0x923c('0x15')](_0x923c('0x16'),_0x923c('0x17')),controller[_0x923c('0x18')]);router[_0x923c('0x19')](_0x923c('0xc'),auth[_0x923c('0x8')](),interaction['tracked'](_0x923c('0x16'),_0x923c('0x1a')),controller[_0x923c('0x1b')]);router[_0x923c('0x1c')](_0x923c('0xc'),auth[_0x923c('0x8')](),interaction['tracked'](_0x923c('0x16'),'faxinteraction:destroy'),controller[_0x923c('0x1d')]);router[_0x923c('0x1c')](_0x923c('0x14'),auth['isAuthenticated'](),controller[_0x923c('0x1e')]);module[_0x923c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index be214c9..a3405f0 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 _0xa1a5=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x3a7ffc,_0x245387){_0x3a7ffc=_0x3a7ffc-0x0;var _0x37e4e3=_0xa1a5[_0x3a7ffc];return _0x37e4e3;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'body':{'type':Sequelize[_0x5a1a('0x1')](_0x5a1a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5a1a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5a1a('0x4')]('in',_0x5a1a('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5a1a('0x6')]}}; \ No newline at end of file +var _0xcb81=['medium','out','TEXT','DATE','sequelize','exports'];(function(_0x3fa05c,_0x5af872){var _0x55c937=function(_0x378862){while(--_0x378862){_0x3fa05c['push'](_0x3fa05c['shift']());}};_0x55c937(++_0x5af872);}(_0xcb81,0x154));var _0x1cb8=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xcb81[_0x102ff9];return _0x24fa97;};'use strict';var Sequelize=require(_0x1cb8('0x0'));module[_0x1cb8('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1cb8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1cb8('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1cb8('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 06241ff..6ab41d7 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 _0xf999=['server','files','attachments','join','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','show','params','fields','length','include','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','FaxInteractionId','UserId','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','isNil','download','root'];(function(_0x27ea64,_0x4a42a6){var _0x51c81d=function(_0x521372){while(--_0x521372){_0x27ea64['push'](_0x27ea64['shift']());}};_0x51c81d(++_0x4a42a6);}(_0xf999,0x1b4));var _0x9f99=function(_0x5a5e55,_0x2d3494){_0x5a5e55=_0x5a5e55-0x0;var _0x2bc92b=_0xf999[_0x5a5e55];return _0x2bc92b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f99('0x0'));var zipdir=require(_0x9f99('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f99('0x2'));var moment=require(_0x9f99('0x3'));var BPromise=require(_0x9f99('0x4'));var Mustache=require(_0x9f99('0x5'));var util=require(_0x9f99('0x6'));var path=require(_0x9f99('0x7'));var sox=require('sox');var csv=require(_0x9f99('0x8'));var ejs=require(_0x9f99('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f99('0xa'));var crypto=require(_0x9f99('0xb'));var jsforce=require(_0x9f99('0xc'));var deskjs=require(_0x9f99('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f99('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f99('0xf'));var qs=require(_0x9f99('0x10'));var as=require(_0x9f99('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f99('0x12'))(_0x9f99('0x13'));var utils=require(_0x9f99('0x14'));var config=require(_0x9f99('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f99('0x16'))['db'];config['redis']=_['defaults'](config[_0x9f99('0x17')],{'host':_0x9f99('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f99('0x17')]));require(_0x9f99('0x19'))[_0x9f99('0x1a')](socket);var jayson=require(_0x9f99('0x1b'));var client=jayson[_0x9f99('0x1c')][_0x9f99('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc416,_0x1e360d,_0x1a2174,_0x853fc3){return new BPromise(function(_0x22c98a,_0x13999d){var _0x1d3c2c=_0x853fc3||client;return _0x1d3c2c[_0x9f99('0x1e')](_0x3cc416,_0x1a2174)[_0x9f99('0x1f')](function(_0x3cdefc){logger['info'](_0x9f99('0x20'),_0x1e360d,'request\x20sent');logger['debug'](_0x9f99('0x21'),_0x1e360d,_0x9f99('0x22'),JSON[_0x9f99('0x23')](_0x3cdefc));if(_0x3cdefc['error']){if(_0x3cdefc[_0x9f99('0x24')]['code']===0x1f4){logger[_0x9f99('0x24')](_0x9f99('0x20'),_0x1e360d,_0x3cdefc[_0x9f99('0x24')][_0x9f99('0x25')]);return _0x13999d(_0x3cdefc[_0x9f99('0x24')][_0x9f99('0x25')]);}logger[_0x9f99('0x24')]('FaxMessage,\x20%s,\x20%s',_0x1e360d,_0x3cdefc['error'][_0x9f99('0x25')]);return _0x22c98a(_0x3cdefc[_0x9f99('0x24')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e360d,_0x9f99('0x22'));_0x22c98a(_0x3cdefc[_0x9f99('0x26')][_0x9f99('0x25')]);}})[_0x9f99('0x27')](function(_0xfdec87){logger['error'](_0x9f99('0x20'),_0x1e360d,_0xfdec87);_0x13999d(_0xfdec87);});});}function respondWithStatusCode(_0x27281c,_0x13338f){_0x13338f=_0x13338f||0xcc;return function(_0x250350){if(_0x250350){return _0x27281c[_0x9f99('0x28')](_0x13338f);}return _0x27281c[_0x9f99('0x29')](_0x13338f)[_0x9f99('0x2a')]();};}function respondWithResult(_0x23a370,_0x2fae39){_0x2fae39=_0x2fae39||0xc8;return function(_0x2bedb1){if(_0x2bedb1){return _0x23a370[_0x9f99('0x29')](_0x2fae39)[_0x9f99('0x2b')](_0x2bedb1);}};}function respondWithFilteredResult(_0x1dbc04,_0x21393b){return function(_0x124d36){if(_0x124d36){var _0x2c64b7=typeof _0x21393b[_0x9f99('0x2c')]==='undefined'&&typeof _0x21393b[_0x9f99('0x2d')]==='undefined';var _0x350642=_0x124d36['count'];var _0x477f8a=_0x2c64b7?0x0:_0x21393b[_0x9f99('0x2c')];var _0x86fd1b=_0x2c64b7?_0x124d36[_0x9f99('0x2e')]:_0x21393b[_0x9f99('0x2c')]+_0x21393b[_0x9f99('0x2d')];var _0x4050df;if(_0x86fd1b>=_0x350642){_0x86fd1b=_0x350642;_0x4050df=0xc8;}else{_0x4050df=0xce;}_0x1dbc04[_0x9f99('0x29')](_0x4050df);return _0x1dbc04[_0x9f99('0x2f')](_0x9f99('0x30'),_0x477f8a+'-'+_0x86fd1b+'/'+_0x350642)[_0x9f99('0x2b')](_0x124d36);}return null;};}function patchUpdates(_0x4d9bb3){return function(_0x386b78){try{jsonpatch[_0x9f99('0x31')](_0x386b78,_0x4d9bb3,!![]);}catch(_0x5c1d9b){return BPromise[_0x9f99('0x32')](_0x5c1d9b);}return _0x386b78[_0x9f99('0x33')]();};}function saveUpdates(_0x1cd700,_0x5c38e5){return function(_0x538d69){if(_0x538d69){return _0x538d69[_0x9f99('0x34')](_0x1cd700)[_0x9f99('0x1f')](function(_0x1c1924){return _0x1c1924;});}return null;};}function removeEntity(_0x313ac1,_0x5b3cca){return function(_0x430a0){if(_0x430a0){return _0x430a0[_0x9f99('0x35')]()[_0x9f99('0x1f')](function(){_0x313ac1['status'](0xcc)[_0x9f99('0x2a')]();});}};}function handleEntityNotFound(_0x4440c0,_0x2226b2){return function(_0x380e5f){if(!_0x380e5f){_0x4440c0['sendStatus'](0x194);}return _0x380e5f;};}function handleError(_0x5712ef,_0x10097c){_0x10097c=_0x10097c||0x1f4;return function(_0x70220a){logger[_0x9f99('0x24')](_0x70220a[_0x9f99('0x36')]);if(_0x70220a[_0x9f99('0x37')]){delete _0x70220a[_0x9f99('0x37')];}_0x5712ef[_0x9f99('0x29')](_0x10097c)[_0x9f99('0x38')](_0x70220a);};}exports[_0x9f99('0x39')]=function(_0x180ff8,_0x161bbf){var _0x5bfd5f={},_0x17eec8={},_0x64e56d={'count':0x0,'rows':[]};var _0x218b7b=_[_0x9f99('0x3a')](db[_0x9f99('0x3b')][_0x9f99('0x3c')],function(_0x46eeba){return{'name':_0x46eeba[_0x9f99('0x3d')],'type':_0x46eeba[_0x9f99('0x3e')]['key']};});_0x17eec8[_0x9f99('0x3f')]=_[_0x9f99('0x3a')](_0x218b7b,_0x9f99('0x37'));_0x17eec8[_0x9f99('0x40')]=_[_0x9f99('0x41')](_0x180ff8[_0x9f99('0x40')]);_0x17eec8['filters']=_[_0x9f99('0x42')](_0x17eec8[_0x9f99('0x3f')],_0x17eec8['query']);_0x5bfd5f[_0x9f99('0x43')]=_['intersection'](_0x17eec8[_0x9f99('0x3f')],qs['fields'](_0x180ff8[_0x9f99('0x40')]['fields']));_0x5bfd5f[_0x9f99('0x43')]=_0x5bfd5f['attributes']['length']?_0x5bfd5f[_0x9f99('0x43')]:_0x17eec8[_0x9f99('0x3f')];if(!_0x180ff8[_0x9f99('0x40')]['hasOwnProperty'](_0x9f99('0x44'))){_0x5bfd5f['limit']=qs[_0x9f99('0x2d')](_0x180ff8[_0x9f99('0x40')][_0x9f99('0x2d')]);_0x5bfd5f[_0x9f99('0x2c')]=qs['offset'](_0x180ff8[_0x9f99('0x40')][_0x9f99('0x2c')]);}_0x5bfd5f[_0x9f99('0x45')]=qs[_0x9f99('0x46')](_0x180ff8[_0x9f99('0x40')][_0x9f99('0x46')]);_0x5bfd5f['where']=qs['filters'](_[_0x9f99('0x47')](_0x180ff8[_0x9f99('0x40')],_0x17eec8[_0x9f99('0x48')]),_0x218b7b);if(_0x180ff8[_0x9f99('0x40')]['filter']){_0x5bfd5f[_0x9f99('0x49')]=_[_0x9f99('0x4a')](_0x5bfd5f[_0x9f99('0x49')],{'$or':_['map'](_0x218b7b,function(_0x4a3e3d){if(_0x4a3e3d[_0x9f99('0x3e')]!==_0x9f99('0x4b')){var _0x499adf={};_0x499adf[_0x4a3e3d['name']]={'$like':'%'+_0x180ff8[_0x9f99('0x40')]['filter']+'%'};return _0x499adf;}})});}_0x5bfd5f=_[_0x9f99('0x4a')]({},_0x5bfd5f,_0x180ff8[_0x9f99('0x4c')]);var _0x292832={'where':_0x5bfd5f[_0x9f99('0x49')]};return db['FaxMessage'][_0x9f99('0x2e')](_0x292832)[_0x9f99('0x1f')](function(_0x14273e){_0x64e56d[_0x9f99('0x2e')]=_0x14273e;if(_0x180ff8[_0x9f99('0x40')][_0x9f99('0x4d')]){_0x5bfd5f['include']=[{'all':!![]}];}return db[_0x9f99('0x3b')]['findAll'](_0x5bfd5f);})['then'](function(_0x401601){_0x64e56d['rows']=_0x401601;return _0x64e56d;})[_0x9f99('0x1f')](respondWithFilteredResult(_0x161bbf,_0x5bfd5f))[_0x9f99('0x27')](handleError(_0x161bbf,null));};exports[_0x9f99('0x4e')]=function(_0x339e7f,_0x546865){var _0x400716={'raw':!![],'where':{'id':_0x339e7f[_0x9f99('0x4f')]['id']}},_0x324c44={};_0x324c44['model']=_[_0x9f99('0x41')](db[_0x9f99('0x3b')][_0x9f99('0x3c')]);_0x324c44[_0x9f99('0x40')]=_['keys'](_0x339e7f[_0x9f99('0x40')]);_0x324c44[_0x9f99('0x48')]=_[_0x9f99('0x42')](_0x324c44['model'],_0x324c44['query']);_0x400716[_0x9f99('0x43')]=_[_0x9f99('0x42')](_0x324c44[_0x9f99('0x3f')],qs[_0x9f99('0x50')](_0x339e7f[_0x9f99('0x40')][_0x9f99('0x50')]));_0x400716[_0x9f99('0x43')]=_0x400716[_0x9f99('0x43')][_0x9f99('0x51')]?_0x400716[_0x9f99('0x43')]:_0x324c44[_0x9f99('0x3f')];if(_0x339e7f[_0x9f99('0x40')]['includeAll']){_0x400716[_0x9f99('0x52')]=[{'all':!![]}];}_0x400716=_[_0x9f99('0x4a')]({},_0x400716,_0x339e7f[_0x9f99('0x4c')]);return db[_0x9f99('0x3b')][_0x9f99('0x53')](_0x400716)[_0x9f99('0x1f')](handleEntityNotFound(_0x546865,null))[_0x9f99('0x1f')](respondWithResult(_0x546865,null))['catch'](handleError(_0x546865,null));};exports['update']=function(_0x51da7e,_0x3d9df7){if(_0x51da7e['body']['id']){delete _0x51da7e[_0x9f99('0x54')]['id'];}return db['FaxMessage'][_0x9f99('0x53')]({'where':{'id':_0x51da7e[_0x9f99('0x4f')]['id']}})[_0x9f99('0x1f')](handleEntityNotFound(_0x3d9df7,null))[_0x9f99('0x1f')](saveUpdates(_0x51da7e[_0x9f99('0x54')],null))[_0x9f99('0x1f')](respondWithResult(_0x3d9df7,null))['catch'](handleError(_0x3d9df7,null));};exports[_0x9f99('0x35')]=function(_0x57894b,_0x4da67a){return db['FaxMessage'][_0x9f99('0x53')]({'where':{'id':_0x57894b[_0x9f99('0x4f')]['id']}})[_0x9f99('0x1f')](handleEntityNotFound(_0x4da67a,null))[_0x9f99('0x1f')](removeEntity(_0x4da67a,null))[_0x9f99('0x27')](handleError(_0x4da67a,null));};exports[_0x9f99('0x55')]=function(_0x58a64e,_0x5fed1){return db['FaxMessage'][_0x9f99('0x55')]()[_0x9f99('0x1f')](respondWithResult(_0x5fed1,null))[_0x9f99('0x27')](handleError(_0x5fed1,null));};var interaction_log=require('../../config/logger')(_0x9f99('0x56'));exports[_0x9f99('0x57')]=function(_0x286a62,_0x3ae668,_0x22a1f8){var _0x21429f={'agent':{},'channel':_0x9f99('0x58')};if(_0x286a62['body']['id']){delete _0x286a62[_0x9f99('0x54')]['id'];}_0x286a62[_0x9f99('0x54')][_0x9f99('0x59')]=!![];_0x286a62[_0x9f99('0x54')][_0x9f99('0x5a')]=moment()[_0x9f99('0x5b')](_0x9f99('0x5c'));_0x286a62[_0x9f99('0x54')]['UserId']=_0x286a62[_0x9f99('0x54')]['UserId']||_0x286a62[_0x9f99('0x5d')]['id'];_0x21429f[_0x9f99('0x5e')]['id']=_0x286a62[_0x9f99('0x54')]['UserId'];return db[_0x9f99('0x3b')]['find']({'where':{'id':_0x286a62[_0x9f99('0x4f')]['id'],'UserId':null}})[_0x9f99('0x1f')](handleEntityNotFound(_0x3ae668,null))[_0x9f99('0x1f')](saveUpdates(_0x286a62[_0x9f99('0x54')],null))[_0x9f99('0x1f')](function(_0x4f246f){if(_0x4f246f){_0x21429f[_0x9f99('0x25')]=_0x4f246f[_0x9f99('0x5f')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4f246f[_0x9f99('0x60')]}});}return null;})[_0x9f99('0x1f')](handleEntityNotFound(_0x3ae668,null))[_0x9f99('0x1f')](function(_0x27117b){if(_0x27117b){return _0x27117b['update']({'UserId':_0x286a62[_0x9f99('0x54')][_0x9f99('0x61')],'read1stAt':_['isNil'](_0x27117b[_0x9f99('0x62')])?moment()['format'](_0x9f99('0x5c')):undefined});}return null;})[_0x9f99('0x1f')](function(_0x56a6f8){if(_0x56a6f8){_0x21429f[_0x9f99('0x63')]=_0x56a6f8['get']({'plain':!![]});interaction_log[_0x9f99('0x64')](_0x9f99('0x65'),_0x286a62[_0x9f99('0x5d')]['id'],_0x286a62[_0x9f99('0x5d')]['name'],_0x286a62['user'][_0x9f99('0x66')],_0x21429f[_0x9f99('0x63')]['id'],_0x286a62[_0x9f99('0x54')]?JSON[_0x9f99('0x23')](_0x286a62[_0x9f99('0x54')]):'null');return respondWithRpcPromise(_0x9f99('0x67'),_0x9f99('0x68'),_0x21429f);}return null;})[_0x9f99('0x1f')](function(_0x107bc1){var _0x4f963e=_0x9f99('0x69')+_0x107bc1[_0x9f99('0x25')][_0x9f99('0x6a')];return db[_0x9f99('0x6b')][_0x9f99('0x40')](_0x4f963e,{'type':db[_0x9f99('0x6c')][_0x9f99('0x6d')][_0x9f99('0x6e')],'raw':!![]})[_0x9f99('0x1f')](function(_0x208c71){return _0x208c71;});})[_0x9f99('0x1f')](function(_0xc4d3cb){if(_0xc4d3cb){_0x21429f[_0x9f99('0x25')][_0x9f99('0x6f')]=_0xc4d3cb[0x0];if(!_0x286a62[_0x9f99('0x54')][_0x9f99('0x61')])return;return db['User']['find']({'where':{'id':_0x286a62['body'][_0x9f99('0x61')],'role':_0x9f99('0x5e')},'attributes':['id',_0x9f99('0x37'),_0x9f99('0x70'),_0x9f99('0x71'),_0x9f99('0x72')],'raw':!![]});}return null;})[_0x9f99('0x1f')](function(_0x40d597){if(!_0x40d597)return null;_0x21429f[_0x9f99('0x25')][_0x9f99('0x5e')]=_0x40d597;return _0x21429f;})[_0x9f99('0x1f')](function(_0x746ec3){if(_0x746ec3){if(_0x286a62['body'][_0x9f99('0x73')]){_0x21429f[_0x9f99('0x25')][_0x9f99('0x74')]=util[_0x9f99('0x5b')](_0x9f99('0x75'),_0x286a62[_0x9f99('0x5d')][_0x9f99('0x37')]);_0x21429f[_0x9f99('0x25')]['channel']=_0x21429f['channel'];_0x21429f[_0x9f99('0x25')][_0x9f99('0x76')]=_0x21429f[_0x9f99('0x77')];_0x21429f[_0x9f99('0x25')][_0x9f99('0x78')]=_0x9f99('0x57');return respondWithRpcPromise(_0x9f99('0x79'),'EventManager',{'event':_0x9f99('0x7a'),'message':_0x21429f[_0x9f99('0x25')]},client9002)['then'](function(){return _0x21429f;});}return _0x21429f;}return null;})[_0x9f99('0x1f')](respondWithResult(_0x3ae668,null))[_0x9f99('0x27')](handleError(_0x3ae668,null));};var interaction_log=require('../../config/logger')(_0x9f99('0x56'));exports[_0x9f99('0x32')]=function(_0x4fc688,_0x223753,_0x47a870){var _0x2fd70a={'agent':{},'channel':_0x9f99('0x58')};if(_0x4fc688[_0x9f99('0x54')]['id']){delete _0x4fc688[_0x9f99('0x54')]['id'];}_0x4fc688[_0x9f99('0x54')][_0x9f99('0x61')]=_0x4fc688['body'][_0x9f99('0x61')]||_0x4fc688[_0x9f99('0x5d')]['id'];_0x2fd70a[_0x9f99('0x5e')]['id']=_0x4fc688['body']['UserId'];return db[_0x9f99('0x3b')][_0x9f99('0x53')]({'where':{'id':_0x4fc688['params']['id'],'UserId':null}})[_0x9f99('0x1f')](handleEntityNotFound(_0x223753,null))['then'](function(_0x5e95a6){if(_0x5e95a6){_0x2fd70a['message']=_0x5e95a6[_0x9f99('0x5f')]({'plain':!![]});return db[_0x9f99('0x7b')][_0x9f99('0x53')]({'where':{'id':_0x5e95a6[_0x9f99('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x223753,null))[_0x9f99('0x1f')](function(_0x3e3dc6){if(_0x3e3dc6){_0x2fd70a['interaction']=_0x3e3dc6[_0x9f99('0x5f')]({'plain':!![]});interaction_log[_0x9f99('0x64')](_0x9f99('0x7c'),_0x4fc688[_0x9f99('0x5d')]['id'],_0x4fc688[_0x9f99('0x5d')][_0x9f99('0x37')],_0x4fc688[_0x9f99('0x5d')][_0x9f99('0x66')],_0x2fd70a[_0x9f99('0x63')]['id'],_0x4fc688[_0x9f99('0x54')]?JSON[_0x9f99('0x23')](_0x4fc688[_0x9f99('0x54')]):_0x9f99('0x7d'));return respondWithRpcPromise(_0x9f99('0x7e'),_0x9f99('0x7f'),_0x2fd70a);}return null;})[_0x9f99('0x1f')](function(_0x16709e){var _0xca3ac4=_0x9f99('0x69')+_0x16709e[_0x9f99('0x25')]['ContactId'];return db[_0x9f99('0x6b')][_0x9f99('0x40')](_0xca3ac4,{'type':db[_0x9f99('0x6c')][_0x9f99('0x6d')]['SELECT'],'raw':!![]})[_0x9f99('0x1f')](function(_0x20475b){return _0x20475b;});})[_0x9f99('0x1f')](function(_0x1a1e0c){if(_0x1a1e0c){_0x2fd70a[_0x9f99('0x25')][_0x9f99('0x6f')]=_0x1a1e0c[0x0];if(!_0x4fc688[_0x9f99('0x54')][_0x9f99('0x61')])return;return db['User'][_0x9f99('0x53')]({'where':{'id':_0x4fc688[_0x9f99('0x54')][_0x9f99('0x61')],'role':_0x9f99('0x5e')},'attributes':['id','name',_0x9f99('0x70'),'email',_0x9f99('0x72')],'raw':!![]});}return null;})['then'](function(_0x4aa19f){if(!_0x4aa19f)return null;_0x2fd70a[_0x9f99('0x25')][_0x9f99('0x5e')]=_0x4aa19f;return _0x2fd70a;})['then'](function(_0x4563f0){if(_0x4563f0){_0x4563f0['message'][_0x9f99('0x74')]=util[_0x9f99('0x5b')]('SIP/%s',_0x4fc688[_0x9f99('0x5d')][_0x9f99('0x37')]);_0x4563f0[_0x9f99('0x25')][_0x9f99('0x77')]=_0x2fd70a[_0x9f99('0x77')];_0x4563f0['message']['motionChannel']=_0x2fd70a[_0x9f99('0x77')];_0x4563f0[_0x9f99('0x25')][_0x9f99('0x78')]='reject';respondWithRpcPromise(_0x9f99('0x79'),_0x9f99('0x79'),{'event':_0x9f99('0x80'),'message':_0x4563f0[_0x9f99('0x25')]},client9002);return _0x2fd70a;}return null;})[_0x9f99('0x1f')](respondWithResult(_0x223753,null))[_0x9f99('0x27')](handleError(_0x223753,null));};exports[_0x9f99('0x81')]=function(_0x387756,_0x544a19){var _0x26f1ad;return db[_0x9f99('0x3b')][_0x9f99('0x81')](_0x387756['body'],{})[_0x9f99('0x1f')](function(_0x57613b){_0x26f1ad=_0x57613b;return db['CmContact'][_0x9f99('0x82')]({'where':{'id':_0x26f1ad['ContactId']}});})[_0x9f99('0x1f')](function(_0x331cc7){if(_['isNil'](_0x331cc7)){return;}else{_0x26f1ad[_0x9f99('0x58')]=_0x331cc7[_0x9f99('0x58')];return db[_0x9f99('0x83')][_0x9f99('0x82')]({'where':{'id':_0x26f1ad[_0x9f99('0x84')]}});}})[_0x9f99('0x1f')](function(_0x2fb4c6){return respondWithRpcPromise(_0x9f99('0x85'),_0x9f99('0x85'),{'FaxAccountId':_['isNil'](_0x387756['body'])?undefined:_0x387756[_0x9f99('0x54')][_0x9f99('0x86')],'path':_['isNil'](_0x2fb4c6)?undefined:util[_0x9f99('0x5b')](_0x9f99('0x87'),_0x2fb4c6[_0x9f99('0x88')]),'fax':_[_0x9f99('0x89')](_0x26f1ad[_0x9f99('0x58')])?undefined:_0x26f1ad[_0x9f99('0x58')],'AttachmentId':_0x26f1ad[_0x9f99('0x84')]},client9002);})[_0x9f99('0x1f')](respondWithResult(_0x544a19,0xc9))[_0x9f99('0x27')](handleError(_0x544a19,null));};exports[_0x9f99('0x8a')]=function(_0x5c0632,_0x279d5d){var _0x1b0008=path['join'](config[_0x9f99('0x8b')],_0x9f99('0x8c'),_0x9f99('0x8d'),_0x9f99('0x8e'));return db[_0x9f99('0x3b')][_0x9f99('0x53')]({'where':{'id':_0x5c0632[_0x9f99('0x4f')]['id']},'include':[{'model':db[_0x9f99('0x83')],'as':_0x9f99('0x83')}]})[_0x9f99('0x1f')](handleEntityNotFound(_0x279d5d,null))['then'](function(_0x785e04){if(_0x785e04){return _0x279d5d['download'](path[_0x9f99('0x8f')](_0x1b0008,_0x785e04[_0x9f99('0x83')]['basename']));}})[_0x9f99('0x27')](handleError(_0x279d5d,null));}; \ No newline at end of file +var _0xc589=['download','root','files','join','basename','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','where','includeAll','findAll','rows','show','params','include','options','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','internal','channel','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc589,0x99));var _0x9c58=function(_0x54271f,_0x262e0c){_0x54271f=_0x54271f-0x0;var _0x53b7c7=_0xc589[_0x54271f];return _0x53b7c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c58('0x0'));var zipdir=require(_0x9c58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c58('0x2'));var moment=require('moment');var BPromise=require(_0x9c58('0x3'));var Mustache=require(_0x9c58('0x4'));var util=require(_0x9c58('0x5'));var path=require(_0x9c58('0x6'));var sox=require(_0x9c58('0x7'));var csv=require(_0x9c58('0x8'));var ejs=require(_0x9c58('0x9'));var fs=require('fs');var fs_extra=require(_0x9c58('0xa'));var _=require(_0x9c58('0xb'));var squel=require(_0x9c58('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c58('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9c58('0x8'));var querystring=require(_0x9c58('0xe'));var Papa=require(_0x9c58('0xf'));var Redis=require(_0x9c58('0x10'));var authService=require(_0x9c58('0x11'));var qs=require(_0x9c58('0x12'));var as=require(_0x9c58('0x13'));var hardwareService=require(_0x9c58('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9c58('0x15'));var licenseUtil=require(_0x9c58('0x16'));var db=require(_0x9c58('0x17'))['db'];config[_0x9c58('0x18')]=_['defaults'](config[_0x9c58('0x18')],{'host':_0x9c58('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0x9c58('0x1a')](socket);var jayson=require(_0x9c58('0x1b'));var client=jayson[_0x9c58('0x1c')][_0x9c58('0x1d')]({'port':0x232c});var client9002=jayson[_0x9c58('0x1c')][_0x9c58('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x150869,_0x592423,_0xbeb89e,_0x57e11c){return new BPromise(function(_0xdb1775,_0x169167){var _0x5c9bcf=_0x57e11c||client;return _0x5c9bcf[_0x9c58('0x1e')](_0x150869,_0xbeb89e)[_0x9c58('0x1f')](function(_0x3bef3f){logger[_0x9c58('0x20')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x9c58('0x21'));logger['debug'](_0x9c58('0x22'),_0x592423,_0x9c58('0x21'),JSON['stringify'](_0x3bef3f));if(_0x3bef3f['error']){if(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x24')]===0x1f4){logger[_0x9c58('0x23')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);return _0x169167(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);}logger[_0x9c58('0x23')](_0x9c58('0x26'),_0x592423,_0x3bef3f['error'][_0x9c58('0x25')]);return _0xdb1775(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);}else{logger[_0x9c58('0x20')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x9c58('0x21'));_0xdb1775(_0x3bef3f[_0x9c58('0x27')][_0x9c58('0x25')]);}})[_0x9c58('0x28')](function(_0x430dfc){logger[_0x9c58('0x23')](_0x9c58('0x26'),_0x592423,_0x430dfc);_0x169167(_0x430dfc);});});}function respondWithStatusCode(_0x3578dd,_0x35a418){_0x35a418=_0x35a418||0xcc;return function(_0x3836d1){if(_0x3836d1){return _0x3578dd[_0x9c58('0x29')](_0x35a418);}return _0x3578dd[_0x9c58('0x2a')](_0x35a418)['end']();};}function respondWithResult(_0x36e2c9,_0x13f442){_0x13f442=_0x13f442||0xc8;return function(_0x57aeb1){if(_0x57aeb1){return _0x36e2c9[_0x9c58('0x2a')](_0x13f442)['json'](_0x57aeb1);}};}function respondWithFilteredResult(_0x342da1,_0x4cd1c2){return function(_0x4f35c1){if(_0x4f35c1){var _0x334141=typeof _0x4cd1c2[_0x9c58('0x2b')]===_0x9c58('0x2c')&&typeof _0x4cd1c2[_0x9c58('0x2d')]===_0x9c58('0x2c');var _0x327151=_0x4f35c1[_0x9c58('0x2e')];var _0x5166c9=_0x334141?0x0:_0x4cd1c2[_0x9c58('0x2b')];var _0x5a83dc=_0x334141?_0x4f35c1[_0x9c58('0x2e')]:_0x4cd1c2['offset']+_0x4cd1c2[_0x9c58('0x2d')];var _0x2e2bf7;if(_0x5a83dc>=_0x327151){_0x5a83dc=_0x327151;_0x2e2bf7=0xc8;}else{_0x2e2bf7=0xce;}_0x342da1[_0x9c58('0x2a')](_0x2e2bf7);return _0x342da1[_0x9c58('0x2f')](_0x9c58('0x30'),_0x5166c9+'-'+_0x5a83dc+'/'+_0x327151)[_0x9c58('0x31')](_0x4f35c1);}return null;};}function patchUpdates(_0x1edb6c){return function(_0x45aebb){try{jsonpatch[_0x9c58('0x32')](_0x45aebb,_0x1edb6c,!![]);}catch(_0x240c7d){return BPromise[_0x9c58('0x33')](_0x240c7d);}return _0x45aebb[_0x9c58('0x34')]();};}function saveUpdates(_0x560bb0,_0x3cc7ea){return function(_0x4d1485){if(_0x4d1485){return _0x4d1485[_0x9c58('0x35')](_0x560bb0)[_0x9c58('0x1f')](function(_0x524637){return _0x524637;});}return null;};}function removeEntity(_0x5b70c2,_0x181cbd){return function(_0x2c4ee9){if(_0x2c4ee9){return _0x2c4ee9[_0x9c58('0x36')]()[_0x9c58('0x1f')](function(){_0x5b70c2[_0x9c58('0x2a')](0xcc)[_0x9c58('0x37')]();});}};}function handleEntityNotFound(_0x5436cb,_0x150b7a){return function(_0x127b4b){if(!_0x127b4b){_0x5436cb[_0x9c58('0x29')](0x194);}return _0x127b4b;};}function handleError(_0xee5cf1,_0x48de68){_0x48de68=_0x48de68||0x1f4;return function(_0x26a22e){logger[_0x9c58('0x23')](_0x26a22e[_0x9c58('0x38')]);if(_0x26a22e[_0x9c58('0x39')]){delete _0x26a22e[_0x9c58('0x39')];}_0xee5cf1[_0x9c58('0x2a')](_0x48de68)[_0x9c58('0x3a')](_0x26a22e);};}exports['index']=function(_0xf2fecc,_0x24b95c){var _0xf0299e={},_0x2dedc8={},_0x3f4982={'count':0x0,'rows':[]};var _0x4a6674=_[_0x9c58('0x3b')](db[_0x9c58('0x3c')][_0x9c58('0x3d')],function(_0x3f8992){return{'name':_0x3f8992[_0x9c58('0x3e')],'type':_0x3f8992['type'][_0x9c58('0x3f')]};});_0x2dedc8[_0x9c58('0x40')]=_[_0x9c58('0x3b')](_0x4a6674,'name');_0x2dedc8['query']=_[_0x9c58('0x41')](_0xf2fecc[_0x9c58('0x42')]);_0x2dedc8[_0x9c58('0x43')]=_[_0x9c58('0x44')](_0x2dedc8[_0x9c58('0x40')],_0x2dedc8[_0x9c58('0x42')]);_0xf0299e[_0x9c58('0x45')]=_[_0x9c58('0x44')](_0x2dedc8[_0x9c58('0x40')],qs[_0x9c58('0x46')](_0xf2fecc[_0x9c58('0x42')][_0x9c58('0x46')]));_0xf0299e[_0x9c58('0x45')]=_0xf0299e['attributes'][_0x9c58('0x47')]?_0xf0299e['attributes']:_0x2dedc8[_0x9c58('0x40')];if(!_0xf2fecc['query'][_0x9c58('0x48')](_0x9c58('0x49'))){_0xf0299e[_0x9c58('0x2d')]=qs[_0x9c58('0x2d')](_0xf2fecc['query'][_0x9c58('0x2d')]);_0xf0299e['offset']=qs[_0x9c58('0x2b')](_0xf2fecc['query'][_0x9c58('0x2b')]);}_0xf0299e[_0x9c58('0x4a')]=qs['sort'](_0xf2fecc['query'][_0x9c58('0x4b')]);_0xf0299e['where']=qs[_0x9c58('0x43')](_[_0x9c58('0x4c')](_0xf2fecc[_0x9c58('0x42')],_0x2dedc8[_0x9c58('0x43')]),_0x4a6674);if(_0xf2fecc['query'][_0x9c58('0x4d')]){_0xf0299e['where']=_[_0x9c58('0x4e')](_0xf0299e['where'],{'$or':_[_0x9c58('0x3b')](_0x4a6674,function(_0xcaceb9){if(_0xcaceb9[_0x9c58('0x4f')]!==_0x9c58('0x50')){var _0x47f2fe={};_0x47f2fe[_0xcaceb9[_0x9c58('0x39')]]={'$like':'%'+_0xf2fecc[_0x9c58('0x42')]['filter']+'%'};return _0x47f2fe;}})});}_0xf0299e=_[_0x9c58('0x4e')]({},_0xf0299e,_0xf2fecc['options']);var _0x42469b={'where':_0xf0299e[_0x9c58('0x51')]};return db[_0x9c58('0x3c')][_0x9c58('0x2e')](_0x42469b)[_0x9c58('0x1f')](function(_0x61b503){_0x3f4982[_0x9c58('0x2e')]=_0x61b503;if(_0xf2fecc[_0x9c58('0x42')][_0x9c58('0x52')]){_0xf0299e['include']=[{'all':!![]}];}return db[_0x9c58('0x3c')][_0x9c58('0x53')](_0xf0299e);})[_0x9c58('0x1f')](function(_0x16a603){_0x3f4982[_0x9c58('0x54')]=_0x16a603;return _0x3f4982;})['then'](respondWithFilteredResult(_0x24b95c,_0xf0299e))[_0x9c58('0x28')](handleError(_0x24b95c,null));};exports[_0x9c58('0x55')]=function(_0x99f924,_0x546b61){var _0x3043da={'raw':!![],'where':{'id':_0x99f924[_0x9c58('0x56')]['id']}},_0xac588c={};_0xac588c[_0x9c58('0x40')]=_[_0x9c58('0x41')](db['FaxMessage'][_0x9c58('0x3d')]);_0xac588c[_0x9c58('0x42')]=_[_0x9c58('0x41')](_0x99f924['query']);_0xac588c[_0x9c58('0x43')]=_['intersection'](_0xac588c[_0x9c58('0x40')],_0xac588c[_0x9c58('0x42')]);_0x3043da[_0x9c58('0x45')]=_[_0x9c58('0x44')](_0xac588c[_0x9c58('0x40')],qs[_0x9c58('0x46')](_0x99f924['query'][_0x9c58('0x46')]));_0x3043da['attributes']=_0x3043da['attributes']['length']?_0x3043da['attributes']:_0xac588c[_0x9c58('0x40')];if(_0x99f924[_0x9c58('0x42')][_0x9c58('0x52')]){_0x3043da[_0x9c58('0x57')]=[{'all':!![]}];}_0x3043da=_['merge']({},_0x3043da,_0x99f924[_0x9c58('0x58')]);return db[_0x9c58('0x3c')][_0x9c58('0x59')](_0x3043da)[_0x9c58('0x1f')](handleEntityNotFound(_0x546b61,null))[_0x9c58('0x1f')](respondWithResult(_0x546b61,null))[_0x9c58('0x28')](handleError(_0x546b61,null));};exports[_0x9c58('0x35')]=function(_0x2742b6,_0x20d48f){if(_0x2742b6[_0x9c58('0x5a')]['id']){delete _0x2742b6[_0x9c58('0x5a')]['id'];}return db[_0x9c58('0x3c')][_0x9c58('0x59')]({'where':{'id':_0x2742b6['params']['id']}})[_0x9c58('0x1f')](handleEntityNotFound(_0x20d48f,null))[_0x9c58('0x1f')](saveUpdates(_0x2742b6[_0x9c58('0x5a')],null))[_0x9c58('0x1f')](respondWithResult(_0x20d48f,null))[_0x9c58('0x28')](handleError(_0x20d48f,null));};exports[_0x9c58('0x36')]=function(_0x2e7c58,_0x5e16ac){return db[_0x9c58('0x3c')]['find']({'where':{'id':_0x2e7c58[_0x9c58('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e16ac,null))['then'](removeEntity(_0x5e16ac,null))[_0x9c58('0x28')](handleError(_0x5e16ac,null));};exports[_0x9c58('0x5b')]=function(_0xb5ed2d,_0x22730c){return db[_0x9c58('0x3c')][_0x9c58('0x5b')]()['then'](respondWithResult(_0x22730c,null))[_0x9c58('0x28')](handleError(_0x22730c,null));};var interaction_log=require(_0x9c58('0x5c'))(_0x9c58('0x5d'));exports[_0x9c58('0x5e')]=function(_0xb1f259,_0x215510,_0x521e79){var _0x2a8800={'agent':{},'channel':_0x9c58('0x5f')};if(_0xb1f259['body']['id']){delete _0xb1f259[_0x9c58('0x5a')]['id'];}_0xb1f259['body'][_0x9c58('0x60')]=!![];_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x61')]=moment()[_0x9c58('0x62')](_0x9c58('0x63'));_0xb1f259[_0x9c58('0x5a')]['UserId']=_0xb1f259['body'][_0x9c58('0x64')]||_0xb1f259['user']['id'];_0x2a8800['agent']['id']=_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x64')];return db[_0x9c58('0x3c')]['find']({'where':{'id':_0xb1f259[_0x9c58('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x215510,null))['then'](saveUpdates(_0xb1f259[_0x9c58('0x5a')],null))[_0x9c58('0x1f')](function(_0xec72df){if(_0xec72df){_0x2a8800['message']=_0xec72df['get']({'plain':!![]});return db[_0x9c58('0x65')]['find']({'where':{'id':_0xec72df['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x215510,null))['then'](function(_0x591260){if(_0x591260){return _0x591260[_0x9c58('0x35')]({'UserId':_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x64')],'read1stAt':_[_0x9c58('0x66')](_0x591260['read1stAt'])?moment()[_0x9c58('0x62')](_0x9c58('0x63')):undefined});}return null;})[_0x9c58('0x1f')](function(_0x4b6f82){if(_0x4b6f82){_0x2a8800[_0x9c58('0x67')]=_0x4b6f82[_0x9c58('0x68')]({'plain':!![]});interaction_log[_0x9c58('0x20')](_0x9c58('0x69'),_0xb1f259[_0x9c58('0x6a')]['id'],_0xb1f259[_0x9c58('0x6a')][_0x9c58('0x39')],_0xb1f259[_0x9c58('0x6a')]['role'],_0x2a8800[_0x9c58('0x67')]['id'],_0xb1f259[_0x9c58('0x5a')]?JSON[_0x9c58('0x6b')](_0xb1f259[_0x9c58('0x5a')]):_0x9c58('0x6c'));return respondWithRpcPromise(_0x9c58('0x6d'),_0x9c58('0x6e'),_0x2a8800);}return null;})[_0x9c58('0x1f')](function(_0x59b0eb){var _0x5a08d3=_0x9c58('0x6f')+_0x59b0eb[_0x9c58('0x25')]['ContactId'];return db['sequelize'][_0x9c58('0x42')](_0x5a08d3,{'type':db[_0x9c58('0x70')][_0x9c58('0x71')][_0x9c58('0x72')],'raw':!![]})[_0x9c58('0x1f')](function(_0x57dcc1){return _0x57dcc1;});})[_0x9c58('0x1f')](function(_0x337a1a){if(_0x337a1a){_0x2a8800['message'][_0x9c58('0x73')]=_0x337a1a[0x0];if(!_0xb1f259[_0x9c58('0x5a')]['UserId'])return;return db[_0x9c58('0x74')][_0x9c58('0x59')]({'where':{'id':_0xb1f259['body'][_0x9c58('0x64')],'role':_0x9c58('0x75')},'attributes':['id','name',_0x9c58('0x76'),_0x9c58('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x54d566){if(!_0x54d566)return null;_0x2a8800[_0x9c58('0x25')][_0x9c58('0x75')]=_0x54d566;return _0x2a8800;})['then'](function(_0x33affa){if(_0x33affa){if(_0xb1f259['body'][_0x9c58('0x78')]){_0x2a8800[_0x9c58('0x25')][_0x9c58('0x79')]=util[_0x9c58('0x62')](_0x9c58('0x7a'),_0xb1f259['user'][_0x9c58('0x39')]);_0x2a8800[_0x9c58('0x25')]['channel']=_0x2a8800['channel'];_0x2a8800[_0x9c58('0x25')][_0x9c58('0x7b')]=_0x2a8800['channel'];_0x2a8800[_0x9c58('0x25')][_0x9c58('0x7c')]=_0x9c58('0x5e');return respondWithRpcPromise('EventManager',_0x9c58('0x7d'),{'event':_0x9c58('0x7e'),'message':_0x2a8800[_0x9c58('0x25')]},client9002)[_0x9c58('0x1f')](function(){return _0x2a8800;});}return _0x2a8800;}return null;})['then'](respondWithResult(_0x215510,null))[_0x9c58('0x28')](handleError(_0x215510,null));};var interaction_log=require(_0x9c58('0x5c'))(_0x9c58('0x5d'));exports[_0x9c58('0x33')]=function(_0x56b1d9,_0x5836b8,_0x588f51){var _0x5d33c8={'agent':{},'channel':_0x9c58('0x5f')};if(_0x56b1d9['body']['id']){delete _0x56b1d9[_0x9c58('0x5a')]['id'];}_0x56b1d9[_0x9c58('0x5a')]['UserId']=_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')]||_0x56b1d9[_0x9c58('0x6a')]['id'];_0x5d33c8[_0x9c58('0x75')]['id']=_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')];return db[_0x9c58('0x3c')][_0x9c58('0x59')]({'where':{'id':_0x56b1d9[_0x9c58('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5836b8,null))[_0x9c58('0x1f')](function(_0x1dee42){if(_0x1dee42){_0x5d33c8[_0x9c58('0x25')]=_0x1dee42[_0x9c58('0x68')]({'plain':!![]});return db[_0x9c58('0x65')][_0x9c58('0x59')]({'where':{'id':_0x1dee42['FaxInteractionId']}});}return null;})[_0x9c58('0x1f')](handleEntityNotFound(_0x5836b8,null))['then'](function(_0x24390e){if(_0x24390e){_0x5d33c8[_0x9c58('0x67')]=_0x24390e[_0x9c58('0x68')]({'plain':!![]});interaction_log[_0x9c58('0x20')](_0x9c58('0x7f'),_0x56b1d9['user']['id'],_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x39')],_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x80')],_0x5d33c8[_0x9c58('0x67')]['id'],_0x56b1d9[_0x9c58('0x5a')]?JSON['stringify'](_0x56b1d9[_0x9c58('0x5a')]):_0x9c58('0x6c'));return respondWithRpcPromise(_0x9c58('0x81'),_0x9c58('0x82'),_0x5d33c8);}return null;})['then'](function(_0xf6be61){var _0x1da824='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf6be61[_0x9c58('0x25')][_0x9c58('0x83')];return db[_0x9c58('0x84')][_0x9c58('0x42')](_0x1da824,{'type':db[_0x9c58('0x70')][_0x9c58('0x71')][_0x9c58('0x72')],'raw':!![]})[_0x9c58('0x1f')](function(_0x2c73ee){return _0x2c73ee;});})[_0x9c58('0x1f')](function(_0x5c0acf){if(_0x5c0acf){_0x5d33c8[_0x9c58('0x25')][_0x9c58('0x73')]=_0x5c0acf[0x0];if(!_0x56b1d9['body'][_0x9c58('0x64')])return;return db[_0x9c58('0x74')][_0x9c58('0x59')]({'where':{'id':_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')],'role':'agent'},'attributes':['id',_0x9c58('0x39'),'fullname','email',_0x9c58('0x85')],'raw':!![]});}return null;})[_0x9c58('0x1f')](function(_0x146f75){if(!_0x146f75)return null;_0x5d33c8[_0x9c58('0x25')]['agent']=_0x146f75;return _0x5d33c8;})[_0x9c58('0x1f')](function(_0x525401){if(_0x525401){_0x525401[_0x9c58('0x25')][_0x9c58('0x79')]=util['format'](_0x9c58('0x7a'),_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x39')]);_0x525401['message']['channel']=_0x5d33c8[_0x9c58('0x86')];_0x525401[_0x9c58('0x25')][_0x9c58('0x7b')]=_0x5d33c8[_0x9c58('0x86')];_0x525401[_0x9c58('0x25')]['event']=_0x9c58('0x33');respondWithRpcPromise('EventManager',_0x9c58('0x7d'),{'event':'rejectmessage','message':_0x525401[_0x9c58('0x25')]},client9002);return _0x5d33c8;}return null;})[_0x9c58('0x1f')](respondWithResult(_0x5836b8,null))[_0x9c58('0x28')](handleError(_0x5836b8,null));};exports[_0x9c58('0x87')]=function(_0x13dfeb,_0x2f6b8e){var _0xa5d6d6;return db[_0x9c58('0x3c')]['create'](_0x13dfeb[_0x9c58('0x5a')],{})[_0x9c58('0x1f')](function(_0x1df01e){_0xa5d6d6=_0x1df01e;return db[_0x9c58('0x88')][_0x9c58('0x89')]({'where':{'id':_0xa5d6d6['ContactId']}});})[_0x9c58('0x1f')](function(_0x13a1cd){if(_[_0x9c58('0x66')](_0x13a1cd)){return;}else{_0xa5d6d6[_0x9c58('0x5f')]=_0x13a1cd['fax'];return db[_0x9c58('0x8a')][_0x9c58('0x89')]({'where':{'id':_0xa5d6d6[_0x9c58('0x8b')]}});}})[_0x9c58('0x1f')](function(_0x11ca41){return respondWithRpcPromise('SendFax',_0x9c58('0x8c'),{'FaxAccountId':_[_0x9c58('0x66')](_0x13dfeb[_0x9c58('0x5a')])?undefined:_0x13dfeb['body'][_0x9c58('0x8d')],'path':_[_0x9c58('0x66')](_0x11ca41)?undefined:util[_0x9c58('0x62')](_0x9c58('0x8e'),_0x11ca41['basename']),'fax':_[_0x9c58('0x66')](_0xa5d6d6['fax'])?undefined:_0xa5d6d6[_0x9c58('0x5f')],'AttachmentId':_0xa5d6d6[_0x9c58('0x8b')]},client9002);})[_0x9c58('0x1f')](respondWithResult(_0x2f6b8e,0xc9))[_0x9c58('0x28')](handleError(_0x2f6b8e,null));};exports[_0x9c58('0x8f')]=function(_0x352d36,_0x47c0f4){var _0x230d10=path['join'](config[_0x9c58('0x90')],'server',_0x9c58('0x91'),'attachments');return db['FaxMessage'][_0x9c58('0x59')]({'where':{'id':_0x352d36[_0x9c58('0x56')]['id']},'include':[{'model':db[_0x9c58('0x8a')],'as':_0x9c58('0x8a')}]})[_0x9c58('0x1f')](handleEntityNotFound(_0x47c0f4,null))[_0x9c58('0x1f')](function(_0x4b59ac){if(_0x4b59ac){return _0x47c0f4['download'](path[_0x9c58('0x92')](_0x230d10,_0x4b59ac['Attachment'][_0x9c58('0x93')]));}})[_0x9c58('0x28')](handleError(_0x47c0f4,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3affd75..330b96d 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 _0xe14a=['emit','hasOwnProperty','hook','exports','update','remove'];(function(_0x386334,_0x2304a0){var _0x5c06b5=function(_0x4ae3c3){while(--_0x4ae3c3){_0x386334['push'](_0x386334['shift']());}};_0x5c06b5(++_0x2304a0);}(_0xe14a,0x94));var _0xae14=function(_0x1a3d0e,_0x2d5ef0){_0x1a3d0e=_0x1a3d0e-0x0;var _0x55c3b9=_0xe14a[_0x1a3d0e];return _0x55c3b9;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xae14('0x0'),'afterDestroy':_0xae14('0x1')};function emitEvent(_0x5cdfa7){return function(_0x16bd5f,_0x2736f8,_0x2ec016){FaxMessageEvents[_0xae14('0x2')](_0x5cdfa7+':'+_0x16bd5f['id'],_0x16bd5f);FaxMessageEvents[_0xae14('0x2')](_0x5cdfa7,_0x16bd5f);_0x2ec016(null);};}for(var e in events){if(events[_0xae14('0x3')](e)){var event=events[e];FaxMessage[_0xae14('0x4')](e,emitEvent(event));}}module[_0xae14('0x5')]=FaxMessageEvents; \ No newline at end of file +var _0x6931=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x6931,0x1a9));var _0x1693=function(_0x17d9c2,_0x47142a){_0x17d9c2=_0x17d9c2-0x0;var _0xb37a62=_0x6931[_0x17d9c2];return _0xb37a62;};'use strict';var EventEmitter=require(_0x1693('0x0'));var FaxMessage=require(_0x1693('0x1'))['db'][_0x1693('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':_0x1693('0x5'),'afterDestroy':_0x1693('0x6')};function emitEvent(_0x2cb142){return function(_0x59d148,_0x19ff1c,_0x2ca960){FaxMessageEvents[_0x1693('0x7')](_0x2cb142+':'+_0x59d148['id'],_0x59d148);FaxMessageEvents[_0x1693('0x7')](_0x2cb142,_0x59d148);_0x2ca960(null);};}for(var e in events){if(events[_0x1693('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1693('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e0ca5c8..6c6c270 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 _0xdc11=['api','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','FaxInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4311fc,_0x507cac){var _0x4672ef=function(_0xb85b1c){while(--_0xb85b1c){_0x4311fc['push'](_0x4311fc['shift']());}};_0x4672ef(++_0x507cac);}(_0xdc11,0x71));var _0x1dc1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc11[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dc1('0x0'));var util=require(_0x1dc1('0x1'));var logger=require(_0x1dc1('0x2'))(_0x1dc1('0x3'));var moment=require(_0x1dc1('0x4'));var BPromise=require(_0x1dc1('0x5'));var rp=require(_0x1dc1('0x6'));var fs=require('fs');var path=require(_0x1dc1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1dc1('0x8'));module[_0x1dc1('0x9')]=function(_0x4b9af4,_0x41ffc3){return _0x4b9af4['define'](_0x1dc1('0xa'),attributes,{'tableName':_0x1dc1('0xb'),'paranoid':![],'indexes':[{'name':_0x1dc1('0xc'),'fields':[_0x1dc1('0xd')],'type':_0x1dc1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x281ef6,_0x3dd52f,_0x446a59){var _0x51bb3a=_0x4b9af4[_0x1dc1('0xf')];var _0x487786=_0x281ef6[_0x1dc1('0x10')]({'plain':!![]});if(_0x487786[_0x1dc1('0x11')][_0x1dc1('0x12')]()==='in'||_0x487786[_0x1dc1('0x11')][_0x1dc1('0x12')]()===_0x1dc1('0x13')&&!_0x487786[_0x1dc1('0x14')]&&!_['isNil'](_0x487786[_0x1dc1('0x15')])){_0x51bb3a[_0x1dc1('0x16')]['findOne']({'where':{'id':_0x487786[_0x1dc1('0x17')]}})['then'](function(_0x40ff95){if(_0x40ff95){_0x40ff95[_0x1dc1('0x18')]({'lastMsgAt':_0x487786[_0x1dc1('0x19')],'lastMsgDirection':_0x487786[_0x1dc1('0x11')][_0x1dc1('0x12')]()});}})[_0x1dc1('0x1a')](function(_0x2d56b9){console['error'](_0x2d56b9);});}_0x446a59();}},'charset':_0x1dc1('0x1b'),'collate':_0x1dc1('0x1c')});}; \ No newline at end of file +var _0x3912=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x322723,_0x31b409){var _0x5200f8=function(_0x5d7b93){while(--_0x5d7b93){_0x322723['push'](_0x322723['shift']());}};_0x5200f8(++_0x31b409);}(_0x3912,0x1b2));var _0x2391=function(_0x487c8f,_0x233f1a){_0x487c8f=_0x487c8f-0x0;var _0x39397f=_0x3912[_0x487c8f];return _0x39397f;};'use strict';var _=require(_0x2391('0x0'));var util=require(_0x2391('0x1'));var logger=require(_0x2391('0x2'))(_0x2391('0x3'));var moment=require(_0x2391('0x4'));var BPromise=require(_0x2391('0x5'));var rp=require(_0x2391('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2391('0x7'));var config=require(_0x2391('0x8'));var attributes=require(_0x2391('0x9'));module[_0x2391('0xa')]=function(_0x3d629d,_0x47abac){return _0x3d629d[_0x2391('0xb')](_0x2391('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2391('0xd'),'fields':[_0x2391('0xe')],'type':_0x2391('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e5bc,_0x526f87,_0x3cc598){var _0x1557a0=_0x3d629d[_0x2391('0x10')];var _0x4d2487=_0x30e5bc[_0x2391('0x11')]({'plain':!![]});if(_0x4d2487['direction'][_0x2391('0x12')]()==='in'||_0x4d2487[_0x2391('0x13')][_0x2391('0x12')]()===_0x2391('0x14')&&!_0x4d2487['secret']&&!_[_0x2391('0x15')](_0x4d2487[_0x2391('0x16')])){_0x1557a0[_0x2391('0x17')][_0x2391('0x18')]({'where':{'id':_0x4d2487[_0x2391('0x19')]}})['then'](function(_0x4ffbd5){if(_0x4ffbd5){_0x4ffbd5['update']({'lastMsgAt':_0x4d2487[_0x2391('0x1a')],'lastMsgDirection':_0x4d2487['direction']['toLowerCase']()});}})[_0x2391('0x1b')](function(_0x2ce4db){console[_0x2391('0x1c')](_0x2ce4db);});}_0x3cc598();}},'charset':_0x2391('0x1d'),'collate':_0x2391('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b8d144d..7d187a5 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 _0xdace=['FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdace,0xc5));var _0xedac=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0xdace[_0x3c6dce];return _0x1450e9;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});config['redis']=_[_0xedac('0xb')](config[_0xedac('0xc')],{'host':_0xedac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedac('0xc')]));require(_0xedac('0xe'))[_0xedac('0xf')](socket);function respondWithRpcPromise(_0x4af030,_0x5e188c,_0x144368){return new BPromise(function(_0x2ea11d,_0x57e1bf){return client['request'](_0x4af030,_0x144368)[_0xedac('0x10')](function(_0x25395d){logger['info'](_0xedac('0x11'),_0x5e188c,'request\x20sent');logger[_0xedac('0x12')](_0xedac('0x13'),_0x5e188c,_0xedac('0x14'),JSON[_0xedac('0x15')](_0x25395d));if(_0x25395d[_0xedac('0x16')]){if(_0x25395d[_0xedac('0x16')][_0xedac('0x17')]===0x1f4){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);return _0x57e1bf(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25395d[_0xedac('0x16')]['message']);return _0x2ea11d(_0x25395d[_0xedac('0x16')][_0xedac('0x18')]);}else{logger[_0xedac('0x19')](_0xedac('0x11'),_0x5e188c,'request\x20sent');_0x2ea11d(_0x25395d['result'][_0xedac('0x18')]);}})[_0xedac('0x1a')](function(_0x25fe64){logger[_0xedac('0x16')]('FaxMessage,\x20%s,\x20%s',_0x5e188c,_0x25fe64);_0x57e1bf(_0x25fe64);});});}exports['CreateFaxMessage']=function(_0x2b2ae9){var _0x17766c=this;return new Promise(function(_0x23c609,_0xcc1605){return db[_0xedac('0x1b')][_0xedac('0x1c')](_0x2b2ae9[_0xedac('0x1d')],{'raw':_0x2b2ae9[_0xedac('0x1e')]?_0x2b2ae9['options'][_0xedac('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x29cd40){logger[_0xedac('0x19')]('CreateFaxMessage',_0x2b2ae9);logger[_0xedac('0x12')](_0xedac('0x20'),_0x2b2ae9,JSON[_0xedac('0x15')](_0x29cd40));_0x23c609(_0x29cd40);})[_0xedac('0x1a')](function(_0x6b13ca){logger[_0xedac('0x16')]('CreateFaxMessage',_0x6b13ca[_0xedac('0x18')],_0x2b2ae9);_0xcc1605(_0x17766c[_0xedac('0x16')](0x1f4,_0x6b13ca[_0xedac('0x18')]));});});};exports[_0xedac('0x21')]=function(_0x1ff33e){var _0x453a3c=this;return new Promise(function(_0x40ba53,_0x26c6f7){return db[_0xedac('0x1b')][_0xedac('0x22')](_0x1ff33e['body'],{'raw':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')]['where']||null:null,'attributes':_0x1ff33e['options']?_0x1ff33e[_0xedac('0x1e')][_0xedac('0x23')]||null:null,'limit':_0x1ff33e[_0xedac('0x1e')]?_0x1ff33e[_0xedac('0x1e')]['limit']||null:null})['then'](function(_0xe813e6){logger[_0xedac('0x19')](_0xedac('0x21'),_0x1ff33e);logger[_0xedac('0x12')](_0xedac('0x21'),_0x1ff33e,JSON[_0xedac('0x15')](_0xe813e6));_0x40ba53(_0xe813e6);})[_0xedac('0x1a')](function(_0x483233){logger[_0xedac('0x16')](_0xedac('0x21'),_0x483233[_0xedac('0x18')],_0x1ff33e);_0x26c6f7(_0x453a3c['error'](0x1f4,_0x483233[_0xedac('0x18')]));});});}; \ No newline at end of file +var _0x0a9a=['error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfe7202,_0x4cf97d){var _0x4b4526=function(_0x441568){while(--_0x441568){_0xfe7202['push'](_0xfe7202['shift']());}};_0x4b4526(++_0x4cf97d);}(_0x0a9a,0x183));var _0xa0a9=function(_0xa2b71,_0x3531b2){_0xa2b71=_0xa2b71-0x0;var _0x1fb731=_0x0a9a[_0xa2b71];return _0x1fb731;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});config[_0xa0a9('0xa')]=_['defaults'](config[_0xa0a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xb'))(new Redis(config[_0xa0a9('0xa')]));require(_0xa0a9('0xc'))[_0xa0a9('0xd')](socket);function respondWithRpcPromise(_0x4b9b93,_0x2ba0ac,_0x1b5bfb){return new BPromise(function(_0x5ce7e9,_0x5909cf){return client[_0xa0a9('0xe')](_0x4b9b93,_0x1b5bfb)[_0xa0a9('0xf')](function(_0x51d5a5){logger[_0xa0a9('0x10')]('FaxMessage,\x20%s,\x20%s',_0x2ba0ac,_0xa0a9('0x11'));logger['debug'](_0xa0a9('0x12'),_0x2ba0ac,_0xa0a9('0x11'),JSON[_0xa0a9('0x13')](_0x51d5a5));if(_0x51d5a5[_0xa0a9('0x14')]){if(_0x51d5a5[_0xa0a9('0x14')]['code']===0x1f4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);return _0x5909cf(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}logger['error'](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5['error']['message']);return _0x5ce7e9(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}else{logger[_0xa0a9('0x10')](_0xa0a9('0x15'),_0x2ba0ac,'request\x20sent');_0x5ce7e9(_0x51d5a5[_0xa0a9('0x17')][_0xa0a9('0x16')]);}})[_0xa0a9('0x18')](function(_0x27f8d4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x27f8d4);_0x5909cf(_0x27f8d4);});});}exports['CreateFaxMessage']=function(_0x3cdd8c){var _0x3107ce=this;return new Promise(function(_0x4a8e80,_0x53b99d){return db[_0xa0a9('0x19')][_0xa0a9('0x1a')](_0x3cdd8c[_0xa0a9('0x1b')],{'raw':_0x3cdd8c['options']?_0x3cdd8c[_0xa0a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa0a9('0xf')](function(_0x5e6148){logger[_0xa0a9('0x10')](_0xa0a9('0x1d'),_0x3cdd8c);logger[_0xa0a9('0x1e')](_0xa0a9('0x1d'),_0x3cdd8c,JSON['stringify'](_0x5e6148));_0x4a8e80(_0x5e6148);})[_0xa0a9('0x18')](function(_0x4fb909){logger[_0xa0a9('0x14')](_0xa0a9('0x1d'),_0x4fb909[_0xa0a9('0x16')],_0x3cdd8c);_0x53b99d(_0x3107ce[_0xa0a9('0x14')](0x1f4,_0x4fb909['message']));});});};exports[_0xa0a9('0x1f')]=function(_0xe49d3b){var _0x384cd5=this;return new Promise(function(_0x3f4bea,_0x526dd1){return db[_0xa0a9('0x19')][_0xa0a9('0x20')](_0xe49d3b[_0xa0a9('0x1b')],{'raw':_0xe49d3b['options']?_0xe49d3b['options'][_0xa0a9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x22')]||null:null,'attributes':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x23')]||null:null,'limit':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x24')]||null:null})[_0xa0a9('0xf')](function(_0x554191){logger[_0xa0a9('0x10')](_0xa0a9('0x1f'),_0xe49d3b);logger['debug'](_0xa0a9('0x1f'),_0xe49d3b,JSON[_0xa0a9('0x13')](_0x554191));_0x3f4bea(_0x554191);})['catch'](function(_0x47c19b){logger[_0xa0a9('0x14')]('UpdateFaxMessage',_0x47c19b['message'],_0xe49d3b);_0x526dd1(_0x384cd5[_0xa0a9('0x14')](0x1f4,_0x47c19b[_0xa0a9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index f625883..b267b28 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 _0xfe21=['save','remove','update','removeListener','length','./faxMessage.events'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xfe21,0x179));var _0x1fe2=function(_0x8cedf8,_0x22a7b8){_0x8cedf8=_0x8cedf8-0x0;var _0x1f2c93=_0xfe21[_0x8cedf8];return _0x1f2c93;};'use strict';var FaxMessageEvents=require(_0x1fe2('0x0'));var events=[_0x1fe2('0x1'),_0x1fe2('0x2'),_0x1fe2('0x3')];function createListener(_0x4cdb11,_0x469d70){return function(_0x2c899a){_0x469d70['emit'](_0x4cdb11,_0x2c899a);};}function removeListener(_0x2796c8,_0x5c46e3){return function(){FaxMessageEvents[_0x1fe2('0x4')](_0x2796c8,_0x5c46e3);};}exports['register']=function(_0x3f1d98){for(var _0xbddcb2=0x0,_0x3232e3=events[_0x1fe2('0x5')];_0xbddcb2<_0x3232e3;_0xbddcb2++){var _0xfe2a11=events[_0xbddcb2];var _0x59c500=createListener('faxMessage:'+_0xfe2a11,_0x3f1d98);FaxMessageEvents['on'](_0xfe2a11,_0x59c500);}}; \ No newline at end of file +var _0x24c8=['./faxMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x110653,_0x3ff1f3){var _0x13c540=function(_0x194c24){while(--_0x194c24){_0x110653['push'](_0x110653['shift']());}};_0x13c540(++_0x3ff1f3);}(_0x24c8,0x1e3));var _0x824c=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x24c8[_0x5a99db];return _0x3aad62;};'use strict';var FaxMessageEvents=require(_0x824c('0x0'));var events=[_0x824c('0x1'),_0x824c('0x2'),_0x824c('0x3')];function createListener(_0x319315,_0x68dea1){return function(_0x53c550){_0x68dea1[_0x824c('0x4')](_0x319315,_0x53c550);};}function removeListener(_0x557c36,_0x3673cb){return function(){FaxMessageEvents[_0x824c('0x5')](_0x557c36,_0x3673cb);};}exports['register']=function(_0x414817){for(var _0x498bc3=0x0,_0x1ce4ee=events[_0x824c('0x6')];_0x498bc3<_0x1ce4ee;_0x498bc3++){var _0x44c8f1=events[_0x498bc3];var _0x13a6a4=createListener('faxMessage:'+_0x44c8f1,_0x414817);FaxMessageEvents['on'](_0x44c8f1,_0x13a6a4);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9c54e7f..85369d5 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 _0xb49a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','tracked','fax','create'];(function(_0x51f6bb,_0x4aeacb){var _0x5e8a89=function(_0x346f26){while(--_0x346f26){_0x51f6bb['push'](_0x51f6bb['shift']());}};_0x5e8a89(++_0x4aeacb);}(_0xb49a,0xfb));var _0xab49=function(_0x41d67e,_0x336a28){_0x41d67e=_0x41d67e-0x0;var _0x100cb2=_0xb49a[_0x41d67e];return _0x100cb2;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var fs_extra=require(_0xab49('0x5'));var auth=require(_0xab49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab49('0x7'));router[_0xab49('0x8')]('/',auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0x8')](_0xab49('0xb'),auth[_0xab49('0x9')](),controller['describe']);router[_0xab49('0x8')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);router[_0xab49('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xab49('0xe')]);router[_0xab49('0xf')]('/',auth[_0xab49('0x9')](),interaction[_0xab49('0x10')](_0xab49('0x11'),'faxmessage:create'),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x14')]);router[_0xab49('0x13')](_0xab49('0x15'),auth[_0xab49('0x9')](),controller[_0xab49('0x16')]);router[_0xab49('0x13')](_0xab49('0x17'),auth['isAuthenticated'](),controller[_0xab49('0x18')]);router[_0xab49('0x19')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xb9a7=['faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0xee6c6f,_0x241922){var _0x26c138=function(_0x4edddb){while(--_0x4edddb){_0xee6c6f['push'](_0xee6c6f['shift']());}};_0x26c138(++_0x241922);}(_0xb9a7,0x112));var _0x7b9a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb9a7[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('fax',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9e192b4..44b54ce 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 _0x55af=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55af,0x1ab));var _0xf55a=function(_0x281419,_0x3a0a54){_0x281419=_0x281419-0x0;var _0x5c2f6d=_0x55af[_0x281419];return _0x5c2f6d;};'use strict';var Sequelize=require(_0xf55a('0x0'));module[_0xf55a('0x1')]={'name':{'type':Sequelize[_0xf55a('0x2')],'unique':_0xf55a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf55a('0x2')]},'timeout':{'type':Sequelize[_0xf55a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf55a('0x5')](_0xf55a('0x6'),_0xf55a('0x7'),_0xf55a('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa533=['beepall','roundrobin','INTEGER','STRING','name','ENUM','rrmemory'];(function(_0x2b114c,_0x1de719){var _0x1fb52e=function(_0x5184c4){while(--_0x5184c4){_0x2b114c['push'](_0x2b114c['shift']());}};_0x1fb52e(++_0x1de719);}(_0xa533,0x13e));var _0x3a53=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0xa533[_0x5842c3];return _0x44bf8c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3a53('0x0')],'unique':_0x3a53('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a53('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a53('0x2')](_0x3a53('0x3'),_0x3a53('0x4'),_0x3a53('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3a53('0x6')],'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 50558b2..c3ddba2 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 _0x66d7=['removeTeams','select','field','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','sequelize','toString','QueryTypes','TeamId','all','union','value','removeAgents','emit','userFaxQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','status','json','undefined','limit','offset','set','Content-Range','reject','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','FaxQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','options','count','includeAll','include','rows','catch','show','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','hasOwnProperty','pick','FaxQueueId','UserFaxQueue','findAll','findAndCountAll','UserId','faxPause','SIP','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','flatMap','transaction','forEach','userFaxQueue:save'];(function(_0xc5628d,_0x1a8a49){var _0x35a87a=function(_0x27045b){while(--_0x27045b){_0xc5628d['push'](_0xc5628d['shift']());}};_0x35a87a(++_0x1a8a49);}(_0x66d7,0x116));var _0x766d=function(_0x47de0e,_0x388597){_0x47de0e=_0x47de0e-0x0;var _0x3c6920=_0x66d7[_0x47de0e];return _0x3c6920;};'use strict';var emlformat=require(_0x766d('0x0'));var rimraf=require(_0x766d('0x1'));var zipdir=require(_0x766d('0x2'));var jsonpatch=require(_0x766d('0x3'));var rp=require(_0x766d('0x4'));var moment=require('moment');var BPromise=require(_0x766d('0x5'));var Mustache=require('mustache');var util=require(_0x766d('0x6'));var path=require(_0x766d('0x7'));var sox=require('sox');var csv=require(_0x766d('0x8'));var ejs=require(_0x766d('0x9'));var fs=require('fs');var fs_extra=require(_0x766d('0xa'));var _=require('lodash');var squel=require(_0x766d('0xb'));var crypto=require(_0x766d('0xc'));var jsforce=require(_0x766d('0xd'));var deskjs=require(_0x766d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x766d('0xf'));var qs=require(_0x766d('0x10'));var as=require(_0x766d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x766d('0x12'));var config=require(_0x766d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x766d('0x14'))['db'];config[_0x766d('0x15')]=_[_0x766d('0x16')](config[_0x766d('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x766d('0x17'))(new Redis(config['redis']));require(_0x766d('0x18'))['register'](socket);function respondWithStatusCode(_0x4f0c82,_0x247b6a){_0x247b6a=_0x247b6a||0xcc;return function(_0x3f1a7c){if(_0x3f1a7c){return _0x4f0c82['sendStatus'](_0x247b6a);}return _0x4f0c82[_0x766d('0x19')](_0x247b6a)['end']();};}function respondWithResult(_0x2fc169,_0x126010){_0x126010=_0x126010||0xc8;return function(_0x515f80){if(_0x515f80){return _0x2fc169[_0x766d('0x19')](_0x126010)[_0x766d('0x1a')](_0x515f80);}};}function respondWithFilteredResult(_0x5c6a45,_0x427faf){return function(_0x27c6b1){if(_0x27c6b1){var _0x851ed8=typeof _0x427faf['offset']===_0x766d('0x1b')&&typeof _0x427faf[_0x766d('0x1c')]===_0x766d('0x1b');var _0x539192=_0x27c6b1['count'];var _0x498063=_0x851ed8?0x0:_0x427faf[_0x766d('0x1d')];var _0x410383=_0x851ed8?_0x27c6b1['count']:_0x427faf[_0x766d('0x1d')]+_0x427faf['limit'];var _0x429d1b;if(_0x410383>=_0x539192){_0x410383=_0x539192;_0x429d1b=0xc8;}else{_0x429d1b=0xce;}_0x5c6a45['status'](_0x429d1b);return _0x5c6a45[_0x766d('0x1e')](_0x766d('0x1f'),_0x498063+'-'+_0x410383+'/'+_0x539192)[_0x766d('0x1a')](_0x27c6b1);}return null;};}function patchUpdates(_0x5569a6){return function(_0x54fbe3){try{jsonpatch['apply'](_0x54fbe3,_0x5569a6,!![]);}catch(_0x2a4858){return BPromise[_0x766d('0x20')](_0x2a4858);}return _0x54fbe3['save']();};}function saveUpdates(_0x54771b,_0xd4fea1){return function(_0x3c960a){if(_0x3c960a){return _0x3c960a['update'](_0x54771b)[_0x766d('0x21')](function(_0x3aab93){return _0x3aab93;});}return null;};}function removeEntity(_0x34531c,_0x9a66e3){return function(_0x2a7966){if(_0x2a7966){return _0x2a7966['destroy']()['then'](function(){var _0x5eecd7=_0x2a7966[_0x766d('0x22')]({'plain':!![]});var _0x2a25a6=_0x766d('0x23');return db[_0x766d('0x24')][_0x766d('0x25')]({'where':{'type':_0x2a25a6,'resourceId':_0x5eecd7['id']}})[_0x766d('0x21')](function(){return _0x2a7966;});})[_0x766d('0x21')](function(){_0x34531c[_0x766d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2708d5,_0x36b6fd){return function(_0xd2bcfb){if(!_0xd2bcfb){_0x2708d5[_0x766d('0x26')](0x194);}return _0xd2bcfb;};}function handleError(_0x3ad04c,_0x27d644){_0x27d644=_0x27d644||0x1f4;return function(_0x975c57){logger[_0x766d('0x27')](_0x975c57[_0x766d('0x28')]);if(_0x975c57[_0x766d('0x29')]){delete _0x975c57[_0x766d('0x29')];}_0x3ad04c[_0x766d('0x19')](_0x27d644)['send'](_0x975c57);};}exports['index']=function(_0x1b2000,_0x39432d){var _0x1b8d46={},_0x3c787c={},_0x42cf9e={'count':0x0,'rows':[]};var _0x5053b0=_['map'](db[_0x766d('0x2a')][_0x766d('0x2b')],function(_0x11a5f9){return{'name':_0x11a5f9[_0x766d('0x2c')],'type':_0x11a5f9[_0x766d('0x2d')]['key']};});_0x3c787c[_0x766d('0x2e')]=_[_0x766d('0x2f')](_0x5053b0,'name');_0x3c787c[_0x766d('0x30')]=_[_0x766d('0x31')](_0x1b2000[_0x766d('0x30')]);_0x3c787c[_0x766d('0x32')]=_[_0x766d('0x33')](_0x3c787c[_0x766d('0x2e')],_0x3c787c[_0x766d('0x30')]);_0x1b8d46[_0x766d('0x34')]=_['intersection'](_0x3c787c[_0x766d('0x2e')],qs[_0x766d('0x35')](_0x1b2000[_0x766d('0x30')]['fields']));_0x1b8d46[_0x766d('0x34')]=_0x1b8d46[_0x766d('0x34')][_0x766d('0x36')]?_0x1b8d46[_0x766d('0x34')]:_0x3c787c[_0x766d('0x2e')];if(!_0x1b2000[_0x766d('0x30')]['hasOwnProperty'](_0x766d('0x37'))){_0x1b8d46[_0x766d('0x1c')]=qs['limit'](_0x1b2000[_0x766d('0x30')]['limit']);_0x1b8d46[_0x766d('0x1d')]=qs[_0x766d('0x1d')](_0x1b2000['query'][_0x766d('0x1d')]);}_0x1b8d46[_0x766d('0x38')]=qs[_0x766d('0x39')](_0x1b2000[_0x766d('0x30')][_0x766d('0x39')]);_0x1b8d46['where']=qs['filters'](_['pick'](_0x1b2000[_0x766d('0x30')],_0x3c787c[_0x766d('0x32')]),_0x5053b0);if(_0x1b2000['query'][_0x766d('0x3a')]){_0x1b8d46[_0x766d('0x3b')]=_[_0x766d('0x3c')](_0x1b8d46[_0x766d('0x3b')],{'$or':_[_0x766d('0x2f')](_0x5053b0,function(_0x5490d9){if(_0x5490d9[_0x766d('0x2d')]!=='VIRTUAL'){var _0x55ec66={};_0x55ec66[_0x5490d9['name']]={'$like':'%'+_0x1b2000[_0x766d('0x30')][_0x766d('0x3a')]+'%'};return _0x55ec66;}})});}_0x1b8d46=_[_0x766d('0x3c')]({},_0x1b8d46,_0x1b2000[_0x766d('0x3d')]);var _0x4c2bfa={'where':_0x1b8d46[_0x766d('0x3b')]};return db[_0x766d('0x2a')][_0x766d('0x3e')](_0x4c2bfa)[_0x766d('0x21')](function(_0xc5aecb){_0x42cf9e[_0x766d('0x3e')]=_0xc5aecb;if(_0x1b2000[_0x766d('0x30')][_0x766d('0x3f')]){_0x1b8d46[_0x766d('0x40')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x1b8d46);})[_0x766d('0x21')](function(_0x346693){_0x42cf9e[_0x766d('0x41')]=_0x346693;return _0x42cf9e;})[_0x766d('0x21')](respondWithFilteredResult(_0x39432d,_0x1b8d46))[_0x766d('0x42')](handleError(_0x39432d,null));};exports[_0x766d('0x43')]=function(_0x3e69e8,_0x55ac03){var _0x412e1d={'raw':!![],'where':{'id':_0x3e69e8['params']['id']}},_0x54b4e7={};_0x54b4e7['model']=_['keys'](db[_0x766d('0x2a')][_0x766d('0x2b')]);_0x54b4e7['query']=_[_0x766d('0x31')](_0x3e69e8[_0x766d('0x30')]);_0x54b4e7[_0x766d('0x32')]=_[_0x766d('0x33')](_0x54b4e7[_0x766d('0x2e')],_0x54b4e7[_0x766d('0x30')]);_0x412e1d[_0x766d('0x34')]=_[_0x766d('0x33')](_0x54b4e7[_0x766d('0x2e')],qs[_0x766d('0x35')](_0x3e69e8[_0x766d('0x30')][_0x766d('0x35')]));_0x412e1d[_0x766d('0x34')]=_0x412e1d[_0x766d('0x34')][_0x766d('0x36')]?_0x412e1d[_0x766d('0x34')]:_0x54b4e7['model'];if(_0x3e69e8[_0x766d('0x30')]['includeAll']){_0x412e1d[_0x766d('0x40')]=[{'all':!![]}];}_0x412e1d=_[_0x766d('0x3c')]({},_0x412e1d,_0x3e69e8[_0x766d('0x3d')]);return db[_0x766d('0x2a')][_0x766d('0x44')](_0x412e1d)[_0x766d('0x21')](handleEntityNotFound(_0x55ac03,null))[_0x766d('0x21')](respondWithResult(_0x55ac03,null))['catch'](handleError(_0x55ac03,null));};exports['create']=function(_0x222590,_0x114951){return db[_0x766d('0x2a')][_0x766d('0x45')](_0x222590[_0x766d('0x46')],{})[_0x766d('0x21')](function(_0x2e8a92){var _0x56a306=_0x222590[_0x766d('0x47')]['get']({'plain':!![]});if(!_0x56a306)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56a306[_0x766d('0x48')]==='user'){var _0x16a348=_0x2e8a92['get']({'plain':!![]});var _0x3fb6fd=_0x766d('0x23');return db['UserProfileSection'][_0x766d('0x44')]({'where':{'name':_0x3fb6fd,'userProfileId':_0x56a306['userProfileId']},'raw':!![]})['then'](function(_0x2b47a3){if(_0x2b47a3&&_0x2b47a3[_0x766d('0x49')]===0x0){return db[_0x766d('0x24')]['create']({'name':_0x16a348[_0x766d('0x29')],'resourceId':_0x16a348['id'],'type':_0x2b47a3[_0x766d('0x29')],'sectionId':_0x2b47a3['id']},{})['then'](function(){return _0x2e8a92;});}else{return _0x2e8a92;}})[_0x766d('0x42')](function(_0x59c13e){logger[_0x766d('0x27')](_0x766d('0x4a'),_0x59c13e);throw _0x59c13e;});}return _0x2e8a92;})[_0x766d('0x21')](respondWithResult(_0x114951,0xc9))[_0x766d('0x42')](handleError(_0x114951,null));};exports[_0x766d('0x4b')]=function(_0x34afca,_0x37494c){if(_0x34afca[_0x766d('0x46')]['id']){delete _0x34afca[_0x766d('0x46')]['id'];}return db['FaxQueue'][_0x766d('0x44')]({'where':{'id':_0x34afca[_0x766d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37494c,null))['then'](saveUpdates(_0x34afca[_0x766d('0x46')],null))[_0x766d('0x21')](respondWithResult(_0x37494c,null))['catch'](handleError(_0x37494c,null));};exports[_0x766d('0x25')]=function(_0x1d89bd,_0x356280){return db[_0x766d('0x2a')]['find']({'where':{'id':_0x1d89bd[_0x766d('0x4c')]['id']}})[_0x766d('0x21')](handleEntityNotFound(_0x356280,null))[_0x766d('0x21')](removeEntity(_0x356280,null))[_0x766d('0x42')](handleError(_0x356280,null));};exports[_0x766d('0x4d')]=function(_0x257b65,_0x38cf68){return db['FaxQueue'][_0x766d('0x4d')]()[_0x766d('0x21')](respondWithResult(_0x38cf68,null))[_0x766d('0x42')](handleError(_0x38cf68,null));};exports['getMembers']=function(_0x2833d6,_0x40fd5a,_0x1b4cd2){var _0x54606e={'raw':!![],'where':{}},_0x47b7b9={},_0x13434b;return db[_0x766d('0x2a')][_0x766d('0x4e')]({'where':{'id':_0x2833d6[_0x766d('0x4c')]['id']}})[_0x766d('0x21')](handleEntityNotFound(_0x40fd5a,null))[_0x766d('0x21')](function(_0x116e8c){if(_0x116e8c){_0x13434b=_0x116e8c[_0x766d('0x22')]({'plain':!![]});_0x47b7b9[_0x766d('0x2e')]=_[_0x766d('0x31')](db['UserFaxQueue'][_0x766d('0x2b')]);_0x47b7b9[_0x766d('0x30')]=_[_0x766d('0x31')](_0x2833d6[_0x766d('0x30')]);_0x47b7b9['filters']=_[_0x766d('0x33')](_0x47b7b9['model'],_0x47b7b9[_0x766d('0x30')]);_0x54606e[_0x766d('0x34')]=_[_0x766d('0x33')](_0x47b7b9['model'],qs[_0x766d('0x35')](_0x2833d6[_0x766d('0x30')][_0x766d('0x35')]));_0x54606e[_0x766d('0x34')]=_0x54606e['attributes'][_0x766d('0x36')]?_0x54606e[_0x766d('0x34')]:_0x47b7b9[_0x766d('0x2e')];if(!_0x2833d6['query'][_0x766d('0x4f')](_0x766d('0x37'))){_0x54606e[_0x766d('0x1c')]=qs['limit'](_0x2833d6[_0x766d('0x30')][_0x766d('0x1c')]);_0x54606e[_0x766d('0x1d')]=qs[_0x766d('0x1d')](_0x2833d6[_0x766d('0x30')][_0x766d('0x1d')]);}_0x54606e[_0x766d('0x38')]=qs['sort'](_0x2833d6[_0x766d('0x30')][_0x766d('0x39')]);_0x54606e['where']=qs[_0x766d('0x32')](_[_0x766d('0x50')](_0x2833d6[_0x766d('0x30')],_0x47b7b9['filters']));_0x54606e[_0x766d('0x3b')][_0x766d('0x51')]=_0x116e8c['id'];if(_0x2833d6[_0x766d('0x30')][_0x766d('0x3a')]){_0x54606e[_0x766d('0x3b')]=_[_0x766d('0x3c')](_0x54606e[_0x766d('0x3b')],{'$or':_[_0x766d('0x2f')](_0x54606e[_0x766d('0x34')],function(_0x37fdd8){var _0xc63627={};_0xc63627[_0x37fdd8]={'$like':'%'+_0x2833d6[_0x766d('0x30')][_0x766d('0x3a')]+'%'};return _0xc63627;})});}_0x54606e=_[_0x766d('0x3c')]({},_0x54606e,_0x2833d6[_0x766d('0x3d')]);return db[_0x766d('0x52')][_0x766d('0x53')](_0x54606e);}})[_0x766d('0x21')](function(_0x5a9e6e){if(_0x5a9e6e){return db['User'][_0x766d('0x54')]({'where':{'id':_['map'](_0x5a9e6e,_0x766d('0x55')),'role':'agent'},'attributes':['id','name',_0x766d('0x56'),'updatedAt','createdAt']});}})[_0x766d('0x21')](function(_0x1702a9){if(_0x1702a9){return{'count':_0x1702a9['count'],'rows':_[_0x766d('0x2f')](_0x1702a9[_0x766d('0x41')],function(_0x1c6c13){return{'membername':_0x1c6c13['name'],'UserId':_0x1c6c13['id'],'queue_name':_0x13434b[_0x766d('0x29')],'FaxQueueId':_0x13434b['id'],'interface':util['format']('%s/%s',_0x766d('0x57'),_0x1c6c13[_0x766d('0x29')]),'penalty':0x0,'paused':_0x1c6c13[_0x766d('0x56')],'createdAt':_0x1c6c13['createdAt'],'updatedAt':_0x1c6c13[_0x766d('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x766d('0x21')](respondWithFilteredResult(_0x40fd5a,_0x54606e))[_0x766d('0x42')](handleError(_0x40fd5a,null));};exports[_0x766d('0x59')]=function(_0x327c15,_0x285849,_0x2fe2cb){var _0x65ef7c={};var _0x134447={};var _0x507ba1;var _0xb69dac;return db[_0x766d('0x2a')][_0x766d('0x4e')]({'where':{'id':_0x327c15[_0x766d('0x4c')]['id']}})[_0x766d('0x21')](handleEntityNotFound(_0x285849,null))[_0x766d('0x21')](function(_0x567ab2){if(_0x567ab2){_0x507ba1=_0x567ab2;_0x134447['model']=_[_0x766d('0x31')](db[_0x766d('0x5a')]['rawAttributes']);_0x134447[_0x766d('0x30')]=_[_0x766d('0x31')](_0x327c15[_0x766d('0x30')]);_0x134447['filters']=_['intersection'](_0x134447[_0x766d('0x2e')],_0x134447[_0x766d('0x30')]);_0x65ef7c[_0x766d('0x34')]=_['intersection'](_0x134447['model'],qs['fields'](_0x327c15['query']['fields']));_0x65ef7c['attributes']=_0x65ef7c[_0x766d('0x34')][_0x766d('0x36')]?_0x65ef7c[_0x766d('0x34')]:_0x134447[_0x766d('0x2e')];_0x65ef7c[_0x766d('0x38')]=qs[_0x766d('0x39')](_0x327c15[_0x766d('0x30')][_0x766d('0x39')]);_0x65ef7c[_0x766d('0x3b')]=qs[_0x766d('0x32')](_[_0x766d('0x50')](_0x327c15[_0x766d('0x30')],_0x134447[_0x766d('0x32')]));if(_0x327c15[_0x766d('0x30')][_0x766d('0x3a')]){_0x65ef7c[_0x766d('0x3b')]=_[_0x766d('0x3c')](_0x65ef7c[_0x766d('0x3b')],{'$or':_[_0x766d('0x2f')](_0x65ef7c['attributes'],function(_0x450053){var _0x1bd1cd={};_0x1bd1cd[_0x450053]={'$like':'%'+_0x327c15['query'][_0x766d('0x3a')]+'%'};return _0x1bd1cd;})});}_0x65ef7c=_[_0x766d('0x3c')]({},_0x65ef7c,_0x327c15[_0x766d('0x3d')]);return _0x507ba1[_0x766d('0x59')](_0x65ef7c);}})[_0x766d('0x21')](function(_0x43fe7e){if(_0x43fe7e){_0xb69dac=_0x43fe7e[_0x766d('0x36')];if(!_0x327c15['query'][_0x766d('0x4f')](_0x766d('0x37'))){_0x65ef7c[_0x766d('0x1c')]=qs[_0x766d('0x1c')](_0x327c15[_0x766d('0x30')]['limit']);_0x65ef7c[_0x766d('0x1d')]=qs[_0x766d('0x1d')](_0x327c15[_0x766d('0x30')][_0x766d('0x1d')]);}return _0x507ba1[_0x766d('0x59')](_0x65ef7c);}})[_0x766d('0x21')](function(_0x4afdc1){if(_0x4afdc1){return _0x4afdc1?{'count':_0xb69dac,'rows':_0x4afdc1}:null;}})[_0x766d('0x21')](respondWithResult(_0x285849,null))['catch'](handleError(_0x285849,null));};exports[_0x766d('0x5b')]=function(_0x14cfcc,_0xd40afa,_0x1cbd2a){var _0x11520a=_0x14cfcc[_0x766d('0x46')][_0x766d('0x5c')];return db[_0x766d('0x5a')][_0x766d('0x53')]({'where':{'id':_0x11520a},'attributes':['id'],'include':[{'model':db[_0x766d('0x5d')],'as':_0x766d('0x5e'),'attributes':['id','name',_0x766d('0x5f'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2baacc){if(_0x2baacc){var _0x1391e5=_[_0x766d('0x60')](_0x2baacc,function(_0x55b09a){var _0x497660=_0x55b09a[_0x766d('0x22')]({'plain':!![]});return _0x497660[_0x766d('0x5e')];});return db[_0x766d('0x2a')][_0x766d('0x44')]({'where':{'id':_0x14cfcc[_0x766d('0x4c')]['id']}})['then'](function(_0x251ed6){return db['sequelize'][_0x766d('0x61')](function(_0x4d9944){return _0x251ed6['addTeams'](_0x11520a,{'transaction':_0x4d9944})[_0x766d('0x21')](function(){return BPromise['each'](_0x1391e5,function(_0x3e349d){return db[_0x766d('0x52')]['findOrCreate']({'where':{'UserId':_0x3e349d['id'],'FaxQueueId':_0x14cfcc[_0x766d('0x4c')]['id']},'transaction':_0x4d9944});});})[_0x766d('0x21')](function(){_0x1391e5[_0x766d('0x62')](function(_0x11533c){socket['emit'](_0x766d('0x63'),{'UserId':_0x11533c['id'],'FaxQueueId':_0x251ed6['id']});});});});});}})['then'](respondWithStatusCode(_0xd40afa,null))['catch'](handleError(_0xd40afa,null));};exports[_0x766d('0x64')]=function(_0x2f2376,_0xf8fe70,_0x109312){return db[_0x766d('0x5a')][_0x766d('0x53')]({'where':{'id':_0x2f2376['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x766d('0x5d')],'as':_0x766d('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xf8fe70,null))[_0x766d('0x21')](function(_0x403b57){var _0x43c752=_['map'](_0x403b57,'id');var _0x242af5=[];var _0x4a0600=[];var _0x3c3249=squel[_0x766d('0x65')]();_0x3c3249[_0x766d('0x66')](_0x766d('0x67'))[_0x766d('0x68')](_0x766d('0x69'),'tq')[_0x766d('0x6a')](_0x766d('0x6b'),'ut',_0x766d('0x6c'))[_0x766d('0x3b')](_0x766d('0x6d'),_0x2f2376['params']['id']);for(var _0x3b6420=0x0;_0x3b6420<_0x403b57[_0x766d('0x36')];_0x3b6420+=0x1){let _0x3f4e33=_0x403b57[_0x3b6420];for(var _0x19ded8=0x0;_0x19ded8<_0x3f4e33[_0x766d('0x5e')][_0x766d('0x36')];_0x19ded8+=0x1){let _0x58c9ce=_0x3f4e33[_0x766d('0x5e')][_0x19ded8];var _0x50cb7f=_0x3c3249[_0x766d('0x6e')]();_0x50cb7f[_0x766d('0x3b')](_0x766d('0x6f'),_0x58c9ce['id']);_0x4a0600[_0x766d('0x70')](db[_0x766d('0x71')][_0x766d('0x30')](_0x50cb7f[_0x766d('0x72')](),{'type':db[_0x766d('0x71')][_0x766d('0x73')]['SELECT']})['then'](function(_0x42ed52){if(_0x42ed52[_0x766d('0x36')]===0x1){return _0x58c9ce['id'];}else{var _0x39fe74=_['every'](_[_0x766d('0x2f')](_0x42ed52,_0x766d('0x74')),function(_0x3fd18c){return _['includes'](_0x43c752,_0x3fd18c);});if(_0x39fe74){return _0x58c9ce['id'];}}}));}}return BPromise[_0x766d('0x75')](_0x4a0600)[_0x766d('0x21')](function(_0x365b41){_0x242af5=_(_0x242af5)[_0x766d('0x76')](_0x365b41)['compact']()[_0x766d('0x77')]();return db[_0x766d('0x2a')][_0x766d('0x44')]({'where':{'id':_0x2f2376['params']['id']}})['then'](function(_0x39d5da){return db[_0x766d('0x71')][_0x766d('0x61')](function(_0x4f9650){return _0x39d5da[_0x766d('0x64')](_0x2f2376[_0x766d('0x30')][_0x766d('0x5c')],{'transaction':_0x4f9650})[_0x766d('0x21')](function(){if(!_['isEmpty'](_0x242af5)){return _0x39d5da[_0x766d('0x78')](_0x242af5,{'transaction':_0x4f9650});}})[_0x766d('0x21')](function(){_0x242af5[_0x766d('0x62')](function(_0xaf7509){socket[_0x766d('0x79')](_0x766d('0x7a'),{'UserId':_0xaf7509,'FaxQueueId':_0x39d5da['id']});});});});});});})[_0x766d('0x21')](respondWithStatusCode(_0xf8fe70,null))['catch'](handleError(_0xf8fe70,null));};exports[_0x766d('0x7b')]=function(_0x72499e,_0x1b09f3,_0x342ba6){return db[_0x766d('0x2a')][_0x766d('0x44')]({'where':{'id':_0x72499e[_0x766d('0x4c')]['id']}})[_0x766d('0x21')](handleEntityNotFound(_0x1b09f3,null))[_0x766d('0x21')](function(_0x3c86cf){if(_0x3c86cf){return _0x3c86cf[_0x766d('0x7b')](_0x72499e[_0x766d('0x46')][_0x766d('0x5c')],_['omit'](_0x72499e[_0x766d('0x46')],[_0x766d('0x5c'),'id'])||{})[_0x766d('0x7c')](function(_0x5595f9){for(var _0x20630a=0x0;_0x20630a<_0x72499e['body'][_0x766d('0x5c')]['length'];_0x20630a+=0x1){socket[_0x766d('0x79')](_0x766d('0x63'),{'UserId':Number(_0x72499e['body']['ids'][_0x20630a]),'FaxQueueId':Number(_0x72499e['params']['id'])});}return _0x5595f9;});}})['then'](respondWithResult(_0x1b09f3,null))[_0x766d('0x42')](handleError(_0x1b09f3,null));};exports[_0x766d('0x78')]=function(_0xfb81d2,_0x448642,_0x12e5ce){return db[_0x766d('0x2a')]['find']({'where':{'id':_0xfb81d2['params']['id']}})[_0x766d('0x21')](handleEntityNotFound(_0x448642,null))[_0x766d('0x21')](function(_0x22fe8d){if(_0x22fe8d){return _0x22fe8d[_0x766d('0x78')](_0xfb81d2[_0x766d('0x30')][_0x766d('0x5c')])[_0x766d('0x21')](function(){if(_['isArray'](_0xfb81d2[_0x766d('0x30')][_0x766d('0x5c')])){for(var _0x570c0e=0x0;_0x570c0e<_0xfb81d2[_0x766d('0x30')][_0x766d('0x5c')]['length'];_0x570c0e+=0x1){socket['emit'](_0x766d('0x7a'),{'UserId':Number(_0xfb81d2['query']['ids'][_0x570c0e]),'FaxQueueId':Number(_0xfb81d2[_0x766d('0x4c')]['id'])});}}else{socket[_0x766d('0x79')](_0x766d('0x7a'),{'UserId':Number(_0xfb81d2['query'][_0x766d('0x5c')]),'FaxQueueId':Number(_0xfb81d2[_0x766d('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x448642,null))[_0x766d('0x42')](handleError(_0x448642,null));};exports[_0x766d('0x7d')]=function(_0xff99dd,_0x1eea22,_0x534462){var _0x28a262={};var _0x3a9bd0={};var _0x1f70b3;var _0x1e8419;return db[_0x766d('0x2a')]['findOne']({'where':{'id':_0xff99dd['params']['id']}})['then'](handleEntityNotFound(_0x1eea22,null))[_0x766d('0x21')](function(_0x3d7b61){if(_0x3d7b61){_0x1f70b3=_0x3d7b61;_0x3a9bd0['model']=_[_0x766d('0x31')](db[_0x766d('0x5d')]['rawAttributes']);_0x3a9bd0[_0x766d('0x30')]=_['keys'](_0xff99dd['query']);_0x3a9bd0[_0x766d('0x32')]=_['intersection'](_0x3a9bd0[_0x766d('0x2e')],_0x3a9bd0[_0x766d('0x30')]);_0x28a262[_0x766d('0x34')]=_[_0x766d('0x33')](_0x3a9bd0[_0x766d('0x2e')],qs[_0x766d('0x35')](_0xff99dd[_0x766d('0x30')][_0x766d('0x35')]));_0x28a262[_0x766d('0x34')]=_0x28a262[_0x766d('0x34')][_0x766d('0x36')]?_0x28a262['attributes']:_0x3a9bd0[_0x766d('0x2e')];_0x28a262[_0x766d('0x38')]=qs[_0x766d('0x39')](_0xff99dd[_0x766d('0x30')][_0x766d('0x39')]);_0x28a262[_0x766d('0x3b')]=qs[_0x766d('0x32')](_[_0x766d('0x50')](_0xff99dd[_0x766d('0x30')],_0x3a9bd0[_0x766d('0x32')]));if(_0xff99dd[_0x766d('0x30')]['filter']){_0x28a262[_0x766d('0x3b')]=_[_0x766d('0x3c')](_0x28a262[_0x766d('0x3b')],{'$or':_[_0x766d('0x2f')](_0x28a262['attributes'],function(_0xb221f0){var _0x109b7d={};_0x109b7d[_0xb221f0]={'$like':'%'+_0xff99dd[_0x766d('0x30')][_0x766d('0x3a')]+'%'};return _0x109b7d;})});}_0x28a262=_[_0x766d('0x3c')]({},_0x28a262,_0xff99dd[_0x766d('0x3d')]);return _0x1f70b3[_0x766d('0x7d')](_0x28a262);}})[_0x766d('0x21')](function(_0x53a04d){if(_0x53a04d){_0x1e8419=_0x53a04d[_0x766d('0x36')];if(!_0xff99dd['query'][_0x766d('0x4f')](_0x766d('0x37'))){_0x28a262[_0x766d('0x1c')]=qs['limit'](_0xff99dd['query']['limit']);_0x28a262[_0x766d('0x1d')]=qs[_0x766d('0x1d')](_0xff99dd[_0x766d('0x30')]['offset']);}return _0x1f70b3[_0x766d('0x7d')](_0x28a262);}})[_0x766d('0x21')](function(_0x31aba9){if(_0x31aba9){return _0x31aba9?{'count':_0x1e8419,'rows':_0x31aba9}:null;}})[_0x766d('0x21')](respondWithResult(_0x1eea22,null))[_0x766d('0x42')](handleError(_0x1eea22,null));}; \ No newline at end of file +var _0x18da=['compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./faxQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','end','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','FaxQueue','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','rawAttributes','pick','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all'];(function(_0x291589,_0x394acd){var _0x304d5d=function(_0x12e247){while(--_0x12e247){_0x291589['push'](_0x291589['shift']());}};_0x304d5d(++_0x394acd);}(_0x18da,0x9b));var _0xa18d=function(_0x1e1d8c,_0x4e004c){_0x1e1d8c=_0x1e1d8c-0x0;var _0x5a00ae=_0x18da[_0x1e1d8c];return _0x5a00ae;};'use strict';var emlformat=require(_0xa18d('0x0'));var rimraf=require(_0xa18d('0x1'));var zipdir=require(_0xa18d('0x2'));var jsonpatch=require(_0xa18d('0x3'));var rp=require(_0xa18d('0x4'));var moment=require(_0xa18d('0x5'));var BPromise=require(_0xa18d('0x6'));var Mustache=require(_0xa18d('0x7'));var util=require(_0xa18d('0x8'));var path=require('path');var sox=require(_0xa18d('0x9'));var csv=require(_0xa18d('0xa'));var ejs=require(_0xa18d('0xb'));var fs=require('fs');var fs_extra=require(_0xa18d('0xc'));var _=require(_0xa18d('0xd'));var squel=require(_0xa18d('0xe'));var crypto=require(_0xa18d('0xf'));var jsforce=require(_0xa18d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa18d('0xa'));var querystring=require(_0xa18d('0x11'));var Papa=require('papaparse');var Redis=require(_0xa18d('0x12'));var authService=require(_0xa18d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa18d('0x14'));var hardwareService=require(_0xa18d('0x15'));var logger=require(_0xa18d('0x16'))(_0xa18d('0x17'));var utils=require(_0xa18d('0x18'));var config=require(_0xa18d('0x19'));var licenseUtil=require(_0xa18d('0x1a'));var db=require('../../mysqldb')['db'];config[_0xa18d('0x1b')]=_['defaults'](config[_0xa18d('0x1b')],{'host':_0xa18d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa18d('0x1b')]));require(_0xa18d('0x1d'))['register'](socket);function respondWithStatusCode(_0x1d852b,_0x295ba9){_0x295ba9=_0x295ba9||0xcc;return function(_0x5745e3){if(_0x5745e3){return _0x1d852b[_0xa18d('0x1e')](_0x295ba9);}return _0x1d852b[_0xa18d('0x1f')](_0x295ba9)['end']();};}function respondWithResult(_0x34ac28,_0x4d756e){_0x4d756e=_0x4d756e||0xc8;return function(_0x311691){if(_0x311691){return _0x34ac28['status'](_0x4d756e)[_0xa18d('0x20')](_0x311691);}};}function respondWithFilteredResult(_0x5e64ee,_0x51ac91){return function(_0x260dae){if(_0x260dae){var _0x384ca0=typeof _0x51ac91[_0xa18d('0x21')]===_0xa18d('0x22')&&typeof _0x51ac91[_0xa18d('0x23')]==='undefined';var _0x11bee6=_0x260dae[_0xa18d('0x24')];var _0x54e1a3=_0x384ca0?0x0:_0x51ac91[_0xa18d('0x21')];var _0x4ddbdd=_0x384ca0?_0x260dae[_0xa18d('0x24')]:_0x51ac91['offset']+_0x51ac91[_0xa18d('0x23')];var _0x3b9d73;if(_0x4ddbdd>=_0x11bee6){_0x4ddbdd=_0x11bee6;_0x3b9d73=0xc8;}else{_0x3b9d73=0xce;}_0x5e64ee[_0xa18d('0x1f')](_0x3b9d73);return _0x5e64ee[_0xa18d('0x25')](_0xa18d('0x26'),_0x54e1a3+'-'+_0x4ddbdd+'/'+_0x11bee6)[_0xa18d('0x20')](_0x260dae);}return null;};}function patchUpdates(_0x2b606b){return function(_0x4708a8){try{jsonpatch[_0xa18d('0x27')](_0x4708a8,_0x2b606b,!![]);}catch(_0x2d3251){return BPromise[_0xa18d('0x28')](_0x2d3251);}return _0x4708a8[_0xa18d('0x29')]();};}function saveUpdates(_0x25d74e,_0xcf0258){return function(_0x1a2dba){if(_0x1a2dba){return _0x1a2dba[_0xa18d('0x2a')](_0x25d74e)[_0xa18d('0x2b')](function(_0x44b813){return _0x44b813;});}return null;};}function removeEntity(_0x5aecbd,_0x35a953){return function(_0x26f4dc){if(_0x26f4dc){return _0x26f4dc[_0xa18d('0x2c')]()['then'](function(){var _0x1dd5b0=_0x26f4dc['get']({'plain':!![]});var _0x5f95e6=_0xa18d('0x2d');return db[_0xa18d('0x2e')][_0xa18d('0x2c')]({'where':{'type':_0x5f95e6,'resourceId':_0x1dd5b0['id']}})[_0xa18d('0x2b')](function(){return _0x26f4dc;});})[_0xa18d('0x2b')](function(){_0x5aecbd['status'](0xcc)[_0xa18d('0x2f')]();});}};}function handleEntityNotFound(_0x1e57a1,_0x2799f2){return function(_0xed604){if(!_0xed604){_0x1e57a1[_0xa18d('0x1e')](0x194);}return _0xed604;};}function handleError(_0x145a53,_0x230fc4){_0x230fc4=_0x230fc4||0x1f4;return function(_0xd18a19){logger['error'](_0xd18a19['stack']);if(_0xd18a19[_0xa18d('0x30')]){delete _0xd18a19[_0xa18d('0x30')];}_0x145a53[_0xa18d('0x1f')](_0x230fc4)[_0xa18d('0x31')](_0xd18a19);};}exports[_0xa18d('0x32')]=function(_0x368ac4,_0x2992bc){var _0x64b68={},_0x5e88af={},_0x550403={'count':0x0,'rows':[]};var _0x4df221=_[_0xa18d('0x33')](db['FaxQueue']['rawAttributes'],function(_0x594020){return{'name':_0x594020[_0xa18d('0x34')],'type':_0x594020[_0xa18d('0x35')][_0xa18d('0x36')]};});_0x5e88af[_0xa18d('0x37')]=_[_0xa18d('0x33')](_0x4df221,_0xa18d('0x30'));_0x5e88af['query']=_[_0xa18d('0x38')](_0x368ac4[_0xa18d('0x39')]);_0x5e88af[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0x5e88af[_0xa18d('0x37')],_0x5e88af[_0xa18d('0x39')]);_0x64b68[_0xa18d('0x3c')]=_[_0xa18d('0x3b')](_0x5e88af['model'],qs[_0xa18d('0x3d')](_0x368ac4['query']['fields']));_0x64b68['attributes']=_0x64b68[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0x64b68[_0xa18d('0x3c')]:_0x5e88af[_0xa18d('0x37')];if(!_0x368ac4[_0xa18d('0x39')][_0xa18d('0x3f')](_0xa18d('0x40'))){_0x64b68[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x368ac4['query'][_0xa18d('0x23')]);_0x64b68[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x368ac4[_0xa18d('0x39')][_0xa18d('0x21')]);}_0x64b68[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x368ac4[_0xa18d('0x39')][_0xa18d('0x42')]);_0x64b68[_0xa18d('0x43')]=qs[_0xa18d('0x3a')](_['pick'](_0x368ac4[_0xa18d('0x39')],_0x5e88af[_0xa18d('0x3a')]),_0x4df221);if(_0x368ac4[_0xa18d('0x39')][_0xa18d('0x44')]){_0x64b68[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x64b68[_0xa18d('0x43')],{'$or':_[_0xa18d('0x33')](_0x4df221,function(_0x1c14b4){if(_0x1c14b4[_0xa18d('0x35')]!=='VIRTUAL'){var _0x34889c={};_0x34889c[_0x1c14b4[_0xa18d('0x30')]]={'$like':'%'+_0x368ac4[_0xa18d('0x39')][_0xa18d('0x44')]+'%'};return _0x34889c;}})});}_0x64b68=_['merge']({},_0x64b68,_0x368ac4[_0xa18d('0x46')]);var _0x354fae={'where':_0x64b68[_0xa18d('0x43')]};return db[_0xa18d('0x47')][_0xa18d('0x24')](_0x354fae)['then'](function(_0xa39e6a){_0x550403[_0xa18d('0x24')]=_0xa39e6a;if(_0x368ac4[_0xa18d('0x39')][_0xa18d('0x48')]){_0x64b68[_0xa18d('0x49')]=[{'all':!![]}];}return db[_0xa18d('0x47')][_0xa18d('0x4a')](_0x64b68);})[_0xa18d('0x2b')](function(_0x54ad22){_0x550403['rows']=_0x54ad22;return _0x550403;})['then'](respondWithFilteredResult(_0x2992bc,_0x64b68))[_0xa18d('0x4b')](handleError(_0x2992bc,null));};exports[_0xa18d('0x4c')]=function(_0x48d151,_0x96a20a){var _0xc3b393={'raw':!![],'where':{'id':_0x48d151[_0xa18d('0x4d')]['id']}},_0x1cbd2c={};_0x1cbd2c[_0xa18d('0x37')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x1cbd2c[_0xa18d('0x39')]=_['keys'](_0x48d151[_0xa18d('0x39')]);_0x1cbd2c[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0x1cbd2c[_0xa18d('0x37')],_0x1cbd2c[_0xa18d('0x39')]);_0xc3b393[_0xa18d('0x3c')]=_['intersection'](_0x1cbd2c[_0xa18d('0x37')],qs[_0xa18d('0x3d')](_0x48d151[_0xa18d('0x39')][_0xa18d('0x3d')]));_0xc3b393[_0xa18d('0x3c')]=_0xc3b393[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0xc3b393[_0xa18d('0x3c')]:_0x1cbd2c[_0xa18d('0x37')];if(_0x48d151[_0xa18d('0x39')]['includeAll']){_0xc3b393['include']=[{'all':!![]}];}_0xc3b393=_[_0xa18d('0x45')]({},_0xc3b393,_0x48d151[_0xa18d('0x46')]);return db[_0xa18d('0x47')][_0xa18d('0x4e')](_0xc3b393)[_0xa18d('0x2b')](handleEntityNotFound(_0x96a20a,null))['then'](respondWithResult(_0x96a20a,null))[_0xa18d('0x4b')](handleError(_0x96a20a,null));};exports[_0xa18d('0x4f')]=function(_0x141d84,_0x108564){return db[_0xa18d('0x47')]['create'](_0x141d84[_0xa18d('0x50')],{})[_0xa18d('0x2b')](function(_0x580582){var _0x3f0cda=_0x141d84[_0xa18d('0x51')]['get']({'plain':!![]});if(!_0x3f0cda)throw new Error(_0xa18d('0x52'));if(_0x3f0cda[_0xa18d('0x53')]===_0xa18d('0x51')){var _0x5751dd=_0x580582[_0xa18d('0x54')]({'plain':!![]});var _0x180b01='FaxQueues';return db[_0xa18d('0x55')]['find']({'where':{'name':_0x180b01,'userProfileId':_0x3f0cda['userProfileId']},'raw':!![]})[_0xa18d('0x2b')](function(_0x4de31a){if(_0x4de31a&&_0x4de31a[_0xa18d('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x5751dd[_0xa18d('0x30')],'resourceId':_0x5751dd['id'],'type':_0x4de31a['name'],'sectionId':_0x4de31a['id']},{})[_0xa18d('0x2b')](function(){return _0x580582;});}else{return _0x580582;}})['catch'](function(_0x724000){logger['error'](_0xa18d('0x57'),_0x724000);throw _0x724000;});}return _0x580582;})['then'](respondWithResult(_0x108564,0xc9))['catch'](handleError(_0x108564,null));};exports[_0xa18d('0x2a')]=function(_0xf97be0,_0x17cdb2){if(_0xf97be0['body']['id']){delete _0xf97be0[_0xa18d('0x50')]['id'];}return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0xf97be0['params']['id']}})['then'](handleEntityNotFound(_0x17cdb2,null))[_0xa18d('0x2b')](saveUpdates(_0xf97be0[_0xa18d('0x50')],null))[_0xa18d('0x2b')](respondWithResult(_0x17cdb2,null))[_0xa18d('0x4b')](handleError(_0x17cdb2,null));};exports[_0xa18d('0x2c')]=function(_0x48c7bd,_0x38dbca){return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0x48c7bd['params']['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x38dbca,null))[_0xa18d('0x2b')](removeEntity(_0x38dbca,null))[_0xa18d('0x4b')](handleError(_0x38dbca,null));};exports[_0xa18d('0x58')]=function(_0x52df78,_0x3a87e9){return db[_0xa18d('0x47')][_0xa18d('0x58')]()[_0xa18d('0x2b')](respondWithResult(_0x3a87e9,null))[_0xa18d('0x4b')](handleError(_0x3a87e9,null));};exports[_0xa18d('0x59')]=function(_0x1c3168,_0x45c230,_0x380328){var _0x4939f0={'raw':!![],'where':{}},_0xf358dc={},_0xdd272f;return db[_0xa18d('0x47')]['findOne']({'where':{'id':_0x1c3168[_0xa18d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x45c230,null))[_0xa18d('0x2b')](function(_0x2ae352){if(_0x2ae352){_0xdd272f=_0x2ae352[_0xa18d('0x54')]({'plain':!![]});_0xf358dc[_0xa18d('0x37')]=_[_0xa18d('0x38')](db[_0xa18d('0x5a')][_0xa18d('0x5b')]);_0xf358dc[_0xa18d('0x39')]=_['keys'](_0x1c3168['query']);_0xf358dc['filters']=_['intersection'](_0xf358dc[_0xa18d('0x37')],_0xf358dc['query']);_0x4939f0['attributes']=_[_0xa18d('0x3b')](_0xf358dc[_0xa18d('0x37')],qs['fields'](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x3d')]));_0x4939f0[_0xa18d('0x3c')]=_0x4939f0[_0xa18d('0x3c')]['length']?_0x4939f0['attributes']:_0xf358dc[_0xa18d('0x37')];if(!_0x1c3168[_0xa18d('0x39')][_0xa18d('0x3f')]('nolimit')){_0x4939f0[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x23')]);_0x4939f0[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x21')]);}_0x4939f0[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x1c3168['query'][_0xa18d('0x42')]);_0x4939f0[_0xa18d('0x43')]=qs[_0xa18d('0x3a')](_[_0xa18d('0x5c')](_0x1c3168[_0xa18d('0x39')],_0xf358dc[_0xa18d('0x3a')]));_0x4939f0[_0xa18d('0x43')][_0xa18d('0x5d')]=_0x2ae352['id'];if(_0x1c3168['query'][_0xa18d('0x44')]){_0x4939f0[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x4939f0[_0xa18d('0x43')],{'$or':_[_0xa18d('0x33')](_0x4939f0[_0xa18d('0x3c')],function(_0x345a40){var _0x27543f={};_0x27543f[_0x345a40]={'$like':'%'+_0x1c3168['query'][_0xa18d('0x44')]+'%'};return _0x27543f;})});}_0x4939f0=_['merge']({},_0x4939f0,_0x1c3168[_0xa18d('0x46')]);return db[_0xa18d('0x5a')][_0xa18d('0x4a')](_0x4939f0);}})[_0xa18d('0x2b')](function(_0x45b28f){if(_0x45b28f){return db[_0xa18d('0x5e')][_0xa18d('0x5f')]({'where':{'id':_['map'](_0x45b28f,_0xa18d('0x60')),'role':_0xa18d('0x61')},'attributes':['id','name',_0xa18d('0x62'),'updatedAt',_0xa18d('0x63')]});}})[_0xa18d('0x2b')](function(_0x11b61b){if(_0x11b61b){return{'count':_0x11b61b[_0xa18d('0x24')],'rows':_[_0xa18d('0x33')](_0x11b61b[_0xa18d('0x64')],function(_0x9876c0){return{'membername':_0x9876c0[_0xa18d('0x30')],'UserId':_0x9876c0['id'],'queue_name':_0xdd272f[_0xa18d('0x30')],'FaxQueueId':_0xdd272f['id'],'interface':util['format'](_0xa18d('0x65'),_0xa18d('0x66'),_0x9876c0[_0xa18d('0x30')]),'penalty':0x0,'paused':_0x9876c0['faxPause'],'createdAt':_0x9876c0[_0xa18d('0x63')],'updatedAt':_0x9876c0[_0xa18d('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45c230,_0x4939f0))[_0xa18d('0x4b')](handleError(_0x45c230,null));};exports[_0xa18d('0x68')]=function(_0x3bedd5,_0x48f809,_0x59c0f1){var _0x260ebf={};var _0xe1e42f={};var _0x207da5;var _0x4eb8e6;return db['FaxQueue'][_0xa18d('0x69')]({'where':{'id':_0x3bedd5[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x48f809,null))[_0xa18d('0x2b')](function(_0x508358){if(_0x508358){_0x207da5=_0x508358;_0xe1e42f[_0xa18d('0x37')]=_['keys'](db['Team'][_0xa18d('0x5b')]);_0xe1e42f[_0xa18d('0x39')]=_['keys'](_0x3bedd5[_0xa18d('0x39')]);_0xe1e42f[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0xe1e42f[_0xa18d('0x37')],_0xe1e42f[_0xa18d('0x39')]);_0x260ebf[_0xa18d('0x3c')]=_[_0xa18d('0x3b')](_0xe1e42f[_0xa18d('0x37')],qs['fields'](_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x3d')]));_0x260ebf[_0xa18d('0x3c')]=_0x260ebf['attributes'][_0xa18d('0x3e')]?_0x260ebf[_0xa18d('0x3c')]:_0xe1e42f[_0xa18d('0x37')];_0x260ebf['order']=qs[_0xa18d('0x42')](_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x42')]);_0x260ebf[_0xa18d('0x43')]=qs['filters'](_[_0xa18d('0x5c')](_0x3bedd5[_0xa18d('0x39')],_0xe1e42f[_0xa18d('0x3a')]));if(_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x44')]){_0x260ebf['where']=_['merge'](_0x260ebf['where'],{'$or':_[_0xa18d('0x33')](_0x260ebf[_0xa18d('0x3c')],function(_0x2ef552){var _0x3d527e={};_0x3d527e[_0x2ef552]={'$like':'%'+_0x3bedd5[_0xa18d('0x39')]['filter']+'%'};return _0x3d527e;})});}_0x260ebf=_['merge']({},_0x260ebf,_0x3bedd5[_0xa18d('0x46')]);return _0x207da5[_0xa18d('0x68')](_0x260ebf);}})[_0xa18d('0x2b')](function(_0x4860b2){if(_0x4860b2){_0x4eb8e6=_0x4860b2[_0xa18d('0x3e')];if(!_0x3bedd5['query'][_0xa18d('0x3f')]('nolimit')){_0x260ebf[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x3bedd5[_0xa18d('0x39')]['limit']);_0x260ebf[_0xa18d('0x21')]=qs['offset'](_0x3bedd5[_0xa18d('0x39')]['offset']);}return _0x207da5[_0xa18d('0x68')](_0x260ebf);}})[_0xa18d('0x2b')](function(_0x2de5cb){if(_0x2de5cb){return _0x2de5cb?{'count':_0x4eb8e6,'rows':_0x2de5cb}:null;}})[_0xa18d('0x2b')](respondWithResult(_0x48f809,null))[_0xa18d('0x4b')](handleError(_0x48f809,null));};exports[_0xa18d('0x6a')]=function(_0x4e46cd,_0x4b77c8,_0x597a75){var _0x3ff944=_0x4e46cd[_0xa18d('0x50')][_0xa18d('0x6b')];return db[_0xa18d('0x6c')][_0xa18d('0x4a')]({'where':{'id':_0x3ff944},'attributes':['id'],'include':[{'model':db[_0xa18d('0x5e')],'as':_0xa18d('0x6d'),'attributes':['id',_0xa18d('0x30'),_0xa18d('0x6e'),_0xa18d('0x6f'),_0xa18d('0x70')],'raw':!![]}]})['then'](function(_0x1dd872){if(_0x1dd872){var _0x40d057=_[_0xa18d('0x71')](_0x1dd872,function(_0x50db7f){var _0x556a94=_0x50db7f[_0xa18d('0x54')]({'plain':!![]});return _0x556a94[_0xa18d('0x6d')];});return db['FaxQueue']['find']({'where':{'id':_0x4e46cd[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](function(_0x1c47cf){return db[_0xa18d('0x72')][_0xa18d('0x73')](function(_0x49876a){return _0x1c47cf[_0xa18d('0x6a')](_0x3ff944,{'transaction':_0x49876a})[_0xa18d('0x2b')](function(){return BPromise[_0xa18d('0x74')](_0x40d057,function(_0x264b28){return db['UserFaxQueue'][_0xa18d('0x75')]({'where':{'UserId':_0x264b28['id'],'FaxQueueId':_0x4e46cd[_0xa18d('0x4d')]['id']},'transaction':_0x49876a});});})[_0xa18d('0x2b')](function(){_0x40d057[_0xa18d('0x76')](function(_0x5c8895){socket['emit'](_0xa18d('0x77'),{'UserId':_0x5c8895['id'],'FaxQueueId':_0x1c47cf['id']});});});});});}})[_0xa18d('0x2b')](respondWithStatusCode(_0x4b77c8,null))['catch'](handleError(_0x4b77c8,null));};exports[_0xa18d('0x78')]=function(_0x1e08ed,_0xfe3af3,_0x52ab6a){return db[_0xa18d('0x6c')][_0xa18d('0x4a')]({'where':{'id':_0x1e08ed[_0xa18d('0x39')][_0xa18d('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa18d('0x2b')](handleEntityNotFound(_0xfe3af3,null))[_0xa18d('0x2b')](function(_0x47a57c){var _0xad22c7=_[_0xa18d('0x33')](_0x47a57c,'id');var _0x5f0ab5=[];var _0x3c991f=[];var _0x628645=squel[_0xa18d('0x79')]();_0x628645[_0xa18d('0x7a')](_0xa18d('0x7b'))[_0xa18d('0x7c')]('team_has_fax_queues','tq')['join'](_0xa18d('0x7d'),'ut',_0xa18d('0x7e'))[_0xa18d('0x43')](_0xa18d('0x7f'),_0x1e08ed['params']['id']);for(var _0x1f5f64=0x0;_0x1f5f64<_0x47a57c[_0xa18d('0x3e')];_0x1f5f64+=0x1){let _0x416ff5=_0x47a57c[_0x1f5f64];for(var _0x26693f=0x0;_0x26693f<_0x416ff5['Agents'][_0xa18d('0x3e')];_0x26693f+=0x1){let _0x2eb549=_0x416ff5[_0xa18d('0x6d')][_0x26693f];var _0x754491=_0x628645['clone']();_0x754491[_0xa18d('0x43')](_0xa18d('0x80'),_0x2eb549['id']);_0x3c991f[_0xa18d('0x81')](db[_0xa18d('0x72')][_0xa18d('0x39')](_0x754491[_0xa18d('0x82')](),{'type':db[_0xa18d('0x72')]['QueryTypes']['SELECT']})[_0xa18d('0x2b')](function(_0x4dc381){if(_0x4dc381['length']===0x1){return _0x2eb549['id'];}else{var _0x196fa1=_[_0xa18d('0x83')](_['map'](_0x4dc381,_0xa18d('0x84')),function(_0x40a03f){return _[_0xa18d('0x85')](_0xad22c7,_0x40a03f);});if(_0x196fa1){return _0x2eb549['id'];}}}));}}return BPromise[_0xa18d('0x86')](_0x3c991f)[_0xa18d('0x2b')](function(_0x49605a){_0x5f0ab5=_(_0x5f0ab5)['union'](_0x49605a)[_0xa18d('0x87')]()[_0xa18d('0x88')]();return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0x1e08ed[_0xa18d('0x4d')]['id']}})['then'](function(_0x3c22b5){return db[_0xa18d('0x72')][_0xa18d('0x73')](function(_0x3af6cf){return _0x3c22b5[_0xa18d('0x78')](_0x1e08ed['query'][_0xa18d('0x6b')],{'transaction':_0x3af6cf})[_0xa18d('0x2b')](function(){if(!_[_0xa18d('0x89')](_0x5f0ab5)){return _0x3c22b5[_0xa18d('0x8a')](_0x5f0ab5,{'transaction':_0x3af6cf});}})[_0xa18d('0x2b')](function(){_0x5f0ab5[_0xa18d('0x76')](function(_0x357660){socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':_0x357660,'FaxQueueId':_0x3c22b5['id']});});});});});});})[_0xa18d('0x2b')](respondWithStatusCode(_0xfe3af3,null))[_0xa18d('0x4b')](handleError(_0xfe3af3,null));};exports['addAgents']=function(_0x44fb30,_0x32547c,_0x6ad89){return db[_0xa18d('0x47')]['find']({'where':{'id':_0x44fb30[_0xa18d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32547c,null))['then'](function(_0x32dc88){if(_0x32dc88){return _0x32dc88[_0xa18d('0x8d')](_0x44fb30['body'][_0xa18d('0x6b')],_[_0xa18d('0x8e')](_0x44fb30['body'],[_0xa18d('0x6b'),'id'])||{})[_0xa18d('0x8f')](function(_0x63a70){for(var _0x409e73=0x0;_0x409e73<_0x44fb30[_0xa18d('0x50')][_0xa18d('0x6b')]['length'];_0x409e73+=0x1){socket[_0xa18d('0x8b')](_0xa18d('0x77'),{'UserId':Number(_0x44fb30[_0xa18d('0x50')][_0xa18d('0x6b')][_0x409e73]),'FaxQueueId':Number(_0x44fb30[_0xa18d('0x4d')]['id'])});}return _0x63a70;});}})[_0xa18d('0x2b')](respondWithResult(_0x32547c,null))[_0xa18d('0x4b')](handleError(_0x32547c,null));};exports[_0xa18d('0x8a')]=function(_0x215239,_0x1a1b3d,_0x3cff7e){return db[_0xa18d('0x47')]['find']({'where':{'id':_0x215239[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x1a1b3d,null))[_0xa18d('0x2b')](function(_0x1b2054){if(_0x1b2054){return _0x1b2054[_0xa18d('0x8a')](_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')])['then'](function(){if(_['isArray'](_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')])){for(var _0x5e6ad6=0x0;_0x5e6ad6<_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')]['length'];_0x5e6ad6+=0x1){socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':Number(_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')][_0x5e6ad6]),'FaxQueueId':Number(_0x215239[_0xa18d('0x4d')]['id'])});}}else{socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':Number(_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')]),'FaxQueueId':Number(_0x215239[_0xa18d('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a1b3d,null))[_0xa18d('0x4b')](handleError(_0x1a1b3d,null));};exports[_0xa18d('0x90')]=function(_0x25f394,_0x5ba08d,_0x986211){var _0x4686e0={};var _0x39b70c={};var _0x3795ac;var _0x420027;return db[_0xa18d('0x47')]['findOne']({'where':{'id':_0x25f394['params']['id']}})['then'](handleEntityNotFound(_0x5ba08d,null))[_0xa18d('0x2b')](function(_0x563ecb){if(_0x563ecb){_0x3795ac=_0x563ecb;_0x39b70c[_0xa18d('0x37')]=_[_0xa18d('0x38')](db[_0xa18d('0x5e')][_0xa18d('0x5b')]);_0x39b70c[_0xa18d('0x39')]=_['keys'](_0x25f394['query']);_0x39b70c['filters']=_['intersection'](_0x39b70c['model'],_0x39b70c[_0xa18d('0x39')]);_0x4686e0['attributes']=_[_0xa18d('0x3b')](_0x39b70c[_0xa18d('0x37')],qs['fields'](_0x25f394['query']['fields']));_0x4686e0[_0xa18d('0x3c')]=_0x4686e0[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0x4686e0[_0xa18d('0x3c')]:_0x39b70c[_0xa18d('0x37')];_0x4686e0[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x25f394['query']['sort']);_0x4686e0['where']=qs[_0xa18d('0x3a')](_['pick'](_0x25f394[_0xa18d('0x39')],_0x39b70c['filters']));if(_0x25f394[_0xa18d('0x39')]['filter']){_0x4686e0[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x4686e0['where'],{'$or':_['map'](_0x4686e0['attributes'],function(_0x52af2e){var _0x244489={};_0x244489[_0x52af2e]={'$like':'%'+_0x25f394['query'][_0xa18d('0x44')]+'%'};return _0x244489;})});}_0x4686e0=_[_0xa18d('0x45')]({},_0x4686e0,_0x25f394[_0xa18d('0x46')]);return _0x3795ac['getAgents'](_0x4686e0);}})['then'](function(_0xde66d9){if(_0xde66d9){_0x420027=_0xde66d9['length'];if(!_0x25f394[_0xa18d('0x39')]['hasOwnProperty']('nolimit')){_0x4686e0[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x25f394['query'][_0xa18d('0x23')]);_0x4686e0[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x25f394['query'][_0xa18d('0x21')]);}return _0x3795ac[_0xa18d('0x90')](_0x4686e0);}})[_0xa18d('0x2b')](function(_0x24d43a){if(_0x24d43a){return _0x24d43a?{'count':_0x420027,'rows':_0x24d43a}:null;}})[_0xa18d('0x2b')](respondWithResult(_0x5ba08d,null))['catch'](handleError(_0x5ba08d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7b3d49d..db57e17 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 _0xc7b1=['remove','emit','hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners','save'];(function(_0x4d8862,_0x10f367){var _0xf73886=function(_0x387b3c){while(--_0x387b3c){_0x4d8862['push'](_0x4d8862['shift']());}};_0xf73886(++_0x10f367);}(_0xc7b1,0xd4));var _0x1c7b=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xc7b1[_0x568cf0];return _0x360f81;};'use strict';var EventEmitter=require(_0x1c7b('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x1c7b('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1c7b('0x2')](0x0);var events={'afterCreate':_0x1c7b('0x3'),'afterUpdate':'update','afterDestroy':_0x1c7b('0x4')};function emitEvent(_0x36073d){return function(_0x2d72b5,_0x5d9358,_0x4a50c6){FaxQueueEvents[_0x1c7b('0x5')](_0x36073d+':'+_0x2d72b5['id'],_0x2d72b5);FaxQueueEvents[_0x1c7b('0x5')](_0x36073d,_0x2d72b5);_0x4a50c6(null);};}for(var e in events){if(events[_0x1c7b('0x6')](e)){var event=events[e];FaxQueue[_0x1c7b('0x7')](e,emitEvent(event));}}module[_0x1c7b('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x0599=['FaxQueue','setMaxListeners','save','update','hook','exports'];(function(_0x3bfe97,_0x2ae77c){var _0xee1365=function(_0x1c4267){while(--_0x1c4267){_0x3bfe97['push'](_0x3bfe97['shift']());}};_0xee1365(++_0x2ae77c);}(_0x0599,0xf0));var _0x9059=function(_0x4c129e,_0x178149){_0x4c129e=_0x4c129e-0x0;var _0x41d725=_0x0599[_0x4c129e];return _0x41d725;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x9059('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9059('0x1')](0x0);var events={'afterCreate':_0x9059('0x2'),'afterUpdate':_0x9059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55a336){return function(_0x1cdbfc,_0x331e91,_0x5d33dd){FaxQueueEvents['emit'](_0x55a336+':'+_0x1cdbfc['id'],_0x1cdbfc);FaxQueueEvents['emit'](_0x55a336,_0x1cdbfc);_0x5d33dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x9059('0x4')](e,emitEvent(event));}}module[_0x9059('0x5')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 825a8ed..febab6f 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 _0x019f=['path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','../../config/logger','moment','bluebird'];(function(_0x3cad1a,_0x4a92c5){var _0x4b768d=function(_0x2b9e6f){while(--_0x2b9e6f){_0x3cad1a['push'](_0x3cad1a['shift']());}};_0x4b768d(++_0x4a92c5);}(_0x019f,0x11f));var _0xf019=function(_0x49cf57,_0x428742){_0x49cf57=_0x49cf57-0x0;var _0x15eca3=_0x019f[_0x49cf57];return _0x15eca3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf019('0x0'))('api');var moment=require(_0xf019('0x1'));var BPromise=require(_0xf019('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf019('0x3'));var rimraf=require(_0xf019('0x4'));var config=require(_0xf019('0x5'));var attributes=require(_0xf019('0x6'));module['exports']=function(_0x5c8b23,_0x309e93){return _0x5c8b23[_0xf019('0x7')](_0xf019('0x8'),attributes,{'tableName':_0xf019('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef75=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x10c10f,_0x5a26a2){var _0x4532f0=function(_0x1c45b2){while(--_0x1c45b2){_0x10c10f['push'](_0x10c10f['shift']());}};_0x4532f0(++_0x5a26a2);}(_0xef75,0xcb));var _0x5ef7=function(_0x429842,_0x32aafa){_0x429842=_0x429842-0x0;var _0x2a3264=_0xef75[_0x429842];return _0x2a3264;};'use strict';var _=require(_0x5ef7('0x0'));var util=require(_0x5ef7('0x1'));var logger=require(_0x5ef7('0x2'))(_0x5ef7('0x3'));var moment=require('moment');var BPromise=require(_0x5ef7('0x4'));var rp=require(_0x5ef7('0x5'));var fs=require('fs');var path=require(_0x5ef7('0x6'));var rimraf=require(_0x5ef7('0x7'));var config=require(_0x5ef7('0x8'));var attributes=require(_0x5ef7('0x9'));module[_0x5ef7('0xa')]=function(_0x562743,_0x4e3e8e){return _0x562743[_0x5ef7('0xb')](_0x5ef7('0xc'),attributes,{'tableName':_0x5ef7('0xd'),'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 695f9c2..fdefac2 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 _0x69b5=['findAll','options','where','attributes','include','map','model','ShowFaxQueue','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue'];(function(_0x5ee17a,_0x333966){var _0x27eb75=function(_0x4e01c5){while(--_0x4e01c5){_0x5ee17a['push'](_0x5ee17a['shift']());}};_0x27eb75(++_0x333966);}(_0x69b5,0x141));var _0x569b=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x69b5[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x569b('0x0'));var util=require('util');var moment=require(_0x569b('0x1'));var BPromise=require('bluebird');var rs=require(_0x569b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x569b('0x3'))['db'];var utils=require(_0x569b('0x4'));var logger=require(_0x569b('0x5'))(_0x569b('0x6'));var config=require(_0x569b('0x7'));var jayson=require(_0x569b('0x8'));var client=jayson[_0x569b('0x9')]['http']({'port':0x232a});config[_0x569b('0xa')]=_[_0x569b('0xb')](config[_0x569b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x569b('0xc'))(new Redis(config['redis']));require(_0x569b('0xd'))[_0x569b('0xe')](socket);function respondWithRpcPromise(_0x1fad47,_0x237342,_0xf267c7){return new BPromise(function(_0xa8413b,_0x7fadf4){return client[_0x569b('0xf')](_0x1fad47,_0xf267c7)[_0x569b('0x10')](function(_0x1452ec){logger[_0x569b('0x11')](_0x569b('0x12'),_0x237342,_0x569b('0x13'));logger[_0x569b('0x14')](_0x569b('0x15'),_0x237342,_0x569b('0x13'),JSON[_0x569b('0x16')](_0x1452ec));if(_0x1452ec['error']){if(_0x1452ec[_0x569b('0x17')][_0x569b('0x18')]===0x1f4){logger[_0x569b('0x17')](_0x569b('0x12'),_0x237342,_0x1452ec['error']['message']);return _0x7fadf4(_0x1452ec[_0x569b('0x17')][_0x569b('0x19')]);}logger[_0x569b('0x17')](_0x569b('0x12'),_0x237342,_0x1452ec[_0x569b('0x17')][_0x569b('0x19')]);return _0xa8413b(_0x1452ec[_0x569b('0x17')][_0x569b('0x19')]);}else{logger[_0x569b('0x11')](_0x569b('0x12'),_0x237342,_0x569b('0x13'));_0xa8413b(_0x1452ec[_0x569b('0x1a')][_0x569b('0x19')]);}})[_0x569b('0x1b')](function(_0x4f8d1c){logger['error'](_0x569b('0x12'),_0x237342,_0x4f8d1c);_0x7fadf4(_0x4f8d1c);});});}exports[_0x569b('0x1c')]=function(_0x1beecc){var _0x4e2439=this;return new Promise(function(_0x5e4f8a,_0x2d3b0e){return db[_0x569b('0x1d')][_0x569b('0x1e')]({'raw':_0x1beecc[_0x569b('0x1f')]?_0x1beecc[_0x569b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1beecc['options']?_0x1beecc['options'][_0x569b('0x20')]||null:null,'attributes':_0x1beecc[_0x569b('0x1f')]?_0x1beecc['options'][_0x569b('0x21')]||null:null,'limit':_0x1beecc['options']?_0x1beecc[_0x569b('0x1f')]['limit']||null:null,'include':_0x1beecc[_0x569b('0x1f')]?_0x1beecc[_0x569b('0x1f')][_0x569b('0x22')]?_[_0x569b('0x23')](_0x1beecc[_0x569b('0x1f')]['include'],function(_0x24be7d){return{'model':db[_0x24be7d[_0x569b('0x24')]],'as':_0x24be7d['as'],'attributes':_0x24be7d['attributes'],'include':_0x24be7d[_0x569b('0x22')]?_['map'](_0x24be7d[_0x569b('0x22')],function(_0x939d01){return{'model':db[_0x939d01['model']],'as':_0x939d01['as'],'attributes':_0x939d01[_0x569b('0x21')],'include':_0x939d01[_0x569b('0x22')]?_[_0x569b('0x23')](_0x939d01[_0x569b('0x22')],function(_0x4870da){return{'model':db[_0x4870da['model']],'as':_0x4870da['as'],'attributes':_0x4870da[_0x569b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x569b('0x10')](function(_0x766ee4){logger['info'](_0x569b('0x1c'),_0x1beecc);logger[_0x569b('0x14')](_0x569b('0x1c'),_0x1beecc,JSON[_0x569b('0x16')](_0x766ee4));_0x5e4f8a(_0x766ee4);})[_0x569b('0x1b')](function(_0x3b4ac4){logger[_0x569b('0x17')](_0x569b('0x1c'),_0x3b4ac4['message'],_0x1beecc);_0x2d3b0e(_0x4e2439[_0x569b('0x17')](0x1f4,_0x3b4ac4[_0x569b('0x19')]));});});};exports[_0x569b('0x25')]=function(_0x171f8c){var _0x578bad=this;return new Promise(function(_0x207447,_0x5ebe63){return db[_0x569b('0x1d')][_0x569b('0x26')]({'raw':_0x171f8c[_0x569b('0x1f')]?_0x171f8c[_0x569b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x171f8c[_0x569b('0x1f')]?_0x171f8c['options'][_0x569b('0x20')]||null:null,'attributes':_0x171f8c['options']?_0x171f8c['options'][_0x569b('0x21')]||null:null,'include':_0x171f8c[_0x569b('0x1f')]?_0x171f8c['options']['include']?_[_0x569b('0x23')](_0x171f8c[_0x569b('0x1f')]['include'],function(_0x4b3294){return{'model':db[_0x4b3294[_0x569b('0x24')]],'as':_0x4b3294['as'],'attributes':_0x4b3294[_0x569b('0x21')],'include':_0x4b3294[_0x569b('0x22')]?_[_0x569b('0x23')](_0x4b3294[_0x569b('0x22')],function(_0x9210cd){return{'model':db[_0x9210cd[_0x569b('0x24')]],'as':_0x9210cd['as'],'attributes':_0x9210cd[_0x569b('0x21')],'include':_0x9210cd[_0x569b('0x22')]?_[_0x569b('0x23')](_0x9210cd[_0x569b('0x22')],function(_0x155d7c){return{'model':db[_0x155d7c[_0x569b('0x24')]],'as':_0x155d7c['as'],'attributes':_0x155d7c[_0x569b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x569b('0x10')](function(_0x170602){logger[_0x569b('0x11')](_0x569b('0x25'),_0x171f8c);logger[_0x569b('0x14')]('ShowFaxQueue',_0x171f8c,JSON[_0x569b('0x16')](_0x170602));_0x207447(_0x170602);})[_0x569b('0x1b')](function(_0x37ab4b){logger[_0x569b('0x17')](_0x569b('0x25'),_0x37ab4b[_0x569b('0x19')],_0x171f8c);_0x5ebe63(_0x578bad[_0x569b('0x17')](0x1f4,_0x37ab4b[_0x569b('0x19')]));});});}; \ No newline at end of file +var _0x931a=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','limit','include','map','model','attributes','stringify','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4225aa,_0x582bf2){var _0x3f8fab=function(_0x498647){while(--_0x498647){_0x4225aa['push'](_0x4225aa['shift']());}};_0x3f8fab(++_0x582bf2);}(_0x931a,0x116));var _0xa931=function(_0xc95737,_0xae8df6){_0xc95737=_0xc95737-0x0;var _0x387f66=_0x931a[_0xc95737];return _0x387f66;};'use strict';var _=require(_0xa931('0x0'));var util=require(_0xa931('0x1'));var moment=require(_0xa931('0x2'));var BPromise=require(_0xa931('0x3'));var rs=require(_0xa931('0x4'));var fs=require('fs');var Redis=require(_0xa931('0x5'));var db=require(_0xa931('0x6'))['db'];var utils=require(_0xa931('0x7'));var logger=require('../../config/logger')(_0xa931('0x8'));var config=require(_0xa931('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa931('0xa')]['http']({'port':0x232a});config[_0xa931('0xb')]=_[_0xa931('0xc')](config[_0xa931('0xb')],{'host':_0xa931('0xd'),'port':0x18eb});var socket=require(_0xa931('0xe'))(new Redis(config[_0xa931('0xb')]));require(_0xa931('0xf'))[_0xa931('0x10')](socket);function respondWithRpcPromise(_0x4dafc2,_0x350bfa,_0x8521db){return new BPromise(function(_0x4a434c,_0xf8da3f){return client['request'](_0x4dafc2,_0x8521db)[_0xa931('0x11')](function(_0x1ce7c3){logger[_0xa931('0x12')](_0xa931('0x13'),_0x350bfa,_0xa931('0x14'));logger[_0xa931('0x15')](_0xa931('0x16'),_0x350bfa,_0xa931('0x14'),JSON['stringify'](_0x1ce7c3));if(_0x1ce7c3[_0xa931('0x17')]){if(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x350bfa,_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);return _0xf8da3f(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);}logger[_0xa931('0x17')](_0xa931('0x13'),_0x350bfa,_0x1ce7c3['error'][_0xa931('0x19')]);return _0x4a434c(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);}else{logger[_0xa931('0x12')](_0xa931('0x13'),_0x350bfa,_0xa931('0x14'));_0x4a434c(_0x1ce7c3['result'][_0xa931('0x19')]);}})[_0xa931('0x1a')](function(_0xb663fb){logger[_0xa931('0x17')](_0xa931('0x13'),_0x350bfa,_0xb663fb);_0xf8da3f(_0xb663fb);});});}exports[_0xa931('0x1b')]=function(_0x268d30){var _0x235dcd=this;return new Promise(function(_0x568d4c,_0x1d8724){return db[_0xa931('0x1c')][_0xa931('0x1d')]({'raw':_0x268d30[_0xa931('0x1e')]?_0x268d30[_0xa931('0x1e')][_0xa931('0x1f')]===undefined?!![]:![]:!![],'where':_0x268d30[_0xa931('0x1e')]?_0x268d30[_0xa931('0x1e')]['where']||null:null,'attributes':_0x268d30['options']?_0x268d30['options']['attributes']||null:null,'limit':_0x268d30[_0xa931('0x1e')]?_0x268d30['options'][_0xa931('0x20')]||null:null,'include':_0x268d30['options']?_0x268d30[_0xa931('0x1e')][_0xa931('0x21')]?_[_0xa931('0x22')](_0x268d30[_0xa931('0x1e')][_0xa931('0x21')],function(_0x3e9761){return{'model':db[_0x3e9761[_0xa931('0x23')]],'as':_0x3e9761['as'],'attributes':_0x3e9761[_0xa931('0x24')],'include':_0x3e9761[_0xa931('0x21')]?_['map'](_0x3e9761[_0xa931('0x21')],function(_0x3c64b1){return{'model':db[_0x3c64b1['model']],'as':_0x3c64b1['as'],'attributes':_0x3c64b1[_0xa931('0x24')],'include':_0x3c64b1[_0xa931('0x21')]?_[_0xa931('0x22')](_0x3c64b1[_0xa931('0x21')],function(_0x43ba90){return{'model':db[_0x43ba90[_0xa931('0x23')]],'as':_0x43ba90['as'],'attributes':_0x43ba90[_0xa931('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa931('0x11')](function(_0x3066a1){logger[_0xa931('0x12')](_0xa931('0x1b'),_0x268d30);logger[_0xa931('0x15')]('GetFaxQueue',_0x268d30,JSON[_0xa931('0x25')](_0x3066a1));_0x568d4c(_0x3066a1);})['catch'](function(_0x363c91){logger[_0xa931('0x17')](_0xa931('0x1b'),_0x363c91[_0xa931('0x19')],_0x268d30);_0x1d8724(_0x235dcd['error'](0x1f4,_0x363c91[_0xa931('0x19')]));});});};exports[_0xa931('0x26')]=function(_0x4f68fb){var _0xe22069=this;return new Promise(function(_0x7675b8,_0x56d152){return db[_0xa931('0x1c')][_0xa931('0x27')]({'raw':_0x4f68fb[_0xa931('0x1e')]?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x1f')]===undefined?!![]:![]:!![],'where':_0x4f68fb['options']?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x28')]||null:null,'attributes':_0x4f68fb['options']?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x24')]||null:null,'include':_0x4f68fb[_0xa931('0x1e')]?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x21')]?_[_0xa931('0x22')](_0x4f68fb['options']['include'],function(_0xe972e4){return{'model':db[_0xe972e4[_0xa931('0x23')]],'as':_0xe972e4['as'],'attributes':_0xe972e4[_0xa931('0x24')],'include':_0xe972e4[_0xa931('0x21')]?_[_0xa931('0x22')](_0xe972e4['include'],function(_0x51faed){return{'model':db[_0x51faed[_0xa931('0x23')]],'as':_0x51faed['as'],'attributes':_0x51faed['attributes'],'include':_0x51faed['include']?_[_0xa931('0x22')](_0x51faed[_0xa931('0x21')],function(_0x4a5201){return{'model':db[_0x4a5201['model']],'as':_0x4a5201['as'],'attributes':_0x4a5201[_0xa931('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa931('0x11')](function(_0x3c92fb){logger[_0xa931('0x12')]('ShowFaxQueue',_0x4f68fb);logger[_0xa931('0x15')](_0xa931('0x26'),_0x4f68fb,JSON['stringify'](_0x3c92fb));_0x7675b8(_0x3c92fb);})['catch'](function(_0x2501d0){logger[_0xa931('0x17')](_0xa931('0x26'),_0x2501d0[_0xa931('0x19')],_0x4f68fb);_0x56d152(_0xe22069[_0xa931('0x17')](0x1f4,_0x2501d0[_0xa931('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2d90fc6..de81e36 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 _0xf505=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xf505,0x1e7));var _0x5f50=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0xf505[_0x34ed48];return _0x37da5c;};'use strict';var FaxQueueEvents=require(_0x5f50('0x0'));var events=[_0x5f50('0x1'),_0x5f50('0x2'),_0x5f50('0x3')];function createListener(_0x39308c,_0x4f4e49){return function(_0x14cf1e){_0x4f4e49[_0x5f50('0x4')](_0x39308c,_0x14cf1e);};}function removeListener(_0xcce51b,_0x392825){return function(){FaxQueueEvents[_0x5f50('0x5')](_0xcce51b,_0x392825);};}exports[_0x5f50('0x6')]=function(_0xf4371f){for(var _0x2ae1d0=0x0,_0x14b5c9=events[_0x5f50('0x7')];_0x2ae1d0<_0x14b5c9;_0x2ae1d0++){var _0x3f623b=events[_0x2ae1d0];var _0xb0e13f=createListener(_0x5f50('0x8')+_0x3f623b,_0xf4371f);FaxQueueEvents['on'](_0x3f623b,_0xb0e13f);}}; \ No newline at end of file +var _0x3741=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x55d2d9,_0x374c74){var _0x150ffe=function(_0x59628e){while(--_0x59628e){_0x55d2d9['push'](_0x55d2d9['shift']());}};_0x150ffe(++_0x374c74);}(_0x3741,0x17c));var _0x1374=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x3741[_0xf34b0a];return _0x5021e1;};'use strict';var FaxQueueEvents=require(_0x1374('0x0'));var events=[_0x1374('0x1'),_0x1374('0x2'),_0x1374('0x3')];function createListener(_0x28dd8c,_0x229dfb){return function(_0x1c426c){_0x229dfb['emit'](_0x28dd8c,_0x1c426c);};}function removeListener(_0xccf38d,_0x5e6ba4){return function(){FaxQueueEvents[_0x1374('0x4')](_0xccf38d,_0x5e6ba4);};}exports[_0x1374('0x5')]=function(_0x2ad015){for(var _0x10190f=0x0,_0x205bba=events[_0x1374('0x6')];_0x10190f<_0x205bba;_0x10190f++){var _0x2654dc=events[_0x10190f];var _0x36ef52=createListener(_0x1374('0x7')+_0x2654dc,_0x2ad015);FaxQueueEvents['on'](_0x2654dc,_0x36ef52);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 70b6063..529aedb 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 _0x5d58=['put','update','delete','destroy','removeTeams','removeAgents','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams'];(function(_0x558287,_0x211059){var _0x239934=function(_0x212b22){while(--_0x212b22){_0x558287['push'](_0x558287['shift']());}};_0x239934(++_0x211059);}(_0x5d58,0x187));var _0x85d5=function(_0x3d248a,_0x2dec21){_0x3d248a=_0x3d248a-0x0;var _0x5cc855=_0x5d58[_0x3d248a];return _0x5cc855;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./faxQueue.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0x4')](_0x85d5('0xa'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xc')]);router[_0x85d5('0x4')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x85d5('0xf')](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x10')]);router[_0x85d5('0xf')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller['addAgents']);router[_0x85d5('0x11')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x12')]);router[_0x85d5('0x13')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x14')]);router[_0x85d5('0x13')](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x15')]);router[_0x85d5('0x13')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x16')]);module[_0x85d5('0x17')]=router; \ No newline at end of file +var _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xcf98,0x8d));var _0x8cf9=function(_0x10e0a8,_0x545281){_0x10e0a8=_0x10e0a8-0x0;var _0x2af21b=_0xcf98[_0x10e0a8];return _0x2af21b;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d8b7e08..37e0228 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 _0x4e03=['DATE','moment','exports','STRING'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x4e03,0x1e5));var _0x34e0=function(_0x4572aa,_0x3efc7a){_0x4572aa=_0x4572aa-0x0;var _0x4a83b4=_0x4e03[_0x4572aa];return _0x4a83b4;};'use strict';var moment=require(_0x34e0('0x0'));var Sequelize=require('sequelize');module[_0x34e0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x34e0('0x2')]},'joinAt':{'type':Sequelize[_0x34e0('0x3')]},'leaveAt':{'type':Sequelize[_0x34e0('0x3')]},'acceptAt':{'type':Sequelize[_0x34e0('0x3')]},'exitAt':{'type':Sequelize[_0x34e0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a7c=['exports','STRING','DATE','moment'];(function(_0x371223,_0x536f4b){var _0x1c3557=function(_0x535738){while(--_0x535738){_0x371223['push'](_0x371223['shift']());}};_0x1c3557(++_0x536f4b);}(_0x6a7c,0x1e7));var _0xc6a7=function(_0x5f200e,_0x1fccef){_0x5f200e=_0x5f200e-0x0;var _0x34717b=_0x6a7c[_0x5f200e];return _0x34717b;};'use strict';var moment=require(_0xc6a7('0x0'));var Sequelize=require('sequelize');module[_0xc6a7('0x1')]={'uniqueid':{'type':Sequelize[_0xc6a7('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc6a7('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc6a7('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 3356974..33fbf53 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 _0x8f1f=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','where','merge','options','FaxQueueReport','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe'];(function(_0x2cf6f8,_0x2c81b3){var _0x572928=function(_0x4dcf40){while(--_0x4dcf40){_0x2cf6f8['push'](_0x2cf6f8['shift']());}};_0x572928(++_0x2c81b3);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x8f1f[_0x2ffc46];return _0x1eda8f;};'use strict';var emlformat=require(_0xf8f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8f1('0x1'));var rp=require(_0xf8f1('0x2'));var moment=require(_0xf8f1('0x3'));var BPromise=require(_0xf8f1('0x4'));var Mustache=require(_0xf8f1('0x5'));var util=require(_0xf8f1('0x6'));var path=require(_0xf8f1('0x7'));var sox=require(_0xf8f1('0x8'));var csv=require('to-csv');var ejs=require(_0xf8f1('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f1('0xa'));var _=require(_0xf8f1('0xb'));var squel=require(_0xf8f1('0xc'));var crypto=require(_0xf8f1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8f1('0xe'));var toCsv=require(_0xf8f1('0xf'));var querystring=require(_0xf8f1('0x10'));var Papa=require(_0xf8f1('0x11'));var Redis=require(_0xf8f1('0x12'));var authService=require(_0xf8f1('0x13'));var qs=require(_0xf8f1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f1('0x15'));var logger=require(_0xf8f1('0x16'))(_0xf8f1('0x17'));var utils=require(_0xf8f1('0x18'));var config=require(_0xf8f1('0x19'));var licenseUtil=require(_0xf8f1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220eb0,_0x1e9238){_0x1e9238=_0x1e9238||0xcc;return function(_0x1f4774){if(_0x1f4774){return _0x220eb0[_0xf8f1('0x1b')](_0x1e9238);}return _0x220eb0[_0xf8f1('0x1c')](_0x1e9238)['end']();};}function respondWithResult(_0x1996b2,_0x1b96f3){_0x1b96f3=_0x1b96f3||0xc8;return function(_0x3e7fd8){if(_0x3e7fd8){return _0x1996b2[_0xf8f1('0x1c')](_0x1b96f3)[_0xf8f1('0x1d')](_0x3e7fd8);}};}function respondWithFilteredResult(_0x36cb1b,_0x21f855){return function(_0x5a5a82){if(_0x5a5a82){var _0x88a1f6=typeof _0x21f855[_0xf8f1('0x1e')]==='undefined'&&typeof _0x21f855[_0xf8f1('0x1f')]===_0xf8f1('0x20');var _0x32d2c1=_0x5a5a82['count'];var _0x3bd8ba=_0x88a1f6?0x0:_0x21f855[_0xf8f1('0x1e')];var _0x410299=_0x88a1f6?_0x5a5a82[_0xf8f1('0x21')]:_0x21f855[_0xf8f1('0x1e')]+_0x21f855['limit'];var _0x12474a;if(_0x410299>=_0x32d2c1){_0x410299=_0x32d2c1;_0x12474a=0xc8;}else{_0x12474a=0xce;}_0x36cb1b['status'](_0x12474a);return _0x36cb1b[_0xf8f1('0x22')](_0xf8f1('0x23'),_0x3bd8ba+'-'+_0x410299+'/'+_0x32d2c1)['json'](_0x5a5a82);}return null;};}function patchUpdates(_0x3aaa1c){return function(_0xfeed91){try{jsonpatch[_0xf8f1('0x24')](_0xfeed91,_0x3aaa1c,!![]);}catch(_0x409e7b){return BPromise[_0xf8f1('0x25')](_0x409e7b);}return _0xfeed91[_0xf8f1('0x26')]();};}function saveUpdates(_0x51ac2e,_0x23cf7f){return function(_0x4d93b6){if(_0x4d93b6){return _0x4d93b6[_0xf8f1('0x27')](_0x51ac2e)[_0xf8f1('0x28')](function(_0x2e5f1b){return _0x2e5f1b;});}return null;};}function removeEntity(_0x3e97e4,_0x113ffd){return function(_0x842ecb){if(_0x842ecb){return _0x842ecb[_0xf8f1('0x29')]()['then'](function(){_0x3e97e4['status'](0xcc)[_0xf8f1('0x2a')]();});}};}function handleEntityNotFound(_0x34bd9b,_0x59a6a5){return function(_0x1a7abe){if(!_0x1a7abe){_0x34bd9b[_0xf8f1('0x1b')](0x194);}return _0x1a7abe;};}function handleError(_0x2d2c5b,_0x1a96f5){_0x1a96f5=_0x1a96f5||0x1f4;return function(_0xf428fc){logger[_0xf8f1('0x2b')](_0xf428fc[_0xf8f1('0x2c')]);if(_0xf428fc['name']){delete _0xf428fc[_0xf8f1('0x2d')];}_0x2d2c5b['status'](_0x1a96f5)[_0xf8f1('0x2e')](_0xf428fc);};}exports[_0xf8f1('0x2f')]=function(_0x138c01,_0x5e4755){var _0x20c4a7={},_0x13dcd5={},_0x205283={'count':0x0,'rows':[]};var _0x4fa285=_['map'](db['FaxQueueReport'][_0xf8f1('0x30')],function(_0x116d88){return{'name':_0x116d88[_0xf8f1('0x31')],'type':_0x116d88[_0xf8f1('0x32')]['key']};});_0x13dcd5[_0xf8f1('0x33')]=_[_0xf8f1('0x34')](_0x4fa285,_0xf8f1('0x2d'));_0x13dcd5[_0xf8f1('0x35')]=_['keys'](_0x138c01[_0xf8f1('0x35')]);_0x13dcd5['filters']=_[_0xf8f1('0x36')](_0x13dcd5['model'],_0x13dcd5[_0xf8f1('0x35')]);_0x20c4a7[_0xf8f1('0x37')]=_[_0xf8f1('0x36')](_0x13dcd5[_0xf8f1('0x33')],qs[_0xf8f1('0x38')](_0x138c01[_0xf8f1('0x35')]['fields']));_0x20c4a7[_0xf8f1('0x37')]=_0x20c4a7[_0xf8f1('0x37')][_0xf8f1('0x39')]?_0x20c4a7[_0xf8f1('0x37')]:_0x13dcd5['model'];if(!_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x3a')]('nolimit')){_0x20c4a7[_0xf8f1('0x1f')]=qs[_0xf8f1('0x1f')](_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x1f')]);_0x20c4a7[_0xf8f1('0x1e')]=qs[_0xf8f1('0x1e')](_0x138c01['query'][_0xf8f1('0x1e')]);}_0x20c4a7[_0xf8f1('0x3b')]=qs['sort'](_0x138c01[_0xf8f1('0x35')]['sort']);_0x20c4a7[_0xf8f1('0x3c')]=qs['filters'](_['pick'](_0x138c01[_0xf8f1('0x35')],_0x13dcd5['filters']),_0x4fa285);if(_0x138c01[_0xf8f1('0x35')]['filter']){_0x20c4a7[_0xf8f1('0x3c')]=_['merge'](_0x20c4a7[_0xf8f1('0x3c')],{'$or':_[_0xf8f1('0x34')](_0x4fa285,function(_0x2396a6){if(_0x2396a6[_0xf8f1('0x32')]!=='VIRTUAL'){var _0x4cdba2={};_0x4cdba2[_0x2396a6[_0xf8f1('0x2d')]]={'$like':'%'+_0x138c01[_0xf8f1('0x35')]['filter']+'%'};return _0x4cdba2;}})});}_0x20c4a7=_[_0xf8f1('0x3d')]({},_0x20c4a7,_0x138c01[_0xf8f1('0x3e')]);var _0x1cbe05={'where':_0x20c4a7[_0xf8f1('0x3c')]};return db[_0xf8f1('0x3f')][_0xf8f1('0x21')](_0x1cbe05)[_0xf8f1('0x28')](function(_0x459594){_0x205283['count']=_0x459594;if(_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x40')]){_0x20c4a7[_0xf8f1('0x41')]=[{'all':!![]}];}return db[_0xf8f1('0x3f')][_0xf8f1('0x42')](_0x20c4a7);})[_0xf8f1('0x28')](function(_0x1bc45a){_0x205283[_0xf8f1('0x43')]=_0x1bc45a;return _0x205283;})['then'](respondWithFilteredResult(_0x5e4755,_0x20c4a7))[_0xf8f1('0x44')](handleError(_0x5e4755,null));};exports['show']=function(_0x37d3ea,_0x14ddfc){var _0x221496={'raw':!![],'where':{'id':_0x37d3ea['params']['id']}},_0x108238={};_0x108238[_0xf8f1('0x33')]=_[_0xf8f1('0x45')](db[_0xf8f1('0x3f')][_0xf8f1('0x30')]);_0x108238['query']=_[_0xf8f1('0x45')](_0x37d3ea[_0xf8f1('0x35')]);_0x108238['filters']=_['intersection'](_0x108238[_0xf8f1('0x33')],_0x108238[_0xf8f1('0x35')]);_0x221496[_0xf8f1('0x37')]=_[_0xf8f1('0x36')](_0x108238[_0xf8f1('0x33')],qs['fields'](_0x37d3ea[_0xf8f1('0x35')]['fields']));_0x221496[_0xf8f1('0x37')]=_0x221496['attributes'][_0xf8f1('0x39')]?_0x221496[_0xf8f1('0x37')]:_0x108238[_0xf8f1('0x33')];if(_0x37d3ea[_0xf8f1('0x35')]['includeAll']){_0x221496[_0xf8f1('0x41')]=[{'all':!![]}];}_0x221496=_[_0xf8f1('0x3d')]({},_0x221496,_0x37d3ea[_0xf8f1('0x3e')]);return db[_0xf8f1('0x3f')][_0xf8f1('0x46')](_0x221496)[_0xf8f1('0x28')](handleEntityNotFound(_0x14ddfc,null))[_0xf8f1('0x28')](respondWithResult(_0x14ddfc,null))[_0xf8f1('0x44')](handleError(_0x14ddfc,null));};exports['create']=function(_0x215ac1,_0x247c9f){return db[_0xf8f1('0x3f')][_0xf8f1('0x47')](_0x215ac1[_0xf8f1('0x48')],{})[_0xf8f1('0x28')](respondWithResult(_0x247c9f,0xc9))[_0xf8f1('0x44')](handleError(_0x247c9f,null));};exports[_0xf8f1('0x27')]=function(_0x513778,_0x3f461e){if(_0x513778[_0xf8f1('0x48')]['id']){delete _0x513778[_0xf8f1('0x48')]['id'];}return db[_0xf8f1('0x3f')]['find']({'where':{'id':_0x513778['params']['id']}})[_0xf8f1('0x28')](handleEntityNotFound(_0x3f461e,null))['then'](saveUpdates(_0x513778['body'],null))[_0xf8f1('0x28')](respondWithResult(_0x3f461e,null))[_0xf8f1('0x44')](handleError(_0x3f461e,null));};exports[_0xf8f1('0x29')]=function(_0x2f653f,_0x353dd8){return db['FaxQueueReport']['find']({'where':{'id':_0x2f653f[_0xf8f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x353dd8,null))[_0xf8f1('0x28')](removeEntity(_0x353dd8,null))[_0xf8f1('0x44')](handleError(_0x353dd8,null));};exports[_0xf8f1('0x4a')]=function(_0x35a42a,_0x4f901e){return db['FaxQueueReport']['describe']()[_0xf8f1('0x28')](respondWithResult(_0x4f901e,null))['catch'](handleError(_0x4f901e,null));}; \ No newline at end of file +var _0x235a=['destroy','error','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x197b38,_0x394a4d){var _0x20a23a=function(_0x2a5541){while(--_0x2a5541){_0x197b38['push'](_0x197b38['shift']());}};_0x20a23a(++_0x394a4d);}(_0x235a,0x1ef));var _0xa235=function(_0x5717fc,_0x456c1a){_0x5717fc=_0x5717fc-0x0;var _0x1e5111=_0x235a[_0x5717fc];return _0x1e5111;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa235('0x3'));var moment=require('moment');var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require(_0xa235('0xa'));var fs=require('fs');var fs_extra=require(_0xa235('0xb'));var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var licenseUtil=require(_0xa235('0x15'));var db=require(_0xa235('0x16'))['db'];function respondWithStatusCode(_0x5330db,_0x5510ff){_0x5510ff=_0x5510ff||0xcc;return function(_0x47aad7){if(_0x47aad7){return _0x5330db[_0xa235('0x17')](_0x5510ff);}return _0x5330db[_0xa235('0x18')](_0x5510ff)[_0xa235('0x19')]();};}function respondWithResult(_0x3bf6fc,_0x36b4b1){_0x36b4b1=_0x36b4b1||0xc8;return function(_0x44ea6a){if(_0x44ea6a){return _0x3bf6fc[_0xa235('0x18')](_0x36b4b1)[_0xa235('0x1a')](_0x44ea6a);}};}function respondWithFilteredResult(_0x1369de,_0x4aceee){return function(_0x352463){if(_0x352463){var _0x20cd67=typeof _0x4aceee[_0xa235('0x1b')]===_0xa235('0x1c')&&typeof _0x4aceee[_0xa235('0x1d')]===_0xa235('0x1c');var _0x5c6e95=_0x352463['count'];var _0x446ea2=_0x20cd67?0x0:_0x4aceee[_0xa235('0x1b')];var _0x2b3769=_0x20cd67?_0x352463['count']:_0x4aceee[_0xa235('0x1b')]+_0x4aceee[_0xa235('0x1d')];var _0x3ca514;if(_0x2b3769>=_0x5c6e95){_0x2b3769=_0x5c6e95;_0x3ca514=0xc8;}else{_0x3ca514=0xce;}_0x1369de[_0xa235('0x18')](_0x3ca514);return _0x1369de[_0xa235('0x1e')](_0xa235('0x1f'),_0x446ea2+'-'+_0x2b3769+'/'+_0x5c6e95)[_0xa235('0x1a')](_0x352463);}return null;};}function patchUpdates(_0x483771){return function(_0x5a3bea){try{jsonpatch[_0xa235('0x20')](_0x5a3bea,_0x483771,!![]);}catch(_0x21940f){return BPromise[_0xa235('0x21')](_0x21940f);}return _0x5a3bea[_0xa235('0x22')]();};}function saveUpdates(_0x2e38e,_0x3deeea){return function(_0x3d9f70){if(_0x3d9f70){return _0x3d9f70[_0xa235('0x23')](_0x2e38e)[_0xa235('0x24')](function(_0x216083){return _0x216083;});}return null;};}function removeEntity(_0x3219f1,_0x20292c){return function(_0xee45e1){if(_0xee45e1){return _0xee45e1[_0xa235('0x25')]()[_0xa235('0x24')](function(){_0x3219f1[_0xa235('0x18')](0xcc)[_0xa235('0x19')]();});}};}function handleEntityNotFound(_0x13c868,_0x976c9f){return function(_0x1cb892){if(!_0x1cb892){_0x13c868[_0xa235('0x17')](0x194);}return _0x1cb892;};}function handleError(_0x57f591,_0xe1176c){_0xe1176c=_0xe1176c||0x1f4;return function(_0x533b15){logger[_0xa235('0x26')](_0x533b15['stack']);if(_0x533b15[_0xa235('0x27')]){delete _0x533b15[_0xa235('0x27')];}_0x57f591[_0xa235('0x18')](_0xe1176c)[_0xa235('0x28')](_0x533b15);};}exports[_0xa235('0x29')]=function(_0x5d811a,_0x2585c7){var _0x612f2={},_0x55a21e={},_0x4b33ef={'count':0x0,'rows':[]};var _0x502df9=_['map'](db[_0xa235('0x2a')][_0xa235('0x2b')],function(_0x2d8073){return{'name':_0x2d8073[_0xa235('0x2c')],'type':_0x2d8073[_0xa235('0x2d')][_0xa235('0x2e')]};});_0x55a21e[_0xa235('0x2f')]=_['map'](_0x502df9,'name');_0x55a21e[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5d811a['query']);_0x55a21e[_0xa235('0x32')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],_0x55a21e[_0xa235('0x30')]);_0x612f2[_0xa235('0x34')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5d811a['query'][_0xa235('0x35')]));_0x612f2['attributes']=_0x612f2[_0xa235('0x34')][_0xa235('0x36')]?_0x612f2[_0xa235('0x34')]:_0x55a21e[_0xa235('0x2f')];if(!_0x5d811a[_0xa235('0x30')][_0xa235('0x37')](_0xa235('0x38'))){_0x612f2[_0xa235('0x1d')]=qs[_0xa235('0x1d')](_0x5d811a[_0xa235('0x30')][_0xa235('0x1d')]);_0x612f2[_0xa235('0x1b')]=qs[_0xa235('0x1b')](_0x5d811a['query']['offset']);}_0x612f2['order']=qs[_0xa235('0x39')](_0x5d811a['query'][_0xa235('0x39')]);_0x612f2[_0xa235('0x3a')]=qs[_0xa235('0x32')](_[_0xa235('0x3b')](_0x5d811a[_0xa235('0x30')],_0x55a21e[_0xa235('0x32')]),_0x502df9);if(_0x5d811a[_0xa235('0x30')]['filter']){_0x612f2[_0xa235('0x3a')]=_[_0xa235('0x3c')](_0x612f2['where'],{'$or':_[_0xa235('0x3d')](_0x502df9,function(_0x3fa927){if(_0x3fa927[_0xa235('0x2d')]!==_0xa235('0x3e')){var _0x45cc55={};_0x45cc55[_0x3fa927[_0xa235('0x27')]]={'$like':'%'+_0x5d811a[_0xa235('0x30')][_0xa235('0x3f')]+'%'};return _0x45cc55;}})});}_0x612f2=_[_0xa235('0x3c')]({},_0x612f2,_0x5d811a['options']);var _0x28c259={'where':_0x612f2[_0xa235('0x3a')]};return db[_0xa235('0x2a')][_0xa235('0x40')](_0x28c259)[_0xa235('0x24')](function(_0x542755){_0x4b33ef[_0xa235('0x40')]=_0x542755;if(_0x5d811a[_0xa235('0x30')][_0xa235('0x41')]){_0x612f2[_0xa235('0x42')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xa235('0x43')](_0x612f2);})[_0xa235('0x24')](function(_0x47801f){_0x4b33ef[_0xa235('0x44')]=_0x47801f;return _0x4b33ef;})[_0xa235('0x24')](respondWithFilteredResult(_0x2585c7,_0x612f2))[_0xa235('0x45')](handleError(_0x2585c7,null));};exports[_0xa235('0x46')]=function(_0x5c203c,_0x333ed8){var _0x4748d8={'raw':!![],'where':{'id':_0x5c203c[_0xa235('0x47')]['id']}},_0x1e90a9={};_0x1e90a9[_0xa235('0x2f')]=_['keys'](db[_0xa235('0x2a')][_0xa235('0x2b')]);_0x1e90a9[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5c203c[_0xa235('0x30')]);_0x1e90a9['filters']=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],_0x1e90a9[_0xa235('0x30')]);_0x4748d8[_0xa235('0x34')]=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5c203c[_0xa235('0x30')]['fields']));_0x4748d8[_0xa235('0x34')]=_0x4748d8[_0xa235('0x34')][_0xa235('0x36')]?_0x4748d8[_0xa235('0x34')]:_0x1e90a9[_0xa235('0x2f')];if(_0x5c203c[_0xa235('0x30')][_0xa235('0x41')]){_0x4748d8[_0xa235('0x42')]=[{'all':!![]}];}_0x4748d8=_[_0xa235('0x3c')]({},_0x4748d8,_0x5c203c['options']);return db[_0xa235('0x2a')][_0xa235('0x48')](_0x4748d8)[_0xa235('0x24')](handleEntityNotFound(_0x333ed8,null))[_0xa235('0x24')](respondWithResult(_0x333ed8,null))[_0xa235('0x45')](handleError(_0x333ed8,null));};exports['create']=function(_0x22f11c,_0x11b5e7){return db['FaxQueueReport'][_0xa235('0x49')](_0x22f11c[_0xa235('0x4a')],{})[_0xa235('0x24')](respondWithResult(_0x11b5e7,0xc9))[_0xa235('0x45')](handleError(_0x11b5e7,null));};exports['update']=function(_0x16d9e8,_0x4909e9){if(_0x16d9e8[_0xa235('0x4a')]['id']){delete _0x16d9e8[_0xa235('0x4a')]['id'];}return db['FaxQueueReport'][_0xa235('0x48')]({'where':{'id':_0x16d9e8[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x4909e9,null))[_0xa235('0x24')](saveUpdates(_0x16d9e8[_0xa235('0x4a')],null))[_0xa235('0x24')](respondWithResult(_0x4909e9,null))[_0xa235('0x45')](handleError(_0x4909e9,null));};exports[_0xa235('0x25')]=function(_0x5ab614,_0x5033dc){return db['FaxQueueReport'][_0xa235('0x48')]({'where':{'id':_0x5ab614[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x5033dc,null))[_0xa235('0x24')](removeEntity(_0x5033dc,null))['catch'](handleError(_0x5033dc,null));};exports[_0xa235('0x4b')]=function(_0x5e4a80,_0x1d9ce8){return db[_0xa235('0x2a')][_0xa235('0x4b')]()[_0xa235('0x24')](respondWithResult(_0x1d9ce8,null))['catch'](handleError(_0x1d9ce8,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 4ec3718..0540858 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(_0x325c8d,_0x549431){var _0x39f0db=function(_0x151f45){while(--_0x151f45){_0x325c8d['push'](_0x325c8d['shift']());}};_0x39f0db(++_0x549431);}(_0x53ec,0x192));var _0xc53e=function(_0x2a990c,_0x241e85){_0x2a990c=_0x2a990c-0x0;var _0x47d328=_0x53ec[_0x2a990c];return _0x47d328;};'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(_0x4ef44e,_0x33afb9){var _0x157d8d=function(_0x42fd84){while(--_0x42fd84){_0x4ef44e['push'](_0x4ef44e['shift']());}};_0x157d8d(++_0x33afb9);}(_0x326f,0xd1));var _0xf326=function(_0x22ea0e,_0x189e3c){_0x22ea0e=_0x22ea0e-0x0;var _0x2a2fe0=_0x326f[_0x22ea0e];return _0x2a2fe0;};'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 90e0cf6..14f21dc 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 _0xe8e7=['then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','attributes','UpdateFaxQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','client','request'];(function(_0x38e0f1,_0xe35387){var _0x28c00e=function(_0x29537d){while(--_0x29537d){_0x38e0f1['push'](_0x38e0f1['shift']());}};_0x28c00e(++_0xe35387);}(_0xe8e7,0x13c));var _0x7e8e=function(_0x1b8256,_0x4b2bc1){_0x1b8256=_0x1b8256-0x0;var _0x20211d=_0xe8e7[_0x1b8256];return _0x20211d;};'use strict';var _=require('lodash');var util=require(_0x7e8e('0x0'));var moment=require(_0x7e8e('0x1'));var BPromise=require(_0x7e8e('0x2'));var rs=require(_0x7e8e('0x3'));var fs=require('fs');var Redis=require(_0x7e8e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e8e('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e8e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14ac6f,_0x2c6da3,_0x2ac62c){return new BPromise(function(_0x48bdb2,_0x362ec5){return client[_0x7e8e('0x7')](_0x14ac6f,_0x2ac62c)[_0x7e8e('0x8')](function(_0x15f181){logger[_0x7e8e('0x9')]('FaxQueueReport,\x20%s,\x20%s',_0x2c6da3,_0x7e8e('0xa'));logger[_0x7e8e('0xb')](_0x7e8e('0xc'),_0x2c6da3,_0x7e8e('0xa'),JSON[_0x7e8e('0xd')](_0x15f181));if(_0x15f181[_0x7e8e('0xe')]){if(_0x15f181[_0x7e8e('0xe')][_0x7e8e('0xf')]===0x1f4){logger[_0x7e8e('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2c6da3,_0x15f181[_0x7e8e('0xe')]['message']);return _0x362ec5(_0x15f181[_0x7e8e('0xe')][_0x7e8e('0x10')]);}logger[_0x7e8e('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2c6da3,_0x15f181[_0x7e8e('0xe')][_0x7e8e('0x10')]);return _0x48bdb2(_0x15f181[_0x7e8e('0xe')]['message']);}else{logger[_0x7e8e('0x9')](_0x7e8e('0x11'),_0x2c6da3,_0x7e8e('0xa'));_0x48bdb2(_0x15f181['result'][_0x7e8e('0x10')]);}})[_0x7e8e('0x12')](function(_0x173dd5){logger['error'](_0x7e8e('0x11'),_0x2c6da3,_0x173dd5);_0x362ec5(_0x173dd5);});});}exports[_0x7e8e('0x13')]=function(_0xa1ad82){var _0x82dabf=this;return new Promise(function(_0x239e82,_0x54af26){return db[_0x7e8e('0x14')][_0x7e8e('0x15')](_0xa1ad82[_0x7e8e('0x16')],{'raw':_0xa1ad82[_0x7e8e('0x17')]?_0xa1ad82['options'][_0x7e8e('0x18')]===undefined?!![]:![]:!![]})[_0x7e8e('0x8')](function(_0x27dbbe){logger[_0x7e8e('0x9')]('CreateFaxQueueReport',_0xa1ad82);logger[_0x7e8e('0xb')](_0x7e8e('0x13'),_0xa1ad82,JSON[_0x7e8e('0xd')](_0x27dbbe));_0x239e82(_0x27dbbe);})[_0x7e8e('0x12')](function(_0x5ba1ae){logger[_0x7e8e('0xe')](_0x7e8e('0x13'),_0x5ba1ae[_0x7e8e('0x10')],_0xa1ad82);_0x54af26(_0x82dabf[_0x7e8e('0xe')](0x1f4,_0x5ba1ae[_0x7e8e('0x10')]));});});};exports['UpdateFaxQueueReport']=function(_0x444cc1){var _0x478af2=this;return new Promise(function(_0x3145b1,_0x75e773){return db[_0x7e8e('0x14')]['update'](_0x444cc1[_0x7e8e('0x16')],{'raw':_0x444cc1[_0x7e8e('0x17')]?_0x444cc1[_0x7e8e('0x17')][_0x7e8e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x444cc1[_0x7e8e('0x17')]?_0x444cc1['options']['where']||null:null,'attributes':_0x444cc1[_0x7e8e('0x17')]?_0x444cc1[_0x7e8e('0x17')][_0x7e8e('0x19')]||null:null,'limit':_0x444cc1['options']?_0x444cc1[_0x7e8e('0x17')]['limit']||null:null})[_0x7e8e('0x8')](function(_0x1b42d0){logger[_0x7e8e('0x9')]('UpdateFaxQueueReport',_0x444cc1);logger[_0x7e8e('0xb')](_0x7e8e('0x1a'),_0x444cc1,JSON['stringify'](_0x1b42d0));_0x3145b1(_0x1b42d0);})[_0x7e8e('0x12')](function(_0x247785){logger['error']('UpdateFaxQueueReport',_0x247785['message'],_0x444cc1);_0x75e773(_0x478af2[_0x7e8e('0xe')](0x1f4,_0x247785[_0x7e8e('0x10')]));});});}; \ No newline at end of file +var _0x3164=['CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','update','raw','where','limit','then','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1353ef,_0x5c1263){var _0x39e8c2=function(_0x1e24da){while(--_0x1e24da){_0x1353ef['push'](_0x1353ef['shift']());}};_0x39e8c2(++_0x5c1263);}(_0x3164,0x1b9));var _0x4316=function(_0x16984d,_0x40a4d9){_0x16984d=_0x16984d-0x0;var _0x567c12=_0x3164[_0x16984d];return _0x567c12;};'use strict';var _=require(_0x4316('0x0'));var util=require('util');var moment=require(_0x4316('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4316('0x2'));var db=require(_0x4316('0x3'))['db'];var utils=require(_0x4316('0x4'));var logger=require(_0x4316('0x5'))(_0x4316('0x6'));var config=require(_0x4316('0x7'));var jayson=require(_0x4316('0x8'));var client=jayson[_0x4316('0x9')][_0x4316('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41431e,_0xddd60,_0x38c7ba){return new BPromise(function(_0x2c5b86,_0x160172){return client[_0x4316('0xb')](_0x41431e,_0x38c7ba)['then'](function(_0x51c27a){logger[_0x4316('0xc')](_0x4316('0xd'),_0xddd60,_0x4316('0xe'));logger['debug'](_0x4316('0xf'),_0xddd60,'request\x20sent',JSON[_0x4316('0x10')](_0x51c27a));if(_0x51c27a['error']){if(_0x51c27a[_0x4316('0x11')][_0x4316('0x12')]===0x1f4){logger[_0x4316('0x11')](_0x4316('0xd'),_0xddd60,_0x51c27a[_0x4316('0x11')][_0x4316('0x13')]);return _0x160172(_0x51c27a[_0x4316('0x11')][_0x4316('0x13')]);}logger[_0x4316('0x11')](_0x4316('0xd'),_0xddd60,_0x51c27a['error'][_0x4316('0x13')]);return _0x2c5b86(_0x51c27a[_0x4316('0x11')]['message']);}else{logger['info'](_0x4316('0xd'),_0xddd60,'request\x20sent');_0x2c5b86(_0x51c27a['result'][_0x4316('0x13')]);}})[_0x4316('0x14')](function(_0x389142){logger[_0x4316('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0xddd60,_0x389142);_0x160172(_0x389142);});});}exports[_0x4316('0x15')]=function(_0x5dcefe){var _0x1e81fa=this;return new Promise(function(_0xa69c3e,_0x18aa1a){return db[_0x4316('0x16')][_0x4316('0x17')](_0x5dcefe[_0x4316('0x18')],{'raw':_0x5dcefe[_0x4316('0x19')]?_0x5dcefe['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33d196){logger[_0x4316('0xc')](_0x4316('0x15'),_0x5dcefe);logger[_0x4316('0x1a')]('CreateFaxQueueReport',_0x5dcefe,JSON['stringify'](_0x33d196));_0xa69c3e(_0x33d196);})[_0x4316('0x14')](function(_0x3d9189){logger['error'](_0x4316('0x15'),_0x3d9189[_0x4316('0x13')],_0x5dcefe);_0x18aa1a(_0x1e81fa[_0x4316('0x11')](0x1f4,_0x3d9189['message']));});});};exports[_0x4316('0x1b')]=function(_0x44899b){var _0x361b7b=this;return new Promise(function(_0x22c2a9,_0x222086){return db['FaxQueueReport'][_0x4316('0x1c')](_0x44899b[_0x4316('0x18')],{'raw':_0x44899b[_0x4316('0x19')]?_0x44899b[_0x4316('0x19')][_0x4316('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44899b[_0x4316('0x19')]?_0x44899b['options'][_0x4316('0x1e')]||null:null,'attributes':_0x44899b[_0x4316('0x19')]?_0x44899b['options']['attributes']||null:null,'limit':_0x44899b[_0x4316('0x19')]?_0x44899b[_0x4316('0x19')][_0x4316('0x1f')]||null:null})[_0x4316('0x20')](function(_0x499b3a){logger['info']('UpdateFaxQueueReport',_0x44899b);logger['debug'](_0x4316('0x1b'),_0x44899b,JSON[_0x4316('0x10')](_0x499b3a));_0x22c2a9(_0x499b3a);})[_0x4316('0x14')](function(_0x47eb32){logger[_0x4316('0x11')]('UpdateFaxQueueReport',_0x47eb32['message'],_0x44899b);_0x222086(_0x361b7b[_0x4316('0x11')](0x1f4,_0x47eb32[_0x4316('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8a262e6..d7c8775 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 _0x8cee=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x8cee,0xcb));var _0xe8ce=function(_0x1c7983,_0x5c13ad){_0x1c7983=_0x1c7983-0x0;var _0x2e2d9e=_0x8cee[_0x1c7983];return _0x2e2d9e;};'use strict';var multer=require(_0xe8ce('0x0'));var util=require(_0xe8ce('0x1'));var path=require(_0xe8ce('0x2'));var timeout=require(_0xe8ce('0x3'));var express=require(_0xe8ce('0x4'));var router=express[_0xe8ce('0x5')]();var fs_extra=require(_0xe8ce('0x6'));var auth=require(_0xe8ce('0x7'));var interaction=require(_0xe8ce('0x8'));var config=require(_0xe8ce('0x9'));var controller=require(_0xe8ce('0xa'));router[_0xe8ce('0xb')]('/',auth[_0xe8ce('0xc')](),controller[_0xe8ce('0xd')]);router['get'](_0xe8ce('0xe'),auth[_0xe8ce('0xc')](),controller['describe']);router['get'](_0xe8ce('0xf'),auth[_0xe8ce('0xc')](),controller['show']);router[_0xe8ce('0x10')]('/',auth[_0xe8ce('0xc')](),controller['create']);router['put']('/:id',auth[_0xe8ce('0xc')](),controller['update']);router[_0xe8ce('0x11')](_0xe8ce('0xf'),auth['isAuthenticated'](),controller[_0xe8ce('0x12')]);module['exports']=router; \ No newline at end of file +var _0x58f9=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x113105,_0xce1173){var _0x31f76f=function(_0x55ac93){while(--_0x55ac93){_0x113105['push'](_0x113105['shift']());}};_0x31f76f(++_0xce1173);}(_0x58f9,0x100));var _0x958f=function(_0x1fa70a,_0xca1af8){_0x1fa70a=_0x1fa70a-0x0;var _0x18c010=_0x58f9[_0x1fa70a];return _0x18c010;};'use strict';var multer=require(_0x958f('0x0'));var util=require(_0x958f('0x1'));var path=require('path');var timeout=require(_0x958f('0x2'));var express=require(_0x958f('0x3'));var router=express[_0x958f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x958f('0x5'));var interaction=require(_0x958f('0x6'));var config=require('../../config/environment');var controller=require(_0x958f('0x7'));router[_0x958f('0x8')]('/',auth[_0x958f('0x9')](),controller['index']);router[_0x958f('0x8')]('/describe',auth[_0x958f('0x9')](),controller[_0x958f('0xa')]);router[_0x958f('0x8')](_0x958f('0xb'),auth[_0x958f('0x9')](),controller[_0x958f('0xc')]);router[_0x958f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x958f('0xe')](_0x958f('0xb'),auth[_0x958f('0x9')](),controller[_0x958f('0xf')]);router['delete'](_0x958f('0xb'),auth[_0x958f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index f805f14..9b381ef 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(_0x5a777b,_0x5ce32f){var _0x20da56=function(_0x5dca24){while(--_0x5dca24){_0x5a777b['push'](_0x5a777b['shift']());}};_0x20da56(++_0x5ce32f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xf3cd[_0x25efdf];return _0x22c495;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xacadf9,_0x435886){var _0x1f2a17=function(_0x52a859){while(--_0x52a859){_0xacadf9['push'](_0xacadf9['shift']());}};_0x1f2a17(++_0x435886);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 02d32d7..508ff37 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 _0x55fa=['where','filter','merge','then','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','hasOwnProperty','nolimit','order','sort'];(function(_0x5f0fee,_0x1c9258){var _0x5ebfc5=function(_0x1f544e){while(--_0x1f544e){_0x5f0fee['push'](_0x5f0fee['shift']());}};_0x5ebfc5(++_0x1c9258);}(_0x55fa,0xa5));var _0xa55f=function(_0x1c72dc,_0x2243a0){_0x1c72dc=_0x1c72dc-0x0;var _0xf3c16c=_0x55fa[_0x1c72dc];return _0xf3c16c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa55f('0x0'));var zipdir=require(_0xa55f('0x1'));var jsonpatch=require(_0xa55f('0x2'));var rp=require('request-promise');var moment=require(_0xa55f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa55f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa55f('0x5'));var ejs=require(_0xa55f('0x6'));var fs=require('fs');var fs_extra=require(_0xa55f('0x7'));var _=require(_0xa55f('0x8'));var squel=require(_0xa55f('0x9'));var crypto=require(_0xa55f('0xa'));var jsforce=require(_0xa55f('0xb'));var deskjs=require(_0xa55f('0xc'));var toCsv=require(_0xa55f('0x5'));var querystring=require(_0xa55f('0xd'));var Papa=require(_0xa55f('0xe'));var Redis=require(_0xa55f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa55f('0x10'));var hardwareService=require(_0xa55f('0x11'));var logger=require('../../config/logger')(_0xa55f('0x12'));var utils=require(_0xa55f('0x13'));var config=require(_0xa55f('0x14'));var licenseUtil=require(_0xa55f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x139e00,_0x57fa15){_0x57fa15=_0x57fa15||0xcc;return function(_0x2f2db5){if(_0x2f2db5){return _0x139e00['sendStatus'](_0x57fa15);}return _0x139e00[_0xa55f('0x16')](_0x57fa15)[_0xa55f('0x17')]();};}function respondWithResult(_0x584f09,_0x3de2c0){_0x3de2c0=_0x3de2c0||0xc8;return function(_0x262265){if(_0x262265){return _0x584f09[_0xa55f('0x16')](_0x3de2c0)[_0xa55f('0x18')](_0x262265);}};}function respondWithFilteredResult(_0x49f2bd,_0x5a53bb){return function(_0x3a33fa){if(_0x3a33fa){var _0x592e9e=typeof _0x5a53bb[_0xa55f('0x19')]===_0xa55f('0x1a')&&typeof _0x5a53bb[_0xa55f('0x1b')]==='undefined';var _0xec4a89=_0x3a33fa[_0xa55f('0x1c')];var _0xdbdc94=_0x592e9e?0x0:_0x5a53bb['offset'];var _0xdff9bc=_0x592e9e?_0x3a33fa[_0xa55f('0x1c')]:_0x5a53bb[_0xa55f('0x19')]+_0x5a53bb['limit'];var _0x5cdc8d;if(_0xdff9bc>=_0xec4a89){_0xdff9bc=_0xec4a89;_0x5cdc8d=0xc8;}else{_0x5cdc8d=0xce;}_0x49f2bd[_0xa55f('0x16')](_0x5cdc8d);return _0x49f2bd[_0xa55f('0x1d')](_0xa55f('0x1e'),_0xdbdc94+'-'+_0xdff9bc+'/'+_0xec4a89)[_0xa55f('0x18')](_0x3a33fa);}return null;};}function patchUpdates(_0x576b27){return function(_0x54289f){try{jsonpatch[_0xa55f('0x1f')](_0x54289f,_0x576b27,!![]);}catch(_0x34da3f){return BPromise[_0xa55f('0x20')](_0x34da3f);}return _0x54289f[_0xa55f('0x21')]();};}function saveUpdates(_0x234ab0,_0x2c64bf){return function(_0x4b1b5b){if(_0x4b1b5b){return _0x4b1b5b[_0xa55f('0x22')](_0x234ab0)['then'](function(_0x13c10c){return _0x13c10c;});}return null;};}function removeEntity(_0x4f84e7,_0x547630){return function(_0x1fe460){if(_0x1fe460){return _0x1fe460[_0xa55f('0x23')]()['then'](function(){_0x4f84e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x682e1d,_0x2476b9){return function(_0x1745aa){if(!_0x1745aa){_0x682e1d[_0xa55f('0x24')](0x194);}return _0x1745aa;};}function handleError(_0x1a03eb,_0x3b9d8d){_0x3b9d8d=_0x3b9d8d||0x1f4;return function(_0x199796){logger[_0xa55f('0x25')](_0x199796[_0xa55f('0x26')]);if(_0x199796[_0xa55f('0x27')]){delete _0x199796[_0xa55f('0x27')];}_0x1a03eb[_0xa55f('0x16')](_0x3b9d8d)[_0xa55f('0x28')](_0x199796);};}exports['index']=function(_0x37ec91,_0x278d38){var _0x2c2132={},_0x3097c9={},_0x5aa82d={'count':0x0,'rows':[]};var _0x227aa3=_[_0xa55f('0x29')](db[_0xa55f('0x2a')][_0xa55f('0x2b')],function(_0x29e4bd){return{'name':_0x29e4bd[_0xa55f('0x2c')],'type':_0x29e4bd[_0xa55f('0x2d')][_0xa55f('0x2e')]};});_0x3097c9[_0xa55f('0x2f')]=_[_0xa55f('0x29')](_0x227aa3,'name');_0x3097c9['query']=_[_0xa55f('0x30')](_0x37ec91['query']);_0x3097c9[_0xa55f('0x31')]=_[_0xa55f('0x32')](_0x3097c9[_0xa55f('0x2f')],_0x3097c9['query']);_0x2c2132[_0xa55f('0x33')]=_[_0xa55f('0x32')](_0x3097c9[_0xa55f('0x2f')],qs['fields'](_0x37ec91['query']['fields']));_0x2c2132[_0xa55f('0x33')]=_0x2c2132['attributes']['length']?_0x2c2132[_0xa55f('0x33')]:_0x3097c9[_0xa55f('0x2f')];if(!_0x37ec91[_0xa55f('0x34')][_0xa55f('0x35')](_0xa55f('0x36'))){_0x2c2132[_0xa55f('0x1b')]=qs[_0xa55f('0x1b')](_0x37ec91[_0xa55f('0x34')][_0xa55f('0x1b')]);_0x2c2132[_0xa55f('0x19')]=qs['offset'](_0x37ec91[_0xa55f('0x34')]['offset']);}_0x2c2132[_0xa55f('0x37')]=qs[_0xa55f('0x38')](_0x37ec91[_0xa55f('0x34')][_0xa55f('0x38')]);_0x2c2132[_0xa55f('0x39')]=qs[_0xa55f('0x31')](_['pick'](_0x37ec91[_0xa55f('0x34')],_0x3097c9[_0xa55f('0x31')]),_0x227aa3);if(_0x37ec91[_0xa55f('0x34')]['filter']){_0x2c2132[_0xa55f('0x39')]=_['merge'](_0x2c2132[_0xa55f('0x39')],{'$or':_[_0xa55f('0x29')](_0x227aa3,function(_0xb89697){if(_0xb89697[_0xa55f('0x2d')]!=='VIRTUAL'){var _0x36b610={};_0x36b610[_0xb89697[_0xa55f('0x27')]]={'$like':'%'+_0x37ec91['query'][_0xa55f('0x3a')]+'%'};return _0x36b610;}})});}_0x2c2132=_[_0xa55f('0x3b')]({},_0x2c2132,_0x37ec91['options']);var _0x1d2643={'where':_0x2c2132['where']};return db[_0xa55f('0x2a')][_0xa55f('0x1c')](_0x1d2643)[_0xa55f('0x3c')](function(_0x4e868e){_0x5aa82d[_0xa55f('0x1c')]=_0x4e868e;if(_0x37ec91[_0xa55f('0x34')][_0xa55f('0x3d')]){_0x2c2132[_0xa55f('0x3e')]=[{'all':!![]}];}return db[_0xa55f('0x2a')][_0xa55f('0x3f')](_0x2c2132);})[_0xa55f('0x3c')](function(_0x3492df){_0x5aa82d[_0xa55f('0x40')]=_0x3492df;return _0x5aa82d;})[_0xa55f('0x3c')](respondWithFilteredResult(_0x278d38,_0x2c2132))[_0xa55f('0x41')](handleError(_0x278d38,null));};exports[_0xa55f('0x42')]=function(_0x40956c,_0x1cde2f){var _0x2c4157={'raw':!![],'where':{'id':_0x40956c[_0xa55f('0x43')]['id']}},_0x5bcdf4={};_0x5bcdf4[_0xa55f('0x2f')]=_[_0xa55f('0x30')](db[_0xa55f('0x2a')]['rawAttributes']);_0x5bcdf4['query']=_['keys'](_0x40956c[_0xa55f('0x34')]);_0x5bcdf4[_0xa55f('0x31')]=_[_0xa55f('0x32')](_0x5bcdf4['model'],_0x5bcdf4['query']);_0x2c4157[_0xa55f('0x33')]=_['intersection'](_0x5bcdf4[_0xa55f('0x2f')],qs['fields'](_0x40956c['query']['fields']));_0x2c4157[_0xa55f('0x33')]=_0x2c4157[_0xa55f('0x33')][_0xa55f('0x44')]?_0x2c4157[_0xa55f('0x33')]:_0x5bcdf4['model'];if(_0x40956c['query'][_0xa55f('0x3d')]){_0x2c4157[_0xa55f('0x3e')]=[{'all':!![]}];}_0x2c4157=_['merge']({},_0x2c4157,_0x40956c[_0xa55f('0x45')]);return db[_0xa55f('0x2a')][_0xa55f('0x46')](_0x2c4157)[_0xa55f('0x3c')](handleEntityNotFound(_0x1cde2f,null))[_0xa55f('0x3c')](respondWithResult(_0x1cde2f,null))[_0xa55f('0x41')](handleError(_0x1cde2f,null));};exports['create']=function(_0x373df5,_0x462b06){return db[_0xa55f('0x2a')][_0xa55f('0x47')](_0x373df5[_0xa55f('0x48')],{})[_0xa55f('0x3c')](respondWithResult(_0x462b06,0xc9))[_0xa55f('0x41')](handleError(_0x462b06,null));};exports[_0xa55f('0x22')]=function(_0x20bf68,_0x1cff0d){if(_0x20bf68[_0xa55f('0x48')]['id']){delete _0x20bf68[_0xa55f('0x48')]['id'];}return db['FaxTransferReport'][_0xa55f('0x46')]({'where':{'id':_0x20bf68[_0xa55f('0x43')]['id']}})[_0xa55f('0x3c')](handleEntityNotFound(_0x1cff0d,null))[_0xa55f('0x3c')](saveUpdates(_0x20bf68[_0xa55f('0x48')],null))[_0xa55f('0x3c')](respondWithResult(_0x1cff0d,null))[_0xa55f('0x41')](handleError(_0x1cff0d,null));};exports[_0xa55f('0x23')]=function(_0x2d94c5,_0xe05c3d){return db[_0xa55f('0x2a')][_0xa55f('0x46')]({'where':{'id':_0x2d94c5[_0xa55f('0x43')]['id']}})[_0xa55f('0x3c')](handleEntityNotFound(_0xe05c3d,null))[_0xa55f('0x3c')](removeEntity(_0xe05c3d,null))[_0xa55f('0x41')](handleError(_0xe05c3d,null));};exports[_0xa55f('0x49')]=function(_0x508d54,_0x207fa3){return db[_0xa55f('0x2a')][_0xa55f('0x49')]()['then'](respondWithResult(_0x207fa3,null))[_0xa55f('0x41')](handleError(_0x207fa3,null));}; \ No newline at end of file +var _0x3eab=['VIRTUAL','include','findAll','rows','catch','show','params','length','merge','options','find','create','update','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter'];(function(_0x5ec019,_0x5bd130){var _0x556c3c=function(_0x24bb75){while(--_0x24bb75){_0x5ec019['push'](_0x5ec019['shift']());}};_0x556c3c(++_0x5bd130);}(_0x3eab,0x19a));var _0xb3ea=function(_0x5b63ea,_0x1a7dbf){_0x5b63ea=_0x5b63ea-0x0;var _0x5ba165=_0x3eab[_0x5b63ea];return _0x5ba165;};'use strict';var emlformat=require(_0xb3ea('0x0'));var rimraf=require(_0xb3ea('0x1'));var zipdir=require(_0xb3ea('0x2'));var jsonpatch=require(_0xb3ea('0x3'));var rp=require(_0xb3ea('0x4'));var moment=require(_0xb3ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3ea('0x6'));var util=require(_0xb3ea('0x7'));var path=require(_0xb3ea('0x8'));var sox=require(_0xb3ea('0x9'));var csv=require(_0xb3ea('0xa'));var ejs=require(_0xb3ea('0xb'));var fs=require('fs');var fs_extra=require(_0xb3ea('0xc'));var _=require(_0xb3ea('0xd'));var squel=require(_0xb3ea('0xe'));var crypto=require(_0xb3ea('0xf'));var jsforce=require(_0xb3ea('0x10'));var deskjs=require(_0xb3ea('0x11'));var toCsv=require(_0xb3ea('0xa'));var querystring=require('querystring');var Papa=require(_0xb3ea('0x12'));var Redis=require(_0xb3ea('0x13'));var authService=require(_0xb3ea('0x14'));var qs=require(_0xb3ea('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3ea('0x16'));var logger=require(_0xb3ea('0x17'))(_0xb3ea('0x18'));var utils=require(_0xb3ea('0x19'));var config=require(_0xb3ea('0x1a'));var licenseUtil=require(_0xb3ea('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x559f33,_0x24c676){_0x24c676=_0x24c676||0xcc;return function(_0x1b5a07){if(_0x1b5a07){return _0x559f33['sendStatus'](_0x24c676);}return _0x559f33[_0xb3ea('0x1c')](_0x24c676)[_0xb3ea('0x1d')]();};}function respondWithResult(_0x523c54,_0x4c7593){_0x4c7593=_0x4c7593||0xc8;return function(_0x260df8){if(_0x260df8){return _0x523c54['status'](_0x4c7593)[_0xb3ea('0x1e')](_0x260df8);}};}function respondWithFilteredResult(_0x3cfa56,_0x3a9eb5){return function(_0xc4b189){if(_0xc4b189){var _0x27444b=typeof _0x3a9eb5['offset']===_0xb3ea('0x1f')&&typeof _0x3a9eb5['limit']===_0xb3ea('0x1f');var _0xb72765=_0xc4b189['count'];var _0xb70be2=_0x27444b?0x0:_0x3a9eb5[_0xb3ea('0x20')];var _0x43a91f=_0x27444b?_0xc4b189['count']:_0x3a9eb5[_0xb3ea('0x20')]+_0x3a9eb5[_0xb3ea('0x21')];var _0x491eb8;if(_0x43a91f>=_0xb72765){_0x43a91f=_0xb72765;_0x491eb8=0xc8;}else{_0x491eb8=0xce;}_0x3cfa56['status'](_0x491eb8);return _0x3cfa56[_0xb3ea('0x22')](_0xb3ea('0x23'),_0xb70be2+'-'+_0x43a91f+'/'+_0xb72765)[_0xb3ea('0x1e')](_0xc4b189);}return null;};}function patchUpdates(_0xcce07c){return function(_0x4fb032){try{jsonpatch[_0xb3ea('0x24')](_0x4fb032,_0xcce07c,!![]);}catch(_0x5a08b1){return BPromise[_0xb3ea('0x25')](_0x5a08b1);}return _0x4fb032[_0xb3ea('0x26')]();};}function saveUpdates(_0x3bdf57,_0x47f77b){return function(_0x388153){if(_0x388153){return _0x388153['update'](_0x3bdf57)[_0xb3ea('0x27')](function(_0x1f5063){return _0x1f5063;});}return null;};}function removeEntity(_0x2da341,_0x320252){return function(_0x5671d1){if(_0x5671d1){return _0x5671d1[_0xb3ea('0x28')]()[_0xb3ea('0x27')](function(){_0x2da341[_0xb3ea('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d1ab7,_0x4ff222){return function(_0x15ad37){if(!_0x15ad37){_0x1d1ab7['sendStatus'](0x194);}return _0x15ad37;};}function handleError(_0x239a62,_0x325af6){_0x325af6=_0x325af6||0x1f4;return function(_0x5b1762){logger[_0xb3ea('0x29')](_0x5b1762['stack']);if(_0x5b1762[_0xb3ea('0x2a')]){delete _0x5b1762['name'];}_0x239a62[_0xb3ea('0x1c')](_0x325af6)[_0xb3ea('0x2b')](_0x5b1762);};}exports[_0xb3ea('0x2c')]=function(_0x329b78,_0x447533){var _0x108f7f={},_0x3e1bad={},_0x1de51d={'count':0x0,'rows':[]};var _0x595a2d=_[_0xb3ea('0x2d')](db[_0xb3ea('0x2e')][_0xb3ea('0x2f')],function(_0x2f6bd5){return{'name':_0x2f6bd5[_0xb3ea('0x30')],'type':_0x2f6bd5[_0xb3ea('0x31')][_0xb3ea('0x32')]};});_0x3e1bad[_0xb3ea('0x33')]=_['map'](_0x595a2d,_0xb3ea('0x2a'));_0x3e1bad[_0xb3ea('0x34')]=_[_0xb3ea('0x35')](_0x329b78['query']);_0x3e1bad[_0xb3ea('0x36')]=_['intersection'](_0x3e1bad[_0xb3ea('0x33')],_0x3e1bad['query']);_0x108f7f[_0xb3ea('0x37')]=_[_0xb3ea('0x38')](_0x3e1bad[_0xb3ea('0x33')],qs[_0xb3ea('0x39')](_0x329b78['query'][_0xb3ea('0x39')]));_0x108f7f[_0xb3ea('0x37')]=_0x108f7f[_0xb3ea('0x37')]['length']?_0x108f7f[_0xb3ea('0x37')]:_0x3e1bad['model'];if(!_0x329b78[_0xb3ea('0x34')]['hasOwnProperty'](_0xb3ea('0x3a'))){_0x108f7f[_0xb3ea('0x21')]=qs['limit'](_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x21')]);_0x108f7f[_0xb3ea('0x20')]=qs['offset'](_0x329b78[_0xb3ea('0x34')]['offset']);}_0x108f7f[_0xb3ea('0x3b')]=qs[_0xb3ea('0x3c')](_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x3c')]);_0x108f7f[_0xb3ea('0x3d')]=qs[_0xb3ea('0x36')](_[_0xb3ea('0x3e')](_0x329b78['query'],_0x3e1bad[_0xb3ea('0x36')]),_0x595a2d);if(_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x3f')]){_0x108f7f[_0xb3ea('0x3d')]=_['merge'](_0x108f7f[_0xb3ea('0x3d')],{'$or':_[_0xb3ea('0x2d')](_0x595a2d,function(_0x1d325f){if(_0x1d325f['type']!==_0xb3ea('0x40')){var _0x2ccafe={};_0x2ccafe[_0x1d325f[_0xb3ea('0x2a')]]={'$like':'%'+_0x329b78[_0xb3ea('0x34')]['filter']+'%'};return _0x2ccafe;}})});}_0x108f7f=_['merge']({},_0x108f7f,_0x329b78['options']);var _0x5984ea={'where':_0x108f7f[_0xb3ea('0x3d')]};return db[_0xb3ea('0x2e')]['count'](_0x5984ea)[_0xb3ea('0x27')](function(_0x499ddf){_0x1de51d['count']=_0x499ddf;if(_0x329b78[_0xb3ea('0x34')]['includeAll']){_0x108f7f[_0xb3ea('0x41')]=[{'all':!![]}];}return db[_0xb3ea('0x2e')][_0xb3ea('0x42')](_0x108f7f);})[_0xb3ea('0x27')](function(_0xeac701){_0x1de51d[_0xb3ea('0x43')]=_0xeac701;return _0x1de51d;})[_0xb3ea('0x27')](respondWithFilteredResult(_0x447533,_0x108f7f))[_0xb3ea('0x44')](handleError(_0x447533,null));};exports[_0xb3ea('0x45')]=function(_0x3bce22,_0xdb80ac){var _0x517ff3={'raw':!![],'where':{'id':_0x3bce22[_0xb3ea('0x46')]['id']}},_0x5e20ee={};_0x5e20ee[_0xb3ea('0x33')]=_['keys'](db[_0xb3ea('0x2e')]['rawAttributes']);_0x5e20ee['query']=_['keys'](_0x3bce22['query']);_0x5e20ee[_0xb3ea('0x36')]=_['intersection'](_0x5e20ee[_0xb3ea('0x33')],_0x5e20ee[_0xb3ea('0x34')]);_0x517ff3[_0xb3ea('0x37')]=_['intersection'](_0x5e20ee[_0xb3ea('0x33')],qs[_0xb3ea('0x39')](_0x3bce22['query'][_0xb3ea('0x39')]));_0x517ff3[_0xb3ea('0x37')]=_0x517ff3['attributes'][_0xb3ea('0x47')]?_0x517ff3['attributes']:_0x5e20ee['model'];if(_0x3bce22[_0xb3ea('0x34')]['includeAll']){_0x517ff3['include']=[{'all':!![]}];}_0x517ff3=_[_0xb3ea('0x48')]({},_0x517ff3,_0x3bce22[_0xb3ea('0x49')]);return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')](_0x517ff3)[_0xb3ea('0x27')](handleEntityNotFound(_0xdb80ac,null))[_0xb3ea('0x27')](respondWithResult(_0xdb80ac,null))['catch'](handleError(_0xdb80ac,null));};exports[_0xb3ea('0x4b')]=function(_0x32ab54,_0x564f6e){return db[_0xb3ea('0x2e')][_0xb3ea('0x4b')](_0x32ab54['body'],{})[_0xb3ea('0x27')](respondWithResult(_0x564f6e,0xc9))[_0xb3ea('0x44')](handleError(_0x564f6e,null));};exports[_0xb3ea('0x4c')]=function(_0x141610,_0x375bfc){if(_0x141610[_0xb3ea('0x4d')]['id']){delete _0x141610['body']['id'];}return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')]({'where':{'id':_0x141610[_0xb3ea('0x46')]['id']}})[_0xb3ea('0x27')](handleEntityNotFound(_0x375bfc,null))[_0xb3ea('0x27')](saveUpdates(_0x141610[_0xb3ea('0x4d')],null))[_0xb3ea('0x27')](respondWithResult(_0x375bfc,null))[_0xb3ea('0x44')](handleError(_0x375bfc,null));};exports[_0xb3ea('0x28')]=function(_0x4b31db,_0x1af082){return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')]({'where':{'id':_0x4b31db[_0xb3ea('0x46')]['id']}})[_0xb3ea('0x27')](handleEntityNotFound(_0x1af082,null))[_0xb3ea('0x27')](removeEntity(_0x1af082,null))[_0xb3ea('0x44')](handleError(_0x1af082,null));};exports['describe']=function(_0x17a37b,_0x24413b){return db[_0xb3ea('0x2e')][_0xb3ea('0x4e')]()['then'](respondWithResult(_0x24413b,null))[_0xb3ea('0x44')](handleError(_0x24413b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 82dbabf..05e074a 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 _0xb264=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid'];(function(_0x11dc8f,_0x26c8cf){var _0x5e4a5f=function(_0x1e16aa){while(--_0x1e16aa){_0x11dc8f['push'](_0x11dc8f['shift']());}};_0x5e4a5f(++_0x26c8cf);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b26('0x0'));var util=require(_0x4b26('0x1'));var logger=require('../../config/logger')(_0x4b26('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b26('0x3'));var fs=require('fs');var path=require(_0x4b26('0x4'));var rimraf=require(_0x4b26('0x5'));var config=require(_0x4b26('0x6'));var attributes=require(_0x4b26('0x7'));module[_0x4b26('0x8')]=function(_0x1e3af6,_0x4e039d){return _0x1e3af6[_0x4b26('0x9')](_0x4b26('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4b26('0xb'),'fields':[_0x4b26('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4599=['./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4599,0x155));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9459('0x0'));var util=require('util');var logger=require(_0x9459('0x1'))(_0x9459('0x2'));var moment=require(_0x9459('0x3'));var BPromise=require(_0x9459('0x4'));var rp=require(_0x9459('0x5'));var fs=require('fs');var path=require(_0x9459('0x6'));var rimraf=require(_0x9459('0x7'));var config=require(_0x9459('0x8'));var attributes=require(_0x9459('0x9'));module[_0x9459('0xa')]=function(_0x41b4fb,_0x2c9abb){return _0x41b4fb['define'](_0x9459('0xb'),attributes,{'tableName':_0x9459('0xc'),'paranoid':![],'indexes':[{'name':_0x9459('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4b6ff85..ba6546e 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 _0x1150=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1150,0x6e));var _0x0115=function(_0x5265d5,_0x51a837){_0x5265d5=_0x5265d5-0x0;var _0x44899d=_0x1150[_0x5265d5];return _0x44899d;};'use strict';var _=require('lodash');var util=require(_0x0115('0x0'));var moment=require(_0x0115('0x1'));var BPromise=require(_0x0115('0x2'));var rs=require(_0x0115('0x3'));var fs=require('fs');var Redis=require(_0x0115('0x4'));var db=require(_0x0115('0x5'))['db'];var utils=require(_0x0115('0x6'));var logger=require(_0x0115('0x7'))(_0x0115('0x8'));var config=require(_0x0115('0x9'));var jayson=require(_0x0115('0xa'));var client=jayson[_0x0115('0xb')][_0x0115('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12c39b,_0x329cb3,_0x41aa29){return new BPromise(function(_0x2e2a8e,_0xf3d762){return client[_0x0115('0xd')](_0x12c39b,_0x41aa29)[_0x0115('0xe')](function(_0xc2ce65){logger['info'](_0x0115('0xf'),_0x329cb3,_0x0115('0x10'));logger[_0x0115('0x11')](_0x0115('0x12'),_0x329cb3,_0x0115('0x10'),JSON['stringify'](_0xc2ce65));if(_0xc2ce65[_0x0115('0x13')]){if(_0xc2ce65['error'][_0x0115('0x14')]===0x1f4){logger[_0x0115('0x13')](_0x0115('0xf'),_0x329cb3,_0xc2ce65[_0x0115('0x13')]['message']);return _0xf3d762(_0xc2ce65['error']['message']);}logger['error'](_0x0115('0xf'),_0x329cb3,_0xc2ce65[_0x0115('0x13')]['message']);return _0x2e2a8e(_0xc2ce65[_0x0115('0x13')][_0x0115('0x15')]);}else{logger[_0x0115('0x16')](_0x0115('0xf'),_0x329cb3,_0x0115('0x10'));_0x2e2a8e(_0xc2ce65[_0x0115('0x17')][_0x0115('0x15')]);}})[_0x0115('0x18')](function(_0x8901f2){logger[_0x0115('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x329cb3,_0x8901f2);_0xf3d762(_0x8901f2);});});} \ No newline at end of file +var _0x16f4=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x16f4,0x133));var _0x416f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x16f4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x416f('0x0'));var util=require('util');var moment=require(_0x416f('0x1'));var BPromise=require(_0x416f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x416f('0x3'))['db'];var utils=require(_0x416f('0x4'));var logger=require(_0x416f('0x5'))('rpc');var config=require(_0x416f('0x6'));var jayson=require(_0x416f('0x7'));var client=jayson[_0x416f('0x8')][_0x416f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf956ba,_0x90a58f,_0x90013b){return new BPromise(function(_0x1cac61,_0x2b7738){return client[_0x416f('0xa')](_0xf956ba,_0x90013b)[_0x416f('0xb')](function(_0x38699e){logger[_0x416f('0xc')](_0x416f('0xd'),_0x90a58f,_0x416f('0xe'));logger[_0x416f('0xf')](_0x416f('0x10'),_0x90a58f,_0x416f('0xe'),JSON[_0x416f('0x11')](_0x38699e));if(_0x38699e[_0x416f('0x12')]){if(_0x38699e[_0x416f('0x12')][_0x416f('0x13')]===0x1f4){logger[_0x416f('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x38699e[_0x416f('0x12')][_0x416f('0x14')]);return _0x2b7738(_0x38699e[_0x416f('0x12')]['message']);}logger[_0x416f('0x12')](_0x416f('0xd'),_0x90a58f,_0x38699e[_0x416f('0x12')]['message']);return _0x1cac61(_0x38699e[_0x416f('0x12')]['message']);}else{logger[_0x416f('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x416f('0xe'));_0x1cac61(_0x38699e[_0x416f('0x15')][_0x416f('0x14')]);}})[_0x416f('0x16')](function(_0x2b442d){logger[_0x416f('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x2b442d);_0x2b7738(_0x2b442d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 55dd3eb..89b7c3b 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 _0xf250=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf250,0x1f4));var _0x0f25=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0xf250[_0x523adf];return _0x283870;};'use strict';var multer=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var path=require(_0x0f25('0x2'));var timeout=require(_0x0f25('0x3'));var express=require(_0x0f25('0x4'));var router=express['Router']();var fs_extra=require(_0x0f25('0x5'));var auth=require(_0x0f25('0x6'));var interaction=require(_0x0f25('0x7'));var config=require(_0x0f25('0x8'));var controller=require(_0x0f25('0x9'));router['get']('/',auth[_0x0f25('0xa')](),controller[_0x0f25('0xb')]);router[_0x0f25('0xc')](_0x0f25('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x0f25('0xc')](_0x0f25('0xe'),auth[_0x0f25('0xa')](),controller[_0x0f25('0xf')]);router[_0x0f25('0x10')]('/',auth[_0x0f25('0xa')](),controller[_0x0f25('0x11')]);router[_0x0f25('0x12')](_0x0f25('0xe'),auth[_0x0f25('0xa')](),controller[_0x0f25('0x13')]);router['delete']('/:id',auth[_0x0f25('0xa')](),controller[_0x0f25('0x14')]);module[_0x0f25('0x15')]=router; \ No newline at end of file +var _0x6e6d=['describe','/:id','post','create','update','delete','exports','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x36e26e,_0x13b02b){var _0x508e6c=function(_0x3c0b44){while(--_0x3c0b44){_0x36e26e['push'](_0x36e26e['shift']());}};_0x508e6c(++_0x13b02b);}(_0x6e6d,0x187));var _0xd6e6=function(_0x5241ba,_0x41a1d4){_0x5241ba=_0x5241ba-0x0;var _0x26e7c5=_0x6e6d[_0x5241ba];return _0x26e7c5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd6e6('0x0'));var express=require(_0xd6e6('0x1'));var router=express['Router']();var fs_extra=require(_0xd6e6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xd6e6('0x3'));var config=require(_0xd6e6('0x4'));var controller=require(_0xd6e6('0x5'));router[_0xd6e6('0x6')]('/',auth[_0xd6e6('0x7')](),controller['index']);router['get'](_0xd6e6('0x8'),auth[_0xd6e6('0x7')](),controller[_0xd6e6('0x9')]);router[_0xd6e6('0x6')](_0xd6e6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd6e6('0xb')]('/',auth[_0xd6e6('0x7')](),controller[_0xd6e6('0xc')]);router['put'](_0xd6e6('0xa'),auth[_0xd6e6('0x7')](),controller[_0xd6e6('0xd')]);router[_0xd6e6('0xe')](_0xd6e6('0xa'),auth[_0xd6e6('0x7')](),controller['destroy']);module[_0xd6e6('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index e3d0824..688833d 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 _0x4a7c=['post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x403c8d,_0x5e3825){var _0x4ca60d=function(_0x9326c1){while(--_0x9326c1){_0x403c8d['push'](_0x403c8d['shift']());}};_0x4ca60d(++_0x5e3825);}(_0x4a7c,0x12c));var _0xc4a7=function(_0x16d43a,_0xedfff9){_0x16d43a=_0x16d43a-0x0;var _0x5863ab=_0x4a7c[_0x16d43a];return _0x5863ab;};'use strict';var multer=require('multer');var util=require(_0xc4a7('0x0'));var path=require(_0xc4a7('0x1'));var timeout=require(_0xc4a7('0x2'));var express=require('express');var router=express[_0xc4a7('0x3')]();var fs_extra=require(_0xc4a7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc4a7('0x5'));var config=require(_0xc4a7('0x6'));var controller=require(_0xc4a7('0x7'));router[_0xc4a7('0x8')]('/',auth[_0xc4a7('0x9')](),controller[_0xc4a7('0xa')]);router['get'](_0xc4a7('0xb'),auth[_0xc4a7('0x9')](),controller['show']);router['get'](_0xc4a7('0xc'),auth[_0xc4a7('0x9')](),controller[_0xc4a7('0xd')]);router[_0xc4a7('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc4a7('0xe')]);router[_0xc4a7('0xf')]('/',auth['isAuthenticated'](),controller[_0xc4a7('0x10')]);router[_0xc4a7('0xf')](_0xc4a7('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc4a7('0x11')]('/:id',auth[_0xc4a7('0x9')](),controller[_0xc4a7('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc4a7('0x13')]);module[_0xc4a7('0x14')]=router; \ No newline at end of file +var _0xf0e3=['index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','path','connect-timeout','../../config/environment','isAuthenticated'];(function(_0x49462a,_0x52b916){var _0x20e2db=function(_0x4a38b1){while(--_0x4a38b1){_0x49462a['push'](_0x49462a['shift']());}};_0x20e2db(++_0x52b916);}(_0xf0e3,0x15c));var _0x3f0e=function(_0x1a605b,_0x7c9deb){_0x1a605b=_0x1a605b-0x0;var _0x2003b6=_0xf0e3[_0x1a605b];return _0x2003b6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3f0e('0x0'));var timeout=require(_0x3f0e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f0e('0x2'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x3f0e('0x3')](),controller[_0x3f0e('0x4')]);router[_0x3f0e('0x5')](_0x3f0e('0x6'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0x7')]);router[_0x3f0e('0x5')](_0x3f0e('0x8'),auth[_0x3f0e('0x3')](),controller['getConfigurations']);router['get'](_0x3f0e('0x9'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xa')]);router[_0x3f0e('0xb')]('/',auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xc')]);router[_0x3f0e('0xb')](_0x3f0e('0x8'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3f0e('0xe')]);router['delete'](_0x3f0e('0x6'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6351029..15e65fc 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 _0xb6af=['STRING','ENUM','basic','integrationTab','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb6af,0x142));var _0xfb6a=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xb6af[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0xfb6a('0x0'));module[_0xfb6a('0x1')]={'name':{'type':Sequelize[_0xfb6a('0x2')]},'description':{'type':Sequelize[_0xfb6a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfb6a('0x2')]},'authType':{'type':Sequelize[_0xfb6a('0x3')](_0xfb6a('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xfb6a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xfb6a('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfb6a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfb6a('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xdad0=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x1a3904,_0x812f56){var _0x8e8499=function(_0x3f5cfc){while(--_0x3f5cfc){_0x1a3904['push'](_0x1a3904['shift']());}};_0x8e8499(++_0x812f56);}(_0xdad0,0x108));var _0x0dad=function(_0x40294c,_0x2b4c24){_0x40294c=_0x40294c-0x0;var _0x547504=_0xdad0[_0x40294c];return _0x547504;};'use strict';var Sequelize=require(_0x0dad('0x0'));module[_0x0dad('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dad('0x2')]},'username':{'type':Sequelize[_0x0dad('0x2')]},'remoteUri':{'type':Sequelize[_0x0dad('0x2')]},'authType':{'type':Sequelize[_0x0dad('0x3')]('basic'),'defaultValue':_0x0dad('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0dad('0x2')]},'token':{'type':Sequelize[_0x0dad('0x2')]},'tokenSecret':{'type':Sequelize[_0x0dad('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0dad('0x3')](_0x0dad('0x5'),'newTab'),'defaultValue':_0x0dad('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index f56ca38..2612d28 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 _0x2e76=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','getConfigurations','findOne','DeskConfiguration','rawAttributes','length','addConfiguration','AccountId','channel','Descriptions','getDescriptions','type','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','format','%s/custom_fields','headers','password','base64','_embedded','name','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','stack','map','DeskAccount','fieldName','key','query','keys','filters','intersection','model','attributes'];(function(_0x26d6b5,_0x874e6a){var _0x41ad02=function(_0x2ff10e){while(--_0x2ff10e){_0x26d6b5['push'](_0x26d6b5['shift']());}};_0x41ad02(++_0x874e6a);}(_0x2e76,0x175));var _0x62e7=function(_0x53b464,_0x3e3d5d){_0x53b464=_0x53b464-0x0;var _0x47aba7=_0x2e76[_0x53b464];return _0x47aba7;};'use strict';var emlformat=require(_0x62e7('0x0'));var rimraf=require(_0x62e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62e7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62e7('0x3'));var util=require(_0x62e7('0x4'));var path=require(_0x62e7('0x5'));var sox=require(_0x62e7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62e7('0x7'));var squel=require(_0x62e7('0x8'));var crypto=require(_0x62e7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x62e7('0xa'));var toCsv=require(_0x62e7('0xb'));var querystring=require(_0x62e7('0xc'));var Papa=require(_0x62e7('0xd'));var Redis=require('ioredis');var authService=require(_0x62e7('0xe'));var qs=require(_0x62e7('0xf'));var as=require(_0x62e7('0x10'));var hardwareService=require(_0x62e7('0x11'));var logger=require(_0x62e7('0x12'))(_0x62e7('0x13'));var utils=require(_0x62e7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x62e7('0x15'));var db=require(_0x62e7('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f6a0a,_0x4d4b3){_0x4d4b3=_0x4d4b3||0xcc;return function(_0x1abe98){if(_0x1abe98){return _0x3f6a0a[_0x62e7('0x17')](_0x4d4b3);}return _0x3f6a0a[_0x62e7('0x18')](_0x4d4b3)['end']();};}function respondWithResult(_0x5b2c15,_0x59b0b2){_0x59b0b2=_0x59b0b2||0xc8;return function(_0x5f1762){if(_0x5f1762){return _0x5b2c15[_0x62e7('0x18')](_0x59b0b2)['json'](_0x5f1762);}};}function respondWithFilteredResult(_0x32f401,_0x3dcbb0){return function(_0x262c7d){if(_0x262c7d){var _0x148f86=typeof _0x3dcbb0[_0x62e7('0x19')]==='undefined'&&typeof _0x3dcbb0['limit']===_0x62e7('0x1a');var _0x2bcb17=_0x262c7d['count'];var _0x145cac=_0x148f86?0x0:_0x3dcbb0[_0x62e7('0x19')];var _0x2442a7=_0x148f86?_0x262c7d[_0x62e7('0x1b')]:_0x3dcbb0['offset']+_0x3dcbb0[_0x62e7('0x1c')];var _0x394138;if(_0x2442a7>=_0x2bcb17){_0x2442a7=_0x2bcb17;_0x394138=0xc8;}else{_0x394138=0xce;}_0x32f401['status'](_0x394138);return _0x32f401[_0x62e7('0x1d')]('Content-Range',_0x145cac+'-'+_0x2442a7+'/'+_0x2bcb17)['json'](_0x262c7d);}return null;};}function patchUpdates(_0x527014){return function(_0x3a2464){try{jsonpatch[_0x62e7('0x1e')](_0x3a2464,_0x527014,!![]);}catch(_0x463edf){return BPromise['reject'](_0x463edf);}return _0x3a2464[_0x62e7('0x1f')]();};}function saveUpdates(_0x498f4a,_0x1efb53){return function(_0x20de26){if(_0x20de26){return _0x20de26[_0x62e7('0x20')](_0x498f4a)[_0x62e7('0x21')](function(_0x2d2480){return _0x2d2480;});}return null;};}function removeEntity(_0x334f52,_0x5b4855){return function(_0xf3b416){if(_0xf3b416){return _0xf3b416[_0x62e7('0x22')]()[_0x62e7('0x21')](function(){_0x334f52['status'](0xcc)[_0x62e7('0x23')]();});}};}function handleEntityNotFound(_0x36a85e,_0xcf98a0){return function(_0xe36bab){if(!_0xe36bab){_0x36a85e['sendStatus'](0x194);}return _0xe36bab;};}function handleError(_0x2cde3c,_0x5cd8fb){_0x5cd8fb=_0x5cd8fb||0x1f4;return function(_0x5fc4c6){logger['error'](_0x5fc4c6[_0x62e7('0x24')]);if(_0x5fc4c6['name']){delete _0x5fc4c6['name'];}_0x2cde3c[_0x62e7('0x18')](_0x5cd8fb)['send'](_0x5fc4c6);};}exports['index']=function(_0xc55066,_0x17039e){var _0x24c1c4={},_0x4bb977={},_0x54baca={'count':0x0,'rows':[]};var _0x1cd9ae=_[_0x62e7('0x25')](db[_0x62e7('0x26')]['rawAttributes'],function(_0x4a516){return{'name':_0x4a516[_0x62e7('0x27')],'type':_0x4a516['type'][_0x62e7('0x28')]};});_0x4bb977['model']=_['map'](_0x1cd9ae,'name');_0x4bb977[_0x62e7('0x29')]=_[_0x62e7('0x2a')](_0xc55066[_0x62e7('0x29')]);_0x4bb977[_0x62e7('0x2b')]=_[_0x62e7('0x2c')](_0x4bb977[_0x62e7('0x2d')],_0x4bb977[_0x62e7('0x29')]);_0x24c1c4[_0x62e7('0x2e')]=_[_0x62e7('0x2c')](_0x4bb977['model'],qs['fields'](_0xc55066[_0x62e7('0x29')]['fields']));_0x24c1c4['attributes']=_0x24c1c4['attributes']['length']?_0x24c1c4['attributes']:_0x4bb977[_0x62e7('0x2d')];if(!_0xc55066[_0x62e7('0x29')][_0x62e7('0x2f')](_0x62e7('0x30'))){_0x24c1c4['limit']=qs['limit'](_0xc55066[_0x62e7('0x29')][_0x62e7('0x1c')]);_0x24c1c4[_0x62e7('0x19')]=qs['offset'](_0xc55066[_0x62e7('0x29')][_0x62e7('0x19')]);}_0x24c1c4[_0x62e7('0x31')]=qs[_0x62e7('0x32')](_0xc55066[_0x62e7('0x29')][_0x62e7('0x32')]);_0x24c1c4['where']=qs[_0x62e7('0x2b')](_[_0x62e7('0x33')](_0xc55066[_0x62e7('0x29')],_0x4bb977[_0x62e7('0x2b')]),_0x1cd9ae);if(_0xc55066[_0x62e7('0x29')][_0x62e7('0x34')]){_0x24c1c4[_0x62e7('0x35')]=_['merge'](_0x24c1c4[_0x62e7('0x35')],{'$or':_[_0x62e7('0x25')](_0x1cd9ae,function(_0x1a4939){if(_0x1a4939['type']!==_0x62e7('0x36')){var _0x421157={};_0x421157[_0x1a4939['name']]={'$like':'%'+_0xc55066[_0x62e7('0x29')][_0x62e7('0x34')]+'%'};return _0x421157;}})});}_0x24c1c4=_[_0x62e7('0x37')]({},_0x24c1c4,_0xc55066[_0x62e7('0x38')]);var _0x157089={'where':_0x24c1c4[_0x62e7('0x35')]};return db[_0x62e7('0x26')]['count'](_0x157089)[_0x62e7('0x21')](function(_0x572ed7){_0x54baca[_0x62e7('0x1b')]=_0x572ed7;if(_0xc55066[_0x62e7('0x29')]['includeAll']){_0x24c1c4['include']=[{'all':!![]}];}return db[_0x62e7('0x26')][_0x62e7('0x39')](_0x24c1c4);})[_0x62e7('0x21')](function(_0x1f519d){_0x54baca[_0x62e7('0x3a')]=_0x1f519d;return _0x54baca;})['then'](respondWithFilteredResult(_0x17039e,_0x24c1c4))[_0x62e7('0x3b')](handleError(_0x17039e,null));};exports[_0x62e7('0x3c')]=function(_0x1f485f,_0x314c9e){var _0x5c486f={'raw':![],'where':{'id':_0x1f485f[_0x62e7('0x3d')]['id']}},_0xbe2c25={};_0xbe2c25[_0x62e7('0x2d')]=_[_0x62e7('0x2a')](db[_0x62e7('0x26')]['rawAttributes']);_0xbe2c25[_0x62e7('0x29')]=_[_0x62e7('0x2a')](_0x1f485f[_0x62e7('0x29')]);_0xbe2c25[_0x62e7('0x2b')]=_[_0x62e7('0x2c')](_0xbe2c25[_0x62e7('0x2d')],_0xbe2c25[_0x62e7('0x29')]);_0x5c486f['attributes']=_['intersection'](_0xbe2c25[_0x62e7('0x2d')],qs['fields'](_0x1f485f[_0x62e7('0x29')][_0x62e7('0x3e')]));_0x5c486f[_0x62e7('0x2e')]=_0x5c486f[_0x62e7('0x2e')]['length']?_0x5c486f[_0x62e7('0x2e')]:_0xbe2c25[_0x62e7('0x2d')];if(_0x1f485f['query'][_0x62e7('0x3f')]){_0x5c486f[_0x62e7('0x40')]=[{'all':!![]}];}_0x5c486f=_[_0x62e7('0x37')]({},_0x5c486f,_0x1f485f[_0x62e7('0x38')]);return db[_0x62e7('0x26')][_0x62e7('0x41')](_0x5c486f)['then'](handleEntityNotFound(_0x314c9e,null))[_0x62e7('0x21')](respondWithResult(_0x314c9e,null))[_0x62e7('0x3b')](handleError(_0x314c9e,null));};exports[_0x62e7('0x42')]=function(_0x51e2c2,_0x411c42){return db[_0x62e7('0x26')][_0x62e7('0x42')](_0x51e2c2[_0x62e7('0x43')],{})[_0x62e7('0x21')](respondWithResult(_0x411c42,0xc9))[_0x62e7('0x3b')](handleError(_0x411c42,null));};exports[_0x62e7('0x20')]=function(_0x49df40,_0x323cab){if(_0x49df40[_0x62e7('0x43')]['id']){delete _0x49df40[_0x62e7('0x43')]['id'];}return db[_0x62e7('0x26')][_0x62e7('0x41')]({'where':{'id':_0x49df40[_0x62e7('0x3d')]['id']}})[_0x62e7('0x21')](handleEntityNotFound(_0x323cab,null))['then'](saveUpdates(_0x49df40[_0x62e7('0x43')],null))[_0x62e7('0x21')](respondWithResult(_0x323cab,null))[_0x62e7('0x3b')](handleError(_0x323cab,null));};exports['destroy']=function(_0x1b65f4,_0x324ddf){return db[_0x62e7('0x26')][_0x62e7('0x41')]({'where':{'id':_0x1b65f4[_0x62e7('0x3d')]['id']}})[_0x62e7('0x21')](handleEntityNotFound(_0x324ddf,null))[_0x62e7('0x21')](removeEntity(_0x324ddf,null))[_0x62e7('0x3b')](handleError(_0x324ddf,null));};exports[_0x62e7('0x44')]=function(_0x14959c,_0x415819,_0x3dba8a){var _0x378063={};var _0x1352fa={};var _0x43c715;var _0x1d27e5;return db[_0x62e7('0x26')][_0x62e7('0x45')]({'where':{'id':_0x14959c[_0x62e7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x415819,null))[_0x62e7('0x21')](function(_0x500dea){if(_0x500dea){_0x43c715=_0x500dea;_0x1352fa[_0x62e7('0x2d')]=_[_0x62e7('0x2a')](db[_0x62e7('0x46')][_0x62e7('0x47')]);_0x1352fa[_0x62e7('0x29')]=_['keys'](_0x14959c[_0x62e7('0x29')]);_0x1352fa[_0x62e7('0x2b')]=_['intersection'](_0x1352fa['model'],_0x1352fa[_0x62e7('0x29')]);_0x378063[_0x62e7('0x2e')]=_['intersection'](_0x1352fa[_0x62e7('0x2d')],qs[_0x62e7('0x3e')](_0x14959c[_0x62e7('0x29')][_0x62e7('0x3e')]));_0x378063[_0x62e7('0x2e')]=_0x378063[_0x62e7('0x2e')]['length']?_0x378063[_0x62e7('0x2e')]:_0x1352fa[_0x62e7('0x2d')];_0x378063['order']=qs[_0x62e7('0x32')](_0x14959c[_0x62e7('0x29')][_0x62e7('0x32')]);_0x378063['where']=qs[_0x62e7('0x2b')](_[_0x62e7('0x33')](_0x14959c['query'],_0x1352fa[_0x62e7('0x2b')]));if(_0x14959c[_0x62e7('0x29')]['filter']){_0x378063[_0x62e7('0x35')]=_[_0x62e7('0x37')](_0x378063['where'],{'$or':_['map'](_0x378063[_0x62e7('0x2e')],function(_0x3b1f6f){var _0x9e3e47={};_0x9e3e47[_0x3b1f6f]={'$like':'%'+_0x14959c[_0x62e7('0x29')]['filter']+'%'};return _0x9e3e47;})});}_0x378063=_[_0x62e7('0x37')]({},_0x378063,_0x14959c['options']);return _0x43c715[_0x62e7('0x44')](_0x378063);}})[_0x62e7('0x21')](function(_0x26c18f){if(_0x26c18f){_0x1d27e5=_0x26c18f[_0x62e7('0x48')];if(!_0x14959c[_0x62e7('0x29')][_0x62e7('0x2f')](_0x62e7('0x30'))){_0x378063[_0x62e7('0x1c')]=qs[_0x62e7('0x1c')](_0x14959c[_0x62e7('0x29')][_0x62e7('0x1c')]);_0x378063['offset']=qs[_0x62e7('0x19')](_0x14959c[_0x62e7('0x29')][_0x62e7('0x19')]);}return _0x43c715[_0x62e7('0x44')](_0x378063);}})['then'](function(_0x15ba90){if(_0x15ba90){return _0x15ba90?{'count':_0x1d27e5,'rows':_0x15ba90}:null;}})[_0x62e7('0x21')](respondWithResult(_0x415819,null))['catch'](handleError(_0x415819,null));};exports[_0x62e7('0x49')]=function(_0x158122,_0x4e91c7,_0x32ceb3){if(_0x158122[_0x62e7('0x43')]['id']){delete _0x158122[_0x62e7('0x43')]['id'];}return db[_0x62e7('0x26')]['findOne']({'where':{'id':_0x158122[_0x62e7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4e91c7,null))[_0x62e7('0x21')](function(_0x2e29eb){if(_0x2e29eb){_0x158122['body'][_0x62e7('0x4a')]=_0x2e29eb['id'];_0x158122[_0x62e7('0x43')]['Subjects']=integrations['getSubjects'](_0x158122[_0x62e7('0x43')][_0x62e7('0x4b')],_0x158122[_0x62e7('0x43')]['type']);_0x158122[_0x62e7('0x43')][_0x62e7('0x4c')]=integrations[_0x62e7('0x4d')](_0x158122[_0x62e7('0x43')]['channel'],_0x158122[_0x62e7('0x43')][_0x62e7('0x4e')]);return db[_0x62e7('0x46')][_0x62e7('0x42')](_0x158122[_0x62e7('0x43')],{'include':[{'model':db[_0x62e7('0x4f')],'as':'Subjects'},{'model':db[_0x62e7('0x4f')],'as':'Descriptions'}]});}return null;})[_0x62e7('0x21')](respondWithResult(_0x4e91c7,null))[_0x62e7('0x3b')](handleError(_0x4e91c7,null));};exports[_0x62e7('0x50')]=function(_0x3a6d74,_0x1546e8,_0x6ea681){var _0x26014c=[{'name':_0x62e7('0x51'),'label':_0x62e7('0x51'),'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 _0x331f54='';return db['DeskAccount'][_0x62e7('0x45')]({'where':{'id':_0x3a6d74['params']['id']},'attributes':['id',_0x62e7('0x52'),_0x62e7('0x53'),_0x62e7('0x54'),'password',_0x62e7('0x55'),_0x62e7('0x56'),_0x62e7('0x57'),_0x62e7('0x58')]})['then'](handleEntityNotFound(_0x1546e8,null))[_0x62e7('0x21')](function(_0x543b83){if(_0x543b83){_0x331f54=_0x543b83['remoteUri'];var _0x30e5fb=_0x331f54[_0x62e7('0x59')](-0x1);if(_0x30e5fb==='/'){_0x331f54=_0x331f54['substring'](0x0,_0x331f54[_0x62e7('0x5a')](_0x30e5fb));}var _0x693e0={'method':'GET','uri':util[_0x62e7('0x5b')](_0x62e7('0x5c'),_0x331f54),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x543b83[_0x62e7('0x53')]==='basic'){_0x693e0[_0x62e7('0x5d')]['Authorization']=util[_0x62e7('0x5b')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x543b83[_0x62e7('0x54')],_0x543b83[_0x62e7('0x5e')]))['toString'](_0x62e7('0x5f')));}return rp(_0x693e0)[_0x62e7('0x21')](function(_0x446e48){return _0x26014c['concat'](_['map'](_0x446e48[_0x62e7('0x60')]['entries'],function(_0x4fbb71){return{'id':_0x4fbb71[_0x62e7('0x61')],'name':_0x4fbb71[_0x62e7('0x61')],'type':_0x4fbb71[_0x62e7('0x4e')],'active':_0x4fbb71[_0x62e7('0x62')],'label':_0x4fbb71['label'],'custom':!![]};}));});}})[_0x62e7('0x21')](function(_0x489c88){return{'count':_0x489c88[_0x62e7('0x48')],'rows':_0x489c88};})[_0x62e7('0x21')](respondWithResult(_0x1546e8,null))[_0x62e7('0x3b')](function(_0x3f31bf){var _0x4d32ec=_0x3a6d74[_0x62e7('0x29')][_0x62e7('0x63')]?0x1f4:_0x3f31bf[_0x62e7('0x64')]||0x1f4;logger[_0x62e7('0x65')](_0x62e7('0x66'),'getFields',_0x4d32ec,JSON['stringify'](_0x3f31bf));delete _0x3f31bf[_0x62e7('0x61')];if(_0x4d32ec===0x191){_0x4d32ec=0x190;}_0x1546e8['status'](_0x4d32ec)[_0x62e7('0x67')](_0x3a6d74['query'][_0x62e7('0x63')]?{'message':_0x62e7('0x68'),'statusCode':_0x3f31bf['statusCode']}:_0x3f31bf);});}; \ No newline at end of file +var _0x5695=['show','options','find','create','body','params','getConfigurations','DeskConfiguration','rawAttributes','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','destroy','then','stack','name','index','map','DeskAccount','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x4490e8,_0x3fd1b2){var _0x41af10=function(_0x3c1cf2){while(--_0x3c1cf2){_0x4490e8['push'](_0x4490e8['shift']());}};_0x41af10(++_0x3fd1b2);}(_0x5695,0x9e));var _0x5569=function(_0x123f6c,_0x3e34bc){_0x123f6c=_0x123f6c-0x0;var _0x1a35d0=_0x5695[_0x123f6c];return _0x1a35d0;};'use strict';var emlformat=require(_0x5569('0x0'));var rimraf=require(_0x5569('0x1'));var zipdir=require(_0x5569('0x2'));var jsonpatch=require(_0x5569('0x3'));var rp=require(_0x5569('0x4'));var moment=require(_0x5569('0x5'));var BPromise=require(_0x5569('0x6'));var Mustache=require(_0x5569('0x7'));var util=require(_0x5569('0x8'));var path=require(_0x5569('0x9'));var sox=require(_0x5569('0xa'));var csv=require(_0x5569('0xb'));var ejs=require(_0x5569('0xc'));var fs=require('fs');var fs_extra=require(_0x5569('0xd'));var _=require('lodash');var squel=require(_0x5569('0xe'));var crypto=require(_0x5569('0xf'));var jsforce=require(_0x5569('0x10'));var deskjs=require(_0x5569('0x11'));var toCsv=require(_0x5569('0xb'));var querystring=require(_0x5569('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5569('0x13'));var qs=require(_0x5569('0x14'));var as=require(_0x5569('0x15'));var hardwareService=require(_0x5569('0x16'));var logger=require('../../config/logger')(_0x5569('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5569('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x333e24,_0x2479f5){_0x2479f5=_0x2479f5||0xcc;return function(_0x50f417){if(_0x50f417){return _0x333e24[_0x5569('0x19')](_0x2479f5);}return _0x333e24[_0x5569('0x1a')](_0x2479f5)[_0x5569('0x1b')]();};}function respondWithResult(_0xc8406d,_0x88165){_0x88165=_0x88165||0xc8;return function(_0x13238e){if(_0x13238e){return _0xc8406d[_0x5569('0x1a')](_0x88165)[_0x5569('0x1c')](_0x13238e);}};}function respondWithFilteredResult(_0x36cca4,_0x3d8320){return function(_0x14d045){if(_0x14d045){var _0x373cba=typeof _0x3d8320['offset']===_0x5569('0x1d')&&typeof _0x3d8320[_0x5569('0x1e')]===_0x5569('0x1d');var _0x34b805=_0x14d045[_0x5569('0x1f')];var _0x260f93=_0x373cba?0x0:_0x3d8320[_0x5569('0x20')];var _0xa42272=_0x373cba?_0x14d045[_0x5569('0x1f')]:_0x3d8320[_0x5569('0x20')]+_0x3d8320[_0x5569('0x1e')];var _0x1b2605;if(_0xa42272>=_0x34b805){_0xa42272=_0x34b805;_0x1b2605=0xc8;}else{_0x1b2605=0xce;}_0x36cca4['status'](_0x1b2605);return _0x36cca4[_0x5569('0x21')]('Content-Range',_0x260f93+'-'+_0xa42272+'/'+_0x34b805)['json'](_0x14d045);}return null;};}function patchUpdates(_0xdcc62f){return function(_0x1b9e22){try{jsonpatch[_0x5569('0x22')](_0x1b9e22,_0xdcc62f,!![]);}catch(_0x4d70d2){return BPromise['reject'](_0x4d70d2);}return _0x1b9e22[_0x5569('0x23')]();};}function saveUpdates(_0x3afa30,_0x6ff7db){return function(_0x5e6d23){if(_0x5e6d23){return _0x5e6d23[_0x5569('0x24')](_0x3afa30)['then'](function(_0x1cb1ef){return _0x1cb1ef;});}return null;};}function removeEntity(_0x344c72,_0x2768e3){return function(_0x3cb681){if(_0x3cb681){return _0x3cb681[_0x5569('0x25')]()[_0x5569('0x26')](function(){_0x344c72[_0x5569('0x1a')](0xcc)[_0x5569('0x1b')]();});}};}function handleEntityNotFound(_0x53afdf,_0x87feb2){return function(_0x1571b4){if(!_0x1571b4){_0x53afdf[_0x5569('0x19')](0x194);}return _0x1571b4;};}function handleError(_0x2fa875,_0xf6f489){_0xf6f489=_0xf6f489||0x1f4;return function(_0x46609a){logger['error'](_0x46609a[_0x5569('0x27')]);if(_0x46609a[_0x5569('0x28')]){delete _0x46609a[_0x5569('0x28')];}_0x2fa875[_0x5569('0x1a')](_0xf6f489)['send'](_0x46609a);};}exports[_0x5569('0x29')]=function(_0x1af25d,_0x44e666){var _0x11b152={},_0x210009={},_0x2ad263={'count':0x0,'rows':[]};var _0x4029e9=_[_0x5569('0x2a')](db[_0x5569('0x2b')]['rawAttributes'],function(_0x4efb46){return{'name':_0x4efb46['fieldName'],'type':_0x4efb46['type']['key']};});_0x210009[_0x5569('0x2c')]=_[_0x5569('0x2a')](_0x4029e9,_0x5569('0x28'));_0x210009[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x1af25d[_0x5569('0x2d')]);_0x210009[_0x5569('0x2f')]=_['intersection'](_0x210009[_0x5569('0x2c')],_0x210009[_0x5569('0x2d')]);_0x11b152[_0x5569('0x30')]=_[_0x5569('0x31')](_0x210009[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x1af25d[_0x5569('0x2d')][_0x5569('0x32')]));_0x11b152[_0x5569('0x30')]=_0x11b152[_0x5569('0x30')][_0x5569('0x33')]?_0x11b152['attributes']:_0x210009[_0x5569('0x2c')];if(!_0x1af25d[_0x5569('0x2d')][_0x5569('0x34')](_0x5569('0x35'))){_0x11b152[_0x5569('0x1e')]=qs[_0x5569('0x1e')](_0x1af25d['query']['limit']);_0x11b152[_0x5569('0x20')]=qs[_0x5569('0x20')](_0x1af25d[_0x5569('0x2d')][_0x5569('0x20')]);}_0x11b152[_0x5569('0x36')]=qs['sort'](_0x1af25d[_0x5569('0x2d')][_0x5569('0x37')]);_0x11b152[_0x5569('0x38')]=qs[_0x5569('0x2f')](_[_0x5569('0x39')](_0x1af25d[_0x5569('0x2d')],_0x210009[_0x5569('0x2f')]),_0x4029e9);if(_0x1af25d[_0x5569('0x2d')][_0x5569('0x3a')]){_0x11b152[_0x5569('0x38')]=_[_0x5569('0x3b')](_0x11b152[_0x5569('0x38')],{'$or':_[_0x5569('0x2a')](_0x4029e9,function(_0x19eeed){if(_0x19eeed['type']!==_0x5569('0x3c')){var _0x24b6a3={};_0x24b6a3[_0x19eeed['name']]={'$like':'%'+_0x1af25d[_0x5569('0x2d')]['filter']+'%'};return _0x24b6a3;}})});}_0x11b152=_['merge']({},_0x11b152,_0x1af25d['options']);var _0x35f7f6={'where':_0x11b152[_0x5569('0x38')]};return db[_0x5569('0x2b')]['count'](_0x35f7f6)[_0x5569('0x26')](function(_0x25141a){_0x2ad263['count']=_0x25141a;if(_0x1af25d['query'][_0x5569('0x3d')]){_0x11b152[_0x5569('0x3e')]=[{'all':!![]}];}return db[_0x5569('0x2b')][_0x5569('0x3f')](_0x11b152);})[_0x5569('0x26')](function(_0x13a9bb){_0x2ad263[_0x5569('0x40')]=_0x13a9bb;return _0x2ad263;})[_0x5569('0x26')](respondWithFilteredResult(_0x44e666,_0x11b152))[_0x5569('0x41')](handleError(_0x44e666,null));};exports[_0x5569('0x42')]=function(_0x768030,_0x5c2aeb){var _0x504b69={'raw':![],'where':{'id':_0x768030['params']['id']}},_0x1352cb={};_0x1352cb[_0x5569('0x2c')]=_[_0x5569('0x2e')](db[_0x5569('0x2b')]['rawAttributes']);_0x1352cb[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x768030['query']);_0x1352cb['filters']=_[_0x5569('0x31')](_0x1352cb['model'],_0x1352cb[_0x5569('0x2d')]);_0x504b69['attributes']=_[_0x5569('0x31')](_0x1352cb[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x768030[_0x5569('0x2d')][_0x5569('0x32')]));_0x504b69[_0x5569('0x30')]=_0x504b69['attributes'][_0x5569('0x33')]?_0x504b69[_0x5569('0x30')]:_0x1352cb[_0x5569('0x2c')];if(_0x768030[_0x5569('0x2d')][_0x5569('0x3d')]){_0x504b69[_0x5569('0x3e')]=[{'all':!![]}];}_0x504b69=_[_0x5569('0x3b')]({},_0x504b69,_0x768030[_0x5569('0x43')]);return db[_0x5569('0x2b')][_0x5569('0x44')](_0x504b69)['then'](handleEntityNotFound(_0x5c2aeb,null))['then'](respondWithResult(_0x5c2aeb,null))[_0x5569('0x41')](handleError(_0x5c2aeb,null));};exports['create']=function(_0x4fcda6,_0x2b8a78){return db['DeskAccount'][_0x5569('0x45')](_0x4fcda6[_0x5569('0x46')],{})['then'](respondWithResult(_0x2b8a78,0xc9))[_0x5569('0x41')](handleError(_0x2b8a78,null));};exports[_0x5569('0x24')]=function(_0x37cc3d,_0x44fc6e){if(_0x37cc3d[_0x5569('0x46')]['id']){delete _0x37cc3d[_0x5569('0x46')]['id'];}return db[_0x5569('0x2b')][_0x5569('0x44')]({'where':{'id':_0x37cc3d[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x44fc6e,null))['then'](saveUpdates(_0x37cc3d[_0x5569('0x46')],null))['then'](respondWithResult(_0x44fc6e,null))[_0x5569('0x41')](handleError(_0x44fc6e,null));};exports['destroy']=function(_0x2e0aab,_0x6bbb38){return db['DeskAccount'][_0x5569('0x44')]({'where':{'id':_0x2e0aab[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x6bbb38,null))['then'](removeEntity(_0x6bbb38,null))[_0x5569('0x41')](handleError(_0x6bbb38,null));};exports[_0x5569('0x48')]=function(_0x214745,_0x3b96a8,_0x114977){var _0x4979c5={};var _0x3efe3e={};var _0xbc3ec8;var _0x5e626f;return db[_0x5569('0x2b')]['findOne']({'where':{'id':_0x214745[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x3b96a8,null))[_0x5569('0x26')](function(_0x164876){if(_0x164876){_0xbc3ec8=_0x164876;_0x3efe3e[_0x5569('0x2c')]=_[_0x5569('0x2e')](db[_0x5569('0x49')][_0x5569('0x4a')]);_0x3efe3e[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x214745[_0x5569('0x2d')]);_0x3efe3e[_0x5569('0x2f')]=_[_0x5569('0x31')](_0x3efe3e['model'],_0x3efe3e[_0x5569('0x2d')]);_0x4979c5[_0x5569('0x30')]=_[_0x5569('0x31')](_0x3efe3e[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x214745[_0x5569('0x2d')]['fields']));_0x4979c5[_0x5569('0x30')]=_0x4979c5[_0x5569('0x30')]['length']?_0x4979c5[_0x5569('0x30')]:_0x3efe3e[_0x5569('0x2c')];_0x4979c5[_0x5569('0x36')]=qs[_0x5569('0x37')](_0x214745[_0x5569('0x2d')]['sort']);_0x4979c5[_0x5569('0x38')]=qs[_0x5569('0x2f')](_[_0x5569('0x39')](_0x214745[_0x5569('0x2d')],_0x3efe3e[_0x5569('0x2f')]));if(_0x214745[_0x5569('0x2d')][_0x5569('0x3a')]){_0x4979c5[_0x5569('0x38')]=_[_0x5569('0x3b')](_0x4979c5[_0x5569('0x38')],{'$or':_[_0x5569('0x2a')](_0x4979c5['attributes'],function(_0x443c63){var _0x3163a0={};_0x3163a0[_0x443c63]={'$like':'%'+_0x214745[_0x5569('0x2d')][_0x5569('0x3a')]+'%'};return _0x3163a0;})});}_0x4979c5=_[_0x5569('0x3b')]({},_0x4979c5,_0x214745['options']);return _0xbc3ec8[_0x5569('0x48')](_0x4979c5);}})[_0x5569('0x26')](function(_0x3ef7c0){if(_0x3ef7c0){_0x5e626f=_0x3ef7c0[_0x5569('0x33')];if(!_0x214745[_0x5569('0x2d')]['hasOwnProperty'](_0x5569('0x35'))){_0x4979c5[_0x5569('0x1e')]=qs[_0x5569('0x1e')](_0x214745['query'][_0x5569('0x1e')]);_0x4979c5[_0x5569('0x20')]=qs[_0x5569('0x20')](_0x214745[_0x5569('0x2d')][_0x5569('0x20')]);}return _0xbc3ec8['getConfigurations'](_0x4979c5);}})[_0x5569('0x26')](function(_0x12ff0e){if(_0x12ff0e){return _0x12ff0e?{'count':_0x5e626f,'rows':_0x12ff0e}:null;}})['then'](respondWithResult(_0x3b96a8,null))['catch'](handleError(_0x3b96a8,null));};exports[_0x5569('0x4b')]=function(_0xef638c,_0x5861fb,_0x4743cb){if(_0xef638c['body']['id']){delete _0xef638c[_0x5569('0x46')]['id'];}return db['DeskAccount'][_0x5569('0x4c')]({'where':{'id':_0xef638c[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x5861fb,null))['then'](function(_0x26874d){if(_0x26874d){_0xef638c[_0x5569('0x46')][_0x5569('0x4d')]=_0x26874d['id'];_0xef638c['body'][_0x5569('0x4e')]=integrations['getSubjects'](_0xef638c[_0x5569('0x46')][_0x5569('0x4f')],_0xef638c[_0x5569('0x46')][_0x5569('0x50')]);_0xef638c[_0x5569('0x46')][_0x5569('0x51')]=integrations[_0x5569('0x52')](_0xef638c[_0x5569('0x46')][_0x5569('0x4f')],_0xef638c[_0x5569('0x46')]['type']);return db[_0x5569('0x49')]['create'](_0xef638c[_0x5569('0x46')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x5569('0x53')],'as':_0x5569('0x51')}]});}return null;})[_0x5569('0x26')](respondWithResult(_0x5861fb,null))[_0x5569('0x41')](handleError(_0x5861fb,null));};exports[_0x5569('0x54')]=function(_0x1320b0,_0xe9721c,_0x46cb3e){var _0x5aba39=[{'name':_0x5569('0x55'),'label':_0x5569('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x35efbf='';return db[_0x5569('0x2b')][_0x5569('0x4c')]({'where':{'id':_0x1320b0[_0x5569('0x47')]['id']},'attributes':['id',_0x5569('0x56'),_0x5569('0x57'),_0x5569('0x58'),_0x5569('0x59'),_0x5569('0x5a'),_0x5569('0x5b'),_0x5569('0x5c'),_0x5569('0x5d')]})[_0x5569('0x26')](handleEntityNotFound(_0xe9721c,null))[_0x5569('0x26')](function(_0x4d3b28){if(_0x4d3b28){_0x35efbf=_0x4d3b28[_0x5569('0x56')];var _0x487adc=_0x35efbf['slice'](-0x1);if(_0x487adc==='/'){_0x35efbf=_0x35efbf['substring'](0x0,_0x35efbf['lastIndexOf'](_0x487adc));}var _0x46d014={'method':_0x5569('0x5e'),'uri':util[_0x5569('0x5f')](_0x5569('0x60'),_0x35efbf),'headers':{'Content-Type':_0x5569('0x61'),'Accept':_0x5569('0x61')},'json':!![]};if(_0x4d3b28[_0x5569('0x57')]==='basic'){_0x46d014['headers'][_0x5569('0x62')]=util['format'](_0x5569('0x63'),new Buffer(util[_0x5569('0x5f')](_0x5569('0x64'),_0x4d3b28[_0x5569('0x58')],_0x4d3b28[_0x5569('0x59')]))[_0x5569('0x65')](_0x5569('0x66')));}return rp(_0x46d014)[_0x5569('0x26')](function(_0x4a9645){return _0x5aba39[_0x5569('0x67')](_[_0x5569('0x2a')](_0x4a9645['_embedded'][_0x5569('0x68')],function(_0x58b9fb){return{'id':_0x58b9fb[_0x5569('0x28')],'name':_0x58b9fb[_0x5569('0x28')],'type':_0x58b9fb[_0x5569('0x50')],'active':_0x58b9fb[_0x5569('0x69')],'label':_0x58b9fb[_0x5569('0x6a')],'custom':!![]};}));});}})[_0x5569('0x26')](function(_0x4767e7){return{'count':_0x4767e7[_0x5569('0x33')],'rows':_0x4767e7};})[_0x5569('0x26')](respondWithResult(_0xe9721c,null))['catch'](function(_0x33d77e){var _0x10207d=_0x1320b0[_0x5569('0x2d')][_0x5569('0x6b')]?0x1f4:_0x33d77e[_0x5569('0x6c')]||0x1f4;logger[_0x5569('0x6d')](_0x5569('0x6e'),_0x5569('0x54'),_0x10207d,JSON['stringify'](_0x33d77e));delete _0x33d77e[_0x5569('0x28')];if(_0x10207d===0x191){_0x10207d=0x190;}_0xe9721c['status'](_0x10207d)[_0x5569('0x6f')](_0x1320b0[_0x5569('0x2d')][_0x5569('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x33d77e['statusCode']}:_0x33d77e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d4b89f7..3915499 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 _0xa84d=['api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x1445a2,_0xfb62c0){var _0x5975ce=function(_0xa2f5f4){while(--_0xa2f5f4){_0x1445a2['push'](_0x1445a2['shift']());}};_0x5975ce(++_0xfb62c0);}(_0xa84d,0xe1));var _0xda84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa84d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xda84('0x0'));var util=require(_0xda84('0x1'));var logger=require(_0xda84('0x2'))(_0xda84('0x3'));var moment=require(_0xda84('0x4'));var BPromise=require(_0xda84('0x5'));var rp=require(_0xda84('0x6'));var fs=require('fs');var path=require(_0xda84('0x7'));var rimraf=require(_0xda84('0x8'));var config=require('../../config/environment');var attributes=require(_0xda84('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xe0d632,_0xc39380){return _0xe0d632['define'](_0xda84('0xa'),attributes,{'tableName':_0xda84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc15c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xc15c,0x110));var _0xcc15=function(_0x54e5ae,_0x371b98){_0x54e5ae=_0x54e5ae-0x0;var _0x4f60db=_0xc15c[_0x54e5ae];return _0x4f60db;};'use strict';var _=require('lodash');var util=require(_0xcc15('0x0'));var logger=require(_0xcc15('0x1'))(_0xcc15('0x2'));var moment=require(_0xcc15('0x3'));var BPromise=require(_0xcc15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc15('0x5'));var rimraf=require(_0xcc15('0x6'));var config=require(_0xcc15('0x7'));var attributes=require(_0xcc15('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xcc15('0x9')]=function(_0x2ea668,_0x474d25){return _0x2ea668[_0xcc15('0xa')](_0xcc15('0xb'),attributes,{'tableName':_0xcc15('0xc'),'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 510b53a..f121e5b 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 _0xaee9=['map','model','ShowDeskAccount','DeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDeskAccount','findAll','options','raw','attributes','limit','include'];(function(_0x49c3b6,_0x56af4a){var _0x1b3250=function(_0x5e8094){while(--_0x5e8094){_0x49c3b6['push'](_0x49c3b6['shift']());}};_0x1b3250(++_0x56af4a);}(_0xaee9,0x1e7));var _0x9aee=function(_0x254ff9,_0x5802fa){_0x254ff9=_0x254ff9-0x0;var _0x2964c4=_0xaee9[_0x254ff9];return _0x2964c4;};'use strict';var _=require(_0x9aee('0x0'));var util=require(_0x9aee('0x1'));var moment=require(_0x9aee('0x2'));var BPromise=require(_0x9aee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aee('0x4'));var db=require(_0x9aee('0x5'))['db'];var utils=require(_0x9aee('0x6'));var logger=require('../../config/logger')(_0x9aee('0x7'));var config=require(_0x9aee('0x8'));var jayson=require(_0x9aee('0x9'));var client=jayson[_0x9aee('0xa')][_0x9aee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x530de4,_0x306b36,_0x54929c){return new BPromise(function(_0xf840a3,_0x39dde9){return client[_0x9aee('0xc')](_0x530de4,_0x54929c)[_0x9aee('0xd')](function(_0x3865e0){logger[_0x9aee('0xe')](_0x9aee('0xf'),_0x306b36,_0x9aee('0x10'));logger[_0x9aee('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x306b36,'request\x20sent',JSON[_0x9aee('0x12')](_0x3865e0));if(_0x3865e0[_0x9aee('0x13')]){if(_0x3865e0['error'][_0x9aee('0x14')]===0x1f4){logger[_0x9aee('0x13')](_0x9aee('0xf'),_0x306b36,_0x3865e0[_0x9aee('0x13')][_0x9aee('0x15')]);return _0x39dde9(_0x3865e0[_0x9aee('0x13')][_0x9aee('0x15')]);}logger[_0x9aee('0x13')](_0x9aee('0xf'),_0x306b36,_0x3865e0['error'][_0x9aee('0x15')]);return _0xf840a3(_0x3865e0[_0x9aee('0x13')]['message']);}else{logger['info'](_0x9aee('0xf'),_0x306b36,_0x9aee('0x10'));_0xf840a3(_0x3865e0[_0x9aee('0x16')][_0x9aee('0x15')]);}})[_0x9aee('0x17')](function(_0x6abfbf){logger[_0x9aee('0x13')]('DeskAccount,\x20%s,\x20%s',_0x306b36,_0x6abfbf);_0x39dde9(_0x6abfbf);});});}exports[_0x9aee('0x18')]=function(_0x1ef5fe){var _0x2157fb=this;return new Promise(function(_0x1256d7,_0x49fa85){return db['DeskAccount'][_0x9aee('0x19')]({'raw':_0x1ef5fe[_0x9aee('0x1a')]?_0x1ef5fe['options'][_0x9aee('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ef5fe[_0x9aee('0x1a')]?_0x1ef5fe[_0x9aee('0x1a')]['where']||null:null,'attributes':_0x1ef5fe[_0x9aee('0x1a')]?_0x1ef5fe[_0x9aee('0x1a')][_0x9aee('0x1c')]||null:null,'limit':_0x1ef5fe[_0x9aee('0x1a')]?_0x1ef5fe[_0x9aee('0x1a')][_0x9aee('0x1d')]||null:null,'include':_0x1ef5fe['options']?_0x1ef5fe[_0x9aee('0x1a')][_0x9aee('0x1e')]?_[_0x9aee('0x1f')](_0x1ef5fe[_0x9aee('0x1a')][_0x9aee('0x1e')],function(_0x233d2a){return{'model':db[_0x233d2a[_0x9aee('0x20')]],'as':_0x233d2a['as'],'attributes':_0x233d2a['attributes'],'include':_0x233d2a[_0x9aee('0x1e')]?_[_0x9aee('0x1f')](_0x233d2a[_0x9aee('0x1e')],function(_0x381903){return{'model':db[_0x381903[_0x9aee('0x20')]],'as':_0x381903['as'],'attributes':_0x381903[_0x9aee('0x1c')],'include':_0x381903[_0x9aee('0x1e')]?_['map'](_0x381903[_0x9aee('0x1e')],function(_0x3ccc65){return{'model':db[_0x3ccc65[_0x9aee('0x20')]],'as':_0x3ccc65['as'],'attributes':_0x3ccc65[_0x9aee('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b42d1){logger[_0x9aee('0xe')](_0x9aee('0x18'),_0x1ef5fe);logger['debug'](_0x9aee('0x18'),_0x1ef5fe,JSON[_0x9aee('0x12')](_0x5b42d1));_0x1256d7(_0x5b42d1);})[_0x9aee('0x17')](function(_0x372f5d){logger[_0x9aee('0x13')](_0x9aee('0x18'),_0x372f5d[_0x9aee('0x15')],_0x1ef5fe);_0x49fa85(_0x2157fb['error'](0x1f4,_0x372f5d[_0x9aee('0x15')]));});});};exports[_0x9aee('0x21')]=function(_0x308cc8){var _0x5e632e=this;return new Promise(function(_0x4de576,_0x474698){return db[_0x9aee('0x22')][_0x9aee('0x23')]({'raw':_0x308cc8['options']?_0x308cc8[_0x9aee('0x1a')][_0x9aee('0x1b')]===undefined?!![]:![]:!![],'where':_0x308cc8['options']?_0x308cc8[_0x9aee('0x1a')][_0x9aee('0x24')]||null:null,'attributes':_0x308cc8[_0x9aee('0x1a')]?_0x308cc8['options'][_0x9aee('0x1c')]||null:null,'include':_0x308cc8[_0x9aee('0x1a')]?_0x308cc8[_0x9aee('0x1a')]['include']?_[_0x9aee('0x1f')](_0x308cc8[_0x9aee('0x1a')][_0x9aee('0x1e')],function(_0x54930d){return{'model':db[_0x54930d[_0x9aee('0x20')]],'as':_0x54930d['as'],'attributes':_0x54930d[_0x9aee('0x1c')],'include':_0x54930d[_0x9aee('0x1e')]?_[_0x9aee('0x1f')](_0x54930d['include'],function(_0x29bc94){return{'model':db[_0x29bc94[_0x9aee('0x20')]],'as':_0x29bc94['as'],'attributes':_0x29bc94[_0x9aee('0x1c')],'include':_0x29bc94['include']?_[_0x9aee('0x1f')](_0x29bc94['include'],function(_0x309ef0){return{'model':db[_0x309ef0[_0x9aee('0x20')]],'as':_0x309ef0['as'],'attributes':_0x309ef0[_0x9aee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9aee('0xd')](function(_0x119722){logger[_0x9aee('0xe')](_0x9aee('0x21'),_0x308cc8);logger[_0x9aee('0x11')]('ShowDeskAccount',_0x308cc8,JSON['stringify'](_0x119722));_0x4de576(_0x119722);})[_0x9aee('0x17')](function(_0xcfb0fb){logger[_0x9aee('0x13')]('ShowDeskAccount',_0xcfb0fb[_0x9aee('0x15')],_0x308cc8);_0x474698(_0x5e632e[_0x9aee('0x13')](0x1f4,_0xcfb0fb[_0x9aee('0x15')]));});});}; \ No newline at end of file +var _0x7ef4=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s'];(function(_0x1385d9,_0x44d41a){var _0x4e1c1e=function(_0xe9cf16){while(--_0xe9cf16){_0x1385d9['push'](_0x1385d9['shift']());}};_0x4e1c1e(++_0x44d41a);}(_0x7ef4,0xe1));var _0x47ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7ef4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x47ef('0x0'));var util=require(_0x47ef('0x1'));var moment=require(_0x47ef('0x2'));var BPromise=require('bluebird');var rs=require(_0x47ef('0x3'));var fs=require('fs');var Redis=require(_0x47ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47ef('0x5'));var logger=require('../../config/logger')(_0x47ef('0x6'));var config=require('../../config/environment');var jayson=require(_0x47ef('0x7'));var client=jayson['client'][_0x47ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6e5ae8,_0xd1ab0a,_0x4bf1eb){return new BPromise(function(_0x481660,_0x5cff5f){return client[_0x47ef('0x9')](_0x6e5ae8,_0x4bf1eb)[_0x47ef('0xa')](function(_0x316d9e){logger[_0x47ef('0xb')](_0x47ef('0xc'),_0xd1ab0a,'request\x20sent');logger[_0x47ef('0xd')](_0x47ef('0xe'),_0xd1ab0a,_0x47ef('0xf'),JSON[_0x47ef('0x10')](_0x316d9e));if(_0x316d9e[_0x47ef('0x11')]){if(_0x316d9e[_0x47ef('0x11')]['code']===0x1f4){logger[_0x47ef('0x11')](_0x47ef('0xc'),_0xd1ab0a,_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);return _0x5cff5f(_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);}logger[_0x47ef('0x11')](_0x47ef('0xc'),_0xd1ab0a,_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);return _0x481660(_0x316d9e['error'][_0x47ef('0x12')]);}else{logger['info'](_0x47ef('0xc'),_0xd1ab0a,_0x47ef('0xf'));_0x481660(_0x316d9e[_0x47ef('0x13')][_0x47ef('0x12')]);}})[_0x47ef('0x14')](function(_0x32e07f){logger[_0x47ef('0x11')]('DeskAccount,\x20%s,\x20%s',_0xd1ab0a,_0x32e07f);_0x5cff5f(_0x32e07f);});});}exports['GetDeskAccount']=function(_0x465bec){var _0x5406a3=this;return new Promise(function(_0x3d3043,_0x2dc891){return db[_0x47ef('0x15')][_0x47ef('0x16')]({'raw':_0x465bec[_0x47ef('0x17')]?_0x465bec[_0x47ef('0x17')][_0x47ef('0x18')]===undefined?!![]:![]:!![],'where':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x19')]||null:null,'attributes':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x1a')]||null:null,'limit':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x1b')]||null:null,'include':_0x465bec[_0x47ef('0x17')]?_0x465bec['options'][_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x465bec[_0x47ef('0x17')]['include'],function(_0x102e9a){return{'model':db[_0x102e9a[_0x47ef('0x1e')]],'as':_0x102e9a['as'],'attributes':_0x102e9a[_0x47ef('0x1a')],'include':_0x102e9a[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x102e9a['include'],function(_0x4c4b06){return{'model':db[_0x4c4b06[_0x47ef('0x1e')]],'as':_0x4c4b06['as'],'attributes':_0x4c4b06[_0x47ef('0x1a')],'include':_0x4c4b06[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x4c4b06['include'],function(_0x43ee40){return{'model':db[_0x43ee40[_0x47ef('0x1e')]],'as':_0x43ee40['as'],'attributes':_0x43ee40[_0x47ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47ef('0xa')](function(_0x34424f){logger[_0x47ef('0xb')](_0x47ef('0x1f'),_0x465bec);logger['debug'](_0x47ef('0x1f'),_0x465bec,JSON[_0x47ef('0x10')](_0x34424f));_0x3d3043(_0x34424f);})[_0x47ef('0x14')](function(_0x30fec9){logger['error']('GetDeskAccount',_0x30fec9[_0x47ef('0x12')],_0x465bec);_0x2dc891(_0x5406a3[_0x47ef('0x11')](0x1f4,_0x30fec9['message']));});});};exports[_0x47ef('0x20')]=function(_0x1780c4){var _0x47d25a=this;return new Promise(function(_0x2fdc2a,_0x58f28f){return db[_0x47ef('0x15')][_0x47ef('0x21')]({'raw':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')][_0x47ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1780c4['options']?_0x1780c4['options'][_0x47ef('0x19')]||null:null,'attributes':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')]['attributes']||null:null,'include':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')][_0x47ef('0x1c')]?_['map'](_0x1780c4['options'][_0x47ef('0x1c')],function(_0x38f764){return{'model':db[_0x38f764[_0x47ef('0x1e')]],'as':_0x38f764['as'],'attributes':_0x38f764['attributes'],'include':_0x38f764[_0x47ef('0x1c')]?_['map'](_0x38f764[_0x47ef('0x1c')],function(_0x50e27d){return{'model':db[_0x50e27d[_0x47ef('0x1e')]],'as':_0x50e27d['as'],'attributes':_0x50e27d['attributes'],'include':_0x50e27d[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x50e27d[_0x47ef('0x1c')],function(_0x9b54e1){return{'model':db[_0x9b54e1[_0x47ef('0x1e')]],'as':_0x9b54e1['as'],'attributes':_0x9b54e1[_0x47ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47ef('0xa')](function(_0x50da3d){logger[_0x47ef('0xb')](_0x47ef('0x20'),_0x1780c4);logger[_0x47ef('0xd')](_0x47ef('0x20'),_0x1780c4,JSON[_0x47ef('0x10')](_0x50da3d));_0x2fdc2a(_0x50da3d);})[_0x47ef('0x14')](function(_0x538d90){logger[_0x47ef('0x11')]('ShowDeskAccount',_0x538d90['message'],_0x1780c4);_0x58f28f(_0x47d25a[_0x47ef('0x11')](0x1f4,_0x538d90['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bfb45b4..75880cd 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 _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(_0x279fec,_0x3f3c6c){var _0x25b71f=function(_0x2df458){while(--_0x2df458){_0x279fec['push'](_0x279fec['shift']());}};_0x25b71f(++_0x3f3c6c);}(_0xedd9,0xfc));var _0x9edd=function(_0x28e6c4,_0x327488){_0x28e6c4=_0x28e6c4-0x0;var _0x4aa527=_0xedd9[_0x28e6c4];return _0x4aa527;};'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 +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x49b4b1,_0x2b38c1){var _0x51bd88=function(_0x1beede){while(--_0x1beede){_0x49b4b1['push'](_0x49b4b1['shift']());}};_0x51bd88(++_0x2b38c1);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 525dc66..ba80d9b 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 _0x7b9b=['sequelize','exports','STRING'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7b9b,0x1bf));var _0xb7b9=function(_0x14ffee,_0x3d3e6c){_0x14ffee=_0x14ffee-0x0;var _0x433179=_0x7b9b[_0x14ffee];return _0x433179;};'use strict';var Sequelize=require(_0xb7b9('0x0'));module[_0xb7b9('0x1')]={'name':{'type':Sequelize[_0xb7b9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4df7=['exports','STRING','sequelize'];(function(_0x441221,_0x6fa798){var _0x3b9fe7=function(_0x1defd5){while(--_0x1defd5){_0x441221['push'](_0x441221['shift']());}};_0x3b9fe7(++_0x6fa798);}(_0x4df7,0x107));var _0x74df=function(_0x3751cb,_0x5bddef){_0x3751cb=_0x3751cb-0x0;var _0x1d1f83=_0x4df7[_0x3751cb];return _0x1d1f83;};'use strict';var Sequelize=require(_0x74df('0x0'));module[_0x74df('0x1')]={'name':{'type':Sequelize[_0x74df('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index d495348..90b94c4 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 _0x0229=['findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','DeskField','filter','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','DeskConfiguration','includeAll','include'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0229,0x68));var _0x9022=function(_0x483245,_0x1a48ff){_0x483245=_0x483245-0x0;var _0x2b45fe=_0x0229[_0x483245];return _0x2b45fe;};'use strict';var emlformat=require(_0x9022('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9022('0x1'));var jsonpatch=require(_0x9022('0x2'));var rp=require(_0x9022('0x3'));var moment=require(_0x9022('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9022('0x5'));var util=require(_0x9022('0x6'));var path=require(_0x9022('0x7'));var sox=require(_0x9022('0x8'));var csv=require(_0x9022('0x9'));var ejs=require(_0x9022('0xa'));var fs=require('fs');var fs_extra=require(_0x9022('0xb'));var _=require(_0x9022('0xc'));var squel=require(_0x9022('0xd'));var crypto=require(_0x9022('0xe'));var jsforce=require(_0x9022('0xf'));var deskjs=require(_0x9022('0x10'));var toCsv=require(_0x9022('0x9'));var querystring=require('querystring');var Papa=require(_0x9022('0x11'));var Redis=require(_0x9022('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9022('0x13'));var as=require(_0x9022('0x14'));var hardwareService=require(_0x9022('0x15'));var logger=require(_0x9022('0x16'))(_0x9022('0x17'));var utils=require(_0x9022('0x18'));var config=require(_0x9022('0x19'));var licenseUtil=require(_0x9022('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ed6e5,_0xecd7d){_0xecd7d=_0xecd7d||0xcc;return function(_0x3be690){if(_0x3be690){return _0x3ed6e5['sendStatus'](_0xecd7d);}return _0x3ed6e5[_0x9022('0x1b')](_0xecd7d)[_0x9022('0x1c')]();};}function respondWithResult(_0x2e1984,_0x42d48f){_0x42d48f=_0x42d48f||0xc8;return function(_0x51d837){if(_0x51d837){return _0x2e1984[_0x9022('0x1b')](_0x42d48f)[_0x9022('0x1d')](_0x51d837);}};}function respondWithFilteredResult(_0x301bdd,_0x4eab1b){return function(_0x3466e3){if(_0x3466e3){var _0x5ed1fb=typeof _0x4eab1b[_0x9022('0x1e')]===_0x9022('0x1f')&&typeof _0x4eab1b[_0x9022('0x20')]===_0x9022('0x1f');var _0x3f1cda=_0x3466e3[_0x9022('0x21')];var _0x1c34e2=_0x5ed1fb?0x0:_0x4eab1b[_0x9022('0x1e')];var _0x29fd68=_0x5ed1fb?_0x3466e3[_0x9022('0x21')]:_0x4eab1b[_0x9022('0x1e')]+_0x4eab1b[_0x9022('0x20')];var _0x3cf55a;if(_0x29fd68>=_0x3f1cda){_0x29fd68=_0x3f1cda;_0x3cf55a=0xc8;}else{_0x3cf55a=0xce;}_0x301bdd[_0x9022('0x1b')](_0x3cf55a);return _0x301bdd[_0x9022('0x22')](_0x9022('0x23'),_0x1c34e2+'-'+_0x29fd68+'/'+_0x3f1cda)['json'](_0x3466e3);}return null;};}function patchUpdates(_0x49e31b){return function(_0x16d93b){try{jsonpatch[_0x9022('0x24')](_0x16d93b,_0x49e31b,!![]);}catch(_0x2363f3){return BPromise[_0x9022('0x25')](_0x2363f3);}return _0x16d93b[_0x9022('0x26')]();};}function saveUpdates(_0xcc024a,_0x3aa630){return function(_0x50c8c0){if(_0x50c8c0){return _0x50c8c0[_0x9022('0x27')](_0xcc024a)[_0x9022('0x28')](function(_0x503618){return _0x503618;});}return null;};}function removeEntity(_0x1b4985,_0x40e0c4){return function(_0x11f31b){if(_0x11f31b){return _0x11f31b['destroy']()[_0x9022('0x28')](function(){_0x1b4985[_0x9022('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59627b,_0x57ed0b){return function(_0x278566){if(!_0x278566){_0x59627b[_0x9022('0x29')](0x194);}return _0x278566;};}function handleError(_0x49f5,_0x468c8e){_0x468c8e=_0x468c8e||0x1f4;return function(_0xbb075e){logger['error'](_0xbb075e['stack']);if(_0xbb075e[_0x9022('0x2a')]){delete _0xbb075e[_0x9022('0x2a')];}_0x49f5[_0x9022('0x1b')](_0x468c8e)[_0x9022('0x2b')](_0xbb075e);};}exports[_0x9022('0x2c')]=function(_0x55ae9b,_0x5b8f90){var _0x21df0f={},_0x2f7753={},_0x299f7a={'count':0x0,'rows':[]};var _0x426231=_[_0x9022('0x2d')](db['DeskConfiguration'][_0x9022('0x2e')],function(_0x123608){return{'name':_0x123608[_0x9022('0x2f')],'type':_0x123608['type']['key']};});_0x2f7753['model']=_[_0x9022('0x2d')](_0x426231,_0x9022('0x2a'));_0x2f7753[_0x9022('0x30')]=_[_0x9022('0x31')](_0x55ae9b[_0x9022('0x30')]);_0x2f7753[_0x9022('0x32')]=_['intersection'](_0x2f7753[_0x9022('0x33')],_0x2f7753[_0x9022('0x30')]);_0x21df0f[_0x9022('0x34')]=_[_0x9022('0x35')](_0x2f7753[_0x9022('0x33')],qs[_0x9022('0x36')](_0x55ae9b[_0x9022('0x30')][_0x9022('0x36')]));_0x21df0f[_0x9022('0x34')]=_0x21df0f['attributes'][_0x9022('0x37')]?_0x21df0f[_0x9022('0x34')]:_0x2f7753['model'];if(!_0x55ae9b['query'][_0x9022('0x38')](_0x9022('0x39'))){_0x21df0f[_0x9022('0x20')]=qs[_0x9022('0x20')](_0x55ae9b[_0x9022('0x30')][_0x9022('0x20')]);_0x21df0f[_0x9022('0x1e')]=qs['offset'](_0x55ae9b[_0x9022('0x30')]['offset']);}_0x21df0f[_0x9022('0x3a')]=qs[_0x9022('0x3b')](_0x55ae9b[_0x9022('0x30')][_0x9022('0x3b')]);_0x21df0f[_0x9022('0x3c')]=qs[_0x9022('0x32')](_[_0x9022('0x3d')](_0x55ae9b['query'],_0x2f7753[_0x9022('0x32')]),_0x426231);if(_0x55ae9b[_0x9022('0x30')]['filter']){_0x21df0f['where']=_[_0x9022('0x3e')](_0x21df0f[_0x9022('0x3c')],{'$or':_[_0x9022('0x2d')](_0x426231,function(_0x1cb98a){if(_0x1cb98a['type']!==_0x9022('0x3f')){var _0x12f009={};_0x12f009[_0x1cb98a[_0x9022('0x2a')]]={'$like':'%'+_0x55ae9b['query']['filter']+'%'};return _0x12f009;}})});}_0x21df0f=_['merge']({},_0x21df0f,_0x55ae9b[_0x9022('0x40')]);var _0x582ccb={'where':_0x21df0f[_0x9022('0x3c')]};return db[_0x9022('0x41')][_0x9022('0x21')](_0x582ccb)[_0x9022('0x28')](function(_0x443eff){_0x299f7a['count']=_0x443eff;if(_0x55ae9b[_0x9022('0x30')][_0x9022('0x42')]){_0x21df0f[_0x9022('0x43')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x9022('0x44')](_0x21df0f);})[_0x9022('0x28')](function(_0x11eaea){_0x299f7a[_0x9022('0x45')]=_0x11eaea;return _0x299f7a;})[_0x9022('0x28')](respondWithFilteredResult(_0x5b8f90,_0x21df0f))[_0x9022('0x46')](handleError(_0x5b8f90,null));};exports[_0x9022('0x47')]=function(_0x453f67,_0x4575c0){var _0x5826e4={'raw':![],'where':{'id':_0x453f67[_0x9022('0x48')]['id']}},_0x1c8125={};_0x1c8125['model']=_['keys'](db[_0x9022('0x41')][_0x9022('0x2e')]);_0x1c8125[_0x9022('0x30')]=_[_0x9022('0x31')](_0x453f67[_0x9022('0x30')]);_0x1c8125[_0x9022('0x32')]=_['intersection'](_0x1c8125['model'],_0x1c8125['query']);_0x5826e4[_0x9022('0x34')]=_[_0x9022('0x35')](_0x1c8125[_0x9022('0x33')],qs[_0x9022('0x36')](_0x453f67[_0x9022('0x30')][_0x9022('0x36')]));_0x5826e4['attributes']=_0x5826e4['attributes'][_0x9022('0x37')]?_0x5826e4[_0x9022('0x34')]:_0x1c8125[_0x9022('0x33')];if(_0x453f67['query'][_0x9022('0x42')]){_0x5826e4[_0x9022('0x43')]=[{'all':!![]}];}_0x5826e4=_[_0x9022('0x3e')]({},_0x5826e4,_0x453f67['options']);return db[_0x9022('0x41')][_0x9022('0x49')](_0x5826e4)[_0x9022('0x28')](handleEntityNotFound(_0x4575c0,null))['then'](respondWithResult(_0x4575c0,null))['catch'](handleError(_0x4575c0,null));};exports[_0x9022('0x4a')]=function(_0x44b392,_0x174fe6){return db[_0x9022('0x41')]['create'](_0x44b392['body'],{})['then'](respondWithResult(_0x174fe6,0xc9))['catch'](handleError(_0x174fe6,null));};exports[_0x9022('0x27')]=function(_0x5967ba,_0x37c176){if(_0x5967ba[_0x9022('0x4b')]['id']){delete _0x5967ba['body']['id'];}return db[_0x9022('0x41')][_0x9022('0x49')]({'where':{'id':_0x5967ba['params']['id']}})['then'](handleEntityNotFound(_0x37c176,null))['then'](saveUpdates(_0x5967ba[_0x9022('0x4b')],null))['then'](respondWithResult(_0x37c176,null))['catch'](handleError(_0x37c176,null));};exports[_0x9022('0x4c')]=function(_0xc56619,_0x1f4136){return db[_0x9022('0x41')][_0x9022('0x49')]({'where':{'id':_0xc56619[_0x9022('0x48')]['id']}})[_0x9022('0x28')](handleEntityNotFound(_0x1f4136,null))['then'](removeEntity(_0x1f4136,null))[_0x9022('0x46')](handleError(_0x1f4136,null));};exports[_0x9022('0x4d')]=function(_0x5203d3,_0x44ab4b,_0x57e246){var _0x5cc485={};var _0x5242ad={};var _0x1bc124;var _0x161e92;return db[_0x9022('0x41')][_0x9022('0x4e')]({'where':{'id':_0x5203d3[_0x9022('0x48')]['id']}})[_0x9022('0x28')](handleEntityNotFound(_0x44ab4b,null))['then'](function(_0x2fe208){if(_0x2fe208){_0x1bc124=_0x2fe208;_0x5242ad[_0x9022('0x33')]=_['keys'](db[_0x9022('0x4f')][_0x9022('0x2e')]);_0x5242ad['query']=_[_0x9022('0x31')](_0x5203d3[_0x9022('0x30')]);_0x5242ad['filters']=_[_0x9022('0x35')](_0x5242ad[_0x9022('0x33')],_0x5242ad[_0x9022('0x30')]);_0x5cc485['attributes']=_[_0x9022('0x35')](_0x5242ad['model'],qs[_0x9022('0x36')](_0x5203d3[_0x9022('0x30')][_0x9022('0x36')]));_0x5cc485[_0x9022('0x34')]=_0x5cc485[_0x9022('0x34')]['length']?_0x5cc485[_0x9022('0x34')]:_0x5242ad[_0x9022('0x33')];_0x5cc485[_0x9022('0x3a')]=qs['sort'](_0x5203d3[_0x9022('0x30')][_0x9022('0x3b')]);_0x5cc485[_0x9022('0x3c')]=qs[_0x9022('0x32')](_['pick'](_0x5203d3[_0x9022('0x30')],_0x5242ad[_0x9022('0x32')]));if(_0x5203d3[_0x9022('0x30')][_0x9022('0x50')]){_0x5cc485[_0x9022('0x3c')]=_['merge'](_0x5cc485[_0x9022('0x3c')],{'$or':_[_0x9022('0x2d')](_0x5cc485[_0x9022('0x34')],function(_0x3aac43){var _0x8f4f7f={};_0x8f4f7f[_0x3aac43]={'$like':'%'+_0x5203d3[_0x9022('0x30')][_0x9022('0x50')]+'%'};return _0x8f4f7f;})});}_0x5cc485=_[_0x9022('0x3e')]({},_0x5cc485,_0x5203d3[_0x9022('0x40')]);return _0x1bc124[_0x9022('0x4d')](_0x5cc485);}})[_0x9022('0x28')](function(_0xa976c4){if(_0xa976c4){_0x161e92=_0xa976c4['length'];if(!_0x5203d3[_0x9022('0x30')][_0x9022('0x38')](_0x9022('0x39'))){_0x5cc485[_0x9022('0x20')]=qs[_0x9022('0x20')](_0x5203d3[_0x9022('0x30')][_0x9022('0x20')]);_0x5cc485[_0x9022('0x1e')]=qs['offset'](_0x5203d3['query'][_0x9022('0x1e')]);}return _0x1bc124[_0x9022('0x4d')](_0x5cc485);}})['then'](function(_0x29f8be){if(_0x29f8be){return _0x29f8be?{'count':_0x161e92,'rows':_0x29f8be}:null;}})[_0x9022('0x28')](respondWithResult(_0x44ab4b,null))[_0x9022('0x46')](handleError(_0x44ab4b,null));};exports['getSubjects']=function(_0x5d36f3,_0x575145,_0x7c1551){var _0xaea81a={};var _0xdd6e9e={};var _0x3b9fed;var _0x36ba60;return db[_0x9022('0x41')][_0x9022('0x4e')]({'where':{'id':_0x5d36f3[_0x9022('0x48')]['id']}})[_0x9022('0x28')](handleEntityNotFound(_0x575145,null))[_0x9022('0x28')](function(_0x2a96f0){if(_0x2a96f0){_0x3b9fed=_0x2a96f0;_0xdd6e9e[_0x9022('0x33')]=_[_0x9022('0x31')](db[_0x9022('0x4f')]['rawAttributes']);_0xdd6e9e[_0x9022('0x30')]=_[_0x9022('0x31')](_0x5d36f3[_0x9022('0x30')]);_0xdd6e9e['filters']=_['intersection'](_0xdd6e9e['model'],_0xdd6e9e[_0x9022('0x30')]);_0xaea81a[_0x9022('0x34')]=_[_0x9022('0x35')](_0xdd6e9e[_0x9022('0x33')],qs[_0x9022('0x36')](_0x5d36f3[_0x9022('0x30')]['fields']));_0xaea81a[_0x9022('0x34')]=_0xaea81a[_0x9022('0x34')][_0x9022('0x37')]?_0xaea81a[_0x9022('0x34')]:_0xdd6e9e['model'];_0xaea81a['order']=qs[_0x9022('0x3b')](_0x5d36f3[_0x9022('0x30')][_0x9022('0x3b')]);_0xaea81a[_0x9022('0x3c')]=qs['filters'](_[_0x9022('0x3d')](_0x5d36f3[_0x9022('0x30')],_0xdd6e9e[_0x9022('0x32')]));if(_0x5d36f3[_0x9022('0x30')][_0x9022('0x50')]){_0xaea81a['where']=_[_0x9022('0x3e')](_0xaea81a[_0x9022('0x3c')],{'$or':_[_0x9022('0x2d')](_0xaea81a[_0x9022('0x34')],function(_0x1c5df1){var _0xfce617={};_0xfce617[_0x1c5df1]={'$like':'%'+_0x5d36f3[_0x9022('0x30')][_0x9022('0x50')]+'%'};return _0xfce617;})});}_0xaea81a=_[_0x9022('0x3e')]({},_0xaea81a,_0x5d36f3[_0x9022('0x40')]);return _0x3b9fed[_0x9022('0x51')](_0xaea81a);}})[_0x9022('0x28')](function(_0x403b2b){if(_0x403b2b){_0x36ba60=_0x403b2b['length'];if(!_0x5d36f3[_0x9022('0x30')][_0x9022('0x38')](_0x9022('0x39'))){_0xaea81a[_0x9022('0x20')]=qs[_0x9022('0x20')](_0x5d36f3['query']['limit']);_0xaea81a[_0x9022('0x1e')]=qs['offset'](_0x5d36f3[_0x9022('0x30')]['offset']);}return _0x3b9fed[_0x9022('0x51')](_0xaea81a);}})['then'](function(_0x290898){if(_0x290898){return _0x290898?{'count':_0x36ba60,'rows':_0x290898}:null;}})['then'](respondWithResult(_0x575145,null))[_0x9022('0x46')](handleError(_0x575145,null));};exports[_0x9022('0x52')]=function(_0x811f9e,_0x57a850,_0x824c32){var _0x5d3047={};var _0x13e71e={};var _0x550e51;var _0x1154ce;return db[_0x9022('0x41')][_0x9022('0x4e')]({'where':{'id':_0x811f9e[_0x9022('0x48')]['id']}})[_0x9022('0x28')](handleEntityNotFound(_0x57a850,null))['then'](function(_0x38122a){if(_0x38122a){_0x550e51=_0x38122a;_0x13e71e[_0x9022('0x33')]=_[_0x9022('0x31')](db[_0x9022('0x4f')][_0x9022('0x2e')]);_0x13e71e['query']=_['keys'](_0x811f9e['query']);_0x13e71e[_0x9022('0x32')]=_[_0x9022('0x35')](_0x13e71e[_0x9022('0x33')],_0x13e71e[_0x9022('0x30')]);_0x5d3047[_0x9022('0x34')]=_[_0x9022('0x35')](_0x13e71e[_0x9022('0x33')],qs[_0x9022('0x36')](_0x811f9e['query'][_0x9022('0x36')]));_0x5d3047[_0x9022('0x34')]=_0x5d3047['attributes']['length']?_0x5d3047[_0x9022('0x34')]:_0x13e71e[_0x9022('0x33')];_0x5d3047[_0x9022('0x3a')]=qs['sort'](_0x811f9e[_0x9022('0x30')][_0x9022('0x3b')]);_0x5d3047[_0x9022('0x3c')]=qs[_0x9022('0x32')](_[_0x9022('0x3d')](_0x811f9e[_0x9022('0x30')],_0x13e71e[_0x9022('0x32')]));if(_0x811f9e[_0x9022('0x30')][_0x9022('0x50')]){_0x5d3047['where']=_['merge'](_0x5d3047['where'],{'$or':_[_0x9022('0x2d')](_0x5d3047[_0x9022('0x34')],function(_0x8f6142){var _0x1a54c3={};_0x1a54c3[_0x8f6142]={'$like':'%'+_0x811f9e[_0x9022('0x30')][_0x9022('0x50')]+'%'};return _0x1a54c3;})});}_0x5d3047=_[_0x9022('0x3e')]({},_0x5d3047,_0x811f9e[_0x9022('0x40')]);return _0x550e51[_0x9022('0x52')](_0x5d3047);}})[_0x9022('0x28')](function(_0x15c6cc){if(_0x15c6cc){_0x1154ce=_0x15c6cc[_0x9022('0x37')];if(!_0x811f9e[_0x9022('0x30')][_0x9022('0x38')](_0x9022('0x39'))){_0x5d3047[_0x9022('0x20')]=qs[_0x9022('0x20')](_0x811f9e[_0x9022('0x30')][_0x9022('0x20')]);_0x5d3047[_0x9022('0x1e')]=qs['offset'](_0x811f9e['query'][_0x9022('0x1e')]);}return _0x550e51[_0x9022('0x52')](_0x5d3047);}})[_0x9022('0x28')](function(_0x3daa1c){if(_0x3daa1c){return _0x3daa1c?{'count':_0x1154ce,'rows':_0x3daa1c}:null;}})['then'](respondWithResult(_0x57a850,null))[_0x9022('0x46')](handleError(_0x57a850,null));};exports[_0x9022('0x53')]=function(_0x4d037b,_0x379b65,_0x18955e){var _0x5c7ebf={};var _0x4f8a11={};var _0x132fd9;var _0x16f303;return db[_0x9022('0x41')]['findOne']({'where':{'id':_0x4d037b[_0x9022('0x48')]['id']}})['then'](handleEntityNotFound(_0x379b65,null))['then'](function(_0x2870cf){if(_0x2870cf){_0x132fd9=_0x2870cf;_0x4f8a11['model']=_[_0x9022('0x31')](db['Tag']['rawAttributes']);_0x4f8a11['query']=_[_0x9022('0x31')](_0x4d037b[_0x9022('0x30')]);_0x4f8a11['filters']=_[_0x9022('0x35')](_0x4f8a11[_0x9022('0x33')],_0x4f8a11[_0x9022('0x30')]);_0x5c7ebf[_0x9022('0x34')]=_['intersection'](_0x4f8a11[_0x9022('0x33')],qs[_0x9022('0x36')](_0x4d037b[_0x9022('0x30')]['fields']));_0x5c7ebf[_0x9022('0x34')]=_0x5c7ebf[_0x9022('0x34')][_0x9022('0x37')]?_0x5c7ebf[_0x9022('0x34')]:_0x4f8a11[_0x9022('0x33')];_0x5c7ebf['order']=qs['sort'](_0x4d037b[_0x9022('0x30')][_0x9022('0x3b')]);_0x5c7ebf['where']=qs[_0x9022('0x32')](_[_0x9022('0x3d')](_0x4d037b[_0x9022('0x30')],_0x4f8a11['filters']));if(_0x4d037b['query'][_0x9022('0x50')]){_0x5c7ebf[_0x9022('0x3c')]=_[_0x9022('0x3e')](_0x5c7ebf['where'],{'$or':_['map'](_0x5c7ebf[_0x9022('0x34')],function(_0x13c0f8){var _0x5d14dd={};_0x5d14dd[_0x13c0f8]={'$like':'%'+_0x4d037b[_0x9022('0x30')][_0x9022('0x50')]+'%'};return _0x5d14dd;})});}_0x5c7ebf=_[_0x9022('0x3e')]({},_0x5c7ebf,_0x4d037b[_0x9022('0x40')]);return _0x132fd9[_0x9022('0x53')](_0x5c7ebf);}})[_0x9022('0x28')](function(_0x457739){if(_0x457739){_0x16f303=_0x457739[_0x9022('0x37')];if(!_0x4d037b[_0x9022('0x30')][_0x9022('0x38')](_0x9022('0x39'))){_0x5c7ebf[_0x9022('0x20')]=qs[_0x9022('0x20')](_0x4d037b[_0x9022('0x30')][_0x9022('0x20')]);_0x5c7ebf[_0x9022('0x1e')]=qs[_0x9022('0x1e')](_0x4d037b[_0x9022('0x30')][_0x9022('0x1e')]);}return _0x132fd9[_0x9022('0x53')](_0x5c7ebf);}})['then'](function(_0x332c0a){if(_0x332c0a){return _0x332c0a?{'count':_0x16f303,'rows':_0x332c0a}:null;}})['then'](respondWithResult(_0x379b65,null))[_0x9022('0x46')](handleError(_0x379b65,null));};exports[_0x9022('0x54')]=function(_0xaf15be,_0x461365,_0xb099f6){if(_0xaf15be[_0x9022('0x4b')]['id']){delete _0xaf15be[_0x9022('0x4b')]['id'];}return db[_0x9022('0x41')][_0x9022('0x4e')]({'where':{'id':_0xaf15be['params']['id']}})[_0x9022('0x28')](handleEntityNotFound(_0x461365,null))[_0x9022('0x28')](function(_0x47130a){if(_0x47130a){return _0x47130a[_0x9022('0x54')](_0xaf15be['body'][_0x9022('0x55')]||[]);}return null;})[_0x9022('0x28')](respondWithResult(_0x461365,null))['catch'](handleError(_0x461365,null));}; \ No newline at end of file +var _0x54d5=['send','index','DeskConfiguration','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','update','getFields','DeskField','order','map','getSubjects','findOne','hasOwnProperty','getDescriptions','getTags','setTags','body','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','Content-Range','json','apply','reject','save','then','destroy','stack','name'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x54d5,0x179));var _0x554d=function(_0x415f81,_0x5422ff){_0x415f81=_0x415f81-0x0;var _0x518fa8=_0x54d5[_0x415f81];return _0x518fa8;};'use strict';var emlformat=require(_0x554d('0x0'));var rimraf=require(_0x554d('0x1'));var zipdir=require(_0x554d('0x2'));var jsonpatch=require(_0x554d('0x3'));var rp=require(_0x554d('0x4'));var moment=require(_0x554d('0x5'));var BPromise=require(_0x554d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x554d('0x7'));var sox=require(_0x554d('0x8'));var csv=require(_0x554d('0x9'));var ejs=require(_0x554d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x554d('0xb'));var crypto=require('crypto');var jsforce=require(_0x554d('0xc'));var deskjs=require(_0x554d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x554d('0xe'));var Papa=require(_0x554d('0xf'));var Redis=require(_0x554d('0x10'));var authService=require(_0x554d('0x11'));var qs=require(_0x554d('0x12'));var as=require(_0x554d('0x13'));var hardwareService=require(_0x554d('0x14'));var logger=require(_0x554d('0x15'))(_0x554d('0x16'));var utils=require(_0x554d('0x17'));var config=require(_0x554d('0x18'));var licenseUtil=require(_0x554d('0x19'));var db=require(_0x554d('0x1a'))['db'];function respondWithStatusCode(_0x24733d,_0x4b5e48){_0x4b5e48=_0x4b5e48||0xcc;return function(_0x205771){if(_0x205771){return _0x24733d[_0x554d('0x1b')](_0x4b5e48);}return _0x24733d['status'](_0x4b5e48)[_0x554d('0x1c')]();};}function respondWithResult(_0x91bf8b,_0x115ee9){_0x115ee9=_0x115ee9||0xc8;return function(_0x14a1d8){if(_0x14a1d8){return _0x91bf8b[_0x554d('0x1d')](_0x115ee9)['json'](_0x14a1d8);}};}function respondWithFilteredResult(_0x36de1e,_0x38e4dd){return function(_0x448629){if(_0x448629){var _0x105eb7=typeof _0x38e4dd[_0x554d('0x1e')]==='undefined'&&typeof _0x38e4dd['limit']===_0x554d('0x1f');var _0x4225c6=_0x448629[_0x554d('0x20')];var _0x1096f3=_0x105eb7?0x0:_0x38e4dd['offset'];var _0x4b3412=_0x105eb7?_0x448629[_0x554d('0x20')]:_0x38e4dd['offset']+_0x38e4dd[_0x554d('0x21')];var _0x272d9d;if(_0x4b3412>=_0x4225c6){_0x4b3412=_0x4225c6;_0x272d9d=0xc8;}else{_0x272d9d=0xce;}_0x36de1e[_0x554d('0x1d')](_0x272d9d);return _0x36de1e['set'](_0x554d('0x22'),_0x1096f3+'-'+_0x4b3412+'/'+_0x4225c6)[_0x554d('0x23')](_0x448629);}return null;};}function patchUpdates(_0x2e8ed1){return function(_0x4a8741){try{jsonpatch[_0x554d('0x24')](_0x4a8741,_0x2e8ed1,!![]);}catch(_0x5e42bc){return BPromise[_0x554d('0x25')](_0x5e42bc);}return _0x4a8741[_0x554d('0x26')]();};}function saveUpdates(_0x9de384,_0x108d0b){return function(_0x17f077){if(_0x17f077){return _0x17f077['update'](_0x9de384)[_0x554d('0x27')](function(_0x25ffc0){return _0x25ffc0;});}return null;};}function removeEntity(_0x3e2a2c,_0x1b1cd2){return function(_0x1d4ccf){if(_0x1d4ccf){return _0x1d4ccf[_0x554d('0x28')]()[_0x554d('0x27')](function(){_0x3e2a2c['status'](0xcc)[_0x554d('0x1c')]();});}};}function handleEntityNotFound(_0x29a621,_0x12dcec){return function(_0x1df6ad){if(!_0x1df6ad){_0x29a621[_0x554d('0x1b')](0x194);}return _0x1df6ad;};}function handleError(_0x8c2799,_0x54ecdb){_0x54ecdb=_0x54ecdb||0x1f4;return function(_0x245fc6){logger['error'](_0x245fc6[_0x554d('0x29')]);if(_0x245fc6[_0x554d('0x2a')]){delete _0x245fc6['name'];}_0x8c2799[_0x554d('0x1d')](_0x54ecdb)[_0x554d('0x2b')](_0x245fc6);};}exports[_0x554d('0x2c')]=function(_0x1c2544,_0x30d674){var _0x41669e={},_0x4501c3={},_0x11b28c={'count':0x0,'rows':[]};var _0x337ff3=_['map'](db[_0x554d('0x2d')]['rawAttributes'],function(_0x89bac7){return{'name':_0x89bac7[_0x554d('0x2e')],'type':_0x89bac7[_0x554d('0x2f')]['key']};});_0x4501c3[_0x554d('0x30')]=_['map'](_0x337ff3,_0x554d('0x2a'));_0x4501c3[_0x554d('0x31')]=_[_0x554d('0x32')](_0x1c2544[_0x554d('0x31')]);_0x4501c3['filters']=_[_0x554d('0x33')](_0x4501c3['model'],_0x4501c3[_0x554d('0x31')]);_0x41669e[_0x554d('0x34')]=_['intersection'](_0x4501c3[_0x554d('0x30')],qs[_0x554d('0x35')](_0x1c2544[_0x554d('0x31')][_0x554d('0x35')]));_0x41669e[_0x554d('0x34')]=_0x41669e['attributes'][_0x554d('0x36')]?_0x41669e[_0x554d('0x34')]:_0x4501c3['model'];if(!_0x1c2544[_0x554d('0x31')]['hasOwnProperty'](_0x554d('0x37'))){_0x41669e[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x1c2544['query'][_0x554d('0x21')]);_0x41669e[_0x554d('0x1e')]=qs['offset'](_0x1c2544['query'][_0x554d('0x1e')]);}_0x41669e['order']=qs['sort'](_0x1c2544[_0x554d('0x31')][_0x554d('0x38')]);_0x41669e[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x1c2544[_0x554d('0x31')],_0x4501c3[_0x554d('0x3b')]),_0x337ff3);if(_0x1c2544['query'][_0x554d('0x3c')]){_0x41669e['where']=_[_0x554d('0x3d')](_0x41669e[_0x554d('0x39')],{'$or':_['map'](_0x337ff3,function(_0x3ce4aa){if(_0x3ce4aa[_0x554d('0x2f')]!=='VIRTUAL'){var _0x42bca2={};_0x42bca2[_0x3ce4aa[_0x554d('0x2a')]]={'$like':'%'+_0x1c2544['query'][_0x554d('0x3c')]+'%'};return _0x42bca2;}})});}_0x41669e=_['merge']({},_0x41669e,_0x1c2544['options']);var _0xcb3433={'where':_0x41669e['where']};return db[_0x554d('0x2d')]['count'](_0xcb3433)['then'](function(_0xa97fb0){_0x11b28c[_0x554d('0x20')]=_0xa97fb0;if(_0x1c2544[_0x554d('0x31')][_0x554d('0x3e')]){_0x41669e[_0x554d('0x3f')]=[{'all':!![]}];}return db[_0x554d('0x2d')][_0x554d('0x40')](_0x41669e);})[_0x554d('0x27')](function(_0x4519fe){_0x11b28c[_0x554d('0x41')]=_0x4519fe;return _0x11b28c;})[_0x554d('0x27')](respondWithFilteredResult(_0x30d674,_0x41669e))[_0x554d('0x42')](handleError(_0x30d674,null));};exports['show']=function(_0x3c52d2,_0x30d79c){var _0x36f6f3={'raw':![],'where':{'id':_0x3c52d2[_0x554d('0x43')]['id']}},_0x4d9f0a={};_0x4d9f0a['model']=_[_0x554d('0x32')](db[_0x554d('0x2d')][_0x554d('0x44')]);_0x4d9f0a[_0x554d('0x31')]=_[_0x554d('0x32')](_0x3c52d2[_0x554d('0x31')]);_0x4d9f0a[_0x554d('0x3b')]=_[_0x554d('0x33')](_0x4d9f0a[_0x554d('0x30')],_0x4d9f0a[_0x554d('0x31')]);_0x36f6f3[_0x554d('0x34')]=_[_0x554d('0x33')](_0x4d9f0a[_0x554d('0x30')],qs[_0x554d('0x35')](_0x3c52d2[_0x554d('0x31')][_0x554d('0x35')]));_0x36f6f3[_0x554d('0x34')]=_0x36f6f3[_0x554d('0x34')]['length']?_0x36f6f3[_0x554d('0x34')]:_0x4d9f0a['model'];if(_0x3c52d2[_0x554d('0x31')][_0x554d('0x3e')]){_0x36f6f3[_0x554d('0x3f')]=[{'all':!![]}];}_0x36f6f3=_[_0x554d('0x3d')]({},_0x36f6f3,_0x3c52d2[_0x554d('0x45')]);return db[_0x554d('0x2d')]['find'](_0x36f6f3)[_0x554d('0x27')](handleEntityNotFound(_0x30d79c,null))[_0x554d('0x27')](respondWithResult(_0x30d79c,null))[_0x554d('0x42')](handleError(_0x30d79c,null));};exports[_0x554d('0x46')]=function(_0x44ed12,_0x61faa0){return db[_0x554d('0x2d')][_0x554d('0x46')](_0x44ed12['body'],{})[_0x554d('0x27')](respondWithResult(_0x61faa0,0xc9))['catch'](handleError(_0x61faa0,null));};exports[_0x554d('0x47')]=function(_0x3039ca,_0x33ba83){if(_0x3039ca['body']['id']){delete _0x3039ca['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3039ca['params']['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x33ba83,null))[_0x554d('0x27')](saveUpdates(_0x3039ca['body'],null))[_0x554d('0x27')](respondWithResult(_0x33ba83,null))[_0x554d('0x42')](handleError(_0x33ba83,null));};exports[_0x554d('0x28')]=function(_0x5d5acc,_0x21a023){return db[_0x554d('0x2d')]['find']({'where':{'id':_0x5d5acc[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x21a023,null))[_0x554d('0x27')](removeEntity(_0x21a023,null))[_0x554d('0x42')](handleError(_0x21a023,null));};exports[_0x554d('0x48')]=function(_0x176fce,_0x2a62b0,_0x3ebbeb){var _0x3b41ed={};var _0xe0b567={};var _0x5acd20;var _0xc869e4;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x176fce[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x2a62b0,null))[_0x554d('0x27')](function(_0x34d50a){if(_0x34d50a){_0x5acd20=_0x34d50a;_0xe0b567[_0x554d('0x30')]=_[_0x554d('0x32')](db[_0x554d('0x49')][_0x554d('0x44')]);_0xe0b567['query']=_[_0x554d('0x32')](_0x176fce[_0x554d('0x31')]);_0xe0b567[_0x554d('0x3b')]=_['intersection'](_0xe0b567['model'],_0xe0b567['query']);_0x3b41ed[_0x554d('0x34')]=_['intersection'](_0xe0b567[_0x554d('0x30')],qs[_0x554d('0x35')](_0x176fce[_0x554d('0x31')][_0x554d('0x35')]));_0x3b41ed['attributes']=_0x3b41ed[_0x554d('0x34')][_0x554d('0x36')]?_0x3b41ed[_0x554d('0x34')]:_0xe0b567[_0x554d('0x30')];_0x3b41ed[_0x554d('0x4a')]=qs[_0x554d('0x38')](_0x176fce['query'][_0x554d('0x38')]);_0x3b41ed[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x176fce[_0x554d('0x31')],_0xe0b567[_0x554d('0x3b')]));if(_0x176fce[_0x554d('0x31')][_0x554d('0x3c')]){_0x3b41ed[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3b41ed[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x3b41ed['attributes'],function(_0x5db218){var _0x3a38ba={};_0x3a38ba[_0x5db218]={'$like':'%'+_0x176fce[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3a38ba;})});}_0x3b41ed=_[_0x554d('0x3d')]({},_0x3b41ed,_0x176fce[_0x554d('0x45')]);return _0x5acd20[_0x554d('0x48')](_0x3b41ed);}})[_0x554d('0x27')](function(_0x3e1b9a){if(_0x3e1b9a){_0xc869e4=_0x3e1b9a['length'];if(!_0x176fce['query']['hasOwnProperty'](_0x554d('0x37'))){_0x3b41ed[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x176fce[_0x554d('0x31')][_0x554d('0x21')]);_0x3b41ed[_0x554d('0x1e')]=qs['offset'](_0x176fce[_0x554d('0x31')][_0x554d('0x1e')]);}return _0x5acd20['getFields'](_0x3b41ed);}})[_0x554d('0x27')](function(_0x53af39){if(_0x53af39){return _0x53af39?{'count':_0xc869e4,'rows':_0x53af39}:null;}})[_0x554d('0x27')](respondWithResult(_0x2a62b0,null))[_0x554d('0x42')](handleError(_0x2a62b0,null));};exports[_0x554d('0x4c')]=function(_0x1eaff1,_0x4518be,_0x393c62){var _0x3c3f66={};var _0x1a5cda={};var _0x439cfe;var _0x3b84f8;return db['DeskConfiguration'][_0x554d('0x4d')]({'where':{'id':_0x1eaff1[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x4518be,null))['then'](function(_0x113043){if(_0x113043){_0x439cfe=_0x113043;_0x1a5cda[_0x554d('0x30')]=_[_0x554d('0x32')](db['DeskField']['rawAttributes']);_0x1a5cda[_0x554d('0x31')]=_['keys'](_0x1eaff1[_0x554d('0x31')]);_0x1a5cda['filters']=_[_0x554d('0x33')](_0x1a5cda[_0x554d('0x30')],_0x1a5cda[_0x554d('0x31')]);_0x3c3f66[_0x554d('0x34')]=_[_0x554d('0x33')](_0x1a5cda[_0x554d('0x30')],qs[_0x554d('0x35')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x35')]));_0x3c3f66[_0x554d('0x34')]=_0x3c3f66[_0x554d('0x34')]['length']?_0x3c3f66['attributes']:_0x1a5cda['model'];_0x3c3f66[_0x554d('0x4a')]=qs[_0x554d('0x38')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x38')]);_0x3c3f66[_0x554d('0x39')]=qs[_0x554d('0x3b')](_[_0x554d('0x3a')](_0x1eaff1[_0x554d('0x31')],_0x1a5cda[_0x554d('0x3b')]));if(_0x1eaff1[_0x554d('0x31')][_0x554d('0x3c')]){_0x3c3f66[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3c3f66[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x3c3f66['attributes'],function(_0x5a3936){var _0x3375dc={};_0x3375dc[_0x5a3936]={'$like':'%'+_0x1eaff1[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3375dc;})});}_0x3c3f66=_['merge']({},_0x3c3f66,_0x1eaff1['options']);return _0x439cfe[_0x554d('0x4c')](_0x3c3f66);}})['then'](function(_0xde291b){if(_0xde291b){_0x3b84f8=_0xde291b[_0x554d('0x36')];if(!_0x1eaff1['query'][_0x554d('0x4e')](_0x554d('0x37'))){_0x3c3f66[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x21')]);_0x3c3f66[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x1eaff1['query'][_0x554d('0x1e')]);}return _0x439cfe['getSubjects'](_0x3c3f66);}})[_0x554d('0x27')](function(_0x3d2986){if(_0x3d2986){return _0x3d2986?{'count':_0x3b84f8,'rows':_0x3d2986}:null;}})['then'](respondWithResult(_0x4518be,null))[_0x554d('0x42')](handleError(_0x4518be,null));};exports[_0x554d('0x4f')]=function(_0x130f18,_0x452d22,_0xb8e36a){var _0x3077d0={};var _0x1b34c2={};var _0x2244b6;var _0x164122;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x130f18[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x452d22,null))[_0x554d('0x27')](function(_0xe44dc0){if(_0xe44dc0){_0x2244b6=_0xe44dc0;_0x1b34c2[_0x554d('0x30')]=_[_0x554d('0x32')](db[_0x554d('0x49')][_0x554d('0x44')]);_0x1b34c2['query']=_[_0x554d('0x32')](_0x130f18[_0x554d('0x31')]);_0x1b34c2['filters']=_['intersection'](_0x1b34c2[_0x554d('0x30')],_0x1b34c2[_0x554d('0x31')]);_0x3077d0[_0x554d('0x34')]=_[_0x554d('0x33')](_0x1b34c2[_0x554d('0x30')],qs[_0x554d('0x35')](_0x130f18[_0x554d('0x31')]['fields']));_0x3077d0['attributes']=_0x3077d0[_0x554d('0x34')][_0x554d('0x36')]?_0x3077d0[_0x554d('0x34')]:_0x1b34c2[_0x554d('0x30')];_0x3077d0[_0x554d('0x4a')]=qs['sort'](_0x130f18['query'][_0x554d('0x38')]);_0x3077d0['where']=qs[_0x554d('0x3b')](_[_0x554d('0x3a')](_0x130f18[_0x554d('0x31')],_0x1b34c2['filters']));if(_0x130f18['query'][_0x554d('0x3c')]){_0x3077d0[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3077d0[_0x554d('0x39')],{'$or':_['map'](_0x3077d0[_0x554d('0x34')],function(_0xd36875){var _0x2cc189={};_0x2cc189[_0xd36875]={'$like':'%'+_0x130f18[_0x554d('0x31')]['filter']+'%'};return _0x2cc189;})});}_0x3077d0=_['merge']({},_0x3077d0,_0x130f18[_0x554d('0x45')]);return _0x2244b6[_0x554d('0x4f')](_0x3077d0);}})['then'](function(_0x33c811){if(_0x33c811){_0x164122=_0x33c811[_0x554d('0x36')];if(!_0x130f18['query'][_0x554d('0x4e')]('nolimit')){_0x3077d0[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x130f18['query']['limit']);_0x3077d0[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x130f18[_0x554d('0x31')]['offset']);}return _0x2244b6['getDescriptions'](_0x3077d0);}})[_0x554d('0x27')](function(_0x4bc343){if(_0x4bc343){return _0x4bc343?{'count':_0x164122,'rows':_0x4bc343}:null;}})['then'](respondWithResult(_0x452d22,null))[_0x554d('0x42')](handleError(_0x452d22,null));};exports[_0x554d('0x50')]=function(_0x227d67,_0x2f9e70,_0x3068c5){var _0x414f58={};var _0x59e557={};var _0x26ec13;var _0xc04389;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x227d67[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x2f9e70,null))[_0x554d('0x27')](function(_0x546b2a){if(_0x546b2a){_0x26ec13=_0x546b2a;_0x59e557['model']=_[_0x554d('0x32')](db['Tag'][_0x554d('0x44')]);_0x59e557[_0x554d('0x31')]=_['keys'](_0x227d67[_0x554d('0x31')]);_0x59e557[_0x554d('0x3b')]=_['intersection'](_0x59e557['model'],_0x59e557[_0x554d('0x31')]);_0x414f58[_0x554d('0x34')]=_[_0x554d('0x33')](_0x59e557[_0x554d('0x30')],qs[_0x554d('0x35')](_0x227d67[_0x554d('0x31')][_0x554d('0x35')]));_0x414f58[_0x554d('0x34')]=_0x414f58[_0x554d('0x34')][_0x554d('0x36')]?_0x414f58['attributes']:_0x59e557[_0x554d('0x30')];_0x414f58[_0x554d('0x4a')]=qs['sort'](_0x227d67[_0x554d('0x31')][_0x554d('0x38')]);_0x414f58['where']=qs[_0x554d('0x3b')](_['pick'](_0x227d67['query'],_0x59e557[_0x554d('0x3b')]));if(_0x227d67[_0x554d('0x31')][_0x554d('0x3c')]){_0x414f58[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x414f58[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x414f58[_0x554d('0x34')],function(_0x4d272e){var _0x3fbabb={};_0x3fbabb[_0x4d272e]={'$like':'%'+_0x227d67[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3fbabb;})});}_0x414f58=_[_0x554d('0x3d')]({},_0x414f58,_0x227d67[_0x554d('0x45')]);return _0x26ec13['getTags'](_0x414f58);}})['then'](function(_0x195307){if(_0x195307){_0xc04389=_0x195307[_0x554d('0x36')];if(!_0x227d67[_0x554d('0x31')][_0x554d('0x4e')]('nolimit')){_0x414f58['limit']=qs['limit'](_0x227d67[_0x554d('0x31')][_0x554d('0x21')]);_0x414f58[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x227d67['query']['offset']);}return _0x26ec13[_0x554d('0x50')](_0x414f58);}})[_0x554d('0x27')](function(_0x1c1ca1){if(_0x1c1ca1){return _0x1c1ca1?{'count':_0xc04389,'rows':_0x1c1ca1}:null;}})['then'](respondWithResult(_0x2f9e70,null))[_0x554d('0x42')](handleError(_0x2f9e70,null));};exports[_0x554d('0x51')]=function(_0x831600,_0x3830b8,_0x2e2e76){if(_0x831600[_0x554d('0x52')]['id']){delete _0x831600[_0x554d('0x52')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x831600[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3830b8,null))['then'](function(_0x54be60){if(_0x54be60){return _0x54be60[_0x554d('0x51')](_0x831600[_0x554d('0x52')][_0x554d('0x53')]||[]);}return null;})[_0x554d('0x27')](respondWithResult(_0x3830b8,null))[_0x554d('0x42')](handleError(_0x3830b8,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index aabb914..c5cdaf0 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 _0xeb9d=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','request-promise'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xeb9d,0x7f));var _0xdeb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdeb9('0x0'));var util=require('util');var logger=require(_0xdeb9('0x1'))(_0xdeb9('0x2'));var moment=require(_0xdeb9('0x3'));var BPromise=require('bluebird');var rp=require(_0xdeb9('0x4'));var fs=require('fs');var path=require(_0xdeb9('0x5'));var rimraf=require(_0xdeb9('0x6'));var config=require(_0xdeb9('0x7'));var attributes=require(_0xdeb9('0x8'));module['exports']=function(_0x14b08e,_0x4941b9){return _0x14b08e[_0xdeb9('0x9')](_0xdeb9('0xa'),attributes,{'tableName':_0xdeb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa643=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','int_desk_configurations','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa643,0x11c));var _0x3a64=function(_0x4fe8d5,_0x3188d0){_0x4fe8d5=_0x4fe8d5-0x0;var _0x215681=_0xa643[_0x4fe8d5];return _0x215681;};'use strict';var _=require(_0x3a64('0x0'));var util=require(_0x3a64('0x1'));var logger=require('../../config/logger')(_0x3a64('0x2'));var moment=require(_0x3a64('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a64('0x4'));var fs=require('fs');var path=require(_0x3a64('0x5'));var rimraf=require(_0x3a64('0x6'));var config=require(_0x3a64('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x3a64('0x8')]=function(_0x14e51b,_0x207bec){return _0x14e51b[_0x3a64('0x9')]('DeskConfiguration',attributes,{'tableName':_0x3a64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 4849eb3..54adc64 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 _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0x47c5,0x165));var _0x547c=function(_0x123be2,_0x547a9e){_0x123be2=_0x123be2-0x0;var _0x47fd4c=_0x47c5[_0x123be2];return _0x47fd4c;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});} \ No newline at end of file +var _0x288a=['jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x6a2fe0,_0x6a9f5f){var _0x3732b0=function(_0x35aa94){while(--_0x35aa94){_0x6a2fe0['push'](_0x6a2fe0['shift']());}};_0x3732b0(++_0x6a9f5f);}(_0x288a,0x188));var _0xa288=function(_0x9d2732,_0x4e241a){_0x9d2732=_0x9d2732-0x0;var _0x2532f5=_0x288a[_0x9d2732];return _0x2532f5;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaee90c,_0x156720,_0x57f445){return new BPromise(function(_0x14e4a6,_0x1e8412){return client[_0xa288('0x9')](_0xaee90c,_0x57f445)[_0xa288('0xa')](function(_0x1a0c06){logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x156720,'request\x20sent',JSON[_0xa288('0xe')](_0x1a0c06));if(_0x1a0c06[_0xa288('0xf')]){if(_0x1a0c06['error'][_0xa288('0x10')]===0x1f4){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x1e8412(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x14e4a6(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}else{logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));_0x14e4a6(_0x1a0c06['result'][_0xa288('0x11')]);}})[_0xa288('0x12')](function(_0x299ede){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x299ede);_0x1e8412(_0x299ede);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 969af67..79a74f9 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 _0x3779=['isAuthenticated','/:id','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0x1e8909,_0x2a56e3){var _0x35726e=function(_0x3c152a){while(--_0x3c152a){_0x1e8909['push'](_0x1e8909['shift']());}};_0x35726e(++_0x2a56e3);}(_0x3779,0x102));var _0x9377=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0x3779[_0x51f84a];return _0x4ba63d;};'use strict';var multer=require(_0x9377('0x0'));var util=require(_0x9377('0x1'));var path=require('path');var timeout=require(_0x9377('0x2'));var express=require(_0x9377('0x3'));var router=express[_0x9377('0x4')]();var fs_extra=require(_0x9377('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9377('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x9377('0x7')]('/',auth[_0x9377('0x8')](),controller['index']);router[_0x9377('0x7')](_0x9377('0x9'),auth[_0x9377('0x8')](),controller['show']);router['post']('/',auth[_0x9377('0x8')](),controller['create']);router[_0x9377('0xa')]('/:id',auth[_0x9377('0x8')](),controller['update']);router[_0x9377('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9377('0xc')]);module[_0x9377('0xd')]=router; \ No newline at end of file +var _0xe55d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util'];(function(_0x2d87c4,_0x341d6b){var _0x2f453b=function(_0x3cf382){while(--_0x3cf382){_0x2d87c4['push'](_0x2d87c4['shift']());}};_0x2f453b(++_0x341d6b);}(_0xe55d,0x9f));var _0xde55=function(_0xa66559,_0x466ee4){_0xa66559=_0xa66559-0x0;var _0x2be33f=_0xe55d[_0xa66559];return _0x2be33f;};'use strict';var multer=require('multer');var util=require(_0xde55('0x0'));var path=require(_0xde55('0x1'));var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var fs_extra=require(_0xde55('0x5'));var auth=require(_0xde55('0x6'));var interaction=require(_0xde55('0x7'));var config=require(_0xde55('0x8'));var controller=require(_0xde55('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xde55('0xa')]);router['get'](_0xde55('0xb'),auth[_0xde55('0xc')](),controller[_0xde55('0xd')]);router[_0xde55('0xe')]('/',auth[_0xde55('0xc')](),controller['create']);router[_0xde55('0xf')](_0xde55('0xb'),auth['isAuthenticated'](),controller[_0xde55('0x10')]);router[_0xde55('0x11')](_0xde55('0xb'),auth[_0xde55('0xc')](),controller[_0xde55('0x12')]);module[_0xde55('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 79152a4..7d41579 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 _0xf886=['ENUM','variable','BOOLEAN','exports','string','customVariable','picklist','STRING'];(function(_0x33c780,_0x5dcffc){var _0xf81fef=function(_0x566cd6){while(--_0x566cd6){_0x33c780['push'](_0x33c780['shift']());}};_0xf81fef(++_0x5dcffc);}(_0xf886,0xd3));var _0x6f88=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0xf886[_0x254081];return _0x5d1e2a;};'use strict';var Sequelize=require('sequelize');module[_0x6f88('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6f88('0x1'),'variable',_0x6f88('0x2'),'keyValue',_0x6f88('0x3')),'defaultValue':_0x6f88('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6f88('0x4')]},'keyType':{'type':Sequelize[_0x6f88('0x5')]('string',_0x6f88('0x6'),_0x6f88('0x2'))},'keyContent':{'type':Sequelize[_0x6f88('0x4')]},'idField':{'type':Sequelize[_0x6f88('0x4')]},'nameField':{'type':Sequelize[_0x6f88('0x4')]},'customField':{'type':Sequelize[_0x6f88('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x635c=['BOOLEAN','sequelize','exports','keyValue','picklist','string','STRING','ENUM','variable'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x635c,0x1e7));var _0xc635=function(_0x2860b2,_0x2c42fe){_0x2860b2=_0x2860b2-0x0;var _0x73e907=_0x635c[_0x2860b2];return _0x73e907;};'use strict';var Sequelize=require(_0xc635('0x0'));module[_0xc635('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xc635('0x2'),_0xc635('0x3')),'defaultValue':_0xc635('0x4')},'content':{'type':Sequelize[_0xc635('0x5')]},'key':{'type':Sequelize[_0xc635('0x5')]},'keyType':{'type':Sequelize[_0xc635('0x6')](_0xc635('0x4'),_0xc635('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc635('0x5')]},'nameField':{'type':Sequelize[_0xc635('0x5')]},'customField':{'type':Sequelize[_0xc635('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc635('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index a926542..c9a83dc 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 _0xb30f=['key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskField','fieldName'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb30f,0x109));var _0xfb30=function(_0x4ec5d5,_0x4f768a){_0x4ec5d5=_0x4ec5d5-0x0;var _0x5c29c5=_0xb30f[_0x4ec5d5];return _0x5c29c5;};'use strict';var emlformat=require(_0xfb30('0x0'));var rimraf=require(_0xfb30('0x1'));var zipdir=require(_0xfb30('0x2'));var jsonpatch=require(_0xfb30('0x3'));var rp=require(_0xfb30('0x4'));var moment=require('moment');var BPromise=require(_0xfb30('0x5'));var Mustache=require(_0xfb30('0x6'));var util=require(_0xfb30('0x7'));var path=require('path');var sox=require(_0xfb30('0x8'));var csv=require(_0xfb30('0x9'));var ejs=require(_0xfb30('0xa'));var fs=require('fs');var fs_extra=require(_0xfb30('0xb'));var _=require(_0xfb30('0xc'));var squel=require('squel');var crypto=require(_0xfb30('0xd'));var jsforce=require(_0xfb30('0xe'));var deskjs=require(_0xfb30('0xf'));var toCsv=require(_0xfb30('0x9'));var querystring=require(_0xfb30('0x10'));var Papa=require('papaparse');var Redis=require(_0xfb30('0x11'));var authService=require(_0xfb30('0x12'));var qs=require(_0xfb30('0x13'));var as=require(_0xfb30('0x14'));var hardwareService=require(_0xfb30('0x15'));var logger=require(_0xfb30('0x16'))(_0xfb30('0x17'));var utils=require(_0xfb30('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfb30('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x191273,_0xb95c9e){_0xb95c9e=_0xb95c9e||0xcc;return function(_0x124a3d){if(_0x124a3d){return _0x191273[_0xfb30('0x1a')](_0xb95c9e);}return _0x191273[_0xfb30('0x1b')](_0xb95c9e)[_0xfb30('0x1c')]();};}function respondWithResult(_0x4ce80a,_0x47be36){_0x47be36=_0x47be36||0xc8;return function(_0x1c4f08){if(_0x1c4f08){return _0x4ce80a[_0xfb30('0x1b')](_0x47be36)[_0xfb30('0x1d')](_0x1c4f08);}};}function respondWithFilteredResult(_0x3993f6,_0x443282){return function(_0x2fd24d){if(_0x2fd24d){var _0x805cba=typeof _0x443282['offset']==='undefined'&&typeof _0x443282[_0xfb30('0x1e')]===_0xfb30('0x1f');var _0x3290a8=_0x2fd24d[_0xfb30('0x20')];var _0x1099d4=_0x805cba?0x0:_0x443282[_0xfb30('0x21')];var _0x56402e=_0x805cba?_0x2fd24d['count']:_0x443282[_0xfb30('0x21')]+_0x443282[_0xfb30('0x1e')];var _0x59f838;if(_0x56402e>=_0x3290a8){_0x56402e=_0x3290a8;_0x59f838=0xc8;}else{_0x59f838=0xce;}_0x3993f6[_0xfb30('0x1b')](_0x59f838);return _0x3993f6['set']('Content-Range',_0x1099d4+'-'+_0x56402e+'/'+_0x3290a8)[_0xfb30('0x1d')](_0x2fd24d);}return null;};}function patchUpdates(_0x12972b){return function(_0x58d207){try{jsonpatch[_0xfb30('0x22')](_0x58d207,_0x12972b,!![]);}catch(_0x45d441){return BPromise[_0xfb30('0x23')](_0x45d441);}return _0x58d207['save']();};}function saveUpdates(_0x47fafa,_0x10a64d){return function(_0x286f20){if(_0x286f20){return _0x286f20[_0xfb30('0x24')](_0x47fafa)[_0xfb30('0x25')](function(_0x5899c0){return _0x5899c0;});}return null;};}function removeEntity(_0x2449c6,_0xeb8c09){return function(_0x50d75c){if(_0x50d75c){return _0x50d75c[_0xfb30('0x26')]()[_0xfb30('0x25')](function(){_0x2449c6[_0xfb30('0x1b')](0xcc)[_0xfb30('0x1c')]();});}};}function handleEntityNotFound(_0x26dbbb,_0x385ef6){return function(_0x39dc68){if(!_0x39dc68){_0x26dbbb[_0xfb30('0x1a')](0x194);}return _0x39dc68;};}function handleError(_0x2b8549,_0x46dd0c){_0x46dd0c=_0x46dd0c||0x1f4;return function(_0x3c5fcb){logger[_0xfb30('0x27')](_0x3c5fcb[_0xfb30('0x28')]);if(_0x3c5fcb[_0xfb30('0x29')]){delete _0x3c5fcb[_0xfb30('0x29')];}_0x2b8549[_0xfb30('0x1b')](_0x46dd0c)[_0xfb30('0x2a')](_0x3c5fcb);};}exports[_0xfb30('0x2b')]=function(_0x497d57,_0x36f7a4){var _0x3d74eb={},_0x514277={},_0x34676b={'count':0x0,'rows':[]};var _0x4aa828=_[_0xfb30('0x2c')](db[_0xfb30('0x2d')]['rawAttributes'],function(_0x593a04){return{'name':_0x593a04[_0xfb30('0x2e')],'type':_0x593a04['type'][_0xfb30('0x2f')]};});_0x514277[_0xfb30('0x30')]=_[_0xfb30('0x2c')](_0x4aa828,'name');_0x514277[_0xfb30('0x31')]=_[_0xfb30('0x32')](_0x497d57[_0xfb30('0x31')]);_0x514277[_0xfb30('0x33')]=_['intersection'](_0x514277[_0xfb30('0x30')],_0x514277[_0xfb30('0x31')]);_0x3d74eb[_0xfb30('0x34')]=_['intersection'](_0x514277[_0xfb30('0x30')],qs[_0xfb30('0x35')](_0x497d57['query'][_0xfb30('0x35')]));_0x3d74eb['attributes']=_0x3d74eb[_0xfb30('0x34')][_0xfb30('0x36')]?_0x3d74eb[_0xfb30('0x34')]:_0x514277[_0xfb30('0x30')];if(!_0x497d57[_0xfb30('0x31')][_0xfb30('0x37')](_0xfb30('0x38'))){_0x3d74eb[_0xfb30('0x1e')]=qs[_0xfb30('0x1e')](_0x497d57['query'][_0xfb30('0x1e')]);_0x3d74eb[_0xfb30('0x21')]=qs[_0xfb30('0x21')](_0x497d57[_0xfb30('0x31')]['offset']);}_0x3d74eb[_0xfb30('0x39')]=qs['sort'](_0x497d57[_0xfb30('0x31')][_0xfb30('0x3a')]);_0x3d74eb['where']=qs[_0xfb30('0x33')](_[_0xfb30('0x3b')](_0x497d57['query'],_0x514277[_0xfb30('0x33')]),_0x4aa828);if(_0x497d57['query'][_0xfb30('0x3c')]){_0x3d74eb[_0xfb30('0x3d')]=_[_0xfb30('0x3e')](_0x3d74eb[_0xfb30('0x3d')],{'$or':_['map'](_0x4aa828,function(_0x9e4136){if(_0x9e4136[_0xfb30('0x3f')]!==_0xfb30('0x40')){var _0x41c3d3={};_0x41c3d3[_0x9e4136[_0xfb30('0x29')]]={'$like':'%'+_0x497d57[_0xfb30('0x31')][_0xfb30('0x3c')]+'%'};return _0x41c3d3;}})});}_0x3d74eb=_[_0xfb30('0x3e')]({},_0x3d74eb,_0x497d57[_0xfb30('0x41')]);var _0x592275={'where':_0x3d74eb[_0xfb30('0x3d')]};return db[_0xfb30('0x2d')][_0xfb30('0x20')](_0x592275)[_0xfb30('0x25')](function(_0x32e2b9){_0x34676b[_0xfb30('0x20')]=_0x32e2b9;if(_0x497d57[_0xfb30('0x31')][_0xfb30('0x42')]){_0x3d74eb[_0xfb30('0x43')]=[{'all':!![]}];}return db[_0xfb30('0x2d')][_0xfb30('0x44')](_0x3d74eb);})[_0xfb30('0x25')](function(_0x3d10c9){_0x34676b[_0xfb30('0x45')]=_0x3d10c9;return _0x34676b;})[_0xfb30('0x25')](respondWithFilteredResult(_0x36f7a4,_0x3d74eb))[_0xfb30('0x46')](handleError(_0x36f7a4,null));};exports[_0xfb30('0x47')]=function(_0x1ec26e,_0x35ea8f){var _0x3fd821={'raw':!![],'where':{'id':_0x1ec26e[_0xfb30('0x48')]['id']}},_0x323db3={};_0x323db3[_0xfb30('0x30')]=_['keys'](db[_0xfb30('0x2d')][_0xfb30('0x49')]);_0x323db3['query']=_[_0xfb30('0x32')](_0x1ec26e[_0xfb30('0x31')]);_0x323db3[_0xfb30('0x33')]=_[_0xfb30('0x4a')](_0x323db3[_0xfb30('0x30')],_0x323db3[_0xfb30('0x31')]);_0x3fd821[_0xfb30('0x34')]=_[_0xfb30('0x4a')](_0x323db3[_0xfb30('0x30')],qs[_0xfb30('0x35')](_0x1ec26e[_0xfb30('0x31')]['fields']));_0x3fd821['attributes']=_0x3fd821['attributes']['length']?_0x3fd821[_0xfb30('0x34')]:_0x323db3[_0xfb30('0x30')];if(_0x1ec26e[_0xfb30('0x31')]['includeAll']){_0x3fd821[_0xfb30('0x43')]=[{'all':!![]}];}_0x3fd821=_[_0xfb30('0x3e')]({},_0x3fd821,_0x1ec26e[_0xfb30('0x41')]);return db[_0xfb30('0x2d')]['find'](_0x3fd821)[_0xfb30('0x25')](handleEntityNotFound(_0x35ea8f,null))['then'](respondWithResult(_0x35ea8f,null))[_0xfb30('0x46')](handleError(_0x35ea8f,null));};exports[_0xfb30('0x4b')]=function(_0x4b376f,_0x35e3ca){return db[_0xfb30('0x2d')][_0xfb30('0x4b')](_0x4b376f[_0xfb30('0x4c')],{})[_0xfb30('0x25')](respondWithResult(_0x35e3ca,0xc9))['catch'](handleError(_0x35e3ca,null));};exports[_0xfb30('0x24')]=function(_0x51d69f,_0x2f714f){if(_0x51d69f[_0xfb30('0x4c')]['id']){delete _0x51d69f[_0xfb30('0x4c')]['id'];}return db[_0xfb30('0x2d')][_0xfb30('0x4d')]({'where':{'id':_0x51d69f[_0xfb30('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f714f,null))[_0xfb30('0x25')](saveUpdates(_0x51d69f[_0xfb30('0x4c')],null))['then'](respondWithResult(_0x2f714f,null))[_0xfb30('0x46')](handleError(_0x2f714f,null));};exports[_0xfb30('0x26')]=function(_0x1db883,_0x377bbb){return db['DeskField'][_0xfb30('0x4d')]({'where':{'id':_0x1db883[_0xfb30('0x48')]['id']}})[_0xfb30('0x25')](handleEntityNotFound(_0x377bbb,null))[_0xfb30('0x25')](removeEntity(_0x377bbb,null))[_0xfb30('0x46')](handleError(_0x377bbb,null));}; \ No newline at end of file +var _0xdbf5=['stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','find','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error'];(function(_0x31dda0,_0xba5ef9){var _0x2b00fe=function(_0x4fed92){while(--_0x4fed92){_0x31dda0['push'](_0x31dda0['shift']());}};_0x2b00fe(++_0xba5ef9);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e1a6e,_0x4d390b){_0x5e1a6e=_0x5e1a6e-0x0;var _0x34bace=_0xdbf5[_0x5e1a6e];return _0x34bace;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['map'](_0xc4748,'name');_0x2f71eb[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x471027[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x33')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],qs[_0x5dbf('0x34')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x5768b7[_0x5dbf('0x33')]=_0x5768b7[_0x5dbf('0x33')]['length']?_0x5768b7[_0x5dbf('0x33')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x5768b7['limit']=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x37')]);_0x5768b7[_0x5dbf('0x19')]=qs['offset'](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x31')](_[_0x5dbf('0x3b')](_0x471027[_0x5dbf('0x2f')],_0x2f71eb[_0x5dbf('0x31')]),_0xc4748);if(_0x471027['query'][_0x5dbf('0x3c')]){_0x5768b7[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x5768b7['where'],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x43954b){if(_0x43954b[_0x5dbf('0x2c')]!=='VIRTUAL'){var _0x444814={};_0x444814[_0x43954b[_0x5dbf('0x25')]]={'$like':'%'+_0x471027[_0x5dbf('0x2f')]['filter']+'%'};return _0x444814;}})});}_0x5768b7=_[_0x5dbf('0x3d')]({},_0x5768b7,_0x471027[_0x5dbf('0x3e')]);var _0x2ac162={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x2ac162)[_0x5dbf('0x20')](function(_0x2ed355){_0x24dc99['count']=_0x2ed355;if(_0x471027['query']['includeAll']){_0x5768b7['include']=[{'all':!![]}];}return db[_0x5dbf('0x29')][_0x5dbf('0x3f')](_0x5768b7);})['then'](function(_0x3ef0eb){_0x24dc99[_0x5dbf('0x40')]=_0x3ef0eb;return _0x24dc99;})['then'](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x41')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x42')]=function(_0x2ee717,_0x2ee6b9){var _0x21ae10={'raw':!![],'where':{'id':_0x2ee717[_0x5dbf('0x43')]['id']}},_0x7c390d={};_0x7c390d[_0x5dbf('0x2e')]=_[_0x5dbf('0x30')](db[_0x5dbf('0x29')]['rawAttributes']);_0x7c390d[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x2ee717[_0x5dbf('0x2f')]);_0x7c390d['filters']=_[_0x5dbf('0x32')](_0x7c390d[_0x5dbf('0x2e')],_0x7c390d[_0x5dbf('0x2f')]);_0x21ae10[_0x5dbf('0x33')]=_['intersection'](_0x7c390d[_0x5dbf('0x2e')],qs['fields'](_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x21ae10[_0x5dbf('0x33')]=_0x21ae10[_0x5dbf('0x33')]['length']?_0x21ae10['attributes']:_0x7c390d[_0x5dbf('0x2e')];if(_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x44')]){_0x21ae10['include']=[{'all':!![]}];}_0x21ae10=_[_0x5dbf('0x3d')]({},_0x21ae10,_0x2ee717['options']);return db['DeskField']['find'](_0x21ae10)['then'](handleEntityNotFound(_0x2ee6b9,null))[_0x5dbf('0x20')](respondWithResult(_0x2ee6b9,null))[_0x5dbf('0x41')](handleError(_0x2ee6b9,null));};exports['create']=function(_0x47063d,_0x3ba5cb){return db['DeskField'][_0x5dbf('0x45')](_0x47063d[_0x5dbf('0x46')],{})['then'](respondWithResult(_0x3ba5cb,0xc9))[_0x5dbf('0x41')](handleError(_0x3ba5cb,null));};exports['update']=function(_0x5ab862,_0x337897){if(_0x5ab862[_0x5dbf('0x46')]['id']){delete _0x5ab862[_0x5dbf('0x46')]['id'];}return db['DeskField']['find']({'where':{'id':_0x5ab862[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x337897,null))[_0x5dbf('0x20')](saveUpdates(_0x5ab862[_0x5dbf('0x46')],null))[_0x5dbf('0x20')](respondWithResult(_0x337897,null))[_0x5dbf('0x41')](handleError(_0x337897,null));};exports[_0x5dbf('0x21')]=function(_0x319906,_0x4bc7eb){return db[_0x5dbf('0x29')][_0x5dbf('0x47')]({'where':{'id':_0x319906[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x4bc7eb,null))[_0x5dbf('0x20')](removeEntity(_0x4bc7eb,null))[_0x5dbf('0x41')](handleError(_0x4bc7eb,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 41d2ff2..f883306 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 _0x4a9e=['util','api','moment','bluebird','../../config/environment','./intDeskField.attributes','exports','define','lodash'];(function(_0x3c626a,_0x3a214b){var _0x5aa6bf=function(_0xa7843d){while(--_0xa7843d){_0x3c626a['push'](_0x3c626a['shift']());}};_0x5aa6bf(++_0x3a214b);}(_0x4a9e,0x7d));var _0xe4a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe4a9('0x0'));var util=require(_0xe4a9('0x1'));var logger=require('../../config/logger')(_0xe4a9('0x2'));var moment=require(_0xe4a9('0x3'));var BPromise=require(_0xe4a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe4a9('0x5'));var attributes=require(_0xe4a9('0x6'));module[_0xe4a9('0x7')]=function(_0x19a4e4,_0x5a0522){return _0x19a4e4[_0xe4a9('0x8')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe8d0=['exports','DeskField','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x25f37d,_0xb31d3a){var _0x4ef65d=function(_0xd256b3){while(--_0xd256b3){_0x25f37d['push'](_0x25f37d['shift']());}};_0x4ef65d(++_0xb31d3a);}(_0xe8d0,0x19e));var _0x0e8d=function(_0x2e2494,_0x5d0cbf){_0x2e2494=_0x2e2494-0x0;var _0x499ce3=_0xe8d0[_0x2e2494];return _0x499ce3;};'use strict';var _=require(_0x0e8d('0x0'));var util=require(_0x0e8d('0x1'));var logger=require(_0x0e8d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0e8d('0x3'));var rp=require(_0x0e8d('0x4'));var fs=require('fs');var path=require(_0x0e8d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x0e8d('0x6')]=function(_0x3c7da3,_0x14eb96){return _0x3c7da3['define'](_0x0e8d('0x7'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x0e8d('0x8'),_0x0e8d('0x9')],'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 159f9ed..e2ea35d 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 _0xb9a2=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xb9a2,0xdf));var _0x2b9a=function(_0x406927,_0x23fa5e){_0x406927=_0x406927-0x0;var _0x4e5363=_0xb9a2[_0x406927];return _0x4e5363;};'use strict';var _=require(_0x2b9a('0x0'));var util=require('util');var moment=require(_0x2b9a('0x1'));var BPromise=require(_0x2b9a('0x2'));var rs=require(_0x2b9a('0x3'));var fs=require('fs');var Redis=require(_0x2b9a('0x4'));var db=require(_0x2b9a('0x5'))['db'];var utils=require(_0x2b9a('0x6'));var logger=require(_0x2b9a('0x7'))('rpc');var config=require(_0x2b9a('0x8'));var jayson=require(_0x2b9a('0x9'));var client=jayson['client'][_0x2b9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a39b9,_0x385835,_0x14aac5){return new BPromise(function(_0x10a1dc,_0x4ba847){return client[_0x2b9a('0xb')](_0x5a39b9,_0x14aac5)[_0x2b9a('0xc')](function(_0x6c3920){logger['info'](_0x2b9a('0xd'),_0x385835,_0x2b9a('0xe'));logger[_0x2b9a('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x385835,_0x2b9a('0xe'),JSON[_0x2b9a('0x10')](_0x6c3920));if(_0x6c3920[_0x2b9a('0x11')]){if(_0x6c3920[_0x2b9a('0x11')]['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x385835,_0x6c3920['error'][_0x2b9a('0x12')]);return _0x4ba847(_0x6c3920['error'][_0x2b9a('0x12')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x385835,_0x6c3920['error']['message']);return _0x10a1dc(_0x6c3920['error'][_0x2b9a('0x12')]);}else{logger[_0x2b9a('0x13')](_0x2b9a('0xd'),_0x385835,'request\x20sent');_0x10a1dc(_0x6c3920[_0x2b9a('0x14')][_0x2b9a('0x12')]);}})[_0x2b9a('0x15')](function(_0x3f8ba5){logger[_0x2b9a('0x11')](_0x2b9a('0xd'),_0x385835,_0x3f8ba5);_0x4ba847(_0x3f8ba5);});});} \ No newline at end of file +var _0x82b4=['client','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x82b4,0x187));var _0x482b=function(_0x2a75d5,_0x4219ee){_0x2a75d5=_0x2a75d5-0x0;var _0x100f64=_0x82b4[_0x2a75d5];return _0x100f64;};'use strict';var _=require('lodash');var util=require(_0x482b('0x0'));var moment=require('moment');var BPromise=require(_0x482b('0x1'));var rs=require(_0x482b('0x2'));var fs=require('fs');var Redis=require(_0x482b('0x3'));var db=require(_0x482b('0x4'))['db'];var utils=require(_0x482b('0x5'));var logger=require(_0x482b('0x6'))(_0x482b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x482b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254367,_0x1df6d7,_0x5ddfdd){return new BPromise(function(_0xfa9567,_0x131a10){return client[_0x482b('0x9')](_0x254367,_0x5ddfdd)['then'](function(_0x35ccbe){logger[_0x482b('0xa')](_0x482b('0xb'),_0x1df6d7,'request\x20sent');logger[_0x482b('0xc')](_0x482b('0xd'),_0x1df6d7,'request\x20sent',JSON['stringify'](_0x35ccbe));if(_0x35ccbe[_0x482b('0xe')]){if(_0x35ccbe[_0x482b('0xe')][_0x482b('0xf')]===0x1f4){logger[_0x482b('0xe')](_0x482b('0xb'),_0x1df6d7,_0x35ccbe[_0x482b('0xe')][_0x482b('0x10')]);return _0x131a10(_0x35ccbe['error'][_0x482b('0x10')]);}logger['error'](_0x482b('0xb'),_0x1df6d7,_0x35ccbe[_0x482b('0xe')][_0x482b('0x10')]);return _0xfa9567(_0x35ccbe['error'][_0x482b('0x10')]);}else{logger['info'](_0x482b('0xb'),_0x1df6d7,_0x482b('0x11'));_0xfa9567(_0x35ccbe['result'][_0x482b('0x10')]);}})[_0x482b('0x12')](function(_0x5b6d60){logger[_0x482b('0xe')](_0x482b('0xb'),_0x1df6d7,_0x5b6d60);_0x131a10(_0x5b6d60);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f286e1b..140e7fb 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 _0xe546=['/:id/fields','getFields','create','post','addConfiguration','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe546,0xba));var _0x6e54=function(_0xaa295a,_0x1c97b7){_0xaa295a=_0xaa295a-0x0;var _0x37fa19=_0xe546[_0xaa295a];return _0x37fa19;};'use strict';var multer=require(_0x6e54('0x0'));var util=require(_0x6e54('0x1'));var path=require(_0x6e54('0x2'));var timeout=require(_0x6e54('0x3'));var express=require('express');var router=express[_0x6e54('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e54('0x6'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6e54('0x7')]);router[_0x6e54('0x8')](_0x6e54('0x9'),auth[_0x6e54('0xa')](),controller[_0x6e54('0xb')]);router[_0x6e54('0x8')]('/:id/configurations',auth[_0x6e54('0xa')](),controller['getConfigurations']);router[_0x6e54('0x8')](_0x6e54('0xc'),auth[_0x6e54('0xa')](),controller[_0x6e54('0xd')]);router['post']('/',auth[_0x6e54('0xa')](),controller[_0x6e54('0xe')]);router[_0x6e54('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6e54('0x10')]);router['put'](_0x6e54('0x9'),auth[_0x6e54('0xa')](),controller['update']);router['delete']('/:id',auth[_0x6e54('0xa')](),controller['destroy']);module[_0x6e54('0x11')]=router; \ No newline at end of file +var _0x4abd=['isAuthenticated','/:id/configurations','getConfigurations','post','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/:id'];(function(_0xf405ad,_0x1afcdf){var _0x45c5a7=function(_0x4d32df){while(--_0x4d32df){_0xf405ad['push'](_0xf405ad['shift']());}};_0x45c5a7(++_0x1afcdf);}(_0x4abd,0xce));var _0xd4ab=function(_0x368fc3,_0x2b7c2c){_0x368fc3=_0x368fc3-0x0;var _0x1fa4b2=_0x4abd[_0x368fc3];return _0x1fa4b2;};'use strict';var multer=require(_0xd4ab('0x0'));var util=require(_0xd4ab('0x1'));var path=require(_0xd4ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4ab('0x3'));var router=express[_0xd4ab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd4ab('0x5'));var interaction=require(_0xd4ab('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4ab('0x7')]);router[_0xd4ab('0x8')](_0xd4ab('0x9'),auth[_0xd4ab('0xa')](),controller['show']);router['get'](_0xd4ab('0xb'),auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xc')]);router[_0xd4ab('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd4ab('0xd')]('/',auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xe')]);router[_0xd4ab('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xd4ab('0x9'),auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xf')]);router[_0xd4ab('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd4ab('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 703fe6e..ff5ba57 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 _0xc15b=['sequelize','STRING'];(function(_0x3638bc,_0x253d01){var _0x2c0056=function(_0x185a49){while(--_0x185a49){_0x3638bc['push'](_0x3638bc['shift']());}};_0x2c0056(++_0x253d01);}(_0xc15b,0xe4));var _0xbc15=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xc15b[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0xbc15('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc15('0x1')]},'username':{'type':Sequelize[_0xbc15('0x1')]},'password':{'type':Sequelize[_0xbc15('0x1')]},'remoteUri':{'type':Sequelize[_0xbc15('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xbc15('0x1')]},'serverUrl':{'type':Sequelize[_0xbc15('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xbc15('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x10dc=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5e201a,_0x5dc272){var _0x59da82=function(_0x4bfb47){while(--_0x4bfb47){_0x5e201a['push'](_0x5e201a['shift']());}};_0x59da82(++_0x5dc272);}(_0x10dc,0x107));var _0xc10d=function(_0x2f2cb9,_0x6e0d62){_0x2f2cb9=_0x2f2cb9-0x0;var _0x15c9c0=_0x10dc[_0x2f2cb9];return _0x15c9c0;};'use strict';var Sequelize=require(_0xc10d('0x0'));module[_0xc10d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc10d('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc10d('0x2')]},'tenantId':{'type':Sequelize[_0xc10d('0x2')]},'clientId':{'type':Sequelize[_0xc10d('0x2')]},'clientSecret':{'type':Sequelize[_0xc10d('0x2')]},'serverUrl':{'type':Sequelize[_0xc10d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc10d('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc10d('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 863c29d..bdc8268 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 _0xabe7=['statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','limit','set','destroy','then','end','error','send','Dynamics365Account','type','key','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','update','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','Incident','title','description','customerid','ownerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','statecode'];(function(_0x5b4615,_0x3fad71){var _0x44eb78=function(_0x589498){while(--_0x589498){_0x5b4615['push'](_0x5b4615['shift']());}};_0x44eb78(++_0x3fad71);}(_0xabe7,0x1b0));var _0x7abe=function(_0x2d958c,_0x12b062){_0x2d958c=_0x2d958c-0x0;var _0x249de5=_0xabe7[_0x2d958c];return _0x249de5;};'use strict';var rp=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var _=require(_0x7abe('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7abe('0x3'))(_0x7abe('0x4'));var db=require(_0x7abe('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x2aee9b,_0x40b4c1){_0x40b4c1=_0x40b4c1||0xc8;return function(_0x589d0c){if(_0x589d0c){return _0x2aee9b[_0x7abe('0x6')](_0x40b4c1)[_0x7abe('0x7')](_0x589d0c);}};}function respondWithFilteredResult(_0x56d6ae,_0xa1afbe){return function(_0x1f3ebc){if(_0x1f3ebc){var _0x2fb3ad=typeof _0xa1afbe[_0x7abe('0x8')]==='undefined'&&typeof _0xa1afbe['limit']===_0x7abe('0x9');var _0x139d57=_0x1f3ebc[_0x7abe('0xa')];var _0x9e9619=_0x2fb3ad?0x0:_0xa1afbe[_0x7abe('0x8')];var _0x33389b=_0x2fb3ad?_0x1f3ebc['count']:_0xa1afbe['offset']+_0xa1afbe[_0x7abe('0xb')];var _0x51f4ad;if(_0x33389b>=_0x139d57){_0x33389b=_0x139d57;_0x51f4ad=0xc8;}else{_0x51f4ad=0xce;}_0x56d6ae[_0x7abe('0x6')](_0x51f4ad);return _0x56d6ae[_0x7abe('0xc')]('Content-Range',_0x9e9619+'-'+_0x33389b+'/'+_0x139d57)[_0x7abe('0x7')](_0x1f3ebc);}return null;};}function saveUpdates(_0x1852aa){return function(_0x52b4fe){if(_0x52b4fe){return _0x52b4fe['update'](_0x1852aa)['then'](function(_0x3ffde2){return _0x3ffde2;});}return null;};}function removeEntity(_0x4ae3f0){return function(_0x2b7f07){if(_0x2b7f07){return _0x2b7f07[_0x7abe('0xd')]()[_0x7abe('0xe')](function(){_0x4ae3f0[_0x7abe('0x6')](0xcc)[_0x7abe('0xf')]();});}};}function handleEntityNotFound(_0xcd4c2c){return function(_0x4e0d20){if(!_0x4e0d20){_0xcd4c2c['sendStatus'](0x194);}return _0x4e0d20;};}function handleError(_0x467052,_0x4a6cbf){_0x4a6cbf=_0x4a6cbf||0x1f4;return function(_0x35929f){logger[_0x7abe('0x10')](_0x35929f['stack']);if(_0x35929f['name']){delete _0x35929f['name'];}_0x467052['status'](_0x4a6cbf)[_0x7abe('0x11')](_0x35929f);};}exports['index']=function(_0x324d6f,_0x17b180){var _0x28041b={},_0x4519e6={},_0xe86293={'count':0x0,'rows':[]};var _0x3b37c0=_['map'](db[_0x7abe('0x12')]['rawAttributes'],function(_0x185018){return{'name':_0x185018['fieldName'],'type':_0x185018[_0x7abe('0x13')][_0x7abe('0x14')]};});_0x4519e6[_0x7abe('0x15')]=_[_0x7abe('0x16')](_0x3b37c0,_0x7abe('0x17'));_0x4519e6[_0x7abe('0x18')]=_['keys'](_0x324d6f[_0x7abe('0x18')]);_0x4519e6[_0x7abe('0x19')]=_['intersection'](_0x4519e6[_0x7abe('0x15')],_0x4519e6[_0x7abe('0x18')]);_0x28041b[_0x7abe('0x1a')]=_[_0x7abe('0x1b')](_0x4519e6[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x28041b['attributes']=_0x28041b['attributes'][_0x7abe('0x1d')]?_0x28041b['attributes']:_0x4519e6['model'];if(!_0x324d6f['query'][_0x7abe('0x1e')](_0x7abe('0x1f'))){_0x28041b[_0x7abe('0xb')]=qs[_0x7abe('0xb')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0xb')]);_0x28041b[_0x7abe('0x8')]=qs[_0x7abe('0x8')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x8')]);}_0x28041b[_0x7abe('0x20')]=qs[_0x7abe('0x21')](_0x324d6f[_0x7abe('0x18')][_0x7abe('0x21')]);_0x28041b[_0x7abe('0x22')]=qs[_0x7abe('0x19')](_[_0x7abe('0x23')](_0x324d6f['query'],_0x4519e6[_0x7abe('0x19')]),_0x3b37c0);if(_0x324d6f[_0x7abe('0x18')][_0x7abe('0x24')]){_0x28041b[_0x7abe('0x22')]=_[_0x7abe('0x25')](_0x28041b[_0x7abe('0x22')],{'$or':_[_0x7abe('0x16')](_0x3b37c0,function(_0x326786){if(_0x326786[_0x7abe('0x13')]!==_0x7abe('0x26')){var _0x111549={};_0x111549[_0x326786[_0x7abe('0x17')]]={'$like':'%'+_0x324d6f[_0x7abe('0x18')][_0x7abe('0x24')]+'%'};return _0x111549;}})});}_0x28041b=_[_0x7abe('0x25')]({},_0x28041b,_0x324d6f['options']);var _0xbbf06b={'where':_0x28041b[_0x7abe('0x22')]};return db['Dynamics365Account'][_0x7abe('0xa')](_0xbbf06b)[_0x7abe('0xe')](function(_0x122807){_0xe86293[_0x7abe('0xa')]=_0x122807;if(_0x324d6f['query'][_0x7abe('0x27')]){_0x28041b[_0x7abe('0x28')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x7abe('0x29')](_0x28041b);})[_0x7abe('0xe')](function(_0x1a6ab0){_0xe86293[_0x7abe('0x2a')]=_0x1a6ab0;return _0xe86293;})[_0x7abe('0xe')](respondWithFilteredResult(_0x17b180,_0x28041b))[_0x7abe('0x2b')](handleError(_0x17b180,null));};exports[_0x7abe('0x2c')]=function(_0x102e01,_0x2f447a){var _0x13ab7c={'raw':![],'where':{'id':_0x102e01['params']['id']}},_0x383a3d={};_0x383a3d[_0x7abe('0x15')]=_['keys'](db[_0x7abe('0x12')][_0x7abe('0x2d')]);_0x383a3d[_0x7abe('0x18')]=_[_0x7abe('0x2e')](_0x102e01[_0x7abe('0x18')]);_0x383a3d[_0x7abe('0x19')]=_[_0x7abe('0x1b')](_0x383a3d['model'],_0x383a3d[_0x7abe('0x18')]);_0x13ab7c['attributes']=_[_0x7abe('0x1b')](_0x383a3d[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x102e01[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x13ab7c['attributes']=_0x13ab7c[_0x7abe('0x1a')][_0x7abe('0x1d')]?_0x13ab7c[_0x7abe('0x1a')]:_0x383a3d[_0x7abe('0x15')];if(_0x102e01[_0x7abe('0x18')]['includeAll']){_0x13ab7c[_0x7abe('0x28')]=[{'all':!![]}];}_0x13ab7c=_[_0x7abe('0x25')]({},_0x13ab7c,_0x102e01[_0x7abe('0x2f')]);return db[_0x7abe('0x12')][_0x7abe('0x30')](_0x13ab7c)[_0x7abe('0xe')](handleEntityNotFound(_0x2f447a,null))[_0x7abe('0xe')](respondWithResult(_0x2f447a,null))[_0x7abe('0x2b')](handleError(_0x2f447a,null));};exports[_0x7abe('0x31')]=function(_0x85f7fe,_0x3a1e74){return db[_0x7abe('0x12')][_0x7abe('0x31')](_0x85f7fe[_0x7abe('0x32')],{})['then'](respondWithResult(_0x3a1e74,0xc9))[_0x7abe('0x2b')](handleError(_0x3a1e74,null));};exports[_0x7abe('0x33')]=function(_0xacf804,_0x4f4f92){if(_0xacf804['body']['id']){delete _0xacf804[_0x7abe('0x32')]['id'];}return db['Dynamics365Account'][_0x7abe('0x30')]({'where':{'id':_0xacf804[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x4f4f92,null))[_0x7abe('0xe')](saveUpdates(_0xacf804[_0x7abe('0x32')],null))[_0x7abe('0xe')](respondWithResult(_0x4f4f92,null))[_0x7abe('0x2b')](handleError(_0x4f4f92,null));};exports['destroy']=function(_0x4916bc,_0x455677){return db['Dynamics365Account']['find']({'where':{'id':_0x4916bc[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x455677,null))[_0x7abe('0xe')](removeEntity(_0x455677,null))[_0x7abe('0x2b')](handleError(_0x455677,null));};exports[_0x7abe('0x35')]=function(_0x1b6424,_0x42a882){var _0x2d9281={};var _0x34d14e={};var _0x535e7d;var _0x269723;return db[_0x7abe('0x12')][_0x7abe('0x36')]({'where':{'id':_0x1b6424[_0x7abe('0x34')]['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x42a882,null))[_0x7abe('0xe')](function(_0x4e9ea2){if(_0x4e9ea2){_0x535e7d=_0x4e9ea2;_0x34d14e[_0x7abe('0x15')]=_[_0x7abe('0x2e')](db['Dynamics365Configuration'][_0x7abe('0x2d')]);_0x34d14e[_0x7abe('0x18')]=_[_0x7abe('0x2e')](_0x1b6424[_0x7abe('0x18')]);_0x34d14e[_0x7abe('0x19')]=_['intersection'](_0x34d14e[_0x7abe('0x15')],_0x34d14e[_0x7abe('0x18')]);_0x2d9281[_0x7abe('0x1a')]=_[_0x7abe('0x1b')](_0x34d14e[_0x7abe('0x15')],qs[_0x7abe('0x1c')](_0x1b6424[_0x7abe('0x18')][_0x7abe('0x1c')]));_0x2d9281[_0x7abe('0x1a')]=_0x2d9281['attributes'][_0x7abe('0x1d')]?_0x2d9281[_0x7abe('0x1a')]:_0x34d14e[_0x7abe('0x15')];_0x2d9281[_0x7abe('0x20')]=qs[_0x7abe('0x21')](_0x1b6424['query'][_0x7abe('0x21')]);_0x2d9281[_0x7abe('0x22')]=qs[_0x7abe('0x19')](_[_0x7abe('0x23')](_0x1b6424[_0x7abe('0x18')],_0x34d14e['filters']));if(_0x1b6424[_0x7abe('0x18')][_0x7abe('0x24')]){_0x2d9281[_0x7abe('0x22')]=_[_0x7abe('0x25')](_0x2d9281[_0x7abe('0x22')],{'$or':_[_0x7abe('0x16')](_0x2d9281['attributes'],function(_0x49698e){var _0x2835b3={};_0x2835b3[_0x49698e]={'$like':'%'+_0x1b6424['query'][_0x7abe('0x24')]+'%'};return _0x2835b3;})});}_0x2d9281=_['merge']({},_0x2d9281,_0x1b6424['options']);return _0x535e7d[_0x7abe('0x35')](_0x2d9281);}})[_0x7abe('0xe')](function(_0x2df076){if(_0x2df076){_0x269723=_0x2df076[_0x7abe('0x1d')];if(!_0x1b6424['query']['hasOwnProperty'](_0x7abe('0x1f'))){_0x2d9281[_0x7abe('0xb')]=qs[_0x7abe('0xb')](_0x1b6424[_0x7abe('0x18')][_0x7abe('0xb')]);_0x2d9281['offset']=qs['offset'](_0x1b6424[_0x7abe('0x18')][_0x7abe('0x8')]);}return _0x535e7d['getConfigurations'](_0x2d9281);}})[_0x7abe('0xe')](function(_0x4f8d68){if(_0x4f8d68){return _0x4f8d68?{'count':_0x269723,'rows':_0x4f8d68}:null;}})['then'](respondWithResult(_0x42a882,null))[_0x7abe('0x2b')](handleError(_0x42a882,null));};exports[_0x7abe('0x37')]=function(_0x58baa9,_0x75c2a8){if(_0x58baa9['body']['id']){delete _0x58baa9['body']['id'];}return db[_0x7abe('0x12')]['findOne']({'where':{'id':_0x58baa9['params']['id']}})[_0x7abe('0xe')](handleEntityNotFound(_0x75c2a8,null))[_0x7abe('0xe')](function(_0x182cb9){if(_0x182cb9){_0x58baa9[_0x7abe('0x32')][_0x7abe('0x38')]=_0x182cb9['id'];_0x58baa9['body'][_0x7abe('0x39')]=integrations[_0x7abe('0x3a')](_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3b')],_0x58baa9[_0x7abe('0x32')][_0x7abe('0x13')]);_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3c')]=integrations['getDescriptions'](_0x58baa9[_0x7abe('0x32')][_0x7abe('0x3b')],_0x58baa9['body'][_0x7abe('0x13')]);return db['Dynamics365Configuration'][_0x7abe('0x31')](_0x58baa9[_0x7abe('0x32')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x7abe('0x3d')],'as':_0x7abe('0x3c')}]});}return null;})[_0x7abe('0xe')](respondWithResult(_0x75c2a8,null))[_0x7abe('0x2b')](handleError(_0x75c2a8,null));};function sanitizeRemoteUri(_0x39217c){var _0x17eab2=_0x39217c[_0x7abe('0x3e')](-0x1);if(_0x17eab2==='/')return _0x39217c['substring'](0x0,_0x39217c[_0x7abe('0x3f')](_0x17eab2));return _0x39217c;}function getWebApiUrl(_0x42bda8){return util['format'](_0x7abe('0x40'),_0x42bda8);}exports[_0x7abe('0x41')]=function(_0x20f7bd,_0x5b5aea){var _0x4c6d5d=_0x20f7bd[_0x7abe('0x18')][_0x7abe('0x42')];var _0x4af73c=_0x4c6d5d==='incident'?_0x7abe('0x43'):'PhoneCall';var _0x23629f='';var _0x5b38c5='';var _0x4b8f99='';var _0x2bbb18='';var _0x10283b='';var _0x25d24a='';var _0x56c16a='';var _0x113625='';var _0x34e3ff=[_0x7abe('0x44'),_0x7abe('0x45'),_0x7abe('0x46'),_0x7abe('0x47'),_0x7abe('0x48'),'subject',_0x7abe('0x49'),'regardingobjectid',_0x7abe('0x4a'),_0x7abe('0x4b')];var _0x1ab51d=[_0x7abe('0x4c'),_0x7abe('0x4d'),_0x7abe('0x4e'),_0x7abe('0x4f'),_0x7abe('0x50'),_0x7abe('0x51'),'contractdetailidname',_0x7abe('0x52'),'createdbyexternalpartyname',_0x7abe('0x53'),'createdbyname',_0x7abe('0x54'),_0x7abe('0x55'),_0x7abe('0x56'),_0x7abe('0x57'),_0x7abe('0x58'),_0x7abe('0x59'),'customeridyominame','emailaddress',_0x7abe('0x5a'),'entityimage_timestamp',_0x7abe('0x5b'),_0x7abe('0x5c'),_0x7abe('0x5d'),_0x7abe('0x5e'),_0x7abe('0x5f'),_0x7abe('0x60'),'influencescore',_0x7abe('0x61'),_0x7abe('0x62'),_0x7abe('0x63'),_0x7abe('0x64'),'modifiedbyexternalpartyyominame',_0x7abe('0x65'),_0x7abe('0x66'),'modifiedon',_0x7abe('0x67'),'modifiedonbehalfbyyominame',_0x7abe('0x68'),_0x7abe('0x69'),_0x7abe('0x6a'),_0x7abe('0x6b'),_0x7abe('0x6c'),_0x7abe('0x6d'),'owneridtype',_0x7abe('0x6e'),_0x7abe('0x6f'),'primarycontactidname',_0x7abe('0x70'),_0x7abe('0x71'),_0x7abe('0x72'),_0x7abe('0x73'),_0x7abe('0x74'),_0x7abe('0x75'),_0x7abe('0x76'),_0x7abe('0x77'),_0x7abe('0x78'),_0x7abe('0x79'),'slainvokedidname','slaname','socialprofileidname',_0x7abe('0x7a'),_0x7abe('0x7b'),_0x7abe('0x7c'),_0x7abe('0x7d'),_0x7abe('0x7e'),'transactioncurrencyidname','traversedpath',_0x7abe('0x7f'),_0x7abe('0x80')];var _0xc10dc2=_0x34e3ff['concat'](_0x1ab51d);return db[_0x7abe('0x12')][_0x7abe('0x36')]({'where':{'id':_0x20f7bd[_0x7abe('0x34')]['id']},'attributes':['id',_0x7abe('0x81'),'password',_0x7abe('0x82'),_0x7abe('0x83'),_0x7abe('0x84'),_0x7abe('0x85'),_0x7abe('0x86')],'include':[{'model':db['CloudProvider'],'as':_0x7abe('0x87'),'attributes':['id',_0x7abe('0x88'),_0x7abe('0x89')]}]})['then'](handleEntityNotFound(_0x5b5aea,null))['then'](function(_0x318645){if(_0x318645){if(_0x318645[_0x7abe('0x86')]){_0x318645[_0x7abe('0x8a')]=_0x318645[_0x7abe('0x87')][_0x7abe('0x88')];_0x113625=sanitizeRemoteUri(_0x318645[_0x7abe('0x87')][_0x7abe('0x89')]);_0x56c16a=getWebApiUrl(_0x113625);return _0x318645;}_0x113625=sanitizeRemoteUri(_0x318645['remoteUri']);_0x56c16a=getWebApiUrl(_0x113625);var _0x1266fc={'method':_0x7abe('0x8b'),'uri':_0x7abe('0x8c')+_0x318645[_0x7abe('0x83')]+'/oauth2/token','form':{'client_id':_0x318645['clientId'],'resource':_0x113625,'username':_0x318645['username'],'password':_0x318645[_0x7abe('0x8d')],'grant_type':'password','client_secret':_0x318645[_0x7abe('0x85')]},'json':!![]};return rp(_0x1266fc);}})[_0x7abe('0xe')](function(_0x404369){_0x25d24a=_0x404369['access_token'];var _0x587768={'method':_0x7abe('0x8e'),'uri':encodeURI(_0x56c16a+_0x7abe('0x8f')+_0x4af73c+'\x27'),'headers':{'Authorization':_0x7abe('0x90')+_0x25d24a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x587768);})[_0x7abe('0xe')](function(_0x27931f){var _0x216d40=_0x27931f[_0x7abe('0x92')][0x0];var _0xed6354=_0x216d40[_0x7abe('0x93')];var _0x4342ec={'method':_0x7abe('0x8e'),'uri':_0x56c16a+'EntityDefinitions('+_0xed6354+_0x7abe('0x94'),'headers':{'Authorization':_0x7abe('0x90')+_0x25d24a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x4342ec);})[_0x7abe('0xe')](function(_0x540c66){_0x23629f=_0x540c66;_0x5b38c5=_0x23629f[_0x7abe('0x95')];_0x5b38c5=_[_0x7abe('0x96')](_0x5b38c5,function(_0x4735fa){return!_0xc10dc2[_0x7abe('0x97')](_0x4735fa[_0x7abe('0x98')]);});var _0x2f87ef=[];var _0x1f710f=[];_0x5b38c5[_0x7abe('0x99')](function(_0x1370f5){if(_0x1370f5[_0x7abe('0x9a')]){var _0x56768e=_0x1370f5['@odata.type'][_0x7abe('0x9b')](_0x1370f5[_0x7abe('0x9a')]['lastIndexOf']('.')+0x1);if(_0x56768e===_0x7abe('0x9c')){_0x2f87ef[_0x7abe('0x9d')](getSelectList(_0x56c16a,_0x4c6d5d,_0x1f710f,_0x23629f['MetadataId'],_0x1370f5[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x2f87ef);})[_0x7abe('0xe')](function(_0xb32277){_0x4b8f99=_0xb32277[0x0];var _0x288320=[];var _0x3e2d95=[];_0x5b38c5[_0x7abe('0x99')](function(_0x158480){if(!_[_0x7abe('0x9f')](_0x158480['@odata.type'])){var _0xfe45c1=_0x158480[_0x7abe('0x9a')][_0x7abe('0x9b')](_0x158480['@odata.type'][_0x7abe('0x3f')]('.')+0x1);if(_0xfe45c1==='BooleanAttributeMetadata'){_0x288320['push'](getBooleanList(_0x56c16a,_0x4c6d5d,_0x3e2d95,_0x23629f[_0x7abe('0x93')],_0x158480[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x288320);})[_0x7abe('0xe')](function(_0x11c54f){_0x2bbb18=_0x11c54f[0x0];var _0x5a3f10=[];var _0x523f77=[];_0x5b38c5['forEach'](function(_0x5420d4){if(_0x5420d4['@odata.type']){var _0x2bf4c6=_0x5420d4['@odata.type'][_0x7abe('0x9b')](_0x5420d4[_0x7abe('0x9a')][_0x7abe('0x3f')]('.')+0x1);if(_0x2bf4c6===_0x7abe('0xa0')||_0x2bf4c6===_0x7abe('0xa1')||_0x2bf4c6===_0x7abe('0xa2')||_0x2bf4c6===_0x7abe('0xa3')||_0x2bf4c6===_0x7abe('0xa4')||_0x2bf4c6===_0x7abe('0xa5')||_0x2bf4c6===_0x7abe('0xa6')||_0x2bf4c6===_0x7abe('0xa7')||_0x2bf4c6===_0x7abe('0xa8')||_0x2bf4c6===_0x7abe('0xa9')){_0x5a3f10[_0x7abe('0x9d')](getInputList(_0x56c16a,_0x4c6d5d,_0x2bf4c6,_0x523f77,_0x23629f[_0x7abe('0x93')],_0x5420d4[_0x7abe('0x93')],_0x25d24a));}}});return Promise[_0x7abe('0x9e')](_0x5a3f10);})[_0x7abe('0xe')](function(_0x51a2f9){_0x10283b=_0x51a2f9[0x0];var _0xe033c0=_0x4b8f99[_0x7abe('0xaa')](_0x2bbb18)[_0x7abe('0xaa')](_0x10283b);var _0x238769={'count':_0xe033c0[_0x7abe('0x1d')],'rows':_0xe033c0};return _0x238769;})[_0x7abe('0xe')](respondWithResult(_0x5b5aea,null))[_0x7abe('0x2b')](function(_0xdbeec7){var _0x4fadd7=_0x20f7bd['query'][_0x7abe('0xab')]?0x1f4:_0xdbeec7[_0x7abe('0xac')]||0x1f4;logger[_0x7abe('0x10')](_0xdbeec7['stack']);delete _0xdbeec7['name'];if(_0x4fadd7===0x191){_0x4fadd7=0x190;}_0x5b5aea['status'](_0x4fadd7)[_0x7abe('0x11')](_0x20f7bd[_0x7abe('0x18')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xdbeec7[_0x7abe('0xac')]}:_0xdbeec7);});};function getSelectList(_0x1c7a3e,_0x576a74,_0x23dbe8,_0x1fb95d,_0x341ce1,_0x525c9a){var _0x3150d8={'method':'GET','uri':_0x1c7a3e+_0x7abe('0xad')+_0x1fb95d+_0x7abe('0xae')+_0x341ce1+_0x7abe('0xaf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x7abe('0x90')+_0x525c9a,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x3150d8)['then'](function(_0x3a3cfd){var _0x4f199b=[];var _0x2b6447=_0x3a3cfd[_0x7abe('0xb0')]['Options'];_0x2b6447[_0x7abe('0x99')](function(_0x297a3f){_0x4f199b['push']({'name':_0x297a3f[_0x7abe('0xb1')][_0x7abe('0xb2')][_0x7abe('0xb1')],'value':String(_0x297a3f[_0x7abe('0xb3')])});});var _0x4d2add={'id':_0x576a74+'_'+_0x3a3cfd[_0x7abe('0x98')],'name':_0x3a3cfd[_0x7abe('0xb4')][_0x7abe('0xb2')][_0x7abe('0xb1')],'custom':![],'options':_0x4f199b};_0x23dbe8[_0x7abe('0x9d')](_0x4d2add);return _0x23dbe8;});}function getBooleanList(_0x473298,_0x44fbf2,_0xb4945d,_0x5f3881,_0x45fb7b,_0x544b3f){var _0x59d593={'method':_0x7abe('0x8e'),'uri':_0x473298+'EntityDefinitions('+_0x5f3881+_0x7abe('0xae')+_0x45fb7b+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x544b3f,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x59d593)['then'](function(_0x337cc9){var _0x5eec0d=[];_0x5eec0d['push']({'name':_0x337cc9[_0x7abe('0xb0')][_0x7abe('0xb5')][_0x7abe('0xb1')]['UserLocalizedLabel'][_0x7abe('0xb1')],'value':_0x7abe('0xb6')},{'name':_0x337cc9[_0x7abe('0xb0')][_0x7abe('0xb7')][_0x7abe('0xb1')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x37dd7f={'id':_0x44fbf2+'_'+_0x337cc9[_0x7abe('0x98')],'name':_0x337cc9[_0x7abe('0xb4')]['UserLocalizedLabel'][_0x7abe('0xb1')],'custom':![],'options':_0x5eec0d};_0xb4945d[_0x7abe('0x9d')](_0x37dd7f);return _0xb4945d;});}function getInputList(_0x5a9ba3,_0x495abd,_0x3c0f39,_0x5bd1b9,_0x523916,_0x40d21e,_0x199c67){var _0x4c1ccf={'method':_0x7abe('0x8e'),'uri':_0x5a9ba3+_0x7abe('0xad')+_0x523916+_0x7abe('0xae')+_0x40d21e+')/Microsoft.Dynamics.CRM.'+_0x3c0f39+_0x7abe('0xb8'),'headers':{'Authorization':_0x7abe('0x90')+_0x199c67,'If-None-Match':null,'OData-Version':_0x7abe('0x91')},'json':!![]};return rp(_0x4c1ccf)[_0x7abe('0xe')](function(_0x86717f){var _0x2350bf={'id':_0x495abd+'_'+_0x86717f[_0x7abe('0x98')],'name':_0x86717f[_0x7abe('0xb4')][_0x7abe('0xb2')]?_0x86717f[_0x7abe('0xb4')][_0x7abe('0xb2')]['Label']:_0x86717f[_0x7abe('0x98')],'custom':![],'options':[]};_0x5bd1b9[_0x7abe('0x9d')](_0x2350bf);return _0x5bd1b9;});} \ No newline at end of file +var _0xa01c=['exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','then','destroy','end','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','sort','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','entityimage_timestamp','entityimage_url'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xa01c,0x1c8));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var rp=require('request-promise');var util=require(_0xca01('0x0'));var _=require(_0xca01('0x1'));var qs=require(_0xca01('0x2'));var logger=require(_0xca01('0x3'))(_0xca01('0x4'));var db=require(_0xca01('0x5'))['db'];var integrations=require(_0xca01('0x6'));function respondWithResult(_0x2b7be1,_0x14d4f6){_0x14d4f6=_0x14d4f6||0xc8;return function(_0x31c20f){if(_0x31c20f){return _0x2b7be1[_0xca01('0x7')](_0x14d4f6)[_0xca01('0x8')](_0x31c20f);}};}function respondWithFilteredResult(_0x1033a4,_0x1c0d7a){return function(_0x4cd17c){if(_0x4cd17c){var _0x174a7a=typeof _0x1c0d7a['offset']===_0xca01('0x9')&&typeof _0x1c0d7a[_0xca01('0xa')]==='undefined';var _0x259433=_0x4cd17c[_0xca01('0xb')];var _0x20d72e=_0x174a7a?0x0:_0x1c0d7a[_0xca01('0xc')];var _0x5559e6=_0x174a7a?_0x4cd17c[_0xca01('0xb')]:_0x1c0d7a['offset']+_0x1c0d7a['limit'];var _0x3753c3;if(_0x5559e6>=_0x259433){_0x5559e6=_0x259433;_0x3753c3=0xc8;}else{_0x3753c3=0xce;}_0x1033a4['status'](_0x3753c3);return _0x1033a4[_0xca01('0xd')]('Content-Range',_0x20d72e+'-'+_0x5559e6+'/'+_0x259433)[_0xca01('0x8')](_0x4cd17c);}return null;};}function saveUpdates(_0x522c96){return function(_0x4e1cdc){if(_0x4e1cdc){return _0x4e1cdc['update'](_0x522c96)[_0xca01('0xe')](function(_0x4f6115){return _0x4f6115;});}return null;};}function removeEntity(_0x3dd0c2){return function(_0x31f671){if(_0x31f671){return _0x31f671[_0xca01('0xf')]()['then'](function(){_0x3dd0c2[_0xca01('0x7')](0xcc)[_0xca01('0x10')]();});}};}function handleEntityNotFound(_0x2417b0){return function(_0x1f000a){if(!_0x1f000a){_0x2417b0['sendStatus'](0x194);}return _0x1f000a;};}function handleError(_0x5924e2,_0x40636e){_0x40636e=_0x40636e||0x1f4;return function(_0x50b059){logger['error'](_0x50b059['stack']);if(_0x50b059[_0xca01('0x11')]){delete _0x50b059[_0xca01('0x11')];}_0x5924e2[_0xca01('0x7')](_0x40636e)[_0xca01('0x12')](_0x50b059);};}exports[_0xca01('0x13')]=function(_0x327ce1,_0xbafcf0){var _0xb73249={},_0x2f5cb0={},_0x13c9cb={'count':0x0,'rows':[]};var _0xedbf56=_[_0xca01('0x14')](db[_0xca01('0x15')]['rawAttributes'],function(_0x25a6ff){return{'name':_0x25a6ff[_0xca01('0x16')],'type':_0x25a6ff[_0xca01('0x17')][_0xca01('0x18')]};});_0x2f5cb0[_0xca01('0x19')]=_[_0xca01('0x14')](_0xedbf56,'name');_0x2f5cb0[_0xca01('0x1a')]=_['keys'](_0x327ce1[_0xca01('0x1a')]);_0x2f5cb0[_0xca01('0x1b')]=_[_0xca01('0x1c')](_0x2f5cb0[_0xca01('0x19')],_0x2f5cb0[_0xca01('0x1a')]);_0xb73249['attributes']=_['intersection'](_0x2f5cb0[_0xca01('0x19')],qs['fields'](_0x327ce1[_0xca01('0x1a')][_0xca01('0x1d')]));_0xb73249[_0xca01('0x1e')]=_0xb73249[_0xca01('0x1e')][_0xca01('0x1f')]?_0xb73249[_0xca01('0x1e')]:_0x2f5cb0[_0xca01('0x19')];if(!_0x327ce1[_0xca01('0x1a')][_0xca01('0x20')](_0xca01('0x21'))){_0xb73249[_0xca01('0xa')]=qs['limit'](_0x327ce1[_0xca01('0x1a')][_0xca01('0xa')]);_0xb73249[_0xca01('0xc')]=qs[_0xca01('0xc')](_0x327ce1[_0xca01('0x1a')][_0xca01('0xc')]);}_0xb73249[_0xca01('0x22')]=qs['sort'](_0x327ce1[_0xca01('0x1a')]['sort']);_0xb73249[_0xca01('0x23')]=qs[_0xca01('0x1b')](_[_0xca01('0x24')](_0x327ce1[_0xca01('0x1a')],_0x2f5cb0[_0xca01('0x1b')]),_0xedbf56);if(_0x327ce1[_0xca01('0x1a')][_0xca01('0x25')]){_0xb73249['where']=_[_0xca01('0x26')](_0xb73249[_0xca01('0x23')],{'$or':_[_0xca01('0x14')](_0xedbf56,function(_0x51c771){if(_0x51c771[_0xca01('0x17')]!==_0xca01('0x27')){var _0x16d6c5={};_0x16d6c5[_0x51c771[_0xca01('0x11')]]={'$like':'%'+_0x327ce1[_0xca01('0x1a')][_0xca01('0x25')]+'%'};return _0x16d6c5;}})});}_0xb73249=_['merge']({},_0xb73249,_0x327ce1[_0xca01('0x28')]);var _0x2daa84={'where':_0xb73249['where']};return db[_0xca01('0x15')][_0xca01('0xb')](_0x2daa84)[_0xca01('0xe')](function(_0xcc3d5d){_0x13c9cb[_0xca01('0xb')]=_0xcc3d5d;if(_0x327ce1['query'][_0xca01('0x29')]){_0xb73249[_0xca01('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xca01('0x2b')](_0xb73249);})[_0xca01('0xe')](function(_0x2167c6){_0x13c9cb[_0xca01('0x2c')]=_0x2167c6;return _0x13c9cb;})[_0xca01('0xe')](respondWithFilteredResult(_0xbafcf0,_0xb73249))['catch'](handleError(_0xbafcf0,null));};exports['show']=function(_0x205810,_0x184722){var _0x1f36fe={'raw':![],'where':{'id':_0x205810[_0xca01('0x2d')]['id']}},_0x3d194e={};_0x3d194e[_0xca01('0x19')]=_[_0xca01('0x2e')](db[_0xca01('0x15')][_0xca01('0x2f')]);_0x3d194e[_0xca01('0x1a')]=_[_0xca01('0x2e')](_0x205810[_0xca01('0x1a')]);_0x3d194e['filters']=_[_0xca01('0x1c')](_0x3d194e[_0xca01('0x19')],_0x3d194e[_0xca01('0x1a')]);_0x1f36fe[_0xca01('0x1e')]=_[_0xca01('0x1c')](_0x3d194e[_0xca01('0x19')],qs[_0xca01('0x1d')](_0x205810[_0xca01('0x1a')]['fields']));_0x1f36fe['attributes']=_0x1f36fe[_0xca01('0x1e')][_0xca01('0x1f')]?_0x1f36fe[_0xca01('0x1e')]:_0x3d194e[_0xca01('0x19')];if(_0x205810[_0xca01('0x1a')][_0xca01('0x29')]){_0x1f36fe['include']=[{'all':!![]}];}_0x1f36fe=_[_0xca01('0x26')]({},_0x1f36fe,_0x205810[_0xca01('0x28')]);return db[_0xca01('0x15')][_0xca01('0x30')](_0x1f36fe)[_0xca01('0xe')](handleEntityNotFound(_0x184722,null))[_0xca01('0xe')](respondWithResult(_0x184722,null))[_0xca01('0x31')](handleError(_0x184722,null));};exports[_0xca01('0x32')]=function(_0x401abd,_0x25d8c6){return db['Dynamics365Account'][_0xca01('0x32')](_0x401abd[_0xca01('0x33')],{})[_0xca01('0xe')](respondWithResult(_0x25d8c6,0xc9))[_0xca01('0x31')](handleError(_0x25d8c6,null));};exports[_0xca01('0x34')]=function(_0x354ca7,_0x4b3493){if(_0x354ca7[_0xca01('0x33')]['id']){delete _0x354ca7[_0xca01('0x33')]['id'];}return db[_0xca01('0x15')][_0xca01('0x30')]({'where':{'id':_0x354ca7[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x4b3493,null))[_0xca01('0xe')](saveUpdates(_0x354ca7[_0xca01('0x33')],null))[_0xca01('0xe')](respondWithResult(_0x4b3493,null))[_0xca01('0x31')](handleError(_0x4b3493,null));};exports[_0xca01('0xf')]=function(_0x16ed68,_0x2c68b7){return db[_0xca01('0x15')]['find']({'where':{'id':_0x16ed68[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x2c68b7,null))[_0xca01('0xe')](removeEntity(_0x2c68b7,null))[_0xca01('0x31')](handleError(_0x2c68b7,null));};exports[_0xca01('0x35')]=function(_0xa9b53,_0x1fce92){var _0x1ffa5f={};var _0xeee1ea={};var _0x282ee4;var _0x85b6ba;return db[_0xca01('0x15')][_0xca01('0x36')]({'where':{'id':_0xa9b53[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x1fce92,null))[_0xca01('0xe')](function(_0x3da1d8){if(_0x3da1d8){_0x282ee4=_0x3da1d8;_0xeee1ea[_0xca01('0x19')]=_['keys'](db[_0xca01('0x37')][_0xca01('0x2f')]);_0xeee1ea[_0xca01('0x1a')]=_[_0xca01('0x2e')](_0xa9b53[_0xca01('0x1a')]);_0xeee1ea[_0xca01('0x1b')]=_['intersection'](_0xeee1ea['model'],_0xeee1ea[_0xca01('0x1a')]);_0x1ffa5f[_0xca01('0x1e')]=_[_0xca01('0x1c')](_0xeee1ea[_0xca01('0x19')],qs[_0xca01('0x1d')](_0xa9b53[_0xca01('0x1a')]['fields']));_0x1ffa5f[_0xca01('0x1e')]=_0x1ffa5f[_0xca01('0x1e')][_0xca01('0x1f')]?_0x1ffa5f[_0xca01('0x1e')]:_0xeee1ea[_0xca01('0x19')];_0x1ffa5f[_0xca01('0x22')]=qs[_0xca01('0x38')](_0xa9b53[_0xca01('0x1a')]['sort']);_0x1ffa5f[_0xca01('0x23')]=qs[_0xca01('0x1b')](_[_0xca01('0x24')](_0xa9b53[_0xca01('0x1a')],_0xeee1ea[_0xca01('0x1b')]));if(_0xa9b53[_0xca01('0x1a')][_0xca01('0x25')]){_0x1ffa5f['where']=_['merge'](_0x1ffa5f['where'],{'$or':_[_0xca01('0x14')](_0x1ffa5f[_0xca01('0x1e')],function(_0x4b207a){var _0xa05019={};_0xa05019[_0x4b207a]={'$like':'%'+_0xa9b53['query'][_0xca01('0x25')]+'%'};return _0xa05019;})});}_0x1ffa5f=_['merge']({},_0x1ffa5f,_0xa9b53[_0xca01('0x28')]);return _0x282ee4[_0xca01('0x35')](_0x1ffa5f);}})[_0xca01('0xe')](function(_0x55846a){if(_0x55846a){_0x85b6ba=_0x55846a[_0xca01('0x1f')];if(!_0xa9b53['query'][_0xca01('0x20')](_0xca01('0x21'))){_0x1ffa5f['limit']=qs[_0xca01('0xa')](_0xa9b53[_0xca01('0x1a')]['limit']);_0x1ffa5f[_0xca01('0xc')]=qs[_0xca01('0xc')](_0xa9b53['query'][_0xca01('0xc')]);}return _0x282ee4['getConfigurations'](_0x1ffa5f);}})[_0xca01('0xe')](function(_0x3a313b){if(_0x3a313b){return _0x3a313b?{'count':_0x85b6ba,'rows':_0x3a313b}:null;}})['then'](respondWithResult(_0x1fce92,null))[_0xca01('0x31')](handleError(_0x1fce92,null));};exports[_0xca01('0x39')]=function(_0x414357,_0x16ac9f){if(_0x414357[_0xca01('0x33')]['id']){delete _0x414357['body']['id'];}return db[_0xca01('0x15')][_0xca01('0x36')]({'where':{'id':_0x414357[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x16ac9f,null))[_0xca01('0xe')](function(_0x38a0cb){if(_0x38a0cb){_0x414357[_0xca01('0x33')][_0xca01('0x3a')]=_0x38a0cb['id'];_0x414357[_0xca01('0x33')]['Subjects']=integrations[_0xca01('0x3b')](_0x414357[_0xca01('0x33')][_0xca01('0x3c')],_0x414357[_0xca01('0x33')][_0xca01('0x17')]);_0x414357['body'][_0xca01('0x3d')]=integrations['getDescriptions'](_0x414357[_0xca01('0x33')][_0xca01('0x3c')],_0x414357[_0xca01('0x33')][_0xca01('0x17')]);return db[_0xca01('0x37')][_0xca01('0x32')](_0x414357[_0xca01('0x33')],{'include':[{'model':db[_0xca01('0x3e')],'as':_0xca01('0x3f')},{'model':db[_0xca01('0x3e')],'as':_0xca01('0x3d')}]});}return null;})[_0xca01('0xe')](respondWithResult(_0x16ac9f,null))[_0xca01('0x31')](handleError(_0x16ac9f,null));};function sanitizeRemoteUri(_0x5d283e){var _0x5db55e=_0x5d283e[_0xca01('0x40')](-0x1);if(_0x5db55e==='/')return _0x5d283e[_0xca01('0x41')](0x0,_0x5d283e[_0xca01('0x42')](_0x5db55e));return _0x5d283e;}function getWebApiUrl(_0x2419c6){return util[_0xca01('0x43')](_0xca01('0x44'),_0x2419c6);}exports[_0xca01('0x45')]=function(_0x505bf5,_0x4a9c4b){var _0xbe876f=_0x505bf5[_0xca01('0x1a')][_0xca01('0x46')];var _0x9e9397=_0xbe876f==='incident'?_0xca01('0x47'):'PhoneCall';var _0x2c0598='';var _0x4b9ae8='';var _0x3fc68d='';var _0x3787e0='';var _0x5983f9='';var _0xe0c8d4='';var _0x41e1cf='';var _0x4253a3='';var _0x122b03=['title',_0xca01('0x48'),_0xca01('0x49'),'ownerid',_0xca01('0x4a'),_0xca01('0x4b'),_0xca01('0x4c'),_0xca01('0x4d'),_0xca01('0x4e'),_0xca01('0x4f')];var _0x14fd31=[_0xca01('0x50'),_0xca01('0x51'),_0xca01('0x52'),'billedserviceunits',_0xca01('0x53'),_0xca01('0x54'),'contractdetailidname',_0xca01('0x55'),_0xca01('0x56'),_0xca01('0x57'),_0xca01('0x58'),_0xca01('0x59'),_0xca01('0x5a'),'createdonbehalfbyname',_0xca01('0x5b'),_0xca01('0x5c'),_0xca01('0x5d'),'customeridyominame','emailaddress','entitlementidname',_0xca01('0x5e'),_0xca01('0x5f'),'escalatedon',_0xca01('0x60'),_0xca01('0x61'),_0xca01('0x62'),_0xca01('0x63'),'influencescore',_0xca01('0x64'),'lastonholdtime',_0xca01('0x65'),_0xca01('0x66'),'modifiedbyexternalpartyyominame',_0xca01('0x67'),_0xca01('0x68'),_0xca01('0x69'),'modifiedonbehalfbyname',_0xca01('0x6a'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon',_0xca01('0x6b'),_0xca01('0x6c'),_0xca01('0x6d'),_0xca01('0x6e'),_0xca01('0x6f'),_0xca01('0x70'),_0xca01('0x71'),_0xca01('0x72'),_0xca01('0x73'),_0xca01('0x74'),_0xca01('0x75'),_0xca01('0x76'),_0xca01('0x77'),'responsiblecontactidyominame',_0xca01('0x78'),_0xca01('0x79'),_0xca01('0x7a'),_0xca01('0x7b'),'statecode','statuscode',_0xca01('0x7c'),_0xca01('0x7d'),_0xca01('0x7e'),'transactioncurrencyidname',_0xca01('0x7f'),_0xca01('0x80'),_0xca01('0x81')];var _0x42e28e=_0x122b03[_0xca01('0x82')](_0x14fd31);return db['Dynamics365Account'][_0xca01('0x36')]({'where':{'id':_0x505bf5[_0xca01('0x2d')]['id']},'attributes':['id','username',_0xca01('0x83'),_0xca01('0x84'),_0xca01('0x85'),_0xca01('0x86'),_0xca01('0x87'),_0xca01('0x88')],'include':[{'model':db[_0xca01('0x89')],'as':_0xca01('0x89'),'attributes':['id',_0xca01('0x8a'),_0xca01('0x8b')]}]})[_0xca01('0xe')](handleEntityNotFound(_0x4a9c4b,null))[_0xca01('0xe')](function(_0x38777a){if(_0x38777a){if(_0x38777a[_0xca01('0x88')]){_0x38777a['access_token']=_0x38777a['CloudProvider'][_0xca01('0x8a')];_0x4253a3=sanitizeRemoteUri(_0x38777a[_0xca01('0x89')][_0xca01('0x8b')]);_0x41e1cf=getWebApiUrl(_0x4253a3);return _0x38777a;}_0x4253a3=sanitizeRemoteUri(_0x38777a[_0xca01('0x84')]);_0x41e1cf=getWebApiUrl(_0x4253a3);var _0x2fe904={'method':_0xca01('0x8c'),'uri':_0xca01('0x8d')+_0x38777a[_0xca01('0x85')]+_0xca01('0x8e'),'form':{'client_id':_0x38777a[_0xca01('0x86')],'resource':_0x4253a3,'username':_0x38777a[_0xca01('0x8f')],'password':_0x38777a[_0xca01('0x83')],'grant_type':_0xca01('0x83'),'client_secret':_0x38777a[_0xca01('0x87')]},'json':!![]};return rp(_0x2fe904);}})[_0xca01('0xe')](function(_0x352475){_0xe0c8d4=_0x352475[_0xca01('0x90')];var _0x4ea0f7={'method':_0xca01('0x91'),'uri':encodeURI(_0x41e1cf+_0xca01('0x92')+_0x9e9397+'\x27'),'headers':{'Authorization':_0xca01('0x93')+_0xe0c8d4,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x4ea0f7);})[_0xca01('0xe')](function(_0x83c0ea){var _0x3c11d1=_0x83c0ea[_0xca01('0x95')][0x0];var _0x59ad10=_0x3c11d1[_0xca01('0x96')];var _0x4d8762={'method':'GET','uri':_0x41e1cf+'EntityDefinitions('+_0x59ad10+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xca01('0x93')+_0xe0c8d4,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x4d8762);})[_0xca01('0xe')](function(_0x538fe6){_0x2c0598=_0x538fe6;_0x4b9ae8=_0x2c0598[_0xca01('0x97')];_0x4b9ae8=_['remove'](_0x4b9ae8,function(_0x2945c4){return!_0x42e28e[_0xca01('0x98')](_0x2945c4[_0xca01('0x99')]);});var _0x494f95=[];var _0x599ff5=[];_0x4b9ae8[_0xca01('0x9a')](function(_0x4c0b9e){if(_0x4c0b9e[_0xca01('0x9b')]){var _0x1136fe=_0x4c0b9e[_0xca01('0x9b')][_0xca01('0x41')](_0x4c0b9e['@odata.type'][_0xca01('0x42')]('.')+0x1);if(_0x1136fe===_0xca01('0x9c')){_0x494f95[_0xca01('0x9d')](getSelectList(_0x41e1cf,_0xbe876f,_0x599ff5,_0x2c0598[_0xca01('0x96')],_0x4c0b9e[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x494f95);})[_0xca01('0xe')](function(_0x165522){_0x3fc68d=_0x165522[0x0];var _0x1c79b0=[];var _0x44e72c=[];_0x4b9ae8['forEach'](function(_0x92c113){if(!_[_0xca01('0x9f')](_0x92c113[_0xca01('0x9b')])){var _0x491152=_0x92c113['@odata.type'][_0xca01('0x41')](_0x92c113[_0xca01('0x9b')][_0xca01('0x42')]('.')+0x1);if(_0x491152===_0xca01('0xa0')){_0x1c79b0[_0xca01('0x9d')](getBooleanList(_0x41e1cf,_0xbe876f,_0x44e72c,_0x2c0598[_0xca01('0x96')],_0x92c113[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x1c79b0);})['then'](function(_0x145974){_0x3787e0=_0x145974[0x0];var _0x11bf46=[];var _0x5908c6=[];_0x4b9ae8[_0xca01('0x9a')](function(_0x4449a1){if(_0x4449a1[_0xca01('0x9b')]){var _0x3bf5ca=_0x4449a1[_0xca01('0x9b')][_0xca01('0x41')](_0x4449a1[_0xca01('0x9b')][_0xca01('0x42')]('.')+0x1);if(_0x3bf5ca===_0xca01('0xa1')||_0x3bf5ca==='DoubleAttributeMetadata'||_0x3bf5ca==='BigIntAttributeMetadata'||_0x3bf5ca===_0xca01('0xa2')||_0x3bf5ca===_0xca01('0xa3')||_0x3bf5ca==='DateTimeAttributeMetadata'||_0x3bf5ca===_0xca01('0xa4')||_0x3bf5ca==='EntityNameAttributeMetadata'||_0x3bf5ca===_0xca01('0xa5')||_0x3bf5ca===_0xca01('0xa6')){_0x11bf46[_0xca01('0x9d')](getInputList(_0x41e1cf,_0xbe876f,_0x3bf5ca,_0x5908c6,_0x2c0598[_0xca01('0x96')],_0x4449a1[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x11bf46);})[_0xca01('0xe')](function(_0x3113b2){_0x5983f9=_0x3113b2[0x0];var _0x489343=_0x3fc68d['concat'](_0x3787e0)[_0xca01('0x82')](_0x5983f9);var _0x311a38={'count':_0x489343['length'],'rows':_0x489343};return _0x311a38;})[_0xca01('0xe')](respondWithResult(_0x4a9c4b,null))[_0xca01('0x31')](function(_0x427c7c){var _0x4efd8d=_0x505bf5[_0xca01('0x1a')]['test']?0x1f4:_0x427c7c[_0xca01('0xa7')]||0x1f4;logger[_0xca01('0xa8')](_0x427c7c['stack']);delete _0x427c7c[_0xca01('0x11')];if(_0x4efd8d===0x191){_0x4efd8d=0x190;}_0x4a9c4b[_0xca01('0x7')](_0x4efd8d)[_0xca01('0x12')](_0x505bf5[_0xca01('0x1a')]['test']?{'message':_0xca01('0xa9'),'statusCode':_0x427c7c[_0xca01('0xa7')]}:_0x427c7c);});};function getSelectList(_0x51d345,_0x2fbd17,_0x263c63,_0x365a4b,_0x186bc1,_0x18f160){var _0x5b360c={'method':'GET','uri':_0x51d345+'EntityDefinitions('+_0x365a4b+_0xca01('0xaa')+_0x186bc1+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xca01('0xab'),'headers':{'Authorization':_0xca01('0x93')+_0x18f160,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b360c)[_0xca01('0xe')](function(_0x2aeb07){var _0x47cebe=[];var _0x4dc37e=_0x2aeb07['OptionSet'][_0xca01('0xac')];_0x4dc37e[_0xca01('0x9a')](function(_0x2524c3){_0x47cebe[_0xca01('0x9d')]({'name':_0x2524c3[_0xca01('0xad')][_0xca01('0xae')][_0xca01('0xad')],'value':String(_0x2524c3[_0xca01('0xaf')])});});var _0x18726e={'id':_0x2fbd17+'_'+_0x2aeb07['LogicalName'],'name':_0x2aeb07[_0xca01('0xb0')][_0xca01('0xae')][_0xca01('0xad')],'custom':![],'options':_0x47cebe};_0x263c63[_0xca01('0x9d')](_0x18726e);return _0x263c63;});}function getBooleanList(_0x240cc8,_0x4ccf01,_0xb83ffb,_0x1a8fca,_0x3ae4e0,_0x313d52){var _0x1f5f52={'method':_0xca01('0x91'),'uri':_0x240cc8+_0xca01('0xb1')+_0x1a8fca+_0xca01('0xaa')+_0x3ae4e0+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xca01('0x93')+_0x313d52,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x1f5f52)['then'](function(_0x91e363){var _0x20706d=[];_0x20706d[_0xca01('0x9d')]({'name':_0x91e363['OptionSet'][_0xca01('0xb2')]['Label'][_0xca01('0xae')][_0xca01('0xad')],'value':_0xca01('0xb3')},{'name':_0x91e363['OptionSet'][_0xca01('0xb4')][_0xca01('0xad')][_0xca01('0xae')][_0xca01('0xad')],'value':_0xca01('0xb5')});var _0x2708d9={'id':_0x4ccf01+'_'+_0x91e363[_0xca01('0x99')],'name':_0x91e363[_0xca01('0xb0')][_0xca01('0xae')]['Label'],'custom':![],'options':_0x20706d};_0xb83ffb[_0xca01('0x9d')](_0x2708d9);return _0xb83ffb;});}function getInputList(_0x30b86a,_0x24cd43,_0xb76340,_0x1ee4a9,_0x4b5d7e,_0xb6762d,_0x37e9fc){var _0x5e5ed0={'method':_0xca01('0x91'),'uri':_0x30b86a+_0xca01('0xb1')+_0x4b5d7e+_0xca01('0xaa')+_0xb6762d+_0xca01('0xb6')+_0xb76340+_0xca01('0xb7'),'headers':{'Authorization':_0xca01('0x93')+_0x37e9fc,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x5e5ed0)[_0xca01('0xe')](function(_0x252dcb){var _0x4e26b7={'id':_0x24cd43+'_'+_0x252dcb['LogicalName'],'name':_0x252dcb[_0xca01('0xb0')]['UserLocalizedLabel']?_0x252dcb[_0xca01('0xb0')][_0xca01('0xae')][_0xca01('0xad')]:_0x252dcb[_0xca01('0x99')],'custom':![],'options':[]};_0x1ee4a9[_0xca01('0x9d')](_0x4e26b7);return _0x1ee4a9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7079e8c..b9f29f8 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x446995,_0x1d780c){var _0x15f271=function(_0x5c5d9c){while(--_0x5c5d9c){_0x446995['push'](_0x446995['shift']());}};_0x15f271(++_0x1d780c);}(_0x757a,0xde));var _0xa757=function(_0x36c314,_0x3529a8){_0x36c314=_0x36c314-0x0;var _0xd96d5a=_0x757a[_0x36c314];return _0xd96d5a;};'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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x4cba4b,_0x58eb50){var _0x524849=function(_0x479e97){while(--_0x479e97){_0x4cba4b['push'](_0x4cba4b['shift']());}};_0x524849(++_0x58eb50);}(_0xe706,0xa3));var _0x6e70=function(_0x46eb0e,_0x296d16){_0x46eb0e=_0x46eb0e-0x0;var _0x523297=_0xe706[_0x46eb0e];return _0x523297;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 828a103..a20c0f8 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 _0x5227=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map','GetDynamics365Account','find','ShowDynamics365Account','lodash','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5227,0x1ba));var _0x7522=function(_0x5b012e,_0x5cb94c){_0x5b012e=_0x5b012e-0x0;var _0xd6daf0=_0x5227[_0x5b012e];return _0xd6daf0;};'use strict';var _=require(_0x7522('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7522('0x1'));var rs=require(_0x7522('0x2'));var fs=require('fs');var Redis=require(_0x7522('0x3'));var db=require(_0x7522('0x4'))['db'];var utils=require(_0x7522('0x5'));var logger=require(_0x7522('0x6'))(_0x7522('0x7'));var config=require(_0x7522('0x8'));var jayson=require(_0x7522('0x9'));var client=jayson[_0x7522('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23d65d,_0x2ea706,_0x2d8abc){return new BPromise(function(_0x428589,_0x7be8ec){return client[_0x7522('0xb')](_0x23d65d,_0x2d8abc)[_0x7522('0xc')](function(_0x5ede7c){logger['info'](_0x7522('0xd'),_0x2ea706,'request\x20sent');logger[_0x7522('0xe')](_0x7522('0xf'),_0x2ea706,_0x7522('0x10'),JSON[_0x7522('0x11')](_0x5ede7c));if(_0x5ede7c[_0x7522('0x12')]){if(_0x5ede7c[_0x7522('0x12')][_0x7522('0x13')]===0x1f4){logger[_0x7522('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2ea706,_0x5ede7c[_0x7522('0x12')][_0x7522('0x14')]);return _0x7be8ec(_0x5ede7c[_0x7522('0x12')][_0x7522('0x14')]);}logger[_0x7522('0x12')](_0x7522('0xd'),_0x2ea706,_0x5ede7c[_0x7522('0x12')][_0x7522('0x14')]);return _0x428589(_0x5ede7c[_0x7522('0x12')][_0x7522('0x14')]);}else{logger[_0x7522('0x15')](_0x7522('0xd'),_0x2ea706,_0x7522('0x10'));_0x428589(_0x5ede7c[_0x7522('0x16')][_0x7522('0x14')]);}})[_0x7522('0x17')](function(_0x1fde67){logger[_0x7522('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2ea706,_0x1fde67);_0x7be8ec(_0x1fde67);});});}exports['GetDynamics365Account']=function(_0x3ec9ea){var _0x4eb65a=this;return new Promise(function(_0x54664f,_0xac145a){return db[_0x7522('0x18')][_0x7522('0x19')]({'raw':_0x3ec9ea['options']?_0x3ec9ea[_0x7522('0x1a')][_0x7522('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ec9ea[_0x7522('0x1a')]?_0x3ec9ea[_0x7522('0x1a')][_0x7522('0x1c')]||null:null,'attributes':_0x3ec9ea[_0x7522('0x1a')]?_0x3ec9ea[_0x7522('0x1a')][_0x7522('0x1d')]||null:null,'limit':_0x3ec9ea[_0x7522('0x1a')]?_0x3ec9ea[_0x7522('0x1a')][_0x7522('0x1e')]||null:null,'include':_0x3ec9ea[_0x7522('0x1a')]?_0x3ec9ea[_0x7522('0x1a')]['include']?_['map'](_0x3ec9ea[_0x7522('0x1a')][_0x7522('0x1f')],function(_0x353152){return{'model':db[_0x353152[_0x7522('0x20')]],'as':_0x353152['as'],'attributes':_0x353152[_0x7522('0x1d')],'include':_0x353152['include']?_[_0x7522('0x21')](_0x353152[_0x7522('0x1f')],function(_0x41356f){return{'model':db[_0x41356f[_0x7522('0x20')]],'as':_0x41356f['as'],'attributes':_0x41356f[_0x7522('0x1d')],'include':_0x41356f[_0x7522('0x1f')]?_[_0x7522('0x21')](_0x41356f[_0x7522('0x1f')],function(_0x26b690){return{'model':db[_0x26b690[_0x7522('0x20')]],'as':_0x26b690['as'],'attributes':_0x26b690[_0x7522('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47faf8){logger['info']('GetDynamics365Account',_0x3ec9ea);logger[_0x7522('0xe')]('GetDynamics365Account',_0x3ec9ea,JSON['stringify'](_0x47faf8));_0x54664f(_0x47faf8);})[_0x7522('0x17')](function(_0x3dfd29){logger[_0x7522('0x12')](_0x7522('0x22'),_0x3dfd29['message'],_0x3ec9ea);_0xac145a(_0x4eb65a[_0x7522('0x12')](0x1f4,_0x3dfd29[_0x7522('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x407b4e){var _0x496013=this;return new Promise(function(_0x3b5c12,_0x3ae927){return db[_0x7522('0x18')][_0x7522('0x23')]({'raw':_0x407b4e[_0x7522('0x1a')]?_0x407b4e[_0x7522('0x1a')][_0x7522('0x1b')]===undefined?!![]:![]:!![],'where':_0x407b4e[_0x7522('0x1a')]?_0x407b4e[_0x7522('0x1a')][_0x7522('0x1c')]||null:null,'attributes':_0x407b4e['options']?_0x407b4e[_0x7522('0x1a')][_0x7522('0x1d')]||null:null,'include':_0x407b4e[_0x7522('0x1a')]?_0x407b4e[_0x7522('0x1a')][_0x7522('0x1f')]?_[_0x7522('0x21')](_0x407b4e[_0x7522('0x1a')][_0x7522('0x1f')],function(_0x5cfaa7){return{'model':db[_0x5cfaa7[_0x7522('0x20')]],'as':_0x5cfaa7['as'],'attributes':_0x5cfaa7[_0x7522('0x1d')],'include':_0x5cfaa7[_0x7522('0x1f')]?_[_0x7522('0x21')](_0x5cfaa7[_0x7522('0x1f')],function(_0x5257a6){return{'model':db[_0x5257a6[_0x7522('0x20')]],'as':_0x5257a6['as'],'attributes':_0x5257a6['attributes'],'include':_0x5257a6['include']?_[_0x7522('0x21')](_0x5257a6[_0x7522('0x1f')],function(_0x359601){return{'model':db[_0x359601[_0x7522('0x20')]],'as':_0x359601['as'],'attributes':_0x359601[_0x7522('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x214d33){logger[_0x7522('0x15')](_0x7522('0x24'),_0x407b4e);logger[_0x7522('0xe')](_0x7522('0x24'),_0x407b4e,JSON[_0x7522('0x11')](_0x214d33));_0x3b5c12(_0x214d33);})['catch'](function(_0x752b21){logger[_0x7522('0x12')]('ShowDynamics365Account',_0x752b21[_0x7522('0x14')],_0x407b4e);_0x3ae927(_0x496013[_0x7522('0x12')](0x1f4,_0x752b21[_0x7522('0x14')]));});});}; \ No newline at end of file +var _0xec2e=['message','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','then','Dynamics365Account','find','model','debug','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x58620d,_0x5d4d59){var _0x597698=function(_0x90d66e){while(--_0x90d66e){_0x58620d['push'](_0x58620d['shift']());}};_0x597698(++_0x5d4d59);}(_0xec2e,0x131));var _0xeec2=function(_0x5bbeeb,_0x2c7cae){_0x5bbeeb=_0x5bbeeb-0x0;var _0x17c2bb=_0xec2e[_0x5bbeeb];return _0x17c2bb;};'use strict';var _=require(_0xeec2('0x0'));var util=require(_0xeec2('0x1'));var moment=require('moment');var BPromise=require(_0xeec2('0x2'));var rs=require(_0xeec2('0x3'));var fs=require('fs');var Redis=require(_0xeec2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeec2('0x5'));var logger=require(_0xeec2('0x6'))(_0xeec2('0x7'));var config=require(_0xeec2('0x8'));var jayson=require(_0xeec2('0x9'));var client=jayson[_0xeec2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc3c8,_0x15a651,_0x238a58){return new BPromise(function(_0x173cdd,_0x5e1566){return client[_0xeec2('0xb')](_0x4bc3c8,_0x238a58)['then'](function(_0x710ad4){logger[_0xeec2('0xc')](_0xeec2('0xd'),_0x15a651,_0xeec2('0xe'));logger['debug'](_0xeec2('0xf'),_0x15a651,_0xeec2('0xe'),JSON[_0xeec2('0x10')](_0x710ad4));if(_0x710ad4[_0xeec2('0x11')]){if(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x12')]===0x1f4){logger[_0xeec2('0x11')](_0xeec2('0xd'),_0x15a651,_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);return _0x5e1566(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);}logger['error'](_0xeec2('0xd'),_0x15a651,_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);return _0x173cdd(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);}else{logger[_0xeec2('0xc')](_0xeec2('0xd'),_0x15a651,'request\x20sent');_0x173cdd(_0x710ad4['result']['message']);}})[_0xeec2('0x14')](function(_0x5a3097){logger['error'](_0xeec2('0xd'),_0x15a651,_0x5a3097);_0x5e1566(_0x5a3097);});});}exports[_0xeec2('0x15')]=function(_0x31511c){var _0x5425ff=this;return new Promise(function(_0x10da52,_0x535df6){return db['Dynamics365Account'][_0xeec2('0x16')]({'raw':_0x31511c['options']?_0x31511c[_0xeec2('0x17')][_0xeec2('0x18')]===undefined?!![]:![]:!![],'where':_0x31511c['options']?_0x31511c[_0xeec2('0x17')][_0xeec2('0x19')]||null:null,'attributes':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1a')]||null:null,'limit':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1b')]||null:null,'include':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x31511c['options'][_0xeec2('0x1c')],function(_0x1b1ab3){return{'model':db[_0x1b1ab3['model']],'as':_0x1b1ab3['as'],'attributes':_0x1b1ab3[_0xeec2('0x1a')],'include':_0x1b1ab3[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x1b1ab3[_0xeec2('0x1c')],function(_0x5bab0f){return{'model':db[_0x5bab0f['model']],'as':_0x5bab0f['as'],'attributes':_0x5bab0f[_0xeec2('0x1a')],'include':_0x5bab0f[_0xeec2('0x1c')]?_['map'](_0x5bab0f['include'],function(_0x1f7796){return{'model':db[_0x1f7796['model']],'as':_0x1f7796['as'],'attributes':_0x1f7796[_0xeec2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeec2('0x1e')](function(_0x2c530c){logger[_0xeec2('0xc')](_0xeec2('0x15'),_0x31511c);logger['debug'](_0xeec2('0x15'),_0x31511c,JSON[_0xeec2('0x10')](_0x2c530c));_0x10da52(_0x2c530c);})[_0xeec2('0x14')](function(_0x154727){logger['error'](_0xeec2('0x15'),_0x154727[_0xeec2('0x13')],_0x31511c);_0x535df6(_0x5425ff[_0xeec2('0x11')](0x1f4,_0x154727[_0xeec2('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x31fb33){var _0x5d6ce3=this;return new Promise(function(_0x2473a4,_0xc23134){return db[_0xeec2('0x1f')][_0xeec2('0x20')]({'raw':_0x31fb33[_0xeec2('0x17')]?_0x31fb33['options']['raw']===undefined?!![]:![]:!![],'where':_0x31fb33[_0xeec2('0x17')]?_0x31fb33['options'][_0xeec2('0x19')]||null:null,'attributes':_0x31fb33[_0xeec2('0x17')]?_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1a')]||null:null,'include':_0x31fb33[_0xeec2('0x17')]?_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1c')]?_['map'](_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1c')],function(_0x25eb79){return{'model':db[_0x25eb79[_0xeec2('0x21')]],'as':_0x25eb79['as'],'attributes':_0x25eb79[_0xeec2('0x1a')],'include':_0x25eb79[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x25eb79[_0xeec2('0x1c')],function(_0x38cb5c){return{'model':db[_0x38cb5c['model']],'as':_0x38cb5c['as'],'attributes':_0x38cb5c['attributes'],'include':_0x38cb5c[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x38cb5c['include'],function(_0x55fe37){return{'model':db[_0x55fe37[_0xeec2('0x21')]],'as':_0x55fe37['as'],'attributes':_0x55fe37[_0xeec2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeec2('0x1e')](function(_0x1f492d){logger[_0xeec2('0xc')]('ShowDynamics365Account',_0x31fb33);logger[_0xeec2('0x22')](_0xeec2('0x23'),_0x31fb33,JSON[_0xeec2('0x10')](_0x1f492d));_0x2473a4(_0x1f492d);})[_0xeec2('0x14')](function(_0x323460){logger['error'](_0xeec2('0x23'),_0x323460[_0xeec2('0x13')],_0x31fb33);_0xc23134(_0x5d6ce3['error'](0x1f4,_0x323460[_0xeec2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 677fcef..93c613c 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 _0x687a=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2cd1fd,_0x248a90){var _0x40de87=function(_0x2c1be0){while(--_0x2c1be0){_0x2cd1fd['push'](_0x2cd1fd['shift']());}};_0x40de87(++_0x248a90);}(_0x687a,0xe8));var _0xa687=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x687a[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xa687('0x0'));var util=require(_0xa687('0x1'));var path=require(_0xa687('0x2'));var timeout=require('connect-timeout');var express=require(_0xa687('0x3'));var router=express[_0xa687('0x4')]();var fs_extra=require(_0xa687('0x5'));var auth=require(_0xa687('0x6'));var interaction=require(_0xa687('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xa687('0x8')]('/',auth[_0xa687('0x9')](),controller[_0xa687('0xa')]);router[_0xa687('0x8')](_0xa687('0xb'),auth[_0xa687('0x9')](),controller[_0xa687('0xc')]);router[_0xa687('0x8')](_0xa687('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xa687('0x8')](_0xa687('0xe'),auth['isAuthenticated'](),controller[_0xa687('0xf')]);router['get'](_0xa687('0x10'),auth[_0xa687('0x9')](),controller[_0xa687('0x11')]);router[_0xa687('0x12')]('/',auth['isAuthenticated'](),controller[_0xa687('0x13')]);router[_0xa687('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa687('0x15')]);router[_0xa687('0x16')](_0xa687('0xb'),auth['isAuthenticated'](),controller[_0xa687('0x17')]);module[_0xa687('0x18')]=router; \ No newline at end of file +var _0xfef3=['./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2eb88f,_0x37fe90){var _0x52e1ed=function(_0x531ff1){while(--_0x531ff1){_0x2eb88f['push'](_0x2eb88f['shift']());}};_0x52e1ed(++_0x37fe90);}(_0xfef3,0x118));var _0x3fef=function(_0x5ebf27,_0x4514e0){_0x5ebf27=_0x5ebf27-0x0;var _0x121c72=_0xfef3[_0x5ebf27];return _0x121c72;};'use strict';var multer=require(_0x3fef('0x0'));var util=require('util');var path=require(_0x3fef('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fef('0x2'));var router=express[_0x3fef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fef('0x4'));var interaction=require(_0x3fef('0x5'));var config=require('../../config/environment');var controller=require(_0x3fef('0x6'));router[_0x3fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x8')]);router[_0x3fef('0x7')](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xb')]);router[_0x3fef('0x7')](_0x3fef('0xc'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xd')]);router[_0x3fef('0x7')](_0x3fef('0xe'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xf')]);router[_0x3fef('0x7')]('/:id/descriptions',auth[_0x3fef('0xa')](),controller[_0x3fef('0x10')]);router[_0x3fef('0x11')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x12')]);router['put'](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0x13')]);router['delete'](_0x3fef('0x9'),auth['isAuthenticated'](),controller[_0x3fef('0x14')]);module[_0x3fef('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index b9dd5e4..edb2bc4 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 _0xa38a=['incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x28bf1a,_0x418326){var _0x44d0ca=function(_0x2508ff){while(--_0x2508ff){_0x28bf1a['push'](_0x28bf1a['shift']());}};_0x44d0ca(++_0x418326);}(_0xa38a,0x11c));var _0xaa38=function(_0x214db3,_0xe1a9df){_0x214db3=_0x214db3-0x0;var _0x304a7d=_0xa38a[_0x214db3];return _0x304a7d;};'use strict';var Sequelize=require(_0xaa38('0x0'));module[_0xaa38('0x1')]={'name':{'type':Sequelize[_0xaa38('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xaa38('0x3')](_0xaa38('0x4'),_0xaa38('0x5')),'defaultValue':_0xaa38('0x4')},'moduleCreate':{'type':Sequelize[_0xaa38('0x3')](_0xaa38('0x6'),_0xaa38('0x7')),'defaultValue':_0xaa38('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xaa38('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xaa38('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf9a1=['exports','STRING','ENUM','incident','phonecall','contact','sequelize'];(function(_0x5345fa,_0x5b95f0){var _0x119e0d=function(_0x140c27){while(--_0x140c27){_0x5345fa['push'](_0x5345fa['shift']());}};_0x119e0d(++_0x5b95f0);}(_0xf9a1,0x1b8));var _0x1f9a=function(_0x1e7d01,_0x48f47f){_0x1e7d01=_0x1e7d01-0x0;var _0x60d047=_0xf9a1[_0x1e7d01];return _0x60d047;};'use strict';var Sequelize=require(_0x1f9a('0x0'));module[_0x1f9a('0x1')]={'name':{'type':Sequelize[_0x1f9a('0x2')]},'description':{'type':Sequelize[_0x1f9a('0x2')]},'ticketType':{'type':Sequelize[_0x1f9a('0x3')](_0x1f9a('0x4'),_0x1f9a('0x5')),'defaultValue':_0x1f9a('0x4')},'moduleCreate':{'type':Sequelize[_0x1f9a('0x3')](_0x1f9a('0x6'),'nothing'),'defaultValue':_0x1f9a('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1f9a('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 675c145..094dc49 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 _0xa318=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','Dynamics365Field','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x4445bb,_0x5b8234){var _0x7f8230=function(_0x3e26d8){while(--_0x3e26d8){_0x4445bb['push'](_0x4445bb['shift']());}};_0x7f8230(++_0x5b8234);}(_0xa318,0x19f));var _0x8a31=function(_0x4ad3fe,_0x5dc189){_0x4ad3fe=_0x4ad3fe-0x0;var _0x4c751f=_0xa318[_0x4ad3fe];return _0x4c751f;};'use strict';var emlformat=require(_0x8a31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a31('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a31('0x2'));var moment=require(_0x8a31('0x3'));var BPromise=require(_0x8a31('0x4'));var Mustache=require(_0x8a31('0x5'));var util=require(_0x8a31('0x6'));var path=require(_0x8a31('0x7'));var sox=require(_0x8a31('0x8'));var csv=require('to-csv');var ejs=require(_0x8a31('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a31('0xa'));var squel=require(_0x8a31('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a31('0xc'));var deskjs=require(_0x8a31('0xd'));var toCsv=require(_0x8a31('0xe'));var querystring=require(_0x8a31('0xf'));var Papa=require(_0x8a31('0x10'));var Redis=require('ioredis');var authService=require(_0x8a31('0x11'));var qs=require(_0x8a31('0x12'));var as=require(_0x8a31('0x13'));var hardwareService=require(_0x8a31('0x14'));var logger=require(_0x8a31('0x15'))(_0x8a31('0x16'));var utils=require(_0x8a31('0x17'));var config=require(_0x8a31('0x18'));var licenseUtil=require(_0x8a31('0x19'));var db=require(_0x8a31('0x1a'))['db'];function respondWithStatusCode(_0x1bcd1a,_0x1f056d){_0x1f056d=_0x1f056d||0xcc;return function(_0x331e98){if(_0x331e98){return _0x1bcd1a[_0x8a31('0x1b')](_0x1f056d);}return _0x1bcd1a[_0x8a31('0x1c')](_0x1f056d)[_0x8a31('0x1d')]();};}function respondWithResult(_0x5406be,_0x12067c){_0x12067c=_0x12067c||0xc8;return function(_0xcec038){if(_0xcec038){return _0x5406be[_0x8a31('0x1c')](_0x12067c)[_0x8a31('0x1e')](_0xcec038);}};}function respondWithFilteredResult(_0x5c372a,_0x53ee6b){return function(_0xbff23){if(_0xbff23){var _0x272837=typeof _0x53ee6b[_0x8a31('0x1f')]===_0x8a31('0x20')&&typeof _0x53ee6b[_0x8a31('0x21')]==='undefined';var _0x2657a3=_0xbff23[_0x8a31('0x22')];var _0x84322b=_0x272837?0x0:_0x53ee6b['offset'];var _0x3ccb9c=_0x272837?_0xbff23[_0x8a31('0x22')]:_0x53ee6b[_0x8a31('0x1f')]+_0x53ee6b[_0x8a31('0x21')];var _0x8002f3;if(_0x3ccb9c>=_0x2657a3){_0x3ccb9c=_0x2657a3;_0x8002f3=0xc8;}else{_0x8002f3=0xce;}_0x5c372a[_0x8a31('0x1c')](_0x8002f3);return _0x5c372a[_0x8a31('0x23')](_0x8a31('0x24'),_0x84322b+'-'+_0x3ccb9c+'/'+_0x2657a3)[_0x8a31('0x1e')](_0xbff23);}return null;};}function patchUpdates(_0x5adddc){return function(_0x30ec09){try{jsonpatch[_0x8a31('0x25')](_0x30ec09,_0x5adddc,!![]);}catch(_0x45cb15){return BPromise[_0x8a31('0x26')](_0x45cb15);}return _0x30ec09[_0x8a31('0x27')]();};}function saveUpdates(_0x173f09,_0x53b2e5){return function(_0x3365c5){if(_0x3365c5){return _0x3365c5[_0x8a31('0x28')](_0x173f09)['then'](function(_0xdfe47f){return _0xdfe47f;});}return null;};}function removeEntity(_0x4256a8,_0x52079b){return function(_0x610b3a){if(_0x610b3a){return _0x610b3a[_0x8a31('0x29')]()['then'](function(){_0x4256a8[_0x8a31('0x1c')](0xcc)[_0x8a31('0x1d')]();});}};}function handleEntityNotFound(_0x2c9534,_0x180f0){return function(_0x12317c){if(!_0x12317c){_0x2c9534['sendStatus'](0x194);}return _0x12317c;};}function handleError(_0xf83b32,_0x15498d){_0x15498d=_0x15498d||0x1f4;return function(_0x1f2276){logger[_0x8a31('0x2a')](_0x1f2276['stack']);if(_0x1f2276['name']){delete _0x1f2276[_0x8a31('0x2b')];}_0xf83b32[_0x8a31('0x1c')](_0x15498d)[_0x8a31('0x2c')](_0x1f2276);};}exports[_0x8a31('0x2d')]=function(_0x3aaed4,_0x6c48c5){var _0x183c99={},_0x48f033={},_0x1246cb={'count':0x0,'rows':[]};var _0x55fa39=_[_0x8a31('0x2e')](db[_0x8a31('0x2f')][_0x8a31('0x30')],function(_0x552ce9){return{'name':_0x552ce9[_0x8a31('0x31')],'type':_0x552ce9[_0x8a31('0x32')][_0x8a31('0x33')]};});_0x48f033[_0x8a31('0x34')]=_[_0x8a31('0x2e')](_0x55fa39,_0x8a31('0x2b'));_0x48f033['query']=_[_0x8a31('0x35')](_0x3aaed4[_0x8a31('0x36')]);_0x48f033[_0x8a31('0x37')]=_[_0x8a31('0x38')](_0x48f033[_0x8a31('0x34')],_0x48f033[_0x8a31('0x36')]);_0x183c99[_0x8a31('0x39')]=_[_0x8a31('0x38')](_0x48f033[_0x8a31('0x34')],qs[_0x8a31('0x3a')](_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x3a')]));_0x183c99['attributes']=_0x183c99['attributes'][_0x8a31('0x3b')]?_0x183c99['attributes']:_0x48f033[_0x8a31('0x34')];if(!_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x3c')]('nolimit')){_0x183c99[_0x8a31('0x21')]=qs[_0x8a31('0x21')](_0x3aaed4[_0x8a31('0x36')]['limit']);_0x183c99[_0x8a31('0x1f')]=qs[_0x8a31('0x1f')](_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x1f')]);}_0x183c99[_0x8a31('0x3d')]=qs[_0x8a31('0x3e')](_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x3e')]);_0x183c99['where']=qs[_0x8a31('0x37')](_[_0x8a31('0x3f')](_0x3aaed4['query'],_0x48f033[_0x8a31('0x37')]),_0x55fa39);if(_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x40')]){_0x183c99['where']=_[_0x8a31('0x41')](_0x183c99[_0x8a31('0x42')],{'$or':_[_0x8a31('0x2e')](_0x55fa39,function(_0x4845e4){if(_0x4845e4[_0x8a31('0x32')]!==_0x8a31('0x43')){var _0xb34fa2={};_0xb34fa2[_0x4845e4[_0x8a31('0x2b')]]={'$like':'%'+_0x3aaed4[_0x8a31('0x36')]['filter']+'%'};return _0xb34fa2;}})});}_0x183c99=_[_0x8a31('0x41')]({},_0x183c99,_0x3aaed4[_0x8a31('0x44')]);var _0x219270={'where':_0x183c99['where']};return db['Dynamics365Configuration']['count'](_0x219270)[_0x8a31('0x45')](function(_0x5f223b){_0x1246cb['count']=_0x5f223b;if(_0x3aaed4[_0x8a31('0x36')][_0x8a31('0x46')]){_0x183c99[_0x8a31('0x47')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x8a31('0x48')](_0x183c99);})[_0x8a31('0x45')](function(_0x182f87){_0x1246cb[_0x8a31('0x49')]=_0x182f87;return _0x1246cb;})[_0x8a31('0x45')](respondWithFilteredResult(_0x6c48c5,_0x183c99))[_0x8a31('0x4a')](handleError(_0x6c48c5,null));};exports[_0x8a31('0x4b')]=function(_0x391cf0,_0x19ebf6){var _0x1c7758={'raw':![],'where':{'id':_0x391cf0[_0x8a31('0x4c')]['id']}},_0x365464={};_0x365464[_0x8a31('0x34')]=_[_0x8a31('0x35')](db['Dynamics365Configuration'][_0x8a31('0x30')]);_0x365464[_0x8a31('0x36')]=_[_0x8a31('0x35')](_0x391cf0['query']);_0x365464[_0x8a31('0x37')]=_[_0x8a31('0x38')](_0x365464[_0x8a31('0x34')],_0x365464[_0x8a31('0x36')]);_0x1c7758['attributes']=_['intersection'](_0x365464[_0x8a31('0x34')],qs[_0x8a31('0x3a')](_0x391cf0[_0x8a31('0x36')]['fields']));_0x1c7758['attributes']=_0x1c7758[_0x8a31('0x39')]['length']?_0x1c7758['attributes']:_0x365464[_0x8a31('0x34')];if(_0x391cf0[_0x8a31('0x36')]['includeAll']){_0x1c7758[_0x8a31('0x47')]=[{'all':!![]}];}_0x1c7758=_[_0x8a31('0x41')]({},_0x1c7758,_0x391cf0['options']);return db[_0x8a31('0x2f')][_0x8a31('0x4d')](_0x1c7758)['then'](handleEntityNotFound(_0x19ebf6,null))[_0x8a31('0x45')](respondWithResult(_0x19ebf6,null))[_0x8a31('0x4a')](handleError(_0x19ebf6,null));};exports[_0x8a31('0x4e')]=function(_0x1dc93b,_0x1992a2){return db[_0x8a31('0x2f')][_0x8a31('0x4e')](_0x1dc93b[_0x8a31('0x4f')],{})[_0x8a31('0x45')](respondWithResult(_0x1992a2,0xc9))[_0x8a31('0x4a')](handleError(_0x1992a2,null));};exports[_0x8a31('0x28')]=function(_0x2f04f7,_0x58fe63){if(_0x2f04f7[_0x8a31('0x4f')]['id']){delete _0x2f04f7[_0x8a31('0x4f')]['id'];}return db[_0x8a31('0x2f')]['find']({'where':{'id':_0x2f04f7['params']['id']}})[_0x8a31('0x45')](handleEntityNotFound(_0x58fe63,null))['then'](saveUpdates(_0x2f04f7[_0x8a31('0x4f')],null))[_0x8a31('0x45')](respondWithResult(_0x58fe63,null))[_0x8a31('0x4a')](handleError(_0x58fe63,null));};exports[_0x8a31('0x29')]=function(_0x1faf7d,_0x4ba8d7){return db['Dynamics365Configuration'][_0x8a31('0x4d')]({'where':{'id':_0x1faf7d['params']['id']}})[_0x8a31('0x45')](handleEntityNotFound(_0x4ba8d7,null))[_0x8a31('0x45')](removeEntity(_0x4ba8d7,null))[_0x8a31('0x4a')](handleError(_0x4ba8d7,null));};exports[_0x8a31('0x50')]=function(_0xb9efc3,_0x37db1f,_0x27812e){var _0x153fef={};var _0x2ecf3c={};var _0x3c41bb;var _0x3141a5;return db[_0x8a31('0x2f')][_0x8a31('0x51')]({'where':{'id':_0xb9efc3[_0x8a31('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37db1f,null))[_0x8a31('0x45')](function(_0xa9048e){if(_0xa9048e){_0x3c41bb=_0xa9048e;_0x2ecf3c[_0x8a31('0x34')]=_[_0x8a31('0x35')](db[_0x8a31('0x52')][_0x8a31('0x30')]);_0x2ecf3c[_0x8a31('0x36')]=_[_0x8a31('0x35')](_0xb9efc3[_0x8a31('0x36')]);_0x2ecf3c['filters']=_[_0x8a31('0x38')](_0x2ecf3c[_0x8a31('0x34')],_0x2ecf3c['query']);_0x153fef['attributes']=_[_0x8a31('0x38')](_0x2ecf3c['model'],qs['fields'](_0xb9efc3['query'][_0x8a31('0x3a')]));_0x153fef[_0x8a31('0x39')]=_0x153fef[_0x8a31('0x39')]['length']?_0x153fef['attributes']:_0x2ecf3c[_0x8a31('0x34')];_0x153fef[_0x8a31('0x3d')]=qs[_0x8a31('0x3e')](_0xb9efc3['query'][_0x8a31('0x3e')]);_0x153fef['where']=qs['filters'](_[_0x8a31('0x3f')](_0xb9efc3[_0x8a31('0x36')],_0x2ecf3c[_0x8a31('0x37')]));if(_0xb9efc3[_0x8a31('0x36')][_0x8a31('0x40')]){_0x153fef[_0x8a31('0x42')]=_[_0x8a31('0x41')](_0x153fef['where'],{'$or':_[_0x8a31('0x2e')](_0x153fef[_0x8a31('0x39')],function(_0x598a5b){var _0x496f40={};_0x496f40[_0x598a5b]={'$like':'%'+_0xb9efc3[_0x8a31('0x36')][_0x8a31('0x40')]+'%'};return _0x496f40;})});}_0x153fef=_[_0x8a31('0x41')]({},_0x153fef,_0xb9efc3['options']);return _0x3c41bb[_0x8a31('0x50')](_0x153fef);}})[_0x8a31('0x45')](function(_0x4fec0a){if(_0x4fec0a){_0x3141a5=_0x4fec0a[_0x8a31('0x3b')];if(!_0xb9efc3['query'][_0x8a31('0x3c')](_0x8a31('0x53'))){_0x153fef[_0x8a31('0x21')]=qs[_0x8a31('0x21')](_0xb9efc3[_0x8a31('0x36')][_0x8a31('0x21')]);_0x153fef[_0x8a31('0x1f')]=qs[_0x8a31('0x1f')](_0xb9efc3['query'][_0x8a31('0x1f')]);}return _0x3c41bb['getFields'](_0x153fef);}})['then'](function(_0x336f3b){if(_0x336f3b){return _0x336f3b?{'count':_0x3141a5,'rows':_0x336f3b}:null;}})[_0x8a31('0x45')](respondWithResult(_0x37db1f,null))[_0x8a31('0x4a')](handleError(_0x37db1f,null));};exports[_0x8a31('0x54')]=function(_0xbeb138,_0x4570e5,_0x2bf433){var _0x1e22ea={};var _0x99b453={};var _0xd60e66;var _0x24fcc7;return db[_0x8a31('0x2f')][_0x8a31('0x51')]({'where':{'id':_0xbeb138[_0x8a31('0x4c')]['id']}})[_0x8a31('0x45')](handleEntityNotFound(_0x4570e5,null))[_0x8a31('0x45')](function(_0xc52388){if(_0xc52388){_0xd60e66=_0xc52388;_0x99b453[_0x8a31('0x34')]=_['keys'](db[_0x8a31('0x52')][_0x8a31('0x30')]);_0x99b453['query']=_['keys'](_0xbeb138[_0x8a31('0x36')]);_0x99b453[_0x8a31('0x37')]=_[_0x8a31('0x38')](_0x99b453[_0x8a31('0x34')],_0x99b453['query']);_0x1e22ea[_0x8a31('0x39')]=_['intersection'](_0x99b453[_0x8a31('0x34')],qs['fields'](_0xbeb138[_0x8a31('0x36')]['fields']));_0x1e22ea[_0x8a31('0x39')]=_0x1e22ea[_0x8a31('0x39')][_0x8a31('0x3b')]?_0x1e22ea[_0x8a31('0x39')]:_0x99b453['model'];_0x1e22ea['order']=qs['sort'](_0xbeb138[_0x8a31('0x36')][_0x8a31('0x3e')]);_0x1e22ea[_0x8a31('0x42')]=qs[_0x8a31('0x37')](_['pick'](_0xbeb138['query'],_0x99b453[_0x8a31('0x37')]));if(_0xbeb138[_0x8a31('0x36')][_0x8a31('0x40')]){_0x1e22ea[_0x8a31('0x42')]=_[_0x8a31('0x41')](_0x1e22ea[_0x8a31('0x42')],{'$or':_[_0x8a31('0x2e')](_0x1e22ea[_0x8a31('0x39')],function(_0x160720){var _0x8e09c0={};_0x8e09c0[_0x160720]={'$like':'%'+_0xbeb138['query'][_0x8a31('0x40')]+'%'};return _0x8e09c0;})});}_0x1e22ea=_[_0x8a31('0x41')]({},_0x1e22ea,_0xbeb138[_0x8a31('0x44')]);return _0xd60e66[_0x8a31('0x54')](_0x1e22ea);}})[_0x8a31('0x45')](function(_0x4a258b){if(_0x4a258b){_0x24fcc7=_0x4a258b[_0x8a31('0x3b')];if(!_0xbeb138[_0x8a31('0x36')][_0x8a31('0x3c')]('nolimit')){_0x1e22ea[_0x8a31('0x21')]=qs[_0x8a31('0x21')](_0xbeb138[_0x8a31('0x36')][_0x8a31('0x21')]);_0x1e22ea['offset']=qs[_0x8a31('0x1f')](_0xbeb138[_0x8a31('0x36')][_0x8a31('0x1f')]);}return _0xd60e66[_0x8a31('0x54')](_0x1e22ea);}})['then'](function(_0x543485){if(_0x543485){return _0x543485?{'count':_0x24fcc7,'rows':_0x543485}:null;}})[_0x8a31('0x45')](respondWithResult(_0x4570e5,null))[_0x8a31('0x4a')](handleError(_0x4570e5,null));};exports[_0x8a31('0x55')]=function(_0x568022,_0x4b0782,_0x5ce556){var _0x59318c={};var _0x102dba={};var _0x2b4156;var _0x42547e;return db[_0x8a31('0x2f')][_0x8a31('0x51')]({'where':{'id':_0x568022['params']['id']}})[_0x8a31('0x45')](handleEntityNotFound(_0x4b0782,null))[_0x8a31('0x45')](function(_0x3ffa26){if(_0x3ffa26){_0x2b4156=_0x3ffa26;_0x102dba[_0x8a31('0x34')]=_['keys'](db[_0x8a31('0x52')]['rawAttributes']);_0x102dba[_0x8a31('0x36')]=_['keys'](_0x568022[_0x8a31('0x36')]);_0x102dba[_0x8a31('0x37')]=_[_0x8a31('0x38')](_0x102dba['model'],_0x102dba[_0x8a31('0x36')]);_0x59318c['attributes']=_[_0x8a31('0x38')](_0x102dba[_0x8a31('0x34')],qs[_0x8a31('0x3a')](_0x568022[_0x8a31('0x36')][_0x8a31('0x3a')]));_0x59318c[_0x8a31('0x39')]=_0x59318c[_0x8a31('0x39')][_0x8a31('0x3b')]?_0x59318c['attributes']:_0x102dba[_0x8a31('0x34')];_0x59318c[_0x8a31('0x3d')]=qs[_0x8a31('0x3e')](_0x568022[_0x8a31('0x36')]['sort']);_0x59318c[_0x8a31('0x42')]=qs[_0x8a31('0x37')](_[_0x8a31('0x3f')](_0x568022['query'],_0x102dba['filters']));if(_0x568022[_0x8a31('0x36')][_0x8a31('0x40')]){_0x59318c['where']=_[_0x8a31('0x41')](_0x59318c[_0x8a31('0x42')],{'$or':_[_0x8a31('0x2e')](_0x59318c[_0x8a31('0x39')],function(_0x4d79e0){var _0x5a0e10={};_0x5a0e10[_0x4d79e0]={'$like':'%'+_0x568022[_0x8a31('0x36')][_0x8a31('0x40')]+'%'};return _0x5a0e10;})});}_0x59318c=_[_0x8a31('0x41')]({},_0x59318c,_0x568022[_0x8a31('0x44')]);return _0x2b4156[_0x8a31('0x55')](_0x59318c);}})[_0x8a31('0x45')](function(_0x1163c2){if(_0x1163c2){_0x42547e=_0x1163c2[_0x8a31('0x3b')];if(!_0x568022[_0x8a31('0x36')][_0x8a31('0x3c')](_0x8a31('0x53'))){_0x59318c[_0x8a31('0x21')]=qs[_0x8a31('0x21')](_0x568022[_0x8a31('0x36')][_0x8a31('0x21')]);_0x59318c[_0x8a31('0x1f')]=qs['offset'](_0x568022[_0x8a31('0x36')][_0x8a31('0x1f')]);}return _0x2b4156[_0x8a31('0x55')](_0x59318c);}})['then'](function(_0x3b1d6c){if(_0x3b1d6c){return _0x3b1d6c?{'count':_0x42547e,'rows':_0x3b1d6c}:null;}})['then'](respondWithResult(_0x4b0782,null))[_0x8a31('0x4a')](handleError(_0x4b0782,null));}; \ No newline at end of file +var _0xe994=['squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','send','index','map','Dynamics365Configuration','rawAttributes','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','catch','params','keys','merge','find','create','body','findOne','getFields','nolimit','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x13d8af,_0x51ee52){var _0x981d50=function(_0x5ab5b4){while(--_0x5ab5b4){_0x13d8af['push'](_0x13d8af['shift']());}};_0x981d50(++_0x51ee52);}(_0xe994,0x1bc));var _0x4e99=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0xe994[_0x1b3a09];return _0x357bb8;};'use strict';var emlformat=require(_0x4e99('0x0'));var rimraf=require(_0x4e99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e99('0x2'));var rp=require(_0x4e99('0x3'));var moment=require('moment');var BPromise=require(_0x4e99('0x4'));var Mustache=require(_0x4e99('0x5'));var util=require('util');var path=require(_0x4e99('0x6'));var sox=require(_0x4e99('0x7'));var csv=require(_0x4e99('0x8'));var ejs=require(_0x4e99('0x9'));var fs=require('fs');var fs_extra=require(_0x4e99('0xa'));var _=require(_0x4e99('0xb'));var squel=require(_0x4e99('0xc'));var crypto=require(_0x4e99('0xd'));var jsforce=require(_0x4e99('0xe'));var deskjs=require(_0x4e99('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4e99('0x10'));var qs=require(_0x4e99('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e99('0x12'));var utils=require(_0x4e99('0x13'));var config=require(_0x4e99('0x14'));var licenseUtil=require(_0x4e99('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc7ad,_0x535545){_0x535545=_0x535545||0xcc;return function(_0x12294e){if(_0x12294e){return _0x2bc7ad[_0x4e99('0x16')](_0x535545);}return _0x2bc7ad[_0x4e99('0x17')](_0x535545)[_0x4e99('0x18')]();};}function respondWithResult(_0x52d94b,_0xfbe5c9){_0xfbe5c9=_0xfbe5c9||0xc8;return function(_0x4873b3){if(_0x4873b3){return _0x52d94b['status'](_0xfbe5c9)['json'](_0x4873b3);}};}function respondWithFilteredResult(_0x422978,_0x10ae7e){return function(_0x379486){if(_0x379486){var _0x39b9ab=typeof _0x10ae7e[_0x4e99('0x19')]===_0x4e99('0x1a')&&typeof _0x10ae7e[_0x4e99('0x1b')]===_0x4e99('0x1a');var _0x5d4aa6=_0x379486[_0x4e99('0x1c')];var _0xc58b44=_0x39b9ab?0x0:_0x10ae7e['offset'];var _0x5241d9=_0x39b9ab?_0x379486[_0x4e99('0x1c')]:_0x10ae7e[_0x4e99('0x19')]+_0x10ae7e['limit'];var _0x542aac;if(_0x5241d9>=_0x5d4aa6){_0x5241d9=_0x5d4aa6;_0x542aac=0xc8;}else{_0x542aac=0xce;}_0x422978[_0x4e99('0x17')](_0x542aac);return _0x422978[_0x4e99('0x1d')](_0x4e99('0x1e'),_0xc58b44+'-'+_0x5241d9+'/'+_0x5d4aa6)[_0x4e99('0x1f')](_0x379486);}return null;};}function patchUpdates(_0x39c121){return function(_0x30b8b7){try{jsonpatch['apply'](_0x30b8b7,_0x39c121,!![]);}catch(_0x34595c){return BPromise['reject'](_0x34595c);}return _0x30b8b7[_0x4e99('0x20')]();};}function saveUpdates(_0x56b3f1,_0x2e4ecd){return function(_0x1bb5f3){if(_0x1bb5f3){return _0x1bb5f3[_0x4e99('0x21')](_0x56b3f1)[_0x4e99('0x22')](function(_0x45c85b){return _0x45c85b;});}return null;};}function removeEntity(_0x4addc2,_0x560041){return function(_0x18f84a){if(_0x18f84a){return _0x18f84a[_0x4e99('0x23')]()['then'](function(){_0x4addc2[_0x4e99('0x17')](0xcc)[_0x4e99('0x18')]();});}};}function handleEntityNotFound(_0x5ab9a7,_0x24f0c3){return function(_0x56b923){if(!_0x56b923){_0x5ab9a7[_0x4e99('0x16')](0x194);}return _0x56b923;};}function handleError(_0x7095ac,_0x23b303){_0x23b303=_0x23b303||0x1f4;return function(_0x2bac02){logger[_0x4e99('0x24')](_0x2bac02[_0x4e99('0x25')]);if(_0x2bac02['name']){delete _0x2bac02['name'];}_0x7095ac[_0x4e99('0x17')](_0x23b303)[_0x4e99('0x26')](_0x2bac02);};}exports[_0x4e99('0x27')]=function(_0xfe6969,_0x55cd80){var _0x57a6f5={},_0x58156c={},_0x3a58ec={'count':0x0,'rows':[]};var _0x269854=_[_0x4e99('0x28')](db[_0x4e99('0x29')][_0x4e99('0x2a')],function(_0x412db1){return{'name':_0x412db1['fieldName'],'type':_0x412db1['type'][_0x4e99('0x2b')]};});_0x58156c['model']=_[_0x4e99('0x28')](_0x269854,_0x4e99('0x2c'));_0x58156c[_0x4e99('0x2d')]=_['keys'](_0xfe6969[_0x4e99('0x2d')]);_0x58156c['filters']=_[_0x4e99('0x2e')](_0x58156c[_0x4e99('0x2f')],_0x58156c['query']);_0x57a6f5[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x58156c[_0x4e99('0x2f')],qs['fields'](_0xfe6969['query'][_0x4e99('0x31')]));_0x57a6f5[_0x4e99('0x30')]=_0x57a6f5[_0x4e99('0x30')][_0x4e99('0x32')]?_0x57a6f5['attributes']:_0x58156c[_0x4e99('0x2f')];if(!_0xfe6969['query'][_0x4e99('0x33')]('nolimit')){_0x57a6f5[_0x4e99('0x1b')]=qs['limit'](_0xfe6969['query'][_0x4e99('0x1b')]);_0x57a6f5[_0x4e99('0x19')]=qs['offset'](_0xfe6969['query']['offset']);}_0x57a6f5[_0x4e99('0x34')]=qs[_0x4e99('0x35')](_0xfe6969[_0x4e99('0x2d')][_0x4e99('0x35')]);_0x57a6f5[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0xfe6969['query'],_0x58156c[_0x4e99('0x37')]),_0x269854);if(_0xfe6969['query'][_0x4e99('0x39')]){_0x57a6f5[_0x4e99('0x36')]=_['merge'](_0x57a6f5['where'],{'$or':_['map'](_0x269854,function(_0x32db63){if(_0x32db63[_0x4e99('0x3a')]!==_0x4e99('0x3b')){var _0x3af38d={};_0x3af38d[_0x32db63[_0x4e99('0x2c')]]={'$like':'%'+_0xfe6969['query'][_0x4e99('0x39')]+'%'};return _0x3af38d;}})});}_0x57a6f5=_['merge']({},_0x57a6f5,_0xfe6969[_0x4e99('0x3c')]);var _0x1b51c5={'where':_0x57a6f5['where']};return db[_0x4e99('0x29')]['count'](_0x1b51c5)[_0x4e99('0x22')](function(_0x5e3c04){_0x3a58ec[_0x4e99('0x1c')]=_0x5e3c04;if(_0xfe6969[_0x4e99('0x2d')][_0x4e99('0x3d')]){_0x57a6f5[_0x4e99('0x3e')]=[{'all':!![]}];}return db[_0x4e99('0x29')]['findAll'](_0x57a6f5);})[_0x4e99('0x22')](function(_0x448ad0){_0x3a58ec['rows']=_0x448ad0;return _0x3a58ec;})[_0x4e99('0x22')](respondWithFilteredResult(_0x55cd80,_0x57a6f5))[_0x4e99('0x3f')](handleError(_0x55cd80,null));};exports['show']=function(_0x307ea9,_0x364b2b){var _0x578400={'raw':![],'where':{'id':_0x307ea9[_0x4e99('0x40')]['id']}},_0x475aa9={};_0x475aa9[_0x4e99('0x2f')]=_[_0x4e99('0x41')](db[_0x4e99('0x29')][_0x4e99('0x2a')]);_0x475aa9[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x307ea9[_0x4e99('0x2d')]);_0x475aa9[_0x4e99('0x37')]=_[_0x4e99('0x2e')](_0x475aa9[_0x4e99('0x2f')],_0x475aa9[_0x4e99('0x2d')]);_0x578400[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x475aa9[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x307ea9[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x578400['attributes']=_0x578400[_0x4e99('0x30')][_0x4e99('0x32')]?_0x578400[_0x4e99('0x30')]:_0x475aa9[_0x4e99('0x2f')];if(_0x307ea9['query'][_0x4e99('0x3d')]){_0x578400[_0x4e99('0x3e')]=[{'all':!![]}];}_0x578400=_[_0x4e99('0x42')]({},_0x578400,_0x307ea9[_0x4e99('0x3c')]);return db[_0x4e99('0x29')][_0x4e99('0x43')](_0x578400)[_0x4e99('0x22')](handleEntityNotFound(_0x364b2b,null))['then'](respondWithResult(_0x364b2b,null))['catch'](handleError(_0x364b2b,null));};exports[_0x4e99('0x44')]=function(_0x4cbe4f,_0x3d88e2){return db[_0x4e99('0x29')]['create'](_0x4cbe4f['body'],{})[_0x4e99('0x22')](respondWithResult(_0x3d88e2,0xc9))[_0x4e99('0x3f')](handleError(_0x3d88e2,null));};exports[_0x4e99('0x21')]=function(_0x3e1553,_0x706d18){if(_0x3e1553[_0x4e99('0x45')]['id']){delete _0x3e1553[_0x4e99('0x45')]['id'];}return db[_0x4e99('0x29')][_0x4e99('0x43')]({'where':{'id':_0x3e1553[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x706d18,null))['then'](saveUpdates(_0x3e1553[_0x4e99('0x45')],null))[_0x4e99('0x22')](respondWithResult(_0x706d18,null))['catch'](handleError(_0x706d18,null));};exports[_0x4e99('0x23')]=function(_0x5690c3,_0x5dce84){return db[_0x4e99('0x29')][_0x4e99('0x43')]({'where':{'id':_0x5690c3[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x5dce84,null))[_0x4e99('0x22')](removeEntity(_0x5dce84,null))[_0x4e99('0x3f')](handleError(_0x5dce84,null));};exports['getFields']=function(_0x275b7b,_0x5f1977,_0x4f45df){var _0x569cd8={};var _0x34765d={};var _0x539e8f;var _0x41c26a;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x275b7b[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x5f1977,null))['then'](function(_0x62699c){if(_0x62699c){_0x539e8f=_0x62699c;_0x34765d[_0x4e99('0x2f')]=_['keys'](db['Dynamics365Field'][_0x4e99('0x2a')]);_0x34765d[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x275b7b[_0x4e99('0x2d')]);_0x34765d['filters']=_[_0x4e99('0x2e')](_0x34765d[_0x4e99('0x2f')],_0x34765d[_0x4e99('0x2d')]);_0x569cd8[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x34765d[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x569cd8[_0x4e99('0x30')]=_0x569cd8['attributes'][_0x4e99('0x32')]?_0x569cd8['attributes']:_0x34765d[_0x4e99('0x2f')];_0x569cd8['order']=qs[_0x4e99('0x35')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x35')]);_0x569cd8[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0x275b7b[_0x4e99('0x2d')],_0x34765d[_0x4e99('0x37')]));if(_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x39')]){_0x569cd8[_0x4e99('0x36')]=_[_0x4e99('0x42')](_0x569cd8[_0x4e99('0x36')],{'$or':_[_0x4e99('0x28')](_0x569cd8[_0x4e99('0x30')],function(_0x573266){var _0x4a2816={};_0x4a2816[_0x573266]={'$like':'%'+_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x39')]+'%'};return _0x4a2816;})});}_0x569cd8=_['merge']({},_0x569cd8,_0x275b7b[_0x4e99('0x3c')]);return _0x539e8f[_0x4e99('0x47')](_0x569cd8);}})[_0x4e99('0x22')](function(_0x1cd241){if(_0x1cd241){_0x41c26a=_0x1cd241[_0x4e99('0x32')];if(!_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x33')](_0x4e99('0x48'))){_0x569cd8[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x1b')]);_0x569cd8[_0x4e99('0x19')]=qs[_0x4e99('0x19')](_0x275b7b[_0x4e99('0x2d')]['offset']);}return _0x539e8f[_0x4e99('0x47')](_0x569cd8);}})[_0x4e99('0x22')](function(_0x43c7e9){if(_0x43c7e9){return _0x43c7e9?{'count':_0x41c26a,'rows':_0x43c7e9}:null;}})[_0x4e99('0x22')](respondWithResult(_0x5f1977,null))['catch'](handleError(_0x5f1977,null));};exports['getSubjects']=function(_0x4045b2,_0x32ff4e,_0xfebf39){var _0xae226c={};var _0x4c3399={};var _0x37d481;var _0x4606c0;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x4045b2[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x32ff4e,null))['then'](function(_0x1c5f36){if(_0x1c5f36){_0x37d481=_0x1c5f36;_0x4c3399['model']=_['keys'](db[_0x4e99('0x49')][_0x4e99('0x2a')]);_0x4c3399[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x4045b2['query']);_0x4c3399['filters']=_[_0x4e99('0x2e')](_0x4c3399['model'],_0x4c3399[_0x4e99('0x2d')]);_0xae226c[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x4c3399[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x31')]));_0xae226c[_0x4e99('0x30')]=_0xae226c[_0x4e99('0x30')][_0x4e99('0x32')]?_0xae226c[_0x4e99('0x30')]:_0x4c3399[_0x4e99('0x2f')];_0xae226c['order']=qs[_0x4e99('0x35')](_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x35')]);_0xae226c[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0x4045b2['query'],_0x4c3399[_0x4e99('0x37')]));if(_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x39')]){_0xae226c['where']=_[_0x4e99('0x42')](_0xae226c['where'],{'$or':_[_0x4e99('0x28')](_0xae226c['attributes'],function(_0x2da46){var _0x54130c={};_0x54130c[_0x2da46]={'$like':'%'+_0x4045b2['query'][_0x4e99('0x39')]+'%'};return _0x54130c;})});}_0xae226c=_[_0x4e99('0x42')]({},_0xae226c,_0x4045b2[_0x4e99('0x3c')]);return _0x37d481[_0x4e99('0x4a')](_0xae226c);}})['then'](function(_0x4084fb){if(_0x4084fb){_0x4606c0=_0x4084fb[_0x4e99('0x32')];if(!_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x33')](_0x4e99('0x48'))){_0xae226c[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x4045b2[_0x4e99('0x2d')]['limit']);_0xae226c['offset']=qs['offset'](_0x4045b2[_0x4e99('0x2d')]['offset']);}return _0x37d481['getSubjects'](_0xae226c);}})['then'](function(_0x567cd4){if(_0x567cd4){return _0x567cd4?{'count':_0x4606c0,'rows':_0x567cd4}:null;}})[_0x4e99('0x22')](respondWithResult(_0x32ff4e,null))[_0x4e99('0x3f')](handleError(_0x32ff4e,null));};exports[_0x4e99('0x4b')]=function(_0x2546fd,_0x4e269b,_0xd19d7){var _0x42fefa={};var _0x4ec73a={};var _0x5bcbd2;var _0x70dc70;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x2546fd[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x4e269b,null))[_0x4e99('0x22')](function(_0x54934d){if(_0x54934d){_0x5bcbd2=_0x54934d;_0x4ec73a[_0x4e99('0x2f')]=_[_0x4e99('0x41')](db[_0x4e99('0x49')][_0x4e99('0x2a')]);_0x4ec73a[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x2546fd['query']);_0x4ec73a[_0x4e99('0x37')]=_['intersection'](_0x4ec73a['model'],_0x4ec73a['query']);_0x42fefa[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x4ec73a[_0x4e99('0x2f')],qs['fields'](_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x42fefa[_0x4e99('0x30')]=_0x42fefa['attributes'][_0x4e99('0x32')]?_0x42fefa[_0x4e99('0x30')]:_0x4ec73a[_0x4e99('0x2f')];_0x42fefa[_0x4e99('0x34')]=qs[_0x4e99('0x35')](_0x2546fd['query'][_0x4e99('0x35')]);_0x42fefa[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_['pick'](_0x2546fd[_0x4e99('0x2d')],_0x4ec73a[_0x4e99('0x37')]));if(_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x39')]){_0x42fefa[_0x4e99('0x36')]=_[_0x4e99('0x42')](_0x42fefa[_0x4e99('0x36')],{'$or':_[_0x4e99('0x28')](_0x42fefa[_0x4e99('0x30')],function(_0x56a4cd){var _0x5a801a={};_0x5a801a[_0x56a4cd]={'$like':'%'+_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x39')]+'%'};return _0x5a801a;})});}_0x42fefa=_[_0x4e99('0x42')]({},_0x42fefa,_0x2546fd[_0x4e99('0x3c')]);return _0x5bcbd2[_0x4e99('0x4b')](_0x42fefa);}})[_0x4e99('0x22')](function(_0x26535c){if(_0x26535c){_0x70dc70=_0x26535c[_0x4e99('0x32')];if(!_0x2546fd[_0x4e99('0x2d')]['hasOwnProperty'](_0x4e99('0x48'))){_0x42fefa[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x2546fd[_0x4e99('0x2d')]['limit']);_0x42fefa['offset']=qs[_0x4e99('0x19')](_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x19')]);}return _0x5bcbd2[_0x4e99('0x4b')](_0x42fefa);}})[_0x4e99('0x22')](function(_0x5b0ff2){if(_0x5b0ff2){return _0x5b0ff2?{'count':_0x70dc70,'rows':_0x5b0ff2}:null;}})[_0x4e99('0x22')](respondWithResult(_0x4e269b,null))['catch'](handleError(_0x4e269b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c9cfbc6..7e708fa 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x1e97c4,_0x42d7b2){var _0x54a726=function(_0x55bd7c){while(--_0x55bd7c){_0x1e97c4['push'](_0x1e97c4['shift']());}};_0x54a726(++_0x42d7b2);}(_0x9f62,0x154));var _0x29f6=function(_0x327a57,_0x33dfb9){_0x327a57=_0x327a57-0x0;var _0x457caf=_0x9f62[_0x327a57];return _0x457caf;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x4053b8,_0x236f4d){var _0x3b5e3e=function(_0x1bb48d){while(--_0x1bb48d){_0x4053b8['push'](_0x4053b8['shift']());}};_0x3b5e3e(++_0x236f4d);}(_0xedd9,0xfc));var _0x9edd=function(_0x573b69,_0x3bd144){_0x573b69=_0x573b69-0x0;var _0x4f4f25=_0xedd9[_0x573b69];return _0x4f4f25;};'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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 8bdb8a0..4e924c3 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 _0x33d6=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x33d6,0x1e5));var _0x633d=function(_0x4119b9,_0x2135b6){_0x4119b9=_0x4119b9-0x0;var _0x421d6a=_0x33d6[_0x4119b9];return _0x421d6a;};'use strict';var _=require(_0x633d('0x0'));var util=require(_0x633d('0x1'));var moment=require(_0x633d('0x2'));var BPromise=require('bluebird');var rs=require(_0x633d('0x3'));var fs=require('fs');var Redis=require(_0x633d('0x4'));var db=require(_0x633d('0x5'))['db'];var utils=require(_0x633d('0x6'));var logger=require(_0x633d('0x7'))(_0x633d('0x8'));var config=require(_0x633d('0x9'));var jayson=require(_0x633d('0xa'));var client=jayson[_0x633d('0xb')][_0x633d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c1ec5,_0x1389a8,_0x1a28dd){return new BPromise(function(_0xcd9db9,_0x573a9b){return client[_0x633d('0xd')](_0x4c1ec5,_0x1a28dd)['then'](function(_0x10dba2){logger['info'](_0x633d('0xe'),_0x1389a8,_0x633d('0xf'));logger[_0x633d('0x10')](_0x633d('0x11'),_0x1389a8,_0x633d('0xf'),JSON['stringify'](_0x10dba2));if(_0x10dba2[_0x633d('0x12')]){if(_0x10dba2[_0x633d('0x12')][_0x633d('0x13')]===0x1f4){logger[_0x633d('0x12')](_0x633d('0xe'),_0x1389a8,_0x10dba2['error']['message']);return _0x573a9b(_0x10dba2['error'][_0x633d('0x14')]);}logger[_0x633d('0x12')](_0x633d('0xe'),_0x1389a8,_0x10dba2['error'][_0x633d('0x14')]);return _0xcd9db9(_0x10dba2[_0x633d('0x12')][_0x633d('0x14')]);}else{logger['info'](_0x633d('0xe'),_0x1389a8,_0x633d('0xf'));_0xcd9db9(_0x10dba2[_0x633d('0x15')][_0x633d('0x14')]);}})[_0x633d('0x16')](function(_0x328573){logger[_0x633d('0x12')](_0x633d('0xe'),_0x1389a8,_0x328573);_0x573a9b(_0x328573);});});} \ No newline at end of file +var _0x929f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x38eee0,_0x3e1bda){var _0x9748c0=function(_0x58f950){while(--_0x58f950){_0x38eee0['push'](_0x38eee0['shift']());}};_0x9748c0(++_0x3e1bda);}(_0x929f,0x1c8));var _0xf929=function(_0x37cdc5,_0x5510ba){_0x37cdc5=_0x37cdc5-0x0;var _0x1aa6be=_0x929f[_0x37cdc5];return _0x1aa6be;};'use strict';var _=require(_0xf929('0x0'));var util=require(_0xf929('0x1'));var moment=require(_0xf929('0x2'));var BPromise=require(_0xf929('0x3'));var rs=require(_0xf929('0x4'));var fs=require('fs');var Redis=require(_0xf929('0x5'));var db=require(_0xf929('0x6'))['db'];var utils=require(_0xf929('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf929('0x8'));var jayson=require(_0xf929('0x9'));var client=jayson[_0xf929('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209ae1,_0x2d8d78,_0x12daea){return new BPromise(function(_0x12e273,_0x115275){return client['request'](_0x209ae1,_0x12daea)[_0xf929('0xb')](function(_0x3aaad3){logger[_0xf929('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2d8d78,'request\x20sent');logger['debug'](_0xf929('0xd'),_0x2d8d78,'request\x20sent',JSON['stringify'](_0x3aaad3));if(_0x3aaad3[_0xf929('0xe')]){if(_0x3aaad3[_0xf929('0xe')][_0xf929('0xf')]===0x1f4){logger[_0xf929('0xe')](_0xf929('0x10'),_0x2d8d78,_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);return _0x115275(_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);}logger[_0xf929('0xe')](_0xf929('0x10'),_0x2d8d78,_0x3aaad3['error'][_0xf929('0x11')]);return _0x12e273(_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);}else{logger['info'](_0xf929('0x10'),_0x2d8d78,_0xf929('0x12'));_0x12e273(_0x3aaad3[_0xf929('0x13')][_0xf929('0x11')]);}})['catch'](function(_0x1802c9){logger['error'](_0xf929('0x10'),_0x2d8d78,_0x1802c9);_0x115275(_0x1802c9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 92ae5ec..766f345 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 _0xd92e=['show','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','/:id'];(function(_0x288bb4,_0xf1a8ea){var _0x4e42cd=function(_0x351d30){while(--_0x351d30){_0x288bb4['push'](_0x288bb4['shift']());}};_0x4e42cd(++_0xf1a8ea);}(_0xd92e,0xa0));var _0xed92=function(_0x406821,_0x275d49){_0x406821=_0x406821-0x0;var _0x4d6035=_0xd92e[_0x406821];return _0x4d6035;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed92('0x0'));var timeout=require(_0xed92('0x1'));var express=require('express');var router=express[_0xed92('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed92('0x3'));var config=require(_0xed92('0x4'));var controller=require(_0xed92('0x5'));router['get']('/',auth[_0xed92('0x6')](),controller['index']);router['get'](_0xed92('0x7'),auth[_0xed92('0x6')](),controller[_0xed92('0x8')]);router['post']('/',auth[_0xed92('0x6')](),controller['create']);router[_0xed92('0x9')](_0xed92('0x7'),auth['isAuthenticated'](),controller[_0xed92('0xa')]);router[_0xed92('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xed92('0xc')]);module[_0xed92('0xd')]=router; \ No newline at end of file +var _0x8a14=['show','post','isAuthenticated','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id'];(function(_0x44179f,_0x3e5b2e){var _0x44fb58=function(_0x228ded){while(--_0x228ded){_0x44179f['push'](_0x44179f['shift']());}};_0x44fb58(++_0x3e5b2e);}(_0x8a14,0xff));var _0x48a1=function(_0x5fc770,_0x4116c6){_0x5fc770=_0x5fc770-0x0;var _0x292910=_0x8a14[_0x5fc770];return _0x292910;};'use strict';var multer=require(_0x48a1('0x0'));var util=require('util');var path=require(_0x48a1('0x1'));var timeout=require(_0x48a1('0x2'));var express=require('express');var router=express[_0x48a1('0x3')]();var fs_extra=require(_0x48a1('0x4'));var auth=require(_0x48a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48a1('0x6'));var controller=require(_0x48a1('0x7'));router[_0x48a1('0x8')]('/',auth['isAuthenticated'](),controller[_0x48a1('0x9')]);router[_0x48a1('0x8')](_0x48a1('0xa'),auth['isAuthenticated'](),controller[_0x48a1('0xb')]);router[_0x48a1('0xc')]('/',auth[_0x48a1('0xd')](),controller[_0x48a1('0xe')]);router[_0x48a1('0xf')](_0x48a1('0xa'),auth[_0x48a1('0xd')](),controller[_0x48a1('0x10')]);router['delete'](_0x48a1('0xa'),auth['isAuthenticated'](),controller[_0x48a1('0x11')]);module[_0x48a1('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 ba4d09d..2dd6c31 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 _0xef9f=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x398d6d,_0x23dc75){var _0x572675=function(_0x4fe30b){while(--_0x4fe30b){_0x398d6d['push'](_0x398d6d['shift']());}};_0x572675(++_0x23dc75);}(_0xef9f,0x99));var _0xfef9=function(_0x21efd3,_0x5032c2){_0x21efd3=_0x21efd3-0x0;var _0x3b2c51=_0xef9f[_0x21efd3];return _0x3b2c51;};'use strict';var Sequelize=require(_0xfef9('0x0'));module[_0xfef9('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfef9('0x2'),_0xfef9('0x3'),_0xfef9('0x4'),_0xfef9('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfef9('0x6')]},'keyType':{'type':Sequelize[_0xfef9('0x7')](_0xfef9('0x2'),_0xfef9('0x3'),_0xfef9('0x4'))},'keyContent':{'type':Sequelize[_0xfef9('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfef9('0x6')]},'customField':{'type':Sequelize[_0xfef9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfef9('0x6')]}}; \ No newline at end of file +var _0x2ad0=['STRING','customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2ad0,0x147));var _0x02ad=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x2ad0[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require('sequelize');module[_0x02ad('0x0')]={'type':{'type':Sequelize[_0x02ad('0x1')](_0x02ad('0x2'),_0x02ad('0x3'),'customVariable',_0x02ad('0x4'),_0x02ad('0x5')),'defaultValue':_0x02ad('0x2')},'content':{'type':Sequelize[_0x02ad('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x02ad('0x1')](_0x02ad('0x2'),_0x02ad('0x3'),_0x02ad('0x7'))},'keyContent':{'type':Sequelize[_0x02ad('0x6')]},'idField':{'type':Sequelize[_0x02ad('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x02ad('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02ad('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5ba2592..bc0fcfa 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 _0x0c09=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Field','include','findAll','show','params','fields','create','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x0c09,0x88));var _0x90c0=function(_0x4ec857,_0x207f40){_0x4ec857=_0x4ec857-0x0;var _0x5922ec=_0x0c09[_0x4ec857];return _0x5922ec;};'use strict';var emlformat=require(_0x90c0('0x0'));var rimraf=require(_0x90c0('0x1'));var zipdir=require(_0x90c0('0x2'));var jsonpatch=require(_0x90c0('0x3'));var rp=require(_0x90c0('0x4'));var moment=require(_0x90c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x90c0('0x6'));var util=require(_0x90c0('0x7'));var path=require(_0x90c0('0x8'));var sox=require(_0x90c0('0x9'));var csv=require('to-csv');var ejs=require(_0x90c0('0xa'));var fs=require('fs');var fs_extra=require(_0x90c0('0xb'));var _=require(_0x90c0('0xc'));var squel=require(_0x90c0('0xd'));var crypto=require(_0x90c0('0xe'));var jsforce=require(_0x90c0('0xf'));var deskjs=require(_0x90c0('0x10'));var toCsv=require(_0x90c0('0x11'));var querystring=require(_0x90c0('0x12'));var Papa=require('papaparse');var Redis=require(_0x90c0('0x13'));var authService=require(_0x90c0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x90c0('0x15'));var hardwareService=require(_0x90c0('0x16'));var logger=require(_0x90c0('0x17'))(_0x90c0('0x18'));var utils=require(_0x90c0('0x19'));var config=require(_0x90c0('0x1a'));var licenseUtil=require(_0x90c0('0x1b'));var db=require(_0x90c0('0x1c'))['db'];function respondWithStatusCode(_0x5a91e1,_0x3ef8ce){_0x3ef8ce=_0x3ef8ce||0xcc;return function(_0x5687ff){if(_0x5687ff){return _0x5a91e1['sendStatus'](_0x3ef8ce);}return _0x5a91e1[_0x90c0('0x1d')](_0x3ef8ce)['end']();};}function respondWithResult(_0x5852bb,_0x28067a){_0x28067a=_0x28067a||0xc8;return function(_0x223548){if(_0x223548){return _0x5852bb[_0x90c0('0x1d')](_0x28067a)[_0x90c0('0x1e')](_0x223548);}};}function respondWithFilteredResult(_0x515627,_0x32a347){return function(_0x20dcdb){if(_0x20dcdb){var _0xba06f3=typeof _0x32a347[_0x90c0('0x1f')]==='undefined'&&typeof _0x32a347[_0x90c0('0x20')]==='undefined';var _0x1680a5=_0x20dcdb['count'];var _0x84c5b2=_0xba06f3?0x0:_0x32a347[_0x90c0('0x1f')];var _0x421efe=_0xba06f3?_0x20dcdb[_0x90c0('0x21')]:_0x32a347[_0x90c0('0x1f')]+_0x32a347[_0x90c0('0x20')];var _0x5d6e5e;if(_0x421efe>=_0x1680a5){_0x421efe=_0x1680a5;_0x5d6e5e=0xc8;}else{_0x5d6e5e=0xce;}_0x515627[_0x90c0('0x1d')](_0x5d6e5e);return _0x515627[_0x90c0('0x22')](_0x90c0('0x23'),_0x84c5b2+'-'+_0x421efe+'/'+_0x1680a5)[_0x90c0('0x1e')](_0x20dcdb);}return null;};}function patchUpdates(_0x31111c){return function(_0xba9cf4){try{jsonpatch[_0x90c0('0x24')](_0xba9cf4,_0x31111c,!![]);}catch(_0x3a30ae){return BPromise[_0x90c0('0x25')](_0x3a30ae);}return _0xba9cf4[_0x90c0('0x26')]();};}function saveUpdates(_0x3b407e,_0x21176a){return function(_0x392e0a){if(_0x392e0a){return _0x392e0a[_0x90c0('0x27')](_0x3b407e)['then'](function(_0x8c3f15){return _0x8c3f15;});}return null;};}function removeEntity(_0x4b70b,_0x5ebad4){return function(_0x33bae8){if(_0x33bae8){return _0x33bae8[_0x90c0('0x28')]()[_0x90c0('0x29')](function(){_0x4b70b[_0x90c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d95e6,_0x21b193){return function(_0x192e37){if(!_0x192e37){_0x7d95e6[_0x90c0('0x2a')](0x194);}return _0x192e37;};}function handleError(_0x410e43,_0x551683){_0x551683=_0x551683||0x1f4;return function(_0x1466b4){logger['error'](_0x1466b4['stack']);if(_0x1466b4[_0x90c0('0x2b')]){delete _0x1466b4[_0x90c0('0x2b')];}_0x410e43[_0x90c0('0x1d')](_0x551683)[_0x90c0('0x2c')](_0x1466b4);};}exports[_0x90c0('0x2d')]=function(_0x3cd21a,_0x5beef6){var _0x6926f0={},_0x7b26ad={},_0xd01a61={'count':0x0,'rows':[]};var _0x5eb49f=_['map'](db['Dynamics365Field'][_0x90c0('0x2e')],function(_0x256ada){return{'name':_0x256ada[_0x90c0('0x2f')],'type':_0x256ada['type'][_0x90c0('0x30')]};});_0x7b26ad[_0x90c0('0x31')]=_[_0x90c0('0x32')](_0x5eb49f,_0x90c0('0x2b'));_0x7b26ad[_0x90c0('0x33')]=_[_0x90c0('0x34')](_0x3cd21a[_0x90c0('0x33')]);_0x7b26ad[_0x90c0('0x35')]=_[_0x90c0('0x36')](_0x7b26ad[_0x90c0('0x31')],_0x7b26ad[_0x90c0('0x33')]);_0x6926f0[_0x90c0('0x37')]=_[_0x90c0('0x36')](_0x7b26ad['model'],qs['fields'](_0x3cd21a[_0x90c0('0x33')]['fields']));_0x6926f0[_0x90c0('0x37')]=_0x6926f0[_0x90c0('0x37')][_0x90c0('0x38')]?_0x6926f0[_0x90c0('0x37')]:_0x7b26ad['model'];if(!_0x3cd21a['query'][_0x90c0('0x39')](_0x90c0('0x3a'))){_0x6926f0[_0x90c0('0x20')]=qs['limit'](_0x3cd21a[_0x90c0('0x33')][_0x90c0('0x20')]);_0x6926f0['offset']=qs[_0x90c0('0x1f')](_0x3cd21a[_0x90c0('0x33')]['offset']);}_0x6926f0[_0x90c0('0x3b')]=qs['sort'](_0x3cd21a[_0x90c0('0x33')][_0x90c0('0x3c')]);_0x6926f0['where']=qs[_0x90c0('0x35')](_[_0x90c0('0x3d')](_0x3cd21a[_0x90c0('0x33')],_0x7b26ad[_0x90c0('0x35')]),_0x5eb49f);if(_0x3cd21a[_0x90c0('0x33')][_0x90c0('0x3e')]){_0x6926f0[_0x90c0('0x3f')]=_[_0x90c0('0x40')](_0x6926f0['where'],{'$or':_[_0x90c0('0x32')](_0x5eb49f,function(_0x5c18c3){if(_0x5c18c3['type']!==_0x90c0('0x41')){var _0x46a98b={};_0x46a98b[_0x5c18c3[_0x90c0('0x2b')]]={'$like':'%'+_0x3cd21a[_0x90c0('0x33')]['filter']+'%'};return _0x46a98b;}})});}_0x6926f0=_[_0x90c0('0x40')]({},_0x6926f0,_0x3cd21a[_0x90c0('0x42')]);var _0x51d980={'where':_0x6926f0['where']};return db[_0x90c0('0x43')][_0x90c0('0x21')](_0x51d980)[_0x90c0('0x29')](function(_0x4afbdc){_0xd01a61[_0x90c0('0x21')]=_0x4afbdc;if(_0x3cd21a['query']['includeAll']){_0x6926f0[_0x90c0('0x44')]=[{'all':!![]}];}return db[_0x90c0('0x43')][_0x90c0('0x45')](_0x6926f0);})[_0x90c0('0x29')](function(_0x57c837){_0xd01a61['rows']=_0x57c837;return _0xd01a61;})[_0x90c0('0x29')](respondWithFilteredResult(_0x5beef6,_0x6926f0))['catch'](handleError(_0x5beef6,null));};exports[_0x90c0('0x46')]=function(_0x3f89c7,_0x5e15d6){var _0x1ea638={'raw':!![],'where':{'id':_0x3f89c7[_0x90c0('0x47')]['id']}},_0x175ea7={};_0x175ea7[_0x90c0('0x31')]=_[_0x90c0('0x34')](db[_0x90c0('0x43')][_0x90c0('0x2e')]);_0x175ea7['query']=_[_0x90c0('0x34')](_0x3f89c7[_0x90c0('0x33')]);_0x175ea7['filters']=_[_0x90c0('0x36')](_0x175ea7[_0x90c0('0x31')],_0x175ea7[_0x90c0('0x33')]);_0x1ea638['attributes']=_['intersection'](_0x175ea7[_0x90c0('0x31')],qs['fields'](_0x3f89c7[_0x90c0('0x33')][_0x90c0('0x48')]));_0x1ea638['attributes']=_0x1ea638[_0x90c0('0x37')][_0x90c0('0x38')]?_0x1ea638[_0x90c0('0x37')]:_0x175ea7[_0x90c0('0x31')];if(_0x3f89c7[_0x90c0('0x33')]['includeAll']){_0x1ea638[_0x90c0('0x44')]=[{'all':!![]}];}_0x1ea638=_['merge']({},_0x1ea638,_0x3f89c7[_0x90c0('0x42')]);return db[_0x90c0('0x43')]['find'](_0x1ea638)[_0x90c0('0x29')](handleEntityNotFound(_0x5e15d6,null))['then'](respondWithResult(_0x5e15d6,null))['catch'](handleError(_0x5e15d6,null));};exports[_0x90c0('0x49')]=function(_0x10d5cc,_0xf19604){return db['Dynamics365Field'][_0x90c0('0x49')](_0x10d5cc[_0x90c0('0x4a')],{})[_0x90c0('0x29')](respondWithResult(_0xf19604,0xc9))['catch'](handleError(_0xf19604,null));};exports[_0x90c0('0x27')]=function(_0x4a2bee,_0x21b3c9){if(_0x4a2bee[_0x90c0('0x4a')]['id']){delete _0x4a2bee['body']['id'];}return db[_0x90c0('0x43')][_0x90c0('0x4b')]({'where':{'id':_0x4a2bee[_0x90c0('0x47')]['id']}})[_0x90c0('0x29')](handleEntityNotFound(_0x21b3c9,null))[_0x90c0('0x29')](saveUpdates(_0x4a2bee['body'],null))[_0x90c0('0x29')](respondWithResult(_0x21b3c9,null))[_0x90c0('0x4c')](handleError(_0x21b3c9,null));};exports[_0x90c0('0x28')]=function(_0x3d0818,_0x56883a){return db[_0x90c0('0x43')]['find']({'where':{'id':_0x3d0818[_0x90c0('0x47')]['id']}})['then'](handleEntityNotFound(_0x56883a,null))[_0x90c0('0x29')](removeEntity(_0x56883a,null))[_0x90c0('0x4c')](handleError(_0x56883a,null));}; \ No newline at end of file +var _0x4e4e=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','key'];(function(_0x30e8ee,_0x47bdb1){var _0x25ecb2=function(_0x34bd18){while(--_0x34bd18){_0x30e8ee['push'](_0x30e8ee['shift']());}};_0x25ecb2(++_0x47bdb1);}(_0x4e4e,0x18f));var _0xe4e4=function(_0x30efb7,_0x7a9aaf){_0x30efb7=_0x30efb7-0x0;var _0x31624e=_0x4e4e[_0x30efb7];return _0x31624e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e4('0x0'));var zipdir=require(_0xe4e4('0x1'));var jsonpatch=require(_0xe4e4('0x2'));var rp=require(_0xe4e4('0x3'));var moment=require(_0xe4e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe4e4('0x5'));var util=require('util');var path=require(_0xe4e4('0x6'));var sox=require(_0xe4e4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4e4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4e4('0x9'));var _=require(_0xe4e4('0xa'));var squel=require('squel');var crypto=require(_0xe4e4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe4e4('0xc'));var toCsv=require(_0xe4e4('0xd'));var querystring=require(_0xe4e4('0xe'));var Papa=require(_0xe4e4('0xf'));var Redis=require(_0xe4e4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe4e4('0x11'));var hardwareService=require(_0xe4e4('0x12'));var logger=require(_0xe4e4('0x13'))(_0xe4e4('0x14'));var utils=require(_0xe4e4('0x15'));var config=require(_0xe4e4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e4('0x17'))['db'];function respondWithStatusCode(_0x319632,_0x1f460c){_0x1f460c=_0x1f460c||0xcc;return function(_0x121718){if(_0x121718){return _0x319632[_0xe4e4('0x18')](_0x1f460c);}return _0x319632[_0xe4e4('0x19')](_0x1f460c)[_0xe4e4('0x1a')]();};}function respondWithResult(_0x32a4a9,_0x1ff32c){_0x1ff32c=_0x1ff32c||0xc8;return function(_0x33ea17){if(_0x33ea17){return _0x32a4a9[_0xe4e4('0x19')](_0x1ff32c)[_0xe4e4('0x1b')](_0x33ea17);}};}function respondWithFilteredResult(_0x5decd2,_0xb73f3c){return function(_0x519df7){if(_0x519df7){var _0x2cd9dc=typeof _0xb73f3c[_0xe4e4('0x1c')]===_0xe4e4('0x1d')&&typeof _0xb73f3c['limit']===_0xe4e4('0x1d');var _0x4067ca=_0x519df7['count'];var _0x21f89b=_0x2cd9dc?0x0:_0xb73f3c[_0xe4e4('0x1c')];var _0x3e7d70=_0x2cd9dc?_0x519df7[_0xe4e4('0x1e')]:_0xb73f3c[_0xe4e4('0x1c')]+_0xb73f3c[_0xe4e4('0x1f')];var _0x53ae73;if(_0x3e7d70>=_0x4067ca){_0x3e7d70=_0x4067ca;_0x53ae73=0xc8;}else{_0x53ae73=0xce;}_0x5decd2[_0xe4e4('0x19')](_0x53ae73);return _0x5decd2['set']('Content-Range',_0x21f89b+'-'+_0x3e7d70+'/'+_0x4067ca)[_0xe4e4('0x1b')](_0x519df7);}return null;};}function patchUpdates(_0x1c3bd9){return function(_0x134d13){try{jsonpatch[_0xe4e4('0x20')](_0x134d13,_0x1c3bd9,!![]);}catch(_0x3e1994){return BPromise[_0xe4e4('0x21')](_0x3e1994);}return _0x134d13[_0xe4e4('0x22')]();};}function saveUpdates(_0x15eeef,_0x21eb23){return function(_0x99e654){if(_0x99e654){return _0x99e654[_0xe4e4('0x23')](_0x15eeef)[_0xe4e4('0x24')](function(_0x3babda){return _0x3babda;});}return null;};}function removeEntity(_0x16d620,_0x161ed1){return function(_0x126e34){if(_0x126e34){return _0x126e34['destroy']()['then'](function(){_0x16d620[_0xe4e4('0x19')](0xcc)[_0xe4e4('0x1a')]();});}};}function handleEntityNotFound(_0x3ed4d4,_0x37d466){return function(_0x4f2abc){if(!_0x4f2abc){_0x3ed4d4[_0xe4e4('0x18')](0x194);}return _0x4f2abc;};}function handleError(_0x199636,_0x4bf208){_0x4bf208=_0x4bf208||0x1f4;return function(_0x7e8594){logger[_0xe4e4('0x25')](_0x7e8594[_0xe4e4('0x26')]);if(_0x7e8594['name']){delete _0x7e8594[_0xe4e4('0x27')];}_0x199636['status'](_0x4bf208)[_0xe4e4('0x28')](_0x7e8594);};}exports[_0xe4e4('0x29')]=function(_0x59126c,_0x1b33a9){var _0x2273fb={},_0x3b7711={},_0x5e788d={'count':0x0,'rows':[]};var _0x40cfe8=_[_0xe4e4('0x2a')](db[_0xe4e4('0x2b')]['rawAttributes'],function(_0x41fb34){return{'name':_0x41fb34['fieldName'],'type':_0x41fb34['type'][_0xe4e4('0x2c')]};});_0x3b7711['model']=_['map'](_0x40cfe8,_0xe4e4('0x27'));_0x3b7711['query']=_['keys'](_0x59126c[_0xe4e4('0x2d')]);_0x3b7711[_0xe4e4('0x2e')]=_[_0xe4e4('0x2f')](_0x3b7711[_0xe4e4('0x30')],_0x3b7711[_0xe4e4('0x2d')]);_0x2273fb[_0xe4e4('0x31')]=_['intersection'](_0x3b7711[_0xe4e4('0x30')],qs[_0xe4e4('0x32')](_0x59126c['query'][_0xe4e4('0x32')]));_0x2273fb[_0xe4e4('0x31')]=_0x2273fb['attributes'][_0xe4e4('0x33')]?_0x2273fb['attributes']:_0x3b7711[_0xe4e4('0x30')];if(!_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x34')](_0xe4e4('0x35'))){_0x2273fb[_0xe4e4('0x1f')]=qs[_0xe4e4('0x1f')](_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x1f')]);_0x2273fb[_0xe4e4('0x1c')]=qs['offset'](_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x1c')]);}_0x2273fb[_0xe4e4('0x36')]=qs[_0xe4e4('0x37')](_0x59126c['query'][_0xe4e4('0x37')]);_0x2273fb[_0xe4e4('0x38')]=qs[_0xe4e4('0x2e')](_[_0xe4e4('0x39')](_0x59126c[_0xe4e4('0x2d')],_0x3b7711[_0xe4e4('0x2e')]),_0x40cfe8);if(_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x3a')]){_0x2273fb[_0xe4e4('0x38')]=_[_0xe4e4('0x3b')](_0x2273fb[_0xe4e4('0x38')],{'$or':_[_0xe4e4('0x2a')](_0x40cfe8,function(_0x4eef80){if(_0x4eef80[_0xe4e4('0x3c')]!==_0xe4e4('0x3d')){var _0x5218bd={};_0x5218bd[_0x4eef80['name']]={'$like':'%'+_0x59126c['query']['filter']+'%'};return _0x5218bd;}})});}_0x2273fb=_[_0xe4e4('0x3b')]({},_0x2273fb,_0x59126c[_0xe4e4('0x3e')]);var _0x17c2f3={'where':_0x2273fb[_0xe4e4('0x38')]};return db[_0xe4e4('0x2b')][_0xe4e4('0x1e')](_0x17c2f3)[_0xe4e4('0x24')](function(_0x419f0c){_0x5e788d[_0xe4e4('0x1e')]=_0x419f0c;if(_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x3f')]){_0x2273fb[_0xe4e4('0x40')]=[{'all':!![]}];}return db[_0xe4e4('0x2b')][_0xe4e4('0x41')](_0x2273fb);})['then'](function(_0x4b0da3){_0x5e788d[_0xe4e4('0x42')]=_0x4b0da3;return _0x5e788d;})[_0xe4e4('0x24')](respondWithFilteredResult(_0x1b33a9,_0x2273fb))[_0xe4e4('0x43')](handleError(_0x1b33a9,null));};exports['show']=function(_0x4f47b9,_0x1217d4){var _0x4c5b71={'raw':!![],'where':{'id':_0x4f47b9[_0xe4e4('0x44')]['id']}},_0x284633={};_0x284633['model']=_[_0xe4e4('0x45')](db[_0xe4e4('0x2b')][_0xe4e4('0x46')]);_0x284633[_0xe4e4('0x2d')]=_[_0xe4e4('0x45')](_0x4f47b9[_0xe4e4('0x2d')]);_0x284633[_0xe4e4('0x2e')]=_[_0xe4e4('0x2f')](_0x284633[_0xe4e4('0x30')],_0x284633[_0xe4e4('0x2d')]);_0x4c5b71['attributes']=_[_0xe4e4('0x2f')](_0x284633[_0xe4e4('0x30')],qs[_0xe4e4('0x32')](_0x4f47b9[_0xe4e4('0x2d')][_0xe4e4('0x32')]));_0x4c5b71['attributes']=_0x4c5b71[_0xe4e4('0x31')][_0xe4e4('0x33')]?_0x4c5b71[_0xe4e4('0x31')]:_0x284633['model'];if(_0x4f47b9[_0xe4e4('0x2d')]['includeAll']){_0x4c5b71[_0xe4e4('0x40')]=[{'all':!![]}];}_0x4c5b71=_[_0xe4e4('0x3b')]({},_0x4c5b71,_0x4f47b9[_0xe4e4('0x3e')]);return db[_0xe4e4('0x2b')][_0xe4e4('0x47')](_0x4c5b71)[_0xe4e4('0x24')](handleEntityNotFound(_0x1217d4,null))[_0xe4e4('0x24')](respondWithResult(_0x1217d4,null))[_0xe4e4('0x43')](handleError(_0x1217d4,null));};exports[_0xe4e4('0x48')]=function(_0x1cbe2f,_0x2c35de){return db['Dynamics365Field'][_0xe4e4('0x48')](_0x1cbe2f[_0xe4e4('0x49')],{})[_0xe4e4('0x24')](respondWithResult(_0x2c35de,0xc9))[_0xe4e4('0x43')](handleError(_0x2c35de,null));};exports['update']=function(_0x20ba51,_0x1212ad){if(_0x20ba51[_0xe4e4('0x49')]['id']){delete _0x20ba51[_0xe4e4('0x49')]['id'];}return db[_0xe4e4('0x2b')]['find']({'where':{'id':_0x20ba51['params']['id']}})[_0xe4e4('0x24')](handleEntityNotFound(_0x1212ad,null))[_0xe4e4('0x24')](saveUpdates(_0x20ba51[_0xe4e4('0x49')],null))[_0xe4e4('0x24')](respondWithResult(_0x1212ad,null))['catch'](handleError(_0x1212ad,null));};exports['destroy']=function(_0x12d2e7,_0xcb4da5){return db[_0xe4e4('0x2b')][_0xe4e4('0x47')]({'where':{'id':_0x12d2e7['params']['id']}})[_0xe4e4('0x24')](handleEntityNotFound(_0xcb4da5,null))[_0xe4e4('0x24')](removeEntity(_0xcb4da5,null))['catch'](handleError(_0xcb4da5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 4fc45a9..d1c6e7a 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 _0xa873=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa873,0xe1));var _0x3a87=function(_0x36bafb,_0x794eae){_0x36bafb=_0x36bafb-0x0;var _0x46de86=_0xa873[_0x36bafb];return _0x46de86;};'use strict';var _=require('lodash');var util=require(_0x3a87('0x0'));var logger=require(_0x3a87('0x1'))(_0x3a87('0x2'));var moment=require(_0x3a87('0x3'));var BPromise=require(_0x3a87('0x4'));var rp=require(_0x3a87('0x5'));var fs=require('fs');var path=require(_0x3a87('0x6'));var rimraf=require(_0x3a87('0x7'));var config=require(_0x3a87('0x8'));var attributes=require(_0x3a87('0x9'));module['exports']=function(_0x5f0532,_0x530583){return _0x5f0532[_0x3a87('0xa')](_0x3a87('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x3a87('0xc'),'fields':[_0x3a87('0xd'),_0x3a87('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8299=['../../config/logger','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x8299,0xd0));var _0x9829=function(_0x3ef1dc,_0x210a81){_0x3ef1dc=_0x3ef1dc-0x0;var _0x151f5f=_0x8299[_0x3ef1dc];return _0x151f5f;};'use strict';var _=require(_0x9829('0x0'));var util=require('util');var logger=require(_0x9829('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9829('0x2'));var rp=require(_0x9829('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9829('0x4'));var config=require('../../config/environment');var attributes=require(_0x9829('0x5'));module['exports']=function(_0xc4a6f,_0x4fd6b4){return _0xc4a6f[_0x9829('0x6')](_0x9829('0x7'),attributes,{'tableName':_0x9829('0x8'),'paranoid':![],'indexes':[{'name':_0x9829('0x9'),'fields':['idField',_0x9829('0xa')],'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 89777ff..0ee2270 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 _0x8c56=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x12a82b,_0x7c26ad){var _0x591141=function(_0x4bf5c5){while(--_0x4bf5c5){_0x12a82b['push'](_0x12a82b['shift']());}};_0x591141(++_0x7c26ad);}(_0x8c56,0x126));var _0x68c5=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x8c56[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0x68c5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x68c5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x68c5('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x68c5('0x3'))('rpc');var config=require(_0x68c5('0x4'));var jayson=require(_0x68c5('0x5'));var client=jayson[_0x68c5('0x6')][_0x68c5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cd9b1,_0x2b7148,_0x3730d3){return new BPromise(function(_0x4acc16,_0x197ab9){return client['request'](_0x4cd9b1,_0x3730d3)[_0x68c5('0x8')](function(_0x5ec45a){logger[_0x68c5('0x9')](_0x68c5('0xa'),_0x2b7148,_0x68c5('0xb'));logger[_0x68c5('0xc')](_0x68c5('0xd'),_0x2b7148,_0x68c5('0xb'),JSON[_0x68c5('0xe')](_0x5ec45a));if(_0x5ec45a[_0x68c5('0xf')]){if(_0x5ec45a[_0x68c5('0xf')][_0x68c5('0x10')]===0x1f4){logger[_0x68c5('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x2b7148,_0x5ec45a[_0x68c5('0xf')][_0x68c5('0x11')]);return _0x197ab9(_0x5ec45a['error'][_0x68c5('0x11')]);}logger[_0x68c5('0xf')](_0x68c5('0xa'),_0x2b7148,_0x5ec45a['error'][_0x68c5('0x11')]);return _0x4acc16(_0x5ec45a['error'][_0x68c5('0x11')]);}else{logger[_0x68c5('0x9')](_0x68c5('0xa'),_0x2b7148,_0x68c5('0xb'));_0x4acc16(_0x5ec45a['result'][_0x68c5('0x11')]);}})['catch'](function(_0x5d8b9d){logger[_0x68c5('0xf')](_0x68c5('0xa'),_0x2b7148,_0x5d8b9d);_0x197ab9(_0x5d8b9d);});});} \ No newline at end of file +var _0xf71b=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b9224,_0x3a20ec){var _0x33f2ab=function(_0x1e5201){while(--_0x1e5201){_0x5b9224['push'](_0x5b9224['shift']());}};_0x33f2ab(++_0x3a20ec);}(_0xf71b,0x8d));var _0xbf71=function(_0x3e85a1,_0x431ad2){_0x3e85a1=_0x3e85a1-0x0;var _0x3e8502=_0xf71b[_0x3e85a1];return _0x3e8502;};'use strict';var _=require(_0xbf71('0x0'));var util=require(_0xbf71('0x1'));var moment=require('moment');var BPromise=require(_0xbf71('0x2'));var rs=require(_0xbf71('0x3'));var fs=require('fs');var Redis=require(_0xbf71('0x4'));var db=require(_0xbf71('0x5'))['db'];var utils=require(_0xbf71('0x6'));var logger=require(_0xbf71('0x7'))(_0xbf71('0x8'));var config=require(_0xbf71('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220935,_0x2552ca,_0x308024){return new BPromise(function(_0x3a7510,_0x1acdbd){return client[_0xbf71('0xb')](_0x220935,_0x308024)[_0xbf71('0xc')](function(_0x4ef7dd){logger[_0xbf71('0xd')](_0xbf71('0xe'),_0x2552ca,_0xbf71('0xf'));logger[_0xbf71('0x10')](_0xbf71('0x11'),_0x2552ca,_0xbf71('0xf'),JSON[_0xbf71('0x12')](_0x4ef7dd));if(_0x4ef7dd[_0xbf71('0x13')]){if(_0x4ef7dd['error'][_0xbf71('0x14')]===0x1f4){logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x4ef7dd[_0xbf71('0x13')]['message']);return _0x1acdbd(_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);}logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);return _0x3a7510(_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);}else{logger[_0xbf71('0xd')](_0xbf71('0xe'),_0x2552ca,_0xbf71('0xf'));_0x3a7510(_0x4ef7dd['result'][_0xbf71('0x15')]);}})[_0xbf71('0x16')](function(_0x3205d0){logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x3205d0);_0x1acdbd(_0x3205d0);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c5afb35..d5414d7 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 _0x5630=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x3d4551,_0x18181e){var _0x4697e0=function(_0x46039b){while(--_0x46039b){_0x3d4551['push'](_0x3d4551['shift']());}};_0x4697e0(++_0x18181e);}(_0x5630,0x19b));var _0x0563=function(_0x5a6711,_0x5648fa){_0x5a6711=_0x5a6711-0x0;var _0x1db1c5=_0x5630[_0x5a6711];return _0x1db1c5;};'use strict';var multer=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var path=require(_0x0563('0x2'));var timeout=require(_0x0563('0x3'));var express=require(_0x0563('0x4'));var router=express[_0x0563('0x5')]();var fs_extra=require(_0x0563('0x6'));var auth=require(_0x0563('0x7'));var interaction=require(_0x0563('0x8'));var config=require(_0x0563('0x9'));var controller=require(_0x0563('0xa'));router[_0x0563('0xb')]('/',auth[_0x0563('0xc')](),controller[_0x0563('0xd')]);router[_0x0563('0xb')](_0x0563('0xe'),auth[_0x0563('0xc')](),controller[_0x0563('0xf')]);router['get']('/:id/configurations',auth[_0x0563('0xc')](),controller['getConfigurations']);router[_0x0563('0xb')](_0x0563('0x10'),auth[_0x0563('0xc')](),controller[_0x0563('0x11')]);router[_0x0563('0x12')]('/',auth[_0x0563('0xc')](),controller[_0x0563('0x13')]);router[_0x0563('0x12')](_0x0563('0x14'),auth[_0x0563('0xc')](),controller['addConfiguration']);router['put'](_0x0563('0xe'),auth[_0x0563('0xc')](),controller['update']);router[_0x0563('0x15')](_0x0563('0xe'),auth[_0x0563('0xc')](),controller[_0x0563('0x16')]);module[_0x0563('0x17')]=router; \ No newline at end of file +var _0x77fc=['delete','exports','path','express','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x346b49,_0x35206c){var _0x13c4fc=function(_0x155aa4){while(--_0x155aa4){_0x346b49['push'](_0x346b49['shift']());}};_0x13c4fc(++_0x35206c);}(_0x77fc,0xe9));var _0xc77f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x77fc[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc77f('0x0'));var timeout=require('connect-timeout');var express=require(_0xc77f('0x1'));var router=express[_0xc77f('0x2')]();var fs_extra=require(_0xc77f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc77f('0x4'));var controller=require(_0xc77f('0x5'));router['get']('/',auth[_0xc77f('0x6')](),controller[_0xc77f('0x7')]);router[_0xc77f('0x8')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xa')]);router[_0xc77f('0x8')](_0xc77f('0xb'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xc')]);router[_0xc77f('0x8')](_0xc77f('0xd'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xe')]);router[_0xc77f('0xf')]('/',auth['isAuthenticated'](),controller[_0xc77f('0x10')]);router['post'](_0xc77f('0xb'),auth[_0xc77f('0x6')](),controller[_0xc77f('0x11')]);router[_0xc77f('0x12')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller['update']);router[_0xc77f('0x13')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller['destroy']);module[_0xc77f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a0eef6d..4df308b 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 _0x3de3=['username','remoteUri','sequelize','STRING'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0x3de3,0x1ce));var _0x33de=function(_0x1c99cc,_0x4e846e){_0x1c99cc=_0x1c99cc-0x0;var _0x4839cd=_0x3de3[_0x1c99cc];return _0x4839cd;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'name':{'type':Sequelize[_0x33de('0x1')]},'description':{'type':Sequelize[_0x33de('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x33de('0x2')},'apiKey':{'type':Sequelize[_0x33de('0x1')]},'remoteUri':{'type':Sequelize[_0x33de('0x1')],'unique':_0x33de('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x9879a7,_0x2c1070){var _0x54e12c=function(_0x254cd7){while(--_0x254cd7){_0x9879a7['push'](_0x9879a7['shift']());}};_0x54e12c(++_0x2c1070);}(_0xef0f,0x168));var _0xfef0=function(_0x553473,_0x4b409b){_0x553473=_0x553473-0x0;var _0x1f0387=_0xef0f[_0x553473];return _0x1f0387;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 2f8971f..31768c5 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 _0x7ec2=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','apply','reject','update','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','channel','FreshdeskField','Descriptions','apiKey','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1fa814,_0x29913d){var _0x11afbe=function(_0x40ea3f){while(--_0x40ea3f){_0x1fa814['push'](_0x1fa814['shift']());}};_0x11afbe(++_0x29913d);}(_0x7ec2,0x15c));var _0x27ec=function(_0x4941ff,_0x44ecc6){_0x4941ff=_0x4941ff-0x0;var _0xd9ee78=_0x7ec2[_0x4941ff];return _0xd9ee78;};'use strict';var emlformat=require(_0x27ec('0x0'));var rimraf=require(_0x27ec('0x1'));var zipdir=require(_0x27ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27ec('0x3'));var moment=require(_0x27ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27ec('0x5'));var util=require(_0x27ec('0x6'));var path=require(_0x27ec('0x7'));var sox=require(_0x27ec('0x8'));var csv=require(_0x27ec('0x9'));var ejs=require(_0x27ec('0xa'));var fs=require('fs');var fs_extra=require(_0x27ec('0xb'));var _=require(_0x27ec('0xc'));var squel=require(_0x27ec('0xd'));var crypto=require(_0x27ec('0xe'));var jsforce=require(_0x27ec('0xf'));var deskjs=require(_0x27ec('0x10'));var toCsv=require(_0x27ec('0x9'));var querystring=require(_0x27ec('0x11'));var Papa=require(_0x27ec('0x12'));var Redis=require(_0x27ec('0x13'));var authService=require(_0x27ec('0x14'));var qs=require(_0x27ec('0x15'));var as=require(_0x27ec('0x16'));var hardwareService=require(_0x27ec('0x17'));var logger=require(_0x27ec('0x18'))('api');var utils=require(_0x27ec('0x19'));var config=require(_0x27ec('0x1a'));var licenseUtil=require(_0x27ec('0x1b'));var db=require(_0x27ec('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x472020,_0x4efa3d){_0x4efa3d=_0x4efa3d||0xcc;return function(_0xf77f61){if(_0xf77f61){return _0x472020[_0x27ec('0x1d')](_0x4efa3d);}return _0x472020[_0x27ec('0x1e')](_0x4efa3d)[_0x27ec('0x1f')]();};}function respondWithResult(_0x29174c,_0x14cde9){_0x14cde9=_0x14cde9||0xc8;return function(_0x46f5a0){if(_0x46f5a0){return _0x29174c['status'](_0x14cde9)[_0x27ec('0x20')](_0x46f5a0);}};}function respondWithFilteredResult(_0x1d75b1,_0x486dae){return function(_0x56bf7d){if(_0x56bf7d){var _0x26f35a=typeof _0x486dae['offset']===_0x27ec('0x21')&&typeof _0x486dae[_0x27ec('0x22')]===_0x27ec('0x21');var _0x2dec35=_0x56bf7d['count'];var _0x24b9be=_0x26f35a?0x0:_0x486dae[_0x27ec('0x23')];var _0x3ce529=_0x26f35a?_0x56bf7d['count']:_0x486dae[_0x27ec('0x23')]+_0x486dae[_0x27ec('0x22')];var _0x5e5c49;if(_0x3ce529>=_0x2dec35){_0x3ce529=_0x2dec35;_0x5e5c49=0xc8;}else{_0x5e5c49=0xce;}_0x1d75b1[_0x27ec('0x1e')](_0x5e5c49);return _0x1d75b1[_0x27ec('0x24')]('Content-Range',_0x24b9be+'-'+_0x3ce529+'/'+_0x2dec35)['json'](_0x56bf7d);}return null;};}function patchUpdates(_0x2ad3be){return function(_0x1ee6cb){try{jsonpatch[_0x27ec('0x25')](_0x1ee6cb,_0x2ad3be,!![]);}catch(_0x80891d){return BPromise[_0x27ec('0x26')](_0x80891d);}return _0x1ee6cb['save']();};}function saveUpdates(_0x19fe3f,_0x1ba9c8){return function(_0x448d62){if(_0x448d62){return _0x448d62[_0x27ec('0x27')](_0x19fe3f)['then'](function(_0x4eba78){return _0x4eba78;});}return null;};}function removeEntity(_0x217036,_0x5d5fbe){return function(_0x3dc396){if(_0x3dc396){return _0x3dc396[_0x27ec('0x28')]()['then'](function(){_0x217036[_0x27ec('0x1e')](0xcc)[_0x27ec('0x1f')]();});}};}function handleEntityNotFound(_0x9c612f,_0x5b8262){return function(_0x47db40){if(!_0x47db40){_0x9c612f[_0x27ec('0x1d')](0x194);}return _0x47db40;};}function handleError(_0x5e4f41,_0x4a0ed2){_0x4a0ed2=_0x4a0ed2||0x1f4;return function(_0x486550){logger['error'](_0x486550[_0x27ec('0x29')]);if(_0x486550[_0x27ec('0x2a')]){delete _0x486550[_0x27ec('0x2a')];}_0x5e4f41[_0x27ec('0x1e')](_0x4a0ed2)[_0x27ec('0x2b')](_0x486550);};}exports[_0x27ec('0x2c')]=function(_0x33346f,_0x471a9b){var _0x52d906={},_0x3c8fd2={},_0x2fd45d={'count':0x0,'rows':[]};var _0x5c8947=_[_0x27ec('0x2d')](db[_0x27ec('0x2e')][_0x27ec('0x2f')],function(_0x34138d){return{'name':_0x34138d[_0x27ec('0x30')],'type':_0x34138d[_0x27ec('0x31')][_0x27ec('0x32')]};});_0x3c8fd2[_0x27ec('0x33')]=_[_0x27ec('0x2d')](_0x5c8947,_0x27ec('0x2a'));_0x3c8fd2[_0x27ec('0x34')]=_['keys'](_0x33346f[_0x27ec('0x34')]);_0x3c8fd2['filters']=_['intersection'](_0x3c8fd2[_0x27ec('0x33')],_0x3c8fd2[_0x27ec('0x34')]);_0x52d906['attributes']=_[_0x27ec('0x35')](_0x3c8fd2[_0x27ec('0x33')],qs['fields'](_0x33346f['query'][_0x27ec('0x36')]));_0x52d906[_0x27ec('0x37')]=_0x52d906['attributes'][_0x27ec('0x38')]?_0x52d906['attributes']:_0x3c8fd2[_0x27ec('0x33')];if(!_0x33346f['query'][_0x27ec('0x39')](_0x27ec('0x3a'))){_0x52d906['limit']=qs[_0x27ec('0x22')](_0x33346f['query'][_0x27ec('0x22')]);_0x52d906[_0x27ec('0x23')]=qs[_0x27ec('0x23')](_0x33346f[_0x27ec('0x34')][_0x27ec('0x23')]);}_0x52d906[_0x27ec('0x3b')]=qs[_0x27ec('0x3c')](_0x33346f['query'][_0x27ec('0x3c')]);_0x52d906[_0x27ec('0x3d')]=qs[_0x27ec('0x3e')](_[_0x27ec('0x3f')](_0x33346f[_0x27ec('0x34')],_0x3c8fd2[_0x27ec('0x3e')]),_0x5c8947);if(_0x33346f[_0x27ec('0x34')][_0x27ec('0x40')]){_0x52d906[_0x27ec('0x3d')]=_[_0x27ec('0x41')](_0x52d906[_0x27ec('0x3d')],{'$or':_[_0x27ec('0x2d')](_0x5c8947,function(_0x336c18){if(_0x336c18[_0x27ec('0x31')]!==_0x27ec('0x42')){var _0x316e1f={};_0x316e1f[_0x336c18['name']]={'$like':'%'+_0x33346f[_0x27ec('0x34')]['filter']+'%'};return _0x316e1f;}})});}_0x52d906=_[_0x27ec('0x41')]({},_0x52d906,_0x33346f[_0x27ec('0x43')]);var _0x57927d={'where':_0x52d906['where']};return db[_0x27ec('0x2e')][_0x27ec('0x44')](_0x57927d)['then'](function(_0x14379d){_0x2fd45d[_0x27ec('0x44')]=_0x14379d;if(_0x33346f[_0x27ec('0x34')][_0x27ec('0x45')]){_0x52d906[_0x27ec('0x46')]=[{'all':!![]}];}return db[_0x27ec('0x2e')][_0x27ec('0x47')](_0x52d906);})[_0x27ec('0x48')](function(_0x1a7cb9){_0x2fd45d[_0x27ec('0x49')]=_0x1a7cb9;return _0x2fd45d;})[_0x27ec('0x48')](respondWithFilteredResult(_0x471a9b,_0x52d906))[_0x27ec('0x4a')](handleError(_0x471a9b,null));};exports[_0x27ec('0x4b')]=function(_0x2908bc,_0x4bd067){var _0x4ce322={'raw':![],'where':{'id':_0x2908bc['params']['id']}},_0x43596e={};_0x43596e[_0x27ec('0x33')]=_[_0x27ec('0x4c')](db[_0x27ec('0x2e')][_0x27ec('0x2f')]);_0x43596e[_0x27ec('0x34')]=_[_0x27ec('0x4c')](_0x2908bc[_0x27ec('0x34')]);_0x43596e[_0x27ec('0x3e')]=_['intersection'](_0x43596e[_0x27ec('0x33')],_0x43596e[_0x27ec('0x34')]);_0x4ce322[_0x27ec('0x37')]=_[_0x27ec('0x35')](_0x43596e[_0x27ec('0x33')],qs[_0x27ec('0x36')](_0x2908bc['query'][_0x27ec('0x36')]));_0x4ce322[_0x27ec('0x37')]=_0x4ce322[_0x27ec('0x37')]['length']?_0x4ce322[_0x27ec('0x37')]:_0x43596e[_0x27ec('0x33')];if(_0x2908bc[_0x27ec('0x34')][_0x27ec('0x45')]){_0x4ce322['include']=[{'all':!![]}];}_0x4ce322=_[_0x27ec('0x41')]({},_0x4ce322,_0x2908bc[_0x27ec('0x43')]);return db['FreshdeskAccount'][_0x27ec('0x4d')](_0x4ce322)[_0x27ec('0x48')](handleEntityNotFound(_0x4bd067,null))['then'](respondWithResult(_0x4bd067,null))[_0x27ec('0x4a')](handleError(_0x4bd067,null));};exports[_0x27ec('0x4e')]=function(_0x2d6f7c,_0x327a3e){return db[_0x27ec('0x2e')][_0x27ec('0x4e')](_0x2d6f7c[_0x27ec('0x4f')],{})[_0x27ec('0x48')](respondWithResult(_0x327a3e,0xc9))[_0x27ec('0x4a')](handleError(_0x327a3e,null));};exports[_0x27ec('0x27')]=function(_0x59e890,_0x2b412f){if(_0x59e890[_0x27ec('0x4f')]['id']){delete _0x59e890[_0x27ec('0x4f')]['id'];}return db[_0x27ec('0x2e')][_0x27ec('0x4d')]({'where':{'id':_0x59e890[_0x27ec('0x50')]['id']}})[_0x27ec('0x48')](handleEntityNotFound(_0x2b412f,null))[_0x27ec('0x48')](saveUpdates(_0x59e890[_0x27ec('0x4f')],null))[_0x27ec('0x48')](respondWithResult(_0x2b412f,null))[_0x27ec('0x4a')](handleError(_0x2b412f,null));};exports[_0x27ec('0x28')]=function(_0x474252,_0x4890a7){return db[_0x27ec('0x2e')][_0x27ec('0x4d')]({'where':{'id':_0x474252[_0x27ec('0x50')]['id']}})[_0x27ec('0x48')](handleEntityNotFound(_0x4890a7,null))[_0x27ec('0x48')](removeEntity(_0x4890a7,null))[_0x27ec('0x4a')](handleError(_0x4890a7,null));};exports[_0x27ec('0x51')]=function(_0x4068e7,_0x4ec2c9,_0x4b1250){var _0x59ac36={};var _0x5aa872={};var _0x17db18;var _0x4d0205;return db[_0x27ec('0x2e')][_0x27ec('0x52')]({'where':{'id':_0x4068e7[_0x27ec('0x50')]['id']}})[_0x27ec('0x48')](handleEntityNotFound(_0x4ec2c9,null))[_0x27ec('0x48')](function(_0x20977d){if(_0x20977d){_0x17db18=_0x20977d;_0x5aa872[_0x27ec('0x33')]=_[_0x27ec('0x4c')](db[_0x27ec('0x53')][_0x27ec('0x2f')]);_0x5aa872[_0x27ec('0x34')]=_['keys'](_0x4068e7[_0x27ec('0x34')]);_0x5aa872[_0x27ec('0x3e')]=_[_0x27ec('0x35')](_0x5aa872[_0x27ec('0x33')],_0x5aa872['query']);_0x59ac36[_0x27ec('0x37')]=_[_0x27ec('0x35')](_0x5aa872['model'],qs[_0x27ec('0x36')](_0x4068e7[_0x27ec('0x34')]['fields']));_0x59ac36[_0x27ec('0x37')]=_0x59ac36[_0x27ec('0x37')][_0x27ec('0x38')]?_0x59ac36[_0x27ec('0x37')]:_0x5aa872[_0x27ec('0x33')];_0x59ac36[_0x27ec('0x3b')]=qs[_0x27ec('0x3c')](_0x4068e7[_0x27ec('0x34')][_0x27ec('0x3c')]);_0x59ac36[_0x27ec('0x3d')]=qs['filters'](_[_0x27ec('0x3f')](_0x4068e7[_0x27ec('0x34')],_0x5aa872[_0x27ec('0x3e')]));if(_0x4068e7[_0x27ec('0x34')]['filter']){_0x59ac36[_0x27ec('0x3d')]=_[_0x27ec('0x41')](_0x59ac36[_0x27ec('0x3d')],{'$or':_[_0x27ec('0x2d')](_0x59ac36[_0x27ec('0x37')],function(_0x594e85){var _0xc3b0cc={};_0xc3b0cc[_0x594e85]={'$like':'%'+_0x4068e7['query'][_0x27ec('0x40')]+'%'};return _0xc3b0cc;})});}_0x59ac36=_[_0x27ec('0x41')]({},_0x59ac36,_0x4068e7[_0x27ec('0x43')]);return _0x17db18[_0x27ec('0x51')](_0x59ac36);}})[_0x27ec('0x48')](function(_0x3c7431){if(_0x3c7431){_0x4d0205=_0x3c7431[_0x27ec('0x38')];if(!_0x4068e7[_0x27ec('0x34')][_0x27ec('0x39')](_0x27ec('0x3a'))){_0x59ac36[_0x27ec('0x22')]=qs[_0x27ec('0x22')](_0x4068e7[_0x27ec('0x34')][_0x27ec('0x22')]);_0x59ac36[_0x27ec('0x23')]=qs[_0x27ec('0x23')](_0x4068e7['query'][_0x27ec('0x23')]);}return _0x17db18[_0x27ec('0x51')](_0x59ac36);}})[_0x27ec('0x48')](function(_0x2a6720){if(_0x2a6720){return _0x2a6720?{'count':_0x4d0205,'rows':_0x2a6720}:null;}})['then'](respondWithResult(_0x4ec2c9,null))[_0x27ec('0x4a')](handleError(_0x4ec2c9,null));};exports[_0x27ec('0x54')]=function(_0x26e610,_0x5cd377,_0x4797bb){if(_0x26e610[_0x27ec('0x4f')]['id']){delete _0x26e610[_0x27ec('0x4f')]['id'];}return db['FreshdeskAccount'][_0x27ec('0x52')]({'where':{'id':_0x26e610[_0x27ec('0x50')]['id']}})[_0x27ec('0x48')](handleEntityNotFound(_0x5cd377,null))['then'](function(_0x1978cb){if(_0x1978cb){_0x26e610[_0x27ec('0x4f')]['AccountId']=_0x1978cb['id'];_0x26e610[_0x27ec('0x4f')][_0x27ec('0x55')]=integrations['getSubjects'](_0x26e610[_0x27ec('0x4f')][_0x27ec('0x56')],_0x26e610[_0x27ec('0x4f')][_0x27ec('0x31')]);_0x26e610[_0x27ec('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x26e610[_0x27ec('0x4f')][_0x27ec('0x56')],_0x26e610[_0x27ec('0x4f')]['type']);return db['FreshdeskConfiguration'][_0x27ec('0x4e')](_0x26e610[_0x27ec('0x4f')],{'include':[{'model':db[_0x27ec('0x57')],'as':_0x27ec('0x55')},{'model':db[_0x27ec('0x57')],'as':_0x27ec('0x58')}]});}return null;})[_0x27ec('0x48')](respondWithResult(_0x5cd377,null))[_0x27ec('0x4a')](handleError(_0x5cd377,null));};exports['getFields']=function(_0x45aa21,_0x1e0ae9,_0x192789){var _0x5ae69d='';return db['FreshdeskAccount'][_0x27ec('0x52')]({'where':{'id':_0x45aa21['params']['id']},'attributes':['id','remoteUri',_0x27ec('0x59')]})['then'](handleEntityNotFound(_0x1e0ae9,null))[_0x27ec('0x48')](function(_0x24f970){if(_0x24f970){_0x5ae69d=_0x24f970[_0x27ec('0x5a')];var _0xbd1caf=_0x5ae69d[_0x27ec('0x5b')](-0x1);if(_0xbd1caf==='/'){_0x5ae69d=_0x5ae69d['substring'](0x0,_0x5ae69d[_0x27ec('0x5c')](_0xbd1caf));}return rp({'method':_0x27ec('0x5d'),'uri':util[_0x27ec('0x5e')](_0x27ec('0x5f'),_0x5ae69d,_0x27ec('0x60')),'headers':{'Authorization':util[_0x27ec('0x5e')](_0x27ec('0x61'),new Buffer(util[_0x27ec('0x5e')]('%s:X',_0x24f970[_0x27ec('0x59')]))[_0x27ec('0x62')]('base64'))},'json':!![]});}})[_0x27ec('0x48')](function(_0x5b6542){if(_0x5b6542){var _0x50e202=[_0x27ec('0x63'),_0x27ec('0x64'),_0x27ec('0x65'),_0x27ec('0x66'),_0x27ec('0x1e'),_0x27ec('0x67'),_0x27ec('0x68'),_0x27ec('0x69'),_0x27ec('0x6a'),_0x27ec('0x68'),'company'];_[_0x27ec('0x6b')](_0x5b6542,function(_0x52a263){return _0x50e202[_0x27ec('0x6c')](_0x52a263[_0x27ec('0x2a')])||!_0x52a263[_0x27ec('0x6d')]&&_0x52a263[_0x27ec('0x31')]!=='custom_text'&&_0x52a263['type']!==_0x27ec('0x6e');});return{'count':_0x5b6542['length'],'rows':_[_0x27ec('0x2d')](_0x5b6542,function(_0x20f698){return{'id':_0x20f698['name'],'name':_0x20f698[_0x27ec('0x6f')],'custom':!_0x20f698[_0x27ec('0x6d')],'options':_0x20f698[_0x27ec('0x70')]?_['map'](_0x20f698[_0x27ec('0x70')],function(_0x507bf5){return{'name':_[_0x27ec('0x71')](_0x507bf5),'value':_0x507bf5};}):[]};})};}})['then'](respondWithResult(_0x1e0ae9,null))[_0x27ec('0x4a')](function(_0x7c4998){var _0x1dda46=_0x45aa21[_0x27ec('0x34')][_0x27ec('0x72')]?0x1f4:_0x7c4998[_0x27ec('0x73')]||0x1f4;logger[_0x27ec('0x74')](_0x27ec('0x75'),'getFields',_0x1dda46,JSON[_0x27ec('0x76')](_0x7c4998));delete _0x7c4998['name'];if(_0x1dda46===0x191){_0x1dda46=0x190;}_0x1e0ae9['status'](_0x1dda46)[_0x27ec('0x2b')](_0x45aa21['query'][_0x27ec('0x72')]?{'message':_0x27ec('0x77'),'statusCode':_0x7c4998[_0x27ec('0x73')]}:_0x7c4998);});}; \ No newline at end of file +var _0xbdb7=['reject','save','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','FreshdeskAccount','include','findAll','rows','intersection','length','includeAll','options','catch','create','body','update','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','slice','format','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','group','ticket_type','company','remove','includes','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','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','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2deb2b,_0x35f4e5){var _0x5836a0=function(_0x10d89b){while(--_0x10d89b){_0x2deb2b['push'](_0x2deb2b['shift']());}};_0x5836a0(++_0x35f4e5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0xbdb7[_0x14e001];return _0x2c09da;};'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'];var integrations=require(_0x7bdb('0x17'));function respondWithStatusCode(_0x496613,_0x8d74ff){_0x8d74ff=_0x8d74ff||0xcc;return function(_0x53021d){if(_0x53021d){return _0x496613['sendStatus'](_0x8d74ff);}return _0x496613[_0x7bdb('0x18')](_0x8d74ff)[_0x7bdb('0x19')]();};}function respondWithResult(_0x4fd91a,_0x50eeca){_0x50eeca=_0x50eeca||0xc8;return function(_0x4e98f7){if(_0x4e98f7){return _0x4fd91a[_0x7bdb('0x18')](_0x50eeca)[_0x7bdb('0x1a')](_0x4e98f7);}};}function respondWithFilteredResult(_0xe9919f,_0x25d417){return function(_0x31c909){if(_0x31c909){var _0xbde12a=typeof _0x25d417[_0x7bdb('0x1b')]===_0x7bdb('0x1c')&&typeof _0x25d417['limit']===_0x7bdb('0x1c');var _0x43f352=_0x31c909[_0x7bdb('0x1d')];var _0x2aff6a=_0xbde12a?0x0:_0x25d417['offset'];var _0x41f540=_0xbde12a?_0x31c909[_0x7bdb('0x1d')]:_0x25d417['offset']+_0x25d417[_0x7bdb('0x1e')];var _0x31f78e;if(_0x41f540>=_0x43f352){_0x41f540=_0x43f352;_0x31f78e=0xc8;}else{_0x31f78e=0xce;}_0xe9919f[_0x7bdb('0x18')](_0x31f78e);return _0xe9919f[_0x7bdb('0x1f')](_0x7bdb('0x20'),_0x2aff6a+'-'+_0x41f540+'/'+_0x43f352)['json'](_0x31c909);}return null;};}function patchUpdates(_0x49f353){return function(_0x677825){try{jsonpatch[_0x7bdb('0x21')](_0x677825,_0x49f353,!![]);}catch(_0x5daea4){return BPromise[_0x7bdb('0x22')](_0x5daea4);}return _0x677825[_0x7bdb('0x23')]();};}function saveUpdates(_0x346c72,_0x3f53e7){return function(_0x3a1d0f){if(_0x3a1d0f){return _0x3a1d0f['update'](_0x346c72)[_0x7bdb('0x24')](function(_0xdad53d){return _0xdad53d;});}return null;};}function removeEntity(_0x40c447,_0x3a456f){return function(_0x481f4b){if(_0x481f4b){return _0x481f4b['destroy']()[_0x7bdb('0x24')](function(){_0x40c447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e02,_0x2abef6){return function(_0x51ab04){if(!_0x51ab04){_0x4a9e02[_0x7bdb('0x25')](0x194);}return _0x51ab04;};}function handleError(_0x72ba69,_0x3ec129){_0x3ec129=_0x3ec129||0x1f4;return function(_0x7c09cf){logger[_0x7bdb('0x26')](_0x7c09cf['stack']);if(_0x7c09cf[_0x7bdb('0x27')]){delete _0x7c09cf[_0x7bdb('0x27')];}_0x72ba69[_0x7bdb('0x18')](_0x3ec129)[_0x7bdb('0x28')](_0x7c09cf);};}exports[_0x7bdb('0x29')]=function(_0x2e8e65,_0x1e9996){var _0xd2d7be={},_0x25a1fe={},_0x365c02={'count':0x0,'rows':[]};var _0x9ec48d=_[_0x7bdb('0x2a')](db['FreshdeskAccount'][_0x7bdb('0x2b')],function(_0x23fc3a){return{'name':_0x23fc3a[_0x7bdb('0x2c')],'type':_0x23fc3a[_0x7bdb('0x2d')][_0x7bdb('0x2e')]};});_0x25a1fe['model']=_[_0x7bdb('0x2a')](_0x9ec48d,_0x7bdb('0x27'));_0x25a1fe[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x2e8e65['query']);_0x25a1fe['filters']=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],_0x25a1fe['query']);_0xd2d7be[_0x7bdb('0x32')]=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x2e8e65[_0x7bdb('0x2f')]['fields']));_0xd2d7be[_0x7bdb('0x32')]=_0xd2d7be['attributes']['length']?_0xd2d7be[_0x7bdb('0x32')]:_0x25a1fe['model'];if(!_0x2e8e65[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0xd2d7be[_0x7bdb('0x1e')]=qs[_0x7bdb('0x1e')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x1e')]);_0xd2d7be[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x2e8e65['query'][_0x7bdb('0x1b')]);}_0xd2d7be[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0xd2d7be[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x2e8e65[_0x7bdb('0x2f')],_0x25a1fe['filters']),_0x9ec48d);if(_0x2e8e65['query'][_0x7bdb('0x39')]){_0xd2d7be[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0xd2d7be[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x9ec48d,function(_0x509e90){if(_0x509e90['type']!==_0x7bdb('0x3b')){var _0x5d7c1f={};_0x5d7c1f[_0x509e90[_0x7bdb('0x27')]]={'$like':'%'+_0x2e8e65['query'][_0x7bdb('0x39')]+'%'};return _0x5d7c1f;}})});}_0xd2d7be=_['merge']({},_0xd2d7be,_0x2e8e65['options']);var _0x21dae7={'where':_0xd2d7be[_0x7bdb('0x36')]};return db[_0x7bdb('0x3c')][_0x7bdb('0x1d')](_0x21dae7)[_0x7bdb('0x24')](function(_0x2b4829){_0x365c02[_0x7bdb('0x1d')]=_0x2b4829;if(_0x2e8e65['query']['includeAll']){_0xd2d7be[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x3c')][_0x7bdb('0x3e')](_0xd2d7be);})[_0x7bdb('0x24')](function(_0x39fbca){_0x365c02[_0x7bdb('0x3f')]=_0x39fbca;return _0x365c02;})[_0x7bdb('0x24')](respondWithFilteredResult(_0x1e9996,_0xd2d7be))['catch'](handleError(_0x1e9996,null));};exports['show']=function(_0x1bcbcd,_0x8e893e){var _0x4636f8={'raw':![],'where':{'id':_0x1bcbcd['params']['id']}},_0x72a81c={};_0x72a81c[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x3c')][_0x7bdb('0x2b')]);_0x72a81c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x1bcbcd[_0x7bdb('0x2f')]);_0x72a81c[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],_0x72a81c[_0x7bdb('0x2f')]);_0x4636f8['attributes']=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],qs['fields'](_0x1bcbcd[_0x7bdb('0x2f')]['fields']));_0x4636f8[_0x7bdb('0x32')]=_0x4636f8[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x4636f8[_0x7bdb('0x32')]:_0x72a81c[_0x7bdb('0x31')];if(_0x1bcbcd['query'][_0x7bdb('0x42')]){_0x4636f8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x4636f8=_[_0x7bdb('0x3a')]({},_0x4636f8,_0x1bcbcd[_0x7bdb('0x43')]);return db[_0x7bdb('0x3c')]['find'](_0x4636f8)[_0x7bdb('0x24')](handleEntityNotFound(_0x8e893e,null))[_0x7bdb('0x24')](respondWithResult(_0x8e893e,null))[_0x7bdb('0x44')](handleError(_0x8e893e,null));};exports[_0x7bdb('0x45')]=function(_0x259007,_0x25c534){return db[_0x7bdb('0x3c')][_0x7bdb('0x45')](_0x259007[_0x7bdb('0x46')],{})[_0x7bdb('0x24')](respondWithResult(_0x25c534,0xc9))['catch'](handleError(_0x25c534,null));};exports[_0x7bdb('0x47')]=function(_0x58c4bc,_0x47cccd){if(_0x58c4bc[_0x7bdb('0x46')]['id']){delete _0x58c4bc[_0x7bdb('0x46')]['id'];}return db['FreshdeskAccount'][_0x7bdb('0x48')]({'where':{'id':_0x58c4bc[_0x7bdb('0x49')]['id']}})['then'](handleEntityNotFound(_0x47cccd,null))['then'](saveUpdates(_0x58c4bc['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x47cccd,null))[_0x7bdb('0x44')](handleError(_0x47cccd,null));};exports[_0x7bdb('0x4a')]=function(_0x46410c,_0x33687b){return db[_0x7bdb('0x3c')][_0x7bdb('0x48')]({'where':{'id':_0x46410c[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x33687b,null))[_0x7bdb('0x24')](removeEntity(_0x33687b,null))['catch'](handleError(_0x33687b,null));};exports[_0x7bdb('0x4b')]=function(_0x4806e0,_0x240425,_0x27358d){var _0x5d564d={};var _0x457886={};var _0x493d23;var _0x258f29;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x4806e0[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x240425,null))['then'](function(_0x4e17f3){if(_0x4e17f3){_0x493d23=_0x4e17f3;_0x457886['model']=_[_0x7bdb('0x30')](db['FreshdeskConfiguration']['rawAttributes']);_0x457886[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x4806e0[_0x7bdb('0x2f')]);_0x457886[_0x7bdb('0x37')]=_['intersection'](_0x457886[_0x7bdb('0x31')],_0x457886['query']);_0x5d564d[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x457886[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x5d564d['attributes']=_0x5d564d[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x5d564d[_0x7bdb('0x32')]:_0x457886['model'];_0x5d564d[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x4806e0['query'][_0x7bdb('0x35')]);_0x5d564d['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x4806e0['query'],_0x457886['filters']));if(_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x5d564d['where']=_[_0x7bdb('0x3a')](_0x5d564d['where'],{'$or':_[_0x7bdb('0x2a')](_0x5d564d['attributes'],function(_0x496cc3){var _0x22ef9c={};_0x22ef9c[_0x496cc3]={'$like':'%'+_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]+'%'};return _0x22ef9c;})});}_0x5d564d=_[_0x7bdb('0x3a')]({},_0x5d564d,_0x4806e0[_0x7bdb('0x43')]);return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})[_0x7bdb('0x24')](function(_0x8cf13a){if(_0x8cf13a){_0x258f29=_0x8cf13a[_0x7bdb('0x41')];if(!_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x4c')](_0x7bdb('0x4d'))){_0x5d564d['limit']=qs[_0x7bdb('0x1e')](_0x4806e0[_0x7bdb('0x2f')]['limit']);_0x5d564d[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);}return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})['then'](function(_0xa5624f){if(_0xa5624f){return _0xa5624f?{'count':_0x258f29,'rows':_0xa5624f}:null;}})[_0x7bdb('0x24')](respondWithResult(_0x240425,null))[_0x7bdb('0x44')](handleError(_0x240425,null));};exports['addConfiguration']=function(_0x3dbcf,_0x2c2fb7,_0x33b93a){if(_0x3dbcf[_0x7bdb('0x46')]['id']){delete _0x3dbcf[_0x7bdb('0x46')]['id'];}return db[_0x7bdb('0x3c')][_0x7bdb('0x4e')]({'where':{'id':_0x3dbcf[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2c2fb7,null))['then'](function(_0x7a7c4a){if(_0x7a7c4a){_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x4f')]=_0x7a7c4a['id'];_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x50')]=integrations[_0x7bdb('0x51')](_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x52')],_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x2d')]);_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x53')]=integrations[_0x7bdb('0x54')](_0x3dbcf['body'][_0x7bdb('0x52')],_0x3dbcf['body'][_0x7bdb('0x2d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x45')](_0x3dbcf['body'],{'include':[{'model':db[_0x7bdb('0x56')],'as':_0x7bdb('0x50')},{'model':db['FreshdeskField'],'as':_0x7bdb('0x53')}]});}return null;})[_0x7bdb('0x24')](respondWithResult(_0x2c2fb7,null))['catch'](handleError(_0x2c2fb7,null));};exports[_0x7bdb('0x57')]=function(_0x1a706b,_0x579caa,_0x291fd3){var _0x237688='';return db['FreshdeskAccount'][_0x7bdb('0x4e')]({'where':{'id':_0x1a706b[_0x7bdb('0x49')]['id']},'attributes':['id','remoteUri',_0x7bdb('0x58')]})['then'](handleEntityNotFound(_0x579caa,null))[_0x7bdb('0x24')](function(_0x25136b){if(_0x25136b){_0x237688=_0x25136b[_0x7bdb('0x59')];var _0x21dd9a=_0x237688[_0x7bdb('0x5a')](-0x1);if(_0x21dd9a==='/'){_0x237688=_0x237688['substring'](0x0,_0x237688['lastIndexOf'](_0x21dd9a));}return rp({'method':'GET','uri':util[_0x7bdb('0x5b')]('%s/%s',_0x237688,_0x7bdb('0x5c')),'headers':{'Authorization':util[_0x7bdb('0x5b')](_0x7bdb('0x5d'),new Buffer(util['format']('%s:X',_0x25136b[_0x7bdb('0x58')]))[_0x7bdb('0x5e')](_0x7bdb('0x5f')))},'json':!![]});}})[_0x7bdb('0x24')](function(_0x572cbe){if(_0x572cbe){var _0x194908=[_0x7bdb('0x60'),_0x7bdb('0x61'),_0x7bdb('0x62'),_0x7bdb('0x63'),_0x7bdb('0x18'),'priority',_0x7bdb('0x64'),'source',_0x7bdb('0x65'),'group',_0x7bdb('0x66')];_[_0x7bdb('0x67')](_0x572cbe,function(_0xee6d78){return _0x194908[_0x7bdb('0x68')](_0xee6d78[_0x7bdb('0x27')])||!_0xee6d78['default']&&_0xee6d78['type']!==_0x7bdb('0x69')&&_0xee6d78[_0x7bdb('0x2d')]!=='custom_dropdown';});return{'count':_0x572cbe[_0x7bdb('0x41')],'rows':_[_0x7bdb('0x2a')](_0x572cbe,function(_0x5a674b){return{'id':_0x5a674b[_0x7bdb('0x27')],'name':_0x5a674b[_0x7bdb('0x6a')],'custom':!_0x5a674b['default'],'options':_0x5a674b[_0x7bdb('0x6b')]?_['map'](_0x5a674b['choices'],function(_0x18d686){return{'name':_[_0x7bdb('0x6c')](_0x18d686),'value':_0x18d686};}):[]};})};}})['then'](respondWithResult(_0x579caa,null))['catch'](function(_0xd5881e){var _0x566a9e=_0x1a706b[_0x7bdb('0x2f')]['test']?0x1f4:_0xd5881e[_0x7bdb('0x6d')]||0x1f4;logger[_0x7bdb('0x26')](_0x7bdb('0x6e'),_0x7bdb('0x57'),_0x566a9e,JSON['stringify'](_0xd5881e));delete _0xd5881e[_0x7bdb('0x27')];if(_0x566a9e===0x191){_0x566a9e=0x190;}_0x579caa[_0x7bdb('0x18')](_0x566a9e)['send'](_0x1a706b[_0x7bdb('0x2f')][_0x7bdb('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0xd5881e[_0x7bdb('0x6d')]}:_0xd5881e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index b504727..38d1c27 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 _0xa57a=['lodash','util','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x4c1921,_0x2bd088){var _0x4868fb=function(_0x28ae8e){while(--_0x28ae8e){_0x4c1921['push'](_0x4c1921['shift']());}};_0x4868fb(++_0x2bd088);}(_0xa57a,0x64));var _0xaa57=function(_0x3a2e52,_0x280c52){_0x3a2e52=_0x3a2e52-0x0;var _0xda08ce=_0xa57a[_0x3a2e52];return _0xda08ce;};'use strict';var _=require(_0xaa57('0x0'));var util=require(_0xaa57('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa57('0x2'));var BPromise=require(_0xaa57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa57('0x4'));var config=require(_0xaa57('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xaa57('0x6'));module[_0xaa57('0x7')]=function(_0x4550f4,_0x72c5cf){return _0x4550f4[_0xaa57('0x8')](_0xaa57('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2a9=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x471001,_0x5b0bdb){var _0x77798a=function(_0x3c9cae){while(--_0x3c9cae){_0x471001['push'](_0x471001['shift']());}};_0x77798a(++_0x5b0bdb);}(_0xe2a9,0x1cd));var _0x9e2a=function(_0x2c750c,_0x589f97){_0x2c750c=_0x2c750c-0x0;var _0x21f92d=_0xe2a9[_0x2c750c];return _0x21f92d;};'use strict';var _=require(_0x9e2a('0x0'));var util=require(_0x9e2a('0x1'));var logger=require(_0x9e2a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9e2a('0x3'));var rp=require(_0x9e2a('0x4'));var fs=require('fs');var path=require(_0x9e2a('0x5'));var rimraf=require(_0x9e2a('0x6'));var config=require(_0x9e2a('0x7'));var attributes=require(_0x9e2a('0x8'));var integrations=require(_0x9e2a('0x9'));module[_0x9e2a('0xa')]=function(_0x1827c1,_0x21d60a){return _0x1827c1[_0x9e2a('0xb')](_0x9e2a('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index a0c5b96..bf1c74d 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 _0x8f82=['findAll','options','attributes','limit','map','include','model','then','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount'];(function(_0x969407,_0x4b07cd){var _0x1df001=function(_0x33a0f8){while(--_0x33a0f8){_0x969407['push'](_0x969407['shift']());}};_0x1df001(++_0x4b07cd);}(_0x8f82,0x77));var _0x28f8=function(_0x40741b,_0x380f1a){_0x40741b=_0x40741b-0x0;var _0x30e499=_0x8f82[_0x40741b];return _0x30e499;};'use strict';var _=require(_0x28f8('0x0'));var util=require(_0x28f8('0x1'));var moment=require(_0x28f8('0x2'));var BPromise=require(_0x28f8('0x3'));var rs=require(_0x28f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28f8('0x5'))['db'];var utils=require(_0x28f8('0x6'));var logger=require(_0x28f8('0x7'))(_0x28f8('0x8'));var config=require(_0x28f8('0x9'));var jayson=require(_0x28f8('0xa'));var client=jayson[_0x28f8('0xb')][_0x28f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f5b97,_0x2e7fbb,_0x5143a3){return new BPromise(function(_0x111411,_0x3bf6f6){return client['request'](_0x1f5b97,_0x5143a3)['then'](function(_0x1845e8){logger['info'](_0x28f8('0xd'),_0x2e7fbb,_0x28f8('0xe'));logger[_0x28f8('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2e7fbb,_0x28f8('0xe'),JSON[_0x28f8('0x10')](_0x1845e8));if(_0x1845e8[_0x28f8('0x11')]){if(_0x1845e8[_0x28f8('0x11')][_0x28f8('0x12')]===0x1f4){logger['error'](_0x28f8('0xd'),_0x2e7fbb,_0x1845e8[_0x28f8('0x11')][_0x28f8('0x13')]);return _0x3bf6f6(_0x1845e8[_0x28f8('0x11')][_0x28f8('0x13')]);}logger[_0x28f8('0x11')](_0x28f8('0xd'),_0x2e7fbb,_0x1845e8[_0x28f8('0x11')]['message']);return _0x111411(_0x1845e8[_0x28f8('0x11')][_0x28f8('0x13')]);}else{logger[_0x28f8('0x14')](_0x28f8('0xd'),_0x2e7fbb,'request\x20sent');_0x111411(_0x1845e8[_0x28f8('0x15')][_0x28f8('0x13')]);}})[_0x28f8('0x16')](function(_0x3f733c){logger[_0x28f8('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x2e7fbb,_0x3f733c);_0x3bf6f6(_0x3f733c);});});}exports[_0x28f8('0x17')]=function(_0x4db0a9){var _0x3bf2cc=this;return new Promise(function(_0x153c7a,_0x3b05a7){return db[_0x28f8('0x18')][_0x28f8('0x19')]({'raw':_0x4db0a9[_0x28f8('0x1a')]?_0x4db0a9[_0x28f8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4db0a9[_0x28f8('0x1a')]?_0x4db0a9[_0x28f8('0x1a')]['where']||null:null,'attributes':_0x4db0a9[_0x28f8('0x1a')]?_0x4db0a9[_0x28f8('0x1a')][_0x28f8('0x1b')]||null:null,'limit':_0x4db0a9[_0x28f8('0x1a')]?_0x4db0a9['options'][_0x28f8('0x1c')]||null:null,'include':_0x4db0a9['options']?_0x4db0a9['options']['include']?_[_0x28f8('0x1d')](_0x4db0a9[_0x28f8('0x1a')][_0x28f8('0x1e')],function(_0xac2fca){return{'model':db[_0xac2fca[_0x28f8('0x1f')]],'as':_0xac2fca['as'],'attributes':_0xac2fca[_0x28f8('0x1b')],'include':_0xac2fca[_0x28f8('0x1e')]?_[_0x28f8('0x1d')](_0xac2fca[_0x28f8('0x1e')],function(_0x4e5237){return{'model':db[_0x4e5237[_0x28f8('0x1f')]],'as':_0x4e5237['as'],'attributes':_0x4e5237[_0x28f8('0x1b')],'include':_0x4e5237['include']?_[_0x28f8('0x1d')](_0x4e5237[_0x28f8('0x1e')],function(_0x53aade){return{'model':db[_0x53aade['model']],'as':_0x53aade['as'],'attributes':_0x53aade[_0x28f8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x28f8('0x20')](function(_0x5d7168){logger[_0x28f8('0x14')](_0x28f8('0x17'),_0x4db0a9);logger[_0x28f8('0xf')]('GetFreshdeskAccount',_0x4db0a9,JSON['stringify'](_0x5d7168));_0x153c7a(_0x5d7168);})['catch'](function(_0x1749d5){logger[_0x28f8('0x11')](_0x28f8('0x17'),_0x1749d5[_0x28f8('0x13')],_0x4db0a9);_0x3b05a7(_0x3bf2cc[_0x28f8('0x11')](0x1f4,_0x1749d5[_0x28f8('0x13')]));});});};exports[_0x28f8('0x21')]=function(_0x24ddef){var _0x84ad0e=this;return new Promise(function(_0x501ba3,_0x5b70b4){return db['FreshdeskAccount'][_0x28f8('0x22')]({'raw':_0x24ddef['options']?_0x24ddef[_0x28f8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24ddef['options']?_0x24ddef['options'][_0x28f8('0x23')]||null:null,'attributes':_0x24ddef[_0x28f8('0x1a')]?_0x24ddef[_0x28f8('0x1a')][_0x28f8('0x1b')]||null:null,'include':_0x24ddef['options']?_0x24ddef[_0x28f8('0x1a')][_0x28f8('0x1e')]?_[_0x28f8('0x1d')](_0x24ddef[_0x28f8('0x1a')][_0x28f8('0x1e')],function(_0x53a1bc){return{'model':db[_0x53a1bc[_0x28f8('0x1f')]],'as':_0x53a1bc['as'],'attributes':_0x53a1bc[_0x28f8('0x1b')],'include':_0x53a1bc[_0x28f8('0x1e')]?_['map'](_0x53a1bc[_0x28f8('0x1e')],function(_0x359e31){return{'model':db[_0x359e31['model']],'as':_0x359e31['as'],'attributes':_0x359e31[_0x28f8('0x1b')],'include':_0x359e31[_0x28f8('0x1e')]?_[_0x28f8('0x1d')](_0x359e31[_0x28f8('0x1e')],function(_0x348339){return{'model':db[_0x348339[_0x28f8('0x1f')]],'as':_0x348339['as'],'attributes':_0x348339[_0x28f8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x28f8('0x20')](function(_0x4cc9e5){logger[_0x28f8('0x14')](_0x28f8('0x21'),_0x24ddef);logger[_0x28f8('0xf')](_0x28f8('0x21'),_0x24ddef,JSON[_0x28f8('0x10')](_0x4cc9e5));_0x501ba3(_0x4cc9e5);})[_0x28f8('0x16')](function(_0xd1c586){logger[_0x28f8('0x11')](_0x28f8('0x21'),_0xd1c586[_0x28f8('0x13')],_0x24ddef);_0x5b70b4(_0x84ad0e[_0x28f8('0x11')](0x1f4,_0xd1c586[_0x28f8('0x13')]));});});}; \ No newline at end of file +var _0x1061=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','then','ShowFreshdeskAccount','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x369909,_0x2050ec){var _0x285fec=function(_0x56dc5a){while(--_0x56dc5a){_0x369909['push'](_0x369909['shift']());}};_0x285fec(++_0x2050ec);}(_0x1061,0x1b5));var _0x1106=function(_0x56dcf8,_0x5cf591){_0x56dcf8=_0x56dcf8-0x0;var _0x172671=_0x1061[_0x56dcf8];return _0x172671;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1106('0x1'));var fs=require('fs');var Redis=require(_0x1106('0x2'));var db=require(_0x1106('0x3'))['db'];var utils=require(_0x1106('0x4'));var logger=require(_0x1106('0x5'))(_0x1106('0x6'));var config=require(_0x1106('0x7'));var jayson=require(_0x1106('0x8'));var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36bfb3,_0x54d2d5,_0x523f0f){return new BPromise(function(_0x287336,_0x3056e0){return client['request'](_0x36bfb3,_0x523f0f)['then'](function(_0x223c85){logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));logger[_0x1106('0xd')](_0x1106('0xe'),_0x54d2d5,_0x1106('0xc'),JSON[_0x1106('0xf')](_0x223c85));if(_0x223c85[_0x1106('0x10')]){if(_0x223c85[_0x1106('0x10')]['code']===0x1f4){logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x3056e0(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x287336(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}else{logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));_0x287336(_0x223c85[_0x1106('0x12')][_0x1106('0x11')]);}})[_0x1106('0x13')](function(_0x547ca3){logger['error'](_0x1106('0xb'),_0x54d2d5,_0x547ca3);_0x3056e0(_0x547ca3);});});}exports[_0x1106('0x14')]=function(_0x2c2905){var _0x465c13=this;return new Promise(function(_0x5be7fc,_0x2c8ff5){return db[_0x1106('0x15')][_0x1106('0x16')]({'raw':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x18')]===undefined?!![]:![]:!![],'where':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x2c2905['options']?_0x2c2905[_0x1106('0x17')]['attributes']||null:null,'limit':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options']['limit']||null:null,'include':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2c2905[_0x1106('0x17')][_0x1106('0x1a')],function(_0x2418c7){return{'model':db[_0x2418c7[_0x1106('0x1c')]],'as':_0x2418c7['as'],'attributes':_0x2418c7[_0x1106('0x1d')],'include':_0x2418c7[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2418c7[_0x1106('0x1a')],function(_0x1ff815){return{'model':db[_0x1ff815[_0x1106('0x1c')]],'as':_0x1ff815['as'],'attributes':_0x1ff815['attributes'],'include':_0x1ff815[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1ff815[_0x1106('0x1a')],function(_0x2285dd){return{'model':db[_0x2285dd['model']],'as':_0x2285dd['as'],'attributes':_0x2285dd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x465d83){logger[_0x1106('0xa')](_0x1106('0x14'),_0x2c2905);logger[_0x1106('0xd')](_0x1106('0x14'),_0x2c2905,JSON['stringify'](_0x465d83));_0x5be7fc(_0x465d83);})['catch'](function(_0x4b070d){logger[_0x1106('0x10')](_0x1106('0x14'),_0x4b070d[_0x1106('0x11')],_0x2c2905);_0x2c8ff5(_0x465c13[_0x1106('0x10')](0x1f4,_0x4b070d[_0x1106('0x11')]));});});};exports[_0x1106('0x1f')]=function(_0x1edae3){var _0x664bf4=this;return new Promise(function(_0x23ac46,_0x3b2021){return db[_0x1106('0x15')]['find']({'raw':_0x1edae3['options']?_0x1edae3[_0x1106('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1edae3[_0x1106('0x17')]?_0x1edae3[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x1edae3[_0x1106('0x17')]?_0x1edae3[_0x1106('0x17')]['attributes']||null:null,'include':_0x1edae3[_0x1106('0x17')]?_0x1edae3['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1edae3[_0x1106('0x17')][_0x1106('0x1a')],function(_0x4809a8){return{'model':db[_0x4809a8[_0x1106('0x1c')]],'as':_0x4809a8['as'],'attributes':_0x4809a8[_0x1106('0x1d')],'include':_0x4809a8[_0x1106('0x1a')]?_['map'](_0x4809a8['include'],function(_0x5af406){return{'model':db[_0x5af406[_0x1106('0x1c')]],'as':_0x5af406['as'],'attributes':_0x5af406[_0x1106('0x1d')],'include':_0x5af406[_0x1106('0x1a')]?_['map'](_0x5af406[_0x1106('0x1a')],function(_0x5158bd){return{'model':db[_0x5158bd[_0x1106('0x1c')]],'as':_0x5158bd['as'],'attributes':_0x5158bd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x56abbf){logger['info']('ShowFreshdeskAccount',_0x1edae3);logger[_0x1106('0xd')]('ShowFreshdeskAccount',_0x1edae3,JSON['stringify'](_0x56abbf));_0x23ac46(_0x56abbf);})['catch'](function(_0x3c2a02){logger[_0x1106('0x10')](_0x1106('0x1f'),_0x3c2a02[_0x1106('0x11')],_0x1edae3);_0x3b2021(_0x664bf4['error'](0x1f4,_0x3c2a02['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3465e6c..c99a596 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 _0x909a=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields'];(function(_0x26bbf3,_0x1e21cb){var _0x516275=function(_0x31b53f){while(--_0x31b53f){_0x26bbf3['push'](_0x26bbf3['shift']());}};_0x516275(++_0x1e21cb);}(_0x909a,0x1cc));var _0xa909=function(_0x3da647,_0xa1a501){_0x3da647=_0x3da647-0x0;var _0x2e91a2=_0x909a[_0x3da647];return _0x2e91a2;};'use strict';var multer=require('multer');var util=require(_0xa909('0x0'));var path=require(_0xa909('0x1'));var timeout=require(_0xa909('0x2'));var express=require('express');var router=express[_0xa909('0x3')]();var fs_extra=require(_0xa909('0x4'));var auth=require(_0xa909('0x5'));var interaction=require(_0xa909('0x6'));var config=require('../../config/environment');var controller=require(_0xa909('0x7'));router['get']('/',auth[_0xa909('0x8')](),controller[_0xa909('0x9')]);router[_0xa909('0xa')](_0xa909('0xb'),auth['isAuthenticated'](),controller[_0xa909('0xc')]);router['get'](_0xa909('0xd'),auth['isAuthenticated'](),controller[_0xa909('0xe')]);router[_0xa909('0xa')]('/:id/subjects',auth[_0xa909('0x8')](),controller[_0xa909('0xf')]);router[_0xa909('0xa')](_0xa909('0x10'),auth[_0xa909('0x8')](),controller[_0xa909('0x11')]);router['get'](_0xa909('0x12'),auth['isAuthenticated'](),controller['getTags']);router[_0xa909('0x13')]('/',auth[_0xa909('0x8')](),controller['create']);router[_0xa909('0x13')](_0xa909('0x12'),auth['isAuthenticated'](),controller[_0xa909('0x14')]);router[_0xa909('0x15')](_0xa909('0xb'),auth[_0xa909('0x8')](),controller[_0xa909('0x16')]);router['delete'](_0xa909('0xb'),auth[_0xa909('0x8')](),controller[_0xa909('0x17')]);module[_0xa909('0x18')]=router; \ No newline at end of file +var _0x149e=['put','/:id','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags'];(function(_0x332d18,_0xb1c601){var _0x2aab22=function(_0x27602c){while(--_0x27602c){_0x332d18['push'](_0x332d18['shift']());}};_0x2aab22(++_0xb1c601);}(_0x149e,0x15e));var _0xe149=function(_0x2a3a3a,_0x1316df){_0x2a3a3a=_0x2a3a3a-0x0;var _0x36be2e=_0x149e[_0x2a3a3a];return _0x36be2e;};'use strict';var multer=require(_0xe149('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe149('0x1'));var express=require(_0xe149('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe149('0x3'));var interaction=require(_0xe149('0x4'));var config=require(_0xe149('0x5'));var controller=require(_0xe149('0x6'));router[_0xe149('0x7')]('/',auth[_0xe149('0x8')](),controller[_0xe149('0x9')]);router['get']('/:id',auth[_0xe149('0x8')](),controller[_0xe149('0xa')]);router[_0xe149('0x7')]('/:id/fields',auth[_0xe149('0x8')](),controller['getFields']);router[_0xe149('0x7')](_0xe149('0xb'),auth[_0xe149('0x8')](),controller[_0xe149('0xc')]);router[_0xe149('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe149('0xd')]);router[_0xe149('0x7')](_0xe149('0xe'),auth[_0xe149('0x8')](),controller[_0xe149('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe149('0x10')](_0xe149('0xe'),auth[_0xe149('0x8')](),controller[_0xe149('0x11')]);router[_0xe149('0x12')](_0xe149('0x13'),auth[_0xe149('0x8')](),controller['update']);router[_0xe149('0x14')](_0xe149('0x13'),auth[_0xe149('0x8')](),controller[_0xe149('0x15')]);module[_0xe149('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 036522e..e2f1490 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 _0xd4e3=['sequelize','exports','STRING'];(function(_0xce755b,_0x58fb87){var _0x30d6da=function(_0x4fa3c2){while(--_0x4fa3c2){_0xce755b['push'](_0xce755b['shift']());}};_0x30d6da(++_0x58fb87);}(_0xd4e3,0x12f));var _0x3d4e=function(_0x53b2ef,_0x2f8de5){_0x53b2ef=_0x53b2ef-0x0;var _0x17e2dc=_0xd4e3[_0x53b2ef];return _0x17e2dc;};'use strict';var Sequelize=require(_0x3d4e('0x0'));module[_0x3d4e('0x1')]={'name':{'type':Sequelize[_0x3d4e('0x2')]},'description':{'type':Sequelize[_0x3d4e('0x2')]}}; \ No newline at end of file +var _0xe5c1=['STRING'];(function(_0x147474,_0x3ec480){var _0x4b7c92=function(_0x58e7eb){while(--_0x58e7eb){_0x147474['push'](_0x147474['shift']());}};_0x4b7c92(++_0x3ec480);}(_0xe5c1,0x153));var _0x1e5c=function(_0x5256f8,_0x4ba759){_0x5256f8=_0x5256f8-0x0;var _0x1c6b16=_0xe5c1[_0x5256f8];return _0x1c6b16;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1e5c('0x0')]},'description':{'type':Sequelize[_0x1e5c('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 237cf5e..c9300a6 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 _0xa9f8=['ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','then','error','stack','name','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','merge','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','Tag','order','getTags','setTags','ids','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9f8,0x97));var _0x8a9f=function(_0x614641,_0x15484d){_0x614641=_0x614641-0x0;var _0x20e1f2=_0xa9f8[_0x614641];return _0x20e1f2;};'use strict';var emlformat=require(_0x8a9f('0x0'));var rimraf=require(_0x8a9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a9f('0x2'));var moment=require('moment');var BPromise=require(_0x8a9f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8a9f('0x4'));var sox=require(_0x8a9f('0x5'));var csv=require(_0x8a9f('0x6'));var ejs=require(_0x8a9f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a9f('0x8'));var squel=require('squel');var crypto=require(_0x8a9f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8a9f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8a9f('0xb'));var Papa=require('papaparse');var Redis=require(_0x8a9f('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8a9f('0xd'));var as=require(_0x8a9f('0xe'));var hardwareService=require(_0x8a9f('0xf'));var logger=require(_0x8a9f('0x10'))(_0x8a9f('0x11'));var utils=require(_0x8a9f('0x12'));var config=require(_0x8a9f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a9f('0x14'))['db'];function respondWithStatusCode(_0x37ba21,_0x2e62a3){_0x2e62a3=_0x2e62a3||0xcc;return function(_0x19ec3c){if(_0x19ec3c){return _0x37ba21[_0x8a9f('0x15')](_0x2e62a3);}return _0x37ba21[_0x8a9f('0x16')](_0x2e62a3)[_0x8a9f('0x17')]();};}function respondWithResult(_0x35cefc,_0x365bbb){_0x365bbb=_0x365bbb||0xc8;return function(_0x4bae0f){if(_0x4bae0f){return _0x35cefc[_0x8a9f('0x16')](_0x365bbb)[_0x8a9f('0x18')](_0x4bae0f);}};}function respondWithFilteredResult(_0x5341bb,_0x47d4d4){return function(_0x1f7304){if(_0x1f7304){var _0x511f81=typeof _0x47d4d4['offset']===_0x8a9f('0x19')&&typeof _0x47d4d4[_0x8a9f('0x1a')]===_0x8a9f('0x19');var _0x17f5b7=_0x1f7304[_0x8a9f('0x1b')];var _0x5d5c6e=_0x511f81?0x0:_0x47d4d4[_0x8a9f('0x1c')];var _0x99c95d=_0x511f81?_0x1f7304[_0x8a9f('0x1b')]:_0x47d4d4['offset']+_0x47d4d4[_0x8a9f('0x1a')];var _0x510ec6;if(_0x99c95d>=_0x17f5b7){_0x99c95d=_0x17f5b7;_0x510ec6=0xc8;}else{_0x510ec6=0xce;}_0x5341bb['status'](_0x510ec6);return _0x5341bb[_0x8a9f('0x1d')]('Content-Range',_0x5d5c6e+'-'+_0x99c95d+'/'+_0x17f5b7)[_0x8a9f('0x18')](_0x1f7304);}return null;};}function patchUpdates(_0x320ce8){return function(_0x2761af){try{jsonpatch['apply'](_0x2761af,_0x320ce8,!![]);}catch(_0x6bd4da){return BPromise['reject'](_0x6bd4da);}return _0x2761af[_0x8a9f('0x1e')]();};}function saveUpdates(_0x1bc2a1,_0xc2104a){return function(_0x33806d){if(_0x33806d){return _0x33806d[_0x8a9f('0x1f')](_0x1bc2a1)[_0x8a9f('0x20')](function(_0x22ba97){return _0x22ba97;});}return null;};}function removeEntity(_0x32196a,_0x1c336c){return function(_0x494e3f){if(_0x494e3f){return _0x494e3f['destroy']()[_0x8a9f('0x20')](function(){_0x32196a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x132465,_0x17dd8e){return function(_0x37546e){if(!_0x37546e){_0x132465['sendStatus'](0x194);}return _0x37546e;};}function handleError(_0x119a94,_0x6f5502){_0x6f5502=_0x6f5502||0x1f4;return function(_0x25bd48){logger[_0x8a9f('0x21')](_0x25bd48[_0x8a9f('0x22')]);if(_0x25bd48[_0x8a9f('0x23')]){delete _0x25bd48[_0x8a9f('0x23')];}_0x119a94['status'](_0x6f5502)['send'](_0x25bd48);};}exports['index']=function(_0x167712,_0x29c2a8){var _0x5d2d0a={},_0x30789b={},_0x54d2ae={'count':0x0,'rows':[]};var _0x4291ae=_[_0x8a9f('0x24')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x2b8888){return{'name':_0x2b8888[_0x8a9f('0x25')],'type':_0x2b8888[_0x8a9f('0x26')][_0x8a9f('0x27')]};});_0x30789b[_0x8a9f('0x28')]=_[_0x8a9f('0x24')](_0x4291ae,'name');_0x30789b[_0x8a9f('0x29')]=_['keys'](_0x167712[_0x8a9f('0x29')]);_0x30789b[_0x8a9f('0x2a')]=_['intersection'](_0x30789b[_0x8a9f('0x28')],_0x30789b[_0x8a9f('0x29')]);_0x5d2d0a[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x30789b[_0x8a9f('0x28')],qs[_0x8a9f('0x2d')](_0x167712[_0x8a9f('0x29')][_0x8a9f('0x2d')]));_0x5d2d0a[_0x8a9f('0x2b')]=_0x5d2d0a['attributes'][_0x8a9f('0x2e')]?_0x5d2d0a[_0x8a9f('0x2b')]:_0x30789b[_0x8a9f('0x28')];if(!_0x167712[_0x8a9f('0x29')]['hasOwnProperty'](_0x8a9f('0x2f'))){_0x5d2d0a[_0x8a9f('0x1a')]=qs[_0x8a9f('0x1a')](_0x167712[_0x8a9f('0x29')][_0x8a9f('0x1a')]);_0x5d2d0a['offset']=qs[_0x8a9f('0x1c')](_0x167712['query'][_0x8a9f('0x1c')]);}_0x5d2d0a['order']=qs['sort'](_0x167712[_0x8a9f('0x29')][_0x8a9f('0x30')]);_0x5d2d0a['where']=qs['filters'](_[_0x8a9f('0x31')](_0x167712[_0x8a9f('0x29')],_0x30789b[_0x8a9f('0x2a')]),_0x4291ae);if(_0x167712[_0x8a9f('0x29')]['filter']){_0x5d2d0a[_0x8a9f('0x32')]=_['merge'](_0x5d2d0a[_0x8a9f('0x32')],{'$or':_['map'](_0x4291ae,function(_0x15c5e7){if(_0x15c5e7[_0x8a9f('0x26')]!==_0x8a9f('0x33')){var _0x214ab1={};_0x214ab1[_0x15c5e7[_0x8a9f('0x23')]]={'$like':'%'+_0x167712[_0x8a9f('0x29')][_0x8a9f('0x34')]+'%'};return _0x214ab1;}})});}_0x5d2d0a=_['merge']({},_0x5d2d0a,_0x167712[_0x8a9f('0x35')]);var _0x282285={'where':_0x5d2d0a['where']};return db[_0x8a9f('0x36')]['count'](_0x282285)[_0x8a9f('0x20')](function(_0x207a9a){_0x54d2ae[_0x8a9f('0x1b')]=_0x207a9a;if(_0x167712[_0x8a9f('0x29')][_0x8a9f('0x37')]){_0x5d2d0a[_0x8a9f('0x38')]=[{'all':!![]}];}return db[_0x8a9f('0x36')][_0x8a9f('0x39')](_0x5d2d0a);})['then'](function(_0x2c15b7){_0x54d2ae[_0x8a9f('0x3a')]=_0x2c15b7;return _0x54d2ae;})[_0x8a9f('0x20')](respondWithFilteredResult(_0x29c2a8,_0x5d2d0a))[_0x8a9f('0x3b')](handleError(_0x29c2a8,null));};exports['show']=function(_0x142744,_0x3cec86){var _0x149502={'raw':![],'where':{'id':_0x142744[_0x8a9f('0x3c')]['id']}},_0x5ad2e9={};_0x5ad2e9['model']=_[_0x8a9f('0x3d')](db[_0x8a9f('0x36')][_0x8a9f('0x3e')]);_0x5ad2e9[_0x8a9f('0x29')]=_[_0x8a9f('0x3d')](_0x142744[_0x8a9f('0x29')]);_0x5ad2e9[_0x8a9f('0x2a')]=_[_0x8a9f('0x2c')](_0x5ad2e9['model'],_0x5ad2e9[_0x8a9f('0x29')]);_0x149502[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x5ad2e9[_0x8a9f('0x28')],qs['fields'](_0x142744[_0x8a9f('0x29')]['fields']));_0x149502[_0x8a9f('0x2b')]=_0x149502['attributes'][_0x8a9f('0x2e')]?_0x149502[_0x8a9f('0x2b')]:_0x5ad2e9[_0x8a9f('0x28')];if(_0x142744['query'][_0x8a9f('0x37')]){_0x149502[_0x8a9f('0x38')]=[{'all':!![]}];}_0x149502=_[_0x8a9f('0x3f')]({},_0x149502,_0x142744['options']);return db['FreshdeskConfiguration'][_0x8a9f('0x40')](_0x149502)['then'](handleEntityNotFound(_0x3cec86,null))[_0x8a9f('0x20')](respondWithResult(_0x3cec86,null))['catch'](handleError(_0x3cec86,null));};exports[_0x8a9f('0x41')]=function(_0x4f2dce,_0x2f4d75){return db[_0x8a9f('0x36')][_0x8a9f('0x41')](_0x4f2dce['body'],{})[_0x8a9f('0x20')](respondWithResult(_0x2f4d75,0xc9))[_0x8a9f('0x3b')](handleError(_0x2f4d75,null));};exports[_0x8a9f('0x1f')]=function(_0x18260b,_0x2cee7d){if(_0x18260b['body']['id']){delete _0x18260b[_0x8a9f('0x42')]['id'];}return db[_0x8a9f('0x36')][_0x8a9f('0x40')]({'where':{'id':_0x18260b[_0x8a9f('0x3c')]['id']}})[_0x8a9f('0x20')](handleEntityNotFound(_0x2cee7d,null))['then'](saveUpdates(_0x18260b['body'],null))[_0x8a9f('0x20')](respondWithResult(_0x2cee7d,null))[_0x8a9f('0x3b')](handleError(_0x2cee7d,null));};exports[_0x8a9f('0x43')]=function(_0x2a5c04,_0x22051c){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x2a5c04[_0x8a9f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x22051c,null))['then'](removeEntity(_0x22051c,null))[_0x8a9f('0x3b')](handleError(_0x22051c,null));};exports[_0x8a9f('0x44')]=function(_0x2f005c,_0x408ce9,_0x307c0d){var _0x3e1b67={};var _0x1b00c8={};var _0x47e91d;var _0x25f6f5;return db['FreshdeskConfiguration'][_0x8a9f('0x45')]({'where':{'id':_0x2f005c[_0x8a9f('0x3c')]['id']}})[_0x8a9f('0x20')](handleEntityNotFound(_0x408ce9,null))['then'](function(_0x1283a2){if(_0x1283a2){_0x47e91d=_0x1283a2;_0x1b00c8[_0x8a9f('0x28')]=_['keys'](db[_0x8a9f('0x46')][_0x8a9f('0x3e')]);_0x1b00c8['query']=_[_0x8a9f('0x3d')](_0x2f005c[_0x8a9f('0x29')]);_0x1b00c8[_0x8a9f('0x2a')]=_[_0x8a9f('0x2c')](_0x1b00c8['model'],_0x1b00c8[_0x8a9f('0x29')]);_0x3e1b67[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x1b00c8[_0x8a9f('0x28')],qs[_0x8a9f('0x2d')](_0x2f005c['query'][_0x8a9f('0x2d')]));_0x3e1b67[_0x8a9f('0x2b')]=_0x3e1b67[_0x8a9f('0x2b')][_0x8a9f('0x2e')]?_0x3e1b67[_0x8a9f('0x2b')]:_0x1b00c8[_0x8a9f('0x28')];_0x3e1b67['order']=qs['sort'](_0x2f005c['query']['sort']);_0x3e1b67['where']=qs[_0x8a9f('0x2a')](_[_0x8a9f('0x31')](_0x2f005c['query'],_0x1b00c8['filters']));if(_0x2f005c[_0x8a9f('0x29')][_0x8a9f('0x34')]){_0x3e1b67[_0x8a9f('0x32')]=_[_0x8a9f('0x3f')](_0x3e1b67[_0x8a9f('0x32')],{'$or':_['map'](_0x3e1b67[_0x8a9f('0x2b')],function(_0xeec769){var _0xf5f4e4={};_0xf5f4e4[_0xeec769]={'$like':'%'+_0x2f005c[_0x8a9f('0x29')][_0x8a9f('0x34')]+'%'};return _0xf5f4e4;})});}_0x3e1b67=_[_0x8a9f('0x3f')]({},_0x3e1b67,_0x2f005c[_0x8a9f('0x35')]);return _0x47e91d[_0x8a9f('0x44')](_0x3e1b67);}})[_0x8a9f('0x20')](function(_0x21b443){if(_0x21b443){_0x25f6f5=_0x21b443['length'];if(!_0x2f005c[_0x8a9f('0x29')][_0x8a9f('0x47')](_0x8a9f('0x2f'))){_0x3e1b67['limit']=qs['limit'](_0x2f005c[_0x8a9f('0x29')][_0x8a9f('0x1a')]);_0x3e1b67[_0x8a9f('0x1c')]=qs[_0x8a9f('0x1c')](_0x2f005c['query'][_0x8a9f('0x1c')]);}return _0x47e91d[_0x8a9f('0x44')](_0x3e1b67);}})['then'](function(_0x3a14a6){if(_0x3a14a6){return _0x3a14a6?{'count':_0x25f6f5,'rows':_0x3a14a6}:null;}})['then'](respondWithResult(_0x408ce9,null))['catch'](handleError(_0x408ce9,null));};exports[_0x8a9f('0x48')]=function(_0x437a04,_0x3b527a,_0x4942f7){var _0x5f4908={};var _0x56ee28={};var _0x2e6156;var _0x531123;return db[_0x8a9f('0x36')][_0x8a9f('0x45')]({'where':{'id':_0x437a04[_0x8a9f('0x3c')]['id']}})[_0x8a9f('0x20')](handleEntityNotFound(_0x3b527a,null))[_0x8a9f('0x20')](function(_0xa63ba4){if(_0xa63ba4){_0x2e6156=_0xa63ba4;_0x56ee28['model']=_[_0x8a9f('0x3d')](db[_0x8a9f('0x46')]['rawAttributes']);_0x56ee28[_0x8a9f('0x29')]=_['keys'](_0x437a04[_0x8a9f('0x29')]);_0x56ee28[_0x8a9f('0x2a')]=_[_0x8a9f('0x2c')](_0x56ee28[_0x8a9f('0x28')],_0x56ee28[_0x8a9f('0x29')]);_0x5f4908[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x56ee28[_0x8a9f('0x28')],qs['fields'](_0x437a04[_0x8a9f('0x29')][_0x8a9f('0x2d')]));_0x5f4908[_0x8a9f('0x2b')]=_0x5f4908['attributes']['length']?_0x5f4908['attributes']:_0x56ee28['model'];_0x5f4908['order']=qs[_0x8a9f('0x30')](_0x437a04[_0x8a9f('0x29')][_0x8a9f('0x30')]);_0x5f4908[_0x8a9f('0x32')]=qs[_0x8a9f('0x2a')](_[_0x8a9f('0x31')](_0x437a04[_0x8a9f('0x29')],_0x56ee28[_0x8a9f('0x2a')]));if(_0x437a04[_0x8a9f('0x29')][_0x8a9f('0x34')]){_0x5f4908[_0x8a9f('0x32')]=_[_0x8a9f('0x3f')](_0x5f4908['where'],{'$or':_['map'](_0x5f4908[_0x8a9f('0x2b')],function(_0x28e291){var _0x323911={};_0x323911[_0x28e291]={'$like':'%'+_0x437a04[_0x8a9f('0x29')]['filter']+'%'};return _0x323911;})});}_0x5f4908=_[_0x8a9f('0x3f')]({},_0x5f4908,_0x437a04[_0x8a9f('0x35')]);return _0x2e6156[_0x8a9f('0x48')](_0x5f4908);}})['then'](function(_0x4320e6){if(_0x4320e6){_0x531123=_0x4320e6[_0x8a9f('0x2e')];if(!_0x437a04['query']['hasOwnProperty'](_0x8a9f('0x2f'))){_0x5f4908[_0x8a9f('0x1a')]=qs['limit'](_0x437a04[_0x8a9f('0x29')][_0x8a9f('0x1a')]);_0x5f4908[_0x8a9f('0x1c')]=qs['offset'](_0x437a04[_0x8a9f('0x29')]['offset']);}return _0x2e6156[_0x8a9f('0x48')](_0x5f4908);}})['then'](function(_0x467dc3){if(_0x467dc3){return _0x467dc3?{'count':_0x531123,'rows':_0x467dc3}:null;}})[_0x8a9f('0x20')](respondWithResult(_0x3b527a,null))[_0x8a9f('0x3b')](handleError(_0x3b527a,null));};exports[_0x8a9f('0x49')]=function(_0x4e3dd8,_0x3fcc9b,_0x5b48fe){var _0x20e597={};var _0x22382f={};var _0x136c08;var _0x5894f4;return db['FreshdeskConfiguration'][_0x8a9f('0x45')]({'where':{'id':_0x4e3dd8[_0x8a9f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3fcc9b,null))[_0x8a9f('0x20')](function(_0x4541e5){if(_0x4541e5){_0x136c08=_0x4541e5;_0x22382f['model']=_[_0x8a9f('0x3d')](db[_0x8a9f('0x46')][_0x8a9f('0x3e')]);_0x22382f['query']=_[_0x8a9f('0x3d')](_0x4e3dd8[_0x8a9f('0x29')]);_0x22382f[_0x8a9f('0x2a')]=_[_0x8a9f('0x2c')](_0x22382f[_0x8a9f('0x28')],_0x22382f[_0x8a9f('0x29')]);_0x20e597[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x22382f[_0x8a9f('0x28')],qs[_0x8a9f('0x2d')](_0x4e3dd8['query'][_0x8a9f('0x2d')]));_0x20e597[_0x8a9f('0x2b')]=_0x20e597[_0x8a9f('0x2b')][_0x8a9f('0x2e')]?_0x20e597[_0x8a9f('0x2b')]:_0x22382f[_0x8a9f('0x28')];_0x20e597['order']=qs['sort'](_0x4e3dd8[_0x8a9f('0x29')][_0x8a9f('0x30')]);_0x20e597[_0x8a9f('0x32')]=qs['filters'](_[_0x8a9f('0x31')](_0x4e3dd8[_0x8a9f('0x29')],_0x22382f[_0x8a9f('0x2a')]));if(_0x4e3dd8[_0x8a9f('0x29')]['filter']){_0x20e597[_0x8a9f('0x32')]=_[_0x8a9f('0x3f')](_0x20e597[_0x8a9f('0x32')],{'$or':_[_0x8a9f('0x24')](_0x20e597[_0x8a9f('0x2b')],function(_0xfbe8b1){var _0x5654f2={};_0x5654f2[_0xfbe8b1]={'$like':'%'+_0x4e3dd8[_0x8a9f('0x29')]['filter']+'%'};return _0x5654f2;})});}_0x20e597=_[_0x8a9f('0x3f')]({},_0x20e597,_0x4e3dd8[_0x8a9f('0x35')]);return _0x136c08[_0x8a9f('0x49')](_0x20e597);}})[_0x8a9f('0x20')](function(_0x562420){if(_0x562420){_0x5894f4=_0x562420[_0x8a9f('0x2e')];if(!_0x4e3dd8[_0x8a9f('0x29')]['hasOwnProperty'](_0x8a9f('0x2f'))){_0x20e597['limit']=qs['limit'](_0x4e3dd8['query'][_0x8a9f('0x1a')]);_0x20e597[_0x8a9f('0x1c')]=qs[_0x8a9f('0x1c')](_0x4e3dd8['query'][_0x8a9f('0x1c')]);}return _0x136c08[_0x8a9f('0x49')](_0x20e597);}})[_0x8a9f('0x20')](function(_0x48b2d3){if(_0x48b2d3){return _0x48b2d3?{'count':_0x5894f4,'rows':_0x48b2d3}:null;}})['then'](respondWithResult(_0x3fcc9b,null))[_0x8a9f('0x3b')](handleError(_0x3fcc9b,null));};exports['getTags']=function(_0xc8328b,_0x13ec63,_0x2f386c){var _0x34c200={};var _0x15a23a={};var _0x484644;var _0x4e8ae9;return db['FreshdeskConfiguration'][_0x8a9f('0x45')]({'where':{'id':_0xc8328b[_0x8a9f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x13ec63,null))[_0x8a9f('0x20')](function(_0x4055f0){if(_0x4055f0){_0x484644=_0x4055f0;_0x15a23a['model']=_[_0x8a9f('0x3d')](db[_0x8a9f('0x4a')][_0x8a9f('0x3e')]);_0x15a23a[_0x8a9f('0x29')]=_[_0x8a9f('0x3d')](_0xc8328b['query']);_0x15a23a[_0x8a9f('0x2a')]=_['intersection'](_0x15a23a['model'],_0x15a23a[_0x8a9f('0x29')]);_0x34c200[_0x8a9f('0x2b')]=_[_0x8a9f('0x2c')](_0x15a23a[_0x8a9f('0x28')],qs[_0x8a9f('0x2d')](_0xc8328b[_0x8a9f('0x29')][_0x8a9f('0x2d')]));_0x34c200[_0x8a9f('0x2b')]=_0x34c200['attributes'][_0x8a9f('0x2e')]?_0x34c200[_0x8a9f('0x2b')]:_0x15a23a[_0x8a9f('0x28')];_0x34c200[_0x8a9f('0x4b')]=qs['sort'](_0xc8328b[_0x8a9f('0x29')]['sort']);_0x34c200['where']=qs[_0x8a9f('0x2a')](_[_0x8a9f('0x31')](_0xc8328b['query'],_0x15a23a['filters']));if(_0xc8328b[_0x8a9f('0x29')][_0x8a9f('0x34')]){_0x34c200[_0x8a9f('0x32')]=_[_0x8a9f('0x3f')](_0x34c200[_0x8a9f('0x32')],{'$or':_['map'](_0x34c200[_0x8a9f('0x2b')],function(_0x120e8b){var _0x370828={};_0x370828[_0x120e8b]={'$like':'%'+_0xc8328b[_0x8a9f('0x29')]['filter']+'%'};return _0x370828;})});}_0x34c200=_['merge']({},_0x34c200,_0xc8328b[_0x8a9f('0x35')]);return _0x484644['getTags'](_0x34c200);}})[_0x8a9f('0x20')](function(_0x4f7f9c){if(_0x4f7f9c){_0x4e8ae9=_0x4f7f9c[_0x8a9f('0x2e')];if(!_0xc8328b[_0x8a9f('0x29')][_0x8a9f('0x47')](_0x8a9f('0x2f'))){_0x34c200[_0x8a9f('0x1a')]=qs[_0x8a9f('0x1a')](_0xc8328b[_0x8a9f('0x29')]['limit']);_0x34c200[_0x8a9f('0x1c')]=qs[_0x8a9f('0x1c')](_0xc8328b['query'][_0x8a9f('0x1c')]);}return _0x484644[_0x8a9f('0x4c')](_0x34c200);}})['then'](function(_0x38d18f){if(_0x38d18f){return _0x38d18f?{'count':_0x4e8ae9,'rows':_0x38d18f}:null;}})[_0x8a9f('0x20')](respondWithResult(_0x13ec63,null))[_0x8a9f('0x3b')](handleError(_0x13ec63,null));};exports['setTags']=function(_0x1c7d3c,_0x1a3b93,_0x148b4e){if(_0x1c7d3c['body']['id']){delete _0x1c7d3c[_0x8a9f('0x42')]['id'];}return db[_0x8a9f('0x36')][_0x8a9f('0x45')]({'where':{'id':_0x1c7d3c[_0x8a9f('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a3b93,null))[_0x8a9f('0x20')](function(_0x1f054f){if(_0x1f054f){return _0x1f054f[_0x8a9f('0x4d')](_0x1c7d3c[_0x8a9f('0x42')][_0x8a9f('0x4e')]||[]);}return null;})[_0x8a9f('0x20')](respondWithResult(_0x1a3b93,null))[_0x8a9f('0x3b')](handleError(_0x1a3b93,null));}; \ No newline at end of file +var _0x9c5a=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','findOne','getFields','FreshdeskField','pick','getSubjects','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x9c5a,0x107));var _0xa9c5=function(_0x300a43,_0x25cb22){_0x300a43=_0x300a43-0x0;var _0x53cde6=_0x9c5a[_0x300a43];return _0x53cde6;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var Mustache=require(_0xa9c5('0x5'));var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require(_0xa9c5('0x8'));var csv=require(_0xa9c5('0x9'));var ejs=require(_0xa9c5('0xa'));var fs=require('fs');var fs_extra=require(_0xa9c5('0xb'));var _=require('lodash');var squel=require(_0xa9c5('0xc'));var crypto=require(_0xa9c5('0xd'));var jsforce=require(_0xa9c5('0xe'));var deskjs=require(_0xa9c5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa9c5('0x10'));var Redis=require('ioredis');var authService=require(_0xa9c5('0x11'));var qs=require(_0xa9c5('0x12'));var as=require(_0xa9c5('0x13'));var hardwareService=require(_0xa9c5('0x14'));var logger=require(_0xa9c5('0x15'))(_0xa9c5('0x16'));var utils=require(_0xa9c5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa9c5('0x18'));var db=require(_0xa9c5('0x19'))['db'];function respondWithStatusCode(_0x456117,_0x4cc89c){_0x4cc89c=_0x4cc89c||0xcc;return function(_0x5f9ec9){if(_0x5f9ec9){return _0x456117[_0xa9c5('0x1a')](_0x4cc89c);}return _0x456117[_0xa9c5('0x1b')](_0x4cc89c)[_0xa9c5('0x1c')]();};}function respondWithResult(_0x4a0597,_0x1ff52a){_0x1ff52a=_0x1ff52a||0xc8;return function(_0xaaff7e){if(_0xaaff7e){return _0x4a0597[_0xa9c5('0x1b')](_0x1ff52a)[_0xa9c5('0x1d')](_0xaaff7e);}};}function respondWithFilteredResult(_0x3a1bda,_0x1ff121){return function(_0x27e1b7){if(_0x27e1b7){var _0xa1d3ca=typeof _0x1ff121[_0xa9c5('0x1e')]==='undefined'&&typeof _0x1ff121[_0xa9c5('0x1f')]===_0xa9c5('0x20');var _0x103bac=_0x27e1b7[_0xa9c5('0x21')];var _0x1e4fc4=_0xa1d3ca?0x0:_0x1ff121['offset'];var _0x2703ae=_0xa1d3ca?_0x27e1b7[_0xa9c5('0x21')]:_0x1ff121[_0xa9c5('0x1e')]+_0x1ff121[_0xa9c5('0x1f')];var _0x32f575;if(_0x2703ae>=_0x103bac){_0x2703ae=_0x103bac;_0x32f575=0xc8;}else{_0x32f575=0xce;}_0x3a1bda[_0xa9c5('0x1b')](_0x32f575);return _0x3a1bda[_0xa9c5('0x22')](_0xa9c5('0x23'),_0x1e4fc4+'-'+_0x2703ae+'/'+_0x103bac)['json'](_0x27e1b7);}return null;};}function patchUpdates(_0x5bfd83){return function(_0x2fb78d){try{jsonpatch['apply'](_0x2fb78d,_0x5bfd83,!![]);}catch(_0x50d974){return BPromise[_0xa9c5('0x24')](_0x50d974);}return _0x2fb78d[_0xa9c5('0x25')]();};}function saveUpdates(_0x17551f,_0x4b1086){return function(_0x249e93){if(_0x249e93){return _0x249e93[_0xa9c5('0x26')](_0x17551f)[_0xa9c5('0x27')](function(_0x17b055){return _0x17b055;});}return null;};}function removeEntity(_0x2af95f,_0x4a210e){return function(_0x50967b){if(_0x50967b){return _0x50967b[_0xa9c5('0x28')]()[_0xa9c5('0x27')](function(){_0x2af95f[_0xa9c5('0x1b')](0xcc)[_0xa9c5('0x1c')]();});}};}function handleEntityNotFound(_0x177657,_0x3a4bfd){return function(_0xd78f92){if(!_0xd78f92){_0x177657['sendStatus'](0x194);}return _0xd78f92;};}function handleError(_0xa9da41,_0x599468){_0x599468=_0x599468||0x1f4;return function(_0x2d1cde){logger['error'](_0x2d1cde[_0xa9c5('0x29')]);if(_0x2d1cde[_0xa9c5('0x2a')]){delete _0x2d1cde['name'];}_0xa9da41[_0xa9c5('0x1b')](_0x599468)[_0xa9c5('0x2b')](_0x2d1cde);};}exports[_0xa9c5('0x2c')]=function(_0x102eb1,_0x55655a){var _0x3e4d27={},_0x121648={},_0x21abd9={'count':0x0,'rows':[]};var _0xf70a3a=_[_0xa9c5('0x2d')](db[_0xa9c5('0x2e')]['rawAttributes'],function(_0x36c1a9){return{'name':_0x36c1a9[_0xa9c5('0x2f')],'type':_0x36c1a9[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x121648[_0xa9c5('0x32')]=_['map'](_0xf70a3a,'name');_0x121648[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x102eb1[_0xa9c5('0x33')]);_0x121648['filters']=_[_0xa9c5('0x35')](_0x121648[_0xa9c5('0x32')],_0x121648[_0xa9c5('0x33')]);_0x3e4d27[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x121648[_0xa9c5('0x32')],qs['fields'](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x3e4d27[_0xa9c5('0x36')]=_0x3e4d27[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x3e4d27['attributes']:_0x121648[_0xa9c5('0x32')];if(!_0x102eb1[_0xa9c5('0x33')]['hasOwnProperty']('nolimit')){_0x3e4d27['limit']=qs[_0xa9c5('0x1f')](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x3e4d27[_0xa9c5('0x1e')]=qs['offset'](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}_0x3e4d27[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x3e4d27[_0xa9c5('0x3b')]=qs[_0xa9c5('0x3c')](_['pick'](_0x102eb1['query'],_0x121648[_0xa9c5('0x3c')]),_0xf70a3a);if(_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3d')]){_0x3e4d27[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x3e4d27[_0xa9c5('0x3b')],{'$or':_[_0xa9c5('0x2d')](_0xf70a3a,function(_0x291996){if(_0x291996[_0xa9c5('0x30')]!==_0xa9c5('0x3f')){var _0x2ae796={};_0x2ae796[_0x291996['name']]={'$like':'%'+_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x2ae796;}})});}_0x3e4d27=_[_0xa9c5('0x3e')]({},_0x3e4d27,_0x102eb1[_0xa9c5('0x40')]);var _0x3d5506={'where':_0x3e4d27[_0xa9c5('0x3b')]};return db['FreshdeskConfiguration'][_0xa9c5('0x21')](_0x3d5506)[_0xa9c5('0x27')](function(_0x129b70){_0x21abd9[_0xa9c5('0x21')]=_0x129b70;if(_0x102eb1['query'][_0xa9c5('0x41')]){_0x3e4d27[_0xa9c5('0x42')]=[{'all':!![]}];}return db[_0xa9c5('0x2e')][_0xa9c5('0x43')](_0x3e4d27);})[_0xa9c5('0x27')](function(_0x17afc3){_0x21abd9[_0xa9c5('0x44')]=_0x17afc3;return _0x21abd9;})['then'](respondWithFilteredResult(_0x55655a,_0x3e4d27))[_0xa9c5('0x45')](handleError(_0x55655a,null));};exports[_0xa9c5('0x46')]=function(_0x121f24,_0x50fed1){var _0x28209c={'raw':![],'where':{'id':_0x121f24['params']['id']}},_0x23fde8={};_0x23fde8[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2e')][_0xa9c5('0x47')]);_0x23fde8[_0xa9c5('0x33')]=_['keys'](_0x121f24[_0xa9c5('0x33')]);_0x23fde8[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x23fde8[_0xa9c5('0x32')],_0x23fde8[_0xa9c5('0x33')]);_0x28209c[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x23fde8['model'],qs['fields'](_0x121f24[_0xa9c5('0x33')]['fields']));_0x28209c[_0xa9c5('0x36')]=_0x28209c['attributes'][_0xa9c5('0x38')]?_0x28209c[_0xa9c5('0x36')]:_0x23fde8[_0xa9c5('0x32')];if(_0x121f24['query'][_0xa9c5('0x41')]){_0x28209c[_0xa9c5('0x42')]=[{'all':!![]}];}_0x28209c=_[_0xa9c5('0x3e')]({},_0x28209c,_0x121f24[_0xa9c5('0x40')]);return db['FreshdeskConfiguration'][_0xa9c5('0x48')](_0x28209c)['then'](handleEntityNotFound(_0x50fed1,null))[_0xa9c5('0x27')](respondWithResult(_0x50fed1,null))[_0xa9c5('0x45')](handleError(_0x50fed1,null));};exports[_0xa9c5('0x49')]=function(_0x20ce9f,_0x58eb5c){return db[_0xa9c5('0x2e')]['create'](_0x20ce9f[_0xa9c5('0x4a')],{})[_0xa9c5('0x27')](respondWithResult(_0x58eb5c,0xc9))[_0xa9c5('0x45')](handleError(_0x58eb5c,null));};exports['update']=function(_0x2c8d4a,_0x27d0a7){if(_0x2c8d4a[_0xa9c5('0x4a')]['id']){delete _0x2c8d4a['body']['id'];}return db[_0xa9c5('0x2e')][_0xa9c5('0x48')]({'where':{'id':_0x2c8d4a[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x27d0a7,null))['then'](saveUpdates(_0x2c8d4a[_0xa9c5('0x4a')],null))[_0xa9c5('0x27')](respondWithResult(_0x27d0a7,null))[_0xa9c5('0x45')](handleError(_0x27d0a7,null));};exports[_0xa9c5('0x28')]=function(_0x18982e,_0x46b5ca){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x18982e[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x46b5ca,null))[_0xa9c5('0x27')](removeEntity(_0x46b5ca,null))[_0xa9c5('0x45')](handleError(_0x46b5ca,null));};exports['getFields']=function(_0x34bf85,_0x2b8d49,_0x5b2f60){var _0x422acf={};var _0x4b9853={};var _0xf504b0;var _0x54ffc2;return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x34bf85[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x2b8d49,null))[_0xa9c5('0x27')](function(_0x69f5ca){if(_0x69f5ca){_0xf504b0=_0x69f5ca;_0x4b9853[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db['FreshdeskField']['rawAttributes']);_0x4b9853[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x34bf85[_0xa9c5('0x33')]);_0x4b9853[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x4b9853[_0xa9c5('0x32')],_0x4b9853['query']);_0x422acf['attributes']=_[_0xa9c5('0x35')](_0x4b9853[_0xa9c5('0x32')],qs['fields'](_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x422acf[_0xa9c5('0x36')]=_0x422acf[_0xa9c5('0x36')]['length']?_0x422acf[_0xa9c5('0x36')]:_0x4b9853[_0xa9c5('0x32')];_0x422acf['order']=qs[_0xa9c5('0x3a')](_0x34bf85[_0xa9c5('0x33')]['sort']);_0x422acf['where']=qs[_0xa9c5('0x3c')](_['pick'](_0x34bf85[_0xa9c5('0x33')],_0x4b9853[_0xa9c5('0x3c')]));if(_0x34bf85[_0xa9c5('0x33')]['filter']){_0x422acf[_0xa9c5('0x3b')]=_['merge'](_0x422acf['where'],{'$or':_[_0xa9c5('0x2d')](_0x422acf['attributes'],function(_0x53ee22){var _0x3cb7e9={};_0x3cb7e9[_0x53ee22]={'$like':'%'+_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x3cb7e9;})});}_0x422acf=_[_0xa9c5('0x3e')]({},_0x422acf,_0x34bf85[_0xa9c5('0x40')]);return _0xf504b0[_0xa9c5('0x4d')](_0x422acf);}})[_0xa9c5('0x27')](function(_0x52f01b){if(_0x52f01b){_0x54ffc2=_0x52f01b['length'];if(!_0x34bf85[_0xa9c5('0x33')]['hasOwnProperty']('nolimit')){_0x422acf[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x422acf[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x34bf85[_0xa9c5('0x33')]['offset']);}return _0xf504b0[_0xa9c5('0x4d')](_0x422acf);}})['then'](function(_0x5d9d99){if(_0x5d9d99){return _0x5d9d99?{'count':_0x54ffc2,'rows':_0x5d9d99}:null;}})['then'](respondWithResult(_0x2b8d49,null))[_0xa9c5('0x45')](handleError(_0x2b8d49,null));};exports['getSubjects']=function(_0x426059,_0x538e3b,_0x4d743c){var _0x491dea={};var _0x293938={};var _0x75aded;var _0x4fe9df;return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x426059[_0xa9c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x538e3b,null))[_0xa9c5('0x27')](function(_0x48c278){if(_0x48c278){_0x75aded=_0x48c278;_0x293938[_0xa9c5('0x32')]=_['keys'](db[_0xa9c5('0x4e')][_0xa9c5('0x47')]);_0x293938[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x426059[_0xa9c5('0x33')]);_0x293938['filters']=_[_0xa9c5('0x35')](_0x293938[_0xa9c5('0x32')],_0x293938[_0xa9c5('0x33')]);_0x491dea[_0xa9c5('0x36')]=_['intersection'](_0x293938[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x426059['query']['fields']));_0x491dea[_0xa9c5('0x36')]=_0x491dea[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x491dea['attributes']:_0x293938['model'];_0x491dea['order']=qs['sort'](_0x426059[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x491dea['where']=qs[_0xa9c5('0x3c')](_[_0xa9c5('0x4f')](_0x426059[_0xa9c5('0x33')],_0x293938[_0xa9c5('0x3c')]));if(_0x426059['query'][_0xa9c5('0x3d')]){_0x491dea[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x491dea['where'],{'$or':_[_0xa9c5('0x2d')](_0x491dea[_0xa9c5('0x36')],function(_0xf094ff){var _0x185087={};_0x185087[_0xf094ff]={'$like':'%'+_0x426059[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x185087;})});}_0x491dea=_[_0xa9c5('0x3e')]({},_0x491dea,_0x426059[_0xa9c5('0x40')]);return _0x75aded[_0xa9c5('0x50')](_0x491dea);}})[_0xa9c5('0x27')](function(_0x4a8623){if(_0x4a8623){_0x4fe9df=_0x4a8623['length'];if(!_0x426059[_0xa9c5('0x33')][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x491dea[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x426059[_0xa9c5('0x33')]['limit']);_0x491dea[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x426059[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}return _0x75aded[_0xa9c5('0x50')](_0x491dea);}})[_0xa9c5('0x27')](function(_0x268e8d){if(_0x268e8d){return _0x268e8d?{'count':_0x4fe9df,'rows':_0x268e8d}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x538e3b,null))[_0xa9c5('0x45')](handleError(_0x538e3b,null));};exports[_0xa9c5('0x53')]=function(_0x5364c7,_0x13989d,_0x5f2a95){var _0x5bba81={};var _0x195844={};var _0x2c5392;var _0x121ae1;return db[_0xa9c5('0x2e')][_0xa9c5('0x4c')]({'where':{'id':_0x5364c7[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x13989d,null))[_0xa9c5('0x27')](function(_0x394e45){if(_0x394e45){_0x2c5392=_0x394e45;_0x195844[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x4e')][_0xa9c5('0x47')]);_0x195844[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x5364c7['query']);_0x195844[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x195844[_0xa9c5('0x32')],_0x195844[_0xa9c5('0x33')]);_0x5bba81['attributes']=_['intersection'](_0x195844[_0xa9c5('0x32')],qs['fields'](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x5bba81['attributes']=_0x5bba81[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x5bba81[_0xa9c5('0x36')]:_0x195844[_0xa9c5('0x32')];_0x5bba81[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x5bba81['where']=qs[_0xa9c5('0x3c')](_[_0xa9c5('0x4f')](_0x5364c7[_0xa9c5('0x33')],_0x195844['filters']));if(_0x5364c7['query'][_0xa9c5('0x3d')]){_0x5bba81[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x5bba81['where'],{'$or':_[_0xa9c5('0x2d')](_0x5bba81[_0xa9c5('0x36')],function(_0x42734e){var _0x1a621d={};_0x1a621d[_0x42734e]={'$like':'%'+_0x5364c7['query'][_0xa9c5('0x3d')]+'%'};return _0x1a621d;})});}_0x5bba81=_[_0xa9c5('0x3e')]({},_0x5bba81,_0x5364c7[_0xa9c5('0x40')]);return _0x2c5392[_0xa9c5('0x53')](_0x5bba81);}})['then'](function(_0x30985e){if(_0x30985e){_0x121ae1=_0x30985e[_0xa9c5('0x38')];if(!_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x5bba81[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x5364c7['query']['limit']);_0x5bba81[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}return _0x2c5392[_0xa9c5('0x53')](_0x5bba81);}})[_0xa9c5('0x27')](function(_0x3a0b97){if(_0x3a0b97){return _0x3a0b97?{'count':_0x121ae1,'rows':_0x3a0b97}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x13989d,null))[_0xa9c5('0x45')](handleError(_0x13989d,null));};exports[_0xa9c5('0x54')]=function(_0x5b4d43,_0x1dd709,_0x1ec6d7){var _0x4d90af={};var _0x2176a5={};var _0x3fb699;var _0x1a3cf4;return db[_0xa9c5('0x2e')][_0xa9c5('0x4c')]({'where':{'id':_0x5b4d43['params']['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x1dd709,null))['then'](function(_0x1cb688){if(_0x1cb688){_0x3fb699=_0x1cb688;_0x2176a5[_0xa9c5('0x32')]=_['keys'](db[_0xa9c5('0x55')]['rawAttributes']);_0x2176a5[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x5b4d43[_0xa9c5('0x33')]);_0x2176a5[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x2176a5['model'],_0x2176a5[_0xa9c5('0x33')]);_0x4d90af[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x2176a5[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x5b4d43['query'][_0xa9c5('0x37')]));_0x4d90af[_0xa9c5('0x36')]=_0x4d90af[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x4d90af['attributes']:_0x2176a5[_0xa9c5('0x32')];_0x4d90af[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x4d90af[_0xa9c5('0x3b')]=qs['filters'](_[_0xa9c5('0x4f')](_0x5b4d43[_0xa9c5('0x33')],_0x2176a5['filters']));if(_0x5b4d43[_0xa9c5('0x33')]['filter']){_0x4d90af[_0xa9c5('0x3b')]=_['merge'](_0x4d90af[_0xa9c5('0x3b')],{'$or':_[_0xa9c5('0x2d')](_0x4d90af[_0xa9c5('0x36')],function(_0x2b6630){var _0x6834b2={};_0x6834b2[_0x2b6630]={'$like':'%'+_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x6834b2;})});}_0x4d90af=_[_0xa9c5('0x3e')]({},_0x4d90af,_0x5b4d43['options']);return _0x3fb699[_0xa9c5('0x54')](_0x4d90af);}})['then'](function(_0x74257b){if(_0x74257b){_0x1a3cf4=_0x74257b[_0xa9c5('0x38')];if(!_0x5b4d43['query'][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x4d90af[_0xa9c5('0x1f')]=qs['limit'](_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x4d90af[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x5b4d43['query']['offset']);}return _0x3fb699[_0xa9c5('0x54')](_0x4d90af);}})[_0xa9c5('0x27')](function(_0xa7ed5d){if(_0xa7ed5d){return _0xa7ed5d?{'count':_0x1a3cf4,'rows':_0xa7ed5d}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x1dd709,null))[_0xa9c5('0x45')](handleError(_0x1dd709,null));};exports[_0xa9c5('0x56')]=function(_0x4f2e26,_0x2b462a,_0x2e9859){if(_0x4f2e26[_0xa9c5('0x4a')]['id']){delete _0x4f2e26[_0xa9c5('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x4f2e26[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x2b462a,null))[_0xa9c5('0x27')](function(_0x2d67ad){if(_0x2d67ad){return _0x2d67ad[_0xa9c5('0x56')](_0x4f2e26[_0xa9c5('0x4a')][_0xa9c5('0x57')]||[]);}return null;})[_0xa9c5('0x27')](respondWithResult(_0x2b462a,null))[_0xa9c5('0x45')](handleError(_0x2b462a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b953e64..032cea3 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 _0xcbba=['int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xcbba,0x69));var _0xacbb=function(_0x5c16af,_0x159b7b){_0x5c16af=_0x5c16af-0x0;var _0x2485f8=_0xcbba[_0x5c16af];return _0x2485f8;};'use strict';var _=require('lodash');var util=require(_0xacbb('0x0'));var logger=require(_0xacbb('0x1'))(_0xacbb('0x2'));var moment=require(_0xacbb('0x3'));var BPromise=require(_0xacbb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xacbb('0x5'));var rimraf=require(_0xacbb('0x6'));var config=require(_0xacbb('0x7'));var attributes=require(_0xacbb('0x8'));module[_0xacbb('0x9')]=function(_0x3b534d,_0xc873d8){return _0x3b534d[_0xacbb('0xa')](_0xacbb('0xb'),attributes,{'tableName':_0xacbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa502=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x30aafb,_0x15166d){var _0x25f84f=function(_0x3d5019){while(--_0x3d5019){_0x30aafb['push'](_0x30aafb['shift']());}};_0x25f84f(++_0x15166d);}(_0xa502,0x1d7));var _0x2a50=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa502[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2a50('0x0'));var logger=require(_0x2a50('0x1'))(_0x2a50('0x2'));var moment=require('moment');var BPromise=require(_0x2a50('0x3'));var rp=require(_0x2a50('0x4'));var fs=require('fs');var path=require(_0x2a50('0x5'));var rimraf=require(_0x2a50('0x6'));var config=require(_0x2a50('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x2a50('0x8')]=function(_0x3fb719,_0x38bf98){return _0x3fb719[_0x2a50('0x9')](_0x2a50('0xa'),attributes,{'tableName':_0x2a50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index cc421f4..f575aa7 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 _0x1524=['rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe01d60,_0x340301){var _0x46d858=function(_0x25e8ba){while(--_0x25e8ba){_0xe01d60['push'](_0xe01d60['shift']());}};_0x46d858(++_0x340301);}(_0x1524,0x82));var _0x4152=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x1524[_0x58fbb0];return _0x1783d2;};'use strict';var _=require('lodash');var util=require(_0x4152('0x0'));var moment=require(_0x4152('0x1'));var BPromise=require(_0x4152('0x2'));var rs=require(_0x4152('0x3'));var fs=require('fs');var Redis=require(_0x4152('0x4'));var db=require(_0x4152('0x5'))['db'];var utils=require(_0x4152('0x6'));var logger=require(_0x4152('0x7'))(_0x4152('0x8'));var config=require(_0x4152('0x9'));var jayson=require(_0x4152('0xa'));var client=jayson['client'][_0x4152('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27720e,_0x5de97f,_0x23fd72){return new BPromise(function(_0x4996e1,_0xe03cff){return client[_0x4152('0xc')](_0x27720e,_0x23fd72)[_0x4152('0xd')](function(_0x565b17){logger[_0x4152('0xe')](_0x4152('0xf'),_0x5de97f,_0x4152('0x10'));logger[_0x4152('0x11')](_0x4152('0x12'),_0x5de97f,_0x4152('0x10'),JSON[_0x4152('0x13')](_0x565b17));if(_0x565b17[_0x4152('0x14')]){if(_0x565b17[_0x4152('0x14')]['code']===0x1f4){logger[_0x4152('0x14')](_0x4152('0xf'),_0x5de97f,_0x565b17[_0x4152('0x14')][_0x4152('0x15')]);return _0xe03cff(_0x565b17[_0x4152('0x14')][_0x4152('0x15')]);}logger[_0x4152('0x14')](_0x4152('0xf'),_0x5de97f,_0x565b17[_0x4152('0x14')][_0x4152('0x15')]);return _0x4996e1(_0x565b17[_0x4152('0x14')][_0x4152('0x15')]);}else{logger[_0x4152('0xe')](_0x4152('0xf'),_0x5de97f,_0x4152('0x10'));_0x4996e1(_0x565b17[_0x4152('0x16')][_0x4152('0x15')]);}})['catch'](function(_0x27b940){logger['error'](_0x4152('0xf'),_0x5de97f,_0x27b940);_0xe03cff(_0x27b940);});});} \ No newline at end of file +var _0xe9cb=['info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','request','then'];(function(_0xeb447a,_0x4b67f4){var _0x5db1d8=function(_0x5a5652){while(--_0x5a5652){_0xeb447a['push'](_0xeb447a['shift']());}};_0x5db1d8(++_0x4b67f4);}(_0xe9cb,0xc7));var _0xbe9c=function(_0x3e216a,_0x1f81ea){_0x3e216a=_0x3e216a-0x0;var _0x29bffc=_0xe9cb[_0x3e216a];return _0x29bffc;};'use strict';var _=require(_0xbe9c('0x0'));var util=require(_0xbe9c('0x1'));var moment=require(_0xbe9c('0x2'));var BPromise=require(_0xbe9c('0x3'));var rs=require(_0xbe9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe9c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe9c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19e2d6,_0x54a458,_0x2dbcaa){return new BPromise(function(_0xcf6a2a,_0x562802){return client[_0xbe9c('0x8')](_0x19e2d6,_0x2dbcaa)[_0xbe9c('0x9')](function(_0x3618ec){logger[_0xbe9c('0xa')](_0xbe9c('0xb'),_0x54a458,'request\x20sent');logger['debug'](_0xbe9c('0xc'),_0x54a458,_0xbe9c('0xd'),JSON[_0xbe9c('0xe')](_0x3618ec));if(_0x3618ec['error']){if(_0x3618ec['error']['code']===0x1f4){logger[_0xbe9c('0xf')](_0xbe9c('0xb'),_0x54a458,_0x3618ec[_0xbe9c('0xf')]['message']);return _0x562802(_0x3618ec[_0xbe9c('0xf')][_0xbe9c('0x10')]);}logger['error'](_0xbe9c('0xb'),_0x54a458,_0x3618ec['error'][_0xbe9c('0x10')]);return _0xcf6a2a(_0x3618ec[_0xbe9c('0xf')][_0xbe9c('0x10')]);}else{logger[_0xbe9c('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x54a458,_0xbe9c('0xd'));_0xcf6a2a(_0x3618ec[_0xbe9c('0x11')][_0xbe9c('0x10')]);}})[_0xbe9c('0x12')](function(_0x304d6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x54a458,_0x304d6e);_0x562802(_0x304d6e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index a2f1e98..ecf0205 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 _0x418f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x4decaf,_0x131c14){var _0x31d48a=function(_0x57efd1){while(--_0x57efd1){_0x4decaf['push'](_0x4decaf['shift']());}};_0x31d48a(++_0x131c14);}(_0x418f,0xa0));var _0xf418=function(_0x3098a7,_0x490909){_0x3098a7=_0x3098a7-0x0;var _0x530a7b=_0x418f[_0x3098a7];return _0x530a7b;};'use strict';var multer=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var path=require(_0xf418('0x2'));var timeout=require(_0xf418('0x3'));var express=require(_0xf418('0x4'));var router=express[_0xf418('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf418('0x6'));var interaction=require(_0xf418('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xf418('0x8')](),controller[_0xf418('0x9')]);router['get'](_0xf418('0xa'),auth['isAuthenticated'](),controller[_0xf418('0xb')]);router[_0xf418('0xc')]('/',auth[_0xf418('0x8')](),controller[_0xf418('0xd')]);router[_0xf418('0xe')](_0xf418('0xa'),auth[_0xf418('0x8')](),controller[_0xf418('0xf')]);router[_0xf418('0x10')](_0xf418('0xa'),auth[_0xf418('0x8')](),controller['destroy']);module[_0xf418('0x11')]=router; \ No newline at end of file +var _0xce24=['Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','path','express'];(function(_0x5c52da,_0x182ff8){var _0x4d5ba4=function(_0x5c4556){while(--_0x5c4556){_0x5c52da['push'](_0x5c52da['shift']());}};_0x4d5ba4(++_0x182ff8);}(_0xce24,0x1be));var _0x4ce2=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xce24[_0x56482c];return _0x5aae7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ce2('0x0'));var timeout=require('connect-timeout');var express=require(_0x4ce2('0x1'));var router=express[_0x4ce2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4ce2('0x3'));var interaction=require(_0x4ce2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ce2('0x5'));router[_0x4ce2('0x6')]('/',auth[_0x4ce2('0x7')](),controller[_0x4ce2('0x8')]);router['get'](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller['show']);router['post']('/',auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xa')]);router[_0x4ce2('0xb')](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xc')]);router['delete'](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 1ff067f..c99d4dc 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 _0xb54a=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x259705,_0x44f44b){var _0xb3794e=function(_0x2280ec){while(--_0x2280ec){_0x259705['push'](_0x259705['shift']());}};_0xb3794e(++_0x44f44b);}(_0xb54a,0x18e));var _0xab54=function(_0x589f7b,_0x1243ec){_0x589f7b=_0x589f7b-0x0;var _0x180591=_0xb54a[_0x589f7b];return _0x180591;};'use strict';var Sequelize=require(_0xab54('0x0'));module[_0xab54('0x1')]={'type':{'type':Sequelize[_0xab54('0x2')](_0xab54('0x3'),_0xab54('0x4'),_0xab54('0x5'),_0xab54('0x6'),_0xab54('0x7')),'defaultValue':_0xab54('0x3')},'content':{'type':Sequelize[_0xab54('0x8')]},'key':{'type':Sequelize[_0xab54('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xab54('0x3'),_0xab54('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xab54('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xab54('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb3fc=['customVariable','keyValue','picklist','STRING','ENUM','variable','sequelize','exports','string'];(function(_0x2a66b5,_0x1c5502){var _0x18b701=function(_0x5de565){while(--_0x5de565){_0x2a66b5['push'](_0x2a66b5['shift']());}};_0x18b701(++_0x1c5502);}(_0xb3fc,0x192));var _0xcb3f=function(_0x16535d,_0xe13222){_0x16535d=_0x16535d-0x0;var _0x4a0239=_0xb3fc[_0x16535d];return _0x4a0239;};'use strict';var Sequelize=require(_0xcb3f('0x0'));module[_0xcb3f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcb3f('0x2'),'variable',_0xcb3f('0x3'),_0xcb3f('0x4'),_0xcb3f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcb3f('0x6')]},'key':{'type':Sequelize[_0xcb3f('0x6')]},'keyType':{'type':Sequelize[_0xcb3f('0x7')](_0xcb3f('0x2'),_0xcb3f('0x8'),_0xcb3f('0x3'))},'keyContent':{'type':Sequelize[_0xcb3f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6ddc262..4f4b4ae 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 _0x5b02=['length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','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','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','name','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x121cf3,_0x9ca44f){var _0x299238=function(_0xbeb589){while(--_0xbeb589){_0x121cf3['push'](_0x121cf3['shift']());}};_0x299238(++_0x9ca44f);}(_0x5b02,0xe9));var _0x25b0=function(_0x2a88c4,_0x2fa4be){_0x2a88c4=_0x2a88c4-0x0;var _0x5e2e37=_0x5b02[_0x2a88c4];return _0x5e2e37;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){_0x2d7c17['status'](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x433085,_0x99bd3a){return function(_0x24f847){if(!_0x24f847){_0x433085[_0x25b0('0x19')](0x194);}return _0x24f847;};}function handleError(_0x23b396,_0x40268a){_0x40268a=_0x40268a||0x1f4;return function(_0x75ce7a){logger[_0x25b0('0x28')](_0x75ce7a['stack']);if(_0x75ce7a[_0x25b0('0x29')]){delete _0x75ce7a[_0x25b0('0x29')];}_0x23b396['status'](_0x40268a)['send'](_0x75ce7a);};}exports['index']=function(_0x1a6212,_0x3f0a54){var _0x251fad={},_0x105129={},_0x214377={'count':0x0,'rows':[]};var _0x3285ae=_[_0x25b0('0x2a')](db[_0x25b0('0x2b')][_0x25b0('0x2c')],function(_0x285a2b){return{'name':_0x285a2b[_0x25b0('0x2d')],'type':_0x285a2b[_0x25b0('0x2e')][_0x25b0('0x2f')]};});_0x105129['model']=_['map'](_0x3285ae,_0x25b0('0x29'));_0x105129['query']=_['keys'](_0x1a6212[_0x25b0('0x30')]);_0x105129[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],_0x105129[_0x25b0('0x30')]);_0x251fad['attributes']=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],qs['fields'](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x34')]));_0x251fad['attributes']=_0x251fad[_0x25b0('0x35')]['length']?_0x251fad[_0x25b0('0x35')]:_0x105129[_0x25b0('0x33')];if(!_0x1a6212[_0x25b0('0x30')][_0x25b0('0x36')](_0x25b0('0x37'))){_0x251fad[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1e')]);_0x251fad['offset']=qs[_0x25b0('0x1f')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1f')]);}_0x251fad[_0x25b0('0x38')]=qs[_0x25b0('0x39')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x39')]);_0x251fad[_0x25b0('0x3a')]=qs[_0x25b0('0x31')](_[_0x25b0('0x3b')](_0x1a6212['query'],_0x105129[_0x25b0('0x31')]),_0x3285ae);if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x3c')]){_0x251fad['where']=_[_0x25b0('0x3d')](_0x251fad[_0x25b0('0x3a')],{'$or':_[_0x25b0('0x2a')](_0x3285ae,function(_0x43e140){if(_0x43e140[_0x25b0('0x2e')]!==_0x25b0('0x3e')){var _0x28f1cd={};_0x28f1cd[_0x43e140[_0x25b0('0x29')]]={'$like':'%'+_0x1a6212['query']['filter']+'%'};return _0x28f1cd;}})});}_0x251fad=_[_0x25b0('0x3d')]({},_0x251fad,_0x1a6212[_0x25b0('0x3f')]);var _0x3f4ae0={'where':_0x251fad['where']};return db[_0x25b0('0x2b')]['count'](_0x3f4ae0)[_0x25b0('0x27')](function(_0x39617a){_0x214377[_0x25b0('0x20')]=_0x39617a;if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x40')]){_0x251fad['include']=[{'all':!![]}];}return db[_0x25b0('0x2b')][_0x25b0('0x41')](_0x251fad);})[_0x25b0('0x27')](function(_0x376d8a){_0x214377[_0x25b0('0x42')]=_0x376d8a;return _0x214377;})['then'](respondWithFilteredResult(_0x3f0a54,_0x251fad))[_0x25b0('0x43')](handleError(_0x3f0a54,null));};exports[_0x25b0('0x44')]=function(_0x3d1262,_0x44c400){var _0x35fc00={'raw':!![],'where':{'id':_0x3d1262[_0x25b0('0x45')]['id']}},_0x1adf8d={};_0x1adf8d[_0x25b0('0x33')]=_[_0x25b0('0x46')](db[_0x25b0('0x2b')][_0x25b0('0x2c')]);_0x1adf8d['query']=_[_0x25b0('0x46')](_0x3d1262['query']);_0x1adf8d[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],_0x1adf8d[_0x25b0('0x30')]);_0x35fc00['attributes']=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],qs[_0x25b0('0x34')](_0x3d1262['query'][_0x25b0('0x34')]));_0x35fc00[_0x25b0('0x35')]=_0x35fc00[_0x25b0('0x35')][_0x25b0('0x47')]?_0x35fc00[_0x25b0('0x35')]:_0x1adf8d[_0x25b0('0x33')];if(_0x3d1262[_0x25b0('0x30')]['includeAll']){_0x35fc00[_0x25b0('0x48')]=[{'all':!![]}];}_0x35fc00=_[_0x25b0('0x3d')]({},_0x35fc00,_0x3d1262[_0x25b0('0x3f')]);return db['FreshdeskField'][_0x25b0('0x49')](_0x35fc00)[_0x25b0('0x27')](handleEntityNotFound(_0x44c400,null))[_0x25b0('0x27')](respondWithResult(_0x44c400,null))[_0x25b0('0x43')](handleError(_0x44c400,null));};exports[_0x25b0('0x4a')]=function(_0x568d83,_0x1e8a8d){return db[_0x25b0('0x2b')][_0x25b0('0x4a')](_0x568d83['body'],{})[_0x25b0('0x27')](respondWithResult(_0x1e8a8d,0xc9))[_0x25b0('0x43')](handleError(_0x1e8a8d,null));};exports[_0x25b0('0x26')]=function(_0x1d6d55,_0x29165e){if(_0x1d6d55[_0x25b0('0x4b')]['id']){delete _0x1d6d55['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x1d6d55[_0x25b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29165e,null))['then'](saveUpdates(_0x1d6d55[_0x25b0('0x4b')],null))['then'](respondWithResult(_0x29165e,null))[_0x25b0('0x43')](handleError(_0x29165e,null));};exports['destroy']=function(_0x4fc22d,_0x394e52){return db[_0x25b0('0x2b')][_0x25b0('0x49')]({'where':{'id':_0x4fc22d[_0x25b0('0x45')]['id']}})[_0x25b0('0x27')](handleEntityNotFound(_0x394e52,null))[_0x25b0('0x27')](removeEntity(_0x394e52,null))[_0x25b0('0x43')](handleError(_0x394e52,null));}; \ No newline at end of file +var _0x9348=['undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskField','count','include','findAll','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../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','limit'];(function(_0x3c48df,_0x56a07a){var _0x2fff07=function(_0x5b46f9){while(--_0x5b46f9){_0x3c48df['push'](_0x3c48df['shift']());}};_0x2fff07(++_0x56a07a);}(_0x9348,0x10d));var _0x8934=function(_0x2e55eb,_0x3c90b1){_0x2e55eb=_0x2e55eb-0x0;var _0x4d033d=_0x9348[_0x2e55eb];return _0x4d033d;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['FreshdeskField'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['FreshdeskField'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 123d8b0..67e8b0f 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 _0xf2f2=['./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x27befc,_0x3696c0){var _0x324d75=function(_0x2bc18b){while(--_0x2bc18b){_0x27befc['push'](_0x27befc['shift']());}};_0x324d75(++_0x3696c0);}(_0xf2f2,0x101));var _0x2f2f=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0xf2f2[_0x2ff4bd];return _0x28edc6;};'use strict';var _=require(_0x2f2f('0x0'));var util=require('util');var logger=require(_0x2f2f('0x1'))(_0x2f2f('0x2'));var moment=require(_0x2f2f('0x3'));var BPromise=require(_0x2f2f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f2f('0x5'));var rimraf=require('rimraf');var config=require(_0x2f2f('0x6'));var attributes=require(_0x2f2f('0x7'));module[_0x2f2f('0x8')]=function(_0x3ac9fc,_0x108b26){return _0x3ac9fc[_0x2f2f('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x2f2f('0xa'),'fields':[_0x2f2f('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54e5=['FieldId','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54e5,0x145));var _0x554e=function(_0x4ae32d,_0x256489){_0x4ae32d=_0x4ae32d-0x0;var _0x550537=_0x54e5[_0x4ae32d];return _0x550537;};'use strict';var _=require(_0x554e('0x0'));var util=require(_0x554e('0x1'));var logger=require(_0x554e('0x2'))('api');var moment=require(_0x554e('0x3'));var BPromise=require(_0x554e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x554e('0x5'));var rimraf=require('rimraf');var config=require(_0x554e('0x6'));var attributes=require(_0x554e('0x7'));module['exports']=function(_0x4fe7f0,_0x346efd){return _0x4fe7f0[_0x554e('0x8')](_0x554e('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x554e('0xa'),_0x554e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 8b63eb4..1cb06bd 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 _0x48f4=['FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x3aa032,_0x566691){var _0x5120f9=function(_0x20e472){while(--_0x20e472){_0x3aa032['push'](_0x3aa032['shift']());}};_0x5120f9(++_0x566691);}(_0x48f4,0x1aa));var _0x448f=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x48f4[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0x448f('0x0'));var util=require(_0x448f('0x1'));var moment=require(_0x448f('0x2'));var BPromise=require(_0x448f('0x3'));var rs=require(_0x448f('0x4'));var fs=require('fs');var Redis=require(_0x448f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x448f('0x6'));var logger=require(_0x448f('0x7'))('rpc');var config=require(_0x448f('0x8'));var jayson=require(_0x448f('0x9'));var client=jayson[_0x448f('0xa')][_0x448f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbd4651,_0x42fc27,_0x254dd4){return new BPromise(function(_0x5becc5,_0x270390){return client[_0x448f('0xc')](_0xbd4651,_0x254dd4)['then'](function(_0x46e6e4){logger[_0x448f('0xd')](_0x448f('0xe'),_0x42fc27,_0x448f('0xf'));logger[_0x448f('0x10')](_0x448f('0x11'),_0x42fc27,_0x448f('0xf'),JSON['stringify'](_0x46e6e4));if(_0x46e6e4[_0x448f('0x12')]){if(_0x46e6e4[_0x448f('0x12')]['code']===0x1f4){logger[_0x448f('0x12')](_0x448f('0xe'),_0x42fc27,_0x46e6e4['error'][_0x448f('0x13')]);return _0x270390(_0x46e6e4['error'][_0x448f('0x13')]);}logger[_0x448f('0x12')](_0x448f('0xe'),_0x42fc27,_0x46e6e4[_0x448f('0x12')][_0x448f('0x13')]);return _0x5becc5(_0x46e6e4[_0x448f('0x12')][_0x448f('0x13')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x42fc27,_0x448f('0xf'));_0x5becc5(_0x46e6e4[_0x448f('0x14')][_0x448f('0x13')]);}})[_0x448f('0x15')](function(_0x556e81){logger['error'](_0x448f('0xe'),_0x42fc27,_0x556e81);_0x270390(_0x556e81);});});} \ No newline at end of file +var _0x4f5a=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x4f5a,0x1d9));var _0xa4f5=function(_0x38dc47,_0x60eb3e){_0x38dc47=_0x38dc47-0x0;var _0xa3a3ff=_0x4f5a[_0x38dc47];return _0xa3a3ff;};'use strict';var _=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var moment=require(_0xa4f5('0x2'));var BPromise=require(_0xa4f5('0x3'));var rs=require(_0xa4f5('0x4'));var fs=require('fs');var Redis=require(_0xa4f5('0x5'));var db=require(_0xa4f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f5('0x7'))(_0xa4f5('0x8'));var config=require(_0xa4f5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c266,_0x44418e,_0x41a775){return new BPromise(function(_0x1ae133,_0x158e09){return client[_0xa4f5('0xb')](_0x47c266,_0x41a775)[_0xa4f5('0xc')](function(_0x52c3c0){logger['info'](_0xa4f5('0xd'),_0x44418e,_0xa4f5('0xe'));logger[_0xa4f5('0xf')](_0xa4f5('0x10'),_0x44418e,_0xa4f5('0xe'),JSON['stringify'](_0x52c3c0));if(_0x52c3c0[_0xa4f5('0x11')]){if(_0x52c3c0[_0xa4f5('0x11')][_0xa4f5('0x12')]===0x1f4){logger['error'](_0xa4f5('0xd'),_0x44418e,_0x52c3c0['error'][_0xa4f5('0x13')]);return _0x158e09(_0x52c3c0[_0xa4f5('0x11')]['message']);}logger[_0xa4f5('0x11')](_0xa4f5('0xd'),_0x44418e,_0x52c3c0[_0xa4f5('0x11')][_0xa4f5('0x13')]);return _0x1ae133(_0x52c3c0[_0xa4f5('0x11')]['message']);}else{logger[_0xa4f5('0x14')](_0xa4f5('0xd'),_0x44418e,_0xa4f5('0xe'));_0x1ae133(_0x52c3c0[_0xa4f5('0x15')][_0xa4f5('0x13')]);}})[_0xa4f5('0x16')](function(_0x20605b){logger[_0xa4f5('0x11')](_0xa4f5('0xd'),_0x44418e,_0x20605b);_0x158e09(_0x20605b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ad95260..d55344f 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 _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','create','post','addConfiguration','put','destroy','path','connect-timeout','express','fs-extra'];(function(_0x33cf3b,_0x5686ae){var _0x54dd43=function(_0x11f39b){while(--_0x11f39b){_0x33cf3b['push'](_0x33cf3b['shift']());}};_0x54dd43(++_0x5686ae);}(_0x4522,0x1a0));var _0x2452=function(_0x20369d,_0x4cf364){_0x20369d=_0x20369d-0x0;var _0x45bc03=_0x4522[_0x20369d];return _0x45bc03;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/fields',auth[_0x2452('0x9')](),controller['getFields']);router['post']('/',auth[_0x2452('0x9')](),controller[_0x2452('0xf')]);router[_0x2452('0x10')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x11')]);router[_0x2452('0x12')](_0x2452('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2452('0xb'),auth['isAuthenticated'](),controller[_0x2452('0x13')]);module['exports']=router; \ No newline at end of file +var _0xd404=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show'];(function(_0x467b6b,_0x2dd887){var _0x3ae317=function(_0x250c33){while(--_0x250c33){_0x467b6b['push'](_0x467b6b['shift']());}};_0x3ae317(++_0x2dd887);}(_0xd404,0x15b));var _0x4d40=function(_0x15027e,_0x44d145){_0x15027e=_0x15027e-0x0;var _0x2d6d11=_0xd404[_0x15027e];return _0x2d6d11;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x10')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller['update']);router[_0x4d40('0x15')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);module[_0x4d40('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 37ff9f5..2c75d5f 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 _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x28cefd,_0x500f11){var _0x1033a4=function(_0x10a04b){while(--_0x10a04b){_0x28cefd['push'](_0x28cefd['shift']());}};_0x1033a4(++_0x500f11);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1f9e81,_0x4adb1d){_0x1f9e81=_0x1f9e81-0x0;var _0x34464e=_0x02ce[_0x1f9e81];return _0x34464e;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7880=['exports','STRING','username','remoteUri'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x7880,0x1f4));var _0x0788=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x7880[_0x2e986d];return _0x351c79;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 6fd1735..c9fe0b2 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 _0x9db5=['test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9db5,0x68));var _0x59db=function(_0x1b3853,_0x41779d){_0x1b3853=_0x1b3853-0x0;var _0x15eb72=_0x9db5[_0x1b3853];return _0x15eb72;};'use strict';var emlformat=require(_0x59db('0x0'));var rimraf=require(_0x59db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x59db('0x2'));var rp=require(_0x59db('0x3'));var moment=require(_0x59db('0x4'));var BPromise=require(_0x59db('0x5'));var Mustache=require(_0x59db('0x6'));var util=require(_0x59db('0x7'));var path=require(_0x59db('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59db('0x9'));var _=require(_0x59db('0xa'));var squel=require(_0x59db('0xb'));var crypto=require(_0x59db('0xc'));var jsforce=require(_0x59db('0xd'));var deskjs=require(_0x59db('0xe'));var toCsv=require(_0x59db('0xf'));var querystring=require(_0x59db('0x10'));var Papa=require(_0x59db('0x11'));var Redis=require(_0x59db('0x12'));var authService=require(_0x59db('0x13'));var qs=require(_0x59db('0x14'));var as=require(_0x59db('0x15'));var hardwareService=require(_0x59db('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x59db('0x17'));var config=require(_0x59db('0x18'));var licenseUtil=require(_0x59db('0x19'));var db=require(_0x59db('0x1a'))['db'];var integrations=require(_0x59db('0x1b'));function respondWithStatusCode(_0x4f14f6,_0x3d49d4){_0x3d49d4=_0x3d49d4||0xcc;return function(_0x56ada8){if(_0x56ada8){return _0x4f14f6[_0x59db('0x1c')](_0x3d49d4);}return _0x4f14f6[_0x59db('0x1d')](_0x3d49d4)[_0x59db('0x1e')]();};}function respondWithResult(_0x4919f9,_0x3635bb){_0x3635bb=_0x3635bb||0xc8;return function(_0x13aa44){if(_0x13aa44){return _0x4919f9['status'](_0x3635bb)[_0x59db('0x1f')](_0x13aa44);}};}function respondWithFilteredResult(_0x22a0ff,_0x175e0d){return function(_0x52901a){if(_0x52901a){var _0x4143b7=typeof _0x175e0d[_0x59db('0x20')]===_0x59db('0x21')&&typeof _0x175e0d['limit']===_0x59db('0x21');var _0x446e70=_0x52901a[_0x59db('0x22')];var _0x25b3de=_0x4143b7?0x0:_0x175e0d['offset'];var _0x374546=_0x4143b7?_0x52901a[_0x59db('0x22')]:_0x175e0d[_0x59db('0x20')]+_0x175e0d['limit'];var _0x329671;if(_0x374546>=_0x446e70){_0x374546=_0x446e70;_0x329671=0xc8;}else{_0x329671=0xce;}_0x22a0ff[_0x59db('0x1d')](_0x329671);return _0x22a0ff[_0x59db('0x23')]('Content-Range',_0x25b3de+'-'+_0x374546+'/'+_0x446e70)['json'](_0x52901a);}return null;};}function patchUpdates(_0x5e910e){return function(_0x181254){try{jsonpatch[_0x59db('0x24')](_0x181254,_0x5e910e,!![]);}catch(_0x1f0fff){return BPromise[_0x59db('0x25')](_0x1f0fff);}return _0x181254[_0x59db('0x26')]();};}function saveUpdates(_0x4c210f,_0x2f0af4){return function(_0x23c688){if(_0x23c688){return _0x23c688[_0x59db('0x27')](_0x4c210f)['then'](function(_0x4672a3){return _0x4672a3;});}return null;};}function removeEntity(_0x40c3c7,_0x11313a){return function(_0x3ca678){if(_0x3ca678){return _0x3ca678[_0x59db('0x28')]()[_0x59db('0x29')](function(){_0x40c3c7[_0x59db('0x1d')](0xcc)[_0x59db('0x1e')]();});}};}function handleEntityNotFound(_0x323cd1,_0x1b274d){return function(_0x1e23d8){if(!_0x1e23d8){_0x323cd1[_0x59db('0x1c')](0x194);}return _0x1e23d8;};}function handleError(_0x197ee8,_0x50aee1){_0x50aee1=_0x50aee1||0x1f4;return function(_0x435234){logger[_0x59db('0x2a')](_0x435234['stack']);if(_0x435234[_0x59db('0x2b')]){delete _0x435234[_0x59db('0x2b')];}_0x197ee8[_0x59db('0x1d')](_0x50aee1)[_0x59db('0x2c')](_0x435234);};}exports[_0x59db('0x2d')]=function(_0x47b2d4,_0x3baeee){var _0x59e7f9={},_0xca6824={},_0x39d5b5={'count':0x0,'rows':[]};var _0x4d3e91=_[_0x59db('0x2e')](db[_0x59db('0x2f')][_0x59db('0x30')],function(_0x57d06b){return{'name':_0x57d06b['fieldName'],'type':_0x57d06b['type'][_0x59db('0x31')]};});_0xca6824[_0x59db('0x32')]=_[_0x59db('0x2e')](_0x4d3e91,_0x59db('0x2b'));_0xca6824[_0x59db('0x33')]=_[_0x59db('0x34')](_0x47b2d4[_0x59db('0x33')]);_0xca6824[_0x59db('0x35')]=_[_0x59db('0x36')](_0xca6824[_0x59db('0x32')],_0xca6824[_0x59db('0x33')]);_0x59e7f9[_0x59db('0x37')]=_['intersection'](_0xca6824[_0x59db('0x32')],qs[_0x59db('0x38')](_0x47b2d4[_0x59db('0x33')][_0x59db('0x38')]));_0x59e7f9[_0x59db('0x37')]=_0x59e7f9[_0x59db('0x37')][_0x59db('0x39')]?_0x59e7f9[_0x59db('0x37')]:_0xca6824[_0x59db('0x32')];if(!_0x47b2d4[_0x59db('0x33')][_0x59db('0x3a')](_0x59db('0x3b'))){_0x59e7f9[_0x59db('0x3c')]=qs['limit'](_0x47b2d4['query'][_0x59db('0x3c')]);_0x59e7f9[_0x59db('0x20')]=qs[_0x59db('0x20')](_0x47b2d4[_0x59db('0x33')]['offset']);}_0x59e7f9['order']=qs['sort'](_0x47b2d4[_0x59db('0x33')]['sort']);_0x59e7f9[_0x59db('0x3d')]=qs[_0x59db('0x35')](_[_0x59db('0x3e')](_0x47b2d4[_0x59db('0x33')],_0xca6824['filters']),_0x4d3e91);if(_0x47b2d4[_0x59db('0x33')][_0x59db('0x3f')]){_0x59e7f9[_0x59db('0x3d')]=_[_0x59db('0x40')](_0x59e7f9[_0x59db('0x3d')],{'$or':_[_0x59db('0x2e')](_0x4d3e91,function(_0x5286f6){if(_0x5286f6[_0x59db('0x41')]!==_0x59db('0x42')){var _0x5e1afb={};_0x5e1afb[_0x5286f6[_0x59db('0x2b')]]={'$like':'%'+_0x47b2d4['query'][_0x59db('0x3f')]+'%'};return _0x5e1afb;}})});}_0x59e7f9=_['merge']({},_0x59e7f9,_0x47b2d4[_0x59db('0x43')]);var _0xe1ea35={'where':_0x59e7f9[_0x59db('0x3d')]};return db[_0x59db('0x2f')][_0x59db('0x22')](_0xe1ea35)[_0x59db('0x29')](function(_0x339777){_0x39d5b5['count']=_0x339777;if(_0x47b2d4[_0x59db('0x33')][_0x59db('0x44')]){_0x59e7f9['include']=[{'all':!![]}];}return db[_0x59db('0x2f')][_0x59db('0x45')](_0x59e7f9);})[_0x59db('0x29')](function(_0x492679){_0x39d5b5[_0x59db('0x46')]=_0x492679;return _0x39d5b5;})[_0x59db('0x29')](respondWithFilteredResult(_0x3baeee,_0x59e7f9))['catch'](handleError(_0x3baeee,null));};exports['show']=function(_0x44f636,_0x3134e7){var _0x1fbbaf={'raw':![],'where':{'id':_0x44f636[_0x59db('0x47')]['id']}},_0x994c6f={};_0x994c6f['model']=_[_0x59db('0x34')](db[_0x59db('0x2f')][_0x59db('0x30')]);_0x994c6f[_0x59db('0x33')]=_['keys'](_0x44f636[_0x59db('0x33')]);_0x994c6f[_0x59db('0x35')]=_[_0x59db('0x36')](_0x994c6f[_0x59db('0x32')],_0x994c6f[_0x59db('0x33')]);_0x1fbbaf[_0x59db('0x37')]=_[_0x59db('0x36')](_0x994c6f['model'],qs[_0x59db('0x38')](_0x44f636['query'][_0x59db('0x38')]));_0x1fbbaf[_0x59db('0x37')]=_0x1fbbaf['attributes'][_0x59db('0x39')]?_0x1fbbaf['attributes']:_0x994c6f[_0x59db('0x32')];if(_0x44f636['query'][_0x59db('0x44')]){_0x1fbbaf[_0x59db('0x48')]=[{'all':!![]}];}_0x1fbbaf=_[_0x59db('0x40')]({},_0x1fbbaf,_0x44f636['options']);return db[_0x59db('0x2f')][_0x59db('0x49')](_0x1fbbaf)['then'](handleEntityNotFound(_0x3134e7,null))[_0x59db('0x29')](respondWithResult(_0x3134e7,null))[_0x59db('0x4a')](handleError(_0x3134e7,null));};exports['create']=function(_0xdc3dc3,_0xcd8193){return db['FreshsalesAccount'][_0x59db('0x4b')](_0xdc3dc3[_0x59db('0x4c')],{})[_0x59db('0x29')](respondWithResult(_0xcd8193,0xc9))['catch'](handleError(_0xcd8193,null));};exports['update']=function(_0xa05062,_0x6913c2){if(_0xa05062['body']['id']){delete _0xa05062[_0x59db('0x4c')]['id'];}return db[_0x59db('0x2f')][_0x59db('0x49')]({'where':{'id':_0xa05062[_0x59db('0x47')]['id']}})[_0x59db('0x29')](handleEntityNotFound(_0x6913c2,null))['then'](saveUpdates(_0xa05062[_0x59db('0x4c')],null))[_0x59db('0x29')](respondWithResult(_0x6913c2,null))['catch'](handleError(_0x6913c2,null));};exports['destroy']=function(_0x41bfac,_0x407c61){return db['FreshsalesAccount'][_0x59db('0x49')]({'where':{'id':_0x41bfac['params']['id']}})[_0x59db('0x29')](handleEntityNotFound(_0x407c61,null))[_0x59db('0x29')](removeEntity(_0x407c61,null))[_0x59db('0x4a')](handleError(_0x407c61,null));};exports[_0x59db('0x4d')]=function(_0x3000d2,_0x306ff0,_0x3b15f1){var _0x165cad={};var _0x57c118={};var _0x99958f;var _0x3dc128;return db[_0x59db('0x2f')][_0x59db('0x4e')]({'where':{'id':_0x3000d2['params']['id']}})[_0x59db('0x29')](handleEntityNotFound(_0x306ff0,null))[_0x59db('0x29')](function(_0x447103){if(_0x447103){_0x99958f=_0x447103;_0x57c118[_0x59db('0x32')]=_[_0x59db('0x34')](db[_0x59db('0x4f')][_0x59db('0x30')]);_0x57c118[_0x59db('0x33')]=_[_0x59db('0x34')](_0x3000d2[_0x59db('0x33')]);_0x57c118[_0x59db('0x35')]=_[_0x59db('0x36')](_0x57c118[_0x59db('0x32')],_0x57c118[_0x59db('0x33')]);_0x165cad[_0x59db('0x37')]=_[_0x59db('0x36')](_0x57c118[_0x59db('0x32')],qs[_0x59db('0x38')](_0x3000d2[_0x59db('0x33')][_0x59db('0x38')]));_0x165cad[_0x59db('0x37')]=_0x165cad[_0x59db('0x37')]['length']?_0x165cad[_0x59db('0x37')]:_0x57c118[_0x59db('0x32')];_0x165cad[_0x59db('0x50')]=qs['sort'](_0x3000d2['query']['sort']);_0x165cad[_0x59db('0x3d')]=qs['filters'](_['pick'](_0x3000d2[_0x59db('0x33')],_0x57c118[_0x59db('0x35')]));if(_0x3000d2[_0x59db('0x33')][_0x59db('0x3f')]){_0x165cad[_0x59db('0x3d')]=_[_0x59db('0x40')](_0x165cad[_0x59db('0x3d')],{'$or':_['map'](_0x165cad['attributes'],function(_0x3abebc){var _0x374bc5={};_0x374bc5[_0x3abebc]={'$like':'%'+_0x3000d2[_0x59db('0x33')][_0x59db('0x3f')]+'%'};return _0x374bc5;})});}_0x165cad=_['merge']({},_0x165cad,_0x3000d2[_0x59db('0x43')]);return _0x99958f[_0x59db('0x4d')](_0x165cad);}})[_0x59db('0x29')](function(_0x4703b8){if(_0x4703b8){_0x3dc128=_0x4703b8[_0x59db('0x39')];if(!_0x3000d2[_0x59db('0x33')][_0x59db('0x3a')](_0x59db('0x3b'))){_0x165cad['limit']=qs['limit'](_0x3000d2['query'][_0x59db('0x3c')]);_0x165cad[_0x59db('0x20')]=qs[_0x59db('0x20')](_0x3000d2['query'][_0x59db('0x20')]);}return _0x99958f[_0x59db('0x4d')](_0x165cad);}})[_0x59db('0x29')](function(_0xd895b9){if(_0xd895b9){return _0xd895b9?{'count':_0x3dc128,'rows':_0xd895b9}:null;}})['then'](respondWithResult(_0x306ff0,null))['catch'](handleError(_0x306ff0,null));};exports['addConfiguration']=function(_0x4bf067,_0xead813,_0x2e5482){if(_0x4bf067[_0x59db('0x4c')]['id']){delete _0x4bf067[_0x59db('0x4c')]['id'];}return db[_0x59db('0x2f')][_0x59db('0x4e')]({'where':{'id':_0x4bf067[_0x59db('0x47')]['id']}})[_0x59db('0x29')](handleEntityNotFound(_0xead813,null))[_0x59db('0x29')](function(_0x1e2a86){if(_0x1e2a86){_0x4bf067[_0x59db('0x4c')]['AccountId']=_0x1e2a86['id'];_0x4bf067[_0x59db('0x4c')][_0x59db('0x51')]=integrations[_0x59db('0x52')](_0x4bf067[_0x59db('0x4c')][_0x59db('0x53')],_0x4bf067['body']['type']);_0x4bf067[_0x59db('0x4c')][_0x59db('0x54')]=integrations['getDescriptions'](_0x4bf067[_0x59db('0x4c')][_0x59db('0x53')],_0x4bf067[_0x59db('0x4c')][_0x59db('0x41')]);return db[_0x59db('0x4f')][_0x59db('0x4b')](_0x4bf067['body'],{'include':[{'model':db[_0x59db('0x55')],'as':_0x59db('0x51')},{'model':db[_0x59db('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xead813,null))['catch'](handleError(_0xead813,null));};exports[_0x59db('0x56')]=function(_0x1b7550,_0x3fbbf9,_0x417f57){var _0x5b43cb='';var _0x5efe24='';return db[_0x59db('0x2f')][_0x59db('0x4e')]({'where':{'id':_0x1b7550[_0x59db('0x47')]['id']},'attributes':['id',_0x59db('0x57'),'remoteUri',_0x59db('0x58')]})[_0x59db('0x29')](handleEntityNotFound(_0x3fbbf9,null))['then'](function(_0x51156f){if(_0x51156f){_0x5efe24=_0x51156f['username'];_0x5b43cb=_0x51156f[_0x59db('0x59')];var _0x3bf5d3=_0x51156f[_0x59db('0x59')]['slice'](-0x1);if(_0x3bf5d3==='/'){_0x5b43cb=_0x5b43cb['substring'](0x0,_0x5b43cb[_0x59db('0x5a')](_0x3bf5d3));}return rp({'method':_0x59db('0x5b'),'uri':util[_0x59db('0x5c')](_0x59db('0x5d'),_0x5b43cb,_0x59db('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x51156f[_0x59db('0x58')]},'json':!![]});}})[_0x59db('0x29')](function(_0x27b9cc){if(_0x27b9cc){var _0xc4cb0b=_0x27b9cc[_0x59db('0x5f')];var _0x3f052b=![];var _0x2cf603=null;for(_0x2cf603=0x0;_0x2cf603<_0xc4cb0b[_0x59db('0x39')];_0x2cf603++){if(_0xc4cb0b[_0x2cf603][_0x59db('0x60')]===_0x5efe24){_0x3f052b=!![];}}if(_0x3f052b){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x59db('0x29')](respondWithResult(_0x3fbbf9,null))[_0x59db('0x4a')](function(_0x1d1655){var _0x2ff67b=_0x1b7550['query']['test']?0x1f4:_0x1d1655['statusCode']||0x1f4;logger[_0x59db('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x59db('0x56'),_0x2ff67b,JSON[_0x59db('0x61')](_0x1d1655));delete _0x1d1655[_0x59db('0x2b')];if(_0x2ff67b===0x191){_0x2ff67b=0x190;}_0x3fbbf9[_0x59db('0x1d')](_0x2ff67b)[_0x59db('0x2c')](_0x1b7550[_0x59db('0x33')][_0x59db('0x62')]?{'message':_0x59db('0x63'),'statusCode':_0x1d1655[_0x59db('0x64')]}:_0x1d1655);});}; \ No newline at end of file +var _0x9df5=['substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','keys','include','find','catch','create','body','params','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Descriptions','username','remoteUri','slice'];(function(_0x27e000,_0x50aaf0){var _0xaf3232=function(_0xe1f44e){while(--_0xe1f44e){_0x27e000['push'](_0x27e000['shift']());}};_0xaf3232(++_0x50aaf0);}(_0x9df5,0x14d));var _0x59df=function(_0x5dba5e,_0x5a3014){_0x5dba5e=_0x5dba5e-0x0;var _0x183039=_0x9df5[_0x5dba5e];return _0x183039;};'use strict';var emlformat=require(_0x59df('0x0'));var rimraf=require(_0x59df('0x1'));var zipdir=require(_0x59df('0x2'));var jsonpatch=require(_0x59df('0x3'));var rp=require(_0x59df('0x4'));var moment=require(_0x59df('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x59df('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x59df('0x7'));var ejs=require(_0x59df('0x8'));var fs=require('fs');var fs_extra=require(_0x59df('0x9'));var _=require(_0x59df('0xa'));var squel=require(_0x59df('0xb'));var crypto=require(_0x59df('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x59df('0xd'));var toCsv=require(_0x59df('0x7'));var querystring=require(_0x59df('0xe'));var Papa=require(_0x59df('0xf'));var Redis=require(_0x59df('0x10'));var authService=require(_0x59df('0x11'));var qs=require(_0x59df('0x12'));var as=require(_0x59df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59df('0x14'))(_0x59df('0x15'));var utils=require(_0x59df('0x16'));var config=require(_0x59df('0x17'));var licenseUtil=require(_0x59df('0x18'));var db=require(_0x59df('0x19'))['db'];var integrations=require(_0x59df('0x1a'));function respondWithStatusCode(_0x293a70,_0x28634e){_0x28634e=_0x28634e||0xcc;return function(_0x5d7fa0){if(_0x5d7fa0){return _0x293a70[_0x59df('0x1b')](_0x28634e);}return _0x293a70[_0x59df('0x1c')](_0x28634e)[_0x59df('0x1d')]();};}function respondWithResult(_0x14e615,_0x5ba911){_0x5ba911=_0x5ba911||0xc8;return function(_0x342373){if(_0x342373){return _0x14e615[_0x59df('0x1c')](_0x5ba911)[_0x59df('0x1e')](_0x342373);}};}function respondWithFilteredResult(_0x4866f2,_0x31c345){return function(_0x4608dc){if(_0x4608dc){var _0x3517c5=typeof _0x31c345[_0x59df('0x1f')]===_0x59df('0x20')&&typeof _0x31c345['limit']===_0x59df('0x20');var _0x491d5b=_0x4608dc[_0x59df('0x21')];var _0x3cfa30=_0x3517c5?0x0:_0x31c345[_0x59df('0x1f')];var _0x29f99c=_0x3517c5?_0x4608dc[_0x59df('0x21')]:_0x31c345['offset']+_0x31c345['limit'];var _0x1d6741;if(_0x29f99c>=_0x491d5b){_0x29f99c=_0x491d5b;_0x1d6741=0xc8;}else{_0x1d6741=0xce;}_0x4866f2['status'](_0x1d6741);return _0x4866f2[_0x59df('0x22')](_0x59df('0x23'),_0x3cfa30+'-'+_0x29f99c+'/'+_0x491d5b)[_0x59df('0x1e')](_0x4608dc);}return null;};}function patchUpdates(_0x1adfc2){return function(_0x5c3ede){try{jsonpatch[_0x59df('0x24')](_0x5c3ede,_0x1adfc2,!![]);}catch(_0x47e7d){return BPromise[_0x59df('0x25')](_0x47e7d);}return _0x5c3ede[_0x59df('0x26')]();};}function saveUpdates(_0x41bb26,_0x5a0d57){return function(_0x30a103){if(_0x30a103){return _0x30a103[_0x59df('0x27')](_0x41bb26)[_0x59df('0x28')](function(_0x2d099f){return _0x2d099f;});}return null;};}function removeEntity(_0x2a0baf,_0x40f713){return function(_0x4e1b05){if(_0x4e1b05){return _0x4e1b05[_0x59df('0x29')]()['then'](function(){_0x2a0baf[_0x59df('0x1c')](0xcc)[_0x59df('0x1d')]();});}};}function handleEntityNotFound(_0xeeaa7b,_0x22ec31){return function(_0x26cb70){if(!_0x26cb70){_0xeeaa7b[_0x59df('0x1b')](0x194);}return _0x26cb70;};}function handleError(_0x580acd,_0x40ca62){_0x40ca62=_0x40ca62||0x1f4;return function(_0x31e512){logger['error'](_0x31e512['stack']);if(_0x31e512[_0x59df('0x2a')]){delete _0x31e512[_0x59df('0x2a')];}_0x580acd[_0x59df('0x1c')](_0x40ca62)[_0x59df('0x2b')](_0x31e512);};}exports[_0x59df('0x2c')]=function(_0x4491a6,_0x41dcf7){var _0x28c1db={},_0x24a997={},_0x2b2944={'count':0x0,'rows':[]};var _0x58ba32=_['map'](db[_0x59df('0x2d')][_0x59df('0x2e')],function(_0x4b9fbc){return{'name':_0x4b9fbc[_0x59df('0x2f')],'type':_0x4b9fbc[_0x59df('0x30')][_0x59df('0x31')]};});_0x24a997[_0x59df('0x32')]=_[_0x59df('0x33')](_0x58ba32,_0x59df('0x2a'));_0x24a997[_0x59df('0x34')]=_['keys'](_0x4491a6[_0x59df('0x34')]);_0x24a997[_0x59df('0x35')]=_[_0x59df('0x36')](_0x24a997[_0x59df('0x32')],_0x24a997[_0x59df('0x34')]);_0x28c1db['attributes']=_['intersection'](_0x24a997[_0x59df('0x32')],qs[_0x59df('0x37')](_0x4491a6[_0x59df('0x34')][_0x59df('0x37')]));_0x28c1db['attributes']=_0x28c1db['attributes'][_0x59df('0x38')]?_0x28c1db[_0x59df('0x39')]:_0x24a997['model'];if(!_0x4491a6[_0x59df('0x34')][_0x59df('0x3a')](_0x59df('0x3b'))){_0x28c1db[_0x59df('0x3c')]=qs['limit'](_0x4491a6[_0x59df('0x34')][_0x59df('0x3c')]);_0x28c1db['offset']=qs[_0x59df('0x1f')](_0x4491a6[_0x59df('0x34')][_0x59df('0x1f')]);}_0x28c1db[_0x59df('0x3d')]=qs[_0x59df('0x3e')](_0x4491a6[_0x59df('0x34')][_0x59df('0x3e')]);_0x28c1db[_0x59df('0x3f')]=qs[_0x59df('0x35')](_[_0x59df('0x40')](_0x4491a6[_0x59df('0x34')],_0x24a997[_0x59df('0x35')]),_0x58ba32);if(_0x4491a6[_0x59df('0x34')]['filter']){_0x28c1db[_0x59df('0x3f')]=_[_0x59df('0x41')](_0x28c1db[_0x59df('0x3f')],{'$or':_['map'](_0x58ba32,function(_0x1fdf9e){if(_0x1fdf9e['type']!==_0x59df('0x42')){var _0x1990fd={};_0x1990fd[_0x1fdf9e['name']]={'$like':'%'+_0x4491a6[_0x59df('0x34')][_0x59df('0x43')]+'%'};return _0x1990fd;}})});}_0x28c1db=_[_0x59df('0x41')]({},_0x28c1db,_0x4491a6[_0x59df('0x44')]);var _0x446454={'where':_0x28c1db[_0x59df('0x3f')]};return db['FreshsalesAccount'][_0x59df('0x21')](_0x446454)['then'](function(_0x318d65){_0x2b2944[_0x59df('0x21')]=_0x318d65;if(_0x4491a6[_0x59df('0x34')][_0x59df('0x45')]){_0x28c1db['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x28c1db);})['then'](function(_0xdf413b){_0x2b2944[_0x59df('0x46')]=_0xdf413b;return _0x2b2944;})[_0x59df('0x28')](respondWithFilteredResult(_0x41dcf7,_0x28c1db))['catch'](handleError(_0x41dcf7,null));};exports['show']=function(_0x4ad481,_0x5d88ad){var _0x4df7d2={'raw':![],'where':{'id':_0x4ad481['params']['id']}},_0x588629={};_0x588629[_0x59df('0x32')]=_[_0x59df('0x47')](db[_0x59df('0x2d')][_0x59df('0x2e')]);_0x588629['query']=_['keys'](_0x4ad481['query']);_0x588629[_0x59df('0x35')]=_[_0x59df('0x36')](_0x588629['model'],_0x588629[_0x59df('0x34')]);_0x4df7d2['attributes']=_[_0x59df('0x36')](_0x588629[_0x59df('0x32')],qs[_0x59df('0x37')](_0x4ad481['query'][_0x59df('0x37')]));_0x4df7d2[_0x59df('0x39')]=_0x4df7d2[_0x59df('0x39')]['length']?_0x4df7d2['attributes']:_0x588629[_0x59df('0x32')];if(_0x4ad481[_0x59df('0x34')][_0x59df('0x45')]){_0x4df7d2[_0x59df('0x48')]=[{'all':!![]}];}_0x4df7d2=_[_0x59df('0x41')]({},_0x4df7d2,_0x4ad481[_0x59df('0x44')]);return db[_0x59df('0x2d')][_0x59df('0x49')](_0x4df7d2)['then'](handleEntityNotFound(_0x5d88ad,null))['then'](respondWithResult(_0x5d88ad,null))[_0x59df('0x4a')](handleError(_0x5d88ad,null));};exports[_0x59df('0x4b')]=function(_0x30b93a,_0xeb339f){return db[_0x59df('0x2d')][_0x59df('0x4b')](_0x30b93a[_0x59df('0x4c')],{})['then'](respondWithResult(_0xeb339f,0xc9))[_0x59df('0x4a')](handleError(_0xeb339f,null));};exports[_0x59df('0x27')]=function(_0x31733e,_0x3f5678){if(_0x31733e['body']['id']){delete _0x31733e[_0x59df('0x4c')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x31733e[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x3f5678,null))[_0x59df('0x28')](saveUpdates(_0x31733e[_0x59df('0x4c')],null))['then'](respondWithResult(_0x3f5678,null))[_0x59df('0x4a')](handleError(_0x3f5678,null));};exports[_0x59df('0x29')]=function(_0x5c32b7,_0x56e2a8){return db[_0x59df('0x2d')]['find']({'where':{'id':_0x5c32b7[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x56e2a8,null))['then'](removeEntity(_0x56e2a8,null))[_0x59df('0x4a')](handleError(_0x56e2a8,null));};exports['getConfigurations']=function(_0x3b9bdb,_0x54f7a2,_0x16bd2f){var _0x2c8d43={};var _0x4e09de={};var _0x1a6c7f;var _0x1a9d76;return db[_0x59df('0x2d')]['findOne']({'where':{'id':_0x3b9bdb[_0x59df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54f7a2,null))[_0x59df('0x28')](function(_0x217433){if(_0x217433){_0x1a6c7f=_0x217433;_0x4e09de['model']=_[_0x59df('0x47')](db['FreshsalesConfiguration'][_0x59df('0x2e')]);_0x4e09de[_0x59df('0x34')]=_['keys'](_0x3b9bdb['query']);_0x4e09de[_0x59df('0x35')]=_['intersection'](_0x4e09de[_0x59df('0x32')],_0x4e09de[_0x59df('0x34')]);_0x2c8d43[_0x59df('0x39')]=_[_0x59df('0x36')](_0x4e09de[_0x59df('0x32')],qs['fields'](_0x3b9bdb[_0x59df('0x34')][_0x59df('0x37')]));_0x2c8d43[_0x59df('0x39')]=_0x2c8d43['attributes'][_0x59df('0x38')]?_0x2c8d43[_0x59df('0x39')]:_0x4e09de[_0x59df('0x32')];_0x2c8d43[_0x59df('0x3d')]=qs[_0x59df('0x3e')](_0x3b9bdb[_0x59df('0x34')][_0x59df('0x3e')]);_0x2c8d43[_0x59df('0x3f')]=qs['filters'](_['pick'](_0x3b9bdb[_0x59df('0x34')],_0x4e09de[_0x59df('0x35')]));if(_0x3b9bdb['query']['filter']){_0x2c8d43[_0x59df('0x3f')]=_[_0x59df('0x41')](_0x2c8d43[_0x59df('0x3f')],{'$or':_[_0x59df('0x33')](_0x2c8d43[_0x59df('0x39')],function(_0x7ad3e6){var _0x25e46f={};_0x25e46f[_0x7ad3e6]={'$like':'%'+_0x3b9bdb['query'][_0x59df('0x43')]+'%'};return _0x25e46f;})});}_0x2c8d43=_['merge']({},_0x2c8d43,_0x3b9bdb[_0x59df('0x44')]);return _0x1a6c7f[_0x59df('0x4e')](_0x2c8d43);}})[_0x59df('0x28')](function(_0x1844d8){if(_0x1844d8){_0x1a9d76=_0x1844d8['length'];if(!_0x3b9bdb['query'][_0x59df('0x3a')](_0x59df('0x3b'))){_0x2c8d43[_0x59df('0x3c')]=qs[_0x59df('0x3c')](_0x3b9bdb[_0x59df('0x34')]['limit']);_0x2c8d43[_0x59df('0x1f')]=qs[_0x59df('0x1f')](_0x3b9bdb[_0x59df('0x34')]['offset']);}return _0x1a6c7f[_0x59df('0x4e')](_0x2c8d43);}})[_0x59df('0x28')](function(_0x44f6a7){if(_0x44f6a7){return _0x44f6a7?{'count':_0x1a9d76,'rows':_0x44f6a7}:null;}})[_0x59df('0x28')](respondWithResult(_0x54f7a2,null))[_0x59df('0x4a')](handleError(_0x54f7a2,null));};exports[_0x59df('0x4f')]=function(_0x2b7b8c,_0x3d3660,_0x3c5be9){if(_0x2b7b8c['body']['id']){delete _0x2b7b8c[_0x59df('0x4c')]['id'];}return db[_0x59df('0x2d')][_0x59df('0x50')]({'where':{'id':_0x2b7b8c[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x3d3660,null))[_0x59df('0x28')](function(_0x126446){if(_0x126446){_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x51')]=_0x126446['id'];_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x52')]=integrations['getSubjects'](_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x53')],_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x30')]);_0x2b7b8c['body']['Descriptions']=integrations[_0x59df('0x54')](_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x53')],_0x2b7b8c['body']['type']);return db[_0x59df('0x55')][_0x59df('0x4b')](_0x2b7b8c[_0x59df('0x4c')],{'include':[{'model':db[_0x59df('0x56')],'as':'Subjects'},{'model':db[_0x59df('0x56')],'as':_0x59df('0x57')}]});}return null;})[_0x59df('0x28')](respondWithResult(_0x3d3660,null))['catch'](handleError(_0x3d3660,null));};exports['getFields']=function(_0xa5c4e4,_0x17e8a2,_0x458936){var _0x58403a='';var _0x1dfd78='';return db[_0x59df('0x2d')]['findOne']({'where':{'id':_0xa5c4e4['params']['id']},'attributes':['id',_0x59df('0x58'),_0x59df('0x59'),'apiKey']})[_0x59df('0x28')](handleEntityNotFound(_0x17e8a2,null))[_0x59df('0x28')](function(_0x244e79){if(_0x244e79){_0x1dfd78=_0x244e79[_0x59df('0x58')];_0x58403a=_0x244e79[_0x59df('0x59')];var _0x30da13=_0x244e79[_0x59df('0x59')][_0x59df('0x5a')](-0x1);if(_0x30da13==='/'){_0x58403a=_0x58403a[_0x59df('0x5b')](0x0,_0x58403a['lastIndexOf'](_0x30da13));}return rp({'method':_0x59df('0x5c'),'uri':util[_0x59df('0x5d')](_0x59df('0x5e'),_0x58403a,_0x59df('0x5f')),'headers':{'Authorization':_0x59df('0x60')+_0x244e79[_0x59df('0x61')]},'json':!![]});}})[_0x59df('0x28')](function(_0x42f479){if(_0x42f479){var _0x207722=_0x42f479[_0x59df('0x62')];var _0x29b35e=![];var _0x10796=null;for(_0x10796=0x0;_0x10796<_0x207722[_0x59df('0x38')];_0x10796++){if(_0x207722[_0x10796]['email']===_0x1dfd78){_0x29b35e=!![];}}if(_0x29b35e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x59df('0x28')](respondWithResult(_0x17e8a2,null))['catch'](function(_0x60b9a9){var _0x5e983d=_0xa5c4e4[_0x59df('0x34')][_0x59df('0x63')]?0x1f4:_0x60b9a9['statusCode']||0x1f4;logger[_0x59df('0x64')](_0x59df('0x65'),_0x59df('0x66'),_0x5e983d,JSON[_0x59df('0x67')](_0x60b9a9));delete _0x60b9a9[_0x59df('0x2a')];if(_0x5e983d===0x191){_0x5e983d=0x190;}_0x17e8a2['status'](_0x5e983d)[_0x59df('0x2b')](_0xa5c4e4[_0x59df('0x34')][_0x59df('0x63')]?{'message':_0x59df('0x68'),'statusCode':_0x60b9a9[_0x59df('0x69')]}:_0x60b9a9);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index cb7030b..4329950 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0xa9eedc,_0x3498df){var _0x30c87f=function(_0x2cf4ce){while(--_0x2cf4ce){_0xa9eedc['push'](_0xa9eedc['shift']());}};_0x30c87f(++_0x3498df);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x4cc8a9,_0x294eaf){var _0x3213c4=function(_0x4c19d5){while(--_0x4c19d5){_0x4cc8a9['push'](_0x4cc8a9['shift']());}};_0x3213c4(++_0x294eaf);}(_0x524e,0x15e));var _0xe524=function(_0x1ad5ea,_0x108933){_0x1ad5ea=_0x1ad5ea-0x0;var _0x1fca0e=_0x524e[_0x1ad5ea];return _0x1fca0e;};'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'));var integrations=require(_0xe524('0x9'));module['exports']=function(_0xaaeaa9,_0x41e1a3){return _0xaaeaa9[_0xe524('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xe524('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 328dbf8..f3ae942 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 _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','raw','ShowFreshsalesAccount'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')]({'raw':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x531f75[_0x2227('0x1b')]?_0x531f75['options'][_0x2227('0x1c')]||null:null,'attributes':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'limit':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1e')]||null:null,'include':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1f')]?_[_0x2227('0x20')](_0x531f75['options'][_0x2227('0x1f')],function(_0x42d500){return{'model':db[_0x42d500['model']],'as':_0x42d500['as'],'attributes':_0x42d500[_0x2227('0x1d')],'include':_0x42d500[_0x2227('0x1f')]?_['map'](_0x42d500['include'],function(_0x17c7a4){return{'model':db[_0x17c7a4[_0x2227('0x21')]],'as':_0x17c7a4['as'],'attributes':_0x17c7a4[_0x2227('0x1d')],'include':_0x17c7a4[_0x2227('0x1f')]?_['map'](_0x17c7a4[_0x2227('0x1f')],function(_0x301304){return{'model':db[_0x301304[_0x2227('0x21')]],'as':_0x301304['as'],'attributes':_0x301304[_0x2227('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204def){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x204def));_0x620012(_0x204def);})['catch'](function(_0x5d1d56){logger[_0x2227('0x12')]('GetFreshsalesAccount',_0x5d1d56[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0x5d1d56['message']));});});};exports['ShowFreshsalesAccount']=function(_0x1f1ba7){var _0x1818ba=this;return new Promise(function(_0x21838a,_0x4cc1e1){return db[_0x2227('0x19')]['find']({'raw':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x22')]===undefined?!![]:![]:!![],'where':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1c')]||null:null,'attributes':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'include':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')]['include']?_[_0x2227('0x20')](_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1f')],function(_0x6cd5d7){return{'model':db[_0x6cd5d7['model']],'as':_0x6cd5d7['as'],'attributes':_0x6cd5d7[_0x2227('0x1d')],'include':_0x6cd5d7[_0x2227('0x1f')]?_[_0x2227('0x20')](_0x6cd5d7[_0x2227('0x1f')],function(_0x5186a6){return{'model':db[_0x5186a6[_0x2227('0x21')]],'as':_0x5186a6['as'],'attributes':_0x5186a6[_0x2227('0x1d')],'include':_0x5186a6[_0x2227('0x1f')]?_['map'](_0x5186a6['include'],function(_0x35d9f1){return{'model':db[_0x35d9f1[_0x2227('0x21')]],'as':_0x35d9f1['as'],'attributes':_0x35d9f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2227('0xc')](function(_0x9a8cc3){logger['info'](_0x2227('0x23'),_0x1f1ba7);logger['debug'](_0x2227('0x23'),_0x1f1ba7,JSON[_0x2227('0x11')](_0x9a8cc3));_0x21838a(_0x9a8cc3);})[_0x2227('0x17')](function(_0x36db00){logger['error'](_0x2227('0x23'),_0x36db00['message'],_0x1f1ba7);_0x4cc1e1(_0x1818ba[_0x2227('0x12')](0x1f4,_0x36db00[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0xacf4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshsalesAccount'];(function(_0x2fec5e,_0x3befde){var _0x2ae95d=function(_0x35ad9f){while(--_0x35ad9f){_0x2fec5e['push'](_0x2fec5e['shift']());}};_0x2ae95d(++_0x3befde);}(_0xacf4,0xe7));var _0x4acf=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xacf4[_0x56825b];return _0x69ce77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')]({'raw':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x18')]||null:null,'attributes':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x19')]||null:null,'limit':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1a')]||null:null,'include':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x240c00[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x53885f){return{'model':db[_0x53885f[_0x4acf('0x1d')]],'as':_0x53885f['as'],'attributes':_0x53885f[_0x4acf('0x19')],'include':_0x53885f['include']?_[_0x4acf('0x1c')](_0x53885f[_0x4acf('0x1b')],function(_0x52a84a){return{'model':db[_0x52a84a[_0x4acf('0x1d')]],'as':_0x52a84a['as'],'attributes':_0x52a84a[_0x4acf('0x19')],'include':_0x52a84a[_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x52a84a['include'],function(_0x50236d){return{'model':db[_0x50236d[_0x4acf('0x1d')]],'as':_0x50236d['as'],'attributes':_0x50236d[_0x4acf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0x42c90c){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1e')](_0x4acf('0x13'),_0x240c00,JSON[_0x4acf('0x1f')](_0x42c90c));_0x2a678b(_0x42c90c);})[_0x4acf('0x12')](function(_0x57989e){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57989e[_0x4acf('0x10')],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57989e[_0x4acf('0x10')]));});});};exports[_0x4acf('0x20')]=function(_0x27384c){var _0x5d862f=this;return new Promise(function(_0x337b3c,_0x1d221b){return db[_0x4acf('0x14')]['find']({'raw':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x27384c[_0x4acf('0x16')]?_0x27384c['options'][_0x4acf('0x18')]||null:null,'attributes':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')]['attributes']||null:null,'include':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x490880){return{'model':db[_0x490880[_0x4acf('0x1d')]],'as':_0x490880['as'],'attributes':_0x490880[_0x4acf('0x19')],'include':_0x490880['include']?_[_0x4acf('0x1c')](_0x490880['include'],function(_0x4cd020){return{'model':db[_0x4cd020['model']],'as':_0x4cd020['as'],'attributes':_0x4cd020['attributes'],'include':_0x4cd020['include']?_['map'](_0x4cd020['include'],function(_0x3364dd){return{'model':db[_0x3364dd[_0x4acf('0x1d')]],'as':_0x3364dd['as'],'attributes':_0x3364dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0xbd0f92){logger[_0x4acf('0xb')](_0x4acf('0x20'),_0x27384c);logger[_0x4acf('0x1e')](_0x4acf('0x20'),_0x27384c,JSON[_0x4acf('0x1f')](_0xbd0f92));_0x337b3c(_0xbd0f92);})[_0x4acf('0x12')](function(_0x24465b){logger[_0x4acf('0xf')]('ShowFreshsalesAccount',_0x24465b['message'],_0x27384c);_0x1d221b(_0x5d862f[_0x4acf('0xf')](0x1f4,_0x24465b[_0x4acf('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 716cba4..f5e8764 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 _0x3abe=['/:id','isAuthenticated','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','index'];(function(_0x4058b9,_0x51609a){var _0x5e22f7=function(_0x3fc515){while(--_0x3fc515){_0x4058b9['push'](_0x4058b9['shift']());}};_0x5e22f7(++_0x51609a);}(_0x3abe,0x1b7));var _0xe3ab=function(_0x4e8c91,_0xbc39ab){_0x4e8c91=_0x4e8c91-0x0;var _0x192df1=_0x3abe[_0x4e8c91];return _0x192df1;};'use strict';var multer=require(_0xe3ab('0x0'));var util=require(_0xe3ab('0x1'));var path=require(_0xe3ab('0x2'));var timeout=require(_0xe3ab('0x3'));var express=require(_0xe3ab('0x4'));var router=express[_0xe3ab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe3ab('0x6'));var interaction=require(_0xe3ab('0x7'));var config=require('../../config/environment');var controller=require(_0xe3ab('0x8'));router[_0xe3ab('0x9')]('/',auth['isAuthenticated'](),controller[_0xe3ab('0xa')]);router['get'](_0xe3ab('0xb'),auth[_0xe3ab('0xc')](),controller[_0xe3ab('0xd')]);router[_0xe3ab('0x9')](_0xe3ab('0xe'),auth[_0xe3ab('0xc')](),controller['getSubjects']);router['get'](_0xe3ab('0xf'),auth[_0xe3ab('0xc')](),controller[_0xe3ab('0x10')]);router[_0xe3ab('0x9')](_0xe3ab('0x11'),auth[_0xe3ab('0xc')](),controller[_0xe3ab('0x12')]);router[_0xe3ab('0x13')]('/',auth['isAuthenticated'](),controller[_0xe3ab('0x14')]);router[_0xe3ab('0x15')](_0xe3ab('0xb'),auth[_0xe3ab('0xc')](),controller[_0xe3ab('0x16')]);router['delete']('/:id',auth[_0xe3ab('0xc')](),controller[_0xe3ab('0x17')]);module[_0xe3ab('0x18')]=router; \ No newline at end of file +var _0x8a02=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x8a02,0xc9));var _0x28a0=function(_0x48299b,_0x25bd30){_0x48299b=_0x48299b-0x0;var _0x2f531e=_0x8a02[_0x48299b];return _0x2f531e;};'use strict';var multer=require(_0x28a0('0x0'));var util=require(_0x28a0('0x1'));var path=require(_0x28a0('0x2'));var timeout=require(_0x28a0('0x3'));var express=require(_0x28a0('0x4'));var router=express['Router']();var fs_extra=require(_0x28a0('0x5'));var auth=require(_0x28a0('0x6'));var interaction=require(_0x28a0('0x7'));var config=require(_0x28a0('0x8'));var controller=require(_0x28a0('0x9'));router[_0x28a0('0xa')]('/',auth[_0x28a0('0xb')](),controller[_0x28a0('0xc')]);router[_0x28a0('0xa')](_0x28a0('0xd'),auth[_0x28a0('0xb')](),controller[_0x28a0('0xe')]);router[_0x28a0('0xa')](_0x28a0('0xf'),auth[_0x28a0('0xb')](),controller[_0x28a0('0x10')]);router[_0x28a0('0xa')](_0x28a0('0x11'),auth[_0x28a0('0xb')](),controller[_0x28a0('0x12')]);router[_0x28a0('0xa')](_0x28a0('0x13'),auth['isAuthenticated'](),controller[_0x28a0('0x14')]);router[_0x28a0('0x15')]('/',auth[_0x28a0('0xb')](),controller[_0x28a0('0x16')]);router[_0x28a0('0x17')](_0x28a0('0xd'),auth[_0x28a0('0xb')](),controller['update']);router[_0x28a0('0x18')](_0x28a0('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x28a0('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 1eeb3e0..d402aa6 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 _0x803e=['sequelize','STRING'];(function(_0x556975,_0x1a8786){var _0x1ac05a=function(_0x4d7122){while(--_0x4d7122){_0x556975['push'](_0x556975['shift']());}};_0x1ac05a(++_0x1a8786);}(_0x803e,0x8e));var _0xe803=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x803e[_0x4631eb];return _0x562eca;};'use strict';var Sequelize=require(_0xe803('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe803('0x1')]}}; \ No newline at end of file +var _0x3cc9=['STRING','sequelize','exports'];(function(_0x4f3a6a,_0x3fc1c2){var _0x1d2458=function(_0x3db9ad){while(--_0x3db9ad){_0x4f3a6a['push'](_0x4f3a6a['shift']());}};_0x1d2458(++_0x3fc1c2);}(_0x3cc9,0x12d));var _0x93cc=function(_0x43d8b5,_0x3fad20){_0x43d8b5=_0x43d8b5-0x0;var _0x39cc30=_0x3cc9[_0x43d8b5];return _0x39cc30;};'use strict';var Sequelize=require(_0x93cc('0x0'));module[_0x93cc('0x1')]={'name':{'type':Sequelize[_0x93cc('0x2')]},'description':{'type':Sequelize[_0x93cc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9c5cecd..a7b97b9 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 _0x9f06=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','findOne','getSubjects','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x9f06,0x66));var _0x69f0=function(_0x5b0fff,_0x403828){_0x5b0fff=_0x5b0fff-0x0;var _0x3db7c6=_0x9f06[_0x5b0fff];return _0x3db7c6;};'use strict';var emlformat=require(_0x69f0('0x0'));var rimraf=require(_0x69f0('0x1'));var zipdir=require(_0x69f0('0x2'));var jsonpatch=require(_0x69f0('0x3'));var rp=require('request-promise');var moment=require(_0x69f0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x69f0('0x5'));var util=require(_0x69f0('0x6'));var path=require(_0x69f0('0x7'));var sox=require(_0x69f0('0x8'));var csv=require(_0x69f0('0x9'));var ejs=require(_0x69f0('0xa'));var fs=require('fs');var fs_extra=require(_0x69f0('0xb'));var _=require(_0x69f0('0xc'));var squel=require(_0x69f0('0xd'));var crypto=require('crypto');var jsforce=require(_0x69f0('0xe'));var deskjs=require(_0x69f0('0xf'));var toCsv=require(_0x69f0('0x9'));var querystring=require(_0x69f0('0x10'));var Papa=require(_0x69f0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69f0('0x12'));var as=require(_0x69f0('0x13'));var hardwareService=require(_0x69f0('0x14'));var logger=require(_0x69f0('0x15'))(_0x69f0('0x16'));var utils=require(_0x69f0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x69f0('0x18'));var db=require(_0x69f0('0x19'))['db'];function respondWithStatusCode(_0x5193df,_0x164718){_0x164718=_0x164718||0xcc;return function(_0x2034e2){if(_0x2034e2){return _0x5193df[_0x69f0('0x1a')](_0x164718);}return _0x5193df['status'](_0x164718)[_0x69f0('0x1b')]();};}function respondWithResult(_0x45b4d3,_0x49d293){_0x49d293=_0x49d293||0xc8;return function(_0x3ca732){if(_0x3ca732){return _0x45b4d3['status'](_0x49d293)[_0x69f0('0x1c')](_0x3ca732);}};}function respondWithFilteredResult(_0x554227,_0x28e810){return function(_0x55b51a){if(_0x55b51a){var _0x6f8cbf=typeof _0x28e810['offset']==='undefined'&&typeof _0x28e810[_0x69f0('0x1d')]==='undefined';var _0x3222ca=_0x55b51a[_0x69f0('0x1e')];var _0x10f98e=_0x6f8cbf?0x0:_0x28e810['offset'];var _0x12846c=_0x6f8cbf?_0x55b51a[_0x69f0('0x1e')]:_0x28e810['offset']+_0x28e810[_0x69f0('0x1d')];var _0x5a909c;if(_0x12846c>=_0x3222ca){_0x12846c=_0x3222ca;_0x5a909c=0xc8;}else{_0x5a909c=0xce;}_0x554227['status'](_0x5a909c);return _0x554227[_0x69f0('0x1f')](_0x69f0('0x20'),_0x10f98e+'-'+_0x12846c+'/'+_0x3222ca)['json'](_0x55b51a);}return null;};}function patchUpdates(_0x7788fe){return function(_0x51add1){try{jsonpatch[_0x69f0('0x21')](_0x51add1,_0x7788fe,!![]);}catch(_0x2581f5){return BPromise[_0x69f0('0x22')](_0x2581f5);}return _0x51add1[_0x69f0('0x23')]();};}function saveUpdates(_0x50e6cb,_0x10b1d8){return function(_0x44318d){if(_0x44318d){return _0x44318d[_0x69f0('0x24')](_0x50e6cb)[_0x69f0('0x25')](function(_0x234263){return _0x234263;});}return null;};}function removeEntity(_0xa1b1c,_0x55cd0d){return function(_0x5b1bb1){if(_0x5b1bb1){return _0x5b1bb1[_0x69f0('0x26')]()[_0x69f0('0x25')](function(){_0xa1b1c[_0x69f0('0x27')](0xcc)[_0x69f0('0x1b')]();});}};}function handleEntityNotFound(_0xf5323b,_0x2f3867){return function(_0x5b9be8){if(!_0x5b9be8){_0xf5323b['sendStatus'](0x194);}return _0x5b9be8;};}function handleError(_0x4c9cc1,_0x2b26cb){_0x2b26cb=_0x2b26cb||0x1f4;return function(_0x3d0eea){logger[_0x69f0('0x28')](_0x3d0eea[_0x69f0('0x29')]);if(_0x3d0eea[_0x69f0('0x2a')]){delete _0x3d0eea[_0x69f0('0x2a')];}_0x4c9cc1[_0x69f0('0x27')](_0x2b26cb)['send'](_0x3d0eea);};}exports[_0x69f0('0x2b')]=function(_0x427925,_0xbc430a){var _0x9308f3={},_0x2aa38e={},_0x4531e2={'count':0x0,'rows':[]};var _0x5449c4=_[_0x69f0('0x2c')](db[_0x69f0('0x2d')][_0x69f0('0x2e')],function(_0x4d8fdf){return{'name':_0x4d8fdf[_0x69f0('0x2f')],'type':_0x4d8fdf[_0x69f0('0x30')][_0x69f0('0x31')]};});_0x2aa38e[_0x69f0('0x32')]=_[_0x69f0('0x2c')](_0x5449c4,_0x69f0('0x2a'));_0x2aa38e[_0x69f0('0x33')]=_['keys'](_0x427925['query']);_0x2aa38e[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x2aa38e['model'],_0x2aa38e['query']);_0x9308f3[_0x69f0('0x36')]=_[_0x69f0('0x35')](_0x2aa38e[_0x69f0('0x32')],qs[_0x69f0('0x37')](_0x427925[_0x69f0('0x33')][_0x69f0('0x37')]));_0x9308f3[_0x69f0('0x36')]=_0x9308f3[_0x69f0('0x36')][_0x69f0('0x38')]?_0x9308f3['attributes']:_0x2aa38e[_0x69f0('0x32')];if(!_0x427925[_0x69f0('0x33')][_0x69f0('0x39')](_0x69f0('0x3a'))){_0x9308f3['limit']=qs[_0x69f0('0x1d')](_0x427925[_0x69f0('0x33')]['limit']);_0x9308f3[_0x69f0('0x3b')]=qs[_0x69f0('0x3b')](_0x427925[_0x69f0('0x33')][_0x69f0('0x3b')]);}_0x9308f3[_0x69f0('0x3c')]=qs[_0x69f0('0x3d')](_0x427925[_0x69f0('0x33')]['sort']);_0x9308f3[_0x69f0('0x3e')]=qs['filters'](_[_0x69f0('0x3f')](_0x427925[_0x69f0('0x33')],_0x2aa38e[_0x69f0('0x34')]),_0x5449c4);if(_0x427925['query'][_0x69f0('0x40')]){_0x9308f3['where']=_[_0x69f0('0x41')](_0x9308f3[_0x69f0('0x3e')],{'$or':_[_0x69f0('0x2c')](_0x5449c4,function(_0x15e660){if(_0x15e660[_0x69f0('0x30')]!==_0x69f0('0x42')){var _0x315d9d={};_0x315d9d[_0x15e660[_0x69f0('0x2a')]]={'$like':'%'+_0x427925['query'][_0x69f0('0x40')]+'%'};return _0x315d9d;}})});}_0x9308f3=_[_0x69f0('0x41')]({},_0x9308f3,_0x427925[_0x69f0('0x43')]);var _0x48b566={'where':_0x9308f3[_0x69f0('0x3e')]};return db[_0x69f0('0x2d')][_0x69f0('0x1e')](_0x48b566)[_0x69f0('0x25')](function(_0xb34b46){_0x4531e2[_0x69f0('0x1e')]=_0xb34b46;if(_0x427925['query'][_0x69f0('0x44')]){_0x9308f3[_0x69f0('0x45')]=[{'all':!![]}];}return db[_0x69f0('0x2d')][_0x69f0('0x46')](_0x9308f3);})['then'](function(_0x3c6f5a){_0x4531e2[_0x69f0('0x47')]=_0x3c6f5a;return _0x4531e2;})[_0x69f0('0x25')](respondWithFilteredResult(_0xbc430a,_0x9308f3))[_0x69f0('0x48')](handleError(_0xbc430a,null));};exports[_0x69f0('0x49')]=function(_0x3c51e5,_0x279eab){var _0x241849={'raw':![],'where':{'id':_0x3c51e5[_0x69f0('0x4a')]['id']}},_0x59aedd={};_0x59aedd[_0x69f0('0x32')]=_[_0x69f0('0x4b')](db[_0x69f0('0x2d')][_0x69f0('0x2e')]);_0x59aedd[_0x69f0('0x33')]=_['keys'](_0x3c51e5[_0x69f0('0x33')]);_0x59aedd['filters']=_[_0x69f0('0x35')](_0x59aedd[_0x69f0('0x32')],_0x59aedd[_0x69f0('0x33')]);_0x241849[_0x69f0('0x36')]=_[_0x69f0('0x35')](_0x59aedd['model'],qs['fields'](_0x3c51e5[_0x69f0('0x33')][_0x69f0('0x37')]));_0x241849[_0x69f0('0x36')]=_0x241849[_0x69f0('0x36')][_0x69f0('0x38')]?_0x241849['attributes']:_0x59aedd[_0x69f0('0x32')];if(_0x3c51e5[_0x69f0('0x33')][_0x69f0('0x44')]){_0x241849['include']=[{'all':!![]}];}_0x241849=_['merge']({},_0x241849,_0x3c51e5['options']);return db[_0x69f0('0x2d')]['find'](_0x241849)['then'](handleEntityNotFound(_0x279eab,null))[_0x69f0('0x25')](respondWithResult(_0x279eab,null))['catch'](handleError(_0x279eab,null));};exports[_0x69f0('0x4c')]=function(_0x288906,_0x395fe9){return db[_0x69f0('0x2d')]['create'](_0x288906[_0x69f0('0x4d')],{})[_0x69f0('0x25')](respondWithResult(_0x395fe9,0xc9))[_0x69f0('0x48')](handleError(_0x395fe9,null));};exports['update']=function(_0x5e2225,_0xa8582){if(_0x5e2225['body']['id']){delete _0x5e2225['body']['id'];}return db[_0x69f0('0x2d')][_0x69f0('0x4e')]({'where':{'id':_0x5e2225[_0x69f0('0x4a')]['id']}})[_0x69f0('0x25')](handleEntityNotFound(_0xa8582,null))['then'](saveUpdates(_0x5e2225[_0x69f0('0x4d')],null))[_0x69f0('0x25')](respondWithResult(_0xa8582,null))[_0x69f0('0x48')](handleError(_0xa8582,null));};exports[_0x69f0('0x26')]=function(_0x27607b,_0x257570){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x27607b[_0x69f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x257570,null))['then'](removeEntity(_0x257570,null))[_0x69f0('0x48')](handleError(_0x257570,null));};exports['getSubjects']=function(_0x145f39,_0x3a6f36,_0x507485){var _0x1b0465={};var _0x318157={};var _0x251d91;var _0x34be54;return db[_0x69f0('0x2d')][_0x69f0('0x4f')]({'where':{'id':_0x145f39[_0x69f0('0x4a')]['id']}})[_0x69f0('0x25')](handleEntityNotFound(_0x3a6f36,null))[_0x69f0('0x25')](function(_0x3eaa54){if(_0x3eaa54){_0x251d91=_0x3eaa54;_0x318157[_0x69f0('0x32')]=_[_0x69f0('0x4b')](db['FreshsalesField']['rawAttributes']);_0x318157[_0x69f0('0x33')]=_[_0x69f0('0x4b')](_0x145f39[_0x69f0('0x33')]);_0x318157[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x318157['model'],_0x318157[_0x69f0('0x33')]);_0x1b0465[_0x69f0('0x36')]=_[_0x69f0('0x35')](_0x318157[_0x69f0('0x32')],qs[_0x69f0('0x37')](_0x145f39[_0x69f0('0x33')][_0x69f0('0x37')]));_0x1b0465[_0x69f0('0x36')]=_0x1b0465['attributes']['length']?_0x1b0465[_0x69f0('0x36')]:_0x318157[_0x69f0('0x32')];_0x1b0465[_0x69f0('0x3c')]=qs[_0x69f0('0x3d')](_0x145f39['query'][_0x69f0('0x3d')]);_0x1b0465['where']=qs['filters'](_['pick'](_0x145f39[_0x69f0('0x33')],_0x318157[_0x69f0('0x34')]));if(_0x145f39[_0x69f0('0x33')][_0x69f0('0x40')]){_0x1b0465[_0x69f0('0x3e')]=_[_0x69f0('0x41')](_0x1b0465[_0x69f0('0x3e')],{'$or':_[_0x69f0('0x2c')](_0x1b0465[_0x69f0('0x36')],function(_0x2b791a){var _0x25f3a9={};_0x25f3a9[_0x2b791a]={'$like':'%'+_0x145f39[_0x69f0('0x33')][_0x69f0('0x40')]+'%'};return _0x25f3a9;})});}_0x1b0465=_['merge']({},_0x1b0465,_0x145f39[_0x69f0('0x43')]);return _0x251d91[_0x69f0('0x50')](_0x1b0465);}})[_0x69f0('0x25')](function(_0x37cc9a){if(_0x37cc9a){_0x34be54=_0x37cc9a[_0x69f0('0x38')];if(!_0x145f39[_0x69f0('0x33')][_0x69f0('0x39')](_0x69f0('0x3a'))){_0x1b0465[_0x69f0('0x1d')]=qs[_0x69f0('0x1d')](_0x145f39[_0x69f0('0x33')][_0x69f0('0x1d')]);_0x1b0465[_0x69f0('0x3b')]=qs[_0x69f0('0x3b')](_0x145f39['query'][_0x69f0('0x3b')]);}return _0x251d91[_0x69f0('0x50')](_0x1b0465);}})[_0x69f0('0x25')](function(_0x530033){if(_0x530033){return _0x530033?{'count':_0x34be54,'rows':_0x530033}:null;}})['then'](respondWithResult(_0x3a6f36,null))[_0x69f0('0x48')](handleError(_0x3a6f36,null));};exports['getDescriptions']=function(_0x2a5642,_0x448fb6,_0x11fcda){var _0x17ab5c={};var _0x4150b0={};var _0xcb6a8f;var _0x5765c8;return db[_0x69f0('0x2d')][_0x69f0('0x4f')]({'where':{'id':_0x2a5642[_0x69f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x448fb6,null))['then'](function(_0x2d83d1){if(_0x2d83d1){_0xcb6a8f=_0x2d83d1;_0x4150b0[_0x69f0('0x32')]=_[_0x69f0('0x4b')](db[_0x69f0('0x51')][_0x69f0('0x2e')]);_0x4150b0[_0x69f0('0x33')]=_[_0x69f0('0x4b')](_0x2a5642[_0x69f0('0x33')]);_0x4150b0[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x4150b0[_0x69f0('0x32')],_0x4150b0[_0x69f0('0x33')]);_0x17ab5c[_0x69f0('0x36')]=_[_0x69f0('0x35')](_0x4150b0[_0x69f0('0x32')],qs['fields'](_0x2a5642['query']['fields']));_0x17ab5c['attributes']=_0x17ab5c[_0x69f0('0x36')][_0x69f0('0x38')]?_0x17ab5c[_0x69f0('0x36')]:_0x4150b0[_0x69f0('0x32')];_0x17ab5c[_0x69f0('0x3c')]=qs[_0x69f0('0x3d')](_0x2a5642[_0x69f0('0x33')][_0x69f0('0x3d')]);_0x17ab5c[_0x69f0('0x3e')]=qs['filters'](_[_0x69f0('0x3f')](_0x2a5642[_0x69f0('0x33')],_0x4150b0['filters']));if(_0x2a5642[_0x69f0('0x33')][_0x69f0('0x40')]){_0x17ab5c[_0x69f0('0x3e')]=_['merge'](_0x17ab5c[_0x69f0('0x3e')],{'$or':_[_0x69f0('0x2c')](_0x17ab5c[_0x69f0('0x36')],function(_0x10c880){var _0xbfa239={};_0xbfa239[_0x10c880]={'$like':'%'+_0x2a5642[_0x69f0('0x33')][_0x69f0('0x40')]+'%'};return _0xbfa239;})});}_0x17ab5c=_[_0x69f0('0x41')]({},_0x17ab5c,_0x2a5642[_0x69f0('0x43')]);return _0xcb6a8f['getDescriptions'](_0x17ab5c);}})[_0x69f0('0x25')](function(_0x598161){if(_0x598161){_0x5765c8=_0x598161[_0x69f0('0x38')];if(!_0x2a5642['query'][_0x69f0('0x39')]('nolimit')){_0x17ab5c[_0x69f0('0x1d')]=qs[_0x69f0('0x1d')](_0x2a5642[_0x69f0('0x33')][_0x69f0('0x1d')]);_0x17ab5c[_0x69f0('0x3b')]=qs['offset'](_0x2a5642[_0x69f0('0x33')][_0x69f0('0x3b')]);}return _0xcb6a8f[_0x69f0('0x52')](_0x17ab5c);}})[_0x69f0('0x25')](function(_0x25ee5a){if(_0x25ee5a){return _0x25ee5a?{'count':_0x5765c8,'rows':_0x25ee5a}:null;}})[_0x69f0('0x25')](respondWithResult(_0x448fb6,null))['catch'](handleError(_0x448fb6,null));};exports['getFields']=function(_0x4acad2,_0x100625,_0x1f8741){var _0x36f062={};var _0x4197de={};var _0x391ba2;var _0xe79516;return db['FreshsalesConfiguration'][_0x69f0('0x4f')]({'where':{'id':_0x4acad2[_0x69f0('0x4a')]['id']}})[_0x69f0('0x25')](handleEntityNotFound(_0x100625,null))[_0x69f0('0x25')](function(_0x59d817){if(_0x59d817){_0x391ba2=_0x59d817;_0x4197de['model']=_['keys'](db[_0x69f0('0x51')]['rawAttributes']);_0x4197de[_0x69f0('0x33')]=_[_0x69f0('0x4b')](_0x4acad2[_0x69f0('0x33')]);_0x4197de[_0x69f0('0x34')]=_[_0x69f0('0x35')](_0x4197de[_0x69f0('0x32')],_0x4197de['query']);_0x36f062['attributes']=_[_0x69f0('0x35')](_0x4197de[_0x69f0('0x32')],qs[_0x69f0('0x37')](_0x4acad2[_0x69f0('0x33')][_0x69f0('0x37')]));_0x36f062[_0x69f0('0x36')]=_0x36f062[_0x69f0('0x36')][_0x69f0('0x38')]?_0x36f062[_0x69f0('0x36')]:_0x4197de[_0x69f0('0x32')];_0x36f062[_0x69f0('0x3c')]=qs[_0x69f0('0x3d')](_0x4acad2['query'][_0x69f0('0x3d')]);_0x36f062[_0x69f0('0x3e')]=qs[_0x69f0('0x34')](_[_0x69f0('0x3f')](_0x4acad2[_0x69f0('0x33')],_0x4197de['filters']));if(_0x4acad2[_0x69f0('0x33')][_0x69f0('0x40')]){_0x36f062[_0x69f0('0x3e')]=_[_0x69f0('0x41')](_0x36f062[_0x69f0('0x3e')],{'$or':_[_0x69f0('0x2c')](_0x36f062[_0x69f0('0x36')],function(_0x57e2e2){var _0x40627e={};_0x40627e[_0x57e2e2]={'$like':'%'+_0x4acad2[_0x69f0('0x33')]['filter']+'%'};return _0x40627e;})});}_0x36f062=_[_0x69f0('0x41')]({},_0x36f062,_0x4acad2[_0x69f0('0x43')]);return _0x391ba2[_0x69f0('0x53')](_0x36f062);}})[_0x69f0('0x25')](function(_0x5d64cf){if(_0x5d64cf){_0xe79516=_0x5d64cf[_0x69f0('0x38')];if(!_0x4acad2[_0x69f0('0x33')][_0x69f0('0x39')]('nolimit')){_0x36f062['limit']=qs[_0x69f0('0x1d')](_0x4acad2['query'][_0x69f0('0x1d')]);_0x36f062[_0x69f0('0x3b')]=qs[_0x69f0('0x3b')](_0x4acad2[_0x69f0('0x33')]['offset']);}return _0x391ba2['getFields'](_0x36f062);}})['then'](function(_0x4a3d97){if(_0x4a3d97){return _0x4a3d97?{'count':_0xe79516,'rows':_0x4a3d97}:null;}})['then'](respondWithResult(_0x100625,null))['catch'](handleError(_0x100625,null));}; \ No newline at end of file +var _0x0892=['merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x504f15,_0x23a1ca){var _0x2a92c1=function(_0x298472){while(--_0x298472){_0x504f15['push'](_0x504f15['shift']());}};_0x2a92c1(++_0x23a1ca);}(_0x0892,0x65));var _0x2089=function(_0x34699c,_0x20d48c){_0x34699c=_0x34699c-0x0;var _0x394bb7=_0x0892[_0x34699c];return _0x394bb7;};'use strict';var emlformat=require(_0x2089('0x0'));var rimraf=require(_0x2089('0x1'));var zipdir=require(_0x2089('0x2'));var jsonpatch=require(_0x2089('0x3'));var rp=require('request-promise');var moment=require(_0x2089('0x4'));var BPromise=require(_0x2089('0x5'));var Mustache=require(_0x2089('0x6'));var util=require(_0x2089('0x7'));var path=require(_0x2089('0x8'));var sox=require(_0x2089('0x9'));var csv=require('to-csv');var ejs=require(_0x2089('0xa'));var fs=require('fs');var fs_extra=require(_0x2089('0xb'));var _=require(_0x2089('0xc'));var squel=require(_0x2089('0xd'));var crypto=require(_0x2089('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2089('0xf'));var toCsv=require(_0x2089('0x10'));var querystring=require('querystring');var Papa=require(_0x2089('0x11'));var Redis=require('ioredis');var authService=require(_0x2089('0x12'));var qs=require(_0x2089('0x13'));var as=require(_0x2089('0x14'));var hardwareService=require(_0x2089('0x15'));var logger=require(_0x2089('0x16'))(_0x2089('0x17'));var utils=require(_0x2089('0x18'));var config=require(_0x2089('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2089('0x1a'))['db'];function respondWithStatusCode(_0x1b0921,_0x34bc33){_0x34bc33=_0x34bc33||0xcc;return function(_0x2d1c58){if(_0x2d1c58){return _0x1b0921[_0x2089('0x1b')](_0x34bc33);}return _0x1b0921[_0x2089('0x1c')](_0x34bc33)[_0x2089('0x1d')]();};}function respondWithResult(_0x162fcf,_0x4d2bd4){_0x4d2bd4=_0x4d2bd4||0xc8;return function(_0x2572c3){if(_0x2572c3){return _0x162fcf[_0x2089('0x1c')](_0x4d2bd4)['json'](_0x2572c3);}};}function respondWithFilteredResult(_0x33d9cd,_0x2a6ada){return function(_0x51b144){if(_0x51b144){var _0x16a291=typeof _0x2a6ada[_0x2089('0x1e')]===_0x2089('0x1f')&&typeof _0x2a6ada[_0x2089('0x20')]===_0x2089('0x1f');var _0x65cf4b=_0x51b144[_0x2089('0x21')];var _0x23178e=_0x16a291?0x0:_0x2a6ada[_0x2089('0x1e')];var _0x25eaff=_0x16a291?_0x51b144['count']:_0x2a6ada[_0x2089('0x1e')]+_0x2a6ada[_0x2089('0x20')];var _0xf9fe89;if(_0x25eaff>=_0x65cf4b){_0x25eaff=_0x65cf4b;_0xf9fe89=0xc8;}else{_0xf9fe89=0xce;}_0x33d9cd[_0x2089('0x1c')](_0xf9fe89);return _0x33d9cd[_0x2089('0x22')](_0x2089('0x23'),_0x23178e+'-'+_0x25eaff+'/'+_0x65cf4b)[_0x2089('0x24')](_0x51b144);}return null;};}function patchUpdates(_0x46cd14){return function(_0x321fb2){try{jsonpatch['apply'](_0x321fb2,_0x46cd14,!![]);}catch(_0x19b653){return BPromise[_0x2089('0x25')](_0x19b653);}return _0x321fb2['save']();};}function saveUpdates(_0x44d61a,_0x176087){return function(_0x10b919){if(_0x10b919){return _0x10b919[_0x2089('0x26')](_0x44d61a)[_0x2089('0x27')](function(_0x4b19de){return _0x4b19de;});}return null;};}function removeEntity(_0x4398a6,_0x3f436b){return function(_0x2fa209){if(_0x2fa209){return _0x2fa209[_0x2089('0x28')]()['then'](function(){_0x4398a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5be21d,_0x55186f){return function(_0xc5a188){if(!_0xc5a188){_0x5be21d[_0x2089('0x1b')](0x194);}return _0xc5a188;};}function handleError(_0x309b70,_0x19067e){_0x19067e=_0x19067e||0x1f4;return function(_0x3249d5){logger[_0x2089('0x29')](_0x3249d5[_0x2089('0x2a')]);if(_0x3249d5[_0x2089('0x2b')]){delete _0x3249d5[_0x2089('0x2b')];}_0x309b70['status'](_0x19067e)[_0x2089('0x2c')](_0x3249d5);};}exports[_0x2089('0x2d')]=function(_0x530a82,_0x27f643){var _0x1d64c5={},_0x3e2c1a={},_0x4aad0a={'count':0x0,'rows':[]};var _0xb503eb=_[_0x2089('0x2e')](db[_0x2089('0x2f')][_0x2089('0x30')],function(_0xb4549c){return{'name':_0xb4549c[_0x2089('0x31')],'type':_0xb4549c['type'][_0x2089('0x32')]};});_0x3e2c1a[_0x2089('0x33')]=_[_0x2089('0x2e')](_0xb503eb,_0x2089('0x2b'));_0x3e2c1a[_0x2089('0x34')]=_[_0x2089('0x35')](_0x530a82[_0x2089('0x34')]);_0x3e2c1a['filters']=_[_0x2089('0x36')](_0x3e2c1a[_0x2089('0x33')],_0x3e2c1a[_0x2089('0x34')]);_0x1d64c5[_0x2089('0x37')]=_['intersection'](_0x3e2c1a['model'],qs[_0x2089('0x38')](_0x530a82['query'][_0x2089('0x38')]));_0x1d64c5[_0x2089('0x37')]=_0x1d64c5['attributes'][_0x2089('0x39')]?_0x1d64c5[_0x2089('0x37')]:_0x3e2c1a['model'];if(!_0x530a82['query']['hasOwnProperty'](_0x2089('0x3a'))){_0x1d64c5[_0x2089('0x20')]=qs[_0x2089('0x20')](_0x530a82['query'][_0x2089('0x20')]);_0x1d64c5[_0x2089('0x1e')]=qs['offset'](_0x530a82[_0x2089('0x34')][_0x2089('0x1e')]);}_0x1d64c5[_0x2089('0x3b')]=qs[_0x2089('0x3c')](_0x530a82[_0x2089('0x34')][_0x2089('0x3c')]);_0x1d64c5[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_[_0x2089('0x3f')](_0x530a82[_0x2089('0x34')],_0x3e2c1a[_0x2089('0x3e')]),_0xb503eb);if(_0x530a82['query'][_0x2089('0x40')]){_0x1d64c5['where']=_[_0x2089('0x41')](_0x1d64c5['where'],{'$or':_[_0x2089('0x2e')](_0xb503eb,function(_0x730240){if(_0x730240['type']!=='VIRTUAL'){var _0x4a4fb1={};_0x4a4fb1[_0x730240[_0x2089('0x2b')]]={'$like':'%'+_0x530a82[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0x4a4fb1;}})});}_0x1d64c5=_[_0x2089('0x41')]({},_0x1d64c5,_0x530a82[_0x2089('0x42')]);var _0x312ac3={'where':_0x1d64c5['where']};return db[_0x2089('0x2f')]['count'](_0x312ac3)['then'](function(_0x696ad6){_0x4aad0a['count']=_0x696ad6;if(_0x530a82['query'][_0x2089('0x43')]){_0x1d64c5[_0x2089('0x44')]=[{'all':!![]}];}return db[_0x2089('0x2f')][_0x2089('0x45')](_0x1d64c5);})[_0x2089('0x27')](function(_0xd971a2){_0x4aad0a[_0x2089('0x46')]=_0xd971a2;return _0x4aad0a;})[_0x2089('0x27')](respondWithFilteredResult(_0x27f643,_0x1d64c5))[_0x2089('0x47')](handleError(_0x27f643,null));};exports[_0x2089('0x48')]=function(_0x113fe7,_0x5bae11){var _0x14b745={'raw':![],'where':{'id':_0x113fe7['params']['id']}},_0x32cafa={};_0x32cafa['model']=_[_0x2089('0x35')](db['FreshsalesConfiguration'][_0x2089('0x30')]);_0x32cafa[_0x2089('0x34')]=_[_0x2089('0x35')](_0x113fe7[_0x2089('0x34')]);_0x32cafa[_0x2089('0x3e')]=_[_0x2089('0x36')](_0x32cafa['model'],_0x32cafa[_0x2089('0x34')]);_0x14b745[_0x2089('0x37')]=_[_0x2089('0x36')](_0x32cafa[_0x2089('0x33')],qs[_0x2089('0x38')](_0x113fe7[_0x2089('0x34')][_0x2089('0x38')]));_0x14b745[_0x2089('0x37')]=_0x14b745['attributes']['length']?_0x14b745['attributes']:_0x32cafa[_0x2089('0x33')];if(_0x113fe7['query'][_0x2089('0x43')]){_0x14b745['include']=[{'all':!![]}];}_0x14b745=_[_0x2089('0x41')]({},_0x14b745,_0x113fe7['options']);return db[_0x2089('0x2f')]['find'](_0x14b745)[_0x2089('0x27')](handleEntityNotFound(_0x5bae11,null))[_0x2089('0x27')](respondWithResult(_0x5bae11,null))[_0x2089('0x47')](handleError(_0x5bae11,null));};exports['create']=function(_0x358187,_0x5b69){return db['FreshsalesConfiguration'][_0x2089('0x49')](_0x358187[_0x2089('0x4a')],{})[_0x2089('0x27')](respondWithResult(_0x5b69,0xc9))['catch'](handleError(_0x5b69,null));};exports[_0x2089('0x26')]=function(_0x29bf76,_0x58ab7d){if(_0x29bf76[_0x2089('0x4a')]['id']){delete _0x29bf76[_0x2089('0x4a')]['id'];}return db[_0x2089('0x2f')][_0x2089('0x4b')]({'where':{'id':_0x29bf76[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x58ab7d,null))[_0x2089('0x27')](saveUpdates(_0x29bf76[_0x2089('0x4a')],null))['then'](respondWithResult(_0x58ab7d,null))['catch'](handleError(_0x58ab7d,null));};exports['destroy']=function(_0x56039e,_0x170b56){return db[_0x2089('0x2f')]['find']({'where':{'id':_0x56039e[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x170b56,null))[_0x2089('0x27')](removeEntity(_0x170b56,null))[_0x2089('0x47')](handleError(_0x170b56,null));};exports[_0x2089('0x4d')]=function(_0x53ac73,_0x75fc89,_0xbd037e){var _0x54b5eb={};var _0xc92dad={};var _0x125608;var _0xc102d9;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0x53ac73['params']['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x75fc89,null))[_0x2089('0x27')](function(_0x1b2639){if(_0x1b2639){_0x125608=_0x1b2639;_0xc92dad[_0x2089('0x33')]=_[_0x2089('0x35')](db[_0x2089('0x4f')][_0x2089('0x30')]);_0xc92dad['query']=_[_0x2089('0x35')](_0x53ac73['query']);_0xc92dad['filters']=_[_0x2089('0x36')](_0xc92dad[_0x2089('0x33')],_0xc92dad[_0x2089('0x34')]);_0x54b5eb[_0x2089('0x37')]=_[_0x2089('0x36')](_0xc92dad['model'],qs['fields'](_0x53ac73['query'][_0x2089('0x38')]));_0x54b5eb[_0x2089('0x37')]=_0x54b5eb[_0x2089('0x37')][_0x2089('0x39')]?_0x54b5eb['attributes']:_0xc92dad[_0x2089('0x33')];_0x54b5eb[_0x2089('0x3b')]=qs[_0x2089('0x3c')](_0x53ac73['query'][_0x2089('0x3c')]);_0x54b5eb[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_['pick'](_0x53ac73['query'],_0xc92dad[_0x2089('0x3e')]));if(_0x53ac73['query'][_0x2089('0x40')]){_0x54b5eb[_0x2089('0x3d')]=_[_0x2089('0x41')](_0x54b5eb[_0x2089('0x3d')],{'$or':_[_0x2089('0x2e')](_0x54b5eb[_0x2089('0x37')],function(_0x2e3f14){var _0xc1e08e={};_0xc1e08e[_0x2e3f14]={'$like':'%'+_0x53ac73['query']['filter']+'%'};return _0xc1e08e;})});}_0x54b5eb=_[_0x2089('0x41')]({},_0x54b5eb,_0x53ac73[_0x2089('0x42')]);return _0x125608[_0x2089('0x4d')](_0x54b5eb);}})['then'](function(_0x287a41){if(_0x287a41){_0xc102d9=_0x287a41[_0x2089('0x39')];if(!_0x53ac73[_0x2089('0x34')][_0x2089('0x50')](_0x2089('0x3a'))){_0x54b5eb[_0x2089('0x20')]=qs['limit'](_0x53ac73['query'][_0x2089('0x20')]);_0x54b5eb[_0x2089('0x1e')]=qs[_0x2089('0x1e')](_0x53ac73[_0x2089('0x34')]['offset']);}return _0x125608[_0x2089('0x4d')](_0x54b5eb);}})[_0x2089('0x27')](function(_0x3cf41a){if(_0x3cf41a){return _0x3cf41a?{'count':_0xc102d9,'rows':_0x3cf41a}:null;}})[_0x2089('0x27')](respondWithResult(_0x75fc89,null))[_0x2089('0x47')](handleError(_0x75fc89,null));};exports[_0x2089('0x51')]=function(_0x3de6a0,_0x3ae4c5,_0x3427df){var _0x5bd5bc={};var _0x4fafd8={};var _0x5eede1;var _0x1806b8;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0x3de6a0['params']['id']}})['then'](handleEntityNotFound(_0x3ae4c5,null))[_0x2089('0x27')](function(_0x50c219){if(_0x50c219){_0x5eede1=_0x50c219;_0x4fafd8[_0x2089('0x33')]=_[_0x2089('0x35')](db['FreshsalesField']['rawAttributes']);_0x4fafd8['query']=_['keys'](_0x3de6a0['query']);_0x4fafd8['filters']=_[_0x2089('0x36')](_0x4fafd8[_0x2089('0x33')],_0x4fafd8[_0x2089('0x34')]);_0x5bd5bc['attributes']=_['intersection'](_0x4fafd8[_0x2089('0x33')],qs[_0x2089('0x38')](_0x3de6a0['query'][_0x2089('0x38')]));_0x5bd5bc['attributes']=_0x5bd5bc[_0x2089('0x37')]['length']?_0x5bd5bc[_0x2089('0x37')]:_0x4fafd8[_0x2089('0x33')];_0x5bd5bc[_0x2089('0x3b')]=qs['sort'](_0x3de6a0[_0x2089('0x34')][_0x2089('0x3c')]);_0x5bd5bc[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_[_0x2089('0x3f')](_0x3de6a0[_0x2089('0x34')],_0x4fafd8['filters']));if(_0x3de6a0[_0x2089('0x34')][_0x2089('0x40')]){_0x5bd5bc[_0x2089('0x3d')]=_[_0x2089('0x41')](_0x5bd5bc['where'],{'$or':_[_0x2089('0x2e')](_0x5bd5bc['attributes'],function(_0x4fae6b){var _0x5c026e={};_0x5c026e[_0x4fae6b]={'$like':'%'+_0x3de6a0[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0x5c026e;})});}_0x5bd5bc=_[_0x2089('0x41')]({},_0x5bd5bc,_0x3de6a0[_0x2089('0x42')]);return _0x5eede1[_0x2089('0x51')](_0x5bd5bc);}})[_0x2089('0x27')](function(_0x15af95){if(_0x15af95){_0x1806b8=_0x15af95[_0x2089('0x39')];if(!_0x3de6a0[_0x2089('0x34')]['hasOwnProperty'](_0x2089('0x3a'))){_0x5bd5bc[_0x2089('0x20')]=qs['limit'](_0x3de6a0[_0x2089('0x34')][_0x2089('0x20')]);_0x5bd5bc[_0x2089('0x1e')]=qs['offset'](_0x3de6a0['query']['offset']);}return _0x5eede1[_0x2089('0x51')](_0x5bd5bc);}})['then'](function(_0x1eb8ea){if(_0x1eb8ea){return _0x1eb8ea?{'count':_0x1806b8,'rows':_0x1eb8ea}:null;}})['then'](respondWithResult(_0x3ae4c5,null))[_0x2089('0x47')](handleError(_0x3ae4c5,null));};exports[_0x2089('0x52')]=function(_0xd23b6a,_0x15834b,_0x1c27b9){var _0x337e9a={};var _0x37805f={};var _0x3f6304;var _0x8fd78;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0xd23b6a[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x15834b,null))[_0x2089('0x27')](function(_0x6ce5de){if(_0x6ce5de){_0x3f6304=_0x6ce5de;_0x37805f[_0x2089('0x33')]=_[_0x2089('0x35')](db[_0x2089('0x4f')]['rawAttributes']);_0x37805f[_0x2089('0x34')]=_[_0x2089('0x35')](_0xd23b6a[_0x2089('0x34')]);_0x37805f[_0x2089('0x3e')]=_[_0x2089('0x36')](_0x37805f[_0x2089('0x33')],_0x37805f[_0x2089('0x34')]);_0x337e9a[_0x2089('0x37')]=_[_0x2089('0x36')](_0x37805f[_0x2089('0x33')],qs[_0x2089('0x38')](_0xd23b6a['query'][_0x2089('0x38')]));_0x337e9a[_0x2089('0x37')]=_0x337e9a[_0x2089('0x37')][_0x2089('0x39')]?_0x337e9a['attributes']:_0x37805f[_0x2089('0x33')];_0x337e9a[_0x2089('0x3b')]=qs['sort'](_0xd23b6a[_0x2089('0x34')][_0x2089('0x3c')]);_0x337e9a[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_['pick'](_0xd23b6a[_0x2089('0x34')],_0x37805f['filters']));if(_0xd23b6a[_0x2089('0x34')][_0x2089('0x40')]){_0x337e9a['where']=_[_0x2089('0x41')](_0x337e9a[_0x2089('0x3d')],{'$or':_[_0x2089('0x2e')](_0x337e9a[_0x2089('0x37')],function(_0x2cdb94){var _0xc3bf85={};_0xc3bf85[_0x2cdb94]={'$like':'%'+_0xd23b6a[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0xc3bf85;})});}_0x337e9a=_[_0x2089('0x41')]({},_0x337e9a,_0xd23b6a['options']);return _0x3f6304[_0x2089('0x52')](_0x337e9a);}})[_0x2089('0x27')](function(_0x232c9c){if(_0x232c9c){_0x8fd78=_0x232c9c[_0x2089('0x39')];if(!_0xd23b6a['query'][_0x2089('0x50')]('nolimit')){_0x337e9a[_0x2089('0x20')]=qs[_0x2089('0x20')](_0xd23b6a[_0x2089('0x34')]['limit']);_0x337e9a[_0x2089('0x1e')]=qs[_0x2089('0x1e')](_0xd23b6a[_0x2089('0x34')]['offset']);}return _0x3f6304[_0x2089('0x52')](_0x337e9a);}})['then'](function(_0x496cc1){if(_0x496cc1){return _0x496cc1?{'count':_0x8fd78,'rows':_0x496cc1}:null;}})[_0x2089('0x27')](respondWithResult(_0x15834b,null))[_0x2089('0x47')](handleError(_0x15834b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8cc1958..07af0ab 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 _0x6a35=['moment','bluebird','request-promise','rimraf','exports','define','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x1a1921,_0x402bf2){var _0x135575=function(_0x266e24){while(--_0x266e24){_0x1a1921['push'](_0x1a1921['shift']());}};_0x135575(++_0x402bf2);}(_0x6a35,0x93));var _0x56a3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6a35[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x56a3('0x0'));var util=require(_0x56a3('0x1'));var logger=require(_0x56a3('0x2'))('api');var moment=require(_0x56a3('0x3'));var BPromise=require(_0x56a3('0x4'));var rp=require(_0x56a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56a3('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x56a3('0x7')]=function(_0x3bc56f,_0x4d1461){return _0x3bc56f[_0x56a3('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x56a3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6a9=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1944dc,_0x409526){var _0x5de3bd=function(_0x351374){while(--_0x351374){_0x1944dc['push'](_0x1944dc['shift']());}};_0x5de3bd(++_0x409526);}(_0xb6a9,0x1b6));var _0x9b6a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb6a9[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x9b6a('0x0'));var util=require(_0x9b6a('0x1'));var logger=require('../../config/logger')(_0x9b6a('0x2'));var moment=require(_0x9b6a('0x3'));var BPromise=require(_0x9b6a('0x4'));var rp=require(_0x9b6a('0x5'));var fs=require('fs');var path=require(_0x9b6a('0x6'));var rimraf=require(_0x9b6a('0x7'));var config=require(_0x9b6a('0x8'));var attributes=require(_0x9b6a('0x9'));module[_0x9b6a('0xa')]=function(_0x4a51e6,_0x2241c7){return _0x4a51e6[_0x9b6a('0xb')](_0x9b6a('0xc'),attributes,{'tableName':_0x9b6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index c9797e6..83c8f8e 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 _0xda75=['jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3044cc,_0x2be321){var _0x2465d4=function(_0x3b6356){while(--_0x3b6356){_0x3044cc['push'](_0x3044cc['shift']());}};_0x2465d4(++_0x2be321);}(_0xda75,0xf8));var _0x5da7=function(_0x2dd2f5,_0x1bf66a){_0x2dd2f5=_0x2dd2f5-0x0;var _0x36d48e=_0xda75[_0x2dd2f5];return _0x36d48e;};'use strict';var _=require(_0x5da7('0x0'));var util=require(_0x5da7('0x1'));var moment=require('moment');var BPromise=require(_0x5da7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5da7('0x3'));var db=require(_0x5da7('0x4'))['db'];var utils=require(_0x5da7('0x5'));var logger=require('../../config/logger')(_0x5da7('0x6'));var config=require('../../config/environment');var jayson=require(_0x5da7('0x7'));var client=jayson[_0x5da7('0x8')][_0x5da7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446cd5,_0xb0620d,_0x4762de){return new BPromise(function(_0x70db5a,_0x250712){return client['request'](_0x446cd5,_0x4762de)[_0x5da7('0xa')](function(_0x128732){logger[_0x5da7('0xb')](_0x5da7('0xc'),_0xb0620d,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xb0620d,_0x5da7('0xd'),JSON['stringify'](_0x128732));if(_0x128732[_0x5da7('0xe')]){if(_0x128732[_0x5da7('0xe')]['code']===0x1f4){logger['error'](_0x5da7('0xc'),_0xb0620d,_0x128732[_0x5da7('0xe')][_0x5da7('0xf')]);return _0x250712(_0x128732['error'][_0x5da7('0xf')]);}logger[_0x5da7('0xe')](_0x5da7('0xc'),_0xb0620d,_0x128732['error'][_0x5da7('0xf')]);return _0x70db5a(_0x128732['error']['message']);}else{logger[_0x5da7('0xb')](_0x5da7('0xc'),_0xb0620d,_0x5da7('0xd'));_0x70db5a(_0x128732['result'][_0x5da7('0xf')]);}})[_0x5da7('0x10')](function(_0x4165de){logger[_0x5da7('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xb0620d,_0x4165de);_0x250712(_0x4165de);});});} \ No newline at end of file +var _0xdade=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x55ae99,_0x5ab789){var _0x4297e1=function(_0x33ee69){while(--_0x33ee69){_0x55ae99['push'](_0x55ae99['shift']());}};_0x4297e1(++_0x5ab789);}(_0xdade,0x15c));var _0xedad=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0xdade[_0x166146];return _0x9c7390;};'use strict';var _=require(_0xedad('0x0'));var util=require(_0xedad('0x1'));var moment=require('moment');var BPromise=require(_0xedad('0x2'));var rs=require(_0xedad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedad('0x5'))(_0xedad('0x6'));var config=require(_0xedad('0x7'));var jayson=require(_0xedad('0x8'));var client=jayson[_0xedad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113044,_0x4023a1,_0x9660b0){return new BPromise(function(_0x5577b5,_0x2c3c04){return client[_0xedad('0xa')](_0x113044,_0x9660b0)[_0xedad('0xb')](function(_0x300f92){logger[_0xedad('0xc')](_0xedad('0xd'),_0x4023a1,_0xedad('0xe'));logger[_0xedad('0xf')](_0xedad('0x10'),_0x4023a1,_0xedad('0xe'),JSON[_0xedad('0x11')](_0x300f92));if(_0x300f92[_0xedad('0x12')]){if(_0x300f92[_0xedad('0x12')][_0xedad('0x13')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4023a1,_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);return _0x2c3c04(_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);}logger[_0xedad('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4023a1,_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);return _0x5577b5(_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);}else{logger['info'](_0xedad('0xd'),_0x4023a1,_0xedad('0xe'));_0x5577b5(_0x300f92[_0xedad('0x15')][_0xedad('0x14')]);}})['catch'](function(_0x3b1312){logger['error'](_0xedad('0xd'),_0x4023a1,_0x3b1312);_0x2c3c04(_0x3b1312);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8939976..21b5a06 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 _0x153f=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x153f,0x15b));var _0xf153=function(_0x1e9da4,_0x5acaa9){_0x1e9da4=_0x1e9da4-0x0;var _0x2c186c=_0x153f[_0x1e9da4];return _0x2c186c;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0xd')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')](_0xf153('0x10'),auth[_0xf153('0xa')](),controller[_0xf153('0x11')]);router[_0xf153('0x12')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x13')]);module[_0xf153('0x14')]=router; \ No newline at end of file +var _0x17ba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0x17ba,0xab));var _0xa17b=function(_0x493532,_0x30a15e){_0x493532=_0x493532-0x0;var _0x37393f=_0x17ba[_0x493532];return _0x37393f;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xf')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0x11')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x12')]);router[_0xa17b('0x13')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x14')]);module[_0xa17b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1a0cbb6..e7d655a 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 _0x9787=['picklist','variable','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x5aa3cb,_0x2030bf){var _0x5c660a=function(_0x1e8626){while(--_0x1e8626){_0x5aa3cb['push'](_0x5aa3cb['shift']());}};_0x5c660a(++_0x2030bf);}(_0x9787,0xdc));var _0x7978=function(_0x3230ab,_0x46eac4){_0x3230ab=_0x3230ab-0x0;var _0x486975=_0x9787[_0x3230ab];return _0x486975;};'use strict';var Sequelize=require(_0x7978('0x0'));module[_0x7978('0x1')]={'type':{'type':Sequelize[_0x7978('0x2')](_0x7978('0x3'),'variable',_0x7978('0x4'),'keyValue',_0x7978('0x5')),'defaultValue':_0x7978('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7978('0x2')](_0x7978('0x3'),_0x7978('0x6'),_0x7978('0x4'))},'keyContent':{'type':Sequelize[_0x7978('0x7')]},'idField':{'type':Sequelize[_0x7978('0x7')]},'nameField':{'type':Sequelize[_0x7978('0x7')]},'customField':{'type':Sequelize[_0x7978('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7978('0x7')]}}; \ No newline at end of file +var _0x5845=['string','variable','customVariable','keyValue','STRING','exports','ENUM'];(function(_0x1252d9,_0xb59816){var _0x76c018=function(_0x52e72c){while(--_0x52e72c){_0x1252d9['push'](_0x1252d9['shift']());}};_0x76c018(++_0xb59816);}(_0x5845,0xde));var _0x5584=function(_0x448e81,_0x402d6b){_0x448e81=_0x448e81-0x0;var _0xca57f8=_0x5845[_0x448e81];return _0xca57f8;};'use strict';var Sequelize=require('sequelize');module[_0x5584('0x0')]={'type':{'type':Sequelize[_0x5584('0x1')](_0x5584('0x2'),_0x5584('0x3'),_0x5584('0x4'),_0x5584('0x5'),'picklist'),'defaultValue':_0x5584('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5584('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5584('0x2'),_0x5584('0x3'),_0x5584('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5584('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5584('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 915196a..db5f278 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 _0x7453=['end','limit','undefined','count','offset','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','FreshsalesField','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','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x43eba3,_0x499714){var _0x4e8cab=function(_0x41dfb6){while(--_0x41dfb6){_0x43eba3['push'](_0x43eba3['shift']());}};_0x4e8cab(++_0x499714);}(_0x7453,0x168));var _0x3745=function(_0x2ebd1d,_0x2a8e08){_0x2ebd1d=_0x2ebd1d-0x0;var _0x2ae0ef=_0x7453[_0x2ebd1d];return _0x2ae0ef;};'use strict';var emlformat=require(_0x3745('0x0'));var rimraf=require(_0x3745('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3745('0x2'));var rp=require(_0x3745('0x3'));var moment=require('moment');var BPromise=require(_0x3745('0x4'));var Mustache=require(_0x3745('0x5'));var util=require('util');var path=require(_0x3745('0x6'));var sox=require('sox');var csv=require(_0x3745('0x7'));var ejs=require(_0x3745('0x8'));var fs=require('fs');var fs_extra=require(_0x3745('0x9'));var _=require(_0x3745('0xa'));var squel=require(_0x3745('0xb'));var crypto=require(_0x3745('0xc'));var jsforce=require(_0x3745('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3745('0x7'));var querystring=require(_0x3745('0xe'));var Papa=require(_0x3745('0xf'));var Redis=require('ioredis');var authService=require(_0x3745('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3745('0x11'));var logger=require(_0x3745('0x12'))(_0x3745('0x13'));var utils=require('../../config/utils');var config=require(_0x3745('0x14'));var licenseUtil=require(_0x3745('0x15'));var db=require(_0x3745('0x16'))['db'];function respondWithStatusCode(_0x3e3f03,_0x396374){_0x396374=_0x396374||0xcc;return function(_0x117209){if(_0x117209){return _0x3e3f03[_0x3745('0x17')](_0x396374);}return _0x3e3f03[_0x3745('0x18')](_0x396374)[_0x3745('0x19')]();};}function respondWithResult(_0x23a515,_0x31cc0e){_0x31cc0e=_0x31cc0e||0xc8;return function(_0x31ff74){if(_0x31ff74){return _0x23a515['status'](_0x31cc0e)['json'](_0x31ff74);}};}function respondWithFilteredResult(_0x419997,_0x1dcf47){return function(_0x176d71){if(_0x176d71){var _0x3be1be=typeof _0x1dcf47['offset']==='undefined'&&typeof _0x1dcf47[_0x3745('0x1a')]===_0x3745('0x1b');var _0x4ac0f5=_0x176d71[_0x3745('0x1c')];var _0x2f3916=_0x3be1be?0x0:_0x1dcf47[_0x3745('0x1d')];var _0x364f70=_0x3be1be?_0x176d71[_0x3745('0x1c')]:_0x1dcf47[_0x3745('0x1d')]+_0x1dcf47[_0x3745('0x1a')];var _0x531ca6;if(_0x364f70>=_0x4ac0f5){_0x364f70=_0x4ac0f5;_0x531ca6=0xc8;}else{_0x531ca6=0xce;}_0x419997[_0x3745('0x18')](_0x531ca6);return _0x419997[_0x3745('0x1e')](_0x3745('0x1f'),_0x2f3916+'-'+_0x364f70+'/'+_0x4ac0f5)[_0x3745('0x20')](_0x176d71);}return null;};}function patchUpdates(_0x36c69e){return function(_0x5e09f3){try{jsonpatch[_0x3745('0x21')](_0x5e09f3,_0x36c69e,!![]);}catch(_0x2cede6){return BPromise['reject'](_0x2cede6);}return _0x5e09f3[_0x3745('0x22')]();};}function saveUpdates(_0x44060e,_0x3970f2){return function(_0x5252e1){if(_0x5252e1){return _0x5252e1['update'](_0x44060e)['then'](function(_0x4065cf){return _0x4065cf;});}return null;};}function removeEntity(_0x10b26d,_0x49fd77){return function(_0x5f443d){if(_0x5f443d){return _0x5f443d[_0x3745('0x23')]()[_0x3745('0x24')](function(){_0x10b26d['status'](0xcc)[_0x3745('0x19')]();});}};}function handleEntityNotFound(_0xbe0594,_0x50d249){return function(_0x54ba29){if(!_0x54ba29){_0xbe0594[_0x3745('0x17')](0x194);}return _0x54ba29;};}function handleError(_0x2be5a8,_0x3372ec){_0x3372ec=_0x3372ec||0x1f4;return function(_0x7e01b4){logger[_0x3745('0x25')](_0x7e01b4[_0x3745('0x26')]);if(_0x7e01b4[_0x3745('0x27')]){delete _0x7e01b4[_0x3745('0x27')];}_0x2be5a8[_0x3745('0x18')](_0x3372ec)[_0x3745('0x28')](_0x7e01b4);};}exports[_0x3745('0x29')]=function(_0x4a09bc,_0xf29943){var _0x54ce29={},_0x4c4f05={},_0x1b0cd1={'count':0x0,'rows':[]};var _0x185664=_[_0x3745('0x2a')](db[_0x3745('0x2b')][_0x3745('0x2c')],function(_0x3f613d){return{'name':_0x3f613d[_0x3745('0x2d')],'type':_0x3f613d[_0x3745('0x2e')][_0x3745('0x2f')]};});_0x4c4f05[_0x3745('0x30')]=_[_0x3745('0x2a')](_0x185664,'name');_0x4c4f05[_0x3745('0x31')]=_[_0x3745('0x32')](_0x4a09bc[_0x3745('0x31')]);_0x4c4f05['filters']=_[_0x3745('0x33')](_0x4c4f05[_0x3745('0x30')],_0x4c4f05[_0x3745('0x31')]);_0x54ce29[_0x3745('0x34')]=_[_0x3745('0x33')](_0x4c4f05[_0x3745('0x30')],qs['fields'](_0x4a09bc[_0x3745('0x31')][_0x3745('0x35')]));_0x54ce29[_0x3745('0x34')]=_0x54ce29['attributes'][_0x3745('0x36')]?_0x54ce29['attributes']:_0x4c4f05[_0x3745('0x30')];if(!_0x4a09bc[_0x3745('0x31')][_0x3745('0x37')](_0x3745('0x38'))){_0x54ce29[_0x3745('0x1a')]=qs[_0x3745('0x1a')](_0x4a09bc[_0x3745('0x31')][_0x3745('0x1a')]);_0x54ce29[_0x3745('0x1d')]=qs[_0x3745('0x1d')](_0x4a09bc[_0x3745('0x31')]['offset']);}_0x54ce29[_0x3745('0x39')]=qs[_0x3745('0x3a')](_0x4a09bc[_0x3745('0x31')][_0x3745('0x3a')]);_0x54ce29[_0x3745('0x3b')]=qs[_0x3745('0x3c')](_[_0x3745('0x3d')](_0x4a09bc[_0x3745('0x31')],_0x4c4f05[_0x3745('0x3c')]),_0x185664);if(_0x4a09bc[_0x3745('0x31')][_0x3745('0x3e')]){_0x54ce29[_0x3745('0x3b')]=_[_0x3745('0x3f')](_0x54ce29['where'],{'$or':_[_0x3745('0x2a')](_0x185664,function(_0x51c624){if(_0x51c624['type']!==_0x3745('0x40')){var _0x7336b6={};_0x7336b6[_0x51c624[_0x3745('0x27')]]={'$like':'%'+_0x4a09bc['query'][_0x3745('0x3e')]+'%'};return _0x7336b6;}})});}_0x54ce29=_['merge']({},_0x54ce29,_0x4a09bc[_0x3745('0x41')]);var _0xf94e8={'where':_0x54ce29[_0x3745('0x3b')]};return db[_0x3745('0x2b')]['count'](_0xf94e8)[_0x3745('0x24')](function(_0x1ca361){_0x1b0cd1['count']=_0x1ca361;if(_0x4a09bc[_0x3745('0x31')][_0x3745('0x42')]){_0x54ce29[_0x3745('0x43')]=[{'all':!![]}];}return db[_0x3745('0x2b')][_0x3745('0x44')](_0x54ce29);})[_0x3745('0x24')](function(_0x62e1d4){_0x1b0cd1[_0x3745('0x45')]=_0x62e1d4;return _0x1b0cd1;})['then'](respondWithFilteredResult(_0xf29943,_0x54ce29))[_0x3745('0x46')](handleError(_0xf29943,null));};exports[_0x3745('0x47')]=function(_0x2a40b6,_0x5904b9){var _0x2ae85b={'raw':!![],'where':{'id':_0x2a40b6[_0x3745('0x48')]['id']}},_0x10dac7={};_0x10dac7[_0x3745('0x30')]=_[_0x3745('0x32')](db[_0x3745('0x2b')][_0x3745('0x2c')]);_0x10dac7[_0x3745('0x31')]=_[_0x3745('0x32')](_0x2a40b6[_0x3745('0x31')]);_0x10dac7[_0x3745('0x3c')]=_['intersection'](_0x10dac7['model'],_0x10dac7[_0x3745('0x31')]);_0x2ae85b[_0x3745('0x34')]=_['intersection'](_0x10dac7[_0x3745('0x30')],qs['fields'](_0x2a40b6[_0x3745('0x31')][_0x3745('0x35')]));_0x2ae85b[_0x3745('0x34')]=_0x2ae85b[_0x3745('0x34')][_0x3745('0x36')]?_0x2ae85b[_0x3745('0x34')]:_0x10dac7[_0x3745('0x30')];if(_0x2a40b6[_0x3745('0x31')][_0x3745('0x42')]){_0x2ae85b[_0x3745('0x43')]=[{'all':!![]}];}_0x2ae85b=_[_0x3745('0x3f')]({},_0x2ae85b,_0x2a40b6['options']);return db[_0x3745('0x2b')]['find'](_0x2ae85b)[_0x3745('0x24')](handleEntityNotFound(_0x5904b9,null))[_0x3745('0x24')](respondWithResult(_0x5904b9,null))['catch'](handleError(_0x5904b9,null));};exports['create']=function(_0x591849,_0x95a15d){return db[_0x3745('0x2b')][_0x3745('0x49')](_0x591849[_0x3745('0x4a')],{})[_0x3745('0x24')](respondWithResult(_0x95a15d,0xc9))[_0x3745('0x46')](handleError(_0x95a15d,null));};exports[_0x3745('0x4b')]=function(_0x3ab533,_0x306813){if(_0x3ab533[_0x3745('0x4a')]['id']){delete _0x3ab533[_0x3745('0x4a')]['id'];}return db[_0x3745('0x2b')][_0x3745('0x4c')]({'where':{'id':_0x3ab533[_0x3745('0x48')]['id']}})[_0x3745('0x24')](handleEntityNotFound(_0x306813,null))['then'](saveUpdates(_0x3ab533[_0x3745('0x4a')],null))[_0x3745('0x24')](respondWithResult(_0x306813,null))[_0x3745('0x46')](handleError(_0x306813,null));};exports[_0x3745('0x23')]=function(_0x122fa5,_0xa390b3){return db[_0x3745('0x2b')][_0x3745('0x4c')]({'where':{'id':_0x122fa5['params']['id']}})[_0x3745('0x24')](handleEntityNotFound(_0xa390b3,null))[_0x3745('0x24')](removeEntity(_0xa390b3,null))[_0x3745('0x46')](handleError(_0xa390b3,null));}; \ No newline at end of file +var _0x85a5=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','show','find','create','body','update','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x85a5,0x88));var _0x585a=function(_0x4b352f,_0x2c3ac1){_0x4b352f=_0x4b352f-0x0;var _0xb78495=_0x85a5[_0x4b352f];return _0xb78495;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x585a('0x0'));var zipdir=require(_0x585a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x585a('0x2'));var BPromise=require(_0x585a('0x3'));var Mustache=require(_0x585a('0x4'));var util=require(_0x585a('0x5'));var path=require(_0x585a('0x6'));var sox=require(_0x585a('0x7'));var csv=require(_0x585a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x585a('0x9'));var _=require(_0x585a('0xa'));var squel=require(_0x585a('0xb'));var crypto=require(_0x585a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x585a('0xd'));var toCsv=require(_0x585a('0x8'));var querystring=require(_0x585a('0xe'));var Papa=require(_0x585a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x585a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x585a('0x11'));var logger=require(_0x585a('0x12'))(_0x585a('0x13'));var utils=require(_0x585a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x585a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2885bb,_0x2591dd){_0x2591dd=_0x2591dd||0xcc;return function(_0x188199){if(_0x188199){return _0x2885bb[_0x585a('0x16')](_0x2591dd);}return _0x2885bb[_0x585a('0x17')](_0x2591dd)[_0x585a('0x18')]();};}function respondWithResult(_0x4674ec,_0x3617c2){_0x3617c2=_0x3617c2||0xc8;return function(_0x522c90){if(_0x522c90){return _0x4674ec[_0x585a('0x17')](_0x3617c2)[_0x585a('0x19')](_0x522c90);}};}function respondWithFilteredResult(_0x1c2f99,_0x5ee5ad){return function(_0x5a3c72){if(_0x5a3c72){var _0x4e0023=typeof _0x5ee5ad[_0x585a('0x1a')]==='undefined'&&typeof _0x5ee5ad[_0x585a('0x1b')]==='undefined';var _0x4eda4b=_0x5a3c72[_0x585a('0x1c')];var _0x16d2a5=_0x4e0023?0x0:_0x5ee5ad['offset'];var _0x2f5046=_0x4e0023?_0x5a3c72[_0x585a('0x1c')]:_0x5ee5ad['offset']+_0x5ee5ad[_0x585a('0x1b')];var _0x4daed1;if(_0x2f5046>=_0x4eda4b){_0x2f5046=_0x4eda4b;_0x4daed1=0xc8;}else{_0x4daed1=0xce;}_0x1c2f99[_0x585a('0x17')](_0x4daed1);return _0x1c2f99[_0x585a('0x1d')](_0x585a('0x1e'),_0x16d2a5+'-'+_0x2f5046+'/'+_0x4eda4b)[_0x585a('0x19')](_0x5a3c72);}return null;};}function patchUpdates(_0x5db316){return function(_0x1e0773){try{jsonpatch['apply'](_0x1e0773,_0x5db316,!![]);}catch(_0x755ee4){return BPromise[_0x585a('0x1f')](_0x755ee4);}return _0x1e0773[_0x585a('0x20')]();};}function saveUpdates(_0x49934e,_0x6fa7fb){return function(_0x397416){if(_0x397416){return _0x397416['update'](_0x49934e)[_0x585a('0x21')](function(_0x2f60ac){return _0x2f60ac;});}return null;};}function removeEntity(_0x1782da,_0x58d2a8){return function(_0x4c9775){if(_0x4c9775){return _0x4c9775[_0x585a('0x22')]()['then'](function(){_0x1782da[_0x585a('0x17')](0xcc)[_0x585a('0x18')]();});}};}function handleEntityNotFound(_0x29d840,_0x53759b){return function(_0x3903af){if(!_0x3903af){_0x29d840[_0x585a('0x16')](0x194);}return _0x3903af;};}function handleError(_0x3222d7,_0x34cbcf){_0x34cbcf=_0x34cbcf||0x1f4;return function(_0x5b8858){logger[_0x585a('0x23')](_0x5b8858[_0x585a('0x24')]);if(_0x5b8858[_0x585a('0x25')]){delete _0x5b8858[_0x585a('0x25')];}_0x3222d7['status'](_0x34cbcf)[_0x585a('0x26')](_0x5b8858);};}exports['index']=function(_0x15ae3e,_0x282093){var _0x3dfcaf={},_0x109067={},_0x380ce1={'count':0x0,'rows':[]};var _0x124516=_[_0x585a('0x27')](db['FreshsalesField'][_0x585a('0x28')],function(_0x30715e){return{'name':_0x30715e[_0x585a('0x29')],'type':_0x30715e['type'][_0x585a('0x2a')]};});_0x109067[_0x585a('0x2b')]=_['map'](_0x124516,_0x585a('0x25'));_0x109067[_0x585a('0x2c')]=_[_0x585a('0x2d')](_0x15ae3e[_0x585a('0x2c')]);_0x109067[_0x585a('0x2e')]=_[_0x585a('0x2f')](_0x109067[_0x585a('0x2b')],_0x109067['query']);_0x3dfcaf['attributes']=_[_0x585a('0x2f')](_0x109067['model'],qs[_0x585a('0x30')](_0x15ae3e['query'][_0x585a('0x30')]));_0x3dfcaf['attributes']=_0x3dfcaf[_0x585a('0x31')][_0x585a('0x32')]?_0x3dfcaf['attributes']:_0x109067[_0x585a('0x2b')];if(!_0x15ae3e[_0x585a('0x2c')][_0x585a('0x33')](_0x585a('0x34'))){_0x3dfcaf['limit']=qs['limit'](_0x15ae3e[_0x585a('0x2c')][_0x585a('0x1b')]);_0x3dfcaf['offset']=qs[_0x585a('0x1a')](_0x15ae3e[_0x585a('0x2c')][_0x585a('0x1a')]);}_0x3dfcaf[_0x585a('0x35')]=qs[_0x585a('0x36')](_0x15ae3e[_0x585a('0x2c')]['sort']);_0x3dfcaf[_0x585a('0x37')]=qs[_0x585a('0x2e')](_[_0x585a('0x38')](_0x15ae3e['query'],_0x109067['filters']),_0x124516);if(_0x15ae3e[_0x585a('0x2c')][_0x585a('0x39')]){_0x3dfcaf[_0x585a('0x37')]=_[_0x585a('0x3a')](_0x3dfcaf[_0x585a('0x37')],{'$or':_[_0x585a('0x27')](_0x124516,function(_0x180b4b){if(_0x180b4b[_0x585a('0x3b')]!==_0x585a('0x3c')){var _0x1b883f={};_0x1b883f[_0x180b4b[_0x585a('0x25')]]={'$like':'%'+_0x15ae3e['query'][_0x585a('0x39')]+'%'};return _0x1b883f;}})});}_0x3dfcaf=_[_0x585a('0x3a')]({},_0x3dfcaf,_0x15ae3e[_0x585a('0x3d')]);var _0x9b0930={'where':_0x3dfcaf[_0x585a('0x37')]};return db[_0x585a('0x3e')][_0x585a('0x1c')](_0x9b0930)[_0x585a('0x21')](function(_0xbe9ec7){_0x380ce1[_0x585a('0x1c')]=_0xbe9ec7;if(_0x15ae3e['query'][_0x585a('0x3f')]){_0x3dfcaf['include']=[{'all':!![]}];}return db[_0x585a('0x3e')][_0x585a('0x40')](_0x3dfcaf);})['then'](function(_0x14d42d){_0x380ce1[_0x585a('0x41')]=_0x14d42d;return _0x380ce1;})[_0x585a('0x21')](respondWithFilteredResult(_0x282093,_0x3dfcaf))[_0x585a('0x42')](handleError(_0x282093,null));};exports[_0x585a('0x43')]=function(_0x1ec5ba,_0x6962ae){var _0x283445={'raw':!![],'where':{'id':_0x1ec5ba['params']['id']}},_0x4ac405={};_0x4ac405[_0x585a('0x2b')]=_['keys'](db[_0x585a('0x3e')][_0x585a('0x28')]);_0x4ac405[_0x585a('0x2c')]=_[_0x585a('0x2d')](_0x1ec5ba[_0x585a('0x2c')]);_0x4ac405[_0x585a('0x2e')]=_[_0x585a('0x2f')](_0x4ac405[_0x585a('0x2b')],_0x4ac405[_0x585a('0x2c')]);_0x283445[_0x585a('0x31')]=_[_0x585a('0x2f')](_0x4ac405[_0x585a('0x2b')],qs[_0x585a('0x30')](_0x1ec5ba[_0x585a('0x2c')]['fields']));_0x283445[_0x585a('0x31')]=_0x283445['attributes'][_0x585a('0x32')]?_0x283445['attributes']:_0x4ac405['model'];if(_0x1ec5ba[_0x585a('0x2c')]['includeAll']){_0x283445['include']=[{'all':!![]}];}_0x283445=_[_0x585a('0x3a')]({},_0x283445,_0x1ec5ba[_0x585a('0x3d')]);return db[_0x585a('0x3e')][_0x585a('0x44')](_0x283445)['then'](handleEntityNotFound(_0x6962ae,null))[_0x585a('0x21')](respondWithResult(_0x6962ae,null))['catch'](handleError(_0x6962ae,null));};exports[_0x585a('0x45')]=function(_0x488e6c,_0x1af66c){return db['FreshsalesField'][_0x585a('0x45')](_0x488e6c[_0x585a('0x46')],{})['then'](respondWithResult(_0x1af66c,0xc9))[_0x585a('0x42')](handleError(_0x1af66c,null));};exports[_0x585a('0x47')]=function(_0x5302b5,_0x3242a9){if(_0x5302b5['body']['id']){delete _0x5302b5[_0x585a('0x46')]['id'];}return db[_0x585a('0x3e')]['find']({'where':{'id':_0x5302b5[_0x585a('0x48')]['id']}})[_0x585a('0x21')](handleEntityNotFound(_0x3242a9,null))['then'](saveUpdates(_0x5302b5['body'],null))[_0x585a('0x21')](respondWithResult(_0x3242a9,null))['catch'](handleError(_0x3242a9,null));};exports[_0x585a('0x22')]=function(_0x32a584,_0x59384a){return db[_0x585a('0x3e')][_0x585a('0x44')]({'where':{'id':_0x32a584['params']['id']}})[_0x585a('0x21')](handleEntityNotFound(_0x59384a,null))[_0x585a('0x21')](removeEntity(_0x59384a,null))[_0x585a('0x42')](handleError(_0x59384a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5dc5d21..32356e0 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 _0xbbbc=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x504635,_0x38d186){_0x504635=_0x504635-0x0;var _0x166e99=_0xbbbc[_0x504635];return _0x166e99;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[{'name':_0xcbbb('0xe'),'fields':[_0xcbbb('0xf'),_0xcbbb('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7269=['idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x241d45,_0x1d62ba){var _0x145c87=function(_0x36463d){while(--_0x36463d){_0x241d45['push'](_0x241d45['shift']());}};_0x145c87(++_0x1d62ba);}(_0x7269,0x76));var _0x9726=function(_0x41a1c8,_0x2b88c3){_0x41a1c8=_0x41a1c8-0x0;var _0x36a628=_0x7269[_0x41a1c8];return _0x36a628;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var logger=require(_0x9726('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9726('0x3'));var rp=require(_0x9726('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var attributes=require(_0x9726('0x7'));module[_0x9726('0x8')]=function(_0x795889,_0x832cb){return _0x795889[_0x9726('0x9')](_0x9726('0xa'),attributes,{'tableName':_0x9726('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9726('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 1045d51..ae4c0b4 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 _0x7a54=['info','FreshsalesField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb65f,_0x53b347){_0x5bb65f=_0x5bb65f-0x0;var _0x1fe5d2=_0x7a54[_0x5bb65f];return _0x1fe5d2;};'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')]('FreshsalesField,\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 _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x30d39f,_0x1ea039){var _0x1f17dd=function(_0xb150d){while(--_0xb150d){_0x30d39f['push'](_0x30d39f['shift']());}};_0x1f17dd(++_0x1ea039);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d7bbd9b..2417b9d 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(_0x18f3cb,_0x599477){var _0x273d11=function(_0x422710){while(--_0x422710){_0x18f3cb['push'](_0x18f3cb['shift']());}};_0x273d11(++_0x599477);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x1ff6a7,_0x15a671){var _0x2decad=function(_0x3caf83){while(--_0x3caf83){_0x1ff6a7['push'](_0x1ff6a7['shift']());}};_0x2decad(++_0x15a671);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d828940..a278f89 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 _0x3014=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x5c8874,_0x5264bd){var _0x64aa05=function(_0x579485){while(--_0x579485){_0x5c8874['push'](_0x5c8874['shift']());}};_0x64aa05(++_0x5264bd);}(_0x3014,0x1d7));var _0x4301=function(_0x3941d0,_0xaf51eb){_0x3941d0=_0x3941d0-0x0;var _0x2681d4=_0x3014[_0x3941d0];return _0x2681d4;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4301('0x2')]},'username':{'type':Sequelize[_0x4301('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4301('0x2')]},'clientId':{'type':Sequelize[_0x4301('0x2')]},'clientSecret':{'type':Sequelize[_0x4301('0x2')]},'securityToken':{'type':Sequelize[_0x4301('0x2')]},'serverUrl':{'type':Sequelize[_0x4301('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4301('0x3')](_0x4301('0x4'),_0x4301('0x5')),'defaultValue':_0x4301('0x4')}}; \ No newline at end of file +var _0x99e7=['username','integrationTab','sequelize','exports','STRING'];(function(_0x8d65d2,_0x17511d){var _0x109850=function(_0x2a1d84){while(--_0x2a1d84){_0x8d65d2['push'](_0x8d65d2['shift']());}};_0x109850(++_0x17511d);}(_0x99e7,0x1b5));var _0x799e=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x99e7[_0x50e40b];return _0x2608b7;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')]},'description':{'type':Sequelize[_0x799e('0x2')]},'username':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3')},'remoteUri':{'type':Sequelize[_0x799e('0x2')]},'password':{'type':Sequelize[_0x799e('0x2')]},'clientId':{'type':Sequelize[_0x799e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x799e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x799e('0x4'),'newTab'),'defaultValue':_0x799e('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3a528d5..2df5d79 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 _0x5b83=['getDescriptions','SalesforceField','Task','clientId','clientSecret','username','securityToken','slice','lastIndexOf','Connection','login','password','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0x5b83,0x12c));var _0x35b8=function(_0x3408b0,_0x1c6812){_0x3408b0=_0x3408b0-0x0;var _0x2056ea=_0x5b83[_0x3408b0];return _0x2056ea;};'use strict';var emlformat=require(_0x35b8('0x0'));var rimraf=require(_0x35b8('0x1'));var zipdir=require(_0x35b8('0x2'));var jsonpatch=require(_0x35b8('0x3'));var rp=require(_0x35b8('0x4'));var moment=require(_0x35b8('0x5'));var BPromise=require(_0x35b8('0x6'));var Mustache=require(_0x35b8('0x7'));var util=require(_0x35b8('0x8'));var path=require(_0x35b8('0x9'));var sox=require(_0x35b8('0xa'));var csv=require('to-csv');var ejs=require(_0x35b8('0xb'));var fs=require('fs');var fs_extra=require(_0x35b8('0xc'));var _=require(_0x35b8('0xd'));var squel=require('squel');var crypto=require(_0x35b8('0xe'));var jsforce=require(_0x35b8('0xf'));var deskjs=require(_0x35b8('0x10'));var toCsv=require(_0x35b8('0x11'));var querystring=require(_0x35b8('0x12'));var Papa=require(_0x35b8('0x13'));var Redis=require(_0x35b8('0x14'));var authService=require(_0x35b8('0x15'));var qs=require(_0x35b8('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35b8('0x17'));var logger=require(_0x35b8('0x18'))(_0x35b8('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35b8('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x35b8('0x1b'));function respondWithStatusCode(_0x5e06ed,_0x161a81){_0x161a81=_0x161a81||0xcc;return function(_0x1f67d4){if(_0x1f67d4){return _0x5e06ed[_0x35b8('0x1c')](_0x161a81);}return _0x5e06ed['status'](_0x161a81)[_0x35b8('0x1d')]();};}function respondWithResult(_0x59f367,_0x144c76){_0x144c76=_0x144c76||0xc8;return function(_0x1e2190){if(_0x1e2190){return _0x59f367[_0x35b8('0x1e')](_0x144c76)[_0x35b8('0x1f')](_0x1e2190);}};}function respondWithFilteredResult(_0x3d8f71,_0x482b24){return function(_0x34653c){if(_0x34653c){var _0x4b13e3=typeof _0x482b24[_0x35b8('0x20')]==='undefined'&&typeof _0x482b24[_0x35b8('0x21')]===_0x35b8('0x22');var _0x1afecb=_0x34653c[_0x35b8('0x23')];var _0x463fa9=_0x4b13e3?0x0:_0x482b24['offset'];var _0x338c1e=_0x4b13e3?_0x34653c[_0x35b8('0x23')]:_0x482b24[_0x35b8('0x20')]+_0x482b24[_0x35b8('0x21')];var _0x2af6b5;if(_0x338c1e>=_0x1afecb){_0x338c1e=_0x1afecb;_0x2af6b5=0xc8;}else{_0x2af6b5=0xce;}_0x3d8f71[_0x35b8('0x1e')](_0x2af6b5);return _0x3d8f71[_0x35b8('0x24')]('Content-Range',_0x463fa9+'-'+_0x338c1e+'/'+_0x1afecb)[_0x35b8('0x1f')](_0x34653c);}return null;};}function patchUpdates(_0x2757a3){return function(_0xc873cb){try{jsonpatch[_0x35b8('0x25')](_0xc873cb,_0x2757a3,!![]);}catch(_0x2393e8){return BPromise[_0x35b8('0x26')](_0x2393e8);}return _0xc873cb[_0x35b8('0x27')]();};}function saveUpdates(_0x239007,_0x4784a1){return function(_0x449acb){if(_0x449acb){return _0x449acb[_0x35b8('0x28')](_0x239007)[_0x35b8('0x29')](function(_0x266df0){return _0x266df0;});}return null;};}function removeEntity(_0x2fba7c,_0x1bddbf){return function(_0x9a29a8){if(_0x9a29a8){return _0x9a29a8['destroy']()[_0x35b8('0x29')](function(){_0x2fba7c['status'](0xcc)[_0x35b8('0x1d')]();});}};}function handleEntityNotFound(_0x4c20c0,_0x204cc3){return function(_0x4c5b95){if(!_0x4c5b95){_0x4c20c0[_0x35b8('0x1c')](0x194);}return _0x4c5b95;};}function handleError(_0x3d0175,_0x5cdb63){_0x5cdb63=_0x5cdb63||0x1f4;return function(_0x1a3625){logger[_0x35b8('0x2a')](_0x1a3625[_0x35b8('0x2b')]);if(_0x1a3625[_0x35b8('0x2c')]){delete _0x1a3625[_0x35b8('0x2c')];}_0x3d0175[_0x35b8('0x1e')](_0x5cdb63)[_0x35b8('0x2d')](_0x1a3625);};}exports[_0x35b8('0x2e')]=function(_0x21011b,_0x2c5283){var _0x2fd8bc={},_0x16e6d1={},_0x2c44ca={'count':0x0,'rows':[]};var _0x2bc61b=_[_0x35b8('0x2f')](db[_0x35b8('0x30')][_0x35b8('0x31')],function(_0x59db98){return{'name':_0x59db98[_0x35b8('0x32')],'type':_0x59db98[_0x35b8('0x33')][_0x35b8('0x34')]};});_0x16e6d1[_0x35b8('0x35')]=_[_0x35b8('0x2f')](_0x2bc61b,_0x35b8('0x2c'));_0x16e6d1['query']=_['keys'](_0x21011b['query']);_0x16e6d1[_0x35b8('0x36')]=_[_0x35b8('0x37')](_0x16e6d1[_0x35b8('0x35')],_0x16e6d1[_0x35b8('0x38')]);_0x2fd8bc[_0x35b8('0x39')]=_[_0x35b8('0x37')](_0x16e6d1['model'],qs[_0x35b8('0x3a')](_0x21011b['query'][_0x35b8('0x3a')]));_0x2fd8bc[_0x35b8('0x39')]=_0x2fd8bc[_0x35b8('0x39')]['length']?_0x2fd8bc['attributes']:_0x16e6d1['model'];if(!_0x21011b[_0x35b8('0x38')][_0x35b8('0x3b')](_0x35b8('0x3c'))){_0x2fd8bc[_0x35b8('0x21')]=qs[_0x35b8('0x21')](_0x21011b['query'][_0x35b8('0x21')]);_0x2fd8bc[_0x35b8('0x20')]=qs['offset'](_0x21011b[_0x35b8('0x38')]['offset']);}_0x2fd8bc[_0x35b8('0x3d')]=qs['sort'](_0x21011b[_0x35b8('0x38')][_0x35b8('0x3e')]);_0x2fd8bc[_0x35b8('0x3f')]=qs[_0x35b8('0x36')](_[_0x35b8('0x40')](_0x21011b[_0x35b8('0x38')],_0x16e6d1['filters']),_0x2bc61b);if(_0x21011b[_0x35b8('0x38')][_0x35b8('0x41')]){_0x2fd8bc[_0x35b8('0x3f')]=_[_0x35b8('0x42')](_0x2fd8bc[_0x35b8('0x3f')],{'$or':_[_0x35b8('0x2f')](_0x2bc61b,function(_0x343162){if(_0x343162['type']!==_0x35b8('0x43')){var _0x50003e={};_0x50003e[_0x343162[_0x35b8('0x2c')]]={'$like':'%'+_0x21011b[_0x35b8('0x38')]['filter']+'%'};return _0x50003e;}})});}_0x2fd8bc=_[_0x35b8('0x42')]({},_0x2fd8bc,_0x21011b[_0x35b8('0x44')]);var _0x16e516={'where':_0x2fd8bc['where']};return db['SalesforceAccount'][_0x35b8('0x23')](_0x16e516)['then'](function(_0x58a06c){_0x2c44ca[_0x35b8('0x23')]=_0x58a06c;if(_0x21011b[_0x35b8('0x38')]['includeAll']){_0x2fd8bc[_0x35b8('0x45')]=[{'all':!![]}];}return db[_0x35b8('0x30')][_0x35b8('0x46')](_0x2fd8bc);})[_0x35b8('0x29')](function(_0x5cffe2){_0x2c44ca[_0x35b8('0x47')]=_0x5cffe2;return _0x2c44ca;})[_0x35b8('0x29')](respondWithFilteredResult(_0x2c5283,_0x2fd8bc))[_0x35b8('0x48')](handleError(_0x2c5283,null));};exports[_0x35b8('0x49')]=function(_0x4fa753,_0x1428f2){var _0x4ff5a1={'raw':![],'where':{'id':_0x4fa753['params']['id']}},_0xa1f01e={};_0xa1f01e[_0x35b8('0x35')]=_[_0x35b8('0x4a')](db[_0x35b8('0x30')][_0x35b8('0x31')]);_0xa1f01e[_0x35b8('0x38')]=_[_0x35b8('0x4a')](_0x4fa753[_0x35b8('0x38')]);_0xa1f01e[_0x35b8('0x36')]=_['intersection'](_0xa1f01e[_0x35b8('0x35')],_0xa1f01e[_0x35b8('0x38')]);_0x4ff5a1[_0x35b8('0x39')]=_[_0x35b8('0x37')](_0xa1f01e[_0x35b8('0x35')],qs[_0x35b8('0x3a')](_0x4fa753[_0x35b8('0x38')][_0x35b8('0x3a')]));_0x4ff5a1[_0x35b8('0x39')]=_0x4ff5a1[_0x35b8('0x39')][_0x35b8('0x4b')]?_0x4ff5a1[_0x35b8('0x39')]:_0xa1f01e[_0x35b8('0x35')];if(_0x4fa753['query'][_0x35b8('0x4c')]){_0x4ff5a1[_0x35b8('0x45')]=[{'all':!![]}];}_0x4ff5a1=_[_0x35b8('0x42')]({},_0x4ff5a1,_0x4fa753[_0x35b8('0x44')]);return db['SalesforceAccount'][_0x35b8('0x4d')](_0x4ff5a1)[_0x35b8('0x29')](handleEntityNotFound(_0x1428f2,null))[_0x35b8('0x29')](respondWithResult(_0x1428f2,null))[_0x35b8('0x48')](handleError(_0x1428f2,null));};exports[_0x35b8('0x4e')]=function(_0x21cef,_0x270dbe){return db[_0x35b8('0x30')][_0x35b8('0x4e')](_0x21cef[_0x35b8('0x4f')],{})[_0x35b8('0x29')](respondWithResult(_0x270dbe,0xc9))['catch'](handleError(_0x270dbe,null));};exports[_0x35b8('0x28')]=function(_0x5da898,_0x1208db){if(_0x5da898['body']['id']){delete _0x5da898[_0x35b8('0x4f')]['id'];}return db[_0x35b8('0x30')][_0x35b8('0x4d')]({'where':{'id':_0x5da898['params']['id']}})['then'](handleEntityNotFound(_0x1208db,null))[_0x35b8('0x29')](saveUpdates(_0x5da898[_0x35b8('0x4f')],null))[_0x35b8('0x29')](respondWithResult(_0x1208db,null))[_0x35b8('0x48')](handleError(_0x1208db,null));};exports['destroy']=function(_0x1c835f,_0x1cd2a1){return db[_0x35b8('0x30')]['find']({'where':{'id':_0x1c835f[_0x35b8('0x50')]['id']}})[_0x35b8('0x29')](handleEntityNotFound(_0x1cd2a1,null))[_0x35b8('0x29')](removeEntity(_0x1cd2a1,null))[_0x35b8('0x48')](handleError(_0x1cd2a1,null));};exports['getConfigurations']=function(_0x194147,_0x3b3397,_0x148e58){var _0x59f5ef={};var _0x59debd={};var _0xadad55;var _0x3b9138;return db['SalesforceAccount'][_0x35b8('0x51')]({'where':{'id':_0x194147[_0x35b8('0x50')]['id']}})[_0x35b8('0x29')](handleEntityNotFound(_0x3b3397,null))[_0x35b8('0x29')](function(_0xc13ab){if(_0xc13ab){_0xadad55=_0xc13ab;_0x59debd[_0x35b8('0x35')]=_['keys'](db[_0x35b8('0x52')][_0x35b8('0x31')]);_0x59debd[_0x35b8('0x38')]=_[_0x35b8('0x4a')](_0x194147['query']);_0x59debd['filters']=_[_0x35b8('0x37')](_0x59debd[_0x35b8('0x35')],_0x59debd[_0x35b8('0x38')]);_0x59f5ef[_0x35b8('0x39')]=_[_0x35b8('0x37')](_0x59debd[_0x35b8('0x35')],qs[_0x35b8('0x3a')](_0x194147['query']['fields']));_0x59f5ef['attributes']=_0x59f5ef[_0x35b8('0x39')]['length']?_0x59f5ef[_0x35b8('0x39')]:_0x59debd[_0x35b8('0x35')];_0x59f5ef[_0x35b8('0x3d')]=qs['sort'](_0x194147[_0x35b8('0x38')][_0x35b8('0x3e')]);_0x59f5ef[_0x35b8('0x3f')]=qs[_0x35b8('0x36')](_[_0x35b8('0x40')](_0x194147[_0x35b8('0x38')],_0x59debd[_0x35b8('0x36')]));if(_0x194147['query'][_0x35b8('0x41')]){_0x59f5ef[_0x35b8('0x3f')]=_[_0x35b8('0x42')](_0x59f5ef['where'],{'$or':_[_0x35b8('0x2f')](_0x59f5ef[_0x35b8('0x39')],function(_0x21989d){var _0x559c46={};_0x559c46[_0x21989d]={'$like':'%'+_0x194147['query'][_0x35b8('0x41')]+'%'};return _0x559c46;})});}_0x59f5ef=_[_0x35b8('0x42')]({},_0x59f5ef,_0x194147[_0x35b8('0x44')]);return _0xadad55[_0x35b8('0x53')](_0x59f5ef);}})['then'](function(_0xb05577){if(_0xb05577){_0x3b9138=_0xb05577[_0x35b8('0x4b')];if(!_0x194147[_0x35b8('0x38')][_0x35b8('0x3b')](_0x35b8('0x3c'))){_0x59f5ef[_0x35b8('0x21')]=qs[_0x35b8('0x21')](_0x194147[_0x35b8('0x38')][_0x35b8('0x21')]);_0x59f5ef[_0x35b8('0x20')]=qs['offset'](_0x194147[_0x35b8('0x38')][_0x35b8('0x20')]);}return _0xadad55[_0x35b8('0x53')](_0x59f5ef);}})[_0x35b8('0x29')](function(_0x544217){if(_0x544217){return _0x544217?{'count':_0x3b9138,'rows':_0x544217}:null;}})[_0x35b8('0x29')](respondWithResult(_0x3b3397,null))[_0x35b8('0x48')](handleError(_0x3b3397,null));};exports[_0x35b8('0x54')]=function(_0x124e0e,_0x5275c6,_0x385811){if(_0x124e0e[_0x35b8('0x4f')]['id']){delete _0x124e0e[_0x35b8('0x4f')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x124e0e[_0x35b8('0x50')]['id']}})[_0x35b8('0x29')](handleEntityNotFound(_0x5275c6,null))['then'](function(_0xfb92b8){if(_0xfb92b8){_0x124e0e[_0x35b8('0x4f')][_0x35b8('0x55')]=_0xfb92b8['id'];_0x124e0e[_0x35b8('0x4f')][_0x35b8('0x56')]=integrations[_0x35b8('0x57')](_0x124e0e[_0x35b8('0x4f')][_0x35b8('0x58')],_0x124e0e['body'][_0x35b8('0x33')]);_0x124e0e['body'][_0x35b8('0x59')]=integrations[_0x35b8('0x5a')](_0x124e0e[_0x35b8('0x4f')][_0x35b8('0x58')],_0x124e0e[_0x35b8('0x4f')]['type']);return db[_0x35b8('0x52')]['create'](_0x124e0e[_0x35b8('0x4f')],{'include':[{'model':db['SalesforceField'],'as':_0x35b8('0x56')},{'model':db[_0x35b8('0x5b')],'as':_0x35b8('0x59')}]});}return null;})[_0x35b8('0x29')](respondWithResult(_0x5275c6,null))[_0x35b8('0x48')](handleError(_0x5275c6,null));};exports['getFields']=function(_0x2544e1,_0x288f59,_0xecb9b){var _0x42f188;var _0x579bfe='';var _0x59f886=_0x35b8('0x5c');return db[_0x35b8('0x30')][_0x35b8('0x51')]({'where':{'id':_0x2544e1[_0x35b8('0x50')]['id']},'attributes':['id','remoteUri',_0x35b8('0x5d'),_0x35b8('0x5e'),_0x35b8('0x5f'),'password',_0x35b8('0x60')]})[_0x35b8('0x29')](handleEntityNotFound(_0x288f59,null))[_0x35b8('0x29')](function(_0x56c02c){if(_0x56c02c){_0x579bfe=_0x56c02c['remoteUri'];var _0x3353ec=_0x579bfe[_0x35b8('0x61')](-0x1);if(_0x3353ec==='/'){_0x579bfe=_0x579bfe['substring'](0x0,_0x579bfe[_0x35b8('0x62')](_0x3353ec));}_0x42f188=new jsforce[(_0x35b8('0x63'))]({'oauth2':{'loginUrl':_0x579bfe,'clientId':_0x56c02c[_0x35b8('0x5d')],'clientSecret':_0x56c02c['clientSecret']}});return _0x42f188[_0x35b8('0x64')](_0x56c02c[_0x35b8('0x5f')],_0x56c02c[_0x35b8('0x65')][_0x35b8('0x66')](_0x56c02c[_0x35b8('0x60')]));}})[_0x35b8('0x29')](function(_0x548ac2){if(_0x548ac2){if(!_['isNil'](_0x2544e1[_0x35b8('0x38')][_0x35b8('0x67')])){_0x59f886=_0x2544e1[_0x35b8('0x38')][_0x35b8('0x67')];}return _0x42f188[_0x35b8('0x68')](_0x59f886)[_0x35b8('0x69')]();}})[_0x35b8('0x29')](function(_0x323d2f){var _0x43a4e3=[_0x35b8('0x6a'),_0x35b8('0x6b'),_0x35b8('0x6c'),'IsRecurrence','Subject',_0x35b8('0x6d')];var _0x4fa3d8=[_0x35b8('0x6e'),'int',_0x35b8('0x6f'),_0x35b8('0x70'),_0x35b8('0x71'),_0x35b8('0x72'),_0x35b8('0x73')];if(_0x323d2f){_[_0x35b8('0x74')](_0x323d2f['fields'],function(_0x505418){return _0x43a4e3[_0x35b8('0x75')](_0x505418[_0x35b8('0x2c')])||!_0x4fa3d8['includes'](_0x505418[_0x35b8('0x33')]);});return{'count':_0x323d2f[_0x35b8('0x3a')][_0x35b8('0x4b')],'rows':_[_0x35b8('0x2f')](_0x323d2f[_0x35b8('0x3a')],function(_0x318293){return{'id':_0x318293[_0x35b8('0x2c')],'name':_0x318293[_0x35b8('0x76')],'custom':_0x318293[_0x35b8('0x77')],'options':_0x318293[_0x35b8('0x78')][_0x35b8('0x4b')]>0x0?_['map'](_0x318293[_0x35b8('0x78')],function(_0x1929fd){return{'name':_0x1929fd['label'],'value':_0x1929fd[_0x35b8('0x79')]};}):_0x318293['type']==_0x35b8('0x70')?[{'name':_0x35b8('0x7a'),'value':_0x35b8('0x7b')},{'name':_0x35b8('0x7c'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x288f59,null))[_0x35b8('0x48')](function(_0x9ae31c){var _0x5b8e0b=_0x2544e1[_0x35b8('0x38')][_0x35b8('0x7d')]?0x1f4:_0x9ae31c[_0x35b8('0x7e')]||0x1f4;logger[_0x35b8('0x2a')](_0x35b8('0x7f'),_0x35b8('0x80'),_0x5b8e0b,JSON['stringify'](_0x9ae31c));delete _0x9ae31c[_0x35b8('0x2c')];if(_0x5b8e0b===0x191){_0x5b8e0b=0x190;}_0x288f59['status'](_0x5b8e0b)['send'](_0x2544e1[_0x35b8('0x38')][_0x35b8('0x7d')]?{'message':_0x35b8('0x81'),'statusCode':_0x9ae31c['statusCode']}:_0x9ae31c);});}; \ No newline at end of file +var _0x569e=['options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','length','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','lastIndexOf','Connection','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','sendStatus','error','stack','SalesforceAccount','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0x569e,0x13d));var _0xe569=function(_0x5c80c1,_0x4f80ca){_0x5c80c1=_0x5c80c1-0x0;var _0xb74ac=_0x569e[_0x5c80c1];return _0xb74ac;};'use strict';var emlformat=require(_0xe569('0x0'));var rimraf=require(_0xe569('0x1'));var zipdir=require(_0xe569('0x2'));var jsonpatch=require(_0xe569('0x3'));var rp=require(_0xe569('0x4'));var moment=require(_0xe569('0x5'));var BPromise=require(_0xe569('0x6'));var Mustache=require(_0xe569('0x7'));var util=require(_0xe569('0x8'));var path=require(_0xe569('0x9'));var sox=require(_0xe569('0xa'));var csv=require(_0xe569('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe569('0xc'));var _=require(_0xe569('0xd'));var squel=require(_0xe569('0xe'));var crypto=require('crypto');var jsforce=require(_0xe569('0xf'));var deskjs=require(_0xe569('0x10'));var toCsv=require(_0xe569('0xb'));var querystring=require(_0xe569('0x11'));var Papa=require('papaparse');var Redis=require(_0xe569('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe569('0x13'));var as=require(_0xe569('0x14'));var hardwareService=require(_0xe569('0x15'));var logger=require('../../config/logger')(_0xe569('0x16'));var utils=require(_0xe569('0x17'));var config=require(_0xe569('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xe569('0x19'));function respondWithStatusCode(_0x129b28,_0x3d22d3){_0x3d22d3=_0x3d22d3||0xcc;return function(_0x21bfad){if(_0x21bfad){return _0x129b28['sendStatus'](_0x3d22d3);}return _0x129b28[_0xe569('0x1a')](_0x3d22d3)['end']();};}function respondWithResult(_0x122a59,_0x4e4487){_0x4e4487=_0x4e4487||0xc8;return function(_0x32fa06){if(_0x32fa06){return _0x122a59[_0xe569('0x1a')](_0x4e4487)[_0xe569('0x1b')](_0x32fa06);}};}function respondWithFilteredResult(_0xa4f7f3,_0x318488){return function(_0x3d291e){if(_0x3d291e){var _0x750207=typeof _0x318488[_0xe569('0x1c')]===_0xe569('0x1d')&&typeof _0x318488[_0xe569('0x1e')]==='undefined';var _0x3e928b=_0x3d291e[_0xe569('0x1f')];var _0x282d8f=_0x750207?0x0:_0x318488[_0xe569('0x1c')];var _0xb1b5c2=_0x750207?_0x3d291e[_0xe569('0x1f')]:_0x318488[_0xe569('0x1c')]+_0x318488['limit'];var _0xdd6f1d;if(_0xb1b5c2>=_0x3e928b){_0xb1b5c2=_0x3e928b;_0xdd6f1d=0xc8;}else{_0xdd6f1d=0xce;}_0xa4f7f3[_0xe569('0x1a')](_0xdd6f1d);return _0xa4f7f3[_0xe569('0x20')]('Content-Range',_0x282d8f+'-'+_0xb1b5c2+'/'+_0x3e928b)['json'](_0x3d291e);}return null;};}function patchUpdates(_0x21d008){return function(_0x5cfe0e){try{jsonpatch[_0xe569('0x21')](_0x5cfe0e,_0x21d008,!![]);}catch(_0x4cce56){return BPromise['reject'](_0x4cce56);}return _0x5cfe0e[_0xe569('0x22')]();};}function saveUpdates(_0x50b6fd,_0x31183f){return function(_0x43b3e9){if(_0x43b3e9){return _0x43b3e9[_0xe569('0x23')](_0x50b6fd)[_0xe569('0x24')](function(_0x3460b6){return _0x3460b6;});}return null;};}function removeEntity(_0x40e4af,_0x2f6223){return function(_0xc9b063){if(_0xc9b063){return _0xc9b063[_0xe569('0x25')]()[_0xe569('0x24')](function(){_0x40e4af[_0xe569('0x1a')](0xcc)[_0xe569('0x26')]();});}};}function handleEntityNotFound(_0x2fd3cf,_0x41f42c){return function(_0x734e37){if(!_0x734e37){_0x2fd3cf[_0xe569('0x27')](0x194);}return _0x734e37;};}function handleError(_0x167dec,_0x4f22c2){_0x4f22c2=_0x4f22c2||0x1f4;return function(_0x4f4f42){logger[_0xe569('0x28')](_0x4f4f42[_0xe569('0x29')]);if(_0x4f4f42['name']){delete _0x4f4f42['name'];}_0x167dec[_0xe569('0x1a')](_0x4f22c2)['send'](_0x4f4f42);};}exports['index']=function(_0x138822,_0x15d549){var _0xfc0a22={},_0x47f99e={},_0x1d2b94={'count':0x0,'rows':[]};var _0x54195a=_['map'](db[_0xe569('0x2a')][_0xe569('0x2b')],function(_0x170d5c){return{'name':_0x170d5c[_0xe569('0x2c')],'type':_0x170d5c[_0xe569('0x2d')]['key']};});_0x47f99e[_0xe569('0x2e')]=_['map'](_0x54195a,_0xe569('0x2f'));_0x47f99e[_0xe569('0x30')]=_[_0xe569('0x31')](_0x138822[_0xe569('0x30')]);_0x47f99e['filters']=_[_0xe569('0x32')](_0x47f99e[_0xe569('0x2e')],_0x47f99e['query']);_0xfc0a22['attributes']=_[_0xe569('0x32')](_0x47f99e['model'],qs[_0xe569('0x33')](_0x138822[_0xe569('0x30')]['fields']));_0xfc0a22['attributes']=_0xfc0a22['attributes']['length']?_0xfc0a22[_0xe569('0x34')]:_0x47f99e[_0xe569('0x2e')];if(!_0x138822['query'][_0xe569('0x35')](_0xe569('0x36'))){_0xfc0a22['limit']=qs[_0xe569('0x1e')](_0x138822[_0xe569('0x30')][_0xe569('0x1e')]);_0xfc0a22[_0xe569('0x1c')]=qs[_0xe569('0x1c')](_0x138822[_0xe569('0x30')][_0xe569('0x1c')]);}_0xfc0a22[_0xe569('0x37')]=qs[_0xe569('0x38')](_0x138822[_0xe569('0x30')]['sort']);_0xfc0a22['where']=qs[_0xe569('0x39')](_['pick'](_0x138822[_0xe569('0x30')],_0x47f99e[_0xe569('0x39')]),_0x54195a);if(_0x138822['query']['filter']){_0xfc0a22[_0xe569('0x3a')]=_[_0xe569('0x3b')](_0xfc0a22[_0xe569('0x3a')],{'$or':_['map'](_0x54195a,function(_0x537837){if(_0x537837[_0xe569('0x2d')]!==_0xe569('0x3c')){var _0x44214e={};_0x44214e[_0x537837['name']]={'$like':'%'+_0x138822['query']['filter']+'%'};return _0x44214e;}})});}_0xfc0a22=_[_0xe569('0x3b')]({},_0xfc0a22,_0x138822[_0xe569('0x3d')]);var _0x53d50d={'where':_0xfc0a22[_0xe569('0x3a')]};return db[_0xe569('0x2a')]['count'](_0x53d50d)[_0xe569('0x24')](function(_0x17d387){_0x1d2b94[_0xe569('0x1f')]=_0x17d387;if(_0x138822[_0xe569('0x30')]['includeAll']){_0xfc0a22[_0xe569('0x3e')]=[{'all':!![]}];}return db[_0xe569('0x2a')][_0xe569('0x3f')](_0xfc0a22);})[_0xe569('0x24')](function(_0x4b0b77){_0x1d2b94[_0xe569('0x40')]=_0x4b0b77;return _0x1d2b94;})[_0xe569('0x24')](respondWithFilteredResult(_0x15d549,_0xfc0a22))[_0xe569('0x41')](handleError(_0x15d549,null));};exports[_0xe569('0x42')]=function(_0x3f9a16,_0x6a903f){var _0x5ea13e={'raw':![],'where':{'id':_0x3f9a16[_0xe569('0x43')]['id']}},_0x2b16ac={};_0x2b16ac[_0xe569('0x2e')]=_['keys'](db[_0xe569('0x2a')]['rawAttributes']);_0x2b16ac[_0xe569('0x30')]=_[_0xe569('0x31')](_0x3f9a16['query']);_0x2b16ac[_0xe569('0x39')]=_[_0xe569('0x32')](_0x2b16ac[_0xe569('0x2e')],_0x2b16ac[_0xe569('0x30')]);_0x5ea13e[_0xe569('0x34')]=_[_0xe569('0x32')](_0x2b16ac[_0xe569('0x2e')],qs['fields'](_0x3f9a16['query'][_0xe569('0x33')]));_0x5ea13e[_0xe569('0x34')]=_0x5ea13e[_0xe569('0x34')]['length']?_0x5ea13e[_0xe569('0x34')]:_0x2b16ac[_0xe569('0x2e')];if(_0x3f9a16[_0xe569('0x30')][_0xe569('0x44')]){_0x5ea13e[_0xe569('0x3e')]=[{'all':!![]}];}_0x5ea13e=_[_0xe569('0x3b')]({},_0x5ea13e,_0x3f9a16[_0xe569('0x3d')]);return db['SalesforceAccount'][_0xe569('0x45')](_0x5ea13e)['then'](handleEntityNotFound(_0x6a903f,null))[_0xe569('0x24')](respondWithResult(_0x6a903f,null))[_0xe569('0x41')](handleError(_0x6a903f,null));};exports[_0xe569('0x46')]=function(_0x1214f8,_0x2befc5){return db[_0xe569('0x2a')]['create'](_0x1214f8[_0xe569('0x47')],{})[_0xe569('0x24')](respondWithResult(_0x2befc5,0xc9))[_0xe569('0x41')](handleError(_0x2befc5,null));};exports[_0xe569('0x23')]=function(_0x196325,_0x31f993){if(_0x196325[_0xe569('0x47')]['id']){delete _0x196325['body']['id'];}return db[_0xe569('0x2a')][_0xe569('0x45')]({'where':{'id':_0x196325[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x31f993,null))[_0xe569('0x24')](saveUpdates(_0x196325['body'],null))['then'](respondWithResult(_0x31f993,null))[_0xe569('0x41')](handleError(_0x31f993,null));};exports[_0xe569('0x25')]=function(_0x239c9b,_0x5e27c3){return db[_0xe569('0x2a')]['find']({'where':{'id':_0x239c9b[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x5e27c3,null))['then'](removeEntity(_0x5e27c3,null))[_0xe569('0x41')](handleError(_0x5e27c3,null));};exports[_0xe569('0x48')]=function(_0x4e8b6b,_0x1fb44b,_0x5595fe){var _0x9470bc={};var _0x3dd6bd={};var _0x15920f;var _0x5c8990;return db[_0xe569('0x2a')][_0xe569('0x49')]({'where':{'id':_0x4e8b6b['params']['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x1fb44b,null))[_0xe569('0x24')](function(_0x46f803){if(_0x46f803){_0x15920f=_0x46f803;_0x3dd6bd[_0xe569('0x2e')]=_['keys'](db[_0xe569('0x4a')]['rawAttributes']);_0x3dd6bd[_0xe569('0x30')]=_[_0xe569('0x31')](_0x4e8b6b[_0xe569('0x30')]);_0x3dd6bd[_0xe569('0x39')]=_[_0xe569('0x32')](_0x3dd6bd[_0xe569('0x2e')],_0x3dd6bd[_0xe569('0x30')]);_0x9470bc[_0xe569('0x34')]=_[_0xe569('0x32')](_0x3dd6bd[_0xe569('0x2e')],qs['fields'](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x33')]));_0x9470bc[_0xe569('0x34')]=_0x9470bc[_0xe569('0x34')][_0xe569('0x4b')]?_0x9470bc['attributes']:_0x3dd6bd[_0xe569('0x2e')];_0x9470bc[_0xe569('0x37')]=qs['sort'](_0x4e8b6b[_0xe569('0x30')]['sort']);_0x9470bc[_0xe569('0x3a')]=qs['filters'](_[_0xe569('0x4c')](_0x4e8b6b['query'],_0x3dd6bd[_0xe569('0x39')]));if(_0x4e8b6b['query']['filter']){_0x9470bc['where']=_['merge'](_0x9470bc[_0xe569('0x3a')],{'$or':_[_0xe569('0x4d')](_0x9470bc['attributes'],function(_0x1619fa){var _0x42f21b={};_0x42f21b[_0x1619fa]={'$like':'%'+_0x4e8b6b[_0xe569('0x30')]['filter']+'%'};return _0x42f21b;})});}_0x9470bc=_[_0xe569('0x3b')]({},_0x9470bc,_0x4e8b6b['options']);return _0x15920f[_0xe569('0x48')](_0x9470bc);}})[_0xe569('0x24')](function(_0x5d1712){if(_0x5d1712){_0x5c8990=_0x5d1712['length'];if(!_0x4e8b6b[_0xe569('0x30')][_0xe569('0x35')](_0xe569('0x36'))){_0x9470bc['limit']=qs[_0xe569('0x1e')](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x1e')]);_0x9470bc[_0xe569('0x1c')]=qs[_0xe569('0x1c')](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x1c')]);}return _0x15920f[_0xe569('0x48')](_0x9470bc);}})['then'](function(_0x69e06c){if(_0x69e06c){return _0x69e06c?{'count':_0x5c8990,'rows':_0x69e06c}:null;}})['then'](respondWithResult(_0x1fb44b,null))[_0xe569('0x41')](handleError(_0x1fb44b,null));};exports[_0xe569('0x4e')]=function(_0x57879e,_0x349b44,_0x1241c7){if(_0x57879e[_0xe569('0x47')]['id']){delete _0x57879e[_0xe569('0x47')]['id'];}return db[_0xe569('0x2a')][_0xe569('0x49')]({'where':{'id':_0x57879e[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x349b44,null))['then'](function(_0x4af67c){if(_0x4af67c){_0x57879e[_0xe569('0x47')][_0xe569('0x4f')]=_0x4af67c['id'];_0x57879e['body'][_0xe569('0x50')]=integrations[_0xe569('0x51')](_0x57879e['body'][_0xe569('0x52')],_0x57879e[_0xe569('0x47')][_0xe569('0x2d')]);_0x57879e[_0xe569('0x47')]['Descriptions']=integrations[_0xe569('0x53')](_0x57879e[_0xe569('0x47')][_0xe569('0x52')],_0x57879e[_0xe569('0x47')][_0xe569('0x2d')]);return db[_0xe569('0x4a')][_0xe569('0x46')](_0x57879e['body'],{'include':[{'model':db['SalesforceField'],'as':_0xe569('0x50')},{'model':db[_0xe569('0x54')],'as':_0xe569('0x55')}]});}return null;})[_0xe569('0x24')](respondWithResult(_0x349b44,null))['catch'](handleError(_0x349b44,null));};exports[_0xe569('0x56')]=function(_0xf49400,_0x56b447,_0x45872b){var _0x285e57;var _0xc855bd='';var _0xa9ac75=_0xe569('0x57');return db['SalesforceAccount'][_0xe569('0x49')]({'where':{'id':_0xf49400[_0xe569('0x43')]['id']},'attributes':['id',_0xe569('0x58'),_0xe569('0x59'),_0xe569('0x5a'),_0xe569('0x5b'),'password',_0xe569('0x5c')]})['then'](handleEntityNotFound(_0x56b447,null))[_0xe569('0x24')](function(_0x398648){if(_0x398648){_0xc855bd=_0x398648[_0xe569('0x58')];var _0x579229=_0xc855bd[_0xe569('0x5d')](-0x1);if(_0x579229==='/'){_0xc855bd=_0xc855bd['substring'](0x0,_0xc855bd[_0xe569('0x5e')](_0x579229));}_0x285e57=new jsforce[(_0xe569('0x5f'))]({'oauth2':{'loginUrl':_0xc855bd,'clientId':_0x398648['clientId'],'clientSecret':_0x398648[_0xe569('0x5a')]}});return _0x285e57['login'](_0x398648[_0xe569('0x5b')],_0x398648['password']['concat'](_0x398648[_0xe569('0x5c')]));}})['then'](function(_0x3b411a){if(_0x3b411a){if(!_[_0xe569('0x60')](_0xf49400[_0xe569('0x30')][_0xe569('0x61')])){_0xa9ac75=_0xf49400[_0xe569('0x30')][_0xe569('0x61')];}return _0x285e57[_0xe569('0x62')](_0xa9ac75)['describe']();}})[_0xe569('0x24')](function(_0x3b9c62){var _0x36c452=[_0xe569('0x63'),_0xe569('0x64'),_0xe569('0x65'),_0xe569('0x66'),_0xe569('0x67'),_0xe569('0x68')];var _0x45ed73=[_0xe569('0x69'),_0xe569('0x6a'),_0xe569('0x6b'),_0xe569('0x6c'),_0xe569('0x6d'),_0xe569('0x6e'),'phone'];if(_0x3b9c62){_[_0xe569('0x6f')](_0x3b9c62['fields'],function(_0x191391){return _0x36c452[_0xe569('0x70')](_0x191391['name'])||!_0x45ed73['includes'](_0x191391[_0xe569('0x2d')]);});return{'count':_0x3b9c62['fields'][_0xe569('0x4b')],'rows':_[_0xe569('0x4d')](_0x3b9c62[_0xe569('0x33')],function(_0x16ae49){return{'id':_0x16ae49[_0xe569('0x2f')],'name':_0x16ae49[_0xe569('0x71')],'custom':_0x16ae49[_0xe569('0x72')],'options':_0x16ae49[_0xe569('0x73')]['length']>0x0?_[_0xe569('0x4d')](_0x16ae49[_0xe569('0x73')],function(_0x48432d){return{'name':_0x48432d[_0xe569('0x71')],'value':_0x48432d[_0xe569('0x74')]};}):_0x16ae49[_0xe569('0x2d')]=='boolean'?[{'name':_0xe569('0x75'),'value':_0xe569('0x76')},{'name':'False','value':_0xe569('0x77')}]:[]};})};}})[_0xe569('0x24')](respondWithResult(_0x56b447,null))[_0xe569('0x41')](function(_0x15809a){var _0x38b2a1=_0xf49400[_0xe569('0x30')][_0xe569('0x78')]?0x1f4:_0x15809a[_0xe569('0x79')]||0x1f4;logger[_0xe569('0x28')](_0xe569('0x7a'),_0xe569('0x56'),_0x38b2a1,JSON[_0xe569('0x7b')](_0x15809a));delete _0x15809a[_0xe569('0x2f')];if(_0x38b2a1===0x191){_0x38b2a1=0x190;}_0x56b447[_0xe569('0x1a')](_0x38b2a1)[_0xe569('0x7c')](_0xf49400[_0xe569('0x30')]['test']?{'message':_0xe569('0x7d'),'statusCode':_0x15809a[_0xe569('0x79')]}:_0x15809a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 88d78a9..809f6d1 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 _0xacb8=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0xcbc688,_0x20dcd2){var _0x1b0b83=function(_0x506b11){while(--_0x506b11){_0xcbc688['push'](_0xcbc688['shift']());}};_0x1b0b83(++_0x20dcd2);}(_0xacb8,0x119));var _0x8acb=function(_0xce94e3,_0x112f55){_0xce94e3=_0xce94e3-0x0;var _0x347f05=_0xacb8[_0xce94e3];return _0x347f05;};'use strict';var _=require(_0x8acb('0x0'));var util=require('util');var logger=require(_0x8acb('0x1'))(_0x8acb('0x2'));var moment=require(_0x8acb('0x3'));var BPromise=require('bluebird');var rp=require(_0x8acb('0x4'));var fs=require('fs');var path=require(_0x8acb('0x5'));var rimraf=require('rimraf');var config=require(_0x8acb('0x6'));var attributes=require(_0x8acb('0x7'));var integrations=require(_0x8acb('0x8'));module[_0x8acb('0x9')]=function(_0x893152,_0xeaa656){return _0x893152['define'](_0x8acb('0xa'),attributes,{'tableName':_0x8acb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x072c=['util','../../config/logger','bluebird','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts'];(function(_0x50703b,_0x2532cb){var _0x5bed36=function(_0x18e3a5){while(--_0x18e3a5){_0x50703b['push'](_0x50703b['shift']());}};_0x5bed36(++_0x2532cb);}(_0x072c,0x10e));var _0xc072=function(_0x54399e,_0x2aeaa8){_0x54399e=_0x54399e-0x0;var _0xecbebf=_0x072c[_0x54399e];return _0xecbebf;};'use strict';var _=require('lodash');var util=require(_0xc072('0x0'));var logger=require(_0xc072('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc072('0x2'));var rp=require(_0xc072('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc072('0x4'));var attributes=require(_0xc072('0x5'));var integrations=require(_0xc072('0x6'));module[_0xc072('0x7')]=function(_0x27514c,_0x5388b0){return _0x27514c['define']('SalesforceAccount',attributes,{'tableName':_0xc072('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 587e7b1..0d55b9d 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 _0x228e=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model','attributes','ShowSalesforceAccount','find','raw','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x228e,0x82));var _0xe228=function(_0x183bd5,_0x5ddb5f){_0x183bd5=_0x183bd5-0x0;var _0x56e3b4=_0x228e[_0x183bd5];return _0x56e3b4;};'use strict';var _=require(_0xe228('0x0'));var util=require(_0xe228('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe228('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe228('0x3'))['db'];var utils=require(_0xe228('0x4'));var logger=require('../../config/logger')(_0xe228('0x5'));var config=require(_0xe228('0x6'));var jayson=require(_0xe228('0x7'));var client=jayson[_0xe228('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15c10f,_0x452af8,_0x226d2e){return new BPromise(function(_0x30487a,_0x2042fa){return client['request'](_0x15c10f,_0x226d2e)[_0xe228('0x9')](function(_0x548812){logger[_0xe228('0xa')](_0xe228('0xb'),_0x452af8,'request\x20sent');logger[_0xe228('0xc')](_0xe228('0xd'),_0x452af8,_0xe228('0xe'),JSON[_0xe228('0xf')](_0x548812));if(_0x548812[_0xe228('0x10')]){if(_0x548812['error']['code']===0x1f4){logger[_0xe228('0x10')](_0xe228('0xb'),_0x452af8,_0x548812[_0xe228('0x10')][_0xe228('0x11')]);return _0x2042fa(_0x548812['error'][_0xe228('0x11')]);}logger[_0xe228('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x452af8,_0x548812[_0xe228('0x10')][_0xe228('0x11')]);return _0x30487a(_0x548812[_0xe228('0x10')]['message']);}else{logger[_0xe228('0xa')](_0xe228('0xb'),_0x452af8,'request\x20sent');_0x30487a(_0x548812[_0xe228('0x12')][_0xe228('0x11')]);}})[_0xe228('0x13')](function(_0x238fc4){logger[_0xe228('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x452af8,_0x238fc4);_0x2042fa(_0x238fc4);});});}exports[_0xe228('0x14')]=function(_0x3b84d9){var _0x54d12d=this;return new Promise(function(_0x17037c,_0x4d1099){return db[_0xe228('0x15')][_0xe228('0x16')]({'raw':_0x3b84d9[_0xe228('0x17')]?_0x3b84d9[_0xe228('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b84d9[_0xe228('0x17')]?_0x3b84d9[_0xe228('0x17')][_0xe228('0x18')]||null:null,'attributes':_0x3b84d9[_0xe228('0x17')]?_0x3b84d9[_0xe228('0x17')]['attributes']||null:null,'limit':_0x3b84d9[_0xe228('0x17')]?_0x3b84d9[_0xe228('0x17')][_0xe228('0x19')]||null:null,'include':_0x3b84d9[_0xe228('0x17')]?_0x3b84d9[_0xe228('0x17')][_0xe228('0x1a')]?_[_0xe228('0x1b')](_0x3b84d9[_0xe228('0x17')][_0xe228('0x1a')],function(_0x2f060d){return{'model':db[_0x2f060d[_0xe228('0x1c')]],'as':_0x2f060d['as'],'attributes':_0x2f060d['attributes'],'include':_0x2f060d['include']?_['map'](_0x2f060d[_0xe228('0x1a')],function(_0x384053){return{'model':db[_0x384053[_0xe228('0x1c')]],'as':_0x384053['as'],'attributes':_0x384053[_0xe228('0x1d')],'include':_0x384053['include']?_[_0xe228('0x1b')](_0x384053[_0xe228('0x1a')],function(_0x19798c){return{'model':db[_0x19798c[_0xe228('0x1c')]],'as':_0x19798c['as'],'attributes':_0x19798c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x81eae6){logger[_0xe228('0xa')](_0xe228('0x14'),_0x3b84d9);logger[_0xe228('0xc')](_0xe228('0x14'),_0x3b84d9,JSON[_0xe228('0xf')](_0x81eae6));_0x17037c(_0x81eae6);})['catch'](function(_0x5bf462){logger[_0xe228('0x10')](_0xe228('0x14'),_0x5bf462[_0xe228('0x11')],_0x3b84d9);_0x4d1099(_0x54d12d['error'](0x1f4,_0x5bf462[_0xe228('0x11')]));});});};exports[_0xe228('0x1e')]=function(_0x586c52){var _0x41c9dd=this;return new Promise(function(_0x5060cb,_0x2f959a){return db[_0xe228('0x15')][_0xe228('0x1f')]({'raw':_0x586c52[_0xe228('0x17')]?_0x586c52[_0xe228('0x17')][_0xe228('0x20')]===undefined?!![]:![]:!![],'where':_0x586c52[_0xe228('0x17')]?_0x586c52[_0xe228('0x17')][_0xe228('0x18')]||null:null,'attributes':_0x586c52[_0xe228('0x17')]?_0x586c52['options']['attributes']||null:null,'include':_0x586c52['options']?_0x586c52[_0xe228('0x17')][_0xe228('0x1a')]?_[_0xe228('0x1b')](_0x586c52[_0xe228('0x17')][_0xe228('0x1a')],function(_0x2fd2cc){return{'model':db[_0x2fd2cc[_0xe228('0x1c')]],'as':_0x2fd2cc['as'],'attributes':_0x2fd2cc['attributes'],'include':_0x2fd2cc['include']?_[_0xe228('0x1b')](_0x2fd2cc[_0xe228('0x1a')],function(_0x1cd089){return{'model':db[_0x1cd089['model']],'as':_0x1cd089['as'],'attributes':_0x1cd089['attributes'],'include':_0x1cd089[_0xe228('0x1a')]?_[_0xe228('0x1b')](_0x1cd089[_0xe228('0x1a')],function(_0x596e5b){return{'model':db[_0x596e5b[_0xe228('0x1c')]],'as':_0x596e5b['as'],'attributes':_0x596e5b[_0xe228('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe228('0x9')](function(_0x56d44b){logger[_0xe228('0xa')](_0xe228('0x1e'),_0x586c52);logger[_0xe228('0xc')](_0xe228('0x1e'),_0x586c52,JSON['stringify'](_0x56d44b));_0x5060cb(_0x56d44b);})[_0xe228('0x13')](function(_0x47e9b3){logger[_0xe228('0x10')](_0xe228('0x1e'),_0x47e9b3[_0xe228('0x11')],_0x586c52);_0x2f959a(_0x41c9dd['error'](0x1f4,_0x47e9b3[_0xe228('0x11')]));});});}; \ No newline at end of file +var _0xe091=['then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','SalesforceAccount','options','raw','attributes','limit','include','map','model','catch','ShowSalesforceAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0xe091,0x1ad));var _0x1e09=function(_0x19ec02,_0x222aff){_0x19ec02=_0x19ec02-0x0;var _0x1c8fb0=_0xe091[_0x19ec02];return _0x1c8fb0;};'use strict';var _=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var moment=require(_0x1e09('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e09('0x3'));var fs=require('fs');var Redis=require(_0x1e09('0x4'));var db=require(_0x1e09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e09('0x6'))(_0x1e09('0x7'));var config=require(_0x1e09('0x8'));var jayson=require(_0x1e09('0x9'));var client=jayson[_0x1e09('0xa')][_0x1e09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dbe36,_0x3aa5ae,_0x521372){return new BPromise(function(_0x260b33,_0x97eefb){return client[_0x1e09('0xc')](_0x2dbe36,_0x521372)[_0x1e09('0xd')](function(_0x10bc96){logger[_0x1e09('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x3aa5ae,_0x1e09('0xf'));logger[_0x1e09('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3aa5ae,_0x1e09('0xf'),JSON[_0x1e09('0x11')](_0x10bc96));if(_0x10bc96[_0x1e09('0x12')]){if(_0x10bc96['error'][_0x1e09('0x13')]===0x1f4){logger['error'](_0x1e09('0x14'),_0x3aa5ae,_0x10bc96[_0x1e09('0x12')][_0x1e09('0x15')]);return _0x97eefb(_0x10bc96[_0x1e09('0x12')][_0x1e09('0x15')]);}logger[_0x1e09('0x12')](_0x1e09('0x14'),_0x3aa5ae,_0x10bc96['error'][_0x1e09('0x15')]);return _0x260b33(_0x10bc96[_0x1e09('0x12')]['message']);}else{logger['info'](_0x1e09('0x14'),_0x3aa5ae,_0x1e09('0xf'));_0x260b33(_0x10bc96['result'][_0x1e09('0x15')]);}})['catch'](function(_0x42455e){logger[_0x1e09('0x12')](_0x1e09('0x14'),_0x3aa5ae,_0x42455e);_0x97eefb(_0x42455e);});});}exports[_0x1e09('0x16')]=function(_0x3408a3){var _0x204cbb=this;return new Promise(function(_0x1062e3,_0x1ac872){return db[_0x1e09('0x17')]['findAll']({'raw':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x19')]===undefined?!![]:![]:!![],'where':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')]['where']||null:null,'attributes':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1a')]||null:null,'limit':_0x3408a3['options']?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1b')]||null:null,'include':_0x3408a3['options']?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1c')],function(_0x2c1c08){return{'model':db[_0x2c1c08['model']],'as':_0x2c1c08['as'],'attributes':_0x2c1c08[_0x1e09('0x1a')],'include':_0x2c1c08[_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x2c1c08['include'],function(_0x34f935){return{'model':db[_0x34f935[_0x1e09('0x1e')]],'as':_0x34f935['as'],'attributes':_0x34f935['attributes'],'include':_0x34f935[_0x1e09('0x1c')]?_['map'](_0x34f935[_0x1e09('0x1c')],function(_0x39b7b9){return{'model':db[_0x39b7b9[_0x1e09('0x1e')]],'as':_0x39b7b9['as'],'attributes':_0x39b7b9[_0x1e09('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e09('0xd')](function(_0xa6fc32){logger['info'](_0x1e09('0x16'),_0x3408a3);logger[_0x1e09('0x10')](_0x1e09('0x16'),_0x3408a3,JSON[_0x1e09('0x11')](_0xa6fc32));_0x1062e3(_0xa6fc32);})[_0x1e09('0x1f')](function(_0x428dc4){logger[_0x1e09('0x12')](_0x1e09('0x16'),_0x428dc4[_0x1e09('0x15')],_0x3408a3);_0x1ac872(_0x204cbb[_0x1e09('0x12')](0x1f4,_0x428dc4[_0x1e09('0x15')]));});});};exports[_0x1e09('0x20')]=function(_0x7c9616){var _0x436c5e=this;return new Promise(function(_0x588f5b,_0x2af33f){return db[_0x1e09('0x17')]['find']({'raw':_0x7c9616[_0x1e09('0x18')]?_0x7c9616['options'][_0x1e09('0x19')]===undefined?!![]:![]:!![],'where':_0x7c9616['options']?_0x7c9616[_0x1e09('0x18')][_0x1e09('0x21')]||null:null,'attributes':_0x7c9616[_0x1e09('0x18')]?_0x7c9616[_0x1e09('0x18')]['attributes']||null:null,'include':_0x7c9616['options']?_0x7c9616['options'][_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x7c9616['options'][_0x1e09('0x1c')],function(_0x4ec592){return{'model':db[_0x4ec592[_0x1e09('0x1e')]],'as':_0x4ec592['as'],'attributes':_0x4ec592[_0x1e09('0x1a')],'include':_0x4ec592[_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x4ec592[_0x1e09('0x1c')],function(_0x164939){return{'model':db[_0x164939[_0x1e09('0x1e')]],'as':_0x164939['as'],'attributes':_0x164939['attributes'],'include':_0x164939['include']?_[_0x1e09('0x1d')](_0x164939[_0x1e09('0x1c')],function(_0x52d6f9){return{'model':db[_0x52d6f9[_0x1e09('0x1e')]],'as':_0x52d6f9['as'],'attributes':_0x52d6f9[_0x1e09('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55fe3e){logger[_0x1e09('0xe')]('ShowSalesforceAccount',_0x7c9616);logger[_0x1e09('0x10')](_0x1e09('0x20'),_0x7c9616,JSON['stringify'](_0x55fe3e));_0x588f5b(_0x55fe3e);})[_0x1e09('0x1f')](function(_0x457e53){logger[_0x1e09('0x12')](_0x1e09('0x20'),_0x457e53[_0x1e09('0x15')],_0x7c9616);_0x2af33f(_0x436c5e[_0x1e09('0x12')](0x1f4,_0x457e53[_0x1e09('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 550124e..b9809fc 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdb28,0x106));var _0x8db2=function(_0x4c1d1f,_0x4bd65a){_0x4c1d1f=_0x4c1d1f-0x0;var _0x39b8b3=_0xdb28[_0x4c1d1f];return _0x39b8b3;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x1042d2,_0x3da8a9){var _0x8934e5=function(_0x3048cb){while(--_0x3048cb){_0x1042d2['push'](_0x1042d2['shift']());}};_0x8934e5(++_0x3da8a9);}(_0xadb5,0xad));var _0x5adb=function(_0x44ccd4,_0x48c81d){_0x44ccd4=_0x44ccd4-0x0;var _0x54064b=_0xadb5[_0x44ccd4];return _0x54064b;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 1184d72..dbf0251 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 _0x5aab=['STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x3d3657,_0x14b71f){var _0x118c38=function(_0x1ccd36){while(--_0x1ccd36){_0x3d3657['push'](_0x3d3657['shift']());}};_0x118c38(++_0x14b71f);}(_0x5aab,0x90));var _0xb5aa=function(_0x43d48e,_0xf3dbc3){_0x43d48e=_0x43d48e-0x0;var _0x2b69f2=_0x5aab[_0x43d48e];return _0x2b69f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb5aa('0x0')]},'description':{'type':Sequelize[_0xb5aa('0x0')]},'ticketType':{'type':Sequelize[_0xb5aa('0x1')]('Task','Case'),'defaultValue':_0xb5aa('0x2')},'moduleSearch':{'type':Sequelize[_0xb5aa('0x1')](_0xb5aa('0x3'),_0xb5aa('0x4'),_0xb5aa('0x5'),_0xb5aa('0x6'),_0xb5aa('0x7')),'defaultValue':_0xb5aa('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb5aa('0x8'),_0xb5aa('0x4'),_0xb5aa('0x5'),_0xb5aa('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchContact':{'type':Sequelize[_0xb5aa('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ac9=['contact_lead','contact','lead','account','STRING','sequelize','exports','ENUM','Task','Case'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x7ac9,0xeb));var _0x97ac=function(_0x2ec288,_0x56a150){_0x2ec288=_0x2ec288-0x0;var _0x377cb5=_0x7ac9[_0x2ec288];return _0x377cb5;};'use strict';var Sequelize=require(_0x97ac('0x0'));module[_0x97ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x97ac('0x2')](_0x97ac('0x3'),_0x97ac('0x4')),'defaultValue':_0x97ac('0x3')},'moduleSearch':{'type':Sequelize[_0x97ac('0x2')](_0x97ac('0x5'),_0x97ac('0x6'),_0x97ac('0x7'),'account_contact_lead','account'),'defaultValue':_0x97ac('0x5')},'moduleCreate':{'type':Sequelize[_0x97ac('0x2')]('nothing',_0x97ac('0x6'),_0x97ac('0x7'),_0x97ac('0x8')),'defaultValue':_0x97ac('0x7')},'leadId':{'type':Sequelize[_0x97ac('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x97ac('0x9')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x97ac('0x9')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index f4ed537..75fb42f 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 _0x91ed=['rows','show','params','rawAttributes','length','find','catch','create','body','update','getFields','findOne','order','nolimit','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x91ed,0xb5));var _0xd91e=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x91ed[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91e('0x0'));var zipdir=require(_0xd91e('0x1'));var jsonpatch=require(_0xd91e('0x2'));var rp=require(_0xd91e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd91e('0x4'));var path=require('path');var sox=require(_0xd91e('0x5'));var csv=require('to-csv');var ejs=require(_0xd91e('0x6'));var fs=require('fs');var fs_extra=require(_0xd91e('0x7'));var _=require(_0xd91e('0x8'));var squel=require(_0xd91e('0x9'));var crypto=require(_0xd91e('0xa'));var jsforce=require(_0xd91e('0xb'));var deskjs=require(_0xd91e('0xc'));var toCsv=require(_0xd91e('0xd'));var querystring=require(_0xd91e('0xe'));var Papa=require(_0xd91e('0xf'));var Redis=require(_0xd91e('0x10'));var authService=require(_0xd91e('0x11'));var qs=require(_0xd91e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd91e('0x13'));var logger=require(_0xd91e('0x14'))(_0xd91e('0x15'));var utils=require(_0xd91e('0x16'));var config=require(_0xd91e('0x17'));var licenseUtil=require(_0xd91e('0x18'));var db=require(_0xd91e('0x19'))['db'];function respondWithStatusCode(_0x379bde,_0x515e98){_0x515e98=_0x515e98||0xcc;return function(_0x5d0677){if(_0x5d0677){return _0x379bde['sendStatus'](_0x515e98);}return _0x379bde[_0xd91e('0x1a')](_0x515e98)[_0xd91e('0x1b')]();};}function respondWithResult(_0x4faaa1,_0x24674e){_0x24674e=_0x24674e||0xc8;return function(_0x2499ed){if(_0x2499ed){return _0x4faaa1[_0xd91e('0x1a')](_0x24674e)[_0xd91e('0x1c')](_0x2499ed);}};}function respondWithFilteredResult(_0x57e2b6,_0x2ab213){return function(_0x398d96){if(_0x398d96){var _0x5f5886=typeof _0x2ab213[_0xd91e('0x1d')]==='undefined'&&typeof _0x2ab213[_0xd91e('0x1e')]===_0xd91e('0x1f');var _0x27b7b5=_0x398d96[_0xd91e('0x20')];var _0x39b55e=_0x5f5886?0x0:_0x2ab213[_0xd91e('0x1d')];var _0x1133bc=_0x5f5886?_0x398d96[_0xd91e('0x20')]:_0x2ab213['offset']+_0x2ab213[_0xd91e('0x1e')];var _0x2606ac;if(_0x1133bc>=_0x27b7b5){_0x1133bc=_0x27b7b5;_0x2606ac=0xc8;}else{_0x2606ac=0xce;}_0x57e2b6[_0xd91e('0x1a')](_0x2606ac);return _0x57e2b6[_0xd91e('0x21')](_0xd91e('0x22'),_0x39b55e+'-'+_0x1133bc+'/'+_0x27b7b5)[_0xd91e('0x1c')](_0x398d96);}return null;};}function patchUpdates(_0xeb77e7){return function(_0x24e587){try{jsonpatch[_0xd91e('0x23')](_0x24e587,_0xeb77e7,!![]);}catch(_0x5dce12){return BPromise['reject'](_0x5dce12);}return _0x24e587[_0xd91e('0x24')]();};}function saveUpdates(_0x160f99,_0x2c4b21){return function(_0x491b06){if(_0x491b06){return _0x491b06['update'](_0x160f99)[_0xd91e('0x25')](function(_0x2b1f59){return _0x2b1f59;});}return null;};}function removeEntity(_0x8d333a,_0x4c08f1){return function(_0x8b163e){if(_0x8b163e){return _0x8b163e[_0xd91e('0x26')]()[_0xd91e('0x25')](function(){_0x8d333a['status'](0xcc)[_0xd91e('0x1b')]();});}};}function handleEntityNotFound(_0x464336,_0x1d63d1){return function(_0x370322){if(!_0x370322){_0x464336[_0xd91e('0x27')](0x194);}return _0x370322;};}function handleError(_0x9180,_0x70ed53){_0x70ed53=_0x70ed53||0x1f4;return function(_0x4c876e){logger['error'](_0x4c876e[_0xd91e('0x28')]);if(_0x4c876e[_0xd91e('0x29')]){delete _0x4c876e[_0xd91e('0x29')];}_0x9180[_0xd91e('0x1a')](_0x70ed53)['send'](_0x4c876e);};}exports[_0xd91e('0x2a')]=function(_0x453626,_0x53e6af){var _0x111555={},_0x4c3fff={},_0x3e5f08={'count':0x0,'rows':[]};var _0x27867b=_[_0xd91e('0x2b')](db[_0xd91e('0x2c')]['rawAttributes'],function(_0x11e9d3){return{'name':_0x11e9d3['fieldName'],'type':_0x11e9d3[_0xd91e('0x2d')][_0xd91e('0x2e')]};});_0x4c3fff[_0xd91e('0x2f')]=_['map'](_0x27867b,_0xd91e('0x29'));_0x4c3fff[_0xd91e('0x30')]=_[_0xd91e('0x31')](_0x453626[_0xd91e('0x30')]);_0x4c3fff[_0xd91e('0x32')]=_[_0xd91e('0x33')](_0x4c3fff['model'],_0x4c3fff[_0xd91e('0x30')]);_0x111555[_0xd91e('0x34')]=_[_0xd91e('0x33')](_0x4c3fff[_0xd91e('0x2f')],qs[_0xd91e('0x35')](_0x453626[_0xd91e('0x30')][_0xd91e('0x35')]));_0x111555['attributes']=_0x111555[_0xd91e('0x34')]['length']?_0x111555[_0xd91e('0x34')]:_0x4c3fff[_0xd91e('0x2f')];if(!_0x453626[_0xd91e('0x30')][_0xd91e('0x36')]('nolimit')){_0x111555[_0xd91e('0x1e')]=qs[_0xd91e('0x1e')](_0x453626['query']['limit']);_0x111555[_0xd91e('0x1d')]=qs[_0xd91e('0x1d')](_0x453626['query']['offset']);}_0x111555['order']=qs[_0xd91e('0x37')](_0x453626[_0xd91e('0x30')]['sort']);_0x111555['where']=qs['filters'](_[_0xd91e('0x38')](_0x453626[_0xd91e('0x30')],_0x4c3fff[_0xd91e('0x32')]),_0x27867b);if(_0x453626[_0xd91e('0x30')][_0xd91e('0x39')]){_0x111555[_0xd91e('0x3a')]=_['merge'](_0x111555[_0xd91e('0x3a')],{'$or':_[_0xd91e('0x2b')](_0x27867b,function(_0x9fe9f){if(_0x9fe9f[_0xd91e('0x2d')]!==_0xd91e('0x3b')){var _0x3bcc70={};_0x3bcc70[_0x9fe9f[_0xd91e('0x29')]]={'$like':'%'+_0x453626[_0xd91e('0x30')][_0xd91e('0x39')]+'%'};return _0x3bcc70;}})});}_0x111555=_[_0xd91e('0x3c')]({},_0x111555,_0x453626[_0xd91e('0x3d')]);var _0x533a23={'where':_0x111555[_0xd91e('0x3a')]};return db[_0xd91e('0x2c')][_0xd91e('0x20')](_0x533a23)[_0xd91e('0x25')](function(_0xa5641){_0x3e5f08[_0xd91e('0x20')]=_0xa5641;if(_0x453626['query'][_0xd91e('0x3e')]){_0x111555[_0xd91e('0x3f')]=[{'all':!![]}];}return db[_0xd91e('0x2c')][_0xd91e('0x40')](_0x111555);})['then'](function(_0x407bd6){_0x3e5f08[_0xd91e('0x41')]=_0x407bd6;return _0x3e5f08;})[_0xd91e('0x25')](respondWithFilteredResult(_0x53e6af,_0x111555))['catch'](handleError(_0x53e6af,null));};exports[_0xd91e('0x42')]=function(_0x598e64,_0x11d1d2){var _0xc653bc={'raw':![],'where':{'id':_0x598e64[_0xd91e('0x43')]['id']}},_0x2f09bd={};_0x2f09bd[_0xd91e('0x2f')]=_['keys'](db['SalesforceConfiguration'][_0xd91e('0x44')]);_0x2f09bd[_0xd91e('0x30')]=_[_0xd91e('0x31')](_0x598e64[_0xd91e('0x30')]);_0x2f09bd[_0xd91e('0x32')]=_[_0xd91e('0x33')](_0x2f09bd[_0xd91e('0x2f')],_0x2f09bd[_0xd91e('0x30')]);_0xc653bc[_0xd91e('0x34')]=_[_0xd91e('0x33')](_0x2f09bd[_0xd91e('0x2f')],qs['fields'](_0x598e64['query'][_0xd91e('0x35')]));_0xc653bc[_0xd91e('0x34')]=_0xc653bc[_0xd91e('0x34')][_0xd91e('0x45')]?_0xc653bc[_0xd91e('0x34')]:_0x2f09bd[_0xd91e('0x2f')];if(_0x598e64['query']['includeAll']){_0xc653bc[_0xd91e('0x3f')]=[{'all':!![]}];}_0xc653bc=_[_0xd91e('0x3c')]({},_0xc653bc,_0x598e64[_0xd91e('0x3d')]);return db[_0xd91e('0x2c')][_0xd91e('0x46')](_0xc653bc)[_0xd91e('0x25')](handleEntityNotFound(_0x11d1d2,null))['then'](respondWithResult(_0x11d1d2,null))[_0xd91e('0x47')](handleError(_0x11d1d2,null));};exports['create']=function(_0x16c165,_0x7b082e){return db[_0xd91e('0x2c')][_0xd91e('0x48')](_0x16c165[_0xd91e('0x49')],{})[_0xd91e('0x25')](respondWithResult(_0x7b082e,0xc9))[_0xd91e('0x47')](handleError(_0x7b082e,null));};exports[_0xd91e('0x4a')]=function(_0x194ee9,_0x11a572){if(_0x194ee9[_0xd91e('0x49')]['id']){delete _0x194ee9[_0xd91e('0x49')]['id'];}return db[_0xd91e('0x2c')][_0xd91e('0x46')]({'where':{'id':_0x194ee9[_0xd91e('0x43')]['id']}})[_0xd91e('0x25')](handleEntityNotFound(_0x11a572,null))['then'](saveUpdates(_0x194ee9['body'],null))['then'](respondWithResult(_0x11a572,null))[_0xd91e('0x47')](handleError(_0x11a572,null));};exports[_0xd91e('0x26')]=function(_0x5326fe,_0x16fe90){return db[_0xd91e('0x2c')][_0xd91e('0x46')]({'where':{'id':_0x5326fe[_0xd91e('0x43')]['id']}})[_0xd91e('0x25')](handleEntityNotFound(_0x16fe90,null))[_0xd91e('0x25')](removeEntity(_0x16fe90,null))[_0xd91e('0x47')](handleError(_0x16fe90,null));};exports[_0xd91e('0x4b')]=function(_0x5c7cd8,_0x52da40,_0x47be05){var _0x5a1d44={};var _0x929b48={};var _0x2032ed;var _0x679a58;return db['SalesforceConfiguration'][_0xd91e('0x4c')]({'where':{'id':_0x5c7cd8[_0xd91e('0x43')]['id']}})[_0xd91e('0x25')](handleEntityNotFound(_0x52da40,null))[_0xd91e('0x25')](function(_0x1a045c){if(_0x1a045c){_0x2032ed=_0x1a045c;_0x929b48[_0xd91e('0x2f')]=_['keys'](db['SalesforceField'][_0xd91e('0x44')]);_0x929b48[_0xd91e('0x30')]=_['keys'](_0x5c7cd8[_0xd91e('0x30')]);_0x929b48['filters']=_[_0xd91e('0x33')](_0x929b48[_0xd91e('0x2f')],_0x929b48['query']);_0x5a1d44['attributes']=_[_0xd91e('0x33')](_0x929b48[_0xd91e('0x2f')],qs[_0xd91e('0x35')](_0x5c7cd8[_0xd91e('0x30')]['fields']));_0x5a1d44[_0xd91e('0x34')]=_0x5a1d44[_0xd91e('0x34')][_0xd91e('0x45')]?_0x5a1d44[_0xd91e('0x34')]:_0x929b48[_0xd91e('0x2f')];_0x5a1d44[_0xd91e('0x4d')]=qs[_0xd91e('0x37')](_0x5c7cd8[_0xd91e('0x30')][_0xd91e('0x37')]);_0x5a1d44[_0xd91e('0x3a')]=qs[_0xd91e('0x32')](_[_0xd91e('0x38')](_0x5c7cd8['query'],_0x929b48[_0xd91e('0x32')]));if(_0x5c7cd8[_0xd91e('0x30')][_0xd91e('0x39')]){_0x5a1d44[_0xd91e('0x3a')]=_[_0xd91e('0x3c')](_0x5a1d44[_0xd91e('0x3a')],{'$or':_['map'](_0x5a1d44[_0xd91e('0x34')],function(_0x206110){var _0x53aabf={};_0x53aabf[_0x206110]={'$like':'%'+_0x5c7cd8[_0xd91e('0x30')][_0xd91e('0x39')]+'%'};return _0x53aabf;})});}_0x5a1d44=_[_0xd91e('0x3c')]({},_0x5a1d44,_0x5c7cd8[_0xd91e('0x3d')]);return _0x2032ed['getFields'](_0x5a1d44);}})['then'](function(_0x12f1ca){if(_0x12f1ca){_0x679a58=_0x12f1ca[_0xd91e('0x45')];if(!_0x5c7cd8['query'][_0xd91e('0x36')](_0xd91e('0x4e'))){_0x5a1d44[_0xd91e('0x1e')]=qs['limit'](_0x5c7cd8[_0xd91e('0x30')][_0xd91e('0x1e')]);_0x5a1d44[_0xd91e('0x1d')]=qs[_0xd91e('0x1d')](_0x5c7cd8[_0xd91e('0x30')]['offset']);}return _0x2032ed[_0xd91e('0x4b')](_0x5a1d44);}})['then'](function(_0x598cac){if(_0x598cac){return _0x598cac?{'count':_0x679a58,'rows':_0x598cac}:null;}})[_0xd91e('0x25')](respondWithResult(_0x52da40,null))['catch'](handleError(_0x52da40,null));};exports['getSubjects']=function(_0x2044dc,_0x38422e,_0x1cb071){var _0x56f439={};var _0x576417={};var _0x2146ee;var _0x418a41;return db['SalesforceConfiguration'][_0xd91e('0x4c')]({'where':{'id':_0x2044dc[_0xd91e('0x43')]['id']}})[_0xd91e('0x25')](handleEntityNotFound(_0x38422e,null))[_0xd91e('0x25')](function(_0x7b4f25){if(_0x7b4f25){_0x2146ee=_0x7b4f25;_0x576417[_0xd91e('0x2f')]=_[_0xd91e('0x31')](db[_0xd91e('0x4f')][_0xd91e('0x44')]);_0x576417['query']=_[_0xd91e('0x31')](_0x2044dc[_0xd91e('0x30')]);_0x576417[_0xd91e('0x32')]=_[_0xd91e('0x33')](_0x576417['model'],_0x576417['query']);_0x56f439[_0xd91e('0x34')]=_[_0xd91e('0x33')](_0x576417[_0xd91e('0x2f')],qs['fields'](_0x2044dc[_0xd91e('0x30')][_0xd91e('0x35')]));_0x56f439[_0xd91e('0x34')]=_0x56f439[_0xd91e('0x34')][_0xd91e('0x45')]?_0x56f439[_0xd91e('0x34')]:_0x576417['model'];_0x56f439[_0xd91e('0x4d')]=qs[_0xd91e('0x37')](_0x2044dc['query'][_0xd91e('0x37')]);_0x56f439[_0xd91e('0x3a')]=qs[_0xd91e('0x32')](_[_0xd91e('0x38')](_0x2044dc[_0xd91e('0x30')],_0x576417['filters']));if(_0x2044dc['query'][_0xd91e('0x39')]){_0x56f439[_0xd91e('0x3a')]=_[_0xd91e('0x3c')](_0x56f439[_0xd91e('0x3a')],{'$or':_[_0xd91e('0x2b')](_0x56f439['attributes'],function(_0x48dd3d){var _0x2d3147={};_0x2d3147[_0x48dd3d]={'$like':'%'+_0x2044dc['query']['filter']+'%'};return _0x2d3147;})});}_0x56f439=_[_0xd91e('0x3c')]({},_0x56f439,_0x2044dc['options']);return _0x2146ee[_0xd91e('0x50')](_0x56f439);}})[_0xd91e('0x25')](function(_0x2ec240){if(_0x2ec240){_0x418a41=_0x2ec240['length'];if(!_0x2044dc[_0xd91e('0x30')][_0xd91e('0x36')](_0xd91e('0x4e'))){_0x56f439[_0xd91e('0x1e')]=qs[_0xd91e('0x1e')](_0x2044dc[_0xd91e('0x30')]['limit']);_0x56f439[_0xd91e('0x1d')]=qs[_0xd91e('0x1d')](_0x2044dc[_0xd91e('0x30')][_0xd91e('0x1d')]);}return _0x2146ee[_0xd91e('0x50')](_0x56f439);}})[_0xd91e('0x25')](function(_0x1866c8){if(_0x1866c8){return _0x1866c8?{'count':_0x418a41,'rows':_0x1866c8}:null;}})[_0xd91e('0x25')](respondWithResult(_0x38422e,null))['catch'](handleError(_0x38422e,null));};exports['getDescriptions']=function(_0x2a3f7e,_0x4f8530,_0x257c5b){var _0x741859={};var _0xd0ad98={};var _0x99f435;var _0x42527d;return db['SalesforceConfiguration'][_0xd91e('0x4c')]({'where':{'id':_0x2a3f7e[_0xd91e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f8530,null))['then'](function(_0x1da8db){if(_0x1da8db){_0x99f435=_0x1da8db;_0xd0ad98[_0xd91e('0x2f')]=_[_0xd91e('0x31')](db[_0xd91e('0x4f')][_0xd91e('0x44')]);_0xd0ad98[_0xd91e('0x30')]=_[_0xd91e('0x31')](_0x2a3f7e[_0xd91e('0x30')]);_0xd0ad98[_0xd91e('0x32')]=_[_0xd91e('0x33')](_0xd0ad98['model'],_0xd0ad98['query']);_0x741859[_0xd91e('0x34')]=_['intersection'](_0xd0ad98[_0xd91e('0x2f')],qs[_0xd91e('0x35')](_0x2a3f7e[_0xd91e('0x30')]['fields']));_0x741859[_0xd91e('0x34')]=_0x741859[_0xd91e('0x34')]['length']?_0x741859['attributes']:_0xd0ad98[_0xd91e('0x2f')];_0x741859[_0xd91e('0x4d')]=qs[_0xd91e('0x37')](_0x2a3f7e[_0xd91e('0x30')][_0xd91e('0x37')]);_0x741859[_0xd91e('0x3a')]=qs[_0xd91e('0x32')](_[_0xd91e('0x38')](_0x2a3f7e[_0xd91e('0x30')],_0xd0ad98[_0xd91e('0x32')]));if(_0x2a3f7e[_0xd91e('0x30')]['filter']){_0x741859['where']=_[_0xd91e('0x3c')](_0x741859[_0xd91e('0x3a')],{'$or':_[_0xd91e('0x2b')](_0x741859[_0xd91e('0x34')],function(_0x547c21){var _0x4b0036={};_0x4b0036[_0x547c21]={'$like':'%'+_0x2a3f7e[_0xd91e('0x30')][_0xd91e('0x39')]+'%'};return _0x4b0036;})});}_0x741859=_[_0xd91e('0x3c')]({},_0x741859,_0x2a3f7e[_0xd91e('0x3d')]);return _0x99f435[_0xd91e('0x51')](_0x741859);}})['then'](function(_0x54b338){if(_0x54b338){_0x42527d=_0x54b338['length'];if(!_0x2a3f7e[_0xd91e('0x30')][_0xd91e('0x36')](_0xd91e('0x4e'))){_0x741859[_0xd91e('0x1e')]=qs['limit'](_0x2a3f7e[_0xd91e('0x30')]['limit']);_0x741859[_0xd91e('0x1d')]=qs[_0xd91e('0x1d')](_0x2a3f7e['query'][_0xd91e('0x1d')]);}return _0x99f435[_0xd91e('0x51')](_0x741859);}})[_0xd91e('0x25')](function(_0x4687d5){if(_0x4687d5){return _0x4687d5?{'count':_0x42527d,'rows':_0x4687d5}:null;}})[_0xd91e('0x25')](respondWithResult(_0x4f8530,null))[_0xd91e('0x47')](handleError(_0x4f8530,null));}; \ No newline at end of file +var _0x58a0=['hasOwnProperty','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','intersection','find','create','body','getFields','findOne','getSubjects','SalesforceField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58a0,0xa6));var _0x058a=function(_0x3a66fa,_0x399904){_0x3a66fa=_0x3a66fa-0x0;var _0x388cf9=_0x58a0[_0x3a66fa];return _0x388cf9;};'use strict';var emlformat=require(_0x058a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x058a('0x1'));var moment=require(_0x058a('0x2'));var BPromise=require(_0x058a('0x3'));var Mustache=require(_0x058a('0x4'));var util=require(_0x058a('0x5'));var path=require(_0x058a('0x6'));var sox=require(_0x058a('0x7'));var csv=require(_0x058a('0x8'));var ejs=require(_0x058a('0x9'));var fs=require('fs');var fs_extra=require(_0x058a('0xa'));var _=require(_0x058a('0xb'));var squel=require(_0x058a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x058a('0x8'));var querystring=require(_0x058a('0xd'));var Papa=require(_0x058a('0xe'));var Redis=require(_0x058a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x058a('0x10'));var as=require(_0x058a('0x11'));var hardwareService=require(_0x058a('0x12'));var logger=require(_0x058a('0x13'))(_0x058a('0x14'));var utils=require(_0x058a('0x15'));var config=require(_0x058a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x058a('0x17'))['db'];function respondWithStatusCode(_0x3877a2,_0x4174f0){_0x4174f0=_0x4174f0||0xcc;return function(_0x4a880e){if(_0x4a880e){return _0x3877a2['sendStatus'](_0x4174f0);}return _0x3877a2[_0x058a('0x18')](_0x4174f0)['end']();};}function respondWithResult(_0x48fcff,_0x55bb87){_0x55bb87=_0x55bb87||0xc8;return function(_0x2edf01){if(_0x2edf01){return _0x48fcff[_0x058a('0x18')](_0x55bb87)[_0x058a('0x19')](_0x2edf01);}};}function respondWithFilteredResult(_0x1dc293,_0x749fa9){return function(_0xb9881d){if(_0xb9881d){var _0x17e33f=typeof _0x749fa9['offset']===_0x058a('0x1a')&&typeof _0x749fa9[_0x058a('0x1b')]==='undefined';var _0x2fb9da=_0xb9881d[_0x058a('0x1c')];var _0x26c546=_0x17e33f?0x0:_0x749fa9[_0x058a('0x1d')];var _0x332ace=_0x17e33f?_0xb9881d[_0x058a('0x1c')]:_0x749fa9[_0x058a('0x1d')]+_0x749fa9[_0x058a('0x1b')];var _0x143d64;if(_0x332ace>=_0x2fb9da){_0x332ace=_0x2fb9da;_0x143d64=0xc8;}else{_0x143d64=0xce;}_0x1dc293[_0x058a('0x18')](_0x143d64);return _0x1dc293[_0x058a('0x1e')](_0x058a('0x1f'),_0x26c546+'-'+_0x332ace+'/'+_0x2fb9da)['json'](_0xb9881d);}return null;};}function patchUpdates(_0x30e183){return function(_0x44e2e6){try{jsonpatch['apply'](_0x44e2e6,_0x30e183,!![]);}catch(_0x3a7438){return BPromise[_0x058a('0x20')](_0x3a7438);}return _0x44e2e6[_0x058a('0x21')]();};}function saveUpdates(_0x24b362,_0x1400e5){return function(_0x3b42ec){if(_0x3b42ec){return _0x3b42ec[_0x058a('0x22')](_0x24b362)[_0x058a('0x23')](function(_0x40844e){return _0x40844e;});}return null;};}function removeEntity(_0x162613,_0x2a1d3e){return function(_0x37c48a){if(_0x37c48a){return _0x37c48a[_0x058a('0x24')]()[_0x058a('0x23')](function(){_0x162613[_0x058a('0x18')](0xcc)[_0x058a('0x25')]();});}};}function handleEntityNotFound(_0x595cf0,_0x3860b4){return function(_0x57c3da){if(!_0x57c3da){_0x595cf0[_0x058a('0x26')](0x194);}return _0x57c3da;};}function handleError(_0x2cb515,_0x3dea05){_0x3dea05=_0x3dea05||0x1f4;return function(_0x38cc5f){logger[_0x058a('0x27')](_0x38cc5f[_0x058a('0x28')]);if(_0x38cc5f['name']){delete _0x38cc5f[_0x058a('0x29')];}_0x2cb515['status'](_0x3dea05)['send'](_0x38cc5f);};}exports[_0x058a('0x2a')]=function(_0x5f21e8,_0x484557){var _0x40bf9d={},_0x3e5ea9={},_0x44bac1={'count':0x0,'rows':[]};var _0x209282=_[_0x058a('0x2b')](db[_0x058a('0x2c')]['rawAttributes'],function(_0x1cb7bd){return{'name':_0x1cb7bd[_0x058a('0x2d')],'type':_0x1cb7bd[_0x058a('0x2e')][_0x058a('0x2f')]};});_0x3e5ea9[_0x058a('0x30')]=_['map'](_0x209282,'name');_0x3e5ea9[_0x058a('0x31')]=_['keys'](_0x5f21e8[_0x058a('0x31')]);_0x3e5ea9[_0x058a('0x32')]=_['intersection'](_0x3e5ea9[_0x058a('0x30')],_0x3e5ea9[_0x058a('0x31')]);_0x40bf9d['attributes']=_['intersection'](_0x3e5ea9['model'],qs[_0x058a('0x33')](_0x5f21e8[_0x058a('0x31')][_0x058a('0x33')]));_0x40bf9d[_0x058a('0x34')]=_0x40bf9d[_0x058a('0x34')][_0x058a('0x35')]?_0x40bf9d[_0x058a('0x34')]:_0x3e5ea9['model'];if(!_0x5f21e8[_0x058a('0x31')]['hasOwnProperty'](_0x058a('0x36'))){_0x40bf9d['limit']=qs['limit'](_0x5f21e8['query'][_0x058a('0x1b')]);_0x40bf9d[_0x058a('0x1d')]=qs['offset'](_0x5f21e8[_0x058a('0x31')][_0x058a('0x1d')]);}_0x40bf9d[_0x058a('0x37')]=qs['sort'](_0x5f21e8[_0x058a('0x31')][_0x058a('0x38')]);_0x40bf9d[_0x058a('0x39')]=qs['filters'](_[_0x058a('0x3a')](_0x5f21e8[_0x058a('0x31')],_0x3e5ea9[_0x058a('0x32')]),_0x209282);if(_0x5f21e8['query'][_0x058a('0x3b')]){_0x40bf9d[_0x058a('0x39')]=_['merge'](_0x40bf9d[_0x058a('0x39')],{'$or':_['map'](_0x209282,function(_0x2bd483){if(_0x2bd483[_0x058a('0x2e')]!==_0x058a('0x3c')){var _0x3e0272={};_0x3e0272[_0x2bd483[_0x058a('0x29')]]={'$like':'%'+_0x5f21e8[_0x058a('0x31')]['filter']+'%'};return _0x3e0272;}})});}_0x40bf9d=_[_0x058a('0x3d')]({},_0x40bf9d,_0x5f21e8[_0x058a('0x3e')]);var _0x1d3675={'where':_0x40bf9d[_0x058a('0x39')]};return db['SalesforceConfiguration'][_0x058a('0x1c')](_0x1d3675)[_0x058a('0x23')](function(_0x5d83e0){_0x44bac1[_0x058a('0x1c')]=_0x5d83e0;if(_0x5f21e8['query'][_0x058a('0x3f')]){_0x40bf9d[_0x058a('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x058a('0x41')](_0x40bf9d);})['then'](function(_0x4cfce3){_0x44bac1[_0x058a('0x42')]=_0x4cfce3;return _0x44bac1;})[_0x058a('0x23')](respondWithFilteredResult(_0x484557,_0x40bf9d))[_0x058a('0x43')](handleError(_0x484557,null));};exports[_0x058a('0x44')]=function(_0x52598d,_0x40b66f){var _0x4b273a={'raw':![],'where':{'id':_0x52598d[_0x058a('0x45')]['id']}},_0x2b624f={};_0x2b624f[_0x058a('0x30')]=_['keys'](db[_0x058a('0x2c')][_0x058a('0x46')]);_0x2b624f[_0x058a('0x31')]=_[_0x058a('0x47')](_0x52598d[_0x058a('0x31')]);_0x2b624f[_0x058a('0x32')]=_[_0x058a('0x48')](_0x2b624f['model'],_0x2b624f[_0x058a('0x31')]);_0x4b273a[_0x058a('0x34')]=_[_0x058a('0x48')](_0x2b624f[_0x058a('0x30')],qs['fields'](_0x52598d[_0x058a('0x31')][_0x058a('0x33')]));_0x4b273a[_0x058a('0x34')]=_0x4b273a[_0x058a('0x34')][_0x058a('0x35')]?_0x4b273a[_0x058a('0x34')]:_0x2b624f[_0x058a('0x30')];if(_0x52598d[_0x058a('0x31')][_0x058a('0x3f')]){_0x4b273a['include']=[{'all':!![]}];}_0x4b273a=_[_0x058a('0x3d')]({},_0x4b273a,_0x52598d['options']);return db[_0x058a('0x2c')][_0x058a('0x49')](_0x4b273a)[_0x058a('0x23')](handleEntityNotFound(_0x40b66f,null))['then'](respondWithResult(_0x40b66f,null))[_0x058a('0x43')](handleError(_0x40b66f,null));};exports[_0x058a('0x4a')]=function(_0x5c230c,_0x4a560d){return db['SalesforceConfiguration']['create'](_0x5c230c[_0x058a('0x4b')],{})[_0x058a('0x23')](respondWithResult(_0x4a560d,0xc9))[_0x058a('0x43')](handleError(_0x4a560d,null));};exports[_0x058a('0x22')]=function(_0x5ce2ec,_0x321a59){if(_0x5ce2ec[_0x058a('0x4b')]['id']){delete _0x5ce2ec['body']['id'];}return db[_0x058a('0x2c')][_0x058a('0x49')]({'where':{'id':_0x5ce2ec[_0x058a('0x45')]['id']}})['then'](handleEntityNotFound(_0x321a59,null))[_0x058a('0x23')](saveUpdates(_0x5ce2ec[_0x058a('0x4b')],null))['then'](respondWithResult(_0x321a59,null))[_0x058a('0x43')](handleError(_0x321a59,null));};exports[_0x058a('0x24')]=function(_0x221fc4,_0x2bb546){return db[_0x058a('0x2c')][_0x058a('0x49')]({'where':{'id':_0x221fc4['params']['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x2bb546,null))[_0x058a('0x23')](removeEntity(_0x2bb546,null))[_0x058a('0x43')](handleError(_0x2bb546,null));};exports[_0x058a('0x4c')]=function(_0x1dc95e,_0x14fd6c,_0xf9cd0c){var _0xe59d12={};var _0x21b76d={};var _0x1b6a20;var _0x36ef8a;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x1dc95e[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x14fd6c,null))[_0x058a('0x23')](function(_0xd22f8e){if(_0xd22f8e){_0x1b6a20=_0xd22f8e;_0x21b76d['model']=_[_0x058a('0x47')](db['SalesforceField']['rawAttributes']);_0x21b76d[_0x058a('0x31')]=_[_0x058a('0x47')](_0x1dc95e[_0x058a('0x31')]);_0x21b76d[_0x058a('0x32')]=_[_0x058a('0x48')](_0x21b76d[_0x058a('0x30')],_0x21b76d[_0x058a('0x31')]);_0xe59d12[_0x058a('0x34')]=_[_0x058a('0x48')](_0x21b76d[_0x058a('0x30')],qs[_0x058a('0x33')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x33')]));_0xe59d12[_0x058a('0x34')]=_0xe59d12['attributes']['length']?_0xe59d12[_0x058a('0x34')]:_0x21b76d[_0x058a('0x30')];_0xe59d12['order']=qs['sort'](_0x1dc95e[_0x058a('0x31')][_0x058a('0x38')]);_0xe59d12[_0x058a('0x39')]=qs[_0x058a('0x32')](_[_0x058a('0x3a')](_0x1dc95e[_0x058a('0x31')],_0x21b76d['filters']));if(_0x1dc95e[_0x058a('0x31')][_0x058a('0x3b')]){_0xe59d12[_0x058a('0x39')]=_['merge'](_0xe59d12['where'],{'$or':_['map'](_0xe59d12[_0x058a('0x34')],function(_0x1308dd){var _0x3b7f43={};_0x3b7f43[_0x1308dd]={'$like':'%'+_0x1dc95e[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x3b7f43;})});}_0xe59d12=_['merge']({},_0xe59d12,_0x1dc95e['options']);return _0x1b6a20[_0x058a('0x4c')](_0xe59d12);}})[_0x058a('0x23')](function(_0x2391cb){if(_0x2391cb){_0x36ef8a=_0x2391cb[_0x058a('0x35')];if(!_0x1dc95e['query']['hasOwnProperty'](_0x058a('0x36'))){_0xe59d12['limit']=qs[_0x058a('0x1b')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x1b')]);_0xe59d12[_0x058a('0x1d')]=qs[_0x058a('0x1d')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x1b6a20[_0x058a('0x4c')](_0xe59d12);}})['then'](function(_0x154ea0){if(_0x154ea0){return _0x154ea0?{'count':_0x36ef8a,'rows':_0x154ea0}:null;}})['then'](respondWithResult(_0x14fd6c,null))[_0x058a('0x43')](handleError(_0x14fd6c,null));};exports[_0x058a('0x4e')]=function(_0x51c0ee,_0x463da3,_0x257580){var _0x5f4799={};var _0x500fe2={};var _0x1b8be4;var _0x19ec74;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x51c0ee[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x463da3,null))[_0x058a('0x23')](function(_0x27a7ef){if(_0x27a7ef){_0x1b8be4=_0x27a7ef;_0x500fe2['model']=_[_0x058a('0x47')](db[_0x058a('0x4f')][_0x058a('0x46')]);_0x500fe2[_0x058a('0x31')]=_[_0x058a('0x47')](_0x51c0ee[_0x058a('0x31')]);_0x500fe2[_0x058a('0x32')]=_['intersection'](_0x500fe2[_0x058a('0x30')],_0x500fe2['query']);_0x5f4799[_0x058a('0x34')]=_['intersection'](_0x500fe2[_0x058a('0x30')],qs[_0x058a('0x33')](_0x51c0ee[_0x058a('0x31')][_0x058a('0x33')]));_0x5f4799[_0x058a('0x34')]=_0x5f4799[_0x058a('0x34')][_0x058a('0x35')]?_0x5f4799[_0x058a('0x34')]:_0x500fe2[_0x058a('0x30')];_0x5f4799[_0x058a('0x37')]=qs[_0x058a('0x38')](_0x51c0ee['query'][_0x058a('0x38')]);_0x5f4799['where']=qs[_0x058a('0x32')](_[_0x058a('0x3a')](_0x51c0ee[_0x058a('0x31')],_0x500fe2[_0x058a('0x32')]));if(_0x51c0ee[_0x058a('0x31')][_0x058a('0x3b')]){_0x5f4799[_0x058a('0x39')]=_[_0x058a('0x3d')](_0x5f4799['where'],{'$or':_[_0x058a('0x2b')](_0x5f4799[_0x058a('0x34')],function(_0x212c56){var _0x3775ef={};_0x3775ef[_0x212c56]={'$like':'%'+_0x51c0ee[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x3775ef;})});}_0x5f4799=_[_0x058a('0x3d')]({},_0x5f4799,_0x51c0ee[_0x058a('0x3e')]);return _0x1b8be4[_0x058a('0x4e')](_0x5f4799);}})['then'](function(_0xd375b3){if(_0xd375b3){_0x19ec74=_0xd375b3[_0x058a('0x35')];if(!_0x51c0ee[_0x058a('0x31')][_0x058a('0x50')](_0x058a('0x36'))){_0x5f4799[_0x058a('0x1b')]=qs['limit'](_0x51c0ee[_0x058a('0x31')]['limit']);_0x5f4799['offset']=qs['offset'](_0x51c0ee[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x1b8be4[_0x058a('0x4e')](_0x5f4799);}})['then'](function(_0x524b34){if(_0x524b34){return _0x524b34?{'count':_0x19ec74,'rows':_0x524b34}:null;}})['then'](respondWithResult(_0x463da3,null))[_0x058a('0x43')](handleError(_0x463da3,null));};exports[_0x058a('0x51')]=function(_0x510bcd,_0x437076,_0x49727c){var _0x17d4e0={};var _0x349dde={};var _0x4c1244;var _0xb298c;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x510bcd[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x437076,null))[_0x058a('0x23')](function(_0xc11de5){if(_0xc11de5){_0x4c1244=_0xc11de5;_0x349dde['model']=_[_0x058a('0x47')](db[_0x058a('0x4f')][_0x058a('0x46')]);_0x349dde[_0x058a('0x31')]=_[_0x058a('0x47')](_0x510bcd[_0x058a('0x31')]);_0x349dde[_0x058a('0x32')]=_[_0x058a('0x48')](_0x349dde[_0x058a('0x30')],_0x349dde[_0x058a('0x31')]);_0x17d4e0['attributes']=_[_0x058a('0x48')](_0x349dde['model'],qs['fields'](_0x510bcd[_0x058a('0x31')][_0x058a('0x33')]));_0x17d4e0[_0x058a('0x34')]=_0x17d4e0[_0x058a('0x34')][_0x058a('0x35')]?_0x17d4e0['attributes']:_0x349dde[_0x058a('0x30')];_0x17d4e0[_0x058a('0x37')]=qs['sort'](_0x510bcd[_0x058a('0x31')][_0x058a('0x38')]);_0x17d4e0['where']=qs[_0x058a('0x32')](_['pick'](_0x510bcd['query'],_0x349dde[_0x058a('0x32')]));if(_0x510bcd['query'][_0x058a('0x3b')]){_0x17d4e0['where']=_[_0x058a('0x3d')](_0x17d4e0[_0x058a('0x39')],{'$or':_['map'](_0x17d4e0[_0x058a('0x34')],function(_0x26cc19){var _0x50939a={};_0x50939a[_0x26cc19]={'$like':'%'+_0x510bcd[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x50939a;})});}_0x17d4e0=_[_0x058a('0x3d')]({},_0x17d4e0,_0x510bcd['options']);return _0x4c1244[_0x058a('0x51')](_0x17d4e0);}})[_0x058a('0x23')](function(_0x2e6eaf){if(_0x2e6eaf){_0xb298c=_0x2e6eaf[_0x058a('0x35')];if(!_0x510bcd[_0x058a('0x31')]['hasOwnProperty'](_0x058a('0x36'))){_0x17d4e0[_0x058a('0x1b')]=qs['limit'](_0x510bcd[_0x058a('0x31')]['limit']);_0x17d4e0[_0x058a('0x1d')]=qs['offset'](_0x510bcd[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x4c1244[_0x058a('0x51')](_0x17d4e0);}})[_0x058a('0x23')](function(_0x156dbb){if(_0x156dbb){return _0x156dbb?{'count':_0xb298c,'rows':_0x156dbb}:null;}})[_0x058a('0x23')](respondWithResult(_0x437076,null))['catch'](handleError(_0x437076,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 828d7d6..a51f63a 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 _0x6819=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','api','moment','request-promise','../../config/environment'];(function(_0x209908,_0xbfcd32){var _0x68e1eb=function(_0x35c468){while(--_0x35c468){_0x209908['push'](_0x209908['shift']());}};_0x68e1eb(++_0xbfcd32);}(_0x6819,0x127));var _0x9681=function(_0x53a58a,_0x474bd3){_0x53a58a=_0x53a58a-0x0;var _0x2df429=_0x6819[_0x53a58a];return _0x2df429;};'use strict';var _=require(_0x9681('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9681('0x1'));var moment=require(_0x9681('0x2'));var BPromise=require('bluebird');var rp=require(_0x9681('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9681('0x4'));var attributes=require(_0x9681('0x5'));module[_0x9681('0x6')]=function(_0x41d300,_0x22646d){return _0x41d300[_0x9681('0x7')](_0x9681('0x8'),attributes,{'tableName':_0x9681('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ac6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x479646,_0x31e898){var _0x5c809b=function(_0x3b1e27){while(--_0x3b1e27){_0x479646['push'](_0x479646['shift']());}};_0x5c809b(++_0x31e898);}(_0x0ac6,0xf1));var _0x60ac=function(_0x202bb5,_0x4c5a09){_0x202bb5=_0x202bb5-0x0;var _0x1733b8=_0x0ac6[_0x202bb5];return _0x1733b8;};'use strict';var _=require(_0x60ac('0x0'));var util=require('util');var logger=require(_0x60ac('0x1'))(_0x60ac('0x2'));var moment=require('moment');var BPromise=require(_0x60ac('0x3'));var rp=require(_0x60ac('0x4'));var fs=require('fs');var path=require(_0x60ac('0x5'));var rimraf=require(_0x60ac('0x6'));var config=require(_0x60ac('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x134cf8,_0x2eb37b){return _0x134cf8[_0x60ac('0x8')](_0x60ac('0x9'),attributes,{'tableName':_0x60ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index c97ae6b..da28307 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 _0x876b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x56efcb,_0x16eaf7){var _0x2027ab=function(_0x271943){while(--_0x271943){_0x56efcb['push'](_0x56efcb['shift']());}};_0x2027ab(++_0x16eaf7);}(_0x876b,0x141));var _0xb876=function(_0x4026ef,_0x4504a2){_0x4026ef=_0x4026ef-0x0;var _0x1bb210=_0x876b[_0x4026ef];return _0x1bb210;};'use strict';var _=require(_0xb876('0x0'));var util=require(_0xb876('0x1'));var moment=require(_0xb876('0x2'));var BPromise=require('bluebird');var rs=require(_0xb876('0x3'));var fs=require('fs');var Redis=require(_0xb876('0x4'));var db=require(_0xb876('0x5'))['db'];var utils=require(_0xb876('0x6'));var logger=require(_0xb876('0x7'))(_0xb876('0x8'));var config=require(_0xb876('0x9'));var jayson=require(_0xb876('0xa'));var client=jayson[_0xb876('0xb')][_0xb876('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39f367,_0x2e8254,_0x198a08){return new BPromise(function(_0xcfc021,_0x223700){return client[_0xb876('0xd')](_0x39f367,_0x198a08)[_0xb876('0xe')](function(_0x5e826f){logger[_0xb876('0xf')](_0xb876('0x10'),_0x2e8254,_0xb876('0x11'));logger[_0xb876('0x12')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2e8254,'request\x20sent',JSON[_0xb876('0x13')](_0x5e826f));if(_0x5e826f[_0xb876('0x14')]){if(_0x5e826f[_0xb876('0x14')][_0xb876('0x15')]===0x1f4){logger[_0xb876('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2e8254,_0x5e826f[_0xb876('0x14')]['message']);return _0x223700(_0x5e826f[_0xb876('0x14')][_0xb876('0x16')]);}logger[_0xb876('0x14')](_0xb876('0x10'),_0x2e8254,_0x5e826f[_0xb876('0x14')]['message']);return _0xcfc021(_0x5e826f[_0xb876('0x14')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2e8254,_0xb876('0x11'));_0xcfc021(_0x5e826f[_0xb876('0x17')][_0xb876('0x16')]);}})[_0xb876('0x18')](function(_0x39ff17){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2e8254,_0x39ff17);_0x223700(_0x39ff17);});});} \ No newline at end of file +var _0xd78d=['request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x1cefd7,_0x1ede17){var _0x157286=function(_0x279917){while(--_0x279917){_0x1cefd7['push'](_0x1cefd7['shift']());}};_0x157286(++_0x1ede17);}(_0xd78d,0x6f));var _0xdd78=function(_0x674e0a,_0x424d90){_0x674e0a=_0x674e0a-0x0;var _0x5ca3fd=_0xd78d[_0x674e0a];return _0x5ca3fd;};'use strict';var _=require(_0xdd78('0x0'));var util=require(_0xdd78('0x1'));var moment=require('moment');var BPromise=require(_0xdd78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd78('0x3'));var db=require(_0xdd78('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd78('0x5'));var config=require(_0xdd78('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd78('0x7')][_0xdd78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40face,_0x4c84d9,_0x1666cf){return new BPromise(function(_0x278f50,_0x1debb0){return client[_0xdd78('0x9')](_0x40face,_0x1666cf)[_0xdd78('0xa')](function(_0x2611c3){logger['info'](_0xdd78('0xb'),_0x4c84d9,_0xdd78('0xc'));logger[_0xdd78('0xd')](_0xdd78('0xe'),_0x4c84d9,_0xdd78('0xc'),JSON['stringify'](_0x2611c3));if(_0x2611c3[_0xdd78('0xf')]){if(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x10')]===0x1f4){logger['error'](_0xdd78('0xb'),_0x4c84d9,_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);return _0x1debb0(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);}logger[_0xdd78('0xf')](_0xdd78('0xb'),_0x4c84d9,_0x2611c3[_0xdd78('0xf')]['message']);return _0x278f50(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);}else{logger['info'](_0xdd78('0xb'),_0x4c84d9,_0xdd78('0xc'));_0x278f50(_0x2611c3[_0xdd78('0x12')][_0xdd78('0x11')]);}})[_0xdd78('0x13')](function(_0x50d21f){logger[_0xdd78('0xf')](_0xdd78('0xb'),_0x4c84d9,_0x50d21f);_0x1debb0(_0x50d21f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2e27a45..4d2fbb9 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 _0xda41=['isAuthenticated','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get'];(function(_0x4e2aec,_0x2b349b){var _0x38c1f=function(_0x1ccec1){while(--_0x1ccec1){_0x4e2aec['push'](_0x4e2aec['shift']());}};_0x38c1f(++_0x2b349b);}(_0xda41,0x1e3));var _0x1da4=function(_0x1878a8,_0x36d1b2){_0x1878a8=_0x1878a8-0x0;var _0x5a68d5=_0xda41[_0x1878a8];return _0x5a68d5;};'use strict';var multer=require(_0x1da4('0x0'));var util=require(_0x1da4('0x1'));var path=require('path');var timeout=require(_0x1da4('0x2'));var express=require(_0x1da4('0x3'));var router=express[_0x1da4('0x4')]();var fs_extra=require(_0x1da4('0x5'));var auth=require(_0x1da4('0x6'));var interaction=require(_0x1da4('0x7'));var config=require('../../config/environment');var controller=require(_0x1da4('0x8'));router[_0x1da4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1da4('0x9')]('/:id',auth[_0x1da4('0xa')](),controller[_0x1da4('0xb')]);router[_0x1da4('0xc')]('/',auth[_0x1da4('0xa')](),controller[_0x1da4('0xd')]);router[_0x1da4('0xe')]('/:id',auth[_0x1da4('0xa')](),controller['update']);router[_0x1da4('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1da4('0x10')]=router; \ No newline at end of file +var _0x744f=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x744f,0xb8));var _0xf744=function(_0x439a4d,_0x1c0018){_0x439a4d=_0x439a4d-0x0;var _0x2025b6=_0x744f[_0x439a4d];return _0x2025b6;};'use strict';var multer=require(_0xf744('0x0'));var util=require(_0xf744('0x1'));var path=require(_0xf744('0x2'));var timeout=require(_0xf744('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf744('0x4'));var interaction=require(_0xf744('0x5'));var config=require('../../config/environment');var controller=require(_0xf744('0x6'));router[_0xf744('0x7')]('/',auth[_0xf744('0x8')](),controller[_0xf744('0x9')]);router[_0xf744('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf744('0xa')]);router['post']('/',auth[_0xf744('0x8')](),controller[_0xf744('0xb')]);router[_0xf744('0xc')](_0xf744('0xd'),auth[_0xf744('0x8')](),controller[_0xf744('0xe')]);router[_0xf744('0xf')](_0xf744('0xd'),auth['isAuthenticated'](),controller[_0xf744('0x10')]);module[_0xf744('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 2e632fa..ec2043e 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 _0xd4f4=['string','variable','customVariable','keyValue','picklist','STRING','exports','ENUM'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd4f4,0x136));var _0x4d4f=function(_0x1c8e76,_0x44d61e){_0x1c8e76=_0x1c8e76-0x0;var _0x97e281=_0xd4f4[_0x1c8e76];return _0x97e281;};'use strict';var Sequelize=require('sequelize');module[_0x4d4f('0x0')]={'type':{'type':Sequelize[_0x4d4f('0x1')](_0x4d4f('0x2'),_0x4d4f('0x3'),_0x4d4f('0x4'),_0x4d4f('0x5'),_0x4d4f('0x6')),'defaultValue':_0x4d4f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4d4f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4d4f('0x2'),_0x4d4f('0x3'),_0x4d4f('0x4'))},'keyContent':{'type':Sequelize[_0x4d4f('0x7')]},'idField':{'type':Sequelize[_0x4d4f('0x7')]},'variableName':{'type':Sequelize[_0x4d4f('0x7')]}}; \ No newline at end of file +var _0xf5ed=['picklist','STRING','string','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xf5ed,0x1f3));var _0xdf5e=function(_0x1d6b12,_0x277761){_0x1d6b12=_0x1d6b12-0x0;var _0xf8cddb=_0xf5ed[_0x1d6b12];return _0xf8cddb;};'use strict';var Sequelize=require(_0xdf5e('0x0'));module[_0xdf5e('0x1')]={'type':{'type':Sequelize[_0xdf5e('0x2')]('string',_0xdf5e('0x3'),'customVariable',_0xdf5e('0x4'),_0xdf5e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdf5e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdf5e('0x7'),_0xdf5e('0x3'),_0xdf5e('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdf5e('0x6')]},'variableName':{'type':Sequelize[_0xdf5e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 59e8076..376cc09 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 _0xd9e2=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','SalesforceField','rawAttributes','model','map','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create'];(function(_0x1f52a5,_0x89e911){var _0x584f77=function(_0xdc88aa){while(--_0xdc88aa){_0x1f52a5['push'](_0x1f52a5['shift']());}};_0x584f77(++_0x89e911);}(_0xd9e2,0x99));var _0x2d9e=function(_0x2c7f80,_0x2b0052){_0x2c7f80=_0x2c7f80-0x0;var _0x11fe38=_0xd9e2[_0x2c7f80];return _0x11fe38;};'use strict';var emlformat=require(_0x2d9e('0x0'));var rimraf=require(_0x2d9e('0x1'));var zipdir=require(_0x2d9e('0x2'));var jsonpatch=require(_0x2d9e('0x3'));var rp=require(_0x2d9e('0x4'));var moment=require(_0x2d9e('0x5'));var BPromise=require(_0x2d9e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2d9e('0x7'));var ejs=require(_0x2d9e('0x8'));var fs=require('fs');var fs_extra=require(_0x2d9e('0x9'));var _=require(_0x2d9e('0xa'));var squel=require(_0x2d9e('0xb'));var crypto=require(_0x2d9e('0xc'));var jsforce=require(_0x2d9e('0xd'));var deskjs=require(_0x2d9e('0xe'));var toCsv=require(_0x2d9e('0x7'));var querystring=require(_0x2d9e('0xf'));var Papa=require(_0x2d9e('0x10'));var Redis=require(_0x2d9e('0x11'));var authService=require(_0x2d9e('0x12'));var qs=require(_0x2d9e('0x13'));var as=require(_0x2d9e('0x14'));var hardwareService=require(_0x2d9e('0x15'));var logger=require(_0x2d9e('0x16'))(_0x2d9e('0x17'));var utils=require(_0x2d9e('0x18'));var config=require(_0x2d9e('0x19'));var licenseUtil=require(_0x2d9e('0x1a'));var db=require(_0x2d9e('0x1b'))['db'];function respondWithStatusCode(_0x3a993e,_0x2899da){_0x2899da=_0x2899da||0xcc;return function(_0x48baff){if(_0x48baff){return _0x3a993e[_0x2d9e('0x1c')](_0x2899da);}return _0x3a993e[_0x2d9e('0x1d')](_0x2899da)[_0x2d9e('0x1e')]();};}function respondWithResult(_0x542b43,_0xfcdff1){_0xfcdff1=_0xfcdff1||0xc8;return function(_0x2343e1){if(_0x2343e1){return _0x542b43[_0x2d9e('0x1d')](_0xfcdff1)['json'](_0x2343e1);}};}function respondWithFilteredResult(_0x7a7547,_0x133bcd){return function(_0x582a07){if(_0x582a07){var _0x49f680=typeof _0x133bcd[_0x2d9e('0x1f')]===_0x2d9e('0x20')&&typeof _0x133bcd[_0x2d9e('0x21')]===_0x2d9e('0x20');var _0x569f6a=_0x582a07[_0x2d9e('0x22')];var _0x20f438=_0x49f680?0x0:_0x133bcd[_0x2d9e('0x1f')];var _0x3becd8=_0x49f680?_0x582a07[_0x2d9e('0x22')]:_0x133bcd[_0x2d9e('0x1f')]+_0x133bcd['limit'];var _0x405a34;if(_0x3becd8>=_0x569f6a){_0x3becd8=_0x569f6a;_0x405a34=0xc8;}else{_0x405a34=0xce;}_0x7a7547[_0x2d9e('0x1d')](_0x405a34);return _0x7a7547[_0x2d9e('0x23')](_0x2d9e('0x24'),_0x20f438+'-'+_0x3becd8+'/'+_0x569f6a)['json'](_0x582a07);}return null;};}function patchUpdates(_0x31756b){return function(_0x4fe655){try{jsonpatch[_0x2d9e('0x25')](_0x4fe655,_0x31756b,!![]);}catch(_0xdbbf0e){return BPromise['reject'](_0xdbbf0e);}return _0x4fe655[_0x2d9e('0x26')]();};}function saveUpdates(_0x2bdce0,_0x2731e3){return function(_0x5c7dce){if(_0x5c7dce){return _0x5c7dce[_0x2d9e('0x27')](_0x2bdce0)[_0x2d9e('0x28')](function(_0x1da558){return _0x1da558;});}return null;};}function removeEntity(_0x5d1b68,_0x32628c){return function(_0x2281ae){if(_0x2281ae){return _0x2281ae[_0x2d9e('0x29')]()['then'](function(){_0x5d1b68[_0x2d9e('0x1d')](0xcc)[_0x2d9e('0x1e')]();});}};}function handleEntityNotFound(_0x477606,_0x2b6d2b){return function(_0x32cd7b){if(!_0x32cd7b){_0x477606[_0x2d9e('0x1c')](0x194);}return _0x32cd7b;};}function handleError(_0x59dad6,_0x4eaa8b){_0x4eaa8b=_0x4eaa8b||0x1f4;return function(_0x8675a8){logger[_0x2d9e('0x2a')](_0x8675a8[_0x2d9e('0x2b')]);if(_0x8675a8['name']){delete _0x8675a8['name'];}_0x59dad6['status'](_0x4eaa8b)[_0x2d9e('0x2c')](_0x8675a8);};}exports['index']=function(_0x22d87e,_0x3f7fc3){var _0x31573b={},_0x4b5bff={},_0xaff700={'count':0x0,'rows':[]};var _0x5c3cc4=_['map'](db[_0x2d9e('0x2d')][_0x2d9e('0x2e')],function(_0xbcd7cb){return{'name':_0xbcd7cb['fieldName'],'type':_0xbcd7cb['type']['key']};});_0x4b5bff[_0x2d9e('0x2f')]=_[_0x2d9e('0x30')](_0x5c3cc4,_0x2d9e('0x31'));_0x4b5bff['query']=_[_0x2d9e('0x32')](_0x22d87e[_0x2d9e('0x33')]);_0x4b5bff[_0x2d9e('0x34')]=_['intersection'](_0x4b5bff[_0x2d9e('0x2f')],_0x4b5bff[_0x2d9e('0x33')]);_0x31573b[_0x2d9e('0x35')]=_[_0x2d9e('0x36')](_0x4b5bff[_0x2d9e('0x2f')],qs[_0x2d9e('0x37')](_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x37')]));_0x31573b[_0x2d9e('0x35')]=_0x31573b[_0x2d9e('0x35')]['length']?_0x31573b['attributes']:_0x4b5bff[_0x2d9e('0x2f')];if(!_0x22d87e['query'][_0x2d9e('0x38')]('nolimit')){_0x31573b[_0x2d9e('0x21')]=qs[_0x2d9e('0x21')](_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x21')]);_0x31573b[_0x2d9e('0x1f')]=qs[_0x2d9e('0x1f')](_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x1f')]);}_0x31573b[_0x2d9e('0x39')]=qs[_0x2d9e('0x3a')](_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x3a')]);_0x31573b[_0x2d9e('0x3b')]=qs[_0x2d9e('0x34')](_[_0x2d9e('0x3c')](_0x22d87e['query'],_0x4b5bff[_0x2d9e('0x34')]),_0x5c3cc4);if(_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x3d')]){_0x31573b[_0x2d9e('0x3b')]=_[_0x2d9e('0x3e')](_0x31573b['where'],{'$or':_['map'](_0x5c3cc4,function(_0x4632f5){if(_0x4632f5['type']!==_0x2d9e('0x3f')){var _0x33a04e={};_0x33a04e[_0x4632f5[_0x2d9e('0x31')]]={'$like':'%'+_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x3d')]+'%'};return _0x33a04e;}})});}_0x31573b=_['merge']({},_0x31573b,_0x22d87e[_0x2d9e('0x40')]);var _0x452910={'where':_0x31573b[_0x2d9e('0x3b')]};return db[_0x2d9e('0x2d')]['count'](_0x452910)['then'](function(_0x537228){_0xaff700[_0x2d9e('0x22')]=_0x537228;if(_0x22d87e[_0x2d9e('0x33')][_0x2d9e('0x41')]){_0x31573b[_0x2d9e('0x42')]=[{'all':!![]}];}return db[_0x2d9e('0x2d')][_0x2d9e('0x43')](_0x31573b);})[_0x2d9e('0x28')](function(_0xc84e47){_0xaff700[_0x2d9e('0x44')]=_0xc84e47;return _0xaff700;})[_0x2d9e('0x28')](respondWithFilteredResult(_0x3f7fc3,_0x31573b))[_0x2d9e('0x45')](handleError(_0x3f7fc3,null));};exports[_0x2d9e('0x46')]=function(_0x45d8e4,_0x48f059){var _0x14b64d={'raw':!![],'where':{'id':_0x45d8e4[_0x2d9e('0x47')]['id']}},_0x3521f8={};_0x3521f8[_0x2d9e('0x2f')]=_[_0x2d9e('0x32')](db[_0x2d9e('0x2d')]['rawAttributes']);_0x3521f8[_0x2d9e('0x33')]=_[_0x2d9e('0x32')](_0x45d8e4[_0x2d9e('0x33')]);_0x3521f8[_0x2d9e('0x34')]=_[_0x2d9e('0x36')](_0x3521f8[_0x2d9e('0x2f')],_0x3521f8[_0x2d9e('0x33')]);_0x14b64d[_0x2d9e('0x35')]=_[_0x2d9e('0x36')](_0x3521f8[_0x2d9e('0x2f')],qs[_0x2d9e('0x37')](_0x45d8e4['query']['fields']));_0x14b64d['attributes']=_0x14b64d[_0x2d9e('0x35')][_0x2d9e('0x48')]?_0x14b64d[_0x2d9e('0x35')]:_0x3521f8[_0x2d9e('0x2f')];if(_0x45d8e4[_0x2d9e('0x33')][_0x2d9e('0x41')]){_0x14b64d[_0x2d9e('0x42')]=[{'all':!![]}];}_0x14b64d=_[_0x2d9e('0x3e')]({},_0x14b64d,_0x45d8e4['options']);return db[_0x2d9e('0x2d')][_0x2d9e('0x49')](_0x14b64d)['then'](handleEntityNotFound(_0x48f059,null))[_0x2d9e('0x28')](respondWithResult(_0x48f059,null))['catch'](handleError(_0x48f059,null));};exports[_0x2d9e('0x4a')]=function(_0x2c4a10,_0x4c3b8a){return db[_0x2d9e('0x2d')][_0x2d9e('0x4a')](_0x2c4a10[_0x2d9e('0x4b')],{})['then'](respondWithResult(_0x4c3b8a,0xc9))[_0x2d9e('0x45')](handleError(_0x4c3b8a,null));};exports[_0x2d9e('0x27')]=function(_0x46a8aa,_0x792d69){if(_0x46a8aa['body']['id']){delete _0x46a8aa[_0x2d9e('0x4b')]['id'];}return db[_0x2d9e('0x2d')]['find']({'where':{'id':_0x46a8aa[_0x2d9e('0x47')]['id']}})[_0x2d9e('0x28')](handleEntityNotFound(_0x792d69,null))['then'](saveUpdates(_0x46a8aa[_0x2d9e('0x4b')],null))[_0x2d9e('0x28')](respondWithResult(_0x792d69,null))[_0x2d9e('0x45')](handleError(_0x792d69,null));};exports[_0x2d9e('0x29')]=function(_0x136e53,_0x5924a6){return db['SalesforceField'][_0x2d9e('0x49')]({'where':{'id':_0x136e53[_0x2d9e('0x47')]['id']}})[_0x2d9e('0x28')](handleEntityNotFound(_0x5924a6,null))[_0x2d9e('0x28')](removeEntity(_0x5924a6,null))[_0x2d9e('0x45')](handleError(_0x5924a6,null));}; \ No newline at end of file +var _0x4053=['../../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','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x408e7f,_0xbb794){var _0x155181=function(_0xd2b36b){while(--_0xd2b36b){_0x408e7f['push'](_0x408e7f['shift']());}};_0x155181(++_0xbb794);}(_0x4053,0xd7));var _0x3405=function(_0x1c212f,_0x59d13f){_0x1c212f=_0x1c212f-0x0;var _0x212fee=_0x4053[_0x1c212f];return _0x212fee;};'use strict';var emlformat=require(_0x3405('0x0'));var rimraf=require(_0x3405('0x1'));var zipdir=require(_0x3405('0x2'));var jsonpatch=require(_0x3405('0x3'));var rp=require(_0x3405('0x4'));var moment=require(_0x3405('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3405('0x6'));var util=require(_0x3405('0x7'));var path=require(_0x3405('0x8'));var sox=require(_0x3405('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3405('0xa'));var _=require(_0x3405('0xb'));var squel=require(_0x3405('0xc'));var crypto=require(_0x3405('0xd'));var jsforce=require(_0x3405('0xe'));var deskjs=require(_0x3405('0xf'));var toCsv=require(_0x3405('0x10'));var querystring=require('querystring');var Papa=require(_0x3405('0x11'));var Redis=require(_0x3405('0x12'));var authService=require(_0x3405('0x13'));var qs=require(_0x3405('0x14'));var as=require(_0x3405('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3405('0x16'))('api');var utils=require(_0x3405('0x17'));var config=require(_0x3405('0x18'));var licenseUtil=require(_0x3405('0x19'));var db=require(_0x3405('0x1a'))['db'];function respondWithStatusCode(_0x45800f,_0x2e0fd2){_0x2e0fd2=_0x2e0fd2||0xcc;return function(_0x3538e7){if(_0x3538e7){return _0x45800f[_0x3405('0x1b')](_0x2e0fd2);}return _0x45800f[_0x3405('0x1c')](_0x2e0fd2)[_0x3405('0x1d')]();};}function respondWithResult(_0x96afc1,_0x4f486c){_0x4f486c=_0x4f486c||0xc8;return function(_0x1c3013){if(_0x1c3013){return _0x96afc1[_0x3405('0x1c')](_0x4f486c)[_0x3405('0x1e')](_0x1c3013);}};}function respondWithFilteredResult(_0x5741c7,_0x4c3144){return function(_0x464673){if(_0x464673){var _0x39582e=typeof _0x4c3144[_0x3405('0x1f')]===_0x3405('0x20')&&typeof _0x4c3144[_0x3405('0x21')]===_0x3405('0x20');var _0x1c4495=_0x464673[_0x3405('0x22')];var _0x5a66f7=_0x39582e?0x0:_0x4c3144[_0x3405('0x1f')];var _0x7b13a7=_0x39582e?_0x464673[_0x3405('0x22')]:_0x4c3144[_0x3405('0x1f')]+_0x4c3144[_0x3405('0x21')];var _0x396435;if(_0x7b13a7>=_0x1c4495){_0x7b13a7=_0x1c4495;_0x396435=0xc8;}else{_0x396435=0xce;}_0x5741c7[_0x3405('0x1c')](_0x396435);return _0x5741c7[_0x3405('0x23')](_0x3405('0x24'),_0x5a66f7+'-'+_0x7b13a7+'/'+_0x1c4495)[_0x3405('0x1e')](_0x464673);}return null;};}function patchUpdates(_0x121cef){return function(_0x5fa692){try{jsonpatch[_0x3405('0x25')](_0x5fa692,_0x121cef,!![]);}catch(_0x3457e7){return BPromise[_0x3405('0x26')](_0x3457e7);}return _0x5fa692[_0x3405('0x27')]();};}function saveUpdates(_0x52f1ee,_0x260826){return function(_0x369181){if(_0x369181){return _0x369181[_0x3405('0x28')](_0x52f1ee)['then'](function(_0x4f5ad8){return _0x4f5ad8;});}return null;};}function removeEntity(_0x295b47,_0xe1810b){return function(_0x42c69b){if(_0x42c69b){return _0x42c69b[_0x3405('0x29')]()[_0x3405('0x2a')](function(){_0x295b47[_0x3405('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe8c67,_0x444596){return function(_0x433708){if(!_0x433708){_0xfe8c67[_0x3405('0x1b')](0x194);}return _0x433708;};}function handleError(_0x279881,_0x17ec5e){_0x17ec5e=_0x17ec5e||0x1f4;return function(_0x1394b0){logger[_0x3405('0x2b')](_0x1394b0['stack']);if(_0x1394b0[_0x3405('0x2c')]){delete _0x1394b0[_0x3405('0x2c')];}_0x279881[_0x3405('0x1c')](_0x17ec5e)[_0x3405('0x2d')](_0x1394b0);};}exports[_0x3405('0x2e')]=function(_0x247bf7,_0x164324){var _0x4b3310={},_0x13902e={},_0xecba45={'count':0x0,'rows':[]};var _0x55089a=_[_0x3405('0x2f')](db[_0x3405('0x30')][_0x3405('0x31')],function(_0x5758bc){return{'name':_0x5758bc[_0x3405('0x32')],'type':_0x5758bc[_0x3405('0x33')][_0x3405('0x34')]};});_0x13902e[_0x3405('0x35')]=_['map'](_0x55089a,_0x3405('0x2c'));_0x13902e[_0x3405('0x36')]=_[_0x3405('0x37')](_0x247bf7[_0x3405('0x36')]);_0x13902e['filters']=_[_0x3405('0x38')](_0x13902e[_0x3405('0x35')],_0x13902e[_0x3405('0x36')]);_0x4b3310[_0x3405('0x39')]=_['intersection'](_0x13902e['model'],qs[_0x3405('0x3a')](_0x247bf7['query'][_0x3405('0x3a')]));_0x4b3310[_0x3405('0x39')]=_0x4b3310[_0x3405('0x39')][_0x3405('0x3b')]?_0x4b3310[_0x3405('0x39')]:_0x13902e[_0x3405('0x35')];if(!_0x247bf7[_0x3405('0x36')][_0x3405('0x3c')](_0x3405('0x3d'))){_0x4b3310['limit']=qs[_0x3405('0x21')](_0x247bf7[_0x3405('0x36')][_0x3405('0x21')]);_0x4b3310[_0x3405('0x1f')]=qs[_0x3405('0x1f')](_0x247bf7[_0x3405('0x36')][_0x3405('0x1f')]);}_0x4b3310['order']=qs[_0x3405('0x3e')](_0x247bf7['query'][_0x3405('0x3e')]);_0x4b3310[_0x3405('0x3f')]=qs[_0x3405('0x40')](_['pick'](_0x247bf7[_0x3405('0x36')],_0x13902e[_0x3405('0x40')]),_0x55089a);if(_0x247bf7[_0x3405('0x36')][_0x3405('0x41')]){_0x4b3310[_0x3405('0x3f')]=_['merge'](_0x4b3310[_0x3405('0x3f')],{'$or':_['map'](_0x55089a,function(_0x5c09af){if(_0x5c09af[_0x3405('0x33')]!=='VIRTUAL'){var _0x5b86a8={};_0x5b86a8[_0x5c09af[_0x3405('0x2c')]]={'$like':'%'+_0x247bf7[_0x3405('0x36')][_0x3405('0x41')]+'%'};return _0x5b86a8;}})});}_0x4b3310=_[_0x3405('0x42')]({},_0x4b3310,_0x247bf7[_0x3405('0x43')]);var _0x518193={'where':_0x4b3310[_0x3405('0x3f')]};return db[_0x3405('0x30')][_0x3405('0x22')](_0x518193)['then'](function(_0x476c4e){_0xecba45[_0x3405('0x22')]=_0x476c4e;if(_0x247bf7[_0x3405('0x36')][_0x3405('0x44')]){_0x4b3310[_0x3405('0x45')]=[{'all':!![]}];}return db[_0x3405('0x30')][_0x3405('0x46')](_0x4b3310);})[_0x3405('0x2a')](function(_0x132064){_0xecba45[_0x3405('0x47')]=_0x132064;return _0xecba45;})['then'](respondWithFilteredResult(_0x164324,_0x4b3310))[_0x3405('0x48')](handleError(_0x164324,null));};exports[_0x3405('0x49')]=function(_0x17b673,_0x1e3318){var _0xe37d31={'raw':!![],'where':{'id':_0x17b673[_0x3405('0x4a')]['id']}},_0x128b4c={};_0x128b4c[_0x3405('0x35')]=_[_0x3405('0x37')](db['SalesforceField'][_0x3405('0x31')]);_0x128b4c[_0x3405('0x36')]=_[_0x3405('0x37')](_0x17b673[_0x3405('0x36')]);_0x128b4c[_0x3405('0x40')]=_[_0x3405('0x38')](_0x128b4c['model'],_0x128b4c['query']);_0xe37d31['attributes']=_[_0x3405('0x38')](_0x128b4c['model'],qs[_0x3405('0x3a')](_0x17b673[_0x3405('0x36')][_0x3405('0x3a')]));_0xe37d31[_0x3405('0x39')]=_0xe37d31[_0x3405('0x39')][_0x3405('0x3b')]?_0xe37d31[_0x3405('0x39')]:_0x128b4c[_0x3405('0x35')];if(_0x17b673[_0x3405('0x36')][_0x3405('0x44')]){_0xe37d31[_0x3405('0x45')]=[{'all':!![]}];}_0xe37d31=_['merge']({},_0xe37d31,_0x17b673[_0x3405('0x43')]);return db[_0x3405('0x30')]['find'](_0xe37d31)[_0x3405('0x2a')](handleEntityNotFound(_0x1e3318,null))[_0x3405('0x2a')](respondWithResult(_0x1e3318,null))[_0x3405('0x48')](handleError(_0x1e3318,null));};exports[_0x3405('0x4b')]=function(_0x2b64d2,_0x494973){return db[_0x3405('0x30')]['create'](_0x2b64d2[_0x3405('0x4c')],{})[_0x3405('0x2a')](respondWithResult(_0x494973,0xc9))[_0x3405('0x48')](handleError(_0x494973,null));};exports[_0x3405('0x28')]=function(_0x1cb587,_0x24cdec){if(_0x1cb587[_0x3405('0x4c')]['id']){delete _0x1cb587[_0x3405('0x4c')]['id'];}return db[_0x3405('0x30')][_0x3405('0x4d')]({'where':{'id':_0x1cb587[_0x3405('0x4a')]['id']}})[_0x3405('0x2a')](handleEntityNotFound(_0x24cdec,null))[_0x3405('0x2a')](saveUpdates(_0x1cb587[_0x3405('0x4c')],null))[_0x3405('0x2a')](respondWithResult(_0x24cdec,null))[_0x3405('0x48')](handleError(_0x24cdec,null));};exports[_0x3405('0x29')]=function(_0x544814,_0x3f0b5a){return db[_0x3405('0x30')][_0x3405('0x4d')]({'where':{'id':_0x544814[_0x3405('0x4a')]['id']}})[_0x3405('0x2a')](handleEntityNotFound(_0x3f0b5a,null))[_0x3405('0x2a')](removeEntity(_0x3f0b5a,null))[_0x3405('0x48')](handleError(_0x3f0b5a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index adb6828..05e72d8 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 _0xe0f1=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','api','moment'];(function(_0x17e88d,_0x5330f7){var _0x52137a=function(_0x250385){while(--_0x250385){_0x17e88d['push'](_0x17e88d['shift']());}};_0x52137a(++_0x5330f7);}(_0xe0f1,0xdc));var _0x1e0f=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xe0f1[_0x29db36];return _0x234e87;};'use strict';var _=require(_0x1e0f('0x0'));var util=require(_0x1e0f('0x1'));var logger=require(_0x1e0f('0x2'))(_0x1e0f('0x3'));var moment=require(_0x1e0f('0x4'));var BPromise=require('bluebird');var rp=require(_0x1e0f('0x5'));var fs=require('fs');var path=require(_0x1e0f('0x6'));var rimraf=require(_0x1e0f('0x7'));var config=require(_0x1e0f('0x8'));var attributes=require(_0x1e0f('0x9'));module[_0x1e0f('0xa')]=function(_0x2ec070,_0xe3f840){return _0x2ec070[_0x1e0f('0xb')](_0x1e0f('0xc'),attributes,{'tableName':_0x1e0f('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x1e0f('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5afb=['request-promise','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','util','bluebird'];(function(_0x45c5d7,_0x1d0928){var _0x54f9d9=function(_0x425168){while(--_0x425168){_0x45c5d7['push'](_0x45c5d7['shift']());}};_0x54f9d9(++_0x1d0928);}(_0x5afb,0x94));var _0xb5af=function(_0x281353,_0x5d53a9){_0x281353=_0x281353-0x0;var _0x4f4e7b=_0x5afb[_0x281353];return _0x4f4e7b;};'use strict';var _=require('lodash');var util=require(_0xb5af('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb5af('0x1'));var rp=require(_0xb5af('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5af('0x3'));var attributes=require(_0xb5af('0x4'));module[_0xb5af('0x5')]=function(_0x72bda3,_0x44377b){return _0x72bda3['define'](_0xb5af('0x6'),attributes,{'tableName':_0xb5af('0x7'),'paranoid':![],'indexes':[{'name':_0xb5af('0x8'),'fields':[_0xb5af('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 3de7a2e..bb23a2e 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 _0x8548=['request','then','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x44b033,_0x4c5695){var _0x3c7f47=function(_0x1b10ed){while(--_0x1b10ed){_0x44b033['push'](_0x44b033['shift']());}};_0x3c7f47(++_0x4c5695);}(_0x8548,0x15b));var _0x8854=function(_0x4b58da,_0x45253a){_0x4b58da=_0x4b58da-0x0;var _0x53bbea=_0x8548[_0x4b58da];return _0x53bbea;};'use strict';var _=require(_0x8854('0x0'));var util=require(_0x8854('0x1'));var moment=require(_0x8854('0x2'));var BPromise=require('bluebird');var rs=require(_0x8854('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8854('0x4'))['db'];var utils=require(_0x8854('0x5'));var logger=require(_0x8854('0x6'))(_0x8854('0x7'));var config=require('../../config/environment');var jayson=require(_0x8854('0x8'));var client=jayson['client'][_0x8854('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dedda,_0x49bd21,_0x1da1e9){return new BPromise(function(_0xfdba57,_0x89cf15){return client[_0x8854('0xa')](_0x4dedda,_0x1da1e9)[_0x8854('0xb')](function(_0x40c9e4){logger['info']('SalesforceField,\x20%s,\x20%s',_0x49bd21,_0x8854('0xc'));logger[_0x8854('0xd')](_0x8854('0xe'),_0x49bd21,_0x8854('0xc'),JSON[_0x8854('0xf')](_0x40c9e4));if(_0x40c9e4[_0x8854('0x10')]){if(_0x40c9e4[_0x8854('0x10')]['code']===0x1f4){logger['error'](_0x8854('0x11'),_0x49bd21,_0x40c9e4[_0x8854('0x10')][_0x8854('0x12')]);return _0x89cf15(_0x40c9e4[_0x8854('0x10')]['message']);}logger[_0x8854('0x10')](_0x8854('0x11'),_0x49bd21,_0x40c9e4[_0x8854('0x10')]['message']);return _0xfdba57(_0x40c9e4[_0x8854('0x10')][_0x8854('0x12')]);}else{logger[_0x8854('0x13')](_0x8854('0x11'),_0x49bd21,_0x8854('0xc'));_0xfdba57(_0x40c9e4['result'][_0x8854('0x12')]);}})[_0x8854('0x14')](function(_0x18cec8){logger[_0x8854('0x10')]('SalesforceField,\x20%s,\x20%s',_0x49bd21,_0x18cec8);_0x89cf15(_0x18cec8);});});} \ No newline at end of file +var _0xcafa=['../../config/logger','rpc','jayson/promise','client','http','request','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e294e,_0x5d8455){var _0x18fa86=function(_0x58be42){while(--_0x58be42){_0x1e294e['push'](_0x1e294e['shift']());}};_0x18fa86(++_0x5d8455);}(_0xcafa,0xc9));var _0xacaf=function(_0x42c01c,_0x433f5b){_0x42c01c=_0x42c01c-0x0;var _0x563dc8=_0xcafa[_0x42c01c];return _0x563dc8;};'use strict';var _=require(_0xacaf('0x0'));var util=require('util');var moment=require(_0xacaf('0x1'));var BPromise=require(_0xacaf('0x2'));var rs=require(_0xacaf('0x3'));var fs=require('fs');var Redis=require(_0xacaf('0x4'));var db=require(_0xacaf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacaf('0x6'))(_0xacaf('0x7'));var config=require('../../config/environment');var jayson=require(_0xacaf('0x8'));var client=jayson[_0xacaf('0x9')][_0xacaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e17e3,_0x4f6909,_0x42c0ce){return new BPromise(function(_0x280bf3,_0x1a15da){return client[_0xacaf('0xb')](_0x1e17e3,_0x42c0ce)['then'](function(_0x9bd44b){logger['info'](_0xacaf('0xc'),_0x4f6909,'request\x20sent');logger[_0xacaf('0xd')](_0xacaf('0xe'),_0x4f6909,'request\x20sent',JSON[_0xacaf('0xf')](_0x9bd44b));if(_0x9bd44b[_0xacaf('0x10')]){if(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x11')]===0x1f4){logger[_0xacaf('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);return _0x1a15da(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);}logger[_0xacaf('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x9bd44b['error'][_0xacaf('0x12')]);return _0x280bf3(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);}else{logger[_0xacaf('0x13')](_0xacaf('0xc'),_0x4f6909,_0xacaf('0x14'));_0x280bf3(_0x9bd44b[_0xacaf('0x15')][_0xacaf('0x12')]);}})[_0xacaf('0x16')](function(_0x3cb42f){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x3cb42f);_0x1a15da(_0x3cb42f);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d4efd61..e4ea1dc 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 _0x0903=['getFields','post','create','addConfiguration','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x4e28c0,_0x1ef470){var _0x4039d4=function(_0x740feb){while(--_0x740feb){_0x4e28c0['push'](_0x4e28c0['shift']());}};_0x4039d4(++_0x1ef470);}(_0x0903,0x105));var _0x3090=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0x0903[_0x2493f7];return _0x594ab2;};'use strict';var multer=require(_0x3090('0x0'));var util=require('util');var path=require(_0x3090('0x1'));var timeout=require(_0x3090('0x2'));var express=require(_0x3090('0x3'));var router=express[_0x3090('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3090('0x5'));var config=require(_0x3090('0x6'));var controller=require(_0x3090('0x7'));router[_0x3090('0x8')]('/',auth[_0x3090('0x9')](),controller[_0x3090('0xa')]);router['get'](_0x3090('0xb'),auth[_0x3090('0x9')](),controller[_0x3090('0xc')]);router[_0x3090('0x8')](_0x3090('0xd'),auth[_0x3090('0x9')](),controller['getConfigurations']);router[_0x3090('0x8')](_0x3090('0xe'),auth[_0x3090('0x9')](),controller[_0x3090('0xf')]);router[_0x3090('0x10')]('/',auth['isAuthenticated'](),controller[_0x3090('0x11')]);router[_0x3090('0x10')](_0x3090('0xd'),auth['isAuthenticated'](),controller[_0x3090('0x12')]);router[_0x3090('0x13')](_0x3090('0xb'),auth[_0x3090('0x9')](),controller[_0x3090('0x14')]);router[_0x3090('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3090('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0b25=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','addConfiguration','put','update','delete'];(function(_0x19b981,_0x50edd4){var _0x1cd2d3=function(_0x15324c){while(--_0x15324c){_0x19b981['push'](_0x19b981['shift']());}};_0x1cd2d3(++_0x50edd4);}(_0x0b25,0x155));var _0x50b2=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x0b25[_0x5dfc2a];return _0x3f1a71;};'use strict';var multer=require(_0x50b2('0x0'));var util=require(_0x50b2('0x1'));var path=require(_0x50b2('0x2'));var timeout=require(_0x50b2('0x3'));var express=require(_0x50b2('0x4'));var router=express[_0x50b2('0x5')]();var fs_extra=require(_0x50b2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50b2('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x50b2('0x8')]('/',auth[_0x50b2('0x9')](),controller[_0x50b2('0xa')]);router[_0x50b2('0x8')](_0x50b2('0xb'),auth['isAuthenticated'](),controller[_0x50b2('0xc')]);router[_0x50b2('0x8')](_0x50b2('0xd'),auth[_0x50b2('0x9')](),controller['getConfigurations']);router[_0x50b2('0x8')]('/:id/fields',auth[_0x50b2('0x9')](),controller[_0x50b2('0xe')]);router['post']('/',auth[_0x50b2('0x9')](),controller['create']);router['post'](_0x50b2('0xd'),auth[_0x50b2('0x9')](),controller[_0x50b2('0xf')]);router[_0x50b2('0x10')](_0x50b2('0xb'),auth[_0x50b2('0x9')](),controller[_0x50b2('0x11')]);router[_0x50b2('0x12')](_0x50b2('0xb'),auth[_0x50b2('0x9')](),controller[_0x50b2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ea6a918..b1727f9 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 _0x4105=['sequelize','STRING'];(function(_0x34b642,_0x38fae2){var _0x1656b7=function(_0x3059d0){while(--_0x3059d0){_0x34b642['push'](_0x34b642['shift']());}};_0x1656b7(++_0x38fae2);}(_0x4105,0x1c0));var _0x5410=function(_0x4392a5,_0x10497c){_0x4392a5=_0x4392a5-0x0;var _0x58c072=_0x4105[_0x4392a5];return _0x58c072;};'use strict';var Sequelize=require(_0x5410('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5410('0x1')]},'username':{'type':Sequelize[_0x5410('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x5410('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5410('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x5410('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd86c=['STRING','username','remoteUri','exports'];(function(_0xc88bc4,_0xa44c68){var _0x598833=function(_0x5d7bdb){while(--_0x5d7bdb){_0xc88bc4['push'](_0xc88bc4['shift']());}};_0x598833(++_0xa44c68);}(_0xd86c,0x7b));var _0xcd86=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xd86c[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require('sequelize');module[_0xcd86('0x0')]={'name':{'type':Sequelize[_0xcd86('0x1')]},'description':{'type':Sequelize[_0xcd86('0x1')]},'username':{'type':Sequelize[_0xcd86('0x1')],'unique':_0xcd86('0x2')},'password':{'type':Sequelize[_0xcd86('0x1')]},'email':{'type':Sequelize[_0xcd86('0x1')]},'remoteUri':{'type':Sequelize[_0xcd86('0x1')],'unique':_0xcd86('0x3')},'serverUrl':{'type':Sequelize[_0xcd86('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 945e48b..490157d 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 _0x2a8a=['VIRTUAL','merge','options','count','includeAll','findAll','rows','include','find','catch','create','body','update','params','findOne','ServicenowConfiguration','filter','getConfigurations','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','assigned_to','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','email','substring','lastIndexOf','format','%s/api/now/table/','username','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','set','Content-Range','reject','save','destroy','then','end','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x300a26,_0x1ad864){var _0x43bccd=function(_0x112388){while(--_0x112388){_0x300a26['push'](_0x300a26['shift']());}};_0x43bccd(++_0x1ad864);}(_0x2a8a,0x12f));var _0xa2a8=function(_0x5cf2bc,_0x9586a4){_0x5cf2bc=_0x5cf2bc-0x0;var _0x24c549=_0x2a8a[_0x5cf2bc];return _0x24c549;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa2a8('0x0'));var jsonpatch=require(_0xa2a8('0x1'));var rp=require(_0xa2a8('0x2'));var moment=require(_0xa2a8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa2a8('0x4'));var path=require('path');var sox=require(_0xa2a8('0x5'));var csv=require('to-csv');var ejs=require(_0xa2a8('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2a8('0x7'));var squel=require(_0xa2a8('0x8'));var crypto=require(_0xa2a8('0x9'));var jsforce=require(_0xa2a8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa2a8('0xb'));var querystring=require('querystring');var Papa=require(_0xa2a8('0xc'));var Redis=require(_0xa2a8('0xd'));var authService=require(_0xa2a8('0xe'));var qs=require(_0xa2a8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa2a8('0x10'));var config=require(_0xa2a8('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2a8('0x12'))['db'];var integrations=require(_0xa2a8('0x13'));function respondWithStatusCode(_0x54447c,_0x4f9ddd){_0x4f9ddd=_0x4f9ddd||0xcc;return function(_0x15fd86){if(_0x15fd86){return _0x54447c[_0xa2a8('0x14')](_0x4f9ddd);}return _0x54447c[_0xa2a8('0x15')](_0x4f9ddd)['end']();};}function respondWithResult(_0x1748a8,_0x213b61){_0x213b61=_0x213b61||0xc8;return function(_0x362f6a){if(_0x362f6a){return _0x1748a8['status'](_0x213b61)['json'](_0x362f6a);}};}function respondWithFilteredResult(_0x4e29a6,_0x4173c1){return function(_0x2cc14b){if(_0x2cc14b){var _0x41d0a6=typeof _0x4173c1[_0xa2a8('0x16')]===_0xa2a8('0x17')&&typeof _0x4173c1['limit']===_0xa2a8('0x17');var _0x23e7b1=_0x2cc14b['count'];var _0x31dc52=_0x41d0a6?0x0:_0x4173c1['offset'];var _0x5467cc=_0x41d0a6?_0x2cc14b['count']:_0x4173c1['offset']+_0x4173c1[_0xa2a8('0x18')];var _0x456b7c;if(_0x5467cc>=_0x23e7b1){_0x5467cc=_0x23e7b1;_0x456b7c=0xc8;}else{_0x456b7c=0xce;}_0x4e29a6[_0xa2a8('0x15')](_0x456b7c);return _0x4e29a6[_0xa2a8('0x19')](_0xa2a8('0x1a'),_0x31dc52+'-'+_0x5467cc+'/'+_0x23e7b1)['json'](_0x2cc14b);}return null;};}function patchUpdates(_0x335c6b){return function(_0x2639b3){try{jsonpatch['apply'](_0x2639b3,_0x335c6b,!![]);}catch(_0x3ba960){return BPromise[_0xa2a8('0x1b')](_0x3ba960);}return _0x2639b3[_0xa2a8('0x1c')]();};}function saveUpdates(_0x124aa0,_0x423d56){return function(_0x4f0001){if(_0x4f0001){return _0x4f0001['update'](_0x124aa0)['then'](function(_0x5f0c24){return _0x5f0c24;});}return null;};}function removeEntity(_0x34aa54,_0x46093c){return function(_0x2d8535){if(_0x2d8535){return _0x2d8535[_0xa2a8('0x1d')]()[_0xa2a8('0x1e')](function(){_0x34aa54[_0xa2a8('0x15')](0xcc)[_0xa2a8('0x1f')]();});}};}function handleEntityNotFound(_0xbaf9c9,_0x4c8abb){return function(_0x468e7a){if(!_0x468e7a){_0xbaf9c9[_0xa2a8('0x14')](0x194);}return _0x468e7a;};}function handleError(_0x1009fc,_0x8bc457){_0x8bc457=_0x8bc457||0x1f4;return function(_0x453280){logger[_0xa2a8('0x20')](_0x453280['stack']);if(_0x453280[_0xa2a8('0x21')]){delete _0x453280[_0xa2a8('0x21')];}_0x1009fc[_0xa2a8('0x15')](_0x8bc457)[_0xa2a8('0x22')](_0x453280);};}exports[_0xa2a8('0x23')]=function(_0x3513f0,_0x1b6ab7){var _0x1a186e={},_0x297dd4={},_0x4b2757={'count':0x0,'rows':[]};var _0x5ca94f=_[_0xa2a8('0x24')](db[_0xa2a8('0x25')][_0xa2a8('0x26')],function(_0x2e78a2){return{'name':_0x2e78a2[_0xa2a8('0x27')],'type':_0x2e78a2[_0xa2a8('0x28')]['key']};});_0x297dd4[_0xa2a8('0x29')]=_[_0xa2a8('0x24')](_0x5ca94f,_0xa2a8('0x21'));_0x297dd4['query']=_[_0xa2a8('0x2a')](_0x3513f0[_0xa2a8('0x2b')]);_0x297dd4[_0xa2a8('0x2c')]=_[_0xa2a8('0x2d')](_0x297dd4['model'],_0x297dd4[_0xa2a8('0x2b')]);_0x1a186e[_0xa2a8('0x2e')]=_[_0xa2a8('0x2d')](_0x297dd4[_0xa2a8('0x29')],qs['fields'](_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x2f')]));_0x1a186e['attributes']=_0x1a186e[_0xa2a8('0x2e')][_0xa2a8('0x30')]?_0x1a186e[_0xa2a8('0x2e')]:_0x297dd4[_0xa2a8('0x29')];if(!_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x31')](_0xa2a8('0x32'))){_0x1a186e['limit']=qs[_0xa2a8('0x18')](_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x18')]);_0x1a186e['offset']=qs['offset'](_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x16')]);}_0x1a186e[_0xa2a8('0x33')]=qs[_0xa2a8('0x34')](_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x34')]);_0x1a186e[_0xa2a8('0x35')]=qs[_0xa2a8('0x2c')](_[_0xa2a8('0x36')](_0x3513f0['query'],_0x297dd4[_0xa2a8('0x2c')]),_0x5ca94f);if(_0x3513f0['query']['filter']){_0x1a186e[_0xa2a8('0x35')]=_['merge'](_0x1a186e[_0xa2a8('0x35')],{'$or':_['map'](_0x5ca94f,function(_0x35ed0b){if(_0x35ed0b['type']!==_0xa2a8('0x37')){var _0x12de2f={};_0x12de2f[_0x35ed0b['name']]={'$like':'%'+_0x3513f0['query']['filter']+'%'};return _0x12de2f;}})});}_0x1a186e=_[_0xa2a8('0x38')]({},_0x1a186e,_0x3513f0[_0xa2a8('0x39')]);var _0x315814={'where':_0x1a186e[_0xa2a8('0x35')]};return db['ServicenowAccount']['count'](_0x315814)[_0xa2a8('0x1e')](function(_0x1b226e){_0x4b2757[_0xa2a8('0x3a')]=_0x1b226e;if(_0x3513f0[_0xa2a8('0x2b')][_0xa2a8('0x3b')]){_0x1a186e['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xa2a8('0x3c')](_0x1a186e);})[_0xa2a8('0x1e')](function(_0x45a46e){_0x4b2757[_0xa2a8('0x3d')]=_0x45a46e;return _0x4b2757;})[_0xa2a8('0x1e')](respondWithFilteredResult(_0x1b6ab7,_0x1a186e))['catch'](handleError(_0x1b6ab7,null));};exports['show']=function(_0x2ec12d,_0x2274bc){var _0xfaa465={'raw':![],'where':{'id':_0x2ec12d['params']['id']}},_0x4f2bd5={};_0x4f2bd5[_0xa2a8('0x29')]=_['keys'](db['ServicenowAccount'][_0xa2a8('0x26')]);_0x4f2bd5[_0xa2a8('0x2b')]=_['keys'](_0x2ec12d[_0xa2a8('0x2b')]);_0x4f2bd5[_0xa2a8('0x2c')]=_[_0xa2a8('0x2d')](_0x4f2bd5[_0xa2a8('0x29')],_0x4f2bd5[_0xa2a8('0x2b')]);_0xfaa465['attributes']=_[_0xa2a8('0x2d')](_0x4f2bd5[_0xa2a8('0x29')],qs[_0xa2a8('0x2f')](_0x2ec12d[_0xa2a8('0x2b')][_0xa2a8('0x2f')]));_0xfaa465[_0xa2a8('0x2e')]=_0xfaa465['attributes'][_0xa2a8('0x30')]?_0xfaa465[_0xa2a8('0x2e')]:_0x4f2bd5[_0xa2a8('0x29')];if(_0x2ec12d[_0xa2a8('0x2b')][_0xa2a8('0x3b')]){_0xfaa465[_0xa2a8('0x3e')]=[{'all':!![]}];}_0xfaa465=_[_0xa2a8('0x38')]({},_0xfaa465,_0x2ec12d[_0xa2a8('0x39')]);return db['ServicenowAccount'][_0xa2a8('0x3f')](_0xfaa465)[_0xa2a8('0x1e')](handleEntityNotFound(_0x2274bc,null))[_0xa2a8('0x1e')](respondWithResult(_0x2274bc,null))[_0xa2a8('0x40')](handleError(_0x2274bc,null));};exports[_0xa2a8('0x41')]=function(_0x3e9341,_0x20982c){return db[_0xa2a8('0x25')][_0xa2a8('0x41')](_0x3e9341[_0xa2a8('0x42')],{})['then'](respondWithResult(_0x20982c,0xc9))[_0xa2a8('0x40')](handleError(_0x20982c,null));};exports[_0xa2a8('0x43')]=function(_0x4388d2,_0x287367){if(_0x4388d2[_0xa2a8('0x42')]['id']){delete _0x4388d2['body']['id'];}return db[_0xa2a8('0x25')][_0xa2a8('0x3f')]({'where':{'id':_0x4388d2['params']['id']}})[_0xa2a8('0x1e')](handleEntityNotFound(_0x287367,null))[_0xa2a8('0x1e')](saveUpdates(_0x4388d2['body'],null))['then'](respondWithResult(_0x287367,null))['catch'](handleError(_0x287367,null));};exports[_0xa2a8('0x1d')]=function(_0x370c57,_0x5e6466){return db['ServicenowAccount']['find']({'where':{'id':_0x370c57[_0xa2a8('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e6466,null))[_0xa2a8('0x1e')](removeEntity(_0x5e6466,null))[_0xa2a8('0x40')](handleError(_0x5e6466,null));};exports['getConfigurations']=function(_0x20213e,_0x1eb7ec,_0xf4b4cb){var _0x3b32f3={};var _0x24b4f7={};var _0x533136;var _0x2caa14;return db[_0xa2a8('0x25')][_0xa2a8('0x45')]({'where':{'id':_0x20213e[_0xa2a8('0x44')]['id']}})[_0xa2a8('0x1e')](handleEntityNotFound(_0x1eb7ec,null))[_0xa2a8('0x1e')](function(_0xa6028f){if(_0xa6028f){_0x533136=_0xa6028f;_0x24b4f7['model']=_[_0xa2a8('0x2a')](db[_0xa2a8('0x46')][_0xa2a8('0x26')]);_0x24b4f7['query']=_[_0xa2a8('0x2a')](_0x20213e[_0xa2a8('0x2b')]);_0x24b4f7[_0xa2a8('0x2c')]=_[_0xa2a8('0x2d')](_0x24b4f7[_0xa2a8('0x29')],_0x24b4f7[_0xa2a8('0x2b')]);_0x3b32f3[_0xa2a8('0x2e')]=_[_0xa2a8('0x2d')](_0x24b4f7['model'],qs['fields'](_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x2f')]));_0x3b32f3[_0xa2a8('0x2e')]=_0x3b32f3[_0xa2a8('0x2e')][_0xa2a8('0x30')]?_0x3b32f3[_0xa2a8('0x2e')]:_0x24b4f7[_0xa2a8('0x29')];_0x3b32f3['order']=qs[_0xa2a8('0x34')](_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x34')]);_0x3b32f3[_0xa2a8('0x35')]=qs[_0xa2a8('0x2c')](_[_0xa2a8('0x36')](_0x20213e['query'],_0x24b4f7[_0xa2a8('0x2c')]));if(_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x47')]){_0x3b32f3[_0xa2a8('0x35')]=_[_0xa2a8('0x38')](_0x3b32f3[_0xa2a8('0x35')],{'$or':_[_0xa2a8('0x24')](_0x3b32f3['attributes'],function(_0x445a65){var _0x2a7ffb={};_0x2a7ffb[_0x445a65]={'$like':'%'+_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x47')]+'%'};return _0x2a7ffb;})});}_0x3b32f3=_[_0xa2a8('0x38')]({},_0x3b32f3,_0x20213e['options']);return _0x533136[_0xa2a8('0x48')](_0x3b32f3);}})[_0xa2a8('0x1e')](function(_0x5664e9){if(_0x5664e9){_0x2caa14=_0x5664e9[_0xa2a8('0x30')];if(!_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x31')]('nolimit')){_0x3b32f3[_0xa2a8('0x18')]=qs[_0xa2a8('0x18')](_0x20213e['query'][_0xa2a8('0x18')]);_0x3b32f3['offset']=qs[_0xa2a8('0x16')](_0x20213e[_0xa2a8('0x2b')][_0xa2a8('0x16')]);}return _0x533136['getConfigurations'](_0x3b32f3);}})['then'](function(_0x42dfde){if(_0x42dfde){return _0x42dfde?{'count':_0x2caa14,'rows':_0x42dfde}:null;}})[_0xa2a8('0x1e')](respondWithResult(_0x1eb7ec,null))[_0xa2a8('0x40')](handleError(_0x1eb7ec,null));};exports['addConfiguration']=function(_0x4d662d,_0x11d31b,_0x2c3e1e){if(_0x4d662d[_0xa2a8('0x42')]['id']){delete _0x4d662d['body']['id'];}return db[_0xa2a8('0x25')][_0xa2a8('0x45')]({'where':{'id':_0x4d662d[_0xa2a8('0x44')]['id']}})['then'](handleEntityNotFound(_0x11d31b,null))[_0xa2a8('0x1e')](function(_0x4dc06d){if(_0x4dc06d){_0x4d662d['body']['AccountId']=_0x4dc06d['id'];_0x4d662d['body'][_0xa2a8('0x49')]=integrations[_0xa2a8('0x4a')](_0x4d662d[_0xa2a8('0x42')][_0xa2a8('0x4b')],_0x4d662d['body'][_0xa2a8('0x28')]);_0x4d662d[_0xa2a8('0x42')][_0xa2a8('0x4c')]=integrations['getDescriptions'](_0x4d662d[_0xa2a8('0x42')][_0xa2a8('0x4b')],_0x4d662d[_0xa2a8('0x42')][_0xa2a8('0x28')]);return db['ServicenowConfiguration'][_0xa2a8('0x41')](_0x4d662d['body'],{'include':[{'model':db[_0xa2a8('0x4d')],'as':_0xa2a8('0x49')},{'model':db[_0xa2a8('0x4d')],'as':_0xa2a8('0x4c')}]});}return null;})[_0xa2a8('0x1e')](respondWithResult(_0x11d31b,null))[_0xa2a8('0x40')](handleError(_0x11d31b,null));};exports[_0xa2a8('0x4e')]=function(_0x490b45,_0x29fd29,_0x5572a6){var _0x3580c0=['made_sla',_0xa2a8('0x4f'),_0xa2a8('0x50'),_0xa2a8('0x51'),'close_code',_0xa2a8('0x52'),'incident_state',_0xa2a8('0x53'),_0xa2a8('0x54')];var _0x93374e=[_0xa2a8('0x55'),_0xa2a8('0x56'),_0xa2a8('0x57'),_0xa2a8('0x58'),_0xa2a8('0x59'),_0xa2a8('0x5a'),_0xa2a8('0x5b'),_0xa2a8('0x4f'),_0xa2a8('0x5c'),'number',_0xa2a8('0x5d'),_0xa2a8('0x5e'),_0xa2a8('0x5f'),_0xa2a8('0x60'),_0xa2a8('0x61'),'sys_domain',_0xa2a8('0x62'),_0xa2a8('0x63'),_0xa2a8('0x50'),_0xa2a8('0x33'),_0xa2a8('0x64'),_0xa2a8('0x65'),'cmdb_ci',_0xa2a8('0x66'),_0xa2a8('0x67'),_0xa2a8('0x68'),_0xa2a8('0x69'),_0xa2a8('0x6a'),_0xa2a8('0x6b'),_0xa2a8('0x6c'),'rfc','time_worked',_0xa2a8('0x6d'),'opened_at',_0xa2a8('0x6e'),_0xa2a8('0x6f'),_0xa2a8('0x70'),_0xa2a8('0x71'),_0xa2a8('0x72'),_0xa2a8('0x73'),_0xa2a8('0x74'),_0xa2a8('0x51'),_0xa2a8('0x75'),_0xa2a8('0x76'),_0xa2a8('0x77'),_0xa2a8('0x78'),_0xa2a8('0x79'),_0xa2a8('0x7a'),_0xa2a8('0x7b'),_0xa2a8('0x7c'),'additional_assignee_list',_0xa2a8('0x7d'),_0xa2a8('0x7e'),_0xa2a8('0x52'),_0xa2a8('0x7f'),_0xa2a8('0x80'),_0xa2a8('0x81'),'follow_up','parent_incident',_0xa2a8('0x82'),_0xa2a8('0x83'),_0xa2a8('0x84'),_0xa2a8('0x85'),_0xa2a8('0x86'),'problem_id',_0xa2a8('0x87'),_0xa2a8('0x88'),_0xa2a8('0x89'),_0xa2a8('0x8a'),'severity','comments','sla_due',_0xa2a8('0x8b'),'comments_and_work_notes',_0xa2a8('0x8c'),_0xa2a8('0x8d'),_0xa2a8('0x8e'),_0xa2a8('0x8f'),_0xa2a8('0x90'),'upon_approval',_0xa2a8('0x91'),_0xa2a8('0x92'),'category'];var _0x316ab5='';var _0x3a4ea9='';var _0x14a528=[];var _0x50fff1='';var _0x4754d5='';var _0xe2754e=[];var _0x3e3f02='';var _0x3943d9='';var _0x2bb4b6={};var _0x5c3a8a='';return db[_0xa2a8('0x25')][_0xa2a8('0x45')]({'where':{'id':_0x490b45['params']['id']},'attributes':['id','username','password',_0xa2a8('0x93'),'remoteUri','serverUrl']})[_0xa2a8('0x1e')](handleEntityNotFound(_0x29fd29,null))['then'](function(_0x9966b6){if(_0x9966b6){_0x5c3a8a=_0x9966b6['remoteUri'];var _0x5ab154=_0x5c3a8a['slice'](-0x1);if(_0x5ab154==='/'){_0x5c3a8a=_0x5c3a8a[_0xa2a8('0x94')](0x0,_0x5c3a8a[_0xa2a8('0x95')](_0x5ab154));}_0x3943d9=util[_0xa2a8('0x96')]('%s/api/now/doc/table/schema/',_0x5c3a8a);_0x3e3f02=util[_0xa2a8('0x96')](_0xa2a8('0x97'),_0x5c3a8a);_0x2bb4b6={'user':_0x9966b6[_0xa2a8('0x98')],'pass':_0x9966b6[_0xa2a8('0x99')]};var _0x489265={'method':'GET','uri':_0x3943d9+_0xa2a8('0x9a'),'auth':_0x2bb4b6,'json':!![]};return rp(_0x489265);}})[_0xa2a8('0x1e')](function(_0x4b89f5){if(_0x4b89f5['result'][_0xa2a8('0x30')]>0x0){_0x316ab5=_0x4b89f5[_0xa2a8('0x9b')];}console[_0xa2a8('0x9c')](_0xa2a8('0x9d'),_0x316ab5);_0xe2754e=[];_0x3a4ea9=Object['assign']([],_0x316ab5);_[_0xa2a8('0x9e')](_0x3a4ea9,function(_0x489102){return!_0x3580c0[_0xa2a8('0x9f')](_0x489102['name']);});_0x3a4ea9[_0xa2a8('0xa0')](function(_0x58e4aa){var _0x4df52c=createFieldObject(_0x3e3f02,_0x2bb4b6,_0x58e4aa['internalType'],_0x58e4aa[_0xa2a8('0x21')],_0x58e4aa[_0xa2a8('0xa1')],![]);_0xe2754e[_0xa2a8('0xa2')](_0x4df52c);});return Promise[_0xa2a8('0xa3')](_0xe2754e);})['then'](function(_0x4218e8){_0x14a528=_0x4218e8;_0x50fff1=Object[_0xa2a8('0xa4')]([],_0x316ab5);console[_0xa2a8('0x9c')](_0xa2a8('0xa5'),_0x316ab5);_[_0xa2a8('0x9e')](_0x50fff1,function(_0x2250ce){return _0x93374e[_0xa2a8('0x9f')](_0x2250ce[_0xa2a8('0x21')]);});console['log'](_0xa2a8('0xa6'),_0x50fff1);_0xe2754e=[];_0x50fff1[_0xa2a8('0xa0')](function(_0x18048e){var _0x4c37dc=createFieldObject(_0x3e3f02,_0x2bb4b6,_0x18048e['internalType'],_0x18048e[_0xa2a8('0x21')],_0x18048e[_0xa2a8('0xa1')],!![]);_0xe2754e[_0xa2a8('0xa2')](_0x4c37dc);});return Promise['all'](_0xe2754e);})[_0xa2a8('0x1e')](function(_0x4beb73){_0x4754d5=_0x4beb73;var _0x5dfd17=_0x14a528[_0xa2a8('0xa7')](_0x4754d5);return{'count':_0x5dfd17[_0xa2a8('0x30')],'rows':_0x5dfd17};})[_0xa2a8('0x1e')](respondWithResult(_0x29fd29,null))[_0xa2a8('0x40')](function(_0x4c6948){console[_0xa2a8('0x9c')](_0xa2a8('0xa8')+_0x4c6948);var _0x593edb=_0x490b45[_0xa2a8('0x2b')]['test']?0x1f4:_0x4c6948['statusCode']||0x1f4;logger[_0xa2a8('0x20')](_0x4c6948['stack']);delete _0x4c6948['name'];if(_0x593edb===0x191){_0x593edb=0x190;}_0x29fd29[_0xa2a8('0x15')](_0x593edb)['send'](_0x490b45[_0xa2a8('0x2b')][_0xa2a8('0xa9')]?{'message':_0xa2a8('0xaa'),'statusCode':_0x4c6948['statusCode']}:_0x4c6948);});};function createFieldObject(_0x2becc7,_0x37ed8b,_0xe1421c,_0x3df2dc,_0x2accca,_0x496500){return new Promise(function(_0x4698a5,_0x388a1e){var _0x24dcbc={'id':_0x3df2dc,'name':_0x2accca,'custom':_0x496500};if(_0xe1421c===_0xa2a8('0xab')){_0x24dcbc['options']=[{'name':'True','value':_0xa2a8('0xac')},{'name':_0xa2a8('0xad'),'value':_0xa2a8('0xae')}];_0x4698a5(_0x24dcbc);}else{var _0x5c64eb={'method':_0xa2a8('0xaf'),'uri':_0x2becc7+_0xa2a8('0xb0')+_0x3df2dc,'auth':_0x37ed8b,'json':!![]};return rp(_0x5c64eb)['then'](function(_0x4287ad){var _0x434faa=[];if(_0x4287ad[_0xa2a8('0x9b')][_0xa2a8('0x30')]>0x0){_0x4287ad[_0xa2a8('0x9b')]['forEach'](function(_0x27bc81){if(_0x27bc81[_0xa2a8('0xb1')]===_0xa2a8('0xae')){var _0x11d66f={'name':_0x27bc81[_0xa2a8('0xa1')],'value':_0x27bc81[_0xa2a8('0xb2')]};_0x434faa['push'](_0x11d66f);}});}_0x24dcbc[_0xa2a8('0x39')]=_0x434faa;if(_0x24dcbc[_0xa2a8('0x39')][_0xa2a8('0x30')]>0x0){_0x4698a5(_0x24dcbc);}else{if(_0x496500==![]){_0x4698a5();}else{_0x4698a5(_0x24dcbc);}}});}});} \ No newline at end of file +var _0xd3ce=['caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','test','boolean','True','true','False','false','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at'];(function(_0x38f11f,_0x438e05){var _0x503943=function(_0x3746f7){while(--_0x3746f7){_0x38f11f['push'](_0x38f11f['shift']());}};_0x503943(++_0x438e05);}(_0xd3ce,0x1b3));var _0xed3c=function(_0x5dfe69,_0x293c29){_0x5dfe69=_0x5dfe69-0x0;var _0x179897=_0xd3ce[_0x5dfe69];return _0x179897;};'use strict';var emlformat=require(_0xed3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed3c('0x1'));var jsonpatch=require(_0xed3c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xed3c('0x3'));var Mustache=require(_0xed3c('0x4'));var util=require(_0xed3c('0x5'));var path=require(_0xed3c('0x6'));var sox=require(_0xed3c('0x7'));var csv=require(_0xed3c('0x8'));var ejs=require(_0xed3c('0x9'));var fs=require('fs');var fs_extra=require(_0xed3c('0xa'));var _=require(_0xed3c('0xb'));var squel=require(_0xed3c('0xc'));var crypto=require(_0xed3c('0xd'));var jsforce=require(_0xed3c('0xe'));var deskjs=require(_0xed3c('0xf'));var toCsv=require(_0xed3c('0x8'));var querystring=require('querystring');var Papa=require(_0xed3c('0x10'));var Redis=require('ioredis');var authService=require(_0xed3c('0x11'));var qs=require(_0xed3c('0x12'));var as=require(_0xed3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed3c('0x14'))(_0xed3c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed3c('0x16'));var db=require(_0xed3c('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x165e42,_0x46780b){_0x46780b=_0x46780b||0xcc;return function(_0x2a10c0){if(_0x2a10c0){return _0x165e42[_0xed3c('0x18')](_0x46780b);}return _0x165e42[_0xed3c('0x19')](_0x46780b)[_0xed3c('0x1a')]();};}function respondWithResult(_0x1d2c27,_0x359fa3){_0x359fa3=_0x359fa3||0xc8;return function(_0x20c3af){if(_0x20c3af){return _0x1d2c27[_0xed3c('0x19')](_0x359fa3)[_0xed3c('0x1b')](_0x20c3af);}};}function respondWithFilteredResult(_0x2b2c4a,_0x11bf03){return function(_0x50ae1e){if(_0x50ae1e){var _0x598af4=typeof _0x11bf03[_0xed3c('0x1c')]===_0xed3c('0x1d')&&typeof _0x11bf03['limit']===_0xed3c('0x1d');var _0x47e4b8=_0x50ae1e[_0xed3c('0x1e')];var _0x4d3f78=_0x598af4?0x0:_0x11bf03[_0xed3c('0x1c')];var _0x2c88c6=_0x598af4?_0x50ae1e[_0xed3c('0x1e')]:_0x11bf03[_0xed3c('0x1c')]+_0x11bf03[_0xed3c('0x1f')];var _0x22724b;if(_0x2c88c6>=_0x47e4b8){_0x2c88c6=_0x47e4b8;_0x22724b=0xc8;}else{_0x22724b=0xce;}_0x2b2c4a['status'](_0x22724b);return _0x2b2c4a[_0xed3c('0x20')](_0xed3c('0x21'),_0x4d3f78+'-'+_0x2c88c6+'/'+_0x47e4b8)['json'](_0x50ae1e);}return null;};}function patchUpdates(_0x18aa5a){return function(_0x1eb765){try{jsonpatch['apply'](_0x1eb765,_0x18aa5a,!![]);}catch(_0x1ebd79){return BPromise[_0xed3c('0x22')](_0x1ebd79);}return _0x1eb765['save']();};}function saveUpdates(_0x18ff09,_0x4e4f37){return function(_0x471854){if(_0x471854){return _0x471854[_0xed3c('0x23')](_0x18ff09)[_0xed3c('0x24')](function(_0x1bad7a){return _0x1bad7a;});}return null;};}function removeEntity(_0x17b64d,_0x4ab612){return function(_0x58f222){if(_0x58f222){return _0x58f222[_0xed3c('0x25')]()[_0xed3c('0x24')](function(){_0x17b64d[_0xed3c('0x19')](0xcc)[_0xed3c('0x1a')]();});}};}function handleEntityNotFound(_0x1b4ab3,_0x55cf75){return function(_0x43eaf8){if(!_0x43eaf8){_0x1b4ab3['sendStatus'](0x194);}return _0x43eaf8;};}function handleError(_0x4d3850,_0x321627){_0x321627=_0x321627||0x1f4;return function(_0x3f2190){logger[_0xed3c('0x26')](_0x3f2190[_0xed3c('0x27')]);if(_0x3f2190['name']){delete _0x3f2190[_0xed3c('0x28')];}_0x4d3850[_0xed3c('0x19')](_0x321627)[_0xed3c('0x29')](_0x3f2190);};}exports[_0xed3c('0x2a')]=function(_0x3a6ee1,_0x165622){var _0x5df89d={},_0x320055={},_0x39158d={'count':0x0,'rows':[]};var _0x4a7bd2=_[_0xed3c('0x2b')](db[_0xed3c('0x2c')][_0xed3c('0x2d')],function(_0x2b2b4c){return{'name':_0x2b2b4c[_0xed3c('0x2e')],'type':_0x2b2b4c[_0xed3c('0x2f')]['key']};});_0x320055[_0xed3c('0x30')]=_[_0xed3c('0x2b')](_0x4a7bd2,_0xed3c('0x28'));_0x320055[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x3a6ee1['query']);_0x320055[_0xed3c('0x33')]=_[_0xed3c('0x34')](_0x320055[_0xed3c('0x30')],_0x320055[_0xed3c('0x31')]);_0x5df89d[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x320055['model'],qs[_0xed3c('0x36')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x36')]));_0x5df89d[_0xed3c('0x35')]=_0x5df89d[_0xed3c('0x35')][_0xed3c('0x37')]?_0x5df89d['attributes']:_0x320055['model'];if(!_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x39'))){_0x5df89d[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x1f')]);_0x5df89d['offset']=qs[_0xed3c('0x1c')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x1c')]);}_0x5df89d['order']=qs[_0xed3c('0x3a')](_0x3a6ee1['query']['sort']);_0x5df89d[_0xed3c('0x3b')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3c')](_0x3a6ee1[_0xed3c('0x31')],_0x320055[_0xed3c('0x33')]),_0x4a7bd2);if(_0x3a6ee1['query']['filter']){_0x5df89d[_0xed3c('0x3b')]=_[_0xed3c('0x3d')](_0x5df89d[_0xed3c('0x3b')],{'$or':_[_0xed3c('0x2b')](_0x4a7bd2,function(_0x142db6){if(_0x142db6[_0xed3c('0x2f')]!==_0xed3c('0x3e')){var _0x15c70c={};_0x15c70c[_0x142db6[_0xed3c('0x28')]]={'$like':'%'+_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x15c70c;}})});}_0x5df89d=_[_0xed3c('0x3d')]({},_0x5df89d,_0x3a6ee1[_0xed3c('0x40')]);var _0x1a5bb3={'where':_0x5df89d[_0xed3c('0x3b')]};return db[_0xed3c('0x2c')][_0xed3c('0x1e')](_0x1a5bb3)[_0xed3c('0x24')](function(_0x272bc9){_0x39158d[_0xed3c('0x1e')]=_0x272bc9;if(_0x3a6ee1[_0xed3c('0x31')]['includeAll']){_0x5df89d[_0xed3c('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xed3c('0x42')](_0x5df89d);})[_0xed3c('0x24')](function(_0x414aa){_0x39158d[_0xed3c('0x43')]=_0x414aa;return _0x39158d;})['then'](respondWithFilteredResult(_0x165622,_0x5df89d))[_0xed3c('0x44')](handleError(_0x165622,null));};exports[_0xed3c('0x45')]=function(_0x4e63ab,_0x372dc4){var _0x2a8d7a={'raw':![],'where':{'id':_0x4e63ab[_0xed3c('0x46')]['id']}},_0x5d2cca={};_0x5d2cca[_0xed3c('0x30')]=_[_0xed3c('0x32')](db['ServicenowAccount'][_0xed3c('0x2d')]);_0x5d2cca[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x4e63ab[_0xed3c('0x31')]);_0x5d2cca[_0xed3c('0x33')]=_['intersection'](_0x5d2cca[_0xed3c('0x30')],_0x5d2cca['query']);_0x2a8d7a[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x5d2cca[_0xed3c('0x30')],qs[_0xed3c('0x36')](_0x4e63ab[_0xed3c('0x31')][_0xed3c('0x36')]));_0x2a8d7a[_0xed3c('0x35')]=_0x2a8d7a[_0xed3c('0x35')][_0xed3c('0x37')]?_0x2a8d7a[_0xed3c('0x35')]:_0x5d2cca[_0xed3c('0x30')];if(_0x4e63ab['query']['includeAll']){_0x2a8d7a['include']=[{'all':!![]}];}_0x2a8d7a=_[_0xed3c('0x3d')]({},_0x2a8d7a,_0x4e63ab[_0xed3c('0x40')]);return db[_0xed3c('0x2c')][_0xed3c('0x47')](_0x2a8d7a)[_0xed3c('0x24')](handleEntityNotFound(_0x372dc4,null))[_0xed3c('0x24')](respondWithResult(_0x372dc4,null))[_0xed3c('0x44')](handleError(_0x372dc4,null));};exports['create']=function(_0x22596f,_0x32935e){return db[_0xed3c('0x2c')][_0xed3c('0x48')](_0x22596f[_0xed3c('0x49')],{})[_0xed3c('0x24')](respondWithResult(_0x32935e,0xc9))[_0xed3c('0x44')](handleError(_0x32935e,null));};exports[_0xed3c('0x23')]=function(_0x19dd2c,_0x2d5b06){if(_0x19dd2c[_0xed3c('0x49')]['id']){delete _0x19dd2c[_0xed3c('0x49')]['id'];}return db[_0xed3c('0x2c')][_0xed3c('0x47')]({'where':{'id':_0x19dd2c['params']['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x2d5b06,null))[_0xed3c('0x24')](saveUpdates(_0x19dd2c[_0xed3c('0x49')],null))['then'](respondWithResult(_0x2d5b06,null))['catch'](handleError(_0x2d5b06,null));};exports['destroy']=function(_0x3fb998,_0x98646a){return db['ServicenowAccount'][_0xed3c('0x47')]({'where':{'id':_0x3fb998[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x98646a,null))[_0xed3c('0x24')](removeEntity(_0x98646a,null))['catch'](handleError(_0x98646a,null));};exports[_0xed3c('0x4a')]=function(_0x3b218c,_0x292dd1,_0x2221a1){var _0x21cbb1={};var _0x59e85d={};var _0x5e3780;var _0x36b3e3;return db[_0xed3c('0x2c')][_0xed3c('0x4b')]({'where':{'id':_0x3b218c[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x292dd1,null))[_0xed3c('0x24')](function(_0x51c958){if(_0x51c958){_0x5e3780=_0x51c958;_0x59e85d[_0xed3c('0x30')]=_[_0xed3c('0x32')](db[_0xed3c('0x4c')][_0xed3c('0x2d')]);_0x59e85d[_0xed3c('0x31')]=_['keys'](_0x3b218c[_0xed3c('0x31')]);_0x59e85d['filters']=_['intersection'](_0x59e85d[_0xed3c('0x30')],_0x59e85d[_0xed3c('0x31')]);_0x21cbb1[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x59e85d[_0xed3c('0x30')],qs[_0xed3c('0x36')](_0x3b218c['query'][_0xed3c('0x36')]));_0x21cbb1['attributes']=_0x21cbb1[_0xed3c('0x35')][_0xed3c('0x37')]?_0x21cbb1[_0xed3c('0x35')]:_0x59e85d[_0xed3c('0x30')];_0x21cbb1[_0xed3c('0x4d')]=qs[_0xed3c('0x3a')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x3a')]);_0x21cbb1[_0xed3c('0x3b')]=qs[_0xed3c('0x33')](_['pick'](_0x3b218c['query'],_0x59e85d[_0xed3c('0x33')]));if(_0x3b218c['query'][_0xed3c('0x3f')]){_0x21cbb1[_0xed3c('0x3b')]=_['merge'](_0x21cbb1[_0xed3c('0x3b')],{'$or':_['map'](_0x21cbb1[_0xed3c('0x35')],function(_0x124ba7){var _0x4f967e={};_0x4f967e[_0x124ba7]={'$like':'%'+_0x3b218c[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x4f967e;})});}_0x21cbb1=_['merge']({},_0x21cbb1,_0x3b218c[_0xed3c('0x40')]);return _0x5e3780[_0xed3c('0x4a')](_0x21cbb1);}})[_0xed3c('0x24')](function(_0x1333ab){if(_0x1333ab){_0x36b3e3=_0x1333ab[_0xed3c('0x37')];if(!_0x3b218c[_0xed3c('0x31')][_0xed3c('0x38')]('nolimit')){_0x21cbb1[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x1f')]);_0x21cbb1['offset']=qs[_0xed3c('0x1c')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x1c')]);}return _0x5e3780[_0xed3c('0x4a')](_0x21cbb1);}})[_0xed3c('0x24')](function(_0x5eb512){if(_0x5eb512){return _0x5eb512?{'count':_0x36b3e3,'rows':_0x5eb512}:null;}})['then'](respondWithResult(_0x292dd1,null))['catch'](handleError(_0x292dd1,null));};exports[_0xed3c('0x4e')]=function(_0x4c738a,_0x4a7ace,_0x181eee){if(_0x4c738a['body']['id']){delete _0x4c738a[_0xed3c('0x49')]['id'];}return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x4c738a[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x4a7ace,null))['then'](function(_0x42a0c9){if(_0x42a0c9){_0x4c738a[_0xed3c('0x49')]['AccountId']=_0x42a0c9['id'];_0x4c738a[_0xed3c('0x49')][_0xed3c('0x4f')]=integrations[_0xed3c('0x50')](_0x4c738a[_0xed3c('0x49')][_0xed3c('0x51')],_0x4c738a['body'][_0xed3c('0x2f')]);_0x4c738a[_0xed3c('0x49')][_0xed3c('0x52')]=integrations[_0xed3c('0x53')](_0x4c738a[_0xed3c('0x49')][_0xed3c('0x51')],_0x4c738a[_0xed3c('0x49')][_0xed3c('0x2f')]);return db[_0xed3c('0x4c')][_0xed3c('0x48')](_0x4c738a[_0xed3c('0x49')],{'include':[{'model':db[_0xed3c('0x54')],'as':_0xed3c('0x4f')},{'model':db[_0xed3c('0x54')],'as':_0xed3c('0x52')}]});}return null;})[_0xed3c('0x24')](respondWithResult(_0x4a7ace,null))[_0xed3c('0x44')](handleError(_0x4a7ace,null));};exports[_0xed3c('0x55')]=function(_0xc6b518,_0x542001,_0x4d1c74){var _0x48c762=[_0xed3c('0x56'),_0xed3c('0x57'),_0xed3c('0x58'),_0xed3c('0x59'),_0xed3c('0x5a'),_0xed3c('0x5b'),'incident_state','severity',_0xed3c('0x5c')];var _0x38d117=['parent','made_sla',_0xed3c('0x5d'),_0xed3c('0x5e'),_0xed3c('0x5f'),_0xed3c('0x60'),_0xed3c('0x61'),_0xed3c('0x57'),'approval_history',_0xed3c('0x62'),_0xed3c('0x63'),_0xed3c('0x64'),_0xed3c('0x65'),_0xed3c('0x66'),'sys_created_on',_0xed3c('0x67'),'state',_0xed3c('0x68'),_0xed3c('0x58'),_0xed3c('0x4d'),_0xed3c('0x69'),_0xed3c('0x6a'),_0xed3c('0x6b'),_0xed3c('0x6c'),_0xed3c('0x6d'),_0xed3c('0x6e'),'work_notes_list',_0xed3c('0x6f'),_0xed3c('0x70'),'sys_domain_path',_0xed3c('0x71'),_0xed3c('0x72'),_0xed3c('0x73'),_0xed3c('0x74'),_0xed3c('0x75'),'group_list','work_end',_0xed3c('0x76'),_0xed3c('0x77'),_0xed3c('0x78'),_0xed3c('0x79'),_0xed3c('0x59'),_0xed3c('0x7a'),'short_description',_0xed3c('0x5a'),_0xed3c('0x7b'),'delivery_task',_0xed3c('0x7c'),_0xed3c('0x7d'),_0xed3c('0x7e'),_0xed3c('0x7f'),_0xed3c('0x80'),_0xed3c('0x81'),'notify',_0xed3c('0x82'),'close_notes',_0xed3c('0x83'),_0xed3c('0x84'),'parent_incident',_0xed3c('0x85'),_0xed3c('0x86'),_0xed3c('0x87'),_0xed3c('0x88'),_0xed3c('0x89'),_0xed3c('0x8a'),'company',_0xed3c('0x8b'),_0xed3c('0x8c'),'assigned_to',_0xed3c('0x8d'),_0xed3c('0x8e'),_0xed3c('0x8f'),_0xed3c('0x90'),_0xed3c('0x91'),'due_date',_0xed3c('0x92'),_0xed3c('0x93'),_0xed3c('0x94'),_0xed3c('0x95'),_0xed3c('0x96'),_0xed3c('0x97'),'location',_0xed3c('0x5c')];var _0x1b98d8='';var _0x44002d='';var _0x108a2e=[];var _0x168993='';var _0x2247c6='';var _0x533049=[];var _0x18b19b='';var _0x1fde02='';var _0x2075e9={};var _0x2afa07='';return db[_0xed3c('0x2c')][_0xed3c('0x4b')]({'where':{'id':_0xc6b518['params']['id']},'attributes':['id',_0xed3c('0x98'),_0xed3c('0x99'),_0xed3c('0x9a'),_0xed3c('0x9b'),_0xed3c('0x9c')]})['then'](handleEntityNotFound(_0x542001,null))['then'](function(_0x4049da){if(_0x4049da){_0x2afa07=_0x4049da[_0xed3c('0x9b')];var _0x4f9b3f=_0x2afa07[_0xed3c('0x9d')](-0x1);if(_0x4f9b3f==='/'){_0x2afa07=_0x2afa07[_0xed3c('0x9e')](0x0,_0x2afa07['lastIndexOf'](_0x4f9b3f));}_0x1fde02=util[_0xed3c('0x9f')](_0xed3c('0xa0'),_0x2afa07);_0x18b19b=util[_0xed3c('0x9f')]('%s/api/now/table/',_0x2afa07);_0x2075e9={'user':_0x4049da['username'],'pass':_0x4049da[_0xed3c('0x99')]};var _0x4cab7e={'method':_0xed3c('0xa1'),'uri':_0x1fde02+_0xed3c('0xa2'),'auth':_0x2075e9,'json':!![]};return rp(_0x4cab7e);}})[_0xed3c('0x24')](function(_0x2dd60a){if(_0x2dd60a[_0xed3c('0xa3')][_0xed3c('0x37')]>0x0){_0x1b98d8=_0x2dd60a[_0xed3c('0xa3')];}console[_0xed3c('0xa4')](_0xed3c('0xa5'),_0x1b98d8);_0x533049=[];_0x44002d=Object['assign']([],_0x1b98d8);_[_0xed3c('0xa6')](_0x44002d,function(_0x57268a){return!_0x48c762[_0xed3c('0xa7')](_0x57268a[_0xed3c('0x28')]);});_0x44002d[_0xed3c('0xa8')](function(_0x10cc70){var _0xe06027=createFieldObject(_0x18b19b,_0x2075e9,_0x10cc70[_0xed3c('0xa9')],_0x10cc70['name'],_0x10cc70[_0xed3c('0xaa')],![]);_0x533049[_0xed3c('0xab')](_0xe06027);});return Promise[_0xed3c('0xac')](_0x533049);})['then'](function(_0x6bf0b0){_0x108a2e=_0x6bf0b0;_0x168993=Object[_0xed3c('0xad')]([],_0x1b98d8);console['log'](_0xed3c('0xae'),_0x1b98d8);_['remove'](_0x168993,function(_0x77a49b){return _0x38d117['includes'](_0x77a49b[_0xed3c('0x28')]);});console[_0xed3c('0xa4')](_0xed3c('0xaf'),_0x168993);_0x533049=[];_0x168993[_0xed3c('0xa8')](function(_0x50a0e3){var _0x32a868=createFieldObject(_0x18b19b,_0x2075e9,_0x50a0e3[_0xed3c('0xa9')],_0x50a0e3['name'],_0x50a0e3['label'],!![]);_0x533049[_0xed3c('0xab')](_0x32a868);});return Promise[_0xed3c('0xac')](_0x533049);})[_0xed3c('0x24')](function(_0x2e6fc8){_0x2247c6=_0x2e6fc8;var _0x18635b=_0x108a2e[_0xed3c('0xb0')](_0x2247c6);return{'count':_0x18635b[_0xed3c('0x37')],'rows':_0x18635b};})[_0xed3c('0x24')](respondWithResult(_0x542001,null))[_0xed3c('0x44')](function(_0x574f78){console[_0xed3c('0xa4')](_0xed3c('0xb1')+_0x574f78);var _0x211943=_0xc6b518[_0xed3c('0x31')]['test']?0x1f4:_0x574f78[_0xed3c('0xb2')]||0x1f4;logger['error'](_0x574f78[_0xed3c('0x27')]);delete _0x574f78[_0xed3c('0x28')];if(_0x211943===0x191){_0x211943=0x190;}_0x542001[_0xed3c('0x19')](_0x211943)[_0xed3c('0x29')](_0xc6b518[_0xed3c('0x31')][_0xed3c('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x574f78['statusCode']}:_0x574f78);});};function createFieldObject(_0x110f83,_0x5d1264,_0xe4eff6,_0x50c701,_0x37ee9e,_0x2609bb){return new Promise(function(_0xe16ba2,_0x554c1f){var _0x21fcc0={'id':_0x50c701,'name':_0x37ee9e,'custom':_0x2609bb};if(_0xe4eff6===_0xed3c('0xb4')){_0x21fcc0['options']=[{'name':_0xed3c('0xb5'),'value':_0xed3c('0xb6')},{'name':_0xed3c('0xb7'),'value':_0xed3c('0xb8')}];_0xe16ba2(_0x21fcc0);}else{var _0x80f0e1={'method':_0xed3c('0xa1'),'uri':_0x110f83+'sys_choice?sysparm_query=name=incident^element='+_0x50c701,'auth':_0x5d1264,'json':!![]};return rp(_0x80f0e1)[_0xed3c('0x24')](function(_0x4d3e00){var _0x2414e6=[];if(_0x4d3e00[_0xed3c('0xa3')][_0xed3c('0x37')]>0x0){_0x4d3e00[_0xed3c('0xa3')]['forEach'](function(_0x1fd6da){if(_0x1fd6da['inactive']==='false'){var _0x4bc1c7={'name':_0x1fd6da['label'],'value':_0x1fd6da['value']};_0x2414e6[_0xed3c('0xab')](_0x4bc1c7);}});}_0x21fcc0[_0xed3c('0x40')]=_0x2414e6;if(_0x21fcc0[_0xed3c('0x40')][_0xed3c('0x37')]>0x0){_0xe16ba2(_0x21fcc0);}else{if(_0x2609bb==![]){_0xe16ba2();}else{_0xe16ba2(_0x21fcc0);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9219006..5bb816e 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 _0xe2fe=['define','int_servicenow_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x33bc5f,_0x30ba51){var _0x2e68de=function(_0x5a5c9e){while(--_0x5a5c9e){_0x33bc5f['push'](_0x33bc5f['shift']());}};_0x2e68de(++_0x30ba51);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('ServicenowAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2c366f,_0x1bd4f8){_0x2c366f=_0x2c366f-0x0;var _0x180634=_0x7fbe[_0x2c366f];return _0x180634;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index fbf8f61..129dc09 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 _0x4e2b=['../../config/environment','jayson/promise','client','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetServicenowAccount','ServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xa6eb0d,_0x53cb20){var _0x2c0d65=function(_0x132469){while(--_0x132469){_0xa6eb0d['push'](_0xa6eb0d['shift']());}};_0x2c0d65(++_0x53cb20);}(_0x4e2b,0x136));var _0xb4e2=function(_0x8f5588,_0x6c6ae1){_0x8f5588=_0x8f5588-0x0;var _0x2edc16=_0x4e2b[_0x8f5588];return _0x2edc16;};'use strict';var _=require(_0xb4e2('0x0'));var util=require(_0xb4e2('0x1'));var moment=require(_0xb4e2('0x2'));var BPromise=require(_0xb4e2('0x3'));var rs=require(_0xb4e2('0x4'));var fs=require('fs');var Redis=require(_0xb4e2('0x5'));var db=require(_0xb4e2('0x6'))['db'];var utils=require(_0xb4e2('0x7'));var logger=require(_0xb4e2('0x8'))(_0xb4e2('0x9'));var config=require(_0xb4e2('0xa'));var jayson=require(_0xb4e2('0xb'));var client=jayson[_0xb4e2('0xc')][_0xb4e2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x32865d,_0x378efa,_0x5a39b7){return new BPromise(function(_0x3976dc,_0x462812){return client[_0xb4e2('0xe')](_0x32865d,_0x5a39b7)['then'](function(_0x18a215){logger['info'](_0xb4e2('0xf'),_0x378efa,_0xb4e2('0x10'));logger[_0xb4e2('0x11')](_0xb4e2('0x12'),_0x378efa,_0xb4e2('0x10'),JSON[_0xb4e2('0x13')](_0x18a215));if(_0x18a215['error']){if(_0x18a215['error'][_0xb4e2('0x14')]===0x1f4){logger[_0xb4e2('0x15')](_0xb4e2('0xf'),_0x378efa,_0x18a215[_0xb4e2('0x15')][_0xb4e2('0x16')]);return _0x462812(_0x18a215[_0xb4e2('0x15')][_0xb4e2('0x16')]);}logger[_0xb4e2('0x15')](_0xb4e2('0xf'),_0x378efa,_0x18a215[_0xb4e2('0x15')][_0xb4e2('0x16')]);return _0x3976dc(_0x18a215[_0xb4e2('0x15')]['message']);}else{logger[_0xb4e2('0x17')](_0xb4e2('0xf'),_0x378efa,'request\x20sent');_0x3976dc(_0x18a215[_0xb4e2('0x18')][_0xb4e2('0x16')]);}})[_0xb4e2('0x19')](function(_0xb96b){logger[_0xb4e2('0x15')](_0xb4e2('0xf'),_0x378efa,_0xb96b);_0x462812(_0xb96b);});});}exports['GetServicenowAccount']=function(_0x19173c){var _0x2dc6c7=this;return new Promise(function(_0x301685,_0x506644){return db['ServicenowAccount'][_0xb4e2('0x1a')]({'raw':_0x19173c[_0xb4e2('0x1b')]?_0x19173c[_0xb4e2('0x1b')][_0xb4e2('0x1c')]===undefined?!![]:![]:!![],'where':_0x19173c['options']?_0x19173c[_0xb4e2('0x1b')][_0xb4e2('0x1d')]||null:null,'attributes':_0x19173c[_0xb4e2('0x1b')]?_0x19173c['options'][_0xb4e2('0x1e')]||null:null,'limit':_0x19173c['options']?_0x19173c[_0xb4e2('0x1b')][_0xb4e2('0x1f')]||null:null,'include':_0x19173c['options']?_0x19173c[_0xb4e2('0x1b')][_0xb4e2('0x20')]?_[_0xb4e2('0x21')](_0x19173c[_0xb4e2('0x1b')]['include'],function(_0x21f95d){return{'model':db[_0x21f95d[_0xb4e2('0x22')]],'as':_0x21f95d['as'],'attributes':_0x21f95d[_0xb4e2('0x1e')],'include':_0x21f95d[_0xb4e2('0x20')]?_[_0xb4e2('0x21')](_0x21f95d[_0xb4e2('0x20')],function(_0x5cffb3){return{'model':db[_0x5cffb3[_0xb4e2('0x22')]],'as':_0x5cffb3['as'],'attributes':_0x5cffb3[_0xb4e2('0x1e')],'include':_0x5cffb3[_0xb4e2('0x20')]?_[_0xb4e2('0x21')](_0x5cffb3['include'],function(_0x5e5a62){return{'model':db[_0x5e5a62['model']],'as':_0x5e5a62['as'],'attributes':_0x5e5a62['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4e2('0x23')](function(_0x1a9d9a){logger[_0xb4e2('0x17')]('GetServicenowAccount',_0x19173c);logger[_0xb4e2('0x11')](_0xb4e2('0x24'),_0x19173c,JSON[_0xb4e2('0x13')](_0x1a9d9a));_0x301685(_0x1a9d9a);})[_0xb4e2('0x19')](function(_0x7fa5d5){logger[_0xb4e2('0x15')]('GetServicenowAccount',_0x7fa5d5['message'],_0x19173c);_0x506644(_0x2dc6c7['error'](0x1f4,_0x7fa5d5[_0xb4e2('0x16')]));});});};exports['ShowServicenowAccount']=function(_0x2f18ff){var _0x570dc0=this;return new Promise(function(_0x234f4a,_0x1f09aa){return db[_0xb4e2('0x25')][_0xb4e2('0x26')]({'raw':_0x2f18ff[_0xb4e2('0x1b')]?_0x2f18ff['options'][_0xb4e2('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f18ff[_0xb4e2('0x1b')]?_0x2f18ff['options']['where']||null:null,'attributes':_0x2f18ff[_0xb4e2('0x1b')]?_0x2f18ff[_0xb4e2('0x1b')]['attributes']||null:null,'include':_0x2f18ff['options']?_0x2f18ff[_0xb4e2('0x1b')][_0xb4e2('0x20')]?_[_0xb4e2('0x21')](_0x2f18ff[_0xb4e2('0x1b')][_0xb4e2('0x20')],function(_0x166aac){return{'model':db[_0x166aac['model']],'as':_0x166aac['as'],'attributes':_0x166aac[_0xb4e2('0x1e')],'include':_0x166aac[_0xb4e2('0x20')]?_[_0xb4e2('0x21')](_0x166aac[_0xb4e2('0x20')],function(_0x1de7b8){return{'model':db[_0x1de7b8['model']],'as':_0x1de7b8['as'],'attributes':_0x1de7b8[_0xb4e2('0x1e')],'include':_0x1de7b8[_0xb4e2('0x20')]?_['map'](_0x1de7b8[_0xb4e2('0x20')],function(_0x463857){return{'model':db[_0x463857[_0xb4e2('0x22')]],'as':_0x463857['as'],'attributes':_0x463857['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4e2('0x23')](function(_0x59b103){logger[_0xb4e2('0x17')](_0xb4e2('0x27'),_0x2f18ff);logger[_0xb4e2('0x11')](_0xb4e2('0x27'),_0x2f18ff,JSON[_0xb4e2('0x13')](_0x59b103));_0x234f4a(_0x59b103);})['catch'](function(_0x1b817e){logger[_0xb4e2('0x15')]('ShowServicenowAccount',_0x1b817e[_0xb4e2('0x16')],_0x2f18ff);_0x1f09aa(_0x570dc0[_0xb4e2('0x15')](0x1f4,_0x1b817e[_0xb4e2('0x16')]));});});}; \ No newline at end of file +var _0x9571=['options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x29c537,_0x2a4059){var _0xca2b5e=function(_0x12061a){while(--_0x12061a){_0x29c537['push'](_0x29c537['shift']());}};_0xca2b5e(++_0x2a4059);}(_0x9571,0x96));var _0x1957=function(_0xdafc1b,_0x2e33a2){_0xdafc1b=_0xdafc1b-0x0;var _0x31de5b=_0x9571[_0xdafc1b];return _0x31de5b;};'use strict';var _=require(_0x1957('0x0'));var util=require('util');var moment=require(_0x1957('0x1'));var BPromise=require(_0x1957('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1957('0x3'))['db'];var utils=require(_0x1957('0x4'));var logger=require(_0x1957('0x5'))(_0x1957('0x6'));var config=require(_0x1957('0x7'));var jayson=require(_0x1957('0x8'));var client=jayson[_0x1957('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b33da,_0x172df2,_0x279446){return new BPromise(function(_0x37ad57,_0x43affa){return client[_0x1957('0xa')](_0x2b33da,_0x279446)[_0x1957('0xb')](function(_0x124ad9){logger[_0x1957('0xc')](_0x1957('0xd'),_0x172df2,'request\x20sent');logger[_0x1957('0xe')](_0x1957('0xf'),_0x172df2,_0x1957('0x10'),JSON[_0x1957('0x11')](_0x124ad9));if(_0x124ad9[_0x1957('0x12')]){if(_0x124ad9['error'][_0x1957('0x13')]===0x1f4){logger[_0x1957('0x12')](_0x1957('0xd'),_0x172df2,_0x124ad9[_0x1957('0x12')]['message']);return _0x43affa(_0x124ad9['error']['message']);}logger[_0x1957('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x172df2,_0x124ad9[_0x1957('0x12')][_0x1957('0x14')]);return _0x37ad57(_0x124ad9['error']['message']);}else{logger[_0x1957('0xc')](_0x1957('0xd'),_0x172df2,_0x1957('0x10'));_0x37ad57(_0x124ad9['result'][_0x1957('0x14')]);}})[_0x1957('0x15')](function(_0x1b4192){logger[_0x1957('0x12')](_0x1957('0xd'),_0x172df2,_0x1b4192);_0x43affa(_0x1b4192);});});}exports[_0x1957('0x16')]=function(_0x564c98){var _0x54e147=this;return new Promise(function(_0x457ded,_0x5a0ba6){return db[_0x1957('0x17')][_0x1957('0x18')]({'raw':_0x564c98[_0x1957('0x19')]?_0x564c98['options'][_0x1957('0x1a')]===undefined?!![]:![]:!![],'where':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1b')]||null:null,'attributes':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1c')]||null:null,'limit':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1d')]||null:null,'include':_0x564c98['options']?_0x564c98[_0x1957('0x19')][_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x564c98[_0x1957('0x19')][_0x1957('0x1e')],function(_0x283a95){return{'model':db[_0x283a95[_0x1957('0x20')]],'as':_0x283a95['as'],'attributes':_0x283a95['attributes'],'include':_0x283a95[_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x283a95[_0x1957('0x1e')],function(_0x3bbbaf){return{'model':db[_0x3bbbaf['model']],'as':_0x3bbbaf['as'],'attributes':_0x3bbbaf['attributes'],'include':_0x3bbbaf[_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x3bbbaf[_0x1957('0x1e')],function(_0x42d41a){return{'model':db[_0x42d41a[_0x1957('0x20')]],'as':_0x42d41a['as'],'attributes':_0x42d41a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1957('0xb')](function(_0x212cac){logger[_0x1957('0xc')](_0x1957('0x16'),_0x564c98);logger[_0x1957('0xe')]('GetServicenowAccount',_0x564c98,JSON[_0x1957('0x11')](_0x212cac));_0x457ded(_0x212cac);})[_0x1957('0x15')](function(_0x5be32c){logger['error']('GetServicenowAccount',_0x5be32c[_0x1957('0x14')],_0x564c98);_0x5a0ba6(_0x54e147['error'](0x1f4,_0x5be32c[_0x1957('0x14')]));});});};exports[_0x1957('0x21')]=function(_0x389263){var _0x501924=this;return new Promise(function(_0x51d511,_0x241782){return db[_0x1957('0x17')][_0x1957('0x22')]({'raw':_0x389263[_0x1957('0x19')]?_0x389263[_0x1957('0x19')][_0x1957('0x1a')]===undefined?!![]:![]:!![],'where':_0x389263[_0x1957('0x19')]?_0x389263['options'][_0x1957('0x1b')]||null:null,'attributes':_0x389263['options']?_0x389263['options']['attributes']||null:null,'include':_0x389263['options']?_0x389263[_0x1957('0x19')][_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x389263[_0x1957('0x19')][_0x1957('0x1e')],function(_0x5b9da6){return{'model':db[_0x5b9da6[_0x1957('0x20')]],'as':_0x5b9da6['as'],'attributes':_0x5b9da6[_0x1957('0x1c')],'include':_0x5b9da6['include']?_['map'](_0x5b9da6[_0x1957('0x1e')],function(_0x2e474b){return{'model':db[_0x2e474b['model']],'as':_0x2e474b['as'],'attributes':_0x2e474b[_0x1957('0x1c')],'include':_0x2e474b[_0x1957('0x1e')]?_['map'](_0x2e474b[_0x1957('0x1e')],function(_0x2271ce){return{'model':db[_0x2271ce['model']],'as':_0x2271ce['as'],'attributes':_0x2271ce[_0x1957('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1957('0xb')](function(_0x1a5788){logger[_0x1957('0xc')]('ShowServicenowAccount',_0x389263);logger[_0x1957('0xe')]('ShowServicenowAccount',_0x389263,JSON['stringify'](_0x1a5788));_0x51d511(_0x1a5788);})[_0x1957('0x15')](function(_0x1b3285){logger[_0x1957('0x12')]('ShowServicenowAccount',_0x1b3285[_0x1957('0x14')],_0x389263);_0x241782(_0x501924[_0x1957('0x12')](0x1f4,_0x1b3285[_0x1957('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 892cf31..19e4114 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 _0xabae=['/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index'];(function(_0x560b9a,_0x50e66d){var _0x32ff29=function(_0x2df043){while(--_0x2df043){_0x560b9a['push'](_0x560b9a['shift']());}};_0x32ff29(++_0x50e66d);}(_0xabae,0x16f));var _0xeaba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xabae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeaba('0x0'));var util=require(_0xeaba('0x1'));var path=require(_0xeaba('0x2'));var timeout=require('connect-timeout');var express=require(_0xeaba('0x3'));var router=express[_0xeaba('0x4')]();var fs_extra=require(_0xeaba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeaba('0x6'));var controller=require(_0xeaba('0x7'));router[_0xeaba('0x8')]('/',auth[_0xeaba('0x9')](),controller[_0xeaba('0xa')]);router[_0xeaba('0x8')](_0xeaba('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xeaba('0xc'),auth[_0xeaba('0x9')](),controller['getFields']);router[_0xeaba('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xeaba('0xd')]);router[_0xeaba('0x8')](_0xeaba('0xe'),auth[_0xeaba('0x9')](),controller[_0xeaba('0xf')]);router[_0xeaba('0x10')]('/',auth[_0xeaba('0x9')](),controller[_0xeaba('0x11')]);router[_0xeaba('0x12')]('/:id',auth[_0xeaba('0x9')](),controller[_0xeaba('0x13')]);router['delete'](_0xeaba('0xb'),auth[_0xeaba('0x9')](),controller['destroy']);module[_0xeaba('0x14')]=router; \ No newline at end of file +var _0x6847=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getDescriptions','post','put','update','delete','destroy','util'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x6847,0x103));var _0x7684=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x6847[_0x29e2af];return _0x1ea06a;};'use strict';var multer=require('multer');var util=require(_0x7684('0x0'));var path=require(_0x7684('0x1'));var timeout=require(_0x7684('0x2'));var express=require(_0x7684('0x3'));var router=express[_0x7684('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7684('0x5'));var config=require(_0x7684('0x6'));var controller=require(_0x7684('0x7'));router[_0x7684('0x8')]('/',auth['isAuthenticated'](),controller[_0x7684('0x9')]);router[_0x7684('0x8')](_0x7684('0xa'),auth[_0x7684('0xb')](),controller['show']);router[_0x7684('0x8')](_0x7684('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x7684('0x8')](_0x7684('0xd'),auth[_0x7684('0xb')](),controller['getSubjects']);router[_0x7684('0x8')]('/:id/descriptions',auth[_0x7684('0xb')](),controller[_0x7684('0xe')]);router[_0x7684('0xf')]('/',auth[_0x7684('0xb')](),controller['create']);router[_0x7684('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7684('0x11')]);router[_0x7684('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7684('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index be49c17..522a8ba 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 _0x74bf=['sequelize','exports','STRING'];(function(_0x4aeb7c,_0x5aae92){var _0x5d9cd7=function(_0xc79947){while(--_0xc79947){_0x4aeb7c['push'](_0x4aeb7c['shift']());}};_0x5d9cd7(++_0x5aae92);}(_0x74bf,0xea));var _0xf74b=function(_0x4eda69,_0x1e32fe){_0x4eda69=_0x4eda69-0x0;var _0x1692f8=_0x74bf[_0x4eda69];return _0x1692f8;};'use strict';var Sequelize=require(_0xf74b('0x0'));module[_0xf74b('0x1')]={'name':{'type':Sequelize[_0xf74b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x71ab=['exports','STRING','sequelize'];(function(_0x1a7c18,_0x29d596){var _0x5561cc=function(_0x26fc76){while(--_0x26fc76){_0x1a7c18['push'](_0x1a7c18['shift']());}};_0x5561cc(++_0x29d596);}(_0x71ab,0x113));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xb71a('0x0'));module[_0xb71a('0x1')]={'name':{'type':Sequelize[_0xb71a('0x2')]},'description':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 20f3d94..80c2a21 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 _0xb9f9=['zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','getFields','merge','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x5247d2,_0x19ad86){var _0x486d09=function(_0x3c1856){while(--_0x3c1856){_0x5247d2['push'](_0x5247d2['shift']());}};_0x486d09(++_0x19ad86);}(_0xb9f9,0xee));var _0x9b9f=function(_0x1c42d5,_0x408e1f){_0x1c42d5=_0x1c42d5-0x0;var _0x33a149=_0xb9f9[_0x1c42d5];return _0x33a149;};'use strict';var emlformat=require(_0x9b9f('0x0'));var rimraf=require(_0x9b9f('0x1'));var zipdir=require(_0x9b9f('0x2'));var jsonpatch=require(_0x9b9f('0x3'));var rp=require(_0x9b9f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b9f('0x5'));var util=require('util');var path=require(_0x9b9f('0x6'));var sox=require(_0x9b9f('0x7'));var csv=require(_0x9b9f('0x8'));var ejs=require(_0x9b9f('0x9'));var fs=require('fs');var fs_extra=require(_0x9b9f('0xa'));var _=require(_0x9b9f('0xb'));var squel=require(_0x9b9f('0xc'));var crypto=require(_0x9b9f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9b9f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9b9f('0xf'));var Papa=require('papaparse');var Redis=require(_0x9b9f('0x10'));var authService=require(_0x9b9f('0x11'));var qs=require(_0x9b9f('0x12'));var as=require(_0x9b9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b9f('0x14'))(_0x9b9f('0x15'));var utils=require('../../config/utils');var config=require(_0x9b9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b9f('0x17'))['db'];function respondWithStatusCode(_0x588518,_0x25c5f3){_0x25c5f3=_0x25c5f3||0xcc;return function(_0x868996){if(_0x868996){return _0x588518[_0x9b9f('0x18')](_0x25c5f3);}return _0x588518['status'](_0x25c5f3)[_0x9b9f('0x19')]();};}function respondWithResult(_0x1f920a,_0x441af9){_0x441af9=_0x441af9||0xc8;return function(_0x36e6cf){if(_0x36e6cf){return _0x1f920a[_0x9b9f('0x1a')](_0x441af9)[_0x9b9f('0x1b')](_0x36e6cf);}};}function respondWithFilteredResult(_0x579567,_0x376d27){return function(_0x195b59){if(_0x195b59){var _0x26c342=typeof _0x376d27[_0x9b9f('0x1c')]==='undefined'&&typeof _0x376d27[_0x9b9f('0x1d')]===_0x9b9f('0x1e');var _0x37eeed=_0x195b59[_0x9b9f('0x1f')];var _0x562c0b=_0x26c342?0x0:_0x376d27[_0x9b9f('0x1c')];var _0x50df0a=_0x26c342?_0x195b59[_0x9b9f('0x1f')]:_0x376d27[_0x9b9f('0x1c')]+_0x376d27[_0x9b9f('0x1d')];var _0x32c7f7;if(_0x50df0a>=_0x37eeed){_0x50df0a=_0x37eeed;_0x32c7f7=0xc8;}else{_0x32c7f7=0xce;}_0x579567[_0x9b9f('0x1a')](_0x32c7f7);return _0x579567['set'](_0x9b9f('0x20'),_0x562c0b+'-'+_0x50df0a+'/'+_0x37eeed)['json'](_0x195b59);}return null;};}function patchUpdates(_0x2ecc86){return function(_0x4b15c9){try{jsonpatch['apply'](_0x4b15c9,_0x2ecc86,!![]);}catch(_0x7c1c26){return BPromise[_0x9b9f('0x21')](_0x7c1c26);}return _0x4b15c9[_0x9b9f('0x22')]();};}function saveUpdates(_0x54949d,_0x322350){return function(_0x5e7c23){if(_0x5e7c23){return _0x5e7c23[_0x9b9f('0x23')](_0x54949d)[_0x9b9f('0x24')](function(_0x38b925){return _0x38b925;});}return null;};}function removeEntity(_0x36e11e,_0x227302){return function(_0x3dfe39){if(_0x3dfe39){return _0x3dfe39['destroy']()['then'](function(){_0x36e11e[_0x9b9f('0x1a')](0xcc)[_0x9b9f('0x19')]();});}};}function handleEntityNotFound(_0x4a06a5,_0xa19225){return function(_0x56a588){if(!_0x56a588){_0x4a06a5[_0x9b9f('0x18')](0x194);}return _0x56a588;};}function handleError(_0x22d7b8,_0x52eb60){_0x52eb60=_0x52eb60||0x1f4;return function(_0x19f8b5){logger[_0x9b9f('0x25')](_0x19f8b5[_0x9b9f('0x26')]);if(_0x19f8b5[_0x9b9f('0x27')]){delete _0x19f8b5[_0x9b9f('0x27')];}_0x22d7b8[_0x9b9f('0x1a')](_0x52eb60)[_0x9b9f('0x28')](_0x19f8b5);};}exports[_0x9b9f('0x29')]=function(_0x50b062,_0x20a8a9){var _0x3ba768={},_0x155ed6={},_0x2b7298={'count':0x0,'rows':[]};var _0xce7266=_[_0x9b9f('0x2a')](db[_0x9b9f('0x2b')][_0x9b9f('0x2c')],function(_0x4c047c){return{'name':_0x4c047c[_0x9b9f('0x2d')],'type':_0x4c047c[_0x9b9f('0x2e')]['key']};});_0x155ed6['model']=_[_0x9b9f('0x2a')](_0xce7266,'name');_0x155ed6[_0x9b9f('0x2f')]=_[_0x9b9f('0x30')](_0x50b062[_0x9b9f('0x2f')]);_0x155ed6[_0x9b9f('0x31')]=_[_0x9b9f('0x32')](_0x155ed6[_0x9b9f('0x33')],_0x155ed6[_0x9b9f('0x2f')]);_0x3ba768[_0x9b9f('0x34')]=_['intersection'](_0x155ed6[_0x9b9f('0x33')],qs[_0x9b9f('0x35')](_0x50b062['query'][_0x9b9f('0x35')]));_0x3ba768[_0x9b9f('0x34')]=_0x3ba768['attributes'][_0x9b9f('0x36')]?_0x3ba768[_0x9b9f('0x34')]:_0x155ed6['model'];if(!_0x50b062[_0x9b9f('0x2f')][_0x9b9f('0x37')](_0x9b9f('0x38'))){_0x3ba768[_0x9b9f('0x1d')]=qs['limit'](_0x50b062['query'][_0x9b9f('0x1d')]);_0x3ba768[_0x9b9f('0x1c')]=qs[_0x9b9f('0x1c')](_0x50b062[_0x9b9f('0x2f')][_0x9b9f('0x1c')]);}_0x3ba768[_0x9b9f('0x39')]=qs['sort'](_0x50b062['query'][_0x9b9f('0x3a')]);_0x3ba768[_0x9b9f('0x3b')]=qs[_0x9b9f('0x31')](_[_0x9b9f('0x3c')](_0x50b062[_0x9b9f('0x2f')],_0x155ed6[_0x9b9f('0x31')]),_0xce7266);if(_0x50b062[_0x9b9f('0x2f')][_0x9b9f('0x3d')]){_0x3ba768[_0x9b9f('0x3b')]=_['merge'](_0x3ba768[_0x9b9f('0x3b')],{'$or':_[_0x9b9f('0x2a')](_0xce7266,function(_0x5079f8){if(_0x5079f8[_0x9b9f('0x2e')]!==_0x9b9f('0x3e')){var _0x10804d={};_0x10804d[_0x5079f8[_0x9b9f('0x27')]]={'$like':'%'+_0x50b062[_0x9b9f('0x2f')][_0x9b9f('0x3d')]+'%'};return _0x10804d;}})});}_0x3ba768=_['merge']({},_0x3ba768,_0x50b062[_0x9b9f('0x3f')]);var _0x368192={'where':_0x3ba768[_0x9b9f('0x3b')]};return db[_0x9b9f('0x2b')][_0x9b9f('0x1f')](_0x368192)['then'](function(_0x1a4233){_0x2b7298[_0x9b9f('0x1f')]=_0x1a4233;if(_0x50b062['query'][_0x9b9f('0x40')]){_0x3ba768[_0x9b9f('0x41')]=[{'all':!![]}];}return db[_0x9b9f('0x2b')]['findAll'](_0x3ba768);})[_0x9b9f('0x24')](function(_0x1b8408){_0x2b7298[_0x9b9f('0x42')]=_0x1b8408;return _0x2b7298;})[_0x9b9f('0x24')](respondWithFilteredResult(_0x20a8a9,_0x3ba768))[_0x9b9f('0x43')](handleError(_0x20a8a9,null));};exports[_0x9b9f('0x44')]=function(_0x37e635,_0x8ef9d0){var _0x42ad09={'raw':![],'where':{'id':_0x37e635[_0x9b9f('0x45')]['id']}},_0x738544={};_0x738544['model']=_[_0x9b9f('0x30')](db['ServicenowConfiguration'][_0x9b9f('0x2c')]);_0x738544[_0x9b9f('0x2f')]=_[_0x9b9f('0x30')](_0x37e635[_0x9b9f('0x2f')]);_0x738544['filters']=_['intersection'](_0x738544[_0x9b9f('0x33')],_0x738544['query']);_0x42ad09['attributes']=_[_0x9b9f('0x32')](_0x738544[_0x9b9f('0x33')],qs['fields'](_0x37e635[_0x9b9f('0x2f')]['fields']));_0x42ad09[_0x9b9f('0x34')]=_0x42ad09[_0x9b9f('0x34')][_0x9b9f('0x36')]?_0x42ad09['attributes']:_0x738544[_0x9b9f('0x33')];if(_0x37e635['query']['includeAll']){_0x42ad09['include']=[{'all':!![]}];}_0x42ad09=_['merge']({},_0x42ad09,_0x37e635[_0x9b9f('0x3f')]);return db[_0x9b9f('0x2b')][_0x9b9f('0x46')](_0x42ad09)[_0x9b9f('0x24')](handleEntityNotFound(_0x8ef9d0,null))[_0x9b9f('0x24')](respondWithResult(_0x8ef9d0,null))[_0x9b9f('0x43')](handleError(_0x8ef9d0,null));};exports[_0x9b9f('0x47')]=function(_0x38682e,_0xd8f967){return db[_0x9b9f('0x2b')][_0x9b9f('0x47')](_0x38682e['body'],{})[_0x9b9f('0x24')](respondWithResult(_0xd8f967,0xc9))[_0x9b9f('0x43')](handleError(_0xd8f967,null));};exports[_0x9b9f('0x23')]=function(_0x57f79f,_0x39355c){if(_0x57f79f['body']['id']){delete _0x57f79f[_0x9b9f('0x48')]['id'];}return db[_0x9b9f('0x2b')]['find']({'where':{'id':_0x57f79f[_0x9b9f('0x45')]['id']}})[_0x9b9f('0x24')](handleEntityNotFound(_0x39355c,null))['then'](saveUpdates(_0x57f79f[_0x9b9f('0x48')],null))['then'](respondWithResult(_0x39355c,null))[_0x9b9f('0x43')](handleError(_0x39355c,null));};exports[_0x9b9f('0x49')]=function(_0x501dd9,_0x3114ec){return db[_0x9b9f('0x2b')][_0x9b9f('0x46')]({'where':{'id':_0x501dd9[_0x9b9f('0x45')]['id']}})[_0x9b9f('0x24')](handleEntityNotFound(_0x3114ec,null))[_0x9b9f('0x24')](removeEntity(_0x3114ec,null))[_0x9b9f('0x43')](handleError(_0x3114ec,null));};exports[_0x9b9f('0x4a')]=function(_0x559c33,_0x22e183,_0x3c8b7c){var _0x25184a={};var _0x11d34d={};var _0x3a9160;var _0x3ed9d1;return db[_0x9b9f('0x2b')]['findOne']({'where':{'id':_0x559c33['params']['id']}})[_0x9b9f('0x24')](handleEntityNotFound(_0x22e183,null))['then'](function(_0x1463e2){if(_0x1463e2){_0x3a9160=_0x1463e2;_0x11d34d['model']=_[_0x9b9f('0x30')](db['ServicenowField']['rawAttributes']);_0x11d34d[_0x9b9f('0x2f')]=_[_0x9b9f('0x30')](_0x559c33[_0x9b9f('0x2f')]);_0x11d34d['filters']=_['intersection'](_0x11d34d['model'],_0x11d34d['query']);_0x25184a[_0x9b9f('0x34')]=_[_0x9b9f('0x32')](_0x11d34d[_0x9b9f('0x33')],qs[_0x9b9f('0x35')](_0x559c33[_0x9b9f('0x2f')]['fields']));_0x25184a[_0x9b9f('0x34')]=_0x25184a[_0x9b9f('0x34')][_0x9b9f('0x36')]?_0x25184a['attributes']:_0x11d34d[_0x9b9f('0x33')];_0x25184a[_0x9b9f('0x39')]=qs[_0x9b9f('0x3a')](_0x559c33['query'][_0x9b9f('0x3a')]);_0x25184a[_0x9b9f('0x3b')]=qs['filters'](_[_0x9b9f('0x3c')](_0x559c33[_0x9b9f('0x2f')],_0x11d34d[_0x9b9f('0x31')]));if(_0x559c33[_0x9b9f('0x2f')]['filter']){_0x25184a[_0x9b9f('0x3b')]=_[_0x9b9f('0x4b')](_0x25184a[_0x9b9f('0x3b')],{'$or':_[_0x9b9f('0x2a')](_0x25184a[_0x9b9f('0x34')],function(_0x4dc60c){var _0x48732e={};_0x48732e[_0x4dc60c]={'$like':'%'+_0x559c33['query']['filter']+'%'};return _0x48732e;})});}_0x25184a=_[_0x9b9f('0x4b')]({},_0x25184a,_0x559c33[_0x9b9f('0x3f')]);return _0x3a9160[_0x9b9f('0x4a')](_0x25184a);}})[_0x9b9f('0x24')](function(_0x4069ad){if(_0x4069ad){_0x3ed9d1=_0x4069ad[_0x9b9f('0x36')];if(!_0x559c33[_0x9b9f('0x2f')][_0x9b9f('0x37')](_0x9b9f('0x38'))){_0x25184a['limit']=qs[_0x9b9f('0x1d')](_0x559c33['query'][_0x9b9f('0x1d')]);_0x25184a[_0x9b9f('0x1c')]=qs[_0x9b9f('0x1c')](_0x559c33[_0x9b9f('0x2f')]['offset']);}return _0x3a9160[_0x9b9f('0x4a')](_0x25184a);}})[_0x9b9f('0x24')](function(_0x570f72){if(_0x570f72){return _0x570f72?{'count':_0x3ed9d1,'rows':_0x570f72}:null;}})['then'](respondWithResult(_0x22e183,null))[_0x9b9f('0x43')](handleError(_0x22e183,null));};exports['getSubjects']=function(_0x3cd916,_0x4bbb2c,_0x13afc4){var _0x57cdd0={};var _0x1133a9={};var _0x492f4d;var _0x47dde1;return db[_0x9b9f('0x2b')][_0x9b9f('0x4c')]({'where':{'id':_0x3cd916[_0x9b9f('0x45')]['id']}})[_0x9b9f('0x24')](handleEntityNotFound(_0x4bbb2c,null))[_0x9b9f('0x24')](function(_0x23b6a5){if(_0x23b6a5){_0x492f4d=_0x23b6a5;_0x1133a9[_0x9b9f('0x33')]=_[_0x9b9f('0x30')](db[_0x9b9f('0x4d')][_0x9b9f('0x2c')]);_0x1133a9[_0x9b9f('0x2f')]=_[_0x9b9f('0x30')](_0x3cd916[_0x9b9f('0x2f')]);_0x1133a9['filters']=_[_0x9b9f('0x32')](_0x1133a9[_0x9b9f('0x33')],_0x1133a9[_0x9b9f('0x2f')]);_0x57cdd0['attributes']=_[_0x9b9f('0x32')](_0x1133a9[_0x9b9f('0x33')],qs[_0x9b9f('0x35')](_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x35')]));_0x57cdd0[_0x9b9f('0x34')]=_0x57cdd0[_0x9b9f('0x34')][_0x9b9f('0x36')]?_0x57cdd0['attributes']:_0x1133a9[_0x9b9f('0x33')];_0x57cdd0['order']=qs['sort'](_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x3a')]);_0x57cdd0[_0x9b9f('0x3b')]=qs[_0x9b9f('0x31')](_[_0x9b9f('0x3c')](_0x3cd916[_0x9b9f('0x2f')],_0x1133a9[_0x9b9f('0x31')]));if(_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x3d')]){_0x57cdd0[_0x9b9f('0x3b')]=_[_0x9b9f('0x4b')](_0x57cdd0[_0x9b9f('0x3b')],{'$or':_[_0x9b9f('0x2a')](_0x57cdd0[_0x9b9f('0x34')],function(_0x1eabbd){var _0x51de00={};_0x51de00[_0x1eabbd]={'$like':'%'+_0x3cd916['query']['filter']+'%'};return _0x51de00;})});}_0x57cdd0=_[_0x9b9f('0x4b')]({},_0x57cdd0,_0x3cd916[_0x9b9f('0x3f')]);return _0x492f4d[_0x9b9f('0x4e')](_0x57cdd0);}})[_0x9b9f('0x24')](function(_0x30586d){if(_0x30586d){_0x47dde1=_0x30586d[_0x9b9f('0x36')];if(!_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x37')](_0x9b9f('0x38'))){_0x57cdd0[_0x9b9f('0x1d')]=qs[_0x9b9f('0x1d')](_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x1d')]);_0x57cdd0[_0x9b9f('0x1c')]=qs[_0x9b9f('0x1c')](_0x3cd916[_0x9b9f('0x2f')][_0x9b9f('0x1c')]);}return _0x492f4d[_0x9b9f('0x4e')](_0x57cdd0);}})['then'](function(_0x521ff8){if(_0x521ff8){return _0x521ff8?{'count':_0x47dde1,'rows':_0x521ff8}:null;}})[_0x9b9f('0x24')](respondWithResult(_0x4bbb2c,null))[_0x9b9f('0x43')](handleError(_0x4bbb2c,null));};exports[_0x9b9f('0x4f')]=function(_0x1237d9,_0x3dc8e8,_0x361244){var _0x105960={};var _0x4df463={};var _0x24500b;var _0x4060c1;return db[_0x9b9f('0x2b')][_0x9b9f('0x4c')]({'where':{'id':_0x1237d9['params']['id']}})['then'](handleEntityNotFound(_0x3dc8e8,null))[_0x9b9f('0x24')](function(_0x40a8d2){if(_0x40a8d2){_0x24500b=_0x40a8d2;_0x4df463['model']=_[_0x9b9f('0x30')](db[_0x9b9f('0x4d')][_0x9b9f('0x2c')]);_0x4df463[_0x9b9f('0x2f')]=_[_0x9b9f('0x30')](_0x1237d9[_0x9b9f('0x2f')]);_0x4df463[_0x9b9f('0x31')]=_[_0x9b9f('0x32')](_0x4df463[_0x9b9f('0x33')],_0x4df463[_0x9b9f('0x2f')]);_0x105960[_0x9b9f('0x34')]=_['intersection'](_0x4df463[_0x9b9f('0x33')],qs[_0x9b9f('0x35')](_0x1237d9[_0x9b9f('0x2f')]['fields']));_0x105960['attributes']=_0x105960[_0x9b9f('0x34')][_0x9b9f('0x36')]?_0x105960[_0x9b9f('0x34')]:_0x4df463[_0x9b9f('0x33')];_0x105960[_0x9b9f('0x39')]=qs['sort'](_0x1237d9[_0x9b9f('0x2f')]['sort']);_0x105960['where']=qs[_0x9b9f('0x31')](_[_0x9b9f('0x3c')](_0x1237d9[_0x9b9f('0x2f')],_0x4df463[_0x9b9f('0x31')]));if(_0x1237d9['query']['filter']){_0x105960[_0x9b9f('0x3b')]=_['merge'](_0x105960[_0x9b9f('0x3b')],{'$or':_['map'](_0x105960[_0x9b9f('0x34')],function(_0x182974){var _0x38c1a3={};_0x38c1a3[_0x182974]={'$like':'%'+_0x1237d9[_0x9b9f('0x2f')]['filter']+'%'};return _0x38c1a3;})});}_0x105960=_['merge']({},_0x105960,_0x1237d9[_0x9b9f('0x3f')]);return _0x24500b[_0x9b9f('0x4f')](_0x105960);}})[_0x9b9f('0x24')](function(_0x1a9390){if(_0x1a9390){_0x4060c1=_0x1a9390[_0x9b9f('0x36')];if(!_0x1237d9[_0x9b9f('0x2f')]['hasOwnProperty'](_0x9b9f('0x38'))){_0x105960[_0x9b9f('0x1d')]=qs[_0x9b9f('0x1d')](_0x1237d9[_0x9b9f('0x2f')][_0x9b9f('0x1d')]);_0x105960[_0x9b9f('0x1c')]=qs[_0x9b9f('0x1c')](_0x1237d9[_0x9b9f('0x2f')][_0x9b9f('0x1c')]);}return _0x24500b[_0x9b9f('0x4f')](_0x105960);}})[_0x9b9f('0x24')](function(_0x2ccaa5){if(_0x2ccaa5){return _0x2ccaa5?{'count':_0x4060c1,'rows':_0x2ccaa5}:null;}})[_0x9b9f('0x24')](respondWithResult(_0x3dc8e8,null))[_0x9b9f('0x43')](handleError(_0x3dc8e8,null));}; \ No newline at end of file +var _0xcd60=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','params','find','catch','create','body','update','getFields','findOne','ServicenowField','sort','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys'];(function(_0x34e7fe,_0x3df429){var _0x1615e2=function(_0x1439f5){while(--_0x1439f5){_0x34e7fe['push'](_0x34e7fe['shift']());}};_0x1615e2(++_0x3df429);}(_0xcd60,0x1db));var _0x0cd6=function(_0x4b6f17,_0x163a79){_0x4b6f17=_0x4b6f17-0x0;var _0x4b242d=_0xcd60[_0x4b6f17];return _0x4b242d;};'use strict';var emlformat=require(_0x0cd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cd6('0x1'));var jsonpatch=require(_0x0cd6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0cd6('0x3'));var Mustache=require(_0x0cd6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0cd6('0x5'));var csv=require('to-csv');var ejs=require(_0x0cd6('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd6('0x7'));var squel=require('squel');var crypto=require(_0x0cd6('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0cd6('0x9'));var Papa=require(_0x0cd6('0xa'));var Redis=require(_0x0cd6('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x0cd6('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cd6('0xd'))(_0x0cd6('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0cd6('0xf'))['db'];function respondWithStatusCode(_0x54c8a6,_0xac718e){_0xac718e=_0xac718e||0xcc;return function(_0x4b7b07){if(_0x4b7b07){return _0x54c8a6[_0x0cd6('0x10')](_0xac718e);}return _0x54c8a6['status'](_0xac718e)[_0x0cd6('0x11')]();};}function respondWithResult(_0x1314ad,_0x102197){_0x102197=_0x102197||0xc8;return function(_0x1e3fc0){if(_0x1e3fc0){return _0x1314ad['status'](_0x102197)[_0x0cd6('0x12')](_0x1e3fc0);}};}function respondWithFilteredResult(_0x15744f,_0x270aa7){return function(_0x325a30){if(_0x325a30){var _0x5c1629=typeof _0x270aa7[_0x0cd6('0x13')]===_0x0cd6('0x14')&&typeof _0x270aa7[_0x0cd6('0x15')]==='undefined';var _0xe64d6b=_0x325a30['count'];var _0x2b9d46=_0x5c1629?0x0:_0x270aa7[_0x0cd6('0x13')];var _0x29f336=_0x5c1629?_0x325a30['count']:_0x270aa7[_0x0cd6('0x13')]+_0x270aa7[_0x0cd6('0x15')];var _0x83759f;if(_0x29f336>=_0xe64d6b){_0x29f336=_0xe64d6b;_0x83759f=0xc8;}else{_0x83759f=0xce;}_0x15744f[_0x0cd6('0x16')](_0x83759f);return _0x15744f[_0x0cd6('0x17')](_0x0cd6('0x18'),_0x2b9d46+'-'+_0x29f336+'/'+_0xe64d6b)[_0x0cd6('0x12')](_0x325a30);}return null;};}function patchUpdates(_0x39445e){return function(_0x2982b9){try{jsonpatch[_0x0cd6('0x19')](_0x2982b9,_0x39445e,!![]);}catch(_0x4cb9f3){return BPromise[_0x0cd6('0x1a')](_0x4cb9f3);}return _0x2982b9[_0x0cd6('0x1b')]();};}function saveUpdates(_0x5bb7d1,_0x4c3cca){return function(_0x29e32a){if(_0x29e32a){return _0x29e32a['update'](_0x5bb7d1)[_0x0cd6('0x1c')](function(_0x18451c){return _0x18451c;});}return null;};}function removeEntity(_0x1c4512,_0xc229d8){return function(_0x2d121b){if(_0x2d121b){return _0x2d121b[_0x0cd6('0x1d')]()[_0x0cd6('0x1c')](function(){_0x1c4512[_0x0cd6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f14ba,_0x9da37a){return function(_0x327cd1){if(!_0x327cd1){_0x5f14ba[_0x0cd6('0x10')](0x194);}return _0x327cd1;};}function handleError(_0x386c4,_0x4372b3){_0x4372b3=_0x4372b3||0x1f4;return function(_0x5d5ef2){logger[_0x0cd6('0x1e')](_0x5d5ef2[_0x0cd6('0x1f')]);if(_0x5d5ef2[_0x0cd6('0x20')]){delete _0x5d5ef2[_0x0cd6('0x20')];}_0x386c4['status'](_0x4372b3)[_0x0cd6('0x21')](_0x5d5ef2);};}exports[_0x0cd6('0x22')]=function(_0xa8c3f2,_0x18fd73){var _0x269d6a={},_0xb573bc={},_0x5b3252={'count':0x0,'rows':[]};var _0x50359c=_[_0x0cd6('0x23')](db[_0x0cd6('0x24')][_0x0cd6('0x25')],function(_0x42a60f){return{'name':_0x42a60f[_0x0cd6('0x26')],'type':_0x42a60f['type'][_0x0cd6('0x27')]};});_0xb573bc[_0x0cd6('0x28')]=_[_0x0cd6('0x23')](_0x50359c,_0x0cd6('0x20'));_0xb573bc[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0xa8c3f2['query']);_0xb573bc[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0xb573bc[_0x0cd6('0x28')],_0xb573bc[_0x0cd6('0x29')]);_0x269d6a[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0xb573bc[_0x0cd6('0x28')],qs[_0x0cd6('0x2e')](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0x269d6a[_0x0cd6('0x2d')]=_0x269d6a['attributes'][_0x0cd6('0x2f')]?_0x269d6a[_0x0cd6('0x2d')]:_0xb573bc[_0x0cd6('0x28')];if(!_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x30')](_0x0cd6('0x31'))){_0x269d6a['limit']=qs['limit'](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x15')]);_0x269d6a['offset']=qs[_0x0cd6('0x13')](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x13')]);}_0x269d6a[_0x0cd6('0x32')]=qs['sort'](_0xa8c3f2[_0x0cd6('0x29')]['sort']);_0x269d6a[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_['pick'](_0xa8c3f2[_0x0cd6('0x29')],_0xb573bc[_0x0cd6('0x2b')]),_0x50359c);if(_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0x269d6a[_0x0cd6('0x33')]=_['merge'](_0x269d6a[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x50359c,function(_0x3561eb){if(_0x3561eb[_0x0cd6('0x35')]!==_0x0cd6('0x36')){var _0x593993={};_0x593993[_0x3561eb['name']]={'$like':'%'+_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x593993;}})});}_0x269d6a=_[_0x0cd6('0x37')]({},_0x269d6a,_0xa8c3f2[_0x0cd6('0x38')]);var _0x400305={'where':_0x269d6a[_0x0cd6('0x33')]};return db['ServicenowConfiguration'][_0x0cd6('0x39')](_0x400305)['then'](function(_0x1e8507){_0x5b3252[_0x0cd6('0x39')]=_0x1e8507;if(_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x3a')]){_0x269d6a[_0x0cd6('0x3b')]=[{'all':!![]}];}return db[_0x0cd6('0x24')][_0x0cd6('0x3c')](_0x269d6a);})[_0x0cd6('0x1c')](function(_0x27674c){_0x5b3252['rows']=_0x27674c;return _0x5b3252;})[_0x0cd6('0x1c')](respondWithFilteredResult(_0x18fd73,_0x269d6a))['catch'](handleError(_0x18fd73,null));};exports['show']=function(_0x225ee9,_0x2c7c9c){var _0x5270f6={'raw':![],'where':{'id':_0x225ee9[_0x0cd6('0x3d')]['id']}},_0x4b3e45={};_0x4b3e45[_0x0cd6('0x28')]=_[_0x0cd6('0x2a')](db[_0x0cd6('0x24')][_0x0cd6('0x25')]);_0x4b3e45[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x225ee9[_0x0cd6('0x29')]);_0x4b3e45[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x4b3e45[_0x0cd6('0x28')],_0x4b3e45[_0x0cd6('0x29')]);_0x5270f6['attributes']=_[_0x0cd6('0x2c')](_0x4b3e45[_0x0cd6('0x28')],qs[_0x0cd6('0x2e')](_0x225ee9[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0x5270f6[_0x0cd6('0x2d')]=_0x5270f6['attributes']['length']?_0x5270f6[_0x0cd6('0x2d')]:_0x4b3e45['model'];if(_0x225ee9[_0x0cd6('0x29')][_0x0cd6('0x3a')]){_0x5270f6[_0x0cd6('0x3b')]=[{'all':!![]}];}_0x5270f6=_['merge']({},_0x5270f6,_0x225ee9[_0x0cd6('0x38')]);return db[_0x0cd6('0x24')][_0x0cd6('0x3e')](_0x5270f6)[_0x0cd6('0x1c')](handleEntityNotFound(_0x2c7c9c,null))[_0x0cd6('0x1c')](respondWithResult(_0x2c7c9c,null))[_0x0cd6('0x3f')](handleError(_0x2c7c9c,null));};exports[_0x0cd6('0x40')]=function(_0x2ddbdb,_0xd8aa5f){return db[_0x0cd6('0x24')][_0x0cd6('0x40')](_0x2ddbdb[_0x0cd6('0x41')],{})['then'](respondWithResult(_0xd8aa5f,0xc9))[_0x0cd6('0x3f')](handleError(_0xd8aa5f,null));};exports[_0x0cd6('0x42')]=function(_0x412112,_0x219c22){if(_0x412112[_0x0cd6('0x41')]['id']){delete _0x412112[_0x0cd6('0x41')]['id'];}return db[_0x0cd6('0x24')][_0x0cd6('0x3e')]({'where':{'id':_0x412112[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x219c22,null))[_0x0cd6('0x1c')](saveUpdates(_0x412112[_0x0cd6('0x41')],null))[_0x0cd6('0x1c')](respondWithResult(_0x219c22,null))[_0x0cd6('0x3f')](handleError(_0x219c22,null));};exports[_0x0cd6('0x1d')]=function(_0x4ed6c3,_0x55a933){return db[_0x0cd6('0x24')][_0x0cd6('0x3e')]({'where':{'id':_0x4ed6c3[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x55a933,null))[_0x0cd6('0x1c')](removeEntity(_0x55a933,null))['catch'](handleError(_0x55a933,null));};exports[_0x0cd6('0x43')]=function(_0x28c95c,_0x1db068,_0x295f8a){var _0x5cd6b8={};var _0x4c18fa={};var _0x17b861;var _0x3e8c94;return db[_0x0cd6('0x24')][_0x0cd6('0x44')]({'where':{'id':_0x28c95c['params']['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x1db068,null))['then'](function(_0x1ff08d){if(_0x1ff08d){_0x17b861=_0x1ff08d;_0x4c18fa[_0x0cd6('0x28')]=_[_0x0cd6('0x2a')](db[_0x0cd6('0x45')]['rawAttributes']);_0x4c18fa[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x28c95c['query']);_0x4c18fa[_0x0cd6('0x2b')]=_['intersection'](_0x4c18fa[_0x0cd6('0x28')],_0x4c18fa[_0x0cd6('0x29')]);_0x5cd6b8[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x4c18fa[_0x0cd6('0x28')],qs['fields'](_0x28c95c['query'][_0x0cd6('0x2e')]));_0x5cd6b8[_0x0cd6('0x2d')]=_0x5cd6b8[_0x0cd6('0x2d')]['length']?_0x5cd6b8[_0x0cd6('0x2d')]:_0x4c18fa['model'];_0x5cd6b8['order']=qs[_0x0cd6('0x46')](_0x28c95c[_0x0cd6('0x29')][_0x0cd6('0x46')]);_0x5cd6b8[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_[_0x0cd6('0x47')](_0x28c95c[_0x0cd6('0x29')],_0x4c18fa[_0x0cd6('0x2b')]));if(_0x28c95c['query']['filter']){_0x5cd6b8['where']=_[_0x0cd6('0x37')](_0x5cd6b8[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x5cd6b8[_0x0cd6('0x2d')],function(_0x3f55b9){var _0x200532={};_0x200532[_0x3f55b9]={'$like':'%'+_0x28c95c['query'][_0x0cd6('0x34')]+'%'};return _0x200532;})});}_0x5cd6b8=_[_0x0cd6('0x37')]({},_0x5cd6b8,_0x28c95c[_0x0cd6('0x38')]);return _0x17b861[_0x0cd6('0x43')](_0x5cd6b8);}})['then'](function(_0x265e8c){if(_0x265e8c){_0x3e8c94=_0x265e8c['length'];if(!_0x28c95c[_0x0cd6('0x29')]['hasOwnProperty']('nolimit')){_0x5cd6b8[_0x0cd6('0x15')]=qs['limit'](_0x28c95c[_0x0cd6('0x29')][_0x0cd6('0x15')]);_0x5cd6b8[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x28c95c['query'][_0x0cd6('0x13')]);}return _0x17b861[_0x0cd6('0x43')](_0x5cd6b8);}})['then'](function(_0x5c6e1d){if(_0x5c6e1d){return _0x5c6e1d?{'count':_0x3e8c94,'rows':_0x5c6e1d}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x1db068,null))[_0x0cd6('0x3f')](handleError(_0x1db068,null));};exports[_0x0cd6('0x48')]=function(_0x5e8e11,_0x25c4b8,_0x33a204){var _0xba99b1={};var _0x139c6e={};var _0x1204d1;var _0x59056b;return db[_0x0cd6('0x24')][_0x0cd6('0x44')]({'where':{'id':_0x5e8e11[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x25c4b8,null))[_0x0cd6('0x1c')](function(_0x4ead2b){if(_0x4ead2b){_0x1204d1=_0x4ead2b;_0x139c6e['model']=_['keys'](db[_0x0cd6('0x45')][_0x0cd6('0x25')]);_0x139c6e[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x5e8e11[_0x0cd6('0x29')]);_0x139c6e[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x139c6e[_0x0cd6('0x28')],_0x139c6e[_0x0cd6('0x29')]);_0xba99b1[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x139c6e['model'],qs[_0x0cd6('0x2e')](_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0xba99b1[_0x0cd6('0x2d')]=_0xba99b1[_0x0cd6('0x2d')][_0x0cd6('0x2f')]?_0xba99b1[_0x0cd6('0x2d')]:_0x139c6e['model'];_0xba99b1[_0x0cd6('0x32')]=qs['sort'](_0x5e8e11['query']['sort']);_0xba99b1[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_['pick'](_0x5e8e11['query'],_0x139c6e[_0x0cd6('0x2b')]));if(_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0xba99b1[_0x0cd6('0x33')]=_[_0x0cd6('0x37')](_0xba99b1[_0x0cd6('0x33')],{'$or':_['map'](_0xba99b1[_0x0cd6('0x2d')],function(_0x1228f4){var _0x457944={};_0x457944[_0x1228f4]={'$like':'%'+_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x457944;})});}_0xba99b1=_[_0x0cd6('0x37')]({},_0xba99b1,_0x5e8e11[_0x0cd6('0x38')]);return _0x1204d1[_0x0cd6('0x48')](_0xba99b1);}})[_0x0cd6('0x1c')](function(_0x28f896){if(_0x28f896){_0x59056b=_0x28f896[_0x0cd6('0x2f')];if(!_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x30')]('nolimit')){_0xba99b1[_0x0cd6('0x15')]=qs[_0x0cd6('0x15')](_0x5e8e11['query'][_0x0cd6('0x15')]);_0xba99b1[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x13')]);}return _0x1204d1[_0x0cd6('0x48')](_0xba99b1);}})[_0x0cd6('0x1c')](function(_0x238944){if(_0x238944){return _0x238944?{'count':_0x59056b,'rows':_0x238944}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x25c4b8,null))[_0x0cd6('0x3f')](handleError(_0x25c4b8,null));};exports[_0x0cd6('0x49')]=function(_0x5a5db8,_0x2be1f2,_0x598051){var _0x4dd6b8={};var _0x55bdbc={};var _0x41540a;var _0x4e4cd5;return db[_0x0cd6('0x24')]['findOne']({'where':{'id':_0x5a5db8['params']['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x2be1f2,null))[_0x0cd6('0x1c')](function(_0x2c65dc){if(_0x2c65dc){_0x41540a=_0x2c65dc;_0x55bdbc['model']=_[_0x0cd6('0x2a')](db[_0x0cd6('0x45')][_0x0cd6('0x25')]);_0x55bdbc[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x5a5db8[_0x0cd6('0x29')]);_0x55bdbc[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x55bdbc[_0x0cd6('0x28')],_0x55bdbc[_0x0cd6('0x29')]);_0x4dd6b8[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x55bdbc['model'],qs[_0x0cd6('0x2e')](_0x5a5db8['query'][_0x0cd6('0x2e')]));_0x4dd6b8['attributes']=_0x4dd6b8[_0x0cd6('0x2d')][_0x0cd6('0x2f')]?_0x4dd6b8[_0x0cd6('0x2d')]:_0x55bdbc[_0x0cd6('0x28')];_0x4dd6b8[_0x0cd6('0x32')]=qs[_0x0cd6('0x46')](_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x46')]);_0x4dd6b8[_0x0cd6('0x33')]=qs['filters'](_[_0x0cd6('0x47')](_0x5a5db8['query'],_0x55bdbc['filters']));if(_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0x4dd6b8[_0x0cd6('0x33')]=_[_0x0cd6('0x37')](_0x4dd6b8[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x4dd6b8['attributes'],function(_0x2b6956){var _0x5b9a0d={};_0x5b9a0d[_0x2b6956]={'$like':'%'+_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x5b9a0d;})});}_0x4dd6b8=_[_0x0cd6('0x37')]({},_0x4dd6b8,_0x5a5db8['options']);return _0x41540a[_0x0cd6('0x49')](_0x4dd6b8);}})[_0x0cd6('0x1c')](function(_0x32a647){if(_0x32a647){_0x4e4cd5=_0x32a647[_0x0cd6('0x2f')];if(!_0x5a5db8['query'][_0x0cd6('0x30')]('nolimit')){_0x4dd6b8['limit']=qs[_0x0cd6('0x15')](_0x5a5db8['query'][_0x0cd6('0x15')]);_0x4dd6b8[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x13')]);}return _0x41540a[_0x0cd6('0x49')](_0x4dd6b8);}})[_0x0cd6('0x1c')](function(_0x4ca4f7){if(_0x4ca4f7){return _0x4ca4f7?{'count':_0x4e4cd5,'rows':_0x4ca4f7}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x2be1f2,null))[_0x0cd6('0x3f')](handleError(_0x2be1f2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 78cc3ea..d7bceed 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 _0x0c2b=['bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment'];(function(_0x2d376c,_0x2da911){var _0x23ab04=function(_0x384e3e){while(--_0x384e3e){_0x2d376c['push'](_0x2d376c['shift']());}};_0x23ab04(++_0x2da911);}(_0x0c2b,0x194));var _0xb0c2=function(_0x3d86af,_0x90488){_0x3d86af=_0x3d86af-0x0;var _0x2bcbec=_0x0c2b[_0x3d86af];return _0x2bcbec;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda20=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','bluebird','path','rimraf','./intServicenowConfiguration.attributes','exports'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xda20,0x1d9));var _0x0da2=function(_0x5725c0,_0x260a86){_0x5725c0=_0x5725c0-0x0;var _0x495959=_0xda20[_0x5725c0];return _0x495959;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var logger=require(_0x0da2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0da2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0da2('0x3'));var rimraf=require(_0x0da2('0x4'));var config=require('../../config/environment');var attributes=require(_0x0da2('0x5'));module[_0x0da2('0x6')]=function(_0x5c1bcb,_0x4674a3){return _0x5c1bcb[_0x0da2('0x7')](_0x0da2('0x8'),attributes,{'tableName':_0x0da2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 59f183d..0925986 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 _0xbc89=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x944d25,_0x19ad9e){var _0x3d6d79=function(_0x2103db){while(--_0x2103db){_0x944d25['push'](_0x944d25['shift']());}};_0x3d6d79(++_0x19ad9e);}(_0xbc89,0x9c));var _0x9bc8=function(_0x3f2855,_0x220576){_0x3f2855=_0x3f2855-0x0;var _0x20c16f=_0xbc89[_0x3f2855];return _0x20c16f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9bc8('0x0'));var rs=require(_0x9bc8('0x1'));var fs=require('fs');var Redis=require(_0x9bc8('0x2'));var db=require(_0x9bc8('0x3'))['db'];var utils=require(_0x9bc8('0x4'));var logger=require(_0x9bc8('0x5'))(_0x9bc8('0x6'));var config=require(_0x9bc8('0x7'));var jayson=require(_0x9bc8('0x8'));var client=jayson[_0x9bc8('0x9')][_0x9bc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417bb1,_0x5f16c8,_0x5eb132){return new BPromise(function(_0x486e97,_0x578b31){return client[_0x9bc8('0xb')](_0x417bb1,_0x5eb132)[_0x9bc8('0xc')](function(_0x212f43){logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,_0x9bc8('0xf'));logger[_0x9bc8('0x10')](_0x9bc8('0x11'),_0x5f16c8,_0x9bc8('0xf'),JSON[_0x9bc8('0x12')](_0x212f43));if(_0x212f43[_0x9bc8('0x13')]){if(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x14')]===0x1f4){logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')]['message']);return _0x578b31(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);return _0x486e97(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}else{logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,'request\x20sent');_0x486e97(_0x212f43[_0x9bc8('0x16')][_0x9bc8('0x15')]);}})[_0x9bc8('0x17')](function(_0x16d830){logger[_0x9bc8('0x13')](_0x9bc8('0xe'),_0x5f16c8,_0x16d830);_0x578b31(_0x16d830);});});} \ No newline at end of file +var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x1862f5,_0x4697e6){var _0x56cdec=function(_0x4fcaa5){while(--_0x4fcaa5){_0x1862f5['push'](_0x1862f5['shift']());}};_0x56cdec(++_0x4697e6);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1c1b59,_0x282b21){_0x1c1b59=_0x1c1b59-0x0;var _0xcedf9e=_0xdbf5[_0x1c1b59];return _0xcedf9e;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4ffeec2..ad028e9 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 _0x3b87=['post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b87,0xe3));var _0x73b8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3b87[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x73b8('0x0'));var util=require(_0x73b8('0x1'));var path=require(_0x73b8('0x2'));var timeout=require(_0x73b8('0x3'));var express=require(_0x73b8('0x4'));var router=express['Router']();var fs_extra=require(_0x73b8('0x5'));var auth=require(_0x73b8('0x6'));var interaction=require(_0x73b8('0x7'));var config=require(_0x73b8('0x8'));var controller=require('./intServicenowField.controller');router[_0x73b8('0x9')]('/',auth[_0x73b8('0xa')](),controller[_0x73b8('0xb')]);router['get']('/:id',auth[_0x73b8('0xa')](),controller[_0x73b8('0xc')]);router[_0x73b8('0xd')]('/',auth[_0x73b8('0xa')](),controller[_0x73b8('0xe')]);router[_0x73b8('0xf')](_0x73b8('0x10'),auth['isAuthenticated'](),controller[_0x73b8('0x11')]);router[_0x73b8('0x12')]('/:id',auth[_0x73b8('0xa')](),controller[_0x73b8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x91ab=['show','post','create','put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x326205,_0x5ef700){var _0x2717dd=function(_0x2d8862){while(--_0x2d8862){_0x326205['push'](_0x326205['shift']());}};_0x2717dd(++_0x5ef700);}(_0x91ab,0x1a6));var _0xb91a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x91ab[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb91a('0x0'));var express=require(_0xb91a('0x1'));var router=express[_0xb91a('0x2')]();var fs_extra=require(_0xb91a('0x3'));var auth=require(_0xb91a('0x4'));var interaction=require(_0xb91a('0x5'));var config=require(_0xb91a('0x6'));var controller=require('./intServicenowField.controller');router[_0xb91a('0x7')]('/',auth[_0xb91a('0x8')](),controller[_0xb91a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb91a('0xa')]);router[_0xb91a('0xb')]('/',auth[_0xb91a('0x8')](),controller[_0xb91a('0xc')]);router[_0xb91a('0xd')](_0xb91a('0xe'),auth[_0xb91a('0x8')](),controller[_0xb91a('0xf')]);router[_0xb91a('0x10')](_0xb91a('0xe'),auth['isAuthenticated'](),controller[_0xb91a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 533051e..1954dc9 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 _0x5415=['sequelize','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x15aac1,_0x465e9a){var _0x509bd1=function(_0x400c94){while(--_0x400c94){_0x15aac1['push'](_0x15aac1['shift']());}};_0x509bd1(++_0x465e9a);}(_0x5415,0x88));var _0x5541=function(_0x5056d8,_0x39a83b){_0x5056d8=_0x5056d8-0x0;var _0x115ec2=_0x5415[_0x5056d8];return _0x115ec2;};'use strict';var Sequelize=require(_0x5541('0x0'));module['exports']={'type':{'type':Sequelize[_0x5541('0x1')](_0x5541('0x2'),_0x5541('0x3'),_0x5541('0x4'),'keyValue',_0x5541('0x5')),'defaultValue':_0x5541('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x5541('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5541('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5541('0x6')]},'customField':{'type':Sequelize[_0x5541('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5541('0x6')]}}; \ No newline at end of file +var _0xb2b2=['ENUM','variable','keyValue','string','STRING','customVariable','sequelize','exports'];(function(_0x364643,_0x35a6b8){var _0x12eb9f=function(_0x3429bc){while(--_0x3429bc){_0x364643['push'](_0x364643['shift']());}};_0x12eb9f(++_0x35a6b8);}(_0xb2b2,0x1e6));var _0x2b2b=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb2b2[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x2b2b('0x0'));module[_0x2b2b('0x1')]={'type':{'type':Sequelize[_0x2b2b('0x2')]('string',_0x2b2b('0x3'),'customVariable',_0x2b2b('0x4'),'picklist'),'defaultValue':_0x2b2b('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2b2b('0x6')]},'keyType':{'type':Sequelize[_0x2b2b('0x2')](_0x2b2b('0x5'),_0x2b2b('0x3'),_0x2b2b('0x7'))},'keyContent':{'type':Sequelize[_0x2b2b('0x6')]},'idField':{'type':Sequelize[_0x2b2b('0x6')]},'nameField':{'type':Sequelize[_0x2b2b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c0566ac..7b72f09 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 _0x3815=['reject','save','update','then','destroy','end','error','stack','name','index','map','ServicenowField','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','keys','options','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2798c2,_0x5e0bfc){var _0x4d694c=function(_0x4607c4){while(--_0x4607c4){_0x2798c2['push'](_0x2798c2['shift']());}};_0x4d694c(++_0x5e0bfc);}(_0x3815,0x17c));var _0x5381=function(_0x5dd4ac,_0x401087){_0x5dd4ac=_0x5dd4ac-0x0;var _0x100498=_0x3815[_0x5dd4ac];return _0x100498;};'use strict';var emlformat=require(_0x5381('0x0'));var rimraf=require(_0x5381('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5381('0x2'));var rp=require('request-promise');var moment=require(_0x5381('0x3'));var BPromise=require(_0x5381('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5381('0x5'));var sox=require(_0x5381('0x6'));var csv=require(_0x5381('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5381('0x8'));var _=require(_0x5381('0x9'));var squel=require(_0x5381('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5381('0xb'));var Papa=require(_0x5381('0xc'));var Redis=require(_0x5381('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5381('0xe'));var utils=require(_0x5381('0xf'));var config=require(_0x5381('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5381('0x11'))['db'];function respondWithStatusCode(_0x37b2b7,_0x206ab0){_0x206ab0=_0x206ab0||0xcc;return function(_0x3df7f4){if(_0x3df7f4){return _0x37b2b7[_0x5381('0x12')](_0x206ab0);}return _0x37b2b7['status'](_0x206ab0)['end']();};}function respondWithResult(_0x2031ab,_0x2dd00e){_0x2dd00e=_0x2dd00e||0xc8;return function(_0x50c5da){if(_0x50c5da){return _0x2031ab[_0x5381('0x13')](_0x2dd00e)[_0x5381('0x14')](_0x50c5da);}};}function respondWithFilteredResult(_0x78214e,_0x34be45){return function(_0x5e596d){if(_0x5e596d){var _0x93bf6=typeof _0x34be45[_0x5381('0x15')]===_0x5381('0x16')&&typeof _0x34be45[_0x5381('0x17')]===_0x5381('0x16');var _0x447aa3=_0x5e596d['count'];var _0x441099=_0x93bf6?0x0:_0x34be45['offset'];var _0x2814dc=_0x93bf6?_0x5e596d[_0x5381('0x18')]:_0x34be45[_0x5381('0x15')]+_0x34be45[_0x5381('0x17')];var _0x2ce65b;if(_0x2814dc>=_0x447aa3){_0x2814dc=_0x447aa3;_0x2ce65b=0xc8;}else{_0x2ce65b=0xce;}_0x78214e['status'](_0x2ce65b);return _0x78214e[_0x5381('0x19')](_0x5381('0x1a'),_0x441099+'-'+_0x2814dc+'/'+_0x447aa3)[_0x5381('0x14')](_0x5e596d);}return null;};}function patchUpdates(_0x209b69){return function(_0xab75ba){try{jsonpatch[_0x5381('0x1b')](_0xab75ba,_0x209b69,!![]);}catch(_0xaeea28){return BPromise[_0x5381('0x1c')](_0xaeea28);}return _0xab75ba[_0x5381('0x1d')]();};}function saveUpdates(_0x2e0ec9,_0x4e7126){return function(_0x4edef4){if(_0x4edef4){return _0x4edef4[_0x5381('0x1e')](_0x2e0ec9)[_0x5381('0x1f')](function(_0x448664){return _0x448664;});}return null;};}function removeEntity(_0x117f2e,_0x1e71cf){return function(_0x4c356b){if(_0x4c356b){return _0x4c356b[_0x5381('0x20')]()[_0x5381('0x1f')](function(){_0x117f2e[_0x5381('0x13')](0xcc)[_0x5381('0x21')]();});}};}function handleEntityNotFound(_0x3f5142,_0x4c9974){return function(_0x3738b2){if(!_0x3738b2){_0x3f5142[_0x5381('0x12')](0x194);}return _0x3738b2;};}function handleError(_0x5d165e,_0x32ff37){_0x32ff37=_0x32ff37||0x1f4;return function(_0x2db357){logger[_0x5381('0x22')](_0x2db357[_0x5381('0x23')]);if(_0x2db357['name']){delete _0x2db357[_0x5381('0x24')];}_0x5d165e['status'](_0x32ff37)['send'](_0x2db357);};}exports[_0x5381('0x25')]=function(_0x4feb48,_0x4090ea){var _0x3e345e={},_0xa39246={},_0x554aaa={'count':0x0,'rows':[]};var _0x487259=_[_0x5381('0x26')](db[_0x5381('0x27')][_0x5381('0x28')],function(_0x3497e9){return{'name':_0x3497e9['fieldName'],'type':_0x3497e9[_0x5381('0x29')][_0x5381('0x2a')]};});_0xa39246['model']=_[_0x5381('0x26')](_0x487259,'name');_0xa39246[_0x5381('0x2b')]=_['keys'](_0x4feb48[_0x5381('0x2b')]);_0xa39246[_0x5381('0x2c')]=_[_0x5381('0x2d')](_0xa39246[_0x5381('0x2e')],_0xa39246[_0x5381('0x2b')]);_0x3e345e[_0x5381('0x2f')]=_[_0x5381('0x2d')](_0xa39246[_0x5381('0x2e')],qs['fields'](_0x4feb48['query'][_0x5381('0x30')]));_0x3e345e['attributes']=_0x3e345e[_0x5381('0x2f')][_0x5381('0x31')]?_0x3e345e[_0x5381('0x2f')]:_0xa39246[_0x5381('0x2e')];if(!_0x4feb48[_0x5381('0x2b')][_0x5381('0x32')](_0x5381('0x33'))){_0x3e345e['limit']=qs[_0x5381('0x17')](_0x4feb48['query'][_0x5381('0x17')]);_0x3e345e['offset']=qs['offset'](_0x4feb48['query'][_0x5381('0x15')]);}_0x3e345e['order']=qs[_0x5381('0x34')](_0x4feb48[_0x5381('0x2b')][_0x5381('0x34')]);_0x3e345e['where']=qs[_0x5381('0x2c')](_[_0x5381('0x35')](_0x4feb48['query'],_0xa39246[_0x5381('0x2c')]),_0x487259);if(_0x4feb48[_0x5381('0x2b')][_0x5381('0x36')]){_0x3e345e[_0x5381('0x37')]=_[_0x5381('0x38')](_0x3e345e[_0x5381('0x37')],{'$or':_[_0x5381('0x26')](_0x487259,function(_0x5d42e9){if(_0x5d42e9['type']!==_0x5381('0x39')){var _0x40284d={};_0x40284d[_0x5d42e9[_0x5381('0x24')]]={'$like':'%'+_0x4feb48[_0x5381('0x2b')]['filter']+'%'};return _0x40284d;}})});}_0x3e345e=_[_0x5381('0x38')]({},_0x3e345e,_0x4feb48['options']);var _0x267837={'where':_0x3e345e['where']};return db[_0x5381('0x27')][_0x5381('0x18')](_0x267837)[_0x5381('0x1f')](function(_0x591d03){_0x554aaa['count']=_0x591d03;if(_0x4feb48[_0x5381('0x2b')][_0x5381('0x3a')]){_0x3e345e[_0x5381('0x3b')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x3e345e);})[_0x5381('0x1f')](function(_0x40f65d){_0x554aaa['rows']=_0x40f65d;return _0x554aaa;})['then'](respondWithFilteredResult(_0x4090ea,_0x3e345e))[_0x5381('0x3c')](handleError(_0x4090ea,null));};exports[_0x5381('0x3d')]=function(_0x2d510c,_0xcb038d){var _0x1934a1={'raw':!![],'where':{'id':_0x2d510c[_0x5381('0x3e')]['id']}},_0x44e6ee={};_0x44e6ee[_0x5381('0x2e')]=_[_0x5381('0x3f')](db[_0x5381('0x27')][_0x5381('0x28')]);_0x44e6ee[_0x5381('0x2b')]=_[_0x5381('0x3f')](_0x2d510c[_0x5381('0x2b')]);_0x44e6ee['filters']=_[_0x5381('0x2d')](_0x44e6ee[_0x5381('0x2e')],_0x44e6ee[_0x5381('0x2b')]);_0x1934a1[_0x5381('0x2f')]=_['intersection'](_0x44e6ee[_0x5381('0x2e')],qs['fields'](_0x2d510c[_0x5381('0x2b')][_0x5381('0x30')]));_0x1934a1[_0x5381('0x2f')]=_0x1934a1[_0x5381('0x2f')]['length']?_0x1934a1['attributes']:_0x44e6ee[_0x5381('0x2e')];if(_0x2d510c[_0x5381('0x2b')]['includeAll']){_0x1934a1[_0x5381('0x3b')]=[{'all':!![]}];}_0x1934a1=_['merge']({},_0x1934a1,_0x2d510c[_0x5381('0x40')]);return db['ServicenowField'][_0x5381('0x41')](_0x1934a1)[_0x5381('0x1f')](handleEntityNotFound(_0xcb038d,null))[_0x5381('0x1f')](respondWithResult(_0xcb038d,null))[_0x5381('0x3c')](handleError(_0xcb038d,null));};exports[_0x5381('0x42')]=function(_0x540a3f,_0x40c0c2){return db['ServicenowField']['create'](_0x540a3f[_0x5381('0x43')],{})['then'](respondWithResult(_0x40c0c2,0xc9))[_0x5381('0x3c')](handleError(_0x40c0c2,null));};exports[_0x5381('0x1e')]=function(_0x28fb89,_0x38152c){if(_0x28fb89[_0x5381('0x43')]['id']){delete _0x28fb89[_0x5381('0x43')]['id'];}return db['ServicenowField'][_0x5381('0x41')]({'where':{'id':_0x28fb89['params']['id']}})['then'](handleEntityNotFound(_0x38152c,null))[_0x5381('0x1f')](saveUpdates(_0x28fb89['body'],null))[_0x5381('0x1f')](respondWithResult(_0x38152c,null))[_0x5381('0x3c')](handleError(_0x38152c,null));};exports[_0x5381('0x20')]=function(_0x2b89e5,_0x523755){return db[_0x5381('0x27')][_0x5381('0x41')]({'where':{'id':_0x2b89e5[_0x5381('0x3e')]['id']}})[_0x5381('0x1f')](handleEntityNotFound(_0x523755,null))[_0x5381('0x1f')](removeEntity(_0x523755,null))[_0x5381('0x3c')](handleError(_0x523755,null));}; \ No newline at end of file +var _0x5163=['to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x340b72,_0xdecf9){var _0x227e04=function(_0x115290){while(--_0x115290){_0x340b72['push'](_0x340b72['shift']());}};_0x227e04(++_0xdecf9);}(_0x5163,0xce));var _0x3516=function(_0x5668a1,_0x15cbc6){_0x5668a1=_0x5668a1-0x0;var _0x1dab00=_0x5163[_0x5668a1];return _0x1dab00;};'use strict';var emlformat=require(_0x3516('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3516('0x1'));var jsonpatch=require(_0x3516('0x2'));var rp=require(_0x3516('0x3'));var moment=require('moment');var BPromise=require(_0x3516('0x4'));var Mustache=require(_0x3516('0x5'));var util=require(_0x3516('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3516('0x7'));var ejs=require(_0x3516('0x8'));var fs=require('fs');var fs_extra=require(_0x3516('0x9'));var _=require('lodash');var squel=require(_0x3516('0xa'));var crypto=require('crypto');var jsforce=require(_0x3516('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3516('0x7'));var querystring=require(_0x3516('0xc'));var Papa=require('papaparse');var Redis=require(_0x3516('0xd'));var authService=require(_0x3516('0xe'));var qs=require(_0x3516('0xf'));var as=require(_0x3516('0x10'));var hardwareService=require(_0x3516('0x11'));var logger=require(_0x3516('0x12'))(_0x3516('0x13'));var utils=require(_0x3516('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3516('0x15'));var db=require(_0x3516('0x16'))['db'];function respondWithStatusCode(_0x14fb9f,_0x30596e){_0x30596e=_0x30596e||0xcc;return function(_0x4f7e32){if(_0x4f7e32){return _0x14fb9f[_0x3516('0x17')](_0x30596e);}return _0x14fb9f[_0x3516('0x18')](_0x30596e)['end']();};}function respondWithResult(_0x4af0a8,_0x5d3069){_0x5d3069=_0x5d3069||0xc8;return function(_0x1fc01d){if(_0x1fc01d){return _0x4af0a8[_0x3516('0x18')](_0x5d3069)[_0x3516('0x19')](_0x1fc01d);}};}function respondWithFilteredResult(_0xc65617,_0x49aa4f){return function(_0x2220f1){if(_0x2220f1){var _0x1f1220=typeof _0x49aa4f[_0x3516('0x1a')]===_0x3516('0x1b')&&typeof _0x49aa4f['limit']==='undefined';var _0x3fc3cd=_0x2220f1[_0x3516('0x1c')];var _0x583236=_0x1f1220?0x0:_0x49aa4f[_0x3516('0x1a')];var _0x436618=_0x1f1220?_0x2220f1['count']:_0x49aa4f[_0x3516('0x1a')]+_0x49aa4f[_0x3516('0x1d')];var _0x44cbe6;if(_0x436618>=_0x3fc3cd){_0x436618=_0x3fc3cd;_0x44cbe6=0xc8;}else{_0x44cbe6=0xce;}_0xc65617[_0x3516('0x18')](_0x44cbe6);return _0xc65617['set'](_0x3516('0x1e'),_0x583236+'-'+_0x436618+'/'+_0x3fc3cd)['json'](_0x2220f1);}return null;};}function patchUpdates(_0x2cd1ea){return function(_0x57f2a2){try{jsonpatch['apply'](_0x57f2a2,_0x2cd1ea,!![]);}catch(_0x1c2420){return BPromise['reject'](_0x1c2420);}return _0x57f2a2['save']();};}function saveUpdates(_0x485f95,_0x3f1898){return function(_0x2966){if(_0x2966){return _0x2966[_0x3516('0x1f')](_0x485f95)[_0x3516('0x20')](function(_0xd4b05a){return _0xd4b05a;});}return null;};}function removeEntity(_0x3cd52,_0x347301){return function(_0x1dea38){if(_0x1dea38){return _0x1dea38[_0x3516('0x21')]()[_0x3516('0x20')](function(){_0x3cd52[_0x3516('0x18')](0xcc)[_0x3516('0x22')]();});}};}function handleEntityNotFound(_0x4cd9d6,_0x27b77f){return function(_0x53d4ba){if(!_0x53d4ba){_0x4cd9d6['sendStatus'](0x194);}return _0x53d4ba;};}function handleError(_0x55ec6c,_0xacf813){_0xacf813=_0xacf813||0x1f4;return function(_0x508da4){logger[_0x3516('0x23')](_0x508da4[_0x3516('0x24')]);if(_0x508da4[_0x3516('0x25')]){delete _0x508da4[_0x3516('0x25')];}_0x55ec6c[_0x3516('0x18')](_0xacf813)[_0x3516('0x26')](_0x508da4);};}exports[_0x3516('0x27')]=function(_0x29d90b,_0x2b0792){var _0x324f3a={},_0x39b3b9={},_0x48eb32={'count':0x0,'rows':[]};var _0x38cb9f=_[_0x3516('0x28')](db[_0x3516('0x29')][_0x3516('0x2a')],function(_0x1856c4){return{'name':_0x1856c4[_0x3516('0x2b')],'type':_0x1856c4[_0x3516('0x2c')][_0x3516('0x2d')]};});_0x39b3b9[_0x3516('0x2e')]=_[_0x3516('0x28')](_0x38cb9f,'name');_0x39b3b9[_0x3516('0x2f')]=_[_0x3516('0x30')](_0x29d90b[_0x3516('0x2f')]);_0x39b3b9[_0x3516('0x31')]=_[_0x3516('0x32')](_0x39b3b9['model'],_0x39b3b9[_0x3516('0x2f')]);_0x324f3a[_0x3516('0x33')]=_['intersection'](_0x39b3b9[_0x3516('0x2e')],qs[_0x3516('0x34')](_0x29d90b[_0x3516('0x2f')][_0x3516('0x34')]));_0x324f3a['attributes']=_0x324f3a['attributes'][_0x3516('0x35')]?_0x324f3a[_0x3516('0x33')]:_0x39b3b9[_0x3516('0x2e')];if(!_0x29d90b[_0x3516('0x2f')][_0x3516('0x36')](_0x3516('0x37'))){_0x324f3a[_0x3516('0x1d')]=qs[_0x3516('0x1d')](_0x29d90b[_0x3516('0x2f')]['limit']);_0x324f3a[_0x3516('0x1a')]=qs[_0x3516('0x1a')](_0x29d90b['query'][_0x3516('0x1a')]);}_0x324f3a[_0x3516('0x38')]=qs['sort'](_0x29d90b[_0x3516('0x2f')][_0x3516('0x39')]);_0x324f3a[_0x3516('0x3a')]=qs[_0x3516('0x31')](_['pick'](_0x29d90b[_0x3516('0x2f')],_0x39b3b9[_0x3516('0x31')]),_0x38cb9f);if(_0x29d90b[_0x3516('0x2f')][_0x3516('0x3b')]){_0x324f3a[_0x3516('0x3a')]=_[_0x3516('0x3c')](_0x324f3a['where'],{'$or':_['map'](_0x38cb9f,function(_0x43789a){if(_0x43789a[_0x3516('0x2c')]!==_0x3516('0x3d')){var _0x939277={};_0x939277[_0x43789a[_0x3516('0x25')]]={'$like':'%'+_0x29d90b[_0x3516('0x2f')][_0x3516('0x3b')]+'%'};return _0x939277;}})});}_0x324f3a=_[_0x3516('0x3c')]({},_0x324f3a,_0x29d90b[_0x3516('0x3e')]);var _0x299e4a={'where':_0x324f3a[_0x3516('0x3a')]};return db[_0x3516('0x29')]['count'](_0x299e4a)[_0x3516('0x20')](function(_0x1e2e8c){_0x48eb32['count']=_0x1e2e8c;if(_0x29d90b[_0x3516('0x2f')]['includeAll']){_0x324f3a['include']=[{'all':!![]}];}return db[_0x3516('0x29')]['findAll'](_0x324f3a);})['then'](function(_0x37e2b4){_0x48eb32[_0x3516('0x3f')]=_0x37e2b4;return _0x48eb32;})[_0x3516('0x20')](respondWithFilteredResult(_0x2b0792,_0x324f3a))[_0x3516('0x40')](handleError(_0x2b0792,null));};exports[_0x3516('0x41')]=function(_0x454414,_0x1db191){var _0x424178={'raw':!![],'where':{'id':_0x454414[_0x3516('0x42')]['id']}},_0x3e86ee={};_0x3e86ee[_0x3516('0x2e')]=_['keys'](db[_0x3516('0x29')][_0x3516('0x2a')]);_0x3e86ee[_0x3516('0x2f')]=_[_0x3516('0x30')](_0x454414[_0x3516('0x2f')]);_0x3e86ee[_0x3516('0x31')]=_[_0x3516('0x32')](_0x3e86ee['model'],_0x3e86ee[_0x3516('0x2f')]);_0x424178[_0x3516('0x33')]=_[_0x3516('0x32')](_0x3e86ee[_0x3516('0x2e')],qs['fields'](_0x454414[_0x3516('0x2f')][_0x3516('0x34')]));_0x424178[_0x3516('0x33')]=_0x424178[_0x3516('0x33')][_0x3516('0x35')]?_0x424178[_0x3516('0x33')]:_0x3e86ee['model'];if(_0x454414[_0x3516('0x2f')]['includeAll']){_0x424178[_0x3516('0x43')]=[{'all':!![]}];}_0x424178=_[_0x3516('0x3c')]({},_0x424178,_0x454414[_0x3516('0x3e')]);return db[_0x3516('0x29')][_0x3516('0x44')](_0x424178)[_0x3516('0x20')](handleEntityNotFound(_0x1db191,null))[_0x3516('0x20')](respondWithResult(_0x1db191,null))[_0x3516('0x40')](handleError(_0x1db191,null));};exports[_0x3516('0x45')]=function(_0x819c63,_0x475572){return db[_0x3516('0x29')][_0x3516('0x45')](_0x819c63[_0x3516('0x46')],{})[_0x3516('0x20')](respondWithResult(_0x475572,0xc9))[_0x3516('0x40')](handleError(_0x475572,null));};exports['update']=function(_0x546310,_0x436a8c){if(_0x546310[_0x3516('0x46')]['id']){delete _0x546310[_0x3516('0x46')]['id'];}return db[_0x3516('0x29')][_0x3516('0x44')]({'where':{'id':_0x546310['params']['id']}})[_0x3516('0x20')](handleEntityNotFound(_0x436a8c,null))[_0x3516('0x20')](saveUpdates(_0x546310[_0x3516('0x46')],null))[_0x3516('0x20')](respondWithResult(_0x436a8c,null))[_0x3516('0x40')](handleError(_0x436a8c,null));};exports['destroy']=function(_0x5f0428,_0x57ecf){return db[_0x3516('0x29')][_0x3516('0x44')]({'where':{'id':_0x5f0428[_0x3516('0x42')]['id']}})[_0x3516('0x20')](handleEntityNotFound(_0x57ecf,null))['then'](removeEntity(_0x57ecf,null))['catch'](handleError(_0x57ecf,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 462e67b..80cfce5 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 _0x68a7=['util','moment','bluebird','path','../../config/environment','int_servicenow_fields','idField','lodash'];(function(_0x12fe26,_0x34d757){var _0x108eae=function(_0x38a005){while(--_0x38a005){_0x12fe26['push'](_0x12fe26['shift']());}};_0x108eae(++_0x34d757);}(_0x68a7,0x77));var _0x768a=function(_0x12dc1f,_0x395cec){_0x12dc1f=_0x12dc1f-0x0;var _0x47fdb8=_0x68a7[_0x12dc1f];return _0x47fdb8;};'use strict';var _=require(_0x768a('0x0'));var util=require(_0x768a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x768a('0x2'));var BPromise=require(_0x768a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x768a('0x4'));var rimraf=require('rimraf');var config=require(_0x768a('0x5'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x4d9d80,_0x367954){return _0x4d9d80['define']('ServicenowField',attributes,{'tableName':_0x768a('0x6'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x768a('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x703c=['api','moment','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x187c30,_0x238119){var _0x391824=function(_0x5e10e3){while(--_0x5e10e3){_0x187c30['push'](_0x187c30['shift']());}};_0x391824(++_0x238119);}(_0x703c,0x1b0));var _0xc703=function(_0x3864d8,_0x311498){_0x3864d8=_0x3864d8-0x0;var _0x6d161=_0x703c[_0x3864d8];return _0x6d161;};'use strict';var _=require(_0xc703('0x0'));var util=require(_0xc703('0x1'));var logger=require('../../config/logger')(_0xc703('0x2'));var moment=require(_0xc703('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc703('0x4'));var rimraf=require(_0xc703('0x5'));var config=require(_0xc703('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xc703('0x7')]=function(_0x50eb69,_0x33b0df){return _0x50eb69[_0xc703('0x8')](_0xc703('0x9'),attributes,{'tableName':_0xc703('0xa'),'paranoid':![],'indexes':[{'name':_0xc703('0xb'),'fields':[_0xc703('0xc'),_0xc703('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 6fdf9b4..5ad7a5e 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2e1835,_0x480554){_0x2e1835=_0x2e1835-0x0;var _0x50c493=_0xf4eb[_0x2e1835];return _0x50c493;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0xf8a295,_0x3980db){var _0xf28354=function(_0x382fb0){while(--_0x382fb0){_0xf8a295['push'](_0xf8a295['shift']());}};_0xf28354(++_0x3980db);}(_0xe706,0xa3));var _0x6e70=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0xe706[_0x19fec1];return _0x29cd35;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index bcbc64b..6158bd1 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(_0x2a01d1,_0x4dba20){var _0x1b9f26=function(_0x5e7ec1){while(--_0x5e7ec1){_0x2a01d1['push'](_0x2a01d1['shift']());}};_0x1b9f26(++_0x4dba20);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0xe47558,_0x603ef2){var _0x404a43=function(_0x37c3d5){while(--_0x37c3d5){_0xe47558['push'](_0xe47558['shift']());}};_0x404a43(++_0x603ef2);}(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 54db523..a78234e 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(_0x474d5d,_0x227073){var _0x45f710=function(_0x4c0e54){while(--_0x4c0e54){_0x474d5d['push'](_0x474d5d['shift']());}};_0x45f710(++_0x227073);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x57a64c,_0x33f071){var _0x445964=function(_0x1260ce){while(--_0x1260ce){_0x57a64c['push'](_0x57a64c['shift']());}};_0x445964(++_0x33f071);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 15ea5ba..7e0ab26 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 _0x4380=['getFields','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','Calls','values','remove','label','endsWith','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../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','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','SugarcrmAccount','catch','show','length','include','find','create','body','params','getConfigurations','keys','pick','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField'];(function(_0x2d7cab,_0x4f9e13){var _0x18eb74=function(_0x107dbb){while(--_0x107dbb){_0x2d7cab['push'](_0x2d7cab['shift']());}};_0x18eb74(++_0x4f9e13);}(_0x4380,0x1ef));var _0x0438=function(_0x824305,_0x5a41aa){_0x824305=_0x824305-0x0;var _0x17c89a=_0x4380[_0x824305];return _0x17c89a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0438('0x0'));var zipdir=require(_0x0438('0x1'));var jsonpatch=require(_0x0438('0x2'));var rp=require('request-promise');var moment=require(_0x0438('0x3'));var BPromise=require(_0x0438('0x4'));var Mustache=require(_0x0438('0x5'));var util=require(_0x0438('0x6'));var path=require('path');var sox=require(_0x0438('0x7'));var csv=require(_0x0438('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0438('0x9'));var _=require(_0x0438('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0438('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0438('0x8'));var querystring=require(_0x0438('0xc'));var Papa=require(_0x0438('0xd'));var Redis=require(_0x0438('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0438('0xf'));var as=require(_0x0438('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0438('0x11'))('api');var utils=require(_0x0438('0x12'));var config=require(_0x0438('0x13'));var licenseUtil=require(_0x0438('0x14'));var db=require(_0x0438('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xecf831,_0x446f82){_0x446f82=_0x446f82||0xcc;return function(_0x3154da){if(_0x3154da){return _0xecf831[_0x0438('0x16')](_0x446f82);}return _0xecf831[_0x0438('0x17')](_0x446f82)[_0x0438('0x18')]();};}function respondWithResult(_0x50ce81,_0x3266c2){_0x3266c2=_0x3266c2||0xc8;return function(_0x19a688){if(_0x19a688){return _0x50ce81[_0x0438('0x17')](_0x3266c2)[_0x0438('0x19')](_0x19a688);}};}function respondWithFilteredResult(_0x3b8c14,_0x2d39c3){return function(_0x4e1207){if(_0x4e1207){var _0x52c15c=typeof _0x2d39c3[_0x0438('0x1a')]===_0x0438('0x1b')&&typeof _0x2d39c3[_0x0438('0x1c')]===_0x0438('0x1b');var _0x22e3ca=_0x4e1207[_0x0438('0x1d')];var _0x1ac04d=_0x52c15c?0x0:_0x2d39c3[_0x0438('0x1a')];var _0xac0649=_0x52c15c?_0x4e1207['count']:_0x2d39c3['offset']+_0x2d39c3[_0x0438('0x1c')];var _0x48223c;if(_0xac0649>=_0x22e3ca){_0xac0649=_0x22e3ca;_0x48223c=0xc8;}else{_0x48223c=0xce;}_0x3b8c14[_0x0438('0x17')](_0x48223c);return _0x3b8c14[_0x0438('0x1e')]('Content-Range',_0x1ac04d+'-'+_0xac0649+'/'+_0x22e3ca)[_0x0438('0x19')](_0x4e1207);}return null;};}function patchUpdates(_0x40ada5){return function(_0x335619){try{jsonpatch['apply'](_0x335619,_0x40ada5,!![]);}catch(_0x2eb92e){return BPromise[_0x0438('0x1f')](_0x2eb92e);}return _0x335619[_0x0438('0x20')]();};}function saveUpdates(_0x1c4048,_0x23d824){return function(_0x1ec16e){if(_0x1ec16e){return _0x1ec16e[_0x0438('0x21')](_0x1c4048)[_0x0438('0x22')](function(_0x1fb68c){return _0x1fb68c;});}return null;};}function removeEntity(_0x2a057a,_0x2db1d4){return function(_0x4a3114){if(_0x4a3114){return _0x4a3114[_0x0438('0x23')]()[_0x0438('0x22')](function(){_0x2a057a['status'](0xcc)[_0x0438('0x18')]();});}};}function handleEntityNotFound(_0x25314a,_0x1821dc){return function(_0x30aa3d){if(!_0x30aa3d){_0x25314a[_0x0438('0x16')](0x194);}return _0x30aa3d;};}function handleError(_0x615d4a,_0x5d07de){_0x5d07de=_0x5d07de||0x1f4;return function(_0xfb322d){logger['error'](_0xfb322d[_0x0438('0x24')]);if(_0xfb322d[_0x0438('0x25')]){delete _0xfb322d[_0x0438('0x25')];}_0x615d4a[_0x0438('0x17')](_0x5d07de)[_0x0438('0x26')](_0xfb322d);};}exports[_0x0438('0x27')]=function(_0x9eadd1,_0x19a2f7){var _0x328120={},_0x12cb49={},_0x36d557={'count':0x0,'rows':[]};var _0x36b26e=_[_0x0438('0x28')](db['SugarcrmAccount'][_0x0438('0x29')],function(_0x4c51f2){return{'name':_0x4c51f2[_0x0438('0x2a')],'type':_0x4c51f2['type']['key']};});_0x12cb49[_0x0438('0x2b')]=_['map'](_0x36b26e,_0x0438('0x25'));_0x12cb49[_0x0438('0x2c')]=_['keys'](_0x9eadd1[_0x0438('0x2c')]);_0x12cb49['filters']=_[_0x0438('0x2d')](_0x12cb49[_0x0438('0x2b')],_0x12cb49['query']);_0x328120[_0x0438('0x2e')]=_[_0x0438('0x2d')](_0x12cb49['model'],qs[_0x0438('0x2f')](_0x9eadd1['query'][_0x0438('0x2f')]));_0x328120[_0x0438('0x2e')]=_0x328120['attributes']['length']?_0x328120['attributes']:_0x12cb49[_0x0438('0x2b')];if(!_0x9eadd1['query'][_0x0438('0x30')](_0x0438('0x31'))){_0x328120[_0x0438('0x1c')]=qs[_0x0438('0x1c')](_0x9eadd1[_0x0438('0x2c')][_0x0438('0x1c')]);_0x328120[_0x0438('0x1a')]=qs[_0x0438('0x1a')](_0x9eadd1[_0x0438('0x2c')]['offset']);}_0x328120[_0x0438('0x32')]=qs[_0x0438('0x33')](_0x9eadd1[_0x0438('0x2c')][_0x0438('0x33')]);_0x328120[_0x0438('0x34')]=qs[_0x0438('0x35')](_['pick'](_0x9eadd1[_0x0438('0x2c')],_0x12cb49[_0x0438('0x35')]),_0x36b26e);if(_0x9eadd1[_0x0438('0x2c')][_0x0438('0x36')]){_0x328120[_0x0438('0x34')]=_[_0x0438('0x37')](_0x328120[_0x0438('0x34')],{'$or':_[_0x0438('0x28')](_0x36b26e,function(_0x4a0497){if(_0x4a0497[_0x0438('0x38')]!==_0x0438('0x39')){var _0x56a001={};_0x56a001[_0x4a0497[_0x0438('0x25')]]={'$like':'%'+_0x9eadd1[_0x0438('0x2c')]['filter']+'%'};return _0x56a001;}})});}_0x328120=_[_0x0438('0x37')]({},_0x328120,_0x9eadd1[_0x0438('0x3a')]);var _0x2053b5={'where':_0x328120[_0x0438('0x34')]};return db['SugarcrmAccount'][_0x0438('0x1d')](_0x2053b5)[_0x0438('0x22')](function(_0xb23afb){_0x36d557[_0x0438('0x1d')]=_0xb23afb;if(_0x9eadd1[_0x0438('0x2c')][_0x0438('0x3b')]){_0x328120['include']=[{'all':!![]}];}return db[_0x0438('0x3c')]['findAll'](_0x328120);})[_0x0438('0x22')](function(_0x15af94){_0x36d557['rows']=_0x15af94;return _0x36d557;})[_0x0438('0x22')](respondWithFilteredResult(_0x19a2f7,_0x328120))[_0x0438('0x3d')](handleError(_0x19a2f7,null));};exports[_0x0438('0x3e')]=function(_0x449b81,_0x4f841d){var _0x14910c={'raw':![],'where':{'id':_0x449b81['params']['id']}},_0x535313={};_0x535313[_0x0438('0x2b')]=_['keys'](db[_0x0438('0x3c')][_0x0438('0x29')]);_0x535313[_0x0438('0x2c')]=_['keys'](_0x449b81[_0x0438('0x2c')]);_0x535313[_0x0438('0x35')]=_[_0x0438('0x2d')](_0x535313[_0x0438('0x2b')],_0x535313[_0x0438('0x2c')]);_0x14910c[_0x0438('0x2e')]=_[_0x0438('0x2d')](_0x535313['model'],qs['fields'](_0x449b81[_0x0438('0x2c')]['fields']));_0x14910c[_0x0438('0x2e')]=_0x14910c[_0x0438('0x2e')][_0x0438('0x3f')]?_0x14910c[_0x0438('0x2e')]:_0x535313['model'];if(_0x449b81[_0x0438('0x2c')][_0x0438('0x3b')]){_0x14910c[_0x0438('0x40')]=[{'all':!![]}];}_0x14910c=_['merge']({},_0x14910c,_0x449b81[_0x0438('0x3a')]);return db[_0x0438('0x3c')][_0x0438('0x41')](_0x14910c)[_0x0438('0x22')](handleEntityNotFound(_0x4f841d,null))[_0x0438('0x22')](respondWithResult(_0x4f841d,null))['catch'](handleError(_0x4f841d,null));};exports[_0x0438('0x42')]=function(_0x41c390,_0x23f3e6){return db[_0x0438('0x3c')][_0x0438('0x42')](_0x41c390[_0x0438('0x43')],{})['then'](respondWithResult(_0x23f3e6,0xc9))['catch'](handleError(_0x23f3e6,null));};exports['update']=function(_0x4942ec,_0x45c722){if(_0x4942ec[_0x0438('0x43')]['id']){delete _0x4942ec['body']['id'];}return db[_0x0438('0x3c')]['find']({'where':{'id':_0x4942ec[_0x0438('0x44')]['id']}})[_0x0438('0x22')](handleEntityNotFound(_0x45c722,null))[_0x0438('0x22')](saveUpdates(_0x4942ec[_0x0438('0x43')],null))[_0x0438('0x22')](respondWithResult(_0x45c722,null))[_0x0438('0x3d')](handleError(_0x45c722,null));};exports[_0x0438('0x23')]=function(_0x299db7,_0x549786){return db[_0x0438('0x3c')]['find']({'where':{'id':_0x299db7[_0x0438('0x44')]['id']}})[_0x0438('0x22')](handleEntityNotFound(_0x549786,null))[_0x0438('0x22')](removeEntity(_0x549786,null))['catch'](handleError(_0x549786,null));};exports[_0x0438('0x45')]=function(_0x12cf75,_0x320e7a,_0x455c72){var _0x16fba0={};var _0x1b78f6={};var _0x1c9807;var _0x55646f;return db[_0x0438('0x3c')]['findOne']({'where':{'id':_0x12cf75['params']['id']}})[_0x0438('0x22')](handleEntityNotFound(_0x320e7a,null))[_0x0438('0x22')](function(_0x5dbc8f){if(_0x5dbc8f){_0x1c9807=_0x5dbc8f;_0x1b78f6[_0x0438('0x2b')]=_[_0x0438('0x46')](db['SugarcrmConfiguration'][_0x0438('0x29')]);_0x1b78f6[_0x0438('0x2c')]=_[_0x0438('0x46')](_0x12cf75[_0x0438('0x2c')]);_0x1b78f6[_0x0438('0x35')]=_[_0x0438('0x2d')](_0x1b78f6['model'],_0x1b78f6[_0x0438('0x2c')]);_0x16fba0[_0x0438('0x2e')]=_[_0x0438('0x2d')](_0x1b78f6[_0x0438('0x2b')],qs['fields'](_0x12cf75[_0x0438('0x2c')][_0x0438('0x2f')]));_0x16fba0[_0x0438('0x2e')]=_0x16fba0[_0x0438('0x2e')][_0x0438('0x3f')]?_0x16fba0['attributes']:_0x1b78f6['model'];_0x16fba0[_0x0438('0x32')]=qs[_0x0438('0x33')](_0x12cf75[_0x0438('0x2c')][_0x0438('0x33')]);_0x16fba0['where']=qs[_0x0438('0x35')](_[_0x0438('0x47')](_0x12cf75[_0x0438('0x2c')],_0x1b78f6[_0x0438('0x35')]));if(_0x12cf75['query']['filter']){_0x16fba0['where']=_[_0x0438('0x37')](_0x16fba0[_0x0438('0x34')],{'$or':_['map'](_0x16fba0['attributes'],function(_0x4de392){var _0xdec662={};_0xdec662[_0x4de392]={'$like':'%'+_0x12cf75[_0x0438('0x2c')]['filter']+'%'};return _0xdec662;})});}_0x16fba0=_[_0x0438('0x37')]({},_0x16fba0,_0x12cf75['options']);return _0x1c9807[_0x0438('0x45')](_0x16fba0);}})[_0x0438('0x22')](function(_0x4248a5){if(_0x4248a5){_0x55646f=_0x4248a5[_0x0438('0x3f')];if(!_0x12cf75['query'][_0x0438('0x30')](_0x0438('0x31'))){_0x16fba0[_0x0438('0x1c')]=qs[_0x0438('0x1c')](_0x12cf75[_0x0438('0x2c')][_0x0438('0x1c')]);_0x16fba0[_0x0438('0x1a')]=qs[_0x0438('0x1a')](_0x12cf75[_0x0438('0x2c')][_0x0438('0x1a')]);}return _0x1c9807[_0x0438('0x45')](_0x16fba0);}})[_0x0438('0x22')](function(_0xf02a74){if(_0xf02a74){return _0xf02a74?{'count':_0x55646f,'rows':_0xf02a74}:null;}})[_0x0438('0x22')](respondWithResult(_0x320e7a,null))[_0x0438('0x3d')](handleError(_0x320e7a,null));};exports[_0x0438('0x48')]=function(_0x4e35da,_0xdb4e31,_0xac0a7c){if(_0x4e35da[_0x0438('0x43')]['id']){delete _0x4e35da[_0x0438('0x43')]['id'];}return db[_0x0438('0x3c')][_0x0438('0x49')]({'where':{'id':_0x4e35da['params']['id']}})[_0x0438('0x22')](handleEntityNotFound(_0xdb4e31,null))[_0x0438('0x22')](function(_0x2c8582){if(_0x2c8582){_0x4e35da[_0x0438('0x43')][_0x0438('0x4a')]=_0x2c8582['id'];_0x4e35da[_0x0438('0x43')]['Subjects']=integrations[_0x0438('0x4b')](_0x4e35da[_0x0438('0x43')]['channel'],_0x4e35da[_0x0438('0x43')]['type']);_0x4e35da[_0x0438('0x43')][_0x0438('0x4c')]=integrations[_0x0438('0x4d')](_0x4e35da['body'][_0x0438('0x4e')],_0x4e35da[_0x0438('0x43')]['type']);return db['SugarcrmConfiguration']['create'](_0x4e35da[_0x0438('0x43')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x0438('0x4f')],'as':_0x0438('0x4c')}]});}return null;})[_0x0438('0x22')](respondWithResult(_0xdb4e31,null))['catch'](handleError(_0xdb4e31,null));};exports[_0x0438('0x50')]=function(_0x5affd2,_0x38f6d7,_0x5e7ebc){var _0x3f10bc='';var _0x42263a=['id',_0x0438('0x25'),_0x0438('0x51'),_0x0438('0x52'),'description','date_start',_0x0438('0x53'),_0x0438('0x54'),_0x0438('0x55'),_0x0438('0x56'),_0x0438('0x57'),_0x0438('0x58')];return db[_0x0438('0x3c')][_0x0438('0x49')]({'where':{'id':_0x5affd2['params']['id']},'attributes':['id',_0x0438('0x59'),_0x0438('0x5a'),_0x0438('0x5b')]})[_0x0438('0x22')](handleEntityNotFound(_0x38f6d7,null))[_0x0438('0x22')](function(_0x539a68){if(_0x539a68){_0x3f10bc=_0x539a68[_0x0438('0x5b')];var _0x5d6c28=_0x3f10bc[_0x0438('0x5c')](-0x1);if(_0x5d6c28==='/'){_0x3f10bc=_0x3f10bc[_0x0438('0x5d')](0x0,_0x3f10bc['lastIndexOf'](_0x5d6c28));}return rp({'method':'POST','uri':util[_0x0438('0x5e')](_0x0438('0x5f'),_0x3f10bc,_0x0438('0x60')),'json':!![],'form':{'method':_0x0438('0x61'),'input_type':_0x0438('0x62'),'response_type':_0x0438('0x62'),'rest_data':JSON[_0x0438('0x63')]({'user_auth':{'user_name':_0x539a68['username'],'password':_0x539a68['password'],'encryption':_0x0438('0x64')},'application':_0x0438('0x65')})}});}})[_0x0438('0x22')](function(_0x205e83){if(_0x205e83&&_0x205e83[_0x0438('0x25')]!==_0x0438('0x66')&&_0x205e83['name']!==_0x0438('0x67')){return rp({'method':_0x0438('0x68'),'uri':util[_0x0438('0x5e')](_0x0438('0x5f'),_0x3f10bc,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x0438('0x62'),'response_type':_0x0438('0x62'),'rest_data':JSON[_0x0438('0x63')]({'session':_0x205e83['id'],'module_name':_0x0438('0x69')})}})[_0x0438('0x22')](function(_0x38e03a){if(_0x38e03a){var _0x2f5f63=_[_0x0438('0x6a')](_0x38e03a['module_fields']);_[_0x0438('0x6b')](_0x2f5f63,function(_0x2b0e81){return _0x42263a['includes'](_0x2b0e81[_0x0438('0x25')]);});return{'count':_0x2f5f63['length'],'rows':_['map'](_0x2f5f63,function(_0xb93e92){return{'id':_0xb93e92[_0x0438('0x25')],'name':_0xb93e92[_0x0438('0x6c')],'custom':_[_0x0438('0x6d')](_0xb93e92[_0x0438('0x25')],'_c')?!![]:![],'options':_0xb93e92[_0x0438('0x3a')]?_[_0x0438('0x28')](_[_0x0438('0x6a')](_0xb93e92['options']),function(_0x4a8c6e){return{'name':_0x4a8c6e['value'],'value':_0x4a8c6e[_0x0438('0x25')]};}):[]};})};}})[_0x0438('0x22')](respondWithResult(_0x38f6d7,null))[_0x0438('0x3d')](function(_0x657d83){var _0xae036d=_0x5affd2[_0x0438('0x2c')][_0x0438('0x6e')]?0x1f4:_0x657d83[_0x0438('0x6f')]||0x1f4;logger[_0x0438('0x70')](_0x0438('0x71'),'getFields',_0xae036d,JSON['stringify'](_0x657d83));delete _0x657d83[_0x0438('0x25')];if(_0xae036d===0x191){_0xae036d=0x190;}_0x38f6d7[_0x0438('0x17')](_0xae036d)[_0x0438('0x26')](_0x5affd2[_0x0438('0x2c')][_0x0438('0x6e')]?{'message':_0x0438('0x72'),'statusCode':_0x657d83[_0x0438('0x6f')]}:_0x657d83);});}else{var _0x1a697d=0x1f4;_0x38f6d7[_0x0438('0x17')](_0x1a697d)['send']({'message':_0x0438('0x72'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xdb63=['destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','intersection','includeAll','create','body','update','find','params'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdb63,0x18a));var _0x3db6=function(_0x54d6a6,_0x608245){_0x54d6a6=_0x54d6a6-0x0;var _0x7d3f26=_0xdb63[_0x54d6a6];return _0x7d3f26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3db6('0x0'));var zipdir=require(_0x3db6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3db6('0x2'));var moment=require(_0x3db6('0x3'));var BPromise=require(_0x3db6('0x4'));var Mustache=require(_0x3db6('0x5'));var util=require('util');var path=require(_0x3db6('0x6'));var sox=require(_0x3db6('0x7'));var csv=require(_0x3db6('0x8'));var ejs=require(_0x3db6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3db6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3db6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3db6('0x8'));var querystring=require(_0x3db6('0xc'));var Papa=require(_0x3db6('0xd'));var Redis=require(_0x3db6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3db6('0xf'));var as=require(_0x3db6('0x10'));var hardwareService=require(_0x3db6('0x11'));var logger=require('../../config/logger')(_0x3db6('0x12'));var utils=require(_0x3db6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3db6('0x14'));var db=require(_0x3db6('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x31b6d6,_0x4457e3){_0x4457e3=_0x4457e3||0xcc;return function(_0x1ed5ad){if(_0x1ed5ad){return _0x31b6d6['sendStatus'](_0x4457e3);}return _0x31b6d6[_0x3db6('0x16')](_0x4457e3)[_0x3db6('0x17')]();};}function respondWithResult(_0x23178c,_0x55cea3){_0x55cea3=_0x55cea3||0xc8;return function(_0x29aa51){if(_0x29aa51){return _0x23178c['status'](_0x55cea3)[_0x3db6('0x18')](_0x29aa51);}};}function respondWithFilteredResult(_0xbceee3,_0x3ac4d4){return function(_0x49fd79){if(_0x49fd79){var _0x7537d0=typeof _0x3ac4d4['offset']===_0x3db6('0x19')&&typeof _0x3ac4d4['limit']===_0x3db6('0x19');var _0x3ee6cc=_0x49fd79[_0x3db6('0x1a')];var _0x20de4d=_0x7537d0?0x0:_0x3ac4d4[_0x3db6('0x1b')];var _0x1df379=_0x7537d0?_0x49fd79[_0x3db6('0x1a')]:_0x3ac4d4[_0x3db6('0x1b')]+_0x3ac4d4[_0x3db6('0x1c')];var _0x47e05a;if(_0x1df379>=_0x3ee6cc){_0x1df379=_0x3ee6cc;_0x47e05a=0xc8;}else{_0x47e05a=0xce;}_0xbceee3['status'](_0x47e05a);return _0xbceee3['set'](_0x3db6('0x1d'),_0x20de4d+'-'+_0x1df379+'/'+_0x3ee6cc)['json'](_0x49fd79);}return null;};}function patchUpdates(_0xfe4622){return function(_0x36c6f2){try{jsonpatch[_0x3db6('0x1e')](_0x36c6f2,_0xfe4622,!![]);}catch(_0xd2e011){return BPromise['reject'](_0xd2e011);}return _0x36c6f2[_0x3db6('0x1f')]();};}function saveUpdates(_0xfb4143,_0x565e81){return function(_0x126997){if(_0x126997){return _0x126997['update'](_0xfb4143)[_0x3db6('0x20')](function(_0x1368d9){return _0x1368d9;});}return null;};}function removeEntity(_0x3e1a79,_0x13902a){return function(_0x38ba17){if(_0x38ba17){return _0x38ba17['destroy']()[_0x3db6('0x20')](function(){_0x3e1a79['status'](0xcc)[_0x3db6('0x17')]();});}};}function handleEntityNotFound(_0x366362,_0x53946f){return function(_0x31a169){if(!_0x31a169){_0x366362[_0x3db6('0x21')](0x194);}return _0x31a169;};}function handleError(_0x574ce0,_0x2bbd92){_0x2bbd92=_0x2bbd92||0x1f4;return function(_0x31e1b1){logger[_0x3db6('0x22')](_0x31e1b1[_0x3db6('0x23')]);if(_0x31e1b1['name']){delete _0x31e1b1[_0x3db6('0x24')];}_0x574ce0['status'](_0x2bbd92)[_0x3db6('0x25')](_0x31e1b1);};}exports[_0x3db6('0x26')]=function(_0x2c9dd0,_0x40805d){var _0x7466c5={},_0x20d896={},_0x170d42={'count':0x0,'rows':[]};var _0x64db41=_[_0x3db6('0x27')](db[_0x3db6('0x28')][_0x3db6('0x29')],function(_0x53ec42){return{'name':_0x53ec42[_0x3db6('0x2a')],'type':_0x53ec42[_0x3db6('0x2b')][_0x3db6('0x2c')]};});_0x20d896[_0x3db6('0x2d')]=_[_0x3db6('0x27')](_0x64db41,_0x3db6('0x24'));_0x20d896[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x2c9dd0['query']);_0x20d896[_0x3db6('0x30')]=_['intersection'](_0x20d896['model'],_0x20d896[_0x3db6('0x2e')]);_0x7466c5[_0x3db6('0x31')]=_['intersection'](_0x20d896[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x2c9dd0['query']['fields']));_0x7466c5[_0x3db6('0x31')]=_0x7466c5[_0x3db6('0x31')][_0x3db6('0x33')]?_0x7466c5[_0x3db6('0x31')]:_0x20d896[_0x3db6('0x2d')];if(!_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x34')](_0x3db6('0x35'))){_0x7466c5['limit']=qs[_0x3db6('0x1c')](_0x2c9dd0['query']['limit']);_0x7466c5[_0x3db6('0x1b')]=qs[_0x3db6('0x1b')](_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x1b')]);}_0x7466c5[_0x3db6('0x36')]=qs[_0x3db6('0x37')](_0x2c9dd0[_0x3db6('0x2e')]['sort']);_0x7466c5[_0x3db6('0x38')]=qs[_0x3db6('0x30')](_[_0x3db6('0x39')](_0x2c9dd0[_0x3db6('0x2e')],_0x20d896['filters']),_0x64db41);if(_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x3a')]){_0x7466c5['where']=_[_0x3db6('0x3b')](_0x7466c5[_0x3db6('0x38')],{'$or':_[_0x3db6('0x27')](_0x64db41,function(_0x4404ad){if(_0x4404ad[_0x3db6('0x2b')]!==_0x3db6('0x3c')){var _0x2724a4={};_0x2724a4[_0x4404ad[_0x3db6('0x24')]]={'$like':'%'+_0x2c9dd0[_0x3db6('0x2e')]['filter']+'%'};return _0x2724a4;}})});}_0x7466c5=_[_0x3db6('0x3b')]({},_0x7466c5,_0x2c9dd0[_0x3db6('0x3d')]);var _0x520287={'where':_0x7466c5[_0x3db6('0x38')]};return db[_0x3db6('0x28')]['count'](_0x520287)[_0x3db6('0x20')](function(_0xa27886){_0x170d42[_0x3db6('0x1a')]=_0xa27886;if(_0x2c9dd0[_0x3db6('0x2e')]['includeAll']){_0x7466c5[_0x3db6('0x3e')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x3db6('0x3f')](_0x7466c5);})['then'](function(_0x39d69f){_0x170d42[_0x3db6('0x40')]=_0x39d69f;return _0x170d42;})[_0x3db6('0x20')](respondWithFilteredResult(_0x40805d,_0x7466c5))[_0x3db6('0x41')](handleError(_0x40805d,null));};exports[_0x3db6('0x42')]=function(_0x35ec84,_0x38365){var _0xb1259c={'raw':![],'where':{'id':_0x35ec84['params']['id']}},_0x4107bb={};_0x4107bb[_0x3db6('0x2d')]=_[_0x3db6('0x2f')](db[_0x3db6('0x28')][_0x3db6('0x29')]);_0x4107bb[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x35ec84[_0x3db6('0x2e')]);_0x4107bb[_0x3db6('0x30')]=_['intersection'](_0x4107bb[_0x3db6('0x2d')],_0x4107bb[_0x3db6('0x2e')]);_0xb1259c[_0x3db6('0x31')]=_[_0x3db6('0x43')](_0x4107bb[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x35ec84[_0x3db6('0x2e')]['fields']));_0xb1259c['attributes']=_0xb1259c['attributes'][_0x3db6('0x33')]?_0xb1259c[_0x3db6('0x31')]:_0x4107bb['model'];if(_0x35ec84['query'][_0x3db6('0x44')]){_0xb1259c[_0x3db6('0x3e')]=[{'all':!![]}];}_0xb1259c=_['merge']({},_0xb1259c,_0x35ec84[_0x3db6('0x3d')]);return db[_0x3db6('0x28')]['find'](_0xb1259c)[_0x3db6('0x20')](handleEntityNotFound(_0x38365,null))[_0x3db6('0x20')](respondWithResult(_0x38365,null))[_0x3db6('0x41')](handleError(_0x38365,null));};exports[_0x3db6('0x45')]=function(_0x35fc19,_0xc603b0){return db['SugarcrmAccount'][_0x3db6('0x45')](_0x35fc19[_0x3db6('0x46')],{})[_0x3db6('0x20')](respondWithResult(_0xc603b0,0xc9))[_0x3db6('0x41')](handleError(_0xc603b0,null));};exports[_0x3db6('0x47')]=function(_0x25194b,_0x465ec9){if(_0x25194b[_0x3db6('0x46')]['id']){delete _0x25194b[_0x3db6('0x46')]['id'];}return db[_0x3db6('0x28')][_0x3db6('0x48')]({'where':{'id':_0x25194b[_0x3db6('0x49')]['id']}})['then'](handleEntityNotFound(_0x465ec9,null))[_0x3db6('0x20')](saveUpdates(_0x25194b[_0x3db6('0x46')],null))[_0x3db6('0x20')](respondWithResult(_0x465ec9,null))[_0x3db6('0x41')](handleError(_0x465ec9,null));};exports[_0x3db6('0x4a')]=function(_0x4ff4d8,_0x16ba73){return db[_0x3db6('0x28')]['find']({'where':{'id':_0x4ff4d8[_0x3db6('0x49')]['id']}})[_0x3db6('0x20')](handleEntityNotFound(_0x16ba73,null))['then'](removeEntity(_0x16ba73,null))['catch'](handleError(_0x16ba73,null));};exports[_0x3db6('0x4b')]=function(_0x239b89,_0x219f49,_0x2e70c1){var _0x401601={};var _0x7d6af7={};var _0x28c1a6;var _0x3e736a;return db['SugarcrmAccount'][_0x3db6('0x4c')]({'where':{'id':_0x239b89[_0x3db6('0x49')]['id']}})['then'](handleEntityNotFound(_0x219f49,null))[_0x3db6('0x20')](function(_0x290d75){if(_0x290d75){_0x28c1a6=_0x290d75;_0x7d6af7[_0x3db6('0x2d')]=_[_0x3db6('0x2f')](db[_0x3db6('0x4d')][_0x3db6('0x29')]);_0x7d6af7[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x239b89['query']);_0x7d6af7[_0x3db6('0x30')]=_[_0x3db6('0x43')](_0x7d6af7[_0x3db6('0x2d')],_0x7d6af7[_0x3db6('0x2e')]);_0x401601[_0x3db6('0x31')]=_['intersection'](_0x7d6af7[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x239b89['query'][_0x3db6('0x32')]));_0x401601[_0x3db6('0x31')]=_0x401601['attributes']['length']?_0x401601['attributes']:_0x7d6af7[_0x3db6('0x2d')];_0x401601[_0x3db6('0x36')]=qs[_0x3db6('0x37')](_0x239b89[_0x3db6('0x2e')][_0x3db6('0x37')]);_0x401601[_0x3db6('0x38')]=qs[_0x3db6('0x30')](_[_0x3db6('0x39')](_0x239b89[_0x3db6('0x2e')],_0x7d6af7['filters']));if(_0x239b89['query'][_0x3db6('0x3a')]){_0x401601['where']=_[_0x3db6('0x3b')](_0x401601[_0x3db6('0x38')],{'$or':_[_0x3db6('0x27')](_0x401601['attributes'],function(_0x962614){var _0x2cc3b={};_0x2cc3b[_0x962614]={'$like':'%'+_0x239b89[_0x3db6('0x2e')][_0x3db6('0x3a')]+'%'};return _0x2cc3b;})});}_0x401601=_[_0x3db6('0x3b')]({},_0x401601,_0x239b89['options']);return _0x28c1a6[_0x3db6('0x4b')](_0x401601);}})[_0x3db6('0x20')](function(_0x5b653b){if(_0x5b653b){_0x3e736a=_0x5b653b[_0x3db6('0x33')];if(!_0x239b89['query']['hasOwnProperty']('nolimit')){_0x401601[_0x3db6('0x1c')]=qs[_0x3db6('0x1c')](_0x239b89['query'][_0x3db6('0x1c')]);_0x401601[_0x3db6('0x1b')]=qs[_0x3db6('0x1b')](_0x239b89[_0x3db6('0x2e')]['offset']);}return _0x28c1a6[_0x3db6('0x4b')](_0x401601);}})['then'](function(_0x9270f6){if(_0x9270f6){return _0x9270f6?{'count':_0x3e736a,'rows':_0x9270f6}:null;}})[_0x3db6('0x20')](respondWithResult(_0x219f49,null))[_0x3db6('0x41')](handleError(_0x219f49,null));};exports[_0x3db6('0x4e')]=function(_0x16648d,_0x2fd5e3,_0x17f573){if(_0x16648d[_0x3db6('0x46')]['id']){delete _0x16648d[_0x3db6('0x46')]['id'];}return db[_0x3db6('0x28')][_0x3db6('0x4c')]({'where':{'id':_0x16648d[_0x3db6('0x49')]['id']}})[_0x3db6('0x20')](handleEntityNotFound(_0x2fd5e3,null))['then'](function(_0x341d91){if(_0x341d91){_0x16648d['body'][_0x3db6('0x4f')]=_0x341d91['id'];_0x16648d[_0x3db6('0x46')][_0x3db6('0x50')]=integrations[_0x3db6('0x51')](_0x16648d['body'][_0x3db6('0x52')],_0x16648d[_0x3db6('0x46')][_0x3db6('0x2b')]);_0x16648d['body'][_0x3db6('0x53')]=integrations['getDescriptions'](_0x16648d['body'][_0x3db6('0x52')],_0x16648d[_0x3db6('0x46')][_0x3db6('0x2b')]);return db['SugarcrmConfiguration'][_0x3db6('0x45')](_0x16648d[_0x3db6('0x46')],{'include':[{'model':db[_0x3db6('0x54')],'as':'Subjects'},{'model':db[_0x3db6('0x54')],'as':_0x3db6('0x53')}]});}return null;})[_0x3db6('0x20')](respondWithResult(_0x2fd5e3,null))[_0x3db6('0x41')](handleError(_0x2fd5e3,null));};exports[_0x3db6('0x55')]=function(_0x44f961,_0x22fd3b,_0x42a7cd){var _0x2edb59='';var _0x23c038=['id',_0x3db6('0x24'),_0x3db6('0x56'),_0x3db6('0x57'),_0x3db6('0x58'),_0x3db6('0x59'),'duration_hours',_0x3db6('0x5a'),'parent_id','parent_type','parent_name',_0x3db6('0x5b')];return db['SugarcrmAccount'][_0x3db6('0x4c')]({'where':{'id':_0x44f961[_0x3db6('0x49')]['id']},'attributes':['id',_0x3db6('0x5c'),_0x3db6('0x5d'),_0x3db6('0x5e')]})[_0x3db6('0x20')](handleEntityNotFound(_0x22fd3b,null))[_0x3db6('0x20')](function(_0x5a002e){if(_0x5a002e){_0x2edb59=_0x5a002e[_0x3db6('0x5e')];var _0x5933af=_0x2edb59['slice'](-0x1);if(_0x5933af==='/'){_0x2edb59=_0x2edb59[_0x3db6('0x5f')](0x0,_0x2edb59[_0x3db6('0x60')](_0x5933af));}return rp({'method':_0x3db6('0x61'),'uri':util[_0x3db6('0x62')](_0x3db6('0x63'),_0x2edb59,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x3db6('0x64'),'response_type':_0x3db6('0x64'),'rest_data':JSON[_0x3db6('0x65')]({'user_auth':{'user_name':_0x5a002e[_0x3db6('0x5c')],'password':_0x5a002e[_0x3db6('0x5d')],'encryption':_0x3db6('0x66')},'application':_0x3db6('0x67')})}});}})['then'](function(_0x11f4af){if(_0x11f4af&&_0x11f4af['name']!==_0x3db6('0x68')&&_0x11f4af[_0x3db6('0x24')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util['format'](_0x3db6('0x63'),_0x2edb59,_0x3db6('0x69')),'json':!![],'form':{'method':_0x3db6('0x6a'),'input_type':'JSON','response_type':_0x3db6('0x64'),'rest_data':JSON[_0x3db6('0x65')]({'session':_0x11f4af['id'],'module_name':_0x3db6('0x6b')})}})[_0x3db6('0x20')](function(_0x1ca47e){if(_0x1ca47e){var _0x2f5ec6=_[_0x3db6('0x6c')](_0x1ca47e[_0x3db6('0x6d')]);_[_0x3db6('0x6e')](_0x2f5ec6,function(_0x4f122a){return _0x23c038[_0x3db6('0x6f')](_0x4f122a['name']);});return{'count':_0x2f5ec6[_0x3db6('0x33')],'rows':_[_0x3db6('0x27')](_0x2f5ec6,function(_0x57a106){return{'id':_0x57a106['name'],'name':_0x57a106[_0x3db6('0x70')],'custom':_[_0x3db6('0x71')](_0x57a106['name'],'_c')?!![]:![],'options':_0x57a106['options']?_[_0x3db6('0x27')](_[_0x3db6('0x6c')](_0x57a106['options']),function(_0x34d15b){return{'name':_0x34d15b[_0x3db6('0x72')],'value':_0x34d15b['name']};}):[]};})};}})[_0x3db6('0x20')](respondWithResult(_0x22fd3b,null))[_0x3db6('0x41')](function(_0xde1654){var _0x4a5e9f=_0x44f961[_0x3db6('0x2e')][_0x3db6('0x73')]?0x1f4:_0xde1654['statusCode']||0x1f4;logger[_0x3db6('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x3db6('0x55'),_0x4a5e9f,JSON[_0x3db6('0x65')](_0xde1654));delete _0xde1654[_0x3db6('0x24')];if(_0x4a5e9f===0x191){_0x4a5e9f=0x190;}_0x22fd3b[_0x3db6('0x16')](_0x4a5e9f)['send'](_0x44f961['query'][_0x3db6('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0xde1654['statusCode']}:_0xde1654);});}else{var _0x3b8b0a=0x1f4;_0x22fd3b[_0x3db6('0x16')](_0x3b8b0a)['send']({'message':_0x3db6('0x74'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 35096f6..ee82f83 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 _0xd3f5=['define','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports'];(function(_0x5630d1,_0x44fb4b){var _0x32f7e2=function(_0x381337){while(--_0x381337){_0x5630d1['push'](_0x5630d1['shift']());}};_0x32f7e2(++_0x44fb4b);}(_0xd3f5,0x147));var _0x5d3f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd3f5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5d3f('0x0'));var util=require(_0x5d3f('0x1'));var logger=require('../../config/logger')(_0x5d3f('0x2'));var moment=require(_0x5d3f('0x3'));var BPromise=require(_0x5d3f('0x4'));var rp=require(_0x5d3f('0x5'));var fs=require('fs');var path=require(_0x5d3f('0x6'));var rimraf=require(_0x5d3f('0x7'));var config=require(_0x5d3f('0x8'));var attributes=require(_0x5d3f('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x5d3f('0xa')]=function(_0x4b7986,_0x2e0ad6){return _0x4b7986[_0x5d3f('0xb')]('SugarcrmAccount',attributes,{'tableName':_0x5d3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe205=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x220b8d,_0x3bb480){var _0x4e5f2d=function(_0x1b7948){while(--_0x1b7948){_0x220b8d['push'](_0x220b8d['shift']());}};_0x4e5f2d(++_0x3bb480);}(_0xe205,0xb0));var _0x5e20=function(_0x3982d0,_0x2e7634){_0x3982d0=_0x3982d0-0x0;var _0x5707d3=_0xe205[_0x3982d0];return _0x5707d3;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require('../../config/logger')(_0x5e20('0x2'));var moment=require('moment');var BPromise=require(_0x5e20('0x3'));var rp=require(_0x5e20('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e20('0x5'));var config=require(_0x5e20('0x6'));var attributes=require(_0x5e20('0x7'));var integrations=require(_0x5e20('0x8'));module[_0x5e20('0x9')]=function(_0x516d56,_0x1f1f75){return _0x516d56[_0x5e20('0xa')](_0x5e20('0xb'),attributes,{'tableName':_0x5e20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 1ca8034..2c8df98 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 _0x8ddd=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find'];(function(_0x5055f1,_0x3cbb87){var _0x28a9f0=function(_0x31433d){while(--_0x31433d){_0x5055f1['push'](_0x5055f1['shift']());}};_0x28a9f0(++_0x3cbb87);}(_0x8ddd,0xee));var _0xd8dd=function(_0x2b198d,_0x12087a){_0x2b198d=_0x2b198d-0x0;var _0x22bcc1=_0x8ddd[_0x2b198d];return _0x22bcc1;};'use strict';var _=require(_0xd8dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd8dd('0x1'));var fs=require('fs');var Redis=require(_0xd8dd('0x2'));var db=require(_0xd8dd('0x3'))['db'];var utils=require(_0xd8dd('0x4'));var logger=require(_0xd8dd('0x5'))(_0xd8dd('0x6'));var config=require(_0xd8dd('0x7'));var jayson=require(_0xd8dd('0x8'));var client=jayson[_0xd8dd('0x9')][_0xd8dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48ddef,_0x4a0bbd,_0x3ad23e){return new BPromise(function(_0x497ac0,_0x2d3ac5){return client[_0xd8dd('0xb')](_0x48ddef,_0x3ad23e)[_0xd8dd('0xc')](function(_0x4dbbd8){logger[_0xd8dd('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x4a0bbd,_0xd8dd('0xe'));logger[_0xd8dd('0xf')](_0xd8dd('0x10'),_0x4a0bbd,'request\x20sent',JSON[_0xd8dd('0x11')](_0x4dbbd8));if(_0x4dbbd8[_0xd8dd('0x12')]){if(_0x4dbbd8[_0xd8dd('0x12')]['code']===0x1f4){logger[_0xd8dd('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x4a0bbd,_0x4dbbd8[_0xd8dd('0x12')][_0xd8dd('0x13')]);return _0x2d3ac5(_0x4dbbd8[_0xd8dd('0x12')]['message']);}logger[_0xd8dd('0x12')](_0xd8dd('0x14'),_0x4a0bbd,_0x4dbbd8[_0xd8dd('0x12')][_0xd8dd('0x13')]);return _0x497ac0(_0x4dbbd8[_0xd8dd('0x12')]['message']);}else{logger[_0xd8dd('0xd')](_0xd8dd('0x14'),_0x4a0bbd,'request\x20sent');_0x497ac0(_0x4dbbd8[_0xd8dd('0x15')][_0xd8dd('0x13')]);}})['catch'](function(_0x42f502){logger[_0xd8dd('0x12')](_0xd8dd('0x14'),_0x4a0bbd,_0x42f502);_0x2d3ac5(_0x42f502);});});}exports[_0xd8dd('0x16')]=function(_0x102643){var _0x274c6e=this;return new Promise(function(_0x12f490,_0x403d1b){return db[_0xd8dd('0x17')]['findAll']({'raw':_0x102643[_0xd8dd('0x18')]?_0x102643[_0xd8dd('0x18')][_0xd8dd('0x19')]===undefined?!![]:![]:!![],'where':_0x102643[_0xd8dd('0x18')]?_0x102643[_0xd8dd('0x18')][_0xd8dd('0x1a')]||null:null,'attributes':_0x102643[_0xd8dd('0x18')]?_0x102643['options'][_0xd8dd('0x1b')]||null:null,'limit':_0x102643['options']?_0x102643[_0xd8dd('0x18')][_0xd8dd('0x1c')]||null:null,'include':_0x102643[_0xd8dd('0x18')]?_0x102643['options'][_0xd8dd('0x1d')]?_[_0xd8dd('0x1e')](_0x102643['options'][_0xd8dd('0x1d')],function(_0x409946){return{'model':db[_0x409946[_0xd8dd('0x1f')]],'as':_0x409946['as'],'attributes':_0x409946['attributes'],'include':_0x409946['include']?_[_0xd8dd('0x1e')](_0x409946['include'],function(_0x535a65){return{'model':db[_0x535a65['model']],'as':_0x535a65['as'],'attributes':_0x535a65[_0xd8dd('0x1b')],'include':_0x535a65[_0xd8dd('0x1d')]?_[_0xd8dd('0x1e')](_0x535a65[_0xd8dd('0x1d')],function(_0x3a75dd){return{'model':db[_0x3a75dd[_0xd8dd('0x1f')]],'as':_0x3a75dd['as'],'attributes':_0x3a75dd[_0xd8dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd8dd('0xc')](function(_0x311aa1){logger[_0xd8dd('0xd')](_0xd8dd('0x16'),_0x102643);logger['debug'](_0xd8dd('0x16'),_0x102643,JSON[_0xd8dd('0x11')](_0x311aa1));_0x12f490(_0x311aa1);})['catch'](function(_0x30e8b8){logger['error'](_0xd8dd('0x16'),_0x30e8b8[_0xd8dd('0x13')],_0x102643);_0x403d1b(_0x274c6e[_0xd8dd('0x12')](0x1f4,_0x30e8b8[_0xd8dd('0x13')]));});});};exports[_0xd8dd('0x20')]=function(_0x436904){var _0x5cbb89=this;return new Promise(function(_0x4b185f,_0x4a7a00){return db['SugarcrmAccount'][_0xd8dd('0x21')]({'raw':_0x436904[_0xd8dd('0x18')]?_0x436904[_0xd8dd('0x18')][_0xd8dd('0x19')]===undefined?!![]:![]:!![],'where':_0x436904[_0xd8dd('0x18')]?_0x436904[_0xd8dd('0x18')][_0xd8dd('0x1a')]||null:null,'attributes':_0x436904[_0xd8dd('0x18')]?_0x436904[_0xd8dd('0x18')][_0xd8dd('0x1b')]||null:null,'include':_0x436904[_0xd8dd('0x18')]?_0x436904[_0xd8dd('0x18')]['include']?_[_0xd8dd('0x1e')](_0x436904[_0xd8dd('0x18')][_0xd8dd('0x1d')],function(_0x48f987){return{'model':db[_0x48f987[_0xd8dd('0x1f')]],'as':_0x48f987['as'],'attributes':_0x48f987[_0xd8dd('0x1b')],'include':_0x48f987['include']?_[_0xd8dd('0x1e')](_0x48f987[_0xd8dd('0x1d')],function(_0x2ac701){return{'model':db[_0x2ac701[_0xd8dd('0x1f')]],'as':_0x2ac701['as'],'attributes':_0x2ac701[_0xd8dd('0x1b')],'include':_0x2ac701[_0xd8dd('0x1d')]?_[_0xd8dd('0x1e')](_0x2ac701[_0xd8dd('0x1d')],function(_0x544cf4){return{'model':db[_0x544cf4[_0xd8dd('0x1f')]],'as':_0x544cf4['as'],'attributes':_0x544cf4[_0xd8dd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd8dd('0xc')](function(_0x33d6b9){logger[_0xd8dd('0xd')](_0xd8dd('0x20'),_0x436904);logger[_0xd8dd('0xf')](_0xd8dd('0x20'),_0x436904,JSON[_0xd8dd('0x11')](_0x33d6b9));_0x4b185f(_0x33d6b9);})['catch'](function(_0x105c01){logger[_0xd8dd('0x12')](_0xd8dd('0x20'),_0x105c01[_0xd8dd('0x13')],_0x436904);_0x4a7a00(_0x5cbb89[_0xd8dd('0x12')](0x1f4,_0x105c01[_0xd8dd('0x13')]));});});}; \ No newline at end of file +var _0xbd4b=['bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','SugarcrmAccount','ShowSugarcrmAccount','util','moment'];(function(_0x331be0,_0x382566){var _0x4fa203=function(_0x3f8964){while(--_0x3f8964){_0x331be0['push'](_0x331be0['shift']());}};_0x4fa203(++_0x382566);}(_0xbd4b,0x169));var _0xbbd4=function(_0x15462b,_0x4fcf41){_0x15462b=_0x15462b-0x0;var _0x2295fe=_0xbd4b[_0x15462b];return _0x2295fe;};'use strict';var _=require('lodash');var util=require(_0xbbd4('0x0'));var moment=require(_0xbbd4('0x1'));var BPromise=require(_0xbbd4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbd4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbd4('0x4'))(_0xbbd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xbbd4('0x6'));var client=jayson['client'][_0xbbd4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd9e566,_0x415cee,_0x2a9e0a){return new BPromise(function(_0x37cee5,_0x39dcf2){return client[_0xbbd4('0x8')](_0xd9e566,_0x2a9e0a)[_0xbbd4('0x9')](function(_0x31d5a1){logger[_0xbbd4('0xa')](_0xbbd4('0xb'),_0x415cee,_0xbbd4('0xc'));logger[_0xbbd4('0xd')](_0xbbd4('0xe'),_0x415cee,'request\x20sent',JSON[_0xbbd4('0xf')](_0x31d5a1));if(_0x31d5a1[_0xbbd4('0x10')]){if(_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x11')]===0x1f4){logger[_0xbbd4('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x415cee,_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x39dcf2(_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x415cee,_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x37cee5(_0x31d5a1[_0xbbd4('0x10')]['message']);}else{logger[_0xbbd4('0xa')](_0xbbd4('0xb'),_0x415cee,_0xbbd4('0xc'));_0x37cee5(_0x31d5a1[_0xbbd4('0x13')]['message']);}})['catch'](function(_0x41f377){logger['error'](_0xbbd4('0xb'),_0x415cee,_0x41f377);_0x39dcf2(_0x41f377);});});}exports[_0xbbd4('0x14')]=function(_0x422270){var _0x3566f9=this;return new Promise(function(_0x7372a0,_0x1aa44f){return db['SugarcrmAccount'][_0xbbd4('0x15')]({'raw':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x17')]===undefined?!![]:![]:!![],'where':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x18')]||null:null,'attributes':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x19')]||null:null,'limit':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x1a')]||null:null,'include':_0x422270['options']?_0x422270['options']['include']?_[_0xbbd4('0x1b')](_0x422270[_0xbbd4('0x16')]['include'],function(_0x4e24c8){return{'model':db[_0x4e24c8['model']],'as':_0x4e24c8['as'],'attributes':_0x4e24c8[_0xbbd4('0x19')],'include':_0x4e24c8[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x4e24c8[_0xbbd4('0x1c')],function(_0x266da1){return{'model':db[_0x266da1[_0xbbd4('0x1d')]],'as':_0x266da1['as'],'attributes':_0x266da1['attributes'],'include':_0x266da1[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x266da1[_0xbbd4('0x1c')],function(_0x2296ae){return{'model':db[_0x2296ae[_0xbbd4('0x1d')]],'as':_0x2296ae['as'],'attributes':_0x2296ae[_0xbbd4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x9')](function(_0x3ce746){logger['info'](_0xbbd4('0x14'),_0x422270);logger[_0xbbd4('0xd')](_0xbbd4('0x14'),_0x422270,JSON['stringify'](_0x3ce746));_0x7372a0(_0x3ce746);})[_0xbbd4('0x1e')](function(_0x48111e){logger[_0xbbd4('0x10')]('GetSugarcrmAccount',_0x48111e[_0xbbd4('0x12')],_0x422270);_0x1aa44f(_0x3566f9[_0xbbd4('0x10')](0x1f4,_0x48111e[_0xbbd4('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0xb44d59){var _0x15f6ba=this;return new Promise(function(_0x19a0a7,_0xb99290){return db[_0xbbd4('0x1f')]['find']({'raw':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59['options']['raw']===undefined?!![]:![]:!![],'where':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59[_0xbbd4('0x16')][_0xbbd4('0x18')]||null:null,'attributes':_0xb44d59['options']?_0xb44d59[_0xbbd4('0x16')][_0xbbd4('0x19')]||null:null,'include':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59['options'][_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0xb44d59['options'][_0xbbd4('0x1c')],function(_0x491a53){return{'model':db[_0x491a53[_0xbbd4('0x1d')]],'as':_0x491a53['as'],'attributes':_0x491a53[_0xbbd4('0x19')],'include':_0x491a53[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x491a53[_0xbbd4('0x1c')],function(_0x1455c2){return{'model':db[_0x1455c2['model']],'as':_0x1455c2['as'],'attributes':_0x1455c2[_0xbbd4('0x19')],'include':_0x1455c2['include']?_[_0xbbd4('0x1b')](_0x1455c2[_0xbbd4('0x1c')],function(_0x8e5269){return{'model':db[_0x8e5269['model']],'as':_0x8e5269['as'],'attributes':_0x8e5269['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x9')](function(_0x13a76f){logger[_0xbbd4('0xa')]('ShowSugarcrmAccount',_0xb44d59);logger['debug'](_0xbbd4('0x20'),_0xb44d59,JSON['stringify'](_0x13a76f));_0x19a0a7(_0x13a76f);})[_0xbbd4('0x1e')](function(_0x542c87){logger[_0xbbd4('0x10')](_0xbbd4('0x20'),_0x542c87['message'],_0xb44d59);_0xb99290(_0x15f6ba[_0xbbd4('0x10')](0x1f4,_0x542c87[_0xbbd4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6950f86..ce6bba9 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 _0x9ab7=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','util','path'];(function(_0x58cbfa,_0x2bf323){var _0x5948f3=function(_0x40757d){while(--_0x40757d){_0x58cbfa['push'](_0x58cbfa['shift']());}};_0x5948f3(++_0x2bf323);}(_0x9ab7,0x106));var _0x79ab=function(_0x12d21c,_0x47da7a){_0x12d21c=_0x12d21c-0x0;var _0x3e84b7=_0x9ab7[_0x12d21c];return _0x3e84b7;};'use strict';var multer=require('multer');var util=require(_0x79ab('0x0'));var path=require(_0x79ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x79ab('0x2'));var router=express[_0x79ab('0x3')]();var fs_extra=require(_0x79ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x79ab('0x5'));var config=require(_0x79ab('0x6'));var controller=require(_0x79ab('0x7'));router[_0x79ab('0x8')]('/',auth[_0x79ab('0x9')](),controller[_0x79ab('0xa')]);router[_0x79ab('0x8')](_0x79ab('0xb'),auth[_0x79ab('0x9')](),controller[_0x79ab('0xc')]);router[_0x79ab('0x8')](_0x79ab('0xd'),auth[_0x79ab('0x9')](),controller[_0x79ab('0xe')]);router[_0x79ab('0x8')](_0x79ab('0xf'),auth[_0x79ab('0x9')](),controller[_0x79ab('0x10')]);router['get'](_0x79ab('0x11'),auth[_0x79ab('0x9')](),controller['getDescriptions']);router[_0x79ab('0x12')]('/',auth[_0x79ab('0x9')](),controller['create']);router[_0x79ab('0x13')](_0x79ab('0xb'),auth[_0x79ab('0x9')](),controller[_0x79ab('0x14')]);router[_0x79ab('0x15')](_0x79ab('0xb'),auth['isAuthenticated'](),controller[_0x79ab('0x16')]);module[_0x79ab('0x17')]=router; \ No newline at end of file +var _0x5fab=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x266dab,_0x211142){var _0x2acc69=function(_0x33c40e){while(--_0x33c40e){_0x266dab['push'](_0x266dab['shift']());}};_0x2acc69(++_0x211142);}(_0x5fab,0x16f));var _0xb5fa=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x5fab[_0x95ac8b];return _0x5b0792;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require(_0xb5fa('0x2'));var timeout=require(_0xb5fa('0x3'));var express=require(_0xb5fa('0x4'));var router=express['Router']();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb5fa('0xa')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router['get'](_0xb5fa('0xd'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xa')](_0xb5fa('0xf'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')]('/:id/descriptions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x11')]);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router['put'](_0xb5fa('0x13'),auth['isAuthenticated'](),controller[_0xb5fa('0x14')]);router[_0xb5fa('0x15')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index f9a9aa8..2780e96 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 _0xcbe0=['exports','STRING'];(function(_0x5f1e93,_0x5dcfa2){var _0x5edfea=function(_0x1c4a16){while(--_0x1c4a16){_0x5f1e93['push'](_0x5f1e93['shift']());}};_0x5edfea(++_0x5dcfa2);}(_0xcbe0,0xb8));var _0x0cbe=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xcbe0[_0x10dfdf];return _0x4d857d;};'use strict';var Sequelize=require('sequelize');module[_0x0cbe('0x0')]={'name':{'type':Sequelize[_0x0cbe('0x1')]},'description':{'type':Sequelize[_0x0cbe('0x1')]}}; \ No newline at end of file +var _0x84ab=['exports','STRING','sequelize'];(function(_0x1514b4,_0x150b75){var _0x432431=function(_0xd7f2f7){while(--_0xd7f2f7){_0x1514b4['push'](_0x1514b4['shift']());}};_0x432431(++_0x150b75);}(_0x84ab,0xdd));var _0xb84a=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x84ab[_0x57b432];return _0x2edf2a;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e9373bf..ca9cb1c 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 _0x6770=['attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','show','catch','body','params','find','getFields','findOne','SugarcrmField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x5c1538,_0x518cbd){var _0x14acf8=function(_0x1e5f78){while(--_0x1e5f78){_0x5c1538['push'](_0x5c1538['shift']());}};_0x14acf8(++_0x518cbd);}(_0x6770,0x165));var _0x0677=function(_0x3aad37,_0x598bdf){_0x3aad37=_0x3aad37-0x0;var _0x2fffec=_0x6770[_0x3aad37];return _0x2fffec;};'use strict';var emlformat=require(_0x0677('0x0'));var rimraf=require(_0x0677('0x1'));var zipdir=require(_0x0677('0x2'));var jsonpatch=require(_0x0677('0x3'));var rp=require(_0x0677('0x4'));var moment=require(_0x0677('0x5'));var BPromise=require(_0x0677('0x6'));var Mustache=require(_0x0677('0x7'));var util=require(_0x0677('0x8'));var path=require('path');var sox=require(_0x0677('0x9'));var csv=require(_0x0677('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0677('0xb'));var squel=require(_0x0677('0xc'));var crypto=require(_0x0677('0xd'));var jsforce=require(_0x0677('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0677('0xa'));var querystring=require(_0x0677('0xf'));var Papa=require(_0x0677('0x10'));var Redis=require(_0x0677('0x11'));var authService=require(_0x0677('0x12'));var qs=require(_0x0677('0x13'));var as=require(_0x0677('0x14'));var hardwareService=require(_0x0677('0x15'));var logger=require('../../config/logger')(_0x0677('0x16'));var utils=require(_0x0677('0x17'));var config=require(_0x0677('0x18'));var licenseUtil=require(_0x0677('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8a2c,_0x3af3ee){_0x3af3ee=_0x3af3ee||0xcc;return function(_0x469dfa){if(_0x469dfa){return _0x4f8a2c[_0x0677('0x1a')](_0x3af3ee);}return _0x4f8a2c['status'](_0x3af3ee)[_0x0677('0x1b')]();};}function respondWithResult(_0x1ed989,_0x4817e5){_0x4817e5=_0x4817e5||0xc8;return function(_0x2cf2df){if(_0x2cf2df){return _0x1ed989[_0x0677('0x1c')](_0x4817e5)['json'](_0x2cf2df);}};}function respondWithFilteredResult(_0x50b186,_0x16b31b){return function(_0x438c8f){if(_0x438c8f){var _0x435afd=typeof _0x16b31b[_0x0677('0x1d')]===_0x0677('0x1e')&&typeof _0x16b31b['limit']===_0x0677('0x1e');var _0x2df9b3=_0x438c8f[_0x0677('0x1f')];var _0x6c8130=_0x435afd?0x0:_0x16b31b[_0x0677('0x1d')];var _0xf14da7=_0x435afd?_0x438c8f[_0x0677('0x1f')]:_0x16b31b['offset']+_0x16b31b[_0x0677('0x20')];var _0x5925b1;if(_0xf14da7>=_0x2df9b3){_0xf14da7=_0x2df9b3;_0x5925b1=0xc8;}else{_0x5925b1=0xce;}_0x50b186[_0x0677('0x1c')](_0x5925b1);return _0x50b186[_0x0677('0x21')](_0x0677('0x22'),_0x6c8130+'-'+_0xf14da7+'/'+_0x2df9b3)[_0x0677('0x23')](_0x438c8f);}return null;};}function patchUpdates(_0x115788){return function(_0x3e0f55){try{jsonpatch['apply'](_0x3e0f55,_0x115788,!![]);}catch(_0x169218){return BPromise['reject'](_0x169218);}return _0x3e0f55[_0x0677('0x24')]();};}function saveUpdates(_0x36e300,_0x403ff6){return function(_0x31122d){if(_0x31122d){return _0x31122d[_0x0677('0x25')](_0x36e300)['then'](function(_0xd30918){return _0xd30918;});}return null;};}function removeEntity(_0x44d3b4,_0x259481){return function(_0xbb1ce7){if(_0xbb1ce7){return _0xbb1ce7[_0x0677('0x26')]()[_0x0677('0x27')](function(){_0x44d3b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1769fd,_0x383219){return function(_0x385d9e){if(!_0x385d9e){_0x1769fd[_0x0677('0x1a')](0x194);}return _0x385d9e;};}function handleError(_0x5eee99,_0x2054e7){_0x2054e7=_0x2054e7||0x1f4;return function(_0x157a48){logger['error'](_0x157a48[_0x0677('0x28')]);if(_0x157a48[_0x0677('0x29')]){delete _0x157a48[_0x0677('0x29')];}_0x5eee99['status'](_0x2054e7)[_0x0677('0x2a')](_0x157a48);};}exports[_0x0677('0x2b')]=function(_0x17c94e,_0x57eee7){var _0x2c7f5b={},_0x1caeac={},_0x3ea429={'count':0x0,'rows':[]};var _0x3c7576=_[_0x0677('0x2c')](db['SugarcrmConfiguration'][_0x0677('0x2d')],function(_0x26fdc7){return{'name':_0x26fdc7[_0x0677('0x2e')],'type':_0x26fdc7[_0x0677('0x2f')][_0x0677('0x30')]};});_0x1caeac[_0x0677('0x31')]=_[_0x0677('0x2c')](_0x3c7576,_0x0677('0x29'));_0x1caeac[_0x0677('0x32')]=_[_0x0677('0x33')](_0x17c94e['query']);_0x1caeac['filters']=_[_0x0677('0x34')](_0x1caeac[_0x0677('0x31')],_0x1caeac[_0x0677('0x32')]);_0x2c7f5b[_0x0677('0x35')]=_[_0x0677('0x34')](_0x1caeac[_0x0677('0x31')],qs[_0x0677('0x36')](_0x17c94e[_0x0677('0x32')][_0x0677('0x36')]));_0x2c7f5b[_0x0677('0x35')]=_0x2c7f5b[_0x0677('0x35')][_0x0677('0x37')]?_0x2c7f5b['attributes']:_0x1caeac[_0x0677('0x31')];if(!_0x17c94e[_0x0677('0x32')]['hasOwnProperty'](_0x0677('0x38'))){_0x2c7f5b[_0x0677('0x20')]=qs['limit'](_0x17c94e[_0x0677('0x32')][_0x0677('0x20')]);_0x2c7f5b[_0x0677('0x1d')]=qs['offset'](_0x17c94e['query'][_0x0677('0x1d')]);}_0x2c7f5b[_0x0677('0x39')]=qs[_0x0677('0x3a')](_0x17c94e['query'][_0x0677('0x3a')]);_0x2c7f5b[_0x0677('0x3b')]=qs[_0x0677('0x3c')](_['pick'](_0x17c94e[_0x0677('0x32')],_0x1caeac['filters']),_0x3c7576);if(_0x17c94e['query'][_0x0677('0x3d')]){_0x2c7f5b[_0x0677('0x3b')]=_[_0x0677('0x3e')](_0x2c7f5b[_0x0677('0x3b')],{'$or':_['map'](_0x3c7576,function(_0x4b984f){if(_0x4b984f[_0x0677('0x2f')]!==_0x0677('0x3f')){var _0xcfdb73={};_0xcfdb73[_0x4b984f[_0x0677('0x29')]]={'$like':'%'+_0x17c94e[_0x0677('0x32')][_0x0677('0x3d')]+'%'};return _0xcfdb73;}})});}_0x2c7f5b=_[_0x0677('0x3e')]({},_0x2c7f5b,_0x17c94e[_0x0677('0x40')]);var _0x4d27ee={'where':_0x2c7f5b[_0x0677('0x3b')]};return db[_0x0677('0x41')][_0x0677('0x1f')](_0x4d27ee)['then'](function(_0x4a3d58){_0x3ea429['count']=_0x4a3d58;if(_0x17c94e[_0x0677('0x32')][_0x0677('0x42')]){_0x2c7f5b[_0x0677('0x43')]=[{'all':!![]}];}return db[_0x0677('0x41')][_0x0677('0x44')](_0x2c7f5b);})[_0x0677('0x27')](function(_0x5b6456){_0x3ea429[_0x0677('0x45')]=_0x5b6456;return _0x3ea429;})[_0x0677('0x27')](respondWithFilteredResult(_0x57eee7,_0x2c7f5b))['catch'](handleError(_0x57eee7,null));};exports[_0x0677('0x46')]=function(_0x582527,_0x47e7d7){var _0x58dbab={'raw':![],'where':{'id':_0x582527['params']['id']}},_0x2beee3={};_0x2beee3[_0x0677('0x31')]=_[_0x0677('0x33')](db[_0x0677('0x41')][_0x0677('0x2d')]);_0x2beee3[_0x0677('0x32')]=_[_0x0677('0x33')](_0x582527[_0x0677('0x32')]);_0x2beee3['filters']=_[_0x0677('0x34')](_0x2beee3[_0x0677('0x31')],_0x2beee3[_0x0677('0x32')]);_0x58dbab[_0x0677('0x35')]=_['intersection'](_0x2beee3['model'],qs[_0x0677('0x36')](_0x582527[_0x0677('0x32')]['fields']));_0x58dbab[_0x0677('0x35')]=_0x58dbab[_0x0677('0x35')]['length']?_0x58dbab[_0x0677('0x35')]:_0x2beee3[_0x0677('0x31')];if(_0x582527[_0x0677('0x32')][_0x0677('0x42')]){_0x58dbab[_0x0677('0x43')]=[{'all':!![]}];}_0x58dbab=_['merge']({},_0x58dbab,_0x582527[_0x0677('0x40')]);return db[_0x0677('0x41')]['find'](_0x58dbab)['then'](handleEntityNotFound(_0x47e7d7,null))[_0x0677('0x27')](respondWithResult(_0x47e7d7,null))[_0x0677('0x47')](handleError(_0x47e7d7,null));};exports['create']=function(_0x23d3c5,_0x25bc7d){return db['SugarcrmConfiguration']['create'](_0x23d3c5['body'],{})[_0x0677('0x27')](respondWithResult(_0x25bc7d,0xc9))[_0x0677('0x47')](handleError(_0x25bc7d,null));};exports[_0x0677('0x25')]=function(_0x1c1a31,_0x1a8abf){if(_0x1c1a31[_0x0677('0x48')]['id']){delete _0x1c1a31['body']['id'];}return db[_0x0677('0x41')]['find']({'where':{'id':_0x1c1a31[_0x0677('0x49')]['id']}})[_0x0677('0x27')](handleEntityNotFound(_0x1a8abf,null))[_0x0677('0x27')](saveUpdates(_0x1c1a31['body'],null))[_0x0677('0x27')](respondWithResult(_0x1a8abf,null))[_0x0677('0x47')](handleError(_0x1a8abf,null));};exports[_0x0677('0x26')]=function(_0x33e1d4,_0x810c79){return db[_0x0677('0x41')][_0x0677('0x4a')]({'where':{'id':_0x33e1d4[_0x0677('0x49')]['id']}})[_0x0677('0x27')](handleEntityNotFound(_0x810c79,null))[_0x0677('0x27')](removeEntity(_0x810c79,null))[_0x0677('0x47')](handleError(_0x810c79,null));};exports[_0x0677('0x4b')]=function(_0x199bdd,_0x5e094a,_0x3482f9){var _0x35e21a={};var _0x38f41d={};var _0x38664f;var _0x2a0149;return db[_0x0677('0x41')][_0x0677('0x4c')]({'where':{'id':_0x199bdd['params']['id']}})[_0x0677('0x27')](handleEntityNotFound(_0x5e094a,null))['then'](function(_0xd0b99){if(_0xd0b99){_0x38664f=_0xd0b99;_0x38f41d[_0x0677('0x31')]=_['keys'](db[_0x0677('0x4d')][_0x0677('0x2d')]);_0x38f41d[_0x0677('0x32')]=_['keys'](_0x199bdd['query']);_0x38f41d[_0x0677('0x3c')]=_[_0x0677('0x34')](_0x38f41d['model'],_0x38f41d[_0x0677('0x32')]);_0x35e21a[_0x0677('0x35')]=_[_0x0677('0x34')](_0x38f41d[_0x0677('0x31')],qs[_0x0677('0x36')](_0x199bdd[_0x0677('0x32')][_0x0677('0x36')]));_0x35e21a[_0x0677('0x35')]=_0x35e21a['attributes']['length']?_0x35e21a[_0x0677('0x35')]:_0x38f41d[_0x0677('0x31')];_0x35e21a[_0x0677('0x39')]=qs['sort'](_0x199bdd[_0x0677('0x32')]['sort']);_0x35e21a[_0x0677('0x3b')]=qs['filters'](_[_0x0677('0x4e')](_0x199bdd[_0x0677('0x32')],_0x38f41d['filters']));if(_0x199bdd[_0x0677('0x32')]['filter']){_0x35e21a[_0x0677('0x3b')]=_[_0x0677('0x3e')](_0x35e21a[_0x0677('0x3b')],{'$or':_['map'](_0x35e21a[_0x0677('0x35')],function(_0x5d2a66){var _0x3d4c75={};_0x3d4c75[_0x5d2a66]={'$like':'%'+_0x199bdd['query']['filter']+'%'};return _0x3d4c75;})});}_0x35e21a=_[_0x0677('0x3e')]({},_0x35e21a,_0x199bdd['options']);return _0x38664f[_0x0677('0x4b')](_0x35e21a);}})[_0x0677('0x27')](function(_0x7bf8d6){if(_0x7bf8d6){_0x2a0149=_0x7bf8d6[_0x0677('0x37')];if(!_0x199bdd[_0x0677('0x32')][_0x0677('0x4f')](_0x0677('0x38'))){_0x35e21a[_0x0677('0x20')]=qs[_0x0677('0x20')](_0x199bdd[_0x0677('0x32')][_0x0677('0x20')]);_0x35e21a[_0x0677('0x1d')]=qs['offset'](_0x199bdd[_0x0677('0x32')][_0x0677('0x1d')]);}return _0x38664f[_0x0677('0x4b')](_0x35e21a);}})[_0x0677('0x27')](function(_0x1d0fcc){if(_0x1d0fcc){return _0x1d0fcc?{'count':_0x2a0149,'rows':_0x1d0fcc}:null;}})[_0x0677('0x27')](respondWithResult(_0x5e094a,null))[_0x0677('0x47')](handleError(_0x5e094a,null));};exports[_0x0677('0x50')]=function(_0x3e2747,_0x5385af,_0x1ba37e){var _0x511b28={};var _0x50f03d={};var _0x54806d;var _0x390776;return db[_0x0677('0x41')]['findOne']({'where':{'id':_0x3e2747['params']['id']}})['then'](handleEntityNotFound(_0x5385af,null))[_0x0677('0x27')](function(_0x3b07b9){if(_0x3b07b9){_0x54806d=_0x3b07b9;_0x50f03d[_0x0677('0x31')]=_[_0x0677('0x33')](db['SugarcrmField'][_0x0677('0x2d')]);_0x50f03d['query']=_[_0x0677('0x33')](_0x3e2747[_0x0677('0x32')]);_0x50f03d['filters']=_[_0x0677('0x34')](_0x50f03d[_0x0677('0x31')],_0x50f03d[_0x0677('0x32')]);_0x511b28[_0x0677('0x35')]=_[_0x0677('0x34')](_0x50f03d['model'],qs['fields'](_0x3e2747['query'][_0x0677('0x36')]));_0x511b28[_0x0677('0x35')]=_0x511b28[_0x0677('0x35')]['length']?_0x511b28[_0x0677('0x35')]:_0x50f03d[_0x0677('0x31')];_0x511b28[_0x0677('0x39')]=qs[_0x0677('0x3a')](_0x3e2747[_0x0677('0x32')]['sort']);_0x511b28['where']=qs[_0x0677('0x3c')](_['pick'](_0x3e2747['query'],_0x50f03d['filters']));if(_0x3e2747[_0x0677('0x32')][_0x0677('0x3d')]){_0x511b28['where']=_[_0x0677('0x3e')](_0x511b28['where'],{'$or':_[_0x0677('0x2c')](_0x511b28['attributes'],function(_0x38839f){var _0x76c5e5={};_0x76c5e5[_0x38839f]={'$like':'%'+_0x3e2747[_0x0677('0x32')][_0x0677('0x3d')]+'%'};return _0x76c5e5;})});}_0x511b28=_['merge']({},_0x511b28,_0x3e2747['options']);return _0x54806d[_0x0677('0x50')](_0x511b28);}})[_0x0677('0x27')](function(_0x5b38b9){if(_0x5b38b9){_0x390776=_0x5b38b9['length'];if(!_0x3e2747[_0x0677('0x32')][_0x0677('0x4f')](_0x0677('0x38'))){_0x511b28['limit']=qs[_0x0677('0x20')](_0x3e2747[_0x0677('0x32')][_0x0677('0x20')]);_0x511b28['offset']=qs[_0x0677('0x1d')](_0x3e2747[_0x0677('0x32')]['offset']);}return _0x54806d[_0x0677('0x50')](_0x511b28);}})[_0x0677('0x27')](function(_0x5d78f2){if(_0x5d78f2){return _0x5d78f2?{'count':_0x390776,'rows':_0x5d78f2}:null;}})[_0x0677('0x27')](respondWithResult(_0x5385af,null))['catch'](handleError(_0x5385af,null));};exports[_0x0677('0x51')]=function(_0x258dd3,_0x375441,_0xb105e8){var _0x2c3def={};var _0x186e4e={};var _0x3f861c;var _0x2c90d0;return db[_0x0677('0x41')][_0x0677('0x4c')]({'where':{'id':_0x258dd3[_0x0677('0x49')]['id']}})[_0x0677('0x27')](handleEntityNotFound(_0x375441,null))['then'](function(_0x504cd2){if(_0x504cd2){_0x3f861c=_0x504cd2;_0x186e4e['model']=_[_0x0677('0x33')](db[_0x0677('0x4d')]['rawAttributes']);_0x186e4e[_0x0677('0x32')]=_['keys'](_0x258dd3['query']);_0x186e4e[_0x0677('0x3c')]=_[_0x0677('0x34')](_0x186e4e[_0x0677('0x31')],_0x186e4e['query']);_0x2c3def[_0x0677('0x35')]=_[_0x0677('0x34')](_0x186e4e['model'],qs[_0x0677('0x36')](_0x258dd3[_0x0677('0x32')][_0x0677('0x36')]));_0x2c3def['attributes']=_0x2c3def[_0x0677('0x35')][_0x0677('0x37')]?_0x2c3def[_0x0677('0x35')]:_0x186e4e['model'];_0x2c3def[_0x0677('0x39')]=qs[_0x0677('0x3a')](_0x258dd3[_0x0677('0x32')][_0x0677('0x3a')]);_0x2c3def['where']=qs[_0x0677('0x3c')](_[_0x0677('0x4e')](_0x258dd3[_0x0677('0x32')],_0x186e4e['filters']));if(_0x258dd3[_0x0677('0x32')]['filter']){_0x2c3def[_0x0677('0x3b')]=_['merge'](_0x2c3def[_0x0677('0x3b')],{'$or':_[_0x0677('0x2c')](_0x2c3def['attributes'],function(_0x55b13a){var _0xeaead2={};_0xeaead2[_0x55b13a]={'$like':'%'+_0x258dd3[_0x0677('0x32')][_0x0677('0x3d')]+'%'};return _0xeaead2;})});}_0x2c3def=_[_0x0677('0x3e')]({},_0x2c3def,_0x258dd3[_0x0677('0x40')]);return _0x3f861c['getDescriptions'](_0x2c3def);}})[_0x0677('0x27')](function(_0x3e360d){if(_0x3e360d){_0x2c90d0=_0x3e360d[_0x0677('0x37')];if(!_0x258dd3[_0x0677('0x32')][_0x0677('0x4f')](_0x0677('0x38'))){_0x2c3def[_0x0677('0x20')]=qs['limit'](_0x258dd3[_0x0677('0x32')][_0x0677('0x20')]);_0x2c3def[_0x0677('0x1d')]=qs[_0x0677('0x1d')](_0x258dd3[_0x0677('0x32')][_0x0677('0x1d')]);}return _0x3f861c[_0x0677('0x51')](_0x2c3def);}})['then'](function(_0x209f8c){if(_0x209f8c){return _0x209f8c?{'count':_0x2c90d0,'rows':_0x209f8c}:null;}})[_0x0677('0x27')](respondWithResult(_0x375441,null))['catch'](handleError(_0x375441,null));}; \ No newline at end of file +var _0x9085=['merge','then','includeAll','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','options','hasOwnProperty','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','bluebird','util','path','sox','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','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','send','index','SugarcrmConfiguration','rawAttributes','fieldName','model','map','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9085,0x14b));var _0x5908=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0x9085[_0x3e618a];return _0x1f3d61;};'use strict';var emlformat=require(_0x5908('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5908('0x2'));var moment=require('moment');var BPromise=require(_0x5908('0x3'));var Mustache=require('mustache');var util=require(_0x5908('0x4'));var path=require(_0x5908('0x5'));var sox=require(_0x5908('0x6'));var csv=require(_0x5908('0x7'));var ejs=require(_0x5908('0x8'));var fs=require('fs');var fs_extra=require(_0x5908('0x9'));var _=require(_0x5908('0xa'));var squel=require(_0x5908('0xb'));var crypto=require('crypto');var jsforce=require(_0x5908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5908('0x7'));var querystring=require(_0x5908('0xd'));var Papa=require(_0x5908('0xe'));var Redis=require('ioredis');var authService=require(_0x5908('0xf'));var qs=require(_0x5908('0x10'));var as=require(_0x5908('0x11'));var hardwareService=require(_0x5908('0x12'));var logger=require(_0x5908('0x13'))(_0x5908('0x14'));var utils=require(_0x5908('0x15'));var config=require(_0x5908('0x16'));var licenseUtil=require(_0x5908('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ebb92,_0x86f898){_0x86f898=_0x86f898||0xcc;return function(_0x7af54d){if(_0x7af54d){return _0x1ebb92[_0x5908('0x18')](_0x86f898);}return _0x1ebb92[_0x5908('0x19')](_0x86f898)['end']();};}function respondWithResult(_0x2ec371,_0x15618b){_0x15618b=_0x15618b||0xc8;return function(_0x3ee9de){if(_0x3ee9de){return _0x2ec371[_0x5908('0x19')](_0x15618b)[_0x5908('0x1a')](_0x3ee9de);}};}function respondWithFilteredResult(_0x2508a4,_0x4bb144){return function(_0x3d732e){if(_0x3d732e){var _0x2663e2=typeof _0x4bb144[_0x5908('0x1b')]===_0x5908('0x1c')&&typeof _0x4bb144[_0x5908('0x1d')]===_0x5908('0x1c');var _0x42f381=_0x3d732e[_0x5908('0x1e')];var _0x3bae0d=_0x2663e2?0x0:_0x4bb144[_0x5908('0x1b')];var _0x5d40e8=_0x2663e2?_0x3d732e['count']:_0x4bb144[_0x5908('0x1b')]+_0x4bb144[_0x5908('0x1d')];var _0x2e08e3;if(_0x5d40e8>=_0x42f381){_0x5d40e8=_0x42f381;_0x2e08e3=0xc8;}else{_0x2e08e3=0xce;}_0x2508a4['status'](_0x2e08e3);return _0x2508a4[_0x5908('0x1f')]('Content-Range',_0x3bae0d+'-'+_0x5d40e8+'/'+_0x42f381)[_0x5908('0x1a')](_0x3d732e);}return null;};}function patchUpdates(_0x22d653){return function(_0x592d18){try{jsonpatch[_0x5908('0x20')](_0x592d18,_0x22d653,!![]);}catch(_0x10cade){return BPromise[_0x5908('0x21')](_0x10cade);}return _0x592d18[_0x5908('0x22')]();};}function saveUpdates(_0x2a98f5,_0x41f521){return function(_0x5cc4a8){if(_0x5cc4a8){return _0x5cc4a8[_0x5908('0x23')](_0x2a98f5)['then'](function(_0x2e50d4){return _0x2e50d4;});}return null;};}function removeEntity(_0x390482,_0xe2548e){return function(_0x3439e3){if(_0x3439e3){return _0x3439e3[_0x5908('0x24')]()['then'](function(){_0x390482[_0x5908('0x19')](0xcc)[_0x5908('0x25')]();});}};}function handleEntityNotFound(_0x538f67,_0x59ea8e){return function(_0x18ba88){if(!_0x18ba88){_0x538f67[_0x5908('0x18')](0x194);}return _0x18ba88;};}function handleError(_0x41aade,_0x4f2a7f){_0x4f2a7f=_0x4f2a7f||0x1f4;return function(_0x22c204){logger['error'](_0x22c204['stack']);if(_0x22c204['name']){delete _0x22c204['name'];}_0x41aade[_0x5908('0x19')](_0x4f2a7f)[_0x5908('0x26')](_0x22c204);};}exports[_0x5908('0x27')]=function(_0x552057,_0x1c2687){var _0xf7b622={},_0x3b49b1={},_0x33cdf1={'count':0x0,'rows':[]};var _0x3fad7a=_['map'](db[_0x5908('0x28')][_0x5908('0x29')],function(_0x2f1a1b){return{'name':_0x2f1a1b[_0x5908('0x2a')],'type':_0x2f1a1b['type']['key']};});_0x3b49b1[_0x5908('0x2b')]=_[_0x5908('0x2c')](_0x3fad7a,_0x5908('0x2d'));_0x3b49b1[_0x5908('0x2e')]=_['keys'](_0x552057[_0x5908('0x2e')]);_0x3b49b1[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x3b49b1['model'],_0x3b49b1[_0x5908('0x2e')]);_0xf7b622[_0x5908('0x31')]=_[_0x5908('0x30')](_0x3b49b1[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x552057[_0x5908('0x2e')][_0x5908('0x32')]));_0xf7b622[_0x5908('0x31')]=_0xf7b622[_0x5908('0x31')][_0x5908('0x33')]?_0xf7b622[_0x5908('0x31')]:_0x3b49b1[_0x5908('0x2b')];if(!_0x552057[_0x5908('0x2e')]['hasOwnProperty'](_0x5908('0x34'))){_0xf7b622[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0x552057['query']['limit']);_0xf7b622[_0x5908('0x1b')]=qs[_0x5908('0x1b')](_0x552057['query'][_0x5908('0x1b')]);}_0xf7b622[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x552057[_0x5908('0x2e')][_0x5908('0x36')]);_0xf7b622[_0x5908('0x37')]=qs[_0x5908('0x2f')](_[_0x5908('0x38')](_0x552057[_0x5908('0x2e')],_0x3b49b1[_0x5908('0x2f')]),_0x3fad7a);if(_0x552057['query'][_0x5908('0x39')]){_0xf7b622[_0x5908('0x37')]=_['merge'](_0xf7b622['where'],{'$or':_[_0x5908('0x2c')](_0x3fad7a,function(_0x5d6fb4){if(_0x5d6fb4[_0x5908('0x3a')]!=='VIRTUAL'){var _0x1411ea={};_0x1411ea[_0x5d6fb4[_0x5908('0x2d')]]={'$like':'%'+_0x552057['query'][_0x5908('0x39')]+'%'};return _0x1411ea;}})});}_0xf7b622=_[_0x5908('0x3b')]({},_0xf7b622,_0x552057['options']);var _0xa69b10={'where':_0xf7b622[_0x5908('0x37')]};return db[_0x5908('0x28')][_0x5908('0x1e')](_0xa69b10)[_0x5908('0x3c')](function(_0x487c7e){_0x33cdf1[_0x5908('0x1e')]=_0x487c7e;if(_0x552057[_0x5908('0x2e')][_0x5908('0x3d')]){_0xf7b622['include']=[{'all':!![]}];}return db[_0x5908('0x28')][_0x5908('0x3e')](_0xf7b622);})['then'](function(_0x3495e0){_0x33cdf1[_0x5908('0x3f')]=_0x3495e0;return _0x33cdf1;})['then'](respondWithFilteredResult(_0x1c2687,_0xf7b622))[_0x5908('0x40')](handleError(_0x1c2687,null));};exports[_0x5908('0x41')]=function(_0x91ad83,_0x410c08){var _0xa858a8={'raw':![],'where':{'id':_0x91ad83[_0x5908('0x42')]['id']}},_0x5656eb={};_0x5656eb[_0x5908('0x2b')]=_[_0x5908('0x43')](db[_0x5908('0x28')][_0x5908('0x29')]);_0x5656eb[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x91ad83[_0x5908('0x2e')]);_0x5656eb['filters']=_[_0x5908('0x30')](_0x5656eb[_0x5908('0x2b')],_0x5656eb[_0x5908('0x2e')]);_0xa858a8[_0x5908('0x31')]=_['intersection'](_0x5656eb[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x91ad83[_0x5908('0x2e')][_0x5908('0x32')]));_0xa858a8[_0x5908('0x31')]=_0xa858a8[_0x5908('0x31')]['length']?_0xa858a8[_0x5908('0x31')]:_0x5656eb['model'];if(_0x91ad83[_0x5908('0x2e')][_0x5908('0x3d')]){_0xa858a8['include']=[{'all':!![]}];}_0xa858a8=_['merge']({},_0xa858a8,_0x91ad83['options']);return db[_0x5908('0x28')][_0x5908('0x44')](_0xa858a8)[_0x5908('0x3c')](handleEntityNotFound(_0x410c08,null))[_0x5908('0x3c')](respondWithResult(_0x410c08,null))[_0x5908('0x40')](handleError(_0x410c08,null));};exports['create']=function(_0x53ce4f,_0x41989e){return db['SugarcrmConfiguration'][_0x5908('0x45')](_0x53ce4f[_0x5908('0x46')],{})[_0x5908('0x3c')](respondWithResult(_0x41989e,0xc9))[_0x5908('0x40')](handleError(_0x41989e,null));};exports['update']=function(_0x1554a3,_0x5afbff){if(_0x1554a3[_0x5908('0x46')]['id']){delete _0x1554a3[_0x5908('0x46')]['id'];}return db[_0x5908('0x28')]['find']({'where':{'id':_0x1554a3[_0x5908('0x42')]['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x5afbff,null))['then'](saveUpdates(_0x1554a3[_0x5908('0x46')],null))[_0x5908('0x3c')](respondWithResult(_0x5afbff,null))[_0x5908('0x40')](handleError(_0x5afbff,null));};exports[_0x5908('0x24')]=function(_0x3b5954,_0x4fa3c8){return db['SugarcrmConfiguration'][_0x5908('0x44')]({'where':{'id':_0x3b5954['params']['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x4fa3c8,null))[_0x5908('0x3c')](removeEntity(_0x4fa3c8,null))[_0x5908('0x40')](handleError(_0x4fa3c8,null));};exports[_0x5908('0x47')]=function(_0x11c0b5,_0x5b2e60,_0x46c38e){var _0x429c90={};var _0x3df86d={};var _0x36d4e5;var _0x42d751;return db['SugarcrmConfiguration'][_0x5908('0x48')]({'where':{'id':_0x11c0b5[_0x5908('0x42')]['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x5b2e60,null))[_0x5908('0x3c')](function(_0x197d16){if(_0x197d16){_0x36d4e5=_0x197d16;_0x3df86d[_0x5908('0x2b')]=_[_0x5908('0x43')](db['SugarcrmField'][_0x5908('0x29')]);_0x3df86d[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x11c0b5[_0x5908('0x2e')]);_0x3df86d[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x3df86d[_0x5908('0x2b')],_0x3df86d['query']);_0x429c90['attributes']=_[_0x5908('0x30')](_0x3df86d[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x32')]));_0x429c90[_0x5908('0x31')]=_0x429c90[_0x5908('0x31')][_0x5908('0x33')]?_0x429c90['attributes']:_0x3df86d['model'];_0x429c90[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x36')]);_0x429c90['where']=qs[_0x5908('0x2f')](_[_0x5908('0x38')](_0x11c0b5[_0x5908('0x2e')],_0x3df86d[_0x5908('0x2f')]));if(_0x11c0b5[_0x5908('0x2e')][_0x5908('0x39')]){_0x429c90[_0x5908('0x37')]=_[_0x5908('0x3b')](_0x429c90[_0x5908('0x37')],{'$or':_['map'](_0x429c90[_0x5908('0x31')],function(_0x4fb99b){var _0x510275={};_0x510275[_0x4fb99b]={'$like':'%'+_0x11c0b5[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x510275;})});}_0x429c90=_[_0x5908('0x3b')]({},_0x429c90,_0x11c0b5[_0x5908('0x49')]);return _0x36d4e5[_0x5908('0x47')](_0x429c90);}})[_0x5908('0x3c')](function(_0x52c68a){if(_0x52c68a){_0x42d751=_0x52c68a[_0x5908('0x33')];if(!_0x11c0b5[_0x5908('0x2e')][_0x5908('0x4a')](_0x5908('0x34'))){_0x429c90[_0x5908('0x1d')]=qs['limit'](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x1d')]);_0x429c90[_0x5908('0x1b')]=qs['offset'](_0x11c0b5['query'][_0x5908('0x1b')]);}return _0x36d4e5[_0x5908('0x47')](_0x429c90);}})[_0x5908('0x3c')](function(_0x1a758c){if(_0x1a758c){return _0x1a758c?{'count':_0x42d751,'rows':_0x1a758c}:null;}})[_0x5908('0x3c')](respondWithResult(_0x5b2e60,null))[_0x5908('0x40')](handleError(_0x5b2e60,null));};exports['getSubjects']=function(_0xb80f15,_0x19e135,_0x1156d1){var _0x185b06={};var _0x20f963={};var _0x3515c8;var _0x19d813;return db[_0x5908('0x28')][_0x5908('0x48')]({'where':{'id':_0xb80f15['params']['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x19e135,null))['then'](function(_0xd21ce7){if(_0xd21ce7){_0x3515c8=_0xd21ce7;_0x20f963['model']=_[_0x5908('0x43')](db[_0x5908('0x4b')][_0x5908('0x29')]);_0x20f963[_0x5908('0x2e')]=_[_0x5908('0x43')](_0xb80f15['query']);_0x20f963[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x20f963[_0x5908('0x2b')],_0x20f963[_0x5908('0x2e')]);_0x185b06[_0x5908('0x31')]=_['intersection'](_0x20f963['model'],qs[_0x5908('0x32')](_0xb80f15[_0x5908('0x2e')][_0x5908('0x32')]));_0x185b06[_0x5908('0x31')]=_0x185b06[_0x5908('0x31')][_0x5908('0x33')]?_0x185b06[_0x5908('0x31')]:_0x20f963[_0x5908('0x2b')];_0x185b06[_0x5908('0x35')]=qs[_0x5908('0x36')](_0xb80f15['query'][_0x5908('0x36')]);_0x185b06[_0x5908('0x37')]=qs['filters'](_[_0x5908('0x38')](_0xb80f15[_0x5908('0x2e')],_0x20f963['filters']));if(_0xb80f15[_0x5908('0x2e')][_0x5908('0x39')]){_0x185b06[_0x5908('0x37')]=_['merge'](_0x185b06[_0x5908('0x37')],{'$or':_[_0x5908('0x2c')](_0x185b06[_0x5908('0x31')],function(_0x11b370){var _0x2c9b0e={};_0x2c9b0e[_0x11b370]={'$like':'%'+_0xb80f15[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x2c9b0e;})});}_0x185b06=_[_0x5908('0x3b')]({},_0x185b06,_0xb80f15[_0x5908('0x49')]);return _0x3515c8[_0x5908('0x4c')](_0x185b06);}})[_0x5908('0x3c')](function(_0x3cc1c0){if(_0x3cc1c0){_0x19d813=_0x3cc1c0[_0x5908('0x33')];if(!_0xb80f15[_0x5908('0x2e')][_0x5908('0x4a')](_0x5908('0x34'))){_0x185b06[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0xb80f15[_0x5908('0x2e')][_0x5908('0x1d')]);_0x185b06[_0x5908('0x1b')]=qs['offset'](_0xb80f15[_0x5908('0x2e')]['offset']);}return _0x3515c8['getSubjects'](_0x185b06);}})[_0x5908('0x3c')](function(_0x1dd155){if(_0x1dd155){return _0x1dd155?{'count':_0x19d813,'rows':_0x1dd155}:null;}})[_0x5908('0x3c')](respondWithResult(_0x19e135,null))['catch'](handleError(_0x19e135,null));};exports[_0x5908('0x4d')]=function(_0x4ee517,_0x5e2ade,_0x3cfa3c){var _0x1b1612={};var _0x835636={};var _0x4353b1;var _0xf2ed5;return db[_0x5908('0x28')]['findOne']({'where':{'id':_0x4ee517['params']['id']}})['then'](handleEntityNotFound(_0x5e2ade,null))[_0x5908('0x3c')](function(_0x15f13c){if(_0x15f13c){_0x4353b1=_0x15f13c;_0x835636[_0x5908('0x2b')]=_['keys'](db[_0x5908('0x4b')]['rawAttributes']);_0x835636[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x4ee517[_0x5908('0x2e')]);_0x835636[_0x5908('0x2f')]=_['intersection'](_0x835636[_0x5908('0x2b')],_0x835636[_0x5908('0x2e')]);_0x1b1612[_0x5908('0x31')]=_[_0x5908('0x30')](_0x835636[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x4ee517[_0x5908('0x2e')]['fields']));_0x1b1612[_0x5908('0x31')]=_0x1b1612[_0x5908('0x31')][_0x5908('0x33')]?_0x1b1612[_0x5908('0x31')]:_0x835636[_0x5908('0x2b')];_0x1b1612[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x4ee517[_0x5908('0x2e')][_0x5908('0x36')]);_0x1b1612[_0x5908('0x37')]=qs[_0x5908('0x2f')](_['pick'](_0x4ee517[_0x5908('0x2e')],_0x835636[_0x5908('0x2f')]));if(_0x4ee517[_0x5908('0x2e')][_0x5908('0x39')]){_0x1b1612[_0x5908('0x37')]=_['merge'](_0x1b1612[_0x5908('0x37')],{'$or':_[_0x5908('0x2c')](_0x1b1612[_0x5908('0x31')],function(_0x4c1133){var _0x65b770={};_0x65b770[_0x4c1133]={'$like':'%'+_0x4ee517[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x65b770;})});}_0x1b1612=_[_0x5908('0x3b')]({},_0x1b1612,_0x4ee517[_0x5908('0x49')]);return _0x4353b1[_0x5908('0x4d')](_0x1b1612);}})[_0x5908('0x3c')](function(_0x462a1b){if(_0x462a1b){_0xf2ed5=_0x462a1b['length'];if(!_0x4ee517['query'][_0x5908('0x4a')](_0x5908('0x34'))){_0x1b1612[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0x4ee517['query']['limit']);_0x1b1612[_0x5908('0x1b')]=qs[_0x5908('0x1b')](_0x4ee517['query'][_0x5908('0x1b')]);}return _0x4353b1[_0x5908('0x4d')](_0x1b1612);}})['then'](function(_0x394e2b){if(_0x394e2b){return _0x394e2b?{'count':_0xf2ed5,'rows':_0x394e2b}:null;}})[_0x5908('0x3c')](respondWithResult(_0x5e2ade,null))[_0x5908('0x40')](handleError(_0x5e2ade,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 645bf86..d84eed7 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 _0xea84=['./intSugarcrmConfiguration.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xea84,0x10b));var _0x4ea8=function(_0x3fd853,_0x48de0a){_0x3fd853=_0x3fd853-0x0;var _0x45706a=_0xea84[_0x3fd853];return _0x45706a;};'use strict';var _=require(_0x4ea8('0x0'));var util=require(_0x4ea8('0x1'));var logger=require('../../config/logger')(_0x4ea8('0x2'));var moment=require(_0x4ea8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ea8('0x4'));var fs=require('fs');var path=require(_0x4ea8('0x5'));var rimraf=require(_0x4ea8('0x6'));var config=require(_0x4ea8('0x7'));var attributes=require(_0x4ea8('0x8'));module[_0x4ea8('0x9')]=function(_0x28031b,_0x433eff){return _0x28031b[_0x4ea8('0xa')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd77=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api'];(function(_0x50bfd8,_0x5af783){var _0x424ca1=function(_0x52c67b){while(--_0x52c67b){_0x50bfd8['push'](_0x50bfd8['shift']());}};_0x424ca1(++_0x5af783);}(_0xcd77,0xf4));var _0x7cd7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcd77[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7cd7('0x0'));var util=require('util');var logger=require(_0x7cd7('0x1'))(_0x7cd7('0x2'));var moment=require(_0x7cd7('0x3'));var BPromise=require(_0x7cd7('0x4'));var rp=require(_0x7cd7('0x5'));var fs=require('fs');var path=require(_0x7cd7('0x6'));var rimraf=require(_0x7cd7('0x7'));var config=require(_0x7cd7('0x8'));var attributes=require(_0x7cd7('0x9'));module['exports']=function(_0x2b5e36,_0x3422c3){return _0x2b5e36[_0x7cd7('0xa')](_0x7cd7('0xb'),attributes,{'tableName':_0x7cd7('0xc'),'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 07e5f01..86c324b 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 _0x8433=['lodash','util','moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x6b12d9,_0x300bbb){var _0x35df52=function(_0x49696b){while(--_0x49696b){_0x6b12d9['push'](_0x6b12d9['shift']());}};_0x35df52(++_0x300bbb);}(_0x8433,0x143));var _0x3843=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x8433[_0x439d59];return _0x3670c7;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var moment=require(_0x3843('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3843('0x3'))(_0x3843('0x4'));var config=require(_0x3843('0x5'));var jayson=require(_0x3843('0x6'));var client=jayson[_0x3843('0x7')][_0x3843('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42c871,_0x30c842,_0x4f9178){return new BPromise(function(_0x5c0de8,_0x1101e3){return client[_0x3843('0x9')](_0x42c871,_0x4f9178)['then'](function(_0x5369b2){logger[_0x3843('0xa')](_0x3843('0xb'),_0x30c842,_0x3843('0xc'));logger[_0x3843('0xd')](_0x3843('0xe'),_0x30c842,_0x3843('0xc'),JSON['stringify'](_0x5369b2));if(_0x5369b2[_0x3843('0xf')]){if(_0x5369b2[_0x3843('0xf')][_0x3843('0x10')]===0x1f4){logger[_0x3843('0xf')](_0x3843('0xb'),_0x30c842,_0x5369b2[_0x3843('0xf')][_0x3843('0x11')]);return _0x1101e3(_0x5369b2['error'][_0x3843('0x11')]);}logger[_0x3843('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x30c842,_0x5369b2[_0x3843('0xf')]['message']);return _0x5c0de8(_0x5369b2[_0x3843('0xf')][_0x3843('0x11')]);}else{logger[_0x3843('0xa')](_0x3843('0xb'),_0x30c842,_0x3843('0xc'));_0x5c0de8(_0x5369b2['result'][_0x3843('0x11')]);}})[_0x3843('0x12')](function(_0x1f5a90){logger[_0x3843('0xf')](_0x3843('0xb'),_0x30c842,_0x1f5a90);_0x1101e3(_0x1f5a90);});});} \ No newline at end of file +var _0x7a4f=['http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x59080e,_0x2c3518){var _0x4f86a9=function(_0x43784a){while(--_0x43784a){_0x59080e['push'](_0x59080e['shift']());}};_0x4f86a9(++_0x2c3518);}(_0x7a4f,0x6e));var _0xf7a4=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x7a4f[_0x46b22a];return _0x44c2e8;};'use strict';var _=require(_0xf7a4('0x0'));var util=require(_0xf7a4('0x1'));var moment=require(_0xf7a4('0x2'));var BPromise=require(_0xf7a4('0x3'));var rs=require(_0xf7a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a4('0x5'))['db'];var utils=require(_0xf7a4('0x6'));var logger=require(_0xf7a4('0x7'))(_0xf7a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7a4('0x9')][_0xf7a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38ef6a,_0x348edc,_0x7fb76){return new BPromise(function(_0x3df6bb,_0x59e3b4){return client[_0xf7a4('0xb')](_0x38ef6a,_0x7fb76)[_0xf7a4('0xc')](function(_0x1d2954){logger[_0xf7a4('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0xf7a4('0xe'));logger[_0xf7a4('0xf')](_0xf7a4('0x10'),_0x348edc,'request\x20sent',JSON[_0xf7a4('0x11')](_0x1d2954));if(_0x1d2954[_0xf7a4('0x12')]){if(_0x1d2954[_0xf7a4('0x12')][_0xf7a4('0x13')]===0x1f4){logger[_0xf7a4('0x12')](_0xf7a4('0x14'),_0x348edc,_0x1d2954['error'][_0xf7a4('0x15')]);return _0x59e3b4(_0x1d2954[_0xf7a4('0x12')]['message']);}logger[_0xf7a4('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0x1d2954[_0xf7a4('0x12')][_0xf7a4('0x15')]);return _0x3df6bb(_0x1d2954['error'][_0xf7a4('0x15')]);}else{logger[_0xf7a4('0xd')](_0xf7a4('0x14'),_0x348edc,_0xf7a4('0xe'));_0x3df6bb(_0x1d2954[_0xf7a4('0x16')][_0xf7a4('0x15')]);}})[_0xf7a4('0x17')](function(_0x489ac1){logger[_0xf7a4('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0x489ac1);_0x59e3b4(_0x489ac1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 676d111..fa16a81 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 _0x677c=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index'];(function(_0xb0c152,_0x1d37a9){var _0x2fc458=function(_0x3d0fd8){while(--_0x3d0fd8){_0xb0c152['push'](_0xb0c152['shift']());}};_0x2fc458(++_0x1d37a9);}(_0x677c,0x15d));var _0xc677=function(_0xe5c81d,_0x2e46f9){_0xe5c81d=_0xe5c81d-0x0;var _0x5a0ea8=_0x677c[_0xe5c81d];return _0x5a0ea8;};'use strict';var multer=require(_0xc677('0x0'));var util=require('util');var path=require(_0xc677('0x1'));var timeout=require(_0xc677('0x2'));var express=require(_0xc677('0x3'));var router=express['Router']();var fs_extra=require(_0xc677('0x4'));var auth=require(_0xc677('0x5'));var interaction=require(_0xc677('0x6'));var config=require(_0xc677('0x7'));var controller=require(_0xc677('0x8'));router['get']('/',auth[_0xc677('0x9')](),controller[_0xc677('0xa')]);router['get'](_0xc677('0xb'),auth[_0xc677('0x9')](),controller['show']);router[_0xc677('0xc')]('/',auth[_0xc677('0x9')](),controller[_0xc677('0xd')]);router['put'](_0xc677('0xb'),auth[_0xc677('0x9')](),controller[_0xc677('0xe')]);router[_0xc677('0xf')](_0xc677('0xb'),auth['isAuthenticated'](),controller[_0xc677('0x10')]);module[_0xc677('0x11')]=router; \ No newline at end of file +var _0x6b0e=['get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller'];(function(_0x14a8d5,_0x17b15c){var _0x3a7c52=function(_0x2c1ec7){while(--_0x2c1ec7){_0x14a8d5['push'](_0x14a8d5['shift']());}};_0x3a7c52(++_0x17b15c);}(_0x6b0e,0x1b4));var _0xe6b0=function(_0x4a624b,_0x21544a){_0x4a624b=_0x4a624b-0x0;var _0x156cba=_0x6b0e[_0x4a624b];return _0x156cba;};'use strict';var multer=require('multer');var util=require(_0xe6b0('0x0'));var path=require(_0xe6b0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe6b0('0x2')]();var fs_extra=require(_0xe6b0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe6b0('0x4'));var config=require('../../config/environment');var controller=require(_0xe6b0('0x5'));router[_0xe6b0('0x6')]('/',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0x8')]);router['get']('/:id',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0x9')]);router[_0xe6b0('0xa')]('/',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0xb')]);router['put'](_0xe6b0('0xc'),auth[_0xe6b0('0x7')](),controller[_0xe6b0('0xd')]);router[_0xe6b0('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe6b0('0xf')]);module[_0xe6b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 1bd1486..7c894f8 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 _0x4106=['string','STRING','variable','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x3cfb74,_0x1f2c6a){var _0x1275b8=function(_0x471edd){while(--_0x471edd){_0x3cfb74['push'](_0x3cfb74['shift']());}};_0x1275b8(++_0x1f2c6a);}(_0x4106,0x6b));var _0x6410=function(_0x32bef4,_0x45a0d7){_0x32bef4=_0x32bef4-0x0;var _0x204aef=_0x4106[_0x32bef4];return _0x204aef;};'use strict';var Sequelize=require(_0x6410('0x0'));module[_0x6410('0x1')]={'type':{'type':Sequelize[_0x6410('0x2')]('string','variable',_0x6410('0x3'),'keyValue',_0x6410('0x4')),'defaultValue':_0x6410('0x5')},'content':{'type':Sequelize[_0x6410('0x6')]},'key':{'type':Sequelize[_0x6410('0x6')]},'keyType':{'type':Sequelize[_0x6410('0x2')](_0x6410('0x5'),_0x6410('0x7'),_0x6410('0x3'))},'keyContent':{'type':Sequelize[_0x6410('0x6')]},'idField':{'type':Sequelize[_0x6410('0x6')]},'nameField':{'type':Sequelize[_0x6410('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6410('0x6')]}}; \ No newline at end of file +var _0x1c0c=['string','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1c0c,0xa1));var _0xc1c0=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1c0c[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0xc1c0('0x0')]={'type':{'type':Sequelize[_0xc1c0('0x1')]('string',_0xc1c0('0x2'),_0xc1c0('0x3'),_0xc1c0('0x4'),_0xc1c0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc1c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc1c0('0x7'),_0xc1c0('0x2'),_0xc1c0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc1c0('0x6')]},'nameField':{'type':Sequelize[_0xc1c0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc1c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 013912f..66db04c 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 _0xb0f0=['fields','attributes','length','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','SugarcrmField','key','model','query','keys','filters','intersection'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb0f0,0x138));var _0x0b0f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb0f0[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b0f('0x0'));var zipdir=require(_0x0b0f('0x1'));var jsonpatch=require(_0x0b0f('0x2'));var rp=require(_0x0b0f('0x3'));var moment=require(_0x0b0f('0x4'));var BPromise=require(_0x0b0f('0x5'));var Mustache=require(_0x0b0f('0x6'));var util=require(_0x0b0f('0x7'));var path=require('path');var sox=require(_0x0b0f('0x8'));var csv=require(_0x0b0f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b0f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0b0f('0xb'));var jsforce=require(_0x0b0f('0xc'));var deskjs=require(_0x0b0f('0xd'));var toCsv=require(_0x0b0f('0x9'));var querystring=require(_0x0b0f('0xe'));var Papa=require(_0x0b0f('0xf'));var Redis=require(_0x0b0f('0x10'));var authService=require(_0x0b0f('0x11'));var qs=require(_0x0b0f('0x12'));var as=require(_0x0b0f('0x13'));var hardwareService=require(_0x0b0f('0x14'));var logger=require(_0x0b0f('0x15'))(_0x0b0f('0x16'));var utils=require(_0x0b0f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0b0f('0x18'))['db'];function respondWithStatusCode(_0x52a156,_0x4e903c){_0x4e903c=_0x4e903c||0xcc;return function(_0xf6dc90){if(_0xf6dc90){return _0x52a156[_0x0b0f('0x19')](_0x4e903c);}return _0x52a156[_0x0b0f('0x1a')](_0x4e903c)[_0x0b0f('0x1b')]();};}function respondWithResult(_0x1543ec,_0x54aa4b){_0x54aa4b=_0x54aa4b||0xc8;return function(_0x294ff2){if(_0x294ff2){return _0x1543ec[_0x0b0f('0x1a')](_0x54aa4b)[_0x0b0f('0x1c')](_0x294ff2);}};}function respondWithFilteredResult(_0xec48d4,_0x5100d4){return function(_0x405e6b){if(_0x405e6b){var _0x4ce610=typeof _0x5100d4[_0x0b0f('0x1d')]===_0x0b0f('0x1e')&&typeof _0x5100d4[_0x0b0f('0x1f')]==='undefined';var _0x2bb972=_0x405e6b[_0x0b0f('0x20')];var _0x137565=_0x4ce610?0x0:_0x5100d4[_0x0b0f('0x1d')];var _0x23a420=_0x4ce610?_0x405e6b['count']:_0x5100d4['offset']+_0x5100d4['limit'];var _0x422415;if(_0x23a420>=_0x2bb972){_0x23a420=_0x2bb972;_0x422415=0xc8;}else{_0x422415=0xce;}_0xec48d4[_0x0b0f('0x1a')](_0x422415);return _0xec48d4[_0x0b0f('0x21')](_0x0b0f('0x22'),_0x137565+'-'+_0x23a420+'/'+_0x2bb972)[_0x0b0f('0x1c')](_0x405e6b);}return null;};}function patchUpdates(_0x18da76){return function(_0x4b90b3){try{jsonpatch[_0x0b0f('0x23')](_0x4b90b3,_0x18da76,!![]);}catch(_0x1ea62e){return BPromise[_0x0b0f('0x24')](_0x1ea62e);}return _0x4b90b3[_0x0b0f('0x25')]();};}function saveUpdates(_0x4fadd6,_0x463ef2){return function(_0x7c1f0e){if(_0x7c1f0e){return _0x7c1f0e[_0x0b0f('0x26')](_0x4fadd6)['then'](function(_0x140a14){return _0x140a14;});}return null;};}function removeEntity(_0x53dc3a,_0x2b0a03){return function(_0x287ae2){if(_0x287ae2){return _0x287ae2[_0x0b0f('0x27')]()[_0x0b0f('0x28')](function(){_0x53dc3a[_0x0b0f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a634,_0xd90b1a){return function(_0x43c1bf){if(!_0x43c1bf){_0x26a634[_0x0b0f('0x19')](0x194);}return _0x43c1bf;};}function handleError(_0x3983de,_0x23a99a){_0x23a99a=_0x23a99a||0x1f4;return function(_0x1aeabc){logger[_0x0b0f('0x29')](_0x1aeabc[_0x0b0f('0x2a')]);if(_0x1aeabc[_0x0b0f('0x2b')]){delete _0x1aeabc[_0x0b0f('0x2b')];}_0x3983de['status'](_0x23a99a)['send'](_0x1aeabc);};}exports[_0x0b0f('0x2c')]=function(_0x162a60,_0x2e41b6){var _0x335dfb={},_0x1ca824={},_0x4914e6={'count':0x0,'rows':[]};var _0x149b5e=_[_0x0b0f('0x2d')](db[_0x0b0f('0x2e')]['rawAttributes'],function(_0x34788a){return{'name':_0x34788a['fieldName'],'type':_0x34788a['type'][_0x0b0f('0x2f')]};});_0x1ca824[_0x0b0f('0x30')]=_[_0x0b0f('0x2d')](_0x149b5e,_0x0b0f('0x2b'));_0x1ca824[_0x0b0f('0x31')]=_[_0x0b0f('0x32')](_0x162a60[_0x0b0f('0x31')]);_0x1ca824[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x1ca824['model'],_0x1ca824['query']);_0x335dfb['attributes']=_[_0x0b0f('0x34')](_0x1ca824[_0x0b0f('0x30')],qs[_0x0b0f('0x35')](_0x162a60[_0x0b0f('0x31')][_0x0b0f('0x35')]));_0x335dfb[_0x0b0f('0x36')]=_0x335dfb[_0x0b0f('0x36')][_0x0b0f('0x37')]?_0x335dfb['attributes']:_0x1ca824['model'];if(!_0x162a60['query']['hasOwnProperty'](_0x0b0f('0x38'))){_0x335dfb[_0x0b0f('0x1f')]=qs[_0x0b0f('0x1f')](_0x162a60[_0x0b0f('0x31')][_0x0b0f('0x1f')]);_0x335dfb[_0x0b0f('0x1d')]=qs[_0x0b0f('0x1d')](_0x162a60[_0x0b0f('0x31')]['offset']);}_0x335dfb[_0x0b0f('0x39')]=qs[_0x0b0f('0x3a')](_0x162a60['query'][_0x0b0f('0x3a')]);_0x335dfb[_0x0b0f('0x3b')]=qs[_0x0b0f('0x33')](_[_0x0b0f('0x3c')](_0x162a60[_0x0b0f('0x31')],_0x1ca824[_0x0b0f('0x33')]),_0x149b5e);if(_0x162a60[_0x0b0f('0x31')][_0x0b0f('0x3d')]){_0x335dfb['where']=_['merge'](_0x335dfb[_0x0b0f('0x3b')],{'$or':_[_0x0b0f('0x2d')](_0x149b5e,function(_0x1490a2){if(_0x1490a2[_0x0b0f('0x3e')]!=='VIRTUAL'){var _0x5f2240={};_0x5f2240[_0x1490a2[_0x0b0f('0x2b')]]={'$like':'%'+_0x162a60[_0x0b0f('0x31')]['filter']+'%'};return _0x5f2240;}})});}_0x335dfb=_['merge']({},_0x335dfb,_0x162a60[_0x0b0f('0x3f')]);var _0x42d329={'where':_0x335dfb[_0x0b0f('0x3b')]};return db['SugarcrmField'][_0x0b0f('0x20')](_0x42d329)[_0x0b0f('0x28')](function(_0x416e2f){_0x4914e6['count']=_0x416e2f;if(_0x162a60[_0x0b0f('0x31')][_0x0b0f('0x40')]){_0x335dfb[_0x0b0f('0x41')]=[{'all':!![]}];}return db[_0x0b0f('0x2e')]['findAll'](_0x335dfb);})[_0x0b0f('0x28')](function(_0x544006){_0x4914e6[_0x0b0f('0x42')]=_0x544006;return _0x4914e6;})[_0x0b0f('0x28')](respondWithFilteredResult(_0x2e41b6,_0x335dfb))['catch'](handleError(_0x2e41b6,null));};exports[_0x0b0f('0x43')]=function(_0x193a4b,_0x105faf){var _0x366f0b={'raw':!![],'where':{'id':_0x193a4b['params']['id']}},_0x483f43={};_0x483f43[_0x0b0f('0x30')]=_[_0x0b0f('0x32')](db[_0x0b0f('0x2e')]['rawAttributes']);_0x483f43[_0x0b0f('0x31')]=_['keys'](_0x193a4b['query']);_0x483f43[_0x0b0f('0x33')]=_[_0x0b0f('0x34')](_0x483f43['model'],_0x483f43[_0x0b0f('0x31')]);_0x366f0b[_0x0b0f('0x36')]=_['intersection'](_0x483f43[_0x0b0f('0x30')],qs[_0x0b0f('0x35')](_0x193a4b[_0x0b0f('0x31')][_0x0b0f('0x35')]));_0x366f0b[_0x0b0f('0x36')]=_0x366f0b[_0x0b0f('0x36')][_0x0b0f('0x37')]?_0x366f0b[_0x0b0f('0x36')]:_0x483f43[_0x0b0f('0x30')];if(_0x193a4b[_0x0b0f('0x31')][_0x0b0f('0x40')]){_0x366f0b[_0x0b0f('0x41')]=[{'all':!![]}];}_0x366f0b=_['merge']({},_0x366f0b,_0x193a4b['options']);return db[_0x0b0f('0x2e')][_0x0b0f('0x44')](_0x366f0b)[_0x0b0f('0x28')](handleEntityNotFound(_0x105faf,null))[_0x0b0f('0x28')](respondWithResult(_0x105faf,null))[_0x0b0f('0x45')](handleError(_0x105faf,null));};exports[_0x0b0f('0x46')]=function(_0x34c64c,_0x1fe04f){return db[_0x0b0f('0x2e')][_0x0b0f('0x46')](_0x34c64c['body'],{})[_0x0b0f('0x28')](respondWithResult(_0x1fe04f,0xc9))[_0x0b0f('0x45')](handleError(_0x1fe04f,null));};exports[_0x0b0f('0x26')]=function(_0x3842d8,_0x11dc2b){if(_0x3842d8['body']['id']){delete _0x3842d8[_0x0b0f('0x47')]['id'];}return db[_0x0b0f('0x2e')][_0x0b0f('0x44')]({'where':{'id':_0x3842d8['params']['id']}})['then'](handleEntityNotFound(_0x11dc2b,null))[_0x0b0f('0x28')](saveUpdates(_0x3842d8[_0x0b0f('0x47')],null))['then'](respondWithResult(_0x11dc2b,null))[_0x0b0f('0x45')](handleError(_0x11dc2b,null));};exports['destroy']=function(_0x5c3545,_0x4ecb36){return db[_0x0b0f('0x2e')][_0x0b0f('0x44')]({'where':{'id':_0x5c3545[_0x0b0f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ecb36,null))[_0x0b0f('0x28')](removeEntity(_0x4ecb36,null))['catch'](handleError(_0x4ecb36,null));}; \ No newline at end of file +var _0xc15e=['update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','stack','name','index','SugarcrmField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body'];(function(_0x4a0879,_0xce40c){var _0x35f33e=function(_0x31280e){while(--_0x31280e){_0x4a0879['push'](_0x4a0879['shift']());}};_0x35f33e(++_0xce40c);}(_0xc15e,0x178));var _0xec15=function(_0x2ef40b,_0x118719){_0x2ef40b=_0x2ef40b-0x0;var _0x3be817=_0xc15e[_0x2ef40b];return _0x3be817;};'use strict';var emlformat=require(_0xec15('0x0'));var rimraf=require(_0xec15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec15('0x2'));var rp=require('request-promise');var moment=require(_0xec15('0x3'));var BPromise=require(_0xec15('0x4'));var Mustache=require(_0xec15('0x5'));var util=require(_0xec15('0x6'));var path=require(_0xec15('0x7'));var sox=require(_0xec15('0x8'));var csv=require(_0xec15('0x9'));var ejs=require(_0xec15('0xa'));var fs=require('fs');var fs_extra=require(_0xec15('0xb'));var _=require(_0xec15('0xc'));var squel=require(_0xec15('0xd'));var crypto=require(_0xec15('0xe'));var jsforce=require(_0xec15('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xec15('0x9'));var querystring=require(_0xec15('0x10'));var Papa=require('papaparse');var Redis=require(_0xec15('0x11'));var authService=require(_0xec15('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xec15('0x13'));var hardwareService=require(_0xec15('0x14'));var logger=require(_0xec15('0x15'))(_0xec15('0x16'));var utils=require(_0xec15('0x17'));var config=require(_0xec15('0x18'));var licenseUtil=require(_0xec15('0x19'));var db=require(_0xec15('0x1a'))['db'];function respondWithStatusCode(_0x45ea69,_0x2bc622){_0x2bc622=_0x2bc622||0xcc;return function(_0x11f292){if(_0x11f292){return _0x45ea69[_0xec15('0x1b')](_0x2bc622);}return _0x45ea69[_0xec15('0x1c')](_0x2bc622)[_0xec15('0x1d')]();};}function respondWithResult(_0x3c6cb3,_0x2b201b){_0x2b201b=_0x2b201b||0xc8;return function(_0x333def){if(_0x333def){return _0x3c6cb3['status'](_0x2b201b)[_0xec15('0x1e')](_0x333def);}};}function respondWithFilteredResult(_0x507451,_0x25d061){return function(_0x26f099){if(_0x26f099){var _0xdb46c9=typeof _0x25d061[_0xec15('0x1f')]===_0xec15('0x20')&&typeof _0x25d061[_0xec15('0x21')]===_0xec15('0x20');var _0x7c3a2=_0x26f099[_0xec15('0x22')];var _0x4d5842=_0xdb46c9?0x0:_0x25d061[_0xec15('0x1f')];var _0xe1e646=_0xdb46c9?_0x26f099[_0xec15('0x22')]:_0x25d061[_0xec15('0x1f')]+_0x25d061[_0xec15('0x21')];var _0x2ffa9a;if(_0xe1e646>=_0x7c3a2){_0xe1e646=_0x7c3a2;_0x2ffa9a=0xc8;}else{_0x2ffa9a=0xce;}_0x507451[_0xec15('0x1c')](_0x2ffa9a);return _0x507451[_0xec15('0x23')](_0xec15('0x24'),_0x4d5842+'-'+_0xe1e646+'/'+_0x7c3a2)['json'](_0x26f099);}return null;};}function patchUpdates(_0x56f3fa){return function(_0x90d24e){try{jsonpatch['apply'](_0x90d24e,_0x56f3fa,!![]);}catch(_0x2dceab){return BPromise['reject'](_0x2dceab);}return _0x90d24e[_0xec15('0x25')]();};}function saveUpdates(_0x195bc6,_0x2925a0){return function(_0x1f74f5){if(_0x1f74f5){return _0x1f74f5['update'](_0x195bc6)['then'](function(_0x3361a7){return _0x3361a7;});}return null;};}function removeEntity(_0x3fa0ba,_0x3b39d4){return function(_0x2a847f){if(_0x2a847f){return _0x2a847f[_0xec15('0x26')]()[_0xec15('0x27')](function(){_0x3fa0ba[_0xec15('0x1c')](0xcc)[_0xec15('0x1d')]();});}};}function handleEntityNotFound(_0x1272be,_0x143d8c){return function(_0x316521){if(!_0x316521){_0x1272be['sendStatus'](0x194);}return _0x316521;};}function handleError(_0x319d39,_0x2c71a3){_0x2c71a3=_0x2c71a3||0x1f4;return function(_0x3262bc){logger['error'](_0x3262bc[_0xec15('0x28')]);if(_0x3262bc[_0xec15('0x29')]){delete _0x3262bc[_0xec15('0x29')];}_0x319d39[_0xec15('0x1c')](_0x2c71a3)['send'](_0x3262bc);};}exports[_0xec15('0x2a')]=function(_0x2229fa,_0x412301){var _0x27fc84={},_0x283211={},_0x54201d={'count':0x0,'rows':[]};var _0x1d6615=_['map'](db[_0xec15('0x2b')][_0xec15('0x2c')],function(_0x5066ea){return{'name':_0x5066ea[_0xec15('0x2d')],'type':_0x5066ea['type'][_0xec15('0x2e')]};});_0x283211[_0xec15('0x2f')]=_[_0xec15('0x30')](_0x1d6615,'name');_0x283211[_0xec15('0x31')]=_[_0xec15('0x32')](_0x2229fa[_0xec15('0x31')]);_0x283211[_0xec15('0x33')]=_[_0xec15('0x34')](_0x283211['model'],_0x283211['query']);_0x27fc84[_0xec15('0x35')]=_[_0xec15('0x34')](_0x283211[_0xec15('0x2f')],qs[_0xec15('0x36')](_0x2229fa['query'][_0xec15('0x36')]));_0x27fc84[_0xec15('0x35')]=_0x27fc84[_0xec15('0x35')][_0xec15('0x37')]?_0x27fc84[_0xec15('0x35')]:_0x283211['model'];if(!_0x2229fa[_0xec15('0x31')][_0xec15('0x38')]('nolimit')){_0x27fc84[_0xec15('0x21')]=qs[_0xec15('0x21')](_0x2229fa['query']['limit']);_0x27fc84['offset']=qs[_0xec15('0x1f')](_0x2229fa[_0xec15('0x31')][_0xec15('0x1f')]);}_0x27fc84[_0xec15('0x39')]=qs['sort'](_0x2229fa['query'][_0xec15('0x3a')]);_0x27fc84[_0xec15('0x3b')]=qs[_0xec15('0x33')](_[_0xec15('0x3c')](_0x2229fa[_0xec15('0x31')],_0x283211['filters']),_0x1d6615);if(_0x2229fa[_0xec15('0x31')]['filter']){_0x27fc84[_0xec15('0x3b')]=_[_0xec15('0x3d')](_0x27fc84['where'],{'$or':_['map'](_0x1d6615,function(_0xf562ee){if(_0xf562ee[_0xec15('0x3e')]!==_0xec15('0x3f')){var _0x3c0920={};_0x3c0920[_0xf562ee[_0xec15('0x29')]]={'$like':'%'+_0x2229fa[_0xec15('0x31')]['filter']+'%'};return _0x3c0920;}})});}_0x27fc84=_[_0xec15('0x3d')]({},_0x27fc84,_0x2229fa[_0xec15('0x40')]);var _0x26bbff={'where':_0x27fc84[_0xec15('0x3b')]};return db[_0xec15('0x2b')]['count'](_0x26bbff)[_0xec15('0x27')](function(_0x8cd863){_0x54201d['count']=_0x8cd863;if(_0x2229fa[_0xec15('0x31')][_0xec15('0x41')]){_0x27fc84[_0xec15('0x42')]=[{'all':!![]}];}return db[_0xec15('0x2b')][_0xec15('0x43')](_0x27fc84);})[_0xec15('0x27')](function(_0x45f2dd){_0x54201d['rows']=_0x45f2dd;return _0x54201d;})[_0xec15('0x27')](respondWithFilteredResult(_0x412301,_0x27fc84))[_0xec15('0x44')](handleError(_0x412301,null));};exports[_0xec15('0x45')]=function(_0x3bf00c,_0x150f25){var _0x5e383c={'raw':!![],'where':{'id':_0x3bf00c[_0xec15('0x46')]['id']}},_0x5d91b3={};_0x5d91b3['model']=_['keys'](db[_0xec15('0x2b')][_0xec15('0x2c')]);_0x5d91b3['query']=_[_0xec15('0x32')](_0x3bf00c[_0xec15('0x31')]);_0x5d91b3[_0xec15('0x33')]=_['intersection'](_0x5d91b3['model'],_0x5d91b3['query']);_0x5e383c['attributes']=_['intersection'](_0x5d91b3[_0xec15('0x2f')],qs[_0xec15('0x36')](_0x3bf00c['query'][_0xec15('0x36')]));_0x5e383c[_0xec15('0x35')]=_0x5e383c['attributes'][_0xec15('0x37')]?_0x5e383c['attributes']:_0x5d91b3[_0xec15('0x2f')];if(_0x3bf00c[_0xec15('0x31')][_0xec15('0x41')]){_0x5e383c[_0xec15('0x42')]=[{'all':!![]}];}_0x5e383c=_[_0xec15('0x3d')]({},_0x5e383c,_0x3bf00c[_0xec15('0x40')]);return db['SugarcrmField'][_0xec15('0x47')](_0x5e383c)[_0xec15('0x27')](handleEntityNotFound(_0x150f25,null))[_0xec15('0x27')](respondWithResult(_0x150f25,null))[_0xec15('0x44')](handleError(_0x150f25,null));};exports[_0xec15('0x48')]=function(_0x2b533e,_0x5b8a0e){return db['SugarcrmField'][_0xec15('0x48')](_0x2b533e[_0xec15('0x49')],{})[_0xec15('0x27')](respondWithResult(_0x5b8a0e,0xc9))[_0xec15('0x44')](handleError(_0x5b8a0e,null));};exports[_0xec15('0x4a')]=function(_0x320a62,_0x2f4e9c){if(_0x320a62[_0xec15('0x49')]['id']){delete _0x320a62[_0xec15('0x49')]['id'];}return db[_0xec15('0x2b')][_0xec15('0x47')]({'where':{'id':_0x320a62[_0xec15('0x46')]['id']}})[_0xec15('0x27')](handleEntityNotFound(_0x2f4e9c,null))[_0xec15('0x27')](saveUpdates(_0x320a62[_0xec15('0x49')],null))[_0xec15('0x27')](respondWithResult(_0x2f4e9c,null))[_0xec15('0x44')](handleError(_0x2f4e9c,null));};exports[_0xec15('0x26')]=function(_0x5433eb,_0x106a1b){return db[_0xec15('0x2b')][_0xec15('0x47')]({'where':{'id':_0x5433eb[_0xec15('0x46')]['id']}})[_0xec15('0x27')](handleEntityNotFound(_0x106a1b,null))['then'](removeEntity(_0x106a1b,null))[_0xec15('0x44')](handleError(_0x106a1b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 071cb48..0dbf033 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 _0x1b64=['FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x1b64,0x83));var _0x41b6=function(_0x53ae3e,_0x30a598){_0x53ae3e=_0x53ae3e-0x0;var _0x11e578=_0x1b64[_0x53ae3e];return _0x11e578;};'use strict';var _=require('lodash');var util=require(_0x41b6('0x0'));var logger=require(_0x41b6('0x1'))(_0x41b6('0x2'));var moment=require(_0x41b6('0x3'));var BPromise=require('bluebird');var rp=require(_0x41b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41b6('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x41b6('0x6')]=function(_0x2e54a7,_0x14f6a5){return _0x2e54a7[_0x41b6('0x7')](_0x41b6('0x8'),attributes,{'tableName':_0x41b6('0x9'),'paranoid':![],'indexes':[{'name':_0x41b6('0xa'),'fields':[_0x41b6('0xb'),_0x41b6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xacd8=['FieldId','util','../../config/logger','moment','bluebird','path','../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x3700fd,_0x5bd346){var _0x4ffb6c=function(_0x42a3de){while(--_0x42a3de){_0x3700fd['push'](_0x3700fd['shift']());}};_0x4ffb6c(++_0x5bd346);}(_0xacd8,0x137));var _0x8acd=function(_0x29c4dc,_0x1a667a){_0x29c4dc=_0x29c4dc-0x0;var _0x5ac8a9=_0xacd8[_0x29c4dc];return _0x5ac8a9;};'use strict';var _=require('lodash');var util=require(_0x8acd('0x0'));var logger=require(_0x8acd('0x1'))('api');var moment=require(_0x8acd('0x2'));var BPromise=require(_0x8acd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8acd('0x4'));var rimraf=require('rimraf');var config=require(_0x8acd('0x5'));var attributes=require(_0x8acd('0x6'));module['exports']=function(_0xa34bf7,_0x3ab142){return _0xa34bf7['define']('SugarcrmField',attributes,{'tableName':_0x8acd('0x7'),'paranoid':![],'indexes':[{'name':_0x8acd('0x8'),'fields':['idField',_0x8acd('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 7d70cec..9943658 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 _0xe1c7=['stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x3487af,_0x3f03d0){var _0x3afdce=function(_0x27d5b){while(--_0x27d5b){_0x3487af['push'](_0x3487af['shift']());}};_0x3afdce(++_0x3f03d0);}(_0xe1c7,0xf6));var _0x7e1c=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0xe1c7[_0x71b765];return _0x34cb24;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e1c('0x0'));var BPromise=require(_0x7e1c('0x1'));var rs=require(_0x7e1c('0x2'));var fs=require('fs');var Redis=require(_0x7e1c('0x3'));var db=require(_0x7e1c('0x4'))['db'];var utils=require(_0x7e1c('0x5'));var logger=require(_0x7e1c('0x6'))(_0x7e1c('0x7'));var config=require(_0x7e1c('0x8'));var jayson=require(_0x7e1c('0x9'));var client=jayson[_0x7e1c('0xa')][_0x7e1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46d556,_0x2a8c05,_0x537283){return new BPromise(function(_0xa3d213,_0x29af5e){return client[_0x7e1c('0xc')](_0x46d556,_0x537283)[_0x7e1c('0xd')](function(_0x37053e){logger[_0x7e1c('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2a8c05,_0x7e1c('0xf'));logger[_0x7e1c('0x10')](_0x7e1c('0x11'),_0x2a8c05,_0x7e1c('0xf'),JSON[_0x7e1c('0x12')](_0x37053e));if(_0x37053e[_0x7e1c('0x13')]){if(_0x37053e[_0x7e1c('0x13')]['code']===0x1f4){logger['error'](_0x7e1c('0x14'),_0x2a8c05,_0x37053e[_0x7e1c('0x13')]['message']);return _0x29af5e(_0x37053e[_0x7e1c('0x13')][_0x7e1c('0x15')]);}logger[_0x7e1c('0x13')](_0x7e1c('0x14'),_0x2a8c05,_0x37053e[_0x7e1c('0x13')][_0x7e1c('0x15')]);return _0xa3d213(_0x37053e[_0x7e1c('0x13')][_0x7e1c('0x15')]);}else{logger[_0x7e1c('0xe')](_0x7e1c('0x14'),_0x2a8c05,_0x7e1c('0xf'));_0xa3d213(_0x37053e[_0x7e1c('0x16')][_0x7e1c('0x15')]);}})[_0x7e1c('0x17')](function(_0x5a560c){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2a8c05,_0x5a560c);_0x29af5e(_0x5a560c);});});} \ No newline at end of file +var _0x87b0=['error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87b0,0x1cf));var _0x087b=function(_0x9f8d6b,_0x3fa4b5){_0x9f8d6b=_0x9f8d6b-0x0;var _0x3cc8d2=_0x87b0[_0x9f8d6b];return _0x3cc8d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x087b('0x0'));var BPromise=require(_0x087b('0x1'));var rs=require(_0x087b('0x2'));var fs=require('fs');var Redis=require(_0x087b('0x3'));var db=require(_0x087b('0x4'))['db'];var utils=require(_0x087b('0x5'));var logger=require(_0x087b('0x6'))('rpc');var config=require(_0x087b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x087b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326bc3,_0x108693,_0x510a01){return new BPromise(function(_0x387106,_0x5c5cbb){return client[_0x087b('0x9')](_0x326bc3,_0x510a01)[_0x087b('0xa')](function(_0x32fefc){logger[_0x087b('0xb')](_0x087b('0xc'),_0x108693,_0x087b('0xd'));logger[_0x087b('0xe')](_0x087b('0xf'),_0x108693,_0x087b('0xd'),JSON[_0x087b('0x10')](_0x32fefc));if(_0x32fefc[_0x087b('0x11')]){if(_0x32fefc[_0x087b('0x11')]['code']===0x1f4){logger[_0x087b('0x11')](_0x087b('0xc'),_0x108693,_0x32fefc['error'][_0x087b('0x12')]);return _0x5c5cbb(_0x32fefc[_0x087b('0x11')][_0x087b('0x12')]);}logger[_0x087b('0x11')](_0x087b('0xc'),_0x108693,_0x32fefc[_0x087b('0x11')][_0x087b('0x12')]);return _0x387106(_0x32fefc[_0x087b('0x11')]['message']);}else{logger['info'](_0x087b('0xc'),_0x108693,_0x087b('0xd'));_0x387106(_0x32fefc[_0x087b('0x13')][_0x087b('0x12')]);}})['catch'](function(_0x952848){logger['error'](_0x087b('0xc'),_0x108693,_0x952848);_0x5c5cbb(_0x952848);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a4e26e8..b7d0447 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 _0xb717=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','path','express','Router'];(function(_0x496125,_0x38e301){var _0x4335a6=function(_0x42be1d){while(--_0x42be1d){_0x496125['push'](_0x496125['shift']());}};_0x4335a6(++_0x38e301);}(_0xb717,0x1b4));var _0x7b71=function(_0x1124fe,_0x3104d3){_0x1124fe=_0x1124fe-0x0;var _0x337bb1=_0xb717[_0x1124fe];return _0x337bb1;};'use strict';var multer=require(_0x7b71('0x0'));var util=require('util');var path=require(_0x7b71('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b71('0x2'));var router=express[_0x7b71('0x3')]();var fs_extra=require(_0x7b71('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var controller=require(_0x7b71('0x7'));router[_0x7b71('0x8')]('/',auth[_0x7b71('0x9')](),controller['index']);router[_0x7b71('0x8')](_0x7b71('0xa'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xb')]);router[_0x7b71('0x8')]('/:id/configurations',auth[_0x7b71('0x9')](),controller[_0x7b71('0xc')]);router['get'](_0x7b71('0xd'),auth[_0x7b71('0x9')](),controller[_0x7b71('0xe')]);router['post']('/',auth[_0x7b71('0x9')](),controller['create']);router[_0x7b71('0xf')]('/:id/configurations',auth[_0x7b71('0x9')](),controller[_0x7b71('0x10')]);router[_0x7b71('0x11')](_0x7b71('0xa'),auth[_0x7b71('0x9')](),controller['update']);router[_0x7b71('0x12')]('/:id',auth[_0x7b71('0x9')](),controller[_0x7b71('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc0c2=['/:id/configurations','addConfiguration','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create'];(function(_0x23c4a9,_0x15eaf1){var _0xf708c5=function(_0x22f2be){while(--_0x22f2be){_0x23c4a9['push'](_0x23c4a9['shift']());}};_0xf708c5(++_0x15eaf1);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0xc0c2[_0x364b32];return _0x3f3ea0;};'use strict';var multer=require('multer');var util=require(_0x2c0c('0x0'));var path=require(_0x2c0c('0x1'));var timeout=require(_0x2c0c('0x2'));var express=require(_0x2c0c('0x3'));var router=express['Router']();var fs_extra=require(_0x2c0c('0x4'));var auth=require(_0x2c0c('0x5'));var interaction=require(_0x2c0c('0x6'));var config=require(_0x2c0c('0x7'));var controller=require(_0x2c0c('0x8'));router[_0x2c0c('0x9')]('/',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0xb')]);router['get']('/:id',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0xc')]);router[_0x2c0c('0x9')]('/:id/configurations',auth[_0x2c0c('0xa')](),controller['getConfigurations']);router[_0x2c0c('0x9')](_0x2c0c('0xd'),auth['isAuthenticated'](),controller[_0x2c0c('0xe')]);router[_0x2c0c('0xf')]('/',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x10')]);router[_0x2c0c('0xf')](_0x2c0c('0x11'),auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x12')]);router[_0x2c0c('0x13')](_0x2c0c('0x14'),auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x15')]);router['delete'](_0x2c0c('0x14'),auth['isAuthenticated'](),controller[_0x2c0c('0x16')]);module[_0x2c0c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 43cd9f2..9827e1e 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 _0x3185=['exports','STRING','HelpDesk'];(function(_0x52c808,_0xc4f540){var _0x16116d=function(_0x12df59){while(--_0x12df59){_0x52c808['push'](_0x52c808['shift']());}};_0x16116d(++_0xc4f540);}(_0x3185,0x17d));var _0x5318=function(_0x529ad7,_0x4cbb2f){_0x529ad7=_0x529ad7-0x0;var _0x3334de=_0x3185[_0x529ad7];return _0x3334de;};'use strict';var Sequelize=require('sequelize');module[_0x5318('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5318('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5318('0x1')],'allowNull':![],'defaultValue':_0x5318('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5318('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6e6f=['STRING','sequelize'];(function(_0x240c63,_0x7e2d08){var _0xb19b09=function(_0x46256c){while(--_0x46256c){_0x240c63['push'](_0x240c63['shift']());}};_0xb19b09(++_0x7e2d08);}(_0x6e6f,0xcb));var _0xf6e6=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x6e6f[_0x476b00];return _0x44ec8e;};'use strict';var Sequelize=require(_0xf6e6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 1db0d74..311edca 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 _0xceec=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','name','send','index','map','VtigerAccount','fieldName','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','findOne','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','success','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra'];(function(_0x5eb83e,_0x386039){var _0x2ba972=function(_0x324087){while(--_0x324087){_0x5eb83e['push'](_0x5eb83e['shift']());}};_0x2ba972(++_0x386039);}(_0xceec,0x1cb));var _0xccee=function(_0x43dea2,_0x34cec6){_0x43dea2=_0x43dea2-0x0;var _0x53fdb1=_0xceec[_0x43dea2];return _0x53fdb1;};'use strict';var emlformat=require(_0xccee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccee('0x2'));var moment=require(_0xccee('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xccee('0x4'));var path=require(_0xccee('0x5'));var sox=require(_0xccee('0x6'));var csv=require(_0xccee('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccee('0x8'));var _=require('lodash');var squel=require(_0xccee('0x9'));var crypto=require(_0xccee('0xa'));var jsforce=require(_0xccee('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xccee('0x7'));var querystring=require(_0xccee('0xc'));var Papa=require(_0xccee('0xd'));var Redis=require(_0xccee('0xe'));var authService=require(_0xccee('0xf'));var qs=require(_0xccee('0x10'));var as=require(_0xccee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xccee('0x12'));var utils=require('../../config/utils');var config=require(_0xccee('0x13'));var licenseUtil=require(_0xccee('0x14'));var db=require(_0xccee('0x15'))['db'];var integrations=require(_0xccee('0x16'));function respondWithStatusCode(_0x365fd7,_0x5e4e35){_0x5e4e35=_0x5e4e35||0xcc;return function(_0x55bf9a){if(_0x55bf9a){return _0x365fd7[_0xccee('0x17')](_0x5e4e35);}return _0x365fd7['status'](_0x5e4e35)[_0xccee('0x18')]();};}function respondWithResult(_0x50f682,_0x363192){_0x363192=_0x363192||0xc8;return function(_0x1f639f){if(_0x1f639f){return _0x50f682[_0xccee('0x19')](_0x363192)[_0xccee('0x1a')](_0x1f639f);}};}function respondWithFilteredResult(_0xe8c4c1,_0x1b6ae2){return function(_0x3c2b47){if(_0x3c2b47){var _0x2fefcf=typeof _0x1b6ae2['offset']===_0xccee('0x1b')&&typeof _0x1b6ae2[_0xccee('0x1c')]===_0xccee('0x1b');var _0x12b82c=_0x3c2b47['count'];var _0x2bdc98=_0x2fefcf?0x0:_0x1b6ae2['offset'];var _0xddc2fc=_0x2fefcf?_0x3c2b47[_0xccee('0x1d')]:_0x1b6ae2[_0xccee('0x1e')]+_0x1b6ae2[_0xccee('0x1c')];var _0x4588fb;if(_0xddc2fc>=_0x12b82c){_0xddc2fc=_0x12b82c;_0x4588fb=0xc8;}else{_0x4588fb=0xce;}_0xe8c4c1[_0xccee('0x19')](_0x4588fb);return _0xe8c4c1[_0xccee('0x1f')](_0xccee('0x20'),_0x2bdc98+'-'+_0xddc2fc+'/'+_0x12b82c)[_0xccee('0x1a')](_0x3c2b47);}return null;};}function patchUpdates(_0x1dff1f){return function(_0x35e59f){try{jsonpatch[_0xccee('0x21')](_0x35e59f,_0x1dff1f,!![]);}catch(_0xf37964){return BPromise['reject'](_0xf37964);}return _0x35e59f[_0xccee('0x22')]();};}function saveUpdates(_0x3a5c5f,_0x37178a){return function(_0x15ca3c){if(_0x15ca3c){return _0x15ca3c[_0xccee('0x23')](_0x3a5c5f)['then'](function(_0x55af13){return _0x55af13;});}return null;};}function removeEntity(_0xe9f1ef,_0x3f0073){return function(_0x4ddaa2){if(_0x4ddaa2){return _0x4ddaa2[_0xccee('0x24')]()[_0xccee('0x25')](function(){_0xe9f1ef[_0xccee('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26c176,_0x45a739){return function(_0x58e647){if(!_0x58e647){_0x26c176[_0xccee('0x17')](0x194);}return _0x58e647;};}function handleError(_0x5979e2,_0x294ec1){_0x294ec1=_0x294ec1||0x1f4;return function(_0x527309){logger['error'](_0x527309['stack']);if(_0x527309[_0xccee('0x26')]){delete _0x527309[_0xccee('0x26')];}_0x5979e2[_0xccee('0x19')](_0x294ec1)[_0xccee('0x27')](_0x527309);};}exports[_0xccee('0x28')]=function(_0x24458d,_0x59d95a){var _0xbe91fa={},_0x46e4ef={},_0x118861={'count':0x0,'rows':[]};var _0x65c9de=_[_0xccee('0x29')](db[_0xccee('0x2a')]['rawAttributes'],function(_0x4a3f93){return{'name':_0x4a3f93[_0xccee('0x2b')],'type':_0x4a3f93['type']['key']};});_0x46e4ef['model']=_[_0xccee('0x29')](_0x65c9de,_0xccee('0x26'));_0x46e4ef['query']=_[_0xccee('0x2c')](_0x24458d['query']);_0x46e4ef[_0xccee('0x2d')]=_[_0xccee('0x2e')](_0x46e4ef[_0xccee('0x2f')],_0x46e4ef[_0xccee('0x30')]);_0xbe91fa[_0xccee('0x31')]=_[_0xccee('0x2e')](_0x46e4ef[_0xccee('0x2f')],qs[_0xccee('0x32')](_0x24458d['query']['fields']));_0xbe91fa[_0xccee('0x31')]=_0xbe91fa[_0xccee('0x31')][_0xccee('0x33')]?_0xbe91fa[_0xccee('0x31')]:_0x46e4ef[_0xccee('0x2f')];if(!_0x24458d['query'][_0xccee('0x34')]('nolimit')){_0xbe91fa[_0xccee('0x1c')]=qs[_0xccee('0x1c')](_0x24458d['query']['limit']);_0xbe91fa[_0xccee('0x1e')]=qs[_0xccee('0x1e')](_0x24458d[_0xccee('0x30')][_0xccee('0x1e')]);}_0xbe91fa[_0xccee('0x35')]=qs[_0xccee('0x36')](_0x24458d[_0xccee('0x30')][_0xccee('0x36')]);_0xbe91fa[_0xccee('0x37')]=qs[_0xccee('0x2d')](_[_0xccee('0x38')](_0x24458d['query'],_0x46e4ef['filters']),_0x65c9de);if(_0x24458d['query'][_0xccee('0x39')]){_0xbe91fa[_0xccee('0x37')]=_[_0xccee('0x3a')](_0xbe91fa[_0xccee('0x37')],{'$or':_[_0xccee('0x29')](_0x65c9de,function(_0x482d6c){if(_0x482d6c[_0xccee('0x3b')]!=='VIRTUAL'){var _0x412d89={};_0x412d89[_0x482d6c['name']]={'$like':'%'+_0x24458d[_0xccee('0x30')]['filter']+'%'};return _0x412d89;}})});}_0xbe91fa=_['merge']({},_0xbe91fa,_0x24458d[_0xccee('0x3c')]);var _0x4761c4={'where':_0xbe91fa['where']};return db[_0xccee('0x2a')][_0xccee('0x1d')](_0x4761c4)[_0xccee('0x25')](function(_0x1280f2){_0x118861[_0xccee('0x1d')]=_0x1280f2;if(_0x24458d[_0xccee('0x30')][_0xccee('0x3d')]){_0xbe91fa['include']=[{'all':!![]}];}return db[_0xccee('0x2a')][_0xccee('0x3e')](_0xbe91fa);})[_0xccee('0x25')](function(_0x46fe07){_0x118861['rows']=_0x46fe07;return _0x118861;})[_0xccee('0x25')](respondWithFilteredResult(_0x59d95a,_0xbe91fa))[_0xccee('0x3f')](handleError(_0x59d95a,null));};exports['show']=function(_0x4e31bb,_0x2e91f3){var _0x1bf196={'raw':![],'where':{'id':_0x4e31bb[_0xccee('0x40')]['id']}},_0x3a198a={};_0x3a198a[_0xccee('0x2f')]=_['keys'](db['VtigerAccount'][_0xccee('0x41')]);_0x3a198a[_0xccee('0x30')]=_[_0xccee('0x2c')](_0x4e31bb[_0xccee('0x30')]);_0x3a198a[_0xccee('0x2d')]=_[_0xccee('0x2e')](_0x3a198a[_0xccee('0x2f')],_0x3a198a[_0xccee('0x30')]);_0x1bf196[_0xccee('0x31')]=_['intersection'](_0x3a198a[_0xccee('0x2f')],qs[_0xccee('0x32')](_0x4e31bb[_0xccee('0x30')]['fields']));_0x1bf196[_0xccee('0x31')]=_0x1bf196[_0xccee('0x31')]['length']?_0x1bf196[_0xccee('0x31')]:_0x3a198a[_0xccee('0x2f')];if(_0x4e31bb[_0xccee('0x30')][_0xccee('0x3d')]){_0x1bf196[_0xccee('0x42')]=[{'all':!![]}];}_0x1bf196=_[_0xccee('0x3a')]({},_0x1bf196,_0x4e31bb[_0xccee('0x3c')]);return db[_0xccee('0x2a')][_0xccee('0x43')](_0x1bf196)['then'](handleEntityNotFound(_0x2e91f3,null))['then'](respondWithResult(_0x2e91f3,null))[_0xccee('0x3f')](handleError(_0x2e91f3,null));};exports[_0xccee('0x44')]=function(_0x54bf21,_0x12d3bb){return db[_0xccee('0x2a')]['create'](_0x54bf21[_0xccee('0x45')],{})[_0xccee('0x25')](respondWithResult(_0x12d3bb,0xc9))['catch'](handleError(_0x12d3bb,null));};exports[_0xccee('0x23')]=function(_0x491a56,_0x5732f8){if(_0x491a56[_0xccee('0x45')]['id']){delete _0x491a56[_0xccee('0x45')]['id'];}return db[_0xccee('0x2a')][_0xccee('0x43')]({'where':{'id':_0x491a56['params']['id']}})['then'](handleEntityNotFound(_0x5732f8,null))[_0xccee('0x25')](saveUpdates(_0x491a56[_0xccee('0x45')],null))['then'](respondWithResult(_0x5732f8,null))[_0xccee('0x3f')](handleError(_0x5732f8,null));};exports[_0xccee('0x24')]=function(_0xf339ff,_0x24a43e){return db[_0xccee('0x2a')]['find']({'where':{'id':_0xf339ff[_0xccee('0x40')]['id']}})[_0xccee('0x25')](handleEntityNotFound(_0x24a43e,null))[_0xccee('0x25')](removeEntity(_0x24a43e,null))[_0xccee('0x3f')](handleError(_0x24a43e,null));};exports['getConfigurations']=function(_0x398658,_0x4338ac,_0x2dd6eb){var _0x3db942={};var _0x51bb32={};var _0x4222aa;var _0x27cb3d;return db[_0xccee('0x2a')][_0xccee('0x46')]({'where':{'id':_0x398658[_0xccee('0x40')]['id']}})[_0xccee('0x25')](handleEntityNotFound(_0x4338ac,null))[_0xccee('0x25')](function(_0x1d909d){if(_0x1d909d){_0x4222aa=_0x1d909d;_0x51bb32[_0xccee('0x2f')]=_[_0xccee('0x2c')](db['VtigerConfiguration'][_0xccee('0x41')]);_0x51bb32[_0xccee('0x30')]=_[_0xccee('0x2c')](_0x398658[_0xccee('0x30')]);_0x51bb32[_0xccee('0x2d')]=_[_0xccee('0x2e')](_0x51bb32[_0xccee('0x2f')],_0x51bb32[_0xccee('0x30')]);_0x3db942['attributes']=_['intersection'](_0x51bb32[_0xccee('0x2f')],qs['fields'](_0x398658[_0xccee('0x30')][_0xccee('0x32')]));_0x3db942['attributes']=_0x3db942[_0xccee('0x31')][_0xccee('0x33')]?_0x3db942['attributes']:_0x51bb32[_0xccee('0x2f')];_0x3db942[_0xccee('0x35')]=qs[_0xccee('0x36')](_0x398658['query']['sort']);_0x3db942[_0xccee('0x37')]=qs[_0xccee('0x2d')](_['pick'](_0x398658['query'],_0x51bb32['filters']));if(_0x398658[_0xccee('0x30')][_0xccee('0x39')]){_0x3db942[_0xccee('0x37')]=_[_0xccee('0x3a')](_0x3db942[_0xccee('0x37')],{'$or':_[_0xccee('0x29')](_0x3db942[_0xccee('0x31')],function(_0x304db3){var _0x409706={};_0x409706[_0x304db3]={'$like':'%'+_0x398658[_0xccee('0x30')][_0xccee('0x39')]+'%'};return _0x409706;})});}_0x3db942=_['merge']({},_0x3db942,_0x398658['options']);return _0x4222aa[_0xccee('0x47')](_0x3db942);}})['then'](function(_0x2d50d4){if(_0x2d50d4){_0x27cb3d=_0x2d50d4[_0xccee('0x33')];if(!_0x398658[_0xccee('0x30')][_0xccee('0x34')]('nolimit')){_0x3db942[_0xccee('0x1c')]=qs[_0xccee('0x1c')](_0x398658['query'][_0xccee('0x1c')]);_0x3db942[_0xccee('0x1e')]=qs['offset'](_0x398658['query'][_0xccee('0x1e')]);}return _0x4222aa[_0xccee('0x47')](_0x3db942);}})['then'](function(_0x43a325){if(_0x43a325){return _0x43a325?{'count':_0x27cb3d,'rows':_0x43a325}:null;}})[_0xccee('0x25')](respondWithResult(_0x4338ac,null))[_0xccee('0x3f')](handleError(_0x4338ac,null));};exports['addConfiguration']=function(_0x1f4684,_0x9f5afc,_0x1ae421){if(_0x1f4684[_0xccee('0x45')]['id']){delete _0x1f4684['body']['id'];}return db[_0xccee('0x2a')][_0xccee('0x46')]({'where':{'id':_0x1f4684[_0xccee('0x40')]['id']}})['then'](handleEntityNotFound(_0x9f5afc,null))[_0xccee('0x25')](function(_0x5ed217){if(_0x5ed217){_0x1f4684['body'][_0xccee('0x48')]=_0x5ed217['id'];_0x1f4684[_0xccee('0x45')][_0xccee('0x49')]=integrations[_0xccee('0x4a')](_0x1f4684['body'][_0xccee('0x4b')],_0x1f4684['body'][_0xccee('0x3b')]);_0x1f4684[_0xccee('0x45')][_0xccee('0x4c')]=integrations[_0xccee('0x4d')](_0x1f4684['body'][_0xccee('0x4b')],_0x1f4684[_0xccee('0x45')][_0xccee('0x3b')]);return db['VtigerConfiguration'][_0xccee('0x44')](_0x1f4684[_0xccee('0x45')],{'include':[{'model':db[_0xccee('0x4e')],'as':'Subjects'},{'model':db[_0xccee('0x4e')],'as':_0xccee('0x4c')}]});}return null;})[_0xccee('0x25')](respondWithResult(_0x9f5afc,null))['catch'](handleError(_0x9f5afc,null));};var md5=require(_0xccee('0x4f'));exports[_0xccee('0x50')]=function(_0x2d9723,_0xc85e10,_0x3b9ca3){var _0x1c6ac4=null;var _0x5e7baa=null;var _0x28e404=null;var _0x54f447=null;var _0x838483='';return db['VtigerAccount'][_0xccee('0x46')]({'where':{'id':_0x2d9723[_0xccee('0x40')]['id']},'attributes':['id',_0xccee('0x26'),_0xccee('0x51'),_0xccee('0x52'),_0xccee('0x53'),_0xccee('0x54'),_0xccee('0x55'),_0xccee('0x56')]})[_0xccee('0x25')](handleEntityNotFound(_0xc85e10,null))[_0xccee('0x25')](function(_0x5666e3){if(_0x5666e3){_0x1c6ac4=_0x5666e3['username'];_0x5e7baa=_0x5666e3['accessKey'];_0x28e404=_0x5666e3['moduleName'];_0x838483=_0x5666e3[_0xccee('0x54')];var _0x231dd3=_0x838483[_0xccee('0x57')](-0x1);if(_0x231dd3==='/'){_0x838483=_0x838483[_0xccee('0x58')](0x0,_0x838483['lastIndexOf'](_0x231dd3));}_0x54f447=util[_0xccee('0x59')](_0xccee('0x5a'),_0x838483);var _0x3ae981={'method':_0xccee('0x5b'),'uri':_0x54f447,'qs':{'operation':_0xccee('0x5c'),'username':_0x5666e3[_0xccee('0x51')]},'json':!![]};return rp(_0x3ae981);}})[_0xccee('0x25')](function(_0x3855ab){if(_0x3855ab[_0xccee('0x5d')]){var _0x50a26e={'method':'POST','uri':_0x54f447,'form':{'operation':'login','username':_0x1c6ac4,'accessKey':md5(_0x3855ab[_0xccee('0x5e')][_0xccee('0x5f')]+_0x5e7baa)},'json':!![]};return rp(_0x50a26e);}})[_0xccee('0x25')](function(_0x1c9804){if(_0x1c9804['success']){var _0x4782df={'method':_0xccee('0x5b'),'uri':_0x54f447,'qs':{'operation':_0xccee('0x60'),'username':_0x1c6ac4,'sessionName':_0x1c9804[_0xccee('0x5e')][_0xccee('0x61')],'elementType':_0x28e404},'json':!![]};return rp(_0x4782df);}})[_0xccee('0x25')](function(_0x346fdc){if(_0x346fdc[_0xccee('0x5d')]){var _0xc1690e=[_0xccee('0x62'),_0xccee('0x63'),_0xccee('0x64')];_[_0xccee('0x65')](_0x346fdc[_0xccee('0x5e')][_0xccee('0x32')],function(_0x57261a){return _0xc1690e[_0xccee('0x66')](_0x57261a[_0xccee('0x3b')][_0xccee('0x26')]);});_[_0xccee('0x65')](_0x346fdc[_0xccee('0x5e')][_0xccee('0x32')],function(_0x20fce6){return _0x20fce6['editable']===_0xccee('0x67');});return{'count':_0x346fdc[_0xccee('0x5e')][_0xccee('0x32')][_0xccee('0x33')],'rows':_['map'](_0x346fdc[_0xccee('0x5e')][_0xccee('0x32')],function(_0x3ef57e){return{'id':_0x3ef57e[_0xccee('0x26')],'name':_0x3ef57e[_0xccee('0x68')],'custom':_['startsWith'](_0x3ef57e['name'],_0xccee('0x69'))?!![]:![],'options':_0x3ef57e['type'][_0xccee('0x26')]===_0xccee('0x6a')&&_0x3ef57e[_0xccee('0x3b')][_0xccee('0x6b')][_0xccee('0x33')]>0x0?_[_0xccee('0x29')](_0x3ef57e[_0xccee('0x3b')]['picklistValues'],function(_0xb94eaa){return{'name':_0xb94eaa[_0xccee('0x68')],'value':_0xb94eaa[_0xccee('0x6c')]};}):[]};})};}})[_0xccee('0x25')](respondWithResult(_0xc85e10,null))[_0xccee('0x3f')](function(_0x4c8f53){console[_0xccee('0x6d')](_0xccee('0x6e')+_0x4c8f53);var _0x20b800=_0x2d9723[_0xccee('0x30')][_0xccee('0x6f')]?0x1f4:_0x4c8f53[_0xccee('0x70')]||0x1f4;logger[_0xccee('0x71')](_0xccee('0x72'),_0xccee('0x50'),_0x20b800,JSON[_0xccee('0x73')](_0x4c8f53));delete _0x4c8f53[_0xccee('0x26')];if(_0x20b800===0x191){_0x20b800=0x190;}_0xc85e10[_0xccee('0x19')](_0x20b800)[_0xccee('0x27')](_0x2d9723[_0xccee('0x30')][_0xccee('0x6f')]?{'message':_0xccee('0x74'),'statusCode':_0x4c8f53[_0xccee('0x70')]}:_0x4c8f53);});}; \ No newline at end of file +var _0x3890=['fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','VtigerAccount','rawAttributes','fieldName','map','query','keys','intersection','model','fields','attributes','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','body','getConfigurations','findOne','order','pick','hasOwnProperty','Subjects','getSubjects','channel','type','Descriptions','create','VtigerField','getFields','username','moduleName','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','reference','owner','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x3890,0x153));var _0x0389=function(_0x568870,_0x12b6f3){_0x568870=_0x568870-0x0;var _0x59fa8e=_0x3890[_0x568870];return _0x59fa8e;};'use strict';var emlformat=require(_0x0389('0x0'));var rimraf=require(_0x0389('0x1'));var zipdir=require(_0x0389('0x2'));var jsonpatch=require(_0x0389('0x3'));var rp=require(_0x0389('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0389('0x5'));var util=require('util');var path=require(_0x0389('0x6'));var sox=require(_0x0389('0x7'));var csv=require(_0x0389('0x8'));var ejs=require(_0x0389('0x9'));var fs=require('fs');var fs_extra=require(_0x0389('0xa'));var _=require(_0x0389('0xb'));var squel=require(_0x0389('0xc'));var crypto=require(_0x0389('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0389('0xe'));var Papa=require(_0x0389('0xf'));var Redis=require(_0x0389('0x10'));var authService=require(_0x0389('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0389('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0389('0x13'));var utils=require(_0x0389('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0389('0x15'));function respondWithStatusCode(_0x1aedf5,_0x386ec8){_0x386ec8=_0x386ec8||0xcc;return function(_0x420d45){if(_0x420d45){return _0x1aedf5['sendStatus'](_0x386ec8);}return _0x1aedf5[_0x0389('0x16')](_0x386ec8)[_0x0389('0x17')]();};}function respondWithResult(_0x46ba4b,_0x190a28){_0x190a28=_0x190a28||0xc8;return function(_0x5a29ae){if(_0x5a29ae){return _0x46ba4b[_0x0389('0x16')](_0x190a28)[_0x0389('0x18')](_0x5a29ae);}};}function respondWithFilteredResult(_0x24ec4b,_0x3ca86c){return function(_0xc226d7){if(_0xc226d7){var _0xdb3beb=typeof _0x3ca86c[_0x0389('0x19')]===_0x0389('0x1a')&&typeof _0x3ca86c[_0x0389('0x1b')]===_0x0389('0x1a');var _0x4d89eb=_0xc226d7[_0x0389('0x1c')];var _0x3bda91=_0xdb3beb?0x0:_0x3ca86c['offset'];var _0x59ea28=_0xdb3beb?_0xc226d7['count']:_0x3ca86c['offset']+_0x3ca86c[_0x0389('0x1b')];var _0x1f0022;if(_0x59ea28>=_0x4d89eb){_0x59ea28=_0x4d89eb;_0x1f0022=0xc8;}else{_0x1f0022=0xce;}_0x24ec4b[_0x0389('0x16')](_0x1f0022);return _0x24ec4b[_0x0389('0x1d')](_0x0389('0x1e'),_0x3bda91+'-'+_0x59ea28+'/'+_0x4d89eb)[_0x0389('0x18')](_0xc226d7);}return null;};}function patchUpdates(_0xb805f2){return function(_0x5e3299){try{jsonpatch[_0x0389('0x1f')](_0x5e3299,_0xb805f2,!![]);}catch(_0x5a1560){return BPromise[_0x0389('0x20')](_0x5a1560);}return _0x5e3299[_0x0389('0x21')]();};}function saveUpdates(_0x2fe734,_0x250e7d){return function(_0x5a0dfd){if(_0x5a0dfd){return _0x5a0dfd[_0x0389('0x22')](_0x2fe734)['then'](function(_0x2419b){return _0x2419b;});}return null;};}function removeEntity(_0x30ea2f,_0x418e7f){return function(_0x176961){if(_0x176961){return _0x176961['destroy']()[_0x0389('0x23')](function(){_0x30ea2f[_0x0389('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50e4b8,_0x351a1c){return function(_0x14d5eb){if(!_0x14d5eb){_0x50e4b8[_0x0389('0x24')](0x194);}return _0x14d5eb;};}function handleError(_0x2387fe,_0x4b7bfa){_0x4b7bfa=_0x4b7bfa||0x1f4;return function(_0x5f530f){logger[_0x0389('0x25')](_0x5f530f[_0x0389('0x26')]);if(_0x5f530f[_0x0389('0x27')]){delete _0x5f530f[_0x0389('0x27')];}_0x2387fe[_0x0389('0x16')](_0x4b7bfa)['send'](_0x5f530f);};}exports['index']=function(_0x3bf4ae,_0x2d467a){var _0x429b39={},_0x14eb37={},_0x163790={'count':0x0,'rows':[]};var _0x54bceb=_['map'](db[_0x0389('0x28')][_0x0389('0x29')],function(_0x4672ed){return{'name':_0x4672ed[_0x0389('0x2a')],'type':_0x4672ed['type']['key']};});_0x14eb37['model']=_[_0x0389('0x2b')](_0x54bceb,'name');_0x14eb37[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x3bf4ae[_0x0389('0x2c')]);_0x14eb37['filters']=_[_0x0389('0x2e')](_0x14eb37[_0x0389('0x2f')],_0x14eb37[_0x0389('0x2c')]);_0x429b39['attributes']=_['intersection'](_0x14eb37[_0x0389('0x2f')],qs[_0x0389('0x30')](_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x30')]));_0x429b39[_0x0389('0x31')]=_0x429b39[_0x0389('0x31')]['length']?_0x429b39['attributes']:_0x14eb37[_0x0389('0x2f')];if(!_0x3bf4ae['query']['hasOwnProperty'](_0x0389('0x32'))){_0x429b39[_0x0389('0x1b')]=qs[_0x0389('0x1b')](_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x1b')]);_0x429b39[_0x0389('0x19')]=qs['offset'](_0x3bf4ae[_0x0389('0x2c')]['offset']);}_0x429b39['order']=qs[_0x0389('0x33')](_0x3bf4ae['query'][_0x0389('0x33')]);_0x429b39[_0x0389('0x34')]=qs['filters'](_['pick'](_0x3bf4ae['query'],_0x14eb37[_0x0389('0x35')]),_0x54bceb);if(_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x36')]){_0x429b39['where']=_[_0x0389('0x37')](_0x429b39['where'],{'$or':_['map'](_0x54bceb,function(_0x216910){if(_0x216910['type']!=='VIRTUAL'){var _0x3a34da={};_0x3a34da[_0x216910['name']]={'$like':'%'+_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x36')]+'%'};return _0x3a34da;}})});}_0x429b39=_[_0x0389('0x37')]({},_0x429b39,_0x3bf4ae[_0x0389('0x38')]);var _0x570791={'where':_0x429b39[_0x0389('0x34')]};return db[_0x0389('0x28')]['count'](_0x570791)['then'](function(_0x276fd4){_0x163790[_0x0389('0x1c')]=_0x276fd4;if(_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x39')]){_0x429b39[_0x0389('0x3a')]=[{'all':!![]}];}return db[_0x0389('0x28')][_0x0389('0x3b')](_0x429b39);})[_0x0389('0x23')](function(_0x15f7fb){_0x163790[_0x0389('0x3c')]=_0x15f7fb;return _0x163790;})[_0x0389('0x23')](respondWithFilteredResult(_0x2d467a,_0x429b39))[_0x0389('0x3d')](handleError(_0x2d467a,null));};exports['show']=function(_0x50017d,_0x3ec23c){var _0x34d347={'raw':![],'where':{'id':_0x50017d[_0x0389('0x3e')]['id']}},_0x549b34={};_0x549b34['model']=_['keys'](db[_0x0389('0x28')][_0x0389('0x29')]);_0x549b34[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x50017d[_0x0389('0x2c')]);_0x549b34[_0x0389('0x35')]=_['intersection'](_0x549b34['model'],_0x549b34['query']);_0x34d347[_0x0389('0x31')]=_['intersection'](_0x549b34['model'],qs[_0x0389('0x30')](_0x50017d[_0x0389('0x2c')][_0x0389('0x30')]));_0x34d347[_0x0389('0x31')]=_0x34d347['attributes'][_0x0389('0x3f')]?_0x34d347[_0x0389('0x31')]:_0x549b34[_0x0389('0x2f')];if(_0x50017d[_0x0389('0x2c')]['includeAll']){_0x34d347[_0x0389('0x3a')]=[{'all':!![]}];}_0x34d347=_['merge']({},_0x34d347,_0x50017d[_0x0389('0x38')]);return db['VtigerAccount'][_0x0389('0x40')](_0x34d347)['then'](handleEntityNotFound(_0x3ec23c,null))['then'](respondWithResult(_0x3ec23c,null))[_0x0389('0x3d')](handleError(_0x3ec23c,null));};exports['create']=function(_0x2aa31e,_0x5c3328){return db[_0x0389('0x28')]['create'](_0x2aa31e[_0x0389('0x41')],{})['then'](respondWithResult(_0x5c3328,0xc9))[_0x0389('0x3d')](handleError(_0x5c3328,null));};exports['update']=function(_0x45af62,_0x260c09){if(_0x45af62[_0x0389('0x41')]['id']){delete _0x45af62['body']['id'];}return db['VtigerAccount'][_0x0389('0x40')]({'where':{'id':_0x45af62[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0x260c09,null))[_0x0389('0x23')](saveUpdates(_0x45af62[_0x0389('0x41')],null))[_0x0389('0x23')](respondWithResult(_0x260c09,null))[_0x0389('0x3d')](handleError(_0x260c09,null));};exports['destroy']=function(_0x4135e1,_0x46f636){return db['VtigerAccount']['find']({'where':{'id':_0x4135e1[_0x0389('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46f636,null))['then'](removeEntity(_0x46f636,null))[_0x0389('0x3d')](handleError(_0x46f636,null));};exports[_0x0389('0x42')]=function(_0x5ef59f,_0x45ee22,_0x316c9d){var _0x47a06f={};var _0x28acc8={};var _0x5726fe;var _0x27785c;return db[_0x0389('0x28')][_0x0389('0x43')]({'where':{'id':_0x5ef59f[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0x45ee22,null))['then'](function(_0x1a7720){if(_0x1a7720){_0x5726fe=_0x1a7720;_0x28acc8[_0x0389('0x2f')]=_[_0x0389('0x2d')](db['VtigerConfiguration'][_0x0389('0x29')]);_0x28acc8[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x5ef59f[_0x0389('0x2c')]);_0x28acc8['filters']=_[_0x0389('0x2e')](_0x28acc8[_0x0389('0x2f')],_0x28acc8[_0x0389('0x2c')]);_0x47a06f[_0x0389('0x31')]=_[_0x0389('0x2e')](_0x28acc8['model'],qs['fields'](_0x5ef59f[_0x0389('0x2c')][_0x0389('0x30')]));_0x47a06f[_0x0389('0x31')]=_0x47a06f[_0x0389('0x31')]['length']?_0x47a06f['attributes']:_0x28acc8['model'];_0x47a06f[_0x0389('0x44')]=qs[_0x0389('0x33')](_0x5ef59f['query'][_0x0389('0x33')]);_0x47a06f[_0x0389('0x34')]=qs[_0x0389('0x35')](_[_0x0389('0x45')](_0x5ef59f[_0x0389('0x2c')],_0x28acc8[_0x0389('0x35')]));if(_0x5ef59f[_0x0389('0x2c')][_0x0389('0x36')]){_0x47a06f[_0x0389('0x34')]=_[_0x0389('0x37')](_0x47a06f[_0x0389('0x34')],{'$or':_[_0x0389('0x2b')](_0x47a06f[_0x0389('0x31')],function(_0x26d0e5){var _0x1e45db={};_0x1e45db[_0x26d0e5]={'$like':'%'+_0x5ef59f[_0x0389('0x2c')][_0x0389('0x36')]+'%'};return _0x1e45db;})});}_0x47a06f=_['merge']({},_0x47a06f,_0x5ef59f[_0x0389('0x38')]);return _0x5726fe[_0x0389('0x42')](_0x47a06f);}})[_0x0389('0x23')](function(_0x19e9b0){if(_0x19e9b0){_0x27785c=_0x19e9b0['length'];if(!_0x5ef59f['query'][_0x0389('0x46')](_0x0389('0x32'))){_0x47a06f[_0x0389('0x1b')]=qs[_0x0389('0x1b')](_0x5ef59f['query']['limit']);_0x47a06f[_0x0389('0x19')]=qs[_0x0389('0x19')](_0x5ef59f['query'][_0x0389('0x19')]);}return _0x5726fe[_0x0389('0x42')](_0x47a06f);}})[_0x0389('0x23')](function(_0x3b2230){if(_0x3b2230){return _0x3b2230?{'count':_0x27785c,'rows':_0x3b2230}:null;}})[_0x0389('0x23')](respondWithResult(_0x45ee22,null))['catch'](handleError(_0x45ee22,null));};exports['addConfiguration']=function(_0x38df86,_0xb2db52,_0xff180d){if(_0x38df86[_0x0389('0x41')]['id']){delete _0x38df86[_0x0389('0x41')]['id'];}return db['VtigerAccount'][_0x0389('0x43')]({'where':{'id':_0x38df86[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0xb2db52,null))['then'](function(_0x5613d4){if(_0x5613d4){_0x38df86['body']['AccountId']=_0x5613d4['id'];_0x38df86['body'][_0x0389('0x47')]=integrations[_0x0389('0x48')](_0x38df86['body'][_0x0389('0x49')],_0x38df86['body'][_0x0389('0x4a')]);_0x38df86['body'][_0x0389('0x4b')]=integrations['getDescriptions'](_0x38df86[_0x0389('0x41')]['channel'],_0x38df86[_0x0389('0x41')][_0x0389('0x4a')]);return db['VtigerConfiguration'][_0x0389('0x4c')](_0x38df86[_0x0389('0x41')],{'include':[{'model':db[_0x0389('0x4d')],'as':_0x0389('0x47')},{'model':db[_0x0389('0x4d')],'as':'Descriptions'}]});}return null;})[_0x0389('0x23')](respondWithResult(_0xb2db52,null))[_0x0389('0x3d')](handleError(_0xb2db52,null));};var md5=require('md5');exports[_0x0389('0x4e')]=function(_0x230de6,_0x44078e,_0x165759){var _0x757262=null;var _0xf4a912=null;var _0x108be1=null;var _0x4de000=null;var _0x893ccd='';return db[_0x0389('0x28')][_0x0389('0x43')]({'where':{'id':_0x230de6[_0x0389('0x3e')]['id']},'attributes':['id',_0x0389('0x27'),_0x0389('0x4f'),'description',_0x0389('0x50'),'remoteUri',_0x0389('0x51'),_0x0389('0x52')]})[_0x0389('0x23')](handleEntityNotFound(_0x44078e,null))[_0x0389('0x23')](function(_0x522a78){if(_0x522a78){_0x757262=_0x522a78[_0x0389('0x4f')];_0xf4a912=_0x522a78[_0x0389('0x52')];_0x108be1=_0x522a78[_0x0389('0x50')];_0x893ccd=_0x522a78['remoteUri'];var _0x443305=_0x893ccd[_0x0389('0x53')](-0x1);if(_0x443305==='/'){_0x893ccd=_0x893ccd[_0x0389('0x54')](0x0,_0x893ccd[_0x0389('0x55')](_0x443305));}_0x4de000=util[_0x0389('0x56')](_0x0389('0x57'),_0x893ccd);var _0x4c4b7f={'method':_0x0389('0x58'),'uri':_0x4de000,'qs':{'operation':_0x0389('0x59'),'username':_0x522a78['username']},'json':!![]};return rp(_0x4c4b7f);}})[_0x0389('0x23')](function(_0x46a722){if(_0x46a722[_0x0389('0x5a')]){var _0x200cb5={'method':_0x0389('0x5b'),'uri':_0x4de000,'form':{'operation':'login','username':_0x757262,'accessKey':md5(_0x46a722[_0x0389('0x5c')]['token']+_0xf4a912)},'json':!![]};return rp(_0x200cb5);}})['then'](function(_0x30b1e5){if(_0x30b1e5[_0x0389('0x5a')]){var _0x495e8a={'method':_0x0389('0x58'),'uri':_0x4de000,'qs':{'operation':_0x0389('0x5d'),'username':_0x757262,'sessionName':_0x30b1e5[_0x0389('0x5c')][_0x0389('0x5e')],'elementType':_0x108be1},'json':!![]};return rp(_0x495e8a);}})[_0x0389('0x23')](function(_0xa83ab8){if(_0xa83ab8[_0x0389('0x5a')]){var _0x239313=['autogenerated',_0x0389('0x5f'),_0x0389('0x60')];_[_0x0389('0x61')](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x179ea2){return _0x239313[_0x0389('0x62')](_0x179ea2['type']['name']);});_['remove'](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x4e616){return _0x4e616[_0x0389('0x63')]==='false';});return{'count':_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')][_0x0389('0x3f')],'rows':_[_0x0389('0x2b')](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x2e9e8b){return{'id':_0x2e9e8b[_0x0389('0x27')],'name':_0x2e9e8b[_0x0389('0x64')],'custom':_[_0x0389('0x65')](_0x2e9e8b[_0x0389('0x27')],_0x0389('0x66'))?!![]:![],'options':_0x2e9e8b['type']['name']===_0x0389('0x67')&&_0x2e9e8b[_0x0389('0x4a')][_0x0389('0x68')][_0x0389('0x3f')]>0x0?_[_0x0389('0x2b')](_0x2e9e8b['type']['picklistValues'],function(_0x10da8c){return{'name':_0x10da8c[_0x0389('0x64')],'value':_0x10da8c[_0x0389('0x69')]};}):[]};})};}})[_0x0389('0x23')](respondWithResult(_0x44078e,null))['catch'](function(_0x44f7c4){console[_0x0389('0x6a')](_0x0389('0x6b')+_0x44f7c4);var _0xacd6f7=_0x230de6[_0x0389('0x2c')]['test']?0x1f4:_0x44f7c4[_0x0389('0x6c')]||0x1f4;logger['error'](_0x0389('0x6d'),_0x0389('0x4e'),_0xacd6f7,JSON[_0x0389('0x6e')](_0x44f7c4));delete _0x44f7c4[_0x0389('0x27')];if(_0xacd6f7===0x191){_0xacd6f7=0x190;}_0x44078e['status'](_0xacd6f7)[_0x0389('0x6f')](_0x230de6['query'][_0x0389('0x70')]?{'message':_0x0389('0x71'),'statusCode':_0x44f7c4[_0x0389('0x6c')]}:_0x44f7c4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b36c9dd..3c5aa78 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 _0xa587=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4f7b95,_0x4c9dd3){var _0xb15317=function(_0xe08f0c){while(--_0xe08f0c){_0x4f7b95['push'](_0x4f7b95['shift']());}};_0xb15317(++_0x4c9dd3);}(_0xa587,0x11a));var _0x7a58=function(_0xe45d51,_0x7657e3){_0xe45d51=_0xe45d51-0x0;var _0x5153fe=_0xa587[_0xe45d51];return _0x5153fe;};'use strict';var _=require(_0x7a58('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7a58('0x1'));var moment=require(_0x7a58('0x2'));var BPromise=require(_0x7a58('0x3'));var rp=require(_0x7a58('0x4'));var fs=require('fs');var path=require(_0x7a58('0x5'));var rimraf=require(_0x7a58('0x6'));var config=require(_0x7a58('0x7'));var attributes=require(_0x7a58('0x8'));var integrations=require(_0x7a58('0x9'));module[_0x7a58('0xa')]=function(_0x138085,_0xea3af4){return _0x138085['define']('VtigerAccount',attributes,{'tableName':_0x7a58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1818=['VtigerAccount','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x1818,0x19b));var _0x8181=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x1818[_0x28394f];return _0x2618d2;};'use strict';var _=require('lodash');var util=require(_0x8181('0x0'));var logger=require(_0x8181('0x1'))(_0x8181('0x2'));var moment=require('moment');var BPromise=require(_0x8181('0x3'));var rp=require(_0x8181('0x4'));var fs=require('fs');var path=require(_0x8181('0x5'));var rimraf=require(_0x8181('0x6'));var config=require(_0x8181('0x7'));var attributes=require(_0x8181('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2b628f,_0x381fa4){return _0x2b628f['define'](_0x8181('0x9'),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 7a007ef..8c5549b 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 _0x36ee=['message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowVtigerAccount','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x17000c,_0x12f087){var _0xda656a=function(_0x5108cd){while(--_0x5108cd){_0x17000c['push'](_0x17000c['shift']());}};_0xda656a(++_0x12f087);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')]({'raw':_0x2184ae['options']?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'limit':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')]['limit']||null:null,'include':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x2184ae[_0xe36e('0x1b')]['include'],function(_0x598a7a){return{'model':db[_0x598a7a[_0xe36e('0x21')]],'as':_0x598a7a['as'],'attributes':_0x598a7a[_0xe36e('0x1e')],'include':_0x598a7a[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x598a7a[_0xe36e('0x1f')],function(_0x1507f9){return{'model':db[_0x1507f9[_0xe36e('0x21')]],'as':_0x1507f9['as'],'attributes':_0x1507f9['attributes'],'include':_0x1507f9[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x1507f9[_0xe36e('0x1f')],function(_0x262caa){return{'model':db[_0x262caa['model']],'as':_0x262caa['as'],'attributes':_0x262caa[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7b02e){logger['info'](_0xe36e('0x18'),_0x2184ae);logger['debug'](_0xe36e('0x18'),_0x2184ae,JSON['stringify'](_0xf7b02e));_0x21d9a3(_0xf7b02e);})[_0xe36e('0x17')](function(_0x59548b){logger['error']('GetVtigerAccount',_0x59548b['message'],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0x59548b[_0xe36e('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4ac819){var _0x1fa1ec=this;return new Promise(function(_0xb8d44e,_0x259e19){return db[_0xe36e('0x19')][_0xe36e('0x22')]({'raw':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'include':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')],function(_0xf808f5){return{'model':db[_0xf808f5['model']],'as':_0xf808f5['as'],'attributes':_0xf808f5[_0xe36e('0x1e')],'include':_0xf808f5['include']?_['map'](_0xf808f5[_0xe36e('0x1f')],function(_0x4f620d){return{'model':db[_0x4f620d[_0xe36e('0x21')]],'as':_0x4f620d['as'],'attributes':_0x4f620d[_0xe36e('0x1e')],'include':_0x4f620d[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4f620d['include'],function(_0x56135c){return{'model':db[_0x56135c[_0xe36e('0x21')]],'as':_0x56135c['as'],'attributes':_0x56135c[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe36e('0xc')](function(_0x243338){logger['info'](_0xe36e('0x23'),_0x4ac819);logger[_0xe36e('0xe')](_0xe36e('0x23'),_0x4ac819,JSON['stringify'](_0x243338));_0xb8d44e(_0x243338);})[_0xe36e('0x17')](function(_0x2ff8f4){logger['error'](_0xe36e('0x23'),_0x2ff8f4[_0xe36e('0x14')],_0x4ac819);_0x259e19(_0x1fa1ec[_0xe36e('0x12')](0x1f4,_0x2ff8f4[_0xe36e('0x14')]));});});}; \ No newline at end of file +var _0x065e=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','find','ShowVtigerAccount','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x588f7c,_0x90f955){var _0x3fab30=function(_0x5568b6){while(--_0x5568b6){_0x588f7c['push'](_0x588f7c['shift']());}};_0x3fab30(++_0x90f955);}(_0x065e,0x1a7));var _0xe065=function(_0x4d65e8,_0x5e81ad){_0x4d65e8=_0x4d65e8-0x0;var _0x3cb43f=_0x065e[_0x4d65e8];return _0x3cb43f;};'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')]('VtigerAccount,\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')]('VtigerAccount,\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')]({'raw':_0x1d2f7a['options']?_0x1d2f7a[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')]['where']||null:null,'attributes':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a['options'][_0xe065('0x17')]||null:null,'limit':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x18')]||null:null,'include':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1d2f7a[_0xe065('0x16')]['include'],function(_0x7208af){return{'model':db[_0x7208af[_0xe065('0x1b')]],'as':_0x7208af['as'],'attributes':_0x7208af[_0xe065('0x17')],'include':_0x7208af[_0xe065('0x19')]?_['map'](_0x7208af['include'],function(_0x164965){return{'model':db[_0x164965['model']],'as':_0x164965['as'],'attributes':_0x164965[_0xe065('0x17')],'include':_0x164965[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x164965[_0xe065('0x19')],function(_0x418731){return{'model':db[_0x418731[_0xe065('0x1b')]],'as':_0x418731['as'],'attributes':_0x418731[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x52cd9c){logger['info'](_0xe065('0x13'),_0x1d2f7a);logger[_0xe065('0xc')](_0xe065('0x13'),_0x1d2f7a,JSON[_0xe065('0xe')](_0x52cd9c));_0x14c97c(_0x52cd9c);})['catch'](function(_0x23f573){logger['error']('GetVtigerAccount',_0x23f573[_0xe065('0x11')],_0x1d2f7a);_0x1e7177(_0x397f05[_0xe065('0xf')](0x1f4,_0x23f573[_0xe065('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x883747){var _0x59b915=this;return new Promise(function(_0x12679d,_0x46db7e){return db[_0xe065('0x14')][_0xe065('0x1c')]({'raw':_0x883747['options']?_0x883747[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x883747[_0xe065('0x16')]?_0x883747[_0xe065('0x16')]['where']||null:null,'attributes':_0x883747[_0xe065('0x16')]?_0x883747['options'][_0xe065('0x17')]||null:null,'include':_0x883747['options']?_0x883747[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x883747[_0xe065('0x16')]['include'],function(_0x1fe1dc){return{'model':db[_0x1fe1dc[_0xe065('0x1b')]],'as':_0x1fe1dc['as'],'attributes':_0x1fe1dc[_0xe065('0x17')],'include':_0x1fe1dc[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1fe1dc[_0xe065('0x19')],function(_0x4b822a){return{'model':db[_0x4b822a[_0xe065('0x1b')]],'as':_0x4b822a['as'],'attributes':_0x4b822a[_0xe065('0x17')],'include':_0x4b822a['include']?_[_0xe065('0x1a')](_0x4b822a[_0xe065('0x19')],function(_0x5afc23){return{'model':db[_0x5afc23[_0xe065('0x1b')]],'as':_0x5afc23['as'],'attributes':_0x5afc23[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x35135f){logger['info'](_0xe065('0x1d'),_0x883747);logger['debug'](_0xe065('0x1d'),_0x883747,JSON[_0xe065('0xe')](_0x35135f));_0x12679d(_0x35135f);})[_0xe065('0x1e')](function(_0xcceb12){logger[_0xe065('0xf')](_0xe065('0x1d'),_0xcceb12['message'],_0x883747);_0x46db7e(_0x59b915[_0xe065('0xf')](0x1f4,_0xcceb12[_0xe065('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0495514..d471615 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 _0x9c8b=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0x9c8b,0x8f));var _0xb9c8=function(_0xa99661,_0x310045){_0xa99661=_0xa99661-0x0;var _0x4bee2d=_0x9c8b[_0xa99661];return _0x4bee2d;};'use strict';var multer=require(_0xb9c8('0x0'));var util=require(_0xb9c8('0x1'));var path=require('path');var timeout=require(_0xb9c8('0x2'));var express=require(_0xb9c8('0x3'));var router=express[_0xb9c8('0x4')]();var fs_extra=require(_0xb9c8('0x5'));var auth=require(_0xb9c8('0x6'));var interaction=require(_0xb9c8('0x7'));var config=require(_0xb9c8('0x8'));var controller=require(_0xb9c8('0x9'));router['get']('/',auth[_0xb9c8('0xa')](),controller['index']);router[_0xb9c8('0xb')](_0xb9c8('0xc'),auth[_0xb9c8('0xa')](),controller[_0xb9c8('0xd')]);router[_0xb9c8('0xb')](_0xb9c8('0xe'),auth['isAuthenticated'](),controller[_0xb9c8('0xf')]);router['get']('/:id/subjects',auth[_0xb9c8('0xa')](),controller[_0xb9c8('0x10')]);router[_0xb9c8('0xb')](_0xb9c8('0x11'),auth[_0xb9c8('0xa')](),controller['getDescriptions']);router[_0xb9c8('0x12')]('/',auth[_0xb9c8('0xa')](),controller[_0xb9c8('0x13')]);router[_0xb9c8('0x14')](_0xb9c8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb9c8('0x15')]('/:id',auth[_0xb9c8('0xa')](),controller[_0xb9c8('0x16')]);module[_0xb9c8('0x17')]=router; \ No newline at end of file +var _0x0e9f=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','util','express','Router','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x396543,_0x49155f){var _0x124f7d=function(_0x177404){while(--_0x177404){_0x396543['push'](_0x396543['shift']());}};_0x124f7d(++_0x49155f);}(_0x0e9f,0xf6));var _0xf0e9=function(_0xb2f0d4,_0x2a8baf){_0xb2f0d4=_0xb2f0d4-0x0;var _0x2581eb=_0x0e9f[_0xb2f0d4];return _0x2581eb;};'use strict';var multer=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf0e9('0x2'));var router=express[_0xf0e9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0e9('0x4'));var controller=require(_0xf0e9('0x5'));router[_0xf0e9('0x6')]('/',auth[_0xf0e9('0x7')](),controller[_0xf0e9('0x8')]);router['get'](_0xf0e9('0x9'),auth['isAuthenticated'](),controller[_0xf0e9('0xa')]);router['get'](_0xf0e9('0xb'),auth[_0xf0e9('0x7')](),controller[_0xf0e9('0xc')]);router[_0xf0e9('0x6')](_0xf0e9('0xd'),auth[_0xf0e9('0x7')](),controller['getSubjects']);router[_0xf0e9('0x6')](_0xf0e9('0xe'),auth['isAuthenticated'](),controller[_0xf0e9('0xf')]);router[_0xf0e9('0x10')]('/',auth[_0xf0e9('0x7')](),controller[_0xf0e9('0x11')]);router[_0xf0e9('0x12')](_0xf0e9('0x9'),auth['isAuthenticated'](),controller[_0xf0e9('0x13')]);router[_0xf0e9('0x14')]('/:id',auth[_0xf0e9('0x7')](),controller['destroy']);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 3165554..ea05c03 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 _0x9dc9=['exports','STRING','sequelize'];(function(_0x29d7b1,_0x1b9789){var _0x3e1252=function(_0x4747e7){while(--_0x4747e7){_0x29d7b1['push'](_0x29d7b1['shift']());}};_0x3e1252(++_0x1b9789);}(_0x9dc9,0x158));var _0x99dc=function(_0x3bf747,_0x20352d){_0x3bf747=_0x3bf747-0x0;var _0x425334=_0x9dc9[_0x3bf747];return _0x425334;};'use strict';var Sequelize=require(_0x99dc('0x0'));module[_0x99dc('0x1')]={'name':{'type':Sequelize[_0x99dc('0x2')]},'description':{'type':Sequelize[_0x99dc('0x2')]}}; \ No newline at end of file +var _0xb296=['STRING','exports'];(function(_0x247b59,_0x4eb44b){var _0x4b8714=function(_0x20716d){while(--_0x20716d){_0x247b59['push'](_0x247b59['shift']());}};_0x4b8714(++_0x4eb44b);}(_0xb296,0xc3));var _0x6b29=function(_0x4518f5,_0x1e41a9){_0x4518f5=_0x4518f5-0x0;var _0x26381e=_0xb296[_0x4518f5];return _0x26381e;};'use strict';var Sequelize=require('sequelize');module[_0x6b29('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6b29('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7a44d82..1fa2727 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 _0xf72b=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3c2f8a,_0x1c22a8){var _0x21fdc5=function(_0x360b77){while(--_0x360b77){_0x3c2f8a['push'](_0x3c2f8a['shift']());}};_0x21fdc5(++_0x1c22a8);}(_0xf72b,0x1d9));var _0xbf72=function(_0x4c5b9b,_0x1cbd24){_0x4c5b9b=_0x4c5b9b-0x0;var _0x44aa95=_0xf72b[_0x4c5b9b];return _0x44aa95;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){_0x4c7f3d['status'](0xcc)[_0xbf72('0x27')]();});}};}function handleEntityNotFound(_0x392a8c,_0x1c8b8b){return function(_0x54fdfe){if(!_0x54fdfe){_0x392a8c[_0xbf72('0x19')](0x194);}return _0x54fdfe;};}function handleError(_0xd8fefc,_0x3df816){_0x3df816=_0x3df816||0x1f4;return function(_0x1a2f55){logger[_0xbf72('0x28')](_0x1a2f55[_0xbf72('0x29')]);if(_0x1a2f55[_0xbf72('0x2a')]){delete _0x1a2f55[_0xbf72('0x2a')];}_0xd8fefc[_0xbf72('0x1a')](_0x3df816)[_0xbf72('0x2b')](_0x1a2f55);};}exports[_0xbf72('0x2c')]=function(_0x20e747,_0x4a6ccf){var _0xb648f2={},_0x37a233={},_0x51f481={'count':0x0,'rows':[]};var _0x708fcb=_[_0xbf72('0x2d')](db[_0xbf72('0x2e')][_0xbf72('0x2f')],function(_0xb1ee4e){return{'name':_0xb1ee4e[_0xbf72('0x30')],'type':_0xb1ee4e[_0xbf72('0x31')][_0xbf72('0x32')]};});_0x37a233[_0xbf72('0x33')]=_[_0xbf72('0x2d')](_0x708fcb,_0xbf72('0x2a'));_0x37a233[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x20e747[_0xbf72('0x34')]);_0x37a233['filters']=_[_0xbf72('0x36')](_0x37a233[_0xbf72('0x33')],_0x37a233[_0xbf72('0x34')]);_0xb648f2['attributes']=_['intersection'](_0x37a233['model'],qs[_0xbf72('0x37')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x37')]));_0xb648f2['attributes']=_0xb648f2[_0xbf72('0x38')][_0xbf72('0x39')]?_0xb648f2['attributes']:_0x37a233[_0xbf72('0x33')];if(!_0x20e747['query'][_0xbf72('0x3a')](_0xbf72('0x3b'))){_0xb648f2['limit']=qs['limit'](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1d')]);_0xb648f2[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1c')]);}_0xb648f2[_0xbf72('0x3c')]=qs[_0xbf72('0x3d')](_0x20e747[_0xbf72('0x34')]['sort']);_0xb648f2[_0xbf72('0x3e')]=qs[_0xbf72('0x3f')](_[_0xbf72('0x40')](_0x20e747[_0xbf72('0x34')],_0x37a233['filters']),_0x708fcb);if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x41')]){_0xb648f2['where']=_[_0xbf72('0x42')](_0xb648f2['where'],{'$or':_['map'](_0x708fcb,function(_0x515ae8){if(_0x515ae8['type']!==_0xbf72('0x43')){var _0x4ed723={};_0x4ed723[_0x515ae8['name']]={'$like':'%'+_0x20e747[_0xbf72('0x34')]['filter']+'%'};return _0x4ed723;}})});}_0xb648f2=_[_0xbf72('0x42')]({},_0xb648f2,_0x20e747[_0xbf72('0x44')]);var _0x4bc204={'where':_0xb648f2[_0xbf72('0x3e')]};return db['VtigerConfiguration']['count'](_0x4bc204)[_0xbf72('0x25')](function(_0x13e1d6){_0x51f481[_0xbf72('0x1f')]=_0x13e1d6;if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x45')]){_0xb648f2[_0xbf72('0x46')]=[{'all':!![]}];}return db[_0xbf72('0x2e')][_0xbf72('0x47')](_0xb648f2);})['then'](function(_0x311a0c){_0x51f481[_0xbf72('0x48')]=_0x311a0c;return _0x51f481;})['then'](respondWithFilteredResult(_0x4a6ccf,_0xb648f2))[_0xbf72('0x49')](handleError(_0x4a6ccf,null));};exports['show']=function(_0x5851b8,_0x396ff7){var _0x15e4c7={'raw':![],'where':{'id':_0x5851b8[_0xbf72('0x4a')]['id']}},_0x3992fd={};_0x3992fd[_0xbf72('0x33')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x3992fd[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x5851b8[_0xbf72('0x34')]);_0x3992fd[_0xbf72('0x3f')]=_['intersection'](_0x3992fd['model'],_0x3992fd[_0xbf72('0x34')]);_0x15e4c7['attributes']=_[_0xbf72('0x36')](_0x3992fd[_0xbf72('0x33')],qs[_0xbf72('0x37')](_0x5851b8[_0xbf72('0x34')]['fields']));_0x15e4c7[_0xbf72('0x38')]=_0x15e4c7[_0xbf72('0x38')][_0xbf72('0x39')]?_0x15e4c7[_0xbf72('0x38')]:_0x3992fd['model'];if(_0x5851b8[_0xbf72('0x34')][_0xbf72('0x45')]){_0x15e4c7['include']=[{'all':!![]}];}_0x15e4c7=_[_0xbf72('0x42')]({},_0x15e4c7,_0x5851b8[_0xbf72('0x44')]);return db[_0xbf72('0x2e')][_0xbf72('0x4b')](_0x15e4c7)[_0xbf72('0x25')](handleEntityNotFound(_0x396ff7,null))[_0xbf72('0x25')](respondWithResult(_0x396ff7,null))[_0xbf72('0x49')](handleError(_0x396ff7,null));};exports['create']=function(_0x4ec7eb,_0x5b4bbb){return db[_0xbf72('0x2e')]['create'](_0x4ec7eb[_0xbf72('0x4c')],{})['then'](respondWithResult(_0x5b4bbb,0xc9))['catch'](handleError(_0x5b4bbb,null));};exports['update']=function(_0x9f94ea,_0x15a271){if(_0x9f94ea[_0xbf72('0x4c')]['id']){delete _0x9f94ea[_0xbf72('0x4c')]['id'];}return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x9f94ea['params']['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x15a271,null))['then'](saveUpdates(_0x9f94ea[_0xbf72('0x4c')],null))['then'](respondWithResult(_0x15a271,null))[_0xbf72('0x49')](handleError(_0x15a271,null));};exports[_0xbf72('0x26')]=function(_0x45e4d5,_0x1fd1f8){return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x45e4d5[_0xbf72('0x4a')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x1fd1f8,null))[_0xbf72('0x25')](removeEntity(_0x1fd1f8,null))['catch'](handleError(_0x1fd1f8,null));};exports[_0xbf72('0x4d')]=function(_0x2f9816,_0x46f22e,_0x5cfde1){var _0x312eb6={};var _0x233729={};var _0x1b39e1;var _0x462075;return db[_0xbf72('0x2e')]['findOne']({'where':{'id':_0x2f9816[_0xbf72('0x4a')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x46f22e,null))['then'](function(_0x23b3b9){if(_0x23b3b9){_0x1b39e1=_0x23b3b9;_0x233729['model']=_['keys'](db[_0xbf72('0x4e')][_0xbf72('0x2f')]);_0x233729[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x2f9816[_0xbf72('0x34')]);_0x233729['filters']=_['intersection'](_0x233729['model'],_0x233729[_0xbf72('0x34')]);_0x312eb6[_0xbf72('0x38')]=_[_0xbf72('0x36')](_0x233729[_0xbf72('0x33')],qs['fields'](_0x2f9816['query'][_0xbf72('0x37')]));_0x312eb6[_0xbf72('0x38')]=_0x312eb6[_0xbf72('0x38')]['length']?_0x312eb6[_0xbf72('0x38')]:_0x233729['model'];_0x312eb6[_0xbf72('0x3c')]=qs[_0xbf72('0x3d')](_0x2f9816['query'][_0xbf72('0x3d')]);_0x312eb6[_0xbf72('0x3e')]=qs['filters'](_[_0xbf72('0x40')](_0x2f9816[_0xbf72('0x34')],_0x233729[_0xbf72('0x3f')]));if(_0x2f9816['query']['filter']){_0x312eb6['where']=_[_0xbf72('0x42')](_0x312eb6[_0xbf72('0x3e')],{'$or':_[_0xbf72('0x2d')](_0x312eb6[_0xbf72('0x38')],function(_0x5303ba){var _0x364f82={};_0x364f82[_0x5303ba]={'$like':'%'+_0x2f9816[_0xbf72('0x34')][_0xbf72('0x41')]+'%'};return _0x364f82;})});}_0x312eb6=_[_0xbf72('0x42')]({},_0x312eb6,_0x2f9816['options']);return _0x1b39e1[_0xbf72('0x4d')](_0x312eb6);}})[_0xbf72('0x25')](function(_0x581110){if(_0x581110){_0x462075=_0x581110[_0xbf72('0x39')];if(!_0x2f9816[_0xbf72('0x34')][_0xbf72('0x3a')](_0xbf72('0x3b'))){_0x312eb6[_0xbf72('0x1d')]=qs[_0xbf72('0x1d')](_0x2f9816[_0xbf72('0x34')][_0xbf72('0x1d')]);_0x312eb6[_0xbf72('0x1c')]=qs['offset'](_0x2f9816['query'][_0xbf72('0x1c')]);}return _0x1b39e1[_0xbf72('0x4d')](_0x312eb6);}})[_0xbf72('0x25')](function(_0x26c25c){if(_0x26c25c){return _0x26c25c?{'count':_0x462075,'rows':_0x26c25c}:null;}})[_0xbf72('0x25')](respondWithResult(_0x46f22e,null))[_0xbf72('0x49')](handleError(_0x46f22e,null));};exports[_0xbf72('0x4f')]=function(_0x1817c7,_0x49824f,_0x7ad49e){var _0x2cb706={};var _0x3fe70d={};var _0xe4a99f;var _0x3d51a9;return db[_0xbf72('0x2e')][_0xbf72('0x50')]({'where':{'id':_0x1817c7['params']['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x49824f,null))[_0xbf72('0x25')](function(_0x23550f){if(_0x23550f){_0xe4a99f=_0x23550f;_0x3fe70d[_0xbf72('0x33')]=_[_0xbf72('0x35')](db[_0xbf72('0x4e')][_0xbf72('0x2f')]);_0x3fe70d[_0xbf72('0x34')]=_['keys'](_0x1817c7[_0xbf72('0x34')]);_0x3fe70d[_0xbf72('0x3f')]=_[_0xbf72('0x36')](_0x3fe70d['model'],_0x3fe70d[_0xbf72('0x34')]);_0x2cb706[_0xbf72('0x38')]=_['intersection'](_0x3fe70d[_0xbf72('0x33')],qs[_0xbf72('0x37')](_0x1817c7['query'][_0xbf72('0x37')]));_0x2cb706[_0xbf72('0x38')]=_0x2cb706['attributes'][_0xbf72('0x39')]?_0x2cb706[_0xbf72('0x38')]:_0x3fe70d[_0xbf72('0x33')];_0x2cb706[_0xbf72('0x3c')]=qs[_0xbf72('0x3d')](_0x1817c7[_0xbf72('0x34')][_0xbf72('0x3d')]);_0x2cb706['where']=qs[_0xbf72('0x3f')](_[_0xbf72('0x40')](_0x1817c7['query'],_0x3fe70d[_0xbf72('0x3f')]));if(_0x1817c7['query']['filter']){_0x2cb706[_0xbf72('0x3e')]=_[_0xbf72('0x42')](_0x2cb706[_0xbf72('0x3e')],{'$or':_[_0xbf72('0x2d')](_0x2cb706[_0xbf72('0x38')],function(_0xebd9c0){var _0x50f70c={};_0x50f70c[_0xebd9c0]={'$like':'%'+_0x1817c7[_0xbf72('0x34')][_0xbf72('0x41')]+'%'};return _0x50f70c;})});}_0x2cb706=_[_0xbf72('0x42')]({},_0x2cb706,_0x1817c7[_0xbf72('0x44')]);return _0xe4a99f['getSubjects'](_0x2cb706);}})[_0xbf72('0x25')](function(_0xf4706){if(_0xf4706){_0x3d51a9=_0xf4706[_0xbf72('0x39')];if(!_0x1817c7[_0xbf72('0x34')]['hasOwnProperty'](_0xbf72('0x3b'))){_0x2cb706['limit']=qs[_0xbf72('0x1d')](_0x1817c7[_0xbf72('0x34')][_0xbf72('0x1d')]);_0x2cb706['offset']=qs[_0xbf72('0x1c')](_0x1817c7[_0xbf72('0x34')][_0xbf72('0x1c')]);}return _0xe4a99f[_0xbf72('0x4f')](_0x2cb706);}})[_0xbf72('0x25')](function(_0x7d080a){if(_0x7d080a){return _0x7d080a?{'count':_0x3d51a9,'rows':_0x7d080a}:null;}})[_0xbf72('0x25')](respondWithResult(_0x49824f,null))[_0xbf72('0x49')](handleError(_0x49824f,null));};exports[_0xbf72('0x51')]=function(_0x285a95,_0x9eeeb3,_0x390659){var _0x5a230f={};var _0x760862={};var _0x172688;var _0x94103f;return db['VtigerConfiguration'][_0xbf72('0x50')]({'where':{'id':_0x285a95['params']['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x9eeeb3,null))[_0xbf72('0x25')](function(_0x11cf76){if(_0x11cf76){_0x172688=_0x11cf76;_0x760862[_0xbf72('0x33')]=_[_0xbf72('0x35')](db[_0xbf72('0x4e')]['rawAttributes']);_0x760862[_0xbf72('0x34')]=_['keys'](_0x285a95[_0xbf72('0x34')]);_0x760862['filters']=_[_0xbf72('0x36')](_0x760862[_0xbf72('0x33')],_0x760862[_0xbf72('0x34')]);_0x5a230f[_0xbf72('0x38')]=_[_0xbf72('0x36')](_0x760862[_0xbf72('0x33')],qs[_0xbf72('0x37')](_0x285a95[_0xbf72('0x34')][_0xbf72('0x37')]));_0x5a230f[_0xbf72('0x38')]=_0x5a230f[_0xbf72('0x38')][_0xbf72('0x39')]?_0x5a230f[_0xbf72('0x38')]:_0x760862[_0xbf72('0x33')];_0x5a230f[_0xbf72('0x3c')]=qs['sort'](_0x285a95['query'][_0xbf72('0x3d')]);_0x5a230f['where']=qs[_0xbf72('0x3f')](_[_0xbf72('0x40')](_0x285a95['query'],_0x760862[_0xbf72('0x3f')]));if(_0x285a95[_0xbf72('0x34')][_0xbf72('0x41')]){_0x5a230f['where']=_[_0xbf72('0x42')](_0x5a230f['where'],{'$or':_[_0xbf72('0x2d')](_0x5a230f[_0xbf72('0x38')],function(_0x5308c3){var _0x2e0923={};_0x2e0923[_0x5308c3]={'$like':'%'+_0x285a95[_0xbf72('0x34')][_0xbf72('0x41')]+'%'};return _0x2e0923;})});}_0x5a230f=_[_0xbf72('0x42')]({},_0x5a230f,_0x285a95[_0xbf72('0x44')]);return _0x172688[_0xbf72('0x51')](_0x5a230f);}})[_0xbf72('0x25')](function(_0x205a81){if(_0x205a81){_0x94103f=_0x205a81['length'];if(!_0x285a95['query'][_0xbf72('0x3a')](_0xbf72('0x3b'))){_0x5a230f[_0xbf72('0x1d')]=qs['limit'](_0x285a95[_0xbf72('0x34')]['limit']);_0x5a230f[_0xbf72('0x1c')]=qs['offset'](_0x285a95[_0xbf72('0x34')][_0xbf72('0x1c')]);}return _0x172688[_0xbf72('0x51')](_0x5a230f);}})['then'](function(_0x311478){if(_0x311478){return _0x311478?{'count':_0x94103f,'rows':_0x311478}:null;}})[_0xbf72('0x25')](respondWithResult(_0x9eeeb3,null))['catch'](handleError(_0x9eeeb3,null));}; \ No newline at end of file +var _0x7edc=['undefined','count','offset','limit','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','merge','filter','includeAll','findAll','rows','intersection','include','options','body','find','params','catch','getFields','findOne','VtigerField','rawAttributes','nolimit','getSubjects','pick','getDescriptions','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1fc091,_0x4a43a0){var _0x22a409=function(_0x593407){while(--_0x593407){_0x1fc091['push'](_0x1fc091['shift']());}};_0x22a409(++_0x4a43a0);}(_0x7edc,0x7e));var _0xc7ed=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7edc[_0x2085f3];return _0x384e3c;};'use strict';var emlformat=require(_0xc7ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc7ed('0x1'));var rp=require(_0xc7ed('0x2'));var moment=require(_0xc7ed('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7ed('0x4'));var path=require(_0xc7ed('0x5'));var sox=require(_0xc7ed('0x6'));var csv=require(_0xc7ed('0x7'));var ejs=require(_0xc7ed('0x8'));var fs=require('fs');var fs_extra=require(_0xc7ed('0x9'));var _=require(_0xc7ed('0xa'));var squel=require(_0xc7ed('0xb'));var crypto=require(_0xc7ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc7ed('0xd'));var toCsv=require(_0xc7ed('0x7'));var querystring=require(_0xc7ed('0xe'));var Papa=require(_0xc7ed('0xf'));var Redis=require(_0xc7ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc7ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7ed('0x12'));var logger=require('../../config/logger')(_0xc7ed('0x13'));var utils=require(_0xc7ed('0x14'));var config=require(_0xc7ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ed('0x16'))['db'];function respondWithStatusCode(_0x5926f4,_0x1db270){_0x1db270=_0x1db270||0xcc;return function(_0x5d6e05){if(_0x5d6e05){return _0x5926f4[_0xc7ed('0x17')](_0x1db270);}return _0x5926f4[_0xc7ed('0x18')](_0x1db270)[_0xc7ed('0x19')]();};}function respondWithResult(_0x59674d,_0x27c0d2){_0x27c0d2=_0x27c0d2||0xc8;return function(_0x43474b){if(_0x43474b){return _0x59674d[_0xc7ed('0x18')](_0x27c0d2)['json'](_0x43474b);}};}function respondWithFilteredResult(_0x1dea6d,_0x535bab){return function(_0x8f897b){if(_0x8f897b){var _0x1734c2=typeof _0x535bab['offset']===_0xc7ed('0x1a')&&typeof _0x535bab['limit']===_0xc7ed('0x1a');var _0x463059=_0x8f897b[_0xc7ed('0x1b')];var _0x402cec=_0x1734c2?0x0:_0x535bab[_0xc7ed('0x1c')];var _0x2de273=_0x1734c2?_0x8f897b[_0xc7ed('0x1b')]:_0x535bab[_0xc7ed('0x1c')]+_0x535bab[_0xc7ed('0x1d')];var _0x5bd358;if(_0x2de273>=_0x463059){_0x2de273=_0x463059;_0x5bd358=0xc8;}else{_0x5bd358=0xce;}_0x1dea6d[_0xc7ed('0x18')](_0x5bd358);return _0x1dea6d['set'](_0xc7ed('0x1e'),_0x402cec+'-'+_0x2de273+'/'+_0x463059)[_0xc7ed('0x1f')](_0x8f897b);}return null;};}function patchUpdates(_0xcfc711){return function(_0x3c150e){try{jsonpatch['apply'](_0x3c150e,_0xcfc711,!![]);}catch(_0xce6fba){return BPromise['reject'](_0xce6fba);}return _0x3c150e['save']();};}function saveUpdates(_0x30bcff,_0x2baae7){return function(_0x1c1121){if(_0x1c1121){return _0x1c1121[_0xc7ed('0x20')](_0x30bcff)[_0xc7ed('0x21')](function(_0x2a6919){return _0x2a6919;});}return null;};}function removeEntity(_0x52b6f4,_0x50a9d0){return function(_0x3fccb2){if(_0x3fccb2){return _0x3fccb2[_0xc7ed('0x22')]()[_0xc7ed('0x21')](function(){_0x52b6f4[_0xc7ed('0x18')](0xcc)[_0xc7ed('0x19')]();});}};}function handleEntityNotFound(_0x4214cc,_0x43082){return function(_0xd96f1c){if(!_0xd96f1c){_0x4214cc[_0xc7ed('0x17')](0x194);}return _0xd96f1c;};}function handleError(_0x52803a,_0x5e71b6){_0x5e71b6=_0x5e71b6||0x1f4;return function(_0x435218){logger[_0xc7ed('0x23')](_0x435218[_0xc7ed('0x24')]);if(_0x435218[_0xc7ed('0x25')]){delete _0x435218[_0xc7ed('0x25')];}_0x52803a[_0xc7ed('0x18')](_0x5e71b6)[_0xc7ed('0x26')](_0x435218);};}exports[_0xc7ed('0x27')]=function(_0x245b6f,_0xacfe0f){var _0x92ce4e={},_0x1ba7a1={},_0x1ada66={'count':0x0,'rows':[]};var _0x774b8c=_[_0xc7ed('0x28')](db[_0xc7ed('0x29')]['rawAttributes'],function(_0x2f8bbd){return{'name':_0x2f8bbd[_0xc7ed('0x2a')],'type':_0x2f8bbd[_0xc7ed('0x2b')][_0xc7ed('0x2c')]};});_0x1ba7a1['model']=_[_0xc7ed('0x28')](_0x774b8c,_0xc7ed('0x25'));_0x1ba7a1[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x245b6f['query']);_0x1ba7a1[_0xc7ed('0x2f')]=_['intersection'](_0x1ba7a1[_0xc7ed('0x30')],_0x1ba7a1[_0xc7ed('0x2d')]);_0x92ce4e['attributes']=_['intersection'](_0x1ba7a1[_0xc7ed('0x30')],qs[_0xc7ed('0x31')](_0x245b6f['query']['fields']));_0x92ce4e['attributes']=_0x92ce4e[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x92ce4e['attributes']:_0x1ba7a1[_0xc7ed('0x30')];if(!_0x245b6f['query'][_0xc7ed('0x34')]('nolimit')){_0x92ce4e[_0xc7ed('0x1d')]=qs[_0xc7ed('0x1d')](_0x245b6f[_0xc7ed('0x2d')]['limit']);_0x92ce4e[_0xc7ed('0x1c')]=qs['offset'](_0x245b6f[_0xc7ed('0x2d')]['offset']);}_0x92ce4e[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x245b6f[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0x92ce4e[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x245b6f['query'],_0x1ba7a1['filters']),_0x774b8c);if(_0x245b6f['query']['filter']){_0x92ce4e[_0xc7ed('0x37')]=_[_0xc7ed('0x38')](_0x92ce4e[_0xc7ed('0x37')],{'$or':_[_0xc7ed('0x28')](_0x774b8c,function(_0x864365){if(_0x864365[_0xc7ed('0x2b')]!=='VIRTUAL'){var _0x3106c5={};_0x3106c5[_0x864365[_0xc7ed('0x25')]]={'$like':'%'+_0x245b6f[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x3106c5;}})});}_0x92ce4e=_[_0xc7ed('0x38')]({},_0x92ce4e,_0x245b6f['options']);var _0x3af6bd={'where':_0x92ce4e['where']};return db['VtigerConfiguration'][_0xc7ed('0x1b')](_0x3af6bd)[_0xc7ed('0x21')](function(_0x3ab415){_0x1ada66[_0xc7ed('0x1b')]=_0x3ab415;if(_0x245b6f['query'][_0xc7ed('0x3a')]){_0x92ce4e['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc7ed('0x3b')](_0x92ce4e);})[_0xc7ed('0x21')](function(_0x56a901){_0x1ada66[_0xc7ed('0x3c')]=_0x56a901;return _0x1ada66;})[_0xc7ed('0x21')](respondWithFilteredResult(_0xacfe0f,_0x92ce4e))['catch'](handleError(_0xacfe0f,null));};exports['show']=function(_0x11c896,_0x4457b4){var _0x27b7d1={'raw':![],'where':{'id':_0x11c896['params']['id']}},_0x109453={};_0x109453[_0xc7ed('0x30')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x109453['query']=_['keys'](_0x11c896[_0xc7ed('0x2d')]);_0x109453[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x109453[_0xc7ed('0x30')],_0x109453[_0xc7ed('0x2d')]);_0x27b7d1[_0xc7ed('0x32')]=_[_0xc7ed('0x3d')](_0x109453[_0xc7ed('0x30')],qs['fields'](_0x11c896['query'][_0xc7ed('0x31')]));_0x27b7d1[_0xc7ed('0x32')]=_0x27b7d1[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x27b7d1[_0xc7ed('0x32')]:_0x109453[_0xc7ed('0x30')];if(_0x11c896[_0xc7ed('0x2d')][_0xc7ed('0x3a')]){_0x27b7d1[_0xc7ed('0x3e')]=[{'all':!![]}];}_0x27b7d1=_[_0xc7ed('0x38')]({},_0x27b7d1,_0x11c896[_0xc7ed('0x3f')]);return db[_0xc7ed('0x29')]['find'](_0x27b7d1)['then'](handleEntityNotFound(_0x4457b4,null))['then'](respondWithResult(_0x4457b4,null))['catch'](handleError(_0x4457b4,null));};exports['create']=function(_0x5d2c54,_0x3eacc2){return db[_0xc7ed('0x29')]['create'](_0x5d2c54[_0xc7ed('0x40')],{})['then'](respondWithResult(_0x3eacc2,0xc9))['catch'](handleError(_0x3eacc2,null));};exports[_0xc7ed('0x20')]=function(_0x371b5c,_0x22e893){if(_0x371b5c[_0xc7ed('0x40')]['id']){delete _0x371b5c[_0xc7ed('0x40')]['id'];}return db[_0xc7ed('0x29')][_0xc7ed('0x41')]({'where':{'id':_0x371b5c[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x22e893,null))[_0xc7ed('0x21')](saveUpdates(_0x371b5c['body'],null))[_0xc7ed('0x21')](respondWithResult(_0x22e893,null))['catch'](handleError(_0x22e893,null));};exports[_0xc7ed('0x22')]=function(_0x347aeb,_0x185a29){return db['VtigerConfiguration']['find']({'where':{'id':_0x347aeb['params']['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x185a29,null))[_0xc7ed('0x21')](removeEntity(_0x185a29,null))[_0xc7ed('0x43')](handleError(_0x185a29,null));};exports[_0xc7ed('0x44')]=function(_0x48ae28,_0x1c06e5,_0x328815){var _0x163d2d={};var _0x5d30aa={};var _0x812023;var _0x127f8c;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x48ae28['params']['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x1c06e5,null))[_0xc7ed('0x21')](function(_0x45c2dd){if(_0x45c2dd){_0x812023=_0x45c2dd;_0x5d30aa['model']=_['keys'](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x5d30aa[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x48ae28[_0xc7ed('0x2d')]);_0x5d30aa['filters']=_['intersection'](_0x5d30aa[_0xc7ed('0x30')],_0x5d30aa[_0xc7ed('0x2d')]);_0x163d2d['attributes']=_[_0xc7ed('0x3d')](_0x5d30aa[_0xc7ed('0x30')],qs['fields'](_0x48ae28[_0xc7ed('0x2d')]['fields']));_0x163d2d['attributes']=_0x163d2d[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x163d2d[_0xc7ed('0x32')]:_0x5d30aa[_0xc7ed('0x30')];_0x163d2d[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x48ae28[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0x163d2d[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x48ae28['query'],_0x5d30aa[_0xc7ed('0x2f')]));if(_0x48ae28['query'][_0xc7ed('0x39')]){_0x163d2d['where']=_['merge'](_0x163d2d['where'],{'$or':_['map'](_0x163d2d[_0xc7ed('0x32')],function(_0x2f3396){var _0x20803f={};_0x20803f[_0x2f3396]={'$like':'%'+_0x48ae28[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x20803f;})});}_0x163d2d=_[_0xc7ed('0x38')]({},_0x163d2d,_0x48ae28[_0xc7ed('0x3f')]);return _0x812023[_0xc7ed('0x44')](_0x163d2d);}})['then'](function(_0x130cfb){if(_0x130cfb){_0x127f8c=_0x130cfb[_0xc7ed('0x33')];if(!_0x48ae28['query']['hasOwnProperty'](_0xc7ed('0x48'))){_0x163d2d[_0xc7ed('0x1d')]=qs['limit'](_0x48ae28['query'][_0xc7ed('0x1d')]);_0x163d2d['offset']=qs['offset'](_0x48ae28[_0xc7ed('0x2d')]['offset']);}return _0x812023['getFields'](_0x163d2d);}})['then'](function(_0x33feec){if(_0x33feec){return _0x33feec?{'count':_0x127f8c,'rows':_0x33feec}:null;}})['then'](respondWithResult(_0x1c06e5,null))[_0xc7ed('0x43')](handleError(_0x1c06e5,null));};exports[_0xc7ed('0x49')]=function(_0x598e32,_0x3a3251,_0x2d49b8){var _0xb3d0a8={};var _0x53cae8={};var _0x1b798c;var _0x7ed754;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x598e32[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x3a3251,null))['then'](function(_0x2e80d1){if(_0x2e80d1){_0x1b798c=_0x2e80d1;_0x53cae8[_0xc7ed('0x30')]=_[_0xc7ed('0x2e')](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x53cae8[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x598e32[_0xc7ed('0x2d')]);_0x53cae8[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x53cae8['model'],_0x53cae8[_0xc7ed('0x2d')]);_0xb3d0a8[_0xc7ed('0x32')]=_['intersection'](_0x53cae8[_0xc7ed('0x30')],qs['fields'](_0x598e32[_0xc7ed('0x2d')]['fields']));_0xb3d0a8[_0xc7ed('0x32')]=_0xb3d0a8[_0xc7ed('0x32')]['length']?_0xb3d0a8[_0xc7ed('0x32')]:_0x53cae8['model'];_0xb3d0a8['order']=qs[_0xc7ed('0x36')](_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0xb3d0a8[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x598e32[_0xc7ed('0x2d')],_0x53cae8['filters']));if(_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x39')]){_0xb3d0a8[_0xc7ed('0x37')]=_['merge'](_0xb3d0a8[_0xc7ed('0x37')],{'$or':_[_0xc7ed('0x28')](_0xb3d0a8[_0xc7ed('0x32')],function(_0xe4411f){var _0x2fb945={};_0x2fb945[_0xe4411f]={'$like':'%'+_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x2fb945;})});}_0xb3d0a8=_[_0xc7ed('0x38')]({},_0xb3d0a8,_0x598e32['options']);return _0x1b798c[_0xc7ed('0x49')](_0xb3d0a8);}})['then'](function(_0x2c2701){if(_0x2c2701){_0x7ed754=_0x2c2701[_0xc7ed('0x33')];if(!_0x598e32[_0xc7ed('0x2d')]['hasOwnProperty'](_0xc7ed('0x48'))){_0xb3d0a8['limit']=qs[_0xc7ed('0x1d')](_0x598e32['query'][_0xc7ed('0x1d')]);_0xb3d0a8[_0xc7ed('0x1c')]=qs['offset'](_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x1c')]);}return _0x1b798c[_0xc7ed('0x49')](_0xb3d0a8);}})[_0xc7ed('0x21')](function(_0x31c08f){if(_0x31c08f){return _0x31c08f?{'count':_0x7ed754,'rows':_0x31c08f}:null;}})['then'](respondWithResult(_0x3a3251,null))[_0xc7ed('0x43')](handleError(_0x3a3251,null));};exports['getDescriptions']=function(_0x3b1ccb,_0x429cb3,_0x353c53){var _0x1fc993={};var _0x5221bf={};var _0x498995;var _0x20788e;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x3b1ccb[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x429cb3,null))['then'](function(_0x47dd99){if(_0x47dd99){_0x498995=_0x47dd99;_0x5221bf[_0xc7ed('0x30')]=_[_0xc7ed('0x2e')](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x5221bf[_0xc7ed('0x2d')]=_['keys'](_0x3b1ccb['query']);_0x5221bf[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x5221bf['model'],_0x5221bf[_0xc7ed('0x2d')]);_0x1fc993[_0xc7ed('0x32')]=_[_0xc7ed('0x3d')](_0x5221bf['model'],qs[_0xc7ed('0x31')](_0x3b1ccb[_0xc7ed('0x2d')]['fields']));_0x1fc993[_0xc7ed('0x32')]=_0x1fc993[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x1fc993[_0xc7ed('0x32')]:_0x5221bf['model'];_0x1fc993[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x3b1ccb['query'][_0xc7ed('0x36')]);_0x1fc993[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_[_0xc7ed('0x4a')](_0x3b1ccb[_0xc7ed('0x2d')],_0x5221bf[_0xc7ed('0x2f')]));if(_0x3b1ccb['query'][_0xc7ed('0x39')]){_0x1fc993[_0xc7ed('0x37')]=_[_0xc7ed('0x38')](_0x1fc993[_0xc7ed('0x37')],{'$or':_['map'](_0x1fc993[_0xc7ed('0x32')],function(_0x20537d){var _0x925b6f={};_0x925b6f[_0x20537d]={'$like':'%'+_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x925b6f;})});}_0x1fc993=_[_0xc7ed('0x38')]({},_0x1fc993,_0x3b1ccb[_0xc7ed('0x3f')]);return _0x498995[_0xc7ed('0x4b')](_0x1fc993);}})[_0xc7ed('0x21')](function(_0x155797){if(_0x155797){_0x20788e=_0x155797[_0xc7ed('0x33')];if(!_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x34')](_0xc7ed('0x48'))){_0x1fc993[_0xc7ed('0x1d')]=qs[_0xc7ed('0x1d')](_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x1d')]);_0x1fc993[_0xc7ed('0x1c')]=qs[_0xc7ed('0x1c')](_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x1c')]);}return _0x498995['getDescriptions'](_0x1fc993);}})['then'](function(_0x49cd2d){if(_0x49cd2d){return _0x49cd2d?{'count':_0x20788e,'rows':_0x49cd2d}:null;}})['then'](respondWithResult(_0x429cb3,null))[_0xc7ed('0x43')](handleError(_0x429cb3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index c7dd318..4824d83 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 _0x1739=['VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1739,0x146));var _0x9173=function(_0x143f3b,_0x3cff7e){_0x143f3b=_0x143f3b-0x0;var _0x4e5fc2=_0x1739[_0x143f3b];return _0x4e5fc2;};'use strict';var _=require(_0x9173('0x0'));var util=require('util');var logger=require(_0x9173('0x1'))(_0x9173('0x2'));var moment=require(_0x9173('0x3'));var BPromise=require(_0x9173('0x4'));var rp=require(_0x9173('0x5'));var fs=require('fs');var path=require(_0x9173('0x6'));var rimraf=require('rimraf');var config=require(_0x9173('0x7'));var attributes=require(_0x9173('0x8'));module[_0x9173('0x9')]=function(_0x36d653,_0x1216a5){return _0x36d653['define'](_0x9173('0xa'),attributes,{'tableName':_0x9173('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x774b=['rimraf','../../config/environment','define','VtigerConfiguration','lodash','util','../../config/logger','moment','path'];(function(_0x3e2f31,_0x9d498){var _0x59a738=function(_0x42d2e5){while(--_0x42d2e5){_0x3e2f31['push'](_0x3e2f31['shift']());}};_0x59a738(++_0x9d498);}(_0x774b,0xc1));var _0xb774=function(_0x474964,_0x4be4f7){_0x474964=_0x474964-0x0;var _0x18e819=_0x774b[_0x474964];return _0x18e819;};'use strict';var _=require(_0xb774('0x0'));var util=require(_0xb774('0x1'));var logger=require(_0xb774('0x2'))('api');var moment=require(_0xb774('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb774('0x4'));var rimraf=require(_0xb774('0x5'));var config=require(_0xb774('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x4b6dea,_0x346000){return _0x4b6dea[_0xb774('0x7')](_0xb774('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 5ed4b76..efc0a0a 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 _0x9d75=['jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','rpc'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9d75,0x14e));var _0x59d7=function(_0x461206,_0x1745e3){_0x461206=_0x461206-0x0;var _0x317e8e=_0x9d75[_0x461206];return _0x317e8e;};'use strict';var _=require(_0x59d7('0x0'));var util=require(_0x59d7('0x1'));var moment=require('moment');var BPromise=require(_0x59d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x59d7('0x4'));var logger=require('../../config/logger')(_0x59d7('0x5'));var config=require('../../config/environment');var jayson=require(_0x59d7('0x6'));var client=jayson[_0x59d7('0x7')][_0x59d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c48cf,_0xdd8009,_0x4edfc3){return new BPromise(function(_0x4acc69,_0x1527ce){return client[_0x59d7('0x9')](_0x5c48cf,_0x4edfc3)['then'](function(_0x44fb6e){logger[_0x59d7('0xa')](_0x59d7('0xb'),_0xdd8009,'request\x20sent');logger[_0x59d7('0xc')](_0x59d7('0xd'),_0xdd8009,_0x59d7('0xe'),JSON[_0x59d7('0xf')](_0x44fb6e));if(_0x44fb6e[_0x59d7('0x10')]){if(_0x44fb6e[_0x59d7('0x10')][_0x59d7('0x11')]===0x1f4){logger[_0x59d7('0x10')](_0x59d7('0xb'),_0xdd8009,_0x44fb6e[_0x59d7('0x10')][_0x59d7('0x12')]);return _0x1527ce(_0x44fb6e[_0x59d7('0x10')]['message']);}logger['error'](_0x59d7('0xb'),_0xdd8009,_0x44fb6e['error']['message']);return _0x4acc69(_0x44fb6e[_0x59d7('0x10')][_0x59d7('0x12')]);}else{logger['info'](_0x59d7('0xb'),_0xdd8009,_0x59d7('0xe'));_0x4acc69(_0x44fb6e[_0x59d7('0x13')][_0x59d7('0x12')]);}})['catch'](function(_0x203c9a){logger['error'](_0x59d7('0xb'),_0xdd8009,_0x203c9a);_0x1527ce(_0x203c9a);});});} \ No newline at end of file +var _0x42be=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x41e5bb,_0xbae913){var _0x221055=function(_0x10f0b5){while(--_0x10f0b5){_0x41e5bb['push'](_0x41e5bb['shift']());}};_0x221055(++_0xbae913);}(_0x42be,0x11a));var _0xe42b=function(_0x37011d,_0x4d6234){_0x37011d=_0x37011d-0x0;var _0xb86273=_0x42be[_0x37011d];return _0xb86273;};'use strict';var _=require(_0xe42b('0x0'));var util=require(_0xe42b('0x1'));var moment=require(_0xe42b('0x2'));var BPromise=require(_0xe42b('0x3'));var rs=require(_0xe42b('0x4'));var fs=require('fs');var Redis=require(_0xe42b('0x5'));var db=require(_0xe42b('0x6'))['db'];var utils=require(_0xe42b('0x7'));var logger=require(_0xe42b('0x8'))('rpc');var config=require(_0xe42b('0x9'));var jayson=require(_0xe42b('0xa'));var client=jayson['client'][_0xe42b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ceb88,_0x4090bf,_0xd228ce){return new BPromise(function(_0x402cd1,_0x2aa88b){return client[_0xe42b('0xc')](_0x1ceb88,_0xd228ce)['then'](function(_0x3f9bcf){logger[_0xe42b('0xd')](_0xe42b('0xe'),_0x4090bf,_0xe42b('0xf'));logger[_0xe42b('0x10')](_0xe42b('0x11'),_0x4090bf,_0xe42b('0xf'),JSON[_0xe42b('0x12')](_0x3f9bcf));if(_0x3f9bcf['error']){if(_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x14')]===0x1f4){logger[_0xe42b('0x13')](_0xe42b('0xe'),_0x4090bf,_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);return _0x2aa88b(_0x3f9bcf['error'][_0xe42b('0x15')]);}logger['error'](_0xe42b('0xe'),_0x4090bf,_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);return _0x402cd1(_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);}else{logger[_0xe42b('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4090bf,'request\x20sent');_0x402cd1(_0x3f9bcf['result'][_0xe42b('0x15')]);}})['catch'](function(_0x5777c1){logger[_0xe42b('0x13')](_0xe42b('0xe'),_0x4090bf,_0x5777c1);_0x2aa88b(_0x5777c1);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index abf759a..eb1eecf 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 _0x031e=['../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','post','create','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47f8bd,_0x238079){var _0x405d7e=function(_0x5717b1){while(--_0x5717b1){_0x47f8bd['push'](_0x47f8bd['shift']());}};_0x405d7e(++_0x238079);}(_0x031e,0x89));var _0xe031=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x031e[_0x263f9d];return _0x4c4efa;};'use strict';var multer=require('multer');var util=require(_0xe031('0x0'));var path=require(_0xe031('0x1'));var timeout=require(_0xe031('0x2'));var express=require('express');var router=express[_0xe031('0x3')]();var fs_extra=require(_0xe031('0x4'));var auth=require(_0xe031('0x5'));var interaction=require(_0xe031('0x6'));var config=require(_0xe031('0x7'));var controller=require(_0xe031('0x8'));router[_0xe031('0x9')]('/',auth[_0xe031('0xa')](),controller['index']);router[_0xe031('0x9')]('/:id',auth[_0xe031('0xa')](),controller[_0xe031('0xb')]);router[_0xe031('0xc')]('/',auth['isAuthenticated'](),controller[_0xe031('0xd')]);router['put'](_0xe031('0xe'),auth['isAuthenticated'](),controller[_0xe031('0xf')]);router['delete'](_0xe031('0xe'),auth[_0xe031('0xa')](),controller[_0xe031('0x10')]);module[_0xe031('0x11')]=router; \ No newline at end of file +var _0x280c=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','create','put','update','delete'];(function(_0xae7883,_0xabf9c8){var _0xd55326=function(_0x51fb2f){while(--_0x51fb2f){_0xae7883['push'](_0xae7883['shift']());}};_0xd55326(++_0xabf9c8);}(_0x280c,0xe1));var _0xc280=function(_0xa79dc4,_0x5cb28a){_0xa79dc4=_0xa79dc4-0x0;var _0x170a44=_0x280c[_0xa79dc4];return _0x170a44;};'use strict';var multer=require('multer');var util=require(_0xc280('0x0'));var path=require(_0xc280('0x1'));var timeout=require('connect-timeout');var express=require(_0xc280('0x2'));var router=express[_0xc280('0x3')]();var fs_extra=require(_0xc280('0x4'));var auth=require(_0xc280('0x5'));var interaction=require(_0xc280('0x6'));var config=require(_0xc280('0x7'));var controller=require(_0xc280('0x8'));router['get']('/',auth[_0xc280('0x9')](),controller['index']);router['get'](_0xc280('0xa'),auth[_0xc280('0x9')](),controller['show']);router['post']('/',auth[_0xc280('0x9')](),controller[_0xc280('0xb')]);router[_0xc280('0xc')](_0xc280('0xa'),auth[_0xc280('0x9')](),controller[_0xc280('0xd')]);router[_0xc280('0xe')](_0xc280('0xa'),auth[_0xc280('0x9')](),controller[_0xc280('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 87547bb..abc502a 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 _0x9f78=['keyValue','STRING','sequelize','exports','ENUM','string','customVariable'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0x9f78,0x1c2));var _0x89f7=function(_0x3cbcde,_0x26313c){_0x3cbcde=_0x3cbcde-0x0;var _0x25cef0=_0x9f78[_0x3cbcde];return _0x25cef0;};'use strict';var Sequelize=require(_0x89f7('0x0'));module[_0x89f7('0x1')]={'type':{'type':Sequelize[_0x89f7('0x2')](_0x89f7('0x3'),'variable',_0x89f7('0x4'),_0x89f7('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x89f7('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x89f7('0x2')](_0x89f7('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x89f7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x89f7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x89f7('0x6')]}}; \ No newline at end of file +var _0x9e51=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9e51,0x176));var _0x19e5=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9e51[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x19e5('0x0'));module['exports']={'type':{'type':Sequelize[_0x19e5('0x1')](_0x19e5('0x2'),_0x19e5('0x3'),_0x19e5('0x4'),'keyValue',_0x19e5('0x5')),'defaultValue':_0x19e5('0x2')},'content':{'type':Sequelize[_0x19e5('0x6')]},'key':{'type':Sequelize[_0x19e5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x19e5('0x2'),_0x19e5('0x3'),_0x19e5('0x4'))},'keyContent':{'type':Sequelize[_0x19e5('0x6')]},'idField':{'type':Sequelize[_0x19e5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x19e5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 2ab2e26..ef96a89 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 _0xdb7a=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xdb7a,0x119));var _0xadb7=function(_0x2b41d8,_0x52ca6f){_0x2b41d8=_0x2b41d8-0x0;var _0x27f7e5=_0xdb7a[_0x2b41d8];return _0x27f7e5;};'use strict';var emlformat=require(_0xadb7('0x0'));var rimraf=require(_0xadb7('0x1'));var zipdir=require(_0xadb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadb7('0x3'));var moment=require('moment');var BPromise=require(_0xadb7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xadb7('0x5'));var sox=require(_0xadb7('0x6'));var csv=require(_0xadb7('0x7'));var ejs=require(_0xadb7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xadb7('0x9'));var crypto=require(_0xadb7('0xa'));var jsforce=require(_0xadb7('0xb'));var deskjs=require(_0xadb7('0xc'));var toCsv=require(_0xadb7('0x7'));var querystring=require('querystring');var Papa=require(_0xadb7('0xd'));var Redis=require(_0xadb7('0xe'));var authService=require(_0xadb7('0xf'));var qs=require(_0xadb7('0x10'));var as=require(_0xadb7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadb7('0x12'))(_0xadb7('0x13'));var utils=require(_0xadb7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xadb7('0x15'));var db=require(_0xadb7('0x16'))['db'];function respondWithStatusCode(_0x5d6478,_0xa38e09){_0xa38e09=_0xa38e09||0xcc;return function(_0x2d97b8){if(_0x2d97b8){return _0x5d6478[_0xadb7('0x17')](_0xa38e09);}return _0x5d6478[_0xadb7('0x18')](_0xa38e09)[_0xadb7('0x19')]();};}function respondWithResult(_0x105b70,_0x3881a9){_0x3881a9=_0x3881a9||0xc8;return function(_0x3d2fff){if(_0x3d2fff){return _0x105b70[_0xadb7('0x18')](_0x3881a9)[_0xadb7('0x1a')](_0x3d2fff);}};}function respondWithFilteredResult(_0x5b1c9b,_0xf7d947){return function(_0x457d56){if(_0x457d56){var _0x521ae5=typeof _0xf7d947[_0xadb7('0x1b')]===_0xadb7('0x1c')&&typeof _0xf7d947[_0xadb7('0x1d')]==='undefined';var _0x56f448=_0x457d56[_0xadb7('0x1e')];var _0x4d2221=_0x521ae5?0x0:_0xf7d947[_0xadb7('0x1b')];var _0x5d71b4=_0x521ae5?_0x457d56[_0xadb7('0x1e')]:_0xf7d947[_0xadb7('0x1b')]+_0xf7d947[_0xadb7('0x1d')];var _0x5293b4;if(_0x5d71b4>=_0x56f448){_0x5d71b4=_0x56f448;_0x5293b4=0xc8;}else{_0x5293b4=0xce;}_0x5b1c9b[_0xadb7('0x18')](_0x5293b4);return _0x5b1c9b[_0xadb7('0x1f')](_0xadb7('0x20'),_0x4d2221+'-'+_0x5d71b4+'/'+_0x56f448)[_0xadb7('0x1a')](_0x457d56);}return null;};}function patchUpdates(_0x49d934){return function(_0x102b9a){try{jsonpatch[_0xadb7('0x21')](_0x102b9a,_0x49d934,!![]);}catch(_0x4e3fec){return BPromise[_0xadb7('0x22')](_0x4e3fec);}return _0x102b9a[_0xadb7('0x23')]();};}function saveUpdates(_0x5086be,_0x613c42){return function(_0x12ccaa){if(_0x12ccaa){return _0x12ccaa['update'](_0x5086be)[_0xadb7('0x24')](function(_0x94863c){return _0x94863c;});}return null;};}function removeEntity(_0x3ba8ee,_0x1b9a80){return function(_0x535dc8){if(_0x535dc8){return _0x535dc8['destroy']()[_0xadb7('0x24')](function(){_0x3ba8ee[_0xadb7('0x18')](0xcc)[_0xadb7('0x19')]();});}};}function handleEntityNotFound(_0x80d706,_0x4daf3c){return function(_0x314f7b){if(!_0x314f7b){_0x80d706[_0xadb7('0x17')](0x194);}return _0x314f7b;};}function handleError(_0x3be9a7,_0x5b5ab4){_0x5b5ab4=_0x5b5ab4||0x1f4;return function(_0x299907){logger[_0xadb7('0x25')](_0x299907[_0xadb7('0x26')]);if(_0x299907[_0xadb7('0x27')]){delete _0x299907[_0xadb7('0x27')];}_0x3be9a7['status'](_0x5b5ab4)[_0xadb7('0x28')](_0x299907);};}exports[_0xadb7('0x29')]=function(_0xc580d2,_0x295303){var _0x39b380={},_0x582cf6={},_0x8821f7={'count':0x0,'rows':[]};var _0x2952d8=_[_0xadb7('0x2a')](db[_0xadb7('0x2b')][_0xadb7('0x2c')],function(_0xac0ea){return{'name':_0xac0ea[_0xadb7('0x2d')],'type':_0xac0ea[_0xadb7('0x2e')]['key']};});_0x582cf6[_0xadb7('0x2f')]=_[_0xadb7('0x2a')](_0x2952d8,'name');_0x582cf6[_0xadb7('0x30')]=_['keys'](_0xc580d2['query']);_0x582cf6[_0xadb7('0x31')]=_[_0xadb7('0x32')](_0x582cf6[_0xadb7('0x2f')],_0x582cf6[_0xadb7('0x30')]);_0x39b380[_0xadb7('0x33')]=_['intersection'](_0x582cf6['model'],qs[_0xadb7('0x34')](_0xc580d2[_0xadb7('0x30')][_0xadb7('0x34')]));_0x39b380['attributes']=_0x39b380[_0xadb7('0x33')][_0xadb7('0x35')]?_0x39b380[_0xadb7('0x33')]:_0x582cf6[_0xadb7('0x2f')];if(!_0xc580d2[_0xadb7('0x30')][_0xadb7('0x36')](_0xadb7('0x37'))){_0x39b380[_0xadb7('0x1d')]=qs[_0xadb7('0x1d')](_0xc580d2['query'][_0xadb7('0x1d')]);_0x39b380[_0xadb7('0x1b')]=qs[_0xadb7('0x1b')](_0xc580d2[_0xadb7('0x30')][_0xadb7('0x1b')]);}_0x39b380['order']=qs[_0xadb7('0x38')](_0xc580d2[_0xadb7('0x30')][_0xadb7('0x38')]);_0x39b380[_0xadb7('0x39')]=qs[_0xadb7('0x31')](_[_0xadb7('0x3a')](_0xc580d2[_0xadb7('0x30')],_0x582cf6[_0xadb7('0x31')]),_0x2952d8);if(_0xc580d2['query']['filter']){_0x39b380[_0xadb7('0x39')]=_['merge'](_0x39b380[_0xadb7('0x39')],{'$or':_[_0xadb7('0x2a')](_0x2952d8,function(_0x3a7f89){if(_0x3a7f89[_0xadb7('0x2e')]!==_0xadb7('0x3b')){var _0x1e321f={};_0x1e321f[_0x3a7f89['name']]={'$like':'%'+_0xc580d2[_0xadb7('0x30')][_0xadb7('0x3c')]+'%'};return _0x1e321f;}})});}_0x39b380=_['merge']({},_0x39b380,_0xc580d2[_0xadb7('0x3d')]);var _0x328fa2={'where':_0x39b380[_0xadb7('0x39')]};return db[_0xadb7('0x2b')][_0xadb7('0x1e')](_0x328fa2)[_0xadb7('0x24')](function(_0x40420c){_0x8821f7[_0xadb7('0x1e')]=_0x40420c;if(_0xc580d2[_0xadb7('0x30')][_0xadb7('0x3e')]){_0x39b380[_0xadb7('0x3f')]=[{'all':!![]}];}return db[_0xadb7('0x2b')][_0xadb7('0x40')](_0x39b380);})['then'](function(_0x5bf69d){_0x8821f7[_0xadb7('0x41')]=_0x5bf69d;return _0x8821f7;})['then'](respondWithFilteredResult(_0x295303,_0x39b380))[_0xadb7('0x42')](handleError(_0x295303,null));};exports[_0xadb7('0x43')]=function(_0x10f40d,_0x522ba8){var _0x2a06f3={'raw':!![],'where':{'id':_0x10f40d[_0xadb7('0x44')]['id']}},_0x35a88f={};_0x35a88f[_0xadb7('0x2f')]=_[_0xadb7('0x45')](db[_0xadb7('0x2b')][_0xadb7('0x2c')]);_0x35a88f[_0xadb7('0x30')]=_[_0xadb7('0x45')](_0x10f40d[_0xadb7('0x30')]);_0x35a88f['filters']=_[_0xadb7('0x32')](_0x35a88f['model'],_0x35a88f[_0xadb7('0x30')]);_0x2a06f3[_0xadb7('0x33')]=_[_0xadb7('0x32')](_0x35a88f[_0xadb7('0x2f')],qs[_0xadb7('0x34')](_0x10f40d[_0xadb7('0x30')][_0xadb7('0x34')]));_0x2a06f3[_0xadb7('0x33')]=_0x2a06f3['attributes']['length']?_0x2a06f3[_0xadb7('0x33')]:_0x35a88f[_0xadb7('0x2f')];if(_0x10f40d[_0xadb7('0x30')][_0xadb7('0x3e')]){_0x2a06f3[_0xadb7('0x3f')]=[{'all':!![]}];}_0x2a06f3=_[_0xadb7('0x46')]({},_0x2a06f3,_0x10f40d[_0xadb7('0x3d')]);return db[_0xadb7('0x2b')][_0xadb7('0x47')](_0x2a06f3)['then'](handleEntityNotFound(_0x522ba8,null))['then'](respondWithResult(_0x522ba8,null))['catch'](handleError(_0x522ba8,null));};exports[_0xadb7('0x48')]=function(_0x3f8e96,_0x5fbb57){return db['VtigerField'][_0xadb7('0x48')](_0x3f8e96['body'],{})[_0xadb7('0x24')](respondWithResult(_0x5fbb57,0xc9))[_0xadb7('0x42')](handleError(_0x5fbb57,null));};exports['update']=function(_0x3c43c6,_0xb52186){if(_0x3c43c6['body']['id']){delete _0x3c43c6[_0xadb7('0x49')]['id'];}return db[_0xadb7('0x2b')][_0xadb7('0x47')]({'where':{'id':_0x3c43c6[_0xadb7('0x44')]['id']}})['then'](handleEntityNotFound(_0xb52186,null))['then'](saveUpdates(_0x3c43c6[_0xadb7('0x49')],null))[_0xadb7('0x24')](respondWithResult(_0xb52186,null))[_0xadb7('0x42')](handleError(_0xb52186,null));};exports[_0xadb7('0x4a')]=function(_0x5453c4,_0x203c91){return db[_0xadb7('0x2b')]['find']({'where':{'id':_0x5453c4['params']['id']}})[_0xadb7('0x24')](handleEntityNotFound(_0x203c91,null))['then'](removeEntity(_0x203c91,null))[_0xadb7('0x42')](handleError(_0x203c91,null));}; \ No newline at end of file +var _0xa4b4=['VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','update','then','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x159902,_0x2f808c){var _0x128878=function(_0x5ee91e){while(--_0x5ee91e){_0x159902['push'](_0x159902['shift']());}};_0x128878(++_0x2f808c);}(_0xa4b4,0xa7));var _0x4a4b=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xa4b4[_0x1f44e4];return _0x591989;};'use strict';var emlformat=require(_0x4a4b('0x0'));var rimraf=require(_0x4a4b('0x1'));var zipdir=require(_0x4a4b('0x2'));var jsonpatch=require(_0x4a4b('0x3'));var rp=require(_0x4a4b('0x4'));var moment=require(_0x4a4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4a4b('0x6'));var util=require(_0x4a4b('0x7'));var path=require(_0x4a4b('0x8'));var sox=require(_0x4a4b('0x9'));var csv=require(_0x4a4b('0xa'));var ejs=require(_0x4a4b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4a4b('0xc'));var crypto=require(_0x4a4b('0xd'));var jsforce=require(_0x4a4b('0xe'));var deskjs=require(_0x4a4b('0xf'));var toCsv=require(_0x4a4b('0xa'));var querystring=require(_0x4a4b('0x10'));var Papa=require(_0x4a4b('0x11'));var Redis=require(_0x4a4b('0x12'));var authService=require(_0x4a4b('0x13'));var qs=require(_0x4a4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a4b('0x15'));var utils=require(_0x4a4b('0x16'));var config=require(_0x4a4b('0x17'));var licenseUtil=require(_0x4a4b('0x18'));var db=require(_0x4a4b('0x19'))['db'];function respondWithStatusCode(_0x59c5a5,_0x48828a){_0x48828a=_0x48828a||0xcc;return function(_0x543352){if(_0x543352){return _0x59c5a5[_0x4a4b('0x1a')](_0x48828a);}return _0x59c5a5['status'](_0x48828a)[_0x4a4b('0x1b')]();};}function respondWithResult(_0x1f9c5c,_0x58e64b){_0x58e64b=_0x58e64b||0xc8;return function(_0x13709d){if(_0x13709d){return _0x1f9c5c['status'](_0x58e64b)[_0x4a4b('0x1c')](_0x13709d);}};}function respondWithFilteredResult(_0x3b3d3d,_0x1f189b){return function(_0x5b2ebc){if(_0x5b2ebc){var _0x227e84=typeof _0x1f189b[_0x4a4b('0x1d')]===_0x4a4b('0x1e')&&typeof _0x1f189b[_0x4a4b('0x1f')]===_0x4a4b('0x1e');var _0xbfbc77=_0x5b2ebc[_0x4a4b('0x20')];var _0x590550=_0x227e84?0x0:_0x1f189b[_0x4a4b('0x1d')];var _0x2b6a4c=_0x227e84?_0x5b2ebc[_0x4a4b('0x20')]:_0x1f189b['offset']+_0x1f189b[_0x4a4b('0x1f')];var _0x1579e6;if(_0x2b6a4c>=_0xbfbc77){_0x2b6a4c=_0xbfbc77;_0x1579e6=0xc8;}else{_0x1579e6=0xce;}_0x3b3d3d[_0x4a4b('0x21')](_0x1579e6);return _0x3b3d3d[_0x4a4b('0x22')]('Content-Range',_0x590550+'-'+_0x2b6a4c+'/'+_0xbfbc77)['json'](_0x5b2ebc);}return null;};}function patchUpdates(_0x5bf09a){return function(_0x5eff86){try{jsonpatch[_0x4a4b('0x23')](_0x5eff86,_0x5bf09a,!![]);}catch(_0xdd2112){return BPromise['reject'](_0xdd2112);}return _0x5eff86['save']();};}function saveUpdates(_0x31875b,_0x346eeb){return function(_0x3f2fb2){if(_0x3f2fb2){return _0x3f2fb2[_0x4a4b('0x24')](_0x31875b)['then'](function(_0x51436b){return _0x51436b;});}return null;};}function removeEntity(_0x465fcb,_0x1bf478){return function(_0x2a9998){if(_0x2a9998){return _0x2a9998['destroy']()[_0x4a4b('0x25')](function(){_0x465fcb[_0x4a4b('0x21')](0xcc)[_0x4a4b('0x1b')]();});}};}function handleEntityNotFound(_0xf732e5,_0x561e11){return function(_0x1b0aa7){if(!_0x1b0aa7){_0xf732e5[_0x4a4b('0x1a')](0x194);}return _0x1b0aa7;};}function handleError(_0x208f53,_0x5d30e6){_0x5d30e6=_0x5d30e6||0x1f4;return function(_0xeb9e5a){logger[_0x4a4b('0x26')](_0xeb9e5a[_0x4a4b('0x27')]);if(_0xeb9e5a[_0x4a4b('0x28')]){delete _0xeb9e5a[_0x4a4b('0x28')];}_0x208f53[_0x4a4b('0x21')](_0x5d30e6)[_0x4a4b('0x29')](_0xeb9e5a);};}exports['index']=function(_0xef34e0,_0x66ad5){var _0x53a648={},_0x30a59a={},_0x457c5b={'count':0x0,'rows':[]};var _0x5e8af2=_['map'](db[_0x4a4b('0x2a')][_0x4a4b('0x2b')],function(_0x292db8){return{'name':_0x292db8[_0x4a4b('0x2c')],'type':_0x292db8[_0x4a4b('0x2d')][_0x4a4b('0x2e')]};});_0x30a59a[_0x4a4b('0x2f')]=_[_0x4a4b('0x30')](_0x5e8af2,_0x4a4b('0x28'));_0x30a59a[_0x4a4b('0x31')]=_[_0x4a4b('0x32')](_0xef34e0[_0x4a4b('0x31')]);_0x30a59a['filters']=_[_0x4a4b('0x33')](_0x30a59a['model'],_0x30a59a[_0x4a4b('0x31')]);_0x53a648[_0x4a4b('0x34')]=_[_0x4a4b('0x33')](_0x30a59a[_0x4a4b('0x2f')],qs['fields'](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x35')]));_0x53a648[_0x4a4b('0x34')]=_0x53a648[_0x4a4b('0x34')][_0x4a4b('0x36')]?_0x53a648[_0x4a4b('0x34')]:_0x30a59a[_0x4a4b('0x2f')];if(!_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x37')](_0x4a4b('0x38'))){_0x53a648[_0x4a4b('0x1f')]=qs['limit'](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x1f')]);_0x53a648[_0x4a4b('0x1d')]=qs[_0x4a4b('0x1d')](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x1d')]);}_0x53a648[_0x4a4b('0x39')]=qs[_0x4a4b('0x3a')](_0xef34e0['query'][_0x4a4b('0x3a')]);_0x53a648[_0x4a4b('0x3b')]=qs[_0x4a4b('0x3c')](_[_0x4a4b('0x3d')](_0xef34e0[_0x4a4b('0x31')],_0x30a59a[_0x4a4b('0x3c')]),_0x5e8af2);if(_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x3e')]){_0x53a648[_0x4a4b('0x3b')]=_[_0x4a4b('0x3f')](_0x53a648[_0x4a4b('0x3b')],{'$or':_['map'](_0x5e8af2,function(_0x5f49c4){if(_0x5f49c4[_0x4a4b('0x2d')]!==_0x4a4b('0x40')){var _0x2593c2={};_0x2593c2[_0x5f49c4[_0x4a4b('0x28')]]={'$like':'%'+_0xef34e0['query'][_0x4a4b('0x3e')]+'%'};return _0x2593c2;}})});}_0x53a648=_[_0x4a4b('0x3f')]({},_0x53a648,_0xef34e0[_0x4a4b('0x41')]);var _0x4e4824={'where':_0x53a648[_0x4a4b('0x3b')]};return db[_0x4a4b('0x2a')][_0x4a4b('0x20')](_0x4e4824)['then'](function(_0x1cfde9){_0x457c5b[_0x4a4b('0x20')]=_0x1cfde9;if(_0xef34e0['query']['includeAll']){_0x53a648[_0x4a4b('0x42')]=[{'all':!![]}];}return db[_0x4a4b('0x2a')][_0x4a4b('0x43')](_0x53a648);})[_0x4a4b('0x25')](function(_0x50ad16){_0x457c5b[_0x4a4b('0x44')]=_0x50ad16;return _0x457c5b;})['then'](respondWithFilteredResult(_0x66ad5,_0x53a648))[_0x4a4b('0x45')](handleError(_0x66ad5,null));};exports[_0x4a4b('0x46')]=function(_0x157c6e,_0x4aabe0){var _0x478931={'raw':!![],'where':{'id':_0x157c6e['params']['id']}},_0x1c8946={};_0x1c8946[_0x4a4b('0x2f')]=_[_0x4a4b('0x32')](db[_0x4a4b('0x2a')][_0x4a4b('0x2b')]);_0x1c8946['query']=_[_0x4a4b('0x32')](_0x157c6e[_0x4a4b('0x31')]);_0x1c8946[_0x4a4b('0x3c')]=_[_0x4a4b('0x33')](_0x1c8946[_0x4a4b('0x2f')],_0x1c8946['query']);_0x478931[_0x4a4b('0x34')]=_[_0x4a4b('0x33')](_0x1c8946['model'],qs[_0x4a4b('0x35')](_0x157c6e['query'][_0x4a4b('0x35')]));_0x478931['attributes']=_0x478931['attributes']['length']?_0x478931[_0x4a4b('0x34')]:_0x1c8946[_0x4a4b('0x2f')];if(_0x157c6e[_0x4a4b('0x31')][_0x4a4b('0x47')]){_0x478931[_0x4a4b('0x42')]=[{'all':!![]}];}_0x478931=_[_0x4a4b('0x3f')]({},_0x478931,_0x157c6e[_0x4a4b('0x41')]);return db[_0x4a4b('0x2a')][_0x4a4b('0x48')](_0x478931)[_0x4a4b('0x25')](handleEntityNotFound(_0x4aabe0,null))[_0x4a4b('0x25')](respondWithResult(_0x4aabe0,null))[_0x4a4b('0x45')](handleError(_0x4aabe0,null));};exports[_0x4a4b('0x49')]=function(_0x5f39ef,_0x24b140){return db[_0x4a4b('0x2a')][_0x4a4b('0x49')](_0x5f39ef['body'],{})[_0x4a4b('0x25')](respondWithResult(_0x24b140,0xc9))[_0x4a4b('0x45')](handleError(_0x24b140,null));};exports['update']=function(_0x438b24,_0x45af0d){if(_0x438b24['body']['id']){delete _0x438b24[_0x4a4b('0x4a')]['id'];}return db[_0x4a4b('0x2a')][_0x4a4b('0x48')]({'where':{'id':_0x438b24[_0x4a4b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45af0d,null))[_0x4a4b('0x25')](saveUpdates(_0x438b24[_0x4a4b('0x4a')],null))[_0x4a4b('0x25')](respondWithResult(_0x45af0d,null))[_0x4a4b('0x45')](handleError(_0x45af0d,null));};exports[_0x4a4b('0x4c')]=function(_0x3aed2b,_0x564b03){return db[_0x4a4b('0x2a')][_0x4a4b('0x48')]({'where':{'id':_0x3aed2b['params']['id']}})[_0x4a4b('0x25')](handleEntityNotFound(_0x564b03,null))[_0x4a4b('0x25')](removeEntity(_0x564b03,null))[_0x4a4b('0x45')](handleError(_0x564b03,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6e84011..e1d5650 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 _0x11ac=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','idField','FieldId'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0x11ac,0x104));var _0xc11a=function(_0x1f540d,_0x29951f){_0x1f540d=_0x1f540d-0x0;var _0x4d7dc3=_0x11ac[_0x1f540d];return _0x4d7dc3;};'use strict';var _=require(_0xc11a('0x0'));var util=require('util');var logger=require(_0xc11a('0x1'))(_0xc11a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc11a('0x3'));var fs=require('fs');var path=require(_0xc11a('0x4'));var rimraf=require(_0xc11a('0x5'));var config=require(_0xc11a('0x6'));var attributes=require(_0xc11a('0x7'));module[_0xc11a('0x8')]=function(_0x3c5cc8,_0xb62621){return _0x3c5cc8[_0xc11a('0x9')]('VtigerField',attributes,{'tableName':_0xc11a('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xc11a('0xb'),_0xc11a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1268=['exports','define','int_vtiger_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x1268,0x70));var _0x8126=function(_0x3243fe,_0x454166){_0x3243fe=_0x3243fe-0x0;var _0x34eeaa=_0x1268[_0x3243fe];return _0x34eeaa;};'use strict';var _=require(_0x8126('0x0'));var util=require(_0x8126('0x1'));var logger=require(_0x8126('0x2'))(_0x8126('0x3'));var moment=require(_0x8126('0x4'));var BPromise=require(_0x8126('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8126('0x6'));var rimraf=require('rimraf');var config=require(_0x8126('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x8126('0x8')]=function(_0x5f045d,_0x2f7c6a){return _0x5f045d[_0x8126('0x9')]('VtigerField',attributes,{'tableName':_0x8126('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x8126('0xb')],'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 8b52d43..9396b70 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 _0x3084=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x25705f,_0x3ceb14){var _0xf18e5d=function(_0x241019){while(--_0x241019){_0x25705f['push'](_0x25705f['shift']());}};_0xf18e5d(++_0x3ceb14);}(_0x3084,0xfe));var _0x4308=function(_0x43e814,_0x35d75b){_0x43e814=_0x43e814-0x0;var _0x1f9ded=_0x3084[_0x43e814];return _0x1f9ded;};'use strict';var _=require(_0x4308('0x0'));var util=require(_0x4308('0x1'));var moment=require(_0x4308('0x2'));var BPromise=require('bluebird');var rs=require(_0x4308('0x3'));var fs=require('fs');var Redis=require(_0x4308('0x4'));var db=require(_0x4308('0x5'))['db'];var utils=require(_0x4308('0x6'));var logger=require(_0x4308('0x7'))(_0x4308('0x8'));var config=require(_0x4308('0x9'));var jayson=require(_0x4308('0xa'));var client=jayson[_0x4308('0xb')][_0x4308('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59bcf7,_0x585e58,_0x1802f7){return new BPromise(function(_0x299508,_0xeb8e23){return client[_0x4308('0xd')](_0x59bcf7,_0x1802f7)[_0x4308('0xe')](function(_0x183161){logger[_0x4308('0xf')](_0x4308('0x10'),_0x585e58,_0x4308('0x11'));logger[_0x4308('0x12')](_0x4308('0x13'),_0x585e58,_0x4308('0x11'),JSON[_0x4308('0x14')](_0x183161));if(_0x183161['error']){if(_0x183161[_0x4308('0x15')]['code']===0x1f4){logger[_0x4308('0x15')](_0x4308('0x10'),_0x585e58,_0x183161[_0x4308('0x15')][_0x4308('0x16')]);return _0xeb8e23(_0x183161['error']['message']);}logger[_0x4308('0x15')](_0x4308('0x10'),_0x585e58,_0x183161[_0x4308('0x15')][_0x4308('0x16')]);return _0x299508(_0x183161[_0x4308('0x15')][_0x4308('0x16')]);}else{logger['info'](_0x4308('0x10'),_0x585e58,_0x4308('0x11'));_0x299508(_0x183161['result']['message']);}})[_0x4308('0x17')](function(_0x475cf8){logger[_0x4308('0x15')]('VtigerField,\x20%s,\x20%s',_0x585e58,_0x475cf8);_0xeb8e23(_0x475cf8);});});} \ No newline at end of file +var _0xa359=['request','then','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1dcd5b,_0x5f157b){var _0x1092ea=function(_0x4a4388){while(--_0x4a4388){_0x1dcd5b['push'](_0x1dcd5b['shift']());}};_0x1092ea(++_0x5f157b);}(_0xa359,0x79));var _0x9a35=function(_0x2ffb80,_0x5c17cd){_0x2ffb80=_0x2ffb80-0x0;var _0x3500a3=_0xa359[_0x2ffb80];return _0x3500a3;};'use strict';var _=require(_0x9a35('0x0'));var util=require(_0x9a35('0x1'));var moment=require('moment');var BPromise=require(_0x9a35('0x2'));var rs=require(_0x9a35('0x3'));var fs=require('fs');var Redis=require(_0x9a35('0x4'));var db=require(_0x9a35('0x5'))['db'];var utils=require(_0x9a35('0x6'));var logger=require(_0x9a35('0x7'))(_0x9a35('0x8'));var config=require('../../config/environment');var jayson=require(_0x9a35('0x9'));var client=jayson[_0x9a35('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2729,_0xba2f54,_0x10ce32){return new BPromise(function(_0x226cc6,_0x3129fe){return client[_0x9a35('0xb')](_0x4c2729,_0x10ce32)[_0x9a35('0xc')](function(_0x4b8f41){logger['info'](_0x9a35('0xd'),_0xba2f54,'request\x20sent');logger['debug'](_0x9a35('0xe'),_0xba2f54,_0x9a35('0xf'),JSON[_0x9a35('0x10')](_0x4b8f41));if(_0x4b8f41[_0x9a35('0x11')]){if(_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x12')]===0x1f4){logger[_0x9a35('0x11')]('VtigerField,\x20%s,\x20%s',_0xba2f54,_0x4b8f41['error'][_0x9a35('0x13')]);return _0x3129fe(_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x13')]);}logger[_0x9a35('0x11')](_0x9a35('0xd'),_0xba2f54,_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x13')]);return _0x226cc6(_0x4b8f41['error'][_0x9a35('0x13')]);}else{logger[_0x9a35('0x14')]('VtigerField,\x20%s,\x20%s',_0xba2f54,_0x9a35('0xf'));_0x226cc6(_0x4b8f41['result'][_0x9a35('0x13')]);}})[_0x9a35('0x15')](function(_0x4028b2){logger['error'](_0x9a35('0xd'),_0xba2f54,_0x4028b2);_0x3129fe(_0x4028b2);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6f4675b..43e543f 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 _0xbff5=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put'];(function(_0x33875d,_0xf2f624){var _0x477086=function(_0x5331e4){while(--_0x5331e4){_0x33875d['push'](_0x33875d['shift']());}};_0x477086(++_0xf2f624);}(_0xbff5,0x86));var _0x5bff=function(_0xe38a73,_0x4b4cde){_0xe38a73=_0xe38a73-0x0;var _0x4b0d78=_0xbff5[_0xe38a73];return _0x4b0d78;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require('connect-timeout');var express=require(_0x5bff('0x3'));var router=express[_0x5bff('0x4')]();var fs_extra=require(_0x5bff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x6'));var config=require(_0x5bff('0x7'));var controller=require(_0x5bff('0x8'));router[_0x5bff('0x9')]('/',auth[_0x5bff('0xa')](),controller['index']);router[_0x5bff('0x9')](_0x5bff('0xb'),auth[_0x5bff('0xa')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x9')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router[_0x5bff('0x9')](_0x5bff('0xf'),auth[_0x5bff('0xa')](),controller[_0x5bff('0x10')]);router['post']('/',auth[_0x5bff('0xa')](),controller[_0x5bff('0x11')]);router[_0x5bff('0x12')](_0x5bff('0xd'),auth[_0x5bff('0xa')](),controller['addConfiguration']);router[_0x5bff('0x13')]('/:id',auth[_0x5bff('0xa')](),controller['update']);router[_0x5bff('0x14')](_0x5bff('0xb'),auth[_0x5bff('0xa')](),controller[_0x5bff('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbb03=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5bcad5,_0x4dc46a){var _0x3cbb78=function(_0x25b60f){while(--_0x25b60f){_0x5bcad5['push'](_0x5bcad5['shift']());}};_0x3cbb78(++_0x4dc46a);}(_0xbb03,0x7f));var _0x3bb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbb03[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3bb0('0x0'));var util=require(_0x3bb0('0x1'));var path=require(_0x3bb0('0x2'));var timeout=require(_0x3bb0('0x3'));var express=require('express');var router=express[_0x3bb0('0x4')]();var fs_extra=require(_0x3bb0('0x5'));var auth=require(_0x3bb0('0x6'));var interaction=require(_0x3bb0('0x7'));var config=require('../../config/environment');var controller=require(_0x3bb0('0x8'));router[_0x3bb0('0x9')]('/',auth[_0x3bb0('0xa')](),controller['index']);router[_0x3bb0('0x9')](_0x3bb0('0xb'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0xc')]);router[_0x3bb0('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3bb0('0xd')]);router['get'](_0x3bb0('0xe'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0xf')]);router[_0x3bb0('0x10')]('/',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x11')]);router[_0x3bb0('0x10')]('/:id/configurations',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x12')]);router['put'](_0x3bb0('0xb'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x13')]);router[_0x3bb0('0x14')]('/:id',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 89d685a..d9c932b 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 _0x0295=['STRING','remoteUri','ENUM','password','token','integrationTab','sequelize'];(function(_0x2c3ebb,_0x43f9d3){var _0x31f259=function(_0x5aa38e){while(--_0x5aa38e){_0x2c3ebb['push'](_0x2c3ebb['shift']());}};_0x31f259(++_0x43f9d3);}(_0x0295,0x1f0));var _0x5029=function(_0x3a20ba,_0x131721){_0x3a20ba=_0x3a20ba-0x0;var _0x21106e=_0x0295[_0x3a20ba];return _0x21106e;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5029('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x5029('0x1')]},'token':{'type':Sequelize[_0x5029('0x1')]},'remoteUri':{'type':Sequelize[_0x5029('0x1')],'unique':_0x5029('0x2')},'authType':{'type':Sequelize[_0x5029('0x3')](_0x5029('0x4'),_0x5029('0x5')),'defaultValue':_0x5029('0x4')},'serverUrl':{'type':Sequelize[_0x5029('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x5029('0x6')}}; \ No newline at end of file +var _0xb016=['newTab','sequelize','exports','STRING','remoteUri','password','token','integrationTab'];(function(_0x4d394d,_0x40e7b3){var _0x4f0003=function(_0x56d25d){while(--_0x56d25d){_0x4d394d['push'](_0x4d394d['shift']());}};_0x4f0003(++_0x40e7b3);}(_0xb016,0x159));var _0x6b01=function(_0x145b65,_0x18418f){_0x145b65=_0x145b65-0x0;var _0x13ca65=_0xb016[_0x145b65];return _0x13ca65;};'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'},'password':{'type':Sequelize[_0x6b01('0x2')]},'token':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'authType':{'type':Sequelize['ENUM'](_0x6b01('0x4'),_0x6b01('0x5')),'defaultValue':_0x6b01('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b01('0x6'),_0x6b01('0x7')),'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 972e36b..2c9757e 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 _0x878f=['username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','headers','%s/token:%s','base64','Sequelize','ValidationError','subject','description','group','assignee','includes','position','title','system_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','error','name','send','index','ZendeskAccount','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x878f,0x173));var _0xf878=function(_0x127268,_0xd253de){_0x127268=_0x127268-0x0;var _0x48ecc3=_0x878f[_0x127268];return _0x48ecc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];var integrations=require(_0xf878('0x15'));function respondWithStatusCode(_0x596fb5,_0x1ce004){_0x1ce004=_0x1ce004||0xcc;return function(_0x38eddf){if(_0x38eddf){return _0x596fb5[_0xf878('0x16')](_0x1ce004);}return _0x596fb5['status'](_0x1ce004)[_0xf878('0x17')]();};}function respondWithResult(_0x3902f7,_0x119e9e){_0x119e9e=_0x119e9e||0xc8;return function(_0x492260){if(_0x492260){return _0x3902f7['status'](_0x119e9e)[_0xf878('0x18')](_0x492260);}};}function respondWithFilteredResult(_0x35ff2d,_0x31d888){return function(_0x6dbeca){if(_0x6dbeca){var _0x44aacc=typeof _0x31d888[_0xf878('0x19')]===_0xf878('0x1a')&&typeof _0x31d888[_0xf878('0x1b')]===_0xf878('0x1a');var _0x3a55f3=_0x6dbeca[_0xf878('0x1c')];var _0x47a91a=_0x44aacc?0x0:_0x31d888[_0xf878('0x19')];var _0x34ae59=_0x44aacc?_0x6dbeca[_0xf878('0x1c')]:_0x31d888[_0xf878('0x19')]+_0x31d888[_0xf878('0x1b')];var _0x237d15;if(_0x34ae59>=_0x3a55f3){_0x34ae59=_0x3a55f3;_0x237d15=0xc8;}else{_0x237d15=0xce;}_0x35ff2d[_0xf878('0x1d')](_0x237d15);return _0x35ff2d['set'](_0xf878('0x1e'),_0x47a91a+'-'+_0x34ae59+'/'+_0x3a55f3)[_0xf878('0x18')](_0x6dbeca);}return null;};}function patchUpdates(_0x250f85){return function(_0x59efcb){try{jsonpatch[_0xf878('0x1f')](_0x59efcb,_0x250f85,!![]);}catch(_0x23590c){return BPromise[_0xf878('0x20')](_0x23590c);}return _0x59efcb[_0xf878('0x21')]();};}function saveUpdates(_0x22d884,_0x442450){return function(_0x1cbc92){if(_0x1cbc92){return _0x1cbc92[_0xf878('0x22')](_0x22d884)[_0xf878('0x23')](function(_0x1a6506){return _0x1a6506;});}return null;};}function removeEntity(_0x45e61f,_0x566995){return function(_0x2ac38b){if(_0x2ac38b){return _0x2ac38b['destroy']()[_0xf878('0x23')](function(){_0x45e61f[_0xf878('0x1d')](0xcc)[_0xf878('0x17')]();});}};}function handleEntityNotFound(_0x280036,_0x20449e){return function(_0x5ebaa0){if(!_0x5ebaa0){_0x280036['sendStatus'](0x194);}return _0x5ebaa0;};}function handleError(_0x59ba7b,_0x242926){_0x242926=_0x242926||0x1f4;return function(_0x3baba4){logger[_0xf878('0x24')](_0x3baba4['stack']);if(_0x3baba4[_0xf878('0x25')]){delete _0x3baba4[_0xf878('0x25')];}_0x59ba7b[_0xf878('0x1d')](_0x242926)[_0xf878('0x26')](_0x3baba4);};}exports[_0xf878('0x27')]=function(_0x5aff46,_0x502322){var _0x9a127d={},_0x5d9c97={},_0x4a0286={'count':0x0,'rows':[]};var _0x31e2e1=_['map'](db[_0xf878('0x28')]['rawAttributes'],function(_0x2c61c1){return{'name':_0x2c61c1['fieldName'],'type':_0x2c61c1[_0xf878('0x29')]['key']};});_0x5d9c97[_0xf878('0x2a')]=_[_0xf878('0x2b')](_0x31e2e1,_0xf878('0x25'));_0x5d9c97[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x5aff46[_0xf878('0x2c')]);_0x5d9c97['filters']=_[_0xf878('0x2e')](_0x5d9c97[_0xf878('0x2a')],_0x5d9c97[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d9c97['model'],qs[_0xf878('0x30')](_0x5aff46[_0xf878('0x2c')]['fields']));_0x9a127d[_0xf878('0x2f')]=_0x9a127d[_0xf878('0x2f')][_0xf878('0x31')]?_0x9a127d[_0xf878('0x2f')]:_0x5d9c97[_0xf878('0x2a')];if(!_0x5aff46['query'][_0xf878('0x32')](_0xf878('0x33'))){_0x9a127d[_0xf878('0x1b')]=qs[_0xf878('0x1b')](_0x5aff46['query'][_0xf878('0x1b')]);_0x9a127d['offset']=qs['offset'](_0x5aff46[_0xf878('0x2c')][_0xf878('0x19')]);}_0x9a127d[_0xf878('0x34')]=qs[_0xf878('0x35')](_0x5aff46[_0xf878('0x2c')]['sort']);_0x9a127d[_0xf878('0x36')]=qs['filters'](_[_0xf878('0x37')](_0x5aff46[_0xf878('0x2c')],_0x5d9c97['filters']),_0x31e2e1);if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]){_0x9a127d['where']=_[_0xf878('0x39')](_0x9a127d[_0xf878('0x36')],{'$or':_['map'](_0x31e2e1,function(_0x4129c2){if(_0x4129c2[_0xf878('0x29')]!==_0xf878('0x3a')){var _0xc8eb91={};_0xc8eb91[_0x4129c2[_0xf878('0x25')]]={'$like':'%'+_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0xc8eb91;}})});}_0x9a127d=_['merge']({},_0x9a127d,_0x5aff46[_0xf878('0x3b')]);var _0x14340d={'where':_0x9a127d['where']};return db[_0xf878('0x28')]['count'](_0x14340d)['then'](function(_0x2ec109){_0x4a0286[_0xf878('0x1c')]=_0x2ec109;if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x3c')]){_0x9a127d[_0xf878('0x3d')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xf878('0x3e')](_0x9a127d);})['then'](function(_0xb09736){_0x4a0286[_0xf878('0x3f')]=_0xb09736;return _0x4a0286;})['then'](respondWithFilteredResult(_0x502322,_0x9a127d))['catch'](handleError(_0x502322,null));};exports[_0xf878('0x40')]=function(_0x2a66c1,_0x13fcd3){var _0x2f6ee5={'raw':![],'where':{'id':_0x2a66c1[_0xf878('0x41')]['id']}},_0x5d6e03={};_0x5d6e03[_0xf878('0x2a')]=_[_0xf878('0x2d')](db[_0xf878('0x28')]['rawAttributes']);_0x5d6e03[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x2a66c1[_0xf878('0x2c')]);_0x5d6e03[_0xf878('0x42')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],_0x5d6e03['query']);_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],qs[_0xf878('0x30')](_0x2a66c1[_0xf878('0x2c')]['fields']));_0x2f6ee5[_0xf878('0x2f')]=_0x2f6ee5[_0xf878('0x2f')][_0xf878('0x31')]?_0x2f6ee5[_0xf878('0x2f')]:_0x5d6e03['model'];if(_0x2a66c1[_0xf878('0x2c')][_0xf878('0x3c')]){_0x2f6ee5[_0xf878('0x3d')]=[{'all':!![]}];}_0x2f6ee5=_['merge']({},_0x2f6ee5,_0x2a66c1['options']);return db[_0xf878('0x28')]['find'](_0x2f6ee5)['then'](handleEntityNotFound(_0x13fcd3,null))['then'](respondWithResult(_0x13fcd3,null))[_0xf878('0x43')](handleError(_0x13fcd3,null));};exports['create']=function(_0x156fdb,_0x450a10){return db[_0xf878('0x28')][_0xf878('0x44')](_0x156fdb[_0xf878('0x45')],{})[_0xf878('0x23')](respondWithResult(_0x450a10,0xc9))[_0xf878('0x43')](handleError(_0x450a10,null));};exports['update']=function(_0xb0bf4c,_0x361ac8){if(_0xb0bf4c[_0xf878('0x45')]['id']){delete _0xb0bf4c[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')]['find']({'where':{'id':_0xb0bf4c['params']['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x361ac8,null))[_0xf878('0x23')](saveUpdates(_0xb0bf4c['body'],null))[_0xf878('0x23')](respondWithResult(_0x361ac8,null))['catch'](handleError(_0x361ac8,null));};exports[_0xf878('0x46')]=function(_0x31adde,_0x379912){return db[_0xf878('0x28')]['find']({'where':{'id':_0x31adde[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x379912,null))[_0xf878('0x23')](removeEntity(_0x379912,null))['catch'](handleError(_0x379912,null));};exports[_0xf878('0x47')]=function(_0x30df05,_0x1d3427,_0x28c393){var _0x53e3c3={};var _0x112f2a={};var _0x181f09;var _0x3f9fce;return db['ZendeskAccount'][_0xf878('0x48')]({'where':{'id':_0x30df05[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x1d3427,null))[_0xf878('0x23')](function(_0x5118f4){if(_0x5118f4){_0x181f09=_0x5118f4;_0x112f2a['model']=_['keys'](db[_0xf878('0x49')]['rawAttributes']);_0x112f2a['query']=_['keys'](_0x30df05[_0xf878('0x2c')]);_0x112f2a[_0xf878('0x42')]=_['intersection'](_0x112f2a[_0xf878('0x2a')],_0x112f2a[_0xf878('0x2c')]);_0x53e3c3[_0xf878('0x2f')]=_['intersection'](_0x112f2a['model'],qs[_0xf878('0x30')](_0x30df05['query'][_0xf878('0x30')]));_0x53e3c3[_0xf878('0x2f')]=_0x53e3c3[_0xf878('0x2f')][_0xf878('0x31')]?_0x53e3c3[_0xf878('0x2f')]:_0x112f2a[_0xf878('0x2a')];_0x53e3c3['order']=qs[_0xf878('0x35')](_0x30df05[_0xf878('0x2c')]['sort']);_0x53e3c3[_0xf878('0x36')]=qs[_0xf878('0x42')](_[_0xf878('0x37')](_0x30df05[_0xf878('0x2c')],_0x112f2a[_0xf878('0x42')]));if(_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]){_0x53e3c3['where']=_[_0xf878('0x39')](_0x53e3c3[_0xf878('0x36')],{'$or':_[_0xf878('0x2b')](_0x53e3c3['attributes'],function(_0x392242){var _0x560e0b={};_0x560e0b[_0x392242]={'$like':'%'+_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0x560e0b;})});}_0x53e3c3=_[_0xf878('0x39')]({},_0x53e3c3,_0x30df05[_0xf878('0x3b')]);return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x1141dd){if(_0x1141dd){_0x3f9fce=_0x1141dd[_0xf878('0x31')];if(!_0x30df05[_0xf878('0x2c')][_0xf878('0x32')]('nolimit')){_0x53e3c3['limit']=qs['limit'](_0x30df05[_0xf878('0x2c')]['limit']);_0x53e3c3[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x30df05['query']['offset']);}return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x3340c1){if(_0x3340c1){return _0x3340c1?{'count':_0x3f9fce,'rows':_0x3340c1}:null;}})[_0xf878('0x23')](respondWithResult(_0x1d3427,null))[_0xf878('0x43')](handleError(_0x1d3427,null));};exports[_0xf878('0x4a')]=function(_0x3e78fc,_0x302258,_0x1602ed){if(_0x3e78fc[_0xf878('0x45')]['id']){delete _0x3e78fc[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x3e78fc[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x302258,null))[_0xf878('0x23')](function(_0x1254dd){if(_0x1254dd){_0x3e78fc[_0xf878('0x45')]['AccountId']=_0x1254dd['id'];_0x3e78fc[_0xf878('0x45')]['Subjects']=integrations[_0xf878('0x4b')](_0x3e78fc[_0xf878('0x45')][_0xf878('0x4c')],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);_0x3e78fc[_0xf878('0x45')][_0xf878('0x4d')]=integrations[_0xf878('0x4e')](_0x3e78fc[_0xf878('0x45')]['channel'],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);return db[_0xf878('0x49')][_0xf878('0x44')](_0x3e78fc['body'],{'include':[{'model':db[_0xf878('0x4f')],'as':_0xf878('0x50')},{'model':db[_0xf878('0x4f')],'as':_0xf878('0x4d')}]});}return null;})[_0xf878('0x23')](respondWithResult(_0x302258,null))['catch'](handleError(_0x302258,null));};exports['getFields']=function(_0x453644,_0x1b0230,_0x193f6c){var _0x251613='';return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x453644[_0xf878('0x41')]['id']},'attributes':['id',_0xf878('0x51'),_0xf878('0x52'),_0xf878('0x53'),_0xf878('0x54'),_0xf878('0x55')]})[_0xf878('0x23')](handleEntityNotFound(_0x1b0230,null))[_0xf878('0x23')](function(_0x3bfd00){if(_0x3bfd00){_0x251613=_0x3bfd00[_0xf878('0x55')];var _0x153069=_0x251613['slice'](-0x1);if(_0x153069==='/'){_0x251613=_0x251613[_0xf878('0x56')](0x0,_0x251613[_0xf878('0x57')](_0x153069));}var _0x288235={'method':_0xf878('0x58'),'uri':util[_0xf878('0x59')](_0xf878('0x5a'),_0x251613,_0xf878('0x5b')),'json':!![]};switch(_0x3bfd00[_0xf878('0x54')]){case _0xf878('0x52'):_0x288235['headers']={'Authorization':util[_0xf878('0x59')](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x5d'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00[_0xf878('0x52')]))[_0xf878('0x5e')]('base64'))};break;case'token':_0x288235[_0xf878('0x5f')]={'Authorization':util['format'](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x60'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00['token']))[_0xf878('0x5e')](_0xf878('0x61')))};break;default:throw new db[(_0xf878('0x62'))][(_0xf878('0x63'))]('Unknown\x20authentication\x20type');}return rp(_0x288235);}})[_0xf878('0x23')](function(_0x565e8c){if(_0x565e8c){var _0x21537f=[_0xf878('0x64'),_0xf878('0x65'),_0xf878('0x66'),_0xf878('0x67')];_['remove'](_0x565e8c[_0xf878('0x5b')],function(_0x21c5d1){return _0x21537f[_0xf878('0x68')](_0x21c5d1[_0xf878('0x29')]);});return{'count':_0x565e8c['ticket_fields'][_0xf878('0x31')],'rows':_['map'](_0x565e8c[_0xf878('0x5b')],function(_0x107456){return{'id':_0x107456['id'],'name':_0x107456[_0xf878('0x69')]>0x7?_0x107456[_0xf878('0x6a')]:_0x107456[_0xf878('0x29')],'custom':_0x107456[_0xf878('0x69')]>0x7?!![]:![],'options':_0x107456[_0xf878('0x6b')]?_0x107456[_0xf878('0x6b')]:_0x107456['custom_field_options']?_0x107456['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x1b0230,null))[_0xf878('0x43')](function(_0x1a9af7){var _0x497b7a=_0x453644['query'][_0xf878('0x6c')]?0x1f4:_0x1a9af7['statusCode']||0x1f4;logger[_0xf878('0x24')](_0xf878('0x6d'),_0xf878('0x6e'),_0x497b7a,JSON[_0xf878('0x6f')](_0x1a9af7));delete _0x1a9af7[_0xf878('0x25')];if(_0x497b7a===0x191){_0x497b7a=0x190;}_0x1b0230[_0xf878('0x1d')](_0x497b7a)[_0xf878('0x26')](_0x453644[_0xf878('0x2c')][_0xf878('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x1a9af7[_0xf878('0x70')]}:_0x1a9af7);});}; \ No newline at end of file +var _0x7af2=['pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters'];(function(_0x18c6ce,_0x146434){var _0x4e968f=function(_0x4e2415){while(--_0x4e2415){_0x18c6ce['push'](_0x18c6ce['shift']());}};_0x4e968f(++_0x146434);}(_0x7af2,0x119));var _0x27af=function(_0x4d7ea6,_0x463467){_0x4d7ea6=_0x4d7ea6-0x0;var _0x30d4ef=_0x7af2[_0x4d7ea6];return _0x30d4ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x406340,_0x203501){_0x203501=_0x203501||0xcc;return function(_0x1fd964){if(_0x1fd964){return _0x406340[_0x27af('0x17')](_0x203501);}return _0x406340[_0x27af('0x18')](_0x203501)[_0x27af('0x19')]();};}function respondWithResult(_0x234825,_0x3da435){_0x3da435=_0x3da435||0xc8;return function(_0x423222){if(_0x423222){return _0x234825[_0x27af('0x18')](_0x3da435)[_0x27af('0x1a')](_0x423222);}};}function respondWithFilteredResult(_0x9c2d4b,_0x2d7800){return function(_0x3102c4){if(_0x3102c4){var _0x2bfc9=typeof _0x2d7800[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x2d7800[_0x27af('0x1d')]==='undefined';var _0x315661=_0x3102c4[_0x27af('0x1e')];var _0x5997ae=_0x2bfc9?0x0:_0x2d7800['offset'];var _0x20a6d7=_0x2bfc9?_0x3102c4[_0x27af('0x1e')]:_0x2d7800[_0x27af('0x1b')]+_0x2d7800[_0x27af('0x1d')];var _0xec699a;if(_0x20a6d7>=_0x315661){_0x20a6d7=_0x315661;_0xec699a=0xc8;}else{_0xec699a=0xce;}_0x9c2d4b['status'](_0xec699a);return _0x9c2d4b[_0x27af('0x1f')](_0x27af('0x20'),_0x5997ae+'-'+_0x20a6d7+'/'+_0x315661)[_0x27af('0x1a')](_0x3102c4);}return null;};}function patchUpdates(_0x5e7c19){return function(_0x19afb1){try{jsonpatch[_0x27af('0x21')](_0x19afb1,_0x5e7c19,!![]);}catch(_0x2ae47e){return BPromise['reject'](_0x2ae47e);}return _0x19afb1[_0x27af('0x22')]();};}function saveUpdates(_0x2460f4,_0x30720b){return function(_0x2af76d){if(_0x2af76d){return _0x2af76d[_0x27af('0x23')](_0x2460f4)[_0x27af('0x24')](function(_0x43dd9e){return _0x43dd9e;});}return null;};}function removeEntity(_0x35b36d,_0x2e1bb0){return function(_0x49780b){if(_0x49780b){return _0x49780b['destroy']()['then'](function(){_0x35b36d[_0x27af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12625c,_0x396326){return function(_0x4ba49f){if(!_0x4ba49f){_0x12625c[_0x27af('0x17')](0x194);}return _0x4ba49f;};}function handleError(_0x1d9341,_0x463e36){_0x463e36=_0x463e36||0x1f4;return function(_0x424490){logger[_0x27af('0x25')](_0x424490[_0x27af('0x26')]);if(_0x424490[_0x27af('0x27')]){delete _0x424490['name'];}_0x1d9341[_0x27af('0x18')](_0x463e36)[_0x27af('0x28')](_0x424490);};}exports[_0x27af('0x29')]=function(_0xe009a,_0x25d65a){var _0xa08dd9={},_0x42a5b7={},_0x2b26ac={'count':0x0,'rows':[]};var _0x4406e2=_[_0x27af('0x2a')](db[_0x27af('0x2b')]['rawAttributes'],function(_0x15e867){return{'name':_0x15e867[_0x27af('0x2c')],'type':_0x15e867[_0x27af('0x2d')][_0x27af('0x2e')]};});_0x42a5b7[_0x27af('0x2f')]=_[_0x27af('0x2a')](_0x4406e2,'name');_0x42a5b7['query']=_[_0x27af('0x30')](_0xe009a[_0x27af('0x31')]);_0x42a5b7['filters']=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],_0x42a5b7[_0x27af('0x31')]);_0xa08dd9[_0x27af('0x33')]=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xe009a[_0x27af('0x31')][_0x27af('0x34')]));_0xa08dd9[_0x27af('0x33')]=_0xa08dd9[_0x27af('0x33')]['length']?_0xa08dd9['attributes']:_0x42a5b7[_0x27af('0x2f')];if(!_0xe009a[_0x27af('0x31')]['hasOwnProperty'](_0x27af('0x35'))){_0xa08dd9[_0x27af('0x1d')]=qs['limit'](_0xe009a[_0x27af('0x31')][_0x27af('0x1d')]);_0xa08dd9[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xe009a[_0x27af('0x31')]['offset']);}_0xa08dd9[_0x27af('0x36')]=qs[_0x27af('0x37')](_0xe009a['query']['sort']);_0xa08dd9[_0x27af('0x38')]=qs[_0x27af('0x39')](_[_0x27af('0x3a')](_0xe009a[_0x27af('0x31')],_0x42a5b7[_0x27af('0x39')]),_0x4406e2);if(_0xe009a[_0x27af('0x31')]['filter']){_0xa08dd9[_0x27af('0x38')]=_['merge'](_0xa08dd9[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x4406e2,function(_0x2a6b14){if(_0x2a6b14[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x5f5504={};_0x5f5504[_0x2a6b14[_0x27af('0x27')]]={'$like':'%'+_0xe009a[_0x27af('0x31')][_0x27af('0x3c')]+'%'};return _0x5f5504;}})});}_0xa08dd9=_[_0x27af('0x3d')]({},_0xa08dd9,_0xe009a[_0x27af('0x3e')]);var _0x32b558={'where':_0xa08dd9[_0x27af('0x38')]};return db[_0x27af('0x2b')][_0x27af('0x1e')](_0x32b558)[_0x27af('0x24')](function(_0xda424e){_0x2b26ac[_0x27af('0x1e')]=_0xda424e;if(_0xe009a[_0x27af('0x31')][_0x27af('0x3f')]){_0xa08dd9['include']=[{'all':!![]}];}return db[_0x27af('0x2b')][_0x27af('0x40')](_0xa08dd9);})[_0x27af('0x24')](function(_0x373c05){_0x2b26ac['rows']=_0x373c05;return _0x2b26ac;})[_0x27af('0x24')](respondWithFilteredResult(_0x25d65a,_0xa08dd9))['catch'](handleError(_0x25d65a,null));};exports['show']=function(_0x2425dd,_0x3c9c81){var _0x279f99={'raw':![],'where':{'id':_0x2425dd[_0x27af('0x41')]['id']}},_0x17efd6={};_0x17efd6[_0x27af('0x2f')]=_[_0x27af('0x30')](db[_0x27af('0x2b')][_0x27af('0x42')]);_0x17efd6[_0x27af('0x31')]=_[_0x27af('0x30')](_0x2425dd[_0x27af('0x31')]);_0x17efd6['filters']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],_0x17efd6['query']);_0x279f99['attributes']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x2425dd[_0x27af('0x31')][_0x27af('0x34')]));_0x279f99['attributes']=_0x279f99[_0x27af('0x33')]['length']?_0x279f99[_0x27af('0x33')]:_0x17efd6[_0x27af('0x2f')];if(_0x2425dd[_0x27af('0x31')][_0x27af('0x3f')]){_0x279f99[_0x27af('0x43')]=[{'all':!![]}];}_0x279f99=_[_0x27af('0x3d')]({},_0x279f99,_0x2425dd[_0x27af('0x3e')]);return db['ZendeskAccount']['find'](_0x279f99)[_0x27af('0x24')](handleEntityNotFound(_0x3c9c81,null))['then'](respondWithResult(_0x3c9c81,null))[_0x27af('0x44')](handleError(_0x3c9c81,null));};exports[_0x27af('0x45')]=function(_0x226025,_0x389962){return db[_0x27af('0x2b')][_0x27af('0x45')](_0x226025[_0x27af('0x46')],{})['then'](respondWithResult(_0x389962,0xc9))[_0x27af('0x44')](handleError(_0x389962,null));};exports[_0x27af('0x23')]=function(_0x20e180,_0x3fdc0e){if(_0x20e180[_0x27af('0x46')]['id']){delete _0x20e180['body']['id'];}return db[_0x27af('0x2b')][_0x27af('0x47')]({'where':{'id':_0x20e180[_0x27af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fdc0e,null))['then'](saveUpdates(_0x20e180[_0x27af('0x46')],null))[_0x27af('0x24')](respondWithResult(_0x3fdc0e,null))[_0x27af('0x44')](handleError(_0x3fdc0e,null));};exports['destroy']=function(_0x495794,_0x2fad23){return db['ZendeskAccount'][_0x27af('0x47')]({'where':{'id':_0x495794[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2fad23,null))[_0x27af('0x24')](removeEntity(_0x2fad23,null))[_0x27af('0x44')](handleError(_0x2fad23,null));};exports[_0x27af('0x48')]=function(_0x123533,_0x374794,_0x1b6d94){var _0x24d8bf={};var _0x23369a={};var _0x5c02c1;var _0x76ed78;return db[_0x27af('0x2b')][_0x27af('0x49')]({'where':{'id':_0x123533[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x374794,null))[_0x27af('0x24')](function(_0x20c155){if(_0x20c155){_0x5c02c1=_0x20c155;_0x23369a[_0x27af('0x2f')]=_['keys'](db[_0x27af('0x4a')]['rawAttributes']);_0x23369a[_0x27af('0x31')]=_[_0x27af('0x30')](_0x123533[_0x27af('0x31')]);_0x23369a['filters']=_[_0x27af('0x32')](_0x23369a['model'],_0x23369a[_0x27af('0x31')]);_0x24d8bf[_0x27af('0x33')]=_[_0x27af('0x32')](_0x23369a['model'],qs[_0x27af('0x34')](_0x123533['query'][_0x27af('0x34')]));_0x24d8bf['attributes']=_0x24d8bf[_0x27af('0x33')][_0x27af('0x4b')]?_0x24d8bf[_0x27af('0x33')]:_0x23369a['model'];_0x24d8bf['order']=qs[_0x27af('0x37')](_0x123533[_0x27af('0x31')][_0x27af('0x37')]);_0x24d8bf[_0x27af('0x38')]=qs['filters'](_[_0x27af('0x3a')](_0x123533[_0x27af('0x31')],_0x23369a[_0x27af('0x39')]));if(_0x123533[_0x27af('0x31')][_0x27af('0x3c')]){_0x24d8bf[_0x27af('0x38')]=_['merge'](_0x24d8bf[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x24d8bf[_0x27af('0x33')],function(_0x2401c7){var _0x49eb46={};_0x49eb46[_0x2401c7]={'$like':'%'+_0x123533[_0x27af('0x31')]['filter']+'%'};return _0x49eb46;})});}_0x24d8bf=_[_0x27af('0x3d')]({},_0x24d8bf,_0x123533[_0x27af('0x3e')]);return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x13a5a8){if(_0x13a5a8){_0x76ed78=_0x13a5a8['length'];if(!_0x123533['query'][_0x27af('0x4c')](_0x27af('0x35'))){_0x24d8bf[_0x27af('0x1d')]=qs['limit'](_0x123533[_0x27af('0x31')][_0x27af('0x1d')]);_0x24d8bf['offset']=qs[_0x27af('0x1b')](_0x123533[_0x27af('0x31')]['offset']);}return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x1fa50b){if(_0x1fa50b){return _0x1fa50b?{'count':_0x76ed78,'rows':_0x1fa50b}:null;}})['then'](respondWithResult(_0x374794,null))['catch'](handleError(_0x374794,null));};exports[_0x27af('0x4d')]=function(_0xf97695,_0x2a8534,_0x266220){if(_0xf97695[_0x27af('0x46')]['id']){delete _0xf97695[_0x27af('0x46')]['id'];}return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0xf97695['params']['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2a8534,null))[_0x27af('0x24')](function(_0xa692f6){if(_0xa692f6){_0xf97695[_0x27af('0x46')][_0x27af('0x4e')]=_0xa692f6['id'];_0xf97695[_0x27af('0x46')][_0x27af('0x4f')]=integrations[_0x27af('0x50')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695[_0x27af('0x46')][_0x27af('0x2d')]);_0xf97695[_0x27af('0x46')][_0x27af('0x52')]=integrations[_0x27af('0x53')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695['body'][_0x27af('0x2d')]);return db[_0x27af('0x4a')]['create'](_0xf97695[_0x27af('0x46')],{'include':[{'model':db[_0x27af('0x54')],'as':_0x27af('0x4f')},{'model':db[_0x27af('0x54')],'as':_0x27af('0x52')}]});}return null;})[_0x27af('0x24')](respondWithResult(_0x2a8534,null))['catch'](handleError(_0x2a8534,null));};exports[_0x27af('0x55')]=function(_0x31a595,_0x3a2958,_0x4ab463){var _0x5d7af4='';return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0x31a595[_0x27af('0x41')]['id']},'attributes':['id',_0x27af('0x56'),_0x27af('0x57'),_0x27af('0x58'),_0x27af('0x59'),'remoteUri']})[_0x27af('0x24')](handleEntityNotFound(_0x3a2958,null))[_0x27af('0x24')](function(_0x4ac2a3){if(_0x4ac2a3){_0x5d7af4=_0x4ac2a3[_0x27af('0x5a')];var _0xc0a98c=_0x5d7af4['slice'](-0x1);if(_0xc0a98c==='/'){_0x5d7af4=_0x5d7af4['substring'](0x0,_0x5d7af4[_0x27af('0x5b')](_0xc0a98c));}var _0x287f7c={'method':_0x27af('0x5c'),'uri':util[_0x27af('0x5d')](_0x27af('0x5e'),_0x5d7af4,_0x27af('0x5f')),'json':!![]};switch(_0x4ac2a3[_0x27af('0x59')]){case'password':_0x287f7c[_0x27af('0x60')]={'Authorization':util[_0x27af('0x5d')](_0x27af('0x61'),new Buffer(util[_0x27af('0x5d')]('%s:%s',_0x4ac2a3['username'],_0x4ac2a3[_0x27af('0x57')]))[_0x27af('0x62')](_0x27af('0x63')))};break;case _0x27af('0x58'):_0x287f7c['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x27af('0x5d')](_0x27af('0x64'),_0x4ac2a3[_0x27af('0x56')],_0x4ac2a3[_0x27af('0x58')]))[_0x27af('0x62')](_0x27af('0x63')))};break;default:throw new db['Sequelize']['ValidationError'](_0x27af('0x65'));}return rp(_0x287f7c);}})[_0x27af('0x24')](function(_0x55637f){if(_0x55637f){var _0x2c3d30=['subject','description',_0x27af('0x66'),_0x27af('0x67')];_[_0x27af('0x68')](_0x55637f[_0x27af('0x5f')],function(_0x2b7e18){return _0x2c3d30[_0x27af('0x69')](_0x2b7e18[_0x27af('0x2d')]);});return{'count':_0x55637f[_0x27af('0x5f')][_0x27af('0x4b')],'rows':_[_0x27af('0x2a')](_0x55637f[_0x27af('0x5f')],function(_0x4dd124){return{'id':_0x4dd124['id'],'name':_0x4dd124[_0x27af('0x6a')]>0x7?_0x4dd124[_0x27af('0x6b')]:_0x4dd124[_0x27af('0x2d')],'custom':_0x4dd124['position']>0x7?!![]:![],'options':_0x4dd124[_0x27af('0x6c')]?_0x4dd124[_0x27af('0x6c')]:_0x4dd124[_0x27af('0x6d')]?_0x4dd124['custom_field_options']:[]};})};}})[_0x27af('0x24')](respondWithResult(_0x3a2958,null))['catch'](function(_0x118d06){var _0x9350fa=_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?0x1f4:_0x118d06[_0x27af('0x6f')]||0x1f4;logger[_0x27af('0x25')](_0x27af('0x70'),_0x27af('0x55'),_0x9350fa,JSON['stringify'](_0x118d06));delete _0x118d06[_0x27af('0x27')];if(_0x9350fa===0x191){_0x9350fa=0x190;}_0x3a2958['status'](_0x9350fa)[_0x27af('0x28')](_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x118d06['statusCode']}:_0x118d06);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 51a7bec..9f9bf1f 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 _0x06cc=['../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4b4f58,_0x4aeb05){var _0x303bb6=function(_0x3cfb8a){while(--_0x3cfb8a){_0x4b4f58['push'](_0x4b4f58['shift']());}};_0x303bb6(++_0x4aeb05);}(_0x06cc,0x18e));var _0xc06c=function(_0x566a78,_0x309118){_0x566a78=_0x566a78-0x0;var _0x1cc7f5=_0x06cc[_0x566a78];return _0x1cc7f5;};'use strict';var _=require(_0xc06c('0x0'));var util=require(_0xc06c('0x1'));var logger=require(_0xc06c('0x2'))(_0xc06c('0x3'));var moment=require(_0xc06c('0x4'));var BPromise=require('bluebird');var rp=require(_0xc06c('0x5'));var fs=require('fs');var path=require(_0xc06c('0x6'));var rimraf=require(_0xc06c('0x7'));var config=require(_0xc06c('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc06c('0x9'));module[_0xc06c('0xa')]=function(_0x1218c9,_0x708d4d){return _0x1218c9[_0xc06c('0xb')](_0xc06c('0xc'),attributes,{'tableName':_0xc06c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8190=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x42e407,_0x1d65d5){var _0x4761c0=function(_0x36a587){while(--_0x36a587){_0x42e407['push'](_0x42e407['shift']());}};_0x4761c0(++_0x1d65d5);}(_0x8190,0x1e6));var _0x0819=function(_0x427106,_0x3f3c52){_0x427106=_0x427106-0x0;var _0x73bf25=_0x8190[_0x427106];return _0x73bf25;};'use strict';var _=require(_0x0819('0x0'));var util=require(_0x0819('0x1'));var logger=require(_0x0819('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0819('0x3'));var rp=require(_0x0819('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0819('0x5'));var config=require(_0x0819('0x6'));var attributes=require(_0x0819('0x7'));var integrations=require(_0x0819('0x8'));module[_0x0819('0x9')]=function(_0x3b97ba,_0x382136){return _0x3b97ba[_0x0819('0xa')]('ZendeskAccount',attributes,{'tableName':_0x0819('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index dde17d3..8a47742 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 _0xabec=['message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','debug','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskAccount,\x20%s,\x20%s'];(function(_0xf429ef,_0x1d7642){var _0x522132=function(_0x15e5f5){while(--_0x15e5f5){_0xf429ef['push'](_0xf429ef['shift']());}};_0x522132(++_0x1d7642);}(_0xabec,0x15a));var _0xcabe=function(_0x5e9689,_0x48e034){_0x5e9689=_0x5e9689-0x0;var _0x2fac94=_0xabec[_0x5e9689];return _0x2fac94;};'use strict';var _=require('lodash');var util=require(_0xcabe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcabe('0x1'));var fs=require('fs');var Redis=require(_0xcabe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcabe('0x3'));var logger=require(_0xcabe('0x4'))('rpc');var config=require(_0xcabe('0x5'));var jayson=require(_0xcabe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f103,_0x26099f,_0x21c741){return new BPromise(function(_0x1e7bef,_0x24a399){return client['request'](_0x31f103,_0x21c741)[_0xcabe('0x7')](function(_0x10d8a7){logger[_0xcabe('0x8')]('ZendeskAccount,\x20%s,\x20%s',_0x26099f,'request\x20sent');logger['debug'](_0xcabe('0x9'),_0x26099f,_0xcabe('0xa'),JSON[_0xcabe('0xb')](_0x10d8a7));if(_0x10d8a7[_0xcabe('0xc')]){if(_0x10d8a7[_0xcabe('0xc')]['code']===0x1f4){logger[_0xcabe('0xc')](_0xcabe('0xd'),_0x26099f,_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);return _0x24a399(_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);}logger[_0xcabe('0xc')](_0xcabe('0xd'),_0x26099f,_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);return _0x1e7bef(_0x10d8a7[_0xcabe('0xc')][_0xcabe('0xe')]);}else{logger[_0xcabe('0x8')](_0xcabe('0xd'),_0x26099f,_0xcabe('0xa'));_0x1e7bef(_0x10d8a7[_0xcabe('0xf')][_0xcabe('0xe')]);}})[_0xcabe('0x10')](function(_0x541eb5){logger['error'](_0xcabe('0xd'),_0x26099f,_0x541eb5);_0x24a399(_0x541eb5);});});}exports['GetZendeskAccount']=function(_0x5ef260){var _0xf8c687=this;return new Promise(function(_0x4c14ac,_0x445fe5){return db['ZendeskAccount'][_0xcabe('0x11')]({'raw':_0x5ef260[_0xcabe('0x12')]?_0x5ef260['options'][_0xcabe('0x13')]===undefined?!![]:![]:!![],'where':_0x5ef260[_0xcabe('0x12')]?_0x5ef260[_0xcabe('0x12')][_0xcabe('0x14')]||null:null,'attributes':_0x5ef260[_0xcabe('0x12')]?_0x5ef260[_0xcabe('0x12')][_0xcabe('0x15')]||null:null,'limit':_0x5ef260[_0xcabe('0x12')]?_0x5ef260[_0xcabe('0x12')][_0xcabe('0x16')]||null:null,'include':_0x5ef260['options']?_0x5ef260['options'][_0xcabe('0x17')]?_[_0xcabe('0x18')](_0x5ef260[_0xcabe('0x12')][_0xcabe('0x17')],function(_0x495102){return{'model':db[_0x495102[_0xcabe('0x19')]],'as':_0x495102['as'],'attributes':_0x495102[_0xcabe('0x15')],'include':_0x495102[_0xcabe('0x17')]?_[_0xcabe('0x18')](_0x495102[_0xcabe('0x17')],function(_0x4fc2f9){return{'model':db[_0x4fc2f9[_0xcabe('0x19')]],'as':_0x4fc2f9['as'],'attributes':_0x4fc2f9[_0xcabe('0x15')],'include':_0x4fc2f9[_0xcabe('0x17')]?_['map'](_0x4fc2f9[_0xcabe('0x17')],function(_0x484984){return{'model':db[_0x484984[_0xcabe('0x19')]],'as':_0x484984['as'],'attributes':_0x484984['attributes']};}):[]};}):[]};}):[]:[]})[_0xcabe('0x7')](function(_0x25cfca){logger[_0xcabe('0x8')]('GetZendeskAccount',_0x5ef260);logger['debug'](_0xcabe('0x1a'),_0x5ef260,JSON[_0xcabe('0xb')](_0x25cfca));_0x4c14ac(_0x25cfca);})[_0xcabe('0x10')](function(_0x32d43f){logger[_0xcabe('0xc')](_0xcabe('0x1a'),_0x32d43f[_0xcabe('0xe')],_0x5ef260);_0x445fe5(_0xf8c687[_0xcabe('0xc')](0x1f4,_0x32d43f[_0xcabe('0xe')]));});});};exports[_0xcabe('0x1b')]=function(_0x257edd){var _0x3b0ade=this;return new Promise(function(_0x5ad104,_0x597af0){return db['ZendeskAccount'][_0xcabe('0x1c')]({'raw':_0x257edd[_0xcabe('0x12')]?_0x257edd[_0xcabe('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x257edd[_0xcabe('0x12')]?_0x257edd[_0xcabe('0x12')][_0xcabe('0x14')]||null:null,'attributes':_0x257edd[_0xcabe('0x12')]?_0x257edd[_0xcabe('0x12')][_0xcabe('0x15')]||null:null,'include':_0x257edd[_0xcabe('0x12')]?_0x257edd[_0xcabe('0x12')][_0xcabe('0x17')]?_[_0xcabe('0x18')](_0x257edd[_0xcabe('0x12')]['include'],function(_0x54044c){return{'model':db[_0x54044c[_0xcabe('0x19')]],'as':_0x54044c['as'],'attributes':_0x54044c['attributes'],'include':_0x54044c[_0xcabe('0x17')]?_[_0xcabe('0x18')](_0x54044c[_0xcabe('0x17')],function(_0x3ff5a1){return{'model':db[_0x3ff5a1[_0xcabe('0x19')]],'as':_0x3ff5a1['as'],'attributes':_0x3ff5a1[_0xcabe('0x15')],'include':_0x3ff5a1[_0xcabe('0x17')]?_[_0xcabe('0x18')](_0x3ff5a1[_0xcabe('0x17')],function(_0x4afc64){return{'model':db[_0x4afc64[_0xcabe('0x19')]],'as':_0x4afc64['as'],'attributes':_0x4afc64[_0xcabe('0x15')]};}):[]};}):[]};}):[]:[]})[_0xcabe('0x7')](function(_0x2ccf1d){logger[_0xcabe('0x8')]('ShowZendeskAccount',_0x257edd);logger[_0xcabe('0x1d')](_0xcabe('0x1b'),_0x257edd,JSON[_0xcabe('0xb')](_0x2ccf1d));_0x5ad104(_0x2ccf1d);})[_0xcabe('0x10')](function(_0x10f96){logger[_0xcabe('0xc')]('ShowZendeskAccount',_0x10f96[_0xcabe('0xe')],_0x257edd);_0x597af0(_0x3b0ade[_0xcabe('0xc')](0x1f4,_0x10f96[_0xcabe('0xe')]));});});}; \ No newline at end of file +var _0xc904=['model','then','GetZendeskAccount','ShowZendeskAccount','find','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','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','where','attributes','include','map'];(function(_0xb400c,_0x386824){var _0xfe8b97=function(_0x251541){while(--_0x251541){_0xb400c['push'](_0xb400c['shift']());}};_0xfe8b97(++_0x386824);}(_0xc904,0x1aa));var _0x4c90=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc904[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x4c90('0x0'));var util=require(_0x4c90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c90('0x2'));var fs=require('fs');var Redis=require(_0x4c90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c90('0x4'));var logger=require(_0x4c90('0x5'))(_0x4c90('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c90('0x7'));var client=jayson[_0x4c90('0x8')][_0x4c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a0315,_0x20b0b2,_0x30f19d){return new BPromise(function(_0x126682,_0x3d95d6){return client[_0x4c90('0xa')](_0x1a0315,_0x30f19d)['then'](function(_0x30bb3c){logger['info'](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));logger[_0x4c90('0xd')](_0x4c90('0xe'),_0x20b0b2,_0x4c90('0xc'),JSON[_0x4c90('0xf')](_0x30bb3c));if(_0x30bb3c[_0x4c90('0x10')]){if(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x11')]===0x1f4){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x3d95d6(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);}logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x126682(_0x30bb3c['error'][_0x4c90('0x12')]);}else{logger[_0x4c90('0x13')](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));_0x126682(_0x30bb3c[_0x4c90('0x14')][_0x4c90('0x12')]);}})[_0x4c90('0x15')](function(_0x5763c0){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x5763c0);_0x3d95d6(_0x5763c0);});});}exports['GetZendeskAccount']=function(_0x4ea961){var _0x7b8108=this;return new Promise(function(_0xe151a9,_0x3aa69c){return db[_0x4c90('0x16')][_0x4c90('0x17')]({'raw':_0x4ea961[_0x4c90('0x18')]?_0x4ea961['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x19')]||null:null,'attributes':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x1a')]||null:null,'limit':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')]['limit']||null:null,'include':_0x4ea961['options']?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x4ea961['options'][_0x4c90('0x1b')],function(_0x45988c){return{'model':db[_0x45988c[_0x4c90('0x1d')]],'as':_0x45988c['as'],'attributes':_0x45988c['attributes'],'include':_0x45988c[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x45988c[_0x4c90('0x1b')],function(_0xf1f792){return{'model':db[_0xf1f792[_0x4c90('0x1d')]],'as':_0xf1f792['as'],'attributes':_0xf1f792[_0x4c90('0x1a')],'include':_0xf1f792[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0xf1f792[_0x4c90('0x1b')],function(_0x142d4f){return{'model':db[_0x142d4f['model']],'as':_0x142d4f['as'],'attributes':_0x142d4f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c90('0x1e')](function(_0x3338e2){logger[_0x4c90('0x13')](_0x4c90('0x1f'),_0x4ea961);logger[_0x4c90('0xd')]('GetZendeskAccount',_0x4ea961,JSON[_0x4c90('0xf')](_0x3338e2));_0xe151a9(_0x3338e2);})[_0x4c90('0x15')](function(_0x26e1ce){logger[_0x4c90('0x10')](_0x4c90('0x1f'),_0x26e1ce[_0x4c90('0x12')],_0x4ea961);_0x3aa69c(_0x7b8108[_0x4c90('0x10')](0x1f4,_0x26e1ce[_0x4c90('0x12')]));});});};exports[_0x4c90('0x20')]=function(_0x5e6dc4){var _0x33af80=this;return new Promise(function(_0x37af4e,_0x537a76){return db[_0x4c90('0x16')][_0x4c90('0x21')]({'raw':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4[_0x4c90('0x18')][_0x4c90('0x22')]===undefined?!![]:![]:!![],'where':_0x5e6dc4['options']?_0x5e6dc4['options'][_0x4c90('0x19')]||null:null,'attributes':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4['options'][_0x4c90('0x1a')]||null:null,'include':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4['options']['include']?_[_0x4c90('0x1c')](_0x5e6dc4[_0x4c90('0x18')][_0x4c90('0x1b')],function(_0x351e7f){return{'model':db[_0x351e7f[_0x4c90('0x1d')]],'as':_0x351e7f['as'],'attributes':_0x351e7f['attributes'],'include':_0x351e7f[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x351e7f[_0x4c90('0x1b')],function(_0x3da504){return{'model':db[_0x3da504['model']],'as':_0x3da504['as'],'attributes':_0x3da504[_0x4c90('0x1a')],'include':_0x3da504[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x3da504[_0x4c90('0x1b')],function(_0x451a1e){return{'model':db[_0x451a1e[_0x4c90('0x1d')]],'as':_0x451a1e['as'],'attributes':_0x451a1e[_0x4c90('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4c90('0x1e')](function(_0x57740c){logger[_0x4c90('0x13')](_0x4c90('0x20'),_0x5e6dc4);logger[_0x4c90('0xd')](_0x4c90('0x20'),_0x5e6dc4,JSON[_0x4c90('0xf')](_0x57740c));_0x37af4e(_0x57740c);})['catch'](function(_0x3df2f5){logger[_0x4c90('0x10')](_0x4c90('0x20'),_0x3df2f5['message'],_0x5e6dc4);_0x537a76(_0x33af80[_0x4c90('0x10')](0x1f4,_0x3df2f5['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index fd50922..56c0b9b 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 _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x644560,_0x1783aa){var _0x41b76b=function(_0xff8c89){while(--_0xff8c89){_0x644560['push'](_0x644560['shift']());}};_0x41b76b(++_0x1783aa);}(_0x878f,0x173));var _0xf878=function(_0x8b0dd2,_0x1bc3af){_0x8b0dd2=_0x8b0dd2-0x0;var _0x4156dd=_0x878f[_0x8b0dd2];return _0x4156dd;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x3c074,_0x104c66){var _0x3ec6d7=function(_0x163561){while(--_0x163561){_0x3c074['push'](_0x3c074['shift']());}};_0x3ec6d7(++_0x104c66);}(_0xe706,0xa3));var _0x6e70=function(_0x1c1798,_0x24812b){_0x1c1798=_0x1c1798-0x0;var _0x4f235e=_0xe706[_0x1c1798];return _0x4f235e;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 1bba1bb..7469003 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 _0xe9a2=['STRING'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0xe9a2,0x134));var _0x2e9a=function(_0x9ca709,_0x518eba){_0x9ca709=_0x9ca709-0x0;var _0x455de9=_0xe9a2[_0x9ca709];return _0x455de9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2e9a('0x0')]}}; \ No newline at end of file +var _0xfc14=['sequelize','STRING'];(function(_0x49b5ed,_0x35cb99){var _0x117247=function(_0x13d664){while(--_0x13d664){_0x49b5ed['push'](_0x49b5ed['shift']());}};_0x117247(++_0x35cb99);}(_0xfc14,0x138));var _0x4fc1=function(_0x150e08,_0x250886){_0x150e08=_0x150e08-0x0;var _0xc45681=_0xfc14[_0x150e08];return _0xc45681;};'use strict';var Sequelize=require(_0x4fc1('0x0'));module['exports']={'name':{'type':Sequelize[_0x4fc1('0x1')]},'description':{'type':Sequelize[_0x4fc1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 18f2386..8b94243 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 _0xe0e5=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','name','index','ZendeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getFields','findOne','ZendeskField','getSubjects','getTags','Tag','setTags','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe0e5,0xe2));var _0x5e0e=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe0e5[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e0e('0x1'));var rp=require(_0x5e0e('0x2'));var moment=require(_0x5e0e('0x3'));var BPromise=require(_0x5e0e('0x4'));var Mustache=require(_0x5e0e('0x5'));var util=require(_0x5e0e('0x6'));var path=require(_0x5e0e('0x7'));var sox=require(_0x5e0e('0x8'));var csv=require(_0x5e0e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e0e('0xa'));var _=require(_0x5e0e('0xb'));var squel=require(_0x5e0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e0e('0xd'));var deskjs=require(_0x5e0e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e0e('0xf'));var authService=require(_0x5e0e('0x10'));var qs=require(_0x5e0e('0x11'));var as=require(_0x5e0e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e0e('0x13'));var utils=require('../../config/utils');var config=require(_0x5e0e('0x14'));var licenseUtil=require(_0x5e0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21f7f8,_0x1a9a34){_0x1a9a34=_0x1a9a34||0xcc;return function(_0x2cc522){if(_0x2cc522){return _0x21f7f8[_0x5e0e('0x16')](_0x1a9a34);}return _0x21f7f8[_0x5e0e('0x17')](_0x1a9a34)[_0x5e0e('0x18')]();};}function respondWithResult(_0xc4d429,_0x229dd5){_0x229dd5=_0x229dd5||0xc8;return function(_0x472bbe){if(_0x472bbe){return _0xc4d429[_0x5e0e('0x17')](_0x229dd5)['json'](_0x472bbe);}};}function respondWithFilteredResult(_0x2d523c,_0x3c9543){return function(_0x1eaa9d){if(_0x1eaa9d){var _0x21ecb5=typeof _0x3c9543[_0x5e0e('0x19')]===_0x5e0e('0x1a')&&typeof _0x3c9543[_0x5e0e('0x1b')]===_0x5e0e('0x1a');var _0x20816e=_0x1eaa9d[_0x5e0e('0x1c')];var _0x15e17c=_0x21ecb5?0x0:_0x3c9543[_0x5e0e('0x19')];var _0x110a62=_0x21ecb5?_0x1eaa9d['count']:_0x3c9543[_0x5e0e('0x19')]+_0x3c9543[_0x5e0e('0x1b')];var _0x4b5f5b;if(_0x110a62>=_0x20816e){_0x110a62=_0x20816e;_0x4b5f5b=0xc8;}else{_0x4b5f5b=0xce;}_0x2d523c['status'](_0x4b5f5b);return _0x2d523c[_0x5e0e('0x1d')]('Content-Range',_0x15e17c+'-'+_0x110a62+'/'+_0x20816e)[_0x5e0e('0x1e')](_0x1eaa9d);}return null;};}function patchUpdates(_0x442541){return function(_0x3d38c0){try{jsonpatch[_0x5e0e('0x1f')](_0x3d38c0,_0x442541,!![]);}catch(_0x59cd53){return BPromise[_0x5e0e('0x20')](_0x59cd53);}return _0x3d38c0[_0x5e0e('0x21')]();};}function saveUpdates(_0x4b404e,_0x3de353){return function(_0x59c5e0){if(_0x59c5e0){return _0x59c5e0[_0x5e0e('0x22')](_0x4b404e)[_0x5e0e('0x23')](function(_0x27fc1a){return _0x27fc1a;});}return null;};}function removeEntity(_0x2b1aeb,_0x1dd647){return function(_0x53fff6){if(_0x53fff6){return _0x53fff6['destroy']()[_0x5e0e('0x23')](function(){_0x2b1aeb[_0x5e0e('0x17')](0xcc)[_0x5e0e('0x18')]();});}};}function handleEntityNotFound(_0x1f99e8,_0x228dd9){return function(_0x343627){if(!_0x343627){_0x1f99e8['sendStatus'](0x194);}return _0x343627;};}function handleError(_0x53b149,_0x1cb2ad){_0x1cb2ad=_0x1cb2ad||0x1f4;return function(_0x41fc98){logger[_0x5e0e('0x24')](_0x41fc98['stack']);if(_0x41fc98['name']){delete _0x41fc98[_0x5e0e('0x25')];}_0x53b149[_0x5e0e('0x17')](_0x1cb2ad)['send'](_0x41fc98);};}exports[_0x5e0e('0x26')]=function(_0x33c134,_0x5c5a1a){var _0x1499c5={},_0x174454={},_0x599f71={'count':0x0,'rows':[]};var _0x49e013=_['map'](db[_0x5e0e('0x27')][_0x5e0e('0x28')],function(_0x4cac8a){return{'name':_0x4cac8a['fieldName'],'type':_0x4cac8a[_0x5e0e('0x29')][_0x5e0e('0x2a')]};});_0x174454[_0x5e0e('0x2b')]=_[_0x5e0e('0x2c')](_0x49e013,_0x5e0e('0x25'));_0x174454[_0x5e0e('0x2d')]=_[_0x5e0e('0x2e')](_0x33c134[_0x5e0e('0x2d')]);_0x174454[_0x5e0e('0x2f')]=_[_0x5e0e('0x30')](_0x174454['model'],_0x174454[_0x5e0e('0x2d')]);_0x1499c5[_0x5e0e('0x31')]=_[_0x5e0e('0x30')](_0x174454[_0x5e0e('0x2b')],qs[_0x5e0e('0x32')](_0x33c134[_0x5e0e('0x2d')][_0x5e0e('0x32')]));_0x1499c5['attributes']=_0x1499c5[_0x5e0e('0x31')][_0x5e0e('0x33')]?_0x1499c5[_0x5e0e('0x31')]:_0x174454[_0x5e0e('0x2b')];if(!_0x33c134['query'][_0x5e0e('0x34')](_0x5e0e('0x35'))){_0x1499c5[_0x5e0e('0x1b')]=qs['limit'](_0x33c134[_0x5e0e('0x2d')][_0x5e0e('0x1b')]);_0x1499c5['offset']=qs[_0x5e0e('0x19')](_0x33c134[_0x5e0e('0x2d')]['offset']);}_0x1499c5[_0x5e0e('0x36')]=qs['sort'](_0x33c134[_0x5e0e('0x2d')][_0x5e0e('0x37')]);_0x1499c5[_0x5e0e('0x38')]=qs['filters'](_[_0x5e0e('0x39')](_0x33c134[_0x5e0e('0x2d')],_0x174454[_0x5e0e('0x2f')]),_0x49e013);if(_0x33c134[_0x5e0e('0x2d')][_0x5e0e('0x3a')]){_0x1499c5[_0x5e0e('0x38')]=_[_0x5e0e('0x3b')](_0x1499c5[_0x5e0e('0x38')],{'$or':_[_0x5e0e('0x2c')](_0x49e013,function(_0x57ad8d){if(_0x57ad8d[_0x5e0e('0x29')]!==_0x5e0e('0x3c')){var _0x4aea44={};_0x4aea44[_0x57ad8d['name']]={'$like':'%'+_0x33c134[_0x5e0e('0x2d')][_0x5e0e('0x3a')]+'%'};return _0x4aea44;}})});}_0x1499c5=_[_0x5e0e('0x3b')]({},_0x1499c5,_0x33c134[_0x5e0e('0x3d')]);var _0x48184c={'where':_0x1499c5['where']};return db[_0x5e0e('0x27')][_0x5e0e('0x1c')](_0x48184c)[_0x5e0e('0x23')](function(_0x411a87){_0x599f71[_0x5e0e('0x1c')]=_0x411a87;if(_0x33c134[_0x5e0e('0x2d')]['includeAll']){_0x1499c5[_0x5e0e('0x3e')]=[{'all':!![]}];}return db[_0x5e0e('0x27')][_0x5e0e('0x3f')](_0x1499c5);})['then'](function(_0x383b5b){_0x599f71[_0x5e0e('0x40')]=_0x383b5b;return _0x599f71;})['then'](respondWithFilteredResult(_0x5c5a1a,_0x1499c5))[_0x5e0e('0x41')](handleError(_0x5c5a1a,null));};exports[_0x5e0e('0x42')]=function(_0x552461,_0x292ae5){var _0x238b89={'raw':![],'where':{'id':_0x552461[_0x5e0e('0x43')]['id']}},_0x3a7c63={};_0x3a7c63['model']=_[_0x5e0e('0x2e')](db['ZendeskConfiguration']['rawAttributes']);_0x3a7c63[_0x5e0e('0x2d')]=_[_0x5e0e('0x2e')](_0x552461[_0x5e0e('0x2d')]);_0x3a7c63[_0x5e0e('0x2f')]=_['intersection'](_0x3a7c63[_0x5e0e('0x2b')],_0x3a7c63[_0x5e0e('0x2d')]);_0x238b89[_0x5e0e('0x31')]=_[_0x5e0e('0x30')](_0x3a7c63[_0x5e0e('0x2b')],qs[_0x5e0e('0x32')](_0x552461['query']['fields']));_0x238b89[_0x5e0e('0x31')]=_0x238b89[_0x5e0e('0x31')]['length']?_0x238b89['attributes']:_0x3a7c63[_0x5e0e('0x2b')];if(_0x552461[_0x5e0e('0x2d')][_0x5e0e('0x44')]){_0x238b89['include']=[{'all':!![]}];}_0x238b89=_['merge']({},_0x238b89,_0x552461[_0x5e0e('0x3d')]);return db[_0x5e0e('0x27')]['find'](_0x238b89)[_0x5e0e('0x23')](handleEntityNotFound(_0x292ae5,null))[_0x5e0e('0x23')](respondWithResult(_0x292ae5,null))[_0x5e0e('0x41')](handleError(_0x292ae5,null));};exports['create']=function(_0x24b8c2,_0x1e651b){return db[_0x5e0e('0x27')][_0x5e0e('0x45')](_0x24b8c2[_0x5e0e('0x46')],{})[_0x5e0e('0x23')](respondWithResult(_0x1e651b,0xc9))['catch'](handleError(_0x1e651b,null));};exports[_0x5e0e('0x22')]=function(_0x267441,_0x14b5c8){if(_0x267441[_0x5e0e('0x46')]['id']){delete _0x267441[_0x5e0e('0x46')]['id'];}return db[_0x5e0e('0x27')][_0x5e0e('0x47')]({'where':{'id':_0x267441[_0x5e0e('0x43')]['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0x14b5c8,null))['then'](saveUpdates(_0x267441[_0x5e0e('0x46')],null))[_0x5e0e('0x23')](respondWithResult(_0x14b5c8,null))[_0x5e0e('0x41')](handleError(_0x14b5c8,null));};exports[_0x5e0e('0x48')]=function(_0x23e189,_0x454e40){return db['ZendeskConfiguration']['find']({'where':{'id':_0x23e189['params']['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0x454e40,null))[_0x5e0e('0x23')](removeEntity(_0x454e40,null))[_0x5e0e('0x41')](handleError(_0x454e40,null));};exports[_0x5e0e('0x49')]=function(_0x3f2d4f,_0xdb8a73,_0x1d8eaf){var _0x1a4b65={};var _0x175861={};var _0x3d3aa3;var _0xd396a3;return db[_0x5e0e('0x27')][_0x5e0e('0x4a')]({'where':{'id':_0x3f2d4f[_0x5e0e('0x43')]['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0xdb8a73,null))[_0x5e0e('0x23')](function(_0x5c54dc){if(_0x5c54dc){_0x3d3aa3=_0x5c54dc;_0x175861[_0x5e0e('0x2b')]=_[_0x5e0e('0x2e')](db[_0x5e0e('0x4b')][_0x5e0e('0x28')]);_0x175861['query']=_[_0x5e0e('0x2e')](_0x3f2d4f[_0x5e0e('0x2d')]);_0x175861[_0x5e0e('0x2f')]=_[_0x5e0e('0x30')](_0x175861[_0x5e0e('0x2b')],_0x175861['query']);_0x1a4b65['attributes']=_[_0x5e0e('0x30')](_0x175861['model'],qs['fields'](_0x3f2d4f[_0x5e0e('0x2d')][_0x5e0e('0x32')]));_0x1a4b65[_0x5e0e('0x31')]=_0x1a4b65['attributes'][_0x5e0e('0x33')]?_0x1a4b65[_0x5e0e('0x31')]:_0x175861[_0x5e0e('0x2b')];_0x1a4b65[_0x5e0e('0x36')]=qs[_0x5e0e('0x37')](_0x3f2d4f[_0x5e0e('0x2d')]['sort']);_0x1a4b65[_0x5e0e('0x38')]=qs[_0x5e0e('0x2f')](_['pick'](_0x3f2d4f['query'],_0x175861[_0x5e0e('0x2f')]));if(_0x3f2d4f[_0x5e0e('0x2d')][_0x5e0e('0x3a')]){_0x1a4b65['where']=_[_0x5e0e('0x3b')](_0x1a4b65[_0x5e0e('0x38')],{'$or':_['map'](_0x1a4b65[_0x5e0e('0x31')],function(_0x43e5b2){var _0x549dd9={};_0x549dd9[_0x43e5b2]={'$like':'%'+_0x3f2d4f['query'][_0x5e0e('0x3a')]+'%'};return _0x549dd9;})});}_0x1a4b65=_[_0x5e0e('0x3b')]({},_0x1a4b65,_0x3f2d4f[_0x5e0e('0x3d')]);return _0x3d3aa3['getFields'](_0x1a4b65);}})[_0x5e0e('0x23')](function(_0x1c96bc){if(_0x1c96bc){_0xd396a3=_0x1c96bc[_0x5e0e('0x33')];if(!_0x3f2d4f[_0x5e0e('0x2d')]['hasOwnProperty'](_0x5e0e('0x35'))){_0x1a4b65['limit']=qs[_0x5e0e('0x1b')](_0x3f2d4f[_0x5e0e('0x2d')]['limit']);_0x1a4b65[_0x5e0e('0x19')]=qs['offset'](_0x3f2d4f['query'][_0x5e0e('0x19')]);}return _0x3d3aa3[_0x5e0e('0x49')](_0x1a4b65);}})[_0x5e0e('0x23')](function(_0x2f0786){if(_0x2f0786){return _0x2f0786?{'count':_0xd396a3,'rows':_0x2f0786}:null;}})['then'](respondWithResult(_0xdb8a73,null))[_0x5e0e('0x41')](handleError(_0xdb8a73,null));};exports[_0x5e0e('0x4c')]=function(_0x5dde2b,_0x29d923,_0x40457c){var _0x3babc1={};var _0x436c74={};var _0x1aecdb;var _0x38d11e;return db[_0x5e0e('0x27')][_0x5e0e('0x4a')]({'where':{'id':_0x5dde2b['params']['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0x29d923,null))[_0x5e0e('0x23')](function(_0x1b6f07){if(_0x1b6f07){_0x1aecdb=_0x1b6f07;_0x436c74[_0x5e0e('0x2b')]=_[_0x5e0e('0x2e')](db[_0x5e0e('0x4b')][_0x5e0e('0x28')]);_0x436c74[_0x5e0e('0x2d')]=_[_0x5e0e('0x2e')](_0x5dde2b[_0x5e0e('0x2d')]);_0x436c74['filters']=_[_0x5e0e('0x30')](_0x436c74[_0x5e0e('0x2b')],_0x436c74[_0x5e0e('0x2d')]);_0x3babc1[_0x5e0e('0x31')]=_[_0x5e0e('0x30')](_0x436c74[_0x5e0e('0x2b')],qs['fields'](_0x5dde2b[_0x5e0e('0x2d')][_0x5e0e('0x32')]));_0x3babc1[_0x5e0e('0x31')]=_0x3babc1[_0x5e0e('0x31')][_0x5e0e('0x33')]?_0x3babc1['attributes']:_0x436c74['model'];_0x3babc1[_0x5e0e('0x36')]=qs[_0x5e0e('0x37')](_0x5dde2b['query']['sort']);_0x3babc1['where']=qs[_0x5e0e('0x2f')](_[_0x5e0e('0x39')](_0x5dde2b[_0x5e0e('0x2d')],_0x436c74[_0x5e0e('0x2f')]));if(_0x5dde2b[_0x5e0e('0x2d')][_0x5e0e('0x3a')]){_0x3babc1[_0x5e0e('0x38')]=_[_0x5e0e('0x3b')](_0x3babc1[_0x5e0e('0x38')],{'$or':_[_0x5e0e('0x2c')](_0x3babc1[_0x5e0e('0x31')],function(_0x15cec9){var _0x31c83b={};_0x31c83b[_0x15cec9]={'$like':'%'+_0x5dde2b['query'][_0x5e0e('0x3a')]+'%'};return _0x31c83b;})});}_0x3babc1=_[_0x5e0e('0x3b')]({},_0x3babc1,_0x5dde2b[_0x5e0e('0x3d')]);return _0x1aecdb[_0x5e0e('0x4c')](_0x3babc1);}})[_0x5e0e('0x23')](function(_0x21124b){if(_0x21124b){_0x38d11e=_0x21124b[_0x5e0e('0x33')];if(!_0x5dde2b[_0x5e0e('0x2d')][_0x5e0e('0x34')](_0x5e0e('0x35'))){_0x3babc1['limit']=qs[_0x5e0e('0x1b')](_0x5dde2b[_0x5e0e('0x2d')][_0x5e0e('0x1b')]);_0x3babc1[_0x5e0e('0x19')]=qs[_0x5e0e('0x19')](_0x5dde2b[_0x5e0e('0x2d')][_0x5e0e('0x19')]);}return _0x1aecdb[_0x5e0e('0x4c')](_0x3babc1);}})['then'](function(_0x191f9f){if(_0x191f9f){return _0x191f9f?{'count':_0x38d11e,'rows':_0x191f9f}:null;}})[_0x5e0e('0x23')](respondWithResult(_0x29d923,null))['catch'](handleError(_0x29d923,null));};exports['getDescriptions']=function(_0x28ae7b,_0x596f41,_0x3be9d3){var _0x4a6cbc={};var _0x286b0c={};var _0x33d497;var _0x119c78;return db[_0x5e0e('0x27')][_0x5e0e('0x4a')]({'where':{'id':_0x28ae7b[_0x5e0e('0x43')]['id']}})['then'](handleEntityNotFound(_0x596f41,null))[_0x5e0e('0x23')](function(_0x4333eb){if(_0x4333eb){_0x33d497=_0x4333eb;_0x286b0c[_0x5e0e('0x2b')]=_[_0x5e0e('0x2e')](db[_0x5e0e('0x4b')][_0x5e0e('0x28')]);_0x286b0c[_0x5e0e('0x2d')]=_['keys'](_0x28ae7b[_0x5e0e('0x2d')]);_0x286b0c[_0x5e0e('0x2f')]=_[_0x5e0e('0x30')](_0x286b0c['model'],_0x286b0c[_0x5e0e('0x2d')]);_0x4a6cbc[_0x5e0e('0x31')]=_[_0x5e0e('0x30')](_0x286b0c['model'],qs[_0x5e0e('0x32')](_0x28ae7b[_0x5e0e('0x2d')]['fields']));_0x4a6cbc[_0x5e0e('0x31')]=_0x4a6cbc['attributes']['length']?_0x4a6cbc['attributes']:_0x286b0c[_0x5e0e('0x2b')];_0x4a6cbc[_0x5e0e('0x36')]=qs[_0x5e0e('0x37')](_0x28ae7b[_0x5e0e('0x2d')]['sort']);_0x4a6cbc[_0x5e0e('0x38')]=qs['filters'](_[_0x5e0e('0x39')](_0x28ae7b['query'],_0x286b0c[_0x5e0e('0x2f')]));if(_0x28ae7b[_0x5e0e('0x2d')][_0x5e0e('0x3a')]){_0x4a6cbc[_0x5e0e('0x38')]=_['merge'](_0x4a6cbc[_0x5e0e('0x38')],{'$or':_['map'](_0x4a6cbc[_0x5e0e('0x31')],function(_0x27ee45){var _0x464e86={};_0x464e86[_0x27ee45]={'$like':'%'+_0x28ae7b[_0x5e0e('0x2d')][_0x5e0e('0x3a')]+'%'};return _0x464e86;})});}_0x4a6cbc=_[_0x5e0e('0x3b')]({},_0x4a6cbc,_0x28ae7b[_0x5e0e('0x3d')]);return _0x33d497['getDescriptions'](_0x4a6cbc);}})['then'](function(_0x4cb01f){if(_0x4cb01f){_0x119c78=_0x4cb01f['length'];if(!_0x28ae7b['query'][_0x5e0e('0x34')](_0x5e0e('0x35'))){_0x4a6cbc[_0x5e0e('0x1b')]=qs[_0x5e0e('0x1b')](_0x28ae7b[_0x5e0e('0x2d')][_0x5e0e('0x1b')]);_0x4a6cbc[_0x5e0e('0x19')]=qs[_0x5e0e('0x19')](_0x28ae7b[_0x5e0e('0x2d')]['offset']);}return _0x33d497['getDescriptions'](_0x4a6cbc);}})[_0x5e0e('0x23')](function(_0x21dff8){if(_0x21dff8){return _0x21dff8?{'count':_0x119c78,'rows':_0x21dff8}:null;}})[_0x5e0e('0x23')](respondWithResult(_0x596f41,null))[_0x5e0e('0x41')](handleError(_0x596f41,null));};exports[_0x5e0e('0x4d')]=function(_0x3920f6,_0x44ccf7,_0x37c320){var _0xe04bd5={};var _0x3dcf61={};var _0x2c3cb0;var _0x429c8e;return db[_0x5e0e('0x27')][_0x5e0e('0x4a')]({'where':{'id':_0x3920f6[_0x5e0e('0x43')]['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0x44ccf7,null))['then'](function(_0x341369){if(_0x341369){_0x2c3cb0=_0x341369;_0x3dcf61[_0x5e0e('0x2b')]=_[_0x5e0e('0x2e')](db[_0x5e0e('0x4e')][_0x5e0e('0x28')]);_0x3dcf61[_0x5e0e('0x2d')]=_[_0x5e0e('0x2e')](_0x3920f6[_0x5e0e('0x2d')]);_0x3dcf61[_0x5e0e('0x2f')]=_[_0x5e0e('0x30')](_0x3dcf61[_0x5e0e('0x2b')],_0x3dcf61[_0x5e0e('0x2d')]);_0xe04bd5[_0x5e0e('0x31')]=_['intersection'](_0x3dcf61[_0x5e0e('0x2b')],qs[_0x5e0e('0x32')](_0x3920f6[_0x5e0e('0x2d')]['fields']));_0xe04bd5[_0x5e0e('0x31')]=_0xe04bd5['attributes'][_0x5e0e('0x33')]?_0xe04bd5['attributes']:_0x3dcf61[_0x5e0e('0x2b')];_0xe04bd5['order']=qs[_0x5e0e('0x37')](_0x3920f6['query'][_0x5e0e('0x37')]);_0xe04bd5[_0x5e0e('0x38')]=qs[_0x5e0e('0x2f')](_[_0x5e0e('0x39')](_0x3920f6[_0x5e0e('0x2d')],_0x3dcf61[_0x5e0e('0x2f')]));if(_0x3920f6['query'][_0x5e0e('0x3a')]){_0xe04bd5['where']=_['merge'](_0xe04bd5['where'],{'$or':_[_0x5e0e('0x2c')](_0xe04bd5[_0x5e0e('0x31')],function(_0x415239){var _0x521fd1={};_0x521fd1[_0x415239]={'$like':'%'+_0x3920f6[_0x5e0e('0x2d')][_0x5e0e('0x3a')]+'%'};return _0x521fd1;})});}_0xe04bd5=_['merge']({},_0xe04bd5,_0x3920f6[_0x5e0e('0x3d')]);return _0x2c3cb0['getTags'](_0xe04bd5);}})[_0x5e0e('0x23')](function(_0x4663fb){if(_0x4663fb){_0x429c8e=_0x4663fb[_0x5e0e('0x33')];if(!_0x3920f6[_0x5e0e('0x2d')]['hasOwnProperty']('nolimit')){_0xe04bd5['limit']=qs[_0x5e0e('0x1b')](_0x3920f6[_0x5e0e('0x2d')][_0x5e0e('0x1b')]);_0xe04bd5[_0x5e0e('0x19')]=qs[_0x5e0e('0x19')](_0x3920f6[_0x5e0e('0x2d')][_0x5e0e('0x19')]);}return _0x2c3cb0[_0x5e0e('0x4d')](_0xe04bd5);}})[_0x5e0e('0x23')](function(_0x2fbd78){if(_0x2fbd78){return _0x2fbd78?{'count':_0x429c8e,'rows':_0x2fbd78}:null;}})[_0x5e0e('0x23')](respondWithResult(_0x44ccf7,null))[_0x5e0e('0x41')](handleError(_0x44ccf7,null));};exports[_0x5e0e('0x4f')]=function(_0x2bd861,_0x185901,_0x4ecbd6){if(_0x2bd861[_0x5e0e('0x46')]['id']){delete _0x2bd861['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2bd861[_0x5e0e('0x43')]['id']}})[_0x5e0e('0x23')](handleEntityNotFound(_0x185901,null))[_0x5e0e('0x23')](function(_0x2a57b0){if(_0x2a57b0){return _0x2a57b0[_0x5e0e('0x4f')](_0x2bd861[_0x5e0e('0x46')]['ids']||[]);}return null;})[_0x5e0e('0x23')](respondWithResult(_0x185901,null))['catch'](handleError(_0x185901,null));}; \ No newline at end of file +var _0xee25=['fieldName','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','filters','includeAll','find','create','body','params','getFields','findOne','ZendeskField','hasOwnProperty','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskConfiguration','rawAttributes'];(function(_0x4a93be,_0x4bc1b4){var _0x14733e=function(_0xda849c){while(--_0xda849c){_0x4a93be['push'](_0x4a93be['shift']());}};_0x14733e(++_0x4bc1b4);}(_0xee25,0xd8));var _0x5ee2=function(_0x4b644f,_0x405ecd){_0x4b644f=_0x4b644f-0x0;var _0x1e6bdb=_0xee25[_0x4b644f];return _0x1e6bdb;};'use strict';var emlformat=require(_0x5ee2('0x0'));var rimraf=require(_0x5ee2('0x1'));var zipdir=require(_0x5ee2('0x2'));var jsonpatch=require(_0x5ee2('0x3'));var rp=require(_0x5ee2('0x4'));var moment=require(_0x5ee2('0x5'));var BPromise=require(_0x5ee2('0x6'));var Mustache=require(_0x5ee2('0x7'));var util=require(_0x5ee2('0x8'));var path=require(_0x5ee2('0x9'));var sox=require(_0x5ee2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ee2('0xb'));var _=require(_0x5ee2('0xc'));var squel=require(_0x5ee2('0xd'));var crypto=require('crypto');var jsforce=require(_0x5ee2('0xe'));var deskjs=require(_0x5ee2('0xf'));var toCsv=require(_0x5ee2('0x10'));var querystring=require(_0x5ee2('0x11'));var Papa=require(_0x5ee2('0x12'));var Redis=require(_0x5ee2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5ee2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ee2('0x15'));var logger=require(_0x5ee2('0x16'))(_0x5ee2('0x17'));var utils=require('../../config/utils');var config=require(_0x5ee2('0x18'));var licenseUtil=require(_0x5ee2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f98d3,_0x3930da){_0x3930da=_0x3930da||0xcc;return function(_0x1fa415){if(_0x1fa415){return _0x4f98d3[_0x5ee2('0x1a')](_0x3930da);}return _0x4f98d3[_0x5ee2('0x1b')](_0x3930da)[_0x5ee2('0x1c')]();};}function respondWithResult(_0x1f9b9f,_0x4b2c43){_0x4b2c43=_0x4b2c43||0xc8;return function(_0x3ca82a){if(_0x3ca82a){return _0x1f9b9f[_0x5ee2('0x1b')](_0x4b2c43)[_0x5ee2('0x1d')](_0x3ca82a);}};}function respondWithFilteredResult(_0x365705,_0x3111d9){return function(_0x4fef44){if(_0x4fef44){var _0x3a7cea=typeof _0x3111d9[_0x5ee2('0x1e')]===_0x5ee2('0x1f')&&typeof _0x3111d9[_0x5ee2('0x20')]===_0x5ee2('0x1f');var _0x418c62=_0x4fef44[_0x5ee2('0x21')];var _0x478456=_0x3a7cea?0x0:_0x3111d9[_0x5ee2('0x1e')];var _0x30c2df=_0x3a7cea?_0x4fef44['count']:_0x3111d9[_0x5ee2('0x1e')]+_0x3111d9[_0x5ee2('0x20')];var _0x14fe65;if(_0x30c2df>=_0x418c62){_0x30c2df=_0x418c62;_0x14fe65=0xc8;}else{_0x14fe65=0xce;}_0x365705[_0x5ee2('0x1b')](_0x14fe65);return _0x365705[_0x5ee2('0x22')](_0x5ee2('0x23'),_0x478456+'-'+_0x30c2df+'/'+_0x418c62)['json'](_0x4fef44);}return null;};}function patchUpdates(_0x318417){return function(_0x1d27f7){try{jsonpatch[_0x5ee2('0x24')](_0x1d27f7,_0x318417,!![]);}catch(_0x2afa2a){return BPromise[_0x5ee2('0x25')](_0x2afa2a);}return _0x1d27f7['save']();};}function saveUpdates(_0x1a17fd,_0x5392a2){return function(_0xa2c0d8){if(_0xa2c0d8){return _0xa2c0d8[_0x5ee2('0x26')](_0x1a17fd)[_0x5ee2('0x27')](function(_0x3800c0){return _0x3800c0;});}return null;};}function removeEntity(_0x546692,_0x278536){return function(_0x1b063c){if(_0x1b063c){return _0x1b063c[_0x5ee2('0x28')]()['then'](function(){_0x546692[_0x5ee2('0x1b')](0xcc)[_0x5ee2('0x1c')]();});}};}function handleEntityNotFound(_0x48cc32,_0xeda1c0){return function(_0xa4edaa){if(!_0xa4edaa){_0x48cc32[_0x5ee2('0x1a')](0x194);}return _0xa4edaa;};}function handleError(_0x55c88e,_0x20114f){_0x20114f=_0x20114f||0x1f4;return function(_0x4d0aab){logger[_0x5ee2('0x29')](_0x4d0aab[_0x5ee2('0x2a')]);if(_0x4d0aab[_0x5ee2('0x2b')]){delete _0x4d0aab[_0x5ee2('0x2b')];}_0x55c88e[_0x5ee2('0x1b')](_0x20114f)[_0x5ee2('0x2c')](_0x4d0aab);};}exports[_0x5ee2('0x2d')]=function(_0x1b7540,_0x5dafec){var _0xa7faf7={},_0x52804f={},_0x3ce2a8={'count':0x0,'rows':[]};var _0x2d23c8=_['map'](db[_0x5ee2('0x2e')][_0x5ee2('0x2f')],function(_0x10560d){return{'name':_0x10560d[_0x5ee2('0x30')],'type':_0x10560d['type'][_0x5ee2('0x31')]};});_0x52804f[_0x5ee2('0x32')]=_[_0x5ee2('0x33')](_0x2d23c8,'name');_0x52804f[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x1b7540[_0x5ee2('0x34')]);_0x52804f['filters']=_['intersection'](_0x52804f['model'],_0x52804f[_0x5ee2('0x34')]);_0xa7faf7[_0x5ee2('0x36')]=_[_0x5ee2('0x37')](_0x52804f[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x1b7540[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0xa7faf7['attributes']=_0xa7faf7[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0xa7faf7[_0x5ee2('0x36')]:_0x52804f[_0x5ee2('0x32')];if(!_0x1b7540[_0x5ee2('0x34')]['hasOwnProperty'](_0x5ee2('0x3a'))){_0xa7faf7[_0x5ee2('0x20')]=qs['limit'](_0x1b7540[_0x5ee2('0x34')]['limit']);_0xa7faf7[_0x5ee2('0x1e')]=qs['offset'](_0x1b7540['query'][_0x5ee2('0x1e')]);}_0xa7faf7['order']=qs[_0x5ee2('0x3b')](_0x1b7540[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0xa7faf7[_0x5ee2('0x3c')]=qs['filters'](_['pick'](_0x1b7540['query'],_0x52804f['filters']),_0x2d23c8);if(_0x1b7540[_0x5ee2('0x34')]['filter']){_0xa7faf7[_0x5ee2('0x3c')]=_['merge'](_0xa7faf7[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x2d23c8,function(_0xeb5403){if(_0xeb5403['type']!==_0x5ee2('0x3d')){var _0x11553e={};_0x11553e[_0xeb5403[_0x5ee2('0x2b')]]={'$like':'%'+_0x1b7540['query'][_0x5ee2('0x3e')]+'%'};return _0x11553e;}})});}_0xa7faf7=_[_0x5ee2('0x3f')]({},_0xa7faf7,_0x1b7540[_0x5ee2('0x40')]);var _0x8d65ec={'where':_0xa7faf7['where']};return db[_0x5ee2('0x2e')][_0x5ee2('0x21')](_0x8d65ec)['then'](function(_0x37fd13){_0x3ce2a8['count']=_0x37fd13;if(_0x1b7540['query']['includeAll']){_0xa7faf7[_0x5ee2('0x41')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x5ee2('0x42')](_0xa7faf7);})[_0x5ee2('0x27')](function(_0x11a64a){_0x3ce2a8[_0x5ee2('0x43')]=_0x11a64a;return _0x3ce2a8;})['then'](respondWithFilteredResult(_0x5dafec,_0xa7faf7))[_0x5ee2('0x44')](handleError(_0x5dafec,null));};exports[_0x5ee2('0x45')]=function(_0x38f08b,_0x5e4504){var _0x2f0e9d={'raw':![],'where':{'id':_0x38f08b['params']['id']}},_0x2fbeb2={};_0x2fbeb2[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db['ZendeskConfiguration']['rawAttributes']);_0x2fbeb2[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x38f08b[_0x5ee2('0x34')]);_0x2fbeb2[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x2fbeb2['model'],_0x2fbeb2['query']);_0x2f0e9d[_0x5ee2('0x36')]=_['intersection'](_0x2fbeb2['model'],qs[_0x5ee2('0x38')](_0x38f08b[_0x5ee2('0x34')]['fields']));_0x2f0e9d[_0x5ee2('0x36')]=_0x2f0e9d[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x2f0e9d[_0x5ee2('0x36')]:_0x2fbeb2['model'];if(_0x38f08b['query'][_0x5ee2('0x47')]){_0x2f0e9d[_0x5ee2('0x41')]=[{'all':!![]}];}_0x2f0e9d=_[_0x5ee2('0x3f')]({},_0x2f0e9d,_0x38f08b['options']);return db[_0x5ee2('0x2e')][_0x5ee2('0x48')](_0x2f0e9d)['then'](handleEntityNotFound(_0x5e4504,null))['then'](respondWithResult(_0x5e4504,null))['catch'](handleError(_0x5e4504,null));};exports[_0x5ee2('0x49')]=function(_0x2d90b2,_0x534dcf){return db[_0x5ee2('0x2e')][_0x5ee2('0x49')](_0x2d90b2[_0x5ee2('0x4a')],{})[_0x5ee2('0x27')](respondWithResult(_0x534dcf,0xc9))[_0x5ee2('0x44')](handleError(_0x534dcf,null));};exports['update']=function(_0x1aec06,_0x3e6f1a){if(_0x1aec06[_0x5ee2('0x4a')]['id']){delete _0x1aec06[_0x5ee2('0x4a')]['id'];}return db[_0x5ee2('0x2e')][_0x5ee2('0x48')]({'where':{'id':_0x1aec06[_0x5ee2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e6f1a,null))[_0x5ee2('0x27')](saveUpdates(_0x1aec06[_0x5ee2('0x4a')],null))[_0x5ee2('0x27')](respondWithResult(_0x3e6f1a,null))[_0x5ee2('0x44')](handleError(_0x3e6f1a,null));};exports[_0x5ee2('0x28')]=function(_0x3aaacd,_0x22a161){return db[_0x5ee2('0x2e')][_0x5ee2('0x48')]({'where':{'id':_0x3aaacd['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x22a161,null))[_0x5ee2('0x27')](removeEntity(_0x22a161,null))[_0x5ee2('0x44')](handleError(_0x22a161,null));};exports[_0x5ee2('0x4c')]=function(_0x3d6a32,_0x47a219,_0x2575e4){var _0x48aed1={};var _0x2b876b={};var _0x3f264d;var _0x3036b9;return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x3d6a32[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x47a219,null))['then'](function(_0x5b61ff){if(_0x5b61ff){_0x3f264d=_0x5b61ff;_0x2b876b['model']=_[_0x5ee2('0x35')](db[_0x5ee2('0x4e')][_0x5ee2('0x2f')]);_0x2b876b[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x3d6a32[_0x5ee2('0x34')]);_0x2b876b[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x2b876b[_0x5ee2('0x32')],_0x2b876b[_0x5ee2('0x34')]);_0x48aed1[_0x5ee2('0x36')]=_['intersection'](_0x2b876b[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x3d6a32['query'][_0x5ee2('0x38')]));_0x48aed1[_0x5ee2('0x36')]=_0x48aed1[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x48aed1[_0x5ee2('0x36')]:_0x2b876b[_0x5ee2('0x32')];_0x48aed1['order']=qs['sort'](_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x48aed1[_0x5ee2('0x3c')]=qs['filters'](_['pick'](_0x3d6a32[_0x5ee2('0x34')],_0x2b876b[_0x5ee2('0x46')]));if(_0x3d6a32[_0x5ee2('0x34')]['filter']){_0x48aed1[_0x5ee2('0x3c')]=_[_0x5ee2('0x3f')](_0x48aed1[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x48aed1[_0x5ee2('0x36')],function(_0x3fb90f){var _0x4e1ee1={};_0x4e1ee1[_0x3fb90f]={'$like':'%'+_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x4e1ee1;})});}_0x48aed1=_['merge']({},_0x48aed1,_0x3d6a32[_0x5ee2('0x40')]);return _0x3f264d['getFields'](_0x48aed1);}})[_0x5ee2('0x27')](function(_0x19f4e5){if(_0x19f4e5){_0x3036b9=_0x19f4e5[_0x5ee2('0x39')];if(!_0x3d6a32['query'][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x48aed1[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x20')]);_0x48aed1[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x3d6a32[_0x5ee2('0x34')]['offset']);}return _0x3f264d['getFields'](_0x48aed1);}})['then'](function(_0x3c2996){if(_0x3c2996){return _0x3c2996?{'count':_0x3036b9,'rows':_0x3c2996}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x47a219,null))[_0x5ee2('0x44')](handleError(_0x47a219,null));};exports['getSubjects']=function(_0x49b1d3,_0x8d0e0a,_0x3169ae){var _0x6b0156={};var _0x220107={};var _0x3c34e4;var _0x323a95;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x49b1d3['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x8d0e0a,null))[_0x5ee2('0x27')](function(_0x1e77f3){if(_0x1e77f3){_0x3c34e4=_0x1e77f3;_0x220107[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db[_0x5ee2('0x4e')][_0x5ee2('0x2f')]);_0x220107[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x49b1d3[_0x5ee2('0x34')]);_0x220107['filters']=_[_0x5ee2('0x37')](_0x220107[_0x5ee2('0x32')],_0x220107['query']);_0x6b0156[_0x5ee2('0x36')]=_['intersection'](_0x220107[_0x5ee2('0x32')],qs['fields'](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x6b0156['attributes']=_0x6b0156[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x6b0156[_0x5ee2('0x36')]:_0x220107[_0x5ee2('0x32')];_0x6b0156[_0x5ee2('0x50')]=qs[_0x5ee2('0x3b')](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x6b0156[_0x5ee2('0x3c')]=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x49b1d3[_0x5ee2('0x34')],_0x220107['filters']));if(_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x6b0156['where']=_[_0x5ee2('0x3f')](_0x6b0156[_0x5ee2('0x3c')],{'$or':_['map'](_0x6b0156[_0x5ee2('0x36')],function(_0x1d991b){var _0x5ae065={};_0x5ae065[_0x1d991b]={'$like':'%'+_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x5ae065;})});}_0x6b0156=_['merge']({},_0x6b0156,_0x49b1d3[_0x5ee2('0x40')]);return _0x3c34e4[_0x5ee2('0x52')](_0x6b0156);}})[_0x5ee2('0x27')](function(_0x5c3e53){if(_0x5c3e53){_0x323a95=_0x5c3e53[_0x5ee2('0x39')];if(!_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x6b0156[_0x5ee2('0x20')]=qs['limit'](_0x49b1d3['query']['limit']);_0x6b0156['offset']=qs[_0x5ee2('0x1e')](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x1e')]);}return _0x3c34e4[_0x5ee2('0x52')](_0x6b0156);}})[_0x5ee2('0x27')](function(_0x4817e1){if(_0x4817e1){return _0x4817e1?{'count':_0x323a95,'rows':_0x4817e1}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x8d0e0a,null))['catch'](handleError(_0x8d0e0a,null));};exports[_0x5ee2('0x53')]=function(_0x1677f6,_0x407554,_0x23f5eb){var _0x135844={};var _0x1a7710={};var _0x3431e4;var _0x1b0ca6;return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x1677f6['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x407554,null))[_0x5ee2('0x27')](function(_0x15195c){if(_0x15195c){_0x3431e4=_0x15195c;_0x1a7710['model']=_[_0x5ee2('0x35')](db['ZendeskField']['rawAttributes']);_0x1a7710[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x1677f6['query']);_0x1a7710[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x1a7710[_0x5ee2('0x32')],_0x1a7710[_0x5ee2('0x34')]);_0x135844[_0x5ee2('0x36')]=_[_0x5ee2('0x37')](_0x1a7710[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x135844[_0x5ee2('0x36')]=_0x135844[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x135844[_0x5ee2('0x36')]:_0x1a7710[_0x5ee2('0x32')];_0x135844[_0x5ee2('0x50')]=qs['sort'](_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x135844['where']=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x1677f6[_0x5ee2('0x34')],_0x1a7710[_0x5ee2('0x46')]));if(_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x135844['where']=_[_0x5ee2('0x3f')](_0x135844[_0x5ee2('0x3c')],{'$or':_['map'](_0x135844[_0x5ee2('0x36')],function(_0x8d257a){var _0xfaf365={};_0xfaf365[_0x8d257a]={'$like':'%'+_0x1677f6[_0x5ee2('0x34')]['filter']+'%'};return _0xfaf365;})});}_0x135844=_[_0x5ee2('0x3f')]({},_0x135844,_0x1677f6[_0x5ee2('0x40')]);return _0x3431e4[_0x5ee2('0x53')](_0x135844);}})[_0x5ee2('0x27')](function(_0x407f75){if(_0x407f75){_0x1b0ca6=_0x407f75['length'];if(!_0x1677f6[_0x5ee2('0x34')]['hasOwnProperty'](_0x5ee2('0x3a'))){_0x135844[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x1677f6['query'][_0x5ee2('0x20')]);_0x135844[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x1677f6['query'][_0x5ee2('0x1e')]);}return _0x3431e4[_0x5ee2('0x53')](_0x135844);}})[_0x5ee2('0x27')](function(_0x27345d){if(_0x27345d){return _0x27345d?{'count':_0x1b0ca6,'rows':_0x27345d}:null;}})['then'](respondWithResult(_0x407554,null))[_0x5ee2('0x44')](handleError(_0x407554,null));};exports[_0x5ee2('0x54')]=function(_0x5caf8e,_0x2c7335,_0x5e7ea1){var _0x295223={};var _0x4d1584={};var _0x33eb6a;var _0x3bbf3d;return db[_0x5ee2('0x2e')]['findOne']({'where':{'id':_0x5caf8e[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x2c7335,null))[_0x5ee2('0x27')](function(_0x16519e){if(_0x16519e){_0x33eb6a=_0x16519e;_0x4d1584[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db[_0x5ee2('0x55')][_0x5ee2('0x2f')]);_0x4d1584['query']=_[_0x5ee2('0x35')](_0x5caf8e['query']);_0x4d1584[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x4d1584[_0x5ee2('0x32')],_0x4d1584[_0x5ee2('0x34')]);_0x295223[_0x5ee2('0x36')]=_['intersection'](_0x4d1584['model'],qs['fields'](_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x295223[_0x5ee2('0x36')]=_0x295223[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x295223[_0x5ee2('0x36')]:_0x4d1584[_0x5ee2('0x32')];_0x295223[_0x5ee2('0x50')]=qs[_0x5ee2('0x3b')](_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x295223[_0x5ee2('0x3c')]=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x5caf8e[_0x5ee2('0x34')],_0x4d1584[_0x5ee2('0x46')]));if(_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x295223[_0x5ee2('0x3c')]=_[_0x5ee2('0x3f')](_0x295223[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x295223[_0x5ee2('0x36')],function(_0x38b515){var _0x2bb0d3={};_0x2bb0d3[_0x38b515]={'$like':'%'+_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x2bb0d3;})});}_0x295223=_[_0x5ee2('0x3f')]({},_0x295223,_0x5caf8e['options']);return _0x33eb6a[_0x5ee2('0x54')](_0x295223);}})[_0x5ee2('0x27')](function(_0x171a81){if(_0x171a81){_0x3bbf3d=_0x171a81[_0x5ee2('0x39')];if(!_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x295223[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x5caf8e[_0x5ee2('0x34')]['limit']);_0x295223[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x5caf8e['query'][_0x5ee2('0x1e')]);}return _0x33eb6a[_0x5ee2('0x54')](_0x295223);}})[_0x5ee2('0x27')](function(_0x405685){if(_0x405685){return _0x405685?{'count':_0x3bbf3d,'rows':_0x405685}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x2c7335,null))['catch'](handleError(_0x2c7335,null));};exports[_0x5ee2('0x56')]=function(_0x3fd19b,_0x3fdbbd,_0x5fd7d6){if(_0x3fd19b[_0x5ee2('0x4a')]['id']){delete _0x3fd19b[_0x5ee2('0x4a')]['id'];}return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x3fd19b[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x3fdbbd,null))[_0x5ee2('0x27')](function(_0x25d6a0){if(_0x25d6a0){return _0x25d6a0[_0x5ee2('0x56')](_0x3fd19b[_0x5ee2('0x4a')][_0x5ee2('0x57')]||[]);}return null;})[_0x5ee2('0x27')](respondWithResult(_0x3fdbbd,null))[_0x5ee2('0x44')](handleError(_0x3fdbbd,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bbde908..bc51292 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 _0x02ce=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash'];(function(_0x23e6a4,_0x40750a){var _0x5a3f9e=function(_0x405632){while(--_0x405632){_0x23e6a4['push'](_0x23e6a4['shift']());}};_0x5a3f9e(++_0x40750a);}(_0x02ce,0x1ac));var _0xe02c=function(_0x24643b,_0x3b378a){_0x24643b=_0x24643b-0x0;var _0x570547=_0x02ce[_0x24643b];return _0x570547;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var logger=require(_0xe02c('0x2'))('api');var moment=require(_0xe02c('0x3'));var BPromise=require('bluebird');var rp=require(_0xe02c('0x4'));var fs=require('fs');var path=require(_0xe02c('0x5'));var rimraf=require(_0xe02c('0x6'));var config=require(_0xe02c('0x7'));var attributes=require(_0xe02c('0x8'));module[_0xe02c('0x9')]=function(_0x3f7436,_0x2b804f){return _0x3f7436[_0xe02c('0xa')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x14a228,_0x428059){var _0x1caa95=function(_0x34db3c){while(--_0x34db3c){_0x14a228['push'](_0x14a228['shift']());}};_0x1caa95(++_0x428059);}(_0x056b,0xb6));var _0xb056=function(_0x5d6dfc,_0x43d8d4){_0x5d6dfc=_0x5d6dfc-0x0;var _0x1bfa18=_0x056b[_0x5d6dfc];return _0x1bfa18;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'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 9568ad3..77828c2 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 _0xf18f=['request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x261011,_0x537dfb){var _0x183bff=function(_0x201447){while(--_0x201447){_0x261011['push'](_0x261011['shift']());}};_0x183bff(++_0x537dfb);}(_0xf18f,0xb4));var _0xff18=function(_0xcf06fd,_0x196ec9){_0xcf06fd=_0xcf06fd-0x0;var _0xa5cf96=_0xf18f[_0xcf06fd];return _0xa5cf96;};'use strict';var _=require(_0xff18('0x0'));var util=require(_0xff18('0x1'));var moment=require(_0xff18('0x2'));var BPromise=require(_0xff18('0x3'));var rs=require(_0xff18('0x4'));var fs=require('fs');var Redis=require(_0xff18('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xff18('0x6'));var logger=require(_0xff18('0x7'))(_0xff18('0x8'));var config=require(_0xff18('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff18('0xa')][_0xff18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x223132,_0x4a95a0,_0x3cdbce){return new BPromise(function(_0x232cc6,_0x2314e9){return client[_0xff18('0xc')](_0x223132,_0x3cdbce)[_0xff18('0xd')](function(_0x5ddee5){logger[_0xff18('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4a95a0,_0xff18('0xf'));logger[_0xff18('0x10')](_0xff18('0x11'),_0x4a95a0,_0xff18('0xf'),JSON[_0xff18('0x12')](_0x5ddee5));if(_0x5ddee5['error']){if(_0x5ddee5[_0xff18('0x13')][_0xff18('0x14')]===0x1f4){logger[_0xff18('0x13')](_0xff18('0x15'),_0x4a95a0,_0x5ddee5[_0xff18('0x13')][_0xff18('0x16')]);return _0x2314e9(_0x5ddee5['error'][_0xff18('0x16')]);}logger[_0xff18('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4a95a0,_0x5ddee5[_0xff18('0x13')][_0xff18('0x16')]);return _0x232cc6(_0x5ddee5[_0xff18('0x13')][_0xff18('0x16')]);}else{logger['info'](_0xff18('0x15'),_0x4a95a0,_0xff18('0xf'));_0x232cc6(_0x5ddee5['result'][_0xff18('0x16')]);}})[_0xff18('0x17')](function(_0x5f1605){logger['error'](_0xff18('0x15'),_0x4a95a0,_0x5f1605);_0x2314e9(_0x5f1605);});});} \ No newline at end of file +var _0x095c=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x095c,0xff));var _0xc095=function(_0x22b96b,_0x35470f){_0x22b96b=_0x22b96b-0x0;var _0x493b95=_0x095c[_0x22b96b];return _0x493b95;};'use strict';var _=require(_0xc095('0x0'));var util=require('util');var moment=require(_0xc095('0x1'));var BPromise=require(_0xc095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc095('0x3'));var db=require(_0xc095('0x4'))['db'];var utils=require(_0xc095('0x5'));var logger=require('../../config/logger')(_0xc095('0x6'));var config=require(_0xc095('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc095('0x8')][_0xc095('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7976,_0x121f23,_0x3303d4){return new BPromise(function(_0x104318,_0x54f86c){return client[_0xc095('0xa')](_0x5d7976,_0x3303d4)[_0xc095('0xb')](function(_0x1d261b){logger[_0xc095('0xc')](_0xc095('0xd'),_0x121f23,_0xc095('0xe'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x121f23,_0xc095('0xe'),JSON[_0xc095('0xf')](_0x1d261b));if(_0x1d261b[_0xc095('0x10')]){if(_0x1d261b[_0xc095('0x10')]['code']===0x1f4){logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x1d261b[_0xc095('0x10')]['message']);return _0x54f86c(_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);}logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);return _0x104318(_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);}else{logger['info'](_0xc095('0xd'),_0x121f23,_0xc095('0xe'));_0x104318(_0x1d261b[_0xc095('0x12')][_0xc095('0x11')]);}})[_0xc095('0x13')](function(_0x2151ba){logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x2151ba);_0x54f86c(_0x2151ba);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5b97cb2..e2f58b0 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 _0xa490=['./intZendeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa490,0xfc));var _0x0a49=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa490[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0a49('0x0'));var util=require(_0x0a49('0x1'));var path=require(_0x0a49('0x2'));var timeout=require(_0x0a49('0x3'));var express=require(_0x0a49('0x4'));var router=express[_0x0a49('0x5')]();var fs_extra=require(_0x0a49('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0a49('0x7'));var config=require('../../config/environment');var controller=require(_0x0a49('0x8'));router[_0x0a49('0x9')]('/',auth[_0x0a49('0xa')](),controller[_0x0a49('0xb')]);router[_0x0a49('0x9')]('/:id',auth[_0x0a49('0xa')](),controller[_0x0a49('0xc')]);router[_0x0a49('0xd')]('/',auth[_0x0a49('0xa')](),controller['create']);router[_0x0a49('0xe')](_0x0a49('0xf'),auth[_0x0a49('0xa')](),controller[_0x0a49('0x10')]);router[_0x0a49('0x11')]('/:id',auth[_0x0a49('0xa')](),controller[_0x0a49('0x12')]);module[_0x0a49('0x13')]=router; \ No newline at end of file +var _0x0bd6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x4f98f2,_0x35d270){var _0x595a12=function(_0x1c34e5){while(--_0x1c34e5){_0x4f98f2['push'](_0x4f98f2['shift']());}};_0x595a12(++_0x35d270);}(_0x0bd6,0x95));var _0x60bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bd6[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x60bd('0x0'));var util=require(_0x60bd('0x1'));var path=require(_0x60bd('0x2'));var timeout=require(_0x60bd('0x3'));var express=require(_0x60bd('0x4'));var router=express[_0x60bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x60bd('0x6'));var interaction=require(_0x60bd('0x7'));var config=require(_0x60bd('0x8'));var controller=require('./intZendeskField.controller');router[_0x60bd('0x9')]('/',auth[_0x60bd('0xa')](),controller[_0x60bd('0xb')]);router[_0x60bd('0x9')](_0x60bd('0xc'),auth[_0x60bd('0xa')](),controller['show']);router[_0x60bd('0xd')]('/',auth[_0x60bd('0xa')](),controller['create']);router[_0x60bd('0xe')]('/:id',auth[_0x60bd('0xa')](),controller[_0x60bd('0xf')]);router['delete'](_0x60bd('0xc'),auth['isAuthenticated'](),controller[_0x60bd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 033aaff..14dc66e 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 _0x601d=['string','variable','picklist','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1a2d37,_0x19cd85){var _0x4d5e76=function(_0x4c254d){while(--_0x4c254d){_0x1a2d37['push'](_0x1a2d37['shift']());}};_0x4d5e76(++_0x19cd85);}(_0x601d,0xcc));var _0xd601=function(_0x4718b8,_0x3abbf0){_0x4718b8=_0x4718b8-0x0;var _0x35a58a=_0x601d[_0x4718b8];return _0x35a58a;};'use strict';var Sequelize=require(_0xd601('0x0'));module[_0xd601('0x1')]={'type':{'type':Sequelize[_0xd601('0x2')](_0xd601('0x3'),_0xd601('0x4'),'customVariable','keyValue',_0xd601('0x5')),'defaultValue':_0xd601('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd601('0x2')](_0xd601('0x3'),_0xd601('0x4'),_0xd601('0x6'))},'keyContent':{'type':Sequelize[_0xd601('0x7')]},'idField':{'type':Sequelize[_0xd601('0x7')]},'nameField':{'type':Sequelize[_0xd601('0x7')]},'customField':{'type':Sequelize[_0xd601('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a00=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0x2a00,0x18c));var _0x02a0=function(_0x11b8a5,_0x2b56a0){_0x11b8a5=_0x11b8a5-0x0;var _0x1f64e8=_0x2a00[_0x11b8a5];return _0x1f64e8;};'use strict';var Sequelize=require(_0x02a0('0x0'));module[_0x02a0('0x1')]={'type':{'type':Sequelize[_0x02a0('0x2')](_0x02a0('0x3'),_0x02a0('0x4'),_0x02a0('0x5'),_0x02a0('0x6'),_0x02a0('0x7')),'defaultValue':_0x02a0('0x3')},'content':{'type':Sequelize[_0x02a0('0x8')]},'key':{'type':Sequelize[_0x02a0('0x8')]},'keyType':{'type':Sequelize[_0x02a0('0x2')]('string',_0x02a0('0x4'),_0x02a0('0x5'))},'keyContent':{'type':Sequelize[_0x02a0('0x8')]},'idField':{'type':Sequelize[_0x02a0('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x02a0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02a0('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index e8b056a..63e1758 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 _0x3f1e=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','options','create','body','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','update','then','error','stack','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model'];(function(_0x21a608,_0x513e49){var _0x3fcdc5=function(_0x40ed82){while(--_0x40ed82){_0x21a608['push'](_0x21a608['shift']());}};_0x3fcdc5(++_0x513e49);}(_0x3f1e,0x1dc));var _0xe3f1=function(_0x3fac46,_0x408818){_0x3fac46=_0x3fac46-0x0;var _0x4c2f66=_0x3f1e[_0x3fac46];return _0x4c2f66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3f1('0x0'));var zipdir=require(_0xe3f1('0x1'));var jsonpatch=require(_0xe3f1('0x2'));var rp=require(_0xe3f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe3f1('0x4'));var util=require(_0xe3f1('0x5'));var path=require(_0xe3f1('0x6'));var sox=require(_0xe3f1('0x7'));var csv=require(_0xe3f1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe3f1('0x9'));var _=require('lodash');var squel=require(_0xe3f1('0xa'));var crypto=require(_0xe3f1('0xb'));var jsforce=require(_0xe3f1('0xc'));var deskjs=require(_0xe3f1('0xd'));var toCsv=require(_0xe3f1('0x8'));var querystring=require(_0xe3f1('0xe'));var Papa=require(_0xe3f1('0xf'));var Redis=require(_0xe3f1('0x10'));var authService=require(_0xe3f1('0x11'));var qs=require(_0xe3f1('0x12'));var as=require(_0xe3f1('0x13'));var hardwareService=require(_0xe3f1('0x14'));var logger=require('../../config/logger')(_0xe3f1('0x15'));var utils=require(_0xe3f1('0x16'));var config=require(_0xe3f1('0x17'));var licenseUtil=require(_0xe3f1('0x18'));var db=require(_0xe3f1('0x19'))['db'];function respondWithStatusCode(_0x1ec78b,_0x29bfa2){_0x29bfa2=_0x29bfa2||0xcc;return function(_0x21677f){if(_0x21677f){return _0x1ec78b[_0xe3f1('0x1a')](_0x29bfa2);}return _0x1ec78b[_0xe3f1('0x1b')](_0x29bfa2)[_0xe3f1('0x1c')]();};}function respondWithResult(_0x2eb354,_0x1d4dfb){_0x1d4dfb=_0x1d4dfb||0xc8;return function(_0x74fac1){if(_0x74fac1){return _0x2eb354[_0xe3f1('0x1b')](_0x1d4dfb)['json'](_0x74fac1);}};}function respondWithFilteredResult(_0x3835c5,_0x16e2da){return function(_0x127b4e){if(_0x127b4e){var _0x42c263=typeof _0x16e2da[_0xe3f1('0x1d')]===_0xe3f1('0x1e')&&typeof _0x16e2da['limit']==='undefined';var _0x38dc80=_0x127b4e[_0xe3f1('0x1f')];var _0x32e17f=_0x42c263?0x0:_0x16e2da[_0xe3f1('0x1d')];var _0x57fc47=_0x42c263?_0x127b4e[_0xe3f1('0x1f')]:_0x16e2da[_0xe3f1('0x1d')]+_0x16e2da['limit'];var _0x49d3fb;if(_0x57fc47>=_0x38dc80){_0x57fc47=_0x38dc80;_0x49d3fb=0xc8;}else{_0x49d3fb=0xce;}_0x3835c5[_0xe3f1('0x1b')](_0x49d3fb);return _0x3835c5['set'](_0xe3f1('0x20'),_0x32e17f+'-'+_0x57fc47+'/'+_0x38dc80)[_0xe3f1('0x21')](_0x127b4e);}return null;};}function patchUpdates(_0x36fcea){return function(_0x19aa0f){try{jsonpatch[_0xe3f1('0x22')](_0x19aa0f,_0x36fcea,!![]);}catch(_0x518f22){return BPromise['reject'](_0x518f22);}return _0x19aa0f[_0xe3f1('0x23')]();};}function saveUpdates(_0x38dbe1,_0x4b9aa4){return function(_0x4182e3){if(_0x4182e3){return _0x4182e3[_0xe3f1('0x24')](_0x38dbe1)[_0xe3f1('0x25')](function(_0x5948ee){return _0x5948ee;});}return null;};}function removeEntity(_0x57790c,_0x1abd8d){return function(_0xc55929){if(_0xc55929){return _0xc55929['destroy']()[_0xe3f1('0x25')](function(){_0x57790c[_0xe3f1('0x1b')](0xcc)[_0xe3f1('0x1c')]();});}};}function handleEntityNotFound(_0x5df456,_0x138e00){return function(_0x36c50a){if(!_0x36c50a){_0x5df456[_0xe3f1('0x1a')](0x194);}return _0x36c50a;};}function handleError(_0xdda7a,_0x33efe2){_0x33efe2=_0x33efe2||0x1f4;return function(_0x3b8e54){logger[_0xe3f1('0x26')](_0x3b8e54[_0xe3f1('0x27')]);if(_0x3b8e54['name']){delete _0x3b8e54['name'];}_0xdda7a[_0xe3f1('0x1b')](_0x33efe2)[_0xe3f1('0x28')](_0x3b8e54);};}exports[_0xe3f1('0x29')]=function(_0x5cf25a,_0x5eebc2){var _0xad36e7={},_0x56ba2c={},_0x1b42e5={'count':0x0,'rows':[]};var _0x39e496=_[_0xe3f1('0x2a')](db[_0xe3f1('0x2b')][_0xe3f1('0x2c')],function(_0x301ab9){return{'name':_0x301ab9[_0xe3f1('0x2d')],'type':_0x301ab9[_0xe3f1('0x2e')][_0xe3f1('0x2f')]};});_0x56ba2c[_0xe3f1('0x30')]=_[_0xe3f1('0x2a')](_0x39e496,'name');_0x56ba2c[_0xe3f1('0x31')]=_[_0xe3f1('0x32')](_0x5cf25a[_0xe3f1('0x31')]);_0x56ba2c[_0xe3f1('0x33')]=_['intersection'](_0x56ba2c[_0xe3f1('0x30')],_0x56ba2c[_0xe3f1('0x31')]);_0xad36e7['attributes']=_[_0xe3f1('0x34')](_0x56ba2c['model'],qs[_0xe3f1('0x35')](_0x5cf25a['query']['fields']));_0xad36e7['attributes']=_0xad36e7[_0xe3f1('0x36')][_0xe3f1('0x37')]?_0xad36e7[_0xe3f1('0x36')]:_0x56ba2c['model'];if(!_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x38')]('nolimit')){_0xad36e7['limit']=qs[_0xe3f1('0x39')](_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x39')]);_0xad36e7[_0xe3f1('0x1d')]=qs[_0xe3f1('0x1d')](_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x1d')]);}_0xad36e7[_0xe3f1('0x3a')]=qs[_0xe3f1('0x3b')](_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x3b')]);_0xad36e7[_0xe3f1('0x3c')]=qs[_0xe3f1('0x33')](_[_0xe3f1('0x3d')](_0x5cf25a['query'],_0x56ba2c[_0xe3f1('0x33')]),_0x39e496);if(_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x3e')]){_0xad36e7[_0xe3f1('0x3c')]=_[_0xe3f1('0x3f')](_0xad36e7['where'],{'$or':_[_0xe3f1('0x2a')](_0x39e496,function(_0x30f58d){if(_0x30f58d['type']!=='VIRTUAL'){var _0x249387={};_0x249387[_0x30f58d['name']]={'$like':'%'+_0x5cf25a['query'][_0xe3f1('0x3e')]+'%'};return _0x249387;}})});}_0xad36e7=_[_0xe3f1('0x3f')]({},_0xad36e7,_0x5cf25a['options']);var _0x4b8fb5={'where':_0xad36e7[_0xe3f1('0x3c')]};return db[_0xe3f1('0x2b')]['count'](_0x4b8fb5)['then'](function(_0x21719d){_0x1b42e5[_0xe3f1('0x1f')]=_0x21719d;if(_0x5cf25a[_0xe3f1('0x31')][_0xe3f1('0x40')]){_0xad36e7['include']=[{'all':!![]}];}return db[_0xe3f1('0x2b')][_0xe3f1('0x41')](_0xad36e7);})[_0xe3f1('0x25')](function(_0x3c1ae0){_0x1b42e5[_0xe3f1('0x42')]=_0x3c1ae0;return _0x1b42e5;})[_0xe3f1('0x25')](respondWithFilteredResult(_0x5eebc2,_0xad36e7))[_0xe3f1('0x43')](handleError(_0x5eebc2,null));};exports[_0xe3f1('0x44')]=function(_0x13da17,_0x1d5b33){var _0x2bd6e1={'raw':!![],'where':{'id':_0x13da17[_0xe3f1('0x45')]['id']}},_0x59041a={};_0x59041a[_0xe3f1('0x30')]=_['keys'](db['ZendeskField'][_0xe3f1('0x2c')]);_0x59041a[_0xe3f1('0x31')]=_[_0xe3f1('0x32')](_0x13da17[_0xe3f1('0x31')]);_0x59041a[_0xe3f1('0x33')]=_['intersection'](_0x59041a['model'],_0x59041a[_0xe3f1('0x31')]);_0x2bd6e1['attributes']=_['intersection'](_0x59041a[_0xe3f1('0x30')],qs[_0xe3f1('0x35')](_0x13da17['query'][_0xe3f1('0x35')]));_0x2bd6e1['attributes']=_0x2bd6e1[_0xe3f1('0x36')][_0xe3f1('0x37')]?_0x2bd6e1[_0xe3f1('0x36')]:_0x59041a[_0xe3f1('0x30')];if(_0x13da17[_0xe3f1('0x31')]['includeAll']){_0x2bd6e1['include']=[{'all':!![]}];}_0x2bd6e1=_['merge']({},_0x2bd6e1,_0x13da17[_0xe3f1('0x46')]);return db[_0xe3f1('0x2b')]['find'](_0x2bd6e1)['then'](handleEntityNotFound(_0x1d5b33,null))[_0xe3f1('0x25')](respondWithResult(_0x1d5b33,null))[_0xe3f1('0x43')](handleError(_0x1d5b33,null));};exports[_0xe3f1('0x47')]=function(_0x7bf1d2,_0x2c366b){return db[_0xe3f1('0x2b')][_0xe3f1('0x47')](_0x7bf1d2[_0xe3f1('0x48')],{})['then'](respondWithResult(_0x2c366b,0xc9))[_0xe3f1('0x43')](handleError(_0x2c366b,null));};exports[_0xe3f1('0x24')]=function(_0x3f13da,_0x345e54){if(_0x3f13da[_0xe3f1('0x48')]['id']){delete _0x3f13da['body']['id'];}return db[_0xe3f1('0x2b')]['find']({'where':{'id':_0x3f13da['params']['id']}})[_0xe3f1('0x25')](handleEntityNotFound(_0x345e54,null))[_0xe3f1('0x25')](saveUpdates(_0x3f13da[_0xe3f1('0x48')],null))[_0xe3f1('0x25')](respondWithResult(_0x345e54,null))[_0xe3f1('0x43')](handleError(_0x345e54,null));};exports[_0xe3f1('0x49')]=function(_0x5a5e83,_0x5b7f1e){return db[_0xe3f1('0x2b')][_0xe3f1('0x4a')]({'where':{'id':_0x5a5e83['params']['id']}})[_0xe3f1('0x25')](handleEntityNotFound(_0x5b7f1e,null))[_0xe3f1('0x25')](removeEntity(_0x5b7f1e,null))[_0xe3f1('0x43')](handleError(_0x5b7f1e,null));}; \ No newline at end of file +var _0x893d=['json','offset','undefined','limit','count','reject','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ZendeskField','includeAll','findAll','rows','catch','show','params','create','body','find','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0x480967,_0x70ab20){var _0x4f4bcd=function(_0x1d44b3){while(--_0x1d44b3){_0x480967['push'](_0x480967['shift']());}};_0x4f4bcd(++_0x70ab20);}(_0x893d,0x180));var _0xd893=function(_0xb8ba3e,_0x3554b5){_0xb8ba3e=_0xb8ba3e-0x0;var _0xfe3968=_0x893d[_0xb8ba3e];return _0xfe3968;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd893('0x0'));var rp=require(_0xd893('0x1'));var moment=require(_0xd893('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd893('0x3'));var util=require(_0xd893('0x4'));var path=require(_0xd893('0x5'));var sox=require(_0xd893('0x6'));var csv=require(_0xd893('0x7'));var ejs=require(_0xd893('0x8'));var fs=require('fs');var fs_extra=require(_0xd893('0x9'));var _=require(_0xd893('0xa'));var squel=require(_0xd893('0xb'));var crypto=require('crypto');var jsforce=require(_0xd893('0xc'));var deskjs=require(_0xd893('0xd'));var toCsv=require(_0xd893('0x7'));var querystring=require(_0xd893('0xe'));var Papa=require(_0xd893('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd893('0x10'));var as=require(_0xd893('0x11'));var hardwareService=require(_0xd893('0x12'));var logger=require(_0xd893('0x13'))(_0xd893('0x14'));var utils=require(_0xd893('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd893('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x556d9b,_0x30f69e){_0x30f69e=_0x30f69e||0xcc;return function(_0x446023){if(_0x446023){return _0x556d9b['sendStatus'](_0x30f69e);}return _0x556d9b[_0xd893('0x17')](_0x30f69e)['end']();};}function respondWithResult(_0x356ef2,_0x43bf5f){_0x43bf5f=_0x43bf5f||0xc8;return function(_0x551c8b){if(_0x551c8b){return _0x356ef2[_0xd893('0x17')](_0x43bf5f)[_0xd893('0x18')](_0x551c8b);}};}function respondWithFilteredResult(_0x3d3a82,_0x17ac6e){return function(_0x213e5a){if(_0x213e5a){var _0x4ad936=typeof _0x17ac6e[_0xd893('0x19')]===_0xd893('0x1a')&&typeof _0x17ac6e[_0xd893('0x1b')]===_0xd893('0x1a');var _0x4f2aeb=_0x213e5a[_0xd893('0x1c')];var _0x5bdaae=_0x4ad936?0x0:_0x17ac6e[_0xd893('0x19')];var _0x5513fa=_0x4ad936?_0x213e5a[_0xd893('0x1c')]:_0x17ac6e['offset']+_0x17ac6e[_0xd893('0x1b')];var _0x6412b4;if(_0x5513fa>=_0x4f2aeb){_0x5513fa=_0x4f2aeb;_0x6412b4=0xc8;}else{_0x6412b4=0xce;}_0x3d3a82['status'](_0x6412b4);return _0x3d3a82['set']('Content-Range',_0x5bdaae+'-'+_0x5513fa+'/'+_0x4f2aeb)[_0xd893('0x18')](_0x213e5a);}return null;};}function patchUpdates(_0x4048bb){return function(_0x191329){try{jsonpatch['apply'](_0x191329,_0x4048bb,!![]);}catch(_0x1abdf5){return BPromise[_0xd893('0x1d')](_0x1abdf5);}return _0x191329['save']();};}function saveUpdates(_0x145c8c,_0x15c758){return function(_0x1c7db5){if(_0x1c7db5){return _0x1c7db5[_0xd893('0x1e')](_0x145c8c)[_0xd893('0x1f')](function(_0x1fedf4){return _0x1fedf4;});}return null;};}function removeEntity(_0x4b5b8f,_0x17db26){return function(_0x52f73c){if(_0x52f73c){return _0x52f73c['destroy']()[_0xd893('0x1f')](function(){_0x4b5b8f[_0xd893('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104900,_0x5ca38b){return function(_0x2723fe){if(!_0x2723fe){_0x104900[_0xd893('0x20')](0x194);}return _0x2723fe;};}function handleError(_0x53ab28,_0x5f5bee){_0x5f5bee=_0x5f5bee||0x1f4;return function(_0x404c0c){logger[_0xd893('0x21')](_0x404c0c['stack']);if(_0x404c0c[_0xd893('0x22')]){delete _0x404c0c[_0xd893('0x22')];}_0x53ab28['status'](_0x5f5bee)[_0xd893('0x23')](_0x404c0c);};}exports[_0xd893('0x24')]=function(_0x389d65,_0x4f314b){var _0x237c6d={},_0x4ceb2c={},_0x2a90f6={'count':0x0,'rows':[]};var _0x85c9c3=_[_0xd893('0x25')](db['ZendeskField'][_0xd893('0x26')],function(_0x15eb89){return{'name':_0x15eb89[_0xd893('0x27')],'type':_0x15eb89[_0xd893('0x28')][_0xd893('0x29')]};});_0x4ceb2c[_0xd893('0x2a')]=_[_0xd893('0x25')](_0x85c9c3,_0xd893('0x22'));_0x4ceb2c[_0xd893('0x2b')]=_[_0xd893('0x2c')](_0x389d65['query']);_0x4ceb2c['filters']=_[_0xd893('0x2d')](_0x4ceb2c[_0xd893('0x2a')],_0x4ceb2c[_0xd893('0x2b')]);_0x237c6d[_0xd893('0x2e')]=_[_0xd893('0x2d')](_0x4ceb2c[_0xd893('0x2a')],qs[_0xd893('0x2f')](_0x389d65['query'][_0xd893('0x2f')]));_0x237c6d[_0xd893('0x2e')]=_0x237c6d[_0xd893('0x2e')][_0xd893('0x30')]?_0x237c6d[_0xd893('0x2e')]:_0x4ceb2c['model'];if(!_0x389d65['query']['hasOwnProperty'](_0xd893('0x31'))){_0x237c6d[_0xd893('0x1b')]=qs[_0xd893('0x1b')](_0x389d65[_0xd893('0x2b')][_0xd893('0x1b')]);_0x237c6d[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x389d65[_0xd893('0x2b')][_0xd893('0x19')]);}_0x237c6d[_0xd893('0x32')]=qs[_0xd893('0x33')](_0x389d65[_0xd893('0x2b')]['sort']);_0x237c6d[_0xd893('0x34')]=qs['filters'](_['pick'](_0x389d65[_0xd893('0x2b')],_0x4ceb2c[_0xd893('0x35')]),_0x85c9c3);if(_0x389d65[_0xd893('0x2b')][_0xd893('0x36')]){_0x237c6d[_0xd893('0x34')]=_[_0xd893('0x37')](_0x237c6d[_0xd893('0x34')],{'$or':_[_0xd893('0x25')](_0x85c9c3,function(_0x2b0d35){if(_0x2b0d35[_0xd893('0x28')]!==_0xd893('0x38')){var _0x4e9271={};_0x4e9271[_0x2b0d35[_0xd893('0x22')]]={'$like':'%'+_0x389d65['query'][_0xd893('0x36')]+'%'};return _0x4e9271;}})});}_0x237c6d=_[_0xd893('0x37')]({},_0x237c6d,_0x389d65[_0xd893('0x39')]);var _0x3550df={'where':_0x237c6d['where']};return db[_0xd893('0x3a')]['count'](_0x3550df)[_0xd893('0x1f')](function(_0x519879){_0x2a90f6[_0xd893('0x1c')]=_0x519879;if(_0x389d65[_0xd893('0x2b')][_0xd893('0x3b')]){_0x237c6d['include']=[{'all':!![]}];}return db['ZendeskField'][_0xd893('0x3c')](_0x237c6d);})[_0xd893('0x1f')](function(_0x7766f9){_0x2a90f6[_0xd893('0x3d')]=_0x7766f9;return _0x2a90f6;})['then'](respondWithFilteredResult(_0x4f314b,_0x237c6d))[_0xd893('0x3e')](handleError(_0x4f314b,null));};exports[_0xd893('0x3f')]=function(_0x2e77bf,_0x23bff1){var _0x17ca15={'raw':!![],'where':{'id':_0x2e77bf[_0xd893('0x40')]['id']}},_0x20e0d5={};_0x20e0d5['model']=_[_0xd893('0x2c')](db[_0xd893('0x3a')][_0xd893('0x26')]);_0x20e0d5['query']=_[_0xd893('0x2c')](_0x2e77bf[_0xd893('0x2b')]);_0x20e0d5[_0xd893('0x35')]=_[_0xd893('0x2d')](_0x20e0d5[_0xd893('0x2a')],_0x20e0d5[_0xd893('0x2b')]);_0x17ca15[_0xd893('0x2e')]=_[_0xd893('0x2d')](_0x20e0d5[_0xd893('0x2a')],qs[_0xd893('0x2f')](_0x2e77bf[_0xd893('0x2b')]['fields']));_0x17ca15['attributes']=_0x17ca15[_0xd893('0x2e')]['length']?_0x17ca15[_0xd893('0x2e')]:_0x20e0d5[_0xd893('0x2a')];if(_0x2e77bf[_0xd893('0x2b')]['includeAll']){_0x17ca15['include']=[{'all':!![]}];}_0x17ca15=_['merge']({},_0x17ca15,_0x2e77bf['options']);return db['ZendeskField']['find'](_0x17ca15)[_0xd893('0x1f')](handleEntityNotFound(_0x23bff1,null))[_0xd893('0x1f')](respondWithResult(_0x23bff1,null))['catch'](handleError(_0x23bff1,null));};exports[_0xd893('0x41')]=function(_0x31e1bd,_0x1a6fcc){return db[_0xd893('0x3a')][_0xd893('0x41')](_0x31e1bd['body'],{})[_0xd893('0x1f')](respondWithResult(_0x1a6fcc,0xc9))[_0xd893('0x3e')](handleError(_0x1a6fcc,null));};exports[_0xd893('0x1e')]=function(_0x5cd06e,_0x54ed26){if(_0x5cd06e[_0xd893('0x42')]['id']){delete _0x5cd06e[_0xd893('0x42')]['id'];}return db[_0xd893('0x3a')][_0xd893('0x43')]({'where':{'id':_0x5cd06e[_0xd893('0x40')]['id']}})['then'](handleEntityNotFound(_0x54ed26,null))[_0xd893('0x1f')](saveUpdates(_0x5cd06e['body'],null))['then'](respondWithResult(_0x54ed26,null))[_0xd893('0x3e')](handleError(_0x54ed26,null));};exports['destroy']=function(_0x2fa859,_0x37cb04){return db['ZendeskField'][_0xd893('0x43')]({'where':{'id':_0x2fa859[_0xd893('0x40')]['id']}})[_0xd893('0x1f')](handleEntityNotFound(_0x37cb04,null))['then'](removeEntity(_0x37cb04,null))[_0xd893('0x3e')](handleError(_0x37cb04,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index f215645..d2aec9d 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 _0xe128=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0xe128,0x1af));var _0x8e12=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xe128[_0x2aefb6];return _0x202772;};'use strict';var _=require(_0x8e12('0x0'));var util=require(_0x8e12('0x1'));var logger=require(_0x8e12('0x2'))(_0x8e12('0x3'));var moment=require(_0x8e12('0x4'));var BPromise=require(_0x8e12('0x5'));var rp=require(_0x8e12('0x6'));var fs=require('fs');var path=require(_0x8e12('0x7'));var rimraf=require(_0x8e12('0x8'));var config=require(_0x8e12('0x9'));var attributes=require(_0x8e12('0xa'));module[_0x8e12('0xb')]=function(_0x406b35,_0x41f711){return _0x406b35[_0x8e12('0xc')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8e12('0xd'),'fields':[_0x8e12('0xe'),_0x8e12('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb91=['bluebird','request-promise','path','../../config/environment','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3c3952,_0x2f67f2){var _0xc615f8=function(_0x5c8834){while(--_0x5c8834){_0x3c3952['push'](_0x3c3952['shift']());}};_0xc615f8(++_0x2f67f2);}(_0xfb91,0x191));var _0x1fb9=function(_0x130199,_0x330ad8){_0x130199=_0x130199-0x0;var _0x5d1cb8=_0xfb91[_0x130199];return _0x5d1cb8;};'use strict';var _=require(_0x1fb9('0x0'));var util=require(_0x1fb9('0x1'));var logger=require(_0x1fb9('0x2'))(_0x1fb9('0x3'));var moment=require(_0x1fb9('0x4'));var BPromise=require(_0x1fb9('0x5'));var rp=require(_0x1fb9('0x6'));var fs=require('fs');var path=require(_0x1fb9('0x7'));var rimraf=require('rimraf');var config=require(_0x1fb9('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x1fb9('0x9')]=function(_0x2f72f2,_0x338aa6){return _0x2f72f2['define'](_0x1fb9('0xa'),attributes,{'tableName':_0x1fb9('0xb'),'paranoid':![],'indexes':[{'name':_0x1fb9('0xc'),'fields':['idField',_0x1fb9('0xd')],'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 efcc487..69772b5 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 _0x05bb=['message','request\x20sent','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x05bb,0xdb));var _0xb05b=function(_0x3ab924,_0x3ee391){_0x3ab924=_0x3ab924-0x0;var _0x1678e3=_0x05bb[_0x3ab924];return _0x1678e3;};'use strict';var _=require(_0xb05b('0x0'));var util=require(_0xb05b('0x1'));var moment=require(_0xb05b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb05b('0x3'));var db=require(_0xb05b('0x4'))['db'];var utils=require(_0xb05b('0x5'));var logger=require(_0xb05b('0x6'))(_0xb05b('0x7'));var config=require(_0xb05b('0x8'));var jayson=require(_0xb05b('0x9'));var client=jayson[_0xb05b('0xa')][_0xb05b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x105964,_0x8919b8,_0x31fb43){return new BPromise(function(_0x1e4af5,_0x3daa66){return client[_0xb05b('0xc')](_0x105964,_0x31fb43)[_0xb05b('0xd')](function(_0x964cd5){logger[_0xb05b('0xe')](_0xb05b('0xf'),_0x8919b8,'request\x20sent');logger[_0xb05b('0x10')](_0xb05b('0x11'),_0x8919b8,'request\x20sent',JSON[_0xb05b('0x12')](_0x964cd5));if(_0x964cd5['error']){if(_0x964cd5['error'][_0xb05b('0x13')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x8919b8,_0x964cd5[_0xb05b('0x14')][_0xb05b('0x15')]);return _0x3daa66(_0x964cd5[_0xb05b('0x14')][_0xb05b('0x15')]);}logger[_0xb05b('0x14')](_0xb05b('0xf'),_0x8919b8,_0x964cd5[_0xb05b('0x14')][_0xb05b('0x15')]);return _0x1e4af5(_0x964cd5[_0xb05b('0x14')][_0xb05b('0x15')]);}else{logger[_0xb05b('0xe')]('ZendeskField,\x20%s,\x20%s',_0x8919b8,_0xb05b('0x16'));_0x1e4af5(_0x964cd5[_0xb05b('0x17')][_0xb05b('0x15')]);}})['catch'](function(_0x167d91){logger['error'](_0xb05b('0xf'),_0x8919b8,_0x167d91);_0x3daa66(_0x167d91);});});} \ No newline at end of file +var _0x9cf9=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9cf9,0x64));var _0x99cf=function(_0x4cd338,_0x1efe9d){_0x4cd338=_0x4cd338-0x0;var _0x4f33e6=_0x9cf9[_0x4cd338];return _0x4f33e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x99cf('0x0'));var BPromise=require('bluebird');var rs=require(_0x99cf('0x1'));var fs=require('fs');var Redis=require(_0x99cf('0x2'));var db=require(_0x99cf('0x3'))['db'];var utils=require(_0x99cf('0x4'));var logger=require('../../config/logger')(_0x99cf('0x5'));var config=require('../../config/environment');var jayson=require(_0x99cf('0x6'));var client=jayson[_0x99cf('0x7')][_0x99cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x152bf9,_0x511dbd,_0x1434d6){return new BPromise(function(_0x21cfdf,_0x1caa43){return client[_0x99cf('0x9')](_0x152bf9,_0x1434d6)[_0x99cf('0xa')](function(_0x469b73){logger[_0x99cf('0xb')](_0x99cf('0xc'),_0x511dbd,_0x99cf('0xd'));logger[_0x99cf('0xe')](_0x99cf('0xf'),_0x511dbd,_0x99cf('0xd'),JSON['stringify'](_0x469b73));if(_0x469b73[_0x99cf('0x10')]){if(_0x469b73['error'][_0x99cf('0x11')]===0x1f4){logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x469b73['error'][_0x99cf('0x12')]);return _0x1caa43(_0x469b73[_0x99cf('0x10')][_0x99cf('0x12')]);}logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x469b73[_0x99cf('0x10')][_0x99cf('0x12')]);return _0x21cfdf(_0x469b73['error'][_0x99cf('0x12')]);}else{logger[_0x99cf('0xb')](_0x99cf('0xc'),_0x511dbd,_0x99cf('0xd'));_0x21cfdf(_0x469b73['result'][_0x99cf('0x12')]);}})['catch'](function(_0x591bbd){logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x591bbd);_0x1caa43(_0x591bbd);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 28d7373..ee0cce3 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 _0xe9d8=['post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x537e85,_0x2844f1){var _0x5c3d1e=function(_0x3b44a8){while(--_0x3b44a8){_0x537e85['push'](_0x537e85['shift']());}};_0x5c3d1e(++_0x2844f1);}(_0xe9d8,0x13f));var _0x8e9d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe9d8[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x8e9d('0x0'));var util=require(_0x8e9d('0x1'));var path=require(_0x8e9d('0x2'));var timeout=require(_0x8e9d('0x3'));var express=require(_0x8e9d('0x4'));var router=express['Router']();var fs_extra=require(_0x8e9d('0x5'));var auth=require(_0x8e9d('0x6'));var interaction=require(_0x8e9d('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9d('0x8'));router[_0x8e9d('0x9')]('/',auth[_0x8e9d('0xa')](),controller[_0x8e9d('0xb')]);router[_0x8e9d('0x9')](_0x8e9d('0xc'),auth[_0x8e9d('0xa')](),controller[_0x8e9d('0xd')]);router['get'](_0x8e9d('0xe'),auth[_0x8e9d('0xa')](),controller['getConfigurations']);router[_0x8e9d('0x9')](_0x8e9d('0xf'),auth[_0x8e9d('0xa')](),controller[_0x8e9d('0x10')]);router[_0x8e9d('0x11')]('/',auth[_0x8e9d('0xa')](),controller['create']);router[_0x8e9d('0x11')](_0x8e9d('0xe'),auth[_0x8e9d('0xa')](),controller[_0x8e9d('0x12')]);router[_0x8e9d('0x13')](_0x8e9d('0xc'),auth[_0x8e9d('0xa')](),controller[_0x8e9d('0x14')]);router[_0x8e9d('0x15')](_0x8e9d('0xc'),auth['isAuthenticated'](),controller[_0x8e9d('0x16')]);module[_0x8e9d('0x17')]=router; \ No newline at end of file +var _0xf53d=['../../config/environment','./intZohoAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x468012,_0x380ff4){var _0x461013=function(_0x40116a){while(--_0x40116a){_0x468012['push'](_0x468012['shift']());}};_0x461013(++_0x380ff4);}(_0xf53d,0x1f2));var _0xdf53=function(_0x30f192,_0x8c241a){_0x30f192=_0x30f192-0x0;var _0x51aeb4=_0xf53d[_0x30f192];return _0x51aeb4;};'use strict';var multer=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var path=require(_0xdf53('0x2'));var timeout=require(_0xdf53('0x3'));var express=require(_0xdf53('0x4'));var router=express[_0xdf53('0x5')]();var fs_extra=require(_0xdf53('0x6'));var auth=require(_0xdf53('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdf53('0x8'));var controller=require(_0xdf53('0x9'));router[_0xdf53('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0xc')]);router[_0xdf53('0xa')](_0xdf53('0xd'),auth[_0xdf53('0xe')](),controller[_0xdf53('0xf')]);router[_0xdf53('0xa')](_0xdf53('0x10'),auth[_0xdf53('0xe')](),controller['getFields']);router[_0xdf53('0x11')]('/',auth[_0xdf53('0xe')](),controller['create']);router[_0xdf53('0x11')](_0xdf53('0xd'),auth[_0xdf53('0xe')](),controller['addConfiguration']);router[_0xdf53('0x12')](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0x13')]);router[_0xdf53('0x14')](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0x15')]);module[_0xdf53('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 1255552..d9570ad 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 _0x4522=['STRING'];(function(_0x5b33f6,_0x2512e1){var _0x1bb4fd=function(_0x771196){while(--_0x771196){_0x5b33f6['push'](_0x5b33f6['shift']());}};_0x1bb4fd(++_0x2512e1);}(_0x4522,0x1a0));var _0x2452=function(_0x45fdd8,_0xf7c96c){_0x45fdd8=_0x45fdd8-0x0;var _0x913b1c=_0x4522[_0x45fdd8];return _0x913b1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2452('0x0')]},'description':{'type':Sequelize[_0x2452('0x0')]},'host':{'type':Sequelize[_0x2452('0x0')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2452('0x0')]},'clientSecret':{'type':Sequelize[_0x2452('0x0')]},'serverUrl':{'type':Sequelize[_0x2452('0x0')],'allowNull':![]},'code':{'type':Sequelize[_0x2452('0x0')]},'refreshToken':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x41bb,0xc5));var _0xb41b=function(_0xd6d4c4,_0x24e036){_0xd6d4c4=_0xd6d4c4-0x0;var _0x1b5f94=_0x41bb[_0xd6d4c4];return _0x1b5f94;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3ffeaff..c69fe9d 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 _0x7dd7=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','host','clientSecret','serverUrl','code','zoho.eu','com','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x7dd7,0x18b));var _0x77dd=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x7dd7[_0x3826ad];return _0x17b900;};'use strict';var emlformat=require(_0x77dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x77dd('0x1'));var jsonpatch=require(_0x77dd('0x2'));var rp=require(_0x77dd('0x3'));var moment=require(_0x77dd('0x4'));var BPromise=require(_0x77dd('0x5'));var Mustache=require(_0x77dd('0x6'));var util=require(_0x77dd('0x7'));var path=require(_0x77dd('0x8'));var sox=require(_0x77dd('0x9'));var csv=require('to-csv');var ejs=require(_0x77dd('0xa'));var fs=require('fs');var fs_extra=require(_0x77dd('0xb'));var _=require(_0x77dd('0xc'));var squel=require(_0x77dd('0xd'));var crypto=require(_0x77dd('0xe'));var jsforce=require(_0x77dd('0xf'));var deskjs=require(_0x77dd('0x10'));var toCsv=require(_0x77dd('0x11'));var querystring=require(_0x77dd('0x12'));var Papa=require('papaparse');var Redis=require(_0x77dd('0x13'));var authService=require(_0x77dd('0x14'));var qs=require(_0x77dd('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77dd('0x16'));var logger=require('../../config/logger')(_0x77dd('0x17'));var utils=require(_0x77dd('0x18'));var config=require(_0x77dd('0x19'));var licenseUtil=require(_0x77dd('0x1a'));var db=require(_0x77dd('0x1b'))['db'];var integrations=require(_0x77dd('0x1c'));function respondWithStatusCode(_0x3b64b3,_0x15ee6d){_0x15ee6d=_0x15ee6d||0xcc;return function(_0x22b147){if(_0x22b147){return _0x3b64b3[_0x77dd('0x1d')](_0x15ee6d);}return _0x3b64b3[_0x77dd('0x1e')](_0x15ee6d)[_0x77dd('0x1f')]();};}function respondWithResult(_0x4043d0,_0x576fee){_0x576fee=_0x576fee||0xc8;return function(_0x208d68){if(_0x208d68){return _0x4043d0[_0x77dd('0x1e')](_0x576fee)[_0x77dd('0x20')](_0x208d68);}};}function respondWithFilteredResult(_0x145d7c,_0x598cde){return function(_0x129065){if(_0x129065){var _0x3bd4d3=typeof _0x598cde['offset']===_0x77dd('0x21')&&typeof _0x598cde[_0x77dd('0x22')]===_0x77dd('0x21');var _0x21379f=_0x129065[_0x77dd('0x23')];var _0x4b142c=_0x3bd4d3?0x0:_0x598cde[_0x77dd('0x24')];var _0x561ebb=_0x3bd4d3?_0x129065['count']:_0x598cde[_0x77dd('0x24')]+_0x598cde[_0x77dd('0x22')];var _0x5eee61;if(_0x561ebb>=_0x21379f){_0x561ebb=_0x21379f;_0x5eee61=0xc8;}else{_0x5eee61=0xce;}_0x145d7c['status'](_0x5eee61);return _0x145d7c['set'](_0x77dd('0x25'),_0x4b142c+'-'+_0x561ebb+'/'+_0x21379f)[_0x77dd('0x20')](_0x129065);}return null;};}function patchUpdates(_0x3a33b5){return function(_0x5cae77){try{jsonpatch[_0x77dd('0x26')](_0x5cae77,_0x3a33b5,!![]);}catch(_0x6e7555){return BPromise[_0x77dd('0x27')](_0x6e7555);}return _0x5cae77['save']();};}function saveUpdates(_0x524864,_0x5a2e8e){return function(_0x2a8aec){if(_0x2a8aec){return _0x2a8aec[_0x77dd('0x28')](_0x524864)[_0x77dd('0x29')](function(_0x22cfd8){return _0x22cfd8;});}return null;};}function removeEntity(_0x5bd28c,_0x19ee83){return function(_0x31b699){if(_0x31b699){return _0x31b699['destroy']()[_0x77dd('0x29')](function(){_0x5bd28c[_0x77dd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b73b3,_0xda1d1a){return function(_0x26b7f2){if(!_0x26b7f2){_0x5b73b3[_0x77dd('0x1d')](0x194);}return _0x26b7f2;};}function handleError(_0x3c9ced,_0x3ee1e4){_0x3ee1e4=_0x3ee1e4||0x1f4;return function(_0x1a5c09){logger[_0x77dd('0x2a')](_0x1a5c09['stack']);if(_0x1a5c09[_0x77dd('0x2b')]){delete _0x1a5c09[_0x77dd('0x2b')];}_0x3c9ced['status'](_0x3ee1e4)['send'](_0x1a5c09);};}exports[_0x77dd('0x2c')]=function(_0x2b7e97,_0x5afed0){var _0x16d23a={},_0x2a7241={},_0x4dda65={'count':0x0,'rows':[]};var _0x2838f9=_[_0x77dd('0x2d')](db[_0x77dd('0x2e')][_0x77dd('0x2f')],function(_0x3b4878){return{'name':_0x3b4878[_0x77dd('0x30')],'type':_0x3b4878[_0x77dd('0x31')][_0x77dd('0x32')]};});_0x2a7241[_0x77dd('0x33')]=_['map'](_0x2838f9,_0x77dd('0x2b'));_0x2a7241[_0x77dd('0x34')]=_[_0x77dd('0x35')](_0x2b7e97[_0x77dd('0x34')]);_0x2a7241[_0x77dd('0x36')]=_[_0x77dd('0x37')](_0x2a7241['model'],_0x2a7241[_0x77dd('0x34')]);_0x16d23a[_0x77dd('0x38')]=_[_0x77dd('0x37')](_0x2a7241['model'],qs[_0x77dd('0x39')](_0x2b7e97[_0x77dd('0x34')]['fields']));_0x16d23a[_0x77dd('0x38')]=_0x16d23a[_0x77dd('0x38')][_0x77dd('0x3a')]?_0x16d23a[_0x77dd('0x38')]:_0x2a7241[_0x77dd('0x33')];if(!_0x2b7e97[_0x77dd('0x34')]['hasOwnProperty'](_0x77dd('0x3b'))){_0x16d23a[_0x77dd('0x22')]=qs[_0x77dd('0x22')](_0x2b7e97[_0x77dd('0x34')][_0x77dd('0x22')]);_0x16d23a['offset']=qs['offset'](_0x2b7e97[_0x77dd('0x34')]['offset']);}_0x16d23a[_0x77dd('0x3c')]=qs[_0x77dd('0x3d')](_0x2b7e97[_0x77dd('0x34')]['sort']);_0x16d23a[_0x77dd('0x3e')]=qs[_0x77dd('0x36')](_[_0x77dd('0x3f')](_0x2b7e97[_0x77dd('0x34')],_0x2a7241[_0x77dd('0x36')]),_0x2838f9);if(_0x2b7e97['query'][_0x77dd('0x40')]){_0x16d23a[_0x77dd('0x3e')]=_[_0x77dd('0x41')](_0x16d23a[_0x77dd('0x3e')],{'$or':_['map'](_0x2838f9,function(_0x51fbcf){if(_0x51fbcf['type']!==_0x77dd('0x42')){var _0x28bc2f={};_0x28bc2f[_0x51fbcf['name']]={'$like':'%'+_0x2b7e97['query']['filter']+'%'};return _0x28bc2f;}})});}_0x16d23a=_[_0x77dd('0x41')]({},_0x16d23a,_0x2b7e97[_0x77dd('0x43')]);var _0x3345fa={'where':_0x16d23a['where']};return db['ZohoAccount'][_0x77dd('0x23')](_0x3345fa)[_0x77dd('0x29')](function(_0x26544a){_0x4dda65[_0x77dd('0x23')]=_0x26544a;if(_0x2b7e97[_0x77dd('0x34')][_0x77dd('0x44')]){_0x16d23a[_0x77dd('0x45')]=[{'all':!![]}];}return db[_0x77dd('0x2e')][_0x77dd('0x46')](_0x16d23a);})['then'](function(_0x499a1c){_0x4dda65[_0x77dd('0x47')]=_0x499a1c;return _0x4dda65;})[_0x77dd('0x29')](respondWithFilteredResult(_0x5afed0,_0x16d23a))[_0x77dd('0x48')](handleError(_0x5afed0,null));};exports[_0x77dd('0x49')]=function(_0x48266c,_0xf9e508){var _0x3fd15e={'raw':![],'where':{'id':_0x48266c['params']['id']}},_0x29180e={};_0x29180e[_0x77dd('0x33')]=_[_0x77dd('0x35')](db[_0x77dd('0x2e')][_0x77dd('0x2f')]);_0x29180e[_0x77dd('0x34')]=_[_0x77dd('0x35')](_0x48266c[_0x77dd('0x34')]);_0x29180e['filters']=_[_0x77dd('0x37')](_0x29180e['model'],_0x29180e[_0x77dd('0x34')]);_0x3fd15e[_0x77dd('0x38')]=_[_0x77dd('0x37')](_0x29180e[_0x77dd('0x33')],qs['fields'](_0x48266c[_0x77dd('0x34')][_0x77dd('0x39')]));_0x3fd15e[_0x77dd('0x38')]=_0x3fd15e[_0x77dd('0x38')][_0x77dd('0x3a')]?_0x3fd15e[_0x77dd('0x38')]:_0x29180e['model'];if(_0x48266c[_0x77dd('0x34')][_0x77dd('0x44')]){_0x3fd15e[_0x77dd('0x45')]=[{'all':!![]}];}_0x3fd15e=_[_0x77dd('0x41')]({},_0x3fd15e,_0x48266c['options']);return db[_0x77dd('0x2e')][_0x77dd('0x4a')](_0x3fd15e)['then'](handleEntityNotFound(_0xf9e508,null))[_0x77dd('0x29')](respondWithResult(_0xf9e508,null))[_0x77dd('0x48')](handleError(_0xf9e508,null));};exports[_0x77dd('0x4b')]=function(_0x5b3a02,_0xb24dfa){return db[_0x77dd('0x2e')][_0x77dd('0x4b')](_0x5b3a02['body'],{})[_0x77dd('0x29')](respondWithResult(_0xb24dfa,0xc9))[_0x77dd('0x48')](handleError(_0xb24dfa,null));};exports[_0x77dd('0x28')]=function(_0x8aef73,_0x4679dc){if(_0x8aef73[_0x77dd('0x4c')]['id']){delete _0x8aef73['body']['id'];}return db['ZohoAccount'][_0x77dd('0x4a')]({'where':{'id':_0x8aef73[_0x77dd('0x4d')]['id']}})[_0x77dd('0x29')](handleEntityNotFound(_0x4679dc,null))['then'](saveUpdates(_0x8aef73['body'],null))['then'](respondWithResult(_0x4679dc,null))[_0x77dd('0x48')](handleError(_0x4679dc,null));};exports[_0x77dd('0x4e')]=function(_0x362383,_0x443f85){return db['ZohoAccount'][_0x77dd('0x4a')]({'where':{'id':_0x362383[_0x77dd('0x4d')]['id']}})[_0x77dd('0x29')](handleEntityNotFound(_0x443f85,null))[_0x77dd('0x29')](removeEntity(_0x443f85,null))[_0x77dd('0x48')](handleError(_0x443f85,null));};exports[_0x77dd('0x4f')]=function(_0x309a0d,_0xc16266,_0xb28a44){var _0x5c546a={};var _0x14f94b={};var _0x477c92;var _0x46c625;return db[_0x77dd('0x2e')][_0x77dd('0x50')]({'where':{'id':_0x309a0d[_0x77dd('0x4d')]['id']}})[_0x77dd('0x29')](handleEntityNotFound(_0xc16266,null))[_0x77dd('0x29')](function(_0x4f3481){if(_0x4f3481){_0x477c92=_0x4f3481;_0x14f94b['model']=_['keys'](db[_0x77dd('0x51')][_0x77dd('0x2f')]);_0x14f94b[_0x77dd('0x34')]=_[_0x77dd('0x35')](_0x309a0d[_0x77dd('0x34')]);_0x14f94b[_0x77dd('0x36')]=_[_0x77dd('0x37')](_0x14f94b[_0x77dd('0x33')],_0x14f94b[_0x77dd('0x34')]);_0x5c546a[_0x77dd('0x38')]=_[_0x77dd('0x37')](_0x14f94b['model'],qs[_0x77dd('0x39')](_0x309a0d['query'][_0x77dd('0x39')]));_0x5c546a[_0x77dd('0x38')]=_0x5c546a[_0x77dd('0x38')][_0x77dd('0x3a')]?_0x5c546a[_0x77dd('0x38')]:_0x14f94b[_0x77dd('0x33')];_0x5c546a['order']=qs[_0x77dd('0x3d')](_0x309a0d[_0x77dd('0x34')][_0x77dd('0x3d')]);_0x5c546a['where']=qs[_0x77dd('0x36')](_[_0x77dd('0x3f')](_0x309a0d[_0x77dd('0x34')],_0x14f94b[_0x77dd('0x36')]));if(_0x309a0d[_0x77dd('0x34')][_0x77dd('0x40')]){_0x5c546a['where']=_['merge'](_0x5c546a[_0x77dd('0x3e')],{'$or':_[_0x77dd('0x2d')](_0x5c546a[_0x77dd('0x38')],function(_0x54ce7a){var _0xf40c76={};_0xf40c76[_0x54ce7a]={'$like':'%'+_0x309a0d[_0x77dd('0x34')][_0x77dd('0x40')]+'%'};return _0xf40c76;})});}_0x5c546a=_[_0x77dd('0x41')]({},_0x5c546a,_0x309a0d[_0x77dd('0x43')]);return _0x477c92[_0x77dd('0x4f')](_0x5c546a);}})[_0x77dd('0x29')](function(_0x11e97e){if(_0x11e97e){_0x46c625=_0x11e97e[_0x77dd('0x3a')];if(!_0x309a0d[_0x77dd('0x34')][_0x77dd('0x52')](_0x77dd('0x3b'))){_0x5c546a[_0x77dd('0x22')]=qs[_0x77dd('0x22')](_0x309a0d['query'][_0x77dd('0x22')]);_0x5c546a[_0x77dd('0x24')]=qs[_0x77dd('0x24')](_0x309a0d[_0x77dd('0x34')][_0x77dd('0x24')]);}return _0x477c92[_0x77dd('0x4f')](_0x5c546a);}})[_0x77dd('0x29')](function(_0x103bc8){if(_0x103bc8){return _0x103bc8?{'count':_0x46c625,'rows':_0x103bc8}:null;}})[_0x77dd('0x29')](respondWithResult(_0xc16266,null))['catch'](handleError(_0xc16266,null));};exports['addConfiguration']=function(_0xb0ebb1,_0x4e753d,_0x3800ce){if(_0xb0ebb1['body']['id']){delete _0xb0ebb1[_0x77dd('0x4c')]['id'];}return db[_0x77dd('0x2e')][_0x77dd('0x50')]({'where':{'id':_0xb0ebb1['params']['id']}})[_0x77dd('0x29')](handleEntityNotFound(_0x4e753d,null))[_0x77dd('0x29')](function(_0x381041){if(_0x381041){_0xb0ebb1[_0x77dd('0x4c')][_0x77dd('0x53')]=_0x381041['id'];_0xb0ebb1['body'][_0x77dd('0x54')]=integrations[_0x77dd('0x55')](_0xb0ebb1[_0x77dd('0x4c')][_0x77dd('0x56')],_0xb0ebb1[_0x77dd('0x4c')][_0x77dd('0x31')]);_0xb0ebb1[_0x77dd('0x4c')]['Descriptions']=integrations[_0x77dd('0x57')](_0xb0ebb1[_0x77dd('0x4c')][_0x77dd('0x56')],_0xb0ebb1[_0x77dd('0x4c')][_0x77dd('0x31')]);return db['ZohoConfiguration']['create'](_0xb0ebb1[_0x77dd('0x4c')],{'include':[{'model':db[_0x77dd('0x58')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x77dd('0x59')}]});}return null;})[_0x77dd('0x29')](respondWithResult(_0x4e753d,null))[_0x77dd('0x48')](handleError(_0x4e753d,null));};function getAccessToken(_0x9fbaff){return new Promise(function(_0x36712d,_0x2bf94c){var _0x190d0c;switch(_0x9fbaff[_0x77dd('0x5a')]){case'US':_0x190d0c='https://accounts.zoho.com';break;case'AU':_0x190d0c=_0x77dd('0x5b');break;case'EU':_0x190d0c=_0x77dd('0x5c');break;case'IN':_0x190d0c=_0x77dd('0x5d');break;case'CN':_0x190d0c='https://accounts.zoho.com.cn';break;default:_0x190d0c='https://accounts.zoho.eu';break;}var _0xc9dc67={'method':'POST','uri':_0x190d0c+_0x77dd('0x5e'),'qs':{'refresh_token':_0x9fbaff[_0x77dd('0x5f')],'client_id':_0x9fbaff[_0x77dd('0x60')],'client_secret':_0x9fbaff['clientSecret'],'grant_type':_0x77dd('0x61')},'json':!![]};return rp(_0xc9dc67)['then'](function(_0x4e42e8){if(_0x4e42e8[_0x77dd('0x62')]){_0x36712d(_0x4e42e8[_0x77dd('0x62')]);}else{_0x2bf94c('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x350893){_0x2bf94c(_0x350893);});});}exports['getFields']=function(_0x25cec9,_0x59a311,_0x2af780){var _0x20961e,_0x3a7e90,_0x440671,_0x3c3d24,_0x4a70de;return db[_0x77dd('0x2e')][_0x77dd('0x50')]({'where':{'id':_0x25cec9[_0x77dd('0x4d')]['id']},'attributes':['id',_0x77dd('0x63'),_0x77dd('0x5a'),_0x77dd('0x60'),_0x77dd('0x64'),_0x77dd('0x65'),_0x77dd('0x66'),'refreshToken']})[_0x77dd('0x29')](handleEntityNotFound(_0x59a311,null))[_0x77dd('0x29')](function(_0x5b96b6){_0x4a70de=_0x5b96b6;_0x20961e=_0x4a70de[_0x77dd('0x63')];_0x3a7e90=_0x20961e===_0x77dd('0x67')?'eu':_0x77dd('0x68');_0x440671=_0x4a70de[_0x77dd('0x65')];var _0x144bb9=_0x440671['slice'](-0x1);if(_0x144bb9==='/'||_0x144bb9==='\x5c'||_0x144bb9===':'){_0x440671=_0x440671['substring'](0x0,_0x440671['lastIndexOf'](_0x144bb9));}if(!_0x4a70de[_0x77dd('0x5f')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4a70de);})['then'](function(_0x4d4ecc){if(_0x4d4ecc){return rp({'method':_0x77dd('0x69'),'uri':util['format'](_0x77dd('0x6a'),_0x3a7e90),'qs':{'module':_0x77dd('0x6b')},'headers':{'Authorization':_0x77dd('0x6c')+_0x4d4ecc},'json':!![]});}})[_0x77dd('0x29')](function(_0x2f475c){if(_0x2f475c){if(_0x2f475c[_0x77dd('0x6d')]&&_0x2f475c[_0x77dd('0x6d')]['error']){throw new Error(_0x2f475c[_0x77dd('0x6d')][_0x77dd('0x2a')][_0x77dd('0x6e')]);}var _0x294c03=[];var _0x10089f=[];var _0x300ce4=[_0x77dd('0x6f'),_0x77dd('0x70'),'Description','WhoId',_0x77dd('0x71'),_0x77dd('0x72'),_0x77dd('0x73'),_0x77dd('0x74')];_0x10089f=_[_0x77dd('0x75')](_0x2f475c[_0x77dd('0x39')],function(_0x182831){return _0x300ce4[_0x77dd('0x76')](_0x182831[_0x77dd('0x77')]);});for(var _0x21c5ee=0x0;_0x21c5ee<_0x10089f[_0x77dd('0x3a')];_0x21c5ee++){if(_0x10089f[_0x21c5ee][_0x77dd('0x78')]===![]){_0x294c03[_0x77dd('0x79')]({'id':_0x10089f[_0x21c5ee]['id'],'name':_0x10089f[_0x21c5ee][_0x77dd('0x7a')],'custom':_0x10089f[_0x21c5ee][_0x77dd('0x7b')],'options':_0x10089f[_0x21c5ee][_0x77dd('0x7c')]===_0x77dd('0x7d')&&_0x10089f[_0x21c5ee][_0x77dd('0x7e')][_0x77dd('0x3a')]>-0x1?_[_0x77dd('0x2d')](_0x10089f[_0x21c5ee][_0x77dd('0x7e')],function(_0x2ff12a){return{'name':_0x2ff12a,'value':_0x2ff12a};}):[]});}}return{'count':_0x294c03[_0x77dd('0x3a')],'rows':_0x294c03};}else{return{'count':0x0,'rows':[]};}})[_0x77dd('0x29')](respondWithResult(_0x59a311,null))[_0x77dd('0x48')](function(_0xb92c0c){var _0x17b2c1=_0x25cec9[_0x77dd('0x34')][_0x77dd('0x7f')]?0x1f4:_0xb92c0c['statusCode']||0x1f4;logger['error'](_0x77dd('0x80'),'getFields',_0x17b2c1,JSON[_0x77dd('0x81')](_0xb92c0c));delete _0xb92c0c[_0x77dd('0x2b')];if(_0x17b2c1===0x191){_0x17b2c1=0x190;}_0x59a311[_0x77dd('0x1e')](_0x17b2c1)[_0x77dd('0x82')](_0x25cec9[_0x77dd('0x34')]['test']?{'message':_0x77dd('0x83'),'statusCode':_0xb92c0c['statusCode']}:_0xb92c0c);});}; \ No newline at end of file +var _0x996a=['sort','addConfiguration','Subjects','channel','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','clientId','clientSecret','access_token','getFields','serverUrl','code','host','zoho.eu','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','update','find','getConfigurations','findOne','ZohoConfiguration'];(function(_0x50b7c4,_0x5becdf){var _0x192220=function(_0x1ac4d1){while(--_0x1ac4d1){_0x50b7c4['push'](_0x50b7c4['shift']());}};_0x192220(++_0x5becdf);}(_0x996a,0x1bb));var _0xa996=function(_0x5e70a0,_0x36abcc){_0x5e70a0=_0x5e70a0-0x0;var _0xbb13ad=_0x996a[_0x5e70a0];return _0xbb13ad;};'use strict';var emlformat=require(_0xa996('0x0'));var rimraf=require(_0xa996('0x1'));var zipdir=require(_0xa996('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa996('0x3'));var moment=require(_0xa996('0x4'));var BPromise=require(_0xa996('0x5'));var Mustache=require('mustache');var util=require(_0xa996('0x6'));var path=require(_0xa996('0x7'));var sox=require(_0xa996('0x8'));var csv=require(_0xa996('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa996('0xa'));var _=require('lodash');var squel=require(_0xa996('0xb'));var crypto=require('crypto');var jsforce=require(_0xa996('0xc'));var deskjs=require(_0xa996('0xd'));var toCsv=require(_0xa996('0x9'));var querystring=require('querystring');var Papa=require(_0xa996('0xe'));var Redis=require(_0xa996('0xf'));var authService=require(_0xa996('0x10'));var qs=require(_0xa996('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa996('0x12'));var logger=require(_0xa996('0x13'))(_0xa996('0x14'));var utils=require('../../config/utils');var config=require(_0xa996('0x15'));var licenseUtil=require(_0xa996('0x16'));var db=require(_0xa996('0x17'))['db'];var integrations=require(_0xa996('0x18'));function respondWithStatusCode(_0x4a72c5,_0x52ff58){_0x52ff58=_0x52ff58||0xcc;return function(_0x14ebab){if(_0x14ebab){return _0x4a72c5[_0xa996('0x19')](_0x52ff58);}return _0x4a72c5[_0xa996('0x1a')](_0x52ff58)['end']();};}function respondWithResult(_0x1b6f42,_0x2d7f95){_0x2d7f95=_0x2d7f95||0xc8;return function(_0x395d80){if(_0x395d80){return _0x1b6f42[_0xa996('0x1a')](_0x2d7f95)[_0xa996('0x1b')](_0x395d80);}};}function respondWithFilteredResult(_0x3c5d13,_0x4a9904){return function(_0x4cc66f){if(_0x4cc66f){var _0x121639=typeof _0x4a9904[_0xa996('0x1c')]===_0xa996('0x1d')&&typeof _0x4a9904[_0xa996('0x1e')]===_0xa996('0x1d');var _0x1ecfa7=_0x4cc66f[_0xa996('0x1f')];var _0x55e5d1=_0x121639?0x0:_0x4a9904['offset'];var _0x25f8eb=_0x121639?_0x4cc66f[_0xa996('0x1f')]:_0x4a9904[_0xa996('0x1c')]+_0x4a9904['limit'];var _0x29581e;if(_0x25f8eb>=_0x1ecfa7){_0x25f8eb=_0x1ecfa7;_0x29581e=0xc8;}else{_0x29581e=0xce;}_0x3c5d13[_0xa996('0x1a')](_0x29581e);return _0x3c5d13[_0xa996('0x20')](_0xa996('0x21'),_0x55e5d1+'-'+_0x25f8eb+'/'+_0x1ecfa7)[_0xa996('0x1b')](_0x4cc66f);}return null;};}function patchUpdates(_0x45c5ec){return function(_0x1d3768){try{jsonpatch[_0xa996('0x22')](_0x1d3768,_0x45c5ec,!![]);}catch(_0xf5178e){return BPromise[_0xa996('0x23')](_0xf5178e);}return _0x1d3768[_0xa996('0x24')]();};}function saveUpdates(_0x5dbbab,_0xb1101f){return function(_0x767186){if(_0x767186){return _0x767186['update'](_0x5dbbab)[_0xa996('0x25')](function(_0x57c2e0){return _0x57c2e0;});}return null;};}function removeEntity(_0x1d5bf6,_0x128042){return function(_0x4f1f33){if(_0x4f1f33){return _0x4f1f33[_0xa996('0x26')]()[_0xa996('0x25')](function(){_0x1d5bf6[_0xa996('0x1a')](0xcc)[_0xa996('0x27')]();});}};}function handleEntityNotFound(_0x540e74,_0x1bc199){return function(_0x427430){if(!_0x427430){_0x540e74[_0xa996('0x19')](0x194);}return _0x427430;};}function handleError(_0x215c2b,_0x4409cb){_0x4409cb=_0x4409cb||0x1f4;return function(_0x10438e){logger[_0xa996('0x28')](_0x10438e[_0xa996('0x29')]);if(_0x10438e[_0xa996('0x2a')]){delete _0x10438e[_0xa996('0x2a')];}_0x215c2b['status'](_0x4409cb)[_0xa996('0x2b')](_0x10438e);};}exports[_0xa996('0x2c')]=function(_0x5b5b76,_0x22d319){var _0x4c979c={},_0x595475={},_0x4609fb={'count':0x0,'rows':[]};var _0x41fbd0=_['map'](db[_0xa996('0x2d')][_0xa996('0x2e')],function(_0x9bac6f){return{'name':_0x9bac6f[_0xa996('0x2f')],'type':_0x9bac6f[_0xa996('0x30')][_0xa996('0x31')]};});_0x595475[_0xa996('0x32')]=_[_0xa996('0x33')](_0x41fbd0,_0xa996('0x2a'));_0x595475[_0xa996('0x34')]=_[_0xa996('0x35')](_0x5b5b76[_0xa996('0x34')]);_0x595475[_0xa996('0x36')]=_[_0xa996('0x37')](_0x595475['model'],_0x595475[_0xa996('0x34')]);_0x4c979c[_0xa996('0x38')]=_[_0xa996('0x37')](_0x595475[_0xa996('0x32')],qs['fields'](_0x5b5b76[_0xa996('0x34')][_0xa996('0x39')]));_0x4c979c[_0xa996('0x38')]=_0x4c979c[_0xa996('0x38')]['length']?_0x4c979c[_0xa996('0x38')]:_0x595475[_0xa996('0x32')];if(!_0x5b5b76[_0xa996('0x34')][_0xa996('0x3a')]('nolimit')){_0x4c979c[_0xa996('0x1e')]=qs[_0xa996('0x1e')](_0x5b5b76[_0xa996('0x34')][_0xa996('0x1e')]);_0x4c979c[_0xa996('0x1c')]=qs[_0xa996('0x1c')](_0x5b5b76[_0xa996('0x34')][_0xa996('0x1c')]);}_0x4c979c[_0xa996('0x3b')]=qs['sort'](_0x5b5b76[_0xa996('0x34')]['sort']);_0x4c979c[_0xa996('0x3c')]=qs[_0xa996('0x36')](_[_0xa996('0x3d')](_0x5b5b76[_0xa996('0x34')],_0x595475[_0xa996('0x36')]),_0x41fbd0);if(_0x5b5b76[_0xa996('0x34')]['filter']){_0x4c979c[_0xa996('0x3c')]=_[_0xa996('0x3e')](_0x4c979c[_0xa996('0x3c')],{'$or':_[_0xa996('0x33')](_0x41fbd0,function(_0x5a94cc){if(_0x5a94cc[_0xa996('0x30')]!==_0xa996('0x3f')){var _0x4d7e22={};_0x4d7e22[_0x5a94cc[_0xa996('0x2a')]]={'$like':'%'+_0x5b5b76['query'][_0xa996('0x40')]+'%'};return _0x4d7e22;}})});}_0x4c979c=_['merge']({},_0x4c979c,_0x5b5b76[_0xa996('0x41')]);var _0x26b8f3={'where':_0x4c979c[_0xa996('0x3c')]};return db['ZohoAccount'][_0xa996('0x1f')](_0x26b8f3)['then'](function(_0xfa04d9){_0x4609fb[_0xa996('0x1f')]=_0xfa04d9;if(_0x5b5b76[_0xa996('0x34')][_0xa996('0x42')]){_0x4c979c[_0xa996('0x43')]=[{'all':!![]}];}return db[_0xa996('0x2d')][_0xa996('0x44')](_0x4c979c);})[_0xa996('0x25')](function(_0x504cd6){_0x4609fb[_0xa996('0x45')]=_0x504cd6;return _0x4609fb;})[_0xa996('0x25')](respondWithFilteredResult(_0x22d319,_0x4c979c))['catch'](handleError(_0x22d319,null));};exports[_0xa996('0x46')]=function(_0x2e7249,_0x4fcdd8){var _0x19dfe4={'raw':![],'where':{'id':_0x2e7249[_0xa996('0x47')]['id']}},_0x1b3ade={};_0x1b3ade[_0xa996('0x32')]=_[_0xa996('0x35')](db[_0xa996('0x2d')][_0xa996('0x2e')]);_0x1b3ade[_0xa996('0x34')]=_[_0xa996('0x35')](_0x2e7249['query']);_0x1b3ade['filters']=_[_0xa996('0x37')](_0x1b3ade[_0xa996('0x32')],_0x1b3ade[_0xa996('0x34')]);_0x19dfe4[_0xa996('0x38')]=_[_0xa996('0x37')](_0x1b3ade['model'],qs[_0xa996('0x39')](_0x2e7249['query'][_0xa996('0x39')]));_0x19dfe4['attributes']=_0x19dfe4[_0xa996('0x38')][_0xa996('0x48')]?_0x19dfe4[_0xa996('0x38')]:_0x1b3ade[_0xa996('0x32')];if(_0x2e7249[_0xa996('0x34')]['includeAll']){_0x19dfe4[_0xa996('0x43')]=[{'all':!![]}];}_0x19dfe4=_[_0xa996('0x3e')]({},_0x19dfe4,_0x2e7249[_0xa996('0x41')]);return db[_0xa996('0x2d')]['find'](_0x19dfe4)['then'](handleEntityNotFound(_0x4fcdd8,null))[_0xa996('0x25')](respondWithResult(_0x4fcdd8,null))[_0xa996('0x49')](handleError(_0x4fcdd8,null));};exports['create']=function(_0x21d893,_0x4e60cf){return db[_0xa996('0x2d')][_0xa996('0x4a')](_0x21d893[_0xa996('0x4b')],{})[_0xa996('0x25')](respondWithResult(_0x4e60cf,0xc9))[_0xa996('0x49')](handleError(_0x4e60cf,null));};exports[_0xa996('0x4c')]=function(_0x4d939c,_0x251571){if(_0x4d939c[_0xa996('0x4b')]['id']){delete _0x4d939c[_0xa996('0x4b')]['id'];}return db[_0xa996('0x2d')][_0xa996('0x4d')]({'where':{'id':_0x4d939c[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0x251571,null))['then'](saveUpdates(_0x4d939c[_0xa996('0x4b')],null))['then'](respondWithResult(_0x251571,null))['catch'](handleError(_0x251571,null));};exports[_0xa996('0x26')]=function(_0x3d7bef,_0xf38397){return db[_0xa996('0x2d')][_0xa996('0x4d')]({'where':{'id':_0x3d7bef[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0xf38397,null))[_0xa996('0x25')](removeEntity(_0xf38397,null))[_0xa996('0x49')](handleError(_0xf38397,null));};exports[_0xa996('0x4e')]=function(_0x4fcfde,_0x3aeb0c,_0x1f7434){var _0x51771c={};var _0x10bc68={};var _0x3c80ad;var _0x2c723a;return db['ZohoAccount'][_0xa996('0x4f')]({'where':{'id':_0x4fcfde[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0x3aeb0c,null))[_0xa996('0x25')](function(_0xa43a3c){if(_0xa43a3c){_0x3c80ad=_0xa43a3c;_0x10bc68[_0xa996('0x32')]=_['keys'](db[_0xa996('0x50')]['rawAttributes']);_0x10bc68[_0xa996('0x34')]=_[_0xa996('0x35')](_0x4fcfde[_0xa996('0x34')]);_0x10bc68[_0xa996('0x36')]=_[_0xa996('0x37')](_0x10bc68['model'],_0x10bc68[_0xa996('0x34')]);_0x51771c[_0xa996('0x38')]=_[_0xa996('0x37')](_0x10bc68[_0xa996('0x32')],qs[_0xa996('0x39')](_0x4fcfde[_0xa996('0x34')][_0xa996('0x39')]));_0x51771c['attributes']=_0x51771c[_0xa996('0x38')][_0xa996('0x48')]?_0x51771c[_0xa996('0x38')]:_0x10bc68['model'];_0x51771c[_0xa996('0x3b')]=qs[_0xa996('0x51')](_0x4fcfde[_0xa996('0x34')]['sort']);_0x51771c['where']=qs[_0xa996('0x36')](_['pick'](_0x4fcfde[_0xa996('0x34')],_0x10bc68[_0xa996('0x36')]));if(_0x4fcfde['query'][_0xa996('0x40')]){_0x51771c['where']=_[_0xa996('0x3e')](_0x51771c[_0xa996('0x3c')],{'$or':_[_0xa996('0x33')](_0x51771c[_0xa996('0x38')],function(_0x438623){var _0x5db090={};_0x5db090[_0x438623]={'$like':'%'+_0x4fcfde[_0xa996('0x34')][_0xa996('0x40')]+'%'};return _0x5db090;})});}_0x51771c=_['merge']({},_0x51771c,_0x4fcfde[_0xa996('0x41')]);return _0x3c80ad['getConfigurations'](_0x51771c);}})[_0xa996('0x25')](function(_0xbd7645){if(_0xbd7645){_0x2c723a=_0xbd7645['length'];if(!_0x4fcfde[_0xa996('0x34')][_0xa996('0x3a')]('nolimit')){_0x51771c[_0xa996('0x1e')]=qs[_0xa996('0x1e')](_0x4fcfde['query'][_0xa996('0x1e')]);_0x51771c[_0xa996('0x1c')]=qs['offset'](_0x4fcfde['query'][_0xa996('0x1c')]);}return _0x3c80ad[_0xa996('0x4e')](_0x51771c);}})['then'](function(_0x4102b5){if(_0x4102b5){return _0x4102b5?{'count':_0x2c723a,'rows':_0x4102b5}:null;}})[_0xa996('0x25')](respondWithResult(_0x3aeb0c,null))[_0xa996('0x49')](handleError(_0x3aeb0c,null));};exports[_0xa996('0x52')]=function(_0x4e62ae,_0xf312a0,_0x4e4f32){if(_0x4e62ae[_0xa996('0x4b')]['id']){delete _0x4e62ae[_0xa996('0x4b')]['id'];}return db[_0xa996('0x2d')][_0xa996('0x4f')]({'where':{'id':_0x4e62ae[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0xf312a0,null))[_0xa996('0x25')](function(_0x8ea235){if(_0x8ea235){_0x4e62ae[_0xa996('0x4b')]['AccountId']=_0x8ea235['id'];_0x4e62ae[_0xa996('0x4b')][_0xa996('0x53')]=integrations['getSubjects'](_0x4e62ae['body'][_0xa996('0x54')],_0x4e62ae[_0xa996('0x4b')][_0xa996('0x30')]);_0x4e62ae[_0xa996('0x4b')][_0xa996('0x55')]=integrations[_0xa996('0x56')](_0x4e62ae[_0xa996('0x4b')][_0xa996('0x54')],_0x4e62ae[_0xa996('0x4b')][_0xa996('0x30')]);return db[_0xa996('0x50')][_0xa996('0x4a')](_0x4e62ae[_0xa996('0x4b')],{'include':[{'model':db[_0xa996('0x57')],'as':'Subjects'},{'model':db[_0xa996('0x57')],'as':_0xa996('0x55')}]});}return null;})['then'](respondWithResult(_0xf312a0,null))[_0xa996('0x49')](handleError(_0xf312a0,null));};function getAccessToken(_0x31f60f){return new Promise(function(_0x281069,_0x7b4e4d){var _0x15372f;switch(_0x31f60f[_0xa996('0x58')]){case'US':_0x15372f=_0xa996('0x59');break;case'AU':_0x15372f=_0xa996('0x5a');break;case'EU':_0x15372f=_0xa996('0x5b');break;case'IN':_0x15372f=_0xa996('0x5c');break;case'CN':_0x15372f=_0xa996('0x5d');break;default:_0x15372f=_0xa996('0x5b');break;}var _0x436f93={'method':'POST','uri':_0x15372f+'/oauth/v2/token','qs':{'refresh_token':_0x31f60f['refreshToken'],'client_id':_0x31f60f[_0xa996('0x5e')],'client_secret':_0x31f60f[_0xa996('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x436f93)[_0xa996('0x25')](function(_0x76e3e3){if(_0x76e3e3[_0xa996('0x60')]){_0x281069(_0x76e3e3[_0xa996('0x60')]);}else{_0x7b4e4d('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x852f5b){_0x7b4e4d(_0x852f5b);});});}exports[_0xa996('0x61')]=function(_0x149bd4,_0x3da596,_0x5dbf42){var _0x4696f3,_0x29e6ff,_0x33cb20,_0x9dc73e,_0x24dc89;return db['ZohoAccount']['findOne']({'where':{'id':_0x149bd4[_0xa996('0x47')]['id']},'attributes':['id','host',_0xa996('0x58'),_0xa996('0x5e'),_0xa996('0x5f'),_0xa996('0x62'),_0xa996('0x63'),'refreshToken']})[_0xa996('0x25')](handleEntityNotFound(_0x3da596,null))[_0xa996('0x25')](function(_0xf65b33){_0x24dc89=_0xf65b33;_0x4696f3=_0x24dc89[_0xa996('0x64')];_0x29e6ff=_0x4696f3===_0xa996('0x65')?'eu':_0xa996('0x66');_0x33cb20=_0x24dc89['serverUrl'];var _0x32a4a1=_0x33cb20[_0xa996('0x67')](-0x1);if(_0x32a4a1==='/'||_0x32a4a1==='\x5c'||_0x32a4a1===':'){_0x33cb20=_0x33cb20[_0xa996('0x68')](0x0,_0x33cb20['lastIndexOf'](_0x32a4a1));}if(!_0x24dc89[_0xa996('0x69')]){throw new Error(_0xa996('0x6a'));}return getAccessToken(_0x24dc89);})[_0xa996('0x25')](function(_0x444b74){if(_0x444b74){return rp({'method':_0xa996('0x6b'),'uri':util['format'](_0xa996('0x6c'),_0x29e6ff),'qs':{'module':_0xa996('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x444b74},'json':!![]});}})[_0xa996('0x25')](function(_0x34d190){if(_0x34d190){if(_0x34d190[_0xa996('0x6e')]&&_0x34d190['response'][_0xa996('0x28')]){throw new Error(_0x34d190[_0xa996('0x6e')][_0xa996('0x28')][_0xa996('0x6f')]);}var _0x53f12a=[];var _0xf94800=[];var _0x390ae1=['Owner',_0xa996('0x70'),_0xa996('0x71'),_0xa996('0x72'),_0xa996('0x73'),_0xa996('0x74'),'Call_Start_Time','Call_Type'];_0xf94800=_[_0xa996('0x75')](_0x34d190[_0xa996('0x39')],function(_0x5a6398){return _0x390ae1[_0xa996('0x76')](_0x5a6398[_0xa996('0x77')]);});for(var _0x21c38b=0x0;_0x21c38b<_0xf94800[_0xa996('0x48')];_0x21c38b++){if(_0xf94800[_0x21c38b][_0xa996('0x78')]===![]){_0x53f12a[_0xa996('0x79')]({'id':_0xf94800[_0x21c38b]['id'],'name':_0xf94800[_0x21c38b][_0xa996('0x7a')],'custom':_0xf94800[_0x21c38b][_0xa996('0x7b')],'options':_0xf94800[_0x21c38b][_0xa996('0x7c')]===_0xa996('0x7d')&&_0xf94800[_0x21c38b][_0xa996('0x7e')]['length']>-0x1?_[_0xa996('0x33')](_0xf94800[_0x21c38b][_0xa996('0x7e')],function(_0x267fc0){return{'name':_0x267fc0,'value':_0x267fc0};}):[]});}}return{'count':_0x53f12a[_0xa996('0x48')],'rows':_0x53f12a};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3da596,null))[_0xa996('0x49')](function(_0x5d0abb){var _0x547c10=_0x149bd4['query'][_0xa996('0x7f')]?0x1f4:_0x5d0abb[_0xa996('0x80')]||0x1f4;logger[_0xa996('0x28')](_0xa996('0x81'),_0xa996('0x61'),_0x547c10,JSON['stringify'](_0x5d0abb));delete _0x5d0abb[_0xa996('0x2a')];if(_0x547c10===0x191){_0x547c10=0x190;}_0x3da596['status'](_0x547c10)[_0xa996('0x2b')](_0x149bd4[_0xa996('0x34')][_0xa996('0x7f')]?{'message':_0xa996('0x82'),'statusCode':_0x5d0abb[_0xa996('0x80')]}:_0x5d0abb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 9e9e17d..446ac18 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 _0xda32=['./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','https://accounts.zoho.com','https://accounts.zoho.in','application/x-www-form-urlencoded','parse','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x40da1d,_0xe98973){var _0x50dbf7=function(_0x4cc2b3){while(--_0x4cc2b3){_0x40da1d['push'](_0x40da1d['shift']());}};_0x50dbf7(++_0xe98973);}(_0xda32,0x106));var _0x2da3=function(_0x17264a,_0x3ec746){_0x17264a=_0x17264a-0x0;var _0x432786=_0xda32[_0x17264a];return _0x432786;};'use strict';var _=require(_0x2da3('0x0'));var util=require(_0x2da3('0x1'));var logger=require(_0x2da3('0x2'))(_0x2da3('0x3'));var moment=require(_0x2da3('0x4'));var BPromise=require('bluebird');var rp=require(_0x2da3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2da3('0x6'));var config=require(_0x2da3('0x7'));var attributes=require(_0x2da3('0x8'));var integrations=require(_0x2da3('0x9'));module[_0x2da3('0xa')]=function(_0x4e80c6,_0x471843){return _0x4e80c6[_0x2da3('0xb')](_0x2da3('0xc'),attributes,{'tableName':_0x2da3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ae9ab,_0x36db1c,_0x5d5885){if(_0x2ae9ab[_0x2da3('0xe')]('zone')||_0x2ae9ab[_0x2da3('0xe')](_0x2da3('0xf'))||_0x2ae9ab[_0x2da3('0xe')](_0x2da3('0x10'))||_0x2ae9ab[_0x2da3('0xe')]('clientSecret')||_0x2ae9ab[_0x2da3('0xe')](_0x2da3('0x11'))||_0x2ae9ab['changed'](_0x2da3('0x12'))){var _0x4f6fec,_0x48b319;_0x4f6fec=_0x2ae9ab['serverUrl'];var _0x598872=_0x4f6fec[_0x2da3('0x13')](-0x1);if(_0x598872==='/'||_0x598872==='\x5c'||_0x598872===':'){_0x4f6fec=_0x4f6fec[_0x2da3('0x14')](0x0,_0x4f6fec[_0x2da3('0x15')](_0x598872));}switch(_0x2ae9ab[_0x2da3('0x16')]){case'US':_0x48b319='https://accounts.zoho.com';break;case'AU':_0x48b319=_0x2da3('0x17');break;case'IN':_0x48b319='https://accounts.zoho.in';break;case'CN':_0x48b319=_0x2da3('0x18');break;default:_0x48b319=_0x2da3('0x19');break;}var _0x232cdd={'method':_0x2da3('0x1a'),'uri':_0x48b319+_0x2da3('0x1b'),'form':{'grant_type':_0x2da3('0x1c'),'client_id':_0x2ae9ab[_0x2da3('0x10')],'client_secret':_0x2ae9ab[_0x2da3('0x1d')],'redirect_uri':_0x2ae9ab['serverUrl'],'code':_0x2ae9ab['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x232cdd)[_0x2da3('0x1e')](function(_0x214b81){var _0x5ee83f=JSON['parse'](_0x214b81);if(_0x5ee83f[_0x2da3('0x1f')]){_0x2ae9ab[_0x2da3('0x20')]=_0x5ee83f[_0x2da3('0x1f')];logger[_0x2da3('0x21')](util[_0x2da3('0x22')](_0x2da3('0x23'),_0x2ae9ab['name'],_0x2ae9ab['id']));}else{logger[_0x2da3('0x24')](util[_0x2da3('0x22')](_0x2da3('0x25'),_0x2ae9ab['name'],_0x2ae9ab['id']),util[_0x2da3('0x26')](_0x5ee83f,{'showHidden':![],'depth':null}));}return _0x5d5885(null,_0x36db1c);})[_0x2da3('0x27')](function(_0x1ea98c){logger[_0x2da3('0x24')](util[_0x2da3('0x22')](_0x2da3('0x25'),_0x2ae9ab[_0x2da3('0x28')],_0x2ae9ab['id']),util[_0x2da3('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x5d5885(_0x1ea98c);});}else{return _0x5d5885(null,_0x36db1c);}},'beforeUpdate':function(_0x266f68,_0x54056e,_0xef6036){if(_0x266f68[_0x2da3('0xe')](_0x2da3('0x16'))||_0x266f68[_0x2da3('0xe')](_0x2da3('0xf'))||_0x266f68[_0x2da3('0xe')](_0x2da3('0x10'))||_0x266f68['changed'](_0x2da3('0x1d'))||_0x266f68[_0x2da3('0xe')](_0x2da3('0x11'))||_0x266f68['changed'](_0x2da3('0x12'))){var _0x8cfc85,_0x2bbd5a;_0x8cfc85=_0x266f68[_0x2da3('0xf')];var _0xc51d22=_0x8cfc85[_0x2da3('0x13')](-0x1);if(_0xc51d22==='/'||_0xc51d22==='\x5c'||_0xc51d22===':'){_0x8cfc85=_0x8cfc85[_0x2da3('0x14')](0x0,_0x8cfc85[_0x2da3('0x15')](_0xc51d22));}switch(_0x266f68[_0x2da3('0x16')]){case'US':_0x2bbd5a=_0x2da3('0x29');break;case'AU':_0x2bbd5a=_0x2da3('0x17');break;case'IN':_0x2bbd5a=_0x2da3('0x2a');break;case'CN':_0x2bbd5a=_0x2da3('0x18');break;default:_0x2bbd5a=_0x2da3('0x19');break;}var _0xf93481={'method':_0x2da3('0x1a'),'uri':_0x2bbd5a+'/oauth/v2/token','form':{'grant_type':_0x2da3('0x1c'),'client_id':_0x266f68['clientId'],'client_secret':_0x266f68[_0x2da3('0x1d')],'redirect_uri':_0x266f68[_0x2da3('0xf')],'code':_0x266f68[_0x2da3('0x11')]},'headers':{'Content-Type':_0x2da3('0x2b')}};return rp(_0xf93481)[_0x2da3('0x1e')](function(_0x197535){var _0x23e7c6=JSON[_0x2da3('0x2c')](_0x197535);if(_0x23e7c6[_0x2da3('0x1f')]){_0x266f68['refreshToken']=_0x23e7c6['refresh_token'];logger[_0x2da3('0x21')](util[_0x2da3('0x22')](_0x2da3('0x23'),_0x266f68['name'],_0x266f68['id']));}else{logger[_0x2da3('0x24')](util[_0x2da3('0x22')](_0x2da3('0x25'),_0x266f68[_0x2da3('0x28')],_0x266f68['id']),util[_0x2da3('0x26')](_0x23e7c6,{'showHidden':![],'depth':null}));}return _0xef6036(null,_0x54056e);})[_0x2da3('0x27')](function(_0x4f65f1){logger[_0x2da3('0x24')](util[_0x2da3('0x22')](_0x2da3('0x25'),_0x266f68[_0x2da3('0x28')],_0x266f68['id']),util[_0x2da3('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0xef6036(_0x4f65f1);});}else{return _0xef6036(null,_0x54056e);}}}});}; \ No newline at end of file +var _0xdf7e=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com','https://accounts.zoho.com.au','/oauth/v2/token','error'];(function(_0x54e7e5,_0x2748b9){var _0x2a44c6=function(_0x249563){while(--_0x249563){_0x54e7e5['push'](_0x54e7e5['shift']());}};_0x2a44c6(++_0x2748b9);}(_0xdf7e,0x190));var _0xedf7=function(_0x1c454d,_0x540913){_0x1c454d=_0x1c454d-0x0;var _0x21850f=_0xdf7e[_0x1c454d];return _0x21850f;};'use strict';var _=require('lodash');var util=require(_0xedf7('0x0'));var logger=require(_0xedf7('0x1'))(_0xedf7('0x2'));var moment=require(_0xedf7('0x3'));var BPromise=require(_0xedf7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xedf7('0x5'));var attributes=require(_0xedf7('0x6'));var integrations=require(_0xedf7('0x7'));module['exports']=function(_0x2e73f,_0x3491d1){return _0x2e73f[_0xedf7('0x8')](_0xedf7('0x9'),attributes,{'tableName':_0xedf7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39515b,_0xb72c6c,_0x381daf){if(_0x39515b['changed'](_0xedf7('0xb'))||_0x39515b[_0xedf7('0xc')]('serverUrl')||_0x39515b[_0xedf7('0xc')](_0xedf7('0xd'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0xe'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0xf'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0x10'))){var _0x56fac9,_0x1e3b6b;_0x56fac9=_0x39515b['serverUrl'];var _0x3f4e20=_0x56fac9[_0xedf7('0x11')](-0x1);if(_0x3f4e20==='/'||_0x3f4e20==='\x5c'||_0x3f4e20===':'){_0x56fac9=_0x56fac9[_0xedf7('0x12')](0x0,_0x56fac9[_0xedf7('0x13')](_0x3f4e20));}switch(_0x39515b['zone']){case'US':_0x1e3b6b='https://accounts.zoho.com';break;case'AU':_0x1e3b6b='https://accounts.zoho.com.au';break;case'IN':_0x1e3b6b=_0xedf7('0x14');break;case'CN':_0x1e3b6b=_0xedf7('0x15');break;default:_0x1e3b6b='https://accounts.zoho.eu';break;}var _0x4e3e98={'method':_0xedf7('0x16'),'uri':_0x1e3b6b+'/oauth/v2/token','form':{'grant_type':_0xedf7('0x17'),'client_id':_0x39515b[_0xedf7('0xd')],'client_secret':_0x39515b[_0xedf7('0xe')],'redirect_uri':_0x39515b[_0xedf7('0x18')],'code':_0x39515b['code']},'headers':{'Content-Type':_0xedf7('0x19')}};return rp(_0x4e3e98)[_0xedf7('0x1a')](function(_0x10270f){var _0x448b64=JSON[_0xedf7('0x1b')](_0x10270f);if(_0x448b64[_0xedf7('0x1c')]){_0x39515b[_0xedf7('0x1d')]=_0x448b64[_0xedf7('0x1c')];logger['info'](util[_0xedf7('0x1e')](_0xedf7('0x1f'),_0x39515b[_0xedf7('0x20')],_0x39515b['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x39515b[_0xedf7('0x20')],_0x39515b['id']),util[_0xedf7('0x21')](_0x448b64,{'showHidden':![],'depth':null}));}return _0x381daf(null,_0xb72c6c);})[_0xedf7('0x22')](function(_0x1a62d6){logger['error'](util[_0xedf7('0x1e')](_0xedf7('0x23'),_0x39515b[_0xedf7('0x20')],_0x39515b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x381daf(_0x1a62d6);});}else{return _0x381daf(null,_0xb72c6c);}},'beforeUpdate':function(_0x2c3fc8,_0x1bcafc,_0x3524fc){if(_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0xb'))||_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0x18'))||_0x2c3fc8['changed'](_0xedf7('0xd'))||_0x2c3fc8[_0xedf7('0xc')]('clientSecret')||_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0xf'))||_0x2c3fc8['changed'](_0xedf7('0x10'))){var _0x1aeabc,_0x570f3f;_0x1aeabc=_0x2c3fc8[_0xedf7('0x18')];var _0x568af4=_0x1aeabc['slice'](-0x1);if(_0x568af4==='/'||_0x568af4==='\x5c'||_0x568af4===':'){_0x1aeabc=_0x1aeabc['substring'](0x0,_0x1aeabc[_0xedf7('0x13')](_0x568af4));}switch(_0x2c3fc8[_0xedf7('0xb')]){case'US':_0x570f3f=_0xedf7('0x24');break;case'AU':_0x570f3f=_0xedf7('0x25');break;case'IN':_0x570f3f='https://accounts.zoho.in';break;case'CN':_0x570f3f=_0xedf7('0x15');break;default:_0x570f3f='https://accounts.zoho.eu';break;}var _0x59ae1f={'method':_0xedf7('0x16'),'uri':_0x570f3f+_0xedf7('0x26'),'form':{'grant_type':'authorization_code','client_id':_0x2c3fc8[_0xedf7('0xd')],'client_secret':_0x2c3fc8[_0xedf7('0xe')],'redirect_uri':_0x2c3fc8[_0xedf7('0x18')],'code':_0x2c3fc8['code']},'headers':{'Content-Type':_0xedf7('0x19')}};return rp(_0x59ae1f)[_0xedf7('0x1a')](function(_0x139f7e){var _0x30a0ca=JSON[_0xedf7('0x1b')](_0x139f7e);if(_0x30a0ca[_0xedf7('0x1c')]){_0x2c3fc8[_0xedf7('0x1d')]=_0x30a0ca[_0xedf7('0x1c')];logger['info'](util[_0xedf7('0x1e')](_0xedf7('0x1f'),_0x2c3fc8[_0xedf7('0x20')],_0x2c3fc8['id']));}else{logger[_0xedf7('0x27')](util[_0xedf7('0x1e')](_0xedf7('0x23'),_0x2c3fc8[_0xedf7('0x20')],_0x2c3fc8['id']),util[_0xedf7('0x21')](_0x30a0ca,{'showHidden':![],'depth':null}));}return _0x3524fc(null,_0x1bcafc);})[_0xedf7('0x22')](function(_0x4caca5){logger['error'](util[_0xedf7('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c3fc8['name'],_0x2c3fc8['id']),util[_0xedf7('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x3524fc(_0x4caca5);});}else{return _0x3524fc(null,_0x1bcafc);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 87aa259..953d9f4 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 _0x160f=['../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowZohoAccount','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')]({'raw':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8185[_0xf160('0x19')]?_0x4b8185['options'][_0xf160('0x1b')]||null:null,'attributes':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')]['attributes']||null:null,'limit':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1c')]||null:null,'include':_0x4b8185[_0xf160('0x19')]?_0x4b8185[_0xf160('0x19')][_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4b8185['options'][_0xf160('0x1d')],function(_0x28bf27){return{'model':db[_0x28bf27[_0xf160('0x1f')]],'as':_0x28bf27['as'],'attributes':_0x28bf27[_0xf160('0x20')],'include':_0x28bf27['include']?_[_0xf160('0x1e')](_0x28bf27[_0xf160('0x1d')],function(_0x4a8003){return{'model':db[_0x4a8003['model']],'as':_0x4a8003['as'],'attributes':_0x4a8003[_0xf160('0x20')],'include':_0x4a8003[_0xf160('0x1d')]?_[_0xf160('0x1e')](_0x4a8003['include'],function(_0xcfa9bd){return{'model':db[_0xcfa9bd[_0xf160('0x1f')]],'as':_0xcfa9bd['as'],'attributes':_0xcfa9bd[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x135e0f){logger[_0xf160('0xd')]('GetZohoAccount',_0x4b8185);logger['debug']('GetZohoAccount',_0x4b8185,JSON[_0xf160('0x11')](_0x135e0f));_0x1cf6ba(_0x135e0f);})[_0xf160('0x15')](function(_0xcaab39){logger[_0xf160('0x12')](_0xf160('0x16'),_0xcaab39['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0xcaab39[_0xf160('0x14')]));});});};exports['ShowZohoAccount']=function(_0x4ce478){var _0x22c2e3=this;return new Promise(function(_0x3a35b3,_0x5497f6){return db[_0xf160('0x17')][_0xf160('0x21')]({'raw':_0x4ce478['options']?_0x4ce478['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ce478['options']?_0x4ce478[_0xf160('0x19')][_0xf160('0x1b')]||null:null,'attributes':_0x4ce478[_0xf160('0x19')]?_0x4ce478[_0xf160('0x19')][_0xf160('0x20')]||null:null,'include':_0x4ce478[_0xf160('0x19')]?_0x4ce478['options']['include']?_['map'](_0x4ce478[_0xf160('0x19')]['include'],function(_0x5c65d2){return{'model':db[_0x5c65d2[_0xf160('0x1f')]],'as':_0x5c65d2['as'],'attributes':_0x5c65d2[_0xf160('0x20')],'include':_0x5c65d2['include']?_[_0xf160('0x1e')](_0x5c65d2[_0xf160('0x1d')],function(_0x272efe){return{'model':db[_0x272efe[_0xf160('0x1f')]],'as':_0x272efe['as'],'attributes':_0x272efe[_0xf160('0x20')],'include':_0x272efe['include']?_[_0xf160('0x1e')](_0x272efe[_0xf160('0x1d')],function(_0x15070a){return{'model':db[_0x15070a['model']],'as':_0x15070a['as'],'attributes':_0x15070a[_0xf160('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf160('0xc')](function(_0x1e4bd6){logger[_0xf160('0xd')](_0xf160('0x22'),_0x4ce478);logger[_0xf160('0x23')]('ShowZohoAccount',_0x4ce478,JSON['stringify'](_0x1e4bd6));_0x3a35b3(_0x1e4bd6);})[_0xf160('0x15')](function(_0x21c248){logger[_0xf160('0x12')](_0xf160('0x22'),_0x21c248[_0xf160('0x14')],_0x4ce478);_0x5497f6(_0x22c2e3[_0xf160('0x12')](0x1f4,_0x21c248[_0xf160('0x14')]));});});}; \ No newline at end of file +var _0xa486=['ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','findAll','options','where','attributes','include','model','GetZohoAccount','ZohoAccount','find','raw','map','ShowZohoAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','debug'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xa486,0x17d));var _0x6a48=function(_0x3b8d1c,_0x3392f4){_0x3b8d1c=_0x3b8d1c-0x0;var _0x4dcfc5=_0xa486[_0x3b8d1c];return _0x4dcfc5;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var moment=require(_0x6a48('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a48('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a48('0x3'))['db'];var utils=require(_0x6a48('0x4'));var logger=require(_0x6a48('0x5'))(_0x6a48('0x6'));var config=require(_0x6a48('0x7'));var jayson=require(_0x6a48('0x8'));var client=jayson[_0x6a48('0x9')][_0x6a48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x124af7,_0x121665,_0x422497){return new BPromise(function(_0x3b751d,_0x40a8f2){return client[_0x6a48('0xb')](_0x124af7,_0x422497)[_0x6a48('0xc')](function(_0xbd313a){logger['info'](_0x6a48('0xd'),_0x121665,'request\x20sent');logger[_0x6a48('0xe')](_0x6a48('0xf'),_0x121665,_0x6a48('0x10'),JSON[_0x6a48('0x11')](_0xbd313a));if(_0xbd313a[_0x6a48('0x12')]){if(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x13')]===0x1f4){logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);return _0x40a8f2(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);}logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);return _0x3b751d(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);}else{logger[_0x6a48('0x15')](_0x6a48('0xd'),_0x121665,_0x6a48('0x10'));_0x3b751d(_0xbd313a[_0x6a48('0x16')][_0x6a48('0x14')]);}})[_0x6a48('0x17')](function(_0x2ca540){logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0x2ca540);_0x40a8f2(_0x2ca540);});});}exports['GetZohoAccount']=function(_0xab0913){var _0x23a1fe=this;return new Promise(function(_0x152280,_0x1290e1){return db['ZohoAccount'][_0x6a48('0x18')]({'raw':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')][_0x6a48('0x1a')]||null:null,'attributes':_0xab0913['options']?_0xab0913[_0x6a48('0x19')][_0x6a48('0x1b')]||null:null,'limit':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['limit']||null:null,'include':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['include']?_['map'](_0xab0913[_0x6a48('0x19')][_0x6a48('0x1c')],function(_0x4cb5d0){return{'model':db[_0x4cb5d0[_0x6a48('0x1d')]],'as':_0x4cb5d0['as'],'attributes':_0x4cb5d0['attributes'],'include':_0x4cb5d0['include']?_['map'](_0x4cb5d0['include'],function(_0x2a14d5){return{'model':db[_0x2a14d5['model']],'as':_0x2a14d5['as'],'attributes':_0x2a14d5[_0x6a48('0x1b')],'include':_0x2a14d5['include']?_['map'](_0x2a14d5['include'],function(_0x5d62a6){return{'model':db[_0x5d62a6[_0x6a48('0x1d')]],'as':_0x5d62a6['as'],'attributes':_0x5d62a6[_0x6a48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a48('0xc')](function(_0x20ecb0){logger['info'](_0x6a48('0x1e'),_0xab0913);logger[_0x6a48('0xe')](_0x6a48('0x1e'),_0xab0913,JSON[_0x6a48('0x11')](_0x20ecb0));_0x152280(_0x20ecb0);})['catch'](function(_0x57522a){logger[_0x6a48('0x12')](_0x6a48('0x1e'),_0x57522a[_0x6a48('0x14')],_0xab0913);_0x1290e1(_0x23a1fe[_0x6a48('0x12')](0x1f4,_0x57522a[_0x6a48('0x14')]));});});};exports['ShowZohoAccount']=function(_0x16982f){var _0x5c8e3e=this;return new Promise(function(_0x50e0e8,_0x12ba71){return db[_0x6a48('0x1f')][_0x6a48('0x20')]({'raw':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x21')]===undefined?!![]:![]:!![],'where':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1a')]||null:null,'attributes':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1b')]||null:null,'include':_0x16982f['options']?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1c')]?_[_0x6a48('0x22')](_0x16982f['options'][_0x6a48('0x1c')],function(_0x4a52a3){return{'model':db[_0x4a52a3[_0x6a48('0x1d')]],'as':_0x4a52a3['as'],'attributes':_0x4a52a3['attributes'],'include':_0x4a52a3[_0x6a48('0x1c')]?_[_0x6a48('0x22')](_0x4a52a3[_0x6a48('0x1c')],function(_0x483428){return{'model':db[_0x483428[_0x6a48('0x1d')]],'as':_0x483428['as'],'attributes':_0x483428[_0x6a48('0x1b')],'include':_0x483428['include']?_['map'](_0x483428[_0x6a48('0x1c')],function(_0x463476){return{'model':db[_0x463476[_0x6a48('0x1d')]],'as':_0x463476['as'],'attributes':_0x463476[_0x6a48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a48('0xc')](function(_0x174a44){logger[_0x6a48('0x15')](_0x6a48('0x23'),_0x16982f);logger['debug'](_0x6a48('0x23'),_0x16982f,JSON[_0x6a48('0x11')](_0x174a44));_0x50e0e8(_0x174a44);})[_0x6a48('0x17')](function(_0x2b236b){logger[_0x6a48('0x12')](_0x6a48('0x23'),_0x2b236b[_0x6a48('0x14')],_0x16982f);_0x12ba71(_0x5c8e3e[_0x6a48('0x12')](0x1f4,_0x2b236b[_0x6a48('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1ceac7a..90a97c1 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 _0x41d1=['put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','/:id/fields','isAuthenticated','/:id/descriptions','getDescriptions','post','create'];(function(_0x4e4ed7,_0x18dc7e){var _0x21f780=function(_0x313ca0){while(--_0x313ca0){_0x4e4ed7['push'](_0x4e4ed7['shift']());}};_0x21f780(++_0x18dc7e);}(_0x41d1,0x100));var _0x141d=function(_0x216586,_0x2e9346){_0x216586=_0x216586-0x0;var _0x2c0807=_0x41d1[_0x216586];return _0x2c0807;};'use strict';var multer=require(_0x141d('0x0'));var util=require(_0x141d('0x1'));var path=require(_0x141d('0x2'));var timeout=require('connect-timeout');var express=require(_0x141d('0x3'));var router=express['Router']();var fs_extra=require(_0x141d('0x4'));var auth=require(_0x141d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x141d('0x6'));var controller=require(_0x141d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x141d('0x8')]);router[_0x141d('0x9')](_0x141d('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x141d('0xb'),auth[_0x141d('0xc')](),controller['getFields']);router[_0x141d('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x141d('0xd'),auth['isAuthenticated'](),controller[_0x141d('0xe')]);router[_0x141d('0xf')]('/',auth['isAuthenticated'](),controller[_0x141d('0x10')]);router[_0x141d('0x11')]('/:id',auth[_0x141d('0xc')](),controller['update']);router[_0x141d('0x12')]('/:id',auth[_0x141d('0xc')](),controller[_0x141d('0x13')]);module[_0x141d('0x14')]=router; \ No newline at end of file +var _0x9e02=['./intZohoConfiguration.controller','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','isAuthenticated','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9e02,0x1ae));var _0x29e0=function(_0x35dcbc,_0x4834e9){_0x35dcbc=_0x35dcbc-0x0;var _0x3bfd51=_0x9e02[_0x35dcbc];return _0x3bfd51;};'use strict';var multer=require(_0x29e0('0x0'));var util=require('util');var path=require(_0x29e0('0x1'));var timeout=require(_0x29e0('0x2'));var express=require(_0x29e0('0x3'));var router=express['Router']();var fs_extra=require(_0x29e0('0x4'));var auth=require(_0x29e0('0x5'));var interaction=require(_0x29e0('0x6'));var config=require('../../config/environment');var controller=require(_0x29e0('0x7'));router[_0x29e0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29e0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x29e0('0x9')]);router[_0x29e0('0x8')](_0x29e0('0xa'),auth['isAuthenticated'](),controller[_0x29e0('0xb')]);router[_0x29e0('0x8')](_0x29e0('0xc'),auth['isAuthenticated'](),controller[_0x29e0('0xd')]);router[_0x29e0('0x8')]('/:id/descriptions',auth[_0x29e0('0xe')](),controller[_0x29e0('0xf')]);router[_0x29e0('0x10')]('/',auth['isAuthenticated'](),controller[_0x29e0('0x11')]);router[_0x29e0('0x12')](_0x29e0('0x13'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x14')]);router[_0x29e0('0x15')]('/:id',auth[_0x29e0('0xe')](),controller[_0x29e0('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index d8fc9a8..62bedfc 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 _0x50a7=['ENUM','lead','contact_lead','contact','sequelize','exports','STRING'];(function(_0x4af5dc,_0x10d191){var _0x568a71=function(_0x23e6ec){while(--_0x23e6ec){_0x4af5dc['push'](_0x4af5dc['shift']());}};_0x568a71(++_0x10d191);}(_0x50a7,0x82));var _0x750a=function(_0xc6ea98,_0x1f0fe7){_0xc6ea98=_0xc6ea98-0x0;var _0x154999=_0x50a7[_0xc6ea98];return _0x154999;};'use strict';var Sequelize=require(_0x750a('0x0'));module[_0x750a('0x1')]={'name':{'type':Sequelize[_0x750a('0x2')]},'moduleCreate':{'type':Sequelize[_0x750a('0x3')](_0x750a('0x4'),'contact','nothing'),'defaultValue':_0x750a('0x4')},'moduleSearch':{'type':Sequelize[_0x750a('0x3')](_0x750a('0x5'),_0x750a('0x6'),_0x750a('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x750a('0x2')]}}; \ No newline at end of file +var _0xd54a=['nothing','lead','contact_lead','sequelize','STRING','ENUM','contact'];(function(_0x592ae5,_0x20524b){var _0x20b7be=function(_0x3628ba){while(--_0x3628ba){_0x592ae5['push'](_0x592ae5['shift']());}};_0x20b7be(++_0x20524b);}(_0xd54a,0x1df));var _0xad54=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd54a[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xad54('0x0'));module['exports']={'name':{'type':Sequelize[_0xad54('0x1')]},'moduleCreate':{'type':Sequelize[_0xad54('0x2')]('lead',_0xad54('0x3'),_0xad54('0x4')),'defaultValue':_0xad54('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0xad54('0x6'),_0xad54('0x3'),_0xad54('0x5')),'defaultValue':_0xad54('0x6')},'description':{'type':Sequelize[_0xad54('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ca9cd93..dd7284f 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 _0x7100=['order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','show','params','include','find','catch','create','body','getFields','findOne','ZohoField','rawAttributes','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','apply','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','limit'];(function(_0x1be1cd,_0x186303){var _0x292cda=function(_0x22b196){while(--_0x22b196){_0x1be1cd['push'](_0x1be1cd['shift']());}};_0x292cda(++_0x186303);}(_0x7100,0x119));var _0x0710=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x7100[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0x0710('0x0'));var rimraf=require(_0x0710('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0710('0x2'));var rp=require(_0x0710('0x3'));var moment=require(_0x0710('0x4'));var BPromise=require(_0x0710('0x5'));var Mustache=require(_0x0710('0x6'));var util=require('util');var path=require(_0x0710('0x7'));var sox=require(_0x0710('0x8'));var csv=require(_0x0710('0x9'));var ejs=require(_0x0710('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0710('0xb'));var squel=require(_0x0710('0xc'));var crypto=require(_0x0710('0xd'));var jsforce=require(_0x0710('0xe'));var deskjs=require(_0x0710('0xf'));var toCsv=require(_0x0710('0x9'));var querystring=require(_0x0710('0x10'));var Papa=require(_0x0710('0x11'));var Redis=require(_0x0710('0x12'));var authService=require(_0x0710('0x13'));var qs=require(_0x0710('0x14'));var as=require(_0x0710('0x15'));var hardwareService=require(_0x0710('0x16'));var logger=require(_0x0710('0x17'))(_0x0710('0x18'));var utils=require('../../config/utils');var config=require(_0x0710('0x19'));var licenseUtil=require(_0x0710('0x1a'));var db=require(_0x0710('0x1b'))['db'];function respondWithStatusCode(_0x3dc886,_0x56fa68){_0x56fa68=_0x56fa68||0xcc;return function(_0x3eca7d){if(_0x3eca7d){return _0x3dc886['sendStatus'](_0x56fa68);}return _0x3dc886[_0x0710('0x1c')](_0x56fa68)['end']();};}function respondWithResult(_0x9eab24,_0x5952d7){_0x5952d7=_0x5952d7||0xc8;return function(_0x3c5f15){if(_0x3c5f15){return _0x9eab24[_0x0710('0x1c')](_0x5952d7)[_0x0710('0x1d')](_0x3c5f15);}};}function respondWithFilteredResult(_0x527f29,_0x113f00){return function(_0x3ca484){if(_0x3ca484){var _0x1d109e=typeof _0x113f00[_0x0710('0x1e')]===_0x0710('0x1f')&&typeof _0x113f00['limit']===_0x0710('0x1f');var _0x15c957=_0x3ca484[_0x0710('0x20')];var _0x16c185=_0x1d109e?0x0:_0x113f00[_0x0710('0x1e')];var _0x242fb8=_0x1d109e?_0x3ca484[_0x0710('0x20')]:_0x113f00[_0x0710('0x1e')]+_0x113f00['limit'];var _0x261024;if(_0x242fb8>=_0x15c957){_0x242fb8=_0x15c957;_0x261024=0xc8;}else{_0x261024=0xce;}_0x527f29[_0x0710('0x1c')](_0x261024);return _0x527f29[_0x0710('0x21')]('Content-Range',_0x16c185+'-'+_0x242fb8+'/'+_0x15c957)[_0x0710('0x1d')](_0x3ca484);}return null;};}function patchUpdates(_0x29882a){return function(_0x37deea){try{jsonpatch[_0x0710('0x22')](_0x37deea,_0x29882a,!![]);}catch(_0x190964){return BPromise['reject'](_0x190964);}return _0x37deea[_0x0710('0x23')]();};}function saveUpdates(_0x16d8ae,_0x13f824){return function(_0x4abfa1){if(_0x4abfa1){return _0x4abfa1[_0x0710('0x24')](_0x16d8ae)['then'](function(_0x3155b9){return _0x3155b9;});}return null;};}function removeEntity(_0x4a46e8,_0x4b3dd5){return function(_0x303692){if(_0x303692){return _0x303692[_0x0710('0x25')]()['then'](function(){_0x4a46e8[_0x0710('0x1c')](0xcc)[_0x0710('0x26')]();});}};}function handleEntityNotFound(_0x3fafbf,_0x596320){return function(_0x267eef){if(!_0x267eef){_0x3fafbf[_0x0710('0x27')](0x194);}return _0x267eef;};}function handleError(_0x3db899,_0x52e344){_0x52e344=_0x52e344||0x1f4;return function(_0x3187b2){logger[_0x0710('0x28')](_0x3187b2[_0x0710('0x29')]);if(_0x3187b2[_0x0710('0x2a')]){delete _0x3187b2[_0x0710('0x2a')];}_0x3db899[_0x0710('0x1c')](_0x52e344)[_0x0710('0x2b')](_0x3187b2);};}exports[_0x0710('0x2c')]=function(_0x1650f7,_0x2f81df){var _0x54ed2b={},_0x442727={},_0x2f0e8f={'count':0x0,'rows':[]};var _0x4c1a24=_[_0x0710('0x2d')](db[_0x0710('0x2e')]['rawAttributes'],function(_0x45f01a){return{'name':_0x45f01a['fieldName'],'type':_0x45f01a[_0x0710('0x2f')][_0x0710('0x30')]};});_0x442727['model']=_['map'](_0x4c1a24,'name');_0x442727[_0x0710('0x31')]=_[_0x0710('0x32')](_0x1650f7[_0x0710('0x31')]);_0x442727[_0x0710('0x33')]=_[_0x0710('0x34')](_0x442727['model'],_0x442727[_0x0710('0x31')]);_0x54ed2b[_0x0710('0x35')]=_[_0x0710('0x34')](_0x442727['model'],qs[_0x0710('0x36')](_0x1650f7['query'][_0x0710('0x36')]));_0x54ed2b[_0x0710('0x35')]=_0x54ed2b[_0x0710('0x35')][_0x0710('0x37')]?_0x54ed2b[_0x0710('0x35')]:_0x442727[_0x0710('0x38')];if(!_0x1650f7[_0x0710('0x31')][_0x0710('0x39')]('nolimit')){_0x54ed2b[_0x0710('0x3a')]=qs[_0x0710('0x3a')](_0x1650f7['query']['limit']);_0x54ed2b[_0x0710('0x1e')]=qs['offset'](_0x1650f7[_0x0710('0x31')]['offset']);}_0x54ed2b[_0x0710('0x3b')]=qs[_0x0710('0x3c')](_0x1650f7[_0x0710('0x31')][_0x0710('0x3c')]);_0x54ed2b[_0x0710('0x3d')]=qs[_0x0710('0x33')](_['pick'](_0x1650f7[_0x0710('0x31')],_0x442727[_0x0710('0x33')]),_0x4c1a24);if(_0x1650f7[_0x0710('0x31')][_0x0710('0x3e')]){_0x54ed2b[_0x0710('0x3d')]=_[_0x0710('0x3f')](_0x54ed2b[_0x0710('0x3d')],{'$or':_['map'](_0x4c1a24,function(_0x1dc86c){if(_0x1dc86c['type']!==_0x0710('0x40')){var _0x331144={};_0x331144[_0x1dc86c[_0x0710('0x2a')]]={'$like':'%'+_0x1650f7[_0x0710('0x31')]['filter']+'%'};return _0x331144;}})});}_0x54ed2b=_[_0x0710('0x3f')]({},_0x54ed2b,_0x1650f7[_0x0710('0x41')]);var _0x7597a5={'where':_0x54ed2b[_0x0710('0x3d')]};return db[_0x0710('0x2e')][_0x0710('0x20')](_0x7597a5)[_0x0710('0x42')](function(_0x174feb){_0x2f0e8f['count']=_0x174feb;if(_0x1650f7['query'][_0x0710('0x43')]){_0x54ed2b['include']=[{'all':!![]}];}return db[_0x0710('0x2e')][_0x0710('0x44')](_0x54ed2b);})[_0x0710('0x42')](function(_0x45b83b){_0x2f0e8f[_0x0710('0x45')]=_0x45b83b;return _0x2f0e8f;})[_0x0710('0x42')](respondWithFilteredResult(_0x2f81df,_0x54ed2b))['catch'](handleError(_0x2f81df,null));};exports[_0x0710('0x46')]=function(_0xaaf420,_0xb94770){var _0x35909e={'raw':![],'where':{'id':_0xaaf420[_0x0710('0x47')]['id']}},_0x3885b5={};_0x3885b5[_0x0710('0x38')]=_['keys'](db[_0x0710('0x2e')]['rawAttributes']);_0x3885b5['query']=_['keys'](_0xaaf420['query']);_0x3885b5[_0x0710('0x33')]=_[_0x0710('0x34')](_0x3885b5[_0x0710('0x38')],_0x3885b5[_0x0710('0x31')]);_0x35909e['attributes']=_['intersection'](_0x3885b5[_0x0710('0x38')],qs[_0x0710('0x36')](_0xaaf420[_0x0710('0x31')][_0x0710('0x36')]));_0x35909e[_0x0710('0x35')]=_0x35909e[_0x0710('0x35')][_0x0710('0x37')]?_0x35909e[_0x0710('0x35')]:_0x3885b5[_0x0710('0x38')];if(_0xaaf420[_0x0710('0x31')][_0x0710('0x43')]){_0x35909e[_0x0710('0x48')]=[{'all':!![]}];}_0x35909e=_[_0x0710('0x3f')]({},_0x35909e,_0xaaf420[_0x0710('0x41')]);return db[_0x0710('0x2e')][_0x0710('0x49')](_0x35909e)['then'](handleEntityNotFound(_0xb94770,null))[_0x0710('0x42')](respondWithResult(_0xb94770,null))[_0x0710('0x4a')](handleError(_0xb94770,null));};exports['create']=function(_0x49d944,_0x39f4e1){return db['ZohoConfiguration'][_0x0710('0x4b')](_0x49d944['body'],{})[_0x0710('0x42')](respondWithResult(_0x39f4e1,0xc9))[_0x0710('0x4a')](handleError(_0x39f4e1,null));};exports['update']=function(_0x1736c3,_0x5a2f8a){if(_0x1736c3[_0x0710('0x4c')]['id']){delete _0x1736c3['body']['id'];}return db[_0x0710('0x2e')]['find']({'where':{'id':_0x1736c3[_0x0710('0x47')]['id']}})[_0x0710('0x42')](handleEntityNotFound(_0x5a2f8a,null))[_0x0710('0x42')](saveUpdates(_0x1736c3[_0x0710('0x4c')],null))[_0x0710('0x42')](respondWithResult(_0x5a2f8a,null))[_0x0710('0x4a')](handleError(_0x5a2f8a,null));};exports[_0x0710('0x25')]=function(_0x4a6f5a,_0x2a2747){return db[_0x0710('0x2e')][_0x0710('0x49')]({'where':{'id':_0x4a6f5a[_0x0710('0x47')]['id']}})[_0x0710('0x42')](handleEntityNotFound(_0x2a2747,null))[_0x0710('0x42')](removeEntity(_0x2a2747,null))[_0x0710('0x4a')](handleError(_0x2a2747,null));};exports[_0x0710('0x4d')]=function(_0x3c768c,_0x34df6f,_0xff271c){var _0x21789a={};var _0x49d1db={};var _0x2ed689;var _0x5660fa;return db[_0x0710('0x2e')][_0x0710('0x4e')]({'where':{'id':_0x3c768c[_0x0710('0x47')]['id']}})[_0x0710('0x42')](handleEntityNotFound(_0x34df6f,null))['then'](function(_0x4f48dc){if(_0x4f48dc){_0x2ed689=_0x4f48dc;_0x49d1db['model']=_[_0x0710('0x32')](db[_0x0710('0x4f')][_0x0710('0x50')]);_0x49d1db[_0x0710('0x31')]=_['keys'](_0x3c768c[_0x0710('0x31')]);_0x49d1db['filters']=_['intersection'](_0x49d1db[_0x0710('0x38')],_0x49d1db[_0x0710('0x31')]);_0x21789a[_0x0710('0x35')]=_[_0x0710('0x34')](_0x49d1db['model'],qs[_0x0710('0x36')](_0x3c768c[_0x0710('0x31')][_0x0710('0x36')]));_0x21789a['attributes']=_0x21789a[_0x0710('0x35')][_0x0710('0x37')]?_0x21789a[_0x0710('0x35')]:_0x49d1db[_0x0710('0x38')];_0x21789a[_0x0710('0x3b')]=qs[_0x0710('0x3c')](_0x3c768c['query'][_0x0710('0x3c')]);_0x21789a[_0x0710('0x3d')]=qs['filters'](_[_0x0710('0x51')](_0x3c768c['query'],_0x49d1db[_0x0710('0x33')]));if(_0x3c768c[_0x0710('0x31')][_0x0710('0x3e')]){_0x21789a['where']=_['merge'](_0x21789a[_0x0710('0x3d')],{'$or':_[_0x0710('0x2d')](_0x21789a[_0x0710('0x35')],function(_0x491726){var _0x27de4a={};_0x27de4a[_0x491726]={'$like':'%'+_0x3c768c[_0x0710('0x31')][_0x0710('0x3e')]+'%'};return _0x27de4a;})});}_0x21789a=_['merge']({},_0x21789a,_0x3c768c[_0x0710('0x41')]);return _0x2ed689['getFields'](_0x21789a);}})[_0x0710('0x42')](function(_0x5d9d53){if(_0x5d9d53){_0x5660fa=_0x5d9d53['length'];if(!_0x3c768c[_0x0710('0x31')][_0x0710('0x39')](_0x0710('0x52'))){_0x21789a['limit']=qs[_0x0710('0x3a')](_0x3c768c[_0x0710('0x31')][_0x0710('0x3a')]);_0x21789a['offset']=qs[_0x0710('0x1e')](_0x3c768c[_0x0710('0x31')][_0x0710('0x1e')]);}return _0x2ed689[_0x0710('0x4d')](_0x21789a);}})[_0x0710('0x42')](function(_0x30dfec){if(_0x30dfec){return _0x30dfec?{'count':_0x5660fa,'rows':_0x30dfec}:null;}})[_0x0710('0x42')](respondWithResult(_0x34df6f,null))['catch'](handleError(_0x34df6f,null));};exports[_0x0710('0x53')]=function(_0x3623a3,_0x557828,_0x4e116f){var _0x180303={};var _0x4bc1a6={};var _0x2fd660;var _0x3250b6;return db[_0x0710('0x2e')][_0x0710('0x4e')]({'where':{'id':_0x3623a3['params']['id']}})['then'](handleEntityNotFound(_0x557828,null))[_0x0710('0x42')](function(_0x52a160){if(_0x52a160){_0x2fd660=_0x52a160;_0x4bc1a6[_0x0710('0x38')]=_[_0x0710('0x32')](db[_0x0710('0x4f')][_0x0710('0x50')]);_0x4bc1a6['query']=_[_0x0710('0x32')](_0x3623a3[_0x0710('0x31')]);_0x4bc1a6[_0x0710('0x33')]=_[_0x0710('0x34')](_0x4bc1a6[_0x0710('0x38')],_0x4bc1a6[_0x0710('0x31')]);_0x180303[_0x0710('0x35')]=_['intersection'](_0x4bc1a6[_0x0710('0x38')],qs[_0x0710('0x36')](_0x3623a3[_0x0710('0x31')][_0x0710('0x36')]));_0x180303['attributes']=_0x180303[_0x0710('0x35')][_0x0710('0x37')]?_0x180303[_0x0710('0x35')]:_0x4bc1a6[_0x0710('0x38')];_0x180303[_0x0710('0x3b')]=qs[_0x0710('0x3c')](_0x3623a3[_0x0710('0x31')]['sort']);_0x180303['where']=qs[_0x0710('0x33')](_[_0x0710('0x51')](_0x3623a3[_0x0710('0x31')],_0x4bc1a6[_0x0710('0x33')]));if(_0x3623a3['query']['filter']){_0x180303[_0x0710('0x3d')]=_['merge'](_0x180303[_0x0710('0x3d')],{'$or':_[_0x0710('0x2d')](_0x180303[_0x0710('0x35')],function(_0x2729df){var _0x1de6e0={};_0x1de6e0[_0x2729df]={'$like':'%'+_0x3623a3[_0x0710('0x31')]['filter']+'%'};return _0x1de6e0;})});}_0x180303=_[_0x0710('0x3f')]({},_0x180303,_0x3623a3[_0x0710('0x41')]);return _0x2fd660['getSubjects'](_0x180303);}})[_0x0710('0x42')](function(_0x39869b){if(_0x39869b){_0x3250b6=_0x39869b['length'];if(!_0x3623a3[_0x0710('0x31')][_0x0710('0x39')]('nolimit')){_0x180303[_0x0710('0x3a')]=qs[_0x0710('0x3a')](_0x3623a3[_0x0710('0x31')]['limit']);_0x180303['offset']=qs[_0x0710('0x1e')](_0x3623a3[_0x0710('0x31')]['offset']);}return _0x2fd660[_0x0710('0x53')](_0x180303);}})[_0x0710('0x42')](function(_0x1d65be){if(_0x1d65be){return _0x1d65be?{'count':_0x3250b6,'rows':_0x1d65be}:null;}})[_0x0710('0x42')](respondWithResult(_0x557828,null))[_0x0710('0x4a')](handleError(_0x557828,null));};exports['getDescriptions']=function(_0x33d8e7,_0x3208c3,_0x5dcde7){var _0x219c6a={};var _0x588c37={};var _0x923d63;var _0x2bb02c;return db[_0x0710('0x2e')]['findOne']({'where':{'id':_0x33d8e7['params']['id']}})[_0x0710('0x42')](handleEntityNotFound(_0x3208c3,null))[_0x0710('0x42')](function(_0x423b35){if(_0x423b35){_0x923d63=_0x423b35;_0x588c37[_0x0710('0x38')]=_['keys'](db[_0x0710('0x4f')][_0x0710('0x50')]);_0x588c37['query']=_[_0x0710('0x32')](_0x33d8e7['query']);_0x588c37['filters']=_[_0x0710('0x34')](_0x588c37[_0x0710('0x38')],_0x588c37['query']);_0x219c6a[_0x0710('0x35')]=_[_0x0710('0x34')](_0x588c37['model'],qs[_0x0710('0x36')](_0x33d8e7[_0x0710('0x31')][_0x0710('0x36')]));_0x219c6a['attributes']=_0x219c6a['attributes'][_0x0710('0x37')]?_0x219c6a[_0x0710('0x35')]:_0x588c37[_0x0710('0x38')];_0x219c6a[_0x0710('0x3b')]=qs[_0x0710('0x3c')](_0x33d8e7[_0x0710('0x31')][_0x0710('0x3c')]);_0x219c6a[_0x0710('0x3d')]=qs[_0x0710('0x33')](_['pick'](_0x33d8e7[_0x0710('0x31')],_0x588c37[_0x0710('0x33')]));if(_0x33d8e7[_0x0710('0x31')]['filter']){_0x219c6a[_0x0710('0x3d')]=_[_0x0710('0x3f')](_0x219c6a[_0x0710('0x3d')],{'$or':_['map'](_0x219c6a['attributes'],function(_0x1ac2b9){var _0x7235b4={};_0x7235b4[_0x1ac2b9]={'$like':'%'+_0x33d8e7[_0x0710('0x31')][_0x0710('0x3e')]+'%'};return _0x7235b4;})});}_0x219c6a=_['merge']({},_0x219c6a,_0x33d8e7[_0x0710('0x41')]);return _0x923d63[_0x0710('0x54')](_0x219c6a);}})[_0x0710('0x42')](function(_0x3af40f){if(_0x3af40f){_0x2bb02c=_0x3af40f[_0x0710('0x37')];if(!_0x33d8e7['query'][_0x0710('0x39')](_0x0710('0x52'))){_0x219c6a[_0x0710('0x3a')]=qs[_0x0710('0x3a')](_0x33d8e7[_0x0710('0x31')][_0x0710('0x3a')]);_0x219c6a[_0x0710('0x1e')]=qs[_0x0710('0x1e')](_0x33d8e7['query'][_0x0710('0x1e')]);}return _0x923d63[_0x0710('0x54')](_0x219c6a);}})[_0x0710('0x42')](function(_0x3b3244){if(_0x3b3244){return _0x3b3244?{'count':_0x2bb02c,'rows':_0x3b3244}:null;}})[_0x0710('0x42')](respondWithResult(_0x3208c3,null))['catch'](handleError(_0x3208c3,null));}; \ No newline at end of file +var _0x52ff=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','include','findAll','show','includeAll','catch','create','body','find','params','getFields','findOne','ZohoField','filters','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf'];(function(_0x59e7ac,_0x89d52e){var _0x2e2024=function(_0x13245f){while(--_0x13245f){_0x59e7ac['push'](_0x59e7ac['shift']());}};_0x2e2024(++_0x89d52e);}(_0x52ff,0x9c));var _0xf52f=function(_0x2e319e,_0x99e002){_0x2e319e=_0x2e319e-0x0;var _0x3a5306=_0x52ff[_0x2e319e];return _0x3a5306;};'use strict';var emlformat=require(_0xf52f('0x0'));var rimraf=require(_0xf52f('0x1'));var zipdir=require(_0xf52f('0x2'));var jsonpatch=require(_0xf52f('0x3'));var rp=require('request-promise');var moment=require(_0xf52f('0x4'));var BPromise=require(_0xf52f('0x5'));var Mustache=require(_0xf52f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf52f('0x7'));var csv=require(_0xf52f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf52f('0x9'));var _=require(_0xf52f('0xa'));var squel=require(_0xf52f('0xb'));var crypto=require(_0xf52f('0xc'));var jsforce=require(_0xf52f('0xd'));var deskjs=require(_0xf52f('0xe'));var toCsv=require(_0xf52f('0x8'));var querystring=require(_0xf52f('0xf'));var Papa=require(_0xf52f('0x10'));var Redis=require(_0xf52f('0x11'));var authService=require(_0xf52f('0x12'));var qs=require(_0xf52f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf52f('0x14'));var utils=require(_0xf52f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf52f('0x16'));var db=require(_0xf52f('0x17'))['db'];function respondWithStatusCode(_0x2c1469,_0x4a839f){_0x4a839f=_0x4a839f||0xcc;return function(_0x4aff4e){if(_0x4aff4e){return _0x2c1469[_0xf52f('0x18')](_0x4a839f);}return _0x2c1469[_0xf52f('0x19')](_0x4a839f)[_0xf52f('0x1a')]();};}function respondWithResult(_0x4f0a78,_0x27d926){_0x27d926=_0x27d926||0xc8;return function(_0xaa6b25){if(_0xaa6b25){return _0x4f0a78['status'](_0x27d926)[_0xf52f('0x1b')](_0xaa6b25);}};}function respondWithFilteredResult(_0x5548fe,_0x569cab){return function(_0x5f3420){if(_0x5f3420){var _0x110288=typeof _0x569cab['offset']===_0xf52f('0x1c')&&typeof _0x569cab['limit']===_0xf52f('0x1c');var _0x1b5ba5=_0x5f3420[_0xf52f('0x1d')];var _0x10a935=_0x110288?0x0:_0x569cab[_0xf52f('0x1e')];var _0x766d1d=_0x110288?_0x5f3420['count']:_0x569cab['offset']+_0x569cab['limit'];var _0x354be1;if(_0x766d1d>=_0x1b5ba5){_0x766d1d=_0x1b5ba5;_0x354be1=0xc8;}else{_0x354be1=0xce;}_0x5548fe[_0xf52f('0x19')](_0x354be1);return _0x5548fe[_0xf52f('0x1f')](_0xf52f('0x20'),_0x10a935+'-'+_0x766d1d+'/'+_0x1b5ba5)[_0xf52f('0x1b')](_0x5f3420);}return null;};}function patchUpdates(_0x1dc918){return function(_0x1b224f){try{jsonpatch['apply'](_0x1b224f,_0x1dc918,!![]);}catch(_0x2331d2){return BPromise[_0xf52f('0x21')](_0x2331d2);}return _0x1b224f[_0xf52f('0x22')]();};}function saveUpdates(_0x8c6fc3,_0x22ff0d){return function(_0x47fb1c){if(_0x47fb1c){return _0x47fb1c[_0xf52f('0x23')](_0x8c6fc3)[_0xf52f('0x24')](function(_0x1869b3){return _0x1869b3;});}return null;};}function removeEntity(_0x5cbb3c,_0x215b22){return function(_0x3614ef){if(_0x3614ef){return _0x3614ef[_0xf52f('0x25')]()[_0xf52f('0x24')](function(){_0x5cbb3c[_0xf52f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b62d4,_0x371462){return function(_0x15d912){if(!_0x15d912){_0x1b62d4[_0xf52f('0x18')](0x194);}return _0x15d912;};}function handleError(_0x522073,_0x4dc1b8){_0x4dc1b8=_0x4dc1b8||0x1f4;return function(_0x50b924){logger[_0xf52f('0x26')](_0x50b924[_0xf52f('0x27')]);if(_0x50b924[_0xf52f('0x28')]){delete _0x50b924[_0xf52f('0x28')];}_0x522073['status'](_0x4dc1b8)['send'](_0x50b924);};}exports[_0xf52f('0x29')]=function(_0x2e7a44,_0x2a410b){var _0x5af102={},_0x50cb34={},_0x2c60c0={'count':0x0,'rows':[]};var _0xb8c36d=_[_0xf52f('0x2a')](db['ZohoConfiguration'][_0xf52f('0x2b')],function(_0x459451){return{'name':_0x459451[_0xf52f('0x2c')],'type':_0x459451['type']['key']};});_0x50cb34[_0xf52f('0x2d')]=_[_0xf52f('0x2a')](_0xb8c36d,_0xf52f('0x28'));_0x50cb34[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x2e7a44['query']);_0x50cb34['filters']=_[_0xf52f('0x30')](_0x50cb34[_0xf52f('0x2d')],_0x50cb34['query']);_0x5af102[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x50cb34['model'],qs[_0xf52f('0x32')](_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x5af102[_0xf52f('0x31')]=_0x5af102['attributes'][_0xf52f('0x33')]?_0x5af102['attributes']:_0x50cb34[_0xf52f('0x2d')];if(!_0x2e7a44['query']['hasOwnProperty'](_0xf52f('0x34'))){_0x5af102[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x2e7a44[_0xf52f('0x2e')]['limit']);_0x5af102[_0xf52f('0x1e')]=qs['offset'](_0x2e7a44['query'][_0xf52f('0x1e')]);}_0x5af102[_0xf52f('0x36')]=qs['sort'](_0x2e7a44['query'][_0xf52f('0x37')]);_0x5af102[_0xf52f('0x38')]=qs['filters'](_[_0xf52f('0x39')](_0x2e7a44[_0xf52f('0x2e')],_0x50cb34['filters']),_0xb8c36d);if(_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x5af102['where']=_['merge'](_0x5af102[_0xf52f('0x38')],{'$or':_[_0xf52f('0x2a')](_0xb8c36d,function(_0x398f8e){if(_0x398f8e['type']!==_0xf52f('0x3b')){var _0x4811cc={};_0x4811cc[_0x398f8e[_0xf52f('0x28')]]={'$like':'%'+_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x3a')]+'%'};return _0x4811cc;}})});}_0x5af102=_[_0xf52f('0x3c')]({},_0x5af102,_0x2e7a44[_0xf52f('0x3d')]);var _0x3f1255={'where':_0x5af102[_0xf52f('0x38')]};return db[_0xf52f('0x3e')]['count'](_0x3f1255)['then'](function(_0x3626a9){_0x2c60c0[_0xf52f('0x1d')]=_0x3626a9;if(_0x2e7a44[_0xf52f('0x2e')]['includeAll']){_0x5af102[_0xf52f('0x3f')]=[{'all':!![]}];}return db[_0xf52f('0x3e')][_0xf52f('0x40')](_0x5af102);})[_0xf52f('0x24')](function(_0x3cd794){_0x2c60c0['rows']=_0x3cd794;return _0x2c60c0;})[_0xf52f('0x24')](respondWithFilteredResult(_0x2a410b,_0x5af102))['catch'](handleError(_0x2a410b,null));};exports[_0xf52f('0x41')]=function(_0x4c4527,_0x33ff08){var _0xff7c08={'raw':![],'where':{'id':_0x4c4527['params']['id']}},_0x1d513e={};_0x1d513e[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x3e')]['rawAttributes']);_0x1d513e[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x4c4527['query']);_0x1d513e['filters']=_[_0xf52f('0x30')](_0x1d513e[_0xf52f('0x2d')],_0x1d513e[_0xf52f('0x2e')]);_0xff7c08[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x1d513e['model'],qs[_0xf52f('0x32')](_0x4c4527[_0xf52f('0x2e')][_0xf52f('0x32')]));_0xff7c08['attributes']=_0xff7c08['attributes'][_0xf52f('0x33')]?_0xff7c08['attributes']:_0x1d513e[_0xf52f('0x2d')];if(_0x4c4527[_0xf52f('0x2e')][_0xf52f('0x42')]){_0xff7c08[_0xf52f('0x3f')]=[{'all':!![]}];}_0xff7c08=_[_0xf52f('0x3c')]({},_0xff7c08,_0x4c4527[_0xf52f('0x3d')]);return db['ZohoConfiguration']['find'](_0xff7c08)[_0xf52f('0x24')](handleEntityNotFound(_0x33ff08,null))[_0xf52f('0x24')](respondWithResult(_0x33ff08,null))[_0xf52f('0x43')](handleError(_0x33ff08,null));};exports[_0xf52f('0x44')]=function(_0x4da3d2,_0x2ded8f){return db[_0xf52f('0x3e')][_0xf52f('0x44')](_0x4da3d2[_0xf52f('0x45')],{})[_0xf52f('0x24')](respondWithResult(_0x2ded8f,0xc9))['catch'](handleError(_0x2ded8f,null));};exports[_0xf52f('0x23')]=function(_0x44f4b9,_0x1bf1a5){if(_0x44f4b9[_0xf52f('0x45')]['id']){delete _0x44f4b9['body']['id'];}return db[_0xf52f('0x3e')][_0xf52f('0x46')]({'where':{'id':_0x44f4b9[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x1bf1a5,null))[_0xf52f('0x24')](saveUpdates(_0x44f4b9[_0xf52f('0x45')],null))['then'](respondWithResult(_0x1bf1a5,null))[_0xf52f('0x43')](handleError(_0x1bf1a5,null));};exports[_0xf52f('0x25')]=function(_0x29e875,_0x13adf6){return db[_0xf52f('0x3e')][_0xf52f('0x46')]({'where':{'id':_0x29e875['params']['id']}})['then'](handleEntityNotFound(_0x13adf6,null))[_0xf52f('0x24')](removeEntity(_0x13adf6,null))[_0xf52f('0x43')](handleError(_0x13adf6,null));};exports[_0xf52f('0x48')]=function(_0x4bc7eb,_0x5b1275,_0x521641){var _0x4fdbac={};var _0x324cdf={};var _0x36b7c8;var _0x4a5bac;return db[_0xf52f('0x3e')][_0xf52f('0x49')]({'where':{'id':_0x4bc7eb[_0xf52f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b1275,null))[_0xf52f('0x24')](function(_0x5a48e6){if(_0x5a48e6){_0x36b7c8=_0x5a48e6;_0x324cdf[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x4a')][_0xf52f('0x2b')]);_0x324cdf[_0xf52f('0x2e')]=_['keys'](_0x4bc7eb[_0xf52f('0x2e')]);_0x324cdf[_0xf52f('0x4b')]=_[_0xf52f('0x30')](_0x324cdf['model'],_0x324cdf[_0xf52f('0x2e')]);_0x4fdbac['attributes']=_['intersection'](_0x324cdf[_0xf52f('0x2d')],qs['fields'](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x4fdbac[_0xf52f('0x31')]=_0x4fdbac['attributes']['length']?_0x4fdbac['attributes']:_0x324cdf[_0xf52f('0x2d')];_0x4fdbac['order']=qs['sort'](_0x4bc7eb[_0xf52f('0x2e')]['sort']);_0x4fdbac[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x4bc7eb[_0xf52f('0x2e')],_0x324cdf[_0xf52f('0x4b')]));if(_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x4fdbac['where']=_[_0xf52f('0x3c')](_0x4fdbac['where'],{'$or':_['map'](_0x4fdbac[_0xf52f('0x31')],function(_0x4d854c){var _0x1acd49={};_0x1acd49[_0x4d854c]={'$like':'%'+_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x3a')]+'%'};return _0x1acd49;})});}_0x4fdbac=_[_0xf52f('0x3c')]({},_0x4fdbac,_0x4bc7eb[_0xf52f('0x3d')]);return _0x36b7c8[_0xf52f('0x48')](_0x4fdbac);}})['then'](function(_0x42be12){if(_0x42be12){_0x4a5bac=_0x42be12[_0xf52f('0x33')];if(!_0x4bc7eb[_0xf52f('0x2e')]['hasOwnProperty'](_0xf52f('0x34'))){_0x4fdbac[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x35')]);_0x4fdbac[_0xf52f('0x1e')]=qs[_0xf52f('0x1e')](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x36b7c8[_0xf52f('0x48')](_0x4fdbac);}})['then'](function(_0x319caf){if(_0x319caf){return _0x319caf?{'count':_0x4a5bac,'rows':_0x319caf}:null;}})['then'](respondWithResult(_0x5b1275,null))[_0xf52f('0x43')](handleError(_0x5b1275,null));};exports['getSubjects']=function(_0x2b5c53,_0x506a00,_0x561a76){var _0x5431bc={};var _0xc763c9={};var _0x4d7de1;var _0x2fd9cd;return db[_0xf52f('0x3e')][_0xf52f('0x49')]({'where':{'id':_0x2b5c53[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x506a00,null))['then'](function(_0x114c36){if(_0x114c36){_0x4d7de1=_0x114c36;_0xc763c9[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x4a')][_0xf52f('0x2b')]);_0xc763c9[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x2b5c53[_0xf52f('0x2e')]);_0xc763c9[_0xf52f('0x4b')]=_[_0xf52f('0x30')](_0xc763c9['model'],_0xc763c9[_0xf52f('0x2e')]);_0x5431bc['attributes']=_[_0xf52f('0x30')](_0xc763c9[_0xf52f('0x2d')],qs[_0xf52f('0x32')](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x5431bc[_0xf52f('0x31')]=_0x5431bc[_0xf52f('0x31')][_0xf52f('0x33')]?_0x5431bc[_0xf52f('0x31')]:_0xc763c9[_0xf52f('0x2d')];_0x5431bc['order']=qs['sort'](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x37')]);_0x5431bc[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x2b5c53[_0xf52f('0x2e')],_0xc763c9[_0xf52f('0x4b')]));if(_0x2b5c53['query']['filter']){_0x5431bc['where']=_[_0xf52f('0x3c')](_0x5431bc[_0xf52f('0x38')],{'$or':_[_0xf52f('0x2a')](_0x5431bc['attributes'],function(_0x354917){var _0x2b49bd={};_0x2b49bd[_0x354917]={'$like':'%'+_0x2b5c53[_0xf52f('0x2e')]['filter']+'%'};return _0x2b49bd;})});}_0x5431bc=_[_0xf52f('0x3c')]({},_0x5431bc,_0x2b5c53['options']);return _0x4d7de1[_0xf52f('0x4c')](_0x5431bc);}})[_0xf52f('0x24')](function(_0x4a9847){if(_0x4a9847){_0x2fd9cd=_0x4a9847[_0xf52f('0x33')];if(!_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x4d')](_0xf52f('0x34'))){_0x5431bc[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x2b5c53[_0xf52f('0x2e')]['limit']);_0x5431bc['offset']=qs[_0xf52f('0x1e')](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x4d7de1[_0xf52f('0x4c')](_0x5431bc);}})[_0xf52f('0x24')](function(_0x1d2a2b){if(_0x1d2a2b){return _0x1d2a2b?{'count':_0x2fd9cd,'rows':_0x1d2a2b}:null;}})[_0xf52f('0x24')](respondWithResult(_0x506a00,null))[_0xf52f('0x43')](handleError(_0x506a00,null));};exports[_0xf52f('0x4e')]=function(_0x53a3e1,_0x39628f,_0x167303){var _0x37b633={};var _0x509e36={};var _0x3fa68d;var _0xe119f5;return db[_0xf52f('0x3e')]['findOne']({'where':{'id':_0x53a3e1[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x39628f,null))[_0xf52f('0x24')](function(_0x41c69b){if(_0x41c69b){_0x3fa68d=_0x41c69b;_0x509e36['model']=_[_0xf52f('0x2f')](db['ZohoField'][_0xf52f('0x2b')]);_0x509e36[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x53a3e1['query']);_0x509e36['filters']=_['intersection'](_0x509e36[_0xf52f('0x2d')],_0x509e36[_0xf52f('0x2e')]);_0x37b633[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x509e36[_0xf52f('0x2d')],qs[_0xf52f('0x32')](_0x53a3e1['query']['fields']));_0x37b633['attributes']=_0x37b633[_0xf52f('0x31')][_0xf52f('0x33')]?_0x37b633[_0xf52f('0x31')]:_0x509e36['model'];_0x37b633[_0xf52f('0x36')]=qs['sort'](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x37')]);_0x37b633[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x53a3e1[_0xf52f('0x2e')],_0x509e36[_0xf52f('0x4b')]));if(_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x37b633[_0xf52f('0x38')]=_[_0xf52f('0x3c')](_0x37b633['where'],{'$or':_[_0xf52f('0x2a')](_0x37b633[_0xf52f('0x31')],function(_0x2e1ae5){var _0x404aa8={};_0x404aa8[_0x2e1ae5]={'$like':'%'+_0x53a3e1[_0xf52f('0x2e')]['filter']+'%'};return _0x404aa8;})});}_0x37b633=_[_0xf52f('0x3c')]({},_0x37b633,_0x53a3e1[_0xf52f('0x3d')]);return _0x3fa68d['getDescriptions'](_0x37b633);}})['then'](function(_0x314878){if(_0x314878){_0xe119f5=_0x314878[_0xf52f('0x33')];if(!_0x53a3e1['query'][_0xf52f('0x4d')](_0xf52f('0x34'))){_0x37b633[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x35')]);_0x37b633['offset']=qs[_0xf52f('0x1e')](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x3fa68d['getDescriptions'](_0x37b633);}})[_0xf52f('0x24')](function(_0x3070b8){if(_0x3070b8){return _0x3070b8?{'count':_0xe119f5,'rows':_0x3070b8}:null;}})[_0xf52f('0x24')](respondWithResult(_0x39628f,null))[_0xf52f('0x43')](handleError(_0x39628f,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6d5ac70..09c9f28 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 _0xa97c=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','lodash','api','moment','bluebird'];(function(_0x3989fa,_0x27f494){var _0x27dd87=function(_0xf73c60){while(--_0xf73c60){_0x3989fa['push'](_0x3989fa['shift']());}};_0x27dd87(++_0x27f494);}(_0xa97c,0x1a9));var _0xca97=function(_0x5f13e2,_0x59a170){_0x5f13e2=_0x5f13e2-0x0;var _0x45df03=_0xa97c[_0x5f13e2];return _0x45df03;};'use strict';var _=require(_0xca97('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xca97('0x1'));var moment=require(_0xca97('0x2'));var BPromise=require(_0xca97('0x3'));var rp=require(_0xca97('0x4'));var fs=require('fs');var path=require(_0xca97('0x5'));var rimraf=require(_0xca97('0x6'));var config=require(_0xca97('0x7'));var attributes=require(_0xca97('0x8'));module['exports']=function(_0x4845b7,_0x264de9){return _0x4845b7[_0xca97('0x9')]('ZohoConfiguration',attributes,{'tableName':_0xca97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa239=['ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x47d18a,_0xd53074){var _0x130c43=function(_0x380f11){while(--_0x380f11){_0x47d18a['push'](_0x47d18a['shift']());}};_0x130c43(++_0xd53074);}(_0xa239,0x98));var _0x9a23=function(_0xaa6f53,_0x10e28b){_0xaa6f53=_0xaa6f53-0x0;var _0x56188b=_0xa239[_0xaa6f53];return _0x56188b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a23('0x0'))(_0x9a23('0x1'));var moment=require(_0x9a23('0x2'));var BPromise=require(_0x9a23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a23('0x4'));var rimraf=require(_0x9a23('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x9a23('0x6')]=function(_0x3c5149,_0x2511f4){return _0x3c5149[_0x9a23('0x7')](_0x9a23('0x8'),attributes,{'tableName':_0x9a23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 18838c6..bdfb9bd 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 _0xdc6f=['message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xd2a831,_0x3ab934){var _0x1a5a57=function(_0x437c0b){while(--_0x437c0b){_0xd2a831['push'](_0xd2a831['shift']());}};_0x1a5a57(++_0x3ab934);}(_0xdc6f,0x129));var _0xfdc6=function(_0x50120a,_0x16f80e){_0x50120a=_0x50120a-0x0;var _0x4f60f9=_0xdc6f[_0x50120a];return _0x4f60f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfdc6('0x0'));var BPromise=require('bluebird');var rs=require(_0xfdc6('0x1'));var fs=require('fs');var Redis=require(_0xfdc6('0x2'));var db=require(_0xfdc6('0x3'))['db'];var utils=require(_0xfdc6('0x4'));var logger=require(_0xfdc6('0x5'))(_0xfdc6('0x6'));var config=require(_0xfdc6('0x7'));var jayson=require(_0xfdc6('0x8'));var client=jayson[_0xfdc6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d3c96,_0x3752c5,_0x24a51e){return new BPromise(function(_0x46d241,_0x386660){return client['request'](_0x2d3c96,_0x24a51e)[_0xfdc6('0xa')](function(_0x63ebec){logger[_0xfdc6('0xb')](_0xfdc6('0xc'),_0x3752c5,_0xfdc6('0xd'));logger[_0xfdc6('0xe')](_0xfdc6('0xf'),_0x3752c5,_0xfdc6('0xd'),JSON['stringify'](_0x63ebec));if(_0x63ebec['error']){if(_0x63ebec[_0xfdc6('0x10')][_0xfdc6('0x11')]===0x1f4){logger[_0xfdc6('0x10')](_0xfdc6('0xc'),_0x3752c5,_0x63ebec[_0xfdc6('0x10')][_0xfdc6('0x12')]);return _0x386660(_0x63ebec['error'][_0xfdc6('0x12')]);}logger[_0xfdc6('0x10')](_0xfdc6('0xc'),_0x3752c5,_0x63ebec['error'][_0xfdc6('0x12')]);return _0x46d241(_0x63ebec[_0xfdc6('0x10')][_0xfdc6('0x12')]);}else{logger[_0xfdc6('0xb')](_0xfdc6('0xc'),_0x3752c5,_0xfdc6('0xd'));_0x46d241(_0x63ebec[_0xfdc6('0x13')]['message']);}})[_0xfdc6('0x14')](function(_0x11b8dd){logger[_0xfdc6('0x10')](_0xfdc6('0xc'),_0x3752c5,_0x11b8dd);_0x386660(_0x11b8dd);});});} \ No newline at end of file +var _0xd561=['then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xd561,0x78));var _0x1d56=function(_0x2ad8fa,_0x43bbd0){_0x2ad8fa=_0x2ad8fa-0x0;var _0x51e2d5=_0xd561[_0x2ad8fa];return _0x51e2d5;};'use strict';var _=require(_0x1d56('0x0'));var util=require(_0x1d56('0x1'));var moment=require(_0x1d56('0x2'));var BPromise=require(_0x1d56('0x3'));var rs=require(_0x1d56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d56('0x6'))(_0x1d56('0x7'));var config=require(_0x1d56('0x8'));var jayson=require(_0x1d56('0x9'));var client=jayson[_0x1d56('0xa')][_0x1d56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25fa90,_0xc4a580,_0x32ebef){return new BPromise(function(_0x59ebd7,_0x3cee41){return client[_0x1d56('0xc')](_0x25fa90,_0x32ebef)[_0x1d56('0xd')](function(_0x35ef40){logger['info'](_0x1d56('0xe'),_0xc4a580,_0x1d56('0xf'));logger['debug'](_0x1d56('0x10'),_0xc4a580,_0x1d56('0xf'),JSON['stringify'](_0x35ef40));if(_0x35ef40[_0x1d56('0x11')]){if(_0x35ef40[_0x1d56('0x11')]['code']===0x1f4){logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x35ef40[_0x1d56('0x11')][_0x1d56('0x12')]);return _0x3cee41(_0x35ef40[_0x1d56('0x11')]['message']);}logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x35ef40['error'][_0x1d56('0x12')]);return _0x59ebd7(_0x35ef40['error'][_0x1d56('0x12')]);}else{logger['info'](_0x1d56('0xe'),_0xc4a580,_0x1d56('0xf'));_0x59ebd7(_0x35ef40['result']['message']);}})['catch'](function(_0x8e1f4b){logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x8e1f4b);_0x3cee41(_0x8e1f4b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index ba6032f..cb4294a 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 _0x1b73=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1b73,0x13f));var _0x31b7=function(_0x562430,_0x4207f2){_0x562430=_0x562430-0x0;var _0x37de6a=_0x1b73[_0x562430];return _0x37de6a;};'use strict';var multer=require(_0x31b7('0x0'));var util=require(_0x31b7('0x1'));var path=require(_0x31b7('0x2'));var timeout=require(_0x31b7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x31b7('0x4'));var auth=require(_0x31b7('0x5'));var interaction=require(_0x31b7('0x6'));var config=require(_0x31b7('0x7'));var controller=require(_0x31b7('0x8'));router['get']('/',auth[_0x31b7('0x9')](),controller[_0x31b7('0xa')]);router[_0x31b7('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x31b7('0xc')]('/',auth[_0x31b7('0x9')](),controller[_0x31b7('0xd')]);router[_0x31b7('0xe')](_0x31b7('0xf'),auth[_0x31b7('0x9')](),controller['update']);router['delete'](_0x31b7('0xf'),auth[_0x31b7('0x9')](),controller[_0x31b7('0x10')]);module[_0x31b7('0x11')]=router; \ No newline at end of file +var _0x001d=['update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1863de,_0x345a8e){var _0x1d4941=function(_0x344dd5){while(--_0x344dd5){_0x1863de['push'](_0x1863de['shift']());}};_0x1d4941(++_0x345a8e);}(_0x001d,0x1df));var _0xd001=function(_0xdcefae,_0xa7067d){_0xdcefae=_0xdcefae-0x0;var _0x22c4b1=_0x001d[_0xdcefae];return _0x22c4b1;};'use strict';var multer=require(_0xd001('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd001('0x1'));var express=require(_0xd001('0x2'));var router=express['Router']();var fs_extra=require(_0xd001('0x3'));var auth=require(_0xd001('0x4'));var interaction=require(_0xd001('0x5'));var config=require(_0xd001('0x6'));var controller=require(_0xd001('0x7'));router[_0xd001('0x8')]('/',auth[_0xd001('0x9')](),controller[_0xd001('0xa')]);router[_0xd001('0x8')](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0xc')]);router[_0xd001('0xd')]('/',auth[_0xd001('0x9')](),controller[_0xd001('0xe')]);router['put'](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0xf')]);router[_0xd001('0x10')](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0x11')]);module[_0xd001('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7f873e8..7a5d9a9 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 _0xfa71=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x44c7a8,_0x3bafc0){var _0x36595f=function(_0xa6cf85){while(--_0xa6cf85){_0x44c7a8['push'](_0x44c7a8['shift']());}};_0x36595f(++_0x3bafc0);}(_0xfa71,0x75));var _0x1fa7=function(_0x34204b,_0x3f91e9){_0x34204b=_0x34204b-0x0;var _0x24e995=_0xfa71[_0x34204b];return _0x24e995;};'use strict';var Sequelize=require(_0x1fa7('0x0'));module[_0x1fa7('0x1')]={'type':{'type':Sequelize[_0x1fa7('0x2')](_0x1fa7('0x3'),_0x1fa7('0x4'),_0x1fa7('0x5'),_0x1fa7('0x6'),_0x1fa7('0x7')),'defaultValue':_0x1fa7('0x3')},'content':{'type':Sequelize[_0x1fa7('0x8')]},'key':{'type':Sequelize[_0x1fa7('0x8')]},'keyType':{'type':Sequelize[_0x1fa7('0x2')](_0x1fa7('0x3'),_0x1fa7('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x1fa7('0x8')]},'idField':{'type':Sequelize[_0x1fa7('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1fa7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc11a=['customVariable','keyValue','picklist','STRING','ENUM','variable','exports','string'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0xc11a,0x106));var _0xac11=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xc11a[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require('sequelize');module[_0xac11('0x0')]={'type':{'type':Sequelize['ENUM'](_0xac11('0x1'),'variable',_0xac11('0x2'),_0xac11('0x3'),_0xac11('0x4')),'defaultValue':_0xac11('0x1')},'content':{'type':Sequelize[_0xac11('0x5')]},'key':{'type':Sequelize[_0xac11('0x5')]},'keyType':{'type':Sequelize[_0xac11('0x6')](_0xac11('0x1'),_0xac11('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xac11('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xac11('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 567afd3..52c15c2 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 _0x96bf=['mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','error','name','send','map','ZohoField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','length','find','create','body','update','rimraf','fast-json-patch','moment'];(function(_0x275851,_0x2542a8){var _0x318b2a=function(_0xe46e2a){while(--_0xe46e2a){_0x275851['push'](_0x275851['shift']());}};_0x318b2a(++_0x2542a8);}(_0x96bf,0x8d));var _0xf96b=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x96bf[_0x5f4cd7];return _0x47c93f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf96b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf96b('0x1'));var rp=require('request-promise');var moment=require(_0xf96b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf96b('0x3'));var util=require('util');var path=require(_0xf96b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf96b('0x5'));var fs=require('fs');var fs_extra=require(_0xf96b('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf96b('0x7'));var jsforce=require(_0xf96b('0x8'));var deskjs=require(_0xf96b('0x9'));var toCsv=require(_0xf96b('0xa'));var querystring=require(_0xf96b('0xb'));var Papa=require(_0xf96b('0xc'));var Redis=require(_0xf96b('0xd'));var authService=require(_0xf96b('0xe'));var qs=require(_0xf96b('0xf'));var as=require(_0xf96b('0x10'));var hardwareService=require(_0xf96b('0x11'));var logger=require('../../config/logger')(_0xf96b('0x12'));var utils=require(_0xf96b('0x13'));var config=require(_0xf96b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf96b('0x15'))['db'];function respondWithStatusCode(_0x348b1d,_0x47df04){_0x47df04=_0x47df04||0xcc;return function(_0xecc75a){if(_0xecc75a){return _0x348b1d[_0xf96b('0x16')](_0x47df04);}return _0x348b1d['status'](_0x47df04)[_0xf96b('0x17')]();};}function respondWithResult(_0x5bd4a6,_0x4261ec){_0x4261ec=_0x4261ec||0xc8;return function(_0x522c44){if(_0x522c44){return _0x5bd4a6[_0xf96b('0x18')](_0x4261ec)[_0xf96b('0x19')](_0x522c44);}};}function respondWithFilteredResult(_0x54ca6a,_0x1c0f3a){return function(_0x522dd8){if(_0x522dd8){var _0x13fb13=typeof _0x1c0f3a['offset']===_0xf96b('0x1a')&&typeof _0x1c0f3a[_0xf96b('0x1b')]===_0xf96b('0x1a');var _0x543b8a=_0x522dd8[_0xf96b('0x1c')];var _0xc973bb=_0x13fb13?0x0:_0x1c0f3a[_0xf96b('0x1d')];var _0x328708=_0x13fb13?_0x522dd8[_0xf96b('0x1c')]:_0x1c0f3a[_0xf96b('0x1d')]+_0x1c0f3a['limit'];var _0x51d581;if(_0x328708>=_0x543b8a){_0x328708=_0x543b8a;_0x51d581=0xc8;}else{_0x51d581=0xce;}_0x54ca6a['status'](_0x51d581);return _0x54ca6a[_0xf96b('0x1e')](_0xf96b('0x1f'),_0xc973bb+'-'+_0x328708+'/'+_0x543b8a)['json'](_0x522dd8);}return null;};}function patchUpdates(_0x52ab93){return function(_0x5b61a7){try{jsonpatch[_0xf96b('0x20')](_0x5b61a7,_0x52ab93,!![]);}catch(_0x5073ef){return BPromise[_0xf96b('0x21')](_0x5073ef);}return _0x5b61a7[_0xf96b('0x22')]();};}function saveUpdates(_0x548b78,_0x33873f){return function(_0x1918b1){if(_0x1918b1){return _0x1918b1['update'](_0x548b78)['then'](function(_0x3638d4){return _0x3638d4;});}return null;};}function removeEntity(_0xfca530,_0x2c106d){return function(_0x120edb){if(_0x120edb){return _0x120edb[_0xf96b('0x23')]()['then'](function(){_0xfca530[_0xf96b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c6e1b,_0x2eebc9){return function(_0x27c49a){if(!_0x27c49a){_0x5c6e1b[_0xf96b('0x16')](0x194);}return _0x27c49a;};}function handleError(_0x565e12,_0x5b7051){_0x5b7051=_0x5b7051||0x1f4;return function(_0x1574d3){logger[_0xf96b('0x24')](_0x1574d3['stack']);if(_0x1574d3[_0xf96b('0x25')]){delete _0x1574d3['name'];}_0x565e12[_0xf96b('0x18')](_0x5b7051)[_0xf96b('0x26')](_0x1574d3);};}exports['index']=function(_0x4fb9ae,_0x8f75cb){var _0x41ddeb={},_0x3eadf2={},_0x4bc612={'count':0x0,'rows':[]};var _0xffb7d6=_[_0xf96b('0x27')](db[_0xf96b('0x28')][_0xf96b('0x29')],function(_0x155dd1){return{'name':_0x155dd1['fieldName'],'type':_0x155dd1['type'][_0xf96b('0x2a')]};});_0x3eadf2[_0xf96b('0x2b')]=_[_0xf96b('0x27')](_0xffb7d6,_0xf96b('0x25'));_0x3eadf2[_0xf96b('0x2c')]=_[_0xf96b('0x2d')](_0x4fb9ae[_0xf96b('0x2c')]);_0x3eadf2[_0xf96b('0x2e')]=_[_0xf96b('0x2f')](_0x3eadf2['model'],_0x3eadf2['query']);_0x41ddeb[_0xf96b('0x30')]=_[_0xf96b('0x2f')](_0x3eadf2[_0xf96b('0x2b')],qs[_0xf96b('0x31')](_0x4fb9ae[_0xf96b('0x2c')]['fields']));_0x41ddeb['attributes']=_0x41ddeb['attributes']['length']?_0x41ddeb[_0xf96b('0x30')]:_0x3eadf2[_0xf96b('0x2b')];if(!_0x4fb9ae[_0xf96b('0x2c')][_0xf96b('0x32')](_0xf96b('0x33'))){_0x41ddeb[_0xf96b('0x1b')]=qs['limit'](_0x4fb9ae[_0xf96b('0x2c')][_0xf96b('0x1b')]);_0x41ddeb[_0xf96b('0x1d')]=qs['offset'](_0x4fb9ae[_0xf96b('0x2c')]['offset']);}_0x41ddeb[_0xf96b('0x34')]=qs[_0xf96b('0x35')](_0x4fb9ae[_0xf96b('0x2c')]['sort']);_0x41ddeb[_0xf96b('0x36')]=qs[_0xf96b('0x2e')](_['pick'](_0x4fb9ae['query'],_0x3eadf2[_0xf96b('0x2e')]),_0xffb7d6);if(_0x4fb9ae[_0xf96b('0x2c')][_0xf96b('0x37')]){_0x41ddeb[_0xf96b('0x36')]=_[_0xf96b('0x38')](_0x41ddeb[_0xf96b('0x36')],{'$or':_[_0xf96b('0x27')](_0xffb7d6,function(_0x15fd52){if(_0x15fd52[_0xf96b('0x39')]!==_0xf96b('0x3a')){var _0x4aa5b6={};_0x4aa5b6[_0x15fd52[_0xf96b('0x25')]]={'$like':'%'+_0x4fb9ae[_0xf96b('0x2c')][_0xf96b('0x37')]+'%'};return _0x4aa5b6;}})});}_0x41ddeb=_['merge']({},_0x41ddeb,_0x4fb9ae[_0xf96b('0x3b')]);var _0xe11b12={'where':_0x41ddeb[_0xf96b('0x36')]};return db[_0xf96b('0x28')][_0xf96b('0x1c')](_0xe11b12)[_0xf96b('0x3c')](function(_0x1903c2){_0x4bc612[_0xf96b('0x1c')]=_0x1903c2;if(_0x4fb9ae[_0xf96b('0x2c')][_0xf96b('0x3d')]){_0x41ddeb[_0xf96b('0x3e')]=[{'all':!![]}];}return db[_0xf96b('0x28')][_0xf96b('0x3f')](_0x41ddeb);})[_0xf96b('0x3c')](function(_0x45304c){_0x4bc612['rows']=_0x45304c;return _0x4bc612;})[_0xf96b('0x3c')](respondWithFilteredResult(_0x8f75cb,_0x41ddeb))[_0xf96b('0x40')](handleError(_0x8f75cb,null));};exports[_0xf96b('0x41')]=function(_0x333496,_0x2eb1ec){var _0xf04da9={'raw':!![],'where':{'id':_0x333496[_0xf96b('0x42')]['id']}},_0x324dbf={};_0x324dbf[_0xf96b('0x2b')]=_[_0xf96b('0x2d')](db['ZohoField'][_0xf96b('0x29')]);_0x324dbf['query']=_['keys'](_0x333496['query']);_0x324dbf[_0xf96b('0x2e')]=_[_0xf96b('0x2f')](_0x324dbf['model'],_0x324dbf[_0xf96b('0x2c')]);_0xf04da9[_0xf96b('0x30')]=_[_0xf96b('0x2f')](_0x324dbf[_0xf96b('0x2b')],qs[_0xf96b('0x31')](_0x333496[_0xf96b('0x2c')]['fields']));_0xf04da9[_0xf96b('0x30')]=_0xf04da9[_0xf96b('0x30')][_0xf96b('0x43')]?_0xf04da9[_0xf96b('0x30')]:_0x324dbf[_0xf96b('0x2b')];if(_0x333496[_0xf96b('0x2c')][_0xf96b('0x3d')]){_0xf04da9['include']=[{'all':!![]}];}_0xf04da9=_[_0xf96b('0x38')]({},_0xf04da9,_0x333496['options']);return db[_0xf96b('0x28')][_0xf96b('0x44')](_0xf04da9)[_0xf96b('0x3c')](handleEntityNotFound(_0x2eb1ec,null))[_0xf96b('0x3c')](respondWithResult(_0x2eb1ec,null))[_0xf96b('0x40')](handleError(_0x2eb1ec,null));};exports[_0xf96b('0x45')]=function(_0x15ad78,_0x223390){return db[_0xf96b('0x28')]['create'](_0x15ad78[_0xf96b('0x46')],{})[_0xf96b('0x3c')](respondWithResult(_0x223390,0xc9))[_0xf96b('0x40')](handleError(_0x223390,null));};exports[_0xf96b('0x47')]=function(_0x25b34a,_0x47dfde){if(_0x25b34a[_0xf96b('0x46')]['id']){delete _0x25b34a['body']['id'];}return db['ZohoField'][_0xf96b('0x44')]({'where':{'id':_0x25b34a[_0xf96b('0x42')]['id']}})[_0xf96b('0x3c')](handleEntityNotFound(_0x47dfde,null))[_0xf96b('0x3c')](saveUpdates(_0x25b34a[_0xf96b('0x46')],null))[_0xf96b('0x3c')](respondWithResult(_0x47dfde,null))[_0xf96b('0x40')](handleError(_0x47dfde,null));};exports['destroy']=function(_0x29a502,_0x2c56b7){return db[_0xf96b('0x28')][_0xf96b('0x44')]({'where':{'id':_0x29a502[_0xf96b('0x42')]['id']}})[_0xf96b('0x3c')](handleEntityNotFound(_0x2c56b7,null))[_0xf96b('0x3c')](removeEntity(_0x2c56b7,null))[_0xf96b('0x40')](handleError(_0x2c56b7,null));}; \ No newline at end of file +var _0xa5a4=['merge','VIRTUAL','filter','options','ZohoField','includeAll','findAll','rows','catch','show','keys','rawAttributes','intersection','include','find','create','body','update','params','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','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xa5a4[_0x3305de];return _0x3b5a84;};'use strict';var emlformat=require(_0x4a5a('0x0'));var rimraf=require(_0x4a5a('0x1'));var zipdir=require(_0x4a5a('0x2'));var jsonpatch=require(_0x4a5a('0x3'));var rp=require(_0x4a5a('0x4'));var moment=require(_0x4a5a('0x5'));var BPromise=require(_0x4a5a('0x6'));var Mustache=require(_0x4a5a('0x7'));var util=require(_0x4a5a('0x8'));var path=require(_0x4a5a('0x9'));var sox=require(_0x4a5a('0xa'));var csv=require(_0x4a5a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a5a('0xc'));var _=require(_0x4a5a('0xd'));var squel=require(_0x4a5a('0xe'));var crypto=require(_0x4a5a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4a5a('0x10'));var toCsv=require(_0x4a5a('0xb'));var querystring=require(_0x4a5a('0x11'));var Papa=require('papaparse');var Redis=require(_0x4a5a('0x12'));var authService=require(_0x4a5a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a5a('0x14'));var logger=require('../../config/logger')(_0x4a5a('0x15'));var utils=require('../../config/utils');var config=require(_0x4a5a('0x16'));var licenseUtil=require(_0x4a5a('0x17'));var db=require(_0x4a5a('0x18'))['db'];function respondWithStatusCode(_0x2b2ca3,_0x4f5d05){_0x4f5d05=_0x4f5d05||0xcc;return function(_0x42af3e){if(_0x42af3e){return _0x2b2ca3[_0x4a5a('0x19')](_0x4f5d05);}return _0x2b2ca3['status'](_0x4f5d05)[_0x4a5a('0x1a')]();};}function respondWithResult(_0x25c659,_0x468892){_0x468892=_0x468892||0xc8;return function(_0x431075){if(_0x431075){return _0x25c659[_0x4a5a('0x1b')](_0x468892)[_0x4a5a('0x1c')](_0x431075);}};}function respondWithFilteredResult(_0x30f2b5,_0x3389a4){return function(_0x14f1ec){if(_0x14f1ec){var _0x4728e2=typeof _0x3389a4[_0x4a5a('0x1d')]==='undefined'&&typeof _0x3389a4[_0x4a5a('0x1e')]==='undefined';var _0x7f46ca=_0x14f1ec[_0x4a5a('0x1f')];var _0x4c2fa2=_0x4728e2?0x0:_0x3389a4['offset'];var _0x59b54c=_0x4728e2?_0x14f1ec['count']:_0x3389a4['offset']+_0x3389a4['limit'];var _0x38661e;if(_0x59b54c>=_0x7f46ca){_0x59b54c=_0x7f46ca;_0x38661e=0xc8;}else{_0x38661e=0xce;}_0x30f2b5[_0x4a5a('0x1b')](_0x38661e);return _0x30f2b5['set'](_0x4a5a('0x20'),_0x4c2fa2+'-'+_0x59b54c+'/'+_0x7f46ca)[_0x4a5a('0x1c')](_0x14f1ec);}return null;};}function patchUpdates(_0x5be26f){return function(_0x49ce9f){try{jsonpatch[_0x4a5a('0x21')](_0x49ce9f,_0x5be26f,!![]);}catch(_0x325eff){return BPromise[_0x4a5a('0x22')](_0x325eff);}return _0x49ce9f[_0x4a5a('0x23')]();};}function saveUpdates(_0x2f985c,_0x48da08){return function(_0x54a79c){if(_0x54a79c){return _0x54a79c['update'](_0x2f985c)[_0x4a5a('0x24')](function(_0x10df82){return _0x10df82;});}return null;};}function removeEntity(_0x17b0fc,_0x445e62){return function(_0x3d1973){if(_0x3d1973){return _0x3d1973[_0x4a5a('0x25')]()[_0x4a5a('0x24')](function(){_0x17b0fc[_0x4a5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17fc46,_0xa935f9){return function(_0x27ad7c){if(!_0x27ad7c){_0x17fc46[_0x4a5a('0x19')](0x194);}return _0x27ad7c;};}function handleError(_0x44517b,_0x46086d){_0x46086d=_0x46086d||0x1f4;return function(_0x5a8492){logger[_0x4a5a('0x26')](_0x5a8492[_0x4a5a('0x27')]);if(_0x5a8492['name']){delete _0x5a8492[_0x4a5a('0x28')];}_0x44517b[_0x4a5a('0x1b')](_0x46086d)[_0x4a5a('0x29')](_0x5a8492);};}exports[_0x4a5a('0x2a')]=function(_0x123984,_0x43f980){var _0x407c0c={},_0x50933c={},_0x59a59e={'count':0x0,'rows':[]};var _0x67cc2b=_[_0x4a5a('0x2b')](db['ZohoField']['rawAttributes'],function(_0x44fc50){return{'name':_0x44fc50[_0x4a5a('0x2c')],'type':_0x44fc50[_0x4a5a('0x2d')][_0x4a5a('0x2e')]};});_0x50933c[_0x4a5a('0x2f')]=_[_0x4a5a('0x2b')](_0x67cc2b,_0x4a5a('0x28'));_0x50933c[_0x4a5a('0x30')]=_['keys'](_0x123984['query']);_0x50933c[_0x4a5a('0x31')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],_0x50933c[_0x4a5a('0x30')]);_0x407c0c[_0x4a5a('0x32')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x407c0c['attributes']=_0x407c0c['attributes'][_0x4a5a('0x34')]?_0x407c0c[_0x4a5a('0x32')]:_0x50933c[_0x4a5a('0x2f')];if(!_0x123984['query'][_0x4a5a('0x35')](_0x4a5a('0x36'))){_0x407c0c[_0x4a5a('0x1e')]=qs[_0x4a5a('0x1e')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1e')]);_0x407c0c[_0x4a5a('0x1d')]=qs[_0x4a5a('0x1d')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1d')]);}_0x407c0c[_0x4a5a('0x37')]=qs[_0x4a5a('0x38')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x38')]);_0x407c0c[_0x4a5a('0x39')]=qs[_0x4a5a('0x31')](_[_0x4a5a('0x3a')](_0x123984[_0x4a5a('0x30')],_0x50933c[_0x4a5a('0x31')]),_0x67cc2b);if(_0x123984['query']['filter']){_0x407c0c[_0x4a5a('0x39')]=_[_0x4a5a('0x3b')](_0x407c0c['where'],{'$or':_[_0x4a5a('0x2b')](_0x67cc2b,function(_0x4c7d17){if(_0x4c7d17[_0x4a5a('0x2d')]!==_0x4a5a('0x3c')){var _0xac1cb2={};_0xac1cb2[_0x4c7d17[_0x4a5a('0x28')]]={'$like':'%'+_0x123984[_0x4a5a('0x30')][_0x4a5a('0x3d')]+'%'};return _0xac1cb2;}})});}_0x407c0c=_[_0x4a5a('0x3b')]({},_0x407c0c,_0x123984[_0x4a5a('0x3e')]);var _0x4ca49a={'where':_0x407c0c[_0x4a5a('0x39')]};return db[_0x4a5a('0x3f')][_0x4a5a('0x1f')](_0x4ca49a)[_0x4a5a('0x24')](function(_0x492bdd){_0x59a59e[_0x4a5a('0x1f')]=_0x492bdd;if(_0x123984['query'][_0x4a5a('0x40')]){_0x407c0c['include']=[{'all':!![]}];}return db[_0x4a5a('0x3f')][_0x4a5a('0x41')](_0x407c0c);})['then'](function(_0x51e3e0){_0x59a59e[_0x4a5a('0x42')]=_0x51e3e0;return _0x59a59e;})[_0x4a5a('0x24')](respondWithFilteredResult(_0x43f980,_0x407c0c))[_0x4a5a('0x43')](handleError(_0x43f980,null));};exports[_0x4a5a('0x44')]=function(_0x22400e,_0x46b75d){var _0x551fd3={'raw':!![],'where':{'id':_0x22400e['params']['id']}},_0x57fa6a={};_0x57fa6a[_0x4a5a('0x2f')]=_[_0x4a5a('0x45')](db['ZohoField'][_0x4a5a('0x46')]);_0x57fa6a[_0x4a5a('0x30')]=_['keys'](_0x22400e[_0x4a5a('0x30')]);_0x57fa6a[_0x4a5a('0x31')]=_[_0x4a5a('0x47')](_0x57fa6a['model'],_0x57fa6a[_0x4a5a('0x30')]);_0x551fd3[_0x4a5a('0x32')]=_[_0x4a5a('0x47')](_0x57fa6a[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x22400e[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x551fd3[_0x4a5a('0x32')]=_0x551fd3[_0x4a5a('0x32')][_0x4a5a('0x34')]?_0x551fd3[_0x4a5a('0x32')]:_0x57fa6a[_0x4a5a('0x2f')];if(_0x22400e[_0x4a5a('0x30')]['includeAll']){_0x551fd3[_0x4a5a('0x48')]=[{'all':!![]}];}_0x551fd3=_['merge']({},_0x551fd3,_0x22400e[_0x4a5a('0x3e')]);return db[_0x4a5a('0x3f')][_0x4a5a('0x49')](_0x551fd3)[_0x4a5a('0x24')](handleEntityNotFound(_0x46b75d,null))[_0x4a5a('0x24')](respondWithResult(_0x46b75d,null))[_0x4a5a('0x43')](handleError(_0x46b75d,null));};exports[_0x4a5a('0x4a')]=function(_0x1bd98b,_0xca6ead){return db[_0x4a5a('0x3f')][_0x4a5a('0x4a')](_0x1bd98b[_0x4a5a('0x4b')],{})[_0x4a5a('0x24')](respondWithResult(_0xca6ead,0xc9))[_0x4a5a('0x43')](handleError(_0xca6ead,null));};exports[_0x4a5a('0x4c')]=function(_0x46b324,_0x4c7feb){if(_0x46b324[_0x4a5a('0x4b')]['id']){delete _0x46b324['body']['id'];}return db[_0x4a5a('0x3f')]['find']({'where':{'id':_0x46b324['params']['id']}})[_0x4a5a('0x24')](handleEntityNotFound(_0x4c7feb,null))['then'](saveUpdates(_0x46b324['body'],null))['then'](respondWithResult(_0x4c7feb,null))[_0x4a5a('0x43')](handleError(_0x4c7feb,null));};exports[_0x4a5a('0x25')]=function(_0x28645d,_0x3580fa){return db[_0x4a5a('0x3f')][_0x4a5a('0x49')]({'where':{'id':_0x28645d[_0x4a5a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3580fa,null))[_0x4a5a('0x24')](removeEntity(_0x3580fa,null))[_0x4a5a('0x43')](handleError(_0x3580fa,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f1ca1a0..d78b319 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 _0x524e=['define','ZohoField','zoho_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0x524e,0x15e));var _0xe524=function(_0x18b162,_0x2cf819){_0x18b162=_0x18b162-0x0;var _0x4ab000=_0x524e[_0x18b162];return _0x4ab000;};'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':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xd'),_0xe524('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0424=['define','ZohoField','int_zoho_fields','FieldId','../../config/logger','api','moment','bluebird','path','./intZohoField.attributes','exports'];(function(_0x499007,_0x58582e){var _0x3d8a7a=function(_0x1e0c6a){while(--_0x1e0c6a){_0x499007['push'](_0x499007['shift']());}};_0x3d8a7a(++_0x58582e);}(_0x0424,0x159));var _0x4042=function(_0x243f79,_0x429e45){_0x243f79=_0x243f79-0x0;var _0x460321=_0x0424[_0x243f79];return _0x460321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x4042('0xa')],'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 164cabf..a98ee3f 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 _0x673b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x3b0aef,_0x2c58a7){var _0x1ddce7=function(_0x58fad1){while(--_0x58fad1){_0x3b0aef['push'](_0x3b0aef['shift']());}};_0x1ddce7(++_0x2c58a7);}(_0x673b,0xe1));var _0xb673=function(_0x33fe7f,_0x344195){_0x33fe7f=_0x33fe7f-0x0;var _0x3f3b80=_0x673b[_0x33fe7f];return _0x3f3b80;};'use strict';var _=require(_0xb673('0x0'));var util=require('util');var moment=require(_0xb673('0x1'));var BPromise=require(_0xb673('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb673('0x3'))['db'];var utils=require(_0xb673('0x4'));var logger=require(_0xb673('0x5'))('rpc');var config=require(_0xb673('0x6'));var jayson=require(_0xb673('0x7'));var client=jayson['client'][_0xb673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40d6f4,_0xc43460,_0x585528){return new BPromise(function(_0x3b8258,_0x17c958){return client['request'](_0x40d6f4,_0x585528)['then'](function(_0x53b0bf){logger[_0xb673('0x9')](_0xb673('0xa'),_0xc43460,_0xb673('0xb'));logger[_0xb673('0xc')](_0xb673('0xd'),_0xc43460,'request\x20sent',JSON[_0xb673('0xe')](_0x53b0bf));if(_0x53b0bf['error']){if(_0x53b0bf[_0xb673('0xf')][_0xb673('0x10')]===0x1f4){logger['error'](_0xb673('0xa'),_0xc43460,_0x53b0bf[_0xb673('0xf')]['message']);return _0x17c958(_0x53b0bf[_0xb673('0xf')][_0xb673('0x11')]);}logger[_0xb673('0xf')](_0xb673('0xa'),_0xc43460,_0x53b0bf[_0xb673('0xf')][_0xb673('0x11')]);return _0x3b8258(_0x53b0bf['error'][_0xb673('0x11')]);}else{logger['info'](_0xb673('0xa'),_0xc43460,'request\x20sent');_0x3b8258(_0x53b0bf['result'][_0xb673('0x11')]);}})[_0xb673('0x12')](function(_0x426ee9){logger['error'](_0xb673('0xa'),_0xc43460,_0x426ee9);_0x17c958(_0x426ee9);});});} \ No newline at end of file +var _0xdb1e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb1e,0xb2));var _0xedb1=function(_0x5138cd,_0x2b8708){_0x5138cd=_0x5138cd-0x0;var _0x1aff35=_0xdb1e[_0x5138cd];return _0x1aff35;};'use strict';var _=require(_0xedb1('0x0'));var util=require(_0xedb1('0x1'));var moment=require(_0xedb1('0x2'));var BPromise=require(_0xedb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedb1('0x4'))['db'];var utils=require(_0xedb1('0x5'));var logger=require(_0xedb1('0x6'))(_0xedb1('0x7'));var config=require(_0xedb1('0x8'));var jayson=require(_0xedb1('0x9'));var client=jayson[_0xedb1('0xa')][_0xedb1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f0599,_0x3f0029,_0x34f7b5){return new BPromise(function(_0x3f31dd,_0x482d30){return client[_0xedb1('0xc')](_0x4f0599,_0x34f7b5)[_0xedb1('0xd')](function(_0x5ce3d3){logger['info'](_0xedb1('0xe'),_0x3f0029,'request\x20sent');logger[_0xedb1('0xf')](_0xedb1('0x10'),_0x3f0029,'request\x20sent',JSON[_0xedb1('0x11')](_0x5ce3d3));if(_0x5ce3d3[_0xedb1('0x12')]){if(_0x5ce3d3[_0xedb1('0x12')]['code']===0x1f4){logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x5ce3d3['error']['message']);return _0x482d30(_0x5ce3d3[_0xedb1('0x12')]['message']);}logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x5ce3d3['error'][_0xedb1('0x13')]);return _0x3f31dd(_0x5ce3d3['error'][_0xedb1('0x13')]);}else{logger['info'](_0xedb1('0xe'),_0x3f0029,_0xedb1('0x14'));_0x3f31dd(_0x5ce3d3[_0xedb1('0x15')][_0xedb1('0x13')]);}})[_0xedb1('0x16')](function(_0x31a8f0){logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x31a8f0);_0x482d30(_0x31a8f0);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 438e719..c359630 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9ce749,_0x38b8cf){var _0x3d2c62=function(_0x58d630){while(--_0x58d630){_0x9ce749['push'](_0x9ce749['shift']());}};_0x3d2c62(++_0x38b8cf);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x564b60,_0x19dd4a){var _0x322362=function(_0x5e28de){while(--_0x5e28de){_0x564b60['push'](_0x564b60['shift']());}};_0x322362(++_0x19dd4a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0xcb91[_0x1a809b];return _0x5d90e6;};'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 2c99846..01d63c5 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 _0x0e6b=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0e6b,0x17d));var _0xb0e6=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x0e6b[_0x49a57c];return _0x4e0316;};'use strict';var Sequelize=require(_0xb0e6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0e6('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb0e6('0x1')],'allowNull':![],'unique':_0xb0e6('0x2')},'main':{'type':Sequelize[_0xb0e6('0x1')],'defaultValue':_0xb0e6('0x3')},'filename':{'type':Sequelize[_0xb0e6('0x1')]},'path':{'type':Sequelize[_0xb0e6('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xb0e6('0x4')]},'active':{'type':Sequelize[_0xb0e6('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xb0e6('0x1')]},'logo':{'type':Sequelize[_0xb0e6('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xb0e6('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xb0e6('0x1')]},'remoteUri':{'type':Sequelize[_0xb0e6('0x1')]},'link':{'type':Sequelize[_0xb0e6('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x6418=['STRING','app.js','INTEGER','BOOLEAN','state','exports','unique_name_and_version'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6418,0xfa));var _0x8641=function(_0x1f771b,_0x573f67){_0x1f771b=_0x1f771b-0x0;var _0xaf1e84=_0x6418[_0x1f771b];return _0xaf1e84;};'use strict';var Sequelize=require('sequelize');module[_0x8641('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8641('0x1')},'version':{'type':Sequelize[_0x8641('0x2')],'allowNull':![],'unique':_0x8641('0x1')},'main':{'type':Sequelize[_0x8641('0x2')],'defaultValue':_0x8641('0x3')},'filename':{'type':Sequelize[_0x8641('0x2')]},'path':{'type':Sequelize[_0x8641('0x2')]},'type':{'type':Sequelize[_0x8641('0x2')]},'size':{'type':Sequelize[_0x8641('0x4')]},'active':{'type':Sequelize[_0x8641('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8641('0x2')]},'logo':{'type':Sequelize[_0x8641('0x2')]},'state':{'type':Sequelize[_0x8641('0x2')],'unique':_0x8641('0x6')},'description':{'type':Sequelize[_0x8641('0x2')]},'title':{'type':Sequelize[_0x8641('0x2')]},'remoteUri':{'type':Sequelize[_0x8641('0x2')]},'link':{'type':Sequelize[_0x8641('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 f853d57..b73086d 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 _0x5c3c=['VIRTUAL','options','Integration','includeAll','include','findAll','rows','params','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x392320,_0x428048){var _0x1fa64d=function(_0x980189){while(--_0x980189){_0x392320['push'](_0x392320['shift']());}};_0x1fa64d(++_0x428048);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5c3c[_0x5037ab];return _0x512adb;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['Integration'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['Integration'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['Integration'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['Integration'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5bb718,_0x190cb7){var _0xf7bfa2=function(_0xc3d2c2){while(--_0xc3d2c2){_0x5bb718['push'](_0x5bb718['shift']());}};_0xf7bfa2(++_0x190cb7);}(_0x7a54,0x106));var _0x47a5=function(_0x134687,_0x20dbc7){_0x134687=_0x134687-0x0;var _0x2f2b7b=_0x7a54[_0x134687];return _0x2f2b7b;};'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['Integration'][_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['Integration']['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['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d3df6e5..57256bc 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 _0xc266=['define','Integration','integrations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports'];(function(_0x1008da,_0x1bdec0){var _0x4ed756=function(_0x4ac079){while(--_0x4ac079){_0x1008da['push'](_0x1008da['shift']());}};_0x4ed756(++_0x1bdec0);}(_0xc266,0x6f));var _0x6c26=function(_0x344f01,_0x2815ee){_0x344f01=_0x344f01-0x0;var _0x92719a=_0xc266[_0x344f01];return _0x92719a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c26('0x0'))(_0x6c26('0x1'));var moment=require(_0x6c26('0x2'));var BPromise=require(_0x6c26('0x3'));var rp=require(_0x6c26('0x4'));var fs=require('fs');var path=require(_0x6c26('0x5'));var rimraf=require(_0x6c26('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c26('0x7'));module[_0x6c26('0x8')]=function(_0x279b60,_0x4d0872){return _0x279b60[_0x6c26('0x9')](_0x6c26('0xa'),attributes,{'tableName':_0x6c26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd99b=['api','moment','bluebird','request-promise','rimraf','./integration.attributes','define','Integration','integrations','util','../../config/logger'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd99b,0x98));var _0xbd99=function(_0x4b2a99,_0x50f753){_0x4b2a99=_0x4b2a99-0x0;var _0x1b78f0=_0xd99b[_0x4b2a99];return _0x1b78f0;};'use strict';var _=require('lodash');var util=require(_0xbd99('0x0'));var logger=require(_0xbd99('0x1'))(_0xbd99('0x2'));var moment=require(_0xbd99('0x3'));var BPromise=require(_0xbd99('0x4'));var rp=require(_0xbd99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd99('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd99('0x7'));module['exports']=function(_0x31811a,_0x762243){return _0x31811a[_0xbd99('0x8')](_0xbd99('0x9'),attributes,{'tableName':_0xbd99('0xa'),'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 147d21e..6d67198 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x28d7f4,_0x43f972){var _0x421fc3=function(_0x1049f0){while(--_0x1049f0){_0x28d7f4['push'](_0x28d7f4['shift']());}};_0x421fc3(++_0x43f972);}(_0x66fa,0x117));var _0xa66f=function(_0x513fc8,_0x549678){_0x513fc8=_0x513fc8-0x0;var _0x5ce3ec=_0x66fa[_0x513fc8];return _0x5ce3ec;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e12d1,_0x28b537){var _0x145958=function(_0x39499e){while(--_0x39499e){_0x2e12d1['push'](_0x2e12d1['shift']());}};_0x145958(++_0x28b537);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x266aa5,_0x5f477a){_0x266aa5=_0x266aa5-0x0;var _0x655791=_0xc6ac[_0x266aa5];return _0x655791;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ba28569..6e641ea 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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('./integrationReport.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['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=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(_0x121f61,_0x5174fc){var _0x393306=function(_0xc9dfde){while(--_0xc9dfde){_0x121f61['push'](_0x121f61['shift']());}};_0x393306(++_0x5174fc);}(_0x66fa,0x117));var _0xa66f=function(_0x4d6733,_0x2cee2e){_0x4d6733=_0x4d6733-0x0;var _0x547ad0=_0x66fa[_0x4d6733];return _0x547ad0;};'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 1fac097..e03e1c4 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 _0xc356=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED'];(function(_0x18ff49,_0x1b3ab6){var _0x5597da=function(_0x3fcc70){while(--_0x3fcc70){_0x18ff49['push'](_0x18ff49['shift']());}};_0x5597da(++_0x1b3ab6);}(_0xc356,0x11f));var _0x6c35=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0xc356[_0x58ee19];return _0x49af25;};'use strict';var Sequelize=require(_0x6c35('0x0'));module[_0x6c35('0x1')]={'integration':{'type':Sequelize[_0x6c35('0x2')]},'eventChannel':{'type':Sequelize[_0x6c35('0x2')]},'exitStatus':{'type':Sequelize[_0x6c35('0x2')]},'ticketId':{'type':Sequelize[_0x6c35('0x2')]},'integrationId':{'type':Sequelize[_0x6c35('0x3')]},'contacts':{'type':Sequelize[_0x6c35('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6c35('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6c35('0x2')]},'interface':{'type':Sequelize[_0x6c35('0x2')]},'membername':{'type':Sequelize[_0x6c35('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6c35('0x4')]},'agentconnectAt':{'type':Sequelize[_0x6c35('0x4')]},'holdtime':{'type':Sequelize[_0x6c35('0x3')]},'agentcomplete':{'type':Sequelize[_0x6c35('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6c35('0x4')]},'talktime':{'type':Sequelize[_0x6c35('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x6c35('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6c35('0x4')]},'agentdump':{'type':Sequelize[_0x6c35('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6c35('0x2')]},'channel':{'type':Sequelize[_0x6c35('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6c35('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6c35('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6c35('0x2')]},'priority':{'type':Sequelize[_0x6c35('0x2')]},'destchannel':{'type':Sequelize[_0x6c35('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6c35('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6c35('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6c35('0x2')]},'destaccountcode':{'type':Sequelize[_0x6c35('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x6c35('0x2')]},'destpriority':{'type':Sequelize[_0x6c35('0x2')]},'destuniqueid':{'type':Sequelize[_0x6c35('0x2')]},'messageId':{'type':Sequelize[_0x6c35('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6c35('0x2')]},'from':{'type':Sequelize[_0x6c35('0x2')]},'to':{'type':Sequelize[_0x6c35('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x6c35('0x6')]},'text':{'type':Sequelize[_0x6c35('0x6')]},'status':{'type':Sequelize[_0x6c35('0x7')](_0x6c35('0x8'),'SENDING',_0x6c35('0x9'),_0x6c35('0xa'))},'url':{'type':Sequelize[_0x6c35('0x2')]},'app':{'type':Sequelize[_0x6c35('0x2')]},'appdata':{'type':Sequelize[_0x6c35('0x2')]},'projectId':{'type':Sequelize[_0x6c35('0x3')]}}; \ No newline at end of file +var _0x2f74=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING'];(function(_0x59b9d3,_0x384472){var _0x171163=function(_0x251233){while(--_0x251233){_0x59b9d3['push'](_0x59b9d3['shift']());}};_0x171163(++_0x384472);}(_0x2f74,0xfb));var _0x42f7=function(_0x36a236,_0x3cc5fc){_0x36a236=_0x36a236-0x0;var _0xa4ab27=_0x2f74[_0x36a236];return _0xa4ab27;};'use strict';var Sequelize=require('sequelize');module[_0x42f7('0x0')]={'integration':{'type':Sequelize[_0x42f7('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x42f7('0x1')]},'integrationId':{'type':Sequelize[_0x42f7('0x2')]},'contacts':{'type':Sequelize[_0x42f7('0x1')]},'uniqueid':{'type':Sequelize[_0x42f7('0x1')]},'calleridnum':{'type':Sequelize[_0x42f7('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x42f7('0x1')]},'interface':{'type':Sequelize[_0x42f7('0x1')]},'membername':{'type':Sequelize[_0x42f7('0x1')]},'agentcalledAt':{'type':Sequelize[_0x42f7('0x3')]},'agentconnectAt':{'type':Sequelize[_0x42f7('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x42f7('0x3')]},'talktime':{'type':Sequelize[_0x42f7('0x2')]},'agentacw':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x42f7('0x2')]},'reason':{'type':Sequelize[_0x42f7('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x42f7('0x3')]},'lastevent':{'type':Sequelize[_0x42f7('0x1')]},'channel':{'type':Sequelize[_0x42f7('0x1')]},'channelstate':{'type':Sequelize[_0x42f7('0x2')]},'channelstatedesc':{'type':Sequelize[_0x42f7('0x1')]},'connectedlinenum':{'type':Sequelize[_0x42f7('0x1')]},'connectedlinename':{'type':Sequelize[_0x42f7('0x1')]},'language':{'type':Sequelize[_0x42f7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x42f7('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x42f7('0x1')]},'destchannel':{'type':Sequelize[_0x42f7('0x1')]},'destchannelstate':{'type':Sequelize[_0x42f7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x42f7('0x1')]},'destcalleridnum':{'type':Sequelize[_0x42f7('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x42f7('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x42f7('0x1')]},'destlanguage':{'type':Sequelize[_0x42f7('0x1')]},'destaccountcode':{'type':Sequelize[_0x42f7('0x1')]},'destcontext':{'type':Sequelize[_0x42f7('0x1')]},'destexten':{'type':Sequelize[_0x42f7('0x1')]},'destpriority':{'type':Sequelize[_0x42f7('0x1')]},'destuniqueid':{'type':Sequelize[_0x42f7('0x1')]},'messageId':{'type':Sequelize[_0x42f7('0x1')]},'inReplyTo':{'type':Sequelize[_0x42f7('0x1')]},'subject':{'type':Sequelize[_0x42f7('0x1')]},'from':{'type':Sequelize[_0x42f7('0x1')]},'to':{'type':Sequelize[_0x42f7('0x1')]},'cc':{'type':Sequelize[_0x42f7('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x42f7('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x42f7('0x6')](_0x42f7('0x7'),_0x42f7('0x8'),_0x42f7('0x9'),_0x42f7('0xa'))},'url':{'type':Sequelize[_0x42f7('0x1')]},'app':{'type':Sequelize[_0x42f7('0x1')]},'appdata':{'type':Sequelize[_0x42f7('0x1')]},'projectId':{'type':Sequelize[_0x42f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 2c626f1..b53f3d2 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 _0x53c2=['fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','params','include','catch','create','body','update','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','json','apply','destroy','then','status','end','stack','name','send','IntegrationReport','rawAttributes'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x53c2,0x1d6));var _0x253c=function(_0x4ce8a7,_0x518e0b){_0x4ce8a7=_0x4ce8a7-0x0;var _0x3d873b=_0x53c2[_0x4ce8a7];return _0x3d873b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x253c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x253c('0x1'));var rp=require(_0x253c('0x2'));var moment=require(_0x253c('0x3'));var BPromise=require(_0x253c('0x4'));var Mustache=require('mustache');var util=require(_0x253c('0x5'));var path=require(_0x253c('0x6'));var sox=require(_0x253c('0x7'));var csv=require(_0x253c('0x8'));var ejs=require(_0x253c('0x9'));var fs=require('fs');var fs_extra=require(_0x253c('0xa'));var _=require(_0x253c('0xb'));var squel=require('squel');var crypto=require(_0x253c('0xc'));var jsforce=require(_0x253c('0xd'));var deskjs=require(_0x253c('0xe'));var toCsv=require(_0x253c('0x8'));var querystring=require(_0x253c('0xf'));var Papa=require('papaparse');var Redis=require(_0x253c('0x10'));var authService=require(_0x253c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x253c('0x12'));var hardwareService=require(_0x253c('0x13'));var logger=require(_0x253c('0x14'))(_0x253c('0x15'));var utils=require('../../config/utils');var config=require(_0x253c('0x16'));var licenseUtil=require(_0x253c('0x17'));var db=require(_0x253c('0x18'))['db'];function respondWithStatusCode(_0xcc1ce9,_0x555cc1){_0x555cc1=_0x555cc1||0xcc;return function(_0x3d9466){if(_0x3d9466){return _0xcc1ce9[_0x253c('0x19')](_0x555cc1);}return _0xcc1ce9['status'](_0x555cc1)['end']();};}function respondWithResult(_0x1b8e5b,_0x9e1e8c){_0x9e1e8c=_0x9e1e8c||0xc8;return function(_0x3eb165){if(_0x3eb165){return _0x1b8e5b['status'](_0x9e1e8c)['json'](_0x3eb165);}};}function respondWithFilteredResult(_0x1d5119,_0x3940ce){return function(_0x5586aa){if(_0x5586aa){var _0x577cba=typeof _0x3940ce[_0x253c('0x1a')]===_0x253c('0x1b')&&typeof _0x3940ce[_0x253c('0x1c')]===_0x253c('0x1b');var _0xb909ef=_0x5586aa[_0x253c('0x1d')];var _0xb0c6e9=_0x577cba?0x0:_0x3940ce['offset'];var _0x345ad5=_0x577cba?_0x5586aa['count']:_0x3940ce[_0x253c('0x1a')]+_0x3940ce[_0x253c('0x1c')];var _0x4ee8d3;if(_0x345ad5>=_0xb909ef){_0x345ad5=_0xb909ef;_0x4ee8d3=0xc8;}else{_0x4ee8d3=0xce;}_0x1d5119['status'](_0x4ee8d3);return _0x1d5119['set']('Content-Range',_0xb0c6e9+'-'+_0x345ad5+'/'+_0xb909ef)[_0x253c('0x1e')](_0x5586aa);}return null;};}function patchUpdates(_0x535fb2){return function(_0x4e83d8){try{jsonpatch[_0x253c('0x1f')](_0x4e83d8,_0x535fb2,!![]);}catch(_0x2d7063){return BPromise['reject'](_0x2d7063);}return _0x4e83d8['save']();};}function saveUpdates(_0x11a246,_0x1b3a82){return function(_0x595702){if(_0x595702){return _0x595702['update'](_0x11a246)['then'](function(_0x87aea6){return _0x87aea6;});}return null;};}function removeEntity(_0x2ea3ae,_0x53fd59){return function(_0x3e954a){if(_0x3e954a){return _0x3e954a[_0x253c('0x20')]()[_0x253c('0x21')](function(){_0x2ea3ae[_0x253c('0x22')](0xcc)[_0x253c('0x23')]();});}};}function handleEntityNotFound(_0x3de7aa,_0xad1793){return function(_0x843fa6){if(!_0x843fa6){_0x3de7aa['sendStatus'](0x194);}return _0x843fa6;};}function handleError(_0x199812,_0x110278){_0x110278=_0x110278||0x1f4;return function(_0x235768){logger['error'](_0x235768[_0x253c('0x24')]);if(_0x235768['name']){delete _0x235768[_0x253c('0x25')];}_0x199812[_0x253c('0x22')](_0x110278)[_0x253c('0x26')](_0x235768);};}exports['index']=function(_0x127eb7,_0x595d67){var _0x2174ce={},_0x21e331={},_0x301aca={'count':0x0,'rows':[]};var _0x365691=_['map'](db[_0x253c('0x27')][_0x253c('0x28')],function(_0x55a817){return{'name':_0x55a817[_0x253c('0x29')],'type':_0x55a817[_0x253c('0x2a')][_0x253c('0x2b')]};});_0x21e331['model']=_[_0x253c('0x2c')](_0x365691,_0x253c('0x25'));_0x21e331[_0x253c('0x2d')]=_[_0x253c('0x2e')](_0x127eb7[_0x253c('0x2d')]);_0x21e331[_0x253c('0x2f')]=_[_0x253c('0x30')](_0x21e331[_0x253c('0x31')],_0x21e331[_0x253c('0x2d')]);_0x2174ce[_0x253c('0x32')]=_[_0x253c('0x30')](_0x21e331[_0x253c('0x31')],qs[_0x253c('0x33')](_0x127eb7[_0x253c('0x2d')][_0x253c('0x33')]));_0x2174ce[_0x253c('0x32')]=_0x2174ce[_0x253c('0x32')][_0x253c('0x34')]?_0x2174ce['attributes']:_0x21e331[_0x253c('0x31')];if(!_0x127eb7[_0x253c('0x2d')][_0x253c('0x35')](_0x253c('0x36'))){_0x2174ce[_0x253c('0x1c')]=qs['limit'](_0x127eb7[_0x253c('0x2d')]['limit']);_0x2174ce[_0x253c('0x1a')]=qs[_0x253c('0x1a')](_0x127eb7[_0x253c('0x2d')]['offset']);}_0x2174ce[_0x253c('0x37')]=qs[_0x253c('0x38')](_0x127eb7[_0x253c('0x2d')][_0x253c('0x38')]);_0x2174ce[_0x253c('0x39')]=qs[_0x253c('0x2f')](_[_0x253c('0x3a')](_0x127eb7[_0x253c('0x2d')],_0x21e331[_0x253c('0x2f')]),_0x365691);if(_0x127eb7[_0x253c('0x2d')][_0x253c('0x3b')]){_0x2174ce['where']=_['merge'](_0x2174ce[_0x253c('0x39')],{'$or':_[_0x253c('0x2c')](_0x365691,function(_0x16944f){if(_0x16944f[_0x253c('0x2a')]!==_0x253c('0x3c')){var _0x23da87={};_0x23da87[_0x16944f[_0x253c('0x25')]]={'$like':'%'+_0x127eb7[_0x253c('0x2d')][_0x253c('0x3b')]+'%'};return _0x23da87;}})});}_0x2174ce=_[_0x253c('0x3d')]({},_0x2174ce,_0x127eb7[_0x253c('0x3e')]);var _0x3bb2b1={'where':_0x2174ce[_0x253c('0x39')]};return db[_0x253c('0x27')][_0x253c('0x1d')](_0x3bb2b1)[_0x253c('0x21')](function(_0xb248ea){_0x301aca[_0x253c('0x1d')]=_0xb248ea;if(_0x127eb7[_0x253c('0x2d')][_0x253c('0x3f')]){_0x2174ce['include']=[{'all':!![]}];}return db[_0x253c('0x27')][_0x253c('0x40')](_0x2174ce);})[_0x253c('0x21')](function(_0x31f180){_0x301aca['rows']=_0x31f180;return _0x301aca;})[_0x253c('0x21')](respondWithFilteredResult(_0x595d67,_0x2174ce))['catch'](handleError(_0x595d67,null));};exports['show']=function(_0x574246,_0x556902){var _0x4a0d20={'raw':![],'where':{'id':_0x574246[_0x253c('0x41')]['id']}},_0x3c3728={};_0x3c3728[_0x253c('0x31')]=_[_0x253c('0x2e')](db[_0x253c('0x27')]['rawAttributes']);_0x3c3728['query']=_[_0x253c('0x2e')](_0x574246[_0x253c('0x2d')]);_0x3c3728[_0x253c('0x2f')]=_[_0x253c('0x30')](_0x3c3728[_0x253c('0x31')],_0x3c3728[_0x253c('0x2d')]);_0x4a0d20['attributes']=_[_0x253c('0x30')](_0x3c3728[_0x253c('0x31')],qs['fields'](_0x574246[_0x253c('0x2d')][_0x253c('0x33')]));_0x4a0d20[_0x253c('0x32')]=_0x4a0d20[_0x253c('0x32')][_0x253c('0x34')]?_0x4a0d20[_0x253c('0x32')]:_0x3c3728[_0x253c('0x31')];if(_0x574246[_0x253c('0x2d')][_0x253c('0x3f')]){_0x4a0d20[_0x253c('0x42')]=[{'all':!![]}];}_0x4a0d20=_[_0x253c('0x3d')]({},_0x4a0d20,_0x574246[_0x253c('0x3e')]);return db['IntegrationReport']['find'](_0x4a0d20)[_0x253c('0x21')](handleEntityNotFound(_0x556902,null))[_0x253c('0x21')](respondWithResult(_0x556902,null))[_0x253c('0x43')](handleError(_0x556902,null));};exports[_0x253c('0x44')]=function(_0x282572,_0x5d888d){return db['IntegrationReport'][_0x253c('0x44')](_0x282572[_0x253c('0x45')],{})[_0x253c('0x21')](respondWithResult(_0x5d888d,0xc9))['catch'](handleError(_0x5d888d,null));};exports[_0x253c('0x46')]=function(_0x1dd628,_0x4b313e){if(_0x1dd628[_0x253c('0x45')]['id']){delete _0x1dd628['body']['id'];}return db[_0x253c('0x27')]['find']({'where':{'id':_0x1dd628[_0x253c('0x41')]['id']}})[_0x253c('0x21')](handleEntityNotFound(_0x4b313e,null))[_0x253c('0x21')](saveUpdates(_0x1dd628[_0x253c('0x45')],null))[_0x253c('0x21')](respondWithResult(_0x4b313e,null))[_0x253c('0x43')](handleError(_0x4b313e,null));};exports[_0x253c('0x20')]=function(_0x22a508,_0x1b0371){return db['IntegrationReport'][_0x253c('0x47')]({'where':{'id':_0x22a508['params']['id']}})[_0x253c('0x21')](handleEntityNotFound(_0x1b0371,null))['then'](removeEntity(_0x1b0371,null))[_0x253c('0x43')](handleError(_0x1b0371,null));};exports[_0x253c('0x48')]=function(_0x394395,_0x5d6dc3){return db[_0x253c('0x27')][_0x253c('0x48')]()[_0x253c('0x21')](respondWithResult(_0x5d6dc3,null))[_0x253c('0x43')](handleError(_0x5d6dc3,null));}; \ No newline at end of file +var _0xf0d2=['create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','rawAttributes','length','find','catch'];(function(_0x173717,_0xc4974e){var _0x508533=function(_0x17e65c){while(--_0x17e65c){_0x173717['push'](_0x173717['shift']());}};_0x508533(++_0xc4974e);}(_0xf0d2,0xe2));var _0x2f0d=function(_0x371ca3,_0x57c221){_0x371ca3=_0x371ca3-0x0;var _0x57bb17=_0xf0d2[_0x371ca3];return _0x57bb17;};'use strict';var emlformat=require(_0x2f0d('0x0'));var rimraf=require(_0x2f0d('0x1'));var zipdir=require(_0x2f0d('0x2'));var jsonpatch=require(_0x2f0d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f0d('0x4'));var Mustache=require('mustache');var util=require(_0x2f0d('0x5'));var path=require(_0x2f0d('0x6'));var sox=require('sox');var csv=require(_0x2f0d('0x7'));var ejs=require(_0x2f0d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f0d('0x9'));var squel=require(_0x2f0d('0xa'));var crypto=require(_0x2f0d('0xb'));var jsforce=require(_0x2f0d('0xc'));var deskjs=require(_0x2f0d('0xd'));var toCsv=require(_0x2f0d('0x7'));var querystring=require(_0x2f0d('0xe'));var Papa=require('papaparse');var Redis=require(_0x2f0d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2f0d('0x10'));var as=require(_0x2f0d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f0d('0x12'))('api');var utils=require(_0x2f0d('0x13'));var config=require(_0x2f0d('0x14'));var licenseUtil=require(_0x2f0d('0x15'));var db=require(_0x2f0d('0x16'))['db'];function respondWithStatusCode(_0x4afda1,_0x363f28){_0x363f28=_0x363f28||0xcc;return function(_0x3b01cd){if(_0x3b01cd){return _0x4afda1['sendStatus'](_0x363f28);}return _0x4afda1[_0x2f0d('0x17')](_0x363f28)['end']();};}function respondWithResult(_0x55b6ea,_0x2c4944){_0x2c4944=_0x2c4944||0xc8;return function(_0x48771c){if(_0x48771c){return _0x55b6ea[_0x2f0d('0x17')](_0x2c4944)[_0x2f0d('0x18')](_0x48771c);}};}function respondWithFilteredResult(_0x4248a8,_0x3e9320){return function(_0x51fa31){if(_0x51fa31){var _0x368f09=typeof _0x3e9320[_0x2f0d('0x19')]===_0x2f0d('0x1a')&&typeof _0x3e9320['limit']==='undefined';var _0x4c1567=_0x51fa31[_0x2f0d('0x1b')];var _0x10d8d1=_0x368f09?0x0:_0x3e9320[_0x2f0d('0x19')];var _0x5135b3=_0x368f09?_0x51fa31['count']:_0x3e9320[_0x2f0d('0x19')]+_0x3e9320[_0x2f0d('0x1c')];var _0x1d2314;if(_0x5135b3>=_0x4c1567){_0x5135b3=_0x4c1567;_0x1d2314=0xc8;}else{_0x1d2314=0xce;}_0x4248a8[_0x2f0d('0x17')](_0x1d2314);return _0x4248a8[_0x2f0d('0x1d')]('Content-Range',_0x10d8d1+'-'+_0x5135b3+'/'+_0x4c1567)['json'](_0x51fa31);}return null;};}function patchUpdates(_0x1ebc9a){return function(_0x5e3366){try{jsonpatch[_0x2f0d('0x1e')](_0x5e3366,_0x1ebc9a,!![]);}catch(_0x35a391){return BPromise[_0x2f0d('0x1f')](_0x35a391);}return _0x5e3366['save']();};}function saveUpdates(_0x47089a,_0x43288a){return function(_0x2cfb45){if(_0x2cfb45){return _0x2cfb45[_0x2f0d('0x20')](_0x47089a)[_0x2f0d('0x21')](function(_0x4275a4){return _0x4275a4;});}return null;};}function removeEntity(_0x57b306,_0x4403e8){return function(_0x5e6b57){if(_0x5e6b57){return _0x5e6b57[_0x2f0d('0x22')]()['then'](function(){_0x57b306[_0x2f0d('0x17')](0xcc)[_0x2f0d('0x23')]();});}};}function handleEntityNotFound(_0x3bd67a,_0xc60a93){return function(_0x439a8e){if(!_0x439a8e){_0x3bd67a[_0x2f0d('0x24')](0x194);}return _0x439a8e;};}function handleError(_0x33c140,_0x1baf24){_0x1baf24=_0x1baf24||0x1f4;return function(_0x4bca2a){logger[_0x2f0d('0x25')](_0x4bca2a[_0x2f0d('0x26')]);if(_0x4bca2a[_0x2f0d('0x27')]){delete _0x4bca2a[_0x2f0d('0x27')];}_0x33c140[_0x2f0d('0x17')](_0x1baf24)[_0x2f0d('0x28')](_0x4bca2a);};}exports[_0x2f0d('0x29')]=function(_0x9e3aa0,_0x116eaa){var _0x18b933={},_0x5223ce={},_0x1c09ef={'count':0x0,'rows':[]};var _0x31cee7=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x110b7c){return{'name':_0x110b7c['fieldName'],'type':_0x110b7c[_0x2f0d('0x2a')][_0x2f0d('0x2b')]};});_0x5223ce[_0x2f0d('0x2c')]=_[_0x2f0d('0x2d')](_0x31cee7,_0x2f0d('0x27'));_0x5223ce[_0x2f0d('0x2e')]=_[_0x2f0d('0x2f')](_0x9e3aa0['query']);_0x5223ce[_0x2f0d('0x30')]=_[_0x2f0d('0x31')](_0x5223ce[_0x2f0d('0x2c')],_0x5223ce[_0x2f0d('0x2e')]);_0x18b933[_0x2f0d('0x32')]=_[_0x2f0d('0x31')](_0x5223ce[_0x2f0d('0x2c')],qs['fields'](_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x33')]));_0x18b933[_0x2f0d('0x32')]=_0x18b933['attributes']['length']?_0x18b933[_0x2f0d('0x32')]:_0x5223ce['model'];if(!_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x34')]('nolimit')){_0x18b933[_0x2f0d('0x1c')]=qs[_0x2f0d('0x1c')](_0x9e3aa0['query'][_0x2f0d('0x1c')]);_0x18b933[_0x2f0d('0x19')]=qs[_0x2f0d('0x19')](_0x9e3aa0[_0x2f0d('0x2e')]['offset']);}_0x18b933[_0x2f0d('0x35')]=qs[_0x2f0d('0x36')](_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x36')]);_0x18b933[_0x2f0d('0x37')]=qs['filters'](_[_0x2f0d('0x38')](_0x9e3aa0[_0x2f0d('0x2e')],_0x5223ce[_0x2f0d('0x30')]),_0x31cee7);if(_0x9e3aa0['query'][_0x2f0d('0x39')]){_0x18b933[_0x2f0d('0x37')]=_[_0x2f0d('0x3a')](_0x18b933['where'],{'$or':_[_0x2f0d('0x2d')](_0x31cee7,function(_0x2cfb0a){if(_0x2cfb0a[_0x2f0d('0x2a')]!==_0x2f0d('0x3b')){var _0x5bdf5e={};_0x5bdf5e[_0x2cfb0a[_0x2f0d('0x27')]]={'$like':'%'+_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x39')]+'%'};return _0x5bdf5e;}})});}_0x18b933=_[_0x2f0d('0x3a')]({},_0x18b933,_0x9e3aa0[_0x2f0d('0x3c')]);var _0x270649={'where':_0x18b933[_0x2f0d('0x37')]};return db[_0x2f0d('0x3d')][_0x2f0d('0x1b')](_0x270649)[_0x2f0d('0x21')](function(_0x43e685){_0x1c09ef['count']=_0x43e685;if(_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x3e')]){_0x18b933[_0x2f0d('0x3f')]=[{'all':!![]}];}return db[_0x2f0d('0x3d')][_0x2f0d('0x40')](_0x18b933);})[_0x2f0d('0x21')](function(_0x33d1e0){_0x1c09ef[_0x2f0d('0x41')]=_0x33d1e0;return _0x1c09ef;})['then'](respondWithFilteredResult(_0x116eaa,_0x18b933))['catch'](handleError(_0x116eaa,null));};exports['show']=function(_0x33cec2,_0x519fcd){var _0x4532ab={'raw':![],'where':{'id':_0x33cec2['params']['id']}},_0x356c62={};_0x356c62[_0x2f0d('0x2c')]=_[_0x2f0d('0x2f')](db['IntegrationReport'][_0x2f0d('0x42')]);_0x356c62[_0x2f0d('0x2e')]=_[_0x2f0d('0x2f')](_0x33cec2[_0x2f0d('0x2e')]);_0x356c62['filters']=_[_0x2f0d('0x31')](_0x356c62[_0x2f0d('0x2c')],_0x356c62[_0x2f0d('0x2e')]);_0x4532ab[_0x2f0d('0x32')]=_['intersection'](_0x356c62[_0x2f0d('0x2c')],qs[_0x2f0d('0x33')](_0x33cec2[_0x2f0d('0x2e')][_0x2f0d('0x33')]));_0x4532ab[_0x2f0d('0x32')]=_0x4532ab[_0x2f0d('0x32')][_0x2f0d('0x43')]?_0x4532ab[_0x2f0d('0x32')]:_0x356c62['model'];if(_0x33cec2['query'][_0x2f0d('0x3e')]){_0x4532ab[_0x2f0d('0x3f')]=[{'all':!![]}];}_0x4532ab=_[_0x2f0d('0x3a')]({},_0x4532ab,_0x33cec2[_0x2f0d('0x3c')]);return db['IntegrationReport'][_0x2f0d('0x44')](_0x4532ab)['then'](handleEntityNotFound(_0x519fcd,null))[_0x2f0d('0x21')](respondWithResult(_0x519fcd,null))[_0x2f0d('0x45')](handleError(_0x519fcd,null));};exports[_0x2f0d('0x46')]=function(_0x201f09,_0x160b1a){return db[_0x2f0d('0x3d')][_0x2f0d('0x46')](_0x201f09[_0x2f0d('0x47')],{})[_0x2f0d('0x21')](respondWithResult(_0x160b1a,0xc9))[_0x2f0d('0x45')](handleError(_0x160b1a,null));};exports['update']=function(_0x1a57ca,_0x530cce){if(_0x1a57ca['body']['id']){delete _0x1a57ca[_0x2f0d('0x47')]['id'];}return db[_0x2f0d('0x3d')][_0x2f0d('0x44')]({'where':{'id':_0x1a57ca[_0x2f0d('0x48')]['id']}})[_0x2f0d('0x21')](handleEntityNotFound(_0x530cce,null))[_0x2f0d('0x21')](saveUpdates(_0x1a57ca[_0x2f0d('0x47')],null))[_0x2f0d('0x21')](respondWithResult(_0x530cce,null))[_0x2f0d('0x45')](handleError(_0x530cce,null));};exports[_0x2f0d('0x22')]=function(_0x1c4c7b,_0x1a9122){return db['IntegrationReport'][_0x2f0d('0x44')]({'where':{'id':_0x1c4c7b['params']['id']}})['then'](handleEntityNotFound(_0x1a9122,null))[_0x2f0d('0x21')](removeEntity(_0x1a9122,null))[_0x2f0d('0x45')](handleError(_0x1a9122,null));};exports[_0x2f0d('0x49')]=function(_0x38ac36,_0x51338c){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x51338c,null))[_0x2f0d('0x45')](handleError(_0x51338c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 085ea04..bcfba56 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 _0x038d=['IntegrationReport','report_integration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define'];(function(_0x44714c,_0x2ac454){var _0x57d4d5=function(_0x5aca44){while(--_0x5aca44){_0x44714c['push'](_0x44714c['shift']());}};_0x57d4d5(++_0x2ac454);}(_0x038d,0x1d6));var _0xd038=function(_0x2cda4b,_0x422e11){_0x2cda4b=_0x2cda4b-0x0;var _0x47de60=_0x038d[_0x2cda4b];return _0x47de60;};'use strict';var _=require(_0xd038('0x0'));var util=require(_0xd038('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require(_0xd038('0x4'));var fs=require('fs');var path=require(_0xd038('0x5'));var rimraf=require(_0xd038('0x6'));var config=require(_0xd038('0x7'));var attributes=require(_0xd038('0x8'));module['exports']=function(_0x530a4d,_0x33c4ff){return _0x530a4d[_0xd038('0x9')](_0xd038('0xa'),attributes,{'tableName':_0xd038('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a90=['../../config/logger','api','moment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9a90,0x1ac));var _0x09a9=function(_0x430e42,_0x337aa7){_0x430e42=_0x430e42-0x0;var _0x3fd4f5=_0x9a90[_0x430e42];return _0x3fd4f5;};'use strict';var _=require(_0x09a9('0x0'));var util=require(_0x09a9('0x1'));var logger=require(_0x09a9('0x2'))(_0x09a9('0x3'));var moment=require(_0x09a9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x09a9('0x5'));module[_0x09a9('0x6')]=function(_0x1de663,_0x232864){return _0x1de663[_0x09a9('0x7')](_0x09a9('0x8'),attributes,{'tableName':_0x09a9('0x9'),'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 12f59ff..da17a7d 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xeb0309,_0x55340a){var _0x4fa64c=function(_0x128cce){while(--_0x128cce){_0xeb0309['push'](_0xeb0309['shift']());}};_0x4fa64c(++_0x55340a);}(_0x2ef3,0xba));var _0x32ef=function(_0x59213f,_0x25afd4){_0x59213f=_0x59213f-0x0;var _0x2af8e0=_0x2ef3[_0x59213f];return _0x2af8e0;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\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(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x1967,0x173));var _0x7196=function(_0x125487,_0x1d6879){_0x125487=_0x125487-0x0;var _0x5af268=_0x1967[_0x125487];return _0x5af268;};'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/interval/index.js b/server/api/interval/index.js index 89a10bd..5275eb4 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 _0xe5e0=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id'];(function(_0x2340dd,_0x1acd5c){var _0x525945=function(_0x363f7c){while(--_0x363f7c){_0x2340dd['push'](_0x2340dd['shift']());}};_0x525945(++_0x1acd5c);}(_0xe5e0,0x123));var _0x0e5e=function(_0x65ce20,_0x2beb2e){_0x65ce20=_0x65ce20-0x0;var _0x44c1c8=_0xe5e0[_0x65ce20];return _0x44c1c8;};'use strict';var multer=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var path=require(_0x0e5e('0x2'));var timeout=require(_0x0e5e('0x3'));var express=require(_0x0e5e('0x4'));var router=express[_0x0e5e('0x5')]();var fs_extra=require(_0x0e5e('0x6'));var auth=require(_0x0e5e('0x7'));var interaction=require(_0x0e5e('0x8'));var config=require(_0x0e5e('0x9'));var controller=require('./interval.controller');router[_0x0e5e('0xa')]('/',auth[_0x0e5e('0xb')](),controller['index']);router[_0x0e5e('0xa')]('/:id',auth[_0x0e5e('0xb')](),controller[_0x0e5e('0xc')]);router[_0x0e5e('0xa')]('/:id/sub_intervals',auth[_0x0e5e('0xb')](),controller[_0x0e5e('0xd')]);router[_0x0e5e('0xe')]('/',auth[_0x0e5e('0xb')](),controller[_0x0e5e('0xf')]);router[_0x0e5e('0xe')](_0x0e5e('0x10'),auth[_0x0e5e('0xb')](),controller[_0x0e5e('0x11')]);router['post'](_0x0e5e('0x12'),auth['isAuthenticated'](),controller[_0x0e5e('0x13')]);router['put'](_0x0e5e('0x14'),auth[_0x0e5e('0xb')](),controller[_0x0e5e('0x15')]);router[_0x0e5e('0x16')](_0x0e5e('0x14'),auth[_0x0e5e('0xb')](),controller[_0x0e5e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd7ff=['express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x59f719,_0x11d1a2){var _0x4f76ea=function(_0xc2c2c){while(--_0xc2c2c){_0x59f719['push'](_0x59f719['shift']());}};_0x4f76ea(++_0x11d1a2);}(_0xd7ff,0x100));var _0xfd7f=function(_0x5044b8,_0x15622f){_0x5044b8=_0x5044b8-0x0;var _0x23adf6=_0xd7ff[_0x5044b8];return _0x23adf6;};'use strict';var multer=require(_0xfd7f('0x0'));var util=require(_0xfd7f('0x1'));var path=require(_0xfd7f('0x2'));var timeout=require(_0xfd7f('0x3'));var express=require(_0xfd7f('0x4'));var router=express[_0xfd7f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd7f('0x6'));var config=require(_0xfd7f('0x7'));var controller=require(_0xfd7f('0x8'));router[_0xfd7f('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd7f('0xa')]);router[_0xfd7f('0x9')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0xd')]);router[_0xfd7f('0x9')](_0xfd7f('0xe'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0xf')]);router[_0xfd7f('0x10')]('/',auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x11')]);router[_0xfd7f('0x10')](_0xfd7f('0xe'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x12')]);router['post'](_0xfd7f('0x13'),auth['isAuthenticated'](),controller[_0xfd7f('0x14')]);router[_0xfd7f('0x15')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x16')]);router[_0xfd7f('0x17')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x18')]);module[_0xfd7f('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index cdaf8ef..92cf320 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 _0x0a55=['sequelize','exports','STRING'];(function(_0x33782d,_0x383bb0){var _0x5e5e32=function(_0x30b7f2){while(--_0x30b7f2){_0x33782d['push'](_0x33782d['shift']());}};_0x5e5e32(++_0x383bb0);}(_0x0a55,0x1c2));var _0x50a5=function(_0x51776a,_0x5e93d7){_0x51776a=_0x51776a-0x0;var _0x5cbada=_0x0a55[_0x51776a];return _0x5cbada;};'use strict';var Sequelize=require(_0x50a5('0x0'));module[_0x50a5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x50a5('0x2')]},'interval':{'type':Sequelize[_0x50a5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xcfb7=['exports','STRING','sequelize'];(function(_0x110b8f,_0x202a83){var _0x2cce4b=function(_0x2faab8){while(--_0x2faab8){_0x110b8f['push'](_0x110b8f['shift']());}};_0x2cce4b(++_0x202a83);}(_0xcfb7,0xa4));var _0x7cfb=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xcfb7[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require(_0x7cfb('0x0'));module[_0x7cfb('0x1')]={'name':{'type':Sequelize[_0x7cfb('0x2')]},'description':{'type':Sequelize[_0x7cfb('0x2')]},'interval':{'type':Sequelize[_0x7cfb('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 763277e..253ae30 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 _0xeee6=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','map','Interval','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','findOne','addIntervals','sequelize','IntervalId','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x557ee2,_0x46d127){var _0x2f576e=function(_0x2fe6f8){while(--_0x2fe6f8){_0x557ee2['push'](_0x557ee2['shift']());}};_0x2f576e(++_0x46d127);}(_0xeee6,0x1af));var _0x6eee=function(_0x1e3684,_0x45c517){_0x1e3684=_0x1e3684-0x0;var _0x36e537=_0xeee6[_0x1e3684];return _0x36e537;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6eee('0x0'));var zipdir=require(_0x6eee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eee('0x2'));var moment=require(_0x6eee('0x3'));var BPromise=require(_0x6eee('0x4'));var Mustache=require(_0x6eee('0x5'));var util=require(_0x6eee('0x6'));var path=require(_0x6eee('0x7'));var sox=require(_0x6eee('0x8'));var csv=require(_0x6eee('0x9'));var ejs=require(_0x6eee('0xa'));var fs=require('fs');var fs_extra=require(_0x6eee('0xb'));var _=require(_0x6eee('0xc'));var squel=require(_0x6eee('0xd'));var crypto=require(_0x6eee('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6eee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6eee('0x10'));var Papa=require('papaparse');var Redis=require(_0x6eee('0x11'));var authService=require(_0x6eee('0x12'));var qs=require(_0x6eee('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eee('0x14'));var logger=require(_0x6eee('0x15'))(_0x6eee('0x16'));var utils=require(_0x6eee('0x17'));var config=require(_0x6eee('0x18'));var licenseUtil=require(_0x6eee('0x19'));var db=require(_0x6eee('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x41420f,_0x229edc){_0x229edc=_0x229edc||0xcc;return function(_0x2b2530){if(_0x2b2530){return _0x41420f[_0x6eee('0x1b')](_0x229edc);}return _0x41420f['status'](_0x229edc)[_0x6eee('0x1c')]();};}function respondWithResult(_0x54ec7e,_0x46bfa5){_0x46bfa5=_0x46bfa5||0xc8;return function(_0x338649){if(_0x338649){return _0x54ec7e[_0x6eee('0x1d')](_0x46bfa5)[_0x6eee('0x1e')](_0x338649);}};}function respondWithFilteredResult(_0x3aefdf,_0x4948dc){return function(_0x4b2855){if(_0x4b2855){var _0x57782f=typeof _0x4948dc[_0x6eee('0x1f')]==='undefined'&&typeof _0x4948dc[_0x6eee('0x20')]===_0x6eee('0x21');var _0x5b9fa0=_0x4b2855[_0x6eee('0x22')];var _0x58bdde=_0x57782f?0x0:_0x4948dc['offset'];var _0x22251f=_0x57782f?_0x4b2855[_0x6eee('0x22')]:_0x4948dc[_0x6eee('0x1f')]+_0x4948dc[_0x6eee('0x20')];var _0x2aa80d;if(_0x22251f>=_0x5b9fa0){_0x22251f=_0x5b9fa0;_0x2aa80d=0xc8;}else{_0x2aa80d=0xce;}_0x3aefdf[_0x6eee('0x1d')](_0x2aa80d);return _0x3aefdf[_0x6eee('0x23')]('Content-Range',_0x58bdde+'-'+_0x22251f+'/'+_0x5b9fa0)[_0x6eee('0x1e')](_0x4b2855);}return null;};}function patchUpdates(_0xfe17ba){return function(_0x244fd2){try{jsonpatch[_0x6eee('0x24')](_0x244fd2,_0xfe17ba,!![]);}catch(_0x27ed04){return BPromise[_0x6eee('0x25')](_0x27ed04);}return _0x244fd2['save']();};}function saveUpdates(_0x7815ba,_0x85c1fd){return function(_0x3af9fa){if(_0x3af9fa){return _0x3af9fa[_0x6eee('0x26')](_0x7815ba)[_0x6eee('0x27')](function(_0x41aff6){return _0x41aff6;});}return null;};}function removeEntity(_0x58117c,_0x52e347){return function(_0x2d1d2e){if(_0x2d1d2e){return _0x2d1d2e[_0x6eee('0x28')]()[_0x6eee('0x27')](function(){var _0x4767fc=_0x2d1d2e[_0x6eee('0x29')]({'plain':!![]});var _0x8838a4=_0x6eee('0x2a');return db[_0x6eee('0x2b')]['destroy']({'where':{'type':_0x8838a4,'resourceId':_0x4767fc['id']}})['then'](function(){return _0x2d1d2e;});})[_0x6eee('0x27')](function(){_0x58117c['status'](0xcc)[_0x6eee('0x1c')]();});}};}function handleEntityNotFound(_0x2023a6,_0x461f07){return function(_0x18c003){if(!_0x18c003){_0x2023a6[_0x6eee('0x1b')](0x194);}return _0x18c003;};}function handleError(_0x1cef30,_0x3ea5ae){_0x3ea5ae=_0x3ea5ae||0x1f4;return function(_0x257ebe){logger[_0x6eee('0x2c')](_0x257ebe[_0x6eee('0x2d')]);if(_0x257ebe[_0x6eee('0x2e')]){delete _0x257ebe[_0x6eee('0x2e')];}_0x1cef30[_0x6eee('0x1d')](_0x3ea5ae)['send'](_0x257ebe);};}exports['index']=function(_0x33069b,_0x31fe62){var _0x146de7={},_0x1befd0={},_0x4ed824={'count':0x0,'rows':[]};var _0x2727d5=_[_0x6eee('0x2f')](db[_0x6eee('0x30')]['rawAttributes'],function(_0x1430a7){return{'name':_0x1430a7['fieldName'],'type':_0x1430a7[_0x6eee('0x31')][_0x6eee('0x32')]};});_0x1befd0['model']=_[_0x6eee('0x2f')](_0x2727d5,'name');_0x1befd0[_0x6eee('0x33')]=_[_0x6eee('0x34')](_0x33069b[_0x6eee('0x33')]);_0x1befd0[_0x6eee('0x35')]=_[_0x6eee('0x36')](_0x1befd0[_0x6eee('0x37')],_0x1befd0[_0x6eee('0x33')]);_0x146de7[_0x6eee('0x38')]=_[_0x6eee('0x36')](_0x1befd0[_0x6eee('0x37')],qs['fields'](_0x33069b[_0x6eee('0x33')][_0x6eee('0x39')]));_0x146de7[_0x6eee('0x38')]=_0x146de7[_0x6eee('0x38')][_0x6eee('0x3a')]?_0x146de7[_0x6eee('0x38')]:_0x1befd0[_0x6eee('0x37')];if(!_0x33069b[_0x6eee('0x33')][_0x6eee('0x3b')](_0x6eee('0x3c'))){_0x146de7['limit']=qs['limit'](_0x33069b[_0x6eee('0x33')][_0x6eee('0x20')]);_0x146de7['offset']=qs[_0x6eee('0x1f')](_0x33069b[_0x6eee('0x33')]['offset']);}_0x146de7[_0x6eee('0x3d')]=qs['sort'](_0x33069b[_0x6eee('0x33')][_0x6eee('0x3e')]);_0x146de7[_0x6eee('0x3f')]=qs[_0x6eee('0x35')](_[_0x6eee('0x40')](_0x33069b['query'],_0x1befd0[_0x6eee('0x35')]),_0x2727d5);if(_0x33069b[_0x6eee('0x33')]['filter']){_0x146de7['where']=_['merge'](_0x146de7[_0x6eee('0x3f')],{'$or':_[_0x6eee('0x2f')](_0x2727d5,function(_0x536b6f){if(_0x536b6f['type']!=='VIRTUAL'){var _0x2d9022={};_0x2d9022[_0x536b6f[_0x6eee('0x2e')]]={'$like':'%'+_0x33069b[_0x6eee('0x33')][_0x6eee('0x41')]+'%'};return _0x2d9022;}})});}_0x146de7=_[_0x6eee('0x42')]({},_0x146de7,_0x33069b[_0x6eee('0x43')]);var _0xa8f302={'where':_0x146de7[_0x6eee('0x3f')]};return db[_0x6eee('0x30')][_0x6eee('0x22')](_0xa8f302)[_0x6eee('0x27')](function(_0x241f97){_0x4ed824['count']=_0x241f97;if(_0x33069b['query'][_0x6eee('0x44')]){_0x146de7[_0x6eee('0x45')]=[{'all':!![]}];}return db[_0x6eee('0x30')][_0x6eee('0x46')](_0x146de7);})[_0x6eee('0x27')](function(_0x332094){_0x4ed824['rows']=_0x332094;return _0x4ed824;})[_0x6eee('0x27')](respondWithFilteredResult(_0x31fe62,_0x146de7))[_0x6eee('0x47')](handleError(_0x31fe62,null));};exports[_0x6eee('0x48')]=function(_0x1a8dc9,_0x332ef3){var _0x5a511f={'raw':!![],'where':{'id':_0x1a8dc9[_0x6eee('0x49')]['id']}},_0x142b7a={};_0x142b7a['model']=_[_0x6eee('0x34')](db[_0x6eee('0x30')]['rawAttributes']);_0x142b7a[_0x6eee('0x33')]=_['keys'](_0x1a8dc9[_0x6eee('0x33')]);_0x142b7a[_0x6eee('0x35')]=_[_0x6eee('0x36')](_0x142b7a['model'],_0x142b7a[_0x6eee('0x33')]);_0x5a511f['attributes']=_[_0x6eee('0x36')](_0x142b7a['model'],qs[_0x6eee('0x39')](_0x1a8dc9[_0x6eee('0x33')][_0x6eee('0x39')]));_0x5a511f[_0x6eee('0x38')]=_0x5a511f['attributes']['length']?_0x5a511f[_0x6eee('0x38')]:_0x142b7a['model'];if(_0x1a8dc9[_0x6eee('0x33')][_0x6eee('0x44')]){_0x5a511f[_0x6eee('0x45')]=[{'all':!![]}];}_0x5a511f=_[_0x6eee('0x42')]({},_0x5a511f,_0x1a8dc9[_0x6eee('0x43')]);return db[_0x6eee('0x30')][_0x6eee('0x4a')](_0x5a511f)['then'](handleEntityNotFound(_0x332ef3,null))[_0x6eee('0x27')](respondWithResult(_0x332ef3,null))[_0x6eee('0x47')](handleError(_0x332ef3,null));};exports[_0x6eee('0x4b')]=function(_0x329982,_0x4f4baa){return db[_0x6eee('0x30')][_0x6eee('0x4b')](_0x329982['body'],{})[_0x6eee('0x27')](function(_0xd53f){var _0xd61e2=_0x329982[_0x6eee('0x4c')][_0x6eee('0x29')]({'plain':!![]});if(!_0xd61e2)throw new Error(_0x6eee('0x4d'));if(_0xd61e2[_0x6eee('0x4e')]===_0x6eee('0x4c')){var _0x4dbb0b=_0xd53f[_0x6eee('0x29')]({'plain':!![]});var _0x39a0b7=_0x6eee('0x2a');return db[_0x6eee('0x4f')][_0x6eee('0x4a')]({'where':{'name':_0x39a0b7,'userProfileId':_0xd61e2[_0x6eee('0x50')]},'raw':!![]})[_0x6eee('0x27')](function(_0x23967b){if(_0x23967b&&_0x23967b[_0x6eee('0x51')]===0x0){return db[_0x6eee('0x2b')][_0x6eee('0x4b')]({'name':_0x4dbb0b[_0x6eee('0x2e')],'resourceId':_0x4dbb0b['id'],'type':_0x23967b['name'],'sectionId':_0x23967b['id']},{})[_0x6eee('0x27')](function(){return _0xd53f;});}else{return _0xd53f;}})[_0x6eee('0x47')](function(_0x4d3178){logger[_0x6eee('0x2c')](_0x6eee('0x52'),_0x4d3178);throw _0x4d3178;});}return _0xd53f;})[_0x6eee('0x27')](respondWithResult(_0x4f4baa,0xc9))[_0x6eee('0x47')](handleError(_0x4f4baa,null));};exports['update']=function(_0x5f14c6,_0x3b38b5){if(_0x5f14c6[_0x6eee('0x53')]['id']){delete _0x5f14c6['body']['id'];}return db[_0x6eee('0x30')][_0x6eee('0x4a')]({'where':{'id':_0x5f14c6[_0x6eee('0x49')]['id']}})[_0x6eee('0x27')](handleEntityNotFound(_0x3b38b5,null))[_0x6eee('0x27')](saveUpdates(_0x5f14c6[_0x6eee('0x53')],null))['then'](respondWithResult(_0x3b38b5,null))['catch'](handleError(_0x3b38b5,null));};exports[_0x6eee('0x28')]=function(_0x1ed6c4,_0x4dd761){return db[_0x6eee('0x30')][_0x6eee('0x4a')]({'where':{'id':_0x1ed6c4[_0x6eee('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dd761,null))[_0x6eee('0x27')](removeEntity(_0x4dd761,null))['catch'](handleError(_0x4dd761,null));};exports[_0x6eee('0x54')]=function(_0x5da02b,_0x5d5998,_0x2c6846){if(_0x5da02b['body']['id']){delete _0x5da02b[_0x6eee('0x53')]['id'];}return db[_0x6eee('0x30')][_0x6eee('0x4a')]({'where':{'id':_0x5da02b['params']['id']}})[_0x6eee('0x27')](handleEntityNotFound(_0x5d5998,null))[_0x6eee('0x27')](function(_0x31eb36){if(_0x31eb36){_0x5da02b['body']['IntervalId']=_0x31eb36['id'];return db[_0x6eee('0x30')][_0x6eee('0x4b')](_0x5da02b[_0x6eee('0x53')]);}})['then'](respondWithResult(_0x5d5998,null))[_0x6eee('0x47')](handleError(_0x5d5998,null));};exports[_0x6eee('0x55')]=function(_0xad6076,_0x59e202,_0x309fc8){var _0x13fd7d={};var _0x1ca5bd={};var _0x530526;var _0x35435e;return db[_0x6eee('0x30')][_0x6eee('0x56')]({'where':{'id':_0xad6076[_0x6eee('0x49')]['id']}})['then'](handleEntityNotFound(_0x59e202,null))[_0x6eee('0x27')](function(_0x2e7ea4){if(_0x2e7ea4){_0x530526=_0x2e7ea4;_0x1ca5bd[_0x6eee('0x37')]=_[_0x6eee('0x34')](db[_0x6eee('0x30')]['rawAttributes']);_0x1ca5bd[_0x6eee('0x33')]=_['keys'](_0xad6076['query']);_0x1ca5bd[_0x6eee('0x35')]=_[_0x6eee('0x36')](_0x1ca5bd[_0x6eee('0x37')],_0x1ca5bd[_0x6eee('0x33')]);_0x13fd7d[_0x6eee('0x38')]=_['intersection'](_0x1ca5bd[_0x6eee('0x37')],qs[_0x6eee('0x39')](_0xad6076[_0x6eee('0x33')]['fields']));_0x13fd7d[_0x6eee('0x38')]=_0x13fd7d[_0x6eee('0x38')][_0x6eee('0x3a')]?_0x13fd7d['attributes']:_0x1ca5bd[_0x6eee('0x37')];_0x13fd7d[_0x6eee('0x3d')]=qs[_0x6eee('0x3e')](_0xad6076[_0x6eee('0x33')][_0x6eee('0x3e')]);_0x13fd7d[_0x6eee('0x3f')]=qs[_0x6eee('0x35')](_[_0x6eee('0x40')](_0xad6076[_0x6eee('0x33')],_0x1ca5bd[_0x6eee('0x35')]));if(_0xad6076[_0x6eee('0x33')]['filter']){_0x13fd7d[_0x6eee('0x3f')]=_['merge'](_0x13fd7d[_0x6eee('0x3f')],{'$or':_['map'](_0x13fd7d[_0x6eee('0x38')],function(_0x1bae9b){var _0xe3463d={};_0xe3463d[_0x1bae9b]={'$like':'%'+_0xad6076[_0x6eee('0x33')][_0x6eee('0x41')]+'%'};return _0xe3463d;})});}_0x13fd7d=_[_0x6eee('0x42')]({},_0x13fd7d,_0xad6076[_0x6eee('0x43')]);return _0x530526['getIntervals'](_0x13fd7d);}})[_0x6eee('0x27')](function(_0x322aca){if(_0x322aca){_0x35435e=_0x322aca[_0x6eee('0x3a')];if(!_0xad6076[_0x6eee('0x33')]['hasOwnProperty'](_0x6eee('0x3c'))){_0x13fd7d[_0x6eee('0x20')]=qs[_0x6eee('0x20')](_0xad6076['query'][_0x6eee('0x20')]);_0x13fd7d[_0x6eee('0x1f')]=qs[_0x6eee('0x1f')](_0xad6076[_0x6eee('0x33')][_0x6eee('0x1f')]);}return _0x530526[_0x6eee('0x55')](_0x13fd7d);}})[_0x6eee('0x27')](function(_0x2e0328){if(_0x2e0328){return _0x2e0328?{'count':_0x35435e,'rows':_0x2e0328}:null;}})[_0x6eee('0x27')](respondWithResult(_0x59e202,null))['catch'](handleError(_0x59e202,null));};exports[_0x6eee('0x57')]=function(_0x1562a1,_0x1c5761,_0x577eed){return db[_0x6eee('0x30')][_0x6eee('0x56')]({'where':{'id':_0x1562a1[_0x6eee('0x49')]['id']}})[_0x6eee('0x27')](handleEntityNotFound(_0x1c5761,null))[_0x6eee('0x27')](function(_0xe94f5b){if(_0xe94f5b){return db[_0x6eee('0x58')]['transaction'](function(_0x4487b2){return db[_0x6eee('0x30')][_0x6eee('0x28')]({'where':{'IntervalId':_0x1562a1[_0x6eee('0x49')]['id']},'transaction':_0x4487b2})['then'](function(_0x39e8ef){var _0x120bb7=_[_0x6eee('0x2f')](_0x1562a1['body'],function(_0x34971e){delete _0x34971e['id'];_0x34971e[_0x6eee('0x59')]=_0x1562a1[_0x6eee('0x49')]['id'];return _0x34971e;});return db['Interval']['bulkCreate'](_0x120bb7,{'transaction':_0x4487b2});});})[_0x6eee('0x27')](function(){return db['Interval'][_0x6eee('0x46')]({'where':{'IntervalId':_0x1562a1['params']['id']}});});}})[_0x6eee('0x27')](respondWithResult(_0x1c5761,null))[_0x6eee('0x47')](handleError(_0x1c5761,null));}; \ No newline at end of file +var _0x5725=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','destroy','get','Intervals','error','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','intersection','includeAll','find','catch','create','body','user','role','userProfileId'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5725,0xc2));var _0x5572=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5725[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5572('0x0'));var zipdir=require(_0x5572('0x1'));var jsonpatch=require(_0x5572('0x2'));var rp=require(_0x5572('0x3'));var moment=require(_0x5572('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5572('0x5'));var path=require(_0x5572('0x6'));var sox=require(_0x5572('0x7'));var csv=require(_0x5572('0x8'));var ejs=require(_0x5572('0x9'));var fs=require('fs');var fs_extra=require(_0x5572('0xa'));var _=require(_0x5572('0xb'));var squel=require(_0x5572('0xc'));var crypto=require(_0x5572('0xd'));var jsforce=require(_0x5572('0xe'));var deskjs=require(_0x5572('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5572('0x10'));var Redis=require(_0x5572('0x11'));var authService=require(_0x5572('0x12'));var qs=require(_0x5572('0x13'));var as=require(_0x5572('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5572('0x15'))('api');var utils=require(_0x5572('0x16'));var config=require(_0x5572('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5572('0x18'))['db'];var extensions=require(_0x5572('0x19'));function respondWithStatusCode(_0x472651,_0x27b25a){_0x27b25a=_0x27b25a||0xcc;return function(_0x529341){if(_0x529341){return _0x472651[_0x5572('0x1a')](_0x27b25a);}return _0x472651[_0x5572('0x1b')](_0x27b25a)[_0x5572('0x1c')]();};}function respondWithResult(_0x11fd51,_0x3fd7f6){_0x3fd7f6=_0x3fd7f6||0xc8;return function(_0x1c8a83){if(_0x1c8a83){return _0x11fd51[_0x5572('0x1b')](_0x3fd7f6)[_0x5572('0x1d')](_0x1c8a83);}};}function respondWithFilteredResult(_0x3a6ce0,_0x1579f9){return function(_0x3d939a){if(_0x3d939a){var _0x2914d8=typeof _0x1579f9[_0x5572('0x1e')]===_0x5572('0x1f')&&typeof _0x1579f9[_0x5572('0x20')]===_0x5572('0x1f');var _0x907b01=_0x3d939a[_0x5572('0x21')];var _0x542c8b=_0x2914d8?0x0:_0x1579f9[_0x5572('0x1e')];var _0x2e4121=_0x2914d8?_0x3d939a[_0x5572('0x21')]:_0x1579f9['offset']+_0x1579f9['limit'];var _0x5e8759;if(_0x2e4121>=_0x907b01){_0x2e4121=_0x907b01;_0x5e8759=0xc8;}else{_0x5e8759=0xce;}_0x3a6ce0['status'](_0x5e8759);return _0x3a6ce0['set']('Content-Range',_0x542c8b+'-'+_0x2e4121+'/'+_0x907b01)['json'](_0x3d939a);}return null;};}function patchUpdates(_0x368a98){return function(_0x25c00c){try{jsonpatch['apply'](_0x25c00c,_0x368a98,!![]);}catch(_0x3e744a){return BPromise[_0x5572('0x22')](_0x3e744a);}return _0x25c00c['save']();};}function saveUpdates(_0x34fc5d,_0x87a169){return function(_0x1137e4){if(_0x1137e4){return _0x1137e4[_0x5572('0x23')](_0x34fc5d)[_0x5572('0x24')](function(_0xc282d2){return _0xc282d2;});}return null;};}function removeEntity(_0x51f496,_0x2d02e2){return function(_0x590e41){if(_0x590e41){return _0x590e41[_0x5572('0x25')]()['then'](function(){var _0x3b6e79=_0x590e41[_0x5572('0x26')]({'plain':!![]});var _0x551270=_0x5572('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x551270,'resourceId':_0x3b6e79['id']}})[_0x5572('0x24')](function(){return _0x590e41;});})[_0x5572('0x24')](function(){_0x51f496[_0x5572('0x1b')](0xcc)[_0x5572('0x1c')]();});}};}function handleEntityNotFound(_0x3fb757,_0x29c7e8){return function(_0xf9b0d2){if(!_0xf9b0d2){_0x3fb757[_0x5572('0x1a')](0x194);}return _0xf9b0d2;};}function handleError(_0x29346b,_0x14e564){_0x14e564=_0x14e564||0x1f4;return function(_0x24efae){logger[_0x5572('0x28')](_0x24efae['stack']);if(_0x24efae[_0x5572('0x29')]){delete _0x24efae[_0x5572('0x29')];}_0x29346b[_0x5572('0x1b')](_0x14e564)[_0x5572('0x2a')](_0x24efae);};}exports[_0x5572('0x2b')]=function(_0x89f942,_0xa877aa){var _0x3a579e={},_0x2ab362={},_0x3cbbfc={'count':0x0,'rows':[]};var _0x2a7bae=_[_0x5572('0x2c')](db[_0x5572('0x2d')][_0x5572('0x2e')],function(_0x42b241){return{'name':_0x42b241[_0x5572('0x2f')],'type':_0x42b241['type'][_0x5572('0x30')]};});_0x2ab362[_0x5572('0x31')]=_[_0x5572('0x2c')](_0x2a7bae,_0x5572('0x29'));_0x2ab362[_0x5572('0x32')]=_[_0x5572('0x33')](_0x89f942['query']);_0x2ab362[_0x5572('0x34')]=_['intersection'](_0x2ab362['model'],_0x2ab362['query']);_0x3a579e[_0x5572('0x35')]=_['intersection'](_0x2ab362['model'],qs[_0x5572('0x36')](_0x89f942[_0x5572('0x32')]['fields']));_0x3a579e[_0x5572('0x35')]=_0x3a579e[_0x5572('0x35')][_0x5572('0x37')]?_0x3a579e[_0x5572('0x35')]:_0x2ab362[_0x5572('0x31')];if(!_0x89f942[_0x5572('0x32')]['hasOwnProperty'](_0x5572('0x38'))){_0x3a579e[_0x5572('0x20')]=qs[_0x5572('0x20')](_0x89f942['query'][_0x5572('0x20')]);_0x3a579e['offset']=qs[_0x5572('0x1e')](_0x89f942[_0x5572('0x32')][_0x5572('0x1e')]);}_0x3a579e['order']=qs[_0x5572('0x39')](_0x89f942[_0x5572('0x32')]['sort']);_0x3a579e[_0x5572('0x3a')]=qs[_0x5572('0x34')](_[_0x5572('0x3b')](_0x89f942['query'],_0x2ab362[_0x5572('0x34')]),_0x2a7bae);if(_0x89f942['query'][_0x5572('0x3c')]){_0x3a579e[_0x5572('0x3a')]=_[_0x5572('0x3d')](_0x3a579e[_0x5572('0x3a')],{'$or':_['map'](_0x2a7bae,function(_0x36cc6f){if(_0x36cc6f[_0x5572('0x3e')]!==_0x5572('0x3f')){var _0x31d4dc={};_0x31d4dc[_0x36cc6f['name']]={'$like':'%'+_0x89f942['query'][_0x5572('0x3c')]+'%'};return _0x31d4dc;}})});}_0x3a579e=_[_0x5572('0x3d')]({},_0x3a579e,_0x89f942[_0x5572('0x40')]);var _0x3654a5={'where':_0x3a579e[_0x5572('0x3a')]};return db[_0x5572('0x2d')][_0x5572('0x21')](_0x3654a5)[_0x5572('0x24')](function(_0xf47b47){_0x3cbbfc[_0x5572('0x21')]=_0xf47b47;if(_0x89f942[_0x5572('0x32')]['includeAll']){_0x3a579e[_0x5572('0x41')]=[{'all':!![]}];}return db[_0x5572('0x2d')][_0x5572('0x42')](_0x3a579e);})[_0x5572('0x24')](function(_0x20d122){_0x3cbbfc[_0x5572('0x43')]=_0x20d122;return _0x3cbbfc;})[_0x5572('0x24')](respondWithFilteredResult(_0xa877aa,_0x3a579e))['catch'](handleError(_0xa877aa,null));};exports[_0x5572('0x44')]=function(_0x5d48f4,_0x1f2572){var _0x4b804d={'raw':!![],'where':{'id':_0x5d48f4[_0x5572('0x45')]['id']}},_0x1baa1e={};_0x1baa1e[_0x5572('0x31')]=_[_0x5572('0x33')](db['Interval']['rawAttributes']);_0x1baa1e[_0x5572('0x32')]=_[_0x5572('0x33')](_0x5d48f4[_0x5572('0x32')]);_0x1baa1e[_0x5572('0x34')]=_[_0x5572('0x46')](_0x1baa1e[_0x5572('0x31')],_0x1baa1e[_0x5572('0x32')]);_0x4b804d[_0x5572('0x35')]=_[_0x5572('0x46')](_0x1baa1e[_0x5572('0x31')],qs[_0x5572('0x36')](_0x5d48f4['query'][_0x5572('0x36')]));_0x4b804d[_0x5572('0x35')]=_0x4b804d[_0x5572('0x35')][_0x5572('0x37')]?_0x4b804d[_0x5572('0x35')]:_0x1baa1e[_0x5572('0x31')];if(_0x5d48f4[_0x5572('0x32')][_0x5572('0x47')]){_0x4b804d['include']=[{'all':!![]}];}_0x4b804d=_[_0x5572('0x3d')]({},_0x4b804d,_0x5d48f4[_0x5572('0x40')]);return db[_0x5572('0x2d')][_0x5572('0x48')](_0x4b804d)[_0x5572('0x24')](handleEntityNotFound(_0x1f2572,null))[_0x5572('0x24')](respondWithResult(_0x1f2572,null))[_0x5572('0x49')](handleError(_0x1f2572,null));};exports['create']=function(_0x5077a0,_0x4056f9){return db[_0x5572('0x2d')][_0x5572('0x4a')](_0x5077a0[_0x5572('0x4b')],{})[_0x5572('0x24')](function(_0x468792){var _0x38f520=_0x5077a0[_0x5572('0x4c')]['get']({'plain':!![]});if(!_0x38f520)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38f520[_0x5572('0x4d')]===_0x5572('0x4c')){var _0xeb47d7=_0x468792[_0x5572('0x26')]({'plain':!![]});var _0x24d5b3=_0x5572('0x27');return db['UserProfileSection'][_0x5572('0x48')]({'where':{'name':_0x24d5b3,'userProfileId':_0x38f520[_0x5572('0x4e')]},'raw':!![]})[_0x5572('0x24')](function(_0x521552){if(_0x521552&&_0x521552[_0x5572('0x4f')]===0x0){return db[_0x5572('0x50')][_0x5572('0x4a')]({'name':_0xeb47d7['name'],'resourceId':_0xeb47d7['id'],'type':_0x521552['name'],'sectionId':_0x521552['id']},{})['then'](function(){return _0x468792;});}else{return _0x468792;}})[_0x5572('0x49')](function(_0x2fc09e){logger[_0x5572('0x28')](_0x5572('0x51'),_0x2fc09e);throw _0x2fc09e;});}return _0x468792;})[_0x5572('0x24')](respondWithResult(_0x4056f9,0xc9))[_0x5572('0x49')](handleError(_0x4056f9,null));};exports['update']=function(_0xed2d87,_0x333725){if(_0xed2d87['body']['id']){delete _0xed2d87['body']['id'];}return db[_0x5572('0x2d')][_0x5572('0x48')]({'where':{'id':_0xed2d87[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x333725,null))[_0x5572('0x24')](saveUpdates(_0xed2d87[_0x5572('0x4b')],null))[_0x5572('0x24')](respondWithResult(_0x333725,null))[_0x5572('0x49')](handleError(_0x333725,null));};exports[_0x5572('0x25')]=function(_0x1025dd,_0x449313){return db[_0x5572('0x2d')][_0x5572('0x48')]({'where':{'id':_0x1025dd[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x449313,null))[_0x5572('0x24')](removeEntity(_0x449313,null))[_0x5572('0x49')](handleError(_0x449313,null));};exports[_0x5572('0x52')]=function(_0x1083bc,_0x35b209,_0xa705c0){if(_0x1083bc[_0x5572('0x4b')]['id']){delete _0x1083bc[_0x5572('0x4b')]['id'];}return db[_0x5572('0x2d')]['find']({'where':{'id':_0x1083bc[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x35b209,null))[_0x5572('0x24')](function(_0x3eb9f8){if(_0x3eb9f8){_0x1083bc[_0x5572('0x4b')][_0x5572('0x53')]=_0x3eb9f8['id'];return db[_0x5572('0x2d')][_0x5572('0x4a')](_0x1083bc[_0x5572('0x4b')]);}})[_0x5572('0x24')](respondWithResult(_0x35b209,null))['catch'](handleError(_0x35b209,null));};exports[_0x5572('0x54')]=function(_0x17fdf9,_0x4f99be,_0x1c4e61){var _0x3c3414={};var _0x16a04b={};var _0x100260;var _0x31eb85;return db[_0x5572('0x2d')][_0x5572('0x55')]({'where':{'id':_0x17fdf9[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x4f99be,null))[_0x5572('0x24')](function(_0x58fc4c){if(_0x58fc4c){_0x100260=_0x58fc4c;_0x16a04b[_0x5572('0x31')]=_[_0x5572('0x33')](db[_0x5572('0x2d')][_0x5572('0x2e')]);_0x16a04b[_0x5572('0x32')]=_[_0x5572('0x33')](_0x17fdf9[_0x5572('0x32')]);_0x16a04b[_0x5572('0x34')]=_[_0x5572('0x46')](_0x16a04b[_0x5572('0x31')],_0x16a04b['query']);_0x3c3414[_0x5572('0x35')]=_[_0x5572('0x46')](_0x16a04b['model'],qs['fields'](_0x17fdf9[_0x5572('0x32')]['fields']));_0x3c3414['attributes']=_0x3c3414['attributes'][_0x5572('0x37')]?_0x3c3414[_0x5572('0x35')]:_0x16a04b['model'];_0x3c3414['order']=qs['sort'](_0x17fdf9[_0x5572('0x32')]['sort']);_0x3c3414[_0x5572('0x3a')]=qs[_0x5572('0x34')](_[_0x5572('0x3b')](_0x17fdf9[_0x5572('0x32')],_0x16a04b[_0x5572('0x34')]));if(_0x17fdf9[_0x5572('0x32')][_0x5572('0x3c')]){_0x3c3414[_0x5572('0x3a')]=_['merge'](_0x3c3414[_0x5572('0x3a')],{'$or':_[_0x5572('0x2c')](_0x3c3414['attributes'],function(_0x298684){var _0x291e09={};_0x291e09[_0x298684]={'$like':'%'+_0x17fdf9['query']['filter']+'%'};return _0x291e09;})});}_0x3c3414=_[_0x5572('0x3d')]({},_0x3c3414,_0x17fdf9['options']);return _0x100260[_0x5572('0x54')](_0x3c3414);}})['then'](function(_0x202ca8){if(_0x202ca8){_0x31eb85=_0x202ca8[_0x5572('0x37')];if(!_0x17fdf9[_0x5572('0x32')][_0x5572('0x56')](_0x5572('0x38'))){_0x3c3414['limit']=qs['limit'](_0x17fdf9['query']['limit']);_0x3c3414[_0x5572('0x1e')]=qs['offset'](_0x17fdf9[_0x5572('0x32')][_0x5572('0x1e')]);}return _0x100260['getIntervals'](_0x3c3414);}})[_0x5572('0x24')](function(_0x5541eb){if(_0x5541eb){return _0x5541eb?{'count':_0x31eb85,'rows':_0x5541eb}:null;}})[_0x5572('0x24')](respondWithResult(_0x4f99be,null))[_0x5572('0x49')](handleError(_0x4f99be,null));};exports[_0x5572('0x57')]=function(_0x5bbd8f,_0x209b64,_0x310eeb){return db[_0x5572('0x2d')]['findOne']({'where':{'id':_0x5bbd8f['params']['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x209b64,null))[_0x5572('0x24')](function(_0xd45e2c){if(_0xd45e2c){return db[_0x5572('0x58')][_0x5572('0x59')](function(_0x205d06){return db['Interval'][_0x5572('0x25')]({'where':{'IntervalId':_0x5bbd8f[_0x5572('0x45')]['id']},'transaction':_0x205d06})[_0x5572('0x24')](function(_0x11978c){var _0x3deb25=_[_0x5572('0x2c')](_0x5bbd8f[_0x5572('0x4b')],function(_0x1a27ea){delete _0x1a27ea['id'];_0x1a27ea[_0x5572('0x53')]=_0x5bbd8f[_0x5572('0x45')]['id'];return _0x1a27ea;});return db[_0x5572('0x2d')][_0x5572('0x5a')](_0x3deb25,{'transaction':_0x205d06});});})[_0x5572('0x24')](function(){return db[_0x5572('0x2d')]['findAll']({'where':{'IntervalId':_0x5bbd8f['params']['id']}});});}})[_0x5572('0x24')](respondWithResult(_0x209b64,null))[_0x5572('0x49')](handleError(_0x209b64,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 85ec9b3..0f8e9e1 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 _0xdade=['tools_intervals','rewrite','util','../../config/logger','bluebird','request-promise','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval'];(function(_0x24031c,_0x1f7f2d){var _0x17fad1=function(_0x539498){while(--_0x539498){_0x24031c['push'](_0x24031c['shift']());}};_0x17fad1(++_0x1f7f2d);}(_0xdade,0x13a));var _0xedad=function(_0x16ec9d,_0x36ac5d){_0x16ec9d=_0x16ec9d-0x0;var _0x1e98b=_0xdade[_0x16ec9d];return _0x1e98b;};'use strict';var _=require('lodash');var util=require(_0xedad('0x0'));var logger=require(_0xedad('0x1'))('api');var moment=require('moment');var BPromise=require(_0xedad('0x2'));var rp=require(_0xedad('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedad('0x4'));var config=require('../../config/environment');var attributes=require(_0xedad('0x5'));var extensions=require(_0xedad('0x6'));module[_0xedad('0x7')]=function(_0x4e6ce0,_0x41d9d2){return _0x4e6ce0[_0xedad('0x8')](_0xedad('0x9'),attributes,{'tableName':_0xedad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49f230,_0x5beecd){extensions[_0xedad('0xb')](_0x4e6ce0,_0x49f230);},'afterBulkCreate':function(_0x1e138c,_0x3d34ef,_0x3e6026){_0x3e6026();extensions[_0xedad('0xb')](_0x4e6ce0,_0x1e138c[0x0]);},'afterUpdate':function(_0xc7614f,_0x4ff842){extensions[_0xedad('0xb')](_0x4e6ce0,_0xc7614f);},'afterDestroy':function(_0x4a67b5,_0x4efd72){extensions['rewrite'](_0x4e6ce0,_0x4a67b5);}}});}; \ No newline at end of file +var _0xa772=['define','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x331622,_0x573abb){var _0x1a98f2=function(_0x2ccb69){while(--_0x2ccb69){_0x331622['push'](_0x331622['shift']());}};_0x1a98f2(++_0x573abb);}(_0xa772,0x1b2));var _0x2a77=function(_0x4b416c,_0x53ef9e){_0x4b416c=_0x4b416c-0x0;var _0x2037fa=_0xa772[_0x4b416c];return _0x2037fa;};'use strict';var _=require('lodash');var util=require(_0x2a77('0x0'));var logger=require(_0x2a77('0x1'))(_0x2a77('0x2'));var moment=require(_0x2a77('0x3'));var BPromise=require(_0x2a77('0x4'));var rp=require(_0x2a77('0x5'));var fs=require('fs');var path=require(_0x2a77('0x6'));var rimraf=require('rimraf');var config=require(_0x2a77('0x7'));var attributes=require(_0x2a77('0x8'));var extensions=require(_0x2a77('0x9'));module['exports']=function(_0x2c3588,_0x16c2c0){return _0x2c3588[_0x2a77('0xa')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x340aba,_0x1ff7dd){extensions[_0x2a77('0xb')](_0x2c3588,_0x340aba);},'afterBulkCreate':function(_0x2e620a,_0x2a2708,_0x29b823){_0x29b823();extensions[_0x2a77('0xb')](_0x2c3588,_0x2e620a[0x0]);},'afterUpdate':function(_0xddab4b,_0x11b7ff){extensions[_0x2a77('0xb')](_0x2c3588,_0xddab4b);},'afterDestroy':function(_0x4a833b,_0x191d54){extensions['rewrite'](_0x2c3588,_0x4a833b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b258f2b..9fc189d 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2ceb73c..3909c75 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x24c733,_0x525907){var _0x21a2d3=function(_0x2bbf39){while(--_0x2bbf39){_0x24c733['push'](_0x24c733['shift']());}};_0x21a2d3(++_0x525907);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10754f,_0x13a33a){_0x10754f=_0x10754f-0x0;var _0x53ddc7=_0x5f2f[_0x10754f];return _0x53ddc7;};'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 +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x45d43a,_0x71b8e){var _0x6e29f7=function(_0x5f4ce4){while(--_0x5f4ce4){_0x45d43a['push'](_0x45d43a['shift']());}};_0x6e29f7(++_0x71b8e);}(_0x2ef3,0xba));var _0x32ef=function(_0x223136,_0x28861a){_0x223136=_0x223136-0x0;var _0x4abdda=_0x2ef3[_0x223136];return _0x4abdda;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index d6361a9..65bf0de 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 _0xdddf=['connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','oldToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for'];(function(_0x1a11e0,_0x11b9d8){var _0x25169c=function(_0x2b3d62){while(--_0x2b3d62){_0x1a11e0['push'](_0x1a11e0['shift']());}};_0x25169c(++_0x11b9d8);}(_0xdddf,0x14c));var _0xfddd=function(_0x3d2994,_0x1f3dbb){_0x3d2994=_0x3d2994-0x0;var _0x37b35c=_0xdddf[_0x3d2994];return _0x37b35c;};'use strict';var BPromise=require(_0xfddd('0x0'));var https=require(_0xfddd('0x1'));var logger=require(_0xfddd('0x2'))(_0xfddd('0x3'));var USERNAME=_0xfddd('0x4');var PASSWORD=_0xfddd('0x5');function openIssue(_0x3368bc,_0x562c5b){var _0x2e39f9={'fields':{'project':{'key':_0x3368bc['key']||_0xfddd('0x6')},'summary':(_0x3368bc['summary']||_0xfddd('0x7'))+_0xfddd('0x8')+_0x3368bc['ip'],'description':_0x3368bc[_0xfddd('0x9')]||JSON[_0xfddd('0xa')](_0x3368bc),'issuetype':{'name':_0x3368bc['issuetype']||_0xfddd('0xb')}}};_0x2e39f9[_0xfddd('0xc')][_0xfddd('0xd')]=_0x3368bc[_0xfddd('0xe')];_0x2e39f9[_0xfddd('0xc')]['customfield_11501']=_0x3368bc[_0xfddd('0xf')];_0x2e39f9[_0xfddd('0xc')]['customfield_11502']=_0x3368bc['newToken'];_0x2e39f9['fields']['customfield_11503']=_0x3368bc[_0xfddd('0x10')];_0x2e39f9[_0xfddd('0xc')][_0xfddd('0x11')]=_0x3368bc[_0xfddd('0x12')];_0x2e39f9[_0xfddd('0xc')][_0xfddd('0x13')]=_0x3368bc['ip'];var _0x103758={'host':_0xfddd('0x14'),'port':0x1bb,'path':_0xfddd('0x15'),'method':_0xfddd('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xfddd('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xfddd('0x18')]('base64')}};var _0x394c12=JSON[_0xfddd('0xa')](_0x2e39f9);var _0xe0522b=https['request'](_0x103758,function(_0x1d1d95){_0x1d1d95['setEncoding']('utf8');var _0x6ad913='';_0x1d1d95['on']('data',function(_0x49b23f){_0x6ad913+=_0x49b23f;});_0x1d1d95['on'](_0xfddd('0x19'),function(){if(_0x562c5b){return _0x562c5b[_0xfddd('0x1a')](_0x1d1d95[_0xfddd('0x1b')])[_0xfddd('0x1c')](JSON['parse'](_0x6ad913));}});});_0xe0522b['on'](_0xfddd('0x1d'),function(_0x8a4a7d){if(_0x562c5b){return _0x562c5b['status'](0x1f4)[_0xfddd('0x1c')]({'errors':[{'message':_0xfddd('0x1e'),'type':_0xfddd('0x1f')}]});}});_0xe0522b[_0xfddd('0x20')](_0x394c12);_0xe0522b['end']();}exports[_0xfddd('0x21')]=openIssue;exports[_0xfddd('0x22')]=function(_0x1fc88f,_0x2d11a7){_0x1fc88f['body']['ip']=_0x1fc88f[_0xfddd('0x23')][_0xfddd('0x24')]||_0x1fc88f[_0xfddd('0x25')][_0xfddd('0x26')]||_0x1fc88f['socket'][_0xfddd('0x26')]||_0x1fc88f[_0xfddd('0x25')][_0xfddd('0x27')][_0xfddd('0x26')];return openIssue(_0x1fc88f[_0xfddd('0x28')],_0x2d11a7);}; \ No newline at end of file +var _0x993b=['https','../../config/logger','api','support','3eAmWpBVP0','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird'];(function(_0x54fe3c,_0x3ba4d8){var _0xde196e=function(_0x9dbe82){while(--_0x9dbe82){_0x54fe3c['push'](_0x54fe3c['shift']());}};_0xde196e(++_0x3ba4d8);}(_0x993b,0xea));var _0xb993=function(_0x356ac0,_0x254958){_0x356ac0=_0x356ac0-0x0;var _0x3d5ecf=_0x993b[_0x356ac0];return _0x3d5ecf;};'use strict';var BPromise=require(_0xb993('0x0'));var https=require(_0xb993('0x1'));var logger=require(_0xb993('0x2'))(_0xb993('0x3'));var USERNAME=_0xb993('0x4');var PASSWORD=_0xb993('0x5');function openIssue(_0x55acbc,_0x289941){var _0x2df29a={'fields':{'project':{'key':_0x55acbc['key']||'MOTGUI'},'summary':(_0x55acbc[_0xb993('0x6')]||'Report')+_0xb993('0x7')+_0x55acbc['ip'],'description':_0x55acbc[_0xb993('0x8')]||JSON[_0xb993('0x9')](_0x55acbc),'issuetype':{'name':_0x55acbc[_0xb993('0xa')]||_0xb993('0xb')}}};_0x2df29a[_0xb993('0xc')][_0xb993('0xd')]=_0x55acbc['email'];_0x2df29a[_0xb993('0xc')][_0xb993('0xe')]=_0x55acbc[_0xb993('0xf')];_0x2df29a[_0xb993('0xc')][_0xb993('0x10')]=_0x55acbc[_0xb993('0x11')];_0x2df29a['fields'][_0xb993('0x12')]=_0x55acbc[_0xb993('0x13')];_0x2df29a[_0xb993('0xc')][_0xb993('0x14')]=_0x55acbc[_0xb993('0x15')];_0x2df29a[_0xb993('0xc')][_0xb993('0x16')]=_0x55acbc['ip'];var _0x48361c={'host':_0xb993('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xb993('0x18'),'Authorization':_0xb993('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xb993('0x1a')](_0xb993('0x1b'))}};var _0x35984e=JSON[_0xb993('0x9')](_0x2df29a);var _0x257fe9=https[_0xb993('0x1c')](_0x48361c,function(_0x228f2d){_0x228f2d[_0xb993('0x1d')](_0xb993('0x1e'));var _0x1634bf='';_0x228f2d['on'](_0xb993('0x1f'),function(_0xe891f4){_0x1634bf+=_0xe891f4;});_0x228f2d['on']('end',function(){if(_0x289941){return _0x289941[_0xb993('0x20')](_0x228f2d[_0xb993('0x21')])[_0xb993('0x22')](JSON[_0xb993('0x23')](_0x1634bf));}});});_0x257fe9['on'](_0xb993('0x24'),function(_0x419f98){if(_0x289941){return _0x289941[_0xb993('0x20')](0x1f4)[_0xb993('0x22')]({'errors':[{'message':_0xb993('0x25'),'type':_0xb993('0x26')}]});}});_0x257fe9[_0xb993('0x27')](_0x35984e);_0x257fe9['end']();}exports[_0xb993('0x28')]=openIssue;exports['send']=function(_0x32f9f0,_0xa1eb24){_0x32f9f0[_0xb993('0x29')]['ip']=_0x32f9f0[_0xb993('0x2a')][_0xb993('0x2b')]||_0x32f9f0[_0xb993('0x2c')][_0xb993('0x2d')]||_0x32f9f0['socket']['remoteAddress']||_0x32f9f0[_0xb993('0x2c')][_0xb993('0x2e')][_0xb993('0x2d')];return openIssue(_0x32f9f0[_0xb993('0x29')],_0xa1eb24);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d9e87cf..456b561 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 _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x1de21f,_0x44c385){var _0x19d9e1=function(_0x369e20){while(--_0x369e20){_0x1de21f['push'](_0x1de21f['shift']());}};_0x19d9e1(++_0x44c385);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xcb91[_0x3f6b1b];return _0x4a3d2b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x153f=['Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xdfa30d,_0x3c4d7c){var _0x1c2061=function(_0x3ae1ec){while(--_0x3ae1ec){_0xdfa30d['push'](_0xdfa30d['shift']());}};_0x1c2061(++_0x3c4d7c);}(_0x153f,0x15b));var _0xf153=function(_0x1d7ce6,_0x479c93){_0x1d7ce6=_0x1d7ce6-0x0;var _0x4ed978=_0x153f[_0x1d7ce6];return _0x4ed978;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router[_0xf153('0x13')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);module[_0xf153('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 60a76f3..70dd640 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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x2baf63,_0x2bcf27){_0x2baf63=_0x2baf63-0x0;var _0x2cc5c8=_0x7a54[_0x2baf63];return _0x2cc5c8;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x246998,_0x2a57de){_0x246998=_0x246998-0x0;var _0xd66b79=_0x7a54[_0x246998];return _0xd66b79;};'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 c132af9..297b9cd 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 _0xf95f=['JscriptyAnswerReport','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','params','rawAttributes','intersection','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x4f58e8,_0x35184b){var _0xbf64bf=function(_0x4f2828){while(--_0x4f2828){_0x4f58e8['push'](_0x4f58e8['shift']());}};_0xbf64bf(++_0x35184b);}(_0xf95f,0x142));var _0xff95=function(_0x3e478c,_0x3afee8){_0x3e478c=_0x3e478c-0x0;var _0x3a0906=_0xf95f[_0x3e478c];return _0x3a0906;};'use strict';var emlformat=require(_0xff95('0x0'));var rimraf=require(_0xff95('0x1'));var zipdir=require(_0xff95('0x2'));var jsonpatch=require(_0xff95('0x3'));var rp=require(_0xff95('0x4'));var moment=require(_0xff95('0x5'));var BPromise=require(_0xff95('0x6'));var Mustache=require(_0xff95('0x7'));var util=require(_0xff95('0x8'));var path=require('path');var sox=require(_0xff95('0x9'));var csv=require('to-csv');var ejs=require(_0xff95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff95('0xb'));var squel=require(_0xff95('0xc'));var crypto=require(_0xff95('0xd'));var jsforce=require(_0xff95('0xe'));var deskjs=require(_0xff95('0xf'));var toCsv=require(_0xff95('0x10'));var querystring=require(_0xff95('0x11'));var Papa=require(_0xff95('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff95('0x13'));var as=require(_0xff95('0x14'));var hardwareService=require(_0xff95('0x15'));var logger=require(_0xff95('0x16'))(_0xff95('0x17'));var utils=require(_0xff95('0x18'));var config=require(_0xff95('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30fb50,_0x247ab0){_0x247ab0=_0x247ab0||0xcc;return function(_0x548a12){if(_0x548a12){return _0x30fb50[_0xff95('0x1a')](_0x247ab0);}return _0x30fb50['status'](_0x247ab0)['end']();};}function respondWithResult(_0x5d8005,_0x1f0011){_0x1f0011=_0x1f0011||0xc8;return function(_0x27a82b){if(_0x27a82b){return _0x5d8005[_0xff95('0x1b')](_0x1f0011)[_0xff95('0x1c')](_0x27a82b);}};}function respondWithFilteredResult(_0x28a795,_0x399d87){return function(_0x52d55b){if(_0x52d55b){var _0x5a8f0b=typeof _0x399d87[_0xff95('0x1d')]===_0xff95('0x1e')&&typeof _0x399d87[_0xff95('0x1f')]===_0xff95('0x1e');var _0x21697b=_0x52d55b[_0xff95('0x20')];var _0x56e19e=_0x5a8f0b?0x0:_0x399d87[_0xff95('0x1d')];var _0x10cfe5=_0x5a8f0b?_0x52d55b[_0xff95('0x20')]:_0x399d87['offset']+_0x399d87['limit'];var _0x306d27;if(_0x10cfe5>=_0x21697b){_0x10cfe5=_0x21697b;_0x306d27=0xc8;}else{_0x306d27=0xce;}_0x28a795['status'](_0x306d27);return _0x28a795[_0xff95('0x21')](_0xff95('0x22'),_0x56e19e+'-'+_0x10cfe5+'/'+_0x21697b)[_0xff95('0x1c')](_0x52d55b);}return null;};}function patchUpdates(_0x40ebfd){return function(_0x134b3c){try{jsonpatch[_0xff95('0x23')](_0x134b3c,_0x40ebfd,!![]);}catch(_0x4aa9ee){return BPromise[_0xff95('0x24')](_0x4aa9ee);}return _0x134b3c[_0xff95('0x25')]();};}function saveUpdates(_0x2a1248,_0x188bad){return function(_0x5181de){if(_0x5181de){return _0x5181de[_0xff95('0x26')](_0x2a1248)[_0xff95('0x27')](function(_0x392173){return _0x392173;});}return null;};}function removeEntity(_0x72e477,_0x2a02ff){return function(_0x416291){if(_0x416291){return _0x416291[_0xff95('0x28')]()[_0xff95('0x27')](function(){_0x72e477[_0xff95('0x1b')](0xcc)[_0xff95('0x29')]();});}};}function handleEntityNotFound(_0x4e7e5e,_0x512b56){return function(_0x50a5c2){if(!_0x50a5c2){_0x4e7e5e['sendStatus'](0x194);}return _0x50a5c2;};}function handleError(_0x2e0aed,_0x1a45cd){_0x1a45cd=_0x1a45cd||0x1f4;return function(_0x373ce7){logger[_0xff95('0x2a')](_0x373ce7[_0xff95('0x2b')]);if(_0x373ce7['name']){delete _0x373ce7[_0xff95('0x2c')];}_0x2e0aed[_0xff95('0x1b')](_0x1a45cd)[_0xff95('0x2d')](_0x373ce7);};}exports[_0xff95('0x2e')]=function(_0x2528a4,_0x146d21){var _0x512e5b={},_0x35834a={},_0x2c0f2c={'count':0x0,'rows':[]};var _0x586956=_[_0xff95('0x2f')](db[_0xff95('0x30')]['rawAttributes'],function(_0x3c2919){return{'name':_0x3c2919['fieldName'],'type':_0x3c2919[_0xff95('0x31')]['key']};});_0x35834a['model']=_[_0xff95('0x2f')](_0x586956,_0xff95('0x2c'));_0x35834a[_0xff95('0x32')]=_[_0xff95('0x33')](_0x2528a4[_0xff95('0x32')]);_0x35834a['filters']=_['intersection'](_0x35834a[_0xff95('0x34')],_0x35834a['query']);_0x512e5b[_0xff95('0x35')]=_['intersection'](_0x35834a[_0xff95('0x34')],qs['fields'](_0x2528a4[_0xff95('0x32')][_0xff95('0x36')]));_0x512e5b[_0xff95('0x35')]=_0x512e5b[_0xff95('0x35')][_0xff95('0x37')]?_0x512e5b[_0xff95('0x35')]:_0x35834a[_0xff95('0x34')];if(!_0x2528a4[_0xff95('0x32')][_0xff95('0x38')](_0xff95('0x39'))){_0x512e5b[_0xff95('0x1f')]=qs[_0xff95('0x1f')](_0x2528a4[_0xff95('0x32')][_0xff95('0x1f')]);_0x512e5b[_0xff95('0x1d')]=qs[_0xff95('0x1d')](_0x2528a4[_0xff95('0x32')][_0xff95('0x1d')]);}_0x512e5b['order']=qs[_0xff95('0x3a')](_0x2528a4[_0xff95('0x32')][_0xff95('0x3a')]);_0x512e5b[_0xff95('0x3b')]=qs[_0xff95('0x3c')](_['pick'](_0x2528a4['query'],_0x35834a[_0xff95('0x3c')]),_0x586956);if(_0x2528a4[_0xff95('0x32')][_0xff95('0x3d')]){_0x512e5b[_0xff95('0x3b')]=_['merge'](_0x512e5b[_0xff95('0x3b')],{'$or':_[_0xff95('0x2f')](_0x586956,function(_0x1a673b){if(_0x1a673b['type']!==_0xff95('0x3e')){var _0x2ee31e={};_0x2ee31e[_0x1a673b[_0xff95('0x2c')]]={'$like':'%'+_0x2528a4[_0xff95('0x32')][_0xff95('0x3d')]+'%'};return _0x2ee31e;}})});}_0x512e5b=_[_0xff95('0x3f')]({},_0x512e5b,_0x2528a4[_0xff95('0x40')]);var _0x381d6d={'where':_0x512e5b[_0xff95('0x3b')]};return db[_0xff95('0x30')][_0xff95('0x20')](_0x381d6d)[_0xff95('0x27')](function(_0x44b5db){_0x2c0f2c[_0xff95('0x20')]=_0x44b5db;if(_0x2528a4['query']['includeAll']){_0x512e5b['include']=[{'all':!![]}];}return db[_0xff95('0x30')]['findAll'](_0x512e5b);})['then'](function(_0x482f91){_0x2c0f2c['rows']=_0x482f91;return _0x2c0f2c;})[_0xff95('0x27')](respondWithFilteredResult(_0x146d21,_0x512e5b))['catch'](handleError(_0x146d21,null));};exports['show']=function(_0x2af75a,_0x155cfa){var _0x42c5ac={'raw':!![],'where':{'id':_0x2af75a[_0xff95('0x41')]['id']}},_0x3bdf94={};_0x3bdf94['model']=_['keys'](db[_0xff95('0x30')][_0xff95('0x42')]);_0x3bdf94[_0xff95('0x32')]=_['keys'](_0x2af75a[_0xff95('0x32')]);_0x3bdf94[_0xff95('0x3c')]=_[_0xff95('0x43')](_0x3bdf94[_0xff95('0x34')],_0x3bdf94['query']);_0x42c5ac[_0xff95('0x35')]=_['intersection'](_0x3bdf94[_0xff95('0x34')],qs[_0xff95('0x36')](_0x2af75a['query'][_0xff95('0x36')]));_0x42c5ac[_0xff95('0x35')]=_0x42c5ac[_0xff95('0x35')][_0xff95('0x37')]?_0x42c5ac[_0xff95('0x35')]:_0x3bdf94[_0xff95('0x34')];if(_0x2af75a[_0xff95('0x32')][_0xff95('0x44')]){_0x42c5ac['include']=[{'all':!![]}];}_0x42c5ac=_[_0xff95('0x3f')]({},_0x42c5ac,_0x2af75a[_0xff95('0x40')]);return db[_0xff95('0x30')][_0xff95('0x45')](_0x42c5ac)[_0xff95('0x27')](handleEntityNotFound(_0x155cfa,null))[_0xff95('0x27')](respondWithResult(_0x155cfa,null))[_0xff95('0x46')](handleError(_0x155cfa,null));};exports[_0xff95('0x47')]=function(_0xea4810,_0x324788){return db['JscriptyAnswerReport']['create'](_0xea4810['body'],{})[_0xff95('0x27')](respondWithResult(_0x324788,0xc9))[_0xff95('0x46')](handleError(_0x324788,null));};exports[_0xff95('0x26')]=function(_0x43a7de,_0x385b61){if(_0x43a7de['body']['id']){delete _0x43a7de[_0xff95('0x48')]['id'];}return db[_0xff95('0x30')][_0xff95('0x45')]({'where':{'id':_0x43a7de[_0xff95('0x41')]['id']}})['then'](handleEntityNotFound(_0x385b61,null))['then'](saveUpdates(_0x43a7de[_0xff95('0x48')],null))['then'](respondWithResult(_0x385b61,null))[_0xff95('0x46')](handleError(_0x385b61,null));};exports[_0xff95('0x28')]=function(_0xebfd0f,_0x5c670a){return db[_0xff95('0x30')][_0xff95('0x45')]({'where':{'id':_0xebfd0f[_0xff95('0x41')]['id']}})[_0xff95('0x27')](handleEntityNotFound(_0x5c670a,null))['then'](removeEntity(_0x5c670a,null))['catch'](handleError(_0x5c670a,null));};exports[_0xff95('0x49')]=function(_0x400f2d,_0x46f06d){return db[_0xff95('0x30')][_0xff95('0x49')]()[_0xff95('0x27')](respondWithResult(_0x46f06d,null))[_0xff95('0x46')](handleError(_0x46f06d,null));}; \ No newline at end of file +var _0x363e=['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','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xe4d7ec,_0x3be166){var _0x34a6a5=function(_0x135362){while(--_0x135362){_0xe4d7ec['push'](_0xe4d7ec['shift']());}};_0x34a6a5(++_0x3be166);}(_0x363e,0x179));var _0xe363=function(_0x1abef0,_0x3274db){_0x1abef0=_0x1abef0-0x0;var _0x438b22=_0x363e[_0x1abef0];return _0x438b22;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['JscriptyAnswerReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 85c0a74..b9d1ac5 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 _0xa4ff=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util'];(function(_0x5ed099,_0x304e8a){var _0x46e1d7=function(_0x2b57f1){while(--_0x2b57f1){_0x5ed099['push'](_0x5ed099['shift']());}};_0x46e1d7(++_0x304e8a);}(_0xa4ff,0x19f));var _0xfa4f=function(_0x12d095,_0x85233f){_0x12d095=_0x12d095-0x0;var _0x16081d=_0xa4ff[_0x12d095];return _0x16081d;};'use strict';var _=require('lodash');var util=require(_0xfa4f('0x0'));var logger=require(_0xfa4f('0x1'))(_0xfa4f('0x2'));var moment=require(_0xfa4f('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa4f('0x4'));var fs=require('fs');var path=require(_0xfa4f('0x5'));var rimraf=require(_0xfa4f('0x6'));var config=require(_0xfa4f('0x7'));var attributes=require(_0xfa4f('0x8'));module[_0xfa4f('0x9')]=function(_0x73c43e,_0x5e9ccb){return _0x73c43e[_0xfa4f('0xa')](_0xfa4f('0xb'),attributes,{'tableName':_0xfa4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x041c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x30079b,_0x3833cd){var _0x42bdd3=function(_0x5952fa){while(--_0x5952fa){_0x30079b['push'](_0x30079b['shift']());}};_0x42bdd3(++_0x3833cd);}(_0x041c,0x8a));var _0xc041=function(_0x3389ba,_0x3284b1){_0x3389ba=_0x3389ba-0x0;var _0x5515e2=_0x041c[_0x3389ba];return _0x5515e2;};'use strict';var _=require(_0xc041('0x0'));var util=require(_0xc041('0x1'));var logger=require(_0xc041('0x2'))(_0xc041('0x3'));var moment=require(_0xc041('0x4'));var BPromise=require('bluebird');var rp=require(_0xc041('0x5'));var fs=require('fs');var path=require(_0xc041('0x6'));var rimraf=require(_0xc041('0x7'));var config=require(_0xc041('0x8'));var attributes=require(_0xc041('0x9'));module[_0xc041('0xa')]=function(_0x5b8af8,_0x1981e0){return _0x5b8af8[_0xc041('0xb')](_0xc041('0xc'),attributes,{'tableName':_0xc041('0xd'),'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 5c63ef5..b77dc6a 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 _0xa204=['stringify','error','code','message','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12e96a,_0x8bb41f){var _0x18bff7=function(_0x3ae55f){while(--_0x3ae55f){_0x12e96a['push'](_0x12e96a['shift']());}};_0x18bff7(++_0x8bb41f);}(_0xa204,0x1e0));var _0x4a20=function(_0x36afc7,_0x3ef03f){_0x36afc7=_0x36afc7-0x0;var _0x13ab17=_0xa204[_0x36afc7];return _0x13ab17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a20('0x0'));var BPromise=require('bluebird');var rs=require(_0x4a20('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a20('0x2'))['db'];var utils=require(_0x4a20('0x3'));var logger=require(_0x4a20('0x4'))(_0x4a20('0x5'));var config=require(_0x4a20('0x6'));var jayson=require(_0x4a20('0x7'));var client=jayson[_0x4a20('0x8')][_0x4a20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2f6f,_0x52efaa,_0x16b1a2){return new BPromise(function(_0x1ebab1,_0x22273b){return client['request'](_0x2f2f6f,_0x16b1a2)['then'](function(_0x559925){logger[_0x4a20('0xa')](_0x4a20('0xb'),_0x52efaa,_0x4a20('0xc'));logger[_0x4a20('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x52efaa,_0x4a20('0xc'),JSON[_0x4a20('0xe')](_0x559925));if(_0x559925[_0x4a20('0xf')]){if(_0x559925[_0x4a20('0xf')][_0x4a20('0x10')]===0x1f4){logger[_0x4a20('0xf')](_0x4a20('0xb'),_0x52efaa,_0x559925[_0x4a20('0xf')][_0x4a20('0x11')]);return _0x22273b(_0x559925['error'][_0x4a20('0x11')]);}logger['error'](_0x4a20('0xb'),_0x52efaa,_0x559925[_0x4a20('0xf')][_0x4a20('0x11')]);return _0x1ebab1(_0x559925[_0x4a20('0xf')][_0x4a20('0x11')]);}else{logger[_0x4a20('0xa')](_0x4a20('0xb'),_0x52efaa,_0x4a20('0xc'));_0x1ebab1(_0x559925['result']['message']);}})[_0x4a20('0x12')](function(_0x328b50){logger['error'](_0x4a20('0xb'),_0x52efaa,_0x328b50);_0x22273b(_0x328b50);});});} \ No newline at end of file +var _0x5974=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','moment','randomstring'];(function(_0x1610d9,_0x5248b0){var _0x48a47a=function(_0x1e54f5){while(--_0x1e54f5){_0x1610d9['push'](_0x1610d9['shift']());}};_0x48a47a(++_0x5248b0);}(_0x5974,0xe1));var _0x4597=function(_0x59591b,_0x354045){_0x59591b=_0x59591b-0x0;var _0x576642=_0x5974[_0x59591b];return _0x576642;};'use strict';var _=require(_0x4597('0x0'));var util=require('util');var moment=require(_0x4597('0x1'));var BPromise=require('bluebird');var rs=require(_0x4597('0x2'));var fs=require('fs');var Redis=require(_0x4597('0x3'));var db=require(_0x4597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4597('0x5'))('rpc');var config=require(_0x4597('0x6'));var jayson=require(_0x4597('0x7'));var client=jayson[_0x4597('0x8')][_0x4597('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4aea,_0x10e417,_0x59ab16){return new BPromise(function(_0x43b08f,_0x2463d3){return client['request'](_0xca4aea,_0x59ab16)[_0x4597('0xa')](function(_0x991029){logger[_0x4597('0xb')](_0x4597('0xc'),_0x10e417,'request\x20sent');logger[_0x4597('0xd')](_0x4597('0xe'),_0x10e417,_0x4597('0xf'),JSON[_0x4597('0x10')](_0x991029));if(_0x991029['error']){if(_0x991029[_0x4597('0x11')]['code']===0x1f4){logger['error'](_0x4597('0xc'),_0x10e417,_0x991029[_0x4597('0x11')][_0x4597('0x12')]);return _0x2463d3(_0x991029[_0x4597('0x11')]['message']);}logger[_0x4597('0x11')](_0x4597('0xc'),_0x10e417,_0x991029['error'][_0x4597('0x12')]);return _0x43b08f(_0x991029[_0x4597('0x11')][_0x4597('0x12')]);}else{logger['info'](_0x4597('0xc'),_0x10e417,_0x4597('0xf'));_0x43b08f(_0x991029['result']['message']);}})['catch'](function(_0x302f3e){logger[_0x4597('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x10e417,_0x302f3e);_0x2463d3(_0x302f3e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2fc2915..73014e7 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 _0xead7=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','put','update','delete','exports'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0xead7,0x87));var _0x7ead=function(_0x246b23,_0x4383e2){_0x246b23=_0x246b23-0x0;var _0x3f1a07=_0xead7[_0x246b23];return _0x3f1a07;};'use strict';var multer=require(_0x7ead('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7ead('0x1'));var express=require(_0x7ead('0x2'));var router=express[_0x7ead('0x3')]();var fs_extra=require(_0x7ead('0x4'));var auth=require(_0x7ead('0x5'));var interaction=require(_0x7ead('0x6'));var config=require(_0x7ead('0x7'));var controller=require(_0x7ead('0x8'));router[_0x7ead('0x9')]('/',auth[_0x7ead('0xa')](),controller[_0x7ead('0xb')]);router['get'](_0x7ead('0xc'),auth[_0x7ead('0xa')](),controller[_0x7ead('0xd')]);router[_0x7ead('0x9')](_0x7ead('0xe'),auth[_0x7ead('0xa')](),controller[_0x7ead('0xf')]);router['get'](_0x7ead('0x10'),auth[_0x7ead('0xa')](),controller[_0x7ead('0x11')]);router[_0x7ead('0x9')](_0x7ead('0x12'),auth['isAuthenticated'](),timeout(_0x7ead('0x13')),controller['getSummary']);router[_0x7ead('0x14')]('/',auth[_0x7ead('0xa')](),controller[_0x7ead('0x15')]);router[_0x7ead('0x14')](_0x7ead('0x16'),auth[_0x7ead('0xa')](),controller['clone']);router[_0x7ead('0x17')](_0x7ead('0xc'),auth[_0x7ead('0xa')](),controller[_0x7ead('0x18')]);router[_0x7ead('0x19')](_0x7ead('0xc'),auth[_0x7ead('0xa')](),controller['destroy']);module[_0x7ead('0x1a')]=router; \ No newline at end of file +var _0x571d=['getAnswers','/:id/summary','post','create','/:id/clone','clone','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','/:id/answers'];(function(_0x7adaf0,_0x49d6f2){var _0x467057=function(_0x50e030){while(--_0x50e030){_0x7adaf0['push'](_0x7adaf0['shift']());}};_0x467057(++_0x49d6f2);}(_0x571d,0x1d7));var _0xd571=function(_0x4603c6,_0x2012db){_0x4603c6=_0x4603c6-0x0;var _0x233b6e=_0x571d[_0x4603c6];return _0x233b6e;};'use strict';var multer=require(_0xd571('0x0'));var util=require(_0xd571('0x1'));var path=require('path');var timeout=require(_0xd571('0x2'));var express=require('express');var router=express[_0xd571('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd571('0x4'));var config=require(_0xd571('0x5'));var controller=require(_0xd571('0x6'));router[_0xd571('0x7')]('/',auth[_0xd571('0x8')](),controller[_0xd571('0x9')]);router['get'](_0xd571('0xa'),auth[_0xd571('0x8')](),controller['show']);router[_0xd571('0x7')](_0xd571('0xb'),auth['isAuthenticated'](),controller['getSessions']);router[_0xd571('0x7')](_0xd571('0xc'),auth[_0xd571('0x8')](),controller[_0xd571('0xd')]);router[_0xd571('0x7')](_0xd571('0xe'),auth[_0xd571('0x8')](),timeout('30s'),controller['getSummary']);router[_0xd571('0xf')]('/',auth[_0xd571('0x8')](),controller[_0xd571('0x10')]);router[_0xd571('0xf')](_0xd571('0x11'),auth[_0xd571('0x8')](),controller[_0xd571('0x12')]);router['put'](_0xd571('0xa'),auth[_0xd571('0x8')](),controller['update']);router[_0xd571('0x13')](_0xd571('0xa'),auth[_0xd571('0x8')](),controller[_0xd571('0x14')]);module[_0xd571('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 53dab4b..6970b3f 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 _0xfa18=['BOOLEAN','sequelize','lodash','util','exports','STRING','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','description'];(function(_0x5544e2,_0x14d6bc){var _0x14a551=function(_0x4697fe){while(--_0x4697fe){_0x5544e2['push'](_0x5544e2['shift']());}};_0x14a551(++_0x14d6bc);}(_0xfa18,0x15a));var _0x8fa1=function(_0x4a29d0,_0x10d786){_0x4a29d0=_0x4a29d0-0x0;var _0x2a8d00=_0xfa18[_0x4a29d0];return _0x2a8d00;};'use strict';var Sequelize=require(_0x8fa1('0x0'));var _=require(_0x8fa1('0x1'));var util=require(_0x8fa1('0x2'));module[_0x8fa1('0x3')]={'name':{'type':Sequelize[_0x8fa1('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x8fa1('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x8fa1('0x5')),'set':function(_0x5e7b3c){if(_['isObjectLike'](_0x5e7b3c)){this[_0x8fa1('0x6')](_0x8fa1('0x7'),JSON[_0x8fa1('0x8')](_0x5e7b3c));}else if(_[_0x8fa1('0x9')](_0x5e7b3c)){this[_0x8fa1('0x6')](_0x8fa1('0x7'),_0x5e7b3c);}else{this['setDataValue'](_0x8fa1('0x7'),util[_0x8fa1('0xa')](_0x8fa1('0xb'),this['getDataValue'](_0x8fa1('0xc'))||'',this['getDataValue'](_0x8fa1('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8fa1('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8fa1('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xd23b=['description','BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x2491b3,_0x4f75d6){var _0x354e25=function(_0xb7ff36){while(--_0xb7ff36){_0x2491b3['push'](_0x2491b3['shift']());}};_0x354e25(++_0x4f75d6);}(_0xd23b,0x1d2));var _0xbd23=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xd23b[_0x8ba19a];return _0x2bd8b4;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbd23('0x0'));var util=require(_0xbd23('0x1'));module[_0xbd23('0x2')]={'name':{'type':Sequelize[_0xbd23('0x3')],'unique':_0xbd23('0x4')},'description':{'type':Sequelize[_0xbd23('0x3')]},'formData':{'type':Sequelize[_0xbd23('0x5')](_0xbd23('0x6')),'set':function(_0x249faf){if(_[_0xbd23('0x7')](_0x249faf)){this[_0xbd23('0x8')](_0xbd23('0x9'),JSON['stringify'](_0x249faf));}else if(_[_0xbd23('0xa')](_0x249faf)){this[_0xbd23('0x8')](_0xbd23('0x9'),_0x249faf);}else{this[_0xbd23('0x8')](_0xbd23('0x9'),util[_0xbd23('0xb')](_0xbd23('0xc'),this[_0xbd23('0xd')](_0xbd23('0x4'))||'',this[_0xbd23('0xd')](_0xbd23('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbd23('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbd23('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 69acf60..7692f81 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 _0xefe2=['squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','end','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','autoAssociation','getSessions','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','findAll','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','answer','isEmpty','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x392bcf,_0x4e5406){var _0x16f956=function(_0x511eea){while(--_0x511eea){_0x392bcf['push'](_0x392bcf['shift']());}};_0x16f956(++_0x4e5406);}(_0xefe2,0xd9));var _0x2efe=function(_0x10bd35,_0x309e8a){_0x10bd35=_0x10bd35-0x0;var _0x2509ff=_0xefe2[_0x10bd35];return _0x2509ff;};'use strict';var emlformat=require(_0x2efe('0x0'));var rimraf=require(_0x2efe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2efe('0x2'));var rp=require(_0x2efe('0x3'));var moment=require('moment');var BPromise=require(_0x2efe('0x4'));var Mustache=require('mustache');var util=require(_0x2efe('0x5'));var path=require(_0x2efe('0x6'));var sox=require(_0x2efe('0x7'));var csv=require(_0x2efe('0x8'));var ejs=require(_0x2efe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2efe('0xa'));var squel=require(_0x2efe('0xb'));var crypto=require(_0x2efe('0xc'));var jsforce=require(_0x2efe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2efe('0x8'));var querystring=require(_0x2efe('0xe'));var Papa=require(_0x2efe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2efe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2efe('0x11'))(_0x2efe('0x12'));var utils=require(_0x2efe('0x13'));var config=require(_0x2efe('0x14'));var licenseUtil=require(_0x2efe('0x15'));var db=require(_0x2efe('0x16'))['db'];function respondWithStatusCode(_0x39a93b,_0x250023){_0x250023=_0x250023||0xcc;return function(_0x41039a){if(_0x41039a){return _0x39a93b[_0x2efe('0x17')](_0x250023);}return _0x39a93b['status'](_0x250023)['end']();};}function respondWithResult(_0x28681f,_0x1d9e5c){_0x1d9e5c=_0x1d9e5c||0xc8;return function(_0x562753){if(_0x562753){return _0x28681f['status'](_0x1d9e5c)[_0x2efe('0x18')](_0x562753);}};}function respondWithFilteredResult(_0x5195c8,_0x235af3){return function(_0x3b8b31){if(_0x3b8b31){var _0x51cbf3=typeof _0x235af3[_0x2efe('0x19')]===_0x2efe('0x1a')&&typeof _0x235af3['limit']===_0x2efe('0x1a');var _0x499c70=_0x3b8b31['count'];var _0xefd47=_0x51cbf3?0x0:_0x235af3[_0x2efe('0x19')];var _0x16acde=_0x51cbf3?_0x3b8b31[_0x2efe('0x1b')]:_0x235af3[_0x2efe('0x19')]+_0x235af3[_0x2efe('0x1c')];var _0x3017a7;if(_0x16acde>=_0x499c70){_0x16acde=_0x499c70;_0x3017a7=0xc8;}else{_0x3017a7=0xce;}_0x5195c8[_0x2efe('0x1d')](_0x3017a7);return _0x5195c8[_0x2efe('0x1e')](_0x2efe('0x1f'),_0xefd47+'-'+_0x16acde+'/'+_0x499c70)[_0x2efe('0x18')](_0x3b8b31);}return null;};}function patchUpdates(_0x6962df){return function(_0x491958){try{jsonpatch[_0x2efe('0x20')](_0x491958,_0x6962df,!![]);}catch(_0x538f39){return BPromise[_0x2efe('0x21')](_0x538f39);}return _0x491958[_0x2efe('0x22')]();};}function saveUpdates(_0x30ed16,_0x4ebeb6){return function(_0x131169){if(_0x131169){return _0x131169[_0x2efe('0x23')](_0x30ed16)['then'](function(_0x1c4a8d){return _0x1c4a8d;});}return null;};}function removeEntity(_0x368d08,_0xc24859){return function(_0x319b7f){if(_0x319b7f){return _0x319b7f[_0x2efe('0x24')]()[_0x2efe('0x25')](function(){var _0x2a9b20=_0x319b7f[_0x2efe('0x26')]({'plain':!![]});var _0x3d4449=_0x2efe('0x27');return db[_0x2efe('0x28')][_0x2efe('0x24')]({'where':{'type':_0x3d4449,'resourceId':_0x2a9b20['id']}})[_0x2efe('0x25')](function(){return _0x319b7f;});})[_0x2efe('0x25')](function(){_0x368d08['status'](0xcc)[_0x2efe('0x29')]();});}};}function handleEntityNotFound(_0x5e18d3,_0x3283c2){return function(_0x1c6c74){if(!_0x1c6c74){_0x5e18d3[_0x2efe('0x17')](0x194);}return _0x1c6c74;};}function handleError(_0x431394,_0x3b61d1){_0x3b61d1=_0x3b61d1||0x1f4;return function(_0xa11a23){logger[_0x2efe('0x2a')](_0xa11a23[_0x2efe('0x2b')]);if(_0xa11a23['name']){delete _0xa11a23[_0x2efe('0x2c')];}_0x431394[_0x2efe('0x1d')](_0x3b61d1)[_0x2efe('0x2d')](_0xa11a23);};}exports[_0x2efe('0x2e')]=function(_0x1bed7f,_0x49ef94){var _0x122d35={},_0x1ce936={},_0x1108eb={'count':0x0,'rows':[]};var _0x54e707=_[_0x2efe('0x2f')](db[_0x2efe('0x30')][_0x2efe('0x31')],function(_0x232c72){return{'name':_0x232c72[_0x2efe('0x32')],'type':_0x232c72[_0x2efe('0x33')]['key']};});_0x1ce936[_0x2efe('0x34')]=_[_0x2efe('0x2f')](_0x54e707,_0x2efe('0x2c'));_0x1ce936[_0x2efe('0x35')]=_[_0x2efe('0x36')](_0x1bed7f[_0x2efe('0x35')]);_0x1ce936[_0x2efe('0x37')]=_[_0x2efe('0x38')](_0x1ce936[_0x2efe('0x34')],_0x1ce936['query']);_0x122d35[_0x2efe('0x39')]=_[_0x2efe('0x38')](_0x1ce936['model'],qs['fields'](_0x1bed7f['query'][_0x2efe('0x3a')]));_0x122d35[_0x2efe('0x39')]=_0x122d35[_0x2efe('0x39')]['length']?_0x122d35[_0x2efe('0x39')]:_0x1ce936[_0x2efe('0x34')];if(!_0x1bed7f[_0x2efe('0x35')]['hasOwnProperty']('nolimit')){_0x122d35[_0x2efe('0x1c')]=qs['limit'](_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x1c')]);_0x122d35[_0x2efe('0x19')]=qs['offset'](_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x19')]);}_0x122d35[_0x2efe('0x3b')]=qs[_0x2efe('0x3c')](_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x3c')]);_0x122d35[_0x2efe('0x3d')]=qs['filters'](_[_0x2efe('0x3e')](_0x1bed7f['query'],_0x1ce936[_0x2efe('0x37')]),_0x54e707);if(_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x3f')]){_0x122d35[_0x2efe('0x3d')]=_[_0x2efe('0x40')](_0x122d35['where'],{'$or':_[_0x2efe('0x2f')](_0x54e707,function(_0x45409f){if(_0x45409f['type']!==_0x2efe('0x41')){var _0x27a877={};_0x27a877[_0x45409f['name']]={'$like':'%'+_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x3f')]+'%'};return _0x27a877;}})});}_0x122d35=_[_0x2efe('0x40')]({},_0x122d35,_0x1bed7f[_0x2efe('0x42')]);var _0x3356ec={'where':_0x122d35[_0x2efe('0x3d')]};return db[_0x2efe('0x30')][_0x2efe('0x1b')](_0x3356ec)[_0x2efe('0x25')](function(_0xd4948f){_0x1108eb[_0x2efe('0x1b')]=_0xd4948f;if(_0x1bed7f[_0x2efe('0x35')][_0x2efe('0x43')]){_0x122d35[_0x2efe('0x44')]=[{'all':!![]}];}return db[_0x2efe('0x30')]['findAll'](_0x122d35);})[_0x2efe('0x25')](function(_0x84d98b){_0x1108eb[_0x2efe('0x45')]=_0x84d98b;return _0x1108eb;})[_0x2efe('0x25')](respondWithFilteredResult(_0x49ef94,_0x122d35))[_0x2efe('0x46')](handleError(_0x49ef94,null));};exports[_0x2efe('0x47')]=function(_0x45c1ee,_0x5a9d2d){var _0x1c99b2={'raw':![],'where':{'id':_0x45c1ee[_0x2efe('0x48')]['id']}},_0x1ddfdf={};_0x1ddfdf[_0x2efe('0x34')]=_[_0x2efe('0x36')](db['JscriptyProject'][_0x2efe('0x31')]);_0x1ddfdf[_0x2efe('0x35')]=_[_0x2efe('0x36')](_0x45c1ee[_0x2efe('0x35')]);_0x1ddfdf[_0x2efe('0x37')]=_[_0x2efe('0x38')](_0x1ddfdf[_0x2efe('0x34')],_0x1ddfdf[_0x2efe('0x35')]);_0x1c99b2[_0x2efe('0x39')]=_['intersection'](_0x1ddfdf['model'],qs['fields'](_0x45c1ee[_0x2efe('0x35')][_0x2efe('0x3a')]));_0x1c99b2['attributes']=_0x1c99b2[_0x2efe('0x39')]['length']?_0x1c99b2['attributes']:_0x1ddfdf[_0x2efe('0x34')];if(_0x45c1ee['query'][_0x2efe('0x43')]){_0x1c99b2[_0x2efe('0x44')]=[{'all':!![]}];}_0x1c99b2=_[_0x2efe('0x40')]({},_0x1c99b2,_0x45c1ee['options']);return db[_0x2efe('0x30')][_0x2efe('0x49')](_0x1c99b2)[_0x2efe('0x25')](handleEntityNotFound(_0x5a9d2d,null))[_0x2efe('0x25')](respondWithResult(_0x5a9d2d,null))['catch'](handleError(_0x5a9d2d,null));};exports[_0x2efe('0x4a')]=function(_0x9a5118,_0x5abdaf){return db[_0x2efe('0x30')][_0x2efe('0x4a')](_0x9a5118[_0x2efe('0x4b')],{})[_0x2efe('0x25')](function(_0x1cda82){var _0x5725e4=_0x9a5118[_0x2efe('0x4c')][_0x2efe('0x26')]({'plain':!![]});if(!_0x5725e4)throw new Error(_0x2efe('0x4d'));if(_0x5725e4['role']===_0x2efe('0x4c')){var _0x3fe2c0=_0x1cda82[_0x2efe('0x26')]({'plain':!![]});var _0x3abb50='Projects';return db[_0x2efe('0x4e')]['find']({'where':{'name':_0x3abb50,'userProfileId':_0x5725e4[_0x2efe('0x4f')]},'raw':!![]})[_0x2efe('0x25')](function(_0x33eb03){if(_0x33eb03&&_0x33eb03['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3fe2c0[_0x2efe('0x2c')],'resourceId':_0x3fe2c0['id'],'type':_0x33eb03['name'],'sectionId':_0x33eb03['id']},{})[_0x2efe('0x25')](function(){return _0x1cda82;});}else{return _0x1cda82;}})['catch'](function(_0x327a10){logger[_0x2efe('0x2a')](_0x2efe('0x50'),_0x327a10);throw _0x327a10;});}return _0x1cda82;})[_0x2efe('0x25')](respondWithResult(_0x5abdaf,0xc9))[_0x2efe('0x46')](handleError(_0x5abdaf,null));};exports[_0x2efe('0x51')]=function(_0x2fa3b0,_0x53c173){var _0x3bc319={'where':{'id':_0x2fa3b0[_0x2efe('0x48')]['id']}},_0x3b1da4={};_0x3b1da4[_0x2efe('0x34')]=_[_0x2efe('0x36')](db[_0x2efe('0x30')]['rawAttributes']);_0x3bc319[_0x2efe('0x39')]=_[_0x2efe('0x38')](_0x3b1da4[_0x2efe('0x34')],qs[_0x2efe('0x3a')](_0x2fa3b0[_0x2efe('0x35')]['fields']));_0x3bc319[_0x2efe('0x39')]=_0x3bc319[_0x2efe('0x39')][_0x2efe('0x52')]?_0x3bc319[_0x2efe('0x39')]:_0x3b1da4['model'];if(_0x2fa3b0[_0x2efe('0x35')][_0x2efe('0x43')]){_0x3bc319[_0x2efe('0x44')]=[{'all':!![]}];}_0x3bc319=_['merge']({},_0x3bc319,_0x2fa3b0[_0x2efe('0x42')]);return db['JscriptyProject'][_0x2efe('0x49')](_0x3bc319)[_0x2efe('0x25')](handleEntityNotFound(_0x53c173,null))[_0x2efe('0x25')](function(_0x245693){if(_0x245693){var _0x4a2754=_0x245693[_0x2efe('0x26')]({'plain':!![]});_0x4a2754=qs[_0x2efe('0x53')](_0x4a2754,['id',_0x2efe('0x54'),_0x2efe('0x55')]);_0x2fa3b0['body']=_[_0x2efe('0x53')](_0x2fa3b0[_0x2efe('0x4b')],['id',_0x2efe('0x54'),_0x2efe('0x55')]);return db[_0x2efe('0x30')][_0x2efe('0x4a')](_[_0x2efe('0x40')](_0x4a2754,_0x2fa3b0['body']),{'include':_0x2fa3b0[_0x2efe('0x35')][_0x2efe('0x43')]?[{'all':!![]}]:undefined})[_0x2efe('0x25')](function(_0x2dfa90){var _0x4545c4=_0x2fa3b0[_0x2efe('0x4c')][_0x2efe('0x26')]({'plain':!![]});if(!_0x4545c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4545c4['role']===_0x2efe('0x4c')){var _0x4d2a94=_0x2dfa90[_0x2efe('0x26')]({'plain':!![]});var _0x1168dc=_0x2efe('0x27');return db[_0x2efe('0x4e')][_0x2efe('0x49')]({'where':{'name':_0x1168dc,'userProfileId':_0x4545c4['userProfileId']},'raw':!![]})[_0x2efe('0x25')](function(_0x110379){if(_0x110379&&_0x110379[_0x2efe('0x56')]===0x0){return db['UserProfileResource'][_0x2efe('0x4a')]({'name':_0x4d2a94[_0x2efe('0x2c')],'resourceId':_0x4d2a94['id'],'type':_0x110379[_0x2efe('0x2c')],'sectionId':_0x110379['id']},{})[_0x2efe('0x25')](function(){return _0x2dfa90;});}else{return _0x2dfa90;}})[_0x2efe('0x46')](function(_0x22caae){logger[_0x2efe('0x2a')](_0x2efe('0x50'),_0x22caae);throw _0x22caae;});}return _0x2dfa90;});}})[_0x2efe('0x25')](respondWithResult(_0x53c173,0xc9))['catch'](handleError(_0x53c173,null));};exports['update']=function(_0x44af9b,_0x303bc0){if(_0x44af9b[_0x2efe('0x4b')]['id']){delete _0x44af9b[_0x2efe('0x4b')]['id'];}return db[_0x2efe('0x30')][_0x2efe('0x49')]({'where':{'id':_0x44af9b[_0x2efe('0x48')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x303bc0,null))['then'](saveUpdates(_0x44af9b[_0x2efe('0x4b')],null))['then'](respondWithResult(_0x303bc0,null))[_0x2efe('0x46')](handleError(_0x303bc0,null));};exports[_0x2efe('0x24')]=function(_0x367633,_0xb2c6e2){return db[_0x2efe('0x30')][_0x2efe('0x49')]({'where':{'id':_0x367633[_0x2efe('0x48')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0xb2c6e2,null))[_0x2efe('0x25')](removeEntity(_0xb2c6e2,null))[_0x2efe('0x46')](handleError(_0xb2c6e2,null));};exports[_0x2efe('0x57')]=function(_0x440a15,_0x442339,_0xb58004){var _0x58c149={'raw':!![],'where':{}};var _0x490d1c={};var _0x1548c2={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2efe('0x58')]({'where':{'id':_0x440a15[_0x2efe('0x48')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x442339,null))[_0x2efe('0x25')](function(_0x1f16d1){if(_0x1f16d1){_0x490d1c[_0x2efe('0x34')]=_[_0x2efe('0x36')](db[_0x2efe('0x59')][_0x2efe('0x31')]);_0x490d1c['query']=_[_0x2efe('0x36')](_0x440a15['query']);_0x490d1c[_0x2efe('0x37')]=_[_0x2efe('0x38')](_0x490d1c['model'],_0x490d1c[_0x2efe('0x35')]);_0x58c149[_0x2efe('0x39')]=_['intersection'](_0x490d1c[_0x2efe('0x34')],qs['fields'](_0x440a15['query'][_0x2efe('0x3a')]));_0x58c149[_0x2efe('0x39')]=_0x58c149[_0x2efe('0x39')]['length']?_0x58c149[_0x2efe('0x39')]:_0x490d1c[_0x2efe('0x34')];if(!_0x440a15[_0x2efe('0x35')][_0x2efe('0x5a')](_0x2efe('0x5b'))){_0x58c149[_0x2efe('0x1c')]=qs[_0x2efe('0x1c')](_0x440a15['query'][_0x2efe('0x1c')]);_0x58c149['offset']=qs[_0x2efe('0x19')](_0x440a15[_0x2efe('0x35')]['offset']);}_0x58c149[_0x2efe('0x3b')]=qs['sort'](_0x440a15[_0x2efe('0x35')][_0x2efe('0x3c')]);_0x58c149[_0x2efe('0x3d')]=qs[_0x2efe('0x37')](_[_0x2efe('0x3e')](_0x440a15[_0x2efe('0x35')],_0x490d1c[_0x2efe('0x37')]));_0x58c149[_0x2efe('0x3d')][_0x2efe('0x5c')]=_0x1f16d1['id'];if(_0x440a15[_0x2efe('0x35')]['filter']){_0x58c149[_0x2efe('0x3d')]=_[_0x2efe('0x40')](_0x58c149[_0x2efe('0x3d')],{'$or':_[_0x2efe('0x2f')](_0x58c149['attributes'],function(_0x47dd7e){var _0x372b66={};_0x372b66[_0x47dd7e]={'$like':'%'+_0x440a15['query'][_0x2efe('0x3f')]+'%'};return _0x372b66;})});}_0x58c149=_[_0x2efe('0x40')]({},_0x58c149,_0x440a15['options']);return db[_0x2efe('0x59')][_0x2efe('0x1b')]({'where':_0x58c149[_0x2efe('0x3d')]})[_0x2efe('0x25')](function(_0xa76d4b){_0x1548c2[_0x2efe('0x1b')]=_0xa76d4b;if(_0x440a15[_0x2efe('0x35')][_0x2efe('0x43')]){_0x58c149['include']=[{'all':!![]}];}return db[_0x2efe('0x59')][_0x2efe('0x5d')](_0x58c149);})[_0x2efe('0x25')](function(_0x17911d){_0x1548c2[_0x2efe('0x45')]=_0x17911d;return _0x1548c2;});}})['then'](respondWithFilteredResult(_0x442339,_0x58c149))[_0x2efe('0x46')](handleError(_0x442339,null));};exports['getAnswers']=function(_0xc9bae9,_0x24c4d8,_0x25b240){var _0x58e7b1={'raw':!![],'where':{}};var _0x656caf={};var _0x5910c6={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x2efe('0x58')]({'where':{'id':_0xc9bae9[_0x2efe('0x48')]['id']}})[_0x2efe('0x25')](handleEntityNotFound(_0x24c4d8,null))[_0x2efe('0x25')](function(_0x1e4c79){if(_0x1e4c79){_0x656caf['model']=_[_0x2efe('0x36')](db['JscriptyAnswerReport'][_0x2efe('0x31')]);_0x656caf[_0x2efe('0x35')]=_[_0x2efe('0x36')](_0xc9bae9[_0x2efe('0x35')]);_0x656caf['filters']=_[_0x2efe('0x38')](_0x656caf[_0x2efe('0x34')],_0x656caf[_0x2efe('0x35')]);_0x58e7b1[_0x2efe('0x39')]=_['intersection'](_0x656caf[_0x2efe('0x34')],qs[_0x2efe('0x3a')](_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x3a')]));_0x58e7b1[_0x2efe('0x39')]=_0x58e7b1[_0x2efe('0x39')][_0x2efe('0x52')]?_0x58e7b1['attributes']:_0x656caf[_0x2efe('0x34')];if(!_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x5a')]('nolimit')){_0x58e7b1[_0x2efe('0x1c')]=qs[_0x2efe('0x1c')](_0xc9bae9[_0x2efe('0x35')]['limit']);_0x58e7b1[_0x2efe('0x19')]=qs[_0x2efe('0x19')](_0xc9bae9['query']['offset']);}_0x58e7b1[_0x2efe('0x3b')]=qs[_0x2efe('0x3c')](_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x3c')]);_0x58e7b1[_0x2efe('0x3d')]=qs[_0x2efe('0x37')](_[_0x2efe('0x3e')](_0xc9bae9['query'],_0x656caf[_0x2efe('0x37')]));_0x58e7b1[_0x2efe('0x3d')]['ProjectId']=_0x1e4c79['id'];if(_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x3f')]){_0x58e7b1[_0x2efe('0x3d')]=_[_0x2efe('0x40')](_0x58e7b1['where'],{'$or':_[_0x2efe('0x2f')](_0x58e7b1['attributes'],function(_0x591eb0){var _0x3eafcf={};_0x3eafcf[_0x591eb0]={'$like':'%'+_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x3f')]+'%'};return _0x3eafcf;})});}_0x58e7b1=_[_0x2efe('0x40')]({},_0x58e7b1,_0xc9bae9['options']);return db['JscriptyAnswerReport'][_0x2efe('0x1b')]({'where':_0x58e7b1[_0x2efe('0x3d')]})[_0x2efe('0x25')](function(_0x50eec2){_0x5910c6[_0x2efe('0x1b')]=_0x50eec2;if(_0xc9bae9[_0x2efe('0x35')][_0x2efe('0x43')]){_0x58e7b1[_0x2efe('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x2efe('0x5d')](_0x58e7b1);})['then'](function(_0x102870){_0x5910c6[_0x2efe('0x45')]=_0x102870;return _0x5910c6;});}})[_0x2efe('0x25')](respondWithFilteredResult(_0x24c4d8,_0x58e7b1))[_0x2efe('0x46')](handleError(_0x24c4d8,null));};function char(_0x287f1c){return'number'===typeof _0x287f1c?String[_0x2efe('0x5e')][_0x2efe('0x20')](null,arguments):_0x287f1c;}function needsEncapsulation(_0x4f745a){return!!_0x4f745a&&(_0x4f745a[_0x2efe('0x5f')]()[_0x2efe('0x60')](char(0xd))>=0x0||_0x4f745a['toString']()[_0x2efe('0x60')](char(0xa))>=0x0||_0x4f745a['toString']()[_0x2efe('0x60')](char(0x2c))>=0x0||_0x4f745a[_0x2efe('0x5f')]()[_0x2efe('0x60')](char(0x22))>=0x0);}function encapsulate(_0x2dc5e8){var _0x32db55=char(0x22),_0x329ce6='\x5c'+char(0x22),_0x5b88ae=_0x2dc5e8[_0x2efe('0x5f')]()[_0x2efe('0x61')](new RegExp(_0x32db55,'g'),_0x329ce6);return _0x32db55+_0x5b88ae+_0x32db55;}exports['getSummary']=function(_0x2671c2,_0x5d8e08,_0x1e8709){var _0x337ce3,_0x50a8de;var _0x3bfba8={'where':{'ProjectId':_0x2671c2[_0x2efe('0x48')]['id']}};if(_0x2671c2[_0x2efe('0x35')][_0x2efe('0x62')]){_0x3bfba8['where'][_0x2efe('0x63')]=JSON[_0x2efe('0x64')](_0x2671c2[_0x2efe('0x35')][_0x2efe('0x62')]);}return db[_0x2efe('0x59')][_0x2efe('0x5d')](_0x3bfba8)[_0x2efe('0x25')](handleEntityNotFound(_0x5d8e08,null))[_0x2efe('0x25')](function(_0x5c06aa){if(_0x5c06aa){_0x337ce3=_0x5c06aa;return db[_0x2efe('0x65')][_0x2efe('0x5d')]({'where':{'SessionId':{'$in':_[_0x2efe('0x2f')](_0x337ce3,'id')},'ProjectId':_0x2671c2['params']['id']},'order':'-createdAt'});}})[_0x2efe('0x25')](handleEntityNotFound(_0x5d8e08,null))[_0x2efe('0x25')](function(_0x3f39de){if(_0x3f39de){_0x50a8de=_0x3f39de;var _0x5e7aa6={};for(var _0x4b7fcd=0x0,_0xe857a4=_0x50a8de[_0x2efe('0x52')];_0x4b7fcd<_0xe857a4;_0x4b7fcd++){if(!_0x5e7aa6[_0x2efe('0x5a')](_0x50a8de[_0x4b7fcd][_0x2efe('0x66')])){_0x5e7aa6[_0x50a8de[_0x4b7fcd][_0x2efe('0x66')]]=needsEncapsulation(_0x50a8de[_0x4b7fcd][_0x2efe('0x67')])?encapsulate(_0x50a8de[_0x4b7fcd]['question']):_0x50a8de[_0x4b7fcd][_0x2efe('0x67')];}}var _0x37637a=[],_0x536637={};for(var _0x360529=0x0,_0x4950b4=_0x337ce3[_0x2efe('0x52')];_0x360529<_0x4950b4;_0x360529++){_0x536637={'ProjectId':_0x2671c2['params']['id'],'SessionId':_0x337ce3[_0x360529]['id'],'StartTime':moment(_0x337ce3[_0x360529][_0x2efe('0x63')])[_0x2efe('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xab90ee=0x0,_0x7be967=_0x50a8de[_0x2efe('0x52')];_0xab90ee<_0x7be967;_0xab90ee++){if(_0x50a8de[_0xab90ee]['SessionId']==_0x337ce3[_0x360529]['id']&&_0x5e7aa6[_0x2efe('0x5a')](_0x50a8de[_0xab90ee][_0x2efe('0x66')])){_0x536637[_0x5e7aa6[_0x50a8de[_0xab90ee][_0x2efe('0x66')]]]=_0x50a8de[_0xab90ee][_0x2efe('0x69')];}}for(var _0x608c26 in _0x5e7aa6){if(!_0x536637[_0x2efe('0x5a')](_0x5e7aa6[_0x608c26])){_0x536637[_0x5e7aa6[_0x608c26]]=null;}}_0x37637a['push'](_0x536637);}return _0x37637a;}})[_0x2efe('0x25')](function(_0x3b15bd){if(!_[_0x2efe('0x6a')](_0x3b15bd)){var _0x37f03e=toCsv(_0x3b15bd);var _0x63e410=Date[_0x2efe('0x6b')]();fs[_0x2efe('0x6c')](util[_0x2efe('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2671c2['params']['id'],_0x63e410),_0x37f03e);_0x5d8e08[_0x2efe('0x6d')](_0x2efe('0x6e'),'attachment;\x20filename='+util[_0x2efe('0x68')](_0x2efe('0x6f'),_0x2671c2[_0x2efe('0x48')]['id'],_0x63e410));_0x5d8e08[_0x2efe('0x6d')]('Content-type',_0x2efe('0x70'));return _0x5d8e08['download'](util[_0x2efe('0x68')](_0x2efe('0x71'),_0x2671c2[_0x2efe('0x48')]['id'],_0x63e410));}else{return _0x5d8e08[_0x2efe('0x17')](0xcc);}})[_0x2efe('0x46')](handleError(_0x5d8e08,null));}; \ No newline at end of file +var _0x3611=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','pick','filter','where','merge','include','rows','show','params','length','options','find','catch','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','getSessions','findOne','JscriptySessionReport','nolimit','JscriptyAnswerReport','sort','ProjectId','findAll','number','fromCharCode','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','eml-format','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x529e62,_0x22128a){var _0x352fbe=function(_0x1acb27){while(--_0x1acb27){_0x529e62['push'](_0x529e62['shift']());}};_0x352fbe(++_0x22128a);}(_0x3611,0x136));var _0x1361=function(_0x4070d8,_0x3ebb3c){_0x4070d8=_0x4070d8-0x0;var _0x19eec3=_0x3611[_0x4070d8];return _0x19eec3;};'use strict';var emlformat=require(_0x1361('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1361('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1361('0x2'));var Mustache=require(_0x1361('0x3'));var util=require(_0x1361('0x4'));var path=require(_0x1361('0x5'));var sox=require('sox');var csv=require(_0x1361('0x6'));var ejs=require(_0x1361('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1361('0x8'));var squel=require('squel');var crypto=require(_0x1361('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1361('0x6'));var querystring=require(_0x1361('0xa'));var Papa=require(_0x1361('0xb'));var Redis=require(_0x1361('0xc'));var authService=require(_0x1361('0xd'));var qs=require(_0x1361('0xe'));var as=require(_0x1361('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1361('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x1361('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x1361('0x12'))['db'];function respondWithStatusCode(_0x2cecd6,_0xbc9d68){_0xbc9d68=_0xbc9d68||0xcc;return function(_0x1a36e9){if(_0x1a36e9){return _0x2cecd6[_0x1361('0x13')](_0xbc9d68);}return _0x2cecd6[_0x1361('0x14')](_0xbc9d68)[_0x1361('0x15')]();};}function respondWithResult(_0x161f92,_0x4a8345){_0x4a8345=_0x4a8345||0xc8;return function(_0x4c33e0){if(_0x4c33e0){return _0x161f92[_0x1361('0x14')](_0x4a8345)['json'](_0x4c33e0);}};}function respondWithFilteredResult(_0x577190,_0x2a0423){return function(_0x18a1fc){if(_0x18a1fc){var _0x31e1c7=typeof _0x2a0423[_0x1361('0x16')]==='undefined'&&typeof _0x2a0423[_0x1361('0x17')]===_0x1361('0x18');var _0x23dc0b=_0x18a1fc[_0x1361('0x19')];var _0x3c01f1=_0x31e1c7?0x0:_0x2a0423[_0x1361('0x16')];var _0x59c9e7=_0x31e1c7?_0x18a1fc[_0x1361('0x19')]:_0x2a0423['offset']+_0x2a0423[_0x1361('0x17')];var _0xe2ac9c;if(_0x59c9e7>=_0x23dc0b){_0x59c9e7=_0x23dc0b;_0xe2ac9c=0xc8;}else{_0xe2ac9c=0xce;}_0x577190[_0x1361('0x14')](_0xe2ac9c);return _0x577190[_0x1361('0x1a')](_0x1361('0x1b'),_0x3c01f1+'-'+_0x59c9e7+'/'+_0x23dc0b)['json'](_0x18a1fc);}return null;};}function patchUpdates(_0x26dacb){return function(_0x17f576){try{jsonpatch[_0x1361('0x1c')](_0x17f576,_0x26dacb,!![]);}catch(_0x273193){return BPromise['reject'](_0x273193);}return _0x17f576['save']();};}function saveUpdates(_0xa3f1f8,_0x52bbff){return function(_0x314b77){if(_0x314b77){return _0x314b77[_0x1361('0x1d')](_0xa3f1f8)[_0x1361('0x1e')](function(_0x14ab6d){return _0x14ab6d;});}return null;};}function removeEntity(_0x4406e2,_0x5c3c4b){return function(_0x1420e3){if(_0x1420e3){return _0x1420e3[_0x1361('0x1f')]()[_0x1361('0x1e')](function(){var _0x1d9c1d=_0x1420e3['get']({'plain':!![]});var _0x16cf21=_0x1361('0x20');return db[_0x1361('0x21')]['destroy']({'where':{'type':_0x16cf21,'resourceId':_0x1d9c1d['id']}})[_0x1361('0x1e')](function(){return _0x1420e3;});})[_0x1361('0x1e')](function(){_0x4406e2['status'](0xcc)[_0x1361('0x15')]();});}};}function handleEntityNotFound(_0x4785b6,_0x1d662d){return function(_0x326760){if(!_0x326760){_0x4785b6['sendStatus'](0x194);}return _0x326760;};}function handleError(_0x454ea1,_0x48e3ea){_0x48e3ea=_0x48e3ea||0x1f4;return function(_0x51b6be){logger[_0x1361('0x22')](_0x51b6be[_0x1361('0x23')]);if(_0x51b6be[_0x1361('0x24')]){delete _0x51b6be[_0x1361('0x24')];}_0x454ea1[_0x1361('0x14')](_0x48e3ea)[_0x1361('0x25')](_0x51b6be);};}exports[_0x1361('0x26')]=function(_0x3fe34a,_0x2fd4b7){var _0x39957b={},_0x398902={},_0x4f0829={'count':0x0,'rows':[]};var _0x6abb56=_[_0x1361('0x27')](db[_0x1361('0x28')][_0x1361('0x29')],function(_0x234311){return{'name':_0x234311[_0x1361('0x2a')],'type':_0x234311[_0x1361('0x2b')][_0x1361('0x2c')]};});_0x398902[_0x1361('0x2d')]=_[_0x1361('0x27')](_0x6abb56,_0x1361('0x24'));_0x398902[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x3fe34a[_0x1361('0x2e')]);_0x398902[_0x1361('0x30')]=_[_0x1361('0x31')](_0x398902[_0x1361('0x2d')],_0x398902['query']);_0x39957b[_0x1361('0x32')]=_[_0x1361('0x31')](_0x398902['model'],qs[_0x1361('0x33')](_0x3fe34a[_0x1361('0x2e')][_0x1361('0x33')]));_0x39957b['attributes']=_0x39957b[_0x1361('0x32')]['length']?_0x39957b[_0x1361('0x32')]:_0x398902['model'];if(!_0x3fe34a['query'][_0x1361('0x34')]('nolimit')){_0x39957b[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x3fe34a[_0x1361('0x2e')][_0x1361('0x17')]);_0x39957b['offset']=qs[_0x1361('0x16')](_0x3fe34a[_0x1361('0x2e')]['offset']);}_0x39957b[_0x1361('0x35')]=qs['sort'](_0x3fe34a[_0x1361('0x2e')]['sort']);_0x39957b['where']=qs[_0x1361('0x30')](_[_0x1361('0x36')](_0x3fe34a['query'],_0x398902[_0x1361('0x30')]),_0x6abb56);if(_0x3fe34a[_0x1361('0x2e')][_0x1361('0x37')]){_0x39957b[_0x1361('0x38')]=_[_0x1361('0x39')](_0x39957b[_0x1361('0x38')],{'$or':_['map'](_0x6abb56,function(_0x22c494){if(_0x22c494['type']!=='VIRTUAL'){var _0x4136c3={};_0x4136c3[_0x22c494[_0x1361('0x24')]]={'$like':'%'+_0x3fe34a[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x4136c3;}})});}_0x39957b=_[_0x1361('0x39')]({},_0x39957b,_0x3fe34a['options']);var _0x6cbd6a={'where':_0x39957b[_0x1361('0x38')]};return db[_0x1361('0x28')][_0x1361('0x19')](_0x6cbd6a)['then'](function(_0x825b2e){_0x4f0829[_0x1361('0x19')]=_0x825b2e;if(_0x3fe34a[_0x1361('0x2e')]['includeAll']){_0x39957b[_0x1361('0x3a')]=[{'all':!![]}];}return db[_0x1361('0x28')]['findAll'](_0x39957b);})['then'](function(_0x4b705c){_0x4f0829[_0x1361('0x3b')]=_0x4b705c;return _0x4f0829;})[_0x1361('0x1e')](respondWithFilteredResult(_0x2fd4b7,_0x39957b))['catch'](handleError(_0x2fd4b7,null));};exports[_0x1361('0x3c')]=function(_0x39dcdc,_0x59dd75){var _0x5a04a3={'raw':![],'where':{'id':_0x39dcdc[_0x1361('0x3d')]['id']}},_0x2ecbb2={};_0x2ecbb2[_0x1361('0x2d')]=_[_0x1361('0x2f')](db[_0x1361('0x28')][_0x1361('0x29')]);_0x2ecbb2[_0x1361('0x2e')]=_['keys'](_0x39dcdc['query']);_0x2ecbb2[_0x1361('0x30')]=_[_0x1361('0x31')](_0x2ecbb2['model'],_0x2ecbb2['query']);_0x5a04a3[_0x1361('0x32')]=_[_0x1361('0x31')](_0x2ecbb2[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x39dcdc['query'][_0x1361('0x33')]));_0x5a04a3[_0x1361('0x32')]=_0x5a04a3['attributes'][_0x1361('0x3e')]?_0x5a04a3[_0x1361('0x32')]:_0x2ecbb2['model'];if(_0x39dcdc[_0x1361('0x2e')]['includeAll']){_0x5a04a3[_0x1361('0x3a')]=[{'all':!![]}];}_0x5a04a3=_[_0x1361('0x39')]({},_0x5a04a3,_0x39dcdc[_0x1361('0x3f')]);return db[_0x1361('0x28')][_0x1361('0x40')](_0x5a04a3)[_0x1361('0x1e')](handleEntityNotFound(_0x59dd75,null))['then'](respondWithResult(_0x59dd75,null))[_0x1361('0x41')](handleError(_0x59dd75,null));};exports[_0x1361('0x42')]=function(_0x4b8114,_0x316137){return db['JscriptyProject'][_0x1361('0x42')](_0x4b8114['body'],{})[_0x1361('0x1e')](function(_0x4f682a){var _0x54f181=_0x4b8114[_0x1361('0x43')][_0x1361('0x44')]({'plain':!![]});if(!_0x54f181)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54f181['role']===_0x1361('0x43')){var _0x3bd647=_0x4f682a[_0x1361('0x44')]({'plain':!![]});var _0x40ae45=_0x1361('0x20');return db[_0x1361('0x45')][_0x1361('0x40')]({'where':{'name':_0x40ae45,'userProfileId':_0x54f181[_0x1361('0x46')]},'raw':!![]})['then'](function(_0x4fa7f6){if(_0x4fa7f6&&_0x4fa7f6[_0x1361('0x47')]===0x0){return db[_0x1361('0x21')][_0x1361('0x42')]({'name':_0x3bd647[_0x1361('0x24')],'resourceId':_0x3bd647['id'],'type':_0x4fa7f6[_0x1361('0x24')],'sectionId':_0x4fa7f6['id']},{})[_0x1361('0x1e')](function(){return _0x4f682a;});}else{return _0x4f682a;}})['catch'](function(_0x1a7120){logger['error'](_0x1361('0x48'),_0x1a7120);throw _0x1a7120;});}return _0x4f682a;})[_0x1361('0x1e')](respondWithResult(_0x316137,0xc9))[_0x1361('0x41')](handleError(_0x316137,null));};exports['clone']=function(_0x187a8a,_0x25a05d){var _0x3fc105={'where':{'id':_0x187a8a[_0x1361('0x3d')]['id']}},_0x96ca99={};_0x96ca99['model']=_['keys'](db[_0x1361('0x28')][_0x1361('0x29')]);_0x3fc105[_0x1361('0x32')]=_[_0x1361('0x31')](_0x96ca99['model'],qs[_0x1361('0x33')](_0x187a8a[_0x1361('0x2e')][_0x1361('0x33')]));_0x3fc105[_0x1361('0x32')]=_0x3fc105[_0x1361('0x32')]['length']?_0x3fc105[_0x1361('0x32')]:_0x96ca99[_0x1361('0x2d')];if(_0x187a8a[_0x1361('0x2e')]['includeAll']){_0x3fc105[_0x1361('0x3a')]=[{'all':!![]}];}_0x3fc105=_['merge']({},_0x3fc105,_0x187a8a[_0x1361('0x3f')]);return db['JscriptyProject']['find'](_0x3fc105)[_0x1361('0x1e')](handleEntityNotFound(_0x25a05d,null))[_0x1361('0x1e')](function(_0x9057f7){if(_0x9057f7){var _0x275511=_0x9057f7['get']({'plain':!![]});_0x275511=qs[_0x1361('0x49')](_0x275511,['id',_0x1361('0x4a'),'updatedAt']);_0x187a8a['body']=_[_0x1361('0x49')](_0x187a8a[_0x1361('0x4b')],['id','createdAt','updatedAt']);return db['JscriptyProject']['create'](_[_0x1361('0x39')](_0x275511,_0x187a8a[_0x1361('0x4b')]),{'include':_0x187a8a[_0x1361('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x1361('0x1e')](function(_0x4cc4f5){var _0x597dff=_0x187a8a['user'][_0x1361('0x44')]({'plain':!![]});if(!_0x597dff)throw new Error(_0x1361('0x4c'));if(_0x597dff[_0x1361('0x4d')]===_0x1361('0x43')){var _0x307ffa=_0x4cc4f5[_0x1361('0x44')]({'plain':!![]});var _0x392c6e='Projects';return db[_0x1361('0x45')][_0x1361('0x40')]({'where':{'name':_0x392c6e,'userProfileId':_0x597dff[_0x1361('0x46')]},'raw':!![]})[_0x1361('0x1e')](function(_0x2bde05){if(_0x2bde05&&_0x2bde05[_0x1361('0x47')]===0x0){return db[_0x1361('0x21')]['create']({'name':_0x307ffa[_0x1361('0x24')],'resourceId':_0x307ffa['id'],'type':_0x2bde05[_0x1361('0x24')],'sectionId':_0x2bde05['id']},{})[_0x1361('0x1e')](function(){return _0x4cc4f5;});}else{return _0x4cc4f5;}})[_0x1361('0x41')](function(_0x294e25){logger[_0x1361('0x22')](_0x1361('0x48'),_0x294e25);throw _0x294e25;});}return _0x4cc4f5;});}})[_0x1361('0x1e')](respondWithResult(_0x25a05d,0xc9))[_0x1361('0x41')](handleError(_0x25a05d,null));};exports[_0x1361('0x1d')]=function(_0x52288c,_0x52ac3a){if(_0x52288c[_0x1361('0x4b')]['id']){delete _0x52288c[_0x1361('0x4b')]['id'];}return db['JscriptyProject'][_0x1361('0x40')]({'where':{'id':_0x52288c[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x52ac3a,null))[_0x1361('0x1e')](saveUpdates(_0x52288c[_0x1361('0x4b')],null))[_0x1361('0x1e')](respondWithResult(_0x52ac3a,null))[_0x1361('0x41')](handleError(_0x52ac3a,null));};exports[_0x1361('0x1f')]=function(_0x44b925,_0x4da620){return db[_0x1361('0x28')]['find']({'where':{'id':_0x44b925[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x4da620,null))[_0x1361('0x1e')](removeEntity(_0x4da620,null))[_0x1361('0x41')](handleError(_0x4da620,null));};exports[_0x1361('0x4e')]=function(_0x4faa6f,_0x445680,_0x2d395c){var _0x1e5693={'raw':!![],'where':{}};var _0x41c6be={};var _0x53d2e8={'count':0x0,'rows':[]};return db[_0x1361('0x28')][_0x1361('0x4f')]({'where':{'id':_0x4faa6f['params']['id']}})['then'](handleEntityNotFound(_0x445680,null))['then'](function(_0x1f872b){if(_0x1f872b){_0x41c6be['model']=_[_0x1361('0x2f')](db[_0x1361('0x50')]['rawAttributes']);_0x41c6be[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x4faa6f[_0x1361('0x2e')]);_0x41c6be[_0x1361('0x30')]=_['intersection'](_0x41c6be[_0x1361('0x2d')],_0x41c6be[_0x1361('0x2e')]);_0x1e5693[_0x1361('0x32')]=_[_0x1361('0x31')](_0x41c6be[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x4faa6f['query'][_0x1361('0x33')]));_0x1e5693['attributes']=_0x1e5693[_0x1361('0x32')][_0x1361('0x3e')]?_0x1e5693['attributes']:_0x41c6be[_0x1361('0x2d')];if(!_0x4faa6f[_0x1361('0x2e')][_0x1361('0x34')](_0x1361('0x51'))){_0x1e5693[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x4faa6f[_0x1361('0x2e')]['limit']);_0x1e5693[_0x1361('0x16')]=qs['offset'](_0x4faa6f[_0x1361('0x2e')]['offset']);}_0x1e5693[_0x1361('0x35')]=qs['sort'](_0x4faa6f[_0x1361('0x2e')]['sort']);_0x1e5693['where']=qs[_0x1361('0x30')](_[_0x1361('0x36')](_0x4faa6f[_0x1361('0x2e')],_0x41c6be[_0x1361('0x30')]));_0x1e5693[_0x1361('0x38')]['ProjectId']=_0x1f872b['id'];if(_0x4faa6f['query']['filter']){_0x1e5693[_0x1361('0x38')]=_[_0x1361('0x39')](_0x1e5693[_0x1361('0x38')],{'$or':_['map'](_0x1e5693[_0x1361('0x32')],function(_0x55b025){var _0x3fe12c={};_0x3fe12c[_0x55b025]={'$like':'%'+_0x4faa6f[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x3fe12c;})});}_0x1e5693=_[_0x1361('0x39')]({},_0x1e5693,_0x4faa6f[_0x1361('0x3f')]);return db['JscriptySessionReport']['count']({'where':_0x1e5693[_0x1361('0x38')]})[_0x1361('0x1e')](function(_0x4af835){_0x53d2e8[_0x1361('0x19')]=_0x4af835;if(_0x4faa6f[_0x1361('0x2e')]['includeAll']){_0x1e5693[_0x1361('0x3a')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1e5693);})[_0x1361('0x1e')](function(_0x1366a7){_0x53d2e8[_0x1361('0x3b')]=_0x1366a7;return _0x53d2e8;});}})[_0x1361('0x1e')](respondWithFilteredResult(_0x445680,_0x1e5693))['catch'](handleError(_0x445680,null));};exports['getAnswers']=function(_0x44a421,_0x18acf8,_0x18fc7b){var _0x5c3afa={'raw':!![],'where':{}};var _0x5ed6a2={};var _0x122498={'count':0x0,'rows':[]};return db[_0x1361('0x28')][_0x1361('0x4f')]({'where':{'id':_0x44a421[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x18acf8,null))[_0x1361('0x1e')](function(_0x31e03c){if(_0x31e03c){_0x5ed6a2[_0x1361('0x2d')]=_[_0x1361('0x2f')](db[_0x1361('0x52')]['rawAttributes']);_0x5ed6a2[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x44a421['query']);_0x5ed6a2[_0x1361('0x30')]=_[_0x1361('0x31')](_0x5ed6a2[_0x1361('0x2d')],_0x5ed6a2[_0x1361('0x2e')]);_0x5c3afa[_0x1361('0x32')]=_[_0x1361('0x31')](_0x5ed6a2[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x44a421[_0x1361('0x2e')][_0x1361('0x33')]));_0x5c3afa[_0x1361('0x32')]=_0x5c3afa['attributes'][_0x1361('0x3e')]?_0x5c3afa['attributes']:_0x5ed6a2[_0x1361('0x2d')];if(!_0x44a421[_0x1361('0x2e')][_0x1361('0x34')](_0x1361('0x51'))){_0x5c3afa[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x44a421[_0x1361('0x2e')]['limit']);_0x5c3afa[_0x1361('0x16')]=qs[_0x1361('0x16')](_0x44a421[_0x1361('0x2e')][_0x1361('0x16')]);}_0x5c3afa[_0x1361('0x35')]=qs[_0x1361('0x53')](_0x44a421[_0x1361('0x2e')][_0x1361('0x53')]);_0x5c3afa[_0x1361('0x38')]=qs['filters'](_[_0x1361('0x36')](_0x44a421['query'],_0x5ed6a2[_0x1361('0x30')]));_0x5c3afa['where'][_0x1361('0x54')]=_0x31e03c['id'];if(_0x44a421[_0x1361('0x2e')][_0x1361('0x37')]){_0x5c3afa['where']=_[_0x1361('0x39')](_0x5c3afa[_0x1361('0x38')],{'$or':_['map'](_0x5c3afa['attributes'],function(_0x206b45){var _0x35f3d9={};_0x35f3d9[_0x206b45]={'$like':'%'+_0x44a421[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x35f3d9;})});}_0x5c3afa=_['merge']({},_0x5c3afa,_0x44a421['options']);return db[_0x1361('0x52')][_0x1361('0x19')]({'where':_0x5c3afa[_0x1361('0x38')]})[_0x1361('0x1e')](function(_0x4caf6e){_0x122498[_0x1361('0x19')]=_0x4caf6e;if(_0x44a421['query']['includeAll']){_0x5c3afa[_0x1361('0x3a')]=[{'all':!![]}];}return db[_0x1361('0x52')][_0x1361('0x55')](_0x5c3afa);})['then'](function(_0x579adb){_0x122498['rows']=_0x579adb;return _0x122498;});}})[_0x1361('0x1e')](respondWithFilteredResult(_0x18acf8,_0x5c3afa))['catch'](handleError(_0x18acf8,null));};function char(_0x2fc1fb){return _0x1361('0x56')===typeof _0x2fc1fb?String[_0x1361('0x57')][_0x1361('0x1c')](null,arguments):_0x2fc1fb;}function needsEncapsulation(_0x265b50){return!!_0x265b50&&(_0x265b50[_0x1361('0x58')]()['indexOf'](char(0xd))>=0x0||_0x265b50['toString']()[_0x1361('0x59')](char(0xa))>=0x0||_0x265b50[_0x1361('0x58')]()[_0x1361('0x59')](char(0x2c))>=0x0||_0x265b50['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x128457){var _0x19bd77=char(0x22),_0xf1b938='\x5c'+char(0x22),_0x155823=_0x128457[_0x1361('0x58')]()[_0x1361('0x5a')](new RegExp(_0x19bd77,'g'),_0xf1b938);return _0x19bd77+_0x155823+_0x19bd77;}exports['getSummary']=function(_0x97c42e,_0x293f3c,_0x37b07e){var _0x47708a,_0x4b6868;var _0x56c574={'where':{'ProjectId':_0x97c42e[_0x1361('0x3d')]['id']}};if(_0x97c42e[_0x1361('0x2e')][_0x1361('0x5b')]){_0x56c574[_0x1361('0x38')][_0x1361('0x5c')]=JSON['parse'](_0x97c42e['query'][_0x1361('0x5b')]);}return db[_0x1361('0x50')][_0x1361('0x55')](_0x56c574)[_0x1361('0x1e')](handleEntityNotFound(_0x293f3c,null))[_0x1361('0x1e')](function(_0x3edce2){if(_0x3edce2){_0x47708a=_0x3edce2;return db[_0x1361('0x5d')][_0x1361('0x55')]({'where':{'SessionId':{'$in':_[_0x1361('0x27')](_0x47708a,'id')},'ProjectId':_0x97c42e[_0x1361('0x3d')]['id']},'order':'-createdAt'});}})[_0x1361('0x1e')](handleEntityNotFound(_0x293f3c,null))[_0x1361('0x1e')](function(_0x6bed12){if(_0x6bed12){_0x4b6868=_0x6bed12;var _0x497f3c={};for(var _0x11138d=0x0,_0xd6d2d5=_0x4b6868[_0x1361('0x3e')];_0x11138d<_0xd6d2d5;_0x11138d++){if(!_0x497f3c[_0x1361('0x34')](_0x4b6868[_0x11138d][_0x1361('0x5e')])){_0x497f3c[_0x4b6868[_0x11138d][_0x1361('0x5e')]]=needsEncapsulation(_0x4b6868[_0x11138d][_0x1361('0x5f')])?encapsulate(_0x4b6868[_0x11138d][_0x1361('0x5f')]):_0x4b6868[_0x11138d]['question'];}}var _0x3a8636=[],_0x18ff96={};for(var _0x28df1c=0x0,_0x59f4a9=_0x47708a['length'];_0x28df1c<_0x59f4a9;_0x28df1c++){_0x18ff96={'ProjectId':_0x97c42e[_0x1361('0x3d')]['id'],'SessionId':_0x47708a[_0x28df1c]['id'],'StartTime':moment(_0x47708a[_0x28df1c][_0x1361('0x5c')])[_0x1361('0x60')](_0x1361('0x61'))};for(var _0x3e2daa=0x0,_0x228ee4=_0x4b6868[_0x1361('0x3e')];_0x3e2daa<_0x228ee4;_0x3e2daa++){if(_0x4b6868[_0x3e2daa][_0x1361('0x62')]==_0x47708a[_0x28df1c]['id']&&_0x497f3c[_0x1361('0x34')](_0x4b6868[_0x3e2daa][_0x1361('0x5e')])){_0x18ff96[_0x497f3c[_0x4b6868[_0x3e2daa][_0x1361('0x5e')]]]=_0x4b6868[_0x3e2daa][_0x1361('0x63')];}}for(var _0x5a83ff in _0x497f3c){if(!_0x18ff96[_0x1361('0x34')](_0x497f3c[_0x5a83ff])){_0x18ff96[_0x497f3c[_0x5a83ff]]=null;}}_0x3a8636[_0x1361('0x64')](_0x18ff96);}return _0x3a8636;}})[_0x1361('0x1e')](function(_0x317d70){if(!_[_0x1361('0x65')](_0x317d70)){var _0x3252f0=toCsv(_0x317d70);var _0x41ed17=Date[_0x1361('0x66')]();fs['writeFileSync'](util[_0x1361('0x60')](_0x1361('0x67'),_0x97c42e[_0x1361('0x3d')]['id'],_0x41ed17),_0x3252f0);_0x293f3c[_0x1361('0x68')](_0x1361('0x69'),_0x1361('0x6a')+util[_0x1361('0x60')]('Jscripty_Project_%d_Summary_%s.csv',_0x97c42e['params']['id'],_0x41ed17));_0x293f3c[_0x1361('0x68')](_0x1361('0x6b'),_0x1361('0x6c'));return _0x293f3c['download'](util[_0x1361('0x60')](_0x1361('0x67'),_0x97c42e['params']['id'],_0x41ed17));}else{return _0x293f3c['sendStatus'](0xcc);}})[_0x1361('0x41')](handleError(_0x293f3c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2c8c41f..e30c574 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 _0x004c=['jscripty_projects','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','define'];(function(_0x24606a,_0x4f999){var _0x2168ce=function(_0x310646){while(--_0x310646){_0x24606a['push'](_0x24606a['shift']());}};_0x2168ce(++_0x4f999);}(_0x004c,0x85));var _0xc004=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x004c[_0x172747];return _0x509692;};'use strict';var _=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var logger=require(_0xc004('0x2'))(_0xc004('0x3'));var moment=require('moment');var BPromise=require(_0xc004('0x4'));var rp=require(_0xc004('0x5'));var fs=require('fs');var path=require(_0xc004('0x6'));var rimraf=require(_0xc004('0x7'));var config=require('../../config/environment');var attributes=require(_0xc004('0x8'));module['exports']=function(_0x2c7142,_0x25a58b){return _0x2c7142[_0xc004('0x9')]('JscriptyProject',attributes,{'tableName':_0xc004('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc906=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects'];(function(_0x55bbfd,_0x3b79a9){var _0x13b979=function(_0x175014){while(--_0x175014){_0x55bbfd['push'](_0x55bbfd['shift']());}};_0x13b979(++_0x3b79a9);}(_0xc906,0x1ad));var _0x6c90=function(_0x312c25,_0x2e123b){_0x312c25=_0x312c25-0x0;var _0x3074db=_0xc906[_0x312c25];return _0x3074db;};'use strict';var _=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var logger=require('../../config/logger')(_0x6c90('0x2'));var moment=require(_0x6c90('0x3'));var BPromise=require(_0x6c90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c90('0x5'));var rimraf=require(_0x6c90('0x6'));var config=require(_0x6c90('0x7'));var attributes=require(_0x6c90('0x8'));module[_0x6c90('0x9')]=function(_0x2b55b8,_0x5491d9){return _0x2b55b8['define']('JscriptyProject',attributes,{'tableName':_0x6c90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index dca41e3..e00d5a6 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1adbe1,_0xdaebdc){var _0x13c72a=function(_0x51df7a){while(--_0x51df7a){_0x1adbe1['push'](_0x1adbe1['shift']());}};_0x13c72a(++_0xdaebdc);}(_0x70e0,0x17b));var _0x070e=function(_0x397a20,_0x3d07d3){_0x397a20=_0x397a20-0x0;var _0x1d2500=_0x70e0[_0x397a20];return _0x1d2500;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x12226f,_0x282198){var _0x31bb52=function(_0x4c2425){while(--_0x4c2425){_0x12226f['push'](_0x12226f['shift']());}};_0x31bb52(++_0x282198);}(_0xaa88,0x137));var _0x8aa8=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xaa88[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0c88ff6..8951f5b 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 _0x3a21=['/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2d465c,_0xf50b11){var _0x4fd0f0=function(_0x28e424){while(--_0x28e424){_0x2d465c['push'](_0x2d465c['shift']());}};_0x4fd0f0(++_0xf50b11);}(_0x3a21,0x185));var _0x13a2=function(_0x55849c,_0x3ab6a1){_0x55849c=_0x55849c-0x0;var _0xf94a3d=_0x3a21[_0x55849c];return _0xf94a3d;};'use strict';var multer=require(_0x13a2('0x0'));var util=require(_0x13a2('0x1'));var path=require('path');var timeout=require(_0x13a2('0x2'));var express=require('express');var router=express[_0x13a2('0x3')]();var fs_extra=require(_0x13a2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x13a2('0x5'));var config=require(_0x13a2('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x13a2('0x7')]('/',auth[_0x13a2('0x8')](),controller[_0x13a2('0x9')]);router[_0x13a2('0x7')](_0x13a2('0xa'),auth['isAuthenticated'](),controller[_0x13a2('0xb')]);router[_0x13a2('0x7')](_0x13a2('0xc'),auth[_0x13a2('0x8')](),controller[_0x13a2('0xd')]);router[_0x13a2('0xe')]('/',auth[_0x13a2('0x8')](),controller[_0x13a2('0xf')]);router[_0x13a2('0x10')](_0x13a2('0xc'),auth['isAuthenticated'](),controller[_0x13a2('0x11')]);router['delete']('/:id',auth[_0x13a2('0x8')](),controller[_0x13a2('0x12')]);module['exports']=router; \ No newline at end of file +var _0x60e8=['update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','/:id','show','post','put'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x60e8,0x1ee));var _0x860e=function(_0x2c62df,_0x4e95fe){_0x2c62df=_0x2c62df-0x0;var _0x3cc941=_0x60e8[_0x2c62df];return _0x3cc941;};'use strict';var multer=require(_0x860e('0x0'));var util=require(_0x860e('0x1'));var path=require(_0x860e('0x2'));var timeout=require('connect-timeout');var express=require(_0x860e('0x3'));var router=express[_0x860e('0x4')]();var fs_extra=require(_0x860e('0x5'));var auth=require(_0x860e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x860e('0x7'));var controller=require(_0x860e('0x8'));router[_0x860e('0x9')]('/',auth['isAuthenticated'](),controller[_0x860e('0xa')]);router[_0x860e('0x9')]('/describe',auth[_0x860e('0xb')](),controller['describe']);router[_0x860e('0x9')](_0x860e('0xc'),auth[_0x860e('0xb')](),controller[_0x860e('0xd')]);router[_0x860e('0xe')]('/',auth[_0x860e('0xb')](),controller['create']);router[_0x860e('0xf')](_0x860e('0xc'),auth[_0x860e('0xb')](),controller[_0x860e('0x10')]);router['delete'](_0x860e('0xc'),auth[_0x860e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ccd5a06..9dcca65 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x3dd33a,_0x458f76){_0x3dd33a=_0x3dd33a-0x0;var _0xca7a0a=_0x7a54[_0x3dd33a];return _0xca7a0a;};'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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x114960,_0x2dd296){_0x114960=_0x114960-0x0;var _0x59db75=_0x7a54[_0x114960];return _0x59db75;};'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 88bf8b3..df782da 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 _0x4e6b=['pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','count','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4e6b,0x138));var _0xb4e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e6b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb4e6('0x0'));var rimraf=require(_0xb4e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4e6('0x2'));var rp=require(_0xb4e6('0x3'));var moment=require(_0xb4e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4e6('0x5'));var util=require(_0xb4e6('0x6'));var path=require(_0xb4e6('0x7'));var sox=require(_0xb4e6('0x8'));var csv=require(_0xb4e6('0x9'));var ejs=require(_0xb4e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4e6('0xb'));var squel=require('squel');var crypto=require(_0xb4e6('0xc'));var jsforce=require(_0xb4e6('0xd'));var deskjs=require(_0xb4e6('0xe'));var toCsv=require(_0xb4e6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb4e6('0xf'));var authService=require(_0xb4e6('0x10'));var qs=require(_0xb4e6('0x11'));var as=require(_0xb4e6('0x12'));var hardwareService=require(_0xb4e6('0x13'));var logger=require(_0xb4e6('0x14'))('api');var utils=require(_0xb4e6('0x15'));var config=require(_0xb4e6('0x16'));var licenseUtil=require(_0xb4e6('0x17'));var db=require(_0xb4e6('0x18'))['db'];function respondWithStatusCode(_0x2e62e2,_0x22f958){_0x22f958=_0x22f958||0xcc;return function(_0x1a8b1d){if(_0x1a8b1d){return _0x2e62e2['sendStatus'](_0x22f958);}return _0x2e62e2[_0xb4e6('0x19')](_0x22f958)['end']();};}function respondWithResult(_0x36ba8d,_0x13a8ba){_0x13a8ba=_0x13a8ba||0xc8;return function(_0x3cb92b){if(_0x3cb92b){return _0x36ba8d[_0xb4e6('0x19')](_0x13a8ba)[_0xb4e6('0x1a')](_0x3cb92b);}};}function respondWithFilteredResult(_0x58f225,_0x40f841){return function(_0x5954dd){if(_0x5954dd){var _0x5f403f=typeof _0x40f841[_0xb4e6('0x1b')]===_0xb4e6('0x1c')&&typeof _0x40f841['limit']===_0xb4e6('0x1c');var _0x2d4a32=_0x5954dd['count'];var _0x474d77=_0x5f403f?0x0:_0x40f841[_0xb4e6('0x1b')];var _0x1069a0=_0x5f403f?_0x5954dd['count']:_0x40f841[_0xb4e6('0x1b')]+_0x40f841[_0xb4e6('0x1d')];var _0x33dec2;if(_0x1069a0>=_0x2d4a32){_0x1069a0=_0x2d4a32;_0x33dec2=0xc8;}else{_0x33dec2=0xce;}_0x58f225['status'](_0x33dec2);return _0x58f225[_0xb4e6('0x1e')](_0xb4e6('0x1f'),_0x474d77+'-'+_0x1069a0+'/'+_0x2d4a32)[_0xb4e6('0x1a')](_0x5954dd);}return null;};}function patchUpdates(_0xaeacf3){return function(_0x263ab4){try{jsonpatch['apply'](_0x263ab4,_0xaeacf3,!![]);}catch(_0xb6bbf9){return BPromise['reject'](_0xb6bbf9);}return _0x263ab4[_0xb4e6('0x20')]();};}function saveUpdates(_0x293428,_0x511a7d){return function(_0x3f2fa2){if(_0x3f2fa2){return _0x3f2fa2['update'](_0x293428)[_0xb4e6('0x21')](function(_0x524cf0){return _0x524cf0;});}return null;};}function removeEntity(_0x4752a4,_0x2fcbea){return function(_0x4b499f){if(_0x4b499f){return _0x4b499f[_0xb4e6('0x22')]()['then'](function(){_0x4752a4[_0xb4e6('0x19')](0xcc)[_0xb4e6('0x23')]();});}};}function handleEntityNotFound(_0x55bcc3,_0x4faad9){return function(_0x58b850){if(!_0x58b850){_0x55bcc3[_0xb4e6('0x24')](0x194);}return _0x58b850;};}function handleError(_0x380af3,_0x801085){_0x801085=_0x801085||0x1f4;return function(_0x46cc50){logger[_0xb4e6('0x25')](_0x46cc50[_0xb4e6('0x26')]);if(_0x46cc50[_0xb4e6('0x27')]){delete _0x46cc50[_0xb4e6('0x27')];}_0x380af3[_0xb4e6('0x19')](_0x801085)[_0xb4e6('0x28')](_0x46cc50);};}exports[_0xb4e6('0x29')]=function(_0x425949,_0x284616){var _0x5d4cd6={},_0x17e47e={},_0x75bbde={'count':0x0,'rows':[]};var _0x55edb6=_[_0xb4e6('0x2a')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x1a7442){return{'name':_0x1a7442[_0xb4e6('0x2b')],'type':_0x1a7442[_0xb4e6('0x2c')][_0xb4e6('0x2d')]};});_0x17e47e[_0xb4e6('0x2e')]=_['map'](_0x55edb6,'name');_0x17e47e[_0xb4e6('0x2f')]=_[_0xb4e6('0x30')](_0x425949['query']);_0x17e47e[_0xb4e6('0x31')]=_['intersection'](_0x17e47e[_0xb4e6('0x2e')],_0x17e47e[_0xb4e6('0x2f')]);_0x5d4cd6[_0xb4e6('0x32')]=_[_0xb4e6('0x33')](_0x17e47e[_0xb4e6('0x2e')],qs['fields'](_0x425949[_0xb4e6('0x2f')][_0xb4e6('0x34')]));_0x5d4cd6[_0xb4e6('0x32')]=_0x5d4cd6[_0xb4e6('0x32')][_0xb4e6('0x35')]?_0x5d4cd6['attributes']:_0x17e47e[_0xb4e6('0x2e')];if(!_0x425949[_0xb4e6('0x2f')]['hasOwnProperty'](_0xb4e6('0x36'))){_0x5d4cd6[_0xb4e6('0x1d')]=qs['limit'](_0x425949[_0xb4e6('0x2f')][_0xb4e6('0x1d')]);_0x5d4cd6[_0xb4e6('0x1b')]=qs['offset'](_0x425949[_0xb4e6('0x2f')][_0xb4e6('0x1b')]);}_0x5d4cd6[_0xb4e6('0x37')]=qs[_0xb4e6('0x38')](_0x425949[_0xb4e6('0x2f')][_0xb4e6('0x38')]);_0x5d4cd6[_0xb4e6('0x39')]=qs[_0xb4e6('0x31')](_[_0xb4e6('0x3a')](_0x425949['query'],_0x17e47e[_0xb4e6('0x31')]),_0x55edb6);if(_0x425949['query'][_0xb4e6('0x3b')]){_0x5d4cd6[_0xb4e6('0x39')]=_[_0xb4e6('0x3c')](_0x5d4cd6[_0xb4e6('0x39')],{'$or':_['map'](_0x55edb6,function(_0x1029b7){if(_0x1029b7['type']!==_0xb4e6('0x3d')){var _0x2feba0={};_0x2feba0[_0x1029b7['name']]={'$like':'%'+_0x425949['query'][_0xb4e6('0x3b')]+'%'};return _0x2feba0;}})});}_0x5d4cd6=_['merge']({},_0x5d4cd6,_0x425949[_0xb4e6('0x3e')]);var _0x13aeca={'where':_0x5d4cd6[_0xb4e6('0x39')]};return db[_0xb4e6('0x3f')][_0xb4e6('0x40')](_0x13aeca)[_0xb4e6('0x21')](function(_0xf41119){_0x75bbde['count']=_0xf41119;if(_0x425949[_0xb4e6('0x2f')]['includeAll']){_0x5d4cd6[_0xb4e6('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x5d4cd6);})[_0xb4e6('0x21')](function(_0x260308){_0x75bbde['rows']=_0x260308;return _0x75bbde;})[_0xb4e6('0x21')](respondWithFilteredResult(_0x284616,_0x5d4cd6))[_0xb4e6('0x42')](handleError(_0x284616,null));};exports[_0xb4e6('0x43')]=function(_0x4d0432,_0x16230b){var _0x126458={'raw':!![],'where':{'id':_0x4d0432[_0xb4e6('0x44')]['id']}},_0x130e1e={};_0x130e1e[_0xb4e6('0x2e')]=_['keys'](db[_0xb4e6('0x3f')][_0xb4e6('0x45')]);_0x130e1e['query']=_[_0xb4e6('0x30')](_0x4d0432[_0xb4e6('0x2f')]);_0x130e1e[_0xb4e6('0x31')]=_[_0xb4e6('0x33')](_0x130e1e[_0xb4e6('0x2e')],_0x130e1e['query']);_0x126458[_0xb4e6('0x32')]=_[_0xb4e6('0x33')](_0x130e1e['model'],qs[_0xb4e6('0x34')](_0x4d0432[_0xb4e6('0x2f')][_0xb4e6('0x34')]));_0x126458[_0xb4e6('0x32')]=_0x126458[_0xb4e6('0x32')][_0xb4e6('0x35')]?_0x126458[_0xb4e6('0x32')]:_0x130e1e[_0xb4e6('0x2e')];if(_0x4d0432[_0xb4e6('0x2f')]['includeAll']){_0x126458[_0xb4e6('0x41')]=[{'all':!![]}];}_0x126458=_[_0xb4e6('0x3c')]({},_0x126458,_0x4d0432[_0xb4e6('0x3e')]);return db[_0xb4e6('0x3f')][_0xb4e6('0x46')](_0x126458)[_0xb4e6('0x21')](handleEntityNotFound(_0x16230b,null))[_0xb4e6('0x21')](respondWithResult(_0x16230b,null))[_0xb4e6('0x42')](handleError(_0x16230b,null));};exports[_0xb4e6('0x47')]=function(_0x216c2d,_0x473003){return db[_0xb4e6('0x3f')][_0xb4e6('0x47')](_0x216c2d[_0xb4e6('0x48')],{})[_0xb4e6('0x21')](respondWithResult(_0x473003,0xc9))[_0xb4e6('0x42')](handleError(_0x473003,null));};exports['update']=function(_0x29324d,_0x5b31a1){if(_0x29324d[_0xb4e6('0x48')]['id']){delete _0x29324d[_0xb4e6('0x48')]['id'];}return db[_0xb4e6('0x3f')][_0xb4e6('0x46')]({'where':{'id':_0x29324d[_0xb4e6('0x44')]['id']}})[_0xb4e6('0x21')](handleEntityNotFound(_0x5b31a1,null))[_0xb4e6('0x21')](saveUpdates(_0x29324d[_0xb4e6('0x48')],null))[_0xb4e6('0x21')](respondWithResult(_0x5b31a1,null))[_0xb4e6('0x42')](handleError(_0x5b31a1,null));};exports[_0xb4e6('0x22')]=function(_0x529f08,_0x1e3e5e){return db[_0xb4e6('0x3f')]['find']({'where':{'id':_0x529f08[_0xb4e6('0x44')]['id']}})[_0xb4e6('0x21')](handleEntityNotFound(_0x1e3e5e,null))['then'](removeEntity(_0x1e3e5e,null))['catch'](handleError(_0x1e3e5e,null));};exports[_0xb4e6('0x49')]=function(_0x2ac571,_0x4cd499){return db[_0xb4e6('0x3f')][_0xb4e6('0x49')]()[_0xb4e6('0x21')](respondWithResult(_0x4cd499,null))[_0xb4e6('0x42')](handleError(_0x4cd499,null));}; \ No newline at end of file +var _0xfb69=['fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','zip-dir'];(function(_0x22e930,_0x32e4c7){var _0x7afabf=function(_0x2c5873){while(--_0x2c5873){_0x22e930['push'](_0x22e930['shift']());}};_0x7afabf(++_0x32e4c7);}(_0xfb69,0x1b5));var _0x9fb6=function(_0x2b5928,_0x458693){_0x2b5928=_0x2b5928-0x0;var _0xb5131c=_0xfb69[_0x2b5928];return _0xb5131c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9fb6('0x0'));var jsonpatch=require(_0x9fb6('0x1'));var rp=require(_0x9fb6('0x2'));var moment=require('moment');var BPromise=require(_0x9fb6('0x3'));var Mustache=require(_0x9fb6('0x4'));var util=require('util');var path=require(_0x9fb6('0x5'));var sox=require(_0x9fb6('0x6'));var csv=require('to-csv');var ejs=require(_0x9fb6('0x7'));var fs=require('fs');var fs_extra=require(_0x9fb6('0x8'));var _=require(_0x9fb6('0x9'));var squel=require(_0x9fb6('0xa'));var crypto=require(_0x9fb6('0xb'));var jsforce=require(_0x9fb6('0xc'));var deskjs=require(_0x9fb6('0xd'));var toCsv=require(_0x9fb6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9fb6('0x10'));var as=require(_0x9fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9fb6('0x12'));var utils=require(_0x9fb6('0x13'));var config=require(_0x9fb6('0x14'));var licenseUtil=require(_0x9fb6('0x15'));var db=require(_0x9fb6('0x16'))['db'];function respondWithStatusCode(_0x29a499,_0x2ad358){_0x2ad358=_0x2ad358||0xcc;return function(_0xd1aed4){if(_0xd1aed4){return _0x29a499[_0x9fb6('0x17')](_0x2ad358);}return _0x29a499[_0x9fb6('0x18')](_0x2ad358)[_0x9fb6('0x19')]();};}function respondWithResult(_0x49e732,_0x24aa5f){_0x24aa5f=_0x24aa5f||0xc8;return function(_0x34df5e){if(_0x34df5e){return _0x49e732['status'](_0x24aa5f)[_0x9fb6('0x1a')](_0x34df5e);}};}function respondWithFilteredResult(_0x126b0a,_0x1f5e83){return function(_0x451480){if(_0x451480){var _0x270932=typeof _0x1f5e83[_0x9fb6('0x1b')]==='undefined'&&typeof _0x1f5e83['limit']===_0x9fb6('0x1c');var _0x42cfc0=_0x451480[_0x9fb6('0x1d')];var _0x15cd2f=_0x270932?0x0:_0x1f5e83[_0x9fb6('0x1b')];var _0x41fa24=_0x270932?_0x451480[_0x9fb6('0x1d')]:_0x1f5e83['offset']+_0x1f5e83[_0x9fb6('0x1e')];var _0x2bdaf4;if(_0x41fa24>=_0x42cfc0){_0x41fa24=_0x42cfc0;_0x2bdaf4=0xc8;}else{_0x2bdaf4=0xce;}_0x126b0a[_0x9fb6('0x18')](_0x2bdaf4);return _0x126b0a[_0x9fb6('0x1f')](_0x9fb6('0x20'),_0x15cd2f+'-'+_0x41fa24+'/'+_0x42cfc0)['json'](_0x451480);}return null;};}function patchUpdates(_0x53a509){return function(_0x62c20b){try{jsonpatch[_0x9fb6('0x21')](_0x62c20b,_0x53a509,!![]);}catch(_0x25f8ac){return BPromise['reject'](_0x25f8ac);}return _0x62c20b['save']();};}function saveUpdates(_0x5b7bea,_0x685717){return function(_0x2c75dd){if(_0x2c75dd){return _0x2c75dd[_0x9fb6('0x22')](_0x5b7bea)['then'](function(_0x457427){return _0x457427;});}return null;};}function removeEntity(_0x1a2e93,_0x58a372){return function(_0x344a41){if(_0x344a41){return _0x344a41[_0x9fb6('0x23')]()[_0x9fb6('0x24')](function(){_0x1a2e93['status'](0xcc)[_0x9fb6('0x19')]();});}};}function handleEntityNotFound(_0x35a862,_0x24e2a2){return function(_0x11c4b6){if(!_0x11c4b6){_0x35a862[_0x9fb6('0x17')](0x194);}return _0x11c4b6;};}function handleError(_0x149045,_0x4b8c4a){_0x4b8c4a=_0x4b8c4a||0x1f4;return function(_0x5aac8c){logger[_0x9fb6('0x25')](_0x5aac8c[_0x9fb6('0x26')]);if(_0x5aac8c[_0x9fb6('0x27')]){delete _0x5aac8c[_0x9fb6('0x27')];}_0x149045['status'](_0x4b8c4a)[_0x9fb6('0x28')](_0x5aac8c);};}exports['index']=function(_0x44afbb,_0x4b74c5){var _0xeea192={},_0x114db2={},_0x1fe35={'count':0x0,'rows':[]};var _0x21ec0b=_[_0x9fb6('0x29')](db[_0x9fb6('0x2a')][_0x9fb6('0x2b')],function(_0xd7547a){return{'name':_0xd7547a[_0x9fb6('0x2c')],'type':_0xd7547a[_0x9fb6('0x2d')][_0x9fb6('0x2e')]};});_0x114db2[_0x9fb6('0x2f')]=_[_0x9fb6('0x29')](_0x21ec0b,_0x9fb6('0x27'));_0x114db2[_0x9fb6('0x30')]=_[_0x9fb6('0x31')](_0x44afbb['query']);_0x114db2[_0x9fb6('0x32')]=_['intersection'](_0x114db2[_0x9fb6('0x2f')],_0x114db2['query']);_0xeea192[_0x9fb6('0x33')]=_[_0x9fb6('0x34')](_0x114db2[_0x9fb6('0x2f')],qs[_0x9fb6('0x35')](_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x35')]));_0xeea192[_0x9fb6('0x33')]=_0xeea192[_0x9fb6('0x33')][_0x9fb6('0x36')]?_0xeea192[_0x9fb6('0x33')]:_0x114db2[_0x9fb6('0x2f')];if(!_0x44afbb[_0x9fb6('0x30')]['hasOwnProperty'](_0x9fb6('0x37'))){_0xeea192['limit']=qs[_0x9fb6('0x1e')](_0x44afbb[_0x9fb6('0x30')]['limit']);_0xeea192[_0x9fb6('0x1b')]=qs[_0x9fb6('0x1b')](_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x1b')]);}_0xeea192[_0x9fb6('0x38')]=qs['sort'](_0x44afbb['query'][_0x9fb6('0x39')]);_0xeea192['where']=qs[_0x9fb6('0x32')](_[_0x9fb6('0x3a')](_0x44afbb[_0x9fb6('0x30')],_0x114db2[_0x9fb6('0x32')]),_0x21ec0b);if(_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x3b')]){_0xeea192[_0x9fb6('0x3c')]=_[_0x9fb6('0x3d')](_0xeea192[_0x9fb6('0x3c')],{'$or':_[_0x9fb6('0x29')](_0x21ec0b,function(_0x3e49b3){if(_0x3e49b3[_0x9fb6('0x2d')]!==_0x9fb6('0x3e')){var _0xf83c0c={};_0xf83c0c[_0x3e49b3[_0x9fb6('0x27')]]={'$like':'%'+_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x3b')]+'%'};return _0xf83c0c;}})});}_0xeea192=_['merge']({},_0xeea192,_0x44afbb[_0x9fb6('0x3f')]);var _0x3c36e2={'where':_0xeea192[_0x9fb6('0x3c')]};return db[_0x9fb6('0x2a')][_0x9fb6('0x1d')](_0x3c36e2)[_0x9fb6('0x24')](function(_0x2a6b7e){_0x1fe35[_0x9fb6('0x1d')]=_0x2a6b7e;if(_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x40')]){_0xeea192[_0x9fb6('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x9fb6('0x42')](_0xeea192);})[_0x9fb6('0x24')](function(_0x59c709){_0x1fe35['rows']=_0x59c709;return _0x1fe35;})[_0x9fb6('0x24')](respondWithFilteredResult(_0x4b74c5,_0xeea192))[_0x9fb6('0x43')](handleError(_0x4b74c5,null));};exports['show']=function(_0x2cf205,_0x3fcba6){var _0x4cf762={'raw':!![],'where':{'id':_0x2cf205[_0x9fb6('0x44')]['id']}},_0x3bbe33={};_0x3bbe33[_0x9fb6('0x2f')]=_['keys'](db[_0x9fb6('0x2a')][_0x9fb6('0x2b')]);_0x3bbe33[_0x9fb6('0x30')]=_['keys'](_0x2cf205[_0x9fb6('0x30')]);_0x3bbe33[_0x9fb6('0x32')]=_['intersection'](_0x3bbe33[_0x9fb6('0x2f')],_0x3bbe33[_0x9fb6('0x30')]);_0x4cf762[_0x9fb6('0x33')]=_['intersection'](_0x3bbe33[_0x9fb6('0x2f')],qs[_0x9fb6('0x35')](_0x2cf205[_0x9fb6('0x30')]['fields']));_0x4cf762[_0x9fb6('0x33')]=_0x4cf762[_0x9fb6('0x33')][_0x9fb6('0x36')]?_0x4cf762[_0x9fb6('0x33')]:_0x3bbe33[_0x9fb6('0x2f')];if(_0x2cf205[_0x9fb6('0x30')][_0x9fb6('0x40')]){_0x4cf762[_0x9fb6('0x41')]=[{'all':!![]}];}_0x4cf762=_[_0x9fb6('0x3d')]({},_0x4cf762,_0x2cf205['options']);return db['JscriptyQuestionReport'][_0x9fb6('0x45')](_0x4cf762)[_0x9fb6('0x24')](handleEntityNotFound(_0x3fcba6,null))[_0x9fb6('0x24')](respondWithResult(_0x3fcba6,null))[_0x9fb6('0x43')](handleError(_0x3fcba6,null));};exports[_0x9fb6('0x46')]=function(_0x1f8525,_0x406ee4){return db['JscriptyQuestionReport']['create'](_0x1f8525[_0x9fb6('0x47')],{})[_0x9fb6('0x24')](respondWithResult(_0x406ee4,0xc9))['catch'](handleError(_0x406ee4,null));};exports[_0x9fb6('0x22')]=function(_0x2ec66a,_0x36cc27){if(_0x2ec66a[_0x9fb6('0x47')]['id']){delete _0x2ec66a[_0x9fb6('0x47')]['id'];}return db[_0x9fb6('0x2a')][_0x9fb6('0x45')]({'where':{'id':_0x2ec66a[_0x9fb6('0x44')]['id']}})[_0x9fb6('0x24')](handleEntityNotFound(_0x36cc27,null))['then'](saveUpdates(_0x2ec66a['body'],null))[_0x9fb6('0x24')](respondWithResult(_0x36cc27,null))['catch'](handleError(_0x36cc27,null));};exports[_0x9fb6('0x23')]=function(_0x1c8ac2,_0x26c619){return db[_0x9fb6('0x2a')][_0x9fb6('0x45')]({'where':{'id':_0x1c8ac2[_0x9fb6('0x44')]['id']}})[_0x9fb6('0x24')](handleEntityNotFound(_0x26c619,null))[_0x9fb6('0x24')](removeEntity(_0x26c619,null))['catch'](handleError(_0x26c619,null));};exports[_0x9fb6('0x48')]=function(_0x4efb75,_0x44130b){return db['JscriptyQuestionReport'][_0x9fb6('0x48')]()[_0x9fb6('0x24')](respondWithResult(_0x44130b,null))['catch'](handleError(_0x44130b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8b10be3..0dece33 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 _0x98e6=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98e6,0x18e));var _0x698e=function(_0x262baa,_0x283058){_0x262baa=_0x262baa-0x0;var _0x4f2257=_0x98e6[_0x262baa];return _0x4f2257;};'use strict';var _=require(_0x698e('0x0'));var util=require(_0x698e('0x1'));var logger=require('../../config/logger')(_0x698e('0x2'));var moment=require(_0x698e('0x3'));var BPromise=require(_0x698e('0x4'));var rp=require(_0x698e('0x5'));var fs=require('fs');var path=require(_0x698e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x698e('0x7'));module['exports']=function(_0x2adbbd,_0x4a80ec){return _0x2adbbd[_0x698e('0x8')](_0x698e('0x9'),attributes,{'tableName':_0x698e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34fc=['request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger','moment'];(function(_0xfc959c,_0x4660c){var _0xa12959=function(_0x474863){while(--_0x474863){_0xfc959c['push'](_0xfc959c['shift']());}};_0xa12959(++_0x4660c);}(_0x34fc,0xcf));var _0xc34f=function(_0x38f612,_0x2c77d7){_0x38f612=_0x38f612-0x0;var _0x160ba7=_0x34fc[_0x38f612];return _0x160ba7;};'use strict';var _=require('lodash');var util=require(_0xc34f('0x0'));var logger=require(_0xc34f('0x1'))('api');var moment=require(_0xc34f('0x2'));var BPromise=require('bluebird');var rp=require(_0xc34f('0x3'));var fs=require('fs');var path=require(_0xc34f('0x4'));var rimraf=require(_0xc34f('0x5'));var config=require('../../config/environment');var attributes=require(_0xc34f('0x6'));module[_0xc34f('0x7')]=function(_0x53ac89,_0x163da1){return _0x53ac89[_0xc34f('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0xc34f('0x9'),'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 2972b05..afa7854 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 _0x76c7=['../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x76c7,0x1b0));var _0x776c=function(_0x32fc54,_0x13e113){_0x32fc54=_0x32fc54-0x0;var _0x15fc46=_0x76c7[_0x32fc54];return _0x15fc46;};'use strict';var _=require(_0x776c('0x0'));var util=require(_0x776c('0x1'));var moment=require(_0x776c('0x2'));var BPromise=require(_0x776c('0x3'));var rs=require(_0x776c('0x4'));var fs=require('fs');var Redis=require(_0x776c('0x5'));var db=require(_0x776c('0x6'))['db'];var utils=require(_0x776c('0x7'));var logger=require(_0x776c('0x8'))(_0x776c('0x9'));var config=require(_0x776c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x776c('0xb')][_0x776c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f99f1,_0x50462a,_0x384439){return new BPromise(function(_0x2978fc,_0x1415bc){return client[_0x776c('0xd')](_0x1f99f1,_0x384439)[_0x776c('0xe')](function(_0x576647){logger[_0x776c('0xf')](_0x776c('0x10'),_0x50462a,_0x776c('0x11'));logger[_0x776c('0x12')](_0x776c('0x13'),_0x50462a,_0x776c('0x11'),JSON[_0x776c('0x14')](_0x576647));if(_0x576647[_0x776c('0x15')]){if(_0x576647['error'][_0x776c('0x16')]===0x1f4){logger[_0x776c('0x15')](_0x776c('0x10'),_0x50462a,_0x576647[_0x776c('0x15')]['message']);return _0x1415bc(_0x576647[_0x776c('0x15')][_0x776c('0x17')]);}logger['error'](_0x776c('0x10'),_0x50462a,_0x576647[_0x776c('0x15')][_0x776c('0x17')]);return _0x2978fc(_0x576647['error']['message']);}else{logger[_0x776c('0xf')](_0x776c('0x10'),_0x50462a,_0x776c('0x11'));_0x2978fc(_0x576647[_0x776c('0x18')]['message']);}})[_0x776c('0x19')](function(_0x452d63){logger[_0x776c('0x15')](_0x776c('0x10'),_0x50462a,_0x452d63);_0x1415bc(_0x452d63);});});} \ No newline at end of file +var _0xb643=['rpc','jayson/promise','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb643,0x151));var _0x3b64=function(_0x1e55e6,_0x4edd41){_0x1e55e6=_0x1e55e6-0x0;var _0x3fd4ca=_0xb643[_0x1e55e6];return _0x3fd4ca;};'use strict';var _=require('lodash');var util=require(_0x3b64('0x0'));var moment=require('moment');var BPromise=require(_0x3b64('0x1'));var rs=require(_0x3b64('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b64('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b64('0x4'))(_0x3b64('0x5'));var config=require('../../config/environment');var jayson=require(_0x3b64('0x6'));var client=jayson['client'][_0x3b64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ab978,_0x572a2f,_0x49a607){return new BPromise(function(_0x4040b5,_0x16fffc){return client['request'](_0x2ab978,_0x49a607)[_0x3b64('0x8')](function(_0x5dde66){logger[_0x3b64('0x9')](_0x3b64('0xa'),_0x572a2f,_0x3b64('0xb'));logger[_0x3b64('0xc')](_0x3b64('0xd'),_0x572a2f,_0x3b64('0xb'),JSON[_0x3b64('0xe')](_0x5dde66));if(_0x5dde66[_0x3b64('0xf')]){if(_0x5dde66[_0x3b64('0xf')]['code']===0x1f4){logger['error'](_0x3b64('0xa'),_0x572a2f,_0x5dde66[_0x3b64('0xf')][_0x3b64('0x10')]);return _0x16fffc(_0x5dde66[_0x3b64('0xf')]['message']);}logger[_0x3b64('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x572a2f,_0x5dde66['error']['message']);return _0x4040b5(_0x5dde66[_0x3b64('0xf')][_0x3b64('0x10')]);}else{logger[_0x3b64('0x9')](_0x3b64('0xa'),_0x572a2f,_0x3b64('0xb'));_0x4040b5(_0x5dde66['result']['message']);}})[_0x3b64('0x11')](function(_0x2ab63a){logger[_0x3b64('0xf')](_0x3b64('0xa'),_0x572a2f,_0x2ab63a);_0x16fffc(_0x2ab63a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 762e6f6..1d5754a 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 _0x2892=['express','Router','fs-extra','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe','show','/:id/questions','getQuestions','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2892,0x15d));var _0x2289=function(_0x3cdc45,_0x161056){_0x3cdc45=_0x3cdc45-0x0;var _0x409510=_0x2892[_0x3cdc45];return _0x409510;};'use strict';var multer=require(_0x2289('0x0'));var util=require(_0x2289('0x1'));var path=require('path');var timeout=require(_0x2289('0x2'));var express=require(_0x2289('0x3'));var router=express[_0x2289('0x4')]();var fs_extra=require(_0x2289('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2289('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2289('0x7')]);router[_0x2289('0x8')](_0x2289('0x9'),auth[_0x2289('0xa')](),controller[_0x2289('0xb')]);router[_0x2289('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2289('0xc')]);router[_0x2289('0x8')](_0x2289('0xd'),auth[_0x2289('0xa')](),controller[_0x2289('0xe')]);router[_0x2289('0xf')]('/',auth[_0x2289('0xa')](),controller['create']);router[_0x2289('0x10')](_0x2289('0x11'),auth['isAuthenticated'](),controller[_0x2289('0x12')]);router[_0x2289('0x13')]('/:id',auth[_0x2289('0xa')](),controller[_0x2289('0x14')]);module[_0x2289('0x15')]=router; \ No newline at end of file +var _0x41a7=['isAuthenticated','index','show','/:id/questions','getQuestions','put','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x54ba7c,_0x57622e){var _0x5cbeab=function(_0x115f47){while(--_0x115f47){_0x54ba7c['push'](_0x54ba7c['shift']());}};_0x5cbeab(++_0x57622e);}(_0x41a7,0xf4));var _0x741a=function(_0x5597eb,_0x6d296c){_0x5597eb=_0x5597eb-0x0;var _0x1589d6=_0x41a7[_0x5597eb];return _0x1589d6;};'use strict';var multer=require(_0x741a('0x0'));var util=require('util');var path=require(_0x741a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x741a('0x2')]();var fs_extra=require(_0x741a('0x3'));var auth=require(_0x741a('0x4'));var interaction=require(_0x741a('0x5'));var config=require(_0x741a('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x741a('0x7')]('/',auth[_0x741a('0x8')](),controller[_0x741a('0x9')]);router[_0x741a('0x7')]('/describe',auth[_0x741a('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x741a('0xa')]);router[_0x741a('0x7')](_0x741a('0xb'),auth['isAuthenticated'](),controller[_0x741a('0xc')]);router['post']('/',auth[_0x741a('0x8')](),controller['create']);router[_0x741a('0xd')](_0x741a('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x741a('0xf')](_0x741a('0xe'),auth[_0x741a('0x8')](),controller[_0x741a('0x10')]);module[_0x741a('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 8ed7f7a..0894705 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 _0x3d30=['format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','exports','setDataValue'];(function(_0x498c9a,_0x5cda15){var _0x328859=function(_0x37a83c){while(--_0x37a83c){_0x498c9a['push'](_0x498c9a['shift']());}};_0x328859(++_0x5cda15);}(_0x3d30,0x6a));var _0x03d3=function(_0x2b52d6,_0x579168){_0x2b52d6=_0x2b52d6-0x0;var _0x477173=_0x3d30[_0x2b52d6];return _0x477173;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x03d3('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x12261f){this['setDataValue']('starttime',_0x12261f);this[_0x03d3('0x1')]('endtime',moment()[_0x03d3('0x2')](_0x03d3('0x3')));}},'endtime':{'type':Sequelize[_0x03d3('0x4')]},'membername':{'type':Sequelize[_0x03d3('0x5')]},'projectname':{'type':Sequelize[_0x03d3('0x5')]},'queue':{'type':Sequelize[_0x03d3('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x03d3('0x5')]},'calleridnum':{'type':Sequelize[_0x03d3('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd26f=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x28b1d3,_0x53238d){var _0x12066c=function(_0x3c439c){while(--_0x3c439c){_0x28b1d3['push'](_0x28b1d3['shift']());}};_0x12066c(++_0x53238d);}(_0xd26f,0x81));var _0xfd26=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd26f[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0xfd26('0x0'));var Sequelize=require(_0xfd26('0x1'));module[_0xfd26('0x2')]={'starttime':{'type':Sequelize[_0xfd26('0x3')],'set':function(_0x2b2b99){this[_0xfd26('0x4')](_0xfd26('0x5'),_0x2b2b99);this[_0xfd26('0x4')]('endtime',moment()[_0xfd26('0x6')](_0xfd26('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xfd26('0x8')]},'projectname':{'type':Sequelize[_0xfd26('0x8')]},'queue':{'type':Sequelize[_0xfd26('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfd26('0x8')]},'calleridnum':{'type':Sequelize[_0xfd26('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 0d53542..ea30af2 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 _0xd4ff=['describe','JscriptyQuestionReport','length','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','JscriptySessionReport','rawAttributes','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body'];(function(_0x343dfb,_0xed8587){var _0x297fe2=function(_0x19cbbd){while(--_0x19cbbd){_0x343dfb['push'](_0x343dfb['shift']());}};_0x297fe2(++_0xed8587);}(_0xd4ff,0xfa));var _0xfd4f=function(_0x5c886e,_0x2d05ba){_0x5c886e=_0x5c886e-0x0;var _0x1fd126=_0xd4ff[_0x5c886e];return _0x1fd126;};'use strict';var emlformat=require(_0xfd4f('0x0'));var rimraf=require(_0xfd4f('0x1'));var zipdir=require(_0xfd4f('0x2'));var jsonpatch=require(_0xfd4f('0x3'));var rp=require(_0xfd4f('0x4'));var moment=require(_0xfd4f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfd4f('0x6'));var util=require(_0xfd4f('0x7'));var path=require(_0xfd4f('0x8'));var sox=require(_0xfd4f('0x9'));var csv=require(_0xfd4f('0xa'));var ejs=require(_0xfd4f('0xb'));var fs=require('fs');var fs_extra=require(_0xfd4f('0xc'));var _=require(_0xfd4f('0xd'));var squel=require('squel');var crypto=require(_0xfd4f('0xe'));var jsforce=require(_0xfd4f('0xf'));var deskjs=require(_0xfd4f('0x10'));var toCsv=require(_0xfd4f('0xa'));var querystring=require(_0xfd4f('0x11'));var Papa=require('papaparse');var Redis=require(_0xfd4f('0x12'));var authService=require(_0xfd4f('0x13'));var qs=require(_0xfd4f('0x14'));var as=require(_0xfd4f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd4f('0x16'));var utils=require('../../config/utils');var config=require(_0xfd4f('0x17'));var licenseUtil=require(_0xfd4f('0x18'));var db=require(_0xfd4f('0x19'))['db'];function respondWithStatusCode(_0x49feb7,_0x212925){_0x212925=_0x212925||0xcc;return function(_0x231d43){if(_0x231d43){return _0x49feb7[_0xfd4f('0x1a')](_0x212925);}return _0x49feb7[_0xfd4f('0x1b')](_0x212925)['end']();};}function respondWithResult(_0x3f0dfc,_0x7e45f1){_0x7e45f1=_0x7e45f1||0xc8;return function(_0x307ac6){if(_0x307ac6){return _0x3f0dfc[_0xfd4f('0x1b')](_0x7e45f1)[_0xfd4f('0x1c')](_0x307ac6);}};}function respondWithFilteredResult(_0x4c0c31,_0x4bb814){return function(_0x33d96d){if(_0x33d96d){var _0x199b06=typeof _0x4bb814[_0xfd4f('0x1d')]===_0xfd4f('0x1e')&&typeof _0x4bb814['limit']===_0xfd4f('0x1e');var _0x2a1735=_0x33d96d[_0xfd4f('0x1f')];var _0x13f059=_0x199b06?0x0:_0x4bb814[_0xfd4f('0x1d')];var _0xfee30b=_0x199b06?_0x33d96d[_0xfd4f('0x1f')]:_0x4bb814[_0xfd4f('0x1d')]+_0x4bb814[_0xfd4f('0x20')];var _0x289d84;if(_0xfee30b>=_0x2a1735){_0xfee30b=_0x2a1735;_0x289d84=0xc8;}else{_0x289d84=0xce;}_0x4c0c31[_0xfd4f('0x1b')](_0x289d84);return _0x4c0c31[_0xfd4f('0x21')](_0xfd4f('0x22'),_0x13f059+'-'+_0xfee30b+'/'+_0x2a1735)[_0xfd4f('0x1c')](_0x33d96d);}return null;};}function patchUpdates(_0x34554b){return function(_0x4d2d2a){try{jsonpatch[_0xfd4f('0x23')](_0x4d2d2a,_0x34554b,!![]);}catch(_0x2dd0a1){return BPromise[_0xfd4f('0x24')](_0x2dd0a1);}return _0x4d2d2a[_0xfd4f('0x25')]();};}function saveUpdates(_0x16aa33,_0x37c236){return function(_0x594816){if(_0x594816){return _0x594816[_0xfd4f('0x26')](_0x16aa33)[_0xfd4f('0x27')](function(_0x5422a7){return _0x5422a7;});}return null;};}function removeEntity(_0x1bbec5,_0x50c279){return function(_0x5a407f){if(_0x5a407f){return _0x5a407f[_0xfd4f('0x28')]()[_0xfd4f('0x27')](function(){_0x1bbec5['status'](0xcc)[_0xfd4f('0x29')]();});}};}function handleEntityNotFound(_0x17c3a2,_0x69fcaf){return function(_0x59c875){if(!_0x59c875){_0x17c3a2[_0xfd4f('0x1a')](0x194);}return _0x59c875;};}function handleError(_0xca3498,_0x504c08){_0x504c08=_0x504c08||0x1f4;return function(_0x5a6296){logger['error'](_0x5a6296[_0xfd4f('0x2a')]);if(_0x5a6296[_0xfd4f('0x2b')]){delete _0x5a6296[_0xfd4f('0x2b')];}_0xca3498[_0xfd4f('0x1b')](_0x504c08)[_0xfd4f('0x2c')](_0x5a6296);};}exports[_0xfd4f('0x2d')]=function(_0x233e62,_0x15e402){var _0x1ee333={},_0x21c7cd={},_0x4186d3={'count':0x0,'rows':[]};var _0x222c1e=_['map'](db[_0xfd4f('0x2e')][_0xfd4f('0x2f')],function(_0x352f90){return{'name':_0x352f90['fieldName'],'type':_0x352f90['type'][_0xfd4f('0x30')]};});_0x21c7cd[_0xfd4f('0x31')]=_[_0xfd4f('0x32')](_0x222c1e,'name');_0x21c7cd[_0xfd4f('0x33')]=_['keys'](_0x233e62['query']);_0x21c7cd[_0xfd4f('0x34')]=_['intersection'](_0x21c7cd[_0xfd4f('0x31')],_0x21c7cd[_0xfd4f('0x33')]);_0x1ee333[_0xfd4f('0x35')]=_[_0xfd4f('0x36')](_0x21c7cd[_0xfd4f('0x31')],qs[_0xfd4f('0x37')](_0x233e62[_0xfd4f('0x33')][_0xfd4f('0x37')]));_0x1ee333[_0xfd4f('0x35')]=_0x1ee333['attributes']['length']?_0x1ee333[_0xfd4f('0x35')]:_0x21c7cd[_0xfd4f('0x31')];if(!_0x233e62[_0xfd4f('0x33')][_0xfd4f('0x38')](_0xfd4f('0x39'))){_0x1ee333[_0xfd4f('0x20')]=qs[_0xfd4f('0x20')](_0x233e62[_0xfd4f('0x33')][_0xfd4f('0x20')]);_0x1ee333[_0xfd4f('0x1d')]=qs[_0xfd4f('0x1d')](_0x233e62[_0xfd4f('0x33')]['offset']);}_0x1ee333[_0xfd4f('0x3a')]=qs[_0xfd4f('0x3b')](_0x233e62[_0xfd4f('0x33')][_0xfd4f('0x3b')]);_0x1ee333[_0xfd4f('0x3c')]=qs[_0xfd4f('0x34')](_[_0xfd4f('0x3d')](_0x233e62[_0xfd4f('0x33')],_0x21c7cd[_0xfd4f('0x34')]),_0x222c1e);if(_0x233e62[_0xfd4f('0x33')][_0xfd4f('0x3e')]){_0x1ee333[_0xfd4f('0x3c')]=_[_0xfd4f('0x3f')](_0x1ee333[_0xfd4f('0x3c')],{'$or':_[_0xfd4f('0x32')](_0x222c1e,function(_0x26bde5){if(_0x26bde5[_0xfd4f('0x40')]!==_0xfd4f('0x41')){var _0x554bef={};_0x554bef[_0x26bde5['name']]={'$like':'%'+_0x233e62['query'][_0xfd4f('0x3e')]+'%'};return _0x554bef;}})});}_0x1ee333=_[_0xfd4f('0x3f')]({},_0x1ee333,_0x233e62[_0xfd4f('0x42')]);var _0x23b976={'where':_0x1ee333[_0xfd4f('0x3c')]};return db[_0xfd4f('0x2e')][_0xfd4f('0x1f')](_0x23b976)[_0xfd4f('0x27')](function(_0x2540f5){_0x4186d3[_0xfd4f('0x1f')]=_0x2540f5;if(_0x233e62['query'][_0xfd4f('0x43')]){_0x1ee333[_0xfd4f('0x44')]=[{'all':!![]}];}return db[_0xfd4f('0x2e')][_0xfd4f('0x45')](_0x1ee333);})['then'](function(_0x1489ff){_0x4186d3[_0xfd4f('0x46')]=_0x1489ff;return _0x4186d3;})[_0xfd4f('0x27')](respondWithFilteredResult(_0x15e402,_0x1ee333))[_0xfd4f('0x47')](handleError(_0x15e402,null));};exports[_0xfd4f('0x48')]=function(_0x5fd18f,_0x5c989f){var _0x5cbc0b={'raw':!![],'where':{'id':_0x5fd18f[_0xfd4f('0x49')]['id']}},_0x419725={};_0x419725['model']=_['keys'](db[_0xfd4f('0x2e')][_0xfd4f('0x2f')]);_0x419725[_0xfd4f('0x33')]=_[_0xfd4f('0x4a')](_0x5fd18f['query']);_0x419725[_0xfd4f('0x34')]=_['intersection'](_0x419725[_0xfd4f('0x31')],_0x419725['query']);_0x5cbc0b[_0xfd4f('0x35')]=_[_0xfd4f('0x36')](_0x419725[_0xfd4f('0x31')],qs[_0xfd4f('0x37')](_0x5fd18f[_0xfd4f('0x33')]['fields']));_0x5cbc0b[_0xfd4f('0x35')]=_0x5cbc0b[_0xfd4f('0x35')]['length']?_0x5cbc0b[_0xfd4f('0x35')]:_0x419725['model'];if(_0x5fd18f[_0xfd4f('0x33')][_0xfd4f('0x43')]){_0x5cbc0b[_0xfd4f('0x44')]=[{'all':!![]}];}_0x5cbc0b=_[_0xfd4f('0x3f')]({},_0x5cbc0b,_0x5fd18f[_0xfd4f('0x42')]);return db[_0xfd4f('0x2e')][_0xfd4f('0x4b')](_0x5cbc0b)[_0xfd4f('0x27')](handleEntityNotFound(_0x5c989f,null))[_0xfd4f('0x27')](respondWithResult(_0x5c989f,null))[_0xfd4f('0x47')](handleError(_0x5c989f,null));};exports[_0xfd4f('0x4c')]=function(_0x37f080,_0xdae9e0){return db[_0xfd4f('0x2e')]['create'](_0x37f080['body'],{})[_0xfd4f('0x27')](respondWithResult(_0xdae9e0,0xc9))[_0xfd4f('0x47')](handleError(_0xdae9e0,null));};exports[_0xfd4f('0x26')]=function(_0xbf88c7,_0x29dd8a){if(_0xbf88c7[_0xfd4f('0x4d')]['id']){delete _0xbf88c7['body']['id'];}return db['JscriptySessionReport'][_0xfd4f('0x4b')]({'where':{'id':_0xbf88c7[_0xfd4f('0x49')]['id']}})['then'](handleEntityNotFound(_0x29dd8a,null))['then'](saveUpdates(_0xbf88c7[_0xfd4f('0x4d')],null))[_0xfd4f('0x27')](respondWithResult(_0x29dd8a,null))[_0xfd4f('0x47')](handleError(_0x29dd8a,null));};exports[_0xfd4f('0x28')]=function(_0x7f7325,_0x49f0aa){return db['JscriptySessionReport'][_0xfd4f('0x4b')]({'where':{'id':_0x7f7325['params']['id']}})[_0xfd4f('0x27')](handleEntityNotFound(_0x49f0aa,null))[_0xfd4f('0x27')](removeEntity(_0x49f0aa,null))[_0xfd4f('0x47')](handleError(_0x49f0aa,null));};exports[_0xfd4f('0x4e')]=function(_0x4ac98d,_0x3b007b){return db['JscriptySessionReport'][_0xfd4f('0x4e')]()[_0xfd4f('0x27')](respondWithResult(_0x3b007b,null))[_0xfd4f('0x47')](handleError(_0x3b007b,null));};exports['getQuestions']=function(_0x1455bb,_0x3179b0,_0x4a5d5d){var _0xdb22c5={'raw':!![],'where':{}};var _0x75c6ee={};var _0x538bc6={'count':0x0,'rows':[]};return db[_0xfd4f('0x2e')]['findOne']({'where':{'id':_0x1455bb[_0xfd4f('0x49')]['id']}})['then'](handleEntityNotFound(_0x3179b0,null))['then'](function(_0x294839){if(_0x294839){_0x75c6ee['model']=_[_0xfd4f('0x4a')](db[_0xfd4f('0x4f')]['rawAttributes']);_0x75c6ee[_0xfd4f('0x33')]=_[_0xfd4f('0x4a')](_0x1455bb['query']);_0x75c6ee[_0xfd4f('0x34')]=_['intersection'](_0x75c6ee[_0xfd4f('0x31')],_0x75c6ee[_0xfd4f('0x33')]);_0xdb22c5[_0xfd4f('0x35')]=_['intersection'](_0x75c6ee[_0xfd4f('0x31')],qs[_0xfd4f('0x37')](_0x1455bb[_0xfd4f('0x33')][_0xfd4f('0x37')]));_0xdb22c5[_0xfd4f('0x35')]=_0xdb22c5[_0xfd4f('0x35')][_0xfd4f('0x50')]?_0xdb22c5[_0xfd4f('0x35')]:_0x75c6ee['model'];if(!_0x1455bb[_0xfd4f('0x33')]['hasOwnProperty']('nolimit')){_0xdb22c5[_0xfd4f('0x20')]=qs[_0xfd4f('0x20')](_0x1455bb[_0xfd4f('0x33')][_0xfd4f('0x20')]);_0xdb22c5[_0xfd4f('0x1d')]=qs[_0xfd4f('0x1d')](_0x1455bb['query'][_0xfd4f('0x1d')]);}_0xdb22c5['order']=qs[_0xfd4f('0x3b')](_0x1455bb[_0xfd4f('0x33')][_0xfd4f('0x3b')]);_0xdb22c5[_0xfd4f('0x3c')]=qs[_0xfd4f('0x34')](_['pick'](_0x1455bb[_0xfd4f('0x33')],_0x75c6ee['filters']));_0xdb22c5[_0xfd4f('0x3c')][_0xfd4f('0x51')]=_0x294839['id'];if(_0x1455bb[_0xfd4f('0x33')][_0xfd4f('0x3e')]){_0xdb22c5['where']=_[_0xfd4f('0x3f')](_0xdb22c5[_0xfd4f('0x3c')],{'$or':_[_0xfd4f('0x32')](_0xdb22c5[_0xfd4f('0x35')],function(_0x58b3e){var _0xcaae23={};_0xcaae23[_0x58b3e]={'$like':'%'+_0x1455bb['query'][_0xfd4f('0x3e')]+'%'};return _0xcaae23;})});}_0xdb22c5=_[_0xfd4f('0x3f')]({},_0xdb22c5,_0x1455bb[_0xfd4f('0x42')]);return db[_0xfd4f('0x4f')]['count']({'where':_0xdb22c5[_0xfd4f('0x3c')]})[_0xfd4f('0x27')](function(_0x16ffa2){_0x538bc6[_0xfd4f('0x1f')]=_0x16ffa2;if(_0x1455bb[_0xfd4f('0x33')][_0xfd4f('0x43')]){_0xdb22c5[_0xfd4f('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xfd4f('0x45')](_0xdb22c5);})[_0xfd4f('0x27')](function(_0x19eeb4){_0x538bc6[_0xfd4f('0x46')]=_0x19eeb4;return _0x538bc6;});}})[_0xfd4f('0x27')](respondWithFilteredResult(_0x3179b0,_0xdb22c5))[_0xfd4f('0x47')](handleError(_0x3179b0,null));}; \ No newline at end of file +var _0x86ae=['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','limit','undefined','count','Content-Range','apply','save','then','end','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','options','findAll','rows','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x54faec,_0x43408b){var _0x8bde19=function(_0x21bdc1){while(--_0x21bdc1){_0x54faec['push'](_0x54faec['shift']());}};_0x8bde19(++_0x43408b);}(_0x86ae,0x186));var _0xe86a=function(_0x2e7840,_0x4ba938){_0x2e7840=_0x2e7840-0x0;var _0x64635=_0x86ae[_0x2e7840];return _0x64635;};'use strict';var emlformat=require(_0xe86a('0x0'));var rimraf=require(_0xe86a('0x1'));var zipdir=require(_0xe86a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe86a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe86a('0x4'));var path=require(_0xe86a('0x5'));var sox=require(_0xe86a('0x6'));var csv=require(_0xe86a('0x7'));var ejs=require(_0xe86a('0x8'));var fs=require('fs');var fs_extra=require(_0xe86a('0x9'));var _=require(_0xe86a('0xa'));var squel=require(_0xe86a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe86a('0xc'));var deskjs=require(_0xe86a('0xd'));var toCsv=require(_0xe86a('0x7'));var querystring=require(_0xe86a('0xe'));var Papa=require(_0xe86a('0xf'));var Redis=require(_0xe86a('0x10'));var authService=require(_0xe86a('0x11'));var qs=require(_0xe86a('0x12'));var as=require(_0xe86a('0x13'));var hardwareService=require(_0xe86a('0x14'));var logger=require(_0xe86a('0x15'))(_0xe86a('0x16'));var utils=require(_0xe86a('0x17'));var config=require(_0xe86a('0x18'));var licenseUtil=require(_0xe86a('0x19'));var db=require(_0xe86a('0x1a'))['db'];function respondWithStatusCode(_0x4ff6c2,_0x58a23a){_0x58a23a=_0x58a23a||0xcc;return function(_0x19f1b9){if(_0x19f1b9){return _0x4ff6c2['sendStatus'](_0x58a23a);}return _0x4ff6c2[_0xe86a('0x1b')](_0x58a23a)['end']();};}function respondWithResult(_0x1bfe3c,_0x539f8c){_0x539f8c=_0x539f8c||0xc8;return function(_0x70f980){if(_0x70f980){return _0x1bfe3c['status'](_0x539f8c)[_0xe86a('0x1c')](_0x70f980);}};}function respondWithFilteredResult(_0x51c89e,_0x17fd90){return function(_0x29b734){if(_0x29b734){var _0x16c95e=typeof _0x17fd90[_0xe86a('0x1d')]==='undefined'&&typeof _0x17fd90[_0xe86a('0x1e')]===_0xe86a('0x1f');var _0x59a3f2=_0x29b734['count'];var _0xd95a11=_0x16c95e?0x0:_0x17fd90[_0xe86a('0x1d')];var _0x3e6b93=_0x16c95e?_0x29b734[_0xe86a('0x20')]:_0x17fd90[_0xe86a('0x1d')]+_0x17fd90[_0xe86a('0x1e')];var _0x3bd51a;if(_0x3e6b93>=_0x59a3f2){_0x3e6b93=_0x59a3f2;_0x3bd51a=0xc8;}else{_0x3bd51a=0xce;}_0x51c89e[_0xe86a('0x1b')](_0x3bd51a);return _0x51c89e['set'](_0xe86a('0x21'),_0xd95a11+'-'+_0x3e6b93+'/'+_0x59a3f2)['json'](_0x29b734);}return null;};}function patchUpdates(_0x257264){return function(_0x43e854){try{jsonpatch[_0xe86a('0x22')](_0x43e854,_0x257264,!![]);}catch(_0x27b082){return BPromise['reject'](_0x27b082);}return _0x43e854[_0xe86a('0x23')]();};}function saveUpdates(_0x1aeb86,_0x5107ad){return function(_0x4ba71a){if(_0x4ba71a){return _0x4ba71a['update'](_0x1aeb86)[_0xe86a('0x24')](function(_0x14c5cb){return _0x14c5cb;});}return null;};}function removeEntity(_0x3c9f92,_0xa9655d){return function(_0x527cdd){if(_0x527cdd){return _0x527cdd['destroy']()[_0xe86a('0x24')](function(){_0x3c9f92[_0xe86a('0x1b')](0xcc)[_0xe86a('0x25')]();});}};}function handleEntityNotFound(_0xd9cc56,_0x16f35c){return function(_0x1e0138){if(!_0x1e0138){_0xd9cc56['sendStatus'](0x194);}return _0x1e0138;};}function handleError(_0x147515,_0x56b92b){_0x56b92b=_0x56b92b||0x1f4;return function(_0x547929){logger[_0xe86a('0x26')](_0x547929['stack']);if(_0x547929['name']){delete _0x547929[_0xe86a('0x27')];}_0x147515[_0xe86a('0x1b')](_0x56b92b)[_0xe86a('0x28')](_0x547929);};}exports[_0xe86a('0x29')]=function(_0x2afa2e,_0x4a7085){var _0x1daf36={},_0xf804b={},_0x458052={'count':0x0,'rows':[]};var _0xf6f1aa=_[_0xe86a('0x2a')](db[_0xe86a('0x2b')][_0xe86a('0x2c')],function(_0x40aeb3){return{'name':_0x40aeb3[_0xe86a('0x2d')],'type':_0x40aeb3[_0xe86a('0x2e')][_0xe86a('0x2f')]};});_0xf804b['model']=_['map'](_0xf6f1aa,'name');_0xf804b[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0x2afa2e['query']);_0xf804b[_0xe86a('0x32')]=_[_0xe86a('0x33')](_0xf804b[_0xe86a('0x34')],_0xf804b[_0xe86a('0x30')]);_0x1daf36[_0xe86a('0x35')]=_[_0xe86a('0x33')](_0xf804b[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0x2afa2e['query'][_0xe86a('0x36')]));_0x1daf36[_0xe86a('0x35')]=_0x1daf36[_0xe86a('0x35')][_0xe86a('0x37')]?_0x1daf36[_0xe86a('0x35')]:_0xf804b[_0xe86a('0x34')];if(!_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x38')](_0xe86a('0x39'))){_0x1daf36[_0xe86a('0x1e')]=qs[_0xe86a('0x1e')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x1e')]);_0x1daf36[_0xe86a('0x1d')]=qs[_0xe86a('0x1d')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x1d')]);}_0x1daf36['order']=qs[_0xe86a('0x3a')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3a')]);_0x1daf36[_0xe86a('0x3b')]=qs[_0xe86a('0x32')](_['pick'](_0x2afa2e['query'],_0xf804b[_0xe86a('0x32')]),_0xf6f1aa);if(_0x2afa2e['query'][_0xe86a('0x3c')]){_0x1daf36[_0xe86a('0x3b')]=_[_0xe86a('0x3d')](_0x1daf36[_0xe86a('0x3b')],{'$or':_[_0xe86a('0x2a')](_0xf6f1aa,function(_0x31bf95){if(_0x31bf95[_0xe86a('0x2e')]!==_0xe86a('0x3e')){var _0x16e45a={};_0x16e45a[_0x31bf95[_0xe86a('0x27')]]={'$like':'%'+_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3c')]+'%'};return _0x16e45a;}})});}_0x1daf36=_['merge']({},_0x1daf36,_0x2afa2e['options']);var _0x1c990f={'where':_0x1daf36[_0xe86a('0x3b')]};return db[_0xe86a('0x2b')][_0xe86a('0x20')](_0x1c990f)['then'](function(_0x3e9a08){_0x458052[_0xe86a('0x20')]=_0x3e9a08;if(_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3f')]){_0x1daf36[_0xe86a('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1daf36);})[_0xe86a('0x24')](function(_0xb20811){_0x458052['rows']=_0xb20811;return _0x458052;})[_0xe86a('0x24')](respondWithFilteredResult(_0x4a7085,_0x1daf36))[_0xe86a('0x41')](handleError(_0x4a7085,null));};exports[_0xe86a('0x42')]=function(_0xfd0f7f,_0x4b7f6c){var _0x1c13d1={'raw':!![],'where':{'id':_0xfd0f7f[_0xe86a('0x43')]['id']}},_0x758011={};_0x758011['model']=_['keys'](db[_0xe86a('0x2b')][_0xe86a('0x2c')]);_0x758011[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0xfd0f7f['query']);_0x758011[_0xe86a('0x32')]=_['intersection'](_0x758011[_0xe86a('0x34')],_0x758011[_0xe86a('0x30')]);_0x1c13d1[_0xe86a('0x35')]=_[_0xe86a('0x33')](_0x758011[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0xfd0f7f[_0xe86a('0x30')][_0xe86a('0x36')]));_0x1c13d1[_0xe86a('0x35')]=_0x1c13d1['attributes'][_0xe86a('0x37')]?_0x1c13d1[_0xe86a('0x35')]:_0x758011[_0xe86a('0x34')];if(_0xfd0f7f[_0xe86a('0x30')][_0xe86a('0x3f')]){_0x1c13d1[_0xe86a('0x40')]=[{'all':!![]}];}_0x1c13d1=_[_0xe86a('0x3d')]({},_0x1c13d1,_0xfd0f7f['options']);return db[_0xe86a('0x2b')][_0xe86a('0x44')](_0x1c13d1)[_0xe86a('0x24')](handleEntityNotFound(_0x4b7f6c,null))[_0xe86a('0x24')](respondWithResult(_0x4b7f6c,null))['catch'](handleError(_0x4b7f6c,null));};exports[_0xe86a('0x45')]=function(_0x3378fa,_0x415bb3){return db['JscriptySessionReport'][_0xe86a('0x45')](_0x3378fa[_0xe86a('0x46')],{})[_0xe86a('0x24')](respondWithResult(_0x415bb3,0xc9))['catch'](handleError(_0x415bb3,null));};exports['update']=function(_0x4e1208,_0x5c7883){if(_0x4e1208[_0xe86a('0x46')]['id']){delete _0x4e1208[_0xe86a('0x46')]['id'];}return db[_0xe86a('0x2b')]['find']({'where':{'id':_0x4e1208[_0xe86a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c7883,null))[_0xe86a('0x24')](saveUpdates(_0x4e1208[_0xe86a('0x46')],null))['then'](respondWithResult(_0x5c7883,null))[_0xe86a('0x41')](handleError(_0x5c7883,null));};exports[_0xe86a('0x47')]=function(_0x2f5645,_0x46f169){return db[_0xe86a('0x2b')][_0xe86a('0x44')]({'where':{'id':_0x2f5645[_0xe86a('0x43')]['id']}})[_0xe86a('0x24')](handleEntityNotFound(_0x46f169,null))[_0xe86a('0x24')](removeEntity(_0x46f169,null))['catch'](handleError(_0x46f169,null));};exports[_0xe86a('0x48')]=function(_0x4b69d6,_0x4879a3){return db[_0xe86a('0x2b')][_0xe86a('0x48')]()[_0xe86a('0x24')](respondWithResult(_0x4879a3,null))['catch'](handleError(_0x4879a3,null));};exports[_0xe86a('0x49')]=function(_0xa8f0ae,_0x473cf6,_0x55c696){var _0x3a1cb3={'raw':!![],'where':{}};var _0x4326de={};var _0x45f11a={'count':0x0,'rows':[]};return db[_0xe86a('0x2b')][_0xe86a('0x4a')]({'where':{'id':_0xa8f0ae[_0xe86a('0x43')]['id']}})[_0xe86a('0x24')](handleEntityNotFound(_0x473cf6,null))[_0xe86a('0x24')](function(_0x13adb7){if(_0x13adb7){_0x4326de[_0xe86a('0x34')]=_['keys'](db[_0xe86a('0x4b')][_0xe86a('0x2c')]);_0x4326de[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0xa8f0ae[_0xe86a('0x30')]);_0x4326de[_0xe86a('0x32')]=_[_0xe86a('0x33')](_0x4326de[_0xe86a('0x34')],_0x4326de[_0xe86a('0x30')]);_0x3a1cb3['attributes']=_[_0xe86a('0x33')](_0x4326de[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0xa8f0ae[_0xe86a('0x30')]['fields']));_0x3a1cb3['attributes']=_0x3a1cb3[_0xe86a('0x35')]['length']?_0x3a1cb3[_0xe86a('0x35')]:_0x4326de[_0xe86a('0x34')];if(!_0xa8f0ae[_0xe86a('0x30')]['hasOwnProperty'](_0xe86a('0x39'))){_0x3a1cb3[_0xe86a('0x1e')]=qs[_0xe86a('0x1e')](_0xa8f0ae['query']['limit']);_0x3a1cb3['offset']=qs[_0xe86a('0x1d')](_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x1d')]);}_0x3a1cb3[_0xe86a('0x4c')]=qs['sort'](_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x3a')]);_0x3a1cb3[_0xe86a('0x3b')]=qs['filters'](_['pick'](_0xa8f0ae[_0xe86a('0x30')],_0x4326de[_0xe86a('0x32')]));_0x3a1cb3[_0xe86a('0x3b')][_0xe86a('0x4d')]=_0x13adb7['id'];if(_0xa8f0ae[_0xe86a('0x30')]['filter']){_0x3a1cb3[_0xe86a('0x3b')]=_[_0xe86a('0x3d')](_0x3a1cb3[_0xe86a('0x3b')],{'$or':_[_0xe86a('0x2a')](_0x3a1cb3['attributes'],function(_0x1fd0e2){var _0x21a499={};_0x21a499[_0x1fd0e2]={'$like':'%'+_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x3c')]+'%'};return _0x21a499;})});}_0x3a1cb3=_[_0xe86a('0x3d')]({},_0x3a1cb3,_0xa8f0ae[_0xe86a('0x4e')]);return db[_0xe86a('0x4b')][_0xe86a('0x20')]({'where':_0x3a1cb3['where']})[_0xe86a('0x24')](function(_0x5d2242){_0x45f11a[_0xe86a('0x20')]=_0x5d2242;if(_0xa8f0ae['query'][_0xe86a('0x3f')]){_0x3a1cb3['include']=[{'all':!![]}];}return db[_0xe86a('0x4b')][_0xe86a('0x4f')](_0x3a1cb3);})[_0xe86a('0x24')](function(_0x6a1864){_0x45f11a[_0xe86a('0x50')]=_0x6a1864;return _0x45f11a;});}})['then'](respondWithFilteredResult(_0x473cf6,_0x3a1cb3))[_0xe86a('0x41')](handleError(_0x473cf6,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1d2d0d7..8048302 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 _0x8958=['define','JscriptySessionReport','report_jscripty_sessions','util','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x1f6465,_0x117fe3){var _0x19228f=function(_0x208829){while(--_0x208829){_0x1f6465['push'](_0x1f6465['shift']());}};_0x19228f(++_0x117fe3);}(_0x8958,0x93));var _0x8895=function(_0xe89d5c,_0x19c854){_0xe89d5c=_0xe89d5c-0x0;var _0x1ce92c=_0x8958[_0xe89d5c];return _0x1ce92c;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));module['exports']=function(_0x22fa52,_0x2f03ad){return _0x22fa52[_0x8895('0x5')](_0x8895('0x6'),attributes,{'tableName':_0x8895('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0x36fd75,_0x22ef90){var _0x250360=function(_0x28f0e5){while(--_0x28f0e5){_0x36fd75['push'](_0x36fd75['shift']());}};_0x250360(++_0x22ef90);}(_0x1261,0x144));var _0x1126=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x1261[_0x5f6a8a];return _0x2cce4d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'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 25ecc08..0dbb195 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 _0xed1c=['request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed1c,0xe4));var _0xced1=function(_0x15f031,_0x58331b){_0x15f031=_0x15f031-0x0;var _0x1c4885=_0xed1c[_0x15f031];return _0x1c4885;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced1('0x2'))['db'];var utils=require(_0xced1('0x3'));var logger=require(_0xced1('0x4'))('rpc');var config=require(_0xced1('0x5'));var jayson=require(_0xced1('0x6'));var client=jayson[_0xced1('0x7')][_0xced1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59399e,_0x2bcf42,_0x38bca8){return new BPromise(function(_0x39d5df,_0x1fb40b){return client[_0xced1('0x9')](_0x59399e,_0x38bca8)[_0xced1('0xa')](function(_0x325dd2){logger[_0xced1('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x2bcf42,_0xced1('0xc'));logger['debug'](_0xced1('0xd'),_0x2bcf42,_0xced1('0xc'),JSON[_0xced1('0xe')](_0x325dd2));if(_0x325dd2[_0xced1('0xf')]){if(_0x325dd2[_0xced1('0xf')][_0xced1('0x10')]===0x1f4){logger[_0xced1('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x2bcf42,_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);return _0x1fb40b(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}logger['error'](_0xced1('0x12'),_0x2bcf42,_0x325dd2[_0xced1('0xf')]['message']);return _0x39d5df(_0x325dd2[_0xced1('0xf')][_0xced1('0x11')]);}else{logger[_0xced1('0xb')](_0xced1('0x12'),_0x2bcf42,'request\x20sent');_0x39d5df(_0x325dd2['result'][_0xced1('0x11')]);}})[_0xced1('0x13')](function(_0x236473){logger[_0xced1('0xf')](_0xced1('0x12'),_0x2bcf42,_0x236473);_0x1fb40b(_0x236473);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2f7b30,_0x16c3c3){var _0x1cdc19=function(_0xa1203a){while(--_0xa1203a){_0x2f7b30['push'](_0x2f7b30['shift']());}};_0x1cdc19(++_0x16c3c3);}(_0x57ca,0x108));var _0xa57c=function(_0x587f08,_0x5d867b){_0x587f08=_0x587f08-0x0;var _0x57dc56=_0x57ca[_0x587f08];return _0x57dc56;};'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')]('JscriptySessionReport,\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')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 59e628f..827330a 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 _0x4037=['update','/download_log_file','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','isAuthenticated'];(function(_0x44eccd,_0x528554){var _0x3aa62c=function(_0x521ce2){while(--_0x521ce2){_0x44eccd['push'](_0x44eccd['shift']());}};_0x3aa62c(++_0x528554);}(_0x4037,0x13b));var _0x7403=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4037[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x7403('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7403('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7403('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7403('0x3'));var config=require(_0x7403('0x4'));var controller=require(_0x7403('0x5'));router[_0x7403('0x6')]('/',controller[_0x7403('0x7')]);router['put']('/:id',auth[_0x7403('0x8')](),controller[_0x7403('0x9')]);router['get'](_0x7403('0xa'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x7403('0xb')]=router; \ No newline at end of file +var _0xe3c7=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','put','/:id','update','/download_log_file','isAuthenticated','exports','util','path','express'];(function(_0x1c4f28,_0x59beb3){var _0x5b30a2=function(_0x370009){while(--_0x370009){_0x1c4f28['push'](_0x1c4f28['shift']());}};_0x5b30a2(++_0x59beb3);}(_0xe3c7,0x6d));var _0x7e3c=function(_0x8330a2,_0x177ecc){_0x8330a2=_0x8330a2-0x0;var _0x5243c6=_0xe3c7[_0x8330a2];return _0x5243c6;};'use strict';var multer=require('multer');var util=require(_0x7e3c('0x0'));var path=require(_0x7e3c('0x1'));var timeout=require('connect-timeout');var express=require(_0x7e3c('0x2'));var router=express['Router']();var fs_extra=require(_0x7e3c('0x3'));var auth=require(_0x7e3c('0x4'));var interaction=require(_0x7e3c('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x7e3c('0x6')]('/',controller[_0x7e3c('0x7')]);router[_0x7e3c('0x8')](_0x7e3c('0x9'),auth['isAuthenticated'](),controller[_0x7e3c('0xa')]);router[_0x7e3c('0x6')](_0x7e3c('0xb'),auth[_0x7e3c('0xc')](),controller['downloadLogFile']);module[_0x7e3c('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 de76796..5e76385 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 _0xe34a=['sequelize','exports','TEXT','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe34a,0xfc));var _0xae34=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xe34a[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0xae34('0x0'));module[_0xae34('0x1')]={'license':{'type':Sequelize[_0xae34('0x2')]},'data1':{'type':Sequelize[_0xae34('0x3')]},'data2':{'type':Sequelize[_0xae34('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xefa6=['INTEGER','sequelize','TEXT','STRING'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xefa6,0xb1));var _0x6efa=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xefa6[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0x6efa('0x0'));module['exports']={'license':{'type':Sequelize[_0x6efa('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6efa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6efa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 57b6ec9..16e09d4 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 _0xfd47=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','end','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','then','catch','body','License','find','get','checkLicense','key','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0xfafc8a,_0x27c3bd){var _0x2bd035=function(_0x1008bc){while(--_0x1008bc){_0xfafc8a['push'](_0xfafc8a['shift']());}};_0x2bd035(++_0x27c3bd);}(_0xfd47,0x173));var _0x7fd4=function(_0x709848,_0x3996a5){_0x709848=_0x709848-0x0;var _0x2eeeae=_0xfd47[_0x709848];return _0x2eeeae;};'use strict';var emlformat=require(_0x7fd4('0x0'));var rimraf=require(_0x7fd4('0x1'));var zipdir=require(_0x7fd4('0x2'));var jsonpatch=require(_0x7fd4('0x3'));var rp=require(_0x7fd4('0x4'));var moment=require(_0x7fd4('0x5'));var BPromise=require(_0x7fd4('0x6'));var Mustache=require(_0x7fd4('0x7'));var util=require(_0x7fd4('0x8'));var path=require(_0x7fd4('0x9'));var sox=require(_0x7fd4('0xa'));var csv=require(_0x7fd4('0xb'));var ejs=require(_0x7fd4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fd4('0xd'));var squel=require(_0x7fd4('0xe'));var crypto=require('crypto');var jsforce=require(_0x7fd4('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7fd4('0x10'));var Papa=require(_0x7fd4('0x11'));var Redis=require(_0x7fd4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7fd4('0x13'));var as=require(_0x7fd4('0x14'));var hardwareService=require(_0x7fd4('0x15'));var logger=require('../../config/logger')(_0x7fd4('0x16'));var utils=require(_0x7fd4('0x17'));var config=require(_0x7fd4('0x18'));var licenseUtil=require(_0x7fd4('0x19'));var db=require(_0x7fd4('0x1a'))['db'];function respondWithStatusCode(_0x51f6b3,_0x2f2cbc){_0x2f2cbc=_0x2f2cbc||0xcc;return function(_0x443bfe){if(_0x443bfe){return _0x51f6b3[_0x7fd4('0x1b')](_0x2f2cbc);}return _0x51f6b3['status'](_0x2f2cbc)['end']();};}function respondWithResult(_0x3fd24c,_0x1b25a1){_0x1b25a1=_0x1b25a1||0xc8;return function(_0x256f42){if(_0x256f42){return _0x3fd24c[_0x7fd4('0x1c')](_0x1b25a1)[_0x7fd4('0x1d')](_0x256f42);}};}function respondWithFilteredResult(_0x2c91da,_0x25ac25){return function(_0x4d5e26){if(_0x4d5e26){var _0x5aae54=typeof _0x25ac25['offset']===_0x7fd4('0x1e')&&typeof _0x25ac25[_0x7fd4('0x1f')]==='undefined';var _0x43ac96=_0x4d5e26['count'];var _0x44c14f=_0x5aae54?0x0:_0x25ac25['offset'];var _0x1fb12c=_0x5aae54?_0x4d5e26[_0x7fd4('0x20')]:_0x25ac25[_0x7fd4('0x21')]+_0x25ac25['limit'];var _0x3b1c65;if(_0x1fb12c>=_0x43ac96){_0x1fb12c=_0x43ac96;_0x3b1c65=0xc8;}else{_0x3b1c65=0xce;}_0x2c91da[_0x7fd4('0x1c')](_0x3b1c65);return _0x2c91da[_0x7fd4('0x22')](_0x7fd4('0x23'),_0x44c14f+'-'+_0x1fb12c+'/'+_0x43ac96)[_0x7fd4('0x1d')](_0x4d5e26);}return null;};}function patchUpdates(_0x2d5329){return function(_0x5e84ed){try{jsonpatch[_0x7fd4('0x24')](_0x5e84ed,_0x2d5329,!![]);}catch(_0x5961c7){return BPromise[_0x7fd4('0x25')](_0x5961c7);}return _0x5e84ed[_0x7fd4('0x26')]();};}function saveUpdates(_0x38de03,_0x11eb2a){return function(_0x2cd28e){if(_0x2cd28e){return _0x2cd28e[_0x7fd4('0x27')](_0x38de03)['then'](function(_0x1aa116){return _0x1aa116;});}return null;};}function removeEntity(_0x4eb76b,_0x2e32a8){return function(_0x135df5){if(_0x135df5){return _0x135df5['destroy']()['then'](function(){_0x4eb76b[_0x7fd4('0x1c')](0xcc)[_0x7fd4('0x28')]();});}};}function handleEntityNotFound(_0x499924,_0x995836){return function(_0x4b5d23){if(!_0x4b5d23){_0x499924['sendStatus'](0x194);}return _0x4b5d23;};}function handleError(_0x15a0f6,_0x1ac251){_0x1ac251=_0x1ac251||0x1f4;return function(_0x5d5f51){logger[_0x7fd4('0x29')](_0x5d5f51[_0x7fd4('0x2a')]);if(_0x5d5f51[_0x7fd4('0x2b')]){delete _0x5d5f51[_0x7fd4('0x2b')];}_0x15a0f6[_0x7fd4('0x1c')](_0x1ac251)[_0x7fd4('0x2c')](_0x5d5f51);};}var utilLicense=require(_0x7fd4('0x19'));exports[_0x7fd4('0x2d')]=function(_0x15627d,_0x52f0db){var _0x376a73={'raw':!![],'where':{'id':0x1}},_0x557a45={};_0x557a45[_0x7fd4('0x2e')]=_[_0x7fd4('0x2f')](db['License'][_0x7fd4('0x30')]);_0x557a45[_0x7fd4('0x31')]=_[_0x7fd4('0x2f')](_0x15627d[_0x7fd4('0x31')]);_0x557a45[_0x7fd4('0x32')]=_[_0x7fd4('0x33')](_0x557a45[_0x7fd4('0x2e')],_0x557a45['query']);_0x376a73['attributes']=_['intersection'](_0x557a45[_0x7fd4('0x2e')],qs[_0x7fd4('0x34')](_0x15627d[_0x7fd4('0x31')][_0x7fd4('0x34')]));_0x376a73[_0x7fd4('0x35')]=_0x376a73['attributes'][_0x7fd4('0x36')]?_0x376a73['attributes']:_0x557a45['model'];_0x376a73=_[_0x7fd4('0x37')]({},_0x376a73,_0x15627d[_0x7fd4('0x38')]);return utilLicense[_0x7fd4('0x39')](_0x376a73)[_0x7fd4('0x3a')](respondWithResult(_0x52f0db,null))[_0x7fd4('0x3b')](handleError(_0x52f0db,null));};exports['update']=function(_0x1ff89f,_0x4d8bd6){if(_0x1ff89f[_0x7fd4('0x3c')]['id']){delete _0x1ff89f[_0x7fd4('0x3c')]['id'];}return db[_0x7fd4('0x3d')][_0x7fd4('0x3e')]({'where':{'id':_0x1ff89f['params']['id']}})['then'](handleEntityNotFound(_0x4d8bd6,null))[_0x7fd4('0x3a')](function(_0x248d00){var _0x1edfef=_0x248d00[_0x7fd4('0x3f')]({'plain':!![]});return utilLicense[_0x7fd4('0x40')](_0x1edfef,_0x1ff89f[_0x7fd4('0x3c')][_0x7fd4('0x41')]);})[_0x7fd4('0x3a')](function(_0xbc4aba){if(!_0xbc4aba[_0x7fd4('0x42')]){return saveUpdates(_0x1ff89f[_0x7fd4('0x3c')],null);}return _0xbc4aba;})[_0x7fd4('0x3a')](respondWithResult(_0x4d8bd6,null))[_0x7fd4('0x3b')](handleError(_0x4d8bd6,null));};exports[_0x7fd4('0x43')]=function(_0x37fed1,_0x3a3bb6){var _0x3c8e38='license-info.log';var _0xacdc2f=path[_0x7fd4('0x44')](_0x7fd4('0x45'),_0x7fd4('0x46'),_0x7fd4('0x47'),_0x3c8e38);_0x3a3bb6[_0x7fd4('0x48')](_0x7fd4('0x49'),_0x7fd4('0x4a')+_0x3c8e38);_0x3a3bb6[_0x7fd4('0x22')](_0x7fd4('0x4b'),_0x7fd4('0x4c'));_0x3a3bb6[_0x7fd4('0x4d')](_0xacdc2f);}; \ No newline at end of file +var _0xe035=['destroy','end','error','stack','name','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','body','License','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then'];(function(_0x40c8eb,_0x38ce98){var _0x3ff10a=function(_0x5f2ef9){while(--_0x5f2ef9){_0x40c8eb['push'](_0x40c8eb['shift']());}};_0x3ff10a(++_0x38ce98);}(_0xe035,0x69));var _0x5e03=function(_0x4c41ff,_0x50acac){_0x4c41ff=_0x4c41ff-0x0;var _0xc9ec17=_0xe035[_0x4c41ff];return _0xc9ec17;};'use strict';var emlformat=require(_0x5e03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e03('0x1'));var jsonpatch=require(_0x5e03('0x2'));var rp=require(_0x5e03('0x3'));var moment=require(_0x5e03('0x4'));var BPromise=require(_0x5e03('0x5'));var Mustache=require(_0x5e03('0x6'));var util=require(_0x5e03('0x7'));var path=require(_0x5e03('0x8'));var sox=require(_0x5e03('0x9'));var csv=require(_0x5e03('0xa'));var ejs=require(_0x5e03('0xb'));var fs=require('fs');var fs_extra=require(_0x5e03('0xc'));var _=require(_0x5e03('0xd'));var squel=require(_0x5e03('0xe'));var crypto=require(_0x5e03('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e03('0xa'));var querystring=require(_0x5e03('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e03('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e03('0x12'));var logger=require(_0x5e03('0x13'))(_0x5e03('0x14'));var utils=require(_0x5e03('0x15'));var config=require(_0x5e03('0x16'));var licenseUtil=require(_0x5e03('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1accaf,_0xb7f772){_0xb7f772=_0xb7f772||0xcc;return function(_0x4ef59b){if(_0x4ef59b){return _0x1accaf[_0x5e03('0x18')](_0xb7f772);}return _0x1accaf['status'](_0xb7f772)['end']();};}function respondWithResult(_0x5dcb3b,_0xe456ed){_0xe456ed=_0xe456ed||0xc8;return function(_0x38c62a){if(_0x38c62a){return _0x5dcb3b[_0x5e03('0x19')](_0xe456ed)[_0x5e03('0x1a')](_0x38c62a);}};}function respondWithFilteredResult(_0x1bfcf4,_0x5b28e4){return function(_0x111745){if(_0x111745){var _0x25b59e=typeof _0x5b28e4[_0x5e03('0x1b')]==='undefined'&&typeof _0x5b28e4[_0x5e03('0x1c')]===_0x5e03('0x1d');var _0x504936=_0x111745[_0x5e03('0x1e')];var _0x57da1a=_0x25b59e?0x0:_0x5b28e4[_0x5e03('0x1b')];var _0x5a9c71=_0x25b59e?_0x111745[_0x5e03('0x1e')]:_0x5b28e4[_0x5e03('0x1b')]+_0x5b28e4[_0x5e03('0x1c')];var _0x2b0cdf;if(_0x5a9c71>=_0x504936){_0x5a9c71=_0x504936;_0x2b0cdf=0xc8;}else{_0x2b0cdf=0xce;}_0x1bfcf4[_0x5e03('0x19')](_0x2b0cdf);return _0x1bfcf4[_0x5e03('0x1f')](_0x5e03('0x20'),_0x57da1a+'-'+_0x5a9c71+'/'+_0x504936)[_0x5e03('0x1a')](_0x111745);}return null;};}function patchUpdates(_0x3b6029){return function(_0x3dc55b){try{jsonpatch[_0x5e03('0x21')](_0x3dc55b,_0x3b6029,!![]);}catch(_0x416334){return BPromise[_0x5e03('0x22')](_0x416334);}return _0x3dc55b['save']();};}function saveUpdates(_0x50106a,_0x3f6366){return function(_0x32ae1f){if(_0x32ae1f){return _0x32ae1f[_0x5e03('0x23')](_0x50106a)[_0x5e03('0x24')](function(_0x2260e5){return _0x2260e5;});}return null;};}function removeEntity(_0x258b47,_0x3f55cd){return function(_0x239aea){if(_0x239aea){return _0x239aea[_0x5e03('0x25')]()[_0x5e03('0x24')](function(){_0x258b47[_0x5e03('0x19')](0xcc)[_0x5e03('0x26')]();});}};}function handleEntityNotFound(_0x1acb47,_0x18b8a3){return function(_0x565094){if(!_0x565094){_0x1acb47[_0x5e03('0x18')](0x194);}return _0x565094;};}function handleError(_0x5032aa,_0x1d186d){_0x1d186d=_0x1d186d||0x1f4;return function(_0x37d9d7){logger[_0x5e03('0x27')](_0x37d9d7[_0x5e03('0x28')]);if(_0x37d9d7['name']){delete _0x37d9d7[_0x5e03('0x29')];}_0x5032aa['status'](_0x1d186d)['send'](_0x37d9d7);};}var utilLicense=require(_0x5e03('0x17'));exports[_0x5e03('0x2a')]=function(_0x5e7243,_0x3c6d72){var _0x331400={'raw':!![],'where':{'id':0x1}},_0x2e7475={};_0x2e7475[_0x5e03('0x2b')]=_[_0x5e03('0x2c')](db['License'][_0x5e03('0x2d')]);_0x2e7475['query']=_[_0x5e03('0x2c')](_0x5e7243[_0x5e03('0x2e')]);_0x2e7475[_0x5e03('0x2f')]=_[_0x5e03('0x30')](_0x2e7475['model'],_0x2e7475[_0x5e03('0x2e')]);_0x331400[_0x5e03('0x31')]=_['intersection'](_0x2e7475['model'],qs[_0x5e03('0x32')](_0x5e7243[_0x5e03('0x2e')][_0x5e03('0x32')]));_0x331400[_0x5e03('0x31')]=_0x331400[_0x5e03('0x31')][_0x5e03('0x33')]?_0x331400[_0x5e03('0x31')]:_0x2e7475[_0x5e03('0x2b')];_0x331400=_['merge']({},_0x331400,_0x5e7243[_0x5e03('0x34')]);return utilLicense[_0x5e03('0x35')](_0x331400)[_0x5e03('0x24')](respondWithResult(_0x3c6d72,null))['catch'](handleError(_0x3c6d72,null));};exports['update']=function(_0x5d6e09,_0x3c0255){if(_0x5d6e09[_0x5e03('0x36')]['id']){delete _0x5d6e09[_0x5e03('0x36')]['id'];}return db[_0x5e03('0x37')]['find']({'where':{'id':_0x5d6e09[_0x5e03('0x38')]['id']}})[_0x5e03('0x24')](handleEntityNotFound(_0x3c0255,null))[_0x5e03('0x24')](function(_0x4b61a1){var _0x92c8d4=_0x4b61a1['get']({'plain':!![]});return utilLicense[_0x5e03('0x39')](_0x92c8d4,_0x5d6e09[_0x5e03('0x36')][_0x5e03('0x3a')]);})[_0x5e03('0x24')](function(_0x3406ac){if(!_0x3406ac[_0x5e03('0x3b')]){return saveUpdates(_0x5d6e09['body'],null);}return _0x3406ac;})[_0x5e03('0x24')](respondWithResult(_0x3c0255,null))['catch'](handleError(_0x3c0255,null));};exports[_0x5e03('0x3c')]=function(_0x5a6edb,_0xc63e0c){var _0x22d86a=_0x5e03('0x3d');var _0x193c5b=path[_0x5e03('0x3e')](_0x5e03('0x3f'),_0x5e03('0x40'),_0x5e03('0x41'),_0x22d86a);_0xc63e0c[_0x5e03('0x42')](_0x5e03('0x43'),_0x5e03('0x44')+_0x22d86a);_0xc63e0c[_0x5e03('0x1f')](_0x5e03('0x45'),'text/plain');_0xc63e0c[_0x5e03('0x46')](_0x193c5b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5333453..1538659 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 _0x6e7c=['../../config/logger','api','moment','bluebird','path','../../config/environment','./license.attributes','exports','define','util'];(function(_0x5ca1c4,_0x3a4645){var _0x349538=function(_0x9a7bbb){while(--_0x9a7bbb){_0x5ca1c4['push'](_0x5ca1c4['shift']());}};_0x349538(++_0x3a4645);}(_0x6e7c,0xdb));var _0xc6e7=function(_0x340e55,_0x589a3c){_0x340e55=_0x340e55-0x0;var _0x33ad3b=_0x6e7c[_0x340e55];return _0x33ad3b;};'use strict';var _=require('lodash');var util=require(_0xc6e7('0x0'));var logger=require(_0xc6e7('0x1'))(_0xc6e7('0x2'));var moment=require(_0xc6e7('0x3'));var BPromise=require(_0xc6e7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e7('0x5'));var rimraf=require('rimraf');var config=require(_0xc6e7('0x6'));var attributes=require(_0xc6e7('0x7'));module[_0xc6e7('0x8')]=function(_0x1d94ed,_0x15fde6){return _0x1d94ed[_0xc6e7('0x9')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c45=['rimraf','define','License','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1f81dd,_0x10fb17){var _0x49d583=function(_0x1e7c29){while(--_0x1e7c29){_0x1f81dd['push'](_0x1f81dd['shift']());}};_0x49d583(++_0x10fb17);}(_0x6c45,0x1f2));var _0x56c4=function(_0x125803,_0x4616b7){_0x125803=_0x125803-0x0;var _0x4453cb=_0x6c45[_0x125803];return _0x4453cb;};'use strict';var _=require('lodash');var util=require(_0x56c4('0x0'));var logger=require(_0x56c4('0x1'))('api');var moment=require(_0x56c4('0x2'));var BPromise=require(_0x56c4('0x3'));var rp=require(_0x56c4('0x4'));var fs=require('fs');var path=require(_0x56c4('0x5'));var rimraf=require(_0x56c4('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x43e808,_0x53c6d6){return _0x43e808[_0x56c4('0x7')](_0x56c4('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 89e3974..5a7883b 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 _0x0993=['message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x4bdc74,_0x2731f5){var _0x26901=function(_0x4ff964){while(--_0x4ff964){_0x4bdc74['push'](_0x4bdc74['shift']());}};_0x26901(++_0x2731f5);}(_0x0993,0x1ba));var _0x3099=function(_0x56e2bf,_0x547d1e){_0x56e2bf=_0x56e2bf-0x0;var _0xbb9be4=_0x0993[_0x56e2bf];return _0xbb9be4;};'use strict';var _=require('lodash');var util=require(_0x3099('0x0'));var moment=require('moment');var BPromise=require(_0x3099('0x1'));var rs=require(_0x3099('0x2'));var fs=require('fs');var Redis=require(_0x3099('0x3'));var db=require(_0x3099('0x4'))['db'];var utils=require(_0x3099('0x5'));var logger=require(_0x3099('0x6'))(_0x3099('0x7'));var config=require(_0x3099('0x8'));var jayson=require(_0x3099('0x9'));var client=jayson[_0x3099('0xa')][_0x3099('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5876ff,_0x15d0ca,_0x2c86b7){return new BPromise(function(_0x4d4fe0,_0x218955){return client[_0x3099('0xc')](_0x5876ff,_0x2c86b7)[_0x3099('0xd')](function(_0x1a1678){logger[_0x3099('0xe')](_0x3099('0xf'),_0x15d0ca,_0x3099('0x10'));logger[_0x3099('0x11')](_0x3099('0x12'),_0x15d0ca,'request\x20sent',JSON['stringify'](_0x1a1678));if(_0x1a1678[_0x3099('0x13')]){if(_0x1a1678['error']['code']===0x1f4){logger[_0x3099('0x13')]('License,\x20%s,\x20%s',_0x15d0ca,_0x1a1678[_0x3099('0x13')][_0x3099('0x14')]);return _0x218955(_0x1a1678[_0x3099('0x13')][_0x3099('0x14')]);}logger[_0x3099('0x13')]('License,\x20%s,\x20%s',_0x15d0ca,_0x1a1678[_0x3099('0x13')]['message']);return _0x4d4fe0(_0x1a1678[_0x3099('0x13')]['message']);}else{logger[_0x3099('0xe')](_0x3099('0xf'),_0x15d0ca,'request\x20sent');_0x4d4fe0(_0x1a1678['result'][_0x3099('0x14')]);}})['catch'](function(_0x542c93){logger[_0x3099('0x13')]('License,\x20%s,\x20%s',_0x15d0ca,_0x542c93);_0x218955(_0x542c93);});});} \ No newline at end of file +var _0x89c1=['../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x356773,_0x49f8c2){var _0x4e478f=function(_0x547b46){while(--_0x547b46){_0x356773['push'](_0x356773['shift']());}};_0x4e478f(++_0x49f8c2);}(_0x89c1,0x64));var _0x189c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x89c1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x189c('0x0'));var moment=require(_0x189c('0x1'));var BPromise=require(_0x189c('0x2'));var rs=require(_0x189c('0x3'));var fs=require('fs');var Redis=require(_0x189c('0x4'));var db=require(_0x189c('0x5'))['db'];var utils=require(_0x189c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x189c('0x7'));var client=jayson[_0x189c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20aaa4,_0x3da7e1,_0x114287){return new BPromise(function(_0x498642,_0x703a22){return client[_0x189c('0x9')](_0x20aaa4,_0x114287)[_0x189c('0xa')](function(_0x2efcb0){logger[_0x189c('0xb')](_0x189c('0xc'),_0x3da7e1,'request\x20sent');logger[_0x189c('0xd')](_0x189c('0xe'),_0x3da7e1,_0x189c('0xf'),JSON['stringify'](_0x2efcb0));if(_0x2efcb0['error']){if(_0x2efcb0[_0x189c('0x10')][_0x189c('0x11')]===0x1f4){logger[_0x189c('0x10')](_0x189c('0xc'),_0x3da7e1,_0x2efcb0[_0x189c('0x10')][_0x189c('0x12')]);return _0x703a22(_0x2efcb0[_0x189c('0x10')][_0x189c('0x12')]);}logger[_0x189c('0x10')]('License,\x20%s,\x20%s',_0x3da7e1,_0x2efcb0['error'][_0x189c('0x12')]);return _0x498642(_0x2efcb0['error'][_0x189c('0x12')]);}else{logger[_0x189c('0xb')](_0x189c('0xc'),_0x3da7e1,'request\x20sent');_0x498642(_0x2efcb0[_0x189c('0x13')]['message']);}})[_0x189c('0x14')](function(_0x38f3d7){logger[_0x189c('0x10')](_0x189c('0xc'),_0x3da7e1,_0x38f3d7);_0x703a22(_0x38f3d7);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6e96334..4952d9a 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 _0xe4be=['removeDispositions','removeImap','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addApplications','update','delete'];(function(_0x43a07f,_0x20e9f9){var _0x4f25e2=function(_0x3ebcea){while(--_0x3ebcea){_0x43a07f['push'](_0x43a07f['shift']());}};_0x4f25e2(++_0x20e9f9);}(_0xe4be,0x118));var _0xee4b=function(_0x51243c,_0x40a3ee){_0x51243c=_0x51243c-0x0;var _0x25416e=_0xe4be[_0x51243c];return _0x25416e;};'use strict';var multer=require(_0xee4b('0x0'));var util=require(_0xee4b('0x1'));var path=require('path');var timeout=require(_0xee4b('0x2'));var express=require(_0xee4b('0x3'));var router=express[_0xee4b('0x4')]();var fs_extra=require(_0xee4b('0x5'));var auth=require(_0xee4b('0x6'));var interaction=require(_0xee4b('0x7'));var config=require(_0xee4b('0x8'));var controller=require(_0xee4b('0x9'));router[_0xee4b('0xa')]('/',auth[_0xee4b('0xb')](),controller[_0xee4b('0xc')]);router[_0xee4b('0xa')](_0xee4b('0xd'),auth[_0xee4b('0xb')](),controller[_0xee4b('0xe')]);router[_0xee4b('0xa')](_0xee4b('0xf'),auth['isAuthenticated'](),controller[_0xee4b('0x10')]);router[_0xee4b('0xa')](_0xee4b('0x11'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x12')]);router[_0xee4b('0xa')](_0xee4b('0x13'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x14')]);router['get'](_0xee4b('0x15'),auth[_0xee4b('0xb')](),controller['getImap']);router['get'](_0xee4b('0x16'),auth['isAuthenticated'](),controller[_0xee4b('0x17')]);router['get'](_0xee4b('0x18'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x19')]);router[_0xee4b('0xa')](_0xee4b('0x1a'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x1b')]);router[_0xee4b('0xa')](_0xee4b('0x1c'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x1d')]);router['get'](_0xee4b('0x1e'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x1f')]);router[_0xee4b('0xa')](_0xee4b('0x20'),auth['isAuthenticated'](),controller[_0xee4b('0x21')]);router[_0xee4b('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xee4b('0x23')]);router['post'](_0xee4b('0x13'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x24')]);router[_0xee4b('0x22')]('/',auth[_0xee4b('0xb')](),controller[_0xee4b('0x25')]);router[_0xee4b('0x22')](_0xee4b('0x15'),auth['isAuthenticated'](),controller[_0xee4b('0x26')]);router[_0xee4b('0x22')](_0xee4b('0x16'),auth[_0xee4b('0xb')](),controller['addSmtp']);router[_0xee4b('0x22')](_0xee4b('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0xee4b('0x1a'),auth['isAuthenticated'](),controller[_0xee4b('0x27')]);router[_0xee4b('0x22')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xee4b('0x22')](_0xee4b('0x20'),auth[_0xee4b('0xb')](),controller['addAgents']);router['put'](_0xee4b('0xf'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x28')]);router[_0xee4b('0x29')]('/:id/dispositions',auth[_0xee4b('0xb')](),controller[_0xee4b('0x2a')]);router[_0xee4b('0x29')](_0xee4b('0x13'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xee4b('0x29')](_0xee4b('0x15'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x2b')]);router[_0xee4b('0x29')](_0xee4b('0x16'),auth[_0xee4b('0xb')](),controller['removeSmtp']);router[_0xee4b('0x29')](_0xee4b('0xf'),auth[_0xee4b('0xb')](),controller[_0xee4b('0x2c')]);router[_0xee4b('0x29')](_0xee4b('0x20'),auth[_0xee4b('0xb')](),controller['removeAgents']);module[_0xee4b('0x2d')]=router; \ No newline at end of file +var _0x954f=['/:id/users','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','removeAnswers','removeImap','delete','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x954f,0x1ba));var _0xf954=function(_0x2c3a22,_0x1324da){_0x2c3a22=_0x2c3a22-0x0;var _0x4a09c2=_0x954f[_0x2c3a22];return _0x4a09c2;};'use strict';var multer=require(_0xf954('0x0'));var util=require(_0xf954('0x1'));var path=require(_0xf954('0x2'));var timeout=require(_0xf954('0x3'));var express=require('express');var router=express[_0xf954('0x4')]();var fs_extra=require(_0xf954('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf954('0x6'));var config=require(_0xf954('0x7'));var controller=require(_0xf954('0x8'));router['get']('/',auth[_0xf954('0x9')](),controller[_0xf954('0xa')]);router[_0xf954('0xb')](_0xf954('0xc'),auth[_0xf954('0x9')](),controller[_0xf954('0xd')]);router[_0xf954('0xb')](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['show']);router[_0xf954('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xf954('0xb')](_0xf954('0xf'),auth[_0xf954('0x9')](),controller[_0xf954('0x10')]);router[_0xf954('0xb')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xf954('0x11')]);router['get'](_0xf954('0x12'),auth[_0xf954('0x9')](),controller[_0xf954('0x13')]);router[_0xf954('0xb')](_0xf954('0x14'),auth[_0xf954('0x9')](),controller[_0xf954('0x15')]);router[_0xf954('0xb')](_0xf954('0x16'),auth[_0xf954('0x9')](),controller[_0xf954('0x17')]);router[_0xf954('0xb')](_0xf954('0x18'),auth[_0xf954('0x9')](),controller[_0xf954('0x19')]);router[_0xf954('0xb')](_0xf954('0x1a'),auth[_0xf954('0x9')](),controller[_0xf954('0x1b')]);router[_0xf954('0xb')](_0xf954('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf954('0x1d')](_0xf954('0x1e'),auth[_0xf954('0x9')](),controller[_0xf954('0x1f')]);router['post'](_0xf954('0xf'),auth['isAuthenticated'](),controller[_0xf954('0x20')]);router[_0xf954('0x1d')]('/',auth[_0xf954('0x9')](),controller[_0xf954('0x21')]);router[_0xf954('0x1d')](_0xf954('0x22'),auth[_0xf954('0x9')](),controller[_0xf954('0x23')]);router['post']('/:id/out_servers',auth[_0xf954('0x9')](),controller[_0xf954('0x24')]);router[_0xf954('0x1d')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf954('0x25')]);router[_0xf954('0x1d')](_0xf954('0x16'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xf954('0x26'),auth['isAuthenticated'](),controller[_0xf954('0x27')]);router[_0xf954('0x1d')](_0xf954('0x1c'),auth['isAuthenticated'](),controller[_0xf954('0x28')]);router['put'](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['update']);router['delete'](_0xf954('0x1e'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xf954('0xf'),auth[_0xf954('0x9')](),controller[_0xf954('0x29')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0xf954('0x2a')]);router[_0xf954('0x2b')](_0xf954('0x12'),auth[_0xf954('0x9')](),controller[_0xf954('0x2c')]);router[_0xf954('0x2b')](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['destroy']);router[_0xf954('0x2b')]('/:id/users',auth[_0xf954('0x9')](),controller[_0xf954('0x2d')]);module[_0xf954('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cefd507..f2cb42f 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 _0x8883=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','custom','provider','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5aa4ba,_0x116a2f){var _0x5f171d=function(_0x5745f4){while(--_0x5745f4){_0x5aa4ba['push'](_0x5aa4ba['shift']());}};_0x5f171d(++_0x116a2f);}(_0x8883,0x118));var _0x3888=function(_0x2bcf35,_0x11f5f8){_0x2bcf35=_0x2bcf35-0x0;var _0x5e9116=_0x8883[_0x2bcf35];return _0x5e9116;};'use strict';var Sequelize=require('sequelize');module[_0x3888('0x0')]={'description':{'type':Sequelize[_0x3888('0x1')]},'name':{'type':Sequelize[_0x3888('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3888('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3888('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3888('0x3')]},'markAsUnread':{'type':Sequelize[_0x3888('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3888('0x4')},'fontSize':{'type':Sequelize[_0x3888('0x5')](0x2)[_0x3888('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3888('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x3888('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3888('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3888('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3888('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3888('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3888('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3888('0x2')],'defaultValue':![],'comment':_0x3888('0x7'),'set':function(_0x384561){if(!_0x384561)this[_0x3888('0x8')](_0x3888('0x9'),null);this['setDataValue'](_0x3888('0xa'),_0x384561);}},'provider':{'type':Sequelize[_0x3888('0xb')](_0x3888('0xc'),_0x3888('0xd'),_0x3888('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3888('0xf')]('provider'))return _0x3888('0x10');return this[_0x3888('0xf')](_0x3888('0x11'));},'set':function(_0x254a8d){if(_0x254a8d===_0x3888('0x10'))_0x254a8d=null;return this[_0x3888('0x8')](_0x3888('0x11'),_0x254a8d);}}}; \ No newline at end of file +var _0x4563=['custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','yahoo','getDataValue','provider'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4563,0x97));var _0x3456=function(_0xf2290f,_0x1a888e){_0xf2290f=_0xf2290f-0x0;var _0xecafbc=_0x4563[_0xf2290f];return _0xecafbc;};'use strict';var Sequelize=require(_0x3456('0x0'));module['exports']={'description':{'type':Sequelize[_0x3456('0x1')]},'name':{'type':Sequelize[_0x3456('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3456('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3456('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3456('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3456('0x3')]},'markAsUnread':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3456('0x1')],'allowNull':![],'defaultValue':_0x3456('0x4')},'fontSize':{'type':Sequelize[_0x3456('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3456('0x3')],'defaultValue':function(){return _0x3456('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3456('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3456('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xea945a){if(!_0xea945a)this[_0x3456('0x7')](_0x3456('0x8'),null);this[_0x3456('0x7')](_0x3456('0x9'),_0xea945a);}},'provider':{'type':Sequelize['ENUM'](_0x3456('0xa'),'hotmail',_0x3456('0xb'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3456('0xc')]('provider'))return'custom';return this[_0x3456('0xc')](_0x3456('0xd'));},'set':function(_0x258eb7){if(_0x258eb7===_0x3456('0xe'))_0x258eb7=null;return this[_0x3456('0x7')](_0x3456('0xd'),_0x258eb7);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4c89ffa..982516d 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 _0x8204=['format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List','List\x20not\x20found','Contacts','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','MailAccount','findAll','rows','show','params','MailServerIn','mandatoryDispositionPause','find','body','provider','custom','Pause','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split'];(function(_0xaa7246,_0x3c5a59){var _0x41bc9f=function(_0x4bd427){while(--_0x4bd427){_0xaa7246['push'](_0xaa7246['shift']());}};_0x41bc9f(++_0x3c5a59);}(_0x8204,0xf2));var _0x4820=function(_0x4d70e0,_0x291407){_0x4d70e0=_0x4d70e0-0x0;var _0x29eb30=_0x8204[_0x4d70e0];return _0x29eb30;};'use strict';var moment=require(_0x4820('0x0'));var BPromise=require(_0x4820('0x1'));var util=require(_0x4820('0x2'));var path=require(_0x4820('0x3'));var _=require(_0x4820('0x4'));var juice=require('juice');var Redis=require(_0x4820('0x5'));var qs=require(_0x4820('0x6'));var logger=require(_0x4820('0x7'))(_0x4820('0x8'));var config=require(_0x4820('0x9'));var db=require(_0x4820('0xa'))['db'];config[_0x4820('0xb')]=_['defaults'](config['redis'],{'host':_0x4820('0xc'),'port':0x18eb});var socket=require(_0x4820('0xd'))(new Redis(config['redis']));require(_0x4820('0xe'))[_0x4820('0xf')](socket);var jayson=require(_0x4820('0x10'));var client=jayson['client'][_0x4820('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x15f172,_0x42b774,_0x3a8aa5,_0x4139a9){return new BPromise(function(_0x39f446,_0xff7188){var _0x51a00f=_0x4139a9||client;return _0x51a00f['request'](_0x15f172,_0x3a8aa5)[_0x4820('0x12')](function(_0xbf50e9){logger[_0x4820('0x13')](_0x4820('0x14'),_0x42b774,_0x4820('0x15'));logger[_0x4820('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x42b774,_0x4820('0x15'),JSON[_0x4820('0x17')](_0xbf50e9));if(_0xbf50e9[_0x4820('0x18')]){if(_0xbf50e9['error'][_0x4820('0x19')]===0x1f4){logger[_0x4820('0x18')](_0x4820('0x14'),_0x42b774,_0xbf50e9[_0x4820('0x18')][_0x4820('0x1a')]);return _0xff7188(_0xbf50e9[_0x4820('0x18')][_0x4820('0x1a')]);}logger[_0x4820('0x18')](_0x4820('0x14'),_0x42b774,_0xbf50e9[_0x4820('0x18')][_0x4820('0x1a')]);return _0x39f446(_0xbf50e9[_0x4820('0x18')][_0x4820('0x1a')]);}else{logger[_0x4820('0x13')](_0x4820('0x14'),_0x42b774,_0x4820('0x15'));_0x39f446(_0xbf50e9['result'][_0x4820('0x1a')]);}})[_0x4820('0x1b')](function(_0x22be80){logger[_0x4820('0x18')]('MailAccount,\x20%s,\x20%s',_0x42b774,_0x22be80);_0xff7188(_0x22be80);});});}function respondWithStatusCode(_0x420efd,_0x3c06ce){_0x3c06ce=_0x3c06ce||0xcc;return function(_0x1618cd){if(_0x1618cd){return _0x420efd[_0x4820('0x1c')](_0x3c06ce);}return _0x420efd[_0x4820('0x1d')](_0x3c06ce)['end']();};}function respondWithResult(_0x42636e,_0x5758e7){_0x5758e7=_0x5758e7||0xc8;return function(_0x4feb6f){if(_0x4feb6f){return _0x42636e[_0x4820('0x1d')](_0x5758e7)[_0x4820('0x1e')](_0x4feb6f);}};}function respondWithFilteredResult(_0x3fa4dd,_0x34a458){return function(_0x138949){if(_0x138949){var _0x3beee6=typeof _0x34a458[_0x4820('0x1f')]===_0x4820('0x20')&&typeof _0x34a458[_0x4820('0x21')]===_0x4820('0x20');var _0x19219a=_0x138949[_0x4820('0x22')];var _0x29657a=_0x3beee6?0x0:_0x34a458['offset'];var _0x45509b=_0x3beee6?_0x138949[_0x4820('0x22')]:_0x34a458['offset']+_0x34a458[_0x4820('0x21')];var _0x7c4db0;if(_0x45509b>=_0x19219a){_0x45509b=_0x19219a;_0x7c4db0=0xc8;}else{_0x7c4db0=0xce;}_0x3fa4dd[_0x4820('0x1d')](_0x7c4db0);return _0x3fa4dd[_0x4820('0x23')](_0x4820('0x24'),_0x29657a+'-'+_0x45509b+'/'+_0x19219a)[_0x4820('0x1e')](_0x138949);}return null;};}function saveUpdates(_0x22cf26){return function(_0x274447){if(_0x274447){return _0x274447[_0x4820('0x25')](_0x22cf26)[_0x4820('0x12')](function(_0x133543){return _0x133543;});}return null;};}function removeEntity(_0x36839a){return function(_0x47623e){if(_0x47623e){return _0x47623e[_0x4820('0x26')]()[_0x4820('0x12')](function(){var _0x367b83=_0x47623e[_0x4820('0x27')]({'plain':!![]});var _0x24c463='MailAccounts';return db[_0x4820('0x28')][_0x4820('0x26')]({'where':{'type':_0x24c463,'resourceId':_0x367b83['id']}})[_0x4820('0x12')](function(){return _0x47623e;});})[_0x4820('0x12')](function(){_0x36839a['status'](0xcc)[_0x4820('0x29')]();});}};}function handleEntityNotFound(_0x24aaad){return function(_0x45b53d){if(!_0x45b53d){_0x24aaad[_0x4820('0x1c')](0x194);}return _0x45b53d;};}function handleError(_0x1b7ffe,_0x21eb8a){_0x21eb8a=_0x21eb8a||0x1f4;return function(_0x339cfb){logger[_0x4820('0x18')](_0x339cfb[_0x4820('0x2a')]);if(_0x339cfb['name']){delete _0x339cfb[_0x4820('0x2b')];}_0x1b7ffe[_0x4820('0x1d')](_0x21eb8a)[_0x4820('0x2c')](_0x339cfb);};}function getImapHost(_0x79d639){switch(_0x79d639){case _0x4820('0x2d'):return _0x4820('0x2e');case _0x4820('0x2f'):return'imap.mail.yahoo.com';case _0x4820('0x30'):return'imap-mail.outlook.com';case _0x4820('0x31'):return _0x4820('0x32');}throw new Error('Unknown\x20email\x20service\x20provider',_0x79d639);}function getSmtpHost(_0x3ce3b8){switch(_0x3ce3b8){case _0x4820('0x2d'):return'smtp.gmail.com';case _0x4820('0x2f'):return _0x4820('0x33');case'hotmail':return _0x4820('0x34');case _0x4820('0x31'):return _0x4820('0x35');}throw new Error('Unknown\x20email\x20service\x20provider',_0x3ce3b8);}function getAuthenticationOptions(_0x40e1e8,_0x280120){var _0x57f728={};var _0x2f96af={};if(_0x40e1e8){_0x57f728[_0x4820('0x36')]=_0x2f96af['user']=_0x280120[_0x4820('0x37')];_0x57f728[_0x4820('0x38')]=_0x2f96af[_0x4820('0x39')]=_0x280120['password'];if(_0x280120[_0x4820('0x3a')]){_0x57f728[_0x4820('0x3a')]=_0x2f96af['modernAuthentication']=!![];_0x57f728[_0x4820('0x3b')]=_0x2f96af[_0x4820('0x3b')]=_0x280120[_0x4820('0x3b')];_0x57f728[_0x4820('0x38')]=_0x2f96af['pass']=null;}else{_0x57f728[_0x4820('0x3b')]=_0x2f96af['CloudProviderId']=null;}_0x57f728[_0x4820('0x3c')]=getImapHost(_0x40e1e8);_0x57f728[_0x4820('0x3d')]=0x3e1;_0x2f96af[_0x4820('0x3c')]=getSmtpHost(_0x40e1e8);_0x2f96af[_0x4820('0x3d')]=0x24b;_0x2f96af[_0x4820('0x3e')]=![];_0x57f728[_0x4820('0x3f')]=_0x2f96af['service']=null;}else{if(_0x280120[_0x4820('0x40')]){_0x57f728[_0x4820('0x36')]=_0x2f96af['user']=_0x280120[_0x4820('0x37')];_0x57f728[_0x4820('0x38')]=_0x2f96af['pass']=_0x280120[_0x4820('0x38')];}else{_0x57f728[_0x4820('0x40')]=_0x2f96af['authentication']=![];_0x57f728['user']=_0x2f96af['user']=null;_0x57f728['password']=_0x2f96af['pass']=null;}_0x57f728['host']=_0x280120[_0x4820('0x41')]['host'];_0x57f728['port']=_0x280120[_0x4820('0x41')]['port'];_0x2f96af[_0x4820('0x3c')]=_0x280120[_0x4820('0x42')]['host'];_0x2f96af[_0x4820('0x3d')]=_0x280120[_0x4820('0x42')][_0x4820('0x3d')];}return{'Imap':_0x57f728,'Smtp':_0x2f96af};}exports[_0x4820('0x43')]=function(_0x11e238,_0x18a3c9){var _0x4451bc={'include':[{'model':db['MailServerIn'],'as':_0x4820('0x41')},{'model':db[_0x4820('0x44')],'as':_0x4820('0x42')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x68eac={},_0x54ade2={'count':0x0,'rows':[]};var _0x2988b0=_[_0x4820('0x45')](db['MailAccount']['rawAttributes'],function(_0xe1abb9){return{'name':_0xe1abb9['fieldName'],'type':_0xe1abb9[_0x4820('0x46')][_0x4820('0x47')]};});_0x68eac[_0x4820('0x48')]=_[_0x4820('0x45')](_0x2988b0,'name');_0x68eac[_0x4820('0x49')]=_[_0x4820('0x4a')](_0x11e238[_0x4820('0x49')]);_0x68eac[_0x4820('0x4b')]=_[_0x4820('0x4c')](_0x68eac[_0x4820('0x48')],_0x68eac[_0x4820('0x49')]);_0x4451bc[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x68eac[_0x4820('0x48')],qs[_0x4820('0x4e')](_0x11e238['query'][_0x4820('0x4e')]));_0x4451bc[_0x4820('0x4d')]=_0x4451bc[_0x4820('0x4d')][_0x4820('0x4f')]?_0x4451bc[_0x4820('0x4d')]:_0x68eac[_0x4820('0x48')];if(!_0x11e238['query']['hasOwnProperty'](_0x4820('0x50'))){_0x4451bc['limit']=qs['limit'](_0x11e238[_0x4820('0x49')][_0x4820('0x21')]);_0x4451bc['offset']=qs['offset'](_0x11e238[_0x4820('0x49')]['offset']);}_0x4451bc[_0x4820('0x51')]=qs[_0x4820('0x52')](_0x11e238[_0x4820('0x49')][_0x4820('0x52')]);_0x4451bc[_0x4820('0x53')]=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x11e238[_0x4820('0x49')],_0x68eac[_0x4820('0x4b')]),_0x2988b0);if(_0x11e238[_0x4820('0x49')][_0x4820('0x55')]){_0x4451bc['where']=_[_0x4820('0x56')](_0x4451bc[_0x4820('0x53')],{'$or':_[_0x4820('0x45')](_0x2988b0,function(_0xa4be12){if(_0xa4be12[_0x4820('0x46')]!=='VIRTUAL'){var _0x23ebca={};_0x23ebca[_0xa4be12[_0x4820('0x2b')]]={'$like':'%'+_0x11e238[_0x4820('0x49')][_0x4820('0x55')]+'%'};return _0x23ebca;}})});}_0x4451bc=_['merge']({},_0x4451bc,_0x11e238[_0x4820('0x57')]);var _0x1e6152={'where':_0x4451bc[_0x4820('0x53')]};return db['MailAccount'][_0x4820('0x22')](_0x1e6152)[_0x4820('0x12')](function(_0x3e124b){_0x54ade2['count']=_0x3e124b;if(_0x11e238[_0x4820('0x49')][_0x4820('0x58')]){_0x4451bc[_0x4820('0x59')]=[{'all':!![]}];}return db[_0x4820('0x5a')][_0x4820('0x5b')](_0x4451bc);})['then'](function(_0x4b45d0){_0x54ade2[_0x4820('0x5c')]=_0x4b45d0;return _0x54ade2;})[_0x4820('0x12')](respondWithFilteredResult(_0x18a3c9,_0x4451bc))[_0x4820('0x1b')](handleError(_0x18a3c9,null));};exports[_0x4820('0x5d')]=function(_0xf2e792,_0x3b495a){var _0x2d09d8={'raw':![],'where':{'id':_0xf2e792[_0x4820('0x5e')]['id']},'include':[{'model':db[_0x4820('0x5f')],'as':_0x4820('0x41')},{'model':db[_0x4820('0x44')],'as':_0x4820('0x42')},{'model':db['Pause'],'as':_0x4820('0x60')}]},_0x339a80={};_0x339a80['model']=_['keys'](db[_0x4820('0x5a')]['rawAttributes']);_0x339a80['query']=_['keys'](_0xf2e792[_0x4820('0x49')]);_0x339a80['filters']=_['intersection'](_0x339a80['model'],_0x339a80[_0x4820('0x49')]);_0x2d09d8[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x339a80['model'],qs[_0x4820('0x4e')](_0xf2e792[_0x4820('0x49')]['fields']));_0x2d09d8['attributes']=_0x2d09d8[_0x4820('0x4d')][_0x4820('0x4f')]?_0x2d09d8[_0x4820('0x4d')]:_0x339a80[_0x4820('0x48')];if(_0xf2e792[_0x4820('0x49')][_0x4820('0x58')]){_0x2d09d8[_0x4820('0x59')]=[{'all':!![]}];}_0x2d09d8=_[_0x4820('0x56')]({},_0x2d09d8,_0xf2e792[_0x4820('0x57')]);return db['MailAccount'][_0x4820('0x61')](_0x2d09d8)['then'](handleEntityNotFound(_0x3b495a,null))[_0x4820('0x12')](respondWithResult(_0x3b495a,null))[_0x4820('0x1b')](handleError(_0x3b495a,null));};exports[_0x4820('0x25')]=function(_0x371224,_0x4de979){if(_0x371224[_0x4820('0x62')]['id']){delete _0x371224[_0x4820('0x62')]['id'];}var _0x2134d7=_0x371224['body'][_0x4820('0x63')]===_0x4820('0x64')?null:_0x371224[_0x4820('0x62')][_0x4820('0x63')];var _0x136ba5=_0x371224[_0x4820('0x62')][_0x4820('0x41')]||{};var _0x35df4e=_0x371224['body']['Smtp']||{};if(_0x2134d7){_0x136ba5[_0x4820('0x3c')]=getImapHost(_0x2134d7);_0x136ba5[_0x4820('0x3d')]=0x3e1;_0x35df4e['host']=getSmtpHost(_0x2134d7);_0x35df4e[_0x4820('0x3d')]=0x24b;_0x35df4e[_0x4820('0x3e')]=![];}if(_0x35df4e['modernAuthentication']){_0x35df4e[_0x4820('0x3e')]=![];}else{_0x35df4e[_0x4820('0x3b')]=null;}if(!_0x136ba5[_0x4820('0x3a')])_0x136ba5['CloudProviderId']=null;_0x371224['body'][_0x4820('0x41')]=_0x136ba5;_0x371224[_0x4820('0x62')][_0x4820('0x42')]=_0x35df4e;return db['MailAccount'][_0x4820('0x61')]({'where':{'id':_0x371224[_0x4820('0x5e')]['id']},'include':[{'model':db[_0x4820('0x5f')],'as':_0x4820('0x41')},{'model':db[_0x4820('0x44')],'as':'Smtp'},{'model':db[_0x4820('0x65')],'as':_0x4820('0x60')}]})[_0x4820('0x12')](handleEntityNotFound(_0x4de979,null))[_0x4820('0x12')](function(_0x265345){if(!_0x265345)throw new Error(_0x4820('0x66'));if(_0x265345[_0x4820('0x3f')])delete _0x371224['body'][_0x4820('0x41')];return _0x265345;})[_0x4820('0x12')](saveUpdates(_0x371224[_0x4820('0x62')],null))[_0x4820('0x12')](function(_0x55cead){if(!_0x371224[_0x4820('0x62')][_0x4820('0x41')])return _0x55cead;return db[_0x4820('0x5f')][_0x4820('0x25')](_0x371224[_0x4820('0x62')][_0x4820('0x41')],{'where':{'MailAccountId':_0x55cead['id']}})['then'](function(){return _0x55cead;});})['then'](function(_0x565c22){if(!_0x371224[_0x4820('0x62')][_0x4820('0x42')])return _0x565c22;return db[_0x4820('0x44')]['update'](_0x371224[_0x4820('0x62')][_0x4820('0x42')],{'where':{'MailAccountId':_0x565c22['id']}})[_0x4820('0x12')](function(){return _0x565c22;});})[_0x4820('0x12')](respondWithResult(_0x4de979,null))[_0x4820('0x1b')](handleError(_0x4de979,null));};exports[_0x4820('0x67')]=function(_0x5a4511,_0x15c3df){return db[_0x4820('0x5a')][_0x4820('0x67')]()[_0x4820('0x12')](respondWithResult(_0x15c3df,null))[_0x4820('0x1b')](handleError(_0x15c3df,null));};exports[_0x4820('0x68')]=function(_0xd22ed1,_0x36182f){if(_0xd22ed1['body']['id']){delete _0xd22ed1[_0x4820('0x62')]['id'];}return db[_0x4820('0x5a')]['find']({'where':{'id':_0xd22ed1['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x36182f,null))[_0x4820('0x12')](function(_0x3a6f3a){if(_0x3a6f3a){_0xd22ed1[_0x4820('0x62')][_0x4820('0x69')]=_0x3a6f3a['id'];return db[_0x4820('0x6a')][_0x4820('0x6b')](_0xd22ed1[_0x4820('0x62')]);}})[_0x4820('0x12')](respondWithResult(_0x36182f,null))[_0x4820('0x1b')](handleError(_0x36182f,null));};exports[_0x4820('0x6c')]=function(_0x17c395,_0x27cd6a){var _0x4bd801={'raw':![],'where':{}};var _0x52fc00={};var _0x40ac81={'count':0x0,'rows':[]};return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x17c395['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x27cd6a,null))[_0x4820('0x12')](function(_0x20dc85){if(_0x20dc85){_0x52fc00[_0x4820('0x48')]=_[_0x4820('0x4a')](db[_0x4820('0x6a')][_0x4820('0x6e')]);_0x52fc00[_0x4820('0x49')]=_[_0x4820('0x4a')](_0x17c395[_0x4820('0x49')]);_0x52fc00['filters']=_[_0x4820('0x4c')](_0x52fc00[_0x4820('0x48')],_0x52fc00['query']);_0x4bd801[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x52fc00[_0x4820('0x48')],qs[_0x4820('0x4e')](_0x17c395[_0x4820('0x49')][_0x4820('0x4e')]));_0x4bd801[_0x4820('0x4d')]=_0x4bd801[_0x4820('0x4d')]['length']?_0x4bd801[_0x4820('0x4d')]:_0x52fc00['model'];if(!_0x17c395[_0x4820('0x49')][_0x4820('0x6f')](_0x4820('0x50'))){_0x4bd801['limit']=qs[_0x4820('0x21')](_0x17c395['query'][_0x4820('0x21')]);_0x4bd801[_0x4820('0x1f')]=qs[_0x4820('0x1f')](_0x17c395[_0x4820('0x49')]['offset']);}_0x4bd801[_0x4820('0x51')]=qs[_0x4820('0x52')](_0x17c395[_0x4820('0x49')][_0x4820('0x52')]);_0x4bd801[_0x4820('0x53')]=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x17c395[_0x4820('0x49')],_0x52fc00[_0x4820('0x4b')]));_0x4bd801[_0x4820('0x53')][_0x4820('0x69')]=_0x20dc85['id'];if(_0x17c395[_0x4820('0x49')][_0x4820('0x55')]){_0x4bd801[_0x4820('0x53')]=_[_0x4820('0x56')](_0x4bd801['where'],{'$or':_[_0x4820('0x45')](_0x4bd801[_0x4820('0x4d')],function(_0x3ae704){var _0x43ec57={};_0x43ec57[_0x3ae704]={'$like':'%'+_0x17c395['query'][_0x4820('0x55')]+'%'};return _0x43ec57;})});}_0x4bd801=_[_0x4820('0x56')]({},_0x4bd801,_0x17c395[_0x4820('0x57')]);return db[_0x4820('0x6a')]['count']({'where':_0x4bd801[_0x4820('0x53')]})[_0x4820('0x12')](function(_0x943795){_0x40ac81[_0x4820('0x22')]=_0x943795;if(_0x17c395[_0x4820('0x49')][_0x4820('0x58')]){_0x4bd801['include']=[{'all':!![]}];}return db[_0x4820('0x6a')][_0x4820('0x5b')](_0x4bd801);})[_0x4820('0x12')](function(_0xa347a2){_0x40ac81[_0x4820('0x5c')]=_0xa347a2;return _0x40ac81;});}})[_0x4820('0x12')](respondWithFilteredResult(_0x27cd6a,_0x4bd801))[_0x4820('0x1b')](handleError(_0x27cd6a,null));};exports[_0x4820('0x70')]=function(_0xbb561c,_0xbe56d6){return db[_0x4820('0x5a')]['find']({'where':{'id':_0xbb561c[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0xbe56d6,null))['then'](function(_0x59fe1e){if(_0x59fe1e){return _0x59fe1e[_0x4820('0x70')](_0xbb561c[_0x4820('0x49')][_0x4820('0x71')]);}})['then'](respondWithStatusCode(_0xbe56d6,null))[_0x4820('0x1b')](handleError(_0xbe56d6,null));};exports[_0x4820('0x72')]=function(_0x3564d6,_0x50a401){if(_0x3564d6[_0x4820('0x62')]['id']){delete _0x3564d6[_0x4820('0x62')]['id'];}return db[_0x4820('0x5a')][_0x4820('0x61')]({'where':{'id':_0x3564d6['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x50a401,null))[_0x4820('0x12')](function(_0x38152c){if(_0x38152c){_0x3564d6[_0x4820('0x62')]['MailAccountId']=_0x38152c['id'];return db[_0x4820('0x73')][_0x4820('0x6b')](_0x3564d6[_0x4820('0x62')]);}})[_0x4820('0x12')](respondWithResult(_0x50a401,null))[_0x4820('0x1b')](handleError(_0x50a401,null));};exports[_0x4820('0x74')]=function(_0x61c090,_0x4a26b1){var _0xa07786={'raw':![],'where':{}};var _0x33c184={};var _0x5f198d={'count':0x0,'rows':[]};return db['MailAccount'][_0x4820('0x6d')]({'where':{'id':_0x61c090['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x4a26b1,null))[_0x4820('0x12')](function(_0x3d9bf9){if(_0x3d9bf9){_0x33c184['model']=_[_0x4820('0x4a')](db[_0x4820('0x73')]['rawAttributes']);_0x33c184[_0x4820('0x49')]=_[_0x4820('0x4a')](_0x61c090[_0x4820('0x49')]);_0x33c184['filters']=_[_0x4820('0x4c')](_0x33c184[_0x4820('0x48')],_0x33c184[_0x4820('0x49')]);_0xa07786['attributes']=_[_0x4820('0x4c')](_0x33c184[_0x4820('0x48')],qs[_0x4820('0x4e')](_0x61c090[_0x4820('0x49')][_0x4820('0x4e')]));_0xa07786['attributes']=_0xa07786[_0x4820('0x4d')]['length']?_0xa07786[_0x4820('0x4d')]:_0x33c184['model'];if(!_0x61c090[_0x4820('0x49')][_0x4820('0x6f')]('nolimit')){_0xa07786[_0x4820('0x21')]=qs[_0x4820('0x21')](_0x61c090['query'][_0x4820('0x21')]);_0xa07786['offset']=qs[_0x4820('0x1f')](_0x61c090['query'][_0x4820('0x1f')]);}_0xa07786['order']=qs[_0x4820('0x52')](_0x61c090[_0x4820('0x49')][_0x4820('0x52')]);_0xa07786[_0x4820('0x53')]=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x61c090[_0x4820('0x49')],_0x33c184['filters']));_0xa07786['where'][_0x4820('0x69')]=_0x3d9bf9['id'];if(_0x61c090['query']['filter']){_0xa07786['where']=_[_0x4820('0x56')](_0xa07786['where'],{'$or':_[_0x4820('0x45')](_0xa07786[_0x4820('0x4d')],function(_0x5bc8f5){var _0xfed317={};_0xfed317[_0x5bc8f5]={'$like':'%'+_0x61c090[_0x4820('0x49')][_0x4820('0x55')]+'%'};return _0xfed317;})});}_0xa07786=_[_0x4820('0x56')]({},_0xa07786,_0x61c090['options']);return db[_0x4820('0x73')][_0x4820('0x22')]({'where':_0xa07786['where']})[_0x4820('0x12')](function(_0x20645d){_0x5f198d[_0x4820('0x22')]=_0x20645d;if(_0x61c090[_0x4820('0x49')][_0x4820('0x58')]){_0xa07786['include']=[{'all':!![]}];}return db[_0x4820('0x73')][_0x4820('0x5b')](_0xa07786);})[_0x4820('0x12')](function(_0x3d0b95){_0x5f198d['rows']=_0x3d0b95;return _0x5f198d;});}})['then'](respondWithFilteredResult(_0x4a26b1,_0xa07786))['catch'](handleError(_0x4a26b1,null));};exports[_0x4820('0x75')]=function(_0x15a889,_0xe384e5){return db['MailAccount'][_0x4820('0x61')]({'where':{'id':_0x15a889['params']['id']}})['then'](handleEntityNotFound(_0xe384e5,null))[_0x4820('0x12')](function(_0x3f658f){if(_0x3f658f){return _0x3f658f[_0x4820('0x75')](_0x15a889['query'][_0x4820('0x71')]);}})['then'](respondWithStatusCode(_0xe384e5,null))[_0x4820('0x1b')](handleError(_0xe384e5,null));};exports[_0x4820('0x6b')]=function(_0x2f27fe,_0xdaa2e){var _0x2c5dee={'name':_0x2f27fe['body'][_0x4820('0x2b')],'key':_0x2f27fe[_0x4820('0x62')][_0x4820('0x47')],'provider':_0x2f27fe[_0x4820('0x62')][_0x4820('0x63')]===_0x4820('0x64')?null:_0x2f27fe[_0x4820('0x62')][_0x4820('0x63')],'email':_0x2f27fe['body'][_0x4820('0x76')],'ListId':_0x2f27fe[_0x4820('0x62')][_0x4820('0x77')],'active':!_[_0x4820('0x78')](_0x2f27fe[_0x4820('0x62')][_0x4820('0x79')])?_0x2f27fe[_0x4820('0x62')][_0x4820('0x79')]:!![],'description':_0x2f27fe[_0x4820('0x62')][_0x4820('0x7a')]||null};var _0x22807=getAuthenticationOptions(_0x2c5dee[_0x4820('0x63')],_0x2f27fe[_0x4820('0x62')]);_0x2c5dee[_0x4820('0x41')]=_0x22807['Imap'];_0x2c5dee[_0x4820('0x42')]=_0x22807[_0x4820('0x42')];return db['MailAccount'][_0x4820('0x6b')](_0x2c5dee,{'include':[{'model':db[_0x4820('0x44')],'as':_0x4820('0x42')},{'model':db[_0x4820('0x5f')],'as':'Imap'}]})[_0x4820('0x12')](function(_0x24b523){var _0x49eb9d=_0x2f27fe[_0x4820('0x36')][_0x4820('0x27')]({'plain':!![]});if(!_0x49eb9d)throw new Error(_0x4820('0x7b'));if(_0x49eb9d[_0x4820('0x7c')]===_0x4820('0x36')){var _0x274360=_0x24b523[_0x4820('0x27')]({'plain':!![]});return db[_0x4820('0x7d')][_0x4820('0x61')]({'where':{'name':'MailAccounts','userProfileId':_0x49eb9d['userProfileId']},'raw':!![]})[_0x4820('0x12')](function(_0x47b123){if(_0x47b123&&_0x47b123[_0x4820('0x7e')]===0x0){return db[_0x4820('0x28')][_0x4820('0x6b')]({'name':_0x274360[_0x4820('0x2b')],'resourceId':_0x274360['id'],'type':_0x47b123[_0x4820('0x2b')],'sectionId':_0x47b123['id']},{})['then'](function(){return _0x24b523;});}else{return _0x24b523;}})['catch'](function(_0x1a7f60){logger[_0x4820('0x18')](_0x4820('0x7f'),_0x1a7f60);throw _0x1a7f60;});}return _0x24b523;})[_0x4820('0x12')](respondWithResult(_0xdaa2e,0xc9))[_0x4820('0x1b')](handleError(_0xdaa2e,null));};exports[_0x4820('0x80')]=function(_0x13e5b8,_0x195406){return db['MailAccount'][_0x4820('0x6d')]({'where':{'id':_0x13e5b8[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x195406,null))[_0x4820('0x12')](function(_0xe8d21f){if(_0xe8d21f){return _0xe8d21f[_0x4820('0x80')]();}return null;})['then'](respondWithResult(_0x195406,null))[_0x4820('0x1b')](handleError(_0x195406,null));};exports[_0x4820('0x81')]=function(_0x29d7e8,_0x50cf7b){if(_0x29d7e8['body']['id']){delete _0x29d7e8['body']['id'];}return db['MailAccount'][_0x4820('0x61')]({'where':{'id':_0x29d7e8['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x50cf7b,null))[_0x4820('0x12')](function(_0x50fc9a){if(_0x50fc9a){_0x29d7e8[_0x4820('0x62')]['MailAccountId']=_0x50fc9a['id'];return db[_0x4820('0x5f')][_0x4820('0x6b')](_0x29d7e8['body']);}})[_0x4820('0x12')](respondWithResult(_0x50cf7b,null))[_0x4820('0x1b')](handleError(_0x50cf7b,null));};exports['removeImap']=function(_0x3de1e1,_0x574142){return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x3de1e1[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x574142,null))[_0x4820('0x12')](function(_0x2be15f){if(_0x2be15f){return _0x2be15f[_0x4820('0x82')](null);}return null;})[_0x4820('0x12')](respondWithStatusCode(_0x574142,null))[_0x4820('0x1b')](handleError(_0x574142,null));};exports[_0x4820('0x83')]=function(_0x22155c,_0x1faf8d){return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x22155c['params']['id']}})['then'](handleEntityNotFound(_0x1faf8d,null))[_0x4820('0x12')](function(_0x201c9a){if(_0x201c9a){return _0x201c9a[_0x4820('0x83')]();}return null;})['then'](respondWithResult(_0x1faf8d,null))[_0x4820('0x1b')](handleError(_0x1faf8d,null));};exports['addSmtp']=function(_0x3f38cd,_0x195bbf){if(_0x3f38cd[_0x4820('0x62')]['id']){delete _0x3f38cd[_0x4820('0x62')]['id'];}return db[_0x4820('0x5a')][_0x4820('0x61')]({'where':{'id':_0x3f38cd['params']['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x195bbf,null))[_0x4820('0x12')](function(_0x4cc20c){if(_0x4cc20c){_0x3f38cd['body'][_0x4820('0x69')]=_0x4cc20c['id'];return db[_0x4820('0x44')][_0x4820('0x6b')](_0x3f38cd[_0x4820('0x62')]);}})[_0x4820('0x12')](respondWithResult(_0x195bbf,null))['catch'](handleError(_0x195bbf,null));};exports[_0x4820('0x84')]=function(_0x31a0c7,_0x2b50ed){return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x31a0c7[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x2b50ed,null))[_0x4820('0x12')](function(_0x471060){if(_0x471060){return _0x471060[_0x4820('0x85')](null);}return null;})[_0x4820('0x12')](respondWithStatusCode(_0x2b50ed,null))[_0x4820('0x1b')](handleError(_0x2b50ed,null));};exports[_0x4820('0x86')]=function(_0xcf4b39,_0xa96941){return db[_0x4820('0x87')][_0x4820('0x61')]({'where':{'id':_0xcf4b39[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0xa96941,null))[_0x4820('0x12')](function(_0x2255f2){if(_0x2255f2){return _0x2255f2[_0x4820('0x86')](_0xcf4b39[_0x4820('0x62')][_0x4820('0x71')],_[_0x4820('0x88')](_0xcf4b39[_0x4820('0x62')],[_0x4820('0x71'),'id'])||{});}})['then'](respondWithResult(_0xa96941,null))[_0x4820('0x1b')](handleError(_0xa96941,null));};exports['getInteractions']=function(_0x3aeaf0,_0x3bc87d){var _0x94d8f4={'raw':![],'where':{}};var _0x1389e3={};var _0xf06c0={'count':0x0,'rows':[]};return db['MailAccount'][_0x4820('0x6d')]({'where':{'id':_0x3aeaf0[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x3bc87d,null))[_0x4820('0x12')](function(_0x573237){if(_0x573237){_0x1389e3['model']=_[_0x4820('0x4a')](db[_0x4820('0x87')][_0x4820('0x6e')]);_0x1389e3[_0x4820('0x49')]=_[_0x4820('0x4a')](_0x3aeaf0[_0x4820('0x49')]);_0x1389e3[_0x4820('0x4b')]=_[_0x4820('0x4c')](_0x1389e3['model'],_0x1389e3['query']);_0x94d8f4[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x1389e3[_0x4820('0x48')],qs['fields'](_0x3aeaf0[_0x4820('0x49')][_0x4820('0x4e')]));_0x94d8f4[_0x4820('0x4d')]=_0x94d8f4['attributes'][_0x4820('0x4f')]?_0x94d8f4[_0x4820('0x4d')]:_0x1389e3[_0x4820('0x48')];if(!_0x3aeaf0[_0x4820('0x49')][_0x4820('0x6f')](_0x4820('0x50'))){_0x94d8f4[_0x4820('0x21')]=qs[_0x4820('0x21')](_0x3aeaf0[_0x4820('0x49')][_0x4820('0x21')]);_0x94d8f4['offset']=qs['offset'](_0x3aeaf0['query'][_0x4820('0x1f')]);}_0x94d8f4['order']=qs[_0x4820('0x52')](_0x3aeaf0[_0x4820('0x49')][_0x4820('0x52')]);_0x94d8f4['where']=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x3aeaf0[_0x4820('0x49')],_0x1389e3[_0x4820('0x4b')]));_0x94d8f4[_0x4820('0x53')][_0x4820('0x69')]=_0x573237['id'];if(_0x3aeaf0[_0x4820('0x49')][_0x4820('0x55')]){_0x94d8f4['where']=_[_0x4820('0x56')](_0x94d8f4[_0x4820('0x53')],{'$or':_[_0x4820('0x45')](_0x94d8f4[_0x4820('0x4d')],function(_0x26b7e6){var _0x5362f8={};_0x5362f8[_0x26b7e6]={'$like':'%'+_0x3aeaf0['query']['filter']+'%'};return _0x5362f8;})});}_0x94d8f4=_[_0x4820('0x56')]({},_0x94d8f4,_0x3aeaf0[_0x4820('0x57')]);return db['MailInteraction'][_0x4820('0x22')]({'where':_0x94d8f4[_0x4820('0x53')]})[_0x4820('0x12')](function(_0x3bdb02){_0xf06c0[_0x4820('0x22')]=_0x3bdb02;if(_0x3aeaf0[_0x4820('0x49')][_0x4820('0x58')]){_0x94d8f4['include']=[{'model':db[_0x4820('0x89')],'as':_0x4820('0x8a'),'required':![]},{'model':db[_0x4820('0x8b')],'as':_0x4820('0x8c'),'attributes':['name',_0x4820('0x8d'),_0x4820('0x8e')],'required':![]},{'model':db[_0x4820('0x8f')],'as':_0x4820('0x90'),'attributes':['id',_0x4820('0x2b'),_0x4820('0x91')],'where':_0x3aeaf0[_0x4820('0x49')][_0x4820('0x92')]?{'id':_0x3aeaf0[_0x4820('0x49')][_0x4820('0x92')]}:undefined,'required':_0x3aeaf0[_0x4820('0x49')]['tag']?!![]:![]}];}return db[_0x4820('0x87')][_0x4820('0x5b')](_0x94d8f4);})[_0x4820('0x12')](function(_0x4a91f3){_0xf06c0['rows']=_0x4a91f3;return _0xf06c0;});}})[_0x4820('0x12')](respondWithFilteredResult(_0x3bc87d,_0x94d8f4))[_0x4820('0x1b')](handleError(_0x3bc87d,null));};exports[_0x4820('0x93')]=function addApplications(_0x4dbe03,_0x2e4c02){var _0x2be1dc=_0x4dbe03[_0x4820('0x5e')]['id'];var _0x567ca6=_0x4dbe03[_0x4820('0x62')];var _0x221905=0xc8;var _0x5f2b77=null;return db[_0x4820('0x94')][_0x4820('0x95')]({'isolationLevel':db[_0x4820('0x94')][_0x4820('0x96')][_0x4820('0x97')][_0x4820('0x98')]},function(_0x7d11b3){return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x2be1dc},'transaction':_0x7d11b3})[_0x4820('0x12')](function(_0x3fb23c){if(_0x3fb23c){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x2be1dc},'transaction':_0x7d11b3})['then'](function(){var _0x2f3f35=_[_0x4820('0x45')](_0x567ca6,function(_0x4aedda){_0x4aedda[_0x4820('0x69')]=_0x2be1dc;return _0x4aedda;});return db[_0x4820('0x99')][_0x4820('0x9a')](_0x2f3f35,{'transaction':_0x7d11b3});});}else{_0x221905=0x194;_0x5f2b77=[];}});})['then'](function(){if(_0x221905!==0x194){return db[_0x4820('0x99')][_0x4820('0x9b')]({'where':{'MailAccountId':_0x2be1dc},'order':_0x4820('0x9c')})[_0x4820('0x12')](function(_0x561925){_0x5f2b77=_0x561925;});}})[_0x4820('0x1b')](function(_0x13973a){_0x221905=0x1f4;logger['error'](_0x13973a['stack']);if(_0x13973a['name']){delete _0x13973a[_0x4820('0x2b')];}_0x5f2b77=_0x13973a;})[_0x4820('0x9d')](function(){if(_0x5f2b77===null){_0x2e4c02[_0x4820('0x1c')](_0x221905);}else{if(_0x221905===0x1f4){_0x2e4c02['status'](_0x221905)[_0x4820('0x2c')](_0x5f2b77);}else{_0x2e4c02[_0x4820('0x1d')](_0x221905)[_0x4820('0x1e')](_0x5f2b77);}}});};exports[_0x4820('0x9e')]=function(_0x2a29ca,_0x5bad7f){var _0x1a3b2b={};var _0x59a8f3={};var _0x9c9012;var _0x396e33;return db[_0x4820('0x5a')][_0x4820('0x6d')]({'where':{'id':_0x2a29ca[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x5bad7f,null))['then'](function(_0x147152){if(_0x147152){_0x9c9012=_0x147152;_0x59a8f3[_0x4820('0x48')]=_[_0x4820('0x4a')](db['MailApplication']['rawAttributes']);_0x59a8f3[_0x4820('0x49')]=_[_0x4820('0x4a')](_0x2a29ca[_0x4820('0x49')]);_0x59a8f3[_0x4820('0x4b')]=_['intersection'](_0x59a8f3[_0x4820('0x48')],_0x59a8f3['query']);_0x1a3b2b[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x59a8f3[_0x4820('0x48')],qs['fields'](_0x2a29ca['query'][_0x4820('0x4e')]));_0x1a3b2b[_0x4820('0x4d')]=_0x1a3b2b['attributes']['length']?_0x1a3b2b[_0x4820('0x4d')]:_0x59a8f3[_0x4820('0x48')];_0x1a3b2b[_0x4820('0x51')]=qs['sort'](_0x2a29ca[_0x4820('0x49')]['sort']);_0x1a3b2b[_0x4820('0x53')]=qs['filters'](_[_0x4820('0x54')](_0x2a29ca[_0x4820('0x49')],_0x59a8f3['filters']));if(_0x2a29ca[_0x4820('0x49')][_0x4820('0x55')]){_0x1a3b2b[_0x4820('0x53')]=_[_0x4820('0x56')](_0x1a3b2b[_0x4820('0x53')],{'$or':_[_0x4820('0x45')](_0x1a3b2b[_0x4820('0x4d')],function(_0x28d8ce){var _0x59c2e3={};_0x59c2e3[_0x28d8ce]={'$like':'%'+_0x2a29ca[_0x4820('0x49')]['filter']+'%'};return _0x59c2e3;})});}_0x1a3b2b=_['merge']({},_0x1a3b2b,_0x2a29ca[_0x4820('0x57')]);return _0x9c9012[_0x4820('0x9e')](_0x1a3b2b);}})['then'](function(_0x3c3b51){if(_0x3c3b51){_0x396e33=_0x3c3b51[_0x4820('0x4f')];if(!_0x2a29ca[_0x4820('0x49')][_0x4820('0x6f')](_0x4820('0x50'))){_0x1a3b2b['limit']=qs['limit'](_0x2a29ca[_0x4820('0x49')]['limit']);_0x1a3b2b[_0x4820('0x1f')]=qs['offset'](_0x2a29ca[_0x4820('0x49')]['offset']);}return _0x9c9012[_0x4820('0x9e')](_0x1a3b2b);}})[_0x4820('0x12')](function(_0x323e5b){if(_0x323e5b){return _0x323e5b?{'count':_0x396e33,'rows':_0x323e5b}:null;}})[_0x4820('0x12')](respondWithResult(_0x5bad7f,null))[_0x4820('0x1b')](handleError(_0x5bad7f,null));};exports['getMessages']=function(_0x5548e1,_0x358345){var _0xdb1fe8={'raw':!![],'where':{}};var _0x1020b3={};var _0x4e1875={'count':0x0,'rows':[]};return db[_0x4820('0x5a')]['findOne']({'where':{'id':_0x5548e1[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x358345,null))['then'](function(_0x36db6b){if(_0x36db6b){_0x1020b3['model']=_[_0x4820('0x4a')](db[_0x4820('0x9f')][_0x4820('0x6e')]);_0x1020b3['query']=_[_0x4820('0x4a')](_0x5548e1[_0x4820('0x49')]);_0x1020b3[_0x4820('0x4b')]=_['intersection'](_0x1020b3['model'],_0x1020b3[_0x4820('0x49')]);_0xdb1fe8[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0x1020b3[_0x4820('0x48')],qs[_0x4820('0x4e')](_0x5548e1[_0x4820('0x49')]['fields']));_0xdb1fe8[_0x4820('0x4d')]=_0xdb1fe8[_0x4820('0x4d')]['length']?_0xdb1fe8[_0x4820('0x4d')]:_0x1020b3[_0x4820('0x48')];if(!_0x5548e1[_0x4820('0x49')][_0x4820('0x6f')](_0x4820('0x50'))){_0xdb1fe8[_0x4820('0x21')]=qs[_0x4820('0x21')](_0x5548e1[_0x4820('0x49')][_0x4820('0x21')]);_0xdb1fe8[_0x4820('0x1f')]=qs[_0x4820('0x1f')](_0x5548e1[_0x4820('0x49')][_0x4820('0x1f')]);}_0xdb1fe8[_0x4820('0x51')]=qs[_0x4820('0x52')](_0x5548e1[_0x4820('0x49')][_0x4820('0x52')]);_0xdb1fe8[_0x4820('0x53')]=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x5548e1[_0x4820('0x49')],_0x1020b3[_0x4820('0x4b')]));_0xdb1fe8[_0x4820('0x53')][_0x4820('0x69')]=_0x36db6b['id'];if(_0x5548e1['query'][_0x4820('0x55')]){_0xdb1fe8[_0x4820('0x53')]=_[_0x4820('0x56')](_0xdb1fe8[_0x4820('0x53')],{'$or':_[_0x4820('0x45')](_0xdb1fe8[_0x4820('0x4d')],function(_0x8567c0){var _0x4dc770={};_0x4dc770[_0x8567c0]={'$like':'%'+_0x5548e1[_0x4820('0x49')]['filter']+'%'};return _0x4dc770;})});}if(_0x5548e1[_0x4820('0x49')][_0x4820('0xa0')]){var _0x32174c=_0x5548e1[_0x4820('0x49')]['$gte'][_0x4820('0xa1')](',');var _0x53a560={};_0x53a560[_0x32174c[0x0]]={'$gte':moment(_0x32174c[0x1])[_0x4820('0xa2')](_0x4820('0xa3'))};_0xdb1fe8[_0x4820('0x53')]=_[_0x4820('0x56')](_0xdb1fe8[_0x4820('0x53')],_0x53a560);}_0xdb1fe8=_[_0x4820('0x56')]({},_0xdb1fe8,_0x5548e1[_0x4820('0x57')]);return db[_0x4820('0x9f')]['count']({'where':_0xdb1fe8[_0x4820('0x53')]})[_0x4820('0x12')](function(_0x398a0b){_0x4e1875[_0x4820('0x22')]=_0x398a0b;if(_0x5548e1[_0x4820('0x49')]['includeAll']){_0xdb1fe8[_0x4820('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x4820('0x5b')](_0xdb1fe8);})['then'](function(_0xfea8d){if(_0x5548e1['query'][_0x4820('0xa4')]==='true'){for(var _0x1daf84=0x0;_0x1daf84<_0xfea8d['length'];_0x1daf84++){_0xfea8d[_0x1daf84][_0x4820('0x62')]=juice(_0xfea8d[_0x1daf84][_0x4820('0x62')]);}}_0x4e1875[_0x4820('0x5c')]=_0xfea8d;return _0x4e1875;});}})[_0x4820('0x12')](respondWithFilteredResult(_0x358345,_0xdb1fe8))[_0x4820('0x1b')](handleError(_0x358345,null));};exports['send']=function(_0x1ec603,_0x235caa){var _0xb12046,_0x2be19c={},_0x5645a7;if(_0x1ec603[_0x4820('0x62')]['to']){_0x5645a7=_0x1ec603[_0x4820('0x62')]['to'][_0x4820('0xa1')](',')[0x0];}return db[_0x4820('0x5a')][_0x4820('0x61')]({'where':{'id':_0x1ec603['params']['id']},'include':[{'model':db[_0x4820('0xa5')],'as':'List','include':[{'model':db[_0x4820('0x89')],'as':'Contacts','where':{'email':_0x5645a7},'limit':0x1,'order':[['updatedAt',_0x4820('0xa6')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4820('0xa7')],'as':_0x4820('0xa7'),'raw':!![]}]}]})[_0x4820('0x12')](handleEntityNotFound(_0x235caa,null))['then'](function(_0x18ed78){if(!_0x18ed78)return;_0xb12046=_0x18ed78;if(!_0x18ed78[_0x4820('0x42')])throw new Error(_0x4820('0xa8'));if(_[_0x4820('0x78')](_0x1ec603[_0x4820('0x62')][_0x4820('0xa9')])){_0x1ec603['body'][_0x4820('0xa9')]=util[_0x4820('0xa2')](_0x4820('0xaa'),_0x18ed78[_0x4820('0x2b')],_0x18ed78[_0x4820('0x76')]||_0x18ed78[_0x4820('0x42')]['user']);}if(_0x1ec603[_0x4820('0x62')][_0x4820('0xab')]&&_0x1ec603[_0x4820('0x62')][_0x4820('0xab')]['length']){for(var _0xb737fc=0x0;_0xb737fc<_0x1ec603[_0x4820('0x62')][_0x4820('0xab')][_0x4820('0x4f')];_0xb737fc+=0x1){_0x1ec603['body'][_0x4820('0xab')][_0xb737fc]={'filename':_0x1ec603[_0x4820('0x62')][_0x4820('0xab')][_0xb737fc][_0x4820('0x2b')],'path':path[_0x4820('0xac')](config[_0x4820('0xad')],_0x4820('0xae'),_0x1ec603['body'][_0x4820('0xab')][_0xb737fc][_0x4820('0xaf')])};}}var _0x3e6fd5=_0x18ed78['getSmtpOptions']();return respondWithRpcPromise(_0x4820('0xb0'),_0x4820('0xb1'),{'account':_0x3e6fd5,'message':_0x1ec603['body']});})[_0x4820('0x12')](function(_0xc7c572){if(!_0xc7c572)return;_0x2be19c=_0xc7c572;if(!_0xb12046[_0x4820('0xb2')])throw new Error(_0x4820('0xb3'));if(_0xb12046[_0x4820('0xb2')][_0x4820('0xb4')][_0x4820('0x4f')])return _0xb12046[_0x4820('0xb2')][_0x4820('0xb4')][0x0];return db[_0x4820('0x89')][_0x4820('0x6b')](_[_0x4820('0xb5')](_0x1ec603[_0x4820('0x62')],{'firstName':_0x1ec603[_0x4820('0x62')]['to'],'email':_0x1ec603['body']['to'],'phone':_0x1ec603[_0x4820('0x62')]['to'],'ListId':_0xb12046['ListId']}));})[_0x4820('0x12')](function(_0x4aa84e){if(!_0x4aa84e)return;var _0x259f32={'UserId':_0x1ec603[_0x4820('0x36')]['id'],'ContactId':_0x4aa84e['id'],'MailAccountId':_0xb12046['id'],'inReplyTo':_0x2be19c[_0x4820('0xb6')],'to':_0x1ec603[_0x4820('0x62')][_0x4820('0xa9')],'cc':_0x1ec603[_0x4820('0x62')]['cc'],'subject':_0x1ec603[_0x4820('0x62')][_0x4820('0xb7')],'attach':_0x1ec603[_0x4820('0x62')][_0x4820('0xb8')],'firstMsgDirection':_0x4820('0xb9'),'lastMsgAt':moment()[_0x4820('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x4820('0xb9'),'Messages':[_[_0x4820('0x56')](_0x1ec603[_0x4820('0x62')],{'messageId':_0x2be19c[_0x4820('0xb6')],'sentAt':moment()['format'](_0x4820('0xa3')),'read':!![],'MailAccountId':_0xb12046['id'],'UserId':_0x1ec603[_0x4820('0x36')]['id'],'ContactId':_0x4aa84e['id']})]};if(_0x1ec603[_0x4820('0x62')][_0x4820('0xba')]){_0x259f32=_[_0x4820('0x56')](_0x259f32,_0x1ec603[_0x4820('0x62')][_0x4820('0xba')]);}return db[_0x4820('0x87')][_0x4820('0x6b')](_0x259f32,{'include':[{'model':db['MailMessage'],'as':_0x4820('0xbb')}]});})['then'](respondWithResult(_0x235caa,null))[_0x4820('0x1b')](handleError(_0x235caa,null));};exports[_0x4820('0xbc')]=function(_0x4f93b5,_0x201257){return db['MailAccount'][_0x4820('0x61')]({'where':{'id':_0x4f93b5['params']['id']},'include':[{'model':db[_0x4820('0x44')],'as':_0x4820('0x42'),'raw':!![],'include':[{'model':db[_0x4820('0xa7')],'as':_0x4820('0xa7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x201257,null))['then'](function(_0x32a332){if(!_0x32a332[_0x4820('0x42')])return;var _0xdb0bd7=_0x32a332[_0x4820('0xbd')]();return respondWithRpcPromise(_0x4820('0xbe'),'verifySmtp',{'account':_0xdb0bd7});})[_0x4820('0x12')](respondWithResult(_0x201257,null))[_0x4820('0x1b')](handleError(_0x201257,null));};exports[_0x4820('0x26')]=function(_0x17d95f,_0x3797cf){return db['MailAccount'][_0x4820('0x61')]({'where':{'id':_0x17d95f[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x3797cf,null))[_0x4820('0x12')](function(_0x5984fa){if(_0x5984fa&&_0x5984fa[_0x4820('0x3f')]){throw new db[(_0x4820('0xbf'))][(_0x4820('0xc0'))](_0x4820('0xc1'));}return _0x5984fa;})[_0x4820('0x12')](removeEntity(_0x3797cf,null))[_0x4820('0x1b')](handleError(_0x3797cf,null));};exports['addAgents']=function(_0x5480ce,_0x52a094){return db[_0x4820('0x5a')][_0x4820('0x61')]({'where':{'id':_0x5480ce[_0x4820('0x5e')]['id']}})['then'](handleEntityNotFound(_0x52a094,null))[_0x4820('0x12')](function(_0x4af1e4){if(_0x4af1e4){return _0x4af1e4[_0x4820('0xc2')](_0x5480ce[_0x4820('0x62')][_0x4820('0x71')],_['omit'](_0x5480ce[_0x4820('0x62')],[_0x4820('0x71'),'id'])||{})[_0x4820('0xc3')](function(_0x185f92){for(var _0x32be80=0x0;_0x32be80<_0x5480ce[_0x4820('0x62')][_0x4820('0x71')][_0x4820('0x4f')];_0x32be80+=0x1){socket[_0x4820('0xc4')](_0x4820('0xc5'),{'UserId':Number(_0x5480ce[_0x4820('0x62')][_0x4820('0x71')][_0x32be80]),'MailAccountId':Number(_0x5480ce['params']['id'])});}return _0x185f92;});}})[_0x4820('0x12')](respondWithResult(_0x52a094,null))[_0x4820('0x1b')](handleError(_0x52a094,null));};exports[_0x4820('0xc6')]=function(_0x5153fd,_0x1721c5){return db[_0x4820('0x5a')][_0x4820('0x61')]({'where':{'id':_0x5153fd[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x1721c5,null))[_0x4820('0x12')](function(_0x431f44){if(_0x431f44){return _0x431f44[_0x4820('0xc6')](_0x5153fd[_0x4820('0x49')][_0x4820('0x71')])['then'](function(){if(_[_0x4820('0xc7')](_0x5153fd[_0x4820('0x49')][_0x4820('0x71')])){for(var _0xe3c345=0x0;_0xe3c345<_0x5153fd[_0x4820('0x49')][_0x4820('0x71')][_0x4820('0x4f')];_0xe3c345+=0x1){socket[_0x4820('0xc4')](_0x4820('0xc8'),{'UserId':Number(_0x5153fd[_0x4820('0x49')][_0x4820('0x71')][_0xe3c345]),'MailAccountId':Number(_0x5153fd['params']['id'])});}}else{socket[_0x4820('0xc4')](_0x4820('0xc8'),{'UserId':Number(_0x5153fd[_0x4820('0x49')][_0x4820('0x71')]),'MailAccountId':Number(_0x5153fd[_0x4820('0x5e')]['id'])});}});}})[_0x4820('0x12')](respondWithStatusCode(_0x1721c5,null))[_0x4820('0x1b')](handleError(_0x1721c5,null));};exports[_0x4820('0xc9')]=function(_0x9e69c6,_0x45bd96){var _0x21578d={};var _0xca61b6={};var _0x2d8800;var _0x3a9c14;return db[_0x4820('0x5a')]['findOne']({'where':{'id':_0x9e69c6[_0x4820('0x5e')]['id']}})[_0x4820('0x12')](handleEntityNotFound(_0x45bd96,null))['then'](function(_0x54f522){if(_0x54f522){_0x2d8800=_0x54f522;_0xca61b6[_0x4820('0x48')]=_[_0x4820('0x4a')](db['User'][_0x4820('0x6e')]);_0xca61b6[_0x4820('0x49')]=_['keys'](_0x9e69c6[_0x4820('0x49')]);_0xca61b6[_0x4820('0x4b')]=_['intersection'](_0xca61b6[_0x4820('0x48')],_0xca61b6['query']);_0x21578d[_0x4820('0x4d')]=_[_0x4820('0x4c')](_0xca61b6[_0x4820('0x48')],qs[_0x4820('0x4e')](_0x9e69c6[_0x4820('0x49')][_0x4820('0x4e')]));_0x21578d[_0x4820('0x4d')]=_0x21578d[_0x4820('0x4d')][_0x4820('0x4f')]?_0x21578d[_0x4820('0x4d')]:_0xca61b6[_0x4820('0x48')];_0x21578d[_0x4820('0x51')]=qs[_0x4820('0x52')](_0x9e69c6[_0x4820('0x49')][_0x4820('0x52')]);_0x21578d[_0x4820('0x53')]=qs[_0x4820('0x4b')](_[_0x4820('0x54')](_0x9e69c6[_0x4820('0x49')],_0xca61b6[_0x4820('0x4b')]));if(_0x9e69c6['query'][_0x4820('0x55')]){_0x21578d[_0x4820('0x53')]=_[_0x4820('0x56')](_0x21578d[_0x4820('0x53')],{'$or':_[_0x4820('0x45')](_0x21578d[_0x4820('0x4d')],function(_0x35efe5){var _0x3a1d8f={};_0x3a1d8f[_0x35efe5]={'$like':'%'+_0x9e69c6[_0x4820('0x49')][_0x4820('0x55')]+'%'};return _0x3a1d8f;})});}_0x21578d=_[_0x4820('0x56')]({},_0x21578d,_0x9e69c6['options']);return _0x2d8800[_0x4820('0xc9')](_0x21578d);}})[_0x4820('0x12')](function(_0x4be8a2){if(_0x4be8a2){_0x3a9c14=_0x4be8a2[_0x4820('0x4f')];if(!_0x9e69c6['query'][_0x4820('0x6f')]('nolimit')){_0x21578d['limit']=qs[_0x4820('0x21')](_0x9e69c6['query']['limit']);_0x21578d['offset']=qs[_0x4820('0x1f')](_0x9e69c6['query']['offset']);}return _0x2d8800[_0x4820('0xc9')](_0x21578d);}})['then'](function(_0x315add){if(_0x315add){return _0x315add?{'count':_0x3a9c14,'rows':_0x315add}:null;}})[_0x4820('0x12')](respondWithResult(_0x45bd96,null))[_0x4820('0x1b')](handleError(_0x45bd96,null));}; \ No newline at end of file +var _0xf215=['params','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','finally','getApplications','MailApplication','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','format','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','get','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','body','provider','custom'];(function(_0x40810b,_0x360300){var _0x30a40b=function(_0x56d7fc){while(--_0x56d7fc){_0x40810b['push'](_0x40810b['shift']());}};_0x30a40b(++_0x360300);}(_0xf215,0x11f));var _0x5f21=function(_0x28c870,_0x1bf349){_0x28c870=_0x28c870-0x0;var _0x5e4de6=_0xf215[_0x28c870];return _0x5e4de6;};'use strict';var moment=require('moment');var BPromise=require(_0x5f21('0x0'));var util=require(_0x5f21('0x1'));var path=require(_0x5f21('0x2'));var _=require(_0x5f21('0x3'));var juice=require('juice');var Redis=require(_0x5f21('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f21('0x5'))('api');var config=require(_0x5f21('0x6'));var db=require(_0x5f21('0x7'))['db'];config[_0x5f21('0x8')]=_[_0x5f21('0x9')](config[_0x5f21('0x8')],{'host':_0x5f21('0xa'),'port':0x18eb});var socket=require(_0x5f21('0xb'))(new Redis(config[_0x5f21('0x8')]));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f21('0xc')][_0x5f21('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x24a3ed,_0x3ab009,_0x21edae,_0x33adf2){return new BPromise(function(_0x3c90c6,_0xaa72f){var _0x2d6532=_0x33adf2||client;return _0x2d6532[_0x5f21('0xe')](_0x24a3ed,_0x21edae)[_0x5f21('0xf')](function(_0xaea8c6){logger[_0x5f21('0x10')](_0x5f21('0x11'),_0x3ab009,_0x5f21('0x12'));logger[_0x5f21('0x13')](_0x5f21('0x14'),_0x3ab009,_0x5f21('0x12'),JSON[_0x5f21('0x15')](_0xaea8c6));if(_0xaea8c6['error']){if(_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x17')]===0x1f4){logger[_0x5f21('0x16')]('MailAccount,\x20%s,\x20%s',_0x3ab009,_0xaea8c6[_0x5f21('0x16')]['message']);return _0xaa72f(_0xaea8c6['error'][_0x5f21('0x18')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3ab009,_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x18')]);return _0x3c90c6(_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x3ab009,'request\x20sent');_0x3c90c6(_0xaea8c6[_0x5f21('0x19')]['message']);}})[_0x5f21('0x1a')](function(_0x482b79){logger[_0x5f21('0x16')](_0x5f21('0x11'),_0x3ab009,_0x482b79);_0xaa72f(_0x482b79);});});}function respondWithStatusCode(_0x8f9a5f,_0x3fe0b8){_0x3fe0b8=_0x3fe0b8||0xcc;return function(_0xbc2e57){if(_0xbc2e57){return _0x8f9a5f[_0x5f21('0x1b')](_0x3fe0b8);}return _0x8f9a5f['status'](_0x3fe0b8)[_0x5f21('0x1c')]();};}function respondWithResult(_0x563e43,_0x29b8de){_0x29b8de=_0x29b8de||0xc8;return function(_0x583792){if(_0x583792){return _0x563e43[_0x5f21('0x1d')](_0x29b8de)[_0x5f21('0x1e')](_0x583792);}};}function respondWithFilteredResult(_0x86917d,_0x269b1c){return function(_0x39fe65){if(_0x39fe65){var _0x3897a8=typeof _0x269b1c[_0x5f21('0x1f')]==='undefined'&&typeof _0x269b1c[_0x5f21('0x20')]===_0x5f21('0x21');var _0x17baf9=_0x39fe65[_0x5f21('0x22')];var _0x18f15c=_0x3897a8?0x0:_0x269b1c[_0x5f21('0x1f')];var _0x57f2e2=_0x3897a8?_0x39fe65[_0x5f21('0x22')]:_0x269b1c[_0x5f21('0x1f')]+_0x269b1c[_0x5f21('0x20')];var _0x409d55;if(_0x57f2e2>=_0x17baf9){_0x57f2e2=_0x17baf9;_0x409d55=0xc8;}else{_0x409d55=0xce;}_0x86917d[_0x5f21('0x1d')](_0x409d55);return _0x86917d[_0x5f21('0x23')](_0x5f21('0x24'),_0x18f15c+'-'+_0x57f2e2+'/'+_0x17baf9)[_0x5f21('0x1e')](_0x39fe65);}return null;};}function saveUpdates(_0x5f0e04){return function(_0x2d3183){if(_0x2d3183){return _0x2d3183[_0x5f21('0x25')](_0x5f0e04)['then'](function(_0x341cb9){return _0x341cb9;});}return null;};}function removeEntity(_0xe7eb58){return function(_0x466194){if(_0x466194){return _0x466194['destroy']()[_0x5f21('0xf')](function(){var _0x51b555=_0x466194[_0x5f21('0x26')]({'plain':!![]});var _0x29117c='MailAccounts';return db[_0x5f21('0x27')][_0x5f21('0x28')]({'where':{'type':_0x29117c,'resourceId':_0x51b555['id']}})[_0x5f21('0xf')](function(){return _0x466194;});})['then'](function(){_0xe7eb58[_0x5f21('0x1d')](0xcc)[_0x5f21('0x1c')]();});}};}function handleEntityNotFound(_0x1c9095){return function(_0xf3046b){if(!_0xf3046b){_0x1c9095[_0x5f21('0x1b')](0x194);}return _0xf3046b;};}function handleError(_0x325cd0,_0x3f607c){_0x3f607c=_0x3f607c||0x1f4;return function(_0x475d7c){logger[_0x5f21('0x16')](_0x475d7c[_0x5f21('0x29')]);if(_0x475d7c[_0x5f21('0x2a')]){delete _0x475d7c[_0x5f21('0x2a')];}_0x325cd0['status'](_0x3f607c)[_0x5f21('0x2b')](_0x475d7c);};}function getImapHost(_0x279937){switch(_0x279937){case _0x5f21('0x2c'):return _0x5f21('0x2d');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0x5f21('0x2e');case _0x5f21('0x2f'):return _0x5f21('0x30');}throw new Error(_0x5f21('0x31'),_0x279937);}function getSmtpHost(_0x9cd45d){switch(_0x9cd45d){case _0x5f21('0x2c'):return _0x5f21('0x32');case _0x5f21('0x33'):return'smtp.mail.yahoo.com';case'hotmail':return _0x5f21('0x34');case _0x5f21('0x2f'):return _0x5f21('0x35');}throw new Error(_0x5f21('0x31'),_0x9cd45d);}function getAuthenticationOptions(_0x70530b,_0x4e5d14){var _0x346113={};var _0x4f6e08={};if(_0x70530b){_0x346113['user']=_0x4f6e08[_0x5f21('0x36')]=_0x4e5d14[_0x5f21('0x37')];_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=_0x4e5d14['password'];if(_0x4e5d14[_0x5f21('0x3a')]){_0x346113[_0x5f21('0x3a')]=_0x4f6e08[_0x5f21('0x3a')]=!![];_0x346113[_0x5f21('0x3b')]=_0x4f6e08[_0x5f21('0x3b')]=_0x4e5d14[_0x5f21('0x3b')];_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=null;}else{_0x346113['CloudProviderId']=_0x4f6e08[_0x5f21('0x3b')]=null;}_0x346113[_0x5f21('0x3c')]=getImapHost(_0x70530b);_0x346113[_0x5f21('0x3d')]=0x3e1;_0x4f6e08[_0x5f21('0x3c')]=getSmtpHost(_0x70530b);_0x4f6e08['port']=0x24b;_0x4f6e08[_0x5f21('0x3e')]=![];_0x346113[_0x5f21('0x3f')]=_0x4f6e08[_0x5f21('0x3f')]=null;}else{if(_0x4e5d14['authentication']){_0x346113['user']=_0x4f6e08[_0x5f21('0x36')]=_0x4e5d14[_0x5f21('0x37')];_0x346113['password']=_0x4f6e08[_0x5f21('0x39')]=_0x4e5d14[_0x5f21('0x38')];}else{_0x346113[_0x5f21('0x40')]=_0x4f6e08[_0x5f21('0x40')]=![];_0x346113['user']=_0x4f6e08['user']=null;_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=null;}_0x346113[_0x5f21('0x3c')]=_0x4e5d14['Imap'][_0x5f21('0x3c')];_0x346113[_0x5f21('0x3d')]=_0x4e5d14['Imap'][_0x5f21('0x3d')];_0x4f6e08[_0x5f21('0x3c')]=_0x4e5d14['Smtp'][_0x5f21('0x3c')];_0x4f6e08[_0x5f21('0x3d')]=_0x4e5d14[_0x5f21('0x41')][_0x5f21('0x3d')];}return{'Imap':_0x346113,'Smtp':_0x4f6e08};}exports[_0x5f21('0x42')]=function(_0xc79339,_0x261d32){var _0x5c7032={'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db[_0x5f21('0x45')],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':'mandatoryDispositionPause'}]},_0x578163={},_0x31ef36={'count':0x0,'rows':[]};var _0xaf3c13=_[_0x5f21('0x47')](db['MailAccount'][_0x5f21('0x48')],function(_0x1dfbd6){return{'name':_0x1dfbd6[_0x5f21('0x49')],'type':_0x1dfbd6[_0x5f21('0x4a')][_0x5f21('0x4b')]};});_0x578163[_0x5f21('0x4c')]=_[_0x5f21('0x47')](_0xaf3c13,'name');_0x578163[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0xc79339[_0x5f21('0x4d')]);_0x578163[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x578163[_0x5f21('0x4c')],_0x578163[_0x5f21('0x4d')]);_0x5c7032[_0x5f21('0x51')]=_['intersection'](_0x578163[_0x5f21('0x4c')],qs['fields'](_0xc79339['query'][_0x5f21('0x52')]));_0x5c7032[_0x5f21('0x51')]=_0x5c7032[_0x5f21('0x51')][_0x5f21('0x53')]?_0x5c7032[_0x5f21('0x51')]:_0x578163[_0x5f21('0x4c')];if(!_0xc79339['query'][_0x5f21('0x54')](_0x5f21('0x55'))){_0x5c7032[_0x5f21('0x20')]=qs['limit'](_0xc79339[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x5c7032[_0x5f21('0x1f')]=qs['offset'](_0xc79339[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x5c7032[_0x5f21('0x56')]=qs[_0x5f21('0x57')](_0xc79339[_0x5f21('0x4d')]['sort']);_0x5c7032['where']=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0xc79339[_0x5f21('0x4d')],_0x578163[_0x5f21('0x4f')]),_0xaf3c13);if(_0xc79339[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x5c7032[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x5c7032[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0xaf3c13,function(_0x45ca34){if(_0x45ca34[_0x5f21('0x4a')]!==_0x5f21('0x5c')){var _0x3274d2={};_0x3274d2[_0x45ca34['name']]={'$like':'%'+_0xc79339[_0x5f21('0x4d')]['filter']+'%'};return _0x3274d2;}})});}_0x5c7032=_[_0x5f21('0x5b')]({},_0x5c7032,_0xc79339[_0x5f21('0x5d')]);var _0x119d1e={'where':_0x5c7032[_0x5f21('0x5a')]};return db[_0x5f21('0x5e')][_0x5f21('0x22')](_0x119d1e)['then'](function(_0x112a8d){_0x31ef36[_0x5f21('0x22')]=_0x112a8d;if(_0xc79339[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x5c7032[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x5e')][_0x5f21('0x61')](_0x5c7032);})[_0x5f21('0xf')](function(_0xea2c30){_0x31ef36[_0x5f21('0x62')]=_0xea2c30;return _0x31ef36;})[_0x5f21('0xf')](respondWithFilteredResult(_0x261d32,_0x5c7032))[_0x5f21('0x1a')](handleError(_0x261d32,null));};exports[_0x5f21('0x63')]=function(_0x541679,_0x144695){var _0x1855a5={'raw':![],'where':{'id':_0x541679['params']['id']},'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db['MailServerOut'],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':_0x5f21('0x64')}]},_0x29cebc={};_0x29cebc[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x5e')]['rawAttributes']);_0x29cebc['query']=_[_0x5f21('0x4e')](_0x541679['query']);_0x29cebc['filters']=_[_0x5f21('0x50')](_0x29cebc[_0x5f21('0x4c')],_0x29cebc['query']);_0x1855a5[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x29cebc['model'],qs[_0x5f21('0x52')](_0x541679['query'][_0x5f21('0x52')]));_0x1855a5[_0x5f21('0x51')]=_0x1855a5[_0x5f21('0x51')][_0x5f21('0x53')]?_0x1855a5[_0x5f21('0x51')]:_0x29cebc[_0x5f21('0x4c')];if(_0x541679[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x1855a5[_0x5f21('0x60')]=[{'all':!![]}];}_0x1855a5=_[_0x5f21('0x5b')]({},_0x1855a5,_0x541679[_0x5f21('0x5d')]);return db[_0x5f21('0x5e')][_0x5f21('0x65')](_0x1855a5)[_0x5f21('0xf')](handleEntityNotFound(_0x144695,null))['then'](respondWithResult(_0x144695,null))[_0x5f21('0x1a')](handleError(_0x144695,null));};exports[_0x5f21('0x25')]=function(_0x1d4634,_0xf649ed){if(_0x1d4634[_0x5f21('0x66')]['id']){delete _0x1d4634[_0x5f21('0x66')]['id'];}var _0x4d8e26=_0x1d4634[_0x5f21('0x66')][_0x5f21('0x67')]===_0x5f21('0x68')?null:_0x1d4634[_0x5f21('0x66')][_0x5f21('0x67')];var _0x4eccdf=_0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')]||{};var _0xed0f40=_0x1d4634[_0x5f21('0x66')]['Smtp']||{};if(_0x4d8e26){_0x4eccdf[_0x5f21('0x3c')]=getImapHost(_0x4d8e26);_0x4eccdf[_0x5f21('0x3d')]=0x3e1;_0xed0f40[_0x5f21('0x3c')]=getSmtpHost(_0x4d8e26);_0xed0f40[_0x5f21('0x3d')]=0x24b;_0xed0f40[_0x5f21('0x3e')]=![];}if(_0xed0f40[_0x5f21('0x3a')]){_0xed0f40[_0x5f21('0x3e')]=![];}else{_0xed0f40[_0x5f21('0x3b')]=null;}if(!_0x4eccdf['modernAuthentication'])_0x4eccdf['CloudProviderId']=null;_0x1d4634['body'][_0x5f21('0x44')]=_0x4eccdf;_0x1d4634['body']['Smtp']=_0xed0f40;return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x1d4634[_0x5f21('0x69')]['id']},'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db[_0x5f21('0x45')],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':_0x5f21('0x64')}]})[_0x5f21('0xf')](handleEntityNotFound(_0xf649ed,null))['then'](function(_0x59c53f){if(!_0x59c53f)throw new Error(_0x5f21('0x6a'));if(_0x59c53f[_0x5f21('0x3f')])delete _0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')];return _0x59c53f;})['then'](saveUpdates(_0x1d4634[_0x5f21('0x66')],null))['then'](function(_0x580728){if(!_0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')])return _0x580728;return db['MailServerIn'][_0x5f21('0x25')](_0x1d4634['body'][_0x5f21('0x44')],{'where':{'MailAccountId':_0x580728['id']}})[_0x5f21('0xf')](function(){return _0x580728;});})[_0x5f21('0xf')](function(_0x14f088){if(!_0x1d4634['body'][_0x5f21('0x41')])return _0x14f088;return db['MailServerOut'][_0x5f21('0x25')](_0x1d4634[_0x5f21('0x66')][_0x5f21('0x41')],{'where':{'MailAccountId':_0x14f088['id']}})[_0x5f21('0xf')](function(){return _0x14f088;});})[_0x5f21('0xf')](respondWithResult(_0xf649ed,null))[_0x5f21('0x1a')](handleError(_0xf649ed,null));};exports[_0x5f21('0x6b')]=function(_0x3331c6,_0x35d7d4){return db['MailAccount']['describe']()['then'](respondWithResult(_0x35d7d4,null))[_0x5f21('0x1a')](handleError(_0x35d7d4,null));};exports['addDisposition']=function(_0x4ef038,_0x175aaf){if(_0x4ef038[_0x5f21('0x66')]['id']){delete _0x4ef038[_0x5f21('0x66')]['id'];}return db['MailAccount'][_0x5f21('0x65')]({'where':{'id':_0x4ef038['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x175aaf,null))[_0x5f21('0xf')](function(_0x3b58cb){if(_0x3b58cb){_0x4ef038[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x3b58cb['id'];return db[_0x5f21('0x6d')]['create'](_0x4ef038[_0x5f21('0x66')]);}})['then'](respondWithResult(_0x175aaf,null))[_0x5f21('0x1a')](handleError(_0x175aaf,null));};exports[_0x5f21('0x6e')]=function(_0x214600,_0x44c4a5){var _0xa6340d={'raw':![],'where':{}};var _0x38a661={};var _0x2be50f={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x214600[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x44c4a5,null))[_0x5f21('0xf')](function(_0x1e00da){if(_0x1e00da){_0x38a661[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x6d')][_0x5f21('0x48')]);_0x38a661[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0x214600[_0x5f21('0x4d')]);_0x38a661[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x38a661[_0x5f21('0x4c')],_0x38a661[_0x5f21('0x4d')]);_0xa6340d[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x38a661[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x214600[_0x5f21('0x4d')][_0x5f21('0x52')]));_0xa6340d['attributes']=_0xa6340d[_0x5f21('0x51')]['length']?_0xa6340d['attributes']:_0x38a661[_0x5f21('0x4c')];if(!_0x214600[_0x5f21('0x4d')]['hasOwnProperty'](_0x5f21('0x55'))){_0xa6340d['limit']=qs[_0x5f21('0x20')](_0x214600[_0x5f21('0x4d')]['limit']);_0xa6340d[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0x214600['query'][_0x5f21('0x1f')]);}_0xa6340d['order']=qs[_0x5f21('0x57')](_0x214600[_0x5f21('0x4d')][_0x5f21('0x57')]);_0xa6340d['where']=qs['filters'](_[_0x5f21('0x58')](_0x214600[_0x5f21('0x4d')],_0x38a661['filters']));_0xa6340d[_0x5f21('0x5a')]['MailAccountId']=_0x1e00da['id'];if(_0x214600[_0x5f21('0x4d')][_0x5f21('0x59')]){_0xa6340d[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0xa6340d[_0x5f21('0x5a')],{'$or':_['map'](_0xa6340d[_0x5f21('0x51')],function(_0x5130c3){var _0x45743d={};_0x45743d[_0x5130c3]={'$like':'%'+_0x214600['query'][_0x5f21('0x59')]+'%'};return _0x45743d;})});}_0xa6340d=_[_0x5f21('0x5b')]({},_0xa6340d,_0x214600[_0x5f21('0x5d')]);return db[_0x5f21('0x6d')][_0x5f21('0x22')]({'where':_0xa6340d[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x164aae){_0x2be50f[_0x5f21('0x22')]=_0x164aae;if(_0x214600[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0xa6340d[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x6d')]['findAll'](_0xa6340d);})[_0x5f21('0xf')](function(_0x3042dd){_0x2be50f['rows']=_0x3042dd;return _0x2be50f;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0x44c4a5,_0xa6340d))['catch'](handleError(_0x44c4a5,null));};exports[_0x5f21('0x70')]=function(_0x5de53c,_0x148f04){return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x5de53c[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x148f04,null))[_0x5f21('0xf')](function(_0x3a3e29){if(_0x3a3e29){return _0x3a3e29[_0x5f21('0x70')](_0x5de53c[_0x5f21('0x4d')][_0x5f21('0x71')]);}})[_0x5f21('0xf')](respondWithStatusCode(_0x148f04,null))['catch'](handleError(_0x148f04,null));};exports[_0x5f21('0x72')]=function(_0x4c2403,_0x498858){if(_0x4c2403['body']['id']){delete _0x4c2403[_0x5f21('0x66')]['id'];}return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x4c2403[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x498858,null))[_0x5f21('0xf')](function(_0x4e2e4c){if(_0x4e2e4c){_0x4c2403[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x4e2e4c['id'];return db[_0x5f21('0x73')][_0x5f21('0x74')](_0x4c2403[_0x5f21('0x66')]);}})[_0x5f21('0xf')](respondWithResult(_0x498858,null))['catch'](handleError(_0x498858,null));};exports[_0x5f21('0x75')]=function(_0x1557d5,_0x12da87){var _0x32ed3b={'raw':![],'where':{}};var _0x49a2f8={};var _0x1fda57={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x1557d5[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x12da87,null))[_0x5f21('0xf')](function(_0xb62185){if(_0xb62185){_0x49a2f8[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x73')][_0x5f21('0x48')]);_0x49a2f8['query']=_[_0x5f21('0x4e')](_0x1557d5[_0x5f21('0x4d')]);_0x49a2f8[_0x5f21('0x4f')]=_['intersection'](_0x49a2f8[_0x5f21('0x4c')],_0x49a2f8[_0x5f21('0x4d')]);_0x32ed3b['attributes']=_[_0x5f21('0x50')](_0x49a2f8[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x1557d5[_0x5f21('0x4d')]['fields']));_0x32ed3b[_0x5f21('0x51')]=_0x32ed3b['attributes']['length']?_0x32ed3b['attributes']:_0x49a2f8[_0x5f21('0x4c')];if(!_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x54')](_0x5f21('0x55'))){_0x32ed3b[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1557d5['query'][_0x5f21('0x20')]);_0x32ed3b['offset']=qs['offset'](_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x32ed3b[_0x5f21('0x56')]=qs['sort'](_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x32ed3b[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1557d5[_0x5f21('0x4d')],_0x49a2f8[_0x5f21('0x4f')]));_0x32ed3b[_0x5f21('0x5a')][_0x5f21('0x6c')]=_0xb62185['id'];if(_0x1557d5[_0x5f21('0x4d')]['filter']){_0x32ed3b[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x32ed3b['where'],{'$or':_['map'](_0x32ed3b[_0x5f21('0x51')],function(_0x4d64e4){var _0x1a04bd={};_0x1a04bd[_0x4d64e4]={'$like':'%'+_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x1a04bd;})});}_0x32ed3b=_[_0x5f21('0x5b')]({},_0x32ed3b,_0x1557d5[_0x5f21('0x5d')]);return db[_0x5f21('0x73')][_0x5f21('0x22')]({'where':_0x32ed3b['where']})['then'](function(_0x4fdbf1){_0x1fda57[_0x5f21('0x22')]=_0x4fdbf1;if(_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x32ed3b[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x73')][_0x5f21('0x61')](_0x32ed3b);})[_0x5f21('0xf')](function(_0x412af2){_0x1fda57[_0x5f21('0x62')]=_0x412af2;return _0x1fda57;});}})['then'](respondWithFilteredResult(_0x12da87,_0x32ed3b))[_0x5f21('0x1a')](handleError(_0x12da87,null));};exports['removeAnswers']=function(_0x279189,_0x12dbb5){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x279189['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x12dbb5,null))[_0x5f21('0xf')](function(_0x3d56cb){if(_0x3d56cb){return _0x3d56cb[_0x5f21('0x76')](_0x279189['query'][_0x5f21('0x71')]);}})[_0x5f21('0xf')](respondWithStatusCode(_0x12dbb5,null))['catch'](handleError(_0x12dbb5,null));};exports[_0x5f21('0x74')]=function(_0x57471e,_0x5ea8a8){var _0x907c56={'name':_0x57471e[_0x5f21('0x66')]['name'],'key':_0x57471e[_0x5f21('0x66')]['key'],'provider':_0x57471e[_0x5f21('0x66')][_0x5f21('0x67')]==='custom'?null:_0x57471e[_0x5f21('0x66')][_0x5f21('0x67')],'email':_0x57471e['body'][_0x5f21('0x77')],'ListId':_0x57471e[_0x5f21('0x66')][_0x5f21('0x78')],'active':!_[_0x5f21('0x79')](_0x57471e[_0x5f21('0x66')][_0x5f21('0x7a')])?_0x57471e['body'][_0x5f21('0x7a')]:!![],'description':_0x57471e[_0x5f21('0x66')]['description']||null};var _0x55d3fb=getAuthenticationOptions(_0x907c56[_0x5f21('0x67')],_0x57471e['body']);_0x907c56['Imap']=_0x55d3fb[_0x5f21('0x44')];_0x907c56[_0x5f21('0x41')]=_0x55d3fb[_0x5f21('0x41')];return db[_0x5f21('0x5e')][_0x5f21('0x74')](_0x907c56,{'include':[{'model':db['MailServerOut'],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')}]})[_0x5f21('0xf')](function(_0x485b5f){var _0x15bcd8=_0x57471e[_0x5f21('0x36')]['get']({'plain':!![]});if(!_0x15bcd8)throw new Error(_0x5f21('0x7b'));if(_0x15bcd8[_0x5f21('0x7c')]===_0x5f21('0x36')){var _0x5a9d31=_0x485b5f['get']({'plain':!![]});return db[_0x5f21('0x7d')][_0x5f21('0x65')]({'where':{'name':_0x5f21('0x7e'),'userProfileId':_0x15bcd8[_0x5f21('0x7f')]},'raw':!![]})['then'](function(_0x306dad){if(_0x306dad&&_0x306dad[_0x5f21('0x80')]===0x0){return db['UserProfileResource'][_0x5f21('0x74')]({'name':_0x5a9d31['name'],'resourceId':_0x5a9d31['id'],'type':_0x306dad[_0x5f21('0x2a')],'sectionId':_0x306dad['id']},{})[_0x5f21('0xf')](function(){return _0x485b5f;});}else{return _0x485b5f;}})[_0x5f21('0x1a')](function(_0x4093ff){logger[_0x5f21('0x16')](_0x5f21('0x81'),_0x4093ff);throw _0x4093ff;});}return _0x485b5f;})[_0x5f21('0xf')](respondWithResult(_0x5ea8a8,0xc9))[_0x5f21('0x1a')](handleError(_0x5ea8a8,null));};exports[_0x5f21('0x82')]=function(_0x19421b,_0x19bd74){return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x19421b[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x19bd74,null))['then'](function(_0x2415ad){if(_0x2415ad){return _0x2415ad[_0x5f21('0x82')]();}return null;})[_0x5f21('0xf')](respondWithResult(_0x19bd74,null))[_0x5f21('0x1a')](handleError(_0x19bd74,null));};exports[_0x5f21('0x83')]=function(_0x3bc3a1,_0x4be71e){if(_0x3bc3a1[_0x5f21('0x66')]['id']){delete _0x3bc3a1['body']['id'];}return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x3bc3a1[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4be71e,null))[_0x5f21('0xf')](function(_0x22b1b6){if(_0x22b1b6){_0x3bc3a1[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x22b1b6['id'];return db[_0x5f21('0x43')]['create'](_0x3bc3a1[_0x5f21('0x66')]);}})['then'](respondWithResult(_0x4be71e,null))[_0x5f21('0x1a')](handleError(_0x4be71e,null));};exports[_0x5f21('0x84')]=function(_0x1f705d,_0x35c577){return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1f705d[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x35c577,null))[_0x5f21('0xf')](function(_0x298835){if(_0x298835){return _0x298835['setImap'](null);}return null;})[_0x5f21('0xf')](respondWithStatusCode(_0x35c577,null))[_0x5f21('0x1a')](handleError(_0x35c577,null));};exports[_0x5f21('0x85')]=function(_0x581227,_0x5342b2){return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x581227[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x5342b2,null))[_0x5f21('0xf')](function(_0x66f23a){if(_0x66f23a){return _0x66f23a['getSmtp']();}return null;})[_0x5f21('0xf')](respondWithResult(_0x5342b2,null))[_0x5f21('0x1a')](handleError(_0x5342b2,null));};exports[_0x5f21('0x86')]=function(_0x487dae,_0x4dad0a){if(_0x487dae[_0x5f21('0x66')]['id']){delete _0x487dae['body']['id'];}return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x487dae[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4dad0a,null))[_0x5f21('0xf')](function(_0x40ecaf){if(_0x40ecaf){_0x487dae['body'][_0x5f21('0x6c')]=_0x40ecaf['id'];return db[_0x5f21('0x45')]['create'](_0x487dae[_0x5f21('0x66')]);}})[_0x5f21('0xf')](respondWithResult(_0x4dad0a,null))['catch'](handleError(_0x4dad0a,null));};exports[_0x5f21('0x87')]=function(_0x258d1d,_0x2888cb){return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x258d1d[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2888cb,null))[_0x5f21('0xf')](function(_0x576a97){if(_0x576a97){return _0x576a97[_0x5f21('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x2888cb,null))[_0x5f21('0x1a')](handleError(_0x2888cb,null));};exports[_0x5f21('0x89')]=function(_0x2c7461,_0x2feb18){return db[_0x5f21('0x8a')]['find']({'where':{'id':_0x2c7461[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2feb18,null))[_0x5f21('0xf')](function(_0x5277a1){if(_0x5277a1){return _0x5277a1[_0x5f21('0x89')](_0x2c7461[_0x5f21('0x66')][_0x5f21('0x71')],_['omit'](_0x2c7461[_0x5f21('0x66')],[_0x5f21('0x71'),'id'])||{});}})['then'](respondWithResult(_0x2feb18,null))[_0x5f21('0x1a')](handleError(_0x2feb18,null));};exports[_0x5f21('0x8b')]=function(_0x5b5e64,_0xf9519b){var _0x3ee841={'raw':![],'where':{}};var _0x1e5fcc={};var _0x500ff9={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x5b5e64['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0xf9519b,null))['then'](function(_0x339e49){if(_0x339e49){_0x1e5fcc[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x8a')][_0x5f21('0x48')]);_0x1e5fcc[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0x5b5e64[_0x5f21('0x4d')]);_0x1e5fcc['filters']=_[_0x5f21('0x50')](_0x1e5fcc[_0x5f21('0x4c')],_0x1e5fcc[_0x5f21('0x4d')]);_0x3ee841['attributes']=_[_0x5f21('0x50')](_0x1e5fcc[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x5b5e64[_0x5f21('0x4d')]['fields']));_0x3ee841[_0x5f21('0x51')]=_0x3ee841[_0x5f21('0x51')][_0x5f21('0x53')]?_0x3ee841[_0x5f21('0x51')]:_0x1e5fcc['model'];if(!_0x5b5e64['query']['hasOwnProperty'](_0x5f21('0x55'))){_0x3ee841[_0x5f21('0x20')]=qs['limit'](_0x5b5e64['query'][_0x5f21('0x20')]);_0x3ee841[_0x5f21('0x1f')]=qs['offset'](_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x3ee841['order']=qs[_0x5f21('0x57')](_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x3ee841[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x5b5e64[_0x5f21('0x4d')],_0x1e5fcc['filters']));_0x3ee841[_0x5f21('0x5a')][_0x5f21('0x6c')]=_0x339e49['id'];if(_0x5b5e64[_0x5f21('0x4d')]['filter']){_0x3ee841['where']=_['merge'](_0x3ee841[_0x5f21('0x5a')],{'$or':_['map'](_0x3ee841[_0x5f21('0x51')],function(_0x4188d8){var _0xc633ac={};_0xc633ac[_0x4188d8]={'$like':'%'+_0x5b5e64['query']['filter']+'%'};return _0xc633ac;})});}_0x3ee841=_[_0x5f21('0x5b')]({},_0x3ee841,_0x5b5e64[_0x5f21('0x5d')]);return db[_0x5f21('0x8a')][_0x5f21('0x22')]({'where':_0x3ee841[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x16ea86){_0x500ff9[_0x5f21('0x22')]=_0x16ea86;if(_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x3ee841['include']=[{'model':db[_0x5f21('0x8c')],'as':_0x5f21('0x8d'),'required':![]},{'model':db[_0x5f21('0x8e')],'as':'Owner','attributes':['name','fullname',_0x5f21('0x8f')],'required':![]},{'model':db[_0x5f21('0x90')],'as':_0x5f21('0x91'),'attributes':['id',_0x5f21('0x2a'),_0x5f21('0x92')],'where':_0x5b5e64[_0x5f21('0x4d')]['tag']?{'id':_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x93')]}:undefined,'required':_0x5b5e64['query'][_0x5f21('0x93')]?!![]:![]}];}return db[_0x5f21('0x8a')]['findAll'](_0x3ee841);})['then'](function(_0x2528b9){_0x500ff9[_0x5f21('0x62')]=_0x2528b9;return _0x500ff9;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0xf9519b,_0x3ee841))[_0x5f21('0x1a')](handleError(_0xf9519b,null));};exports[_0x5f21('0x94')]=function addApplications(_0x1e6361,_0x4e361c){var _0x3e8ccf=_0x1e6361[_0x5f21('0x69')]['id'];var _0x14eeec=_0x1e6361[_0x5f21('0x66')];var _0x8549fb=0xc8;var _0x41b6e2=null;return db[_0x5f21('0x95')][_0x5f21('0x96')]({'isolationLevel':db['sequelize'][_0x5f21('0x97')]['ISOLATION_LEVELS'][_0x5f21('0x98')]},function(_0x3150d5){return db['MailAccount'][_0x5f21('0x6f')]({'where':{'id':_0x3e8ccf},'transaction':_0x3150d5})[_0x5f21('0xf')](function(_0x254350){if(_0x254350){return db['MailApplication'][_0x5f21('0x28')]({'where':{'MailAccountId':_0x3e8ccf},'transaction':_0x3150d5})[_0x5f21('0xf')](function(){var _0x1fdcc4=_[_0x5f21('0x47')](_0x14eeec,function(_0x3b2e0b){_0x3b2e0b['MailAccountId']=_0x3e8ccf;return _0x3b2e0b;});return db['MailApplication'][_0x5f21('0x99')](_0x1fdcc4,{'transaction':_0x3150d5});});}else{_0x8549fb=0x194;_0x41b6e2=[];}});})[_0x5f21('0xf')](function(){if(_0x8549fb!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x3e8ccf},'order':_0x5f21('0x9a')})[_0x5f21('0xf')](function(_0x58f0cf){_0x41b6e2=_0x58f0cf;});}})[_0x5f21('0x1a')](function(_0x364ad4){_0x8549fb=0x1f4;logger[_0x5f21('0x16')](_0x364ad4[_0x5f21('0x29')]);if(_0x364ad4['name']){delete _0x364ad4[_0x5f21('0x2a')];}_0x41b6e2=_0x364ad4;})[_0x5f21('0x9b')](function(){if(_0x41b6e2===null){_0x4e361c[_0x5f21('0x1b')](_0x8549fb);}else{if(_0x8549fb===0x1f4){_0x4e361c[_0x5f21('0x1d')](_0x8549fb)[_0x5f21('0x2b')](_0x41b6e2);}else{_0x4e361c['status'](_0x8549fb)[_0x5f21('0x1e')](_0x41b6e2);}}});};exports[_0x5f21('0x9c')]=function(_0x1a58b2,_0x264851){var _0x10f695={};var _0x327087={};var _0x10c273;var _0x53ddfb;return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1a58b2['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x264851,null))['then'](function(_0x3770ff){if(_0x3770ff){_0x10c273=_0x3770ff;_0x327087[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x9d')][_0x5f21('0x48')]);_0x327087[_0x5f21('0x4d')]=_['keys'](_0x1a58b2[_0x5f21('0x4d')]);_0x327087[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x327087[_0x5f21('0x4c')],_0x327087[_0x5f21('0x4d')]);_0x10f695['attributes']=_[_0x5f21('0x50')](_0x327087[_0x5f21('0x4c')],qs['fields'](_0x1a58b2['query']['fields']));_0x10f695[_0x5f21('0x51')]=_0x10f695[_0x5f21('0x51')][_0x5f21('0x53')]?_0x10f695[_0x5f21('0x51')]:_0x327087['model'];_0x10f695['order']=qs[_0x5f21('0x57')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x10f695['where']=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1a58b2[_0x5f21('0x4d')],_0x327087[_0x5f21('0x4f')]));if(_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x10f695[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x10f695[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x10f695[_0x5f21('0x51')],function(_0x22e4b3){var _0x5133b9={};_0x5133b9[_0x22e4b3]={'$like':'%'+_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x5133b9;})});}_0x10f695=_['merge']({},_0x10f695,_0x1a58b2[_0x5f21('0x5d')]);return _0x10c273[_0x5f21('0x9c')](_0x10f695);}})[_0x5f21('0xf')](function(_0x9516de){if(_0x9516de){_0x53ddfb=_0x9516de[_0x5f21('0x53')];if(!_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x54')](_0x5f21('0x55'))){_0x10f695[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x10f695['offset']=qs[_0x5f21('0x1f')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x1f')]);}return _0x10c273[_0x5f21('0x9c')](_0x10f695);}})['then'](function(_0x10c921){if(_0x10c921){return _0x10c921?{'count':_0x53ddfb,'rows':_0x10c921}:null;}})['then'](respondWithResult(_0x264851,null))[_0x5f21('0x1a')](handleError(_0x264851,null));};exports['getMessages']=function(_0xaca345,_0x2b7474){var _0x7e6331={'raw':!![],'where':{}};var _0x24dd9f={};var _0x44a189={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0xaca345[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2b7474,null))[_0x5f21('0xf')](function(_0x47ea7c){if(_0x47ea7c){_0x24dd9f['model']=_[_0x5f21('0x4e')](db[_0x5f21('0x9e')][_0x5f21('0x48')]);_0x24dd9f[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0xaca345['query']);_0x24dd9f[_0x5f21('0x4f')]=_['intersection'](_0x24dd9f[_0x5f21('0x4c')],_0x24dd9f[_0x5f21('0x4d')]);_0x7e6331[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x24dd9f['model'],qs[_0x5f21('0x52')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x52')]));_0x7e6331[_0x5f21('0x51')]=_0x7e6331[_0x5f21('0x51')][_0x5f21('0x53')]?_0x7e6331[_0x5f21('0x51')]:_0x24dd9f[_0x5f21('0x4c')];if(!_0xaca345[_0x5f21('0x4d')]['hasOwnProperty']('nolimit')){_0x7e6331[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x7e6331[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x7e6331['order']=qs[_0x5f21('0x57')](_0xaca345['query'][_0x5f21('0x57')]);_0x7e6331[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0xaca345[_0x5f21('0x4d')],_0x24dd9f[_0x5f21('0x4f')]));_0x7e6331[_0x5f21('0x5a')]['MailAccountId']=_0x47ea7c['id'];if(_0xaca345[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x7e6331[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x7e6331[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x7e6331[_0x5f21('0x51')],function(_0x45c474){var _0x335811={};_0x335811[_0x45c474]={'$like':'%'+_0xaca345[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x335811;})});}if(_0xaca345[_0x5f21('0x4d')][_0x5f21('0x9f')]){var _0x561bf5=_0xaca345['query'][_0x5f21('0x9f')][_0x5f21('0xa0')](',');var _0x3915dc={};_0x3915dc[_0x561bf5[0x0]]={'$gte':moment(_0x561bf5[0x1])['format'](_0x5f21('0xa1'))};_0x7e6331['where']=_[_0x5f21('0x5b')](_0x7e6331[_0x5f21('0x5a')],_0x3915dc);}_0x7e6331=_['merge']({},_0x7e6331,_0xaca345['options']);return db[_0x5f21('0x9e')][_0x5f21('0x22')]({'where':_0x7e6331[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x1fb774){_0x44a189['count']=_0x1fb774;if(_0xaca345[_0x5f21('0x4d')]['includeAll']){_0x7e6331[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x9e')]['findAll'](_0x7e6331);})[_0x5f21('0xf')](function(_0x546a09){if(_0xaca345[_0x5f21('0x4d')]['inlineCss']===_0x5f21('0xa2')){for(var _0x14034e=0x0;_0x14034e<_0x546a09['length'];_0x14034e++){_0x546a09[_0x14034e][_0x5f21('0x66')]=juice(_0x546a09[_0x14034e][_0x5f21('0x66')]);}}_0x44a189['rows']=_0x546a09;return _0x44a189;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0x2b7474,_0x7e6331))[_0x5f21('0x1a')](handleError(_0x2b7474,null));};exports['send']=function(_0x14e47f,_0x11b963){var _0xda825e,_0x30b8c8={},_0x23401b;if(_0x14e47f[_0x5f21('0x66')]['to']){_0x23401b=_0x14e47f[_0x5f21('0x66')]['to'][_0x5f21('0xa0')](',')[0x0];}return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x14e47f['params']['id']},'include':[{'model':db[_0x5f21('0xa3')],'as':_0x5f21('0xa4'),'include':[{'model':db['CmContact'],'as':_0x5f21('0xa5'),'where':{'email':_0x23401b},'limit':0x1,'order':[[_0x5f21('0xa6'),_0x5f21('0xa7')]]}]},{'model':db['MailServerOut'],'as':_0x5f21('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5f21('0xa8'),'raw':!![]}]}]})[_0x5f21('0xf')](handleEntityNotFound(_0x11b963,null))[_0x5f21('0xf')](function(_0x23752f){if(!_0x23752f)return;_0xda825e=_0x23752f;if(!_0x23752f['Smtp'])throw new Error(_0x5f21('0xa9'));if(_[_0x5f21('0x79')](_0x14e47f[_0x5f21('0x66')]['from'])){_0x14e47f['body'][_0x5f21('0xaa')]=util['format']('%s\x20<%s>',_0x23752f['name'],_0x23752f[_0x5f21('0x77')]||_0x23752f['Smtp'][_0x5f21('0x36')]);}if(_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')]&&_0x14e47f[_0x5f21('0x66')]['attachments'][_0x5f21('0x53')]){for(var _0x5c7d5=0x0;_0x5c7d5<_0x14e47f[_0x5f21('0x66')]['attachments']['length'];_0x5c7d5+=0x1){_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')][_0x5c7d5]={'filename':_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')][_0x5c7d5][_0x5f21('0x2a')],'path':path[_0x5f21('0xac')](config[_0x5f21('0xad')],'server/files/attachments',_0x14e47f['body']['attachments'][_0x5c7d5]['basename'])};}}var _0x11424a=_0x23752f[_0x5f21('0xae')]();return respondWithRpcPromise(_0x5f21('0xaf'),_0x5f21('0xb0'),{'account':_0x11424a,'message':_0x14e47f['body']});})['then'](function(_0x203a97){if(!_0x203a97)return;_0x30b8c8=_0x203a97;if(!_0xda825e[_0x5f21('0xa4')])throw new Error(_0x5f21('0xb1'));if(_0xda825e[_0x5f21('0xa4')][_0x5f21('0xa5')]['length'])return _0xda825e['List']['Contacts'][0x0];return db[_0x5f21('0x8c')][_0x5f21('0x74')](_['defaults'](_0x14e47f[_0x5f21('0x66')],{'firstName':_0x14e47f['body']['to'],'email':_0x14e47f['body']['to'],'phone':_0x14e47f['body']['to'],'ListId':_0xda825e[_0x5f21('0x78')]}));})[_0x5f21('0xf')](function(_0xa1fb55){if(!_0xa1fb55)return;var _0x3c9773={'UserId':_0x14e47f[_0x5f21('0x36')]['id'],'ContactId':_0xa1fb55['id'],'MailAccountId':_0xda825e['id'],'inReplyTo':_0x30b8c8[_0x5f21('0xb2')],'to':_0x14e47f[_0x5f21('0x66')][_0x5f21('0xaa')],'cc':_0x14e47f[_0x5f21('0x66')]['cc'],'subject':_0x14e47f[_0x5f21('0x66')]['subject'],'attach':_0x14e47f['body'][_0x5f21('0xb3')],'firstMsgDirection':_0x5f21('0xb4'),'lastMsgAt':moment()[_0x5f21('0xb5')](_0x5f21('0xa1')),'lastMsgDirection':_0x5f21('0xb4'),'Messages':[_[_0x5f21('0x5b')](_0x14e47f[_0x5f21('0x66')],{'messageId':_0x30b8c8['messageId'],'sentAt':moment()[_0x5f21('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xda825e['id'],'UserId':_0x14e47f[_0x5f21('0x36')]['id'],'ContactId':_0xa1fb55['id']})]};if(_0x14e47f[_0x5f21('0x66')][_0x5f21('0xb6')]){_0x3c9773=_[_0x5f21('0x5b')](_0x3c9773,_0x14e47f[_0x5f21('0x66')][_0x5f21('0xb6')]);}return db['MailInteraction'][_0x5f21('0x74')](_0x3c9773,{'include':[{'model':db[_0x5f21('0x9e')],'as':_0x5f21('0xb7')}]});})['then'](respondWithResult(_0x11b963,null))['catch'](handleError(_0x11b963,null));};exports[_0x5f21('0xb8')]=function(_0x3f3fb4,_0x1fb670){return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x3f3fb4[_0x5f21('0x69')]['id']},'include':[{'model':db[_0x5f21('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5f21('0xa8')],'as':_0x5f21('0xa8'),'raw':!![]}]}]})[_0x5f21('0xf')](handleEntityNotFound(_0x1fb670,null))[_0x5f21('0xf')](function(_0x51da24){if(!_0x51da24[_0x5f21('0x41')])return;var _0x3a92df=_0x51da24[_0x5f21('0xae')]();return respondWithRpcPromise(_0x5f21('0xb9'),_0x5f21('0xb8'),{'account':_0x3a92df});})[_0x5f21('0xf')](respondWithResult(_0x1fb670,null))[_0x5f21('0x1a')](handleError(_0x1fb670,null));};exports['destroy']=function(_0x483a71,_0x18f317){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x483a71[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x18f317,null))[_0x5f21('0xf')](function(_0x5e0f38){if(_0x5e0f38&&_0x5e0f38['service']){throw new db[(_0x5f21('0xba'))][(_0x5f21('0xbb'))](_0x5f21('0xbc'));}return _0x5e0f38;})[_0x5f21('0xf')](removeEntity(_0x18f317,null))[_0x5f21('0x1a')](handleError(_0x18f317,null));};exports[_0x5f21('0xbd')]=function(_0x42849c,_0x4e7ddb){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x42849c[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4e7ddb,null))[_0x5f21('0xf')](function(_0x14d4ae){if(_0x14d4ae){return _0x14d4ae[_0x5f21('0xbd')](_0x42849c[_0x5f21('0x66')][_0x5f21('0x71')],_['omit'](_0x42849c[_0x5f21('0x66')],[_0x5f21('0x71'),'id'])||{})[_0x5f21('0xbe')](function(_0x6e3a7c){for(var _0x507e1d=0x0;_0x507e1d<_0x42849c['body'][_0x5f21('0x71')][_0x5f21('0x53')];_0x507e1d+=0x1){socket['emit'](_0x5f21('0xbf'),{'UserId':Number(_0x42849c[_0x5f21('0x66')][_0x5f21('0x71')][_0x507e1d]),'MailAccountId':Number(_0x42849c[_0x5f21('0x69')]['id'])});}return _0x6e3a7c;});}})[_0x5f21('0xf')](respondWithResult(_0x4e7ddb,null))[_0x5f21('0x1a')](handleError(_0x4e7ddb,null));};exports[_0x5f21('0xc0')]=function(_0x28dab3,_0x2c90d1){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x28dab3[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x2c90d1,null))[_0x5f21('0xf')](function(_0x4e91ad){if(_0x4e91ad){return _0x4e91ad[_0x5f21('0xc0')](_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')])['then'](function(){if(_['isArray'](_0x28dab3[_0x5f21('0x4d')]['ids'])){for(var _0x4ba63c=0x0;_0x4ba63c<_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')][_0x5f21('0x53')];_0x4ba63c+=0x1){socket[_0x5f21('0xc1')](_0x5f21('0xc2'),{'UserId':Number(_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')][_0x4ba63c]),'MailAccountId':Number(_0x28dab3[_0x5f21('0x69')]['id'])});}}else{socket[_0x5f21('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')]),'MailAccountId':Number(_0x28dab3[_0x5f21('0x69')]['id'])});}});}})[_0x5f21('0xf')](respondWithStatusCode(_0x2c90d1,null))[_0x5f21('0x1a')](handleError(_0x2c90d1,null));};exports[_0x5f21('0xc3')]=function(_0x1fd850,_0x36ca1b){var _0x152e13={};var _0x57e23a={};var _0x43dc2d;var _0x1340a4;return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1fd850['params']['id']}})['then'](handleEntityNotFound(_0x36ca1b,null))[_0x5f21('0xf')](function(_0x3a2fcb){if(_0x3a2fcb){_0x43dc2d=_0x3a2fcb;_0x57e23a[_0x5f21('0x4c')]=_['keys'](db[_0x5f21('0x8e')][_0x5f21('0x48')]);_0x57e23a[_0x5f21('0x4d')]=_['keys'](_0x1fd850[_0x5f21('0x4d')]);_0x57e23a[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x57e23a[_0x5f21('0x4c')],_0x57e23a['query']);_0x152e13['attributes']=_[_0x5f21('0x50')](_0x57e23a[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x52')]));_0x152e13[_0x5f21('0x51')]=_0x152e13[_0x5f21('0x51')][_0x5f21('0x53')]?_0x152e13[_0x5f21('0x51')]:_0x57e23a['model'];_0x152e13['order']=qs[_0x5f21('0x57')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x152e13[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1fd850[_0x5f21('0x4d')],_0x57e23a[_0x5f21('0x4f')]));if(_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x152e13[_0x5f21('0x5a')]=_['merge'](_0x152e13[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x152e13[_0x5f21('0x51')],function(_0x5f195f){var _0x3043aa={};_0x3043aa[_0x5f195f]={'$like':'%'+_0x1fd850[_0x5f21('0x4d')]['filter']+'%'};return _0x3043aa;})});}_0x152e13=_[_0x5f21('0x5b')]({},_0x152e13,_0x1fd850['options']);return _0x43dc2d['getAgents'](_0x152e13);}})[_0x5f21('0xf')](function(_0x563c03){if(_0x563c03){_0x1340a4=_0x563c03[_0x5f21('0x53')];if(!_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x54')]('nolimit')){_0x152e13[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x152e13[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x1f')]);}return _0x43dc2d['getAgents'](_0x152e13);}})[_0x5f21('0xf')](function(_0x301c18){if(_0x301c18){return _0x301c18?{'count':_0x1340a4,'rows':_0x301c18}:null;}})[_0x5f21('0xf')](respondWithResult(_0x36ca1b,null))[_0x5f21('0x1a')](handleError(_0x36ca1b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 6fce6a3..c4b184e 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 _0x0619=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x44cc15,_0x33c34b){var _0x1c6bc3=function(_0x340818){while(--_0x340818){_0x44cc15['push'](_0x44cc15['shift']());}};_0x1c6bc3(++_0x33c34b);}(_0x0619,0x90));var _0x9061=function(_0x54adf5,_0x4174c0){_0x54adf5=_0x54adf5-0x0;var _0x385be8=_0x0619[_0x54adf5];return _0x385be8;};'use strict';var EventEmitter=require(_0x9061('0x0'));var MailAccount=require(_0x9061('0x1'))['db'][_0x9061('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9061('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9061('0x4'),'afterDestroy':_0x9061('0x5')};function emitEvent(_0x1f0fe8){return function(_0x1384a7,_0x1bc8ce,_0xa713e1){MailAccountEvents[_0x9061('0x6')](_0x1f0fe8+':'+_0x1384a7['id'],_0x1384a7);MailAccountEvents[_0x9061('0x6')](_0x1f0fe8,_0x1384a7);_0xa713e1(null);};}for(var e in events){if(events[_0x9061('0x7')](e)){var event=events[e];MailAccount[_0x9061('0x8')](e,emitEvent(event));}}module[_0x9061('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x700c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0x700c,0x127));var _0xc700=function(_0x174536,_0x1e8bb5){_0x174536=_0x174536-0x0;var _0xf47484=_0x700c[_0x174536];return _0xf47484;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc700('0x0'))['db'][_0xc700('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc700('0x2')](0x0);var events={'afterCreate':_0xc700('0x3'),'afterUpdate':_0xc700('0x4'),'afterDestroy':_0xc700('0x5')};function emitEvent(_0x31fc1d){return function(_0x35d8ed,_0x50fe7c,_0x508aba){MailAccountEvents[_0xc700('0x6')](_0x31fc1d+':'+_0x35d8ed['id'],_0x35d8ed);MailAccountEvents['emit'](_0x31fc1d,_0x35d8ed);_0x508aba(null);};}for(var e in events){if(events[_0xc700('0x7')](e)){var event=events[e];MailAccount[_0xc700('0x8')](e,emitEvent(event));}}module[_0xc700('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 2286e34..7a25960 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 _0x80f8=['Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','data5','auth','pass','./mailAccount.attributes','MailAccount','mail_accounts','custom','service','provider','host'];(function(_0x32568a,_0x4ee251){var _0x320391=function(_0x10caba){while(--_0x10caba){_0x32568a['push'](_0x32568a['shift']());}};_0x320391(++_0x4ee251);}(_0x80f8,0xc5));var _0x880f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x80f8[_0x5b644e];return _0x49c6bf;};'use strict';var attributes=require(_0x880f('0x0'));module['exports']=function(_0x95ec3c){return _0x95ec3c['define'](_0x880f('0x1'),attributes,{'tableName':_0x880f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x21c1d3=this;var _0x505318={'id':_0x21c1d3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x21c1d3['provider']!==_0x880f('0x3')){_0x505318[_0x880f('0x4')]=_0x21c1d3[_0x880f('0x5')];}else{_0x505318[_0x880f('0x6')]=_0x21c1d3[_0x880f('0x7')]['host'];_0x505318[_0x880f('0x8')]=_0x21c1d3[_0x880f('0x7')]['port'];_0x505318[_0x880f('0x9')]=_0x21c1d3[_0x880f('0x7')][_0x880f('0x9')];}if(_0x21c1d3['Smtp']['authentication']){if(_0x21c1d3[_0x880f('0x7')][_0x880f('0xa')]){if(!_0x21c1d3[_0x880f('0x7')][_0x880f('0xb')])throw new Error(_0x880f('0xc'));_0x505318['auth']={'type':'OAuth2','user':_0x21c1d3[_0x880f('0x7')][_0x880f('0xd')],'accessToken':_0x21c1d3[_0x880f('0x7')][_0x880f('0xb')][_0x880f('0xe')]};}else{_0x505318[_0x880f('0xf')]={'user':_0x21c1d3['Smtp'][_0x880f('0xd')],'pass':_0x21c1d3['Smtp'][_0x880f('0x10')]};}}return _0x505318;}}});}; \ No newline at end of file +var _0x2d9b=['custom','host','Smtp','port','secure','authentication','CloudProvider','auth','OAuth2','user','data5','./mailAccount.attributes','exports','define','provider'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x2d9b,0x74));var _0xb2d9=function(_0x3a2fde,_0x14745d){_0x3a2fde=_0x3a2fde-0x0;var _0x8134b9=_0x2d9b[_0x3a2fde];return _0x8134b9;};'use strict';var attributes=require(_0xb2d9('0x0'));module[_0xb2d9('0x1')]=function(_0x335ca4){return _0x335ca4[_0xb2d9('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1588f2=this;var _0x3edae4={'id':_0x1588f2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1588f2[_0xb2d9('0x3')]!==_0xb2d9('0x4')){_0x3edae4['service']=_0x1588f2[_0xb2d9('0x3')];}else{_0x3edae4[_0xb2d9('0x5')]=_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0x5')];_0x3edae4[_0xb2d9('0x7')]=_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0x7')];_0x3edae4['secure']=_0x1588f2['Smtp'][_0xb2d9('0x8')];}if(_0x1588f2['Smtp'][_0xb2d9('0x9')]){if(_0x1588f2[_0xb2d9('0x6')]['modernAuthentication']){if(!_0x1588f2['Smtp'][_0xb2d9('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3edae4[_0xb2d9('0xb')]={'type':_0xb2d9('0xc'),'user':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xd')],'accessToken':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xa')][_0xb2d9('0xe')]};}else{_0x3edae4['auth']={'user':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xd')],'pass':_0x1588f2[_0xb2d9('0x6')]['pass']};}}return _0x3edae4;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 51c46ce..290b53a 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 _0x524e=['ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','CloudProvider','get','Applications','applications','orderBy','priority','asc','autoclose','push','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originTo','originCc','bcc'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x524e,0x15e));var _0xe524=function(_0xcd5b86,_0x279cca){_0xcd5b86=_0xcd5b86-0x0;var _0x41fd89=_0x524e[_0xcd5b86];return _0x41fd89;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xe524('0x0'));var rs=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var db=require(_0xe524('0x3'))['db'];var logger=require(_0xe524('0x4'))(_0xe524('0x5'));var config=require(_0xe524('0x6'));var jayson=require(_0xe524('0x7'));var client=jayson[_0xe524('0x8')][_0xe524('0x9')]({'port':0x232c});config['redis']=_[_0xe524('0xa')](config[_0xe524('0xb')],{'host':_0xe524('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xd'))[_0xe524('0xe')](socket);function respondWithRpcPromise(_0x1f36e5,_0x991924,_0x4082b1){return new BPromise(function(_0x1a08e2,_0xb3eb9f){return client[_0xe524('0xf')](_0x1f36e5,_0x4082b1)[_0xe524('0x10')](function(_0x1e4459){logger[_0xe524('0x11')](_0xe524('0x12'),_0x991924,_0xe524('0x13'));logger[_0xe524('0x14')](_0xe524('0x15'),_0x991924,'request\x20sent',JSON['stringify'](_0x1e4459));if(_0x1e4459[_0xe524('0x16')]){if(_0x1e4459[_0xe524('0x16')][_0xe524('0x17')]===0x1f4){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x1e4459['error'][_0xe524('0x18')]);return _0xb3eb9f(_0x1e4459['error'][_0xe524('0x18')]);}logger[_0xe524('0x16')]('MailAccount,\x20%s,\x20%s',_0x991924,_0x1e4459[_0xe524('0x16')]['message']);return _0x1a08e2(_0x1e4459[_0xe524('0x16')]['message']);}else{logger[_0xe524('0x11')]('MailAccount,\x20%s,\x20%s',_0x991924,'request\x20sent');_0x1a08e2(_0x1e4459['result'][_0xe524('0x18')]);}})['catch'](function(_0x11b2a1){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x11b2a1);_0xb3eb9f(_0x11b2a1);});});}exports[_0xe524('0x19')]=function(_0x5d7b17){var _0x1fd93a=this;return new Promise(function(_0x3ccb3f,_0x49d104){return db[_0xe524('0x1a')][_0xe524('0x1b')]({'raw':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17['options'][_0xe524('0x1f')]||null:null,'limit':_0x5d7b17['options']?_0x5d7b17['options'][_0xe524('0x20')]||null:null,'include':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x21')]?_['map'](_0x5d7b17[_0xe524('0x1c')]['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x22')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1f')],'include':_0x17e245[_0xe524('0x21')]?_[_0xe524('0x23')](_0x17e245[_0xe524('0x21')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes'],'include':_0x2141db[_0xe524('0x21')]?_[_0xe524('0x23')](_0x2141db[_0xe524('0x21')],function(_0x109a96){return{'model':db[_0x109a96[_0xe524('0x22')]],'as':_0x109a96['as'],'attributes':_0x109a96['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b1ff){logger[_0xe524('0x11')](_0xe524('0x19'),_0x5d7b17);logger[_0xe524('0x14')](_0xe524('0x19'),_0x5d7b17,JSON['stringify'](_0x4b1ff));_0x3ccb3f(_0x4b1ff);})[_0xe524('0x24')](function(_0x9a7e98){logger['error']('GetMailAccount',_0x9a7e98[_0xe524('0x18')],_0x5d7b17);_0x49d104(_0x1fd93a[_0xe524('0x16')](0x1f4,_0x9a7e98['message']));});});};exports[_0xe524('0x25')]=function(_0x535354){var _0x3fec06=this;return new Promise(function(_0x54af2a,_0x315e56){return db[_0xe524('0x1a')][_0xe524('0x26')]({'raw':_0x535354['options']?_0x535354[_0xe524('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x535354[_0xe524('0x1c')]?_0x535354[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x1f')]||null:null,'include':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x21')]?_[_0xe524('0x23')](_0x535354[_0xe524('0x1c')]['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x22')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1f')],'include':_0x415450[_0xe524('0x21')]?_[_0xe524('0x23')](_0x415450[_0xe524('0x21')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x22')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes'],'include':_0x2741e8[_0xe524('0x21')]?_['map'](_0x2741e8[_0xe524('0x21')],function(_0x53eeee){return{'model':db[_0x53eeee['model']],'as':_0x53eeee['as'],'attributes':_0x53eeee[_0xe524('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c3aae){if(_0x535354[_0xe524('0x1c')][_0xe524('0x27')]===!![])_0x1c3aae[_0xe524('0x28')](_0xe524('0x29'),_0x1c3aae[_0xe524('0x2a')]());logger[_0xe524('0x11')](_0xe524('0x25'),_0x535354);logger['debug'](_0xe524('0x25'),_0x535354,JSON[_0xe524('0x2b')](_0x1c3aae));_0x54af2a(_0x1c3aae);})[_0xe524('0x24')](function(_0x3fd023){logger[_0xe524('0x16')](_0xe524('0x25'),_0x3fd023[_0xe524('0x18')],_0x535354);_0x315e56(_0x3fec06[_0xe524('0x16')](0x1f4,_0x3fd023['message']));});});};exports[_0xe524('0x2c')]=function(_0x849307){var _0x2e4a13=this;return new Promise(function(_0x59781b,_0x238673){var _0x5213ed={'body':_0x849307[_0xe524('0x2d')],'channel':_0xe524('0x2e')};var _0x43c314=_[_0xe524('0x2f')](_[_0xe524('0x30')](db[_0xe524('0x31')][_0xe524('0x32')]),['createdAt',_0xe524('0x33'),_0xe524('0x34'),_0xe524('0x35')]);var _0x376505=![];if(_0x849307[_0xe524('0x2d')]['id']){delete _0x849307[_0xe524('0x2d')]['id'];}if(_['isNil'](_0x849307[_0xe524('0x2d')][_0xe524('0x36')])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe524('0x37')](_0x849307['body']['body'])||_0x849307[_0xe524('0x2d')][_0xe524('0x2d')]===''){return _0x238673(_0x2e4a13['error'](0x1f4,_0xe524('0x38')));}if(_[_0xe524('0x37')](_0x849307[_0xe524('0x2d')][_0xe524('0x39')])){return _0x238673(_0x2e4a13['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}if(!_[_0xe524('0x3a')](_0x43c314,_0x849307[_0xe524('0x2d')]['mapKey'])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}var _0x472519={};_0x472519[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x1a')][_0xe524('0x26')]({'where':{'id':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db[_0xe524('0x3c')],'as':_0xe524('0x3d'),'include':[{'model':db[_0xe524('0x31')],'as':_0xe524('0x3e'),'where':_0x472519,'limit':0x1,'order':[[_0xe524('0x33'),_0xe524('0x3f')]]}]},{'model':db[_0xe524('0x40')],'as':'Applications'},{'model':db[_0xe524('0x41')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xe524('0x42')}]}]})['then'](function(_0x232cf0){if(_0x232cf0&&_0x232cf0[_0xe524('0x3d')]){var _0x561107=_0x232cf0[_0xe524('0x43')]({'plain':!![]});_0x5213ed['account']=_['omit'](_0x561107,[_0xe524('0x44'),_0xe524('0x3d')]);_0x5213ed[_0xe524('0x3b')]['smtpOptions']=_0x232cf0['getSmtpOptions']();_0x5213ed['applications']=_0x561107['Applications'];_0x5213ed['list']=_0x561107['List'];_0x5213ed[_0xe524('0x45')]=_[_0xe524('0x46')](_0x5213ed['applications'],[_0xe524('0x47')],[_0xe524('0x48')]);if(_0x5213ed[_0xe524('0x3b')]&&_0x5213ed[_0xe524('0x3b')][_0xe524('0x49')]){_0x5213ed['applications'][_0xe524('0x4a')]({'id':0x0,'priority':_0x5213ed[_0xe524('0x45')][_0xe524('0x4b')]+0x1,'app':'close','appdata':_0xe524('0x49'),'interval':'*,*,*,*'});}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x44')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x44')];}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')];}if(_0x561107[_0xe524('0x3d')][_0xe524('0x3e')][_0xe524('0x4b')]){return _0x561107[_0xe524('0x3d')]['Contacts'][0x0];}var _0x4dac0f=_['defaults'](_0x849307[_0xe524('0x2d')],{'firstName':_0x849307[_0xe524('0x2d')][_0xe524('0x36')],'ListId':_0x561107[_0xe524('0x35')]});_0x4dac0f[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x31')][_0xe524('0x4c')](_0x4dac0f);}else{throw new Error(_0xe524('0x4d'));}})['then'](function(_0x5012fc){_0x5213ed[_0xe524('0x4e')]=_0x5012fc;if(_0x5012fc){if(!_0x849307['body']['message']['messageId']){_0x849307['body'][_0xe524('0x18')][_0xe524('0x4f')]=rs[_0xe524('0x50')]()+'\x20'+_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x36')];}var _0x244f08={'ContactId':_0x5012fc['id'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'inReplyTo':_0x849307[_0xe524('0x2d')]['message']['messageId'],'to':_0x849307['body'][_0xe524('0x18')]['from'],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307['body']['message'][_0xe524('0x52')],'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'};return db[_0xe524('0x55')][_0xe524('0x26')]({'where':{'closed':![],'MailAccountId':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':_0xe524('0x56'),'attributes':[_0xe524('0x4f')],'where':{'messageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x57')]}}]})[_0xe524('0x10')](function(_0x3bd9f9){if(_0x3bd9f9){return[_0x3bd9f9,![]];}return db['MailInteraction']['create'](_0x244f08)[_0xe524('0x10')](function(_0x35cbe9){return[_0x35cbe9,!![]];});});}else{throw new Error(_0xe524('0x58'));}})[_0xe524('0x59')](function(_0x139a0a,_0x4c6869){if(_0x139a0a){_0x376505=_0x4c6869;if(!_0x4c6869){return _0x139a0a[_0xe524('0x5a')]({'inReplyTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x36')],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['subject'],'attach':_0x139a0a[_0xe524('0x52')]?_0x139a0a[_0xe524('0x52')]:_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x52')],'substatus':null,'substatusAt':moment()['format'](_0xe524('0x54')),'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'});}else{return _0x139a0a;}}})[_0xe524('0x10')](function(_0x387c4b){_0x5213ed[_0xe524('0x5b')]=_0x387c4b[_0xe524('0x43')]({'plain':!![]});_0x5213ed['interaction'][_0xe524('0x5c')]=_0x376505;return db[_0xe524('0x5d')][_0xe524('0x4c')]({'body':_0x849307[_0xe524('0x2d')]['body'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'MailInteractionId':_0x387c4b['id'],'direction':'in','ContactId':_0x5213ed['contact']['id'],'messageId':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'from':_0x849307['body'][_0xe524('0x18')][_0xe524('0x36')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['to'],'cc':_0x849307[_0xe524('0x2d')]['message']['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['attach'],'Attachments':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5e')],'originTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5f')],'originCc':_0x849307['body'][_0xe524('0x18')][_0xe524('0x60')],'bcc':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x61')],'ChatWebsiteId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x62')]||null,'originChannel':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x63')]||_0xe524('0x64'),'ChatOfflineMessageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x65')]||null},{'include':[{'model':db[_0xe524('0x66')],'as':_0xe524('0x67')}]});})[_0xe524('0x10')](function(_0x19b28a){_0x5213ed[_0xe524('0x18')]=_0x19b28a;if(_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]){return db[_0xe524('0x69')][_0xe524('0x26')]({'attributes':['id',_0xe524('0x6a')],'where':{'id':_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]}})[_0xe524('0x10')](function(_0x23425c){if(_0x23425c){_0x5213ed['applications'][_0xe524('0x6b')]({'id':0x0,'priority':0x0,'app':_0xe524('0x6c'),'appdata':_0x23425c[_0xe524('0x6a')]+','+(_0x5213ed['account'][_0xe524('0x6d')]||0xa),'interval':_0xe524('0x6e')});}return respondWithRpcPromise('Start','startRouting',_0x5213ed);});}return respondWithRpcPromise(_0xe524('0x6f'),'startRouting',_0x5213ed);})[_0xe524('0x10')](function(_0x5a6a07){_0x59781b(_0x5a6a07);})[_0xe524('0x24')](function(_0x1ed60b){_0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,_0x1ed60b[_0xe524('0x18')]));});});}; \ No newline at end of file +var _0x1261=['Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','UserId','unshift','agent','*,*,*,*','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailAccount','options','where','attributes','limit','map','include','model','ShowMailAccount','find','setDataValue','getSmtpOptions','catch','difference','keys','CmContact','rawAttributes','createdAt','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','updatedAt','MailApplication','Applications','Smtp','CloudProvider','get','omit','smtpOptions','applications','priority','asc','autoclose','push','close','length','ListId','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailInteraction','Messages','inReplyTo'];(function(_0x1a704d,_0x4e818c){var _0x5df79b=function(_0x506fa2){while(--_0x506fa2){_0x1a704d['push'](_0x1a704d['shift']());}};_0x5df79b(++_0x4e818c);}(_0x1261,0x144));var _0x1126=function(_0x2050f7,_0x3833c6){_0x2050f7=_0x2050f7-0x0;var _0x219da1=_0x1261[_0x2050f7];return _0x219da1;};'use strict';var _=require('lodash');var moment=require(_0x1126('0x0'));var BPromise=require(_0x1126('0x1'));var rs=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var db=require(_0x1126('0x4'))['db'];var logger=require(_0x1126('0x5'))(_0x1126('0x6'));var config=require(_0x1126('0x7'));var jayson=require(_0x1126('0x8'));var client=jayson[_0x1126('0x9')]['http']({'port':0x232c});config['redis']=_[_0x1126('0xa')](config[_0x1126('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1126('0xc'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xd'))[_0x1126('0xe')](socket);function respondWithRpcPromise(_0x2d9033,_0x59cfa1,_0x3f09ac){return new BPromise(function(_0x18dbe6,_0x167ef1){return client['request'](_0x2d9033,_0x3f09ac)[_0x1126('0xf')](function(_0x5d581b){logger['info'](_0x1126('0x10'),_0x59cfa1,'request\x20sent');logger[_0x1126('0x11')](_0x1126('0x12'),_0x59cfa1,_0x1126('0x13'),JSON[_0x1126('0x14')](_0x5d581b));if(_0x5d581b[_0x1126('0x15')]){if(_0x5d581b[_0x1126('0x15')][_0x1126('0x16')]===0x1f4){logger[_0x1126('0x15')](_0x1126('0x10'),_0x59cfa1,_0x5d581b['error']['message']);return _0x167ef1(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x5d581b[_0x1126('0x15')]['message']);return _0x18dbe6(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}else{logger[_0x1126('0x18')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x1126('0x13'));_0x18dbe6(_0x5d581b[_0x1126('0x19')]['message']);}})['catch'](function(_0x22ae0b){logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x22ae0b);_0x167ef1(_0x22ae0b);});});}exports['GetMailAccount']=function(_0x4564c0){var _0x58b109=this;return new Promise(function(_0x22ed37,_0x1d6d19){return db[_0x1126('0x1a')]['findAll']({'raw':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4564c0[_0x1126('0x1b')]?_0x4564c0[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1d')]||null:null,'limit':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1e')]||null:null,'include':_0x4564c0['options']?_0x4564c0['options']['include']?_[_0x1126('0x1f')](_0x4564c0[_0x1126('0x1b')][_0x1126('0x20')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x21')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1d')],'include':_0x34bcf1[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x21')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1d')],'include':_0x35eec3['include']?_['map'](_0x35eec3[_0x1126('0x20')],function(_0x39bf0e){return{'model':db[_0x39bf0e['model']],'as':_0x39bf0e['as'],'attributes':_0x39bf0e[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x4a334a){logger[_0x1126('0x18')]('GetMailAccount',_0x4564c0);logger[_0x1126('0x11')]('GetMailAccount',_0x4564c0,JSON[_0x1126('0x14')](_0x4a334a));_0x22ed37(_0x4a334a);})['catch'](function(_0x378f4d){logger['error']('GetMailAccount',_0x378f4d['message'],_0x4564c0);_0x1d6d19(_0x58b109[_0x1126('0x15')](0x1f4,_0x378f4d[_0x1126('0x17')]));});});};exports[_0x1126('0x22')]=function(_0x5b8bea){var _0x2a3055=this;return new Promise(function(_0x226afb,_0x56f7f8){return db[_0x1126('0x1a')][_0x1126('0x23')]({'raw':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b8bea['options']?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['attributes']||null:null,'include':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x20')]?_[_0x1126('0x1f')](_0x5b8bea[_0x1126('0x1b')]['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x21')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1d')],'include':_0x2a0dfe[_0x1126('0x20')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x21')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes'],'include':_0x22827a[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x22827a[_0x1126('0x20')],function(_0x5c08b9){return{'model':db[_0x5c08b9['model']],'as':_0x5c08b9['as'],'attributes':_0x5c08b9[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x3aa08f){if(_0x5b8bea[_0x1126('0x1b')]['smtp']===!![])_0x3aa08f[_0x1126('0x24')]('smtpOptions',_0x3aa08f[_0x1126('0x25')]());logger[_0x1126('0x18')](_0x1126('0x22'),_0x5b8bea);logger[_0x1126('0x11')](_0x1126('0x22'),_0x5b8bea,JSON['stringify'](_0x3aa08f));_0x226afb(_0x3aa08f);})[_0x1126('0x26')](function(_0x3ea9de){logger[_0x1126('0x15')](_0x1126('0x22'),_0x3ea9de[_0x1126('0x17')],_0x5b8bea);_0x56f7f8(_0x2a3055[_0x1126('0x15')](0x1f4,_0x3ea9de[_0x1126('0x17')]));});});};exports['NotifyMailAccount']=function(_0x1c8d8a){var _0x154c28=this;return new Promise(function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'body':_0x1c8d8a['body'],'channel':'mail'};var _0x1c4f06=_[_0x1126('0x27')](_[_0x1126('0x28')](db[_0x1126('0x29')][_0x1126('0x2a')]),[_0x1126('0x2b'),'updatedAt','CompanyId','ListId']);var _0xb8054e=![];if(_0x1c8d8a['body']['id']){delete _0x1c8d8a[_0x1126('0x2c')]['id'];}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')])||_0x1c8d8a['body'][_0x1126('0x2c')]===''){return _0xf3a0bd(_0x154c28['error'](0x1f4,_0x1126('0x2f')));}if(_['isNil'](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}if(!_[_0x1126('0x31')](_0x1c4f06,_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}var _0x4dd7f5={};_0x4dd7f5[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x1a')][_0x1126('0x23')]({'where':{'id':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db[_0x1126('0x33')],'as':_0x1126('0x34'),'include':[{'model':db['CmContact'],'as':_0x1126('0x35'),'where':_0x4dd7f5,'limit':0x1,'order':[[_0x1126('0x36'),'DESC']]}]},{'model':db[_0x1126('0x37')],'as':_0x1126('0x38')},{'model':db['MailServerOut'],'as':_0x1126('0x39'),'include':[{'model':db[_0x1126('0x3a')],'as':'CloudProvider'}]}]})[_0x1126('0xf')](function(_0xbdde58){if(_0xbdde58&&_0xbdde58[_0x1126('0x34')]){var _0x59656d=_0xbdde58[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x32')]=_[_0x1126('0x3c')](_0x59656d,[_0x1126('0x38'),_0x1126('0x34')]);_0xcf0483[_0x1126('0x32')][_0x1126('0x3d')]=_0xbdde58[_0x1126('0x25')]();_0xcf0483['applications']=_0x59656d[_0x1126('0x38')];_0xcf0483['list']=_0x59656d[_0x1126('0x34')];_0xcf0483[_0x1126('0x3e')]=_['orderBy'](_0xcf0483['applications'],[_0x1126('0x3f')],[_0x1126('0x40')]);if(_0xcf0483[_0x1126('0x32')]&&_0xcf0483['account'][_0x1126('0x41')]){_0xcf0483[_0x1126('0x3e')][_0x1126('0x42')]({'id':0x0,'priority':_0xcf0483[_0x1126('0x3e')]['length']+0x1,'app':_0x1126('0x43'),'appdata':_0x1126('0x41'),'interval':'*,*,*,*'});}if(_0xcf0483['account']['Applications']){delete _0xcf0483['account'][_0x1126('0x38')];}if(_0xcf0483[_0x1126('0x32')]['List']){delete _0xcf0483[_0x1126('0x32')][_0x1126('0x34')];}if(_0x59656d[_0x1126('0x34')][_0x1126('0x35')][_0x1126('0x44')]){return _0x59656d['List'][_0x1126('0x35')][0x0];}var _0x267592=_['defaults'](_0x1c8d8a[_0x1126('0x2c')],{'firstName':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')],'ListId':_0x59656d[_0x1126('0x45')]});_0x267592[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x29')][_0x1126('0x46')](_0x267592);}else{throw new Error(_0x1126('0x47'));}})['then'](function(_0x427add){_0xcf0483[_0x1126('0x48')]=_0x427add;if(_0x427add){if(!_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x49')]){_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')]=rs[_0x1126('0x4a')]()+'\x20'+_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')];}var _0x26949c={'ContactId':_0x427add['id'],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id'],'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'cc':_0x1c8d8a[_0x1126('0x2c')]['message']['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x4b')],'lastMsgAt':moment()[_0x1126('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x1126('0x4d')][_0x1126('0x23')]({'where':{'closed':![],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db['MailMessage'],'as':_0x1126('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x4f')]}}]})[_0x1126('0xf')](function(_0x1230e9){if(_0x1230e9){return[_0x1230e9,![]];}return db[_0x1126('0x4d')][_0x1126('0x46')](_0x26949c)[_0x1126('0xf')](function(_0x5036d4){return[_0x5036d4,!![]];});});}else{throw new Error(_0x1126('0x50'));}})[_0x1126('0x51')](function(_0x116867,_0xc39c36){if(_0x116867){_0xb8054e=_0xc39c36;if(!_0xc39c36){return _0x116867[_0x1126('0x52')]({'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message']['messageId'],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['from'],'cc':_0x1c8d8a['body']['message']['cc'],'subject':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x53')],'attach':_0x116867[_0x1126('0x4b')]?_0x116867['attach']:_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'substatus':null,'substatusAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgDirection':'in'});}else{return _0x116867;}}})['then'](function(_0x339aa6){_0xcf0483[_0x1126('0x55')]=_0x339aa6[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x55')][_0x1126('0x56')]=_0xb8054e;return db['MailMessage']['create']({'body':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')],'MailAccountId':_0x1c8d8a['account']['id'],'MailInteractionId':_0x339aa6['id'],'direction':'in','ContactId':_0xcf0483[_0x1126('0x48')]['id'],'messageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x49')],'from':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['to'],'cc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'Attachments':_0x1c8d8a['body']['message'][_0x1126('0x57')],'originTo':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x58')],'originCc':_0x1c8d8a['body']['message']['originCc'],'bcc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x59')],'ChatWebsiteId':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x5a')]||null,'originChannel':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x5b')]||_0x1126('0x5c'),'ChatOfflineMessageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x5d')]||null},{'include':[{'model':db[_0x1126('0x5e')],'as':'Attachments'}]});})[_0x1126('0xf')](function(_0x57ece2){_0xcf0483[_0x1126('0x17')]=_0x57ece2;if(_0xcf0483[_0x1126('0x55')]['UserId']){return db[_0x1126('0x5f')][_0x1126('0x23')]({'attributes':['id','name'],'where':{'id':_0xcf0483[_0x1126('0x55')][_0x1126('0x60')]}})['then'](function(_0x561647){if(_0x561647){_0xcf0483[_0x1126('0x3e')][_0x1126('0x61')]({'id':0x0,'priority':0x0,'app':_0x1126('0x62'),'appdata':_0x561647['name']+','+(_0xcf0483['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1126('0x63')});}return respondWithRpcPromise('Start','startRouting',_0xcf0483);});}return respondWithRpcPromise(_0x1126('0x64'),'startRouting',_0xcf0483);})[_0x1126('0xf')](function(_0x288a0c){_0x227a6b(_0x288a0c);})['catch'](function(_0x133075){_0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,_0x133075[_0x1126('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 500d748..f024375 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 _0xfe4a=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x33fa44,_0x94567b){var _0x59d9dc=function(_0x408898){while(--_0x408898){_0x33fa44['push'](_0x33fa44['shift']());}};_0x59d9dc(++_0x94567b);}(_0xfe4a,0x10b));var _0xafe4=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xfe4a[_0x487b0c];return _0x1adbdc;};'use strict';var MailAccountEvents=require(_0xafe4('0x0'));var events=[_0xafe4('0x1'),_0xafe4('0x2'),_0xafe4('0x3')];function createListener(_0x43b9f9,_0x3129f5){return function(_0xc93683){_0x3129f5[_0xafe4('0x4')](_0x43b9f9,_0xc93683);};}function removeListener(_0x558a0d,_0x273416){return function(){MailAccountEvents[_0xafe4('0x5')](_0x558a0d,_0x273416);};}exports[_0xafe4('0x6')]=function(_0xc7b0c9){for(var _0x50583f=0x0,_0x7716b7=events[_0xafe4('0x7')];_0x50583f<_0x7716b7;_0x50583f++){var _0x56864c=events[_0x50583f];var _0x45a533=createListener(_0xafe4('0x8')+_0x56864c,_0xc7b0c9);MailAccountEvents['on'](_0x56864c,_0x45a533);}}; \ No newline at end of file +var _0xe19e=['remove','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xe19e,0x180));var _0xee19=function(_0x5a99cd,_0x4adaa4){_0x5a99cd=_0x5a99cd-0x0;var _0x1a10e9=_0xe19e[_0x5a99cd];return _0x1a10e9;};'use strict';var MailAccountEvents=require(_0xee19('0x0'));var events=['save',_0xee19('0x1'),'update'];function createListener(_0x48d81c,_0x51d653){return function(_0x4418b8){_0x51d653['emit'](_0x48d81c,_0x4418b8);};}function removeListener(_0x1e72dc,_0xa2c8c6){return function(){MailAccountEvents[_0xee19('0x2')](_0x1e72dc,_0xa2c8c6);};}exports['register']=function(_0x457fd1){for(var _0x491cc3=0x0,_0x4b7b5b=events[_0xee19('0x3')];_0x491cc3<_0x4b7b5b;_0x491cc3++){var _0x2dea24=events[_0x491cc3];var _0x167143=createListener(_0xee19('0x4')+_0x2dea24,_0x457fd1);MailAccountEvents['on'](_0x2dea24,_0x167143);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9e97623..af6e936 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 _0x8817=['/:id','show','put','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x33b1fe,_0x3f1df4){var _0x597100=function(_0x2d86a4){while(--_0x2d86a4){_0x33b1fe['push'](_0x33b1fe['shift']());}};_0x597100(++_0x3f1df4);}(_0x8817,0x17f));var _0x7881=function(_0x4de6d2,_0x2e961e){_0x4de6d2=_0x4de6d2-0x0;var _0x2c290f=_0x8817[_0x4de6d2];return _0x2c290f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7881('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7881('0x1')]();var fs_extra=require(_0x7881('0x2'));var auth=require(_0x7881('0x3'));var interaction=require(_0x7881('0x4'));var config=require('../../config/environment');var controller=require(_0x7881('0x5'));router[_0x7881('0x6')](_0x7881('0x7'),auth['isAuthenticated'](),controller[_0x7881('0x8')]);router[_0x7881('0x9')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7881('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7881('0xb')]);module[_0x7881('0xc')]=router; \ No newline at end of file +var _0x0c34=['./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x8fb7a4,_0x607700){var _0x1fdca2=function(_0x300754){while(--_0x300754){_0x8fb7a4['push'](_0x8fb7a4['shift']());}};_0x1fdca2(++_0x607700);}(_0x0c34,0x1e8));var _0x40c3=function(_0x4ac29b,_0x4dc928){_0x4ac29b=_0x4ac29b-0x0;var _0x2fa46b=_0x0c34[_0x4ac29b];return _0x2fa46b;};'use strict';var multer=require(_0x40c3('0x0'));var util=require('util');var path=require(_0x40c3('0x1'));var timeout=require(_0x40c3('0x2'));var express=require(_0x40c3('0x3'));var router=express[_0x40c3('0x4')]();var fs_extra=require(_0x40c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x40c3('0x6'));var config=require('../../config/environment');var controller=require(_0x40c3('0x7'));router[_0x40c3('0x8')](_0x40c3('0x9'),auth[_0x40c3('0xa')](),controller[_0x40c3('0xb')]);router['put'](_0x40c3('0x9'),auth['isAuthenticated'](),controller[_0x40c3('0xc')]);router[_0x40c3('0xd')]('/:id',auth[_0x40c3('0xa')](),controller[_0x40c3('0xe')]);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 3f71973..101cca4 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 _0x9368=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0xef19e7,_0x52291d){var _0x49b411=function(_0x43eda7){while(--_0x43eda7){_0xef19e7['push'](_0xef19e7['shift']());}};_0x49b411(++_0x52291d);}(_0x9368,0xdf));var _0x8936=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x9368[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require(_0x8936('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8936('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8936('0x2')],'allowNull':![],'defaultValue':_0x8936('0x3')},'appdata':{'type':Sequelize[_0x8936('0x4')]()},'description':{'type':Sequelize[_0x8936('0x2')]},'interval':{'type':Sequelize[_0x8936('0x2')],'defaultValue':_0x8936('0x5')}}; \ No newline at end of file +var _0x081d=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x081d,0x19e));var _0xd081=function(_0x16a4b8,_0x42f23b){_0x16a4b8=_0x16a4b8-0x0;var _0x48cc58=_0x081d[_0x16a4b8];return _0x48cc58;};'use strict';var Sequelize=require(_0xd081('0x0'));module[_0xd081('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd081('0x2')],'allowNull':![],'defaultValue':_0xd081('0x3')},'appdata':{'type':Sequelize[_0xd081('0x4')]()},'description':{'type':Sequelize[_0xd081('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd081('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index dbff9f9..0676fb6 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x58b4b2,_0xda87c4){var _0x262740=function(_0x59e0bb){while(--_0x59e0bb){_0x58b4b2['push'](_0x58b4b2['shift']());}};_0x262740(++_0xda87c4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xcb91[_0x3a1ea5];return _0xfac9b2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x2035e1,_0x35570e){var _0x400301=function(_0x3cc4f4){while(--_0x3cc4f4){_0x2035e1['push'](_0x2035e1['shift']());}};_0x400301(++_0x35570e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xcb91[_0x5774be];return _0x4914b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 909cea9..06537c7 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 _0x75fe=['exports','define','MailApplication','mail_applications','lodash','util','api','moment','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x75fe,0x1a6));var _0xe75f=function(_0x31f2bd,_0x255133){_0x31f2bd=_0x31f2bd-0x0;var _0x12b101=_0x75fe[_0x31f2bd];return _0x12b101;};'use strict';var _=require(_0xe75f('0x0'));var util=require(_0xe75f('0x1'));var logger=require('../../config/logger')(_0xe75f('0x2'));var moment=require(_0xe75f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe75f('0x4'));var config=require(_0xe75f('0x5'));var attributes=require(_0xe75f('0x6'));module[_0xe75f('0x7')]=function(_0x2d586c,_0x2fa3a3){return _0x2d586c[_0xe75f('0x8')](_0xe75f('0x9'),attributes,{'tableName':_0xe75f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6e9f=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e9f,0x173));var _0xf6e9=function(_0x315d3e,_0x4ae0df){_0x315d3e=_0x315d3e-0x0;var _0x557a8a=_0x6e9f[_0x315d3e];return _0x557a8a;};'use strict';var _=require(_0xf6e9('0x0'));var util=require(_0xf6e9('0x1'));var logger=require(_0xf6e9('0x2'))(_0xf6e9('0x3'));var moment=require(_0xf6e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6e9('0x6'));var config=require(_0xf6e9('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x1b3050,_0x8a1917){return _0x1b3050[_0xf6e9('0x8')](_0xf6e9('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6e9('0xa'),'collate':_0xf6e9('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b87608e..b6139b2 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 _0x82db=['request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x82db,0x128));var _0xb82d=function(_0x46f3fa,_0x345911){_0x46f3fa=_0x46f3fa-0x0;var _0x3aad8a=_0x82db[_0x46f3fa];return _0x3aad8a;};'use strict';var _=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var moment=require(_0xb82d('0x2'));var BPromise=require(_0xb82d('0x3'));var rs=require(_0xb82d('0x4'));var fs=require('fs');var Redis=require(_0xb82d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb82d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb82d('0x7'));var jayson=require(_0xb82d('0x8'));var client=jayson[_0xb82d('0x9')][_0xb82d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16a1a8,_0x439691,_0x6d6300){return new BPromise(function(_0x51d479,_0x2e7613){return client[_0xb82d('0xb')](_0x16a1a8,_0x6d6300)[_0xb82d('0xc')](function(_0x125fff){logger['info'](_0xb82d('0xd'),_0x439691,_0xb82d('0xe'));logger[_0xb82d('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x439691,_0xb82d('0xe'),JSON[_0xb82d('0x10')](_0x125fff));if(_0x125fff[_0xb82d('0x11')]){if(_0x125fff[_0xb82d('0x11')][_0xb82d('0x12')]===0x1f4){logger[_0xb82d('0x11')](_0xb82d('0xd'),_0x439691,_0x125fff[_0xb82d('0x11')]['message']);return _0x2e7613(_0x125fff[_0xb82d('0x11')][_0xb82d('0x13')]);}logger[_0xb82d('0x11')]('MailApplication,\x20%s,\x20%s',_0x439691,_0x125fff[_0xb82d('0x11')]['message']);return _0x51d479(_0x125fff['error'][_0xb82d('0x13')]);}else{logger[_0xb82d('0x14')]('MailApplication,\x20%s,\x20%s',_0x439691,_0xb82d('0xe'));_0x51d479(_0x125fff[_0xb82d('0x15')][_0xb82d('0x13')]);}})[_0xb82d('0x16')](function(_0x3336d6){logger['error']('MailApplication,\x20%s,\x20%s',_0x439691,_0x3336d6);_0x2e7613(_0x3336d6);});});}exports[_0xb82d('0x17')]=function(_0xbb3dae){var _0x5c57fa=this;return new Promise(function(_0x3b423e,_0x11fb94){return db[_0xb82d('0x18')]['update'](_0xbb3dae[_0xb82d('0x19')],{'raw':_0xbb3dae[_0xb82d('0x1a')]?_0xbb3dae[_0xb82d('0x1a')][_0xb82d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb3dae[_0xb82d('0x1a')]?_0xbb3dae[_0xb82d('0x1a')][_0xb82d('0x1c')]||null:null,'attributes':_0xbb3dae[_0xb82d('0x1a')]?_0xbb3dae[_0xb82d('0x1a')][_0xb82d('0x1d')]||null:null,'limit':_0xbb3dae[_0xb82d('0x1a')]?_0xbb3dae[_0xb82d('0x1a')][_0xb82d('0x1e')]||null:null})[_0xb82d('0xc')](function(_0x2fa5c4){logger[_0xb82d('0x14')](_0xb82d('0x17'),_0xbb3dae);logger[_0xb82d('0xf')](_0xb82d('0x17'),_0xbb3dae,JSON[_0xb82d('0x10')](_0x2fa5c4));_0x3b423e(_0x2fa5c4);})[_0xb82d('0x16')](function(_0x17e041){logger[_0xb82d('0x11')](_0xb82d('0x17'),_0x17e041['message'],_0xbb3dae);_0x11fb94(_0x5c57fa[_0xb82d('0x11')](0x1f4,_0x17e041[_0xb82d('0x13')]));});});}; \ No newline at end of file +var _0x3e88=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3e88,0x143));var _0x83e8=function(_0x1aaf95,_0x2150c0){_0x1aaf95=_0x1aaf95-0x0;var _0x1a5651=_0x3e88[_0x1aaf95];return _0x1a5651;};'use strict';var _=require(_0x83e8('0x0'));var util=require(_0x83e8('0x1'));var moment=require(_0x83e8('0x2'));var BPromise=require(_0x83e8('0x3'));var rs=require(_0x83e8('0x4'));var fs=require('fs');var Redis=require(_0x83e8('0x5'));var db=require(_0x83e8('0x6'))['db'];var utils=require(_0x83e8('0x7'));var logger=require(_0x83e8('0x8'))(_0x83e8('0x9'));var config=require(_0x83e8('0xa'));var jayson=require(_0x83e8('0xb'));var client=jayson[_0x83e8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162188,_0x794c1,_0x403b7a){return new BPromise(function(_0x45f92f,_0x37e8cd){return client[_0x83e8('0xd')](_0x162188,_0x403b7a)[_0x83e8('0xe')](function(_0x2267bb){logger[_0x83e8('0xf')]('MailApplication,\x20%s,\x20%s',_0x794c1,_0x83e8('0x10'));logger[_0x83e8('0x11')](_0x83e8('0x12'),_0x794c1,_0x83e8('0x10'),JSON[_0x83e8('0x13')](_0x2267bb));if(_0x2267bb[_0x83e8('0x14')]){if(_0x2267bb['error'][_0x83e8('0x15')]===0x1f4){logger[_0x83e8('0x14')](_0x83e8('0x16'),_0x794c1,_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);return _0x37e8cd(_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);}logger['error'](_0x83e8('0x16'),_0x794c1,_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);return _0x45f92f(_0x2267bb['error'][_0x83e8('0x17')]);}else{logger[_0x83e8('0xf')](_0x83e8('0x16'),_0x794c1,_0x83e8('0x10'));_0x45f92f(_0x2267bb[_0x83e8('0x18')][_0x83e8('0x17')]);}})[_0x83e8('0x19')](function(_0x4ec21a){logger[_0x83e8('0x14')](_0x83e8('0x16'),_0x794c1,_0x4ec21a);_0x37e8cd(_0x4ec21a);});});}exports[_0x83e8('0x1a')]=function(_0x321cbf){var _0x1c028a=this;return new Promise(function(_0x18b54e,_0x6c85e4){return db[_0x83e8('0x1b')][_0x83e8('0x1c')](_0x321cbf[_0x83e8('0x1d')],{'raw':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321cbf['options']?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x20')]||null:null,'attributes':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')]['attributes']||null:null,'limit':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x21')]||null:null})[_0x83e8('0xe')](function(_0x53d57f){logger[_0x83e8('0xf')]('UpdateMailApplication',_0x321cbf);logger[_0x83e8('0x11')](_0x83e8('0x1a'),_0x321cbf,JSON[_0x83e8('0x13')](_0x53d57f));_0x18b54e(_0x53d57f);})[_0x83e8('0x19')](function(_0x37e489){logger[_0x83e8('0x14')](_0x83e8('0x1a'),_0x37e489[_0x83e8('0x17')],_0x321cbf);_0x6c85e4(_0x1c028a['error'](0x1f4,_0x37e489[_0x83e8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 491ee62..614867f 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 _0xc863=['/:id/tags','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','mail','mailinteraction:addtags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy'];(function(_0x8693ed,_0x140c3b){var _0x57b7be=function(_0x224641){while(--_0x224641){_0x8693ed['push'](_0x8693ed['shift']());}};_0x57b7be(++_0x140c3b);}(_0xc863,0x155));var _0x3c86=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xc863[_0x2dd390];return _0x3afe47;};'use strict';var express=require(_0x3c86('0x0'));var router=express[_0x3c86('0x1')]();var auth=require(_0x3c86('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x3c86('0x3'));router[_0x3c86('0x4')]('/',auth[_0x3c86('0x5')](),controller[_0x3c86('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3c86('0x7')]);router['get'](_0x3c86('0x8'),auth[_0x3c86('0x5')](),controller['show']);router['get'](_0x3c86('0x9'),auth[_0x3c86('0x5')](),controller[_0x3c86('0xa')]);router[_0x3c86('0x4')](_0x3c86('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x3c86('0xc')]('/',auth['isAuthenticated'](),controller[_0x3c86('0xd')]);router[_0x3c86('0xc')]('/:id/messages',auth[_0x3c86('0x5')](),controller[_0x3c86('0xe')]);router['post']('/:id/tags',auth[_0x3c86('0x5')](),interaction['tracked'](_0x3c86('0xf'),_0x3c86('0x10')),controller['addTags']);router['put']('/:id',auth[_0x3c86('0x5')](),interaction[_0x3c86('0x11')](_0x3c86('0xf'),_0x3c86('0x12')),controller[_0x3c86('0x13')]);router[_0x3c86('0x14')]('/:id',auth[_0x3c86('0x5')](),interaction[_0x3c86('0x11')]('mail',_0x3c86('0x15')),controller[_0x3c86('0x16')]);router[_0x3c86('0x14')](_0x3c86('0x17'),auth[_0x3c86('0x5')](),controller[_0x3c86('0x18')]);module[_0x3c86('0x19')]=router; \ No newline at end of file +var _0xc4d4=['index','get','describe','/:id','/:id/messages','getMessages','download','post','/:id/tags','mailinteraction:addtags','addTags','tracked','mail','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xc4d4,0x1ee));var _0x4c4d=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0xc4d4[_0x39a04c];return _0x580cb0;};'use strict';var express=require(_0x4c4d('0x0'));var router=express[_0x4c4d('0x1')]();var auth=require(_0x4c4d('0x2'));var interaction=require(_0x4c4d('0x3'));var controller=require(_0x4c4d('0x4'));router['get']('/',auth[_0x4c4d('0x5')](),controller[_0x4c4d('0x6')]);router[_0x4c4d('0x7')]('/describe',auth[_0x4c4d('0x5')](),controller[_0x4c4d('0x8')]);router[_0x4c4d('0x7')](_0x4c4d('0x9'),auth[_0x4c4d('0x5')](),controller['show']);router['get'](_0x4c4d('0xa'),auth[_0x4c4d('0x5')](),controller[_0x4c4d('0xb')]);router[_0x4c4d('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x4c4d('0xc')]);router[_0x4c4d('0xd')]('/',auth[_0x4c4d('0x5')](),controller['create']);router[_0x4c4d('0xd')](_0x4c4d('0xa'),auth[_0x4c4d('0x5')](),controller['addMessage']);router[_0x4c4d('0xd')](_0x4c4d('0xe'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x4c4d('0xf')),controller[_0x4c4d('0x10')]);router['put'](_0x4c4d('0x9'),auth[_0x4c4d('0x5')](),interaction[_0x4c4d('0x11')](_0x4c4d('0x12'),_0x4c4d('0x13')),controller[_0x4c4d('0x14')]);router['delete']('/:id',auth[_0x4c4d('0x5')](),interaction[_0x4c4d('0x11')](_0x4c4d('0x12'),_0x4c4d('0x15')),controller[_0x4c4d('0x16')]);router[_0x4c4d('0x17')](_0x4c4d('0xe'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4c4d('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 6ccfbd2..31842d1 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 _0xa2fb=['ENUM','out','sequelize','iconv','exports','DATE','STRING','TEXT','long','BOOLEAN'];(function(_0x578b1e,_0x16b8a0){var _0x5088a8=function(_0x43f6f5){while(--_0x43f6f5){_0x578b1e['push'](_0x578b1e['shift']());}};_0x5088a8(++_0x16b8a0);}(_0xa2fb,0x188));var _0xba2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2fb[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xba2f('0x0'));var iconv=require(_0xba2f('0x1'));module[_0xba2f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xba2f('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xba2f('0x4')]},'note':{'type':Sequelize[_0xba2f('0x4')]},'inReplyTo':{'type':Sequelize[_0xba2f('0x4')](0x1fe)},'to':{'type':Sequelize[_0xba2f('0x4')]},'cc':{'type':Sequelize[_0xba2f('0x5')](_0xba2f('0x6'))},'subject':{'type':Sequelize[_0xba2f('0x5')]()},'attach':{'type':Sequelize[_0xba2f('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xba2f('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xba2f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xba2f('0x8')]('in',_0xba2f('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xba2f('0x8')]('in',_0xba2f('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0734=['sequelize','iconv','exports','DATE','STRING','TEXT','long','ENUM','out','BOOLEAN'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x0734,0xfa));var _0x4073=function(_0x220892,_0xc6873f){_0x220892=_0x220892-0x0;var _0x43a676=_0x0734[_0x220892];return _0x43a676;};'use strict';var Sequelize=require(_0x4073('0x0'));var iconv=require(_0x4073('0x1'));module[_0x4073('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4073('0x3')]},'disposition':{'type':Sequelize[_0x4073('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4073('0x4')]},'note':{'type':Sequelize[_0x4073('0x4')]},'inReplyTo':{'type':Sequelize[_0x4073('0x4')](0x1fe)},'to':{'type':Sequelize[_0x4073('0x4')]},'cc':{'type':Sequelize[_0x4073('0x5')](_0x4073('0x6'))},'subject':{'type':Sequelize[_0x4073('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4073('0x3')]},'substatus':{'type':Sequelize[_0x4073('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x4073('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4073('0x7')]('in',_0x4073('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4073('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4073('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4073('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index bd5eda6..baafc3f 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 _0x111c=['MailInteraction','query','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','MailMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','MailInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','count','inlineCss','true','rows','addTags','setTags','ids','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','attachments','push','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','moment','bluebird','path','juice','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','user','catch','show','params','model'];(function(_0x2c6ec7,_0x20a1b2){var _0x107019=function(_0x4138af){while(--_0x4138af){_0x2c6ec7['push'](_0x2c6ec7['shift']());}};_0x107019(++_0x20a1b2);}(_0x111c,0x1a0));var _0xc111=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x111c[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xc111('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc111('0x1'));var moment=require(_0xc111('0x2'));var BPromise=require(_0xc111('0x3'));var util=require('util');var path=require(_0xc111('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0xc111('0x5'));var Redis=require(_0xc111('0x6'));var interaction=require(_0xc111('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xc111('0x8'))(_0xc111('0x9'));var config=require('../../config/environment');var db=require(_0xc111('0xa'))['db'];var htmlEntities=require(_0xc111('0xb'));config[_0xc111('0xc')]=_[_0xc111('0xd')](config[_0xc111('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc111('0xc')]));require(_0xc111('0xe'))[_0xc111('0xf')](socket);function respondWithStatusCode(_0x1a4a7f,_0x404f8e){_0x404f8e=_0x404f8e||0xcc;return function(_0x478c6b){if(_0x478c6b){return _0x1a4a7f[_0xc111('0x10')](_0x404f8e);}return _0x1a4a7f[_0xc111('0x11')](_0x404f8e)[_0xc111('0x12')]();};}function respondWithResult(_0x526b37,_0x341543){_0x341543=_0x341543||0xc8;return function(_0xe55f3a){if(_0xe55f3a){return _0x526b37[_0xc111('0x11')](_0x341543)[_0xc111('0x13')](_0xe55f3a);}};}function respondWithFilteredResult(_0x575650,_0x2aa0bf){return function(_0x2b544b){if(_0x2b544b){var _0x34a5ec=typeof _0x2aa0bf[_0xc111('0x14')]===_0xc111('0x15')&&typeof _0x2aa0bf[_0xc111('0x16')]===_0xc111('0x15');var _0x3e25dc=_0x2b544b['count'];var _0x530504=_0x34a5ec?0x0:_0x2aa0bf[_0xc111('0x14')];var _0x176b85=_0x34a5ec?_0x2b544b['count']:_0x2aa0bf[_0xc111('0x14')]+_0x2aa0bf['limit'];var _0x46b1c3;if(_0x176b85>=_0x3e25dc){_0x176b85=_0x3e25dc;_0x46b1c3=0xc8;}else{_0x46b1c3=0xce;}_0x575650[_0xc111('0x11')](_0x46b1c3);return _0x575650['set'](_0xc111('0x17'),_0x530504+'-'+_0x176b85+'/'+_0x3e25dc)[_0xc111('0x13')](_0x2b544b);}return null;};}function saveUpdates(_0x449e4c){return function(_0x203f86){if(_0x203f86){return _0x203f86[_0xc111('0x18')](_0x449e4c)[_0xc111('0x19')](function(_0x23a818){return _0x23a818;});}return null;};}function removeEntity(_0x2aaee6){return function(_0x46ea40){if(_0x46ea40){return _0x46ea40[_0xc111('0x1a')]()[_0xc111('0x19')](function(){_0x2aaee6[_0xc111('0x11')](0xcc)[_0xc111('0x12')]();});}};}function handleEntityNotFound(_0x2bb43e){return function(_0x30dd1d){if(!_0x30dd1d){_0x2bb43e['sendStatus'](0x194);}return _0x30dd1d;};}function handleError(_0x4b5637,_0xe01f30){_0xe01f30=_0xe01f30||0x1f4;return function(_0x1c74bd){logger[_0xc111('0x1b')](_0x1c74bd[_0xc111('0x1c')]);if(_0x1c74bd['name']){delete _0x1c74bd[_0xc111('0x1d')];}_0x4b5637['status'](_0xe01f30)[_0xc111('0x1e')](_0x1c74bd);};}exports[_0xc111('0x1f')]=function(_0x37b54b,_0xfa82bd){var _0x37c9be={};var _0x30d3fc=_[_0xc111('0x20')](db['MailInteraction'][_0xc111('0x21')],function(_0x31438f){return{'name':_0x31438f[_0xc111('0x22')],'type':_0x31438f[_0xc111('0x23')][_0xc111('0x24')]};});_0x37c9be=qs[_0xc111('0x25')](_0x30d3fc,_0x37b54b);return interaction[_0xc111('0x26')]('mail',_0x37b54b['query'],_0x37b54b[_0xc111('0x27')],_0x37c9be,_0x30d3fc)[_0xc111('0x19')](respondWithFilteredResult(_0xfa82bd,_0x37c9be))[_0xc111('0x28')](handleError(_0xfa82bd,null));};exports[_0xc111('0x29')]=function(_0x2a4e52,_0x4da55e){var _0x2c9572={'raw':![],'where':{'id':_0x2a4e52[_0xc111('0x2a')]['id']}},_0x24ee8f={};_0x24ee8f[_0xc111('0x2b')]=_['keys'](db[_0xc111('0x2c')]['rawAttributes']);_0x24ee8f[_0xc111('0x2d')]=_[_0xc111('0x2e')](_0x2a4e52[_0xc111('0x2d')]);_0x24ee8f[_0xc111('0x2f')]=_[_0xc111('0x30')](_0x24ee8f[_0xc111('0x2b')],_0x24ee8f['query']);_0x2c9572[_0xc111('0x31')]=_[_0xc111('0x30')](_0x24ee8f[_0xc111('0x2b')],qs[_0xc111('0x32')](_0x2a4e52['query'][_0xc111('0x32')]));_0x2c9572['attributes']=_0x2c9572['attributes'][_0xc111('0x33')]?_0x2c9572[_0xc111('0x31')]:_0x24ee8f[_0xc111('0x2b')];if(_0x2a4e52[_0xc111('0x2d')][_0xc111('0x34')]){_0x2c9572[_0xc111('0x35')]=[{'all':!![]}];}_0x2c9572=_['merge']({},_0x2c9572,_0x2a4e52['options']);return db[_0xc111('0x2c')][_0xc111('0x36')](_0x2c9572)[_0xc111('0x19')](handleEntityNotFound(_0x4da55e,null))[_0xc111('0x19')](respondWithResult(_0x4da55e,null))[_0xc111('0x28')](handleError(_0x4da55e,null));};exports[_0xc111('0x37')]=function(_0x519861,_0x37ca0c){return db[_0xc111('0x2c')][_0xc111('0x37')](_0x519861[_0xc111('0x38')],{})[_0xc111('0x19')](respondWithResult(_0x37ca0c,0xc9))[_0xc111('0x28')](handleError(_0x37ca0c,null));};exports[_0xc111('0x18')]=function(_0x15fdbc,_0x1c9bad){if(_0x15fdbc['body']['id']){delete _0x15fdbc['body']['id'];}return db[_0xc111('0x2c')]['find']({'where':{'id':_0x15fdbc[_0xc111('0x2a')]['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x1c9bad,null))[_0xc111('0x19')](saveUpdates(_0x15fdbc[_0xc111('0x38')],null))[_0xc111('0x19')](respondWithResult(_0x1c9bad,null))['catch'](handleError(_0x1c9bad,null));};exports[_0xc111('0x1a')]=function(_0x182419,_0x401a28){return db[_0xc111('0x2c')]['find']({'where':{'id':_0x182419['params']['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x401a28,null))['then'](removeEntity(_0x401a28,null))[_0xc111('0x28')](handleError(_0x401a28,null));};exports[_0xc111('0x39')]=function(_0x413ebb,_0x1d32d7){return db[_0xc111('0x2c')][_0xc111('0x39')]()[_0xc111('0x19')](respondWithResult(_0x1d32d7,null))[_0xc111('0x28')](handleError(_0x1d32d7,null));};exports[_0xc111('0x3a')]=function(_0x2a838e,_0x403814){return db[_0xc111('0x3b')][_0xc111('0x36')]({'where':{'id':_0x2a838e[_0xc111('0x2a')]['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x403814,null))[_0xc111('0x19')](function(_0x255b25){if(_0x255b25){return _0x255b25[_0xc111('0x3a')](_0x2a838e['body']['ids'],_[_0xc111('0x3c')](_0x2a838e[_0xc111('0x38')],['ids','id'])||{});}})[_0xc111('0x19')](respondWithResult(_0x403814,null))[_0xc111('0x28')](handleError(_0x403814,null));};exports[_0xc111('0x3d')]=function(_0x3c7a07,_0x41ee7d){var _0x491852={'raw':![],'where':{}};var _0xdc215e={};var _0x381d81={'count':0x0,'rows':[]};return db[_0xc111('0x2c')][_0xc111('0x3e')]({'where':{'id':_0x3c7a07[_0xc111('0x2a')]['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x41ee7d,null))[_0xc111('0x19')](function(_0x504cf5){if(_0x504cf5){_0xdc215e[_0xc111('0x2b')]=_[_0xc111('0x2e')](db[_0xc111('0x3b')][_0xc111('0x21')]);_0xdc215e[_0xc111('0x2d')]=_['keys'](_0x3c7a07[_0xc111('0x2d')]);_0xdc215e[_0xc111('0x2f')]=_[_0xc111('0x30')](_0xdc215e[_0xc111('0x2b')],_0xdc215e['query']);_0x491852[_0xc111('0x31')]=_[_0xc111('0x30')](_0xdc215e[_0xc111('0x2b')],qs['fields'](_0x3c7a07[_0xc111('0x2d')]['fields']));_0x491852[_0xc111('0x31')]=_0x491852[_0xc111('0x31')][_0xc111('0x33')]?_0x491852['attributes']:_0xdc215e[_0xc111('0x2b')];if(!_0x3c7a07[_0xc111('0x2d')][_0xc111('0x3f')](_0xc111('0x40'))){_0x491852[_0xc111('0x16')]=qs['limit'](_0x3c7a07[_0xc111('0x2d')][_0xc111('0x16')]);_0x491852['offset']=qs[_0xc111('0x14')](_0x3c7a07[_0xc111('0x2d')][_0xc111('0x14')]);}_0x491852['order']=qs['sort'](_0x3c7a07['query'][_0xc111('0x41')]);_0x491852['where']=qs[_0xc111('0x2f')](_['pick'](_0x3c7a07[_0xc111('0x2d')],_0xdc215e['filters']));_0x491852[_0xc111('0x42')][_0xc111('0x43')]=_0x504cf5['id'];if(_0x3c7a07[_0xc111('0x2d')]['filter']){_0x491852[_0xc111('0x42')]=_[_0xc111('0x44')](_0x491852['where'],{'$or':_[_0xc111('0x20')](_0x491852[_0xc111('0x31')],function(_0xcc866d){var _0x7e1a69={};_0x7e1a69[_0xcc866d]={'$like':'%'+_0x3c7a07[_0xc111('0x2d')][_0xc111('0x45')]+'%'};return _0x7e1a69;})});}if(_0x3c7a07[_0xc111('0x2d')][_0xc111('0x46')]){var _0xeda095=_0x3c7a07[_0xc111('0x2d')]['$gte'][_0xc111('0x47')](',');var _0x101076={};_0x101076[_0xeda095[0x0]]={'$gte':moment(_0xeda095[0x1])[_0xc111('0x48')](_0xc111('0x49'))};_0x491852[_0xc111('0x42')]=_[_0xc111('0x44')](_0x491852[_0xc111('0x42')],_0x101076);}_0x491852=_['merge']({},_0x491852,_0x3c7a07[_0xc111('0x4a')]);return db[_0xc111('0x3b')]['count']({'where':_0x491852[_0xc111('0x42')]})[_0xc111('0x19')](function(_0x4681cd){_0x381d81[_0xc111('0x4b')]=_0x4681cd;if(_0x3c7a07[_0xc111('0x2d')]['includeAll']){_0x491852[_0xc111('0x35')]=[{'all':!![]}];}return db[_0xc111('0x3b')]['findAll'](_0x491852);})[_0xc111('0x19')](function(_0x2f25ca){if(_0x3c7a07[_0xc111('0x2d')][_0xc111('0x4c')]===_0xc111('0x4d')){for(var _0x2b3da0=0x0;_0x2b3da0<_0x2f25ca[_0xc111('0x33')];_0x2b3da0++){_0x2f25ca[_0x2b3da0]['body']=juice(_0x2f25ca[_0x2b3da0][_0xc111('0x38')]);}}_0x381d81[_0xc111('0x4e')]=_0x2f25ca;return _0x381d81;});}})[_0xc111('0x19')](respondWithFilteredResult(_0x41ee7d,_0x491852))[_0xc111('0x28')](handleError(_0x41ee7d,null));};exports[_0xc111('0x4f')]=function(_0x14f6e7,_0x24e9fc){return db[_0xc111('0x2c')][_0xc111('0x36')]({'where':{'id':_0x14f6e7[_0xc111('0x2a')]['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x24e9fc,null))[_0xc111('0x19')](function(_0x1e26fd){if(_0x1e26fd){return _0x1e26fd[_0xc111('0x50')](_0x14f6e7[_0xc111('0x38')]['ids'],_[_0xc111('0x3c')](_0x14f6e7[_0xc111('0x38')],[_0xc111('0x51'),'id'])||{})[_0xc111('0x52')](function(){return db['Tag'][_0xc111('0x26')]({'attributes':['id','name',_0xc111('0x53')],'where':{'id':_0x14f6e7[_0xc111('0x38')][_0xc111('0x51')]}});})['then'](function(_0x12ba16){socket[_0xc111('0x54')](_0xc111('0x55'),{'id':Number(_0x14f6e7[_0xc111('0x2a')]['id']),'tags':_0x12ba16||[]});return{'id':Number(_0x14f6e7['params']['id']),'tags':_0x12ba16||[]};});}})[_0xc111('0x19')](respondWithResult(_0x24e9fc,null))['catch'](handleError(_0x24e9fc,null));};exports[_0xc111('0x56')]=function(_0x59ef8b,_0x1bfef4){return db[_0xc111('0x2c')][_0xc111('0x36')]({'where':{'id':_0x59ef8b[_0xc111('0x2a')]['id']}})[_0xc111('0x19')](handleEntityNotFound(_0x1bfef4,null))[_0xc111('0x19')](function(_0x1f30d9){if(_0x1f30d9){return _0x1f30d9[_0xc111('0x56')](_0x59ef8b[_0xc111('0x2d')]['ids']);}})[_0xc111('0x19')](respondWithStatusCode(_0x1bfef4,null))[_0xc111('0x28')](handleError(_0x1bfef4,null));};exports[_0xc111('0x57')]=function(_0x5dbbce,_0x63338b){var _0x31c0a5=moment()[_0xc111('0x58')]()['toString']();var _0xaac90e=path[_0xc111('0x59')](config[_0xc111('0x5a')],_0xc111('0x5b'),_0xc111('0x5c'),_0xc111('0x5d'));var _0x417ee0=path[_0xc111('0x59')](config[_0xc111('0x5a')],_0xc111('0x5b'),'files','attachments');var _0x4bcfec=path[_0xc111('0x59')](_0xaac90e,_0x31c0a5);var _0x4d9e25=util['format'](_0xc111('0x5e'),_0x5dbbce[_0xc111('0x2a')]['id'],_0x31c0a5);var _0x10fa86=path['join'](_0xaac90e,_0x4d9e25);var _0x296330=[];if(_0x5dbbce[_0xc111('0x2d')][_0xc111('0x5f')]){_0x296330[_0xc111('0x60')]({'model':db['Attachment'],'as':_0xc111('0x61'),'raw':!![]});}var _0x48dddf=[{'model':db['MailMessage'],'as':_0xc111('0x62'),'attributes':['id',_0xc111('0x38'),_0xc111('0x63'),'to','cc',_0xc111('0x64'),_0xc111('0x65'),_0xc111('0x66')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x296330}];return db[_0xc111('0x2c')][_0xc111('0x36')]({'where':{'id':_0x5dbbce[_0xc111('0x2a')]['id']},'include':_0x48dddf})[_0xc111('0x19')](handleEntityNotFound(_0x63338b,null))[_0xc111('0x19')](function(_0x2925a1){if(_0x2925a1&&_0x2925a1[_0xc111('0x62')]){var _0x16bfc0=_0x2925a1[_0xc111('0x67')]({'plain':!![]});fs[_0xc111('0x68')](_0x4bcfec);return BPromise[_0xc111('0x69')](_0x16bfc0[_0xc111('0x62')],function(_0x25410e,_0x26c308){var _0x52357d={'from':_0x25410e['from'],'to':_0x25410e['to']||_0xc111('0x6a'),'subject':_0x25410e[_0xc111('0x65')],'html':htmlEntities[_0xc111('0x6b')](_0x25410e['body']),'headers':{'Date':moment(_0x25410e[_0xc111('0x66')])['format'](_0xc111('0x6c'))},'attachments':[]};if(_0x25410e['cc']){_0x52357d[_0xc111('0x6d')]['Cc']=_0x25410e['cc'];}if(_0x25410e[_0xc111('0x64')]){_0x52357d['headers']['Bcc']=_0x25410e['bcc'];}return new BPromise(function(_0x57abae,_0x3547ef){if(_0x25410e[_0xc111('0x61')]){for(var _0x58b752=0x0;_0x58b752<_0x25410e[_0xc111('0x61')][_0xc111('0x33')];_0x58b752++){var _0x318e5b=_0x25410e[_0xc111('0x61')][_0x58b752];var _0x2f7be7=path[_0xc111('0x59')](_0x417ee0,_0x318e5b['basename']);if(fs[_0xc111('0x6e')](_0x2f7be7)){_0x52357d['attachments'][_0xc111('0x60')]({'name':_0x318e5b[_0xc111('0x1d')],'contentType':_0x318e5b[_0xc111('0x23')],'data':fs[_0xc111('0x6f')](_0x2f7be7)});}}}emlformat[_0xc111('0x70')](_0x52357d,function(_0x2c43cf,_0x4fe378){if(_0x2c43cf)return _0x3547ef(_0x2c43cf);fs[_0xc111('0x71')](path[_0xc111('0x59')](_0x4bcfec,util[_0xc111('0x48')]('message%d.eml',_0x26c308)),_0x4fe378);return _0x57abae(_0x4fe378);});});})[_0xc111('0x19')](function(){return new BPromise(function(_0x4a4c7d,_0x2999d7){zipdir(_0x4bcfec,{'saveTo':_0x10fa86},function(_0x344634,_0x256f36){if(_0x344634)return _0x2999d7(_0x344634);return _0x4a4c7d(_0x256f36);});})[_0xc111('0x19')](function(){return new BPromise(function(_0x5cf85a,_0x208b05){rimraf(_0x4bcfec,function(_0x1c3713){if(_0x1c3713)_0x208b05(_0x1c3713);return _0x5cf85a();});});})['then'](function(){return _0x63338b['download'](_0x10fa86,_0x4d9e25,function(_0xfdf77b){if(!_0xfdf77b)fs[_0xc111('0x72')](_0x10fa86);});});});}else{return _0x63338b['sendStatus'](0xc8);}})[_0xc111('0x28')](handleError(_0x63338b,null));}; \ No newline at end of file +var _0xc4c5=['MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','MailInteractionId','filter','map','$gte','split','include','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachments','Messages','bcc','createdAt','mkdirSync','each','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','eml-format','rimraf','zip-dir','util','path','ioredis','../../components/interaction/service','../../config/logger','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','find','body','describe','addMessage'];(function(_0x1741cb,_0x2cec67){var _0x345f0b=function(_0x462368){while(--_0x462368){_0x1741cb['push'](_0x1741cb['shift']());}};_0x345f0b(++_0x2cec67);}(_0xc4c5,0x108));var _0x5c4c=function(_0x289907,_0x2c4445){_0x289907=_0x289907-0x0;var _0x2a75ba=_0xc4c5[_0x289907];return _0x2a75ba;};'use strict';var emlformat=require(_0x5c4c('0x0'));var rimraf=require(_0x5c4c('0x1'));var zipdir=require(_0x5c4c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x5c4c('0x3'));var path=require(_0x5c4c('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x5c4c('0x5'));var interaction=require(_0x5c4c('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5c4c('0x7'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x5c4c('0x8')]=_[_0x5c4c('0x9')](config[_0x5c4c('0x8')],{'host':_0x5c4c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c4c('0xb'))[_0x5c4c('0xc')](socket);function respondWithStatusCode(_0x50e904,_0x1efe1f){_0x1efe1f=_0x1efe1f||0xcc;return function(_0x428764){if(_0x428764){return _0x50e904[_0x5c4c('0xd')](_0x1efe1f);}return _0x50e904['status'](_0x1efe1f)[_0x5c4c('0xe')]();};}function respondWithResult(_0x47b0b7,_0xa754da){_0xa754da=_0xa754da||0xc8;return function(_0x2c6823){if(_0x2c6823){return _0x47b0b7[_0x5c4c('0xf')](_0xa754da)[_0x5c4c('0x10')](_0x2c6823);}};}function respondWithFilteredResult(_0x3e4da7,_0x270f8a){return function(_0x3f8197){if(_0x3f8197){var _0x3d0145=typeof _0x270f8a[_0x5c4c('0x11')]===_0x5c4c('0x12')&&typeof _0x270f8a[_0x5c4c('0x13')]===_0x5c4c('0x12');var _0x318ff6=_0x3f8197['count'];var _0x11991a=_0x3d0145?0x0:_0x270f8a[_0x5c4c('0x11')];var _0x541583=_0x3d0145?_0x3f8197[_0x5c4c('0x14')]:_0x270f8a[_0x5c4c('0x11')]+_0x270f8a[_0x5c4c('0x13')];var _0x2dfc9b;if(_0x541583>=_0x318ff6){_0x541583=_0x318ff6;_0x2dfc9b=0xc8;}else{_0x2dfc9b=0xce;}_0x3e4da7[_0x5c4c('0xf')](_0x2dfc9b);return _0x3e4da7[_0x5c4c('0x15')](_0x5c4c('0x16'),_0x11991a+'-'+_0x541583+'/'+_0x318ff6)['json'](_0x3f8197);}return null;};}function saveUpdates(_0x59de29){return function(_0x4442bc){if(_0x4442bc){return _0x4442bc[_0x5c4c('0x17')](_0x59de29)['then'](function(_0x31eee3){return _0x31eee3;});}return null;};}function removeEntity(_0x50de95){return function(_0x4e39b1){if(_0x4e39b1){return _0x4e39b1[_0x5c4c('0x18')]()[_0x5c4c('0x19')](function(){_0x50de95[_0x5c4c('0xf')](0xcc)[_0x5c4c('0xe')]();});}};}function handleEntityNotFound(_0x2fb629){return function(_0x315d20){if(!_0x315d20){_0x2fb629['sendStatus'](0x194);}return _0x315d20;};}function handleError(_0x1368af,_0x231ea0){_0x231ea0=_0x231ea0||0x1f4;return function(_0x5a41cd){logger[_0x5c4c('0x1a')](_0x5a41cd[_0x5c4c('0x1b')]);if(_0x5a41cd['name']){delete _0x5a41cd[_0x5c4c('0x1c')];}_0x1368af['status'](_0x231ea0)[_0x5c4c('0x1d')](_0x5a41cd);};}exports[_0x5c4c('0x1e')]=function(_0x52b7d0,_0x23758d){var _0x373e5d={};var _0x242e3b=_['map'](db[_0x5c4c('0x1f')][_0x5c4c('0x20')],function(_0x36df7e){return{'name':_0x36df7e[_0x5c4c('0x21')],'type':_0x36df7e[_0x5c4c('0x22')][_0x5c4c('0x23')]};});_0x373e5d=qs['getOptions'](_0x242e3b,_0x52b7d0);return interaction[_0x5c4c('0x24')]('mail',_0x52b7d0[_0x5c4c('0x25')],_0x52b7d0[_0x5c4c('0x26')],_0x373e5d,_0x242e3b)['then'](respondWithFilteredResult(_0x23758d,_0x373e5d))[_0x5c4c('0x27')](handleError(_0x23758d,null));};exports[_0x5c4c('0x28')]=function(_0x859dd4,_0x2dc87b){var _0x5d532b={'raw':![],'where':{'id':_0x859dd4[_0x5c4c('0x29')]['id']}},_0x45e0a7={};_0x45e0a7[_0x5c4c('0x2a')]=_[_0x5c4c('0x2b')](db['MailInteraction']['rawAttributes']);_0x45e0a7['query']=_['keys'](_0x859dd4[_0x5c4c('0x25')]);_0x45e0a7[_0x5c4c('0x2c')]=_[_0x5c4c('0x2d')](_0x45e0a7['model'],_0x45e0a7[_0x5c4c('0x25')]);_0x5d532b[_0x5c4c('0x2e')]=_['intersection'](_0x45e0a7['model'],qs[_0x5c4c('0x2f')](_0x859dd4[_0x5c4c('0x25')]['fields']));_0x5d532b['attributes']=_0x5d532b[_0x5c4c('0x2e')][_0x5c4c('0x30')]?_0x5d532b[_0x5c4c('0x2e')]:_0x45e0a7[_0x5c4c('0x2a')];if(_0x859dd4['query'][_0x5c4c('0x31')]){_0x5d532b['include']=[{'all':!![]}];}_0x5d532b=_[_0x5c4c('0x32')]({},_0x5d532b,_0x859dd4[_0x5c4c('0x33')]);return db['MailInteraction']['find'](_0x5d532b)[_0x5c4c('0x19')](handleEntityNotFound(_0x2dc87b,null))[_0x5c4c('0x19')](respondWithResult(_0x2dc87b,null))['catch'](handleError(_0x2dc87b,null));};exports['create']=function(_0x23ee1a,_0x45f80a){return db[_0x5c4c('0x1f')][_0x5c4c('0x34')](_0x23ee1a['body'],{})[_0x5c4c('0x19')](respondWithResult(_0x45f80a,0xc9))[_0x5c4c('0x27')](handleError(_0x45f80a,null));};exports[_0x5c4c('0x17')]=function(_0x5a3291,_0x39cdb3){if(_0x5a3291['body']['id']){delete _0x5a3291['body']['id'];}return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0x5a3291[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x39cdb3,null))[_0x5c4c('0x19')](saveUpdates(_0x5a3291[_0x5c4c('0x36')],null))[_0x5c4c('0x19')](respondWithResult(_0x39cdb3,null))['catch'](handleError(_0x39cdb3,null));};exports[_0x5c4c('0x18')]=function(_0x3eb1b1,_0x23a730){return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0x3eb1b1[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x23a730,null))[_0x5c4c('0x19')](removeEntity(_0x23a730,null))[_0x5c4c('0x27')](handleError(_0x23a730,null));};exports['describe']=function(_0x1578f3,_0x2d5c4f){return db[_0x5c4c('0x1f')][_0x5c4c('0x37')]()[_0x5c4c('0x19')](respondWithResult(_0x2d5c4f,null))[_0x5c4c('0x27')](handleError(_0x2d5c4f,null));};exports[_0x5c4c('0x38')]=function(_0x14bf45,_0x52bade){return db[_0x5c4c('0x39')]['find']({'where':{'id':_0x14bf45['params']['id']}})['then'](handleEntityNotFound(_0x52bade,null))['then'](function(_0x4dfba5){if(_0x4dfba5){return _0x4dfba5[_0x5c4c('0x38')](_0x14bf45[_0x5c4c('0x36')][_0x5c4c('0x3a')],_[_0x5c4c('0x3b')](_0x14bf45[_0x5c4c('0x36')],['ids','id'])||{});}})[_0x5c4c('0x19')](respondWithResult(_0x52bade,null))[_0x5c4c('0x27')](handleError(_0x52bade,null));};exports[_0x5c4c('0x3c')]=function(_0x2d0e8a,_0x589566){var _0x503be6={'raw':![],'where':{}};var _0x34e896={};var _0x525dcd={'count':0x0,'rows':[]};return db[_0x5c4c('0x1f')][_0x5c4c('0x3d')]({'where':{'id':_0x2d0e8a[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x589566,null))[_0x5c4c('0x19')](function(_0x3edde1){if(_0x3edde1){_0x34e896[_0x5c4c('0x2a')]=_[_0x5c4c('0x2b')](db[_0x5c4c('0x39')]['rawAttributes']);_0x34e896[_0x5c4c('0x25')]=_['keys'](_0x2d0e8a[_0x5c4c('0x25')]);_0x34e896[_0x5c4c('0x2c')]=_[_0x5c4c('0x2d')](_0x34e896[_0x5c4c('0x2a')],_0x34e896[_0x5c4c('0x25')]);_0x503be6['attributes']=_[_0x5c4c('0x2d')](_0x34e896[_0x5c4c('0x2a')],qs['fields'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x2f')]));_0x503be6[_0x5c4c('0x2e')]=_0x503be6[_0x5c4c('0x2e')]['length']?_0x503be6[_0x5c4c('0x2e')]:_0x34e896['model'];if(!_0x2d0e8a['query'][_0x5c4c('0x3e')](_0x5c4c('0x3f'))){_0x503be6[_0x5c4c('0x13')]=qs['limit'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x13')]);_0x503be6[_0x5c4c('0x11')]=qs['offset'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x11')]);}_0x503be6['order']=qs[_0x5c4c('0x40')](_0x2d0e8a['query']['sort']);_0x503be6[_0x5c4c('0x41')]=qs[_0x5c4c('0x2c')](_['pick'](_0x2d0e8a[_0x5c4c('0x25')],_0x34e896[_0x5c4c('0x2c')]));_0x503be6[_0x5c4c('0x41')][_0x5c4c('0x42')]=_0x3edde1['id'];if(_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x43')]){_0x503be6[_0x5c4c('0x41')]=_[_0x5c4c('0x32')](_0x503be6[_0x5c4c('0x41')],{'$or':_[_0x5c4c('0x44')](_0x503be6[_0x5c4c('0x2e')],function(_0xc284d){var _0xbca93d={};_0xbca93d[_0xc284d]={'$like':'%'+_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x43')]+'%'};return _0xbca93d;})});}if(_0x2d0e8a['query'][_0x5c4c('0x45')]){var _0x323ab0=_0x2d0e8a['query'][_0x5c4c('0x45')][_0x5c4c('0x46')](',');var _0x1073bf={};_0x1073bf[_0x323ab0[0x0]]={'$gte':moment(_0x323ab0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x503be6[_0x5c4c('0x41')]=_[_0x5c4c('0x32')](_0x503be6[_0x5c4c('0x41')],_0x1073bf);}_0x503be6=_['merge']({},_0x503be6,_0x2d0e8a[_0x5c4c('0x33')]);return db['MailMessage'][_0x5c4c('0x14')]({'where':_0x503be6[_0x5c4c('0x41')]})['then'](function(_0x18a268){_0x525dcd[_0x5c4c('0x14')]=_0x18a268;if(_0x2d0e8a[_0x5c4c('0x25')]['includeAll']){_0x503be6[_0x5c4c('0x47')]=[{'all':!![]}];}return db[_0x5c4c('0x39')][_0x5c4c('0x24')](_0x503be6);})[_0x5c4c('0x19')](function(_0x4d9310){if(_0x2d0e8a[_0x5c4c('0x25')]['inlineCss']==='true'){for(var _0x10b58f=0x0;_0x10b58f<_0x4d9310[_0x5c4c('0x30')];_0x10b58f++){_0x4d9310[_0x10b58f][_0x5c4c('0x36')]=juice(_0x4d9310[_0x10b58f]['body']);}}_0x525dcd[_0x5c4c('0x48')]=_0x4d9310;return _0x525dcd;});}})[_0x5c4c('0x19')](respondWithFilteredResult(_0x589566,_0x503be6))[_0x5c4c('0x27')](handleError(_0x589566,null));};exports[_0x5c4c('0x49')]=function(_0x3a26b0,_0x389edd){return db['MailInteraction'][_0x5c4c('0x35')]({'where':{'id':_0x3a26b0[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x389edd,null))[_0x5c4c('0x19')](function(_0x504746){if(_0x504746){return _0x504746[_0x5c4c('0x4a')](_0x3a26b0[_0x5c4c('0x36')][_0x5c4c('0x3a')],_[_0x5c4c('0x3b')](_0x3a26b0[_0x5c4c('0x36')],[_0x5c4c('0x3a'),'id'])||{})[_0x5c4c('0x4b')](function(){return db[_0x5c4c('0x4c')][_0x5c4c('0x24')]({'attributes':['id',_0x5c4c('0x1c'),_0x5c4c('0x4d')],'where':{'id':_0x3a26b0[_0x5c4c('0x36')][_0x5c4c('0x3a')]}});})[_0x5c4c('0x19')](function(_0x15ec37){socket[_0x5c4c('0x4e')](_0x5c4c('0x4f'),{'id':Number(_0x3a26b0[_0x5c4c('0x29')]['id']),'tags':_0x15ec37||[]});return{'id':Number(_0x3a26b0[_0x5c4c('0x29')]['id']),'tags':_0x15ec37||[]};});}})[_0x5c4c('0x19')](respondWithResult(_0x389edd,null))[_0x5c4c('0x27')](handleError(_0x389edd,null));};exports[_0x5c4c('0x50')]=function(_0x5b6655,_0x25bfd7){return db['MailInteraction'][_0x5c4c('0x35')]({'where':{'id':_0x5b6655['params']['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x25bfd7,null))[_0x5c4c('0x19')](function(_0x3eb068){if(_0x3eb068){return _0x3eb068[_0x5c4c('0x50')](_0x5b6655['query'][_0x5c4c('0x3a')]);}})[_0x5c4c('0x19')](respondWithStatusCode(_0x25bfd7,null))[_0x5c4c('0x27')](handleError(_0x25bfd7,null));};exports[_0x5c4c('0x51')]=function(_0xa302b7,_0x2fdae0){var _0xe9ef7e=moment()[_0x5c4c('0x52')]()[_0x5c4c('0x53')]();var _0x570d2f=path[_0x5c4c('0x54')](config[_0x5c4c('0x55')],_0x5c4c('0x56'),_0x5c4c('0x57'),_0x5c4c('0x58'));var _0x38b74c=path[_0x5c4c('0x54')](config[_0x5c4c('0x55')],_0x5c4c('0x56'),_0x5c4c('0x57'),_0x5c4c('0x59'));var _0x412f78=path['join'](_0x570d2f,_0xe9ef7e);var _0x2d0fa5=util[_0x5c4c('0x5a')](_0x5c4c('0x5b'),_0xa302b7[_0x5c4c('0x29')]['id'],_0xe9ef7e);var _0xf8d48=path['join'](_0x570d2f,_0x2d0fa5);var _0x57d4b4=[];if(_0xa302b7[_0x5c4c('0x25')][_0x5c4c('0x59')]){_0x57d4b4[_0x5c4c('0x5c')]({'model':db['Attachment'],'as':_0x5c4c('0x5d'),'raw':!![]});}var _0x591228=[{'model':db[_0x5c4c('0x39')],'as':_0x5c4c('0x5e'),'attributes':['id',_0x5c4c('0x36'),'from','to','cc',_0x5c4c('0x5f'),'subject',_0x5c4c('0x60')],'where':{'secret':![]},'order':qs[_0x5c4c('0x40')]('id'),'include':_0x57d4b4}];return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0xa302b7[_0x5c4c('0x29')]['id']},'include':_0x591228})['then'](handleEntityNotFound(_0x2fdae0,null))[_0x5c4c('0x19')](function(_0x181a6b){if(_0x181a6b&&_0x181a6b[_0x5c4c('0x5e')]){var _0x557da1=_0x181a6b['get']({'plain':!![]});fs[_0x5c4c('0x61')](_0x412f78);return BPromise[_0x5c4c('0x62')](_0x557da1[_0x5c4c('0x5e')],function(_0x11a614,_0x3866e9){var _0x4edd74={'from':_0x11a614[_0x5c4c('0x63')],'to':_0x11a614['to']||'missing.recipient@your.company.com','subject':_0x11a614['subject'],'html':htmlEntities[_0x5c4c('0x64')](_0x11a614[_0x5c4c('0x36')]),'headers':{'Date':moment(_0x11a614[_0x5c4c('0x60')])['format'](_0x5c4c('0x65'))},'attachments':[]};if(_0x11a614['cc']){_0x4edd74[_0x5c4c('0x66')]['Cc']=_0x11a614['cc'];}if(_0x11a614[_0x5c4c('0x5f')]){_0x4edd74[_0x5c4c('0x66')][_0x5c4c('0x67')]=_0x11a614[_0x5c4c('0x5f')];}return new BPromise(function(_0x53ae7a,_0x1fef9e){if(_0x11a614['Attachments']){for(var _0x25ba5c=0x0;_0x25ba5c<_0x11a614['Attachments'][_0x5c4c('0x30')];_0x25ba5c++){var _0xe1832=_0x11a614[_0x5c4c('0x5d')][_0x25ba5c];var _0x32c6c3=path['join'](_0x38b74c,_0xe1832['basename']);if(fs[_0x5c4c('0x68')](_0x32c6c3)){_0x4edd74['attachments'][_0x5c4c('0x5c')]({'name':_0xe1832[_0x5c4c('0x1c')],'contentType':_0xe1832['type'],'data':fs[_0x5c4c('0x69')](_0x32c6c3)});}}}emlformat['build'](_0x4edd74,function(_0x4fe3fe,_0x27a7c5){if(_0x4fe3fe)return _0x1fef9e(_0x4fe3fe);fs[_0x5c4c('0x6a')](path['join'](_0x412f78,util[_0x5c4c('0x5a')]('message%d.eml',_0x3866e9)),_0x27a7c5);return _0x53ae7a(_0x27a7c5);});});})['then'](function(){return new BPromise(function(_0x10fe83,_0xbc76c4){zipdir(_0x412f78,{'saveTo':_0xf8d48},function(_0x5ee7d1,_0x34f1eb){if(_0x5ee7d1)return _0xbc76c4(_0x5ee7d1);return _0x10fe83(_0x34f1eb);});})[_0x5c4c('0x19')](function(){return new BPromise(function(_0x39b5df,_0x71617b){rimraf(_0x412f78,function(_0x46407b){if(_0x46407b)_0x71617b(_0x46407b);return _0x39b5df();});});})['then'](function(){return _0x2fdae0[_0x5c4c('0x51')](_0xf8d48,_0x2d0fa5,function(_0x48376d){if(!_0x48376d)fs['unlinkSync'](_0xf8d48);});});});}else{return _0x2fdae0[_0x5c4c('0xd')](0xc8);}})[_0x5c4c('0x27')](handleError(_0x2fdae0,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c2fb0b4..62375ae 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 _0x2fe5=['emit','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x3d4635,_0x2ab4b5){var _0x3c4ceb=function(_0x47872e){while(--_0x47872e){_0x3d4635['push'](_0x3d4635['shift']());}};_0x3c4ceb(++_0x2ab4b5);}(_0x2fe5,0xd5));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x52fe('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x52fe('0x1')];var MailMessage=require(_0x52fe('0x2'))['db'][_0x52fe('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x52fe('0x4')](0x0);var events={'afterCreate':_0x52fe('0x5'),'afterUpdate':_0x52fe('0x6'),'afterDestroy':_0x52fe('0x7')};function emitEvent(_0x5365fa){return function(_0x13bc35,_0x460b93,_0x6a791c){_0x13bc35[_0x52fe('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c28de){_0x13bc35[_0x52fe('0x9')]('Users',_0x2c28de['map'](function(_0x2288b4){return{'id':_0x2288b4['id']};}));return MailMessage[_0x52fe('0xa')]({'where':{'MailInteractionId':_0x13bc35['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5a062c){_0x13bc35[_0x52fe('0x9')](_0x52fe('0xb'),_0x5a062c['length']);MailInteractionEvents[_0x52fe('0xc')](_0x5365fa+':'+_0x13bc35['id'],_0x13bc35);MailInteractionEvents['emit'](_0x5365fa,_0x13bc35);_0x6a791c(null);})['catch'](_0x6a791c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x52fe('0xd')](e,emitEvent(event));}}module[_0x52fe('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x4bc1=['length','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x4bc1,0x190));var _0x14bc=function(_0x155c2c,_0x5439b3){_0x155c2c=_0x155c2c-0x0;var _0x4b77e2=_0x4bc1[_0x155c2c];return _0x4b77e2;};'use strict';var EventEmitter=require(_0x14bc('0x0'));var MailInteraction=require(_0x14bc('0x1'))['db'][_0x14bc('0x2')];var MailMessage=require(_0x14bc('0x1'))['db'][_0x14bc('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x14bc('0x4')](0x0);var events={'afterCreate':_0x14bc('0x5'),'afterUpdate':_0x14bc('0x6'),'afterDestroy':_0x14bc('0x7')};function emitEvent(_0x1f3373){return function(_0x564016,_0xd1dce5,_0x4d1f62){_0x564016[_0x14bc('0x8')]({'attributes':['id'],'raw':!![]})[_0x14bc('0x9')](function(_0x22ece5){_0x564016[_0x14bc('0xa')](_0x14bc('0xb'),_0x22ece5[_0x14bc('0xc')](function(_0x24bbf2){return{'id':_0x24bbf2['id']};}));return MailMessage[_0x14bc('0xd')]({'where':{'MailInteractionId':_0x564016['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14bc('0x9')](function(_0x334a10){_0x564016['setDataValue']('unreadMessages',_0x334a10[_0x14bc('0xe')]);MailInteractionEvents['emit'](_0x1f3373+':'+_0x564016['id'],_0x564016);MailInteractionEvents['emit'](_0x1f3373,_0x564016);_0x4d1f62(null);})['catch'](_0x4d1f62(null));};}for(var e in events){if(events[_0x14bc('0xf')](e)){var event=events[e];MailInteraction[_0x14bc('0x10')](e,emitEvent(event));}}module[_0x14bc('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8afc2a4..8024d54 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 _0x5107=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5107,0xa1));var _0x7510=function(_0x847f0,_0x3e94e1){_0x847f0=_0x847f0-0x0;var _0xace04a=_0x5107[_0x847f0];return _0xace04a;};'use strict';var _=require(_0x7510('0x0'));var util=require(_0x7510('0x1'));var logger=require('../../config/logger')(_0x7510('0x2'));var moment=require(_0x7510('0x3'));var BPromise=require(_0x7510('0x4'));var rp=require(_0x7510('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7510('0x6'));var config=require(_0x7510('0x7'));var attributes=require(_0x7510('0x8'));module[_0x7510('0x9')]=function(_0x34e114,_0x3e0fef){return _0x34e114[_0x7510('0xa')](_0x7510('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x7510('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3603b6,_0x75075b,_0x49f940){if(_0x3603b6[_0x7510('0xd')]){_0x3603b6[_0x7510('0xe')]=moment()[_0x7510('0xf')](_0x7510('0x10'));}if(_0x3603b6[_0x7510('0x11')]){_0x3603b6[_0x7510('0x12')]=moment()[_0x7510('0xf')](_0x7510('0x10'));}_0x49f940(null,_0x75075b);},'beforeUpdate':function(_0xb6a7e8,_0x2e5125,_0x2bd400){if(_0xb6a7e8[_0x7510('0x13')](_0x7510('0xd'))){_0xb6a7e8[_0x7510('0xe')]=_0xb6a7e8[_0x7510('0xd')]?moment()[_0x7510('0xf')](_0x7510('0x10')):null;}if(_0xb6a7e8[_0x7510('0x13')](_0x7510('0x11'))){_0xb6a7e8[_0x7510('0x12')]=moment()[_0x7510('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0xb6a7e8['substatus']=null;_0xb6a7e8[_0x7510('0xe')]=null;}_0x2bd400(null,_0xb6a7e8);},'afterUpdate':function(_0x4b02de,_0x21df0b,_0x3000a2){var _0x4be777=_0x34e114[_0x7510('0x14')];var _0x1fd5d3=_0x4b02de[_0x7510('0x15')]({'plain':!![]});if(_0x1fd5d3[_0x7510('0x11')]){return _0x4be777[_0x7510('0x16')][_0x7510('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x1fd5d3['id']}})[_0x7510('0x18')](function(){_0x3000a2();})[_0x7510('0x19')](function(_0x31a390){_0x3000a2(_0x31a390);});}else{_0x3000a2();}}},'charset':_0x7510('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x225d=['closedAt','changed','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x353c45,_0x151824){var _0x2af8ed=function(_0x173506){while(--_0x173506){_0x353c45['push'](_0x353c45['shift']());}};_0x2af8ed(++_0x151824);}(_0x225d,0xdb));var _0xd225=function(_0x466b78,_0x22380c){_0x466b78=_0x466b78-0x0;var _0x48af33=_0x225d[_0x466b78];return _0x48af33;};'use strict';var _=require(_0xd225('0x0'));var util=require(_0xd225('0x1'));var logger=require(_0xd225('0x2'))(_0xd225('0x3'));var moment=require(_0xd225('0x4'));var BPromise=require(_0xd225('0x5'));var rp=require(_0xd225('0x6'));var fs=require('fs');var path=require(_0xd225('0x7'));var rimraf=require(_0xd225('0x8'));var config=require(_0xd225('0x9'));var attributes=require(_0xd225('0xa'));module[_0xd225('0xb')]=function(_0x513ba0,_0x5d7b47){return _0x513ba0[_0xd225('0xc')]('MailInteraction',attributes,{'tableName':_0xd225('0xd'),'paranoid':![],'indexes':[{'name':_0xd225('0xe'),'fields':['subject','to'],'type':_0xd225('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xaaee5e,_0x16b5e2,_0x2a9ba2){if(_0xaaee5e[_0xd225('0x10')]){_0xaaee5e[_0xd225('0x11')]=moment()[_0xd225('0x12')](_0xd225('0x13'));}if(_0xaaee5e[_0xd225('0x14')]){_0xaaee5e[_0xd225('0x15')]=moment()[_0xd225('0x12')](_0xd225('0x13'));}_0x2a9ba2(null,_0x16b5e2);},'beforeUpdate':function(_0x4e472e,_0xbc5cc8,_0x55ffa1){if(_0x4e472e[_0xd225('0x16')](_0xd225('0x10'))){_0x4e472e['substatusAt']=_0x4e472e['substatus']?moment()[_0xd225('0x12')](_0xd225('0x13')):null;}if(_0x4e472e[_0xd225('0x16')](_0xd225('0x14'))){_0x4e472e['closedAt']=moment()['format'](_0xd225('0x13'));_0x4e472e['substatus']=null;_0x4e472e[_0xd225('0x11')]=null;}_0x55ffa1(null,_0x4e472e);},'afterUpdate':function(_0x45636b,_0x535163,_0x1d5851){var _0x41421a=_0x513ba0[_0xd225('0x17')];var _0x423a2a=_0x45636b[_0xd225('0x18')]({'plain':!![]});if(_0x423a2a[_0xd225('0x14')]){return _0x41421a[_0xd225('0x19')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x423a2a['id']}})[_0xd225('0x1a')](function(){_0x1d5851();})[_0xd225('0x1b')](function(_0x7bfb1e){_0x1d5851(_0x7bfb1e);});}else{_0x1d5851();}}},'charset':_0xd225('0x1c'),'collate':_0xd225('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 841c6b7..2940011 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 _0x6093=['AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','stringify'];(function(_0x14e538,_0x3628d3){var _0x2ad94d=function(_0x1ba6dd){while(--_0x1ba6dd){_0x14e538['push'](_0x14e538['shift']());}};_0x2ad94d(++_0x3628d3);}(_0x6093,0x107));var _0x3609=function(_0x416d8f,_0x41fa09){_0x416d8f=_0x416d8f-0x0;var _0x3f0b0a=_0x6093[_0x416d8f];return _0x3f0b0a;};'use strict';var _=require(_0x3609('0x0'));var util=require(_0x3609('0x1'));var moment=require(_0x3609('0x2'));var BPromise=require(_0x3609('0x3'));var rs=require(_0x3609('0x4'));var fs=require('fs');var Redis=require(_0x3609('0x5'));var db=require(_0x3609('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3609('0x7'));var config=require(_0x3609('0x8'));var jayson=require(_0x3609('0x9'));var client=jayson[_0x3609('0xa')]['http']({'port':0x232a});config[_0x3609('0xb')]=_[_0x3609('0xc')](config[_0x3609('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3609('0xd'))(new Redis(config[_0x3609('0xb')]));require(_0x3609('0xe'))[_0x3609('0xf')](socket);function respondWithRpcPromise(_0x2fc461,_0x3f74a5,_0x51aaeb){return new BPromise(function(_0x3a40bb,_0xfd264){return client[_0x3609('0x10')](_0x2fc461,_0x51aaeb)[_0x3609('0x11')](function(_0x589985){logger[_0x3609('0x12')](_0x3609('0x13'),_0x3f74a5,_0x3609('0x14'));logger[_0x3609('0x15')](_0x3609('0x16'),_0x3f74a5,'request\x20sent',JSON['stringify'](_0x589985));if(_0x589985['error']){if(_0x589985[_0x3609('0x17')][_0x3609('0x18')]===0x1f4){logger[_0x3609('0x17')](_0x3609('0x13'),_0x3f74a5,_0x589985[_0x3609('0x17')][_0x3609('0x19')]);return _0xfd264(_0x589985[_0x3609('0x17')][_0x3609('0x19')]);}logger[_0x3609('0x17')]('MailInteraction,\x20%s,\x20%s',_0x3f74a5,_0x589985[_0x3609('0x17')][_0x3609('0x19')]);return _0x3a40bb(_0x589985['error'][_0x3609('0x19')]);}else{logger[_0x3609('0x12')](_0x3609('0x13'),_0x3f74a5,'request\x20sent');_0x3a40bb(_0x589985[_0x3609('0x1a')][_0x3609('0x19')]);}})[_0x3609('0x1b')](function(_0x5d8c27){logger[_0x3609('0x17')](_0x3609('0x13'),_0x3f74a5,_0x5d8c27);_0xfd264(_0x5d8c27);});});}exports[_0x3609('0x1c')]=function(_0x32097b){var _0x13f5a2=this;return new Promise(function(_0x2be56f,_0xe94acf){return db[_0x3609('0x1d')][_0x3609('0x1e')](_0x32097b[_0x3609('0x1f')],{'raw':_0x32097b[_0x3609('0x20')]?_0x32097b[_0x3609('0x20')][_0x3609('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32097b[_0x3609('0x20')]?_0x32097b['options'][_0x3609('0x22')]||null:null,'attributes':_0x32097b[_0x3609('0x20')]?_0x32097b['options'][_0x3609('0x23')]||null:null,'limit':_0x32097b[_0x3609('0x20')]?_0x32097b[_0x3609('0x20')][_0x3609('0x24')]||null:null})[_0x3609('0x11')](function(_0x5430a8){logger[_0x3609('0x12')]('UpdateMailInteraction',_0x32097b);logger['debug'](_0x3609('0x1c'),_0x32097b,JSON[_0x3609('0x25')](_0x5430a8));_0x2be56f(_0x5430a8);})[_0x3609('0x1b')](function(_0x53156a){logger['error'](_0x3609('0x1c'),_0x53156a[_0x3609('0x19')],_0x32097b);_0xe94acf(_0x13f5a2[_0x3609('0x17')](0x1f4,_0x53156a[_0x3609('0x19')]));});});};exports[_0x3609('0x26')]=function(_0x34dc2a){return new Promise(function(_0x4d8a08,_0x52c7e5){return db[_0x3609('0x1d')]['find']({'where':_0x34dc2a['options']?_0x34dc2a['options'][_0x3609('0x22')]||null:null})['then'](function(_0x7d3057){if(_0x7d3057){return _0x7d3057['addTags'](_0x34dc2a[_0x3609('0x1f')][_0x3609('0x27')],_[_0x3609('0x28')](_0x34dc2a[_0x3609('0x1f')],[_0x3609('0x27'),'id'])||{});}})[_0x3609('0x29')](function(_0x763021){logger['info'](_0x3609('0x2a'),_0x34dc2a);logger[_0x3609('0x15')](_0x3609('0x2a'),_0x34dc2a,JSON['stringify'](_0x763021));_0x4d8a08(_0x763021);})[_0x3609('0x1b')](function(_0x481fe7){logger[_0x3609('0x17')](_0x3609('0x2a'),_0x481fe7[_0x3609('0x19')],_0x34dc2a);_0x52c7e5(_this[_0x3609('0x17')](0x1f4,_0x481fe7['message']));});});}; \ No newline at end of file +var _0xe5e0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','update','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x3bb0a3,_0x1163bf){_0x3bb0a3=_0x3bb0a3-0x0;var _0x1aeb1f=_0xe5e0[_0x3bb0a3];return _0x1aeb1f;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var moment=require(_0x0e5e('0x2'));var BPromise=require(_0x0e5e('0x3'));var rs=require(_0x0e5e('0x4'));var fs=require('fs');var Redis=require(_0x0e5e('0x5'));var db=require(_0x0e5e('0x6'))['db'];var utils=require(_0x0e5e('0x7'));var logger=require(_0x0e5e('0x8'))('rpc');var config=require(_0x0e5e('0x9'));var jayson=require(_0x0e5e('0xa'));var client=jayson[_0x0e5e('0xb')]['http']({'port':0x232a});config[_0x0e5e('0xc')]=_[_0x0e5e('0xd')](config[_0x0e5e('0xc')],{'host':_0x0e5e('0xe'),'port':0x18eb});var socket=require(_0x0e5e('0xf'))(new Redis(config[_0x0e5e('0xc')]));require(_0x0e5e('0x10'))['register'](socket);function respondWithRpcPromise(_0x5d5366,_0x531bf8,_0x4241ea){return new BPromise(function(_0x17a208,_0x5a88de){return client['request'](_0x5d5366,_0x4241ea)[_0x0e5e('0x11')](function(_0x3ee826){logger[_0x0e5e('0x12')](_0x0e5e('0x13'),_0x531bf8,'request\x20sent');logger[_0x0e5e('0x14')](_0x0e5e('0x15'),_0x531bf8,'request\x20sent',JSON[_0x0e5e('0x16')](_0x3ee826));if(_0x3ee826[_0x0e5e('0x17')]){if(_0x3ee826[_0x0e5e('0x17')]['code']===0x1f4){logger[_0x0e5e('0x17')](_0x0e5e('0x13'),_0x531bf8,_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);return _0x5a88de(_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);}logger['error'](_0x0e5e('0x13'),_0x531bf8,_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);return _0x17a208(_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);}else{logger['info'](_0x0e5e('0x13'),_0x531bf8,_0x0e5e('0x19'));_0x17a208(_0x3ee826['result'][_0x0e5e('0x18')]);}})[_0x0e5e('0x1a')](function(_0x56cc12){logger[_0x0e5e('0x17')](_0x0e5e('0x13'),_0x531bf8,_0x56cc12);_0x5a88de(_0x56cc12);});});}exports['UpdateMailInteraction']=function(_0x422c08){var _0x485b97=this;return new Promise(function(_0x3659d9,_0x56dcc9){return db['MailInteraction'][_0x0e5e('0x1b')](_0x422c08[_0x0e5e('0x1c')],{'raw':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x1f')]||null:null,'attributes':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')]['attributes']||null:null,'limit':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x20')]||null:null})[_0x0e5e('0x11')](function(_0x553208){logger[_0x0e5e('0x12')](_0x0e5e('0x21'),_0x422c08);logger['debug'](_0x0e5e('0x21'),_0x422c08,JSON['stringify'](_0x553208));_0x3659d9(_0x553208);})[_0x0e5e('0x1a')](function(_0x2f789a){logger['error'](_0x0e5e('0x21'),_0x2f789a[_0x0e5e('0x18')],_0x422c08);_0x56dcc9(_0x485b97[_0x0e5e('0x17')](0x1f4,_0x2f789a['message']));});});};exports[_0x0e5e('0x22')]=function(_0x57b970){return new Promise(function(_0x343eb2,_0x2d5cc0){return db[_0x0e5e('0x23')]['find']({'where':_0x57b970[_0x0e5e('0x1d')]?_0x57b970[_0x0e5e('0x1d')][_0x0e5e('0x1f')]||null:null})[_0x0e5e('0x11')](function(_0x348684){if(_0x348684){return _0x348684[_0x0e5e('0x24')](_0x57b970[_0x0e5e('0x1c')]['ids'],_[_0x0e5e('0x25')](_0x57b970[_0x0e5e('0x1c')],[_0x0e5e('0x26'),'id'])||{});}})[_0x0e5e('0x27')](function(_0x4f3d67){logger['info']('AddTags',_0x57b970);logger['debug'](_0x0e5e('0x28'),_0x57b970,JSON['stringify'](_0x4f3d67));_0x343eb2(_0x4f3d67);})[_0x0e5e('0x1a')](function(_0x40a27c){logger[_0x0e5e('0x17')]('AddTags',_0x40a27c[_0x0e5e('0x18')],_0x57b970);_0x2d5cc0(_this['error'](0x1f4,_0x40a27c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index a285daa..13835b9 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 _0x3167=['removeListener','register','./mailInteraction.events','remove','update'];(function(_0x627d70,_0x3dae9d){var _0x4b0aa0=function(_0x258d07){while(--_0x258d07){_0x627d70['push'](_0x627d70['shift']());}};_0x4b0aa0(++_0x3dae9d);}(_0x3167,0x133));var _0x7316=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x3167[_0x1abeb2];return _0x48da20;};'use strict';var MailInteractionEvents=require(_0x7316('0x0'));var events=['save',_0x7316('0x1'),_0x7316('0x2')];function createListener(_0x11653f,_0x31c7a4){return function(_0x364b2a){_0x31c7a4['emit'](_0x11653f,_0x364b2a);};}function removeListener(_0xdd64df,_0x3c37ff){return function(){MailInteractionEvents[_0x7316('0x3')](_0xdd64df,_0x3c37ff);};}exports[_0x7316('0x4')]=function(_0x4eb2e3){for(var _0x49e8de=0x0,_0x5ce7d9=events['length'];_0x49e8de<_0x5ce7d9;_0x49e8de++){var _0x1f9e3c=events[_0x49e8de];var _0x36890b=createListener('mailInteraction:'+_0x1f9e3c,_0x4eb2e3);MailInteractionEvents['on'](_0x1f9e3c,_0x36890b);}}; \ No newline at end of file +var _0x1cbc=['removeListener','length','mailInteraction:','save','remove'];(function(_0x5dce88,_0x3d6a44){var _0x14e9ad=function(_0x29b3d2){while(--_0x29b3d2){_0x5dce88['push'](_0x5dce88['shift']());}};_0x14e9ad(++_0x3d6a44);}(_0x1cbc,0x11b));var _0xc1cb=function(_0x11ea14,_0x5bddf5){_0x11ea14=_0x11ea14-0x0;var _0x5286f8=_0x1cbc[_0x11ea14];return _0x5286f8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xc1cb('0x0'),_0xc1cb('0x1'),'update'];function createListener(_0x15d2d7,_0x15435b){return function(_0x19aab7){_0x15435b['emit'](_0x15d2d7,_0x19aab7);};}function removeListener(_0x2a7420,_0x2a79bc){return function(){MailInteractionEvents[_0xc1cb('0x2')](_0x2a7420,_0x2a79bc);};}exports['register']=function(_0xb66e1b){for(var _0x5c6e2c=0x0,_0x5c2b36=events[_0xc1cb('0x3')];_0x5c6e2c<_0x5c2b36;_0x5c6e2c++){var _0x5b81dc=events[_0x5c6e2c];var _0x35b4ea=createListener(_0xc1cb('0x4')+_0x5b81dc,_0xb66e1b);MailInteractionEvents['on'](_0x5b81dc,_0x35b4ea);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f62be28..ab1c8fc 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 _0xa71c=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','show','/:id/download','download','tracked','mail','put','/:id','/:id/accept','/:id/reject','reject','delete','exports','multer','util'];(function(_0x5b99a7,_0x329e45){var _0x2ac75b=function(_0x5ba7e1){while(--_0x5ba7e1){_0x5b99a7['push'](_0x5b99a7['shift']());}};_0x2ac75b(++_0x329e45);}(_0xa71c,0x12a));var _0xca71=function(_0x113c6e,_0xe82fc9){_0x113c6e=_0x113c6e-0x0;var _0x34eaa5=_0xa71c[_0x113c6e];return _0x34eaa5;};'use strict';var multer=require(_0xca71('0x0'));var util=require(_0xca71('0x1'));var path=require(_0xca71('0x2'));var timeout=require(_0xca71('0x3'));var express=require(_0xca71('0x4'));var router=express['Router']();var fs_extra=require(_0xca71('0x5'));var auth=require(_0xca71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca71('0x7'));var controller=require(_0xca71('0x8'));router['get']('/',auth[_0xca71('0x9')](),controller[_0xca71('0xa')]);router[_0xca71('0xb')](_0xca71('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xca71('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xca71('0xd')]);router[_0xca71('0xb')](_0xca71('0xe'),auth[_0xca71('0x9')](),controller[_0xca71('0xf')]);router['post']('/',auth[_0xca71('0x9')](),interaction[_0xca71('0x10')](_0xca71('0x11'),'mailmessage:create'),controller['create']);router[_0xca71('0x12')](_0xca71('0x13'),auth[_0xca71('0x9')](),controller['update']);router[_0xca71('0x12')](_0xca71('0x14'),auth[_0xca71('0x9')](),controller['accept']);router[_0xca71('0x12')](_0xca71('0x15'),auth['isAuthenticated'](),controller[_0xca71('0x16')]);router[_0xca71('0x17')](_0xca71('0x13'),auth[_0xca71('0x9')](),controller['destroy']);module[_0xca71('0x18')]=router; \ No newline at end of file +var _0x7072=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xbe2daa,_0x471877){var _0x4eebb6=function(_0x115706){while(--_0x115706){_0xbe2daa['push'](_0xbe2daa['shift']());}};_0x4eebb6(++_0x471877);}(_0x7072,0x138));var _0x2707=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x7072[_0x257642];return _0x3d813b;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 880c92c..5ab74fe 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 _0xc811=['DATE','Chat','Email','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER'];(function(_0x174084,_0xbc0c12){var _0x393737=function(_0x27ee0a){while(--_0x27ee0a){_0x174084['push'](_0x174084['shift']());}};_0x393737(++_0xbc0c12);}(_0xc811,0xfa));var _0x1c81=function(_0x3e42d2,_0x63fff6){_0x3e42d2=_0x3e42d2-0x0;var _0x32ae60=_0xc811[_0x3e42d2];return _0x32ae60;};'use strict';var Sequelize=require(_0x1c81('0x0'));var _=require(_0x1c81('0x1'));module['exports']={'body':{'type':Sequelize[_0x1c81('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x3'))},'read':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c81('0x5')]('in','out'),'defaultValue':_0x1c81('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1c81('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x8'))},'bcc':{'type':Sequelize[_0x1c81('0x2')]('long')},'subject':{'type':Sequelize[_0x1c81('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x1c81('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1c81('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1c81('0xa')]},'originTo':{'type':Sequelize[_0x1c81('0x2')](_0x1c81('0x8'))},'originCc':{'type':Sequelize[_0x1c81('0x2')]('long')},'originChannel':{'type':Sequelize[_0x1c81('0x5')]('Email',_0x1c81('0xb')),'defaultValue':_0x1c81('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xf344=['STRING','DATE','INTEGER','ENUM','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','out'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xf344,0x89));var _0x4f34=function(_0x25d296,_0x566c1a){_0x25d296=_0x25d296-0x0;var _0x598705=_0xf344[_0x25d296];return _0x598705;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4f34('0x0'));module[_0x4f34('0x1')]={'body':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x4'))},'read':{'type':Sequelize[_0x4f34('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4f34('0x6')),'defaultValue':_0x4f34('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4f34('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4f34('0x7')]},'to':{'type':Sequelize['TEXT'](_0x4f34('0x3'))},'cc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'bcc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x4f34('0x8')]},'attach':{'type':Sequelize[_0x4f34('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4f34('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4f34('0x8')]},'originTo':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'originCc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'originChannel':{'type':Sequelize[_0x4f34('0xa')]('Email',_0x4f34('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index b17fc12..8bd2d5d 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 _0x5a30=['updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','length','join','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','User','fromString','EventManager','rejectmessage','unix','toString','root','server','tmp','files','from','createdAt','Attachment','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','bcc','Attachments','existsSync','push','build','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','include','rows','show','params','includeAll','update','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts'];(function(_0x55cb8e,_0x3742a3){var _0x6a9840=function(_0x138f8d){while(--_0x138f8d){_0x55cb8e['push'](_0x55cb8e['shift']());}};_0x6a9840(++_0x3742a3);}(_0x5a30,0x199));var _0x05a3=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x5a30[_0x3c2b2e];return _0x27a338;};'use strict';var emlformat=require(_0x05a3('0x0'));var moment=require(_0x05a3('0x1'));var BPromise=require(_0x05a3('0x2'));var util=require('util');var path=require(_0x05a3('0x3'));var fs=require('fs');var _=require(_0x05a3('0x4'));var Redis=require(_0x05a3('0x5'));var htmlToText=require(_0x05a3('0x6'));var qs=require(_0x05a3('0x7'));var logger=require(_0x05a3('0x8'))(_0x05a3('0x9'));var interaction_log=require(_0x05a3('0x8'))(_0x05a3('0xa'));var config=require(_0x05a3('0xb'));var db=require(_0x05a3('0xc'))['db'];config[_0x05a3('0xd')]=_[_0x05a3('0xe')](config[_0x05a3('0xd')],{'host':_0x05a3('0xf'),'port':0x18eb});var socket=require(_0x05a3('0x10'))(new Redis(config['redis']));var htmlEntities=require(_0x05a3('0x11'));require(_0x05a3('0x12'))[_0x05a3('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x05a3('0x14')][_0x05a3('0x15')]({'port':0x232c});var client9003=jayson['client'][_0x05a3('0x15')]({'port':0x232b});var client9002=jayson[_0x05a3('0x14')][_0x05a3('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x54a42d,_0x852fc2,_0x300427,_0xb981c8){return new BPromise(function(_0x5af485,_0x354a4b){var _0x233a48=_0xb981c8||client;return _0x233a48[_0x05a3('0x16')](_0x54a42d,_0x300427)[_0x05a3('0x17')](function(_0x11fb4d){logger['info']('MailMessage,\x20%s,\x20%s',_0x852fc2,_0x05a3('0x18'));logger[_0x05a3('0x19')](_0x05a3('0x1a'),_0x852fc2,_0x05a3('0x18'),JSON['stringify'](_0x11fb4d));if(_0x11fb4d[_0x05a3('0x1b')]){if(_0x11fb4d[_0x05a3('0x1b')]['code']===0x1f4){logger[_0x05a3('0x1b')](_0x05a3('0x1c'),_0x852fc2,_0x11fb4d['error'][_0x05a3('0x1d')]);return _0x354a4b(_0x11fb4d[_0x05a3('0x1b')]['message']);}logger[_0x05a3('0x1b')](_0x05a3('0x1c'),_0x852fc2,_0x11fb4d[_0x05a3('0x1b')][_0x05a3('0x1d')]);return _0x5af485(_0x11fb4d['error'][_0x05a3('0x1d')]);}else{logger[_0x05a3('0x1e')](_0x05a3('0x1c'),_0x852fc2,_0x05a3('0x18'));_0x5af485(_0x11fb4d[_0x05a3('0x1f')][_0x05a3('0x1d')]);}})[_0x05a3('0x20')](function(_0x42533d){logger[_0x05a3('0x1b')](_0x05a3('0x1c'),_0x852fc2,_0x42533d);_0x354a4b(_0x42533d);});});}function respondWithResult(_0x14e58a,_0x424fa0){_0x424fa0=_0x424fa0||0xc8;return function(_0x776954){if(_0x776954){return _0x14e58a['status'](_0x424fa0)[_0x05a3('0x21')](_0x776954);}};}function respondWithFilteredResult(_0x386ffa,_0x326779){return function(_0x6a3a0d){if(_0x6a3a0d){var _0x521ffd=typeof _0x326779[_0x05a3('0x22')]===_0x05a3('0x23')&&typeof _0x326779[_0x05a3('0x24')]===_0x05a3('0x23');var _0x118135=_0x6a3a0d[_0x05a3('0x25')];var _0x29c3b1=_0x521ffd?0x0:_0x326779[_0x05a3('0x22')];var _0x297afc=_0x521ffd?_0x6a3a0d[_0x05a3('0x25')]:_0x326779['offset']+_0x326779[_0x05a3('0x24')];var _0x2b9ac3;if(_0x297afc>=_0x118135){_0x297afc=_0x118135;_0x2b9ac3=0xc8;}else{_0x2b9ac3=0xce;}_0x386ffa[_0x05a3('0x26')](_0x2b9ac3);return _0x386ffa[_0x05a3('0x27')](_0x05a3('0x28'),_0x29c3b1+'-'+_0x297afc+'/'+_0x118135)['json'](_0x6a3a0d);}return null;};}function saveUpdates(_0x324d77){return function(_0xde707){if(_0xde707){return _0xde707['update'](_0x324d77)[_0x05a3('0x17')](function(_0x5afa23){return _0x5afa23;});}return null;};}function removeEntity(_0x92ea75){return function(_0x4a4856){if(_0x4a4856){return _0x4a4856[_0x05a3('0x29')]()[_0x05a3('0x17')](function(){_0x92ea75[_0x05a3('0x26')](0xcc)[_0x05a3('0x2a')]();});}};}function handleEntityNotFound(_0x49f43f){return function(_0x4a7729){if(!_0x4a7729){_0x49f43f[_0x05a3('0x2b')](0x194);}return _0x4a7729;};}function handleError(_0x30db62,_0x2c847c){_0x2c847c=_0x2c847c||0x1f4;return function(_0x150ea6){logger[_0x05a3('0x1b')](_0x150ea6['stack']);if(_0x150ea6[_0x05a3('0x2c')]){delete _0x150ea6['name'];}_0x30db62[_0x05a3('0x26')](_0x2c847c)[_0x05a3('0x2d')](_0x150ea6);};}exports[_0x05a3('0x2e')]=function(_0x45fa5a,_0x3eb591){var _0x505088={},_0x309c9b={},_0x308c79={'count':0x0,'rows':[]};var _0x1cc324=_[_0x05a3('0x2f')](db[_0x05a3('0x30')][_0x05a3('0x31')],function(_0x4c64c3){return{'name':_0x4c64c3['fieldName'],'type':_0x4c64c3[_0x05a3('0x32')][_0x05a3('0x33')]};});_0x309c9b['model']=_['map'](_0x1cc324,'name');_0x309c9b[_0x05a3('0x34')]=_[_0x05a3('0x35')](_0x45fa5a[_0x05a3('0x34')]);_0x309c9b['filters']=_['intersection'](_0x309c9b[_0x05a3('0x36')],_0x309c9b[_0x05a3('0x34')]);_0x505088[_0x05a3('0x37')]=_[_0x05a3('0x38')](_0x309c9b[_0x05a3('0x36')],qs[_0x05a3('0x39')](_0x45fa5a[_0x05a3('0x34')][_0x05a3('0x39')]));_0x505088[_0x05a3('0x37')]=_0x505088['attributes']['length']?_0x505088[_0x05a3('0x37')]:_0x309c9b['model'];if(!_0x45fa5a['query'][_0x05a3('0x3a')](_0x05a3('0x3b'))){_0x505088[_0x05a3('0x24')]=qs[_0x05a3('0x24')](_0x45fa5a[_0x05a3('0x34')]['limit']);_0x505088['offset']=qs[_0x05a3('0x22')](_0x45fa5a[_0x05a3('0x34')]['offset']);}_0x505088[_0x05a3('0x3c')]=qs[_0x05a3('0x3d')](_0x45fa5a[_0x05a3('0x34')][_0x05a3('0x3d')]);_0x505088[_0x05a3('0x3e')]=qs['filters'](_[_0x05a3('0x3f')](_0x45fa5a['query'],_0x309c9b[_0x05a3('0x40')]),_0x1cc324);if(_0x45fa5a[_0x05a3('0x34')]['filter']){_0x505088[_0x05a3('0x3e')]=_['merge'](_0x505088['where'],{'$or':_[_0x05a3('0x2f')](_0x1cc324,function(_0x1c412e){if(_0x1c412e[_0x05a3('0x32')]!==_0x05a3('0x41')){var _0x22cc44={};_0x22cc44[_0x1c412e['name']]={'$like':'%'+_0x45fa5a[_0x05a3('0x34')][_0x05a3('0x42')]+'%'};return _0x22cc44;}})});}_0x505088=_[_0x05a3('0x43')]({},_0x505088,_0x45fa5a[_0x05a3('0x44')]);var _0x51ce0b={'where':_0x505088[_0x05a3('0x3e')]};return db[_0x05a3('0x30')]['count'](_0x51ce0b)[_0x05a3('0x17')](function(_0x2f027b){_0x308c79[_0x05a3('0x25')]=_0x2f027b;if(_0x45fa5a[_0x05a3('0x34')]['includeAll']){_0x505088[_0x05a3('0x45')]=[{'all':!![]}];}return db[_0x05a3('0x30')]['findAll'](_0x505088);})['then'](function(_0x35d736){_0x308c79[_0x05a3('0x46')]=_0x35d736;return _0x308c79;})['then'](respondWithFilteredResult(_0x3eb591,_0x505088))['catch'](handleError(_0x3eb591,null));};exports[_0x05a3('0x47')]=function(_0x1dc9ab,_0x185b5f){var _0x3c8ac1={'raw':!![],'where':{'id':_0x1dc9ab[_0x05a3('0x48')]['id']}},_0x402383={};_0x402383[_0x05a3('0x36')]=_[_0x05a3('0x35')](db[_0x05a3('0x30')][_0x05a3('0x31')]);_0x402383[_0x05a3('0x34')]=_[_0x05a3('0x35')](_0x1dc9ab[_0x05a3('0x34')]);_0x402383[_0x05a3('0x40')]=_['intersection'](_0x402383[_0x05a3('0x36')],_0x402383[_0x05a3('0x34')]);_0x3c8ac1['attributes']=_[_0x05a3('0x38')](_0x402383[_0x05a3('0x36')],qs[_0x05a3('0x39')](_0x1dc9ab['query'][_0x05a3('0x39')]));_0x3c8ac1['attributes']=_0x3c8ac1[_0x05a3('0x37')]['length']?_0x3c8ac1[_0x05a3('0x37')]:_0x402383['model'];if(_0x1dc9ab[_0x05a3('0x34')][_0x05a3('0x49')]){_0x3c8ac1[_0x05a3('0x45')]=[{'all':!![]}];}_0x3c8ac1=_[_0x05a3('0x43')]({},_0x3c8ac1,_0x1dc9ab[_0x05a3('0x44')]);return db[_0x05a3('0x30')]['find'](_0x3c8ac1)[_0x05a3('0x17')](handleEntityNotFound(_0x185b5f,null))[_0x05a3('0x17')](respondWithResult(_0x185b5f,null))[_0x05a3('0x20')](handleError(_0x185b5f,null));};exports[_0x05a3('0x4a')]=function(_0x45c16a,_0x42f8a0){if(_0x45c16a[_0x05a3('0x4b')]['id']){delete _0x45c16a[_0x05a3('0x4b')]['id'];}return db[_0x05a3('0x30')][_0x05a3('0x4c')]({'where':{'id':_0x45c16a[_0x05a3('0x48')]['id']}})[_0x05a3('0x17')](handleEntityNotFound(_0x42f8a0,null))[_0x05a3('0x17')](saveUpdates(_0x45c16a[_0x05a3('0x4b')],null))[_0x05a3('0x17')](respondWithResult(_0x42f8a0,null))[_0x05a3('0x20')](handleError(_0x42f8a0,null));};exports[_0x05a3('0x29')]=function(_0x33a872,_0x49db0c){return db[_0x05a3('0x30')][_0x05a3('0x4c')]({'where':{'id':_0x33a872['params']['id']}})[_0x05a3('0x17')](handleEntityNotFound(_0x49db0c,null))['then'](removeEntity(_0x49db0c,null))[_0x05a3('0x20')](handleError(_0x49db0c,null));};exports[_0x05a3('0x4d')]=function(_0x101da0,_0x4b6324){return db[_0x05a3('0x30')]['describe']()[_0x05a3('0x17')](respondWithResult(_0x4b6324,null))[_0x05a3('0x20')](handleError(_0x4b6324,null));};exports['create']=function(_0x3ae75a,_0x33afe6){return db[_0x05a3('0x30')][_0x05a3('0x4e')](_0x3ae75a[_0x05a3('0x4b')])['then'](function(_0x4cf226){if(_0x4cf226){if(_0x4cf226[_0x05a3('0x4f')]===_0x05a3('0x50')&&!_0x4cf226[_0x05a3('0x51')]){var _0x462a18,_0x252266,_0x4e8737;if(_0x3ae75a['body']['to']){_0x252266=_0x3ae75a['body']['to']['split'](',')[0x0];}return db[_0x05a3('0x52')][_0x05a3('0x53')]({'where':{'id':_0x4cf226[_0x05a3('0x54')]},'include':[{'model':db[_0x05a3('0x55')],'as':_0x05a3('0x56'),'include':[{'model':db[_0x05a3('0x57')],'as':_0x05a3('0x58'),'where':{'email':_0x252266},'limit':0x1,'order':[[_0x05a3('0x59'),_0x05a3('0x5a')]]}]},{'model':db[_0x05a3('0x5b')],'as':_0x05a3('0x5c'),'raw':!![],'include':[{'model':db[_0x05a3('0x5d')],'as':_0x05a3('0x5d'),'raw':!![]}]}]})[_0x05a3('0x17')](function(_0x1e803c){_0x462a18=_0x1e803c;if(!_0x462a18||!_0x462a18[_0x05a3('0x5c')])return;var _0x632326=_0x462a18[_0x05a3('0x5e')]();if(_0x3ae75a['body'][_0x05a3('0x5f')]&&_0x3ae75a['body']['attachments'][_0x05a3('0x60')]){for(var _0x52ac62=0x0;_0x52ac62<_0x3ae75a[_0x05a3('0x4b')][_0x05a3('0x5f')]['length'];_0x52ac62+=0x1){_0x3ae75a[_0x05a3('0x4b')][_0x05a3('0x5f')][_0x52ac62]={'filename':_0x3ae75a[_0x05a3('0x4b')][_0x05a3('0x5f')][_0x52ac62][_0x05a3('0x2c')],'path':path[_0x05a3('0x61')](config['root'],_0x05a3('0x62'),_0x3ae75a[_0x05a3('0x4b')][_0x05a3('0x5f')][_0x52ac62][_0x05a3('0x63')])};}}_0x4e8737={'account':_0x632326,'message':_0x3ae75a[_0x05a3('0x4b')]};return;})['then'](function(){if(_0x462a18[_0x05a3('0x56')]){if(_0x462a18['List']['Contacts'][_0x05a3('0x60')]){return _0x462a18[_0x05a3('0x56')][_0x05a3('0x58')][0x0];}else{return db[_0x05a3('0x57')][_0x05a3('0x4e')](_[_0x05a3('0xe')](_0x3ae75a['body'],{'firstName':_0x3ae75a[_0x05a3('0x4b')]['to'],'email':_0x3ae75a[_0x05a3('0x4b')]['to'],'phone':_0x3ae75a[_0x05a3('0x4b')]['to'],'ListId':_0x462a18[_0x05a3('0x64')]}));}}else{throw new Error(_0x05a3('0x65'));}})[_0x05a3('0x17')](function(){if(_0x4e8737){return respondWithRpcPromise(_0x05a3('0x66'),_0x05a3('0x67'),_0x4e8737,client9003)[_0x05a3('0x17')](function(_0xeede6c){return _0x4cf226[_0x05a3('0x4a')]({'read':!![],'messageId':_0xeede6c[_0x05a3('0x68')],'sentAt':moment()[_0x05a3('0x69')](_0x05a3('0x6a'))});})[_0x05a3('0x20')](function(_0x477e96){logger['error']('%s',JSON['stringify'](_0x477e96));return _0x4cf226;});}return _0x4cf226;});}return _0x4cf226;}})[_0x05a3('0x17')](respondWithResult(_0x33afe6,0xc9))[_0x05a3('0x20')](handleError(_0x33afe6,null));};exports[_0x05a3('0x6b')]=function(_0x540d24,_0x4314eb){var _0x4a47a0={'agent':{},'channel':_0x05a3('0x6c')};if(_0x540d24[_0x05a3('0x4b')]['id']){delete _0x540d24[_0x05a3('0x4b')]['id'];}_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6d')]=!![];_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6e')]=moment()[_0x05a3('0x69')](_0x05a3('0x6a'));_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6f')]=_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6f')]||_0x540d24[_0x05a3('0x70')]['id'];_0x4a47a0[_0x05a3('0x71')]['id']=_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6f')];return db[_0x05a3('0x30')]['find']({'where':{'id':_0x540d24[_0x05a3('0x48')]['id'],'UserId':null}})[_0x05a3('0x17')](handleEntityNotFound(_0x4314eb,null))['then'](saveUpdates(_0x540d24['body'],null))[_0x05a3('0x17')](function(_0xef3a9f){if(_0xef3a9f){_0x4a47a0[_0x05a3('0x1d')]=_0xef3a9f[_0x05a3('0x72')]({'plain':!![]});return db[_0x05a3('0x73')][_0x05a3('0x4c')]({'where':{'id':_0xef3a9f['MailInteractionId']}});}return null;})[_0x05a3('0x17')](handleEntityNotFound(_0x4314eb,null))['then'](function(_0x58078a){if(_0x58078a){return _0x58078a[_0x05a3('0x4a')]({'UserId':_0x540d24[_0x05a3('0x4b')]['UserId'],'read1stAt':_[_0x05a3('0x74')](_0x58078a['read1stAt'])?moment()[_0x05a3('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x05a3('0x17')](function(_0x3674e1){if(_0x3674e1){_0x4a47a0[_0x05a3('0x75')]=_0x3674e1[_0x05a3('0x72')]({'plain':!![]});interaction_log[_0x05a3('0x1e')](_0x05a3('0x76'),_0x540d24[_0x05a3('0x70')]['id'],_0x540d24[_0x05a3('0x70')][_0x05a3('0x2c')],_0x540d24[_0x05a3('0x70')][_0x05a3('0x77')],_0x4a47a0[_0x05a3('0x75')]['id'],_0x540d24['body']?JSON[_0x05a3('0x78')](_0x540d24['body']):_0x05a3('0x79'));return respondWithRpcPromise(_0x05a3('0x7a'),_0x05a3('0x7b'),_0x4a47a0);}return null;})[_0x05a3('0x17')](function(_0x5b555d){var _0x3a4fae=_0x05a3('0x7c')+_0x5b555d[_0x05a3('0x1d')][_0x05a3('0x7d')];return db[_0x05a3('0x7e')][_0x05a3('0x34')](_0x3a4fae,{'type':db[_0x05a3('0x7f')][_0x05a3('0x80')][_0x05a3('0x81')],'raw':!![]})[_0x05a3('0x17')](function(_0x3f079b){return _0x3f079b;});})[_0x05a3('0x17')](function(_0x2d157e){if(_0x2d157e){_0x4a47a0[_0x05a3('0x1d')][_0x05a3('0x82')]=_0x2d157e[0x0];if(!_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6f')])return;return db['User']['find']({'where':{'id':_0x540d24[_0x05a3('0x4b')][_0x05a3('0x6f')],'role':_0x05a3('0x71')},'attributes':['id',_0x05a3('0x2c'),_0x05a3('0x83'),_0x05a3('0x84'),_0x05a3('0x85')],'raw':!![]});}return null;})[_0x05a3('0x17')](function(_0x3aacc7){if(!_0x3aacc7)return null;_0x4a47a0[_0x05a3('0x1d')]['agent']=_0x3aacc7;return _0x4a47a0;})[_0x05a3('0x17')](function(_0x36611d){if(_0x36611d){if(_0x540d24[_0x05a3('0x4b')][_0x05a3('0x86')]){_0x4a47a0[_0x05a3('0x1d')][_0x05a3('0x87')]=util[_0x05a3('0x69')]('SIP/%s',_0x540d24[_0x05a3('0x70')][_0x05a3('0x2c')]);_0x4a47a0[_0x05a3('0x1d')][_0x05a3('0x88')]=_0x4a47a0[_0x05a3('0x88')];_0x4a47a0[_0x05a3('0x1d')][_0x05a3('0x89')]=_0x4a47a0[_0x05a3('0x88')];_0x4a47a0[_0x05a3('0x1d')][_0x05a3('0x8a')]=_0x05a3('0x6b');_0x4a47a0['message'][_0x05a3('0x4b')]=htmlToText['fromString'](_0x4a47a0[_0x05a3('0x1d')]['body']);return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x4a47a0[_0x05a3('0x1d')]},client9002)[_0x05a3('0x17')](function(){return _0x4a47a0;});}return _0x4a47a0;}return null;})[_0x05a3('0x17')](respondWithResult(_0x4314eb,null))['catch'](handleError(_0x4314eb,null));};exports[_0x05a3('0x8b')]=function(_0x4d9400,_0xb6320c){var _0x3c8ddb={'agent':{},'channel':'mail'};if(_0x4d9400[_0x05a3('0x4b')]['id']){delete _0x4d9400[_0x05a3('0x4b')]['id'];}_0x4d9400[_0x05a3('0x4b')][_0x05a3('0x6f')]=_0x4d9400[_0x05a3('0x4b')][_0x05a3('0x6f')]||_0x4d9400[_0x05a3('0x70')]['id'];_0x3c8ddb[_0x05a3('0x71')]['id']=_0x4d9400['body'][_0x05a3('0x6f')];return db[_0x05a3('0x30')]['find']({'where':{'id':_0x4d9400[_0x05a3('0x48')]['id'],'UserId':null}})[_0x05a3('0x17')](handleEntityNotFound(_0xb6320c,null))[_0x05a3('0x17')](function(_0x3cb8d5){if(_0x3cb8d5){_0x3c8ddb['message']=_0x3cb8d5[_0x05a3('0x72')]({'plain':!![]});return db[_0x05a3('0x73')][_0x05a3('0x4c')]({'where':{'id':_0x3cb8d5[_0x05a3('0x8c')]}});}return null;})[_0x05a3('0x17')](handleEntityNotFound(_0xb6320c,null))[_0x05a3('0x17')](function(_0x17e409){if(_0x17e409){_0x3c8ddb[_0x05a3('0x75')]=_0x17e409[_0x05a3('0x72')]({'plain':!![]});interaction_log['info'](_0x05a3('0x8d'),_0x4d9400['user']['id'],_0x4d9400[_0x05a3('0x70')][_0x05a3('0x2c')],_0x4d9400[_0x05a3('0x70')][_0x05a3('0x77')],_0x3c8ddb['interaction']['id'],_0x4d9400['body']?JSON[_0x05a3('0x78')](_0x4d9400[_0x05a3('0x4b')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3c8ddb);}return null;})['then'](function(_0x289df6){var _0x2d550e=_0x05a3('0x7c')+_0x289df6[_0x05a3('0x1d')][_0x05a3('0x7d')];return db['sequelize'][_0x05a3('0x34')](_0x2d550e,{'type':db[_0x05a3('0x7f')]['QueryTypes'][_0x05a3('0x81')],'raw':!![]})[_0x05a3('0x17')](function(_0x267c0b){return _0x267c0b;});})[_0x05a3('0x17')](function(_0x217706){if(_0x217706){_0x3c8ddb[_0x05a3('0x1d')]['contact']=_0x217706[0x0];if(!_0x4d9400[_0x05a3('0x4b')][_0x05a3('0x6f')])return;return db[_0x05a3('0x8e')]['find']({'where':{'id':_0x4d9400[_0x05a3('0x4b')][_0x05a3('0x6f')],'role':'agent'},'attributes':['id',_0x05a3('0x2c'),_0x05a3('0x83'),_0x05a3('0x84'),_0x05a3('0x85')],'raw':!![]});}return null;})['then'](function(_0xfce671){if(!_0xfce671)return null;_0x3c8ddb[_0x05a3('0x1d')][_0x05a3('0x71')]=_0xfce671;return _0x3c8ddb;})[_0x05a3('0x17')](function(_0x4bdaf1){if(_0x4bdaf1){_0x4bdaf1[_0x05a3('0x1d')][_0x05a3('0x87')]=util[_0x05a3('0x69')]('SIP/%s',_0x4d9400[_0x05a3('0x70')][_0x05a3('0x2c')]);_0x4bdaf1[_0x05a3('0x1d')][_0x05a3('0x88')]=_0x3c8ddb[_0x05a3('0x88')];_0x4bdaf1[_0x05a3('0x1d')][_0x05a3('0x89')]=_0x3c8ddb[_0x05a3('0x88')];_0x4bdaf1[_0x05a3('0x1d')][_0x05a3('0x8a')]='reject';_0x4bdaf1['message'][_0x05a3('0x4b')]=htmlToText[_0x05a3('0x8f')](_0x3c8ddb['message']['body']);respondWithRpcPromise('EventManager',_0x05a3('0x90'),{'event':_0x05a3('0x91'),'message':_0x4bdaf1[_0x05a3('0x1d')]},client9002);return _0x3c8ddb;}return null;})[_0x05a3('0x17')](respondWithResult(_0xb6320c,null))[_0x05a3('0x20')](handleError(_0xb6320c,null));};exports['download']=function(_0x134bfd,_0x1a558f){var _0x57db7c=moment()[_0x05a3('0x92')]()[_0x05a3('0x93')]();var _0x35b684=path[_0x05a3('0x61')](config[_0x05a3('0x94')],_0x05a3('0x95'),'files',_0x05a3('0x96'));var _0x177282=path[_0x05a3('0x61')](config[_0x05a3('0x94')],_0x05a3('0x95'),_0x05a3('0x97'),_0x05a3('0x5f'));var _0x9bce1b=util[_0x05a3('0x69')]('message-%s.eml',_0x57db7c);return db['MailMessage'][_0x05a3('0x4c')]({'where':{'id':_0x134bfd[_0x05a3('0x48')]['id']},'attributes':['id',_0x05a3('0x4b'),_0x05a3('0x98'),'to','cc','bcc','subject',_0x05a3('0x99')],'include':_0x134bfd[_0x05a3('0x34')][_0x05a3('0x5f')]?[{'model':db[_0x05a3('0x9a')],'as':'Attachments'}]:undefined})[_0x05a3('0x17')](handleEntityNotFound(_0x1a558f,null))[_0x05a3('0x17')](function(_0x478b9c){if(_0x478b9c){var _0x54775a=_0x478b9c;var _0x1d548f={'from':_0x54775a[_0x05a3('0x98')],'to':_0x54775a['to'],'subject':_0x54775a[_0x05a3('0x9b')],'html':htmlEntities[_0x05a3('0x9c')](_0x54775a[_0x05a3('0x4b')]),'headers':{'Date':moment(_0x54775a[_0x05a3('0x99')])[_0x05a3('0x69')](_0x05a3('0x9d'))},'attachments':[]};if(_0x478b9c['cc']){_0x1d548f['headers']['Cc']=_0x478b9c['cc'];}if(_0x478b9c['bcc']){_0x1d548f['headers'][_0x05a3('0x9e')]=_0x478b9c[_0x05a3('0x9f')];}return new BPromise(function(_0x2821ce,_0x20cccf){if(_0x478b9c[_0x05a3('0xa0')]){for(var _0x418079=0x0;_0x418079<_0x478b9c[_0x05a3('0xa0')]['length'];_0x418079++){var _0x57b55b=_0x478b9c[_0x05a3('0xa0')][_0x418079];var _0x44e5a7=path[_0x05a3('0x61')](_0x177282,_0x57b55b[_0x05a3('0x63')]);if(fs[_0x05a3('0xa1')](_0x44e5a7)){_0x1d548f['attachments'][_0x05a3('0xa2')]({'name':_0x57b55b['name'],'contentType':_0x57b55b[_0x05a3('0x32')],'data':fs['readFileSync'](_0x44e5a7)});}}}emlformat[_0x05a3('0xa3')](_0x1d548f,function(_0x2b4a21,_0x579760){if(_0x2b4a21)return _0x20cccf(_0x2b4a21);fs['writeFileSync'](path[_0x05a3('0x61')](_0x35b684,_0x9bce1b),_0x579760);return _0x2821ce(_0x579760);});});}})[_0x05a3('0x17')](function(_0x4d7456){if(_0x4d7456){return _0x1a558f[_0x05a3('0xa4')](path[_0x05a3('0x61')](_0x35b684,_0x9bce1b),_0x9bce1b,function(_0x489b88){if(!_0x489b88)fs[_0x05a3('0xa5')](path[_0x05a3('0x61')](_0x35b684,_0x9bce1b));});}})[_0x05a3('0x20')](handleError(_0x1a558f,null));}; \ No newline at end of file +var _0x6f41=['http','request','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','json','undefined','limit','offset','status','Content-Range','destroy','end','sendStatus','stack','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','MailMessage','count','include','findAll','rows','params','keys','includeAll','find','body','describe','create','direction','out','secret','MailAccount','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','sendMail','update','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','user','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','sequelize','download','toString','server','files','from','bcc','createdAt','Attachment','Attachments','decode','headers','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client'];(function(_0x298cb8,_0x2e74ce){var _0x40b911=function(_0x5bbcba){while(--_0x5bbcba){_0x298cb8['push'](_0x298cb8['shift']());}};_0x40b911(++_0x2e74ce);}(_0x6f41,0x1b5));var _0x16f4=function(_0x3eb4df,_0x500f16){_0x3eb4df=_0x3eb4df-0x0;var _0x5a6c36=_0x6f41[_0x3eb4df];return _0x5a6c36;};'use strict';var emlformat=require(_0x16f4('0x0'));var moment=require(_0x16f4('0x1'));var BPromise=require(_0x16f4('0x2'));var util=require('util');var path=require(_0x16f4('0x3'));var fs=require('fs');var _=require(_0x16f4('0x4'));var Redis=require(_0x16f4('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x16f4('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0x16f4('0x7'))['db'];config[_0x16f4('0x8')]=_[_0x16f4('0x9')](config[_0x16f4('0x8')],{'host':_0x16f4('0xa'),'port':0x18eb});var socket=require(_0x16f4('0xb'))(new Redis(config[_0x16f4('0x8')]));var htmlEntities=require(_0x16f4('0xc'));require(_0x16f4('0xd'))['register'](socket);var jayson=require(_0x16f4('0xe'));var client=jayson[_0x16f4('0xf')][_0x16f4('0x10')]({'port':0x232c});var client9003=jayson[_0x16f4('0xf')][_0x16f4('0x10')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2de6ec,_0x590525,_0x5628f8,_0x3c49b2){return new BPromise(function(_0x27e638,_0x505d93){var _0x4c80f7=_0x3c49b2||client;return _0x4c80f7[_0x16f4('0x11')](_0x2de6ec,_0x5628f8)[_0x16f4('0x12')](function(_0x482de8){logger[_0x16f4('0x13')](_0x16f4('0x14'),_0x590525,'request\x20sent');logger[_0x16f4('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x590525,_0x16f4('0x16'),JSON['stringify'](_0x482de8));if(_0x482de8[_0x16f4('0x17')]){if(_0x482de8['error']['code']===0x1f4){logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x482de8[_0x16f4('0x17')][_0x16f4('0x18')]);return _0x505d93(_0x482de8[_0x16f4('0x17')][_0x16f4('0x18')]);}logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x482de8['error'][_0x16f4('0x18')]);return _0x27e638(_0x482de8['error'][_0x16f4('0x18')]);}else{logger[_0x16f4('0x13')](_0x16f4('0x14'),_0x590525,_0x16f4('0x16'));_0x27e638(_0x482de8[_0x16f4('0x19')]['message']);}})[_0x16f4('0x1a')](function(_0x3ad78b){logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x3ad78b);_0x505d93(_0x3ad78b);});});}function respondWithResult(_0x6d86d5,_0x425aba){_0x425aba=_0x425aba||0xc8;return function(_0x142b5d){if(_0x142b5d){return _0x6d86d5['status'](_0x425aba)[_0x16f4('0x1b')](_0x142b5d);}};}function respondWithFilteredResult(_0x314835,_0x3c533a){return function(_0x5bd60f){if(_0x5bd60f){var _0x225312=typeof _0x3c533a['offset']===_0x16f4('0x1c')&&typeof _0x3c533a[_0x16f4('0x1d')]===_0x16f4('0x1c');var _0x29835a=_0x5bd60f['count'];var _0x1cde8d=_0x225312?0x0:_0x3c533a[_0x16f4('0x1e')];var _0x1f9fe4=_0x225312?_0x5bd60f['count']:_0x3c533a[_0x16f4('0x1e')]+_0x3c533a['limit'];var _0xad782;if(_0x1f9fe4>=_0x29835a){_0x1f9fe4=_0x29835a;_0xad782=0xc8;}else{_0xad782=0xce;}_0x314835[_0x16f4('0x1f')](_0xad782);return _0x314835['set'](_0x16f4('0x20'),_0x1cde8d+'-'+_0x1f9fe4+'/'+_0x29835a)[_0x16f4('0x1b')](_0x5bd60f);}return null;};}function saveUpdates(_0x1b10c9){return function(_0x5ed91f){if(_0x5ed91f){return _0x5ed91f['update'](_0x1b10c9)['then'](function(_0x3d4466){return _0x3d4466;});}return null;};}function removeEntity(_0x20f407){return function(_0x4b101f){if(_0x4b101f){return _0x4b101f[_0x16f4('0x21')]()[_0x16f4('0x12')](function(){_0x20f407[_0x16f4('0x1f')](0xcc)[_0x16f4('0x22')]();});}};}function handleEntityNotFound(_0x3e9b87){return function(_0x31c402){if(!_0x31c402){_0x3e9b87[_0x16f4('0x23')](0x194);}return _0x31c402;};}function handleError(_0x2f5322,_0x584180){_0x584180=_0x584180||0x1f4;return function(_0x43a330){logger[_0x16f4('0x17')](_0x43a330[_0x16f4('0x24')]);if(_0x43a330['name']){delete _0x43a330['name'];}_0x2f5322[_0x16f4('0x1f')](_0x584180)['send'](_0x43a330);};}exports['index']=function(_0x2edb77,_0x46cc98){var _0x303ced={},_0x1b43ca={},_0x1bda5a={'count':0x0,'rows':[]};var _0x1578f7=_[_0x16f4('0x25')](db['MailMessage'][_0x16f4('0x26')],function(_0x320425){return{'name':_0x320425[_0x16f4('0x27')],'type':_0x320425[_0x16f4('0x28')][_0x16f4('0x29')]};});_0x1b43ca[_0x16f4('0x2a')]=_['map'](_0x1578f7,_0x16f4('0x2b'));_0x1b43ca['query']=_['keys'](_0x2edb77[_0x16f4('0x2c')]);_0x1b43ca[_0x16f4('0x2d')]=_[_0x16f4('0x2e')](_0x1b43ca[_0x16f4('0x2a')],_0x1b43ca[_0x16f4('0x2c')]);_0x303ced[_0x16f4('0x2f')]=_[_0x16f4('0x2e')](_0x1b43ca[_0x16f4('0x2a')],qs['fields'](_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x30')]));_0x303ced[_0x16f4('0x2f')]=_0x303ced['attributes'][_0x16f4('0x31')]?_0x303ced[_0x16f4('0x2f')]:_0x1b43ca[_0x16f4('0x2a')];if(!_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x32')](_0x16f4('0x33'))){_0x303ced['limit']=qs['limit'](_0x2edb77['query'][_0x16f4('0x1d')]);_0x303ced['offset']=qs['offset'](_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x1e')]);}_0x303ced[_0x16f4('0x34')]=qs[_0x16f4('0x35')](_0x2edb77[_0x16f4('0x2c')]['sort']);_0x303ced[_0x16f4('0x36')]=qs[_0x16f4('0x2d')](_[_0x16f4('0x37')](_0x2edb77[_0x16f4('0x2c')],_0x1b43ca['filters']),_0x1578f7);if(_0x2edb77[_0x16f4('0x2c')]['filter']){_0x303ced[_0x16f4('0x36')]=_[_0x16f4('0x38')](_0x303ced[_0x16f4('0x36')],{'$or':_[_0x16f4('0x25')](_0x1578f7,function(_0x43d1e8){if(_0x43d1e8[_0x16f4('0x28')]!==_0x16f4('0x39')){var _0x57ca70={};_0x57ca70[_0x43d1e8[_0x16f4('0x2b')]]={'$like':'%'+_0x2edb77[_0x16f4('0x2c')]['filter']+'%'};return _0x57ca70;}})});}_0x303ced=_[_0x16f4('0x38')]({},_0x303ced,_0x2edb77[_0x16f4('0x3a')]);var _0x48a875={'where':_0x303ced['where']};return db[_0x16f4('0x3b')]['count'](_0x48a875)['then'](function(_0x1d7cf7){_0x1bda5a[_0x16f4('0x3c')]=_0x1d7cf7;if(_0x2edb77[_0x16f4('0x2c')]['includeAll']){_0x303ced[_0x16f4('0x3d')]=[{'all':!![]}];}return db[_0x16f4('0x3b')][_0x16f4('0x3e')](_0x303ced);})[_0x16f4('0x12')](function(_0xc67df1){_0x1bda5a[_0x16f4('0x3f')]=_0xc67df1;return _0x1bda5a;})[_0x16f4('0x12')](respondWithFilteredResult(_0x46cc98,_0x303ced))[_0x16f4('0x1a')](handleError(_0x46cc98,null));};exports['show']=function(_0x22dfa6,_0x3729c2){var _0x50646a={'raw':!![],'where':{'id':_0x22dfa6[_0x16f4('0x40')]['id']}},_0x337703={};_0x337703[_0x16f4('0x2a')]=_['keys'](db[_0x16f4('0x3b')]['rawAttributes']);_0x337703['query']=_[_0x16f4('0x41')](_0x22dfa6['query']);_0x337703['filters']=_[_0x16f4('0x2e')](_0x337703[_0x16f4('0x2a')],_0x337703[_0x16f4('0x2c')]);_0x50646a[_0x16f4('0x2f')]=_[_0x16f4('0x2e')](_0x337703['model'],qs[_0x16f4('0x30')](_0x22dfa6[_0x16f4('0x2c')][_0x16f4('0x30')]));_0x50646a[_0x16f4('0x2f')]=_0x50646a[_0x16f4('0x2f')][_0x16f4('0x31')]?_0x50646a[_0x16f4('0x2f')]:_0x337703[_0x16f4('0x2a')];if(_0x22dfa6['query'][_0x16f4('0x42')]){_0x50646a['include']=[{'all':!![]}];}_0x50646a=_['merge']({},_0x50646a,_0x22dfa6[_0x16f4('0x3a')]);return db['MailMessage'][_0x16f4('0x43')](_0x50646a)[_0x16f4('0x12')](handleEntityNotFound(_0x3729c2,null))[_0x16f4('0x12')](respondWithResult(_0x3729c2,null))[_0x16f4('0x1a')](handleError(_0x3729c2,null));};exports['update']=function(_0x25eeed,_0x53ecac){if(_0x25eeed[_0x16f4('0x44')]['id']){delete _0x25eeed[_0x16f4('0x44')]['id'];}return db['MailMessage'][_0x16f4('0x43')]({'where':{'id':_0x25eeed['params']['id']}})['then'](handleEntityNotFound(_0x53ecac,null))['then'](saveUpdates(_0x25eeed[_0x16f4('0x44')],null))['then'](respondWithResult(_0x53ecac,null))['catch'](handleError(_0x53ecac,null));};exports[_0x16f4('0x21')]=function(_0x4e1fb7,_0x1a4058){return db[_0x16f4('0x3b')][_0x16f4('0x43')]({'where':{'id':_0x4e1fb7[_0x16f4('0x40')]['id']}})[_0x16f4('0x12')](handleEntityNotFound(_0x1a4058,null))[_0x16f4('0x12')](removeEntity(_0x1a4058,null))[_0x16f4('0x1a')](handleError(_0x1a4058,null));};exports['describe']=function(_0x40c360,_0x58b78b){return db[_0x16f4('0x3b')][_0x16f4('0x45')]()[_0x16f4('0x12')](respondWithResult(_0x58b78b,null))[_0x16f4('0x1a')](handleError(_0x58b78b,null));};exports['create']=function(_0x441f7e,_0x5d478e){return db['MailMessage'][_0x16f4('0x46')](_0x441f7e[_0x16f4('0x44')])[_0x16f4('0x12')](function(_0x30a494){if(_0x30a494){if(_0x30a494[_0x16f4('0x47')]===_0x16f4('0x48')&&!_0x30a494[_0x16f4('0x49')]){var _0x2be620,_0xd45eb3,_0x396234;if(_0x441f7e[_0x16f4('0x44')]['to']){_0xd45eb3=_0x441f7e[_0x16f4('0x44')]['to']['split'](',')[0x0];}return db[_0x16f4('0x4a')][_0x16f4('0x4b')]({'where':{'id':_0x30a494['MailAccountId']},'include':[{'model':db[_0x16f4('0x4c')],'as':_0x16f4('0x4d'),'include':[{'model':db['CmContact'],'as':_0x16f4('0x4e'),'where':{'email':_0xd45eb3},'limit':0x1,'order':[[_0x16f4('0x4f'),_0x16f4('0x50')]]}]},{'model':db[_0x16f4('0x51')],'as':_0x16f4('0x52'),'raw':!![],'include':[{'model':db[_0x16f4('0x53')],'as':_0x16f4('0x53'),'raw':!![]}]}]})[_0x16f4('0x12')](function(_0x5ada75){_0x2be620=_0x5ada75;if(!_0x2be620||!_0x2be620['Smtp'])return;var _0x1dd2e9=_0x2be620['getSmtpOptions']();if(_0x441f7e[_0x16f4('0x44')][_0x16f4('0x54')]&&_0x441f7e[_0x16f4('0x44')][_0x16f4('0x54')][_0x16f4('0x31')]){for(var _0x178968=0x0;_0x178968<_0x441f7e['body'][_0x16f4('0x54')][_0x16f4('0x31')];_0x178968+=0x1){_0x441f7e['body'][_0x16f4('0x54')][_0x178968]={'filename':_0x441f7e['body'][_0x16f4('0x54')][_0x178968][_0x16f4('0x2b')],'path':path[_0x16f4('0x55')](config[_0x16f4('0x56')],_0x16f4('0x57'),_0x441f7e['body'][_0x16f4('0x54')][_0x178968][_0x16f4('0x58')])};}}_0x396234={'account':_0x1dd2e9,'message':_0x441f7e[_0x16f4('0x44')]};return;})[_0x16f4('0x12')](function(){if(_0x2be620[_0x16f4('0x4d')]){if(_0x2be620[_0x16f4('0x4d')][_0x16f4('0x4e')][_0x16f4('0x31')]){return _0x2be620[_0x16f4('0x4d')][_0x16f4('0x4e')][0x0];}else{return db[_0x16f4('0x59')][_0x16f4('0x46')](_['defaults'](_0x441f7e[_0x16f4('0x44')],{'firstName':_0x441f7e[_0x16f4('0x44')]['to'],'email':_0x441f7e['body']['to'],'phone':_0x441f7e[_0x16f4('0x44')]['to'],'ListId':_0x2be620[_0x16f4('0x5a')]}));}}else{throw new Error(_0x16f4('0x5b'));}})[_0x16f4('0x12')](function(){if(_0x396234){return respondWithRpcPromise('SendMail',_0x16f4('0x5c'),_0x396234,client9003)[_0x16f4('0x12')](function(_0x8da76e){return _0x30a494[_0x16f4('0x5d')]({'read':!![],'messageId':_0x8da76e['messageId'],'sentAt':moment()[_0x16f4('0x5e')](_0x16f4('0x5f'))});})[_0x16f4('0x1a')](function(_0x1c85ef){logger[_0x16f4('0x17')]('%s',JSON[_0x16f4('0x60')](_0x1c85ef));return _0x30a494;});}return _0x30a494;});}return _0x30a494;}})[_0x16f4('0x12')](respondWithResult(_0x5d478e,0xc9))['catch'](handleError(_0x5d478e,null));};exports[_0x16f4('0x61')]=function(_0xa0ee12,_0x540740){var _0x5c63b0={'agent':{},'channel':'mail'};if(_0xa0ee12[_0x16f4('0x44')]['id']){delete _0xa0ee12[_0x16f4('0x44')]['id'];}_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x62')]=!![];_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x63')]=moment()[_0x16f4('0x5e')](_0x16f4('0x5f'));_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')]=_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')]||_0xa0ee12['user']['id'];_0x5c63b0[_0x16f4('0x65')]['id']=_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')];return db[_0x16f4('0x3b')]['find']({'where':{'id':_0xa0ee12[_0x16f4('0x40')]['id'],'UserId':null}})[_0x16f4('0x12')](handleEntityNotFound(_0x540740,null))[_0x16f4('0x12')](saveUpdates(_0xa0ee12[_0x16f4('0x44')],null))[_0x16f4('0x12')](function(_0x1bb89c){if(_0x1bb89c){_0x5c63b0[_0x16f4('0x18')]=_0x1bb89c[_0x16f4('0x66')]({'plain':!![]});return db[_0x16f4('0x67')][_0x16f4('0x43')]({'where':{'id':_0x1bb89c[_0x16f4('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x540740,null))[_0x16f4('0x12')](function(_0x407457){if(_0x407457){return _0x407457['update']({'UserId':_0xa0ee12['body'][_0x16f4('0x64')],'read1stAt':_[_0x16f4('0x69')](_0x407457['read1stAt'])?moment()['format'](_0x16f4('0x5f')):undefined});}return null;})[_0x16f4('0x12')](function(_0x2a390d){if(_0x2a390d){_0x5c63b0['interaction']=_0x2a390d[_0x16f4('0x66')]({'plain':!![]});interaction_log[_0x16f4('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa0ee12[_0x16f4('0x6a')]['id'],_0xa0ee12[_0x16f4('0x6a')][_0x16f4('0x2b')],_0xa0ee12[_0x16f4('0x6a')]['role'],_0x5c63b0[_0x16f4('0x6b')]['id'],_0xa0ee12[_0x16f4('0x44')]?JSON[_0x16f4('0x60')](_0xa0ee12[_0x16f4('0x44')]):'null');return respondWithRpcPromise(_0x16f4('0x6c'),_0x16f4('0x6d'),_0x5c63b0);}return null;})[_0x16f4('0x12')](function(_0x4d4b2b){var _0x4e8ed9=_0x16f4('0x6e')+_0x4d4b2b[_0x16f4('0x18')][_0x16f4('0x6f')];return db['sequelize'][_0x16f4('0x2c')](_0x4e8ed9,{'type':db[_0x16f4('0x70')][_0x16f4('0x71')][_0x16f4('0x72')],'raw':!![]})[_0x16f4('0x12')](function(_0x5844c5){return _0x5844c5;});})[_0x16f4('0x12')](function(_0x5e6c48){if(_0x5e6c48){_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x73')]=_0x5e6c48[0x0];if(!_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')])return;return db[_0x16f4('0x74')][_0x16f4('0x43')]({'where':{'id':_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')],'role':_0x16f4('0x65')},'attributes':['id',_0x16f4('0x2b'),_0x16f4('0x75'),'email',_0x16f4('0x76')],'raw':!![]});}return null;})['then'](function(_0x20f2bc){if(!_0x20f2bc)return null;_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x65')]=_0x20f2bc;return _0x5c63b0;})[_0x16f4('0x12')](function(_0x236008){if(_0x236008){if(_0xa0ee12[_0x16f4('0x44')]['manual']){_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x77')]=util[_0x16f4('0x5e')](_0x16f4('0x78'),_0xa0ee12[_0x16f4('0x6a')][_0x16f4('0x2b')]);_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x79')]=_0x5c63b0['channel'];_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x7a')]=_0x5c63b0[_0x16f4('0x79')];_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x7b')]=_0x16f4('0x61');_0x5c63b0['message']['body']=htmlToText[_0x16f4('0x7c')](_0x5c63b0[_0x16f4('0x18')]['body']);return respondWithRpcPromise(_0x16f4('0x7d'),_0x16f4('0x7d'),{'event':_0x16f4('0x7e'),'message':_0x5c63b0[_0x16f4('0x18')]},client9002)['then'](function(){return _0x5c63b0;});}return _0x5c63b0;}return null;})[_0x16f4('0x12')](respondWithResult(_0x540740,null))[_0x16f4('0x1a')](handleError(_0x540740,null));};exports[_0x16f4('0x7f')]=function(_0x58a637,_0x361243){var _0xc0d5ff={'agent':{},'channel':_0x16f4('0x80')};if(_0x58a637['body']['id']){delete _0x58a637[_0x16f4('0x44')]['id'];}_0x58a637[_0x16f4('0x44')][_0x16f4('0x64')]=_0x58a637['body'][_0x16f4('0x64')]||_0x58a637[_0x16f4('0x6a')]['id'];_0xc0d5ff[_0x16f4('0x65')]['id']=_0x58a637[_0x16f4('0x44')]['UserId'];return db[_0x16f4('0x3b')]['find']({'where':{'id':_0x58a637[_0x16f4('0x40')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x361243,null))['then'](function(_0x373795){if(_0x373795){_0xc0d5ff[_0x16f4('0x18')]=_0x373795['get']({'plain':!![]});return db[_0x16f4('0x67')][_0x16f4('0x43')]({'where':{'id':_0x373795[_0x16f4('0x68')]}});}return null;})[_0x16f4('0x12')](handleEntityNotFound(_0x361243,null))[_0x16f4('0x12')](function(_0x172097){if(_0x172097){_0xc0d5ff[_0x16f4('0x6b')]=_0x172097[_0x16f4('0x66')]({'plain':!![]});interaction_log[_0x16f4('0x13')](_0x16f4('0x81'),_0x58a637['user']['id'],_0x58a637[_0x16f4('0x6a')][_0x16f4('0x2b')],_0x58a637[_0x16f4('0x6a')][_0x16f4('0x82')],_0xc0d5ff[_0x16f4('0x6b')]['id'],_0x58a637[_0x16f4('0x44')]?JSON[_0x16f4('0x60')](_0x58a637['body']):_0x16f4('0x83'));return respondWithRpcPromise(_0x16f4('0x84'),'rejectMessage',_0xc0d5ff);}return null;})[_0x16f4('0x12')](function(_0x3c5c37){var _0x1c7342=_0x16f4('0x6e')+_0x3c5c37['message']['ContactId'];return db[_0x16f4('0x85')][_0x16f4('0x2c')](_0x1c7342,{'type':db[_0x16f4('0x70')]['QueryTypes'][_0x16f4('0x72')],'raw':!![]})['then'](function(_0x2a63b9){return _0x2a63b9;});})['then'](function(_0x479e1e){if(_0x479e1e){_0xc0d5ff[_0x16f4('0x18')][_0x16f4('0x73')]=_0x479e1e[0x0];if(!_0x58a637[_0x16f4('0x44')][_0x16f4('0x64')])return;return db[_0x16f4('0x74')][_0x16f4('0x43')]({'where':{'id':_0x58a637['body']['UserId'],'role':_0x16f4('0x65')},'attributes':['id',_0x16f4('0x2b'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x16f4('0x12')](function(_0x55f4b7){if(!_0x55f4b7)return null;_0xc0d5ff[_0x16f4('0x18')]['agent']=_0x55f4b7;return _0xc0d5ff;})[_0x16f4('0x12')](function(_0x197dde){if(_0x197dde){_0x197dde[_0x16f4('0x18')][_0x16f4('0x77')]=util['format'](_0x16f4('0x78'),_0x58a637['user'][_0x16f4('0x2b')]);_0x197dde[_0x16f4('0x18')][_0x16f4('0x79')]=_0xc0d5ff[_0x16f4('0x79')];_0x197dde['message'][_0x16f4('0x7a')]=_0xc0d5ff[_0x16f4('0x79')];_0x197dde['message'][_0x16f4('0x7b')]='reject';_0x197dde[_0x16f4('0x18')][_0x16f4('0x44')]=htmlToText['fromString'](_0xc0d5ff[_0x16f4('0x18')][_0x16f4('0x44')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x197dde[_0x16f4('0x18')]},client9002);return _0xc0d5ff;}return null;})[_0x16f4('0x12')](respondWithResult(_0x361243,null))[_0x16f4('0x1a')](handleError(_0x361243,null));};exports[_0x16f4('0x86')]=function(_0xc6ae40,_0xbdd1a4){var _0x149ae1=moment()['unix']()[_0x16f4('0x87')]();var _0x3a7bda=path[_0x16f4('0x55')](config[_0x16f4('0x56')],_0x16f4('0x88'),_0x16f4('0x89'),'tmp');var _0x4528e3=path[_0x16f4('0x55')](config['root'],_0x16f4('0x88'),'files',_0x16f4('0x54'));var _0x4beeca=util['format']('message-%s.eml',_0x149ae1);return db[_0x16f4('0x3b')]['find']({'where':{'id':_0xc6ae40[_0x16f4('0x40')]['id']},'attributes':['id',_0x16f4('0x44'),_0x16f4('0x8a'),'to','cc',_0x16f4('0x8b'),'subject',_0x16f4('0x8c')],'include':_0xc6ae40[_0x16f4('0x2c')][_0x16f4('0x54')]?[{'model':db[_0x16f4('0x8d')],'as':_0x16f4('0x8e')}]:undefined})[_0x16f4('0x12')](handleEntityNotFound(_0xbdd1a4,null))[_0x16f4('0x12')](function(_0x3fbc62){if(_0x3fbc62){var _0x4b296d=_0x3fbc62;var _0x56fcf9={'from':_0x4b296d[_0x16f4('0x8a')],'to':_0x4b296d['to'],'subject':_0x4b296d['subject'],'html':htmlEntities[_0x16f4('0x8f')](_0x4b296d[_0x16f4('0x44')]),'headers':{'Date':moment(_0x4b296d[_0x16f4('0x8c')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3fbc62['cc']){_0x56fcf9[_0x16f4('0x90')]['Cc']=_0x3fbc62['cc'];}if(_0x3fbc62[_0x16f4('0x8b')]){_0x56fcf9['headers']['Bcc']=_0x3fbc62[_0x16f4('0x8b')];}return new BPromise(function(_0xb92bad,_0x106922){if(_0x3fbc62[_0x16f4('0x8e')]){for(var _0x5bd5a3=0x0;_0x5bd5a3<_0x3fbc62[_0x16f4('0x8e')][_0x16f4('0x31')];_0x5bd5a3++){var _0x4f8dcb=_0x3fbc62[_0x16f4('0x8e')][_0x5bd5a3];var _0x4fc9da=path[_0x16f4('0x55')](_0x4528e3,_0x4f8dcb[_0x16f4('0x58')]);if(fs[_0x16f4('0x91')](_0x4fc9da)){_0x56fcf9[_0x16f4('0x54')][_0x16f4('0x92')]({'name':_0x4f8dcb[_0x16f4('0x2b')],'contentType':_0x4f8dcb[_0x16f4('0x28')],'data':fs[_0x16f4('0x93')](_0x4fc9da)});}}}emlformat[_0x16f4('0x94')](_0x56fcf9,function(_0x45c278,_0x18e316){if(_0x45c278)return _0x106922(_0x45c278);fs[_0x16f4('0x95')](path['join'](_0x3a7bda,_0x4beeca),_0x18e316);return _0xb92bad(_0x18e316);});});}})[_0x16f4('0x12')](function(_0x663750){if(_0x663750){return _0xbdd1a4[_0x16f4('0x86')](path[_0x16f4('0x55')](_0x3a7bda,_0x4beeca),_0x4beeca,function(_0x1796a7){if(!_0x1796a7)fs[_0x16f4('0x96')](path[_0x16f4('0x55')](_0x3a7bda,_0x4beeca));});}})[_0x16f4('0x1a')](handleError(_0xbdd1a4,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index a1aca3a..8d5ec53 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 _0x7e62=['../../mysqldb','MailMessage','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4acb16,_0x34d1c4){var _0x221d2a=function(_0x420b6d){while(--_0x420b6d){_0x4acb16['push'](_0x4acb16['shift']());}};_0x221d2a(++_0x34d1c4);}(_0x7e62,0x70));var _0x27e6=function(_0x18550e,_0xbb1ef9){_0x18550e=_0x18550e-0x0;var _0x4210b0=_0x7e62[_0x18550e];return _0x4210b0;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x27e6('0x0'))['db'][_0x27e6('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x27e6('0x2'),'afterUpdate':_0x27e6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4253e1){return function(_0xd09c86,_0x9709ed,_0x6364da){MailMessageEvents[_0x27e6('0x4')](_0x4253e1+':'+_0xd09c86['id'],_0xd09c86);MailMessageEvents[_0x27e6('0x4')](_0x4253e1,_0xd09c86);_0x6364da(null);};}for(var e in events){if(events[_0x27e6('0x5')](e)){var event=events[e];MailMessage[_0x27e6('0x6')](e,emitEvent(event));}}module[_0x27e6('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xf111=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3a7077,_0x1f9d15){var _0x3ad27d=function(_0x3e2ece){while(--_0x3e2ece){_0x3a7077['push'](_0x3a7077['shift']());}};_0x3ad27d(++_0x1f9d15);}(_0xf111,0x77));var _0x1f11=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0xf111[_0x375492];return _0x18ba5b;};'use strict';var EventEmitter=require(_0x1f11('0x0'));var MailMessage=require(_0x1f11('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f11('0x2'),'afterUpdate':_0x1f11('0x3'),'afterDestroy':_0x1f11('0x4')};function emitEvent(_0x27e991){return function(_0x53939b,_0x5185b8,_0xc94731){MailMessageEvents[_0x1f11('0x5')](_0x27e991+':'+_0x53939b['id'],_0x53939b);MailMessageEvents[_0x1f11('0x5')](_0x27e991,_0x53939b);_0xc94731(null);};}for(var e in events){if(events[_0x1f11('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x1f11('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b2f066a..0f81f72 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 _0x7ea0=['fti_mail_messages','FULLTEXT','body','fromString','get','direction','toLowerCase','out','isNil','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7ea0,0xf2));var _0x07ea=function(_0x26edb0,_0x1020ee){_0x26edb0=_0x26edb0-0x0;var _0x274cb0=_0x7ea0[_0x26edb0];return _0x274cb0;};'use strict';var _=require(_0x07ea('0x0'));var util=require(_0x07ea('0x1'));var logger=require(_0x07ea('0x2'))(_0x07ea('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x07ea('0x4'));var htmlToText=require(_0x07ea('0x5'));var fs=require('fs');var path=require(_0x07ea('0x6'));var rimraf=require(_0x07ea('0x7'));var config=require(_0x07ea('0x8'));var attributes=require('./mailMessage.attributes');module[_0x07ea('0x9')]=function(_0x5a65f5,_0x4aa2ba){return _0x5a65f5[_0x07ea('0xa')](_0x07ea('0xb'),attributes,{'tableName':_0x07ea('0xc'),'paranoid':![],'indexes':[{'name':_0x07ea('0xd'),'fields':[_0x07ea('0xd')]},{'name':_0x07ea('0xe'),'fields':['plainBody','subject'],'type':_0x07ea('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3142fa,_0x30e159,_0x82e7b8){if(_0x3142fa[_0x07ea('0x10')]){_0x3142fa['plainBody']=htmlToText[_0x07ea('0x11')](_0x3142fa['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x82e7b8(null,_0x30e159);},'afterCreate':function(_0xde1d58,_0x7158c4,_0x127a21){var _0x344d64=_0x5a65f5['models'];var _0x364b83=_0xde1d58[_0x07ea('0x12')]({'plain':!![]});if(_0x364b83[_0x07ea('0x13')][_0x07ea('0x14')]()==='in'||_0x364b83['direction'][_0x07ea('0x14')]()===_0x07ea('0x15')&&!_0x364b83['secret']&&!_[_0x07ea('0x16')](_0x364b83['UserId'])){_0x344d64[_0x07ea('0x17')][_0x07ea('0x18')]({'where':{'id':_0x364b83['MailInteractionId']}})[_0x07ea('0x19')](function(_0x42b752){if(_0x42b752){_0x42b752[_0x07ea('0x1a')]({'lastMsgAt':_0x364b83[_0x07ea('0x1b')],'lastMsgDirection':_0x364b83[_0x07ea('0x13')][_0x07ea('0x14')]()});}})[_0x07ea('0x1c')](function(_0xe5c370){console[_0x07ea('0x1d')](_0xe5c370);});}_0x127a21();}},'charset':_0x07ea('0x1e'),'collate':_0x07ea('0x1f')});}; \ No newline at end of file +var _0x6c99=['mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage'];(function(_0x2c5cbf,_0x4e4349){var _0x3efeae=function(_0x1f7db8){while(--_0x1f7db8){_0x2c5cbf['push'](_0x2c5cbf['shift']());}};_0x3efeae(++_0x4e4349);}(_0x6c99,0x106));var _0x96c9=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x6c99[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x96c9('0x0'))(_0x96c9('0x1'));var moment=require(_0x96c9('0x2'));var BPromise=require('bluebird');var rp=require(_0x96c9('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x96c9('0x4'));var rimraf=require(_0x96c9('0x5'));var config=require(_0x96c9('0x6'));var attributes=require(_0x96c9('0x7'));module['exports']=function(_0x430781,_0x1ddaf4){return _0x430781[_0x96c9('0x8')](_0x96c9('0x9'),attributes,{'tableName':_0x96c9('0xa'),'paranoid':![],'indexes':[{'name':_0x96c9('0xb'),'fields':['messageId']},{'name':_0x96c9('0xc'),'fields':[_0x96c9('0xd'),_0x96c9('0xe')],'type':_0x96c9('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47cc36,_0x4be861,_0x5840f0){if(_0x47cc36[_0x96c9('0x10')]){_0x47cc36[_0x96c9('0xd')]=htmlToText[_0x96c9('0x11')](_0x47cc36[_0x96c9('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5840f0(null,_0x4be861);},'afterCreate':function(_0x3ebdbc,_0x1313b5,_0x153d2f){var _0x32a6c6=_0x430781[_0x96c9('0x12')];var _0x522f1a=_0x3ebdbc['get']({'plain':!![]});if(_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()==='in'||_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()===_0x96c9('0x15')&&!_0x522f1a[_0x96c9('0x16')]&&!_[_0x96c9('0x17')](_0x522f1a[_0x96c9('0x18')])){_0x32a6c6[_0x96c9('0x19')]['findOne']({'where':{'id':_0x522f1a[_0x96c9('0x1a')]}})[_0x96c9('0x1b')](function(_0x385269){if(_0x385269){_0x385269[_0x96c9('0x1c')]({'lastMsgAt':_0x522f1a[_0x96c9('0x1d')],'lastMsgDirection':_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()});}})[_0x96c9('0x1e')](function(_0x1051c6){console[_0x96c9('0x1f')](_0x1051c6);});}_0x153d2f();}},'charset':_0x96c9('0x20'),'collate':_0x96c9('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0723a40..66c7628 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 _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailMessage','body','options','CreateMailMessage','lodash'];(function(_0x5d6f98,_0x515e99){var _0x25f7cb=function(_0x162731){while(--_0x162731){_0x5d6f98['push'](_0x5d6f98['shift']());}};_0x25f7cb(++_0x515e99);}(_0x5204,0xdf));var _0x4520=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x5204[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});config[_0x4520('0xb')]=_[_0x4520('0xc')](config[_0x4520('0xb')],{'host':_0x4520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4520('0xb')]));require('./mailMessage.socket')[_0x4520('0xe')](socket);function respondWithRpcPromise(_0x37a617,_0x1a5324,_0x30ca43){return new BPromise(function(_0x4d767b,_0x297f8d){return client[_0x4520('0xf')](_0x37a617,_0x30ca43)[_0x4520('0x10')](function(_0x2a2a2f){logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));logger[_0x4520('0x14')](_0x4520('0x15'),_0x1a5324,_0x4520('0x13'),JSON[_0x4520('0x16')](_0x2a2a2f));if(_0x2a2a2f[_0x4520('0x17')]){if(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x18')]===0x1f4){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x297f8d(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x4d767b(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}else{logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));_0x4d767b(_0x2a2a2f[_0x4520('0x1a')][_0x4520('0x19')]);}})[_0x4520('0x1b')](function(_0x11eaea){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x11eaea);_0x297f8d(_0x11eaea);});});}exports['CreateMailMessage']=function(_0xc016a3){var _0x52ca8c=this;return new Promise(function(_0x5ceff6,_0x4c46c5){return db[_0x4520('0x1c')]['create'](_0xc016a3[_0x4520('0x1d')],{'raw':_0xc016a3[_0x4520('0x1e')]?_0xc016a3[_0x4520('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4520('0x10')](function(_0x4000d4){logger[_0x4520('0x11')]('CreateMailMessage',_0xc016a3);logger[_0x4520('0x14')](_0x4520('0x1f'),_0xc016a3,JSON[_0x4520('0x16')](_0x4000d4));_0x5ceff6(_0x4000d4);})[_0x4520('0x1b')](function(_0x2a8528){logger['error'](_0x4520('0x1f'),_0x2a8528[_0x4520('0x19')],_0xc016a3);_0x4c46c5(_0x52ca8c[_0x4520('0x17')](0x1f4,_0x2a8528[_0x4520('0x19')]));});});}; \ No newline at end of file +var _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xda2d,0x102));var _0xdda2=function(_0xe96b71,_0x50da82){_0xe96b71=_0xe96b71-0x0;var _0x21a511=_0xda2d[_0xe96b71];return _0x21a511;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateMailMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index bfaa728..0316bb5 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 _0x86b6=['save','remove','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x86b6,0x6b));var _0x686b=function(_0xe679de,_0x56d513){_0xe679de=_0xe679de-0x0;var _0x1ba35f=_0x86b6[_0xe679de];return _0x1ba35f;};'use strict';var MailMessageEvents=require(_0x686b('0x0'));var events=[_0x686b('0x1'),_0x686b('0x2'),_0x686b('0x3')];function createListener(_0x56bbb6,_0x50232e){return function(_0xc283e2){_0x50232e[_0x686b('0x4')](_0x56bbb6,_0xc283e2);};}function removeListener(_0x2cdd42,_0x3d7a8f){return function(){MailMessageEvents[_0x686b('0x5')](_0x2cdd42,_0x3d7a8f);};}exports[_0x686b('0x6')]=function(_0x4c7aa7){for(var _0x599ba1=0x0,_0x2e0fb0=events[_0x686b('0x7')];_0x599ba1<_0x2e0fb0;_0x599ba1++){var _0x1a0c1a=events[_0x599ba1];var _0x474570=createListener(_0x686b('0x8')+_0x1a0c1a,_0x4c7aa7);MailMessageEvents['on'](_0x1a0c1a,_0x474570);}}; \ No newline at end of file +var _0x5a38=['register','length','remove','update','emit','removeListener'];(function(_0x27e1c9,_0xda67a0){var _0x55b510=function(_0x2f1234){while(--_0x2f1234){_0x27e1c9['push'](_0x27e1c9['shift']());}};_0x55b510(++_0xda67a0);}(_0x5a38,0x16a));var _0x85a3=function(_0x4e96d8,_0x20304f){_0x4e96d8=_0x4e96d8-0x0;var _0x5cb02d=_0x5a38[_0x4e96d8];return _0x5cb02d;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x85a3('0x0'),_0x85a3('0x1')];function createListener(_0x1e5ac4,_0x228d94){return function(_0x1aa1c0){_0x228d94[_0x85a3('0x2')](_0x1e5ac4,_0x1aa1c0);};}function removeListener(_0x47bc8e,_0x33586d){return function(){MailMessageEvents[_0x85a3('0x3')](_0x47bc8e,_0x33586d);};}exports[_0x85a3('0x4')]=function(_0x2632e6){for(var _0x5971a9=0x0,_0xf18c15=events[_0x85a3('0x5')];_0x5971a9<_0xf18c15;_0x5971a9++){var _0x45bcc4=events[_0x5971a9];var _0xd26bac=createListener('mailMessage:'+_0x45bcc4,_0x2632e6);MailMessageEvents['on'](_0x45bcc4,_0xd26bac);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index bfaa045..b92acec 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 _0x4676=['/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x50cf8a,_0x2c31ac){var _0x50163f=function(_0x2554f9){while(--_0x2554f9){_0x50cf8a['push'](_0x50cf8a['shift']());}};_0x50163f(++_0x2c31ac);}(_0x4676,0xbe));var _0x6467=function(_0x2fa689,_0x50d55e){_0x2fa689=_0x2fa689-0x0;var _0xcc7e4e=_0x4676[_0x2fa689];return _0xcc7e4e;};'use strict';var multer=require('multer');var util=require(_0x6467('0x0'));var path=require(_0x6467('0x1'));var timeout=require(_0x6467('0x2'));var express=require('express');var router=express[_0x6467('0x3')]();var fs_extra=require(_0x6467('0x4'));var auth=require(_0x6467('0x5'));var interaction=require(_0x6467('0x6'));var config=require(_0x6467('0x7'));var controller=require('./mailQueue.controller');router[_0x6467('0x8')]('/',auth[_0x6467('0x9')](),controller[_0x6467('0xa')]);router[_0x6467('0x8')](_0x6467('0xb'),auth[_0x6467('0x9')](),controller[_0x6467('0xc')]);router[_0x6467('0x8')](_0x6467('0xd'),auth[_0x6467('0x9')](),controller['show']);router[_0x6467('0x8')](_0x6467('0xe'),auth[_0x6467('0x9')](),controller[_0x6467('0xf')]);router[_0x6467('0x8')](_0x6467('0x10'),auth[_0x6467('0x9')](),controller[_0x6467('0x11')]);router['get'](_0x6467('0x12'),auth[_0x6467('0x9')](),controller[_0x6467('0x13')]);router['post']('/',auth[_0x6467('0x9')](),controller[_0x6467('0x14')]);router[_0x6467('0x15')](_0x6467('0x10'),auth[_0x6467('0x9')](),controller[_0x6467('0x16')]);router['post']('/:id/users',auth[_0x6467('0x9')](),controller[_0x6467('0x17')]);router[_0x6467('0x18')](_0x6467('0xd'),auth[_0x6467('0x9')](),controller[_0x6467('0x19')]);router[_0x6467('0x1a')](_0x6467('0xd'),auth['isAuthenticated'](),controller[_0x6467('0x1b')]);router[_0x6467('0x1a')]('/:id/teams',auth[_0x6467('0x9')](),controller[_0x6467('0x1c')]);router[_0x6467('0x1a')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2f81=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams'];(function(_0x2e25b5,_0x5cd8e2){var _0x10ba3a=function(_0x44e16a){while(--_0x44e16a){_0x2e25b5['push'](_0x2e25b5['shift']());}};_0x10ba3a(++_0x5cd8e2);}(_0x2f81,0x1d3));var _0x12f8=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0x2f81[_0x2e9187];return _0x1fc3a8;};'use strict';var multer=require(_0x12f8('0x0'));var util=require(_0x12f8('0x1'));var path=require('path');var timeout=require(_0x12f8('0x2'));var express=require('express');var router=express[_0x12f8('0x3')]();var fs_extra=require(_0x12f8('0x4'));var auth=require(_0x12f8('0x5'));var interaction=require(_0x12f8('0x6'));var config=require(_0x12f8('0x7'));var controller=require(_0x12f8('0x8'));router[_0x12f8('0x9')]('/',auth[_0x12f8('0xa')](),controller[_0x12f8('0xb')]);router['get'](_0x12f8('0xc'),auth[_0x12f8('0xa')](),controller[_0x12f8('0xd')]);router[_0x12f8('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x12f8('0x9')](_0x12f8('0xe'),auth[_0x12f8('0xa')](),controller[_0x12f8('0xf')]);router[_0x12f8('0x9')](_0x12f8('0x10'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x11')]);router[_0x12f8('0x9')](_0x12f8('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x12f8('0x13')]('/',auth['isAuthenticated'](),controller[_0x12f8('0x14')]);router['post'](_0x12f8('0x10'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x15')]);router[_0x12f8('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x12f8('0x16')]);router[_0x12f8('0x17')](_0x12f8('0x18'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x19')]);router['delete']('/:id',auth[_0x12f8('0xa')](),controller[_0x12f8('0x1a')]);router[_0x12f8('0x1b')](_0x12f8('0x10'),auth['isAuthenticated'](),controller[_0x12f8('0x1c')]);router[_0x12f8('0x1b')](_0x12f8('0x12'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x1d')]);module[_0x12f8('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 de7a4ec..a3767f2 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 _0x6c66=['ENUM','rrmemory','beepall','roundrobin','STRING','name','INTEGER'];(function(_0x11a202,_0x12e348){var _0x513753=function(_0x327c90){while(--_0x327c90){_0x11a202['push'](_0x11a202['shift']());}};_0x513753(++_0x12e348);}(_0x6c66,0x18c));var _0x66c6=function(_0x1a9683,_0x675c5d){_0x1a9683=_0x1a9683-0x0;var _0xdc3ba3=_0x6c66[_0x1a9683];return _0xdc3ba3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x66c6('0x0')],'unique':_0x66c6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x66c6('0x0')]},'timeout':{'type':Sequelize[_0x66c6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x66c6('0x3')](_0x66c6('0x4'),_0x66c6('0x5'),_0x66c6('0x6'))}}; \ No newline at end of file +var _0x1cf0=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x103e9d,_0x3cff63){var _0x137520=function(_0x361b36){while(--_0x361b36){_0x103e9d['push'](_0x103e9d['shift']());}};_0x137520(++_0x3cff63);}(_0x1cf0,0x6c));var _0x01cf=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x1cf0[_0x49d41c];return _0xb64c5f;};'use strict';var Sequelize=require(_0x01cf('0x0'));module[_0x01cf('0x1')]={'name':{'type':Sequelize[_0x01cf('0x2')],'unique':_0x01cf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x01cf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01cf('0x5')](_0x01cf('0x6'),_0x01cf('0x7'),_0x01cf('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4c7b89f..8d4a2a6 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 _0xe50e=['socket.io-emitter','./mailQueue.socket','sendStatus','end','json','offset','limit','undefined','status','set','reject','save','update','then','destroy','get','MailQueues','error','stack','name','index','map','MailQueue','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','rows','show','params','keys','rawAttributes','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserMailQueue','options','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','interface','flatMap','Agents','sequelize','transaction','emit','userMailQueue:save','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','value','removeTeams','removeAgents','addAgents','omit','isArray','userMailQueue:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xe50e,0xf9));var _0xee50=function(_0x3692e7,_0x5ac537){_0x3692e7=_0x3692e7-0x0;var _0x4bd405=_0xe50e[_0x3692e7];return _0x4bd405;};'use strict';var emlformat=require(_0xee50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xee50('0x1'));var moment=require(_0xee50('0x2'));var BPromise=require(_0xee50('0x3'));var Mustache=require(_0xee50('0x4'));var util=require(_0xee50('0x5'));var path=require(_0xee50('0x6'));var sox=require(_0xee50('0x7'));var csv=require(_0xee50('0x8'));var ejs=require(_0xee50('0x9'));var fs=require('fs');var fs_extra=require(_0xee50('0xa'));var _=require(_0xee50('0xb'));var squel=require(_0xee50('0xc'));var crypto=require(_0xee50('0xd'));var jsforce=require(_0xee50('0xe'));var deskjs=require(_0xee50('0xf'));var toCsv=require(_0xee50('0x8'));var querystring=require(_0xee50('0x10'));var Papa=require(_0xee50('0x11'));var Redis=require(_0xee50('0x12'));var authService=require(_0xee50('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee50('0x14'));var logger=require(_0xee50('0x15'))(_0xee50('0x16'));var utils=require(_0xee50('0x17'));var config=require(_0xee50('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xee50('0x19'))['db'];config[_0xee50('0x1a')]=_[_0xee50('0x1b')](config[_0xee50('0x1a')],{'host':_0xee50('0x1c'),'port':0x18eb});var socket=require(_0xee50('0x1d'))(new Redis(config[_0xee50('0x1a')]));require(_0xee50('0x1e'))['register'](socket);function respondWithStatusCode(_0x3b89a1,_0xbafaf0){_0xbafaf0=_0xbafaf0||0xcc;return function(_0x35602b){if(_0x35602b){return _0x3b89a1[_0xee50('0x1f')](_0xbafaf0);}return _0x3b89a1['status'](_0xbafaf0)[_0xee50('0x20')]();};}function respondWithResult(_0x361e0a,_0x47179e){_0x47179e=_0x47179e||0xc8;return function(_0x3ade17){if(_0x3ade17){return _0x361e0a['status'](_0x47179e)[_0xee50('0x21')](_0x3ade17);}};}function respondWithFilteredResult(_0x281b5f,_0x2229e7){return function(_0x201513){if(_0x201513){var _0x1cadb9=typeof _0x2229e7[_0xee50('0x22')]==='undefined'&&typeof _0x2229e7[_0xee50('0x23')]===_0xee50('0x24');var _0x37f439=_0x201513['count'];var _0x4445fa=_0x1cadb9?0x0:_0x2229e7[_0xee50('0x22')];var _0x14229d=_0x1cadb9?_0x201513['count']:_0x2229e7[_0xee50('0x22')]+_0x2229e7[_0xee50('0x23')];var _0x14bbd9;if(_0x14229d>=_0x37f439){_0x14229d=_0x37f439;_0x14bbd9=0xc8;}else{_0x14bbd9=0xce;}_0x281b5f[_0xee50('0x25')](_0x14bbd9);return _0x281b5f[_0xee50('0x26')]('Content-Range',_0x4445fa+'-'+_0x14229d+'/'+_0x37f439)[_0xee50('0x21')](_0x201513);}return null;};}function patchUpdates(_0x1990f2){return function(_0x1b635c){try{jsonpatch['apply'](_0x1b635c,_0x1990f2,!![]);}catch(_0x15906e){return BPromise[_0xee50('0x27')](_0x15906e);}return _0x1b635c[_0xee50('0x28')]();};}function saveUpdates(_0x557c77,_0x5d33e0){return function(_0x478a27){if(_0x478a27){return _0x478a27[_0xee50('0x29')](_0x557c77)[_0xee50('0x2a')](function(_0x53ddab){return _0x53ddab;});}return null;};}function removeEntity(_0x5c5910,_0x5762e5){return function(_0x230d97){if(_0x230d97){return _0x230d97[_0xee50('0x2b')]()['then'](function(){var _0x15556f=_0x230d97[_0xee50('0x2c')]({'plain':!![]});var _0x2026b9=_0xee50('0x2d');return db['UserProfileResource'][_0xee50('0x2b')]({'where':{'type':_0x2026b9,'resourceId':_0x15556f['id']}})[_0xee50('0x2a')](function(){return _0x230d97;});})[_0xee50('0x2a')](function(){_0x5c5910[_0xee50('0x25')](0xcc)[_0xee50('0x20')]();});}};}function handleEntityNotFound(_0x6f16db,_0x4c14b2){return function(_0x473f5b){if(!_0x473f5b){_0x6f16db[_0xee50('0x1f')](0x194);}return _0x473f5b;};}function handleError(_0x5e3cb7,_0x18da3d){_0x18da3d=_0x18da3d||0x1f4;return function(_0x33432d){logger[_0xee50('0x2e')](_0x33432d[_0xee50('0x2f')]);if(_0x33432d[_0xee50('0x30')]){delete _0x33432d[_0xee50('0x30')];}_0x5e3cb7['status'](_0x18da3d)['send'](_0x33432d);};}exports[_0xee50('0x31')]=function(_0x54a03e,_0x5e7704){var _0x2430bb={},_0xa9ab3c={},_0x369b49={'count':0x0,'rows':[]};var _0x3d0476=_[_0xee50('0x32')](db[_0xee50('0x33')]['rawAttributes'],function(_0x5b7179){return{'name':_0x5b7179['fieldName'],'type':_0x5b7179[_0xee50('0x34')]['key']};});_0xa9ab3c[_0xee50('0x35')]=_[_0xee50('0x32')](_0x3d0476,_0xee50('0x30'));_0xa9ab3c[_0xee50('0x36')]=_['keys'](_0x54a03e[_0xee50('0x36')]);_0xa9ab3c[_0xee50('0x37')]=_[_0xee50('0x38')](_0xa9ab3c[_0xee50('0x35')],_0xa9ab3c[_0xee50('0x36')]);_0x2430bb[_0xee50('0x39')]=_[_0xee50('0x38')](_0xa9ab3c['model'],qs['fields'](_0x54a03e[_0xee50('0x36')][_0xee50('0x3a')]));_0x2430bb[_0xee50('0x39')]=_0x2430bb[_0xee50('0x39')]['length']?_0x2430bb['attributes']:_0xa9ab3c[_0xee50('0x35')];if(!_0x54a03e[_0xee50('0x36')][_0xee50('0x3b')](_0xee50('0x3c'))){_0x2430bb['limit']=qs[_0xee50('0x23')](_0x54a03e[_0xee50('0x36')][_0xee50('0x23')]);_0x2430bb[_0xee50('0x22')]=qs[_0xee50('0x22')](_0x54a03e['query'][_0xee50('0x22')]);}_0x2430bb[_0xee50('0x3d')]=qs[_0xee50('0x3e')](_0x54a03e['query'][_0xee50('0x3e')]);_0x2430bb[_0xee50('0x3f')]=qs['filters'](_[_0xee50('0x40')](_0x54a03e['query'],_0xa9ab3c[_0xee50('0x37')]),_0x3d0476);if(_0x54a03e['query'][_0xee50('0x41')]){_0x2430bb[_0xee50('0x3f')]=_['merge'](_0x2430bb[_0xee50('0x3f')],{'$or':_[_0xee50('0x32')](_0x3d0476,function(_0x9fc95e){if(_0x9fc95e['type']!==_0xee50('0x42')){var _0x964ba4={};_0x964ba4[_0x9fc95e[_0xee50('0x30')]]={'$like':'%'+_0x54a03e['query'][_0xee50('0x41')]+'%'};return _0x964ba4;}})});}_0x2430bb=_[_0xee50('0x43')]({},_0x2430bb,_0x54a03e['options']);var _0xdc15c5={'where':_0x2430bb[_0xee50('0x3f')]};return db[_0xee50('0x33')][_0xee50('0x44')](_0xdc15c5)[_0xee50('0x2a')](function(_0x3117e9){_0x369b49[_0xee50('0x44')]=_0x3117e9;if(_0x54a03e[_0xee50('0x36')][_0xee50('0x45')]){_0x2430bb[_0xee50('0x46')]=[{'all':!![]}];}return db[_0xee50('0x33')]['findAll'](_0x2430bb);})[_0xee50('0x2a')](function(_0x53e33c){_0x369b49[_0xee50('0x47')]=_0x53e33c;return _0x369b49;})[_0xee50('0x2a')](respondWithFilteredResult(_0x5e7704,_0x2430bb))['catch'](handleError(_0x5e7704,null));};exports[_0xee50('0x48')]=function(_0x5a26e4,_0x59ebf7){var _0x31c69c={'raw':!![],'where':{'id':_0x5a26e4[_0xee50('0x49')]['id']}},_0xd8271={};_0xd8271[_0xee50('0x35')]=_[_0xee50('0x4a')](db[_0xee50('0x33')][_0xee50('0x4b')]);_0xd8271[_0xee50('0x36')]=_[_0xee50('0x4a')](_0x5a26e4[_0xee50('0x36')]);_0xd8271['filters']=_[_0xee50('0x38')](_0xd8271['model'],_0xd8271[_0xee50('0x36')]);_0x31c69c[_0xee50('0x39')]=_['intersection'](_0xd8271[_0xee50('0x35')],qs[_0xee50('0x3a')](_0x5a26e4['query'][_0xee50('0x3a')]));_0x31c69c[_0xee50('0x39')]=_0x31c69c['attributes'][_0xee50('0x4c')]?_0x31c69c[_0xee50('0x39')]:_0xd8271[_0xee50('0x35')];if(_0x5a26e4[_0xee50('0x36')]['includeAll']){_0x31c69c['include']=[{'all':!![]}];}_0x31c69c=_[_0xee50('0x43')]({},_0x31c69c,_0x5a26e4['options']);return db['MailQueue'][_0xee50('0x4d')](_0x31c69c)[_0xee50('0x2a')](handleEntityNotFound(_0x59ebf7,null))['then'](respondWithResult(_0x59ebf7,null))[_0xee50('0x4e')](handleError(_0x59ebf7,null));};exports['create']=function(_0x229db8,_0x16cc7c){return db['MailQueue'][_0xee50('0x4f')](_0x229db8['body'],{})['then'](function(_0x9ad02c){var _0x2ac0a7=_0x229db8[_0xee50('0x50')][_0xee50('0x2c')]({'plain':!![]});if(!_0x2ac0a7)throw new Error(_0xee50('0x51'));if(_0x2ac0a7[_0xee50('0x52')]===_0xee50('0x50')){var _0x200897=_0x9ad02c[_0xee50('0x2c')]({'plain':!![]});var _0x5b2bcd=_0xee50('0x2d');return db[_0xee50('0x53')][_0xee50('0x4d')]({'where':{'name':_0x5b2bcd,'userProfileId':_0x2ac0a7[_0xee50('0x54')]},'raw':!![]})[_0xee50('0x2a')](function(_0x34036a){if(_0x34036a&&_0x34036a['autoAssociation']===0x0){return db['UserProfileResource'][_0xee50('0x4f')]({'name':_0x200897[_0xee50('0x30')],'resourceId':_0x200897['id'],'type':_0x34036a[_0xee50('0x30')],'sectionId':_0x34036a['id']},{})[_0xee50('0x2a')](function(){return _0x9ad02c;});}else{return _0x9ad02c;}})[_0xee50('0x4e')](function(_0xd257b2){logger['error'](_0xee50('0x55'),_0xd257b2);throw _0xd257b2;});}return _0x9ad02c;})[_0xee50('0x2a')](respondWithResult(_0x16cc7c,0xc9))[_0xee50('0x4e')](handleError(_0x16cc7c,null));};exports['update']=function(_0x3cd5fd,_0x5235b8){if(_0x3cd5fd[_0xee50('0x56')]['id']){delete _0x3cd5fd['body']['id'];}return db[_0xee50('0x33')][_0xee50('0x4d')]({'where':{'id':_0x3cd5fd[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0x5235b8,null))['then'](saveUpdates(_0x3cd5fd[_0xee50('0x56')],null))[_0xee50('0x2a')](respondWithResult(_0x5235b8,null))[_0xee50('0x4e')](handleError(_0x5235b8,null));};exports[_0xee50('0x2b')]=function(_0x440c3a,_0x2edfbe){return db[_0xee50('0x33')]['find']({'where':{'id':_0x440c3a[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0x2edfbe,null))[_0xee50('0x2a')](removeEntity(_0x2edfbe,null))[_0xee50('0x4e')](handleError(_0x2edfbe,null));};exports[_0xee50('0x57')]=function(_0x17724d,_0x5a4fd7){return db['MailQueue'][_0xee50('0x57')]()[_0xee50('0x2a')](respondWithResult(_0x5a4fd7,null))[_0xee50('0x4e')](handleError(_0x5a4fd7,null));};exports[_0xee50('0x58')]=function(_0x38602e,_0x230ea2,_0xbb0f33){var _0xa59990={'raw':!![],'where':{}},_0x4d9642={},_0x17d276;return db[_0xee50('0x33')]['findOne']({'where':{'id':_0x38602e[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0x230ea2,null))[_0xee50('0x2a')](function(_0x18d8cb){if(_0x18d8cb){_0x17d276=_0x18d8cb[_0xee50('0x2c')]({'plain':!![]});_0x4d9642[_0xee50('0x35')]=_[_0xee50('0x4a')](db[_0xee50('0x59')][_0xee50('0x4b')]);_0x4d9642[_0xee50('0x36')]=_[_0xee50('0x4a')](_0x38602e[_0xee50('0x36')]);_0x4d9642[_0xee50('0x37')]=_['intersection'](_0x4d9642['model'],_0x4d9642[_0xee50('0x36')]);_0xa59990[_0xee50('0x39')]=_[_0xee50('0x38')](_0x4d9642['model'],qs[_0xee50('0x3a')](_0x38602e['query']['fields']));_0xa59990[_0xee50('0x39')]=_0xa59990[_0xee50('0x39')][_0xee50('0x4c')]?_0xa59990['attributes']:_0x4d9642[_0xee50('0x35')];if(!_0x38602e['query'][_0xee50('0x3b')]('nolimit')){_0xa59990['limit']=qs[_0xee50('0x23')](_0x38602e[_0xee50('0x36')]['limit']);_0xa59990[_0xee50('0x22')]=qs['offset'](_0x38602e[_0xee50('0x36')][_0xee50('0x22')]);}_0xa59990[_0xee50('0x3d')]=qs['sort'](_0x38602e[_0xee50('0x36')][_0xee50('0x3e')]);_0xa59990['where']=qs[_0xee50('0x37')](_['pick'](_0x38602e['query'],_0x4d9642[_0xee50('0x37')]));_0xa59990[_0xee50('0x3f')]['MailQueueId']=_0x18d8cb['id'];if(_0x38602e['query']['filter']){_0xa59990['where']=_['merge'](_0xa59990[_0xee50('0x3f')],{'$or':_['map'](_0xa59990['attributes'],function(_0x63d791){var _0xa22909={};_0xa22909[_0x63d791]={'$like':'%'+_0x38602e['query'][_0xee50('0x41')]+'%'};return _0xa22909;})});}_0xa59990=_[_0xee50('0x43')]({},_0xa59990,_0x38602e[_0xee50('0x5a')]);return db['UserMailQueue'][_0xee50('0x5b')](_0xa59990);}})[_0xee50('0x2a')](function(_0x12252e){if(_0x12252e){return db[_0xee50('0x5c')][_0xee50('0x5d')]({'where':{'id':_[_0xee50('0x32')](_0x12252e,_0xee50('0x5e')),'role':_0xee50('0x5f')},'attributes':['id',_0xee50('0x30'),_0xee50('0x60'),_0xee50('0x61'),_0xee50('0x62')]});}})[_0xee50('0x2a')](function(_0x21e08a){if(_0x21e08a){return{'count':_0x21e08a[_0xee50('0x44')],'rows':_['map'](_0x21e08a[_0xee50('0x47')],function(_0x8f3c8b){return{'membername':_0x8f3c8b[_0xee50('0x30')],'UserId':_0x8f3c8b['id'],'queue_name':_0x17d276['name'],'MailQueueId':_0x17d276['id'],'interface':util[_0xee50('0x63')](_0xee50('0x64'),_0xee50('0x65'),_0x8f3c8b['name']),'penalty':0x0,'paused':_0x8f3c8b[_0xee50('0x60')],'createdAt':_0x8f3c8b[_0xee50('0x62')],'updatedAt':_0x8f3c8b[_0xee50('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xee50('0x2a')](respondWithFilteredResult(_0x230ea2,_0xa59990))[_0xee50('0x4e')](handleError(_0x230ea2,null));};exports[_0xee50('0x66')]=function(_0x202e2d,_0x597ce7,_0x2e4411){var _0x24087e={};var _0x3315ee={};var _0x44d82d;var _0x411e95;return db[_0xee50('0x33')][_0xee50('0x67')]({'where':{'id':_0x202e2d[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0x597ce7,null))[_0xee50('0x2a')](function(_0x1f05b8){if(_0x1f05b8){_0x44d82d=_0x1f05b8;_0x3315ee['model']=_[_0xee50('0x4a')](db[_0xee50('0x68')][_0xee50('0x4b')]);_0x3315ee[_0xee50('0x36')]=_[_0xee50('0x4a')](_0x202e2d[_0xee50('0x36')]);_0x3315ee['filters']=_[_0xee50('0x38')](_0x3315ee[_0xee50('0x35')],_0x3315ee['query']);_0x24087e['attributes']=_[_0xee50('0x38')](_0x3315ee['model'],qs[_0xee50('0x3a')](_0x202e2d[_0xee50('0x36')]['fields']));_0x24087e[_0xee50('0x39')]=_0x24087e[_0xee50('0x39')][_0xee50('0x4c')]?_0x24087e[_0xee50('0x39')]:_0x3315ee['model'];_0x24087e[_0xee50('0x3d')]=qs[_0xee50('0x3e')](_0x202e2d['query'][_0xee50('0x3e')]);_0x24087e[_0xee50('0x3f')]=qs[_0xee50('0x37')](_[_0xee50('0x40')](_0x202e2d[_0xee50('0x36')],_0x3315ee[_0xee50('0x37')]));if(_0x202e2d[_0xee50('0x36')]['filter']){_0x24087e[_0xee50('0x3f')]=_[_0xee50('0x43')](_0x24087e['where'],{'$or':_['map'](_0x24087e[_0xee50('0x39')],function(_0x1e19cd){var _0x433010={};_0x433010[_0x1e19cd]={'$like':'%'+_0x202e2d[_0xee50('0x36')][_0xee50('0x41')]+'%'};return _0x433010;})});}_0x24087e=_['merge']({},_0x24087e,_0x202e2d[_0xee50('0x5a')]);return _0x44d82d[_0xee50('0x66')](_0x24087e);}})[_0xee50('0x2a')](function(_0x547adc){if(_0x547adc){_0x411e95=_0x547adc['length'];if(!_0x202e2d['query']['hasOwnProperty'](_0xee50('0x3c'))){_0x24087e[_0xee50('0x23')]=qs[_0xee50('0x23')](_0x202e2d[_0xee50('0x36')][_0xee50('0x23')]);_0x24087e[_0xee50('0x22')]=qs[_0xee50('0x22')](_0x202e2d[_0xee50('0x36')][_0xee50('0x22')]);}return _0x44d82d['getTeams'](_0x24087e);}})[_0xee50('0x2a')](function(_0x32bbd6){if(_0x32bbd6){return _0x32bbd6?{'count':_0x411e95,'rows':_0x32bbd6}:null;}})['then'](respondWithResult(_0x597ce7,null))[_0xee50('0x4e')](handleError(_0x597ce7,null));};exports[_0xee50('0x69')]=function(_0x160efa,_0x4b6b9d,_0x56c5a1){var _0x31bc83=_0x160efa[_0xee50('0x56')]['ids'];return db['Team'][_0xee50('0x5b')]({'where':{'id':_0x31bc83},'attributes':['id'],'include':[{'model':db[_0xee50('0x5c')],'as':'Agents','attributes':['id',_0xee50('0x30'),'online','voicePause',_0xee50('0x6a')],'raw':!![]}]})[_0xee50('0x2a')](function(_0x4983c8){if(_0x4983c8){var _0xc929a2=_[_0xee50('0x6b')](_0x4983c8,function(_0x441dfa){var _0x39a158=_0x441dfa[_0xee50('0x2c')]({'plain':!![]});return _0x39a158[_0xee50('0x6c')];});return db['MailQueue'][_0xee50('0x4d')]({'where':{'id':_0x160efa[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](function(_0x4a71b2){return db[_0xee50('0x6d')][_0xee50('0x6e')](function(_0x4401b9){return _0x4a71b2[_0xee50('0x69')](_0x31bc83,{'transaction':_0x4401b9})[_0xee50('0x2a')](function(){return BPromise['each'](_0xc929a2,function(_0x4b894b){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x4b894b['id'],'MailQueueId':_0x160efa[_0xee50('0x49')]['id']},'transaction':_0x4401b9});});})['then'](function(){_0xc929a2['forEach'](function(_0x67b1de){socket[_0xee50('0x6f')](_0xee50('0x70'),{'UserId':_0x67b1de['id'],'MailQueueId':_0x4a71b2['id']});});});});});}})[_0xee50('0x2a')](respondWithStatusCode(_0x4b6b9d,null))['catch'](handleError(_0x4b6b9d,null));};exports['removeTeams']=function(_0x438460,_0x52cfb0,_0xd0ca3){return db[_0xee50('0x68')][_0xee50('0x5b')]({'where':{'id':_0x438460[_0xee50('0x36')][_0xee50('0x71')]},'attributes':['id'],'include':[{'model':db[_0xee50('0x5c')],'as':_0xee50('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xee50('0x2a')](handleEntityNotFound(_0x52cfb0,null))[_0xee50('0x2a')](function(_0xc34316){var _0x4ee424=_[_0xee50('0x32')](_0xc34316,'id');var _0x586b76=[];var _0x537233=[];var _0x262124=squel[_0xee50('0x72')]();_0x262124[_0xee50('0x73')](_0xee50('0x74'))[_0xee50('0x75')](_0xee50('0x76'),'tq')[_0xee50('0x77')](_0xee50('0x78'),'ut',_0xee50('0x79'))[_0xee50('0x3f')](_0xee50('0x7a'),_0x438460[_0xee50('0x49')]['id']);for(var _0x2ba43f=0x0;_0x2ba43f<_0xc34316['length'];_0x2ba43f+=0x1){let _0xfb369f=_0xc34316[_0x2ba43f];for(var _0x7225cb=0x0;_0x7225cb<_0xfb369f[_0xee50('0x6c')][_0xee50('0x4c')];_0x7225cb+=0x1){let _0x1c4392=_0xfb369f[_0xee50('0x6c')][_0x7225cb];var _0x4dad5a=_0x262124[_0xee50('0x7b')]();_0x4dad5a[_0xee50('0x3f')](_0xee50('0x7c'),_0x1c4392['id']);_0x537233[_0xee50('0x7d')](db[_0xee50('0x6d')][_0xee50('0x36')](_0x4dad5a['toString'](),{'type':db['sequelize'][_0xee50('0x7e')][_0xee50('0x7f')]})[_0xee50('0x2a')](function(_0x5bc72a){if(_0x5bc72a['length']===0x1){return _0x1c4392['id'];}else{var _0x39bc54=_[_0xee50('0x80')](_[_0xee50('0x32')](_0x5bc72a,'TeamId'),function(_0x598422){return _[_0xee50('0x81')](_0x4ee424,_0x598422);});if(_0x39bc54){return _0x1c4392['id'];}}}));}}return BPromise[_0xee50('0x82')](_0x537233)[_0xee50('0x2a')](function(_0x34c705){_0x586b76=_(_0x586b76)['union'](_0x34c705)['compact']()[_0xee50('0x83')]();return db['MailQueue'][_0xee50('0x4d')]({'where':{'id':_0x438460[_0xee50('0x49')]['id']}})['then'](function(_0x4dfbbd){return db['sequelize'][_0xee50('0x6e')](function(_0x288ee5){return _0x4dfbbd[_0xee50('0x84')](_0x438460[_0xee50('0x36')][_0xee50('0x71')],{'transaction':_0x288ee5})['then'](function(){if(!_['isEmpty'](_0x586b76)){return _0x4dfbbd[_0xee50('0x85')](_0x586b76,{'transaction':_0x288ee5});}})[_0xee50('0x2a')](function(){_0x586b76['forEach'](function(_0x3c8162){socket[_0xee50('0x6f')]('userMailQueue:remove',{'UserId':_0x3c8162,'MailQueueId':_0x4dfbbd['id']});});});});});});})[_0xee50('0x2a')](respondWithStatusCode(_0x52cfb0,null))['catch'](handleError(_0x52cfb0,null));};exports['addAgents']=function(_0x209a39,_0x1a1ac2,_0x360f05){return db['MailQueue'][_0xee50('0x4d')]({'where':{'id':_0x209a39[_0xee50('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a1ac2,null))[_0xee50('0x2a')](function(_0x5b3fb9){if(_0x5b3fb9){return _0x5b3fb9[_0xee50('0x86')](_0x209a39['body']['ids'],_[_0xee50('0x87')](_0x209a39[_0xee50('0x56')],[_0xee50('0x71'),'id'])||{})['spread'](function(_0x83abe8){for(var _0x57e068=0x0;_0x57e068<_0x209a39['body'][_0xee50('0x71')][_0xee50('0x4c')];_0x57e068+=0x1){socket[_0xee50('0x6f')]('userMailQueue:save',{'UserId':Number(_0x209a39[_0xee50('0x56')][_0xee50('0x71')][_0x57e068]),'MailQueueId':Number(_0x209a39[_0xee50('0x49')]['id'])});}return _0x83abe8;});}})[_0xee50('0x2a')](respondWithResult(_0x1a1ac2,null))[_0xee50('0x4e')](handleError(_0x1a1ac2,null));};exports['removeAgents']=function(_0x3cba97,_0xb2b84d,_0x2ca2ef){return db[_0xee50('0x33')][_0xee50('0x4d')]({'where':{'id':_0x3cba97[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0xb2b84d,null))[_0xee50('0x2a')](function(_0x3d1c01){if(_0x3d1c01){return _0x3d1c01[_0xee50('0x85')](_0x3cba97[_0xee50('0x36')][_0xee50('0x71')])[_0xee50('0x2a')](function(){if(_[_0xee50('0x88')](_0x3cba97[_0xee50('0x36')]['ids'])){for(var _0x595575=0x0;_0x595575<_0x3cba97[_0xee50('0x36')][_0xee50('0x71')][_0xee50('0x4c')];_0x595575+=0x1){socket[_0xee50('0x6f')]('userMailQueue:remove',{'UserId':Number(_0x3cba97[_0xee50('0x36')][_0xee50('0x71')][_0x595575]),'MailQueueId':Number(_0x3cba97[_0xee50('0x49')]['id'])});}}else{socket['emit'](_0xee50('0x89'),{'UserId':Number(_0x3cba97['query'][_0xee50('0x71')]),'MailQueueId':Number(_0x3cba97[_0xee50('0x49')]['id'])});}});}})[_0xee50('0x2a')](respondWithStatusCode(_0xb2b84d,null))[_0xee50('0x4e')](handleError(_0xb2b84d,null));};exports['getAgents']=function(_0x47b26c,_0x10e07d,_0x530552){var _0x572166={};var _0x448d71={};var _0x390b5d;var _0x31a833;return db[_0xee50('0x33')][_0xee50('0x67')]({'where':{'id':_0x47b26c[_0xee50('0x49')]['id']}})[_0xee50('0x2a')](handleEntityNotFound(_0x10e07d,null))[_0xee50('0x2a')](function(_0x576437){if(_0x576437){_0x390b5d=_0x576437;_0x448d71['model']=_['keys'](db[_0xee50('0x5c')]['rawAttributes']);_0x448d71[_0xee50('0x36')]=_[_0xee50('0x4a')](_0x47b26c[_0xee50('0x36')]);_0x448d71[_0xee50('0x37')]=_[_0xee50('0x38')](_0x448d71[_0xee50('0x35')],_0x448d71[_0xee50('0x36')]);_0x572166[_0xee50('0x39')]=_[_0xee50('0x38')](_0x448d71[_0xee50('0x35')],qs[_0xee50('0x3a')](_0x47b26c['query']['fields']));_0x572166['attributes']=_0x572166[_0xee50('0x39')][_0xee50('0x4c')]?_0x572166[_0xee50('0x39')]:_0x448d71[_0xee50('0x35')];_0x572166[_0xee50('0x3d')]=qs[_0xee50('0x3e')](_0x47b26c[_0xee50('0x36')][_0xee50('0x3e')]);_0x572166[_0xee50('0x3f')]=qs['filters'](_[_0xee50('0x40')](_0x47b26c[_0xee50('0x36')],_0x448d71[_0xee50('0x37')]));if(_0x47b26c['query'][_0xee50('0x41')]){_0x572166[_0xee50('0x3f')]=_[_0xee50('0x43')](_0x572166[_0xee50('0x3f')],{'$or':_[_0xee50('0x32')](_0x572166['attributes'],function(_0x35a4f0){var _0x43e640={};_0x43e640[_0x35a4f0]={'$like':'%'+_0x47b26c['query'][_0xee50('0x41')]+'%'};return _0x43e640;})});}_0x572166=_[_0xee50('0x43')]({},_0x572166,_0x47b26c[_0xee50('0x5a')]);return _0x390b5d[_0xee50('0x8a')](_0x572166);}})[_0xee50('0x2a')](function(_0x401057){if(_0x401057){_0x31a833=_0x401057[_0xee50('0x4c')];if(!_0x47b26c['query']['hasOwnProperty']('nolimit')){_0x572166[_0xee50('0x23')]=qs['limit'](_0x47b26c['query']['limit']);_0x572166[_0xee50('0x22')]=qs['offset'](_0x47b26c['query'][_0xee50('0x22')]);}return _0x390b5d[_0xee50('0x8a')](_0x572166);}})[_0xee50('0x2a')](function(_0xf50983){if(_0xf50983){return _0xf50983?{'count':_0x31a833,'rows':_0xf50983}:null;}})[_0xee50('0x2a')](respondWithResult(_0x10e07d,null))['catch'](handleError(_0x10e07d,null));}; \ No newline at end of file +var _0x7ada=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','index','map','MailQueue','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','%s/%s','SIP','getTeams','Team','ids','online','interface','flatMap','Agents','transaction','addTeams','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','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/environment'];(function(_0x39f9f2,_0x37fc06){var _0x3febf8=function(_0x2811f2){while(--_0x2811f2){_0x39f9f2['push'](_0x39f9f2['shift']());}};_0x3febf8(++_0x37fc06);}(_0x7ada,0x103));var _0xa7ad=function(_0x326def,_0x4084e){_0x326def=_0x326def-0x0;var _0x24345c=_0x7ada[_0x326def];return _0x24345c;};'use strict';var emlformat=require(_0xa7ad('0x0'));var rimraf=require(_0xa7ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7ad('0x2'));var rp=require('request-promise');var moment=require(_0xa7ad('0x3'));var BPromise=require(_0xa7ad('0x4'));var Mustache=require('mustache');var util=require(_0xa7ad('0x5'));var path=require('path');var sox=require(_0xa7ad('0x6'));var csv=require(_0xa7ad('0x7'));var ejs=require(_0xa7ad('0x8'));var fs=require('fs');var fs_extra=require(_0xa7ad('0x9'));var _=require(_0xa7ad('0xa'));var squel=require(_0xa7ad('0xb'));var crypto=require(_0xa7ad('0xc'));var jsforce=require(_0xa7ad('0xd'));var deskjs=require(_0xa7ad('0xe'));var toCsv=require(_0xa7ad('0x7'));var querystring=require(_0xa7ad('0xf'));var Papa=require(_0xa7ad('0x10'));var Redis=require(_0xa7ad('0x11'));var authService=require(_0xa7ad('0x12'));var qs=require(_0xa7ad('0x13'));var as=require(_0xa7ad('0x14'));var hardwareService=require(_0xa7ad('0x15'));var logger=require(_0xa7ad('0x16'))(_0xa7ad('0x17'));var utils=require('../../config/utils');var config=require(_0xa7ad('0x18'));var licenseUtil=require(_0xa7ad('0x19'));var db=require('../../mysqldb')['db'];config[_0xa7ad('0x1a')]=_[_0xa7ad('0x1b')](config[_0xa7ad('0x1a')],{'host':_0xa7ad('0x1c'),'port':0x18eb});var socket=require(_0xa7ad('0x1d'))(new Redis(config[_0xa7ad('0x1a')]));require(_0xa7ad('0x1e'))[_0xa7ad('0x1f')](socket);function respondWithStatusCode(_0x33b381,_0x418155){_0x418155=_0x418155||0xcc;return function(_0x5d83d1){if(_0x5d83d1){return _0x33b381[_0xa7ad('0x20')](_0x418155);}return _0x33b381[_0xa7ad('0x21')](_0x418155)['end']();};}function respondWithResult(_0x54225d,_0x3d5141){_0x3d5141=_0x3d5141||0xc8;return function(_0x5b179a){if(_0x5b179a){return _0x54225d['status'](_0x3d5141)[_0xa7ad('0x22')](_0x5b179a);}};}function respondWithFilteredResult(_0x26cc8a,_0x54c133){return function(_0x2b7227){if(_0x2b7227){var _0x288f78=typeof _0x54c133[_0xa7ad('0x23')]===_0xa7ad('0x24')&&typeof _0x54c133[_0xa7ad('0x25')]===_0xa7ad('0x24');var _0x5634e4=_0x2b7227[_0xa7ad('0x26')];var _0x36fcb5=_0x288f78?0x0:_0x54c133[_0xa7ad('0x23')];var _0x36e9ab=_0x288f78?_0x2b7227[_0xa7ad('0x26')]:_0x54c133[_0xa7ad('0x23')]+_0x54c133[_0xa7ad('0x25')];var _0x41a84b;if(_0x36e9ab>=_0x5634e4){_0x36e9ab=_0x5634e4;_0x41a84b=0xc8;}else{_0x41a84b=0xce;}_0x26cc8a['status'](_0x41a84b);return _0x26cc8a['set'](_0xa7ad('0x27'),_0x36fcb5+'-'+_0x36e9ab+'/'+_0x5634e4)['json'](_0x2b7227);}return null;};}function patchUpdates(_0x51f17c){return function(_0x21b26c){try{jsonpatch[_0xa7ad('0x28')](_0x21b26c,_0x51f17c,!![]);}catch(_0x5f342d){return BPromise['reject'](_0x5f342d);}return _0x21b26c[_0xa7ad('0x29')]();};}function saveUpdates(_0x324544,_0x2e2c4f){return function(_0x33f870){if(_0x33f870){return _0x33f870['update'](_0x324544)[_0xa7ad('0x2a')](function(_0x41de73){return _0x41de73;});}return null;};}function removeEntity(_0xfe1c60,_0x4e1fc9){return function(_0x4c04aa){if(_0x4c04aa){return _0x4c04aa[_0xa7ad('0x2b')]()['then'](function(){var _0x41376c=_0x4c04aa[_0xa7ad('0x2c')]({'plain':!![]});var _0x43d2de=_0xa7ad('0x2d');return db[_0xa7ad('0x2e')]['destroy']({'where':{'type':_0x43d2de,'resourceId':_0x41376c['id']}})['then'](function(){return _0x4c04aa;});})['then'](function(){_0xfe1c60['status'](0xcc)[_0xa7ad('0x2f')]();});}};}function handleEntityNotFound(_0x5e8c65,_0x31ce67){return function(_0x406112){if(!_0x406112){_0x5e8c65['sendStatus'](0x194);}return _0x406112;};}function handleError(_0x3cceef,_0x50c54b){_0x50c54b=_0x50c54b||0x1f4;return function(_0x565891){logger[_0xa7ad('0x30')](_0x565891[_0xa7ad('0x31')]);if(_0x565891[_0xa7ad('0x32')]){delete _0x565891[_0xa7ad('0x32')];}_0x3cceef[_0xa7ad('0x21')](_0x50c54b)['send'](_0x565891);};}exports[_0xa7ad('0x33')]=function(_0x22e7fc,_0x4e8858){var _0x587103={},_0xf245a4={},_0x3f16ae={'count':0x0,'rows':[]};var _0x22a098=_[_0xa7ad('0x34')](db[_0xa7ad('0x35')][_0xa7ad('0x36')],function(_0x521f18){return{'name':_0x521f18['fieldName'],'type':_0x521f18[_0xa7ad('0x37')]['key']};});_0xf245a4[_0xa7ad('0x38')]=_[_0xa7ad('0x34')](_0x22a098,_0xa7ad('0x32'));_0xf245a4['query']=_[_0xa7ad('0x39')](_0x22e7fc[_0xa7ad('0x3a')]);_0xf245a4[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0xf245a4[_0xa7ad('0x38')],_0xf245a4[_0xa7ad('0x3a')]);_0x587103['attributes']=_['intersection'](_0xf245a4[_0xa7ad('0x38')],qs['fields'](_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x3d')]));_0x587103[_0xa7ad('0x3e')]=_0x587103['attributes'][_0xa7ad('0x3f')]?_0x587103['attributes']:_0xf245a4['model'];if(!_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0x587103[_0xa7ad('0x25')]=qs[_0xa7ad('0x25')](_0x22e7fc['query'][_0xa7ad('0x25')]);_0x587103['offset']=qs[_0xa7ad('0x23')](_0x22e7fc['query'][_0xa7ad('0x23')]);}_0x587103[_0xa7ad('0x42')]=qs['sort'](_0x22e7fc[_0xa7ad('0x3a')]['sort']);_0x587103[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_[_0xa7ad('0x44')](_0x22e7fc[_0xa7ad('0x3a')],_0xf245a4[_0xa7ad('0x3b')]),_0x22a098);if(_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0x587103[_0xa7ad('0x43')]=_['merge'](_0x587103[_0xa7ad('0x43')],{'$or':_[_0xa7ad('0x34')](_0x22a098,function(_0x27de42){if(_0x27de42[_0xa7ad('0x37')]!==_0xa7ad('0x46')){var _0x1b73c4={};_0x1b73c4[_0x27de42[_0xa7ad('0x32')]]={'$like':'%'+_0x22e7fc['query']['filter']+'%'};return _0x1b73c4;}})});}_0x587103=_[_0xa7ad('0x47')]({},_0x587103,_0x22e7fc[_0xa7ad('0x48')]);var _0x19362f={'where':_0x587103[_0xa7ad('0x43')]};return db['MailQueue'][_0xa7ad('0x26')](_0x19362f)[_0xa7ad('0x2a')](function(_0x3ad142){_0x3f16ae[_0xa7ad('0x26')]=_0x3ad142;if(_0x22e7fc[_0xa7ad('0x3a')]['includeAll']){_0x587103[_0xa7ad('0x49')]=[{'all':!![]}];}return db[_0xa7ad('0x35')][_0xa7ad('0x4a')](_0x587103);})[_0xa7ad('0x2a')](function(_0x112e05){_0x3f16ae[_0xa7ad('0x4b')]=_0x112e05;return _0x3f16ae;})['then'](respondWithFilteredResult(_0x4e8858,_0x587103))[_0xa7ad('0x4c')](handleError(_0x4e8858,null));};exports['show']=function(_0x4e28d2,_0x4466db){var _0x1b148a={'raw':!![],'where':{'id':_0x4e28d2[_0xa7ad('0x4d')]['id']}},_0x5a733={};_0x5a733[_0xa7ad('0x38')]=_[_0xa7ad('0x39')](db[_0xa7ad('0x35')][_0xa7ad('0x36')]);_0x5a733['query']=_[_0xa7ad('0x39')](_0x4e28d2[_0xa7ad('0x3a')]);_0x5a733[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x5a733[_0xa7ad('0x38')],_0x5a733['query']);_0x1b148a[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x5a733[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x4e28d2[_0xa7ad('0x3a')]['fields']));_0x1b148a[_0xa7ad('0x3e')]=_0x1b148a[_0xa7ad('0x3e')][_0xa7ad('0x3f')]?_0x1b148a[_0xa7ad('0x3e')]:_0x5a733[_0xa7ad('0x38')];if(_0x4e28d2[_0xa7ad('0x3a')]['includeAll']){_0x1b148a[_0xa7ad('0x49')]=[{'all':!![]}];}_0x1b148a=_[_0xa7ad('0x47')]({},_0x1b148a,_0x4e28d2['options']);return db[_0xa7ad('0x35')][_0xa7ad('0x4e')](_0x1b148a)[_0xa7ad('0x2a')](handleEntityNotFound(_0x4466db,null))['then'](respondWithResult(_0x4466db,null))[_0xa7ad('0x4c')](handleError(_0x4466db,null));};exports[_0xa7ad('0x4f')]=function(_0x28e355,_0x1bc986){return db[_0xa7ad('0x35')][_0xa7ad('0x4f')](_0x28e355[_0xa7ad('0x50')],{})['then'](function(_0x53c145){var _0x4c6e40=_0x28e355[_0xa7ad('0x51')]['get']({'plain':!![]});if(!_0x4c6e40)throw new Error(_0xa7ad('0x52'));if(_0x4c6e40[_0xa7ad('0x53')]===_0xa7ad('0x51')){var _0x462c0c=_0x53c145[_0xa7ad('0x2c')]({'plain':!![]});var _0x3e4c35='MailQueues';return db['UserProfileSection'][_0xa7ad('0x4e')]({'where':{'name':_0x3e4c35,'userProfileId':_0x4c6e40[_0xa7ad('0x54')]},'raw':!![]})[_0xa7ad('0x2a')](function(_0x2133b8){if(_0x2133b8&&_0x2133b8[_0xa7ad('0x55')]===0x0){return db['UserProfileResource'][_0xa7ad('0x4f')]({'name':_0x462c0c[_0xa7ad('0x32')],'resourceId':_0x462c0c['id'],'type':_0x2133b8[_0xa7ad('0x32')],'sectionId':_0x2133b8['id']},{})['then'](function(){return _0x53c145;});}else{return _0x53c145;}})[_0xa7ad('0x4c')](function(_0x69353c){logger['error'](_0xa7ad('0x56'),_0x69353c);throw _0x69353c;});}return _0x53c145;})[_0xa7ad('0x2a')](respondWithResult(_0x1bc986,0xc9))[_0xa7ad('0x4c')](handleError(_0x1bc986,null));};exports[_0xa7ad('0x57')]=function(_0x190af6,_0x7fd642){if(_0x190af6['body']['id']){delete _0x190af6[_0xa7ad('0x50')]['id'];}return db[_0xa7ad('0x35')]['find']({'where':{'id':_0x190af6[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x7fd642,null))['then'](saveUpdates(_0x190af6[_0xa7ad('0x50')],null))[_0xa7ad('0x2a')](respondWithResult(_0x7fd642,null))[_0xa7ad('0x4c')](handleError(_0x7fd642,null));};exports[_0xa7ad('0x2b')]=function(_0x2f1729,_0x52f302){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x2f1729['params']['id']}})['then'](handleEntityNotFound(_0x52f302,null))[_0xa7ad('0x2a')](removeEntity(_0x52f302,null))[_0xa7ad('0x4c')](handleError(_0x52f302,null));};exports['describe']=function(_0x41f31c,_0x44ca34){return db[_0xa7ad('0x35')][_0xa7ad('0x58')]()[_0xa7ad('0x2a')](respondWithResult(_0x44ca34,null))['catch'](handleError(_0x44ca34,null));};exports[_0xa7ad('0x59')]=function(_0x1ea022,_0x548538,_0xd0d679){var _0x4763ac={'raw':!![],'where':{}},_0x104fa9={},_0x5c4ddb;return db[_0xa7ad('0x35')][_0xa7ad('0x5a')]({'where':{'id':_0x1ea022[_0xa7ad('0x4d')]['id']}})['then'](handleEntityNotFound(_0x548538,null))[_0xa7ad('0x2a')](function(_0x51dc3a){if(_0x51dc3a){_0x5c4ddb=_0x51dc3a[_0xa7ad('0x2c')]({'plain':!![]});_0x104fa9[_0xa7ad('0x38')]=_['keys'](db[_0xa7ad('0x5b')][_0xa7ad('0x36')]);_0x104fa9[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x1ea022['query']);_0x104fa9[_0xa7ad('0x3b')]=_['intersection'](_0x104fa9[_0xa7ad('0x38')],_0x104fa9['query']);_0x4763ac[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x104fa9[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x1ea022['query'][_0xa7ad('0x3d')]));_0x4763ac[_0xa7ad('0x3e')]=_0x4763ac['attributes'][_0xa7ad('0x3f')]?_0x4763ac[_0xa7ad('0x3e')]:_0x104fa9[_0xa7ad('0x38')];if(!_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0x4763ac[_0xa7ad('0x25')]=qs[_0xa7ad('0x25')](_0x1ea022[_0xa7ad('0x3a')]['limit']);_0x4763ac['offset']=qs[_0xa7ad('0x23')](_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}_0x4763ac[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x5c')]);_0x4763ac['where']=qs[_0xa7ad('0x3b')](_['pick'](_0x1ea022['query'],_0x104fa9[_0xa7ad('0x3b')]));_0x4763ac[_0xa7ad('0x43')][_0xa7ad('0x5d')]=_0x51dc3a['id'];if(_0x1ea022['query'][_0xa7ad('0x45')]){_0x4763ac['where']=_[_0xa7ad('0x47')](_0x4763ac[_0xa7ad('0x43')],{'$or':_['map'](_0x4763ac[_0xa7ad('0x3e')],function(_0x12e9df){var _0x252997={};_0x252997[_0x12e9df]={'$like':'%'+_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x45')]+'%'};return _0x252997;})});}_0x4763ac=_['merge']({},_0x4763ac,_0x1ea022[_0xa7ad('0x48')]);return db['UserMailQueue'][_0xa7ad('0x4a')](_0x4763ac);}})[_0xa7ad('0x2a')](function(_0x43323a){if(_0x43323a){return db[_0xa7ad('0x5e')][_0xa7ad('0x5f')]({'where':{'id':_[_0xa7ad('0x34')](_0x43323a,_0xa7ad('0x60')),'role':_0xa7ad('0x61')},'attributes':['id',_0xa7ad('0x32'),_0xa7ad('0x62'),_0xa7ad('0x63'),'createdAt']});}})['then'](function(_0x46b9ea){if(_0x46b9ea){return{'count':_0x46b9ea[_0xa7ad('0x26')],'rows':_[_0xa7ad('0x34')](_0x46b9ea[_0xa7ad('0x4b')],function(_0x51bcf0){return{'membername':_0x51bcf0[_0xa7ad('0x32')],'UserId':_0x51bcf0['id'],'queue_name':_0x5c4ddb[_0xa7ad('0x32')],'MailQueueId':_0x5c4ddb['id'],'interface':util['format'](_0xa7ad('0x64'),_0xa7ad('0x65'),_0x51bcf0['name']),'penalty':0x0,'paused':_0x51bcf0[_0xa7ad('0x62')],'createdAt':_0x51bcf0['createdAt'],'updatedAt':_0x51bcf0[_0xa7ad('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x548538,_0x4763ac))[_0xa7ad('0x4c')](handleError(_0x548538,null));};exports[_0xa7ad('0x66')]=function(_0x16f5de,_0x3ed3af,_0x20d48d){var _0xbafc8f={};var _0x4100dd={};var _0x194d10;var _0x5c743e;return db[_0xa7ad('0x35')][_0xa7ad('0x5a')]({'where':{'id':_0x16f5de[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x3ed3af,null))['then'](function(_0x2b8b77){if(_0x2b8b77){_0x194d10=_0x2b8b77;_0x4100dd[_0xa7ad('0x38')]=_[_0xa7ad('0x39')](db[_0xa7ad('0x67')][_0xa7ad('0x36')]);_0x4100dd[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x16f5de[_0xa7ad('0x3a')]);_0x4100dd[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x4100dd[_0xa7ad('0x38')],_0x4100dd[_0xa7ad('0x3a')]);_0xbafc8f[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x4100dd[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x16f5de['query'][_0xa7ad('0x3d')]));_0xbafc8f[_0xa7ad('0x3e')]=_0xbafc8f[_0xa7ad('0x3e')]['length']?_0xbafc8f[_0xa7ad('0x3e')]:_0x4100dd[_0xa7ad('0x38')];_0xbafc8f[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x16f5de[_0xa7ad('0x3a')]['sort']);_0xbafc8f[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_[_0xa7ad('0x44')](_0x16f5de[_0xa7ad('0x3a')],_0x4100dd[_0xa7ad('0x3b')]));if(_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0xbafc8f[_0xa7ad('0x43')]=_[_0xa7ad('0x47')](_0xbafc8f['where'],{'$or':_[_0xa7ad('0x34')](_0xbafc8f[_0xa7ad('0x3e')],function(_0x5a95c7){var _0x254546={};_0x254546[_0x5a95c7]={'$like':'%'+_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x45')]+'%'};return _0x254546;})});}_0xbafc8f=_['merge']({},_0xbafc8f,_0x16f5de[_0xa7ad('0x48')]);return _0x194d10[_0xa7ad('0x66')](_0xbafc8f);}})[_0xa7ad('0x2a')](function(_0x3a7972){if(_0x3a7972){_0x5c743e=_0x3a7972[_0xa7ad('0x3f')];if(!_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0xbafc8f[_0xa7ad('0x25')]=qs['limit'](_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x25')]);_0xbafc8f[_0xa7ad('0x23')]=qs['offset'](_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}return _0x194d10[_0xa7ad('0x66')](_0xbafc8f);}})[_0xa7ad('0x2a')](function(_0x34bf2e){if(_0x34bf2e){return _0x34bf2e?{'count':_0x5c743e,'rows':_0x34bf2e}:null;}})[_0xa7ad('0x2a')](respondWithResult(_0x3ed3af,null))[_0xa7ad('0x4c')](handleError(_0x3ed3af,null));};exports['addTeams']=function(_0x27f269,_0x5602e7,_0xaaf271){var _0x3d7cfc=_0x27f269['body'][_0xa7ad('0x68')];return db[_0xa7ad('0x67')][_0xa7ad('0x4a')]({'where':{'id':_0x3d7cfc},'attributes':['id'],'include':[{'model':db[_0xa7ad('0x5e')],'as':'Agents','attributes':['id',_0xa7ad('0x32'),_0xa7ad('0x69'),'voicePause',_0xa7ad('0x6a')],'raw':!![]}]})[_0xa7ad('0x2a')](function(_0x436268){if(_0x436268){var _0x5af571=_[_0xa7ad('0x6b')](_0x436268,function(_0x2cf829){var _0x548623=_0x2cf829[_0xa7ad('0x2c')]({'plain':!![]});return _0x548623[_0xa7ad('0x6c')];});return db[_0xa7ad('0x35')]['find']({'where':{'id':_0x27f269[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](function(_0x374d71){return db['sequelize'][_0xa7ad('0x6d')](function(_0x2b38c5){return _0x374d71[_0xa7ad('0x6e')](_0x3d7cfc,{'transaction':_0x2b38c5})[_0xa7ad('0x2a')](function(){return BPromise['each'](_0x5af571,function(_0x55e671){return db[_0xa7ad('0x5b')][_0xa7ad('0x6f')]({'where':{'UserId':_0x55e671['id'],'MailQueueId':_0x27f269[_0xa7ad('0x4d')]['id']},'transaction':_0x2b38c5});});})[_0xa7ad('0x2a')](function(){_0x5af571[_0xa7ad('0x70')](function(_0x5d568f){socket[_0xa7ad('0x71')](_0xa7ad('0x72'),{'UserId':_0x5d568f['id'],'MailQueueId':_0x374d71['id']});});});});});}})[_0xa7ad('0x2a')](respondWithStatusCode(_0x5602e7,null))[_0xa7ad('0x4c')](handleError(_0x5602e7,null));};exports[_0xa7ad('0x73')]=function(_0x49fc16,_0x2d1b12,_0x3dcaae){return db['Team']['findAll']({'where':{'id':_0x49fc16[_0xa7ad('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa7ad('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d1b12,null))[_0xa7ad('0x2a')](function(_0x396c48){var _0x15b651=_['map'](_0x396c48,'id');var _0x34eb21=[];var _0x1f4416=[];var _0x1ba3e3=squel[_0xa7ad('0x74')]();_0x1ba3e3[_0xa7ad('0x75')](_0xa7ad('0x76'))[_0xa7ad('0x77')]('team_has_mail_queues','tq')[_0xa7ad('0x78')](_0xa7ad('0x79'),'ut',_0xa7ad('0x7a'))[_0xa7ad('0x43')](_0xa7ad('0x7b'),_0x49fc16['params']['id']);for(var _0x557979=0x0;_0x557979<_0x396c48[_0xa7ad('0x3f')];_0x557979+=0x1){let _0x517a22=_0x396c48[_0x557979];for(var _0x12dc00=0x0;_0x12dc00<_0x517a22[_0xa7ad('0x6c')][_0xa7ad('0x3f')];_0x12dc00+=0x1){let _0x385225=_0x517a22[_0xa7ad('0x6c')][_0x12dc00];var _0x2b3007=_0x1ba3e3[_0xa7ad('0x7c')]();_0x2b3007[_0xa7ad('0x43')]('ut.UserId\x20=\x20?',_0x385225['id']);_0x1f4416[_0xa7ad('0x7d')](db['sequelize'][_0xa7ad('0x3a')](_0x2b3007['toString'](),{'type':db[_0xa7ad('0x7e')][_0xa7ad('0x7f')][_0xa7ad('0x80')]})[_0xa7ad('0x2a')](function(_0x2d8513){if(_0x2d8513[_0xa7ad('0x3f')]===0x1){return _0x385225['id'];}else{var _0x37ed3f=_['every'](_[_0xa7ad('0x34')](_0x2d8513,_0xa7ad('0x81')),function(_0x476144){return _[_0xa7ad('0x82')](_0x15b651,_0x476144);});if(_0x37ed3f){return _0x385225['id'];}}}));}}return BPromise[_0xa7ad('0x83')](_0x1f4416)[_0xa7ad('0x2a')](function(_0x321c3b){_0x34eb21=_(_0x34eb21)[_0xa7ad('0x84')](_0x321c3b)[_0xa7ad('0x85')]()[_0xa7ad('0x86')]();return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x49fc16[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](function(_0x4f3d1a){return db[_0xa7ad('0x7e')]['transaction'](function(_0x49942a){return _0x4f3d1a[_0xa7ad('0x73')](_0x49fc16[_0xa7ad('0x3a')][_0xa7ad('0x68')],{'transaction':_0x49942a})[_0xa7ad('0x2a')](function(){if(!_['isEmpty'](_0x34eb21)){return _0x4f3d1a[_0xa7ad('0x87')](_0x34eb21,{'transaction':_0x49942a});}})[_0xa7ad('0x2a')](function(){_0x34eb21[_0xa7ad('0x70')](function(_0x53dddc){socket['emit'](_0xa7ad('0x88'),{'UserId':_0x53dddc,'MailQueueId':_0x4f3d1a['id']});});});});});});})[_0xa7ad('0x2a')](respondWithStatusCode(_0x2d1b12,null))[_0xa7ad('0x4c')](handleError(_0x2d1b12,null));};exports[_0xa7ad('0x89')]=function(_0x36d932,_0x2ceece,_0x354495){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x36d932[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x2ceece,null))['then'](function(_0x15ba0d){if(_0x15ba0d){return _0x15ba0d[_0xa7ad('0x89')](_0x36d932[_0xa7ad('0x50')][_0xa7ad('0x68')],_[_0xa7ad('0x8a')](_0x36d932[_0xa7ad('0x50')],[_0xa7ad('0x68'),'id'])||{})[_0xa7ad('0x8b')](function(_0xf82a8e){for(var _0x1c7a14=0x0;_0x1c7a14<_0x36d932[_0xa7ad('0x50')][_0xa7ad('0x68')][_0xa7ad('0x3f')];_0x1c7a14+=0x1){socket[_0xa7ad('0x71')](_0xa7ad('0x72'),{'UserId':Number(_0x36d932['body'][_0xa7ad('0x68')][_0x1c7a14]),'MailQueueId':Number(_0x36d932[_0xa7ad('0x4d')]['id'])});}return _0xf82a8e;});}})[_0xa7ad('0x2a')](respondWithResult(_0x2ceece,null))[_0xa7ad('0x4c')](handleError(_0x2ceece,null));};exports[_0xa7ad('0x87')]=function(_0x5b9b48,_0x1a1a91,_0x13af3e){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x5b9b48[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x1a1a91,null))[_0xa7ad('0x2a')](function(_0x217da0){if(_0x217da0){return _0x217da0[_0xa7ad('0x87')](_0x5b9b48[_0xa7ad('0x3a')][_0xa7ad('0x68')])[_0xa7ad('0x2a')](function(){if(_[_0xa7ad('0x8c')](_0x5b9b48['query']['ids'])){for(var _0x1dc0ed=0x0;_0x1dc0ed<_0x5b9b48['query'][_0xa7ad('0x68')][_0xa7ad('0x3f')];_0x1dc0ed+=0x1){socket[_0xa7ad('0x71')]('userMailQueue:remove',{'UserId':Number(_0x5b9b48[_0xa7ad('0x3a')][_0xa7ad('0x68')][_0x1dc0ed]),'MailQueueId':Number(_0x5b9b48[_0xa7ad('0x4d')]['id'])});}}else{socket[_0xa7ad('0x71')]('userMailQueue:remove',{'UserId':Number(_0x5b9b48['query']['ids']),'MailQueueId':Number(_0x5b9b48[_0xa7ad('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a1a91,null))['catch'](handleError(_0x1a1a91,null));};exports['getAgents']=function(_0x1708f1,_0x370585,_0x2bcd0c){var _0x104ddb={};var _0x21c1f6={};var _0x4dadc0;var _0x38879d;return db[_0xa7ad('0x35')]['findOne']({'where':{'id':_0x1708f1[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x370585,null))['then'](function(_0x5ae108){if(_0x5ae108){_0x4dadc0=_0x5ae108;_0x21c1f6[_0xa7ad('0x38')]=_['keys'](db[_0xa7ad('0x5e')][_0xa7ad('0x36')]);_0x21c1f6[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x1708f1[_0xa7ad('0x3a')]);_0x21c1f6[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x21c1f6['model'],_0x21c1f6['query']);_0x104ddb['attributes']=_['intersection'](_0x21c1f6[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x3d')]));_0x104ddb[_0xa7ad('0x3e')]=_0x104ddb[_0xa7ad('0x3e')][_0xa7ad('0x3f')]?_0x104ddb[_0xa7ad('0x3e')]:_0x21c1f6[_0xa7ad('0x38')];_0x104ddb[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x5c')]);_0x104ddb[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_['pick'](_0x1708f1[_0xa7ad('0x3a')],_0x21c1f6[_0xa7ad('0x3b')]));if(_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0x104ddb[_0xa7ad('0x43')]=_[_0xa7ad('0x47')](_0x104ddb[_0xa7ad('0x43')],{'$or':_[_0xa7ad('0x34')](_0x104ddb[_0xa7ad('0x3e')],function(_0x3eb9c2){var _0x5bcad8={};_0x5bcad8[_0x3eb9c2]={'$like':'%'+_0x1708f1[_0xa7ad('0x3a')]['filter']+'%'};return _0x5bcad8;})});}_0x104ddb=_['merge']({},_0x104ddb,_0x1708f1['options']);return _0x4dadc0[_0xa7ad('0x8d')](_0x104ddb);}})[_0xa7ad('0x2a')](function(_0x4531af){if(_0x4531af){_0x38879d=_0x4531af[_0xa7ad('0x3f')];if(!_0x1708f1[_0xa7ad('0x3a')]['hasOwnProperty'](_0xa7ad('0x41'))){_0x104ddb[_0xa7ad('0x25')]=qs['limit'](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x25')]);_0x104ddb['offset']=qs[_0xa7ad('0x23')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}return _0x4dadc0[_0xa7ad('0x8d')](_0x104ddb);}})[_0xa7ad('0x2a')](function(_0x1be1b9){if(_0x1be1b9){return _0x1be1b9?{'count':_0x38879d,'rows':_0x1be1b9}:null;}})['then'](respondWithResult(_0x370585,null))[_0xa7ad('0x4c')](handleError(_0x370585,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index cc94618..5d3cb9d 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 _0x2e3f=['../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5a4844,_0x4b266d){var _0x550824=function(_0x2c114d){while(--_0x2c114d){_0x5a4844['push'](_0x5a4844['shift']());}};_0x550824(++_0x4b266d);}(_0x2e3f,0x81));var _0xf2e3=function(_0x3e4e5c,_0x4d2966){_0x3e4e5c=_0x3e4e5c-0x0;var _0x46f0bf=_0x2e3f[_0x3e4e5c];return _0x46f0bf;};'use strict';var EventEmitter=require(_0xf2e3('0x0'));var MailQueue=require(_0xf2e3('0x1'))['db'][_0xf2e3('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf2e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2e3('0x4'),'afterDestroy':_0xf2e3('0x5')};function emitEvent(_0x53d804){return function(_0x5a5c8d,_0x409fa6,_0x7bd7d8){MailQueueEvents[_0xf2e3('0x6')](_0x53d804+':'+_0x5a5c8d['id'],_0x5a5c8d);MailQueueEvents[_0xf2e3('0x6')](_0x53d804,_0x5a5c8d);_0x7bd7d8(null);};}for(var e in events){if(events[_0xf2e3('0x7')](e)){var event=events[e];MailQueue[_0xf2e3('0x8')](e,emitEvent(event));}}module[_0xf2e3('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x6656=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x375efe,_0x27df2d){var _0x1d5db6=function(_0x43e15d){while(--_0x43e15d){_0x375efe['push'](_0x375efe['shift']());}};_0x1d5db6(++_0x27df2d);}(_0x6656,0x18e));var _0x6665=function(_0x55419e,_0x2d49f6){_0x55419e=_0x55419e-0x0;var _0x460121=_0x6656[_0x55419e];return _0x460121;};'use strict';var EventEmitter=require(_0x6665('0x0'));var MailQueue=require(_0x6665('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6665('0x2')](0x0);var events={'afterCreate':_0x6665('0x3'),'afterUpdate':_0x6665('0x4'),'afterDestroy':_0x6665('0x5')};function emitEvent(_0x28300c){return function(_0x4aebe5,_0x598d74,_0x13f8db){MailQueueEvents[_0x6665('0x6')](_0x28300c+':'+_0x4aebe5['id'],_0x4aebe5);MailQueueEvents[_0x6665('0x6')](_0x28300c,_0x4aebe5);_0x13f8db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6665('0x7')](e,emitEvent(event));}}module[_0x6665('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 0b0e3a5..f92bce3 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 _0x5e72=['MailQueue','mail_queues','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x438974,_0x103d33){var _0x3a0216=function(_0x172aef){while(--_0x172aef){_0x438974['push'](_0x438974['shift']());}};_0x3a0216(++_0x103d33);}(_0x5e72,0x110));var _0x25e7=function(_0xc49502,_0x4f23e4){_0xc49502=_0xc49502-0x0;var _0x22ddf1=_0x5e72[_0xc49502];return _0x22ddf1;};'use strict';var _=require(_0x25e7('0x0'));var util=require(_0x25e7('0x1'));var logger=require(_0x25e7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25e7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25e7('0x4'));var config=require(_0x25e7('0x5'));var attributes=require('./mailQueue.attributes');module[_0x25e7('0x6')]=function(_0x48d1d0,_0x49889d){return _0x48d1d0[_0x25e7('0x7')](_0x25e7('0x8'),attributes,{'tableName':_0x25e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31c7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','util','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x31c7,0x1e4));var _0x731c=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x31c7[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x731c('0x0'));var logger=require(_0x731c('0x1'))('api');var moment=require(_0x731c('0x2'));var BPromise=require(_0x731c('0x3'));var rp=require(_0x731c('0x4'));var fs=require('fs');var path=require(_0x731c('0x5'));var rimraf=require(_0x731c('0x6'));var config=require(_0x731c('0x7'));var attributes=require(_0x731c('0x8'));module['exports']=function(_0xe9fe03,_0x285a20){return _0xe9fe03['define']('MailQueue',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 7ed122a..cd7de67 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 _0xe10b=['redis','localhost','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailQueue','options','raw','where','attributes','limit','map','include','model','GetMailQueue','find','ShowMailQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe10b,0x98));var _0xbe10=function(_0x22adc0,_0x53f799){_0x22adc0=_0x22adc0-0x0;var _0x373f93=_0xe10b[_0x22adc0];return _0x373f93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe10('0x0'));var BPromise=require(_0xbe10('0x1'));var rs=require(_0xbe10('0x2'));var fs=require('fs');var Redis=require(_0xbe10('0x3'));var db=require(_0xbe10('0x4'))['db'];var utils=require(_0xbe10('0x5'));var logger=require(_0xbe10('0x6'))(_0xbe10('0x7'));var config=require(_0xbe10('0x8'));var jayson=require(_0xbe10('0x9'));var client=jayson[_0xbe10('0xa')][_0xbe10('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbe10('0xc')],{'host':_0xbe10('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe10('0xe'))[_0xbe10('0xf')](socket);function respondWithRpcPromise(_0x12cad7,_0x37f13c,_0xa6f88c){return new BPromise(function(_0x2dfbf6,_0x5b9cad){return client[_0xbe10('0x10')](_0x12cad7,_0xa6f88c)[_0xbe10('0x11')](function(_0x4f307b){logger['info'](_0xbe10('0x12'),_0x37f13c,_0xbe10('0x13'));logger[_0xbe10('0x14')](_0xbe10('0x15'),_0x37f13c,'request\x20sent',JSON[_0xbe10('0x16')](_0x4f307b));if(_0x4f307b[_0xbe10('0x17')]){if(_0x4f307b[_0xbe10('0x17')][_0xbe10('0x18')]===0x1f4){logger[_0xbe10('0x17')](_0xbe10('0x12'),_0x37f13c,_0x4f307b[_0xbe10('0x17')][_0xbe10('0x19')]);return _0x5b9cad(_0x4f307b[_0xbe10('0x17')][_0xbe10('0x19')]);}logger[_0xbe10('0x17')](_0xbe10('0x12'),_0x37f13c,_0x4f307b[_0xbe10('0x17')][_0xbe10('0x19')]);return _0x2dfbf6(_0x4f307b[_0xbe10('0x17')][_0xbe10('0x19')]);}else{logger[_0xbe10('0x1a')](_0xbe10('0x12'),_0x37f13c,'request\x20sent');_0x2dfbf6(_0x4f307b[_0xbe10('0x1b')][_0xbe10('0x19')]);}})[_0xbe10('0x1c')](function(_0x131790){logger[_0xbe10('0x17')](_0xbe10('0x12'),_0x37f13c,_0x131790);_0x5b9cad(_0x131790);});});}exports['GetMailQueue']=function(_0x575d32){var _0x2dd1f6=this;return new Promise(function(_0x45e509,_0x91dad2){return db[_0xbe10('0x1d')]['findAll']({'raw':_0x575d32[_0xbe10('0x1e')]?_0x575d32['options'][_0xbe10('0x1f')]===undefined?!![]:![]:!![],'where':_0x575d32['options']?_0x575d32[_0xbe10('0x1e')][_0xbe10('0x20')]||null:null,'attributes':_0x575d32[_0xbe10('0x1e')]?_0x575d32['options'][_0xbe10('0x21')]||null:null,'limit':_0x575d32[_0xbe10('0x1e')]?_0x575d32[_0xbe10('0x1e')][_0xbe10('0x22')]||null:null,'include':_0x575d32[_0xbe10('0x1e')]?_0x575d32['options']['include']?_[_0xbe10('0x23')](_0x575d32[_0xbe10('0x1e')]['include'],function(_0xf93c4e){return{'model':db[_0xf93c4e['model']],'as':_0xf93c4e['as'],'attributes':_0xf93c4e[_0xbe10('0x21')],'include':_0xf93c4e[_0xbe10('0x24')]?_[_0xbe10('0x23')](_0xf93c4e[_0xbe10('0x24')],function(_0x497200){return{'model':db[_0x497200[_0xbe10('0x25')]],'as':_0x497200['as'],'attributes':_0x497200[_0xbe10('0x21')],'include':_0x497200[_0xbe10('0x24')]?_[_0xbe10('0x23')](_0x497200[_0xbe10('0x24')],function(_0x2d3301){return{'model':db[_0x2d3301[_0xbe10('0x25')]],'as':_0x2d3301['as'],'attributes':_0x2d3301[_0xbe10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbe10('0x11')](function(_0x27c9e2){logger['info'](_0xbe10('0x26'),_0x575d32);logger[_0xbe10('0x14')]('GetMailQueue',_0x575d32,JSON['stringify'](_0x27c9e2));_0x45e509(_0x27c9e2);})['catch'](function(_0x5ab048){logger['error'](_0xbe10('0x26'),_0x5ab048[_0xbe10('0x19')],_0x575d32);_0x91dad2(_0x2dd1f6[_0xbe10('0x17')](0x1f4,_0x5ab048[_0xbe10('0x19')]));});});};exports['ShowMailQueue']=function(_0x4e4396){var _0x4d6e57=this;return new Promise(function(_0x2bf758,_0x3c15d3){return db[_0xbe10('0x1d')][_0xbe10('0x27')]({'raw':_0x4e4396[_0xbe10('0x1e')]?_0x4e4396['options'][_0xbe10('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e4396[_0xbe10('0x1e')]?_0x4e4396['options'][_0xbe10('0x20')]||null:null,'attributes':_0x4e4396['options']?_0x4e4396[_0xbe10('0x1e')][_0xbe10('0x21')]||null:null,'include':_0x4e4396['options']?_0x4e4396[_0xbe10('0x1e')][_0xbe10('0x24')]?_[_0xbe10('0x23')](_0x4e4396[_0xbe10('0x1e')][_0xbe10('0x24')],function(_0x72364b){return{'model':db[_0x72364b[_0xbe10('0x25')]],'as':_0x72364b['as'],'attributes':_0x72364b[_0xbe10('0x21')],'include':_0x72364b[_0xbe10('0x24')]?_[_0xbe10('0x23')](_0x72364b[_0xbe10('0x24')],function(_0x4786a6){return{'model':db[_0x4786a6[_0xbe10('0x25')]],'as':_0x4786a6['as'],'attributes':_0x4786a6[_0xbe10('0x21')],'include':_0x4786a6['include']?_[_0xbe10('0x23')](_0x4786a6['include'],function(_0x529608){return{'model':db[_0x529608[_0xbe10('0x25')]],'as':_0x529608['as'],'attributes':_0x529608[_0xbe10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbe10('0x11')](function(_0x29d89a){logger[_0xbe10('0x1a')]('ShowMailQueue',_0x4e4396);logger[_0xbe10('0x14')]('ShowMailQueue',_0x4e4396,JSON['stringify'](_0x29d89a));_0x2bf758(_0x29d89a);})[_0xbe10('0x1c')](function(_0x579c1b){logger[_0xbe10('0x17')](_0xbe10('0x28'),_0x579c1b[_0xbe10('0x19')],_0x4e4396);_0x3c15d3(_0x4d6e57[_0xbe10('0x17')](0x1f4,_0x579c1b[_0xbe10('0x19')]));});});}; \ No newline at end of file +var _0xe075=['options','raw','where','attributes','limit','map','include','model','find','catch','ShowMailQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetMailQueue'];(function(_0x11a53c,_0x486647){var _0x119348=function(_0x416318){while(--_0x416318){_0x11a53c['push'](_0x11a53c['shift']());}};_0x119348(++_0x486647);}(_0xe075,0x143));var _0x5e07=function(_0x37c71b,_0x22b0fa){_0x37c71b=_0x37c71b-0x0;var _0x15e8df=_0xe075[_0x37c71b];return _0x15e8df;};'use strict';var _=require('lodash');var util=require(_0x5e07('0x0'));var moment=require(_0x5e07('0x1'));var BPromise=require(_0x5e07('0x2'));var rs=require(_0x5e07('0x3'));var fs=require('fs');var Redis=require(_0x5e07('0x4'));var db=require(_0x5e07('0x5'))['db'];var utils=require(_0x5e07('0x6'));var logger=require(_0x5e07('0x7'))(_0x5e07('0x8'));var config=require(_0x5e07('0x9'));var jayson=require(_0x5e07('0xa'));var client=jayson[_0x5e07('0xb')]['http']({'port':0x232a});config[_0x5e07('0xc')]=_[_0x5e07('0xd')](config['redis'],{'host':_0x5e07('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e07('0xf'))[_0x5e07('0x10')](socket);function respondWithRpcPromise(_0x11a3d9,_0x5c1ac8,_0x452077){return new BPromise(function(_0x21d27f,_0x3faa6c){return client[_0x5e07('0x11')](_0x11a3d9,_0x452077)[_0x5e07('0x12')](function(_0x1a4368){logger[_0x5e07('0x13')](_0x5e07('0x14'),_0x5c1ac8,_0x5e07('0x15'));logger[_0x5e07('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x5c1ac8,_0x5e07('0x15'),JSON[_0x5e07('0x17')](_0x1a4368));if(_0x1a4368[_0x5e07('0x18')]){if(_0x1a4368[_0x5e07('0x18')][_0x5e07('0x19')]===0x1f4){logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);return _0x3faa6c(_0x1a4368[_0x5e07('0x18')]['message']);}logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);return _0x21d27f(_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);}else{logger[_0x5e07('0x13')]('MailQueue,\x20%s,\x20%s',_0x5c1ac8,_0x5e07('0x15'));_0x21d27f(_0x1a4368['result'][_0x5e07('0x1a')]);}})['catch'](function(_0x32cda9){logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x32cda9);_0x3faa6c(_0x32cda9);});});}exports[_0x5e07('0x1b')]=function(_0x3bbd9b){var _0x4c4af4=this;return new Promise(function(_0x16484b,_0x4bb2c3){return db['MailQueue']['findAll']({'raw':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x1e')]||null:null,'attributes':_0x3bbd9b['options']?_0x3bbd9b['options'][_0x5e07('0x1f')]||null:null,'limit':_0x3bbd9b['options']?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x20')]||null:null,'include':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')]['include']?_[_0x5e07('0x21')](_0x3bbd9b['options'][_0x5e07('0x22')],function(_0x289f95){return{'model':db[_0x289f95[_0x5e07('0x23')]],'as':_0x289f95['as'],'attributes':_0x289f95[_0x5e07('0x1f')],'include':_0x289f95['include']?_['map'](_0x289f95['include'],function(_0x4ae64d){return{'model':db[_0x4ae64d['model']],'as':_0x4ae64d['as'],'attributes':_0x4ae64d[_0x5e07('0x1f')],'include':_0x4ae64d['include']?_[_0x5e07('0x21')](_0x4ae64d[_0x5e07('0x22')],function(_0x1864ba){return{'model':db[_0x1864ba[_0x5e07('0x23')]],'as':_0x1864ba['as'],'attributes':_0x1864ba[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e07('0x12')](function(_0x321ff8){logger[_0x5e07('0x13')](_0x5e07('0x1b'),_0x3bbd9b);logger[_0x5e07('0x16')](_0x5e07('0x1b'),_0x3bbd9b,JSON[_0x5e07('0x17')](_0x321ff8));_0x16484b(_0x321ff8);})['catch'](function(_0x297b31){logger['error']('GetMailQueue',_0x297b31[_0x5e07('0x1a')],_0x3bbd9b);_0x4bb2c3(_0x4c4af4[_0x5e07('0x18')](0x1f4,_0x297b31[_0x5e07('0x1a')]));});});};exports['ShowMailQueue']=function(_0x5c55ad){var _0x55a0c6=this;return new Promise(function(_0x332790,_0x52f012){return db['MailQueue'][_0x5e07('0x24')]({'raw':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1e')]||null:null,'attributes':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1f')]||null:null,'include':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x22')],function(_0x8d92e4){return{'model':db[_0x8d92e4['model']],'as':_0x8d92e4['as'],'attributes':_0x8d92e4[_0x5e07('0x1f')],'include':_0x8d92e4[_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x8d92e4[_0x5e07('0x22')],function(_0x37f380){return{'model':db[_0x37f380[_0x5e07('0x23')]],'as':_0x37f380['as'],'attributes':_0x37f380['attributes'],'include':_0x37f380[_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x37f380['include'],function(_0x2d7151){return{'model':db[_0x2d7151[_0x5e07('0x23')]],'as':_0x2d7151['as'],'attributes':_0x2d7151[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x558359){logger[_0x5e07('0x13')]('ShowMailQueue',_0x5c55ad);logger['debug']('ShowMailQueue',_0x5c55ad,JSON[_0x5e07('0x17')](_0x558359));_0x332790(_0x558359);})[_0x5e07('0x25')](function(_0x1cae27){logger[_0x5e07('0x18')](_0x5e07('0x26'),_0x1cae27[_0x5e07('0x1a')],_0x5c55ad);_0x52f012(_0x55a0c6[_0x5e07('0x18')](0x1f4,_0x1cae27[_0x5e07('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c5dcdc5..5256abf 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 _0xb25b=['length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x11471a,_0x520bb3){var _0x3f9f5c=function(_0x19e097){while(--_0x19e097){_0x11471a['push'](_0x11471a['shift']());}};_0x3f9f5c(++_0x520bb3);}(_0xb25b,0x12b));var _0xbb25=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb25b[_0x3bf83f];return _0x22c4a9;};'use strict';var MailQueueEvents=require(_0xbb25('0x0'));var events=[_0xbb25('0x1'),_0xbb25('0x2'),_0xbb25('0x3')];function createListener(_0x203c5e,_0x3e7110){return function(_0x69eb75){_0x3e7110[_0xbb25('0x4')](_0x203c5e,_0x69eb75);};}function removeListener(_0x41c429,_0x1d96dc){return function(){MailQueueEvents[_0xbb25('0x5')](_0x41c429,_0x1d96dc);};}exports[_0xbb25('0x6')]=function(_0x132b3f){for(var _0x2a3266=0x0,_0x1b492f=events[_0xbb25('0x7')];_0x2a3266<_0x1b492f;_0x2a3266++){var _0x337032=events[_0x2a3266];var _0x149c6c=createListener(_0xbb25('0x8')+_0x337032,_0x132b3f);MailQueueEvents['on'](_0x337032,_0x149c6c);}}; \ No newline at end of file +var _0x8e78=['emit','removeListener','register','length','./mailQueue.events','save','remove','update'];(function(_0x3ddb7f,_0x14ed87){var _0x47c7d8=function(_0x422aa1){while(--_0x422aa1){_0x3ddb7f['push'](_0x3ddb7f['shift']());}};_0x47c7d8(++_0x14ed87);}(_0x8e78,0xdc));var _0x88e7=function(_0x1df6b1,_0x1a5ca9){_0x1df6b1=_0x1df6b1-0x0;var _0x23c434=_0x8e78[_0x1df6b1];return _0x23c434;};'use strict';var MailQueueEvents=require(_0x88e7('0x0'));var events=[_0x88e7('0x1'),_0x88e7('0x2'),_0x88e7('0x3')];function createListener(_0x2e04a1,_0x48ffed){return function(_0x4a4b2d){_0x48ffed[_0x88e7('0x4')](_0x2e04a1,_0x4a4b2d);};}function removeListener(_0x1b5316,_0x2f54c1){return function(){MailQueueEvents[_0x88e7('0x5')](_0x1b5316,_0x2f54c1);};}exports[_0x88e7('0x6')]=function(_0x4c1384){for(var _0x316ed7=0x0,_0x41ccad=events[_0x88e7('0x7')];_0x316ed7<_0x41ccad;_0x316ed7++){var _0x4cf8f8=events[_0x316ed7];var _0x4bbbad=createListener('mailQueue:'+_0x4cf8f8,_0x4c1384);MailQueueEvents['on'](_0x4cf8f8,_0x4bbbad);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index dd7187a..48f855d 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 _0xe2e4=['put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create'];(function(_0x254958,_0x430edb){var _0x505078=function(_0x30dd47){while(--_0x30dd47){_0x254958['push'](_0x254958['shift']());}};_0x505078(++_0x430edb);}(_0xe2e4,0x108));var _0x4e2e=function(_0x297ec5,_0x860cf4){_0x297ec5=_0x297ec5-0x0;var _0x367d44=_0xe2e4[_0x297ec5];return _0x367d44;};'use strict';var multer=require(_0x4e2e('0x0'));var util=require(_0x4e2e('0x1'));var path=require(_0x4e2e('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e2e('0x3'));var router=express[_0x4e2e('0x4')]();var fs_extra=require(_0x4e2e('0x5'));var auth=require(_0x4e2e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e2e('0x7'));router['get']('/',auth[_0x4e2e('0x8')](),controller[_0x4e2e('0x9')]);router[_0x4e2e('0xa')](_0x4e2e('0xb'),auth[_0x4e2e('0x8')](),controller[_0x4e2e('0xc')]);router[_0x4e2e('0xa')](_0x4e2e('0xd'),auth['isAuthenticated'](),controller[_0x4e2e('0xe')]);router['post']('/',auth[_0x4e2e('0x8')](),controller[_0x4e2e('0xf')]);router[_0x4e2e('0x10')](_0x4e2e('0xd'),auth[_0x4e2e('0x8')](),controller[_0x4e2e('0x11')]);router[_0x4e2e('0x12')]('/:id',auth[_0x4e2e('0x8')](),controller['destroy']);module[_0x4e2e('0x13')]=router; \ No newline at end of file +var _0xa439=['update','delete','/:id','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put'];(function(_0x2f6c77,_0x5ef873){var _0x783a3c=function(_0x3ea64a){while(--_0x3ea64a){_0x2f6c77['push'](_0x2f6c77['shift']());}};_0x783a3c(++_0x5ef873);}(_0xa439,0xad));var _0x9a43=function(_0x4685da,_0x1a2975){_0x4685da=_0x4685da-0x0;var _0x152c1c=_0xa439[_0x4685da];return _0x152c1c;};'use strict';var multer=require(_0x9a43('0x0'));var util=require('util');var path=require(_0x9a43('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a43('0x2'));var router=express[_0x9a43('0x3')]();var fs_extra=require(_0x9a43('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a43('0x5'));var config=require(_0x9a43('0x6'));var controller=require('./mailQueueReport.controller');router[_0x9a43('0x7')]('/',auth[_0x9a43('0x8')](),controller[_0x9a43('0x9')]);router['get'](_0x9a43('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9a43('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a43('0xc')]);router[_0x9a43('0xd')]('/:id',auth[_0x9a43('0x8')](),controller[_0x9a43('0xe')]);router[_0x9a43('0xf')](_0x9a43('0x10'),auth[_0x9a43('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f236523..49b7f98 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 _0xdd1c=['STRING','DATE','moment','sequelize'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0xdd1c,0x66));var _0xcdd1=function(_0x9e05d1,_0x3cef4a){_0x9e05d1=_0x9e05d1-0x0;var _0x4f7e97=_0xdd1c[_0x9e05d1];return _0x4f7e97;};'use strict';var moment=require(_0xcdd1('0x0'));var Sequelize=require(_0xcdd1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xcdd1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcdd1('0x2')]},'joinAt':{'type':Sequelize[_0xcdd1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcdd1('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc4d1=['STRING','DATE','sequelize','exports'];(function(_0x4e319e,_0x56d20c){var _0x136a2c=function(_0x1020ee){while(--_0x1020ee){_0x4e319e['push'](_0x4e319e['shift']());}};_0x136a2c(++_0x56d20c);}(_0xc4d1,0x1b2));var _0x1c4d=function(_0x4e46fd,_0x5993bb){_0x4e46fd=_0x4e46fd-0x0;var _0x4dc5cf=_0xc4d1[_0x4e46fd];return _0x4dc5cf;};'use strict';var moment=require('moment');var Sequelize=require(_0x1c4d('0x0'));module[_0x1c4d('0x1')]={'uniqueid':{'type':Sequelize[_0x1c4d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1c4d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1c4d('0x3')]},'acceptAt':{'type':Sequelize[_0x1c4d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1c4d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e1e646b..5838557 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 _0x2da6=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','intersection','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x3952d8,_0x13e783){var _0x52d4b1=function(_0x2964cb){while(--_0x2964cb){_0x3952d8['push'](_0x3952d8['shift']());}};_0x52d4b1(++_0x13e783);}(_0x2da6,0x1dd));var _0x62da=function(_0x20226b,_0x38edb6){_0x20226b=_0x20226b-0x0;var _0x32452f=_0x2da6[_0x20226b];return _0x32452f;};'use strict';var emlformat=require(_0x62da('0x0'));var rimraf=require(_0x62da('0x1'));var zipdir=require(_0x62da('0x2'));var jsonpatch=require(_0x62da('0x3'));var rp=require(_0x62da('0x4'));var moment=require(_0x62da('0x5'));var BPromise=require(_0x62da('0x6'));var Mustache=require(_0x62da('0x7'));var util=require('util');var path=require('path');var sox=require(_0x62da('0x8'));var csv=require(_0x62da('0x9'));var ejs=require(_0x62da('0xa'));var fs=require('fs');var fs_extra=require(_0x62da('0xb'));var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x62da('0x1a'));var db=require(_0x62da('0x1b'))['db'];function respondWithStatusCode(_0xd27693,_0x362eeb){_0x362eeb=_0x362eeb||0xcc;return function(_0x37ba2e){if(_0x37ba2e){return _0xd27693['sendStatus'](_0x362eeb);}return _0xd27693['status'](_0x362eeb)[_0x62da('0x1c')]();};}function respondWithResult(_0x27a000,_0x1bd7f9){_0x1bd7f9=_0x1bd7f9||0xc8;return function(_0x191ed5){if(_0x191ed5){return _0x27a000[_0x62da('0x1d')](_0x1bd7f9)[_0x62da('0x1e')](_0x191ed5);}};}function respondWithFilteredResult(_0x3c6498,_0x624a1c){return function(_0x2cbdf6){if(_0x2cbdf6){var _0xcc1a25=typeof _0x624a1c[_0x62da('0x1f')]===_0x62da('0x20')&&typeof _0x624a1c[_0x62da('0x21')]===_0x62da('0x20');var _0x4bdab9=_0x2cbdf6['count'];var _0xa7050b=_0xcc1a25?0x0:_0x624a1c['offset'];var _0x4d6482=_0xcc1a25?_0x2cbdf6[_0x62da('0x22')]:_0x624a1c[_0x62da('0x1f')]+_0x624a1c['limit'];var _0x29191b;if(_0x4d6482>=_0x4bdab9){_0x4d6482=_0x4bdab9;_0x29191b=0xc8;}else{_0x29191b=0xce;}_0x3c6498['status'](_0x29191b);return _0x3c6498[_0x62da('0x23')](_0x62da('0x24'),_0xa7050b+'-'+_0x4d6482+'/'+_0x4bdab9)[_0x62da('0x1e')](_0x2cbdf6);}return null;};}function patchUpdates(_0x2f7b01){return function(_0x3d015f){try{jsonpatch[_0x62da('0x25')](_0x3d015f,_0x2f7b01,!![]);}catch(_0x183033){return BPromise[_0x62da('0x26')](_0x183033);}return _0x3d015f[_0x62da('0x27')]();};}function saveUpdates(_0x583fc0,_0x13bf6d){return function(_0x866a76){if(_0x866a76){return _0x866a76[_0x62da('0x28')](_0x583fc0)[_0x62da('0x29')](function(_0x35f687){return _0x35f687;});}return null;};}function removeEntity(_0x54b936,_0x24298a){return function(_0x50ed6b){if(_0x50ed6b){return _0x50ed6b['destroy']()['then'](function(){_0x54b936[_0x62da('0x1d')](0xcc)[_0x62da('0x1c')]();});}};}function handleEntityNotFound(_0x14897c,_0x3f6fc9){return function(_0x4b1237){if(!_0x4b1237){_0x14897c[_0x62da('0x2a')](0x194);}return _0x4b1237;};}function handleError(_0x3b9c06,_0x5f0a9c){_0x5f0a9c=_0x5f0a9c||0x1f4;return function(_0x3ccf96){logger[_0x62da('0x2b')](_0x3ccf96[_0x62da('0x2c')]);if(_0x3ccf96['name']){delete _0x3ccf96[_0x62da('0x2d')];}_0x3b9c06[_0x62da('0x1d')](_0x5f0a9c)[_0x62da('0x2e')](_0x3ccf96);};}exports['index']=function(_0x4f5657,_0x3c6274){var _0x301e3d={},_0x220ffc={},_0x594c5a={'count':0x0,'rows':[]};var _0x45f67a=_[_0x62da('0x2f')](db[_0x62da('0x30')][_0x62da('0x31')],function(_0xd8cf3b){return{'name':_0xd8cf3b[_0x62da('0x32')],'type':_0xd8cf3b['type'][_0x62da('0x33')]};});_0x220ffc['model']=_[_0x62da('0x2f')](_0x45f67a,_0x62da('0x2d'));_0x220ffc[_0x62da('0x34')]=_[_0x62da('0x35')](_0x4f5657[_0x62da('0x34')]);_0x220ffc[_0x62da('0x36')]=_['intersection'](_0x220ffc[_0x62da('0x37')],_0x220ffc[_0x62da('0x34')]);_0x301e3d[_0x62da('0x38')]=_['intersection'](_0x220ffc[_0x62da('0x37')],qs[_0x62da('0x39')](_0x4f5657[_0x62da('0x34')]['fields']));_0x301e3d[_0x62da('0x38')]=_0x301e3d[_0x62da('0x38')]['length']?_0x301e3d[_0x62da('0x38')]:_0x220ffc[_0x62da('0x37')];if(!_0x4f5657['query'][_0x62da('0x3a')](_0x62da('0x3b'))){_0x301e3d[_0x62da('0x21')]=qs[_0x62da('0x21')](_0x4f5657[_0x62da('0x34')][_0x62da('0x21')]);_0x301e3d[_0x62da('0x1f')]=qs[_0x62da('0x1f')](_0x4f5657[_0x62da('0x34')][_0x62da('0x1f')]);}_0x301e3d[_0x62da('0x3c')]=qs[_0x62da('0x3d')](_0x4f5657[_0x62da('0x34')][_0x62da('0x3d')]);_0x301e3d[_0x62da('0x3e')]=qs[_0x62da('0x36')](_[_0x62da('0x3f')](_0x4f5657['query'],_0x220ffc[_0x62da('0x36')]),_0x45f67a);if(_0x4f5657['query'][_0x62da('0x40')]){_0x301e3d[_0x62da('0x3e')]=_[_0x62da('0x41')](_0x301e3d['where'],{'$or':_[_0x62da('0x2f')](_0x45f67a,function(_0xecf52d){if(_0xecf52d[_0x62da('0x42')]!==_0x62da('0x43')){var _0x5093c1={};_0x5093c1[_0xecf52d[_0x62da('0x2d')]]={'$like':'%'+_0x4f5657[_0x62da('0x34')][_0x62da('0x40')]+'%'};return _0x5093c1;}})});}_0x301e3d=_[_0x62da('0x41')]({},_0x301e3d,_0x4f5657[_0x62da('0x44')]);var _0x203815={'where':_0x301e3d[_0x62da('0x3e')]};return db[_0x62da('0x30')][_0x62da('0x22')](_0x203815)['then'](function(_0x29d2c2){_0x594c5a[_0x62da('0x22')]=_0x29d2c2;if(_0x4f5657['query'][_0x62da('0x45')]){_0x301e3d[_0x62da('0x46')]=[{'all':!![]}];}return db[_0x62da('0x30')][_0x62da('0x47')](_0x301e3d);})[_0x62da('0x29')](function(_0xde827d){_0x594c5a[_0x62da('0x48')]=_0xde827d;return _0x594c5a;})[_0x62da('0x29')](respondWithFilteredResult(_0x3c6274,_0x301e3d))['catch'](handleError(_0x3c6274,null));};exports['show']=function(_0x4bd1b8,_0x40d0af){var _0x54b49c={'raw':!![],'where':{'id':_0x4bd1b8['params']['id']}},_0x86f5a8={};_0x86f5a8['model']=_['keys'](db[_0x62da('0x30')][_0x62da('0x31')]);_0x86f5a8['query']=_[_0x62da('0x35')](_0x4bd1b8['query']);_0x86f5a8[_0x62da('0x36')]=_['intersection'](_0x86f5a8['model'],_0x86f5a8[_0x62da('0x34')]);_0x54b49c[_0x62da('0x38')]=_[_0x62da('0x49')](_0x86f5a8['model'],qs[_0x62da('0x39')](_0x4bd1b8[_0x62da('0x34')][_0x62da('0x39')]));_0x54b49c[_0x62da('0x38')]=_0x54b49c[_0x62da('0x38')]['length']?_0x54b49c['attributes']:_0x86f5a8[_0x62da('0x37')];if(_0x4bd1b8[_0x62da('0x34')][_0x62da('0x45')]){_0x54b49c[_0x62da('0x46')]=[{'all':!![]}];}_0x54b49c=_[_0x62da('0x41')]({},_0x54b49c,_0x4bd1b8['options']);return db['MailQueueReport'][_0x62da('0x4a')](_0x54b49c)[_0x62da('0x29')](handleEntityNotFound(_0x40d0af,null))['then'](respondWithResult(_0x40d0af,null))[_0x62da('0x4b')](handleError(_0x40d0af,null));};exports[_0x62da('0x4c')]=function(_0x454cc0,_0x29153f){return db[_0x62da('0x30')]['create'](_0x454cc0[_0x62da('0x4d')],{})[_0x62da('0x29')](respondWithResult(_0x29153f,0xc9))[_0x62da('0x4b')](handleError(_0x29153f,null));};exports[_0x62da('0x28')]=function(_0x4d3ec0,_0x1f2ab5){if(_0x4d3ec0[_0x62da('0x4d')]['id']){delete _0x4d3ec0[_0x62da('0x4d')]['id'];}return db[_0x62da('0x30')]['find']({'where':{'id':_0x4d3ec0[_0x62da('0x4e')]['id']}})[_0x62da('0x29')](handleEntityNotFound(_0x1f2ab5,null))['then'](saveUpdates(_0x4d3ec0['body'],null))['then'](respondWithResult(_0x1f2ab5,null))[_0x62da('0x4b')](handleError(_0x1f2ab5,null));};exports[_0x62da('0x4f')]=function(_0x33fbfc,_0x5cd1a9){return db[_0x62da('0x30')][_0x62da('0x4a')]({'where':{'id':_0x33fbfc[_0x62da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cd1a9,null))[_0x62da('0x29')](removeEntity(_0x5cd1a9,null))[_0x62da('0x4b')](handleError(_0x5cd1a9,null));};exports[_0x62da('0x50')]=function(_0x420697,_0x4bb439){return db[_0x62da('0x30')][_0x62da('0x50')]()[_0x62da('0x29')](respondWithResult(_0x4bb439,null))[_0x62da('0x4b')](handleError(_0x4bb439,null));}; \ No newline at end of file +var _0xfb11=['create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','params','find','catch'];(function(_0x1ec827,_0x423478){var _0x1930b9=function(_0x216b5c){while(--_0x216b5c){_0x1ec827['push'](_0x1ec827['shift']());}};_0x1930b9(++_0x423478);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xfb11[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1353a4,_0x3680b5){return function(_0x2de1d4){if(!_0x2de1d4){_0x1353a4['sendStatus'](0x194);}return _0x2de1d4;};}function handleError(_0x1b25b3,_0x1aac7d){_0x1aac7d=_0x1aac7d||0x1f4;return function(_0x46ff60){logger[_0x1fb1('0x25')](_0x46ff60[_0x1fb1('0x26')]);if(_0x46ff60[_0x1fb1('0x27')]){delete _0x46ff60[_0x1fb1('0x27')];}_0x1b25b3[_0x1fb1('0x18')](_0x1aac7d)[_0x1fb1('0x28')](_0x46ff60);};}exports[_0x1fb1('0x29')]=function(_0x5e99e7,_0x497017){var _0x39fc43={},_0xe8ec0a={},_0x2f6c88={'count':0x0,'rows':[]};var _0x520ee2=_[_0x1fb1('0x2a')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')],function(_0x1b71cb){return{'name':_0x1b71cb['fieldName'],'type':_0x1b71cb[_0x1fb1('0x2d')][_0x1fb1('0x2e')]};});_0xe8ec0a['model']=_[_0x1fb1('0x2a')](_0x520ee2,'name');_0xe8ec0a['query']=_[_0x1fb1('0x2f')](_0x5e99e7[_0x1fb1('0x30')]);_0xe8ec0a['filters']=_[_0x1fb1('0x31')](_0xe8ec0a[_0x1fb1('0x32')],_0xe8ec0a[_0x1fb1('0x30')]);_0x39fc43[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0xe8ec0a['model'],qs[_0x1fb1('0x34')](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x39fc43[_0x1fb1('0x33')]=_0x39fc43[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x39fc43[_0x1fb1('0x33')]:_0xe8ec0a[_0x1fb1('0x32')];if(!_0x5e99e7[_0x1fb1('0x30')]['hasOwnProperty'](_0x1fb1('0x36'))){_0x39fc43['limit']=qs[_0x1fb1('0x1d')](_0x5e99e7['query'][_0x1fb1('0x1d')]);_0x39fc43['offset']=qs['offset'](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x1b')]);}_0x39fc43[_0x1fb1('0x37')]=qs[_0x1fb1('0x38')](_0x5e99e7['query'][_0x1fb1('0x38')]);_0x39fc43[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_['pick'](_0x5e99e7[_0x1fb1('0x30')],_0xe8ec0a[_0x1fb1('0x3a')]),_0x520ee2);if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]){_0x39fc43[_0x1fb1('0x39')]=_[_0x1fb1('0x3c')](_0x39fc43[_0x1fb1('0x39')],{'$or':_['map'](_0x520ee2,function(_0x3a8a63){if(_0x3a8a63[_0x1fb1('0x2d')]!=='VIRTUAL'){var _0x473894={};_0x473894[_0x3a8a63['name']]={'$like':'%'+_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]+'%'};return _0x473894;}})});}_0x39fc43=_[_0x1fb1('0x3c')]({},_0x39fc43,_0x5e99e7[_0x1fb1('0x3d')]);var _0x1a0b32={'where':_0x39fc43[_0x1fb1('0x39')]};return db[_0x1fb1('0x2b')][_0x1fb1('0x1e')](_0x1a0b32)[_0x1fb1('0x23')](function(_0x2c023e){_0x2f6c88[_0x1fb1('0x1e')]=_0x2c023e;if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x39fc43[_0x1fb1('0x3f')]=[{'all':!![]}];}return db[_0x1fb1('0x2b')]['findAll'](_0x39fc43);})[_0x1fb1('0x23')](function(_0xca1fd3){_0x2f6c88[_0x1fb1('0x40')]=_0xca1fd3;return _0x2f6c88;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x497017,_0x39fc43))['catch'](handleError(_0x497017,null));};exports['show']=function(_0xf6f17d,_0xef42e0){var _0x307faf={'raw':!![],'where':{'id':_0xf6f17d[_0x1fb1('0x41')]['id']}},_0x3edc8a={};_0x3edc8a[_0x1fb1('0x32')]=_[_0x1fb1('0x2f')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')]);_0x3edc8a[_0x1fb1('0x30')]=_['keys'](_0xf6f17d[_0x1fb1('0x30')]);_0x3edc8a['filters']=_['intersection'](_0x3edc8a[_0x1fb1('0x32')],_0x3edc8a[_0x1fb1('0x30')]);_0x307faf[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0x3edc8a['model'],qs['fields'](_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x307faf[_0x1fb1('0x33')]=_0x307faf[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x307faf[_0x1fb1('0x33')]:_0x3edc8a[_0x1fb1('0x32')];if(_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x307faf['include']=[{'all':!![]}];}_0x307faf=_['merge']({},_0x307faf,_0xf6f17d[_0x1fb1('0x3d')]);return db['MailQueueReport'][_0x1fb1('0x42')](_0x307faf)[_0x1fb1('0x23')](handleEntityNotFound(_0xef42e0,null))[_0x1fb1('0x23')](respondWithResult(_0xef42e0,null))[_0x1fb1('0x43')](handleError(_0xef42e0,null));};exports[_0x1fb1('0x44')]=function(_0x3c3fbf,_0x5af135){return db[_0x1fb1('0x2b')][_0x1fb1('0x44')](_0x3c3fbf[_0x1fb1('0x45')],{})['then'](respondWithResult(_0x5af135,0xc9))[_0x1fb1('0x43')](handleError(_0x5af135,null));};exports['update']=function(_0x6e105b,_0xba4fa7){if(_0x6e105b[_0x1fb1('0x45')]['id']){delete _0x6e105b['body']['id'];}return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x6e105b['params']['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xba4fa7,null))[_0x1fb1('0x23')](saveUpdates(_0x6e105b[_0x1fb1('0x45')],null))['then'](respondWithResult(_0xba4fa7,null))['catch'](handleError(_0xba4fa7,null));};exports['destroy']=function(_0x31a85a,_0x2365b5){return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x31a85a[_0x1fb1('0x41')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0x2365b5,null))['then'](removeEntity(_0x2365b5,null))['catch'](handleError(_0x2365b5,null));};exports[_0x1fb1('0x46')]=function(_0x2a6898,_0x2d03d2){return db[_0x1fb1('0x2b')]['describe']()['then'](respondWithResult(_0x2d03d2,null))[_0x1fb1('0x43')](handleError(_0x2d03d2,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 949dc72..8275fc5 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 _0x9cd1=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid'];(function(_0x56989c,_0x6781f0){var _0x22ab27=function(_0x390034){while(--_0x390034){_0x56989c['push'](_0x56989c['shift']());}};_0x22ab27(++_0x6781f0);}(_0x9cd1,0xdd));var _0x19cd=function(_0x4c5ce1,_0x417075){_0x4c5ce1=_0x4c5ce1-0x0;var _0x1e2e63=_0x9cd1[_0x4c5ce1];return _0x1e2e63;};'use strict';var _=require(_0x19cd('0x0'));var util=require(_0x19cd('0x1'));var logger=require(_0x19cd('0x2'))(_0x19cd('0x3'));var moment=require(_0x19cd('0x4'));var BPromise=require('bluebird');var rp=require(_0x19cd('0x5'));var fs=require('fs');var path=require(_0x19cd('0x6'));var rimraf=require(_0x19cd('0x7'));var config=require(_0x19cd('0x8'));var attributes=require(_0x19cd('0x9'));module[_0x19cd('0xa')]=function(_0x19da88,_0x54182a){return _0x19da88['define'](_0x19cd('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x19cd('0xc'),'fields':[_0x19cd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc881=['api','moment','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x557d99,_0x38e8a1){var _0x4e5b46=function(_0x187eb3){while(--_0x187eb3){_0x557d99['push'](_0x557d99['shift']());}};_0x4e5b46(++_0x38e8a1);}(_0xc881,0xda));var _0x1c88=function(_0x180890,_0x4bc2cd){_0x180890=_0x180890-0x0;var _0x4f4d0f=_0xc881[_0x180890];return _0x4f4d0f;};'use strict';var _=require(_0x1c88('0x0'));var util=require(_0x1c88('0x1'));var logger=require(_0x1c88('0x2'))(_0x1c88('0x3'));var moment=require(_0x1c88('0x4'));var BPromise=require(_0x1c88('0x5'));var rp=require(_0x1c88('0x6'));var fs=require('fs');var path=require(_0x1c88('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c88('0x8'));module[_0x1c88('0x9')]=function(_0x4910ea,_0x2e5ec3){return _0x4910ea[_0x1c88('0xa')](_0x1c88('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1c88('0xc'),'fields':[_0x1c88('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 64a8006..23cdb90 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x39cdb8,_0x15ee98){var _0x44bbc9=function(_0x395338){while(--_0x395338){_0x39cdb8['push'](_0x39cdb8['shift']());}};_0x44bbc9(++_0x15ee98);}(_0x2ef3,0xba));var _0x32ef=function(_0x40c0dd,_0x2ff87f){_0x40c0dd=_0x40c0dd-0x0;var _0x89dcc3=_0x2ef3[_0x40c0dd];return _0x89dcc3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +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(_0x4649bb,_0x5599de){var _0x58764a=function(_0x5b93f1){while(--_0x5b93f1){_0x4649bb['push'](_0x4649bb['shift']());}};_0x58764a(++_0x5599de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'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 9a0c194..338d9bc 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x303862,_0x20b5ab){var _0xe6f228=function(_0x41fc5a){while(--_0x41fc5a){_0x303862['push'](_0x303862['shift']());}};_0xe6f228(++_0x20b5ab);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x138164,_0x2fedaa){var _0x3fbe5e=function(_0x15a8d1){while(--_0x15a8d1){_0x138164['push'](_0x138164['shift']());}};_0x3fbe5e(++_0x2fedaa);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0d90d59..f303b2c 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 _0x68b6=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x39212a,_0x5e810b){var _0x3eb03b=function(_0x14f42e){while(--_0x14f42e){_0x39212a['push'](_0x39212a['shift']());}};_0x3eb03b(++_0x5e810b);}(_0x68b6,0x1cf));var _0x668b=function(_0x592800,_0x1bb7f8){_0x592800=_0x592800-0x0;var _0x3690f9=_0x68b6[_0x592800];return _0x3690f9;};'use strict';var Sequelize=require('sequelize');module[_0x668b('0x0')]={'description':{'type':Sequelize[_0x668b('0x1')]},'host':{'type':Sequelize[_0x668b('0x1')]},'authentication':{'type':Sequelize[_0x668b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x668b('0x1')]},'password':{'type':Sequelize[_0x668b('0x1')]},'port':{'type':Sequelize[_0x668b('0x3')]},'tls':{'type':Sequelize[_0x668b('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x668b('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x668b('0x1')]},'modernAuthentication':{'type':Sequelize[_0x668b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x620b=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x34682f,_0x3c113a){var _0x341f14=function(_0xbf0c52){while(--_0xbf0c52){_0x34682f['push'](_0x34682f['shift']());}};_0x341f14(++_0x3c113a);}(_0x620b,0x167));var _0xb620=function(_0x4b98ab,_0x88d198){_0x4b98ab=_0x4b98ab-0x0;var _0x5adb05=_0x620b[_0x4b98ab];return _0x5adb05;};'use strict';var Sequelize=require(_0xb620('0x0'));module[_0xb620('0x1')]={'description':{'type':Sequelize[_0xb620('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb620('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb620('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb620('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb620('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8714c09..15283f7 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 _0xaa4d=['moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xaa4d,0x11a));var _0xdaa4=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0xaa4d[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0xdaa4('0x0'));var util=require(_0xdaa4('0x1'));var logger=require(_0xdaa4('0x2'))(_0xdaa4('0x3'));var moment=require(_0xdaa4('0x4'));var BPromise=require('bluebird');var rp=require(_0xdaa4('0x5'));var fs=require('fs');var path=require(_0xdaa4('0x6'));var rimraf=require(_0xdaa4('0x7'));var config=require(_0xdaa4('0x8'));var attributes=require(_0xdaa4('0x9'));module[_0xdaa4('0xa')]=function(_0x3c7ceb,_0xc3f795){return _0x3c7ceb[_0xdaa4('0xb')]('MailServerIn',attributes,{'tableName':_0xdaa4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3f8=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x33820d,_0x1f71ea){var _0x586222=function(_0x54b0cb){while(--_0x54b0cb){_0x33820d['push'](_0x33820d['shift']());}};_0x586222(++_0x1f71ea);}(_0xe3f8,0x125));var _0x8e3f=function(_0x28b2d8,_0x5b9f27){_0x28b2d8=_0x28b2d8-0x0;var _0x301bf6=_0xe3f8[_0x28b2d8];return _0x301bf6;};'use strict';var _=require(_0x8e3f('0x0'));var util=require(_0x8e3f('0x1'));var logger=require(_0x8e3f('0x2'))(_0x8e3f('0x3'));var moment=require('moment');var BPromise=require(_0x8e3f('0x4'));var rp=require(_0x8e3f('0x5'));var fs=require('fs');var path=require(_0x8e3f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e3f('0x7'));module[_0x8e3f('0x8')]=function(_0x506fa0,_0x3a227d){return _0x506fa0[_0x8e3f('0x9')](_0x8e3f('0xa'),attributes,{'tableName':_0x8e3f('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 a51df9d..d07bb95 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 _0x0db9=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','findAll','options','where','attributes','limit','include','model','map','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x0db9,0xa3));var _0x90db=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x0db9[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476491,_0xee21f8,_0x915ca){return new BPromise(function(_0x9b6d0d,_0x4b0c1d){return client[_0x90db('0x8')](_0x476491,_0x915ca)[_0x90db('0x9')](function(_0x39512e){logger[_0x90db('0xa')](_0x90db('0xb'),_0xee21f8,_0x90db('0xc'));logger[_0x90db('0xd')](_0x90db('0xe'),_0xee21f8,_0x90db('0xc'),JSON[_0x90db('0xf')](_0x39512e));if(_0x39512e[_0x90db('0x10')]){if(_0x39512e['error'][_0x90db('0x11')]===0x1f4){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x4b0c1d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x9b6d0d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}else{logger[_0x90db('0xa')]('MailServerIn,\x20%s,\x20%s',_0xee21f8,_0x90db('0xc'));_0x9b6d0d(_0x39512e['result'][_0x90db('0x12')]);}})[_0x90db('0x13')](function(_0x3de860){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x3de860);_0x4b0c1d(_0x3de860);});});}exports[_0x90db('0x14')]=function(_0x15e33e){var _0x43f40b=this;return new Promise(function(_0x24a16a,_0x171a4a){return db['MailServerIn'][_0x90db('0x15')]({'raw':_0x15e33e[_0x90db('0x16')]?_0x15e33e['options']['raw']===undefined?!![]:![]:!![],'where':_0x15e33e[_0x90db('0x16')]?_0x15e33e[_0x90db('0x16')][_0x90db('0x17')]||null:null,'attributes':_0x15e33e[_0x90db('0x16')]?_0x15e33e[_0x90db('0x16')][_0x90db('0x18')]||null:null,'limit':_0x15e33e[_0x90db('0x16')]?_0x15e33e['options'][_0x90db('0x19')]||null:null,'include':_0x15e33e[_0x90db('0x16')]?_0x15e33e[_0x90db('0x16')][_0x90db('0x1a')]?_['map'](_0x15e33e[_0x90db('0x16')]['include'],function(_0x459068){return{'model':db[_0x459068[_0x90db('0x1b')]],'as':_0x459068['as'],'attributes':_0x459068['attributes'],'include':_0x459068[_0x90db('0x1a')]?_[_0x90db('0x1c')](_0x459068['include'],function(_0x2f8469){return{'model':db[_0x2f8469[_0x90db('0x1b')]],'as':_0x2f8469['as'],'attributes':_0x2f8469['attributes'],'include':_0x2f8469[_0x90db('0x1a')]?_[_0x90db('0x1c')](_0x2f8469[_0x90db('0x1a')],function(_0x94cd84){return{'model':db[_0x94cd84['model']],'as':_0x94cd84['as'],'attributes':_0x94cd84[_0x90db('0x18')]};}):[]};}):[]};}):[]:[]})[_0x90db('0x9')](function(_0x60439d){logger[_0x90db('0xa')](_0x90db('0x14'),_0x15e33e);logger[_0x90db('0xd')](_0x90db('0x14'),_0x15e33e,JSON[_0x90db('0xf')](_0x60439d));_0x24a16a(_0x60439d);})['catch'](function(_0x3489d1){logger['error'](_0x90db('0x14'),_0x3489d1[_0x90db('0x12')],_0x15e33e);_0x171a4a(_0x43f40b['error'](0x1f4,_0x3489d1[_0x90db('0x12')]));});});}; \ No newline at end of file +var _0x7914=['../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35c730,_0x131382){var _0x39c12f=function(_0x2f0f45){while(--_0x2f0f45){_0x35c730['push'](_0x35c730['shift']());}};_0x39c12f(++_0x131382);}(_0x7914,0x107));var _0x4791=function(_0x5da7a8,_0x1652a7){_0x5da7a8=_0x5da7a8-0x0;var _0x2185d9=_0x7914[_0x5da7a8];return _0x2185d9;};'use strict';var _=require(_0x4791('0x0'));var util=require(_0x4791('0x1'));var moment=require('moment');var BPromise=require(_0x4791('0x2'));var rs=require(_0x4791('0x3'));var fs=require('fs');var Redis=require(_0x4791('0x4'));var db=require(_0x4791('0x5'))['db'];var utils=require(_0x4791('0x6'));var logger=require(_0x4791('0x7'))(_0x4791('0x8'));var config=require(_0x4791('0x9'));var jayson=require(_0x4791('0xa'));var client=jayson[_0x4791('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306863,_0x559fc1,_0x1dc98f){return new BPromise(function(_0x22163f,_0xa154fc){return client[_0x4791('0xc')](_0x306863,_0x1dc98f)[_0x4791('0xd')](function(_0x153de4){logger[_0x4791('0xe')](_0x4791('0xf'),_0x559fc1,'request\x20sent');logger[_0x4791('0x10')](_0x4791('0x11'),_0x559fc1,_0x4791('0x12'),JSON[_0x4791('0x13')](_0x153de4));if(_0x153de4[_0x4791('0x14')]){if(_0x153de4[_0x4791('0x14')]['code']===0x1f4){logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4['error'][_0x4791('0x15')]);return _0xa154fc(_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);}logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);return _0x22163f(_0x153de4['error'][_0x4791('0x15')]);}else{logger[_0x4791('0xe')]('MailServerIn,\x20%s,\x20%s',_0x559fc1,_0x4791('0x12'));_0x22163f(_0x153de4[_0x4791('0x16')][_0x4791('0x15')]);}})[_0x4791('0x17')](function(_0xab1f15){logger['error']('MailServerIn,\x20%s,\x20%s',_0x559fc1,_0xab1f15);_0xa154fc(_0xab1f15);});});}exports[_0x4791('0x18')]=function(_0x41d373){var _0xce74a5=this;return new Promise(function(_0x322244,_0x333258){return db['MailServerIn'][_0x4791('0x19')]({'raw':_0x41d373['options']?_0x41d373['options'][_0x4791('0x1a')]===undefined?!![]:![]:!![],'where':_0x41d373[_0x4791('0x1b')]?_0x41d373[_0x4791('0x1b')][_0x4791('0x1c')]||null:null,'attributes':_0x41d373[_0x4791('0x1b')]?_0x41d373['options'][_0x4791('0x1d')]||null:null,'limit':_0x41d373['options']?_0x41d373[_0x4791('0x1b')][_0x4791('0x1e')]||null:null,'include':_0x41d373['options']?_0x41d373[_0x4791('0x1b')][_0x4791('0x1f')]?_[_0x4791('0x20')](_0x41d373[_0x4791('0x1b')]['include'],function(_0x281178){return{'model':db[_0x281178[_0x4791('0x21')]],'as':_0x281178['as'],'attributes':_0x281178[_0x4791('0x1d')],'include':_0x281178['include']?_[_0x4791('0x20')](_0x281178[_0x4791('0x1f')],function(_0x5d1c0c){return{'model':db[_0x5d1c0c[_0x4791('0x21')]],'as':_0x5d1c0c['as'],'attributes':_0x5d1c0c[_0x4791('0x1d')],'include':_0x5d1c0c[_0x4791('0x1f')]?_[_0x4791('0x20')](_0x5d1c0c[_0x4791('0x1f')],function(_0xcbfd8e){return{'model':db[_0xcbfd8e[_0x4791('0x21')]],'as':_0xcbfd8e['as'],'attributes':_0xcbfd8e[_0x4791('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4791('0xd')](function(_0x307f10){logger[_0x4791('0xe')](_0x4791('0x18'),_0x41d373);logger[_0x4791('0x10')]('GetMailServerIn',_0x41d373,JSON[_0x4791('0x13')](_0x307f10));_0x322244(_0x307f10);})[_0x4791('0x17')](function(_0x21dfc0){logger[_0x4791('0x14')](_0x4791('0x18'),_0x21dfc0[_0x4791('0x15')],_0x41d373);_0x333258(_0xce74a5['error'](0x1f4,_0x21dfc0[_0x4791('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b386a23..b41c21e 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(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 96247bd..cec422c 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 _0x1d2d=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0xb03df8,_0x5b0886){var _0x4eda6d=function(_0x46cd10){while(--_0x46cd10){_0xb03df8['push'](_0xb03df8['shift']());}};_0x4eda6d(++_0x5b0886);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x400a23,_0x127c54){_0x400a23=_0x400a23-0x0;var _0x14d8e6=_0x1d2d[_0x400a23];return _0x14d8e6;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'description':{'type':Sequelize[_0xd1d2('0x2')]},'host':{'type':Sequelize[_0xd1d2('0x2')]},'user':{'type':Sequelize[_0xd1d2('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd1d2('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xd1d2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xd1d2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xa571=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x7ba70c,_0x20b624){var _0x1bd1dd=function(_0x5c26f2){while(--_0x5c26f2){_0x7ba70c['push'](_0x7ba70c['shift']());}};_0x1bd1dd(++_0x20b624);}(_0xa571,0x107));var _0x1a57=function(_0x1df5d4,_0x139bac){_0x1df5d4=_0x1df5d4-0x0;var _0x817aa5=_0xa571[_0x1df5d4];return _0x817aa5;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'description':{'type':Sequelize[_0x1a57('0x2')]},'host':{'type':Sequelize[_0x1a57('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1a57('0x2')]},'port':{'type':Sequelize[_0x1a57('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1a57('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index de13694..e05b911 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 _0x0de8=['count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','MailServerOut','fieldName','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x5de136,_0x5eb2d8){var _0x200f6e=function(_0x38d94a){while(--_0x38d94a){_0x5de136['push'](_0x5de136['shift']());}};_0x200f6e(++_0x5eb2d8);}(_0x0de8,0x76));var _0x80de=function(_0x409251,_0x40f525){_0x409251=_0x409251-0x0;var _0x216f47=_0x0de8[_0x409251];return _0x216f47;};'use strict';var emlformat=require(_0x80de('0x0'));var rimraf=require(_0x80de('0x1'));var zipdir=require(_0x80de('0x2'));var jsonpatch=require(_0x80de('0x3'));var rp=require(_0x80de('0x4'));var moment=require('moment');var BPromise=require(_0x80de('0x5'));var Mustache=require(_0x80de('0x6'));var util=require(_0x80de('0x7'));var path=require('path');var sox=require(_0x80de('0x8'));var csv=require('to-csv');var ejs=require(_0x80de('0x9'));var fs=require('fs');var fs_extra=require(_0x80de('0xa'));var _=require('lodash');var squel=require(_0x80de('0xb'));var crypto=require(_0x80de('0xc'));var jsforce=require(_0x80de('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x80de('0xe'));var querystring=require(_0x80de('0xf'));var Papa=require(_0x80de('0x10'));var Redis=require('ioredis');var authService=require(_0x80de('0x11'));var qs=require(_0x80de('0x12'));var as=require(_0x80de('0x13'));var hardwareService=require(_0x80de('0x14'));var logger=require(_0x80de('0x15'))(_0x80de('0x16'));var utils=require(_0x80de('0x17'));var config=require(_0x80de('0x18'));var licenseUtil=require(_0x80de('0x19'));var db=require(_0x80de('0x1a'))['db'];function respondWithStatusCode(_0x5554f3,_0x5e706a){_0x5e706a=_0x5e706a||0xcc;return function(_0x13c7d7){if(_0x13c7d7){return _0x5554f3[_0x80de('0x1b')](_0x5e706a);}return _0x5554f3[_0x80de('0x1c')](_0x5e706a)[_0x80de('0x1d')]();};}function respondWithResult(_0x29d913,_0x574401){_0x574401=_0x574401||0xc8;return function(_0x270c29){if(_0x270c29){return _0x29d913['status'](_0x574401)[_0x80de('0x1e')](_0x270c29);}};}function respondWithFilteredResult(_0x438b82,_0x25a507){return function(_0x20c34e){if(_0x20c34e){var _0x36b692=typeof _0x25a507[_0x80de('0x1f')]===_0x80de('0x20')&&typeof _0x25a507[_0x80de('0x21')]==='undefined';var _0x5e9c50=_0x20c34e['count'];var _0xe92748=_0x36b692?0x0:_0x25a507[_0x80de('0x1f')];var _0x32a06a=_0x36b692?_0x20c34e[_0x80de('0x22')]:_0x25a507['offset']+_0x25a507[_0x80de('0x21')];var _0x568e89;if(_0x32a06a>=_0x5e9c50){_0x32a06a=_0x5e9c50;_0x568e89=0xc8;}else{_0x568e89=0xce;}_0x438b82[_0x80de('0x1c')](_0x568e89);return _0x438b82[_0x80de('0x23')](_0x80de('0x24'),_0xe92748+'-'+_0x32a06a+'/'+_0x5e9c50)['json'](_0x20c34e);}return null;};}function patchUpdates(_0x2c16f8){return function(_0x26ee64){try{jsonpatch[_0x80de('0x25')](_0x26ee64,_0x2c16f8,!![]);}catch(_0x21a6a6){return BPromise[_0x80de('0x26')](_0x21a6a6);}return _0x26ee64['save']();};}function saveUpdates(_0x3fb56a,_0x57ce1f){return function(_0x3d92b0){if(_0x3d92b0){return _0x3d92b0[_0x80de('0x27')](_0x3fb56a)[_0x80de('0x28')](function(_0x2f3d98){return _0x2f3d98;});}return null;};}function removeEntity(_0x16a469,_0x1c817d){return function(_0x1cf9ae){if(_0x1cf9ae){return _0x1cf9ae[_0x80de('0x29')]()[_0x80de('0x28')](function(){_0x16a469[_0x80de('0x1c')](0xcc)[_0x80de('0x1d')]();});}};}function handleEntityNotFound(_0x324079,_0x305e92){return function(_0x52e6f1){if(!_0x52e6f1){_0x324079[_0x80de('0x1b')](0x194);}return _0x52e6f1;};}function handleError(_0xad44c1,_0x4468ec){_0x4468ec=_0x4468ec||0x1f4;return function(_0x5d882c){logger[_0x80de('0x2a')](_0x5d882c[_0x80de('0x2b')]);if(_0x5d882c[_0x80de('0x2c')]){delete _0x5d882c[_0x80de('0x2c')];}_0xad44c1[_0x80de('0x1c')](_0x4468ec)['send'](_0x5d882c);};}exports[_0x80de('0x2d')]=function(_0x2b1a94,_0x55c174){var _0x46c6d2={},_0x87c0e0={},_0xbd1bb3={'count':0x0,'rows':[]};var _0x19de01=_[_0x80de('0x2e')](db[_0x80de('0x2f')]['rawAttributes'],function(_0x117569){return{'name':_0x117569[_0x80de('0x30')],'type':_0x117569['type']['key']};});_0x87c0e0[_0x80de('0x31')]=_['map'](_0x19de01,_0x80de('0x2c'));_0x87c0e0[_0x80de('0x32')]=_['keys'](_0x2b1a94[_0x80de('0x32')]);_0x87c0e0[_0x80de('0x33')]=_['intersection'](_0x87c0e0['model'],_0x87c0e0[_0x80de('0x32')]);_0x46c6d2['attributes']=_[_0x80de('0x34')](_0x87c0e0[_0x80de('0x31')],qs[_0x80de('0x35')](_0x2b1a94['query'][_0x80de('0x35')]));_0x46c6d2[_0x80de('0x36')]=_0x46c6d2['attributes']['length']?_0x46c6d2[_0x80de('0x36')]:_0x87c0e0[_0x80de('0x31')];if(!_0x2b1a94[_0x80de('0x32')]['hasOwnProperty'](_0x80de('0x37'))){_0x46c6d2[_0x80de('0x21')]=qs['limit'](_0x2b1a94[_0x80de('0x32')][_0x80de('0x21')]);_0x46c6d2['offset']=qs['offset'](_0x2b1a94[_0x80de('0x32')][_0x80de('0x1f')]);}_0x46c6d2[_0x80de('0x38')]=qs[_0x80de('0x39')](_0x2b1a94[_0x80de('0x32')][_0x80de('0x39')]);_0x46c6d2[_0x80de('0x3a')]=qs['filters'](_['pick'](_0x2b1a94[_0x80de('0x32')],_0x87c0e0[_0x80de('0x33')]),_0x19de01);if(_0x2b1a94[_0x80de('0x32')][_0x80de('0x3b')]){_0x46c6d2['where']=_[_0x80de('0x3c')](_0x46c6d2[_0x80de('0x3a')],{'$or':_[_0x80de('0x2e')](_0x19de01,function(_0x54e26b){if(_0x54e26b[_0x80de('0x3d')]!==_0x80de('0x3e')){var _0x119d12={};_0x119d12[_0x54e26b['name']]={'$like':'%'+_0x2b1a94[_0x80de('0x32')][_0x80de('0x3b')]+'%'};return _0x119d12;}})});}_0x46c6d2=_[_0x80de('0x3c')]({},_0x46c6d2,_0x2b1a94[_0x80de('0x3f')]);var _0x3b7fcf={'where':_0x46c6d2[_0x80de('0x3a')]};return db[_0x80de('0x2f')][_0x80de('0x22')](_0x3b7fcf)[_0x80de('0x28')](function(_0x58a602){_0xbd1bb3[_0x80de('0x22')]=_0x58a602;if(_0x2b1a94[_0x80de('0x32')][_0x80de('0x40')]){_0x46c6d2[_0x80de('0x41')]=[{'all':!![]}];}return db[_0x80de('0x2f')][_0x80de('0x42')](_0x46c6d2);})[_0x80de('0x28')](function(_0x5af72a){_0xbd1bb3[_0x80de('0x43')]=_0x5af72a;return _0xbd1bb3;})['then'](respondWithFilteredResult(_0x55c174,_0x46c6d2))['catch'](handleError(_0x55c174,null));};exports[_0x80de('0x44')]=function(_0x131107,_0x43e942){var _0x1d0547={'raw':!![],'where':{'id':_0x131107[_0x80de('0x45')]['id']}},_0x5dcfb3={};_0x5dcfb3[_0x80de('0x31')]=_['keys'](db[_0x80de('0x2f')]['rawAttributes']);_0x5dcfb3['query']=_[_0x80de('0x46')](_0x131107['query']);_0x5dcfb3[_0x80de('0x33')]=_[_0x80de('0x34')](_0x5dcfb3['model'],_0x5dcfb3[_0x80de('0x32')]);_0x1d0547[_0x80de('0x36')]=_[_0x80de('0x34')](_0x5dcfb3['model'],qs[_0x80de('0x35')](_0x131107['query'][_0x80de('0x35')]));_0x1d0547['attributes']=_0x1d0547['attributes'][_0x80de('0x47')]?_0x1d0547[_0x80de('0x36')]:_0x5dcfb3[_0x80de('0x31')];if(_0x131107[_0x80de('0x32')]['includeAll']){_0x1d0547[_0x80de('0x41')]=[{'all':!![]}];}_0x1d0547=_['merge']({},_0x1d0547,_0x131107[_0x80de('0x3f')]);return db[_0x80de('0x2f')][_0x80de('0x48')](_0x1d0547)[_0x80de('0x28')](handleEntityNotFound(_0x43e942,null))[_0x80de('0x28')](respondWithResult(_0x43e942,null))[_0x80de('0x49')](handleError(_0x43e942,null));};exports[_0x80de('0x4a')]=function(_0x2e09df,_0x38998b){return db[_0x80de('0x2f')][_0x80de('0x4a')](_0x2e09df[_0x80de('0x4b')],{})[_0x80de('0x28')](respondWithResult(_0x38998b,0xc9))[_0x80de('0x49')](handleError(_0x38998b,null));};exports[_0x80de('0x27')]=function(_0x93e30a,_0x5837da){if(_0x93e30a['body']['id']){delete _0x93e30a[_0x80de('0x4b')]['id'];}return db['MailServerOut'][_0x80de('0x48')]({'where':{'id':_0x93e30a[_0x80de('0x45')]['id']}})[_0x80de('0x28')](handleEntityNotFound(_0x5837da,null))[_0x80de('0x28')](saveUpdates(_0x93e30a[_0x80de('0x4b')],null))[_0x80de('0x28')](respondWithResult(_0x5837da,null))[_0x80de('0x49')](handleError(_0x5837da,null));};exports['destroy']=function(_0x3f1ce4,_0x459aed){return db[_0x80de('0x2f')][_0x80de('0x48')]({'where':{'id':_0x3f1ce4[_0x80de('0x45')]['id']}})['then'](handleEntityNotFound(_0x459aed,null))[_0x80de('0x28')](removeEntity(_0x459aed,null))[_0x80de('0x49')](handleError(_0x459aed,null));}; \ No newline at end of file +var _0xfa44=['include','catch','show','params','rawAttributes','fields','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','MailServerOut','includeAll'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xfa44,0x9e));var _0x4fa4=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0xfa44[_0x151334];return _0x3d03da;};'use strict';var emlformat=require(_0x4fa4('0x0'));var rimraf=require(_0x4fa4('0x1'));var zipdir=require(_0x4fa4('0x2'));var jsonpatch=require(_0x4fa4('0x3'));var rp=require(_0x4fa4('0x4'));var moment=require(_0x4fa4('0x5'));var BPromise=require(_0x4fa4('0x6'));var Mustache=require('mustache');var util=require(_0x4fa4('0x7'));var path=require(_0x4fa4('0x8'));var sox=require(_0x4fa4('0x9'));var csv=require(_0x4fa4('0xa'));var ejs=require(_0x4fa4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fa4('0xc'));var squel=require(_0x4fa4('0xd'));var crypto=require('crypto');var jsforce=require(_0x4fa4('0xe'));var deskjs=require(_0x4fa4('0xf'));var toCsv=require(_0x4fa4('0xa'));var querystring=require(_0x4fa4('0x10'));var Papa=require(_0x4fa4('0x11'));var Redis=require('ioredis');var authService=require(_0x4fa4('0x12'));var qs=require(_0x4fa4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fa4('0x14'));var logger=require('../../config/logger')(_0x4fa4('0x15'));var utils=require(_0x4fa4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4fa4('0x17'));var db=require(_0x4fa4('0x18'))['db'];function respondWithStatusCode(_0x5f75bb,_0x584a8f){_0x584a8f=_0x584a8f||0xcc;return function(_0x3815b3){if(_0x3815b3){return _0x5f75bb[_0x4fa4('0x19')](_0x584a8f);}return _0x5f75bb['status'](_0x584a8f)[_0x4fa4('0x1a')]();};}function respondWithResult(_0xfd2094,_0x2cb019){_0x2cb019=_0x2cb019||0xc8;return function(_0x3a4ed7){if(_0x3a4ed7){return _0xfd2094['status'](_0x2cb019)[_0x4fa4('0x1b')](_0x3a4ed7);}};}function respondWithFilteredResult(_0x3ab256,_0x5895ac){return function(_0x10bd39){if(_0x10bd39){var _0x1c2589=typeof _0x5895ac[_0x4fa4('0x1c')]===_0x4fa4('0x1d')&&typeof _0x5895ac['limit']===_0x4fa4('0x1d');var _0x41039c=_0x10bd39[_0x4fa4('0x1e')];var _0x1bc63d=_0x1c2589?0x0:_0x5895ac['offset'];var _0x3affa5=_0x1c2589?_0x10bd39['count']:_0x5895ac[_0x4fa4('0x1c')]+_0x5895ac['limit'];var _0x5d570d;if(_0x3affa5>=_0x41039c){_0x3affa5=_0x41039c;_0x5d570d=0xc8;}else{_0x5d570d=0xce;}_0x3ab256[_0x4fa4('0x1f')](_0x5d570d);return _0x3ab256[_0x4fa4('0x20')](_0x4fa4('0x21'),_0x1bc63d+'-'+_0x3affa5+'/'+_0x41039c)[_0x4fa4('0x1b')](_0x10bd39);}return null;};}function patchUpdates(_0x2db334){return function(_0x1d1620){try{jsonpatch[_0x4fa4('0x22')](_0x1d1620,_0x2db334,!![]);}catch(_0x1e8be6){return BPromise['reject'](_0x1e8be6);}return _0x1d1620['save']();};}function saveUpdates(_0x264403,_0x20e81e){return function(_0xc9a9b6){if(_0xc9a9b6){return _0xc9a9b6[_0x4fa4('0x23')](_0x264403)['then'](function(_0x2e12bc){return _0x2e12bc;});}return null;};}function removeEntity(_0x32621f,_0x8d925b){return function(_0x3a76cf){if(_0x3a76cf){return _0x3a76cf[_0x4fa4('0x24')]()[_0x4fa4('0x25')](function(){_0x32621f[_0x4fa4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc1f7c,_0xb0b1b3){return function(_0x5199b0){if(!_0x5199b0){_0xdc1f7c['sendStatus'](0x194);}return _0x5199b0;};}function handleError(_0x16f9ea,_0x2d7a7a){_0x2d7a7a=_0x2d7a7a||0x1f4;return function(_0x15bf76){logger['error'](_0x15bf76[_0x4fa4('0x26')]);if(_0x15bf76[_0x4fa4('0x27')]){delete _0x15bf76[_0x4fa4('0x27')];}_0x16f9ea[_0x4fa4('0x1f')](_0x2d7a7a)[_0x4fa4('0x28')](_0x15bf76);};}exports[_0x4fa4('0x29')]=function(_0x347b7f,_0x4f2577){var _0x8f1a20={},_0x2d4eaa={},_0x269eb3={'count':0x0,'rows':[]};var _0x2e5756=_[_0x4fa4('0x2a')](db['MailServerOut']['rawAttributes'],function(_0x41e202){return{'name':_0x41e202[_0x4fa4('0x2b')],'type':_0x41e202['type'][_0x4fa4('0x2c')]};});_0x2d4eaa[_0x4fa4('0x2d')]=_[_0x4fa4('0x2a')](_0x2e5756,_0x4fa4('0x27'));_0x2d4eaa[_0x4fa4('0x2e')]=_[_0x4fa4('0x2f')](_0x347b7f[_0x4fa4('0x2e')]);_0x2d4eaa[_0x4fa4('0x30')]=_[_0x4fa4('0x31')](_0x2d4eaa[_0x4fa4('0x2d')],_0x2d4eaa[_0x4fa4('0x2e')]);_0x8f1a20[_0x4fa4('0x32')]=_[_0x4fa4('0x31')](_0x2d4eaa[_0x4fa4('0x2d')],qs['fields'](_0x347b7f[_0x4fa4('0x2e')]['fields']));_0x8f1a20[_0x4fa4('0x32')]=_0x8f1a20[_0x4fa4('0x32')]['length']?_0x8f1a20[_0x4fa4('0x32')]:_0x2d4eaa[_0x4fa4('0x2d')];if(!_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x33')](_0x4fa4('0x34'))){_0x8f1a20[_0x4fa4('0x35')]=qs[_0x4fa4('0x35')](_0x347b7f['query'][_0x4fa4('0x35')]);_0x8f1a20[_0x4fa4('0x1c')]=qs[_0x4fa4('0x1c')](_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x1c')]);}_0x8f1a20[_0x4fa4('0x36')]=qs['sort'](_0x347b7f['query'][_0x4fa4('0x37')]);_0x8f1a20[_0x4fa4('0x38')]=qs['filters'](_['pick'](_0x347b7f[_0x4fa4('0x2e')],_0x2d4eaa[_0x4fa4('0x30')]),_0x2e5756);if(_0x347b7f['query'][_0x4fa4('0x39')]){_0x8f1a20['where']=_[_0x4fa4('0x3a')](_0x8f1a20[_0x4fa4('0x38')],{'$or':_['map'](_0x2e5756,function(_0x73fc68){if(_0x73fc68[_0x4fa4('0x3b')]!==_0x4fa4('0x3c')){var _0x3ef501={};_0x3ef501[_0x73fc68[_0x4fa4('0x27')]]={'$like':'%'+_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x39')]+'%'};return _0x3ef501;}})});}_0x8f1a20=_[_0x4fa4('0x3a')]({},_0x8f1a20,_0x347b7f[_0x4fa4('0x3d')]);var _0x476f73={'where':_0x8f1a20[_0x4fa4('0x38')]};return db[_0x4fa4('0x3e')][_0x4fa4('0x1e')](_0x476f73)['then'](function(_0x205ac1){_0x269eb3[_0x4fa4('0x1e')]=_0x205ac1;if(_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x3f')]){_0x8f1a20[_0x4fa4('0x40')]=[{'all':!![]}];}return db[_0x4fa4('0x3e')]['findAll'](_0x8f1a20);})[_0x4fa4('0x25')](function(_0x400d72){_0x269eb3['rows']=_0x400d72;return _0x269eb3;})['then'](respondWithFilteredResult(_0x4f2577,_0x8f1a20))[_0x4fa4('0x41')](handleError(_0x4f2577,null));};exports[_0x4fa4('0x42')]=function(_0x1697a9,_0x19c27d){var _0x5d4d46={'raw':!![],'where':{'id':_0x1697a9[_0x4fa4('0x43')]['id']}},_0x542a46={};_0x542a46[_0x4fa4('0x2d')]=_[_0x4fa4('0x2f')](db['MailServerOut'][_0x4fa4('0x44')]);_0x542a46[_0x4fa4('0x2e')]=_[_0x4fa4('0x2f')](_0x1697a9['query']);_0x542a46['filters']=_[_0x4fa4('0x31')](_0x542a46['model'],_0x542a46[_0x4fa4('0x2e')]);_0x5d4d46[_0x4fa4('0x32')]=_[_0x4fa4('0x31')](_0x542a46[_0x4fa4('0x2d')],qs[_0x4fa4('0x45')](_0x1697a9[_0x4fa4('0x2e')][_0x4fa4('0x45')]));_0x5d4d46['attributes']=_0x5d4d46['attributes'][_0x4fa4('0x46')]?_0x5d4d46[_0x4fa4('0x32')]:_0x542a46['model'];if(_0x1697a9[_0x4fa4('0x2e')][_0x4fa4('0x3f')]){_0x5d4d46[_0x4fa4('0x40')]=[{'all':!![]}];}_0x5d4d46=_[_0x4fa4('0x3a')]({},_0x5d4d46,_0x1697a9[_0x4fa4('0x3d')]);return db['MailServerOut'][_0x4fa4('0x47')](_0x5d4d46)[_0x4fa4('0x25')](handleEntityNotFound(_0x19c27d,null))[_0x4fa4('0x25')](respondWithResult(_0x19c27d,null))[_0x4fa4('0x41')](handleError(_0x19c27d,null));};exports['create']=function(_0x507ecf,_0x143f22){return db[_0x4fa4('0x3e')][_0x4fa4('0x48')](_0x507ecf['body'],{})[_0x4fa4('0x25')](respondWithResult(_0x143f22,0xc9))[_0x4fa4('0x41')](handleError(_0x143f22,null));};exports['update']=function(_0x53998b,_0x55bcc4){if(_0x53998b['body']['id']){delete _0x53998b[_0x4fa4('0x49')]['id'];}return db[_0x4fa4('0x3e')]['find']({'where':{'id':_0x53998b[_0x4fa4('0x43')]['id']}})[_0x4fa4('0x25')](handleEntityNotFound(_0x55bcc4,null))['then'](saveUpdates(_0x53998b[_0x4fa4('0x49')],null))[_0x4fa4('0x25')](respondWithResult(_0x55bcc4,null))[_0x4fa4('0x41')](handleError(_0x55bcc4,null));};exports[_0x4fa4('0x24')]=function(_0xe1fed6,_0x5becb0){return db[_0x4fa4('0x3e')]['find']({'where':{'id':_0xe1fed6[_0x4fa4('0x43')]['id']}})[_0x4fa4('0x25')](handleEntityNotFound(_0x5becb0,null))[_0x4fa4('0x25')](removeEntity(_0x5becb0,null))[_0x4fa4('0x41')](handleError(_0x5becb0,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 89a4bb3..8c4039a 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 _0xa5fc=['bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','moment'];(function(_0xe5f032,_0x3dff07){var _0x2eba1d=function(_0x1b9695){while(--_0x1b9695){_0xe5f032['push'](_0xe5f032['shift']());}};_0x2eba1d(++_0x3dff07);}(_0xa5fc,0x98));var _0xca5f=function(_0x530767,_0x2c2909){_0x530767=_0x530767-0x0;var _0x1da8c6=_0xa5fc[_0x530767];return _0x1da8c6;};'use strict';var _=require(_0xca5f('0x0'));var util=require(_0xca5f('0x1'));var logger=require(_0xca5f('0x2'))('api');var moment=require(_0xca5f('0x3'));var BPromise=require(_0xca5f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca5f('0x5'));var rimraf=require(_0xca5f('0x6'));var config=require(_0xca5f('0x7'));var attributes=require(_0xca5f('0x8'));module[_0xca5f('0x9')]=function(_0x58a4a3,_0x390195){return _0x58a4a3[_0xca5f('0xa')](_0xca5f('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4c2=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x598cd0,_0x157d6f){var _0x2370e7=function(_0x3216c2){while(--_0x3216c2){_0x598cd0['push'](_0x598cd0['shift']());}};_0x2370e7(++_0x157d6f);}(_0xa4c2,0x117));var _0x2a4c=function(_0x45f6ca,_0x431195){_0x45f6ca=_0x45f6ca-0x0;var _0x56dc03=_0xa4c2[_0x45f6ca];return _0x56dc03;};'use strict';var _=require(_0x2a4c('0x0'));var util=require(_0x2a4c('0x1'));var logger=require(_0x2a4c('0x2'))(_0x2a4c('0x3'));var moment=require(_0x2a4c('0x4'));var BPromise=require(_0x2a4c('0x5'));var rp=require(_0x2a4c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4c('0x7'));var config=require(_0x2a4c('0x8'));var attributes=require(_0x2a4c('0x9'));module[_0x2a4c('0xa')]=function(_0x567790,_0x294251){return _0x567790[_0x2a4c('0xb')]('MailServerOut',attributes,{'tableName':_0x2a4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 54ce436..094d53f 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2700b3,_0x2e6aca){var _0x2e4974=function(_0x195c8f){while(--_0x195c8f){_0x2700b3['push'](_0x2700b3['shift']());}};_0x2e4974(++_0x2e6aca);}(_0xdb28,0x106));var _0x8db2=function(_0x23a4fc,_0xd325c){_0x23a4fc=_0x23a4fc-0x0;var _0x56e36e=_0xdb28[_0x23a4fc];return _0x56e36e;};'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')]('MailServerOut,\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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x307713,_0x1eb964){var _0x3588cf=function(_0x37fa2a){while(--_0x37fa2a){_0x307713['push'](_0x307713['shift']());}};_0x3588cf(++_0x1eb964);}(_0xdb28,0x106));var _0x8db2=function(_0x174a64,_0x4674f4){_0x174a64=_0x174a64-0x0;var _0x862f7e=_0xdb28[_0x174a64];return _0x862f7e;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 475e1e9..0c4caa6 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 _0x5726=['../../config/environment','index','/describe','describe','get','/:id','post','put','update','delete','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f9bb8,_0x1b0060){var _0x6f8be2=function(_0x105f35){while(--_0x105f35){_0x4f9bb8['push'](_0x4f9bb8['shift']());}};_0x6f8be2(++_0x1b0060);}(_0x5726,0x15b));var _0x6572=function(_0x2c1460,_0x55505e){_0x2c1460=_0x2c1460-0x0;var _0x70c146=_0x5726[_0x2c1460];return _0x70c146;};'use strict';var multer=require(_0x6572('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6572('0x1'));var router=express[_0x6572('0x2')]();var fs_extra=require(_0x6572('0x3'));var auth=require(_0x6572('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6572('0x5'));var controller=require('./mailSubstatus.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6572('0x6')]);router['get'](_0x6572('0x7'),auth['isAuthenticated'](),controller[_0x6572('0x8')]);router[_0x6572('0x9')](_0x6572('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6572('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6572('0xc')](_0x6572('0xa'),auth['isAuthenticated'](),controller[_0x6572('0xd')]);router[_0x6572('0xe')](_0x6572('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6572('0xf')]=router; \ No newline at end of file +var _0x629d=['./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37ec49,_0x38f646){var _0x5ac426=function(_0x3aafc9){while(--_0x3aafc9){_0x37ec49['push'](_0x37ec49['shift']());}};_0x5ac426(++_0x38f646);}(_0x629d,0x1bf));var _0xd629=function(_0xf0330b,_0x814253){_0xf0330b=_0xf0330b-0x0;var _0x538518=_0x629d[_0xf0330b];return _0x538518;};'use strict';var multer=require(_0xd629('0x0'));var util=require(_0xd629('0x1'));var path=require(_0xd629('0x2'));var timeout=require(_0xd629('0x3'));var express=require(_0xd629('0x4'));var router=express[_0xd629('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd629('0x6'));var interaction=require(_0xd629('0x7'));var config=require(_0xd629('0x8'));var controller=require(_0xd629('0x9'));router[_0xd629('0xa')]('/',auth[_0xd629('0xb')](),controller[_0xd629('0xc')]);router[_0xd629('0xa')]('/describe',auth[_0xd629('0xb')](),controller['describe']);router[_0xd629('0xa')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller[_0xd629('0xe')]);router['post']('/',auth[_0xd629('0xb')](),controller['create']);router[_0xd629('0xf')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller[_0xd629('0x10')]);router[_0xd629('0x11')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller['destroy']);module[_0xd629('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 55f24e6..c519c02 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 _0x0295=['sequelize','name'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x0295,0x1f0));var _0x5029=function(_0x2edb9f,_0x36fad0){_0x2edb9f=_0x2edb9f-0x0;var _0x4e5979=_0x0295[_0x2edb9f];return _0x4e5979;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5029('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbd10=['STRING','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbd10,0x85));var _0x0bd1=function(_0x433adf,_0x3b863e){_0x433adf=_0x433adf-0x0;var _0x4a35e4=_0xbd10[_0x433adf];return _0x4a35e4;};'use strict';var Sequelize=require(_0x0bd1('0x0'));module[_0x0bd1('0x1')]={'name':{'type':Sequelize[_0x0bd1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0bd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 319b800..25b8dd9 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 _0x3446=['update','body','params','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','rows','catch','show','includeAll','include','find','create'];(function(_0x44be54,_0x1ba877){var _0x4a7da9=function(_0xb3df0d){while(--_0xb3df0d){_0x44be54['push'](_0x44be54['shift']());}};_0x4a7da9(++_0x1ba877);}(_0x3446,0xef));var _0x6344=function(_0xdfc9f5,_0x688d10){_0xdfc9f5=_0xdfc9f5-0x0;var _0x39c49b=_0x3446[_0xdfc9f5];return _0x39c49b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6344('0x0'));var zipdir=require(_0x6344('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6344('0x2'));var moment=require(_0x6344('0x3'));var BPromise=require(_0x6344('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6344('0x5'));var sox=require(_0x6344('0x6'));var csv=require(_0x6344('0x7'));var ejs=require(_0x6344('0x8'));var fs=require('fs');var fs_extra=require(_0x6344('0x9'));var _=require(_0x6344('0xa'));var squel=require(_0x6344('0xb'));var crypto=require(_0x6344('0xc'));var jsforce=require(_0x6344('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6344('0xe'));var Papa=require(_0x6344('0xf'));var Redis=require(_0x6344('0x10'));var authService=require(_0x6344('0x11'));var qs=require(_0x6344('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6344('0x13'));var logger=require(_0x6344('0x14'))(_0x6344('0x15'));var utils=require(_0x6344('0x16'));var config=require(_0x6344('0x17'));var licenseUtil=require(_0x6344('0x18'));var db=require(_0x6344('0x19'))['db'];function respondWithStatusCode(_0x1d02b2,_0x4e00ff){_0x4e00ff=_0x4e00ff||0xcc;return function(_0x278314){if(_0x278314){return _0x1d02b2[_0x6344('0x1a')](_0x4e00ff);}return _0x1d02b2['status'](_0x4e00ff)[_0x6344('0x1b')]();};}function respondWithResult(_0x26cef7,_0x45c4b0){_0x45c4b0=_0x45c4b0||0xc8;return function(_0x34b987){if(_0x34b987){return _0x26cef7[_0x6344('0x1c')](_0x45c4b0)['json'](_0x34b987);}};}function respondWithFilteredResult(_0x2ae330,_0x2ae0c4){return function(_0x4359fd){if(_0x4359fd){var _0x3f2ede=typeof _0x2ae0c4[_0x6344('0x1d')]==='undefined'&&typeof _0x2ae0c4[_0x6344('0x1e')]===_0x6344('0x1f');var _0x2b5aae=_0x4359fd[_0x6344('0x20')];var _0x254d06=_0x3f2ede?0x0:_0x2ae0c4['offset'];var _0x75e3a5=_0x3f2ede?_0x4359fd['count']:_0x2ae0c4[_0x6344('0x1d')]+_0x2ae0c4[_0x6344('0x1e')];var _0x6fcfd4;if(_0x75e3a5>=_0x2b5aae){_0x75e3a5=_0x2b5aae;_0x6fcfd4=0xc8;}else{_0x6fcfd4=0xce;}_0x2ae330[_0x6344('0x1c')](_0x6fcfd4);return _0x2ae330['set'](_0x6344('0x21'),_0x254d06+'-'+_0x75e3a5+'/'+_0x2b5aae)[_0x6344('0x22')](_0x4359fd);}return null;};}function patchUpdates(_0x73c8be){return function(_0x5fd134){try{jsonpatch[_0x6344('0x23')](_0x5fd134,_0x73c8be,!![]);}catch(_0x380f17){return BPromise[_0x6344('0x24')](_0x380f17);}return _0x5fd134[_0x6344('0x25')]();};}function saveUpdates(_0x352f43,_0x324558){return function(_0x143fbd){if(_0x143fbd){return _0x143fbd['update'](_0x352f43)[_0x6344('0x26')](function(_0x560a36){return _0x560a36;});}return null;};}function removeEntity(_0x33e198,_0x196ee3){return function(_0x2513aa){if(_0x2513aa){return _0x2513aa['destroy']()[_0x6344('0x26')](function(){_0x33e198[_0x6344('0x1c')](0xcc)[_0x6344('0x1b')]();});}};}function handleEntityNotFound(_0x3e3ee0,_0x1749e0){return function(_0x332f15){if(!_0x332f15){_0x3e3ee0[_0x6344('0x1a')](0x194);}return _0x332f15;};}function handleError(_0x371a88,_0x79e6db){_0x79e6db=_0x79e6db||0x1f4;return function(_0x38f7f5){logger[_0x6344('0x27')](_0x38f7f5[_0x6344('0x28')]);if(_0x38f7f5[_0x6344('0x29')]){delete _0x38f7f5[_0x6344('0x29')];}_0x371a88[_0x6344('0x1c')](_0x79e6db)[_0x6344('0x2a')](_0x38f7f5);};}exports['index']=function(_0x52fad5,_0x30c1f1){var _0x37f7c2={},_0x5c2384={},_0x3d8aea={'count':0x0,'rows':[]};var _0x6395c3=_[_0x6344('0x2b')](db[_0x6344('0x2c')][_0x6344('0x2d')],function(_0x1d21af){return{'name':_0x1d21af[_0x6344('0x2e')],'type':_0x1d21af[_0x6344('0x2f')][_0x6344('0x30')]};});_0x5c2384[_0x6344('0x31')]=_['map'](_0x6395c3,'name');_0x5c2384[_0x6344('0x32')]=_[_0x6344('0x33')](_0x52fad5[_0x6344('0x32')]);_0x5c2384[_0x6344('0x34')]=_[_0x6344('0x35')](_0x5c2384['model'],_0x5c2384[_0x6344('0x32')]);_0x37f7c2[_0x6344('0x36')]=_['intersection'](_0x5c2384[_0x6344('0x31')],qs[_0x6344('0x37')](_0x52fad5[_0x6344('0x32')][_0x6344('0x37')]));_0x37f7c2['attributes']=_0x37f7c2[_0x6344('0x36')][_0x6344('0x38')]?_0x37f7c2[_0x6344('0x36')]:_0x5c2384['model'];if(!_0x52fad5['query'][_0x6344('0x39')]('nolimit')){_0x37f7c2['limit']=qs['limit'](_0x52fad5[_0x6344('0x32')][_0x6344('0x1e')]);_0x37f7c2[_0x6344('0x1d')]=qs[_0x6344('0x1d')](_0x52fad5[_0x6344('0x32')][_0x6344('0x1d')]);}_0x37f7c2[_0x6344('0x3a')]=qs[_0x6344('0x3b')](_0x52fad5[_0x6344('0x32')][_0x6344('0x3b')]);_0x37f7c2[_0x6344('0x3c')]=qs[_0x6344('0x34')](_[_0x6344('0x3d')](_0x52fad5[_0x6344('0x32')],_0x5c2384[_0x6344('0x34')]),_0x6395c3);if(_0x52fad5['query']['filter']){_0x37f7c2[_0x6344('0x3c')]=_['merge'](_0x37f7c2[_0x6344('0x3c')],{'$or':_[_0x6344('0x2b')](_0x6395c3,function(_0xd9a96d){if(_0xd9a96d[_0x6344('0x2f')]!==_0x6344('0x3e')){var _0x49eeb4={};_0x49eeb4[_0xd9a96d['name']]={'$like':'%'+_0x52fad5[_0x6344('0x32')][_0x6344('0x3f')]+'%'};return _0x49eeb4;}})});}_0x37f7c2=_[_0x6344('0x40')]({},_0x37f7c2,_0x52fad5[_0x6344('0x41')]);var _0x109994={'where':_0x37f7c2['where']};return db[_0x6344('0x2c')][_0x6344('0x20')](_0x109994)[_0x6344('0x26')](function(_0x42bbb6){_0x3d8aea[_0x6344('0x20')]=_0x42bbb6;if(_0x52fad5[_0x6344('0x32')]['includeAll']){_0x37f7c2['include']=[{'all':!![]}];}return db[_0x6344('0x2c')]['findAll'](_0x37f7c2);})[_0x6344('0x26')](function(_0x5b5166){_0x3d8aea[_0x6344('0x42')]=_0x5b5166;return _0x3d8aea;})[_0x6344('0x26')](respondWithFilteredResult(_0x30c1f1,_0x37f7c2))[_0x6344('0x43')](handleError(_0x30c1f1,null));};exports[_0x6344('0x44')]=function(_0x1a76d8,_0x2a2eb0){var _0xb90dcc={'raw':!![],'where':{'id':_0x1a76d8['params']['id']}},_0x5a9359={};_0x5a9359[_0x6344('0x31')]=_[_0x6344('0x33')](db[_0x6344('0x2c')][_0x6344('0x2d')]);_0x5a9359['query']=_[_0x6344('0x33')](_0x1a76d8['query']);_0x5a9359['filters']=_['intersection'](_0x5a9359[_0x6344('0x31')],_0x5a9359[_0x6344('0x32')]);_0xb90dcc[_0x6344('0x36')]=_[_0x6344('0x35')](_0x5a9359['model'],qs[_0x6344('0x37')](_0x1a76d8['query'][_0x6344('0x37')]));_0xb90dcc[_0x6344('0x36')]=_0xb90dcc['attributes'][_0x6344('0x38')]?_0xb90dcc[_0x6344('0x36')]:_0x5a9359[_0x6344('0x31')];if(_0x1a76d8[_0x6344('0x32')][_0x6344('0x45')]){_0xb90dcc[_0x6344('0x46')]=[{'all':!![]}];}_0xb90dcc=_[_0x6344('0x40')]({},_0xb90dcc,_0x1a76d8['options']);return db['MailSubstatus'][_0x6344('0x47')](_0xb90dcc)[_0x6344('0x26')](handleEntityNotFound(_0x2a2eb0,null))[_0x6344('0x26')](respondWithResult(_0x2a2eb0,null))['catch'](handleError(_0x2a2eb0,null));};exports[_0x6344('0x48')]=function(_0x221e14,_0x1b7eab){return db[_0x6344('0x2c')]['create'](_0x221e14['body'],{})[_0x6344('0x26')](respondWithResult(_0x1b7eab,0xc9))[_0x6344('0x43')](handleError(_0x1b7eab,null));};exports[_0x6344('0x49')]=function(_0x1f2b60,_0x85d135){if(_0x1f2b60[_0x6344('0x4a')]['id']){delete _0x1f2b60[_0x6344('0x4a')]['id'];}return db[_0x6344('0x2c')]['find']({'where':{'id':_0x1f2b60[_0x6344('0x4b')]['id']}})['then'](handleEntityNotFound(_0x85d135,null))['then'](saveUpdates(_0x1f2b60[_0x6344('0x4a')],null))[_0x6344('0x26')](respondWithResult(_0x85d135,null))['catch'](handleError(_0x85d135,null));};exports[_0x6344('0x4c')]=function(_0x5ee901,_0x4c5be5){return db[_0x6344('0x2c')]['find']({'where':{'id':_0x5ee901[_0x6344('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c5be5,null))[_0x6344('0x26')](removeEntity(_0x4c5be5,null))[_0x6344('0x43')](handleError(_0x4c5be5,null));};exports[_0x6344('0x4d')]=function(_0x1e8553,_0x45dc2b){return db[_0x6344('0x2c')][_0x6344('0x4d')]()[_0x6344('0x26')](respondWithResult(_0x45dc2b,null))[_0x6344('0x43')](handleError(_0x45dc2b,null));}; \ No newline at end of file +var _0xd69e=['filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','Content-Range','save','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1a2581,_0x44dab6){var _0x21ef3e=function(_0x26839e){while(--_0x26839e){_0x1a2581['push'](_0x1a2581['shift']());}};_0x21ef3e(++_0x44dab6);}(_0xd69e,0x13d));var _0xed69=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd69e[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require(_0xed69('0x3'));var rp=require('request-promise');var moment=require(_0xed69('0x4'));var BPromise=require(_0xed69('0x5'));var Mustache=require(_0xed69('0x6'));var util=require('util');var path=require(_0xed69('0x7'));var sox=require(_0xed69('0x8'));var csv=require(_0xed69('0x9'));var ejs=require(_0xed69('0xa'));var fs=require('fs');var fs_extra=require(_0xed69('0xb'));var _=require(_0xed69('0xc'));var squel=require(_0xed69('0xd'));var crypto=require(_0xed69('0xe'));var jsforce=require(_0xed69('0xf'));var deskjs=require(_0xed69('0x10'));var toCsv=require(_0xed69('0x9'));var querystring=require(_0xed69('0x11'));var Papa=require('papaparse');var Redis=require(_0xed69('0x12'));var authService=require(_0xed69('0x13'));var qs=require(_0xed69('0x14'));var as=require(_0xed69('0x15'));var hardwareService=require(_0xed69('0x16'));var logger=require(_0xed69('0x17'))(_0xed69('0x18'));var utils=require(_0xed69('0x19'));var config=require(_0xed69('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f696,_0x364a0e){_0x364a0e=_0x364a0e||0xcc;return function(_0x12d53f){if(_0x12d53f){return _0x34f696[_0xed69('0x1b')](_0x364a0e);}return _0x34f696[_0xed69('0x1c')](_0x364a0e)['end']();};}function respondWithResult(_0x1c7b09,_0x20b3d8){_0x20b3d8=_0x20b3d8||0xc8;return function(_0x46dfd0){if(_0x46dfd0){return _0x1c7b09[_0xed69('0x1c')](_0x20b3d8)['json'](_0x46dfd0);}};}function respondWithFilteredResult(_0x4e52a2,_0x3b92a4){return function(_0x25fafd){if(_0x25fafd){var _0x581784=typeof _0x3b92a4[_0xed69('0x1d')]===_0xed69('0x1e')&&typeof _0x3b92a4['limit']===_0xed69('0x1e');var _0x2eeb8e=_0x25fafd[_0xed69('0x1f')];var _0x158d73=_0x581784?0x0:_0x3b92a4[_0xed69('0x1d')];var _0x1f5f20=_0x581784?_0x25fafd[_0xed69('0x1f')]:_0x3b92a4[_0xed69('0x1d')]+_0x3b92a4[_0xed69('0x20')];var _0xf1d430;if(_0x1f5f20>=_0x2eeb8e){_0x1f5f20=_0x2eeb8e;_0xf1d430=0xc8;}else{_0xf1d430=0xce;}_0x4e52a2[_0xed69('0x1c')](_0xf1d430);return _0x4e52a2['set'](_0xed69('0x21'),_0x158d73+'-'+_0x1f5f20+'/'+_0x2eeb8e)['json'](_0x25fafd);}return null;};}function patchUpdates(_0x5f20cd){return function(_0x3d550a){try{jsonpatch['apply'](_0x3d550a,_0x5f20cd,!![]);}catch(_0x14fdbe){return BPromise['reject'](_0x14fdbe);}return _0x3d550a[_0xed69('0x22')]();};}function saveUpdates(_0x5ba942,_0x432e88){return function(_0x540b9d){if(_0x540b9d){return _0x540b9d['update'](_0x5ba942)['then'](function(_0x405bdf){return _0x405bdf;});}return null;};}function removeEntity(_0x5ad0b0,_0x179535){return function(_0x5f0f00){if(_0x5f0f00){return _0x5f0f00['destroy']()['then'](function(){_0x5ad0b0['status'](0xcc)[_0xed69('0x23')]();});}};}function handleEntityNotFound(_0x1b68a7,_0x175ebe){return function(_0x402b71){if(!_0x402b71){_0x1b68a7['sendStatus'](0x194);}return _0x402b71;};}function handleError(_0xcb69f6,_0x50bad2){_0x50bad2=_0x50bad2||0x1f4;return function(_0x360e64){logger[_0xed69('0x24')](_0x360e64[_0xed69('0x25')]);if(_0x360e64['name']){delete _0x360e64[_0xed69('0x26')];}_0xcb69f6[_0xed69('0x1c')](_0x50bad2)[_0xed69('0x27')](_0x360e64);};}exports[_0xed69('0x28')]=function(_0x135705,_0x2c372b){var _0x54a6cf={},_0x1242b9={},_0xdc03be={'count':0x0,'rows':[]};var _0x2e058d=_[_0xed69('0x29')](db[_0xed69('0x2a')][_0xed69('0x2b')],function(_0x2d78d9){return{'name':_0x2d78d9['fieldName'],'type':_0x2d78d9['type'][_0xed69('0x2c')]};});_0x1242b9[_0xed69('0x2d')]=_[_0xed69('0x29')](_0x2e058d,_0xed69('0x26'));_0x1242b9[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x135705['query']);_0x1242b9[_0xed69('0x30')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],_0x1242b9[_0xed69('0x2e')]);_0x54a6cf[_0xed69('0x32')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],qs[_0xed69('0x33')](_0x135705[_0xed69('0x2e')]['fields']));_0x54a6cf['attributes']=_0x54a6cf[_0xed69('0x32')]['length']?_0x54a6cf[_0xed69('0x32')]:_0x1242b9[_0xed69('0x2d')];if(!_0x135705['query'][_0xed69('0x34')](_0xed69('0x35'))){_0x54a6cf['limit']=qs[_0xed69('0x20')](_0x135705[_0xed69('0x2e')]['limit']);_0x54a6cf[_0xed69('0x1d')]=qs[_0xed69('0x1d')](_0x135705['query'][_0xed69('0x1d')]);}_0x54a6cf[_0xed69('0x36')]=qs[_0xed69('0x37')](_0x135705[_0xed69('0x2e')]['sort']);_0x54a6cf[_0xed69('0x38')]=qs[_0xed69('0x30')](_[_0xed69('0x39')](_0x135705['query'],_0x1242b9[_0xed69('0x30')]),_0x2e058d);if(_0x135705[_0xed69('0x2e')][_0xed69('0x3a')]){_0x54a6cf[_0xed69('0x38')]=_['merge'](_0x54a6cf[_0xed69('0x38')],{'$or':_['map'](_0x2e058d,function(_0x58bfa7){if(_0x58bfa7['type']!==_0xed69('0x3b')){var _0x49f94d={};_0x49f94d[_0x58bfa7[_0xed69('0x26')]]={'$like':'%'+_0x135705[_0xed69('0x2e')]['filter']+'%'};return _0x49f94d;}})});}_0x54a6cf=_[_0xed69('0x3c')]({},_0x54a6cf,_0x135705['options']);var _0x559aa8={'where':_0x54a6cf[_0xed69('0x38')]};return db[_0xed69('0x2a')][_0xed69('0x1f')](_0x559aa8)[_0xed69('0x3d')](function(_0x2c7bbb){_0xdc03be[_0xed69('0x1f')]=_0x2c7bbb;if(_0x135705[_0xed69('0x2e')][_0xed69('0x3e')]){_0x54a6cf[_0xed69('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0xed69('0x40')](_0x54a6cf);})[_0xed69('0x3d')](function(_0xb4a1f4){_0xdc03be[_0xed69('0x41')]=_0xb4a1f4;return _0xdc03be;})['then'](respondWithFilteredResult(_0x2c372b,_0x54a6cf))['catch'](handleError(_0x2c372b,null));};exports[_0xed69('0x42')]=function(_0x2bb831,_0x406540){var _0x2154ae={'raw':!![],'where':{'id':_0x2bb831[_0xed69('0x43')]['id']}},_0x3674fc={};_0x3674fc[_0xed69('0x2d')]=_[_0xed69('0x2f')](db[_0xed69('0x2a')]['rawAttributes']);_0x3674fc['query']=_[_0xed69('0x2f')](_0x2bb831[_0xed69('0x2e')]);_0x3674fc[_0xed69('0x30')]=_['intersection'](_0x3674fc['model'],_0x3674fc[_0xed69('0x2e')]);_0x2154ae[_0xed69('0x32')]=_[_0xed69('0x31')](_0x3674fc['model'],qs[_0xed69('0x33')](_0x2bb831[_0xed69('0x2e')][_0xed69('0x33')]));_0x2154ae['attributes']=_0x2154ae[_0xed69('0x32')]['length']?_0x2154ae[_0xed69('0x32')]:_0x3674fc[_0xed69('0x2d')];if(_0x2bb831[_0xed69('0x2e')][_0xed69('0x3e')]){_0x2154ae[_0xed69('0x3f')]=[{'all':!![]}];}_0x2154ae=_['merge']({},_0x2154ae,_0x2bb831[_0xed69('0x44')]);return db[_0xed69('0x2a')]['find'](_0x2154ae)[_0xed69('0x3d')](handleEntityNotFound(_0x406540,null))['then'](respondWithResult(_0x406540,null))[_0xed69('0x45')](handleError(_0x406540,null));};exports[_0xed69('0x46')]=function(_0x1e3a24,_0x127f67){return db[_0xed69('0x2a')][_0xed69('0x46')](_0x1e3a24[_0xed69('0x47')],{})[_0xed69('0x3d')](respondWithResult(_0x127f67,0xc9))[_0xed69('0x45')](handleError(_0x127f67,null));};exports['update']=function(_0x214d96,_0x3e9166){if(_0x214d96[_0xed69('0x47')]['id']){delete _0x214d96[_0xed69('0x47')]['id'];}return db['MailSubstatus'][_0xed69('0x48')]({'where':{'id':_0x214d96[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x3e9166,null))[_0xed69('0x3d')](saveUpdates(_0x214d96['body'],null))[_0xed69('0x3d')](respondWithResult(_0x3e9166,null))[_0xed69('0x45')](handleError(_0x3e9166,null));};exports[_0xed69('0x49')]=function(_0x5cb032,_0x1dbebd){return db['MailSubstatus'][_0xed69('0x48')]({'where':{'id':_0x5cb032[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x1dbebd,null))['then'](removeEntity(_0x1dbebd,null))['catch'](handleError(_0x1dbebd,null));};exports[_0xed69('0x4a')]=function(_0x32ae71,_0x3772fd){return db[_0xed69('0x2a')][_0xed69('0x4a')]()[_0xed69('0x3d')](respondWithResult(_0x3772fd,null))[_0xed69('0x45')](handleError(_0x3772fd,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index eeebd7e..1ad72fd 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 _0xd41f=['../../mysqldb','MailSubstatus','setMaxListeners','hasOwnProperty','hook'];(function(_0x5d9eaa,_0x167a02){var _0x15db37=function(_0x1d0f6a){while(--_0x1d0f6a){_0x5d9eaa['push'](_0x5d9eaa['shift']());}};_0x15db37(++_0x167a02);}(_0xd41f,0x172));var _0xfd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xfd41('0x0'))['db'][_0xfd41('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xfd41('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x34ff7b){return function(_0x8ab80a,_0x5f2563,_0x59a28d){MailSubstatusEvents['emit'](_0x34ff7b+':'+_0x8ab80a['id'],_0x8ab80a);MailSubstatusEvents['emit'](_0x34ff7b,_0x8ab80a);_0x59a28d(null);};}for(var e in events){if(events[_0xfd41('0x3')](e)){var event=events[e];MailSubstatus[_0xfd41('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x38cd=['setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x5cebc3,_0x3f0d41){var _0x595fa5=function(_0x455faa){while(--_0x455faa){_0x5cebc3['push'](_0x5cebc3['shift']());}};_0x595fa5(++_0x3f0d41);}(_0x38cd,0x14e));var _0xd38c=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x38cd[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0xd38c('0x0'));var MailSubstatus=require(_0xd38c('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd38c('0x2')](0x0);var events={'afterUpdate':_0xd38c('0x3')};function emitEvent(_0x7f329a){return function(_0x27961d,_0x5cd796,_0x4bfca1){MailSubstatusEvents[_0xd38c('0x4')](_0x7f329a+':'+_0x27961d['id'],_0x27961d);MailSubstatusEvents[_0xd38c('0x4')](_0x7f329a,_0x27961d);_0x4bfca1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xd38c('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 87b4ec8..a87abec 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 _0x0611=['name','mailSubstatus','_previousDataValues','then','models','define','MailSubstatus','Condition'];(function(_0x2b1a89,_0x41fbef){var _0x25ff90=function(_0xd95aea){while(--_0xd95aea){_0x2b1a89['push'](_0x2b1a89['shift']());}};_0x25ff90(++_0x41fbef);}(_0x0611,0x1bc));var _0x1061=function(_0x25aa3e,_0x24bc9d){_0x25aa3e=_0x25aa3e-0x0;var _0x7d52cc=_0x0611[_0x25aa3e];return _0x7d52cc;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x4d5419){var _0x2a7b20=_0x4d5419[_0x1061('0x0')];return _0x4d5419[_0x1061('0x1')](_0x1061('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x27a224,_0x37caad,_0x23212b){return _0x2a7b20[_0x1061('0x3')]['update']({'value':_0x27a224[_0x1061('0x4')]},{'where':{'field':_0x1061('0x5'),'value':_0x27a224[_0x1061('0x6')][_0x1061('0x4')]}})[_0x1061('0x7')](function(){_0x23212b();})['catch'](function(_0x349654){_0x23212b(_0x349654);});}}});}; \ No newline at end of file +var _0x8d07=['exports','models','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','catch'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x8d07,0xe1));var _0x78d0=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x8d07[_0x54d4fe];return _0x1ab5bb;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x78d0('0x0')]=function(_0x77312a){var _0x3cb208=_0x77312a[_0x78d0('0x1')];return _0x77312a['define'](_0x78d0('0x2'),attributes,{'tableName':_0x78d0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x485575,_0x5797fd,_0xb2aca6){return _0x3cb208[_0x78d0('0x4')]['update']({'value':_0x485575[_0x78d0('0x5')]},{'where':{'field':_0x78d0('0x6'),'value':_0x485575[_0x78d0('0x7')]['name']}})['then'](function(){_0xb2aca6();})[_0x78d0('0x8')](function(_0x4d4f4a){_0xb2aca6(_0x4d4f4a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 4b1c636..e3b68b3 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 _0x2741=['client','request','then','info','request\x20sent','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x406ced,_0x1ebd94){var _0x10e806=function(_0x392ac1){while(--_0x392ac1){_0x406ced['push'](_0x406ced['shift']());}};_0x10e806(++_0x1ebd94);}(_0x2741,0x1c4));var _0x1274=function(_0x51b27b,_0x4625ff){_0x51b27b=_0x51b27b-0x0;var _0xc081e2=_0x2741[_0x51b27b];return _0xc081e2;};'use strict';var _=require('lodash');var util=require(_0x1274('0x0'));var moment=require(_0x1274('0x1'));var BPromise=require(_0x1274('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1274('0x3'));var db=require(_0x1274('0x4'))['db'];var utils=require(_0x1274('0x5'));var logger=require(_0x1274('0x6'))(_0x1274('0x7'));var config=require(_0x1274('0x8'));var jayson=require(_0x1274('0x9'));var client=jayson[_0x1274('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac1fa,_0x1d3bd2,_0x471ecc){return new BPromise(function(_0x49d0fe,_0x2a5a6d){return client[_0x1274('0xb')](_0x2ac1fa,_0x471ecc)[_0x1274('0xc')](function(_0x37ce60){logger[_0x1274('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x1d3bd2,'request\x20sent');logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1d3bd2,_0x1274('0xe'),JSON[_0x1274('0xf')](_0x37ce60));if(_0x37ce60[_0x1274('0x10')]){if(_0x37ce60[_0x1274('0x10')][_0x1274('0x11')]===0x1f4){logger[_0x1274('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x1d3bd2,_0x37ce60[_0x1274('0x10')][_0x1274('0x12')]);return _0x2a5a6d(_0x37ce60['error'][_0x1274('0x12')]);}logger[_0x1274('0x10')](_0x1274('0x13'),_0x1d3bd2,_0x37ce60['error']['message']);return _0x49d0fe(_0x37ce60['error'][_0x1274('0x12')]);}else{logger['info'](_0x1274('0x13'),_0x1d3bd2,_0x1274('0xe'));_0x49d0fe(_0x37ce60['result'][_0x1274('0x12')]);}})[_0x1274('0x14')](function(_0x5d80fc){logger[_0x1274('0x10')](_0x1274('0x13'),_0x1d3bd2,_0x5d80fc);_0x2a5a6d(_0x5d80fc);});});} \ No newline at end of file +var _0xe436=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xe436,0x1af));var _0x6e43=function(_0x53f40c,_0x31521f){_0x53f40c=_0x53f40c-0x0;var _0x337cf8=_0xe436[_0x53f40c];return _0x337cf8;};'use strict';var _=require(_0x6e43('0x0'));var util=require(_0x6e43('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e43('0x2'));var fs=require('fs');var Redis=require(_0x6e43('0x3'));var db=require(_0x6e43('0x4'))['db'];var utils=require(_0x6e43('0x5'));var logger=require('../../config/logger')(_0x6e43('0x6'));var config=require(_0x6e43('0x7'));var jayson=require(_0x6e43('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13ab71,_0x443123,_0x2d8620){return new BPromise(function(_0xc18be9,_0x159d07){return client[_0x6e43('0x9')](_0x13ab71,_0x2d8620)[_0x6e43('0xa')](function(_0x5815c9){logger[_0x6e43('0xb')](_0x6e43('0xc'),_0x443123,_0x6e43('0xd'));logger[_0x6e43('0xe')](_0x6e43('0xf'),_0x443123,'request\x20sent',JSON['stringify'](_0x5815c9));if(_0x5815c9['error']){if(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x11')]===0x1f4){logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);return _0x159d07(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);}logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x5815c9['error'][_0x6e43('0x12')]);return _0xc18be9(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);}else{logger[_0x6e43('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x6e43('0xd'));_0xc18be9(_0x5815c9[_0x6e43('0x13')]['message']);}})[_0x6e43('0x14')](function(_0x551359){logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x551359);_0x159d07(_0x551359);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 35a3f3b..f5b0972 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 _0x5c6c=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete'];(function(_0x127dc6,_0x12919a){var _0x20c24b=function(_0x1d6a6a){while(--_0x1d6a6a){_0x127dc6['push'](_0x127dc6['shift']());}};_0x20c24b(++_0x12919a);}(_0x5c6c,0x112));var _0xc5c6=function(_0x5fe2be,_0x438577){_0x5fe2be=_0x5fe2be-0x0;var _0x4dedc2=_0x5c6c[_0x5fe2be];return _0x4dedc2;};'use strict';var multer=require('multer');var util=require(_0xc5c6('0x0'));var path=require(_0xc5c6('0x1'));var timeout=require(_0xc5c6('0x2'));var express=require(_0xc5c6('0x3'));var router=express[_0xc5c6('0x4')]();var fs_extra=require(_0xc5c6('0x5'));var auth=require(_0xc5c6('0x6'));var interaction=require(_0xc5c6('0x7'));var config=require(_0xc5c6('0x8'));var controller=require('./mailTransferReport.controller');router[_0xc5c6('0x9')]('/',auth[_0xc5c6('0xa')](),controller[_0xc5c6('0xb')]);router[_0xc5c6('0x9')](_0xc5c6('0xc'),auth['isAuthenticated'](),controller[_0xc5c6('0xd')]);router[_0xc5c6('0x9')](_0xc5c6('0xe'),auth[_0xc5c6('0xa')](),controller[_0xc5c6('0xf')]);router[_0xc5c6('0x10')]('/',auth[_0xc5c6('0xa')](),controller[_0xc5c6('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc5c6('0x12')]);router[_0xc5c6('0x13')](_0xc5c6('0xe'),auth[_0xc5c6('0xa')](),controller[_0xc5c6('0x14')]);module['exports']=router; \ No newline at end of file +var _0xba00=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b7b3b,_0x1a07db){var _0x17167b=function(_0x300dfd){while(--_0x300dfd){_0x2b7b3b['push'](_0x2b7b3b['shift']());}};_0x17167b(++_0x1a07db);}(_0xba00,0x1db));var _0x0ba0=function(_0x50d3cf,_0x507c77){_0x50d3cf=_0x50d3cf-0x0;var _0x618979=_0xba00[_0x50d3cf];return _0x618979;};'use strict';var multer=require(_0x0ba0('0x0'));var util=require(_0x0ba0('0x1'));var path=require(_0x0ba0('0x2'));var timeout=require(_0x0ba0('0x3'));var express=require(_0x0ba0('0x4'));var router=express[_0x0ba0('0x5')]();var fs_extra=require(_0x0ba0('0x6'));var auth=require(_0x0ba0('0x7'));var interaction=require(_0x0ba0('0x8'));var config=require(_0x0ba0('0x9'));var controller=require(_0x0ba0('0xa'));router[_0x0ba0('0xb')]('/',auth[_0x0ba0('0xc')](),controller[_0x0ba0('0xd')]);router[_0x0ba0('0xb')](_0x0ba0('0xe'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x0ba0('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ba0('0xf')]);router[_0x0ba0('0x10')]('/:id',auth[_0x0ba0('0xc')](),controller[_0x0ba0('0x11')]);router[_0x0ba0('0x12')](_0x0ba0('0x13'),auth[_0x0ba0('0xc')](),controller[_0x0ba0('0x14')]);module[_0x0ba0('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5e16369..7e6c1f5 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x5b883b,_0x5cb4b1){var _0x1ca4d4=function(_0x4da346){while(--_0x4da346){_0x5b883b['push'](_0x5b883b['shift']());}};_0x1ca4d4(++_0x5cb4b1);}(_0x70e0,0x17b));var _0x070e=function(_0x48d886,_0x3029e2){_0x48d886=_0x48d886-0x0;var _0x2662e1=_0x70e0[_0x48d886];return _0x2662e1;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d3924,_0x327b56){var _0x844555=function(_0x387a6d){while(--_0x387a6d){_0x4d3924['push'](_0x4d3924['shift']());}};_0x844555(++_0x327b56);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 9fd839f..24317fe 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 _0x5435=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','find','body','params','describe','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','MailTransferReport','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0x5435,0x12f));var _0x5543=function(_0x323897,_0x43c101){_0x323897=_0x323897-0x0;var _0x306cde=_0x5435[_0x323897];return _0x306cde;};'use strict';var emlformat=require(_0x5543('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5543('0x1'));var jsonpatch=require(_0x5543('0x2'));var rp=require('request-promise');var moment=require(_0x5543('0x3'));var BPromise=require(_0x5543('0x4'));var Mustache=require(_0x5543('0x5'));var util=require(_0x5543('0x6'));var path=require(_0x5543('0x7'));var sox=require(_0x5543('0x8'));var csv=require(_0x5543('0x9'));var ejs=require(_0x5543('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5543('0xb'));var squel=require(_0x5543('0xc'));var crypto=require(_0x5543('0xd'));var jsforce=require(_0x5543('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5543('0x9'));var querystring=require(_0x5543('0xf'));var Papa=require(_0x5543('0x10'));var Redis=require(_0x5543('0x11'));var authService=require(_0x5543('0x12'));var qs=require(_0x5543('0x13'));var as=require(_0x5543('0x14'));var hardwareService=require(_0x5543('0x15'));var logger=require(_0x5543('0x16'))(_0x5543('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e9ea9,_0x3c15d7){_0x3c15d7=_0x3c15d7||0xcc;return function(_0x3cb780){if(_0x3cb780){return _0x1e9ea9['sendStatus'](_0x3c15d7);}return _0x1e9ea9[_0x5543('0x18')](_0x3c15d7)[_0x5543('0x19')]();};}function respondWithResult(_0x3f962d,_0x5e93b7){_0x5e93b7=_0x5e93b7||0xc8;return function(_0x13e7c3){if(_0x13e7c3){return _0x3f962d[_0x5543('0x18')](_0x5e93b7)[_0x5543('0x1a')](_0x13e7c3);}};}function respondWithFilteredResult(_0x4c3df6,_0x510e2e){return function(_0x355deb){if(_0x355deb){var _0x589f26=typeof _0x510e2e[_0x5543('0x1b')]===_0x5543('0x1c')&&typeof _0x510e2e['limit']==='undefined';var _0x1b7a32=_0x355deb[_0x5543('0x1d')];var _0x3a6ecd=_0x589f26?0x0:_0x510e2e[_0x5543('0x1b')];var _0xc79ca4=_0x589f26?_0x355deb[_0x5543('0x1d')]:_0x510e2e['offset']+_0x510e2e[_0x5543('0x1e')];var _0x271aee;if(_0xc79ca4>=_0x1b7a32){_0xc79ca4=_0x1b7a32;_0x271aee=0xc8;}else{_0x271aee=0xce;}_0x4c3df6[_0x5543('0x18')](_0x271aee);return _0x4c3df6[_0x5543('0x1f')](_0x5543('0x20'),_0x3a6ecd+'-'+_0xc79ca4+'/'+_0x1b7a32)['json'](_0x355deb);}return null;};}function patchUpdates(_0x363013){return function(_0x29033a){try{jsonpatch['apply'](_0x29033a,_0x363013,!![]);}catch(_0x11af6e){return BPromise[_0x5543('0x21')](_0x11af6e);}return _0x29033a['save']();};}function saveUpdates(_0x20330b,_0x105dd9){return function(_0x18461f){if(_0x18461f){return _0x18461f[_0x5543('0x22')](_0x20330b)[_0x5543('0x23')](function(_0x39669c){return _0x39669c;});}return null;};}function removeEntity(_0x23c1b9,_0x562467){return function(_0x4debf1){if(_0x4debf1){return _0x4debf1[_0x5543('0x24')]()['then'](function(){_0x23c1b9[_0x5543('0x18')](0xcc)[_0x5543('0x19')]();});}};}function handleEntityNotFound(_0x260496,_0x2fd1f6){return function(_0x4c2842){if(!_0x4c2842){_0x260496['sendStatus'](0x194);}return _0x4c2842;};}function handleError(_0x47a0cb,_0x24cd2a){_0x24cd2a=_0x24cd2a||0x1f4;return function(_0x20b318){logger[_0x5543('0x25')](_0x20b318[_0x5543('0x26')]);if(_0x20b318[_0x5543('0x27')]){delete _0x20b318[_0x5543('0x27')];}_0x47a0cb[_0x5543('0x18')](_0x24cd2a)['send'](_0x20b318);};}exports['index']=function(_0x4bd40c,_0x194462){var _0x2cdf1c={},_0x50ae48={},_0x54d817={'count':0x0,'rows':[]};var _0x1be769=_['map'](db[_0x5543('0x28')]['rawAttributes'],function(_0x158fce){return{'name':_0x158fce['fieldName'],'type':_0x158fce[_0x5543('0x29')]['key']};});_0x50ae48[_0x5543('0x2a')]=_[_0x5543('0x2b')](_0x1be769,_0x5543('0x27'));_0x50ae48[_0x5543('0x2c')]=_[_0x5543('0x2d')](_0x4bd40c[_0x5543('0x2c')]);_0x50ae48[_0x5543('0x2e')]=_['intersection'](_0x50ae48[_0x5543('0x2a')],_0x50ae48['query']);_0x2cdf1c[_0x5543('0x2f')]=_[_0x5543('0x30')](_0x50ae48[_0x5543('0x2a')],qs[_0x5543('0x31')](_0x4bd40c[_0x5543('0x2c')][_0x5543('0x31')]));_0x2cdf1c[_0x5543('0x2f')]=_0x2cdf1c['attributes'][_0x5543('0x32')]?_0x2cdf1c[_0x5543('0x2f')]:_0x50ae48[_0x5543('0x2a')];if(!_0x4bd40c[_0x5543('0x2c')][_0x5543('0x33')](_0x5543('0x34'))){_0x2cdf1c[_0x5543('0x1e')]=qs[_0x5543('0x1e')](_0x4bd40c['query'][_0x5543('0x1e')]);_0x2cdf1c['offset']=qs[_0x5543('0x1b')](_0x4bd40c[_0x5543('0x2c')][_0x5543('0x1b')]);}_0x2cdf1c[_0x5543('0x35')]=qs[_0x5543('0x36')](_0x4bd40c['query'][_0x5543('0x36')]);_0x2cdf1c[_0x5543('0x37')]=qs[_0x5543('0x2e')](_[_0x5543('0x38')](_0x4bd40c[_0x5543('0x2c')],_0x50ae48[_0x5543('0x2e')]),_0x1be769);if(_0x4bd40c['query'][_0x5543('0x39')]){_0x2cdf1c[_0x5543('0x37')]=_[_0x5543('0x3a')](_0x2cdf1c['where'],{'$or':_['map'](_0x1be769,function(_0x156895){if(_0x156895['type']!==_0x5543('0x3b')){var _0x553576={};_0x553576[_0x156895[_0x5543('0x27')]]={'$like':'%'+_0x4bd40c[_0x5543('0x2c')][_0x5543('0x39')]+'%'};return _0x553576;}})});}_0x2cdf1c=_[_0x5543('0x3a')]({},_0x2cdf1c,_0x4bd40c[_0x5543('0x3c')]);var _0x221863={'where':_0x2cdf1c[_0x5543('0x37')]};return db[_0x5543('0x28')]['count'](_0x221863)[_0x5543('0x23')](function(_0x169a8a){_0x54d817[_0x5543('0x1d')]=_0x169a8a;if(_0x4bd40c[_0x5543('0x2c')][_0x5543('0x3d')]){_0x2cdf1c['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x5543('0x3e')](_0x2cdf1c);})['then'](function(_0x1dd81e){_0x54d817[_0x5543('0x3f')]=_0x1dd81e;return _0x54d817;})[_0x5543('0x23')](respondWithFilteredResult(_0x194462,_0x2cdf1c))[_0x5543('0x40')](handleError(_0x194462,null));};exports['show']=function(_0x3bcaea,_0x2b8245){var _0x397964={'raw':!![],'where':{'id':_0x3bcaea['params']['id']}},_0x5ed157={};_0x5ed157[_0x5543('0x2a')]=_[_0x5543('0x2d')](db[_0x5543('0x28')][_0x5543('0x41')]);_0x5ed157['query']=_[_0x5543('0x2d')](_0x3bcaea[_0x5543('0x2c')]);_0x5ed157['filters']=_['intersection'](_0x5ed157[_0x5543('0x2a')],_0x5ed157[_0x5543('0x2c')]);_0x397964[_0x5543('0x2f')]=_['intersection'](_0x5ed157[_0x5543('0x2a')],qs['fields'](_0x3bcaea['query']['fields']));_0x397964[_0x5543('0x2f')]=_0x397964[_0x5543('0x2f')][_0x5543('0x32')]?_0x397964[_0x5543('0x2f')]:_0x5ed157[_0x5543('0x2a')];if(_0x3bcaea[_0x5543('0x2c')]['includeAll']){_0x397964[_0x5543('0x42')]=[{'all':!![]}];}_0x397964=_[_0x5543('0x3a')]({},_0x397964,_0x3bcaea[_0x5543('0x3c')]);return db['MailTransferReport'][_0x5543('0x43')](_0x397964)[_0x5543('0x23')](handleEntityNotFound(_0x2b8245,null))['then'](respondWithResult(_0x2b8245,null))[_0x5543('0x40')](handleError(_0x2b8245,null));};exports['create']=function(_0x1dd853,_0x14f8b3){return db['MailTransferReport']['create'](_0x1dd853[_0x5543('0x44')],{})[_0x5543('0x23')](respondWithResult(_0x14f8b3,0xc9))['catch'](handleError(_0x14f8b3,null));};exports[_0x5543('0x22')]=function(_0xc6d4f4,_0x3cae12){if(_0xc6d4f4[_0x5543('0x44')]['id']){delete _0xc6d4f4[_0x5543('0x44')]['id'];}return db['MailTransferReport'][_0x5543('0x43')]({'where':{'id':_0xc6d4f4[_0x5543('0x45')]['id']}})[_0x5543('0x23')](handleEntityNotFound(_0x3cae12,null))[_0x5543('0x23')](saveUpdates(_0xc6d4f4[_0x5543('0x44')],null))[_0x5543('0x23')](respondWithResult(_0x3cae12,null))[_0x5543('0x40')](handleError(_0x3cae12,null));};exports['destroy']=function(_0x251f69,_0x2e2604){return db[_0x5543('0x28')][_0x5543('0x43')]({'where':{'id':_0x251f69[_0x5543('0x45')]['id']}})[_0x5543('0x23')](handleEntityNotFound(_0x2e2604,null))['then'](removeEntity(_0x2e2604,null))[_0x5543('0x40')](handleError(_0x2e2604,null));};exports[_0x5543('0x46')]=function(_0x3ca5c2,_0x279348){return db[_0x5543('0x28')]['describe']()[_0x5543('0x23')](respondWithResult(_0x279348,null))[_0x5543('0x40')](handleError(_0x279348,null));}; \ No newline at end of file +var _0x59db=['model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','MailTransferReport','includeAll','include','findAll','show','fields','length','options','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x59db,0x1e5));var _0xb59d=function(_0x5e6939,_0x3dcd8a){_0x5e6939=_0x5e6939-0x0;var _0x45d3f1=_0x59db[_0x5e6939];return _0x45d3f1;};'use strict';var emlformat=require(_0xb59d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb59d('0x1'));var jsonpatch=require(_0xb59d('0x2'));var rp=require('request-promise');var moment=require(_0xb59d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb59d('0x4'));var util=require(_0xb59d('0x5'));var path=require('path');var sox=require(_0xb59d('0x6'));var csv=require('to-csv');var ejs=require(_0xb59d('0x7'));var fs=require('fs');var fs_extra=require(_0xb59d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb59d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb59d('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb59d('0xb'));var Papa=require(_0xb59d('0xc'));var Redis=require(_0xb59d('0xd'));var authService=require(_0xb59d('0xe'));var qs=require(_0xb59d('0xf'));var as=require(_0xb59d('0x10'));var hardwareService=require(_0xb59d('0x11'));var logger=require(_0xb59d('0x12'))(_0xb59d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb59d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b6ba,_0x1b8ec5){_0x1b8ec5=_0x1b8ec5||0xcc;return function(_0x5ecf66){if(_0x5ecf66){return _0x54b6ba[_0xb59d('0x15')](_0x1b8ec5);}return _0x54b6ba[_0xb59d('0x16')](_0x1b8ec5)[_0xb59d('0x17')]();};}function respondWithResult(_0x75bff5,_0x22f01d){_0x22f01d=_0x22f01d||0xc8;return function(_0x271a4a){if(_0x271a4a){return _0x75bff5[_0xb59d('0x16')](_0x22f01d)[_0xb59d('0x18')](_0x271a4a);}};}function respondWithFilteredResult(_0x2d4ca4,_0x58ef69){return function(_0xb69300){if(_0xb69300){var _0x4bd144=typeof _0x58ef69[_0xb59d('0x19')]===_0xb59d('0x1a')&&typeof _0x58ef69[_0xb59d('0x1b')]===_0xb59d('0x1a');var _0x30439c=_0xb69300[_0xb59d('0x1c')];var _0x5161c6=_0x4bd144?0x0:_0x58ef69[_0xb59d('0x19')];var _0x278c0a=_0x4bd144?_0xb69300[_0xb59d('0x1c')]:_0x58ef69['offset']+_0x58ef69[_0xb59d('0x1b')];var _0x314e7d;if(_0x278c0a>=_0x30439c){_0x278c0a=_0x30439c;_0x314e7d=0xc8;}else{_0x314e7d=0xce;}_0x2d4ca4[_0xb59d('0x16')](_0x314e7d);return _0x2d4ca4[_0xb59d('0x1d')](_0xb59d('0x1e'),_0x5161c6+'-'+_0x278c0a+'/'+_0x30439c)[_0xb59d('0x18')](_0xb69300);}return null;};}function patchUpdates(_0x553694){return function(_0x2380e1){try{jsonpatch[_0xb59d('0x1f')](_0x2380e1,_0x553694,!![]);}catch(_0x14eec2){return BPromise[_0xb59d('0x20')](_0x14eec2);}return _0x2380e1[_0xb59d('0x21')]();};}function saveUpdates(_0x5d5ffe,_0x5078a9){return function(_0x5d6eab){if(_0x5d6eab){return _0x5d6eab[_0xb59d('0x22')](_0x5d5ffe)[_0xb59d('0x23')](function(_0x401659){return _0x401659;});}return null;};}function removeEntity(_0x18a758,_0x53dfa4){return function(_0x1cedf8){if(_0x1cedf8){return _0x1cedf8[_0xb59d('0x24')]()[_0xb59d('0x23')](function(){_0x18a758[_0xb59d('0x16')](0xcc)[_0xb59d('0x17')]();});}};}function handleEntityNotFound(_0x16f7bf,_0x21503b){return function(_0x382535){if(!_0x382535){_0x16f7bf['sendStatus'](0x194);}return _0x382535;};}function handleError(_0x5e5500,_0x399fad){_0x399fad=_0x399fad||0x1f4;return function(_0x396ed4){logger[_0xb59d('0x25')](_0x396ed4[_0xb59d('0x26')]);if(_0x396ed4[_0xb59d('0x27')]){delete _0x396ed4['name'];}_0x5e5500[_0xb59d('0x16')](_0x399fad)[_0xb59d('0x28')](_0x396ed4);};}exports[_0xb59d('0x29')]=function(_0x541f49,_0x28f5ac){var _0x2a0410={},_0x1fe372={},_0x3cd892={'count':0x0,'rows':[]};var _0x2492c1=_[_0xb59d('0x2a')](db['MailTransferReport'][_0xb59d('0x2b')],function(_0x57265e){return{'name':_0x57265e[_0xb59d('0x2c')],'type':_0x57265e[_0xb59d('0x2d')][_0xb59d('0x2e')]};});_0x1fe372[_0xb59d('0x2f')]=_[_0xb59d('0x2a')](_0x2492c1,'name');_0x1fe372[_0xb59d('0x30')]=_[_0xb59d('0x31')](_0x541f49['query']);_0x1fe372[_0xb59d('0x32')]=_[_0xb59d('0x33')](_0x1fe372['model'],_0x1fe372[_0xb59d('0x30')]);_0x2a0410[_0xb59d('0x34')]=_[_0xb59d('0x33')](_0x1fe372[_0xb59d('0x2f')],qs['fields'](_0x541f49['query']['fields']));_0x2a0410[_0xb59d('0x34')]=_0x2a0410[_0xb59d('0x34')]['length']?_0x2a0410[_0xb59d('0x34')]:_0x1fe372[_0xb59d('0x2f')];if(!_0x541f49[_0xb59d('0x30')][_0xb59d('0x35')](_0xb59d('0x36'))){_0x2a0410['limit']=qs[_0xb59d('0x1b')](_0x541f49[_0xb59d('0x30')]['limit']);_0x2a0410['offset']=qs[_0xb59d('0x19')](_0x541f49[_0xb59d('0x30')][_0xb59d('0x19')]);}_0x2a0410[_0xb59d('0x37')]=qs[_0xb59d('0x38')](_0x541f49[_0xb59d('0x30')][_0xb59d('0x38')]);_0x2a0410[_0xb59d('0x39')]=qs[_0xb59d('0x32')](_[_0xb59d('0x3a')](_0x541f49[_0xb59d('0x30')],_0x1fe372[_0xb59d('0x32')]),_0x2492c1);if(_0x541f49[_0xb59d('0x30')]['filter']){_0x2a0410['where']=_[_0xb59d('0x3b')](_0x2a0410[_0xb59d('0x39')],{'$or':_['map'](_0x2492c1,function(_0x4ef81b){if(_0x4ef81b[_0xb59d('0x2d')]!==_0xb59d('0x3c')){var _0x166639={};_0x166639[_0x4ef81b[_0xb59d('0x27')]]={'$like':'%'+_0x541f49['query'][_0xb59d('0x3d')]+'%'};return _0x166639;}})});}_0x2a0410=_[_0xb59d('0x3b')]({},_0x2a0410,_0x541f49['options']);var _0x423daf={'where':_0x2a0410['where']};return db[_0xb59d('0x3e')]['count'](_0x423daf)[_0xb59d('0x23')](function(_0x2156e1){_0x3cd892['count']=_0x2156e1;if(_0x541f49[_0xb59d('0x30')][_0xb59d('0x3f')]){_0x2a0410[_0xb59d('0x40')]=[{'all':!![]}];}return db['MailTransferReport'][_0xb59d('0x41')](_0x2a0410);})['then'](function(_0xdae73a){_0x3cd892['rows']=_0xdae73a;return _0x3cd892;})[_0xb59d('0x23')](respondWithFilteredResult(_0x28f5ac,_0x2a0410))['catch'](handleError(_0x28f5ac,null));};exports[_0xb59d('0x42')]=function(_0xb51730,_0x13663b){var _0x2ac95b={'raw':!![],'where':{'id':_0xb51730['params']['id']}},_0x215177={};_0x215177[_0xb59d('0x2f')]=_[_0xb59d('0x31')](db[_0xb59d('0x3e')]['rawAttributes']);_0x215177[_0xb59d('0x30')]=_[_0xb59d('0x31')](_0xb51730[_0xb59d('0x30')]);_0x215177[_0xb59d('0x32')]=_[_0xb59d('0x33')](_0x215177[_0xb59d('0x2f')],_0x215177[_0xb59d('0x30')]);_0x2ac95b[_0xb59d('0x34')]=_[_0xb59d('0x33')](_0x215177[_0xb59d('0x2f')],qs[_0xb59d('0x43')](_0xb51730['query'][_0xb59d('0x43')]));_0x2ac95b['attributes']=_0x2ac95b[_0xb59d('0x34')][_0xb59d('0x44')]?_0x2ac95b[_0xb59d('0x34')]:_0x215177[_0xb59d('0x2f')];if(_0xb51730[_0xb59d('0x30')][_0xb59d('0x3f')]){_0x2ac95b[_0xb59d('0x40')]=[{'all':!![]}];}_0x2ac95b=_[_0xb59d('0x3b')]({},_0x2ac95b,_0xb51730[_0xb59d('0x45')]);return db['MailTransferReport']['find'](_0x2ac95b)['then'](handleEntityNotFound(_0x13663b,null))[_0xb59d('0x23')](respondWithResult(_0x13663b,null))[_0xb59d('0x46')](handleError(_0x13663b,null));};exports[_0xb59d('0x47')]=function(_0x1e13d7,_0x5d3686){return db[_0xb59d('0x3e')][_0xb59d('0x47')](_0x1e13d7[_0xb59d('0x48')],{})[_0xb59d('0x23')](respondWithResult(_0x5d3686,0xc9))[_0xb59d('0x46')](handleError(_0x5d3686,null));};exports[_0xb59d('0x22')]=function(_0x321b79,_0x1706a1){if(_0x321b79[_0xb59d('0x48')]['id']){delete _0x321b79[_0xb59d('0x48')]['id'];}return db['MailTransferReport'][_0xb59d('0x49')]({'where':{'id':_0x321b79[_0xb59d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1706a1,null))[_0xb59d('0x23')](saveUpdates(_0x321b79[_0xb59d('0x48')],null))[_0xb59d('0x23')](respondWithResult(_0x1706a1,null))[_0xb59d('0x46')](handleError(_0x1706a1,null));};exports[_0xb59d('0x24')]=function(_0x2f0b35,_0xdb5bb){return db['MailTransferReport'][_0xb59d('0x49')]({'where':{'id':_0x2f0b35['params']['id']}})['then'](handleEntityNotFound(_0xdb5bb,null))[_0xb59d('0x23')](removeEntity(_0xdb5bb,null))[_0xb59d('0x46')](handleError(_0xdb5bb,null));};exports[_0xb59d('0x4b')]=function(_0x5438a7,_0x2eb132){return db[_0xb59d('0x3e')][_0xb59d('0x4b')]()[_0xb59d('0x23')](respondWithResult(_0x2eb132,null))[_0xb59d('0x46')](handleError(_0x2eb132,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 164edf6..26b0a94 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 _0x8a8b=['exports','define','report_mail_transfer','uniqueid','lodash','api','moment','request-promise','rimraf','./mailTransferReport.attributes'];(function(_0x24bd05,_0x1e9f80){var _0x142073=function(_0x2f413e){while(--_0x2f413e){_0x24bd05['push'](_0x24bd05['shift']());}};_0x142073(++_0x1e9f80);}(_0x8a8b,0xae));var _0xb8a8=function(_0x486360,_0x5e708a){_0x486360=_0x486360-0x0;var _0x4d6da4=_0x8a8b[_0x486360];return _0x4d6da4;};'use strict';var _=require(_0xb8a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb8a8('0x1'));var moment=require(_0xb8a8('0x2'));var BPromise=require('bluebird');var rp=require(_0xb8a8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8a8('0x4'));var config=require('../../config/environment');var attributes=require(_0xb8a8('0x5'));module[_0xb8a8('0x6')]=function(_0xcca5ca,_0x578e1b){return _0xcca5ca[_0xb8a8('0x7')]('MailTransferReport',attributes,{'tableName':_0xb8a8('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb8a8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe984=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xe984,0xe2));var _0x4e98=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xe984[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0x4e98('0x0'));var logger=require(_0x4e98('0x1'))(_0x4e98('0x2'));var moment=require(_0x4e98('0x3'));var BPromise=require(_0x4e98('0x4'));var rp=require(_0x4e98('0x5'));var fs=require('fs');var path=require(_0x4e98('0x6'));var rimraf=require(_0x4e98('0x7'));var config=require(_0x4e98('0x8'));var attributes=require(_0x4e98('0x9'));module['exports']=function(_0x3288f5,_0x44ffad){return _0x3288f5[_0x4e98('0xa')](_0x4e98('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x4e98('0xc'),'fields':[_0x4e98('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a601f19..592be51 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 _0x3265=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3265,0x1ba));var _0x5326=function(_0x14465d,_0x5a7403){_0x14465d=_0x14465d-0x0;var _0x5be222=_0x3265[_0x14465d];return _0x5be222;};'use strict';var _=require(_0x5326('0x0'));var util=require(_0x5326('0x1'));var moment=require(_0x5326('0x2'));var BPromise=require('bluebird');var rs=require(_0x5326('0x3'));var fs=require('fs');var Redis=require(_0x5326('0x4'));var db=require(_0x5326('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5326('0x6'))('rpc');var config=require(_0x5326('0x7'));var jayson=require(_0x5326('0x8'));var client=jayson[_0x5326('0x9')][_0x5326('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3030d2,_0x41cdfd,_0x97a5e2){return new BPromise(function(_0x15981c,_0xc5d64c){return client['request'](_0x3030d2,_0x97a5e2)[_0x5326('0xb')](function(_0x3bd7cd){logger[_0x5326('0xc')](_0x5326('0xd'),_0x41cdfd,_0x5326('0xe'));logger[_0x5326('0xf')](_0x5326('0x10'),_0x41cdfd,_0x5326('0xe'),JSON['stringify'](_0x3bd7cd));if(_0x3bd7cd[_0x5326('0x11')]){if(_0x3bd7cd[_0x5326('0x11')]['code']===0x1f4){logger[_0x5326('0x11')](_0x5326('0xd'),_0x41cdfd,_0x3bd7cd[_0x5326('0x11')]['message']);return _0xc5d64c(_0x3bd7cd['error']['message']);}logger[_0x5326('0x11')](_0x5326('0xd'),_0x41cdfd,_0x3bd7cd[_0x5326('0x11')][_0x5326('0x12')]);return _0x15981c(_0x3bd7cd[_0x5326('0x11')][_0x5326('0x12')]);}else{logger[_0x5326('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x41cdfd,'request\x20sent');_0x15981c(_0x3bd7cd[_0x5326('0x13')][_0x5326('0x12')]);}})['catch'](function(_0x488f76){logger[_0x5326('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x41cdfd,_0x488f76);_0xc5d64c(_0x488f76);});});} \ No newline at end of file +var _0x3d52=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3d52,0x15b));var _0x23d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23d5('0x0'));var util=require('util');var moment=require(_0x23d5('0x1'));var BPromise=require(_0x23d5('0x2'));var rs=require(_0x23d5('0x3'));var fs=require('fs');var Redis=require(_0x23d5('0x4'));var db=require(_0x23d5('0x5'))['db'];var utils=require(_0x23d5('0x6'));var logger=require(_0x23d5('0x7'))(_0x23d5('0x8'));var config=require(_0x23d5('0x9'));var jayson=require(_0x23d5('0xa'));var client=jayson['client'][_0x23d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37b047,_0x14c6c6,_0x50d2c8){return new BPromise(function(_0x481869,_0x18afc2){return client[_0x23d5('0xc')](_0x37b047,_0x50d2c8)[_0x23d5('0xd')](function(_0x4cd1bf){logger[_0x23d5('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x14c6c6,_0x23d5('0xf'));logger[_0x23d5('0x10')](_0x23d5('0x11'),_0x14c6c6,_0x23d5('0xf'),JSON[_0x23d5('0x12')](_0x4cd1bf));if(_0x4cd1bf[_0x23d5('0x13')]){if(_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x14')]===0x1f4){logger['error'](_0x23d5('0x15'),_0x14c6c6,_0x4cd1bf['error'][_0x23d5('0x16')]);return _0x18afc2(_0x4cd1bf['error'][_0x23d5('0x16')]);}logger[_0x23d5('0x13')](_0x23d5('0x15'),_0x14c6c6,_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x16')]);return _0x481869(_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x16')]);}else{logger[_0x23d5('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x14c6c6,_0x23d5('0xf'));_0x481869(_0x4cd1bf[_0x23d5('0x17')][_0x23d5('0x16')]);}})[_0x23d5('0x18')](function(_0x15c4f5){logger['error'](_0x23d5('0x15'),_0x14c6c6,_0x15c4f5);_0x18afc2(_0x15c4f5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a7330d0..0c36841 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 _0x4462=['../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x4462,0x1f3));var _0x2446=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0x4462[_0xc1263e];return _0x471f07;};'use strict';var multer=require(_0x2446('0x0'));var util=require(_0x2446('0x1'));var path=require(_0x2446('0x2'));var timeout=require('connect-timeout');var express=require(_0x2446('0x3'));var router=express[_0x2446('0x4')]();var fs_extra=require(_0x2446('0x5'));var auth=require(_0x2446('0x6'));var interaction=require(_0x2446('0x7'));var config=require(_0x2446('0x8'));var controller=require(_0x2446('0x9'));router[_0x2446('0xa')]('/',auth[_0x2446('0xb')](),controller[_0x2446('0xc')]);router['get'](_0x2446('0xd'),auth[_0x2446('0xb')](),controller[_0x2446('0xe')]);router['get'](_0x2446('0xf'),auth[_0x2446('0xb')](),controller[_0x2446('0x10')]);router[_0x2446('0x11')]('/',auth[_0x2446('0xb')](),controller[_0x2446('0x12')]);router[_0x2446('0x13')](_0x2446('0xf'),auth[_0x2446('0xb')](),controller['update']);router['delete']('/:id',auth[_0x2446('0xb')](),controller[_0x2446('0x14')]);module[_0x2446('0x15')]=router; \ No newline at end of file +var _0x4c42=['get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3efe54,_0x6bf466){var _0x17ccaa=function(_0x5989e0){while(--_0x5989e0){_0x3efe54['push'](_0x3efe54['shift']());}};_0x17ccaa(++_0x6bf466);}(_0x4c42,0xb6));var _0x24c4=function(_0xbb8d6f,_0x429e65){_0xbb8d6f=_0xbb8d6f-0x0;var _0x28aeab=_0x4c42[_0xbb8d6f];return _0x28aeab;};'use strict';var multer=require(_0x24c4('0x0'));var util=require(_0x24c4('0x1'));var path=require(_0x24c4('0x2'));var timeout=require(_0x24c4('0x3'));var express=require(_0x24c4('0x4'));var router=express['Router']();var fs_extra=require(_0x24c4('0x5'));var auth=require(_0x24c4('0x6'));var interaction=require(_0x24c4('0x7'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x24c4('0x8')]('/',auth[_0x24c4('0x9')](),controller['index']);router[_0x24c4('0x8')](_0x24c4('0xa'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xb')]);router[_0x24c4('0x8')](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xd')]);router[_0x24c4('0xe')]('/',auth[_0x24c4('0x9')](),controller['create']);router['put'](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xf')]);router[_0x24c4('0x10')](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0x11')]);module[_0x24c4('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 1208b33..ed33eba 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 _0x5947=['setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds'];(function(_0x11d7c8,_0x162206){var _0xb39e69=function(_0xb6e969){while(--_0xb6e969){_0x11d7c8['push'](_0x11d7c8['shift']());}};_0xb39e69(++_0x162206);}(_0x5947,0x75));var _0x7594=function(_0x18f6a8,_0x590174){_0x18f6a8=_0x18f6a8-0x0;var _0x34dd6e=_0x5947[_0x18f6a8];return _0x34dd6e;};'use strict';var Sequelize=require(_0x7594('0x0'));var moment=require('moment');module[_0x7594('0x1')]={'channel':{'type':Sequelize[_0x7594('0x2')]},'membername':{'type':Sequelize[_0x7594('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x7594('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x7594('0x4')]},'exitAt':{'type':Sequelize[_0x7594('0x4')],'set':function(_0x105542){var _0x5b42c3=moment(_0x105542);var _0xee2d76=moment(this[_0x7594('0x5')](_0x7594('0x6')));var _0x51c336=_0x5b42c3[_0x7594('0x7')](_0xee2d76,_0x7594('0x8'));this[_0x7594('0x9')]('exitAt',_0x105542);this[_0x7594('0x9')]('duration',_0x51c336>=0x0?_0x51c336:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7594('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x7594('0xb')},'data3':{'type':Sequelize[_0x7594('0x2')],'comment':_0x7594('0xc')},'data4':{'type':Sequelize[_0x7594('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x7594('0x2')],'comment':_0x7594('0xd')},'role':{'type':Sequelize[_0x7594('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x7594('0x2')]}}; \ No newline at end of file +var _0x6f94=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','setDataValue'];(function(_0x5db1ce,_0x57ab66){var _0xb62cbb=function(_0x33b753){while(--_0x33b753){_0x5db1ce['push'](_0x5db1ce['shift']());}};_0xb62cbb(++_0x57ab66);}(_0x6f94,0xe8));var _0x46f9=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x6f94[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x46f9('0x0'));var moment=require('moment');module[_0x46f9('0x1')]={'channel':{'type':Sequelize[_0x46f9('0x2')]},'membername':{'type':Sequelize[_0x46f9('0x2')]},'interface':{'type':Sequelize[_0x46f9('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x46f9('0x3')},'duration':{'type':Sequelize[_0x46f9('0x4')]},'enterAt':{'type':Sequelize[_0x46f9('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5b1781){var _0x49f906=moment(_0x5b1781);var _0x18504d=moment(this['getDataValue'](_0x46f9('0x6')));var _0x1d775f=_0x49f906['diff'](_0x18504d,'seconds');this[_0x46f9('0x7')]('exitAt',_0x5b1781);this[_0x46f9('0x7')]('duration',_0x1d775f>=0x0?_0x1d775f:null);}},'data1':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0x8')},'data2':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0x9')},'data3':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0xa')},'data4':{'type':Sequelize[_0x46f9('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x46f9('0xb')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x46f9('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b118933..77e2748 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x55ca,0x126));var _0xa55c=function(_0x25656f,_0x4cf8be){_0x25656f=_0x25656f-0x0;var _0x6e703f=_0x55ca[_0x25656f];return _0x6e703f;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,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(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x34e8,0x12c));var _0x834e=function(_0x3b5953,_0x38346b){_0x3b5953=_0x3b5953-0x0;var _0x13f6dc=_0x34e8[_0x3b5953];return _0x13f6dc;};'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 c7ad9b1..997739f 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 _0xcc05=['rimraf','exports','MemberReport','report_member','membername_interface','membername','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x51a849,_0x12db63){var _0x23a7ec=function(_0x3c95ea){while(--_0x3c95ea){_0x51a849['push'](_0x51a849['shift']());}};_0x23a7ec(++_0x12db63);}(_0xcc05,0x95));var _0x5cc0=function(_0x4a239b,_0x47ff28){_0x4a239b=_0x4a239b-0x0;var _0x4df7fb=_0xcc05[_0x4a239b];return _0x4df7fb;};'use strict';var _=require(_0x5cc0('0x0'));var util=require(_0x5cc0('0x1'));var logger=require('../../config/logger')(_0x5cc0('0x2'));var moment=require(_0x5cc0('0x3'));var BPromise=require(_0x5cc0('0x4'));var rp=require(_0x5cc0('0x5'));var fs=require('fs');var path=require(_0x5cc0('0x6'));var rimraf=require(_0x5cc0('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x5cc0('0x8')]=function(_0x420064,_0x30b9b4){return _0x420064['define'](_0x5cc0('0x9'),attributes,{'tableName':_0x5cc0('0xa'),'paranoid':![],'indexes':[{'name':_0x5cc0('0xb'),'fields':[_0x5cc0('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2436=['../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x145217,_0x2eb561){var _0x5c454b=function(_0x89d37b){while(--_0x89d37b){_0x145217['push'](_0x145217['shift']());}};_0x5c454b(++_0x2eb561);}(_0x2436,0x1e7));var _0x6243=function(_0xa54373,_0x393f2c){_0xa54373=_0xa54373-0x0;var _0xb12745=_0x2436[_0xa54373];return _0xb12745;};'use strict';var _=require('lodash');var util=require(_0x6243('0x0'));var logger=require(_0x6243('0x1'))(_0x6243('0x2'));var moment=require(_0x6243('0x3'));var BPromise=require(_0x6243('0x4'));var rp=require(_0x6243('0x5'));var fs=require('fs');var path=require(_0x6243('0x6'));var rimraf=require(_0x6243('0x7'));var config=require(_0x6243('0x8'));var attributes=require(_0x6243('0x9'));module['exports']=function(_0x33499e,_0x3b32d4){return _0x33499e[_0x6243('0xa')](_0x6243('0xb'),attributes,{'tableName':_0x6243('0xc'),'paranoid':![],'indexes':[{'name':_0x6243('0xd'),'fields':[_0x6243('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index d26fec0..bbcfa4a 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 _0x7923=['debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','findAll','options','raw','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','body','then','stringify','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','info','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7923,0x8f));var _0x3792=function(_0x1afc9a,_0x399224){_0x1afc9a=_0x1afc9a-0x0;var _0x9aca1f=_0x7923[_0x1afc9a];return _0x9aca1f;};'use strict';var _=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var moment=require(_0x3792('0x2'));var BPromise=require(_0x3792('0x3'));var rs=require(_0x3792('0x4'));var fs=require('fs');var Redis=require(_0x3792('0x5'));var db=require(_0x3792('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3792('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3792('0x8'));var client=jayson['client'][_0x3792('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18b993,_0x1e065a,_0x5b55f8){return new BPromise(function(_0x5b453a,_0x297f6f){return client[_0x3792('0xa')](_0x18b993,_0x5b55f8)['then'](function(_0x19d6e5){logger[_0x3792('0xb')]('MemberReport,\x20%s,\x20%s',_0x1e065a,_0x3792('0xc'));logger[_0x3792('0xd')](_0x3792('0xe'),_0x1e065a,'request\x20sent',JSON['stringify'](_0x19d6e5));if(_0x19d6e5[_0x3792('0xf')]){if(_0x19d6e5[_0x3792('0xf')][_0x3792('0x10')]===0x1f4){logger[_0x3792('0xf')]('MemberReport,\x20%s,\x20%s',_0x1e065a,_0x19d6e5['error'][_0x3792('0x11')]);return _0x297f6f(_0x19d6e5[_0x3792('0xf')][_0x3792('0x11')]);}logger[_0x3792('0xf')](_0x3792('0x12'),_0x1e065a,_0x19d6e5[_0x3792('0xf')][_0x3792('0x11')]);return _0x5b453a(_0x19d6e5[_0x3792('0xf')][_0x3792('0x11')]);}else{logger[_0x3792('0xb')](_0x3792('0x12'),_0x1e065a,_0x3792('0xc'));_0x5b453a(_0x19d6e5[_0x3792('0x13')][_0x3792('0x11')]);}})[_0x3792('0x14')](function(_0x683ede){logger[_0x3792('0xf')]('MemberReport,\x20%s,\x20%s',_0x1e065a,_0x683ede);_0x297f6f(_0x683ede);});});}exports[_0x3792('0x15')]=function(_0x2547d8){var _0xb69786=this;return new Promise(function(_0x3893ed,_0x2e2621){return db['MemberReport'][_0x3792('0x16')]({'raw':_0x2547d8[_0x3792('0x17')]?_0x2547d8[_0x3792('0x17')][_0x3792('0x18')]===undefined?!![]:![]:!![],'where':_0x2547d8[_0x3792('0x17')]?_0x2547d8['options']['where']||null:null,'attributes':_0x2547d8[_0x3792('0x17')]?_0x2547d8[_0x3792('0x17')][_0x3792('0x19')]||null:null,'limit':_0x2547d8[_0x3792('0x17')]?_0x2547d8[_0x3792('0x17')][_0x3792('0x1a')]||null:null,'include':_0x2547d8['options']?_0x2547d8['options'][_0x3792('0x1b')]?_[_0x3792('0x1c')](_0x2547d8[_0x3792('0x17')][_0x3792('0x1b')],function(_0x54d99b){return{'model':db[_0x54d99b[_0x3792('0x1d')]],'as':_0x54d99b['as'],'attributes':_0x54d99b['attributes'],'include':_0x54d99b[_0x3792('0x1b')]?_[_0x3792('0x1c')](_0x54d99b['include'],function(_0x530c04){return{'model':db[_0x530c04[_0x3792('0x1d')]],'as':_0x530c04['as'],'attributes':_0x530c04[_0x3792('0x19')],'include':_0x530c04[_0x3792('0x1b')]?_['map'](_0x530c04['include'],function(_0x44499b){return{'model':db[_0x44499b[_0x3792('0x1d')]],'as':_0x44499b['as'],'attributes':_0x44499b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7e2964){logger[_0x3792('0xb')](_0x3792('0x15'),_0x2547d8);logger[_0x3792('0xd')]('GetMemberReport',_0x2547d8,JSON['stringify'](_0x7e2964));_0x3893ed(_0x7e2964);})[_0x3792('0x14')](function(_0xcc56d5){logger[_0x3792('0xf')](_0x3792('0x15'),_0xcc56d5[_0x3792('0x11')],_0x2547d8);_0x2e2621(_0xb69786[_0x3792('0xf')](0x1f4,_0xcc56d5[_0x3792('0x11')]));});});};exports[_0x3792('0x1e')]=function(_0xe83f5c){var _0x4b2ba4=this;return new Promise(function(_0x1612e2,_0x2f8f82){return db[_0x3792('0x1f')][_0x3792('0x20')](_0xe83f5c[_0x3792('0x21')],{'raw':_0xe83f5c['options']?_0xe83f5c['options']['raw']===undefined?!![]:![]:!![]})[_0x3792('0x22')](function(_0x5f0268){logger[_0x3792('0xb')]('CreateMemberReport',_0xe83f5c);logger[_0x3792('0xd')](_0x3792('0x1e'),_0xe83f5c,JSON[_0x3792('0x23')](_0x5f0268));_0x1612e2(_0x5f0268);})[_0x3792('0x14')](function(_0x5d3522){logger[_0x3792('0xf')]('CreateMemberReport',_0x5d3522['message'],_0xe83f5c);_0x2f8f82(_0x4b2ba4[_0x3792('0xf')](0x1f4,_0x5d3522[_0x3792('0x11')]));});});};exports[_0x3792('0x24')]=function(_0x255356){var _0x48c016=this;return new Promise(function(_0x573ec6,_0x10b4eb){return db[_0x3792('0x1f')][_0x3792('0x25')](_0x255356[_0x3792('0x21')],{'raw':_0x255356[_0x3792('0x17')]?_0x255356[_0x3792('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x255356[_0x3792('0x17')]?_0x255356[_0x3792('0x17')][_0x3792('0x26')]||null:null,'attributes':_0x255356[_0x3792('0x17')]?_0x255356[_0x3792('0x17')][_0x3792('0x19')]||null:null,'limit':_0x255356[_0x3792('0x17')]?_0x255356[_0x3792('0x17')]['limit']||null:null})['then'](function(_0x47ca85){logger[_0x3792('0xb')](_0x3792('0x24'),_0x255356);logger[_0x3792('0xd')]('UpdateMemberReport',_0x255356,JSON['stringify'](_0x47ca85));_0x573ec6(_0x47ca85);})[_0x3792('0x14')](function(_0x151523){logger['error'](_0x3792('0x24'),_0x151523[_0x3792('0x11')],_0x255356);_0x10b4eb(_0x48c016[_0x3792('0xf')](0x1f4,_0x151523['message']));});});}; \ No newline at end of file +var _0x4da5=['debug','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','model','map'];(function(_0x3bac80,_0x1cb360){var _0x36ff3f=function(_0x579f06){while(--_0x579f06){_0x3bac80['push'](_0x3bac80['shift']());}};_0x36ff3f(++_0x1cb360);}(_0x4da5,0x1b7));var _0x54da=function(_0x3a6c79,_0x3d67a2){_0x3a6c79=_0x3a6c79-0x0;var _0x164a87=_0x4da5[_0x3a6c79];return _0x164a87;};'use strict';var _=require('lodash');var util=require(_0x54da('0x0'));var moment=require(_0x54da('0x1'));var BPromise=require(_0x54da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54da('0x4'));var logger=require(_0x54da('0x5'))(_0x54da('0x6'));var config=require(_0x54da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54da('0x8')][_0x54da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x259062,_0x1b2b5c,_0x2fe7cc){return new BPromise(function(_0x30c17d,_0x1e2c78){return client['request'](_0x259062,_0x2fe7cc)[_0x54da('0xa')](function(_0x3c4e06){logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'),JSON[_0x54da('0xd')](_0x3c4e06));if(_0x3c4e06[_0x54da('0xe')]){if(_0x3c4e06[_0x54da('0xe')][_0x54da('0xf')]===0x1f4){logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);return _0x1e2c78(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06['error'][_0x54da('0x11')]);return _0x30c17d(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}else{logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));_0x30c17d(_0x3c4e06[_0x54da('0x12')][_0x54da('0x11')]);}})[_0x54da('0x13')](function(_0x20ff93){logger[_0x54da('0xe')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x20ff93);_0x1e2c78(_0x20ff93);});});}exports[_0x54da('0x14')]=function(_0x14aa08){var _0x5d242e=this;return new Promise(function(_0x2cad22,_0x3a463c){return db['MemberReport']['findAll']({'raw':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x16')]===undefined?!![]:![]:!![],'where':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x17')]||null:null,'attributes':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x18')]||null:null,'limit':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x19')]||null:null,'include':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')]?_['map'](_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')],function(_0x16b09a){return{'model':db[_0x16b09a[_0x54da('0x1b')]],'as':_0x16b09a['as'],'attributes':_0x16b09a[_0x54da('0x18')],'include':_0x16b09a[_0x54da('0x1a')]?_['map'](_0x16b09a[_0x54da('0x1a')],function(_0xef179d){return{'model':db[_0xef179d[_0x54da('0x1b')]],'as':_0xef179d['as'],'attributes':_0xef179d[_0x54da('0x18')],'include':_0xef179d[_0x54da('0x1a')]?_[_0x54da('0x1c')](_0xef179d['include'],function(_0x9ea13f){return{'model':db[_0x9ea13f['model']],'as':_0x9ea13f['as'],'attributes':_0x9ea13f[_0x54da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x54da('0xa')](function(_0x77024e){logger['info']('GetMemberReport',_0x14aa08);logger[_0x54da('0x1d')](_0x54da('0x14'),_0x14aa08,JSON[_0x54da('0xd')](_0x77024e));_0x2cad22(_0x77024e);})['catch'](function(_0x1f69e6){logger[_0x54da('0xe')]('GetMemberReport',_0x1f69e6[_0x54da('0x11')],_0x14aa08);_0x3a463c(_0x5d242e[_0x54da('0xe')](0x1f4,_0x1f69e6[_0x54da('0x11')]));});});};exports['CreateMemberReport']=function(_0x4d142e){var _0x21784e=this;return new Promise(function(_0x54b666,_0x20a0c6){return db[_0x54da('0x1e')][_0x54da('0x1f')](_0x4d142e[_0x54da('0x20')],{'raw':_0x4d142e[_0x54da('0x15')]?_0x4d142e[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![]})[_0x54da('0xa')](function(_0x56d4fc){logger[_0x54da('0xb')](_0x54da('0x21'),_0x4d142e);logger['debug']('CreateMemberReport',_0x4d142e,JSON[_0x54da('0xd')](_0x56d4fc));_0x54b666(_0x56d4fc);})[_0x54da('0x13')](function(_0x3f3847){logger[_0x54da('0xe')](_0x54da('0x21'),_0x3f3847[_0x54da('0x11')],_0x4d142e);_0x20a0c6(_0x21784e[_0x54da('0xe')](0x1f4,_0x3f3847[_0x54da('0x11')]));});});};exports[_0x54da('0x22')]=function(_0xe2afc4){var _0x10f188=this;return new Promise(function(_0x361c6f,_0x5e58d3){return db[_0x54da('0x1e')][_0x54da('0x23')](_0xe2afc4['body'],{'raw':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')]['where']||null:null,'attributes':_0xe2afc4['options']?_0xe2afc4[_0x54da('0x15')]['attributes']||null:null,'limit':_0xe2afc4['options']?_0xe2afc4['options'][_0x54da('0x19')]||null:null})[_0x54da('0xa')](function(_0x19cbb4){logger[_0x54da('0xb')](_0x54da('0x22'),_0xe2afc4);logger[_0x54da('0x1d')](_0x54da('0x22'),_0xe2afc4,JSON[_0x54da('0xd')](_0x19cbb4));_0x361c6f(_0x19cbb4);})[_0x54da('0x13')](function(_0x3885aa){logger[_0x54da('0xe')](_0x54da('0x22'),_0x3885aa[_0x54da('0x11')],_0xe2afc4);_0x5e58d3(_0x10f188[_0x54da('0xe')](0x1f4,_0x3885aa[_0x54da('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 67e694b..3ae9baa 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 _0xa07f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x6b838a,_0x5ebffb){var _0x3fdb27=function(_0xdfea66){while(--_0xdfea66){_0x6b838a['push'](_0x6b838a['shift']());}};_0x3fdb27(++_0x5ebffb);}(_0xa07f,0xee));var _0xfa07=function(_0x259d4d,_0x978f29){_0x259d4d=_0x259d4d-0x0;var _0x16a71c=_0xa07f[_0x259d4d];return _0x16a71c;};'use strict';var multer=require(_0xfa07('0x0'));var util=require(_0xfa07('0x1'));var path=require('path');var timeout=require(_0xfa07('0x2'));var express=require(_0xfa07('0x3'));var router=express[_0xfa07('0x4')]();var fs_extra=require(_0xfa07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa07('0x6'));var config=require(_0xfa07('0x7'));var controller=require(_0xfa07('0x8'));router[_0xfa07('0x9')]('/',controller[_0xfa07('0xa')]);module[_0xfa07('0xb')]=router; \ No newline at end of file +var _0xe45e=['path','connect-timeout','Router','fs-extra','../../config/environment','get','exports','multer','util'];(function(_0x361ba7,_0x34bbcc){var _0x1e1ed5=function(_0x2c5330){while(--_0x2c5330){_0x361ba7['push'](_0x361ba7['shift']());}};_0x1e1ed5(++_0x34bbcc);}(_0xe45e,0x1c0));var _0xee45=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xe45e[_0x595013];return _0x2a29e3;};'use strict';var multer=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var path=require(_0xee45('0x2'));var timeout=require(_0xee45('0x3'));var express=require('express');var router=express[_0xee45('0x4')]();var fs_extra=require(_0xee45('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee45('0x6'));var controller=require('./migration.controller');router[_0xee45('0x7')]('/',controller['index']);module[_0xee45('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 58f3bae..2a39634 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 _0x9770=['version','sequelize','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x9770,0x1ae));var _0x0977=function(_0x2409a9,_0x4b7ea8){_0x2409a9=_0x2409a9-0x0;var _0x15583d=_0x9770[_0x2409a9];return _0x15583d;};'use strict';var Sequelize=require(_0x0977('0x0'));module[_0x0977('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x0977('0x2')}}; \ No newline at end of file +var _0x1f30=['STRING','version','sequelize','exports'];(function(_0x3e8bf8,_0x4e76d6){var _0x3391ce=function(_0x4f32d6){while(--_0x4f32d6){_0x3e8bf8['push'](_0x3e8bf8['shift']());}};_0x3391ce(++_0x4e76d6);}(_0x1f30,0x17a));var _0x01f3=function(_0x269b2b,_0x182447){_0x269b2b=_0x269b2b-0x0;var _0xa61baf=_0x1f30[_0x269b2b];return _0xa61baf;};'use strict';var Sequelize=require(_0x01f3('0x0'));module[_0x01f3('0x1')]={'version':{'type':Sequelize[_0x01f3('0x2')],'unique':_0x01f3('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2285093..77b06dc 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 _0x3515=['then','destroy','error','stack','name','send','index','Migration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update'];(function(_0x2ea8f9,_0x4d9325){var _0x457e8c=function(_0x147bf8){while(--_0x147bf8){_0x2ea8f9['push'](_0x2ea8f9['shift']());}};_0x457e8c(++_0x4d9325);}(_0x3515,0x1f4));var _0x5351=function(_0x379cf7,_0x1e35b7){_0x379cf7=_0x379cf7-0x0;var _0x428020=_0x3515[_0x379cf7];return _0x428020;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5351('0x0'));var zipdir=require(_0x5351('0x1'));var jsonpatch=require(_0x5351('0x2'));var rp=require(_0x5351('0x3'));var moment=require('moment');var BPromise=require(_0x5351('0x4'));var Mustache=require(_0x5351('0x5'));var util=require('util');var path=require(_0x5351('0x6'));var sox=require(_0x5351('0x7'));var csv=require(_0x5351('0x8'));var ejs=require(_0x5351('0x9'));var fs=require('fs');var fs_extra=require(_0x5351('0xa'));var _=require('lodash');var squel=require(_0x5351('0xb'));var crypto=require(_0x5351('0xc'));var jsforce=require(_0x5351('0xd'));var deskjs=require(_0x5351('0xe'));var toCsv=require(_0x5351('0x8'));var querystring=require('querystring');var Papa=require(_0x5351('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5351('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5351('0x11'))(_0x5351('0x12'));var utils=require(_0x5351('0x13'));var config=require(_0x5351('0x14'));var licenseUtil=require(_0x5351('0x15'));var db=require(_0x5351('0x16'))['db'];function respondWithStatusCode(_0x44bf6d,_0x18c467){_0x18c467=_0x18c467||0xcc;return function(_0x3201b5){if(_0x3201b5){return _0x44bf6d[_0x5351('0x17')](_0x18c467);}return _0x44bf6d['status'](_0x18c467)[_0x5351('0x18')]();};}function respondWithResult(_0x527dc5,_0x1f46c2){_0x1f46c2=_0x1f46c2||0xc8;return function(_0x55a599){if(_0x55a599){return _0x527dc5[_0x5351('0x19')](_0x1f46c2)['json'](_0x55a599);}};}function respondWithFilteredResult(_0x300d8f,_0x10b45c){return function(_0x4a588d){if(_0x4a588d){var _0x2e190d=typeof _0x10b45c[_0x5351('0x1a')]===_0x5351('0x1b')&&typeof _0x10b45c[_0x5351('0x1c')]===_0x5351('0x1b');var _0x109419=_0x4a588d[_0x5351('0x1d')];var _0x20b347=_0x2e190d?0x0:_0x10b45c['offset'];var _0x12e236=_0x2e190d?_0x4a588d[_0x5351('0x1d')]:_0x10b45c[_0x5351('0x1a')]+_0x10b45c['limit'];var _0x46ac18;if(_0x12e236>=_0x109419){_0x12e236=_0x109419;_0x46ac18=0xc8;}else{_0x46ac18=0xce;}_0x300d8f[_0x5351('0x19')](_0x46ac18);return _0x300d8f[_0x5351('0x1e')]('Content-Range',_0x20b347+'-'+_0x12e236+'/'+_0x109419)[_0x5351('0x1f')](_0x4a588d);}return null;};}function patchUpdates(_0x1e9cbf){return function(_0x693acf){try{jsonpatch[_0x5351('0x20')](_0x693acf,_0x1e9cbf,!![]);}catch(_0x470b36){return BPromise[_0x5351('0x21')](_0x470b36);}return _0x693acf[_0x5351('0x22')]();};}function saveUpdates(_0x5542d3,_0x4362ad){return function(_0x3fff3c){if(_0x3fff3c){return _0x3fff3c[_0x5351('0x23')](_0x5542d3)[_0x5351('0x24')](function(_0x1555c2){return _0x1555c2;});}return null;};}function removeEntity(_0x40a756,_0x1f6521){return function(_0x58ede5){if(_0x58ede5){return _0x58ede5[_0x5351('0x25')]()[_0x5351('0x24')](function(){_0x40a756['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa97986,_0x460c41){return function(_0xcc844){if(!_0xcc844){_0xa97986[_0x5351('0x17')](0x194);}return _0xcc844;};}function handleError(_0x2ca7da,_0x55f625){_0x55f625=_0x55f625||0x1f4;return function(_0x41bab8){logger[_0x5351('0x26')](_0x41bab8[_0x5351('0x27')]);if(_0x41bab8[_0x5351('0x28')]){delete _0x41bab8[_0x5351('0x28')];}_0x2ca7da[_0x5351('0x19')](_0x55f625)[_0x5351('0x29')](_0x41bab8);};}exports[_0x5351('0x2a')]=function(_0x3dc750,_0x3d309a){var _0x3922a9={},_0x406791={},_0x5bbede={'count':0x0,'rows':[]};var _0x1b56df=_['map'](db[_0x5351('0x2b')][_0x5351('0x2c')],function(_0x2cb195){return{'name':_0x2cb195[_0x5351('0x2d')],'type':_0x2cb195['type'][_0x5351('0x2e')]};});_0x406791[_0x5351('0x2f')]=_[_0x5351('0x30')](_0x1b56df,_0x5351('0x28'));_0x406791[_0x5351('0x31')]=_[_0x5351('0x32')](_0x3dc750[_0x5351('0x31')]);_0x406791[_0x5351('0x33')]=_[_0x5351('0x34')](_0x406791['model'],_0x406791[_0x5351('0x31')]);_0x3922a9['attributes']=_[_0x5351('0x34')](_0x406791[_0x5351('0x2f')],qs[_0x5351('0x35')](_0x3dc750[_0x5351('0x31')][_0x5351('0x35')]));_0x3922a9[_0x5351('0x36')]=_0x3922a9['attributes'][_0x5351('0x37')]?_0x3922a9[_0x5351('0x36')]:_0x406791['model'];if(!_0x3dc750[_0x5351('0x31')][_0x5351('0x38')](_0x5351('0x39'))){_0x3922a9[_0x5351('0x1c')]=qs[_0x5351('0x1c')](_0x3dc750[_0x5351('0x31')]['limit']);_0x3922a9[_0x5351('0x1a')]=qs[_0x5351('0x1a')](_0x3dc750[_0x5351('0x31')][_0x5351('0x1a')]);}_0x3922a9[_0x5351('0x3a')]=qs['sort'](_0x3dc750[_0x5351('0x31')][_0x5351('0x3b')]);_0x3922a9[_0x5351('0x3c')]=qs[_0x5351('0x33')](_[_0x5351('0x3d')](_0x3dc750[_0x5351('0x31')],_0x406791[_0x5351('0x33')]),_0x1b56df);if(_0x3dc750[_0x5351('0x31')]['filter']){_0x3922a9[_0x5351('0x3c')]=_[_0x5351('0x3e')](_0x3922a9['where'],{'$or':_['map'](_0x1b56df,function(_0x2dfe84){if(_0x2dfe84['type']!=='VIRTUAL'){var _0x59725d={};_0x59725d[_0x2dfe84[_0x5351('0x28')]]={'$like':'%'+_0x3dc750[_0x5351('0x31')][_0x5351('0x3f')]+'%'};return _0x59725d;}})});}_0x3922a9=_[_0x5351('0x3e')]({},_0x3922a9,_0x3dc750[_0x5351('0x40')]);var _0x22e1b0={'where':_0x3922a9['where']};return db['Migration'][_0x5351('0x1d')](_0x22e1b0)['then'](function(_0x780d90){_0x5bbede[_0x5351('0x1d')]=_0x780d90;if(_0x3dc750[_0x5351('0x31')][_0x5351('0x41')]){_0x3922a9['include']=[{'all':!![]}];}return db[_0x5351('0x2b')]['findAll'](_0x3922a9);})['then'](function(_0x248287){_0x5bbede['rows']=_0x248287;return _0x5bbede;})[_0x5351('0x24')](respondWithFilteredResult(_0x3d309a,_0x3922a9))[_0x5351('0x42')](handleError(_0x3d309a,null));}; \ No newline at end of file +var _0x04f5=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','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','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query'];(function(_0x18b0c2,_0x127a3d){var _0x14b6ff=function(_0x484a49){while(--_0x484a49){_0x18b0c2['push'](_0x18b0c2['shift']());}};_0x14b6ff(++_0x127a3d);}(_0x04f5,0x9f));var _0x504f=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x04f5[_0x5d07ff];return _0x5226ad;};'use strict';var emlformat=require(_0x504f('0x0'));var rimraf=require(_0x504f('0x1'));var zipdir=require(_0x504f('0x2'));var jsonpatch=require(_0x504f('0x3'));var rp=require(_0x504f('0x4'));var moment=require('moment');var BPromise=require(_0x504f('0x5'));var Mustache=require(_0x504f('0x6'));var util=require('util');var path=require(_0x504f('0x7'));var sox=require(_0x504f('0x8'));var csv=require(_0x504f('0x9'));var ejs=require(_0x504f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x504f('0xb'));var squel=require('squel');var crypto=require(_0x504f('0xc'));var jsforce=require(_0x504f('0xd'));var deskjs=require(_0x504f('0xe'));var toCsv=require(_0x504f('0x9'));var querystring=require(_0x504f('0xf'));var Papa=require(_0x504f('0x10'));var Redis=require(_0x504f('0x11'));var authService=require(_0x504f('0x12'));var qs=require(_0x504f('0x13'));var as=require(_0x504f('0x14'));var hardwareService=require(_0x504f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x504f('0x16'));var config=require(_0x504f('0x17'));var licenseUtil=require(_0x504f('0x18'));var db=require(_0x504f('0x19'))['db'];function respondWithStatusCode(_0x38d3a5,_0x1d494d){_0x1d494d=_0x1d494d||0xcc;return function(_0x2946bc){if(_0x2946bc){return _0x38d3a5[_0x504f('0x1a')](_0x1d494d);}return _0x38d3a5[_0x504f('0x1b')](_0x1d494d)[_0x504f('0x1c')]();};}function respondWithResult(_0xcf1606,_0x1a3cdc){_0x1a3cdc=_0x1a3cdc||0xc8;return function(_0x373a63){if(_0x373a63){return _0xcf1606[_0x504f('0x1b')](_0x1a3cdc)['json'](_0x373a63);}};}function respondWithFilteredResult(_0x33fae6,_0x2a4e17){return function(_0x2dec1a){if(_0x2dec1a){var _0x2bdac5=typeof _0x2a4e17[_0x504f('0x1d')]===_0x504f('0x1e')&&typeof _0x2a4e17[_0x504f('0x1f')]===_0x504f('0x1e');var _0x317da9=_0x2dec1a['count'];var _0x598c57=_0x2bdac5?0x0:_0x2a4e17['offset'];var _0xdce25b=_0x2bdac5?_0x2dec1a[_0x504f('0x20')]:_0x2a4e17[_0x504f('0x1d')]+_0x2a4e17['limit'];var _0x2b3c0b;if(_0xdce25b>=_0x317da9){_0xdce25b=_0x317da9;_0x2b3c0b=0xc8;}else{_0x2b3c0b=0xce;}_0x33fae6[_0x504f('0x1b')](_0x2b3c0b);return _0x33fae6['set'](_0x504f('0x21'),_0x598c57+'-'+_0xdce25b+'/'+_0x317da9)['json'](_0x2dec1a);}return null;};}function patchUpdates(_0x45a1a7){return function(_0x51dc54){try{jsonpatch[_0x504f('0x22')](_0x51dc54,_0x45a1a7,!![]);}catch(_0x45e47e){return BPromise[_0x504f('0x23')](_0x45e47e);}return _0x51dc54[_0x504f('0x24')]();};}function saveUpdates(_0xcb7c72,_0x3df5d7){return function(_0x2d32fb){if(_0x2d32fb){return _0x2d32fb[_0x504f('0x25')](_0xcb7c72)['then'](function(_0x499cd5){return _0x499cd5;});}return null;};}function removeEntity(_0x2a89e4,_0x31db03){return function(_0xd33db6){if(_0xd33db6){return _0xd33db6[_0x504f('0x26')]()['then'](function(){_0x2a89e4[_0x504f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502f2d,_0x39b3e0){return function(_0x319db2){if(!_0x319db2){_0x502f2d[_0x504f('0x1a')](0x194);}return _0x319db2;};}function handleError(_0x5e1051,_0x57a0af){_0x57a0af=_0x57a0af||0x1f4;return function(_0xaa39b6){logger[_0x504f('0x27')](_0xaa39b6[_0x504f('0x28')]);if(_0xaa39b6['name']){delete _0xaa39b6[_0x504f('0x29')];}_0x5e1051[_0x504f('0x1b')](_0x57a0af)[_0x504f('0x2a')](_0xaa39b6);};}exports[_0x504f('0x2b')]=function(_0x1c59db,_0x24d37e){var _0x4d947c={},_0x3dcbe4={},_0x28577a={'count':0x0,'rows':[]};var _0x271f8b=_[_0x504f('0x2c')](db[_0x504f('0x2d')][_0x504f('0x2e')],function(_0x7e0563){return{'name':_0x7e0563[_0x504f('0x2f')],'type':_0x7e0563[_0x504f('0x30')][_0x504f('0x31')]};});_0x3dcbe4['model']=_['map'](_0x271f8b,_0x504f('0x29'));_0x3dcbe4[_0x504f('0x32')]=_[_0x504f('0x33')](_0x1c59db[_0x504f('0x32')]);_0x3dcbe4[_0x504f('0x34')]=_[_0x504f('0x35')](_0x3dcbe4['model'],_0x3dcbe4['query']);_0x4d947c[_0x504f('0x36')]=_[_0x504f('0x35')](_0x3dcbe4[_0x504f('0x37')],qs[_0x504f('0x38')](_0x1c59db['query'][_0x504f('0x38')]));_0x4d947c['attributes']=_0x4d947c[_0x504f('0x36')]['length']?_0x4d947c['attributes']:_0x3dcbe4['model'];if(!_0x1c59db['query'][_0x504f('0x39')](_0x504f('0x3a'))){_0x4d947c['limit']=qs[_0x504f('0x1f')](_0x1c59db[_0x504f('0x32')]['limit']);_0x4d947c[_0x504f('0x1d')]=qs[_0x504f('0x1d')](_0x1c59db[_0x504f('0x32')]['offset']);}_0x4d947c['order']=qs[_0x504f('0x3b')](_0x1c59db['query'][_0x504f('0x3b')]);_0x4d947c[_0x504f('0x3c')]=qs[_0x504f('0x34')](_[_0x504f('0x3d')](_0x1c59db['query'],_0x3dcbe4['filters']),_0x271f8b);if(_0x1c59db[_0x504f('0x32')][_0x504f('0x3e')]){_0x4d947c[_0x504f('0x3c')]=_[_0x504f('0x3f')](_0x4d947c[_0x504f('0x3c')],{'$or':_['map'](_0x271f8b,function(_0x3350db){if(_0x3350db['type']!==_0x504f('0x40')){var _0x4f173a={};_0x4f173a[_0x3350db['name']]={'$like':'%'+_0x1c59db[_0x504f('0x32')][_0x504f('0x3e')]+'%'};return _0x4f173a;}})});}_0x4d947c=_[_0x504f('0x3f')]({},_0x4d947c,_0x1c59db['options']);var _0xfc5420={'where':_0x4d947c[_0x504f('0x3c')]};return db[_0x504f('0x2d')]['count'](_0xfc5420)[_0x504f('0x41')](function(_0x3f3fb6){_0x28577a[_0x504f('0x20')]=_0x3f3fb6;if(_0x1c59db[_0x504f('0x32')][_0x504f('0x42')]){_0x4d947c[_0x504f('0x43')]=[{'all':!![]}];}return db[_0x504f('0x2d')][_0x504f('0x44')](_0x4d947c);})['then'](function(_0x24b908){_0x28577a['rows']=_0x24b908;return _0x28577a;})[_0x504f('0x41')](respondWithFilteredResult(_0x24d37e,_0x4d947c))[_0x504f('0x45')](handleError(_0x24d37e,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7f02de5..a8129d5 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 _0x6b47=['api','moment','bluebird','path','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger'];(function(_0x4e34d0,_0x19f1cd){var _0x288759=function(_0x158b3c){while(--_0x158b3c){_0x4e34d0['push'](_0x4e34d0['shift']());}};_0x288759(++_0x19f1cd);}(_0x6b47,0x142));var _0x76b4=function(_0x46ce98,_0x52d764){_0x46ce98=_0x46ce98-0x0;var _0x172f46=_0x6b47[_0x46ce98];return _0x172f46;};'use strict';var _=require(_0x76b4('0x0'));var util=require('util');var logger=require(_0x76b4('0x1'))(_0x76b4('0x2'));var moment=require(_0x76b4('0x3'));var BPromise=require(_0x76b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76b4('0x5'));var rimraf=require('rimraf');var config=require(_0x76b4('0x6'));var attributes=require(_0x76b4('0x7'));module[_0x76b4('0x8')]=function(_0x7e439e,_0x4dd326){return _0x7e439e[_0x76b4('0x9')](_0x76b4('0xa'),attributes,{'tableName':_0x76b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb42=['request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x310a5f,_0x2bcecd){var _0xade9b=function(_0x7faa46){while(--_0x7faa46){_0x310a5f['push'](_0x310a5f['shift']());}};_0xade9b(++_0x2bcecd);}(_0xdb42,0x126));var _0x2db4=function(_0x8fd8d7,_0x377249){_0x8fd8d7=_0x8fd8d7-0x0;var _0x1e3503=_0xdb42[_0x8fd8d7];return _0x1e3503;};'use strict';var _=require(_0x2db4('0x0'));var util=require(_0x2db4('0x1'));var logger=require(_0x2db4('0x2'))(_0x2db4('0x3'));var moment=require(_0x2db4('0x4'));var BPromise=require('bluebird');var rp=require(_0x2db4('0x5'));var fs=require('fs');var path=require(_0x2db4('0x6'));var rimraf=require(_0x2db4('0x7'));var config=require(_0x2db4('0x8'));var attributes=require(_0x2db4('0x9'));module['exports']=function(_0x2ef57d,_0x18db6b){return _0x2ef57d[_0x2db4('0xa')](_0x2db4('0xb'),attributes,{'tableName':_0x2db4('0xc'),'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 0e87046..3df4336 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 _0xdadd=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis'];(function(_0xf34632,_0x5968c3){var _0x1385be=function(_0x18567c){while(--_0x18567c){_0xf34632['push'](_0xf34632['shift']());}};_0x1385be(++_0x5968c3);}(_0xdadd,0x1c8));var _0xddad=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0xdadd[_0x35bd6c];return _0x2f421d;};'use strict';var _=require(_0xddad('0x0'));var util=require('util');var moment=require(_0xddad('0x1'));var BPromise=require('bluebird');var rs=require(_0xddad('0x2'));var fs=require('fs');var Redis=require(_0xddad('0x3'));var db=require(_0xddad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xddad('0x5'))(_0xddad('0x6'));var config=require(_0xddad('0x7'));var jayson=require(_0xddad('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32fed9,_0x79a00b,_0x5b1c3f){return new BPromise(function(_0x40b75a,_0x2b9dbb){return client[_0xddad('0x9')](_0x32fed9,_0x5b1c3f)[_0xddad('0xa')](function(_0x15b533){logger[_0xddad('0xb')](_0xddad('0xc'),_0x79a00b,_0xddad('0xd'));logger[_0xddad('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x79a00b,_0xddad('0xd'),JSON[_0xddad('0xf')](_0x15b533));if(_0x15b533[_0xddad('0x10')]){if(_0x15b533['error'][_0xddad('0x11')]===0x1f4){logger['error'](_0xddad('0xc'),_0x79a00b,_0x15b533[_0xddad('0x10')][_0xddad('0x12')]);return _0x2b9dbb(_0x15b533[_0xddad('0x10')][_0xddad('0x12')]);}logger[_0xddad('0x10')]('Migration,\x20%s,\x20%s',_0x79a00b,_0x15b533[_0xddad('0x10')][_0xddad('0x12')]);return _0x40b75a(_0x15b533[_0xddad('0x10')][_0xddad('0x12')]);}else{logger[_0xddad('0xb')](_0xddad('0xc'),_0x79a00b,'request\x20sent');_0x40b75a(_0x15b533['result'][_0xddad('0x12')]);}})[_0xddad('0x13')](function(_0x239d82){logger[_0xddad('0x10')](_0xddad('0xc'),_0x79a00b,_0x239d82);_0x2b9dbb(_0x239d82);});});} \ No newline at end of file +var _0xaa2d=['../../config/environment','jayson/promise','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x443246,_0x199405){var _0xf91625=function(_0x6c01ff){while(--_0x6c01ff){_0x443246['push'](_0x443246['shift']());}};_0xf91625(++_0x199405);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdaa2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaa2('0x1'));var db=require(_0xdaa2('0x2'))['db'];var utils=require(_0xdaa2('0x3'));var logger=require('../../config/logger')(_0xdaa2('0x4'));var config=require(_0xdaa2('0x5'));var jayson=require(_0xdaa2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2422ff,_0x4ca453,_0x2e2af4){return new BPromise(function(_0x2b3589,_0x259599){return client['request'](_0x2422ff,_0x2e2af4)[_0xdaa2('0x7')](function(_0x4437cc){logger[_0xdaa2('0x8')](_0xdaa2('0x9'),_0x4ca453,_0xdaa2('0xa'));logger[_0xdaa2('0xb')]('Migration,\x20%s,\x20%s,\x20%s',_0x4ca453,'request\x20sent',JSON[_0xdaa2('0xc')](_0x4437cc));if(_0x4437cc['error']){if(_0x4437cc['error']['code']===0x1f4){logger[_0xdaa2('0xd')](_0xdaa2('0x9'),_0x4ca453,_0x4437cc['error'][_0xdaa2('0xe')]);return _0x259599(_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);}logger[_0xdaa2('0xd')](_0xdaa2('0x9'),_0x4ca453,_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);return _0x2b3589(_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);}else{logger[_0xdaa2('0x8')](_0xdaa2('0x9'),_0x4ca453,_0xdaa2('0xa'));_0x2b3589(_0x4437cc[_0xdaa2('0xf')][_0xdaa2('0xe')]);}})[_0xdaa2('0x10')](function(_0x14fe3c){logger['error'](_0xdaa2('0x9'),_0x4ca453,_0x14fe3c);_0x259599(_0x14fe3c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ef5ac3d..b42f9d7 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 _0xe666=['destroy','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','create','put','/:id','delete'];(function(_0x37ce74,_0x2382e0){var _0x514e1b=function(_0x54172e){while(--_0x54172e){_0x37ce74['push'](_0x37ce74['shift']());}};_0x514e1b(++_0x2382e0);}(_0xe666,0x189));var _0x6e66=function(_0x37bbc0,_0x4bdf0a){_0x37bbc0=_0x37bbc0-0x0;var _0x5e5e60=_0xe666[_0x37bbc0];return _0x5e5e60;};'use strict';var multer=require(_0x6e66('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e66('0x1'));var express=require('express');var router=express[_0x6e66('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6e66('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6e66('0x4'));var controller=require(_0x6e66('0x5'));router[_0x6e66('0x6')]('/',auth[_0x6e66('0x7')](),controller[_0x6e66('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6e66('0x7')](),controller[_0x6e66('0x9')]);router[_0x6e66('0xa')](_0x6e66('0xb'),auth[_0x6e66('0x7')](),controller['update']);router[_0x6e66('0xc')](_0x6e66('0xb'),auth['isAuthenticated'](),controller[_0x6e66('0xd')]);module['exports']=router; \ No newline at end of file +var _0x14a0=['../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14a0,0x109));var _0x014a=function(_0x16a2d0,_0x428248){_0x16a2d0=_0x16a2d0-0x0;var _0x453d43=_0x14a0[_0x16a2d0];return _0x453d43;};'use strict';var multer=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var path=require(_0x014a('0x2'));var timeout=require(_0x014a('0x3'));var express=require(_0x014a('0x4'));var router=express[_0x014a('0x5')]();var fs_extra=require(_0x014a('0x6'));var auth=require(_0x014a('0x7'));var interaction=require(_0x014a('0x8'));var config=require('../../config/environment');var controller=require(_0x014a('0x9'));router[_0x014a('0xa')]('/',auth['isAuthenticated'](),controller[_0x014a('0xb')]);router[_0x014a('0xa')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0xe')]);router['post']('/',auth[_0x014a('0xd')](),controller[_0x014a('0xf')]);router[_0x014a('0x10')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x13')]);module[_0x014a('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6cfca06..2a88a70 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 _0xa45e=['externip','stun','turn','STRING','exports','ENUM','localnet'];(function(_0x1fb344,_0x458a03){var _0xb7f0f2=function(_0x4b0ef0){while(--_0x4b0ef0){_0x1fb344['push'](_0x1fb344['shift']());}};_0xb7f0f2(++_0x458a03);}(_0xa45e,0x97));var _0xea45=function(_0x1f32e7,_0x1ca6cc){_0x1f32e7=_0x1f32e7-0x0;var _0x4e2103=_0xa45e[_0x1f32e7];return _0x4e2103;};'use strict';var Sequelize=require('sequelize');module[_0xea45('0x0')]={'type':{'type':Sequelize[_0xea45('0x1')](_0xea45('0x2'),_0xea45('0x3'),_0xea45('0x4'),_0xea45('0x5'))},'value':{'type':Sequelize[_0xea45('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xea45('0x6')]}}; \ No newline at end of file +var _0x6af0=['sequelize','exports','localnet','externip','stun','turn','STRING'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0x6af0,0x134));var _0x06af=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x6af0[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x06af('0x0'));module[_0x06af('0x1')]={'type':{'type':Sequelize['ENUM'](_0x06af('0x2'),_0x06af('0x3'),_0x06af('0x4'),_0x06af('0x5'))},'value':{'type':Sequelize[_0x06af('0x6')]},'username':{'type':Sequelize[_0x06af('0x6')]},'password':{'type':Sequelize[_0x06af('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d37f6fa..655ee78 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 _0x69c0=['end','sendStatus','stack','name','index','map','Network','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','toUpperCase','readFileSync','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','utf8','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','chan_sip.so','update','STUN','toLowerCase','destroy','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','then'];(function(_0x1d0836,_0x360a46){var _0x4b5c63=function(_0x3b7586){while(--_0x3b7586){_0x1d0836['push'](_0x1d0836['shift']());}};_0x4b5c63(++_0x360a46);}(_0x69c0,0xe2));var _0x069c=function(_0xe397b4,_0x37f1c0){_0xe397b4=_0xe397b4-0x0;var _0x384f1e=_0x69c0[_0xe397b4];return _0x384f1e;};'use strict';var util=require('util');var path=require(_0x069c('0x0'));var ejs=require(_0x069c('0x1'));var fs=require('fs');var _=require(_0x069c('0x2'));var qs=require(_0x069c('0x3'));var logger=require(_0x069c('0x4'))(_0x069c('0x5'));var config=require(_0x069c('0x6'));var db=require(_0x069c('0x7'))['db'];var jayson=require(_0x069c('0x8'));var client=jayson[_0x069c('0x9')][_0x069c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c12d6,_0x27d1b9,_0x5899fd,_0x338394){return new Promise(function(_0x526bb2,_0x5438e6){var _0x4366c0=_0x338394||client;return _0x4366c0[_0x069c('0xb')](_0x3c12d6,_0x5899fd)['then'](function(_0x57953c){logger[_0x069c('0xc')](_0x069c('0xd'),_0x27d1b9,'request\x20sent');logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x27d1b9,_0x069c('0xe'),JSON[_0x069c('0xf')](_0x57953c));if(_0x57953c['error']){if(_0x57953c[_0x069c('0x10')]['code']===0x1f4){logger[_0x069c('0x10')]('Network,\x20%s,\x20%s',_0x27d1b9,_0x57953c[_0x069c('0x10')]['message']);return _0x5438e6(_0x57953c['error'][_0x069c('0x11')]);}logger[_0x069c('0x10')](_0x069c('0xd'),_0x27d1b9,_0x57953c[_0x069c('0x10')][_0x069c('0x11')]);return _0x526bb2(_0x57953c[_0x069c('0x10')]['message']);}else{logger[_0x069c('0xc')]('Network,\x20%s,\x20%s',_0x27d1b9,_0x069c('0xe'));_0x526bb2(_0x57953c[_0x069c('0x12')][_0x069c('0x11')]);}})[_0x069c('0x13')](function(_0x5964f1){logger[_0x069c('0x10')]('Network,\x20%s,\x20%s',_0x27d1b9,_0x5964f1);_0x5438e6(_0x5964f1);});});}function respondWithResult(_0x4978da,_0x1a36a2){_0x1a36a2=_0x1a36a2||0xc8;return function(_0x377983){if(_0x377983){return _0x4978da[_0x069c('0x14')](_0x1a36a2)[_0x069c('0x15')](_0x377983);}};}function respondWithFilteredResult(_0x547208,_0x479752){return function(_0x75861c){if(_0x75861c){var _0x3c899c=typeof _0x479752[_0x069c('0x16')]==='undefined'&&typeof _0x479752[_0x069c('0x17')]===_0x069c('0x18');var _0x177919=_0x75861c[_0x069c('0x19')];var _0x43141b=_0x3c899c?0x0:_0x479752['offset'];var _0x5ea0ca=_0x3c899c?_0x75861c[_0x069c('0x19')]:_0x479752[_0x069c('0x16')]+_0x479752['limit'];var _0x4e2e71;if(_0x5ea0ca>=_0x177919){_0x5ea0ca=_0x177919;_0x4e2e71=0xc8;}else{_0x4e2e71=0xce;}_0x547208['status'](_0x4e2e71);return _0x547208[_0x069c('0x1a')](_0x069c('0x1b'),_0x43141b+'-'+_0x5ea0ca+'/'+_0x177919)[_0x069c('0x15')](_0x75861c);}return null;};}function saveUpdates(_0x5a8a0f){return function(_0xb2d221){if(_0xb2d221){return _0xb2d221['update'](_0x5a8a0f)[_0x069c('0x1c')](function(_0xeb66bf){return _0xeb66bf;});}return null;};}function removeEntity(_0xa74642){return function(_0x180fd6){if(_0x180fd6){return _0x180fd6['destroy']()[_0x069c('0x1c')](function(){_0xa74642[_0x069c('0x14')](0xcc)[_0x069c('0x1d')]();});}};}function handleEntityNotFound(_0xfdb89c){return function(_0x35bc75){if(!_0x35bc75){_0xfdb89c[_0x069c('0x1e')](0x194);}return _0x35bc75;};}function handleError(_0x588dd2,_0x3d8634){_0x3d8634=_0x3d8634||0x1f4;return function(_0x4ea9fb){logger['error'](_0x4ea9fb[_0x069c('0x1f')]);if(_0x4ea9fb[_0x069c('0x20')]){delete _0x4ea9fb['name'];}_0x588dd2[_0x069c('0x14')](_0x3d8634)['send'](_0x4ea9fb);};}exports[_0x069c('0x21')]=function(_0x3761d1,_0x5f3d1f){var _0x219591={},_0xec0e0e={},_0x54208f={'count':0x0,'rows':[]};var _0xc22321=_[_0x069c('0x22')](db[_0x069c('0x23')][_0x069c('0x24')],function(_0x362895){return{'name':_0x362895['fieldName'],'type':_0x362895[_0x069c('0x25')][_0x069c('0x26')]};});_0xec0e0e[_0x069c('0x27')]=_[_0x069c('0x22')](_0xc22321,_0x069c('0x20'));_0xec0e0e['query']=_[_0x069c('0x28')](_0x3761d1[_0x069c('0x29')]);_0xec0e0e[_0x069c('0x2a')]=_[_0x069c('0x2b')](_0xec0e0e['model'],_0xec0e0e[_0x069c('0x29')]);_0x219591[_0x069c('0x2c')]=_['intersection'](_0xec0e0e[_0x069c('0x27')],qs[_0x069c('0x2d')](_0x3761d1[_0x069c('0x29')][_0x069c('0x2d')]));_0x219591['attributes']=_0x219591['attributes'][_0x069c('0x2e')]?_0x219591[_0x069c('0x2c')]:_0xec0e0e[_0x069c('0x27')];if(!_0x3761d1['query'][_0x069c('0x2f')](_0x069c('0x30'))){_0x219591[_0x069c('0x17')]=qs[_0x069c('0x17')](_0x3761d1['query']['limit']);_0x219591[_0x069c('0x16')]=qs[_0x069c('0x16')](_0x3761d1[_0x069c('0x29')][_0x069c('0x16')]);}_0x219591['order']=qs[_0x069c('0x31')](_0x3761d1['query'][_0x069c('0x31')]);_0x219591[_0x069c('0x32')]=qs['filters'](_[_0x069c('0x33')](_0x3761d1[_0x069c('0x29')],_0xec0e0e[_0x069c('0x2a')]),_0xc22321);if(_0x3761d1['query'][_0x069c('0x34')]){_0x219591[_0x069c('0x32')]=_[_0x069c('0x35')](_0x219591['where'],{'$or':_[_0x069c('0x22')](_0xc22321,function(_0x391c7d){if(_0x391c7d[_0x069c('0x25')]!=='VIRTUAL'){var _0x163942={};_0x163942[_0x391c7d[_0x069c('0x20')]]={'$like':'%'+_0x3761d1['query'][_0x069c('0x34')]+'%'};return _0x163942;}})});}_0x219591=_[_0x069c('0x35')]({},_0x219591,_0x3761d1[_0x069c('0x36')]);var _0x33c099={'where':_0x219591[_0x069c('0x32')]};return db[_0x069c('0x23')]['count'](_0x33c099)[_0x069c('0x1c')](function(_0x230c6d){_0x54208f[_0x069c('0x19')]=_0x230c6d;if(_0x3761d1[_0x069c('0x29')][_0x069c('0x37')]){_0x219591[_0x069c('0x38')]=[{'all':!![]}];}return db['Network'][_0x069c('0x39')](_0x219591);})['then'](function(_0x5059bd){_0x54208f[_0x069c('0x3a')]=_0x5059bd;return _0x54208f;})[_0x069c('0x1c')](respondWithFilteredResult(_0x5f3d1f,_0x219591))[_0x069c('0x13')](handleError(_0x5f3d1f,null));};exports[_0x069c('0x3b')]=function(_0x4cf70b,_0x377fdf){var _0x510616={'raw':!![],'where':{'id':_0x4cf70b[_0x069c('0x3c')]['id']}},_0x43e56e={};_0x43e56e['model']=_[_0x069c('0x28')](db[_0x069c('0x23')][_0x069c('0x24')]);_0x43e56e[_0x069c('0x29')]=_[_0x069c('0x28')](_0x4cf70b['query']);_0x43e56e[_0x069c('0x2a')]=_[_0x069c('0x2b')](_0x43e56e[_0x069c('0x27')],_0x43e56e[_0x069c('0x29')]);_0x510616[_0x069c('0x2c')]=_['intersection'](_0x43e56e[_0x069c('0x27')],qs['fields'](_0x4cf70b[_0x069c('0x29')][_0x069c('0x2d')]));_0x510616[_0x069c('0x2c')]=_0x510616[_0x069c('0x2c')][_0x069c('0x2e')]?_0x510616['attributes']:_0x43e56e[_0x069c('0x27')];if(_0x4cf70b['query'][_0x069c('0x37')]){_0x510616['include']=[{'all':!![]}];}_0x510616=_['merge']({},_0x510616,_0x4cf70b[_0x069c('0x36')]);return db['Network'][_0x069c('0x3d')](_0x510616)[_0x069c('0x1c')](handleEntityNotFound(_0x377fdf,null))[_0x069c('0x1c')](respondWithResult(_0x377fdf,null))[_0x069c('0x13')](handleError(_0x377fdf,null));};exports[_0x069c('0x3e')]=function(_0x5bcd74,_0x5def17){var _0x4b9cec;return db[_0x069c('0x23')]['create'](_0x5bcd74[_0x069c('0x3f')],{'raw':!![]})[_0x069c('0x1c')](function(_0x3893a5){_0x4b9cec=_0x3893a5;return db[_0x069c('0x23')][_0x069c('0x39')]({'where':{'type':_0x5bcd74[_0x069c('0x3f')][_0x069c('0x25')]},'raw':!![]});})[_0x069c('0x1c')](function(_0x146981){if(_0x4b9cec[_0x069c('0x25')][_0x069c('0x40')]()=='STUN'){var _0x491c91=fs[_0x069c('0x41')](path['join'](config['root'],_0x069c('0x42')),'utf8');var _0x271b3e=ejs['render'](_0x491c91,{'networks':_0x146981||[]});fs['writeFileSync'](_0x069c('0x43'),_0x271b3e);return respondWithRpcPromise(_0x069c('0x44'),'create',{'module':_0x069c('0x45')});}else if(_0x4b9cec[_0x069c('0x25')][_0x069c('0x40')]()==_0x069c('0x46')){var _0x358f9b=fs[_0x069c('0x41')](path[_0x069c('0x47')](config[_0x069c('0x48')],_0x069c('0x49')),_0x069c('0x4a'));var _0x2376d8=ejs[_0x069c('0x4b')](_0x358f9b,{'networks':_0x146981||[]});fs['writeFileSync'](_0x069c('0x4c'),_0x2376d8);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x3e'),{'module':_0x069c('0x45')});}else{var _0x214dd8=fs['readFileSync'](path['join'](config[_0x069c('0x48')],_0x069c('0x4d')),_0x069c('0x4a'));var _0x1a86a2=ejs['render'](_0x214dd8,{'networks':_0x146981||[]});fs[_0x069c('0x4e')](util[_0x069c('0x4f')]('/etc/asterisk/sip_xcally_%s.conf',_0x5bcd74['body'][_0x069c('0x25')]['toLowerCase']()),_0x1a86a2);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x3e'),{'module':_0x069c('0x50')});}})[_0x069c('0x1c')](function(){return _0x4b9cec;})[_0x069c('0x1c')](respondWithResult(_0x5def17,0xc9))[_0x069c('0x13')](handleError(_0x5def17,null));};exports[_0x069c('0x51')]=function(_0x510a7a,_0x3df760){var _0x276e5c;return db[_0x069c('0x23')][_0x069c('0x3d')]({'where':{'id':_0x510a7a['params']['id']}})[_0x069c('0x1c')](handleEntityNotFound(_0x3df760,null))[_0x069c('0x1c')](saveUpdates(_0x510a7a[_0x069c('0x3f')],null))['then'](function(_0x150d0f){if(_0x150d0f){_0x276e5c=_0x150d0f;return db['Network'][_0x069c('0x39')]({'where':{'type':_0x276e5c['type']},'raw':!![]});}return null;})['then'](function(_0x9955a){if(_0x276e5c['type'][_0x069c('0x40')]()==_0x069c('0x52')){var _0x58e387=fs['readFileSync'](path['join'](config[_0x069c('0x48')],_0x069c('0x42')),_0x069c('0x4a'));var _0x2743d8=ejs[_0x069c('0x4b')](_0x58e387,{'networks':_0x9955a||[]});fs[_0x069c('0x4e')]('/etc/asterisk/stun_xcally.conf',_0x2743d8);return respondWithRpcPromise(_0x069c('0x44'),'update',{'module':_0x069c('0x45')});}else if(_0x276e5c[_0x069c('0x25')][_0x069c('0x40')]()==_0x069c('0x46')){var _0x4ed3aa=fs[_0x069c('0x41')](path[_0x069c('0x47')](config[_0x069c('0x48')],_0x069c('0x49')),'utf8');var _0x2df51b=ejs['render'](_0x4ed3aa,{'networks':_0x9955a||[]});fs[_0x069c('0x4e')](_0x069c('0x4c'),_0x2df51b);return respondWithRpcPromise('Reload','update',{'module':_0x069c('0x45')});}else{var _0x4bf0d5=fs[_0x069c('0x41')](path[_0x069c('0x47')](config[_0x069c('0x48')],_0x069c('0x4d')),_0x069c('0x4a'));var _0x38aed3=ejs['render'](_0x4bf0d5,{'networks':_0x9955a||[]});fs[_0x069c('0x4e')](util[_0x069c('0x4f')]('/etc/asterisk/sip_xcally_%s.conf',_0x510a7a[_0x069c('0x3f')][_0x069c('0x25')][_0x069c('0x53')]()),_0x38aed3);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x51'),{'module':'chan_sip.so'});}})[_0x069c('0x1c')](function(_0x449095){if(_0x449095){return _0x276e5c;}return null;})[_0x069c('0x1c')](respondWithResult(_0x3df760,null))[_0x069c('0x13')](handleError(_0x3df760,null));};exports[_0x069c('0x54')]=function(_0x59b4c5,_0x144933){var _0x3df79a;return db['Network'][_0x069c('0x3d')]({'where':{'id':_0x59b4c5['params']['id']}})[_0x069c('0x1c')](function(_0x1ace34){_0x3df79a=_0x1ace34;return _0x1ace34;})[_0x069c('0x1c')](handleEntityNotFound(_0x144933,null))['then'](removeEntity(_0x144933,null))['then'](function(){if(_0x3df79a){return db[_0x069c('0x23')][_0x069c('0x39')]({'where':{'type':_0x3df79a[_0x069c('0x25')]},'raw':!![]});}})['then'](function(_0x16de15){if(_0x3df79a['type'][_0x069c('0x40')]()==_0x069c('0x52')){var _0x1e8350=fs['readFileSync'](path[_0x069c('0x47')](config[_0x069c('0x48')],_0x069c('0x42')),_0x069c('0x4a'));var _0x5a4ee5=ejs[_0x069c('0x4b')](_0x1e8350,{'networks':_0x16de15||[]});fs['writeFileSync'](_0x069c('0x43'),_0x5a4ee5);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x54'),{'module':_0x069c('0x45')});}else if(_0x3df79a[_0x069c('0x25')]['toUpperCase']()==_0x069c('0x46')){var _0x548fac=fs[_0x069c('0x41')](path[_0x069c('0x47')](config[_0x069c('0x48')],'server/files/templates/turn_multiple.ejs'),_0x069c('0x4a'));var _0x451b08=ejs[_0x069c('0x4b')](_0x548fac,{'networks':_0x16de15||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x451b08);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x54'),{'module':_0x069c('0x45')});}else{var _0x2358b4=fs[_0x069c('0x41')](path[_0x069c('0x47')](config[_0x069c('0x48')],_0x069c('0x4d')),'utf8');var _0x30f0f6=ejs[_0x069c('0x4b')](_0x2358b4,{'networks':_0x16de15||[]});fs[_0x069c('0x4e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3df79a[_0x069c('0x25')][_0x069c('0x53')]()),_0x30f0f6);return respondWithRpcPromise(_0x069c('0x44'),_0x069c('0x54'),{'module':_0x069c('0x50')});}})[_0x069c('0x13')](handleError(_0x144933,null));}; \ No newline at end of file +var _0x3f25=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','render','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/network.ejs','format','server/files/templates/turn_multiple.ejs','path','lodash','../../components/parsers/qs','api','jayson/promise','client','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','Network','fieldName','type','model','map','query','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f25,0x1b4));var _0x53f2=function(_0x2846cc,_0x12b673){_0x2846cc=_0x2846cc-0x0;var _0x58cd2a=_0x3f25[_0x2846cc];return _0x58cd2a;};'use strict';var util=require('util');var path=require(_0x53f2('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x53f2('0x1'));var qs=require(_0x53f2('0x2'));var logger=require('../../config/logger')(_0x53f2('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x53f2('0x4'));var client=jayson[_0x53f2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d48de,_0x5a8ab2,_0x288a87,_0x6187fc){return new Promise(function(_0x3b0fea,_0x589ea3){var _0x928421=_0x6187fc||client;return _0x928421[_0x53f2('0x6')](_0x4d48de,_0x288a87)[_0x53f2('0x7')](function(_0x784bcf){logger['info'](_0x53f2('0x8'),_0x5a8ab2,_0x53f2('0x9'));logger[_0x53f2('0xa')](_0x53f2('0xb'),_0x5a8ab2,_0x53f2('0x9'),JSON['stringify'](_0x784bcf));if(_0x784bcf['error']){if(_0x784bcf[_0x53f2('0xc')][_0x53f2('0xd')]===0x1f4){logger[_0x53f2('0xc')]('Network,\x20%s,\x20%s',_0x5a8ab2,_0x784bcf[_0x53f2('0xc')][_0x53f2('0xe')]);return _0x589ea3(_0x784bcf[_0x53f2('0xc')][_0x53f2('0xe')]);}logger[_0x53f2('0xc')](_0x53f2('0x8'),_0x5a8ab2,_0x784bcf['error'][_0x53f2('0xe')]);return _0x3b0fea(_0x784bcf['error']['message']);}else{logger[_0x53f2('0xf')](_0x53f2('0x8'),_0x5a8ab2,'request\x20sent');_0x3b0fea(_0x784bcf[_0x53f2('0x10')]['message']);}})[_0x53f2('0x11')](function(_0x30daa4){logger[_0x53f2('0xc')](_0x53f2('0x8'),_0x5a8ab2,_0x30daa4);_0x589ea3(_0x30daa4);});});}function respondWithResult(_0x6d8af4,_0x2bf621){_0x2bf621=_0x2bf621||0xc8;return function(_0x4f5c13){if(_0x4f5c13){return _0x6d8af4[_0x53f2('0x12')](_0x2bf621)[_0x53f2('0x13')](_0x4f5c13);}};}function respondWithFilteredResult(_0x45acee,_0x5a5305){return function(_0x208fbc){if(_0x208fbc){var _0xb8da1=typeof _0x5a5305[_0x53f2('0x14')]===_0x53f2('0x15')&&typeof _0x5a5305[_0x53f2('0x16')]==='undefined';var _0x11506e=_0x208fbc[_0x53f2('0x17')];var _0x400819=_0xb8da1?0x0:_0x5a5305['offset'];var _0x48751e=_0xb8da1?_0x208fbc[_0x53f2('0x17')]:_0x5a5305[_0x53f2('0x14')]+_0x5a5305[_0x53f2('0x16')];var _0x79c9d5;if(_0x48751e>=_0x11506e){_0x48751e=_0x11506e;_0x79c9d5=0xc8;}else{_0x79c9d5=0xce;}_0x45acee[_0x53f2('0x12')](_0x79c9d5);return _0x45acee[_0x53f2('0x18')](_0x53f2('0x19'),_0x400819+'-'+_0x48751e+'/'+_0x11506e)[_0x53f2('0x13')](_0x208fbc);}return null;};}function saveUpdates(_0x57b9d2){return function(_0x270e28){if(_0x270e28){return _0x270e28['update'](_0x57b9d2)[_0x53f2('0x7')](function(_0x305fb2){return _0x305fb2;});}return null;};}function removeEntity(_0x5a9aaa){return function(_0x55e02c){if(_0x55e02c){return _0x55e02c[_0x53f2('0x1a')]()[_0x53f2('0x7')](function(){_0x5a9aaa[_0x53f2('0x12')](0xcc)[_0x53f2('0x1b')]();});}};}function handleEntityNotFound(_0xcb6735){return function(_0x1a4c07){if(!_0x1a4c07){_0xcb6735['sendStatus'](0x194);}return _0x1a4c07;};}function handleError(_0x369aad,_0x3fd55){_0x3fd55=_0x3fd55||0x1f4;return function(_0x83a32e){logger['error'](_0x83a32e[_0x53f2('0x1c')]);if(_0x83a32e[_0x53f2('0x1d')]){delete _0x83a32e['name'];}_0x369aad[_0x53f2('0x12')](_0x3fd55)['send'](_0x83a32e);};}exports['index']=function(_0x9243cc,_0x5c26be){var _0x4be84c={},_0x13ab22={},_0x373bc0={'count':0x0,'rows':[]};var _0x47fb46=_['map'](db[_0x53f2('0x1e')]['rawAttributes'],function(_0x473d39){return{'name':_0x473d39[_0x53f2('0x1f')],'type':_0x473d39[_0x53f2('0x20')]['key']};});_0x13ab22[_0x53f2('0x21')]=_[_0x53f2('0x22')](_0x47fb46,_0x53f2('0x1d'));_0x13ab22[_0x53f2('0x23')]=_['keys'](_0x9243cc[_0x53f2('0x23')]);_0x13ab22[_0x53f2('0x24')]=_[_0x53f2('0x25')](_0x13ab22[_0x53f2('0x21')],_0x13ab22[_0x53f2('0x23')]);_0x4be84c[_0x53f2('0x26')]=_['intersection'](_0x13ab22[_0x53f2('0x21')],qs[_0x53f2('0x27')](_0x9243cc[_0x53f2('0x23')]['fields']));_0x4be84c[_0x53f2('0x26')]=_0x4be84c['attributes'][_0x53f2('0x28')]?_0x4be84c[_0x53f2('0x26')]:_0x13ab22[_0x53f2('0x21')];if(!_0x9243cc[_0x53f2('0x23')][_0x53f2('0x29')](_0x53f2('0x2a'))){_0x4be84c[_0x53f2('0x16')]=qs[_0x53f2('0x16')](_0x9243cc[_0x53f2('0x23')][_0x53f2('0x16')]);_0x4be84c['offset']=qs[_0x53f2('0x14')](_0x9243cc['query'][_0x53f2('0x14')]);}_0x4be84c['order']=qs[_0x53f2('0x2b')](_0x9243cc[_0x53f2('0x23')][_0x53f2('0x2b')]);_0x4be84c[_0x53f2('0x2c')]=qs['filters'](_[_0x53f2('0x2d')](_0x9243cc[_0x53f2('0x23')],_0x13ab22['filters']),_0x47fb46);if(_0x9243cc[_0x53f2('0x23')]['filter']){_0x4be84c['where']=_['merge'](_0x4be84c[_0x53f2('0x2c')],{'$or':_[_0x53f2('0x22')](_0x47fb46,function(_0x43bda4){if(_0x43bda4[_0x53f2('0x20')]!=='VIRTUAL'){var _0x2499ba={};_0x2499ba[_0x43bda4[_0x53f2('0x1d')]]={'$like':'%'+_0x9243cc[_0x53f2('0x23')][_0x53f2('0x2e')]+'%'};return _0x2499ba;}})});}_0x4be84c=_[_0x53f2('0x2f')]({},_0x4be84c,_0x9243cc['options']);var _0x27c0c0={'where':_0x4be84c[_0x53f2('0x2c')]};return db[_0x53f2('0x1e')][_0x53f2('0x17')](_0x27c0c0)['then'](function(_0x3f437d){_0x373bc0[_0x53f2('0x17')]=_0x3f437d;if(_0x9243cc[_0x53f2('0x23')][_0x53f2('0x30')]){_0x4be84c[_0x53f2('0x31')]=[{'all':!![]}];}return db[_0x53f2('0x1e')][_0x53f2('0x32')](_0x4be84c);})[_0x53f2('0x7')](function(_0x53c798){_0x373bc0[_0x53f2('0x33')]=_0x53c798;return _0x373bc0;})[_0x53f2('0x7')](respondWithFilteredResult(_0x5c26be,_0x4be84c))[_0x53f2('0x11')](handleError(_0x5c26be,null));};exports[_0x53f2('0x34')]=function(_0x1a2a07,_0x5b1649){var _0x4a50b5={'raw':!![],'where':{'id':_0x1a2a07[_0x53f2('0x35')]['id']}},_0x184dd6={};_0x184dd6[_0x53f2('0x21')]=_['keys'](db[_0x53f2('0x1e')][_0x53f2('0x36')]);_0x184dd6[_0x53f2('0x23')]=_['keys'](_0x1a2a07[_0x53f2('0x23')]);_0x184dd6[_0x53f2('0x24')]=_[_0x53f2('0x25')](_0x184dd6['model'],_0x184dd6[_0x53f2('0x23')]);_0x4a50b5[_0x53f2('0x26')]=_[_0x53f2('0x25')](_0x184dd6['model'],qs[_0x53f2('0x27')](_0x1a2a07[_0x53f2('0x23')][_0x53f2('0x27')]));_0x4a50b5[_0x53f2('0x26')]=_0x4a50b5['attributes'][_0x53f2('0x28')]?_0x4a50b5[_0x53f2('0x26')]:_0x184dd6[_0x53f2('0x21')];if(_0x1a2a07[_0x53f2('0x23')]['includeAll']){_0x4a50b5['include']=[{'all':!![]}];}_0x4a50b5=_[_0x53f2('0x2f')]({},_0x4a50b5,_0x1a2a07['options']);return db['Network'][_0x53f2('0x37')](_0x4a50b5)[_0x53f2('0x7')](handleEntityNotFound(_0x5b1649,null))['then'](respondWithResult(_0x5b1649,null))[_0x53f2('0x11')](handleError(_0x5b1649,null));};exports[_0x53f2('0x38')]=function(_0x201bc2,_0x3f6cca){var _0x3ec732;return db['Network'][_0x53f2('0x38')](_0x201bc2[_0x53f2('0x39')],{'raw':!![]})[_0x53f2('0x7')](function(_0x1d8b90){_0x3ec732=_0x1d8b90;return db[_0x53f2('0x1e')][_0x53f2('0x32')]({'where':{'type':_0x201bc2[_0x53f2('0x39')][_0x53f2('0x20')]},'raw':!![]});})[_0x53f2('0x7')](function(_0x791015){if(_0x3ec732[_0x53f2('0x20')][_0x53f2('0x3a')]()==_0x53f2('0x3b')){var _0x1f76a8=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x3098f4=ejs['render'](_0x1f76a8,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](_0x53f2('0x42'),_0x3098f4);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x44')});}else if(_0x3ec732[_0x53f2('0x20')]['toUpperCase']()==_0x53f2('0x45')){var _0x317d52=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x53f2('0x40'));var _0x1452c6=ejs[_0x53f2('0x46')](_0x317d52,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](_0x53f2('0x47'),_0x1452c6);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x44')});}else{var _0x2247e9=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],'server/files/templates/network.ejs'),'utf8');var _0x36dda4=ejs[_0x53f2('0x46')](_0x2247e9,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](util['format'](_0x53f2('0x48'),_0x201bc2[_0x53f2('0x39')][_0x53f2('0x20')][_0x53f2('0x49')]()),_0x36dda4);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x4a')});}})[_0x53f2('0x7')](function(){return _0x3ec732;})[_0x53f2('0x7')](respondWithResult(_0x3f6cca,0xc9))[_0x53f2('0x11')](handleError(_0x3f6cca,null));};exports['update']=function(_0x22022a,_0x55fbda){var _0x346cbb;return db[_0x53f2('0x1e')]['find']({'where':{'id':_0x22022a[_0x53f2('0x35')]['id']}})[_0x53f2('0x7')](handleEntityNotFound(_0x55fbda,null))[_0x53f2('0x7')](saveUpdates(_0x22022a[_0x53f2('0x39')],null))[_0x53f2('0x7')](function(_0x2ca32d){if(_0x2ca32d){_0x346cbb=_0x2ca32d;return db['Network'][_0x53f2('0x32')]({'where':{'type':_0x346cbb['type']},'raw':!![]});}return null;})[_0x53f2('0x7')](function(_0x2562b2){if(_0x346cbb['type'][_0x53f2('0x3a')]()==_0x53f2('0x3b')){var _0x1e0287=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x4fa090=ejs[_0x53f2('0x46')](_0x1e0287,{'networks':_0x2562b2||[]});fs['writeFileSync'](_0x53f2('0x42'),_0x4fa090);return respondWithRpcPromise('Reload',_0x53f2('0x4b'),{'module':_0x53f2('0x44')});}else if(_0x346cbb[_0x53f2('0x20')]['toUpperCase']()==_0x53f2('0x45')){var _0x458a16=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],'server/files/templates/turn_multiple.ejs'),_0x53f2('0x40'));var _0xa62136=ejs[_0x53f2('0x46')](_0x458a16,{'networks':_0x2562b2||[]});fs['writeFileSync'](_0x53f2('0x47'),_0xa62136);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x4b'),{'module':'res_stun_monitor.so'});}else{var _0x4d634b=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config['root'],_0x53f2('0x4c')),'utf8');var _0x119c28=ejs['render'](_0x4d634b,{'networks':_0x2562b2||[]});fs[_0x53f2('0x41')](util[_0x53f2('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0x22022a['body'][_0x53f2('0x20')][_0x53f2('0x49')]()),_0x119c28);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x4b'),{'module':'chan_sip.so'});}})[_0x53f2('0x7')](function(_0x4ef944){if(_0x4ef944){return _0x346cbb;}return null;})[_0x53f2('0x7')](respondWithResult(_0x55fbda,null))[_0x53f2('0x11')](handleError(_0x55fbda,null));};exports[_0x53f2('0x1a')]=function(_0x5f1c40,_0x12858f){var _0x6a065e;return db[_0x53f2('0x1e')][_0x53f2('0x37')]({'where':{'id':_0x5f1c40['params']['id']}})['then'](function(_0x29b7cf){_0x6a065e=_0x29b7cf;return _0x29b7cf;})[_0x53f2('0x7')](handleEntityNotFound(_0x12858f,null))['then'](removeEntity(_0x12858f,null))[_0x53f2('0x7')](function(){if(_0x6a065e){return db[_0x53f2('0x1e')][_0x53f2('0x32')]({'where':{'type':_0x6a065e[_0x53f2('0x20')]},'raw':!![]});}})[_0x53f2('0x7')](function(_0x1409a3){if(_0x6a065e[_0x53f2('0x20')][_0x53f2('0x3a')]()=='STUN'){var _0x3ddf64=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x164363=ejs['render'](_0x3ddf64,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](_0x53f2('0x42'),_0x164363);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x1a'),{'module':_0x53f2('0x44')});}else if(_0x6a065e['type']['toUpperCase']()==_0x53f2('0x45')){var _0x238508=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x4e')),_0x53f2('0x40'));var _0x5cbdd6=ejs['render'](_0x238508,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](_0x53f2('0x47'),_0x5cbdd6);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x1a'),{'module':'res_stun_monitor.so'});}else{var _0x487857=fs[_0x53f2('0x3c')](path['join'](config[_0x53f2('0x3e')],_0x53f2('0x4c')),'utf8');var _0x2f0fec=ejs[_0x53f2('0x46')](_0x487857,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x6a065e[_0x53f2('0x20')]['toLowerCase']()),_0x2f0fec);return respondWithRpcPromise('Reload',_0x53f2('0x1a'),{'module':_0x53f2('0x4a')});}})[_0x53f2('0x11')](handleError(_0x12858f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3e66dc5..6beb2b2 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 _0x7980=['Network','network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./network.attributes','define'];(function(_0x287c3a,_0x5c00b8){var _0x46266b=function(_0x3943ad){while(--_0x3943ad){_0x287c3a['push'](_0x287c3a['shift']());}};_0x46266b(++_0x5c00b8);}(_0x7980,0xab));var _0x0798=function(_0x177d6f,_0x25b290){_0x177d6f=_0x177d6f-0x0;var _0x592bcf=_0x7980[_0x177d6f];return _0x592bcf;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var logger=require(_0x0798('0x2'))(_0x0798('0x3'));var moment=require(_0x0798('0x4'));var BPromise=require('bluebird');var rp=require(_0x0798('0x5'));var fs=require('fs');var path=require(_0x0798('0x6'));var rimraf=require(_0x0798('0x7'));var config=require(_0x0798('0x8'));var attributes=require(_0x0798('0x9'));module['exports']=function(_0x22a0f0,_0x557325){return _0x22a0f0[_0x0798('0xa')](_0x0798('0xb'),attributes,{'tableName':_0x0798('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaa2=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1d1e32,_0x5165c5){var _0xcd5a5a=function(_0x8fb8f8){while(--_0x8fb8f8){_0x1d1e32['push'](_0x1d1e32['shift']());}};_0xcd5a5a(++_0x5165c5);}(_0xaaa2,0xac));var _0x2aaa=function(_0xd0c01c,_0x309801){_0xd0c01c=_0xd0c01c-0x0;var _0x2962f8=_0xaaa2[_0xd0c01c];return _0x2962f8;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var logger=require(_0x2aaa('0x2'))(_0x2aaa('0x3'));var moment=require(_0x2aaa('0x4'));var BPromise=require(_0x2aaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aaa('0x6'));var rimraf=require('rimraf');var config=require(_0x2aaa('0x7'));var attributes=require(_0x2aaa('0x8'));module[_0x2aaa('0x9')]=function(_0x25cb1d,_0x1ef101){return _0x25cb1d[_0x2aaa('0xa')]('Network',attributes,{'tableName':_0x2aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 67d8003..26d68ff 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x4c0dde,_0x27e869){_0x4c0dde=_0x4c0dde-0x0;var _0x40e30d=_0x7a54[_0x4c0dde];return _0x40e30d;};'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(_0x7408fa,_0x3171d0){var _0x3aba03=function(_0x1736cd){while(--_0x1736cd){_0x7408fa['push'](_0x7408fa['shift']());}};_0x3aba03(++_0x3171d0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 78b5857..a953953 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 _0x17e9=['send','put','update','delete','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','notify','addApplications','addAgents','/:id/send'];(function(_0x2c4d63,_0x1f90eb){var _0x2bb803=function(_0x15e510){while(--_0x15e510){_0x2c4d63['push'](_0x2c4d63['shift']());}};_0x2bb803(++_0x1f90eb);}(_0x17e9,0x182));var _0x917e=function(_0x19cd7d,_0x35bb47){_0x19cd7d=_0x19cd7d-0x0;var _0x515eed=_0x17e9[_0x19cd7d];return _0x515eed;};'use strict';var multer=require(_0x917e('0x0'));var util=require(_0x917e('0x1'));var path=require(_0x917e('0x2'));var timeout=require('connect-timeout');var express=require(_0x917e('0x3'));var router=express[_0x917e('0x4')]();var fs_extra=require(_0x917e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x917e('0x6'));var config=require(_0x917e('0x7'));var controller=require(_0x917e('0x8'));router['get']('/',auth[_0x917e('0x9')](),controller[_0x917e('0xa')]);router[_0x917e('0xb')](_0x917e('0xc'),auth[_0x917e('0x9')](),controller[_0x917e('0xd')]);router[_0x917e('0xb')](_0x917e('0xe'),auth['isAuthenticated'](),controller[_0x917e('0xf')]);router[_0x917e('0xb')](_0x917e('0x10'),auth['isAuthenticated'](),controller[_0x917e('0x11')]);router[_0x917e('0xb')](_0x917e('0x12'),auth[_0x917e('0x9')](),controller[_0x917e('0x13')]);router[_0x917e('0xb')](_0x917e('0x14'),auth[_0x917e('0x9')](),controller[_0x917e('0x15')]);router[_0x917e('0xb')](_0x917e('0x16'),auth[_0x917e('0x9')](),controller[_0x917e('0x17')]);router['get'](_0x917e('0x18'),auth[_0x917e('0x9')](),controller[_0x917e('0x19')]);router[_0x917e('0x1a')]('/',auth['isAuthenticated'](),controller['create']);router[_0x917e('0x1a')](_0x917e('0x10'),auth[_0x917e('0x9')](),controller[_0x917e('0x1b')]);router['post'](_0x917e('0x12'),auth[_0x917e('0x9')](),controller['addAnswer']);router[_0x917e('0x1a')]('/:id/notify',controller[_0x917e('0x1c')]);router['post']('/:id/applications',auth[_0x917e('0x9')](),controller[_0x917e('0x1d')]);router['post'](_0x917e('0x18'),auth[_0x917e('0x9')](),controller[_0x917e('0x1e')]);router['post'](_0x917e('0x1f'),auth[_0x917e('0x9')](),controller[_0x917e('0x20')]);router[_0x917e('0x21')](_0x917e('0xe'),auth[_0x917e('0x9')](),controller[_0x917e('0x22')]);router['delete'](_0x917e('0xe'),auth[_0x917e('0x9')](),controller['destroy']);router[_0x917e('0x23')]('/:id/dispositions',auth[_0x917e('0x9')](),controller['removeDispositions']);router[_0x917e('0x23')](_0x917e('0x12'),auth[_0x917e('0x9')](),controller[_0x917e('0x24')]);router[_0x917e('0x23')](_0x917e('0x18'),auth[_0x917e('0x9')](),controller['removeAgents']);module[_0x917e('0x25')]=router; \ No newline at end of file +var _0xd89d=['addDisposition','/:id/canned_answers','/:id/notify','notify','addApplications','/:id/send','send','put','delete','destroy','removeAnswers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create'];(function(_0x352af2,_0x11acf7){var _0x3b35aa=function(_0x593709){while(--_0x593709){_0x352af2['push'](_0x352af2['shift']());}};_0x3b35aa(++_0x11acf7);}(_0xd89d,0x11c));var _0xdd89=function(_0x34bd36,_0x4ca7fd){_0x34bd36=_0x34bd36-0x0;var _0x28e775=_0xd89d[_0x34bd36];return _0x28e775;};'use strict';var multer=require('multer');var util=require(_0xdd89('0x0'));var path=require(_0xdd89('0x1'));var timeout=require(_0xdd89('0x2'));var express=require(_0xdd89('0x3'));var router=express['Router']();var fs_extra=require(_0xdd89('0x4'));var auth=require(_0xdd89('0x5'));var interaction=require(_0xdd89('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xdd89('0x7')]('/',auth[_0xdd89('0x8')](),controller[_0xdd89('0x9')]);router['get']('/describe',auth[_0xdd89('0x8')](),controller[_0xdd89('0xa')]);router['get'](_0xdd89('0xb'),auth[_0xdd89('0x8')](),controller['show']);router[_0xdd89('0x7')](_0xdd89('0xc'),auth[_0xdd89('0x8')](),controller[_0xdd89('0xd')]);router[_0xdd89('0x7')]('/:id/canned_answers',auth[_0xdd89('0x8')](),controller[_0xdd89('0xe')]);router[_0xdd89('0x7')](_0xdd89('0xf'),auth['isAuthenticated'](),controller[_0xdd89('0x10')]);router[_0xdd89('0x7')](_0xdd89('0x11'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x12')]);router[_0xdd89('0x7')]('/:id/users',auth[_0xdd89('0x8')](),controller[_0xdd89('0x13')]);router[_0xdd89('0x14')]('/',auth[_0xdd89('0x8')](),controller[_0xdd89('0x15')]);router[_0xdd89('0x14')](_0xdd89('0xc'),auth['isAuthenticated'](),controller[_0xdd89('0x16')]);router['post'](_0xdd89('0x17'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xdd89('0x18'),controller[_0xdd89('0x19')]);router[_0xdd89('0x14')](_0xdd89('0xf'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x1a')]);router['post']('/:id/users',auth[_0xdd89('0x8')](),controller['addAgents']);router['post'](_0xdd89('0x1b'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x1c')]);router[_0xdd89('0x1d')](_0xdd89('0xb'),auth[_0xdd89('0x8')](),controller['update']);router[_0xdd89('0x1e')](_0xdd89('0xb'),auth['isAuthenticated'](),controller[_0xdd89('0x1f')]);router['delete'](_0xdd89('0xc'),auth[_0xdd89('0x8')](),controller['removeDispositions']);router[_0xdd89('0x1e')](_0xdd89('0x17'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x20')]);router[_0xdd89('0x1e')]('/:id/users',auth[_0xdd89('0x8')](),controller['removeAgents']);module[_0xdd89('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 c25de27..01124b8 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 _0x00f1=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2d55a1,_0x30cb10){var _0x39ed86=function(_0x1df22a){while(--_0x1df22a){_0x2d55a1['push'](_0x2d55a1['shift']());}};_0x39ed86(++_0x30cb10);}(_0x00f1,0x73));var _0x100f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x00f1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x100f('0x0'));var rs=require(_0x100f('0x1'));module[_0x100f('0x2')]={'name':{'type':Sequelize[_0x100f('0x3')],'unique':_0x100f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x100f('0x3')]},'token':{'type':Sequelize[_0x100f('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x100f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x100f('0x5')],'defaultValue':function(){return _0x100f('0x6');}},'notificationSound':{'type':Sequelize[_0x100f('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x100f('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x100f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x100f('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x100f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x100f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x100f('0x7')],'defaultValue':![],'comment':_0x100f('0xa'),'set':function(_0x3daaef){if(!_0x3daaef)this[_0x100f('0xb')](_0x100f('0xc'),null);this[_0x100f('0xb')](_0x100f('0xd'),_0x3daaef);}}}; \ No newline at end of file +var _0x6c0a=['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','mandatoryDisposition'];(function(_0x152547,_0x23189c){var _0x1f828d=function(_0xdff426){while(--_0xdff426){_0x152547['push'](_0x152547['shift']());}};_0x1f828d(++_0x23189c);}(_0x6c0a,0x10e));var _0xa6c0=function(_0x4409a3,_0x1cb281){_0x4409a3=_0x4409a3-0x0;var _0x2cb3c4=_0x6c0a[_0x4409a3];return _0x2cb3c4;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xa6c0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa6c0('0x1')],'defaultValue':function(){return rs[_0xa6c0('0x2')]();}},'replyUri':{'type':Sequelize[_0xa6c0('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa6c0('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa6c0('0x3')],'defaultValue':function(){return _0xa6c0('0x4');}},'notificationSound':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6c0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa6c0('0x1')]},'queueTransfer':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6c0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa6c0('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51fab1){if(!_0x51fab1)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa6c0('0x8'),_0x51fab1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 755579e..880c7e2 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 _0xa79e=['asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','defaults','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','limit','offset','set','apply','update','destroy','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','count','includeAll','findAll','rows','params','rawAttributes','include','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','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','Applications','account','applications','list'];(function(_0x23519e,_0xd1cd41){var _0x52a482=function(_0x279159){while(--_0x279159){_0x23519e['push'](_0x23519e['shift']());}};_0x52a482(++_0xd1cd41);}(_0xa79e,0xf7));var _0xea79=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0xa79e[_0x437d7f];return _0x31058c;};'use strict';var emlformat=require(_0xea79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea79('0x1'));var jsonpatch=require(_0xea79('0x2'));var rp=require(_0xea79('0x3'));var moment=require(_0xea79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea79('0x5'));var path=require(_0xea79('0x6'));var sox=require('sox');var csv=require(_0xea79('0x7'));var ejs=require(_0xea79('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea79('0x9'));var squel=require(_0xea79('0xa'));var crypto=require(_0xea79('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea79('0xc'));var Papa=require(_0xea79('0xd'));var Redis=require('ioredis');var authService=require(_0xea79('0xe'));var qs=require(_0xea79('0xf'));var as=require(_0xea79('0x10'));var hardwareService=require(_0xea79('0x11'));var logger=require('../../config/logger')(_0xea79('0x12'));var utils=require(_0xea79('0x13'));var config=require(_0xea79('0x14'));var licenseUtil=require(_0xea79('0x15'));var db=require('../../mysqldb')['db'];config[_0xea79('0x16')]=_['defaults'](config[_0xea79('0x16')],{'host':_0xea79('0x17'),'port':0x18eb});var socket=require(_0xea79('0x18'))(new Redis(config['redis']));require(_0xea79('0x19'))[_0xea79('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xea79('0x1b')][_0xea79('0x1c')]({'port':0x232c});var client9002=jayson[_0xea79('0x1b')][_0xea79('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5805fb,_0x440ec1,_0x19b83c,_0x26fc5e){return new BPromise(function(_0x265088,_0x181fd9){var _0x3d03d7=_0x26fc5e||client;return _0x3d03d7['request'](_0x5805fb,_0x19b83c)[_0xea79('0x1d')](function(_0x455434){logger[_0xea79('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x440ec1,'request\x20sent');logger[_0xea79('0x1f')](_0xea79('0x20'),_0x440ec1,_0xea79('0x21'),JSON[_0xea79('0x22')](_0x455434));if(_0x455434[_0xea79('0x23')]){if(_0x455434[_0xea79('0x23')][_0xea79('0x24')]===0x1f4){logger['error'](_0xea79('0x25'),_0x440ec1,_0x455434['error'][_0xea79('0x26')]);return _0x181fd9(_0x455434['error']['message']);}logger[_0xea79('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x440ec1,_0x455434[_0xea79('0x23')][_0xea79('0x26')]);return _0x265088(_0x455434[_0xea79('0x23')][_0xea79('0x26')]);}else{logger['info'](_0xea79('0x25'),_0x440ec1,_0xea79('0x21'));_0x265088(_0x455434[_0xea79('0x27')][_0xea79('0x26')]);}})[_0xea79('0x28')](function(_0x21399a){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x440ec1,_0x21399a);_0x181fd9(_0x21399a);});});}function respondWithStatusCode(_0x24f1a7,_0x4bfbd5){_0x4bfbd5=_0x4bfbd5||0xcc;return function(_0x18ce51){if(_0x18ce51){return _0x24f1a7[_0xea79('0x29')](_0x4bfbd5);}return _0x24f1a7[_0xea79('0x2a')](_0x4bfbd5)['end']();};}function respondWithResult(_0x2999af,_0x3e6837){_0x3e6837=_0x3e6837||0xc8;return function(_0x33958a){if(_0x33958a){return _0x2999af[_0xea79('0x2a')](_0x3e6837)[_0xea79('0x2b')](_0x33958a);}};}function respondWithFilteredResult(_0x523b6c,_0x3d8fca){return function(_0x720cb9){if(_0x720cb9){var _0x63a058=typeof _0x3d8fca['offset']==='undefined'&&typeof _0x3d8fca[_0xea79('0x2c')]==='undefined';var _0x1614d3=_0x720cb9['count'];var _0x19e5b2=_0x63a058?0x0:_0x3d8fca[_0xea79('0x2d')];var _0x3fd798=_0x63a058?_0x720cb9['count']:_0x3d8fca[_0xea79('0x2d')]+_0x3d8fca[_0xea79('0x2c')];var _0x396f8f;if(_0x3fd798>=_0x1614d3){_0x3fd798=_0x1614d3;_0x396f8f=0xc8;}else{_0x396f8f=0xce;}_0x523b6c[_0xea79('0x2a')](_0x396f8f);return _0x523b6c[_0xea79('0x2e')]('Content-Range',_0x19e5b2+'-'+_0x3fd798+'/'+_0x1614d3)['json'](_0x720cb9);}return null;};}function patchUpdates(_0x3e9666){return function(_0x965c64){try{jsonpatch[_0xea79('0x2f')](_0x965c64,_0x3e9666,!![]);}catch(_0x5ecee5){return BPromise['reject'](_0x5ecee5);}return _0x965c64['save']();};}function saveUpdates(_0x4407a2,_0x1f2def){return function(_0x3c6bc2){if(_0x3c6bc2){return _0x3c6bc2[_0xea79('0x30')](_0x4407a2)[_0xea79('0x1d')](function(_0xc9128f){return _0xc9128f;});}return null;};}function removeEntity(_0x8fcd05,_0x37bc7e){return function(_0x4fb036){if(_0x4fb036){return _0x4fb036[_0xea79('0x31')]()['then'](function(){var _0x28e0e6=_0x4fb036['get']({'plain':!![]});var _0x515f65=_0xea79('0x32');return db[_0xea79('0x33')][_0xea79('0x31')]({'where':{'type':_0x515f65,'resourceId':_0x28e0e6['id']}})[_0xea79('0x1d')](function(){return _0x4fb036;});})[_0xea79('0x1d')](function(){_0x8fcd05[_0xea79('0x2a')](0xcc)[_0xea79('0x34')]();});}};}function handleEntityNotFound(_0x24e72c,_0x4000be){return function(_0x379a8e){if(!_0x379a8e){_0x24e72c[_0xea79('0x29')](0x194);}return _0x379a8e;};}function handleError(_0x455342,_0x6b5562){_0x6b5562=_0x6b5562||0x1f4;return function(_0x37abef){logger[_0xea79('0x23')](_0x37abef[_0xea79('0x35')]);if(_0x37abef['name']){delete _0x37abef[_0xea79('0x36')];}_0x455342[_0xea79('0x2a')](_0x6b5562)[_0xea79('0x37')](_0x37abef);};}exports[_0xea79('0x38')]=function(_0x28c808,_0x59e3bb){var _0x18566a={'include':[{'model':db[_0xea79('0x39')],'as':_0xea79('0x3a')}]},_0x23a772={},_0x85e386={'count':0x0,'rows':[]};var _0x392d91=_[_0xea79('0x3b')](db[_0xea79('0x3c')]['rawAttributes'],function(_0x4c88c7){return{'name':_0x4c88c7[_0xea79('0x3d')],'type':_0x4c88c7[_0xea79('0x3e')]['key']};});_0x23a772[_0xea79('0x3f')]=_[_0xea79('0x3b')](_0x392d91,_0xea79('0x36'));_0x23a772[_0xea79('0x40')]=_[_0xea79('0x41')](_0x28c808[_0xea79('0x40')]);_0x23a772['filters']=_[_0xea79('0x42')](_0x23a772[_0xea79('0x3f')],_0x23a772[_0xea79('0x40')]);_0x18566a[_0xea79('0x43')]=_['intersection'](_0x23a772[_0xea79('0x3f')],qs[_0xea79('0x44')](_0x28c808[_0xea79('0x40')][_0xea79('0x44')]));_0x18566a['attributes']=_0x18566a[_0xea79('0x43')][_0xea79('0x45')]?_0x18566a[_0xea79('0x43')]:_0x23a772['model'];if(!_0x28c808['query']['hasOwnProperty'](_0xea79('0x46'))){_0x18566a[_0xea79('0x2c')]=qs[_0xea79('0x2c')](_0x28c808[_0xea79('0x40')]['limit']);_0x18566a[_0xea79('0x2d')]=qs[_0xea79('0x2d')](_0x28c808[_0xea79('0x40')][_0xea79('0x2d')]);}_0x18566a[_0xea79('0x47')]=qs['sort'](_0x28c808[_0xea79('0x40')][_0xea79('0x48')]);_0x18566a[_0xea79('0x49')]=qs['filters'](_[_0xea79('0x4a')](_0x28c808[_0xea79('0x40')],_0x23a772[_0xea79('0x4b')]),_0x392d91);if(_0x28c808[_0xea79('0x40')][_0xea79('0x4c')]){_0x18566a[_0xea79('0x49')]=_[_0xea79('0x4d')](_0x18566a['where'],{'$or':_[_0xea79('0x3b')](_0x392d91,function(_0x1aa245){if(_0x1aa245[_0xea79('0x3e')]!=='VIRTUAL'){var _0x2b00f9={};_0x2b00f9[_0x1aa245[_0xea79('0x36')]]={'$like':'%'+_0x28c808[_0xea79('0x40')][_0xea79('0x4c')]+'%'};return _0x2b00f9;}})});}_0x18566a=_[_0xea79('0x4d')]({},_0x18566a,_0x28c808[_0xea79('0x4e')]);var _0xf869ef={'where':_0x18566a['where']};return db['OpenchannelAccount'][_0xea79('0x4f')](_0xf869ef)[_0xea79('0x1d')](function(_0x23cb97){_0x85e386[_0xea79('0x4f')]=_0x23cb97;if(_0x28c808[_0xea79('0x40')][_0xea79('0x50')]){_0x18566a['include']=[{'all':!![]}];}return db[_0xea79('0x3c')][_0xea79('0x51')](_0x18566a);})[_0xea79('0x1d')](function(_0x26b0fa){_0x85e386[_0xea79('0x52')]=_0x26b0fa;return _0x85e386;})[_0xea79('0x1d')](respondWithFilteredResult(_0x59e3bb,_0x18566a))[_0xea79('0x28')](handleError(_0x59e3bb,null));};exports['show']=function(_0x105248,_0x19a48c){var _0x96ede1={'raw':![],'where':{'id':_0x105248[_0xea79('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xea79('0x3a')}]},_0x3e83ac={};_0x3e83ac['model']=_[_0xea79('0x41')](db[_0xea79('0x3c')][_0xea79('0x54')]);_0x3e83ac[_0xea79('0x40')]=_[_0xea79('0x41')](_0x105248[_0xea79('0x40')]);_0x3e83ac[_0xea79('0x4b')]=_[_0xea79('0x42')](_0x3e83ac['model'],_0x3e83ac['query']);_0x96ede1[_0xea79('0x43')]=_[_0xea79('0x42')](_0x3e83ac[_0xea79('0x3f')],qs[_0xea79('0x44')](_0x105248[_0xea79('0x40')][_0xea79('0x44')]));_0x96ede1[_0xea79('0x43')]=_0x96ede1[_0xea79('0x43')][_0xea79('0x45')]?_0x96ede1[_0xea79('0x43')]:_0x3e83ac[_0xea79('0x3f')];if(_0x105248[_0xea79('0x40')][_0xea79('0x50')]){_0x96ede1[_0xea79('0x55')]=[{'all':!![]}];}_0x96ede1=_['merge']({},_0x96ede1,_0x105248['options']);return db[_0xea79('0x3c')][_0xea79('0x56')](_0x96ede1)[_0xea79('0x1d')](handleEntityNotFound(_0x19a48c,null))[_0xea79('0x1d')](respondWithResult(_0x19a48c,null))[_0xea79('0x28')](handleError(_0x19a48c,null));};exports[_0xea79('0x57')]=function(_0x594cf1,_0x25bdf2){return db[_0xea79('0x3c')][_0xea79('0x57')](_0x594cf1[_0xea79('0x58')],{})['then'](function(_0x27fc52){var _0x3ef6f6=_0x594cf1[_0xea79('0x59')][_0xea79('0x5a')]({'plain':!![]});if(!_0x3ef6f6)throw new Error(_0xea79('0x5b'));if(_0x3ef6f6[_0xea79('0x5c')]===_0xea79('0x59')){var _0x40c60b=_0x27fc52[_0xea79('0x5a')]({'plain':!![]});var _0xfa5c24=_0xea79('0x32');return db[_0xea79('0x5d')][_0xea79('0x56')]({'where':{'name':_0xfa5c24,'userProfileId':_0x3ef6f6[_0xea79('0x5e')]},'raw':!![]})[_0xea79('0x1d')](function(_0x5041b4){if(_0x5041b4&&_0x5041b4[_0xea79('0x5f')]===0x0){return db[_0xea79('0x33')][_0xea79('0x57')]({'name':_0x40c60b[_0xea79('0x36')],'resourceId':_0x40c60b['id'],'type':_0x5041b4[_0xea79('0x36')],'sectionId':_0x5041b4['id']},{})[_0xea79('0x1d')](function(){return _0x27fc52;});}else{return _0x27fc52;}})['catch'](function(_0x6e24e9){logger['error'](_0xea79('0x60'),_0x6e24e9);throw _0x6e24e9;});}return _0x27fc52;})['then'](respondWithResult(_0x25bdf2,0xc9))[_0xea79('0x28')](handleError(_0x25bdf2,null));};exports[_0xea79('0x30')]=function(_0x5cb8c0,_0x584d63){if(_0x5cb8c0[_0xea79('0x58')]['id']){delete _0x5cb8c0[_0xea79('0x58')]['id'];}return db['OpenchannelAccount'][_0xea79('0x56')]({'where':{'id':_0x5cb8c0[_0xea79('0x53')]['id']},'include':[{'model':db[_0xea79('0x39')],'as':_0xea79('0x3a')}]})['then'](handleEntityNotFound(_0x584d63,null))[_0xea79('0x1d')](saveUpdates(_0x5cb8c0['body'],null))[_0xea79('0x1d')](respondWithResult(_0x584d63,null))[_0xea79('0x28')](handleError(_0x584d63,null));};exports[_0xea79('0x31')]=function(_0x3ea6a5,_0x4b9061){return db[_0xea79('0x3c')]['find']({'where':{'id':_0x3ea6a5[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x4b9061,null))[_0xea79('0x1d')](removeEntity(_0x4b9061,null))['catch'](handleError(_0x4b9061,null));};exports[_0xea79('0x61')]=function(_0x176676,_0x1bf60b){return db[_0xea79('0x3c')]['describe']()[_0xea79('0x1d')](respondWithResult(_0x1bf60b,null))[_0xea79('0x28')](handleError(_0x1bf60b,null));};exports[_0xea79('0x62')]=function(_0x3831d6,_0x7b0076,_0x55c5d3){if(_0x3831d6[_0xea79('0x58')]['id']){delete _0x3831d6[_0xea79('0x58')]['id'];}return db['OpenchannelAccount'][_0xea79('0x56')]({'where':{'id':_0x3831d6['params']['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x7b0076,null))[_0xea79('0x1d')](function(_0x371747){if(_0x371747){_0x3831d6[_0xea79('0x58')]['OpenchannelAccountId']=_0x371747['id'];return db[_0xea79('0x63')][_0xea79('0x57')](_0x3831d6[_0xea79('0x58')]);}})[_0xea79('0x1d')](respondWithResult(_0x7b0076,null))[_0xea79('0x28')](handleError(_0x7b0076,null));};exports[_0xea79('0x64')]=function(_0x44b204,_0x1d354f,_0x4685dd){var _0x4a566c={'raw':![],'where':{}};var _0x11b043={};var _0x3d3b90={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x44b204[_0xea79('0x53')]['id']}})['then'](handleEntityNotFound(_0x1d354f,null))[_0xea79('0x1d')](function(_0x3035e4){if(_0x3035e4){_0x11b043[_0xea79('0x3f')]=_['keys'](db[_0xea79('0x63')][_0xea79('0x54')]);_0x11b043[_0xea79('0x40')]=_[_0xea79('0x41')](_0x44b204[_0xea79('0x40')]);_0x11b043[_0xea79('0x4b')]=_[_0xea79('0x42')](_0x11b043[_0xea79('0x3f')],_0x11b043[_0xea79('0x40')]);_0x4a566c[_0xea79('0x43')]=_[_0xea79('0x42')](_0x11b043[_0xea79('0x3f')],qs['fields'](_0x44b204[_0xea79('0x40')]['fields']));_0x4a566c[_0xea79('0x43')]=_0x4a566c[_0xea79('0x43')][_0xea79('0x45')]?_0x4a566c[_0xea79('0x43')]:_0x11b043[_0xea79('0x3f')];if(!_0x44b204[_0xea79('0x40')][_0xea79('0x65')](_0xea79('0x46'))){_0x4a566c[_0xea79('0x2c')]=qs[_0xea79('0x2c')](_0x44b204[_0xea79('0x40')]['limit']);_0x4a566c[_0xea79('0x2d')]=qs[_0xea79('0x2d')](_0x44b204[_0xea79('0x40')][_0xea79('0x2d')]);}_0x4a566c[_0xea79('0x47')]=qs['sort'](_0x44b204[_0xea79('0x40')][_0xea79('0x48')]);_0x4a566c['where']=qs[_0xea79('0x4b')](_[_0xea79('0x4a')](_0x44b204[_0xea79('0x40')],_0x11b043[_0xea79('0x4b')]));_0x4a566c['where']['OpenchannelAccountId']=_0x3035e4['id'];if(_0x44b204['query'][_0xea79('0x4c')]){_0x4a566c['where']=_[_0xea79('0x4d')](_0x4a566c[_0xea79('0x49')],{'$or':_[_0xea79('0x3b')](_0x4a566c[_0xea79('0x43')],function(_0x49ff6a){var _0x234b13={};_0x234b13[_0x49ff6a]={'$like':'%'+_0x44b204[_0xea79('0x40')][_0xea79('0x4c')]+'%'};return _0x234b13;})});}_0x4a566c=_[_0xea79('0x4d')]({},_0x4a566c,_0x44b204[_0xea79('0x4e')]);return db['Disposition'][_0xea79('0x4f')]({'where':_0x4a566c['where']})[_0xea79('0x1d')](function(_0x2387d6){_0x3d3b90[_0xea79('0x4f')]=_0x2387d6;if(_0x44b204['query'][_0xea79('0x50')]){_0x4a566c[_0xea79('0x55')]=[{'all':!![]}];}return db[_0xea79('0x63')][_0xea79('0x51')](_0x4a566c);})['then'](function(_0x55383c){_0x3d3b90[_0xea79('0x52')]=_0x55383c;return _0x3d3b90;});}})['then'](respondWithFilteredResult(_0x1d354f,_0x4a566c))['catch'](handleError(_0x1d354f,null));};exports[_0xea79('0x66')]=function(_0xc669e7,_0x259691,_0x534f91){return db[_0xea79('0x3c')][_0xea79('0x56')]({'where':{'id':_0xc669e7[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x259691,null))[_0xea79('0x1d')](function(_0x121532){if(_0x121532){return _0x121532[_0xea79('0x66')](_0xc669e7[_0xea79('0x40')][_0xea79('0x67')]);}})[_0xea79('0x1d')](respondWithStatusCode(_0x259691,null))[_0xea79('0x28')](handleError(_0x259691,null));};exports['addAnswer']=function(_0x26ad19,_0x729d4,_0x2c7a5e){if(_0x26ad19[_0xea79('0x58')]['id']){delete _0x26ad19[_0xea79('0x58')]['id'];}return db[_0xea79('0x3c')][_0xea79('0x56')]({'where':{'id':_0x26ad19[_0xea79('0x53')]['id']}})['then'](handleEntityNotFound(_0x729d4,null))[_0xea79('0x1d')](function(_0x6b9eab){if(_0x6b9eab){_0x26ad19['body'][_0xea79('0x68')]=_0x6b9eab['id'];return db[_0xea79('0x69')][_0xea79('0x57')](_0x26ad19[_0xea79('0x58')]);}})[_0xea79('0x1d')](respondWithResult(_0x729d4,null))[_0xea79('0x28')](handleError(_0x729d4,null));};exports[_0xea79('0x6a')]=function(_0x5b9213,_0x122666,_0x5e19c3){var _0x5de725={'raw':![],'where':{}};var _0x2ed180={};var _0x4c7e41={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5b9213[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x122666,null))['then'](function(_0x143d04){if(_0x143d04){_0x2ed180[_0xea79('0x3f')]=_['keys'](db[_0xea79('0x69')][_0xea79('0x54')]);_0x2ed180[_0xea79('0x40')]=_[_0xea79('0x41')](_0x5b9213['query']);_0x2ed180[_0xea79('0x4b')]=_[_0xea79('0x42')](_0x2ed180['model'],_0x2ed180['query']);_0x5de725['attributes']=_[_0xea79('0x42')](_0x2ed180[_0xea79('0x3f')],qs[_0xea79('0x44')](_0x5b9213['query']['fields']));_0x5de725['attributes']=_0x5de725[_0xea79('0x43')][_0xea79('0x45')]?_0x5de725[_0xea79('0x43')]:_0x2ed180[_0xea79('0x3f')];if(!_0x5b9213[_0xea79('0x40')][_0xea79('0x65')](_0xea79('0x46'))){_0x5de725['limit']=qs[_0xea79('0x2c')](_0x5b9213[_0xea79('0x40')][_0xea79('0x2c')]);_0x5de725['offset']=qs['offset'](_0x5b9213[_0xea79('0x40')][_0xea79('0x2d')]);}_0x5de725[_0xea79('0x47')]=qs['sort'](_0x5b9213[_0xea79('0x40')]['sort']);_0x5de725['where']=qs[_0xea79('0x4b')](_['pick'](_0x5b9213[_0xea79('0x40')],_0x2ed180[_0xea79('0x4b')]));_0x5de725[_0xea79('0x49')]['OpenchannelAccountId']=_0x143d04['id'];if(_0x5b9213[_0xea79('0x40')][_0xea79('0x4c')]){_0x5de725[_0xea79('0x49')]=_[_0xea79('0x4d')](_0x5de725[_0xea79('0x49')],{'$or':_[_0xea79('0x3b')](_0x5de725[_0xea79('0x43')],function(_0x509bb5){var _0x385541={};_0x385541[_0x509bb5]={'$like':'%'+_0x5b9213[_0xea79('0x40')][_0xea79('0x4c')]+'%'};return _0x385541;})});}_0x5de725=_[_0xea79('0x4d')]({},_0x5de725,_0x5b9213[_0xea79('0x4e')]);return db[_0xea79('0x69')]['count']({'where':_0x5de725[_0xea79('0x49')]})[_0xea79('0x1d')](function(_0x15c6a6){_0x4c7e41[_0xea79('0x4f')]=_0x15c6a6;if(_0x5b9213[_0xea79('0x40')][_0xea79('0x50')]){_0x5de725[_0xea79('0x55')]=[{'all':!![]}];}return db[_0xea79('0x69')][_0xea79('0x51')](_0x5de725);})['then'](function(_0x1da1a7){_0x4c7e41['rows']=_0x1da1a7;return _0x4c7e41;});}})[_0xea79('0x1d')](respondWithFilteredResult(_0x122666,_0x5de725))['catch'](handleError(_0x122666,null));};exports[_0xea79('0x6b')]=function(_0x2390fd,_0x1e6daa,_0x80ae93){return db[_0xea79('0x3c')][_0xea79('0x56')]({'where':{'id':_0x2390fd[_0xea79('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e6daa,null))[_0xea79('0x1d')](function(_0x24cbac){if(_0x24cbac){return _0x24cbac[_0xea79('0x6b')](_0x2390fd[_0xea79('0x40')][_0xea79('0x67')]);}})[_0xea79('0x1d')](respondWithStatusCode(_0x1e6daa,null))['catch'](handleError(_0x1e6daa,null));};exports[_0xea79('0x6c')]=function(_0x3e9aeb,_0x735d40,_0x55b1eb){var _0x4c7ffc={'body':_0x3e9aeb[_0xea79('0x58')],'channel':_0xea79('0x6d')};var _0x5b1ead=[];var _0x4eda99=[];var _0x989b8a={};var _0x4fb509=![];return db[_0xea79('0x6e')][_0xea79('0x61')]()[_0xea79('0x1d')](function(_0x5c06d1){if(!_0x5c06d1){throw new db[(_0xea79('0x6f'))]['ValidationError'](_0xea79('0x70'));}_0x5b1ead=_[_0xea79('0x71')](_[_0xea79('0x41')](_0x5c06d1),[_0xea79('0x72'),_0xea79('0x73')]);_0x4eda99=_[_0xea79('0x71')](_[_0xea79('0x41')](_0x5c06d1),[_0xea79('0x72'),_0xea79('0x73'),_0xea79('0x74'),_0xea79('0x75')]);if(_0x3e9aeb[_0xea79('0x58')]['id']){delete _0x3e9aeb[_0xea79('0x58')]['id'];}if(_['isNil'](_0x3e9aeb['body']['from'])){throw new db[(_0xea79('0x6f'))][(_0xea79('0x76'))](_0xea79('0x77'));}if(_['isNil'](_0x3e9aeb[_0xea79('0x58')][_0xea79('0x58')])||_0x3e9aeb[_0xea79('0x58')]['body']===''){throw new db[(_0xea79('0x6f'))][(_0xea79('0x76'))](_0xea79('0x78'));}if(_[_0xea79('0x79')](_0x3e9aeb[_0xea79('0x58')][_0xea79('0x7a')])){throw new db[(_0xea79('0x6f'))][(_0xea79('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4eda99);}if(!_[_0xea79('0x7b')](_0x4eda99,_0x3e9aeb[_0xea79('0x58')]['mapKey'])){throw new db[(_0xea79('0x6f'))][(_0xea79('0x76'))](_0xea79('0x7c')+_0x4eda99);}_0x989b8a[_0x3e9aeb['body'][_0xea79('0x7a')]]=_0x3e9aeb[_0xea79('0x58')][_0xea79('0x7d')];})[_0xea79('0x1d')](function(){return db['OpenchannelAccount'][_0xea79('0x56')]({'where':{'id':_0x3e9aeb[_0xea79('0x53')]['id']},'include':[{'model':db[_0xea79('0x7e')],'as':_0xea79('0x7f'),'include':[{'model':db['CmContact'],'as':_0xea79('0x80'),'where':_0x989b8a,'limit':0x1,'order':[[_0xea79('0x73'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xea79('0x81')}]});})['then'](handleEntityNotFound(_0x735d40,null))[_0xea79('0x1d')](function(_0x222ae7){if(_0x222ae7&&_0x222ae7[_0xea79('0x7f')]){_0x4c7ffc[_0xea79('0x82')]=_0x222ae7;_0x4c7ffc[_0xea79('0x83')]=_0x222ae7[_0xea79('0x81')];_0x4c7ffc[_0xea79('0x84')]=_0x222ae7[_0xea79('0x7f')];_0x4c7ffc[_0xea79('0x83')]=_['orderBy'](_0x4c7ffc[_0xea79('0x83')],['priority'],[_0xea79('0x85')]);if(_0x4c7ffc[_0xea79('0x82')][_0xea79('0x81')]){delete _0x4c7ffc['account']['Applications'];}if(_0x4c7ffc[_0xea79('0x82')][_0xea79('0x7f')]&&_0x4c7ffc[_0xea79('0x82')][_0xea79('0x7f')]['Contacts'][_0xea79('0x45')]){return _0x4c7ffc[_0xea79('0x82')][_0xea79('0x7f')][_0xea79('0x80')][0x0];}var _0x137b0d=_['defaults'](_0x3e9aeb[_0xea79('0x58')],{'firstName':_0x3e9aeb[_0xea79('0x58')][_0xea79('0x7d')],'ListId':_0x222ae7[_0xea79('0x75')]});_0x137b0d[_0x3e9aeb['body']['mapKey']]=_0x3e9aeb[_0xea79('0x58')][_0xea79('0x7d')];return db[_0xea79('0x6e')]['create'](_0x137b0d,{'fields':_0x5b1ead,'raw':!![]});}})[_0xea79('0x1d')](handleEntityNotFound(_0x735d40,null))[_0xea79('0x1d')](function(_0x26403f){_0x4c7ffc[_0xea79('0x86')]=_0x26403f;if(_0x26403f){var _0x54f039={'ContactId':_0x26403f['id'],'OpenchannelAccountId':_0x3e9aeb[_0xea79('0x53')]['id'],'from':(_0x26403f[_0xea79('0x87')]||'')+'\x20'+(_0x26403f[_0xea79('0x88')]||'')};var _0x1cbed0={'OpenchannelAccountId':_0x3e9aeb[_0xea79('0x53')]['id'],'closed':![]};if(_0x3e9aeb[_0xea79('0x58')][_0xea79('0x89')]){_0x1cbed0[_0xea79('0x89')]=_0x3e9aeb[_0xea79('0x58')][_0xea79('0x89')];return db[_0xea79('0x8a')]['find']({'where':_0x1cbed0})[_0xea79('0x1d')](function(_0xf9db68){if(_0xf9db68){return[_0xf9db68,![]];}_0x54f039['threadId']=_0x3e9aeb['body'][_0xea79('0x89')];_0x54f039['externalUrl']=_0x3e9aeb['body'][_0xea79('0x8b')];return db[_0xea79('0x8a')][_0xea79('0x57')](_0x54f039)[_0xea79('0x1d')](function(_0xbcb8a6){return[_0xbcb8a6,!![]];});});}else{_0x1cbed0[_0xea79('0x89')]=null;}_0x1cbed0[_0xea79('0x8c')]=_0x26403f['id'];return db[_0xea79('0x8a')][_0xea79('0x56')]({'where':_0x1cbed0})['then'](function(_0x4a3019){if(_0x4a3019){return[_0x4a3019,![]];}return db[_0xea79('0x8a')][_0xea79('0x57')](_0x54f039)[_0xea79('0x1d')](function(_0x2e1568){return[_0x2e1568,!![]];});});}})[_0xea79('0x8d')](function(_0x331c27,_0x568bf8){if(_0x331c27){_0x4fb509=_0x568bf8;if(!_0x568bf8){var _0x3881f3={'from':(_0x4c7ffc[_0xea79('0x86')][_0xea79('0x87')]||'')+'\x20'+(_0x4c7ffc[_0xea79('0x86')][_0xea79('0x88')]||'')};if(_0x3e9aeb[_0xea79('0x58')]['threadId']&&_0x3e9aeb[_0xea79('0x58')]['messageId']&&_0x3e9aeb['body']['threadId']!=_0x3e9aeb[_0xea79('0x58')]['messageId']){_0x3881f3['threadId']=_0x3e9aeb['body']['messageId'];}return _0x331c27[_0xea79('0x30')](_0x3881f3);}else{return _0x331c27;}}})[_0xea79('0x1d')](function(_0x224e19){_0x4c7ffc[_0xea79('0x8e')]=_0x224e19[_0xea79('0x5a')]({'plain':!![]});_0x4c7ffc[_0xea79('0x8e')][_0xea79('0x8f')]=_0x4fb509;if(_0x4c7ffc[_0xea79('0x8e')][_0xea79('0x8f')]){if(_0x4c7ffc[_0xea79('0x82')][_0xea79('0x90')]){_0x4c7ffc[_0xea79('0x83')]['push']({'id':0x0,'priority':_0x4c7ffc[_0xea79('0x83')]['length']+0x1,'app':_0xea79('0x91'),'appdata':_0xea79('0x92'),'interval':_0xea79('0x93')});}}return db[_0xea79('0x94')][_0xea79('0x57')]({'body':_0x3e9aeb[_0xea79('0x58')][_0xea79('0x58')],'OpenchannelAccountId':_0x3e9aeb[_0xea79('0x53')]['id'],'OpenchannelInteractionId':_0x224e19['id'],'direction':'in','ContactId':_0x4c7ffc[_0xea79('0x86')]['id'],'AttachmentId':_0x3e9aeb['body'][_0xea79('0x95')]});})[_0xea79('0x1d')](function(_0x32e35c){_0x4c7ffc['message']=_0x32e35c;if(_0x4c7ffc[_0xea79('0x8e')][_0xea79('0x96')]){return db[_0xea79('0x97')]['find']({'attributes':['id',_0xea79('0x36')],'where':{'id':_0x4c7ffc[_0xea79('0x8e')][_0xea79('0x96')]}})['then'](function(_0x29c17d){if(_0x29c17d){_0x4c7ffc[_0xea79('0x83')][_0xea79('0x98')]({'id':0x0,'priority':0x0,'app':_0xea79('0x99'),'appdata':_0x29c17d[_0xea79('0x36')]+','+(_0x4c7ffc[_0xea79('0x82')][_0xea79('0x9a')]||0xa),'interval':_0xea79('0x93')});_0x4c7ffc[_0xea79('0x9b')]=![];}return respondWithRpcPromise('Start','startRouting',_0x4c7ffc);});}return respondWithRpcPromise(_0xea79('0x9c'),_0xea79('0x9d'),_0x4c7ffc);})[_0xea79('0x1d')](function(_0x45fb79){respondWithRpcPromise('EventManager',_0xea79('0x9e'),{'event':_0xea79('0x6c'),'message':_0x45fb79},client9002);return _0x45fb79;})['then'](respondWithResult(_0x735d40,null))[_0xea79('0x28')](handleError(_0x735d40,null));};exports['addApplications']=function(_0x1ebcde,_0x18cdc3){var _0x355b81=_0x1ebcde[_0xea79('0x53')]['id'];var _0xd06934=_0x1ebcde[_0xea79('0x58')];var _0x19a4ff=0xc8;var _0x16cc09=null;return db[_0xea79('0x9f')][_0xea79('0xa0')]({'isolationLevel':db[_0xea79('0x9f')]['Transaction'][_0xea79('0xa1')][_0xea79('0xa2')]},function(_0x275553){return db[_0xea79('0x3c')][_0xea79('0xa3')]({'where':{'id':_0x355b81},'transaction':_0x275553})[_0xea79('0x1d')](function(_0x48facd){if(_0x48facd){return db['OpenchannelApplication'][_0xea79('0x31')]({'where':{'OpenchannelAccountId':_0x355b81},'transaction':_0x275553})[_0xea79('0x1d')](function(){var _0x13b822=_['map'](_0xd06934,function(_0x23e38d){_0x23e38d[_0xea79('0x68')]=_0x355b81;return _0x23e38d;});return db[_0xea79('0xa4')][_0xea79('0xa5')](_0x13b822,{'transaction':_0x275553});});}else{_0x19a4ff=0x194;_0x16cc09=[];}});})[_0xea79('0x1d')](function(){if(_0x19a4ff!==0x194){return db[_0xea79('0xa4')][_0xea79('0xa6')]({'where':{'OpenchannelAccountId':_0x355b81},'order':'priority'})[_0xea79('0x1d')](function(_0xdb83ad){_0x16cc09=_0xdb83ad;});}})['catch'](function(_0xb53743){_0x19a4ff=0x1f4;logger[_0xea79('0x23')](_0xb53743[_0xea79('0x35')]);if(_0xb53743[_0xea79('0x36')]){delete _0xb53743[_0xea79('0x36')];}_0x16cc09=_0xb53743;})[_0xea79('0xa7')](function(){if(_0x16cc09===null){_0x18cdc3[_0xea79('0x29')](_0x19a4ff);}else{if(_0x19a4ff===0x1f4){_0x18cdc3[_0xea79('0x2a')](_0x19a4ff)[_0xea79('0x37')](_0x16cc09);}else{_0x18cdc3['status'](_0x19a4ff)[_0xea79('0x2b')](_0x16cc09);}}});};exports[_0xea79('0xa8')]=function(_0x314c83,_0x3e46af,_0x3ad4fb){var _0x5cf284={};var _0x4cc643={};var _0x18218d;var _0xa67138;return db[_0xea79('0x3c')][_0xea79('0xa3')]({'where':{'id':_0x314c83[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x3e46af,null))[_0xea79('0x1d')](function(_0x348b41){if(_0x348b41){_0x18218d=_0x348b41;_0x4cc643['model']=_['keys'](db[_0xea79('0xa4')][_0xea79('0x54')]);_0x4cc643['query']=_[_0xea79('0x41')](_0x314c83[_0xea79('0x40')]);_0x4cc643[_0xea79('0x4b')]=_['intersection'](_0x4cc643[_0xea79('0x3f')],_0x4cc643[_0xea79('0x40')]);_0x5cf284[_0xea79('0x43')]=_['intersection'](_0x4cc643[_0xea79('0x3f')],qs['fields'](_0x314c83[_0xea79('0x40')]['fields']));_0x5cf284['attributes']=_0x5cf284[_0xea79('0x43')][_0xea79('0x45')]?_0x5cf284[_0xea79('0x43')]:_0x4cc643[_0xea79('0x3f')];_0x5cf284['order']=qs['sort'](_0x314c83[_0xea79('0x40')][_0xea79('0x48')]);_0x5cf284[_0xea79('0x49')]=qs[_0xea79('0x4b')](_[_0xea79('0x4a')](_0x314c83[_0xea79('0x40')],_0x4cc643[_0xea79('0x4b')]));if(_0x314c83[_0xea79('0x40')][_0xea79('0x4c')]){_0x5cf284['where']=_[_0xea79('0x4d')](_0x5cf284[_0xea79('0x49')],{'$or':_[_0xea79('0x3b')](_0x5cf284[_0xea79('0x43')],function(_0x7e498d){var _0x32ff71={};_0x32ff71[_0x7e498d]={'$like':'%'+_0x314c83[_0xea79('0x40')]['filter']+'%'};return _0x32ff71;})});}_0x5cf284=_[_0xea79('0x4d')]({},_0x5cf284,_0x314c83[_0xea79('0x4e')]);return _0x18218d[_0xea79('0xa8')](_0x5cf284);}})[_0xea79('0x1d')](function(_0x121c6f){if(_0x121c6f){_0xa67138=_0x121c6f[_0xea79('0x45')];if(!_0x314c83[_0xea79('0x40')][_0xea79('0x65')](_0xea79('0x46'))){_0x5cf284[_0xea79('0x2c')]=qs[_0xea79('0x2c')](_0x314c83[_0xea79('0x40')][_0xea79('0x2c')]);_0x5cf284[_0xea79('0x2d')]=qs[_0xea79('0x2d')](_0x314c83['query'][_0xea79('0x2d')]);}return _0x18218d[_0xea79('0xa8')](_0x5cf284);}})[_0xea79('0x1d')](function(_0x3896ad){if(_0x3896ad){return _0x3896ad?{'count':_0xa67138,'rows':_0x3896ad}:null;}})[_0xea79('0x1d')](respondWithResult(_0x3e46af,null))[_0xea79('0x28')](handleError(_0x3e46af,null));};exports[_0xea79('0xa9')]=function(_0xa65665,_0x5e887a,_0x436159){var _0x36d1d9={'raw':![],'where':{}};var _0xe4955={};var _0x36afd9={'count':0x0,'rows':[]};return db[_0xea79('0x3c')][_0xea79('0xa3')]({'where':{'id':_0xa65665[_0xea79('0x53')]['id']}})['then'](handleEntityNotFound(_0x5e887a,null))['then'](function(_0x4453b5){if(_0x4453b5){_0xe4955[_0xea79('0x3f')]=_[_0xea79('0x41')](db[_0xea79('0x8a')][_0xea79('0x54')]);_0xe4955[_0xea79('0x40')]=_[_0xea79('0x41')](_0xa65665['query']);_0xe4955[_0xea79('0x4b')]=_[_0xea79('0x42')](_0xe4955[_0xea79('0x3f')],_0xe4955[_0xea79('0x40')]);_0x36d1d9[_0xea79('0x43')]=_[_0xea79('0x42')](_0xe4955[_0xea79('0x3f')],qs['fields'](_0xa65665[_0xea79('0x40')]['fields']));_0x36d1d9[_0xea79('0x43')]=_0x36d1d9['attributes'][_0xea79('0x45')]?_0x36d1d9['attributes']:_0xe4955['model'];if(!_0xa65665[_0xea79('0x40')][_0xea79('0x65')](_0xea79('0x46'))){_0x36d1d9[_0xea79('0x2c')]=qs[_0xea79('0x2c')](_0xa65665['query'][_0xea79('0x2c')]);_0x36d1d9[_0xea79('0x2d')]=qs[_0xea79('0x2d')](_0xa65665[_0xea79('0x40')][_0xea79('0x2d')]);}_0x36d1d9['order']=qs['sort'](_0xa65665[_0xea79('0x40')][_0xea79('0x48')]);_0x36d1d9[_0xea79('0x49')]=qs['filters'](_[_0xea79('0x4a')](_0xa65665[_0xea79('0x40')],_0xe4955[_0xea79('0x4b')]));_0x36d1d9[_0xea79('0x49')][_0xea79('0x68')]=_0x4453b5['id'];if(_0xa65665[_0xea79('0x40')][_0xea79('0x4c')]){_0x36d1d9[_0xea79('0x49')]=_[_0xea79('0x4d')](_0x36d1d9[_0xea79('0x49')],{'$or':_[_0xea79('0x3b')](_0x36d1d9[_0xea79('0x43')],function(_0x578312){var _0x139a8f={};_0x139a8f[_0x578312]={'$like':'%'+_0xa65665['query']['filter']+'%'};return _0x139a8f;})});}_0x36d1d9=_[_0xea79('0x4d')]({},_0x36d1d9,_0xa65665['options']);return db[_0xea79('0x8a')][_0xea79('0x4f')]({'where':_0x36d1d9[_0xea79('0x49')]})['then'](function(_0x288e75){_0x36afd9[_0xea79('0x4f')]=_0x288e75;if(_0xa65665[_0xea79('0x40')][_0xea79('0x50')]){_0x36d1d9['include']=[{'model':db[_0xea79('0x6e')],'as':_0xea79('0xaa'),'required':![]},{'model':db[_0xea79('0x97')],'as':'Owner','attributes':['name',_0xea79('0xab'),_0xea79('0xac')],'required':![]},{'model':db[_0xea79('0xad')],'as':_0xea79('0xae'),'attributes':['id','name',_0xea79('0xaf')],'where':_0xa65665[_0xea79('0x40')]['tag']?{'id':_0xa65665[_0xea79('0x40')][_0xea79('0xb0')]}:undefined,'required':_0xa65665[_0xea79('0x40')]['tag']?!![]:![]}];}return db[_0xea79('0x8a')][_0xea79('0x51')](_0x36d1d9);})[_0xea79('0x1d')](function(_0x454db1){_0x36afd9[_0xea79('0x52')]=_0x454db1;return _0x36afd9;});}})[_0xea79('0x1d')](respondWithFilteredResult(_0x5e887a,_0x36d1d9))[_0xea79('0x28')](handleError(_0x5e887a,null));};exports[_0xea79('0xb1')]=function(_0x22c4b8,_0x2aa8f6,_0xa59806){return db[_0xea79('0x3c')][_0xea79('0x56')]({'where':{'id':_0x22c4b8[_0xea79('0x53')]['id']}})['then'](handleEntityNotFound(_0x2aa8f6,null))[_0xea79('0x1d')](function(_0x461bed){if(_0x461bed){return _0x461bed[_0xea79('0xb1')](_0x22c4b8['body'][_0xea79('0x67')],_[_0xea79('0xb2')](_0x22c4b8[_0xea79('0x58')],[_0xea79('0x67'),'id'])||{})['spread'](function(_0x10d682){for(var _0x109e9f=0x0;_0x109e9f<_0x22c4b8[_0xea79('0x58')][_0xea79('0x67')][_0xea79('0x45')];_0x109e9f+=0x1){socket[_0xea79('0xb3')](_0xea79('0xb4'),{'UserId':Number(_0x22c4b8['body']['ids'][_0x109e9f]),'OpenchannelAccountId':Number(_0x22c4b8['params']['id'])});}return _0x10d682;});}})[_0xea79('0x1d')](respondWithResult(_0x2aa8f6,null))[_0xea79('0x28')](handleError(_0x2aa8f6,null));};exports[_0xea79('0xb5')]=function(_0x50dc22,_0x3b96a0,_0x713bd2){return db['OpenchannelAccount']['find']({'where':{'id':_0x50dc22[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x3b96a0,null))[_0xea79('0x1d')](function(_0x538ca0){if(_0x538ca0){return _0x538ca0[_0xea79('0xb5')](_0x50dc22[_0xea79('0x40')][_0xea79('0x67')])['then'](function(){if(_['isArray'](_0x50dc22[_0xea79('0x40')][_0xea79('0x67')])){for(var _0x485777=0x0;_0x485777<_0x50dc22[_0xea79('0x40')][_0xea79('0x67')][_0xea79('0x45')];_0x485777+=0x1){socket[_0xea79('0xb3')](_0xea79('0xb6'),{'UserId':Number(_0x50dc22[_0xea79('0x40')][_0xea79('0x67')][_0x485777]),'OpenchannelAccountId':Number(_0x50dc22['params']['id'])});}}else{socket[_0xea79('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x50dc22['query']['ids']),'OpenchannelAccountId':Number(_0x50dc22[_0xea79('0x53')]['id'])});}});}})[_0xea79('0x1d')](respondWithStatusCode(_0x3b96a0,null))['catch'](handleError(_0x3b96a0,null));};exports['getAgents']=function(_0x2a3edf,_0x422006,_0x12850c){var _0x47f3cf={};var _0x4e0d73={};var _0x323f44;var _0x44ea4d;return db[_0xea79('0x3c')]['findOne']({'where':{'id':_0x2a3edf[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x422006,null))['then'](function(_0x28d568){if(_0x28d568){_0x323f44=_0x28d568;_0x4e0d73[_0xea79('0x3f')]=_['keys'](db[_0xea79('0x97')][_0xea79('0x54')]);_0x4e0d73['query']=_[_0xea79('0x41')](_0x2a3edf[_0xea79('0x40')]);_0x4e0d73[_0xea79('0x4b')]=_[_0xea79('0x42')](_0x4e0d73[_0xea79('0x3f')],_0x4e0d73['query']);_0x47f3cf['attributes']=_[_0xea79('0x42')](_0x4e0d73['model'],qs[_0xea79('0x44')](_0x2a3edf[_0xea79('0x40')]['fields']));_0x47f3cf[_0xea79('0x43')]=_0x47f3cf[_0xea79('0x43')][_0xea79('0x45')]?_0x47f3cf[_0xea79('0x43')]:_0x4e0d73[_0xea79('0x3f')];_0x47f3cf['order']=qs[_0xea79('0x48')](_0x2a3edf[_0xea79('0x40')][_0xea79('0x48')]);_0x47f3cf[_0xea79('0x49')]=qs[_0xea79('0x4b')](_[_0xea79('0x4a')](_0x2a3edf[_0xea79('0x40')],_0x4e0d73['filters']));if(_0x2a3edf[_0xea79('0x40')]['filter']){_0x47f3cf[_0xea79('0x49')]=_['merge'](_0x47f3cf[_0xea79('0x49')],{'$or':_[_0xea79('0x3b')](_0x47f3cf[_0xea79('0x43')],function(_0x2bb75d){var _0x874008={};_0x874008[_0x2bb75d]={'$like':'%'+_0x2a3edf[_0xea79('0x40')]['filter']+'%'};return _0x874008;})});}_0x47f3cf=_[_0xea79('0x4d')]({},_0x47f3cf,_0x2a3edf[_0xea79('0x4e')]);return _0x323f44['getAgents'](_0x47f3cf);}})['then'](function(_0x8a4e3e){if(_0x8a4e3e){_0x44ea4d=_0x8a4e3e['length'];if(!_0x2a3edf[_0xea79('0x40')][_0xea79('0x65')]('nolimit')){_0x47f3cf['limit']=qs[_0xea79('0x2c')](_0x2a3edf[_0xea79('0x40')][_0xea79('0x2c')]);_0x47f3cf[_0xea79('0x2d')]=qs[_0xea79('0x2d')](_0x2a3edf['query']['offset']);}return _0x323f44[_0xea79('0xb7')](_0x47f3cf);}})[_0xea79('0x1d')](function(_0x4284c0){if(_0x4284c0){return _0x4284c0?{'count':_0x44ea4d,'rows':_0x4284c0}:null;}})[_0xea79('0x1d')](respondWithResult(_0x422006,null))[_0xea79('0x28')](handleError(_0x422006,null));};exports[_0xea79('0x37')]=function(_0x53ed5f,_0x4032c8,_0x2dc9f5){var _0x2c60eb,_0x1459f8,_0x19b310;if(_[_0xea79('0x79')](_0x53ed5f[_0xea79('0x58')][_0xea79('0x58')])||_0x53ed5f[_0xea79('0x58')][_0xea79('0x58')]===''){throw new db[(_0xea79('0x6f'))][(_0xea79('0x76'))](_0xea79('0x78'));}if(_['isNil'](_0x53ed5f[_0xea79('0x58')]['to'])){}_0x2c60eb=_0x53ed5f[_0xea79('0x58')]['to'];return db[_0xea79('0x3c')][_0xea79('0xa3')]({'where':{'id':_0x53ed5f[_0xea79('0x53')]['id']}})[_0xea79('0x1d')](handleEntityNotFound(_0x4032c8,null))[_0xea79('0x1d')](function(_0x28b2d2){if(_0x28b2d2){return db[_0xea79('0x3c')][_0xea79('0x56')]({'where':{'id':_0x28b2d2['id']},'include':[{'model':db[_0xea79('0x7e')],'as':_0xea79('0x7f'),'include':[{'model':db[_0xea79('0x6e')],'as':_0xea79('0x80'),'where':{[_0x28b2d2[_0xea79('0x7a')]]:_0x2c60eb},'limit':0x1,'order':[[_0xea79('0x73'),_0xea79('0xb8')]]}]}]})[_0xea79('0x1d')](handleEntityNotFound(_0x4032c8,null))[_0xea79('0x1d')](function(_0x3d936c){if(_0x3d936c&&_0x3d936c['List']){_0x1459f8=_0x3d936c[_0xea79('0x5a')]({'plain':!![]});if(_0x1459f8['List']&&_0x1459f8['List']['Contacts']['length']){return _0x1459f8[_0xea79('0x7f')][_0xea79('0x80')][0x0];}return db['CmContact'][_0xea79('0x57')](_[_0xea79('0xb9')](_0x53ed5f[_0xea79('0x58')],{'firstName':_0x2c60eb,[_0x3d936c[_0xea79('0x7a')]]:_0x2c60eb,'phone':_0x2c60eb,'ListId':_0x1459f8[_0xea79('0x75')]}));}})[_0xea79('0x1d')](handleEntityNotFound(_0x4032c8,null))[_0xea79('0x1d')](function(_0x2d8a4e){if(_0x2d8a4e){_0x19b310=_0x2d8a4e;return db[_0xea79('0x8a')]['find']({'where':{'ContactId':_0x19b310['id'],'closed':![],'OpenchannelAccountId':_0x1459f8['id']}})['then'](function(_0x23ac4e){if(_0x23ac4e){return[_0x23ac4e,![]];}return db[_0xea79('0x8a')][_0xea79('0x57')]({'UserId':_0x53ed5f[_0xea79('0x59')]['id'],'ContactId':_0x19b310['id'],'OpenchannelAccountId':_0x1459f8['id'],'lastMsgDirection':_0xea79('0xba'),'firstMsgDirection':'out','Messages':[_[_0xea79('0x4d')](_0x53ed5f['body'],{'read':![],'body':_0x53ed5f[_0xea79('0x58')][_0xea79('0x58')],'OpenchannelAccountId':_0x1459f8['id'],'UserId':_0x53ed5f[_0xea79('0x59')]['id'],'ContactId':_0x19b310['id']})]},{'include':[{'model':db[_0xea79('0x94')],'as':_0xea79('0xbb')}]})[_0xea79('0x1d')](function(_0x35714a){return[_0x35714a,!![]];});});}})[_0xea79('0x8d')](function(_0x1dc366,_0x3c8fc4){if(_0x3c8fc4){return _0x1dc366;}return db[_0xea79('0x94')][_0xea79('0x57')](_['merge'](_0x53ed5f[_0xea79('0x58')],{'read':![],'body':_0x53ed5f[_0xea79('0x58')][_0xea79('0x58')],'OpenchannelAccountId':_0x1459f8['id'],'OpenchannelInteractionId':_0x1dc366['id'],'UserId':_0x53ed5f[_0xea79('0x59')]['id'],'ContactId':_0x19b310['id']}))[_0xea79('0x1d')](function(_0x1982f2){_0x1dc366[_0xea79('0xbc')][_0xea79('0xbb')]=[];_0x1dc366[_0xea79('0xbc')][_0xea79('0xbb')][_0xea79('0xbd')](_0x1982f2[_0xea79('0xbc')]);return _0x1dc366;});});}})[_0xea79('0x1d')](respondWithResult(_0x4032c8,null))[_0xea79('0x28')](handleError(_0x4032c8,null));}; \ No newline at end of file +var _0x661c=['params','keys','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','Contact','fullname','internal','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','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','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','count','include','OpenchannelAccount','findAll','rows','show'];(function(_0x11dd7e,_0x37a73e){var _0x509608=function(_0x40a010){while(--_0x40a010){_0x11dd7e['push'](_0x11dd7e['shift']());}};_0x509608(++_0x37a73e);}(_0x661c,0x122));var _0xc661=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x661c[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xc661('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc661('0x1'));var rp=require('request-promise');var moment=require(_0xc661('0x2'));var BPromise=require(_0xc661('0x3'));var Mustache=require(_0xc661('0x4'));var util=require(_0xc661('0x5'));var path=require(_0xc661('0x6'));var sox=require(_0xc661('0x7'));var csv=require(_0xc661('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc661('0x9'));var squel=require('squel');var crypto=require(_0xc661('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc661('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc661('0xc'));var Papa=require(_0xc661('0xd'));var Redis=require(_0xc661('0xe'));var authService=require(_0xc661('0xf'));var qs=require(_0xc661('0x10'));var as=require(_0xc661('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc661('0x12'))('api');var utils=require(_0xc661('0x13'));var config=require(_0xc661('0x14'));var licenseUtil=require(_0xc661('0x15'));var db=require(_0xc661('0x16'))['db'];config['redis']=_[_0xc661('0x17')](config[_0xc661('0x18')],{'host':_0xc661('0x19'),'port':0x18eb});var socket=require(_0xc661('0x1a'))(new Redis(config['redis']));require(_0xc661('0x1b'))[_0xc661('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc661('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc661('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2223ff,_0x5565f1,_0x518b08,_0x3587b8){return new BPromise(function(_0x52a291,_0x52dcfc){var _0x437eae=_0x3587b8||client;return _0x437eae['request'](_0x2223ff,_0x518b08)[_0xc661('0x1f')](function(_0x39e90a){logger[_0xc661('0x20')](_0xc661('0x21'),_0x5565f1,_0xc661('0x22'));logger[_0xc661('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5565f1,_0xc661('0x22'),JSON['stringify'](_0x39e90a));if(_0x39e90a[_0xc661('0x24')]){if(_0x39e90a[_0xc661('0x24')]['code']===0x1f4){logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);return _0x52dcfc(_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);}logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);return _0x52a291(_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);}else{logger[_0xc661('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5565f1,_0xc661('0x22'));_0x52a291(_0x39e90a[_0xc661('0x26')]['message']);}})[_0xc661('0x27')](function(_0x3eb48d){logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x3eb48d);_0x52dcfc(_0x3eb48d);});});}function respondWithStatusCode(_0x2072e9,_0x245e42){_0x245e42=_0x245e42||0xcc;return function(_0x564bce){if(_0x564bce){return _0x2072e9[_0xc661('0x28')](_0x245e42);}return _0x2072e9['status'](_0x245e42)[_0xc661('0x29')]();};}function respondWithResult(_0x31d76c,_0x57d9a2){_0x57d9a2=_0x57d9a2||0xc8;return function(_0x58f9f8){if(_0x58f9f8){return _0x31d76c[_0xc661('0x2a')](_0x57d9a2)[_0xc661('0x2b')](_0x58f9f8);}};}function respondWithFilteredResult(_0x116db6,_0x5037d6){return function(_0x57d4a1){if(_0x57d4a1){var _0x2d5ab2=typeof _0x5037d6[_0xc661('0x2c')]===_0xc661('0x2d')&&typeof _0x5037d6[_0xc661('0x2e')]===_0xc661('0x2d');var _0x31da9a=_0x57d4a1['count'];var _0x17ba32=_0x2d5ab2?0x0:_0x5037d6['offset'];var _0x222092=_0x2d5ab2?_0x57d4a1['count']:_0x5037d6[_0xc661('0x2c')]+_0x5037d6[_0xc661('0x2e')];var _0x37b5f5;if(_0x222092>=_0x31da9a){_0x222092=_0x31da9a;_0x37b5f5=0xc8;}else{_0x37b5f5=0xce;}_0x116db6[_0xc661('0x2a')](_0x37b5f5);return _0x116db6[_0xc661('0x2f')](_0xc661('0x30'),_0x17ba32+'-'+_0x222092+'/'+_0x31da9a)[_0xc661('0x2b')](_0x57d4a1);}return null;};}function patchUpdates(_0x680732){return function(_0x2a6f59){try{jsonpatch[_0xc661('0x31')](_0x2a6f59,_0x680732,!![]);}catch(_0x4ccc5c){return BPromise[_0xc661('0x32')](_0x4ccc5c);}return _0x2a6f59['save']();};}function saveUpdates(_0x52493f,_0x4b6901){return function(_0x43e9ae){if(_0x43e9ae){return _0x43e9ae[_0xc661('0x33')](_0x52493f)['then'](function(_0x4b3f90){return _0x4b3f90;});}return null;};}function removeEntity(_0xac0cc6,_0x2954f3){return function(_0x17a3ae){if(_0x17a3ae){return _0x17a3ae[_0xc661('0x34')]()[_0xc661('0x1f')](function(){var _0xe4ff76=_0x17a3ae['get']({'plain':!![]});var _0x49b009='OpenchannelAccounts';return db[_0xc661('0x35')][_0xc661('0x34')]({'where':{'type':_0x49b009,'resourceId':_0xe4ff76['id']}})[_0xc661('0x1f')](function(){return _0x17a3ae;});})['then'](function(){_0xac0cc6[_0xc661('0x2a')](0xcc)[_0xc661('0x29')]();});}};}function handleEntityNotFound(_0x2fa605,_0x4a2cad){return function(_0x24bc2e){if(!_0x24bc2e){_0x2fa605[_0xc661('0x28')](0x194);}return _0x24bc2e;};}function handleError(_0x4cd027,_0x3c09ad){_0x3c09ad=_0x3c09ad||0x1f4;return function(_0x12a3e5){logger[_0xc661('0x24')](_0x12a3e5[_0xc661('0x36')]);if(_0x12a3e5['name']){delete _0x12a3e5[_0xc661('0x37')];}_0x4cd027['status'](_0x3c09ad)[_0xc661('0x38')](_0x12a3e5);};}exports[_0xc661('0x39')]=function(_0x3fef9a,_0x44ed2d){var _0x227f27={'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]},_0xe576b1={},_0x303346={'count':0x0,'rows':[]};var _0x2f470d=_[_0xc661('0x3c')](db['OpenchannelAccount'][_0xc661('0x3d')],function(_0x1ba0d5){return{'name':_0x1ba0d5[_0xc661('0x3e')],'type':_0x1ba0d5[_0xc661('0x3f')][_0xc661('0x40')]};});_0xe576b1[_0xc661('0x41')]=_['map'](_0x2f470d,_0xc661('0x37'));_0xe576b1['query']=_['keys'](_0x3fef9a[_0xc661('0x42')]);_0xe576b1['filters']=_[_0xc661('0x43')](_0xe576b1[_0xc661('0x41')],_0xe576b1[_0xc661('0x42')]);_0x227f27[_0xc661('0x44')]=_[_0xc661('0x43')](_0xe576b1[_0xc661('0x41')],qs[_0xc661('0x45')](_0x3fef9a[_0xc661('0x42')][_0xc661('0x45')]));_0x227f27[_0xc661('0x44')]=_0x227f27[_0xc661('0x44')][_0xc661('0x46')]?_0x227f27[_0xc661('0x44')]:_0xe576b1[_0xc661('0x41')];if(!_0x3fef9a[_0xc661('0x42')][_0xc661('0x47')](_0xc661('0x48'))){_0x227f27['limit']=qs['limit'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x2e')]);_0x227f27['offset']=qs['offset'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x2c')]);}_0x227f27[_0xc661('0x49')]=qs['sort'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x4a')]);_0x227f27[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_['pick'](_0x3fef9a[_0xc661('0x42')],_0xe576b1[_0xc661('0x4c')]),_0x2f470d);if(_0x3fef9a[_0xc661('0x42')][_0xc661('0x4d')]){_0x227f27[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x227f27[_0xc661('0x4b')],{'$or':_['map'](_0x2f470d,function(_0x5f52dd){if(_0x5f52dd[_0xc661('0x3f')]!==_0xc661('0x4f')){var _0x2327c7={};_0x2327c7[_0x5f52dd[_0xc661('0x37')]]={'$like':'%'+_0x3fef9a['query'][_0xc661('0x4d')]+'%'};return _0x2327c7;}})});}_0x227f27=_[_0xc661('0x4e')]({},_0x227f27,_0x3fef9a['options']);var _0x9f18a9={'where':_0x227f27[_0xc661('0x4b')]};return db['OpenchannelAccount']['count'](_0x9f18a9)[_0xc661('0x1f')](function(_0x38fb40){_0x303346[_0xc661('0x50')]=_0x38fb40;if(_0x3fef9a['query']['includeAll']){_0x227f27[_0xc661('0x51')]=[{'all':!![]}];}return db[_0xc661('0x52')][_0xc661('0x53')](_0x227f27);})['then'](function(_0x34fe31){_0x303346[_0xc661('0x54')]=_0x34fe31;return _0x303346;})[_0xc661('0x1f')](respondWithFilteredResult(_0x44ed2d,_0x227f27))[_0xc661('0x27')](handleError(_0x44ed2d,null));};exports[_0xc661('0x55')]=function(_0x3262ba,_0x5d0360){var _0x4d1b67={'raw':![],'where':{'id':_0x3262ba[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]},_0x35106f={};_0x35106f['model']=_[_0xc661('0x57')](db['OpenchannelAccount']['rawAttributes']);_0x35106f[_0xc661('0x42')]=_[_0xc661('0x57')](_0x3262ba[_0xc661('0x42')]);_0x35106f[_0xc661('0x4c')]=_['intersection'](_0x35106f[_0xc661('0x41')],_0x35106f[_0xc661('0x42')]);_0x4d1b67[_0xc661('0x44')]=_['intersection'](_0x35106f[_0xc661('0x41')],qs[_0xc661('0x45')](_0x3262ba[_0xc661('0x42')]['fields']));_0x4d1b67[_0xc661('0x44')]=_0x4d1b67[_0xc661('0x44')][_0xc661('0x46')]?_0x4d1b67[_0xc661('0x44')]:_0x35106f[_0xc661('0x41')];if(_0x3262ba[_0xc661('0x42')][_0xc661('0x58')]){_0x4d1b67[_0xc661('0x51')]=[{'all':!![]}];}_0x4d1b67=_['merge']({},_0x4d1b67,_0x3262ba[_0xc661('0x59')]);return db['OpenchannelAccount'][_0xc661('0x5a')](_0x4d1b67)[_0xc661('0x1f')](handleEntityNotFound(_0x5d0360,null))[_0xc661('0x1f')](respondWithResult(_0x5d0360,null))['catch'](handleError(_0x5d0360,null));};exports[_0xc661('0x5b')]=function(_0x594129,_0xab396e){return db[_0xc661('0x52')][_0xc661('0x5b')](_0x594129[_0xc661('0x5c')],{})['then'](function(_0x5f1d23){var _0xe221c2=_0x594129[_0xc661('0x5d')][_0xc661('0x5e')]({'plain':!![]});if(!_0xe221c2)throw new Error(_0xc661('0x5f'));if(_0xe221c2[_0xc661('0x60')]===_0xc661('0x5d')){var _0x16c3c1=_0x5f1d23[_0xc661('0x5e')]({'plain':!![]});var _0x35a9a0='OpenchannelAccounts';return db[_0xc661('0x61')][_0xc661('0x5a')]({'where':{'name':_0x35a9a0,'userProfileId':_0xe221c2[_0xc661('0x62')]},'raw':!![]})[_0xc661('0x1f')](function(_0x5dd091){if(_0x5dd091&&_0x5dd091['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16c3c1['name'],'resourceId':_0x16c3c1['id'],'type':_0x5dd091[_0xc661('0x37')],'sectionId':_0x5dd091['id']},{})[_0xc661('0x1f')](function(){return _0x5f1d23;});}else{return _0x5f1d23;}})[_0xc661('0x27')](function(_0x16bbf0){logger[_0xc661('0x24')](_0xc661('0x63'),_0x16bbf0);throw _0x16bbf0;});}return _0x5f1d23;})[_0xc661('0x1f')](respondWithResult(_0xab396e,0xc9))[_0xc661('0x27')](handleError(_0xab396e,null));};exports[_0xc661('0x33')]=function(_0x6c42e3,_0x3a3d4a){if(_0x6c42e3[_0xc661('0x5c')]['id']){delete _0x6c42e3['body']['id'];}return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x6c42e3[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]})[_0xc661('0x1f')](handleEntityNotFound(_0x3a3d4a,null))['then'](saveUpdates(_0x6c42e3['body'],null))[_0xc661('0x1f')](respondWithResult(_0x3a3d4a,null))[_0xc661('0x27')](handleError(_0x3a3d4a,null));};exports['destroy']=function(_0x539901,_0x3210f1){return db[_0xc661('0x52')]['find']({'where':{'id':_0x539901[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x3210f1,null))['then'](removeEntity(_0x3210f1,null))[_0xc661('0x27')](handleError(_0x3210f1,null));};exports[_0xc661('0x64')]=function(_0x3acbe9,_0x3aa301){return db[_0xc661('0x52')]['describe']()[_0xc661('0x1f')](respondWithResult(_0x3aa301,null))[_0xc661('0x27')](handleError(_0x3aa301,null));};exports[_0xc661('0x65')]=function(_0x4ff589,_0x2a847a,_0x28fe39){if(_0x4ff589[_0xc661('0x5c')]['id']){delete _0x4ff589[_0xc661('0x5c')]['id'];}return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x4ff589[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x2a847a,null))[_0xc661('0x1f')](function(_0x5bfa68){if(_0x5bfa68){_0x4ff589[_0xc661('0x5c')][_0xc661('0x66')]=_0x5bfa68['id'];return db['Disposition'][_0xc661('0x5b')](_0x4ff589[_0xc661('0x5c')]);}})[_0xc661('0x1f')](respondWithResult(_0x2a847a,null))[_0xc661('0x27')](handleError(_0x2a847a,null));};exports[_0xc661('0x67')]=function(_0x376e69,_0x5cb80d,_0x108ab7){var _0x2c1f1a={'raw':![],'where':{}};var _0x5525f4={};var _0x211e30={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x376e69['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x5cb80d,null))['then'](function(_0x3fa513){if(_0x3fa513){_0x5525f4[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x69')][_0xc661('0x3d')]);_0x5525f4[_0xc661('0x42')]=_[_0xc661('0x57')](_0x376e69[_0xc661('0x42')]);_0x5525f4[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x5525f4['model'],_0x5525f4[_0xc661('0x42')]);_0x2c1f1a[_0xc661('0x44')]=_['intersection'](_0x5525f4[_0xc661('0x41')],qs[_0xc661('0x45')](_0x376e69[_0xc661('0x42')][_0xc661('0x45')]));_0x2c1f1a[_0xc661('0x44')]=_0x2c1f1a[_0xc661('0x44')][_0xc661('0x46')]?_0x2c1f1a[_0xc661('0x44')]:_0x5525f4[_0xc661('0x41')];if(!_0x376e69['query']['hasOwnProperty'](_0xc661('0x48'))){_0x2c1f1a[_0xc661('0x2e')]=qs['limit'](_0x376e69[_0xc661('0x42')][_0xc661('0x2e')]);_0x2c1f1a[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x376e69[_0xc661('0x42')][_0xc661('0x2c')]);}_0x2c1f1a['order']=qs[_0xc661('0x4a')](_0x376e69[_0xc661('0x42')][_0xc661('0x4a')]);_0x2c1f1a['where']=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x376e69[_0xc661('0x42')],_0x5525f4[_0xc661('0x4c')]));_0x2c1f1a['where'][_0xc661('0x66')]=_0x3fa513['id'];if(_0x376e69[_0xc661('0x42')][_0xc661('0x4d')]){_0x2c1f1a[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x2c1f1a['where'],{'$or':_['map'](_0x2c1f1a['attributes'],function(_0x15d724){var _0x3f62a5={};_0x3f62a5[_0x15d724]={'$like':'%'+_0x376e69[_0xc661('0x42')][_0xc661('0x4d')]+'%'};return _0x3f62a5;})});}_0x2c1f1a=_[_0xc661('0x4e')]({},_0x2c1f1a,_0x376e69[_0xc661('0x59')]);return db[_0xc661('0x69')][_0xc661('0x50')]({'where':_0x2c1f1a[_0xc661('0x4b')]})['then'](function(_0x272983){_0x211e30[_0xc661('0x50')]=_0x272983;if(_0x376e69[_0xc661('0x42')][_0xc661('0x58')]){_0x2c1f1a[_0xc661('0x51')]=[{'all':!![]}];}return db[_0xc661('0x69')]['findAll'](_0x2c1f1a);})[_0xc661('0x1f')](function(_0x36fec3){_0x211e30[_0xc661('0x54')]=_0x36fec3;return _0x211e30;});}})[_0xc661('0x1f')](respondWithFilteredResult(_0x5cb80d,_0x2c1f1a))[_0xc661('0x27')](handleError(_0x5cb80d,null));};exports[_0xc661('0x6b')]=function(_0x123461,_0x2446c0,_0x183dc0){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x123461['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x2446c0,null))[_0xc661('0x1f')](function(_0x4e1bda){if(_0x4e1bda){return _0x4e1bda[_0xc661('0x6b')](_0x123461[_0xc661('0x42')]['ids']);}})[_0xc661('0x1f')](respondWithStatusCode(_0x2446c0,null))['catch'](handleError(_0x2446c0,null));};exports[_0xc661('0x6c')]=function(_0x3acc27,_0x504f03,_0x2e1245){if(_0x3acc27[_0xc661('0x5c')]['id']){delete _0x3acc27[_0xc661('0x5c')]['id'];}return db['OpenchannelAccount'][_0xc661('0x5a')]({'where':{'id':_0x3acc27[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x504f03,null))[_0xc661('0x1f')](function(_0xccdc54){if(_0xccdc54){_0x3acc27[_0xc661('0x5c')][_0xc661('0x66')]=_0xccdc54['id'];return db[_0xc661('0x6d')][_0xc661('0x5b')](_0x3acc27['body']);}})[_0xc661('0x1f')](respondWithResult(_0x504f03,null))[_0xc661('0x27')](handleError(_0x504f03,null));};exports[_0xc661('0x6e')]=function(_0x47208d,_0x1bade3,_0x9fb245){var _0xd54a6e={'raw':![],'where':{}};var _0x58f4ce={};var _0x2e7272={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x47208d['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x1bade3,null))[_0xc661('0x1f')](function(_0x1606f2){if(_0x1606f2){_0x58f4ce[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x6d')]['rawAttributes']);_0x58f4ce[_0xc661('0x42')]=_[_0xc661('0x57')](_0x47208d['query']);_0x58f4ce[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x58f4ce['model'],_0x58f4ce['query']);_0xd54a6e['attributes']=_[_0xc661('0x43')](_0x58f4ce[_0xc661('0x41')],qs[_0xc661('0x45')](_0x47208d['query'][_0xc661('0x45')]));_0xd54a6e[_0xc661('0x44')]=_0xd54a6e[_0xc661('0x44')]['length']?_0xd54a6e[_0xc661('0x44')]:_0x58f4ce['model'];if(!_0x47208d[_0xc661('0x42')][_0xc661('0x47')](_0xc661('0x48'))){_0xd54a6e['limit']=qs[_0xc661('0x2e')](_0x47208d['query'][_0xc661('0x2e')]);_0xd54a6e['offset']=qs['offset'](_0x47208d['query'][_0xc661('0x2c')]);}_0xd54a6e[_0xc661('0x49')]=qs[_0xc661('0x4a')](_0x47208d[_0xc661('0x42')][_0xc661('0x4a')]);_0xd54a6e[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x47208d[_0xc661('0x42')],_0x58f4ce[_0xc661('0x4c')]));_0xd54a6e[_0xc661('0x4b')][_0xc661('0x66')]=_0x1606f2['id'];if(_0x47208d[_0xc661('0x42')][_0xc661('0x4d')]){_0xd54a6e[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0xd54a6e[_0xc661('0x4b')],{'$or':_['map'](_0xd54a6e[_0xc661('0x44')],function(_0x441d75){var _0xcebd18={};_0xcebd18[_0x441d75]={'$like':'%'+_0x47208d[_0xc661('0x42')][_0xc661('0x4d')]+'%'};return _0xcebd18;})});}_0xd54a6e=_[_0xc661('0x4e')]({},_0xd54a6e,_0x47208d[_0xc661('0x59')]);return db[_0xc661('0x6d')][_0xc661('0x50')]({'where':_0xd54a6e['where']})[_0xc661('0x1f')](function(_0x2dcdb1){_0x2e7272[_0xc661('0x50')]=_0x2dcdb1;if(_0x47208d[_0xc661('0x42')][_0xc661('0x58')]){_0xd54a6e['include']=[{'all':!![]}];}return db[_0xc661('0x6d')][_0xc661('0x53')](_0xd54a6e);})['then'](function(_0x5207c0){_0x2e7272[_0xc661('0x54')]=_0x5207c0;return _0x2e7272;});}})['then'](respondWithFilteredResult(_0x1bade3,_0xd54a6e))['catch'](handleError(_0x1bade3,null));};exports[_0xc661('0x6f')]=function(_0x12d270,_0x7c6293,_0x4d5dc1){return db[_0xc661('0x52')]['find']({'where':{'id':_0x12d270[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x7c6293,null))[_0xc661('0x1f')](function(_0x5eccac){if(_0x5eccac){return _0x5eccac['removeAnswers'](_0x12d270[_0xc661('0x42')][_0xc661('0x70')]);}})[_0xc661('0x1f')](respondWithStatusCode(_0x7c6293,null))[_0xc661('0x27')](handleError(_0x7c6293,null));};exports[_0xc661('0x71')]=function(_0x592c8b,_0x32a616,_0x18ae2d){var _0x13d01a={'body':_0x592c8b[_0xc661('0x5c')],'channel':_0xc661('0x72')};var _0x508eea=[];var _0x1bd3bc=[];var _0x41906d={};var _0x1a0fce=![];return db[_0xc661('0x73')]['describe']()[_0xc661('0x1f')](function(_0x56b9f1){if(!_0x56b9f1){throw new db[(_0xc661('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x508eea=_[_0xc661('0x75')](_[_0xc661('0x57')](_0x56b9f1),[_0xc661('0x76'),_0xc661('0x77')]);_0x1bd3bc=_['difference'](_['keys'](_0x56b9f1),['createdAt',_0xc661('0x77'),_0xc661('0x78'),'ListId']);if(_0x592c8b[_0xc661('0x5c')]['id']){delete _0x592c8b[_0xc661('0x5c')]['id'];}if(_[_0xc661('0x79')](_0x592c8b[_0xc661('0x5c')][_0xc661('0x7a')])){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')])||_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')]===''){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))](_0xc661('0x7c'));}if(_[_0xc661('0x79')](_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')])){throw new db[(_0xc661('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1bd3bc);}if(!_[_0xc661('0x7e')](_0x1bd3bc,_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')])){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))](_0xc661('0x7f')+_0x1bd3bc);}_0x41906d[_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')]]=_0x592c8b['body']['from'];})[_0xc661('0x1f')](function(){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x592c8b[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x80')],'as':_0xc661('0x81'),'include':[{'model':db[_0xc661('0x73')],'as':'Contacts','where':_0x41906d,'limit':0x1,'order':[[_0xc661('0x77'),_0xc661('0x82')]]}]},{'model':db[_0xc661('0x83')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x32a616,null))[_0xc661('0x1f')](function(_0x45b8a8){if(_0x45b8a8&&_0x45b8a8['List']){_0x13d01a[_0xc661('0x84')]=_0x45b8a8;_0x13d01a[_0xc661('0x85')]=_0x45b8a8[_0xc661('0x86')];_0x13d01a[_0xc661('0x87')]=_0x45b8a8['List'];_0x13d01a[_0xc661('0x85')]=_[_0xc661('0x88')](_0x13d01a[_0xc661('0x85')],[_0xc661('0x89')],[_0xc661('0x8a')]);if(_0x13d01a[_0xc661('0x84')][_0xc661('0x86')]){delete _0x13d01a[_0xc661('0x84')][_0xc661('0x86')];}if(_0x13d01a['account'][_0xc661('0x81')]&&_0x13d01a[_0xc661('0x84')]['List']['Contacts'][_0xc661('0x46')]){return _0x13d01a[_0xc661('0x84')][_0xc661('0x81')][_0xc661('0x8b')][0x0];}var _0x22f4f8=_[_0xc661('0x17')](_0x592c8b['body'],{'firstName':_0x592c8b['body'][_0xc661('0x7a')],'ListId':_0x45b8a8[_0xc661('0x8c')]});_0x22f4f8[_0x592c8b['body'][_0xc661('0x7d')]]=_0x592c8b[_0xc661('0x5c')][_0xc661('0x7a')];return db['CmContact']['create'](_0x22f4f8,{'fields':_0x508eea,'raw':!![]});}})[_0xc661('0x1f')](handleEntityNotFound(_0x32a616,null))['then'](function(_0x53b7bc){_0x13d01a[_0xc661('0x8d')]=_0x53b7bc;if(_0x53b7bc){var _0x3c9171={'ContactId':_0x53b7bc['id'],'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'from':(_0x53b7bc[_0xc661('0x8e')]||'')+'\x20'+(_0x53b7bc[_0xc661('0x8f')]||'')};var _0x56a81e={'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'closed':![]};if(_0x592c8b[_0xc661('0x5c')]['threadId']){_0x56a81e['threadId']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')];return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':_0x56a81e})[_0xc661('0x1f')](function(_0x17a11d){if(_0x17a11d){return[_0x17a11d,![]];}_0x3c9171[_0xc661('0x90')]=_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')];_0x3c9171['externalUrl']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x92')];return db['OpenchannelInteraction'][_0xc661('0x5b')](_0x3c9171)[_0xc661('0x1f')](function(_0x5ca3bd){return[_0x5ca3bd,!![]];});});}else{_0x56a81e[_0xc661('0x90')]=null;}_0x56a81e['ContactId']=_0x53b7bc['id'];return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':_0x56a81e})[_0xc661('0x1f')](function(_0x25049a){if(_0x25049a){return[_0x25049a,![]];}return db[_0xc661('0x91')][_0xc661('0x5b')](_0x3c9171)[_0xc661('0x1f')](function(_0x5176ee){return[_0x5176ee,!![]];});});}})['spread'](function(_0x3c0c64,_0x3901ab){if(_0x3c0c64){_0x1a0fce=_0x3901ab;if(!_0x3901ab){var _0x1e3f08={'from':(_0x13d01a[_0xc661('0x8d')][_0xc661('0x8e')]||'')+'\x20'+(_0x13d01a['contact'][_0xc661('0x8f')]||'')};if(_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')]&&_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')]&&_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')]!=_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')]){_0x1e3f08['threadId']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')];}return _0x3c0c64[_0xc661('0x33')](_0x1e3f08);}else{return _0x3c0c64;}}})[_0xc661('0x1f')](function(_0x52bce1){_0x13d01a[_0xc661('0x94')]=_0x52bce1[_0xc661('0x5e')]({'plain':!![]});_0x13d01a[_0xc661('0x94')][_0xc661('0x95')]=_0x1a0fce;if(_0x13d01a['interaction'][_0xc661('0x95')]){if(_0x13d01a['account'][_0xc661('0x96')]){_0x13d01a[_0xc661('0x85')]['push']({'id':0x0,'priority':_0x13d01a[_0xc661('0x85')]['length']+0x1,'app':'close','appdata':_0xc661('0x97'),'interval':_0xc661('0x98')});}}return db[_0xc661('0x99')]['create']({'body':_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'OpenchannelInteractionId':_0x52bce1['id'],'direction':'in','ContactId':_0x13d01a[_0xc661('0x8d')]['id'],'AttachmentId':_0x592c8b[_0xc661('0x5c')]['AttachmentId']});})[_0xc661('0x1f')](function(_0x27a676){_0x13d01a[_0xc661('0x25')]=_0x27a676;if(_0x13d01a[_0xc661('0x94')][_0xc661('0x9a')]){return db[_0xc661('0x9b')][_0xc661('0x5a')]({'attributes':['id',_0xc661('0x37')],'where':{'id':_0x13d01a[_0xc661('0x94')][_0xc661('0x9a')]}})[_0xc661('0x1f')](function(_0x160775){if(_0x160775){_0x13d01a[_0xc661('0x85')][_0xc661('0x9c')]({'id':0x0,'priority':0x0,'app':_0xc661('0x9d'),'appdata':_0x160775[_0xc661('0x37')]+','+(_0x13d01a['account'][_0xc661('0x9e')]||0xa),'interval':'*,*,*,*'});_0x13d01a[_0xc661('0x9f')]=![];}return respondWithRpcPromise(_0xc661('0xa0'),_0xc661('0xa1'),_0x13d01a);});}return respondWithRpcPromise('Start',_0xc661('0xa1'),_0x13d01a);})[_0xc661('0x1f')](function(_0x30af82){respondWithRpcPromise(_0xc661('0xa2'),_0xc661('0xa2'),{'event':_0xc661('0x71'),'message':_0x30af82},client9002);return _0x30af82;})[_0xc661('0x1f')](respondWithResult(_0x32a616,null))[_0xc661('0x27')](handleError(_0x32a616,null));};exports[_0xc661('0xa3')]=function(_0x542841,_0x24bd2c){var _0x4784b3=_0x542841[_0xc661('0x56')]['id'];var _0x1841b2=_0x542841['body'];var _0x505be6=0xc8;var _0x482c72=null;return db[_0xc661('0xa4')][_0xc661('0xa5')]({'isolationLevel':db[_0xc661('0xa4')]['Transaction']['ISOLATION_LEVELS'][_0xc661('0xa6')]},function(_0x4e135f){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4784b3},'transaction':_0x4e135f})[_0xc661('0x1f')](function(_0x52730d){if(_0x52730d){return db[_0xc661('0x83')][_0xc661('0x34')]({'where':{'OpenchannelAccountId':_0x4784b3},'transaction':_0x4e135f})[_0xc661('0x1f')](function(){var _0xeb0476=_['map'](_0x1841b2,function(_0x2b56f1){_0x2b56f1[_0xc661('0x66')]=_0x4784b3;return _0x2b56f1;});return db['OpenchannelApplication']['bulkCreate'](_0xeb0476,{'transaction':_0x4e135f});});}else{_0x505be6=0x194;_0x482c72=[];}});})['then'](function(){if(_0x505be6!==0x194){return db[_0xc661('0x83')][_0xc661('0xa7')]({'where':{'OpenchannelAccountId':_0x4784b3},'order':_0xc661('0x89')})[_0xc661('0x1f')](function(_0x5db96f){_0x482c72=_0x5db96f;});}})[_0xc661('0x27')](function(_0x26d1d0){_0x505be6=0x1f4;logger[_0xc661('0x24')](_0x26d1d0[_0xc661('0x36')]);if(_0x26d1d0[_0xc661('0x37')]){delete _0x26d1d0[_0xc661('0x37')];}_0x482c72=_0x26d1d0;})[_0xc661('0xa8')](function(){if(_0x482c72===null){_0x24bd2c['sendStatus'](_0x505be6);}else{if(_0x505be6===0x1f4){_0x24bd2c['status'](_0x505be6)[_0xc661('0x38')](_0x482c72);}else{_0x24bd2c['status'](_0x505be6)['json'](_0x482c72);}}});};exports['getApplications']=function(_0x9833be,_0x409464,_0xc3232b){var _0x30a8c7={};var _0x2a23e6={};var _0x4b563c;var _0x4d8c9a;return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x9833be[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x409464,null))[_0xc661('0x1f')](function(_0x5c4a48){if(_0x5c4a48){_0x4b563c=_0x5c4a48;_0x2a23e6['model']=_['keys'](db[_0xc661('0x83')][_0xc661('0x3d')]);_0x2a23e6[_0xc661('0x42')]=_[_0xc661('0x57')](_0x9833be[_0xc661('0x42')]);_0x2a23e6[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x2a23e6[_0xc661('0x41')],_0x2a23e6['query']);_0x30a8c7[_0xc661('0x44')]=_[_0xc661('0x43')](_0x2a23e6[_0xc661('0x41')],qs['fields'](_0x9833be[_0xc661('0x42')][_0xc661('0x45')]));_0x30a8c7['attributes']=_0x30a8c7[_0xc661('0x44')]['length']?_0x30a8c7[_0xc661('0x44')]:_0x2a23e6[_0xc661('0x41')];_0x30a8c7[_0xc661('0x49')]=qs[_0xc661('0x4a')](_0x9833be[_0xc661('0x42')][_0xc661('0x4a')]);_0x30a8c7[_0xc661('0x4b')]=qs['filters'](_['pick'](_0x9833be['query'],_0x2a23e6['filters']));if(_0x9833be[_0xc661('0x42')]['filter']){_0x30a8c7['where']=_['merge'](_0x30a8c7[_0xc661('0x4b')],{'$or':_['map'](_0x30a8c7[_0xc661('0x44')],function(_0x357b0d){var _0x3d77d9={};_0x3d77d9[_0x357b0d]={'$like':'%'+_0x9833be['query'][_0xc661('0x4d')]+'%'};return _0x3d77d9;})});}_0x30a8c7=_[_0xc661('0x4e')]({},_0x30a8c7,_0x9833be['options']);return _0x4b563c[_0xc661('0xa9')](_0x30a8c7);}})[_0xc661('0x1f')](function(_0x3c1273){if(_0x3c1273){_0x4d8c9a=_0x3c1273['length'];if(!_0x9833be[_0xc661('0x42')]['hasOwnProperty'](_0xc661('0x48'))){_0x30a8c7[_0xc661('0x2e')]=qs[_0xc661('0x2e')](_0x9833be[_0xc661('0x42')][_0xc661('0x2e')]);_0x30a8c7[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x9833be[_0xc661('0x42')]['offset']);}return _0x4b563c[_0xc661('0xa9')](_0x30a8c7);}})[_0xc661('0x1f')](function(_0x141a38){if(_0x141a38){return _0x141a38?{'count':_0x4d8c9a,'rows':_0x141a38}:null;}})[_0xc661('0x1f')](respondWithResult(_0x409464,null))['catch'](handleError(_0x409464,null));};exports['getInteractions']=function(_0x17d5de,_0x31b0d2,_0x221455){var _0x3e1d16={'raw':![],'where':{}};var _0x2e5419={};var _0x1edac7={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x17d5de[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x31b0d2,null))[_0xc661('0x1f')](function(_0x57f869){if(_0x57f869){_0x2e5419[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x91')]['rawAttributes']);_0x2e5419[_0xc661('0x42')]=_[_0xc661('0x57')](_0x17d5de[_0xc661('0x42')]);_0x2e5419[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x2e5419[_0xc661('0x41')],_0x2e5419[_0xc661('0x42')]);_0x3e1d16['attributes']=_['intersection'](_0x2e5419[_0xc661('0x41')],qs[_0xc661('0x45')](_0x17d5de[_0xc661('0x42')][_0xc661('0x45')]));_0x3e1d16['attributes']=_0x3e1d16['attributes']['length']?_0x3e1d16[_0xc661('0x44')]:_0x2e5419['model'];if(!_0x17d5de['query']['hasOwnProperty'](_0xc661('0x48'))){_0x3e1d16[_0xc661('0x2e')]=qs[_0xc661('0x2e')](_0x17d5de[_0xc661('0x42')][_0xc661('0x2e')]);_0x3e1d16[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x17d5de[_0xc661('0x42')]['offset']);}_0x3e1d16['order']=qs['sort'](_0x17d5de[_0xc661('0x42')][_0xc661('0x4a')]);_0x3e1d16[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x17d5de[_0xc661('0x42')],_0x2e5419[_0xc661('0x4c')]));_0x3e1d16[_0xc661('0x4b')][_0xc661('0x66')]=_0x57f869['id'];if(_0x17d5de['query'][_0xc661('0x4d')]){_0x3e1d16['where']=_[_0xc661('0x4e')](_0x3e1d16[_0xc661('0x4b')],{'$or':_[_0xc661('0x3c')](_0x3e1d16[_0xc661('0x44')],function(_0x2436e9){var _0x33e384={};_0x33e384[_0x2436e9]={'$like':'%'+_0x17d5de[_0xc661('0x42')]['filter']+'%'};return _0x33e384;})});}_0x3e1d16=_[_0xc661('0x4e')]({},_0x3e1d16,_0x17d5de[_0xc661('0x59')]);return db[_0xc661('0x91')][_0xc661('0x50')]({'where':_0x3e1d16[_0xc661('0x4b')]})['then'](function(_0x859646){_0x1edac7[_0xc661('0x50')]=_0x859646;if(_0x17d5de[_0xc661('0x42')][_0xc661('0x58')]){_0x3e1d16[_0xc661('0x51')]=[{'model':db[_0xc661('0x73')],'as':_0xc661('0xaa'),'required':![]},{'model':db[_0xc661('0x9b')],'as':'Owner','attributes':[_0xc661('0x37'),_0xc661('0xab'),_0xc661('0xac')],'required':![]},{'model':db['Tag'],'as':_0xc661('0xad'),'attributes':['id','name',_0xc661('0xae')],'where':_0x17d5de[_0xc661('0x42')]['tag']?{'id':_0x17d5de[_0xc661('0x42')][_0xc661('0xaf')]}:undefined,'required':_0x17d5de['query'][_0xc661('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xc661('0x53')](_0x3e1d16);})[_0xc661('0x1f')](function(_0x2c7c8a){_0x1edac7['rows']=_0x2c7c8a;return _0x1edac7;});}})['then'](respondWithFilteredResult(_0x31b0d2,_0x3e1d16))['catch'](handleError(_0x31b0d2,null));};exports[_0xc661('0xb0')]=function(_0x226b05,_0x4b2428,_0x2e0b36){return db['OpenchannelAccount'][_0xc661('0x5a')]({'where':{'id':_0x226b05['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x4b2428,null))[_0xc661('0x1f')](function(_0x1dbb0f){if(_0x1dbb0f){return _0x1dbb0f[_0xc661('0xb0')](_0x226b05[_0xc661('0x5c')]['ids'],_['omit'](_0x226b05[_0xc661('0x5c')],[_0xc661('0x70'),'id'])||{})[_0xc661('0xb1')](function(_0x5deba0){for(var _0x2f9cef=0x0;_0x2f9cef<_0x226b05[_0xc661('0x5c')][_0xc661('0x70')][_0xc661('0x46')];_0x2f9cef+=0x1){socket[_0xc661('0xb2')](_0xc661('0xb3'),{'UserId':Number(_0x226b05[_0xc661('0x5c')][_0xc661('0x70')][_0x2f9cef]),'OpenchannelAccountId':Number(_0x226b05['params']['id'])});}return _0x5deba0;});}})[_0xc661('0x1f')](respondWithResult(_0x4b2428,null))[_0xc661('0x27')](handleError(_0x4b2428,null));};exports[_0xc661('0xb4')]=function(_0x30224d,_0x5c0e29,_0x1f0c71){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x30224d['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x5c0e29,null))[_0xc661('0x1f')](function(_0x79ab54){if(_0x79ab54){return _0x79ab54[_0xc661('0xb4')](_0x30224d[_0xc661('0x42')]['ids'])[_0xc661('0x1f')](function(){if(_[_0xc661('0xb5')](_0x30224d[_0xc661('0x42')][_0xc661('0x70')])){for(var _0x5087c7=0x0;_0x5087c7<_0x30224d[_0xc661('0x42')][_0xc661('0x70')][_0xc661('0x46')];_0x5087c7+=0x1){socket[_0xc661('0xb2')](_0xc661('0xb6'),{'UserId':Number(_0x30224d[_0xc661('0x42')][_0xc661('0x70')][_0x5087c7]),'OpenchannelAccountId':Number(_0x30224d[_0xc661('0x56')]['id'])});}}else{socket[_0xc661('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x30224d['query'][_0xc661('0x70')]),'OpenchannelAccountId':Number(_0x30224d[_0xc661('0x56')]['id'])});}});}})[_0xc661('0x1f')](respondWithStatusCode(_0x5c0e29,null))[_0xc661('0x27')](handleError(_0x5c0e29,null));};exports[_0xc661('0xb7')]=function(_0x1ebbbc,_0x35ce67,_0x231280){var _0x183f0c={};var _0x3fad92={};var _0x44fcb0;var _0x4f354b;return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x1ebbbc[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x35ce67,null))[_0xc661('0x1f')](function(_0x1deafc){if(_0x1deafc){_0x44fcb0=_0x1deafc;_0x3fad92['model']=_[_0xc661('0x57')](db[_0xc661('0x9b')][_0xc661('0x3d')]);_0x3fad92['query']=_[_0xc661('0x57')](_0x1ebbbc[_0xc661('0x42')]);_0x3fad92[_0xc661('0x4c')]=_['intersection'](_0x3fad92[_0xc661('0x41')],_0x3fad92[_0xc661('0x42')]);_0x183f0c[_0xc661('0x44')]=_[_0xc661('0x43')](_0x3fad92[_0xc661('0x41')],qs['fields'](_0x1ebbbc[_0xc661('0x42')]['fields']));_0x183f0c[_0xc661('0x44')]=_0x183f0c['attributes'][_0xc661('0x46')]?_0x183f0c['attributes']:_0x3fad92[_0xc661('0x41')];_0x183f0c['order']=qs['sort'](_0x1ebbbc['query'][_0xc661('0x4a')]);_0x183f0c[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_['pick'](_0x1ebbbc[_0xc661('0x42')],_0x3fad92['filters']));if(_0x1ebbbc[_0xc661('0x42')][_0xc661('0x4d')]){_0x183f0c[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x183f0c[_0xc661('0x4b')],{'$or':_[_0xc661('0x3c')](_0x183f0c[_0xc661('0x44')],function(_0x479c4){var _0x91d8f2={};_0x91d8f2[_0x479c4]={'$like':'%'+_0x1ebbbc[_0xc661('0x42')]['filter']+'%'};return _0x91d8f2;})});}_0x183f0c=_[_0xc661('0x4e')]({},_0x183f0c,_0x1ebbbc[_0xc661('0x59')]);return _0x44fcb0['getAgents'](_0x183f0c);}})[_0xc661('0x1f')](function(_0x481133){if(_0x481133){_0x4f354b=_0x481133[_0xc661('0x46')];if(!_0x1ebbbc['query'][_0xc661('0x47')](_0xc661('0x48'))){_0x183f0c['limit']=qs[_0xc661('0x2e')](_0x1ebbbc[_0xc661('0x42')][_0xc661('0x2e')]);_0x183f0c[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x1ebbbc[_0xc661('0x42')]['offset']);}return _0x44fcb0[_0xc661('0xb7')](_0x183f0c);}})[_0xc661('0x1f')](function(_0x264ec1){if(_0x264ec1){return _0x264ec1?{'count':_0x4f354b,'rows':_0x264ec1}:null;}})[_0xc661('0x1f')](respondWithResult(_0x35ce67,null))[_0xc661('0x27')](handleError(_0x35ce67,null));};exports[_0xc661('0x38')]=function(_0x46279c,_0x151b50,_0x1c69af){var _0x2a3c7f,_0x25a04d,_0x1bb40b;if(_[_0xc661('0x79')](_0x46279c['body'][_0xc661('0x5c')])||_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0xc661('0x7c'));}if(_[_0xc661('0x79')](_0x46279c[_0xc661('0x5c')]['to'])){}_0x2a3c7f=_0x46279c['body']['to'];return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x46279c['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x57f93c){if(_0x57f93c){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x57f93c['id']},'include':[{'model':db[_0xc661('0x80')],'as':_0xc661('0x81'),'include':[{'model':db['CmContact'],'as':_0xc661('0x8b'),'where':{[_0x57f93c[_0xc661('0x7d')]]:_0x2a3c7f},'limit':0x1,'order':[['updatedAt',_0xc661('0x82')]]}]}]})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x445901){if(_0x445901&&_0x445901[_0xc661('0x81')]){_0x25a04d=_0x445901[_0xc661('0x5e')]({'plain':!![]});if(_0x25a04d[_0xc661('0x81')]&&_0x25a04d[_0xc661('0x81')][_0xc661('0x8b')]['length']){return _0x25a04d['List'][_0xc661('0x8b')][0x0];}return db[_0xc661('0x73')]['create'](_[_0xc661('0x17')](_0x46279c[_0xc661('0x5c')],{'firstName':_0x2a3c7f,[_0x445901[_0xc661('0x7d')]]:_0x2a3c7f,'phone':_0x2a3c7f,'ListId':_0x25a04d[_0xc661('0x8c')]}));}})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x4995ea){if(_0x4995ea){_0x1bb40b=_0x4995ea;return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':{'ContactId':_0x1bb40b['id'],'closed':![],'OpenchannelAccountId':_0x25a04d['id']}})[_0xc661('0x1f')](function(_0x24e8b3){if(_0x24e8b3){return[_0x24e8b3,![]];}return db['OpenchannelInteraction'][_0xc661('0x5b')]({'UserId':_0x46279c['user']['id'],'ContactId':_0x1bb40b['id'],'OpenchannelAccountId':_0x25a04d['id'],'lastMsgDirection':_0xc661('0xb8'),'firstMsgDirection':'out','Messages':[_[_0xc661('0x4e')](_0x46279c['body'],{'read':![],'body':_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x25a04d['id'],'UserId':_0x46279c['user']['id'],'ContactId':_0x1bb40b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xc661('0x1f')](function(_0x498a0a){return[_0x498a0a,!![]];});});}})['spread'](function(_0x16ee72,_0x5759ea){if(_0x5759ea){return _0x16ee72;}return db[_0xc661('0x99')][_0xc661('0x5b')](_[_0xc661('0x4e')](_0x46279c[_0xc661('0x5c')],{'read':![],'body':_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x25a04d['id'],'OpenchannelInteractionId':_0x16ee72['id'],'UserId':_0x46279c[_0xc661('0x5d')]['id'],'ContactId':_0x1bb40b['id']}))[_0xc661('0x1f')](function(_0x307e5b){_0x16ee72[_0xc661('0xb9')]['Messages']=[];_0x16ee72[_0xc661('0xb9')][_0xc661('0xba')][_0xc661('0xbb')](_0x307e5b[_0xc661('0xb9')]);return _0x16ee72;});});}})[_0xc661('0x1f')](respondWithResult(_0x151b50,null))[_0xc661('0x27')](handleError(_0x151b50,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 635abdd..86841c9 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x161b9f,_0x45dd26){var _0xca91b5=function(_0x5be6e4){while(--_0x5be6e4){_0x161b9f['push'](_0x161b9f['shift']());}};_0xca91b5(++_0x45dd26);}(_0xf109,0xce));var _0x9f10=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xf109[_0x4ae829];return _0x256b31;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x32734f,_0x5c0a00){_0x32734f=_0x32734f-0x0;var _0x334813=_0x6f7a[_0x32734f];return _0x334813;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 2f777df..e1d6f93 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(_0x4c3f9a,_0xfb8bcc){var _0x8eb693=function(_0x4168a8){while(--_0x4168a8){_0x4c3f9a['push'](_0x4c3f9a['shift']());}};_0x8eb693(++_0xfb8bcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x39c509,_0x2cc96d){var _0x263cbf=function(_0x148876){while(--_0x148876){_0x39c509['push'](_0x39c509['shift']());}};_0x263cbf(++_0x2cc96d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 e44ba38..4be28ae 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 _0xa74f=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then'];(function(_0xbd1c88,_0x357701){var _0x38f421=function(_0x267936){while(--_0x267936){_0xbd1c88['push'](_0xbd1c88['shift']());}};_0x38f421(++_0x357701);}(_0xa74f,0x9a));var _0xfa74=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xa74f[_0x368587];return _0x42d33c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});config[_0xfa74('0x7')]=_[_0xfa74('0x8')](config[_0xfa74('0x7')],{'host':_0xfa74('0x9'),'port':0x18eb});var socket=require(_0xfa74('0xa'))(new Redis(config['redis']));require(_0xfa74('0xb'))[_0xfa74('0xc')](socket);function respondWithRpcPromise(_0x355e37,_0x2a405e,_0x4d118c){return new BPromise(function(_0x46117e,_0x4f8891){return client['request'](_0x355e37,_0x4d118c)[_0xfa74('0xd')](function(_0x1d919d){logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x2a405e,_0xfa74('0x12'),JSON[_0xfa74('0x13')](_0x1d919d));if(_0x1d919d['error']){if(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x15')]===0x1f4){logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')]['message']);return _0x4f8891(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);}logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);return _0x46117e(_0x1d919d[_0xfa74('0x14')]['message']);}else{logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');_0x46117e(_0x1d919d['result'][_0xfa74('0x16')]);}})[_0xfa74('0x17')](function(_0xb8fe6b){logger['error'](_0xfa74('0xf'),_0x2a405e,_0xb8fe6b);_0x4f8891(_0xb8fe6b);});});} \ No newline at end of file +var _0x80ed=['../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3b1f6e,_0x3ab93c){var _0x3993e0=function(_0x35c4d2){while(--_0x35c4d2){_0x3b1f6e['push'](_0x3b1f6e['shift']());}};_0x3993e0(++_0x3ab93c);}(_0x80ed,0x11c));var _0xd80e=function(_0x5ad88,_0x282d37){_0x5ad88=_0x5ad88-0x0;var _0x5992ed=_0x80ed[_0x5ad88];return _0x5992ed;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 58aa77e..dc8a926 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 _0xafe6=['register','length','./openchannelAccount.events','save','removeListener'];(function(_0x1c02e1,_0x22e368){var _0x34c933=function(_0x34106e){while(--_0x34106e){_0x1c02e1['push'](_0x1c02e1['shift']());}};_0x34c933(++_0x22e368);}(_0xafe6,0xac));var _0x6afe=function(_0x3eabac,_0x897524){_0x3eabac=_0x3eabac-0x0;var _0x20a135=_0xafe6[_0x3eabac];return _0x20a135;};'use strict';var OpenchannelAccountEvents=require(_0x6afe('0x0'));var events=[_0x6afe('0x1'),'remove','update'];function createListener(_0x45de15,_0xa75765){return function(_0x5a03a1){_0xa75765['emit'](_0x45de15,_0x5a03a1);};}function removeListener(_0x40d720,_0x176f85){return function(){OpenchannelAccountEvents[_0x6afe('0x2')](_0x40d720,_0x176f85);};}exports[_0x6afe('0x3')]=function(_0x2ce302){for(var _0x4898bb=0x0,_0x302747=events[_0x6afe('0x4')];_0x4898bb<_0x302747;_0x4898bb++){var _0x59badb=events[_0x4898bb];var _0x1d3c11=createListener('openchannelAccount:'+_0x59badb,_0x2ce302);OpenchannelAccountEvents['on'](_0x59badb,_0x1d3c11);}}; \ No newline at end of file +var _0xdb76=['remove','update','emit','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x54cfa2,_0x360080){var _0x2536e2=function(_0x14e8f1){while(--_0x14e8f1){_0x54cfa2['push'](_0x54cfa2['shift']());}};_0x2536e2(++_0x360080);}(_0xdb76,0x1be));var _0x6db7=function(_0x47101e,_0xec2261){_0x47101e=_0x47101e-0x0;var _0x757e41=_0xdb76[_0x47101e];return _0x757e41;};'use strict';var OpenchannelAccountEvents=require(_0x6db7('0x0'));var events=[_0x6db7('0x1'),_0x6db7('0x2'),_0x6db7('0x3')];function createListener(_0x27d5fd,_0x4fee62){return function(_0x448591){_0x4fee62[_0x6db7('0x4')](_0x27d5fd,_0x448591);};}function removeListener(_0x3e17d8,_0x40f6ce){return function(){OpenchannelAccountEvents['removeListener'](_0x3e17d8,_0x40f6ce);};}exports[_0x6db7('0x5')]=function(_0x7bba2d){for(var _0x8a8fe2=0x0,_0x417e71=events[_0x6db7('0x6')];_0x8a8fe2<_0x417e71;_0x8a8fe2++){var _0x58f6e4=events[_0x8a8fe2];var _0x1c7f92=createListener(_0x6db7('0x7')+_0x58f6e4,_0x7bba2d);OpenchannelAccountEvents['on'](_0x58f6e4,_0x1c7f92);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index a413e9a..33fd0dc 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 _0x7bfb=['../../components/interaction/service','../../config/environment','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2ed40d,_0x78e9cc){var _0x40cdab=function(_0x13d7a9){while(--_0x13d7a9){_0x2ed40d['push'](_0x2ed40d['shift']());}};_0x40cdab(++_0x78e9cc);}(_0x7bfb,0x129));var _0xb7bf=function(_0x19b1c2,_0x205062){_0x19b1c2=_0x19b1c2-0x0;var _0x4e1ae5=_0x7bfb[_0x19b1c2];return _0x4e1ae5;};'use strict';var multer=require(_0xb7bf('0x0'));var util=require(_0xb7bf('0x1'));var path=require(_0xb7bf('0x2'));var timeout=require(_0xb7bf('0x3'));var express=require('express');var router=express[_0xb7bf('0x4')]();var fs_extra=require(_0xb7bf('0x5'));var auth=require(_0xb7bf('0x6'));var interaction=require(_0xb7bf('0x7'));var config=require(_0xb7bf('0x8'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb7bf('0x9')]);router['get']('/:id',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xb')]);router[_0xb7bf('0xc')]('/',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xd')]);router['put'](_0xb7bf('0xe'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xf')]);router[_0xb7bf('0x10')](_0xb7bf('0xe'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0x11')]);module[_0xb7bf('0x12')]=router; \ No newline at end of file +var _0x7b56=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','multer'];(function(_0x2a7e7f,_0x307432){var _0xdce505=function(_0x2b271f){while(--_0x2b271f){_0x2a7e7f['push'](_0x2a7e7f['shift']());}};_0xdce505(++_0x307432);}(_0x7b56,0x65));var _0x67b5=function(_0x4a6c78,_0x296701){_0x4a6c78=_0x4a6c78-0x0;var _0x5f017c=_0x7b56[_0x4a6c78];return _0x5f017c;};'use strict';var multer=require(_0x67b5('0x0'));var util=require(_0x67b5('0x1'));var path=require('path');var timeout=require(_0x67b5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x67b5('0x3'));var auth=require(_0x67b5('0x4'));var interaction=require(_0x67b5('0x5'));var config=require(_0x67b5('0x6'));var controller=require(_0x67b5('0x7'));router[_0x67b5('0x8')]('/',auth[_0x67b5('0x9')](),controller[_0x67b5('0xa')]);router[_0x67b5('0x8')](_0x67b5('0xb'),auth[_0x67b5('0x9')](),controller[_0x67b5('0xc')]);router[_0x67b5('0xd')]('/',auth[_0x67b5('0x9')](),controller[_0x67b5('0xe')]);router['put'](_0x67b5('0xb'),auth[_0x67b5('0x9')](),controller[_0x67b5('0xf')]);router[_0x67b5('0x10')](_0x67b5('0xb'),auth['isAuthenticated'](),controller['destroy']);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 cbabd12..8183101 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 _0xfae1=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0xfae1,0x1f3));var _0x1fae=function(_0x53beca,_0x5f182d){_0x53beca=_0x53beca-0x0;var _0x511636=_0xfae1[_0x53beca];return _0x511636;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x1fae('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x1fae('0x1')],'allowNull':![],'defaultValue':_0x1fae('0x2')},'appdata':{'type':Sequelize[_0x1fae('0x3')]()},'description':{'type':Sequelize[_0x1fae('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1fae('0x4')}}; \ No newline at end of file +var _0xb583=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xb583,0x9b));var _0x3b58=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb583[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x3b58('0x0')]={'priority':{'type':Sequelize[_0x3b58('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3b58('0x2')],'allowNull':![],'defaultValue':_0x3b58('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3b58('0x2')]},'interval':{'type':Sequelize[_0x3b58('0x2')],'defaultValue':_0x3b58('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 7349261..dc57f42 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 _0xff7e=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelApplication','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','rimraf','zip-dir','moment','bluebird'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xff7e,0x92));var _0xeff7=function(_0x1d782e,_0x5163f7){_0x1d782e=_0x1d782e-0x0;var _0x459013=_0xff7e[_0x1d782e];return _0x459013;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeff7('0x0'));var zipdir=require(_0xeff7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeff7('0x2'));var BPromise=require(_0xeff7('0x3'));var Mustache=require('mustache');var util=require(_0xeff7('0x4'));var path=require(_0xeff7('0x5'));var sox=require(_0xeff7('0x6'));var csv=require(_0xeff7('0x7'));var ejs=require(_0xeff7('0x8'));var fs=require('fs');var fs_extra=require(_0xeff7('0x9'));var _=require(_0xeff7('0xa'));var squel=require(_0xeff7('0xb'));var crypto=require(_0xeff7('0xc'));var jsforce=require(_0xeff7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeff7('0x7'));var querystring=require(_0xeff7('0xe'));var Papa=require(_0xeff7('0xf'));var Redis=require(_0xeff7('0x10'));var authService=require(_0xeff7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeff7('0x12'));var logger=require(_0xeff7('0x13'))('api');var utils=require(_0xeff7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xeff7('0x15'));var db=require(_0xeff7('0x16'))['db'];function respondWithStatusCode(_0x4f6437,_0x3d1675){_0x3d1675=_0x3d1675||0xcc;return function(_0x186b77){if(_0x186b77){return _0x4f6437[_0xeff7('0x17')](_0x3d1675);}return _0x4f6437['status'](_0x3d1675)[_0xeff7('0x18')]();};}function respondWithResult(_0x468883,_0x5413e3){_0x5413e3=_0x5413e3||0xc8;return function(_0x434f4a){if(_0x434f4a){return _0x468883[_0xeff7('0x19')](_0x5413e3)[_0xeff7('0x1a')](_0x434f4a);}};}function respondWithFilteredResult(_0x488078,_0x896260){return function(_0x5b5963){if(_0x5b5963){var _0x188aae=typeof _0x896260[_0xeff7('0x1b')]==='undefined'&&typeof _0x896260[_0xeff7('0x1c')]===_0xeff7('0x1d');var _0xd0a248=_0x5b5963[_0xeff7('0x1e')];var _0x440363=_0x188aae?0x0:_0x896260[_0xeff7('0x1b')];var _0x4af667=_0x188aae?_0x5b5963['count']:_0x896260[_0xeff7('0x1b')]+_0x896260['limit'];var _0x1bd02a;if(_0x4af667>=_0xd0a248){_0x4af667=_0xd0a248;_0x1bd02a=0xc8;}else{_0x1bd02a=0xce;}_0x488078[_0xeff7('0x19')](_0x1bd02a);return _0x488078[_0xeff7('0x1f')](_0xeff7('0x20'),_0x440363+'-'+_0x4af667+'/'+_0xd0a248)[_0xeff7('0x1a')](_0x5b5963);}return null;};}function patchUpdates(_0x1d041c){return function(_0x16b394){try{jsonpatch[_0xeff7('0x21')](_0x16b394,_0x1d041c,!![]);}catch(_0x47f10e){return BPromise[_0xeff7('0x22')](_0x47f10e);}return _0x16b394[_0xeff7('0x23')]();};}function saveUpdates(_0x24697b,_0x19220e){return function(_0x58536a){if(_0x58536a){return _0x58536a[_0xeff7('0x24')](_0x24697b)[_0xeff7('0x25')](function(_0x5dbe72){return _0x5dbe72;});}return null;};}function removeEntity(_0x4a7282,_0x4e2b57){return function(_0x111371){if(_0x111371){return _0x111371[_0xeff7('0x26')]()[_0xeff7('0x25')](function(){_0x4a7282[_0xeff7('0x19')](0xcc)[_0xeff7('0x18')]();});}};}function handleEntityNotFound(_0x1f08d7,_0xf55066){return function(_0x39c61e){if(!_0x39c61e){_0x1f08d7['sendStatus'](0x194);}return _0x39c61e;};}function handleError(_0x47b805,_0x5c6629){_0x5c6629=_0x5c6629||0x1f4;return function(_0x4567bd){logger[_0xeff7('0x27')](_0x4567bd['stack']);if(_0x4567bd[_0xeff7('0x28')]){delete _0x4567bd['name'];}_0x47b805['status'](_0x5c6629)[_0xeff7('0x29')](_0x4567bd);};}exports[_0xeff7('0x2a')]=function(_0x27827b,_0x15cdb6){var _0xc4321d={},_0x732cdd={},_0x3aa82f={'count':0x0,'rows':[]};var _0x107036=_[_0xeff7('0x2b')](db[_0xeff7('0x2c')]['rawAttributes'],function(_0x498a62){return{'name':_0x498a62['fieldName'],'type':_0x498a62['type'][_0xeff7('0x2d')]};});_0x732cdd[_0xeff7('0x2e')]=_[_0xeff7('0x2b')](_0x107036,_0xeff7('0x28'));_0x732cdd[_0xeff7('0x2f')]=_[_0xeff7('0x30')](_0x27827b[_0xeff7('0x2f')]);_0x732cdd[_0xeff7('0x31')]=_[_0xeff7('0x32')](_0x732cdd[_0xeff7('0x2e')],_0x732cdd['query']);_0xc4321d[_0xeff7('0x33')]=_['intersection'](_0x732cdd[_0xeff7('0x2e')],qs[_0xeff7('0x34')](_0x27827b[_0xeff7('0x2f')]['fields']));_0xc4321d['attributes']=_0xc4321d[_0xeff7('0x33')][_0xeff7('0x35')]?_0xc4321d[_0xeff7('0x33')]:_0x732cdd[_0xeff7('0x2e')];if(!_0x27827b[_0xeff7('0x2f')][_0xeff7('0x36')](_0xeff7('0x37'))){_0xc4321d[_0xeff7('0x1c')]=qs[_0xeff7('0x1c')](_0x27827b['query'][_0xeff7('0x1c')]);_0xc4321d[_0xeff7('0x1b')]=qs[_0xeff7('0x1b')](_0x27827b[_0xeff7('0x2f')][_0xeff7('0x1b')]);}_0xc4321d[_0xeff7('0x38')]=qs['sort'](_0x27827b[_0xeff7('0x2f')][_0xeff7('0x39')]);_0xc4321d[_0xeff7('0x3a')]=qs[_0xeff7('0x31')](_[_0xeff7('0x3b')](_0x27827b['query'],_0x732cdd['filters']),_0x107036);if(_0x27827b[_0xeff7('0x2f')]['filter']){_0xc4321d['where']=_[_0xeff7('0x3c')](_0xc4321d[_0xeff7('0x3a')],{'$or':_[_0xeff7('0x2b')](_0x107036,function(_0x4b1a37){if(_0x4b1a37[_0xeff7('0x3d')]!==_0xeff7('0x3e')){var _0x4380c4={};_0x4380c4[_0x4b1a37[_0xeff7('0x28')]]={'$like':'%'+_0x27827b[_0xeff7('0x2f')][_0xeff7('0x3f')]+'%'};return _0x4380c4;}})});}_0xc4321d=_[_0xeff7('0x3c')]({},_0xc4321d,_0x27827b[_0xeff7('0x40')]);var _0x3abe62={'where':_0xc4321d[_0xeff7('0x3a')]};return db[_0xeff7('0x2c')][_0xeff7('0x1e')](_0x3abe62)[_0xeff7('0x25')](function(_0x3d37de){_0x3aa82f[_0xeff7('0x1e')]=_0x3d37de;if(_0x27827b[_0xeff7('0x2f')][_0xeff7('0x41')]){_0xc4321d[_0xeff7('0x42')]=[{'all':!![]}];}return db[_0xeff7('0x2c')]['findAll'](_0xc4321d);})[_0xeff7('0x25')](function(_0xb7e92d){_0x3aa82f[_0xeff7('0x43')]=_0xb7e92d;return _0x3aa82f;})[_0xeff7('0x25')](respondWithFilteredResult(_0x15cdb6,_0xc4321d))[_0xeff7('0x44')](handleError(_0x15cdb6,null));};exports[_0xeff7('0x45')]=function(_0x72093b,_0x3301e4){var _0x351a99={'raw':!![],'where':{'id':_0x72093b['params']['id']}},_0x21c0df={};_0x21c0df[_0xeff7('0x2e')]=_[_0xeff7('0x30')](db[_0xeff7('0x2c')][_0xeff7('0x46')]);_0x21c0df['query']=_['keys'](_0x72093b['query']);_0x21c0df[_0xeff7('0x31')]=_['intersection'](_0x21c0df[_0xeff7('0x2e')],_0x21c0df[_0xeff7('0x2f')]);_0x351a99[_0xeff7('0x33')]=_[_0xeff7('0x32')](_0x21c0df[_0xeff7('0x2e')],qs[_0xeff7('0x34')](_0x72093b[_0xeff7('0x2f')]['fields']));_0x351a99[_0xeff7('0x33')]=_0x351a99[_0xeff7('0x33')][_0xeff7('0x35')]?_0x351a99[_0xeff7('0x33')]:_0x21c0df[_0xeff7('0x2e')];if(_0x72093b[_0xeff7('0x2f')][_0xeff7('0x41')]){_0x351a99['include']=[{'all':!![]}];}_0x351a99=_[_0xeff7('0x3c')]({},_0x351a99,_0x72093b[_0xeff7('0x40')]);return db[_0xeff7('0x2c')][_0xeff7('0x47')](_0x351a99)[_0xeff7('0x25')](handleEntityNotFound(_0x3301e4,null))[_0xeff7('0x25')](respondWithResult(_0x3301e4,null))[_0xeff7('0x44')](handleError(_0x3301e4,null));};exports[_0xeff7('0x48')]=function(_0x571bf8,_0x5e6c32){return db[_0xeff7('0x2c')]['create'](_0x571bf8[_0xeff7('0x49')],{})[_0xeff7('0x25')](respondWithResult(_0x5e6c32,0xc9))[_0xeff7('0x44')](handleError(_0x5e6c32,null));};exports['update']=function(_0x33fb4c,_0x72a06c){if(_0x33fb4c['body']['id']){delete _0x33fb4c[_0xeff7('0x49')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x33fb4c[_0xeff7('0x4a')]['id']}})[_0xeff7('0x25')](handleEntityNotFound(_0x72a06c,null))[_0xeff7('0x25')](saveUpdates(_0x33fb4c[_0xeff7('0x49')],null))[_0xeff7('0x25')](respondWithResult(_0x72a06c,null))[_0xeff7('0x44')](handleError(_0x72a06c,null));};exports[_0xeff7('0x26')]=function(_0x4818e3,_0xc18e81){return db['OpenchannelApplication'][_0xeff7('0x47')]({'where':{'id':_0x4818e3['params']['id']}})[_0xeff7('0x25')](handleEntityNotFound(_0xc18e81,null))[_0xeff7('0x25')](removeEntity(_0xc18e81,null))['catch'](handleError(_0xc18e81,null));}; \ No newline at end of file +var _0x635a=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','type','VIRTUAL','OpenchannelApplication','includeAll','include','findAll','catch','params','options','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x635a,0x186));var _0xa635=function(_0x1f7e74,_0xa04705){_0x1f7e74=_0x1f7e74-0x0;var _0x231be2=_0x635a[_0x1f7e74];return _0x231be2;};'use strict';var emlformat=require(_0xa635('0x0'));var rimraf=require(_0xa635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa635('0x2'));var moment=require('moment');var BPromise=require(_0xa635('0x3'));var Mustache=require(_0xa635('0x4'));var util=require('util');var path=require(_0xa635('0x5'));var sox=require(_0xa635('0x6'));var csv=require(_0xa635('0x7'));var ejs=require(_0xa635('0x8'));var fs=require('fs');var fs_extra=require(_0xa635('0x9'));var _=require('lodash');var squel=require(_0xa635('0xa'));var crypto=require(_0xa635('0xb'));var jsforce=require(_0xa635('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa635('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa635('0xd'));var as=require(_0xa635('0xe'));var hardwareService=require(_0xa635('0xf'));var logger=require(_0xa635('0x10'))(_0xa635('0x11'));var utils=require(_0xa635('0x12'));var config=require(_0xa635('0x13'));var licenseUtil=require(_0xa635('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d7e7b,_0x26c603){_0x26c603=_0x26c603||0xcc;return function(_0x400e17){if(_0x400e17){return _0x5d7e7b[_0xa635('0x15')](_0x26c603);}return _0x5d7e7b[_0xa635('0x16')](_0x26c603)[_0xa635('0x17')]();};}function respondWithResult(_0x30a072,_0x372530){_0x372530=_0x372530||0xc8;return function(_0x6a563d){if(_0x6a563d){return _0x30a072[_0xa635('0x16')](_0x372530)[_0xa635('0x18')](_0x6a563d);}};}function respondWithFilteredResult(_0x4c75b6,_0x2256b0){return function(_0x452909){if(_0x452909){var _0x2e0469=typeof _0x2256b0[_0xa635('0x19')]==='undefined'&&typeof _0x2256b0[_0xa635('0x1a')]===_0xa635('0x1b');var _0x265fd9=_0x452909['count'];var _0x3bb660=_0x2e0469?0x0:_0x2256b0[_0xa635('0x19')];var _0x5505bf=_0x2e0469?_0x452909[_0xa635('0x1c')]:_0x2256b0[_0xa635('0x19')]+_0x2256b0[_0xa635('0x1a')];var _0x3de9f0;if(_0x5505bf>=_0x265fd9){_0x5505bf=_0x265fd9;_0x3de9f0=0xc8;}else{_0x3de9f0=0xce;}_0x4c75b6[_0xa635('0x16')](_0x3de9f0);return _0x4c75b6[_0xa635('0x1d')](_0xa635('0x1e'),_0x3bb660+'-'+_0x5505bf+'/'+_0x265fd9)[_0xa635('0x18')](_0x452909);}return null;};}function patchUpdates(_0x3d3ddb){return function(_0x165af4){try{jsonpatch[_0xa635('0x1f')](_0x165af4,_0x3d3ddb,!![]);}catch(_0xe40f08){return BPromise[_0xa635('0x20')](_0xe40f08);}return _0x165af4[_0xa635('0x21')]();};}function saveUpdates(_0x612260,_0x152a31){return function(_0x339ddc){if(_0x339ddc){return _0x339ddc['update'](_0x612260)[_0xa635('0x22')](function(_0x79cbc7){return _0x79cbc7;});}return null;};}function removeEntity(_0x41e6b8,_0x1f2cf1){return function(_0x211d32){if(_0x211d32){return _0x211d32[_0xa635('0x23')]()[_0xa635('0x22')](function(){_0x41e6b8['status'](0xcc)[_0xa635('0x17')]();});}};}function handleEntityNotFound(_0xb6a5cb,_0x2a2a32){return function(_0x6c0d3){if(!_0x6c0d3){_0xb6a5cb[_0xa635('0x15')](0x194);}return _0x6c0d3;};}function handleError(_0x492e7b,_0x52026b){_0x52026b=_0x52026b||0x1f4;return function(_0x172a06){logger[_0xa635('0x24')](_0x172a06[_0xa635('0x25')]);if(_0x172a06['name']){delete _0x172a06['name'];}_0x492e7b[_0xa635('0x16')](_0x52026b)[_0xa635('0x26')](_0x172a06);};}exports['index']=function(_0x4e0454,_0x6b6682){var _0x3203bf={},_0x1ecc39={},_0x26b450={'count':0x0,'rows':[]};var _0x45856e=_[_0xa635('0x27')](db['OpenchannelApplication'][_0xa635('0x28')],function(_0xeec824){return{'name':_0xeec824[_0xa635('0x29')],'type':_0xeec824['type'][_0xa635('0x2a')]};});_0x1ecc39[_0xa635('0x2b')]=_['map'](_0x45856e,_0xa635('0x2c'));_0x1ecc39['query']=_[_0xa635('0x2d')](_0x4e0454[_0xa635('0x2e')]);_0x1ecc39['filters']=_['intersection'](_0x1ecc39['model'],_0x1ecc39[_0xa635('0x2e')]);_0x3203bf['attributes']=_[_0xa635('0x2f')](_0x1ecc39[_0xa635('0x2b')],qs['fields'](_0x4e0454[_0xa635('0x2e')][_0xa635('0x30')]));_0x3203bf[_0xa635('0x31')]=_0x3203bf['attributes'][_0xa635('0x32')]?_0x3203bf[_0xa635('0x31')]:_0x1ecc39[_0xa635('0x2b')];if(!_0x4e0454['query'][_0xa635('0x33')]('nolimit')){_0x3203bf[_0xa635('0x1a')]=qs[_0xa635('0x1a')](_0x4e0454['query'][_0xa635('0x1a')]);_0x3203bf['offset']=qs[_0xa635('0x19')](_0x4e0454[_0xa635('0x2e')]['offset']);}_0x3203bf['order']=qs[_0xa635('0x34')](_0x4e0454[_0xa635('0x2e')]['sort']);_0x3203bf[_0xa635('0x35')]=qs[_0xa635('0x36')](_[_0xa635('0x37')](_0x4e0454[_0xa635('0x2e')],_0x1ecc39[_0xa635('0x36')]),_0x45856e);if(_0x4e0454['query']['filter']){_0x3203bf['where']=_[_0xa635('0x38')](_0x3203bf[_0xa635('0x35')],{'$or':_[_0xa635('0x27')](_0x45856e,function(_0x4d3d2f){if(_0x4d3d2f[_0xa635('0x39')]!==_0xa635('0x3a')){var _0x234dd7={};_0x234dd7[_0x4d3d2f['name']]={'$like':'%'+_0x4e0454[_0xa635('0x2e')]['filter']+'%'};return _0x234dd7;}})});}_0x3203bf=_[_0xa635('0x38')]({},_0x3203bf,_0x4e0454['options']);var _0x49caaa={'where':_0x3203bf[_0xa635('0x35')]};return db[_0xa635('0x3b')][_0xa635('0x1c')](_0x49caaa)['then'](function(_0x5398ef){_0x26b450[_0xa635('0x1c')]=_0x5398ef;if(_0x4e0454[_0xa635('0x2e')][_0xa635('0x3c')]){_0x3203bf[_0xa635('0x3d')]=[{'all':!![]}];}return db[_0xa635('0x3b')][_0xa635('0x3e')](_0x3203bf);})[_0xa635('0x22')](function(_0x3eb0e3){_0x26b450['rows']=_0x3eb0e3;return _0x26b450;})[_0xa635('0x22')](respondWithFilteredResult(_0x6b6682,_0x3203bf))[_0xa635('0x3f')](handleError(_0x6b6682,null));};exports['show']=function(_0x3f14bf,_0x35e67f){var _0x480c00={'raw':!![],'where':{'id':_0x3f14bf[_0xa635('0x40')]['id']}},_0x2a36f5={};_0x2a36f5[_0xa635('0x2b')]=_[_0xa635('0x2d')](db['OpenchannelApplication'][_0xa635('0x28')]);_0x2a36f5['query']=_[_0xa635('0x2d')](_0x3f14bf[_0xa635('0x2e')]);_0x2a36f5[_0xa635('0x36')]=_[_0xa635('0x2f')](_0x2a36f5[_0xa635('0x2b')],_0x2a36f5['query']);_0x480c00[_0xa635('0x31')]=_[_0xa635('0x2f')](_0x2a36f5[_0xa635('0x2b')],qs[_0xa635('0x30')](_0x3f14bf[_0xa635('0x2e')]['fields']));_0x480c00[_0xa635('0x31')]=_0x480c00[_0xa635('0x31')][_0xa635('0x32')]?_0x480c00[_0xa635('0x31')]:_0x2a36f5[_0xa635('0x2b')];if(_0x3f14bf[_0xa635('0x2e')]['includeAll']){_0x480c00[_0xa635('0x3d')]=[{'all':!![]}];}_0x480c00=_[_0xa635('0x38')]({},_0x480c00,_0x3f14bf[_0xa635('0x41')]);return db[_0xa635('0x3b')][_0xa635('0x42')](_0x480c00)[_0xa635('0x22')](handleEntityNotFound(_0x35e67f,null))[_0xa635('0x22')](respondWithResult(_0x35e67f,null))['catch'](handleError(_0x35e67f,null));};exports[_0xa635('0x43')]=function(_0x191d64,_0x35af63){return db[_0xa635('0x3b')][_0xa635('0x43')](_0x191d64['body'],{})[_0xa635('0x22')](respondWithResult(_0x35af63,0xc9))[_0xa635('0x3f')](handleError(_0x35af63,null));};exports['update']=function(_0x30e51d,_0xdb3466){if(_0x30e51d[_0xa635('0x44')]['id']){delete _0x30e51d['body']['id'];}return db['OpenchannelApplication'][_0xa635('0x42')]({'where':{'id':_0x30e51d[_0xa635('0x40')]['id']}})[_0xa635('0x22')](handleEntityNotFound(_0xdb3466,null))[_0xa635('0x22')](saveUpdates(_0x30e51d['body'],null))[_0xa635('0x22')](respondWithResult(_0xdb3466,null))[_0xa635('0x3f')](handleError(_0xdb3466,null));};exports[_0xa635('0x23')]=function(_0x122be9,_0x971a51){return db[_0xa635('0x3b')][_0xa635('0x42')]({'where':{'id':_0x122be9[_0xa635('0x40')]['id']}})['then'](handleEntityNotFound(_0x971a51,null))['then'](removeEntity(_0x971a51,null))[_0xa635('0x3f')](handleError(_0x971a51,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index baafa66..fea1939 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 _0xaa86=['bluebird','request-promise','path','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0xaa86,0x110));var _0x6aa8=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xaa86[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x6aa8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6aa8('0x1'));var moment=require(_0x6aa8('0x2'));var BPromise=require(_0x6aa8('0x3'));var rp=require(_0x6aa8('0x4'));var fs=require('fs');var path=require(_0x6aa8('0x5'));var rimraf=require('rimraf');var config=require(_0x6aa8('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x6aa8('0x7')]=function(_0x37b098,_0xef8c04){return _0x37b098[_0x6aa8('0x8')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6aa8('0x9'),'collate':_0x6aa8('0xa')});}; \ No newline at end of file +var _0xb4f4=['bluebird','path','rimraf','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4aaa44,_0x53f64f){var _0x5d9de4=function(_0x5681e7){while(--_0x5681e7){_0x4aaa44['push'](_0x4aaa44['shift']());}};_0x5d9de4(++_0x53f64f);}(_0xb4f4,0x164));var _0x4b4f=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xb4f4[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var logger=require(_0x4b4f('0x2'))(_0x4b4f('0x3'));var moment=require('moment');var BPromise=require(_0x4b4f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b4f('0x5'));var rimraf=require(_0x4b4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b4f('0x7'));module[_0x4b4f('0x8')]=function(_0x407dc8,_0x4bb33b){return _0x407dc8['define']('OpenchannelApplication',attributes,{'tableName':_0x4b4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b4f('0xa'),'collate':_0x4b4f('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2e527ff..6f6b629 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 _0x3f94=['then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x3f94,0x1d2));var _0x43f9=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x3f94[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x43f9('0x0'));var util=require(_0x43f9('0x1'));var moment=require(_0x43f9('0x2'));var BPromise=require(_0x43f9('0x3'));var rs=require(_0x43f9('0x4'));var fs=require('fs');var Redis=require(_0x43f9('0x5'));var db=require(_0x43f9('0x6'))['db'];var utils=require(_0x43f9('0x7'));var logger=require(_0x43f9('0x8'))(_0x43f9('0x9'));var config=require(_0x43f9('0xa'));var jayson=require(_0x43f9('0xb'));var client=jayson[_0x43f9('0xc')][_0x43f9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x7edd55,_0x175b41,_0x157535){return new BPromise(function(_0x21d7fc,_0x1eef18){return client['request'](_0x7edd55,_0x157535)[_0x43f9('0xe')](function(_0x688d9b){logger[_0x43f9('0xf')](_0x43f9('0x10'),_0x175b41,_0x43f9('0x11'));logger['debug'](_0x43f9('0x12'),_0x175b41,_0x43f9('0x11'),JSON['stringify'](_0x688d9b));if(_0x688d9b[_0x43f9('0x13')]){if(_0x688d9b[_0x43f9('0x13')][_0x43f9('0x14')]===0x1f4){logger[_0x43f9('0x13')](_0x43f9('0x10'),_0x175b41,_0x688d9b[_0x43f9('0x13')]['message']);return _0x1eef18(_0x688d9b[_0x43f9('0x13')][_0x43f9('0x15')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x175b41,_0x688d9b[_0x43f9('0x13')][_0x43f9('0x15')]);return _0x21d7fc(_0x688d9b[_0x43f9('0x13')][_0x43f9('0x15')]);}else{logger[_0x43f9('0xf')](_0x43f9('0x10'),_0x175b41,_0x43f9('0x11'));_0x21d7fc(_0x688d9b[_0x43f9('0x16')]['message']);}})[_0x43f9('0x17')](function(_0x4a87b4){logger[_0x43f9('0x13')](_0x43f9('0x10'),_0x175b41,_0x4a87b4);_0x1eef18(_0x4a87b4);});});}exports[_0x43f9('0x18')]=function(_0x58bdaf){var _0xefaeb=this;return new Promise(function(_0x39c432,_0x28aa93){return db['OpenchannelApplication'][_0x43f9('0x19')](_0x58bdaf[_0x43f9('0x1a')],{'raw':_0x58bdaf[_0x43f9('0x1b')]?_0x58bdaf[_0x43f9('0x1b')][_0x43f9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58bdaf[_0x43f9('0x1b')]?_0x58bdaf['options'][_0x43f9('0x1d')]||null:null,'attributes':_0x58bdaf['options']?_0x58bdaf[_0x43f9('0x1b')][_0x43f9('0x1e')]||null:null,'limit':_0x58bdaf[_0x43f9('0x1b')]?_0x58bdaf[_0x43f9('0x1b')][_0x43f9('0x1f')]||null:null})[_0x43f9('0xe')](function(_0x51ce93){logger[_0x43f9('0xf')](_0x43f9('0x18'),_0x58bdaf);logger['debug'](_0x43f9('0x18'),_0x58bdaf,JSON['stringify'](_0x51ce93));_0x39c432(_0x51ce93);})[_0x43f9('0x17')](function(_0x2b634d){logger[_0x43f9('0x13')](_0x43f9('0x18'),_0x2b634d[_0x43f9('0x15')],_0x58bdaf);_0x28aa93(_0xefaeb['error'](0x1f4,_0x2b634d[_0x43f9('0x15')]));});});}; \ No newline at end of file +var _0xac5c=['OpenchannelApplication','update','body','options','raw','limit','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x2f3de5,_0x261691){var _0x42dda0=function(_0x41780d){while(--_0x41780d){_0x2f3de5['push'](_0x2f3de5['shift']());}};_0x42dda0(++_0x261691);}(_0xac5c,0x15c));var _0xcac5=function(_0x2eb410,_0x3acba2){_0x2eb410=_0x2eb410-0x0;var _0x2aaf7f=_0xac5c[_0x2eb410];return _0x2aaf7f;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcac5('0x3'));var db=require(_0xcac5('0x4'))['db'];var utils=require(_0xcac5('0x5'));var logger=require(_0xcac5('0x6'))(_0xcac5('0x7'));var config=require(_0xcac5('0x8'));var jayson=require(_0xcac5('0x9'));var client=jayson[_0xcac5('0xa')][_0xcac5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c136,_0xb22fa6,_0x5d33a9){return new BPromise(function(_0x4b425d,_0x5d0d70){return client['request'](_0x12c136,_0x5d33a9)['then'](function(_0x172abb){logger[_0xcac5('0xc')](_0xcac5('0xd'),_0xb22fa6,_0xcac5('0xe'));logger[_0xcac5('0xf')](_0xcac5('0x10'),_0xb22fa6,'request\x20sent',JSON[_0xcac5('0x11')](_0x172abb));if(_0x172abb[_0xcac5('0x12')]){if(_0x172abb[_0xcac5('0x12')][_0xcac5('0x13')]===0x1f4){logger[_0xcac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xb22fa6,_0x172abb[_0xcac5('0x12')]['message']);return _0x5d0d70(_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);}logger[_0xcac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xb22fa6,_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);return _0x4b425d(_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);}else{logger[_0xcac5('0xc')](_0xcac5('0xd'),_0xb22fa6,'request\x20sent');_0x4b425d(_0x172abb[_0xcac5('0x15')]['message']);}})[_0xcac5('0x16')](function(_0x4bd285){logger[_0xcac5('0x12')](_0xcac5('0xd'),_0xb22fa6,_0x4bd285);_0x5d0d70(_0x4bd285);});});}exports[_0xcac5('0x17')]=function(_0x263eee){var _0x39def4=this;return new Promise(function(_0x5d20b5,_0x229968){return db[_0xcac5('0x18')][_0xcac5('0x19')](_0x263eee[_0xcac5('0x1a')],{'raw':_0x263eee[_0xcac5('0x1b')]?_0x263eee['options'][_0xcac5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x263eee[_0xcac5('0x1b')]?_0x263eee['options']['where']||null:null,'attributes':_0x263eee[_0xcac5('0x1b')]?_0x263eee[_0xcac5('0x1b')]['attributes']||null:null,'limit':_0x263eee[_0xcac5('0x1b')]?_0x263eee[_0xcac5('0x1b')][_0xcac5('0x1d')]||null:null})[_0xcac5('0x1e')](function(_0x256c53){logger['info']('UpdateOpenchannelApplication',_0x263eee);logger[_0xcac5('0xf')](_0xcac5('0x17'),_0x263eee,JSON[_0xcac5('0x11')](_0x256c53));_0x5d20b5(_0x256c53);})[_0xcac5('0x16')](function(_0x1bdb02){logger[_0xcac5('0x12')](_0xcac5('0x17'),_0x1bdb02[_0xcac5('0x14')],_0x263eee);_0x229968(_0x39def4[_0xcac5('0x12')](0x1f4,_0x1bdb02[_0xcac5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 44473fc..10933ed 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 _0xb71f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','connect-timeout','express','Router'];(function(_0x3eb4f1,_0xc6a58c){var _0x2b2a44=function(_0x2cd85b){while(--_0x2cd85b){_0x3eb4f1['push'](_0x3eb4f1['shift']());}};_0x2b2a44(++_0xc6a58c);}(_0xb71f,0x131));var _0xfb71=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xb71f[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0xfb71('0x0'));var util=require(_0xfb71('0x1'));var path=require('path');var timeout=require(_0xfb71('0x2'));var express=require(_0xfb71('0x3'));var router=express[_0xfb71('0x4')]();var fs_extra=require(_0xfb71('0x5'));var auth=require(_0xfb71('0x6'));var interaction=require(_0xfb71('0x7'));var config=require(_0xfb71('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xfb71('0x9')]('/',auth[_0xfb71('0xa')](),controller['index']);router['get']('/describe',auth[_0xfb71('0xa')](),controller[_0xfb71('0xb')]);router[_0xfb71('0x9')](_0xfb71('0xc'),auth[_0xfb71('0xa')](),controller[_0xfb71('0xd')]);router[_0xfb71('0x9')](_0xfb71('0xe'),auth['isAuthenticated'](),controller[_0xfb71('0xf')]);router[_0xfb71('0x9')](_0xfb71('0x10'),auth[_0xfb71('0xa')](),controller[_0xfb71('0x11')]);router[_0xfb71('0x12')]('/',auth['isAuthenticated'](),controller[_0xfb71('0x13')]);router[_0xfb71('0x12')]('/:id/messages',auth[_0xfb71('0xa')](),controller[_0xfb71('0x14')]);router['post']('/:id/tags',auth[_0xfb71('0xa')](),interaction['tracked'](_0xfb71('0x15'),_0xfb71('0x16')),controller['addTags']);router[_0xfb71('0x17')](_0xfb71('0xc'),auth[_0xfb71('0xa')](),interaction[_0xfb71('0x18')](_0xfb71('0x15'),_0xfb71('0x19')),controller['update']);router[_0xfb71('0x1a')](_0xfb71('0xc'),auth[_0xfb71('0xa')](),interaction[_0xfb71('0x18')](_0xfb71('0x15'),_0xfb71('0x1b')),controller[_0xfb71('0x1c')]);router['delete'](_0xfb71('0x1d'),auth[_0xfb71('0xa')](),controller[_0xfb71('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x7c25=['openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','getMessages','/:id/download','download','post','tracked'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x7c25,0x16a));var _0x57c2=function(_0x228243,_0x2eb0e1){_0x228243=_0x228243-0x0;var _0x761356=_0x7c25[_0x228243];return _0x761356;};'use strict';var multer=require(_0x57c2('0x0'));var util=require(_0x57c2('0x1'));var path=require(_0x57c2('0x2'));var timeout=require(_0x57c2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57c2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x57c2('0x5'));var config=require(_0x57c2('0x6'));var controller=require(_0x57c2('0x7'));router[_0x57c2('0x8')]('/',auth[_0x57c2('0x9')](),controller['index']);router[_0x57c2('0x8')]('/describe',auth[_0x57c2('0x9')](),controller[_0x57c2('0xa')]);router[_0x57c2('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x57c2('0x9')](),controller[_0x57c2('0xb')]);router[_0x57c2('0x8')](_0x57c2('0xc'),auth[_0x57c2('0x9')](),controller[_0x57c2('0xd')]);router[_0x57c2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth[_0x57c2('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x57c2('0x9')](),interaction[_0x57c2('0xf')](_0x57c2('0x10'),_0x57c2('0x11')),controller[_0x57c2('0x12')]);router['put'](_0x57c2('0x13'),auth['isAuthenticated'](),interaction[_0x57c2('0xf')]('openchannel',_0x57c2('0x14')),controller[_0x57c2('0x15')]);router[_0x57c2('0x16')](_0x57c2('0x13'),auth[_0x57c2('0x9')](),interaction[_0x57c2('0xf')]('openchannel',_0x57c2('0x17')),controller[_0x57c2('0x18')]);router[_0x57c2('0x16')](_0x57c2('0x19'),auth[_0x57c2('0x9')](),controller[_0x57c2('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 2777ea8..ace05ba 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 _0xf323=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x5746b6,_0x19f6b1){var _0x3b444b=function(_0x4bfccd){while(--_0x4bfccd){_0x5746b6['push'](_0x5746b6['shift']());}};_0x3b444b(++_0x19f6b1);}(_0xf323,0x1c6));var _0x3f32=function(_0x13ed54,_0x3a9a09){_0x13ed54=_0x13ed54-0x0;var _0x3d6eb6=_0xf323[_0x13ed54];return _0x3d6eb6;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3f32('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3f32('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3f32('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3f32('0x2')]},'note':{'type':Sequelize[_0x3f32('0x2')]},'read1stAt':{'type':Sequelize[_0x3f32('0x1')]},'threadId':{'type':Sequelize[_0x3f32('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x3f32('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x3f32('0x3')]('in',_0x3f32('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x3f32('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x3f32('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xcb99=['BOOLEAN','STRING','ENUM','out','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1ce7cf,_0x1706be){_0x1ce7cf=_0x1ce7cf-0x0;var _0x38fe5a=_0xcb99[_0x1ce7cf];return _0x38fe5a;};'use strict';var Sequelize=require(_0x9cb9('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9cb9('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9cb9('0x2')]},'note':{'type':Sequelize[_0x9cb9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x9cb9('0x2')]},'externalUrl':{'type':Sequelize[_0x9cb9('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9cb9('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9cb9('0x3')]('in',_0x9cb9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9cb9('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x9cb9('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 973cb93..8994f14 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 _0x3d16=['update','destroy','then','error','stack','name','map','OpenchannelInteraction','fieldName','key','getOptions','findAll','openchannel','query','type','from','params','keys','rawAttributes','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch','create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','nolimit','order','sort','where','OpenchannelInteractionId','merge','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','fullname','push','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','Public','basename','existsSync','pipe','createWriteStream','out','User','System','Contact','value','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x81119e,_0x1789cc){var _0x26bc19=function(_0x1ecaaf){while(--_0x1ecaaf){_0x81119e['push'](_0x81119e['shift']());}};_0x26bc19(++_0x1789cc);}(_0x3d16,0x1d5));var _0x63d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d16[_0x2dafbe];return _0x58a45a;};'use strict';var rimraf=require(_0x63d1('0x0'));var zipdir=require(_0x63d1('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x63d1('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x63d1('0x3'));var Redis=require(_0x63d1('0x4'));var interaction=require(_0x63d1('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x63d1('0x6'));var logger=require(_0x63d1('0x7'))(_0x63d1('0x8'));var config=require(_0x63d1('0x9'));var db=require(_0x63d1('0xa'))['db'];config[_0x63d1('0xb')]=_[_0x63d1('0xc')](config[_0x63d1('0xb')],{'host':_0x63d1('0xd'),'port':0x18eb});var socket=require(_0x63d1('0xe'))(new Redis(config[_0x63d1('0xb')]));require(_0x63d1('0xf'))[_0x63d1('0x10')](socket);function respondWithStatusCode(_0x5ec140,_0x13710e){_0x13710e=_0x13710e||0xcc;return function(_0x5eec57){if(_0x5eec57){return _0x5ec140[_0x63d1('0x11')](_0x13710e);}return _0x5ec140[_0x63d1('0x12')](_0x13710e)[_0x63d1('0x13')]();};}function respondWithResult(_0x370835,_0x39c04e){_0x39c04e=_0x39c04e||0xc8;return function(_0x2bd76b){if(_0x2bd76b){return _0x370835[_0x63d1('0x12')](_0x39c04e)[_0x63d1('0x14')](_0x2bd76b);}};}function respondWithFilteredResult(_0x23a286,_0x3ed315){return function(_0x4fa3e5){if(_0x4fa3e5){var _0x344995=typeof _0x3ed315[_0x63d1('0x15')]==='undefined'&&typeof _0x3ed315[_0x63d1('0x16')]===_0x63d1('0x17');var _0x9f89e3=_0x4fa3e5[_0x63d1('0x18')];var _0x364048=_0x344995?0x0:_0x3ed315[_0x63d1('0x15')];var _0x48a6bc=_0x344995?_0x4fa3e5[_0x63d1('0x18')]:_0x3ed315[_0x63d1('0x15')]+_0x3ed315[_0x63d1('0x16')];var _0x34c18e;if(_0x48a6bc>=_0x9f89e3){_0x48a6bc=_0x9f89e3;_0x34c18e=0xc8;}else{_0x34c18e=0xce;}_0x23a286[_0x63d1('0x12')](_0x34c18e);return _0x23a286[_0x63d1('0x19')](_0x63d1('0x1a'),_0x364048+'-'+_0x48a6bc+'/'+_0x9f89e3)[_0x63d1('0x14')](_0x4fa3e5);}return null;};}function saveUpdates(_0x2a2c96){return function(_0x2b9a24){if(_0x2b9a24){return _0x2b9a24[_0x63d1('0x1b')](_0x2a2c96)['then'](function(_0x36093f){return _0x36093f;});}return null;};}function removeEntity(_0x4ad8b0){return function(_0x1dc6f5){if(_0x1dc6f5){return _0x1dc6f5[_0x63d1('0x1c')]()[_0x63d1('0x1d')](function(){_0x4ad8b0[_0x63d1('0x12')](0xcc)[_0x63d1('0x13')]();});}};}function handleEntityNotFound(_0x5519fe){return function(_0x4c4081){if(!_0x4c4081){_0x5519fe[_0x63d1('0x11')](0x194);}return _0x4c4081;};}function handleError(_0x5cc9ea,_0x197746){_0x197746=_0x197746||0x1f4;return function(_0x41115a){logger[_0x63d1('0x1e')](_0x41115a[_0x63d1('0x1f')]);if(_0x41115a[_0x63d1('0x20')]){delete _0x41115a[_0x63d1('0x20')];}_0x5cc9ea[_0x63d1('0x12')](_0x197746)['send'](_0x41115a);};}exports['index']=function(_0x59ab0e,_0x699a6c){var _0x1ecab9={};var _0xbd40c5=_[_0x63d1('0x21')](db[_0x63d1('0x22')]['rawAttributes'],function(_0x427e19){return{'name':_0x427e19[_0x63d1('0x23')],'type':_0x427e19['type'][_0x63d1('0x24')]};});_0x1ecab9=qs[_0x63d1('0x25')](_0xbd40c5,_0x59ab0e);return interaction[_0x63d1('0x26')](_0x63d1('0x27'),_0x59ab0e[_0x63d1('0x28')],_0x59ab0e['user'],_0x1ecab9,_0xbd40c5)[_0x63d1('0x1d')](respondWithFilteredResult(_0x699a6c,_0x1ecab9))['catch'](handleError(_0x699a6c,null));};exports['show']=function(_0x56588b,_0x362788){var _0x4a36fc={};if(_0x56588b['query']['type']&&_0x56588b[_0x63d1('0x28')][_0x63d1('0x29')]===_0x63d1('0x2a')){_0x4a36fc['from']=_0x56588b[_0x63d1('0x2b')]['id'];}else{_0x4a36fc['id']=_0x56588b['params']['id'];}var _0x56c5e2={'raw':![],'where':_0x4a36fc},_0x480d03={};_0x480d03['model']=_[_0x63d1('0x2c')](db[_0x63d1('0x22')][_0x63d1('0x2d')]);_0x480d03[_0x63d1('0x28')]=_[_0x63d1('0x2c')](_0x56588b[_0x63d1('0x28')]);_0x480d03[_0x63d1('0x2e')]=_[_0x63d1('0x2f')](_0x480d03[_0x63d1('0x30')],_0x480d03[_0x63d1('0x28')]);_0x56c5e2[_0x63d1('0x31')]=_[_0x63d1('0x2f')](_0x480d03[_0x63d1('0x30')],qs[_0x63d1('0x32')](_0x56588b[_0x63d1('0x28')]['fields']));_0x56c5e2['attributes']=_0x56c5e2[_0x63d1('0x31')][_0x63d1('0x33')]?_0x56c5e2[_0x63d1('0x31')]:_0x480d03['model'];if(_0x56588b[_0x63d1('0x28')][_0x63d1('0x34')]){_0x56c5e2[_0x63d1('0x35')]=[{'all':!![]}];}_0x56c5e2=_['merge']({},_0x56c5e2,_0x56588b['options']);return db[_0x63d1('0x22')][_0x63d1('0x36')](_0x56c5e2)[_0x63d1('0x1d')](handleEntityNotFound(_0x362788,null))['then'](respondWithResult(_0x362788,null))[_0x63d1('0x37')](handleError(_0x362788,null));};exports[_0x63d1('0x38')]=function(_0x3c724c,_0x1d34d9){return db[_0x63d1('0x22')]['create'](_0x3c724c[_0x63d1('0x39')],{})[_0x63d1('0x1d')](respondWithResult(_0x1d34d9,0xc9))[_0x63d1('0x37')](handleError(_0x1d34d9,null));};exports['update']=function(_0xa151bf,_0x449cac){if(_0xa151bf['body']['id']){delete _0xa151bf[_0x63d1('0x39')]['id'];}return db['OpenchannelInteraction'][_0x63d1('0x36')]({'where':{'id':_0xa151bf['params']['id']}})[_0x63d1('0x1d')](handleEntityNotFound(_0x449cac,null))[_0x63d1('0x1d')](saveUpdates(_0xa151bf[_0x63d1('0x39')],null))[_0x63d1('0x1d')](respondWithResult(_0x449cac,null))[_0x63d1('0x37')](handleError(_0x449cac,null));};exports[_0x63d1('0x1c')]=function(_0x44e116,_0x32d603){return db[_0x63d1('0x22')]['find']({'where':{'id':_0x44e116['params']['id']}})[_0x63d1('0x1d')](handleEntityNotFound(_0x32d603,null))['then'](removeEntity(_0x32d603,null))[_0x63d1('0x37')](handleError(_0x32d603,null));};exports[_0x63d1('0x3a')]=function(_0x15b38a,_0xe5a1f4){return db[_0x63d1('0x22')][_0x63d1('0x3a')]()[_0x63d1('0x1d')](respondWithResult(_0xe5a1f4,null))[_0x63d1('0x37')](handleError(_0xe5a1f4,null));};exports[_0x63d1('0x3b')]=function(_0x3254ba,_0x5eb299){return db[_0x63d1('0x3c')]['find']({'where':{'id':_0x3254ba[_0x63d1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5eb299,null))['then'](function(_0x323907){if(_0x323907){return _0x323907[_0x63d1('0x3b')](_0x3254ba['body'][_0x63d1('0x3d')],_[_0x63d1('0x3e')](_0x3254ba['body'],[_0x63d1('0x3d'),'id'])||{});}})[_0x63d1('0x1d')](respondWithResult(_0x5eb299,null))[_0x63d1('0x37')](handleError(_0x5eb299,null));};exports['getMessages']=function(_0x1e2dc5,_0x362c9a){var _0x2c76be={'raw':![],'where':{}};var _0x292fc8={};var _0x3476ce={'count':0x0,'rows':[]};return db[_0x63d1('0x22')][_0x63d1('0x3f')]({'where':{'id':_0x1e2dc5[_0x63d1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x362c9a,null))[_0x63d1('0x1d')](function(_0x336950){if(_0x336950){_0x292fc8[_0x63d1('0x30')]=_[_0x63d1('0x2c')](db[_0x63d1('0x3c')][_0x63d1('0x2d')]);_0x292fc8['query']=_[_0x63d1('0x2c')](_0x1e2dc5[_0x63d1('0x28')]);_0x292fc8[_0x63d1('0x2e')]=_[_0x63d1('0x2f')](_0x292fc8[_0x63d1('0x30')],_0x292fc8['query']);_0x2c76be['attributes']=_[_0x63d1('0x2f')](_0x292fc8[_0x63d1('0x30')],qs['fields'](_0x1e2dc5['query'][_0x63d1('0x32')]));_0x2c76be[_0x63d1('0x31')]=_0x2c76be['attributes'][_0x63d1('0x33')]?_0x2c76be[_0x63d1('0x31')]:_0x292fc8[_0x63d1('0x30')];if(!_0x1e2dc5[_0x63d1('0x28')]['hasOwnProperty'](_0x63d1('0x40'))){_0x2c76be[_0x63d1('0x16')]=qs[_0x63d1('0x16')](_0x1e2dc5['query']['limit']);_0x2c76be['offset']=qs[_0x63d1('0x15')](_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x15')]);}_0x2c76be[_0x63d1('0x41')]=qs['sort'](_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x42')]);_0x2c76be[_0x63d1('0x43')]=qs['filters'](_['pick'](_0x1e2dc5[_0x63d1('0x28')],_0x292fc8['filters']));_0x2c76be[_0x63d1('0x43')][_0x63d1('0x44')]=_0x336950['id'];if(_0x1e2dc5[_0x63d1('0x28')]['filter']){_0x2c76be[_0x63d1('0x43')]=_[_0x63d1('0x45')](_0x2c76be['where'],{'$or':_[_0x63d1('0x21')](_0x2c76be[_0x63d1('0x31')],function(_0x398d27){var _0x332455={};_0x332455[_0x398d27]={'$like':'%'+_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x46')]+'%'};return _0x332455;})});}if(_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x47')]){var _0x127bea=_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x47')]['split'](',');var _0x12fc2={};_0x12fc2[_0x127bea[0x0]]={'$gte':moment(_0x127bea[0x1])[_0x63d1('0x48')](_0x63d1('0x49'))};_0x2c76be[_0x63d1('0x43')]=_[_0x63d1('0x45')](_0x2c76be['where'],_0x12fc2);}_0x2c76be=_[_0x63d1('0x45')]({},_0x2c76be,_0x1e2dc5['options']);return db[_0x63d1('0x3c')]['count']({'where':_0x2c76be['where']})[_0x63d1('0x1d')](function(_0xb8783b){_0x3476ce[_0x63d1('0x18')]=_0xb8783b;if(_0x1e2dc5[_0x63d1('0x28')][_0x63d1('0x34')]){_0x2c76be[_0x63d1('0x35')]=[{'all':!![]}];}return db[_0x63d1('0x3c')][_0x63d1('0x26')](_0x2c76be);})[_0x63d1('0x1d')](function(_0x5270a5){_0x3476ce['rows']=_0x5270a5;return _0x3476ce;});}})['then'](respondWithFilteredResult(_0x362c9a,_0x2c76be))['catch'](handleError(_0x362c9a,null));};exports[_0x63d1('0x4a')]=function(_0x2245a4,_0x5b3bfa){return db[_0x63d1('0x22')][_0x63d1('0x36')]({'where':{'id':_0x2245a4[_0x63d1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5b3bfa,null))[_0x63d1('0x1d')](function(_0x59bb8e){if(_0x59bb8e){return _0x59bb8e[_0x63d1('0x4b')](_0x2245a4['body'][_0x63d1('0x3d')],_[_0x63d1('0x3e')](_0x2245a4[_0x63d1('0x39')],[_0x63d1('0x3d'),'id'])||{})[_0x63d1('0x4c')](function(){return db[_0x63d1('0x4d')][_0x63d1('0x26')]({'attributes':['id',_0x63d1('0x20'),_0x63d1('0x4e')],'where':{'id':_0x2245a4['body'][_0x63d1('0x3d')]}});})[_0x63d1('0x1d')](function(_0x14195d){socket[_0x63d1('0x4f')]('openchannelInteractionTags:save',{'id':Number(_0x2245a4[_0x63d1('0x2b')]['id']),'tags':_0x14195d||[]});return{'id':Number(_0x2245a4['params']['id']),'tags':_0x14195d||[]};});}})[_0x63d1('0x1d')](respondWithResult(_0x5b3bfa,null))[_0x63d1('0x37')](handleError(_0x5b3bfa,null));};exports[_0x63d1('0x50')]=function(_0x486b91,_0x5523ef){return db[_0x63d1('0x22')][_0x63d1('0x36')]({'where':{'id':_0x486b91[_0x63d1('0x2b')]['id']}})[_0x63d1('0x1d')](handleEntityNotFound(_0x5523ef,null))['then'](function(_0x1acc9f){if(_0x1acc9f){return _0x1acc9f[_0x63d1('0x50')](_0x486b91[_0x63d1('0x28')][_0x63d1('0x3d')]);}})['then'](respondWithStatusCode(_0x5523ef,null))[_0x63d1('0x37')](handleError(_0x5523ef,null));};exports[_0x63d1('0x51')]=function(_0x449361,_0x2da044){var _0x405538=moment()[_0x63d1('0x52')]()[_0x63d1('0x53')]();var _0x1a4559=path[_0x63d1('0x54')](config[_0x63d1('0x55')],_0x63d1('0x56'),_0x63d1('0x57'),_0x63d1('0x58'));var _0xb0f706=path[_0x63d1('0x54')](config[_0x63d1('0x55')],_0x63d1('0x56'),_0x63d1('0x57'),'attachments');var _0x5e656d=path[_0x63d1('0x54')](_0x1a4559,_0x405538);var _0x96021d=util['format'](_0x63d1('0x59'),_0x449361[_0x63d1('0x2b')]['id'],_0x405538);var _0x361aaf=path['join'](_0x1a4559,_0x96021d);var _0x280d6f=[];_0x280d6f['push']({'model':db['User'],'as':'User','attributes':['id',_0x63d1('0x5a')],'raw':!![]});_0x280d6f[_0x63d1('0x5b')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x63d1('0x5c'),_0x63d1('0x5d')],'raw':!![]});if(_0x449361[_0x63d1('0x28')][_0x63d1('0x5e')]){_0x280d6f[_0x63d1('0x5b')]({'model':db[_0x63d1('0x5f')],'as':_0x63d1('0x5f'),'raw':!![]});}var _0x9cb55c=[{'model':db[_0x63d1('0x3c')],'as':_0x63d1('0x60'),'attributes':['id',_0x63d1('0x39'),_0x63d1('0x61'),_0x63d1('0x62'),_0x63d1('0x63'),_0x63d1('0x64')],'include':_0x280d6f}];_0x9cb55c[_0x63d1('0x5b')]({'model':db['OpenchannelAccount'],'as':_0x63d1('0x65'),'attributes':['id',_0x63d1('0x20')]});_0x9cb55c['push']({'model':db['User'],'as':_0x63d1('0x66'),'attributes':['id','fullname']});return db[_0x63d1('0x22')]['find']({'where':{'id':_0x449361[_0x63d1('0x2b')]['id']},'include':_0x9cb55c})[_0x63d1('0x1d')](handleEntityNotFound(_0x2da044,null))[_0x63d1('0x1d')](function(_0x3193d0){if(_0x3193d0){var _0x576a72=_0x3193d0[_0x63d1('0x67')]({'plain':!![]});fs['mkdirSync'](_0x5e656d);var _0x10ea7b={'channel':_0x63d1('0x68'),'account':_0x576a72[_0x63d1('0x65')][_0x63d1('0x20')],'agent':_0x576a72[_0x63d1('0x66')]?_0x576a72['Owner'][_0x63d1('0x5a')]:_0x63d1('0x69'),'createdAt':moment(_0x576a72[_0x63d1('0x61')])[_0x63d1('0x48')](_0x63d1('0x49'))['toString'](),'closedAt':_0x576a72[_0x63d1('0x6a')]?moment(_0x576a72[_0x63d1('0x6b')])['format'](_0x63d1('0x49'))[_0x63d1('0x53')]():'','disposition':_0x576a72[_0x63d1('0x6c')],'visibility':_0x576a72['threadId']?_0x63d1('0x6d'):'Private','messages':_(_0x576a72[_0x63d1('0x60')])['filter']({'secret':![]})[_0x63d1('0x21')](function(_0x4a516b){if(_0x4a516b[_0x63d1('0x5f')]){var _0x445aa3=path[_0x63d1('0x54')](_0xb0f706,_0x4a516b['Attachment'][_0x63d1('0x6e')]);if(fs[_0x63d1('0x6f')](_0x445aa3)){fs['createReadStream'](_0x445aa3)[_0x63d1('0x70')](fs[_0x63d1('0x71')](path[_0x63d1('0x54')](_0x5e656d,_0x4a516b[_0x63d1('0x5f')][_0x63d1('0x6e')])));}}return{'date':moment(_0x4a516b[_0x63d1('0x61')])[_0x63d1('0x48')](_0x63d1('0x49'))[_0x63d1('0x53')](),'sender':_0x4a516b[_0x63d1('0x62')]===_0x63d1('0x72')?_0x4a516b[_0x63d1('0x73')]?_0x4a516b[_0x63d1('0x73')]['fullname']:_0x63d1('0x74'):_0x4a516b[_0x63d1('0x75')][_0x63d1('0x5c')]+(_0x4a516b[_0x63d1('0x75')][_0x63d1('0x5d')]?'\x20'+_0x4a516b['Contact']['lastName']:''),'body':_0x4a516b[_0x63d1('0x5f')]?_0x4a516b[_0x63d1('0x5f')]['basename']:_0x4a516b[_0x63d1('0x39')],'direction':_0x4a516b['direction']===_0x63d1('0x72')?'A':'C','secret':_0x4a516b[_0x63d1('0x63')],'read':_0x4a516b[_0x63d1('0x64')],'attachment':_0x4a516b[_0x63d1('0x5f')]};})[_0x63d1('0x76')]()};return ejs['renderFile'](path['join'](config['root'],_0x63d1('0x56'),'views','downloadInteraction.ejs'),{'interaction':_0x10ea7b})[_0x63d1('0x1d')](function(_0x316c7c){var _0x1174e0=path['join'](_0x5e656d,_0x63d1('0x77')+_0x576a72['id']+'-'+_0x405538+_0x63d1('0x78'));var _0x32c68e={'path':_0x1174e0,'channel':_0x63d1('0x68'),'interactionId':_0x576a72['id']};return pdf[_0x63d1('0x79')](_0x316c7c,_0x32c68e);})[_0x63d1('0x1d')](function(){return new Promise(function(_0x55e001,_0x554b3c){zipdir(_0x5e656d,{'saveTo':_0x361aaf},function(_0x297f62,_0x5163f3){if(_0x297f62)return _0x554b3c(_0x297f62);return _0x55e001(_0x5163f3);});})[_0x63d1('0x1d')](function(){return new Promise(function(_0xacfb36,_0x3cadab){rimraf(_0x5e656d,function(_0x8120c4){if(_0x8120c4)_0x3cadab(_0x8120c4);return _0xacfb36();});});})[_0x63d1('0x1d')](function(){return _0x2da044[_0x63d1('0x51')](_0x361aaf,_0x96021d,function(_0x685268){if(_0x685268){logger[_0x63d1('0x1e')](_0x63d1('0x7a'),_0x685268);}else{fs[_0x63d1('0x7b')](_0x361aaf);}});});});}else{return _0x2da044[_0x63d1('0x11')](0xc8);}})[_0x63d1('0x37')](handleError(_0x2da044,null));}; \ No newline at end of file +var _0x28b0=['createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','keys','filters','intersection','model','attributes','fields','length','include','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','merge','includeAll','setTags','omit','spread','Tag','color','emit','removeTags','server','tmp','join','root','attachments','transcript-%d-%s.zip','push','User','fullname','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','createdAt','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','Public','Private','Messages','map','existsSync','createReadStream','createWriteStream','basename','System','Contact','lastName','out','value','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x2e60b7,_0x4ae25e){var _0x2bbba1=function(_0x5045e0){while(--_0x5045e0){_0x2e60b7['push'](_0x2e60b7['shift']());}};_0x2bbba1(++_0x4ae25e);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x028b('0x0'));var moment=require(_0x028b('0x1'));var util=require(_0x028b('0x2'));var path=require(_0x028b('0x3'));var ejs=require(_0x028b('0x4'));var fs=require('fs');var _=require(_0x028b('0x5'));var Redis=require(_0x028b('0x6'));var interaction=require(_0x028b('0x7'));var qs=require(_0x028b('0x8'));var pdf=require(_0x028b('0x9'));var logger=require('../../config/logger')(_0x028b('0xa'));var config=require('../../config/environment');var db=require(_0x028b('0xb'))['db'];config[_0x028b('0xc')]=_[_0x028b('0xd')](config[_0x028b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x028b('0xc')]));require(_0x028b('0xe'))[_0x028b('0xf')](socket);function respondWithStatusCode(_0x27f053,_0x1cd8fc){_0x1cd8fc=_0x1cd8fc||0xcc;return function(_0x16181b){if(_0x16181b){return _0x27f053[_0x028b('0x10')](_0x1cd8fc);}return _0x27f053[_0x028b('0x11')](_0x1cd8fc)[_0x028b('0x12')]();};}function respondWithResult(_0x238b7d,_0x5683a7){_0x5683a7=_0x5683a7||0xc8;return function(_0x274b51){if(_0x274b51){return _0x238b7d[_0x028b('0x11')](_0x5683a7)[_0x028b('0x13')](_0x274b51);}};}function respondWithFilteredResult(_0x11b9f2,_0x52dd6c){return function(_0x99aed1){if(_0x99aed1){var _0x44da97=typeof _0x52dd6c[_0x028b('0x14')]===_0x028b('0x15')&&typeof _0x52dd6c[_0x028b('0x16')]===_0x028b('0x15');var _0x24c3d9=_0x99aed1['count'];var _0x2e3182=_0x44da97?0x0:_0x52dd6c[_0x028b('0x14')];var _0x5e519c=_0x44da97?_0x99aed1[_0x028b('0x17')]:_0x52dd6c['offset']+_0x52dd6c[_0x028b('0x16')];var _0x4ca9ff;if(_0x5e519c>=_0x24c3d9){_0x5e519c=_0x24c3d9;_0x4ca9ff=0xc8;}else{_0x4ca9ff=0xce;}_0x11b9f2['status'](_0x4ca9ff);return _0x11b9f2[_0x028b('0x18')](_0x028b('0x19'),_0x2e3182+'-'+_0x5e519c+'/'+_0x24c3d9)[_0x028b('0x13')](_0x99aed1);}return null;};}function saveUpdates(_0x412ff8){return function(_0x2fb4b7){if(_0x2fb4b7){return _0x2fb4b7[_0x028b('0x1a')](_0x412ff8)[_0x028b('0x1b')](function(_0x189720){return _0x189720;});}return null;};}function removeEntity(_0x4bd0b6){return function(_0x2f2307){if(_0x2f2307){return _0x2f2307[_0x028b('0x1c')]()[_0x028b('0x1b')](function(){_0x4bd0b6[_0x028b('0x11')](0xcc)[_0x028b('0x12')]();});}};}function handleEntityNotFound(_0xd49aba){return function(_0x2b6b80){if(!_0x2b6b80){_0xd49aba[_0x028b('0x10')](0x194);}return _0x2b6b80;};}function handleError(_0x502da2,_0x1ee638){_0x1ee638=_0x1ee638||0x1f4;return function(_0x456e8c){logger['error'](_0x456e8c[_0x028b('0x1d')]);if(_0x456e8c['name']){delete _0x456e8c[_0x028b('0x1e')];}_0x502da2[_0x028b('0x11')](_0x1ee638)['send'](_0x456e8c);};}exports[_0x028b('0x1f')]=function(_0x391c03,_0x9b8422){var _0x785f8c={};var _0x3b9b8b=_['map'](db[_0x028b('0x20')][_0x028b('0x21')],function(_0x3ddc82){return{'name':_0x3ddc82[_0x028b('0x22')],'type':_0x3ddc82[_0x028b('0x23')][_0x028b('0x24')]};});_0x785f8c=qs[_0x028b('0x25')](_0x3b9b8b,_0x391c03);return interaction[_0x028b('0x26')](_0x028b('0x27'),_0x391c03[_0x028b('0x28')],_0x391c03['user'],_0x785f8c,_0x3b9b8b)[_0x028b('0x1b')](respondWithFilteredResult(_0x9b8422,_0x785f8c))[_0x028b('0x29')](handleError(_0x9b8422,null));};exports[_0x028b('0x2a')]=function(_0x40d099,_0x169782){var _0xa1a55a={};if(_0x40d099['query']['type']&&_0x40d099[_0x028b('0x28')]['type']==='from'){_0xa1a55a[_0x028b('0x2b')]=_0x40d099['params']['id'];}else{_0xa1a55a['id']=_0x40d099[_0x028b('0x2c')]['id'];}var _0x3cf451={'raw':![],'where':_0xa1a55a},_0x1e42bb={};_0x1e42bb['model']=_[_0x028b('0x2d')](db[_0x028b('0x20')][_0x028b('0x21')]);_0x1e42bb[_0x028b('0x28')]=_[_0x028b('0x2d')](_0x40d099['query']);_0x1e42bb[_0x028b('0x2e')]=_[_0x028b('0x2f')](_0x1e42bb[_0x028b('0x30')],_0x1e42bb['query']);_0x3cf451[_0x028b('0x31')]=_['intersection'](_0x1e42bb[_0x028b('0x30')],qs[_0x028b('0x32')](_0x40d099[_0x028b('0x28')][_0x028b('0x32')]));_0x3cf451[_0x028b('0x31')]=_0x3cf451[_0x028b('0x31')][_0x028b('0x33')]?_0x3cf451[_0x028b('0x31')]:_0x1e42bb[_0x028b('0x30')];if(_0x40d099[_0x028b('0x28')]['includeAll']){_0x3cf451[_0x028b('0x34')]=[{'all':!![]}];}_0x3cf451=_['merge']({},_0x3cf451,_0x40d099[_0x028b('0x35')]);return db['OpenchannelInteraction'][_0x028b('0x36')](_0x3cf451)['then'](handleEntityNotFound(_0x169782,null))[_0x028b('0x1b')](respondWithResult(_0x169782,null))[_0x028b('0x29')](handleError(_0x169782,null));};exports['create']=function(_0xc96ac2,_0x2a3719){return db[_0x028b('0x20')][_0x028b('0x37')](_0xc96ac2['body'],{})[_0x028b('0x1b')](respondWithResult(_0x2a3719,0xc9))[_0x028b('0x29')](handleError(_0x2a3719,null));};exports['update']=function(_0x19833f,_0x5c3ab5){if(_0x19833f['body']['id']){delete _0x19833f[_0x028b('0x38')]['id'];}return db[_0x028b('0x20')][_0x028b('0x36')]({'where':{'id':_0x19833f['params']['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x5c3ab5,null))[_0x028b('0x1b')](saveUpdates(_0x19833f['body'],null))[_0x028b('0x1b')](respondWithResult(_0x5c3ab5,null))[_0x028b('0x29')](handleError(_0x5c3ab5,null));};exports[_0x028b('0x1c')]=function(_0x16236d,_0x5d30b8){return db['OpenchannelInteraction'][_0x028b('0x36')]({'where':{'id':_0x16236d[_0x028b('0x2c')]['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x5d30b8,null))['then'](removeEntity(_0x5d30b8,null))['catch'](handleError(_0x5d30b8,null));};exports[_0x028b('0x39')]=function(_0x46e304,_0x3c175d){return db[_0x028b('0x20')][_0x028b('0x39')]()['then'](respondWithResult(_0x3c175d,null))['catch'](handleError(_0x3c175d,null));};exports[_0x028b('0x3a')]=function(_0x1c995f,_0x4dc494){return db[_0x028b('0x3b')]['find']({'where':{'id':_0x1c995f['params']['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x4dc494,null))[_0x028b('0x1b')](function(_0x1f0100){if(_0x1f0100){return _0x1f0100['addMessage'](_0x1c995f[_0x028b('0x38')][_0x028b('0x3c')],_['omit'](_0x1c995f[_0x028b('0x38')],[_0x028b('0x3c'),'id'])||{});}})[_0x028b('0x1b')](respondWithResult(_0x4dc494,null))[_0x028b('0x29')](handleError(_0x4dc494,null));};exports[_0x028b('0x3d')]=function(_0x9fc541,_0x1a5548){var _0x17e359={'raw':![],'where':{}};var _0x49eb15={};var _0x204ffd={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x028b('0x3e')]({'where':{'id':_0x9fc541[_0x028b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1a5548,null))[_0x028b('0x1b')](function(_0xc4ebc6){if(_0xc4ebc6){_0x49eb15['model']=_[_0x028b('0x2d')](db['OpenchannelMessage'][_0x028b('0x21')]);_0x49eb15[_0x028b('0x28')]=_[_0x028b('0x2d')](_0x9fc541['query']);_0x49eb15[_0x028b('0x2e')]=_[_0x028b('0x2f')](_0x49eb15[_0x028b('0x30')],_0x49eb15[_0x028b('0x28')]);_0x17e359['attributes']=_[_0x028b('0x2f')](_0x49eb15[_0x028b('0x30')],qs['fields'](_0x9fc541[_0x028b('0x28')][_0x028b('0x32')]));_0x17e359[_0x028b('0x31')]=_0x17e359['attributes'][_0x028b('0x33')]?_0x17e359[_0x028b('0x31')]:_0x49eb15[_0x028b('0x30')];if(!_0x9fc541['query'][_0x028b('0x3f')](_0x028b('0x40'))){_0x17e359[_0x028b('0x16')]=qs[_0x028b('0x16')](_0x9fc541['query']['limit']);_0x17e359[_0x028b('0x14')]=qs[_0x028b('0x14')](_0x9fc541['query'][_0x028b('0x14')]);}_0x17e359[_0x028b('0x41')]=qs[_0x028b('0x42')](_0x9fc541['query']['sort']);_0x17e359[_0x028b('0x43')]=qs['filters'](_[_0x028b('0x44')](_0x9fc541[_0x028b('0x28')],_0x49eb15[_0x028b('0x2e')]));_0x17e359[_0x028b('0x43')][_0x028b('0x45')]=_0xc4ebc6['id'];if(_0x9fc541[_0x028b('0x28')][_0x028b('0x46')]){_0x17e359[_0x028b('0x43')]=_['merge'](_0x17e359[_0x028b('0x43')],{'$or':_['map'](_0x17e359[_0x028b('0x31')],function(_0x598238){var _0xcae47c={};_0xcae47c[_0x598238]={'$like':'%'+_0x9fc541[_0x028b('0x28')]['filter']+'%'};return _0xcae47c;})});}if(_0x9fc541['query'][_0x028b('0x47')]){var _0x32fd02=_0x9fc541['query'][_0x028b('0x47')]['split'](',');var _0x470dc0={};_0x470dc0[_0x32fd02[0x0]]={'$gte':moment(_0x32fd02[0x1])[_0x028b('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x17e359[_0x028b('0x43')]=_[_0x028b('0x49')](_0x17e359[_0x028b('0x43')],_0x470dc0);}_0x17e359=_[_0x028b('0x49')]({},_0x17e359,_0x9fc541['options']);return db[_0x028b('0x3b')][_0x028b('0x17')]({'where':_0x17e359['where']})[_0x028b('0x1b')](function(_0x16f72d){_0x204ffd[_0x028b('0x17')]=_0x16f72d;if(_0x9fc541[_0x028b('0x28')][_0x028b('0x4a')]){_0x17e359[_0x028b('0x34')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x028b('0x26')](_0x17e359);})['then'](function(_0xcd7b6b){_0x204ffd['rows']=_0xcd7b6b;return _0x204ffd;});}})[_0x028b('0x1b')](respondWithFilteredResult(_0x1a5548,_0x17e359))['catch'](handleError(_0x1a5548,null));};exports['addTags']=function(_0xf7fa0b,_0x4c74e4){return db['OpenchannelInteraction'][_0x028b('0x36')]({'where':{'id':_0xf7fa0b['params']['id']}})['then'](handleEntityNotFound(_0x4c74e4,null))[_0x028b('0x1b')](function(_0x2c6f17){if(_0x2c6f17){return _0x2c6f17[_0x028b('0x4b')](_0xf7fa0b[_0x028b('0x38')][_0x028b('0x3c')],_[_0x028b('0x4c')](_0xf7fa0b[_0x028b('0x38')],[_0x028b('0x3c'),'id'])||{})[_0x028b('0x4d')](function(){return db[_0x028b('0x4e')][_0x028b('0x26')]({'attributes':['id',_0x028b('0x1e'),_0x028b('0x4f')],'where':{'id':_0xf7fa0b[_0x028b('0x38')][_0x028b('0x3c')]}});})[_0x028b('0x1b')](function(_0x174be7){socket[_0x028b('0x50')]('openchannelInteractionTags:save',{'id':Number(_0xf7fa0b[_0x028b('0x2c')]['id']),'tags':_0x174be7||[]});return{'id':Number(_0xf7fa0b[_0x028b('0x2c')]['id']),'tags':_0x174be7||[]};});}})['then'](respondWithResult(_0x4c74e4,null))['catch'](handleError(_0x4c74e4,null));};exports['removeTags']=function(_0x55f89b,_0x24ceae){return db[_0x028b('0x20')]['find']({'where':{'id':_0x55f89b[_0x028b('0x2c')]['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x24ceae,null))[_0x028b('0x1b')](function(_0x202896){if(_0x202896){return _0x202896[_0x028b('0x51')](_0x55f89b[_0x028b('0x28')][_0x028b('0x3c')]);}})[_0x028b('0x1b')](respondWithStatusCode(_0x24ceae,null))[_0x028b('0x29')](handleError(_0x24ceae,null));};exports['download']=function(_0x40c986,_0x441c14){var _0x260c52=moment()['unix']()['toString']();var _0x1690d7=path['join'](config['root'],_0x028b('0x52'),'files',_0x028b('0x53'));var _0x335113=path[_0x028b('0x54')](config[_0x028b('0x55')],_0x028b('0x52'),'files',_0x028b('0x56'));var _0x53a306=path['join'](_0x1690d7,_0x260c52);var _0x2fcc65=util[_0x028b('0x48')](_0x028b('0x57'),_0x40c986[_0x028b('0x2c')]['id'],_0x260c52);var _0x191edc=path[_0x028b('0x54')](_0x1690d7,_0x2fcc65);var _0x6ca8f2=[];_0x6ca8f2[_0x028b('0x58')]({'model':db[_0x028b('0x59')],'as':_0x028b('0x59'),'attributes':['id',_0x028b('0x5a')],'raw':!![]});_0x6ca8f2[_0x028b('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x40c986[_0x028b('0x28')][_0x028b('0x56')]){_0x6ca8f2[_0x028b('0x58')]({'model':db[_0x028b('0x5b')],'as':_0x028b('0x5b'),'raw':!![]});}var _0x386a8f=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x028b('0x38'),'createdAt',_0x028b('0x5c'),'secret','read'],'include':_0x6ca8f2}];_0x386a8f['push']({'model':db[_0x028b('0x5d')],'as':_0x028b('0x5e'),'attributes':['id',_0x028b('0x1e')]});_0x386a8f[_0x028b('0x58')]({'model':db['User'],'as':_0x028b('0x5f'),'attributes':['id',_0x028b('0x5a')]});return db[_0x028b('0x20')][_0x028b('0x36')]({'where':{'id':_0x40c986[_0x028b('0x2c')]['id']},'include':_0x386a8f})[_0x028b('0x1b')](handleEntityNotFound(_0x441c14,null))['then'](function(_0x32bfa4){if(_0x32bfa4){var _0x49837e=_0x32bfa4[_0x028b('0x60')]({'plain':!![]});fs[_0x028b('0x61')](_0x53a306);var _0x59a186={'channel':_0x028b('0x62'),'account':_0x49837e[_0x028b('0x5e')][_0x028b('0x1e')],'agent':_0x49837e[_0x028b('0x5f')]?_0x49837e[_0x028b('0x5f')][_0x028b('0x5a')]:'N.A.','createdAt':moment(_0x49837e[_0x028b('0x63')])['format'](_0x028b('0x64'))[_0x028b('0x65')](),'closedAt':_0x49837e[_0x028b('0x66')]?moment(_0x49837e[_0x028b('0x67')])[_0x028b('0x48')](_0x028b('0x64'))[_0x028b('0x65')]():'','disposition':_0x49837e['disposition'],'visibility':_0x49837e['threadId']?_0x028b('0x68'):_0x028b('0x69'),'messages':_(_0x49837e[_0x028b('0x6a')])[_0x028b('0x46')]({'secret':![]})[_0x028b('0x6b')](function(_0x3eccc5){if(_0x3eccc5[_0x028b('0x5b')]){var _0x490f63=path[_0x028b('0x54')](_0x335113,_0x3eccc5['Attachment']['basename']);if(fs[_0x028b('0x6c')](_0x490f63)){fs[_0x028b('0x6d')](_0x490f63)['pipe'](fs[_0x028b('0x6e')](path[_0x028b('0x54')](_0x53a306,_0x3eccc5[_0x028b('0x5b')][_0x028b('0x6f')])));}}return{'date':moment(_0x3eccc5[_0x028b('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x028b('0x65')](),'sender':_0x3eccc5[_0x028b('0x5c')]==='out'?_0x3eccc5['User']?_0x3eccc5[_0x028b('0x59')]['fullname']:_0x028b('0x70'):_0x3eccc5[_0x028b('0x71')]['firstName']+(_0x3eccc5[_0x028b('0x71')][_0x028b('0x72')]?'\x20'+_0x3eccc5[_0x028b('0x71')][_0x028b('0x72')]:''),'body':_0x3eccc5[_0x028b('0x5b')]?_0x3eccc5[_0x028b('0x5b')]['basename']:_0x3eccc5[_0x028b('0x38')],'direction':_0x3eccc5['direction']===_0x028b('0x73')?'A':'C','secret':_0x3eccc5['secret'],'read':_0x3eccc5['read'],'attachment':_0x3eccc5['Attachment']};})[_0x028b('0x74')]()};return ejs['renderFile'](path[_0x028b('0x54')](config[_0x028b('0x55')],_0x028b('0x52'),'views',_0x028b('0x75')),{'interaction':_0x59a186})[_0x028b('0x1b')](function(_0x17fc31){var _0x5d0d4a=path[_0x028b('0x54')](_0x53a306,_0x028b('0x76')+_0x49837e['id']+'-'+_0x260c52+_0x028b('0x77'));var _0x3d7f65={'path':_0x5d0d4a,'channel':_0x028b('0x62'),'interactionId':_0x49837e['id']};return pdf[_0x028b('0x78')](_0x17fc31,_0x3d7f65);})['then'](function(){return new Promise(function(_0x5ebd0c,_0x3db283){zipdir(_0x53a306,{'saveTo':_0x191edc},function(_0x49a654,_0x4a7c35){if(_0x49a654)return _0x3db283(_0x49a654);return _0x5ebd0c(_0x4a7c35);});})['then'](function(){return new Promise(function(_0x2619be,_0x5ec57d){rimraf(_0x53a306,function(_0x2237e7){if(_0x2237e7)_0x5ec57d(_0x2237e7);return _0x2619be();});});})[_0x028b('0x1b')](function(){return _0x441c14[_0x028b('0x79')](_0x191edc,_0x2fcc65,function(_0xd227a2){if(_0xd227a2){logger['error'](_0x028b('0x7a'),_0xd227a2);}else{fs['unlinkSync'](_0x191edc);}});});});}else{return _0x441c14['sendStatus'](0xc8);}})[_0x028b('0x29')](handleError(_0x441c14,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c4d5fa0..e1a8c5f 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 _0x1178=['remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x5915cb,_0x5f3387){var _0x58eb91=function(_0x4aa5bf){while(--_0x4aa5bf){_0x5915cb['push'](_0x5915cb['shift']());}};_0x58eb91(++_0x5f3387);}(_0x1178,0x72));var _0x8117=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1178[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x8117('0x0'));var OpenchannelInteraction=require(_0x8117('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x8117('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8117('0x2')](0x0);var events={'afterCreate':_0x8117('0x3'),'afterUpdate':_0x8117('0x4'),'afterDestroy':_0x8117('0x5')};function emitEvent(_0x36ce3a){return function(_0x2e2380,_0x2add6b,_0x43fca3){_0x2e2380[_0x8117('0x6')]({'attributes':['id'],'raw':!![]})[_0x8117('0x7')](function(_0x404a5d){_0x2e2380[_0x8117('0x8')](_0x8117('0x9'),_0x404a5d[_0x8117('0xa')](function(_0x5bb627){return{'id':_0x5bb627['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2e2380['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8117('0x7')](function(_0x25a486){_0x2e2380[_0x8117('0x8')]('unreadMessages',_0x25a486[_0x8117('0xb')]);OpenchannelInteractionEvents[_0x8117('0xc')](_0x36ce3a+':'+_0x2e2380['id'],_0x2e2380);OpenchannelInteractionEvents[_0x8117('0xc')](_0x36ce3a,_0x2e2380);_0x43fca3(null);})[_0x8117('0xd')](_0x43fca3(null));};}for(var e in events){if(events[_0x8117('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x8117('0xf')](e,emitEvent(event));}}module[_0x8117('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6c34=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6c34,0x10b));var _0x46c3=function(_0x2b034b,_0x8ee798){_0x2b034b=_0x2b034b-0x0;var _0x5e4653=_0x6c34[_0x2b034b];return _0x5e4653;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x46c3('0x0'))['db'][_0x46c3('0x1')];var OpenchannelMessage=require(_0x46c3('0x0'))['db'][_0x46c3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x46c3('0x3')](0x0);var events={'afterCreate':_0x46c3('0x4'),'afterUpdate':_0x46c3('0x5'),'afterDestroy':_0x46c3('0x6')};function emitEvent(_0x15259f){return function(_0x59c25b,_0x1e4d34,_0x1dd932){_0x59c25b[_0x46c3('0x7')]({'attributes':['id'],'raw':!![]})[_0x46c3('0x8')](function(_0x95b372){_0x59c25b[_0x46c3('0x9')](_0x46c3('0xa'),_0x95b372['map'](function(_0x3c58ed){return{'id':_0x3c58ed['id']};}));return OpenchannelMessage[_0x46c3('0xb')]({'where':{'OpenchannelInteractionId':_0x59c25b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46c3('0x8')](function(_0x579190){_0x59c25b[_0x46c3('0x9')](_0x46c3('0xc'),_0x579190[_0x46c3('0xd')]);OpenchannelInteractionEvents[_0x46c3('0xe')](_0x15259f+':'+_0x59c25b['id'],_0x59c25b);OpenchannelInteractionEvents[_0x46c3('0xe')](_0x15259f,_0x59c25b);_0x1dd932(null);})['catch'](_0x1dd932(null));};}for(var e in events){if(events[_0x46c3('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x46c3('0x10')](e,emitEvent(event));}}module[_0x46c3('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b6670d1..3aebea6 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 _0xc213=['path','rimraf','../../config/environment','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xc213,0x19b));var _0x3c21=function(_0x275b7b,_0x3f3940){_0x275b7b=_0x275b7b-0x0;var _0x5d9e5c=_0xc213[_0x275b7b];return _0x5d9e5c;};'use strict';var _=require(_0x3c21('0x0'));var util=require(_0x3c21('0x1'));var logger=require(_0x3c21('0x2'))(_0x3c21('0x3'));var moment=require(_0x3c21('0x4'));var BPromise=require(_0x3c21('0x5'));var rp=require(_0x3c21('0x6'));var fs=require('fs');var path=require(_0x3c21('0x7'));var rimraf=require(_0x3c21('0x8'));var config=require(_0x3c21('0x9'));var attributes=require('./openchannelInteraction.attributes');module[_0x3c21('0xa')]=function(_0x41ad9e,_0x2f94f6){return _0x41ad9e[_0x3c21('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x3c21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c21('0xd'),'collate':_0x3c21('0xe'),'hooks':{'beforeUpdate':function(_0x2502f9,_0x22836a,_0x5abcbc){if(_0x2502f9[_0x3c21('0xf')]('closed')){_0x2502f9[_0x3c21('0x10')]=moment()[_0x3c21('0x11')](_0x3c21('0x12'));}_0x5abcbc(null,_0x2502f9);}}});}; \ No newline at end of file +var _0x7449=['utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions'];(function(_0x138711,_0x202fd3){var _0x31c01d=function(_0x581830){while(--_0x581830){_0x138711['push'](_0x138711['shift']());}};_0x31c01d(++_0x202fd3);}(_0x7449,0x14b));var _0x9744=function(_0x47dc95,_0x117d17){_0x47dc95=_0x47dc95-0x0;var _0x504325=_0x7449[_0x47dc95];return _0x504325;};'use strict';var _=require(_0x9744('0x0'));var util=require(_0x9744('0x1'));var logger=require(_0x9744('0x2'))(_0x9744('0x3'));var moment=require('moment');var BPromise=require(_0x9744('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9744('0x5'));var rimraf=require('rimraf');var config=require(_0x9744('0x6'));var attributes=require(_0x9744('0x7'));module[_0x9744('0x8')]=function(_0x17bd44,_0x51c031){return _0x17bd44['define'](_0x9744('0x9'),attributes,{'tableName':_0x9744('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9744('0xb'),'collate':_0x9744('0xc'),'hooks':{'beforeUpdate':function(_0x3d1177,_0xd161b,_0x17d571){if(_0x3d1177[_0x9744('0xd')](_0x9744('0xe'))){_0x3d1177[_0x9744('0xf')]=moment()[_0x9744('0x10')](_0x9744('0x11'));}_0x17d571(null,_0x3d1177);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e4925b5..d435a6b 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 _0x4c57=['raw','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','client','redis','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options'];(function(_0x27ef87,_0x1ea85b){var _0xea908=function(_0xa0a75c){while(--_0xa0a75c){_0x27ef87['push'](_0x27ef87['shift']());}};_0xea908(++_0x1ea85b);}(_0x4c57,0xa4));var _0x74c5=function(_0x2f1961,_0x41bc85){_0x2f1961=_0x2f1961-0x0;var _0x22ff83=_0x4c57[_0x2f1961];return _0x22ff83;};'use strict';var _=require(_0x74c5('0x0'));var util=require(_0x74c5('0x1'));var moment=require('moment');var BPromise=require(_0x74c5('0x2'));var rs=require(_0x74c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x74c5('0x4'));var logger=require(_0x74c5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74c5('0x6')]['http']({'port':0x232a});config[_0x74c5('0x7')]=_['defaults'](config[_0x74c5('0x7')],{'host':_0x74c5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74c5('0x7')]));require('./openchannelInteraction.socket')[_0x74c5('0x9')](socket);function respondWithRpcPromise(_0x4543d5,_0xcddba7,_0x494148){return new BPromise(function(_0x47b0d5,_0x565720){return client[_0x74c5('0xa')](_0x4543d5,_0x494148)[_0x74c5('0xb')](function(_0x6db1cf){logger['info'](_0x74c5('0xc'),_0xcddba7,_0x74c5('0xd'));logger[_0x74c5('0xe')](_0x74c5('0xf'),_0xcddba7,_0x74c5('0xd'),JSON['stringify'](_0x6db1cf));if(_0x6db1cf[_0x74c5('0x10')]){if(_0x6db1cf['error']['code']===0x1f4){logger[_0x74c5('0x10')](_0x74c5('0xc'),_0xcddba7,_0x6db1cf['error'][_0x74c5('0x11')]);return _0x565720(_0x6db1cf[_0x74c5('0x10')][_0x74c5('0x11')]);}logger[_0x74c5('0x10')](_0x74c5('0xc'),_0xcddba7,_0x6db1cf['error'][_0x74c5('0x11')]);return _0x47b0d5(_0x6db1cf[_0x74c5('0x10')][_0x74c5('0x11')]);}else{logger[_0x74c5('0x12')](_0x74c5('0xc'),_0xcddba7,_0x74c5('0xd'));_0x47b0d5(_0x6db1cf[_0x74c5('0x13')][_0x74c5('0x11')]);}})[_0x74c5('0x14')](function(_0x303d30){logger[_0x74c5('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0xcddba7,_0x303d30);_0x565720(_0x303d30);});});}exports[_0x74c5('0x15')]=function(_0x33c348){var _0x30f626=this;return new Promise(function(_0x20f45a,_0x5d68e6){return db[_0x74c5('0x16')][_0x74c5('0x17')](_0x33c348[_0x74c5('0x18')],{'raw':_0x33c348[_0x74c5('0x19')]?_0x33c348['options'][_0x74c5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c348[_0x74c5('0x19')]?_0x33c348['options']['where']||null:null,'attributes':_0x33c348[_0x74c5('0x19')]?_0x33c348[_0x74c5('0x19')][_0x74c5('0x1b')]||null:null,'limit':_0x33c348[_0x74c5('0x19')]?_0x33c348[_0x74c5('0x19')][_0x74c5('0x1c')]||null:null})['then'](function(_0x33ccdd){logger[_0x74c5('0x12')]('UpdateOpenchannelInteraction',_0x33c348);logger['debug'](_0x74c5('0x15'),_0x33c348,JSON[_0x74c5('0x1d')](_0x33ccdd));_0x20f45a(_0x33ccdd);})[_0x74c5('0x14')](function(_0x1c90de){logger[_0x74c5('0x10')](_0x74c5('0x15'),_0x1c90de[_0x74c5('0x11')],_0x33c348);_0x5d68e6(_0x30f626[_0x74c5('0x10')](0x1f4,_0x1c90de[_0x74c5('0x11')]));});});};exports[_0x74c5('0x1e')]=function(_0x48d5c1){return new Promise(function(_0x14e44c,_0x3d75dd){return db[_0x74c5('0x16')][_0x74c5('0x1f')]({'where':_0x48d5c1[_0x74c5('0x19')]?_0x48d5c1['options'][_0x74c5('0x20')]||null:null})[_0x74c5('0xb')](function(_0x3b8260){if(_0x3b8260){return _0x3b8260[_0x74c5('0x21')](_0x48d5c1[_0x74c5('0x18')][_0x74c5('0x22')],_[_0x74c5('0x23')](_0x48d5c1[_0x74c5('0x18')],[_0x74c5('0x22'),'id'])||{});}})[_0x74c5('0x24')](function(_0x1dee7c){logger[_0x74c5('0x12')]('AddTags',_0x48d5c1);logger[_0x74c5('0xe')](_0x74c5('0x25'),_0x48d5c1,JSON[_0x74c5('0x1d')](_0x1dee7c));_0x14e44c(_0x1dee7c);})[_0x74c5('0x14')](function(_0x4498d5){logger['error'](_0x74c5('0x25'),_0x4498d5['message'],_0x48d5c1);_0x3d75dd(_this[_0x74c5('0x10')](0x1f4,_0x4498d5['message']));});});}; \ No newline at end of file +var _0x8cd6=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','limit','info','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x466af3,_0x4d3ed8){var _0x4ae6f0=function(_0x18d8dd){while(--_0x18d8dd){_0x466af3['push'](_0x466af3['shift']());}};_0x4ae6f0(++_0x4d3ed8);}(_0x8cd6,0x186));var _0x68cd=function(_0x5e9850,_0x291edf){_0x5e9850=_0x5e9850-0x0;var _0x2d3d96=_0x8cd6[_0x5e9850];return _0x2d3d96;};'use strict';var _=require(_0x68cd('0x0'));var util=require('util');var moment=require(_0x68cd('0x1'));var BPromise=require('bluebird');var rs=require(_0x68cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68cd('0x3'))['db'];var utils=require(_0x68cd('0x4'));var logger=require(_0x68cd('0x5'))(_0x68cd('0x6'));var config=require(_0x68cd('0x7'));var jayson=require(_0x68cd('0x8'));var client=jayson[_0x68cd('0x9')][_0x68cd('0xa')]({'port':0x232a});config[_0x68cd('0xb')]=_['defaults'](config['redis'],{'host':_0x68cd('0xc'),'port':0x18eb});var socket=require(_0x68cd('0xd'))(new Redis(config[_0x68cd('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1c2f7a,_0x487054,_0x13ac6d){return new BPromise(function(_0x32690b,_0xfbaf9c){return client[_0x68cd('0xe')](_0x1c2f7a,_0x13ac6d)[_0x68cd('0xf')](function(_0x337dab){logger['info'](_0x68cd('0x10'),_0x487054,_0x68cd('0x11'));logger['debug'](_0x68cd('0x12'),_0x487054,_0x68cd('0x11'),JSON['stringify'](_0x337dab));if(_0x337dab[_0x68cd('0x13')]){if(_0x337dab['error']['code']===0x1f4){logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x337dab[_0x68cd('0x13')]['message']);return _0xfbaf9c(_0x337dab[_0x68cd('0x13')][_0x68cd('0x14')]);}logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x337dab[_0x68cd('0x13')]['message']);return _0x32690b(_0x337dab[_0x68cd('0x13')]['message']);}else{logger['info'](_0x68cd('0x10'),_0x487054,_0x68cd('0x11'));_0x32690b(_0x337dab[_0x68cd('0x15')][_0x68cd('0x14')]);}})[_0x68cd('0x16')](function(_0x38a25d){logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x38a25d);_0xfbaf9c(_0x38a25d);});});}exports['UpdateOpenchannelInteraction']=function(_0x2857d9){var _0x56ebaa=this;return new Promise(function(_0x267c9d,_0x3bfe5d){return db['OpenchannelInteraction'][_0x68cd('0x17')](_0x2857d9[_0x68cd('0x18')],{'raw':_0x2857d9['options']?_0x2857d9[_0x68cd('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2857d9[_0x68cd('0x19')]?_0x2857d9[_0x68cd('0x19')]['where']||null:null,'attributes':_0x2857d9[_0x68cd('0x19')]?_0x2857d9['options']['attributes']||null:null,'limit':_0x2857d9['options']?_0x2857d9[_0x68cd('0x19')][_0x68cd('0x1a')]||null:null})[_0x68cd('0xf')](function(_0x241745){logger[_0x68cd('0x1b')](_0x68cd('0x1c'),_0x2857d9);logger['debug'](_0x68cd('0x1c'),_0x2857d9,JSON[_0x68cd('0x1d')](_0x241745));_0x267c9d(_0x241745);})[_0x68cd('0x16')](function(_0x4b6d59){logger[_0x68cd('0x13')](_0x68cd('0x1c'),_0x4b6d59['message'],_0x2857d9);_0x3bfe5d(_0x56ebaa[_0x68cd('0x13')](0x1f4,_0x4b6d59['message']));});});};exports[_0x68cd('0x1e')]=function(_0x4e034a){return new Promise(function(_0x36793d,_0xb1ff59){return db['OpenchannelInteraction'][_0x68cd('0x1f')]({'where':_0x4e034a[_0x68cd('0x19')]?_0x4e034a[_0x68cd('0x19')]['where']||null:null})[_0x68cd('0xf')](function(_0x3644d8){if(_0x3644d8){return _0x3644d8['addTags'](_0x4e034a['body'][_0x68cd('0x20')],_[_0x68cd('0x21')](_0x4e034a[_0x68cd('0x18')],[_0x68cd('0x20'),'id'])||{});}})['spread'](function(_0x52522e){logger['info'](_0x68cd('0x22'),_0x4e034a);logger[_0x68cd('0x23')](_0x68cd('0x22'),_0x4e034a,JSON[_0x68cd('0x1d')](_0x52522e));_0x36793d(_0x52522e);})['catch'](function(_0xf7525a){logger[_0x68cd('0x13')](_0x68cd('0x22'),_0xf7525a[_0x68cd('0x14')],_0x4e034a);_0xb1ff59(_this[_0x68cd('0x13')](0x1f4,_0xf7525a[_0x68cd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 1f59b02..e3f8a30 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 _0x908b=['update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x908b,0x18d));var _0xb908=function(_0x4f8cc0,_0x3ae317){_0x4f8cc0=_0x4f8cc0-0x0;var _0x56716a=_0x908b[_0x4f8cc0];return _0x56716a;};'use strict';var OpenchannelInteractionEvents=require(_0xb908('0x0'));var events=[_0xb908('0x1'),'remove',_0xb908('0x2')];function createListener(_0x31431f,_0x56b5b9){return function(_0x28644a){_0x56b5b9[_0xb908('0x3')](_0x31431f,_0x28644a);};}function removeListener(_0x4d7ab4,_0x109db1){return function(){OpenchannelInteractionEvents['removeListener'](_0x4d7ab4,_0x109db1);};}exports[_0xb908('0x4')]=function(_0x95fdd4){for(var _0x5e47cb=0x0,_0x2859a6=events[_0xb908('0x5')];_0x5e47cb<_0x2859a6;_0x5e47cb++){var _0x143787=events[_0x5e47cb];var _0x243a63=createListener(_0xb908('0x6')+_0x143787,_0x95fdd4);OpenchannelInteractionEvents['on'](_0x143787,_0x243a63);}}; \ No newline at end of file +var _0xc6c8=['save','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x3c50ca,_0x540b1a){var _0x58685e=function(_0x33fb52){while(--_0x33fb52){_0x3c50ca['push'](_0x3c50ca['shift']());}};_0x58685e(++_0x540b1a);}(_0xc6c8,0x1aa));var _0x8c6c=function(_0x3d16f0,_0x3272b1){_0x3d16f0=_0x3d16f0-0x0;var _0x3cf21b=_0xc6c8[_0x3d16f0];return _0x3cf21b;};'use strict';var OpenchannelInteractionEvents=require(_0x8c6c('0x0'));var events=[_0x8c6c('0x1'),'remove',_0x8c6c('0x2')];function createListener(_0x2ba533,_0x238d04){return function(_0xd5b154){_0x238d04[_0x8c6c('0x3')](_0x2ba533,_0xd5b154);};}function removeListener(_0x7d98ff,_0x250927){return function(){OpenchannelInteractionEvents[_0x8c6c('0x4')](_0x7d98ff,_0x250927);};}exports['register']=function(_0x1955f3){for(var _0x397c7e=0x0,_0x2da388=events[_0x8c6c('0x5')];_0x397c7e<_0x2da388;_0x397c7e++){var _0x2fbf5b=events[_0x397c7e];var _0x39c127=createListener(_0x8c6c('0x6')+_0x2fbf5b,_0x1955f3);OpenchannelInteractionEvents['on'](_0x2fbf5b,_0x39c127);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 5653192..1d386ea 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x586ebb,_0x585c74){var _0x35e646=function(_0x59bd46){while(--_0x59bd46){_0x586ebb['push'](_0x586ebb['shift']());}};_0x35e646(++_0x585c74);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a52a6,_0x11eb75){_0x3a52a6=_0x3a52a6-0x0;var _0x4a7807=_0xedd9[_0x3a52a6];return _0x4a7807;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x1f7073,_0x3bb338){_0x1f7073=_0x1f7073-0x0;var _0x3edccf=_0x70e0[_0x1f7073];return _0x3edccf;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 3fe738e..74b17bc 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 _0x15b8=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x15b8,0xcd));var _0x815b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x15b8[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0x815b('0x0')]={'body':{'type':Sequelize[_0x815b('0x1')](_0x815b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x815b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x815b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x815b('0x4')),'defaultValue':_0x815b('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x815b('0x5')]},'providerName':{'type':Sequelize[_0x815b('0x6')]},'providerResponse':{'type':Sequelize[_0x815b('0x1')]}}; \ No newline at end of file +var _0x3495=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0x3495,0x1de));var _0x5349=function(_0x2824b4,_0x2efdb4){_0x2824b4=_0x2824b4-0x0;var _0x9669c8=_0x3495[_0x2824b4];return _0x9669c8;};'use strict';var Sequelize=require(_0x5349('0x0'));module[_0x5349('0x1')]={'body':{'type':Sequelize[_0x5349('0x2')](_0x5349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5349('0x5')]('in',_0x5349('0x6')),'defaultValue':_0x5349('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x5349('0x7')]},'providerResponse':{'type':Sequelize[_0x5349('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ef2b71b..dd17c55 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 _0x16b4=['readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','internal','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel'];(function(_0x41ccbb,_0x3771e8){var _0x519c61=function(_0x4724a6){while(--_0x4724a6){_0x41ccbb['push'](_0x41ccbb['shift']());}};_0x519c61(++_0x3771e8);}(_0x16b4,0xa9));var _0x416b=function(_0x58e136,_0x4f1b2e){_0x58e136=_0x58e136-0x0;var _0x575703=_0x16b4[_0x58e136];return _0x575703;};'use strict';var emlformat=require(_0x416b('0x0'));var rimraf=require(_0x416b('0x1'));var zipdir=require(_0x416b('0x2'));var jsonpatch=require(_0x416b('0x3'));var rp=require(_0x416b('0x4'));var moment=require(_0x416b('0x5'));var BPromise=require(_0x416b('0x6'));var Mustache=require(_0x416b('0x7'));var util=require(_0x416b('0x8'));var path=require(_0x416b('0x9'));var sox=require(_0x416b('0xa'));var csv=require(_0x416b('0xb'));var ejs=require(_0x416b('0xc'));var fs=require('fs');var fs_extra=require(_0x416b('0xd'));var _=require(_0x416b('0xe'));var squel=require(_0x416b('0xf'));var crypto=require(_0x416b('0x10'));var jsforce=require(_0x416b('0x11'));var deskjs=require(_0x416b('0x12'));var toCsv=require(_0x416b('0xb'));var querystring=require('querystring');var Papa=require(_0x416b('0x13'));var Redis=require(_0x416b('0x14'));var authService=require(_0x416b('0x15'));var qs=require(_0x416b('0x16'));var as=require(_0x416b('0x17'));var hardwareService=require(_0x416b('0x18'));var logger=require(_0x416b('0x19'))(_0x416b('0x1a'));var utils=require(_0x416b('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x416b('0x1c'));var db=require(_0x416b('0x1d'))['db'];config[_0x416b('0x1e')]=_[_0x416b('0x1f')](config['redis'],{'host':_0x416b('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x416b('0x1e')]));require(_0x416b('0x21'))[_0x416b('0x22')](socket);var jayson=require(_0x416b('0x23'));var client=jayson[_0x416b('0x24')]['http']({'port':0x232c});var client9002=jayson['client'][_0x416b('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x17e7e2,_0x1819c9,_0x103d58,_0x55adb9){return new BPromise(function(_0xa7a3bb,_0x40c32d){var _0x4cdfb2=_0x55adb9||client;return _0x4cdfb2['request'](_0x17e7e2,_0x103d58)[_0x416b('0x26')](function(_0xa9309e){logger[_0x416b('0x27')](_0x416b('0x28'),_0x1819c9,_0x416b('0x29'));logger[_0x416b('0x2a')](_0x416b('0x2b'),_0x1819c9,_0x416b('0x29'),JSON[_0x416b('0x2c')](_0xa9309e));if(_0xa9309e[_0x416b('0x2d')]){if(_0xa9309e[_0x416b('0x2d')][_0x416b('0x2e')]===0x1f4){logger[_0x416b('0x2d')](_0x416b('0x28'),_0x1819c9,_0xa9309e[_0x416b('0x2d')]['message']);return _0x40c32d(_0xa9309e[_0x416b('0x2d')][_0x416b('0x2f')]);}logger[_0x416b('0x2d')](_0x416b('0x28'),_0x1819c9,_0xa9309e[_0x416b('0x2d')][_0x416b('0x2f')]);return _0xa7a3bb(_0xa9309e[_0x416b('0x2d')][_0x416b('0x2f')]);}else{logger['info'](_0x416b('0x28'),_0x1819c9,'request\x20sent');_0xa7a3bb(_0xa9309e[_0x416b('0x30')]['message']);}})['catch'](function(_0x471a67){logger[_0x416b('0x2d')](_0x416b('0x28'),_0x1819c9,_0x471a67);_0x40c32d(_0x471a67);});});}function respondWithStatusCode(_0x17ec0e,_0x1f0d04){_0x1f0d04=_0x1f0d04||0xcc;return function(_0x1a0b54){if(_0x1a0b54){return _0x17ec0e[_0x416b('0x31')](_0x1f0d04);}return _0x17ec0e[_0x416b('0x32')](_0x1f0d04)[_0x416b('0x33')]();};}function respondWithResult(_0x4bd1e1,_0x541de5){_0x541de5=_0x541de5||0xc8;return function(_0x3eec09){if(_0x3eec09){return _0x4bd1e1[_0x416b('0x32')](_0x541de5)[_0x416b('0x34')](_0x3eec09);}};}function respondWithFilteredResult(_0x495995,_0x3efa32){return function(_0xd086a6){if(_0xd086a6){var _0x3762ab=typeof _0x3efa32[_0x416b('0x35')]===_0x416b('0x36')&&typeof _0x3efa32[_0x416b('0x37')]===_0x416b('0x36');var _0x12f7ca=_0xd086a6['count'];var _0x845599=_0x3762ab?0x0:_0x3efa32[_0x416b('0x35')];var _0x3e0578=_0x3762ab?_0xd086a6[_0x416b('0x38')]:_0x3efa32['offset']+_0x3efa32[_0x416b('0x37')];var _0x265b34;if(_0x3e0578>=_0x12f7ca){_0x3e0578=_0x12f7ca;_0x265b34=0xc8;}else{_0x265b34=0xce;}_0x495995[_0x416b('0x32')](_0x265b34);return _0x495995[_0x416b('0x39')]('Content-Range',_0x845599+'-'+_0x3e0578+'/'+_0x12f7ca)[_0x416b('0x34')](_0xd086a6);}return null;};}function patchUpdates(_0x42434a){return function(_0x1fc564){try{jsonpatch['apply'](_0x1fc564,_0x42434a,!![]);}catch(_0x5bf73d){return BPromise[_0x416b('0x3a')](_0x5bf73d);}return _0x1fc564['save']();};}function saveUpdates(_0x17dc57,_0x5afd2d){return function(_0x191f6e){if(_0x191f6e){return _0x191f6e[_0x416b('0x3b')](_0x17dc57)[_0x416b('0x26')](function(_0x4f064d){return _0x4f064d;});}return null;};}function removeEntity(_0x3c713d,_0x4f3556){return function(_0x345c03){if(_0x345c03){return _0x345c03[_0x416b('0x3c')]()['then'](function(){_0x3c713d[_0x416b('0x32')](0xcc)[_0x416b('0x33')]();});}};}function handleEntityNotFound(_0x276b27,_0x267ec5){return function(_0x408422){if(!_0x408422){_0x276b27[_0x416b('0x31')](0x194);}return _0x408422;};}function handleError(_0x1cc562,_0x824c4b){_0x824c4b=_0x824c4b||0x1f4;return function(_0x5a9e30){logger['error'](_0x5a9e30[_0x416b('0x3d')]);if(_0x5a9e30[_0x416b('0x3e')]){delete _0x5a9e30[_0x416b('0x3e')];}_0x1cc562[_0x416b('0x32')](_0x824c4b)[_0x416b('0x3f')](_0x5a9e30);};}exports[_0x416b('0x40')]=function(_0x1a137b,_0x31f326){var _0x2876ff={},_0x3c1c28={},_0x521af9={'count':0x0,'rows':[]};var _0x295891=_[_0x416b('0x41')](db[_0x416b('0x42')][_0x416b('0x43')],function(_0x1d2d6d){return{'name':_0x1d2d6d[_0x416b('0x44')],'type':_0x1d2d6d[_0x416b('0x45')][_0x416b('0x46')]};});_0x3c1c28[_0x416b('0x47')]=_['map'](_0x295891,_0x416b('0x3e'));_0x3c1c28[_0x416b('0x48')]=_[_0x416b('0x49')](_0x1a137b[_0x416b('0x48')]);_0x3c1c28['filters']=_['intersection'](_0x3c1c28[_0x416b('0x47')],_0x3c1c28[_0x416b('0x48')]);_0x2876ff[_0x416b('0x4a')]=_[_0x416b('0x4b')](_0x3c1c28[_0x416b('0x47')],qs['fields'](_0x1a137b[_0x416b('0x48')][_0x416b('0x4c')]));_0x2876ff[_0x416b('0x4a')]=_0x2876ff[_0x416b('0x4a')][_0x416b('0x4d')]?_0x2876ff['attributes']:_0x3c1c28['model'];if(!_0x1a137b[_0x416b('0x48')][_0x416b('0x4e')](_0x416b('0x4f'))){_0x2876ff['limit']=qs[_0x416b('0x37')](_0x1a137b[_0x416b('0x48')][_0x416b('0x37')]);_0x2876ff['offset']=qs[_0x416b('0x35')](_0x1a137b[_0x416b('0x48')][_0x416b('0x35')]);}_0x2876ff[_0x416b('0x50')]=qs[_0x416b('0x51')](_0x1a137b[_0x416b('0x48')][_0x416b('0x51')]);_0x2876ff[_0x416b('0x52')]=qs[_0x416b('0x53')](_['pick'](_0x1a137b[_0x416b('0x48')],_0x3c1c28[_0x416b('0x53')]),_0x295891);if(_0x1a137b[_0x416b('0x48')][_0x416b('0x54')]){_0x2876ff[_0x416b('0x52')]=_['merge'](_0x2876ff[_0x416b('0x52')],{'$or':_[_0x416b('0x41')](_0x295891,function(_0x1e1bbe){if(_0x1e1bbe['type']!==_0x416b('0x55')){var _0x298e8c={};_0x298e8c[_0x1e1bbe[_0x416b('0x3e')]]={'$like':'%'+_0x1a137b[_0x416b('0x48')][_0x416b('0x54')]+'%'};return _0x298e8c;}})});}_0x2876ff=_[_0x416b('0x56')]({},_0x2876ff,_0x1a137b[_0x416b('0x57')]);var _0x29ef1a={'where':_0x2876ff[_0x416b('0x52')]};return db['OpenchannelMessage']['count'](_0x29ef1a)[_0x416b('0x26')](function(_0x471fce){_0x521af9[_0x416b('0x38')]=_0x471fce;if(_0x1a137b[_0x416b('0x48')][_0x416b('0x58')]){_0x2876ff[_0x416b('0x59')]=[{'all':!![]}];}return db[_0x416b('0x42')]['findAll'](_0x2876ff);})[_0x416b('0x26')](function(_0x47584e){_0x521af9[_0x416b('0x5a')]=_0x47584e;return _0x521af9;})[_0x416b('0x26')](respondWithFilteredResult(_0x31f326,_0x2876ff))[_0x416b('0x5b')](handleError(_0x31f326,null));};exports[_0x416b('0x5c')]=function(_0x28bfa2,_0x2fc4f9){var _0x286ed2={'raw':!![],'where':{'id':_0x28bfa2[_0x416b('0x5d')]['id']}},_0x3fef0c={};_0x3fef0c['model']=_[_0x416b('0x49')](db[_0x416b('0x42')][_0x416b('0x43')]);_0x3fef0c[_0x416b('0x48')]=_[_0x416b('0x49')](_0x28bfa2['query']);_0x3fef0c['filters']=_['intersection'](_0x3fef0c[_0x416b('0x47')],_0x3fef0c['query']);_0x286ed2[_0x416b('0x4a')]=_[_0x416b('0x4b')](_0x3fef0c[_0x416b('0x47')],qs[_0x416b('0x4c')](_0x28bfa2[_0x416b('0x48')]['fields']));_0x286ed2[_0x416b('0x4a')]=_0x286ed2[_0x416b('0x4a')]['length']?_0x286ed2[_0x416b('0x4a')]:_0x3fef0c['model'];if(_0x28bfa2[_0x416b('0x48')][_0x416b('0x58')]){_0x286ed2[_0x416b('0x59')]=[{'all':!![]}];}_0x286ed2=_[_0x416b('0x56')]({},_0x286ed2,_0x28bfa2[_0x416b('0x57')]);return db[_0x416b('0x42')][_0x416b('0x5e')](_0x286ed2)[_0x416b('0x26')](handleEntityNotFound(_0x2fc4f9,null))[_0x416b('0x26')](respondWithResult(_0x2fc4f9,null))[_0x416b('0x5b')](handleError(_0x2fc4f9,null));};exports[_0x416b('0x5f')]=function(_0x54a33d,_0x1639ae){return db['OpenchannelMessage'][_0x416b('0x5f')](_0x54a33d[_0x416b('0x60')],{})[_0x416b('0x26')](respondWithResult(_0x1639ae,0xc9))[_0x416b('0x5b')](handleError(_0x1639ae,null));};exports[_0x416b('0x3b')]=function(_0x32ec3e,_0x44a43e){if(_0x32ec3e[_0x416b('0x60')]['id']){delete _0x32ec3e['body']['id'];}return db[_0x416b('0x42')][_0x416b('0x5e')]({'where':{'id':_0x32ec3e['params']['id']}})['then'](handleEntityNotFound(_0x44a43e,null))[_0x416b('0x26')](saveUpdates(_0x32ec3e['body'],null))[_0x416b('0x26')](respondWithResult(_0x44a43e,null))[_0x416b('0x5b')](handleError(_0x44a43e,null));};exports[_0x416b('0x3c')]=function(_0x31a9bf,_0x2cb1cb){return db[_0x416b('0x42')][_0x416b('0x5e')]({'where':{'id':_0x31a9bf[_0x416b('0x5d')]['id']}})[_0x416b('0x26')](handleEntityNotFound(_0x2cb1cb,null))[_0x416b('0x26')](removeEntity(_0x2cb1cb,null))['catch'](handleError(_0x2cb1cb,null));};exports[_0x416b('0x61')]=function(_0x4eefa4,_0x184ee4){return db[_0x416b('0x42')][_0x416b('0x61')]()[_0x416b('0x26')](respondWithResult(_0x184ee4,null))[_0x416b('0x5b')](handleError(_0x184ee4,null));};var interaction_log=require(_0x416b('0x19'))(_0x416b('0x62'));exports[_0x416b('0x63')]=function(_0x550f27,_0x1b199a,_0x5534a6){var _0x2b3aab={'agent':{},'channel':_0x416b('0x64')};if(_0x550f27['body']['id']){delete _0x550f27['body']['id'];}_0x550f27[_0x416b('0x60')]['read']=!![];_0x550f27[_0x416b('0x60')][_0x416b('0x65')]=moment()[_0x416b('0x66')](_0x416b('0x67'));_0x550f27[_0x416b('0x60')][_0x416b('0x68')]=_0x550f27[_0x416b('0x60')]['UserId']||_0x550f27[_0x416b('0x69')]['id'];_0x2b3aab[_0x416b('0x6a')]['id']=_0x550f27['body'][_0x416b('0x68')];return db['OpenchannelMessage']['find']({'where':{'id':_0x550f27[_0x416b('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b199a,null))[_0x416b('0x26')](saveUpdates(_0x550f27[_0x416b('0x60')],null))[_0x416b('0x26')](function(_0x3ad544){if(_0x3ad544){_0x2b3aab[_0x416b('0x2f')]=_0x3ad544[_0x416b('0x6b')]({'plain':!![]});return db[_0x416b('0x6c')]['find']({'where':{'id':_0x3ad544['OpenchannelInteractionId']}});}return null;})[_0x416b('0x26')](handleEntityNotFound(_0x1b199a,null))['then'](function(_0xd4b775){if(_0xd4b775){return _0xd4b775[_0x416b('0x3b')]({'UserId':_0x550f27[_0x416b('0x60')]['UserId'],'read1stAt':_[_0x416b('0x6d')](_0xd4b775[_0x416b('0x6e')])?moment()[_0x416b('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x416b('0x26')](function(_0x3c6965){if(_0x3c6965){_0x2b3aab[_0x416b('0x6f')]=_0x3c6965['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x550f27['user']['id'],_0x550f27[_0x416b('0x69')]['name'],_0x550f27[_0x416b('0x69')][_0x416b('0x70')],_0x2b3aab[_0x416b('0x6f')]['id'],_0x550f27[_0x416b('0x60')]?JSON[_0x416b('0x2c')](_0x550f27['body']):_0x416b('0x71'));return respondWithRpcPromise(_0x416b('0x72'),_0x416b('0x73'),_0x2b3aab);}return null;})[_0x416b('0x26')](function(_0x4679c9){var _0x1f97c9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4679c9[_0x416b('0x2f')][_0x416b('0x74')];return db['sequelize'][_0x416b('0x48')](_0x1f97c9,{'type':db['Sequelize'][_0x416b('0x75')][_0x416b('0x76')],'raw':!![]})[_0x416b('0x26')](function(_0x50c228){return _0x50c228;});})[_0x416b('0x26')](function(_0x45e8b3){if(_0x45e8b3){_0x2b3aab[_0x416b('0x2f')][_0x416b('0x77')]=_0x45e8b3[0x0];if(!_0x550f27[_0x416b('0x60')][_0x416b('0x68')])return;return db[_0x416b('0x78')]['find']({'where':{'id':_0x550f27['body'][_0x416b('0x68')],'role':'agent'},'attributes':['id',_0x416b('0x3e'),_0x416b('0x79'),_0x416b('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2df944){if(!_0x2df944)return null;_0x2b3aab['message'][_0x416b('0x6a')]=_0x2df944;return _0x2b3aab;})[_0x416b('0x26')](function(_0x2cc5d7){if(_0x2cc5d7){if(_0x550f27[_0x416b('0x60')]['manual']){_0x2b3aab[_0x416b('0x2f')][_0x416b('0x7b')]=util[_0x416b('0x66')](_0x416b('0x7c'),_0x550f27[_0x416b('0x69')][_0x416b('0x3e')]);_0x2b3aab[_0x416b('0x2f')][_0x416b('0x7d')]=_0x2b3aab[_0x416b('0x7d')];_0x2b3aab[_0x416b('0x2f')][_0x416b('0x7e')]=_0x2b3aab[_0x416b('0x7d')];_0x2b3aab[_0x416b('0x2f')][_0x416b('0x7f')]='accept';return respondWithRpcPromise(_0x416b('0x80'),_0x416b('0x80'),{'event':'acceptmessage','message':_0x2b3aab['message']},client9002)[_0x416b('0x26')](function(){return _0x2b3aab;});}return _0x2b3aab;}return null;})[_0x416b('0x26')](respondWithResult(_0x1b199a,null))[_0x416b('0x5b')](handleError(_0x1b199a,null));};var interaction_log=require(_0x416b('0x19'))('openchannel-interactions');exports[_0x416b('0x3a')]=function(_0x51e7d5,_0x22f6ae,_0x1a1761){var _0x5a23d8={'agent':{},'channel':'openchannel'};if(_0x51e7d5[_0x416b('0x60')]['id']){delete _0x51e7d5['body']['id'];}_0x51e7d5[_0x416b('0x60')]['UserId']=_0x51e7d5['body'][_0x416b('0x68')]||_0x51e7d5['user']['id'];_0x5a23d8[_0x416b('0x6a')]['id']=_0x51e7d5[_0x416b('0x60')][_0x416b('0x68')];return db[_0x416b('0x42')][_0x416b('0x5e')]({'where':{'id':_0x51e7d5['params']['id'],'UserId':null}})[_0x416b('0x26')](handleEntityNotFound(_0x22f6ae,null))[_0x416b('0x26')](function(_0x3612d1){if(_0x3612d1){_0x5a23d8[_0x416b('0x2f')]=_0x3612d1[_0x416b('0x6b')]({'plain':!![]});return db['OpenchannelInteraction'][_0x416b('0x5e')]({'where':{'id':_0x3612d1[_0x416b('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x22f6ae,null))[_0x416b('0x26')](function(_0x387875){if(_0x387875){_0x5a23d8[_0x416b('0x6f')]=_0x387875[_0x416b('0x6b')]({'plain':!![]});interaction_log['info'](_0x416b('0x82'),_0x51e7d5[_0x416b('0x69')]['id'],_0x51e7d5['user'][_0x416b('0x3e')],_0x51e7d5['user']['role'],_0x5a23d8[_0x416b('0x6f')]['id'],_0x51e7d5[_0x416b('0x60')]?JSON['stringify'](_0x51e7d5[_0x416b('0x60')]):_0x416b('0x71'));return respondWithRpcPromise(_0x416b('0x83'),_0x416b('0x84'),_0x5a23d8);}return null;})[_0x416b('0x26')](function(_0x46b7b8){var _0x58ac40='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46b7b8[_0x416b('0x2f')]['ContactId'];return db[_0x416b('0x85')][_0x416b('0x48')](_0x58ac40,{'type':db['Sequelize'][_0x416b('0x75')][_0x416b('0x76')],'raw':!![]})[_0x416b('0x26')](function(_0x282dad){return _0x282dad;});})[_0x416b('0x26')](function(_0x48108e){if(_0x48108e){_0x5a23d8[_0x416b('0x2f')][_0x416b('0x77')]=_0x48108e[0x0];if(!_0x51e7d5[_0x416b('0x60')][_0x416b('0x68')])return;return db['User'][_0x416b('0x5e')]({'where':{'id':_0x51e7d5['body'][_0x416b('0x68')],'role':_0x416b('0x6a')},'attributes':['id','name',_0x416b('0x79'),'email',_0x416b('0x86')],'raw':!![]});}return null;})[_0x416b('0x26')](function(_0x5fe261){if(!_0x5fe261)return null;_0x5a23d8['message'][_0x416b('0x6a')]=_0x5fe261;return _0x5a23d8;})['then'](function(_0x4837c5){if(_0x4837c5){_0x4837c5[_0x416b('0x2f')]['interface']=util['format'](_0x416b('0x7c'),_0x51e7d5[_0x416b('0x69')][_0x416b('0x3e')]);_0x4837c5[_0x416b('0x2f')]['channel']=_0x5a23d8[_0x416b('0x7d')];_0x4837c5[_0x416b('0x2f')][_0x416b('0x7e')]=_0x5a23d8['channel'];_0x4837c5[_0x416b('0x2f')]['event']=_0x416b('0x3a');respondWithRpcPromise(_0x416b('0x80'),'EventManager',{'event':'rejectmessage','message':_0x4837c5[_0x416b('0x2f')]},client9002);return _0x5a23d8;}return null;})[_0x416b('0x26')](respondWithResult(_0x22f6ae,null))['catch'](handleError(_0x22f6ae,null));}; \ No newline at end of file +var _0x7a3e=['squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','request','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash'];(function(_0x35466b,_0x41c842){var _0x35a9bf=function(_0x3f7777){while(--_0x3f7777){_0x35466b['push'](_0x35466b['shift']());}};_0x35a9bf(++_0x41c842);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x618e4e,_0x1193eb){_0x618e4e=_0x618e4e-0x0;var _0x25affc=_0x7a3e[_0x618e4e];return _0x25affc;};'use strict';var emlformat=require(_0xe7a3('0x0'));var rimraf=require(_0xe7a3('0x1'));var zipdir=require(_0xe7a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe7a3('0x5'));var path=require(_0xe7a3('0x6'));var sox=require(_0xe7a3('0x7'));var csv=require('to-csv');var ejs=require(_0xe7a3('0x8'));var fs=require('fs');var fs_extra=require(_0xe7a3('0x9'));var _=require(_0xe7a3('0xa'));var squel=require(_0xe7a3('0xb'));var crypto=require(_0xe7a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7a3('0xd'));var toCsv=require(_0xe7a3('0xe'));var querystring=require(_0xe7a3('0xf'));var Papa=require(_0xe7a3('0x10'));var Redis=require('ioredis');var authService=require(_0xe7a3('0x11'));var qs=require(_0xe7a3('0x12'));var as=require(_0xe7a3('0x13'));var hardwareService=require(_0xe7a3('0x14'));var logger=require(_0xe7a3('0x15'))(_0xe7a3('0x16'));var utils=require(_0xe7a3('0x17'));var config=require(_0xe7a3('0x18'));var licenseUtil=require(_0xe7a3('0x19'));var db=require(_0xe7a3('0x1a'))['db'];config[_0xe7a3('0x1b')]=_[_0xe7a3('0x1c')](config['redis'],{'host':_0xe7a3('0x1d'),'port':0x18eb});var socket=require(_0xe7a3('0x1e'))(new Redis(config[_0xe7a3('0x1b')]));require(_0xe7a3('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe7a3('0x20')][_0xe7a3('0x21')]({'port':0x232c});var client9002=jayson[_0xe7a3('0x20')][_0xe7a3('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xb53629,_0x2c8d77,_0x3da8ba,_0x6e2615){return new BPromise(function(_0x4b3bd3,_0xd87bab){var _0x57060a=_0x6e2615||client;return _0x57060a[_0xe7a3('0x22')](_0xb53629,_0x3da8ba)['then'](function(_0x568a6c){logger[_0xe7a3('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'));logger[_0xe7a3('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'),JSON[_0xe7a3('0x26')](_0x568a6c));if(_0x568a6c[_0xe7a3('0x27')]){if(_0x568a6c['error'][_0xe7a3('0x28')]===0x1f4){logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x568a6c['error'][_0xe7a3('0x2a')]);return _0xd87bab(_0x568a6c['error'][_0xe7a3('0x2a')]);}logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x568a6c[_0xe7a3('0x27')][_0xe7a3('0x2a')]);return _0x4b3bd3(_0x568a6c[_0xe7a3('0x27')][_0xe7a3('0x2a')]);}else{logger[_0xe7a3('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'));_0x4b3bd3(_0x568a6c[_0xe7a3('0x2b')][_0xe7a3('0x2a')]);}})['catch'](function(_0x1afeaf){logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x1afeaf);_0xd87bab(_0x1afeaf);});});}function respondWithStatusCode(_0x3252a8,_0x31e27c){_0x31e27c=_0x31e27c||0xcc;return function(_0x58e43b){if(_0x58e43b){return _0x3252a8[_0xe7a3('0x2c')](_0x31e27c);}return _0x3252a8[_0xe7a3('0x2d')](_0x31e27c)['end']();};}function respondWithResult(_0x42d035,_0x59ab12){_0x59ab12=_0x59ab12||0xc8;return function(_0x294593){if(_0x294593){return _0x42d035[_0xe7a3('0x2d')](_0x59ab12)[_0xe7a3('0x2e')](_0x294593);}};}function respondWithFilteredResult(_0xf952e5,_0x54cfbc){return function(_0x385b38){if(_0x385b38){var _0x36fa2e=typeof _0x54cfbc[_0xe7a3('0x2f')]===_0xe7a3('0x30')&&typeof _0x54cfbc[_0xe7a3('0x31')]===_0xe7a3('0x30');var _0x753914=_0x385b38[_0xe7a3('0x32')];var _0x3fe1c2=_0x36fa2e?0x0:_0x54cfbc[_0xe7a3('0x2f')];var _0x37f51d=_0x36fa2e?_0x385b38[_0xe7a3('0x32')]:_0x54cfbc['offset']+_0x54cfbc[_0xe7a3('0x31')];var _0x444618;if(_0x37f51d>=_0x753914){_0x37f51d=_0x753914;_0x444618=0xc8;}else{_0x444618=0xce;}_0xf952e5['status'](_0x444618);return _0xf952e5[_0xe7a3('0x33')]('Content-Range',_0x3fe1c2+'-'+_0x37f51d+'/'+_0x753914)['json'](_0x385b38);}return null;};}function patchUpdates(_0x567f44){return function(_0x1a40e0){try{jsonpatch[_0xe7a3('0x34')](_0x1a40e0,_0x567f44,!![]);}catch(_0x46d4f2){return BPromise[_0xe7a3('0x35')](_0x46d4f2);}return _0x1a40e0['save']();};}function saveUpdates(_0x2fcb02,_0x3aff03){return function(_0xbfeea6){if(_0xbfeea6){return _0xbfeea6[_0xe7a3('0x36')](_0x2fcb02)['then'](function(_0x4583ae){return _0x4583ae;});}return null;};}function removeEntity(_0x401702,_0x2133c5){return function(_0x3c01f1){if(_0x3c01f1){return _0x3c01f1['destroy']()[_0xe7a3('0x37')](function(){_0x401702[_0xe7a3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xef827f,_0x335c58){return function(_0x2d0b99){if(!_0x2d0b99){_0xef827f[_0xe7a3('0x2c')](0x194);}return _0x2d0b99;};}function handleError(_0x1df65f,_0x16781e){_0x16781e=_0x16781e||0x1f4;return function(_0x422bdb){logger[_0xe7a3('0x27')](_0x422bdb[_0xe7a3('0x38')]);if(_0x422bdb['name']){delete _0x422bdb[_0xe7a3('0x39')];}_0x1df65f[_0xe7a3('0x2d')](_0x16781e)[_0xe7a3('0x3a')](_0x422bdb);};}exports[_0xe7a3('0x3b')]=function(_0x5b89c0,_0x4659da){var _0x64c50={},_0x32d34f={},_0x5e3085={'count':0x0,'rows':[]};var _0x499d52=_[_0xe7a3('0x3c')](db[_0xe7a3('0x3d')][_0xe7a3('0x3e')],function(_0x136696){return{'name':_0x136696[_0xe7a3('0x3f')],'type':_0x136696[_0xe7a3('0x40')][_0xe7a3('0x41')]};});_0x32d34f[_0xe7a3('0x42')]=_[_0xe7a3('0x3c')](_0x499d52,'name');_0x32d34f[_0xe7a3('0x43')]=_[_0xe7a3('0x44')](_0x5b89c0['query']);_0x32d34f[_0xe7a3('0x45')]=_[_0xe7a3('0x46')](_0x32d34f[_0xe7a3('0x42')],_0x32d34f[_0xe7a3('0x43')]);_0x64c50['attributes']=_[_0xe7a3('0x46')](_0x32d34f[_0xe7a3('0x42')],qs[_0xe7a3('0x47')](_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x47')]));_0x64c50[_0xe7a3('0x48')]=_0x64c50[_0xe7a3('0x48')]['length']?_0x64c50[_0xe7a3('0x48')]:_0x32d34f['model'];if(!_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x49')](_0xe7a3('0x4a'))){_0x64c50[_0xe7a3('0x31')]=qs[_0xe7a3('0x31')](_0x5b89c0[_0xe7a3('0x43')]['limit']);_0x64c50[_0xe7a3('0x2f')]=qs['offset'](_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x2f')]);}_0x64c50[_0xe7a3('0x4b')]=qs['sort'](_0x5b89c0[_0xe7a3('0x43')]['sort']);_0x64c50['where']=qs['filters'](_[_0xe7a3('0x4c')](_0x5b89c0[_0xe7a3('0x43')],_0x32d34f[_0xe7a3('0x45')]),_0x499d52);if(_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x4d')]){_0x64c50[_0xe7a3('0x4e')]=_[_0xe7a3('0x4f')](_0x64c50[_0xe7a3('0x4e')],{'$or':_['map'](_0x499d52,function(_0x75caa9){if(_0x75caa9[_0xe7a3('0x40')]!==_0xe7a3('0x50')){var _0x4d6471={};_0x4d6471[_0x75caa9[_0xe7a3('0x39')]]={'$like':'%'+_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x4d')]+'%'};return _0x4d6471;}})});}_0x64c50=_[_0xe7a3('0x4f')]({},_0x64c50,_0x5b89c0[_0xe7a3('0x51')]);var _0x114705={'where':_0x64c50[_0xe7a3('0x4e')]};return db['OpenchannelMessage']['count'](_0x114705)[_0xe7a3('0x37')](function(_0x3e5e0e){_0x5e3085[_0xe7a3('0x32')]=_0x3e5e0e;if(_0x5b89c0['query'][_0xe7a3('0x52')]){_0x64c50['include']=[{'all':!![]}];}return db[_0xe7a3('0x3d')][_0xe7a3('0x53')](_0x64c50);})[_0xe7a3('0x37')](function(_0x572ae7){_0x5e3085[_0xe7a3('0x54')]=_0x572ae7;return _0x5e3085;})[_0xe7a3('0x37')](respondWithFilteredResult(_0x4659da,_0x64c50))[_0xe7a3('0x55')](handleError(_0x4659da,null));};exports[_0xe7a3('0x56')]=function(_0x4d170c,_0x22636e){var _0x4536cd={'raw':!![],'where':{'id':_0x4d170c[_0xe7a3('0x57')]['id']}},_0x1429a3={};_0x1429a3[_0xe7a3('0x42')]=_['keys'](db[_0xe7a3('0x3d')][_0xe7a3('0x3e')]);_0x1429a3[_0xe7a3('0x43')]=_[_0xe7a3('0x44')](_0x4d170c[_0xe7a3('0x43')]);_0x1429a3[_0xe7a3('0x45')]=_[_0xe7a3('0x46')](_0x1429a3['model'],_0x1429a3[_0xe7a3('0x43')]);_0x4536cd[_0xe7a3('0x48')]=_['intersection'](_0x1429a3[_0xe7a3('0x42')],qs['fields'](_0x4d170c[_0xe7a3('0x43')][_0xe7a3('0x47')]));_0x4536cd['attributes']=_0x4536cd[_0xe7a3('0x48')][_0xe7a3('0x58')]?_0x4536cd[_0xe7a3('0x48')]:_0x1429a3[_0xe7a3('0x42')];if(_0x4d170c[_0xe7a3('0x43')]['includeAll']){_0x4536cd[_0xe7a3('0x59')]=[{'all':!![]}];}_0x4536cd=_[_0xe7a3('0x4f')]({},_0x4536cd,_0x4d170c['options']);return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')](_0x4536cd)[_0xe7a3('0x37')](handleEntityNotFound(_0x22636e,null))[_0xe7a3('0x37')](respondWithResult(_0x22636e,null))[_0xe7a3('0x55')](handleError(_0x22636e,null));};exports[_0xe7a3('0x5b')]=function(_0x356d98,_0x3ea24b){return db[_0xe7a3('0x3d')]['create'](_0x356d98[_0xe7a3('0x5c')],{})['then'](respondWithResult(_0x3ea24b,0xc9))[_0xe7a3('0x55')](handleError(_0x3ea24b,null));};exports[_0xe7a3('0x36')]=function(_0x211a74,_0x11845c){if(_0x211a74[_0xe7a3('0x5c')]['id']){delete _0x211a74[_0xe7a3('0x5c')]['id'];}return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')]({'where':{'id':_0x211a74[_0xe7a3('0x57')]['id']}})['then'](handleEntityNotFound(_0x11845c,null))[_0xe7a3('0x37')](saveUpdates(_0x211a74[_0xe7a3('0x5c')],null))[_0xe7a3('0x37')](respondWithResult(_0x11845c,null))[_0xe7a3('0x55')](handleError(_0x11845c,null));};exports[_0xe7a3('0x5d')]=function(_0x4d5618,_0x3d9157){return db[_0xe7a3('0x3d')]['find']({'where':{'id':_0x4d5618[_0xe7a3('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d9157,null))[_0xe7a3('0x37')](removeEntity(_0x3d9157,null))['catch'](handleError(_0x3d9157,null));};exports[_0xe7a3('0x5e')]=function(_0x10c9c6,_0x5063dd){return db[_0xe7a3('0x3d')]['describe']()[_0xe7a3('0x37')](respondWithResult(_0x5063dd,null))[_0xe7a3('0x55')](handleError(_0x5063dd,null));};var interaction_log=require('../../config/logger')(_0xe7a3('0x5f'));exports[_0xe7a3('0x60')]=function(_0x17db38,_0x27edf2,_0x37bcb4){var _0x132633={'agent':{},'channel':_0xe7a3('0x61')};if(_0x17db38[_0xe7a3('0x5c')]['id']){delete _0x17db38[_0xe7a3('0x5c')]['id'];}_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x62')]=!![];_0x17db38[_0xe7a3('0x5c')]['readAt']=moment()[_0xe7a3('0x63')](_0xe7a3('0x64'));_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')]=_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')]||_0x17db38['user']['id'];_0x132633[_0xe7a3('0x66')]['id']=_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')];return db[_0xe7a3('0x3d')]['find']({'where':{'id':_0x17db38[_0xe7a3('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27edf2,null))['then'](saveUpdates(_0x17db38[_0xe7a3('0x5c')],null))['then'](function(_0x5a865c){if(_0x5a865c){_0x132633[_0xe7a3('0x2a')]=_0x5a865c[_0xe7a3('0x67')]({'plain':!![]});return db[_0xe7a3('0x68')][_0xe7a3('0x5a')]({'where':{'id':_0x5a865c[_0xe7a3('0x69')]}});}return null;})[_0xe7a3('0x37')](handleEntityNotFound(_0x27edf2,null))[_0xe7a3('0x37')](function(_0x259744){if(_0x259744){return _0x259744[_0xe7a3('0x36')]({'UserId':_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')],'read1stAt':_[_0xe7a3('0x6a')](_0x259744[_0xe7a3('0x6b')])?moment()[_0xe7a3('0x63')](_0xe7a3('0x64')):undefined});}return null;})[_0xe7a3('0x37')](function(_0x673c11){if(_0x673c11){_0x132633['interaction']=_0x673c11[_0xe7a3('0x67')]({'plain':!![]});interaction_log[_0xe7a3('0x23')](_0xe7a3('0x6c'),_0x17db38[_0xe7a3('0x6d')]['id'],_0x17db38[_0xe7a3('0x6d')]['name'],_0x17db38[_0xe7a3('0x6d')][_0xe7a3('0x6e')],_0x132633[_0xe7a3('0x6f')]['id'],_0x17db38[_0xe7a3('0x5c')]?JSON['stringify'](_0x17db38[_0xe7a3('0x5c')]):'null');return respondWithRpcPromise(_0xe7a3('0x70'),_0xe7a3('0x71'),_0x132633);}return null;})[_0xe7a3('0x37')](function(_0x168376){var _0x3809d1=_0xe7a3('0x72')+_0x168376[_0xe7a3('0x2a')][_0xe7a3('0x73')];return db[_0xe7a3('0x74')]['query'](_0x3809d1,{'type':db[_0xe7a3('0x75')][_0xe7a3('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x200b62){return _0x200b62;});})[_0xe7a3('0x37')](function(_0x14cbee){if(_0x14cbee){_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x77')]=_0x14cbee[0x0];if(!_0x17db38['body'][_0xe7a3('0x65')])return;return db[_0xe7a3('0x78')][_0xe7a3('0x5a')]({'where':{'id':_0x17db38['body'][_0xe7a3('0x65')],'role':_0xe7a3('0x66')},'attributes':['id',_0xe7a3('0x39'),_0xe7a3('0x79'),_0xe7a3('0x7a'),_0xe7a3('0x7b')],'raw':!![]});}return null;})[_0xe7a3('0x37')](function(_0x515d02){if(!_0x515d02)return null;_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x66')]=_0x515d02;return _0x132633;})[_0xe7a3('0x37')](function(_0x1df2e3){if(_0x1df2e3){if(_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x7c')]){_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x7d')]=util[_0xe7a3('0x63')](_0xe7a3('0x7e'),_0x17db38['user'][_0xe7a3('0x39')]);_0x132633['message'][_0xe7a3('0x7f')]=_0x132633[_0xe7a3('0x7f')];_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x80')]=_0x132633[_0xe7a3('0x7f')];_0x132633[_0xe7a3('0x2a')]['event']=_0xe7a3('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe7a3('0x81'),'message':_0x132633[_0xe7a3('0x2a')]},client9002)['then'](function(){return _0x132633;});}return _0x132633;}return null;})['then'](respondWithResult(_0x27edf2,null))[_0xe7a3('0x55')](handleError(_0x27edf2,null));};var interaction_log=require(_0xe7a3('0x15'))(_0xe7a3('0x5f'));exports[_0xe7a3('0x35')]=function(_0x3121d6,_0x27583a,_0x440cb1){var _0x111f86={'agent':{},'channel':_0xe7a3('0x61')};if(_0x3121d6['body']['id']){delete _0x3121d6['body']['id'];}_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')]=_0x3121d6[_0xe7a3('0x5c')]['UserId']||_0x3121d6[_0xe7a3('0x6d')]['id'];_0x111f86[_0xe7a3('0x66')]['id']=_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')];return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')]({'where':{'id':_0x3121d6[_0xe7a3('0x57')]['id'],'UserId':null}})[_0xe7a3('0x37')](handleEntityNotFound(_0x27583a,null))[_0xe7a3('0x37')](function(_0x4288b7){if(_0x4288b7){_0x111f86[_0xe7a3('0x2a')]=_0x4288b7[_0xe7a3('0x67')]({'plain':!![]});return db[_0xe7a3('0x68')][_0xe7a3('0x5a')]({'where':{'id':_0x4288b7[_0xe7a3('0x69')]}});}return null;})[_0xe7a3('0x37')](handleEntityNotFound(_0x27583a,null))['then'](function(_0x4a03f8){if(_0x4a03f8){_0x111f86[_0xe7a3('0x6f')]=_0x4a03f8[_0xe7a3('0x67')]({'plain':!![]});interaction_log[_0xe7a3('0x23')](_0xe7a3('0x82'),_0x3121d6['user']['id'],_0x3121d6['user'][_0xe7a3('0x39')],_0x3121d6[_0xe7a3('0x6d')]['role'],_0x111f86['interaction']['id'],_0x3121d6[_0xe7a3('0x5c')]?JSON[_0xe7a3('0x26')](_0x3121d6[_0xe7a3('0x5c')]):'null');return respondWithRpcPromise(_0xe7a3('0x83'),_0xe7a3('0x84'),_0x111f86);}return null;})[_0xe7a3('0x37')](function(_0x18dc64){var _0x2d622e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18dc64['message'][_0xe7a3('0x73')];return db['sequelize'][_0xe7a3('0x43')](_0x2d622e,{'type':db[_0xe7a3('0x75')][_0xe7a3('0x76')]['SELECT'],'raw':!![]})[_0xe7a3('0x37')](function(_0x19f01e){return _0x19f01e;});})[_0xe7a3('0x37')](function(_0x8c1331){if(_0x8c1331){_0x111f86['message'][_0xe7a3('0x77')]=_0x8c1331[0x0];if(!_0x3121d6['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')],'role':_0xe7a3('0x66')},'attributes':['id','name',_0xe7a3('0x79'),'email',_0xe7a3('0x7b')],'raw':!![]});}return null;})[_0xe7a3('0x37')](function(_0x33130b){if(!_0x33130b)return null;_0x111f86[_0xe7a3('0x2a')][_0xe7a3('0x66')]=_0x33130b;return _0x111f86;})['then'](function(_0x2b752c){if(_0x2b752c){_0x2b752c['message'][_0xe7a3('0x7d')]=util[_0xe7a3('0x63')]('SIP/%s',_0x3121d6[_0xe7a3('0x6d')][_0xe7a3('0x39')]);_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x7f')]=_0x111f86['channel'];_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x80')]=_0x111f86[_0xe7a3('0x7f')];_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x85')]=_0xe7a3('0x35');respondWithRpcPromise(_0xe7a3('0x86'),_0xe7a3('0x86'),{'event':'rejectmessage','message':_0x2b752c[_0xe7a3('0x2a')]},client9002);return _0x111f86;}return null;})[_0xe7a3('0x37')](respondWithResult(_0x27583a,null))[_0xe7a3('0x55')](handleError(_0x27583a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 7cc862b..ed02ba2 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 _0xe87a=['events','../../mysqldb','OpenchannelMessage','update','remove','hasOwnProperty','hook','exports'];(function(_0x59ebe3,_0x5a9e6d){var _0x1c40b3=function(_0x3a8381){while(--_0x3a8381){_0x59ebe3['push'](_0x59ebe3['shift']());}};_0x1c40b3(++_0x5a9e6d);}(_0xe87a,0x1d8));var _0xae87=function(_0x475290,_0x322bd9){_0x475290=_0x475290-0x0;var _0x49e209=_0xe87a[_0x475290];return _0x49e209;};'use strict';var EventEmitter=require(_0xae87('0x0'));var OpenchannelMessage=require(_0xae87('0x1'))['db'][_0xae87('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xae87('0x3'),'afterDestroy':_0xae87('0x4')};function emitEvent(_0x16a85a){return function(_0x1488f4,_0x11ff26,_0x4a6414){OpenchannelMessageEvents['emit'](_0x16a85a+':'+_0x1488f4['id'],_0x1488f4);OpenchannelMessageEvents['emit'](_0x16a85a,_0x1488f4);_0x4a6414(null);};}for(var e in events){if(events[_0xae87('0x5')](e)){var event=events[e];OpenchannelMessage[_0xae87('0x6')](e,emitEvent(event));}}module[_0xae87('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xf93f=['remove','emit','hasOwnProperty','save','update'];(function(_0x3eecf6,_0x2f4038){var _0x1458a4=function(_0x5b3fb6){while(--_0x5b3fb6){_0x3eecf6['push'](_0x3eecf6['shift']());}};_0x1458a4(++_0x2f4038);}(_0xf93f,0x111));var _0xff93=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0xf93f[_0x26e0d9];return _0x3ed4bb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff93('0x0'),'afterUpdate':_0xff93('0x1'),'afterDestroy':_0xff93('0x2')};function emitEvent(_0x1b6101){return function(_0x304155,_0x209a30,_0x15a64){OpenchannelMessageEvents[_0xff93('0x3')](_0x1b6101+':'+_0x304155['id'],_0x304155);OpenchannelMessageEvents[_0xff93('0x3')](_0x1b6101,_0x304155);_0x15a64(null);};}for(var e in events){if(events[_0xff93('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 7c3234e..29c40cf 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 _0x01f7=['exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes'];(function(_0x3edd1b,_0x24537e){var _0x7d1725=function(_0x4d5976){while(--_0x4d5976){_0x3edd1b['push'](_0x3edd1b['shift']());}};_0x7d1725(++_0x24537e);}(_0x01f7,0x1d8));var _0x701f=function(_0x37affd,_0x53e54d){_0x37affd=_0x37affd-0x0;var _0x5c385a=_0x01f7[_0x37affd];return _0x5c385a;};'use strict';var _=require('lodash');var util=require(_0x701f('0x0'));var logger=require(_0x701f('0x1'))(_0x701f('0x2'));var moment=require(_0x701f('0x3'));var BPromise=require('bluebird');var rp=require(_0x701f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x701f('0x5'));var config=require(_0x701f('0x6'));var attributes=require(_0x701f('0x7'));module[_0x701f('0x8')]=function(_0x2a040f,_0x2e5df6){return _0x2a040f[_0x701f('0x9')](_0x701f('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x701f('0xb'),'fields':[_0x701f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x418432,_0x5e0144,_0x2a5dc4){var _0x4f610f=_0x2a040f[_0x701f('0xd')];var _0x494fb3=_0x418432[_0x701f('0xe')]({'plain':!![]});if(_0x494fb3[_0x701f('0xf')][_0x701f('0x10')]()==='in'||_0x494fb3['direction'][_0x701f('0x10')]()===_0x701f('0x11')&&!_0x494fb3[_0x701f('0x12')]&&!_[_0x701f('0x13')](_0x494fb3['UserId'])){_0x4f610f[_0x701f('0x14')][_0x701f('0x15')]({'where':{'id':_0x494fb3[_0x701f('0x16')]}})[_0x701f('0x17')](function(_0x4f03ac){if(_0x4f03ac){_0x4f03ac[_0x701f('0x18')]({'lastMsgAt':_0x494fb3[_0x701f('0x19')],'lastMsgDirection':_0x494fb3[_0x701f('0xf')][_0x701f('0x10')]()});}})[_0x701f('0x1a')](function(_0x14b0bd){console[_0x701f('0x1b')](_0x14b0bd);});}if(_0x494fb3[_0x701f('0xf')]==='out'&&!_0x494fb3['secret']){var _0x54574a;_0x4f610f[_0x701f('0x1c')]['describe']()['then'](function(_0x552a60){return _0x4f610f['OpenchannelAccount'][_0x701f('0x1d')]({'where':{'id':_0x494fb3[_0x701f('0x1e')]},'include':[{'model':_0x4f610f['OpenchannelInteraction'],'as':_0x701f('0x1f'),'where':{'id':_0x494fb3[_0x701f('0x16')]},'limit':0x1,'include':[{'model':_0x4f610f[_0x701f('0x1c')],'as':_0x701f('0x20'),'attributes':_[_0x701f('0x21')](_0x552a60)}]}]});})['then'](function(_0x43a2de){_0x54574a=_0x43a2de[_0x701f('0xe')]({'plain':!![]});if(_0x54574a&&_0x54574a[_0x701f('0x22')]){logger['info'](_0x701f('0x23'),_0x701f('0x24'),util[_0x701f('0x25')](_0x701f('0x26'),_0x494fb3['id'],_0x54574a[_0x701f('0x22')]));if(_0x54574a[_0x701f('0x1f')]&&_0x54574a[_0x701f('0x1f')][_0x701f('0x27')]){_0x494fb3[_0x701f('0x28')]=_[_0x701f('0x29')](_0x54574a['Interactions'][0x0],'Contact');_0x494fb3[_0x701f('0x20')]=_0x54574a[_0x701f('0x1f')][0x0][_0x701f('0x20')];}var _0x5e0144={'method':_0x701f('0x2a'),'uri':encodeURI(_0x54574a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5e0144['method']){case _0x701f('0x2b'):_0x5e0144['qs']=_0x494fb3;break;case _0x701f('0x2a'):_0x5e0144[_0x701f('0xc')]=_0x494fb3;break;}return rp(_0x5e0144)[_0x701f('0x17')](function(_0x40c960){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x701f('0x25')](_0x701f('0x2c'),_0x494fb3['id'],_0x54574a[_0x701f('0x22')]));if(_0x40c960['body'][_0x701f('0x2d')]&&_0x40c960['body'][_0x701f('0x2d')]!=_0x494fb3[_0x701f('0x28')][_0x701f('0x2d')]){return _0x4f610f[_0x701f('0x14')][_0x701f('0x18')]({'threadId':_0x40c960[_0x701f('0xc')][_0x701f('0x2d')]},{'where':{'id':_0x494fb3['Interaction']['id']}});}else{return;}})[_0x701f('0x17')](function(){return _0x418432['update']({'read':!![]});})[_0x701f('0x1a')](function(_0xe3084e){logger['error'](_0x701f('0x23'),_0x701f('0x24'),util[_0x701f('0x2e')](_0xe3084e,{'showHidden':![],'depth':null}));_0x2a5dc4();});}else{_0x2a5dc4();}})[_0x701f('0x2f')](function(){_0x2a5dc4();});}else{_0x2a5dc4();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x87a3=['Interaction','omit','POST','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length'];(function(_0x27995d,_0x2715be){var _0x45f0b2=function(_0x1580f2){while(--_0x1580f2){_0x27995d['push'](_0x27995d['shift']());}};_0x45f0b2(++_0x2715be);}(_0x87a3,0x1bc));var _0x387a=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x87a3[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x387a('0x0'));var util=require('util');var logger=require(_0x387a('0x1'))('api');var moment=require(_0x387a('0x2'));var BPromise=require(_0x387a('0x3'));var rp=require(_0x387a('0x4'));var fs=require('fs');var path=require(_0x387a('0x5'));var rimraf=require(_0x387a('0x6'));var config=require(_0x387a('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x519ac7,_0x2dde0b){return _0x519ac7[_0x387a('0x8')](_0x387a('0x9'),attributes,{'tableName':_0x387a('0xa'),'paranoid':![],'indexes':[{'name':_0x387a('0xb'),'fields':[_0x387a('0xc')],'type':_0x387a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x534a33,_0x177dc3,_0x84b877){var _0x585df6=_0x519ac7['models'];var _0x517d79=_0x534a33[_0x387a('0xe')]({'plain':!![]});if(_0x517d79[_0x387a('0xf')][_0x387a('0x10')]()==='in'||_0x517d79['direction']['toLowerCase']()===_0x387a('0x11')&&!_0x517d79[_0x387a('0x12')]&&!_['isNil'](_0x517d79[_0x387a('0x13')])){_0x585df6[_0x387a('0x14')][_0x387a('0x15')]({'where':{'id':_0x517d79[_0x387a('0x16')]}})[_0x387a('0x17')](function(_0x3968d1){if(_0x3968d1){_0x3968d1[_0x387a('0x18')]({'lastMsgAt':_0x517d79[_0x387a('0x19')],'lastMsgDirection':_0x517d79[_0x387a('0xf')][_0x387a('0x10')]()});}})[_0x387a('0x1a')](function(_0x2da0c2){console[_0x387a('0x1b')](_0x2da0c2);});}if(_0x517d79[_0x387a('0xf')]===_0x387a('0x11')&&!_0x517d79[_0x387a('0x12')]){var _0x526f47;_0x585df6[_0x387a('0x1c')][_0x387a('0x1d')]()[_0x387a('0x17')](function(_0x4bf56b){return _0x585df6[_0x387a('0x1e')][_0x387a('0x1f')]({'where':{'id':_0x517d79[_0x387a('0x20')]},'include':[{'model':_0x585df6['OpenchannelInteraction'],'as':_0x387a('0x21'),'where':{'id':_0x517d79[_0x387a('0x16')]},'limit':0x1,'include':[{'model':_0x585df6[_0x387a('0x1c')],'as':_0x387a('0x22'),'attributes':_[_0x387a('0x23')](_0x4bf56b)}]}]});})[_0x387a('0x17')](function(_0x3bf487){_0x526f47=_0x3bf487[_0x387a('0xe')]({'plain':!![]});if(_0x526f47&&_0x526f47[_0x387a('0x24')]){logger[_0x387a('0x25')](_0x387a('0x26'),_0x387a('0x27'),util['format'](_0x387a('0x28'),_0x517d79['id'],_0x526f47[_0x387a('0x24')]));if(_0x526f47[_0x387a('0x21')]&&_0x526f47['Interactions'][_0x387a('0x29')]){_0x517d79[_0x387a('0x2a')]=_[_0x387a('0x2b')](_0x526f47['Interactions'][0x0],'Contact');_0x517d79[_0x387a('0x22')]=_0x526f47[_0x387a('0x21')][0x0][_0x387a('0x22')];}var _0x177dc3={'method':_0x387a('0x2c'),'uri':encodeURI(_0x526f47[_0x387a('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x177dc3[_0x387a('0x2d')]){case _0x387a('0x2e'):_0x177dc3['qs']=_0x517d79;break;case _0x387a('0x2c'):_0x177dc3[_0x387a('0xc')]=_0x517d79;break;}return rp(_0x177dc3)[_0x387a('0x17')](function(_0x46151e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x387a('0x27'),util[_0x387a('0x2f')](_0x387a('0x30'),_0x517d79['id'],_0x526f47[_0x387a('0x24')]));if(_0x46151e[_0x387a('0xc')]['threadId']&&_0x46151e['body'][_0x387a('0x31')]!=_0x517d79[_0x387a('0x2a')]['threadId']){return _0x585df6[_0x387a('0x14')]['update']({'threadId':_0x46151e['body'][_0x387a('0x31')]},{'where':{'id':_0x517d79['Interaction']['id']}});}else{return;}})[_0x387a('0x17')](function(){return _0x534a33[_0x387a('0x18')]({'read':!![]});})[_0x387a('0x1a')](function(_0x198412){logger[_0x387a('0x1b')](_0x387a('0x26'),_0x387a('0x27'),util[_0x387a('0x32')](_0x198412,{'showHidden':![],'depth':null}));_0x84b877();});}else{_0x84b877();}})[_0x387a('0x33')](function(){_0x84b877();});}else{_0x84b877();}}},'charset':_0x387a('0x34'),'collate':_0x387a('0x35')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 49ee639..1779f06 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(_0x5bc8b5,_0x586ccc){var _0x233124=function(_0x5d096c){while(--_0x5d096c){_0x5bc8b5['push'](_0x5bc8b5['shift']());}};_0x233124(++_0x586ccc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xa6171c,_0x40def5){var _0x246939=function(_0x28b280){while(--_0x28b280){_0xa6171c['push'](_0xa6171c['shift']());}};_0x246939(++_0x40def5);}(_0x7a54,0x106));var _0x47a5=function(_0x3ddce4,_0x2c7d75){_0x3ddce4=_0x3ddce4-0x0;var _0xe7e1c1=_0x7a54[_0x3ddce4];return _0xe7e1c1;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b67ad94..ac2512b 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 _0x4d61=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x1b0b88,_0x342ca1){var _0x18d921=function(_0x559907){while(--_0x559907){_0x1b0b88['push'](_0x1b0b88['shift']());}};_0x18d921(++_0x342ca1);}(_0x4d61,0x147));var _0x14d6=function(_0x2ea41,_0x4f807b){_0x2ea41=_0x2ea41-0x0;var _0x8ee23b=_0x4d61[_0x2ea41];return _0x8ee23b;};'use strict';var OpenchannelMessageEvents=require(_0x14d6('0x0'));var events=[_0x14d6('0x1'),_0x14d6('0x2'),_0x14d6('0x3')];function createListener(_0x128a58,_0x1f3eb8){return function(_0x1f4d14){_0x1f3eb8[_0x14d6('0x4')](_0x128a58,_0x1f4d14);};}function removeListener(_0x2950b7,_0x5da268){return function(){OpenchannelMessageEvents[_0x14d6('0x5')](_0x2950b7,_0x5da268);};}exports[_0x14d6('0x6')]=function(_0x2920fe){for(var _0x11b2c0=0x0,_0x349eac=events[_0x14d6('0x7')];_0x11b2c0<_0x349eac;_0x11b2c0++){var _0x344fb8=events[_0x11b2c0];var _0x52eb2d=createListener(_0x14d6('0x8')+_0x344fb8,_0x2920fe);OpenchannelMessageEvents['on'](_0x344fb8,_0x52eb2d);}}; \ No newline at end of file +var _0x192f=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','register'];(function(_0x142db6,_0x5a1395){var _0x256363=function(_0x530ac4){while(--_0x530ac4){_0x142db6['push'](_0x142db6['shift']());}};_0x256363(++_0x5a1395);}(_0x192f,0x19a));var _0xf192=function(_0x3e1113,_0x105275){_0x3e1113=_0x3e1113-0x0;var _0x36da2f=_0x192f[_0x3e1113];return _0x36da2f;};'use strict';var OpenchannelMessageEvents=require(_0xf192('0x0'));var events=[_0xf192('0x1'),_0xf192('0x2'),_0xf192('0x3')];function createListener(_0x39a88b,_0x429b9f){return function(_0x2049d6){_0x429b9f[_0xf192('0x4')](_0x39a88b,_0x2049d6);};}function removeListener(_0x500020,_0x52b247){return function(){OpenchannelMessageEvents['removeListener'](_0x500020,_0x52b247);};}exports[_0xf192('0x5')]=function(_0x379046){for(var _0x583b71=0x0,_0x3d68e4=events[_0xf192('0x6')];_0x583b71<_0x3d68e4;_0x583b71++){var _0x3a0448=events[_0x583b71];var _0x1cf5c5=createListener(_0xf192('0x7')+_0x3a0448,_0x379046);OpenchannelMessageEvents['on'](_0x3a0448,_0x1cf5c5);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index de3d142..3ea520a 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 _0xd8b2=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','/describe','describe','get','/:id','isAuthenticated','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','multer'];(function(_0x421fdb,_0x3b51c5){var _0x5d0054=function(_0x442765){while(--_0x442765){_0x421fdb['push'](_0x421fdb['shift']());}};_0x5d0054(++_0x3b51c5);}(_0xd8b2,0xfb));var _0x2d8b=function(_0x17caed,_0x3eb05c){_0x17caed=_0x17caed-0x0;var _0x158442=_0xd8b2[_0x17caed];return _0x158442;};'use strict';var multer=require(_0x2d8b('0x0'));var util=require(_0x2d8b('0x1'));var path=require('path');var timeout=require(_0x2d8b('0x2'));var express=require(_0x2d8b('0x3'));var router=express[_0x2d8b('0x4')]();var fs_extra=require(_0x2d8b('0x5'));var auth=require(_0x2d8b('0x6'));var interaction=require(_0x2d8b('0x7'));var config=require('../../config/environment');var controller=require(_0x2d8b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2d8b('0x9'),auth['isAuthenticated'](),controller[_0x2d8b('0xa')]);router[_0x2d8b('0xb')](_0x2d8b('0xc'),auth[_0x2d8b('0xd')](),controller['show']);router[_0x2d8b('0xb')](_0x2d8b('0xe'),auth['isAuthenticated'](),controller[_0x2d8b('0xf')]);router[_0x2d8b('0xb')]('/:id/teams',auth[_0x2d8b('0xd')](),controller[_0x2d8b('0x10')]);router[_0x2d8b('0xb')](_0x2d8b('0x11'),auth[_0x2d8b('0xd')](),controller[_0x2d8b('0x12')]);router['post']('/',auth[_0x2d8b('0xd')](),controller[_0x2d8b('0x13')]);router[_0x2d8b('0x14')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x2d8b('0x14')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x2d8b('0x15')](_0x2d8b('0xc'),auth['isAuthenticated'](),controller[_0x2d8b('0x16')]);router[_0x2d8b('0x17')](_0x2d8b('0xc'),auth['isAuthenticated'](),controller[_0x2d8b('0x18')]);router[_0x2d8b('0x17')](_0x2d8b('0x19'),auth[_0x2d8b('0xd')](),controller[_0x2d8b('0x1a')]);router[_0x2d8b('0x17')](_0x2d8b('0x11'),auth[_0x2d8b('0xd')](),controller[_0x2d8b('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xeb92=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeAgents'];(function(_0x544072,_0xc41ee1){var _0x590bf6=function(_0x41107f){while(--_0x41107f){_0x544072['push'](_0x544072['shift']());}};_0x590bf6(++_0xc41ee1);}(_0xeb92,0x1dd));var _0x2eb9=function(_0x3e5e55,_0x2f060f){_0x3e5e55=_0x3e5e55-0x0;var _0x2ca158=_0xeb92[_0x3e5e55];return _0x2ca158;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2eb9('0x0'));var timeout=require(_0x2eb9('0x1'));var express=require(_0x2eb9('0x2'));var router=express[_0x2eb9('0x3')]();var fs_extra=require(_0x2eb9('0x4'));var auth=require(_0x2eb9('0x5'));var interaction=require(_0x2eb9('0x6'));var config=require('../../config/environment');var controller=require(_0x2eb9('0x7'));router[_0x2eb9('0x8')]('/',auth['isAuthenticated'](),controller[_0x2eb9('0x9')]);router[_0x2eb9('0x8')](_0x2eb9('0xa'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0xc')]);router[_0x2eb9('0x8')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0xe')]);router[_0x2eb9('0x8')](_0x2eb9('0xf'),auth['isAuthenticated'](),controller[_0x2eb9('0x10')]);router[_0x2eb9('0x8')](_0x2eb9('0x11'),auth[_0x2eb9('0xb')](),controller['getTeams']);router[_0x2eb9('0x8')](_0x2eb9('0x12'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x13')]);router[_0x2eb9('0x14')]('/',auth[_0x2eb9('0xb')](),controller['create']);router[_0x2eb9('0x14')](_0x2eb9('0x11'),auth['isAuthenticated'](),controller[_0x2eb9('0x15')]);router['post'](_0x2eb9('0x12'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x16')]);router[_0x2eb9('0x17')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x18')]);router[_0x2eb9('0x19')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller['destroy']);router['delete'](_0x2eb9('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2eb9('0x19')](_0x2eb9('0x12'),auth['isAuthenticated'](),controller[_0x2eb9('0x1a')]);module[_0x2eb9('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 0338c5e..4cc3243 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 _0x048c=['INTEGER','beepall','roundrobin','STRING'];(function(_0x4af521,_0x446b9b){var _0x2da17a=function(_0x109e9c){while(--_0x109e9c){_0x4af521['push'](_0x4af521['shift']());}};_0x2da17a(++_0x446b9b);}(_0x048c,0x123));var _0xc048=function(_0x197398,_0x2e9b50){_0x197398=_0x197398-0x0;var _0x2c9072=_0x048c[_0x197398];return _0x2c9072;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc048('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc048('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xc048('0x2'),_0xc048('0x3'))}}; \ No newline at end of file +var _0xc1a3=['ENUM','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc1a3,0x170));var _0x3c1a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc1a3[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x3c1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c1a('0x1')],'unique':_0x3c1a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3c1a('0x1')]},'timeout':{'type':Sequelize[_0x3c1a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3c1a('0x4')]('rrmemory','beepall',_0x3c1a('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8b1ccfe..2f49095 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 _0x9b3c=['../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./openchannelQueue.socket','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','OpenchannelQueue','then','include','rows','catch','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','pick','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x377447,_0x1f1acc){var _0x39b3d4=function(_0x58a5c3){while(--_0x58a5c3){_0x377447['push'](_0x377447['shift']());}};_0x39b3d4(++_0x1f1acc);}(_0x9b3c,0x18f));var _0xc9b3=function(_0x2e814d,_0x3c92a5){_0x2e814d=_0x2e814d-0x0;var _0x49b357=_0x9b3c[_0x2e814d];return _0x49b357;};'use strict';var emlformat=require(_0xc9b3('0x0'));var rimraf=require(_0xc9b3('0x1'));var zipdir=require(_0xc9b3('0x2'));var jsonpatch=require(_0xc9b3('0x3'));var rp=require(_0xc9b3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9b3('0x5'));var util=require(_0xc9b3('0x6'));var path=require(_0xc9b3('0x7'));var sox=require(_0xc9b3('0x8'));var csv=require(_0xc9b3('0x9'));var ejs=require(_0xc9b3('0xa'));var fs=require('fs');var fs_extra=require(_0xc9b3('0xb'));var _=require(_0xc9b3('0xc'));var squel=require(_0xc9b3('0xd'));var crypto=require(_0xc9b3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc9b3('0xf'));var toCsv=require(_0xc9b3('0x9'));var querystring=require('querystring');var Papa=require(_0xc9b3('0x10'));var Redis=require(_0xc9b3('0x11'));var authService=require(_0xc9b3('0x12'));var qs=require(_0xc9b3('0x13'));var as=require(_0xc9b3('0x14'));var hardwareService=require(_0xc9b3('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc9b3('0x16'));var licenseUtil=require(_0xc9b3('0x17'));var db=require(_0xc9b3('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc9b3('0x19'))(new Redis(config[_0xc9b3('0x1a')]));require(_0xc9b3('0x1b'))['register'](socket);function respondWithStatusCode(_0x156dbe,_0x28dcd3){_0x28dcd3=_0x28dcd3||0xcc;return function(_0x3b3d90){if(_0x3b3d90){return _0x156dbe['sendStatus'](_0x28dcd3);}return _0x156dbe[_0xc9b3('0x1c')](_0x28dcd3)[_0xc9b3('0x1d')]();};}function respondWithResult(_0x5d9b0c,_0x36486b){_0x36486b=_0x36486b||0xc8;return function(_0x23aad5){if(_0x23aad5){return _0x5d9b0c[_0xc9b3('0x1c')](_0x36486b)[_0xc9b3('0x1e')](_0x23aad5);}};}function respondWithFilteredResult(_0x56860c,_0x2cdc7b){return function(_0x2b0cd7){if(_0x2b0cd7){var _0x5a1d04=typeof _0x2cdc7b[_0xc9b3('0x1f')]===_0xc9b3('0x20')&&typeof _0x2cdc7b[_0xc9b3('0x21')]==='undefined';var _0x2f931b=_0x2b0cd7['count'];var _0x75dc73=_0x5a1d04?0x0:_0x2cdc7b[_0xc9b3('0x1f')];var _0x3d9244=_0x5a1d04?_0x2b0cd7[_0xc9b3('0x22')]:_0x2cdc7b[_0xc9b3('0x1f')]+_0x2cdc7b[_0xc9b3('0x21')];var _0x1e80f5;if(_0x3d9244>=_0x2f931b){_0x3d9244=_0x2f931b;_0x1e80f5=0xc8;}else{_0x1e80f5=0xce;}_0x56860c[_0xc9b3('0x1c')](_0x1e80f5);return _0x56860c[_0xc9b3('0x23')]('Content-Range',_0x75dc73+'-'+_0x3d9244+'/'+_0x2f931b)[_0xc9b3('0x1e')](_0x2b0cd7);}return null;};}function patchUpdates(_0x5dbfd4){return function(_0x4df4df){try{jsonpatch[_0xc9b3('0x24')](_0x4df4df,_0x5dbfd4,!![]);}catch(_0x5aca73){return BPromise[_0xc9b3('0x25')](_0x5aca73);}return _0x4df4df['save']();};}function saveUpdates(_0x5e0ca8,_0xcf71d7){return function(_0x566004){if(_0x566004){return _0x566004[_0xc9b3('0x26')](_0x5e0ca8)['then'](function(_0x345471){return _0x345471;});}return null;};}function removeEntity(_0x321507,_0x4f6191){return function(_0x58fc36){if(_0x58fc36){return _0x58fc36[_0xc9b3('0x27')]()['then'](function(){var _0x574ee9=_0x58fc36[_0xc9b3('0x28')]({'plain':!![]});var _0x1621dc=_0xc9b3('0x29');return db[_0xc9b3('0x2a')]['destroy']({'where':{'type':_0x1621dc,'resourceId':_0x574ee9['id']}})['then'](function(){return _0x58fc36;});})['then'](function(){_0x321507['status'](0xcc)[_0xc9b3('0x1d')]();});}};}function handleEntityNotFound(_0x2ee967,_0x42da83){return function(_0x55b167){if(!_0x55b167){_0x2ee967[_0xc9b3('0x2b')](0x194);}return _0x55b167;};}function handleError(_0x2b73e6,_0x1bb973){_0x1bb973=_0x1bb973||0x1f4;return function(_0x3c1ade){logger[_0xc9b3('0x2c')](_0x3c1ade[_0xc9b3('0x2d')]);if(_0x3c1ade[_0xc9b3('0x2e')]){delete _0x3c1ade[_0xc9b3('0x2e')];}_0x2b73e6['status'](_0x1bb973)[_0xc9b3('0x2f')](_0x3c1ade);};}exports[_0xc9b3('0x30')]=function(_0x4a275e,_0x1e2330){var _0x5836c9={},_0x44f7ec={},_0x5a83a3={'count':0x0,'rows':[]};var _0x1914ea=_[_0xc9b3('0x31')](db['OpenchannelQueue']['rawAttributes'],function(_0x460750){return{'name':_0x460750[_0xc9b3('0x32')],'type':_0x460750[_0xc9b3('0x33')][_0xc9b3('0x34')]};});_0x44f7ec[_0xc9b3('0x35')]=_[_0xc9b3('0x31')](_0x1914ea,_0xc9b3('0x2e'));_0x44f7ec[_0xc9b3('0x36')]=_[_0xc9b3('0x37')](_0x4a275e[_0xc9b3('0x36')]);_0x44f7ec['filters']=_['intersection'](_0x44f7ec[_0xc9b3('0x35')],_0x44f7ec['query']);_0x5836c9[_0xc9b3('0x38')]=_['intersection'](_0x44f7ec[_0xc9b3('0x35')],qs[_0xc9b3('0x39')](_0x4a275e[_0xc9b3('0x36')][_0xc9b3('0x39')]));_0x5836c9[_0xc9b3('0x38')]=_0x5836c9[_0xc9b3('0x38')][_0xc9b3('0x3a')]?_0x5836c9['attributes']:_0x44f7ec[_0xc9b3('0x35')];if(!_0x4a275e['query']['hasOwnProperty'](_0xc9b3('0x3b'))){_0x5836c9[_0xc9b3('0x21')]=qs[_0xc9b3('0x21')](_0x4a275e[_0xc9b3('0x36')][_0xc9b3('0x21')]);_0x5836c9[_0xc9b3('0x1f')]=qs[_0xc9b3('0x1f')](_0x4a275e[_0xc9b3('0x36')][_0xc9b3('0x1f')]);}_0x5836c9[_0xc9b3('0x3c')]=qs[_0xc9b3('0x3d')](_0x4a275e[_0xc9b3('0x36')]['sort']);_0x5836c9[_0xc9b3('0x3e')]=qs[_0xc9b3('0x3f')](_['pick'](_0x4a275e[_0xc9b3('0x36')],_0x44f7ec[_0xc9b3('0x3f')]),_0x1914ea);if(_0x4a275e[_0xc9b3('0x36')][_0xc9b3('0x40')]){_0x5836c9[_0xc9b3('0x3e')]=_[_0xc9b3('0x41')](_0x5836c9['where'],{'$or':_['map'](_0x1914ea,function(_0x497e9c){if(_0x497e9c[_0xc9b3('0x33')]!==_0xc9b3('0x42')){var _0xf8357f={};_0xf8357f[_0x497e9c[_0xc9b3('0x2e')]]={'$like':'%'+_0x4a275e['query'][_0xc9b3('0x40')]+'%'};return _0xf8357f;}})});}_0x5836c9=_[_0xc9b3('0x41')]({},_0x5836c9,_0x4a275e[_0xc9b3('0x43')]);var _0x19efca={'where':_0x5836c9[_0xc9b3('0x3e')]};return db[_0xc9b3('0x44')][_0xc9b3('0x22')](_0x19efca)[_0xc9b3('0x45')](function(_0x58a94a){_0x5a83a3[_0xc9b3('0x22')]=_0x58a94a;if(_0x4a275e['query']['includeAll']){_0x5836c9[_0xc9b3('0x46')]=[{'all':!![]}];}return db[_0xc9b3('0x44')]['findAll'](_0x5836c9);})['then'](function(_0x242d49){_0x5a83a3[_0xc9b3('0x47')]=_0x242d49;return _0x5a83a3;})['then'](respondWithFilteredResult(_0x1e2330,_0x5836c9))[_0xc9b3('0x48')](handleError(_0x1e2330,null));};exports[_0xc9b3('0x49')]=function(_0x5d39ac,_0x2e1a4e){var _0x65437f={'raw':!![],'where':{'id':_0x5d39ac[_0xc9b3('0x4a')]['id']}},_0x128e52={};_0x128e52[_0xc9b3('0x35')]=_[_0xc9b3('0x37')](db['OpenchannelQueue']['rawAttributes']);_0x128e52[_0xc9b3('0x36')]=_['keys'](_0x5d39ac[_0xc9b3('0x36')]);_0x128e52[_0xc9b3('0x3f')]=_[_0xc9b3('0x4b')](_0x128e52[_0xc9b3('0x35')],_0x128e52[_0xc9b3('0x36')]);_0x65437f[_0xc9b3('0x38')]=_[_0xc9b3('0x4b')](_0x128e52[_0xc9b3('0x35')],qs['fields'](_0x5d39ac[_0xc9b3('0x36')][_0xc9b3('0x39')]));_0x65437f[_0xc9b3('0x38')]=_0x65437f[_0xc9b3('0x38')][_0xc9b3('0x3a')]?_0x65437f[_0xc9b3('0x38')]:_0x128e52[_0xc9b3('0x35')];if(_0x5d39ac[_0xc9b3('0x36')][_0xc9b3('0x4c')]){_0x65437f['include']=[{'all':!![]}];}_0x65437f=_[_0xc9b3('0x41')]({},_0x65437f,_0x5d39ac[_0xc9b3('0x43')]);return db[_0xc9b3('0x44')][_0xc9b3('0x4d')](_0x65437f)['then'](handleEntityNotFound(_0x2e1a4e,null))['then'](respondWithResult(_0x2e1a4e,null))[_0xc9b3('0x48')](handleError(_0x2e1a4e,null));};exports[_0xc9b3('0x4e')]=function(_0x2f125a,_0x163671){return db['OpenchannelQueue'][_0xc9b3('0x4e')](_0x2f125a[_0xc9b3('0x4f')],{})['then'](function(_0x4bf629){var _0x141539=_0x2f125a[_0xc9b3('0x50')][_0xc9b3('0x28')]({'plain':!![]});if(!_0x141539)throw new Error(_0xc9b3('0x51'));if(_0x141539[_0xc9b3('0x52')]===_0xc9b3('0x50')){var _0x4ce9f0=_0x4bf629[_0xc9b3('0x28')]({'plain':!![]});var _0x20285d=_0xc9b3('0x29');return db[_0xc9b3('0x53')][_0xc9b3('0x4d')]({'where':{'name':_0x20285d,'userProfileId':_0x141539[_0xc9b3('0x54')]},'raw':!![]})[_0xc9b3('0x45')](function(_0x44b98a){if(_0x44b98a&&_0x44b98a['autoAssociation']===0x0){return db[_0xc9b3('0x2a')][_0xc9b3('0x4e')]({'name':_0x4ce9f0['name'],'resourceId':_0x4ce9f0['id'],'type':_0x44b98a[_0xc9b3('0x2e')],'sectionId':_0x44b98a['id']},{})[_0xc9b3('0x45')](function(){return _0x4bf629;});}else{return _0x4bf629;}})[_0xc9b3('0x48')](function(_0x1c670){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c670);throw _0x1c670;});}return _0x4bf629;})[_0xc9b3('0x45')](respondWithResult(_0x163671,0xc9))[_0xc9b3('0x48')](handleError(_0x163671,null));};exports[_0xc9b3('0x26')]=function(_0x58106f,_0x2c7c01){if(_0x58106f['body']['id']){delete _0x58106f[_0xc9b3('0x4f')]['id'];}return db[_0xc9b3('0x44')][_0xc9b3('0x4d')]({'where':{'id':_0x58106f[_0xc9b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c7c01,null))[_0xc9b3('0x45')](saveUpdates(_0x58106f['body'],null))[_0xc9b3('0x45')](respondWithResult(_0x2c7c01,null))[_0xc9b3('0x48')](handleError(_0x2c7c01,null));};exports[_0xc9b3('0x27')]=function(_0x47921c,_0x4fa69c){return db[_0xc9b3('0x44')][_0xc9b3('0x4d')]({'where':{'id':_0x47921c[_0xc9b3('0x4a')]['id']}})[_0xc9b3('0x45')](handleEntityNotFound(_0x4fa69c,null))[_0xc9b3('0x45')](removeEntity(_0x4fa69c,null))[_0xc9b3('0x48')](handleError(_0x4fa69c,null));};exports['describe']=function(_0x49b874,_0x2d06fb){return db['OpenchannelQueue'][_0xc9b3('0x55')]()['then'](respondWithResult(_0x2d06fb,null))['catch'](handleError(_0x2d06fb,null));};exports[_0xc9b3('0x56')]=function(_0x45a3bc,_0x47dbd7,_0x4ae618){var _0x2ce0bf={'raw':!![],'where':{}},_0x2103b4={},_0x42df33;return db[_0xc9b3('0x44')][_0xc9b3('0x57')]({'where':{'id':_0x45a3bc[_0xc9b3('0x4a')]['id']}})[_0xc9b3('0x45')](handleEntityNotFound(_0x47dbd7,null))[_0xc9b3('0x45')](function(_0x3f1a4b){if(_0x3f1a4b){_0x42df33=_0x3f1a4b[_0xc9b3('0x28')]({'plain':!![]});_0x2103b4['model']=_[_0xc9b3('0x37')](db[_0xc9b3('0x58')][_0xc9b3('0x59')]);_0x2103b4[_0xc9b3('0x36')]=_[_0xc9b3('0x37')](_0x45a3bc['query']);_0x2103b4[_0xc9b3('0x3f')]=_['intersection'](_0x2103b4[_0xc9b3('0x35')],_0x2103b4[_0xc9b3('0x36')]);_0x2ce0bf[_0xc9b3('0x38')]=_[_0xc9b3('0x4b')](_0x2103b4[_0xc9b3('0x35')],qs['fields'](_0x45a3bc[_0xc9b3('0x36')][_0xc9b3('0x39')]));_0x2ce0bf[_0xc9b3('0x38')]=_0x2ce0bf[_0xc9b3('0x38')][_0xc9b3('0x3a')]?_0x2ce0bf[_0xc9b3('0x38')]:_0x2103b4[_0xc9b3('0x35')];if(!_0x45a3bc[_0xc9b3('0x36')]['hasOwnProperty'](_0xc9b3('0x3b'))){_0x2ce0bf[_0xc9b3('0x21')]=qs[_0xc9b3('0x21')](_0x45a3bc[_0xc9b3('0x36')][_0xc9b3('0x21')]);_0x2ce0bf[_0xc9b3('0x1f')]=qs[_0xc9b3('0x1f')](_0x45a3bc[_0xc9b3('0x36')][_0xc9b3('0x1f')]);}_0x2ce0bf[_0xc9b3('0x3c')]=qs[_0xc9b3('0x3d')](_0x45a3bc[_0xc9b3('0x36')][_0xc9b3('0x3d')]);_0x2ce0bf[_0xc9b3('0x3e')]=qs[_0xc9b3('0x3f')](_[_0xc9b3('0x5a')](_0x45a3bc[_0xc9b3('0x36')],_0x2103b4['filters']));_0x2ce0bf[_0xc9b3('0x3e')][_0xc9b3('0x5b')]=_0x3f1a4b['id'];if(_0x45a3bc[_0xc9b3('0x36')][_0xc9b3('0x40')]){_0x2ce0bf[_0xc9b3('0x3e')]=_[_0xc9b3('0x41')](_0x2ce0bf['where'],{'$or':_['map'](_0x2ce0bf['attributes'],function(_0x2ba0d1){var _0x3adcc8={};_0x3adcc8[_0x2ba0d1]={'$like':'%'+_0x45a3bc[_0xc9b3('0x36')]['filter']+'%'};return _0x3adcc8;})});}_0x2ce0bf=_[_0xc9b3('0x41')]({},_0x2ce0bf,_0x45a3bc[_0xc9b3('0x43')]);return db[_0xc9b3('0x58')][_0xc9b3('0x5c')](_0x2ce0bf);}})[_0xc9b3('0x45')](function(_0x355d54){if(_0x355d54){return db[_0xc9b3('0x5d')][_0xc9b3('0x5e')]({'where':{'id':_[_0xc9b3('0x31')](_0x355d54,_0xc9b3('0x5f')),'role':_0xc9b3('0x60')},'attributes':['id',_0xc9b3('0x2e'),_0xc9b3('0x61'),_0xc9b3('0x62'),_0xc9b3('0x63')]});}})['then'](function(_0x2ac578){if(_0x2ac578){return{'count':_0x2ac578[_0xc9b3('0x22')],'rows':_['map'](_0x2ac578['rows'],function(_0x3dd39b){return{'membername':_0x3dd39b['name'],'UserId':_0x3dd39b['id'],'queue_name':_0x42df33[_0xc9b3('0x2e')],'OpenchannelQueueId':_0x42df33['id'],'interface':util[_0xc9b3('0x64')]('%s/%s',_0xc9b3('0x65'),_0x3dd39b[_0xc9b3('0x2e')]),'penalty':0x0,'paused':_0x3dd39b[_0xc9b3('0x61')],'createdAt':_0x3dd39b[_0xc9b3('0x63')],'updatedAt':_0x3dd39b[_0xc9b3('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc9b3('0x45')](respondWithFilteredResult(_0x47dbd7,_0x2ce0bf))[_0xc9b3('0x48')](handleError(_0x47dbd7,null));};exports[_0xc9b3('0x66')]=function(_0x268a62,_0x5e95ea,_0x5bac35){var _0xc4948e={};var _0x4def8c={};var _0x1a7965;var _0x225a8a;return db['OpenchannelQueue'][_0xc9b3('0x57')]({'where':{'id':_0x268a62[_0xc9b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e95ea,null))['then'](function(_0xcd084d){if(_0xcd084d){_0x1a7965=_0xcd084d;_0x4def8c[_0xc9b3('0x35')]=_[_0xc9b3('0x37')](db[_0xc9b3('0x67')]['rawAttributes']);_0x4def8c[_0xc9b3('0x36')]=_[_0xc9b3('0x37')](_0x268a62[_0xc9b3('0x36')]);_0x4def8c[_0xc9b3('0x3f')]=_['intersection'](_0x4def8c[_0xc9b3('0x35')],_0x4def8c[_0xc9b3('0x36')]);_0xc4948e[_0xc9b3('0x38')]=_['intersection'](_0x4def8c[_0xc9b3('0x35')],qs[_0xc9b3('0x39')](_0x268a62[_0xc9b3('0x36')]['fields']));_0xc4948e[_0xc9b3('0x38')]=_0xc4948e[_0xc9b3('0x38')][_0xc9b3('0x3a')]?_0xc4948e[_0xc9b3('0x38')]:_0x4def8c[_0xc9b3('0x35')];_0xc4948e[_0xc9b3('0x3c')]=qs['sort'](_0x268a62[_0xc9b3('0x36')][_0xc9b3('0x3d')]);_0xc4948e['where']=qs[_0xc9b3('0x3f')](_[_0xc9b3('0x5a')](_0x268a62['query'],_0x4def8c[_0xc9b3('0x3f')]));if(_0x268a62['query'][_0xc9b3('0x40')]){_0xc4948e[_0xc9b3('0x3e')]=_['merge'](_0xc4948e[_0xc9b3('0x3e')],{'$or':_[_0xc9b3('0x31')](_0xc4948e['attributes'],function(_0x4841fb){var _0x3ebe01={};_0x3ebe01[_0x4841fb]={'$like':'%'+_0x268a62['query'][_0xc9b3('0x40')]+'%'};return _0x3ebe01;})});}_0xc4948e=_[_0xc9b3('0x41')]({},_0xc4948e,_0x268a62[_0xc9b3('0x43')]);return _0x1a7965[_0xc9b3('0x66')](_0xc4948e);}})[_0xc9b3('0x45')](function(_0x3e317c){if(_0x3e317c){_0x225a8a=_0x3e317c[_0xc9b3('0x3a')];if(!_0x268a62[_0xc9b3('0x36')][_0xc9b3('0x68')](_0xc9b3('0x3b'))){_0xc4948e[_0xc9b3('0x21')]=qs[_0xc9b3('0x21')](_0x268a62[_0xc9b3('0x36')][_0xc9b3('0x21')]);_0xc4948e[_0xc9b3('0x1f')]=qs[_0xc9b3('0x1f')](_0x268a62['query'][_0xc9b3('0x1f')]);}return _0x1a7965['getTeams'](_0xc4948e);}})['then'](function(_0x58edb3){if(_0x58edb3){return _0x58edb3?{'count':_0x225a8a,'rows':_0x58edb3}:null;}})[_0xc9b3('0x45')](respondWithResult(_0x5e95ea,null))[_0xc9b3('0x48')](handleError(_0x5e95ea,null));};exports[_0xc9b3('0x69')]=function(_0x46db21,_0x3f1973,_0x34ee80){var _0x65ecce=_0x46db21[_0xc9b3('0x4f')][_0xc9b3('0x6a')];return db[_0xc9b3('0x67')][_0xc9b3('0x5c')]({'where':{'id':_0x65ecce},'attributes':['id'],'include':[{'model':db[_0xc9b3('0x5d')],'as':_0xc9b3('0x6b'),'attributes':['id',_0xc9b3('0x2e'),_0xc9b3('0x6c'),_0xc9b3('0x6d'),_0xc9b3('0x6e')],'raw':!![]}]})[_0xc9b3('0x45')](function(_0x4b722b){if(_0x4b722b){var _0x2b7a56=_['flatMap'](_0x4b722b,function(_0x29d288){var _0x5b044d=_0x29d288[_0xc9b3('0x28')]({'plain':!![]});return _0x5b044d['Agents'];});return db[_0xc9b3('0x44')][_0xc9b3('0x4d')]({'where':{'id':_0x46db21['params']['id']}})[_0xc9b3('0x45')](function(_0x35e323){return db[_0xc9b3('0x6f')][_0xc9b3('0x70')](function(_0x5ee043){return _0x35e323['addTeams'](_0x65ecce,{'transaction':_0x5ee043})[_0xc9b3('0x45')](function(){return BPromise['each'](_0x2b7a56,function(_0x259aa0){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x259aa0['id'],'OpenchannelQueueId':_0x46db21[_0xc9b3('0x4a')]['id']},'transaction':_0x5ee043});});})[_0xc9b3('0x45')](function(){_0x2b7a56[_0xc9b3('0x71')](function(_0x704bc){socket[_0xc9b3('0x72')]('userOpenchannelQueue:save',{'UserId':_0x704bc['id'],'OpenchannelQueueId':_0x35e323['id']});});});});});}})[_0xc9b3('0x45')](respondWithStatusCode(_0x3f1973,null))[_0xc9b3('0x48')](handleError(_0x3f1973,null));};exports[_0xc9b3('0x73')]=function(_0x17ba13,_0x157e77,_0x12b661){return db[_0xc9b3('0x67')][_0xc9b3('0x5c')]({'where':{'id':_0x17ba13[_0xc9b3('0x36')][_0xc9b3('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x157e77,null))[_0xc9b3('0x45')](function(_0x36dee0){var _0x368d08=_['map'](_0x36dee0,'id');var _0x9f065b=[];var _0xe2855d=[];var _0x993e8b=squel[_0xc9b3('0x74')]();_0x993e8b[_0xc9b3('0x75')](_0xc9b3('0x76'))['from'](_0xc9b3('0x77'),'tq')[_0xc9b3('0x78')]('user_has_teams','ut',_0xc9b3('0x79'))[_0xc9b3('0x3e')](_0xc9b3('0x7a'),_0x17ba13[_0xc9b3('0x4a')]['id']);for(var _0xdaa83f=0x0;_0xdaa83f<_0x36dee0['length'];_0xdaa83f+=0x1){let _0x43a4cb=_0x36dee0[_0xdaa83f];for(var _0x2761a8=0x0;_0x2761a8<_0x43a4cb[_0xc9b3('0x6b')]['length'];_0x2761a8+=0x1){let _0x41b13a=_0x43a4cb[_0xc9b3('0x6b')][_0x2761a8];var _0x1de8e5=_0x993e8b[_0xc9b3('0x7b')]();_0x1de8e5['where'](_0xc9b3('0x7c'),_0x41b13a['id']);_0xe2855d['push'](db[_0xc9b3('0x6f')][_0xc9b3('0x36')](_0x1de8e5[_0xc9b3('0x7d')](),{'type':db[_0xc9b3('0x6f')]['QueryTypes'][_0xc9b3('0x7e')]})['then'](function(_0x8c821){if(_0x8c821['length']===0x1){return _0x41b13a['id'];}else{var _0x3279a1=_[_0xc9b3('0x7f')](_[_0xc9b3('0x31')](_0x8c821,_0xc9b3('0x80')),function(_0x72e7c4){return _[_0xc9b3('0x81')](_0x368d08,_0x72e7c4);});if(_0x3279a1){return _0x41b13a['id'];}}}));}}return BPromise[_0xc9b3('0x82')](_0xe2855d)['then'](function(_0x5a70d4){_0x9f065b=_(_0x9f065b)[_0xc9b3('0x83')](_0x5a70d4)['compact']()['value']();return db['OpenchannelQueue'][_0xc9b3('0x4d')]({'where':{'id':_0x17ba13[_0xc9b3('0x4a')]['id']}})[_0xc9b3('0x45')](function(_0x62e15a){return db['sequelize'][_0xc9b3('0x70')](function(_0x31f262){return _0x62e15a[_0xc9b3('0x73')](_0x17ba13['query'][_0xc9b3('0x6a')],{'transaction':_0x31f262})['then'](function(){if(!_[_0xc9b3('0x84')](_0x9f065b)){return _0x62e15a['removeAgents'](_0x9f065b,{'transaction':_0x31f262});}})[_0xc9b3('0x45')](function(){_0x9f065b[_0xc9b3('0x71')](function(_0x1e4b22){socket[_0xc9b3('0x72')](_0xc9b3('0x85'),{'UserId':_0x1e4b22,'OpenchannelQueueId':_0x62e15a['id']});});});});});});})[_0xc9b3('0x45')](respondWithStatusCode(_0x157e77,null))[_0xc9b3('0x48')](handleError(_0x157e77,null));};exports[_0xc9b3('0x86')]=function(_0x4d838f,_0x501267,_0x558e3c){return db[_0xc9b3('0x44')]['find']({'where':{'id':_0x4d838f[_0xc9b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x501267,null))['then'](function(_0x5c8a9f){if(_0x5c8a9f){return _0x5c8a9f[_0xc9b3('0x86')](_0x4d838f[_0xc9b3('0x4f')][_0xc9b3('0x6a')],_[_0xc9b3('0x87')](_0x4d838f[_0xc9b3('0x4f')],[_0xc9b3('0x6a'),'id'])||{})[_0xc9b3('0x88')](function(_0x2aad2a){for(var _0x53acc2=0x0;_0x53acc2<_0x4d838f[_0xc9b3('0x4f')]['ids'][_0xc9b3('0x3a')];_0x53acc2+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x4d838f['body'][_0xc9b3('0x6a')][_0x53acc2]),'OpenchannelQueueId':Number(_0x4d838f[_0xc9b3('0x4a')]['id'])});}return _0x2aad2a;});}})['then'](respondWithResult(_0x501267,null))['catch'](handleError(_0x501267,null));};exports['removeAgents']=function(_0x4253f8,_0x5118a4,_0x525bc2){return db[_0xc9b3('0x44')][_0xc9b3('0x4d')]({'where':{'id':_0x4253f8[_0xc9b3('0x4a')]['id']}})[_0xc9b3('0x45')](handleEntityNotFound(_0x5118a4,null))[_0xc9b3('0x45')](function(_0xf1c3dd){if(_0xf1c3dd){return _0xf1c3dd[_0xc9b3('0x89')](_0x4253f8[_0xc9b3('0x36')]['ids'])[_0xc9b3('0x45')](function(){if(_[_0xc9b3('0x8a')](_0x4253f8[_0xc9b3('0x36')]['ids'])){for(var _0x5717d8=0x0;_0x5717d8<_0x4253f8[_0xc9b3('0x36')][_0xc9b3('0x6a')][_0xc9b3('0x3a')];_0x5717d8+=0x1){socket[_0xc9b3('0x72')](_0xc9b3('0x85'),{'UserId':Number(_0x4253f8['query'][_0xc9b3('0x6a')][_0x5717d8]),'OpenchannelQueueId':Number(_0x4253f8[_0xc9b3('0x4a')]['id'])});}}else{socket[_0xc9b3('0x72')](_0xc9b3('0x85'),{'UserId':Number(_0x4253f8[_0xc9b3('0x36')][_0xc9b3('0x6a')]),'OpenchannelQueueId':Number(_0x4253f8[_0xc9b3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5118a4,null))[_0xc9b3('0x48')](handleError(_0x5118a4,null));};exports[_0xc9b3('0x8b')]=function(_0x48d98a,_0x4f437d,_0x21150b){var _0x3a22c7={};var _0x5c4f2e={};var _0x595deb;var _0x47e87c;return db[_0xc9b3('0x44')]['findOne']({'where':{'id':_0x48d98a[_0xc9b3('0x4a')]['id']}})[_0xc9b3('0x45')](handleEntityNotFound(_0x4f437d,null))[_0xc9b3('0x45')](function(_0x5863cd){if(_0x5863cd){_0x595deb=_0x5863cd;_0x5c4f2e[_0xc9b3('0x35')]=_[_0xc9b3('0x37')](db[_0xc9b3('0x5d')][_0xc9b3('0x59')]);_0x5c4f2e[_0xc9b3('0x36')]=_[_0xc9b3('0x37')](_0x48d98a[_0xc9b3('0x36')]);_0x5c4f2e['filters']=_['intersection'](_0x5c4f2e['model'],_0x5c4f2e[_0xc9b3('0x36')]);_0x3a22c7[_0xc9b3('0x38')]=_['intersection'](_0x5c4f2e['model'],qs[_0xc9b3('0x39')](_0x48d98a[_0xc9b3('0x36')]['fields']));_0x3a22c7[_0xc9b3('0x38')]=_0x3a22c7[_0xc9b3('0x38')][_0xc9b3('0x3a')]?_0x3a22c7['attributes']:_0x5c4f2e[_0xc9b3('0x35')];_0x3a22c7[_0xc9b3('0x3c')]=qs['sort'](_0x48d98a[_0xc9b3('0x36')]['sort']);_0x3a22c7[_0xc9b3('0x3e')]=qs[_0xc9b3('0x3f')](_[_0xc9b3('0x5a')](_0x48d98a[_0xc9b3('0x36')],_0x5c4f2e[_0xc9b3('0x3f')]));if(_0x48d98a['query']['filter']){_0x3a22c7[_0xc9b3('0x3e')]=_['merge'](_0x3a22c7['where'],{'$or':_[_0xc9b3('0x31')](_0x3a22c7[_0xc9b3('0x38')],function(_0x131e4d){var _0x2c5e37={};_0x2c5e37[_0x131e4d]={'$like':'%'+_0x48d98a['query'][_0xc9b3('0x40')]+'%'};return _0x2c5e37;})});}_0x3a22c7=_['merge']({},_0x3a22c7,_0x48d98a['options']);return _0x595deb[_0xc9b3('0x8b')](_0x3a22c7);}})[_0xc9b3('0x45')](function(_0x38d5a1){if(_0x38d5a1){_0x47e87c=_0x38d5a1[_0xc9b3('0x3a')];if(!_0x48d98a[_0xc9b3('0x36')][_0xc9b3('0x68')](_0xc9b3('0x3b'))){_0x3a22c7[_0xc9b3('0x21')]=qs[_0xc9b3('0x21')](_0x48d98a[_0xc9b3('0x36')]['limit']);_0x3a22c7[_0xc9b3('0x1f')]=qs[_0xc9b3('0x1f')](_0x48d98a[_0xc9b3('0x36')]['offset']);}return _0x595deb['getAgents'](_0x3a22c7);}})[_0xc9b3('0x45')](function(_0x51b55a){if(_0x51b55a){return _0x51b55a?{'count':_0x47e87c,'rows':_0x51b55a}:null;}})[_0xc9b3('0x45')](respondWithResult(_0x4f437d,null))[_0xc9b3('0x48')](handleError(_0x4f437d,null));}; \ No newline at end of file +var _0xcf56=['../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','status','error','stack','name','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserOpenchannelQueue','pick','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','nolimit','addTeams','ids','Team','Agents','online','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','includes','union','transaction','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x1732e5,_0xf24e30){var _0xc77fdf=function(_0x402ce5){while(--_0x402ce5){_0x1732e5['push'](_0x1732e5['shift']());}};_0xc77fdf(++_0xf24e30);}(_0xcf56,0x181));var _0x6cf5=function(_0x404fb7,_0x3a13ff){_0x404fb7=_0x404fb7-0x0;var _0x140296=_0xcf56[_0x404fb7];return _0x140296;};'use strict';var emlformat=require(_0x6cf5('0x0'));var rimraf=require(_0x6cf5('0x1'));var zipdir=require(_0x6cf5('0x2'));var jsonpatch=require(_0x6cf5('0x3'));var rp=require(_0x6cf5('0x4'));var moment=require(_0x6cf5('0x5'));var BPromise=require(_0x6cf5('0x6'));var Mustache=require(_0x6cf5('0x7'));var util=require('util');var path=require(_0x6cf5('0x8'));var sox=require(_0x6cf5('0x9'));var csv=require('to-csv');var ejs=require(_0x6cf5('0xa'));var fs=require('fs');var fs_extra=require(_0x6cf5('0xb'));var _=require(_0x6cf5('0xc'));var squel=require(_0x6cf5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cf5('0xe'));var toCsv=require(_0x6cf5('0xf'));var querystring=require(_0x6cf5('0x10'));var Papa=require(_0x6cf5('0x11'));var Redis=require(_0x6cf5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6cf5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf5('0x14'));var logger=require('../../config/logger')(_0x6cf5('0x15'));var utils=require('../../config/utils');var config=require(_0x6cf5('0x16'));var licenseUtil=require(_0x6cf5('0x17'));var db=require('../../mysqldb')['db'];config[_0x6cf5('0x18')]=_[_0x6cf5('0x19')](config[_0x6cf5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6cf5('0x1a'))(new Redis(config[_0x6cf5('0x18')]));require(_0x6cf5('0x1b'))['register'](socket);function respondWithStatusCode(_0x5081cc,_0x128534){_0x128534=_0x128534||0xcc;return function(_0x2b3080){if(_0x2b3080){return _0x5081cc[_0x6cf5('0x1c')](_0x128534);}return _0x5081cc['status'](_0x128534)[_0x6cf5('0x1d')]();};}function respondWithResult(_0x579efc,_0x54934f){_0x54934f=_0x54934f||0xc8;return function(_0x43fba2){if(_0x43fba2){return _0x579efc['status'](_0x54934f)[_0x6cf5('0x1e')](_0x43fba2);}};}function respondWithFilteredResult(_0x2a2f44,_0x4e1937){return function(_0x4b3e57){if(_0x4b3e57){var _0x54afed=typeof _0x4e1937[_0x6cf5('0x1f')]===_0x6cf5('0x20')&&typeof _0x4e1937[_0x6cf5('0x21')]==='undefined';var _0x4a6822=_0x4b3e57[_0x6cf5('0x22')];var _0x57ee8f=_0x54afed?0x0:_0x4e1937[_0x6cf5('0x1f')];var _0x46f1cc=_0x54afed?_0x4b3e57[_0x6cf5('0x22')]:_0x4e1937[_0x6cf5('0x1f')]+_0x4e1937[_0x6cf5('0x21')];var _0x3a08f0;if(_0x46f1cc>=_0x4a6822){_0x46f1cc=_0x4a6822;_0x3a08f0=0xc8;}else{_0x3a08f0=0xce;}_0x2a2f44['status'](_0x3a08f0);return _0x2a2f44['set'](_0x6cf5('0x23'),_0x57ee8f+'-'+_0x46f1cc+'/'+_0x4a6822)['json'](_0x4b3e57);}return null;};}function patchUpdates(_0x58fad0){return function(_0x5bed8c){try{jsonpatch[_0x6cf5('0x24')](_0x5bed8c,_0x58fad0,!![]);}catch(_0x1cb51b){return BPromise[_0x6cf5('0x25')](_0x1cb51b);}return _0x5bed8c[_0x6cf5('0x26')]();};}function saveUpdates(_0x333bab,_0x589bcd){return function(_0x4a19fc){if(_0x4a19fc){return _0x4a19fc[_0x6cf5('0x27')](_0x333bab)[_0x6cf5('0x28')](function(_0xe13f35){return _0xe13f35;});}return null;};}function removeEntity(_0x41c9ef,_0x5dada0){return function(_0x1797e3){if(_0x1797e3){return _0x1797e3[_0x6cf5('0x29')]()[_0x6cf5('0x28')](function(){var _0x2c6a99=_0x1797e3[_0x6cf5('0x2a')]({'plain':!![]});var _0xf7fe95=_0x6cf5('0x2b');return db[_0x6cf5('0x2c')][_0x6cf5('0x29')]({'where':{'type':_0xf7fe95,'resourceId':_0x2c6a99['id']}})[_0x6cf5('0x28')](function(){return _0x1797e3;});})[_0x6cf5('0x28')](function(){_0x41c9ef[_0x6cf5('0x2d')](0xcc)[_0x6cf5('0x1d')]();});}};}function handleEntityNotFound(_0x11b2ae,_0x23354a){return function(_0x4bacc1){if(!_0x4bacc1){_0x11b2ae[_0x6cf5('0x1c')](0x194);}return _0x4bacc1;};}function handleError(_0x5a9751,_0x144056){_0x144056=_0x144056||0x1f4;return function(_0xdab9d1){logger[_0x6cf5('0x2e')](_0xdab9d1[_0x6cf5('0x2f')]);if(_0xdab9d1[_0x6cf5('0x30')]){delete _0xdab9d1[_0x6cf5('0x30')];}_0x5a9751[_0x6cf5('0x2d')](_0x144056)['send'](_0xdab9d1);};}exports['index']=function(_0x65254,_0x27336c){var _0x4bd3c3={},_0xcf7a41={},_0x5eff59={'count':0x0,'rows':[]};var _0x46c9b7=_[_0x6cf5('0x31')](db[_0x6cf5('0x32')][_0x6cf5('0x33')],function(_0x536d11){return{'name':_0x536d11['fieldName'],'type':_0x536d11[_0x6cf5('0x34')][_0x6cf5('0x35')]};});_0xcf7a41[_0x6cf5('0x36')]=_[_0x6cf5('0x31')](_0x46c9b7,_0x6cf5('0x30'));_0xcf7a41[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x65254[_0x6cf5('0x37')]);_0xcf7a41[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0xcf7a41[_0x6cf5('0x36')],_0xcf7a41[_0x6cf5('0x37')]);_0x4bd3c3[_0x6cf5('0x3b')]=_[_0x6cf5('0x3a')](_0xcf7a41['model'],qs[_0x6cf5('0x3c')](_0x65254[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x4bd3c3[_0x6cf5('0x3b')]=_0x4bd3c3[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x4bd3c3[_0x6cf5('0x3b')]:_0xcf7a41[_0x6cf5('0x36')];if(!_0x65254['query'][_0x6cf5('0x3e')]('nolimit')){_0x4bd3c3[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x65254[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0x4bd3c3[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x65254[_0x6cf5('0x37')]['offset']);}_0x4bd3c3[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x65254['query'][_0x6cf5('0x40')]);_0x4bd3c3[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_['pick'](_0x65254[_0x6cf5('0x37')],_0xcf7a41[_0x6cf5('0x39')]),_0x46c9b7);if(_0x65254[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0x4bd3c3['where']=_['merge'](_0x4bd3c3[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x46c9b7,function(_0x457169){if(_0x457169[_0x6cf5('0x34')]!==_0x6cf5('0x43')){var _0x43925b={};_0x43925b[_0x457169[_0x6cf5('0x30')]]={'$like':'%'+_0x65254['query'][_0x6cf5('0x42')]+'%'};return _0x43925b;}})});}_0x4bd3c3=_[_0x6cf5('0x44')]({},_0x4bd3c3,_0x65254[_0x6cf5('0x45')]);var _0x3a1737={'where':_0x4bd3c3['where']};return db[_0x6cf5('0x32')]['count'](_0x3a1737)[_0x6cf5('0x28')](function(_0x21a1e3){_0x5eff59['count']=_0x21a1e3;if(_0x65254[_0x6cf5('0x37')]['includeAll']){_0x4bd3c3[_0x6cf5('0x46')]=[{'all':!![]}];}return db[_0x6cf5('0x32')][_0x6cf5('0x47')](_0x4bd3c3);})[_0x6cf5('0x28')](function(_0x1c9cf1){_0x5eff59[_0x6cf5('0x48')]=_0x1c9cf1;return _0x5eff59;})[_0x6cf5('0x28')](respondWithFilteredResult(_0x27336c,_0x4bd3c3))[_0x6cf5('0x49')](handleError(_0x27336c,null));};exports[_0x6cf5('0x4a')]=function(_0x482924,_0xbef03f){var _0x551680={'raw':!![],'where':{'id':_0x482924['params']['id']}},_0x4e1417={};_0x4e1417[_0x6cf5('0x36')]=_[_0x6cf5('0x38')](db['OpenchannelQueue'][_0x6cf5('0x33')]);_0x4e1417[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x482924[_0x6cf5('0x37')]);_0x4e1417[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x4e1417[_0x6cf5('0x36')],_0x4e1417[_0x6cf5('0x37')]);_0x551680[_0x6cf5('0x3b')]=_[_0x6cf5('0x3a')](_0x4e1417[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x482924[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x551680[_0x6cf5('0x3b')]=_0x551680[_0x6cf5('0x3b')]['length']?_0x551680[_0x6cf5('0x3b')]:_0x4e1417['model'];if(_0x482924['query'][_0x6cf5('0x4b')]){_0x551680[_0x6cf5('0x46')]=[{'all':!![]}];}_0x551680=_['merge']({},_0x551680,_0x482924[_0x6cf5('0x45')]);return db[_0x6cf5('0x32')][_0x6cf5('0x4c')](_0x551680)[_0x6cf5('0x28')](handleEntityNotFound(_0xbef03f,null))[_0x6cf5('0x28')](respondWithResult(_0xbef03f,null))[_0x6cf5('0x49')](handleError(_0xbef03f,null));};exports['create']=function(_0x11ad5d,_0x31689b){return db[_0x6cf5('0x32')]['create'](_0x11ad5d[_0x6cf5('0x4d')],{})[_0x6cf5('0x28')](function(_0x582d2b){var _0x28fe9b=_0x11ad5d['user'][_0x6cf5('0x2a')]({'plain':!![]});if(!_0x28fe9b)throw new Error(_0x6cf5('0x4e'));if(_0x28fe9b[_0x6cf5('0x4f')]===_0x6cf5('0x50')){var _0x4b1e36=_0x582d2b[_0x6cf5('0x2a')]({'plain':!![]});var _0x412f31=_0x6cf5('0x2b');return db[_0x6cf5('0x51')][_0x6cf5('0x4c')]({'where':{'name':_0x412f31,'userProfileId':_0x28fe9b['userProfileId']},'raw':!![]})[_0x6cf5('0x28')](function(_0x34e00d){if(_0x34e00d&&_0x34e00d[_0x6cf5('0x52')]===0x0){return db[_0x6cf5('0x2c')]['create']({'name':_0x4b1e36['name'],'resourceId':_0x4b1e36['id'],'type':_0x34e00d['name'],'sectionId':_0x34e00d['id']},{})['then'](function(){return _0x582d2b;});}else{return _0x582d2b;}})[_0x6cf5('0x49')](function(_0x2bac2a){logger[_0x6cf5('0x2e')](_0x6cf5('0x53'),_0x2bac2a);throw _0x2bac2a;});}return _0x582d2b;})[_0x6cf5('0x28')](respondWithResult(_0x31689b,0xc9))[_0x6cf5('0x49')](handleError(_0x31689b,null));};exports[_0x6cf5('0x27')]=function(_0x53bd59,_0x1b9974){if(_0x53bd59[_0x6cf5('0x4d')]['id']){delete _0x53bd59[_0x6cf5('0x4d')]['id'];}return db[_0x6cf5('0x32')]['find']({'where':{'id':_0x53bd59[_0x6cf5('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b9974,null))[_0x6cf5('0x28')](saveUpdates(_0x53bd59[_0x6cf5('0x4d')],null))['then'](respondWithResult(_0x1b9974,null))[_0x6cf5('0x49')](handleError(_0x1b9974,null));};exports[_0x6cf5('0x29')]=function(_0x2e9b5e,_0x2f9220){return db[_0x6cf5('0x32')]['find']({'where':{'id':_0x2e9b5e[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x2f9220,null))[_0x6cf5('0x28')](removeEntity(_0x2f9220,null))['catch'](handleError(_0x2f9220,null));};exports['describe']=function(_0x1e0565,_0x14372f){return db[_0x6cf5('0x32')]['describe']()[_0x6cf5('0x28')](respondWithResult(_0x14372f,null))[_0x6cf5('0x49')](handleError(_0x14372f,null));};exports[_0x6cf5('0x55')]=function(_0x1a2ec9,_0x3278c3,_0x5a5e71){var _0x727186={'raw':!![],'where':{}},_0x44780f={},_0x5139e0;return db[_0x6cf5('0x32')]['findOne']({'where':{'id':_0x1a2ec9['params']['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3278c3,null))['then'](function(_0x10a388){if(_0x10a388){_0x5139e0=_0x10a388[_0x6cf5('0x2a')]({'plain':!![]});_0x44780f['model']=_[_0x6cf5('0x38')](db[_0x6cf5('0x56')][_0x6cf5('0x33')]);_0x44780f[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x1a2ec9[_0x6cf5('0x37')]);_0x44780f[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x44780f[_0x6cf5('0x36')],_0x44780f[_0x6cf5('0x37')]);_0x727186['attributes']=_[_0x6cf5('0x3a')](_0x44780f[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x727186[_0x6cf5('0x3b')]=_0x727186[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x727186['attributes']:_0x44780f[_0x6cf5('0x36')];if(!_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x3e')]('nolimit')){_0x727186[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1a2ec9[_0x6cf5('0x37')]['limit']);_0x727186[_0x6cf5('0x1f')]=qs['offset'](_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x1f')]);}_0x727186[_0x6cf5('0x3f')]=qs['sort'](_0x1a2ec9[_0x6cf5('0x37')]['sort']);_0x727186[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1a2ec9[_0x6cf5('0x37')],_0x44780f['filters']));_0x727186['where']['OpenchannelQueueId']=_0x10a388['id'];if(_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0x727186[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0x727186[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x727186[_0x6cf5('0x3b')],function(_0x396876){var _0x306457={};_0x306457[_0x396876]={'$like':'%'+_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x306457;})});}_0x727186=_[_0x6cf5('0x44')]({},_0x727186,_0x1a2ec9[_0x6cf5('0x45')]);return db[_0x6cf5('0x56')][_0x6cf5('0x47')](_0x727186);}})[_0x6cf5('0x28')](function(_0x22531f){if(_0x22531f){return db[_0x6cf5('0x58')][_0x6cf5('0x59')]({'where':{'id':_['map'](_0x22531f,_0x6cf5('0x5a')),'role':_0x6cf5('0x5b')},'attributes':['id',_0x6cf5('0x30'),_0x6cf5('0x5c'),'updatedAt',_0x6cf5('0x5d')]});}})[_0x6cf5('0x28')](function(_0x2fd560){if(_0x2fd560){return{'count':_0x2fd560[_0x6cf5('0x22')],'rows':_['map'](_0x2fd560['rows'],function(_0x2be9f5){return{'membername':_0x2be9f5['name'],'UserId':_0x2be9f5['id'],'queue_name':_0x5139e0['name'],'OpenchannelQueueId':_0x5139e0['id'],'interface':util[_0x6cf5('0x5e')](_0x6cf5('0x5f'),_0x6cf5('0x60'),_0x2be9f5[_0x6cf5('0x30')]),'penalty':0x0,'paused':_0x2be9f5[_0x6cf5('0x5c')],'createdAt':_0x2be9f5[_0x6cf5('0x5d')],'updatedAt':_0x2be9f5[_0x6cf5('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3278c3,_0x727186))[_0x6cf5('0x49')](handleError(_0x3278c3,null));};exports[_0x6cf5('0x62')]=function(_0x1c2868,_0x3ddb78,_0x5451d1){var _0x516947={};var _0x1ff2bf={};var _0x2d1fce;var _0x45e7a3;return db[_0x6cf5('0x32')]['findOne']({'where':{'id':_0x1c2868[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3ddb78,null))[_0x6cf5('0x28')](function(_0x2b9f){if(_0x2b9f){_0x2d1fce=_0x2b9f;_0x1ff2bf[_0x6cf5('0x36')]=_['keys'](db['Team']['rawAttributes']);_0x1ff2bf[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x1c2868[_0x6cf5('0x37')]);_0x1ff2bf[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x1ff2bf[_0x6cf5('0x36')],_0x1ff2bf[_0x6cf5('0x37')]);_0x516947['attributes']=_[_0x6cf5('0x3a')](_0x1ff2bf[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x516947['attributes']=_0x516947[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x516947['attributes']:_0x1ff2bf[_0x6cf5('0x36')];_0x516947[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x40')]);_0x516947[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1c2868[_0x6cf5('0x37')],_0x1ff2bf['filters']));if(_0x1c2868['query'][_0x6cf5('0x42')]){_0x516947[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0x516947[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x516947[_0x6cf5('0x3b')],function(_0x519821){var _0x4d7da0={};_0x4d7da0[_0x519821]={'$like':'%'+_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x4d7da0;})});}_0x516947=_[_0x6cf5('0x44')]({},_0x516947,_0x1c2868[_0x6cf5('0x45')]);return _0x2d1fce['getTeams'](_0x516947);}})[_0x6cf5('0x28')](function(_0xfc0692){if(_0xfc0692){_0x45e7a3=_0xfc0692[_0x6cf5('0x3d')];if(!_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x3e')](_0x6cf5('0x63'))){_0x516947[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0x516947[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x1c2868[_0x6cf5('0x37')]['offset']);}return _0x2d1fce[_0x6cf5('0x62')](_0x516947);}})[_0x6cf5('0x28')](function(_0x1c0892){if(_0x1c0892){return _0x1c0892?{'count':_0x45e7a3,'rows':_0x1c0892}:null;}})[_0x6cf5('0x28')](respondWithResult(_0x3ddb78,null))['catch'](handleError(_0x3ddb78,null));};exports[_0x6cf5('0x64')]=function(_0x14fb8c,_0xf07884,_0x29906f){var _0x369a10=_0x14fb8c[_0x6cf5('0x4d')][_0x6cf5('0x65')];return db[_0x6cf5('0x66')]['findAll']({'where':{'id':_0x369a10},'attributes':['id'],'include':[{'model':db[_0x6cf5('0x58')],'as':_0x6cf5('0x67'),'attributes':['id','name',_0x6cf5('0x68'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x259f26){if(_0x259f26){var _0x436bec=_['flatMap'](_0x259f26,function(_0x17dac6){var _0x3d4799=_0x17dac6[_0x6cf5('0x2a')]({'plain':!![]});return _0x3d4799[_0x6cf5('0x67')];});return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x14fb8c[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](function(_0x3815b3){return db['sequelize']['transaction'](function(_0x34ab9a){return _0x3815b3[_0x6cf5('0x64')](_0x369a10,{'transaction':_0x34ab9a})[_0x6cf5('0x28')](function(){return BPromise[_0x6cf5('0x69')](_0x436bec,function(_0x3e665f){return db[_0x6cf5('0x56')][_0x6cf5('0x6a')]({'where':{'UserId':_0x3e665f['id'],'OpenchannelQueueId':_0x14fb8c[_0x6cf5('0x54')]['id']},'transaction':_0x34ab9a});});})[_0x6cf5('0x28')](function(){_0x436bec['forEach'](function(_0x5b7be1){socket[_0x6cf5('0x6b')](_0x6cf5('0x6c'),{'UserId':_0x5b7be1['id'],'OpenchannelQueueId':_0x3815b3['id']});});});});});}})[_0x6cf5('0x28')](respondWithStatusCode(_0xf07884,null))[_0x6cf5('0x49')](handleError(_0xf07884,null));};exports[_0x6cf5('0x6d')]=function(_0x309c98,_0x57bc16,_0xa760c9){return db[_0x6cf5('0x66')][_0x6cf5('0x47')]({'where':{'id':_0x309c98[_0x6cf5('0x37')][_0x6cf5('0x65')]},'attributes':['id'],'include':[{'model':db[_0x6cf5('0x58')],'as':_0x6cf5('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x57bc16,null))[_0x6cf5('0x28')](function(_0x46567){var _0x3c51ee=_['map'](_0x46567,'id');var _0x109324=[];var _0x1eb360=[];var _0x2169f0=squel[_0x6cf5('0x6e')]();_0x2169f0[_0x6cf5('0x6f')](_0x6cf5('0x70'))['from'](_0x6cf5('0x71'),'tq')[_0x6cf5('0x72')](_0x6cf5('0x73'),'ut',_0x6cf5('0x74'))['where'](_0x6cf5('0x75'),_0x309c98[_0x6cf5('0x54')]['id']);for(var _0x2ff7e7=0x0;_0x2ff7e7<_0x46567[_0x6cf5('0x3d')];_0x2ff7e7+=0x1){let _0x11229d=_0x46567[_0x2ff7e7];for(var _0x5b1835=0x0;_0x5b1835<_0x11229d[_0x6cf5('0x67')][_0x6cf5('0x3d')];_0x5b1835+=0x1){let _0x57fe71=_0x11229d[_0x6cf5('0x67')][_0x5b1835];var _0x597690=_0x2169f0[_0x6cf5('0x76')]();_0x597690[_0x6cf5('0x41')](_0x6cf5('0x77'),_0x57fe71['id']);_0x1eb360[_0x6cf5('0x78')](db[_0x6cf5('0x79')][_0x6cf5('0x37')](_0x597690[_0x6cf5('0x7a')](),{'type':db[_0x6cf5('0x79')]['QueryTypes']['SELECT']})[_0x6cf5('0x28')](function(_0xc4ef5){if(_0xc4ef5[_0x6cf5('0x3d')]===0x1){return _0x57fe71['id'];}else{var _0x567dc2=_[_0x6cf5('0x7b')](_[_0x6cf5('0x31')](_0xc4ef5,_0x6cf5('0x7c')),function(_0x398229){return _[_0x6cf5('0x7d')](_0x3c51ee,_0x398229);});if(_0x567dc2){return _0x57fe71['id'];}}}));}}return BPromise['all'](_0x1eb360)['then'](function(_0x38d90a){_0x109324=_(_0x109324)[_0x6cf5('0x7e')](_0x38d90a)['compact']()['value']();return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x309c98[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](function(_0x56fe8b){return db[_0x6cf5('0x79')][_0x6cf5('0x7f')](function(_0x476556){return _0x56fe8b[_0x6cf5('0x6d')](_0x309c98[_0x6cf5('0x37')][_0x6cf5('0x65')],{'transaction':_0x476556})['then'](function(){if(!_['isEmpty'](_0x109324)){return _0x56fe8b[_0x6cf5('0x80')](_0x109324,{'transaction':_0x476556});}})[_0x6cf5('0x28')](function(){_0x109324[_0x6cf5('0x81')](function(_0x5a0a2e){socket[_0x6cf5('0x6b')](_0x6cf5('0x82'),{'UserId':_0x5a0a2e,'OpenchannelQueueId':_0x56fe8b['id']});});});});});});})['then'](respondWithStatusCode(_0x57bc16,null))['catch'](handleError(_0x57bc16,null));};exports['addAgents']=function(_0x36c601,_0x392a43,_0x125f96){return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x36c601[_0x6cf5('0x54')]['id']}})['then'](handleEntityNotFound(_0x392a43,null))['then'](function(_0xe08c97){if(_0xe08c97){return _0xe08c97[_0x6cf5('0x83')](_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')],_[_0x6cf5('0x84')](_0x36c601[_0x6cf5('0x4d')],['ids','id'])||{})[_0x6cf5('0x85')](function(_0x46a77d){for(var _0x58859d=0x0;_0x58859d<_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')]['length'];_0x58859d+=0x1){socket[_0x6cf5('0x6b')](_0x6cf5('0x6c'),{'UserId':Number(_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')][_0x58859d]),'OpenchannelQueueId':Number(_0x36c601[_0x6cf5('0x54')]['id'])});}return _0x46a77d;});}})[_0x6cf5('0x28')](respondWithResult(_0x392a43,null))[_0x6cf5('0x49')](handleError(_0x392a43,null));};exports['removeAgents']=function(_0x4b0f53,_0x3d3224,_0x3b86ce){return db[_0x6cf5('0x32')][_0x6cf5('0x4c')]({'where':{'id':_0x4b0f53[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3d3224,null))['then'](function(_0xb3dd24){if(_0xb3dd24){return _0xb3dd24[_0x6cf5('0x80')](_0x4b0f53['query'][_0x6cf5('0x65')])[_0x6cf5('0x28')](function(){if(_['isArray'](_0x4b0f53[_0x6cf5('0x37')][_0x6cf5('0x65')])){for(var _0x5f0b23=0x0;_0x5f0b23<_0x4b0f53['query']['ids'][_0x6cf5('0x3d')];_0x5f0b23+=0x1){socket[_0x6cf5('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4b0f53[_0x6cf5('0x37')]['ids'][_0x5f0b23]),'OpenchannelQueueId':Number(_0x4b0f53[_0x6cf5('0x54')]['id'])});}}else{socket[_0x6cf5('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4b0f53['query'][_0x6cf5('0x65')]),'OpenchannelQueueId':Number(_0x4b0f53[_0x6cf5('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3224,null))[_0x6cf5('0x49')](handleError(_0x3d3224,null));};exports[_0x6cf5('0x86')]=function(_0x1e1caa,_0x1434f1,_0x2fd2ef){var _0xba39fe={};var _0x2be56e={};var _0x512f03;var _0x4c933c;return db[_0x6cf5('0x32')][_0x6cf5('0x87')]({'where':{'id':_0x1e1caa[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x1434f1,null))[_0x6cf5('0x28')](function(_0x43dd40){if(_0x43dd40){_0x512f03=_0x43dd40;_0x2be56e[_0x6cf5('0x36')]=_[_0x6cf5('0x38')](db[_0x6cf5('0x58')][_0x6cf5('0x33')]);_0x2be56e[_0x6cf5('0x37')]=_['keys'](_0x1e1caa['query']);_0x2be56e['filters']=_[_0x6cf5('0x3a')](_0x2be56e[_0x6cf5('0x36')],_0x2be56e['query']);_0xba39fe['attributes']=_[_0x6cf5('0x3a')](_0x2be56e['model'],qs[_0x6cf5('0x3c')](_0x1e1caa[_0x6cf5('0x37')]['fields']));_0xba39fe[_0x6cf5('0x3b')]=_0xba39fe['attributes'][_0x6cf5('0x3d')]?_0xba39fe[_0x6cf5('0x3b')]:_0x2be56e[_0x6cf5('0x36')];_0xba39fe[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x1e1caa[_0x6cf5('0x37')]['sort']);_0xba39fe['where']=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1e1caa['query'],_0x2be56e[_0x6cf5('0x39')]));if(_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0xba39fe[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0xba39fe[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0xba39fe[_0x6cf5('0x3b')],function(_0x33c318){var _0x2ae56a={};_0x2ae56a[_0x33c318]={'$like':'%'+_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x2ae56a;})});}_0xba39fe=_[_0x6cf5('0x44')]({},_0xba39fe,_0x1e1caa[_0x6cf5('0x45')]);return _0x512f03[_0x6cf5('0x86')](_0xba39fe);}})[_0x6cf5('0x28')](function(_0x1d4b0c){if(_0x1d4b0c){_0x4c933c=_0x1d4b0c['length'];if(!_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x3e')](_0x6cf5('0x63'))){_0xba39fe[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0xba39fe[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x1e1caa['query'][_0x6cf5('0x1f')]);}return _0x512f03[_0x6cf5('0x86')](_0xba39fe);}})['then'](function(_0x244587){if(_0x244587){return _0x244587?{'count':_0x4c933c,'rows':_0x244587}:null;}})['then'](respondWithResult(_0x1434f1,null))[_0x6cf5('0x49')](handleError(_0x1434f1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e0988ea..6330bde 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 _0xe9d7=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0xa4e62a,_0x6e308a){var _0x4eb8bd=function(_0x1afcf6){while(--_0x1afcf6){_0xa4e62a['push'](_0xa4e62a['shift']());}};_0x4eb8bd(++_0x6e308a);}(_0xe9d7,0x182));var _0x7e9d=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0xe9d7[_0x1ae125];return _0x1f3b2b;};'use strict';var EventEmitter=require(_0x7e9d('0x0'));var OpenchannelQueue=require(_0x7e9d('0x1'))['db'][_0x7e9d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7e9d('0x3')](0x0);var events={'afterCreate':_0x7e9d('0x4'),'afterUpdate':'update','afterDestroy':_0x7e9d('0x5')};function emitEvent(_0x44afcb){return function(_0xdc1e33,_0xbcf589,_0x5b16a6){OpenchannelQueueEvents[_0x7e9d('0x6')](_0x44afcb+':'+_0xdc1e33['id'],_0xdc1e33);OpenchannelQueueEvents[_0x7e9d('0x6')](_0x44afcb,_0xdc1e33);_0x5b16a6(null);};}for(var e in events){if(events[_0x7e9d('0x7')](e)){var event=events[e];OpenchannelQueue[_0x7e9d('0x8')](e,emitEvent(event));}}module[_0x7e9d('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xeca8=['OpenchannelQueue','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xeca8,0x193));var _0x8eca=function(_0x2dcc88,_0xc89492){_0x2dcc88=_0x2dcc88-0x0;var _0x2a8268=_0xeca8[_0x2dcc88];return _0x2a8268;};'use strict';var EventEmitter=require(_0x8eca('0x0'));var OpenchannelQueue=require(_0x8eca('0x1'))['db'][_0x8eca('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8eca('0x3'),'afterUpdate':'update','afterDestroy':_0x8eca('0x4')};function emitEvent(_0xf522e0){return function(_0x3f4392,_0x1c1ce3,_0x43e4f3){OpenchannelQueueEvents[_0x8eca('0x5')](_0xf522e0+':'+_0x3f4392['id'],_0x3f4392);OpenchannelQueueEvents['emit'](_0xf522e0,_0x3f4392);_0x43e4f3(null);};}for(var e in events){if(events[_0x8eca('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8eca('0x7')](e,emitEvent(event));}}module[_0x8eca('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 bdd9a88..c22cc73 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 _0x6b55=['moment','bluebird','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0x6b55,0xb1));var _0x56b5=function(_0x5b081b,_0xf5aafd){_0x5b081b=_0x5b081b-0x0;var _0x21a466=_0x6b55[_0x5b081b];return _0x21a466;};'use strict';var _=require(_0x56b5('0x0'));var util=require('util');var logger=require(_0x56b5('0x1'))(_0x56b5('0x2'));var moment=require(_0x56b5('0x3'));var BPromise=require(_0x56b5('0x4'));var rp=require(_0x56b5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56b5('0x6'));var config=require('../../config/environment');var attributes=require(_0x56b5('0x7'));module[_0x56b5('0x8')]=function(_0x1735ae,_0xc698c4){return _0x1735ae[_0x56b5('0x9')](_0x56b5('0xa'),attributes,{'tableName':_0x56b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x753b=['request-promise','path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0xddeb96,_0x1c3406){var _0x1f270c=function(_0x2632ad){while(--_0x2632ad){_0xddeb96['push'](_0xddeb96['shift']());}};_0x1f270c(++_0x1c3406);}(_0x753b,0x11a));var _0xb753=function(_0x2bcf5e,_0x5d9059){_0x2bcf5e=_0x2bcf5e-0x0;var _0x94e486=_0x753b[_0x2bcf5e];return _0x94e486;};'use strict';var _=require(_0xb753('0x0'));var util=require(_0xb753('0x1'));var logger=require(_0xb753('0x2'))(_0xb753('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb753('0x4'));var fs=require('fs');var path=require(_0xb753('0x5'));var rimraf=require(_0xb753('0x6'));var config=require(_0xb753('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xb753('0x8')]=function(_0x5bfc3a,_0x3e1cf8){return _0x5bfc3a['define'](_0xb753('0x9'),attributes,{'tableName':_0xb753('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 c7f807c..4bda98d 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 _0xa218=['raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options'];(function(_0x435850,_0x32aa47){var _0x5453e4=function(_0x17b32a){while(--_0x17b32a){_0x435850['push'](_0x435850['shift']());}};_0x5453e4(++_0x32aa47);}(_0xa218,0xa9));var _0x8a21=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa218[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8a21('0x0'));var util=require(_0x8a21('0x1'));var moment=require('moment');var BPromise=require(_0x8a21('0x2'));var rs=require(_0x8a21('0x3'));var fs=require('fs');var Redis=require(_0x8a21('0x4'));var db=require(_0x8a21('0x5'))['db'];var utils=require(_0x8a21('0x6'));var logger=require('../../config/logger')(_0x8a21('0x7'));var config=require(_0x8a21('0x8'));var jayson=require(_0x8a21('0x9'));var client=jayson[_0x8a21('0xa')]['http']({'port':0x232a});config[_0x8a21('0xb')]=_[_0x8a21('0xc')](config['redis'],{'host':_0x8a21('0xd'),'port':0x18eb});var socket=require(_0x8a21('0xe'))(new Redis(config[_0x8a21('0xb')]));require('./openchannelQueue.socket')[_0x8a21('0xf')](socket);function respondWithRpcPromise(_0x1735dc,_0x329ef7,_0x4cc0a4){return new BPromise(function(_0x4896c2,_0x442eb2){return client[_0x8a21('0x10')](_0x1735dc,_0x4cc0a4)[_0x8a21('0x11')](function(_0x343e21){logger[_0x8a21('0x12')](_0x8a21('0x13'),_0x329ef7,'request\x20sent');logger[_0x8a21('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x329ef7,_0x8a21('0x15'),JSON[_0x8a21('0x16')](_0x343e21));if(_0x343e21[_0x8a21('0x17')]){if(_0x343e21['error'][_0x8a21('0x18')]===0x1f4){logger['error'](_0x8a21('0x13'),_0x329ef7,_0x343e21['error'][_0x8a21('0x19')]);return _0x442eb2(_0x343e21[_0x8a21('0x17')][_0x8a21('0x19')]);}logger[_0x8a21('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x329ef7,_0x343e21['error'][_0x8a21('0x19')]);return _0x4896c2(_0x343e21[_0x8a21('0x17')]['message']);}else{logger['info'](_0x8a21('0x13'),_0x329ef7,'request\x20sent');_0x4896c2(_0x343e21[_0x8a21('0x1a')]['message']);}})[_0x8a21('0x1b')](function(_0x211aee){logger[_0x8a21('0x17')](_0x8a21('0x13'),_0x329ef7,_0x211aee);_0x442eb2(_0x211aee);});});}exports[_0x8a21('0x1c')]=function(_0x79d415){var _0x46b5a5=this;return new Promise(function(_0x1c4a23,_0x5db481){return db[_0x8a21('0x1d')]['findAll']({'raw':_0x79d415['options']?_0x79d415[_0x8a21('0x1e')][_0x8a21('0x1f')]===undefined?!![]:![]:!![],'where':_0x79d415['options']?_0x79d415['options'][_0x8a21('0x20')]||null:null,'attributes':_0x79d415['options']?_0x79d415[_0x8a21('0x1e')][_0x8a21('0x21')]||null:null,'limit':_0x79d415[_0x8a21('0x1e')]?_0x79d415[_0x8a21('0x1e')][_0x8a21('0x22')]||null:null,'include':_0x79d415[_0x8a21('0x1e')]?_0x79d415[_0x8a21('0x1e')][_0x8a21('0x23')]?_[_0x8a21('0x24')](_0x79d415[_0x8a21('0x1e')]['include'],function(_0x346341){return{'model':db[_0x346341[_0x8a21('0x25')]],'as':_0x346341['as'],'attributes':_0x346341[_0x8a21('0x21')],'include':_0x346341[_0x8a21('0x23')]?_[_0x8a21('0x24')](_0x346341[_0x8a21('0x23')],function(_0x441670){return{'model':db[_0x441670[_0x8a21('0x25')]],'as':_0x441670['as'],'attributes':_0x441670[_0x8a21('0x21')],'include':_0x441670['include']?_['map'](_0x441670[_0x8a21('0x23')],function(_0x470c22){return{'model':db[_0x470c22[_0x8a21('0x25')]],'as':_0x470c22['as'],'attributes':_0x470c22['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a21('0x11')](function(_0x51fb0a){logger[_0x8a21('0x12')](_0x8a21('0x1c'),_0x79d415);logger[_0x8a21('0x14')](_0x8a21('0x1c'),_0x79d415,JSON['stringify'](_0x51fb0a));_0x1c4a23(_0x51fb0a);})[_0x8a21('0x1b')](function(_0x59befa){logger[_0x8a21('0x17')](_0x8a21('0x1c'),_0x59befa[_0x8a21('0x19')],_0x79d415);_0x5db481(_0x46b5a5[_0x8a21('0x17')](0x1f4,_0x59befa[_0x8a21('0x19')]));});});};exports[_0x8a21('0x26')]=function(_0x428cb0){var _0x122948=this;return new Promise(function(_0x37f878,_0x3280e1){return db[_0x8a21('0x1d')][_0x8a21('0x27')]({'raw':_0x428cb0['options']?_0x428cb0[_0x8a21('0x1e')][_0x8a21('0x1f')]===undefined?!![]:![]:!![],'where':_0x428cb0[_0x8a21('0x1e')]?_0x428cb0['options'][_0x8a21('0x20')]||null:null,'attributes':_0x428cb0['options']?_0x428cb0[_0x8a21('0x1e')][_0x8a21('0x21')]||null:null,'include':_0x428cb0[_0x8a21('0x1e')]?_0x428cb0[_0x8a21('0x1e')][_0x8a21('0x23')]?_[_0x8a21('0x24')](_0x428cb0[_0x8a21('0x1e')][_0x8a21('0x23')],function(_0x25b3e8){return{'model':db[_0x25b3e8[_0x8a21('0x25')]],'as':_0x25b3e8['as'],'attributes':_0x25b3e8['attributes'],'include':_0x25b3e8['include']?_[_0x8a21('0x24')](_0x25b3e8['include'],function(_0x686ea3){return{'model':db[_0x686ea3[_0x8a21('0x25')]],'as':_0x686ea3['as'],'attributes':_0x686ea3[_0x8a21('0x21')],'include':_0x686ea3[_0x8a21('0x23')]?_[_0x8a21('0x24')](_0x686ea3[_0x8a21('0x23')],function(_0x25cc55){return{'model':db[_0x25cc55['model']],'as':_0x25cc55['as'],'attributes':_0x25cc55[_0x8a21('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ea9f4){logger[_0x8a21('0x12')](_0x8a21('0x26'),_0x428cb0);logger[_0x8a21('0x14')](_0x8a21('0x26'),_0x428cb0,JSON[_0x8a21('0x16')](_0x4ea9f4));_0x37f878(_0x4ea9f4);})[_0x8a21('0x1b')](function(_0x439d95){logger[_0x8a21('0x17')]('ShowOpenchannelQueue',_0x439d95[_0x8a21('0x19')],_0x428cb0);_0x3280e1(_0x122948[_0x8a21('0x17')](0x1f4,_0x439d95[_0x8a21('0x19')]));});});}; \ No newline at end of file +var _0xff75=['attributes','map','catch','ShowOpenchannelQueue','find','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelQueue,\x20%s,\x20%s','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0xff75,0x13e));var _0x5ff7=function(_0x557c0b,_0x19f527){_0x557c0b=_0x557c0b-0x0;var _0x25806a=_0xff75[_0x557c0b];return _0x25806a;};'use strict';var _=require(_0x5ff7('0x0'));var util=require(_0x5ff7('0x1'));var moment=require(_0x5ff7('0x2'));var BPromise=require(_0x5ff7('0x3'));var rs=require(_0x5ff7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ff7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ff7('0x6'));var config=require(_0x5ff7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ff7('0x8')][_0x5ff7('0x9')]({'port':0x232a});config[_0x5ff7('0xa')]=_[_0x5ff7('0xb')](config[_0x5ff7('0xa')],{'host':_0x5ff7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ff7('0xa')]));require(_0x5ff7('0xd'))[_0x5ff7('0xe')](socket);function respondWithRpcPromise(_0x1282f2,_0x1134f2,_0x26bb4a){return new BPromise(function(_0x2b5b4f,_0x5bd076){return client[_0x5ff7('0xf')](_0x1282f2,_0x26bb4a)[_0x5ff7('0x10')](function(_0x1ff2a2){logger[_0x5ff7('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x1134f2,'request\x20sent');logger[_0x5ff7('0x12')](_0x5ff7('0x13'),_0x1134f2,_0x5ff7('0x14'),JSON[_0x5ff7('0x15')](_0x1ff2a2));if(_0x1ff2a2['error']){if(_0x1ff2a2[_0x5ff7('0x16')]['code']===0x1f4){logger[_0x5ff7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1134f2,_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);return _0x5bd076(_0x1ff2a2['error']['message']);}logger['error'](_0x5ff7('0x18'),_0x1134f2,_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);return _0x2b5b4f(_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);}else{logger[_0x5ff7('0x11')](_0x5ff7('0x18'),_0x1134f2,'request\x20sent');_0x2b5b4f(_0x1ff2a2['result'][_0x5ff7('0x17')]);}})['catch'](function(_0x31f28c){logger['error'](_0x5ff7('0x18'),_0x1134f2,_0x31f28c);_0x5bd076(_0x31f28c);});});}exports[_0x5ff7('0x19')]=function(_0x3fd29f){var _0x27907d=this;return new Promise(function(_0x7d891,_0x21a78b){return db[_0x5ff7('0x1a')][_0x5ff7('0x1b')]({'raw':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x1d')]===undefined?!![]:![]:!![],'where':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f['options'][_0x5ff7('0x1e')]||null:null,'attributes':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')]['attributes']||null:null,'limit':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x1f')]||null:null,'include':_0x3fd29f['options']?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x20')]?_['map'](_0x3fd29f['options']['include'],function(_0x16379f){return{'model':db[_0x16379f['model']],'as':_0x16379f['as'],'attributes':_0x16379f[_0x5ff7('0x21')],'include':_0x16379f[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x16379f[_0x5ff7('0x20')],function(_0x37bf6c){return{'model':db[_0x37bf6c['model']],'as':_0x37bf6c['as'],'attributes':_0x37bf6c['attributes'],'include':_0x37bf6c[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x37bf6c['include'],function(_0x2ff153){return{'model':db[_0x2ff153['model']],'as':_0x2ff153['as'],'attributes':_0x2ff153[_0x5ff7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1868d2){logger[_0x5ff7('0x11')](_0x5ff7('0x19'),_0x3fd29f);logger['debug'](_0x5ff7('0x19'),_0x3fd29f,JSON[_0x5ff7('0x15')](_0x1868d2));_0x7d891(_0x1868d2);})[_0x5ff7('0x23')](function(_0x266bc0){logger[_0x5ff7('0x16')]('GetOpenchannelQueue',_0x266bc0[_0x5ff7('0x17')],_0x3fd29f);_0x21a78b(_0x27907d[_0x5ff7('0x16')](0x1f4,_0x266bc0[_0x5ff7('0x17')]));});});};exports[_0x5ff7('0x24')]=function(_0x49de35){var _0x200914=this;return new Promise(function(_0x5274c3,_0x48a87a){return db['OpenchannelQueue'][_0x5ff7('0x25')]({'raw':_0x49de35['options']?_0x49de35['options'][_0x5ff7('0x1d')]===undefined?!![]:![]:!![],'where':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x1e')]||null:null,'attributes':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x21')]||null:null,'include':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')]['include']?_[_0x5ff7('0x22')](_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x20')],function(_0x3e67fc){return{'model':db[_0x3e67fc[_0x5ff7('0x26')]],'as':_0x3e67fc['as'],'attributes':_0x3e67fc[_0x5ff7('0x21')],'include':_0x3e67fc[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x3e67fc[_0x5ff7('0x20')],function(_0x4bfd29){return{'model':db[_0x4bfd29['model']],'as':_0x4bfd29['as'],'attributes':_0x4bfd29[_0x5ff7('0x21')],'include':_0x4bfd29['include']?_[_0x5ff7('0x22')](_0x4bfd29[_0x5ff7('0x20')],function(_0xb62c9e){return{'model':db[_0xb62c9e[_0x5ff7('0x26')]],'as':_0xb62c9e['as'],'attributes':_0xb62c9e[_0x5ff7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5ff7('0x10')](function(_0x4a1c6f){logger[_0x5ff7('0x11')]('ShowOpenchannelQueue',_0x49de35);logger[_0x5ff7('0x12')]('ShowOpenchannelQueue',_0x49de35,JSON['stringify'](_0x4a1c6f));_0x5274c3(_0x4a1c6f);})['catch'](function(_0x5d2765){logger['error']('ShowOpenchannelQueue',_0x5d2765[_0x5ff7('0x17')],_0x49de35);_0x48a87a(_0x200914[_0x5ff7('0x16')](0x1f4,_0x5d2765[_0x5ff7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4dcada3..602d589 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 _0x6e8e=['./openchannelQueue.events','save','remove','update','emit','removeListener','register','length','openchannelQueue:'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x6e8e,0x14d));var _0xe6e8=function(_0x2e9bd9,_0x366854){_0x2e9bd9=_0x2e9bd9-0x0;var _0x2dec01=_0x6e8e[_0x2e9bd9];return _0x2dec01;};'use strict';var OpenchannelQueueEvents=require(_0xe6e8('0x0'));var events=[_0xe6e8('0x1'),_0xe6e8('0x2'),_0xe6e8('0x3')];function createListener(_0x14a7b9,_0x5a994d){return function(_0x3b3495){_0x5a994d[_0xe6e8('0x4')](_0x14a7b9,_0x3b3495);};}function removeListener(_0x23daa4,_0x42386c){return function(){OpenchannelQueueEvents[_0xe6e8('0x5')](_0x23daa4,_0x42386c);};}exports[_0xe6e8('0x6')]=function(_0x1597c1){for(var _0x121891=0x0,_0x53dfe5=events[_0xe6e8('0x7')];_0x121891<_0x53dfe5;_0x121891++){var _0x4391ac=events[_0x121891];var _0xa8669c=createListener(_0xe6e8('0x8')+_0x4391ac,_0x1597c1);OpenchannelQueueEvents['on'](_0x4391ac,_0xa8669c);}}; \ No newline at end of file +var _0xcac3=['update','removeListener','register','length','openchannelQueue:','save','remove'];(function(_0x512788,_0x2ba055){var _0x4e6a78=function(_0x54ed14){while(--_0x54ed14){_0x512788['push'](_0x512788['shift']());}};_0x4e6a78(++_0x2ba055);}(_0xcac3,0x1a9));var _0x3cac=function(_0x15c7ab,_0x317c91){_0x15c7ab=_0x15c7ab-0x0;var _0x2ba2cc=_0xcac3[_0x15c7ab];return _0x2ba2cc;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x3cac('0x0'),_0x3cac('0x1'),_0x3cac('0x2')];function createListener(_0x407434,_0x9d44f4){return function(_0x6fe7b6){_0x9d44f4['emit'](_0x407434,_0x6fe7b6);};}function removeListener(_0x405fca,_0x5267fc){return function(){OpenchannelQueueEvents[_0x3cac('0x3')](_0x405fca,_0x5267fc);};}exports[_0x3cac('0x4')]=function(_0x1252c8){for(var _0x476b9a=0x0,_0x2168a0=events[_0x3cac('0x5')];_0x476b9a<_0x2168a0;_0x476b9a++){var _0x411520=events[_0x476b9a];var _0x78de28=createListener(_0x3cac('0x6')+_0x411520,_0x1252c8);OpenchannelQueueEvents['on'](_0x411520,_0x78de28);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index c4c7de8..b94c644 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 _0x5724=['Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x49b488,_0x19a5b6){var _0x506906=function(_0x5d903c){while(--_0x5d903c){_0x49b488['push'](_0x49b488['shift']());}};_0x506906(++_0x19a5b6);}(_0x5724,0xe2));var _0x4572=function(_0x438b88,_0x1d6000){_0x438b88=_0x438b88-0x0;var _0x145480=_0x5724[_0x438b88];return _0x145480;};'use strict';var multer=require(_0x4572('0x0'));var util=require(_0x4572('0x1'));var path=require(_0x4572('0x2'));var timeout=require(_0x4572('0x3'));var express=require(_0x4572('0x4'));var router=express[_0x4572('0x5')]();var fs_extra=require(_0x4572('0x6'));var auth=require(_0x4572('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4572('0x8'));router[_0x4572('0x9')]('/',auth[_0x4572('0xa')](),controller[_0x4572('0xb')]);router[_0x4572('0x9')](_0x4572('0xc'),auth[_0x4572('0xa')](),controller[_0x4572('0xd')]);router['get']('/:id',auth[_0x4572('0xa')](),controller[_0x4572('0xe')]);router[_0x4572('0xf')]('/',auth['isAuthenticated'](),controller[_0x4572('0x10')]);router['put'](_0x4572('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x4572('0x12')](_0x4572('0x11'),auth[_0x4572('0xa')](),controller[_0x4572('0x13')]);module[_0x4572('0x14')]=router; \ No newline at end of file +var _0x8b9e=['isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x8b9e,0x1ab));var _0xe8b9=function(_0x1db794,_0x13bc92){_0x1db794=_0x1db794-0x0;var _0x1940fc=_0x8b9e[_0x1db794];return _0x1940fc;};'use strict';var multer=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var path=require(_0xe8b9('0x2'));var timeout=require(_0xe8b9('0x3'));var express=require(_0xe8b9('0x4'));var router=express[_0xe8b9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe8b9('0x6'));var config=require(_0xe8b9('0x7'));var controller=require(_0xe8b9('0x8'));router[_0xe8b9('0x9')]('/',auth[_0xe8b9('0xa')](),controller['index']);router[_0xe8b9('0x9')](_0xe8b9('0xb'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xc')]);router[_0xe8b9('0x9')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xe')]);router['post']('/',auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xf')]);router[_0xe8b9('0x10')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller['update']);router[_0xe8b9('0x11')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e712c48..b5469d9 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 _0xb14c=['moment','sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb14c,0xac));var _0xcb14=function(_0x2665a3,_0x1bd09e){_0x2665a3=_0x2665a3-0x0;var _0x4f8fb0=_0xb14c[_0x2665a3];return _0x4f8fb0;};'use strict';var moment=require(_0xcb14('0x0'));var Sequelize=require(_0xcb14('0x1'));module[_0xcb14('0x2')]={'uniqueid':{'type':Sequelize[_0xcb14('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcb14('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xcb14('0x3')]}}; \ No newline at end of file +var _0xf6ca=['DATE','moment','sequelize','exports','STRING'];(function(_0x1828c3,_0x36d621){var _0x2bb9a6=function(_0x1a254b){while(--_0x1a254b){_0x1828c3['push'](_0x1828c3['shift']());}};_0x2bb9a6(++_0x36d621);}(_0xf6ca,0x11e));var _0xaf6c=function(_0x5d7198,_0x1dcd71){_0x5d7198=_0x5d7198-0x0;var _0x1522e8=_0xf6ca[_0x5d7198];return _0x1522e8;};'use strict';var moment=require(_0xaf6c('0x0'));var Sequelize=require(_0xaf6c('0x1'));module[_0xaf6c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaf6c('0x3')]},'joinAt':{'type':Sequelize[_0xaf6c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xaf6c('0x4')]},'exitAt':{'type':Sequelize[_0xaf6c('0x4')]},'reason':{'type':Sequelize[_0xaf6c('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 7760219..8eb8af7 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 _0x7944=['hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x7944,0x1ee));var _0x4794=function(_0x2f4827,_0x8653a8){_0x2f4827=_0x2f4827-0x0;var _0x10ea57=_0x7944[_0x2f4827];return _0x10ea57;};'use strict';var emlformat=require(_0x4794('0x0'));var rimraf=require(_0x4794('0x1'));var zipdir=require(_0x4794('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4794('0x3'));var moment=require(_0x4794('0x4'));var BPromise=require(_0x4794('0x5'));var Mustache=require(_0x4794('0x6'));var util=require(_0x4794('0x7'));var path=require('path');var sox=require(_0x4794('0x8'));var csv=require('to-csv');var ejs=require(_0x4794('0x9'));var fs=require('fs');var fs_extra=require(_0x4794('0xa'));var _=require(_0x4794('0xb'));var squel=require(_0x4794('0xc'));var crypto=require('crypto');var jsforce=require(_0x4794('0xd'));var deskjs=require(_0x4794('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4794('0xf'));var Redis=require(_0x4794('0x10'));var authService=require(_0x4794('0x11'));var qs=require(_0x4794('0x12'));var as=require(_0x4794('0x13'));var hardwareService=require(_0x4794('0x14'));var logger=require(_0x4794('0x15'))(_0x4794('0x16'));var utils=require(_0x4794('0x17'));var config=require(_0x4794('0x18'));var licenseUtil=require(_0x4794('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x161b23,_0x1bdb73){_0x1bdb73=_0x1bdb73||0xcc;return function(_0x4e6f3e){if(_0x4e6f3e){return _0x161b23[_0x4794('0x1a')](_0x1bdb73);}return _0x161b23[_0x4794('0x1b')](_0x1bdb73)[_0x4794('0x1c')]();};}function respondWithResult(_0x437ecd,_0x5d3c44){_0x5d3c44=_0x5d3c44||0xc8;return function(_0x2da725){if(_0x2da725){return _0x437ecd['status'](_0x5d3c44)['json'](_0x2da725);}};}function respondWithFilteredResult(_0x10d88e,_0x406da7){return function(_0x1147ac){if(_0x1147ac){var _0x4be2cc=typeof _0x406da7[_0x4794('0x1d')]===_0x4794('0x1e')&&typeof _0x406da7[_0x4794('0x1f')]===_0x4794('0x1e');var _0x2dc014=_0x1147ac[_0x4794('0x20')];var _0x38c2c3=_0x4be2cc?0x0:_0x406da7['offset'];var _0x11d5d4=_0x4be2cc?_0x1147ac[_0x4794('0x20')]:_0x406da7[_0x4794('0x1d')]+_0x406da7[_0x4794('0x1f')];var _0xaa2f10;if(_0x11d5d4>=_0x2dc014){_0x11d5d4=_0x2dc014;_0xaa2f10=0xc8;}else{_0xaa2f10=0xce;}_0x10d88e[_0x4794('0x1b')](_0xaa2f10);return _0x10d88e[_0x4794('0x21')]('Content-Range',_0x38c2c3+'-'+_0x11d5d4+'/'+_0x2dc014)[_0x4794('0x22')](_0x1147ac);}return null;};}function patchUpdates(_0x5d9002){return function(_0x594f88){try{jsonpatch['apply'](_0x594f88,_0x5d9002,!![]);}catch(_0x5222dc){return BPromise[_0x4794('0x23')](_0x5222dc);}return _0x594f88[_0x4794('0x24')]();};}function saveUpdates(_0x316b66,_0x1b34be){return function(_0x453721){if(_0x453721){return _0x453721[_0x4794('0x25')](_0x316b66)[_0x4794('0x26')](function(_0x2fedf9){return _0x2fedf9;});}return null;};}function removeEntity(_0x5d0377,_0x563f2d){return function(_0x38f574){if(_0x38f574){return _0x38f574[_0x4794('0x27')]()[_0x4794('0x26')](function(){_0x5d0377[_0x4794('0x1b')](0xcc)[_0x4794('0x1c')]();});}};}function handleEntityNotFound(_0x36f556,_0x49e4a1){return function(_0x2e27e2){if(!_0x2e27e2){_0x36f556['sendStatus'](0x194);}return _0x2e27e2;};}function handleError(_0x5715d1,_0x2b3c11){_0x2b3c11=_0x2b3c11||0x1f4;return function(_0x58c565){logger[_0x4794('0x28')](_0x58c565[_0x4794('0x29')]);if(_0x58c565[_0x4794('0x2a')]){delete _0x58c565['name'];}_0x5715d1['status'](_0x2b3c11)[_0x4794('0x2b')](_0x58c565);};}exports[_0x4794('0x2c')]=function(_0x36571f,_0x582480){var _0x4b3d7f={},_0x2f80f7={},_0x3271f9={'count':0x0,'rows':[]};var _0x3436f8=_[_0x4794('0x2d')](db[_0x4794('0x2e')][_0x4794('0x2f')],function(_0x45cc88){return{'name':_0x45cc88[_0x4794('0x30')],'type':_0x45cc88[_0x4794('0x31')][_0x4794('0x32')]};});_0x2f80f7[_0x4794('0x33')]=_[_0x4794('0x2d')](_0x3436f8,_0x4794('0x2a'));_0x2f80f7[_0x4794('0x34')]=_[_0x4794('0x35')](_0x36571f['query']);_0x2f80f7[_0x4794('0x36')]=_[_0x4794('0x37')](_0x2f80f7['model'],_0x2f80f7['query']);_0x4b3d7f[_0x4794('0x38')]=_[_0x4794('0x37')](_0x2f80f7[_0x4794('0x33')],qs[_0x4794('0x39')](_0x36571f[_0x4794('0x34')][_0x4794('0x39')]));_0x4b3d7f[_0x4794('0x38')]=_0x4b3d7f[_0x4794('0x38')][_0x4794('0x3a')]?_0x4b3d7f[_0x4794('0x38')]:_0x2f80f7[_0x4794('0x33')];if(!_0x36571f['query'][_0x4794('0x3b')](_0x4794('0x3c'))){_0x4b3d7f[_0x4794('0x1f')]=qs['limit'](_0x36571f['query'][_0x4794('0x1f')]);_0x4b3d7f[_0x4794('0x1d')]=qs['offset'](_0x36571f['query'][_0x4794('0x1d')]);}_0x4b3d7f[_0x4794('0x3d')]=qs[_0x4794('0x3e')](_0x36571f[_0x4794('0x34')][_0x4794('0x3e')]);_0x4b3d7f['where']=qs['filters'](_[_0x4794('0x3f')](_0x36571f[_0x4794('0x34')],_0x2f80f7[_0x4794('0x36')]),_0x3436f8);if(_0x36571f[_0x4794('0x34')][_0x4794('0x40')]){_0x4b3d7f['where']=_[_0x4794('0x41')](_0x4b3d7f[_0x4794('0x42')],{'$or':_[_0x4794('0x2d')](_0x3436f8,function(_0x12ee0b){if(_0x12ee0b['type']!==_0x4794('0x43')){var _0x35b7dd={};_0x35b7dd[_0x12ee0b[_0x4794('0x2a')]]={'$like':'%'+_0x36571f['query'][_0x4794('0x40')]+'%'};return _0x35b7dd;}})});}_0x4b3d7f=_['merge']({},_0x4b3d7f,_0x36571f['options']);var _0x46a38e={'where':_0x4b3d7f[_0x4794('0x42')]};return db[_0x4794('0x2e')][_0x4794('0x20')](_0x46a38e)[_0x4794('0x26')](function(_0x48853e){_0x3271f9[_0x4794('0x20')]=_0x48853e;if(_0x36571f['query'][_0x4794('0x44')]){_0x4b3d7f[_0x4794('0x45')]=[{'all':!![]}];}return db[_0x4794('0x2e')][_0x4794('0x46')](_0x4b3d7f);})[_0x4794('0x26')](function(_0x1b0b16){_0x3271f9[_0x4794('0x47')]=_0x1b0b16;return _0x3271f9;})[_0x4794('0x26')](respondWithFilteredResult(_0x582480,_0x4b3d7f))[_0x4794('0x48')](handleError(_0x582480,null));};exports[_0x4794('0x49')]=function(_0x4bfd17,_0x3d9058){var _0x2e0f45={'raw':!![],'where':{'id':_0x4bfd17[_0x4794('0x4a')]['id']}},_0x5a02b8={};_0x5a02b8[_0x4794('0x33')]=_[_0x4794('0x35')](db[_0x4794('0x2e')][_0x4794('0x2f')]);_0x5a02b8[_0x4794('0x34')]=_[_0x4794('0x35')](_0x4bfd17[_0x4794('0x34')]);_0x5a02b8[_0x4794('0x36')]=_[_0x4794('0x37')](_0x5a02b8['model'],_0x5a02b8[_0x4794('0x34')]);_0x2e0f45['attributes']=_['intersection'](_0x5a02b8[_0x4794('0x33')],qs[_0x4794('0x39')](_0x4bfd17['query'][_0x4794('0x39')]));_0x2e0f45[_0x4794('0x38')]=_0x2e0f45[_0x4794('0x38')][_0x4794('0x3a')]?_0x2e0f45['attributes']:_0x5a02b8['model'];if(_0x4bfd17['query']['includeAll']){_0x2e0f45['include']=[{'all':!![]}];}_0x2e0f45=_[_0x4794('0x41')]({},_0x2e0f45,_0x4bfd17['options']);return db['OpenchannelQueueReport']['find'](_0x2e0f45)[_0x4794('0x26')](handleEntityNotFound(_0x3d9058,null))[_0x4794('0x26')](respondWithResult(_0x3d9058,null))[_0x4794('0x48')](handleError(_0x3d9058,null));};exports[_0x4794('0x4b')]=function(_0x3f79f5,_0x41e22e){return db['OpenchannelQueueReport'][_0x4794('0x4b')](_0x3f79f5[_0x4794('0x4c')],{})['then'](respondWithResult(_0x41e22e,0xc9))['catch'](handleError(_0x41e22e,null));};exports[_0x4794('0x25')]=function(_0x43b1cc,_0x31ad6d){if(_0x43b1cc[_0x4794('0x4c')]['id']){delete _0x43b1cc[_0x4794('0x4c')]['id'];}return db[_0x4794('0x2e')][_0x4794('0x4d')]({'where':{'id':_0x43b1cc[_0x4794('0x4a')]['id']}})[_0x4794('0x26')](handleEntityNotFound(_0x31ad6d,null))[_0x4794('0x26')](saveUpdates(_0x43b1cc[_0x4794('0x4c')],null))[_0x4794('0x26')](respondWithResult(_0x31ad6d,null))[_0x4794('0x48')](handleError(_0x31ad6d,null));};exports[_0x4794('0x27')]=function(_0x43ecf9,_0x57b252){return db[_0x4794('0x2e')][_0x4794('0x4d')]({'where':{'id':_0x43ecf9['params']['id']}})[_0x4794('0x26')](handleEntityNotFound(_0x57b252,null))[_0x4794('0x26')](removeEntity(_0x57b252,null))['catch'](handleError(_0x57b252,null));};exports[_0x4794('0x4e')]=function(_0x224fe5,_0x11e6a5){return db['OpenchannelQueueReport']['describe']()[_0x4794('0x26')](respondWithResult(_0x11e6a5,null))[_0x4794('0x48')](handleError(_0x11e6a5,null));}; \ No newline at end of file +var _0xca5b=['rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xca5b,0x12b));var _0xbca5=function(_0x4454c3,_0x24c130){_0x4454c3=_0x4454c3-0x0;var _0x195fa6=_0xca5b[_0x4454c3];return _0x195fa6;};'use strict';var emlformat=require(_0xbca5('0x0'));var rimraf=require(_0xbca5('0x1'));var zipdir=require(_0xbca5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbca5('0x3'));var moment=require(_0xbca5('0x4'));var BPromise=require(_0xbca5('0x5'));var Mustache=require('mustache');var util=require(_0xbca5('0x6'));var path=require(_0xbca5('0x7'));var sox=require(_0xbca5('0x8'));var csv=require(_0xbca5('0x9'));var ejs=require(_0xbca5('0xa'));var fs=require('fs');var fs_extra=require(_0xbca5('0xb'));var _=require('lodash');var squel=require(_0xbca5('0xc'));var crypto=require(_0xbca5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbca5('0x9'));var querystring=require(_0xbca5('0xe'));var Papa=require(_0xbca5('0xf'));var Redis=require(_0xbca5('0x10'));var authService=require(_0xbca5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbca5('0x12'));var hardwareService=require(_0xbca5('0x13'));var logger=require(_0xbca5('0x14'))(_0xbca5('0x15'));var utils=require(_0xbca5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbca5('0x17'));var db=require(_0xbca5('0x18'))['db'];function respondWithStatusCode(_0x2e993e,_0x197c87){_0x197c87=_0x197c87||0xcc;return function(_0x3b05e1){if(_0x3b05e1){return _0x2e993e[_0xbca5('0x19')](_0x197c87);}return _0x2e993e[_0xbca5('0x1a')](_0x197c87)['end']();};}function respondWithResult(_0x59caf6,_0x2cbb53){_0x2cbb53=_0x2cbb53||0xc8;return function(_0x11562f){if(_0x11562f){return _0x59caf6[_0xbca5('0x1a')](_0x2cbb53)[_0xbca5('0x1b')](_0x11562f);}};}function respondWithFilteredResult(_0xafee97,_0x2fed65){return function(_0x4c57f6){if(_0x4c57f6){var _0x1f77f6=typeof _0x2fed65[_0xbca5('0x1c')]===_0xbca5('0x1d')&&typeof _0x2fed65[_0xbca5('0x1e')]===_0xbca5('0x1d');var _0x3b49c7=_0x4c57f6[_0xbca5('0x1f')];var _0x2121bc=_0x1f77f6?0x0:_0x2fed65['offset'];var _0x29d479=_0x1f77f6?_0x4c57f6[_0xbca5('0x1f')]:_0x2fed65[_0xbca5('0x1c')]+_0x2fed65[_0xbca5('0x1e')];var _0x2634b1;if(_0x29d479>=_0x3b49c7){_0x29d479=_0x3b49c7;_0x2634b1=0xc8;}else{_0x2634b1=0xce;}_0xafee97[_0xbca5('0x1a')](_0x2634b1);return _0xafee97['set'](_0xbca5('0x20'),_0x2121bc+'-'+_0x29d479+'/'+_0x3b49c7)['json'](_0x4c57f6);}return null;};}function patchUpdates(_0x3c1f5b){return function(_0x6d9cb1){try{jsonpatch['apply'](_0x6d9cb1,_0x3c1f5b,!![]);}catch(_0x586eca){return BPromise[_0xbca5('0x21')](_0x586eca);}return _0x6d9cb1[_0xbca5('0x22')]();};}function saveUpdates(_0xe9285f,_0x24a2ab){return function(_0x288e64){if(_0x288e64){return _0x288e64[_0xbca5('0x23')](_0xe9285f)[_0xbca5('0x24')](function(_0x3aaa84){return _0x3aaa84;});}return null;};}function removeEntity(_0x9b3263,_0x3b1a15){return function(_0x39a1d0){if(_0x39a1d0){return _0x39a1d0[_0xbca5('0x25')]()[_0xbca5('0x24')](function(){_0x9b3263[_0xbca5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520019,_0x2abb11){return function(_0x1f2fc2){if(!_0x1f2fc2){_0x520019[_0xbca5('0x19')](0x194);}return _0x1f2fc2;};}function handleError(_0x21572a,_0x39e3d0){_0x39e3d0=_0x39e3d0||0x1f4;return function(_0xd3e1f9){logger['error'](_0xd3e1f9['stack']);if(_0xd3e1f9[_0xbca5('0x26')]){delete _0xd3e1f9[_0xbca5('0x26')];}_0x21572a[_0xbca5('0x1a')](_0x39e3d0)[_0xbca5('0x27')](_0xd3e1f9);};}exports[_0xbca5('0x28')]=function(_0x16b7af,_0x302b27){var _0x5ac3fb={},_0x45fb34={},_0x47c772={'count':0x0,'rows':[]};var _0x209f9f=_[_0xbca5('0x29')](db[_0xbca5('0x2a')][_0xbca5('0x2b')],function(_0xb21bea){return{'name':_0xb21bea[_0xbca5('0x2c')],'type':_0xb21bea[_0xbca5('0x2d')][_0xbca5('0x2e')]};});_0x45fb34[_0xbca5('0x2f')]=_[_0xbca5('0x29')](_0x209f9f,_0xbca5('0x26'));_0x45fb34['query']=_['keys'](_0x16b7af[_0xbca5('0x30')]);_0x45fb34[_0xbca5('0x31')]=_[_0xbca5('0x32')](_0x45fb34[_0xbca5('0x2f')],_0x45fb34[_0xbca5('0x30')]);_0x5ac3fb['attributes']=_[_0xbca5('0x32')](_0x45fb34[_0xbca5('0x2f')],qs[_0xbca5('0x33')](_0x16b7af[_0xbca5('0x30')][_0xbca5('0x33')]));_0x5ac3fb[_0xbca5('0x34')]=_0x5ac3fb[_0xbca5('0x34')][_0xbca5('0x35')]?_0x5ac3fb[_0xbca5('0x34')]:_0x45fb34['model'];if(!_0x16b7af[_0xbca5('0x30')]['hasOwnProperty'](_0xbca5('0x36'))){_0x5ac3fb['limit']=qs[_0xbca5('0x1e')](_0x16b7af[_0xbca5('0x30')]['limit']);_0x5ac3fb['offset']=qs[_0xbca5('0x1c')](_0x16b7af['query'][_0xbca5('0x1c')]);}_0x5ac3fb[_0xbca5('0x37')]=qs[_0xbca5('0x38')](_0x16b7af[_0xbca5('0x30')][_0xbca5('0x38')]);_0x5ac3fb[_0xbca5('0x39')]=qs['filters'](_[_0xbca5('0x3a')](_0x16b7af[_0xbca5('0x30')],_0x45fb34[_0xbca5('0x31')]),_0x209f9f);if(_0x16b7af[_0xbca5('0x30')][_0xbca5('0x3b')]){_0x5ac3fb['where']=_[_0xbca5('0x3c')](_0x5ac3fb[_0xbca5('0x39')],{'$or':_[_0xbca5('0x29')](_0x209f9f,function(_0x4a483d){if(_0x4a483d[_0xbca5('0x2d')]!==_0xbca5('0x3d')){var _0x53c0e3={};_0x53c0e3[_0x4a483d[_0xbca5('0x26')]]={'$like':'%'+_0x16b7af[_0xbca5('0x30')][_0xbca5('0x3b')]+'%'};return _0x53c0e3;}})});}_0x5ac3fb=_[_0xbca5('0x3c')]({},_0x5ac3fb,_0x16b7af[_0xbca5('0x3e')]);var _0x3bf3b9={'where':_0x5ac3fb[_0xbca5('0x39')]};return db[_0xbca5('0x2a')][_0xbca5('0x1f')](_0x3bf3b9)[_0xbca5('0x24')](function(_0x1f092a){_0x47c772[_0xbca5('0x1f')]=_0x1f092a;if(_0x16b7af[_0xbca5('0x30')]['includeAll']){_0x5ac3fb[_0xbca5('0x3f')]=[{'all':!![]}];}return db[_0xbca5('0x2a')][_0xbca5('0x40')](_0x5ac3fb);})[_0xbca5('0x24')](function(_0xf956b2){_0x47c772[_0xbca5('0x41')]=_0xf956b2;return _0x47c772;})['then'](respondWithFilteredResult(_0x302b27,_0x5ac3fb))[_0xbca5('0x42')](handleError(_0x302b27,null));};exports[_0xbca5('0x43')]=function(_0x2b1d9a,_0x440c00){var _0xa80968={'raw':!![],'where':{'id':_0x2b1d9a['params']['id']}},_0x1c4cfd={};_0x1c4cfd[_0xbca5('0x2f')]=_[_0xbca5('0x44')](db['OpenchannelQueueReport'][_0xbca5('0x2b')]);_0x1c4cfd[_0xbca5('0x30')]=_[_0xbca5('0x44')](_0x2b1d9a['query']);_0x1c4cfd[_0xbca5('0x31')]=_[_0xbca5('0x32')](_0x1c4cfd[_0xbca5('0x2f')],_0x1c4cfd[_0xbca5('0x30')]);_0xa80968[_0xbca5('0x34')]=_['intersection'](_0x1c4cfd[_0xbca5('0x2f')],qs[_0xbca5('0x33')](_0x2b1d9a[_0xbca5('0x30')][_0xbca5('0x33')]));_0xa80968[_0xbca5('0x34')]=_0xa80968[_0xbca5('0x34')][_0xbca5('0x35')]?_0xa80968['attributes']:_0x1c4cfd['model'];if(_0x2b1d9a[_0xbca5('0x30')][_0xbca5('0x45')]){_0xa80968[_0xbca5('0x3f')]=[{'all':!![]}];}_0xa80968=_[_0xbca5('0x3c')]({},_0xa80968,_0x2b1d9a['options']);return db[_0xbca5('0x2a')][_0xbca5('0x46')](_0xa80968)[_0xbca5('0x24')](handleEntityNotFound(_0x440c00,null))['then'](respondWithResult(_0x440c00,null))[_0xbca5('0x42')](handleError(_0x440c00,null));};exports['create']=function(_0x341417,_0x12aacb){return db[_0xbca5('0x2a')][_0xbca5('0x47')](_0x341417[_0xbca5('0x48')],{})[_0xbca5('0x24')](respondWithResult(_0x12aacb,0xc9))[_0xbca5('0x42')](handleError(_0x12aacb,null));};exports[_0xbca5('0x23')]=function(_0x3ea9c2,_0x36c971){if(_0x3ea9c2['body']['id']){delete _0x3ea9c2['body']['id'];}return db[_0xbca5('0x2a')][_0xbca5('0x46')]({'where':{'id':_0x3ea9c2[_0xbca5('0x49')]['id']}})[_0xbca5('0x24')](handleEntityNotFound(_0x36c971,null))[_0xbca5('0x24')](saveUpdates(_0x3ea9c2[_0xbca5('0x48')],null))['then'](respondWithResult(_0x36c971,null))[_0xbca5('0x42')](handleError(_0x36c971,null));};exports['destroy']=function(_0x491642,_0x3171fe){return db[_0xbca5('0x2a')][_0xbca5('0x46')]({'where':{'id':_0x491642['params']['id']}})[_0xbca5('0x24')](handleEntityNotFound(_0x3171fe,null))[_0xbca5('0x24')](removeEntity(_0x3171fe,null))[_0xbca5('0x42')](handleError(_0x3171fe,null));};exports[_0xbca5('0x4a')]=function(_0x3625d5,_0x51a2a7){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0x51a2a7,null))[_0xbca5('0x42')](handleError(_0x51a2a7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6ae8d70..0454f74 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x37df38,_0x177198){var _0x26c1e6=function(_0x1b3214){while(--_0x1b3214){_0x37df38['push'](_0x37df38['shift']());}};_0x26c1e6(++_0x177198);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x814b,0x1a2));var _0xb814=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x814b[_0x5b3b9b];return _0x47c1d7;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 88fca55..64b2677 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 _0x235b=['code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','limit','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x48aea0,_0x1a0803){var _0x2e4655=function(_0x56cc97){while(--_0x56cc97){_0x48aea0['push'](_0x48aea0['shift']());}};_0x2e4655(++_0x1a0803);}(_0x235b,0x1ed));var _0xb235=function(_0x3149b0,_0x11e95d){_0x3149b0=_0x3149b0-0x0;var _0x511aa3=_0x235b[_0x3149b0];return _0x511aa3;};'use strict';var _=require(_0xb235('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb235('0x1'));var rs=require(_0xb235('0x2'));var fs=require('fs');var Redis=require(_0xb235('0x3'));var db=require(_0xb235('0x4'))['db'];var utils=require(_0xb235('0x5'));var logger=require(_0xb235('0x6'))('rpc');var config=require(_0xb235('0x7'));var jayson=require(_0xb235('0x8'));var client=jayson[_0xb235('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d0ae,_0x44559a,_0x2affe8){return new BPromise(function(_0x436d63,_0x3241b4){return client['request'](_0x12d0ae,_0x2affe8)['then'](function(_0xecf759){logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));logger[_0xb235('0xd')](_0xb235('0xe'),_0x44559a,_0xb235('0xc'),JSON[_0xb235('0xf')](_0xecf759));if(_0xecf759['error']){if(_0xecf759[_0xb235('0x10')][_0xb235('0x11')]===0x1f4){logger[_0xb235('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x44559a,_0xecf759[_0xb235('0x10')]['message']);return _0x3241b4(_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);}logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);return _0x436d63(_0xecf759[_0xb235('0x10')]['message']);}else{logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));_0x436d63(_0xecf759[_0xb235('0x13')][_0xb235('0x12')]);}})[_0xb235('0x14')](function(_0x16f044){logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0x16f044);_0x3241b4(_0x16f044);});});}exports[_0xb235('0x15')]=function(_0x2f1c46){var _0x1b9eae=this;return new Promise(function(_0x1f7cb9,_0x55a479){return db[_0xb235('0x16')]['create'](_0x2f1c46[_0xb235('0x17')],{'raw':_0x2f1c46['options']?_0x2f1c46[_0xb235('0x18')][_0xb235('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x447ec6){logger[_0xb235('0xa')](_0xb235('0x15'),_0x2f1c46);logger[_0xb235('0xd')](_0xb235('0x15'),_0x2f1c46,JSON['stringify'](_0x447ec6));_0x1f7cb9(_0x447ec6);})[_0xb235('0x14')](function(_0x12f787){logger[_0xb235('0x10')](_0xb235('0x15'),_0x12f787[_0xb235('0x12')],_0x2f1c46);_0x55a479(_0x1b9eae[_0xb235('0x10')](0x1f4,_0x12f787['message']));});});};exports[_0xb235('0x1a')]=function(_0x57d7f5){var _0x2b5c93=this;return new Promise(function(_0x1d7122,_0xb97b29){return db['OpenchannelQueueReport']['update'](_0x57d7f5['body'],{'raw':_0x57d7f5[_0xb235('0x18')]?_0x57d7f5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d7f5[_0xb235('0x18')]?_0x57d7f5[_0xb235('0x18')][_0xb235('0x1b')]||null:null,'attributes':_0x57d7f5['options']?_0x57d7f5[_0xb235('0x18')]['attributes']||null:null,'limit':_0x57d7f5['options']?_0x57d7f5[_0xb235('0x18')][_0xb235('0x1c')]||null:null})[_0xb235('0x1d')](function(_0x4fe640){logger[_0xb235('0xa')](_0xb235('0x1a'),_0x57d7f5);logger[_0xb235('0xd')]('UpdateOpenchannelQueueReport',_0x57d7f5,JSON['stringify'](_0x4fe640));_0x1d7122(_0x4fe640);})[_0xb235('0x14')](function(_0x4871b7){logger[_0xb235('0x10')]('UpdateOpenchannelQueueReport',_0x4871b7['message'],_0x57d7f5);_0xb97b29(_0x2b5c93[_0xb235('0x10')](0x1f4,_0x4871b7[_0xb235('0x12')]));});});}; \ No newline at end of file +var _0x94df=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','update','where','UpdateOpenchannelQueueReport','debug','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94df,0xa3));var _0xf94d=function(_0x2757a7,_0x5e59ea){_0x2757a7=_0x2757a7-0x0;var _0x213a80=_0x94df[_0x2757a7];return _0x213a80;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x301d2e){var _0x51f7f8=this;return new Promise(function(_0x4701e1,_0x2564a3){return db[_0xf94d('0x19')][_0xf94d('0x1d')](_0x301d2e[_0xf94d('0x1a')],{'raw':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1e')]||null:null,'attributes':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')]['attributes']||null:null,'limit':_0x301d2e['options']?_0x301d2e['options']['limit']||null:null})[_0xf94d('0xe')](function(_0x1e8242){logger['info'](_0xf94d('0x1f'),_0x301d2e);logger[_0xf94d('0x20')](_0xf94d('0x1f'),_0x301d2e,JSON['stringify'](_0x1e8242));_0x4701e1(_0x1e8242);})[_0xf94d('0x17')](function(_0x5ab0c8){logger[_0xf94d('0x14')](_0xf94d('0x1f'),_0x5ab0c8['message'],_0x301d2e);_0x2564a3(_0x51f7f8[_0xf94d('0x14')](0x1f4,_0x5ab0c8['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d5aabb5..2884951 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 _0x7239=['/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated','index'];(function(_0x11b4cf,_0x359f60){var _0x2696a3=function(_0x188200){while(--_0x188200){_0x11b4cf['push'](_0x11b4cf['shift']());}};_0x2696a3(++_0x359f60);}(_0x7239,0xb2));var _0x9723=function(_0x17d50e,_0x415f01){_0x17d50e=_0x17d50e-0x0;var _0x2f29ca=_0x7239[_0x17d50e];return _0x2f29ca;};'use strict';var multer=require(_0x9723('0x0'));var util=require(_0x9723('0x1'));var path=require(_0x9723('0x2'));var timeout=require(_0x9723('0x3'));var express=require(_0x9723('0x4'));var router=express[_0x9723('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9723('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9723('0x7'));router[_0x9723('0x8')]('/',auth[_0x9723('0x9')](),controller[_0x9723('0xa')]);router[_0x9723('0x8')](_0x9723('0xb'),auth[_0x9723('0x9')](),controller[_0x9723('0xc')]);router[_0x9723('0x8')]('/:id',auth[_0x9723('0x9')](),controller[_0x9723('0xd')]);router[_0x9723('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9723('0xf')](_0x9723('0x10'),auth[_0x9723('0x9')](),controller[_0x9723('0x11')]);router[_0x9723('0x12')]('/:id',auth[_0x9723('0x9')](),controller[_0x9723('0x13')]);module[_0x9723('0x14')]=router; \ No newline at end of file +var _0x111b=['index','/describe','isAuthenticated','/:id','show','create','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x111b,0xca));var _0xb111=function(_0x59a675,_0x56c5a1){_0x59a675=_0x59a675-0x0;var _0x1be9ab=_0x111b[_0x59a675];return _0x1be9ab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb111('0x0'));var express=require(_0xb111('0x1'));var router=express[_0xb111('0x2')]();var fs_extra=require(_0xb111('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb111('0x4'));var config=require(_0xb111('0x5'));var controller=require(_0xb111('0x6'));router[_0xb111('0x7')]('/',auth['isAuthenticated'](),controller[_0xb111('0x8')]);router[_0xb111('0x7')](_0xb111('0x9'),auth[_0xb111('0xa')](),controller['describe']);router[_0xb111('0x7')](_0xb111('0xb'),auth['isAuthenticated'](),controller[_0xb111('0xc')]);router['post']('/',auth[_0xb111('0xa')](),controller[_0xb111('0xd')]);router['put'](_0xb111('0xb'),auth[_0xb111('0xa')](),controller['update']);router[_0xb111('0xe')]('/:id',auth[_0xb111('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4b7224b..272f3ff 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x335bb1,_0x5aa97e){var _0x4c2fc7=function(_0xe358fc){while(--_0xe358fc){_0x335bb1['push'](_0x335bb1['shift']());}};_0x4c2fc7(++_0x5aa97e);}(_0x54ef,0x112));var _0xf54e=function(_0x1771ca,_0x3c3257){_0x1771ca=_0x1771ca-0x0;var _0x82a438=_0x54ef[_0x1771ca];return _0x82a438;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x193e6f,_0x4c1342){var _0x1703fb=function(_0x5db883){while(--_0x5db883){_0x193e6f['push'](_0x193e6f['shift']());}};_0x1703fb(++_0x4c1342);}(_0xaa88,0x137));var _0x8aa8=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xaa88[_0x43941d];return _0x27b82a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9d5d663..2867961 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 _0x8dd8=['catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','OpenchannelTransferReport','rawAttributes','type','key','map','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','keys','fields','length','find'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x8dd8,0x8f));var _0x88dd=function(_0x171ecc,_0x24f587){_0x171ecc=_0x171ecc-0x0;var _0x328d4b=_0x8dd8[_0x171ecc];return _0x328d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88dd('0x0'));var zipdir=require(_0x88dd('0x1'));var jsonpatch=require(_0x88dd('0x2'));var rp=require('request-promise');var moment=require(_0x88dd('0x3'));var BPromise=require(_0x88dd('0x4'));var Mustache=require(_0x88dd('0x5'));var util=require(_0x88dd('0x6'));var path=require(_0x88dd('0x7'));var sox=require('sox');var csv=require(_0x88dd('0x8'));var ejs=require(_0x88dd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88dd('0xa'));var squel=require(_0x88dd('0xb'));var crypto=require('crypto');var jsforce=require(_0x88dd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x88dd('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x88dd('0xd'));var qs=require(_0x88dd('0xe'));var as=require(_0x88dd('0xf'));var hardwareService=require(_0x88dd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x88dd('0x11'));var config=require(_0x88dd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x88dd('0x13'))['db'];function respondWithStatusCode(_0x232e84,_0x19db2b){_0x19db2b=_0x19db2b||0xcc;return function(_0x5dc79d){if(_0x5dc79d){return _0x232e84[_0x88dd('0x14')](_0x19db2b);}return _0x232e84['status'](_0x19db2b)[_0x88dd('0x15')]();};}function respondWithResult(_0x542e0d,_0x2f9652){_0x2f9652=_0x2f9652||0xc8;return function(_0x51d0e8){if(_0x51d0e8){return _0x542e0d['status'](_0x2f9652)[_0x88dd('0x16')](_0x51d0e8);}};}function respondWithFilteredResult(_0x5c2df6,_0x131185){return function(_0x44b7ab){if(_0x44b7ab){var _0x6f2ff9=typeof _0x131185[_0x88dd('0x17')]===_0x88dd('0x18')&&typeof _0x131185[_0x88dd('0x19')]===_0x88dd('0x18');var _0x2084a4=_0x44b7ab[_0x88dd('0x1a')];var _0x39d938=_0x6f2ff9?0x0:_0x131185[_0x88dd('0x17')];var _0x193377=_0x6f2ff9?_0x44b7ab[_0x88dd('0x1a')]:_0x131185[_0x88dd('0x17')]+_0x131185['limit'];var _0x1e8039;if(_0x193377>=_0x2084a4){_0x193377=_0x2084a4;_0x1e8039=0xc8;}else{_0x1e8039=0xce;}_0x5c2df6[_0x88dd('0x1b')](_0x1e8039);return _0x5c2df6[_0x88dd('0x1c')](_0x88dd('0x1d'),_0x39d938+'-'+_0x193377+'/'+_0x2084a4)['json'](_0x44b7ab);}return null;};}function patchUpdates(_0x51f421){return function(_0x434689){try{jsonpatch[_0x88dd('0x1e')](_0x434689,_0x51f421,!![]);}catch(_0x4ceb36){return BPromise[_0x88dd('0x1f')](_0x4ceb36);}return _0x434689[_0x88dd('0x20')]();};}function saveUpdates(_0x5d67a3,_0x270230){return function(_0xb42d52){if(_0xb42d52){return _0xb42d52[_0x88dd('0x21')](_0x5d67a3)['then'](function(_0x632530){return _0x632530;});}return null;};}function removeEntity(_0x16ec57,_0x276560){return function(_0x157f1d){if(_0x157f1d){return _0x157f1d[_0x88dd('0x22')]()[_0x88dd('0x23')](function(){_0x16ec57[_0x88dd('0x1b')](0xcc)[_0x88dd('0x15')]();});}};}function handleEntityNotFound(_0x4021b2,_0x52c9d0){return function(_0x2403b6){if(!_0x2403b6){_0x4021b2['sendStatus'](0x194);}return _0x2403b6;};}function handleError(_0x45f26a,_0xbf7b91){_0xbf7b91=_0xbf7b91||0x1f4;return function(_0x27f40a){logger[_0x88dd('0x24')](_0x27f40a[_0x88dd('0x25')]);if(_0x27f40a[_0x88dd('0x26')]){delete _0x27f40a[_0x88dd('0x26')];}_0x45f26a['status'](_0xbf7b91)['send'](_0x27f40a);};}exports['index']=function(_0x491190,_0x539eb9){var _0x56f035={},_0x2aedcb={},_0x3ea2bd={'count':0x0,'rows':[]};var _0x199313=_['map'](db[_0x88dd('0x27')][_0x88dd('0x28')],function(_0x10183a){return{'name':_0x10183a['fieldName'],'type':_0x10183a[_0x88dd('0x29')][_0x88dd('0x2a')]};});_0x2aedcb['model']=_[_0x88dd('0x2b')](_0x199313,_0x88dd('0x26'));_0x2aedcb[_0x88dd('0x2c')]=_['keys'](_0x491190[_0x88dd('0x2c')]);_0x2aedcb[_0x88dd('0x2d')]=_[_0x88dd('0x2e')](_0x2aedcb[_0x88dd('0x2f')],_0x2aedcb[_0x88dd('0x2c')]);_0x56f035[_0x88dd('0x30')]=_['intersection'](_0x2aedcb[_0x88dd('0x2f')],qs['fields'](_0x491190['query']['fields']));_0x56f035['attributes']=_0x56f035[_0x88dd('0x30')]['length']?_0x56f035['attributes']:_0x2aedcb['model'];if(!_0x491190[_0x88dd('0x2c')][_0x88dd('0x31')](_0x88dd('0x32'))){_0x56f035[_0x88dd('0x19')]=qs['limit'](_0x491190[_0x88dd('0x2c')][_0x88dd('0x19')]);_0x56f035['offset']=qs[_0x88dd('0x17')](_0x491190[_0x88dd('0x2c')][_0x88dd('0x17')]);}_0x56f035['order']=qs[_0x88dd('0x33')](_0x491190[_0x88dd('0x2c')][_0x88dd('0x33')]);_0x56f035[_0x88dd('0x34')]=qs[_0x88dd('0x2d')](_['pick'](_0x491190[_0x88dd('0x2c')],_0x2aedcb[_0x88dd('0x2d')]),_0x199313);if(_0x491190['query'][_0x88dd('0x35')]){_0x56f035[_0x88dd('0x34')]=_[_0x88dd('0x36')](_0x56f035['where'],{'$or':_[_0x88dd('0x2b')](_0x199313,function(_0x104462){if(_0x104462[_0x88dd('0x29')]!=='VIRTUAL'){var _0x4207dc={};_0x4207dc[_0x104462[_0x88dd('0x26')]]={'$like':'%'+_0x491190[_0x88dd('0x2c')][_0x88dd('0x35')]+'%'};return _0x4207dc;}})});}_0x56f035=_[_0x88dd('0x36')]({},_0x56f035,_0x491190[_0x88dd('0x37')]);var _0x4fe7b1={'where':_0x56f035[_0x88dd('0x34')]};return db[_0x88dd('0x27')][_0x88dd('0x1a')](_0x4fe7b1)[_0x88dd('0x23')](function(_0x13dcf4){_0x3ea2bd[_0x88dd('0x1a')]=_0x13dcf4;if(_0x491190[_0x88dd('0x2c')][_0x88dd('0x38')]){_0x56f035[_0x88dd('0x39')]=[{'all':!![]}];}return db[_0x88dd('0x27')][_0x88dd('0x3a')](_0x56f035);})[_0x88dd('0x23')](function(_0x372896){_0x3ea2bd[_0x88dd('0x3b')]=_0x372896;return _0x3ea2bd;})[_0x88dd('0x23')](respondWithFilteredResult(_0x539eb9,_0x56f035))['catch'](handleError(_0x539eb9,null));};exports['show']=function(_0x4f9c06,_0x5056fd){var _0x246ed7={'raw':!![],'where':{'id':_0x4f9c06['params']['id']}},_0x55aa29={};_0x55aa29[_0x88dd('0x2f')]=_[_0x88dd('0x3c')](db[_0x88dd('0x27')][_0x88dd('0x28')]);_0x55aa29[_0x88dd('0x2c')]=_[_0x88dd('0x3c')](_0x4f9c06[_0x88dd('0x2c')]);_0x55aa29[_0x88dd('0x2d')]=_[_0x88dd('0x2e')](_0x55aa29[_0x88dd('0x2f')],_0x55aa29[_0x88dd('0x2c')]);_0x246ed7[_0x88dd('0x30')]=_[_0x88dd('0x2e')](_0x55aa29[_0x88dd('0x2f')],qs['fields'](_0x4f9c06[_0x88dd('0x2c')][_0x88dd('0x3d')]));_0x246ed7[_0x88dd('0x30')]=_0x246ed7[_0x88dd('0x30')][_0x88dd('0x3e')]?_0x246ed7['attributes']:_0x55aa29['model'];if(_0x4f9c06[_0x88dd('0x2c')]['includeAll']){_0x246ed7[_0x88dd('0x39')]=[{'all':!![]}];}_0x246ed7=_[_0x88dd('0x36')]({},_0x246ed7,_0x4f9c06['options']);return db[_0x88dd('0x27')][_0x88dd('0x3f')](_0x246ed7)[_0x88dd('0x23')](handleEntityNotFound(_0x5056fd,null))['then'](respondWithResult(_0x5056fd,null))[_0x88dd('0x40')](handleError(_0x5056fd,null));};exports[_0x88dd('0x41')]=function(_0x434127,_0x3c074d){return db[_0x88dd('0x27')]['create'](_0x434127[_0x88dd('0x42')],{})['then'](respondWithResult(_0x3c074d,0xc9))[_0x88dd('0x40')](handleError(_0x3c074d,null));};exports[_0x88dd('0x21')]=function(_0x919d83,_0xb12977){if(_0x919d83[_0x88dd('0x42')]['id']){delete _0x919d83[_0x88dd('0x42')]['id'];}return db[_0x88dd('0x27')]['find']({'where':{'id':_0x919d83[_0x88dd('0x43')]['id']}})[_0x88dd('0x23')](handleEntityNotFound(_0xb12977,null))[_0x88dd('0x23')](saveUpdates(_0x919d83[_0x88dd('0x42')],null))['then'](respondWithResult(_0xb12977,null))['catch'](handleError(_0xb12977,null));};exports[_0x88dd('0x22')]=function(_0x3c2ac7,_0xc761f4){return db[_0x88dd('0x27')][_0x88dd('0x3f')]({'where':{'id':_0x3c2ac7['params']['id']}})[_0x88dd('0x23')](handleEntityNotFound(_0xc761f4,null))[_0x88dd('0x23')](removeEntity(_0xc761f4,null))['catch'](handleError(_0xc761f4,null));};exports[_0x88dd('0x44')]=function(_0x29df93,_0x57c42e){return db[_0x88dd('0x27')]['describe']()[_0x88dd('0x23')](respondWithResult(_0x57c42e,null))[_0x88dd('0x40')](handleError(_0x57c42e,null));}; \ No newline at end of file +var _0x2553=['mustache','util','sox','to-csv','fs-extra','lodash','squel','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','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x45ed09,_0x4deb08){var _0x1938a5=function(_0x4b11be){while(--_0x4b11be){_0x45ed09['push'](_0x45ed09['shift']());}};_0x1938a5(++_0x4deb08);}(_0x2553,0x1d5));var _0x3255=function(_0x5b17b4,_0x5a3221){_0x5b17b4=_0x5b17b4-0x0;var _0x55af79=_0x2553[_0x5b17b4];return _0x55af79;};'use strict';var emlformat=require(_0x3255('0x0'));var rimraf=require(_0x3255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3255('0x2'));var rp=require('request-promise');var moment=require(_0x3255('0x3'));var BPromise=require(_0x3255('0x4'));var Mustache=require(_0x3255('0x5'));var util=require(_0x3255('0x6'));var path=require('path');var sox=require(_0x3255('0x7'));var csv=require(_0x3255('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3255('0x9'));var _=require(_0x3255('0xa'));var squel=require(_0x3255('0xb'));var crypto=require(_0x3255('0xc'));var jsforce=require(_0x3255('0xd'));var deskjs=require(_0x3255('0xe'));var toCsv=require(_0x3255('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3255('0xf'));var authService=require(_0x3255('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3255('0x11'));var hardwareService=require(_0x3255('0x12'));var logger=require(_0x3255('0x13'))(_0x3255('0x14'));var utils=require(_0x3255('0x15'));var config=require(_0x3255('0x16'));var licenseUtil=require(_0x3255('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551dc9,_0x37a5b9){_0x37a5b9=_0x37a5b9||0xcc;return function(_0xc5f560){if(_0xc5f560){return _0x551dc9[_0x3255('0x18')](_0x37a5b9);}return _0x551dc9[_0x3255('0x19')](_0x37a5b9)['end']();};}function respondWithResult(_0x4abcf2,_0x35b866){_0x35b866=_0x35b866||0xc8;return function(_0x548452){if(_0x548452){return _0x4abcf2[_0x3255('0x19')](_0x35b866)[_0x3255('0x1a')](_0x548452);}};}function respondWithFilteredResult(_0x49b975,_0x31a961){return function(_0x66d65){if(_0x66d65){var _0x4d3478=typeof _0x31a961['offset']==='undefined'&&typeof _0x31a961['limit']===_0x3255('0x1b');var _0x3883db=_0x66d65[_0x3255('0x1c')];var _0x345d46=_0x4d3478?0x0:_0x31a961['offset'];var _0x33a305=_0x4d3478?_0x66d65[_0x3255('0x1c')]:_0x31a961['offset']+_0x31a961[_0x3255('0x1d')];var _0x534f4c;if(_0x33a305>=_0x3883db){_0x33a305=_0x3883db;_0x534f4c=0xc8;}else{_0x534f4c=0xce;}_0x49b975['status'](_0x534f4c);return _0x49b975[_0x3255('0x1e')](_0x3255('0x1f'),_0x345d46+'-'+_0x33a305+'/'+_0x3883db)[_0x3255('0x1a')](_0x66d65);}return null;};}function patchUpdates(_0x557a47){return function(_0x11bfba){try{jsonpatch[_0x3255('0x20')](_0x11bfba,_0x557a47,!![]);}catch(_0x1d8aac){return BPromise[_0x3255('0x21')](_0x1d8aac);}return _0x11bfba[_0x3255('0x22')]();};}function saveUpdates(_0x395693,_0x5b42cb){return function(_0x1e1b5b){if(_0x1e1b5b){return _0x1e1b5b[_0x3255('0x23')](_0x395693)['then'](function(_0x21c621){return _0x21c621;});}return null;};}function removeEntity(_0x5c3b91,_0x3364ca){return function(_0x3993cf){if(_0x3993cf){return _0x3993cf[_0x3255('0x24')]()[_0x3255('0x25')](function(){_0x5c3b91[_0x3255('0x19')](0xcc)[_0x3255('0x26')]();});}};}function handleEntityNotFound(_0x5f296b,_0x51ecaf){return function(_0x5f3c55){if(!_0x5f3c55){_0x5f296b[_0x3255('0x18')](0x194);}return _0x5f3c55;};}function handleError(_0xf393ed,_0x102f35){_0x102f35=_0x102f35||0x1f4;return function(_0x386098){logger[_0x3255('0x27')](_0x386098['stack']);if(_0x386098[_0x3255('0x28')]){delete _0x386098[_0x3255('0x28')];}_0xf393ed[_0x3255('0x19')](_0x102f35)[_0x3255('0x29')](_0x386098);};}exports[_0x3255('0x2a')]=function(_0x333828,_0x5ac05b){var _0x14371b={},_0x13eb69={},_0x12a588={'count':0x0,'rows':[]};var _0x3c676c=_[_0x3255('0x2b')](db['OpenchannelTransferReport'][_0x3255('0x2c')],function(_0x4fecf0){return{'name':_0x4fecf0[_0x3255('0x2d')],'type':_0x4fecf0[_0x3255('0x2e')][_0x3255('0x2f')]};});_0x13eb69[_0x3255('0x30')]=_[_0x3255('0x2b')](_0x3c676c,_0x3255('0x28'));_0x13eb69['query']=_['keys'](_0x333828[_0x3255('0x31')]);_0x13eb69[_0x3255('0x32')]=_[_0x3255('0x33')](_0x13eb69['model'],_0x13eb69[_0x3255('0x31')]);_0x14371b[_0x3255('0x34')]=_[_0x3255('0x33')](_0x13eb69['model'],qs[_0x3255('0x35')](_0x333828['query'][_0x3255('0x35')]));_0x14371b[_0x3255('0x34')]=_0x14371b['attributes'][_0x3255('0x36')]?_0x14371b['attributes']:_0x13eb69[_0x3255('0x30')];if(!_0x333828['query'][_0x3255('0x37')](_0x3255('0x38'))){_0x14371b['limit']=qs[_0x3255('0x1d')](_0x333828[_0x3255('0x31')][_0x3255('0x1d')]);_0x14371b[_0x3255('0x39')]=qs['offset'](_0x333828[_0x3255('0x31')]['offset']);}_0x14371b[_0x3255('0x3a')]=qs[_0x3255('0x3b')](_0x333828[_0x3255('0x31')][_0x3255('0x3b')]);_0x14371b['where']=qs[_0x3255('0x32')](_[_0x3255('0x3c')](_0x333828['query'],_0x13eb69[_0x3255('0x32')]),_0x3c676c);if(_0x333828[_0x3255('0x31')][_0x3255('0x3d')]){_0x14371b[_0x3255('0x3e')]=_[_0x3255('0x3f')](_0x14371b[_0x3255('0x3e')],{'$or':_[_0x3255('0x2b')](_0x3c676c,function(_0x105dcc){if(_0x105dcc[_0x3255('0x2e')]!==_0x3255('0x40')){var _0x43e877={};_0x43e877[_0x105dcc[_0x3255('0x28')]]={'$like':'%'+_0x333828[_0x3255('0x31')][_0x3255('0x3d')]+'%'};return _0x43e877;}})});}_0x14371b=_[_0x3255('0x3f')]({},_0x14371b,_0x333828[_0x3255('0x41')]);var _0x5bff6b={'where':_0x14371b[_0x3255('0x3e')]};return db[_0x3255('0x42')][_0x3255('0x1c')](_0x5bff6b)[_0x3255('0x25')](function(_0x544589){_0x12a588['count']=_0x544589;if(_0x333828[_0x3255('0x31')][_0x3255('0x43')]){_0x14371b[_0x3255('0x44')]=[{'all':!![]}];}return db[_0x3255('0x42')][_0x3255('0x45')](_0x14371b);})[_0x3255('0x25')](function(_0x2c774e){_0x12a588[_0x3255('0x46')]=_0x2c774e;return _0x12a588;})[_0x3255('0x25')](respondWithFilteredResult(_0x5ac05b,_0x14371b))[_0x3255('0x47')](handleError(_0x5ac05b,null));};exports[_0x3255('0x48')]=function(_0x543e7a,_0x3fb971){var _0x1d54fa={'raw':!![],'where':{'id':_0x543e7a[_0x3255('0x49')]['id']}},_0x1576fc={};_0x1576fc[_0x3255('0x30')]=_[_0x3255('0x4a')](db[_0x3255('0x42')][_0x3255('0x2c')]);_0x1576fc[_0x3255('0x31')]=_[_0x3255('0x4a')](_0x543e7a[_0x3255('0x31')]);_0x1576fc['filters']=_['intersection'](_0x1576fc[_0x3255('0x30')],_0x1576fc[_0x3255('0x31')]);_0x1d54fa[_0x3255('0x34')]=_['intersection'](_0x1576fc[_0x3255('0x30')],qs['fields'](_0x543e7a[_0x3255('0x31')][_0x3255('0x35')]));_0x1d54fa[_0x3255('0x34')]=_0x1d54fa['attributes'][_0x3255('0x36')]?_0x1d54fa[_0x3255('0x34')]:_0x1576fc[_0x3255('0x30')];if(_0x543e7a[_0x3255('0x31')]['includeAll']){_0x1d54fa[_0x3255('0x44')]=[{'all':!![]}];}_0x1d54fa=_['merge']({},_0x1d54fa,_0x543e7a['options']);return db[_0x3255('0x42')][_0x3255('0x4b')](_0x1d54fa)[_0x3255('0x25')](handleEntityNotFound(_0x3fb971,null))[_0x3255('0x25')](respondWithResult(_0x3fb971,null))['catch'](handleError(_0x3fb971,null));};exports[_0x3255('0x4c')]=function(_0xff6912,_0xc45113){return db[_0x3255('0x42')][_0x3255('0x4c')](_0xff6912[_0x3255('0x4d')],{})[_0x3255('0x25')](respondWithResult(_0xc45113,0xc9))[_0x3255('0x47')](handleError(_0xc45113,null));};exports[_0x3255('0x23')]=function(_0x26efbd,_0x484850){if(_0x26efbd[_0x3255('0x4d')]['id']){delete _0x26efbd[_0x3255('0x4d')]['id'];}return db[_0x3255('0x42')][_0x3255('0x4b')]({'where':{'id':_0x26efbd[_0x3255('0x49')]['id']}})[_0x3255('0x25')](handleEntityNotFound(_0x484850,null))[_0x3255('0x25')](saveUpdates(_0x26efbd[_0x3255('0x4d')],null))[_0x3255('0x25')](respondWithResult(_0x484850,null))[_0x3255('0x47')](handleError(_0x484850,null));};exports[_0x3255('0x24')]=function(_0x22b5c4,_0x5dcd15){return db['OpenchannelTransferReport'][_0x3255('0x4b')]({'where':{'id':_0x22b5c4[_0x3255('0x49')]['id']}})[_0x3255('0x25')](handleEntityNotFound(_0x5dcd15,null))[_0x3255('0x25')](removeEntity(_0x5dcd15,null))['catch'](handleError(_0x5dcd15,null));};exports[_0x3255('0x4e')]=function(_0x56b38e,_0x37cfdc){return db[_0x3255('0x42')][_0x3255('0x4e')]()[_0x3255('0x25')](respondWithResult(_0x37cfdc,null))[_0x3255('0x47')](handleError(_0x37cfdc,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index b0a5b42..70f68f7 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 _0xc0ea=['exports','OpenchannelTransferReport','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc0ea,0x1dc));var _0xac0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0ea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac0e('0x0'));var util=require(_0xac0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xac0e('0x2'));var BPromise=require(_0xac0e('0x3'));var rp=require(_0xac0e('0x4'));var fs=require('fs');var path=require(_0xac0e('0x5'));var rimraf=require(_0xac0e('0x6'));var config=require(_0xac0e('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0xac0e('0x8')]=function(_0xd0d4c1,_0x20b722){return _0xd0d4c1['define'](_0xac0e('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xac0e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5f7=['../../config/logger','api','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util'];(function(_0x157de9,_0x1a3dc3){var _0x13b471=function(_0x4ab559){while(--_0x4ab559){_0x157de9['push'](_0x157de9['shift']());}};_0x13b471(++_0x1a3dc3);}(_0xc5f7,0xcb));var _0x7c5f=function(_0x30c483,_0x44dcd4){_0x30c483=_0x30c483-0x0;var _0x2067bb=_0xc5f7[_0x30c483];return _0x2067bb;};'use strict';var _=require('lodash');var util=require(_0x7c5f('0x0'));var logger=require(_0x7c5f('0x1'))(_0x7c5f('0x2'));var moment=require(_0x7c5f('0x3'));var BPromise=require(_0x7c5f('0x4'));var rp=require(_0x7c5f('0x5'));var fs=require('fs');var path=require(_0x7c5f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c5f('0x7'));module[_0x7c5f('0x8')]=function(_0x2dd2d0,_0x380e95){return _0x2dd2d0['define'](_0x7c5f('0x9'),attributes,{'tableName':_0x7c5f('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7c5f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 51709c8..534a6d7 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 _0x6c7b=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x554610,_0x4c0dd7){var _0x539ea7=function(_0x3ddb03){while(--_0x3ddb03){_0x554610['push'](_0x554610['shift']());}};_0x539ea7(++_0x4c0dd7);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x39ce07,_0x2a0d4b){_0x39ce07=_0x39ce07-0x0;var _0x126f42=_0x6c7b[_0x39ce07];return _0x126f42;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6c7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6c7('0x2'))['db'];var utils=require(_0xb6c7('0x3'));var logger=require(_0xb6c7('0x4'))('rpc');var config=require(_0xb6c7('0x5'));var jayson=require(_0xb6c7('0x6'));var client=jayson[_0xb6c7('0x7')][_0xb6c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb889c3,_0x5dd47a,_0x12e97e){return new BPromise(function(_0x41a5a5,_0xe2ce08){return client[_0xb6c7('0x9')](_0xb889c3,_0x12e97e)[_0xb6c7('0xa')](function(_0x34dbbd){logger[_0xb6c7('0xb')](_0xb6c7('0xc'),_0x5dd47a,'request\x20sent');logger['debug'](_0xb6c7('0xd'),_0x5dd47a,_0xb6c7('0xe'),JSON[_0xb6c7('0xf')](_0x34dbbd));if(_0x34dbbd[_0xb6c7('0x10')]){if(_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x11')]===0x1f4){logger[_0xb6c7('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5dd47a,_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x12')]);return _0xe2ce08(_0x34dbbd[_0xb6c7('0x10')][_0xb6c7('0x12')]);}logger[_0xb6c7('0x10')](_0xb6c7('0xc'),_0x5dd47a,_0x34dbbd[_0xb6c7('0x10')]['message']);return _0x41a5a5(_0x34dbbd[_0xb6c7('0x10')]['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5dd47a,_0xb6c7('0xe'));_0x41a5a5(_0x34dbbd['result'][_0xb6c7('0x12')]);}})[_0xb6c7('0x13')](function(_0x23971b){logger[_0xb6c7('0x10')](_0xb6c7('0xc'),_0x5dd47a,_0x23971b);_0xe2ce08(_0x23971b);});});} \ No newline at end of file +var _0xc18a=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../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','error'];(function(_0xb1271e,_0x4cd506){var _0x45d761=function(_0x4b2493){while(--_0x4b2493){_0xb1271e['push'](_0xb1271e['shift']());}};_0x45d761(++_0x4cd506);}(_0xc18a,0x1cf));var _0xac18=function(_0x326cf6,_0x29b9dd){_0x326cf6=_0x326cf6-0x0;var _0x27c42e=_0xc18a[_0x326cf6];return _0x27c42e;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var moment=require(_0xac18('0x2'));var BPromise=require(_0xac18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac18('0x4'));var db=require(_0xac18('0x5'))['db'];var utils=require(_0xac18('0x6'));var logger=require(_0xac18('0x7'))(_0xac18('0x8'));var config=require(_0xac18('0x9'));var jayson=require(_0xac18('0xa'));var client=jayson[_0xac18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab6cb,_0x268fa1,_0x542a9){return new BPromise(function(_0x2bf4b8,_0xd3c4bc){return client[_0xac18('0xc')](_0xab6cb,_0x542a9)[_0xac18('0xd')](function(_0x223d7f){logger[_0xac18('0xe')](_0xac18('0xf'),_0x268fa1,_0xac18('0x10'));logger[_0xac18('0x11')](_0xac18('0x12'),_0x268fa1,_0xac18('0x10'),JSON['stringify'](_0x223d7f));if(_0x223d7f[_0xac18('0x13')]){if(_0x223d7f['error'][_0xac18('0x14')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')]['message']);return _0xd3c4bc(_0x223d7f['error'][_0xac18('0x15')]);}logger[_0xac18('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')][_0xac18('0x15')]);return _0x2bf4b8(_0x223d7f['error'][_0xac18('0x15')]);}else{logger['info'](_0xac18('0xf'),_0x268fa1,'request\x20sent');_0x2bf4b8(_0x223d7f['result'][_0xac18('0x15')]);}})[_0xac18('0x16')](function(_0x519c07){logger['error'](_0xac18('0xf'),_0x268fa1,_0x519c07);_0xd3c4bc(_0x519c07);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e9727c3..3037838 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 _0x15d5=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x25d160,_0x469c84){var _0x9579=function(_0x301005){while(--_0x301005){_0x25d160['push'](_0x25d160['shift']());}};_0x9579(++_0x469c84);}(_0x15d5,0x7e));var _0x515d=function(_0x4ab0eb,_0x41d876){_0x4ab0eb=_0x4ab0eb-0x0;var _0x250f7b=_0x15d5[_0x4ab0eb];return _0x250f7b;};'use strict';var multer=require(_0x515d('0x0'));var util=require(_0x515d('0x1'));var path=require(_0x515d('0x2'));var timeout=require('connect-timeout');var express=require(_0x515d('0x3'));var router=express[_0x515d('0x4')]();var fs_extra=require(_0x515d('0x5'));var auth=require(_0x515d('0x6'));var interaction=require(_0x515d('0x7'));var config=require('../../config/environment');var controller=require(_0x515d('0x8'));router['get']('/',auth[_0x515d('0x9')](),controller[_0x515d('0xa')]);router[_0x515d('0xb')](_0x515d('0xc'),auth[_0x515d('0x9')](),controller[_0x515d('0xd')]);router[_0x515d('0xe')]('/',auth[_0x515d('0x9')](),controller[_0x515d('0xf')]);router[_0x515d('0x10')]('/:id',auth[_0x515d('0x9')](),controller[_0x515d('0x11')]);router[_0x515d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x515d('0x13')]);module[_0x515d('0x14')]=router; \ No newline at end of file +var _0x9f1b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0xc15e2f,_0xea0b1e){var _0x45fa06=function(_0x6c126c){while(--_0x6c126c){_0xc15e2f['push'](_0xc15e2f['shift']());}};_0x45fa06(++_0xea0b1e);}(_0x9f1b,0xbd));var _0xb9f1=function(_0x1ffbae,_0x20a4d9){_0x1ffbae=_0x1ffbae-0x0;var _0x5ad985=_0x9f1b[_0x1ffbae];return _0x5ad985;};'use strict';var multer=require('multer');var util=require(_0xb9f1('0x0'));var path=require('path');var timeout=require(_0xb9f1('0x1'));var express=require(_0xb9f1('0x2'));var router=express['Router']();var fs_extra=require(_0xb9f1('0x3'));var auth=require(_0xb9f1('0x4'));var interaction=require(_0xb9f1('0x5'));var config=require(_0xb9f1('0x6'));var controller=require(_0xb9f1('0x7'));router[_0xb9f1('0x8')]('/',auth[_0xb9f1('0x9')](),controller['index']);router[_0xb9f1('0x8')](_0xb9f1('0xa'),auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xb')]);router[_0xb9f1('0xc')]('/',auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xd')]);router[_0xb9f1('0xe')]('/:id',auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xf')]);router[_0xb9f1('0x10')](_0xb9f1('0xa'),auth[_0xb9f1('0x9')](),controller[_0xb9f1('0x11')]);module[_0xb9f1('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index da58e37..9c368b7 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 _0x3c5a=['STRING','sequelize','exports'];(function(_0x53e3c2,_0x90a8fd){var _0x10aa40=function(_0x535ead){while(--_0x535ead){_0x53e3c2['push'](_0x53e3c2['shift']());}};_0x10aa40(++_0x90a8fd);}(_0x3c5a,0xa3));var _0xa3c5=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x3c5a[_0x4207f4];return _0x29a621;};'use strict';var Sequelize=require(_0xa3c5('0x0'));module[_0xa3c5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa3c5('0x2')]}}; \ No newline at end of file +var _0xd7d4=['name','STRING','exports'];(function(_0x452db0,_0x5cf2d4){var _0x29130d=function(_0x161686){while(--_0x161686){_0x452db0['push'](_0x452db0['shift']());}};_0x29130d(++_0x5cf2d4);}(_0xd7d4,0x1c4));var _0x4d7d=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xd7d4[_0x1dfa63];return _0x26f2a9;};'use strict';var Sequelize=require('sequelize');module[_0x4d7d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4d7d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4d7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d6a0dee..695d175 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 _0xa540=['keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','filter','type','merge','options','Pause','includeAll','include','findAll','show','rawAttributes','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Pauses','UserProfileResource','name','send','fieldName','key','model','map'];(function(_0x3aa8b1,_0x3089a1){var _0x3a9566=function(_0x319be3){while(--_0x319be3){_0x3aa8b1['push'](_0x3aa8b1['shift']());}};_0x3a9566(++_0x3089a1);}(_0xa540,0x15e));var _0x0a54=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa540[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0a54('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a54('0x1'));var rp=require(_0x0a54('0x2'));var moment=require(_0x0a54('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a54('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0a54('0x5'));var csv=require(_0x0a54('0x6'));var ejs=require(_0x0a54('0x7'));var fs=require('fs');var fs_extra=require(_0x0a54('0x8'));var _=require(_0x0a54('0x9'));var squel=require(_0x0a54('0xa'));var crypto=require(_0x0a54('0xb'));var jsforce=require(_0x0a54('0xc'));var deskjs=require(_0x0a54('0xd'));var toCsv=require(_0x0a54('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a54('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0a54('0xf'));var hardwareService=require(_0x0a54('0x10'));var logger=require(_0x0a54('0x11'))('api');var utils=require(_0x0a54('0x12'));var config=require(_0x0a54('0x13'));var licenseUtil=require(_0x0a54('0x14'));var db=require(_0x0a54('0x15'))['db'];function respondWithStatusCode(_0x991430,_0x2ae443){_0x2ae443=_0x2ae443||0xcc;return function(_0x57f7f6){if(_0x57f7f6){return _0x991430[_0x0a54('0x16')](_0x2ae443);}return _0x991430[_0x0a54('0x17')](_0x2ae443)['end']();};}function respondWithResult(_0x1b97b7,_0x3e6eb7){_0x3e6eb7=_0x3e6eb7||0xc8;return function(_0x4dae77){if(_0x4dae77){return _0x1b97b7[_0x0a54('0x17')](_0x3e6eb7)[_0x0a54('0x18')](_0x4dae77);}};}function respondWithFilteredResult(_0x4124d0,_0x57b3d6){return function(_0x552e28){if(_0x552e28){var _0xd2db60=typeof _0x57b3d6[_0x0a54('0x19')]===_0x0a54('0x1a')&&typeof _0x57b3d6[_0x0a54('0x1b')]===_0x0a54('0x1a');var _0xccdb71=_0x552e28[_0x0a54('0x1c')];var _0x32391f=_0xd2db60?0x0:_0x57b3d6[_0x0a54('0x19')];var _0x3bad9f=_0xd2db60?_0x552e28[_0x0a54('0x1c')]:_0x57b3d6[_0x0a54('0x19')]+_0x57b3d6[_0x0a54('0x1b')];var _0x2bc2da;if(_0x3bad9f>=_0xccdb71){_0x3bad9f=_0xccdb71;_0x2bc2da=0xc8;}else{_0x2bc2da=0xce;}_0x4124d0['status'](_0x2bc2da);return _0x4124d0[_0x0a54('0x1d')](_0x0a54('0x1e'),_0x32391f+'-'+_0x3bad9f+'/'+_0xccdb71)['json'](_0x552e28);}return null;};}function patchUpdates(_0x4bf74d){return function(_0x12031a){try{jsonpatch['apply'](_0x12031a,_0x4bf74d,!![]);}catch(_0xe070e){return BPromise[_0x0a54('0x1f')](_0xe070e);}return _0x12031a[_0x0a54('0x20')]();};}function saveUpdates(_0x29188a,_0x5026bc){return function(_0x52e1c8){if(_0x52e1c8){return _0x52e1c8[_0x0a54('0x21')](_0x29188a)[_0x0a54('0x22')](function(_0xe9dbc){return _0xe9dbc;});}return null;};}function removeEntity(_0x5d0881,_0x2ab613){return function(_0x4bde80){if(_0x4bde80){return _0x4bde80[_0x0a54('0x23')]()[_0x0a54('0x22')](function(){var _0x2f0300=_0x4bde80[_0x0a54('0x24')]({'plain':!![]});var _0x2f82c8=_0x0a54('0x25');return db[_0x0a54('0x26')][_0x0a54('0x23')]({'where':{'type':_0x2f82c8,'resourceId':_0x2f0300['id']}})[_0x0a54('0x22')](function(){return _0x4bde80;});})[_0x0a54('0x22')](function(){_0x5d0881['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x396d71,_0x2f8c15){return function(_0x23c2c2){if(!_0x23c2c2){_0x396d71[_0x0a54('0x16')](0x194);}return _0x23c2c2;};}function handleError(_0x1fcfce,_0x1ca69e){_0x1ca69e=_0x1ca69e||0x1f4;return function(_0x1f0c20){logger['error'](_0x1f0c20['stack']);if(_0x1f0c20[_0x0a54('0x27')]){delete _0x1f0c20[_0x0a54('0x27')];}_0x1fcfce['status'](_0x1ca69e)[_0x0a54('0x28')](_0x1f0c20);};}exports['index']=function(_0x31be87,_0x3e7567){var _0x4f44b4={},_0x4bc6da={},_0xdc996d={'count':0x0,'rows':[]};var _0x5972d9=_['map'](db['Pause']['rawAttributes'],function(_0x13d918){return{'name':_0x13d918[_0x0a54('0x29')],'type':_0x13d918['type'][_0x0a54('0x2a')]};});_0x4bc6da[_0x0a54('0x2b')]=_[_0x0a54('0x2c')](_0x5972d9,'name');_0x4bc6da['query']=_[_0x0a54('0x2d')](_0x31be87['query']);_0x4bc6da[_0x0a54('0x2e')]=_[_0x0a54('0x2f')](_0x4bc6da[_0x0a54('0x2b')],_0x4bc6da[_0x0a54('0x30')]);_0x4f44b4['attributes']=_['intersection'](_0x4bc6da[_0x0a54('0x2b')],qs[_0x0a54('0x31')](_0x31be87['query']['fields']));_0x4f44b4['attributes']=_0x4f44b4['attributes']['length']?_0x4f44b4[_0x0a54('0x32')]:_0x4bc6da[_0x0a54('0x2b')];if(!_0x31be87[_0x0a54('0x30')][_0x0a54('0x33')]('nolimit')){_0x4f44b4[_0x0a54('0x1b')]=qs[_0x0a54('0x1b')](_0x31be87[_0x0a54('0x30')][_0x0a54('0x1b')]);_0x4f44b4['offset']=qs[_0x0a54('0x19')](_0x31be87[_0x0a54('0x30')][_0x0a54('0x19')]);}_0x4f44b4[_0x0a54('0x34')]=qs[_0x0a54('0x35')](_0x31be87[_0x0a54('0x30')]['sort']);_0x4f44b4[_0x0a54('0x36')]=qs[_0x0a54('0x2e')](_['pick'](_0x31be87[_0x0a54('0x30')],_0x4bc6da[_0x0a54('0x2e')]),_0x5972d9);if(_0x31be87[_0x0a54('0x30')][_0x0a54('0x37')]){_0x4f44b4[_0x0a54('0x36')]=_['merge'](_0x4f44b4[_0x0a54('0x36')],{'$or':_[_0x0a54('0x2c')](_0x5972d9,function(_0x5f1427){if(_0x5f1427[_0x0a54('0x38')]!=='VIRTUAL'){var _0x3f1b14={};_0x3f1b14[_0x5f1427[_0x0a54('0x27')]]={'$like':'%'+_0x31be87[_0x0a54('0x30')]['filter']+'%'};return _0x3f1b14;}})});}_0x4f44b4=_[_0x0a54('0x39')]({},_0x4f44b4,_0x31be87[_0x0a54('0x3a')]);var _0x2fcb25={'where':_0x4f44b4[_0x0a54('0x36')]};return db[_0x0a54('0x3b')][_0x0a54('0x1c')](_0x2fcb25)[_0x0a54('0x22')](function(_0xbadc74){_0xdc996d[_0x0a54('0x1c')]=_0xbadc74;if(_0x31be87[_0x0a54('0x30')][_0x0a54('0x3c')]){_0x4f44b4[_0x0a54('0x3d')]=[{'all':!![]}];}return db[_0x0a54('0x3b')][_0x0a54('0x3e')](_0x4f44b4);})[_0x0a54('0x22')](function(_0x1f1da2){_0xdc996d['rows']=_0x1f1da2;return _0xdc996d;})[_0x0a54('0x22')](respondWithFilteredResult(_0x3e7567,_0x4f44b4))['catch'](handleError(_0x3e7567,null));};exports[_0x0a54('0x3f')]=function(_0x4454f9,_0x240278){var _0xc3a8f6={'raw':!![],'where':{'id':_0x4454f9['params']['id']}},_0x540f3a={};_0x540f3a[_0x0a54('0x2b')]=_[_0x0a54('0x2d')](db[_0x0a54('0x3b')][_0x0a54('0x40')]);_0x540f3a[_0x0a54('0x30')]=_[_0x0a54('0x2d')](_0x4454f9[_0x0a54('0x30')]);_0x540f3a[_0x0a54('0x2e')]=_['intersection'](_0x540f3a[_0x0a54('0x2b')],_0x540f3a['query']);_0xc3a8f6[_0x0a54('0x32')]=_[_0x0a54('0x2f')](_0x540f3a[_0x0a54('0x2b')],qs[_0x0a54('0x31')](_0x4454f9[_0x0a54('0x30')][_0x0a54('0x31')]));_0xc3a8f6[_0x0a54('0x32')]=_0xc3a8f6[_0x0a54('0x32')][_0x0a54('0x41')]?_0xc3a8f6[_0x0a54('0x32')]:_0x540f3a[_0x0a54('0x2b')];if(_0x4454f9['query'][_0x0a54('0x3c')]){_0xc3a8f6['include']=[{'all':!![]}];}_0xc3a8f6=_[_0x0a54('0x39')]({},_0xc3a8f6,_0x4454f9[_0x0a54('0x3a')]);return db[_0x0a54('0x3b')]['find'](_0xc3a8f6)[_0x0a54('0x22')](handleEntityNotFound(_0x240278,null))[_0x0a54('0x22')](respondWithResult(_0x240278,null))[_0x0a54('0x42')](handleError(_0x240278,null));};exports[_0x0a54('0x43')]=function(_0x3bed7a,_0xa9c16a){return db[_0x0a54('0x3b')][_0x0a54('0x43')](_0x3bed7a[_0x0a54('0x44')],{})[_0x0a54('0x22')](function(_0x520c91){var _0x5b53ff=_0x3bed7a[_0x0a54('0x45')][_0x0a54('0x24')]({'plain':!![]});if(!_0x5b53ff)throw new Error(_0x0a54('0x46'));if(_0x5b53ff[_0x0a54('0x47')]===_0x0a54('0x45')){var _0xab6873=_0x520c91[_0x0a54('0x24')]({'plain':!![]});var _0x39f52f='Pauses';return db[_0x0a54('0x48')][_0x0a54('0x49')]({'where':{'name':_0x39f52f,'userProfileId':_0x5b53ff[_0x0a54('0x4a')]},'raw':!![]})['then'](function(_0x353d01){if(_0x353d01&&_0x353d01[_0x0a54('0x4b')]===0x0){return db[_0x0a54('0x26')]['create']({'name':_0xab6873['name'],'resourceId':_0xab6873['id'],'type':_0x353d01[_0x0a54('0x27')],'sectionId':_0x353d01['id']},{})[_0x0a54('0x22')](function(){return _0x520c91;});}else{return _0x520c91;}})[_0x0a54('0x42')](function(_0x103a6a){logger[_0x0a54('0x4c')](_0x0a54('0x4d'),_0x103a6a);throw _0x103a6a;});}return _0x520c91;})[_0x0a54('0x22')](respondWithResult(_0xa9c16a,0xc9))['catch'](handleError(_0xa9c16a,null));};exports[_0x0a54('0x21')]=function(_0x1b11e1,_0x4bf20c){if(_0x1b11e1[_0x0a54('0x44')]['id']){delete _0x1b11e1[_0x0a54('0x44')]['id'];}return db[_0x0a54('0x3b')][_0x0a54('0x49')]({'where':{'id':_0x1b11e1['params']['id']}})['then'](handleEntityNotFound(_0x4bf20c,null))[_0x0a54('0x22')](saveUpdates(_0x1b11e1[_0x0a54('0x44')],null))[_0x0a54('0x22')](respondWithResult(_0x4bf20c,null))[_0x0a54('0x42')](handleError(_0x4bf20c,null));};exports['destroy']=function(_0x2c4436,_0x16fafe){return db[_0x0a54('0x3b')][_0x0a54('0x49')]({'where':{'id':_0x2c4436[_0x0a54('0x4e')]['id']}})[_0x0a54('0x22')](handleEntityNotFound(_0x16fafe,null))[_0x0a54('0x22')](removeEntity(_0x16fafe,null))['catch'](handleError(_0x16fafe,null));}; \ No newline at end of file +var _0x9ed8=['options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Pause','fieldName','type','key','model','keys','intersection','attributes','fields','length','query','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','show','rawAttributes'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x9ed8,0x1e6));var _0x89ed=function(_0x43a3c4,_0x56035b){_0x43a3c4=_0x43a3c4-0x0;var _0x1b6661=_0x9ed8[_0x43a3c4];return _0x1b6661;};'use strict';var emlformat=require(_0x89ed('0x0'));var rimraf=require(_0x89ed('0x1'));var zipdir=require(_0x89ed('0x2'));var jsonpatch=require(_0x89ed('0x3'));var rp=require(_0x89ed('0x4'));var moment=require(_0x89ed('0x5'));var BPromise=require(_0x89ed('0x6'));var Mustache=require(_0x89ed('0x7'));var util=require('util');var path=require(_0x89ed('0x8'));var sox=require('sox');var csv=require(_0x89ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89ed('0xa'));var _=require('lodash');var squel=require(_0x89ed('0xb'));var crypto=require(_0x89ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x89ed('0xd'));var toCsv=require(_0x89ed('0x9'));var querystring=require('querystring');var Papa=require(_0x89ed('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89ed('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89ed('0x10'));var logger=require(_0x89ed('0x11'))(_0x89ed('0x12'));var utils=require(_0x89ed('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5903c0,_0x5365c9){_0x5365c9=_0x5365c9||0xcc;return function(_0x174dc6){if(_0x174dc6){return _0x5903c0[_0x89ed('0x14')](_0x5365c9);}return _0x5903c0[_0x89ed('0x15')](_0x5365c9)[_0x89ed('0x16')]();};}function respondWithResult(_0x106353,_0x59d76c){_0x59d76c=_0x59d76c||0xc8;return function(_0x53b9b5){if(_0x53b9b5){return _0x106353[_0x89ed('0x15')](_0x59d76c)['json'](_0x53b9b5);}};}function respondWithFilteredResult(_0x2f8247,_0x137e07){return function(_0x38ca99){if(_0x38ca99){var _0x97df6f=typeof _0x137e07[_0x89ed('0x17')]==='undefined'&&typeof _0x137e07[_0x89ed('0x18')]===_0x89ed('0x19');var _0x476746=_0x38ca99[_0x89ed('0x1a')];var _0x280545=_0x97df6f?0x0:_0x137e07[_0x89ed('0x17')];var _0x85c19f=_0x97df6f?_0x38ca99[_0x89ed('0x1a')]:_0x137e07[_0x89ed('0x17')]+_0x137e07['limit'];var _0x1bdd83;if(_0x85c19f>=_0x476746){_0x85c19f=_0x476746;_0x1bdd83=0xc8;}else{_0x1bdd83=0xce;}_0x2f8247[_0x89ed('0x15')](_0x1bdd83);return _0x2f8247[_0x89ed('0x1b')](_0x89ed('0x1c'),_0x280545+'-'+_0x85c19f+'/'+_0x476746)[_0x89ed('0x1d')](_0x38ca99);}return null;};}function patchUpdates(_0x417f3a){return function(_0x59f80a){try{jsonpatch[_0x89ed('0x1e')](_0x59f80a,_0x417f3a,!![]);}catch(_0x36485b){return BPromise['reject'](_0x36485b);}return _0x59f80a[_0x89ed('0x1f')]();};}function saveUpdates(_0x11f5b3,_0x29d863){return function(_0x26ddf2){if(_0x26ddf2){return _0x26ddf2[_0x89ed('0x20')](_0x11f5b3)[_0x89ed('0x21')](function(_0x1f88c9){return _0x1f88c9;});}return null;};}function removeEntity(_0x45c5d9,_0x4ccca6){return function(_0x19fa40){if(_0x19fa40){return _0x19fa40[_0x89ed('0x22')]()[_0x89ed('0x21')](function(){var _0x1cda90=_0x19fa40[_0x89ed('0x23')]({'plain':!![]});var _0x308bf2='Pauses';return db[_0x89ed('0x24')][_0x89ed('0x22')]({'where':{'type':_0x308bf2,'resourceId':_0x1cda90['id']}})[_0x89ed('0x21')](function(){return _0x19fa40;});})[_0x89ed('0x21')](function(){_0x45c5d9[_0x89ed('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x449ee6,_0x48b000){return function(_0x1b096e){if(!_0x1b096e){_0x449ee6[_0x89ed('0x14')](0x194);}return _0x1b096e;};}function handleError(_0x44ecaa,_0xe40b72){_0xe40b72=_0xe40b72||0x1f4;return function(_0x2b8f4c){logger[_0x89ed('0x25')](_0x2b8f4c[_0x89ed('0x26')]);if(_0x2b8f4c[_0x89ed('0x27')]){delete _0x2b8f4c['name'];}_0x44ecaa[_0x89ed('0x15')](_0xe40b72)[_0x89ed('0x28')](_0x2b8f4c);};}exports[_0x89ed('0x29')]=function(_0x3cf520,_0x3190c5){var _0x4a1525={},_0x23a26e={},_0x16df00={'count':0x0,'rows':[]};var _0x4e0cc7=_[_0x89ed('0x2a')](db[_0x89ed('0x2b')]['rawAttributes'],function(_0x5cd209){return{'name':_0x5cd209[_0x89ed('0x2c')],'type':_0x5cd209[_0x89ed('0x2d')][_0x89ed('0x2e')]};});_0x23a26e[_0x89ed('0x2f')]=_[_0x89ed('0x2a')](_0x4e0cc7,_0x89ed('0x27'));_0x23a26e['query']=_[_0x89ed('0x30')](_0x3cf520['query']);_0x23a26e['filters']=_[_0x89ed('0x31')](_0x23a26e[_0x89ed('0x2f')],_0x23a26e['query']);_0x4a1525[_0x89ed('0x32')]=_['intersection'](_0x23a26e['model'],qs[_0x89ed('0x33')](_0x3cf520['query'][_0x89ed('0x33')]));_0x4a1525[_0x89ed('0x32')]=_0x4a1525[_0x89ed('0x32')][_0x89ed('0x34')]?_0x4a1525[_0x89ed('0x32')]:_0x23a26e[_0x89ed('0x2f')];if(!_0x3cf520[_0x89ed('0x35')]['hasOwnProperty'](_0x89ed('0x36'))){_0x4a1525[_0x89ed('0x18')]=qs[_0x89ed('0x18')](_0x3cf520[_0x89ed('0x35')][_0x89ed('0x18')]);_0x4a1525['offset']=qs[_0x89ed('0x17')](_0x3cf520[_0x89ed('0x35')][_0x89ed('0x17')]);}_0x4a1525[_0x89ed('0x37')]=qs[_0x89ed('0x38')](_0x3cf520['query'][_0x89ed('0x38')]);_0x4a1525[_0x89ed('0x39')]=qs[_0x89ed('0x3a')](_[_0x89ed('0x3b')](_0x3cf520[_0x89ed('0x35')],_0x23a26e[_0x89ed('0x3a')]),_0x4e0cc7);if(_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3c')]){_0x4a1525[_0x89ed('0x39')]=_['merge'](_0x4a1525[_0x89ed('0x39')],{'$or':_[_0x89ed('0x2a')](_0x4e0cc7,function(_0x2fc38c){if(_0x2fc38c['type']!=='VIRTUAL'){var _0x522143={};_0x522143[_0x2fc38c[_0x89ed('0x27')]]={'$like':'%'+_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3c')]+'%'};return _0x522143;}})});}_0x4a1525=_[_0x89ed('0x3d')]({},_0x4a1525,_0x3cf520['options']);var _0x21601a={'where':_0x4a1525[_0x89ed('0x39')]};return db[_0x89ed('0x2b')][_0x89ed('0x1a')](_0x21601a)['then'](function(_0x4e29b7){_0x16df00[_0x89ed('0x1a')]=_0x4e29b7;if(_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3e')]){_0x4a1525[_0x89ed('0x3f')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4a1525);})[_0x89ed('0x21')](function(_0x57d78c){_0x16df00[_0x89ed('0x40')]=_0x57d78c;return _0x16df00;})[_0x89ed('0x21')](respondWithFilteredResult(_0x3190c5,_0x4a1525))['catch'](handleError(_0x3190c5,null));};exports[_0x89ed('0x41')]=function(_0x37f122,_0x1cbcfb){var _0x2c4122={'raw':!![],'where':{'id':_0x37f122['params']['id']}},_0x1ad6bc={};_0x1ad6bc[_0x89ed('0x2f')]=_[_0x89ed('0x30')](db[_0x89ed('0x2b')][_0x89ed('0x42')]);_0x1ad6bc['query']=_['keys'](_0x37f122[_0x89ed('0x35')]);_0x1ad6bc['filters']=_[_0x89ed('0x31')](_0x1ad6bc[_0x89ed('0x2f')],_0x1ad6bc[_0x89ed('0x35')]);_0x2c4122[_0x89ed('0x32')]=_[_0x89ed('0x31')](_0x1ad6bc['model'],qs[_0x89ed('0x33')](_0x37f122[_0x89ed('0x35')]['fields']));_0x2c4122[_0x89ed('0x32')]=_0x2c4122['attributes']['length']?_0x2c4122[_0x89ed('0x32')]:_0x1ad6bc['model'];if(_0x37f122[_0x89ed('0x35')][_0x89ed('0x3e')]){_0x2c4122[_0x89ed('0x3f')]=[{'all':!![]}];}_0x2c4122=_[_0x89ed('0x3d')]({},_0x2c4122,_0x37f122[_0x89ed('0x43')]);return db[_0x89ed('0x2b')][_0x89ed('0x44')](_0x2c4122)['then'](handleEntityNotFound(_0x1cbcfb,null))[_0x89ed('0x21')](respondWithResult(_0x1cbcfb,null))[_0x89ed('0x45')](handleError(_0x1cbcfb,null));};exports[_0x89ed('0x46')]=function(_0x1fc39f,_0x1a0deb){return db[_0x89ed('0x2b')][_0x89ed('0x46')](_0x1fc39f[_0x89ed('0x47')],{})['then'](function(_0x4a5413){var _0x34278a=_0x1fc39f[_0x89ed('0x48')][_0x89ed('0x23')]({'plain':!![]});if(!_0x34278a)throw new Error(_0x89ed('0x49'));if(_0x34278a['role']===_0x89ed('0x48')){var _0x7c35f1=_0x4a5413[_0x89ed('0x23')]({'plain':!![]});var _0x17b14f=_0x89ed('0x4a');return db['UserProfileSection'][_0x89ed('0x44')]({'where':{'name':_0x17b14f,'userProfileId':_0x34278a[_0x89ed('0x4b')]},'raw':!![]})[_0x89ed('0x21')](function(_0x4891c3){if(_0x4891c3&&_0x4891c3[_0x89ed('0x4c')]===0x0){return db[_0x89ed('0x24')]['create']({'name':_0x7c35f1['name'],'resourceId':_0x7c35f1['id'],'type':_0x4891c3['name'],'sectionId':_0x4891c3['id']},{})['then'](function(){return _0x4a5413;});}else{return _0x4a5413;}})[_0x89ed('0x45')](function(_0x312b9f){logger[_0x89ed('0x25')](_0x89ed('0x4d'),_0x312b9f);throw _0x312b9f;});}return _0x4a5413;})['then'](respondWithResult(_0x1a0deb,0xc9))[_0x89ed('0x45')](handleError(_0x1a0deb,null));};exports[_0x89ed('0x20')]=function(_0x2f57d1,_0x4da075){if(_0x2f57d1[_0x89ed('0x47')]['id']){delete _0x2f57d1[_0x89ed('0x47')]['id'];}return db['Pause']['find']({'where':{'id':_0x2f57d1[_0x89ed('0x4e')]['id']}})[_0x89ed('0x21')](handleEntityNotFound(_0x4da075,null))[_0x89ed('0x21')](saveUpdates(_0x2f57d1[_0x89ed('0x47')],null))[_0x89ed('0x21')](respondWithResult(_0x4da075,null))[_0x89ed('0x45')](handleError(_0x4da075,null));};exports[_0x89ed('0x22')]=function(_0x45bbd6,_0x2896d7){return db[_0x89ed('0x2b')]['find']({'where':{'id':_0x45bbd6[_0x89ed('0x4e')]['id']}})[_0x89ed('0x21')](handleEntityNotFound(_0x2896d7,null))['then'](removeEntity(_0x2896d7,null))[_0x89ed('0x45')](handleError(_0x2896d7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index fad6a24..4a65791 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x515838,_0x5d8003){var _0x107ac8=function(_0x4572f8){while(--_0x4572f8){_0x515838['push'](_0x515838['shift']());}};_0x107ac8(++_0x5d8003);}(_0xabce,0x103));var _0xeabc=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xabce[_0x32d457];return _0x338386;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 25bc8d2..15c2450 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(_0x5c57df,_0x1c30ec){var _0x2a45bb=function(_0x432546){while(--_0x432546){_0x5c57df['push'](_0x5c57df['shift']());}};_0x2a45bb(++_0x1c30ec);}(_0x7a54,0x106));var _0x47a5=function(_0x244346,_0x9f6258){_0x244346=_0x244346-0x0;var _0x2dac65=_0x7a54[_0x244346];return _0x2dac65;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x34e89c,_0x3e95dd){var _0x37db46=function(_0xeb0fb8){while(--_0xeb0fb8){_0x34e89c['push'](_0x34e89c['shift']());}};_0x37db46(++_0x3e95dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x17db61,_0x364236){_0x17db61=_0x17db61-0x0;var _0x7ac96b=_0xb10b[_0x17db61];return _0x7ac96b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 50a707e..82bc6cf 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 _0xb821=['upload','post','update','delete','exports','util','path','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','basename','extname','single'];(function(_0x389c52,_0x55e9a5){var _0x1479b5=function(_0x23b2ca){while(--_0x23b2ca){_0x389c52['push'](_0x389c52['shift']());}};_0x1479b5(++_0x55e9a5);}(_0xb821,0xa7));var _0x1b82=function(_0x522f46,_0x2ab756){_0x522f46=_0x522f46-0x0;var _0x42e248=_0xb821[_0x522f46];return _0x42e248;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),controller[_0x1b82('0x9')]);router[_0x1b82('0x6')](_0x1b82('0xa'),auth[_0x1b82('0xb')](),controller[_0x1b82('0xc')]);router[_0x1b82('0x6')]('/:id/download',auth[_0x1b82('0xb')](),controller[_0x1b82('0xd')]);var upload=multer({'storage':multer[_0x1b82('0xe')]({'destination':function(_0x14c57a,_0xcffb87,_0x17a96b){_0x17a96b(null,path[_0x1b82('0xf')](config[_0x1b82('0x10')],'server/files/plugins'));},'filename':function(_0x46007e,_0x241d11,_0x2391f5){_0x241d11[_0x1b82('0x11')]=_0x241d11['originalname'][_0x1b82('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2391f5(null,util['format']('%s-%s%s',path[_0x1b82('0x13')](_0x241d11['originalname'],path[_0x1b82('0x14')](_0x241d11[_0x1b82('0x11')])),Date['now'](),path[_0x1b82('0x14')](_0x241d11['originalname'])));}})});router['post']('/',upload[_0x1b82('0x15')]('file'),controller[_0x1b82('0x16')]);router[_0x1b82('0x17')](_0x1b82('0x8'),controller['webhookPost']);router['put'](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x18')]);router[_0x1b82('0x19')](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x19')]);module[_0x1b82('0x1a')]=router; \ No newline at end of file +var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x40b598,_0x4dda7e){var _0xd574fd=function(_0x4ea633){while(--_0x4ea633){_0x40b598['push'](_0x40b598['shift']());}};_0xd574fd(++_0x4dda7e);}(_0x4c4e,0x152));var _0xe4c4=function(_0xb51f6c,_0x4e3071){_0xb51f6c=_0xb51f6c-0x0;var _0x21b617=_0x4c4e[_0xb51f6c];return _0x21b617;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 62cce39..fa1d135 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 _0x5f15=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never'];(function(_0x2223d6,_0x48597d){var _0x1c2a86=function(_0x291851){while(--_0x291851){_0x2223d6['push'](_0x2223d6['shift']());}};_0x1c2a86(++_0x48597d);}(_0x5f15,0x119));var _0x55f1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5f15[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x55f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x55f1('0x1')]},'type':{'type':Sequelize[_0x55f1('0x2')]('html',_0x55f1('0x3'))},'description':{'type':Sequelize[_0x55f1('0x4')]},'version':{'type':Sequelize[_0x55f1('0x4')]},'path':{'type':Sequelize[_0x55f1('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x55f1('0x5')},'sidebar':{'type':Sequelize[_0x55f1('0x2')]('adminOnly',_0x55f1('0x6'),_0x55f1('0x7'),_0x55f1('0x8')),'defaultValue':_0x55f1('0x7'),'comment':_0x55f1('0x9')},'icon':{'type':Sequelize[_0x55f1('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x55f1('0x1')]},'scriptName':{'type':Sequelize[_0x55f1('0x1')]},'scriptPath':{'type':Sequelize[_0x55f1('0x1')]}}; \ No newline at end of file +var _0x7f43=['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.','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x7f43,0x6f));var _0x37f4=function(_0x4267df,_0x5ada59){_0x4267df=_0x4267df-0x0;var _0x1dd02f=_0x7f43[_0x4267df];return _0x1dd02f;};'use strict';var Sequelize=require(_0x37f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x37f4('0x1')]},'type':{'type':Sequelize[_0x37f4('0x2')](_0x37f4('0x3'),_0x37f4('0x4'))},'description':{'type':Sequelize[_0x37f4('0x5')]},'version':{'type':Sequelize[_0x37f4('0x5')]},'path':{'type':Sequelize[_0x37f4('0x1')],'comment':_0x37f4('0x6')},'active':{'type':Sequelize[_0x37f4('0x7')],'defaultValue':0x0,'comment':_0x37f4('0x8')},'sidebar':{'type':Sequelize[_0x37f4('0x2')](_0x37f4('0x9'),_0x37f4('0xa'),'always',_0x37f4('0xb')),'defaultValue':_0x37f4('0xc'),'comment':_0x37f4('0xd')},'icon':{'type':Sequelize[_0x37f4('0x1')]},'adminUrl':{'type':Sequelize[_0x37f4('0x1')]},'agentUrl':{'type':Sequelize[_0x37f4('0x1')]},'scriptName':{'type':Sequelize[_0x37f4('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 07a6860..e313ccd 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 _0x3da7=['Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','format','%s%s','headers','content-length','content-type','endsWith','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','error','name','send','index','map','Plugin','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','options','find','catch','download','params','join','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync'];(function(_0x53d8c7,_0x179b0a){var _0x276e2c=function(_0x5bfaea){while(--_0x5bfaea){_0x53d8c7['push'](_0x53d8c7['shift']());}};_0x276e2c(++_0x179b0a);}(_0x3da7,0xe2));var _0x73da=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x3da7[_0x3203a1];return _0x24215e;};'use strict';var emlformat=require(_0x73da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73da('0x1'));var jsonpatch=require(_0x73da('0x2'));var rp=require(_0x73da('0x3'));var moment=require(_0x73da('0x4'));var BPromise=require(_0x73da('0x5'));var Mustache=require(_0x73da('0x6'));var util=require('util');var path=require(_0x73da('0x7'));var sox=require(_0x73da('0x8'));var csv=require(_0x73da('0x9'));var ejs=require(_0x73da('0xa'));var fs=require('fs');var fs_extra=require(_0x73da('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x73da('0xc'));var jsforce=require(_0x73da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x73da('0x9'));var querystring=require(_0x73da('0xe'));var Papa=require(_0x73da('0xf'));var extract=require('extract-zip');var rimraf=require(_0x73da('0x10'));var archiver=require(_0x73da('0x11'));var Redis=require(_0x73da('0x12'));var authService=require(_0x73da('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x73da('0x14'))(_0x73da('0x15'));var utils=require(_0x73da('0x16'));var config=require(_0x73da('0x17'));var licenseUtil=require(_0x73da('0x18'));var db=require('../../mysqldb')['db'];config[_0x73da('0x19')]=_[_0x73da('0x1a')](config[_0x73da('0x19')],{'host':_0x73da('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x73da('0x1c'))['register'](socket);function respondWithStatusCode(_0x269b7a,_0x123c8d){_0x123c8d=_0x123c8d||0xcc;return function(_0x3cf5a8){if(_0x3cf5a8){return _0x269b7a[_0x73da('0x1d')](_0x123c8d);}return _0x269b7a['status'](_0x123c8d)[_0x73da('0x1e')]();};}function respondWithResult(_0x3cff1b,_0x27926f){_0x27926f=_0x27926f||0xc8;return function(_0x1a1aa3){if(_0x1a1aa3){return _0x3cff1b[_0x73da('0x1f')](_0x27926f)[_0x73da('0x20')](_0x1a1aa3);}};}function respondWithFilteredResult(_0x6649b9,_0x16aa5e){return function(_0x45bd44){if(_0x45bd44){var _0x34371e=typeof _0x16aa5e[_0x73da('0x21')]===_0x73da('0x22')&&typeof _0x16aa5e[_0x73da('0x23')]==='undefined';var _0x3a8278=_0x45bd44[_0x73da('0x24')];var _0x682a99=_0x34371e?0x0:_0x16aa5e[_0x73da('0x21')];var _0x222137=_0x34371e?_0x45bd44[_0x73da('0x24')]:_0x16aa5e[_0x73da('0x21')]+_0x16aa5e['limit'];var _0x534623;if(_0x222137>=_0x3a8278){_0x222137=_0x3a8278;_0x534623=0xc8;}else{_0x534623=0xce;}_0x6649b9[_0x73da('0x1f')](_0x534623);return _0x6649b9[_0x73da('0x25')](_0x73da('0x26'),_0x682a99+'-'+_0x222137+'/'+_0x3a8278)[_0x73da('0x20')](_0x45bd44);}return null;};}function patchUpdates(_0x507101){return function(_0x21168d){try{jsonpatch[_0x73da('0x27')](_0x21168d,_0x507101,!![]);}catch(_0x5bf139){return BPromise[_0x73da('0x28')](_0x5bf139);}return _0x21168d[_0x73da('0x29')]();};}function saveUpdates(_0x82d50e,_0x415e3f){return function(_0x5ab89c){if(_0x5ab89c){return _0x5ab89c[_0x73da('0x2a')](_0x82d50e)[_0x73da('0x2b')](function(_0x482b83){return _0x482b83;});}return null;};}function removeEntity(_0x45df89,_0x1db5f3){return function(_0x4c3682){if(_0x4c3682){return _0x4c3682[_0x73da('0x2c')]()[_0x73da('0x2b')](function(){var _0x3fc316=_0x4c3682[_0x73da('0x2d')]({'plain':!![]});var _0x4f7f2e=_0x73da('0x2e');return db['UserProfileResource'][_0x73da('0x2c')]({'where':{'type':_0x4f7f2e,'resourceId':_0x3fc316['id']}})['then'](function(){return _0x4c3682;});})[_0x73da('0x2b')](function(){_0x45df89[_0x73da('0x1f')](0xcc)[_0x73da('0x1e')]();});}};}function handleEntityNotFound(_0x3b75d8,_0x4b2ae8){return function(_0x20bf93){if(!_0x20bf93){_0x3b75d8[_0x73da('0x1d')](0x194);}return _0x20bf93;};}function handleError(_0x51f97f,_0x27abdb){_0x27abdb=_0x27abdb||0x1f4;return function(_0x3daa0e){logger[_0x73da('0x2f')](_0x3daa0e['stack']);if(_0x3daa0e[_0x73da('0x30')]){delete _0x3daa0e[_0x73da('0x30')];}_0x51f97f[_0x73da('0x1f')](_0x27abdb)[_0x73da('0x31')](_0x3daa0e);};}exports[_0x73da('0x32')]=function(_0x531af7,_0xc578b3){var _0x5dc1f4={},_0x939f7e={},_0xb24763={'count':0x0,'rows':[]};var _0x5bcecf=_[_0x73da('0x33')](db[_0x73da('0x34')][_0x73da('0x35')],function(_0x22bc79){return{'name':_0x22bc79[_0x73da('0x36')],'type':_0x22bc79['type'][_0x73da('0x37')]};});_0x939f7e['model']=_[_0x73da('0x33')](_0x5bcecf,_0x73da('0x30'));_0x939f7e['query']=_[_0x73da('0x38')](_0x531af7[_0x73da('0x39')]);_0x939f7e[_0x73da('0x3a')]=_[_0x73da('0x3b')](_0x939f7e['model'],_0x939f7e[_0x73da('0x39')]);_0x5dc1f4[_0x73da('0x3c')]=_['intersection'](_0x939f7e[_0x73da('0x3d')],qs[_0x73da('0x3e')](_0x531af7[_0x73da('0x39')]['fields']));_0x5dc1f4[_0x73da('0x3c')]=_0x5dc1f4[_0x73da('0x3c')][_0x73da('0x3f')]?_0x5dc1f4[_0x73da('0x3c')]:_0x939f7e[_0x73da('0x3d')];if(!_0x531af7[_0x73da('0x39')]['hasOwnProperty'](_0x73da('0x40'))){_0x5dc1f4['limit']=qs[_0x73da('0x23')](_0x531af7[_0x73da('0x39')][_0x73da('0x23')]);_0x5dc1f4[_0x73da('0x21')]=qs[_0x73da('0x21')](_0x531af7[_0x73da('0x39')][_0x73da('0x21')]);}_0x5dc1f4[_0x73da('0x41')]=qs[_0x73da('0x42')](_0x531af7[_0x73da('0x39')][_0x73da('0x42')]);_0x5dc1f4[_0x73da('0x43')]=qs[_0x73da('0x3a')](_[_0x73da('0x44')](_0x531af7[_0x73da('0x39')],_0x939f7e[_0x73da('0x3a')]),_0x5bcecf);if(_0x531af7[_0x73da('0x39')][_0x73da('0x45')]){_0x5dc1f4[_0x73da('0x43')]=_[_0x73da('0x46')](_0x5dc1f4[_0x73da('0x43')],{'$or':_[_0x73da('0x33')](_0x5bcecf,function(_0x5bab93){if(_0x5bab93[_0x73da('0x47')]!==_0x73da('0x48')){var _0x246179={};_0x246179[_0x5bab93[_0x73da('0x30')]]={'$like':'%'+_0x531af7[_0x73da('0x39')]['filter']+'%'};return _0x246179;}})});}_0x5dc1f4=_[_0x73da('0x46')]({},_0x5dc1f4,_0x531af7['options']);var _0x1c462e={'where':_0x5dc1f4[_0x73da('0x43')]};return db[_0x73da('0x34')]['count'](_0x1c462e)[_0x73da('0x2b')](function(_0x168967){_0xb24763['count']=_0x168967;if(_0x531af7[_0x73da('0x39')][_0x73da('0x49')]){_0x5dc1f4[_0x73da('0x4a')]=[{'all':!![]}];}return db[_0x73da('0x34')]['findAll'](_0x5dc1f4);})[_0x73da('0x2b')](function(_0x138b56){_0xb24763[_0x73da('0x4b')]=_0x138b56;return _0xb24763;})[_0x73da('0x2b')](respondWithFilteredResult(_0xc578b3,_0x5dc1f4))['catch'](handleError(_0xc578b3,null));};exports[_0x73da('0x4c')]=function(_0x99e4be,_0x3ea040){var _0x2ae5bf={'raw':!![],'where':{'id':_0x99e4be['params']['id']}},_0x1c25a4={};_0x1c25a4[_0x73da('0x3d')]=_[_0x73da('0x38')](db['Plugin'][_0x73da('0x35')]);_0x1c25a4[_0x73da('0x39')]=_['keys'](_0x99e4be['query']);_0x1c25a4[_0x73da('0x3a')]=_['intersection'](_0x1c25a4[_0x73da('0x3d')],_0x1c25a4[_0x73da('0x39')]);_0x2ae5bf[_0x73da('0x3c')]=_[_0x73da('0x3b')](_0x1c25a4[_0x73da('0x3d')],qs[_0x73da('0x3e')](_0x99e4be[_0x73da('0x39')]['fields']));_0x2ae5bf[_0x73da('0x3c')]=_0x2ae5bf['attributes'][_0x73da('0x3f')]?_0x2ae5bf[_0x73da('0x3c')]:_0x1c25a4[_0x73da('0x3d')];if(_0x99e4be[_0x73da('0x39')][_0x73da('0x49')]){_0x2ae5bf[_0x73da('0x4a')]=[{'all':!![]}];}_0x2ae5bf=_[_0x73da('0x46')]({},_0x2ae5bf,_0x99e4be[_0x73da('0x4d')]);return db[_0x73da('0x34')][_0x73da('0x4e')](_0x2ae5bf)[_0x73da('0x2b')](handleEntityNotFound(_0x3ea040,null))[_0x73da('0x2b')](respondWithResult(_0x3ea040,null))[_0x73da('0x4f')](handleError(_0x3ea040,null));};exports[_0x73da('0x50')]=function(_0x3d2c2b,_0x5e3ae7,_0xb11ce1){return db[_0x73da('0x34')]['find']({'where':{'id':_0x3d2c2b[_0x73da('0x51')]['id']},'attributes':[_0x73da('0x30'),_0x73da('0x7')],'raw':!![]})[_0x73da('0x2b')](handleEntityNotFound(_0x5e3ae7,null))[_0x73da('0x2b')](function(_0x4aa445){if(_0x4aa445){var _0xfad3b3=path[_0x73da('0x52')](config['root'],_0x73da('0x53'),util['format'](_0x73da('0x54'),path[_0x73da('0x55')](_0x4aa445[_0x73da('0x7')])));var _0x25f3c2=fs[_0x73da('0x56')](_0xfad3b3);var _0x2b1da4=archiver(_0x73da('0x57'),{'zlib':{'level':0x9}});_0x2b1da4['on'](_0x73da('0x58'),function(_0x464c8c){if(_0x464c8c[_0x73da('0x59')]===_0x73da('0x5a')){logger[_0x73da('0x2f')](_0x464c8c);}else{throw new db[(_0x73da('0x5b'))][(_0x73da('0x5c'))](_0x73da('0x5d'));}});_0x2b1da4['on']('error',function(_0x3c8501){throw new db[(_0x73da('0x5b'))]['Error'](_0x73da('0x5d'));});_0x2b1da4[_0x73da('0x5e')](_0x25f3c2);_0x2b1da4['glob'](_0x73da('0x5f'),{'cwd':path[_0x73da('0x52')](config[_0x73da('0x60')],_0x73da('0x53'),path[_0x73da('0x61')](_0x4aa445[_0x73da('0x7')])),'ignore':[path[_0x73da('0x52')](path['basename'](_0x4aa445[_0x73da('0x7')]),'node_modules/**/*'),path[_0x73da('0x52')](path[_0x73da('0x55')](_0x4aa445['path']),'attachments/**/*')],'nodir':!![]})[_0x73da('0x62')]();_0x25f3c2['on'](_0x73da('0x63'),function(){if(!fs[_0x73da('0x64')](_0xfad3b3)){throw new db[(_0x73da('0x5b'))][(_0x73da('0x5c'))](_0x73da('0x65'));}return _0x5e3ae7[_0x73da('0x50')](_0xfad3b3,util['format'](_0x73da('0x54'),path[_0x73da('0x55')](_0x4aa445[_0x73da('0x7')])),function(_0x2e4006){if(_0x2e4006){throw new db[(_0x73da('0x5b'))][(_0x73da('0x5c'))](_0x73da('0x66'));}fs['unlinkSync'](_0xfad3b3);logger[_0x73da('0x67')](_0x73da('0x68'));logger['info'](_0x73da('0x69'));});});}return null;})[_0x73da('0x4f')](handleError(_0x5e3ae7,null));};exports[_0x73da('0x6a')]=function(_0x21726b,_0x305b99,_0x12a3c2){var _0x284d44=path['basename'](_0x21726b[_0x73da('0x6b')][_0x73da('0x6c')],path[_0x73da('0x6d')](_0x21726b[_0x73da('0x6b')][_0x73da('0x6c')]));var _0x501d14=path[_0x73da('0x52')](config[_0x73da('0x60')],_0x73da('0x53'),_0x21726b['file'][_0x73da('0x6c')]);var _0x27e814=path[_0x73da('0x52')](config[_0x73da('0x60')],_0x73da('0x53'),_0x284d44);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x501d14);logger[_0x73da('0x67')](_0x73da('0x6e'),_0x27e814);try{fs[_0x73da('0x6f')](_0x501d14,parseInt(_0x73da('0x70'),0x8));extract(_0x501d14,{'dir':_0x27e814},function(_0x5e10cf){if(_0x5e10cf){logger['error'](_0x5e10cf);handleError(_0x5e10cf,!![]);};var _0x20bbad=fs[_0x73da('0x71')](_0x27e814);if(_0x20bbad[_0x73da('0x3f')]>0x1){removeReferences(_0x501d14,_0x27e814);logger['error'](_0x73da('0x72'));return _0x12a3c2(new Error(_0x73da('0x72')));}var _0x3f94b4=fs[_0x73da('0x73')](path['join'](_0x27e814,_0x20bbad[0x0]));if(_0x3f94b4[_0x73da('0x74')]()){removeReferences(_0x501d14,_0x27e814);logger[_0x73da('0x2f')](_0x73da('0x72'));return _0x12a3c2(new Error(_0x73da('0x72')));}if(_0x3f94b4[_0x73da('0x75')]()){var _0x1c5ce7=fs['readdirSync'](path['join'](_0x27e814,_0x20bbad[0x0]));if(_0x1c5ce7[_0x73da('0x3f')]===0x0){removeReferences(_0x501d14,_0x27e814);logger[_0x73da('0x2f')](_0x73da('0x72'));return _0x12a3c2(new Error(_0x73da('0x72')));}var _0x2dff9c=_0x1c5ce7[_0x73da('0x76')](function(_0x204eae){return _0x204eae===_0x73da('0x77');});if(!_0x2dff9c){return _0x12a3c2(new Error(_0x73da('0x78')));}var _0x321099=fs['readFileSync'](path[_0x73da('0x52')](_0x27e814,_0x20bbad[0x0],_0x73da('0x77')));var _0x14cbdb=JSON[_0x73da('0x79')](_0x321099);if(_0x73da('0x22')==typeof _0x14cbdb['name']){return _0x12a3c2(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x47')]){return _0x12a3c2(new Error(_0x73da('0x7a')));}if('undefined'==typeof _0x14cbdb[_0x73da('0x7b')]){return _0x12a3c2(new Error(_0x73da('0x7c')));}if(_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x7d')]){return _0x12a3c2(new Error(_0x73da('0x7e')));}if(_0x14cbdb['type']==='html'){if(_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x7d')]['views']){return _0x12a3c2(new Error(_0x73da('0x7f')));}if(_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x81')]&&_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x82')]){return _0x12a3c2(new Error(_0x73da('0x83')));}}else if(_0x14cbdb['type']===_0x73da('0x84')){if(_0x73da('0x22')==typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x85')]){return _0x12a3c2(new Error(_0x73da('0x86')));}if('undefined'==typeof _0x14cbdb[_0x73da('0x7d')]['scriptPath']){return _0x12a3c2(new Error(_0x73da('0x87')));}}else{return _0x12a3c2(new Error(_0x73da('0x88')));}var _0x323406=_0x14cbdb['name'];var _0x50b18d=_0x14cbdb['description'];var _0x1b8230=_0x14cbdb[_0x73da('0x47')];var _0x3c04f6=_0x14cbdb[_0x73da('0x89')]?_0x14cbdb[_0x73da('0x89')]:_0x73da('0x8a');var _0x42752e=_0x14cbdb[_0x73da('0x8b')]?_0x14cbdb[_0x73da('0x8b')]:_0x73da('0x8c');var _0x1fba6d='';var _0x17f16b='';var _0x48f435='';var _0x41c042='';var _0x5f5b1e=_0x14cbdb['version'];if(_0x1b8230===_0x73da('0x8d')){if(_0x73da('0x22')!=typeof _0x14cbdb[_0x73da('0x7d')]['views'][_0x73da('0x81')]){var _0x44f8f5=_0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x44f8f5)){_0x1fba6d=path[_0x73da('0x52')](_0x73da('0x8e'),_0x284d44,_0x20bbad[0x0],_0x44f8f5);}else{_0x1fba6d=_0x44f8f5;}}else{logger['info'](_0x73da('0x8f'));}if(_0x73da('0x22')!=typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x82')]){var _0x47e6b3=_0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x73da('0x90')](_0x47e6b3)){_0x17f16b=path[_0x73da('0x52')](_0x73da('0x8e'),_0x284d44,_0x20bbad[0x0],_0x47e6b3);}else{_0x17f16b=_0x47e6b3;}}else{logger[_0x73da('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1b8230===_0x73da('0x84')){_0x48f435=_0x14cbdb[_0x73da('0x7d')][_0x73da('0x85')];_0x41c042=_0x14cbdb[_0x73da('0x7d')]['scriptPath'];if('undefined'!=typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')]){if('undefined'!=typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x81')]){var _0x44f8f5=_0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x73da('0x90')](_0x44f8f5)){_0x1fba6d=path['join'](_0x73da('0x8e'),_0x284d44,_0x20bbad[0x0],_0x44f8f5);}else{_0x1fba6d=_0x44f8f5;}}if('undefined'!=typeof _0x14cbdb[_0x73da('0x7d')][_0x73da('0x80')][_0x73da('0x82')]){var _0x47e6b3=_0x14cbdb['parameters'][_0x73da('0x80')][_0x73da('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x73da('0x90')](_0x47e6b3)){_0x17f16b=path[_0x73da('0x52')]('plugins',_0x284d44,_0x20bbad[0x0],_0x47e6b3);}else{_0x17f16b=_0x47e6b3;}}}}var _0x56d490={'name':_0x323406,'description':_0x50b18d,'path':path[_0x73da('0x52')](_0x284d44,_0x20bbad[0x0]),'type':_0x1b8230,'sidebar':_0x3c04f6,'icon':_0x42752e,'adminUrl':_0x1fba6d,'agentUrl':_0x17f16b,'scriptName':_0x48f435,'scriptPath':_0x41c042,'version':_0x5f5b1e};removeReferences(_0x501d14,null);return db[_0x73da('0x34')][_0x73da('0x91')](_0x56d490)['then'](function(_0x2aa44d){var _0x51b4d4={'role':_0x21726b['body'][_0x73da('0x92')],'userProfileId':_0x21726b['body'][_0x73da('0x93')]};if(!_0x51b4d4)throw new Error(_0x73da('0x94'));if(_0x51b4d4[_0x73da('0x92')]===_0x73da('0x95')){var _0x4acfbb=_0x2aa44d[_0x73da('0x2d')]({'plain':!![]});return db[_0x73da('0x96')][_0x73da('0x4e')]({'where':{'name':_0x73da('0x2e'),'userProfileId':_0x51b4d4['userProfileId']},'raw':!![]})[_0x73da('0x2b')](function(_0x1c1a8c){if(_0x1c1a8c&&_0x1c1a8c['autoAssociation']===0x0){return db['UserProfileResource'][_0x73da('0x91')]({'name':_0x4acfbb[_0x73da('0x30')],'resourceId':_0x4acfbb['id'],'type':_0x1c1a8c[_0x73da('0x30')],'sectionId':_0x1c1a8c['id']},{})[_0x73da('0x2b')](function(){return _0x2aa44d;});}else{return _0x2aa44d;}})[_0x73da('0x4f')](function(_0x3e53ea){logger['error'](_0x73da('0x97'),_0x3e53ea);throw _0x3e53ea;});}return _0x2aa44d;})[_0x73da('0x2b')](respondWithResult(_0x305b99,null))[_0x73da('0x4f')](handleError(_0x305b99,null));}});}catch(_0x2df74b){_0x305b99['status'](0x1f4)[_0x73da('0x31')](_0x2df74b);}};function removeReferences(_0x2252a4,_0x1871c6){try{if(_0x2252a4){fs['unlinkSync'](_0x2252a4);logger['info'](_0x73da('0x98'));}if(_0x1871c6){rimraf(_0x1871c6,function(){});logger[_0x73da('0x67')](_0x73da('0x99'));}}catch(_0x23d2fb){logger[_0x73da('0x2f')](_0x23d2fb);}}exports['update']=function(_0x3d9df7,_0x4ec655,_0x187402){return db[_0x73da('0x34')][_0x73da('0x4e')]({'where':{'id':_0x3d9df7[_0x73da('0x51')]['id']}})[_0x73da('0x2b')](handleEntityNotFound(_0x4ec655,null))[_0x73da('0x2b')](saveUpdates(_0x3d9df7[_0x73da('0x9a')],null))['then'](respondWithResult(_0x4ec655,null))[_0x73da('0x4f')](handleError(_0x4ec655,null));};exports[_0x73da('0x9b')]=function(_0x539d66,_0x1b7636,_0x27215c){return db['Plugin'][_0x73da('0x4e')]({'where':{'id':_0x539d66[_0x73da('0x51')]['id']}})[_0x73da('0x2b')](function(_0x1e3016){if(_0x1e3016){return _0x1e3016[_0x73da('0x2c')]();}})['then'](function(_0x4c2ea5){rimraf(path['join'](config['root'],_0x73da('0x53'),path['dirname'](_0x4c2ea5[_0x73da('0x7')])),function(){});return _0x4c2ea5;})[_0x73da('0x2b')](handleEntityNotFound(_0x1b7636,null))[_0x73da('0x2b')](respondWithStatusCode(_0x1b7636,null))[_0x73da('0x4f')](handleError(_0x1b7636,null));};exports[_0x73da('0x9c')]=function(_0x101e9c,_0x2d4754,_0x2d208e){return BPromise[_0x73da('0x9d')]()['then'](function(){if(!_0x101e9c[_0x73da('0x39')][_0x73da('0x7')]){throw new Error(_0x73da('0x9e'));}if(!_0x101e9c[_0x73da('0x39')][_0x73da('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3c66ea=_0x101e9c['query']['hostname']?_0x101e9c['query'][_0x73da('0xa0')]+':'+_0x101e9c[_0x73da('0x39')][_0x73da('0x9f')]:'http://localhost:'+_0x101e9c[_0x73da('0x39')][_0x73da('0x9f')];var _0xa0363b=_0x101e9c['query'][_0x73da('0x20')]?_0x101e9c[_0x73da('0x39')]['json']:!![];var _0x5d1294=_0x101e9c[_0x73da('0x39')][_0x73da('0xa1')]?_0x101e9c['query'][_0x73da('0xa1')]:null;var _0x30d476={'method':_0x101e9c['method'],'uri':util[_0x73da('0xa2')](_0x73da('0xa3'),_0x3c66ea,_0x101e9c[_0x73da('0x39')][_0x73da('0x7')]),'json':_0xa0363b,'resolveWithFullResponse':!![],'encoding':_0x5d1294,'qs':_0x101e9c['query']};if(_0x101e9c[_0x73da('0xa4')]){_0x30d476[_0x73da('0xa4')]=_0x101e9c['headers'];if(_0x30d476[_0x73da('0xa4')][_0x73da('0xa5')]){delete _0x30d476[_0x73da('0xa4')][_0x73da('0xa5')];}}if(_0x30d476['headers'][_0x73da('0xa6')]){delete _0x30d476[_0x73da('0xa4')]['content-type'];}return rp(_0x30d476);})[_0x73da('0x2b')](function(_0x2e0125){if(_0x2e0125){_0x2d4754[_0x73da('0x25')](_0x2e0125[_0x73da('0xa4')]);logger[_0x73da('0x67')](_0x2e0125[_0x73da('0x9a')]);if(_[_0x73da('0xa7')](_0x101e9c[_0x73da('0x39')][_0x73da('0x7')],_0x73da('0x50'))&&_0x2e0125['statusCode']==0x1f4){return _0x2d4754[_0x73da('0x1d')](_0x2e0125['statusCode']);}else{return _0x2d4754[_0x73da('0x1f')](_0x2e0125['statusCode'])[_0x73da('0x31')](_0x2e0125[_0x73da('0x9a')]);}}else{return _0x2d4754[_0x73da('0x1d')](0xc8);}})['catch'](handleError(_0x2d4754,null));};exports[_0x73da('0xa8')]=function(_0x46a862,_0x4f8c1c,_0x520cd0){return BPromise[_0x73da('0x9d')]()['then'](function(){if(!_0x46a862[_0x73da('0x39')][_0x73da('0x7')]){throw new Error(_0x73da('0x9e'));}if(!_0x46a862['query'][_0x73da('0x9f')]){throw new Error(_0x73da('0xa9'));}var _0x353a15=_0x46a862[_0x73da('0x39')][_0x73da('0xa0')]?_0x46a862[_0x73da('0x39')][_0x73da('0xa0')]+':'+_0x46a862[_0x73da('0x39')]['port']:'http://localhost:'+_0x46a862[_0x73da('0x39')]['port'];var _0x5d1ad1=_0x46a862[_0x73da('0x39')]['json']?_0x46a862[_0x73da('0x39')][_0x73da('0x20')]:!![];var _0x43dbc6=_0x46a862[_0x73da('0x39')]['encoding']?_0x46a862['query'][_0x73da('0xa1')]:null;var _0xb093f3={'method':_0x46a862['method'],'uri':util[_0x73da('0xa2')](_0x73da('0xa3'),_0x353a15,_0x46a862[_0x73da('0x39')][_0x73da('0x7')]),'json':_0x5d1ad1,'resolveWithFullResponse':!![],'encoding':_0x43dbc6,'body':_0x46a862[_0x73da('0x9a')]};if(_0x46a862[_0x73da('0xa4')]){_0xb093f3[_0x73da('0xa4')]=_0x46a862[_0x73da('0xa4')];if(_0xb093f3[_0x73da('0xa4')]['content-length']){delete _0xb093f3[_0x73da('0xa4')]['content-length'];}}if(_0xb093f3[_0x73da('0xa4')]['content-type']){delete _0xb093f3[_0x73da('0xa4')]['content-type'];}return rp(_0xb093f3);})['then'](function(_0x3d29d3){if(_0x3d29d3){_0x4f8c1c['set'](_0x3d29d3['headers']);logger['info'](_0x3d29d3['body']);return _0x4f8c1c[_0x73da('0x1f')](_0x3d29d3['statusCode'])[_0x73da('0x31')](_0x3d29d3[_0x73da('0x9a')]);}else{return _0x4f8c1c[_0x73da('0x1d')](0xc8);}})[_0x73da('0x4f')](handleError(_0x4f8c1c,null));}; \ No newline at end of file +var _0x1e38=['code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','close','Plugin\x20not\x20found','format','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','script','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','UserProfileResource','destroy','then','error','map','Plugin','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','show','params','keys','options','find','catch','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning'];(function(_0x3c6305,_0x43dde1){var _0x22685a=function(_0x3e55c5){while(--_0x3e55c5){_0x3c6305['push'](_0x3c6305['shift']());}};_0x22685a(++_0x43dde1);}(_0x1e38,0x1b3));var _0x81e3=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1e38[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81e3('0x0'));var jsonpatch=require(_0x81e3('0x1'));var rp=require(_0x81e3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81e3('0x3'));var util=require(_0x81e3('0x4'));var path=require(_0x81e3('0x5'));var sox=require('sox');var csv=require(_0x81e3('0x6'));var ejs=require(_0x81e3('0x7'));var fs=require('fs');var fs_extra=require(_0x81e3('0x8'));var _=require(_0x81e3('0x9'));var squel=require(_0x81e3('0xa'));var crypto=require(_0x81e3('0xb'));var jsforce=require(_0x81e3('0xc'));var deskjs=require(_0x81e3('0xd'));var toCsv=require(_0x81e3('0x6'));var querystring=require('querystring');var Papa=require(_0x81e3('0xe'));var extract=require(_0x81e3('0xf'));var rimraf=require('rimraf');var archiver=require(_0x81e3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x81e3('0x11'));var as=require(_0x81e3('0x12'));var hardwareService=require(_0x81e3('0x13'));var logger=require(_0x81e3('0x14'))(_0x81e3('0x15'));var utils=require(_0x81e3('0x16'));var config=require(_0x81e3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x81e3('0x18'))['db'];config['redis']=_[_0x81e3('0x19')](config[_0x81e3('0x1a')],{'host':_0x81e3('0x1b'),'port':0x18eb});var socket=require(_0x81e3('0x1c'))(new Redis(config[_0x81e3('0x1a')]));require('./plugin.socket')[_0x81e3('0x1d')](socket);function respondWithStatusCode(_0x25aa88,_0x515379){_0x515379=_0x515379||0xcc;return function(_0x5a07da){if(_0x5a07da){return _0x25aa88[_0x81e3('0x1e')](_0x515379);}return _0x25aa88[_0x81e3('0x1f')](_0x515379)[_0x81e3('0x20')]();};}function respondWithResult(_0x3d4799,_0xe12ee5){_0xe12ee5=_0xe12ee5||0xc8;return function(_0x1c026b){if(_0x1c026b){return _0x3d4799[_0x81e3('0x1f')](_0xe12ee5)[_0x81e3('0x21')](_0x1c026b);}};}function respondWithFilteredResult(_0x410801,_0x5bbc7d){return function(_0x229112){if(_0x229112){var _0x4d2900=typeof _0x5bbc7d['offset']===_0x81e3('0x22')&&typeof _0x5bbc7d[_0x81e3('0x23')]===_0x81e3('0x22');var _0x5cc51c=_0x229112[_0x81e3('0x24')];var _0x321743=_0x4d2900?0x0:_0x5bbc7d[_0x81e3('0x25')];var _0x388b82=_0x4d2900?_0x229112[_0x81e3('0x24')]:_0x5bbc7d[_0x81e3('0x25')]+_0x5bbc7d[_0x81e3('0x23')];var _0x112ce1;if(_0x388b82>=_0x5cc51c){_0x388b82=_0x5cc51c;_0x112ce1=0xc8;}else{_0x112ce1=0xce;}_0x410801[_0x81e3('0x1f')](_0x112ce1);return _0x410801[_0x81e3('0x26')](_0x81e3('0x27'),_0x321743+'-'+_0x388b82+'/'+_0x5cc51c)[_0x81e3('0x21')](_0x229112);}return null;};}function patchUpdates(_0x19408a){return function(_0x1528d6){try{jsonpatch[_0x81e3('0x28')](_0x1528d6,_0x19408a,!![]);}catch(_0x44bd6e){return BPromise[_0x81e3('0x29')](_0x44bd6e);}return _0x1528d6[_0x81e3('0x2a')]();};}function saveUpdates(_0x4d9f78,_0x2092fc){return function(_0x2e4320){if(_0x2e4320){return _0x2e4320['update'](_0x4d9f78)['then'](function(_0x2839c2){return _0x2839c2;});}return null;};}function removeEntity(_0x9b0b30,_0x4e7bbc){return function(_0x557908){if(_0x557908){return _0x557908['destroy']()['then'](function(){var _0x37aec3=_0x557908['get']({'plain':!![]});var _0x4b3eab='Plugins';return db[_0x81e3('0x2b')][_0x81e3('0x2c')]({'where':{'type':_0x4b3eab,'resourceId':_0x37aec3['id']}})['then'](function(){return _0x557908;});})[_0x81e3('0x2d')](function(){_0x9b0b30['status'](0xcc)[_0x81e3('0x20')]();});}};}function handleEntityNotFound(_0x4c0821,_0x8686d3){return function(_0x5ef9ac){if(!_0x5ef9ac){_0x4c0821['sendStatus'](0x194);}return _0x5ef9ac;};}function handleError(_0x31cfea,_0x4a315f){_0x4a315f=_0x4a315f||0x1f4;return function(_0x57c2d8){logger[_0x81e3('0x2e')](_0x57c2d8['stack']);if(_0x57c2d8['name']){delete _0x57c2d8['name'];}_0x31cfea[_0x81e3('0x1f')](_0x4a315f)['send'](_0x57c2d8);};}exports['index']=function(_0x10234e,_0x361d43){var _0x71f2e={},_0x45f327={},_0x20f22b={'count':0x0,'rows':[]};var _0x2cb506=_[_0x81e3('0x2f')](db[_0x81e3('0x30')][_0x81e3('0x31')],function(_0x1e8af2){return{'name':_0x1e8af2[_0x81e3('0x32')],'type':_0x1e8af2[_0x81e3('0x33')]['key']};});_0x45f327[_0x81e3('0x34')]=_['map'](_0x2cb506,_0x81e3('0x35'));_0x45f327[_0x81e3('0x36')]=_['keys'](_0x10234e[_0x81e3('0x36')]);_0x45f327[_0x81e3('0x37')]=_[_0x81e3('0x38')](_0x45f327[_0x81e3('0x34')],_0x45f327['query']);_0x71f2e[_0x81e3('0x39')]=_[_0x81e3('0x38')](_0x45f327['model'],qs['fields'](_0x10234e['query'][_0x81e3('0x3a')]));_0x71f2e['attributes']=_0x71f2e[_0x81e3('0x39')][_0x81e3('0x3b')]?_0x71f2e[_0x81e3('0x39')]:_0x45f327['model'];if(!_0x10234e[_0x81e3('0x36')]['hasOwnProperty']('nolimit')){_0x71f2e[_0x81e3('0x23')]=qs['limit'](_0x10234e[_0x81e3('0x36')][_0x81e3('0x23')]);_0x71f2e[_0x81e3('0x25')]=qs[_0x81e3('0x25')](_0x10234e[_0x81e3('0x36')][_0x81e3('0x25')]);}_0x71f2e[_0x81e3('0x3c')]=qs['sort'](_0x10234e[_0x81e3('0x36')][_0x81e3('0x3d')]);_0x71f2e[_0x81e3('0x3e')]=qs[_0x81e3('0x37')](_[_0x81e3('0x3f')](_0x10234e[_0x81e3('0x36')],_0x45f327[_0x81e3('0x37')]),_0x2cb506);if(_0x10234e['query']['filter']){_0x71f2e[_0x81e3('0x3e')]=_[_0x81e3('0x40')](_0x71f2e[_0x81e3('0x3e')],{'$or':_[_0x81e3('0x2f')](_0x2cb506,function(_0x252dbe){if(_0x252dbe[_0x81e3('0x33')]!==_0x81e3('0x41')){var _0x19163e={};_0x19163e[_0x252dbe['name']]={'$like':'%'+_0x10234e[_0x81e3('0x36')][_0x81e3('0x42')]+'%'};return _0x19163e;}})});}_0x71f2e=_[_0x81e3('0x40')]({},_0x71f2e,_0x10234e['options']);var _0x3eab91={'where':_0x71f2e[_0x81e3('0x3e')]};return db[_0x81e3('0x30')]['count'](_0x3eab91)[_0x81e3('0x2d')](function(_0x245602){_0x20f22b[_0x81e3('0x24')]=_0x245602;if(_0x10234e[_0x81e3('0x36')]['includeAll']){_0x71f2e[_0x81e3('0x43')]=[{'all':!![]}];}return db[_0x81e3('0x30')]['findAll'](_0x71f2e);})[_0x81e3('0x2d')](function(_0x3acd78){_0x20f22b[_0x81e3('0x44')]=_0x3acd78;return _0x20f22b;})[_0x81e3('0x2d')](respondWithFilteredResult(_0x361d43,_0x71f2e))['catch'](handleError(_0x361d43,null));};exports[_0x81e3('0x45')]=function(_0x1bcd53,_0xbb50c8){var _0x33db64={'raw':!![],'where':{'id':_0x1bcd53[_0x81e3('0x46')]['id']}},_0x28d6c5={};_0x28d6c5[_0x81e3('0x34')]=_[_0x81e3('0x47')](db[_0x81e3('0x30')][_0x81e3('0x31')]);_0x28d6c5[_0x81e3('0x36')]=_[_0x81e3('0x47')](_0x1bcd53[_0x81e3('0x36')]);_0x28d6c5[_0x81e3('0x37')]=_[_0x81e3('0x38')](_0x28d6c5[_0x81e3('0x34')],_0x28d6c5[_0x81e3('0x36')]);_0x33db64[_0x81e3('0x39')]=_[_0x81e3('0x38')](_0x28d6c5['model'],qs[_0x81e3('0x3a')](_0x1bcd53[_0x81e3('0x36')][_0x81e3('0x3a')]));_0x33db64[_0x81e3('0x39')]=_0x33db64[_0x81e3('0x39')]['length']?_0x33db64[_0x81e3('0x39')]:_0x28d6c5[_0x81e3('0x34')];if(_0x1bcd53[_0x81e3('0x36')]['includeAll']){_0x33db64['include']=[{'all':!![]}];}_0x33db64=_[_0x81e3('0x40')]({},_0x33db64,_0x1bcd53[_0x81e3('0x48')]);return db[_0x81e3('0x30')][_0x81e3('0x49')](_0x33db64)[_0x81e3('0x2d')](handleEntityNotFound(_0xbb50c8,null))[_0x81e3('0x2d')](respondWithResult(_0xbb50c8,null))[_0x81e3('0x4a')](handleError(_0xbb50c8,null));};exports[_0x81e3('0x4b')]=function(_0x1c9530,_0x120b89,_0x3ba8e0){return db['Plugin'][_0x81e3('0x49')]({'where':{'id':_0x1c9530[_0x81e3('0x46')]['id']},'attributes':[_0x81e3('0x35'),_0x81e3('0x5')],'raw':!![]})[_0x81e3('0x2d')](handleEntityNotFound(_0x120b89,null))[_0x81e3('0x2d')](function(_0x33fc17){if(_0x33fc17){var _0x37da14=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),util['format'](_0x81e3('0x4f'),path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')])));var _0x271b7f=fs[_0x81e3('0x51')](_0x37da14);var _0x188b17=archiver(_0x81e3('0x52'),{'zlib':{'level':0x9}});_0x188b17['on'](_0x81e3('0x53'),function(_0x5a1e35){if(_0x5a1e35[_0x81e3('0x54')]===_0x81e3('0x55')){logger[_0x81e3('0x2e')](_0x5a1e35);}else{throw new db['Sequelize'][(_0x81e3('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x188b17['on'](_0x81e3('0x2e'),function(_0x396bcd){throw new db[(_0x81e3('0x57'))][(_0x81e3('0x56'))](_0x81e3('0x58'));});_0x188b17[_0x81e3('0x59')](_0x271b7f);_0x188b17[_0x81e3('0x5a')](_0x81e3('0x5b'),{'cwd':path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],'server/files/plugins',path['dirname'](_0x33fc17[_0x81e3('0x5')])),'ignore':[path['join'](path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')]),_0x81e3('0x5c')),path[_0x81e3('0x4c')](path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')]),_0x81e3('0x5d'))],'nodir':!![]})['finalize']();_0x271b7f['on'](_0x81e3('0x5e'),function(){if(!fs['existsSync'](_0x37da14)){throw new db['Sequelize'][(_0x81e3('0x56'))](_0x81e3('0x5f'));}return _0x120b89['download'](_0x37da14,util[_0x81e3('0x60')](_0x81e3('0x4f'),path[_0x81e3('0x50')](_0x33fc17['path'])),function(_0x3da9ef){if(_0x3da9ef){throw new db[(_0x81e3('0x57'))][(_0x81e3('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x81e3('0x61')](_0x37da14);logger['info']('Download\x20completed');logger[_0x81e3('0x62')](_0x81e3('0x63'));});});}return null;})[_0x81e3('0x4a')](handleError(_0x120b89,null));};exports[_0x81e3('0x64')]=function(_0x1ef872,_0x49b5dd,_0x5531ff){var _0x387a94=path[_0x81e3('0x50')](_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')],path[_0x81e3('0x67')](_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')]));var _0xd622b6=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')]);var _0x57a08e=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),_0x387a94);logger[_0x81e3('0x62')](_0x81e3('0x68'),_0xd622b6);logger[_0x81e3('0x62')](_0x81e3('0x69'),_0x57a08e);try{fs['chmodSync'](_0xd622b6,parseInt(_0x81e3('0x6a'),0x8));extract(_0xd622b6,{'dir':_0x57a08e},function(_0x292668){if(_0x292668){logger['error'](_0x292668);handleError(_0x292668,!![]);};var _0x1820e3=fs[_0x81e3('0x6b')](_0x57a08e);if(_0x1820e3['length']>0x1){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')]('Invalid\x20plugin\x20structure');return _0x5531ff(new Error('Invalid\x20plugin\x20structure'));}var _0x1ab683=fs[_0x81e3('0x6c')](path['join'](_0x57a08e,_0x1820e3[0x0]));if(_0x1ab683[_0x81e3('0x6d')]()){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')]('Invalid\x20plugin\x20structure');return _0x5531ff(new Error(_0x81e3('0x6e')));}if(_0x1ab683[_0x81e3('0x6f')]()){var _0x57b3ba=fs[_0x81e3('0x6b')](path[_0x81e3('0x4c')](_0x57a08e,_0x1820e3[0x0]));if(_0x57b3ba[_0x81e3('0x3b')]===0x0){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')](_0x81e3('0x6e'));return _0x5531ff(new Error(_0x81e3('0x6e')));}var _0x324486=_0x57b3ba[_0x81e3('0x70')](function(_0x221d67){return _0x221d67==='manifest.json';});if(!_0x324486){return _0x5531ff(new Error(_0x81e3('0x71')));}var _0x2930b6=fs['readFileSync'](path[_0x81e3('0x4c')](_0x57a08e,_0x1820e3[0x0],_0x81e3('0x72')));var _0x47ab8f=JSON[_0x81e3('0x73')](_0x2930b6);if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x35')]){return _0x5531ff(new Error(_0x81e3('0x74')));}if(_0x81e3('0x22')==typeof _0x47ab8f['type']){return _0x5531ff(new Error(_0x81e3('0x75')));}if('undefined'==typeof _0x47ab8f[_0x81e3('0x76')]){return _0x5531ff(new Error(_0x81e3('0x77')));}if(_0x81e3('0x22')==typeof _0x47ab8f['parameters']){return _0x5531ff(new Error(_0x81e3('0x78')));}if(_0x47ab8f[_0x81e3('0x33')]===_0x81e3('0x79')){if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')]){return _0x5531ff(new Error(_0x81e3('0x7c')));}if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')]['views'][_0x81e3('0x7d')]&&_0x81e3('0x22')==typeof _0x47ab8f['parameters'][_0x81e3('0x7b')][_0x81e3('0x7e')]){return _0x5531ff(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x47ab8f[_0x81e3('0x33')]==='script'){if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')]['scriptName']){return _0x5531ff(new Error(_0x81e3('0x7f')));}if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x80')]){return _0x5531ff(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5531ff(new Error(_0x81e3('0x81')));}var _0x5cfa03=_0x47ab8f[_0x81e3('0x35')];var _0x2451f7=_0x47ab8f[_0x81e3('0x82')];var _0x141262=_0x47ab8f['type'];var _0x1b9902=_0x47ab8f[_0x81e3('0x83')]?_0x47ab8f[_0x81e3('0x83')]:_0x81e3('0x84');var _0x6fd8fd=_0x47ab8f[_0x81e3('0x85')]?_0x47ab8f[_0x81e3('0x85')]:_0x81e3('0x86');var _0x15fd86='';var _0x50400e='';var _0x1cf32a='';var _0x32be1c='';var _0x4a44e2=_0x47ab8f[_0x81e3('0x76')];if(_0x141262===_0x81e3('0x79')){if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')]['views']['admin']){var _0x16bf3c=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')][_0x81e3('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x16bf3c)){_0x15fd86=path[_0x81e3('0x4c')](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x16bf3c);}else{_0x15fd86=_0x16bf3c;}}else{logger[_0x81e3('0x62')](_0x81e3('0x88'));}if(_0x81e3('0x22')!=typeof _0x47ab8f['parameters'][_0x81e3('0x7b')]['agent']){var _0x163de7=_0x47ab8f['parameters']['views'][_0x81e3('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x89')](_0x163de7)){_0x50400e=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x163de7);}else{_0x50400e=_0x163de7;}}else{logger[_0x81e3('0x62')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x141262===_0x81e3('0x8a')){_0x1cf32a=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x8b')];_0x32be1c=_0x47ab8f[_0x81e3('0x7a')]['scriptPath'];if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')]['views']){if(_0x81e3('0x22')!=typeof _0x47ab8f['parameters'][_0x81e3('0x7b')][_0x81e3('0x7d')]){var _0x16bf3c=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x89')](_0x16bf3c)){_0x15fd86=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x16bf3c);}else{_0x15fd86=_0x16bf3c;}}if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')][_0x81e3('0x7e')]){var _0x163de7=_0x47ab8f['parameters']['views'][_0x81e3('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x163de7)){_0x50400e=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x163de7);}else{_0x50400e=_0x163de7;}}}}var _0x3d35af={'name':_0x5cfa03,'description':_0x2451f7,'path':path['join'](_0x387a94,_0x1820e3[0x0]),'type':_0x141262,'sidebar':_0x1b9902,'icon':_0x6fd8fd,'adminUrl':_0x15fd86,'agentUrl':_0x50400e,'scriptName':_0x1cf32a,'scriptPath':_0x32be1c,'version':_0x4a44e2};removeReferences(_0xd622b6,null);return db[_0x81e3('0x30')][_0x81e3('0x8c')](_0x3d35af)[_0x81e3('0x2d')](function(_0x35e821){var _0x522241={'role':_0x1ef872[_0x81e3('0x8d')][_0x81e3('0x8e')],'userProfileId':_0x1ef872[_0x81e3('0x8d')][_0x81e3('0x8f')]};if(!_0x522241)throw new Error(_0x81e3('0x90'));if(_0x522241[_0x81e3('0x8e')]===_0x81e3('0x91')){var _0x40949a=_0x35e821[_0x81e3('0x92')]({'plain':!![]});return db[_0x81e3('0x93')][_0x81e3('0x49')]({'where':{'name':_0x81e3('0x94'),'userProfileId':_0x522241[_0x81e3('0x8f')]},'raw':!![]})[_0x81e3('0x2d')](function(_0x41e76a){if(_0x41e76a&&_0x41e76a[_0x81e3('0x95')]===0x0){return db['UserProfileResource'][_0x81e3('0x8c')]({'name':_0x40949a[_0x81e3('0x35')],'resourceId':_0x40949a['id'],'type':_0x41e76a['name'],'sectionId':_0x41e76a['id']},{})[_0x81e3('0x2d')](function(){return _0x35e821;});}else{return _0x35e821;}})[_0x81e3('0x4a')](function(_0x5bf608){logger['error'](_0x81e3('0x96'),_0x5bf608);throw _0x5bf608;});}return _0x35e821;})[_0x81e3('0x2d')](respondWithResult(_0x49b5dd,null))[_0x81e3('0x4a')](handleError(_0x49b5dd,null));}});}catch(_0x4f27fe){_0x49b5dd[_0x81e3('0x1f')](0x1f4)['send'](_0x4f27fe);}};function removeReferences(_0x38168f,_0x586bab){try{if(_0x38168f){fs[_0x81e3('0x61')](_0x38168f);logger['info'](_0x81e3('0x97'));}if(_0x586bab){rimraf(_0x586bab,function(){});logger[_0x81e3('0x62')](_0x81e3('0x98'));}}catch(_0x1e39ef){logger[_0x81e3('0x2e')](_0x1e39ef);}}exports[_0x81e3('0x99')]=function(_0x157c75,_0xef1721,_0x534228){return db[_0x81e3('0x30')][_0x81e3('0x49')]({'where':{'id':_0x157c75[_0x81e3('0x46')]['id']}})[_0x81e3('0x2d')](handleEntityNotFound(_0xef1721,null))['then'](saveUpdates(_0x157c75[_0x81e3('0x8d')],null))[_0x81e3('0x2d')](respondWithResult(_0xef1721,null))[_0x81e3('0x4a')](handleError(_0xef1721,null));};exports[_0x81e3('0x9a')]=function(_0x48f9ee,_0x59b166,_0x3ad954){return db[_0x81e3('0x30')][_0x81e3('0x49')]({'where':{'id':_0x48f9ee[_0x81e3('0x46')]['id']}})[_0x81e3('0x2d')](function(_0x4fcb85){if(_0x4fcb85){return _0x4fcb85[_0x81e3('0x2c')]();}})[_0x81e3('0x2d')](function(_0x1b9a56){rimraf(path['join'](config[_0x81e3('0x4d')],'server/files/plugins',path[_0x81e3('0x9b')](_0x1b9a56['path'])),function(){});return _0x1b9a56;})[_0x81e3('0x2d')](handleEntityNotFound(_0x59b166,null))[_0x81e3('0x2d')](respondWithStatusCode(_0x59b166,null))[_0x81e3('0x4a')](handleError(_0x59b166,null));};exports[_0x81e3('0x9c')]=function(_0x561c51,_0x832934,_0x4ab85f){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x2d')](function(){if(!_0x561c51[_0x81e3('0x36')][_0x81e3('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x561c51['query']['port']){throw new Error(_0x81e3('0x9e'));}var _0x3fcc5d=_0x561c51[_0x81e3('0x36')]['hostname']?_0x561c51['query']['hostname']+':'+_0x561c51['query'][_0x81e3('0x9f')]:_0x81e3('0xa0')+_0x561c51[_0x81e3('0x36')][_0x81e3('0x9f')];var _0x1457d1=_0x561c51[_0x81e3('0x36')][_0x81e3('0x21')]?_0x561c51[_0x81e3('0x36')]['json']:!![];var _0x8412e8=_0x561c51[_0x81e3('0x36')][_0x81e3('0xa1')]?_0x561c51[_0x81e3('0x36')][_0x81e3('0xa1')]:null;var _0x478761={'method':_0x561c51[_0x81e3('0xa2')],'uri':util[_0x81e3('0x60')](_0x81e3('0xa3'),_0x3fcc5d,_0x561c51[_0x81e3('0x36')]['path']),'json':_0x1457d1,'resolveWithFullResponse':!![],'encoding':_0x8412e8,'qs':_0x561c51['query']};if(_0x561c51[_0x81e3('0xa4')]){_0x478761[_0x81e3('0xa4')]=_0x561c51['headers'];if(_0x478761['headers'][_0x81e3('0xa5')]){delete _0x478761[_0x81e3('0xa4')]['content-length'];}}if(_0x478761[_0x81e3('0xa4')][_0x81e3('0xa6')]){delete _0x478761[_0x81e3('0xa4')][_0x81e3('0xa6')];}return rp(_0x478761);})[_0x81e3('0x2d')](function(_0x45d1c4){if(_0x45d1c4){_0x832934[_0x81e3('0x26')](_0x45d1c4[_0x81e3('0xa4')]);logger[_0x81e3('0x62')](_0x45d1c4['body']);if(_[_0x81e3('0xa7')](_0x561c51[_0x81e3('0x36')]['path'],_0x81e3('0x4b'))&&_0x45d1c4[_0x81e3('0xa8')]==0x1f4){return _0x832934[_0x81e3('0x1e')](_0x45d1c4['statusCode']);}else{return _0x832934[_0x81e3('0x1f')](_0x45d1c4[_0x81e3('0xa8')])[_0x81e3('0xa9')](_0x45d1c4[_0x81e3('0x8d')]);}}else{return _0x832934[_0x81e3('0x1e')](0xc8);}})[_0x81e3('0x4a')](handleError(_0x832934,null));};exports[_0x81e3('0xaa')]=function(_0x2a0f92,_0x69333a,_0x4f3feb){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x2d')](function(){if(!_0x2a0f92['query'][_0x81e3('0x5')]){throw new Error(_0x81e3('0xab'));}if(!_0x2a0f92['query'][_0x81e3('0x9f')]){throw new Error(_0x81e3('0x9e'));}var _0x304bfe=_0x2a0f92[_0x81e3('0x36')]['hostname']?_0x2a0f92[_0x81e3('0x36')][_0x81e3('0xac')]+':'+_0x2a0f92[_0x81e3('0x36')]['port']:_0x81e3('0xa0')+_0x2a0f92[_0x81e3('0x36')]['port'];var _0x3a83c6=_0x2a0f92[_0x81e3('0x36')]['json']?_0x2a0f92['query'][_0x81e3('0x21')]:!![];var _0x53a7e5=_0x2a0f92[_0x81e3('0x36')][_0x81e3('0xa1')]?_0x2a0f92[_0x81e3('0x36')]['encoding']:null;var _0x54e9ab={'method':_0x2a0f92[_0x81e3('0xa2')],'uri':util[_0x81e3('0x60')](_0x81e3('0xa3'),_0x304bfe,_0x2a0f92[_0x81e3('0x36')][_0x81e3('0x5')]),'json':_0x3a83c6,'resolveWithFullResponse':!![],'encoding':_0x53a7e5,'body':_0x2a0f92[_0x81e3('0x8d')]};if(_0x2a0f92[_0x81e3('0xa4')]){_0x54e9ab[_0x81e3('0xa4')]=_0x2a0f92[_0x81e3('0xa4')];if(_0x54e9ab['headers'][_0x81e3('0xa5')]){delete _0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa5')];}}if(_0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa6')]){delete _0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa6')];}return rp(_0x54e9ab);})[_0x81e3('0x2d')](function(_0x28d837){if(_0x28d837){_0x69333a[_0x81e3('0x26')](_0x28d837[_0x81e3('0xa4')]);logger[_0x81e3('0x62')](_0x28d837[_0x81e3('0x8d')]);return _0x69333a['status'](_0x28d837[_0x81e3('0xa8')])[_0x81e3('0xa9')](_0x28d837[_0x81e3('0x8d')]);}else{return _0x69333a[_0x81e3('0x1e')](0xc8);}})[_0x81e3('0x4a')](handleError(_0x69333a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e81ee5a..97adb8c 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 _0x0d91=['Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x10c0d9,_0x539223){var _0x5432d0=function(_0x201bf2){while(--_0x201bf2){_0x10c0d9['push'](_0x10c0d9['shift']());}};_0x5432d0(++_0x539223);}(_0x0d91,0x76));var _0x10d9=function(_0x289842,_0x2d9db4){_0x289842=_0x289842-0x0;var _0x16155a=_0x0d91[_0x289842];return _0x16155a;};'use strict';var EventEmitter=require(_0x10d9('0x0'));var Plugin=require(_0x10d9('0x1'))['db'][_0x10d9('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x10d9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x10d9('0x4'),'afterDestroy':_0x10d9('0x5')};function emitEvent(_0x132a71){return function(_0x56ab5d,_0x2f6e57,_0x305c20){PluginEvents[_0x10d9('0x6')](_0x132a71+':'+_0x56ab5d['id'],_0x56ab5d);PluginEvents['emit'](_0x132a71,_0x56ab5d);_0x305c20(null);};}for(var e in events){if(events[_0x10d9('0x7')](e)){var event=events[e];Plugin[_0x10d9('0x8')](e,emitEvent(event));}}module[_0x10d9('0x9')]=PluginEvents; \ No newline at end of file +var _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x244b7c,_0x164a27){var _0x566dcf=function(_0x528024){while(--_0x528024){_0x244b7c['push'](_0x244b7c['shift']());}};_0x566dcf(++_0x164a27);}(_0x8a8b,0xae));var _0xb8a8=function(_0x2d8948,_0x3213ca){_0x2d8948=_0x2d8948-0x0;var _0x35a057=_0x8a8b[_0x2d8948];return _0x35a057;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){PluginEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);PluginEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 8c927f9..003f498 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 _0xd50e=['path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5a208c,_0x26c27a){var _0x14371d=function(_0xadd54b){while(--_0xadd54b){_0x5a208c['push'](_0x5a208c['shift']());}};_0x14371d(++_0x26c27a);}(_0xd50e,0x13c));var _0xed50=function(_0x2d0706,_0x626a3d){_0x2d0706=_0x2d0706-0x0;var _0x365ad7=_0xd50e[_0x2d0706];return _0x365ad7;};'use strict';var _=require(_0xed50('0x0'));var util=require(_0xed50('0x1'));var logger=require('../../config/logger')(_0xed50('0x2'));var moment=require(_0xed50('0x3'));var BPromise=require(_0xed50('0x4'));var rp=require(_0xed50('0x5'));var fs=require('fs');var path=require(_0xed50('0x6'));var rimraf=require(_0xed50('0x7'));var config=require(_0xed50('0x8'));var attributes=require(_0xed50('0x9'));module[_0xed50('0xa')]=function(_0x491938,_0x2bf6e9){return _0x491938[_0xed50('0xb')](_0xed50('0xc'),attributes,{'tableName':_0xed50('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fd4=['path','rimraf','../../config/environment','./plugin.attributes','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b3676,_0x475b6e){var _0x520f66=function(_0x5477f1){while(--_0x5477f1){_0x3b3676['push'](_0x3b3676['shift']());}};_0x520f66(++_0x475b6e);}(_0x0fd4,0xa1));var _0x40fd=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x0fd4[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x40fd('0x0'));var util=require(_0x40fd('0x1'));var logger=require(_0x40fd('0x2'))(_0x40fd('0x3'));var moment=require(_0x40fd('0x4'));var BPromise=require(_0x40fd('0x5'));var rp=require(_0x40fd('0x6'));var fs=require('fs');var path=require(_0x40fd('0x7'));var rimraf=require(_0x40fd('0x8'));var config=require(_0x40fd('0x9'));var attributes=require(_0x40fd('0xa'));module['exports']=function(_0x49d4c6,_0x216f33){return _0x49d4c6['define'](_0x40fd('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 969ac68..46fd0d8 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 _0xb4c3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','create','body','options','raw','info','CreatePlugin','catch','lodash','moment','bluebird'];(function(_0x22a29e,_0xedff6b){var _0x1742b8=function(_0x15332b){while(--_0x15332b){_0x22a29e['push'](_0x22a29e['shift']());}};_0x1742b8(++_0xedff6b);}(_0xb4c3,0x115));var _0x3b4c=function(_0x46af2e,_0x30567d){_0x46af2e=_0x46af2e-0x0;var _0x5eb2df=_0xb4c3[_0x46af2e];return _0x5eb2df;};'use strict';var _=require(_0x3b4c('0x0'));var util=require('util');var moment=require(_0x3b4c('0x1'));var BPromise=require(_0x3b4c('0x2'));var rs=require(_0x3b4c('0x3'));var fs=require('fs');var Redis=require(_0x3b4c('0x4'));var db=require(_0x3b4c('0x5'))['db'];var utils=require(_0x3b4c('0x6'));var logger=require(_0x3b4c('0x7'))('rpc');var config=require(_0x3b4c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3b4c('0x9')][_0x3b4c('0xa')]({'port':0x232a});config['redis']=_[_0x3b4c('0xb')](config[_0x3b4c('0xc')],{'host':_0x3b4c('0xd'),'port':0x18eb});var socket=require(_0x3b4c('0xe'))(new Redis(config[_0x3b4c('0xc')]));require(_0x3b4c('0xf'))[_0x3b4c('0x10')](socket);function respondWithRpcPromise(_0x11fd6a,_0x4bea12,_0x55970b){return new BPromise(function(_0x477257,_0x3288eb){return client[_0x3b4c('0x11')](_0x11fd6a,_0x55970b)[_0x3b4c('0x12')](function(_0x31250a){logger['info'](_0x3b4c('0x13'),_0x4bea12,_0x3b4c('0x14'));logger[_0x3b4c('0x15')](_0x3b4c('0x16'),_0x4bea12,_0x3b4c('0x14'),JSON[_0x3b4c('0x17')](_0x31250a));if(_0x31250a['error']){if(_0x31250a['error'][_0x3b4c('0x18')]===0x1f4){logger[_0x3b4c('0x19')](_0x3b4c('0x13'),_0x4bea12,_0x31250a[_0x3b4c('0x19')][_0x3b4c('0x1a')]);return _0x3288eb(_0x31250a[_0x3b4c('0x19')][_0x3b4c('0x1a')]);}logger[_0x3b4c('0x19')](_0x3b4c('0x13'),_0x4bea12,_0x31250a[_0x3b4c('0x19')][_0x3b4c('0x1a')]);return _0x477257(_0x31250a['error'][_0x3b4c('0x1a')]);}else{logger['info'](_0x3b4c('0x13'),_0x4bea12,'request\x20sent');_0x477257(_0x31250a[_0x3b4c('0x1b')][_0x3b4c('0x1a')]);}})['catch'](function(_0x93dcb5){logger['error']('Plugin,\x20%s,\x20%s',_0x4bea12,_0x93dcb5);_0x3288eb(_0x93dcb5);});});}exports['CreatePlugin']=function(_0x6e8d15){var _0x44c99d=this;return new Promise(function(_0x326ef4,_0x18c687){return db['Plugin'][_0x3b4c('0x1c')](_0x6e8d15[_0x3b4c('0x1d')],{'raw':_0x6e8d15[_0x3b4c('0x1e')]?_0x6e8d15[_0x3b4c('0x1e')][_0x3b4c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x470135){logger[_0x3b4c('0x20')](_0x3b4c('0x21'),_0x6e8d15);logger[_0x3b4c('0x15')]('CreatePlugin',_0x6e8d15,JSON['stringify'](_0x470135));_0x326ef4(_0x470135);})[_0x3b4c('0x22')](function(_0x299e7f){logger['error'](_0x3b4c('0x21'),_0x299e7f['message'],_0x6e8d15);_0x18c687(_0x44c99d[_0x3b4c('0x19')](0x1f4,_0x299e7f[_0x3b4c('0x1a')]));});});}; \ No newline at end of file +var _0x9a09=['Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','create','body','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4dd5e4,_0x29bed0){var _0x2049cb=function(_0x3befe4){while(--_0x3befe4){_0x4dd5e4['push'](_0x4dd5e4['shift']());}};_0x2049cb(++_0x29bed0);}(_0x9a09,0x19d));var _0x99a0=function(_0x4a0a7d,_0x277822){_0x4a0a7d=_0x4a0a7d-0x0;var _0x4eb3e5=_0x9a09[_0x4a0a7d];return _0x4eb3e5;};'use strict';var _=require(_0x99a0('0x0'));var util=require(_0x99a0('0x1'));var moment=require(_0x99a0('0x2'));var BPromise=require(_0x99a0('0x3'));var rs=require(_0x99a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x99a0('0x5'));var logger=require(_0x99a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x99a0('0x7')][_0x99a0('0x8')]({'port':0x232a});config[_0x99a0('0x9')]=_[_0x99a0('0xa')](config['redis'],{'host':_0x99a0('0xb'),'port':0x18eb});var socket=require(_0x99a0('0xc'))(new Redis(config[_0x99a0('0x9')]));require(_0x99a0('0xd'))[_0x99a0('0xe')](socket);function respondWithRpcPromise(_0xce117a,_0x362e61,_0x5a8e52){return new BPromise(function(_0x57945a,_0x11cb98){return client[_0x99a0('0xf')](_0xce117a,_0x5a8e52)[_0x99a0('0x10')](function(_0xebe2cb){logger[_0x99a0('0x11')](_0x99a0('0x12'),_0x362e61,_0x99a0('0x13'));logger[_0x99a0('0x14')](_0x99a0('0x15'),_0x362e61,'request\x20sent',JSON['stringify'](_0xebe2cb));if(_0xebe2cb[_0x99a0('0x16')]){if(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x17')]===0x1f4){logger['error'](_0x99a0('0x12'),_0x362e61,_0xebe2cb[_0x99a0('0x16')]['message']);return _0x11cb98(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x18')]);}logger[_0x99a0('0x16')](_0x99a0('0x12'),_0x362e61,_0xebe2cb[_0x99a0('0x16')]['message']);return _0x57945a(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x18')]);}else{logger['info'](_0x99a0('0x12'),_0x362e61,_0x99a0('0x13'));_0x57945a(_0xebe2cb[_0x99a0('0x19')][_0x99a0('0x18')]);}})[_0x99a0('0x1a')](function(_0x274bd6){logger[_0x99a0('0x16')]('Plugin,\x20%s,\x20%s',_0x362e61,_0x274bd6);_0x11cb98(_0x274bd6);});});}exports[_0x99a0('0x1b')]=function(_0x40f319){var _0x2d02e0=this;return new Promise(function(_0x2146ae,_0x254250){return db['Plugin'][_0x99a0('0x1c')](_0x40f319[_0x99a0('0x1d')],{'raw':_0x40f319['options']?_0x40f319['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22953a){logger[_0x99a0('0x11')](_0x99a0('0x1b'),_0x40f319);logger['debug'](_0x99a0('0x1b'),_0x40f319,JSON[_0x99a0('0x1e')](_0x22953a));_0x2146ae(_0x22953a);})['catch'](function(_0x45f429){logger[_0x99a0('0x16')](_0x99a0('0x1b'),_0x45f429[_0x99a0('0x18')],_0x40f319);_0x254250(_0x2d02e0['error'](0x1f4,_0x45f429[_0x99a0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1790ffd..3ae88b3 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 _0xbee2=['removeListener','register','length','save','remove','emit'];(function(_0x16a807,_0x37c16d){var _0x110c4e=function(_0x1e4e1a){while(--_0x1e4e1a){_0x16a807['push'](_0x16a807['shift']());}};_0x110c4e(++_0x37c16d);}(_0xbee2,0x1ad));var _0x2bee=function(_0x39d024,_0x5c5797){_0x39d024=_0x39d024-0x0;var _0x311bdd=_0xbee2[_0x39d024];return _0x311bdd;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2bee('0x0'),_0x2bee('0x1'),'update'];function createListener(_0x4d12b8,_0x398d0b){return function(_0x3dcad1){_0x398d0b[_0x2bee('0x2')](_0x4d12b8,_0x3dcad1);};}function removeListener(_0x9ebad9,_0x39377f){return function(){PluginEvents[_0x2bee('0x3')](_0x9ebad9,_0x39377f);};}exports[_0x2bee('0x4')]=function(_0x29ec77){for(var _0x5253fa=0x0,_0x88a12c=events[_0x2bee('0x5')];_0x5253fa<_0x88a12c;_0x5253fa++){var _0x9e6b04=events[_0x5253fa];var _0x58aac8=createListener('plugin:'+_0x9e6b04,_0x29ec77);PluginEvents['on'](_0x9e6b04,_0x58aac8);}}; \ No newline at end of file +var _0xd241=['removeListener','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x203c97,_0x231c73){var _0x5b53b3=function(_0x4778fe){while(--_0x4778fe){_0x203c97['push'](_0x203c97['shift']());}};_0x5b53b3(++_0x231c73);}(_0xd241,0xfb));var _0x1d24=function(_0x55489a,_0x1cbc72){_0x55489a=_0x55489a-0x0;var _0x37d80f=_0xd241[_0x55489a];return _0x37d80f;};'use strict';var PluginEvents=require(_0x1d24('0x0'));var events=[_0x1d24('0x1'),_0x1d24('0x2'),_0x1d24('0x3')];function createListener(_0x5826a0,_0x159c68){return function(_0xee2581){_0x159c68[_0x1d24('0x4')](_0x5826a0,_0xee2581);};}function removeListener(_0x2c9f8f,_0x2819f4){return function(){PluginEvents[_0x1d24('0x5')](_0x2c9f8f,_0x2819f4);};}exports['register']=function(_0x4d7cbc){for(var _0x3244c2=0x0,_0x3a1a33=events[_0x1d24('0x6')];_0x3244c2<_0x3a1a33;_0x3244c2++){var _0x3e2ce1=events[_0x3244c2];var _0x4f1d35=createListener(_0x1d24('0x7')+_0x3e2ce1,_0x4d7cbc);PluginEvents['on'](_0x3e2ce1,_0x4f1d35);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 08121ea..2556492 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(_0x20dd46,_0x5d8cc9){var _0x41985b=function(_0x4c0852){while(--_0x4c0852){_0x20dd46['push'](_0x20dd46['shift']());}};_0x41985b(++_0x5d8cc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0xe561fd,_0x39fe5a){var _0x410944=function(_0x3df5dd){while(--_0x3df5dd){_0xe561fd['push'](_0xe561fd['shift']());}};_0x410944(++_0x39fe5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 ca021dc..f0c34b7 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 _0x6f0d=['../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','send','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script'];(function(_0x1e0c1c,_0x405957){var _0x28af87=function(_0x22e186){while(--_0x22e186){_0x1e0c1c['push'](_0x1e0c1c['shift']());}};_0x28af87(++_0x405957);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x870d08,_0x592f6a){_0x870d08=_0x870d08-0x0;var _0x4b8f1d=_0x6f0d[_0x870d08];return _0x4b8f1d;};'use strict';var _=require('lodash');var pm2=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var path=require(_0xd6f0('0x3'));var exec=require('child_process')[_0xd6f0('0x4')];var BPromise=require(_0xd6f0('0x5'));function handleEntityNotFound(_0x2f78fb,_0x25344b){return function(_0x3a757f){if(!_0x3a757f){_0x2f78fb['sendStatus'](0x194);;}return _0x3a757f;};}function respondWithResult(_0x2d2ce6,_0x4a8b0c){_0x4a8b0c=_0x4a8b0c||0xc8;return function(_0xe21ac4){if(_0xe21ac4){return _0x2d2ce6[_0xd6f0('0x6')](_0x4a8b0c)[_0xd6f0('0x7')](_0xe21ac4);}return null;};}function handleError(_0x1a48a0,_0x4c4916){_0x4c4916=_0x4c4916||0x1f4;return function(_0x507048){logger[_0xd6f0('0x8')](_0x507048[_0xd6f0('0x9')]);if(_0x507048[_0xd6f0('0xa')]){delete _0x507048[_0xd6f0('0xa')];}_0x1a48a0[_0xd6f0('0x6')](_0x4c4916)['send'](_0x507048);};}function execChildProcess(){return new BPromise(function(_0x136eee,_0xee144c){exec(_0xd6f0('0xb'),function(_0x44bba6,_0x4d10a1,_0x1ce8d5){logger[_0xd6f0('0xc')](_0x4d10a1);logger[_0xd6f0('0xc')](_0x1ce8d5);if(_0x44bba6){logger[_0xd6f0('0x8')](_0x44bba6);return _0xee144c(_0x44bba6);}return _0x136eee(_0x4d10a1);});});}exports[_0xd6f0('0xd')]=function(_0x409549,_0x2bf5b8){return pm2[_0xd6f0('0xe')]()[_0xd6f0('0xf')](function(_0x4ab979){if(_0x4ab979){var _0x2b3f32=_[_0xd6f0('0x10')](_0x4ab979,function(_0x4c1559){return _0x4c1559[_0xd6f0('0xa')]==='express'||_0x4c1559[_0xd6f0('0xa')]===_0xd6f0('0x11');});return{'rows':_0x2b3f32,'count':_0x2b3f32[_0xd6f0('0x12')]};}return null;})[_0xd6f0('0xf')](respondWithResult(_0x2bf5b8,null))[_0xd6f0('0x13')](handleError(_0x2bf5b8,null));};exports[_0xd6f0('0x14')]=function(_0x25da0c,_0x29fbb9){return pm2[_0xd6f0('0x15')](_0x25da0c[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x29fbb9,null))[_0xd6f0('0xf')](handleEntityNotFound(_0x29fbb9,null))[_0xd6f0('0x13')](handleError(_0x29fbb9,null));};exports[_0xd6f0('0x17')]=function(_0x1f43d7,_0xde87d4){if(_0x1f43d7['body']['name']&&_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0x19')]){var _0x1158dc=path['join'](__dirname,_0xd6f0('0x1a'),_0x1f43d7[_0xd6f0('0x18')]['script']);var _0x86dde0=process['cwd']();process[_0xd6f0('0x1b')](path[_0xd6f0('0x1c')](_0x1158dc));return execChildProcess()['then'](function(_0xb9e820){process[_0xd6f0('0x1b')](_0x86dde0);return pm2['start']({'name':_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0xa')],'script':_0x1158dc});})[_0xd6f0('0xf')](function(_0x5b1a62){pm2[_0xd6f0('0x1d')]();return _0x5b1a62[0x0];})[_0xd6f0('0xf')](respondWithResult(_0xde87d4,0xc9))['catch'](handleError(_0xde87d4,null));}else{return _0xde87d4[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x1e')});}};exports[_0xd6f0('0x1f')]=function(_0x1630dc,_0x3c1bff){if(_0x1630dc[_0xd6f0('0x18')]['id']){delete _0x1630dc[_0xd6f0('0x18')]['id'];}var _0x12d6ec={'online':_0xd6f0('0x20'),'stopped':'stop'};if(_0x12d6ec[_0xd6f0('0x21')](_0x1630dc[_0xd6f0('0x18')]['status'])){return pm2[_0x12d6ec[_0x1630dc[_0xd6f0('0x18')][_0xd6f0('0x6')]]](_0x1630dc[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x3c1bff,0xc8))[_0xd6f0('0x13')](handleError(_0x3c1bff,null));}else{return _0x3c1bff[_0xd6f0('0x6')](0x1f4)[_0xd6f0('0x22')]({'message':_0xd6f0('0x23')});}};exports[_0xd6f0('0x24')]=function(_0x43f72f,_0x1dff9b){if(_0x43f72f[_0xd6f0('0x18')]['id']){delete _0x43f72f[_0xd6f0('0x18')]['id'];}if(_0x43f72f[_0xd6f0('0x16')]['id']){return pm2[_0xd6f0('0x25')](_0x43f72f[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](function(_0x376890){pm2[_0xd6f0('0x1d')]();return _0x376890[0x0];})[_0xd6f0('0xf')](respondWithResult(_0x1dff9b,null))[_0xd6f0('0x13')](handleError(_0x1dff9b,null));}else{return _0x1dff9b[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x26')});}}; \ No newline at end of file +var _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x4251d9,_0x4a726d){var _0x14f0cb=function(_0x44e558){while(--_0x44e558){_0x4251d9['push'](_0x4251d9['shift']());}};_0x14f0cb(++_0x4a726d);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index bfee249..4f4c9f7 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 _0xea50=['exports','express','Router','../../components/auth/service','get','getAgents','/queues','isAuthenticated','getQueues'];(function(_0x17d93e,_0x34b7be){var _0x45741f=function(_0x47ee92){while(--_0x47ee92){_0x17d93e['push'](_0x17d93e['shift']());}};_0x45741f(++_0x34b7be);}(_0xea50,0x76));var _0x0ea5=function(_0x592e9e,_0x3a9301){_0x592e9e=_0x592e9e-0x0;var _0x1dda1c=_0xea50[_0x592e9e];return _0x1dda1c;};'use strict';var express=require(_0x0ea5('0x0'));var router=express[_0x0ea5('0x1')]();var auth=require(_0x0ea5('0x2'));var controller=require('./realtime.controller');router[_0x0ea5('0x3')]('/agents',auth['isAuthenticated'](),controller[_0x0ea5('0x4')]);router[_0x0ea5('0x3')](_0x0ea5('0x5'),auth[_0x0ea5('0x6')](),controller[_0x0ea5('0x7')]);module[_0x0ea5('0x8')]=router; \ No newline at end of file +var _0x4435=['isAuthenticated','getQueues','Router','./realtime.controller','get','getAgents','/queues'];(function(_0x174b62,_0x316871){var _0x358adf=function(_0x1a3adf){while(--_0x1a3adf){_0x174b62['push'](_0x174b62['shift']());}};_0x358adf(++_0x316871);}(_0x4435,0xb8));var _0x5443=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x4435[_0xd0b415];return _0x2bdf2c;};'use strict';var express=require('express');var router=express[_0x5443('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5443('0x1'));router[_0x5443('0x2')]('/agents',auth['isAuthenticated'](),controller[_0x5443('0x3')]);router[_0x5443('0x2')](_0x5443('0x4'),auth[_0x5443('0x5')](),controller[_0x5443('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 7ff3fce..2c30b4d 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 _0x66ad=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','find','merge','pick','filter','length','some','connectedlinenum','internal','toString','getMembers','UserId','online','voiceStatus','loggedInDb','busy','agents','User','findAll','includes','Invalid\x20channel','toLowerCase','getAgents','getChannels','query','globalStatusFilter','resolve','channel','sort','globalStatus','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','map','rawAttributes','type','role','agent','raw','literal','Pause','where','user','userProfileId','Agents','assign','UserProfile','getResources','findAndCountAll','rows','filterAgentAttributes','getAgentStatus','pause','forEach','Status','sortAgentsByStatus','getQueues','Queue','fieldName','getOptions','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','json','error','stack','name','send','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','Trunk','startPredictive','startProgressive'];(function(_0x2a9c27,_0x43433e){var _0x3f6be1=function(_0x368262){while(--_0x368262){_0x2a9c27['push'](_0x2a9c27['shift']());}};_0x3f6be1(++_0x43433e);}(_0x66ad,0x1b7));var _0xd66a=function(_0x24621f,_0x1f098a){_0x24621f=_0x24621f-0x0;var _0x3f0262=_0x66ad[_0x24621f];return _0x3f0262;};'use strict';var util=require(_0xd66a('0x0'));var _=require(_0xd66a('0x1'));var jayson=require(_0xd66a('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0xd66a('0x3'));var utils=require('../../config/utils');var logger=require(_0xd66a('0x4'))(_0xd66a('0x5'));var db=require(_0xd66a('0x6'))['db'];var amiClient=jayson[_0xd66a('0x7')][_0xd66a('0x8')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x33722a,_0x459948){return function(_0x48342b){if(_0x48342b){var _0x5ad5e6=typeof _0x459948[_0xd66a('0x9')]===_0xd66a('0xa')&&typeof _0x459948['limit']===_0xd66a('0xa');var _0x1c43a5=_0x48342b[_0xd66a('0xb')];var _0x430ca3=_0x5ad5e6?0x0:_0x459948[_0xd66a('0x9')];var _0x35fe1a=_0x5ad5e6?_0x48342b[_0xd66a('0xb')]:_0x459948[_0xd66a('0x9')]+_0x459948[_0xd66a('0xc')];var _0x3a158d;if(_0x35fe1a>=_0x1c43a5){_0x35fe1a=_0x1c43a5;_0x3a158d=0xc8;}else{_0x3a158d=0xce;}_0x33722a[_0xd66a('0xd')](_0x3a158d);return _0x33722a[_0xd66a('0xe')](_0xd66a('0xf'),_0x430ca3+'-'+_0x35fe1a+'/'+_0x1c43a5)[_0xd66a('0x10')](_0x48342b);}return null;};}function handleError(_0x40ef64,_0x476737){_0x476737=_0x476737||0x1f4;return function(_0x144bf3){logger[_0xd66a('0x11')](_0x144bf3[_0xd66a('0x12')]);if(_0x144bf3['name']){delete _0x144bf3[_0xd66a('0x13')];}_0x40ef64[_0xd66a('0xd')](_0x476737)[_0xd66a('0x14')](_0x144bf3);};}function getRealtimeQueues(_0x5ba45e,_0x681159){return new Promise(function(_0xb07e3d,_0x47c134){var _0x5ace78=_0x681159===_0xd66a('0x15')?amiClient:routingClient;return _0x5ace78[_0xd66a('0x16')](_[_0xd66a('0x17')](_0x681159)+_0xd66a('0x18'),_0x5ba45e)[_0xd66a('0x19')](function(_0x336d78){if(_0x336d78[_0xd66a('0x11')])throw new Error(util[_0xd66a('0x1a')](_0xd66a('0x1b'),_0x681159));return _0xb07e3d(_0x336d78[_0xd66a('0x1c')]);})[_0xd66a('0x1d')](function(_0x23f1cb){_0x47c134(_0x23f1cb);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x190a08,_0x4b5e5d){return amiClient[_0xd66a('0x16')](_0xd66a('0x1e'),{})[_0xd66a('0x19')](function(_0x250e82){if(_0x250e82[_0xd66a('0x11')])throw new Error(_0xd66a('0x1f'));return _0x190a08(_0x250e82[_0xd66a('0x1c')]);})[_0xd66a('0x1d')](function(_0x1786f0){_0x4b5e5d(_0x1786f0);});});}function initializeQueues(_0x8b3431,_0x2882f4,_0x2709b7,_0x206d15){var _0x50c995=[_0xd66a('0x20'),_0xd66a('0x21'),_0xd66a('0x22'),_0xd66a('0x23'),_0xd66a('0x24')];if(_0x2709b7===_0xd66a('0x15')&&_0x206d15===_0xd66a('0x25')){_0x50c995[_0xd66a('0x26')](_0xd66a('0x27'),_0xd66a('0x28'),_0xd66a('0x29'),'dialActive','dialMethod',_0xd66a('0x2a'),_0xd66a('0x2b'),_0xd66a('0x2c'),_0xd66a('0x2d'),_0xd66a('0x2e'),_0xd66a('0x2f'),_0xd66a('0x30'),_0xd66a('0x31'),'dialPredictiveIntervalMaxThreshold',_0xd66a('0x32'),_0xd66a('0x33'),_0xd66a('0x34'),_0xd66a('0x35'),'predictiveIntervalDroppedCallsTimeout',_0xd66a('0x36'),'predictiveIntervalAvgHoldtime',_0xd66a('0x37'));}return _0x8b3431['map'](function(_0x1c43e5){var _0x11018e=_0x1c43e5['get']({'plain':!![]});_0x11018e['agents']=[];_0x11018e[_0xd66a('0x24')]=0x0;_0x11018e['loggedInDb']=0x0;_0x11018e['loggedIn']=0x0;_0x11018e[_0xd66a('0x21')]=0x0;_0x11018e[_0xd66a('0x22')]=0x0;if(_0x2709b7===_0xd66a('0x15')){_0x11018e[_0xd66a('0x23')]=0x0;_0x11018e['busy']=0x0;if(_0x206d15===_0xd66a('0x25')){_0x11018e[_0xd66a('0x27')]=0x0;_0x11018e[_0xd66a('0x28')]=0x0;}}var _0x4e7b81=_[_0xd66a('0x38')](_0x2882f4,['id',_0x11018e['id']]);if(_0x4e7b81)_[_0xd66a('0x39')](_0x11018e,_[_0xd66a('0x3a')](_0x4e7b81,_0x50c995));return _0x11018e;});}function updateAgentVoiceStatus(_0x3517b5,_0x71d2e,_0x2957ec){var _0xb1e285=_[_0xd66a('0x3b')](_0x2957ec,['queue',_0x71d2e[_0xd66a('0x13')]]);if(_0xb1e285[_0xd66a('0x3c')]===0x0)return _0x3517b5['busy']=!![];if(_[_0xd66a('0x3d')](_0xb1e285,[_0xd66a('0x3e'),_0x3517b5[_0xd66a('0x3f')][_0xd66a('0x40')]()]))return _0x3517b5[_0xd66a('0x23')]=!![];if(!_0x3517b5[_0xd66a('0x23')])return _0x3517b5['busy']=!![];}function getVoiceQueueAgents(_0x2ea128,_0x59c2f6,_0x28ea13,_0x52756b){var _0x2b290f=_[_0xd66a('0x38')](_0x59c2f6,['id',_0x2ea128['id']]);if(!_0x2b290f)return _0x2ea128;return _0x2b290f[_0xd66a('0x41')]({'raw':!![]})[_0xd66a('0x19')](function(_0x1b1098){for(var _0x1fda99=0x0;_0x1fda99<_0x1b1098['length'];_0x1fda99++){var _0x573e15=_['find'](_0x28ea13,['id',_0x1b1098[_0x1fda99][_0xd66a('0x42')]]);if(!_0x573e15){_0x573e15={'id':_0x1b1098[_0x1fda99]['UserId'],'name':_0x1b1098[_0x1fda99]['UserId'],'accountcode':'','online':![]};}var _0x156dc7={'id':_0x573e15['id'],'name':_0x573e15[_0xd66a('0x13')],'internal':_0x573e15['accountcode'],'online':Boolean(_0x573e15[_0xd66a('0x43')]),'paused':Boolean(_0x1b1098[_0x1fda99][_0xd66a('0x24')])};if(_0x573e15[_0xd66a('0x44')]===_0xd66a('0x23'))updateAgentVoiceStatus(_0x156dc7,_0x2ea128,_0x52756b);if(_0x156dc7[_0xd66a('0x43')])_0x2ea128[_0xd66a('0x45')]++;if(_0x156dc7['busy'])_0x2ea128[_0xd66a('0x46')]++;if(_0x156dc7[_0xd66a('0x24')]&&!_0x156dc7[_0xd66a('0x46')]&&!_0x156dc7[_0xd66a('0x23')])_0x2ea128[_0xd66a('0x24')]++;_0x2ea128[_0xd66a('0x47')][_0xd66a('0x26')](_0x156dc7);}return _0x2ea128;});}function getQueueAgents(_0x502ae8,_0x4cc361,_0x589599){var _0x10ea3f=_0xd66a('0x48')+_[_0xd66a('0x17')](_0x589599)+'Queue';var _0x1231df=_0x589599+'Pause';return db[_0x10ea3f][_0xd66a('0x49')]({'where':{[_[_0xd66a('0x17')](_0x589599)+'QueueId']:_0x502ae8['id']},'raw':!![]})[_0xd66a('0x19')](function(_0xbd3306){for(var _0x5ccde1=0x0;_0x5ccde1<_0xbd3306[_0xd66a('0x3c')];_0x5ccde1++){var _0x2d1fb7=_['find'](_0x4cc361,['id',_0xbd3306[_0x5ccde1][_0xd66a('0x42')]]);if(!_0x2d1fb7){_0x2d1fb7={'id':_0xbd3306[_0x5ccde1][_0xd66a('0x42')],'name':_0xbd3306[_0x5ccde1][_0xd66a('0x42')],'online':![],['pauseField']:![]};}var _0x2e9d63={'id':_0x2d1fb7['id'],'name':_0x2d1fb7[_0xd66a('0x13')],'online':Boolean(_0x2d1fb7['online']),'paused':Boolean(_0x2d1fb7[_0x1231df])};if(_0x2e9d63[_0xd66a('0x43')])_0x502ae8[_0xd66a('0x45')]++;_0x502ae8[_0xd66a('0x47')]['push'](_0x2e9d63);}return _0x502ae8;});}function validateChannel(_0x37629a){var _0x408675=utils['getChannels']();if(!_[_0xd66a('0x4a')](_0x408675,_0x37629a['toLowerCase']()))throw new Error(_0xd66a('0x4b'));return _0x37629a[_0xd66a('0x4c')]();}exports[_0xd66a('0x4d')]=function(_0x391245,_0x85b269){var _0x15cfaf={'count':0x0,'rows':[]};var _0x23131f={};var _0x232bc6;var _0x180f9c;var _0x4d4f23;var _0x54c21a;var _0x14b4b8=utils[_0xd66a('0x4e')]();var _0x1123c9=_0x391245[_0xd66a('0x4f')]['globalQueueFilter'];var _0xa8f4b9=_0x391245[_0xd66a('0x4f')][_0xd66a('0x50')];var _0x4f79fd=_0x391245[_0xd66a('0x4f')]['pauseTypeFilter'];var _0x2573ed=_0xa8f4b9==='pause'||_0xa8f4b9==='*pause'?!![]:![];var _0x1a39b1=[];var _0x36e8dd;Promise[_0xd66a('0x51')]()['then'](function(){if(_0x391245[_0xd66a('0x4f')][_0xd66a('0x52')]){_0x232bc6=validateChannel(_0x391245[_0xd66a('0x4f')]['channel']);}if(!_0x391245[_0xd66a('0x4f')][_0xd66a('0x53')]||!_0x391245[_0xd66a('0x4f')][_0xd66a('0x53')][_0xd66a('0x4a')](_0xd66a('0x54'))){_0x391245[_0xd66a('0x4f')][_0xd66a('0x53')]=rta[_0xd66a('0x55')](_0x391245[_0xd66a('0x4f')][_0xd66a('0x53')]);return;}var _0x3429e5=rta['getUpdatedSortOptions'](_0x391245[_0xd66a('0x4f')]['sort']);_0x391245[_0xd66a('0x4f')][_0xd66a('0x53')]=_0x3429e5[_0xd66a('0x56')][_0xd66a('0x57')](',');_0x180f9c=_0x3429e5[_0xd66a('0x58')];})[_0xd66a('0x19')](function(){if(!_0x1123c9){return[];}return rta[_0xd66a('0x59')](_0x1123c9,_0x232bc6);})[_0xd66a('0x19')](function(_0x2e3ad9){_0x1a39b1=_0x2e3ad9;return rta[_0xd66a('0x5a')]();})[_0xd66a('0x19')](function(_0x6f9652){_0x54c21a=_0x6f9652['rows'];if((!_0xa8f4b9||_0x2573ed)&&!_0x180f9c){return _0x1a39b1;}if(_0x180f9c&&!_0xa8f4b9){return rta[_0xd66a('0x5b')](_0x54c21a,_0x1a39b1,_0x180f9c);}else{return rta['getAgentIdsByStatus'](_0x54c21a,_0x1a39b1,_0xa8f4b9);}})[_0xd66a('0x19')](function(_0x26047a){_0x1a39b1=_0x26047a;var _0x563b64=![];if(_0x1a39b1[_0xd66a('0x3c')]===0x0){if(_0x1123c9||_0xa8f4b9){_0x563b64=!![];}if(_0x2573ed){_0x563b64=![];}}if(_0x563b64){return _0x15cfaf;}var _0x1f41c5=_[_0xd66a('0x5c')](db[_0xd66a('0x48')][_0xd66a('0x5d')],function(_0x4507ca){return{'name':_0x4507ca['fieldName'],'type':_0x4507ca[_0xd66a('0x5e')]['key']};});_0x391245[_0xd66a('0x4f')][_0xd66a('0x5f')]=_0xd66a('0x60');_0x391245['query'][_0xd66a('0x43')]=!![];_0x23131f=qs['getOptions'](_0x1f41c5,_0x391245);_0x23131f[_0xd66a('0x61')]=!![];var _0x4de24c=[];if(_0x1a39b1[_0xd66a('0x3c')]>0x0){_0x4de24c['push']({'id':{'$in':_0x1a39b1}});if(_0x180f9c&&!_0xa8f4b9){_0x36e8dd=[db['sequelize'][_0xd66a('0x62')]('FIELD(id,'+_0x1a39b1+')')];_0x23131f['order']=_0x36e8dd;}}if(_0x2573ed){_0x14b4b8['forEach'](function(_0xb5297b){var _0x47aed6=!![];if(_0xa8f4b9==='*pause'&&_0x232bc6!==_0xb5297b){_0x47aed6=![];}_0x4de24c[_0xd66a('0x26')]({[_0xb5297b+_0xd66a('0x63')]:_0x47aed6});});if(_0x4f79fd){_0x4de24c[_0xd66a('0x26')]({'pauseType':_0x4f79fd});}}else if(_0xa8f4b9){_0x14b4b8['forEach'](function(_0x349654){_0x4de24c[_0xd66a('0x26')]({[_0x349654+_0xd66a('0x63')]:![]});});}_0x23131f['where']=_[_0xd66a('0x39')](_0x23131f[_0xd66a('0x64')],{'$and':_0x4de24c});if(_0x391245[_0xd66a('0x65')][_0xd66a('0x5f')]===_0xd66a('0x65')){var _0x6d655d={'params':{'id':_0x391245[_0xd66a('0x65')][_0xd66a('0x66')]},'query':{'section':_0xd66a('0x67'),'role':_0xd66a('0x60'),'online':!![],'raw':!![],'ids':_0x1a39b1,'customSorting':_0x36e8dd}};if(_0x2573ed){_0x6d655d[_0xd66a('0x4f')]['extraQueryConditions']=_0x4de24c;}_0x6d655d['query']=Object[_0xd66a('0x68')](_0x6d655d[_0xd66a('0x4f')],_0x391245[_0xd66a('0x4f')]);delete _0x6d655d['query']['id'];return db[_0xd66a('0x69')][_0xd66a('0x6a')](_0x6d655d);}return db[_0xd66a('0x48')][_0xd66a('0x6b')](_0x23131f);})['then'](function(_0x2b6f4f){_0x15cfaf[_0xd66a('0xb')]=_0x2b6f4f[_0xd66a('0xb')];_0x4d4f23=_0x2b6f4f[_0xd66a('0x6c')];return _0x4d4f23[_0xd66a('0x5c')](function(_0x49b1d4){var _0x3540bc=_['find'](_0x54c21a,['id',_0x49b1d4['id']]);if(_0x3540bc){var _0x37a5a1=rta[_0xd66a('0x6d')](_0x3540bc);_[_0xd66a('0x39')](_0x49b1d4,_0x37a5a1);}_0x49b1d4[_0xd66a('0x54')]=rta[_0xd66a('0x6e')](_0x49b1d4);if(_0x49b1d4[_0xd66a('0x54')]['includes'](_0xd66a('0x6f'))){_0x14b4b8[_0xd66a('0x70')](function(_0x2e6e07){if(_0x49b1d4[_0x2e6e07+_0xd66a('0x63')]){_0x49b1d4[_0x2e6e07+_0xd66a('0x71')]='pause';}});}return _0x49b1d4;});})[_0xd66a('0x19')](function(_0x3c25a1){if(!_0x180f9c||_0x36e8dd){return _0x3c25a1;}return rta[_0xd66a('0x72')](_0x3c25a1,_0x180f9c);})[_0xd66a('0x19')](function(_0x848252){_0x15cfaf['rows']=_0x848252;return _0x15cfaf;})[_0xd66a('0x19')](respondWithFilteredResult(_0x85b269,_0x23131f))[_0xd66a('0x1d')](handleError(_0x85b269,null));};exports[_0xd66a('0x73')]=function(_0x4b2b04,_0x269d42){var _0x20974d={'count':0x0,'rows':[]},_0x1cf57a={},_0x56a7a3,_0x32423d,_0x40c930,_0x3ec29c,_0xb2d109;Promise[_0xd66a('0x51')]()[_0xd66a('0x19')](function(){if(_0x4b2b04[_0xd66a('0x4f')][_0xd66a('0x52')])_0x56a7a3=validateChannel(_0x4b2b04[_0xd66a('0x4f')][_0xd66a('0x52')]);var _0x56d820=_['startCase'](_0x56a7a3)+_0xd66a('0x74');var _0xb2309b=_[_0xd66a('0x5c')](db[_0x56d820][_0xd66a('0x5d')],function(_0x5ca166){return{'name':_0x5ca166[_0xd66a('0x75')],'type':_0x5ca166['type']['key']};});_0x1cf57a=qs[_0xd66a('0x76')](_0xb2309b,_0x4b2b04);if(_0x4b2b04[_0xd66a('0x65')]['role']===_0xd66a('0x65')){var _0x301963={'params':{'id':_0x4b2b04['user'][_0xd66a('0x66')]},'query':{'section':_0x56a7a3==='voice'&&_0x4b2b04[_0xd66a('0x4f')][_0xd66a('0x5e')]===_0xd66a('0x25')?_0xd66a('0x77'):_[_0xd66a('0x17')](_0x56a7a3)+_0xd66a('0x18'),'type':_0x4b2b04[_0xd66a('0x4f')]['type'],'nolimit':!![],'sort':'name','filter':_0x4b2b04[_0xd66a('0x4f')]['filter']}};return db['UserProfile'][_0xd66a('0x6a')](_0x301963);}return db[_0x56d820][_0xd66a('0x6b')](_0x1cf57a);})['then'](function(_0x849ee){_0x20974d[_0xd66a('0xb')]=_0x849ee[_0xd66a('0xb')];_0x32423d=_0x849ee[_0xd66a('0x6c')];return getRealtimeQueues(_0x4b2b04,_0x56a7a3);})[_0xd66a('0x19')](function(_0x16fe77){_0x3ec29c=_0x16fe77[_0xd66a('0x6c')];return rta[_0xd66a('0x5a')]();})[_0xd66a('0x19')](function(_0x3ddfa0){_0x40c930=_0x3ddfa0['rows'];if(_0x56a7a3!=_0xd66a('0x15'))return;return getRealtimeVoiceQueueChannels();})[_0xd66a('0x19')](function(_0x1c43e4){_0xb2d109=_0x1c43e4?_0x1c43e4['rows']:[];return initializeQueues(_0x32423d,_0x3ec29c,_0x56a7a3,_0x4b2b04[_0xd66a('0x4f')][_0xd66a('0x5e')]);})['then'](function(_0x1b3e51){var _0x40e76e=_0x1b3e51['map'](function(_0x13b121){if(_0x56a7a3===_0xd66a('0x15'))return getVoiceQueueAgents(_0x13b121,_0x32423d,_0x40c930,_0xb2d109);else return getQueueAgents(_0x13b121,_0x40c930,_0x56a7a3);});return Promise[_0xd66a('0x78')](_0x40e76e);})[_0xd66a('0x19')](function(_0x100e6d){_0x20974d[_0xd66a('0x6c')]=_0x100e6d;return _0x20974d;})[_0xd66a('0x19')](respondWithFilteredResult(_0x269d42,_0x1cf57a))[_0xd66a('0x1d')](handleError(_0x269d42,null));}; \ No newline at end of file +var _0xc9cf=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','paused','outbound','push','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','agents','loggedInDb','voice','find','pick','filter','queue','length','busy','some','connectedlinenum','internal','getMembers','UserId','accountcode','Queue','findAll','startCase','QueueId','online','getChannels','includes','toLowerCase','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','channel','sort','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','User','rawAttributes','fieldName','type','key','role','agent','raw','FIELD(id,','Pause','forEach','where','merge','user','userProfileId','extraQueryConditions','assign','UserProfile','filterAgentAttributes','globalStatus','getAgentStatus','Status','sortAgentsByStatus','getQueues','resolve','getOptions','QueueCampaigns','getResources','findAndCountAll','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','Queues','then','format'];(function(_0x240776,_0xeefa88){var _0x58d284=function(_0x282097){while(--_0x282097){_0x240776['push'](_0x240776['shift']());}};_0x58d284(++_0xeefa88);}(_0xc9cf,0x1cd));var _0xfc9c=function(_0x16b13d,_0x2faf09){_0x16b13d=_0x16b13d-0x0;var _0x1f1e77=_0xc9cf[_0x16b13d];return _0x1f1e77;};'use strict';var util=require(_0xfc9c('0x0'));var _=require(_0xfc9c('0x1'));var jayson=require(_0xfc9c('0x2'));var rta=require(_0xfc9c('0x3'));var qs=require(_0xfc9c('0x4'));var utils=require(_0xfc9c('0x5'));var logger=require(_0xfc9c('0x6'))(_0xfc9c('0x7'));var db=require(_0xfc9c('0x8'))['db'];var amiClient=jayson[_0xfc9c('0x9')][_0xfc9c('0xa')]({'port':0x232a});var routingClient=jayson[_0xfc9c('0x9')][_0xfc9c('0xa')]({'port':0x232c});function respondWithFilteredResult(_0x33d008,_0x454815){return function(_0x16f9f8){if(_0x16f9f8){var _0x27cba7=typeof _0x454815[_0xfc9c('0xb')]===_0xfc9c('0xc')&&typeof _0x454815[_0xfc9c('0xd')]===_0xfc9c('0xc');var _0x2ea50d=_0x16f9f8[_0xfc9c('0xe')];var _0x4569bf=_0x27cba7?0x0:_0x454815['offset'];var _0x230992=_0x27cba7?_0x16f9f8[_0xfc9c('0xe')]:_0x454815[_0xfc9c('0xb')]+_0x454815[_0xfc9c('0xd')];var _0x13b0cb;if(_0x230992>=_0x2ea50d){_0x230992=_0x2ea50d;_0x13b0cb=0xc8;}else{_0x13b0cb=0xce;}_0x33d008[_0xfc9c('0xf')](_0x13b0cb);return _0x33d008[_0xfc9c('0x10')](_0xfc9c('0x11'),_0x4569bf+'-'+_0x230992+'/'+_0x2ea50d)[_0xfc9c('0x12')](_0x16f9f8);}return null;};}function handleError(_0x1a318d,_0x5341b5){_0x5341b5=_0x5341b5||0x1f4;return function(_0x1fa0b5){logger[_0xfc9c('0x13')](_0x1fa0b5[_0xfc9c('0x14')]);if(_0x1fa0b5[_0xfc9c('0x15')]){delete _0x1fa0b5[_0xfc9c('0x15')];}_0x1a318d[_0xfc9c('0xf')](_0x5341b5)[_0xfc9c('0x16')](_0x1fa0b5);};}function getRealtimeQueues(_0xf8bf4f,_0x21b4ec){return new Promise(function(_0x4f5a58,_0xee2736){var _0x280f61=_0x21b4ec==='voice'?amiClient:routingClient;return _0x280f61[_0xfc9c('0x17')](_['startCase'](_0x21b4ec)+_0xfc9c('0x18'),_0xf8bf4f)[_0xfc9c('0x19')](function(_0x345c1c){if(_0x345c1c['error'])throw new Error(util[_0xfc9c('0x1a')](_0xfc9c('0x1b'),_0x21b4ec));return _0x4f5a58(_0x345c1c['result']);})[_0xfc9c('0x1c')](function(_0x4c953e){_0xee2736(_0x4c953e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x467bad,_0x2fbd52){return amiClient[_0xfc9c('0x17')](_0xfc9c('0x1d'),{})[_0xfc9c('0x19')](function(_0x34183b){if(_0x34183b[_0xfc9c('0x13')])throw new Error(_0xfc9c('0x1e'));return _0x467bad(_0x34183b[_0xfc9c('0x1f')]);})[_0xfc9c('0x1c')](function(_0x4e084c){_0x2fbd52(_0x4e084c);});});}function initializeQueues(_0x4a7bb3,_0x1cc93,_0x1145bc,_0x526d66){var _0x118e40=[_0xfc9c('0x20'),_0xfc9c('0x21'),_0xfc9c('0x22'),_0xfc9c('0x23'),_0xfc9c('0x24')];if(_0x1145bc==='voice'&&_0x526d66===_0xfc9c('0x25')){_0x118e40[_0xfc9c('0x26')]('pTalking','originated','message',_0xfc9c('0x27'),'dialMethod',_0xfc9c('0x28'),_0xfc9c('0x29'),_0xfc9c('0x2a'),_0xfc9c('0x2b'),_0xfc9c('0x2c'),_0xfc9c('0x2d'),'erlangBusyFactor',_0xfc9c('0x2e'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xfc9c('0x2f'),_0xfc9c('0x30'),_0xfc9c('0x31'),_0xfc9c('0x32'),_0xfc9c('0x33'),_0xfc9c('0x34'),'predictiveIntervalAvgTalktime');}return _0x4a7bb3[_0xfc9c('0x35')](function(_0x3fdad3){var _0x16aef3=_0x3fdad3['get']({'plain':!![]});_0x16aef3[_0xfc9c('0x36')]=[];_0x16aef3[_0xfc9c('0x24')]=0x0;_0x16aef3[_0xfc9c('0x37')]=0x0;_0x16aef3[_0xfc9c('0x20')]=0x0;_0x16aef3['available']=0x0;_0x16aef3[_0xfc9c('0x22')]=0x0;if(_0x1145bc===_0xfc9c('0x38')){_0x16aef3[_0xfc9c('0x23')]=0x0;_0x16aef3['busy']=0x0;if(_0x526d66===_0xfc9c('0x25')){_0x16aef3['pTalking']=0x0;_0x16aef3['originated']=0x0;}}var _0x3e14c3=_[_0xfc9c('0x39')](_0x1cc93,['id',_0x16aef3['id']]);if(_0x3e14c3)_['merge'](_0x16aef3,_[_0xfc9c('0x3a')](_0x3e14c3,_0x118e40));return _0x16aef3;});}function updateAgentVoiceStatus(_0x222272,_0x5ccc64,_0x3a0275){var _0x1a60e8=_[_0xfc9c('0x3b')](_0x3a0275,[_0xfc9c('0x3c'),_0x5ccc64[_0xfc9c('0x15')]]);if(_0x1a60e8[_0xfc9c('0x3d')]===0x0)return _0x222272[_0xfc9c('0x3e')]=!![];if(_[_0xfc9c('0x3f')](_0x1a60e8,[_0xfc9c('0x40'),_0x222272[_0xfc9c('0x41')]['toString']()]))return _0x222272[_0xfc9c('0x23')]=!![];if(!_0x222272[_0xfc9c('0x23')])return _0x222272[_0xfc9c('0x3e')]=!![];}function getVoiceQueueAgents(_0x10a796,_0x1330a8,_0x1a36e1,_0x431011){var _0x3e1a08=_['find'](_0x1330a8,['id',_0x10a796['id']]);if(!_0x3e1a08)return _0x10a796;return _0x3e1a08[_0xfc9c('0x42')]({'raw':!![]})[_0xfc9c('0x19')](function(_0x140268){for(var _0x8e86ed=0x0;_0x8e86ed<_0x140268['length'];_0x8e86ed++){var _0x4846c2=_[_0xfc9c('0x39')](_0x1a36e1,['id',_0x140268[_0x8e86ed][_0xfc9c('0x43')]]);if(!_0x4846c2){_0x4846c2={'id':_0x140268[_0x8e86ed][_0xfc9c('0x43')],'name':_0x140268[_0x8e86ed][_0xfc9c('0x43')],'accountcode':'','online':![]};}var _0x443098={'id':_0x4846c2['id'],'name':_0x4846c2[_0xfc9c('0x15')],'internal':_0x4846c2[_0xfc9c('0x44')],'online':Boolean(_0x4846c2['online']),'paused':Boolean(_0x140268[_0x8e86ed][_0xfc9c('0x24')])};if(_0x4846c2['voiceStatus']===_0xfc9c('0x23'))updateAgentVoiceStatus(_0x443098,_0x10a796,_0x431011);if(_0x443098['online'])_0x10a796[_0xfc9c('0x37')]++;if(_0x443098[_0xfc9c('0x3e')])_0x10a796['busy']++;if(_0x443098[_0xfc9c('0x24')]&&!_0x443098[_0xfc9c('0x3e')]&&!_0x443098['talking'])_0x10a796[_0xfc9c('0x24')]++;_0x10a796[_0xfc9c('0x36')]['push'](_0x443098);}return _0x10a796;});}function getQueueAgents(_0x54499d,_0x396a39,_0x444555){var _0x109e18='User'+_['startCase'](_0x444555)+_0xfc9c('0x45');var _0x1f1d15=_0x444555+'Pause';return db[_0x109e18][_0xfc9c('0x46')]({'where':{[_[_0xfc9c('0x47')](_0x444555)+_0xfc9c('0x48')]:_0x54499d['id']},'raw':!![]})['then'](function(_0x51e730){for(var _0x33479d=0x0;_0x33479d<_0x51e730['length'];_0x33479d++){var _0x5885c6=_[_0xfc9c('0x39')](_0x396a39,['id',_0x51e730[_0x33479d][_0xfc9c('0x43')]]);if(!_0x5885c6){_0x5885c6={'id':_0x51e730[_0x33479d][_0xfc9c('0x43')],'name':_0x51e730[_0x33479d][_0xfc9c('0x43')],'online':![],['pauseField']:![]};}var _0x152652={'id':_0x5885c6['id'],'name':_0x5885c6[_0xfc9c('0x15')],'online':Boolean(_0x5885c6[_0xfc9c('0x49')]),'paused':Boolean(_0x5885c6[_0x1f1d15])};if(_0x152652[_0xfc9c('0x49')])_0x54499d[_0xfc9c('0x37')]++;_0x54499d[_0xfc9c('0x36')][_0xfc9c('0x26')](_0x152652);}return _0x54499d;});}function validateChannel(_0x75b9e1){var _0x42dcf6=utils[_0xfc9c('0x4a')]();if(!_[_0xfc9c('0x4b')](_0x42dcf6,_0x75b9e1['toLowerCase']()))throw new Error('Invalid\x20channel');return _0x75b9e1[_0xfc9c('0x4c')]();}exports[_0xfc9c('0x4d')]=function(_0x432af4,_0x47f58d){var _0x2d45e6={'count':0x0,'rows':[]};var _0x49abba={};var _0x5ce4ab;var _0x17990d;var _0x4fa17c;var _0xd3b0cd;var _0x6855fd=utils[_0xfc9c('0x4a')]();var _0x4255e7=_0x432af4[_0xfc9c('0x4e')]['globalQueueFilter'];var _0x47e350=_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x4f')];var _0x57cf92=_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x50')];var _0x2fded2=_0x47e350===_0xfc9c('0x51')||_0x47e350===_0xfc9c('0x52')?!![]:![];var _0x41a83f=[];var _0x5d6e67;Promise['resolve']()[_0xfc9c('0x19')](function(){if(_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x53')]){_0x5ce4ab=validateChannel(_0x432af4['query'][_0xfc9c('0x53')]);}if(!_0x432af4['query'][_0xfc9c('0x54')]||!_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x54')]['includes']('globalStatus')){_0x432af4['query'][_0xfc9c('0x54')]=rta[_0xfc9c('0x55')](_0x432af4['query']['sort']);return;}var _0x59a689=rta[_0xfc9c('0x56')](_0x432af4[_0xfc9c('0x4e')]['sort']);_0x432af4[_0xfc9c('0x4e')]['sort']=_0x59a689['fields'][_0xfc9c('0x57')](',');_0x17990d=_0x59a689[_0xfc9c('0x58')];})[_0xfc9c('0x19')](function(){if(!_0x4255e7){return[];}return rta[_0xfc9c('0x59')](_0x4255e7,_0x5ce4ab);})['then'](function(_0x2e38f9){_0x41a83f=_0x2e38f9;return rta[_0xfc9c('0x5a')]();})[_0xfc9c('0x19')](function(_0x4d06aa){_0xd3b0cd=_0x4d06aa[_0xfc9c('0x5b')];if((!_0x47e350||_0x2fded2)&&!_0x17990d){return _0x41a83f;}if(_0x17990d&&!_0x47e350){return rta['getSortedAgentsIdsByStatus'](_0xd3b0cd,_0x41a83f,_0x17990d);}else{return rta[_0xfc9c('0x5c')](_0xd3b0cd,_0x41a83f,_0x47e350);}})[_0xfc9c('0x19')](function(_0x2ff73b){_0x41a83f=_0x2ff73b;var _0x459539=![];if(_0x41a83f[_0xfc9c('0x3d')]===0x0){if(_0x4255e7||_0x47e350){_0x459539=!![];}if(_0x2fded2){_0x459539=![];}}if(_0x459539){return _0x2d45e6;}var _0x108b08=_[_0xfc9c('0x35')](db[_0xfc9c('0x5d')][_0xfc9c('0x5e')],function(_0xdf04e8){return{'name':_0xdf04e8[_0xfc9c('0x5f')],'type':_0xdf04e8[_0xfc9c('0x60')][_0xfc9c('0x61')]};});_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x62')]=_0xfc9c('0x63');_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x49')]=!![];_0x49abba=qs['getOptions'](_0x108b08,_0x432af4);_0x49abba[_0xfc9c('0x64')]=!![];var _0x322390=[];if(_0x41a83f['length']>0x0){_0x322390[_0xfc9c('0x26')]({'id':{'$in':_0x41a83f}});if(_0x17990d&&!_0x47e350){_0x5d6e67=[db['sequelize']['literal'](_0xfc9c('0x65')+_0x41a83f+')')];_0x49abba[_0xfc9c('0x58')]=_0x5d6e67;}}if(_0x2fded2){_0x6855fd['forEach'](function(_0x377da4){var _0x450199=!![];if(_0x47e350===_0xfc9c('0x52')&&_0x5ce4ab!==_0x377da4){_0x450199=![];}_0x322390[_0xfc9c('0x26')]({[_0x377da4+_0xfc9c('0x66')]:_0x450199});});if(_0x57cf92){_0x322390[_0xfc9c('0x26')]({'pauseType':_0x57cf92});}}else if(_0x47e350){_0x6855fd[_0xfc9c('0x67')](function(_0x2bef99){_0x322390['push']({[_0x2bef99+'Pause']:![]});});}_0x49abba[_0xfc9c('0x68')]=_[_0xfc9c('0x69')](_0x49abba['where'],{'$and':_0x322390});if(_0x432af4[_0xfc9c('0x6a')]['role']===_0xfc9c('0x6a')){var _0x11ff40={'params':{'id':_0x432af4[_0xfc9c('0x6a')][_0xfc9c('0x6b')]},'query':{'section':'Agents','role':_0xfc9c('0x63'),'online':!![],'raw':!![],'ids':_0x41a83f,'customSorting':_0x5d6e67}};if(_0x2fded2){_0x11ff40[_0xfc9c('0x4e')][_0xfc9c('0x6c')]=_0x322390;}_0x11ff40[_0xfc9c('0x4e')]=Object[_0xfc9c('0x6d')](_0x11ff40[_0xfc9c('0x4e')],_0x432af4[_0xfc9c('0x4e')]);delete _0x11ff40[_0xfc9c('0x4e')]['id'];return db[_0xfc9c('0x6e')]['getResources'](_0x11ff40);}return db[_0xfc9c('0x5d')]['findAndCountAll'](_0x49abba);})[_0xfc9c('0x19')](function(_0x3ae549){_0x2d45e6[_0xfc9c('0xe')]=_0x3ae549[_0xfc9c('0xe')];_0x4fa17c=_0x3ae549['rows'];return _0x4fa17c[_0xfc9c('0x35')](function(_0x3e6f11){var _0x3e4128=_[_0xfc9c('0x39')](_0xd3b0cd,['id',_0x3e6f11['id']]);if(_0x3e4128){var _0x29da1c=rta[_0xfc9c('0x6f')](_0x3e4128);_[_0xfc9c('0x69')](_0x3e6f11,_0x29da1c);}_0x3e6f11[_0xfc9c('0x70')]=rta[_0xfc9c('0x71')](_0x3e6f11);if(_0x3e6f11[_0xfc9c('0x70')][_0xfc9c('0x4b')]('pause')){_0x6855fd['forEach'](function(_0x13af36){if(_0x3e6f11[_0x13af36+'Pause']){_0x3e6f11[_0x13af36+_0xfc9c('0x72')]=_0xfc9c('0x51');}});}return _0x3e6f11;});})['then'](function(_0x369c60){if(!_0x17990d||_0x5d6e67){return _0x369c60;}return rta[_0xfc9c('0x73')](_0x369c60,_0x17990d);})['then'](function(_0x4217f6){_0x2d45e6['rows']=_0x4217f6;return _0x2d45e6;})[_0xfc9c('0x19')](respondWithFilteredResult(_0x47f58d,_0x49abba))[_0xfc9c('0x1c')](handleError(_0x47f58d,null));};exports[_0xfc9c('0x74')]=function(_0x3db3b9,_0x193e80){var _0x123aee={'count':0x0,'rows':[]},_0x21dea4={},_0x4982ae,_0x29d617,_0x46114e,_0x5ec67e,_0x80f0ae;Promise[_0xfc9c('0x75')]()[_0xfc9c('0x19')](function(){if(_0x3db3b9[_0xfc9c('0x4e')]['channel'])_0x4982ae=validateChannel(_0x3db3b9['query'][_0xfc9c('0x53')]);var _0x14948d=_[_0xfc9c('0x47')](_0x4982ae)+'Queue';var _0x1eadda=_[_0xfc9c('0x35')](db[_0x14948d][_0xfc9c('0x5e')],function(_0x3c548b){return{'name':_0x3c548b[_0xfc9c('0x5f')],'type':_0x3c548b[_0xfc9c('0x60')][_0xfc9c('0x61')]};});_0x21dea4=qs[_0xfc9c('0x76')](_0x1eadda,_0x3db3b9);if(_0x3db3b9[_0xfc9c('0x6a')][_0xfc9c('0x62')]===_0xfc9c('0x6a')){var _0xc8df94={'params':{'id':_0x3db3b9[_0xfc9c('0x6a')][_0xfc9c('0x6b')]},'query':{'section':_0x4982ae===_0xfc9c('0x38')&&_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x60')]==='outbound'?_0xfc9c('0x77'):_[_0xfc9c('0x47')](_0x4982ae)+'Queues','type':_0x3db3b9['query'][_0xfc9c('0x60')],'nolimit':!![],'sort':_0xfc9c('0x15'),'filter':_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x3b')]}};return db['UserProfile'][_0xfc9c('0x78')](_0xc8df94);}return db[_0x14948d][_0xfc9c('0x79')](_0x21dea4);})['then'](function(_0x396721){_0x123aee[_0xfc9c('0xe')]=_0x396721[_0xfc9c('0xe')];_0x29d617=_0x396721[_0xfc9c('0x5b')];return getRealtimeQueues(_0x3db3b9,_0x4982ae);})[_0xfc9c('0x19')](function(_0x5de036){_0x5ec67e=_0x5de036['rows'];return rta['getRealtimeAgents']();})[_0xfc9c('0x19')](function(_0x4a39dc){_0x46114e=_0x4a39dc['rows'];if(_0x4982ae!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xfc9c('0x19')](function(_0x35076f){_0x80f0ae=_0x35076f?_0x35076f[_0xfc9c('0x5b')]:[];return initializeQueues(_0x29d617,_0x5ec67e,_0x4982ae,_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x60')]);})[_0xfc9c('0x19')](function(_0x11c112){var _0x2be913=_0x11c112['map'](function(_0x26d9b2){if(_0x4982ae===_0xfc9c('0x38'))return getVoiceQueueAgents(_0x26d9b2,_0x29d617,_0x46114e,_0x80f0ae);else return getQueueAgents(_0x26d9b2,_0x46114e,_0x4982ae);});return Promise['all'](_0x2be913);})[_0xfc9c('0x19')](function(_0x45b523){_0x123aee['rows']=_0x45b523;return _0x123aee;})[_0xfc9c('0x19')](respondWithFilteredResult(_0x193e80,_0x21dea4))['catch'](handleError(_0x193e80,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2a296bf..4f6074c 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1e3a6c,_0x19c8db){var _0x37b66c=function(_0x382445){while(--_0x382445){_0x1e3a6c['push'](_0x1e3a6c['shift']());}};_0x37b66c(++_0x19c8db);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xad0aaa,_0x4943c8){var _0x168b18=function(_0x6e6e35){while(--_0x6e6e35){_0xad0aaa['push'](_0xad0aaa['shift']());}};_0x168b18(++_0x4943c8);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index eeb04d4..97396d6 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 _0xf88f=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xf88f,0x1bb));var _0xff88=function(_0x39bfcd,_0x7d0dc3){_0x39bfcd=_0x39bfcd-0x0;var _0x36ec30=_0xf88f[_0x39bfcd];return _0x36ec30;};'use strict';var Sequelize=require(_0xff88('0x0'));module[_0xff88('0x1')]={'state':{'type':Sequelize[_0xff88('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xff88('0x3')]},'scheduledat':{'type':Sequelize[_0xff88('0x4')]},'uniqueid':{'type':Sequelize[_0xff88('0x3')]},'starttime':{'type':Sequelize[_0xff88('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xff88('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xff88('0x3')]},'campaigntype':{'type':Sequelize[_0xff88('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b47=['sequelize','INTEGER','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b47,0x1b4));var _0x74b4=function(_0xb10104,_0x178e9d){_0xb10104=_0xb10104-0x0;var _0x3c747a=_0x4b47[_0xb10104];return _0x3c747a;};'use strict';var Sequelize=require(_0x74b4('0x0'));module['exports']={'state':{'type':Sequelize[_0x74b4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x74b4('0x2')]},'scheduledat':{'type':Sequelize[_0x74b4('0x3')]},'uniqueid':{'type':Sequelize[_0x74b4('0x2')]},'starttime':{'type':Sequelize[_0x74b4('0x3')]},'responsetime':{'type':Sequelize[_0x74b4('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x74b4('0x2')]},'membername':{'type':Sequelize[_0x74b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e218699..a6cf44e 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 _0x117c=['report_agent_preview','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','ReportAgentPreview'];(function(_0x2bb398,_0xd7c0dc){var _0x4dfefc=function(_0x20b088){while(--_0x20b088){_0x2bb398['push'](_0x2bb398['shift']());}};_0x4dfefc(++_0xd7c0dc);}(_0x117c,0x1e1));var _0xc117=function(_0x4287e9,_0x31f01c){_0x4287e9=_0x4287e9-0x0;var _0x2f8390=_0x117c[_0x4287e9];return _0x2f8390;};'use strict';var _=require(_0xc117('0x0'));var util=require('util');var logger=require(_0xc117('0x1'))('api');var moment=require(_0xc117('0x2'));var BPromise=require(_0xc117('0x3'));var rp=require(_0xc117('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc117('0x5'));var config=require(_0xc117('0x6'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x3df6c1,_0x327235){return _0x3df6c1[_0xc117('0x7')](_0xc117('0x8'),attributes,{'tableName':_0xc117('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7e6=['rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5643c9,_0x37ef1a){var _0x392b68=function(_0x3a6ec1){while(--_0x3a6ec1){_0x5643c9['push'](_0x5643c9['shift']());}};_0x392b68(++_0x37ef1a);}(_0xd7e6,0xb4));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d7e('0x0'));var util=require('util');var logger=require(_0x6d7e('0x1'))(_0x6d7e('0x2'));var moment=require(_0x6d7e('0x3'));var BPromise=require(_0x6d7e('0x4'));var rp=require(_0x6d7e('0x5'));var fs=require('fs');var path=require(_0x6d7e('0x6'));var rimraf=require(_0x6d7e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d7e('0x8'));module['exports']=function(_0x1061d4,_0x37e89b){return _0x1061d4[_0x6d7e('0x9')](_0x6d7e('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ac560e4..2ff3cbe 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 _0x0d2a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ReportAgentPreview','create','raw','CreateReportAgentPreview','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x6ff10e,_0xca7e58){var _0x5da07c=function(_0x665d01){while(--_0x665d01){_0x6ff10e['push'](_0x6ff10e['shift']());}};_0x5da07c(++_0xca7e58);}(_0x0d2a,0x1b9));var _0xa0d2=function(_0x22834e,_0x325945){_0x22834e=_0x22834e-0x0;var _0x28fa91=_0x0d2a[_0x22834e];return _0x28fa91;};'use strict';var _=require(_0xa0d2('0x0'));var util=require(_0xa0d2('0x1'));var moment=require(_0xa0d2('0x2'));var BPromise=require(_0xa0d2('0x3'));var rs=require(_0xa0d2('0x4'));var fs=require('fs');var Redis=require(_0xa0d2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0d2('0x6'));var logger=require('../../config/logger')(_0xa0d2('0x7'));var config=require(_0xa0d2('0x8'));var jayson=require(_0xa0d2('0x9'));var client=jayson[_0xa0d2('0xa')][_0xa0d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bead3,_0x4b62cc,_0x241136){return new BPromise(function(_0x3ab8b1,_0xa3609a){return client[_0xa0d2('0xc')](_0x1bead3,_0x241136)[_0xa0d2('0xd')](function(_0x4b3839){logger[_0xa0d2('0xe')](_0xa0d2('0xf'),_0x4b62cc,_0xa0d2('0x10'));logger['debug'](_0xa0d2('0x11'),_0x4b62cc,_0xa0d2('0x10'),JSON['stringify'](_0x4b3839));if(_0x4b3839['error']){if(_0x4b3839[_0xa0d2('0x12')][_0xa0d2('0x13')]===0x1f4){logger[_0xa0d2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4b62cc,_0x4b3839[_0xa0d2('0x12')][_0xa0d2('0x14')]);return _0xa3609a(_0x4b3839[_0xa0d2('0x12')][_0xa0d2('0x14')]);}logger[_0xa0d2('0x12')](_0xa0d2('0xf'),_0x4b62cc,_0x4b3839[_0xa0d2('0x12')]['message']);return _0x3ab8b1(_0x4b3839[_0xa0d2('0x12')][_0xa0d2('0x14')]);}else{logger['info'](_0xa0d2('0xf'),_0x4b62cc,_0xa0d2('0x10'));_0x3ab8b1(_0x4b3839[_0xa0d2('0x15')]['message']);}})[_0xa0d2('0x16')](function(_0x442f02){logger['error'](_0xa0d2('0xf'),_0x4b62cc,_0x442f02);_0xa3609a(_0x442f02);});});}exports['CreateReportAgentPreview']=function(_0x4a64bd){var _0x5d2c37=this;return new Promise(function(_0x508eba,_0x1289cf){return db[_0xa0d2('0x17')][_0xa0d2('0x18')](_0x4a64bd['body'],{'raw':_0x4a64bd['options']?_0x4a64bd['options'][_0xa0d2('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x887a3f){logger['info'](_0xa0d2('0x1a'),_0x4a64bd);logger['debug'](_0xa0d2('0x1a'),_0x4a64bd,JSON[_0xa0d2('0x1b')](_0x887a3f));_0x508eba(_0x887a3f);})[_0xa0d2('0x16')](function(_0x1c33d4){logger[_0xa0d2('0x12')](_0xa0d2('0x1a'),_0x1c33d4[_0xa0d2('0x14')],_0x4a64bd);_0x1289cf(_0x5d2c37['error'](0x1f4,_0x1c33d4[_0xa0d2('0x14')]));});});}; \ No newline at end of file +var _0x75e7=['result','catch','create','body','raw','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x75e7,0x1c8));var _0x775e=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x75e7[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0x775e('0x0'));var util=require('util');var moment=require(_0x775e('0x1'));var BPromise=require(_0x775e('0x2'));var rs=require(_0x775e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x775e('0x4'));var logger=require(_0x775e('0x5'))(_0x775e('0x6'));var config=require(_0x775e('0x7'));var jayson=require(_0x775e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c79df,_0x2c4e57,_0x5d45f2){return new BPromise(function(_0x368124,_0x5bff10){return client[_0x775e('0x9')](_0x5c79df,_0x5d45f2)['then'](function(_0x508892){logger[_0x775e('0xa')](_0x775e('0xb'),_0x2c4e57,_0x775e('0xc'));logger[_0x775e('0xd')](_0x775e('0xe'),_0x2c4e57,'request\x20sent',JSON[_0x775e('0xf')](_0x508892));if(_0x508892[_0x775e('0x10')]){if(_0x508892[_0x775e('0x10')][_0x775e('0x11')]===0x1f4){logger['error'](_0x775e('0xb'),_0x2c4e57,_0x508892[_0x775e('0x10')]['message']);return _0x5bff10(_0x508892[_0x775e('0x10')]['message']);}logger[_0x775e('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2c4e57,_0x508892[_0x775e('0x10')][_0x775e('0x12')]);return _0x368124(_0x508892[_0x775e('0x10')][_0x775e('0x12')]);}else{logger[_0x775e('0xa')](_0x775e('0xb'),_0x2c4e57,_0x775e('0xc'));_0x368124(_0x508892[_0x775e('0x13')][_0x775e('0x12')]);}})[_0x775e('0x14')](function(_0x336f7c){logger[_0x775e('0x10')](_0x775e('0xb'),_0x2c4e57,_0x336f7c);_0x5bff10(_0x336f7c);});});}exports['CreateReportAgentPreview']=function(_0x18c71b){var _0xd921bb=this;return new Promise(function(_0x1fa4b8,_0x5afd77){return db['ReportAgentPreview'][_0x775e('0x15')](_0x18c71b[_0x775e('0x16')],{'raw':_0x18c71b['options']?_0x18c71b['options'][_0x775e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5ab0b6){logger[_0x775e('0xa')](_0x775e('0x18'),_0x18c71b);logger[_0x775e('0xd')]('CreateReportAgentPreview',_0x18c71b,JSON[_0x775e('0xf')](_0x5ab0b6));_0x1fa4b8(_0x5ab0b6);})[_0x775e('0x14')](function(_0x415526){logger[_0x775e('0x10')](_0x775e('0x18'),_0x415526[_0x775e('0x12')],_0x18c71b);_0x5afd77(_0xd921bb[_0x775e('0x10')](0x1f4,_0x415526[_0x775e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ea2e042..5e498d6 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 _0xd60e=['/fax/queues/:id','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','put','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','post','/fax/queues/:id/notify','fax'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd60e,0x18e));var _0xed60=function(_0x3254e0,_0x48ef3c){_0x3254e0=_0x3254e0-0x0;var _0x3ec794=_0xd60e[_0x3254e0];return _0x3ec794;};'use strict';var multer=require(_0xed60('0x0'));var util=require('util');var path=require(_0xed60('0x1'));var express=require('express');var router=express[_0xed60('0x2')]();var auth=require(_0xed60('0x3'));var controller=require(_0xed60('0x4'));router[_0xed60('0x5')](_0xed60('0x6'),auth[_0xed60('0x7')](),controller[_0xed60('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xed60('0x7')](),controller[_0xed60('0x9')]);router['get'](_0xed60('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router['get'](_0xed60('0xb'),auth[_0xed60('0x7')](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0xed60('0x7')](),controller['chatQueues']);router['get'](_0xed60('0xc'),auth[_0xed60('0x7')](),controller[_0xed60('0xd')]);router['get'](_0xed60('0xe'),auth['isAuthenticated'](),controller[_0xed60('0xf')]);router[_0xed60('0x5')](_0xed60('0x10'),auth[_0xed60('0x7')](),controller[_0xed60('0x11')]);router[_0xed60('0x5')]('/sms/queues',auth['isAuthenticated'](),controller[_0xed60('0x12')]);router[_0xed60('0x5')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0xed60('0x13')]);router[_0xed60('0x5')](_0xed60('0x14'),auth[_0xed60('0x7')](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xed60('0x15')]);router[_0xed60('0x5')](_0xed60('0x16'),auth['isAuthenticated'](),controller[_0xed60('0x17')]);router[_0xed60('0x5')](_0xed60('0x18'),auth[_0xed60('0x7')](),controller['voiceQueuesChannel']);router[_0xed60('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xed60('0x7')](),controller[_0xed60('0x19')]);router['get'](_0xed60('0x1a'),auth['isAuthenticated'](),controller[_0xed60('0x1b')]);router[_0xed60('0x5')](_0xed60('0x1c'),auth[_0xed60('0x7')](),controller[_0xed60('0x1d')]);router['put'](_0xed60('0x1c'),auth[_0xed60('0x7')](),controller[_0xed60('0x1e')]);router[_0xed60('0x5')]('/outbound',auth[_0xed60('0x7')](),controller[_0xed60('0x1f')]);router[_0xed60('0x5')](_0xed60('0x20'),auth['isAuthenticated'](),controller[_0xed60('0x21')]);router[_0xed60('0x5')]('/agents',auth[_0xed60('0x7')](),controller['agents']);router[_0xed60('0x22')]('/agents/:id/capacity',auth[_0xed60('0x7')](),controller[_0xed60('0x23')]);router['get'](_0xed60('0x24'),auth[_0xed60('0x7')](),controller[_0xed60('0x25')]);router[_0xed60('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0xed60('0x26')]);router[_0xed60('0x5')](_0xed60('0x27'),auth[_0xed60('0x7')](),controller[_0xed60('0x28')]);router[_0xed60('0x5')](_0xed60('0x29'),auth[_0xed60('0x7')](),controller[_0xed60('0x2a')]);router[_0xed60('0x5')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0xed60('0x5')](_0xed60('0x2b'),auth['isAuthenticated'](),controller[_0xed60('0x2c')]);router[_0xed60('0x5')](_0xed60('0x2d'),auth[_0xed60('0x7')](),controller[_0xed60('0x2e')]);router[_0xed60('0x5')](_0xed60('0x2f'),auth[_0xed60('0x7')](),controller[_0xed60('0x30')]);router[_0xed60('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xed60('0x31')]);router['get'](_0xed60('0x32'),auth['isAuthenticated'](),controller[_0xed60('0x33')]);router[_0xed60('0x5')](_0xed60('0x34'),auth[_0xed60('0x7')](),controller[_0xed60('0x35')]);router['post'](_0xed60('0x36'),auth[_0xed60('0x7')](),controller[_0xed60('0x37')](_0xed60('0x38')));router[_0xed60('0x5')]('/mail/queues/:id',auth[_0xed60('0x7')](),controller[_0xed60('0x39')]);router['post'](_0xed60('0x3a'),auth[_0xed60('0x7')](),controller['queueNotify'](_0xed60('0x3b')));router[_0xed60('0x5')]('/chat/queues/:id',auth[_0xed60('0x7')](),controller[_0xed60('0x3c')]);router[_0xed60('0x3d')](_0xed60('0x3e'),auth[_0xed60('0x7')](),controller[_0xed60('0x37')](_0xed60('0x3f')));router['get'](_0xed60('0x40'),auth[_0xed60('0x7')](),controller[_0xed60('0x41')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xed60('0x37')](_0xed60('0x42')));router[_0xed60('0x5')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xed60('0x43')]);router['post'](_0xed60('0x44'),auth[_0xed60('0x7')](),controller[_0xed60('0x37')](_0xed60('0x45')));router[_0xed60('0x3d')](_0xed60('0x46'),auth[_0xed60('0x7')](),controller[_0xed60('0x37')](_0xed60('0x47')));router[_0xed60('0x5')]('/sms/queues/:id',auth[_0xed60('0x7')](),controller[_0xed60('0x48')]);router[_0xed60('0x5')](_0xed60('0x49'),auth['isAuthenticated'](),controller[_0xed60('0x4a')]);router[_0xed60('0x3d')]('/agents/:id/notify',auth[_0xed60('0x7')](),controller[_0xed60('0x4b')]);module[_0xed60('0x4c')]=router; \ No newline at end of file +var _0xc326=['/outbound/channels','outboundChannels','agents','/agents/:id/capacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound'];(function(_0x5d63d9,_0x5aa58d){var _0x580c02=function(_0x1c95ec){while(--_0x1c95ec){_0x5d63d9['push'](_0x5d63d9['shift']());}};_0x580c02(++_0x5aa58d);}(_0xc326,0xdf));var _0x6c32=function(_0x5e5deb,_0x21867a){_0x5e5deb=_0x5e5deb-0x0;var _0x3556e0=_0xc326[_0x5e5deb];return _0x3556e0;};'use strict';var multer=require(_0x6c32('0x0'));var util=require(_0x6c32('0x1'));var path=require(_0x6c32('0x2'));var express=require(_0x6c32('0x3'));var router=express[_0x6c32('0x4')]();var auth=require(_0x6c32('0x5'));var controller=require('./rpc.controller');router[_0x6c32('0x6')](_0x6c32('0x7'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x9')]);router['get'](_0x6c32('0xa'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xb')]);router[_0x6c32('0x6')](_0x6c32('0xc'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xd')]);router[_0x6c32('0x6')](_0x6c32('0xe'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xf')]);router['get'](_0x6c32('0x10'),auth[_0x6c32('0x8')](),controller['chatQueues']);router[_0x6c32('0x6')](_0x6c32('0x11'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x12')]);router[_0x6c32('0x6')](_0x6c32('0x13'),auth[_0x6c32('0x8')](),controller['mailAccounts']);router[_0x6c32('0x6')](_0x6c32('0x14'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x15')]);router[_0x6c32('0x6')](_0x6c32('0x16'),auth['isAuthenticated'](),controller[_0x6c32('0x17')]);router[_0x6c32('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x6c32('0x18')]);router[_0x6c32('0x6')](_0x6c32('0x19'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x1a')]);router[_0x6c32('0x6')](_0x6c32('0x1b'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x1c')]);router[_0x6c32('0x6')](_0x6c32('0x1d'),auth['isAuthenticated'](),controller[_0x6c32('0x1e')]);router[_0x6c32('0x6')](_0x6c32('0x1f'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x20')]);router[_0x6c32('0x6')](_0x6c32('0x21'),auth[_0x6c32('0x8')](),controller['voiceQueuesChannelHangup']);router['get'](_0x6c32('0x22'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x23')]);router[_0x6c32('0x6')](_0x6c32('0x24'),auth['isAuthenticated'](),controller[_0x6c32('0x25')]);router[_0x6c32('0x26')](_0x6c32('0x24'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x27')]);router[_0x6c32('0x6')]('/outbound',auth[_0x6c32('0x8')](),controller[_0x6c32('0x28')]);router['get'](_0x6c32('0x29'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x2a')]);router[_0x6c32('0x6')]('/agents',auth[_0x6c32('0x8')](),controller[_0x6c32('0x2b')]);router[_0x6c32('0x26')](_0x6c32('0x2c'),auth[_0x6c32('0x8')](),controller['agentCapacity']);router[_0x6c32('0x6')]('/telephones',auth[_0x6c32('0x8')](),controller[_0x6c32('0x2d')]);router[_0x6c32('0x6')](_0x6c32('0x2e'),auth['isAuthenticated'](),controller[_0x6c32('0x2f')]);router['get'](_0x6c32('0x30'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x31')]);router[_0x6c32('0x6')](_0x6c32('0x32'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x33')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x6c32('0x34')]);router[_0x6c32('0x6')](_0x6c32('0x35'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x36')]);router[_0x6c32('0x6')](_0x6c32('0x37'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x38')]);router[_0x6c32('0x6')](_0x6c32('0x39'),auth[_0x6c32('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x6c32('0x6')](_0x6c32('0x3a'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x3b')]);router[_0x6c32('0x6')](_0x6c32('0x3c'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x6c32('0x6')](_0x6c32('0x3d'),auth[_0x6c32('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x6c32('0x3e')](_0x6c32('0x3f'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x41')));router[_0x6c32('0x6')](_0x6c32('0x42'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x43')]);router[_0x6c32('0x3e')](_0x6c32('0x44'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x40')](_0x6c32('0x45')));router[_0x6c32('0x6')](_0x6c32('0x46'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x47')]);router[_0x6c32('0x3e')](_0x6c32('0x48'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x49')));router[_0x6c32('0x6')](_0x6c32('0x4a'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x4b')]);router[_0x6c32('0x3e')](_0x6c32('0x4c'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x40')](_0x6c32('0x4d')));router[_0x6c32('0x6')](_0x6c32('0x4e'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x4f')]);router[_0x6c32('0x3e')](_0x6c32('0x50'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x51')));router[_0x6c32('0x3e')](_0x6c32('0x52'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x53')));router[_0x6c32('0x6')]('/sms/queues/:id',auth[_0x6c32('0x8')](),controller['showSmsQueues']);router['get'](_0x6c32('0x54'),auth['isAuthenticated'](),controller[_0x6c32('0x55')]);router[_0x6c32('0x3e')]('/agents/:id/notify',auth[_0x6c32('0x8')](),controller[_0x6c32('0x56')]);module[_0x6c32('0x57')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f0760df..1f86199 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c09=['update','MessageId','agent','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User'];(function(_0x393afc,_0x400603){var _0x3bb793=function(_0x5cfa59){while(--_0x5cfa59){_0x393afc['push'](_0x393afc['shift']());}};_0x3bb793(++_0x400603);}(_0x7c09,0x102));var _0x97c0=function(_0x45b677,_0x1c7e26){_0x45b677=_0x45b677-0x0;var _0x301cd8=_0x7c09[_0x45b677];return _0x301cd8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x97c0('0x0'));var _=require(_0x97c0('0x1'));var util=require('util');var db=require(_0x97c0('0x2'))['db'];var logger=require(_0x97c0('0x3'))(_0x97c0('0x4'));var jayson=require(_0x97c0('0x5'));var amiClient=jayson[_0x97c0('0x6')][_0x97c0('0x7')]({'port':0x232a});var mailClient=jayson[_0x97c0('0x6')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){var _0x57661a=_0x2c19fa?_0x2c19fa:amiClient;return _0x57661a[_0x97c0('0x8')](_0x46fdd9,_0x42c6c7)['then'](function(_0x2d5507){if(_0x2d5507[_0x97c0('0x9')]){if(_0x2d5507['error']['code']===0x1f4){return _0x293785(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}return _0x109bc8(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}else{_0x109bc8(_0x2d5507[_0x97c0('0xb')]);}})[_0x97c0('0xc')](function(_0x7fc93){_0x293785(_0x7fc93);});});}function respondWithResult(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xc8;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0xd')](_0x9ca3c1)[_0x97c0('0xe')](_0x2ecf34);}return _0x39a3b4[_0x97c0('0xf')](0x194);};}function handleError(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0x1f4;return function(_0x15b336){logger[_0x97c0('0x9')](_0x15b336['stack']);if(_0x15b336[_0x97c0('0x10')]){delete _0x15b336[_0x97c0('0x10')];}_0x514782[_0x97c0('0xd')](_0x3f2fc2)[_0x97c0('0x11')](_0x15b336);};}function findById(_0x482be5){return function(_0x13d46e){if(!_['isNil'](_0x482be5)&&!_[_0x97c0('0x12')](_0x13d46e)&&!_[_0x97c0('0x12')](_0x13d46e['rows'])){return _[_0x97c0('0x13')](_0x13d46e[_0x97c0('0x14')],function(_0x179d43){return _0x179d43['id']==_0x482be5;});}return null;};}exports[_0x97c0('0x15')]=function(_0x183e2e,_0x3e7a52){return respondWithRpcPromise(_0x97c0('0x16'),_0x183e2e[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x3e7a52,null))[_0x97c0('0xc')](handleError(_0x3e7a52,null));};exports['voiceChannelMixMonitor']=function(_0x554122,_0x2b74a2){return respondWithRpcPromise(_0x97c0('0x19'),_[_0x97c0('0x1a')](_0x554122['query'],_0x554122[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x2b74a2,null))[_0x97c0('0xc')](handleError(_0x2b74a2,null));};exports[_0x97c0('0x1c')]=function(_0x30fba2,_0x3a0bfb){return respondWithRpcPromise(_0x97c0('0x1d'),_['merge'](_0x30fba2[_0x97c0('0x17')],_0x30fba2[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x3a0bfb,null))[_0x97c0('0xc')](handleError(_0x3a0bfb,null));};exports['voiceQueues']=function(_0x2bda6c,_0x14cada){return respondWithRpcPromise('VoiceQueues',_0x2bda6c[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x14cada,null))[_0x97c0('0xc')](handleError(_0x14cada,null));};exports['showVoiceQueues']=function(_0x4f11ba,_0x51f258){return respondWithRpcPromise(_0x97c0('0x1e'),_0x4f11ba[_0x97c0('0x17')])[_0x97c0('0x18')](findById(_0x4f11ba[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x51f258,null))[_0x97c0('0xc')](handleError(_0x51f258,null));};exports['updateVoiceQueue']=function(_0x10e47e,_0x1c183f){return respondWithRpcPromise(_0x97c0('0x1f'),_['merge'](_0x10e47e[_0x97c0('0x20')],_0x10e47e[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1c183f,null))[_0x97c0('0xc')](handleError(_0x1c183f,null));};exports[_0x97c0('0x21')]=function(_0x5c4e4e,_0x59abbb){return respondWithRpcPromise(_0x97c0('0x22'),_[_0x97c0('0x1a')](_0x5c4e4e[_0x97c0('0x17')],_0x5c4e4e['params']))[_0x97c0('0x18')](respondWithResult(_0x59abbb,null))[_0x97c0('0xc')](handleError(_0x59abbb,null));};exports['voiceQueuesChannels']=function(_0x30147b,_0x22833e){return respondWithRpcPromise(_0x97c0('0x23'),_0x30147b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x22833e,null))[_0x97c0('0xc')](handleError(_0x22833e,null));};exports[_0x97c0('0x24')]=function(_0x1a6c4b,_0x30b927){return respondWithRpcPromise(_0x97c0('0x25'),_[_0x97c0('0x1a')](_0x1a6c4b[_0x97c0('0x17')],_0x1a6c4b[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x30b927,null))[_0x97c0('0xc')](handleError(_0x30b927,null));};exports['voiceQueuesChannelHangup']=function(_0x292560,_0x1548b6){return respondWithRpcPromise(_0x97c0('0x26'),_[_0x97c0('0x1a')](_0x292560[_0x97c0('0x17')],_0x292560[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1548b6,null))[_0x97c0('0xc')](handleError(_0x1548b6,null));};exports['voiceQueuesChannelRedirect']=function(_0xd72d47,_0x4bf42a){return respondWithRpcPromise(_0x97c0('0x27'),_[_0x97c0('0x1a')](_0xd72d47[_0x97c0('0x17')],_0xd72d47[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x4bf42a,null))[_0x97c0('0xc')](handleError(_0x4bf42a,null));};exports[_0x97c0('0x28')]=function(_0x225ca4,_0x38f37a){return respondWithRpcPromise(_0x97c0('0x29'),_0x225ca4[_0x97c0('0x17')])['then'](respondWithResult(_0x38f37a,null))[_0x97c0('0xc')](handleError(_0x38f37a,null));};exports[_0x97c0('0x2a')]=function(_0x4d47b1,_0x137ee1){return respondWithRpcPromise(_0x97c0('0x2b'),_0x4d47b1[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x137ee1,null))['catch'](handleError(_0x137ee1,null));};exports[_0x97c0('0x2c')]=function(_0x4f1629,_0x1acf31){var _0x64cfcd;return respondWithRpcPromise('Agents',_0x4f1629[_0x97c0('0x17')])[_0x97c0('0x18')](function(_0xd728dd){_0x64cfcd=_0xd728dd;return respondWithRpcPromise(_0x97c0('0x2d'),_0x4f1629[_0x97c0('0x17')],routingClient);})[_0x97c0('0x18')](function(_0x36b3d0){return _[_0x97c0('0x1a')]({},_0x36b3d0,_0x64cfcd);})[_0x97c0('0x18')](respondWithResult(_0x1acf31,null))[_0x97c0('0xc')](handleError(_0x1acf31,null));};exports[_0x97c0('0x2e')]=function(_0x2cca4c,_0x1351d2){if(_0x2cca4c['body']&&_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')]&&_0x2cca4c[_0x97c0('0x30')]&&_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]){for(var _0x375ebc in _0x2cca4c[_0x97c0('0x20')]['interaction']){if(_0x2cca4c['body'][_0x97c0('0x2f')][_0x97c0('0x31')](_0x375ebc)){db[_0x97c0('0x32')][_0x97c0('0x33')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc]&&_0x2cca4c['body']['interaction'][_0x375ebc][_0x97c0('0x34')]?{'$notIn':_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc]}:{'$ne':null}}})[_0x97c0('0x18')](function(_0x2f538b){var _0x483656=moment()[_0x97c0('0x35')](_0x97c0('0x36'));for(var _0x342eeb=0x0,_0x10a8ea=_0x2f538b[_0x97c0('0x34')];_0x342eeb<_0x10a8ea;_0x342eeb+=0x1){_0x2f538b[_0x342eeb][_0x97c0('0x37')]({'exitAt':_0x483656});}});for(var _0x444e41=0x0;_0x444e41<_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc][_0x97c0('0x34')];_0x444e41+=0x1){db['MemberReport'][_0x97c0('0x38')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'type':_0x97c0('0x39'),'uniqueid':_0x2cca4c['body']['interaction'][_0x375ebc][_0x444e41],'exitAt':null},'defaults':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'interface':_[_0x97c0('0x12')](_0x2cca4c['user'][_0x97c0('0x3a')])?util[_0x97c0('0x35')](_0x97c0('0x3b'),_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]):_0x2cca4c['user'][_0x97c0('0x3a')],'type':_0x97c0('0x39'),'enterAt':moment()[_0x97c0('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x2cca4c[_0x97c0('0x30')]['internal'],'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc][_0x444e41]}});}}}}return respondWithRpcPromise(_0x97c0('0x3c'),{'id':_0x2cca4c[_0x97c0('0x1b')]['id'],'capacity':_0x2cca4c['body']['capacity']},routingClient)['then'](respondWithResult(_0x1351d2,null))[_0x97c0('0xc')](handleError(_0x1351d2,null));};exports[_0x97c0('0x3d')]=function(_0x3afef4,_0xdb2767){return respondWithRpcPromise(_0x97c0('0x3e'),_0x3afef4[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0xdb2767,null))['catch'](handleError(_0xdb2767,null));};exports[_0x97c0('0x3f')]=function(_0x3f074b,_0x20cd9c){return respondWithRpcPromise(_0x97c0('0x40'),_0x3f074b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x20cd9c,null))['catch'](handleError(_0x20cd9c,null));};exports[_0x97c0('0x41')]=function(_0x86a497,_0x4fbc1e){return respondWithRpcPromise(_0x97c0('0x42'),_0x86a497[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x4fbc1e,null))[_0x97c0('0xc')](handleError(_0x4fbc1e,null));};exports[_0x97c0('0x43')]=function(_0x18992d,_0x47298f){return respondWithRpcPromise('ChatQueues',_0x18992d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x47298f,null))[_0x97c0('0xc')](handleError(_0x47298f,null));};exports[_0x97c0('0x44')]=function(_0x154317,_0x2f1571){return respondWithRpcPromise(_0x97c0('0x45'),_0x154317[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x154317[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x2f1571,null))[_0x97c0('0xc')](handleError(_0x2f1571,null));};exports[_0x97c0('0x46')]=function(_0x57766f,_0x771495){return respondWithRpcPromise(_0x97c0('0x47'),_0x57766f[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x771495,null))[_0x97c0('0xc')](handleError(_0x771495,null));};exports[_0x97c0('0x48')]=function(_0x481f5b,_0x18a6c0){return respondWithRpcPromise(_0x97c0('0x47'),_0x481f5b['query'],routingClient)[_0x97c0('0x18')](findById(_0x481f5b[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x18a6c0,null))['catch'](handleError(_0x18a6c0,null));};exports[_0x97c0('0x49')]=function(_0x4c4fb2,_0x25c750){return respondWithRpcPromise(_0x97c0('0x4a'),_0x4c4fb2[_0x97c0('0x17')],mailClient)[_0x97c0('0x18')](respondWithResult(_0x25c750,null))[_0x97c0('0xc')](handleError(_0x25c750,null));};exports[_0x97c0('0x4b')]=function(_0x52643e,_0x3349df){return respondWithRpcPromise(_0x97c0('0x4c'),_0x52643e[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3349df,null))['catch'](handleError(_0x3349df,null));};exports[_0x97c0('0x4d')]=function(_0x3795db,_0x102f68){return respondWithRpcPromise(_0x97c0('0x4c'),_0x3795db['query'],routingClient)[_0x97c0('0x18')](findById(_0x3795db[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x102f68,null))[_0x97c0('0xc')](handleError(_0x102f68,null));};exports['smsQueues']=function(_0x32881c,_0x3c4c27){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32881c['query'],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3c4c27,null))[_0x97c0('0xc')](handleError(_0x3c4c27,null));};exports[_0x97c0('0x4f')]=function(_0x32e392,_0x373c34){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32e392[_0x97c0('0x17')],routingClient)['then'](findById(_0x32e392['params']['id']))[_0x97c0('0x18')](respondWithResult(_0x373c34,null))[_0x97c0('0xc')](handleError(_0x373c34,null));};exports['whatsappQueues']=function(_0x366a01,_0x5a4738){return respondWithRpcPromise('WhatsappQueues',_0x366a01[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x5a4738,null))[_0x97c0('0xc')](handleError(_0x5a4738,null));};exports[_0x97c0('0x50')]=function(_0x56be23,_0x496336){return respondWithRpcPromise('WhatsappQueues',_0x56be23[_0x97c0('0x17')],routingClient)['then'](findById(_0x56be23[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x496336,null))[_0x97c0('0xc')](handleError(_0x496336,null));};exports[_0x97c0('0x51')]=function(_0x400a8d,_0x321460){return respondWithRpcPromise(_0x97c0('0x52'),_0x400a8d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x321460,null))[_0x97c0('0xc')](handleError(_0x321460,null));};exports[_0x97c0('0x53')]=function(_0x536f72,_0x1c1182){return respondWithRpcPromise(_0x97c0('0x52'),_0x536f72[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x536f72[_0x97c0('0x1b')]['id']))['then'](respondWithResult(_0x1c1182,null))[_0x97c0('0xc')](handleError(_0x1c1182,null));};exports[_0x97c0('0x54')]=function(_0x579f54,_0x4116c9){return respondWithRpcPromise(_0x97c0('0x55'),_0x579f54[_0x97c0('0x17')])['then'](respondWithResult(_0x4116c9,null))[_0x97c0('0xc')](handleError(_0x4116c9,null));};exports[_0x97c0('0x56')]=function(_0x10f1aa,_0x165c72){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x10f1aa['query'],routingClient)['then'](respondWithResult(_0x165c72,null))[_0x97c0('0xc')](handleError(_0x165c72,null));};exports[_0x97c0('0x57')]=function(_0x442bba,_0x41f8e7){return respondWithRpcPromise(_0x97c0('0x58'),_0x442bba[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x41f8e7,null))[_0x97c0('0xc')](handleError(_0x41f8e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52d9d9,_0x199abc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52d9d9['query'],routingClient)['then'](respondWithResult(_0x199abc,null))[_0x97c0('0xc')](handleError(_0x199abc,null));};exports[_0x97c0('0x59')]=function(_0x123a99,_0x30968e){return respondWithRpcPromise(_0x97c0('0x5a'),_0x123a99['query'],routingClient)['then'](function(_0x35ced3){if(_0x123a99[_0x97c0('0x17')][_0x97c0('0x5b')]!==undefined){var _0x3a8ac0=_(_0x35ced3['rows'])[_0x97c0('0x5c')]([_0x123a99['query'][_0x97c0('0x5b')],_0x123a99[_0x97c0('0x1b')]['id']])[_0x97c0('0x5d')](_0x97c0('0x5e'))[_0x97c0('0x5f')]()[_0x97c0('0x60')]();return _0x35ced3[_0x97c0('0x14')][_0x97c0('0x5c')](function(_0x465a92){return _0x3a8ac0[_0x97c0('0x61')](_0x465a92['queue_id'])>-0x1;});}else{return _0x35ced3[_0x97c0('0x14')]['filter'](function(_0x5b8ebd){return _0x5b8ebd[_0x97c0('0x5e')]===parseInt(_0x123a99[_0x97c0('0x1b')]['id']);});}})['then'](respondWithResult(_0x30968e,null))[_0x97c0('0xc')](handleError(_0x30968e,null));};exports['smsQueuesWaitingInteractions']=function(_0x1f2380,_0x24a81c){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1f2380[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x24a81c,null))['catch'](handleError(_0x24a81c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xab71f4,_0x12bb6e){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0xab71f4[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x12bb6e,null))[_0x97c0('0xc')](handleError(_0x12bb6e,null));};exports[_0x97c0('0x62')]=function(_0x41b864,_0x11db50){return respondWithRpcPromise(_0x97c0('0x63'),_0x41b864[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x11db50,null))[_0x97c0('0xc')](handleError(_0x11db50,null));};exports['queueNotify']=function(_0x597cd1){return function(_0x4062f8,_0x4f9307){var _0x3f69a6,_0x15f953;var _0x567e15=_[_0x97c0('0x64')](_0x597cd1);var _0x344d5f=_0x597cd1===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x567e15+'Queue'][_0x97c0('0x68')]({'raw':!![],'where':{'id':_0x4062f8[_0x97c0('0x1b')]['id']}})[_0x97c0('0x18')](function(_0x58e7c0){if(_[_0x97c0('0x12')](_0x58e7c0)){throw new Error(_0x567e15+_0x97c0('0x69'));}_0x3f69a6=_0x58e7c0;return db[_0x567e15+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x4062f8['body'][_0x97c0('0x6b')]},'include':[{'model':db[_0x567e15+_0x97c0('0x6c')],'as':_0x97c0('0x6c')},{'model':db[_0x567e15+_0x344d5f],'as':_0x97c0('0x67')}]});})[_0x97c0('0x18')](function(_0x5828f7){if(_[_0x97c0('0x12')](_0x5828f7)){throw new Error(_0x567e15+_0x97c0('0x6d'));}_0x15f953=_0x5828f7;return _0x5828f7['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x372415={'uniqueid':_0x597cd1+'.'+_0x15f953['id']+'.'+_0x15f953[_0x97c0('0x6c')]['id'],'FromUserId':_0x4062f8[_0x97c0('0x30')]['id'],'type':'queue'};_0x372415[_0x567e15+'MessageId']=_0x15f953['id'];_0x372415[_0x567e15+_0x97c0('0x6e')]=_0x15f953['Interaction']['id'];_0x372415[_0x97c0('0x6f')+_0x567e15+_0x344d5f+'Id']=_0x15f953[_0x97c0('0x67')]['id'];_0x372415['To'+_0x567e15+_0x97c0('0x70')]=_0x3f69a6['id'];return db[_0x567e15+_0x97c0('0x71')][_0x97c0('0x72')](_0x372415);})[_0x97c0('0x18')](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x597cd1,'interaction':_0x15f953['Interaction'],'message':_0x15f953,'account':_0x15f953[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x74'),'appdata':_0x3f69a6[_0x97c0('0x10')]+','+(_0x15f953[_0x97c0('0x67')][_0x97c0('0x75')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x4f9307,null))[_0x97c0('0xc')](handleError(_0x4f9307,null));};};exports[_0x97c0('0x77')]=function(_0x15b27f,_0x1cc32c){var _0x1b2e52,_0x3c4c8e;if(_[_0x97c0('0x12')](_0x15b27f['body'][_0x97c0('0x78')])){throw new Error(_0x97c0('0x79'));}var _0x2f9ffe=_0x15b27f[_0x97c0('0x20')]['channel'];var _0x1eb0c7=_[_0x97c0('0x64')](_0x2f9ffe);var _0x6b955=_0x2f9ffe===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x97c0('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x15b27f[_0x97c0('0x1b')]['id'],'role':'agent'}})[_0x97c0('0x18')](function(_0x1822b5){if(_[_0x97c0('0x12')](_0x1822b5)){throw new Error('Agent\x20not\x20found');}_0x1b2e52=_0x1822b5;return db[_0x1eb0c7+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x15b27f[_0x97c0('0x20')][_0x97c0('0x6b')]},'include':[{'model':db[_0x1eb0c7+_0x97c0('0x6c')],'as':'Interaction'},{'model':db[_0x1eb0c7+_0x6b955],'as':_0x97c0('0x67')}]});})['then'](function(_0x2db5b0){if(_[_0x97c0('0x12')](_0x2db5b0)){throw new Error(_0x1eb0c7+'\x20Message\x20not\x20found');}_0x3c4c8e=_0x2db5b0;return _0x2db5b0[_0x97c0('0x7b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x97c0('0x18')](function(){var _0x1419cd={'uniqueid':_0x2f9ffe+'.'+_0x3c4c8e['id']+'.'+_0x3c4c8e[_0x97c0('0x6c')]['id'],'FromUserId':_0x15b27f[_0x97c0('0x30')]['id'],'type':_0x97c0('0x74'),'ToUserId':_0x1b2e52['id']};_0x1419cd[_0x1eb0c7+_0x97c0('0x7c')]=_0x3c4c8e['id'];_0x1419cd[_0x1eb0c7+_0x97c0('0x6e')]=_0x3c4c8e['Interaction']['id'];_0x1419cd[_0x97c0('0x6f')+_0x1eb0c7+_0x6b955+'Id']=_0x3c4c8e[_0x97c0('0x67')]['id'];return db[_0x1eb0c7+_0x97c0('0x71')]['create'](_0x1419cd);})['then'](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x2f9ffe,'interaction':_0x3c4c8e[_0x97c0('0x6c')],'message':_0x3c4c8e,'account':_0x3c4c8e[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x7d'),'appdata':_0x1b2e52[_0x97c0('0x10')]+','+(_0x3c4c8e[_0x97c0('0x67')][_0x97c0('0x7e')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x1cc32c,null))[_0x97c0('0xc')](handleError(_0x1cc32c,null));}; \ No newline at end of file +var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0xff8a3,_0x15e756){var _0x178234=function(_0x29c5be){while(--_0x29c5be){_0xff8a3['push'](_0xff8a3['shift']());}};_0x178234(++_0x15e756);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x5fc3[_0x2b5b44];return _0x32cb66;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f3ad839..7a09f0f 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 _0xcf48=['run','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run'];(function(_0x117729,_0x3bb44c){var _0x1f67b5=function(_0x438ed6){while(--_0x438ed6){_0x117729['push'](_0x117729['shift']());}};_0x1f67b5(++_0x3bb44c);}(_0xcf48,0x86));var _0x8cf4=function(_0x469def,_0x3f8695){_0x469def=_0x469def-0x0;var _0x22792c=_0xcf48[_0x469def];return _0x22792c;};'use strict';var multer=require('multer');var util=require(_0x8cf4('0x0'));var path=require('path');var timeout=require(_0x8cf4('0x1'));var express=require(_0x8cf4('0x2'));var router=express['Router']();var fs_extra=require(_0x8cf4('0x3'));var auth=require(_0x8cf4('0x4'));var interaction=require(_0x8cf4('0x5'));var config=require(_0x8cf4('0x6'));var controller=require(_0x8cf4('0x7'));router[_0x8cf4('0x8')]('/',auth[_0x8cf4('0x9')](),controller['index']);router[_0x8cf4('0x8')](_0x8cf4('0xa'),auth['isAuthenticated'](),controller[_0x8cf4('0xb')]);router[_0x8cf4('0x8')](_0x8cf4('0xc'),auth['isAuthenticated'](),controller[_0x8cf4('0xd')]);router[_0x8cf4('0xe')]('/',auth['isAuthenticated'](),controller[_0x8cf4('0xf')]);router[_0x8cf4('0x10')](_0x8cf4('0xa'),auth[_0x8cf4('0x9')](),controller[_0x8cf4('0x11')]);router[_0x8cf4('0x12')](_0x8cf4('0xa'),auth[_0x8cf4('0x9')](),controller[_0x8cf4('0x13')]);module[_0x8cf4('0x14')]=router; \ No newline at end of file +var _0x1bf2=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','/:id/run','post','create','put','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1bf2,0xaa));var _0x21bf=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x1bf2[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x21bf('0x0'));var util=require(_0x21bf('0x1'));var path=require(_0x21bf('0x2'));var timeout=require(_0x21bf('0x3'));var express=require(_0x21bf('0x4'));var router=express[_0x21bf('0x5')]();var fs_extra=require(_0x21bf('0x6'));var auth=require(_0x21bf('0x7'));var interaction=require(_0x21bf('0x8'));var config=require(_0x21bf('0x9'));var controller=require(_0x21bf('0xa'));router[_0x21bf('0xb')]('/',auth[_0x21bf('0xc')](),controller['index']);router[_0x21bf('0xb')](_0x21bf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x21bf('0xb')](_0x21bf('0xe'),auth[_0x21bf('0xc')](),controller['run']);router[_0x21bf('0xf')]('/',auth[_0x21bf('0xc')](),controller[_0x21bf('0x10')]);router[_0x21bf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x21bf('0x12')]);router[_0x21bf('0x13')](_0x21bf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x21bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5cd5505..4c12986 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 _0xf90b=['exports','STRING','BOOLEAN','DATE','ENUM','years','quarters','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize'];(function(_0x10794a,_0x13f318){var _0x370e93=function(_0x4060f2){while(--_0x4060f2){_0x10794a['push'](_0x10794a['shift']());}};_0x370e93(++_0x13f318);}(_0xf90b,0x8f));var _0xbf90=function(_0x4305f0,_0x15817c){_0x4305f0=_0x4305f0-0x0;var _0x2cfdfc=_0xf90b[_0x4305f0];return _0x2cfdfc;};'use strict';var Sequelize=require(_0xbf90('0x0'));module[_0xbf90('0x1')]={'name':{'type':Sequelize[_0xbf90('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbf90('0x2')]},'active':{'type':Sequelize[_0xbf90('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbf90('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xbf90('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xbf90('0x5')](_0xbf90('0x6'),_0xbf90('0x7'),'months','weeks',_0xbf90('0x8'),'hours',_0xbf90('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xbf90('0x5')](_0xbf90('0xa'),_0xbf90('0xb'),_0xbf90('0xc')),'allowNull':![],'defaultValue':_0xbf90('0xa')},'type':{'type':Sequelize[_0xbf90('0x5')](_0xbf90('0xd'),_0xbf90('0xe')),'allowNull':![],'defaultValue':_0xbf90('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xbf90('0x2')]},'cc':{'type':Sequelize[_0xbf90('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xbf90('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcd03=['ENUM','years','quarters','months','weeks','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcd03,0x19c));var _0x3cd0=function(_0x35c8f5,_0x399f44){_0x35c8f5=_0x35c8f5-0x0;var _0xb5c718=_0xcd03[_0x35c8f5];return _0xb5c718;};'use strict';var Sequelize=require(_0x3cd0('0x0'));module[_0x3cd0('0x1')]={'name':{'type':Sequelize[_0x3cd0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3cd0('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3cd0('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x3cd0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3cd0('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3cd0('0x6')](_0x3cd0('0x7'),_0x3cd0('0x8'),_0x3cd0('0x9'),_0x3cd0('0xa'),_0x3cd0('0xb'),'hours',_0x3cd0('0xc')),'allowNull':![],'defaultValue':_0x3cd0('0xb')},'output':{'type':Sequelize['ENUM'](_0x3cd0('0xd'),_0x3cd0('0xe'),_0x3cd0('0xf')),'allowNull':![],'defaultValue':_0x3cd0('0xd')},'type':{'type':Sequelize[_0x3cd0('0x6')](_0x3cd0('0x10'),_0x3cd0('0x11')),'allowNull':![],'defaultValue':_0x3cd0('0x10')},'sendMail':{'type':Sequelize[_0x3cd0('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3cd0('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x3cd0('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3cd0('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 3dbf16f..ebae378 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 _0xe5e2=['includeAll','findAll','rows','show','rawAttributes','include','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','save','update','destroy','Scheduler','UserProfileResource','then','error','name','send','index','Schedule','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','type','VIRTUAL','merge','count'];(function(_0x5f1f21,_0x41b8c2){var _0x84c6c9=function(_0x15db41){while(--_0x15db41){_0x5f1f21['push'](_0x5f1f21['shift']());}};_0x84c6c9(++_0x41b8c2);}(_0xe5e2,0x1be));var _0x2e5e=function(_0x52c26,_0x536566){_0x52c26=_0x52c26-0x0;var _0x27c5fb=_0xe5e2[_0x52c26];return _0x27c5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e5e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e5e('0x1'));var rp=require(_0x2e5e('0x2'));var moment=require(_0x2e5e('0x3'));var BPromise=require(_0x2e5e('0x4'));var Mustache=require(_0x2e5e('0x5'));var util=require(_0x2e5e('0x6'));var path=require(_0x2e5e('0x7'));var sox=require(_0x2e5e('0x8'));var csv=require(_0x2e5e('0x9'));var ejs=require(_0x2e5e('0xa'));var fs=require('fs');var fs_extra=require(_0x2e5e('0xb'));var _=require('lodash');var squel=require(_0x2e5e('0xc'));var crypto=require(_0x2e5e('0xd'));var jsforce=require(_0x2e5e('0xe'));var deskjs=require(_0x2e5e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e5e('0x10'));var Redis=require(_0x2e5e('0x11'));var authService=require(_0x2e5e('0x12'));var qs=require(_0x2e5e('0x13'));var as=require(_0x2e5e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e5e('0x15'))(_0x2e5e('0x16'));var utils=require(_0x2e5e('0x17'));var config=require(_0x2e5e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e5e('0x19'))['db'];function respondWithStatusCode(_0x300468,_0x21420b){_0x21420b=_0x21420b||0xcc;return function(_0x571ab5){if(_0x571ab5){return _0x300468[_0x2e5e('0x1a')](_0x21420b);}return _0x300468[_0x2e5e('0x1b')](_0x21420b)[_0x2e5e('0x1c')]();};}function respondWithResult(_0x499295,_0x4a5794){_0x4a5794=_0x4a5794||0xc8;return function(_0x139c6d){if(_0x139c6d){return _0x499295[_0x2e5e('0x1b')](_0x4a5794)[_0x2e5e('0x1d')](_0x139c6d);}};}function respondWithFilteredResult(_0x1e16b3,_0x514dbc){return function(_0x3bd94e){if(_0x3bd94e){var _0x2782db=typeof _0x514dbc[_0x2e5e('0x1e')]===_0x2e5e('0x1f')&&typeof _0x514dbc['limit']===_0x2e5e('0x1f');var _0x232e66=_0x3bd94e['count'];var _0x224090=_0x2782db?0x0:_0x514dbc[_0x2e5e('0x1e')];var _0xc2c276=_0x2782db?_0x3bd94e['count']:_0x514dbc[_0x2e5e('0x1e')]+_0x514dbc[_0x2e5e('0x20')];var _0x310a98;if(_0xc2c276>=_0x232e66){_0xc2c276=_0x232e66;_0x310a98=0xc8;}else{_0x310a98=0xce;}_0x1e16b3[_0x2e5e('0x1b')](_0x310a98);return _0x1e16b3[_0x2e5e('0x21')]('Content-Range',_0x224090+'-'+_0xc2c276+'/'+_0x232e66)[_0x2e5e('0x1d')](_0x3bd94e);}return null;};}function patchUpdates(_0x25b76c){return function(_0xd939e2){try{jsonpatch['apply'](_0xd939e2,_0x25b76c,!![]);}catch(_0x5d5746){return BPromise['reject'](_0x5d5746);}return _0xd939e2[_0x2e5e('0x22')]();};}function saveUpdates(_0x56bc91,_0x3fda50){return function(_0x23826a){if(_0x23826a){return _0x23826a[_0x2e5e('0x23')](_0x56bc91)['then'](function(_0x389eb8){return _0x389eb8;});}return null;};}function removeEntity(_0x2ae800,_0x47556b){return function(_0x554f51){if(_0x554f51){return _0x554f51[_0x2e5e('0x24')]()['then'](function(){var _0x19d4a5=_0x554f51['get']({'plain':!![]});var _0x20f469=_0x2e5e('0x25');return db[_0x2e5e('0x26')][_0x2e5e('0x24')]({'where':{'type':_0x20f469,'resourceId':_0x19d4a5['id']}})[_0x2e5e('0x27')](function(){return _0x554f51;});})[_0x2e5e('0x27')](function(){_0x2ae800[_0x2e5e('0x1b')](0xcc)[_0x2e5e('0x1c')]();});}};}function handleEntityNotFound(_0x4ecae5,_0x30a410){return function(_0x3c8d49){if(!_0x3c8d49){_0x4ecae5[_0x2e5e('0x1a')](0x194);}return _0x3c8d49;};}function handleError(_0xa1a99f,_0x5b1c4a){_0x5b1c4a=_0x5b1c4a||0x1f4;return function(_0x550dcd){logger[_0x2e5e('0x28')](_0x550dcd['stack']);if(_0x550dcd[_0x2e5e('0x29')]){delete _0x550dcd[_0x2e5e('0x29')];}_0xa1a99f['status'](_0x5b1c4a)[_0x2e5e('0x2a')](_0x550dcd);};}exports[_0x2e5e('0x2b')]=function(_0x417fe9,_0x114904){var _0x350b06={},_0x58a810={},_0x3f6fef={'count':0x0,'rows':[]};var _0x547264=_['map'](db[_0x2e5e('0x2c')]['rawAttributes'],function(_0x58ec33){return{'name':_0x58ec33['fieldName'],'type':_0x58ec33['type']['key']};});_0x58a810['model']=_['map'](_0x547264,_0x2e5e('0x29'));_0x58a810[_0x2e5e('0x2d')]=_[_0x2e5e('0x2e')](_0x417fe9[_0x2e5e('0x2d')]);_0x58a810[_0x2e5e('0x2f')]=_['intersection'](_0x58a810[_0x2e5e('0x30')],_0x58a810[_0x2e5e('0x2d')]);_0x350b06[_0x2e5e('0x31')]=_[_0x2e5e('0x32')](_0x58a810[_0x2e5e('0x30')],qs[_0x2e5e('0x33')](_0x417fe9[_0x2e5e('0x2d')][_0x2e5e('0x33')]));_0x350b06['attributes']=_0x350b06[_0x2e5e('0x31')][_0x2e5e('0x34')]?_0x350b06[_0x2e5e('0x31')]:_0x58a810['model'];if(!_0x417fe9[_0x2e5e('0x2d')][_0x2e5e('0x35')](_0x2e5e('0x36'))){_0x350b06[_0x2e5e('0x20')]=qs[_0x2e5e('0x20')](_0x417fe9['query'][_0x2e5e('0x20')]);_0x350b06[_0x2e5e('0x1e')]=qs[_0x2e5e('0x1e')](_0x417fe9['query'][_0x2e5e('0x1e')]);}_0x350b06['order']=qs[_0x2e5e('0x37')](_0x417fe9['query'][_0x2e5e('0x37')]);_0x350b06['where']=qs[_0x2e5e('0x2f')](_[_0x2e5e('0x38')](_0x417fe9[_0x2e5e('0x2d')],_0x58a810[_0x2e5e('0x2f')]),_0x547264);if(_0x417fe9[_0x2e5e('0x2d')][_0x2e5e('0x39')]){_0x350b06[_0x2e5e('0x3a')]=_['merge'](_0x350b06['where'],{'$or':_[_0x2e5e('0x3b')](_0x547264,function(_0x114dd6){if(_0x114dd6[_0x2e5e('0x3c')]!==_0x2e5e('0x3d')){var _0x2936bf={};_0x2936bf[_0x114dd6[_0x2e5e('0x29')]]={'$like':'%'+_0x417fe9[_0x2e5e('0x2d')][_0x2e5e('0x39')]+'%'};return _0x2936bf;}})});}_0x350b06=_[_0x2e5e('0x3e')]({},_0x350b06,_0x417fe9['options']);var _0x5c801d={'where':_0x350b06['where']};return db['Schedule']['count'](_0x5c801d)[_0x2e5e('0x27')](function(_0x5a8289){_0x3f6fef[_0x2e5e('0x3f')]=_0x5a8289;if(_0x417fe9['query'][_0x2e5e('0x40')]){_0x350b06['include']=[{'all':!![]}];}return db['Schedule'][_0x2e5e('0x41')](_0x350b06);})[_0x2e5e('0x27')](function(_0x462ee4){_0x3f6fef[_0x2e5e('0x42')]=_0x462ee4;return _0x3f6fef;})[_0x2e5e('0x27')](respondWithFilteredResult(_0x114904,_0x350b06))['catch'](handleError(_0x114904,null));};exports[_0x2e5e('0x43')]=function(_0x1127f2,_0x2a5a09){var _0x385fa0={'raw':![],'where':{'id':_0x1127f2['params']['id']}},_0x25308f={};_0x25308f[_0x2e5e('0x30')]=_[_0x2e5e('0x2e')](db[_0x2e5e('0x2c')][_0x2e5e('0x44')]);_0x25308f[_0x2e5e('0x2d')]=_['keys'](_0x1127f2['query']);_0x25308f[_0x2e5e('0x2f')]=_[_0x2e5e('0x32')](_0x25308f[_0x2e5e('0x30')],_0x25308f[_0x2e5e('0x2d')]);_0x385fa0[_0x2e5e('0x31')]=_[_0x2e5e('0x32')](_0x25308f[_0x2e5e('0x30')],qs[_0x2e5e('0x33')](_0x1127f2[_0x2e5e('0x2d')][_0x2e5e('0x33')]));_0x385fa0['attributes']=_0x385fa0[_0x2e5e('0x31')][_0x2e5e('0x34')]?_0x385fa0[_0x2e5e('0x31')]:_0x25308f[_0x2e5e('0x30')];if(_0x1127f2['query'][_0x2e5e('0x40')]){_0x385fa0[_0x2e5e('0x45')]=[{'all':!![]}];}_0x385fa0=_[_0x2e5e('0x3e')]({},_0x385fa0,_0x1127f2[_0x2e5e('0x46')]);return db['Schedule'][_0x2e5e('0x47')](_0x385fa0)['then'](handleEntityNotFound(_0x2a5a09,null))[_0x2e5e('0x27')](respondWithResult(_0x2a5a09,null))[_0x2e5e('0x48')](handleError(_0x2a5a09,null));};exports[_0x2e5e('0x49')]=function(_0x1a72aa,_0x11f890){return db['Schedule'][_0x2e5e('0x49')](_0x1a72aa['body'],{})[_0x2e5e('0x27')](function(_0x576741){var _0x29a67f=_0x1a72aa[_0x2e5e('0x4a')]['get']({'plain':!![]});if(!_0x29a67f)throw new Error(_0x2e5e('0x4b'));if(_0x29a67f[_0x2e5e('0x4c')]===_0x2e5e('0x4a')){var _0x51bce1=_0x576741['get']({'plain':!![]});var _0x4b02b7=_0x2e5e('0x25');return db[_0x2e5e('0x4d')][_0x2e5e('0x47')]({'where':{'name':_0x4b02b7,'userProfileId':_0x29a67f[_0x2e5e('0x4e')]},'raw':!![]})[_0x2e5e('0x27')](function(_0x53639a){if(_0x53639a&&_0x53639a[_0x2e5e('0x4f')]===0x0){return db['UserProfileResource'][_0x2e5e('0x49')]({'name':_0x51bce1[_0x2e5e('0x29')],'resourceId':_0x51bce1['id'],'type':_0x53639a[_0x2e5e('0x29')],'sectionId':_0x53639a['id']},{})[_0x2e5e('0x27')](function(){return _0x576741;});}else{return _0x576741;}})[_0x2e5e('0x48')](function(_0x55229a){logger['error'](_0x2e5e('0x50'),_0x55229a);throw _0x55229a;});}return _0x576741;})[_0x2e5e('0x27')](respondWithResult(_0x11f890,0xc9))[_0x2e5e('0x48')](handleError(_0x11f890,null));};exports[_0x2e5e('0x23')]=function(_0x3c6568,_0xdb94de){if(_0x3c6568[_0x2e5e('0x51')]['id']){delete _0x3c6568[_0x2e5e('0x51')]['id'];}return db[_0x2e5e('0x2c')][_0x2e5e('0x47')]({'where':{'id':_0x3c6568['params']['id']}})[_0x2e5e('0x27')](handleEntityNotFound(_0xdb94de,null))[_0x2e5e('0x27')](saveUpdates(_0x3c6568[_0x2e5e('0x51')],null))['then'](respondWithResult(_0xdb94de,null))['catch'](handleError(_0xdb94de,null));};exports['destroy']=function(_0x1d90e8,_0x39d775){return db['Schedule'][_0x2e5e('0x47')]({'where':{'id':_0x1d90e8[_0x2e5e('0x52')]['id']}})['then'](handleEntityNotFound(_0x39d775,null))['then'](removeEntity(_0x39d775,null))[_0x2e5e('0x48')](handleError(_0x39d775,null));};exports[_0x2e5e('0x53')]=function(_0x1fa030,_0x34f713,_0x728f79){var _0x4b6680=require(_0x2e5e('0x54'));return db[_0x2e5e('0x2c')][_0x2e5e('0x47')]({'where':{'id':_0x1fa030['params']['id']},'raw':!![]})[_0x2e5e('0x27')](handleEntityNotFound(_0x34f713,null))[_0x2e5e('0x27')](function(){_0x4b6680['run'](_0x1fa030['params']['id']);})[_0x2e5e('0x27')](respondWithStatusCode(_0x34f713,null))[_0x2e5e('0x48')](handleError(_0x34f713,null));}; \ No newline at end of file +var _0xb061=['offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','get','Scheduler','end','sendStatus','error','name','send','index','Schedule','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','include','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','run','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xb061,0x8a));var _0x1b06=function(_0x2ac512,_0x18d0fc){_0x2ac512=_0x2ac512-0x0;var _0x41a20e=_0xb061[_0x2ac512];return _0x41a20e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b06('0x0'));var zipdir=require(_0x1b06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b06('0x2'));var moment=require(_0x1b06('0x3'));var BPromise=require(_0x1b06('0x4'));var Mustache=require(_0x1b06('0x5'));var util=require(_0x1b06('0x6'));var path=require(_0x1b06('0x7'));var sox=require(_0x1b06('0x8'));var csv=require(_0x1b06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b06('0xa'));var _=require(_0x1b06('0xb'));var squel=require(_0x1b06('0xc'));var crypto=require(_0x1b06('0xd'));var jsforce=require(_0x1b06('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1b06('0x9'));var querystring=require(_0x1b06('0xf'));var Papa=require(_0x1b06('0x10'));var Redis=require(_0x1b06('0x11'));var authService=require(_0x1b06('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1b06('0x13'));var hardwareService=require(_0x1b06('0x14'));var logger=require(_0x1b06('0x15'))(_0x1b06('0x16'));var utils=require(_0x1b06('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1b06('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6c1e,_0xbd4c6e){_0xbd4c6e=_0xbd4c6e||0xcc;return function(_0x4a34b5){if(_0x4a34b5){return _0x1d6c1e['sendStatus'](_0xbd4c6e);}return _0x1d6c1e['status'](_0xbd4c6e)['end']();};}function respondWithResult(_0x4b4f9c,_0x55c1e0){_0x55c1e0=_0x55c1e0||0xc8;return function(_0x159a4f){if(_0x159a4f){return _0x4b4f9c[_0x1b06('0x19')](_0x55c1e0)['json'](_0x159a4f);}};}function respondWithFilteredResult(_0xf1e477,_0x1091c2){return function(_0xd9d4f){if(_0xd9d4f){var _0x51df2f=typeof _0x1091c2[_0x1b06('0x1a')]===_0x1b06('0x1b')&&typeof _0x1091c2[_0x1b06('0x1c')]===_0x1b06('0x1b');var _0x2f4562=_0xd9d4f['count'];var _0x4de98e=_0x51df2f?0x0:_0x1091c2[_0x1b06('0x1a')];var _0x28de02=_0x51df2f?_0xd9d4f['count']:_0x1091c2[_0x1b06('0x1a')]+_0x1091c2[_0x1b06('0x1c')];var _0x58c106;if(_0x28de02>=_0x2f4562){_0x28de02=_0x2f4562;_0x58c106=0xc8;}else{_0x58c106=0xce;}_0xf1e477['status'](_0x58c106);return _0xf1e477['set'](_0x1b06('0x1d'),_0x4de98e+'-'+_0x28de02+'/'+_0x2f4562)[_0x1b06('0x1e')](_0xd9d4f);}return null;};}function patchUpdates(_0x21b4ea){return function(_0x3a927e){try{jsonpatch[_0x1b06('0x1f')](_0x3a927e,_0x21b4ea,!![]);}catch(_0x1fcfa9){return BPromise[_0x1b06('0x20')](_0x1fcfa9);}return _0x3a927e['save']();};}function saveUpdates(_0x215376,_0x396236){return function(_0x586cc7){if(_0x586cc7){return _0x586cc7[_0x1b06('0x21')](_0x215376)[_0x1b06('0x22')](function(_0x492f45){return _0x492f45;});}return null;};}function removeEntity(_0x4196dc,_0x2debe2){return function(_0x223aca){if(_0x223aca){return _0x223aca[_0x1b06('0x23')]()[_0x1b06('0x22')](function(){var _0x590c4d=_0x223aca[_0x1b06('0x24')]({'plain':!![]});var _0x23b4e7=_0x1b06('0x25');return db['UserProfileResource'][_0x1b06('0x23')]({'where':{'type':_0x23b4e7,'resourceId':_0x590c4d['id']}})[_0x1b06('0x22')](function(){return _0x223aca;});})[_0x1b06('0x22')](function(){_0x4196dc[_0x1b06('0x19')](0xcc)[_0x1b06('0x26')]();});}};}function handleEntityNotFound(_0x5e9713,_0x5d738a){return function(_0x527ac4){if(!_0x527ac4){_0x5e9713[_0x1b06('0x27')](0x194);}return _0x527ac4;};}function handleError(_0x4073a1,_0x3d4aa3){_0x3d4aa3=_0x3d4aa3||0x1f4;return function(_0xb52f74){logger[_0x1b06('0x28')](_0xb52f74['stack']);if(_0xb52f74[_0x1b06('0x29')]){delete _0xb52f74[_0x1b06('0x29')];}_0x4073a1[_0x1b06('0x19')](_0x3d4aa3)[_0x1b06('0x2a')](_0xb52f74);};}exports[_0x1b06('0x2b')]=function(_0x28bae3,_0x2d2268){var _0x40f706={},_0x23ea33={},_0x4b5a7c={'count':0x0,'rows':[]};var _0x36043b=_['map'](db[_0x1b06('0x2c')][_0x1b06('0x2d')],function(_0x3d5d43){return{'name':_0x3d5d43['fieldName'],'type':_0x3d5d43['type']['key']};});_0x23ea33[_0x1b06('0x2e')]=_['map'](_0x36043b,_0x1b06('0x29'));_0x23ea33[_0x1b06('0x2f')]=_['keys'](_0x28bae3[_0x1b06('0x2f')]);_0x23ea33[_0x1b06('0x30')]=_[_0x1b06('0x31')](_0x23ea33[_0x1b06('0x2e')],_0x23ea33[_0x1b06('0x2f')]);_0x40f706[_0x1b06('0x32')]=_[_0x1b06('0x31')](_0x23ea33['model'],qs[_0x1b06('0x33')](_0x28bae3['query']['fields']));_0x40f706[_0x1b06('0x32')]=_0x40f706['attributes'][_0x1b06('0x34')]?_0x40f706[_0x1b06('0x32')]:_0x23ea33['model'];if(!_0x28bae3[_0x1b06('0x2f')][_0x1b06('0x35')](_0x1b06('0x36'))){_0x40f706[_0x1b06('0x1c')]=qs[_0x1b06('0x1c')](_0x28bae3[_0x1b06('0x2f')]['limit']);_0x40f706['offset']=qs[_0x1b06('0x1a')](_0x28bae3[_0x1b06('0x2f')][_0x1b06('0x1a')]);}_0x40f706[_0x1b06('0x37')]=qs[_0x1b06('0x38')](_0x28bae3['query'][_0x1b06('0x38')]);_0x40f706[_0x1b06('0x39')]=qs[_0x1b06('0x30')](_[_0x1b06('0x3a')](_0x28bae3[_0x1b06('0x2f')],_0x23ea33[_0x1b06('0x30')]),_0x36043b);if(_0x28bae3['query'][_0x1b06('0x3b')]){_0x40f706['where']=_[_0x1b06('0x3c')](_0x40f706[_0x1b06('0x39')],{'$or':_[_0x1b06('0x3d')](_0x36043b,function(_0x4d4c66){if(_0x4d4c66[_0x1b06('0x3e')]!==_0x1b06('0x3f')){var _0x2e6c0c={};_0x2e6c0c[_0x4d4c66[_0x1b06('0x29')]]={'$like':'%'+_0x28bae3['query']['filter']+'%'};return _0x2e6c0c;}})});}_0x40f706=_[_0x1b06('0x3c')]({},_0x40f706,_0x28bae3[_0x1b06('0x40')]);var _0x37a721={'where':_0x40f706[_0x1b06('0x39')]};return db[_0x1b06('0x2c')][_0x1b06('0x41')](_0x37a721)[_0x1b06('0x22')](function(_0x28076b){_0x4b5a7c[_0x1b06('0x41')]=_0x28076b;if(_0x28bae3[_0x1b06('0x2f')]['includeAll']){_0x40f706[_0x1b06('0x42')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x40f706);})[_0x1b06('0x22')](function(_0x14959a){_0x4b5a7c[_0x1b06('0x43')]=_0x14959a;return _0x4b5a7c;})[_0x1b06('0x22')](respondWithFilteredResult(_0x2d2268,_0x40f706))[_0x1b06('0x44')](handleError(_0x2d2268,null));};exports[_0x1b06('0x45')]=function(_0x132019,_0x45c76c){var _0x1fd0be={'raw':![],'where':{'id':_0x132019[_0x1b06('0x46')]['id']}},_0x1aa5ef={};_0x1aa5ef[_0x1b06('0x2e')]=_[_0x1b06('0x47')](db[_0x1b06('0x2c')][_0x1b06('0x2d')]);_0x1aa5ef[_0x1b06('0x2f')]=_[_0x1b06('0x47')](_0x132019[_0x1b06('0x2f')]);_0x1aa5ef['filters']=_[_0x1b06('0x31')](_0x1aa5ef[_0x1b06('0x2e')],_0x1aa5ef['query']);_0x1fd0be[_0x1b06('0x32')]=_[_0x1b06('0x31')](_0x1aa5ef[_0x1b06('0x2e')],qs['fields'](_0x132019['query'][_0x1b06('0x33')]));_0x1fd0be[_0x1b06('0x32')]=_0x1fd0be[_0x1b06('0x32')][_0x1b06('0x34')]?_0x1fd0be[_0x1b06('0x32')]:_0x1aa5ef[_0x1b06('0x2e')];if(_0x132019['query'][_0x1b06('0x48')]){_0x1fd0be[_0x1b06('0x42')]=[{'all':!![]}];}_0x1fd0be=_['merge']({},_0x1fd0be,_0x132019['options']);return db[_0x1b06('0x2c')][_0x1b06('0x49')](_0x1fd0be)[_0x1b06('0x22')](handleEntityNotFound(_0x45c76c,null))[_0x1b06('0x22')](respondWithResult(_0x45c76c,null))[_0x1b06('0x44')](handleError(_0x45c76c,null));};exports[_0x1b06('0x4a')]=function(_0xa96c6,_0x324812){return db[_0x1b06('0x2c')][_0x1b06('0x4a')](_0xa96c6[_0x1b06('0x4b')],{})[_0x1b06('0x22')](function(_0x599dbb){var _0x16f853=_0xa96c6['user'][_0x1b06('0x24')]({'plain':!![]});if(!_0x16f853)throw new Error(_0x1b06('0x4c'));if(_0x16f853[_0x1b06('0x4d')]==='user'){var _0x5229d4=_0x599dbb[_0x1b06('0x24')]({'plain':!![]});var _0x3428f3='Scheduler';return db[_0x1b06('0x4e')][_0x1b06('0x49')]({'where':{'name':_0x3428f3,'userProfileId':_0x16f853[_0x1b06('0x4f')]},'raw':!![]})[_0x1b06('0x22')](function(_0x367e8d){if(_0x367e8d&&_0x367e8d['autoAssociation']===0x0){return db[_0x1b06('0x50')][_0x1b06('0x4a')]({'name':_0x5229d4[_0x1b06('0x29')],'resourceId':_0x5229d4['id'],'type':_0x367e8d[_0x1b06('0x29')],'sectionId':_0x367e8d['id']},{})[_0x1b06('0x22')](function(){return _0x599dbb;});}else{return _0x599dbb;}})[_0x1b06('0x44')](function(_0x5be7a4){logger[_0x1b06('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5be7a4);throw _0x5be7a4;});}return _0x599dbb;})[_0x1b06('0x22')](respondWithResult(_0x324812,0xc9))['catch'](handleError(_0x324812,null));};exports['update']=function(_0x1fe464,_0x20754f){if(_0x1fe464['body']['id']){delete _0x1fe464[_0x1b06('0x4b')]['id'];}return db[_0x1b06('0x2c')]['find']({'where':{'id':_0x1fe464['params']['id']}})[_0x1b06('0x22')](handleEntityNotFound(_0x20754f,null))[_0x1b06('0x22')](saveUpdates(_0x1fe464[_0x1b06('0x4b')],null))[_0x1b06('0x22')](respondWithResult(_0x20754f,null))[_0x1b06('0x44')](handleError(_0x20754f,null));};exports[_0x1b06('0x23')]=function(_0x2600be,_0x12d854){return db[_0x1b06('0x2c')][_0x1b06('0x49')]({'where':{'id':_0x2600be[_0x1b06('0x46')]['id']}})[_0x1b06('0x22')](handleEntityNotFound(_0x12d854,null))[_0x1b06('0x22')](removeEntity(_0x12d854,null))[_0x1b06('0x44')](handleError(_0x12d854,null));};exports[_0x1b06('0x51')]=function(_0x500805,_0x21f8cb,_0x4e9e2d){var _0x34be66=require('../../config/schedule');return db[_0x1b06('0x2c')]['find']({'where':{'id':_0x500805[_0x1b06('0x46')]['id']},'raw':!![]})[_0x1b06('0x22')](handleEntityNotFound(_0x21f8cb,null))[_0x1b06('0x22')](function(){_0x34be66[_0x1b06('0x51')](_0x500805['params']['id']);})['then'](respondWithStatusCode(_0x21f8cb,null))['catch'](handleError(_0x21f8cb,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3313977..c2a89a9 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 _0x2803=['bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','api','moment'];(function(_0x490c7a,_0x953e28){var _0x4ec7c8=function(_0x113f06){while(--_0x113f06){_0x490c7a['push'](_0x490c7a['shift']());}};_0x4ec7c8(++_0x953e28);}(_0x2803,0x111));var _0x3280=function(_0x9277ed,_0x7f634a){_0x9277ed=_0x9277ed-0x0;var _0x40813a=_0x2803[_0x9277ed];return _0x40813a;};'use strict';var _=require(_0x3280('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3280('0x1'));var moment=require(_0x3280('0x2'));var BPromise=require(_0x3280('0x3'));var rp=require(_0x3280('0x4'));var fs=require('fs');var path=require(_0x3280('0x5'));var rimraf=require(_0x3280('0x6'));var config=require('../../config/environment');var attributes=require(_0x3280('0x7'));module[_0x3280('0x8')]=function(_0x360ced,_0x1a716c){return _0x360ced[_0x3280('0x9')](_0x3280('0xa'),attributes,{'tableName':_0x3280('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9158=['path','rimraf','../../config/environment','exports','define','Schedule','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3e4eaf,_0x1eed89){var _0x423ee9=function(_0x3501ca){while(--_0x3501ca){_0x3e4eaf['push'](_0x3e4eaf['shift']());}};_0x423ee9(++_0x1eed89);}(_0x9158,0x186));var _0x8915=function(_0x196a21,_0x331324){_0x196a21=_0x196a21-0x0;var _0xf08524=_0x9158[_0x196a21];return _0xf08524;};'use strict';var _=require(_0x8915('0x0'));var util=require(_0x8915('0x1'));var logger=require('../../config/logger')(_0x8915('0x2'));var moment=require(_0x8915('0x3'));var BPromise=require(_0x8915('0x4'));var rp=require(_0x8915('0x5'));var fs=require('fs');var path=require(_0x8915('0x6'));var rimraf=require(_0x8915('0x7'));var config=require(_0x8915('0x8'));var attributes=require('./schedule.attributes');module[_0x8915('0x9')]=function(_0x2adfeb,_0x3fee21){return _0x2adfeb[_0x8915('0xa')](_0x8915('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8ff84e6..61a893e 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 _0x4bb5=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4bb5,0x1de));var _0x54bb=function(_0x1fed26,_0x16c640){_0x1fed26=_0x1fed26-0x0;var _0x5e0aa2=_0x4bb5[_0x1fed26];return _0x5e0aa2;};'use strict';var _=require(_0x54bb('0x0'));var util=require(_0x54bb('0x1'));var moment=require(_0x54bb('0x2'));var BPromise=require(_0x54bb('0x3'));var rs=require(_0x54bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x54bb('0x5'));var logger=require(_0x54bb('0x6'))(_0x54bb('0x7'));var config=require(_0x54bb('0x8'));var jayson=require(_0x54bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2746,_0x4afac0,_0x1d67cd){return new BPromise(function(_0x5d838f,_0xeee122){return client[_0x54bb('0xa')](_0x5f2746,_0x1d67cd)[_0x54bb('0xb')](function(_0x249c02){logger[_0x54bb('0xc')](_0x54bb('0xd'),_0x4afac0,'request\x20sent');logger[_0x54bb('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4afac0,_0x54bb('0xf'),JSON['stringify'](_0x249c02));if(_0x249c02[_0x54bb('0x10')]){if(_0x249c02[_0x54bb('0x10')]['code']===0x1f4){logger['error'](_0x54bb('0xd'),_0x4afac0,_0x249c02[_0x54bb('0x10')][_0x54bb('0x11')]);return _0xeee122(_0x249c02[_0x54bb('0x10')][_0x54bb('0x11')]);}logger[_0x54bb('0x10')](_0x54bb('0xd'),_0x4afac0,_0x249c02[_0x54bb('0x10')][_0x54bb('0x11')]);return _0x5d838f(_0x249c02[_0x54bb('0x10')][_0x54bb('0x11')]);}else{logger[_0x54bb('0xc')](_0x54bb('0xd'),_0x4afac0,_0x54bb('0xf'));_0x5d838f(_0x249c02[_0x54bb('0x12')][_0x54bb('0x11')]);}})[_0x54bb('0x13')](function(_0x8e732c){logger[_0x54bb('0x10')](_0x54bb('0xd'),_0x4afac0,_0x8e732c);_0xeee122(_0x8e732c);});});} \ No newline at end of file +var _0xc785=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis'];(function(_0x1a13c7,_0x590def){var _0x5bf588=function(_0x3604fb){while(--_0x3604fb){_0x1a13c7['push'](_0x1a13c7['shift']());}};_0x5bf588(++_0x590def);}(_0xc785,0xbc));var _0x5c78=function(_0xbbcd81,_0x4ae16e){_0xbbcd81=_0xbbcd81-0x0;var _0x5f7d4c=_0xc785[_0xbbcd81];return _0x5f7d4c;};'use strict';var _=require(_0x5c78('0x0'));var util=require(_0x5c78('0x1'));var moment=require(_0x5c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c78('0x3'));var db=require(_0x5c78('0x4'))['db'];var utils=require(_0x5c78('0x5'));var logger=require(_0x5c78('0x6'))(_0x5c78('0x7'));var config=require(_0x5c78('0x8'));var jayson=require(_0x5c78('0x9'));var client=jayson[_0x5c78('0xa')][_0x5c78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17308c,_0x8bf36f,_0x19a096){return new BPromise(function(_0x12019b,_0x55e4aa){return client['request'](_0x17308c,_0x19a096)[_0x5c78('0xc')](function(_0x4af369){logger[_0x5c78('0xd')](_0x5c78('0xe'),_0x8bf36f,'request\x20sent');logger[_0x5c78('0xf')](_0x5c78('0x10'),_0x8bf36f,'request\x20sent',JSON[_0x5c78('0x11')](_0x4af369));if(_0x4af369[_0x5c78('0x12')]){if(_0x4af369[_0x5c78('0x12')][_0x5c78('0x13')]===0x1f4){logger['error'](_0x5c78('0xe'),_0x8bf36f,_0x4af369[_0x5c78('0x12')]['message']);return _0x55e4aa(_0x4af369['error'][_0x5c78('0x14')]);}logger[_0x5c78('0x12')]('Schedule,\x20%s,\x20%s',_0x8bf36f,_0x4af369[_0x5c78('0x12')]['message']);return _0x12019b(_0x4af369[_0x5c78('0x12')][_0x5c78('0x14')]);}else{logger['info'](_0x5c78('0xe'),_0x8bf36f,_0x5c78('0x15'));_0x12019b(_0x4af369[_0x5c78('0x16')][_0x5c78('0x14')]);}})[_0x5c78('0x17')](function(_0x1e2e1f){logger[_0x5c78('0x12')]('Schedule,\x20%s,\x20%s',_0x8bf36f,_0x1e2e1f);_0x55e4aa(_0x1e2e1f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 1788840..8527348 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 _0xefad=['/:id/download','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x286b47,_0x3b6bb2){var _0x6cd353=function(_0x4f4e47){while(--_0x4f4e47){_0x286b47['push'](_0x286b47['shift']());}};_0x6cd353(++_0x3b6bb2);}(_0xefad,0x1ed));var _0xdefa=function(_0x3cbe85,_0x4c3091){_0x3cbe85=_0x3cbe85-0x0;var _0x396936=_0xefad[_0x3cbe85];return _0x396936;};'use strict';var multer=require('multer');var util=require(_0xdefa('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdefa('0x1')]();var fs_extra=require(_0xdefa('0x2'));var auth=require(_0xdefa('0x3'));var interaction=require(_0xdefa('0x4'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0xdefa('0x5')]('/',auth[_0xdefa('0x6')](),controller[_0xdefa('0x7')]);router[_0xdefa('0x5')](_0xdefa('0x8'),auth[_0xdefa('0x6')](),controller['describe']);router[_0xdefa('0x5')](_0xdefa('0x9'),auth['isAuthenticated'](),controller[_0xdefa('0xa')]);router[_0xdefa('0x5')](_0xdefa('0xb'),auth[_0xdefa('0x6')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xdefa('0xc')]);router[_0xdefa('0xd')](_0xdefa('0x9'),auth[_0xdefa('0x6')](),controller[_0xdefa('0xe')]);router[_0xdefa('0xf')]('/:id',auth[_0xdefa('0x6')](),controller[_0xdefa('0x10')]);module[_0xdefa('0x11')]=router; \ No newline at end of file +var _0xe16a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x19924d,_0x5b11a5){var _0x2889c9=function(_0x335c69){while(--_0x335c69){_0x19924d['push'](_0x19924d['shift']());}};_0x2889c9(++_0x5b11a5);}(_0xe16a,0x11e));var _0xae16=function(_0x2d76cd,_0x1a07a3){_0x2d76cd=_0x2d76cd-0x0;var _0x4747c2=_0xe16a[_0x2d76cd];return _0x4747c2;};'use strict';var multer=require(_0xae16('0x0'));var util=require(_0xae16('0x1'));var path=require(_0xae16('0x2'));var timeout=require(_0xae16('0x3'));var express=require(_0xae16('0x4'));var router=express[_0xae16('0x5')]();var fs_extra=require(_0xae16('0x6'));var auth=require(_0xae16('0x7'));var interaction=require(_0xae16('0x8'));var config=require('../../config/environment');var controller=require(_0xae16('0x9'));router[_0xae16('0xa')]('/',auth[_0xae16('0xb')](),controller['index']);router[_0xae16('0xa')](_0xae16('0xc'),auth[_0xae16('0xb')](),controller['describe']);router[_0xae16('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xae16('0xd')]);router[_0xae16('0xa')](_0xae16('0xe'),auth[_0xae16('0xb')](),controller[_0xae16('0xf')]);router[_0xae16('0x10')]('/',auth['isAuthenticated'](),controller[_0xae16('0x11')]);router[_0xae16('0x12')]('/:id',auth[_0xae16('0xb')](),controller[_0xae16('0x13')]);router[_0xae16('0x14')](_0xae16('0x15'),auth[_0xae16('0xb')](),controller[_0xae16('0x16')]);module[_0xae16('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 37412fc..eb0441c 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 _0x65cb=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports'];(function(_0x5ad0cd,_0x37eece){var _0x1487d8=function(_0x16e8ca){while(--_0x16e8ca){_0x5ad0cd['push'](_0x5ad0cd['shift']());}};_0x1487d8(++_0x37eece);}(_0x65cb,0xa4));var _0xb65c=function(_0x20b68c,_0x17d470){_0x20b68c=_0x20b68c-0x0;var _0x1d3565=_0x65cb[_0x20b68c];return _0x1d3565;};'use strict';var Sequelize=require(_0xb65c('0x0'));var moment=require('moment');var path=require(_0xb65c('0x1'));var config=require(_0xb65c('0x2'));module[_0xb65c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb65c('0x4')](_0xb65c('0x5'))?path[_0xb65c('0x6')](this[_0xb65c('0x4')](_0xb65c('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb65c('0x7')]},'value':{'type':Sequelize[_0xb65c('0x7')],'set':function(_0x25087d){var _0xacb77d=_0x25087d[_0xb65c('0x8')](/\\/g,'/');this[_0xb65c('0x9')](_0xb65c('0x5'),_0xacb77d);}},'rating':{'type':Sequelize[_0xb65c('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x43e68f){this[_0xb65c('0x9')](_0xb65c('0xb'),moment()[_0xb65c('0xc')](_0x43e68f,'ms'));this['setDataValue'](_0xb65c('0xd'),moment());this['setDataValue'](_0xb65c('0xe'),_0x43e68f);}},'startedAt':{'type':Sequelize[_0xb65c('0xf')],'get':function(){return moment(this[_0xb65c('0x4')](_0xb65c('0xb')))[_0xb65c('0x10')](_0xb65c('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0xb65c('0xf')],'get':function(){return moment(this[_0xb65c('0x4')](_0xb65c('0xd')))[_0xb65c('0x10')](_0xb65c('0x11'))[_0xb65c('0x12')]();}},'createdAt':{'type':Sequelize[_0xb65c('0xf')],'get':function(){return moment(this['getDataValue'](_0xb65c('0x13')))[_0xb65c('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xb65c('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb65c('0x4')](_0xb65c('0x14')))[_0xb65c('0x10')](_0xb65c('0x11'))[_0xb65c('0x12')]();}}}; \ No newline at end of file +var _0x1681=['getDataValue','value','STRING','replace','INTEGER','setDataValue','subtract','duration','DATE','startedAt','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','path','../../config/environment','exports','VIRTUAL'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x1168('0x0'));var config=require(_0x1168('0x1'));module[_0x1168('0x2')]={'format':{'type':Sequelize[_0x1168('0x3')],'get':function(){return this[_0x1168('0x4')](_0x1168('0x5'))?path['extname'](this['getDataValue'](_0x1168('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x1168('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x1168('0x6')],'set':function(_0x1d0634){var _0x5e6752=_0x1d0634[_0x1168('0x7')](/\\/g,'/');this['setDataValue'](_0x1168('0x5'),_0x5e6752);}},'rating':{'type':Sequelize[_0x1168('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x38096f){this[_0x1168('0x9')]('startedAt',moment()[_0x1168('0xa')](_0x38096f,'ms'));this[_0x1168('0x9')]('closedAt',moment());this['setDataValue'](_0x1168('0xb'),_0x38096f);}},'startedAt':{'type':Sequelize[_0x1168('0xc')],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0xd')))[_0x1168('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1168('0xf')]();}},'closedAt':{'type':Sequelize[_0x1168('0xc')],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0x10')))[_0x1168('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1168('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0x11')))['format'](_0x1168('0x12'))[_0x1168('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1168('0x4')]('updatedAt'))[_0x1168('0xe')](_0x1168('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 45bc211..cd2b553 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 _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0x4c4e,0x152));var _0xe4c4=function(_0x3f6540,_0x52d562){_0x3f6540=_0x3f6540-0x0;var _0x4d4d53=_0x4c4e[_0x3f6540];return _0x4d4d53;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));}; \ No newline at end of file +var _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0xe230f6,_0x506e40){var _0x3382b0=function(_0xcf8ce8){while(--_0xcf8ce8){_0xe230f6['push'](_0xe230f6['shift']());}};_0x3382b0(++_0x506e40);}(_0xac9d,0x14d));var _0xdac9=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0xac9d[_0x34473f];return _0x25cf6f;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ac14fdb..8cbcad5 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 _0x7c29=['screen_recordings','interactionid','lodash','util','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x111557,_0x4671f4){var _0xc99165=function(_0x24fbac){while(--_0x24fbac){_0x111557['push'](_0x111557['shift']());}};_0xc99165(++_0x4671f4);}(_0x7c29,0x106));var _0x97c2=function(_0x3f20d4,_0x30d77b){_0x3f20d4=_0x3f20d4-0x0;var _0x27448a=_0x7c29[_0x3f20d4];return _0x27448a;};'use strict';var _=require(_0x97c2('0x0'));var util=require(_0x97c2('0x1'));var logger=require('../../config/logger')(_0x97c2('0x2'));var moment=require(_0x97c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x97c2('0x4'));var fs=require('fs');var path=require(_0x97c2('0x5'));var rimraf=require('rimraf');var config=require(_0x97c2('0x6'));var attributes=require(_0x97c2('0x7'));module[_0x97c2('0x8')]=function(_0x15c52b,_0x22ddab){return _0x15c52b[_0x97c2('0x9')](_0x97c2('0xa'),attributes,{'tableName':_0x97c2('0xb'),'paranoid':![],'indexes':[{'name':_0x97c2('0xc'),'fields':[_0x97c2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad35=['ScreenRecording','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5e4a31,_0x2d2c4b){var _0x27eaaf=function(_0x43cd5e){while(--_0x43cd5e){_0x5e4a31['push'](_0x5e4a31['shift']());}};_0x27eaaf(++_0x2d2c4b);}(_0xad35,0xfe));var _0x5ad3=function(_0x213b32,_0x1c1bf5){_0x213b32=_0x213b32-0x0;var _0x4e6767=_0xad35[_0x213b32];return _0x4e6767;};'use strict';var _=require(_0x5ad3('0x0'));var util=require(_0x5ad3('0x1'));var logger=require(_0x5ad3('0x2'))(_0x5ad3('0x3'));var moment=require('moment');var BPromise=require(_0x5ad3('0x4'));var rp=require(_0x5ad3('0x5'));var fs=require('fs');var path=require(_0x5ad3('0x6'));var rimraf=require(_0x5ad3('0x7'));var config=require(_0x5ad3('0x8'));var attributes=require(_0x5ad3('0x9'));module['exports']=function(_0x344e02,_0x216c79){return _0x344e02['define'](_0x5ad3('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5ad3('0xb'),'fields':[_0x5ad3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8394adb..6509d42 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 _0x20cc=['client','http','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x46be17,_0x546b37){var _0x4d4694=function(_0x528d19){while(--_0x528d19){_0x46be17['push'](_0x46be17['shift']());}};_0x4d4694(++_0x546b37);}(_0x20cc,0x84));var _0xc20c=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x20cc[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var moment=require(_0xc20c('0x2'));var BPromise=require(_0xc20c('0x3'));var rs=require(_0xc20c('0x4'));var fs=require('fs');var Redis=require(_0xc20c('0x5'));var db=require(_0xc20c('0x6'))['db'];var utils=require(_0xc20c('0x7'));var logger=require(_0xc20c('0x8'))(_0xc20c('0x9'));var config=require(_0xc20c('0xa'));var jayson=require(_0xc20c('0xb'));var client=jayson[_0xc20c('0xc')][_0xc20c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x143d06,_0x267f8b,_0x5911f2){return new BPromise(function(_0x454dec,_0xbf9835){return client['request'](_0x143d06,_0x5911f2)[_0xc20c('0xe')](function(_0x33b4b7){logger[_0xc20c('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x267f8b,_0xc20c('0x10'));logger[_0xc20c('0x11')](_0xc20c('0x12'),_0x267f8b,_0xc20c('0x10'),JSON[_0xc20c('0x13')](_0x33b4b7));if(_0x33b4b7[_0xc20c('0x14')]){if(_0x33b4b7[_0xc20c('0x14')]['code']===0x1f4){logger['error'](_0xc20c('0x15'),_0x267f8b,_0x33b4b7[_0xc20c('0x14')][_0xc20c('0x16')]);return _0xbf9835(_0x33b4b7[_0xc20c('0x14')][_0xc20c('0x16')]);}logger[_0xc20c('0x14')](_0xc20c('0x15'),_0x267f8b,_0x33b4b7['error'][_0xc20c('0x16')]);return _0x454dec(_0x33b4b7[_0xc20c('0x14')]['message']);}else{logger['info'](_0xc20c('0x15'),_0x267f8b,_0xc20c('0x10'));_0x454dec(_0x33b4b7['result']['message']);}})[_0xc20c('0x17')](function(_0x57d2af){logger['error'](_0xc20c('0x15'),_0x267f8b,_0x57d2af);_0xbf9835(_0x57d2af);});});} \ No newline at end of file +var _0xe45c=['then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xe45c,0x164));var _0xce45=function(_0x1a3b62,_0x58cd31){_0x1a3b62=_0x1a3b62-0x0;var _0x26edab=_0xe45c[_0x1a3b62];return _0x26edab;};'use strict';var _=require(_0xce45('0x0'));var util=require('util');var moment=require(_0xce45('0x1'));var BPromise=require('bluebird');var rs=require(_0xce45('0x2'));var fs=require('fs');var Redis=require(_0xce45('0x3'));var db=require(_0xce45('0x4'))['db'];var utils=require(_0xce45('0x5'));var logger=require(_0xce45('0x6'))('rpc');var config=require(_0xce45('0x7'));var jayson=require(_0xce45('0x8'));var client=jayson[_0xce45('0x9')][_0xce45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x546bdc,_0x4237a1,_0x1baf96){return new BPromise(function(_0x17b458,_0x7ec422){return client[_0xce45('0xb')](_0x546bdc,_0x1baf96)[_0xce45('0xc')](function(_0x4cf612){logger[_0xce45('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0xce45('0xe'));logger[_0xce45('0xf')](_0xce45('0x10'),_0x4237a1,_0xce45('0xe'),JSON['stringify'](_0x4cf612));if(_0x4cf612['error']){if(_0x4cf612[_0xce45('0x11')][_0xce45('0x12')]===0x1f4){logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x4cf612[_0xce45('0x11')]['message']);return _0x7ec422(_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);}logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);return _0x17b458(_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);}else{logger[_0xce45('0xd')](_0xce45('0x14'),_0x4237a1,_0xce45('0xe'));_0x17b458(_0x4cf612[_0xce45('0x15')][_0xce45('0x13')]);}})[_0xce45('0x16')](function(_0x27a5db){logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x27a5db);_0x7ec422(_0x27a5db);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 29304e4..e6c1a5a 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 _0x3c37=['extname','originalname','single','file','server/files/images/logos/','format','logologin','post','addLogoLogin','preferred','addPreferred','diskStorage','favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','isAuthenticated','index','/now','getDate','/:id','show','get','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','%s%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c37,0x170));var _0x73c3=function(_0x377af6,_0x5e581a){_0x377af6=_0x377af6-0x0;var _0xa7c603=_0x3c37[_0x377af6];return _0xa7c603;};'use strict';var multer=require(_0x73c3('0x0'));var util=require(_0x73c3('0x1'));var path=require(_0x73c3('0x2'));var timeout=require(_0x73c3('0x3'));var express=require(_0x73c3('0x4'));var router=express[_0x73c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x73c3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73c3('0x7'));var controller=require(_0x73c3('0x8'));router['get']('/',auth[_0x73c3('0x9')](),controller[_0x73c3('0xa')]);router['get'](_0x73c3('0xb'),controller[_0x73c3('0xc')]);router['get'](_0x73c3('0xd'),controller[_0x73c3('0xe')]);router[_0x73c3('0xf')](_0x73c3('0x10'),controller[_0x73c3('0x11')]);router[_0x73c3('0xf')](_0x73c3('0x12'),controller[_0x73c3('0x13')]);router[_0x73c3('0xf')]('/:id/gdpr',controller[_0x73c3('0x14')]);router[_0x73c3('0xf')](_0x73c3('0x15'),controller[_0x73c3('0x16')]);router[_0x73c3('0xf')](_0x73c3('0x17'),controller[_0x73c3('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45221a,_0x51ee10,_0x19844f){_0x19844f(null,path[_0x73c3('0x19')](config[_0x73c3('0x1a')],'server/files/images/logos/'));},'filename':function(_0x1621d0,_0x29713b,_0xd49cf8){_0xd49cf8(null,util['format'](_0x73c3('0x1b'),'logo',path[_0x73c3('0x1c')](_0x29713b[_0x73c3('0x1d')])));}})});router['post'](_0x73c3('0x10'),upload[_0x73c3('0x1e')](_0x73c3('0x1f')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x205f77,_0x48bde2,_0xfff12){_0xfff12(null,path[_0x73c3('0x19')](config[_0x73c3('0x1a')],_0x73c3('0x20')));},'filename':function(_0x3c0256,_0x24bdd6,_0x3718af){_0x3718af(null,util[_0x73c3('0x21')](_0x73c3('0x1b'),_0x73c3('0x22'),path[_0x73c3('0x1c')](_0x24bdd6[_0x73c3('0x1d')])));}})});router[_0x73c3('0x23')]('/:id/logo_login',upload[_0x73c3('0x1e')](_0x73c3('0x1f')),controller[_0x73c3('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ca285,_0x4c2c61,_0x32541c){_0x32541c(null,path[_0x73c3('0x19')](config[_0x73c3('0x1a')],'server/files/images/logos/'));},'filename':function(_0x57421b,_0x452d64,_0x5e5402){_0x5e5402(null,util[_0x73c3('0x21')](_0x73c3('0x1b'),_0x73c3('0x25'),path['extname'](_0x452d64[_0x73c3('0x1d')])));}})});router['post'](_0x73c3('0x15'),upload['single'](_0x73c3('0x1f')),controller[_0x73c3('0x26')]);var upload=multer({'storage':multer[_0x73c3('0x27')]({'destination':function(_0x32e7fe,_0x12f1af,_0x126f4d){_0x126f4d(null,path[_0x73c3('0x19')](config['root'],_0x73c3('0x20')));},'filename':function(_0x30d119,_0x47153f,_0x20c3ad){_0x20c3ad(null,util['format'](_0x73c3('0x1b'),_0x73c3('0x28'),path[_0x73c3('0x1c')](_0x47153f[_0x73c3('0x1d')])));}})});router['post'](_0x73c3('0x17'),upload['single'](_0x73c3('0x1f')),controller[_0x73c3('0x29')]);router[_0x73c3('0x2a')](_0x73c3('0xd'),auth[_0x73c3('0x9')](),controller['update']);module[_0x73c3('0x2b')]=router; \ No newline at end of file +var _0xbe92=['single','file','addLogo','root','server/files/images/logos/','addLogoLogin','preferred','addPreferred','/:id/favicon','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname','post'];(function(_0x40ff75,_0x7040dd){var _0x46e629=function(_0x50c700){while(--_0x50c700){_0x40ff75['push'](_0x40ff75['shift']());}};_0x46e629(++_0x7040dd);}(_0xbe92,0x139));var _0x2be9=function(_0x545a56,_0x4246c6){_0x545a56=_0x545a56-0x0;var _0xa82334=_0xbe92[_0x545a56];return _0xa82334;};'use strict';var multer=require('multer');var util=require(_0x2be9('0x0'));var path=require(_0x2be9('0x1'));var timeout=require(_0x2be9('0x2'));var express=require(_0x2be9('0x3'));var router=express[_0x2be9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2be9('0x5'));var interaction=require(_0x2be9('0x6'));var config=require(_0x2be9('0x7'));var controller=require(_0x2be9('0x8'));router[_0x2be9('0x9')]('/',auth[_0x2be9('0xa')](),controller[_0x2be9('0xb')]);router[_0x2be9('0x9')](_0x2be9('0xc'),controller[_0x2be9('0xd')]);router[_0x2be9('0x9')](_0x2be9('0xe'),controller[_0x2be9('0xf')]);router[_0x2be9('0x9')](_0x2be9('0x10'),controller[_0x2be9('0x11')]);router['get'](_0x2be9('0x12'),controller['getLogoLogin']);router['get'](_0x2be9('0x13'),controller[_0x2be9('0x14')]);router['get'](_0x2be9('0x15'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0x2be9('0x16')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x20c444,_0x7bba89,_0x30e2d9){_0x30e2d9(null,path[_0x2be9('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2e060e,_0x5039db,_0x4a91e8){_0x4a91e8(null,util[_0x2be9('0x19')](_0x2be9('0x1a'),_0x2be9('0x1b'),path[_0x2be9('0x1c')](_0x5039db[_0x2be9('0x1d')])));}})});router[_0x2be9('0x1e')](_0x2be9('0x10'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x21')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x4ab87e,_0x125ef5,_0x2adf42){_0x2adf42(null,path['join'](config[_0x2be9('0x22')],_0x2be9('0x23')));},'filename':function(_0x1356ce,_0x219c74,_0x5735f5){_0x5735f5(null,util[_0x2be9('0x19')](_0x2be9('0x1a'),'logologin',path[_0x2be9('0x1c')](_0x219c74[_0x2be9('0x1d')])));}})});router['post']('/:id/logo_login',upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x24')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x2b42c4,_0x251307,_0x1364b9){_0x1364b9(null,path['join'](config['root'],_0x2be9('0x23')));},'filename':function(_0x14be5c,_0x2adb60,_0x4f43bf){_0x4f43bf(null,util['format'](_0x2be9('0x1a'),_0x2be9('0x25'),path[_0x2be9('0x1c')](_0x2adb60[_0x2be9('0x1d')])));}})});router['post'](_0x2be9('0x15'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x26')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x51b583,_0x1b8a44,_0x45c8af){_0x45c8af(null,path[_0x2be9('0x18')](config[_0x2be9('0x22')],_0x2be9('0x23')));},'filename':function(_0x310fc0,_0x2c061f,_0x3a612a){_0x3a612a(null,util['format'](_0x2be9('0x1a'),'favicon',path[_0x2be9('0x1c')](_0x2c061f[_0x2be9('0x1d')])));}})});router['post'](_0x2be9('0x27'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller['addFavicon']);router[_0x2be9('0x28')]('/:id',auth[_0x2be9('0xa')](),controller[_0x2be9('0x29')]);module[_0x2be9('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c73fcfb..277b445 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(_0x2c613b,_0x3e0bb3){var _0x341487=function(_0x50a7f7){while(--_0x50a7f7){_0x2c613b['push'](_0x2c613b['shift']());}};_0x341487(++_0x3e0bb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x5479a9,_0x48805f){var _0x2745b6=function(_0x2b4ee0){while(--_0x2b4ee0){_0x5479a9['push'](_0x5479a9['shift']());}};_0x2745b6(++_0x48805f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 f2df253..9cc690f 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 _0x6f49=['logo','find','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','defaultLogo','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','preferred','getPreferred','custom','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','end','stack','name','index','map','Setting','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','keys','body','params','addLogo','file','filename'];(function(_0x1c5815,_0x1bce39){var _0x61c825=function(_0xf2d831){while(--_0xf2d831){_0x1c5815['push'](_0x1c5815['shift']());}};_0x61c825(++_0x1bce39);}(_0x6f49,0xa6));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96f4('0x0'));var zipdir=require(_0x96f4('0x1'));var jsonpatch=require(_0x96f4('0x2'));var rp=require(_0x96f4('0x3'));var moment=require(_0x96f4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x96f4('0x5'));var sox=require('sox');var csv=require(_0x96f4('0x6'));var ejs=require(_0x96f4('0x7'));var fs=require('fs');var fs_extra=require(_0x96f4('0x8'));var _=require('lodash');var squel=require(_0x96f4('0x9'));var crypto=require(_0x96f4('0xa'));var jsforce=require(_0x96f4('0xb'));var deskjs=require(_0x96f4('0xc'));var toCsv=require(_0x96f4('0x6'));var querystring=require(_0x96f4('0xd'));var Papa=require(_0x96f4('0xe'));var Redis=require(_0x96f4('0xf'));var authService=require(_0x96f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x96f4('0x11'));var hardwareService=require(_0x96f4('0x12'));var logger=require(_0x96f4('0x13'))(_0x96f4('0x14'));var utils=require(_0x96f4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x96f4('0x16'));var db=require(_0x96f4('0x17'))['db'];var jayson=require(_0x96f4('0x18'));var client=jayson['client'][_0x96f4('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x9a2d22,_0x4f325f,_0x2faa44,_0x504e91){return new BPromise(function(_0x4db39b,_0x502f3d){var _0x2a8a28=_0x504e91||client;return _0x2a8a28[_0x96f4('0x1a')](_0x9a2d22,_0x2faa44)[_0x96f4('0x1b')](function(_0x24fba9){logger[_0x96f4('0x1c')](_0x96f4('0x1d'),_0x4f325f,'request\x20sent');logger[_0x96f4('0x1e')](_0x96f4('0x1f'),_0x4f325f,_0x96f4('0x20'),JSON[_0x96f4('0x21')](_0x24fba9));if(_0x24fba9['error']){if(_0x24fba9[_0x96f4('0x22')][_0x96f4('0x23')]===0x1f4){logger[_0x96f4('0x22')]('Setting,\x20%s,\x20%s',_0x4f325f,_0x24fba9[_0x96f4('0x22')][_0x96f4('0x24')]);return _0x502f3d(_0x24fba9[_0x96f4('0x22')][_0x96f4('0x24')]);}logger[_0x96f4('0x22')](_0x96f4('0x1d'),_0x4f325f,_0x24fba9['error'][_0x96f4('0x24')]);return _0x4db39b(_0x24fba9[_0x96f4('0x22')]['message']);}else{logger[_0x96f4('0x1c')]('Setting,\x20%s,\x20%s',_0x4f325f,'request\x20sent');_0x4db39b(_0x24fba9[_0x96f4('0x25')][_0x96f4('0x24')]);}})[_0x96f4('0x26')](function(_0x32bd8f){logger[_0x96f4('0x22')](_0x96f4('0x1d'),_0x4f325f,_0x32bd8f);_0x502f3d(_0x32bd8f);});});}function respondWithStatusCode(_0x5c992d,_0x287f36){_0x287f36=_0x287f36||0xcc;return function(_0x3f8b1b){if(_0x3f8b1b){return _0x5c992d[_0x96f4('0x27')](_0x287f36);}return _0x5c992d[_0x96f4('0x28')](_0x287f36)['end']();};}function respondWithResult(_0x3967bb,_0x3404bf){_0x3404bf=_0x3404bf||0xc8;return function(_0x27751e){if(_0x27751e){return _0x3967bb[_0x96f4('0x28')](_0x3404bf)[_0x96f4('0x29')](_0x27751e);}};}function respondWithFilteredResult(_0x5eefb0,_0x25d0a0){return function(_0xff2057){if(_0xff2057){var _0xd3571a=typeof _0x25d0a0[_0x96f4('0x2a')]===_0x96f4('0x2b')&&typeof _0x25d0a0[_0x96f4('0x2c')]===_0x96f4('0x2b');var _0x5b171b=_0xff2057[_0x96f4('0x2d')];var _0x228077=_0xd3571a?0x0:_0x25d0a0['offset'];var _0x750f4d=_0xd3571a?_0xff2057[_0x96f4('0x2d')]:_0x25d0a0[_0x96f4('0x2a')]+_0x25d0a0[_0x96f4('0x2c')];var _0x703e6c;if(_0x750f4d>=_0x5b171b){_0x750f4d=_0x5b171b;_0x703e6c=0xc8;}else{_0x703e6c=0xce;}_0x5eefb0[_0x96f4('0x28')](_0x703e6c);return _0x5eefb0['set']('Content-Range',_0x228077+'-'+_0x750f4d+'/'+_0x5b171b)[_0x96f4('0x29')](_0xff2057);}return null;};}function patchUpdates(_0x53d172){return function(_0x5330b5){try{jsonpatch[_0x96f4('0x2e')](_0x5330b5,_0x53d172,!![]);}catch(_0x242764){return BPromise[_0x96f4('0x2f')](_0x242764);}return _0x5330b5[_0x96f4('0x30')]();};}function saveUpdates(_0x230ee7,_0x329d9e){return function(_0x58e9e8){if(_0x58e9e8){return _0x58e9e8[_0x96f4('0x31')](_0x230ee7)[_0x96f4('0x1b')](function(_0x236d07){return _0x236d07;});}return null;};}function removeEntity(_0x55b16d,_0x5cdd6f){return function(_0x1c65ef){if(_0x1c65ef){return _0x1c65ef[_0x96f4('0x32')]()[_0x96f4('0x1b')](function(){_0x55b16d[_0x96f4('0x28')](0xcc)[_0x96f4('0x33')]();});}};}function handleEntityNotFound(_0x129950,_0x376faf){return function(_0x36bea3){if(!_0x36bea3){_0x129950[_0x96f4('0x27')](0x194);}return _0x36bea3;};}function handleError(_0x51d0bf,_0x1d7316){_0x1d7316=_0x1d7316||0x1f4;return function(_0x541c4c){logger[_0x96f4('0x22')](_0x541c4c[_0x96f4('0x34')]);if(_0x541c4c['name']){delete _0x541c4c[_0x96f4('0x35')];}_0x51d0bf['status'](_0x1d7316)['send'](_0x541c4c);};}exports[_0x96f4('0x36')]=function(_0x5c9d97,_0xfda087){var _0x2918db={},_0x2d3242={},_0x41ac3c={'count':0x0,'rows':[]};var _0x533379=_[_0x96f4('0x37')](db[_0x96f4('0x38')][_0x96f4('0x39')],function(_0x438eb0){return{'name':_0x438eb0['fieldName'],'type':_0x438eb0['type'][_0x96f4('0x3a')]};});_0x2d3242[_0x96f4('0x3b')]=_[_0x96f4('0x37')](_0x533379,_0x96f4('0x35'));_0x2d3242[_0x96f4('0x3c')]=_['keys'](_0x5c9d97['query']);_0x2d3242['filters']=_[_0x96f4('0x3d')](_0x2d3242['model'],_0x2d3242[_0x96f4('0x3c')]);_0x2918db[_0x96f4('0x3e')]=_[_0x96f4('0x3d')](_0x2d3242[_0x96f4('0x3b')],qs[_0x96f4('0x3f')](_0x5c9d97[_0x96f4('0x3c')]['fields']));_0x2918db[_0x96f4('0x3e')]=_0x2918db[_0x96f4('0x3e')][_0x96f4('0x40')]?_0x2918db[_0x96f4('0x3e')]:_0x2d3242['model'];if(!_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x41')](_0x96f4('0x42'))){_0x2918db[_0x96f4('0x2c')]=qs[_0x96f4('0x2c')](_0x5c9d97['query'][_0x96f4('0x2c')]);_0x2918db[_0x96f4('0x2a')]=qs[_0x96f4('0x2a')](_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x2a')]);}_0x2918db[_0x96f4('0x43')]=qs['sort'](_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x44')]);_0x2918db['where']=qs[_0x96f4('0x45')](_[_0x96f4('0x46')](_0x5c9d97['query'],_0x2d3242[_0x96f4('0x45')]),_0x533379);if(_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x47')]){_0x2918db['where']=_[_0x96f4('0x48')](_0x2918db[_0x96f4('0x49')],{'$or':_['map'](_0x533379,function(_0x1328b3){if(_0x1328b3['type']!==_0x96f4('0x4a')){var _0x1a28b0={};_0x1a28b0[_0x1328b3[_0x96f4('0x35')]]={'$like':'%'+_0x5c9d97[_0x96f4('0x3c')][_0x96f4('0x47')]+'%'};return _0x1a28b0;}})});}_0x2918db=_[_0x96f4('0x48')]({},_0x2918db,_0x5c9d97[_0x96f4('0x4b')]);var _0xa4dfaa={'where':_0x2918db[_0x96f4('0x49')]};return db['Setting'][_0x96f4('0x2d')](_0xa4dfaa)[_0x96f4('0x1b')](function(_0x1c4df6){_0x41ac3c[_0x96f4('0x2d')]=_0x1c4df6;if(_0x5c9d97['query'][_0x96f4('0x4c')]){_0x2918db[_0x96f4('0x4d')]=[{'all':!![]}];}return db['Setting'][_0x96f4('0x4e')](_0x2918db);})[_0x96f4('0x1b')](function(_0x12371b){_0x41ac3c['rows']=_0x12371b;return _0x41ac3c;})[_0x96f4('0x1b')](respondWithFilteredResult(_0xfda087,_0x2918db))[_0x96f4('0x26')](handleError(_0xfda087,null));};exports[_0x96f4('0x4f')]=function(_0x38fc9c,_0x5e620d){var _0xb92d9={'raw':![],'where':{'id':_0x38fc9c['params']['id']}},_0x24da60={};_0x24da60['model']=_[_0x96f4('0x50')](db['Setting']['rawAttributes']);_0x24da60[_0x96f4('0x3c')]=_[_0x96f4('0x50')](_0x38fc9c[_0x96f4('0x3c')]);_0x24da60[_0x96f4('0x45')]=_[_0x96f4('0x3d')](_0x24da60['model'],_0x24da60[_0x96f4('0x3c')]);_0xb92d9[_0x96f4('0x3e')]=_['intersection'](_0x24da60[_0x96f4('0x3b')],qs['fields'](_0x38fc9c[_0x96f4('0x3c')][_0x96f4('0x3f')]));_0xb92d9[_0x96f4('0x3e')]=_0xb92d9[_0x96f4('0x3e')][_0x96f4('0x40')]?_0xb92d9[_0x96f4('0x3e')]:_0x24da60[_0x96f4('0x3b')];if(_0x38fc9c[_0x96f4('0x3c')]['includeAll']){_0xb92d9['include']=[{'all':!![]}];}_0xb92d9=_[_0x96f4('0x48')]({},_0xb92d9,_0x38fc9c[_0x96f4('0x4b')]);return db['Setting']['find'](_0xb92d9)[_0x96f4('0x1b')](handleEntityNotFound(_0x5e620d,null))[_0x96f4('0x1b')](respondWithResult(_0x5e620d,null))[_0x96f4('0x26')](handleError(_0x5e620d,null));};exports[_0x96f4('0x31')]=function(_0x2f7f5d,_0x4158d2){if(_0x2f7f5d[_0x96f4('0x51')]['id']){delete _0x2f7f5d['body']['id'];}return db['Setting']['find']({'where':{'id':_0x2f7f5d[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x4158d2,null))[_0x96f4('0x1b')](saveUpdates(_0x2f7f5d[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x4158d2,null))[_0x96f4('0x26')](handleError(_0x4158d2,null));};exports[_0x96f4('0x53')]=function(_0x181eb1,_0x1d961f,_0x5781c2){if(_0x181eb1[_0x96f4('0x54')]&&_0x181eb1['file'][_0x96f4('0x55')]){_0x181eb1[_0x96f4('0x51')][_0x96f4('0x56')]=_0x181eb1[_0x96f4('0x54')]['filename'];}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x181eb1[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x1d961f,null))['then'](saveUpdates(_0x181eb1[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x1d961f,null))[_0x96f4('0x26')](handleError(_0x1d961f,null));};exports[_0x96f4('0x58')]=function(_0x41a9f7,_0x1774b1,_0x1470a5){if(_0x41a9f7[_0x96f4('0x54')]&&_0x41a9f7['file']['filename']){_0x41a9f7[_0x96f4('0x51')][_0x96f4('0x59')]=_0x41a9f7[_0x96f4('0x54')][_0x96f4('0x55')];}return db['Setting'][_0x96f4('0x57')]({'where':{'id':_0x41a9f7[_0x96f4('0x52')]['id']}})[_0x96f4('0x1b')](handleEntityNotFound(_0x1774b1,null))[_0x96f4('0x1b')](saveUpdates(_0x41a9f7['body'],null))[_0x96f4('0x1b')](respondWithResult(_0x1774b1,null))['catch'](handleError(_0x1774b1,null));};var utilLicense=require(_0x96f4('0x16'));exports[_0x96f4('0x5a')]=function(_0x4ffad3,_0x198334,_0x1563d0){var _0x2a6a40=_0x96f4('0x5b');var _0x530095={'custom':![]};return utilLicense[_0x96f4('0x5c')]()[_0x96f4('0x1b')](function(_0x4dc092){if(_0x4dc092){_0x530095=_0x4dc092;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x4ffad3[_0x96f4('0x52')]['id']},'attributes':[_0x96f4('0x56'),_0x96f4('0x59'),'preferred',_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),'defaultPreferred',_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x198334,null))[_0x96f4('0x1b')](function(_0x2dde38){if(_0x2dde38){var _0x193ec9=_0x2dde38[_0x96f4('0x56')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_['toLower'](_0x2dde38[_0x96f4('0x56')])))?path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_[_0x96f4('0x63')](_0x2dde38[_0x96f4('0x56')])):path['join'](config[_0x96f4('0x62')],_0x2a6a40,_[_0x96f4('0x63')](_0x96f4('0x64')));var _0x91b1a2=_0x96f4('0x65')+_['upperFirst'](_0x96f4('0x56'));if(_0x2dde38[_0x91b1a2]||!_0x530095['custom']){_0x193ec9=path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x2a6a40,_['toLower'](_0x96f4('0x64')));}if(!fs[_0x96f4('0x60')](_0x193ec9)){throw new db[(_0x96f4('0x66'))][(_0x96f4('0x67'))](_[_0x96f4('0x68')](_0x96f4('0x56'))+_0x96f4('0x69'));}return _0x198334[_0x96f4('0x6a')](_0x193ec9);}})[_0x96f4('0x26')](handleError(_0x198334,null));};var utilLicense=require(_0x96f4('0x16'));exports['getLogoLogin']=function(_0x173ef4,_0x2f4cb2,_0x3c4982){var _0x104c39='server/files/images/logos';var _0x7a01ff={'custom':![]};return utilLicense['getLicense']()[_0x96f4('0x1b')](function(_0x2d84ba){if(_0x2d84ba){_0x7a01ff=_0x2d84ba;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x173ef4['params']['id']},'attributes':[_0x96f4('0x56'),'loginLogo','preferred','favicon',_0x96f4('0x6b'),_0x96f4('0x5e'),_0x96f4('0x6c'),_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x2f4cb2,null))['then'](function(_0x286c7b){if(_0x286c7b){var _0x54172c=_0x286c7b[_0x96f4('0x59')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x104c39,_[_0x96f4('0x63')](_0x286c7b[_0x96f4('0x59')])))?path['join'](config[_0x96f4('0x62')],_0x104c39,_[_0x96f4('0x63')](_0x286c7b['loginLogo'])):path[_0x96f4('0x61')](config['root'],_0x104c39,_[_0x96f4('0x63')](_0x96f4('0x6d')));var _0x3e67ba='default'+_[_0x96f4('0x68')](_0x96f4('0x59'));if(_0x286c7b[_0x3e67ba]||!_0x7a01ff['custom']){_0x54172c=path[_0x96f4('0x61')](config['root'],_0x104c39,_[_0x96f4('0x63')](_0x96f4('0x6d')));}if(!fs['existsSync'](_0x54172c)){throw new db['Sequelize'][(_0x96f4('0x67'))](_[_0x96f4('0x68')](_0x96f4('0x59'))+_0x96f4('0x69'));}return _0x2f4cb2['download'](_0x54172c);}})[_0x96f4('0x26')](handleError(_0x2f4cb2,null));};exports[_0x96f4('0x6e')]=function(_0x32c658,_0xb1d584){return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x32c658['params']['id']},'attributes':[_0x96f4('0x6f')]})[_0x96f4('0x1b')](respondWithResult(_0xb1d584,null))['catch'](handleError(_0xb1d584,null));};exports[_0x96f4('0x70')]=function(_0x47aa9,_0x18e1ea,_0x2c7c4b){if(_0x47aa9[_0x96f4('0x54')]&&_0x47aa9['file'][_0x96f4('0x55')]){_0x47aa9[_0x96f4('0x51')][_0x96f4('0x71')]=_0x47aa9['file'][_0x96f4('0x55')];}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x47aa9[_0x96f4('0x52')]['id']}})['then'](handleEntityNotFound(_0x18e1ea,null))[_0x96f4('0x1b')](saveUpdates(_0x47aa9[_0x96f4('0x51')],null))[_0x96f4('0x1b')](respondWithResult(_0x18e1ea,null))['catch'](handleError(_0x18e1ea,null));};var utilLicense=require('../../config/license/util');exports[_0x96f4('0x72')]=function(_0x14494d,_0x4e2388,_0x12d427){var _0x3bab64=_0x96f4('0x5b');var _0x2e5eba={'custom':![]};return utilLicense[_0x96f4('0x5c')]()[_0x96f4('0x1b')](function(_0x3036b7){if(_0x3036b7){_0x2e5eba=_0x3036b7;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x14494d[_0x96f4('0x52')]['id']},'attributes':[_0x96f4('0x56'),_0x96f4('0x59'),_0x96f4('0x71'),_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),_0x96f4('0x6c'),_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x4e2388,null))['then'](function(_0x4b2f50){if(_0x4b2f50){var _0x2a4c11=_0x4b2f50[_0x96f4('0x71')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x4b2f50[_0x96f4('0x71')])))?path['join'](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x4b2f50[_0x96f4('0x71')])):path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_[_0x96f4('0x63')]('default_preferred.png'));var _0x1f7f3f=_0x96f4('0x65')+_[_0x96f4('0x68')]('preferred');if(_0x4b2f50[_0x1f7f3f]||!_0x2e5eba[_0x96f4('0x73')]||!_0x2e5eba['preferred']){_0x2a4c11=path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x3bab64,_['toLower'](_0x96f4('0x74')));}if(!fs[_0x96f4('0x60')](_0x2a4c11)){throw new db['Sequelize'][(_0x96f4('0x67'))](_['upperFirst'](_0x96f4('0x71'))+_0x96f4('0x69'));}return _0x4e2388['download'](_0x2a4c11);}})[_0x96f4('0x26')](handleError(_0x4e2388,null));};exports[_0x96f4('0x75')]=function(_0x48a795,_0x1114ec,_0x10f76f){if(_0x48a795[_0x96f4('0x54')]&&_0x48a795['file'][_0x96f4('0x55')]){_0x48a795[_0x96f4('0x51')][_0x96f4('0x5d')]=_0x48a795[_0x96f4('0x54')][_0x96f4('0x55')];}return db['Setting'][_0x96f4('0x57')]({'where':{'id':_0x48a795['params']['id']}})['then'](handleEntityNotFound(_0x1114ec,null))[_0x96f4('0x1b')](saveUpdates(_0x48a795['body'],null))[_0x96f4('0x1b')](respondWithResult(_0x1114ec,null))[_0x96f4('0x26')](handleError(_0x1114ec,null));};var utilLicense=require(_0x96f4('0x16'));exports[_0x96f4('0x76')]=function(_0x1c3a70,_0x32092f,_0x20c5f2){var _0x54434d=_0x96f4('0x5b');var _0x2aa081={'custom':![]};return utilLicense['getLicense']()[_0x96f4('0x1b')](function(_0x4ee7ad){if(_0x4ee7ad){_0x2aa081=_0x4ee7ad;}return db[_0x96f4('0x38')][_0x96f4('0x57')]({'where':{'id':_0x1c3a70[_0x96f4('0x52')]['id']},'attributes':['logo',_0x96f4('0x59'),_0x96f4('0x71'),_0x96f4('0x5d'),'defaultLogo',_0x96f4('0x5e'),'defaultPreferred',_0x96f4('0x5f')],'raw':!![]});})[_0x96f4('0x1b')](handleEntityNotFound(_0x32092f,null))[_0x96f4('0x1b')](function(_0x3c9f2d){if(_0x3c9f2d){var _0x308c5d=_0x3c9f2d[_0x96f4('0x5d')]&&fs[_0x96f4('0x60')](path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x3c9f2d['favicon'])))?path[_0x96f4('0x61')](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x3c9f2d[_0x96f4('0x5d')])):path['join'](config[_0x96f4('0x62')],_0x54434d,_[_0x96f4('0x63')](_0x96f4('0x77')));var _0x26b89d=_0x96f4('0x65')+_[_0x96f4('0x68')](_0x96f4('0x5d'));if(_0x3c9f2d[_0x26b89d]||!_0x2aa081[_0x96f4('0x73')]){_0x308c5d=path['join'](config['root'],_0x54434d,_[_0x96f4('0x63')](_0x96f4('0x77')));}if(!fs['existsSync'](_0x308c5d)){throw new db[(_0x96f4('0x66'))]['ValidationError'](_[_0x96f4('0x68')](_0x96f4('0x5d'))+_0x96f4('0x69'));}return _0x32092f[_0x96f4('0x6a')](_0x308c5d);}})[_0x96f4('0x26')](handleError(_0x32092f,null));};exports[_0x96f4('0x78')]=function(_0x437ce9,_0x155388){var _0x404de4={'offset':moment()[_0x96f4('0x79')]()};_0x404de4[_0x96f4('0x7a')]=moment()[_0x96f4('0x79')](_0x404de4[_0x96f4('0x2a')])[_0x96f4('0x7b')](_0x96f4('0x7c'));return _0x155388[_0x96f4('0x28')](0xc8)[_0x96f4('0x7d')](_0x404de4);}; \ No newline at end of file +var _0x9649=['attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','upperFirst','default_logo.svg','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','ValidationError','getFavicon','custom','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','stack','name','map','Setting','rawAttributes','type','key','model','keys','query','filters','intersection'];(function(_0x271db0,_0x41252a){var _0x368781=function(_0x312311){while(--_0x312311){_0x271db0['push'](_0x271db0['shift']());}};_0x368781(++_0x41252a);}(_0x9649,0x19f));var _0x9964=function(_0x367312,_0x2987f7){_0x367312=_0x367312-0x0;var _0x56948f=_0x9649[_0x367312];return _0x56948f;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require('request-promise');var moment=require(_0x9964('0x4'));var BPromise=require(_0x9964('0x5'));var Mustache=require('mustache');var util=require(_0x9964('0x6'));var path=require('path');var sox=require(_0x9964('0x7'));var csv=require(_0x9964('0x8'));var ejs=require(_0x9964('0x9'));var fs=require('fs');var fs_extra=require(_0x9964('0xa'));var _=require(_0x9964('0xb'));var squel=require(_0x9964('0xc'));var crypto=require(_0x9964('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9964('0xe'));var toCsv=require(_0x9964('0x8'));var querystring=require('querystring');var Papa=require(_0x9964('0xf'));var Redis=require(_0x9964('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require(_0x9964('0x12'));var logger=require(_0x9964('0x13'))(_0x9964('0x14'));var utils=require(_0x9964('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9964('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9964('0x17'));var client=jayson[_0x9964('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15414d,_0x39ef74,_0x5aa1a8,_0x1fd4b4){return new BPromise(function(_0x463dbf,_0x11dfc9){var _0x46688a=_0x1fd4b4||client;return _0x46688a[_0x9964('0x19')](_0x15414d,_0x5aa1a8)['then'](function(_0x411544){logger[_0x9964('0x1a')]('Setting,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'));logger[_0x9964('0x1c')]('Setting,\x20%s,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'),JSON[_0x9964('0x1d')](_0x411544));if(_0x411544[_0x9964('0x1e')]){if(_0x411544[_0x9964('0x1e')]['code']===0x1f4){logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x411544['error'][_0x9964('0x20')]);return _0x11dfc9(_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);}logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);return _0x463dbf(_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);}else{logger[_0x9964('0x1a')]('Setting,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'));_0x463dbf(_0x411544[_0x9964('0x21')]['message']);}})[_0x9964('0x22')](function(_0x47912c){logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x47912c);_0x11dfc9(_0x47912c);});});}function respondWithStatusCode(_0x1c5e34,_0x167525){_0x167525=_0x167525||0xcc;return function(_0x2d049c){if(_0x2d049c){return _0x1c5e34[_0x9964('0x23')](_0x167525);}return _0x1c5e34['status'](_0x167525)[_0x9964('0x24')]();};}function respondWithResult(_0x378e34,_0x5961e9){_0x5961e9=_0x5961e9||0xc8;return function(_0x1b05a8){if(_0x1b05a8){return _0x378e34[_0x9964('0x25')](_0x5961e9)[_0x9964('0x26')](_0x1b05a8);}};}function respondWithFilteredResult(_0x1399e0,_0x26cd95){return function(_0x5a5793){if(_0x5a5793){var _0x13df3d=typeof _0x26cd95['offset']===_0x9964('0x27')&&typeof _0x26cd95['limit']===_0x9964('0x27');var _0x5dc789=_0x5a5793[_0x9964('0x28')];var _0x162b83=_0x13df3d?0x0:_0x26cd95[_0x9964('0x29')];var _0x44a38f=_0x13df3d?_0x5a5793[_0x9964('0x28')]:_0x26cd95[_0x9964('0x29')]+_0x26cd95[_0x9964('0x2a')];var _0x2f6068;if(_0x44a38f>=_0x5dc789){_0x44a38f=_0x5dc789;_0x2f6068=0xc8;}else{_0x2f6068=0xce;}_0x1399e0[_0x9964('0x25')](_0x2f6068);return _0x1399e0['set']('Content-Range',_0x162b83+'-'+_0x44a38f+'/'+_0x5dc789)['json'](_0x5a5793);}return null;};}function patchUpdates(_0x483092){return function(_0x36220b){try{jsonpatch[_0x9964('0x2b')](_0x36220b,_0x483092,!![]);}catch(_0x4efb43){return BPromise[_0x9964('0x2c')](_0x4efb43);}return _0x36220b[_0x9964('0x2d')]();};}function saveUpdates(_0x3092b2,_0x17a244){return function(_0x9d4eaf){if(_0x9d4eaf){return _0x9d4eaf[_0x9964('0x2e')](_0x3092b2)['then'](function(_0x5f8cda){return _0x5f8cda;});}return null;};}function removeEntity(_0x2eae45,_0x59ab78){return function(_0xbd2537){if(_0xbd2537){return _0xbd2537[_0x9964('0x2f')]()[_0x9964('0x30')](function(){_0x2eae45[_0x9964('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b7a0,_0x445be2){return function(_0x4e517c){if(!_0x4e517c){_0x55b7a0['sendStatus'](0x194);}return _0x4e517c;};}function handleError(_0x193c9a,_0xca41d2){_0xca41d2=_0xca41d2||0x1f4;return function(_0x5d28d8){logger['error'](_0x5d28d8[_0x9964('0x31')]);if(_0x5d28d8[_0x9964('0x32')]){delete _0x5d28d8['name'];}_0x193c9a[_0x9964('0x25')](_0xca41d2)['send'](_0x5d28d8);};}exports['index']=function(_0x57f4ff,_0x469813){var _0x36626c={},_0x168f41={},_0x1df24e={'count':0x0,'rows':[]};var _0x2cdbbc=_[_0x9964('0x33')](db[_0x9964('0x34')][_0x9964('0x35')],function(_0x131073){return{'name':_0x131073['fieldName'],'type':_0x131073[_0x9964('0x36')][_0x9964('0x37')]};});_0x168f41[_0x9964('0x38')]=_[_0x9964('0x33')](_0x2cdbbc,'name');_0x168f41['query']=_[_0x9964('0x39')](_0x57f4ff[_0x9964('0x3a')]);_0x168f41[_0x9964('0x3b')]=_[_0x9964('0x3c')](_0x168f41[_0x9964('0x38')],_0x168f41['query']);_0x36626c[_0x9964('0x3d')]=_[_0x9964('0x3c')](_0x168f41[_0x9964('0x38')],qs[_0x9964('0x3e')](_0x57f4ff[_0x9964('0x3a')][_0x9964('0x3e')]));_0x36626c[_0x9964('0x3d')]=_0x36626c[_0x9964('0x3d')][_0x9964('0x3f')]?_0x36626c[_0x9964('0x3d')]:_0x168f41[_0x9964('0x38')];if(!_0x57f4ff[_0x9964('0x3a')][_0x9964('0x40')](_0x9964('0x41'))){_0x36626c[_0x9964('0x2a')]=qs[_0x9964('0x2a')](_0x57f4ff['query'][_0x9964('0x2a')]);_0x36626c['offset']=qs[_0x9964('0x29')](_0x57f4ff[_0x9964('0x3a')][_0x9964('0x29')]);}_0x36626c['order']=qs[_0x9964('0x42')](_0x57f4ff['query'][_0x9964('0x42')]);_0x36626c['where']=qs[_0x9964('0x3b')](_[_0x9964('0x43')](_0x57f4ff[_0x9964('0x3a')],_0x168f41[_0x9964('0x3b')]),_0x2cdbbc);if(_0x57f4ff[_0x9964('0x3a')][_0x9964('0x44')]){_0x36626c[_0x9964('0x45')]=_[_0x9964('0x46')](_0x36626c['where'],{'$or':_[_0x9964('0x33')](_0x2cdbbc,function(_0x3d236e){if(_0x3d236e[_0x9964('0x36')]!==_0x9964('0x47')){var _0xcce717={};_0xcce717[_0x3d236e[_0x9964('0x32')]]={'$like':'%'+_0x57f4ff[_0x9964('0x3a')][_0x9964('0x44')]+'%'};return _0xcce717;}})});}_0x36626c=_[_0x9964('0x46')]({},_0x36626c,_0x57f4ff[_0x9964('0x48')]);var _0x5acdc5={'where':_0x36626c['where']};return db[_0x9964('0x34')]['count'](_0x5acdc5)[_0x9964('0x30')](function(_0x53c6a8){_0x1df24e['count']=_0x53c6a8;if(_0x57f4ff['query'][_0x9964('0x49')]){_0x36626c[_0x9964('0x4a')]=[{'all':!![]}];}return db[_0x9964('0x34')]['findAll'](_0x36626c);})['then'](function(_0x652882){_0x1df24e['rows']=_0x652882;return _0x1df24e;})[_0x9964('0x30')](respondWithFilteredResult(_0x469813,_0x36626c))[_0x9964('0x22')](handleError(_0x469813,null));};exports[_0x9964('0x4b')]=function(_0x1d8192,_0x41c9ff){var _0x5b0fa7={'raw':![],'where':{'id':_0x1d8192[_0x9964('0x4c')]['id']}},_0x521d03={};_0x521d03[_0x9964('0x38')]=_[_0x9964('0x39')](db[_0x9964('0x34')][_0x9964('0x35')]);_0x521d03['query']=_[_0x9964('0x39')](_0x1d8192[_0x9964('0x3a')]);_0x521d03[_0x9964('0x3b')]=_['intersection'](_0x521d03[_0x9964('0x38')],_0x521d03[_0x9964('0x3a')]);_0x5b0fa7[_0x9964('0x3d')]=_[_0x9964('0x3c')](_0x521d03[_0x9964('0x38')],qs[_0x9964('0x3e')](_0x1d8192[_0x9964('0x3a')][_0x9964('0x3e')]));_0x5b0fa7['attributes']=_0x5b0fa7[_0x9964('0x3d')]['length']?_0x5b0fa7['attributes']:_0x521d03[_0x9964('0x38')];if(_0x1d8192['query'][_0x9964('0x49')]){_0x5b0fa7[_0x9964('0x4a')]=[{'all':!![]}];}_0x5b0fa7=_[_0x9964('0x46')]({},_0x5b0fa7,_0x1d8192['options']);return db[_0x9964('0x34')][_0x9964('0x4d')](_0x5b0fa7)[_0x9964('0x30')](handleEntityNotFound(_0x41c9ff,null))[_0x9964('0x30')](respondWithResult(_0x41c9ff,null))[_0x9964('0x22')](handleError(_0x41c9ff,null));};exports[_0x9964('0x2e')]=function(_0x25db0d,_0x33f359){if(_0x25db0d[_0x9964('0x4e')]['id']){delete _0x25db0d['body']['id'];}return db[_0x9964('0x34')]['find']({'where':{'id':_0x25db0d[_0x9964('0x4c')]['id']}})[_0x9964('0x30')](handleEntityNotFound(_0x33f359,null))[_0x9964('0x30')](saveUpdates(_0x25db0d['body'],null))[_0x9964('0x30')](respondWithResult(_0x33f359,null))[_0x9964('0x22')](handleError(_0x33f359,null));};exports[_0x9964('0x4f')]=function(_0x375ad6,_0xaf7e23,_0x4b1571){if(_0x375ad6[_0x9964('0x50')]&&_0x375ad6[_0x9964('0x50')][_0x9964('0x51')]){_0x375ad6[_0x9964('0x4e')][_0x9964('0x52')]=_0x375ad6['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x375ad6[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0xaf7e23,null))['then'](saveUpdates(_0x375ad6['body'],null))[_0x9964('0x30')](respondWithResult(_0xaf7e23,null))['catch'](handleError(_0xaf7e23,null));};exports[_0x9964('0x53')]=function(_0x1cc5e4,_0x464ab1,_0x4e0316){if(_0x1cc5e4[_0x9964('0x50')]&&_0x1cc5e4['file']['filename']){_0x1cc5e4[_0x9964('0x4e')][_0x9964('0x54')]=_0x1cc5e4[_0x9964('0x50')]['filename'];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x1cc5e4[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0x464ab1,null))[_0x9964('0x30')](saveUpdates(_0x1cc5e4[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x464ab1,null))['catch'](handleError(_0x464ab1,null));};var utilLicense=require('../../config/license/util');exports[_0x9964('0x55')]=function(_0x471b8f,_0x34fe6e,_0x1d7a9a){var _0x3001d7=_0x9964('0x56');var _0x2e3870={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x37d2ec){if(_0x37d2ec){_0x2e3870=_0x37d2ec;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x471b8f[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),'preferred',_0x9964('0x58'),_0x9964('0x59'),_0x9964('0x5a'),_0x9964('0x5b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x34fe6e,null))['then'](function(_0x4ad690){if(_0x4ad690){var _0x4e374e=_0x4ad690[_0x9964('0x52')]&&fs[_0x9964('0x5c')](path['join'](config[_0x9964('0x5d')],_0x3001d7,_[_0x9964('0x5e')](_0x4ad690[_0x9964('0x52')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x3001d7,_['toLower'](_0x4ad690[_0x9964('0x52')])):path[_0x9964('0x5f')](config['root'],_0x3001d7,_[_0x9964('0x5e')]('default_logo.svg'));var _0x27a396='default'+_[_0x9964('0x60')](_0x9964('0x52'));if(_0x4ad690[_0x27a396]||!_0x2e3870['custom']){_0x4e374e=path[_0x9964('0x5f')](config['root'],_0x3001d7,_['toLower'](_0x9964('0x61')));}if(!fs['existsSync'](_0x4e374e)){throw new db[(_0x9964('0x62'))]['ValidationError'](_[_0x9964('0x60')]('logo')+_0x9964('0x63'));}return _0x34fe6e[_0x9964('0x64')](_0x4e374e);}})[_0x9964('0x22')](handleError(_0x34fe6e,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x65')]=function(_0x145086,_0x4a53b1,_0x32c5a7){var _0x2d90c9=_0x9964('0x56');var _0x5800ea={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x35d32b){if(_0x35d32b){_0x5800ea=_0x35d32b;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x145086[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),_0x9964('0x66'),_0x9964('0x58'),_0x9964('0x59'),'defaultLoginLogo',_0x9964('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x9964('0x30')](handleEntityNotFound(_0x4a53b1,null))[_0x9964('0x30')](function(_0x19fbef){if(_0x19fbef){var _0xcb9b08=_0x19fbef['loginLogo']&&fs[_0x9964('0x5c')](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x19fbef[_0x9964('0x54')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x19fbef[_0x9964('0x54')])):path[_0x9964('0x5f')](config['root'],_0x2d90c9,_[_0x9964('0x5e')](_0x9964('0x67')));var _0xc45929=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x54'));if(_0x19fbef[_0xc45929]||!_0x5800ea['custom']){_0xcb9b08=path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x9964('0x67')));}if(!fs['existsSync'](_0xcb9b08)){throw new db['Sequelize']['ValidationError'](_[_0x9964('0x60')](_0x9964('0x54'))+'\x20not\x20found');}return _0x4a53b1[_0x9964('0x64')](_0xcb9b08);}})[_0x9964('0x22')](handleError(_0x4a53b1,null));};exports[_0x9964('0x69')]=function(_0x49cff4,_0x379ada){return db[_0x9964('0x34')]['find']({'where':{'id':_0x49cff4[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x6a')]})['then'](respondWithResult(_0x379ada,null))[_0x9964('0x22')](handleError(_0x379ada,null));};exports[_0x9964('0x6b')]=function(_0x16df9f,_0x34c85e,_0x2a94a3){if(_0x16df9f['file']&&_0x16df9f[_0x9964('0x50')]['filename']){_0x16df9f[_0x9964('0x4e')][_0x9964('0x66')]=_0x16df9f['file'][_0x9964('0x51')];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x16df9f[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34c85e,null))[_0x9964('0x30')](saveUpdates(_0x16df9f[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x34c85e,null))[_0x9964('0x22')](handleError(_0x34c85e,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x6c')]=function(_0x128882,_0x11dce5,_0x41200c){var _0x224f60=_0x9964('0x56');var _0x16b018={'custom':![]};return utilLicense['getLicense']()[_0x9964('0x30')](function(_0x56e3bf){if(_0x56e3bf){_0x16b018=_0x56e3bf;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x128882['params']['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),_0x9964('0x66'),_0x9964('0x58'),_0x9964('0x59'),_0x9964('0x5a'),_0x9964('0x5b'),_0x9964('0x6d')],'raw':!![]});})['then'](handleEntityNotFound(_0x11dce5,null))[_0x9964('0x30')](function(_0x14e6e8){if(_0x14e6e8){var _0x342d35=_0x14e6e8['preferred']&&fs[_0x9964('0x5c')](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_['toLower'](_0x14e6e8[_0x9964('0x66')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x14e6e8[_0x9964('0x66')])):path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x9964('0x6e')));var _0x5cf819=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x66'));if(_0x14e6e8[_0x5cf819]||!_0x16b018['custom']||!_0x16b018[_0x9964('0x66')]){_0x342d35=path['join'](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x9964('0x6e')));}if(!fs['existsSync'](_0x342d35)){throw new db[(_0x9964('0x62'))][(_0x9964('0x6f'))](_[_0x9964('0x60')]('preferred')+_0x9964('0x63'));}return _0x11dce5[_0x9964('0x64')](_0x342d35);}})[_0x9964('0x22')](handleError(_0x11dce5,null));};exports['addFavicon']=function(_0x14db69,_0x22e298,_0x1bdedf){if(_0x14db69['file']&&_0x14db69[_0x9964('0x50')][_0x9964('0x51')]){_0x14db69[_0x9964('0x4e')]['favicon']=_0x14db69[_0x9964('0x50')][_0x9964('0x51')];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x14db69[_0x9964('0x4c')]['id']}})[_0x9964('0x30')](handleEntityNotFound(_0x22e298,null))['then'](saveUpdates(_0x14db69[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x22e298,null))[_0x9964('0x22')](handleError(_0x22e298,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x70')]=function(_0xc3da2e,_0x233fac,_0x5e2b2f){var _0x26e9de=_0x9964('0x56');var _0x1570fc={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x49ff89){if(_0x49ff89){_0x1570fc=_0x49ff89;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0xc3da2e[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),'loginLogo','preferred','favicon','defaultLogo',_0x9964('0x5a'),_0x9964('0x5b'),_0x9964('0x6d')],'raw':!![]});})[_0x9964('0x30')](handleEntityNotFound(_0x233fac,null))[_0x9964('0x30')](function(_0xf61611){if(_0xf61611){var _0x9f6bcf=_0xf61611['favicon']&&fs['existsSync'](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')](_0xf61611[_0x9964('0x58')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')](_0xf61611['favicon'])):path['join'](config['root'],_0x26e9de,_['toLower']('default_favicon.ico'));var _0x4783a5=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x58'));if(_0xf61611[_0x4783a5]||!_0x1570fc[_0x9964('0x71')]){_0x9f6bcf=path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')]('default_favicon.ico'));}if(!fs[_0x9964('0x5c')](_0x9f6bcf)){throw new db['Sequelize'][(_0x9964('0x6f'))](_[_0x9964('0x60')](_0x9964('0x58'))+'\x20not\x20found');}return _0x233fac[_0x9964('0x64')](_0x9f6bcf);}})['catch'](handleError(_0x233fac,null));};exports[_0x9964('0x72')]=function(_0x2c2d39,_0x2b8be7){var _0xd7906f={'offset':moment()[_0x9964('0x73')]()};_0xd7906f['now']=moment()[_0x9964('0x73')](_0xd7906f[_0x9964('0x29')])[_0x9964('0x74')](_0x9964('0x75'));return _0x2b8be7[_0x9964('0x25')](0xc8)[_0x9964('0x76')](_0xd7906f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f0a1e57..16bce7b 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x37dfdb,_0x51140f){var _0x1f1715=function(_0x88d974){while(--_0x88d974){_0x37dfdb['push'](_0x37dfdb['shift']());}};_0x1f1715(++_0x51140f);}(_0x008c,0x188));var _0xc008=function(_0x24ec6f,_0x1de736){_0x24ec6f=_0x24ec6f-0x0;var _0x2b3d05=_0x008c[_0x24ec6f];return _0x2b3d05;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x008c,0x188));var _0xc008=function(_0x482611,_0x33356d){_0x482611=_0x482611-0x0;var _0x4aeb3a=_0x008c[_0x482611];return _0x4aeb3a;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c1be22a..73dd05c 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 _0xf7aa=['stringify','error','code','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x141cd1,_0x4bc8ef){var _0x177e06=function(_0x4f7372){while(--_0x4f7372){_0x141cd1['push'](_0x141cd1['shift']());}};_0x177e06(++_0x4bc8ef);}(_0xf7aa,0x10f));var _0xaf7a=function(_0x50985f,_0x789753){_0x50985f=_0x50985f-0x0;var _0x5924c2=_0xf7aa[_0x50985f];return _0x5924c2;};'use strict';var _=require(_0xaf7a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaf7a('0x1'));var rs=require(_0xaf7a('0x2'));var fs=require('fs');var Redis=require(_0xaf7a('0x3'));var db=require(_0xaf7a('0x4'))['db'];var utils=require(_0xaf7a('0x5'));var logger=require(_0xaf7a('0x6'))(_0xaf7a('0x7'));var config=require(_0xaf7a('0x8'));var jayson=require(_0xaf7a('0x9'));var client=jayson[_0xaf7a('0xa')][_0xaf7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10e083,_0x303334,_0x3871fb){return new BPromise(function(_0x4ac846,_0xdc4e87){return client[_0xaf7a('0xc')](_0x10e083,_0x3871fb)[_0xaf7a('0xd')](function(_0x4c1754){logger['info'](_0xaf7a('0xe'),_0x303334,_0xaf7a('0xf'));logger[_0xaf7a('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x303334,_0xaf7a('0xf'),JSON[_0xaf7a('0x11')](_0x4c1754));if(_0x4c1754[_0xaf7a('0x12')]){if(_0x4c1754[_0xaf7a('0x12')][_0xaf7a('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x303334,_0x4c1754[_0xaf7a('0x12')][_0xaf7a('0x14')]);return _0xdc4e87(_0x4c1754['error'][_0xaf7a('0x14')]);}logger['error'](_0xaf7a('0xe'),_0x303334,_0x4c1754[_0xaf7a('0x12')]['message']);return _0x4ac846(_0x4c1754[_0xaf7a('0x12')][_0xaf7a('0x14')]);}else{logger['info'](_0xaf7a('0xe'),_0x303334,_0xaf7a('0xf'));_0x4ac846(_0x4c1754[_0xaf7a('0x15')][_0xaf7a('0x14')]);}})[_0xaf7a('0x16')](function(_0x4ba076){logger[_0xaf7a('0x12')](_0xaf7a('0xe'),_0x303334,_0x4ba076);_0xdc4e87(_0x4ba076);});});}exports[_0xaf7a('0x17')]=function(_0x339d01){var _0x91c0cf=this;return new Promise(function(_0x9c5ab5,_0x21bf8f){return db[_0xaf7a('0x18')]['find']({'raw':_0x339d01[_0xaf7a('0x19')]?_0x339d01[_0xaf7a('0x19')][_0xaf7a('0x1a')]===undefined?!![]:![]:!![],'where':_0x339d01[_0xaf7a('0x19')]?_0x339d01[_0xaf7a('0x19')][_0xaf7a('0x1b')]||null:null,'attributes':_0x339d01[_0xaf7a('0x19')]?_0x339d01[_0xaf7a('0x19')][_0xaf7a('0x1c')]||null:null,'include':_0x339d01[_0xaf7a('0x19')]?_0x339d01[_0xaf7a('0x19')][_0xaf7a('0x1d')]?_[_0xaf7a('0x1e')](_0x339d01[_0xaf7a('0x19')][_0xaf7a('0x1d')],function(_0x24ccf5){return{'model':db[_0x24ccf5['model']],'as':_0x24ccf5['as'],'attributes':_0x24ccf5['attributes'],'include':_0x24ccf5[_0xaf7a('0x1d')]?_[_0xaf7a('0x1e')](_0x24ccf5[_0xaf7a('0x1d')],function(_0x3ccb73){return{'model':db[_0x3ccb73[_0xaf7a('0x1f')]],'as':_0x3ccb73['as'],'attributes':_0x3ccb73[_0xaf7a('0x1c')],'include':_0x3ccb73[_0xaf7a('0x1d')]?_[_0xaf7a('0x1e')](_0x3ccb73[_0xaf7a('0x1d')],function(_0x4437d5){return{'model':db[_0x4437d5[_0xaf7a('0x1f')]],'as':_0x4437d5['as'],'attributes':_0x4437d5[_0xaf7a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaf7a('0xd')](function(_0xf15e31){logger['info'](_0xaf7a('0x17'),_0x339d01);logger[_0xaf7a('0x10')]('ShowSetting',_0x339d01,JSON[_0xaf7a('0x11')](_0xf15e31));_0x9c5ab5(_0xf15e31);})[_0xaf7a('0x16')](function(_0x3e66e3){logger[_0xaf7a('0x12')](_0xaf7a('0x17'),_0x3e66e3[_0xaf7a('0x14')],_0x339d01);_0x21bf8f(_0x91c0cf[_0xaf7a('0x12')](0x1f4,_0x3e66e3[_0xaf7a('0x14')]));});});}; \ No newline at end of file +var _0x1312=['message','info','result','catch','ShowSetting','Setting','find','options','where','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1312,0x148));var _0x2131=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x1312[_0x274dd7];return _0x148829;};'use strict';var _=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var moment=require('moment');var BPromise=require(_0x2131('0x2'));var rs=require(_0x2131('0x3'));var fs=require('fs');var Redis=require(_0x2131('0x4'));var db=require(_0x2131('0x5'))['db'];var utils=require(_0x2131('0x6'));var logger=require(_0x2131('0x7'))(_0x2131('0x8'));var config=require(_0x2131('0x9'));var jayson=require(_0x2131('0xa'));var client=jayson[_0x2131('0xb')][_0x2131('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b225e,_0x154746,_0xcf8894){return new BPromise(function(_0xa9f9aa,_0x33a402){return client[_0x2131('0xd')](_0x1b225e,_0xcf8894)[_0x2131('0xe')](function(_0x1271f6){logger['info'](_0x2131('0xf'),_0x154746,_0x2131('0x10'));logger[_0x2131('0x11')](_0x2131('0x12'),_0x154746,_0x2131('0x10'),JSON[_0x2131('0x13')](_0x1271f6));if(_0x1271f6['error']){if(_0x1271f6[_0x2131('0x14')][_0x2131('0x15')]===0x1f4){logger[_0x2131('0x14')](_0x2131('0xf'),_0x154746,_0x1271f6[_0x2131('0x14')]['message']);return _0x33a402(_0x1271f6[_0x2131('0x14')]['message']);}logger['error'](_0x2131('0xf'),_0x154746,_0x1271f6[_0x2131('0x14')][_0x2131('0x16')]);return _0xa9f9aa(_0x1271f6[_0x2131('0x14')][_0x2131('0x16')]);}else{logger[_0x2131('0x17')](_0x2131('0xf'),_0x154746,_0x2131('0x10'));_0xa9f9aa(_0x1271f6[_0x2131('0x18')][_0x2131('0x16')]);}})[_0x2131('0x19')](function(_0x111a53){logger[_0x2131('0x14')]('Setting,\x20%s,\x20%s',_0x154746,_0x111a53);_0x33a402(_0x111a53);});});}exports[_0x2131('0x1a')]=function(_0x4574cb){var _0x3ce9ff=this;return new Promise(function(_0x260928,_0x291b40){return db[_0x2131('0x1b')][_0x2131('0x1c')]({'raw':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')][_0x2131('0x1e')]||null:null,'attributes':_0x4574cb['options']?_0x4574cb['options']['attributes']||null:null,'include':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')][_0x2131('0x1f')]?_[_0x2131('0x20')](_0x4574cb[_0x2131('0x1d')][_0x2131('0x1f')],function(_0x3df3a4){return{'model':db[_0x3df3a4[_0x2131('0x21')]],'as':_0x3df3a4['as'],'attributes':_0x3df3a4[_0x2131('0x22')],'include':_0x3df3a4[_0x2131('0x1f')]?_[_0x2131('0x20')](_0x3df3a4['include'],function(_0x594b6c){return{'model':db[_0x594b6c[_0x2131('0x21')]],'as':_0x594b6c['as'],'attributes':_0x594b6c[_0x2131('0x22')],'include':_0x594b6c[_0x2131('0x1f')]?_[_0x2131('0x20')](_0x594b6c[_0x2131('0x1f')],function(_0x490e98){return{'model':db[_0x490e98[_0x2131('0x21')]],'as':_0x490e98['as'],'attributes':_0x490e98[_0x2131('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2131('0xe')](function(_0xaf18f7){logger['info'](_0x2131('0x1a'),_0x4574cb);logger[_0x2131('0x11')](_0x2131('0x1a'),_0x4574cb,JSON[_0x2131('0x13')](_0xaf18f7));_0x260928(_0xaf18f7);})['catch'](function(_0x54a5d4){logger[_0x2131('0x14')]('ShowSetting',_0x54a5d4[_0x2131('0x16')],_0x4574cb);_0x291b40(_0x3ce9ff[_0x2131('0x14')](0x1f4,_0x54a5d4[_0x2131('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index be485d5..f021be4 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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x5e608c,_0x453591){var _0x44d7fc=function(_0xc9de57){while(--_0xc9de57){_0x5e608c['push'](_0x5e608c['shift']());}};_0x44d7fc(++_0x453591);}(_0xe14b,0x93));var _0xbe14=function(_0x2985fb,_0x1adbbc){_0x2985fb=_0x2985fb-0x0;var _0x6da70b=_0xe14b[_0x2985fb];return _0x6da70b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file +var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x462545,_0x3c0f1b){var _0x680d51=function(_0x22727b){while(--_0x22727b){_0x462545['push'](_0x462545['shift']());}};_0x680d51(++_0x3c0f1b);}(_0x326f,0xd1));var _0xf326=function(_0x3cb7df,_0x50838f){_0x3cb7df=_0x3cb7df-0x0;var _0x4956fb=_0x326f[_0x3cb7df];return _0x4956fb;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 020e27d..97ae4a9 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 _0x4aa8=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','STRING','name','twilio','skebby','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT'];(function(_0x53fa89,_0x17447d){var _0x135f8c=function(_0x3801ec){while(--_0x3801ec){_0x53fa89['push'](_0x53fa89['shift']());}};_0x135f8c(++_0x17447d);}(_0x4aa8,0x102));var _0x84aa=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x4aa8[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x84aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x84aa('0x1')],'unique':_0x84aa('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x84aa('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x84aa('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x84aa('0x1')]},'type':{'type':Sequelize['ENUM'](_0x84aa('0x3'),_0x84aa('0x4'),'connectel',_0x84aa('0x5'),_0x84aa('0x6'),_0x84aa('0x7'),_0x84aa('0x8'),_0x84aa('0x9'),_0x84aa('0xa'),_0x84aa('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x84aa('0x1')]},'authToken':{'type':Sequelize[_0x84aa('0x1')]},'smsMethod':{'type':Sequelize[_0x84aa('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x84aa('0x1')]},'password':{'type':Sequelize[_0x84aa('0x1')]},'apiKey':{'type':Sequelize[_0x84aa('0x1')]},'applicationId':{'type':Sequelize[_0x84aa('0x1')]},'accountId':{'type':Sequelize[_0x84aa('0x1')]},'senderString':{'type':Sequelize[_0x84aa('0x1')]},'deliveryReport':{'type':Sequelize[_0x84aa('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x84aa('0x1')]},'notificationTemplate':{'type':Sequelize[_0x84aa('0xe')],'defaultValue':function(){return _0x84aa('0xf');}},'notificationSound':{'type':Sequelize[_0x84aa('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x84aa('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x84aa('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x84aa('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x84aa('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x84aa('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x84aa('0x10')],'comment':_0x84aa('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x84aa('0xd')],'defaultValue':![],'comment':_0x84aa('0x12'),'set':function(_0x40906c){if(!_0x40906c)this[_0x84aa('0x13')](_0x84aa('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x40906c);}}}; \ No newline at end of file +var _0xe8c8=['exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe8c8,0x11d));var _0x8e8c=function(_0x3a8ce5,_0x1d30cc){_0x3a8ce5=_0x3a8ce5-0x0;var _0xa3f226=_0xe8c8[_0x3a8ce5];return _0xa3f226;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8e8c('0x0')]={'name':{'type':Sequelize[_0x8e8c('0x1')],'unique':_0x8e8c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x8e8c('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x8e8c('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x8e8c('0x1')],'defaultValue':function(){return rs[_0x8e8c('0x3')]();}},'phone':{'type':Sequelize[_0x8e8c('0x1')]},'type':{'type':Sequelize[_0x8e8c('0x4')](_0x8e8c('0x5'),_0x8e8c('0x6'),'connectel',_0x8e8c('0x7'),_0x8e8c('0x8'),'clickatell','bandwidth',_0x8e8c('0x9'),'infobip',_0x8e8c('0xa'))},'accountSid':{'type':Sequelize[_0x8e8c('0x1')]},'authId':{'type':Sequelize[_0x8e8c('0x1')]},'authToken':{'type':Sequelize[_0x8e8c('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8e8c('0x1')]},'password':{'type':Sequelize[_0x8e8c('0x1')]},'apiKey':{'type':Sequelize[_0x8e8c('0x1')]},'applicationId':{'type':Sequelize[_0x8e8c('0x1')]},'accountId':{'type':Sequelize[_0x8e8c('0x1')]},'senderString':{'type':Sequelize[_0x8e8c('0x1')]},'deliveryReport':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x8e8c('0x1')]},'notificationTemplate':{'type':Sequelize[_0x8e8c('0xc')],'defaultValue':function(){return _0x8e8c('0xd');}},'notificationSound':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8e8c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8e8c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8e8c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![],'comment':_0x8e8c('0x10'),'set':function(_0x27399e){if(!_0x27399e)this[_0x8e8c('0x11')](_0x8e8c('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x27399e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a2e57fb..e3d9e41 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 _0xb1f4=['message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','SmsAccounts','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','body','Disposition','findOne','pick','SmsAccountId','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','messageId','MessageSid','skebby','text','message_id','plivo','Text','infobip','results','csc','originatingAddress','replyMessageId','bandwidth','intelepeer','refid','isNil','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','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','autoclose','push','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a2fb4,_0x22ed91){var _0x4dcf80=function(_0x25b6ba){while(--_0x25b6ba){_0x4a2fb4['push'](_0x4a2fb4['shift']());}};_0x4dcf80(++_0x22ed91);}(_0xb1f4,0x19c));var _0x4b1f=function(_0x3afbb0,_0x5a94dc){_0x3afbb0=_0x3afbb0-0x0;var _0x1b2ab8=_0xb1f4[_0x3afbb0];return _0x1b2ab8;};'use strict';var emlformat=require(_0x4b1f('0x0'));var rimraf=require(_0x4b1f('0x1'));var zipdir=require(_0x4b1f('0x2'));var jsonpatch=require(_0x4b1f('0x3'));var rp=require(_0x4b1f('0x4'));var moment=require('moment');var BPromise=require(_0x4b1f('0x5'));var Mustache=require(_0x4b1f('0x6'));var util=require(_0x4b1f('0x7'));var path=require(_0x4b1f('0x8'));var sox=require('sox');var csv=require(_0x4b1f('0x9'));var ejs=require(_0x4b1f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b1f('0xb'));var squel=require('squel');var crypto=require(_0x4b1f('0xc'));var jsforce=require(_0x4b1f('0xd'));var deskjs=require(_0x4b1f('0xe'));var toCsv=require(_0x4b1f('0x9'));var querystring=require('querystring');var Papa=require(_0x4b1f('0xf'));var Redis=require('ioredis');var authService=require(_0x4b1f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b1f('0x11'));var logger=require('../../config/logger')(_0x4b1f('0x12'));var utils=require(_0x4b1f('0x13'));var config=require(_0x4b1f('0x14'));var licenseUtil=require(_0x4b1f('0x15'));var db=require(_0x4b1f('0x16'))['db'];config[_0x4b1f('0x17')]=_[_0x4b1f('0x18')](config[_0x4b1f('0x17')],{'host':_0x4b1f('0x19'),'port':0x18eb});var socket=require(_0x4b1f('0x1a'))(new Redis(config[_0x4b1f('0x17')]));require(_0x4b1f('0x1b'))['register'](socket);var jayson=require(_0x4b1f('0x1c'));var client=jayson[_0x4b1f('0x1d')][_0x4b1f('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0xa9ea1b,_0x2fd493,_0x28c90c,_0x4a6b8f){return new BPromise(function(_0x4bb7e8,_0x578c61){var _0x1ed196=_0x4a6b8f||client;return _0x1ed196[_0x4b1f('0x1f')](_0xa9ea1b,_0x28c90c)[_0x4b1f('0x20')](function(_0x31699c){logger[_0x4b1f('0x21')](_0x4b1f('0x22'),_0x2fd493,_0x4b1f('0x23'));logger[_0x4b1f('0x24')](_0x4b1f('0x25'),_0x2fd493,'request\x20sent',JSON[_0x4b1f('0x26')](_0x31699c));if(_0x31699c[_0x4b1f('0x27')]){if(_0x31699c['error']['code']===0x1f4){logger[_0x4b1f('0x27')](_0x4b1f('0x22'),_0x2fd493,_0x31699c[_0x4b1f('0x27')][_0x4b1f('0x28')]);return _0x578c61(_0x31699c[_0x4b1f('0x27')]['message']);}logger[_0x4b1f('0x27')](_0x4b1f('0x22'),_0x2fd493,_0x31699c[_0x4b1f('0x27')][_0x4b1f('0x28')]);return _0x4bb7e8(_0x31699c[_0x4b1f('0x27')][_0x4b1f('0x28')]);}else{logger['info'](_0x4b1f('0x22'),_0x2fd493,_0x4b1f('0x23'));_0x4bb7e8(_0x31699c[_0x4b1f('0x29')]['message']);}})[_0x4b1f('0x2a')](function(_0x5ce91c){logger[_0x4b1f('0x27')](_0x4b1f('0x22'),_0x2fd493,_0x5ce91c);_0x578c61(_0x5ce91c);});});}function respondWithStatusCode(_0x48872f,_0x21db24){_0x21db24=_0x21db24||0xcc;return function(_0x390f34){if(_0x390f34){return _0x48872f[_0x4b1f('0x2b')](_0x21db24);}return _0x48872f[_0x4b1f('0x2c')](_0x21db24)[_0x4b1f('0x2d')]();};}function respondWithResult(_0x328a26,_0x2b4d26){_0x2b4d26=_0x2b4d26||0xc8;return function(_0x3581e3){if(_0x3581e3){return _0x328a26[_0x4b1f('0x2c')](_0x2b4d26)[_0x4b1f('0x2e')](_0x3581e3);}};}function respondWithFilteredResult(_0x9edeab,_0x941f6d){return function(_0x2cd677){if(_0x2cd677){var _0x102063=typeof _0x941f6d[_0x4b1f('0x2f')]===_0x4b1f('0x30')&&typeof _0x941f6d[_0x4b1f('0x31')]===_0x4b1f('0x30');var _0x26a796=_0x2cd677['count'];var _0xf21d9d=_0x102063?0x0:_0x941f6d['offset'];var _0x52a6f8=_0x102063?_0x2cd677[_0x4b1f('0x32')]:_0x941f6d[_0x4b1f('0x2f')]+_0x941f6d['limit'];var _0x4ebbae;if(_0x52a6f8>=_0x26a796){_0x52a6f8=_0x26a796;_0x4ebbae=0xc8;}else{_0x4ebbae=0xce;}_0x9edeab[_0x4b1f('0x2c')](_0x4ebbae);return _0x9edeab['set']('Content-Range',_0xf21d9d+'-'+_0x52a6f8+'/'+_0x26a796)[_0x4b1f('0x2e')](_0x2cd677);}return null;};}function patchUpdates(_0x277bd4){return function(_0x1c5f7d){try{jsonpatch['apply'](_0x1c5f7d,_0x277bd4,!![]);}catch(_0x4f2f90){return BPromise[_0x4b1f('0x33')](_0x4f2f90);}return _0x1c5f7d[_0x4b1f('0x34')]();};}function saveUpdates(_0x393a2c,_0x4ff496){return function(_0x37858e){if(_0x37858e){return _0x37858e[_0x4b1f('0x35')](_0x393a2c)['then'](function(_0x2255a7){return _0x2255a7;});}return null;};}function removeEntity(_0xb4699,_0x275ba4){return function(_0x30ed0a){if(_0x30ed0a){return _0x30ed0a[_0x4b1f('0x36')]()[_0x4b1f('0x20')](function(){var _0x44d9a9=_0x30ed0a['get']({'plain':!![]});var _0x3b0a9c=_0x4b1f('0x37');return db['UserProfileResource'][_0x4b1f('0x36')]({'where':{'type':_0x3b0a9c,'resourceId':_0x44d9a9['id']}})[_0x4b1f('0x20')](function(){return _0x30ed0a;});})[_0x4b1f('0x20')](function(){_0xb4699[_0x4b1f('0x2c')](0xcc)[_0x4b1f('0x2d')]();});}};}function handleEntityNotFound(_0xabb6fc,_0x371643){return function(_0x105be0){if(!_0x105be0){_0xabb6fc[_0x4b1f('0x2b')](0x194);}return _0x105be0;};}function handleError(_0xcaf13a,_0x14c388){_0x14c388=_0x14c388||0x1f4;return function(_0x321034){logger[_0x4b1f('0x27')](_0x321034[_0x4b1f('0x38')]);if(_0x321034[_0x4b1f('0x39')]){delete _0x321034[_0x4b1f('0x39')];}_0xcaf13a[_0x4b1f('0x2c')](_0x14c388)[_0x4b1f('0x3a')](_0x321034);};}exports[_0x4b1f('0x3b')]=function(_0x4a208d,_0x1dc1a9){var _0xef5655={'include':[{'model':db[_0x4b1f('0x3c')],'as':'mandatoryDispositionPause'}]},_0x252534={},_0xec07ef={'count':0x0,'rows':[]};var _0x10d60d=_[_0x4b1f('0x3d')](db[_0x4b1f('0x3e')][_0x4b1f('0x3f')],function(_0x58902b){return{'name':_0x58902b[_0x4b1f('0x40')],'type':_0x58902b[_0x4b1f('0x41')]['key']};});_0x252534[_0x4b1f('0x42')]=_['map'](_0x10d60d,'name');_0x252534[_0x4b1f('0x43')]=_[_0x4b1f('0x44')](_0x4a208d[_0x4b1f('0x43')]);_0x252534[_0x4b1f('0x45')]=_[_0x4b1f('0x46')](_0x252534[_0x4b1f('0x42')],_0x252534['query']);_0xef5655['attributes']=_[_0x4b1f('0x46')](_0x252534['model'],qs[_0x4b1f('0x47')](_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x47')]));_0xef5655[_0x4b1f('0x48')]=_0xef5655['attributes'][_0x4b1f('0x49')]?_0xef5655[_0x4b1f('0x48')]:_0x252534[_0x4b1f('0x42')];if(!_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x4a')](_0x4b1f('0x4b'))){_0xef5655[_0x4b1f('0x31')]=qs[_0x4b1f('0x31')](_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x31')]);_0xef5655[_0x4b1f('0x2f')]=qs[_0x4b1f('0x2f')](_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x2f')]);}_0xef5655[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x4d')]);_0xef5655[_0x4b1f('0x4e')]=qs['filters'](_['pick'](_0x4a208d[_0x4b1f('0x43')],_0x252534['filters']),_0x10d60d);if(_0x4a208d['query'][_0x4b1f('0x4f')]){_0xef5655[_0x4b1f('0x4e')]=_[_0x4b1f('0x50')](_0xef5655[_0x4b1f('0x4e')],{'$or':_[_0x4b1f('0x3d')](_0x10d60d,function(_0x388d21){if(_0x388d21[_0x4b1f('0x41')]!==_0x4b1f('0x51')){var _0x4a5820={};_0x4a5820[_0x388d21[_0x4b1f('0x39')]]={'$like':'%'+_0x4a208d['query']['filter']+'%'};return _0x4a5820;}})});}_0xef5655=_[_0x4b1f('0x50')]({},_0xef5655,_0x4a208d[_0x4b1f('0x52')]);var _0x3a9618={'where':_0xef5655['where']};return db[_0x4b1f('0x3e')]['count'](_0x3a9618)[_0x4b1f('0x20')](function(_0x663e69){_0xec07ef[_0x4b1f('0x32')]=_0x663e69;if(_0x4a208d[_0x4b1f('0x43')][_0x4b1f('0x53')]){_0xef5655[_0x4b1f('0x54')]=[{'all':!![]}];}return db[_0x4b1f('0x3e')][_0x4b1f('0x55')](_0xef5655);})[_0x4b1f('0x20')](function(_0x328f13){_0xec07ef[_0x4b1f('0x56')]=_0x328f13;return _0xec07ef;})[_0x4b1f('0x20')](respondWithFilteredResult(_0x1dc1a9,_0xef5655))['catch'](handleError(_0x1dc1a9,null));};exports[_0x4b1f('0x57')]=function(_0x8efcfe,_0x42acd8){var _0x3e94fd={'raw':![],'where':{'id':_0x8efcfe[_0x4b1f('0x58')]['id']},'include':[{'model':db[_0x4b1f('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3dae09={};_0x3dae09[_0x4b1f('0x42')]=_[_0x4b1f('0x44')](db[_0x4b1f('0x3e')][_0x4b1f('0x3f')]);_0x3dae09['query']=_[_0x4b1f('0x44')](_0x8efcfe[_0x4b1f('0x43')]);_0x3dae09[_0x4b1f('0x45')]=_[_0x4b1f('0x46')](_0x3dae09[_0x4b1f('0x42')],_0x3dae09[_0x4b1f('0x43')]);_0x3e94fd[_0x4b1f('0x48')]=_[_0x4b1f('0x46')](_0x3dae09[_0x4b1f('0x42')],qs['fields'](_0x8efcfe[_0x4b1f('0x43')][_0x4b1f('0x47')]));_0x3e94fd[_0x4b1f('0x48')]=_0x3e94fd[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x3e94fd[_0x4b1f('0x48')]:_0x3dae09[_0x4b1f('0x42')];if(_0x8efcfe['query'][_0x4b1f('0x53')]){_0x3e94fd[_0x4b1f('0x54')]=[{'all':!![]}];}_0x3e94fd=_['merge']({},_0x3e94fd,_0x8efcfe[_0x4b1f('0x52')]);return db['SmsAccount'][_0x4b1f('0x59')](_0x3e94fd)[_0x4b1f('0x20')](handleEntityNotFound(_0x42acd8,null))['then'](respondWithResult(_0x42acd8,null))[_0x4b1f('0x2a')](handleError(_0x42acd8,null));};exports[_0x4b1f('0x5a')]=function(_0x58320a,_0xd5ac6e){return db[_0x4b1f('0x3e')][_0x4b1f('0x5a')](_0x58320a['body'],{})[_0x4b1f('0x20')](function(_0xc30456){var _0x36c8a4=_0x58320a[_0x4b1f('0x5b')][_0x4b1f('0x5c')]({'plain':!![]});if(!_0x36c8a4)throw new Error(_0x4b1f('0x5d'));if(_0x36c8a4['role']===_0x4b1f('0x5b')){var _0xe0dcee=_0xc30456[_0x4b1f('0x5c')]({'plain':!![]});var _0x1e66af=_0x4b1f('0x37');return db[_0x4b1f('0x5e')][_0x4b1f('0x59')]({'where':{'name':_0x1e66af,'userProfileId':_0x36c8a4[_0x4b1f('0x5f')]},'raw':!![]})[_0x4b1f('0x20')](function(_0x11dd63){if(_0x11dd63&&_0x11dd63['autoAssociation']===0x0){return db[_0x4b1f('0x60')][_0x4b1f('0x5a')]({'name':_0xe0dcee['name'],'resourceId':_0xe0dcee['id'],'type':_0x11dd63[_0x4b1f('0x39')],'sectionId':_0x11dd63['id']},{})[_0x4b1f('0x20')](function(){return _0xc30456;});}else{return _0xc30456;}})['catch'](function(_0x36f53e){logger[_0x4b1f('0x27')](_0x4b1f('0x61'),_0x36f53e);throw _0x36f53e;});}return _0xc30456;})[_0x4b1f('0x20')](respondWithResult(_0xd5ac6e,0xc9))[_0x4b1f('0x2a')](handleError(_0xd5ac6e,null));};exports['update']=function(_0x2632e4,_0x35e4ba){if(_0x2632e4['body']['id']){delete _0x2632e4['body']['id'];}return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x2632e4[_0x4b1f('0x58')]['id']},'include':[{'model':db[_0x4b1f('0x3c')],'as':_0x4b1f('0x62')}]})['then'](handleEntityNotFound(_0x35e4ba,null))[_0x4b1f('0x20')](saveUpdates(_0x2632e4['body'],null))['then'](respondWithResult(_0x35e4ba,null))['catch'](handleError(_0x35e4ba,null));};exports[_0x4b1f('0x36')]=function(_0x50d8b0,_0x3b4092){return db['SmsAccount']['find']({'where':{'id':_0x50d8b0[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x3b4092,null))[_0x4b1f('0x20')](removeEntity(_0x3b4092,null))[_0x4b1f('0x2a')](handleError(_0x3b4092,null));};exports[_0x4b1f('0x63')]=function(_0x14779c,_0x85887f){return db[_0x4b1f('0x3e')][_0x4b1f('0x63')]()[_0x4b1f('0x20')](respondWithResult(_0x85887f,null))[_0x4b1f('0x2a')](handleError(_0x85887f,null));};exports[_0x4b1f('0x64')]=function(_0x5758e3,_0x4bd8c8,_0x5c8c7e){if(_0x5758e3[_0x4b1f('0x65')]['id']){delete _0x5758e3[_0x4b1f('0x65')]['id'];}return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x5758e3[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x4bd8c8,null))[_0x4b1f('0x20')](function(_0x7119fb){if(_0x7119fb){_0x5758e3[_0x4b1f('0x65')]['SmsAccountId']=_0x7119fb['id'];return db[_0x4b1f('0x66')]['create'](_0x5758e3[_0x4b1f('0x65')]);}})[_0x4b1f('0x20')](respondWithResult(_0x4bd8c8,null))[_0x4b1f('0x2a')](handleError(_0x4bd8c8,null));};exports['getDispositions']=function(_0x419708,_0x4cc80f,_0x437e82){var _0x300e04={'raw':![],'where':{}};var _0x37c62b={};var _0xf8707d={'count':0x0,'rows':[]};return db[_0x4b1f('0x3e')][_0x4b1f('0x67')]({'where':{'id':_0x419708['params']['id']}})['then'](handleEntityNotFound(_0x4cc80f,null))[_0x4b1f('0x20')](function(_0x4c1f50){if(_0x4c1f50){_0x37c62b[_0x4b1f('0x42')]=_['keys'](db['Disposition'][_0x4b1f('0x3f')]);_0x37c62b['query']=_[_0x4b1f('0x44')](_0x419708['query']);_0x37c62b['filters']=_[_0x4b1f('0x46')](_0x37c62b[_0x4b1f('0x42')],_0x37c62b['query']);_0x300e04[_0x4b1f('0x48')]=_[_0x4b1f('0x46')](_0x37c62b[_0x4b1f('0x42')],qs['fields'](_0x419708['query'][_0x4b1f('0x47')]));_0x300e04['attributes']=_0x300e04[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x300e04[_0x4b1f('0x48')]:_0x37c62b[_0x4b1f('0x42')];if(!_0x419708[_0x4b1f('0x43')][_0x4b1f('0x4a')]('nolimit')){_0x300e04[_0x4b1f('0x31')]=qs['limit'](_0x419708[_0x4b1f('0x43')]['limit']);_0x300e04[_0x4b1f('0x2f')]=qs[_0x4b1f('0x2f')](_0x419708[_0x4b1f('0x43')][_0x4b1f('0x2f')]);}_0x300e04[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x419708[_0x4b1f('0x43')]['sort']);_0x300e04['where']=qs[_0x4b1f('0x45')](_[_0x4b1f('0x68')](_0x419708[_0x4b1f('0x43')],_0x37c62b[_0x4b1f('0x45')]));_0x300e04['where'][_0x4b1f('0x69')]=_0x4c1f50['id'];if(_0x419708[_0x4b1f('0x43')][_0x4b1f('0x4f')]){_0x300e04['where']=_[_0x4b1f('0x50')](_0x300e04[_0x4b1f('0x4e')],{'$or':_[_0x4b1f('0x3d')](_0x300e04[_0x4b1f('0x48')],function(_0x16c480){var _0x47fa16={};_0x47fa16[_0x16c480]={'$like':'%'+_0x419708[_0x4b1f('0x43')][_0x4b1f('0x4f')]+'%'};return _0x47fa16;})});}_0x300e04=_[_0x4b1f('0x50')]({},_0x300e04,_0x419708[_0x4b1f('0x52')]);return db[_0x4b1f('0x66')]['count']({'where':_0x300e04[_0x4b1f('0x4e')]})[_0x4b1f('0x20')](function(_0x3627cb){_0xf8707d['count']=_0x3627cb;if(_0x419708[_0x4b1f('0x43')]['includeAll']){_0x300e04[_0x4b1f('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x300e04);})[_0x4b1f('0x20')](function(_0x4f0cea){_0xf8707d[_0x4b1f('0x56')]=_0x4f0cea;return _0xf8707d;});}})[_0x4b1f('0x20')](respondWithFilteredResult(_0x4cc80f,_0x300e04))[_0x4b1f('0x2a')](handleError(_0x4cc80f,null));};exports['removeDispositions']=function(_0x2c9f3b,_0x1aa0cd,_0xe008ae){return db['SmsAccount']['find']({'where':{'id':_0x2c9f3b[_0x4b1f('0x58')]['id']}})['then'](handleEntityNotFound(_0x1aa0cd,null))['then'](function(_0x34b70b){if(_0x34b70b){return _0x34b70b['removeDispositions'](_0x2c9f3b['query'][_0x4b1f('0x6a')]);}})[_0x4b1f('0x20')](respondWithStatusCode(_0x1aa0cd,null))['catch'](handleError(_0x1aa0cd,null));};exports[_0x4b1f('0x6b')]=function(_0x3ea364,_0x18508e,_0x24779c){if(_0x3ea364[_0x4b1f('0x65')]['id']){delete _0x3ea364['body']['id'];}return db['SmsAccount'][_0x4b1f('0x59')]({'where':{'id':_0x3ea364[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x18508e,null))[_0x4b1f('0x20')](function(_0x62f1b2){if(_0x62f1b2){_0x3ea364[_0x4b1f('0x65')]['SmsAccountId']=_0x62f1b2['id'];return db[_0x4b1f('0x6c')][_0x4b1f('0x5a')](_0x3ea364[_0x4b1f('0x65')]);}})[_0x4b1f('0x20')](respondWithResult(_0x18508e,null))[_0x4b1f('0x2a')](handleError(_0x18508e,null));};exports[_0x4b1f('0x6d')]=function(_0x18cb7b,_0x109954,_0x5272a0){var _0x185942={'raw':![],'where':{}};var _0x10bf63={};var _0x389213={'count':0x0,'rows':[]};return db[_0x4b1f('0x3e')][_0x4b1f('0x67')]({'where':{'id':_0x18cb7b['params']['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x109954,null))['then'](function(_0x2bf094){if(_0x2bf094){_0x10bf63['model']=_[_0x4b1f('0x44')](db[_0x4b1f('0x6c')][_0x4b1f('0x3f')]);_0x10bf63['query']=_['keys'](_0x18cb7b[_0x4b1f('0x43')]);_0x10bf63['filters']=_['intersection'](_0x10bf63[_0x4b1f('0x42')],_0x10bf63['query']);_0x185942[_0x4b1f('0x48')]=_[_0x4b1f('0x46')](_0x10bf63['model'],qs['fields'](_0x18cb7b[_0x4b1f('0x43')][_0x4b1f('0x47')]));_0x185942[_0x4b1f('0x48')]=_0x185942[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x185942[_0x4b1f('0x48')]:_0x10bf63[_0x4b1f('0x42')];if(!_0x18cb7b[_0x4b1f('0x43')]['hasOwnProperty'](_0x4b1f('0x4b'))){_0x185942[_0x4b1f('0x31')]=qs[_0x4b1f('0x31')](_0x18cb7b[_0x4b1f('0x43')]['limit']);_0x185942['offset']=qs['offset'](_0x18cb7b['query'][_0x4b1f('0x2f')]);}_0x185942[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x18cb7b[_0x4b1f('0x43')][_0x4b1f('0x4d')]);_0x185942[_0x4b1f('0x4e')]=qs[_0x4b1f('0x45')](_['pick'](_0x18cb7b[_0x4b1f('0x43')],_0x10bf63[_0x4b1f('0x45')]));_0x185942[_0x4b1f('0x4e')][_0x4b1f('0x69')]=_0x2bf094['id'];if(_0x18cb7b[_0x4b1f('0x43')]['filter']){_0x185942[_0x4b1f('0x4e')]=_[_0x4b1f('0x50')](_0x185942[_0x4b1f('0x4e')],{'$or':_[_0x4b1f('0x3d')](_0x185942['attributes'],function(_0x15d96d){var _0x3e8671={};_0x3e8671[_0x15d96d]={'$like':'%'+_0x18cb7b[_0x4b1f('0x43')][_0x4b1f('0x4f')]+'%'};return _0x3e8671;})});}_0x185942=_[_0x4b1f('0x50')]({},_0x185942,_0x18cb7b['options']);return db[_0x4b1f('0x6c')]['count']({'where':_0x185942[_0x4b1f('0x4e')]})[_0x4b1f('0x20')](function(_0x3ba6da){_0x389213['count']=_0x3ba6da;if(_0x18cb7b[_0x4b1f('0x43')]['includeAll']){_0x185942['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x185942);})[_0x4b1f('0x20')](function(_0x39b79e){_0x389213[_0x4b1f('0x56')]=_0x39b79e;return _0x389213;});}})[_0x4b1f('0x20')](respondWithFilteredResult(_0x109954,_0x185942))[_0x4b1f('0x2a')](handleError(_0x109954,null));};exports[_0x4b1f('0x6e')]=function(_0x471bbb,_0x15a40c,_0x5e02ab){return db['SmsAccount'][_0x4b1f('0x59')]({'where':{'id':_0x471bbb[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x15a40c,null))[_0x4b1f('0x20')](function(_0x144f1c){if(_0x144f1c){return _0x144f1c['removeAnswers'](_0x471bbb[_0x4b1f('0x43')][_0x4b1f('0x6a')]);}})[_0x4b1f('0x20')](respondWithStatusCode(_0x15a40c,null))['catch'](handleError(_0x15a40c,null));};exports['notify']=function(_0x1bca27,_0x4f25c8,_0x1db9f2){var _0x984824={'channel':_0x4b1f('0x6f')};var _0x74abe2=[];var _0xcaf4d5=[];var _0x1ddcdb={};return db[_0x4b1f('0x3e')]['find']({'where':{'id':_0x1bca27[_0x4b1f('0x58')]['id']},'include':[{'model':db[_0x4b1f('0x70')],'as':'Applications'}]})[_0x4b1f('0x20')](handleEntityNotFound(_0x4f25c8,null))[_0x4b1f('0x20')](function(_0x4572b0){_0x984824[_0x4b1f('0x71')]=_0x4572b0;_0x984824[_0x4b1f('0x72')]=_[_0x4b1f('0x73')](_0x4572b0[_0x4b1f('0x74')],[_0x4b1f('0x75')],[_0x4b1f('0x76')]);if(_0x984824[_0x4b1f('0x71')][_0x4b1f('0x74')]){delete _0x984824[_0x4b1f('0x71')][_0x4b1f('0x74')];}return db[_0x4b1f('0x77')][_0x4b1f('0x63')]();})['then'](function(_0x401ba9){if(!_0x401ba9){throw new db[(_0x4b1f('0x78'))][(_0x4b1f('0x79'))](_0x4b1f('0x7a'));}_0x74abe2=_[_0x4b1f('0x7b')](_[_0x4b1f('0x44')](_0x401ba9),['createdAt',_0x4b1f('0x7c')]);_0xcaf4d5=_[_0x4b1f('0x7b')](_[_0x4b1f('0x44')](_0x401ba9),[_0x4b1f('0x7d'),_0x4b1f('0x7c'),_0x4b1f('0x7e'),_0x4b1f('0x7f')]);_0x984824[_0x4b1f('0x65')]={'mapKey':_0x4b1f('0x80')};if(_0x984824[_0x4b1f('0x71')][_0x4b1f('0x41')]){switch(_0x984824[_0x4b1f('0x71')][_0x4b1f('0x41')]){case'twilio':_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')]=_0x1bca27['body'][_0x4b1f('0x82')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27[_0x4b1f('0x65')]['Body'];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x84')];break;case _0x4b1f('0x85'):_0x984824['body'][_0x4b1f('0x81')]='+'+_0x1bca27[_0x4b1f('0x65')]['sender'];_0x984824[_0x4b1f('0x65')]['body']=_0x1bca27['body'][_0x4b1f('0x86')];break;case'connectel':_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')]=_0x1bca27[_0x4b1f('0x65')]['from'];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27[_0x4b1f('0x65')]['message'];break;case'clicksend':_0x984824[_0x4b1f('0x65')]['from']=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x81')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x65')];_0x984824[_0x4b1f('0x65')]['messageId']=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x87')];break;case _0x4b1f('0x88'):_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x82')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27['body'][_0x4b1f('0x89')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')]['MessageUUID'];break;case _0x4b1f('0x8a'):_0x984824['body'][_0x4b1f('0x81')]='+'+_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x8b')][0x0]['from'];_0x984824[_0x4b1f('0x65')]['body']=_0x1bca27['body']['results'][0x0]['text'];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x8b')][0x0][_0x4b1f('0x83')];break;case _0x4b1f('0x8c'):_0x984824['body'][_0x4b1f('0x81')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x8d')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27[_0x4b1f('0x65')]['segmentedMessage']['message'];break;case'clickatell':_0x984824['body']['from']=_0x1bca27[_0x4b1f('0x65')]['fromNumber'];_0x984824[_0x4b1f('0x65')]['body']=_0x1bca27['body'][_0x4b1f('0x86')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x8e')];break;case _0x4b1f('0x8f'):_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')][0x0][_0x4b1f('0x28')]['id'];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')]=_0x1bca27[_0x4b1f('0x65')][0x0][_0x4b1f('0x28')][_0x4b1f('0x81')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27[_0x4b1f('0x65')][0x0]['message'][_0x4b1f('0x86')];break;case _0x4b1f('0x90'):_0x984824['body'][_0x4b1f('0x81')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x81')];_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]=_0x1bca27['body'][_0x4b1f('0x28')];_0x984824['body'][_0x4b1f('0x83')]=_0x1bca27[_0x4b1f('0x65')][_0x4b1f('0x91')];break;}}if(_0x984824['body']['id']){delete _0x984824[_0x4b1f('0x65')]['id'];}if(_[_0x4b1f('0x92')](_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')])){throw new db[(_0x4b1f('0x78'))][(_0x4b1f('0x79'))](_0x4b1f('0x93'));}if(_[_0x4b1f('0x92')](_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')])||_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')]===''){throw new db[(_0x4b1f('0x78'))][(_0x4b1f('0x79'))](_0x4b1f('0x94'));}if(_[_0x4b1f('0x92')](_0x984824[_0x4b1f('0x65')][_0x4b1f('0x95')])){throw new db[(_0x4b1f('0x78'))][(_0x4b1f('0x79'))](_0x4b1f('0x96')+_0xcaf4d5);}if(!_[_0x4b1f('0x97')](_0xcaf4d5,_0x984824[_0x4b1f('0x65')][_0x4b1f('0x95')])){throw new db[(_0x4b1f('0x78'))]['ValidationError'](_0x4b1f('0x98')+_0xcaf4d5);}_0x1ddcdb[_0x984824[_0x4b1f('0x65')]['mapKey']]=_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')];return db['CmList'][_0x4b1f('0x59')]({'where':{'id':_0x984824['account'][_0x4b1f('0x7f')]},'include':[{'model':db[_0x4b1f('0x77')],'as':_0x4b1f('0x99'),'where':_0x1ddcdb,'limit':0x1,'order':[[_0x4b1f('0x7c'),_0x4b1f('0x9a')]]}]});})[_0x4b1f('0x20')](handleEntityNotFound(_0x4f25c8,null))[_0x4b1f('0x20')](function(_0x58df78){if(_0x58df78){_0x984824[_0x4b1f('0x9b')]=_[_0x4b1f('0x9c')](_0x58df78,[_0x4b1f('0x99')]);if(_0x58df78[_0x4b1f('0x99')][_0x4b1f('0x49')]){return _0x58df78[_0x4b1f('0x99')][0x0];}var _0x9f5b6f=_[_0x4b1f('0x18')](_0x984824['body'],{'firstName':_0x984824['body']['from'],'ListId':_0x58df78['id']});_0x9f5b6f[_0x984824[_0x4b1f('0x65')][_0x4b1f('0x95')]]=_0x984824[_0x4b1f('0x65')][_0x4b1f('0x81')];return db[_0x4b1f('0x77')][_0x4b1f('0x5a')](_0x9f5b6f,{'fields':_0x74abe2,'raw':!![]});}})[_0x4b1f('0x20')](handleEntityNotFound(_0x4f25c8,null))['then'](function(_0x6f1d26){if(_0x6f1d26){_0x984824['contact']=_0x6f1d26;var _0x21126a={'ContactId':_0x6f1d26['id'],'phone':_0x984824['body'][_0x4b1f('0x81')],'SmsAccountId':_0x1bca27[_0x4b1f('0x58')]['id']};var _0x402ea6={'ContactId':_0x6f1d26['id'],'SmsAccountId':_0x1bca27[_0x4b1f('0x58')]['id'],'closed':![]};return db[_0x4b1f('0x9d')][_0x4b1f('0x59')]({'where':_0x402ea6})[_0x4b1f('0x20')](function(_0x2f6f62){if(_0x2f6f62){return[_0x2f6f62,![]];}return db[_0x4b1f('0x9d')][_0x4b1f('0x5a')](_0x21126a)[_0x4b1f('0x20')](function(_0x37d3dc){return[_0x37d3dc,!![]];});});}})[_0x4b1f('0x9e')](function(_0x56ad1d,_0x3db384){_0x984824[_0x4b1f('0x9f')]=_0x56ad1d[_0x4b1f('0x5c')]({'plain':!![]});_0x984824[_0x4b1f('0x9f')]['created']=![];if(_0x3db384){if(_0x984824['account'][_0x4b1f('0xa0')]){_0x984824[_0x4b1f('0x72')][_0x4b1f('0xa1')]({'id':0x0,'priority':_0x984824['applications'][_0x4b1f('0x49')]+0x1,'app':'close','appdata':_0x4b1f('0xa2'),'interval':_0x4b1f('0xa3')});}_0x984824[_0x4b1f('0x9f')][_0x4b1f('0xa4')]=!![];}return db[_0x4b1f('0xa5')][_0x4b1f('0x5a')]({'phone':_0x984824['body']['from'],'messageId':_0x984824[_0x4b1f('0x65')][_0x4b1f('0x83')],'body':_0x984824[_0x4b1f('0x65')][_0x4b1f('0x65')],'SmsAccountId':_0x1bca27[_0x4b1f('0x58')]['id'],'SmsInteractionId':_0x56ad1d['id'],'direction':'in','ContactId':_0x56ad1d[_0x4b1f('0xa6')],'AttachmentId':_0x984824[_0x4b1f('0x65')][_0x4b1f('0xa7')]});})[_0x4b1f('0x20')](function(_0x1b1699){_0x984824['message']=_0x1b1699;if(_0x984824[_0x4b1f('0x9f')][_0x4b1f('0xa8')]){return db[_0x4b1f('0xa9')][_0x4b1f('0x59')]({'attributes':['id',_0x4b1f('0x39')],'where':{'id':_0x984824[_0x4b1f('0x9f')][_0x4b1f('0xa8')]}})[_0x4b1f('0x20')](function(_0x5f3a34){if(_0x5f3a34){_0x984824[_0x4b1f('0x72')][_0x4b1f('0xaa')]({'id':0x0,'priority':0x0,'app':_0x4b1f('0xab'),'appdata':_0x5f3a34[_0x4b1f('0x39')]+','+(_0x984824[_0x4b1f('0x71')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4b1f('0xac'),_0x984824);});}return respondWithRpcPromise(_0x4b1f('0xad'),'startRouting',_0x984824);})[_0x4b1f('0x20')](function(_0x5903a8){if(_0x5903a8){var _0x14a353=0xc8;var _0x4a8e26=_0x4b1f('0xae');logger[_0x4b1f('0x21')](_0x4b1f('0x25'),_0x4a8e26,_0x14a353,_0x4b1f('0xaf'));logger[_0x4b1f('0x24')](_0x4b1f('0xb0'),_0x4a8e26,_0x14a353,_0x4b1f('0xaf'),JSON[_0x4b1f('0x26')](_0x5903a8));if(_0x984824['account'][_0x4b1f('0x41')]==='twilio'){return _0x4f25c8['status'](_0x14a353)[_0x4b1f('0xb1')]('Content-Type',_0x4b1f('0xb2'))[_0x4b1f('0x3a')](_0x4b1f('0xb3'));}else{return _0x4f25c8[_0x4b1f('0x2c')](_0x14a353)['json'](_0x5903a8);}}})[_0x4b1f('0x2a')](handleError(_0x4f25c8,null));};exports['addApplications']=function(_0x4c6cf5,_0x11571a){var _0x1018e6=_0x4c6cf5[_0x4b1f('0x58')]['id'];var _0x30878a=_0x4c6cf5[_0x4b1f('0x65')];var _0x36e680=0xc8;var _0x272743=null;return db[_0x4b1f('0xb4')][_0x4b1f('0xb5')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x4b1f('0xb6')]},function(_0x2ad28a){return db['SmsAccount']['findOne']({'where':{'id':_0x1018e6},'transaction':_0x2ad28a})[_0x4b1f('0x20')](function(_0x39eb1d){if(_0x39eb1d){return db[_0x4b1f('0x70')][_0x4b1f('0x36')]({'where':{'SmsAccountId':_0x1018e6},'transaction':_0x2ad28a})['then'](function(){var _0x4e8ee7=_[_0x4b1f('0x3d')](_0x30878a,function(_0x520cfe){_0x520cfe[_0x4b1f('0x69')]=_0x1018e6;return _0x520cfe;});return db[_0x4b1f('0x70')][_0x4b1f('0xb7')](_0x4e8ee7,{'transaction':_0x2ad28a});});}else{_0x36e680=0x194;_0x272743=[];}});})['then'](function(){if(_0x36e680!==0x194){return db[_0x4b1f('0x70')][_0x4b1f('0xb8')]({'where':{'SmsAccountId':_0x1018e6},'order':_0x4b1f('0x75')})[_0x4b1f('0x20')](function(_0x4b99b6){_0x272743=_0x4b99b6;});}})['catch'](function(_0x236907){_0x36e680=0x1f4;logger[_0x4b1f('0x27')](_0x236907[_0x4b1f('0x38')]);if(_0x236907['name']){delete _0x236907['name'];}_0x272743=_0x236907;})[_0x4b1f('0xb9')](function(){if(_0x272743===null){_0x11571a[_0x4b1f('0x2b')](_0x36e680);}else{if(_0x36e680===0x1f4){_0x11571a[_0x4b1f('0x2c')](_0x36e680)[_0x4b1f('0x3a')](_0x272743);}else{_0x11571a['status'](_0x36e680)[_0x4b1f('0x2e')](_0x272743);}}});};exports[_0x4b1f('0xba')]=function(_0x13ac08,_0x4aa6dc,_0x2f8389){var _0x4449e7={};var _0x2bba2e={};var _0x36a888;var _0x5d98ee;return db[_0x4b1f('0x3e')][_0x4b1f('0x67')]({'where':{'id':_0x13ac08[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x4aa6dc,null))[_0x4b1f('0x20')](function(_0x41505e){if(_0x41505e){_0x36a888=_0x41505e;_0x2bba2e[_0x4b1f('0x42')]=_[_0x4b1f('0x44')](db[_0x4b1f('0x70')][_0x4b1f('0x3f')]);_0x2bba2e[_0x4b1f('0x43')]=_[_0x4b1f('0x44')](_0x13ac08[_0x4b1f('0x43')]);_0x2bba2e[_0x4b1f('0x45')]=_[_0x4b1f('0x46')](_0x2bba2e[_0x4b1f('0x42')],_0x2bba2e['query']);_0x4449e7[_0x4b1f('0x48')]=_['intersection'](_0x2bba2e['model'],qs['fields'](_0x13ac08[_0x4b1f('0x43')]['fields']));_0x4449e7['attributes']=_0x4449e7[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x4449e7['attributes']:_0x2bba2e[_0x4b1f('0x42')];_0x4449e7[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x13ac08[_0x4b1f('0x43')][_0x4b1f('0x4d')]);_0x4449e7['where']=qs[_0x4b1f('0x45')](_[_0x4b1f('0x68')](_0x13ac08[_0x4b1f('0x43')],_0x2bba2e[_0x4b1f('0x45')]));if(_0x13ac08[_0x4b1f('0x43')][_0x4b1f('0x4f')]){_0x4449e7['where']=_[_0x4b1f('0x50')](_0x4449e7['where'],{'$or':_[_0x4b1f('0x3d')](_0x4449e7[_0x4b1f('0x48')],function(_0x295bfa){var _0x50110a={};_0x50110a[_0x295bfa]={'$like':'%'+_0x13ac08[_0x4b1f('0x43')]['filter']+'%'};return _0x50110a;})});}_0x4449e7=_[_0x4b1f('0x50')]({},_0x4449e7,_0x13ac08[_0x4b1f('0x52')]);return _0x36a888['getApplications'](_0x4449e7);}})[_0x4b1f('0x20')](function(_0x487b8d){if(_0x487b8d){_0x5d98ee=_0x487b8d[_0x4b1f('0x49')];if(!_0x13ac08['query']['hasOwnProperty']('nolimit')){_0x4449e7[_0x4b1f('0x31')]=qs[_0x4b1f('0x31')](_0x13ac08[_0x4b1f('0x43')][_0x4b1f('0x31')]);_0x4449e7[_0x4b1f('0x2f')]=qs['offset'](_0x13ac08[_0x4b1f('0x43')][_0x4b1f('0x2f')]);}return _0x36a888['getApplications'](_0x4449e7);}})[_0x4b1f('0x20')](function(_0xdc8d3b){if(_0xdc8d3b){return _0xdc8d3b?{'count':_0x5d98ee,'rows':_0xdc8d3b}:null;}})['then'](respondWithResult(_0x4aa6dc,null))['catch'](handleError(_0x4aa6dc,null));};exports[_0x4b1f('0xbb')]=function(_0x44a3fc,_0x513022,_0x41d790){var _0x458205={'raw':![],'where':{}};var _0x25120f={};var _0x96a7bc={'count':0x0,'rows':[]};return db[_0x4b1f('0x3e')][_0x4b1f('0x67')]({'where':{'id':_0x44a3fc[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x513022,null))['then'](function(_0x3c9a22){if(_0x3c9a22){_0x25120f[_0x4b1f('0x42')]=_['keys'](db[_0x4b1f('0x9d')]['rawAttributes']);_0x25120f['query']=_[_0x4b1f('0x44')](_0x44a3fc['query']);_0x25120f[_0x4b1f('0x45')]=_[_0x4b1f('0x46')](_0x25120f[_0x4b1f('0x42')],_0x25120f[_0x4b1f('0x43')]);_0x458205[_0x4b1f('0x48')]=_['intersection'](_0x25120f['model'],qs[_0x4b1f('0x47')](_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x47')]));_0x458205['attributes']=_0x458205[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x458205[_0x4b1f('0x48')]:_0x25120f[_0x4b1f('0x42')];if(!_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x4a')](_0x4b1f('0x4b'))){_0x458205['limit']=qs[_0x4b1f('0x31')](_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x31')]);_0x458205[_0x4b1f('0x2f')]=qs[_0x4b1f('0x2f')](_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x2f')]);}_0x458205[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x4d')]);_0x458205[_0x4b1f('0x4e')]=qs['filters'](_[_0x4b1f('0x68')](_0x44a3fc[_0x4b1f('0x43')],_0x25120f['filters']));_0x458205[_0x4b1f('0x4e')][_0x4b1f('0x69')]=_0x3c9a22['id'];if(_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x4f')]){_0x458205[_0x4b1f('0x4e')]=_[_0x4b1f('0x50')](_0x458205[_0x4b1f('0x4e')],{'$or':_[_0x4b1f('0x3d')](_0x458205[_0x4b1f('0x48')],function(_0x29291a){var _0x3bb5d9={};_0x3bb5d9[_0x29291a]={'$like':'%'+_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x4f')]+'%'};return _0x3bb5d9;})});}_0x458205=_[_0x4b1f('0x50')]({},_0x458205,_0x44a3fc[_0x4b1f('0x52')]);return db[_0x4b1f('0x9d')][_0x4b1f('0x32')]({'where':_0x458205['where']})[_0x4b1f('0x20')](function(_0x4d3e54){_0x96a7bc['count']=_0x4d3e54;if(_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0x53')]){_0x458205[_0x4b1f('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4b1f('0xa9')],'as':_0x4b1f('0xbc'),'attributes':[_0x4b1f('0x39'),_0x4b1f('0xbd'),_0x4b1f('0xbe')],'required':![]},{'model':db[_0x4b1f('0xbf')],'as':_0x4b1f('0xc0'),'attributes':['id',_0x4b1f('0x39'),_0x4b1f('0xc1')],'where':_0x44a3fc['query'][_0x4b1f('0xc2')]?{'id':_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0xc2')]}:undefined,'required':_0x44a3fc[_0x4b1f('0x43')][_0x4b1f('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x4b1f('0x55')](_0x458205);})[_0x4b1f('0x20')](function(_0x1cb355){_0x96a7bc[_0x4b1f('0x56')]=_0x1cb355;return _0x96a7bc;});}})[_0x4b1f('0x20')](respondWithFilteredResult(_0x513022,_0x458205))[_0x4b1f('0x2a')](handleError(_0x513022,null));};exports[_0x4b1f('0x3a')]=function(_0x4418f5,_0x33a1e8,_0x1ca202){var _0x1c6496,_0x75160,_0x157aa9;if(_[_0x4b1f('0x92')](_0x4418f5[_0x4b1f('0x65')][_0x4b1f('0x65')])||_0x4418f5['body'][_0x4b1f('0x65')]===''){throw new db['Sequelize'][(_0x4b1f('0x79'))](_0x4b1f('0x94'));}if(_[_0x4b1f('0x92')](_0x4418f5[_0x4b1f('0x65')]['to'])){throw new db['Sequelize'][(_0x4b1f('0x79'))](_0x4b1f('0xc3'));}_0x1c6496=_0x4418f5[_0x4b1f('0x65')]['to'];return db[_0x4b1f('0x3e')]['find']({'where':{'id':_0x4418f5[_0x4b1f('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x4b1f('0xc4'),'include':[{'model':db[_0x4b1f('0x77')],'as':'Contacts','where':{'mobile':_0x1c6496},'limit':0x1,'order':[[_0x4b1f('0x7c'),'DESC']]}]}]})[_0x4b1f('0x20')](handleEntityNotFound(_0x33a1e8,null))[_0x4b1f('0x20')](function(_0x30696e){if(_0x30696e&&_0x30696e[_0x4b1f('0xc4')]){_0x75160=_0x30696e[_0x4b1f('0x5c')]({'plain':!![]});if(_0x75160[_0x4b1f('0xc4')]&&_0x75160[_0x4b1f('0xc4')][_0x4b1f('0x99')][_0x4b1f('0x49')]){return _0x75160[_0x4b1f('0xc4')][_0x4b1f('0x99')][0x0];}return db[_0x4b1f('0x77')]['create'](_['defaults'](_0x4418f5[_0x4b1f('0x65')],{'firstName':_0x1c6496,'mobile':_0x1c6496,'phone':_0x1c6496,'ListId':_0x75160[_0x4b1f('0x7f')]}));}})[_0x4b1f('0x20')](handleEntityNotFound(_0x33a1e8,null))[_0x4b1f('0x20')](function(_0x13af41){if(_0x13af41){_0x157aa9=_0x13af41;return db['SmsInteraction'][_0x4b1f('0x59')]({'where':{'ContactId':_0x157aa9['id'],'closed':![],'SmsAccountId':_0x75160['id']}})[_0x4b1f('0x20')](function(_0x590ab8){if(_0x590ab8){return[_0x590ab8,![]];}return db[_0x4b1f('0x9d')][_0x4b1f('0x5a')]({'UserId':_0x4418f5[_0x4b1f('0x5b')]['id'],'ContactId':_0x157aa9['id'],'SmsAccountId':_0x75160['id'],'phone':_0x1c6496,'firstMsgDirection':_0x4b1f('0xc5'),'Messages':[_[_0x4b1f('0x50')](_0x4418f5['body'],{'read':![],'body':_0x4418f5['body'][_0x4b1f('0x65')],'phone':_0x1c6496,'SmsAccountId':_0x75160['id'],'UserId':_0x4418f5[_0x4b1f('0x5b')]['id'],'ContactId':_0x157aa9['id']})]},{'include':[{'model':db[_0x4b1f('0xa5')],'as':_0x4b1f('0xc6')}]})[_0x4b1f('0x20')](function(_0x370db2){return[_0x370db2,!![]];});});}})[_0x4b1f('0x9e')](function(_0xdbcf85,_0x258c44){if(_0x258c44){return _0xdbcf85;}return db[_0x4b1f('0xa5')]['create'](_['merge'](_0x4418f5[_0x4b1f('0x65')],{'read':![],'body':_0x4418f5[_0x4b1f('0x65')]['body'],'phone':_0x1c6496,'SmsAccountId':_0x75160['id'],'SmsInteractionId':_0xdbcf85['id'],'UserId':_0x4418f5['user']['id'],'ContactId':_0x157aa9['id']}))[_0x4b1f('0x20')](function(_0x51e29a){_0xdbcf85[_0x4b1f('0xc7')][_0x4b1f('0xc6')]=[];_0xdbcf85[_0x4b1f('0xc7')][_0x4b1f('0xc6')][_0x4b1f('0xa1')](_0x51e29a[_0x4b1f('0xc7')]);return _0xdbcf85;});})['then'](respondWithResult(_0x33a1e8,null))[_0x4b1f('0x2a')](handleError(_0x33a1e8,null));};exports[_0x4b1f('0x2c')]=function(_0x39f9dd,_0x24b854,_0x4ee2cf){if(_0x39f9dd[_0x4b1f('0x65')]['id']){delete _0x39f9dd[_0x4b1f('0x65')]['id'];}var _0x4024c6,_0x1d288c,_0x289293;return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x39f9dd[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x24b854,null))[_0x4b1f('0x20')](function(_0x42ca3){if(_0x42ca3){_0x289293=_0x42ca3;logger[_0x4b1f('0x24')](_0x4b1f('0x25'),_0x4b1f('0x2c'),_0x4b1f('0xc8'),_0x42ca3[_0x4b1f('0x41')],util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));switch(_0x42ca3[_0x4b1f('0x41')]){case _0x4b1f('0x85'):if(_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xca')]&&_0x39f9dd['body'][_0x4b1f('0x2c')]){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')]['status'];return db[_0x4b1f('0xa5')][_0x4b1f('0x59')]({'where':{'messageId':_0x39f9dd['body'][_0x4b1f('0xca')]}});}break;case _0x4b1f('0xcb'):if(_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xcc')]&&_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xcd')]){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')]['statusInt'];return db[_0x4b1f('0xa5')][_0x4b1f('0x59')]({'where':{'messageId':_0x39f9dd['body'][_0x4b1f('0xcc')]}});}break;case _0x4b1f('0xce'):if(_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x87')]&&_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xcf')]){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xcf')];return db['SmsMessage'][_0x4b1f('0x59')]({'where':{'messageId':_0x39f9dd['body']['message_id']}});}break;case _0x4b1f('0x8a'):var _0x26d146=_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x8b')][0x0];if(_0x26d146['messageId']&&_0x26d146[_0x4b1f('0x2c')][_0x4b1f('0xd0')]===_0x4b1f('0xd1')){_0x1d288c=_0x26d146[_0x4b1f('0x2c')]['groupName'];return db['SmsMessage'][_0x4b1f('0x59')]({'where':{'messageId':_0x26d146[_0x4b1f('0x83')]}});}break;case _0x4b1f('0xd2'):if(_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x83')]&&_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x2c')]){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x2c')];return db[_0x4b1f('0xa5')]['find']({'where':{'messageId':_0x39f9dd['body'][_0x4b1f('0x83')]}});}break;case'bandwidth':if(_0x39f9dd['body'][0x0][_0x4b1f('0x28')]['id']){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')][0x0][_0x4b1f('0x41')];return db[_0x4b1f('0xa5')]['find']({'where':{'messageId':_0x39f9dd['body'][0x0][_0x4b1f('0x28')]['id']}});}break;case _0x4b1f('0x90'):if(_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xd3')]&&_0x39f9dd['body']['status']){_0x1d288c=_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0x2c')];return db[_0x4b1f('0xa5')][_0x4b1f('0x59')]({'where':{'messageId':_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xd3')]}});}break;}}})[_0x4b1f('0x20')](handleEntityNotFound(_0x24b854,null))[_0x4b1f('0x20')](function(_0x338b25){if(_0x338b25){_0x4024c6=_0x338b25;switch(_0x289293[_0x4b1f('0x41')]){case'skebby':if(_0x1d288c===_0x4b1f('0xd1')){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4b1f('0x2c'),_0x4b1f('0x85'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case _0x4b1f('0xcb'):if(_0x1d288c==='1'){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger['error'](_0x4b1f('0x25'),_0x4b1f('0x2c'),_0x4b1f('0x85'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case _0x4b1f('0xce'):if(!_0x39f9dd[_0x4b1f('0x65')][_0x4b1f('0xd4')]&&_0x1d288c>=0xc8&&_0x1d288c<=0xce){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger[_0x4b1f('0x27')](_0x4b1f('0x25'),'status',_0x4b1f('0xce'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x403c73=_0x39f9dd['body']['results'][0x0];if(_0x403c73['status'][_0x4b1f('0xd0')]===_0x4b1f('0xd1')){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger[_0x4b1f('0x27')](_0x4b1f('0x25'),_0x4b1f('0x2c'),_0x4b1f('0x8a'),util['inspect'](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x1d288c==_0x4b1f('0xd5')||_0x1d288c==_0x4b1f('0xd6')){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger['error'](_0x4b1f('0x25'),_0x4b1f('0x2c'),_0x4b1f('0xd2'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case _0x4b1f('0x8f'):if(_0x1d288c=='message-delivered'){return _0x4024c6[_0x4b1f('0x35')]({'read':!![]});}else{logger[_0x4b1f('0x27')](_0x4b1f('0x25'),_0x4b1f('0x2c'),_0x4b1f('0x8f'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;case _0x4b1f('0x90'):if(_0x1d288c===_0x4b1f('0xd7')||_0x1d288c===_0x4b1f('0xd8')){return _0x4024c6['update']({'read':!![]});}else{logger[_0x4b1f('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4b1f('0x90'),util[_0x4b1f('0xc9')](_0x39f9dd[_0x4b1f('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x4024c6;}})['then'](respondWithResult(_0x24b854,null))[_0x4b1f('0x2a')](handleError(_0x24b854,null));};exports['statusGet']=function(_0x3437e1,_0xc6842b,_0x5712ef){var _0x2f820a,_0x5b4e94,_0x82b473;return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x3437e1[_0x4b1f('0x58')]['id']}})['then'](handleEntityNotFound(_0xc6842b,null))['then'](function(_0x235ba1){if(_0x235ba1){_0x82b473=_0x235ba1;logger[_0x4b1f('0x24')](_0x4b1f('0x25'),_0x4b1f('0x2c'),'received\x20delivery\x20report\x20from',_0x235ba1['type'],util['inspect'](_0x3437e1[_0x4b1f('0x43')],{'showHidden':![],'depth':null}));switch(_0x235ba1['type']){case _0x4b1f('0x8c'):if(_0x3437e1[_0x4b1f('0x43')][_0x4b1f('0xd9')]&&_0x3437e1[_0x4b1f('0x43')][_0x4b1f('0xda')]){_0x5b4e94=_0x3437e1[_0x4b1f('0x43')][_0x4b1f('0xda')];return db['SmsMessage'][_0x4b1f('0x59')]({'where':{'messageId':_0x3437e1[_0x4b1f('0x43')][_0x4b1f('0xd9')]}});}break;}}})[_0x4b1f('0x20')](handleEntityNotFound(_0xc6842b,null))['then'](function(_0x1dda9e){if(_0x1dda9e){_0x2f820a=_0x1dda9e;switch(_0x82b473[_0x4b1f('0x41')]){case _0x4b1f('0x8c'):if(_0x5b4e94==='2'||_0x5b4e94==='6'){return _0x2f820a['update']({'read':!![]});}else{logger[_0x4b1f('0x27')](_0x4b1f('0x25'),'status',_0x4b1f('0x8c'),util[_0x4b1f('0xc9')](_0x3437e1[_0x4b1f('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x2f820a;}})['then'](respondWithResult(_0xc6842b,null))[_0x4b1f('0x2a')](handleError(_0xc6842b,null));};exports[_0x4b1f('0xdb')]=function(_0x464780,_0x42c02b,_0x3930ea){return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x464780[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x42c02b,null))[_0x4b1f('0x20')](function(_0x4b1c37){if(_0x4b1c37){return _0x4b1c37[_0x4b1f('0xdb')](_0x464780['body'][_0x4b1f('0x6a')],_[_0x4b1f('0x9c')](_0x464780[_0x4b1f('0x65')],[_0x4b1f('0x6a'),'id'])||{})['spread'](function(_0x35e5ef){for(var _0x3d25d8=0x0;_0x3d25d8<_0x464780[_0x4b1f('0x65')][_0x4b1f('0x6a')][_0x4b1f('0x49')];_0x3d25d8+=0x1){socket[_0x4b1f('0xdc')](_0x4b1f('0xdd'),{'UserId':Number(_0x464780[_0x4b1f('0x65')][_0x4b1f('0x6a')][_0x3d25d8]),'SmsAccountId':Number(_0x464780[_0x4b1f('0x58')]['id'])});}return _0x35e5ef;});}})[_0x4b1f('0x20')](respondWithResult(_0x42c02b,null))[_0x4b1f('0x2a')](handleError(_0x42c02b,null));};exports[_0x4b1f('0xde')]=function(_0x2d04f9,_0x2acbe2,_0x503b86){return db[_0x4b1f('0x3e')][_0x4b1f('0x59')]({'where':{'id':_0x2d04f9[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x2acbe2,null))[_0x4b1f('0x20')](function(_0x4a1523){if(_0x4a1523){return _0x4a1523[_0x4b1f('0xde')](_0x2d04f9[_0x4b1f('0x43')][_0x4b1f('0x6a')])[_0x4b1f('0x20')](function(){if(_[_0x4b1f('0xdf')](_0x2d04f9[_0x4b1f('0x43')][_0x4b1f('0x6a')])){for(var _0x53b69d=0x0;_0x53b69d<_0x2d04f9[_0x4b1f('0x43')][_0x4b1f('0x6a')][_0x4b1f('0x49')];_0x53b69d+=0x1){socket[_0x4b1f('0xdc')](_0x4b1f('0xe0'),{'UserId':Number(_0x2d04f9[_0x4b1f('0x43')]['ids'][_0x53b69d]),'SmsAccountId':Number(_0x2d04f9[_0x4b1f('0x58')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2d04f9[_0x4b1f('0x43')]['ids']),'SmsAccountId':Number(_0x2d04f9[_0x4b1f('0x58')]['id'])});}});}})[_0x4b1f('0x20')](respondWithStatusCode(_0x2acbe2,null))[_0x4b1f('0x2a')](handleError(_0x2acbe2,null));};exports['getAgents']=function(_0x2722a2,_0x15bfbf,_0x27601c){var _0x47b084={};var _0x2a8e55={};var _0x5b1722;var _0x141a17;return db['SmsAccount'][_0x4b1f('0x67')]({'where':{'id':_0x2722a2[_0x4b1f('0x58')]['id']}})[_0x4b1f('0x20')](handleEntityNotFound(_0x15bfbf,null))[_0x4b1f('0x20')](function(_0x400859){if(_0x400859){_0x5b1722=_0x400859;_0x2a8e55[_0x4b1f('0x42')]=_[_0x4b1f('0x44')](db['User']['rawAttributes']);_0x2a8e55[_0x4b1f('0x43')]=_[_0x4b1f('0x44')](_0x2722a2[_0x4b1f('0x43')]);_0x2a8e55[_0x4b1f('0x45')]=_['intersection'](_0x2a8e55[_0x4b1f('0x42')],_0x2a8e55['query']);_0x47b084['attributes']=_[_0x4b1f('0x46')](_0x2a8e55[_0x4b1f('0x42')],qs['fields'](_0x2722a2[_0x4b1f('0x43')][_0x4b1f('0x47')]));_0x47b084[_0x4b1f('0x48')]=_0x47b084[_0x4b1f('0x48')][_0x4b1f('0x49')]?_0x47b084[_0x4b1f('0x48')]:_0x2a8e55[_0x4b1f('0x42')];_0x47b084[_0x4b1f('0x4c')]=qs[_0x4b1f('0x4d')](_0x2722a2['query'][_0x4b1f('0x4d')]);_0x47b084[_0x4b1f('0x4e')]=qs[_0x4b1f('0x45')](_[_0x4b1f('0x68')](_0x2722a2[_0x4b1f('0x43')],_0x2a8e55[_0x4b1f('0x45')]));if(_0x2722a2[_0x4b1f('0x43')][_0x4b1f('0x4f')]){_0x47b084[_0x4b1f('0x4e')]=_[_0x4b1f('0x50')](_0x47b084[_0x4b1f('0x4e')],{'$or':_['map'](_0x47b084[_0x4b1f('0x48')],function(_0x2ba595){var _0x59ba52={};_0x59ba52[_0x2ba595]={'$like':'%'+_0x2722a2[_0x4b1f('0x43')][_0x4b1f('0x4f')]+'%'};return _0x59ba52;})});}_0x47b084=_['merge']({},_0x47b084,_0x2722a2[_0x4b1f('0x52')]);return _0x5b1722[_0x4b1f('0xe1')](_0x47b084);}})[_0x4b1f('0x20')](function(_0x2521e7){if(_0x2521e7){_0x141a17=_0x2521e7[_0x4b1f('0x49')];if(!_0x2722a2['query'][_0x4b1f('0x4a')](_0x4b1f('0x4b'))){_0x47b084[_0x4b1f('0x31')]=qs['limit'](_0x2722a2['query'][_0x4b1f('0x31')]);_0x47b084[_0x4b1f('0x2f')]=qs['offset'](_0x2722a2['query'][_0x4b1f('0x2f')]);}return _0x5b1722[_0x4b1f('0xe1')](_0x47b084);}})[_0x4b1f('0x20')](function(_0x15c3fd){if(_0x15c3fd){return _0x15c3fd?{'count':_0x141a17,'rows':_0x15c3fd}:null;}})[_0x4b1f('0x20')](respondWithResult(_0x15bfbf,null))['catch'](handleError(_0x15bfbf,null));}; \ No newline at end of file +var _0xfb87=['mobile','From','Body','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','json','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','getApplications','length','Contact','Owner','fullname','internal','Tag','color','to\x20is\x20mandatory','List','user','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','status_code','DELIVERED','groupName','clickatell','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply','update','then','destroy','get','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','filter','options','include','rows','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','sms','SmsApplication','applications','priority','asc','account','Applications','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfb87,0x6d));var _0x7fb8=function(_0x154b19,_0x21e4cf){_0x154b19=_0x154b19-0x0;var _0x10f433=_0xfb87[_0x154b19];return _0x10f433;};'use strict';var emlformat=require(_0x7fb8('0x0'));var rimraf=require(_0x7fb8('0x1'));var zipdir=require(_0x7fb8('0x2'));var jsonpatch=require(_0x7fb8('0x3'));var rp=require(_0x7fb8('0x4'));var moment=require(_0x7fb8('0x5'));var BPromise=require(_0x7fb8('0x6'));var Mustache=require('mustache');var util=require(_0x7fb8('0x7'));var path=require(_0x7fb8('0x8'));var sox=require(_0x7fb8('0x9'));var csv=require(_0x7fb8('0xa'));var ejs=require(_0x7fb8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb8('0xc'));var squel=require('squel');var crypto=require(_0x7fb8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7fb8('0xe'));var Redis=require('ioredis');var authService=require(_0x7fb8('0xf'));var qs=require(_0x7fb8('0x10'));var as=require(_0x7fb8('0x11'));var hardwareService=require(_0x7fb8('0x12'));var logger=require(_0x7fb8('0x13'))('api');var utils=require(_0x7fb8('0x14'));var config=require(_0x7fb8('0x15'));var licenseUtil=require(_0x7fb8('0x16'));var db=require('../../mysqldb')['db'];config[_0x7fb8('0x17')]=_[_0x7fb8('0x18')](config[_0x7fb8('0x17')],{'host':_0x7fb8('0x19'),'port':0x18eb});var socket=require(_0x7fb8('0x1a'))(new Redis(config[_0x7fb8('0x17')]));require('./smsAccount.socket')[_0x7fb8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7fb8('0x1c')][_0x7fb8('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x55b3d7,_0x4f3dd8,_0x53fc92,_0x10dde9){return new BPromise(function(_0x18fe47,_0x1261c3){var _0x5e5eed=_0x10dde9||client;return _0x5e5eed[_0x7fb8('0x1e')](_0x55b3d7,_0x53fc92)['then'](function(_0x391e10){logger[_0x7fb8('0x1f')](_0x7fb8('0x20'),_0x4f3dd8,_0x7fb8('0x21'));logger['debug'](_0x7fb8('0x22'),_0x4f3dd8,_0x7fb8('0x21'),JSON[_0x7fb8('0x23')](_0x391e10));if(_0x391e10['error']){if(_0x391e10[_0x7fb8('0x24')]['code']===0x1f4){logger['error'](_0x7fb8('0x20'),_0x4f3dd8,_0x391e10[_0x7fb8('0x24')][_0x7fb8('0x25')]);return _0x1261c3(_0x391e10[_0x7fb8('0x24')][_0x7fb8('0x25')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4f3dd8,_0x391e10['error'][_0x7fb8('0x25')]);return _0x18fe47(_0x391e10[_0x7fb8('0x24')]['message']);}else{logger[_0x7fb8('0x1f')](_0x7fb8('0x20'),_0x4f3dd8,_0x7fb8('0x21'));_0x18fe47(_0x391e10[_0x7fb8('0x26')][_0x7fb8('0x25')]);}})[_0x7fb8('0x27')](function(_0x3294d2){logger[_0x7fb8('0x24')](_0x7fb8('0x20'),_0x4f3dd8,_0x3294d2);_0x1261c3(_0x3294d2);});});}function respondWithStatusCode(_0x45290e,_0x1dc05a){_0x1dc05a=_0x1dc05a||0xcc;return function(_0x36ed49){if(_0x36ed49){return _0x45290e[_0x7fb8('0x28')](_0x1dc05a);}return _0x45290e[_0x7fb8('0x29')](_0x1dc05a)[_0x7fb8('0x2a')]();};}function respondWithResult(_0x5a462f,_0x1e2a9b){_0x1e2a9b=_0x1e2a9b||0xc8;return function(_0x237ffc){if(_0x237ffc){return _0x5a462f[_0x7fb8('0x29')](_0x1e2a9b)['json'](_0x237ffc);}};}function respondWithFilteredResult(_0x574a68,_0x34ecad){return function(_0x40ddaa){if(_0x40ddaa){var _0x200b86=typeof _0x34ecad[_0x7fb8('0x2b')]==='undefined'&&typeof _0x34ecad[_0x7fb8('0x2c')]===_0x7fb8('0x2d');var _0x1f3ede=_0x40ddaa[_0x7fb8('0x2e')];var _0x2ee0c9=_0x200b86?0x0:_0x34ecad[_0x7fb8('0x2b')];var _0x410388=_0x200b86?_0x40ddaa['count']:_0x34ecad[_0x7fb8('0x2b')]+_0x34ecad['limit'];var _0xeca158;if(_0x410388>=_0x1f3ede){_0x410388=_0x1f3ede;_0xeca158=0xc8;}else{_0xeca158=0xce;}_0x574a68[_0x7fb8('0x29')](_0xeca158);return _0x574a68[_0x7fb8('0x2f')]('Content-Range',_0x2ee0c9+'-'+_0x410388+'/'+_0x1f3ede)['json'](_0x40ddaa);}return null;};}function patchUpdates(_0x419f51){return function(_0x16dead){try{jsonpatch[_0x7fb8('0x30')](_0x16dead,_0x419f51,!![]);}catch(_0x788991){return BPromise['reject'](_0x788991);}return _0x16dead['save']();};}function saveUpdates(_0x27aad3,_0x171318){return function(_0x49dfe3){if(_0x49dfe3){return _0x49dfe3[_0x7fb8('0x31')](_0x27aad3)[_0x7fb8('0x32')](function(_0x2c1549){return _0x2c1549;});}return null;};}function removeEntity(_0x51e1ad,_0xa411ed){return function(_0x3a320c){if(_0x3a320c){return _0x3a320c[_0x7fb8('0x33')]()[_0x7fb8('0x32')](function(){var _0x3c02fb=_0x3a320c[_0x7fb8('0x34')]({'plain':!![]});var _0x418d5f='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x418d5f,'resourceId':_0x3c02fb['id']}})[_0x7fb8('0x32')](function(){return _0x3a320c;});})[_0x7fb8('0x32')](function(){_0x51e1ad[_0x7fb8('0x29')](0xcc)[_0x7fb8('0x2a')]();});}};}function handleEntityNotFound(_0x2b2925,_0x2c5b38){return function(_0x45ef42){if(!_0x45ef42){_0x2b2925[_0x7fb8('0x28')](0x194);}return _0x45ef42;};}function handleError(_0x115d9e,_0x2f75cb){_0x2f75cb=_0x2f75cb||0x1f4;return function(_0x5c9674){logger[_0x7fb8('0x24')](_0x5c9674['stack']);if(_0x5c9674[_0x7fb8('0x35')]){delete _0x5c9674[_0x7fb8('0x35')];}_0x115d9e[_0x7fb8('0x29')](_0x2f75cb)['send'](_0x5c9674);};}exports[_0x7fb8('0x36')]=function(_0x3e8f67,_0xf3d579){var _0x3019df={'include':[{'model':db[_0x7fb8('0x37')],'as':_0x7fb8('0x38')}]},_0x5d39f1={},_0x128e26={'count':0x0,'rows':[]};var _0x8d8c76=_['map'](db[_0x7fb8('0x39')][_0x7fb8('0x3a')],function(_0x3bdd02){return{'name':_0x3bdd02[_0x7fb8('0x3b')],'type':_0x3bdd02[_0x7fb8('0x3c')][_0x7fb8('0x3d')]};});_0x5d39f1[_0x7fb8('0x3e')]=_[_0x7fb8('0x3f')](_0x8d8c76,_0x7fb8('0x35'));_0x5d39f1[_0x7fb8('0x40')]=_['keys'](_0x3e8f67['query']);_0x5d39f1[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x5d39f1[_0x7fb8('0x3e')],_0x5d39f1['query']);_0x3019df[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x5d39f1['model'],qs[_0x7fb8('0x44')](_0x3e8f67['query']['fields']));_0x3019df['attributes']=_0x3019df[_0x7fb8('0x43')]['length']?_0x3019df[_0x7fb8('0x43')]:_0x5d39f1[_0x7fb8('0x3e')];if(!_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x45')]('nolimit')){_0x3019df[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x3019df[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x3019df[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x3e8f67['query']['sort']);_0x3019df['where']=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x3e8f67[_0x7fb8('0x40')],_0x5d39f1[_0x7fb8('0x41')]),_0x8d8c76);if(_0x3e8f67[_0x7fb8('0x40')]['filter']){_0x3019df[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x3019df[_0x7fb8('0x49')],{'$or':_[_0x7fb8('0x3f')](_0x8d8c76,function(_0x2ca264){if(_0x2ca264[_0x7fb8('0x3c')]!=='VIRTUAL'){var _0x4bd686={};_0x4bd686[_0x2ca264[_0x7fb8('0x35')]]={'$like':'%'+_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x4bd686;}})});}_0x3019df=_[_0x7fb8('0x4a')]({},_0x3019df,_0x3e8f67[_0x7fb8('0x4c')]);var _0x43b3ef={'where':_0x3019df[_0x7fb8('0x49')]};return db[_0x7fb8('0x39')]['count'](_0x43b3ef)[_0x7fb8('0x32')](function(_0x1b0b27){_0x128e26[_0x7fb8('0x2e')]=_0x1b0b27;if(_0x3e8f67[_0x7fb8('0x40')]['includeAll']){_0x3019df[_0x7fb8('0x4d')]=[{'all':!![]}];}return db[_0x7fb8('0x39')]['findAll'](_0x3019df);})[_0x7fb8('0x32')](function(_0xc3df65){_0x128e26[_0x7fb8('0x4e')]=_0xc3df65;return _0x128e26;})[_0x7fb8('0x32')](respondWithFilteredResult(_0xf3d579,_0x3019df))[_0x7fb8('0x27')](handleError(_0xf3d579,null));};exports['show']=function(_0x8c7ff7,_0x3791e5){var _0x4efc5={'raw':![],'where':{'id':_0x8c7ff7['params']['id']},'include':[{'model':db[_0x7fb8('0x37')],'as':_0x7fb8('0x38')}]},_0x5b3ee7={};_0x5b3ee7[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db[_0x7fb8('0x39')][_0x7fb8('0x3a')]);_0x5b3ee7[_0x7fb8('0x40')]=_[_0x7fb8('0x4f')](_0x8c7ff7[_0x7fb8('0x40')]);_0x5b3ee7[_0x7fb8('0x41')]=_['intersection'](_0x5b3ee7[_0x7fb8('0x3e')],_0x5b3ee7[_0x7fb8('0x40')]);_0x4efc5[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x5b3ee7[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x8c7ff7['query'][_0x7fb8('0x44')]));_0x4efc5[_0x7fb8('0x43')]=_0x4efc5[_0x7fb8('0x43')]['length']?_0x4efc5[_0x7fb8('0x43')]:_0x5b3ee7[_0x7fb8('0x3e')];if(_0x8c7ff7[_0x7fb8('0x40')][_0x7fb8('0x50')]){_0x4efc5[_0x7fb8('0x4d')]=[{'all':!![]}];}_0x4efc5=_[_0x7fb8('0x4a')]({},_0x4efc5,_0x8c7ff7[_0x7fb8('0x4c')]);return db[_0x7fb8('0x39')][_0x7fb8('0x51')](_0x4efc5)[_0x7fb8('0x32')](handleEntityNotFound(_0x3791e5,null))[_0x7fb8('0x32')](respondWithResult(_0x3791e5,null))[_0x7fb8('0x27')](handleError(_0x3791e5,null));};exports[_0x7fb8('0x52')]=function(_0x2c4e1d,_0x8b9eec){return db[_0x7fb8('0x39')]['create'](_0x2c4e1d[_0x7fb8('0x53')],{})[_0x7fb8('0x32')](function(_0x1f639f){var _0x30c702=_0x2c4e1d['user'][_0x7fb8('0x34')]({'plain':!![]});if(!_0x30c702)throw new Error(_0x7fb8('0x54'));if(_0x30c702['role']==='user'){var _0x64d8dc=_0x1f639f['get']({'plain':!![]});var _0x3d1942=_0x7fb8('0x55');return db['UserProfileSection'][_0x7fb8('0x51')]({'where':{'name':_0x3d1942,'userProfileId':_0x30c702[_0x7fb8('0x56')]},'raw':!![]})['then'](function(_0x5186ae){if(_0x5186ae&&_0x5186ae[_0x7fb8('0x57')]===0x0){return db[_0x7fb8('0x58')]['create']({'name':_0x64d8dc[_0x7fb8('0x35')],'resourceId':_0x64d8dc['id'],'type':_0x5186ae['name'],'sectionId':_0x5186ae['id']},{})[_0x7fb8('0x32')](function(){return _0x1f639f;});}else{return _0x1f639f;}})[_0x7fb8('0x27')](function(_0x36b1a5){logger['error'](_0x7fb8('0x59'),_0x36b1a5);throw _0x36b1a5;});}return _0x1f639f;})[_0x7fb8('0x32')](respondWithResult(_0x8b9eec,0xc9))[_0x7fb8('0x27')](handleError(_0x8b9eec,null));};exports['update']=function(_0x58e0c8,_0x11918b){if(_0x58e0c8[_0x7fb8('0x53')]['id']){delete _0x58e0c8[_0x7fb8('0x53')]['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x58e0c8[_0x7fb8('0x5a')]['id']},'include':[{'model':db[_0x7fb8('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x11918b,null))[_0x7fb8('0x32')](saveUpdates(_0x58e0c8[_0x7fb8('0x53')],null))[_0x7fb8('0x32')](respondWithResult(_0x11918b,null))['catch'](handleError(_0x11918b,null));};exports[_0x7fb8('0x33')]=function(_0x8ad055,_0x2aa0e4){return db[_0x7fb8('0x39')]['find']({'where':{'id':_0x8ad055['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x2aa0e4,null))['then'](removeEntity(_0x2aa0e4,null))[_0x7fb8('0x27')](handleError(_0x2aa0e4,null));};exports[_0x7fb8('0x5b')]=function(_0x307dd9,_0x1246ac){return db['SmsAccount']['describe']()[_0x7fb8('0x32')](respondWithResult(_0x1246ac,null))['catch'](handleError(_0x1246ac,null));};exports[_0x7fb8('0x5c')]=function(_0x183df4,_0x4caa1b,_0x2e9e10){if(_0x183df4[_0x7fb8('0x53')]['id']){delete _0x183df4['body']['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x183df4[_0x7fb8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4caa1b,null))['then'](function(_0x3527f8){if(_0x3527f8){_0x183df4[_0x7fb8('0x53')][_0x7fb8('0x5d')]=_0x3527f8['id'];return db[_0x7fb8('0x5e')]['create'](_0x183df4[_0x7fb8('0x53')]);}})[_0x7fb8('0x32')](respondWithResult(_0x4caa1b,null))[_0x7fb8('0x27')](handleError(_0x4caa1b,null));};exports[_0x7fb8('0x5f')]=function(_0x5e01a1,_0x491249,_0xef20d3){var _0x24e86d={'raw':![],'where':{}};var _0x3c958c={};var _0x5c682f={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')]['findOne']({'where':{'id':_0x5e01a1['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x491249,null))[_0x7fb8('0x32')](function(_0x113d72){if(_0x113d72){_0x3c958c['model']=_[_0x7fb8('0x4f')](db[_0x7fb8('0x5e')][_0x7fb8('0x3a')]);_0x3c958c[_0x7fb8('0x40')]=_[_0x7fb8('0x4f')](_0x5e01a1[_0x7fb8('0x40')]);_0x3c958c['filters']=_['intersection'](_0x3c958c['model'],_0x3c958c[_0x7fb8('0x40')]);_0x24e86d[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x3c958c[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x24e86d[_0x7fb8('0x43')]=_0x24e86d['attributes']['length']?_0x24e86d[_0x7fb8('0x43')]:_0x3c958c[_0x7fb8('0x3e')];if(!_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x24e86d[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x24e86d[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x24e86d[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x5e01a1[_0x7fb8('0x40')]['sort']);_0x24e86d[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x5e01a1[_0x7fb8('0x40')],_0x3c958c[_0x7fb8('0x41')]));_0x24e86d[_0x7fb8('0x49')]['SmsAccountId']=_0x113d72['id'];if(_0x5e01a1['query'][_0x7fb8('0x4b')]){_0x24e86d[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x24e86d[_0x7fb8('0x49')],{'$or':_[_0x7fb8('0x3f')](_0x24e86d[_0x7fb8('0x43')],function(_0x28ad30){var _0x54335b={};_0x54335b[_0x28ad30]={'$like':'%'+_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x54335b;})});}_0x24e86d=_[_0x7fb8('0x4a')]({},_0x24e86d,_0x5e01a1[_0x7fb8('0x4c')]);return db[_0x7fb8('0x5e')][_0x7fb8('0x2e')]({'where':_0x24e86d['where']})['then'](function(_0x58c99d){_0x5c682f['count']=_0x58c99d;if(_0x5e01a1['query'][_0x7fb8('0x50')]){_0x24e86d[_0x7fb8('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x7fb8('0x61')](_0x24e86d);})[_0x7fb8('0x32')](function(_0x352106){_0x5c682f[_0x7fb8('0x4e')]=_0x352106;return _0x5c682f;});}})['then'](respondWithFilteredResult(_0x491249,_0x24e86d))['catch'](handleError(_0x491249,null));};exports[_0x7fb8('0x62')]=function(_0x17105a,_0x1cde8d,_0x990020){return db['SmsAccount'][_0x7fb8('0x51')]({'where':{'id':_0x17105a[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x1cde8d,null))[_0x7fb8('0x32')](function(_0x3569e0){if(_0x3569e0){return _0x3569e0[_0x7fb8('0x62')](_0x17105a[_0x7fb8('0x40')][_0x7fb8('0x63')]);}})[_0x7fb8('0x32')](respondWithStatusCode(_0x1cde8d,null))[_0x7fb8('0x27')](handleError(_0x1cde8d,null));};exports[_0x7fb8('0x64')]=function(_0x5a25cd,_0x1fe493,_0x30a7c3){if(_0x5a25cd['body']['id']){delete _0x5a25cd[_0x7fb8('0x53')]['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x5a25cd['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x1fe493,null))[_0x7fb8('0x32')](function(_0x3bfb72){if(_0x3bfb72){_0x5a25cd[_0x7fb8('0x53')]['SmsAccountId']=_0x3bfb72['id'];return db[_0x7fb8('0x65')][_0x7fb8('0x52')](_0x5a25cd[_0x7fb8('0x53')]);}})[_0x7fb8('0x32')](respondWithResult(_0x1fe493,null))['catch'](handleError(_0x1fe493,null));};exports['getAnswers']=function(_0x57b180,_0x2c6c96,_0x39bde2){var _0x332eb4={'raw':![],'where':{}};var _0x53d3da={};var _0x309d73={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x57b180[_0x7fb8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c6c96,null))[_0x7fb8('0x32')](function(_0x1501e2){if(_0x1501e2){_0x53d3da[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db['CannedAnswer'][_0x7fb8('0x3a')]);_0x53d3da['query']=_['keys'](_0x57b180[_0x7fb8('0x40')]);_0x53d3da[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x53d3da['model'],_0x53d3da[_0x7fb8('0x40')]);_0x332eb4[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x53d3da[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x57b180['query']['fields']));_0x332eb4[_0x7fb8('0x43')]=_0x332eb4[_0x7fb8('0x43')]['length']?_0x332eb4[_0x7fb8('0x43')]:_0x53d3da[_0x7fb8('0x3e')];if(!_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x45')]('nolimit')){_0x332eb4[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x57b180['query']['limit']);_0x332eb4['offset']=qs['offset'](_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x332eb4[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x332eb4[_0x7fb8('0x49')]=qs['filters'](_['pick'](_0x57b180[_0x7fb8('0x40')],_0x53d3da[_0x7fb8('0x41')]));_0x332eb4[_0x7fb8('0x49')][_0x7fb8('0x5d')]=_0x1501e2['id'];if(_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x4b')]){_0x332eb4[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x332eb4[_0x7fb8('0x49')],{'$or':_['map'](_0x332eb4['attributes'],function(_0x1ae349){var _0x125211={};_0x125211[_0x1ae349]={'$like':'%'+_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x125211;})});}_0x332eb4=_[_0x7fb8('0x4a')]({},_0x332eb4,_0x57b180[_0x7fb8('0x4c')]);return db[_0x7fb8('0x65')][_0x7fb8('0x2e')]({'where':_0x332eb4['where']})[_0x7fb8('0x32')](function(_0xe63bbf){_0x309d73['count']=_0xe63bbf;if(_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x50')]){_0x332eb4[_0x7fb8('0x4d')]=[{'all':!![]}];}return db[_0x7fb8('0x65')][_0x7fb8('0x61')](_0x332eb4);})[_0x7fb8('0x32')](function(_0x5aa042){_0x309d73[_0x7fb8('0x4e')]=_0x5aa042;return _0x309d73;});}})[_0x7fb8('0x32')](respondWithFilteredResult(_0x2c6c96,_0x332eb4))['catch'](handleError(_0x2c6c96,null));};exports['removeAnswers']=function(_0x478a2f,_0x292f53,_0x17b6ef){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x478a2f[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x292f53,null))[_0x7fb8('0x32')](function(_0x44c30e){if(_0x44c30e){return _0x44c30e[_0x7fb8('0x67')](_0x478a2f[_0x7fb8('0x40')][_0x7fb8('0x63')]);}})[_0x7fb8('0x32')](respondWithStatusCode(_0x292f53,null))[_0x7fb8('0x27')](handleError(_0x292f53,null));};exports[_0x7fb8('0x68')]=function(_0x19ac4e,_0x4c831f,_0x43f2f){var _0x5b3d8d={'channel':_0x7fb8('0x69')};var _0x1f2cc0=[];var _0x21cc7a=[];var _0x2b1793={};return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x19ac4e['params']['id']},'include':[{'model':db[_0x7fb8('0x6a')],'as':'Applications'}]})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))[_0x7fb8('0x32')](function(_0x15f32e){_0x5b3d8d['account']=_0x15f32e;_0x5b3d8d[_0x7fb8('0x6b')]=_['orderBy'](_0x15f32e['Applications'],[_0x7fb8('0x6c')],[_0x7fb8('0x6d')]);if(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x6f')]){delete _0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x6f')];}return db[_0x7fb8('0x70')]['describe']();})[_0x7fb8('0x32')](function(_0x807519){if(!_0x807519){throw new db['Sequelize'][(_0x7fb8('0x71'))](_0x7fb8('0x72'));}_0x1f2cc0=_['difference'](_[_0x7fb8('0x4f')](_0x807519),[_0x7fb8('0x73'),_0x7fb8('0x74')]);_0x21cc7a=_[_0x7fb8('0x75')](_[_0x7fb8('0x4f')](_0x807519),['createdAt',_0x7fb8('0x74'),_0x7fb8('0x76'),_0x7fb8('0x77')]);_0x5b3d8d[_0x7fb8('0x53')]={'mapKey':_0x7fb8('0x78')};if(_0x5b3d8d['account'][_0x7fb8('0x3c')]){switch(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x3c')]){case'twilio':_0x5b3d8d['body']['from']=_0x19ac4e['body'][_0x7fb8('0x79')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7a')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7c')];break;case _0x7fb8('0x7d'):_0x5b3d8d[_0x7fb8('0x53')]['from']='+'+_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7e')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e['body'][_0x7fb8('0x7f')];break;case _0x7fb8('0x80'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body']['from'];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x25')];break;case _0x7fb8('0x82'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body'][_0x7fb8('0x81')];_0x5b3d8d[_0x7fb8('0x53')]['body']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x53')];_0x5b3d8d['body']['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x83')];break;case _0x7fb8('0x84'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x79')];_0x5b3d8d[_0x7fb8('0x53')]['body']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x85')];_0x5b3d8d[_0x7fb8('0x53')]['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x86')];break;case _0x7fb8('0x87'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]='+'+_0x19ac4e['body'][_0x7fb8('0x88')][0x0]['from'];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0][_0x7fb8('0x7f')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0][_0x7fb8('0x7b')];break;case _0x7fb8('0x89'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body'][_0x7fb8('0x8a')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8b')][_0x7fb8('0x25')];break;case'clickatell':_0x5b3d8d[_0x7fb8('0x53')]['from']=_0x19ac4e['body'][_0x7fb8('0x8c')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e['body'][_0x7fb8('0x7f')];_0x5b3d8d['body'][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8d')];break;case _0x7fb8('0x8e'):_0x5b3d8d['body']['messageId']=_0x19ac4e[_0x7fb8('0x53')][0x0][_0x7fb8('0x25')]['id'];_0x5b3d8d[_0x7fb8('0x53')]['from']=_0x19ac4e[_0x7fb8('0x53')][0x0]['message'][_0x7fb8('0x81')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e['body'][0x0][_0x7fb8('0x25')]['text'];break;case'intelepeer':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x81')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x25')];_0x5b3d8d[_0x7fb8('0x53')]['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8f')];break;}}if(_0x5b3d8d[_0x7fb8('0x53')]['id']){delete _0x5b3d8d[_0x7fb8('0x53')]['id'];}if(_[_0x7fb8('0x90')](_0x5b3d8d['body'][_0x7fb8('0x81')])){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x92'));}if(_[_0x7fb8('0x90')](_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')])||_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]===''){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x93'));}if(_[_0x7fb8('0x90')](_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')])){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x95')+_0x21cc7a);}if(!_[_0x7fb8('0x96')](_0x21cc7a,_0x5b3d8d['body'][_0x7fb8('0x94')])){throw new db[(_0x7fb8('0x91'))]['ValidationError'](_0x7fb8('0x97')+_0x21cc7a);}_0x2b1793[_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')]]=_0x5b3d8d[_0x7fb8('0x53')]['from'];return db[_0x7fb8('0x98')]['find']({'where':{'id':_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x77')]},'include':[{'model':db[_0x7fb8('0x70')],'as':'Contacts','where':_0x2b1793,'limit':0x1,'order':[[_0x7fb8('0x74'),_0x7fb8('0x99')]]}]});})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))['then'](function(_0x760b2e){if(_0x760b2e){_0x5b3d8d[_0x7fb8('0x9a')]=_[_0x7fb8('0x9b')](_0x760b2e,['Contacts']);if(_0x760b2e[_0x7fb8('0x9c')]['length']){return _0x760b2e[_0x7fb8('0x9c')][0x0];}var _0x42b578=_[_0x7fb8('0x18')](_0x5b3d8d['body'],{'firstName':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')],'ListId':_0x760b2e['id']});_0x42b578[_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')]]=_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')];return db['CmContact'][_0x7fb8('0x52')](_0x42b578,{'fields':_0x1f2cc0,'raw':!![]});}})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))[_0x7fb8('0x32')](function(_0x16d079){if(_0x16d079){_0x5b3d8d[_0x7fb8('0x9d')]=_0x16d079;var _0x4f4a96={'ContactId':_0x16d079['id'],'phone':_0x5b3d8d[_0x7fb8('0x53')]['from'],'SmsAccountId':_0x19ac4e[_0x7fb8('0x5a')]['id']};var _0x14db54={'ContactId':_0x16d079['id'],'SmsAccountId':_0x19ac4e['params']['id'],'closed':![]};return db[_0x7fb8('0x9e')][_0x7fb8('0x51')]({'where':_0x14db54})['then'](function(_0x10b926){if(_0x10b926){return[_0x10b926,![]];}return db['SmsInteraction'][_0x7fb8('0x52')](_0x4f4a96)['then'](function(_0x1faa08){return[_0x1faa08,!![]];});});}})[_0x7fb8('0x9f')](function(_0x320d5d,_0x523e99){_0x5b3d8d[_0x7fb8('0xa0')]=_0x320d5d[_0x7fb8('0x34')]({'plain':!![]});_0x5b3d8d[_0x7fb8('0xa0')][_0x7fb8('0xa1')]=![];if(_0x523e99){if(_0x5b3d8d['account'][_0x7fb8('0xa2')]){_0x5b3d8d[_0x7fb8('0x6b')][_0x7fb8('0xa3')]({'id':0x0,'priority':_0x5b3d8d[_0x7fb8('0x6b')]['length']+0x1,'app':_0x7fb8('0xa4'),'appdata':'unmanaged','interval':_0x7fb8('0xa5')});}_0x5b3d8d['interaction']['created']=!![];}return db[_0x7fb8('0xa6')]['create']({'phone':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')],'messageId':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')],'body':_0x5b3d8d[_0x7fb8('0x53')]['body'],'SmsAccountId':_0x19ac4e[_0x7fb8('0x5a')]['id'],'SmsInteractionId':_0x320d5d['id'],'direction':'in','ContactId':_0x320d5d['ContactId'],'AttachmentId':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0xa7')]});})[_0x7fb8('0x32')](function(_0xedf7bc){_0x5b3d8d['message']=_0xedf7bc;if(_0x5b3d8d[_0x7fb8('0xa0')]['UserId']){return db[_0x7fb8('0xa8')][_0x7fb8('0x51')]({'attributes':['id','name'],'where':{'id':_0x5b3d8d[_0x7fb8('0xa0')][_0x7fb8('0xa9')]}})[_0x7fb8('0x32')](function(_0x501587){if(_0x501587){_0x5b3d8d[_0x7fb8('0x6b')][_0x7fb8('0xaa')]({'id':0x0,'priority':0x0,'app':_0x7fb8('0xab'),'appdata':_0x501587[_0x7fb8('0x35')]+','+(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0xac')]||0xa),'interval':_0x7fb8('0xa5')});}return respondWithRpcPromise(_0x7fb8('0xad'),'startRouting',_0x5b3d8d);});}return respondWithRpcPromise(_0x7fb8('0xad'),_0x7fb8('0xae'),_0x5b3d8d);})[_0x7fb8('0x32')](function(_0x5b6f41){if(_0x5b6f41){var _0x52410c=0xc8;var _0xda316='receiveMessage';logger[_0x7fb8('0x1f')](_0x7fb8('0x22'),_0xda316,_0x52410c,'entity\x20found');logger[_0x7fb8('0xaf')](_0x7fb8('0xb0'),_0xda316,_0x52410c,'entity\x20found',JSON[_0x7fb8('0x23')](_0x5b6f41));if(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x3c')]===_0x7fb8('0xb1')){return _0x4c831f['status'](_0x52410c)['set'](_0x7fb8('0xb2'),_0x7fb8('0xb3'))[_0x7fb8('0xb4')]('\x0a');}else{return _0x4c831f[_0x7fb8('0x29')](_0x52410c)[_0x7fb8('0xb5')](_0x5b6f41);}}})[_0x7fb8('0x27')](handleError(_0x4c831f,null));};exports[_0x7fb8('0xb6')]=function(_0x12e039,_0x509c79){var _0x586381=_0x12e039[_0x7fb8('0x5a')]['id'];var _0xeadfa5=_0x12e039[_0x7fb8('0x53')];var _0x5b9a20=0xc8;var _0x56ded2=null;return db[_0x7fb8('0xb7')][_0x7fb8('0xb8')]({'isolationLevel':db[_0x7fb8('0xb7')][_0x7fb8('0xb9')][_0x7fb8('0xba')][_0x7fb8('0xbb')]},function(_0x466fed){return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x586381},'transaction':_0x466fed})[_0x7fb8('0x32')](function(_0x50c93f){if(_0x50c93f){return db[_0x7fb8('0x6a')]['destroy']({'where':{'SmsAccountId':_0x586381},'transaction':_0x466fed})[_0x7fb8('0x32')](function(){var _0x157159=_[_0x7fb8('0x3f')](_0xeadfa5,function(_0x336b89){_0x336b89[_0x7fb8('0x5d')]=_0x586381;return _0x336b89;});return db[_0x7fb8('0x6a')][_0x7fb8('0xbc')](_0x157159,{'transaction':_0x466fed});});}else{_0x5b9a20=0x194;_0x56ded2=[];}});})[_0x7fb8('0x32')](function(){if(_0x5b9a20!==0x194){return db[_0x7fb8('0x6a')][_0x7fb8('0xbd')]({'where':{'SmsAccountId':_0x586381},'order':_0x7fb8('0x6c')})[_0x7fb8('0x32')](function(_0x29af9b){_0x56ded2=_0x29af9b;});}})[_0x7fb8('0x27')](function(_0x266b5f){_0x5b9a20=0x1f4;logger[_0x7fb8('0x24')](_0x266b5f[_0x7fb8('0xbe')]);if(_0x266b5f['name']){delete _0x266b5f['name'];}_0x56ded2=_0x266b5f;})['finally'](function(){if(_0x56ded2===null){_0x509c79[_0x7fb8('0x28')](_0x5b9a20);}else{if(_0x5b9a20===0x1f4){_0x509c79[_0x7fb8('0x29')](_0x5b9a20)['send'](_0x56ded2);}else{_0x509c79[_0x7fb8('0x29')](_0x5b9a20)[_0x7fb8('0xb5')](_0x56ded2);}}});};exports[_0x7fb8('0xbf')]=function(_0x3d85f4,_0x12fe79,_0x3ac25c){var _0x378bca={};var _0x2a4c76={};var _0x52df0a;var _0xdaab19;return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x3d85f4['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x12fe79,null))['then'](function(_0x57696b){if(_0x57696b){_0x52df0a=_0x57696b;_0x2a4c76['model']=_[_0x7fb8('0x4f')](db[_0x7fb8('0x6a')][_0x7fb8('0x3a')]);_0x2a4c76['query']=_['keys'](_0x3d85f4[_0x7fb8('0x40')]);_0x2a4c76[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x2a4c76['model'],_0x2a4c76[_0x7fb8('0x40')]);_0x378bca['attributes']=_['intersection'](_0x2a4c76[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x3d85f4[_0x7fb8('0x40')]['fields']));_0x378bca[_0x7fb8('0x43')]=_0x378bca[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x378bca[_0x7fb8('0x43')]:_0x2a4c76[_0x7fb8('0x3e')];_0x378bca['order']=qs['sort'](_0x3d85f4['query'][_0x7fb8('0x47')]);_0x378bca[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_['pick'](_0x3d85f4['query'],_0x2a4c76[_0x7fb8('0x41')]));if(_0x3d85f4['query'][_0x7fb8('0x4b')]){_0x378bca[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x378bca[_0x7fb8('0x49')],{'$or':_['map'](_0x378bca['attributes'],function(_0x1a876b){var _0x20f11d={};_0x20f11d[_0x1a876b]={'$like':'%'+_0x3d85f4['query'][_0x7fb8('0x4b')]+'%'};return _0x20f11d;})});}_0x378bca=_['merge']({},_0x378bca,_0x3d85f4['options']);return _0x52df0a[_0x7fb8('0xbf')](_0x378bca);}})['then'](function(_0x6e55a9){if(_0x6e55a9){_0xdaab19=_0x6e55a9[_0x7fb8('0xc0')];if(!_0x3d85f4[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x378bca[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x3d85f4[_0x7fb8('0x40')]['limit']);_0x378bca[_0x7fb8('0x2b')]=qs['offset'](_0x3d85f4['query'][_0x7fb8('0x2b')]);}return _0x52df0a[_0x7fb8('0xbf')](_0x378bca);}})[_0x7fb8('0x32')](function(_0x4e20ca){if(_0x4e20ca){return _0x4e20ca?{'count':_0xdaab19,'rows':_0x4e20ca}:null;}})[_0x7fb8('0x32')](respondWithResult(_0x12fe79,null))['catch'](handleError(_0x12fe79,null));};exports['getInteractions']=function(_0x57f2a0,_0xf696ee,_0x17ddb1){var _0x18ab64={'raw':![],'where':{}};var _0x1f55e1={};var _0x23ccf1={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x57f2a0[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0xf696ee,null))[_0x7fb8('0x32')](function(_0x4eca40){if(_0x4eca40){_0x1f55e1[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db['SmsInteraction'][_0x7fb8('0x3a')]);_0x1f55e1[_0x7fb8('0x40')]=_['keys'](_0x57f2a0['query']);_0x1f55e1[_0x7fb8('0x41')]=_['intersection'](_0x1f55e1[_0x7fb8('0x3e')],_0x1f55e1[_0x7fb8('0x40')]);_0x18ab64['attributes']=_[_0x7fb8('0x42')](_0x1f55e1[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x18ab64[_0x7fb8('0x43')]=_0x18ab64[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x18ab64[_0x7fb8('0x43')]:_0x1f55e1[_0x7fb8('0x3e')];if(!_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x18ab64[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x57f2a0['query']['limit']);_0x18ab64[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x18ab64['order']=qs[_0x7fb8('0x47')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x18ab64[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x57f2a0[_0x7fb8('0x40')],_0x1f55e1[_0x7fb8('0x41')]));_0x18ab64[_0x7fb8('0x49')]['SmsAccountId']=_0x4eca40['id'];if(_0x57f2a0['query']['filter']){_0x18ab64['where']=_[_0x7fb8('0x4a')](_0x18ab64['where'],{'$or':_[_0x7fb8('0x3f')](_0x18ab64[_0x7fb8('0x43')],function(_0x514ea4){var _0x3e88dc={};_0x3e88dc[_0x514ea4]={'$like':'%'+_0x57f2a0[_0x7fb8('0x40')]['filter']+'%'};return _0x3e88dc;})});}_0x18ab64=_[_0x7fb8('0x4a')]({},_0x18ab64,_0x57f2a0['options']);return db['SmsInteraction'][_0x7fb8('0x2e')]({'where':_0x18ab64[_0x7fb8('0x49')]})[_0x7fb8('0x32')](function(_0x5306d0){_0x23ccf1[_0x7fb8('0x2e')]=_0x5306d0;if(_0x57f2a0['query'][_0x7fb8('0x50')]){_0x18ab64[_0x7fb8('0x4d')]=[{'model':db[_0x7fb8('0x70')],'as':_0x7fb8('0xc1'),'required':![]},{'model':db[_0x7fb8('0xa8')],'as':_0x7fb8('0xc2'),'attributes':['name',_0x7fb8('0xc3'),_0x7fb8('0xc4')],'required':![]},{'model':db[_0x7fb8('0xc5')],'as':'Tags','attributes':['id','name',_0x7fb8('0xc6')],'where':_0x57f2a0['query']['tag']?{'id':_0x57f2a0['query']['tag']}:undefined,'required':_0x57f2a0[_0x7fb8('0x40')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x7fb8('0x61')](_0x18ab64);})[_0x7fb8('0x32')](function(_0x32992b){_0x23ccf1[_0x7fb8('0x4e')]=_0x32992b;return _0x23ccf1;});}})[_0x7fb8('0x32')](respondWithFilteredResult(_0xf696ee,_0x18ab64))['catch'](handleError(_0xf696ee,null));};exports['send']=function(_0x30f6b8,_0x59d9bd,_0x5d8c2e){var _0x548bd4,_0x4bf452,_0x22d297;if(_[_0x7fb8('0x90')](_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')])||_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')]===''){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x93'));}if(_['isNil'](_0x30f6b8['body']['to'])){throw new db[(_0x7fb8('0x91'))]['ValidationError'](_0x7fb8('0xc7'));}_0x548bd4=_0x30f6b8['body']['to'];return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x30f6b8[_0x7fb8('0x5a')]['id']},'include':[{'model':db[_0x7fb8('0x98')],'as':_0x7fb8('0xc8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x548bd4},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x7fb8('0x32')](handleEntityNotFound(_0x59d9bd,null))[_0x7fb8('0x32')](function(_0x1b1fe7){if(_0x1b1fe7&&_0x1b1fe7[_0x7fb8('0xc8')]){_0x4bf452=_0x1b1fe7['get']({'plain':!![]});if(_0x4bf452[_0x7fb8('0xc8')]&&_0x4bf452[_0x7fb8('0xc8')][_0x7fb8('0x9c')][_0x7fb8('0xc0')]){return _0x4bf452['List'][_0x7fb8('0x9c')][0x0];}return db[_0x7fb8('0x70')]['create'](_[_0x7fb8('0x18')](_0x30f6b8[_0x7fb8('0x53')],{'firstName':_0x548bd4,'mobile':_0x548bd4,'phone':_0x548bd4,'ListId':_0x4bf452[_0x7fb8('0x77')]}));}})[_0x7fb8('0x32')](handleEntityNotFound(_0x59d9bd,null))[_0x7fb8('0x32')](function(_0x24989f){if(_0x24989f){_0x22d297=_0x24989f;return db['SmsInteraction'][_0x7fb8('0x51')]({'where':{'ContactId':_0x22d297['id'],'closed':![],'SmsAccountId':_0x4bf452['id']}})[_0x7fb8('0x32')](function(_0x427fc4){if(_0x427fc4){return[_0x427fc4,![]];}return db[_0x7fb8('0x9e')][_0x7fb8('0x52')]({'UserId':_0x30f6b8[_0x7fb8('0xc9')]['id'],'ContactId':_0x22d297['id'],'SmsAccountId':_0x4bf452['id'],'phone':_0x548bd4,'firstMsgDirection':_0x7fb8('0xca'),'Messages':[_[_0x7fb8('0x4a')](_0x30f6b8[_0x7fb8('0x53')],{'read':![],'body':_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')],'phone':_0x548bd4,'SmsAccountId':_0x4bf452['id'],'UserId':_0x30f6b8['user']['id'],'ContactId':_0x22d297['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x7fb8('0xcb')}]})[_0x7fb8('0x32')](function(_0x26bd70){return[_0x26bd70,!![]];});});}})['spread'](function(_0x344810,_0x1067d9){if(_0x1067d9){return _0x344810;}return db[_0x7fb8('0xa6')][_0x7fb8('0x52')](_['merge'](_0x30f6b8[_0x7fb8('0x53')],{'read':![],'body':_0x30f6b8['body'][_0x7fb8('0x53')],'phone':_0x548bd4,'SmsAccountId':_0x4bf452['id'],'SmsInteractionId':_0x344810['id'],'UserId':_0x30f6b8['user']['id'],'ContactId':_0x22d297['id']}))[_0x7fb8('0x32')](function(_0x2ae5e7){_0x344810[_0x7fb8('0xcc')][_0x7fb8('0xcb')]=[];_0x344810['dataValues']['Messages']['push'](_0x2ae5e7[_0x7fb8('0xcc')]);return _0x344810;});})[_0x7fb8('0x32')](respondWithResult(_0x59d9bd,null))['catch'](handleError(_0x59d9bd,null));};exports[_0x7fb8('0x29')]=function(_0x5b0cb8,_0x2f8351,_0x2da3ac){if(_0x5b0cb8['body']['id']){delete _0x5b0cb8[_0x7fb8('0x53')]['id'];}var _0x34ab01,_0x123789,_0x4d2497;return db['SmsAccount']['find']({'where':{'id':_0x5b0cb8[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x2f8351,null))[_0x7fb8('0x32')](function(_0x351d79){if(_0x351d79){_0x4d2497=_0x351d79;logger[_0x7fb8('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'received\x20delivery\x20report\x20from',_0x351d79[_0x7fb8('0x3c')],util[_0x7fb8('0xcd')](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));switch(_0x351d79[_0x7fb8('0x3c')]){case _0x7fb8('0x7d'):if(_0x5b0cb8['body'][_0x7fb8('0xce')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xce')]}});}break;case _0x7fb8('0x80'):if(_0x5b0cb8[_0x7fb8('0x53')]['requestid']&&_0x5b0cb8['body'][_0x7fb8('0xcf')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xcf')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')]['requestid']}});}break;case _0x7fb8('0x82'):if(_0x5b0cb8['body'][_0x7fb8('0x83')]&&_0x5b0cb8[_0x7fb8('0x53')]['status_code']){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd0')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x83')]}});}break;case _0x7fb8('0x87'):var _0x10ffc5=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0];if(_0x10ffc5[_0x7fb8('0x7b')]&&_0x10ffc5[_0x7fb8('0x29')]['groupName']===_0x7fb8('0xd1')){_0x123789=_0x10ffc5[_0x7fb8('0x29')][_0x7fb8('0xd2')];return db['SmsMessage'][_0x7fb8('0x51')]({'where':{'messageId':_0x10ffc5['messageId']}});}break;case _0x7fb8('0xd3'):if(_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x7b')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')]['messageId']}});}break;case _0x7fb8('0x8e'):if(_0x5b0cb8[_0x7fb8('0x53')][0x0][_0x7fb8('0x25')]['id']){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][0x0][_0x7fb8('0x3c')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][0x0]['message']['id']}});}break;case _0x7fb8('0xd4'):if(_0x5b0cb8['body'][_0x7fb8('0xd5')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8['body'][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x2f8351,null))[_0x7fb8('0x32')](function(_0x44b51d){if(_0x44b51d){_0x34ab01=_0x44b51d;switch(_0x4d2497['type']){case _0x7fb8('0x7d'):if(_0x123789==='DELIVERED'){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x7d'),util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x80'):if(_0x123789==='1'){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x7d'),util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x82'):if(!_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd6')]&&_0x123789>=0xc8&&_0x123789<=0xce){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'clicksend',util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x87'):var _0x2d4265=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0];if(_0x2d4265[_0x7fb8('0x29')][_0x7fb8('0xd2')]===_0x7fb8('0xd1')){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'infobip',util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x123789==_0x7fb8('0xd7')||_0x123789=='RECEIVED_BY_RECIPIENT'){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0xd3'),util[_0x7fb8('0xcd')](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x123789==_0x7fb8('0xd8')){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),'bandwidth',util[_0x7fb8('0xcd')](_0x5b0cb8['body'],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0xd4'):if(_0x123789===_0x7fb8('0xd9')||_0x123789===_0x7fb8('0xda')){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),'intelepeer',util[_0x7fb8('0xcd')](_0x5b0cb8['body'],{'showHidden':![],'depth':null}));}break;}return _0x34ab01;}})[_0x7fb8('0x32')](respondWithResult(_0x2f8351,null))['catch'](handleError(_0x2f8351,null));};exports['statusGet']=function(_0x5c630b,_0x16a98d,_0x55f565){var _0x1e026b,_0x19d226,_0x451e2d;return db['SmsAccount']['find']({'where':{'id':_0x5c630b[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x16a98d,null))[_0x7fb8('0x32')](function(_0x19eba7){if(_0x19eba7){_0x451e2d=_0x19eba7;logger[_0x7fb8('0xaf')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0xdb'),_0x19eba7['type'],util[_0x7fb8('0xcd')](_0x5c630b[_0x7fb8('0x40')],{'showHidden':![],'depth':null}));switch(_0x19eba7['type']){case'csc':if(_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdc')]&&_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdd')]){_0x19d226=_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdd')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdc')]}});}break;}}})[_0x7fb8('0x32')](handleEntityNotFound(_0x16a98d,null))['then'](function(_0x1046a3){if(_0x1046a3){_0x1e026b=_0x1046a3;switch(_0x451e2d[_0x7fb8('0x3c')]){case _0x7fb8('0x89'):if(_0x19d226==='2'||_0x19d226==='6'){return _0x1e026b[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x89'),util[_0x7fb8('0xcd')](_0x5c630b[_0x7fb8('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x1e026b;}})['then'](respondWithResult(_0x16a98d,null))['catch'](handleError(_0x16a98d,null));};exports[_0x7fb8('0xde')]=function(_0xd7b6b1,_0x30f933,_0x30e19d){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0xd7b6b1[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x30f933,null))[_0x7fb8('0x32')](function(_0x44c590){if(_0x44c590){return _0x44c590['addAgents'](_0xd7b6b1[_0x7fb8('0x53')][_0x7fb8('0x63')],_['omit'](_0xd7b6b1['body'],[_0x7fb8('0x63'),'id'])||{})[_0x7fb8('0x9f')](function(_0x1e7f61){for(var _0x5a10cf=0x0;_0x5a10cf<_0xd7b6b1[_0x7fb8('0x53')][_0x7fb8('0x63')][_0x7fb8('0xc0')];_0x5a10cf+=0x1){socket[_0x7fb8('0xdf')](_0x7fb8('0xe0'),{'UserId':Number(_0xd7b6b1[_0x7fb8('0x53')]['ids'][_0x5a10cf]),'SmsAccountId':Number(_0xd7b6b1[_0x7fb8('0x5a')]['id'])});}return _0x1e7f61;});}})[_0x7fb8('0x32')](respondWithResult(_0x30f933,null))[_0x7fb8('0x27')](handleError(_0x30f933,null));};exports[_0x7fb8('0xe1')]=function(_0xe625d0,_0x56f5fc,_0x2d8760){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0xe625d0[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x56f5fc,null))[_0x7fb8('0x32')](function(_0xa7f1f1){if(_0xa7f1f1){return _0xa7f1f1[_0x7fb8('0xe1')](_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')])[_0x7fb8('0x32')](function(){if(_[_0x7fb8('0xe2')](_0xe625d0[_0x7fb8('0x40')]['ids'])){for(var _0x30942f=0x0;_0x30942f<_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')]['length'];_0x30942f+=0x1){socket['emit'](_0x7fb8('0xe3'),{'UserId':Number(_0xe625d0[_0x7fb8('0x40')]['ids'][_0x30942f]),'SmsAccountId':Number(_0xe625d0[_0x7fb8('0x5a')]['id'])});}}else{socket['emit'](_0x7fb8('0xe3'),{'UserId':Number(_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')]),'SmsAccountId':Number(_0xe625d0['params']['id'])});}});}})[_0x7fb8('0x32')](respondWithStatusCode(_0x56f5fc,null))['catch'](handleError(_0x56f5fc,null));};exports[_0x7fb8('0xe4')]=function(_0x395384,_0x9d6a57,_0x24f910){var _0x46dbaf={};var _0x16db44={};var _0x34eb46;var _0x403078;return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x395384[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x9d6a57,null))[_0x7fb8('0x32')](function(_0x478e39){if(_0x478e39){_0x34eb46=_0x478e39;_0x16db44[_0x7fb8('0x3e')]=_['keys'](db[_0x7fb8('0xa8')][_0x7fb8('0x3a')]);_0x16db44['query']=_[_0x7fb8('0x4f')](_0x395384[_0x7fb8('0x40')]);_0x16db44[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x16db44['model'],_0x16db44[_0x7fb8('0x40')]);_0x46dbaf[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x16db44['model'],qs[_0x7fb8('0x44')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x46dbaf[_0x7fb8('0x43')]=_0x46dbaf[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x46dbaf[_0x7fb8('0x43')]:_0x16db44[_0x7fb8('0x3e')];_0x46dbaf[_0x7fb8('0x46')]=qs['sort'](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x46dbaf[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_['pick'](_0x395384[_0x7fb8('0x40')],_0x16db44['filters']));if(_0x395384[_0x7fb8('0x40')]['filter']){_0x46dbaf[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x46dbaf[_0x7fb8('0x49')],{'$or':_['map'](_0x46dbaf[_0x7fb8('0x43')],function(_0x5459aa){var _0x1d990d={};_0x1d990d[_0x5459aa]={'$like':'%'+_0x395384[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x1d990d;})});}_0x46dbaf=_[_0x7fb8('0x4a')]({},_0x46dbaf,_0x395384[_0x7fb8('0x4c')]);return _0x34eb46[_0x7fb8('0xe4')](_0x46dbaf);}})[_0x7fb8('0x32')](function(_0x2c2d5c){if(_0x2c2d5c){_0x403078=_0x2c2d5c['length'];if(!_0x395384['query']['hasOwnProperty'](_0x7fb8('0x60'))){_0x46dbaf[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x46dbaf[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}return _0x34eb46['getAgents'](_0x46dbaf);}})['then'](function(_0x37d242){if(_0x37d242){return _0x37d242?{'count':_0x403078,'rows':_0x37d242}:null;}})[_0x7fb8('0x32')](respondWithResult(_0x9d6a57,null))['catch'](handleError(_0x9d6a57,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 82fd161..0da9b50 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 _0x0567=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3a3133,_0x179dde){var _0x51b179=function(_0x182e86){while(--_0x182e86){_0x3a3133['push'](_0x3a3133['shift']());}};_0x51b179(++_0x179dde);}(_0x0567,0x17e));var _0x7056=function(_0xcaf4e7,_0x1a1c7f){_0xcaf4e7=_0xcaf4e7-0x0;var _0x3b8666=_0x0567[_0xcaf4e7];return _0x3b8666;};'use strict';var EventEmitter=require(_0x7056('0x0'));var SmsAccount=require(_0x7056('0x1'))['db'][_0x7056('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7056('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7056('0x4'),'afterDestroy':_0x7056('0x5')};function emitEvent(_0x224a1c){return function(_0x207c4a,_0x7c108e,_0x566ed6){SmsAccountEvents[_0x7056('0x6')](_0x224a1c+':'+_0x207c4a['id'],_0x207c4a);SmsAccountEvents[_0x7056('0x6')](_0x224a1c,_0x207c4a);_0x566ed6(null);};}for(var e in events){if(events[_0x7056('0x7')](e)){var event=events[e];SmsAccount[_0x7056('0x8')](e,emitEvent(event));}}module[_0x7056('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xa40a=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x212a2e,_0x5bc358){var _0x19e9c6=function(_0x308afc){while(--_0x308afc){_0x212a2e['push'](_0x212a2e['shift']());}};_0x19e9c6(++_0x5bc358);}(_0xa40a,0x133));var _0xaa40=function(_0x25a614,_0xbefde7){_0x25a614=_0x25a614-0x0;var _0x10407e=_0xa40a[_0x25a614];return _0x10407e;};'use strict';var EventEmitter=require(_0xaa40('0x0'));var SmsAccount=require(_0xaa40('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaa40('0x2')](0x0);var events={'afterCreate':_0xaa40('0x3'),'afterUpdate':_0xaa40('0x4'),'afterDestroy':_0xaa40('0x5')};function emitEvent(_0x564c06){return function(_0x681405,_0xb8f52,_0x4cbda0){SmsAccountEvents[_0xaa40('0x6')](_0x564c06+':'+_0x681405['id'],_0x681405);SmsAccountEvents['emit'](_0x564c06,_0x681405);_0x4cbda0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xaa40('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5c321dc..9f35d9d 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 _0x4e23=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsAccount.attributes','exports'];(function(_0x735d59,_0x3fee4e){var _0x263c57=function(_0x4281e6){while(--_0x4281e6){_0x735d59['push'](_0x735d59['shift']());}};_0x263c57(++_0x3fee4e);}(_0x4e23,0x93));var _0x34e2=function(_0x5d671e,_0x2d255a){_0x5d671e=_0x5d671e-0x0;var _0x3381c9=_0x4e23[_0x5d671e];return _0x3381c9;};'use strict';var _=require(_0x34e2('0x0'));var util=require(_0x34e2('0x1'));var logger=require(_0x34e2('0x2'))('api');var moment=require(_0x34e2('0x3'));var BPromise=require(_0x34e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34e2('0x5'));var rimraf=require(_0x34e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x34e2('0x7'));module[_0x34e2('0x8')]=function(_0x183222,_0x5073fa){return _0x183222[_0x34e2('0x9')](_0x34e2('0xa'),attributes,{'tableName':_0x34e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb63=['SmsAccount','util','api','moment','path','rimraf','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb63,0x1b1));var _0x3eb6=function(_0x410e0f,_0x409b52){_0x410e0f=_0x410e0f-0x0;var _0x29c16b=_0xeb63[_0x410e0f];return _0x29c16b;};'use strict';var _=require('lodash');var util=require(_0x3eb6('0x0'));var logger=require('../../config/logger')(_0x3eb6('0x1'));var moment=require(_0x3eb6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eb6('0x3'));var rimraf=require(_0x3eb6('0x4'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x3eb6('0x5')]=function(_0x59b682,_0x2890ae){return _0x59b682[_0x3eb6('0x6')](_0x3eb6('0x7'),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 8525fe1..764106c 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 _0xbc19=['raw','where','attributes','include','map','model','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options'];(function(_0x2b0b73,_0x4c6134){var _0x232c39=function(_0x21f2a3){while(--_0x21f2a3){_0x2b0b73['push'](_0x2b0b73['shift']());}};_0x232c39(++_0x4c6134);}(_0xbc19,0xee));var _0x9bc1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbc19[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x9bc1('0x0'));var moment=require('moment');var BPromise=require(_0x9bc1('0x1'));var rs=require(_0x9bc1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bc1('0x3'))['db'];var utils=require(_0x9bc1('0x4'));var logger=require(_0x9bc1('0x5'))(_0x9bc1('0x6'));var config=require(_0x9bc1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9bc1('0x8')],{'host':_0x9bc1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9bc1('0xa'))[_0x9bc1('0xb')](socket);function respondWithRpcPromise(_0x546c66,_0x21f1bc,_0x422316){return new BPromise(function(_0x31c7ac,_0x491c9c){return client['request'](_0x546c66,_0x422316)['then'](function(_0x47ad05){logger[_0x9bc1('0xc')](_0x9bc1('0xd'),_0x21f1bc,_0x9bc1('0xe'));logger[_0x9bc1('0xf')](_0x9bc1('0x10'),_0x21f1bc,'request\x20sent',JSON['stringify'](_0x47ad05));if(_0x47ad05[_0x9bc1('0x11')]){if(_0x47ad05[_0x9bc1('0x11')][_0x9bc1('0x12')]===0x1f4){logger['error'](_0x9bc1('0xd'),_0x21f1bc,_0x47ad05['error'][_0x9bc1('0x13')]);return _0x491c9c(_0x47ad05[_0x9bc1('0x11')][_0x9bc1('0x13')]);}logger[_0x9bc1('0x11')](_0x9bc1('0xd'),_0x21f1bc,_0x47ad05['error'][_0x9bc1('0x13')]);return _0x31c7ac(_0x47ad05['error']['message']);}else{logger[_0x9bc1('0xc')](_0x9bc1('0xd'),_0x21f1bc,_0x9bc1('0xe'));_0x31c7ac(_0x47ad05[_0x9bc1('0x14')][_0x9bc1('0x13')]);}})[_0x9bc1('0x15')](function(_0x664a97){logger[_0x9bc1('0x11')](_0x9bc1('0xd'),_0x21f1bc,_0x664a97);_0x491c9c(_0x664a97);});});}exports[_0x9bc1('0x16')]=function(_0x3dbd0b){var _0x5a5df9=this;return new Promise(function(_0x586bfe,_0x3805d0){return db[_0x9bc1('0x17')][_0x9bc1('0x18')]({'raw':_0x3dbd0b[_0x9bc1('0x19')]?_0x3dbd0b['options'][_0x9bc1('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbd0b[_0x9bc1('0x19')]?_0x3dbd0b[_0x9bc1('0x19')][_0x9bc1('0x1b')]||null:null,'attributes':_0x3dbd0b[_0x9bc1('0x19')]?_0x3dbd0b['options'][_0x9bc1('0x1c')]||null:null,'include':_0x3dbd0b[_0x9bc1('0x19')]?_0x3dbd0b[_0x9bc1('0x19')][_0x9bc1('0x1d')]?_[_0x9bc1('0x1e')](_0x3dbd0b[_0x9bc1('0x19')][_0x9bc1('0x1d')],function(_0x5c9dd7){return{'model':db[_0x5c9dd7[_0x9bc1('0x1f')]],'as':_0x5c9dd7['as'],'attributes':_0x5c9dd7[_0x9bc1('0x1c')],'include':_0x5c9dd7[_0x9bc1('0x1d')]?_[_0x9bc1('0x1e')](_0x5c9dd7[_0x9bc1('0x1d')],function(_0x54d143){return{'model':db[_0x54d143[_0x9bc1('0x1f')]],'as':_0x54d143['as'],'attributes':_0x54d143[_0x9bc1('0x1c')],'include':_0x54d143[_0x9bc1('0x1d')]?_[_0x9bc1('0x1e')](_0x54d143['include'],function(_0xb6eefa){return{'model':db[_0xb6eefa[_0x9bc1('0x1f')]],'as':_0xb6eefa['as'],'attributes':_0xb6eefa[_0x9bc1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x524fdd){logger[_0x9bc1('0xc')](_0x9bc1('0x16'),_0x3dbd0b);logger[_0x9bc1('0xf')](_0x9bc1('0x16'),_0x3dbd0b,JSON[_0x9bc1('0x20')](_0x524fdd));_0x586bfe(_0x524fdd);})[_0x9bc1('0x15')](function(_0x187114){logger[_0x9bc1('0x11')]('ShowSmsAccount',_0x187114['message'],_0x3dbd0b);_0x3805d0(_0x5a5df9[_0x9bc1('0x11')](0x1f4,_0x187114[_0x9bc1('0x13')]));});});}; \ No newline at end of file +var _0xae3b=['then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsAccount.socket','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xae3b,0x190));var _0xbae3=function(_0x4d799e,_0x23a294){_0x4d799e=_0x4d799e-0x0;var _0x390621=_0xae3b[_0x4d799e];return _0x390621;};'use strict';var _=require(_0xbae3('0x0'));var util=require(_0xbae3('0x1'));var moment=require(_0xbae3('0x2'));var BPromise=require(_0xbae3('0x3'));var rs=require(_0xbae3('0x4'));var fs=require('fs');var Redis=require(_0xbae3('0x5'));var db=require(_0xbae3('0x6'))['db'];var utils=require(_0xbae3('0x7'));var logger=require(_0xbae3('0x8'))(_0xbae3('0x9'));var config=require(_0xbae3('0xa'));var jayson=require(_0xbae3('0xb'));var client=jayson['client'][_0xbae3('0xc')]({'port':0x232a});config[_0xbae3('0xd')]=_[_0xbae3('0xe')](config[_0xbae3('0xd')],{'host':_0xbae3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbae3('0xd')]));require(_0xbae3('0x10'))['register'](socket);function respondWithRpcPromise(_0xe77ee0,_0xfb2f04,_0x1f7173){return new BPromise(function(_0x2f12f5,_0x5e2948){return client[_0xbae3('0x11')](_0xe77ee0,_0x1f7173)[_0xbae3('0x12')](function(_0xb2626a){logger['info'](_0xbae3('0x13'),_0xfb2f04,_0xbae3('0x14'));logger[_0xbae3('0x15')](_0xbae3('0x16'),_0xfb2f04,_0xbae3('0x14'),JSON[_0xbae3('0x17')](_0xb2626a));if(_0xb2626a[_0xbae3('0x18')]){if(_0xb2626a[_0xbae3('0x18')]['code']===0x1f4){logger[_0xbae3('0x18')]('SmsAccount,\x20%s,\x20%s',_0xfb2f04,_0xb2626a[_0xbae3('0x18')][_0xbae3('0x19')]);return _0x5e2948(_0xb2626a['error'][_0xbae3('0x19')]);}logger[_0xbae3('0x18')]('SmsAccount,\x20%s,\x20%s',_0xfb2f04,_0xb2626a[_0xbae3('0x18')][_0xbae3('0x19')]);return _0x2f12f5(_0xb2626a['error'][_0xbae3('0x19')]);}else{logger['info'](_0xbae3('0x13'),_0xfb2f04,_0xbae3('0x14'));_0x2f12f5(_0xb2626a[_0xbae3('0x1a')][_0xbae3('0x19')]);}})['catch'](function(_0x16b98d){logger[_0xbae3('0x18')](_0xbae3('0x13'),_0xfb2f04,_0x16b98d);_0x5e2948(_0x16b98d);});});}exports[_0xbae3('0x1b')]=function(_0x2b631e){var _0x4abfee=this;return new Promise(function(_0x29b4f3,_0x1f8e9d){return db[_0xbae3('0x1c')]['find']({'raw':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e['options'][_0xbae3('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x1f')]||null:null,'attributes':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x20')]||null:null,'include':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x21')]?_['map'](_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x21')],function(_0x53ae27){return{'model':db[_0x53ae27[_0xbae3('0x22')]],'as':_0x53ae27['as'],'attributes':_0x53ae27[_0xbae3('0x20')],'include':_0x53ae27['include']?_[_0xbae3('0x23')](_0x53ae27['include'],function(_0x1cb164){return{'model':db[_0x1cb164['model']],'as':_0x1cb164['as'],'attributes':_0x1cb164[_0xbae3('0x20')],'include':_0x1cb164['include']?_[_0xbae3('0x23')](_0x1cb164[_0xbae3('0x21')],function(_0x3210db){return{'model':db[_0x3210db[_0xbae3('0x22')]],'as':_0x3210db['as'],'attributes':_0x3210db[_0xbae3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbae3('0x12')](function(_0x27e13d){logger[_0xbae3('0x24')]('ShowSmsAccount',_0x2b631e);logger[_0xbae3('0x15')](_0xbae3('0x1b'),_0x2b631e,JSON[_0xbae3('0x17')](_0x27e13d));_0x29b4f3(_0x27e13d);})[_0xbae3('0x25')](function(_0x3ad480){logger[_0xbae3('0x18')](_0xbae3('0x1b'),_0x3ad480[_0xbae3('0x19')],_0x2b631e);_0x1f8e9d(_0x4abfee[_0xbae3('0x18')](0x1f4,_0x3ad480['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 186e1b8..1cd842c 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 a57fdca..590831f 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x25e723,_0x34afbd){var _0xca7c69=function(_0x16f1a4){while(--_0x16f1a4){_0x25e723['push'](_0x25e723['shift']());}};_0xca7c69(++_0x34afbd);}(_0xedd9,0xfc));var _0x9edd=function(_0x5c9682,_0x3e8840){_0x5c9682=_0x5c9682-0x0;var _0x43d8e7=_0xedd9[_0x5c9682];return _0x43d8e7;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 222b3fe..65104ef 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 _0x7e99=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x39e134,_0xd37a5d){var _0x3239a7=function(_0x597cc7){while(--_0x597cc7){_0x39e134['push'](_0x39e134['shift']());}};_0x3239a7(++_0xd37a5d);}(_0x7e99,0x18e));var _0x97e9=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x7e99[_0x50aa2e];return _0x5e07f0;};'use strict';var Sequelize=require(_0x97e9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x97e9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x97e9('0x2')},'appdata':{'type':Sequelize[_0x97e9('0x3')]()},'description':{'type':Sequelize[_0x97e9('0x4')]},'interval':{'type':Sequelize[_0x97e9('0x4')],'defaultValue':_0x97e9('0x5')}}; \ No newline at end of file +var _0x416c=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x12867f,_0x44b08a){var _0xf984ee=function(_0x2805d7){while(--_0x2805d7){_0x12867f['push'](_0x12867f['shift']());}};_0xf984ee(++_0x44b08a);}(_0x416c,0x1c8));var _0xc416=function(_0x179165,_0x4c82fd){_0x179165=_0x179165-0x0;var _0x227a4f=_0x416c[_0x179165];return _0x227a4f;};'use strict';var Sequelize=require(_0xc416('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc416('0x1')],'allowNull':![],'defaultValue':_0xc416('0x2')},'appdata':{'type':Sequelize[_0xc416('0x3')]()},'description':{'type':Sequelize[_0xc416('0x1')]},'interval':{'type':Sequelize[_0xc416('0x1')],'defaultValue':_0xc416('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a730a7a..dcda7de 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 _0xc7be=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','then','catch','show','params','includeAll','include','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsApplication','rawAttributes'];(function(_0x30eb36,_0x4f7dab){var _0x1b33d1=function(_0x4ab0ff){while(--_0x4ab0ff){_0x30eb36['push'](_0x30eb36['shift']());}};_0x1b33d1(++_0x4f7dab);}(_0xc7be,0x187));var _0xec7b=function(_0x332572,_0x38e523){_0x332572=_0x332572-0x0;var _0x9fab1c=_0xc7be[_0x332572];return _0x9fab1c;};'use strict';var emlformat=require(_0xec7b('0x0'));var rimraf=require(_0xec7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec7b('0x2'));var moment=require(_0xec7b('0x3'));var BPromise=require(_0xec7b('0x4'));var Mustache=require(_0xec7b('0x5'));var util=require(_0xec7b('0x6'));var path=require(_0xec7b('0x7'));var sox=require(_0xec7b('0x8'));var csv=require(_0xec7b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec7b('0xa'));var _=require(_0xec7b('0xb'));var squel=require(_0xec7b('0xc'));var crypto=require(_0xec7b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec7b('0xe'));var toCsv=require(_0xec7b('0x9'));var querystring=require(_0xec7b('0xf'));var Papa=require(_0xec7b('0x10'));var Redis=require(_0xec7b('0x11'));var authService=require(_0xec7b('0x12'));var qs=require(_0xec7b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec7b('0x14'));var logger=require(_0xec7b('0x15'))(_0xec7b('0x16'));var utils=require(_0xec7b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xec7b('0x18'));var db=require(_0xec7b('0x19'))['db'];function respondWithStatusCode(_0x22306d,_0x487ca1){_0x487ca1=_0x487ca1||0xcc;return function(_0x410222){if(_0x410222){return _0x22306d['sendStatus'](_0x487ca1);}return _0x22306d['status'](_0x487ca1)[_0xec7b('0x1a')]();};}function respondWithResult(_0x48ca92,_0x87f122){_0x87f122=_0x87f122||0xc8;return function(_0x147c59){if(_0x147c59){return _0x48ca92[_0xec7b('0x1b')](_0x87f122)['json'](_0x147c59);}};}function respondWithFilteredResult(_0x2b63c8,_0x567f69){return function(_0xf7d4aa){if(_0xf7d4aa){var _0x2af899=typeof _0x567f69['offset']===_0xec7b('0x1c')&&typeof _0x567f69['limit']===_0xec7b('0x1c');var _0x4cbab8=_0xf7d4aa[_0xec7b('0x1d')];var _0x24ac90=_0x2af899?0x0:_0x567f69[_0xec7b('0x1e')];var _0x40c77a=_0x2af899?_0xf7d4aa['count']:_0x567f69[_0xec7b('0x1e')]+_0x567f69[_0xec7b('0x1f')];var _0x36143a;if(_0x40c77a>=_0x4cbab8){_0x40c77a=_0x4cbab8;_0x36143a=0xc8;}else{_0x36143a=0xce;}_0x2b63c8[_0xec7b('0x1b')](_0x36143a);return _0x2b63c8['set'](_0xec7b('0x20'),_0x24ac90+'-'+_0x40c77a+'/'+_0x4cbab8)[_0xec7b('0x21')](_0xf7d4aa);}return null;};}function patchUpdates(_0x372d2c){return function(_0x39eb97){try{jsonpatch[_0xec7b('0x22')](_0x39eb97,_0x372d2c,!![]);}catch(_0x4b1c57){return BPromise[_0xec7b('0x23')](_0x4b1c57);}return _0x39eb97[_0xec7b('0x24')]();};}function saveUpdates(_0x41395d,_0x2dbdde){return function(_0x29e6b6){if(_0x29e6b6){return _0x29e6b6[_0xec7b('0x25')](_0x41395d)['then'](function(_0x297e85){return _0x297e85;});}return null;};}function removeEntity(_0x417846,_0x52a76a){return function(_0x317db2){if(_0x317db2){return _0x317db2[_0xec7b('0x26')]()['then'](function(){_0x417846[_0xec7b('0x1b')](0xcc)[_0xec7b('0x1a')]();});}};}function handleEntityNotFound(_0x2d5d6f,_0x28ce35){return function(_0x5a5f6c){if(!_0x5a5f6c){_0x2d5d6f[_0xec7b('0x27')](0x194);}return _0x5a5f6c;};}function handleError(_0x1824c2,_0x52179e){_0x52179e=_0x52179e||0x1f4;return function(_0x4b8a08){logger['error'](_0x4b8a08[_0xec7b('0x28')]);if(_0x4b8a08[_0xec7b('0x29')]){delete _0x4b8a08['name'];}_0x1824c2[_0xec7b('0x1b')](_0x52179e)[_0xec7b('0x2a')](_0x4b8a08);};}exports[_0xec7b('0x2b')]=function(_0x1626ec,_0x5ce4d5){var _0x314030={},_0x4f1c36={},_0x5096d4={'count':0x0,'rows':[]};var _0x3d923f=_[_0xec7b('0x2c')](db[_0xec7b('0x2d')][_0xec7b('0x2e')],function(_0x4f723e){return{'name':_0x4f723e['fieldName'],'type':_0x4f723e['type'][_0xec7b('0x2f')]};});_0x4f1c36[_0xec7b('0x30')]=_[_0xec7b('0x2c')](_0x3d923f,_0xec7b('0x29'));_0x4f1c36[_0xec7b('0x31')]=_[_0xec7b('0x32')](_0x1626ec[_0xec7b('0x31')]);_0x4f1c36[_0xec7b('0x33')]=_[_0xec7b('0x34')](_0x4f1c36['model'],_0x4f1c36[_0xec7b('0x31')]);_0x314030[_0xec7b('0x35')]=_[_0xec7b('0x34')](_0x4f1c36[_0xec7b('0x30')],qs['fields'](_0x1626ec[_0xec7b('0x31')][_0xec7b('0x36')]));_0x314030[_0xec7b('0x35')]=_0x314030[_0xec7b('0x35')][_0xec7b('0x37')]?_0x314030['attributes']:_0x4f1c36[_0xec7b('0x30')];if(!_0x1626ec[_0xec7b('0x31')]['hasOwnProperty']('nolimit')){_0x314030[_0xec7b('0x1f')]=qs[_0xec7b('0x1f')](_0x1626ec[_0xec7b('0x31')]['limit']);_0x314030[_0xec7b('0x1e')]=qs[_0xec7b('0x1e')](_0x1626ec[_0xec7b('0x31')][_0xec7b('0x1e')]);}_0x314030[_0xec7b('0x38')]=qs[_0xec7b('0x39')](_0x1626ec[_0xec7b('0x31')][_0xec7b('0x39')]);_0x314030[_0xec7b('0x3a')]=qs[_0xec7b('0x33')](_[_0xec7b('0x3b')](_0x1626ec[_0xec7b('0x31')],_0x4f1c36['filters']),_0x3d923f);if(_0x1626ec[_0xec7b('0x31')][_0xec7b('0x3c')]){_0x314030[_0xec7b('0x3a')]=_['merge'](_0x314030['where'],{'$or':_['map'](_0x3d923f,function(_0x5623ef){if(_0x5623ef[_0xec7b('0x3d')]!==_0xec7b('0x3e')){var _0x3db819={};_0x3db819[_0x5623ef['name']]={'$like':'%'+_0x1626ec[_0xec7b('0x31')][_0xec7b('0x3c')]+'%'};return _0x3db819;}})});}_0x314030=_[_0xec7b('0x3f')]({},_0x314030,_0x1626ec['options']);var _0x5a9c12={'where':_0x314030[_0xec7b('0x3a')]};return db[_0xec7b('0x2d')][_0xec7b('0x1d')](_0x5a9c12)['then'](function(_0x373b4f){_0x5096d4[_0xec7b('0x1d')]=_0x373b4f;if(_0x1626ec['query']['includeAll']){_0x314030['include']=[{'all':!![]}];}return db[_0xec7b('0x2d')]['findAll'](_0x314030);})[_0xec7b('0x40')](function(_0x2bc5a3){_0x5096d4['rows']=_0x2bc5a3;return _0x5096d4;})[_0xec7b('0x40')](respondWithFilteredResult(_0x5ce4d5,_0x314030))[_0xec7b('0x41')](handleError(_0x5ce4d5,null));};exports[_0xec7b('0x42')]=function(_0x4d24d4,_0x2acbc6){var _0x44e60d={'raw':!![],'where':{'id':_0x4d24d4[_0xec7b('0x43')]['id']}},_0x1cc69d={};_0x1cc69d[_0xec7b('0x30')]=_[_0xec7b('0x32')](db['SmsApplication']['rawAttributes']);_0x1cc69d[_0xec7b('0x31')]=_[_0xec7b('0x32')](_0x4d24d4['query']);_0x1cc69d[_0xec7b('0x33')]=_[_0xec7b('0x34')](_0x1cc69d[_0xec7b('0x30')],_0x1cc69d[_0xec7b('0x31')]);_0x44e60d[_0xec7b('0x35')]=_[_0xec7b('0x34')](_0x1cc69d['model'],qs[_0xec7b('0x36')](_0x4d24d4[_0xec7b('0x31')][_0xec7b('0x36')]));_0x44e60d[_0xec7b('0x35')]=_0x44e60d['attributes'][_0xec7b('0x37')]?_0x44e60d[_0xec7b('0x35')]:_0x1cc69d[_0xec7b('0x30')];if(_0x4d24d4[_0xec7b('0x31')][_0xec7b('0x44')]){_0x44e60d[_0xec7b('0x45')]=[{'all':!![]}];}_0x44e60d=_[_0xec7b('0x3f')]({},_0x44e60d,_0x4d24d4['options']);return db['SmsApplication'][_0xec7b('0x46')](_0x44e60d)[_0xec7b('0x40')](handleEntityNotFound(_0x2acbc6,null))[_0xec7b('0x40')](respondWithResult(_0x2acbc6,null))['catch'](handleError(_0x2acbc6,null));};exports[_0xec7b('0x47')]=function(_0x4051db,_0x2d4900){return db[_0xec7b('0x2d')][_0xec7b('0x47')](_0x4051db[_0xec7b('0x48')],{})[_0xec7b('0x40')](respondWithResult(_0x2d4900,0xc9))[_0xec7b('0x41')](handleError(_0x2d4900,null));};exports[_0xec7b('0x25')]=function(_0x57467c,_0x486ef9){if(_0x57467c[_0xec7b('0x48')]['id']){delete _0x57467c[_0xec7b('0x48')]['id'];}return db[_0xec7b('0x2d')]['find']({'where':{'id':_0x57467c['params']['id']}})[_0xec7b('0x40')](handleEntityNotFound(_0x486ef9,null))[_0xec7b('0x40')](saveUpdates(_0x57467c['body'],null))[_0xec7b('0x40')](respondWithResult(_0x486ef9,null))[_0xec7b('0x41')](handleError(_0x486ef9,null));};exports[_0xec7b('0x26')]=function(_0x20a1df,_0x3cc5b9){return db[_0xec7b('0x2d')][_0xec7b('0x46')]({'where':{'id':_0x20a1df['params']['id']}})['then'](handleEntityNotFound(_0x3cc5b9,null))[_0xec7b('0x40')](removeEntity(_0x3cc5b9,null))['catch'](handleError(_0x3cc5b9,null));}; \ No newline at end of file +var _0x1766=['name','send','map','SmsApplication','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','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','offset','undefined','limit','count','set','Content-Range','reject','save','then','error'];(function(_0x509341,_0x52a61b){var _0x514071=function(_0x266a6c){while(--_0x266a6c){_0x509341['push'](_0x509341['shift']());}};_0x514071(++_0x52a61b);}(_0x1766,0x6c));var _0x6176=function(_0x2aaeb2,_0x1b745e){_0x2aaeb2=_0x2aaeb2-0x0;var _0x58bf5b=_0x1766[_0x2aaeb2];return _0x58bf5b;};'use strict';var emlformat=require(_0x6176('0x0'));var rimraf=require(_0x6176('0x1'));var zipdir=require(_0x6176('0x2'));var jsonpatch=require(_0x6176('0x3'));var rp=require('request-promise');var moment=require(_0x6176('0x4'));var BPromise=require(_0x6176('0x5'));var Mustache=require('mustache');var util=require(_0x6176('0x6'));var path=require(_0x6176('0x7'));var sox=require(_0x6176('0x8'));var csv=require(_0x6176('0x9'));var ejs=require(_0x6176('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6176('0xb'));var squel=require(_0x6176('0xc'));var crypto=require('crypto');var jsforce=require(_0x6176('0xd'));var deskjs=require(_0x6176('0xe'));var toCsv=require(_0x6176('0x9'));var querystring=require('querystring');var Papa=require(_0x6176('0xf'));var Redis=require(_0x6176('0x10'));var authService=require(_0x6176('0x11'));var qs=require(_0x6176('0x12'));var as=require(_0x6176('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6176('0x14'))('api');var utils=require(_0x6176('0x15'));var config=require(_0x6176('0x16'));var licenseUtil=require(_0x6176('0x17'));var db=require(_0x6176('0x18'))['db'];function respondWithStatusCode(_0x1e52e9,_0x4211b6){_0x4211b6=_0x4211b6||0xcc;return function(_0x146368){if(_0x146368){return _0x1e52e9[_0x6176('0x19')](_0x4211b6);}return _0x1e52e9[_0x6176('0x1a')](_0x4211b6)[_0x6176('0x1b')]();};}function respondWithResult(_0x39d69b,_0x4975dc){_0x4975dc=_0x4975dc||0xc8;return function(_0x3c7453){if(_0x3c7453){return _0x39d69b[_0x6176('0x1a')](_0x4975dc)['json'](_0x3c7453);}};}function respondWithFilteredResult(_0xe2ff28,_0x3e2b13){return function(_0x458826){if(_0x458826){var _0x8bfce6=typeof _0x3e2b13[_0x6176('0x1c')]===_0x6176('0x1d')&&typeof _0x3e2b13[_0x6176('0x1e')]===_0x6176('0x1d');var _0x3e1c2=_0x458826[_0x6176('0x1f')];var _0x53a8f0=_0x8bfce6?0x0:_0x3e2b13[_0x6176('0x1c')];var _0x315943=_0x8bfce6?_0x458826['count']:_0x3e2b13['offset']+_0x3e2b13[_0x6176('0x1e')];var _0x7638a4;if(_0x315943>=_0x3e1c2){_0x315943=_0x3e1c2;_0x7638a4=0xc8;}else{_0x7638a4=0xce;}_0xe2ff28[_0x6176('0x1a')](_0x7638a4);return _0xe2ff28[_0x6176('0x20')](_0x6176('0x21'),_0x53a8f0+'-'+_0x315943+'/'+_0x3e1c2)['json'](_0x458826);}return null;};}function patchUpdates(_0x5e9434){return function(_0x37d354){try{jsonpatch['apply'](_0x37d354,_0x5e9434,!![]);}catch(_0x50d3d4){return BPromise[_0x6176('0x22')](_0x50d3d4);}return _0x37d354[_0x6176('0x23')]();};}function saveUpdates(_0x834ab0,_0x449594){return function(_0x2ebbcc){if(_0x2ebbcc){return _0x2ebbcc['update'](_0x834ab0)[_0x6176('0x24')](function(_0x555c34){return _0x555c34;});}return null;};}function removeEntity(_0x4acda6,_0x51a8f0){return function(_0x91d641){if(_0x91d641){return _0x91d641['destroy']()[_0x6176('0x24')](function(){_0x4acda6[_0x6176('0x1a')](0xcc)[_0x6176('0x1b')]();});}};}function handleEntityNotFound(_0x412157,_0x2ad7f0){return function(_0x2f21b7){if(!_0x2f21b7){_0x412157[_0x6176('0x19')](0x194);}return _0x2f21b7;};}function handleError(_0x2fd716,_0x408d3b){_0x408d3b=_0x408d3b||0x1f4;return function(_0x240a38){logger[_0x6176('0x25')](_0x240a38['stack']);if(_0x240a38[_0x6176('0x26')]){delete _0x240a38[_0x6176('0x26')];}_0x2fd716[_0x6176('0x1a')](_0x408d3b)[_0x6176('0x27')](_0x240a38);};}exports['index']=function(_0x56c733,_0x5c0bb){var _0x7ded52={},_0x1d6a15={},_0x412516={'count':0x0,'rows':[]};var _0x3ae756=_[_0x6176('0x28')](db[_0x6176('0x29')][_0x6176('0x2a')],function(_0x5407fa){return{'name':_0x5407fa['fieldName'],'type':_0x5407fa[_0x6176('0x2b')][_0x6176('0x2c')]};});_0x1d6a15['model']=_[_0x6176('0x28')](_0x3ae756,_0x6176('0x26'));_0x1d6a15[_0x6176('0x2d')]=_['keys'](_0x56c733['query']);_0x1d6a15[_0x6176('0x2e')]=_[_0x6176('0x2f')](_0x1d6a15[_0x6176('0x30')],_0x1d6a15[_0x6176('0x2d')]);_0x7ded52[_0x6176('0x31')]=_['intersection'](_0x1d6a15[_0x6176('0x30')],qs[_0x6176('0x32')](_0x56c733[_0x6176('0x2d')][_0x6176('0x32')]));_0x7ded52[_0x6176('0x31')]=_0x7ded52[_0x6176('0x31')][_0x6176('0x33')]?_0x7ded52['attributes']:_0x1d6a15['model'];if(!_0x56c733[_0x6176('0x2d')][_0x6176('0x34')](_0x6176('0x35'))){_0x7ded52[_0x6176('0x1e')]=qs[_0x6176('0x1e')](_0x56c733[_0x6176('0x2d')][_0x6176('0x1e')]);_0x7ded52[_0x6176('0x1c')]=qs[_0x6176('0x1c')](_0x56c733['query'][_0x6176('0x1c')]);}_0x7ded52['order']=qs[_0x6176('0x36')](_0x56c733['query'][_0x6176('0x36')]);_0x7ded52[_0x6176('0x37')]=qs['filters'](_['pick'](_0x56c733['query'],_0x1d6a15['filters']),_0x3ae756);if(_0x56c733[_0x6176('0x2d')][_0x6176('0x38')]){_0x7ded52[_0x6176('0x37')]=_[_0x6176('0x39')](_0x7ded52[_0x6176('0x37')],{'$or':_['map'](_0x3ae756,function(_0x278047){if(_0x278047[_0x6176('0x2b')]!==_0x6176('0x3a')){var _0x36912e={};_0x36912e[_0x278047[_0x6176('0x26')]]={'$like':'%'+_0x56c733[_0x6176('0x2d')]['filter']+'%'};return _0x36912e;}})});}_0x7ded52=_[_0x6176('0x39')]({},_0x7ded52,_0x56c733[_0x6176('0x3b')]);var _0x2434a3={'where':_0x7ded52[_0x6176('0x37')]};return db['SmsApplication'][_0x6176('0x1f')](_0x2434a3)[_0x6176('0x24')](function(_0x351927){_0x412516[_0x6176('0x1f')]=_0x351927;if(_0x56c733[_0x6176('0x2d')][_0x6176('0x3c')]){_0x7ded52['include']=[{'all':!![]}];}return db['SmsApplication'][_0x6176('0x3d')](_0x7ded52);})[_0x6176('0x24')](function(_0x88f26e){_0x412516[_0x6176('0x3e')]=_0x88f26e;return _0x412516;})[_0x6176('0x24')](respondWithFilteredResult(_0x5c0bb,_0x7ded52))[_0x6176('0x3f')](handleError(_0x5c0bb,null));};exports[_0x6176('0x40')]=function(_0x4a8c85,_0x446fb5){var _0x4cb68b={'raw':!![],'where':{'id':_0x4a8c85[_0x6176('0x41')]['id']}},_0x43f1a9={};_0x43f1a9[_0x6176('0x30')]=_['keys'](db[_0x6176('0x29')][_0x6176('0x2a')]);_0x43f1a9[_0x6176('0x2d')]=_[_0x6176('0x42')](_0x4a8c85[_0x6176('0x2d')]);_0x43f1a9['filters']=_[_0x6176('0x2f')](_0x43f1a9['model'],_0x43f1a9[_0x6176('0x2d')]);_0x4cb68b['attributes']=_[_0x6176('0x2f')](_0x43f1a9['model'],qs[_0x6176('0x32')](_0x4a8c85[_0x6176('0x2d')]['fields']));_0x4cb68b['attributes']=_0x4cb68b[_0x6176('0x31')][_0x6176('0x33')]?_0x4cb68b[_0x6176('0x31')]:_0x43f1a9[_0x6176('0x30')];if(_0x4a8c85[_0x6176('0x2d')][_0x6176('0x3c')]){_0x4cb68b[_0x6176('0x43')]=[{'all':!![]}];}_0x4cb68b=_['merge']({},_0x4cb68b,_0x4a8c85[_0x6176('0x3b')]);return db['SmsApplication'][_0x6176('0x44')](_0x4cb68b)['then'](handleEntityNotFound(_0x446fb5,null))[_0x6176('0x24')](respondWithResult(_0x446fb5,null))[_0x6176('0x3f')](handleError(_0x446fb5,null));};exports['create']=function(_0x18d27e,_0x487dd9){return db[_0x6176('0x29')][_0x6176('0x45')](_0x18d27e[_0x6176('0x46')],{})['then'](respondWithResult(_0x487dd9,0xc9))[_0x6176('0x3f')](handleError(_0x487dd9,null));};exports[_0x6176('0x47')]=function(_0xbf4aa7,_0x15a18f){if(_0xbf4aa7['body']['id']){delete _0xbf4aa7[_0x6176('0x46')]['id'];}return db[_0x6176('0x29')][_0x6176('0x44')]({'where':{'id':_0xbf4aa7[_0x6176('0x41')]['id']}})['then'](handleEntityNotFound(_0x15a18f,null))[_0x6176('0x24')](saveUpdates(_0xbf4aa7[_0x6176('0x46')],null))[_0x6176('0x24')](respondWithResult(_0x15a18f,null))[_0x6176('0x3f')](handleError(_0x15a18f,null));};exports[_0x6176('0x48')]=function(_0x183c30,_0x4f1cfc){return db[_0x6176('0x29')]['find']({'where':{'id':_0x183c30['params']['id']}})['then'](handleEntityNotFound(_0x4f1cfc,null))[_0x6176('0x24')](removeEntity(_0x4f1cfc,null))['catch'](handleError(_0x4f1cfc,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 5ae3c27..5c0f8b2 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 _0xcfa6=['api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x572673,_0x425300){var _0x545583=function(_0x49a2f2){while(--_0x49a2f2){_0x572673['push'](_0x572673['shift']());}};_0x545583(++_0x425300);}(_0xcfa6,0xcf));var _0x6cfa=function(_0x549ed3,_0x2f93b6){_0x549ed3=_0x549ed3-0x0;var _0x430546=_0xcfa6[_0x549ed3];return _0x430546;};'use strict';var _=require(_0x6cfa('0x0'));var util=require(_0x6cfa('0x1'));var logger=require(_0x6cfa('0x2'))(_0x6cfa('0x3'));var moment=require(_0x6cfa('0x4'));var BPromise=require('bluebird');var rp=require(_0x6cfa('0x5'));var fs=require('fs');var path=require(_0x6cfa('0x6'));var rimraf=require(_0x6cfa('0x7'));var config=require(_0x6cfa('0x8'));var attributes=require(_0x6cfa('0x9'));module[_0x6cfa('0xa')]=function(_0x412db4,_0x145ba3){return _0x412db4[_0x6cfa('0xb')](_0x6cfa('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6cfa('0xd')});}; \ No newline at end of file +var _0xe8d3=['api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','lodash','util'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xe8d3,0x9a));var _0x3e8d=function(_0x1872c1,_0x325e84){_0x1872c1=_0x1872c1-0x0;var _0x2c40e3=_0xe8d3[_0x1872c1];return _0x2c40e3;};'use strict';var _=require(_0x3e8d('0x0'));var util=require(_0x3e8d('0x1'));var logger=require('../../config/logger')(_0x3e8d('0x2'));var moment=require(_0x3e8d('0x3'));var BPromise=require(_0x3e8d('0x4'));var rp=require(_0x3e8d('0x5'));var fs=require('fs');var path=require(_0x3e8d('0x6'));var rimraf=require(_0x3e8d('0x7'));var config=require('../../config/environment');var attributes=require(_0x3e8d('0x8'));module[_0x3e8d('0x9')]=function(_0x3a2fce,_0xd961b7){return _0x3a2fce[_0x3e8d('0xa')]('SmsApplication',attributes,{'tableName':_0x3e8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e8d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f3415dc..b582bc3 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 _0x4c50=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x5a8215,_0x34f4c2){var _0x543b35=function(_0x3f2952){while(--_0x3f2952){_0x5a8215['push'](_0x5a8215['shift']());}};_0x543b35(++_0x34f4c2);}(_0x4c50,0x10f));var _0x04c5=function(_0x1c8a5b,_0x20118b){_0x1c8a5b=_0x1c8a5b-0x0;var _0x274cd0=_0x4c50[_0x1c8a5b];return _0x274cd0;};'use strict';var _=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var moment=require(_0x04c5('0x2'));var BPromise=require(_0x04c5('0x3'));var rs=require(_0x04c5('0x4'));var fs=require('fs');var Redis=require(_0x04c5('0x5'));var db=require(_0x04c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x04c5('0x7'));var config=require(_0x04c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c5('0x9')][_0x04c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22535c,_0x34961a,_0x1fb2db){return new BPromise(function(_0x40a846,_0x411e7f){return client[_0x04c5('0xb')](_0x22535c,_0x1fb2db)['then'](function(_0x4ebad1){logger['info'](_0x04c5('0xc'),_0x34961a,_0x04c5('0xd'));logger[_0x04c5('0xe')](_0x04c5('0xf'),_0x34961a,_0x04c5('0xd'),JSON[_0x04c5('0x10')](_0x4ebad1));if(_0x4ebad1[_0x04c5('0x11')]){if(_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x12')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x411e7f(_0x4ebad1['error'][_0x04c5('0x13')]);}logger[_0x04c5('0x11')](_0x04c5('0xc'),_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x40a846(_0x4ebad1['error']['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x34961a,'request\x20sent');_0x40a846(_0x4ebad1[_0x04c5('0x14')]['message']);}})['catch'](function(_0x1ee3a0){logger[_0x04c5('0x11')]('SmsApplication,\x20%s,\x20%s',_0x34961a,_0x1ee3a0);_0x411e7f(_0x1ee3a0);});});} \ No newline at end of file +var _0xda81=['then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x162167,_0x52203f){var _0x13fda6=function(_0x47848e){while(--_0x47848e){_0x162167['push'](_0x162167['shift']());}};_0x13fda6(++_0x52203f);}(_0xda81,0x1c3));var _0x1da8=function(_0x461675,_0x203a06){_0x461675=_0x461675-0x0;var _0x436eca=_0xda81[_0x461675];return _0x436eca;};'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')]('SmsApplication,\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')]('SmsApplication,\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/smsInteraction/index.js b/server/api/smsInteraction/index.js index bba626a..9751f7e 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 _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x2f1d2f,_0x527d85){var _0x2874cf=function(_0x3203df){while(--_0x3203df){_0x2f1d2f['push'](_0x2f1d2f['shift']());}};_0x2874cf(++_0x527d85);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x1eba[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file +var _0x1775=['/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['post']('/',auth[_0x5177('0xb')](),controller[_0x5177('0x14')]);router[_0x5177('0x15')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0x15')](_0x5177('0x18'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1b')),controller[_0x5177('0x1c')]);router[_0x5177('0x1d')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1e')),controller['update']);router[_0x5177('0x1f')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')]('sms',_0x5177('0x20')),controller[_0x5177('0x21')]);router[_0x5177('0x1f')]('/:id/tags',auth[_0x5177('0xb')](),controller['removeTags']);module[_0x5177('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index bb7e630..6617a0d 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 _0x0f89=['BOOLEAN','sequelize','moment','exports','DATE','STRING','out','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0f89,0x111));var _0x90f8=function(_0x2fb243,_0x2cc682){_0x2fb243=_0x2fb243-0x0;var _0x64d5d6=_0x0f89[_0x2fb243];return _0x64d5d6;};'use strict';var Sequelize=require(_0x90f8('0x0'));var moment=require(_0x90f8('0x1'));module[_0x90f8('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x90f8('0x3')]},'disposition':{'type':Sequelize[_0x90f8('0x4')]},'secondDisposition':{'type':Sequelize[_0x90f8('0x4')]},'thirdDisposition':{'type':Sequelize[_0x90f8('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x90f8('0x4')]},'read1stAt':{'type':Sequelize[_0x90f8('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x90f8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x90f8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x90f8('0x6')]('in',_0x90f8('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x90f8('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8e0f=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4cafb1,_0x2954df){var _0x5d0869=function(_0x43667a){while(--_0x43667a){_0x4cafb1['push'](_0x4cafb1['shift']());}};_0x5d0869(++_0x2954df);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x5ecb3a,_0xc4eac7){_0x5ecb3a=_0x5ecb3a-0x0;var _0x351a0f=_0x8e0f[_0x5ecb3a];return _0x351a0f;};'use strict';var Sequelize=require(_0xf8e0('0x0'));var moment=require(_0xf8e0('0x1'));module[_0xf8e0('0x2')]={'closed':{'type':Sequelize[_0xf8e0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf8e0('0x4')]},'disposition':{'type':Sequelize[_0xf8e0('0x5')]},'secondDisposition':{'type':Sequelize[_0xf8e0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf8e0('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf8e0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf8e0('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf8e0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf8e0('0x6')]('in',_0xf8e0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf8e0('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 850c61e..ad61ed4 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 _0xd7a3=['json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','stack','name','send','index','map','rawAttributes','type','key','getOptions','findAll','sms','query','user','show','params','model','SmsInteraction','keys','filters','intersection','fields','attributes','includeAll','include','options','find','catch','create','body','describe','addMessage','omit','ids','findOne','SmsMessage','length','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Account','Owner','get','Sms','fullname','N.A.','closed','closedAt','disposition','System','out','value','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status'];(function(_0x33e6df,_0x44edc4){var _0x3bd8a6=function(_0x507996){while(--_0x507996){_0x33e6df['push'](_0x33e6df['shift']());}};_0x3bd8a6(++_0x44edc4);}(_0xd7a3,0x6a));var _0x3d7a=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xd7a3[_0x21aec3];return _0x288bbc;};'use strict';var rimraf=require(_0x3d7a('0x0'));var zipdir=require(_0x3d7a('0x1'));var moment=require(_0x3d7a('0x2'));var BPromise=require(_0x3d7a('0x3'));var util=require(_0x3d7a('0x4'));var path=require(_0x3d7a('0x5'));var ejs=require(_0x3d7a('0x6'));var fs=require('fs');var _=require(_0x3d7a('0x7'));var Redis=require('ioredis');var interaction=require(_0x3d7a('0x8'));var qs=require(_0x3d7a('0x9'));var pdf=require(_0x3d7a('0xa'));var logger=require(_0x3d7a('0xb'))('api');var config=require(_0x3d7a('0xc'));var db=require(_0x3d7a('0xd'))['db'];config[_0x3d7a('0xe')]=_[_0x3d7a('0xf')](config['redis'],{'host':_0x3d7a('0x10'),'port':0x18eb});var socket=require(_0x3d7a('0x11'))(new Redis(config['redis']));require(_0x3d7a('0x12'))[_0x3d7a('0x13')](socket);function respondWithStatusCode(_0x1b0998,_0x409260){_0x409260=_0x409260||0xcc;return function(_0x2bcbc3){if(_0x2bcbc3){return _0x1b0998['sendStatus'](_0x409260);}return _0x1b0998[_0x3d7a('0x14')](_0x409260)['end']();};}function respondWithResult(_0x1fe6b3,_0x3e138c){_0x3e138c=_0x3e138c||0xc8;return function(_0x31cf48){if(_0x31cf48){return _0x1fe6b3[_0x3d7a('0x14')](_0x3e138c)[_0x3d7a('0x15')](_0x31cf48);}};}function respondWithFilteredResult(_0x38041e,_0x5802fc){return function(_0x183aba){if(_0x183aba){var _0x4a0ce6=typeof _0x5802fc[_0x3d7a('0x16')]===_0x3d7a('0x17')&&typeof _0x5802fc[_0x3d7a('0x18')]===_0x3d7a('0x17');var _0x30c251=_0x183aba[_0x3d7a('0x19')];var _0x330c27=_0x4a0ce6?0x0:_0x5802fc[_0x3d7a('0x16')];var _0x1b4f9d=_0x4a0ce6?_0x183aba[_0x3d7a('0x19')]:_0x5802fc[_0x3d7a('0x16')]+_0x5802fc['limit'];var _0x25fbd0;if(_0x1b4f9d>=_0x30c251){_0x1b4f9d=_0x30c251;_0x25fbd0=0xc8;}else{_0x25fbd0=0xce;}_0x38041e[_0x3d7a('0x14')](_0x25fbd0);return _0x38041e['set'](_0x3d7a('0x1a'),_0x330c27+'-'+_0x1b4f9d+'/'+_0x30c251)[_0x3d7a('0x15')](_0x183aba);}return null;};}function saveUpdates(_0x1d0d8b){return function(_0x505b99){if(_0x505b99){return _0x505b99[_0x3d7a('0x1b')](_0x1d0d8b)['then'](function(_0x5b6fa0){return _0x5b6fa0;});}return null;};}function removeEntity(_0x57855a){return function(_0x25c2c0){if(_0x25c2c0){return _0x25c2c0[_0x3d7a('0x1c')]()[_0x3d7a('0x1d')](function(){_0x57855a[_0x3d7a('0x14')](0xcc)[_0x3d7a('0x1e')]();});}};}function handleEntityNotFound(_0x17e74d){return function(_0x3f2099){if(!_0x3f2099){_0x17e74d['sendStatus'](0x194);}return _0x3f2099;};}function handleError(_0x53f469,_0x3b7d5a){_0x3b7d5a=_0x3b7d5a||0x1f4;return function(_0x175501){logger['error'](_0x175501[_0x3d7a('0x1f')]);if(_0x175501[_0x3d7a('0x20')]){delete _0x175501[_0x3d7a('0x20')];}_0x53f469[_0x3d7a('0x14')](_0x3b7d5a)[_0x3d7a('0x21')](_0x175501);};}exports[_0x3d7a('0x22')]=function(_0x5575eb,_0xa9db95){var _0x6f4b36={};var _0x186c3d=_[_0x3d7a('0x23')](db['SmsInteraction'][_0x3d7a('0x24')],function(_0x55e73e){return{'name':_0x55e73e['fieldName'],'type':_0x55e73e[_0x3d7a('0x25')][_0x3d7a('0x26')]};});_0x6f4b36=qs[_0x3d7a('0x27')](_0x186c3d,_0x5575eb);return interaction[_0x3d7a('0x28')](_0x3d7a('0x29'),_0x5575eb[_0x3d7a('0x2a')],_0x5575eb[_0x3d7a('0x2b')],_0x6f4b36,_0x186c3d)['then'](respondWithFilteredResult(_0xa9db95,_0x6f4b36))['catch'](handleError(_0xa9db95,null));};exports[_0x3d7a('0x2c')]=function(_0x544883,_0x3a85a2){var _0x4621bc={'raw':![],'where':{'id':_0x544883[_0x3d7a('0x2d')]['id']}},_0x21246a={};_0x21246a[_0x3d7a('0x2e')]=_['keys'](db[_0x3d7a('0x2f')][_0x3d7a('0x24')]);_0x21246a['query']=_[_0x3d7a('0x30')](_0x544883[_0x3d7a('0x2a')]);_0x21246a[_0x3d7a('0x31')]=_[_0x3d7a('0x32')](_0x21246a[_0x3d7a('0x2e')],_0x21246a['query']);_0x4621bc['attributes']=_[_0x3d7a('0x32')](_0x21246a[_0x3d7a('0x2e')],qs[_0x3d7a('0x33')](_0x544883[_0x3d7a('0x2a')][_0x3d7a('0x33')]));_0x4621bc[_0x3d7a('0x34')]=_0x4621bc[_0x3d7a('0x34')]['length']?_0x4621bc['attributes']:_0x21246a['model'];if(_0x544883[_0x3d7a('0x2a')][_0x3d7a('0x35')]){_0x4621bc[_0x3d7a('0x36')]=[{'all':!![]}];}_0x4621bc=_['merge']({},_0x4621bc,_0x544883[_0x3d7a('0x37')]);return db[_0x3d7a('0x2f')][_0x3d7a('0x38')](_0x4621bc)[_0x3d7a('0x1d')](handleEntityNotFound(_0x3a85a2,null))[_0x3d7a('0x1d')](respondWithResult(_0x3a85a2,null))[_0x3d7a('0x39')](handleError(_0x3a85a2,null));};exports[_0x3d7a('0x3a')]=function(_0x436c01,_0x2be50b){return db['SmsInteraction']['create'](_0x436c01[_0x3d7a('0x3b')],{})[_0x3d7a('0x1d')](respondWithResult(_0x2be50b,0xc9))['catch'](handleError(_0x2be50b,null));};exports[_0x3d7a('0x1b')]=function(_0x4a31cb,_0x7756f1){if(_0x4a31cb[_0x3d7a('0x3b')]['id']){delete _0x4a31cb['body']['id'];}return db['SmsInteraction'][_0x3d7a('0x38')]({'where':{'id':_0x4a31cb[_0x3d7a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x7756f1,null))[_0x3d7a('0x1d')](saveUpdates(_0x4a31cb[_0x3d7a('0x3b')],null))[_0x3d7a('0x1d')](respondWithResult(_0x7756f1,null))[_0x3d7a('0x39')](handleError(_0x7756f1,null));};exports[_0x3d7a('0x1c')]=function(_0x4c230c,_0x5daf7e){return db[_0x3d7a('0x2f')][_0x3d7a('0x38')]({'where':{'id':_0x4c230c['params']['id']}})[_0x3d7a('0x1d')](handleEntityNotFound(_0x5daf7e,null))['then'](removeEntity(_0x5daf7e,null))[_0x3d7a('0x39')](handleError(_0x5daf7e,null));};exports[_0x3d7a('0x3c')]=function(_0x1b100d,_0x27f741){return db[_0x3d7a('0x2f')][_0x3d7a('0x3c')]()[_0x3d7a('0x1d')](respondWithResult(_0x27f741,null))[_0x3d7a('0x39')](handleError(_0x27f741,null));};exports[_0x3d7a('0x3d')]=function(_0x119263,_0x42f363){return db['SmsMessage']['find']({'where':{'id':_0x119263[_0x3d7a('0x2d')]['id']}})[_0x3d7a('0x1d')](handleEntityNotFound(_0x42f363,null))[_0x3d7a('0x1d')](function(_0x5e02d2){if(_0x5e02d2){return _0x5e02d2[_0x3d7a('0x3d')](_0x119263['body']['ids'],_[_0x3d7a('0x3e')](_0x119263[_0x3d7a('0x3b')],[_0x3d7a('0x3f'),'id'])||{});}})[_0x3d7a('0x1d')](respondWithResult(_0x42f363,null))[_0x3d7a('0x39')](handleError(_0x42f363,null));};exports['getMessages']=function(_0x1da710,_0x34e420){var _0x971ec8={'raw':![],'where':{}};var _0x2a25d7={};var _0x1988ea={'count':0x0,'rows':[]};return db[_0x3d7a('0x2f')][_0x3d7a('0x40')]({'where':{'id':_0x1da710[_0x3d7a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x34e420,null))[_0x3d7a('0x1d')](function(_0x1f915f){if(_0x1f915f){_0x2a25d7[_0x3d7a('0x2e')]=_[_0x3d7a('0x30')](db[_0x3d7a('0x41')]['rawAttributes']);_0x2a25d7[_0x3d7a('0x2a')]=_['keys'](_0x1da710[_0x3d7a('0x2a')]);_0x2a25d7[_0x3d7a('0x31')]=_[_0x3d7a('0x32')](_0x2a25d7[_0x3d7a('0x2e')],_0x2a25d7[_0x3d7a('0x2a')]);_0x971ec8[_0x3d7a('0x34')]=_['intersection'](_0x2a25d7[_0x3d7a('0x2e')],qs[_0x3d7a('0x33')](_0x1da710[_0x3d7a('0x2a')][_0x3d7a('0x33')]));_0x971ec8['attributes']=_0x971ec8[_0x3d7a('0x34')][_0x3d7a('0x42')]?_0x971ec8['attributes']:_0x2a25d7[_0x3d7a('0x2e')];if(!_0x1da710[_0x3d7a('0x2a')]['hasOwnProperty'](_0x3d7a('0x43'))){_0x971ec8[_0x3d7a('0x18')]=qs[_0x3d7a('0x18')](_0x1da710['query'][_0x3d7a('0x18')]);_0x971ec8[_0x3d7a('0x16')]=qs[_0x3d7a('0x16')](_0x1da710['query']['offset']);}_0x971ec8['order']=qs['sort'](_0x1da710[_0x3d7a('0x2a')][_0x3d7a('0x44')]);_0x971ec8[_0x3d7a('0x45')]=qs[_0x3d7a('0x31')](_[_0x3d7a('0x46')](_0x1da710[_0x3d7a('0x2a')],_0x2a25d7[_0x3d7a('0x31')]));_0x971ec8[_0x3d7a('0x45')][_0x3d7a('0x47')]=_0x1f915f['id'];if(_0x1da710[_0x3d7a('0x2a')][_0x3d7a('0x48')]){_0x971ec8[_0x3d7a('0x45')]=_['merge'](_0x971ec8[_0x3d7a('0x45')],{'$or':_['map'](_0x971ec8[_0x3d7a('0x34')],function(_0x226313){var _0x2bbc6a={};_0x2bbc6a[_0x226313]={'$like':'%'+_0x1da710['query'][_0x3d7a('0x48')]+'%'};return _0x2bbc6a;})});}if(_0x1da710['query'][_0x3d7a('0x49')]){var _0x2a8b42=_0x1da710['query'][_0x3d7a('0x49')][_0x3d7a('0x4a')](',');var _0x317b4a={};_0x317b4a[_0x2a8b42[0x0]]={'$gte':moment(_0x2a8b42[0x1])['format'](_0x3d7a('0x4b'))};_0x971ec8['where']=_[_0x3d7a('0x4c')](_0x971ec8[_0x3d7a('0x45')],_0x317b4a);}_0x971ec8=_[_0x3d7a('0x4c')]({},_0x971ec8,_0x1da710['options']);return db['SmsMessage'][_0x3d7a('0x19')]({'where':_0x971ec8[_0x3d7a('0x45')]})['then'](function(_0x3d1797){_0x1988ea[_0x3d7a('0x19')]=_0x3d1797;if(_0x1da710['query']['includeAll']){_0x971ec8[_0x3d7a('0x36')]=[{'all':!![]}];}return db['SmsMessage'][_0x3d7a('0x28')](_0x971ec8);})[_0x3d7a('0x1d')](function(_0x4a381a){_0x1988ea[_0x3d7a('0x4d')]=_0x4a381a;return _0x1988ea;});}})['then'](respondWithFilteredResult(_0x34e420,_0x971ec8))[_0x3d7a('0x39')](handleError(_0x34e420,null));};exports[_0x3d7a('0x4e')]=function(_0x5236a4,_0x16c791){return db[_0x3d7a('0x2f')][_0x3d7a('0x38')]({'where':{'id':_0x5236a4['params']['id']}})['then'](handleEntityNotFound(_0x16c791,null))[_0x3d7a('0x1d')](function(_0xc3d3ce){if(_0xc3d3ce){return _0xc3d3ce[_0x3d7a('0x4f')](_0x5236a4['body'][_0x3d7a('0x3f')],_[_0x3d7a('0x3e')](_0x5236a4['body'],[_0x3d7a('0x3f'),'id'])||{})[_0x3d7a('0x50')](function(){return db[_0x3d7a('0x51')][_0x3d7a('0x28')]({'attributes':['id','name',_0x3d7a('0x52')],'where':{'id':_0x5236a4[_0x3d7a('0x3b')]['ids']}});})[_0x3d7a('0x1d')](function(_0x36b91a){socket[_0x3d7a('0x53')](_0x3d7a('0x54'),{'id':Number(_0x5236a4['params']['id']),'tags':_0x36b91a||[]});return{'id':Number(_0x5236a4[_0x3d7a('0x2d')]['id']),'tags':_0x36b91a||[]};});}})[_0x3d7a('0x1d')](respondWithResult(_0x16c791,null))[_0x3d7a('0x39')](handleError(_0x16c791,null));};exports['removeTags']=function(_0x46132d,_0x18942f){return db[_0x3d7a('0x2f')][_0x3d7a('0x38')]({'where':{'id':_0x46132d[_0x3d7a('0x2d')]['id']}})['then'](handleEntityNotFound(_0x18942f,null))[_0x3d7a('0x1d')](function(_0x357c75){if(_0x357c75){return _0x357c75[_0x3d7a('0x55')](_0x46132d[_0x3d7a('0x2a')][_0x3d7a('0x3f')]);}})[_0x3d7a('0x1d')](respondWithStatusCode(_0x18942f,null))['catch'](handleError(_0x18942f,null));};exports[_0x3d7a('0x56')]=function(_0x2da4b1,_0x44ad74){var _0x1a1774=moment()[_0x3d7a('0x57')]()[_0x3d7a('0x58')]();var _0x28147b=path[_0x3d7a('0x59')](config[_0x3d7a('0x5a')],_0x3d7a('0x5b'),_0x3d7a('0x5c'),_0x3d7a('0x5d'));var _0x2542c7=path[_0x3d7a('0x59')](_0x28147b,_0x1a1774);var _0x3e2493=util[_0x3d7a('0x5e')](_0x3d7a('0x5f'),_0x2da4b1['params']['id'],_0x1a1774);var _0x5d3c94=path[_0x3d7a('0x59')](_0x28147b,_0x3e2493);var _0x235a36=[];_0x235a36[_0x3d7a('0x60')]({'model':db[_0x3d7a('0x61')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x235a36[_0x3d7a('0x60')]({'model':db[_0x3d7a('0x62')],'as':_0x3d7a('0x63'),'attributes':['id',_0x3d7a('0x64'),_0x3d7a('0x65')],'raw':!![]});var _0x1c68cc=[{'model':db['SmsMessage'],'as':_0x3d7a('0x66'),'attributes':['id',_0x3d7a('0x3b'),_0x3d7a('0x67'),_0x3d7a('0x68'),_0x3d7a('0x69'),_0x3d7a('0x6a')],'include':_0x235a36}];_0x1c68cc['push']({'model':db['SmsAccount'],'as':_0x3d7a('0x6b'),'attributes':['id',_0x3d7a('0x20')]});_0x1c68cc['push']({'model':db[_0x3d7a('0x61')],'as':_0x3d7a('0x6c'),'attributes':['id','fullname']});return db[_0x3d7a('0x2f')][_0x3d7a('0x38')]({'where':{'id':_0x2da4b1[_0x3d7a('0x2d')]['id']},'include':_0x1c68cc})['then'](handleEntityNotFound(_0x44ad74,null))[_0x3d7a('0x1d')](function(_0x3ff210){if(_0x3ff210){var _0x3aa08b=_0x3ff210[_0x3d7a('0x6d')]({'plain':!![]});fs['mkdirSync'](_0x2542c7);var _0x3e95ec={'channel':_0x3d7a('0x6e'),'account':_0x3aa08b[_0x3d7a('0x6b')][_0x3d7a('0x20')],'agent':_0x3aa08b[_0x3d7a('0x6c')]?_0x3aa08b[_0x3d7a('0x6c')][_0x3d7a('0x6f')]:_0x3d7a('0x70'),'createdAt':moment(_0x3aa08b['createdAt'])[_0x3d7a('0x5e')](_0x3d7a('0x4b'))[_0x3d7a('0x58')](),'closedAt':_0x3aa08b[_0x3d7a('0x71')]?moment(_0x3aa08b[_0x3d7a('0x72')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3d7a('0x58')]():'','disposition':_0x3aa08b[_0x3d7a('0x73')],'messages':_(_0x3aa08b[_0x3d7a('0x66')])[_0x3d7a('0x48')]({'secret':![]})[_0x3d7a('0x23')](function(_0x1bb3f3){return{'date':moment(_0x1bb3f3[_0x3d7a('0x67')])[_0x3d7a('0x5e')](_0x3d7a('0x4b'))[_0x3d7a('0x58')](),'sender':_0x1bb3f3[_0x3d7a('0x68')]==='out'?_0x1bb3f3[_0x3d7a('0x61')]?_0x1bb3f3[_0x3d7a('0x61')][_0x3d7a('0x6f')]:_0x3d7a('0x74'):_0x1bb3f3[_0x3d7a('0x63')][_0x3d7a('0x64')]+(_0x1bb3f3[_0x3d7a('0x63')][_0x3d7a('0x65')]?'\x20'+_0x1bb3f3[_0x3d7a('0x63')][_0x3d7a('0x65')]:''),'body':_0x1bb3f3[_0x3d7a('0x3b')],'direction':_0x1bb3f3[_0x3d7a('0x68')]===_0x3d7a('0x75')?'A':'C','secret':_0x1bb3f3[_0x3d7a('0x69')],'read':_0x1bb3f3[_0x3d7a('0x6a')]};})[_0x3d7a('0x76')]()};return ejs['renderFile'](path['join'](config['root'],_0x3d7a('0x5b'),_0x3d7a('0x77'),_0x3d7a('0x78')),{'interaction':_0x3e95ec})[_0x3d7a('0x1d')](function(_0x2b2900){var _0x2f9cdf=path[_0x3d7a('0x59')](_0x2542c7,_0x3d7a('0x79')+_0x3aa08b['id']+'-'+_0x1a1774+_0x3d7a('0x7a'));var _0xb5a4b2={'path':_0x2f9cdf,'channel':_0x3d7a('0x6e'),'interactionId':_0x3aa08b['id']};return pdf['createPdfFromHTML'](_0x2b2900,_0xb5a4b2);})[_0x3d7a('0x1d')](function(){return new BPromise(function(_0x3cb735,_0x6127df){zipdir(_0x2542c7,{'saveTo':_0x5d3c94},function(_0x49f062,_0xdb1e13){if(_0x49f062)return _0x6127df(_0x49f062);return _0x3cb735(_0xdb1e13);});})[_0x3d7a('0x1d')](function(){return new BPromise(function(_0x36b804,_0x3254b2){rimraf(_0x2542c7,function(_0x4b60be){if(_0x4b60be)_0x3254b2(_0x4b60be);return _0x36b804();});});})[_0x3d7a('0x1d')](function(){return _0x44ad74['download'](_0x5d3c94,_0x3e2493,function(_0x38d6aa){if(_0x38d6aa){console[_0x3d7a('0x7b')](_0x3d7a('0x7c'),_0x38d6aa);}else{fs[_0x3d7a('0x7d')](_0x5d3c94);}});});});}else{return _0x44ad74[_0x3d7a('0x7e')](0xc8);}})[_0x3d7a('0x39')](handleError(_0x44ad74,null));}; \ No newline at end of file +var _0xd363=['then','error','name','send','index','map','SmsInteraction','fieldName','type','key','getOptions','query','show','params','keys','filters','intersection','model','attributes','fields','options','catch','create','body','find','destroy','describe','addMessage','ids','omit','getMessages','SmsMessage','rawAttributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','setTags','spread','Tag','findAll','color','smsInteractionTags:save','removeTags','download','unix','toString','root','files','tmp','join','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','secret','read','push','SmsAccount','Owner','get','Sms','Account','N.A.','closed','disposition','out','direction','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update'];(function(_0x23bf47,_0x4b5d9a){var _0x568e5d=function(_0x9723b4){while(--_0x9723b4){_0x23bf47['push'](_0x23bf47['shift']());}};_0x568e5d(++_0x4b5d9a);}(_0xd363,0xdb));var _0x3d36=function(_0x380168,_0x40546c){_0x380168=_0x380168-0x0;var _0x12e86d=_0xd363[_0x380168];return _0x12e86d;};'use strict';var rimraf=require(_0x3d36('0x0'));var zipdir=require(_0x3d36('0x1'));var moment=require(_0x3d36('0x2'));var BPromise=require(_0x3d36('0x3'));var util=require(_0x3d36('0x4'));var path=require(_0x3d36('0x5'));var ejs=require(_0x3d36('0x6'));var fs=require('fs');var _=require(_0x3d36('0x7'));var Redis=require(_0x3d36('0x8'));var interaction=require(_0x3d36('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3d36('0xa'));var logger=require(_0x3d36('0xb'))(_0x3d36('0xc'));var config=require('../../config/environment');var db=require(_0x3d36('0xd'))['db'];config[_0x3d36('0xe')]=_[_0x3d36('0xf')](config[_0x3d36('0xe')],{'host':_0x3d36('0x10'),'port':0x18eb});var socket=require(_0x3d36('0x11'))(new Redis(config[_0x3d36('0xe')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x108f14,_0x340e74){_0x340e74=_0x340e74||0xcc;return function(_0x49edde){if(_0x49edde){return _0x108f14[_0x3d36('0x12')](_0x340e74);}return _0x108f14[_0x3d36('0x13')](_0x340e74)[_0x3d36('0x14')]();};}function respondWithResult(_0x518674,_0x5aa76c){_0x5aa76c=_0x5aa76c||0xc8;return function(_0x3a2364){if(_0x3a2364){return _0x518674[_0x3d36('0x13')](_0x5aa76c)[_0x3d36('0x15')](_0x3a2364);}};}function respondWithFilteredResult(_0x3fa61b,_0x570992){return function(_0x4c21ad){if(_0x4c21ad){var _0x5849c3=typeof _0x570992[_0x3d36('0x16')]==='undefined'&&typeof _0x570992[_0x3d36('0x17')]===_0x3d36('0x18');var _0x1c4d76=_0x4c21ad[_0x3d36('0x19')];var _0x2650f4=_0x5849c3?0x0:_0x570992[_0x3d36('0x16')];var _0x3b1709=_0x5849c3?_0x4c21ad['count']:_0x570992['offset']+_0x570992[_0x3d36('0x17')];var _0x13a787;if(_0x3b1709>=_0x1c4d76){_0x3b1709=_0x1c4d76;_0x13a787=0xc8;}else{_0x13a787=0xce;}_0x3fa61b['status'](_0x13a787);return _0x3fa61b[_0x3d36('0x1a')](_0x3d36('0x1b'),_0x2650f4+'-'+_0x3b1709+'/'+_0x1c4d76)[_0x3d36('0x15')](_0x4c21ad);}return null;};}function saveUpdates(_0x376cde){return function(_0x581f11){if(_0x581f11){return _0x581f11[_0x3d36('0x1c')](_0x376cde)[_0x3d36('0x1d')](function(_0x15d939){return _0x15d939;});}return null;};}function removeEntity(_0x506261){return function(_0x37adb4){if(_0x37adb4){return _0x37adb4['destroy']()['then'](function(){_0x506261['status'](0xcc)[_0x3d36('0x14')]();});}};}function handleEntityNotFound(_0x2bf6e2){return function(_0x3addf4){if(!_0x3addf4){_0x2bf6e2[_0x3d36('0x12')](0x194);}return _0x3addf4;};}function handleError(_0x5dee08,_0x107aa6){_0x107aa6=_0x107aa6||0x1f4;return function(_0x561b6c){logger[_0x3d36('0x1e')](_0x561b6c['stack']);if(_0x561b6c[_0x3d36('0x1f')]){delete _0x561b6c['name'];}_0x5dee08[_0x3d36('0x13')](_0x107aa6)[_0x3d36('0x20')](_0x561b6c);};}exports[_0x3d36('0x21')]=function(_0x55e173,_0x3ff06b){var _0x150ba0={};var _0x10ff3c=_[_0x3d36('0x22')](db[_0x3d36('0x23')]['rawAttributes'],function(_0xcb1a5){return{'name':_0xcb1a5[_0x3d36('0x24')],'type':_0xcb1a5[_0x3d36('0x25')][_0x3d36('0x26')]};});_0x150ba0=qs[_0x3d36('0x27')](_0x10ff3c,_0x55e173);return interaction['findAll']('sms',_0x55e173[_0x3d36('0x28')],_0x55e173['user'],_0x150ba0,_0x10ff3c)[_0x3d36('0x1d')](respondWithFilteredResult(_0x3ff06b,_0x150ba0))['catch'](handleError(_0x3ff06b,null));};exports[_0x3d36('0x29')]=function(_0x3f46e5,_0x4e53cf){var _0x37a859={'raw':![],'where':{'id':_0x3f46e5[_0x3d36('0x2a')]['id']}},_0xbe5712={};_0xbe5712['model']=_[_0x3d36('0x2b')](db[_0x3d36('0x23')]['rawAttributes']);_0xbe5712[_0x3d36('0x28')]=_['keys'](_0x3f46e5[_0x3d36('0x28')]);_0xbe5712[_0x3d36('0x2c')]=_[_0x3d36('0x2d')](_0xbe5712[_0x3d36('0x2e')],_0xbe5712['query']);_0x37a859[_0x3d36('0x2f')]=_['intersection'](_0xbe5712[_0x3d36('0x2e')],qs[_0x3d36('0x30')](_0x3f46e5[_0x3d36('0x28')][_0x3d36('0x30')]));_0x37a859[_0x3d36('0x2f')]=_0x37a859['attributes']['length']?_0x37a859[_0x3d36('0x2f')]:_0xbe5712[_0x3d36('0x2e')];if(_0x3f46e5[_0x3d36('0x28')]['includeAll']){_0x37a859['include']=[{'all':!![]}];}_0x37a859=_['merge']({},_0x37a859,_0x3f46e5[_0x3d36('0x31')]);return db[_0x3d36('0x23')]['find'](_0x37a859)[_0x3d36('0x1d')](handleEntityNotFound(_0x4e53cf,null))['then'](respondWithResult(_0x4e53cf,null))[_0x3d36('0x32')](handleError(_0x4e53cf,null));};exports[_0x3d36('0x33')]=function(_0x17f968,_0x5cd440){return db[_0x3d36('0x23')]['create'](_0x17f968[_0x3d36('0x34')],{})[_0x3d36('0x1d')](respondWithResult(_0x5cd440,0xc9))[_0x3d36('0x32')](handleError(_0x5cd440,null));};exports[_0x3d36('0x1c')]=function(_0x36a5b9,_0x226431){if(_0x36a5b9['body']['id']){delete _0x36a5b9['body']['id'];}return db[_0x3d36('0x23')][_0x3d36('0x35')]({'where':{'id':_0x36a5b9[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x226431,null))[_0x3d36('0x1d')](saveUpdates(_0x36a5b9['body'],null))['then'](respondWithResult(_0x226431,null))[_0x3d36('0x32')](handleError(_0x226431,null));};exports[_0x3d36('0x36')]=function(_0x2c2546,_0x36f31a){return db[_0x3d36('0x23')][_0x3d36('0x35')]({'where':{'id':_0x2c2546['params']['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x36f31a,null))['then'](removeEntity(_0x36f31a,null))['catch'](handleError(_0x36f31a,null));};exports['describe']=function(_0x5b3193,_0x29be92){return db['SmsInteraction'][_0x3d36('0x37')]()[_0x3d36('0x1d')](respondWithResult(_0x29be92,null))['catch'](handleError(_0x29be92,null));};exports[_0x3d36('0x38')]=function(_0x5b93f0,_0x4b6c26){return db['SmsMessage'][_0x3d36('0x35')]({'where':{'id':_0x5b93f0[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x4b6c26,null))[_0x3d36('0x1d')](function(_0x3102bc){if(_0x3102bc){return _0x3102bc['addMessage'](_0x5b93f0[_0x3d36('0x34')][_0x3d36('0x39')],_[_0x3d36('0x3a')](_0x5b93f0[_0x3d36('0x34')],['ids','id'])||{});}})[_0x3d36('0x1d')](respondWithResult(_0x4b6c26,null))['catch'](handleError(_0x4b6c26,null));};exports[_0x3d36('0x3b')]=function(_0x11f872,_0x6dfc62){var _0xe1d90c={'raw':![],'where':{}};var _0x540a7b={};var _0x1affc7={'count':0x0,'rows':[]};return db[_0x3d36('0x23')]['findOne']({'where':{'id':_0x11f872[_0x3d36('0x2a')]['id']}})['then'](handleEntityNotFound(_0x6dfc62,null))['then'](function(_0x5b0292){if(_0x5b0292){_0x540a7b['model']=_[_0x3d36('0x2b')](db[_0x3d36('0x3c')][_0x3d36('0x3d')]);_0x540a7b[_0x3d36('0x28')]=_[_0x3d36('0x2b')](_0x11f872[_0x3d36('0x28')]);_0x540a7b['filters']=_[_0x3d36('0x2d')](_0x540a7b[_0x3d36('0x2e')],_0x540a7b[_0x3d36('0x28')]);_0xe1d90c['attributes']=_[_0x3d36('0x2d')](_0x540a7b['model'],qs['fields'](_0x11f872[_0x3d36('0x28')][_0x3d36('0x30')]));_0xe1d90c[_0x3d36('0x2f')]=_0xe1d90c[_0x3d36('0x2f')][_0x3d36('0x3e')]?_0xe1d90c[_0x3d36('0x2f')]:_0x540a7b[_0x3d36('0x2e')];if(!_0x11f872['query'][_0x3d36('0x3f')](_0x3d36('0x40'))){_0xe1d90c['limit']=qs[_0x3d36('0x17')](_0x11f872[_0x3d36('0x28')][_0x3d36('0x17')]);_0xe1d90c[_0x3d36('0x16')]=qs[_0x3d36('0x16')](_0x11f872[_0x3d36('0x28')][_0x3d36('0x16')]);}_0xe1d90c[_0x3d36('0x41')]=qs[_0x3d36('0x42')](_0x11f872['query'][_0x3d36('0x42')]);_0xe1d90c[_0x3d36('0x43')]=qs[_0x3d36('0x2c')](_[_0x3d36('0x44')](_0x11f872[_0x3d36('0x28')],_0x540a7b[_0x3d36('0x2c')]));_0xe1d90c['where']['SmsInteractionId']=_0x5b0292['id'];if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x45')]){_0xe1d90c['where']=_[_0x3d36('0x46')](_0xe1d90c[_0x3d36('0x43')],{'$or':_[_0x3d36('0x22')](_0xe1d90c[_0x3d36('0x2f')],function(_0x1a1647){var _0x46a848={};_0x46a848[_0x1a1647]={'$like':'%'+_0x11f872[_0x3d36('0x28')]['filter']+'%'};return _0x46a848;})});}if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x47')]){var _0x55cd2d=_0x11f872[_0x3d36('0x28')][_0x3d36('0x47')][_0x3d36('0x48')](',');var _0x1d0ae7={};_0x1d0ae7[_0x55cd2d[0x0]]={'$gte':moment(_0x55cd2d[0x1])[_0x3d36('0x49')](_0x3d36('0x4a'))};_0xe1d90c[_0x3d36('0x43')]=_[_0x3d36('0x46')](_0xe1d90c[_0x3d36('0x43')],_0x1d0ae7);}_0xe1d90c=_[_0x3d36('0x46')]({},_0xe1d90c,_0x11f872[_0x3d36('0x31')]);return db[_0x3d36('0x3c')]['count']({'where':_0xe1d90c[_0x3d36('0x43')]})['then'](function(_0x4d1e4a){_0x1affc7[_0x3d36('0x19')]=_0x4d1e4a;if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x4b')]){_0xe1d90c[_0x3d36('0x4c')]=[{'all':!![]}];}return db[_0x3d36('0x3c')]['findAll'](_0xe1d90c);})[_0x3d36('0x1d')](function(_0x3136d9){_0x1affc7[_0x3d36('0x4d')]=_0x3136d9;return _0x1affc7;});}})[_0x3d36('0x1d')](respondWithFilteredResult(_0x6dfc62,_0xe1d90c))[_0x3d36('0x32')](handleError(_0x6dfc62,null));};exports['addTags']=function(_0x5737b9,_0x5d1046){return db['SmsInteraction']['find']({'where':{'id':_0x5737b9['params']['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x5d1046,null))[_0x3d36('0x1d')](function(_0x4e506a){if(_0x4e506a){return _0x4e506a[_0x3d36('0x4e')](_0x5737b9['body'][_0x3d36('0x39')],_[_0x3d36('0x3a')](_0x5737b9[_0x3d36('0x34')],[_0x3d36('0x39'),'id'])||{})[_0x3d36('0x4f')](function(){return db[_0x3d36('0x50')][_0x3d36('0x51')]({'attributes':['id',_0x3d36('0x1f'),_0x3d36('0x52')],'where':{'id':_0x5737b9[_0x3d36('0x34')][_0x3d36('0x39')]}});})[_0x3d36('0x1d')](function(_0xccc5d0){socket['emit'](_0x3d36('0x53'),{'id':Number(_0x5737b9[_0x3d36('0x2a')]['id']),'tags':_0xccc5d0||[]});return{'id':Number(_0x5737b9[_0x3d36('0x2a')]['id']),'tags':_0xccc5d0||[]};});}})[_0x3d36('0x1d')](respondWithResult(_0x5d1046,null))[_0x3d36('0x32')](handleError(_0x5d1046,null));};exports[_0x3d36('0x54')]=function(_0x10e9a0,_0xf1387c){return db['SmsInteraction']['find']({'where':{'id':_0x10e9a0[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0xf1387c,null))[_0x3d36('0x1d')](function(_0x3877a4){if(_0x3877a4){return _0x3877a4[_0x3d36('0x54')](_0x10e9a0['query']['ids']);}})[_0x3d36('0x1d')](respondWithStatusCode(_0xf1387c,null))[_0x3d36('0x32')](handleError(_0xf1387c,null));};exports[_0x3d36('0x55')]=function(_0xefa4c6,_0x3e5e88){var _0x36c2ab=moment()[_0x3d36('0x56')]()[_0x3d36('0x57')]();var _0x44f350=path['join'](config[_0x3d36('0x58')],'server',_0x3d36('0x59'),_0x3d36('0x5a'));var _0x3aecad=path[_0x3d36('0x5b')](_0x44f350,_0x36c2ab);var _0x537a49=util['format'](_0x3d36('0x5c'),_0xefa4c6['params']['id'],_0x36c2ab);var _0x20299d=path['join'](_0x44f350,_0x537a49);var _0x4e810d=[];_0x4e810d['push']({'model':db[_0x3d36('0x5d')],'as':_0x3d36('0x5d'),'attributes':['id',_0x3d36('0x5e')],'raw':!![]});_0x4e810d['push']({'model':db[_0x3d36('0x5f')],'as':_0x3d36('0x60'),'attributes':['id',_0x3d36('0x61'),_0x3d36('0x62')],'raw':!![]});var _0x215b4f=[{'model':db[_0x3d36('0x3c')],'as':_0x3d36('0x63'),'attributes':['id',_0x3d36('0x34'),_0x3d36('0x64'),'direction',_0x3d36('0x65'),_0x3d36('0x66')],'include':_0x4e810d}];_0x215b4f[_0x3d36('0x67')]({'model':db[_0x3d36('0x68')],'as':'Account','attributes':['id',_0x3d36('0x1f')]});_0x215b4f[_0x3d36('0x67')]({'model':db['User'],'as':_0x3d36('0x69'),'attributes':['id',_0x3d36('0x5e')]});return db['SmsInteraction'][_0x3d36('0x35')]({'where':{'id':_0xefa4c6['params']['id']},'include':_0x215b4f})[_0x3d36('0x1d')](handleEntityNotFound(_0x3e5e88,null))[_0x3d36('0x1d')](function(_0x23fc66){if(_0x23fc66){var _0x517818=_0x23fc66[_0x3d36('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x3aecad);var _0x3da5a5={'channel':_0x3d36('0x6b'),'account':_0x517818[_0x3d36('0x6c')][_0x3d36('0x1f')],'agent':_0x517818['Owner']?_0x517818[_0x3d36('0x69')][_0x3d36('0x5e')]:_0x3d36('0x6d'),'createdAt':moment(_0x517818[_0x3d36('0x64')])[_0x3d36('0x49')](_0x3d36('0x4a'))[_0x3d36('0x57')](),'closedAt':_0x517818[_0x3d36('0x6e')]?moment(_0x517818['closedAt'])[_0x3d36('0x49')](_0x3d36('0x4a'))['toString']():'','disposition':_0x517818[_0x3d36('0x6f')],'messages':_(_0x517818[_0x3d36('0x63')])[_0x3d36('0x45')]({'secret':![]})[_0x3d36('0x22')](function(_0x525da9){return{'date':moment(_0x525da9[_0x3d36('0x64')])[_0x3d36('0x49')](_0x3d36('0x4a'))[_0x3d36('0x57')](),'sender':_0x525da9['direction']===_0x3d36('0x70')?_0x525da9['User']?_0x525da9[_0x3d36('0x5d')][_0x3d36('0x5e')]:'System':_0x525da9[_0x3d36('0x60')]['firstName']+(_0x525da9[_0x3d36('0x60')][_0x3d36('0x62')]?'\x20'+_0x525da9[_0x3d36('0x60')]['lastName']:''),'body':_0x525da9[_0x3d36('0x34')],'direction':_0x525da9[_0x3d36('0x71')]===_0x3d36('0x70')?'A':'C','secret':_0x525da9['secret'],'read':_0x525da9[_0x3d36('0x66')]};})[_0x3d36('0x72')]()};return ejs[_0x3d36('0x73')](path[_0x3d36('0x5b')](config[_0x3d36('0x58')],_0x3d36('0x74'),_0x3d36('0x75'),_0x3d36('0x76')),{'interaction':_0x3da5a5})['then'](function(_0x13cce3){var _0x54e2e3=path[_0x3d36('0x5b')](_0x3aecad,_0x3d36('0x77')+_0x517818['id']+'-'+_0x36c2ab+_0x3d36('0x78'));var _0x20c542={'path':_0x54e2e3,'channel':'Sms','interactionId':_0x517818['id']};return pdf[_0x3d36('0x79')](_0x13cce3,_0x20c542);})[_0x3d36('0x1d')](function(){return new BPromise(function(_0x2e07a5,_0x24ebd0){zipdir(_0x3aecad,{'saveTo':_0x20299d},function(_0x486d39,_0x42da7f){if(_0x486d39)return _0x24ebd0(_0x486d39);return _0x2e07a5(_0x42da7f);});})[_0x3d36('0x1d')](function(){return new BPromise(function(_0x30bff8,_0x2dcf51){rimraf(_0x3aecad,function(_0x1144d5){if(_0x1144d5)_0x2dcf51(_0x1144d5);return _0x30bff8();});});})[_0x3d36('0x1d')](function(){return _0x3e5e88[_0x3d36('0x55')](_0x20299d,_0x537a49,function(_0x5d884e){if(_0x5d884e){console[_0x3d36('0x7a')]('err',_0x5d884e);}else{fs[_0x3d36('0x7b')](_0x20299d);}});});});}else{return _0x3e5e88[_0x3d36('0x12')](0xc8);}})[_0x3d36('0x32')](handleError(_0x3e5e88,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index c4ebac2..2a7dc58 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 _0xe511=['Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','getUsers','then'];(function(_0x2f889b,_0x5c4abc){var _0x12492f=function(_0x367580){while(--_0x367580){_0x2f889b['push'](_0x2f889b['shift']());}};_0x12492f(++_0x5c4abc);}(_0xe511,0x16f));var _0x1e51=function(_0x543341,_0x25271a){_0x543341=_0x543341-0x0;var _0x59362b=_0xe511[_0x543341];return _0x59362b;};'use strict';var EventEmitter=require(_0x1e51('0x0'));var SmsInteraction=require(_0x1e51('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x1e51('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1e51('0x2')](0x0);var events={'afterCreate':_0x1e51('0x3'),'afterUpdate':'update','afterDestroy':_0x1e51('0x4')};function emitEvent(_0x2be2b7){return function(_0x204da7,_0x16ec99,_0x480cca){_0x204da7[_0x1e51('0x5')]({'attributes':['id'],'raw':!![]})[_0x1e51('0x6')](function(_0x5c4590){_0x204da7['setDataValue'](_0x1e51('0x7'),_0x5c4590[_0x1e51('0x8')](function(_0x4fa8a9){return{'id':_0x4fa8a9['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x204da7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e51('0x6')](function(_0x2712e0){_0x204da7[_0x1e51('0x9')](_0x1e51('0xa'),_0x2712e0[_0x1e51('0xb')]);SmsInteractionEvents[_0x1e51('0xc')](_0x2be2b7+':'+_0x204da7['id'],_0x204da7);SmsInteractionEvents['emit'](_0x2be2b7,_0x204da7);_0x480cca(null);})[_0x1e51('0xd')](_0x480cca(null));};}for(var e in events){if(events[_0x1e51('0xe')](e)){var event=events[e];SmsInteraction[_0x1e51('0xf')](e,emitEvent(event));}}module[_0x1e51('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0xd914=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages'];(function(_0x2af2f1,_0x367db3){var _0x7677fc=function(_0x8367e9){while(--_0x8367e9){_0x2af2f1['push'](_0x2af2f1['shift']());}};_0x7677fc(++_0x367db3);}(_0xd914,0x17f));var _0x4d91=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0xd914[_0x3f8a03];return _0x147fb2;};'use strict';var EventEmitter=require(_0x4d91('0x0'));var SmsInteraction=require(_0x4d91('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4d91('0x1'))['db'][_0x4d91('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4d91('0x3')](0x0);var events={'afterCreate':_0x4d91('0x4'),'afterUpdate':_0x4d91('0x5'),'afterDestroy':_0x4d91('0x6')};function emitEvent(_0x4875a2){return function(_0x1b256e,_0x5d8af4,_0x3ab6f8){_0x1b256e[_0x4d91('0x7')]({'attributes':['id'],'raw':!![]})[_0x4d91('0x8')](function(_0x27c0d5){_0x1b256e[_0x4d91('0x9')](_0x4d91('0xa'),_0x27c0d5[_0x4d91('0xb')](function(_0x2a3ca1){return{'id':_0x2a3ca1['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x1b256e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4d91('0x8')](function(_0xa4bb25){_0x1b256e[_0x4d91('0x9')](_0x4d91('0xc'),_0xa4bb25[_0x4d91('0xd')]);SmsInteractionEvents[_0x4d91('0xe')](_0x4875a2+':'+_0x1b256e['id'],_0x1b256e);SmsInteractionEvents['emit'](_0x4875a2,_0x1b256e);_0x3ab6f8(null);})['catch'](_0x3ab6f8(null));};}for(var e in events){if(events[_0x4d91('0xf')](e)){var event=events[e];SmsInteraction[_0x4d91('0x10')](e,emitEvent(event));}}module[_0x4d91('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index d0eca31..772dbfb 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 _0x7692=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2cbd58,_0x278e75){var _0x42ef2a=function(_0x4d2ceb){while(--_0x4d2ceb){_0x2cbd58['push'](_0x2cbd58['shift']());}};_0x42ef2a(++_0x278e75);}(_0x7692,0x69));var _0x2769=function(_0x3ba9ec,_0x49c244){_0x3ba9ec=_0x3ba9ec-0x0;var _0x39f681=_0x7692[_0x3ba9ec];return _0x39f681;};'use strict';var _=require(_0x2769('0x0'));var util=require(_0x2769('0x1'));var logger=require(_0x2769('0x2'))(_0x2769('0x3'));var moment=require(_0x2769('0x4'));var BPromise=require(_0x2769('0x5'));var rp=require(_0x2769('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2769('0x7'));var attributes=require(_0x2769('0x8'));module[_0x2769('0x9')]=function(_0x26f0cf,_0x364a32){return _0x26f0cf[_0x2769('0xa')](_0x2769('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cc2f9,_0x1b55ab,_0x14952e){if(_0x2cc2f9['changed'](_0x2769('0xc'))){_0x2cc2f9[_0x2769('0xd')]=moment()[_0x2769('0xe')](_0x2769('0xf'));}_0x14952e(null,_0x2cc2f9);}}});}; \ No newline at end of file +var _0xef99=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47d841,_0x36ad89){var _0x13348a=function(_0x25ba88){while(--_0x25ba88){_0x47d841['push'](_0x47d841['shift']());}};_0x13348a(++_0x36ad89);}(_0xef99,0xd1));var _0x9ef9=function(_0x3eaa48,_0x5d3e94){_0x3eaa48=_0x3eaa48-0x0;var _0x1a9ab5=_0xef99[_0x3eaa48];return _0x1a9ab5;};'use strict';var _=require(_0x9ef9('0x0'));var util=require(_0x9ef9('0x1'));var logger=require(_0x9ef9('0x2'))(_0x9ef9('0x3'));var moment=require(_0x9ef9('0x4'));var BPromise=require(_0x9ef9('0x5'));var rp=require(_0x9ef9('0x6'));var fs=require('fs');var path=require(_0x9ef9('0x7'));var rimraf=require(_0x9ef9('0x8'));var config=require(_0x9ef9('0x9'));var attributes=require(_0x9ef9('0xa'));module[_0x9ef9('0xb')]=function(_0x504719,_0x54e9e6){return _0x504719[_0x9ef9('0xc')](_0x9ef9('0xd'),attributes,{'tableName':_0x9ef9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2dd721,_0x47b5c5,_0x4fa033){if(_0x2dd721[_0x9ef9('0xf')](_0x9ef9('0x10'))){_0x2dd721[_0x9ef9('0x11')]=moment()['format'](_0x9ef9('0x12'));}_0x4fa033(null,_0x2dd721);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a4175c2..50b7696 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 _0xd3ce=['catch','UpdateSmsInteraction','SmsInteraction','raw','options','where','limit','AddTagsToSmsInteraction','find','addTags','body','omit','ids','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x9eb6c0,_0x4a1995){var _0x2a4010=function(_0x305652){while(--_0x305652){_0x9eb6c0['push'](_0x9eb6c0['shift']());}};_0x2a4010(++_0x4a1995);}(_0xd3ce,0x1bc));var _0xed3c=function(_0x46ca48,_0x3a6501){_0x46ca48=_0x46ca48-0x0;var _0x2e69f1=_0xd3ce[_0x46ca48];return _0x2e69f1;};'use strict';var _=require(_0xed3c('0x0'));var util=require(_0xed3c('0x1'));var moment=require(_0xed3c('0x2'));var BPromise=require('bluebird');var rs=require(_0xed3c('0x3'));var fs=require('fs');var Redis=require(_0xed3c('0x4'));var db=require(_0xed3c('0x5'))['db'];var utils=require(_0xed3c('0x6'));var logger=require(_0xed3c('0x7'))(_0xed3c('0x8'));var config=require(_0xed3c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xed3c('0xa')][_0xed3c('0xb')]({'port':0x232a});config[_0xed3c('0xc')]=_[_0xed3c('0xd')](config['redis'],{'host':_0xed3c('0xe'),'port':0x18eb});var socket=require(_0xed3c('0xf'))(new Redis(config[_0xed3c('0xc')]));require(_0xed3c('0x10'))[_0xed3c('0x11')](socket);function respondWithRpcPromise(_0x6369d0,_0x214bcf,_0x47db99){return new BPromise(function(_0x358c60,_0x4d6781){return client['request'](_0x6369d0,_0x47db99)[_0xed3c('0x12')](function(_0x239a47){logger[_0xed3c('0x13')](_0xed3c('0x14'),_0x214bcf,'request\x20sent');logger[_0xed3c('0x15')](_0xed3c('0x16'),_0x214bcf,_0xed3c('0x17'),JSON[_0xed3c('0x18')](_0x239a47));if(_0x239a47[_0xed3c('0x19')]){if(_0x239a47[_0xed3c('0x19')][_0xed3c('0x1a')]===0x1f4){logger[_0xed3c('0x19')](_0xed3c('0x14'),_0x214bcf,_0x239a47[_0xed3c('0x19')][_0xed3c('0x1b')]);return _0x4d6781(_0x239a47['error'][_0xed3c('0x1b')]);}logger[_0xed3c('0x19')](_0xed3c('0x14'),_0x214bcf,_0x239a47[_0xed3c('0x19')]['message']);return _0x358c60(_0x239a47['error'][_0xed3c('0x1b')]);}else{logger[_0xed3c('0x13')](_0xed3c('0x14'),_0x214bcf,_0xed3c('0x17'));_0x358c60(_0x239a47[_0xed3c('0x1c')][_0xed3c('0x1b')]);}})[_0xed3c('0x1d')](function(_0x4175bc){logger[_0xed3c('0x19')](_0xed3c('0x14'),_0x214bcf,_0x4175bc);_0x4d6781(_0x4175bc);});});}exports[_0xed3c('0x1e')]=function(_0x12fc4e){var _0x301d30=this;return new Promise(function(_0x3de82a,_0x4aa0f2){return db[_0xed3c('0x1f')]['update'](_0x12fc4e['body'],{'raw':_0x12fc4e['options']?_0x12fc4e['options'][_0xed3c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12fc4e[_0xed3c('0x21')]?_0x12fc4e[_0xed3c('0x21')][_0xed3c('0x22')]||null:null,'attributes':_0x12fc4e[_0xed3c('0x21')]?_0x12fc4e[_0xed3c('0x21')]['attributes']||null:null,'limit':_0x12fc4e[_0xed3c('0x21')]?_0x12fc4e[_0xed3c('0x21')][_0xed3c('0x23')]||null:null})[_0xed3c('0x12')](function(_0x4d8923){logger['info'](_0xed3c('0x1e'),_0x12fc4e);logger[_0xed3c('0x15')]('UpdateSmsInteraction',_0x12fc4e,JSON['stringify'](_0x4d8923));_0x3de82a(_0x4d8923);})[_0xed3c('0x1d')](function(_0x22ab18){logger[_0xed3c('0x19')]('UpdateSmsInteraction',_0x22ab18['message'],_0x12fc4e);_0x4aa0f2(_0x301d30[_0xed3c('0x19')](0x1f4,_0x22ab18[_0xed3c('0x1b')]));});});};exports[_0xed3c('0x24')]=function(_0x30c23f){return new Promise(function(_0x497c85,_0x2bd3b8){return db['SmsInteraction'][_0xed3c('0x25')]({'where':_0x30c23f['options']?_0x30c23f['options'][_0xed3c('0x22')]||null:null})['then'](function(_0x288b5b){if(_0x288b5b){return _0x288b5b[_0xed3c('0x26')](_0x30c23f[_0xed3c('0x27')]['ids'],_[_0xed3c('0x28')](_0x30c23f[_0xed3c('0x27')],[_0xed3c('0x29'),'id'])||{});}})['spread'](function(_0xd4f45c){logger[_0xed3c('0x13')]('AddTags',_0x30c23f);logger['debug'](_0xed3c('0x2a'),_0x30c23f,JSON['stringify'](_0xd4f45c));_0x497c85(_0xd4f45c);})[_0xed3c('0x1d')](function(_0x111f76){logger[_0xed3c('0x19')](_0xed3c('0x2a'),_0x111f76[_0xed3c('0x1b')],_0x30c23f);_0x2bd3b8(_this[_0xed3c('0x19')](0x1f4,_0x111f76[_0xed3c('0x1b')]));});});}; \ No newline at end of file +var _0xd9f6=['request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','then','stringify','find','addTags','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info'];(function(_0x507c64,_0x5c7b96){var _0x2d83e1=function(_0xeec886){while(--_0xeec886){_0x507c64['push'](_0x507c64['shift']());}};_0x2d83e1(++_0x5c7b96);}(_0xd9f6,0xe0));var _0x6d9f=function(_0x4cd739,_0x1a8a12){_0x4cd739=_0x4cd739-0x0;var _0x1b163f=_0xd9f6[_0x4cd739];return _0x1b163f;};'use strict';var _=require(_0x6d9f('0x0'));var util=require('util');var moment=require(_0x6d9f('0x1'));var BPromise=require(_0x6d9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d9f('0x4'))('rpc');var config=require(_0x6d9f('0x5'));var jayson=require(_0x6d9f('0x6'));var client=jayson[_0x6d9f('0x7')][_0x6d9f('0x8')]({'port':0x232a});config[_0x6d9f('0x9')]=_['defaults'](config[_0x6d9f('0x9')],{'host':_0x6d9f('0xa'),'port':0x18eb});var socket=require(_0x6d9f('0xb'))(new Redis(config[_0x6d9f('0x9')]));require(_0x6d9f('0xc'))[_0x6d9f('0xd')](socket);function respondWithRpcPromise(_0x1fa002,_0x479215,_0x50fff6){return new BPromise(function(_0x212151,_0x2f70e5){return client[_0x6d9f('0xe')](_0x1fa002,_0x50fff6)['then'](function(_0x464355){logger[_0x6d9f('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x479215,_0x6d9f('0x10'));logger[_0x6d9f('0x11')](_0x6d9f('0x12'),_0x479215,_0x6d9f('0x10'),JSON['stringify'](_0x464355));if(_0x464355[_0x6d9f('0x13')]){if(_0x464355[_0x6d9f('0x13')][_0x6d9f('0x14')]===0x1f4){logger['error'](_0x6d9f('0x15'),_0x479215,_0x464355['error'][_0x6d9f('0x16')]);return _0x2f70e5(_0x464355[_0x6d9f('0x13')]['message']);}logger['error'](_0x6d9f('0x15'),_0x479215,_0x464355[_0x6d9f('0x13')][_0x6d9f('0x16')]);return _0x212151(_0x464355[_0x6d9f('0x13')][_0x6d9f('0x16')]);}else{logger['info'](_0x6d9f('0x15'),_0x479215,_0x6d9f('0x10'));_0x212151(_0x464355[_0x6d9f('0x17')][_0x6d9f('0x16')]);}})[_0x6d9f('0x18')](function(_0x1bf46d){logger[_0x6d9f('0x13')](_0x6d9f('0x15'),_0x479215,_0x1bf46d);_0x2f70e5(_0x1bf46d);});});}exports[_0x6d9f('0x19')]=function(_0xab94fb){var _0x120899=this;return new Promise(function(_0x4b676d,_0x28a26d){return db[_0x6d9f('0x1a')][_0x6d9f('0x1b')](_0xab94fb[_0x6d9f('0x1c')],{'raw':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb[_0x6d9f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab94fb['options']?_0xab94fb[_0x6d9f('0x1d')][_0x6d9f('0x1e')]||null:null,'attributes':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb['options'][_0x6d9f('0x1f')]||null:null,'limit':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb[_0x6d9f('0x1d')][_0x6d9f('0x20')]||null:null})[_0x6d9f('0x21')](function(_0x50f5b8){logger['info'](_0x6d9f('0x19'),_0xab94fb);logger[_0x6d9f('0x11')]('UpdateSmsInteraction',_0xab94fb,JSON[_0x6d9f('0x22')](_0x50f5b8));_0x4b676d(_0x50f5b8);})[_0x6d9f('0x18')](function(_0x4ce368){logger[_0x6d9f('0x13')](_0x6d9f('0x19'),_0x4ce368['message'],_0xab94fb);_0x28a26d(_0x120899[_0x6d9f('0x13')](0x1f4,_0x4ce368[_0x6d9f('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x184bff){return new Promise(function(_0x3b08e3,_0x24aa10){return db[_0x6d9f('0x1a')][_0x6d9f('0x23')]({'where':_0x184bff['options']?_0x184bff['options'][_0x6d9f('0x1e')]||null:null})['then'](function(_0x4d869f){if(_0x4d869f){return _0x4d869f[_0x6d9f('0x24')](_0x184bff[_0x6d9f('0x1c')]['ids'],_[_0x6d9f('0x25')](_0x184bff['body'],['ids','id'])||{});}})[_0x6d9f('0x26')](function(_0x4420a4){logger[_0x6d9f('0xf')](_0x6d9f('0x27'),_0x184bff);logger['debug'](_0x6d9f('0x27'),_0x184bff,JSON['stringify'](_0x4420a4));_0x3b08e3(_0x4420a4);})[_0x6d9f('0x18')](function(_0x5373a4){logger[_0x6d9f('0x13')](_0x6d9f('0x27'),_0x5373a4[_0x6d9f('0x16')],_0x184bff);_0x24aa10(_this[_0x6d9f('0x13')](0x1f4,_0x5373a4['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 3882d4f..2c64caf 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 _0x67cc=['register','length','smsInteraction:','./smsInteraction.events','remove','removeListener'];(function(_0x4c6ca0,_0x5dc48d){var _0x43335=function(_0x372504){while(--_0x372504){_0x4c6ca0['push'](_0x4c6ca0['shift']());}};_0x43335(++_0x5dc48d);}(_0x67cc,0x7b));var _0xc67c=function(_0x23fe4a,_0x5e6044){_0x23fe4a=_0x23fe4a-0x0;var _0x13ff94=_0x67cc[_0x23fe4a];return _0x13ff94;};'use strict';var SmsInteractionEvents=require(_0xc67c('0x0'));var events=['save',_0xc67c('0x1'),'update'];function createListener(_0x40cc8e,_0xba729b){return function(_0x3afae3){_0xba729b['emit'](_0x40cc8e,_0x3afae3);};}function removeListener(_0x42d26c,_0x24372d){return function(){SmsInteractionEvents[_0xc67c('0x2')](_0x42d26c,_0x24372d);};}exports[_0xc67c('0x3')]=function(_0x2bc01d){for(var _0x5f039a=0x0,_0x34c3b5=events[_0xc67c('0x4')];_0x5f039a<_0x34c3b5;_0x5f039a++){var _0x21e97d=events[_0x5f039a];var _0x16ecab=createListener(_0xc67c('0x5')+_0x21e97d,_0x2bc01d);SmsInteractionEvents['on'](_0x21e97d,_0x16ecab);}}; \ No newline at end of file +var _0x0dd2=['register','length','smsInteraction:','save','remove','update','emit'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0dd2,0xc7));var _0x20dd=function(_0x1a9b94,_0x4d763e){_0x1a9b94=_0x1a9b94-0x0;var _0x379102=_0x0dd2[_0x1a9b94];return _0x379102;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x20dd('0x0'),_0x20dd('0x1'),_0x20dd('0x2')];function createListener(_0x486c06,_0x3fc558){return function(_0x407276){_0x3fc558[_0x20dd('0x3')](_0x486c06,_0x407276);};}function removeListener(_0x32990d,_0x10bb23){return function(){SmsInteractionEvents['removeListener'](_0x32990d,_0x10bb23);};}exports[_0x20dd('0x4')]=function(_0x3d6549){for(var _0x490d52=0x0,_0x48174a=events[_0x20dd('0x5')];_0x490d52<_0x48174a;_0x490d52++){var _0x4331cb=events[_0x490d52];var _0xbd5ba9=createListener(_0x20dd('0x6')+_0x4331cb,_0x3d6549);SmsInteractionEvents['on'](_0x4331cb,_0xbd5ba9);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 731ce6e..2def893 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 _0x34ae=['/:id','show','post','tracked','sms','create','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','isAuthenticated','index','get'];(function(_0x3614c3,_0x1c5111){var _0x3830bd=function(_0x50f8d0){while(--_0x50f8d0){_0x3614c3['push'](_0x3614c3['shift']());}};_0x3830bd(++_0x1c5111);}(_0x34ae,0x185));var _0xe34a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34ae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe34a('0x0'));var path=require(_0xe34a('0x1'));var timeout=require(_0xe34a('0x2'));var express=require(_0xe34a('0x3'));var router=express[_0xe34a('0x4')]();var fs_extra=require(_0xe34a('0x5'));var auth=require(_0xe34a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe34a('0x7'));router['get']('/',auth[_0xe34a('0x8')](),controller[_0xe34a('0x9')]);router[_0xe34a('0xa')]('/describe',auth[_0xe34a('0x8')](),controller['describe']);router['get'](_0xe34a('0xb'),auth[_0xe34a('0x8')](),controller[_0xe34a('0xc')]);router[_0xe34a('0xd')]('/',auth['isAuthenticated'](),interaction[_0xe34a('0xe')](_0xe34a('0xf'),'smsmessage:create'),controller[_0xe34a('0x10')]);router[_0xe34a('0xd')](_0xe34a('0x11'),controller[_0xe34a('0x12')]);router[_0xe34a('0x13')](_0xe34a('0xb'),auth[_0xe34a('0x8')](),controller['update']);router['put']('/:id/accept',auth[_0xe34a('0x8')](),controller[_0xe34a('0x14')]);router[_0xe34a('0x13')](_0xe34a('0x15'),auth[_0xe34a('0x8')](),controller[_0xe34a('0x16')]);router[_0xe34a('0x17')](_0xe34a('0xb'),auth['isAuthenticated'](),controller[_0xe34a('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb34a=['tracked','sms','post','/:id/status','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x99f728,_0x1e6124){var _0x42e733=function(_0x144423){while(--_0x144423){_0x99f728['push'](_0x99f728['shift']());}};_0x42e733(++_0x1e6124);}(_0xb34a,0x1ce));var _0xab34=function(_0x439092,_0x224456){_0x439092=_0x439092-0x0;var _0x280b44=_0xb34a[_0x439092];return _0x280b44;};'use strict';var multer=require(_0xab34('0x0'));var util=require(_0xab34('0x1'));var path=require(_0xab34('0x2'));var timeout=require(_0xab34('0x3'));var express=require(_0xab34('0x4'));var router=express[_0xab34('0x5')]();var fs_extra=require(_0xab34('0x6'));var auth=require(_0xab34('0x7'));var interaction=require(_0xab34('0x8'));var config=require(_0xab34('0x9'));var controller=require(_0xab34('0xa'));router[_0xab34('0xb')]('/',auth[_0xab34('0xc')](),controller[_0xab34('0xd')]);router[_0xab34('0xb')](_0xab34('0xe'),auth[_0xab34('0xc')](),controller[_0xab34('0xf')]);router[_0xab34('0xb')](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x11')]);router['post']('/',auth[_0xab34('0xc')](),interaction[_0xab34('0x12')](_0xab34('0x13'),'smsmessage:create'),controller['create']);router[_0xab34('0x14')](_0xab34('0x15'),controller['status']);router['put'](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x16')]);router[_0xab34('0x17')](_0xab34('0x18'),auth[_0xab34('0xc')](),controller[_0xab34('0x19')]);router[_0xab34('0x17')]('/:id/reject',auth[_0xab34('0xc')](),controller[_0xab34('0x1a')]);router[_0xab34('0x1b')](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x1c')]);module[_0xab34('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d7445f9..06add92 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 _0x2d9e=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x3552b2,_0x4cfa41){var _0x296019=function(_0x4c83a6){while(--_0x4c83a6){_0x3552b2['push'](_0x3552b2['shift']());}};_0x296019(++_0x4cfa41);}(_0x2d9e,0x97));var _0xe2d9=function(_0x1d193b,_0x41de55){_0x1d193b=_0x1d193b-0x0;var _0x13eff6=_0x2d9e[_0x1d193b];return _0x13eff6;};'use strict';var Sequelize=require(_0xe2d9('0x0'));module['exports']={'body':{'type':Sequelize[_0xe2d9('0x1')](_0xe2d9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe2d9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe2d9('0x4')]('in',_0xe2d9('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe2d9('0x6')]},'secret':{'type':Sequelize[_0xe2d9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe2d9('0x7')]},'providerResponse':{'type':Sequelize[_0xe2d9('0x1')]}}; \ No newline at end of file +var _0x2aa0=['out','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x4c514a,_0x452eac){var _0x559a76=function(_0x2699e3){while(--_0x2699e3){_0x4c514a['push'](_0x4c514a['shift']());}};_0x559a76(++_0x452eac);}(_0x2aa0,0x6c));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x02aa('0x0'));module[_0x02aa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x02aa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x02aa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x02aa('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x02aa('0x5')](0xbe)},'phone':{'type':Sequelize[_0x02aa('0x5')]},'readAt':{'type':Sequelize[_0x02aa('0x6')]},'secret':{'type':Sequelize[_0x02aa('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x02aa('0x5')]},'providerResponse':{'type':Sequelize[_0x02aa('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 633ed3b..6c40f0c 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 _0xbd50=['internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','plivio','results','DELIVERED','zip-dir','request-promise','moment','bluebird','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsMessage','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','sms-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','get','SmsInteraction','isNil','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email'];(function(_0x579cc8,_0x69ad26){var _0x53a033=function(_0x55c1b4){while(--_0x55c1b4){_0x579cc8['push'](_0x579cc8['shift']());}};_0x53a033(++_0x69ad26);}(_0xbd50,0x151));var _0x0bd5=function(_0x46ecde,_0x226160){_0x46ecde=_0x46ecde-0x0;var _0x2dce7e=_0xbd50[_0x46ecde];return _0x2dce7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bd5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require(_0x0bd5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0bd5('0x4'));var sox=require(_0x0bd5('0x5'));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(_0x0bd5('0x6'));var crypto=require(_0x0bd5('0x7'));var jsforce=require(_0x0bd5('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0x9'));var querystring=require(_0x0bd5('0xa'));var Papa=require(_0x0bd5('0xb'));var Redis=require(_0x0bd5('0xc'));var authService=require(_0x0bd5('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0bd5('0xe'));var hardwareService=require(_0x0bd5('0xf'));var logger=require(_0x0bd5('0x10'))(_0x0bd5('0x11'));var utils=require(_0x0bd5('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0bd5('0x13'));var db=require(_0x0bd5('0x14'))['db'];config[_0x0bd5('0x15')]=_[_0x0bd5('0x16')](config[_0x0bd5('0x15')],{'host':_0x0bd5('0x17'),'port':0x18eb});var socket=require(_0x0bd5('0x18'))(new Redis(config[_0x0bd5('0x15')]));require(_0x0bd5('0x19'))[_0x0bd5('0x1a')](socket);var jayson=require(_0x0bd5('0x1b'));var client=jayson[_0x0bd5('0x1c')][_0x0bd5('0x1d')]({'port':0x232c});var client9002=jayson[_0x0bd5('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x473c9e,_0x131ee5,_0x3f8ebf,_0x29999e){return new BPromise(function(_0x5457f5,_0x1e1368){var _0x1b73b3=_0x29999e||client;return _0x1b73b3[_0x0bd5('0x1e')](_0x473c9e,_0x3f8ebf)[_0x0bd5('0x1f')](function(_0x5d2223){logger[_0x0bd5('0x20')](_0x0bd5('0x21'),_0x131ee5,_0x0bd5('0x22'));logger[_0x0bd5('0x23')](_0x0bd5('0x24'),_0x131ee5,_0x0bd5('0x22'),JSON[_0x0bd5('0x25')](_0x5d2223));if(_0x5d2223[_0x0bd5('0x26')]){if(_0x5d2223[_0x0bd5('0x26')][_0x0bd5('0x27')]===0x1f4){logger['error'](_0x0bd5('0x21'),_0x131ee5,_0x5d2223[_0x0bd5('0x26')][_0x0bd5('0x28')]);return _0x1e1368(_0x5d2223['error'][_0x0bd5('0x28')]);}logger[_0x0bd5('0x26')](_0x0bd5('0x21'),_0x131ee5,_0x5d2223[_0x0bd5('0x26')]['message']);return _0x5457f5(_0x5d2223['error'][_0x0bd5('0x28')]);}else{logger[_0x0bd5('0x20')](_0x0bd5('0x21'),_0x131ee5,_0x0bd5('0x22'));_0x5457f5(_0x5d2223[_0x0bd5('0x29')][_0x0bd5('0x28')]);}})['catch'](function(_0x3f6d0b){logger[_0x0bd5('0x26')](_0x0bd5('0x21'),_0x131ee5,_0x3f6d0b);_0x1e1368(_0x3f6d0b);});});}function respondWithStatusCode(_0x49eb35,_0xdbb5d2){_0xdbb5d2=_0xdbb5d2||0xcc;return function(_0x373dd7){if(_0x373dd7){return _0x49eb35['sendStatus'](_0xdbb5d2);}return _0x49eb35[_0x0bd5('0x2a')](_0xdbb5d2)[_0x0bd5('0x2b')]();};}function respondWithResult(_0x2480c8,_0x7faa52){_0x7faa52=_0x7faa52||0xc8;return function(_0x5722f3){if(_0x5722f3){return _0x2480c8[_0x0bd5('0x2a')](_0x7faa52)['json'](_0x5722f3);}};}function respondWithFilteredResult(_0x3d8b19,_0x3c03ec){return function(_0x35d29f){if(_0x35d29f){var _0xe95c45=typeof _0x3c03ec['offset']===_0x0bd5('0x2c')&&typeof _0x3c03ec[_0x0bd5('0x2d')]==='undefined';var _0x466898=_0x35d29f[_0x0bd5('0x2e')];var _0x373e42=_0xe95c45?0x0:_0x3c03ec[_0x0bd5('0x2f')];var _0x16d993=_0xe95c45?_0x35d29f[_0x0bd5('0x2e')]:_0x3c03ec[_0x0bd5('0x2f')]+_0x3c03ec[_0x0bd5('0x2d')];var _0x4249eb;if(_0x16d993>=_0x466898){_0x16d993=_0x466898;_0x4249eb=0xc8;}else{_0x4249eb=0xce;}_0x3d8b19[_0x0bd5('0x2a')](_0x4249eb);return _0x3d8b19[_0x0bd5('0x30')](_0x0bd5('0x31'),_0x373e42+'-'+_0x16d993+'/'+_0x466898)[_0x0bd5('0x32')](_0x35d29f);}return null;};}function patchUpdates(_0x55f80a){return function(_0x77c8d9){try{jsonpatch[_0x0bd5('0x33')](_0x77c8d9,_0x55f80a,!![]);}catch(_0x17696e){return BPromise['reject'](_0x17696e);}return _0x77c8d9[_0x0bd5('0x34')]();};}function saveUpdates(_0x348af4,_0x427863){return function(_0xeea77e){if(_0xeea77e){return _0xeea77e[_0x0bd5('0x35')](_0x348af4)[_0x0bd5('0x1f')](function(_0x2a1549){return _0x2a1549;});}return null;};}function removeEntity(_0x35f0e6,_0x5a0ec0){return function(_0x503832){if(_0x503832){return _0x503832['destroy']()[_0x0bd5('0x1f')](function(){_0x35f0e6[_0x0bd5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a0833,_0x2faea1){return function(_0x3309c7){if(!_0x3309c7){_0x8a0833['sendStatus'](0x194);}return _0x3309c7;};}function handleError(_0x1941d3,_0x19d293){_0x19d293=_0x19d293||0x1f4;return function(_0x2c80bd){logger['error'](_0x2c80bd['stack']);if(_0x2c80bd[_0x0bd5('0x36')]){delete _0x2c80bd['name'];}_0x1941d3['status'](_0x19d293)[_0x0bd5('0x37')](_0x2c80bd);};}exports[_0x0bd5('0x38')]=function(_0x6f78dc,_0x49b0b3){var _0x55c845={},_0xdda468={},_0x38dffb={'count':0x0,'rows':[]};var _0x481911=_[_0x0bd5('0x39')](db['SmsMessage'][_0x0bd5('0x3a')],function(_0x38c15b){return{'name':_0x38c15b[_0x0bd5('0x3b')],'type':_0x38c15b[_0x0bd5('0x3c')][_0x0bd5('0x3d')]};});_0xdda468[_0x0bd5('0x3e')]=_[_0x0bd5('0x39')](_0x481911,_0x0bd5('0x36'));_0xdda468[_0x0bd5('0x3f')]=_[_0x0bd5('0x40')](_0x6f78dc[_0x0bd5('0x3f')]);_0xdda468[_0x0bd5('0x41')]=_[_0x0bd5('0x42')](_0xdda468[_0x0bd5('0x3e')],_0xdda468['query']);_0x55c845[_0x0bd5('0x43')]=_[_0x0bd5('0x42')](_0xdda468[_0x0bd5('0x3e')],qs['fields'](_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x44')]));_0x55c845[_0x0bd5('0x43')]=_0x55c845['attributes'][_0x0bd5('0x45')]?_0x55c845['attributes']:_0xdda468[_0x0bd5('0x3e')];if(!_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x46')](_0x0bd5('0x47'))){_0x55c845['limit']=qs[_0x0bd5('0x2d')](_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x2d')]);_0x55c845[_0x0bd5('0x2f')]=qs[_0x0bd5('0x2f')](_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x2f')]);}_0x55c845[_0x0bd5('0x48')]=qs[_0x0bd5('0x49')](_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x49')]);_0x55c845[_0x0bd5('0x4a')]=qs[_0x0bd5('0x41')](_[_0x0bd5('0x4b')](_0x6f78dc[_0x0bd5('0x3f')],_0xdda468[_0x0bd5('0x41')]),_0x481911);if(_0x6f78dc[_0x0bd5('0x3f')]['filter']){_0x55c845[_0x0bd5('0x4a')]=_[_0x0bd5('0x4c')](_0x55c845['where'],{'$or':_[_0x0bd5('0x39')](_0x481911,function(_0x2cb266){if(_0x2cb266[_0x0bd5('0x3c')]!==_0x0bd5('0x4d')){var _0x2a7b9f={};_0x2a7b9f[_0x2cb266[_0x0bd5('0x36')]]={'$like':'%'+_0x6f78dc[_0x0bd5('0x3f')][_0x0bd5('0x4e')]+'%'};return _0x2a7b9f;}})});}_0x55c845=_[_0x0bd5('0x4c')]({},_0x55c845,_0x6f78dc[_0x0bd5('0x4f')]);var _0x4a622b={'where':_0x55c845[_0x0bd5('0x4a')]};return db['SmsMessage'][_0x0bd5('0x2e')](_0x4a622b)['then'](function(_0x3e8120){_0x38dffb[_0x0bd5('0x2e')]=_0x3e8120;if(_0x6f78dc[_0x0bd5('0x3f')]['includeAll']){_0x55c845['include']=[{'all':!![]}];}return db[_0x0bd5('0x50')]['findAll'](_0x55c845);})[_0x0bd5('0x1f')](function(_0x1a7f92){_0x38dffb[_0x0bd5('0x51')]=_0x1a7f92;return _0x38dffb;})[_0x0bd5('0x1f')](respondWithFilteredResult(_0x49b0b3,_0x55c845))[_0x0bd5('0x52')](handleError(_0x49b0b3,null));};exports[_0x0bd5('0x53')]=function(_0x426b81,_0x5d3e03){var _0xd25b63={'raw':!![],'where':{'id':_0x426b81[_0x0bd5('0x54')]['id']}},_0x352f8b={};_0x352f8b[_0x0bd5('0x3e')]=_[_0x0bd5('0x40')](db[_0x0bd5('0x50')][_0x0bd5('0x3a')]);_0x352f8b[_0x0bd5('0x3f')]=_[_0x0bd5('0x40')](_0x426b81[_0x0bd5('0x3f')]);_0x352f8b[_0x0bd5('0x41')]=_[_0x0bd5('0x42')](_0x352f8b['model'],_0x352f8b['query']);_0xd25b63[_0x0bd5('0x43')]=_[_0x0bd5('0x42')](_0x352f8b[_0x0bd5('0x3e')],qs['fields'](_0x426b81['query'][_0x0bd5('0x44')]));_0xd25b63['attributes']=_0xd25b63[_0x0bd5('0x43')][_0x0bd5('0x45')]?_0xd25b63[_0x0bd5('0x43')]:_0x352f8b['model'];if(_0x426b81[_0x0bd5('0x3f')][_0x0bd5('0x55')]){_0xd25b63[_0x0bd5('0x56')]=[{'all':!![]}];}_0xd25b63=_[_0x0bd5('0x4c')]({},_0xd25b63,_0x426b81[_0x0bd5('0x4f')]);return db['SmsMessage']['find'](_0xd25b63)[_0x0bd5('0x1f')](handleEntityNotFound(_0x5d3e03,null))[_0x0bd5('0x1f')](respondWithResult(_0x5d3e03,null))['catch'](handleError(_0x5d3e03,null));};exports[_0x0bd5('0x57')]=function(_0x2d9e31,_0x285ae3){return db[_0x0bd5('0x50')][_0x0bd5('0x57')](_0x2d9e31[_0x0bd5('0x58')],{})[_0x0bd5('0x1f')](respondWithResult(_0x285ae3,0xc9))[_0x0bd5('0x52')](handleError(_0x285ae3,null));};exports[_0x0bd5('0x35')]=function(_0x765b1e,_0x227774){if(_0x765b1e[_0x0bd5('0x58')]['id']){delete _0x765b1e[_0x0bd5('0x58')]['id'];}return db[_0x0bd5('0x50')][_0x0bd5('0x59')]({'where':{'id':_0x765b1e[_0x0bd5('0x54')]['id']}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x227774,null))[_0x0bd5('0x1f')](saveUpdates(_0x765b1e['body'],null))[_0x0bd5('0x1f')](respondWithResult(_0x227774,null))[_0x0bd5('0x52')](handleError(_0x227774,null));};exports[_0x0bd5('0x5a')]=function(_0x3e7442,_0x2674ec){return db['SmsMessage'][_0x0bd5('0x59')]({'where':{'id':_0x3e7442['params']['id']}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x2674ec,null))[_0x0bd5('0x1f')](removeEntity(_0x2674ec,null))['catch'](handleError(_0x2674ec,null));};exports[_0x0bd5('0x5b')]=function(_0x283136,_0x1f5604){return db[_0x0bd5('0x50')][_0x0bd5('0x5b')]()[_0x0bd5('0x1f')](respondWithResult(_0x1f5604,null))[_0x0bd5('0x52')](handleError(_0x1f5604,null));};var interaction_log=require('../../config/logger')(_0x0bd5('0x5c'));exports[_0x0bd5('0x5d')]=function(_0x15c5fb,_0xaffbec,_0x5f369d){var _0x5e1ee2={'agent':{},'channel':'sms'};if(_0x15c5fb['body']['id']){delete _0x15c5fb[_0x0bd5('0x58')]['id'];}_0x15c5fb[_0x0bd5('0x58')][_0x0bd5('0x5e')]=!![];_0x15c5fb['body'][_0x0bd5('0x5f')]=moment()['format'](_0x0bd5('0x60'));_0x15c5fb[_0x0bd5('0x58')]['UserId']=_0x15c5fb['body']['UserId']||_0x15c5fb['user']['id'];_0x5e1ee2[_0x0bd5('0x61')]['id']=_0x15c5fb[_0x0bd5('0x58')][_0x0bd5('0x62')];return db[_0x0bd5('0x50')][_0x0bd5('0x59')]({'where':{'id':_0x15c5fb['params']['id'],'UserId':null}})[_0x0bd5('0x1f')](handleEntityNotFound(_0xaffbec,null))['then'](saveUpdates(_0x15c5fb[_0x0bd5('0x58')],null))['then'](function(_0x3839c0){if(_0x3839c0){_0x5e1ee2[_0x0bd5('0x28')]=_0x3839c0[_0x0bd5('0x63')]({'plain':!![]});return db[_0x0bd5('0x64')][_0x0bd5('0x59')]({'where':{'id':_0x3839c0['SmsInteractionId']}});}return null;})[_0x0bd5('0x1f')](handleEntityNotFound(_0xaffbec,null))[_0x0bd5('0x1f')](function(_0x2b8bd0){if(_0x2b8bd0){return _0x2b8bd0[_0x0bd5('0x35')]({'UserId':_0x15c5fb[_0x0bd5('0x58')]['UserId'],'read1stAt':_[_0x0bd5('0x65')](_0x2b8bd0[_0x0bd5('0x66')])?moment()[_0x0bd5('0x67')](_0x0bd5('0x60')):undefined});}return null;})[_0x0bd5('0x1f')](function(_0x482c22){if(_0x482c22){_0x5e1ee2[_0x0bd5('0x68')]=_0x482c22['get']({'plain':!![]});interaction_log['info'](_0x0bd5('0x69'),_0x15c5fb[_0x0bd5('0x6a')]['id'],_0x15c5fb[_0x0bd5('0x6a')]['name'],_0x15c5fb[_0x0bd5('0x6a')][_0x0bd5('0x6b')],_0x5e1ee2[_0x0bd5('0x68')]['id'],_0x15c5fb[_0x0bd5('0x58')]?JSON['stringify'](_0x15c5fb[_0x0bd5('0x58')]):_0x0bd5('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x0bd5('0x6d'),_0x5e1ee2);}return null;})[_0x0bd5('0x1f')](function(_0x4b0f6f){var _0x3c55b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b0f6f[_0x0bd5('0x28')][_0x0bd5('0x6e')];return db[_0x0bd5('0x6f')][_0x0bd5('0x3f')](_0x3c55b3,{'type':db[_0x0bd5('0x70')][_0x0bd5('0x71')][_0x0bd5('0x72')],'raw':!![]})[_0x0bd5('0x1f')](function(_0xb5073c){return _0xb5073c;});})[_0x0bd5('0x1f')](function(_0x1ee709){if(_0x1ee709){_0x5e1ee2[_0x0bd5('0x28')][_0x0bd5('0x73')]=_0x1ee709[0x0];if(!_0x15c5fb[_0x0bd5('0x58')][_0x0bd5('0x62')])return;return db[_0x0bd5('0x74')][_0x0bd5('0x59')]({'where':{'id':_0x15c5fb[_0x0bd5('0x58')]['UserId'],'role':_0x0bd5('0x61')},'attributes':['id',_0x0bd5('0x36'),_0x0bd5('0x75'),_0x0bd5('0x76'),_0x0bd5('0x77')],'raw':!![]});}return null;})[_0x0bd5('0x1f')](function(_0x8e13d9){if(!_0x8e13d9)return null;_0x5e1ee2['message'][_0x0bd5('0x61')]=_0x8e13d9;return _0x5e1ee2;})[_0x0bd5('0x1f')](function(_0x5116bd){if(_0x5116bd){if(_0x15c5fb[_0x0bd5('0x58')][_0x0bd5('0x78')]){_0x5e1ee2['message'][_0x0bd5('0x79')]=util[_0x0bd5('0x67')](_0x0bd5('0x7a'),_0x15c5fb[_0x0bd5('0x6a')][_0x0bd5('0x36')]);_0x5e1ee2[_0x0bd5('0x28')][_0x0bd5('0x7b')]=_0x5e1ee2[_0x0bd5('0x7b')];_0x5e1ee2[_0x0bd5('0x28')][_0x0bd5('0x7c')]=_0x5e1ee2[_0x0bd5('0x7b')];_0x5e1ee2[_0x0bd5('0x28')]['event']=_0x0bd5('0x5d');return respondWithRpcPromise(_0x0bd5('0x7d'),_0x0bd5('0x7d'),{'event':_0x0bd5('0x7e'),'message':_0x5e1ee2[_0x0bd5('0x28')]},client9002)[_0x0bd5('0x1f')](function(){return _0x5e1ee2;});}return _0x5e1ee2;}return null;})[_0x0bd5('0x1f')](respondWithResult(_0xaffbec,null))[_0x0bd5('0x52')](handleError(_0xaffbec,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x0bd5('0x7f')]=function(_0x244b59,_0x5ec2b4,_0xa603d4){var _0x135694={'agent':{},'channel':_0x0bd5('0x80')};if(_0x244b59['body']['id']){delete _0x244b59[_0x0bd5('0x58')]['id'];}_0x244b59[_0x0bd5('0x58')][_0x0bd5('0x62')]=_0x244b59[_0x0bd5('0x58')][_0x0bd5('0x62')]||_0x244b59['user']['id'];_0x135694['agent']['id']=_0x244b59['body'][_0x0bd5('0x62')];return db['SmsMessage'][_0x0bd5('0x59')]({'where':{'id':_0x244b59[_0x0bd5('0x54')]['id'],'UserId':null}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x5ec2b4,null))[_0x0bd5('0x1f')](function(_0x588866){if(_0x588866){_0x135694[_0x0bd5('0x28')]=_0x588866['get']({'plain':!![]});return db[_0x0bd5('0x64')][_0x0bd5('0x59')]({'where':{'id':_0x588866[_0x0bd5('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x5ec2b4,null))['then'](function(_0x48a76a){if(_0x48a76a){_0x135694[_0x0bd5('0x68')]=_0x48a76a['get']({'plain':!![]});interaction_log['info'](_0x0bd5('0x82'),_0x244b59['user']['id'],_0x244b59[_0x0bd5('0x6a')]['name'],_0x244b59[_0x0bd5('0x6a')][_0x0bd5('0x6b')],_0x135694[_0x0bd5('0x68')]['id'],_0x244b59[_0x0bd5('0x58')]?JSON[_0x0bd5('0x25')](_0x244b59[_0x0bd5('0x58')]):_0x0bd5('0x6c'));return respondWithRpcPromise(_0x0bd5('0x83'),_0x0bd5('0x84'),_0x135694);}return null;})[_0x0bd5('0x1f')](function(_0x118358){var _0x10c332=_0x0bd5('0x85')+_0x118358['message'][_0x0bd5('0x6e')];return db[_0x0bd5('0x6f')][_0x0bd5('0x3f')](_0x10c332,{'type':db['Sequelize']['QueryTypes'][_0x0bd5('0x72')],'raw':!![]})[_0x0bd5('0x1f')](function(_0x18ccd2){return _0x18ccd2;});})[_0x0bd5('0x1f')](function(_0xbca213){if(_0xbca213){_0x135694[_0x0bd5('0x28')][_0x0bd5('0x73')]=_0xbca213[0x0];if(!_0x244b59[_0x0bd5('0x58')]['UserId'])return;return db[_0x0bd5('0x74')][_0x0bd5('0x59')]({'where':{'id':_0x244b59['body'][_0x0bd5('0x62')],'role':_0x0bd5('0x61')},'attributes':['id',_0x0bd5('0x36'),'fullname',_0x0bd5('0x76'),_0x0bd5('0x77')],'raw':!![]});}return null;})[_0x0bd5('0x1f')](function(_0x1eac09){if(!_0x1eac09)return null;_0x135694['message']['agent']=_0x1eac09;return _0x135694;})[_0x0bd5('0x1f')](function(_0x1aa901){if(_0x1aa901){_0x1aa901[_0x0bd5('0x28')]['interface']=util[_0x0bd5('0x67')]('SIP/%s',_0x244b59['user'][_0x0bd5('0x36')]);_0x1aa901['message'][_0x0bd5('0x7b')]=_0x135694[_0x0bd5('0x7b')];_0x1aa901[_0x0bd5('0x28')][_0x0bd5('0x7c')]=_0x135694[_0x0bd5('0x7b')];_0x1aa901[_0x0bd5('0x28')][_0x0bd5('0x86')]=_0x0bd5('0x7f');respondWithRpcPromise(_0x0bd5('0x7d'),_0x0bd5('0x7d'),{'event':_0x0bd5('0x87'),'message':_0x1aa901[_0x0bd5('0x28')]},client9002);return _0x135694;}return null;})[_0x0bd5('0x1f')](respondWithResult(_0x5ec2b4,null))['catch'](handleError(_0x5ec2b4,null));};exports[_0x0bd5('0x2a')]=function(_0x4f5bd4,_0x4bdc5e,_0x4a095f){if(_0x4f5bd4[_0x0bd5('0x58')]['id']){delete _0x4f5bd4[_0x0bd5('0x58')]['id'];}var _0x24e550;return db[_0x0bd5('0x50')][_0x0bd5('0x59')]({'where':{'id':_0x4f5bd4[_0x0bd5('0x54')]['id']}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x4bdc5e,null))[_0x0bd5('0x1f')](function(_0x59fe20){if(_0x59fe20){_0x24e550=_0x59fe20;return db[_0x0bd5('0x88')][_0x0bd5('0x59')]({'where':{'id':_0x59fe20[_0x0bd5('0x89')]}});}})['then'](handleEntityNotFound(_0x4bdc5e,null))[_0x0bd5('0x1f')](function(_0x52f87b){if(_0x52f87b){logger[_0x0bd5('0x23')](_0x0bd5('0x24'),_0x0bd5('0x2a'),_0x0bd5('0x8a'),_0x52f87b[_0x0bd5('0x3c')],util['inspect'](_0x4f5bd4[_0x0bd5('0x58')],{'showHidden':![],'depth':null}));switch(_0x52f87b[_0x0bd5('0x3c')]){case _0x0bd5('0x8b'):if(_0x4f5bd4['body'][_0x0bd5('0x8c')]&&_0x4f5bd4['body'][_0x0bd5('0x8c')]===_0x24e550[_0x0bd5('0x8d')]){return _0x24e550[_0x0bd5('0x35')]({'read':!![]});}else{logger['error'](_0x0bd5('0x8e'),_0x0bd5('0x2a'),_0x0bd5('0x8b'),util[_0x0bd5('0x8f')](_0x4f5bd4[_0x0bd5('0x58')],{'showHidden':![],'depth':null}));}break;case _0x0bd5('0x90'):if(_0x4f5bd4['body'][_0x0bd5('0x91')]&&_0x4f5bd4[_0x0bd5('0x58')][_0x0bd5('0x91')]===_0x24e550[_0x0bd5('0x8d')]&&_['indexOf']([_0x0bd5('0x92'),_0x0bd5('0x93')],_0x4f5bd4[_0x0bd5('0x58')][_0x0bd5('0x94')])>=0x0){return _0x24e550[_0x0bd5('0x35')]({'read':!![]});}else{logger[_0x0bd5('0x26')](_0x0bd5('0x8e'),_0x0bd5('0x2a'),_0x0bd5('0x95'),util[_0x0bd5('0x8f')](_0x4f5bd4[_0x0bd5('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x160d00=_0x4f5bd4[_0x0bd5('0x58')][_0x0bd5('0x96')][0x0];if(_0x160d00[_0x0bd5('0x2a')]['groupName']===_0x0bd5('0x97')){return _0x24e550[_0x0bd5('0x35')]({'read':!![]});}else{logger[_0x0bd5('0x26')](_0x0bd5('0x8e'),'status','infobip',util['inspect'](_0x4f5bd4['body'],{'showHidden':![],'depth':null}));}break;}return _0x24e550;}})[_0x0bd5('0x1f')](respondWithResult(_0x4bdc5e,null))[_0x0bd5('0x52')](handleError(_0x4bdc5e,null));}; \ No newline at end of file +var _0xa8d9=['interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','body','describe','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt'];(function(_0x5e77b8,_0x4fa504){var _0x988deb=function(_0x29880f){while(--_0x29880f){_0x5e77b8['push'](_0x5e77b8['shift']());}};_0x988deb(++_0x4fa504);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9a8d('0x0'));var rimraf=require(_0x9a8d('0x1'));var zipdir=require(_0x9a8d('0x2'));var jsonpatch=require(_0x9a8d('0x3'));var rp=require(_0x9a8d('0x4'));var moment=require('moment');var BPromise=require(_0x9a8d('0x5'));var Mustache=require(_0x9a8d('0x6'));var util=require('util');var path=require(_0x9a8d('0x7'));var sox=require(_0x9a8d('0x8'));var csv=require(_0x9a8d('0x9'));var ejs=require(_0x9a8d('0xa'));var fs=require('fs');var fs_extra=require(_0x9a8d('0xb'));var _=require('lodash');var squel=require(_0x9a8d('0xc'));var crypto=require(_0x9a8d('0xd'));var jsforce=require(_0x9a8d('0xe'));var deskjs=require(_0x9a8d('0xf'));var toCsv=require(_0x9a8d('0x9'));var querystring=require('querystring');var Papa=require(_0x9a8d('0x10'));var Redis=require(_0x9a8d('0x11'));var authService=require(_0x9a8d('0x12'));var qs=require(_0x9a8d('0x13'));var as=require(_0x9a8d('0x14'));var hardwareService=require(_0x9a8d('0x15'));var logger=require(_0x9a8d('0x16'))(_0x9a8d('0x17'));var utils=require(_0x9a8d('0x18'));var config=require(_0x9a8d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9a8d('0x1a')]=_[_0x9a8d('0x1b')](config[_0x9a8d('0x1a')],{'host':_0x9a8d('0x1c'),'port':0x18eb});var socket=require(_0x9a8d('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x9a8d('0x1e')](socket);var jayson=require(_0x9a8d('0x1f'));var client=jayson[_0x9a8d('0x20')][_0x9a8d('0x21')]({'port':0x232c});var client9002=jayson[_0x9a8d('0x20')][_0x9a8d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x59e984,_0x419173,_0x37c632,_0xf0e398){return new BPromise(function(_0x290fb7,_0x32d491){var _0x9df34d=_0xf0e398||client;return _0x9df34d[_0x9a8d('0x22')](_0x59e984,_0x37c632)[_0x9a8d('0x23')](function(_0x5565f8){logger[_0x9a8d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x419173,_0x9a8d('0x25'));logger[_0x9a8d('0x26')](_0x9a8d('0x27'),_0x419173,_0x9a8d('0x25'),JSON['stringify'](_0x5565f8));if(_0x5565f8[_0x9a8d('0x28')]){if(_0x5565f8[_0x9a8d('0x28')]['code']===0x1f4){logger['error'](_0x9a8d('0x29'),_0x419173,_0x5565f8[_0x9a8d('0x28')]['message']);return _0x32d491(_0x5565f8[_0x9a8d('0x28')][_0x9a8d('0x2a')]);}logger['error'](_0x9a8d('0x29'),_0x419173,_0x5565f8[_0x9a8d('0x28')]['message']);return _0x290fb7(_0x5565f8[_0x9a8d('0x28')][_0x9a8d('0x2a')]);}else{logger[_0x9a8d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x419173,_0x9a8d('0x25'));_0x290fb7(_0x5565f8[_0x9a8d('0x2b')][_0x9a8d('0x2a')]);}})['catch'](function(_0xa1b0c5){logger[_0x9a8d('0x28')](_0x9a8d('0x29'),_0x419173,_0xa1b0c5);_0x32d491(_0xa1b0c5);});});}function respondWithStatusCode(_0x4750ad,_0x1dd21f){_0x1dd21f=_0x1dd21f||0xcc;return function(_0x260019){if(_0x260019){return _0x4750ad['sendStatus'](_0x1dd21f);}return _0x4750ad[_0x9a8d('0x2c')](_0x1dd21f)[_0x9a8d('0x2d')]();};}function respondWithResult(_0x50af6b,_0x404d2f){_0x404d2f=_0x404d2f||0xc8;return function(_0x5dbb2a){if(_0x5dbb2a){return _0x50af6b[_0x9a8d('0x2c')](_0x404d2f)[_0x9a8d('0x2e')](_0x5dbb2a);}};}function respondWithFilteredResult(_0x3dde53,_0x50ef61){return function(_0x2da3ce){if(_0x2da3ce){var _0x41eb5e=typeof _0x50ef61[_0x9a8d('0x2f')]===_0x9a8d('0x30')&&typeof _0x50ef61[_0x9a8d('0x31')]===_0x9a8d('0x30');var _0x1bc1e3=_0x2da3ce['count'];var _0x15056c=_0x41eb5e?0x0:_0x50ef61['offset'];var _0x3b5051=_0x41eb5e?_0x2da3ce[_0x9a8d('0x32')]:_0x50ef61[_0x9a8d('0x2f')]+_0x50ef61[_0x9a8d('0x31')];var _0x492864;if(_0x3b5051>=_0x1bc1e3){_0x3b5051=_0x1bc1e3;_0x492864=0xc8;}else{_0x492864=0xce;}_0x3dde53[_0x9a8d('0x2c')](_0x492864);return _0x3dde53[_0x9a8d('0x33')](_0x9a8d('0x34'),_0x15056c+'-'+_0x3b5051+'/'+_0x1bc1e3)[_0x9a8d('0x2e')](_0x2da3ce);}return null;};}function patchUpdates(_0xf96ea2){return function(_0x32bc4d){try{jsonpatch[_0x9a8d('0x35')](_0x32bc4d,_0xf96ea2,!![]);}catch(_0x57b998){return BPromise[_0x9a8d('0x36')](_0x57b998);}return _0x32bc4d[_0x9a8d('0x37')]();};}function saveUpdates(_0x3210de,_0x487ee8){return function(_0x404617){if(_0x404617){return _0x404617[_0x9a8d('0x38')](_0x3210de)[_0x9a8d('0x23')](function(_0xe0e5df){return _0xe0e5df;});}return null;};}function removeEntity(_0x239207,_0x39d37a){return function(_0x46b0a6){if(_0x46b0a6){return _0x46b0a6[_0x9a8d('0x39')]()['then'](function(){_0x239207[_0x9a8d('0x2c')](0xcc)[_0x9a8d('0x2d')]();});}};}function handleEntityNotFound(_0xfface4,_0x59a02e){return function(_0x542fc3){if(!_0x542fc3){_0xfface4[_0x9a8d('0x3a')](0x194);}return _0x542fc3;};}function handleError(_0x5f5958,_0x5a1f0b){_0x5a1f0b=_0x5a1f0b||0x1f4;return function(_0x4c2a6c){logger['error'](_0x4c2a6c[_0x9a8d('0x3b')]);if(_0x4c2a6c[_0x9a8d('0x3c')]){delete _0x4c2a6c[_0x9a8d('0x3c')];}_0x5f5958[_0x9a8d('0x2c')](_0x5a1f0b)[_0x9a8d('0x3d')](_0x4c2a6c);};}exports[_0x9a8d('0x3e')]=function(_0x5c1864,_0x4a6b89){var _0x46620c={},_0x20adbd={},_0x23fec3={'count':0x0,'rows':[]};var _0xe986b7=_[_0x9a8d('0x3f')](db[_0x9a8d('0x40')][_0x9a8d('0x41')],function(_0x407f52){return{'name':_0x407f52[_0x9a8d('0x42')],'type':_0x407f52[_0x9a8d('0x43')][_0x9a8d('0x44')]};});_0x20adbd[_0x9a8d('0x45')]=_['map'](_0xe986b7,_0x9a8d('0x3c'));_0x20adbd[_0x9a8d('0x46')]=_['keys'](_0x5c1864['query']);_0x20adbd[_0x9a8d('0x47')]=_[_0x9a8d('0x48')](_0x20adbd[_0x9a8d('0x45')],_0x20adbd['query']);_0x46620c[_0x9a8d('0x49')]=_[_0x9a8d('0x48')](_0x20adbd[_0x9a8d('0x45')],qs[_0x9a8d('0x4a')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4a')]));_0x46620c[_0x9a8d('0x49')]=_0x46620c[_0x9a8d('0x49')][_0x9a8d('0x4b')]?_0x46620c[_0x9a8d('0x49')]:_0x20adbd[_0x9a8d('0x45')];if(!_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4c')](_0x9a8d('0x4d'))){_0x46620c[_0x9a8d('0x31')]=qs[_0x9a8d('0x31')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x31')]);_0x46620c['offset']=qs[_0x9a8d('0x2f')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x2f')]);}_0x46620c['order']=qs['sort'](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4e')]);_0x46620c[_0x9a8d('0x4f')]=qs[_0x9a8d('0x47')](_[_0x9a8d('0x50')](_0x5c1864[_0x9a8d('0x46')],_0x20adbd['filters']),_0xe986b7);if(_0x5c1864['query'][_0x9a8d('0x51')]){_0x46620c[_0x9a8d('0x4f')]=_['merge'](_0x46620c[_0x9a8d('0x4f')],{'$or':_['map'](_0xe986b7,function(_0x58a657){if(_0x58a657[_0x9a8d('0x43')]!==_0x9a8d('0x52')){var _0xdfc4b3={};_0xdfc4b3[_0x58a657[_0x9a8d('0x3c')]]={'$like':'%'+_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x51')]+'%'};return _0xdfc4b3;}})});}_0x46620c=_[_0x9a8d('0x53')]({},_0x46620c,_0x5c1864[_0x9a8d('0x54')]);var _0x4f564a={'where':_0x46620c[_0x9a8d('0x4f')]};return db[_0x9a8d('0x40')]['count'](_0x4f564a)['then'](function(_0x46faa1){_0x23fec3['count']=_0x46faa1;if(_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x55')]){_0x46620c[_0x9a8d('0x56')]=[{'all':!![]}];}return db[_0x9a8d('0x40')][_0x9a8d('0x57')](_0x46620c);})['then'](function(_0x2dc79c){_0x23fec3[_0x9a8d('0x58')]=_0x2dc79c;return _0x23fec3;})[_0x9a8d('0x23')](respondWithFilteredResult(_0x4a6b89,_0x46620c))['catch'](handleError(_0x4a6b89,null));};exports['show']=function(_0x511045,_0x1b88a1){var _0x5059e5={'raw':!![],'where':{'id':_0x511045[_0x9a8d('0x59')]['id']}},_0x44502d={};_0x44502d[_0x9a8d('0x45')]=_[_0x9a8d('0x5a')](db[_0x9a8d('0x40')][_0x9a8d('0x41')]);_0x44502d[_0x9a8d('0x46')]=_[_0x9a8d('0x5a')](_0x511045[_0x9a8d('0x46')]);_0x44502d[_0x9a8d('0x47')]=_[_0x9a8d('0x48')](_0x44502d['model'],_0x44502d['query']);_0x5059e5[_0x9a8d('0x49')]=_['intersection'](_0x44502d[_0x9a8d('0x45')],qs[_0x9a8d('0x4a')](_0x511045[_0x9a8d('0x46')][_0x9a8d('0x4a')]));_0x5059e5['attributes']=_0x5059e5[_0x9a8d('0x49')][_0x9a8d('0x4b')]?_0x5059e5['attributes']:_0x44502d['model'];if(_0x511045['query'][_0x9a8d('0x55')]){_0x5059e5['include']=[{'all':!![]}];}_0x5059e5=_[_0x9a8d('0x53')]({},_0x5059e5,_0x511045[_0x9a8d('0x54')]);return db[_0x9a8d('0x40')][_0x9a8d('0x5b')](_0x5059e5)['then'](handleEntityNotFound(_0x1b88a1,null))['then'](respondWithResult(_0x1b88a1,null))[_0x9a8d('0x5c')](handleError(_0x1b88a1,null));};exports['create']=function(_0x1c98b7,_0x31cf9f){return db[_0x9a8d('0x40')]['create'](_0x1c98b7[_0x9a8d('0x5d')],{})[_0x9a8d('0x23')](respondWithResult(_0x31cf9f,0xc9))[_0x9a8d('0x5c')](handleError(_0x31cf9f,null));};exports[_0x9a8d('0x38')]=function(_0x473d66,_0x37a116){if(_0x473d66[_0x9a8d('0x5d')]['id']){delete _0x473d66['body']['id'];}return db[_0x9a8d('0x40')][_0x9a8d('0x5b')]({'where':{'id':_0x473d66[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x37a116,null))[_0x9a8d('0x23')](saveUpdates(_0x473d66[_0x9a8d('0x5d')],null))[_0x9a8d('0x23')](respondWithResult(_0x37a116,null))[_0x9a8d('0x5c')](handleError(_0x37a116,null));};exports[_0x9a8d('0x39')]=function(_0x2a9b3f,_0x1339de){return db['SmsMessage'][_0x9a8d('0x5b')]({'where':{'id':_0x2a9b3f[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1339de,null))[_0x9a8d('0x23')](removeEntity(_0x1339de,null))[_0x9a8d('0x5c')](handleError(_0x1339de,null));};exports[_0x9a8d('0x5e')]=function(_0x4e4842,_0x5b148b){return db[_0x9a8d('0x40')][_0x9a8d('0x5e')]()[_0x9a8d('0x23')](respondWithResult(_0x5b148b,null))[_0x9a8d('0x5c')](handleError(_0x5b148b,null));};var interaction_log=require(_0x9a8d('0x16'))(_0x9a8d('0x5f'));exports['accept']=function(_0x21f2e5,_0x41b61a,_0x5ef3d4){var _0x548868={'agent':{},'channel':_0x9a8d('0x60')};if(_0x21f2e5[_0x9a8d('0x5d')]['id']){delete _0x21f2e5[_0x9a8d('0x5d')]['id'];}_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x61')]=!![];_0x21f2e5[_0x9a8d('0x5d')]['readAt']=moment()[_0x9a8d('0x62')](_0x9a8d('0x63'));_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')]=_0x21f2e5[_0x9a8d('0x5d')]['UserId']||_0x21f2e5[_0x9a8d('0x65')]['id'];_0x548868[_0x9a8d('0x66')]['id']=_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')];return db['SmsMessage']['find']({'where':{'id':_0x21f2e5[_0x9a8d('0x59')]['id'],'UserId':null}})[_0x9a8d('0x23')](handleEntityNotFound(_0x41b61a,null))[_0x9a8d('0x23')](saveUpdates(_0x21f2e5[_0x9a8d('0x5d')],null))[_0x9a8d('0x23')](function(_0x2c5142){if(_0x2c5142){_0x548868[_0x9a8d('0x2a')]=_0x2c5142[_0x9a8d('0x67')]({'plain':!![]});return db[_0x9a8d('0x68')][_0x9a8d('0x5b')]({'where':{'id':_0x2c5142[_0x9a8d('0x69')]}});}return null;})[_0x9a8d('0x23')](handleEntityNotFound(_0x41b61a,null))[_0x9a8d('0x23')](function(_0x112c85){if(_0x112c85){return _0x112c85[_0x9a8d('0x38')]({'UserId':_0x21f2e5['body'][_0x9a8d('0x64')],'read1stAt':_['isNil'](_0x112c85[_0x9a8d('0x6a')])?moment()['format'](_0x9a8d('0x63')):undefined});}return null;})[_0x9a8d('0x23')](function(_0x502f3e){if(_0x502f3e){_0x548868[_0x9a8d('0x6b')]=_0x502f3e[_0x9a8d('0x67')]({'plain':!![]});interaction_log[_0x9a8d('0x24')](_0x9a8d('0x6c'),_0x21f2e5['user']['id'],_0x21f2e5[_0x9a8d('0x65')][_0x9a8d('0x3c')],_0x21f2e5['user'][_0x9a8d('0x6d')],_0x548868[_0x9a8d('0x6b')]['id'],_0x21f2e5[_0x9a8d('0x5d')]?JSON[_0x9a8d('0x6e')](_0x21f2e5[_0x9a8d('0x5d')]):_0x9a8d('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x548868);}return null;})[_0x9a8d('0x23')](function(_0x8833e4){var _0x229e1a=_0x9a8d('0x70')+_0x8833e4[_0x9a8d('0x2a')][_0x9a8d('0x71')];return db['sequelize'][_0x9a8d('0x46')](_0x229e1a,{'type':db[_0x9a8d('0x72')][_0x9a8d('0x73')][_0x9a8d('0x74')],'raw':!![]})[_0x9a8d('0x23')](function(_0x1f57a9){return _0x1f57a9;});})['then'](function(_0x298939){if(_0x298939){_0x548868['message'][_0x9a8d('0x75')]=_0x298939[0x0];if(!_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')])return;return db[_0x9a8d('0x76')]['find']({'where':{'id':_0x21f2e5['body'][_0x9a8d('0x64')],'role':_0x9a8d('0x66')},'attributes':['id',_0x9a8d('0x3c'),_0x9a8d('0x77'),_0x9a8d('0x78'),_0x9a8d('0x79')],'raw':!![]});}return null;})['then'](function(_0x443b7b){if(!_0x443b7b)return null;_0x548868['message'][_0x9a8d('0x66')]=_0x443b7b;return _0x548868;})[_0x9a8d('0x23')](function(_0x5d0315){if(_0x5d0315){if(_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x7a')]){_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7b')]=util['format'](_0x9a8d('0x7c'),_0x21f2e5[_0x9a8d('0x65')][_0x9a8d('0x3c')]);_0x548868['message'][_0x9a8d('0x7d')]=_0x548868[_0x9a8d('0x7d')];_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7e')]=_0x548868[_0x9a8d('0x7d')];_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7f')]=_0x9a8d('0x80');return respondWithRpcPromise('EventManager',_0x9a8d('0x81'),{'event':_0x9a8d('0x82'),'message':_0x548868[_0x9a8d('0x2a')]},client9002)[_0x9a8d('0x23')](function(){return _0x548868;});}return _0x548868;}return null;})[_0x9a8d('0x23')](respondWithResult(_0x41b61a,null))['catch'](handleError(_0x41b61a,null));};var interaction_log=require(_0x9a8d('0x16'))(_0x9a8d('0x5f'));exports[_0x9a8d('0x36')]=function(_0x54d865,_0x5b91f1,_0x3e2bd3){var _0x1c4bf4={'agent':{},'channel':_0x9a8d('0x60')};if(_0x54d865['body']['id']){delete _0x54d865[_0x9a8d('0x5d')]['id'];}_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')]=_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')]||_0x54d865[_0x9a8d('0x65')]['id'];_0x1c4bf4[_0x9a8d('0x66')]['id']=_0x54d865['body'][_0x9a8d('0x64')];return db[_0x9a8d('0x40')][_0x9a8d('0x5b')]({'where':{'id':_0x54d865[_0x9a8d('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5b91f1,null))[_0x9a8d('0x23')](function(_0x1d0855){if(_0x1d0855){_0x1c4bf4['message']=_0x1d0855['get']({'plain':!![]});return db['SmsInteraction'][_0x9a8d('0x5b')]({'where':{'id':_0x1d0855[_0x9a8d('0x69')]}});}return null;})[_0x9a8d('0x23')](handleEntityNotFound(_0x5b91f1,null))[_0x9a8d('0x23')](function(_0x13355b){if(_0x13355b){_0x1c4bf4[_0x9a8d('0x6b')]=_0x13355b[_0x9a8d('0x67')]({'plain':!![]});interaction_log[_0x9a8d('0x24')](_0x9a8d('0x83'),_0x54d865[_0x9a8d('0x65')]['id'],_0x54d865['user'][_0x9a8d('0x3c')],_0x54d865['user'][_0x9a8d('0x6d')],_0x1c4bf4[_0x9a8d('0x6b')]['id'],_0x54d865['body']?JSON['stringify'](_0x54d865['body']):'null');return respondWithRpcPromise(_0x9a8d('0x84'),_0x9a8d('0x85'),_0x1c4bf4);}return null;})[_0x9a8d('0x23')](function(_0x265366){var _0x5d9e05='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x265366['message']['ContactId'];return db['sequelize'][_0x9a8d('0x46')](_0x5d9e05,{'type':db[_0x9a8d('0x72')][_0x9a8d('0x73')][_0x9a8d('0x74')],'raw':!![]})['then'](function(_0x4ce659){return _0x4ce659;});})[_0x9a8d('0x23')](function(_0x314ffd){if(_0x314ffd){_0x1c4bf4[_0x9a8d('0x2a')][_0x9a8d('0x75')]=_0x314ffd[0x0];if(!_0x54d865[_0x9a8d('0x5d')]['UserId'])return;return db[_0x9a8d('0x76')][_0x9a8d('0x5b')]({'where':{'id':_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')],'role':_0x9a8d('0x66')},'attributes':['id',_0x9a8d('0x3c'),_0x9a8d('0x77'),_0x9a8d('0x78'),_0x9a8d('0x79')],'raw':!![]});}return null;})[_0x9a8d('0x23')](function(_0x51eb8e){if(!_0x51eb8e)return null;_0x1c4bf4['message']['agent']=_0x51eb8e;return _0x1c4bf4;})[_0x9a8d('0x23')](function(_0x8c4d84){if(_0x8c4d84){_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7b')]=util[_0x9a8d('0x62')](_0x9a8d('0x7c'),_0x54d865[_0x9a8d('0x65')][_0x9a8d('0x3c')]);_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7d')]=_0x1c4bf4[_0x9a8d('0x7d')];_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7e')]=_0x1c4bf4['channel'];_0x8c4d84[_0x9a8d('0x2a')]['event']=_0x9a8d('0x36');respondWithRpcPromise('EventManager',_0x9a8d('0x81'),{'event':_0x9a8d('0x86'),'message':_0x8c4d84[_0x9a8d('0x2a')]},client9002);return _0x1c4bf4;}return null;})[_0x9a8d('0x23')](respondWithResult(_0x5b91f1,null))['catch'](handleError(_0x5b91f1,null));};exports[_0x9a8d('0x2c')]=function(_0x4358e1,_0x1d32f4,_0x2bdf2f){if(_0x4358e1[_0x9a8d('0x5d')]['id']){delete _0x4358e1['body']['id'];}var _0x36892e;return db[_0x9a8d('0x40')]['find']({'where':{'id':_0x4358e1[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1d32f4,null))[_0x9a8d('0x23')](function(_0x41329e){if(_0x41329e){_0x36892e=_0x41329e;return db[_0x9a8d('0x87')][_0x9a8d('0x5b')]({'where':{'id':_0x41329e['SmsAccountId']}});}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1d32f4,null))['then'](function(_0x5f03ba){if(_0x5f03ba){logger[_0x9a8d('0x26')](_0x9a8d('0x27'),'status',_0x9a8d('0x88'),_0x5f03ba[_0x9a8d('0x43')],util['inspect'](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5f03ba['type']){case'twilio':if(_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x89')]&&_0x4358e1['body'][_0x9a8d('0x89')]===_0x36892e[_0x9a8d('0x8a')]){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')](_0x9a8d('0x8b'),'status',_0x9a8d('0x8c'),util[_0x9a8d('0x8d')](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x8e')]&&_0x4358e1['body'][_0x9a8d('0x8e')]===_0x36892e[_0x9a8d('0x8a')]&&_[_0x9a8d('0x8f')]([_0x9a8d('0x90'),_0x9a8d('0x91')],_0x4358e1['body'][_0x9a8d('0x92')])>=0x0){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a8d('0x2c'),_0x9a8d('0x93'),util['inspect'](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9a8d('0x94'):var _0x50e7a7=_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x95')][0x0];if(_0x50e7a7[_0x9a8d('0x2c')]['groupName']===_0x9a8d('0x96')){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')](_0x9a8d('0x8b'),_0x9a8d('0x2c'),_0x9a8d('0x94'),util[_0x9a8d('0x8d')](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x36892e;}})[_0x9a8d('0x23')](respondWithResult(_0x1d32f4,null))[_0x9a8d('0x5c')](handleError(_0x1d32f4,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f7191c1..aec1b04 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 _0x00e6=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x57de05,_0x5b7221){var _0x4a2234=function(_0xb2be8a){while(--_0xb2be8a){_0x57de05['push'](_0x57de05['shift']());}};_0x4a2234(++_0x5b7221);}(_0x00e6,0x100));var _0x600e=function(_0x584d37,_0x13fb20){_0x584d37=_0x584d37-0x0;var _0x1a1dbf=_0x00e6[_0x584d37];return _0x1a1dbf;};'use strict';var EventEmitter=require(_0x600e('0x0'));var SmsMessage=require(_0x600e('0x1'))['db'][_0x600e('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x600e('0x3')](0x0);var events={'afterCreate':_0x600e('0x4'),'afterUpdate':_0x600e('0x5'),'afterDestroy':_0x600e('0x6')};function emitEvent(_0x39ac14){return function(_0x4e0892,_0x39c251,_0xf684d4){SmsMessageEvents[_0x600e('0x7')](_0x39ac14+':'+_0x4e0892['id'],_0x4e0892);SmsMessageEvents[_0x600e('0x7')](_0x39ac14,_0x4e0892);_0xf684d4(null);};}for(var e in events){if(events[_0x600e('0x8')](e)){var event=events[e];SmsMessage[_0x600e('0x9')](e,emitEvent(event));}}module[_0x600e('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x1486=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x301038,_0x44026e){var _0x27e231=function(_0x110d25){while(--_0x110d25){_0x301038['push'](_0x301038['shift']());}};_0x27e231(++_0x44026e);}(_0x1486,0x135));var _0x6148=function(_0x31cf55,_0x269351){_0x31cf55=_0x31cf55-0x0;var _0x35955c=_0x1486[_0x31cf55];return _0x35955c;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x6148('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6148('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6148('0x2'),'afterDestroy':_0x6148('0x3')};function emitEvent(_0x21e14e){return function(_0x29d4bf,_0x5d383a,_0x492693){SmsMessageEvents[_0x6148('0x4')](_0x21e14e+':'+_0x29d4bf['id'],_0x29d4bf);SmsMessageEvents[_0x6148('0x4')](_0x21e14e,_0x29d4bf);_0x492693(null);};}for(var e in events){if(events[_0x6148('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x6148('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index e497e1d..c3271bd 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 _0x7fbe=['smsMethod','sender','login?username=','&password=','GET','POST','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','data','head','message_id','clickSend','plivo','token','authId','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','csc','crypto','login','timestamp','keys','sort','length','apiKey','md5','digest','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7fbe,0x1a2));var _0xe7fb=function(_0x278f93,_0x5d74c6){_0x278f93=_0x278f93-0x0;var _0x47d224=_0x7fbe[_0x278f93];return _0x47d224;};'use strict';var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var logger=require(_0xe7fb('0x2'))('api');var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var rp=require(_0xe7fb('0x5'));var fs=require('fs');var path=require(_0xe7fb('0x6'));var rimraf=require(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var attributes=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x4094d4,_0x55ccd3){return _0x4094d4[_0xe7fb('0xb')](_0xe7fb('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe7fb('0xd'),'fields':[_0xe7fb('0xd')]},{'name':_0xe7fb('0xe'),'fields':['body'],'type':_0xe7fb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x19b4b4,_0x1d8b9f,_0x4dc78b){var _0x5182bb=_0x4094d4[_0xe7fb('0x10')];var _0x545cda=_0x19b4b4[_0xe7fb('0x11')]({'plain':!![]});if(_0x545cda[_0xe7fb('0x12')]['toLowerCase']()==='in'||_0x545cda[_0xe7fb('0x12')][_0xe7fb('0x13')]()===_0xe7fb('0x14')&&!_0x545cda['secret']&&!_[_0xe7fb('0x15')](_0x545cda[_0xe7fb('0x16')])&&!_[_0xe7fb('0x15')](_0x545cda['SmsInteractionId'])){_0x5182bb[_0xe7fb('0x17')]['findOne']({'where':{'id':_0x545cda[_0xe7fb('0x18')]}})[_0xe7fb('0x19')](function(_0x8c0b1){if(_0x8c0b1){_0x8c0b1[_0xe7fb('0x1a')]({'lastMsgAt':_0x545cda[_0xe7fb('0x1b')],'lastMsgDirection':_0x545cda[_0xe7fb('0x12')]['toLowerCase']()});}})[_0xe7fb('0x1c')](function(_0x37192f){console[_0xe7fb('0x1d')](_0x37192f);});}if(_0x545cda[_0xe7fb('0x12')]===_0xe7fb('0x14')&&!_0x545cda[_0xe7fb('0x1e')]){var _0x4adb69;_0x5182bb[_0xe7fb('0x1f')][_0xe7fb('0x20')]({'where':{'id':_0x545cda[_0xe7fb('0x21')]},'raw':!![]})[_0xe7fb('0x19')](function(_0x165671){_0x4adb69=_0x165671;if(_0x4adb69&&_0x4adb69['type']){switch(_0x4adb69[_0xe7fb('0x22')]){case _0xe7fb('0x23'):var _0x5cc1b2=require(_0xe7fb('0x23'));if(_0x4adb69[_0xe7fb('0x24')]&&_0x4adb69[_0xe7fb('0x25')]&&_0x4adb69[_0xe7fb('0x26')]){var _0x3ec4be=new _0x5cc1b2(_0x4adb69[_0xe7fb('0x24')],_0x4adb69['authToken']);_0x3ec4be[_0xe7fb('0x27')][_0xe7fb('0x28')]({'body':_0x545cda[_0xe7fb('0x29')],'to':_0x545cda['phone'],'from':_0x4adb69[_0xe7fb('0x26')],'statusCallback':_0x4adb69[_0xe7fb('0x2a')]+_0xe7fb('0x2b')+_0x545cda['id']+_0xe7fb('0x2c')+_0x4adb69['token']})[_0xe7fb('0x19')](function(_0x51b56b){if(_0x51b56b['sid']){return _0x19b4b4[_0xe7fb('0x1a')]({'messageId':_0x51b56b[_0xe7fb('0x2d')]});}})[_0xe7fb('0x1c')](function(_0x24efea){logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x23'),util[_0xe7fb('0x30')](_0x24efea,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x23'),_0xe7fb('0x31'));}break;case _0xe7fb('0x32'):var _0x148a77=_0xe7fb('0x33');if(_0x4adb69[_0xe7fb('0x34')]&&_0x4adb69[_0xe7fb('0x35')]){var _0x42692f={'recipient':[_0x545cda[_0xe7fb('0x26')]],'message':_0x545cda['body'],'message_type':_0x4adb69[_0xe7fb('0x36')]};if(_0x4adb69[_0xe7fb('0x36')]&&_0x4adb69['smsMethod']!=='SI'){_0x42692f[_0xe7fb('0x37')]=_0x4adb69[_0xe7fb('0x26')];}var _0x345d98={'url':_0x148a77+_0xe7fb('0x38')+_0x4adb69[_0xe7fb('0x34')]+_0xe7fb('0x39')+_0x4adb69[_0xe7fb('0x35')],'method':_0xe7fb('0x3a')};rp(_0x345d98)[_0xe7fb('0x19')](function(_0x54536e){var _0x9d088=_0x54536e['split'](';');var _0x280007={'user_key':_0x9d088[0x0],'session_key':_0x9d088[0x1]};_0x345d98={'url':_0x148a77+'sms','method':_0xe7fb('0x3b'),'headers':{'user_key':_0x280007['user_key'],'Session_key':_0x280007['session_key']},'json':!![],'body':_0x42692f};return rp(_0x345d98);})[_0xe7fb('0x19')](function(_0x960be9){if(_0x960be9['total_sent']>=0x1){var _0x1e3cc0={'messageId':_0x960be9[_0xe7fb('0x3c')]};if(_0x4adb69[_0xe7fb('0x36')]!=='GP'||!_0x4adb69[_0xe7fb('0x3d')]){_0x1e3cc0[_0xe7fb('0x3e')]=!![];}return _0x19b4b4[_0xe7fb('0x1a')](_0x1e3cc0);}else{return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),'afterCreate',_0xe7fb('0x32'),util['inspect'](_0x960be9,{'showHidden':![],'depth':null}));}})[_0xe7fb('0x1c')](function(_0x296d85){return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x32'),util[_0xe7fb('0x30')](_0x296d85,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),'afterCreate',_0xe7fb('0x32'),_0xe7fb('0x3f'));}break;case _0xe7fb('0x40'):if(_0x4adb69[_0xe7fb('0x25')]){var _0x40a9db={'recipient':_0x545cda['phone'],'message':_0x545cda[_0xe7fb('0x29')],'sender':_0x4adb69[_0xe7fb('0x41')]||_0x4adb69['phone'],'authorization':_0x4adb69[_0xe7fb('0x25')]};var _0x1d8b9f={'method':_0xe7fb('0x3b'),'uri':_0xe7fb('0x42'),'body':_0x40a9db,'json':!![]};rp(_0x1d8b9f)[_0xe7fb('0x19')](function(_0xd198be){var _0x58a824={'messageId':_0xd198be['requestid']};if(!_0x4adb69[_0xe7fb('0x3d')]){_0x58a824[_0xe7fb('0x3e')]=!![];}return _0x19b4b4['update'](_0x58a824);})['catch'](function(_0x5af1c7){logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'connectel',util['inspect'](_0x5af1c7,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),'afterCreate',_0xe7fb('0x40'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x4adb69[_0xe7fb('0x34')]&&_0x4adb69['password']){var _0x40a9db={'messages':[{'source':_0xe7fb('0x43'),'to':_0x545cda[_0xe7fb('0x26')],'body':_0x545cda[_0xe7fb('0x29')],'from':_0x4adb69[_0xe7fb('0x41')]||_0x4adb69[_0xe7fb('0x26')]}]};var _0x40fd86=util[_0xe7fb('0x44')](_0xe7fb('0x45'),_0x4adb69[_0xe7fb('0x34')],_0x4adb69[_0xe7fb('0x35')]);var _0x1d8b9f={'method':_0xe7fb('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x40a9db,'headers':{'Authorization':util[_0xe7fb('0x44')](_0xe7fb('0x46'),new Buffer(_0x40fd86)['toString'](_0xe7fb('0x47')))},'json':!![]};rp(_0x1d8b9f)[_0xe7fb('0x19')](function(_0x37c511){if(_0x37c511['http_code']>=0xc8&&_0x37c511['http_code']<=0xce){if(_0x37c511['data']&&_0x37c511[_0xe7fb('0x48')]['queued_count']>0x0){var _0x1e9a60=_[_0xe7fb('0x49')](_0x37c511[_0xe7fb('0x48')]['messages']);var _0x124b1b={'messageId':_0x1e9a60[_0xe7fb('0x4a')]};if(!_0x4adb69[_0xe7fb('0x3d')]){_0x124b1b[_0xe7fb('0x3e')]=!![];}return _0x19b4b4[_0xe7fb('0x1a')](_0x124b1b);}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'clickSend',util['inspect'](_0x37c511,{'showHidden':![],'depth':null}));}}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x4b'),util[_0xe7fb('0x30')](_0x37c511,{'showHidden':![],'depth':null}));}})[_0xe7fb('0x1c')](function(_0x5a0907){logger['error'](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'clickSend',util[_0xe7fb('0x30')](_0x5a0907,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x4b'),_0xe7fb('0x3f'));}break;case _0xe7fb('0x4c'):if(_0x4adb69['authId']&&_0x4adb69[_0xe7fb('0x25')]){var _0x40a9db={'dst':_0x545cda[_0xe7fb('0x26')],'text':_0x545cda['body'],'src':_0x4adb69['senderString']||_0x4adb69['phone'],'url':_0x4adb69[_0xe7fb('0x2a')]+'/api/sms/messages/'+_0x545cda['id']+_0xe7fb('0x2c')+_0x4adb69[_0xe7fb('0x4d')]};var _0x40fd86=util['format'](_0xe7fb('0x45'),_0x4adb69[_0xe7fb('0x4e')],_0x4adb69[_0xe7fb('0x25')]);var _0x1d8b9f={'method':'POST','uri':util[_0xe7fb('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4adb69[_0xe7fb('0x4e')]),'body':_0x40a9db,'headers':{'Authorization':util[_0xe7fb('0x44')](_0xe7fb('0x46'),new Buffer(_0x40fd86)[_0xe7fb('0x4f')](_0xe7fb('0x47')))},'json':!![]};rp(_0x1d8b9f)['then'](function(_0x2bbc6a){var _0x115789={'messageId':_0x2bbc6a[_0xe7fb('0x50')][0x0]};return _0x19b4b4[_0xe7fb('0x1a')](_0x115789);})[_0xe7fb('0x1c')](function(_0x116f77){logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x4c'),util[_0xe7fb('0x30')](_0x116f77,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x4c'),_0xe7fb('0x51'));}break;case _0xe7fb('0x52'):if(_0x4adb69[_0xe7fb('0x34')]&&_0x4adb69['password']){if(_0x4adb69['baseUrl']){var _0xb60f43={'method':_0xe7fb('0x3b'),'uri':_0x4adb69['baseUrl']+'/auth/1/session','body':{'username':_0x4adb69[_0xe7fb('0x34')],'password':_0x4adb69[_0xe7fb('0x35')]},'json':!![]};return rp(_0xb60f43)[_0xe7fb('0x19')](function(_0x1f1cf2){var _0x11b00e={'method':_0xe7fb('0x3b'),'uri':_0x4adb69[_0xe7fb('0x53')]+_0xe7fb('0x54'),'body':{'messages':[{'from':_0x4adb69[_0xe7fb('0x26')],'destinations':[{'to':_0x545cda['phone']}],'text':_0x545cda[_0xe7fb('0x29')],'notifyUrl':_0x4adb69['remote']+_0xe7fb('0x2b')+_0x545cda['id']+'/status?token='+_0x4adb69[_0xe7fb('0x4d')],'notifyContentType':_0xe7fb('0x55'),'callbackData':_0x4adb69[_0xe7fb('0x26')]+';'+_0x545cda['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x1f1cf2[_0xe7fb('0x4d')]},'json':!![]};return rp(_0x11b00e)[_0xe7fb('0x19')](function(_0x524e1f){if(_0x524e1f[_0xe7fb('0x27')]){var _0x5f4c33={'messageId':_0x524e1f[_0xe7fb('0x27')][0x0][_0xe7fb('0xd')]};if(!_0x4adb69['deliveryReport']){_0x5f4c33[_0xe7fb('0x3e')]=!![];}return _0x19b4b4[_0xe7fb('0x1a')](_0x5f4c33);}else{return logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x52'),util[_0xe7fb('0x30')](_0x524e1f,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x74af64){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x52'),util[_0xe7fb('0x30')](_0x74af64,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'infobip',_0xe7fb('0x3f'));}break;case _0xe7fb('0x56'):var _0x708d2e=require(_0xe7fb('0x57'));if(_0x4adb69['apiKey']){var _0x56b132={};_0x56b132[_0xe7fb('0x58')]=_0x4adb69[_0xe7fb('0x34')];_0x56b132['phone']=_0x545cda['phone'];_0x56b132[_0xe7fb('0x37')]=_0x4adb69[_0xe7fb('0x26')];_0x56b132['text']=_0x545cda['body'];_0x56b132[_0xe7fb('0x59')]=+new Date();var _0x6777a2='';var _0x125047='';var _0x85ed40=Object[_0xe7fb('0x5a')](_0x56b132);_0x85ed40[_0xe7fb('0x5b')]();for(var _0x1a0a9b=0x0;_0x1a0a9b<_0x85ed40[_0xe7fb('0x5c')];_0x1a0a9b++){if(_0x6777a2!=''){_0x6777a2+='&';}_0x6777a2+=_0x85ed40[_0x1a0a9b]+'='+encodeURIComponent(_0x56b132[_0x85ed40[_0x1a0a9b]]);_0x125047+=_0x56b132[_0x85ed40[_0x1a0a9b]];}_0x125047+=_0x4adb69[_0xe7fb('0x5d')];_0x125047=_0x708d2e['createHash'](_0xe7fb('0x5e'))[_0xe7fb('0x1a')](_0x125047)[_0xe7fb('0x5f')](_0xe7fb('0x60'));if(_0x6777a2!==''){_0x6777a2+='&';}_0x6777a2+='signature='+_0x125047;var _0x345d98={'method':'GET','uri':_0x4adb69[_0xe7fb('0x53')]+_0xe7fb('0x61')+_0x6777a2,'json':!![]};return rp(_0x345d98)[_0xe7fb('0x19')](function(_0x5727d3){var _0x5dc44c=Object[_0xe7fb('0x5a')](_0x5727d3);if(_0x5727d3[_0x5dc44c[0x0]][_0xe7fb('0x1d')]&&parseInt(_0x5727d3[_0x5dc44c[0x0]][_0xe7fb('0x1d')])===0x0){var _0x120918={'messageId':_0x5727d3[_0x5dc44c[0x0]]['id_sms']};if(!_0x4adb69['deliveryReport']){_0x120918[_0xe7fb('0x3e')]=!![];}return _0x19b4b4[_0xe7fb('0x1a')](_0x120918);}else{return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x56'),util[_0xe7fb('0x30')](_0x5727d3['error'],{'showHidden':![],'depth':null}));}})[_0xe7fb('0x1c')](function(_0x3dec06){return logger['error'](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x56'),util[_0xe7fb('0x30')](_0x3dec06,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x56'),_0xe7fb('0x62'));}break;case _0xe7fb('0x63'):if(_0x4adb69[_0xe7fb('0x5d')]){var _0x323a5b={'method':_0xe7fb('0x3b'),'uri':_0xe7fb('0x64'),'headers':{'Authorization':_0x4adb69[_0xe7fb('0x5d')]},'body':{'content':_0x545cda[_0xe7fb('0x29')],'to':[_0x545cda[_0xe7fb('0x26')]],'from':_0x4adb69['phone'],'binary':![],'clientMessageId':_0xe7fb('0x65'),'charset':_0xe7fb('0x66')},'json':!![]};rp(_0x323a5b)[_0xe7fb('0x19')](function(_0x4974c7){if(!_0x4974c7[_0xe7fb('0x1d')]){var _0x3d5377={'messageId':_0x4974c7[_0xe7fb('0x27')][0x0][_0xe7fb('0x67')]};if(!_0x4adb69[_0xe7fb('0x3d')]){_0x3d5377[_0xe7fb('0x3e')]=!![];}return _0x19b4b4[_0xe7fb('0x1a')](_0x3d5377);}else{return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'clickatell',util[_0xe7fb('0x30')](_0x4974c7[_0xe7fb('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x26d78c){return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x63'),util[_0xe7fb('0x30')](_0x26d78c,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x63'),_0xe7fb('0x62'));}break;case'bandwidth':if(_0x4adb69[_0xe7fb('0x34')]&&_0x4adb69[_0xe7fb('0x35')]){var _0x40fd86=util[_0xe7fb('0x44')]('%s:%s',_0x4adb69['username'],_0x4adb69['password']);var _0x1d8b9f={'method':_0xe7fb('0x3b'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4adb69[_0xe7fb('0x68')]+_0xe7fb('0x69'),'body':{'to':[_0x545cda['phone']],'text':_0x545cda[_0xe7fb('0x29')],'from':_0x4adb69[_0xe7fb('0x26')],'applicationId':_0x4adb69[_0xe7fb('0x6a')]},'headers':{'Authorization':util[_0xe7fb('0x44')](_0xe7fb('0x46'),new Buffer(_0x40fd86)[_0xe7fb('0x4f')](_0xe7fb('0x47')))},'json':!![]};rp(_0x1d8b9f)[_0xe7fb('0x19')](function(_0x244acc){if(_0x244acc['id']){var _0x265cc4={'messageId':_0x244acc['id']};return _0x19b4b4[_0xe7fb('0x1a')](_0x265cc4);}else{logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),'bandwidth',util[_0xe7fb('0x30')](_0x244acc,{'showHidden':![],'depth':null}));}})[_0xe7fb('0x1c')](function(_0xa9bb91){logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),'bandwidth',util[_0xe7fb('0x30')](_0xa9bb91,{'showHidden':![],'depth':null}));});}else{logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),'bandwidth',_0xe7fb('0x3f'));}break;case _0xe7fb('0x6b'):if(_0x4adb69[_0xe7fb('0x5d')]){var _0x4c0daf={};var _0x345d98={'method':_0xe7fb('0x3b'),'uri':_0xe7fb('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x4adb69[_0xe7fb('0x5d')],'Content-Type':'application/json'},'body':{'from':_0x4adb69[_0xe7fb('0x26')],'to':_0x545cda[_0xe7fb('0x26')],'text':_0x545cda[_0xe7fb('0x29')]},'json':!![]};return rp(_0x345d98)[_0xe7fb('0x19')](function(_0x2c8cee){if(_0x2c8cee[_0xe7fb('0x6d')]==0xca){_0x4c0daf[_0xe7fb('0x6e')]=_0x2c8cee;var _0x116627={'method':_0xe7fb('0x3b'),'uri':_0xe7fb('0x6f'),'headers':{'Authorization':_0xe7fb('0x70')+_0x4adb69[_0xe7fb('0x5d')],'Content-Type':'application/json'},'body':{'refid':_0x4c0daf[_0xe7fb('0x6e')]['refid']},'json':!![]};return rp(_0x116627)[_0xe7fb('0x19')](function(_0x509cd3){_0x4c0daf[_0xe7fb('0x71')]=_0x509cd3;var _0x50d2f8={'messageId':_0x4c0daf['message'][_0xe7fb('0x72')],'read':!![]};return _0x19b4b4[_0xe7fb('0x1a')](_0x50d2f8);});}else{return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x6b'),util[_0xe7fb('0x30')](_0x2c8cee,{'showHidden':![],'depth':null}));}})[_0xe7fb('0x1c')](function(_0x5c1e70){return logger[_0xe7fb('0x1d')](_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x6b'),util[_0xe7fb('0x30')](_0x5c1e70,{'showHidden':![],'depth':null}));});}else{return logger[_0xe7fb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe7fb('0x2f'),_0xe7fb('0x6b'),_0xe7fb('0x73'));}break;}}})[_0xe7fb('0x74')](function(){_0x4dc78b();});}else{_0x4dc78b();}}},'charset':_0xe7fb('0x75'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa70f=['infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','total_sent','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','message_id','update','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','plivo','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','IBSSO\x20'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xa70f,0x9a));var _0xfa70=function(_0x72254b,_0x5f4dba){_0x72254b=_0x72254b-0x0;var _0x22fc14=_0xa70f[_0x72254b];return _0x22fc14;};'use strict';var _=require(_0xfa70('0x0'));var util=require(_0xfa70('0x1'));var logger=require('../../config/logger')(_0xfa70('0x2'));var moment=require(_0xfa70('0x3'));var BPromise=require(_0xfa70('0x4'));var rp=require(_0xfa70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa70('0x6'));var config=require(_0xfa70('0x7'));var attributes=require(_0xfa70('0x8'));module['exports']=function(_0x5790b0,_0xe07164){return _0x5790b0[_0xfa70('0x9')](_0xfa70('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfa70('0xb')]},{'name':_0xfa70('0xc'),'fields':[_0xfa70('0xd')],'type':_0xfa70('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc7a2a8,_0x38b67a,_0x55fcb4){var _0x5a4281=_0x5790b0[_0xfa70('0xf')];var _0x18c8c1=_0xc7a2a8['get']({'plain':!![]});if(_0x18c8c1[_0xfa70('0x10')][_0xfa70('0x11')]()==='in'||_0x18c8c1['direction'][_0xfa70('0x11')]()===_0xfa70('0x12')&&!_0x18c8c1[_0xfa70('0x13')]&&!_['isNil'](_0x18c8c1['UserId'])&&!_[_0xfa70('0x14')](_0x18c8c1[_0xfa70('0x15')])){_0x5a4281[_0xfa70('0x16')][_0xfa70('0x17')]({'where':{'id':_0x18c8c1[_0xfa70('0x15')]}})[_0xfa70('0x18')](function(_0x3eeabd){if(_0x3eeabd){_0x3eeabd['update']({'lastMsgAt':_0x18c8c1[_0xfa70('0x19')],'lastMsgDirection':_0x18c8c1[_0xfa70('0x10')][_0xfa70('0x11')]()});}})[_0xfa70('0x1a')](function(_0x465dab){console[_0xfa70('0x1b')](_0x465dab);});}if(_0x18c8c1[_0xfa70('0x10')]==='out'&&!_0x18c8c1[_0xfa70('0x13')]){var _0x428a12;_0x5a4281[_0xfa70('0x1c')]['find']({'where':{'id':_0x18c8c1[_0xfa70('0x1d')]},'raw':!![]})[_0xfa70('0x18')](function(_0x2f52d3){_0x428a12=_0x2f52d3;if(_0x428a12&&_0x428a12[_0xfa70('0x1e')]){switch(_0x428a12[_0xfa70('0x1e')]){case _0xfa70('0x1f'):var _0x463230=require('twilio');if(_0x428a12['accountSid']&&_0x428a12[_0xfa70('0x20')]&&_0x428a12[_0xfa70('0x21')]){var _0xe443b1=new _0x463230(_0x428a12[_0xfa70('0x22')],_0x428a12[_0xfa70('0x20')]);_0xe443b1[_0xfa70('0x23')][_0xfa70('0x24')]({'body':_0x18c8c1[_0xfa70('0xd')],'to':_0x18c8c1[_0xfa70('0x21')],'from':_0x428a12[_0xfa70('0x21')],'statusCallback':_0x428a12[_0xfa70('0x25')]+'/api/sms/messages/'+_0x18c8c1['id']+_0xfa70('0x26')+_0x428a12[_0xfa70('0x27')]})[_0xfa70('0x18')](function(_0x11ccd4){if(_0x11ccd4['sid']){return _0xc7a2a8['update']({'messageId':_0x11ccd4[_0xfa70('0x28')]});}})[_0xfa70('0x1a')](function(_0x929e82){logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x1f'),util[_0xfa70('0x2b')](_0x929e82,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x1f'),_0xfa70('0x2c'));}break;case'skebby':var _0x1ecdc6=_0xfa70('0x2d');if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){var _0x40d2be={'recipient':[_0x18c8c1[_0xfa70('0x21')]],'message':_0x18c8c1['body'],'message_type':_0x428a12['smsMethod']};if(_0x428a12['smsMethod']&&_0x428a12[_0xfa70('0x30')]!=='SI'){_0x40d2be[_0xfa70('0x31')]=_0x428a12['phone'];}var _0x445155={'url':_0x1ecdc6+_0xfa70('0x32')+_0x428a12[_0xfa70('0x2e')]+'&password='+_0x428a12[_0xfa70('0x2f')],'method':_0xfa70('0x33')};rp(_0x445155)[_0xfa70('0x18')](function(_0x1ef8ad){var _0x19bca1=_0x1ef8ad['split'](';');var _0x1c7c15={'user_key':_0x19bca1[0x0],'session_key':_0x19bca1[0x1]};_0x445155={'url':_0x1ecdc6+_0xfa70('0x34'),'method':_0xfa70('0x35'),'headers':{'user_key':_0x1c7c15[_0xfa70('0x36')],'Session_key':_0x1c7c15['session_key']},'json':!![],'body':_0x40d2be};return rp(_0x445155);})[_0xfa70('0x18')](function(_0x356976){if(_0x356976[_0xfa70('0x37')]>=0x1){var _0x253bb6={'messageId':_0x356976[_0xfa70('0x38')]};if(_0x428a12['smsMethod']!=='GP'||!_0x428a12['deliveryReport']){_0x253bb6[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x253bb6);}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),util[_0xfa70('0x2b')](_0x356976,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ed322){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),util[_0xfa70('0x2b')](_0x5ed322,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),_0xfa70('0x3b'));}break;case _0xfa70('0x3c'):if(_0x428a12['authToken']){var _0x595c9a={'recipient':_0x18c8c1[_0xfa70('0x21')],'message':_0x18c8c1[_0xfa70('0xd')],'sender':_0x428a12[_0xfa70('0x3d')]||_0x428a12[_0xfa70('0x21')],'authorization':_0x428a12[_0xfa70('0x20')]};var _0x38b67a={'method':_0xfa70('0x35'),'uri':_0xfa70('0x3e'),'body':_0x595c9a,'json':!![]};rp(_0x38b67a)['then'](function(_0x4877c2){var _0x4309f9={'messageId':_0x4877c2[_0xfa70('0x3f')]};if(!_0x428a12[_0xfa70('0x40')]){_0x4309f9[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x4309f9);})[_0xfa70('0x1a')](function(_0x4c6abf){logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3c'),util[_0xfa70('0x2b')](_0x4c6abf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3c'),_0xfa70('0x41'));}break;case _0xfa70('0x42'):if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12['password']){var _0x595c9a={'messages':[{'source':'xCALLY\x20Motion','to':_0x18c8c1[_0xfa70('0x21')],'body':_0x18c8c1[_0xfa70('0xd')],'from':_0x428a12['senderString']||_0x428a12['phone']}]};var _0x5ba81e=util[_0xfa70('0x43')]('%s:%s',_0x428a12[_0xfa70('0x2e')],_0x428a12[_0xfa70('0x2f')]);var _0x38b67a={'method':'POST','uri':_0xfa70('0x44'),'body':_0x595c9a,'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x6542a1){if(_0x6542a1['http_code']>=0xc8&&_0x6542a1['http_code']<=0xce){if(_0x6542a1['data']&&_0x6542a1[_0xfa70('0x48')]['queued_count']>0x0){var _0x50fb00=_['head'](_0x6542a1[_0xfa70('0x48')][_0xfa70('0x23')]);var _0x3d984c={'messageId':_0x50fb00[_0xfa70('0x49')]};if(!_0x428a12[_0xfa70('0x40')]){_0x3d984c['read']=!![];}return _0xc7a2a8[_0xfa70('0x4a')](_0x3d984c);}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x4b'),util[_0xfa70('0x2b')](_0x6542a1,{'showHidden':![],'depth':null}));}}else{logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),'clickSend',util[_0xfa70('0x2b')](_0x6542a1,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x483390){logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x4b'),util['inspect'](_0x483390,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x4b'),_0xfa70('0x3b'));}break;case'plivo':if(_0x428a12[_0xfa70('0x4c')]&&_0x428a12['authToken']){var _0x595c9a={'dst':_0x18c8c1[_0xfa70('0x21')],'text':_0x18c8c1[_0xfa70('0xd')],'src':_0x428a12[_0xfa70('0x3d')]||_0x428a12[_0xfa70('0x21')],'url':_0x428a12['remote']+'/api/sms/messages/'+_0x18c8c1['id']+'/status?token='+_0x428a12['token']};var _0x5ba81e=util[_0xfa70('0x43')](_0xfa70('0x4d'),_0x428a12[_0xfa70('0x4c')],_0x428a12['authToken']);var _0x38b67a={'method':_0xfa70('0x35'),'uri':util[_0xfa70('0x43')](_0xfa70('0x4e'),_0x428a12[_0xfa70('0x4c')]),'body':_0x595c9a,'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x32bd04){var _0x56b53a={'messageId':_0x32bd04['message_uuid'][0x0]};return _0xc7a2a8[_0xfa70('0x4a')](_0x56b53a);})[_0xfa70('0x1a')](function(_0x1ba928){logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),_0xfa70('0x4f'),util[_0xfa70('0x2b')](_0x1ba928,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){if(_0x428a12[_0xfa70('0x50')]){var _0x28e8ca={'method':'POST','uri':_0x428a12[_0xfa70('0x50')]+_0xfa70('0x51'),'body':{'username':_0x428a12['username'],'password':_0x428a12[_0xfa70('0x2f')]},'json':!![]};return rp(_0x28e8ca)['then'](function(_0x188fb2){var _0x2a81e4={'method':_0xfa70('0x35'),'uri':_0x428a12[_0xfa70('0x50')]+_0xfa70('0x52'),'body':{'messages':[{'from':_0x428a12['phone'],'destinations':[{'to':_0x18c8c1['phone']}],'text':_0x18c8c1[_0xfa70('0xd')],'notifyUrl':_0x428a12[_0xfa70('0x25')]+_0xfa70('0x53')+_0x18c8c1['id']+_0xfa70('0x26')+_0x428a12[_0xfa70('0x27')],'notifyContentType':_0xfa70('0x54'),'callbackData':_0x428a12[_0xfa70('0x21')]+';'+_0x18c8c1[_0xfa70('0xd')]}]},'headers':{'Authorization':_0xfa70('0x55')+_0x188fb2[_0xfa70('0x27')]},'json':!![]};return rp(_0x2a81e4)['then'](function(_0x2174bb){if(_0x2174bb[_0xfa70('0x23')]){var _0x193551={'messageId':_0x2174bb[_0xfa70('0x23')][0x0][_0xfa70('0xb')]};if(!_0x428a12[_0xfa70('0x40')]){_0x193551['read']=!![];}return _0xc7a2a8[_0xfa70('0x4a')](_0x193551);}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x56'),util[_0xfa70('0x2b')](_0x2174bb,{'showHidden':![],'depth':null}));}});})[_0xfa70('0x1a')](function(_0x22ee29){return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x56'),util['inspect'](_0x22ee29,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate','infobip',_0xfa70('0x57'));}}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x56'),_0xfa70('0x3b'));}break;case'csc':var _0x1f4eac=require(_0xfa70('0x58'));if(_0x428a12[_0xfa70('0x59')]){var _0x2584fb={};_0x2584fb[_0xfa70('0x5a')]=_0x428a12[_0xfa70('0x2e')];_0x2584fb[_0xfa70('0x21')]=_0x18c8c1[_0xfa70('0x21')];_0x2584fb[_0xfa70('0x31')]=_0x428a12['phone'];_0x2584fb[_0xfa70('0x5b')]=_0x18c8c1['body'];_0x2584fb[_0xfa70('0x5c')]=+new Date();var _0x4c5a91='';var _0x1b6493='';var _0x367fa2=Object[_0xfa70('0x5d')](_0x2584fb);_0x367fa2[_0xfa70('0x5e')]();for(var _0x494b3f=0x0;_0x494b3f<_0x367fa2[_0xfa70('0x5f')];_0x494b3f++){if(_0x4c5a91!=''){_0x4c5a91+='&';}_0x4c5a91+=_0x367fa2[_0x494b3f]+'='+encodeURIComponent(_0x2584fb[_0x367fa2[_0x494b3f]]);_0x1b6493+=_0x2584fb[_0x367fa2[_0x494b3f]];}_0x1b6493+=_0x428a12['apiKey'];_0x1b6493=_0x1f4eac[_0xfa70('0x60')](_0xfa70('0x61'))['update'](_0x1b6493)[_0xfa70('0x62')](_0xfa70('0x63'));if(_0x4c5a91!==''){_0x4c5a91+='&';}_0x4c5a91+=_0xfa70('0x64')+_0x1b6493;var _0x445155={'method':_0xfa70('0x33'),'uri':_0x428a12[_0xfa70('0x50')]+'/external/get/send.php?'+_0x4c5a91,'json':!![]};return rp(_0x445155)['then'](function(_0xf8864c){var _0x1a3987=Object['keys'](_0xf8864c);if(_0xf8864c[_0x1a3987[0x0]][_0xfa70('0x1b')]&&parseInt(_0xf8864c[_0x1a3987[0x0]][_0xfa70('0x1b')])===0x0){var _0x59ca78={'messageId':_0xf8864c[_0x1a3987[0x0]]['id_sms']};if(!_0x428a12[_0xfa70('0x40')]){_0x59ca78[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x59ca78);}else{return logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util['inspect'](_0xf8864c[_0xfa70('0x1b')],{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x302104){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x65'),util[_0xfa70('0x2b')](_0x302104,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x65'),_0xfa70('0x66'));}break;case _0xfa70('0x67'):if(_0x428a12[_0xfa70('0x59')]){var _0x1a06ed={'method':_0xfa70('0x35'),'uri':_0xfa70('0x68'),'headers':{'Authorization':_0x428a12[_0xfa70('0x59')]},'body':{'content':_0x18c8c1[_0xfa70('0xd')],'to':[_0x18c8c1[_0xfa70('0x21')]],'from':_0x428a12['phone'],'binary':![],'clientMessageId':_0xfa70('0x69'),'charset':_0xfa70('0x6a')},'json':!![]};rp(_0x1a06ed)[_0xfa70('0x18')](function(_0x1e02b7){if(!_0x1e02b7[_0xfa70('0x1b')]){var _0x39be43={'messageId':_0x1e02b7[_0xfa70('0x23')][0x0]['apiMessageId']};if(!_0x428a12[_0xfa70('0x40')]){_0x39be43['read']=!![];}return _0xc7a2a8['update'](_0x39be43);}else{return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),'clickatell',util[_0xfa70('0x2b')](_0x1e02b7[_0xfa70('0x1b')],{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x194281){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x67'),util[_0xfa70('0x2b')](_0x194281,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x67'),_0xfa70('0x66'));}break;case _0xfa70('0x6b'):if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){var _0x5ba81e=util['format']('%s:%s',_0x428a12[_0xfa70('0x2e')],_0x428a12[_0xfa70('0x2f')]);var _0x38b67a={'method':_0xfa70('0x35'),'uri':_0xfa70('0x6c')+_0x428a12[_0xfa70('0x6d')]+'/messages','body':{'to':[_0x18c8c1[_0xfa70('0x21')]],'text':_0x18c8c1[_0xfa70('0xd')],'from':_0x428a12[_0xfa70('0x21')],'applicationId':_0x428a12[_0xfa70('0x6e')]},'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x4fdd35){if(_0x4fdd35['id']){var _0x5e870b={'messageId':_0x4fdd35['id']};return _0xc7a2a8[_0xfa70('0x4a')](_0x5e870b);}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x6b'),util['inspect'](_0x4fdd35,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x11c4d6){logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),_0xfa70('0x6b'),util['inspect'](_0x11c4d6,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfa70('0x6f'):if(_0x428a12[_0xfa70('0x59')]){var _0x1f4192={};var _0x445155={'method':_0xfa70('0x35'),'uri':_0xfa70('0x70'),'headers':{'Authorization':_0xfa70('0x71')+_0x428a12[_0xfa70('0x59')],'Content-Type':_0xfa70('0x54')},'body':{'from':_0x428a12[_0xfa70('0x21')],'to':_0x18c8c1[_0xfa70('0x21')],'text':_0x18c8c1[_0xfa70('0xd')]},'json':!![]};return rp(_0x445155)[_0xfa70('0x18')](function(_0x5a9623){if(_0x5a9623[_0xfa70('0x72')]==0xca){_0x1f4192[_0xfa70('0x73')]=_0x5a9623;var _0x14bbc9={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xfa70('0x71')+_0x428a12[_0xfa70('0x59')],'Content-Type':'application/json'},'body':{'refid':_0x1f4192[_0xfa70('0x73')]['refid']},'json':!![]};return rp(_0x14bbc9)[_0xfa70('0x18')](function(_0x484c9b){_0x1f4192['status']=_0x484c9b;var _0x11bdff={'messageId':_0x1f4192[_0xfa70('0x73')][_0xfa70('0x74')],'read':!![]};return _0xc7a2a8['update'](_0x11bdff);});}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),util[_0xfa70('0x2b')](_0x5a9623,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x2e34cf){return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),util[_0xfa70('0x2b')](_0x2e34cf,{'showHidden':![],'depth':null}));});}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),_0xfa70('0x75'));}break;}}})[_0xfa70('0x76')](function(){_0x55fcb4();});}else{_0x55fcb4();}}},'charset':'utf8mb4','collate':_0xfa70('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 95a6e56..85d3b32 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 _0x1393=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateSmsMessage','SmsMessage','create','options','raw','stringify','lodash','util','moment'];(function(_0xc7bd76,_0x1ec222){var _0x1fcf0c=function(_0x331b54){while(--_0x331b54){_0xc7bd76['push'](_0xc7bd76['shift']());}};_0x1fcf0c(++_0x1ec222);}(_0x1393,0x171));var _0x3139=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1393[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3139('0x0'));var util=require(_0x3139('0x1'));var moment=require(_0x3139('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3139('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3139('0x4'));var logger=require(_0x3139('0x5'))(_0x3139('0x6'));var config=require('../../config/environment');var jayson=require(_0x3139('0x7'));var client=jayson[_0x3139('0x8')][_0x3139('0x9')]({'port':0x232a});config['redis']=_[_0x3139('0xa')](config[_0x3139('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3139('0xc'))(new Redis(config[_0x3139('0xb')]));require(_0x3139('0xd'))[_0x3139('0xe')](socket);function respondWithRpcPromise(_0x1e0f22,_0x2c238c,_0x323869){return new BPromise(function(_0x3c544a,_0x4e177c){return client[_0x3139('0xf')](_0x1e0f22,_0x323869)[_0x3139('0x10')](function(_0x157d1e){logger[_0x3139('0x11')](_0x3139('0x12'),_0x2c238c,_0x3139('0x13'));logger[_0x3139('0x14')](_0x3139('0x15'),_0x2c238c,'request\x20sent',JSON['stringify'](_0x157d1e));if(_0x157d1e[_0x3139('0x16')]){if(_0x157d1e[_0x3139('0x16')][_0x3139('0x17')]===0x1f4){logger[_0x3139('0x16')](_0x3139('0x12'),_0x2c238c,_0x157d1e[_0x3139('0x16')]['message']);return _0x4e177c(_0x157d1e[_0x3139('0x16')][_0x3139('0x18')]);}logger[_0x3139('0x16')](_0x3139('0x12'),_0x2c238c,_0x157d1e[_0x3139('0x16')][_0x3139('0x18')]);return _0x3c544a(_0x157d1e['error'][_0x3139('0x18')]);}else{logger[_0x3139('0x11')](_0x3139('0x12'),_0x2c238c,_0x3139('0x13'));_0x3c544a(_0x157d1e['result'][_0x3139('0x18')]);}})['catch'](function(_0x5f9b47){logger['error'](_0x3139('0x12'),_0x2c238c,_0x5f9b47);_0x4e177c(_0x5f9b47);});});}exports[_0x3139('0x19')]=function(_0x34155b){var _0xb8c321=this;return new Promise(function(_0xaeaa52,_0x1d28bd){return db[_0x3139('0x1a')][_0x3139('0x1b')](_0x34155b['body'],{'raw':_0x34155b[_0x3139('0x1c')]?_0x34155b['options'][_0x3139('0x1d')]===undefined?!![]:![]:!![]})[_0x3139('0x10')](function(_0x4f4c80){logger[_0x3139('0x11')](_0x3139('0x19'),_0x34155b);logger[_0x3139('0x14')](_0x3139('0x19'),_0x34155b,JSON[_0x3139('0x1e')](_0x4f4c80));_0xaeaa52(_0x4f4c80);})['catch'](function(_0x4ddd23){logger[_0x3139('0x16')]('CreateSmsMessage',_0x4ddd23[_0x3139('0x18')],_0x34155b);_0x1d28bd(_0xb8c321[_0x3139('0x16')](0x1f4,_0x4ddd23[_0x3139('0x18')]));});});}; \ No newline at end of file +var _0x78da=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ed15f,_0x1d0298){var _0x27dd0f=function(_0x33b7f4){while(--_0x33b7f4){_0x4ed15f['push'](_0x4ed15f['shift']());}};_0x27dd0f(++_0x1d0298);}(_0x78da,0x1a4));var _0xa78d=function(_0xbc10a8,_0x35d4d5){_0xbc10a8=_0xbc10a8-0x0;var _0x1ac0c3=_0x78da[_0xbc10a8];return _0x1ac0c3;};'use strict';var _=require(_0xa78d('0x0'));var util=require(_0xa78d('0x1'));var moment=require(_0xa78d('0x2'));var BPromise=require(_0xa78d('0x3'));var rs=require(_0xa78d('0x4'));var fs=require('fs');var Redis=require(_0xa78d('0x5'));var db=require(_0xa78d('0x6'))['db'];var utils=require(_0xa78d('0x7'));var logger=require('../../config/logger')(_0xa78d('0x8'));var config=require(_0xa78d('0x9'));var jayson=require(_0xa78d('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa78d('0xb')](config[_0xa78d('0xc')],{'host':_0xa78d('0xd'),'port':0x18eb});var socket=require(_0xa78d('0xe'))(new Redis(config[_0xa78d('0xc')]));require('./smsMessage.socket')[_0xa78d('0xf')](socket);function respondWithRpcPromise(_0x287a89,_0x3997a4,_0x156bf6){return new BPromise(function(_0x4352b3,_0x48e261){return client[_0xa78d('0x10')](_0x287a89,_0x156bf6)[_0xa78d('0x11')](function(_0x3c5047){logger[_0xa78d('0x12')](_0xa78d('0x13'),_0x3997a4,_0xa78d('0x14'));logger[_0xa78d('0x15')](_0xa78d('0x16'),_0x3997a4,_0xa78d('0x14'),JSON[_0xa78d('0x17')](_0x3c5047));if(_0x3c5047[_0xa78d('0x18')]){if(_0x3c5047['error'][_0xa78d('0x19')]===0x1f4){logger[_0xa78d('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);return _0x48e261(_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);}logger[_0xa78d('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);return _0x4352b3(_0x3c5047[_0xa78d('0x18')]['message']);}else{logger[_0xa78d('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0xa78d('0x14'));_0x4352b3(_0x3c5047[_0xa78d('0x1b')][_0xa78d('0x1a')]);}})[_0xa78d('0x1c')](function(_0x1e5e03){logger['error'](_0xa78d('0x13'),_0x3997a4,_0x1e5e03);_0x48e261(_0x1e5e03);});});}exports[_0xa78d('0x1d')]=function(_0x70b7){var _0x53cbd9=this;return new Promise(function(_0x58d000,_0x4550a3){return db[_0xa78d('0x1e')]['create'](_0x70b7[_0xa78d('0x1f')],{'raw':_0x70b7[_0xa78d('0x20')]?_0x70b7[_0xa78d('0x20')][_0xa78d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x521598){logger[_0xa78d('0x12')](_0xa78d('0x1d'),_0x70b7);logger[_0xa78d('0x15')](_0xa78d('0x1d'),_0x70b7,JSON[_0xa78d('0x17')](_0x521598));_0x58d000(_0x521598);})['catch'](function(_0x1c3907){logger[_0xa78d('0x18')](_0xa78d('0x1d'),_0x1c3907[_0xa78d('0x1a')],_0x70b7);_0x4550a3(_0x53cbd9[_0xa78d('0x18')](0x1f4,_0x1c3907[_0xa78d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 90e7540..c0c5423 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 _0xcb1e=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','update'];(function(_0x35a7f5,_0xc77a37){var _0x2e10df=function(_0x295f97){while(--_0x295f97){_0x35a7f5['push'](_0x35a7f5['shift']());}};_0x2e10df(++_0xc77a37);}(_0xcb1e,0xfd));var _0xecb1=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xcb1e[_0x28aea5];return _0x6a55f9;};'use strict';var SmsMessageEvents=require(_0xecb1('0x0'));var events=[_0xecb1('0x1'),'remove',_0xecb1('0x2')];function createListener(_0x4ac510,_0x439d52){return function(_0x1067bd){_0x439d52[_0xecb1('0x3')](_0x4ac510,_0x1067bd);};}function removeListener(_0x26e592,_0x4f77ed){return function(){SmsMessageEvents[_0xecb1('0x4')](_0x26e592,_0x4f77ed);};}exports[_0xecb1('0x5')]=function(_0x435fe3){for(var _0x156add=0x0,_0x349792=events[_0xecb1('0x6')];_0x156add<_0x349792;_0x156add++){var _0x26237c=events[_0x156add];var _0x405847=createListener(_0xecb1('0x7')+_0x26237c,_0x435fe3);SmsMessageEvents['on'](_0x26237c,_0x405847);}}; \ No newline at end of file +var _0xe345=['removeListener','register','length','./smsMessage.events','save','remove','update','emit'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xe345,0x1cb));var _0x5e34=function(_0x58ae23,_0x296dfe){_0x58ae23=_0x58ae23-0x0;var _0x3b047f=_0xe345[_0x58ae23];return _0x3b047f;};'use strict';var SmsMessageEvents=require(_0x5e34('0x0'));var events=[_0x5e34('0x1'),_0x5e34('0x2'),_0x5e34('0x3')];function createListener(_0x598c38,_0x57e7ce){return function(_0x1ddaa6){_0x57e7ce[_0x5e34('0x4')](_0x598c38,_0x1ddaa6);};}function removeListener(_0x33dc4f,_0x51390f){return function(){SmsMessageEvents[_0x5e34('0x5')](_0x33dc4f,_0x51390f);};}exports[_0x5e34('0x6')]=function(_0xb2224f){for(var _0x248305=0x0,_0x3db3db=events[_0x5e34('0x7')];_0x248305<_0x3db3db;_0x248305++){var _0x4a2f8e=events[_0x248305];var _0x7927a3=createListener('smsMessage:'+_0x4a2f8e,_0xb2224f);SmsMessageEvents['on'](_0x4a2f8e,_0x7927a3);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c5332b1..084238f 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 _0x7938=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x5a08ad,_0x2cc438){var _0x5709fb=function(_0x58e968){while(--_0x58e968){_0x5a08ad['push'](_0x5a08ad['shift']());}};_0x5709fb(++_0x2cc438);}(_0x7938,0x1bc));var _0x8793=function(_0x3b2f30,_0x597f6b){_0x3b2f30=_0x3b2f30-0x0;var _0x213194=_0x7938[_0x3b2f30];return _0x213194;};'use strict';var multer=require(_0x8793('0x0'));var util=require(_0x8793('0x1'));var path=require(_0x8793('0x2'));var timeout=require(_0x8793('0x3'));var express=require(_0x8793('0x4'));var router=express[_0x8793('0x5')]();var fs_extra=require(_0x8793('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8793('0x7'));var config=require(_0x8793('0x8'));var controller=require(_0x8793('0x9'));router[_0x8793('0xa')]('/',auth[_0x8793('0xb')](),controller[_0x8793('0xc')]);router['get'](_0x8793('0xd'),auth[_0x8793('0xb')](),controller[_0x8793('0xe')]);router[_0x8793('0xa')](_0x8793('0xf'),auth[_0x8793('0xb')](),controller[_0x8793('0x10')]);router[_0x8793('0xa')](_0x8793('0x11'),auth[_0x8793('0xb')](),controller['getMembers']);router['get'](_0x8793('0x12'),auth[_0x8793('0xb')](),controller['getTeams']);router['get'](_0x8793('0x13'),auth[_0x8793('0xb')](),controller[_0x8793('0x14')]);router['post']('/',auth[_0x8793('0xb')](),controller[_0x8793('0x15')]);router[_0x8793('0x16')](_0x8793('0x12'),auth[_0x8793('0xb')](),controller[_0x8793('0x17')]);router['post'](_0x8793('0x13'),auth[_0x8793('0xb')](),controller[_0x8793('0x18')]);router[_0x8793('0x19')](_0x8793('0xf'),auth[_0x8793('0xb')](),controller[_0x8793('0x1a')]);router[_0x8793('0x1b')](_0x8793('0xf'),auth['isAuthenticated'](),controller[_0x8793('0x1c')]);router[_0x8793('0x1b')](_0x8793('0x12'),auth['isAuthenticated'](),controller[_0x8793('0x1d')]);router[_0x8793('0x1b')](_0x8793('0x13'),auth[_0x8793('0xb')](),controller[_0x8793('0x1e')]);module[_0x8793('0x1f')]=router; \ No newline at end of file +var _0x691c=['create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x691c,0xe3));var _0xc691=function(_0x4a0a2e,_0x3897b1){_0x4a0a2e=_0x4a0a2e-0x0;var _0x20d54c=_0x691c[_0x4a0a2e];return _0x20d54c;};'use strict';var multer=require(_0xc691('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc691('0x1'));var express=require(_0xc691('0x2'));var router=express[_0xc691('0x3')]();var fs_extra=require(_0xc691('0x4'));var auth=require(_0xc691('0x5'));var interaction=require(_0xc691('0x6'));var config=require(_0xc691('0x7'));var controller=require('./smsQueue.controller');router[_0xc691('0x8')]('/',auth['isAuthenticated'](),controller[_0xc691('0x9')]);router[_0xc691('0x8')](_0xc691('0xa'),auth[_0xc691('0xb')](),controller[_0xc691('0xc')]);router[_0xc691('0x8')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0xe')]);router['get']('/:id/members',auth[_0xc691('0xb')](),controller[_0xc691('0xf')]);router[_0xc691('0x8')](_0xc691('0x10'),auth[_0xc691('0xb')](),controller[_0xc691('0x11')]);router[_0xc691('0x8')](_0xc691('0x12'),auth[_0xc691('0xb')](),controller[_0xc691('0x13')]);router[_0xc691('0x14')]('/',auth['isAuthenticated'](),controller[_0xc691('0x15')]);router['post'](_0xc691('0x10'),auth[_0xc691('0xb')](),controller[_0xc691('0x16')]);router[_0xc691('0x14')]('/:id/users',auth[_0xc691('0xb')](),controller[_0xc691('0x17')]);router[_0xc691('0x18')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0x19')]);router[_0xc691('0x1a')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0x1b')]);router['delete']('/:id/teams',auth[_0xc691('0xb')](),controller[_0xc691('0x1c')]);router['delete']('/:id/users',auth[_0xc691('0xb')](),controller[_0xc691('0x1d')]);module[_0xc691('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c71a18c..30e6cfb 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 _0x2fd2=['rrmemory','beepall','name','INTEGER'];(function(_0x4e0ae9,_0x575a04){var _0x60aa79=function(_0x47165e){while(--_0x47165e){_0x4e0ae9['push'](_0x4e0ae9['shift']());}};_0x60aa79(++_0x575a04);}(_0x2fd2,0xb6));var _0x22fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2fd2[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x22fd('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x22fd('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x22fd('0x2'),_0x22fd('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x0e82=['rrmemory','beepall','roundrobin','exports','name','STRING','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0e82,0xab));var _0x20e8=function(_0x393eac,_0x4505f3){_0x393eac=_0x393eac-0x0;var _0x37a891=_0x0e82[_0x393eac];return _0x37a891;};'use strict';var Sequelize=require('sequelize');module[_0x20e8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x20e8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20e8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20e8('0x3')](_0x20e8('0x4'),_0x20e8('0x5'),_0x20e8('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 767ec98..7153364 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 _0x33f4=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','type','options','SmsQueue','include','findAll','rows','show','params','includeAll','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','pick','User','findAndCountAll','updatedAt','smsPause','getTeams','Team','length','order','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeTeams','ids','isEmpty','addAgents','omit','spread','removeAgents','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end'];(function(_0x5ec056,_0x2455c7){var _0x440c92=function(_0x57f0a8){while(--_0x57f0a8){_0x5ec056['push'](_0x5ec056['shift']());}};_0x440c92(++_0x2455c7);}(_0x33f4,0xf5));var _0x433f=function(_0x39f1d5,_0x296abe){_0x39f1d5=_0x39f1d5-0x0;var _0x1917b8=_0x33f4[_0x39f1d5];return _0x1917b8;};'use strict';var emlformat=require(_0x433f('0x0'));var rimraf=require(_0x433f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x433f('0x2'));var rp=require(_0x433f('0x3'));var moment=require(_0x433f('0x4'));var BPromise=require(_0x433f('0x5'));var Mustache=require(_0x433f('0x6'));var util=require(_0x433f('0x7'));var path=require(_0x433f('0x8'));var sox=require(_0x433f('0x9'));var csv=require('to-csv');var ejs=require(_0x433f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x433f('0xb'));var squel=require('squel');var crypto=require(_0x433f('0xc'));var jsforce=require(_0x433f('0xd'));var deskjs=require(_0x433f('0xe'));var toCsv=require(_0x433f('0xf'));var querystring=require('querystring');var Papa=require(_0x433f('0x10'));var Redis=require(_0x433f('0x11'));var authService=require(_0x433f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x433f('0x13'));var logger=require('../../config/logger')(_0x433f('0x14'));var utils=require(_0x433f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x433f('0x16')]=_[_0x433f('0x17')](config[_0x433f('0x16')],{'host':_0x433f('0x18'),'port':0x18eb});var socket=require(_0x433f('0x19'))(new Redis(config[_0x433f('0x16')]));require(_0x433f('0x1a'))[_0x433f('0x1b')](socket);function respondWithStatusCode(_0x26eaf9,_0x243853){_0x243853=_0x243853||0xcc;return function(_0x38641){if(_0x38641){return _0x26eaf9[_0x433f('0x1c')](_0x243853);}return _0x26eaf9[_0x433f('0x1d')](_0x243853)[_0x433f('0x1e')]();};}function respondWithResult(_0x2c1d34,_0xd861b0){_0xd861b0=_0xd861b0||0xc8;return function(_0xc0b1e3){if(_0xc0b1e3){return _0x2c1d34[_0x433f('0x1d')](_0xd861b0)[_0x433f('0x1f')](_0xc0b1e3);}};}function respondWithFilteredResult(_0x5ca1a8,_0x51eeb4){return function(_0x3d8e59){if(_0x3d8e59){var _0x12041e=typeof _0x51eeb4[_0x433f('0x20')]===_0x433f('0x21')&&typeof _0x51eeb4[_0x433f('0x22')]===_0x433f('0x21');var _0x367454=_0x3d8e59[_0x433f('0x23')];var _0x527c9c=_0x12041e?0x0:_0x51eeb4[_0x433f('0x20')];var _0x298f35=_0x12041e?_0x3d8e59[_0x433f('0x23')]:_0x51eeb4[_0x433f('0x20')]+_0x51eeb4[_0x433f('0x22')];var _0x474d6e;if(_0x298f35>=_0x367454){_0x298f35=_0x367454;_0x474d6e=0xc8;}else{_0x474d6e=0xce;}_0x5ca1a8[_0x433f('0x1d')](_0x474d6e);return _0x5ca1a8[_0x433f('0x24')]('Content-Range',_0x527c9c+'-'+_0x298f35+'/'+_0x367454)['json'](_0x3d8e59);}return null;};}function patchUpdates(_0xee2b69){return function(_0x147ae5){try{jsonpatch[_0x433f('0x25')](_0x147ae5,_0xee2b69,!![]);}catch(_0x5a596b){return BPromise[_0x433f('0x26')](_0x5a596b);}return _0x147ae5[_0x433f('0x27')]();};}function saveUpdates(_0x1b17e1,_0x5bbb99){return function(_0x286239){if(_0x286239){return _0x286239[_0x433f('0x28')](_0x1b17e1)[_0x433f('0x29')](function(_0x4063b2){return _0x4063b2;});}return null;};}function removeEntity(_0x365b81,_0x2444a4){return function(_0x1a1497){if(_0x1a1497){return _0x1a1497['destroy']()['then'](function(){var _0x4d6d7c=_0x1a1497['get']({'plain':!![]});var _0x554f0f=_0x433f('0x2a');return db[_0x433f('0x2b')][_0x433f('0x2c')]({'where':{'type':_0x554f0f,'resourceId':_0x4d6d7c['id']}})[_0x433f('0x29')](function(){return _0x1a1497;});})[_0x433f('0x29')](function(){_0x365b81['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x137bcb,_0x3649a6){return function(_0x2b7311){if(!_0x2b7311){_0x137bcb[_0x433f('0x1c')](0x194);}return _0x2b7311;};}function handleError(_0x540075,_0x40e64c){_0x40e64c=_0x40e64c||0x1f4;return function(_0x20f069){logger[_0x433f('0x2d')](_0x20f069[_0x433f('0x2e')]);if(_0x20f069[_0x433f('0x2f')]){delete _0x20f069[_0x433f('0x2f')];}_0x540075[_0x433f('0x1d')](_0x40e64c)['send'](_0x20f069);};}exports[_0x433f('0x30')]=function(_0x31ecee,_0x6ef772){var _0x2dd59b={},_0x594c08={},_0xf2c773={'count':0x0,'rows':[]};var _0x32248d=_[_0x433f('0x31')](db['SmsQueue'][_0x433f('0x32')],function(_0x90968e){return{'name':_0x90968e[_0x433f('0x33')],'type':_0x90968e['type'][_0x433f('0x34')]};});_0x594c08[_0x433f('0x35')]=_[_0x433f('0x31')](_0x32248d,'name');_0x594c08[_0x433f('0x36')]=_[_0x433f('0x37')](_0x31ecee[_0x433f('0x36')]);_0x594c08[_0x433f('0x38')]=_[_0x433f('0x39')](_0x594c08[_0x433f('0x35')],_0x594c08['query']);_0x2dd59b['attributes']=_[_0x433f('0x39')](_0x594c08[_0x433f('0x35')],qs[_0x433f('0x3a')](_0x31ecee[_0x433f('0x36')]['fields']));_0x2dd59b[_0x433f('0x3b')]=_0x2dd59b['attributes']['length']?_0x2dd59b[_0x433f('0x3b')]:_0x594c08[_0x433f('0x35')];if(!_0x31ecee[_0x433f('0x36')]['hasOwnProperty'](_0x433f('0x3c'))){_0x2dd59b[_0x433f('0x22')]=qs[_0x433f('0x22')](_0x31ecee[_0x433f('0x36')]['limit']);_0x2dd59b['offset']=qs[_0x433f('0x20')](_0x31ecee['query'][_0x433f('0x20')]);}_0x2dd59b['order']=qs[_0x433f('0x3d')](_0x31ecee[_0x433f('0x36')][_0x433f('0x3d')]);_0x2dd59b[_0x433f('0x3e')]=qs[_0x433f('0x38')](_['pick'](_0x31ecee['query'],_0x594c08['filters']),_0x32248d);if(_0x31ecee[_0x433f('0x36')][_0x433f('0x3f')]){_0x2dd59b[_0x433f('0x3e')]=_['merge'](_0x2dd59b[_0x433f('0x3e')],{'$or':_[_0x433f('0x31')](_0x32248d,function(_0x4ce8d6){if(_0x4ce8d6[_0x433f('0x40')]!=='VIRTUAL'){var _0x91e233={};_0x91e233[_0x4ce8d6['name']]={'$like':'%'+_0x31ecee[_0x433f('0x36')][_0x433f('0x3f')]+'%'};return _0x91e233;}})});}_0x2dd59b=_['merge']({},_0x2dd59b,_0x31ecee[_0x433f('0x41')]);var _0x3dd00d={'where':_0x2dd59b[_0x433f('0x3e')]};return db[_0x433f('0x42')][_0x433f('0x23')](_0x3dd00d)['then'](function(_0x5f58d5){_0xf2c773[_0x433f('0x23')]=_0x5f58d5;if(_0x31ecee['query']['includeAll']){_0x2dd59b[_0x433f('0x43')]=[{'all':!![]}];}return db[_0x433f('0x42')][_0x433f('0x44')](_0x2dd59b);})[_0x433f('0x29')](function(_0x2dbcc0){_0xf2c773[_0x433f('0x45')]=_0x2dbcc0;return _0xf2c773;})['then'](respondWithFilteredResult(_0x6ef772,_0x2dd59b))['catch'](handleError(_0x6ef772,null));};exports[_0x433f('0x46')]=function(_0x589c2c,_0x32be46){var _0x167c33={'raw':!![],'where':{'id':_0x589c2c[_0x433f('0x47')]['id']}},_0x212f16={};_0x212f16['model']=_[_0x433f('0x37')](db[_0x433f('0x42')]['rawAttributes']);_0x212f16[_0x433f('0x36')]=_[_0x433f('0x37')](_0x589c2c[_0x433f('0x36')]);_0x212f16[_0x433f('0x38')]=_[_0x433f('0x39')](_0x212f16[_0x433f('0x35')],_0x212f16['query']);_0x167c33[_0x433f('0x3b')]=_[_0x433f('0x39')](_0x212f16[_0x433f('0x35')],qs[_0x433f('0x3a')](_0x589c2c[_0x433f('0x36')]['fields']));_0x167c33[_0x433f('0x3b')]=_0x167c33[_0x433f('0x3b')]['length']?_0x167c33[_0x433f('0x3b')]:_0x212f16[_0x433f('0x35')];if(_0x589c2c['query'][_0x433f('0x48')]){_0x167c33[_0x433f('0x43')]=[{'all':!![]}];}_0x167c33=_[_0x433f('0x49')]({},_0x167c33,_0x589c2c[_0x433f('0x41')]);return db[_0x433f('0x42')][_0x433f('0x4a')](_0x167c33)[_0x433f('0x29')](handleEntityNotFound(_0x32be46,null))[_0x433f('0x29')](respondWithResult(_0x32be46,null))['catch'](handleError(_0x32be46,null));};exports['create']=function(_0x199779,_0x4eb1a7){return db[_0x433f('0x42')][_0x433f('0x4b')](_0x199779['body'],{})[_0x433f('0x29')](function(_0x6709e8){var _0x492f8f=_0x199779[_0x433f('0x4c')][_0x433f('0x4d')]({'plain':!![]});if(!_0x492f8f)throw new Error(_0x433f('0x4e'));if(_0x492f8f[_0x433f('0x4f')]===_0x433f('0x4c')){var _0x2a6c23=_0x6709e8['get']({'plain':!![]});var _0x4036d2=_0x433f('0x2a');return db[_0x433f('0x50')][_0x433f('0x4a')]({'where':{'name':_0x4036d2,'userProfileId':_0x492f8f['userProfileId']},'raw':!![]})[_0x433f('0x29')](function(_0x481f00){if(_0x481f00&&_0x481f00[_0x433f('0x51')]===0x0){return db[_0x433f('0x2b')]['create']({'name':_0x2a6c23[_0x433f('0x2f')],'resourceId':_0x2a6c23['id'],'type':_0x481f00[_0x433f('0x2f')],'sectionId':_0x481f00['id']},{})[_0x433f('0x29')](function(){return _0x6709e8;});}else{return _0x6709e8;}})[_0x433f('0x52')](function(_0x25450f){logger[_0x433f('0x2d')](_0x433f('0x53'),_0x25450f);throw _0x25450f;});}return _0x6709e8;})[_0x433f('0x29')](respondWithResult(_0x4eb1a7,0xc9))['catch'](handleError(_0x4eb1a7,null));};exports['update']=function(_0x3c6c8a,_0x10023d){if(_0x3c6c8a[_0x433f('0x54')]['id']){delete _0x3c6c8a[_0x433f('0x54')]['id'];}return db['SmsQueue'][_0x433f('0x4a')]({'where':{'id':_0x3c6c8a[_0x433f('0x47')]['id']}})[_0x433f('0x29')](handleEntityNotFound(_0x10023d,null))[_0x433f('0x29')](saveUpdates(_0x3c6c8a[_0x433f('0x54')],null))[_0x433f('0x29')](respondWithResult(_0x10023d,null))[_0x433f('0x52')](handleError(_0x10023d,null));};exports[_0x433f('0x2c')]=function(_0x245920,_0x5db7b6){return db[_0x433f('0x42')]['find']({'where':{'id':_0x245920[_0x433f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5db7b6,null))[_0x433f('0x29')](removeEntity(_0x5db7b6,null))[_0x433f('0x52')](handleError(_0x5db7b6,null));};exports[_0x433f('0x55')]=function(_0x1911d5,_0x214e3d){return db[_0x433f('0x42')][_0x433f('0x55')]()['then'](respondWithResult(_0x214e3d,null))[_0x433f('0x52')](handleError(_0x214e3d,null));};exports[_0x433f('0x56')]=function(_0x5c7b84,_0x37d748,_0x5ad28b){var _0x1850db={'raw':!![],'where':{}},_0x447af2={},_0x47c203;return db[_0x433f('0x42')][_0x433f('0x57')]({'where':{'id':_0x5c7b84[_0x433f('0x47')]['id']}})[_0x433f('0x29')](handleEntityNotFound(_0x37d748,null))[_0x433f('0x29')](function(_0x4ba3a6){if(_0x4ba3a6){_0x47c203=_0x4ba3a6[_0x433f('0x4d')]({'plain':!![]});_0x447af2[_0x433f('0x35')]=_[_0x433f('0x37')](db[_0x433f('0x58')]['rawAttributes']);_0x447af2[_0x433f('0x36')]=_[_0x433f('0x37')](_0x5c7b84[_0x433f('0x36')]);_0x447af2[_0x433f('0x38')]=_[_0x433f('0x39')](_0x447af2[_0x433f('0x35')],_0x447af2[_0x433f('0x36')]);_0x1850db[_0x433f('0x3b')]=_[_0x433f('0x39')](_0x447af2[_0x433f('0x35')],qs[_0x433f('0x3a')](_0x5c7b84['query'][_0x433f('0x3a')]));_0x1850db['attributes']=_0x1850db[_0x433f('0x3b')]['length']?_0x1850db['attributes']:_0x447af2[_0x433f('0x35')];if(!_0x5c7b84[_0x433f('0x36')][_0x433f('0x59')]('nolimit')){_0x1850db[_0x433f('0x22')]=qs[_0x433f('0x22')](_0x5c7b84[_0x433f('0x36')][_0x433f('0x22')]);_0x1850db[_0x433f('0x20')]=qs[_0x433f('0x20')](_0x5c7b84['query'][_0x433f('0x20')]);}_0x1850db['order']=qs[_0x433f('0x3d')](_0x5c7b84[_0x433f('0x36')][_0x433f('0x3d')]);_0x1850db[_0x433f('0x3e')]=qs[_0x433f('0x38')](_[_0x433f('0x5a')](_0x5c7b84['query'],_0x447af2[_0x433f('0x38')]));_0x1850db['where']['SmsQueueId']=_0x4ba3a6['id'];if(_0x5c7b84[_0x433f('0x36')][_0x433f('0x3f')]){_0x1850db[_0x433f('0x3e')]=_['merge'](_0x1850db[_0x433f('0x3e')],{'$or':_[_0x433f('0x31')](_0x1850db[_0x433f('0x3b')],function(_0xc9186){var _0x47e969={};_0x47e969[_0xc9186]={'$like':'%'+_0x5c7b84[_0x433f('0x36')][_0x433f('0x3f')]+'%'};return _0x47e969;})});}_0x1850db=_['merge']({},_0x1850db,_0x5c7b84['options']);return db[_0x433f('0x58')][_0x433f('0x44')](_0x1850db);}})['then'](function(_0x159c96){if(_0x159c96){return db[_0x433f('0x5b')][_0x433f('0x5c')]({'where':{'id':_[_0x433f('0x31')](_0x159c96,'UserId'),'role':'agent'},'attributes':['id',_0x433f('0x2f'),'smsPause',_0x433f('0x5d'),'createdAt']});}})[_0x433f('0x29')](function(_0x4d2f23){if(_0x4d2f23){return{'count':_0x4d2f23[_0x433f('0x23')],'rows':_[_0x433f('0x31')](_0x4d2f23[_0x433f('0x45')],function(_0x3fb802){return{'membername':_0x3fb802['name'],'UserId':_0x3fb802['id'],'queue_name':_0x47c203[_0x433f('0x2f')],'SmsQueueId':_0x47c203['id'],'interface':util['format']('%s/%s','SIP',_0x3fb802['name']),'penalty':0x0,'paused':_0x3fb802[_0x433f('0x5e')],'createdAt':_0x3fb802['createdAt'],'updatedAt':_0x3fb802['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x433f('0x29')](respondWithFilteredResult(_0x37d748,_0x1850db))[_0x433f('0x52')](handleError(_0x37d748,null));};exports[_0x433f('0x5f')]=function(_0x5609cc,_0x3be62f,_0x6734cb){var _0x2dbe9a={};var _0x5645a3={};var _0x5b831a;var _0x13de50;return db[_0x433f('0x42')][_0x433f('0x57')]({'where':{'id':_0x5609cc[_0x433f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3be62f,null))[_0x433f('0x29')](function(_0x320570){if(_0x320570){_0x5b831a=_0x320570;_0x5645a3[_0x433f('0x35')]=_['keys'](db[_0x433f('0x60')][_0x433f('0x32')]);_0x5645a3['query']=_[_0x433f('0x37')](_0x5609cc[_0x433f('0x36')]);_0x5645a3[_0x433f('0x38')]=_['intersection'](_0x5645a3[_0x433f('0x35')],_0x5645a3[_0x433f('0x36')]);_0x2dbe9a['attributes']=_[_0x433f('0x39')](_0x5645a3[_0x433f('0x35')],qs[_0x433f('0x3a')](_0x5609cc[_0x433f('0x36')][_0x433f('0x3a')]));_0x2dbe9a[_0x433f('0x3b')]=_0x2dbe9a['attributes'][_0x433f('0x61')]?_0x2dbe9a[_0x433f('0x3b')]:_0x5645a3[_0x433f('0x35')];_0x2dbe9a[_0x433f('0x62')]=qs[_0x433f('0x3d')](_0x5609cc[_0x433f('0x36')]['sort']);_0x2dbe9a['where']=qs[_0x433f('0x38')](_['pick'](_0x5609cc[_0x433f('0x36')],_0x5645a3[_0x433f('0x38')]));if(_0x5609cc[_0x433f('0x36')][_0x433f('0x3f')]){_0x2dbe9a['where']=_['merge'](_0x2dbe9a[_0x433f('0x3e')],{'$or':_[_0x433f('0x31')](_0x2dbe9a[_0x433f('0x3b')],function(_0x324d9f){var _0x275199={};_0x275199[_0x324d9f]={'$like':'%'+_0x5609cc[_0x433f('0x36')][_0x433f('0x3f')]+'%'};return _0x275199;})});}_0x2dbe9a=_[_0x433f('0x49')]({},_0x2dbe9a,_0x5609cc[_0x433f('0x41')]);return _0x5b831a[_0x433f('0x5f')](_0x2dbe9a);}})['then'](function(_0x483795){if(_0x483795){_0x13de50=_0x483795['length'];if(!_0x5609cc['query'][_0x433f('0x59')](_0x433f('0x3c'))){_0x2dbe9a[_0x433f('0x22')]=qs['limit'](_0x5609cc[_0x433f('0x36')][_0x433f('0x22')]);_0x2dbe9a['offset']=qs[_0x433f('0x20')](_0x5609cc[_0x433f('0x36')][_0x433f('0x20')]);}return _0x5b831a[_0x433f('0x5f')](_0x2dbe9a);}})['then'](function(_0x5c75dc){if(_0x5c75dc){return _0x5c75dc?{'count':_0x13de50,'rows':_0x5c75dc}:null;}})[_0x433f('0x29')](respondWithResult(_0x3be62f,null))[_0x433f('0x52')](handleError(_0x3be62f,null));};exports[_0x433f('0x63')]=function(_0x3549d0,_0x292399,_0x140351){var _0x427db1=_0x3549d0[_0x433f('0x54')]['ids'];return db[_0x433f('0x60')][_0x433f('0x44')]({'where':{'id':_0x427db1},'attributes':['id'],'include':[{'model':db[_0x433f('0x5b')],'as':_0x433f('0x64'),'attributes':['id',_0x433f('0x2f'),_0x433f('0x65'),_0x433f('0x66'),'interface'],'raw':!![]}]})[_0x433f('0x29')](function(_0x24dea4){if(_0x24dea4){var _0x2a345f=_['flatMap'](_0x24dea4,function(_0x4247d2){var _0x3c3b83=_0x4247d2[_0x433f('0x4d')]({'plain':!![]});return _0x3c3b83[_0x433f('0x64')];});return db['SmsQueue'][_0x433f('0x4a')]({'where':{'id':_0x3549d0[_0x433f('0x47')]['id']}})[_0x433f('0x29')](function(_0x41bb3d){return db[_0x433f('0x67')][_0x433f('0x68')](function(_0x57ff72){return _0x41bb3d[_0x433f('0x63')](_0x427db1,{'transaction':_0x57ff72})[_0x433f('0x29')](function(){return BPromise[_0x433f('0x69')](_0x2a345f,function(_0x442191){return db[_0x433f('0x58')][_0x433f('0x6a')]({'where':{'UserId':_0x442191['id'],'SmsQueueId':_0x3549d0[_0x433f('0x47')]['id']},'transaction':_0x57ff72});});})['then'](function(){_0x2a345f[_0x433f('0x6b')](function(_0x41ce3a){socket[_0x433f('0x6c')](_0x433f('0x6d'),{'UserId':_0x41ce3a['id'],'SmsQueueId':_0x41bb3d['id']});});});});});}})[_0x433f('0x29')](respondWithStatusCode(_0x292399,null))[_0x433f('0x52')](handleError(_0x292399,null));};exports['removeTeams']=function(_0x1b3d19,_0x575ca1,_0x32e006){return db['Team'][_0x433f('0x44')]({'where':{'id':_0x1b3d19[_0x433f('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x433f('0x29')](handleEntityNotFound(_0x575ca1,null))[_0x433f('0x29')](function(_0x242cc7){var _0x147442=_['map'](_0x242cc7,'id');var _0x19e276=[];var _0x304c52=[];var _0x2c2a41=squel[_0x433f('0x6e')]();_0x2c2a41[_0x433f('0x6f')](_0x433f('0x70'))[_0x433f('0x71')](_0x433f('0x72'),'tq')[_0x433f('0x73')](_0x433f('0x74'),'ut',_0x433f('0x75'))[_0x433f('0x3e')](_0x433f('0x76'),_0x1b3d19['params']['id']);for(var _0x37a371=0x0;_0x37a371<_0x242cc7['length'];_0x37a371+=0x1){let _0x109f98=_0x242cc7[_0x37a371];for(var _0x547fed=0x0;_0x547fed<_0x109f98['Agents'][_0x433f('0x61')];_0x547fed+=0x1){let _0x482c7d=_0x109f98[_0x433f('0x64')][_0x547fed];var _0x37aafd=_0x2c2a41['clone']();_0x37aafd[_0x433f('0x3e')](_0x433f('0x77'),_0x482c7d['id']);_0x304c52[_0x433f('0x78')](db['sequelize'][_0x433f('0x36')](_0x37aafd[_0x433f('0x79')](),{'type':db['sequelize'][_0x433f('0x7a')]['SELECT']})[_0x433f('0x29')](function(_0x587531){if(_0x587531[_0x433f('0x61')]===0x1){return _0x482c7d['id'];}else{var _0x49f03b=_[_0x433f('0x7b')](_['map'](_0x587531,_0x433f('0x7c')),function(_0x1f4315){return _[_0x433f('0x7d')](_0x147442,_0x1f4315);});if(_0x49f03b){return _0x482c7d['id'];}}}));}}return BPromise['all'](_0x304c52)[_0x433f('0x29')](function(_0x17c94e){_0x19e276=_(_0x19e276)[_0x433f('0x7e')](_0x17c94e)[_0x433f('0x7f')]()[_0x433f('0x80')]();return db[_0x433f('0x42')][_0x433f('0x4a')]({'where':{'id':_0x1b3d19[_0x433f('0x47')]['id']}})[_0x433f('0x29')](function(_0x3124e4){return db[_0x433f('0x67')][_0x433f('0x68')](function(_0x149f72){return _0x3124e4[_0x433f('0x81')](_0x1b3d19[_0x433f('0x36')][_0x433f('0x82')],{'transaction':_0x149f72})[_0x433f('0x29')](function(){if(!_[_0x433f('0x83')](_0x19e276)){return _0x3124e4['removeAgents'](_0x19e276,{'transaction':_0x149f72});}})['then'](function(){_0x19e276['forEach'](function(_0x1b8c58){socket['emit']('userSmsQueue:remove',{'UserId':_0x1b8c58,'SmsQueueId':_0x3124e4['id']});});});});});});})[_0x433f('0x29')](respondWithStatusCode(_0x575ca1,null))[_0x433f('0x52')](handleError(_0x575ca1,null));};exports[_0x433f('0x84')]=function(_0x3abfa6,_0x15302e,_0x124acc){return db[_0x433f('0x42')][_0x433f('0x4a')]({'where':{'id':_0x3abfa6['params']['id']}})[_0x433f('0x29')](handleEntityNotFound(_0x15302e,null))['then'](function(_0x4079d2){if(_0x4079d2){return _0x4079d2[_0x433f('0x84')](_0x3abfa6[_0x433f('0x54')]['ids'],_[_0x433f('0x85')](_0x3abfa6[_0x433f('0x54')],[_0x433f('0x82'),'id'])||{})[_0x433f('0x86')](function(_0x5ddf66){for(var _0x5d51d2=0x0;_0x5d51d2<_0x3abfa6[_0x433f('0x54')][_0x433f('0x82')]['length'];_0x5d51d2+=0x1){socket['emit'](_0x433f('0x6d'),{'UserId':Number(_0x3abfa6[_0x433f('0x54')][_0x433f('0x82')][_0x5d51d2]),'SmsQueueId':Number(_0x3abfa6[_0x433f('0x47')]['id'])});}return _0x5ddf66;});}})[_0x433f('0x29')](respondWithResult(_0x15302e,null))[_0x433f('0x52')](handleError(_0x15302e,null));};exports['removeAgents']=function(_0x56db6d,_0x3745e2,_0x1d353e){return db[_0x433f('0x42')][_0x433f('0x4a')]({'where':{'id':_0x56db6d[_0x433f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3745e2,null))[_0x433f('0x29')](function(_0xed9890){if(_0xed9890){return _0xed9890[_0x433f('0x87')](_0x56db6d[_0x433f('0x36')]['ids'])[_0x433f('0x29')](function(){if(_['isArray'](_0x56db6d[_0x433f('0x36')][_0x433f('0x82')])){for(var _0x16b167=0x0;_0x16b167<_0x56db6d[_0x433f('0x36')][_0x433f('0x82')][_0x433f('0x61')];_0x16b167+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x56db6d[_0x433f('0x36')][_0x433f('0x82')][_0x16b167]),'SmsQueueId':Number(_0x56db6d['params']['id'])});}}else{socket['emit'](_0x433f('0x88'),{'UserId':Number(_0x56db6d[_0x433f('0x36')][_0x433f('0x82')]),'SmsQueueId':Number(_0x56db6d[_0x433f('0x47')]['id'])});}});}})[_0x433f('0x29')](respondWithStatusCode(_0x3745e2,null))[_0x433f('0x52')](handleError(_0x3745e2,null));};exports[_0x433f('0x89')]=function(_0x14c5e4,_0x3540c2,_0x4da0b1){var _0x356c55={};var _0x40ccf1={};var _0x2b6d95;var _0x194805;return db[_0x433f('0x42')][_0x433f('0x57')]({'where':{'id':_0x14c5e4[_0x433f('0x47')]['id']}})[_0x433f('0x29')](handleEntityNotFound(_0x3540c2,null))[_0x433f('0x29')](function(_0x37d150){if(_0x37d150){_0x2b6d95=_0x37d150;_0x40ccf1[_0x433f('0x35')]=_[_0x433f('0x37')](db['User'][_0x433f('0x32')]);_0x40ccf1[_0x433f('0x36')]=_[_0x433f('0x37')](_0x14c5e4['query']);_0x40ccf1['filters']=_[_0x433f('0x39')](_0x40ccf1[_0x433f('0x35')],_0x40ccf1[_0x433f('0x36')]);_0x356c55[_0x433f('0x3b')]=_['intersection'](_0x40ccf1[_0x433f('0x35')],qs[_0x433f('0x3a')](_0x14c5e4[_0x433f('0x36')][_0x433f('0x3a')]));_0x356c55['attributes']=_0x356c55[_0x433f('0x3b')][_0x433f('0x61')]?_0x356c55['attributes']:_0x40ccf1['model'];_0x356c55[_0x433f('0x62')]=qs[_0x433f('0x3d')](_0x14c5e4[_0x433f('0x36')][_0x433f('0x3d')]);_0x356c55[_0x433f('0x3e')]=qs[_0x433f('0x38')](_[_0x433f('0x5a')](_0x14c5e4[_0x433f('0x36')],_0x40ccf1[_0x433f('0x38')]));if(_0x14c5e4[_0x433f('0x36')][_0x433f('0x3f')]){_0x356c55[_0x433f('0x3e')]=_[_0x433f('0x49')](_0x356c55[_0x433f('0x3e')],{'$or':_[_0x433f('0x31')](_0x356c55[_0x433f('0x3b')],function(_0x40a5dc){var _0x1c743a={};_0x1c743a[_0x40a5dc]={'$like':'%'+_0x14c5e4[_0x433f('0x36')]['filter']+'%'};return _0x1c743a;})});}_0x356c55=_[_0x433f('0x49')]({},_0x356c55,_0x14c5e4[_0x433f('0x41')]);return _0x2b6d95[_0x433f('0x89')](_0x356c55);}})[_0x433f('0x29')](function(_0x54acda){if(_0x54acda){_0x194805=_0x54acda['length'];if(!_0x14c5e4[_0x433f('0x36')][_0x433f('0x59')](_0x433f('0x3c'))){_0x356c55[_0x433f('0x22')]=qs[_0x433f('0x22')](_0x14c5e4[_0x433f('0x36')][_0x433f('0x22')]);_0x356c55['offset']=qs['offset'](_0x14c5e4[_0x433f('0x36')][_0x433f('0x20')]);}return _0x2b6d95[_0x433f('0x89')](_0x356c55);}})[_0x433f('0x29')](function(_0x5b719a){if(_0x5b719a){return _0x5b719a?{'count':_0x194805,'rows':_0x5b719a}:null;}})[_0x433f('0x29')](respondWithResult(_0x3540c2,null))[_0x433f('0x52')](handleError(_0x3540c2,null));}; \ No newline at end of file +var _0xc7bd=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json','undefined','count','offset','set','save','update','then','destroy','get','SmsQueues','sendStatus','error','stack','name','send','index','SmsQueue','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','filters','SmsQueueId','UserSmsQueue','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','rawAttributes','getAgents','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x532fc1,_0x3f9c8f){var _0xd58d79=function(_0x209293){while(--_0x209293){_0x532fc1['push'](_0x532fc1['shift']());}};_0xd58d79(++_0x3f9c8f);}(_0xc7bd,0x86));var _0xdc7b=function(_0x43149d,_0x28322a){_0x43149d=_0x43149d-0x0;var _0x2ee89e=_0xc7bd[_0x43149d];return _0x2ee89e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc7b('0x0'));var zipdir=require(_0xdc7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc7b('0x2'));var moment=require('moment');var BPromise=require(_0xdc7b('0x3'));var Mustache=require('mustache');var util=require(_0xdc7b('0x4'));var path=require(_0xdc7b('0x5'));var sox=require(_0xdc7b('0x6'));var csv=require(_0xdc7b('0x7'));var ejs=require(_0xdc7b('0x8'));var fs=require('fs');var fs_extra=require(_0xdc7b('0x9'));var _=require(_0xdc7b('0xa'));var squel=require('squel');var crypto=require(_0xdc7b('0xb'));var jsforce=require(_0xdc7b('0xc'));var deskjs=require(_0xdc7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc7b('0xe'));var Redis=require(_0xdc7b('0xf'));var authService=require(_0xdc7b('0x10'));var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')(_0xdc7b('0x14'));var utils=require(_0xdc7b('0x15'));var config=require(_0xdc7b('0x16'));var licenseUtil=require(_0xdc7b('0x17'));var db=require(_0xdc7b('0x18'))['db'];config[_0xdc7b('0x19')]=_['defaults'](config[_0xdc7b('0x19')],{'host':_0xdc7b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc7b('0x19')]));require('./smsQueue.socket')[_0xdc7b('0x1b')](socket);function respondWithStatusCode(_0x23d458,_0x22e150){_0x22e150=_0x22e150||0xcc;return function(_0x355090){if(_0x355090){return _0x23d458['sendStatus'](_0x22e150);}return _0x23d458[_0xdc7b('0x1c')](_0x22e150)[_0xdc7b('0x1d')]();};}function respondWithResult(_0x5e0281,_0x35c671){_0x35c671=_0x35c671||0xc8;return function(_0x12b8ca){if(_0x12b8ca){return _0x5e0281[_0xdc7b('0x1c')](_0x35c671)[_0xdc7b('0x1e')](_0x12b8ca);}};}function respondWithFilteredResult(_0x19b289,_0x3fc4f0){return function(_0x39cb1c){if(_0x39cb1c){var _0x25334e=typeof _0x3fc4f0['offset']===_0xdc7b('0x1f')&&typeof _0x3fc4f0['limit']===_0xdc7b('0x1f');var _0x5bcc30=_0x39cb1c[_0xdc7b('0x20')];var _0x435c3a=_0x25334e?0x0:_0x3fc4f0[_0xdc7b('0x21')];var _0x372728=_0x25334e?_0x39cb1c[_0xdc7b('0x20')]:_0x3fc4f0['offset']+_0x3fc4f0['limit'];var _0x500458;if(_0x372728>=_0x5bcc30){_0x372728=_0x5bcc30;_0x500458=0xc8;}else{_0x500458=0xce;}_0x19b289[_0xdc7b('0x1c')](_0x500458);return _0x19b289[_0xdc7b('0x22')]('Content-Range',_0x435c3a+'-'+_0x372728+'/'+_0x5bcc30)[_0xdc7b('0x1e')](_0x39cb1c);}return null;};}function patchUpdates(_0x25ec2e){return function(_0x144a3c){try{jsonpatch['apply'](_0x144a3c,_0x25ec2e,!![]);}catch(_0x3c1783){return BPromise['reject'](_0x3c1783);}return _0x144a3c[_0xdc7b('0x23')]();};}function saveUpdates(_0x2a1fca,_0x213d0c){return function(_0x46255c){if(_0x46255c){return _0x46255c[_0xdc7b('0x24')](_0x2a1fca)[_0xdc7b('0x25')](function(_0x10c260){return _0x10c260;});}return null;};}function removeEntity(_0x626ed6,_0x4e97c9){return function(_0x5b6ad7){if(_0x5b6ad7){return _0x5b6ad7[_0xdc7b('0x26')]()[_0xdc7b('0x25')](function(){var _0x21d40b=_0x5b6ad7[_0xdc7b('0x27')]({'plain':!![]});var _0x52b346=_0xdc7b('0x28');return db['UserProfileResource'][_0xdc7b('0x26')]({'where':{'type':_0x52b346,'resourceId':_0x21d40b['id']}})[_0xdc7b('0x25')](function(){return _0x5b6ad7;});})[_0xdc7b('0x25')](function(){_0x626ed6['status'](0xcc)[_0xdc7b('0x1d')]();});}};}function handleEntityNotFound(_0x102288,_0x2cfd85){return function(_0x1eefbb){if(!_0x1eefbb){_0x102288[_0xdc7b('0x29')](0x194);}return _0x1eefbb;};}function handleError(_0x4fb2a8,_0x3d3751){_0x3d3751=_0x3d3751||0x1f4;return function(_0x1f795d){logger[_0xdc7b('0x2a')](_0x1f795d[_0xdc7b('0x2b')]);if(_0x1f795d['name']){delete _0x1f795d[_0xdc7b('0x2c')];}_0x4fb2a8[_0xdc7b('0x1c')](_0x3d3751)[_0xdc7b('0x2d')](_0x1f795d);};}exports[_0xdc7b('0x2e')]=function(_0x4ad851,_0x18df1f){var _0x12a3b8={},_0x3092a1={},_0x1d805d={'count':0x0,'rows':[]};var _0x195d45=_['map'](db[_0xdc7b('0x2f')]['rawAttributes'],function(_0xff18c6){return{'name':_0xff18c6[_0xdc7b('0x30')],'type':_0xff18c6[_0xdc7b('0x31')]['key']};});_0x3092a1[_0xdc7b('0x32')]=_[_0xdc7b('0x33')](_0x195d45,_0xdc7b('0x2c'));_0x3092a1['query']=_[_0xdc7b('0x34')](_0x4ad851[_0xdc7b('0x35')]);_0x3092a1['filters']=_[_0xdc7b('0x36')](_0x3092a1['model'],_0x3092a1[_0xdc7b('0x35')]);_0x12a3b8[_0xdc7b('0x37')]=_['intersection'](_0x3092a1[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x12a3b8[_0xdc7b('0x37')]=_0x12a3b8[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0x12a3b8[_0xdc7b('0x37')]:_0x3092a1['model'];if(!_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x12a3b8['limit']=qs['limit'](_0x4ad851['query'][_0xdc7b('0x3c')]);_0x12a3b8[_0xdc7b('0x21')]=qs[_0xdc7b('0x21')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x21')]);}_0x12a3b8[_0xdc7b('0x3d')]=qs[_0xdc7b('0x3e')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x12a3b8[_0xdc7b('0x3f')]=qs['filters'](_[_0xdc7b('0x40')](_0x4ad851[_0xdc7b('0x35')],_0x3092a1['filters']),_0x195d45);if(_0x4ad851['query'][_0xdc7b('0x41')]){_0x12a3b8[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x12a3b8[_0xdc7b('0x3f')],{'$or':_[_0xdc7b('0x33')](_0x195d45,function(_0x265df8){if(_0x265df8[_0xdc7b('0x31')]!==_0xdc7b('0x43')){var _0x151a4e={};_0x151a4e[_0x265df8[_0xdc7b('0x2c')]]={'$like':'%'+_0x4ad851['query'][_0xdc7b('0x41')]+'%'};return _0x151a4e;}})});}_0x12a3b8=_[_0xdc7b('0x42')]({},_0x12a3b8,_0x4ad851[_0xdc7b('0x44')]);var _0x517246={'where':_0x12a3b8[_0xdc7b('0x3f')]};return db[_0xdc7b('0x2f')][_0xdc7b('0x20')](_0x517246)[_0xdc7b('0x25')](function(_0x398133){_0x1d805d[_0xdc7b('0x20')]=_0x398133;if(_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x45')]){_0x12a3b8[_0xdc7b('0x46')]=[{'all':!![]}];}return db[_0xdc7b('0x2f')]['findAll'](_0x12a3b8);})[_0xdc7b('0x25')](function(_0x131643){_0x1d805d[_0xdc7b('0x47')]=_0x131643;return _0x1d805d;})[_0xdc7b('0x25')](respondWithFilteredResult(_0x18df1f,_0x12a3b8))[_0xdc7b('0x48')](handleError(_0x18df1f,null));};exports['show']=function(_0x21b0ac,_0xe1d379){var _0xc8470c={'raw':!![],'where':{'id':_0x21b0ac[_0xdc7b('0x49')]['id']}},_0x577ce0={};_0x577ce0[_0xdc7b('0x32')]=_[_0xdc7b('0x34')](db[_0xdc7b('0x2f')]['rawAttributes']);_0x577ce0['query']=_[_0xdc7b('0x34')](_0x21b0ac['query']);_0x577ce0['filters']=_[_0xdc7b('0x36')](_0x577ce0[_0xdc7b('0x32')],_0x577ce0[_0xdc7b('0x35')]);_0xc8470c[_0xdc7b('0x37')]=_[_0xdc7b('0x36')](_0x577ce0[_0xdc7b('0x32')],qs['fields'](_0x21b0ac['query'][_0xdc7b('0x38')]));_0xc8470c[_0xdc7b('0x37')]=_0xc8470c[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0xc8470c[_0xdc7b('0x37')]:_0x577ce0[_0xdc7b('0x32')];if(_0x21b0ac[_0xdc7b('0x35')][_0xdc7b('0x45')]){_0xc8470c[_0xdc7b('0x46')]=[{'all':!![]}];}_0xc8470c=_[_0xdc7b('0x42')]({},_0xc8470c,_0x21b0ac[_0xdc7b('0x44')]);return db['SmsQueue'][_0xdc7b('0x4a')](_0xc8470c)[_0xdc7b('0x25')](handleEntityNotFound(_0xe1d379,null))['then'](respondWithResult(_0xe1d379,null))['catch'](handleError(_0xe1d379,null));};exports[_0xdc7b('0x4b')]=function(_0x3a6b7f,_0x1c063e){return db[_0xdc7b('0x2f')][_0xdc7b('0x4b')](_0x3a6b7f[_0xdc7b('0x4c')],{})[_0xdc7b('0x25')](function(_0x36ef7e){var _0x594f6c=_0x3a6b7f['user'][_0xdc7b('0x27')]({'plain':!![]});if(!_0x594f6c)throw new Error(_0xdc7b('0x4d'));if(_0x594f6c[_0xdc7b('0x4e')]==='user'){var _0x5e8331=_0x36ef7e[_0xdc7b('0x27')]({'plain':!![]});var _0x1ecaf0='SmsQueues';return db[_0xdc7b('0x4f')][_0xdc7b('0x4a')]({'where':{'name':_0x1ecaf0,'userProfileId':_0x594f6c['userProfileId']},'raw':!![]})[_0xdc7b('0x25')](function(_0x29ef3d){if(_0x29ef3d&&_0x29ef3d[_0xdc7b('0x50')]===0x0){return db[_0xdc7b('0x51')]['create']({'name':_0x5e8331[_0xdc7b('0x2c')],'resourceId':_0x5e8331['id'],'type':_0x29ef3d[_0xdc7b('0x2c')],'sectionId':_0x29ef3d['id']},{})[_0xdc7b('0x25')](function(){return _0x36ef7e;});}else{return _0x36ef7e;}})[_0xdc7b('0x48')](function(_0x5bd3af){logger[_0xdc7b('0x2a')](_0xdc7b('0x52'),_0x5bd3af);throw _0x5bd3af;});}return _0x36ef7e;})[_0xdc7b('0x25')](respondWithResult(_0x1c063e,0xc9))['catch'](handleError(_0x1c063e,null));};exports[_0xdc7b('0x24')]=function(_0x3bfc4c,_0x1733fa){if(_0x3bfc4c[_0xdc7b('0x4c')]['id']){delete _0x3bfc4c[_0xdc7b('0x4c')]['id'];}return db['SmsQueue'][_0xdc7b('0x4a')]({'where':{'id':_0x3bfc4c[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x1733fa,null))[_0xdc7b('0x25')](saveUpdates(_0x3bfc4c[_0xdc7b('0x4c')],null))[_0xdc7b('0x25')](respondWithResult(_0x1733fa,null))[_0xdc7b('0x48')](handleError(_0x1733fa,null));};exports[_0xdc7b('0x26')]=function(_0x5993cf,_0x71dca4){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x5993cf[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x71dca4,null))[_0xdc7b('0x25')](removeEntity(_0x71dca4,null))[_0xdc7b('0x48')](handleError(_0x71dca4,null));};exports[_0xdc7b('0x53')]=function(_0xfeeda4,_0x44e093){return db[_0xdc7b('0x2f')][_0xdc7b('0x53')]()['then'](respondWithResult(_0x44e093,null))[_0xdc7b('0x48')](handleError(_0x44e093,null));};exports['getMembers']=function(_0x2e2eef,_0x475708,_0x5ef37d){var _0x3dd54e={'raw':!![],'where':{}},_0xd13ed5={},_0x383d83;return db[_0xdc7b('0x2f')][_0xdc7b('0x54')]({'where':{'id':_0x2e2eef[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x475708,null))[_0xdc7b('0x25')](function(_0x20e41d){if(_0x20e41d){_0x383d83=_0x20e41d[_0xdc7b('0x27')]({'plain':!![]});_0xd13ed5[_0xdc7b('0x32')]=_[_0xdc7b('0x34')](db['UserSmsQueue']['rawAttributes']);_0xd13ed5[_0xdc7b('0x35')]=_[_0xdc7b('0x34')](_0x2e2eef['query']);_0xd13ed5['filters']=_['intersection'](_0xd13ed5[_0xdc7b('0x32')],_0xd13ed5[_0xdc7b('0x35')]);_0x3dd54e['attributes']=_[_0xdc7b('0x36')](_0xd13ed5[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x3dd54e[_0xdc7b('0x37')]=_0x3dd54e[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0x3dd54e[_0xdc7b('0x37')]:_0xd13ed5[_0xdc7b('0x32')];if(!_0x2e2eef[_0xdc7b('0x35')]['hasOwnProperty']('nolimit')){_0x3dd54e[_0xdc7b('0x3c')]=qs['limit'](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x3c')]);_0x3dd54e['offset']=qs[_0xdc7b('0x21')](_0x2e2eef['query'][_0xdc7b('0x21')]);}_0x3dd54e[_0xdc7b('0x3d')]=qs['sort'](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x3dd54e[_0xdc7b('0x3f')]=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x2e2eef[_0xdc7b('0x35')],_0xd13ed5[_0xdc7b('0x55')]));_0x3dd54e['where'][_0xdc7b('0x56')]=_0x20e41d['id'];if(_0x2e2eef[_0xdc7b('0x35')]['filter']){_0x3dd54e[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x3dd54e['where'],{'$or':_[_0xdc7b('0x33')](_0x3dd54e[_0xdc7b('0x37')],function(_0x4e7590){var _0x346b8c={};_0x346b8c[_0x4e7590]={'$like':'%'+_0x2e2eef['query']['filter']+'%'};return _0x346b8c;})});}_0x3dd54e=_[_0xdc7b('0x42')]({},_0x3dd54e,_0x2e2eef[_0xdc7b('0x44')]);return db[_0xdc7b('0x57')][_0xdc7b('0x58')](_0x3dd54e);}})[_0xdc7b('0x25')](function(_0x5bf580){if(_0x5bf580){return db[_0xdc7b('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x5bf580,_0xdc7b('0x5a')),'role':_0xdc7b('0x5b')},'attributes':['id',_0xdc7b('0x2c'),_0xdc7b('0x5c'),_0xdc7b('0x5d'),_0xdc7b('0x5e')]});}})[_0xdc7b('0x25')](function(_0xc7577c){if(_0xc7577c){return{'count':_0xc7577c[_0xdc7b('0x20')],'rows':_[_0xdc7b('0x33')](_0xc7577c[_0xdc7b('0x47')],function(_0xc60a5e){return{'membername':_0xc60a5e[_0xdc7b('0x2c')],'UserId':_0xc60a5e['id'],'queue_name':_0x383d83['name'],'SmsQueueId':_0x383d83['id'],'interface':util['format'](_0xdc7b('0x5f'),_0xdc7b('0x60'),_0xc60a5e['name']),'penalty':0x0,'paused':_0xc60a5e[_0xdc7b('0x5c')],'createdAt':_0xc60a5e['createdAt'],'updatedAt':_0xc60a5e[_0xdc7b('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdc7b('0x25')](respondWithFilteredResult(_0x475708,_0x3dd54e))[_0xdc7b('0x48')](handleError(_0x475708,null));};exports[_0xdc7b('0x61')]=function(_0x307e8c,_0x4130bb,_0x3ecdc4){var _0x842451={};var _0x31c684={};var _0x2958d8;var _0x5b8574;return db[_0xdc7b('0x2f')]['findOne']({'where':{'id':_0x307e8c[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x4130bb,null))[_0xdc7b('0x25')](function(_0x41ce02){if(_0x41ce02){_0x2958d8=_0x41ce02;_0x31c684[_0xdc7b('0x32')]=_['keys'](db[_0xdc7b('0x62')]['rawAttributes']);_0x31c684[_0xdc7b('0x35')]=_[_0xdc7b('0x34')](_0x307e8c['query']);_0x31c684[_0xdc7b('0x55')]=_[_0xdc7b('0x36')](_0x31c684['model'],_0x31c684[_0xdc7b('0x35')]);_0x842451['attributes']=_[_0xdc7b('0x36')](_0x31c684['model'],qs[_0xdc7b('0x38')](_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x842451[_0xdc7b('0x37')]=_0x842451['attributes'][_0xdc7b('0x39')]?_0x842451[_0xdc7b('0x37')]:_0x31c684[_0xdc7b('0x32')];_0x842451[_0xdc7b('0x3d')]=qs['sort'](_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x842451['where']=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x307e8c['query'],_0x31c684[_0xdc7b('0x55')]));if(_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x41')]){_0x842451['where']=_[_0xdc7b('0x42')](_0x842451['where'],{'$or':_[_0xdc7b('0x33')](_0x842451['attributes'],function(_0x4a9a20){var _0x3de7c7={};_0x3de7c7[_0x4a9a20]={'$like':'%'+_0x307e8c['query']['filter']+'%'};return _0x3de7c7;})});}_0x842451=_[_0xdc7b('0x42')]({},_0x842451,_0x307e8c['options']);return _0x2958d8[_0xdc7b('0x61')](_0x842451);}})[_0xdc7b('0x25')](function(_0x3b8b1f){if(_0x3b8b1f){_0x5b8574=_0x3b8b1f[_0xdc7b('0x39')];if(!_0x307e8c['query'][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x842451[_0xdc7b('0x3c')]=qs[_0xdc7b('0x3c')](_0x307e8c['query'][_0xdc7b('0x3c')]);_0x842451['offset']=qs['offset'](_0x307e8c['query'][_0xdc7b('0x21')]);}return _0x2958d8[_0xdc7b('0x61')](_0x842451);}})[_0xdc7b('0x25')](function(_0x4dd710){if(_0x4dd710){return _0x4dd710?{'count':_0x5b8574,'rows':_0x4dd710}:null;}})[_0xdc7b('0x25')](respondWithResult(_0x4130bb,null))[_0xdc7b('0x48')](handleError(_0x4130bb,null));};exports[_0xdc7b('0x63')]=function(_0x57cd68,_0x448e2b,_0x359acc){var _0x5da655=_0x57cd68[_0xdc7b('0x4c')]['ids'];return db[_0xdc7b('0x62')][_0xdc7b('0x58')]({'where':{'id':_0x5da655},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdc7b('0x64'),'attributes':['id',_0xdc7b('0x2c'),_0xdc7b('0x65'),_0xdc7b('0x66'),_0xdc7b('0x67')],'raw':!![]}]})[_0xdc7b('0x25')](function(_0x2936e1){if(_0x2936e1){var _0x34f4d9=_[_0xdc7b('0x68')](_0x2936e1,function(_0x4a4b0c){var _0x4d336d=_0x4a4b0c[_0xdc7b('0x27')]({'plain':!![]});return _0x4d336d[_0xdc7b('0x64')];});return db[_0xdc7b('0x2f')]['find']({'where':{'id':_0x57cd68[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](function(_0x28f80b){return db[_0xdc7b('0x69')][_0xdc7b('0x6a')](function(_0x34f897){return _0x28f80b[_0xdc7b('0x63')](_0x5da655,{'transaction':_0x34f897})[_0xdc7b('0x25')](function(){return BPromise[_0xdc7b('0x6b')](_0x34f4d9,function(_0x42be7e){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x42be7e['id'],'SmsQueueId':_0x57cd68[_0xdc7b('0x49')]['id']},'transaction':_0x34f897});});})[_0xdc7b('0x25')](function(){_0x34f4d9[_0xdc7b('0x6c')](function(_0x34a94e){socket[_0xdc7b('0x6d')](_0xdc7b('0x6e'),{'UserId':_0x34a94e['id'],'SmsQueueId':_0x28f80b['id']});});});});});}})[_0xdc7b('0x25')](respondWithStatusCode(_0x448e2b,null))[_0xdc7b('0x48')](handleError(_0x448e2b,null));};exports['removeTeams']=function(_0x46370b,_0x1b307a,_0x301e1a){return db[_0xdc7b('0x62')][_0xdc7b('0x58')]({'where':{'id':_0x46370b[_0xdc7b('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdc7b('0x59')],'as':_0xdc7b('0x64'),'attributes':['id'],'raw':!![]}]})[_0xdc7b('0x25')](handleEntityNotFound(_0x1b307a,null))['then'](function(_0x43a3d5){var _0x3a6704=_['map'](_0x43a3d5,'id');var _0x525099=[];var _0x58f693=[];var _0x551760=squel[_0xdc7b('0x6f')]();_0x551760[_0xdc7b('0x70')](_0xdc7b('0x71'))[_0xdc7b('0x72')](_0xdc7b('0x73'),'tq')[_0xdc7b('0x74')](_0xdc7b('0x75'),'ut',_0xdc7b('0x76'))[_0xdc7b('0x3f')](_0xdc7b('0x77'),_0x46370b[_0xdc7b('0x49')]['id']);for(var _0x2b78ab=0x0;_0x2b78ab<_0x43a3d5[_0xdc7b('0x39')];_0x2b78ab+=0x1){let _0x8501da=_0x43a3d5[_0x2b78ab];for(var _0xc4133f=0x0;_0xc4133f<_0x8501da['Agents'][_0xdc7b('0x39')];_0xc4133f+=0x1){let _0x19bfd5=_0x8501da['Agents'][_0xc4133f];var _0x2c728f=_0x551760[_0xdc7b('0x78')]();_0x2c728f[_0xdc7b('0x3f')](_0xdc7b('0x79'),_0x19bfd5['id']);_0x58f693[_0xdc7b('0x7a')](db[_0xdc7b('0x69')][_0xdc7b('0x35')](_0x2c728f[_0xdc7b('0x7b')](),{'type':db[_0xdc7b('0x69')][_0xdc7b('0x7c')][_0xdc7b('0x7d')]})[_0xdc7b('0x25')](function(_0x35d52a){if(_0x35d52a['length']===0x1){return _0x19bfd5['id'];}else{var _0x580f97=_[_0xdc7b('0x7e')](_[_0xdc7b('0x33')](_0x35d52a,_0xdc7b('0x7f')),function(_0x1740c9){return _[_0xdc7b('0x80')](_0x3a6704,_0x1740c9);});if(_0x580f97){return _0x19bfd5['id'];}}}));}}return BPromise[_0xdc7b('0x81')](_0x58f693)['then'](function(_0xecf498){_0x525099=_(_0x525099)[_0xdc7b('0x82')](_0xecf498)[_0xdc7b('0x83')]()[_0xdc7b('0x84')]();return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x46370b[_0xdc7b('0x49')]['id']}})['then'](function(_0x46966f){return db['sequelize'][_0xdc7b('0x6a')](function(_0x59d808){return _0x46966f['removeTeams'](_0x46370b[_0xdc7b('0x35')][_0xdc7b('0x85')],{'transaction':_0x59d808})[_0xdc7b('0x25')](function(){if(!_[_0xdc7b('0x86')](_0x525099)){return _0x46966f[_0xdc7b('0x87')](_0x525099,{'transaction':_0x59d808});}})[_0xdc7b('0x25')](function(){_0x525099['forEach'](function(_0x493557){socket['emit'](_0xdc7b('0x88'),{'UserId':_0x493557,'SmsQueueId':_0x46966f['id']});});});});});});})[_0xdc7b('0x25')](respondWithStatusCode(_0x1b307a,null))[_0xdc7b('0x48')](handleError(_0x1b307a,null));};exports[_0xdc7b('0x89')]=function(_0x342b32,_0xee0d8b,_0x160638){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x342b32[_0xdc7b('0x49')]['id']}})['then'](handleEntityNotFound(_0xee0d8b,null))['then'](function(_0x413a5a){if(_0x413a5a){return _0x413a5a[_0xdc7b('0x89')](_0x342b32[_0xdc7b('0x4c')][_0xdc7b('0x85')],_[_0xdc7b('0x8a')](_0x342b32['body'],['ids','id'])||{})[_0xdc7b('0x8b')](function(_0x11bd50){for(var _0x455e65=0x0;_0x455e65<_0x342b32[_0xdc7b('0x4c')][_0xdc7b('0x85')]['length'];_0x455e65+=0x1){socket[_0xdc7b('0x6d')](_0xdc7b('0x6e'),{'UserId':Number(_0x342b32['body']['ids'][_0x455e65]),'SmsQueueId':Number(_0x342b32[_0xdc7b('0x49')]['id'])});}return _0x11bd50;});}})[_0xdc7b('0x25')](respondWithResult(_0xee0d8b,null))['catch'](handleError(_0xee0d8b,null));};exports[_0xdc7b('0x87')]=function(_0x470a0f,_0x41ca82,_0x33f255){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x470a0f['params']['id']}})['then'](handleEntityNotFound(_0x41ca82,null))[_0xdc7b('0x25')](function(_0x1f86bf){if(_0x1f86bf){return _0x1f86bf[_0xdc7b('0x87')](_0x470a0f['query'][_0xdc7b('0x85')])['then'](function(){if(_['isArray'](_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')])){for(var _0x3d3c8e=0x0;_0x3d3c8e<_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')][_0xdc7b('0x39')];_0x3d3c8e+=0x1){socket[_0xdc7b('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x470a0f[_0xdc7b('0x35')]['ids'][_0x3d3c8e]),'SmsQueueId':Number(_0x470a0f[_0xdc7b('0x49')]['id'])});}}else{socket[_0xdc7b('0x6d')](_0xdc7b('0x88'),{'UserId':Number(_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')]),'SmsQueueId':Number(_0x470a0f[_0xdc7b('0x49')]['id'])});}});}})[_0xdc7b('0x25')](respondWithStatusCode(_0x41ca82,null))['catch'](handleError(_0x41ca82,null));};exports['getAgents']=function(_0x39d63d,_0x563791,_0x3d0ed0){var _0x3b123d={};var _0x1e0213={};var _0x14b37a;var _0x1906d6;return db['SmsQueue'][_0xdc7b('0x54')]({'where':{'id':_0x39d63d[_0xdc7b('0x49')]['id']}})['then'](handleEntityNotFound(_0x563791,null))[_0xdc7b('0x25')](function(_0x1fbb70){if(_0x1fbb70){_0x14b37a=_0x1fbb70;_0x1e0213['model']=_[_0xdc7b('0x34')](db[_0xdc7b('0x59')][_0xdc7b('0x8c')]);_0x1e0213['query']=_[_0xdc7b('0x34')](_0x39d63d[_0xdc7b('0x35')]);_0x1e0213[_0xdc7b('0x55')]=_[_0xdc7b('0x36')](_0x1e0213['model'],_0x1e0213[_0xdc7b('0x35')]);_0x3b123d[_0xdc7b('0x37')]=_['intersection'](_0x1e0213[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x3b123d['attributes']=_0x3b123d['attributes'][_0xdc7b('0x39')]?_0x3b123d[_0xdc7b('0x37')]:_0x1e0213['model'];_0x3b123d[_0xdc7b('0x3d')]=qs[_0xdc7b('0x3e')](_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x3b123d[_0xdc7b('0x3f')]=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x39d63d[_0xdc7b('0x35')],_0x1e0213['filters']));if(_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x41')]){_0x3b123d[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x3b123d[_0xdc7b('0x3f')],{'$or':_['map'](_0x3b123d[_0xdc7b('0x37')],function(_0x2eba4d){var _0xd577c0={};_0xd577c0[_0x2eba4d]={'$like':'%'+_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x41')]+'%'};return _0xd577c0;})});}_0x3b123d=_[_0xdc7b('0x42')]({},_0x3b123d,_0x39d63d[_0xdc7b('0x44')]);return _0x14b37a['getAgents'](_0x3b123d);}})['then'](function(_0x4f6e8d){if(_0x4f6e8d){_0x1906d6=_0x4f6e8d[_0xdc7b('0x39')];if(!_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x3b123d[_0xdc7b('0x3c')]=qs['limit'](_0x39d63d[_0xdc7b('0x35')]['limit']);_0x3b123d[_0xdc7b('0x21')]=qs[_0xdc7b('0x21')](_0x39d63d['query'][_0xdc7b('0x21')]);}return _0x14b37a[_0xdc7b('0x8d')](_0x3b123d);}})[_0xdc7b('0x25')](function(_0x117f05){if(_0x117f05){return _0x117f05?{'count':_0x1906d6,'rows':_0x117f05}:null;}})['then'](respondWithResult(_0x563791,null))[_0xdc7b('0x48')](handleError(_0x563791,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 40afcf7..144ee4a 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 _0x9b74=['emit','hasOwnProperty','exports','events','../../mysqldb','update'];(function(_0x28c756,_0x323b17){var _0x4ae47d=function(_0x21a45b){while(--_0x21a45b){_0x28c756['push'](_0x28c756['shift']());}};_0x4ae47d(++_0x323b17);}(_0x9b74,0x1d7));var _0x49b7=function(_0x82fa8e,_0x4d0e43){_0x82fa8e=_0x82fa8e-0x0;var _0x138d5a=_0x9b74[_0x82fa8e];return _0x138d5a;};'use strict';var EventEmitter=require(_0x49b7('0x0'));var SmsQueue=require(_0x49b7('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x49b7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x40dc27){return function(_0x5074c6,_0x1887f3,_0x3f4713){SmsQueueEvents['emit'](_0x40dc27+':'+_0x5074c6['id'],_0x5074c6);SmsQueueEvents[_0x49b7('0x3')](_0x40dc27,_0x5074c6);_0x3f4713(null);};}for(var e in events){if(events[_0x49b7('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x49b7('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0x6628=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x18f90c,_0x3f7c22){var _0x483815=function(_0x846270){while(--_0x846270){_0x18f90c['push'](_0x18f90c['shift']());}};_0x483815(++_0x3f7c22);}(_0x6628,0xac));var _0x8662=function(_0x50f54b,_0x3990ab){_0x50f54b=_0x50f54b-0x0;var _0x48c8f7=_0x6628[_0x50f54b];return _0x48c8f7;};'use strict';var EventEmitter=require(_0x8662('0x0'));var SmsQueue=require(_0x8662('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8662('0x2'),'afterUpdate':_0x8662('0x3'),'afterDestroy':_0x8662('0x4')};function emitEvent(_0x509856){return function(_0x43355a,_0x501a11,_0x5f0d35){SmsQueueEvents[_0x8662('0x5')](_0x509856+':'+_0x43355a['id'],_0x43355a);SmsQueueEvents['emit'](_0x509856,_0x43355a);_0x5f0d35(null);};}for(var e in events){if(events[_0x8662('0x6')](e)){var event=events[e];SmsQueue[_0x8662('0x7')](e,emitEvent(event));}}module[_0x8662('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 abf91f4..17456a7 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 _0xf5c4=['define','SmsQueue','sms_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x16eb19,_0x58cea4){var _0x312a25=function(_0x343702){while(--_0x343702){_0x16eb19['push'](_0x16eb19['shift']());}};_0x312a25(++_0x58cea4);}(_0xf5c4,0x137));var _0x4f5c=function(_0x116538,_0x1d9449){_0x116538=_0x116538-0x0;var _0x521263=_0xf5c4[_0x116538];return _0x521263;};'use strict';var _=require('lodash');var util=require(_0x4f5c('0x0'));var logger=require(_0x4f5c('0x1'))('api');var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rp=require(_0x4f5c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f5c('0x5'));var config=require(_0x4f5c('0x6'));var attributes=require(_0x4f5c('0x7'));module['exports']=function(_0x32362e,_0x19460c){return _0x32362e[_0x4f5c('0x8')](_0x4f5c('0x9'),attributes,{'tableName':_0x4f5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4011=['moment','bluebird','request-promise','path','../../config/environment','define','sms_queues','../../config/logger','api'];(function(_0x2f3d36,_0xc2c5af){var _0x3beb8e=function(_0x34aaf4){while(--_0x34aaf4){_0x2f3d36['push'](_0x2f3d36['shift']());}};_0x3beb8e(++_0xc2c5af);}(_0x4011,0x1d2));var _0x1401=function(_0x39abf6,_0x5cd4f1){_0x39abf6=_0x39abf6-0x0;var _0x2af92d=_0x4011[_0x39abf6];return _0x2af92d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1401('0x0'))(_0x1401('0x1'));var moment=require(_0x1401('0x2'));var BPromise=require(_0x1401('0x3'));var rp=require(_0x1401('0x4'));var fs=require('fs');var path=require(_0x1401('0x5'));var rimraf=require('rimraf');var config=require(_0x1401('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x5610e9,_0x644e16){return _0x5610e9[_0x1401('0x7')]('SmsQueue',attributes,{'tableName':_0x1401('0x8'),'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 823e9d5..e0bd13c 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 _0xb959=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','where','limit','include','map','model','attributes','ShowSmsQueue','find','raw','lodash','moment','randomstring','ioredis'];(function(_0x1de7e8,_0x355ee5){var _0x41b9ea=function(_0x4742eb){while(--_0x4742eb){_0x1de7e8['push'](_0x1de7e8['shift']());}};_0x41b9ea(++_0x355ee5);}(_0xb959,0x144));var _0x9b95=function(_0x34fc38,_0x3e4464){_0x34fc38=_0x34fc38-0x0;var _0x224f9f=_0xb959[_0x34fc38];return _0x224f9f;};'use strict';var _=require(_0x9b95('0x0'));var util=require('util');var moment=require(_0x9b95('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b95('0x2'));var fs=require('fs');var Redis=require(_0x9b95('0x3'));var db=require(_0x9b95('0x4'))['db'];var utils=require(_0x9b95('0x5'));var logger=require(_0x9b95('0x6'))(_0x9b95('0x7'));var config=require(_0x9b95('0x8'));var jayson=require(_0x9b95('0x9'));var client=jayson[_0x9b95('0xa')][_0x9b95('0xb')]({'port':0x232a});config[_0x9b95('0xc')]=_[_0x9b95('0xd')](config[_0x9b95('0xc')],{'host':_0x9b95('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x9b95('0xf')](socket);function respondWithRpcPromise(_0x2227f3,_0x8eef68,_0x2b80c7){return new BPromise(function(_0x1ad194,_0x2585a6){return client[_0x9b95('0x10')](_0x2227f3,_0x2b80c7)[_0x9b95('0x11')](function(_0x5ebfe6){logger[_0x9b95('0x12')](_0x9b95('0x13'),_0x8eef68,'request\x20sent');logger[_0x9b95('0x14')](_0x9b95('0x15'),_0x8eef68,_0x9b95('0x16'),JSON[_0x9b95('0x17')](_0x5ebfe6));if(_0x5ebfe6[_0x9b95('0x18')]){if(_0x5ebfe6[_0x9b95('0x18')][_0x9b95('0x19')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x8eef68,_0x5ebfe6[_0x9b95('0x18')][_0x9b95('0x1a')]);return _0x2585a6(_0x5ebfe6[_0x9b95('0x18')][_0x9b95('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x8eef68,_0x5ebfe6[_0x9b95('0x18')][_0x9b95('0x1a')]);return _0x1ad194(_0x5ebfe6[_0x9b95('0x18')]['message']);}else{logger[_0x9b95('0x12')](_0x9b95('0x13'),_0x8eef68,_0x9b95('0x16'));_0x1ad194(_0x5ebfe6[_0x9b95('0x1b')][_0x9b95('0x1a')]);}})[_0x9b95('0x1c')](function(_0x7246bc){logger[_0x9b95('0x18')]('SmsQueue,\x20%s,\x20%s',_0x8eef68,_0x7246bc);_0x2585a6(_0x7246bc);});});}exports[_0x9b95('0x1d')]=function(_0x296e8b){var _0x27c8af=this;return new Promise(function(_0x591d2f,_0x5a9ed3){return db[_0x9b95('0x1e')]['findAll']({'raw':_0x296e8b[_0x9b95('0x1f')]?_0x296e8b[_0x9b95('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x296e8b['options']?_0x296e8b[_0x9b95('0x1f')][_0x9b95('0x20')]||null:null,'attributes':_0x296e8b[_0x9b95('0x1f')]?_0x296e8b[_0x9b95('0x1f')]['attributes']||null:null,'limit':_0x296e8b['options']?_0x296e8b['options'][_0x9b95('0x21')]||null:null,'include':_0x296e8b[_0x9b95('0x1f')]?_0x296e8b[_0x9b95('0x1f')][_0x9b95('0x22')]?_[_0x9b95('0x23')](_0x296e8b[_0x9b95('0x1f')][_0x9b95('0x22')],function(_0x2d9958){return{'model':db[_0x2d9958[_0x9b95('0x24')]],'as':_0x2d9958['as'],'attributes':_0x2d9958[_0x9b95('0x25')],'include':_0x2d9958[_0x9b95('0x22')]?_[_0x9b95('0x23')](_0x2d9958[_0x9b95('0x22')],function(_0x3deb2b){return{'model':db[_0x3deb2b[_0x9b95('0x24')]],'as':_0x3deb2b['as'],'attributes':_0x3deb2b[_0x9b95('0x25')],'include':_0x3deb2b[_0x9b95('0x22')]?_[_0x9b95('0x23')](_0x3deb2b['include'],function(_0x2f00d4){return{'model':db[_0x2f00d4[_0x9b95('0x24')]],'as':_0x2f00d4['as'],'attributes':_0x2f00d4[_0x9b95('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9b95('0x11')](function(_0x110ff5){logger[_0x9b95('0x12')]('GetSmsQueue',_0x296e8b);logger[_0x9b95('0x14')](_0x9b95('0x1d'),_0x296e8b,JSON[_0x9b95('0x17')](_0x110ff5));_0x591d2f(_0x110ff5);})['catch'](function(_0x23ced6){logger[_0x9b95('0x18')]('GetSmsQueue',_0x23ced6[_0x9b95('0x1a')],_0x296e8b);_0x5a9ed3(_0x27c8af[_0x9b95('0x18')](0x1f4,_0x23ced6[_0x9b95('0x1a')]));});});};exports[_0x9b95('0x26')]=function(_0x41d249){var _0x23fbc0=this;return new Promise(function(_0x3c876e,_0x57a056){return db[_0x9b95('0x1e')][_0x9b95('0x27')]({'raw':_0x41d249[_0x9b95('0x1f')]?_0x41d249[_0x9b95('0x1f')][_0x9b95('0x28')]===undefined?!![]:![]:!![],'where':_0x41d249[_0x9b95('0x1f')]?_0x41d249['options']['where']||null:null,'attributes':_0x41d249[_0x9b95('0x1f')]?_0x41d249[_0x9b95('0x1f')][_0x9b95('0x25')]||null:null,'include':_0x41d249[_0x9b95('0x1f')]?_0x41d249[_0x9b95('0x1f')][_0x9b95('0x22')]?_[_0x9b95('0x23')](_0x41d249['options'][_0x9b95('0x22')],function(_0x24460e){return{'model':db[_0x24460e[_0x9b95('0x24')]],'as':_0x24460e['as'],'attributes':_0x24460e[_0x9b95('0x25')],'include':_0x24460e[_0x9b95('0x22')]?_['map'](_0x24460e['include'],function(_0x135f1a){return{'model':db[_0x135f1a[_0x9b95('0x24')]],'as':_0x135f1a['as'],'attributes':_0x135f1a[_0x9b95('0x25')],'include':_0x135f1a[_0x9b95('0x22')]?_[_0x9b95('0x23')](_0x135f1a[_0x9b95('0x22')],function(_0xe291d7){return{'model':db[_0xe291d7[_0x9b95('0x24')]],'as':_0xe291d7['as'],'attributes':_0xe291d7[_0x9b95('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x330baf){logger[_0x9b95('0x12')](_0x9b95('0x26'),_0x41d249);logger[_0x9b95('0x14')]('ShowSmsQueue',_0x41d249,JSON['stringify'](_0x330baf));_0x3c876e(_0x330baf);})[_0x9b95('0x1c')](function(_0x25a744){logger[_0x9b95('0x18')](_0x9b95('0x26'),_0x25a744[_0x9b95('0x1a')],_0x41d249);_0x57a056(_0x23fbc0[_0x9b95('0x18')](0x1f4,_0x25a744[_0x9b95('0x1a')]));});});}; \ No newline at end of file +var _0xd4e4=['client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','map','model','include','find','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3199cc,_0x18479b){var _0x395f8b=function(_0x11f326){while(--_0x11f326){_0x3199cc['push'](_0x3199cc['shift']());}};_0x395f8b(++_0x18479b);}(_0xd4e4,0x173));var _0x4d4e=function(_0x215926,_0x3206a4){_0x215926=_0x215926-0x0;var _0x499161=_0xd4e4[_0x215926];return _0x499161;};'use strict';var _=require(_0x4d4e('0x0'));var util=require('util');var moment=require(_0x4d4e('0x1'));var BPromise=require(_0x4d4e('0x2'));var rs=require(_0x4d4e('0x3'));var fs=require('fs');var Redis=require(_0x4d4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d4e('0x5'));var logger=require(_0x4d4e('0x6'))(_0x4d4e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d4e('0x8'));var client=jayson[_0x4d4e('0x9')][_0x4d4e('0xa')]({'port':0x232a});config[_0x4d4e('0xb')]=_[_0x4d4e('0xc')](config[_0x4d4e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d4e('0xd'))(new Redis(config[_0x4d4e('0xb')]));require('./smsQueue.socket')[_0x4d4e('0xe')](socket);function respondWithRpcPromise(_0x32cf9c,_0x3c073d,_0x22631a){return new BPromise(function(_0x53ab26,_0x408852){return client[_0x4d4e('0xf')](_0x32cf9c,_0x22631a)[_0x4d4e('0x10')](function(_0x37de4f){logger[_0x4d4e('0x11')](_0x4d4e('0x12'),_0x3c073d,'request\x20sent');logger[_0x4d4e('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3c073d,_0x4d4e('0x14'),JSON[_0x4d4e('0x15')](_0x37de4f));if(_0x37de4f[_0x4d4e('0x16')]){if(_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x17')]===0x1f4){logger[_0x4d4e('0x16')](_0x4d4e('0x12'),_0x3c073d,_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x18')]);return _0x408852(_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x18')]);}logger[_0x4d4e('0x16')](_0x4d4e('0x12'),_0x3c073d,_0x37de4f[_0x4d4e('0x16')]['message']);return _0x53ab26(_0x37de4f[_0x4d4e('0x16')]['message']);}else{logger[_0x4d4e('0x11')](_0x4d4e('0x12'),_0x3c073d,'request\x20sent');_0x53ab26(_0x37de4f[_0x4d4e('0x19')][_0x4d4e('0x18')]);}})[_0x4d4e('0x1a')](function(_0x33fbbb){logger['error'](_0x4d4e('0x12'),_0x3c073d,_0x33fbbb);_0x408852(_0x33fbbb);});});}exports[_0x4d4e('0x1b')]=function(_0x3bef92){var _0x20bc9a=this;return new Promise(function(_0x18501d,_0x53689a){return db[_0x4d4e('0x1c')]['findAll']({'raw':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92[_0x4d4e('0x1d')][_0x4d4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options'][_0x4d4e('0x1f')]||null:null,'attributes':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options'][_0x4d4e('0x20')]||null:null,'limit':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92[_0x4d4e('0x1d')]['limit']||null:null,'include':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options']['include']?_[_0x4d4e('0x21')](_0x3bef92[_0x4d4e('0x1d')]['include'],function(_0x1a7f74){return{'model':db[_0x1a7f74[_0x4d4e('0x22')]],'as':_0x1a7f74['as'],'attributes':_0x1a7f74[_0x4d4e('0x20')],'include':_0x1a7f74[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x1a7f74[_0x4d4e('0x23')],function(_0x3ddefe){return{'model':db[_0x3ddefe[_0x4d4e('0x22')]],'as':_0x3ddefe['as'],'attributes':_0x3ddefe[_0x4d4e('0x20')],'include':_0x3ddefe[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x3ddefe[_0x4d4e('0x23')],function(_0x5e1284){return{'model':db[_0x5e1284[_0x4d4e('0x22')]],'as':_0x5e1284['as'],'attributes':_0x5e1284[_0x4d4e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x890cb2){logger['info']('GetSmsQueue',_0x3bef92);logger['debug'](_0x4d4e('0x1b'),_0x3bef92,JSON[_0x4d4e('0x15')](_0x890cb2));_0x18501d(_0x890cb2);})[_0x4d4e('0x1a')](function(_0x15be30){logger['error'](_0x4d4e('0x1b'),_0x15be30['message'],_0x3bef92);_0x53689a(_0x20bc9a['error'](0x1f4,_0x15be30['message']));});});};exports['ShowSmsQueue']=function(_0x5fb741){var _0x24f484=this;return new Promise(function(_0x185cdf,_0x5de6e7){return db[_0x4d4e('0x1c')][_0x4d4e('0x24')]({'raw':_0x5fb741['options']?_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x1f')]||null:null,'attributes':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741['options'][_0x4d4e('0x20')]||null:null,'include':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741[_0x4d4e('0x1d')]['include']?_[_0x4d4e('0x21')](_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x23')],function(_0x262d5e){return{'model':db[_0x262d5e[_0x4d4e('0x22')]],'as':_0x262d5e['as'],'attributes':_0x262d5e['attributes'],'include':_0x262d5e['include']?_[_0x4d4e('0x21')](_0x262d5e[_0x4d4e('0x23')],function(_0x1719fd){return{'model':db[_0x1719fd[_0x4d4e('0x22')]],'as':_0x1719fd['as'],'attributes':_0x1719fd[_0x4d4e('0x20')],'include':_0x1719fd[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x1719fd[_0x4d4e('0x23')],function(_0xbdd497){return{'model':db[_0xbdd497[_0x4d4e('0x22')]],'as':_0xbdd497['as'],'attributes':_0xbdd497[_0x4d4e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4d4e('0x10')](function(_0x2527c4){logger[_0x4d4e('0x11')]('ShowSmsQueue',_0x5fb741);logger[_0x4d4e('0x13')]('ShowSmsQueue',_0x5fb741,JSON[_0x4d4e('0x15')](_0x2527c4));_0x185cdf(_0x2527c4);})['catch'](function(_0x3fbdb5){logger[_0x4d4e('0x16')](_0x4d4e('0x25'),_0x3fbdb5['message'],_0x5fb741);_0x5de6e7(_0x24f484['error'](0x1f4,_0x3fbdb5[_0x4d4e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index e7493da..1c7a3ef 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 _0x9ce2=['update','removeListener','register','./smsQueue.events','save','remove'];(function(_0x1e13d3,_0x4f6dd9){var _0x52c34a=function(_0x49428e){while(--_0x49428e){_0x1e13d3['push'](_0x1e13d3['shift']());}};_0x52c34a(++_0x4f6dd9);}(_0x9ce2,0xb7));var _0x29ce=function(_0x15449d,_0x537b1d){_0x15449d=_0x15449d-0x0;var _0x55cf8c=_0x9ce2[_0x15449d];return _0x55cf8c;};'use strict';var SmsQueueEvents=require(_0x29ce('0x0'));var events=[_0x29ce('0x1'),_0x29ce('0x2'),_0x29ce('0x3')];function createListener(_0x49a0af,_0x1ee18e){return function(_0x1f83ad){_0x1ee18e['emit'](_0x49a0af,_0x1f83ad);};}function removeListener(_0x245ad5,_0x144c80){return function(){SmsQueueEvents[_0x29ce('0x4')](_0x245ad5,_0x144c80);};}exports[_0x29ce('0x5')]=function(_0x166ab5){for(var _0x44ec74=0x0,_0x340b16=events['length'];_0x44ec74<_0x340b16;_0x44ec74++){var _0x5a490c=events[_0x44ec74];var _0x853211=createListener('smsQueue:'+_0x5a490c,_0x166ab5);SmsQueueEvents['on'](_0x5a490c,_0x853211);}}; \ No newline at end of file +var _0xd152=['smsQueue:','./smsQueue.events','update','emit','register','length'];(function(_0x3ff82c,_0x326326){var _0x430c6a=function(_0x47dd2c){while(--_0x47dd2c){_0x3ff82c['push'](_0x3ff82c['shift']());}};_0x430c6a(++_0x326326);}(_0xd152,0x1c3));var _0x2d15=function(_0x46c57c,_0x4a4e22){_0x46c57c=_0x46c57c-0x0;var _0x59dc46=_0xd152[_0x46c57c];return _0x59dc46;};'use strict';var SmsQueueEvents=require(_0x2d15('0x0'));var events=['save','remove',_0x2d15('0x1')];function createListener(_0x5ca67e,_0x546b77){return function(_0x4a3d76){_0x546b77[_0x2d15('0x2')](_0x5ca67e,_0x4a3d76);};}function removeListener(_0x291c90,_0x2ec825){return function(){SmsQueueEvents['removeListener'](_0x291c90,_0x2ec825);};}exports[_0x2d15('0x3')]=function(_0xf2f6af){for(var _0x1a0e5c=0x0,_0xeae154=events[_0x2d15('0x4')];_0x1a0e5c<_0xeae154;_0x1a0e5c++){var _0x596639=events[_0x1a0e5c];var _0x34dddb=createListener(_0x2d15('0x5')+_0x596639,_0xf2f6af);SmsQueueEvents['on'](_0x596639,_0x34dddb);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b31ab0d..3a3574c 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 _0x8e76=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e76,0x78));var _0x68e7=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x8e76[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x68e7('0x0'));var util=require(_0x68e7('0x1'));var path=require(_0x68e7('0x2'));var timeout=require(_0x68e7('0x3'));var express=require(_0x68e7('0x4'));var router=express[_0x68e7('0x5')]();var fs_extra=require(_0x68e7('0x6'));var auth=require(_0x68e7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x68e7('0x8'));var controller=require(_0x68e7('0x9'));router[_0x68e7('0xa')]('/',auth[_0x68e7('0xb')](),controller[_0x68e7('0xc')]);router['get'](_0x68e7('0xd'),auth[_0x68e7('0xb')](),controller['describe']);router[_0x68e7('0xa')](_0x68e7('0xe'),auth['isAuthenticated'](),controller[_0x68e7('0xf')]);router[_0x68e7('0x10')]('/',auth[_0x68e7('0xb')](),controller[_0x68e7('0x11')]);router[_0x68e7('0x12')](_0x68e7('0xe'),auth[_0x68e7('0xb')](),controller[_0x68e7('0x13')]);router[_0x68e7('0x14')]('/:id',auth[_0x68e7('0xb')](),controller[_0x68e7('0x15')]);module[_0x68e7('0x16')]=router; \ No newline at end of file +var _0x9cd2=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x9cd2,0x85));var _0x29cd=function(_0x127783,_0x258715){_0x127783=_0x127783-0x0;var _0x14f298=_0x9cd2[_0x127783];return _0x14f298;};'use strict';var multer=require(_0x29cd('0x0'));var util=require('util');var path=require(_0x29cd('0x1'));var timeout=require(_0x29cd('0x2'));var express=require(_0x29cd('0x3'));var router=express[_0x29cd('0x4')]();var fs_extra=require(_0x29cd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29cd('0x6'));var controller=require(_0x29cd('0x7'));router[_0x29cd('0x8')]('/',auth[_0x29cd('0x9')](),controller[_0x29cd('0xa')]);router[_0x29cd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x29cd('0xb')]);router['get'](_0x29cd('0xc'),auth[_0x29cd('0x9')](),controller[_0x29cd('0xd')]);router[_0x29cd('0xe')]('/',auth[_0x29cd('0x9')](),controller[_0x29cd('0xf')]);router[_0x29cd('0x10')](_0x29cd('0xc'),auth['isAuthenticated'](),controller[_0x29cd('0x11')]);router[_0x29cd('0x12')](_0x29cd('0xc'),auth[_0x29cd('0x9')](),controller[_0x29cd('0x13')]);module[_0x29cd('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 1d69f5b..dee8f81 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 _0x192a=['sequelize','exports','STRING','DATE','moment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x192a,0x17b));var _0xa192=function(_0xeab10a,_0xe739b0){_0xeab10a=_0xeab10a-0x0;var _0xe32a84=_0x192a[_0xeab10a];return _0xe32a84;};'use strict';var moment=require(_0xa192('0x0'));var Sequelize=require(_0xa192('0x1'));module[_0xa192('0x2')]={'uniqueid':{'type':Sequelize[_0xa192('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa192('0x4')]},'leaveAt':{'type':Sequelize[_0xa192('0x4')]},'acceptAt':{'type':Sequelize[_0xa192('0x4')]},'exitAt':{'type':Sequelize[_0xa192('0x4')]},'reason':{'type':Sequelize[_0xa192('0x3')]}}; \ No newline at end of file +var _0xd10c=['exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10c,0x1c3));var _0xcd10=function(_0x4de310,_0x1990c2){_0x4de310=_0x4de310-0x0;var _0x4201d1=_0xd10c[_0x4de310];return _0x4201d1;};'use strict';var moment=require(_0xcd10('0x0'));var Sequelize=require('sequelize');module[_0xcd10('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcd10('0x2')]},'joinAt':{'type':Sequelize[_0xcd10('0x3')]},'leaveAt':{'type':Sequelize[_0xcd10('0x3')]},'acceptAt':{'type':Sequelize[_0xcd10('0x3')]},'exitAt':{'type':Sequelize[_0xcd10('0x3')]},'reason':{'type':Sequelize[_0xcd10('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0750e66..27f5a27 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 _0x6b45=['filters','intersection','attributes','fields','hasOwnProperty','offset','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','keys'];(function(_0xfe2c16,_0x213fe1){var _0x5c99cb=function(_0x13fed4){while(--_0x13fed4){_0xfe2c16['push'](_0xfe2c16['shift']());}};_0x5c99cb(++_0x213fe1);}(_0x6b45,0x141));var _0x56b4=function(_0x3734bc,_0xf0ad5f){_0x3734bc=_0x3734bc-0x0;var _0x5d965c=_0x6b45[_0x3734bc];return _0x5d965c;};'use strict';var emlformat=require(_0x56b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x56b4('0x1'));var rp=require(_0x56b4('0x2'));var moment=require(_0x56b4('0x3'));var BPromise=require(_0x56b4('0x4'));var Mustache=require(_0x56b4('0x5'));var util=require(_0x56b4('0x6'));var path=require(_0x56b4('0x7'));var sox=require(_0x56b4('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(_0x56b4('0x9'));var crypto=require(_0x56b4('0xa'));var jsforce=require(_0x56b4('0xb'));var deskjs=require(_0x56b4('0xc'));var toCsv=require(_0x56b4('0xd'));var querystring=require(_0x56b4('0xe'));var Papa=require(_0x56b4('0xf'));var Redis=require('ioredis');var authService=require(_0x56b4('0x10'));var qs=require(_0x56b4('0x11'));var as=require(_0x56b4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56b4('0x13'))('api');var utils=require(_0x56b4('0x14'));var config=require(_0x56b4('0x15'));var licenseUtil=require(_0x56b4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e4b7c,_0x5e1101){_0x5e1101=_0x5e1101||0xcc;return function(_0xbdab1){if(_0xbdab1){return _0x3e4b7c[_0x56b4('0x17')](_0x5e1101);}return _0x3e4b7c['status'](_0x5e1101)[_0x56b4('0x18')]();};}function respondWithResult(_0x15c30e,_0x5cd369){_0x5cd369=_0x5cd369||0xc8;return function(_0x2f88cc){if(_0x2f88cc){return _0x15c30e['status'](_0x5cd369)[_0x56b4('0x19')](_0x2f88cc);}};}function respondWithFilteredResult(_0x23fff3,_0x15ecf6){return function(_0x438a8c){if(_0x438a8c){var _0x131ecf=typeof _0x15ecf6['offset']===_0x56b4('0x1a')&&typeof _0x15ecf6[_0x56b4('0x1b')]===_0x56b4('0x1a');var _0x876239=_0x438a8c[_0x56b4('0x1c')];var _0x19d504=_0x131ecf?0x0:_0x15ecf6['offset'];var _0x1e3afa=_0x131ecf?_0x438a8c[_0x56b4('0x1c')]:_0x15ecf6['offset']+_0x15ecf6[_0x56b4('0x1b')];var _0x3ad38b;if(_0x1e3afa>=_0x876239){_0x1e3afa=_0x876239;_0x3ad38b=0xc8;}else{_0x3ad38b=0xce;}_0x23fff3[_0x56b4('0x1d')](_0x3ad38b);return _0x23fff3[_0x56b4('0x1e')](_0x56b4('0x1f'),_0x19d504+'-'+_0x1e3afa+'/'+_0x876239)[_0x56b4('0x19')](_0x438a8c);}return null;};}function patchUpdates(_0x30b674){return function(_0x2cc8c0){try{jsonpatch[_0x56b4('0x20')](_0x2cc8c0,_0x30b674,!![]);}catch(_0x29a597){return BPromise['reject'](_0x29a597);}return _0x2cc8c0[_0x56b4('0x21')]();};}function saveUpdates(_0x88727c,_0x2e9806){return function(_0x5b4336){if(_0x5b4336){return _0x5b4336[_0x56b4('0x22')](_0x88727c)[_0x56b4('0x23')](function(_0x1cc3b3){return _0x1cc3b3;});}return null;};}function removeEntity(_0x5405d3,_0x3c25f7){return function(_0x220d99){if(_0x220d99){return _0x220d99[_0x56b4('0x24')]()['then'](function(){_0x5405d3[_0x56b4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x473fe0,_0x574e08){return function(_0x47fa0a){if(!_0x47fa0a){_0x473fe0['sendStatus'](0x194);}return _0x47fa0a;};}function handleError(_0x11501b,_0x20009c){_0x20009c=_0x20009c||0x1f4;return function(_0x5d6f28){logger['error'](_0x5d6f28[_0x56b4('0x25')]);if(_0x5d6f28[_0x56b4('0x26')]){delete _0x5d6f28[_0x56b4('0x26')];}_0x11501b['status'](_0x20009c)[_0x56b4('0x27')](_0x5d6f28);};}exports[_0x56b4('0x28')]=function(_0x43d41f,_0x41d0e4){var _0x5da713={},_0x5c59ae={},_0x16a089={'count':0x0,'rows':[]};var _0x1660de=_['map'](db[_0x56b4('0x29')][_0x56b4('0x2a')],function(_0x338abe){return{'name':_0x338abe[_0x56b4('0x2b')],'type':_0x338abe['type'][_0x56b4('0x2c')]};});_0x5c59ae[_0x56b4('0x2d')]=_[_0x56b4('0x2e')](_0x1660de,'name');_0x5c59ae[_0x56b4('0x2f')]=_[_0x56b4('0x30')](_0x43d41f['query']);_0x5c59ae[_0x56b4('0x31')]=_[_0x56b4('0x32')](_0x5c59ae[_0x56b4('0x2d')],_0x5c59ae['query']);_0x5da713[_0x56b4('0x33')]=_[_0x56b4('0x32')](_0x5c59ae[_0x56b4('0x2d')],qs[_0x56b4('0x34')](_0x43d41f[_0x56b4('0x2f')][_0x56b4('0x34')]));_0x5da713[_0x56b4('0x33')]=_0x5da713[_0x56b4('0x33')]['length']?_0x5da713[_0x56b4('0x33')]:_0x5c59ae[_0x56b4('0x2d')];if(!_0x43d41f['query'][_0x56b4('0x35')]('nolimit')){_0x5da713['limit']=qs[_0x56b4('0x1b')](_0x43d41f['query'][_0x56b4('0x1b')]);_0x5da713[_0x56b4('0x36')]=qs[_0x56b4('0x36')](_0x43d41f[_0x56b4('0x2f')][_0x56b4('0x36')]);}_0x5da713['order']=qs[_0x56b4('0x37')](_0x43d41f[_0x56b4('0x2f')][_0x56b4('0x37')]);_0x5da713[_0x56b4('0x38')]=qs[_0x56b4('0x31')](_[_0x56b4('0x39')](_0x43d41f[_0x56b4('0x2f')],_0x5c59ae['filters']),_0x1660de);if(_0x43d41f['query'][_0x56b4('0x3a')]){_0x5da713[_0x56b4('0x38')]=_[_0x56b4('0x3b')](_0x5da713['where'],{'$or':_[_0x56b4('0x2e')](_0x1660de,function(_0x3d16ae){if(_0x3d16ae[_0x56b4('0x3c')]!==_0x56b4('0x3d')){var _0x59d242={};_0x59d242[_0x3d16ae[_0x56b4('0x26')]]={'$like':'%'+_0x43d41f[_0x56b4('0x2f')][_0x56b4('0x3a')]+'%'};return _0x59d242;}})});}_0x5da713=_['merge']({},_0x5da713,_0x43d41f[_0x56b4('0x3e')]);var _0x1d49ea={'where':_0x5da713[_0x56b4('0x38')]};return db[_0x56b4('0x29')]['count'](_0x1d49ea)[_0x56b4('0x23')](function(_0x4e9ab4){_0x16a089['count']=_0x4e9ab4;if(_0x43d41f[_0x56b4('0x2f')][_0x56b4('0x3f')]){_0x5da713[_0x56b4('0x40')]=[{'all':!![]}];}return db[_0x56b4('0x29')][_0x56b4('0x41')](_0x5da713);})['then'](function(_0x1044d8){_0x16a089[_0x56b4('0x42')]=_0x1044d8;return _0x16a089;})[_0x56b4('0x23')](respondWithFilteredResult(_0x41d0e4,_0x5da713))['catch'](handleError(_0x41d0e4,null));};exports['show']=function(_0x5e7da9,_0x1c50a8){var _0x198a45={'raw':!![],'where':{'id':_0x5e7da9[_0x56b4('0x43')]['id']}},_0x377e8b={};_0x377e8b[_0x56b4('0x2d')]=_[_0x56b4('0x30')](db[_0x56b4('0x29')][_0x56b4('0x2a')]);_0x377e8b[_0x56b4('0x2f')]=_['keys'](_0x5e7da9['query']);_0x377e8b[_0x56b4('0x31')]=_[_0x56b4('0x32')](_0x377e8b[_0x56b4('0x2d')],_0x377e8b['query']);_0x198a45[_0x56b4('0x33')]=_[_0x56b4('0x32')](_0x377e8b[_0x56b4('0x2d')],qs['fields'](_0x5e7da9[_0x56b4('0x2f')]['fields']));_0x198a45[_0x56b4('0x33')]=_0x198a45[_0x56b4('0x33')][_0x56b4('0x44')]?_0x198a45[_0x56b4('0x33')]:_0x377e8b[_0x56b4('0x2d')];if(_0x5e7da9[_0x56b4('0x2f')]['includeAll']){_0x198a45['include']=[{'all':!![]}];}_0x198a45=_['merge']({},_0x198a45,_0x5e7da9[_0x56b4('0x3e')]);return db[_0x56b4('0x29')][_0x56b4('0x45')](_0x198a45)[_0x56b4('0x23')](handleEntityNotFound(_0x1c50a8,null))['then'](respondWithResult(_0x1c50a8,null))[_0x56b4('0x46')](handleError(_0x1c50a8,null));};exports[_0x56b4('0x47')]=function(_0x2aff9c,_0x163038){return db[_0x56b4('0x29')][_0x56b4('0x47')](_0x2aff9c[_0x56b4('0x48')],{})[_0x56b4('0x23')](respondWithResult(_0x163038,0xc9))['catch'](handleError(_0x163038,null));};exports['update']=function(_0x1530bb,_0x56c06d){if(_0x1530bb[_0x56b4('0x48')]['id']){delete _0x1530bb[_0x56b4('0x48')]['id'];}return db[_0x56b4('0x29')][_0x56b4('0x45')]({'where':{'id':_0x1530bb[_0x56b4('0x43')]['id']}})[_0x56b4('0x23')](handleEntityNotFound(_0x56c06d,null))[_0x56b4('0x23')](saveUpdates(_0x1530bb[_0x56b4('0x48')],null))[_0x56b4('0x23')](respondWithResult(_0x56c06d,null))[_0x56b4('0x46')](handleError(_0x56c06d,null));};exports[_0x56b4('0x24')]=function(_0x36e1f0,_0x21e39b){return db[_0x56b4('0x29')]['find']({'where':{'id':_0x36e1f0[_0x56b4('0x43')]['id']}})['then'](handleEntityNotFound(_0x21e39b,null))[_0x56b4('0x23')](removeEntity(_0x21e39b,null))['catch'](handleError(_0x21e39b,null));};exports['describe']=function(_0x492764,_0x207895){return db['SmsQueueReport'][_0x56b4('0x49')]()[_0x56b4('0x23')](respondWithResult(_0x207895,null))[_0x56b4('0x46')](handleError(_0x207895,null));}; \ No newline at end of file +var _0xd379=['findAll','rows','catch','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','merge','options','include','SmsQueueReport'];(function(_0x32dae7,_0x5adb01){var _0x5388a5=function(_0x4ea990){while(--_0x4ea990){_0x32dae7['push'](_0x32dae7['shift']());}};_0x5388a5(++_0x5adb01);}(_0xd379,0x91));var _0x9d37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd379[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d37('0x1'));var jsonpatch=require(_0x9d37('0x2'));var rp=require(_0x9d37('0x3'));var moment=require(_0x9d37('0x4'));var BPromise=require(_0x9d37('0x5'));var Mustache=require(_0x9d37('0x6'));var util=require(_0x9d37('0x7'));var path=require(_0x9d37('0x8'));var sox=require('sox');var csv=require(_0x9d37('0x9'));var ejs=require(_0x9d37('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d37('0xb'));var squel=require(_0x9d37('0xc'));var crypto=require(_0x9d37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d37('0xe'));var toCsv=require(_0x9d37('0x9'));var querystring=require(_0x9d37('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9d37('0x10'));var qs=require(_0x9d37('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d37('0x12'));var logger=require('../../config/logger')(_0x9d37('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f52f0,_0xa4d6c1){_0xa4d6c1=_0xa4d6c1||0xcc;return function(_0x5dd392){if(_0x5dd392){return _0x4f52f0[_0x9d37('0x14')](_0xa4d6c1);}return _0x4f52f0[_0x9d37('0x15')](_0xa4d6c1)[_0x9d37('0x16')]();};}function respondWithResult(_0x7f46dc,_0x31fc17){_0x31fc17=_0x31fc17||0xc8;return function(_0x378829){if(_0x378829){return _0x7f46dc['status'](_0x31fc17)[_0x9d37('0x17')](_0x378829);}};}function respondWithFilteredResult(_0x8000a3,_0x1dd025){return function(_0x2c8fdf){if(_0x2c8fdf){var _0x136e14=typeof _0x1dd025[_0x9d37('0x18')]==='undefined'&&typeof _0x1dd025['limit']==='undefined';var _0x11e33a=_0x2c8fdf['count'];var _0x5e7ce5=_0x136e14?0x0:_0x1dd025['offset'];var _0x303cac=_0x136e14?_0x2c8fdf[_0x9d37('0x19')]:_0x1dd025[_0x9d37('0x18')]+_0x1dd025[_0x9d37('0x1a')];var _0x223555;if(_0x303cac>=_0x11e33a){_0x303cac=_0x11e33a;_0x223555=0xc8;}else{_0x223555=0xce;}_0x8000a3['status'](_0x223555);return _0x8000a3[_0x9d37('0x1b')](_0x9d37('0x1c'),_0x5e7ce5+'-'+_0x303cac+'/'+_0x11e33a)[_0x9d37('0x17')](_0x2c8fdf);}return null;};}function patchUpdates(_0x50a1e9){return function(_0x3e9745){try{jsonpatch['apply'](_0x3e9745,_0x50a1e9,!![]);}catch(_0x5b8044){return BPromise[_0x9d37('0x1d')](_0x5b8044);}return _0x3e9745[_0x9d37('0x1e')]();};}function saveUpdates(_0x5da3ae,_0x5cc1e5){return function(_0x39ac6c){if(_0x39ac6c){return _0x39ac6c[_0x9d37('0x1f')](_0x5da3ae)[_0x9d37('0x20')](function(_0x264f1d){return _0x264f1d;});}return null;};}function removeEntity(_0x1b0bfc,_0x3abc25){return function(_0x131def){if(_0x131def){return _0x131def[_0x9d37('0x21')]()[_0x9d37('0x20')](function(){_0x1b0bfc[_0x9d37('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340f5d,_0x32fa75){return function(_0x2a9f55){if(!_0x2a9f55){_0x340f5d[_0x9d37('0x14')](0x194);}return _0x2a9f55;};}function handleError(_0x769eb1,_0x2c37b5){_0x2c37b5=_0x2c37b5||0x1f4;return function(_0x4595a8){logger[_0x9d37('0x22')](_0x4595a8[_0x9d37('0x23')]);if(_0x4595a8[_0x9d37('0x24')]){delete _0x4595a8[_0x9d37('0x24')];}_0x769eb1[_0x9d37('0x15')](_0x2c37b5)[_0x9d37('0x25')](_0x4595a8);};}exports[_0x9d37('0x26')]=function(_0x5516d2,_0x21ca72){var _0x9cce16={},_0x42fcff={},_0x26b6ba={'count':0x0,'rows':[]};var _0x24cd9=_[_0x9d37('0x27')](db['SmsQueueReport'][_0x9d37('0x28')],function(_0x4829a6){return{'name':_0x4829a6[_0x9d37('0x29')],'type':_0x4829a6[_0x9d37('0x2a')][_0x9d37('0x2b')]};});_0x42fcff['model']=_[_0x9d37('0x27')](_0x24cd9,_0x9d37('0x24'));_0x42fcff[_0x9d37('0x2c')]=_[_0x9d37('0x2d')](_0x5516d2['query']);_0x42fcff['filters']=_[_0x9d37('0x2e')](_0x42fcff[_0x9d37('0x2f')],_0x42fcff['query']);_0x9cce16[_0x9d37('0x30')]=_[_0x9d37('0x2e')](_0x42fcff['model'],qs['fields'](_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x31')]));_0x9cce16[_0x9d37('0x30')]=_0x9cce16['attributes']['length']?_0x9cce16['attributes']:_0x42fcff[_0x9d37('0x2f')];if(!_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x32')](_0x9d37('0x33'))){_0x9cce16['limit']=qs[_0x9d37('0x1a')](_0x5516d2[_0x9d37('0x2c')]['limit']);_0x9cce16[_0x9d37('0x18')]=qs[_0x9d37('0x18')](_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x18')]);}_0x9cce16[_0x9d37('0x34')]=qs['sort'](_0x5516d2[_0x9d37('0x2c')]['sort']);_0x9cce16[_0x9d37('0x35')]=qs[_0x9d37('0x36')](_['pick'](_0x5516d2['query'],_0x42fcff[_0x9d37('0x36')]),_0x24cd9);if(_0x5516d2[_0x9d37('0x2c')]['filter']){_0x9cce16[_0x9d37('0x35')]=_[_0x9d37('0x37')](_0x9cce16[_0x9d37('0x35')],{'$or':_[_0x9d37('0x27')](_0x24cd9,function(_0x5c4259){if(_0x5c4259[_0x9d37('0x2a')]!=='VIRTUAL'){var _0x333d2b={};_0x333d2b[_0x5c4259[_0x9d37('0x24')]]={'$like':'%'+_0x5516d2[_0x9d37('0x2c')]['filter']+'%'};return _0x333d2b;}})});}_0x9cce16=_[_0x9d37('0x37')]({},_0x9cce16,_0x5516d2[_0x9d37('0x38')]);var _0x5bbb9f={'where':_0x9cce16[_0x9d37('0x35')]};return db['SmsQueueReport']['count'](_0x5bbb9f)[_0x9d37('0x20')](function(_0x475809){_0x26b6ba[_0x9d37('0x19')]=_0x475809;if(_0x5516d2['query']['includeAll']){_0x9cce16[_0x9d37('0x39')]=[{'all':!![]}];}return db[_0x9d37('0x3a')][_0x9d37('0x3b')](_0x9cce16);})['then'](function(_0x5f472b){_0x26b6ba[_0x9d37('0x3c')]=_0x5f472b;return _0x26b6ba;})[_0x9d37('0x20')](respondWithFilteredResult(_0x21ca72,_0x9cce16))[_0x9d37('0x3d')](handleError(_0x21ca72,null));};exports['show']=function(_0x23199f,_0x32ac33){var _0x5e59b3={'raw':!![],'where':{'id':_0x23199f['params']['id']}},_0x2664e1={};_0x2664e1['model']=_['keys'](db[_0x9d37('0x3a')][_0x9d37('0x28')]);_0x2664e1[_0x9d37('0x2c')]=_[_0x9d37('0x2d')](_0x23199f[_0x9d37('0x2c')]);_0x2664e1[_0x9d37('0x36')]=_[_0x9d37('0x2e')](_0x2664e1[_0x9d37('0x2f')],_0x2664e1[_0x9d37('0x2c')]);_0x5e59b3[_0x9d37('0x30')]=_['intersection'](_0x2664e1[_0x9d37('0x2f')],qs['fields'](_0x23199f[_0x9d37('0x2c')][_0x9d37('0x31')]));_0x5e59b3['attributes']=_0x5e59b3[_0x9d37('0x30')][_0x9d37('0x3e')]?_0x5e59b3[_0x9d37('0x30')]:_0x2664e1[_0x9d37('0x2f')];if(_0x23199f[_0x9d37('0x2c')]['includeAll']){_0x5e59b3[_0x9d37('0x39')]=[{'all':!![]}];}_0x5e59b3=_['merge']({},_0x5e59b3,_0x23199f[_0x9d37('0x38')]);return db[_0x9d37('0x3a')][_0x9d37('0x3f')](_0x5e59b3)[_0x9d37('0x20')](handleEntityNotFound(_0x32ac33,null))[_0x9d37('0x20')](respondWithResult(_0x32ac33,null))['catch'](handleError(_0x32ac33,null));};exports['create']=function(_0x354465,_0xf097a3){return db[_0x9d37('0x3a')][_0x9d37('0x40')](_0x354465[_0x9d37('0x41')],{})[_0x9d37('0x20')](respondWithResult(_0xf097a3,0xc9))[_0x9d37('0x3d')](handleError(_0xf097a3,null));};exports[_0x9d37('0x1f')]=function(_0x38ab50,_0x7bbec5){if(_0x38ab50[_0x9d37('0x41')]['id']){delete _0x38ab50[_0x9d37('0x41')]['id'];}return db[_0x9d37('0x3a')][_0x9d37('0x3f')]({'where':{'id':_0x38ab50['params']['id']}})[_0x9d37('0x20')](handleEntityNotFound(_0x7bbec5,null))[_0x9d37('0x20')](saveUpdates(_0x38ab50[_0x9d37('0x41')],null))[_0x9d37('0x20')](respondWithResult(_0x7bbec5,null))[_0x9d37('0x3d')](handleError(_0x7bbec5,null));};exports[_0x9d37('0x21')]=function(_0x26db23,_0x445b02){return db[_0x9d37('0x3a')][_0x9d37('0x3f')]({'where':{'id':_0x26db23[_0x9d37('0x42')]['id']}})[_0x9d37('0x20')](handleEntityNotFound(_0x445b02,null))[_0x9d37('0x20')](removeEntity(_0x445b02,null))[_0x9d37('0x3d')](handleError(_0x445b02,null));};exports[_0x9d37('0x43')]=function(_0x1bef58,_0x4d2758){return db['SmsQueueReport'][_0x9d37('0x43')]()[_0x9d37('0x20')](respondWithResult(_0x4d2758,null))[_0x9d37('0x3d')](handleError(_0x4d2758,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9536bbe..b618881 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x250a53,_0x2c4863){var _0x14f284=function(_0xe039b1){while(--_0xe039b1){_0x250a53['push'](_0x250a53['shift']());}};_0x14f284(++_0x2c4863);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59b9f3,_0x512b03){var _0x4461aa=function(_0x483952){while(--_0x483952){_0x59b9f3['push'](_0x59b9f3['shift']());}};_0x4461aa(++_0x512b03);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 270bcbf..b756ad4 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 _0x9525=['create','body','options','raw','info','debug','UpdateSmsQueueReport','update','where','limit','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport'];(function(_0x494a42,_0x1f2103){var _0x254792=function(_0x5f1c1d){while(--_0x5f1c1d){_0x494a42['push'](_0x494a42['shift']());}};_0x254792(++_0x1f2103);}(_0x9525,0x1ab));var _0x5952=function(_0x487675,_0x46a3ce){_0x487675=_0x487675-0x0;var _0x527023=_0x9525[_0x487675];return _0x527023;};'use strict';var _=require(_0x5952('0x0'));var util=require(_0x5952('0x1'));var moment=require(_0x5952('0x2'));var BPromise=require(_0x5952('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5952('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5952('0x5'));var logger=require(_0x5952('0x6'))(_0x5952('0x7'));var config=require(_0x5952('0x8'));var jayson=require(_0x5952('0x9'));var client=jayson[_0x5952('0xa')][_0x5952('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a598a,_0x5936a7,_0x3a4a7e){return new BPromise(function(_0x5abb6b,_0x149769){return client['request'](_0x1a598a,_0x3a4a7e)[_0x5952('0xc')](function(_0x983f39){logger['info'](_0x5952('0xd'),_0x5936a7,_0x5952('0xe'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5936a7,_0x5952('0xe'),JSON[_0x5952('0xf')](_0x983f39));if(_0x983f39['error']){if(_0x983f39[_0x5952('0x10')][_0x5952('0x11')]===0x1f4){logger[_0x5952('0x10')](_0x5952('0xd'),_0x5936a7,_0x983f39[_0x5952('0x10')][_0x5952('0x12')]);return _0x149769(_0x983f39[_0x5952('0x10')][_0x5952('0x12')]);}logger['error'](_0x5952('0xd'),_0x5936a7,_0x983f39[_0x5952('0x10')][_0x5952('0x12')]);return _0x5abb6b(_0x983f39[_0x5952('0x10')][_0x5952('0x12')]);}else{logger['info'](_0x5952('0xd'),_0x5936a7,_0x5952('0xe'));_0x5abb6b(_0x983f39['result'][_0x5952('0x12')]);}})['catch'](function(_0x4ad1b3){logger[_0x5952('0x10')](_0x5952('0xd'),_0x5936a7,_0x4ad1b3);_0x149769(_0x4ad1b3);});});}exports[_0x5952('0x13')]=function(_0x2ff183){var _0x49cd5f=this;return new Promise(function(_0x558cda,_0x1d4559){return db[_0x5952('0x14')][_0x5952('0x15')](_0x2ff183[_0x5952('0x16')],{'raw':_0x2ff183[_0x5952('0x17')]?_0x2ff183[_0x5952('0x17')][_0x5952('0x18')]===undefined?!![]:![]:!![]})[_0x5952('0xc')](function(_0x5a5733){logger[_0x5952('0x19')](_0x5952('0x13'),_0x2ff183);logger[_0x5952('0x1a')](_0x5952('0x13'),_0x2ff183,JSON[_0x5952('0xf')](_0x5a5733));_0x558cda(_0x5a5733);})['catch'](function(_0x151935){logger[_0x5952('0x10')]('CreateSmsQueueReport',_0x151935[_0x5952('0x12')],_0x2ff183);_0x1d4559(_0x49cd5f['error'](0x1f4,_0x151935[_0x5952('0x12')]));});});};exports[_0x5952('0x1b')]=function(_0x285b8f){var _0x5efe2a=this;return new Promise(function(_0x57e8fe,_0xe91878){return db[_0x5952('0x14')][_0x5952('0x1c')](_0x285b8f[_0x5952('0x16')],{'raw':_0x285b8f['options']?_0x285b8f[_0x5952('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285b8f['options']?_0x285b8f[_0x5952('0x17')][_0x5952('0x1d')]||null:null,'attributes':_0x285b8f[_0x5952('0x17')]?_0x285b8f[_0x5952('0x17')]['attributes']||null:null,'limit':_0x285b8f['options']?_0x285b8f['options'][_0x5952('0x1e')]||null:null})['then'](function(_0x1c69bd){logger['info'](_0x5952('0x1b'),_0x285b8f);logger[_0x5952('0x1a')](_0x5952('0x1b'),_0x285b8f,JSON[_0x5952('0xf')](_0x1c69bd));_0x57e8fe(_0x1c69bd);})[_0x5952('0x1f')](function(_0x1b1f1f){logger['error']('UpdateSmsQueueReport',_0x1b1f1f['message'],_0x285b8f);_0xe91878(_0x5efe2a[_0x5952('0x10')](0x1f4,_0x1b1f1f[_0x5952('0x12')]));});});}; \ No newline at end of file +var _0x2b17=['catch','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','SmsQueueReport','create','options','raw','CreateSmsQueueReport'];(function(_0x4aa181,_0x219426){var _0x446c0f=function(_0x395a26){while(--_0x395a26){_0x4aa181['push'](_0x4aa181['shift']());}};_0x446c0f(++_0x219426);}(_0x2b17,0x6a));var _0x72b1=function(_0xbee21a,_0xc3456b){_0xbee21a=_0xbee21a-0x0;var _0x83c6e4=_0x2b17[_0xbee21a];return _0x83c6e4;};'use strict';var _=require(_0x72b1('0x0'));var util=require('util');var moment=require(_0x72b1('0x1'));var BPromise=require(_0x72b1('0x2'));var rs=require(_0x72b1('0x3'));var fs=require('fs');var Redis=require(_0x72b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x72b1('0x5'));var logger=require(_0x72b1('0x6'))(_0x72b1('0x7'));var config=require(_0x72b1('0x8'));var jayson=require(_0x72b1('0x9'));var client=jayson[_0x72b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dc8fb,_0x2878fb,_0x1db07e){return new BPromise(function(_0x39eccd,_0x568123){return client[_0x72b1('0xb')](_0x1dc8fb,_0x1db07e)[_0x72b1('0xc')](function(_0x40118c){logger[_0x72b1('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,'request\x20sent');logger[_0x72b1('0xe')](_0x72b1('0xf'),_0x2878fb,_0x72b1('0x10'),JSON[_0x72b1('0x11')](_0x40118c));if(_0x40118c[_0x72b1('0x12')]){if(_0x40118c['error']['code']===0x1f4){logger['error'](_0x72b1('0x13'),_0x2878fb,_0x40118c['error'][_0x72b1('0x14')]);return _0x568123(_0x40118c[_0x72b1('0x12')][_0x72b1('0x14')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x40118c[_0x72b1('0x12')][_0x72b1('0x14')]);return _0x39eccd(_0x40118c['error'][_0x72b1('0x14')]);}else{logger[_0x72b1('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x72b1('0x10'));_0x39eccd(_0x40118c['result'][_0x72b1('0x14')]);}})['catch'](function(_0x75eda3){logger[_0x72b1('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x75eda3);_0x568123(_0x75eda3);});});}exports['CreateSmsQueueReport']=function(_0x285326){var _0x2bec1d=this;return new Promise(function(_0x234bff,_0x16234f){return db[_0x72b1('0x15')][_0x72b1('0x16')](_0x285326['body'],{'raw':_0x285326[_0x72b1('0x17')]?_0x285326['options'][_0x72b1('0x18')]===undefined?!![]:![]:!![]})[_0x72b1('0xc')](function(_0x12cf91){logger[_0x72b1('0xd')](_0x72b1('0x19'),_0x285326);logger[_0x72b1('0xe')]('CreateSmsQueueReport',_0x285326,JSON['stringify'](_0x12cf91));_0x234bff(_0x12cf91);})[_0x72b1('0x1a')](function(_0x1eee53){logger[_0x72b1('0x12')](_0x72b1('0x19'),_0x1eee53[_0x72b1('0x14')],_0x285326);_0x16234f(_0x2bec1d[_0x72b1('0x12')](0x1f4,_0x1eee53[_0x72b1('0x14')]));});});};exports[_0x72b1('0x1b')]=function(_0x347db8){var _0x5b7e51=this;return new Promise(function(_0x4feaa1,_0x13664f){return db[_0x72b1('0x15')][_0x72b1('0x1c')](_0x347db8[_0x72b1('0x1d')],{'raw':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347db8[_0x72b1('0x17')]?_0x347db8['options'][_0x72b1('0x1e')]||null:null,'attributes':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x1f')]||null:null,'limit':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x20')]||null:null})[_0x72b1('0xc')](function(_0x13e9be){logger[_0x72b1('0xd')](_0x72b1('0x1b'),_0x347db8);logger[_0x72b1('0xe')](_0x72b1('0x1b'),_0x347db8,JSON[_0x72b1('0x11')](_0x13e9be));_0x4feaa1(_0x13e9be);})[_0x72b1('0x1a')](function(_0x502363){logger['error'](_0x72b1('0x1b'),_0x502363[_0x72b1('0x14')],_0x347db8);_0x13664f(_0x5b7e51['error'](0x1f4,_0x502363[_0x72b1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7a77a23..06e3fa3 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 _0x9f5a=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','put'];(function(_0x3e1022,_0x2de912){var _0x33a610=function(_0x224004){while(--_0x224004){_0x3e1022['push'](_0x3e1022['shift']());}};_0x33a610(++_0x2de912);}(_0x9f5a,0xbd));var _0xa9f5=function(_0xf2be1d,_0x4817cf){_0xf2be1d=_0xf2be1d-0x0;var _0x46adea=_0x9f5a[_0xf2be1d];return _0x46adea;};'use strict';var multer=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var path=require(_0xa9f5('0x2'));var timeout=require(_0xa9f5('0x3'));var express=require('express');var router=express[_0xa9f5('0x4')]();var fs_extra=require(_0xa9f5('0x5'));var auth=require(_0xa9f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa9f5('0x7'));var controller=require('./smsTransferReport.controller');router[_0xa9f5('0x8')]('/',auth[_0xa9f5('0x9')](),controller['index']);router[_0xa9f5('0x8')](_0xa9f5('0xa'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0xb')]);router[_0xa9f5('0x8')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),controller['show']);router[_0xa9f5('0xd')]('/',auth[_0xa9f5('0x9')](),controller['create']);router[_0xa9f5('0xe')](_0xa9f5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa9f5('0xf')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0x10')]);module['exports']=router; \ No newline at end of file +var _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0xca9e,0x136));var _0xeca9=function(_0x53e6f0,_0x1352e3){_0x53e6f0=_0x53e6f0-0x0;var _0x55726a=_0xca9e[_0x53e6f0];return _0x55726a;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 5e3fcfc..39b4145 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2a6193,_0x2ec097){var _0x317a31=function(_0x478fa1){while(--_0x478fa1){_0x2a6193['push'](_0x2a6193['shift']());}};_0x317a31(++_0x2ec097);}(_0x54ef,0x112));var _0xf54e=function(_0x1703c5,_0x570c4b){_0x1703c5=_0x1703c5-0x0;var _0x3d6b35=_0x54ef[_0x1703c5];return _0x3d6b35;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3dcc55,_0x1b08fa){var _0xd8cdee=function(_0xff9f96){while(--_0xff9f96){_0x3dcc55['push'](_0x3dcc55['shift']());}};_0xd8cdee(++_0x1b08fa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x95adfd,_0xbfe14c){_0x95adfd=_0x95adfd-0x0;var _0x5e28b2=_0xf4eb[_0x95adfd];return _0x5e28b2;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 34d072c..e2800ec 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 _0x54c8=['describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','set','apply','reject','save','update','then','name','SmsTransferReport','rawAttributes','type','key','filters','intersection','query','attributes','fields','length','order','sort','where','pick','map','VIRTUAL','count','includeAll','include','rows','catch','params','model','keys','options','find','create','body','destroy'];(function(_0x28c2b8,_0xc7ad37){var _0x504aae=function(_0x56c73f){while(--_0x56c73f){_0x28c2b8['push'](_0x28c2b8['shift']());}};_0x504aae(++_0xc7ad37);}(_0x54c8,0xfd));var _0x854c=function(_0x29e7bc,_0x10bbfd){_0x29e7bc=_0x29e7bc-0x0;var _0x441d70=_0x54c8[_0x29e7bc];return _0x441d70;};'use strict';var emlformat=require(_0x854c('0x0'));var rimraf=require(_0x854c('0x1'));var zipdir=require(_0x854c('0x2'));var jsonpatch=require(_0x854c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x854c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x854c('0x5'));var sox=require(_0x854c('0x6'));var csv=require(_0x854c('0x7'));var ejs=require(_0x854c('0x8'));var fs=require('fs');var fs_extra=require(_0x854c('0x9'));var _=require('lodash');var squel=require(_0x854c('0xa'));var crypto=require('crypto');var jsforce=require(_0x854c('0xb'));var deskjs=require(_0x854c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x854c('0xd'));var Papa=require(_0x854c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x854c('0xf'));var as=require(_0x854c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x854c('0x11'));var utils=require(_0x854c('0x12'));var config=require(_0x854c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x854c('0x14'))['db'];function respondWithStatusCode(_0x44c5f7,_0x2ef5df){_0x2ef5df=_0x2ef5df||0xcc;return function(_0x4b1462){if(_0x4b1462){return _0x44c5f7['sendStatus'](_0x2ef5df);}return _0x44c5f7[_0x854c('0x15')](_0x2ef5df)[_0x854c('0x16')]();};}function respondWithResult(_0x500d33,_0xb52f61){_0xb52f61=_0xb52f61||0xc8;return function(_0x468431){if(_0x468431){return _0x500d33[_0x854c('0x15')](_0xb52f61)['json'](_0x468431);}};}function respondWithFilteredResult(_0x40d837,_0x12b7b9){return function(_0x375866){if(_0x375866){var _0x201256=typeof _0x12b7b9[_0x854c('0x17')]===_0x854c('0x18')&&typeof _0x12b7b9[_0x854c('0x19')]==='undefined';var _0x2a3748=_0x375866['count'];var _0x47d1ed=_0x201256?0x0:_0x12b7b9[_0x854c('0x17')];var _0x3ca386=_0x201256?_0x375866['count']:_0x12b7b9[_0x854c('0x17')]+_0x12b7b9['limit'];var _0x1aa9bb;if(_0x3ca386>=_0x2a3748){_0x3ca386=_0x2a3748;_0x1aa9bb=0xc8;}else{_0x1aa9bb=0xce;}_0x40d837[_0x854c('0x15')](_0x1aa9bb);return _0x40d837[_0x854c('0x1a')]('Content-Range',_0x47d1ed+'-'+_0x3ca386+'/'+_0x2a3748)['json'](_0x375866);}return null;};}function patchUpdates(_0x1b260a){return function(_0x4924c0){try{jsonpatch[_0x854c('0x1b')](_0x4924c0,_0x1b260a,!![]);}catch(_0x46ef5d){return BPromise[_0x854c('0x1c')](_0x46ef5d);}return _0x4924c0[_0x854c('0x1d')]();};}function saveUpdates(_0x58dfb9,_0x6bfa45){return function(_0x65c9d7){if(_0x65c9d7){return _0x65c9d7[_0x854c('0x1e')](_0x58dfb9)[_0x854c('0x1f')](function(_0x1a1ce9){return _0x1a1ce9;});}return null;};}function removeEntity(_0x491c17,_0x4a0889){return function(_0x1c4e0d){if(_0x1c4e0d){return _0x1c4e0d['destroy']()[_0x854c('0x1f')](function(){_0x491c17[_0x854c('0x15')](0xcc)[_0x854c('0x16')]();});}};}function handleEntityNotFound(_0x23c2f5,_0xe5382f){return function(_0x480c4e){if(!_0x480c4e){_0x23c2f5['sendStatus'](0x194);}return _0x480c4e;};}function handleError(_0x32544d,_0x5e832a){_0x5e832a=_0x5e832a||0x1f4;return function(_0x744030){logger['error'](_0x744030['stack']);if(_0x744030[_0x854c('0x20')]){delete _0x744030[_0x854c('0x20')];}_0x32544d[_0x854c('0x15')](_0x5e832a)['send'](_0x744030);};}exports['index']=function(_0x39fe8d,_0x55b952){var _0x45cbfc={},_0x13ef2f={},_0x4af525={'count':0x0,'rows':[]};var _0x49bea5=_['map'](db[_0x854c('0x21')][_0x854c('0x22')],function(_0x4b4b33){return{'name':_0x4b4b33['fieldName'],'type':_0x4b4b33[_0x854c('0x23')][_0x854c('0x24')]};});_0x13ef2f['model']=_['map'](_0x49bea5,'name');_0x13ef2f['query']=_['keys'](_0x39fe8d['query']);_0x13ef2f[_0x854c('0x25')]=_[_0x854c('0x26')](_0x13ef2f['model'],_0x13ef2f[_0x854c('0x27')]);_0x45cbfc[_0x854c('0x28')]=_['intersection'](_0x13ef2f['model'],qs[_0x854c('0x29')](_0x39fe8d['query'][_0x854c('0x29')]));_0x45cbfc['attributes']=_0x45cbfc['attributes'][_0x854c('0x2a')]?_0x45cbfc['attributes']:_0x13ef2f['model'];if(!_0x39fe8d['query']['hasOwnProperty']('nolimit')){_0x45cbfc[_0x854c('0x19')]=qs[_0x854c('0x19')](_0x39fe8d[_0x854c('0x27')][_0x854c('0x19')]);_0x45cbfc[_0x854c('0x17')]=qs[_0x854c('0x17')](_0x39fe8d[_0x854c('0x27')]['offset']);}_0x45cbfc[_0x854c('0x2b')]=qs[_0x854c('0x2c')](_0x39fe8d[_0x854c('0x27')][_0x854c('0x2c')]);_0x45cbfc[_0x854c('0x2d')]=qs[_0x854c('0x25')](_[_0x854c('0x2e')](_0x39fe8d[_0x854c('0x27')],_0x13ef2f[_0x854c('0x25')]),_0x49bea5);if(_0x39fe8d[_0x854c('0x27')]['filter']){_0x45cbfc[_0x854c('0x2d')]=_['merge'](_0x45cbfc[_0x854c('0x2d')],{'$or':_[_0x854c('0x2f')](_0x49bea5,function(_0x4dba19){if(_0x4dba19['type']!==_0x854c('0x30')){var _0x4e135e={};_0x4e135e[_0x4dba19[_0x854c('0x20')]]={'$like':'%'+_0x39fe8d['query']['filter']+'%'};return _0x4e135e;}})});}_0x45cbfc=_['merge']({},_0x45cbfc,_0x39fe8d['options']);var _0x348edf={'where':_0x45cbfc[_0x854c('0x2d')]};return db[_0x854c('0x21')]['count'](_0x348edf)[_0x854c('0x1f')](function(_0x3354b1){_0x4af525[_0x854c('0x31')]=_0x3354b1;if(_0x39fe8d[_0x854c('0x27')][_0x854c('0x32')]){_0x45cbfc[_0x854c('0x33')]=[{'all':!![]}];}return db[_0x854c('0x21')]['findAll'](_0x45cbfc);})[_0x854c('0x1f')](function(_0x4e949e){_0x4af525[_0x854c('0x34')]=_0x4e949e;return _0x4af525;})[_0x854c('0x1f')](respondWithFilteredResult(_0x55b952,_0x45cbfc))[_0x854c('0x35')](handleError(_0x55b952,null));};exports['show']=function(_0x1d5335,_0x5872b4){var _0x297964={'raw':!![],'where':{'id':_0x1d5335[_0x854c('0x36')]['id']}},_0x5daea9={};_0x5daea9[_0x854c('0x37')]=_[_0x854c('0x38')](db[_0x854c('0x21')]['rawAttributes']);_0x5daea9[_0x854c('0x27')]=_[_0x854c('0x38')](_0x1d5335[_0x854c('0x27')]);_0x5daea9['filters']=_[_0x854c('0x26')](_0x5daea9[_0x854c('0x37')],_0x5daea9[_0x854c('0x27')]);_0x297964['attributes']=_[_0x854c('0x26')](_0x5daea9['model'],qs['fields'](_0x1d5335[_0x854c('0x27')]['fields']));_0x297964['attributes']=_0x297964[_0x854c('0x28')][_0x854c('0x2a')]?_0x297964[_0x854c('0x28')]:_0x5daea9['model'];if(_0x1d5335['query'][_0x854c('0x32')]){_0x297964[_0x854c('0x33')]=[{'all':!![]}];}_0x297964=_['merge']({},_0x297964,_0x1d5335[_0x854c('0x39')]);return db[_0x854c('0x21')][_0x854c('0x3a')](_0x297964)[_0x854c('0x1f')](handleEntityNotFound(_0x5872b4,null))[_0x854c('0x1f')](respondWithResult(_0x5872b4,null))['catch'](handleError(_0x5872b4,null));};exports[_0x854c('0x3b')]=function(_0x3a042a,_0x3246d1){return db[_0x854c('0x21')][_0x854c('0x3b')](_0x3a042a[_0x854c('0x3c')],{})[_0x854c('0x1f')](respondWithResult(_0x3246d1,0xc9))['catch'](handleError(_0x3246d1,null));};exports['update']=function(_0x130763,_0x2ff170){if(_0x130763[_0x854c('0x3c')]['id']){delete _0x130763[_0x854c('0x3c')]['id'];}return db[_0x854c('0x21')][_0x854c('0x3a')]({'where':{'id':_0x130763[_0x854c('0x36')]['id']}})[_0x854c('0x1f')](handleEntityNotFound(_0x2ff170,null))[_0x854c('0x1f')](saveUpdates(_0x130763[_0x854c('0x3c')],null))[_0x854c('0x1f')](respondWithResult(_0x2ff170,null))[_0x854c('0x35')](handleError(_0x2ff170,null));};exports[_0x854c('0x3d')]=function(_0x24f6d3,_0x1075bd){return db['SmsTransferReport'][_0x854c('0x3a')]({'where':{'id':_0x24f6d3['params']['id']}})['then'](handleEntityNotFound(_0x1075bd,null))[_0x854c('0x1f')](removeEntity(_0x1075bd,null))[_0x854c('0x35')](handleError(_0x1075bd,null));};exports[_0x854c('0x3e')]=function(_0x7ccb61,_0x29e861){return db[_0x854c('0x21')][_0x854c('0x3e')]()[_0x854c('0x1f')](respondWithResult(_0x29e861,null))[_0x854c('0x35')](handleError(_0x29e861,null));}; \ No newline at end of file +var _0x87f3=['sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x87f3,0x1d1));var _0x387f=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x87f3[_0x247fa1];return _0x244f35;};'use strict';var emlformat=require(_0x387f('0x0'));var rimraf=require(_0x387f('0x1'));var zipdir=require(_0x387f('0x2'));var jsonpatch=require(_0x387f('0x3'));var rp=require('request-promise');var moment=require(_0x387f('0x4'));var BPromise=require(_0x387f('0x5'));var Mustache=require(_0x387f('0x6'));var util=require(_0x387f('0x7'));var path=require(_0x387f('0x8'));var sox=require(_0x387f('0x9'));var csv=require('to-csv');var ejs=require(_0x387f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x387f('0xb'));var squel=require('squel');var crypto=require(_0x387f('0xc'));var jsforce=require(_0x387f('0xd'));var deskjs=require(_0x387f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x387f('0xf'));var Papa=require(_0x387f('0x10'));var Redis=require(_0x387f('0x11'));var authService=require(_0x387f('0x12'));var qs=require(_0x387f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x387f('0x14'));var logger=require(_0x387f('0x15'))('api');var utils=require(_0x387f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x387f('0x17'));var db=require(_0x387f('0x18'))['db'];function respondWithStatusCode(_0x21f781,_0x15ef40){_0x15ef40=_0x15ef40||0xcc;return function(_0x3027c6){if(_0x3027c6){return _0x21f781[_0x387f('0x19')](_0x15ef40);}return _0x21f781[_0x387f('0x1a')](_0x15ef40)[_0x387f('0x1b')]();};}function respondWithResult(_0x14ea37,_0x41a058){_0x41a058=_0x41a058||0xc8;return function(_0x36ed75){if(_0x36ed75){return _0x14ea37[_0x387f('0x1a')](_0x41a058)[_0x387f('0x1c')](_0x36ed75);}};}function respondWithFilteredResult(_0x4b0717,_0x1e6e3b){return function(_0x320e54){if(_0x320e54){var _0x44fe73=typeof _0x1e6e3b[_0x387f('0x1d')]===_0x387f('0x1e')&&typeof _0x1e6e3b[_0x387f('0x1f')]===_0x387f('0x1e');var _0x39a034=_0x320e54[_0x387f('0x20')];var _0x4287e5=_0x44fe73?0x0:_0x1e6e3b[_0x387f('0x1d')];var _0x30a17e=_0x44fe73?_0x320e54[_0x387f('0x20')]:_0x1e6e3b['offset']+_0x1e6e3b['limit'];var _0x2bbcf7;if(_0x30a17e>=_0x39a034){_0x30a17e=_0x39a034;_0x2bbcf7=0xc8;}else{_0x2bbcf7=0xce;}_0x4b0717[_0x387f('0x1a')](_0x2bbcf7);return _0x4b0717[_0x387f('0x21')]('Content-Range',_0x4287e5+'-'+_0x30a17e+'/'+_0x39a034)[_0x387f('0x1c')](_0x320e54);}return null;};}function patchUpdates(_0x5c90f5){return function(_0x5a157d){try{jsonpatch[_0x387f('0x22')](_0x5a157d,_0x5c90f5,!![]);}catch(_0x3ea7bd){return BPromise[_0x387f('0x23')](_0x3ea7bd);}return _0x5a157d[_0x387f('0x24')]();};}function saveUpdates(_0xbba430,_0x4bba47){return function(_0x269572){if(_0x269572){return _0x269572[_0x387f('0x25')](_0xbba430)['then'](function(_0x418acc){return _0x418acc;});}return null;};}function removeEntity(_0x1ebed7,_0x5a9f72){return function(_0x2e5d04){if(_0x2e5d04){return _0x2e5d04[_0x387f('0x26')]()[_0x387f('0x27')](function(){_0x1ebed7['status'](0xcc)[_0x387f('0x1b')]();});}};}function handleEntityNotFound(_0x356fa8,_0xde5395){return function(_0x51b591){if(!_0x51b591){_0x356fa8[_0x387f('0x19')](0x194);}return _0x51b591;};}function handleError(_0x3d8ab4,_0x35232e){_0x35232e=_0x35232e||0x1f4;return function(_0x234367){logger[_0x387f('0x28')](_0x234367[_0x387f('0x29')]);if(_0x234367[_0x387f('0x2a')]){delete _0x234367[_0x387f('0x2a')];}_0x3d8ab4['status'](_0x35232e)[_0x387f('0x2b')](_0x234367);};}exports['index']=function(_0x3a4ec2,_0x3ba0d2){var _0x4acddf={},_0x51787c={},_0x4794b0={'count':0x0,'rows':[]};var _0x3f8910=_[_0x387f('0x2c')](db[_0x387f('0x2d')][_0x387f('0x2e')],function(_0x9edec5){return{'name':_0x9edec5[_0x387f('0x2f')],'type':_0x9edec5[_0x387f('0x30')][_0x387f('0x31')]};});_0x51787c[_0x387f('0x32')]=_['map'](_0x3f8910,_0x387f('0x2a'));_0x51787c[_0x387f('0x33')]=_[_0x387f('0x34')](_0x3a4ec2['query']);_0x51787c['filters']=_[_0x387f('0x35')](_0x51787c[_0x387f('0x32')],_0x51787c['query']);_0x4acddf['attributes']=_[_0x387f('0x35')](_0x51787c[_0x387f('0x32')],qs[_0x387f('0x36')](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x36')]));_0x4acddf['attributes']=_0x4acddf[_0x387f('0x37')][_0x387f('0x38')]?_0x4acddf['attributes']:_0x51787c[_0x387f('0x32')];if(!_0x3a4ec2['query'][_0x387f('0x39')](_0x387f('0x3a'))){_0x4acddf[_0x387f('0x1f')]=qs['limit'](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x1f')]);_0x4acddf[_0x387f('0x1d')]=qs[_0x387f('0x1d')](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x1d')]);}_0x4acddf[_0x387f('0x3b')]=qs[_0x387f('0x3c')](_0x3a4ec2['query'][_0x387f('0x3c')]);_0x4acddf[_0x387f('0x3d')]=qs[_0x387f('0x3e')](_[_0x387f('0x3f')](_0x3a4ec2['query'],_0x51787c['filters']),_0x3f8910);if(_0x3a4ec2[_0x387f('0x33')][_0x387f('0x40')]){_0x4acddf['where']=_['merge'](_0x4acddf['where'],{'$or':_['map'](_0x3f8910,function(_0x381cee){if(_0x381cee[_0x387f('0x30')]!==_0x387f('0x41')){var _0x2919d8={};_0x2919d8[_0x381cee[_0x387f('0x2a')]]={'$like':'%'+_0x3a4ec2['query']['filter']+'%'};return _0x2919d8;}})});}_0x4acddf=_[_0x387f('0x42')]({},_0x4acddf,_0x3a4ec2['options']);var _0x3e88d6={'where':_0x4acddf['where']};return db[_0x387f('0x2d')][_0x387f('0x20')](_0x3e88d6)['then'](function(_0x468c6f){_0x4794b0['count']=_0x468c6f;if(_0x3a4ec2['query'][_0x387f('0x43')]){_0x4acddf[_0x387f('0x44')]=[{'all':!![]}];}return db[_0x387f('0x2d')][_0x387f('0x45')](_0x4acddf);})[_0x387f('0x27')](function(_0x51942e){_0x4794b0[_0x387f('0x46')]=_0x51942e;return _0x4794b0;})[_0x387f('0x27')](respondWithFilteredResult(_0x3ba0d2,_0x4acddf))['catch'](handleError(_0x3ba0d2,null));};exports[_0x387f('0x47')]=function(_0x2c1177,_0x3f805a){var _0x44baed={'raw':!![],'where':{'id':_0x2c1177[_0x387f('0x48')]['id']}},_0x2d9c59={};_0x2d9c59[_0x387f('0x32')]=_[_0x387f('0x34')](db['SmsTransferReport'][_0x387f('0x2e')]);_0x2d9c59[_0x387f('0x33')]=_[_0x387f('0x34')](_0x2c1177[_0x387f('0x33')]);_0x2d9c59[_0x387f('0x3e')]=_['intersection'](_0x2d9c59['model'],_0x2d9c59['query']);_0x44baed['attributes']=_[_0x387f('0x35')](_0x2d9c59[_0x387f('0x32')],qs['fields'](_0x2c1177[_0x387f('0x33')][_0x387f('0x36')]));_0x44baed['attributes']=_0x44baed[_0x387f('0x37')]['length']?_0x44baed[_0x387f('0x37')]:_0x2d9c59[_0x387f('0x32')];if(_0x2c1177[_0x387f('0x33')][_0x387f('0x43')]){_0x44baed[_0x387f('0x44')]=[{'all':!![]}];}_0x44baed=_[_0x387f('0x42')]({},_0x44baed,_0x2c1177[_0x387f('0x49')]);return db[_0x387f('0x2d')][_0x387f('0x4a')](_0x44baed)['then'](handleEntityNotFound(_0x3f805a,null))[_0x387f('0x27')](respondWithResult(_0x3f805a,null))['catch'](handleError(_0x3f805a,null));};exports[_0x387f('0x4b')]=function(_0x35676c,_0x49da7c){return db['SmsTransferReport']['create'](_0x35676c['body'],{})['then'](respondWithResult(_0x49da7c,0xc9))['catch'](handleError(_0x49da7c,null));};exports[_0x387f('0x25')]=function(_0x1ad163,_0x51f570){if(_0x1ad163[_0x387f('0x4c')]['id']){delete _0x1ad163['body']['id'];}return db[_0x387f('0x2d')][_0x387f('0x4a')]({'where':{'id':_0x1ad163[_0x387f('0x48')]['id']}})['then'](handleEntityNotFound(_0x51f570,null))[_0x387f('0x27')](saveUpdates(_0x1ad163[_0x387f('0x4c')],null))[_0x387f('0x27')](respondWithResult(_0x51f570,null))[_0x387f('0x4d')](handleError(_0x51f570,null));};exports[_0x387f('0x26')]=function(_0x81d88,_0x5b7644){return db['SmsTransferReport'][_0x387f('0x4a')]({'where':{'id':_0x81d88['params']['id']}})[_0x387f('0x27')](handleEntityNotFound(_0x5b7644,null))['then'](removeEntity(_0x5b7644,null))[_0x387f('0x4d')](handleError(_0x5b7644,null));};exports['describe']=function(_0x4c97df,_0x35c5d9){return db[_0x387f('0x2d')][_0x387f('0x4e')]()['then'](respondWithResult(_0x35c5d9,null))[_0x387f('0x4d')](handleError(_0x35c5d9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5f9a3e1..56038dc 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 _0x1b69=['define','SmsTransferReport','report_sms_transfer','uniqueid','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x22a0ca,_0x58b8b8){var _0x522d67=function(_0x4ebe6e){while(--_0x4ebe6e){_0x22a0ca['push'](_0x22a0ca['shift']());}};_0x522d67(++_0x58b8b8);}(_0x1b69,0x190));var _0x91b6=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x1b69[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x91b6('0x0'));var moment=require(_0x91b6('0x1'));var BPromise=require(_0x91b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91b6('0x3'));var rimraf=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var attributes=require(_0x91b6('0x6'));module[_0x91b6('0x7')]=function(_0x1411c6,_0x264272){return _0x1411c6[_0x91b6('0x8')](_0x91b6('0x9'),attributes,{'tableName':_0x91b6('0xa'),'paranoid':![],'indexes':[{'name':_0x91b6('0xb'),'fields':[_0x91b6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20a8=['report_sms_transfer','uniqueid','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsTransferReport'];(function(_0x4088bd,_0x334965){var _0x1f20f5=function(_0xb879e1){while(--_0xb879e1){_0x4088bd['push'](_0x4088bd['shift']());}};_0x1f20f5(++_0x334965);}(_0x20a8,0x115));var _0x820a=function(_0x255a4d,_0x29068c){_0x255a4d=_0x255a4d-0x0;var _0x108184=_0x20a8[_0x255a4d];return _0x108184;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x820a('0x0'));var moment=require(_0x820a('0x1'));var BPromise=require(_0x820a('0x2'));var rp=require(_0x820a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x820a('0x4'));var config=require(_0x820a('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x820a('0x6')]=function(_0x6312ec,_0x276f7b){return _0x6312ec[_0x820a('0x7')](_0x820a('0x8'),attributes,{'tableName':_0x820a('0x9'),'paranoid':![],'indexes':[{'name':_0x820a('0xa'),'fields':[_0x820a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7c598dd..8ce8999 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 _0x56a4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x43525f,_0x2dff80){var _0x59df96=function(_0x33b23e){while(--_0x33b23e){_0x43525f['push'](_0x43525f['shift']());}};_0x59df96(++_0x2dff80);}(_0x56a4,0x11b));var _0x456a=function(_0x4ff5a2,_0xb33150){_0x4ff5a2=_0x4ff5a2-0x0;var _0xe162f6=_0x56a4[_0x4ff5a2];return _0xe162f6;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var moment=require('moment');var BPromise=require(_0x456a('0x2'));var rs=require(_0x456a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson['client'][_0x456a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52b38d,_0x497df4,_0x2b6329){return new BPromise(function(_0x20c8e0,_0x37f1b4){return client['request'](_0x52b38d,_0x2b6329)[_0x456a('0xa')](function(_0x595c4b){logger[_0x456a('0xb')](_0x456a('0xc'),_0x497df4,_0x456a('0xd'));logger[_0x456a('0xe')](_0x456a('0xf'),_0x497df4,_0x456a('0xd'),JSON[_0x456a('0x10')](_0x595c4b));if(_0x595c4b[_0x456a('0x11')]){if(_0x595c4b[_0x456a('0x11')][_0x456a('0x12')]===0x1f4){logger[_0x456a('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x497df4,_0x595c4b[_0x456a('0x11')]['message']);return _0x37f1b4(_0x595c4b['error'][_0x456a('0x13')]);}logger[_0x456a('0x11')](_0x456a('0xc'),_0x497df4,_0x595c4b[_0x456a('0x11')]['message']);return _0x20c8e0(_0x595c4b[_0x456a('0x11')][_0x456a('0x13')]);}else{logger[_0x456a('0xb')](_0x456a('0xc'),_0x497df4,_0x456a('0xd'));_0x20c8e0(_0x595c4b[_0x456a('0x14')]['message']);}})[_0x456a('0x15')](function(_0x42f7d8){logger[_0x456a('0x11')](_0x456a('0xc'),_0x497df4,_0x42f7d8);_0x37f1b4(_0x42f7d8);});});} \ No newline at end of file +var _0x8d0a=['SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c8ddb,_0x3a61ef){var _0x47b29e=function(_0x25c134){while(--_0x25c134){_0x4c8ddb['push'](_0x4c8ddb['shift']());}};_0x47b29e(++_0x3a61ef);}(_0x8d0a,0x65));var _0xa8d0=function(_0x3ec960,_0x484f07){_0x3ec960=_0x3ec960-0x0;var _0x5f2052=_0x8d0a[_0x3ec960];return _0x5f2052;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f95a7,_0x1f8b78,_0x3ee6b4){return new BPromise(function(_0x55ffc0,_0x508238){return client[_0xa8d0('0xc')](_0x1f95a7,_0x3ee6b4)[_0xa8d0('0xd')](function(_0x49e137){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x1f8b78,_0xa8d0('0xe'));logger['debug'](_0xa8d0('0xf'),_0x1f8b78,_0xa8d0('0xe'),JSON[_0xa8d0('0x10')](_0x49e137));if(_0x49e137[_0xa8d0('0x11')]){if(_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x12')]===0x1f4){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x14')]);return _0x508238(_0x49e137[_0xa8d0('0x11')]['message']);}logger[_0xa8d0('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1f8b78,_0x49e137['error'][_0xa8d0('0x14')]);return _0x55ffc0(_0x49e137[_0xa8d0('0x11')]['message']);}else{logger[_0xa8d0('0x15')](_0xa8d0('0x13'),_0x1f8b78,_0xa8d0('0xe'));_0x55ffc0(_0x49e137[_0xa8d0('0x16')][_0xa8d0('0x14')]);}})[_0xa8d0('0x17')](function(_0x4ef7bf){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x4ef7bf);_0x508238(_0x4ef7bf);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index e7341ea..7167e6f 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 _0x0434=['single','file','create','put','update','delete','exports','multer','util','path','../../components/interaction/service','../../config/environment','./sound.controller','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x0434,0xf7));var _0x4043=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x0434[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var path=require(_0x4043('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4043('0x3'));var config=require(_0x4043('0x4'));var controller=require(_0x4043('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4043('0x6')]);router['get'](_0x4043('0x7'),auth[_0x4043('0x8')](),controller[_0x4043('0x9')]);router['get'](_0x4043('0xa'),auth[_0x4043('0x8')](),controller[_0x4043('0xb')]);var upload=multer({'storage':multer[_0x4043('0xc')]({'destination':function(_0x58985f,_0x3796b3,_0x1cb7e3){_0x1cb7e3(null,path['join'](config[_0x4043('0xd')],_0x4043('0xe')));},'filename':function(_0x51ef35,_0x8cd1d0,_0x3f4f0d){_0x8cd1d0[_0x4043('0xf')]=_0x8cd1d0[_0x4043('0xf')][_0x4043('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f4f0d(null,util[_0x4043('0x11')](_0x4043('0x12'),path[_0x4043('0x13')](_0x8cd1d0[_0x4043('0xf')],path[_0x4043('0x14')](_0x8cd1d0[_0x4043('0xf')])),Date[_0x4043('0x15')](),path[_0x4043('0x14')](_0x8cd1d0['originalname'])));}})});router[_0x4043('0x16')]('/',upload[_0x4043('0x17')](_0x4043('0x18')),controller[_0x4043('0x19')]);router[_0x4043('0x1a')](_0x4043('0x7'),auth['isAuthenticated'](),controller[_0x4043('0x1b')]);router[_0x4043('0x1c')](_0x4043('0x7'),auth[_0x4043('0x8')](),controller[_0x4043('0x1c')]);module[_0x4043('0x1d')]=router; \ No newline at end of file +var _0x9de2=['fs-extra','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','file','create','put','update','delete','multer','connect-timeout','express'];(function(_0x2bbdfa,_0x960043){var _0x42f870=function(_0x2162c8){while(--_0x2162c8){_0x2bbdfa['push'](_0x2bbdfa['shift']());}};_0x42f870(++_0x960043);}(_0x9de2,0x101));var _0x29de=function(_0x128b20,_0x495b28){_0x128b20=_0x128b20-0x0;var _0x3c3259=_0x9de2[_0x128b20];return _0x3c3259;};'use strict';var multer=require(_0x29de('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29de('0x1'));var express=require(_0x29de('0x2'));var router=express['Router']();var fs_extra=require(_0x29de('0x3'));var auth=require(_0x29de('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x29de('0x5'));router[_0x29de('0x6')]('/',auth[_0x29de('0x7')](),controller[_0x29de('0x8')]);router['get'](_0x29de('0x9'),auth[_0x29de('0x7')](),controller['show']);router[_0x29de('0x6')](_0x29de('0xa'),auth[_0x29de('0x7')](),controller[_0x29de('0xb')]);var upload=multer({'storage':multer[_0x29de('0xc')]({'destination':function(_0x4ae24e,_0x593cbd,_0x3c2165){_0x3c2165(null,path[_0x29de('0xd')](config['root'],_0x29de('0xe')));},'filename':function(_0x3cffaa,_0xa0169f,_0x297b63){_0xa0169f[_0x29de('0xf')]=_0xa0169f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x297b63(null,util[_0x29de('0x10')](_0x29de('0x11'),path[_0x29de('0x12')](_0xa0169f['originalname'],path[_0x29de('0x13')](_0xa0169f[_0x29de('0xf')])),Date[_0x29de('0x14')](),path['extname'](_0xa0169f['originalname'])));}})});router['post']('/',upload['single'](_0x29de('0x15')),controller[_0x29de('0x16')]);router[_0x29de('0x17')]('/:id',auth[_0x29de('0x7')](),controller[_0x29de('0x18')]);router[_0x29de('0x19')](_0x29de('0x9'),auth['isAuthenticated'](),controller[_0x29de('0x19')]);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 1376755..9cef2db 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 _0x28d9=['name','FLOAT','INTEGER','BIGINT','exports','STRING'];(function(_0x20d65e,_0x225482){var _0xdd7ffa=function(_0x33de13){while(--_0x33de13){_0x20d65e['push'](_0x20d65e['shift']());}};_0xdd7ffa(++_0x225482);}(_0x28d9,0x1f0));var _0x928d=function(_0x455813,_0x2e8aa2){_0x455813=_0x455813-0x0;var _0x516a55=_0x28d9[_0x455813];return _0x516a55;};'use strict';var Sequelize=require('sequelize');module[_0x928d('0x0')]={'name':{'type':Sequelize[_0x928d('0x1')],'unique':_0x928d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x928d('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x928d('0x1')]},'original_format':{'type':Sequelize[_0x928d('0x1')]},'original_duration':{'type':Sequelize[_0x928d('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x928d('0x4')]},'original_bitRate':{'type':Sequelize[_0x928d('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x928d('0x1')]},'converted_duration':{'type':Sequelize[_0x928d('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x928d('0x5')]},'converted_channelCount':{'type':Sequelize[_0x928d('0x4')]},'converted_bitRate':{'type':Sequelize[_0x928d('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x928d('0x4')]}}; \ No newline at end of file +var _0x8103=['BIGINT','INTEGER','FLOAT','sequelize','exports','STRING','name'];(function(_0x37646c,_0xe91c4e){var _0x2dae3f=function(_0x2dad77){while(--_0x2dad77){_0x37646c['push'](_0x37646c['shift']());}};_0x2dae3f(++_0xe91c4e);}(_0x8103,0x1c3));var _0x3810=function(_0x10d60e,_0x464eb4){_0x10d60e=_0x10d60e-0x0;var _0xe16e80=_0x8103[_0x10d60e];return _0xe16e80;};'use strict';var Sequelize=require(_0x3810('0x0'));module[_0x3810('0x1')]={'name':{'type':Sequelize[_0x3810('0x2')],'unique':_0x3810('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x3810('0x2')]},'display_name':{'type':Sequelize[_0x3810('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x3810('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x3810('0x4')]},'original_channelCount':{'type':Sequelize[_0x3810('0x5')]},'original_bitRate':{'type':Sequelize[_0x3810('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3810('0x5')]},'converted_format':{'type':Sequelize[_0x3810('0x2')]},'converted_duration':{'type':Sequelize[_0x3810('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x3810('0x4')]},'converted_channelCount':{'type':Sequelize[_0x3810('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3810('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 12062f6..63667e2 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 _0xdecb=['create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','server/files/sounds/converted','format','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','role','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','download','save_name','converted_format','join','ValidationError','Sound\x20not\x20found','root'];(function(_0x24aaff,_0x3c16d5){var _0x26d303=function(_0x189164){while(--_0x189164){_0x24aaff['push'](_0x24aaff['shift']());}};_0x26d303(++_0x3c16d5);}(_0xdecb,0x135));var _0xbdec=function(_0x23a198,_0x366cb0){_0x23a198=_0x23a198-0x0;var _0x4c664c=_0xdecb[_0x23a198];return _0x4c664c;};'use strict';var emlformat=require(_0xbdec('0x0'));var rimraf=require(_0xbdec('0x1'));var zipdir=require(_0xbdec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbdec('0x3'));var moment=require(_0xbdec('0x4'));var BPromise=require(_0xbdec('0x5'));var Mustache=require(_0xbdec('0x6'));var util=require(_0xbdec('0x7'));var path=require(_0xbdec('0x8'));var sox=require(_0xbdec('0x9'));var csv=require(_0xbdec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbdec('0xb'));var _=require(_0xbdec('0xc'));var squel=require('squel');var crypto=require(_0xbdec('0xd'));var jsforce=require(_0xbdec('0xe'));var deskjs=require(_0xbdec('0xf'));var toCsv=require(_0xbdec('0xa'));var querystring=require(_0xbdec('0x10'));var Papa=require(_0xbdec('0x11'));var Redis=require(_0xbdec('0x12'));var authService=require(_0xbdec('0x13'));var qs=require(_0xbdec('0x14'));var as=require(_0xbdec('0x15'));var hardwareService=require(_0xbdec('0x16'));var logger=require(_0xbdec('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbdec('0x18'));var db=require(_0xbdec('0x19'))['db'];function respondWithStatusCode(_0x5a87ce,_0x36bd0e){_0x36bd0e=_0x36bd0e||0xcc;return function(_0xfc94d5){if(_0xfc94d5){return _0x5a87ce[_0xbdec('0x1a')](_0x36bd0e);}return _0x5a87ce[_0xbdec('0x1b')](_0x36bd0e)[_0xbdec('0x1c')]();};}function respondWithResult(_0x3156cb,_0x2d56ef){_0x2d56ef=_0x2d56ef||0xc8;return function(_0x4320b6){if(_0x4320b6){return _0x3156cb[_0xbdec('0x1b')](_0x2d56ef)[_0xbdec('0x1d')](_0x4320b6);}};}function respondWithFilteredResult(_0x3c2cda,_0x3bb580){return function(_0x23f016){if(_0x23f016){var _0x411a9d=typeof _0x3bb580[_0xbdec('0x1e')]==='undefined'&&typeof _0x3bb580[_0xbdec('0x1f')]===_0xbdec('0x20');var _0x59910c=_0x23f016['count'];var _0x40ba58=_0x411a9d?0x0:_0x3bb580[_0xbdec('0x1e')];var _0x5485ee=_0x411a9d?_0x23f016[_0xbdec('0x21')]:_0x3bb580[_0xbdec('0x1e')]+_0x3bb580[_0xbdec('0x1f')];var _0x1d163e;if(_0x5485ee>=_0x59910c){_0x5485ee=_0x59910c;_0x1d163e=0xc8;}else{_0x1d163e=0xce;}_0x3c2cda[_0xbdec('0x1b')](_0x1d163e);return _0x3c2cda['set'](_0xbdec('0x22'),_0x40ba58+'-'+_0x5485ee+'/'+_0x59910c)['json'](_0x23f016);}return null;};}function patchUpdates(_0x5636e0){return function(_0x45381b){try{jsonpatch[_0xbdec('0x23')](_0x45381b,_0x5636e0,!![]);}catch(_0x4c80ae){return BPromise[_0xbdec('0x24')](_0x4c80ae);}return _0x45381b[_0xbdec('0x25')]();};}function saveUpdates(_0x549bec,_0x30d775){return function(_0x1710a9){if(_0x1710a9){return _0x1710a9[_0xbdec('0x26')](_0x549bec)[_0xbdec('0x27')](function(_0x5d2084){return _0x5d2084;});}return null;};}function removeEntity(_0x1300f1,_0x202c2a){return function(_0x643d82){if(_0x643d82){return _0x643d82[_0xbdec('0x28')]()['then'](function(){var _0x412e21=_0x643d82['get']({'plain':!![]});var _0x1e2c92=_0xbdec('0x29');return db[_0xbdec('0x2a')][_0xbdec('0x28')]({'where':{'type':_0x1e2c92,'resourceId':_0x412e21['id']}})[_0xbdec('0x27')](function(){return _0x643d82;});})[_0xbdec('0x27')](function(){_0x1300f1[_0xbdec('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3231a3,_0x95f587){return function(_0x150c53){if(!_0x150c53){_0x3231a3[_0xbdec('0x1a')](0x194);}return _0x150c53;};}function handleError(_0x47f33c,_0x28de5e){_0x28de5e=_0x28de5e||0x1f4;return function(_0x45187e){logger[_0xbdec('0x2b')](_0x45187e[_0xbdec('0x2c')]);if(_0x45187e['name']){delete _0x45187e[_0xbdec('0x2d')];}_0x47f33c['status'](_0x28de5e)[_0xbdec('0x2e')](_0x45187e);};}exports[_0xbdec('0x2f')]=function(_0x498aaa,_0x1cc9ad){var _0xf41fec={},_0x3f336d={},_0x144520={'count':0x0,'rows':[]};var _0x2efd7e=_['map'](db[_0xbdec('0x30')][_0xbdec('0x31')],function(_0x6008c2){return{'name':_0x6008c2[_0xbdec('0x32')],'type':_0x6008c2[_0xbdec('0x33')][_0xbdec('0x34')]};});_0x3f336d[_0xbdec('0x35')]=_[_0xbdec('0x36')](_0x2efd7e,_0xbdec('0x2d'));_0x3f336d[_0xbdec('0x37')]=_[_0xbdec('0x38')](_0x498aaa[_0xbdec('0x37')]);_0x3f336d['filters']=_[_0xbdec('0x39')](_0x3f336d['model'],_0x3f336d[_0xbdec('0x37')]);_0xf41fec[_0xbdec('0x3a')]=_['intersection'](_0x3f336d[_0xbdec('0x35')],qs[_0xbdec('0x3b')](_0x498aaa['query'][_0xbdec('0x3b')]));_0xf41fec[_0xbdec('0x3a')]=_0xf41fec[_0xbdec('0x3a')]['length']?_0xf41fec[_0xbdec('0x3a')]:_0x3f336d[_0xbdec('0x35')];if(!_0x498aaa[_0xbdec('0x37')]['hasOwnProperty']('nolimit')){_0xf41fec['limit']=qs[_0xbdec('0x1f')](_0x498aaa[_0xbdec('0x37')][_0xbdec('0x1f')]);_0xf41fec[_0xbdec('0x1e')]=qs['offset'](_0x498aaa[_0xbdec('0x37')][_0xbdec('0x1e')]);}_0xf41fec['order']=qs[_0xbdec('0x3c')](_0x498aaa[_0xbdec('0x37')][_0xbdec('0x3c')]);_0xf41fec[_0xbdec('0x3d')]=qs['filters'](_[_0xbdec('0x3e')](_0x498aaa[_0xbdec('0x37')],_0x3f336d[_0xbdec('0x3f')]),_0x2efd7e);if(_0x498aaa[_0xbdec('0x37')][_0xbdec('0x40')]){_0xf41fec[_0xbdec('0x3d')]=_[_0xbdec('0x41')](_0xf41fec['where'],{'$or':_['map'](_0x2efd7e,function(_0x52462e){if(_0x52462e['type']!==_0xbdec('0x42')){var _0x1dd3d9={};_0x1dd3d9[_0x52462e[_0xbdec('0x2d')]]={'$like':'%'+_0x498aaa[_0xbdec('0x37')][_0xbdec('0x40')]+'%'};return _0x1dd3d9;}})});}_0xf41fec=_['merge']({},_0xf41fec,_0x498aaa[_0xbdec('0x43')]);var _0x4236ce={'where':_0xf41fec[_0xbdec('0x3d')]};return db[_0xbdec('0x30')][_0xbdec('0x21')](_0x4236ce)[_0xbdec('0x27')](function(_0x11d8f1){_0x144520[_0xbdec('0x21')]=_0x11d8f1;if(_0x498aaa[_0xbdec('0x37')][_0xbdec('0x44')]){_0xf41fec['include']=[{'all':!![]}];}return db[_0xbdec('0x30')][_0xbdec('0x45')](_0xf41fec);})[_0xbdec('0x27')](function(_0x5aea31){_0x144520[_0xbdec('0x46')]=_0x5aea31;return _0x144520;})[_0xbdec('0x27')](respondWithFilteredResult(_0x1cc9ad,_0xf41fec))[_0xbdec('0x47')](handleError(_0x1cc9ad,null));};exports[_0xbdec('0x48')]=function(_0x152ded,_0x13de11){var _0x47461a={'raw':!![],'where':{'id':_0x152ded[_0xbdec('0x49')]['id']}},_0x47c184={};_0x47c184[_0xbdec('0x35')]=_[_0xbdec('0x38')](db[_0xbdec('0x30')][_0xbdec('0x31')]);_0x47c184[_0xbdec('0x37')]=_[_0xbdec('0x38')](_0x152ded[_0xbdec('0x37')]);_0x47c184['filters']=_['intersection'](_0x47c184['model'],_0x47c184[_0xbdec('0x37')]);_0x47461a[_0xbdec('0x3a')]=_[_0xbdec('0x39')](_0x47c184[_0xbdec('0x35')],qs[_0xbdec('0x3b')](_0x152ded[_0xbdec('0x37')]['fields']));_0x47461a[_0xbdec('0x3a')]=_0x47461a[_0xbdec('0x3a')][_0xbdec('0x4a')]?_0x47461a[_0xbdec('0x3a')]:_0x47c184[_0xbdec('0x35')];if(_0x152ded[_0xbdec('0x37')]['includeAll']){_0x47461a[_0xbdec('0x4b')]=[{'all':!![]}];}_0x47461a=_[_0xbdec('0x41')]({},_0x47461a,_0x152ded['options']);return db[_0xbdec('0x30')][_0xbdec('0x4c')](_0x47461a)[_0xbdec('0x27')](handleEntityNotFound(_0x13de11,null))['then'](respondWithResult(_0x13de11,null))[_0xbdec('0x47')](handleError(_0x13de11,null));};exports[_0xbdec('0x4d')]=function(_0x3e06a1,_0x2521b1,_0x5bcf5c){return db[_0xbdec('0x30')][_0xbdec('0x4c')]({'where':{'id':_0x3e06a1['params']['id']},'attributes':[_0xbdec('0x2d'),_0xbdec('0x4e'),_0xbdec('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x2521b1,null))['then'](function(_0x39e74a){if(_0x39e74a){if(!fs['existsSync'](path[_0xbdec('0x50')](config['root'],'server/files/sounds/converted',_0x39e74a[_0xbdec('0x4e')]+'.'+_0x39e74a[_0xbdec('0x4f')]))){throw new db['Sequelize'][(_0xbdec('0x51'))](_0xbdec('0x52'));}return _0x2521b1[_0xbdec('0x4d')](path[_0xbdec('0x50')](config[_0xbdec('0x53')],'server/files/sounds/converted',util['format']('%s.%s',_0x39e74a[_0xbdec('0x4e')],_0x39e74a['converted_format'])),util['format']('%s.%s',_0x39e74a['name'],_0x39e74a['converted_format']));}return null;})['catch'](handleError(_0x2521b1,null));};exports[_0xbdec('0x54')]=function(_0x40b3b5,_0x27b979,_0x354e97){var _0x5e64bb={'name':path[_0xbdec('0x55')](_0x40b3b5[_0xbdec('0x56')][_0xbdec('0x57')],path[_0xbdec('0x58')](_0x40b3b5[_0xbdec('0x56')][_0xbdec('0x57')])),'save_name':path[_0xbdec('0x55')](_0x40b3b5[_0xbdec('0x56')][_0xbdec('0x59')],path[_0xbdec('0x58')](_0x40b3b5[_0xbdec('0x56')]['filename'])),'original_format':path[_0xbdec('0x58')](_0x40b3b5[_0xbdec('0x56')][_0xbdec('0x57')])[_0xbdec('0x5a')](0x1),'converted_format':_0xbdec('0x5b')};var _0x49b6e8=path[_0xbdec('0x50')](config['root'],_0xbdec('0x5c'),_0x40b3b5[_0xbdec('0x56')]['filename']);var _0x1f49d0=path['join'](config['root'],_0xbdec('0x5d'),util[_0xbdec('0x5e')](_0xbdec('0x5f'),path[_0xbdec('0x55')](_0x40b3b5[_0xbdec('0x56')][_0xbdec('0x59')],path[_0xbdec('0x58')](_0x40b3b5['file'][_0xbdec('0x59')])),_0x5e64bb[_0xbdec('0x4f')]));logger[_0xbdec('0x60')](_0xbdec('0x61'),_0x49b6e8);logger[_0xbdec('0x60')](_0xbdec('0x62'),_0x1f49d0);try{fs[_0xbdec('0x63')](_0x49b6e8,parseInt(_0xbdec('0x64'),0x8));var _0x1badd6=sox[_0xbdec('0x65')](_0x49b6e8,_0x1f49d0,{'sampleRate':0x1f40,'format':_0xbdec('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1badd6['on']('error',function(_0x330a5b){fs[_0xbdec('0x66')](_0x49b6e8);_0x27b979[_0xbdec('0x1b')](0x1f4)['send'](_0x330a5b);});_0x1badd6['on'](_0xbdec('0x67'),function(_0x2a12f8){_0x5e64bb[_0xbdec('0x68')]=isNaN(_0x2a12f8[_0xbdec('0x69')])?null:_0x2a12f8[_0xbdec('0x69')]*0x3e8;_0x5e64bb[_0xbdec('0x6a')]=isNaN(_0x2a12f8[_0xbdec('0x6b')])?null:_0x2a12f8[_0xbdec('0x6b')];_0x5e64bb[_0xbdec('0x6c')]=isNaN(_0x2a12f8[_0xbdec('0x6d')])?null:_0x2a12f8[_0xbdec('0x6d')];_0x5e64bb[_0xbdec('0x6e')]=isNaN(_0x2a12f8['bitRate'])?null:_0x2a12f8[_0xbdec('0x6f')];_0x5e64bb[_0xbdec('0x70')]=isNaN(_0x2a12f8[_0xbdec('0x71')])?null:_0x2a12f8[_0xbdec('0x71')];});_0x1badd6['on']('dest',function(_0x36ba66){_0x5e64bb[_0xbdec('0x72')]=isNaN(_0x36ba66['duration'])?null:_0x36ba66['duration']*0x3e8;_0x5e64bb[_0xbdec('0x73')]=isNaN(_0x36ba66[_0xbdec('0x6b')])?null:_0x36ba66[_0xbdec('0x6b')];_0x5e64bb[_0xbdec('0x74')]=isNaN(_0x36ba66[_0xbdec('0x6d')])?null:_0x36ba66[_0xbdec('0x6d')];_0x5e64bb[_0xbdec('0x75')]=isNaN(_0x36ba66[_0xbdec('0x6f')])?null:_0x36ba66['bitRate'];_0x5e64bb[_0xbdec('0x76')]=isNaN(_0x36ba66[_0xbdec('0x71')])?null:_0x36ba66[_0xbdec('0x71')];});_0x1badd6['on'](_0xbdec('0x1c'),function(){fs[_0xbdec('0x63')](_0x1f49d0,parseInt('0777',0x8));return db[_0xbdec('0x30')][_0xbdec('0x54')](_0x5e64bb)[_0xbdec('0x27')](function(_0x2ab57f){var _0x274c7a={'role':_0x40b3b5[_0xbdec('0x77')]['role'],'userProfileId':_0x40b3b5[_0xbdec('0x77')][_0xbdec('0x78')]};if(!_0x274c7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c7a[_0xbdec('0x79')]===_0xbdec('0x7a')){var _0x4dd442=_0x2ab57f[_0xbdec('0x7b')]({'plain':!![]});return db[_0xbdec('0x7c')][_0xbdec('0x4c')]({'where':{'name':'Sounds','userProfileId':_0x274c7a['userProfileId']},'raw':!![]})[_0xbdec('0x27')](function(_0x48e3e4){if(_0x48e3e4&&_0x48e3e4[_0xbdec('0x7d')]===0x0){return db[_0xbdec('0x2a')][_0xbdec('0x54')]({'name':_0x4dd442[_0xbdec('0x2d')],'resourceId':_0x4dd442['id'],'type':_0x48e3e4['name'],'sectionId':_0x48e3e4['id']},{})[_0xbdec('0x27')](function(){return _0x2ab57f;});}else{return _0x2ab57f;}})['catch'](function(_0x5a9233){logger[_0xbdec('0x2b')](_0xbdec('0x7e'),_0x5a9233);throw _0x5a9233;});}return _0x2ab57f;})[_0xbdec('0x27')](respondWithResult(_0x27b979,null))['catch'](handleError(_0x27b979,null));});_0x1badd6[_0xbdec('0x7f')]();}catch(_0x32869f){_0x27b979[_0xbdec('0x1b')](0x1f4)[_0xbdec('0x2e')](_0x32869f);}};exports[_0xbdec('0x26')]=function(_0x565e9f,_0x578dbc,_0x1676b6){return db[_0xbdec('0x30')][_0xbdec('0x4c')]({'where':{'id':_0x565e9f['params']['id']}})[_0xbdec('0x27')](handleEntityNotFound(_0x578dbc,null))[_0xbdec('0x27')](saveUpdates(_[_0xbdec('0x3e')](_0x565e9f[_0xbdec('0x77')],[_0xbdec('0x2d'),_0xbdec('0x80')]),null))['then'](respondWithResult(_0x578dbc,null))[_0xbdec('0x47')](handleError(_0x578dbc,null));};exports[_0xbdec('0x81')]=function(_0x5635b5,_0x2e8bce,_0x298a7a){return db[_0xbdec('0x30')][_0xbdec('0x4c')]({'where':{'id':_0x5635b5[_0xbdec('0x49')]['id']}})[_0xbdec('0x27')](function(_0x2f3313){if(_0x2f3313){return _0x2f3313[_0xbdec('0x28')]();}})[_0xbdec('0x27')](function(_0x226a6f){var _0x11a7f4=path[_0xbdec('0x50')](config['root'],_0xbdec('0x5c'),util[_0xbdec('0x5e')]('%s.%s',_0x226a6f[_0xbdec('0x4e')],_0x226a6f[_0xbdec('0x82')]));var _0x177235=path['join'](config[_0xbdec('0x53')],'server/files/sounds/converted',util['format'](_0xbdec('0x5f'),_0x226a6f[_0xbdec('0x4e')],_0x226a6f['converted_format']));fs[_0xbdec('0x66')](_0x11a7f4);fs[_0xbdec('0x66')](_0x177235);return _0x226a6f;})[_0xbdec('0x27')](function(_0x4d723a){if(_0x4d723a){return _0x2e8bce['status'](0xcc)[_0xbdec('0x1c')]();}})[_0xbdec('0x27')](handleEntityNotFound(_0x2e8bce,null))[_0xbdec('0x47')](handleError(_0x2e8bce,null));}; \ No newline at end of file +var _0x1e78=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','Sounds','UserProfileResource','send','index','Sound','fieldName','key','map','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','catch','length','find','params','save_name','existsSync','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','file','originalname','extname','basename','filename','substring','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_bitRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','original_format','unlinkSync'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x1e78,0xf8));var _0x81e7=function(_0x420c36,_0xc8683b){_0x420c36=_0x420c36-0x0;var _0x410c0b=_0x1e78[_0x420c36];return _0x410c0b;};'use strict';var emlformat=require(_0x81e7('0x0'));var rimraf=require(_0x81e7('0x1'));var zipdir=require(_0x81e7('0x2'));var jsonpatch=require(_0x81e7('0x3'));var rp=require(_0x81e7('0x4'));var moment=require(_0x81e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81e7('0x6'));var util=require('util');var path=require(_0x81e7('0x7'));var sox=require('sox');var csv=require(_0x81e7('0x8'));var ejs=require(_0x81e7('0x9'));var fs=require('fs');var fs_extra=require(_0x81e7('0xa'));var _=require('lodash');var squel=require(_0x81e7('0xb'));var crypto=require(_0x81e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x81e7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x81e7('0xe'));var Papa=require(_0x81e7('0xf'));var Redis=require(_0x81e7('0x10'));var authService=require(_0x81e7('0x11'));var qs=require(_0x81e7('0x12'));var as=require(_0x81e7('0x13'));var hardwareService=require(_0x81e7('0x14'));var logger=require('../../config/logger')(_0x81e7('0x15'));var utils=require(_0x81e7('0x16'));var config=require(_0x81e7('0x17'));var licenseUtil=require(_0x81e7('0x18'));var db=require(_0x81e7('0x19'))['db'];function respondWithStatusCode(_0x1a71c7,_0x467f52){_0x467f52=_0x467f52||0xcc;return function(_0x520f94){if(_0x520f94){return _0x1a71c7[_0x81e7('0x1a')](_0x467f52);}return _0x1a71c7[_0x81e7('0x1b')](_0x467f52)[_0x81e7('0x1c')]();};}function respondWithResult(_0x1838ae,_0x412306){_0x412306=_0x412306||0xc8;return function(_0xdec4a6){if(_0xdec4a6){return _0x1838ae[_0x81e7('0x1b')](_0x412306)[_0x81e7('0x1d')](_0xdec4a6);}};}function respondWithFilteredResult(_0x771929,_0x261159){return function(_0x27662a){if(_0x27662a){var _0x178ef2=typeof _0x261159['offset']==='undefined'&&typeof _0x261159[_0x81e7('0x1e')]===_0x81e7('0x1f');var _0x38e492=_0x27662a['count'];var _0x1e5e43=_0x178ef2?0x0:_0x261159[_0x81e7('0x20')];var _0x23bd8f=_0x178ef2?_0x27662a[_0x81e7('0x21')]:_0x261159[_0x81e7('0x20')]+_0x261159[_0x81e7('0x1e')];var _0x4306c5;if(_0x23bd8f>=_0x38e492){_0x23bd8f=_0x38e492;_0x4306c5=0xc8;}else{_0x4306c5=0xce;}_0x771929[_0x81e7('0x1b')](_0x4306c5);return _0x771929[_0x81e7('0x22')](_0x81e7('0x23'),_0x1e5e43+'-'+_0x23bd8f+'/'+_0x38e492)[_0x81e7('0x1d')](_0x27662a);}return null;};}function patchUpdates(_0x573483){return function(_0xdd9550){try{jsonpatch[_0x81e7('0x24')](_0xdd9550,_0x573483,!![]);}catch(_0x5d3f30){return BPromise[_0x81e7('0x25')](_0x5d3f30);}return _0xdd9550[_0x81e7('0x26')]();};}function saveUpdates(_0x194c1d,_0x14dee4){return function(_0x47e8d8){if(_0x47e8d8){return _0x47e8d8['update'](_0x194c1d)[_0x81e7('0x27')](function(_0x8ca850){return _0x8ca850;});}return null;};}function removeEntity(_0x2d1d13,_0x8ee2ef){return function(_0x33bc47){if(_0x33bc47){return _0x33bc47[_0x81e7('0x28')]()['then'](function(){var _0x1c8b77=_0x33bc47['get']({'plain':!![]});var _0x2769e5=_0x81e7('0x29');return db[_0x81e7('0x2a')][_0x81e7('0x28')]({'where':{'type':_0x2769e5,'resourceId':_0x1c8b77['id']}})[_0x81e7('0x27')](function(){return _0x33bc47;});})[_0x81e7('0x27')](function(){_0x2d1d13[_0x81e7('0x1b')](0xcc)[_0x81e7('0x1c')]();});}};}function handleEntityNotFound(_0x59e3c6,_0x51cfce){return function(_0x517f18){if(!_0x517f18){_0x59e3c6['sendStatus'](0x194);}return _0x517f18;};}function handleError(_0x4a1ab0,_0x2fb1c8){_0x2fb1c8=_0x2fb1c8||0x1f4;return function(_0x945d75){logger['error'](_0x945d75['stack']);if(_0x945d75['name']){delete _0x945d75['name'];}_0x4a1ab0['status'](_0x2fb1c8)[_0x81e7('0x2b')](_0x945d75);};}exports[_0x81e7('0x2c')]=function(_0x33c51d,_0xeb00c6){var _0x337d51={},_0x2dd427={},_0x12c32c={'count':0x0,'rows':[]};var _0x54607f=_['map'](db[_0x81e7('0x2d')]['rawAttributes'],function(_0x192d1a){return{'name':_0x192d1a[_0x81e7('0x2e')],'type':_0x192d1a['type'][_0x81e7('0x2f')]};});_0x2dd427['model']=_[_0x81e7('0x30')](_0x54607f,_0x81e7('0x31'));_0x2dd427[_0x81e7('0x32')]=_[_0x81e7('0x33')](_0x33c51d[_0x81e7('0x32')]);_0x2dd427['filters']=_[_0x81e7('0x34')](_0x2dd427[_0x81e7('0x35')],_0x2dd427['query']);_0x337d51[_0x81e7('0x36')]=_[_0x81e7('0x34')](_0x2dd427[_0x81e7('0x35')],qs['fields'](_0x33c51d['query'][_0x81e7('0x37')]));_0x337d51['attributes']=_0x337d51['attributes']['length']?_0x337d51['attributes']:_0x2dd427[_0x81e7('0x35')];if(!_0x33c51d[_0x81e7('0x32')][_0x81e7('0x38')](_0x81e7('0x39'))){_0x337d51[_0x81e7('0x1e')]=qs['limit'](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x1e')]);_0x337d51['offset']=qs[_0x81e7('0x20')](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x20')]);}_0x337d51['order']=qs[_0x81e7('0x3a')](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x3a')]);_0x337d51[_0x81e7('0x3b')]=qs[_0x81e7('0x3c')](_[_0x81e7('0x3d')](_0x33c51d['query'],_0x2dd427[_0x81e7('0x3c')]),_0x54607f);if(_0x33c51d[_0x81e7('0x32')][_0x81e7('0x3e')]){_0x337d51['where']=_['merge'](_0x337d51[_0x81e7('0x3b')],{'$or':_[_0x81e7('0x30')](_0x54607f,function(_0x1cff0a){if(_0x1cff0a[_0x81e7('0x3f')]!=='VIRTUAL'){var _0x20a659={};_0x20a659[_0x1cff0a[_0x81e7('0x31')]]={'$like':'%'+_0x33c51d[_0x81e7('0x32')]['filter']+'%'};return _0x20a659;}})});}_0x337d51=_[_0x81e7('0x40')]({},_0x337d51,_0x33c51d[_0x81e7('0x41')]);var _0x2cdcdb={'where':_0x337d51['where']};return db[_0x81e7('0x2d')]['count'](_0x2cdcdb)[_0x81e7('0x27')](function(_0x4346b6){_0x12c32c[_0x81e7('0x21')]=_0x4346b6;if(_0x33c51d[_0x81e7('0x32')][_0x81e7('0x42')]){_0x337d51[_0x81e7('0x43')]=[{'all':!![]}];}return db['Sound'][_0x81e7('0x44')](_0x337d51);})[_0x81e7('0x27')](function(_0x2d83e8){_0x12c32c['rows']=_0x2d83e8;return _0x12c32c;})[_0x81e7('0x27')](respondWithFilteredResult(_0xeb00c6,_0x337d51))[_0x81e7('0x45')](handleError(_0xeb00c6,null));};exports['show']=function(_0x1866e1,_0x3ccffe){var _0x45b5fd={'raw':!![],'where':{'id':_0x1866e1['params']['id']}},_0x5cb529={};_0x5cb529[_0x81e7('0x35')]=_['keys'](db[_0x81e7('0x2d')]['rawAttributes']);_0x5cb529[_0x81e7('0x32')]=_[_0x81e7('0x33')](_0x1866e1['query']);_0x5cb529[_0x81e7('0x3c')]=_[_0x81e7('0x34')](_0x5cb529[_0x81e7('0x35')],_0x5cb529[_0x81e7('0x32')]);_0x45b5fd[_0x81e7('0x36')]=_[_0x81e7('0x34')](_0x5cb529[_0x81e7('0x35')],qs['fields'](_0x1866e1['query'][_0x81e7('0x37')]));_0x45b5fd[_0x81e7('0x36')]=_0x45b5fd[_0x81e7('0x36')][_0x81e7('0x46')]?_0x45b5fd[_0x81e7('0x36')]:_0x5cb529[_0x81e7('0x35')];if(_0x1866e1['query'][_0x81e7('0x42')]){_0x45b5fd[_0x81e7('0x43')]=[{'all':!![]}];}_0x45b5fd=_[_0x81e7('0x40')]({},_0x45b5fd,_0x1866e1['options']);return db[_0x81e7('0x2d')][_0x81e7('0x47')](_0x45b5fd)[_0x81e7('0x27')](handleEntityNotFound(_0x3ccffe,null))[_0x81e7('0x27')](respondWithResult(_0x3ccffe,null))['catch'](handleError(_0x3ccffe,null));};exports['download']=function(_0x59f317,_0xd67615,_0x33b401){return db[_0x81e7('0x2d')][_0x81e7('0x47')]({'where':{'id':_0x59f317[_0x81e7('0x48')]['id']},'attributes':[_0x81e7('0x31'),_0x81e7('0x49'),'converted_format'],'raw':!![]})[_0x81e7('0x27')](handleEntityNotFound(_0xd67615,null))[_0x81e7('0x27')](function(_0x407298){if(_0x407298){if(!fs[_0x81e7('0x4a')](path['join'](config['root'],_0x81e7('0x4b'),_0x407298['save_name']+'.'+_0x407298[_0x81e7('0x4c')]))){throw new db['Sequelize'][(_0x81e7('0x4d'))](_0x81e7('0x4e'));}return _0xd67615['download'](path[_0x81e7('0x4f')](config['root'],'server/files/sounds/converted',util[_0x81e7('0x50')](_0x81e7('0x51'),_0x407298[_0x81e7('0x49')],_0x407298['converted_format'])),util['format']('%s.%s',_0x407298[_0x81e7('0x31')],_0x407298[_0x81e7('0x4c')]));}return null;})[_0x81e7('0x45')](handleError(_0xd67615,null));};exports[_0x81e7('0x52')]=function(_0x2ee359,_0x2b1b24,_0x5d5ba4){var _0x21c039={'name':path['basename'](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x54')],path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')]['originalname'])),'save_name':path[_0x81e7('0x56')](_0x2ee359['file'][_0x81e7('0x57')],path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x57')])),'original_format':path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x54')])[_0x81e7('0x58')](0x1),'converted_format':'wav'};var _0x5e0a7b=path[_0x81e7('0x4f')](config[_0x81e7('0x59')],_0x81e7('0x5a'),_0x2ee359[_0x81e7('0x53')]['filename']);var _0x1b076a=path['join'](config['root'],'server/files/sounds/converted',util[_0x81e7('0x50')](_0x81e7('0x51'),path[_0x81e7('0x56')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x57')],path['extname'](_0x2ee359['file'][_0x81e7('0x57')])),_0x21c039['converted_format']));logger[_0x81e7('0x5b')](_0x81e7('0x5c'),_0x5e0a7b);logger[_0x81e7('0x5b')](_0x81e7('0x5d'),_0x1b076a);try{fs['chmodSync'](_0x5e0a7b,parseInt(_0x81e7('0x5e'),0x8));var _0x3ccf24=sox[_0x81e7('0x5f')](_0x5e0a7b,_0x1b076a,{'sampleRate':0x1f40,'format':_0x81e7('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ccf24['on'](_0x81e7('0x61'),function(_0x102fb5){fs['unlinkSync'](_0x5e0a7b);_0x2b1b24[_0x81e7('0x1b')](0x1f4)['send'](_0x102fb5);});_0x3ccf24['on'](_0x81e7('0x62'),function(_0x154b66){_0x21c039[_0x81e7('0x63')]=isNaN(_0x154b66[_0x81e7('0x64')])?null:_0x154b66[_0x81e7('0x64')]*0x3e8;_0x21c039[_0x81e7('0x65')]=isNaN(_0x154b66[_0x81e7('0x66')])?null:_0x154b66[_0x81e7('0x66')];_0x21c039[_0x81e7('0x67')]=isNaN(_0x154b66[_0x81e7('0x68')])?null:_0x154b66[_0x81e7('0x68')];_0x21c039[_0x81e7('0x69')]=isNaN(_0x154b66[_0x81e7('0x6a')])?null:_0x154b66[_0x81e7('0x6a')];_0x21c039[_0x81e7('0x6b')]=isNaN(_0x154b66[_0x81e7('0x6c')])?null:_0x154b66[_0x81e7('0x6c')];});_0x3ccf24['on'](_0x81e7('0x6d'),function(_0x46504c){_0x21c039['converted_duration']=isNaN(_0x46504c[_0x81e7('0x64')])?null:_0x46504c[_0x81e7('0x64')]*0x3e8;_0x21c039[_0x81e7('0x6e')]=isNaN(_0x46504c[_0x81e7('0x66')])?null:_0x46504c[_0x81e7('0x66')];_0x21c039['converted_channelCount']=isNaN(_0x46504c[_0x81e7('0x68')])?null:_0x46504c[_0x81e7('0x68')];_0x21c039[_0x81e7('0x6f')]=isNaN(_0x46504c[_0x81e7('0x6a')])?null:_0x46504c[_0x81e7('0x6a')];_0x21c039['converted_sampleRate']=isNaN(_0x46504c[_0x81e7('0x6c')])?null:_0x46504c['sampleRate'];});_0x3ccf24['on'](_0x81e7('0x1c'),function(){fs[_0x81e7('0x70')](_0x1b076a,parseInt(_0x81e7('0x5e'),0x8));return db[_0x81e7('0x2d')]['create'](_0x21c039)['then'](function(_0x405ee9){var _0x5dfff3={'role':_0x2ee359[_0x81e7('0x71')][_0x81e7('0x72')],'userProfileId':_0x2ee359[_0x81e7('0x71')][_0x81e7('0x73')]};if(!_0x5dfff3)throw new Error(_0x81e7('0x74'));if(_0x5dfff3['role']==='user'){var _0x74f94d=_0x405ee9['get']({'plain':!![]});return db[_0x81e7('0x75')][_0x81e7('0x47')]({'where':{'name':'Sounds','userProfileId':_0x5dfff3['userProfileId']},'raw':!![]})['then'](function(_0x55b731){if(_0x55b731&&_0x55b731[_0x81e7('0x76')]===0x0){return db[_0x81e7('0x2a')]['create']({'name':_0x74f94d['name'],'resourceId':_0x74f94d['id'],'type':_0x55b731['name'],'sectionId':_0x55b731['id']},{})['then'](function(){return _0x405ee9;});}else{return _0x405ee9;}})[_0x81e7('0x45')](function(_0xfec30){logger[_0x81e7('0x61')](_0x81e7('0x77'),_0xfec30);throw _0xfec30;});}return _0x405ee9;})[_0x81e7('0x27')](respondWithResult(_0x2b1b24,null))[_0x81e7('0x45')](handleError(_0x2b1b24,null));});_0x3ccf24[_0x81e7('0x78')]();}catch(_0x36c9c3){_0x2b1b24['status'](0x1f4)[_0x81e7('0x2b')](_0x36c9c3);}};exports[_0x81e7('0x79')]=function(_0x29db84,_0x123c07,_0x48acbe){return db['Sound'][_0x81e7('0x47')]({'where':{'id':_0x29db84[_0x81e7('0x48')]['id']}})[_0x81e7('0x27')](handleEntityNotFound(_0x123c07,null))[_0x81e7('0x27')](saveUpdates(_[_0x81e7('0x3d')](_0x29db84[_0x81e7('0x71')],['name','description']),null))[_0x81e7('0x27')](respondWithResult(_0x123c07,null))['catch'](handleError(_0x123c07,null));};exports['delete']=function(_0x3a80f1,_0x582a58,_0x31555c){return db[_0x81e7('0x2d')][_0x81e7('0x47')]({'where':{'id':_0x3a80f1[_0x81e7('0x48')]['id']}})[_0x81e7('0x27')](function(_0x235fad){if(_0x235fad){return _0x235fad[_0x81e7('0x28')]();}})[_0x81e7('0x27')](function(_0x851583){var _0x36d464=path['join'](config[_0x81e7('0x59')],_0x81e7('0x5a'),util[_0x81e7('0x50')]('%s.%s',_0x851583['save_name'],_0x851583[_0x81e7('0x7a')]));var _0x53b1fc=path[_0x81e7('0x4f')](config[_0x81e7('0x59')],'server/files/sounds/converted',util['format']('%s.%s',_0x851583[_0x81e7('0x49')],_0x851583[_0x81e7('0x4c')]));fs['unlinkSync'](_0x36d464);fs[_0x81e7('0x7b')](_0x53b1fc);return _0x851583;})[_0x81e7('0x27')](function(_0x3801c1){if(_0x3801c1){return _0x582a58[_0x81e7('0x1b')](0xcc)[_0x81e7('0x1c')]();}})[_0x81e7('0x27')](handleEntityNotFound(_0x582a58,null))['catch'](handleError(_0x582a58,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e4d1e81..1a12291 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 _0x7de3=['bluebird','../../config/environment','./sound.attributes','exports','tools_sounds','lodash','../../config/logger','api'];(function(_0x45bd84,_0x4a61bb){var _0x551b62=function(_0x3b03cf){while(--_0x3b03cf){_0x45bd84['push'](_0x45bd84['shift']());}};_0x551b62(++_0x4a61bb);}(_0x7de3,0x175));var _0x37de=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x7de3[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x37de('0x0'));var util=require('util');var logger=require(_0x37de('0x1'))(_0x37de('0x2'));var moment=require('moment');var BPromise=require(_0x37de('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x37de('0x4'));var attributes=require(_0x37de('0x5'));module[_0x37de('0x6')]=function(_0x89ceec,_0x1a245d){return _0x89ceec['define']('Sound',attributes,{'tableName':_0x37de('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cec=['../../config/environment','exports','Sound','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x401f2e,_0x119d0d){var _0x4ef876=function(_0x5bb365){while(--_0x5bb365){_0x401f2e['push'](_0x401f2e['shift']());}};_0x4ef876(++_0x119d0d);}(_0x6cec,0x123));var _0xc6ce=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6cec[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xc6ce('0x0'));var util=require('util');var logger=require(_0xc6ce('0x1'))(_0xc6ce('0x2'));var moment=require('moment');var BPromise=require(_0xc6ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ce('0x4'));var rimraf=require(_0xc6ce('0x5'));var config=require(_0xc6ce('0x6'));var attributes=require('./sound.attributes');module[_0xc6ce('0x7')]=function(_0x2840de,_0x469302){return _0x2840de['define'](_0xc6ce('0x8'),attributes,{'tableName':'tools_sounds','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 7100c65..9ad1391 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 _0x62ab=['model','then','ShowSound','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','error','message','Sound,\x20%s,\x20%s','result','catch','find','raw','options','where','attributes','include','map'];(function(_0x551251,_0x23f83b){var _0x4efc13=function(_0x5be356){while(--_0x5be356){_0x551251['push'](_0x551251['shift']());}};_0x4efc13(++_0x23f83b);}(_0x62ab,0x131));var _0xb62a=function(_0x13fb5a,_0x20d2be){_0x13fb5a=_0x13fb5a-0x0;var _0x556dd1=_0x62ab[_0x13fb5a];return _0x556dd1;};'use strict';var _=require(_0xb62a('0x0'));var util=require(_0xb62a('0x1'));var moment=require(_0xb62a('0x2'));var BPromise=require(_0xb62a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb62a('0x4'));var db=require(_0xb62a('0x5'))['db'];var utils=require(_0xb62a('0x6'));var logger=require(_0xb62a('0x7'))(_0xb62a('0x8'));var config=require(_0xb62a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb62a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e266c,_0x3e32b2,_0x5cb86c){return new BPromise(function(_0x4f76f7,_0x2aff0){return client['request'](_0x2e266c,_0x5cb86c)['then'](function(_0x5b1976){logger[_0xb62a('0xb')]('Sound,\x20%s,\x20%s',_0x3e32b2,_0xb62a('0xc'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x3e32b2,'request\x20sent',JSON['stringify'](_0x5b1976));if(_0x5b1976[_0xb62a('0xd')]){if(_0x5b1976[_0xb62a('0xd')]['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x3e32b2,_0x5b1976[_0xb62a('0xd')][_0xb62a('0xe')]);return _0x2aff0(_0x5b1976[_0xb62a('0xd')][_0xb62a('0xe')]);}logger['error']('Sound,\x20%s,\x20%s',_0x3e32b2,_0x5b1976[_0xb62a('0xd')][_0xb62a('0xe')]);return _0x4f76f7(_0x5b1976['error'][_0xb62a('0xe')]);}else{logger[_0xb62a('0xb')](_0xb62a('0xf'),_0x3e32b2,_0xb62a('0xc'));_0x4f76f7(_0x5b1976[_0xb62a('0x10')][_0xb62a('0xe')]);}})[_0xb62a('0x11')](function(_0x20bf7d){logger[_0xb62a('0xd')](_0xb62a('0xf'),_0x3e32b2,_0x20bf7d);_0x2aff0(_0x20bf7d);});});}exports['ShowSound']=function(_0xd38bfa){var _0x1bda6d=this;return new Promise(function(_0x10054d,_0x5c2019){return db['Sound'][_0xb62a('0x12')]({'raw':_0xd38bfa['options']?_0xd38bfa['options'][_0xb62a('0x13')]===undefined?!![]:![]:!![],'where':_0xd38bfa[_0xb62a('0x14')]?_0xd38bfa[_0xb62a('0x14')][_0xb62a('0x15')]||null:null,'attributes':_0xd38bfa['options']?_0xd38bfa[_0xb62a('0x14')][_0xb62a('0x16')]||null:null,'include':_0xd38bfa[_0xb62a('0x14')]?_0xd38bfa[_0xb62a('0x14')][_0xb62a('0x17')]?_[_0xb62a('0x18')](_0xd38bfa[_0xb62a('0x14')][_0xb62a('0x17')],function(_0x27402b){return{'model':db[_0x27402b['model']],'as':_0x27402b['as'],'attributes':_0x27402b[_0xb62a('0x16')],'include':_0x27402b[_0xb62a('0x17')]?_[_0xb62a('0x18')](_0x27402b[_0xb62a('0x17')],function(_0x383e9b){return{'model':db[_0x383e9b[_0xb62a('0x19')]],'as':_0x383e9b['as'],'attributes':_0x383e9b[_0xb62a('0x16')],'include':_0x383e9b[_0xb62a('0x17')]?_[_0xb62a('0x18')](_0x383e9b['include'],function(_0x49bfc2){return{'model':db[_0x49bfc2[_0xb62a('0x19')]],'as':_0x49bfc2['as'],'attributes':_0x49bfc2['attributes']};}):[]};}):[]};}):[]:[]})[_0xb62a('0x1a')](function(_0x4ea054){logger[_0xb62a('0xb')](_0xb62a('0x1b'),_0xd38bfa);logger[_0xb62a('0x1c')]('ShowSound',_0xd38bfa,JSON[_0xb62a('0x1d')](_0x4ea054));_0x10054d(_0x4ea054);})[_0xb62a('0x11')](function(_0x28c2af){logger[_0xb62a('0xd')](_0xb62a('0x1b'),_0x28c2af['message'],_0xd38bfa);_0x5c2019(_0x1bda6d['error'](0x1f4,_0x28c2af['message']));});});}; \ No newline at end of file +var _0x35f0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSound','Sound','options','raw','attributes','include','map','model','stringify','lodash'];(function(_0xf7bfa4,_0x504c7a){var _0x12c7f1=function(_0x4d4100){while(--_0x4d4100){_0xf7bfa4['push'](_0xf7bfa4['shift']());}};_0x12c7f1(++_0x504c7a);}(_0x35f0,0x1ec));var _0x035f=function(_0x109da9,_0x4f10de){_0x109da9=_0x109da9-0x0;var _0x1dcd2f=_0x35f0[_0x109da9];return _0x1dcd2f;};'use strict';var _=require(_0x035f('0x0'));var util=require(_0x035f('0x1'));var moment=require('moment');var BPromise=require(_0x035f('0x2'));var rs=require(_0x035f('0x3'));var fs=require('fs');var Redis=require(_0x035f('0x4'));var db=require(_0x035f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x035f('0x6'))('rpc');var config=require(_0x035f('0x7'));var jayson=require(_0x035f('0x8'));var client=jayson[_0x035f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3be4f8,_0x249263,_0x530346){return new BPromise(function(_0x45d3e6,_0x948c7a){return client['request'](_0x3be4f8,_0x530346)[_0x035f('0xa')](function(_0x98b337){logger[_0x035f('0xb')](_0x035f('0xc'),_0x249263,_0x035f('0xd'));logger[_0x035f('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x249263,_0x035f('0xd'),JSON['stringify'](_0x98b337));if(_0x98b337[_0x035f('0xf')]){if(_0x98b337[_0x035f('0xf')][_0x035f('0x10')]===0x1f4){logger['error'](_0x035f('0xc'),_0x249263,_0x98b337['error'][_0x035f('0x11')]);return _0x948c7a(_0x98b337['error'][_0x035f('0x11')]);}logger[_0x035f('0xf')](_0x035f('0xc'),_0x249263,_0x98b337[_0x035f('0xf')]['message']);return _0x45d3e6(_0x98b337[_0x035f('0xf')][_0x035f('0x11')]);}else{logger['info'](_0x035f('0xc'),_0x249263,_0x035f('0xd'));_0x45d3e6(_0x98b337[_0x035f('0x12')][_0x035f('0x11')]);}})[_0x035f('0x13')](function(_0x4027d5){logger[_0x035f('0xf')](_0x035f('0xc'),_0x249263,_0x4027d5);_0x948c7a(_0x4027d5);});});}exports[_0x035f('0x14')]=function(_0x342a52){var _0x15e57e=this;return new Promise(function(_0x3c8a01,_0x21288b){return db[_0x035f('0x15')]['find']({'raw':_0x342a52['options']?_0x342a52[_0x035f('0x16')][_0x035f('0x17')]===undefined?!![]:![]:!![],'where':_0x342a52[_0x035f('0x16')]?_0x342a52['options']['where']||null:null,'attributes':_0x342a52[_0x035f('0x16')]?_0x342a52[_0x035f('0x16')][_0x035f('0x18')]||null:null,'include':_0x342a52[_0x035f('0x16')]?_0x342a52[_0x035f('0x16')][_0x035f('0x19')]?_[_0x035f('0x1a')](_0x342a52[_0x035f('0x16')][_0x035f('0x19')],function(_0x14a098){return{'model':db[_0x14a098[_0x035f('0x1b')]],'as':_0x14a098['as'],'attributes':_0x14a098[_0x035f('0x18')],'include':_0x14a098[_0x035f('0x19')]?_[_0x035f('0x1a')](_0x14a098[_0x035f('0x19')],function(_0x25846e){return{'model':db[_0x25846e['model']],'as':_0x25846e['as'],'attributes':_0x25846e[_0x035f('0x18')],'include':_0x25846e[_0x035f('0x19')]?_['map'](_0x25846e[_0x035f('0x19')],function(_0x4cba55){return{'model':db[_0x4cba55['model']],'as':_0x4cba55['as'],'attributes':_0x4cba55[_0x035f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x035f('0xa')](function(_0x285a22){logger[_0x035f('0xb')](_0x035f('0x14'),_0x342a52);logger['debug'](_0x035f('0x14'),_0x342a52,JSON[_0x035f('0x1c')](_0x285a22));_0x3c8a01(_0x285a22);})[_0x035f('0x13')](function(_0x30f963){logger['error'](_0x035f('0x14'),_0x30f963['message'],_0x342a52);_0x21288b(_0x15e57e['error'](0x1f4,_0x30f963['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f235551..0f97944 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x157c01,_0x3aadbb){var _0x4f2ed2=function(_0x329958){while(--_0x329958){_0x157c01['push'](_0x157c01['shift']());}};_0x4f2ed2(++_0x3aadbb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('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(_0x308375,_0x3a93cc){var _0x18d40c=function(_0x21bbbf){while(--_0x21bbbf){_0x308375['push'](_0x308375['shift']());}};_0x18d40c(++_0x3a93cc);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x0b0e[_0xc82d1a];return _0x32fad2;};'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 d1f06ac..677fdf2 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 _0xd2c5=['ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x5e0cb2,_0x4dccc1){var _0x47301a=function(_0x2008e4){while(--_0x2008e4){_0x5e0cb2['push'](_0x5e0cb2['shift']());}};_0x47301a(++_0x4dccc1);}(_0xd2c5,0x195));var _0x5d2c=function(_0xf32b39,_0x5ac2c8){_0xf32b39=_0xf32b39-0x0;var _0x27ca48=_0xd2c5[_0xf32b39];return _0x27ca48;};'use strict';var Sequelize=require(_0x5d2c('0x0'));module[_0x5d2c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x5d2c('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x5d2c('0x3')]('in',_0x5d2c('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x5d2c('0x5')]},'providerResponse':{'type':Sequelize[_0x5d2c('0x2')]}}; \ No newline at end of file +var _0x26e9=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x319677,_0x2ca70f){var _0x589198=function(_0x2c127f){while(--_0x2c127f){_0x319677['push'](_0x319677['shift']());}};_0x589198(++_0x2ca70f);}(_0x26e9,0x10d));var _0x926e=function(_0x52f975,_0x305404){_0x52f975=_0x52f975-0x0;var _0x1b15a3=_0x26e9[_0x52f975];return _0x1b15a3;};'use strict';var Sequelize=require(_0x926e('0x0'));module[_0x926e('0x1')]={'uniqueid':{'type':Sequelize[_0x926e('0x2')]},'body':{'type':Sequelize[_0x926e('0x3')](_0x926e('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x926e('0x5')),'defaultValue':_0x926e('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x926e('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 5ef8389..46cab23 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 _0x671e=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','end','error','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash'];(function(_0x275e20,_0x74110d){var _0x41e939=function(_0x3243d1){while(--_0x3243d1){_0x275e20['push'](_0x275e20['shift']());}};_0x41e939(++_0x74110d);}(_0x671e,0xd6));var _0xe671=function(_0x5bdd96,_0x178a4f){_0x5bdd96=_0x5bdd96-0x0;var _0x31625b=_0x671e[_0x5bdd96];return _0x31625b;};'use strict';var emlformat=require(_0xe671('0x0'));var rimraf=require(_0xe671('0x1'));var zipdir=require(_0xe671('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe671('0x3'));var moment=require(_0xe671('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe671('0x5'));var util=require(_0xe671('0x6'));var path=require(_0xe671('0x7'));var sox=require('sox');var csv=require(_0xe671('0x8'));var ejs=require(_0xe671('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe671('0xa'));var squel=require(_0xe671('0xb'));var crypto=require(_0xe671('0xc'));var jsforce=require(_0xe671('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe671('0x8'));var querystring=require(_0xe671('0xe'));var Papa=require(_0xe671('0xf'));var Redis=require(_0xe671('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe671('0x11'));var hardwareService=require(_0xe671('0x12'));var logger=require(_0xe671('0x13'))('api');var utils=require(_0xe671('0x14'));var config=require(_0xe671('0x15'));var licenseUtil=require(_0xe671('0x16'));var db=require(_0xe671('0x17'))['db'];function respondWithStatusCode(_0x57767b,_0x3a051e){_0x3a051e=_0x3a051e||0xcc;return function(_0x4f8054){if(_0x4f8054){return _0x57767b[_0xe671('0x18')](_0x3a051e);}return _0x57767b['status'](_0x3a051e)['end']();};}function respondWithResult(_0x5222a7,_0x59688e){_0x59688e=_0x59688e||0xc8;return function(_0xcf6e92){if(_0xcf6e92){return _0x5222a7[_0xe671('0x19')](_0x59688e)[_0xe671('0x1a')](_0xcf6e92);}};}function respondWithFilteredResult(_0x2d427f,_0x53ceee){return function(_0x19d49c){if(_0x19d49c){var _0x6aea49=typeof _0x53ceee[_0xe671('0x1b')]===_0xe671('0x1c')&&typeof _0x53ceee[_0xe671('0x1d')]==='undefined';var _0x135e68=_0x19d49c[_0xe671('0x1e')];var _0x3ef34b=_0x6aea49?0x0:_0x53ceee[_0xe671('0x1b')];var _0xf28a70=_0x6aea49?_0x19d49c[_0xe671('0x1e')]:_0x53ceee[_0xe671('0x1b')]+_0x53ceee[_0xe671('0x1d')];var _0x4a24bf;if(_0xf28a70>=_0x135e68){_0xf28a70=_0x135e68;_0x4a24bf=0xc8;}else{_0x4a24bf=0xce;}_0x2d427f[_0xe671('0x19')](_0x4a24bf);return _0x2d427f[_0xe671('0x1f')](_0xe671('0x20'),_0x3ef34b+'-'+_0xf28a70+'/'+_0x135e68)[_0xe671('0x1a')](_0x19d49c);}return null;};}function patchUpdates(_0x565623){return function(_0x1f6521){try{jsonpatch['apply'](_0x1f6521,_0x565623,!![]);}catch(_0x1acc81){return BPromise[_0xe671('0x21')](_0x1acc81);}return _0x1f6521['save']();};}function saveUpdates(_0x50bc70,_0x2e9d94){return function(_0x23f1db){if(_0x23f1db){return _0x23f1db['update'](_0x50bc70)['then'](function(_0x3c796b){return _0x3c796b;});}return null;};}function removeEntity(_0x5ed70f,_0x1479e9){return function(_0x511ff5){if(_0x511ff5){return _0x511ff5[_0xe671('0x22')]()[_0xe671('0x23')](function(){_0x5ed70f['status'](0xcc)[_0xe671('0x24')]();});}};}function handleEntityNotFound(_0x15e433,_0x10e0ac){return function(_0x5bfaf8){if(!_0x5bfaf8){_0x15e433[_0xe671('0x18')](0x194);}return _0x5bfaf8;};}function handleError(_0x432d3d,_0x1afa1e){_0x1afa1e=_0x1afa1e||0x1f4;return function(_0x529266){logger[_0xe671('0x25')](_0x529266[_0xe671('0x26')]);if(_0x529266[_0xe671('0x27')]){delete _0x529266['name'];}_0x432d3d[_0xe671('0x19')](_0x1afa1e)[_0xe671('0x28')](_0x529266);};}exports[_0xe671('0x29')]=function(_0x385f4f,_0x53dc22){var _0x1a20aa={},_0x1ba7bb={},_0x3b9f9e={'count':0x0,'rows':[]};var _0x4b06ad=_[_0xe671('0x2a')](db[_0xe671('0x2b')]['rawAttributes'],function(_0x1087ec){return{'name':_0x1087ec[_0xe671('0x2c')],'type':_0x1087ec[_0xe671('0x2d')][_0xe671('0x2e')]};});_0x1ba7bb[_0xe671('0x2f')]=_[_0xe671('0x2a')](_0x4b06ad,_0xe671('0x27'));_0x1ba7bb['query']=_[_0xe671('0x30')](_0x385f4f['query']);_0x1ba7bb[_0xe671('0x31')]=_[_0xe671('0x32')](_0x1ba7bb[_0xe671('0x2f')],_0x1ba7bb['query']);_0x1a20aa[_0xe671('0x33')]=_[_0xe671('0x32')](_0x1ba7bb['model'],qs['fields'](_0x385f4f['query'][_0xe671('0x34')]));_0x1a20aa['attributes']=_0x1a20aa[_0xe671('0x33')][_0xe671('0x35')]?_0x1a20aa['attributes']:_0x1ba7bb['model'];if(!_0x385f4f[_0xe671('0x36')][_0xe671('0x37')](_0xe671('0x38'))){_0x1a20aa[_0xe671('0x1d')]=qs['limit'](_0x385f4f[_0xe671('0x36')][_0xe671('0x1d')]);_0x1a20aa[_0xe671('0x1b')]=qs[_0xe671('0x1b')](_0x385f4f['query']['offset']);}_0x1a20aa[_0xe671('0x39')]=qs[_0xe671('0x3a')](_0x385f4f[_0xe671('0x36')][_0xe671('0x3a')]);_0x1a20aa[_0xe671('0x3b')]=qs[_0xe671('0x31')](_[_0xe671('0x3c')](_0x385f4f[_0xe671('0x36')],_0x1ba7bb[_0xe671('0x31')]),_0x4b06ad);if(_0x385f4f[_0xe671('0x36')]['filter']){_0x1a20aa[_0xe671('0x3b')]=_[_0xe671('0x3d')](_0x1a20aa[_0xe671('0x3b')],{'$or':_['map'](_0x4b06ad,function(_0x2702c2){if(_0x2702c2[_0xe671('0x2d')]!==_0xe671('0x3e')){var _0x538e4a={};_0x538e4a[_0x2702c2['name']]={'$like':'%'+_0x385f4f['query']['filter']+'%'};return _0x538e4a;}})});}_0x1a20aa=_[_0xe671('0x3d')]({},_0x1a20aa,_0x385f4f['options']);var _0x12b4bc={'where':_0x1a20aa[_0xe671('0x3b')]};return db[_0xe671('0x2b')][_0xe671('0x1e')](_0x12b4bc)[_0xe671('0x23')](function(_0x59189a){_0x3b9f9e[_0xe671('0x1e')]=_0x59189a;if(_0x385f4f[_0xe671('0x36')][_0xe671('0x3f')]){_0x1a20aa[_0xe671('0x40')]=[{'all':!![]}];}return db[_0xe671('0x2b')][_0xe671('0x41')](_0x1a20aa);})[_0xe671('0x23')](function(_0xc0e8ce){_0x3b9f9e[_0xe671('0x42')]=_0xc0e8ce;return _0x3b9f9e;})[_0xe671('0x23')](respondWithFilteredResult(_0x53dc22,_0x1a20aa))['catch'](handleError(_0x53dc22,null));};exports[_0xe671('0x43')]=function(_0x5d2dcf,_0x3b0e06){var _0x2767d7={'raw':!![],'where':{'id':_0x5d2dcf['params']['id']}},_0x4e99bc={};_0x4e99bc[_0xe671('0x2f')]=_[_0xe671('0x30')](db[_0xe671('0x2b')][_0xe671('0x44')]);_0x4e99bc[_0xe671('0x36')]=_[_0xe671('0x30')](_0x5d2dcf[_0xe671('0x36')]);_0x4e99bc['filters']=_[_0xe671('0x32')](_0x4e99bc[_0xe671('0x2f')],_0x4e99bc[_0xe671('0x36')]);_0x2767d7['attributes']=_['intersection'](_0x4e99bc[_0xe671('0x2f')],qs[_0xe671('0x34')](_0x5d2dcf['query'][_0xe671('0x34')]));_0x2767d7['attributes']=_0x2767d7[_0xe671('0x33')][_0xe671('0x35')]?_0x2767d7[_0xe671('0x33')]:_0x4e99bc[_0xe671('0x2f')];if(_0x5d2dcf['query'][_0xe671('0x3f')]){_0x2767d7[_0xe671('0x40')]=[{'all':!![]}];}_0x2767d7=_['merge']({},_0x2767d7,_0x5d2dcf['options']);return db['SquareMessage'][_0xe671('0x45')](_0x2767d7)[_0xe671('0x23')](handleEntityNotFound(_0x3b0e06,null))['then'](respondWithResult(_0x3b0e06,null))[_0xe671('0x46')](handleError(_0x3b0e06,null));};exports[_0xe671('0x47')]=function(_0x3a7f89,_0x564374){return db[_0xe671('0x2b')]['create'](_0x3a7f89[_0xe671('0x48')],{})['then'](respondWithResult(_0x564374,0xc9))[_0xe671('0x46')](handleError(_0x564374,null));};exports[_0xe671('0x49')]=function(_0x470996,_0x525888){if(_0x470996['body']['id']){delete _0x470996[_0xe671('0x48')]['id'];}return db[_0xe671('0x2b')][_0xe671('0x45')]({'where':{'id':_0x470996[_0xe671('0x4a')]['id']}})[_0xe671('0x23')](handleEntityNotFound(_0x525888,null))[_0xe671('0x23')](saveUpdates(_0x470996[_0xe671('0x48')],null))[_0xe671('0x23')](respondWithResult(_0x525888,null))['catch'](handleError(_0x525888,null));};exports[_0xe671('0x22')]=function(_0x2cfbfd,_0x17dfd8){return db[_0xe671('0x2b')]['find']({'where':{'id':_0x2cfbfd['params']['id']}})[_0xe671('0x23')](handleEntityNotFound(_0x17dfd8,null))[_0xe671('0x23')](removeEntity(_0x17dfd8,null))['catch'](handleError(_0x17dfd8,null));}; \ No newline at end of file +var _0x9845=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x2592fc,_0x4f0c82){var _0x3fb81d=function(_0x8c50c3){while(--_0x8c50c3){_0x2592fc['push'](_0x2592fc['shift']());}};_0x3fb81d(++_0x4f0c82);}(_0x9845,0x1e2));var _0x5984=function(_0x2afb08,_0x324211){_0x2afb08=_0x2afb08-0x0;var _0x38cc5a=_0x9845[_0x2afb08];return _0x38cc5a;};'use strict';var emlformat=require(_0x5984('0x0'));var rimraf=require(_0x5984('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5984('0x2'));var rp=require(_0x5984('0x3'));var moment=require(_0x5984('0x4'));var BPromise=require(_0x5984('0x5'));var Mustache=require(_0x5984('0x6'));var util=require('util');var path=require(_0x5984('0x7'));var sox=require(_0x5984('0x8'));var csv=require(_0x5984('0x9'));var ejs=require(_0x5984('0xa'));var fs=require('fs');var fs_extra=require(_0x5984('0xb'));var _=require('lodash');var squel=require(_0x5984('0xc'));var crypto=require(_0x5984('0xd'));var jsforce=require(_0x5984('0xe'));var deskjs=require(_0x5984('0xf'));var toCsv=require(_0x5984('0x9'));var querystring=require('querystring');var Papa=require(_0x5984('0x10'));var Redis=require(_0x5984('0x11'));var authService=require(_0x5984('0x12'));var qs=require(_0x5984('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5984('0x14'));var logger=require(_0x5984('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5984('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5984('0x17'))['db'];function respondWithStatusCode(_0x1487a3,_0x20e728){_0x20e728=_0x20e728||0xcc;return function(_0x5218e4){if(_0x5218e4){return _0x1487a3[_0x5984('0x18')](_0x20e728);}return _0x1487a3['status'](_0x20e728)[_0x5984('0x19')]();};}function respondWithResult(_0x173e56,_0x25aa3f){_0x25aa3f=_0x25aa3f||0xc8;return function(_0x4e6faa){if(_0x4e6faa){return _0x173e56['status'](_0x25aa3f)[_0x5984('0x1a')](_0x4e6faa);}};}function respondWithFilteredResult(_0x5d85a7,_0x3894f2){return function(_0x37036b){if(_0x37036b){var _0x198aef=typeof _0x3894f2['offset']===_0x5984('0x1b')&&typeof _0x3894f2['limit']===_0x5984('0x1b');var _0x328885=_0x37036b[_0x5984('0x1c')];var _0x5715f5=_0x198aef?0x0:_0x3894f2[_0x5984('0x1d')];var _0x4c0cdf=_0x198aef?_0x37036b[_0x5984('0x1c')]:_0x3894f2[_0x5984('0x1d')]+_0x3894f2[_0x5984('0x1e')];var _0x5d52f3;if(_0x4c0cdf>=_0x328885){_0x4c0cdf=_0x328885;_0x5d52f3=0xc8;}else{_0x5d52f3=0xce;}_0x5d85a7[_0x5984('0x1f')](_0x5d52f3);return _0x5d85a7['set'](_0x5984('0x20'),_0x5715f5+'-'+_0x4c0cdf+'/'+_0x328885)['json'](_0x37036b);}return null;};}function patchUpdates(_0x484110){return function(_0xcbf8e4){try{jsonpatch[_0x5984('0x21')](_0xcbf8e4,_0x484110,!![]);}catch(_0x4e8f3a){return BPromise['reject'](_0x4e8f3a);}return _0xcbf8e4[_0x5984('0x22')]();};}function saveUpdates(_0x13d8c0,_0x3712b9){return function(_0x12b66c){if(_0x12b66c){return _0x12b66c[_0x5984('0x23')](_0x13d8c0)[_0x5984('0x24')](function(_0x47ea79){return _0x47ea79;});}return null;};}function removeEntity(_0xfb2b58,_0x51c4ab){return function(_0x160396){if(_0x160396){return _0x160396[_0x5984('0x25')]()[_0x5984('0x24')](function(){_0xfb2b58[_0x5984('0x1f')](0xcc)[_0x5984('0x19')]();});}};}function handleEntityNotFound(_0x59247c,_0x24be01){return function(_0x192805){if(!_0x192805){_0x59247c[_0x5984('0x18')](0x194);}return _0x192805;};}function handleError(_0x271a2a,_0x196384){_0x196384=_0x196384||0x1f4;return function(_0x951f0b){logger[_0x5984('0x26')](_0x951f0b[_0x5984('0x27')]);if(_0x951f0b['name']){delete _0x951f0b[_0x5984('0x28')];}_0x271a2a[_0x5984('0x1f')](_0x196384)['send'](_0x951f0b);};}exports[_0x5984('0x29')]=function(_0x1327da,_0x51a2f2){var _0x20dcfe={},_0x4d4c68={},_0x3a3004={'count':0x0,'rows':[]};var _0x103724=_[_0x5984('0x2a')](db[_0x5984('0x2b')][_0x5984('0x2c')],function(_0x986fe9){return{'name':_0x986fe9[_0x5984('0x2d')],'type':_0x986fe9['type']['key']};});_0x4d4c68[_0x5984('0x2e')]=_['map'](_0x103724,'name');_0x4d4c68[_0x5984('0x2f')]=_['keys'](_0x1327da[_0x5984('0x2f')]);_0x4d4c68[_0x5984('0x30')]=_['intersection'](_0x4d4c68[_0x5984('0x2e')],_0x4d4c68[_0x5984('0x2f')]);_0x20dcfe['attributes']=_[_0x5984('0x31')](_0x4d4c68[_0x5984('0x2e')],qs[_0x5984('0x32')](_0x1327da[_0x5984('0x2f')][_0x5984('0x32')]));_0x20dcfe[_0x5984('0x33')]=_0x20dcfe[_0x5984('0x33')][_0x5984('0x34')]?_0x20dcfe[_0x5984('0x33')]:_0x4d4c68['model'];if(!_0x1327da['query'][_0x5984('0x35')]('nolimit')){_0x20dcfe[_0x5984('0x1e')]=qs['limit'](_0x1327da[_0x5984('0x2f')][_0x5984('0x1e')]);_0x20dcfe[_0x5984('0x1d')]=qs[_0x5984('0x1d')](_0x1327da[_0x5984('0x2f')][_0x5984('0x1d')]);}_0x20dcfe['order']=qs[_0x5984('0x36')](_0x1327da[_0x5984('0x2f')][_0x5984('0x36')]);_0x20dcfe[_0x5984('0x37')]=qs[_0x5984('0x30')](_['pick'](_0x1327da[_0x5984('0x2f')],_0x4d4c68['filters']),_0x103724);if(_0x1327da[_0x5984('0x2f')][_0x5984('0x38')]){_0x20dcfe[_0x5984('0x37')]=_[_0x5984('0x39')](_0x20dcfe['where'],{'$or':_[_0x5984('0x2a')](_0x103724,function(_0x33b2a6){if(_0x33b2a6['type']!==_0x5984('0x3a')){var _0x3d9245={};_0x3d9245[_0x33b2a6[_0x5984('0x28')]]={'$like':'%'+_0x1327da['query'][_0x5984('0x38')]+'%'};return _0x3d9245;}})});}_0x20dcfe=_[_0x5984('0x39')]({},_0x20dcfe,_0x1327da[_0x5984('0x3b')]);var _0x115ebc={'where':_0x20dcfe[_0x5984('0x37')]};return db[_0x5984('0x2b')][_0x5984('0x1c')](_0x115ebc)[_0x5984('0x24')](function(_0x43c532){_0x3a3004['count']=_0x43c532;if(_0x1327da[_0x5984('0x2f')][_0x5984('0x3c')]){_0x20dcfe['include']=[{'all':!![]}];}return db[_0x5984('0x2b')][_0x5984('0x3d')](_0x20dcfe);})[_0x5984('0x24')](function(_0xe5cf31){_0x3a3004[_0x5984('0x3e')]=_0xe5cf31;return _0x3a3004;})['then'](respondWithFilteredResult(_0x51a2f2,_0x20dcfe))[_0x5984('0x3f')](handleError(_0x51a2f2,null));};exports[_0x5984('0x40')]=function(_0x4b89f1,_0xdd5e69){var _0x293a14={'raw':!![],'where':{'id':_0x4b89f1[_0x5984('0x41')]['id']}},_0x5202ea={};_0x5202ea[_0x5984('0x2e')]=_[_0x5984('0x42')](db['SquareMessage'][_0x5984('0x2c')]);_0x5202ea[_0x5984('0x2f')]=_[_0x5984('0x42')](_0x4b89f1[_0x5984('0x2f')]);_0x5202ea[_0x5984('0x30')]=_['intersection'](_0x5202ea[_0x5984('0x2e')],_0x5202ea['query']);_0x293a14[_0x5984('0x33')]=_[_0x5984('0x31')](_0x5202ea[_0x5984('0x2e')],qs[_0x5984('0x32')](_0x4b89f1[_0x5984('0x2f')][_0x5984('0x32')]));_0x293a14['attributes']=_0x293a14[_0x5984('0x33')][_0x5984('0x34')]?_0x293a14[_0x5984('0x33')]:_0x5202ea[_0x5984('0x2e')];if(_0x4b89f1['query']['includeAll']){_0x293a14[_0x5984('0x43')]=[{'all':!![]}];}_0x293a14=_[_0x5984('0x39')]({},_0x293a14,_0x4b89f1[_0x5984('0x3b')]);return db[_0x5984('0x2b')]['find'](_0x293a14)[_0x5984('0x24')](handleEntityNotFound(_0xdd5e69,null))[_0x5984('0x24')](respondWithResult(_0xdd5e69,null))[_0x5984('0x3f')](handleError(_0xdd5e69,null));};exports['create']=function(_0x2e8a14,_0x5b1631){return db['SquareMessage'][_0x5984('0x44')](_0x2e8a14[_0x5984('0x45')],{})[_0x5984('0x24')](respondWithResult(_0x5b1631,0xc9))[_0x5984('0x3f')](handleError(_0x5b1631,null));};exports[_0x5984('0x23')]=function(_0x4a6ff8,_0x391073){if(_0x4a6ff8[_0x5984('0x45')]['id']){delete _0x4a6ff8[_0x5984('0x45')]['id'];}return db[_0x5984('0x2b')][_0x5984('0x46')]({'where':{'id':_0x4a6ff8['params']['id']}})[_0x5984('0x24')](handleEntityNotFound(_0x391073,null))[_0x5984('0x24')](saveUpdates(_0x4a6ff8[_0x5984('0x45')],null))[_0x5984('0x24')](respondWithResult(_0x391073,null))[_0x5984('0x3f')](handleError(_0x391073,null));};exports[_0x5984('0x25')]=function(_0x8cd397,_0x5cbc04){return db[_0x5984('0x2b')][_0x5984('0x46')]({'where':{'id':_0x8cd397[_0x5984('0x41')]['id']}})[_0x5984('0x24')](handleEntityNotFound(_0x5cbc04,null))[_0x5984('0x24')](removeEntity(_0x5cbc04,null))[_0x5984('0x3f')](handleError(_0x5cbc04,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a1312d0..9dc50c4 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 _0x67c6=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b8f7d,_0xb16f39){var _0x7d4aae=function(_0x4f6e0f){while(--_0x4f6e0f){_0x2b8f7d['push'](_0x2b8f7d['shift']());}};_0x7d4aae(++_0xb16f39);}(_0x67c6,0x147));var _0x667c=function(_0x244e18,_0x254186){_0x244e18=_0x244e18-0x0;var _0x31c029=_0x67c6[_0x244e18];return _0x31c029;};'use strict';var _=require(_0x667c('0x0'));var util=require('util');var logger=require(_0x667c('0x1'))(_0x667c('0x2'));var moment=require(_0x667c('0x3'));var BPromise=require(_0x667c('0x4'));var rp=require(_0x667c('0x5'));var fs=require('fs');var path=require(_0x667c('0x6'));var rimraf=require(_0x667c('0x7'));var config=require(_0x667c('0x8'));var attributes=require(_0x667c('0x9'));module[_0x667c('0xa')]=function(_0x1c0a5c,_0x3a6e7d){return _0x1c0a5c[_0x667c('0xb')](_0x667c('0xc'),attributes,{'tableName':_0x667c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6f4=['./squareMessage.attributes','define','SquareMessage','square_messages','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xd6f4,0x88));var _0x4d6f=function(_0x330c18,_0x5a2f1c){_0x330c18=_0x330c18-0x0;var _0xeca3fd=_0xd6f4[_0x330c18];return _0xeca3fd;};'use strict';var _=require('lodash');var util=require(_0x4d6f('0x0'));var logger=require('../../config/logger')(_0x4d6f('0x1'));var moment=require(_0x4d6f('0x2'));var BPromise=require(_0x4d6f('0x3'));var rp=require(_0x4d6f('0x4'));var fs=require('fs');var path=require(_0x4d6f('0x5'));var rimraf=require('rimraf');var config=require(_0x4d6f('0x6'));var attributes=require(_0x4d6f('0x7'));module['exports']=function(_0x4e58e8,_0x410a63){return _0x4e58e8[_0x4d6f('0x8')](_0x4d6f('0x9'),attributes,{'tableName':_0x4d6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 9eca34c..897ae65 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 _0x5688=['result','CreateSquareMessage','SquareMessage','body','options','raw','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareMessage,\x20%s,\x20%s'];(function(_0x13e8a5,_0x5c721d){var _0x57b820=function(_0x55289f){while(--_0x55289f){_0x13e8a5['push'](_0x13e8a5['shift']());}};_0x57b820(++_0x5c721d);}(_0x5688,0x19c));var _0x8568=function(_0x39204a,_0x55286f){_0x39204a=_0x39204a-0x0;var _0x129eef=_0x5688[_0x39204a];return _0x129eef;};'use strict';var _=require(_0x8568('0x0'));var util=require(_0x8568('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8568('0x2'));var fs=require('fs');var Redis=require(_0x8568('0x3'));var db=require(_0x8568('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8568('0x5'))(_0x8568('0x6'));var config=require(_0x8568('0x7'));var jayson=require(_0x8568('0x8'));var client=jayson[_0x8568('0x9')][_0x8568('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b15c3,_0x59dbe3,_0x449af3){return new BPromise(function(_0xf1d0d6,_0x2bb2d9){return client['request'](_0x2b15c3,_0x449af3)[_0x8568('0xb')](function(_0x24d668){logger[_0x8568('0xc')]('SquareMessage,\x20%s,\x20%s',_0x59dbe3,_0x8568('0xd'));logger['debug'](_0x8568('0xe'),_0x59dbe3,_0x8568('0xd'),JSON[_0x8568('0xf')](_0x24d668));if(_0x24d668[_0x8568('0x10')]){if(_0x24d668['error'][_0x8568('0x11')]===0x1f4){logger[_0x8568('0x10')]('SquareMessage,\x20%s,\x20%s',_0x59dbe3,_0x24d668['error'][_0x8568('0x12')]);return _0x2bb2d9(_0x24d668['error']['message']);}logger[_0x8568('0x10')](_0x8568('0x13'),_0x59dbe3,_0x24d668[_0x8568('0x10')][_0x8568('0x12')]);return _0xf1d0d6(_0x24d668['error']['message']);}else{logger[_0x8568('0xc')](_0x8568('0x13'),_0x59dbe3,'request\x20sent');_0xf1d0d6(_0x24d668[_0x8568('0x14')][_0x8568('0x12')]);}})['catch'](function(_0x430344){logger[_0x8568('0x10')](_0x8568('0x13'),_0x59dbe3,_0x430344);_0x2bb2d9(_0x430344);});});}exports[_0x8568('0x15')]=function(_0x5b7440){var _0x17aab0=this;return new Promise(function(_0x516321,_0x19d43b){return db[_0x8568('0x16')]['create'](_0x5b7440[_0x8568('0x17')],{'raw':_0x5b7440[_0x8568('0x18')]?_0x5b7440[_0x8568('0x18')][_0x8568('0x19')]===undefined?!![]:![]:!![]})[_0x8568('0xb')](function(_0x177869){logger['info'](_0x8568('0x15'),_0x5b7440);logger[_0x8568('0x1a')](_0x8568('0x15'),_0x5b7440,JSON[_0x8568('0xf')](_0x177869));_0x516321(_0x177869);})['catch'](function(_0x380d93){logger['error'](_0x8568('0x15'),_0x380d93['message'],_0x5b7440);_0x19d43b(_0x17aab0[_0x8568('0x10')](0x1f4,_0x380d93[_0x8568('0x12')]));});});}; \ No newline at end of file +var _0xce16=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','CreateSquareMessage','body','options','raw','lodash','util','moment'];(function(_0x15c4ab,_0x409fe0){var _0x1b668d=function(_0x437833){while(--_0x437833){_0x15c4ab['push'](_0x15c4ab['shift']());}};_0x1b668d(++_0x409fe0);}(_0xce16,0x1a6));var _0x6ce1=function(_0x8f44f4,_0x10cdd6){_0x8f44f4=_0x8f44f4-0x0;var _0xd0cd4=_0xce16[_0x8f44f4];return _0xd0cd4;};'use strict';var _=require(_0x6ce1('0x0'));var util=require(_0x6ce1('0x1'));var moment=require(_0x6ce1('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ce1('0x3'));var fs=require('fs');var Redis=require(_0x6ce1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ce1('0x5'));var logger=require(_0x6ce1('0x6'))(_0x6ce1('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ce1('0x8'));var client=jayson[_0x6ce1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xac1cc5,_0x4f8420,_0x33bb30){return new BPromise(function(_0x313c51,_0x46a1a5){return client[_0x6ce1('0xa')](_0xac1cc5,_0x33bb30)[_0x6ce1('0xb')](function(_0x557451){logger[_0x6ce1('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'));logger[_0x6ce1('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'),JSON[_0x6ce1('0xf')](_0x557451));if(_0x557451[_0x6ce1('0x10')]){if(_0x557451[_0x6ce1('0x10')][_0x6ce1('0x11')]===0x1f4){logger[_0x6ce1('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x557451[_0x6ce1('0x10')][_0x6ce1('0x12')]);return _0x46a1a5(_0x557451[_0x6ce1('0x10')]['message']);}logger[_0x6ce1('0x10')](_0x6ce1('0x13'),_0x4f8420,_0x557451[_0x6ce1('0x10')][_0x6ce1('0x12')]);return _0x313c51(_0x557451['error'][_0x6ce1('0x12')]);}else{logger[_0x6ce1('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'));_0x313c51(_0x557451[_0x6ce1('0x14')][_0x6ce1('0x12')]);}})['catch'](function(_0x874542){logger[_0x6ce1('0x10')](_0x6ce1('0x13'),_0x4f8420,_0x874542);_0x46a1a5(_0x874542);});});}exports[_0x6ce1('0x15')]=function(_0x489e96){var _0x5b92c0=this;return new Promise(function(_0x30f5f6,_0x5f08cc){return db['SquareMessage']['create'](_0x489e96[_0x6ce1('0x16')],{'raw':_0x489e96[_0x6ce1('0x17')]?_0x489e96[_0x6ce1('0x17')][_0x6ce1('0x18')]===undefined?!![]:![]:!![]})[_0x6ce1('0xb')](function(_0x584301){logger[_0x6ce1('0xc')](_0x6ce1('0x15'),_0x489e96);logger[_0x6ce1('0xe')]('CreateSquareMessage',_0x489e96,JSON['stringify'](_0x584301));_0x30f5f6(_0x584301);})['catch'](function(_0x19db40){logger[_0x6ce1('0x10')](_0x6ce1('0x15'),_0x19db40[_0x6ce1('0x12')],_0x489e96);_0x5f08cc(_0x5b92c0[_0x6ce1('0x10')](0x1f4,_0x19db40[_0x6ce1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index fa29428..e338e38 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 _0xe2d2=['util','path','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','show','/:id/test','isAuthenticated','test','create','put','/:id','update','delete','exports','multer'];(function(_0x3ce089,_0x1a4890){var _0x35b89d=function(_0x57f388){while(--_0x57f388){_0x3ce089['push'](_0x3ce089['shift']());}};_0x35b89d(++_0x1a4890);}(_0xe2d2,0xdb));var _0x2e2d=function(_0x4d8d7b,_0x49da11){_0x4d8d7b=_0x4d8d7b-0x0;var _0x3ee143=_0xe2d2[_0x4d8d7b];return _0x3ee143;};'use strict';var multer=require(_0x2e2d('0x0'));var util=require(_0x2e2d('0x1'));var path=require(_0x2e2d('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e2d('0x3'));var router=express[_0x2e2d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2e2d('0x5'));var config=require(_0x2e2d('0x6'));var controller=require(_0x2e2d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2e2d('0x8')]);router[_0x2e2d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2e2d('0xa')]);router[_0x2e2d('0x9')](_0x2e2d('0xb'),auth[_0x2e2d('0xc')](),timeout('15s'),controller[_0x2e2d('0xd')]);router['post']('/',auth[_0x2e2d('0xc')](),controller[_0x2e2d('0xe')]);router[_0x2e2d('0xf')](_0x2e2d('0x10'),auth[_0x2e2d('0xc')](),controller[_0x2e2d('0x11')]);router[_0x2e2d('0x12')](_0x2e2d('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x2e2d('0x13')]=router; \ No newline at end of file +var _0xdeb9=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test'];(function(_0x88c2d6,_0x11046e){var _0x1bbe1d=function(_0x5f0527){while(--_0x5f0527){_0x88c2d6['push'](_0x88c2d6['shift']());}};_0x1bbe1d(++_0x11046e);}(_0xdeb9,0x1d3));var _0x9deb=function(_0x11fdb2,_0x2b74db){_0x11fdb2=_0x11fdb2-0x0;var _0x3bd188=_0xdeb9[_0x11fdb2];return _0x3bd188;};'use strict';var multer=require(_0x9deb('0x0'));var util=require(_0x9deb('0x1'));var path=require(_0x9deb('0x2'));var timeout=require(_0x9deb('0x3'));var express=require('express');var router=express[_0x9deb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9deb('0x5'));var interaction=require(_0x9deb('0x6'));var config=require(_0x9deb('0x7'));var controller=require(_0x9deb('0x8'));router[_0x9deb('0x9')]('/',auth[_0x9deb('0xa')](),controller[_0x9deb('0xb')]);router[_0x9deb('0x9')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller['show']);router[_0x9deb('0x9')](_0x9deb('0xd'),auth[_0x9deb('0xa')](),timeout(_0x9deb('0xe')),controller[_0x9deb('0xf')]);router[_0x9deb('0x10')]('/',auth[_0x9deb('0xa')](),controller[_0x9deb('0x11')]);router[_0x9deb('0x12')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller[_0x9deb('0x13')]);router[_0x9deb('0x14')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller[_0x9deb('0x15')]);module[_0x9deb('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8f2f505..cf47a1e 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 _0xd806=['sequelize','exports','STRING','name'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd806,0x1c4));var _0x6d80=function(_0x2894d5,_0x159d6b){_0x2894d5=_0x2894d5-0x0;var _0x343dd7=_0xd806[_0x2894d5];return _0x343dd7;};'use strict';var Sequelize=require(_0x6d80('0x0'));module[_0x6d80('0x1')]={'name':{'type':Sequelize[_0x6d80('0x2')],'unique':_0x6d80('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d80('0x2')]}}; \ No newline at end of file +var _0x02e7=['name','sequelize','exports','STRING'];(function(_0x22d892,_0x2eae86){var _0x10a257=function(_0x50a658){while(--_0x50a658){_0x22d892['push'](_0x22d892['shift']());}};_0x10a257(++_0x2eae86);}(_0x02e7,0x17d));var _0x702e=function(_0x363d40,_0x3b3d61){_0x363d40=_0x363d40-0x0;var _0x9f330a=_0x02e7[_0x363d40];return _0x9f330a;};'use strict';var Sequelize=require(_0x702e('0x0'));module[_0x702e('0x1')]={'name':{'type':Sequelize[_0x702e('0x2')],'unique':_0x702e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x702e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 95a61dc..36dd221 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 _0x19b7=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','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','test','dsn','odbc','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','stack','name','index','SquareOdbc','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','nolimit','sort'];(function(_0x393c24,_0x29c062){var _0x273e83=function(_0x239f61){while(--_0x239f61){_0x393c24['push'](_0x393c24['shift']());}};_0x273e83(++_0x29c062);}(_0x19b7,0x178));var _0x719b=function(_0xd91e0d,_0x1b1d31){_0xd91e0d=_0xd91e0d-0x0;var _0x4fb3a5=_0x19b7[_0xd91e0d];return _0x4fb3a5;};'use strict';var emlformat=require(_0x719b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x719b('0x1'));var jsonpatch=require(_0x719b('0x2'));var rp=require(_0x719b('0x3'));var moment=require(_0x719b('0x4'));var BPromise=require(_0x719b('0x5'));var Mustache=require('mustache');var util=require(_0x719b('0x6'));var path=require('path');var sox=require(_0x719b('0x7'));var csv=require(_0x719b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x719b('0x9'));var _=require(_0x719b('0xa'));var squel=require(_0x719b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x719b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x719b('0xd'));var Redis=require(_0x719b('0xe'));var authService=require(_0x719b('0xf'));var qs=require(_0x719b('0x10'));var as=require(_0x719b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x719b('0x12'))(_0x719b('0x13'));var utils=require(_0x719b('0x14'));var config=require(_0x719b('0x15'));var licenseUtil=require(_0x719b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7fbad8,_0x19f6b3){_0x19f6b3=_0x19f6b3||0xcc;return function(_0x2be2b2){if(_0x2be2b2){return _0x7fbad8[_0x719b('0x17')](_0x19f6b3);}return _0x7fbad8[_0x719b('0x18')](_0x19f6b3)[_0x719b('0x19')]();};}function respondWithResult(_0x509657,_0x4dbd7e){_0x4dbd7e=_0x4dbd7e||0xc8;return function(_0x5a4545){if(_0x5a4545){return _0x509657[_0x719b('0x18')](_0x4dbd7e)[_0x719b('0x1a')](_0x5a4545);}};}function respondWithFilteredResult(_0x2055be,_0x53574a){return function(_0x4db97d){if(_0x4db97d){var _0x915602=typeof _0x53574a[_0x719b('0x1b')]===_0x719b('0x1c')&&typeof _0x53574a[_0x719b('0x1d')]===_0x719b('0x1c');var _0x4bd0ee=_0x4db97d[_0x719b('0x1e')];var _0xfc1c9e=_0x915602?0x0:_0x53574a[_0x719b('0x1b')];var _0x44b690=_0x915602?_0x4db97d[_0x719b('0x1e')]:_0x53574a[_0x719b('0x1b')]+_0x53574a[_0x719b('0x1d')];var _0x51f56d;if(_0x44b690>=_0x4bd0ee){_0x44b690=_0x4bd0ee;_0x51f56d=0xc8;}else{_0x51f56d=0xce;}_0x2055be[_0x719b('0x18')](_0x51f56d);return _0x2055be[_0x719b('0x1f')](_0x719b('0x20'),_0xfc1c9e+'-'+_0x44b690+'/'+_0x4bd0ee)[_0x719b('0x1a')](_0x4db97d);}return null;};}function patchUpdates(_0x1d062c){return function(_0x458a71){try{jsonpatch[_0x719b('0x21')](_0x458a71,_0x1d062c,!![]);}catch(_0x3348c7){return BPromise['reject'](_0x3348c7);}return _0x458a71[_0x719b('0x22')]();};}function saveUpdates(_0x380bc8,_0x4f4a8d){return function(_0x2fc237){if(_0x2fc237){return _0x2fc237[_0x719b('0x23')](_0x380bc8)[_0x719b('0x24')](function(_0x270020){return _0x270020;});}return null;};}function removeEntity(_0x1c1e45,_0x155c07){return function(_0x258055){if(_0x258055){return _0x258055[_0x719b('0x25')]()[_0x719b('0x24')](function(){var _0x2b2c5a=_0x258055[_0x719b('0x26')]({'plain':!![]});var _0x4e2977=_0x719b('0x27');return db[_0x719b('0x28')]['destroy']({'where':{'type':_0x4e2977,'resourceId':_0x2b2c5a['id']}})[_0x719b('0x24')](function(){return _0x258055;});})[_0x719b('0x24')](function(){_0x1c1e45[_0x719b('0x18')](0xcc)[_0x719b('0x19')]();});}};}function handleEntityNotFound(_0x51490c,_0x1aa8d0){return function(_0x2b8644){if(!_0x2b8644){_0x51490c[_0x719b('0x17')](0x194);}return _0x2b8644;};}function handleError(_0x54f6a1,_0x26e03f){_0x26e03f=_0x26e03f||0x1f4;return function(_0x310630){logger['error'](_0x310630[_0x719b('0x29')]);if(_0x310630[_0x719b('0x2a')]){delete _0x310630['name'];}_0x54f6a1[_0x719b('0x18')](_0x26e03f)['send'](_0x310630);};}exports[_0x719b('0x2b')]=function(_0x2f379d,_0x270824){var _0x568137={},_0x3936c2={},_0x51b037={'count':0x0,'rows':[]};var _0x4374b1=_['map'](db[_0x719b('0x2c')][_0x719b('0x2d')],function(_0x5409e7){return{'name':_0x5409e7[_0x719b('0x2e')],'type':_0x5409e7[_0x719b('0x2f')][_0x719b('0x30')]};});_0x3936c2[_0x719b('0x31')]=_[_0x719b('0x32')](_0x4374b1,_0x719b('0x2a'));_0x3936c2['query']=_[_0x719b('0x33')](_0x2f379d['query']);_0x3936c2[_0x719b('0x34')]=_[_0x719b('0x35')](_0x3936c2[_0x719b('0x31')],_0x3936c2[_0x719b('0x36')]);_0x568137[_0x719b('0x37')]=_[_0x719b('0x35')](_0x3936c2['model'],qs[_0x719b('0x38')](_0x2f379d[_0x719b('0x36')][_0x719b('0x38')]));_0x568137[_0x719b('0x37')]=_0x568137[_0x719b('0x37')]['length']?_0x568137['attributes']:_0x3936c2[_0x719b('0x31')];if(!_0x2f379d[_0x719b('0x36')]['hasOwnProperty'](_0x719b('0x39'))){_0x568137[_0x719b('0x1d')]=qs['limit'](_0x2f379d[_0x719b('0x36')][_0x719b('0x1d')]);_0x568137[_0x719b('0x1b')]=qs[_0x719b('0x1b')](_0x2f379d[_0x719b('0x36')][_0x719b('0x1b')]);}_0x568137['order']=qs[_0x719b('0x3a')](_0x2f379d['query']['sort']);_0x568137[_0x719b('0x3b')]=qs[_0x719b('0x34')](_[_0x719b('0x3c')](_0x2f379d[_0x719b('0x36')],_0x3936c2['filters']),_0x4374b1);if(_0x2f379d[_0x719b('0x36')][_0x719b('0x3d')]){_0x568137[_0x719b('0x3b')]=_[_0x719b('0x3e')](_0x568137[_0x719b('0x3b')],{'$or':_[_0x719b('0x32')](_0x4374b1,function(_0x3a5b9a){if(_0x3a5b9a[_0x719b('0x2f')]!==_0x719b('0x3f')){var _0x1ac756={};_0x1ac756[_0x3a5b9a[_0x719b('0x2a')]]={'$like':'%'+_0x2f379d[_0x719b('0x36')][_0x719b('0x3d')]+'%'};return _0x1ac756;}})});}_0x568137=_[_0x719b('0x3e')]({},_0x568137,_0x2f379d[_0x719b('0x40')]);var _0x191a11={'where':_0x568137['where']};return db[_0x719b('0x2c')][_0x719b('0x1e')](_0x191a11)[_0x719b('0x24')](function(_0x16d6da){_0x51b037[_0x719b('0x1e')]=_0x16d6da;if(_0x2f379d['query'][_0x719b('0x41')]){_0x568137[_0x719b('0x42')]=[{'all':!![]}];}return db[_0x719b('0x2c')][_0x719b('0x43')](_0x568137);})[_0x719b('0x24')](function(_0x304a99){_0x51b037['rows']=_0x304a99;return _0x51b037;})[_0x719b('0x24')](respondWithFilteredResult(_0x270824,_0x568137))[_0x719b('0x44')](handleError(_0x270824,null));};exports[_0x719b('0x45')]=function(_0x50d177,_0x563a43){var _0x641f7f={'raw':!![],'where':{'id':_0x50d177[_0x719b('0x46')]['id']}},_0x129c40={};_0x129c40[_0x719b('0x31')]=_[_0x719b('0x33')](db[_0x719b('0x2c')][_0x719b('0x2d')]);_0x129c40[_0x719b('0x36')]=_['keys'](_0x50d177['query']);_0x129c40['filters']=_[_0x719b('0x35')](_0x129c40[_0x719b('0x31')],_0x129c40[_0x719b('0x36')]);_0x641f7f['attributes']=_[_0x719b('0x35')](_0x129c40[_0x719b('0x31')],qs[_0x719b('0x38')](_0x50d177[_0x719b('0x36')][_0x719b('0x38')]));_0x641f7f[_0x719b('0x37')]=_0x641f7f[_0x719b('0x37')][_0x719b('0x47')]?_0x641f7f[_0x719b('0x37')]:_0x129c40[_0x719b('0x31')];if(_0x50d177['query'][_0x719b('0x41')]){_0x641f7f['include']=[{'all':!![]}];}_0x641f7f=_[_0x719b('0x3e')]({},_0x641f7f,_0x50d177['options']);return db[_0x719b('0x2c')]['find'](_0x641f7f)[_0x719b('0x24')](handleEntityNotFound(_0x563a43,null))[_0x719b('0x24')](respondWithResult(_0x563a43,null))[_0x719b('0x44')](handleError(_0x563a43,null));};exports[_0x719b('0x48')]=function(_0x40a496,_0x3023c7){return db['SquareOdbc'][_0x719b('0x48')](_0x40a496[_0x719b('0x49')],{})[_0x719b('0x24')](function(_0x31c358){var _0xf880a7=_0x40a496[_0x719b('0x4a')][_0x719b('0x26')]({'plain':!![]});if(!_0xf880a7)throw new Error(_0x719b('0x4b'));if(_0xf880a7[_0x719b('0x4c')]===_0x719b('0x4a')){var _0x1c2949=_0x31c358[_0x719b('0x26')]({'plain':!![]});var _0x364c42=_0x719b('0x27');return db[_0x719b('0x4d')]['find']({'where':{'name':_0x364c42,'userProfileId':_0xf880a7[_0x719b('0x4e')]},'raw':!![]})[_0x719b('0x24')](function(_0xca5329){if(_0xca5329&&_0xca5329[_0x719b('0x4f')]===0x0){return db['UserProfileResource'][_0x719b('0x48')]({'name':_0x1c2949[_0x719b('0x2a')],'resourceId':_0x1c2949['id'],'type':_0xca5329[_0x719b('0x2a')],'sectionId':_0xca5329['id']},{})['then'](function(){return _0x31c358;});}else{return _0x31c358;}})[_0x719b('0x44')](function(_0x3032a8){logger[_0x719b('0x50')](_0x719b('0x51'),_0x3032a8);throw _0x3032a8;});}return _0x31c358;})[_0x719b('0x24')](respondWithResult(_0x3023c7,0xc9))[_0x719b('0x44')](handleError(_0x3023c7,null));};exports[_0x719b('0x23')]=function(_0x118ee2,_0xd0f4e4){if(_0x118ee2[_0x719b('0x49')]['id']){delete _0x118ee2[_0x719b('0x49')]['id'];}return db[_0x719b('0x2c')][_0x719b('0x52')]({'where':{'id':_0x118ee2['params']['id']}})[_0x719b('0x24')](handleEntityNotFound(_0xd0f4e4,null))['then'](saveUpdates(_0x118ee2[_0x719b('0x49')],null))[_0x719b('0x24')](respondWithResult(_0xd0f4e4,null))[_0x719b('0x44')](handleError(_0xd0f4e4,null));};exports['destroy']=function(_0x230d92,_0x189200){return db['SquareOdbc'][_0x719b('0x52')]({'where':{'id':_0x230d92['params']['id']}})[_0x719b('0x24')](handleEntityNotFound(_0x189200,null))['then'](removeEntity(_0x189200,null))[_0x719b('0x44')](handleError(_0x189200,null));};exports[_0x719b('0x53')]=function(_0x34e33a,_0x396c69,_0x8d17e4){var _0xff6ab8;return db['SquareOdbc']['find']({'where':{'id':_0x34e33a[_0x719b('0x46')]['id']},'attributes':['id',_0x719b('0x54')]})[_0x719b('0x24')](handleEntityNotFound(_0x396c69,null))[_0x719b('0x24')](function(_0x4797f9){if(_0x4797f9){var _0x2381ab=require(_0x719b('0x55'))();_0x2381ab['openSync'](_0x4797f9[_0x719b('0x54')]);_0x2381ab[_0x719b('0x56')]();return _0x4797f9;}})['then'](respondWithResult(_0x396c69,null))['catch'](handleError(_0x396c69,null));}; \ No newline at end of file +var _0xba01=['save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','map','options','SquareOdbc','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x637800,_0x336c24){var _0x28ad13=function(_0xa03005){while(--_0xa03005){_0x637800['push'](_0x637800['shift']());}};_0x28ad13(++_0x336c24);}(_0xba01,0xe1));var _0x1ba0=function(_0x2838fa,_0x55938a){_0x2838fa=_0x2838fa-0x0;var _0x291c8b=_0xba01[_0x2838fa];return _0x291c8b;};'use strict';var emlformat=require(_0x1ba0('0x0'));var rimraf=require(_0x1ba0('0x1'));var zipdir=require(_0x1ba0('0x2'));var jsonpatch=require(_0x1ba0('0x3'));var rp=require(_0x1ba0('0x4'));var moment=require(_0x1ba0('0x5'));var BPromise=require(_0x1ba0('0x6'));var Mustache=require(_0x1ba0('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1ba0('0x8'));var csv=require(_0x1ba0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ba0('0xa'));var squel=require(_0x1ba0('0xb'));var crypto=require(_0x1ba0('0xc'));var jsforce=require(_0x1ba0('0xd'));var deskjs=require(_0x1ba0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1ba0('0xf'));var Redis=require('ioredis');var authService=require(_0x1ba0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1ba0('0x11'));var hardwareService=require(_0x1ba0('0x12'));var logger=require(_0x1ba0('0x13'))(_0x1ba0('0x14'));var utils=require('../../config/utils');var config=require(_0x1ba0('0x15'));var licenseUtil=require(_0x1ba0('0x16'));var db=require(_0x1ba0('0x17'))['db'];function respondWithStatusCode(_0x434018,_0x2594eb){_0x2594eb=_0x2594eb||0xcc;return function(_0x3aea71){if(_0x3aea71){return _0x434018[_0x1ba0('0x18')](_0x2594eb);}return _0x434018[_0x1ba0('0x19')](_0x2594eb)[_0x1ba0('0x1a')]();};}function respondWithResult(_0x325e12,_0x4c372b){_0x4c372b=_0x4c372b||0xc8;return function(_0x3a5ddd){if(_0x3a5ddd){return _0x325e12[_0x1ba0('0x19')](_0x4c372b)['json'](_0x3a5ddd);}};}function respondWithFilteredResult(_0x3eafb9,_0x8cae14){return function(_0x1463f6){if(_0x1463f6){var _0x6753dd=typeof _0x8cae14[_0x1ba0('0x1b')]===_0x1ba0('0x1c')&&typeof _0x8cae14[_0x1ba0('0x1d')]===_0x1ba0('0x1c');var _0x1324de=_0x1463f6[_0x1ba0('0x1e')];var _0x4f0853=_0x6753dd?0x0:_0x8cae14[_0x1ba0('0x1b')];var _0x3fc68e=_0x6753dd?_0x1463f6['count']:_0x8cae14['offset']+_0x8cae14[_0x1ba0('0x1d')];var _0x10f335;if(_0x3fc68e>=_0x1324de){_0x3fc68e=_0x1324de;_0x10f335=0xc8;}else{_0x10f335=0xce;}_0x3eafb9[_0x1ba0('0x19')](_0x10f335);return _0x3eafb9[_0x1ba0('0x1f')](_0x1ba0('0x20'),_0x4f0853+'-'+_0x3fc68e+'/'+_0x1324de)[_0x1ba0('0x21')](_0x1463f6);}return null;};}function patchUpdates(_0x397852){return function(_0x4e583f){try{jsonpatch[_0x1ba0('0x22')](_0x4e583f,_0x397852,!![]);}catch(_0x3c4f79){return BPromise[_0x1ba0('0x23')](_0x3c4f79);}return _0x4e583f[_0x1ba0('0x24')]();};}function saveUpdates(_0x45f91c,_0xd4abcd){return function(_0x28eeee){if(_0x28eeee){return _0x28eeee[_0x1ba0('0x25')](_0x45f91c)[_0x1ba0('0x26')](function(_0x40ebf5){return _0x40ebf5;});}return null;};}function removeEntity(_0x28fe1b,_0x1a15bc){return function(_0x285765){if(_0x285765){return _0x285765[_0x1ba0('0x27')]()['then'](function(){var _0x5a9b4e=_0x285765[_0x1ba0('0x28')]({'plain':!![]});var _0x69c2e8=_0x1ba0('0x29');return db[_0x1ba0('0x2a')][_0x1ba0('0x27')]({'where':{'type':_0x69c2e8,'resourceId':_0x5a9b4e['id']}})[_0x1ba0('0x26')](function(){return _0x285765;});})[_0x1ba0('0x26')](function(){_0x28fe1b[_0x1ba0('0x19')](0xcc)[_0x1ba0('0x1a')]();});}};}function handleEntityNotFound(_0x5d08fa,_0x47ccf3){return function(_0x9e89b6){if(!_0x9e89b6){_0x5d08fa['sendStatus'](0x194);}return _0x9e89b6;};}function handleError(_0x4ab358,_0x4d0b2e){_0x4d0b2e=_0x4d0b2e||0x1f4;return function(_0x181896){logger[_0x1ba0('0x2b')](_0x181896[_0x1ba0('0x2c')]);if(_0x181896[_0x1ba0('0x2d')]){delete _0x181896[_0x1ba0('0x2d')];}_0x4ab358[_0x1ba0('0x19')](_0x4d0b2e)['send'](_0x181896);};}exports[_0x1ba0('0x2e')]=function(_0x39b3dc,_0x506983){var _0xc31537={},_0x2ae3f8={},_0x287ac3={'count':0x0,'rows':[]};var _0x56c0cd=_['map'](db['SquareOdbc'][_0x1ba0('0x2f')],function(_0x1f94b5){return{'name':_0x1f94b5[_0x1ba0('0x30')],'type':_0x1f94b5[_0x1ba0('0x31')][_0x1ba0('0x32')]};});_0x2ae3f8[_0x1ba0('0x33')]=_['map'](_0x56c0cd,'name');_0x2ae3f8['query']=_[_0x1ba0('0x34')](_0x39b3dc[_0x1ba0('0x35')]);_0x2ae3f8['filters']=_['intersection'](_0x2ae3f8[_0x1ba0('0x33')],_0x2ae3f8['query']);_0xc31537[_0x1ba0('0x36')]=_[_0x1ba0('0x37')](_0x2ae3f8[_0x1ba0('0x33')],qs['fields'](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x38')]));_0xc31537['attributes']=_0xc31537[_0x1ba0('0x36')][_0x1ba0('0x39')]?_0xc31537[_0x1ba0('0x36')]:_0x2ae3f8[_0x1ba0('0x33')];if(!_0x39b3dc['query']['hasOwnProperty'](_0x1ba0('0x3a'))){_0xc31537[_0x1ba0('0x1d')]=qs[_0x1ba0('0x1d')](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x1d')]);_0xc31537[_0x1ba0('0x1b')]=qs[_0x1ba0('0x1b')](_0x39b3dc['query']['offset']);}_0xc31537[_0x1ba0('0x3b')]=qs[_0x1ba0('0x3c')](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x3c')]);_0xc31537['where']=qs['filters'](_['pick'](_0x39b3dc['query'],_0x2ae3f8[_0x1ba0('0x3d')]),_0x56c0cd);if(_0x39b3dc['query'][_0x1ba0('0x3e')]){_0xc31537[_0x1ba0('0x3f')]=_[_0x1ba0('0x40')](_0xc31537[_0x1ba0('0x3f')],{'$or':_[_0x1ba0('0x41')](_0x56c0cd,function(_0x4f7a7e){if(_0x4f7a7e[_0x1ba0('0x31')]!=='VIRTUAL'){var _0x4d2bd6={};_0x4d2bd6[_0x4f7a7e['name']]={'$like':'%'+_0x39b3dc['query'][_0x1ba0('0x3e')]+'%'};return _0x4d2bd6;}})});}_0xc31537=_['merge']({},_0xc31537,_0x39b3dc[_0x1ba0('0x42')]);var _0x5d4df1={'where':_0xc31537['where']};return db[_0x1ba0('0x43')][_0x1ba0('0x1e')](_0x5d4df1)['then'](function(_0x106178){_0x287ac3[_0x1ba0('0x1e')]=_0x106178;if(_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x44')]){_0xc31537[_0x1ba0('0x45')]=[{'all':!![]}];}return db[_0x1ba0('0x43')][_0x1ba0('0x46')](_0xc31537);})['then'](function(_0x3ad19c){_0x287ac3[_0x1ba0('0x47')]=_0x3ad19c;return _0x287ac3;})[_0x1ba0('0x26')](respondWithFilteredResult(_0x506983,_0xc31537))[_0x1ba0('0x48')](handleError(_0x506983,null));};exports['show']=function(_0x24618b,_0x5199b6){var _0x3fd635={'raw':!![],'where':{'id':_0x24618b[_0x1ba0('0x49')]['id']}},_0x4d7049={};_0x4d7049[_0x1ba0('0x33')]=_[_0x1ba0('0x34')](db['SquareOdbc'][_0x1ba0('0x2f')]);_0x4d7049['query']=_[_0x1ba0('0x34')](_0x24618b[_0x1ba0('0x35')]);_0x4d7049[_0x1ba0('0x3d')]=_['intersection'](_0x4d7049[_0x1ba0('0x33')],_0x4d7049[_0x1ba0('0x35')]);_0x3fd635['attributes']=_[_0x1ba0('0x37')](_0x4d7049[_0x1ba0('0x33')],qs[_0x1ba0('0x38')](_0x24618b['query'][_0x1ba0('0x38')]));_0x3fd635['attributes']=_0x3fd635[_0x1ba0('0x36')]['length']?_0x3fd635[_0x1ba0('0x36')]:_0x4d7049['model'];if(_0x24618b[_0x1ba0('0x35')][_0x1ba0('0x44')]){_0x3fd635['include']=[{'all':!![]}];}_0x3fd635=_[_0x1ba0('0x40')]({},_0x3fd635,_0x24618b['options']);return db['SquareOdbc']['find'](_0x3fd635)[_0x1ba0('0x26')](handleEntityNotFound(_0x5199b6,null))['then'](respondWithResult(_0x5199b6,null))[_0x1ba0('0x48')](handleError(_0x5199b6,null));};exports[_0x1ba0('0x4a')]=function(_0x33b4b1,_0x5c2542){return db[_0x1ba0('0x43')][_0x1ba0('0x4a')](_0x33b4b1[_0x1ba0('0x4b')],{})[_0x1ba0('0x26')](function(_0x213c8f){var _0x16ead5=_0x33b4b1[_0x1ba0('0x4c')][_0x1ba0('0x28')]({'plain':!![]});if(!_0x16ead5)throw new Error(_0x1ba0('0x4d'));if(_0x16ead5['role']===_0x1ba0('0x4c')){var _0x25924c=_0x213c8f['get']({'plain':!![]});var _0x5b4083=_0x1ba0('0x29');return db[_0x1ba0('0x4e')][_0x1ba0('0x4f')]({'where':{'name':_0x5b4083,'userProfileId':_0x16ead5['userProfileId']},'raw':!![]})['then'](function(_0x221059){if(_0x221059&&_0x221059[_0x1ba0('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x25924c[_0x1ba0('0x2d')],'resourceId':_0x25924c['id'],'type':_0x221059[_0x1ba0('0x2d')],'sectionId':_0x221059['id']},{})[_0x1ba0('0x26')](function(){return _0x213c8f;});}else{return _0x213c8f;}})[_0x1ba0('0x48')](function(_0xec61a5){logger[_0x1ba0('0x2b')](_0x1ba0('0x51'),_0xec61a5);throw _0xec61a5;});}return _0x213c8f;})[_0x1ba0('0x26')](respondWithResult(_0x5c2542,0xc9))['catch'](handleError(_0x5c2542,null));};exports[_0x1ba0('0x25')]=function(_0x3ec2dc,_0x48be37){if(_0x3ec2dc[_0x1ba0('0x4b')]['id']){delete _0x3ec2dc['body']['id'];}return db[_0x1ba0('0x43')][_0x1ba0('0x4f')]({'where':{'id':_0x3ec2dc[_0x1ba0('0x49')]['id']}})['then'](handleEntityNotFound(_0x48be37,null))['then'](saveUpdates(_0x3ec2dc[_0x1ba0('0x4b')],null))[_0x1ba0('0x26')](respondWithResult(_0x48be37,null))[_0x1ba0('0x48')](handleError(_0x48be37,null));};exports['destroy']=function(_0x5ef2c7,_0x5d11e9){return db[_0x1ba0('0x43')][_0x1ba0('0x4f')]({'where':{'id':_0x5ef2c7[_0x1ba0('0x49')]['id']}})[_0x1ba0('0x26')](handleEntityNotFound(_0x5d11e9,null))[_0x1ba0('0x26')](removeEntity(_0x5d11e9,null))[_0x1ba0('0x48')](handleError(_0x5d11e9,null));};exports[_0x1ba0('0x52')]=function(_0x1a33e4,_0x9bd7f4,_0x4173a6){var _0x1fa15f;return db['SquareOdbc'][_0x1ba0('0x4f')]({'where':{'id':_0x1a33e4[_0x1ba0('0x49')]['id']},'attributes':['id',_0x1ba0('0x53')]})[_0x1ba0('0x26')](handleEntityNotFound(_0x9bd7f4,null))[_0x1ba0('0x26')](function(_0x2b65eb){if(_0x2b65eb){var _0x106dd9=require(_0x1ba0('0x54'))();_0x106dd9[_0x1ba0('0x55')](_0x2b65eb['dsn']);_0x106dd9[_0x1ba0('0x56')]();return _0x2b65eb;}})[_0x1ba0('0x26')](respondWithResult(_0x9bd7f4,null))['catch'](handleError(_0x9bd7f4,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 3f7182f..704c9f9 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 _0x0ff0=['bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api'];(function(_0x8cbfe1,_0x3cdedd){var _0x20a7cc=function(_0x39bb28){while(--_0x39bb28){_0x8cbfe1['push'](_0x8cbfe1['shift']());}};_0x20a7cc(++_0x3cdedd);}(_0x0ff0,0x75));var _0x00ff=function(_0x3ff975,_0x1da80a){_0x3ff975=_0x3ff975-0x0;var _0x98026c=_0x0ff0[_0x3ff975];return _0x98026c;};'use strict';var _=require(_0x00ff('0x0'));var util=require(_0x00ff('0x1'));var logger=require('../../config/logger')(_0x00ff('0x2'));var moment=require('moment');var BPromise=require(_0x00ff('0x3'));var rp=require(_0x00ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00ff('0x5'));var config=require(_0x00ff('0x6'));var attributes=require(_0x00ff('0x7'));module[_0x00ff('0x8')]=function(_0x204ca0,_0x16c7e3){return _0x204ca0[_0x00ff('0x9')](_0x00ff('0xa'),attributes,{'tableName':_0x00ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab90=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','lodash'];(function(_0x1c24c6,_0x5c26ed){var _0x26949a=function(_0x3298db){while(--_0x3298db){_0x1c24c6['push'](_0x1c24c6['shift']());}};_0x26949a(++_0x5c26ed);}(_0xab90,0x9b));var _0x0ab9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xab90[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var logger=require(_0x0ab9('0x2'))(_0x0ab9('0x3'));var moment=require(_0x0ab9('0x4'));var BPromise=require(_0x0ab9('0x5'));var rp=require(_0x0ab9('0x6'));var fs=require('fs');var path=require(_0x0ab9('0x7'));var rimraf=require(_0x0ab9('0x8'));var config=require('../../config/environment');var attributes=require(_0x0ab9('0x9'));module[_0x0ab9('0xa')]=function(_0x27da93,_0xab56e7){return _0x27da93[_0x0ab9('0xb')](_0x0ab9('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 03bd9f3..fc30efb 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 _0xc7ec=['options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','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','ShowSquareOdbc','find'];(function(_0x428411,_0x4b12fb){var _0x26bade=function(_0x1eab19){while(--_0x1eab19){_0x428411['push'](_0x428411['shift']());}};_0x26bade(++_0x4b12fb);}(_0xc7ec,0x94));var _0xcc7e=function(_0x45b36c,_0x4efbfe){_0x45b36c=_0x45b36c-0x0;var _0x1dad2f=_0xc7ec[_0x45b36c];return _0x1dad2f;};'use strict';var _=require(_0xcc7e('0x0'));var util=require(_0xcc7e('0x1'));var moment=require(_0xcc7e('0x2'));var BPromise=require(_0xcc7e('0x3'));var rs=require(_0xcc7e('0x4'));var fs=require('fs');var Redis=require(_0xcc7e('0x5'));var db=require(_0xcc7e('0x6'))['db'];var utils=require(_0xcc7e('0x7'));var logger=require('../../config/logger')(_0xcc7e('0x8'));var config=require(_0xcc7e('0x9'));var jayson=require(_0xcc7e('0xa'));var client=jayson[_0xcc7e('0xb')][_0xcc7e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2835aa,_0x21b018,_0x4de0f2){return new BPromise(function(_0x4cbaa4,_0x470550){return client[_0xcc7e('0xd')](_0x2835aa,_0x4de0f2)[_0xcc7e('0xe')](function(_0x1543f8){logger[_0xcc7e('0xf')](_0xcc7e('0x10'),_0x21b018,_0xcc7e('0x11'));logger[_0xcc7e('0x12')](_0xcc7e('0x13'),_0x21b018,'request\x20sent',JSON[_0xcc7e('0x14')](_0x1543f8));if(_0x1543f8[_0xcc7e('0x15')]){if(_0x1543f8[_0xcc7e('0x15')][_0xcc7e('0x16')]===0x1f4){logger['error'](_0xcc7e('0x10'),_0x21b018,_0x1543f8['error']['message']);return _0x470550(_0x1543f8['error'][_0xcc7e('0x17')]);}logger[_0xcc7e('0x15')](_0xcc7e('0x10'),_0x21b018,_0x1543f8[_0xcc7e('0x15')][_0xcc7e('0x17')]);return _0x4cbaa4(_0x1543f8[_0xcc7e('0x15')][_0xcc7e('0x17')]);}else{logger[_0xcc7e('0xf')](_0xcc7e('0x10'),_0x21b018,_0xcc7e('0x11'));_0x4cbaa4(_0x1543f8[_0xcc7e('0x18')][_0xcc7e('0x17')]);}})['catch'](function(_0x101d12){logger[_0xcc7e('0x15')](_0xcc7e('0x10'),_0x21b018,_0x101d12);_0x470550(_0x101d12);});});}exports[_0xcc7e('0x19')]=function(_0x584967){var _0x222aff=this;return new Promise(function(_0x3d7c07,_0x1de8be){return db['SquareOdbc'][_0xcc7e('0x1a')]({'raw':_0x584967['options']?_0x584967[_0xcc7e('0x1b')][_0xcc7e('0x1c')]===undefined?!![]:![]:!![],'where':_0x584967['options']?_0x584967[_0xcc7e('0x1b')][_0xcc7e('0x1d')]||null:null,'attributes':_0x584967[_0xcc7e('0x1b')]?_0x584967[_0xcc7e('0x1b')][_0xcc7e('0x1e')]||null:null,'include':_0x584967[_0xcc7e('0x1b')]?_0x584967[_0xcc7e('0x1b')][_0xcc7e('0x1f')]?_[_0xcc7e('0x20')](_0x584967[_0xcc7e('0x1b')][_0xcc7e('0x1f')],function(_0x465ca8){return{'model':db[_0x465ca8[_0xcc7e('0x21')]],'as':_0x465ca8['as'],'attributes':_0x465ca8['attributes'],'include':_0x465ca8['include']?_[_0xcc7e('0x20')](_0x465ca8[_0xcc7e('0x1f')],function(_0x5b5dee){return{'model':db[_0x5b5dee[_0xcc7e('0x21')]],'as':_0x5b5dee['as'],'attributes':_0x5b5dee[_0xcc7e('0x1e')],'include':_0x5b5dee[_0xcc7e('0x1f')]?_[_0xcc7e('0x20')](_0x5b5dee[_0xcc7e('0x1f')],function(_0x4e4536){return{'model':db[_0x4e4536[_0xcc7e('0x21')]],'as':_0x4e4536['as'],'attributes':_0x4e4536[_0xcc7e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d3ecf){logger[_0xcc7e('0xf')]('ShowSquareOdbc',_0x584967);logger['debug'](_0xcc7e('0x19'),_0x584967,JSON[_0xcc7e('0x14')](_0x5d3ecf));_0x3d7c07(_0x5d3ecf);})[_0xcc7e('0x22')](function(_0x8e5804){logger[_0xcc7e('0x15')](_0xcc7e('0x19'),_0x8e5804['message'],_0x584967);_0x1de8be(_0x222aff[_0xcc7e('0x15')](0x1f4,_0x8e5804[_0xcc7e('0x17')]));});});}; \ No newline at end of file +var _0x696f=['include','map','model','catch','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x696f,0x1a8));var _0xf696=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x696f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf696('0x0'));var util=require(_0xf696('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf696('0x2'))['db'];var utils=require(_0xf696('0x3'));var logger=require('../../config/logger')(_0xf696('0x4'));var config=require(_0xf696('0x5'));var jayson=require(_0xf696('0x6'));var client=jayson[_0xf696('0x7')][_0xf696('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ce52f,_0x3d6994,_0x4c8650){return new BPromise(function(_0x28523e,_0x314c3d){return client[_0xf696('0x9')](_0x4ce52f,_0x4c8650)[_0xf696('0xa')](function(_0x557ca0){logger[_0xf696('0xb')](_0xf696('0xc'),_0x3d6994,'request\x20sent');logger[_0xf696('0xd')](_0xf696('0xe'),_0x3d6994,_0xf696('0xf'),JSON['stringify'](_0x557ca0));if(_0x557ca0[_0xf696('0x10')]){if(_0x557ca0['error'][_0xf696('0x11')]===0x1f4){logger[_0xf696('0x10')](_0xf696('0xc'),_0x3d6994,_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);return _0x314c3d(_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);}logger['error'](_0xf696('0xc'),_0x3d6994,_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);return _0x28523e(_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);}else{logger['info'](_0xf696('0xc'),_0x3d6994,'request\x20sent');_0x28523e(_0x557ca0[_0xf696('0x13')][_0xf696('0x12')]);}})['catch'](function(_0x4f1c3b){logger[_0xf696('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3d6994,_0x4f1c3b);_0x314c3d(_0x4f1c3b);});});}exports[_0xf696('0x14')]=function(_0x265c88){var _0x122d59=this;return new Promise(function(_0x3c7683,_0x49d196){return db[_0xf696('0x15')]['find']({'raw':_0x265c88[_0xf696('0x16')]?_0x265c88['options'][_0xf696('0x17')]===undefined?!![]:![]:!![],'where':_0x265c88['options']?_0x265c88[_0xf696('0x16')][_0xf696('0x18')]||null:null,'attributes':_0x265c88['options']?_0x265c88[_0xf696('0x16')][_0xf696('0x19')]||null:null,'include':_0x265c88[_0xf696('0x16')]?_0x265c88[_0xf696('0x16')][_0xf696('0x1a')]?_[_0xf696('0x1b')](_0x265c88[_0xf696('0x16')][_0xf696('0x1a')],function(_0x229037){return{'model':db[_0x229037[_0xf696('0x1c')]],'as':_0x229037['as'],'attributes':_0x229037[_0xf696('0x19')],'include':_0x229037[_0xf696('0x1a')]?_[_0xf696('0x1b')](_0x229037[_0xf696('0x1a')],function(_0x3c8e5a){return{'model':db[_0x3c8e5a[_0xf696('0x1c')]],'as':_0x3c8e5a['as'],'attributes':_0x3c8e5a[_0xf696('0x19')],'include':_0x3c8e5a[_0xf696('0x1a')]?_['map'](_0x3c8e5a[_0xf696('0x1a')],function(_0x56c77f){return{'model':db[_0x56c77f[_0xf696('0x1c')]],'as':_0x56c77f['as'],'attributes':_0x56c77f[_0xf696('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf696('0xa')](function(_0x204e18){logger[_0xf696('0xb')](_0xf696('0x14'),_0x265c88);logger['debug'](_0xf696('0x14'),_0x265c88,JSON['stringify'](_0x204e18));_0x3c7683(_0x204e18);})[_0xf696('0x1d')](function(_0xeaec40){logger[_0xf696('0x10')](_0xf696('0x14'),_0xeaec40[_0xf696('0x12')],_0x265c88);_0x49d196(_0x122d59['error'](0x1f4,_0xeaec40[_0xf696('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e422107..02787a7 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 _0x8d7a=['isAuthenticated','index','get','show','post','create','put','/:id','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0xe73e9e,_0x351c03){var _0x268981=function(_0x59907a){while(--_0x59907a){_0xe73e9e['push'](_0xe73e9e['shift']());}};_0x268981(++_0x351c03);}(_0x8d7a,0x179));var _0xa8d7=function(_0x3d6adf,_0x435573){_0x3d6adf=_0x3d6adf-0x0;var _0x50cc3f=_0x8d7a[_0x3d6adf];return _0x50cc3f;};'use strict';var multer=require(_0xa8d7('0x0'));var util=require('util');var path=require(_0xa8d7('0x1'));var timeout=require(_0xa8d7('0x2'));var express=require('express');var router=express[_0xa8d7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8d7('0x4'));var config=require(_0xa8d7('0x5'));var controller=require(_0xa8d7('0x6'));router['get']('/',auth[_0xa8d7('0x7')](),controller[_0xa8d7('0x8')]);router[_0xa8d7('0x9')]('/:id',auth[_0xa8d7('0x7')](),controller[_0xa8d7('0xa')]);router[_0xa8d7('0xb')]('/',auth['isAuthenticated'](),controller[_0xa8d7('0xc')]);router[_0xa8d7('0xd')]('/:id',auth[_0xa8d7('0x7')](),controller['update']);router['delete'](_0xa8d7('0xe'),auth[_0xa8d7('0x7')](),controller['destroy']);module[_0xa8d7('0xf')]=router; \ No newline at end of file +var _0xd821=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','show','post','put','/:id','update','delete'];(function(_0x10518c,_0x10d736){var _0x126166=function(_0x117cfc){while(--_0x117cfc){_0x10518c['push'](_0x10518c['shift']());}};_0x126166(++_0x10d736);}(_0xd821,0xb6));var _0x1d82=function(_0xd42c2b,_0x2ab8f7){_0xd42c2b=_0xd42c2b-0x0;var _0x59a230=_0xd821[_0xd42c2b];return _0x59a230;};'use strict';var multer=require('multer');var util=require(_0x1d82('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d82('0x1'));var router=express[_0x1d82('0x2')]();var fs_extra=require(_0x1d82('0x3'));var auth=require(_0x1d82('0x4'));var interaction=require(_0x1d82('0x5'));var config=require(_0x1d82('0x6'));var controller=require(_0x1d82('0x7'));router[_0x1d82('0x8')]('/',auth[_0x1d82('0x9')](),controller['index']);router[_0x1d82('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1d82('0xa')]);router[_0x1d82('0xb')]('/',auth[_0x1d82('0x9')](),controller['create']);router[_0x1d82('0xc')](_0x1d82('0xd'),auth['isAuthenticated'](),controller[_0x1d82('0xe')]);router[_0x1d82('0xf')]('/:id',auth[_0x1d82('0x9')](),controller[_0x1d82('0x10')]);module[_0x1d82('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index aea1a33..3084807 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 _0x0530=['preproduction','getDataValue','toString','utf8','production','DATE','sequelize','exports','name','TEXT','BLOB','long'];(function(_0x23ae89,_0x343c1d){var _0xe22a4a=function(_0x4a6057){while(--_0x4a6057){_0x23ae89['push'](_0x23ae89['shift']());}};_0xe22a4a(++_0x343c1d);}(_0x0530,0x72));var _0x0053=function(_0x501bf0,_0x4cda87){_0x501bf0=_0x501bf0-0x0;var _0x2bf5cc=_0x0530[_0x501bf0];return _0x2bf5cc;};'use strict';var Sequelize=require(_0x0053('0x0'));module[_0x0053('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0053('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x0053('0x3')]},'preproduction':{'type':Sequelize[_0x0053('0x4')](_0x0053('0x5')),'get':function(){if(this['getDataValue'](_0x0053('0x6'))){return this[_0x0053('0x7')](_0x0053('0x6'))[_0x0053('0x8')](_0x0053('0x9'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x0053('0x7')]('production')){return this[_0x0053('0x7')](_0x0053('0xa'))[_0x0053('0x8')]('utf8');}}},'savedAt':{'type':Sequelize[_0x0053('0xb')]},'publishedAt':{'type':Sequelize[_0x0053('0xb')]}}; \ No newline at end of file +var _0x9749=['exports','STRING','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long','production','DATE'];(function(_0x5d24b1,_0x33b379){var _0x56d0d2=function(_0x332388){while(--_0x332388){_0x5d24b1['push'](_0x5d24b1['shift']());}};_0x56d0d2(++_0x33b379);}(_0x9749,0x1e4));var _0x9974=function(_0x476ebb,_0x17a1aa){_0x476ebb=_0x476ebb-0x0;var _0x48618e=_0x9749[_0x476ebb];return _0x48618e;};'use strict';var Sequelize=require('sequelize');module[_0x9974('0x0')]={'name':{'type':Sequelize[_0x9974('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9974('0x1')]},'notes':{'type':Sequelize[_0x9974('0x2')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x9974('0x3')]('preproduction')){return this[_0x9974('0x3')](_0x9974('0x4'))[_0x9974('0x5')](_0x9974('0x6'));}}},'production':{'type':Sequelize[_0x9974('0x7')](_0x9974('0x8')),'get':function(){if(this['getDataValue'](_0x9974('0x9'))){return this[_0x9974('0x3')]('production')[_0x9974('0x5')]('utf8');}}},'savedAt':{'type':Sequelize[_0x9974('0xa')]},'publishedAt':{'type':Sequelize[_0x9974('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 502cb45..983447f 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 _0x8f25=['query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','name','includeAll','findAll','catch','show','params','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','agi','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./squareProject.socket','offset','limit','undefined','count','status','Content-Range','json','update','then','SquareProjects','UserProfileResource','destroy','stringify','end','sendStatus','error','stack','send','index','map','SquareProject','rawAttributes','fieldName','type','key'];(function(_0x3cefa1,_0x31a3c5){var _0x3beac8=function(_0x1b10d9){while(--_0x1b10d9){_0x3cefa1['push'](_0x3cefa1['shift']());}};_0x3beac8(++_0x31a3c5);}(_0x8f25,0x137));var _0x58f2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f25[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x58f2('0x0'));var Redis=require(_0x58f2('0x1'));var qs=require(_0x58f2('0x2'));var logger=require(_0x58f2('0x3'))(_0x58f2('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x58f2('0x5')]=_[_0x58f2('0x6')](config[_0x58f2('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x58f2('0x7'))(new Redis(config[_0x58f2('0x5')]));require(_0x58f2('0x8'))['register'](socket);function respondWithResult(_0x1a057f,_0x2e85e2){_0x2e85e2=_0x2e85e2||0xc8;return function(_0xce75d){if(_0xce75d){return _0x1a057f['status'](_0x2e85e2)['json'](_0xce75d);}};}function respondWithFilteredResult(_0x5b14b7,_0x2a81d0){return function(_0xf9440){if(_0xf9440){var _0x5ac768=typeof _0x2a81d0[_0x58f2('0x9')]==='undefined'&&typeof _0x2a81d0[_0x58f2('0xa')]===_0x58f2('0xb');var _0x1c4bb2=_0xf9440[_0x58f2('0xc')];var _0x352f05=_0x5ac768?0x0:_0x2a81d0['offset'];var _0x2e228a=_0x5ac768?_0xf9440[_0x58f2('0xc')]:_0x2a81d0[_0x58f2('0x9')]+_0x2a81d0[_0x58f2('0xa')];var _0x327375;if(_0x2e228a>=_0x1c4bb2){_0x2e228a=_0x1c4bb2;_0x327375=0xc8;}else{_0x327375=0xce;}_0x5b14b7[_0x58f2('0xd')](_0x327375);return _0x5b14b7['set'](_0x58f2('0xe'),_0x352f05+'-'+_0x2e228a+'/'+_0x1c4bb2)[_0x58f2('0xf')](_0xf9440);}return null;};}function saveUpdates(_0x2a2d34){return function(_0x151886){if(_0x151886){return _0x151886[_0x58f2('0x10')](_0x2a2d34)[_0x58f2('0x11')](function(_0x2d614b){return _0x2d614b;});}return null;};}function removeEntity(_0x35481d){return function(_0xfb26f6){if(_0xfb26f6){return _0xfb26f6['destroy']()[_0x58f2('0x11')](function(){var _0x43cce2=_0xfb26f6['get']({'plain':!![]});var _0x3f3986=_0x58f2('0x12');return db[_0x58f2('0x13')][_0x58f2('0x14')]({'where':{'type':_0x3f3986,'resourceId':_0x43cce2['id']}})[_0x58f2('0x11')](function(){return _0xfb26f6;});})['then'](function(){var _0x26a845=new Redis(config[_0x58f2('0x5')]);_0x26a845['publish']('agi',JSON[_0x58f2('0x15')]({'id':_0xfb26f6['id'],'deleted':!![]}));})[_0x58f2('0x11')](function(){_0x35481d['status'](0xcc)[_0x58f2('0x16')]();});}};}function handleEntityNotFound(_0x4637e5){return function(_0x5cbba8){if(!_0x5cbba8){_0x4637e5[_0x58f2('0x17')](0x194);}return _0x5cbba8;};}function handleError(_0x5a194d,_0x40dbcd){_0x40dbcd=_0x40dbcd||0x1f4;return function(_0x3b9581){logger[_0x58f2('0x18')](_0x3b9581[_0x58f2('0x19')]);if(_0x3b9581['name']){delete _0x3b9581['name'];}_0x5a194d[_0x58f2('0xd')](_0x40dbcd)[_0x58f2('0x1a')](_0x3b9581);};}exports[_0x58f2('0x1b')]=function(_0x5c9f86,_0x1cb178){var _0x1b1788={},_0x13b53e={},_0x4a7f0b={'count':0x0,'rows':[]};var _0x37a702=_[_0x58f2('0x1c')](db[_0x58f2('0x1d')][_0x58f2('0x1e')],function(_0x2b24a3){return{'name':_0x2b24a3[_0x58f2('0x1f')],'type':_0x2b24a3[_0x58f2('0x20')][_0x58f2('0x21')]};});_0x13b53e['model']=_['map'](_0x37a702,'name');_0x13b53e[_0x58f2('0x22')]=_[_0x58f2('0x23')](_0x5c9f86[_0x58f2('0x22')]);_0x13b53e['filters']=_[_0x58f2('0x24')](_0x13b53e['model'],_0x13b53e[_0x58f2('0x22')]);_0x1b1788[_0x58f2('0x25')]=_['intersection'](_0x13b53e[_0x58f2('0x26')],qs[_0x58f2('0x27')](_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x27')]));_0x1b1788[_0x58f2('0x25')]=_0x1b1788[_0x58f2('0x25')][_0x58f2('0x28')]?_0x1b1788[_0x58f2('0x25')]:_0x13b53e[_0x58f2('0x26')];if(!_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x29')](_0x58f2('0x2a'))){_0x1b1788[_0x58f2('0xa')]=qs[_0x58f2('0xa')](_0x5c9f86['query'][_0x58f2('0xa')]);_0x1b1788['offset']=qs[_0x58f2('0x9')](_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x9')]);}_0x1b1788[_0x58f2('0x2b')]=qs[_0x58f2('0x2c')](_0x5c9f86[_0x58f2('0x22')]['sort']);_0x1b1788[_0x58f2('0x2d')]=qs['filters'](_[_0x58f2('0x2e')](_0x5c9f86['query'],_0x13b53e[_0x58f2('0x2f')]),_0x37a702);if(_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x30')]){_0x1b1788[_0x58f2('0x2d')]=_['merge'](_0x1b1788[_0x58f2('0x2d')],{'$or':_['map'](_0x37a702,function(_0x42c298){if(_0x42c298['type']!==_0x58f2('0x31')){var _0x2a4638={};_0x2a4638[_0x42c298[_0x58f2('0x32')]]={'$like':'%'+_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x30')]+'%'};return _0x2a4638;}})});}_0x1b1788=_['merge']({},_0x1b1788,_0x5c9f86['options']);var _0x2ca4c0={'where':_0x1b1788['where']};return db[_0x58f2('0x1d')]['count'](_0x2ca4c0)[_0x58f2('0x11')](function(_0x3914cf){_0x4a7f0b['count']=_0x3914cf;if(_0x5c9f86[_0x58f2('0x22')][_0x58f2('0x33')]){_0x1b1788['include']=[{'all':!![]}];}return db[_0x58f2('0x1d')][_0x58f2('0x34')](_0x1b1788);})['then'](function(_0x348e26){_0x4a7f0b['rows']=_0x348e26;return _0x4a7f0b;})[_0x58f2('0x11')](respondWithFilteredResult(_0x1cb178,_0x1b1788))[_0x58f2('0x35')](handleError(_0x1cb178,null));};exports[_0x58f2('0x36')]=function(_0x485953,_0x22db11){var _0x4b6f8f={'raw':![],'where':{'id':_0x485953[_0x58f2('0x37')]['id']}},_0x11abc5={};_0x11abc5[_0x58f2('0x26')]=_['keys'](db['SquareProject'][_0x58f2('0x1e')]);_0x11abc5['query']=_[_0x58f2('0x23')](_0x485953[_0x58f2('0x22')]);_0x11abc5[_0x58f2('0x2f')]=_['intersection'](_0x11abc5[_0x58f2('0x26')],_0x11abc5['query']);_0x4b6f8f[_0x58f2('0x25')]=_[_0x58f2('0x24')](_0x11abc5['model'],qs[_0x58f2('0x27')](_0x485953['query'][_0x58f2('0x27')]));_0x4b6f8f['attributes']=_0x4b6f8f[_0x58f2('0x25')][_0x58f2('0x28')]?_0x4b6f8f[_0x58f2('0x25')]:_0x11abc5[_0x58f2('0x26')];if(_0x485953[_0x58f2('0x22')][_0x58f2('0x33')]){_0x4b6f8f['include']=[{'all':!![]}];}_0x4b6f8f=_[_0x58f2('0x38')]({},_0x4b6f8f,_0x485953[_0x58f2('0x39')]);return db['SquareProject'][_0x58f2('0x3a')](_0x4b6f8f)[_0x58f2('0x11')](handleEntityNotFound(_0x22db11,null))[_0x58f2('0x11')](respondWithResult(_0x22db11,null))[_0x58f2('0x35')](handleError(_0x22db11,null));};exports[_0x58f2('0x3b')]=function(_0x40bec0,_0x438643){return db['SquareProject'][_0x58f2('0x3b')](_0x40bec0[_0x58f2('0x3c')],{})[_0x58f2('0x11')](function(_0x413c89){var _0xf60947=_0x40bec0[_0x58f2('0x3d')][_0x58f2('0x3e')]({'plain':!![]});if(!_0xf60947)throw new Error(_0x58f2('0x3f'));if(_0xf60947[_0x58f2('0x40')]==='user'){var _0x176812=_0x413c89[_0x58f2('0x3e')]({'plain':!![]});var _0x3480e4=_0x58f2('0x12');return db[_0x58f2('0x41')][_0x58f2('0x3a')]({'where':{'name':_0x3480e4,'userProfileId':_0xf60947[_0x58f2('0x42')]},'raw':!![]})['then'](function(_0x4f6d8c){if(_0x4f6d8c&&_0x4f6d8c['autoAssociation']===0x0){return db[_0x58f2('0x13')][_0x58f2('0x3b')]({'name':_0x176812[_0x58f2('0x32')],'resourceId':_0x176812['id'],'type':_0x4f6d8c[_0x58f2('0x32')],'sectionId':_0x4f6d8c['id']},{})[_0x58f2('0x11')](function(){return _0x413c89;});}else{return _0x413c89;}})[_0x58f2('0x35')](function(_0x2a321f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a321f);throw _0x2a321f;});}return _0x413c89;})[_0x58f2('0x11')](respondWithResult(_0x438643,0xc9))[_0x58f2('0x35')](handleError(_0x438643,null));};exports[_0x58f2('0x10')]=function(_0x5cc9c7,_0x27483d){if(_0x5cc9c7[_0x58f2('0x3c')]['id']){delete _0x5cc9c7['body']['id'];}return db[_0x58f2('0x1d')][_0x58f2('0x3a')]({'where':{'id':_0x5cc9c7[_0x58f2('0x37')]['id']}})[_0x58f2('0x11')](handleEntityNotFound(_0x27483d,null))[_0x58f2('0x11')](saveUpdates(_0x5cc9c7['body'],null))[_0x58f2('0x11')](function(_0x180199){if(!_0x180199)return;var _0x28e833=_0x180199[_0x58f2('0x3e')]({'plain':!![]});return _0x28e833;})['then'](function(_0x546de9){var _0x399f12=new Redis(config[_0x58f2('0x5')]);_0x399f12['publish'](_0x58f2('0x43'),JSON[_0x58f2('0x15')](_[_0x58f2('0x2e')](_0x546de9,['id',_0x58f2('0x32'),_0x58f2('0x44')])));return _0x546de9;})[_0x58f2('0x11')](respondWithResult(_0x27483d,null))[_0x58f2('0x35')](handleError(_0x27483d,null));};exports[_0x58f2('0x14')]=function(_0x4fb212,_0x433fc4){return db[_0x58f2('0x1d')][_0x58f2('0x3a')]({'where':{'id':_0x4fb212[_0x58f2('0x37')]['id']}})['then'](handleEntityNotFound(_0x433fc4,null))[_0x58f2('0x11')](removeEntity(_0x433fc4,null))[_0x58f2('0x35')](handleError(_0x433fc4,null));}; \ No newline at end of file +var _0xc4a7=['hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','name','send','map','SquareProject','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x38ad10,_0x1f2749){var _0x83bcce=function(_0x4569c0){while(--_0x4569c0){_0x38ad10['push'](_0x38ad10['shift']());}};_0x83bcce(++_0x1f2749);}(_0xc4a7,0xae));var _0x7c4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4a7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7c4a('0x0'));var Redis=require('ioredis');var qs=require(_0x7c4a('0x1'));var logger=require(_0x7c4a('0x2'))('api');var config=require(_0x7c4a('0x3'));var db=require(_0x7c4a('0x4'))['db'];config[_0x7c4a('0x5')]=_[_0x7c4a('0x6')](config[_0x7c4a('0x5')],{'host':_0x7c4a('0x7'),'port':0x18eb});var socket=require(_0x7c4a('0x8'))(new Redis(config[_0x7c4a('0x5')]));require(_0x7c4a('0x9'))[_0x7c4a('0xa')](socket);function respondWithResult(_0x144c5f,_0x2e5cda){_0x2e5cda=_0x2e5cda||0xc8;return function(_0x3fa060){if(_0x3fa060){return _0x144c5f[_0x7c4a('0xb')](_0x2e5cda)[_0x7c4a('0xc')](_0x3fa060);}};}function respondWithFilteredResult(_0x4c2b2a,_0x204e0c){return function(_0x2ee78d){if(_0x2ee78d){var _0x3233a6=typeof _0x204e0c[_0x7c4a('0xd')]===_0x7c4a('0xe')&&typeof _0x204e0c[_0x7c4a('0xf')]===_0x7c4a('0xe');var _0x1386eb=_0x2ee78d[_0x7c4a('0x10')];var _0x17e9b8=_0x3233a6?0x0:_0x204e0c[_0x7c4a('0xd')];var _0x2859de=_0x3233a6?_0x2ee78d['count']:_0x204e0c[_0x7c4a('0xd')]+_0x204e0c[_0x7c4a('0xf')];var _0x22a362;if(_0x2859de>=_0x1386eb){_0x2859de=_0x1386eb;_0x22a362=0xc8;}else{_0x22a362=0xce;}_0x4c2b2a[_0x7c4a('0xb')](_0x22a362);return _0x4c2b2a[_0x7c4a('0x11')](_0x7c4a('0x12'),_0x17e9b8+'-'+_0x2859de+'/'+_0x1386eb)[_0x7c4a('0xc')](_0x2ee78d);}return null;};}function saveUpdates(_0x343dd8){return function(_0x5227a7){if(_0x5227a7){return _0x5227a7[_0x7c4a('0x13')](_0x343dd8)[_0x7c4a('0x14')](function(_0x467c58){return _0x467c58;});}return null;};}function removeEntity(_0x549884){return function(_0x5da5ea){if(_0x5da5ea){return _0x5da5ea[_0x7c4a('0x15')]()[_0x7c4a('0x14')](function(){var _0x11de1c=_0x5da5ea[_0x7c4a('0x16')]({'plain':!![]});var _0x45854b=_0x7c4a('0x17');return db[_0x7c4a('0x18')][_0x7c4a('0x15')]({'where':{'type':_0x45854b,'resourceId':_0x11de1c['id']}})[_0x7c4a('0x14')](function(){return _0x5da5ea;});})['then'](function(){var _0x542480=new Redis(config[_0x7c4a('0x5')]);_0x542480[_0x7c4a('0x19')](_0x7c4a('0x1a'),JSON[_0x7c4a('0x1b')]({'id':_0x5da5ea['id'],'deleted':!![]}));})[_0x7c4a('0x14')](function(){_0x549884['status'](0xcc)[_0x7c4a('0x1c')]();});}};}function handleEntityNotFound(_0x113fc8){return function(_0x2ebf56){if(!_0x2ebf56){_0x113fc8[_0x7c4a('0x1d')](0x194);}return _0x2ebf56;};}function handleError(_0x1d0026,_0x4b6a10){_0x4b6a10=_0x4b6a10||0x1f4;return function(_0x109148){logger[_0x7c4a('0x1e')](_0x109148['stack']);if(_0x109148[_0x7c4a('0x1f')]){delete _0x109148[_0x7c4a('0x1f')];}_0x1d0026[_0x7c4a('0xb')](_0x4b6a10)[_0x7c4a('0x20')](_0x109148);};}exports['index']=function(_0x4dff70,_0x1d9bb9){var _0x715a5f={},_0x207f5c={},_0x187273={'count':0x0,'rows':[]};var _0xa2d5e0=_[_0x7c4a('0x21')](db[_0x7c4a('0x22')]['rawAttributes'],function(_0x3fc425){return{'name':_0x3fc425[_0x7c4a('0x23')],'type':_0x3fc425[_0x7c4a('0x24')][_0x7c4a('0x25')]};});_0x207f5c[_0x7c4a('0x26')]=_[_0x7c4a('0x21')](_0xa2d5e0,_0x7c4a('0x1f'));_0x207f5c[_0x7c4a('0x27')]=_[_0x7c4a('0x28')](_0x4dff70[_0x7c4a('0x27')]);_0x207f5c[_0x7c4a('0x29')]=_[_0x7c4a('0x2a')](_0x207f5c[_0x7c4a('0x26')],_0x207f5c[_0x7c4a('0x27')]);_0x715a5f['attributes']=_[_0x7c4a('0x2a')](_0x207f5c[_0x7c4a('0x26')],qs[_0x7c4a('0x2b')](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x2b')]));_0x715a5f[_0x7c4a('0x2c')]=_0x715a5f[_0x7c4a('0x2c')]['length']?_0x715a5f['attributes']:_0x207f5c[_0x7c4a('0x26')];if(!_0x4dff70['query'][_0x7c4a('0x2d')]('nolimit')){_0x715a5f['limit']=qs['limit'](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0xf')]);_0x715a5f['offset']=qs[_0x7c4a('0xd')](_0x4dff70['query'][_0x7c4a('0xd')]);}_0x715a5f[_0x7c4a('0x2e')]=qs[_0x7c4a('0x2f')](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x2f')]);_0x715a5f['where']=qs[_0x7c4a('0x29')](_[_0x7c4a('0x30')](_0x4dff70['query'],_0x207f5c[_0x7c4a('0x29')]),_0xa2d5e0);if(_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x31')]){_0x715a5f[_0x7c4a('0x32')]=_[_0x7c4a('0x33')](_0x715a5f['where'],{'$or':_[_0x7c4a('0x21')](_0xa2d5e0,function(_0x318b6d){if(_0x318b6d[_0x7c4a('0x24')]!==_0x7c4a('0x34')){var _0x472190={};_0x472190[_0x318b6d[_0x7c4a('0x1f')]]={'$like':'%'+_0x4dff70['query'][_0x7c4a('0x31')]+'%'};return _0x472190;}})});}_0x715a5f=_[_0x7c4a('0x33')]({},_0x715a5f,_0x4dff70[_0x7c4a('0x35')]);var _0x27cc29={'where':_0x715a5f[_0x7c4a('0x32')]};return db[_0x7c4a('0x22')][_0x7c4a('0x10')](_0x27cc29)['then'](function(_0x360f3a){_0x187273['count']=_0x360f3a;if(_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x36')]){_0x715a5f[_0x7c4a('0x37')]=[{'all':!![]}];}return db[_0x7c4a('0x22')][_0x7c4a('0x38')](_0x715a5f);})['then'](function(_0x46a168){_0x187273[_0x7c4a('0x39')]=_0x46a168;return _0x187273;})[_0x7c4a('0x14')](respondWithFilteredResult(_0x1d9bb9,_0x715a5f))[_0x7c4a('0x3a')](handleError(_0x1d9bb9,null));};exports[_0x7c4a('0x3b')]=function(_0x5746da,_0xc6725a){var _0x11f9aa={'raw':![],'where':{'id':_0x5746da[_0x7c4a('0x3c')]['id']}},_0x4fa0c3={};_0x4fa0c3[_0x7c4a('0x26')]=_['keys'](db[_0x7c4a('0x22')][_0x7c4a('0x3d')]);_0x4fa0c3[_0x7c4a('0x27')]=_[_0x7c4a('0x28')](_0x5746da[_0x7c4a('0x27')]);_0x4fa0c3[_0x7c4a('0x29')]=_[_0x7c4a('0x2a')](_0x4fa0c3['model'],_0x4fa0c3[_0x7c4a('0x27')]);_0x11f9aa[_0x7c4a('0x2c')]=_[_0x7c4a('0x2a')](_0x4fa0c3['model'],qs['fields'](_0x5746da[_0x7c4a('0x27')][_0x7c4a('0x2b')]));_0x11f9aa[_0x7c4a('0x2c')]=_0x11f9aa[_0x7c4a('0x2c')]['length']?_0x11f9aa[_0x7c4a('0x2c')]:_0x4fa0c3['model'];if(_0x5746da[_0x7c4a('0x27')]['includeAll']){_0x11f9aa[_0x7c4a('0x37')]=[{'all':!![]}];}_0x11f9aa=_['merge']({},_0x11f9aa,_0x5746da[_0x7c4a('0x35')]);return db[_0x7c4a('0x22')][_0x7c4a('0x3e')](_0x11f9aa)[_0x7c4a('0x14')](handleEntityNotFound(_0xc6725a,null))[_0x7c4a('0x14')](respondWithResult(_0xc6725a,null))[_0x7c4a('0x3a')](handleError(_0xc6725a,null));};exports[_0x7c4a('0x3f')]=function(_0x2527d5,_0x5b464a){return db[_0x7c4a('0x22')][_0x7c4a('0x3f')](_0x2527d5['body'],{})[_0x7c4a('0x14')](function(_0x13c5a0){var _0x2b049e=_0x2527d5[_0x7c4a('0x40')]['get']({'plain':!![]});if(!_0x2b049e)throw new Error(_0x7c4a('0x41'));if(_0x2b049e[_0x7c4a('0x42')]===_0x7c4a('0x40')){var _0x3c82dd=_0x13c5a0[_0x7c4a('0x16')]({'plain':!![]});var _0x195afd=_0x7c4a('0x17');return db[_0x7c4a('0x43')][_0x7c4a('0x3e')]({'where':{'name':_0x195afd,'userProfileId':_0x2b049e[_0x7c4a('0x44')]},'raw':!![]})['then'](function(_0x22b148){if(_0x22b148&&_0x22b148[_0x7c4a('0x45')]===0x0){return db['UserProfileResource'][_0x7c4a('0x3f')]({'name':_0x3c82dd['name'],'resourceId':_0x3c82dd['id'],'type':_0x22b148[_0x7c4a('0x1f')],'sectionId':_0x22b148['id']},{})[_0x7c4a('0x14')](function(){return _0x13c5a0;});}else{return _0x13c5a0;}})[_0x7c4a('0x3a')](function(_0x227b1c){logger[_0x7c4a('0x1e')](_0x7c4a('0x46'),_0x227b1c);throw _0x227b1c;});}return _0x13c5a0;})[_0x7c4a('0x14')](respondWithResult(_0x5b464a,0xc9))['catch'](handleError(_0x5b464a,null));};exports[_0x7c4a('0x13')]=function(_0x2b3619,_0x335abb){if(_0x2b3619[_0x7c4a('0x47')]['id']){delete _0x2b3619['body']['id'];}return db[_0x7c4a('0x22')]['find']({'where':{'id':_0x2b3619[_0x7c4a('0x3c')]['id']}})[_0x7c4a('0x14')](handleEntityNotFound(_0x335abb,null))[_0x7c4a('0x14')](saveUpdates(_0x2b3619[_0x7c4a('0x47')],null))[_0x7c4a('0x14')](function(_0x51211f){if(!_0x51211f)return;var _0x58523b=_0x51211f[_0x7c4a('0x16')]({'plain':!![]});return _0x58523b;})[_0x7c4a('0x14')](function(_0x3f96ba){var _0x22a21f=new Redis(config['redis']);_0x22a21f[_0x7c4a('0x19')]('agi',JSON[_0x7c4a('0x1b')](_['pick'](_0x3f96ba,['id','name',_0x7c4a('0x48')])));return _0x3f96ba;})['then'](respondWithResult(_0x335abb,null))[_0x7c4a('0x3a')](handleError(_0x335abb,null));};exports[_0x7c4a('0x15')]=function(_0x44b189,_0x519a6b){return db[_0x7c4a('0x22')]['find']({'where':{'id':_0x44b189[_0x7c4a('0x3c')]['id']}})[_0x7c4a('0x14')](handleEntityNotFound(_0x519a6b,null))['then'](removeEntity(_0x519a6b,null))[_0x7c4a('0x3a')](handleError(_0x519a6b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 127b31f..953daaf 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 _0xfdf1=['events','../../mysqldb','SquareProject','save','update','remove','emit','hook'];(function(_0x4a699b,_0x461d1f){var _0x5e0cc6=function(_0x100767){while(--_0x100767){_0x4a699b['push'](_0x4a699b['shift']());}};_0x5e0cc6(++_0x461d1f);}(_0xfdf1,0x160));var _0x1fdf=function(_0x28f948,_0x4c7517){_0x28f948=_0x28f948-0x0;var _0x1cd51a=_0xfdf1[_0x28f948];return _0x1cd51a;};'use strict';var EventEmitter=require(_0x1fdf('0x0'));var SquareProject=require(_0x1fdf('0x1'))['db'][_0x1fdf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1fdf('0x3'),'afterUpdate':_0x1fdf('0x4'),'afterDestroy':_0x1fdf('0x5')};function emitEvent(_0x3123e2){return function(_0x13d6f7,_0x3a9d27,_0x517686){SquareProjectEvents['emit'](_0x3123e2+':'+_0x13d6f7['id'],_0x13d6f7);SquareProjectEvents[_0x1fdf('0x6')](_0x3123e2,_0x13d6f7);_0x517686(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x1fdf('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x5511=['events','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x144e1d,_0x409a01){var _0x15fc15=function(_0x58b87f){while(--_0x58b87f){_0x144e1d['push'](_0x144e1d['shift']());}};_0x15fc15(++_0x409a01);}(_0x5511,0x1ce));var _0x1551=function(_0x44df7c,_0x4eea04){_0x44df7c=_0x44df7c-0x0;var _0x96d079=_0x5511[_0x44df7c];return _0x96d079;};'use strict';var EventEmitter=require(_0x1551('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1551('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1551('0x2'),'afterDestroy':'remove'};function emitEvent(_0xb48652){return function(_0x1c94ca,_0x28d623,_0x498ce0){SquareProjectEvents['emit'](_0xb48652+':'+_0x1c94ca['id'],_0x1c94ca);SquareProjectEvents[_0x1551('0x3')](_0xb48652,_0x1c94ca);_0x498ce0(null);};}for(var e in events){if(events[_0x1551('0x4')](e)){var event=events[e];SquareProject[_0x1551('0x5')](e,emitEvent(event));}}module[_0x1551('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c3d15f4..bb92662 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 _0x7def=['changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','format','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x31a0b4,_0x5072d7){var _0xeff62c=function(_0x11a7c5){while(--_0x11a7c5){_0x31a0b4['push'](_0x31a0b4['shift']());}};_0xeff62c(++_0x5072d7);}(_0x7def,0x74));var _0xf7de=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7def[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0xf7de('0x0'));var util=require('util');var logger=require(_0xf7de('0x1'))(_0xf7de('0x2'));var moment=require('moment');var BPromise=require(_0xf7de('0x3'));var rp=require(_0xf7de('0x4'));var fs=require('fs');var path=require(_0xf7de('0x5'));var rimraf=require(_0xf7de('0x6'));var config=require(_0xf7de('0x7'));var attributes=require(_0xf7de('0x8'));module[_0xf7de('0x9')]=function(_0x1348b2,_0x5feecb){return _0x1348b2[_0xf7de('0xa')](_0xf7de('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11937a,_0x1858f0,_0x5e60d9){if(_0x11937a[_0xf7de('0xc')]('preproduction')){_0x11937a[_0xf7de('0xd')]=moment()['format'](_0xf7de('0xe'));}if(_0x11937a[_0xf7de('0xc')]('production')){_0x11937a['publishedAt']=moment()[_0xf7de('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e60d9(null,_0x11937a);}}});}; \ No newline at end of file +var _0xd19b=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0xd19b,0x90));var _0xbd19=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xd19b[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0xbd19('0x0'));var util=require(_0xbd19('0x1'));var logger=require(_0xbd19('0x2'))(_0xbd19('0x3'));var moment=require(_0xbd19('0x4'));var BPromise=require(_0xbd19('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd19('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xbd19('0x7')]=function(_0x5e8627,_0x58c5e9){return _0x5e8627[_0xbd19('0x8')](_0xbd19('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54171f,_0x16900d,_0x4bd9e5){if(_0x54171f[_0xbd19('0xa')](_0xbd19('0xb'))){_0x54171f[_0xbd19('0xc')]=moment()['format'](_0xbd19('0xd'));}if(_0x54171f[_0xbd19('0xa')]('production')){_0x54171f[_0xbd19('0xe')]=moment()[_0xbd19('0xf')](_0xbd19('0xd'));}_0x4bd9e5(null,_0x54171f);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 688c51e..b9c6e0e 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 _0x9dfd=['socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','attributes','limit','map','model','include','then','info','catch','error','message','SquareProject','where','ShowSquareProject','debug','stringify','lodash','rpc','../../config/environment','redis','defaults','localhost'];(function(_0x1fdce6,_0x4412d9){var _0x36b546=function(_0x1bf3bb){while(--_0x1bf3bb){_0x1fdce6['push'](_0x1fdce6['shift']());}};_0x36b546(++_0x4412d9);}(_0x9dfd,0x19e));var _0xd9df=function(_0x520a29,_0x311afb){_0x520a29=_0x520a29-0x0;var _0x243269=_0x9dfd[_0x520a29];return _0x243269;};'use strict';var _=require(_0xd9df('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xd9df('0x1'));var config=require(_0xd9df('0x2'));config[_0xd9df('0x3')]=_[_0xd9df('0x4')](config[_0xd9df('0x3')],{'host':_0xd9df('0x5'),'port':0x18eb});var socket=require(_0xd9df('0x6'))(new Redis(config[_0xd9df('0x3')]));require(_0xd9df('0x7'))[_0xd9df('0x8')](socket);exports[_0xd9df('0x9')]=function(_0x1502eb){var _0x56bdc3=this;return new Promise(function(_0x261743,_0x57c135){return db['SquareProject'][_0xd9df('0xa')]({'raw':_0x1502eb[_0xd9df('0xb')]?_0x1502eb['options'][_0xd9df('0xc')]===undefined?!![]:![]:!![],'where':_0x1502eb[_0xd9df('0xb')]?_0x1502eb[_0xd9df('0xb')]['where']||null:null,'attributes':_0x1502eb[_0xd9df('0xb')]?_0x1502eb[_0xd9df('0xb')][_0xd9df('0xd')]||null:null,'limit':_0x1502eb[_0xd9df('0xb')]?_0x1502eb[_0xd9df('0xb')][_0xd9df('0xe')]||null:null,'include':_0x1502eb[_0xd9df('0xb')]?_0x1502eb['options']['include']?_[_0xd9df('0xf')](_0x1502eb[_0xd9df('0xb')]['include'],function(_0x116391){return{'model':db[_0x116391[_0xd9df('0x10')]],'as':_0x116391['as'],'attributes':_0x116391['attributes'],'include':_0x116391['include']?_[_0xd9df('0xf')](_0x116391[_0xd9df('0x11')],function(_0x5323ce){return{'model':db[_0x5323ce['model']],'as':_0x5323ce['as'],'attributes':_0x5323ce[_0xd9df('0xd')],'include':_0x5323ce[_0xd9df('0x11')]?_[_0xd9df('0xf')](_0x5323ce[_0xd9df('0x11')],function(_0x1e06e7){return{'model':db[_0x1e06e7[_0xd9df('0x10')]],'as':_0x1e06e7['as'],'attributes':_0x1e06e7[_0xd9df('0xd')]};}):[]};}):[]};}):[]:[]})[_0xd9df('0x12')](function(_0x167fcf){logger[_0xd9df('0x13')]('GetSquareProjects',_0x1502eb);logger['debug'](_0xd9df('0x9'),_0x1502eb,JSON['stringify'](_0x167fcf));_0x261743(_0x167fcf);})[_0xd9df('0x14')](function(_0x5e5078){logger[_0xd9df('0x15')](_0xd9df('0x9'),_0x5e5078[_0xd9df('0x16')],_0x1502eb);_0x57c135(_0x56bdc3[_0xd9df('0x15')](0x1f4,_0x5e5078[_0xd9df('0x16')]));});});};exports['ShowSquareProject']=function(_0x12b73e){var _0x4f2ae0=this;return new Promise(function(_0x1c5756,_0x5bbdc3){return db[_0xd9df('0x17')]['find']({'raw':_0x12b73e[_0xd9df('0xb')]?_0x12b73e[_0xd9df('0xb')][_0xd9df('0xc')]===undefined?!![]:![]:!![],'where':_0x12b73e[_0xd9df('0xb')]?_0x12b73e[_0xd9df('0xb')][_0xd9df('0x18')]||null:null,'attributes':_0x12b73e[_0xd9df('0xb')]?_0x12b73e['options'][_0xd9df('0xd')]||null:null,'include':_0x12b73e['options']?_0x12b73e[_0xd9df('0xb')]['include']?_[_0xd9df('0xf')](_0x12b73e[_0xd9df('0xb')][_0xd9df('0x11')],function(_0x1caa5d){return{'model':db[_0x1caa5d[_0xd9df('0x10')]],'as':_0x1caa5d['as'],'attributes':_0x1caa5d[_0xd9df('0xd')],'include':_0x1caa5d[_0xd9df('0x11')]?_['map'](_0x1caa5d[_0xd9df('0x11')],function(_0x1fb41f){return{'model':db[_0x1fb41f['model']],'as':_0x1fb41f['as'],'attributes':_0x1fb41f[_0xd9df('0xd')],'include':_0x1fb41f[_0xd9df('0x11')]?_[_0xd9df('0xf')](_0x1fb41f[_0xd9df('0x11')],function(_0x145359){return{'model':db[_0x145359['model']],'as':_0x145359['as'],'attributes':_0x145359[_0xd9df('0xd')]};}):[]};}):[]};}):[]:[]})[_0xd9df('0x12')](function(_0x5cd275){logger['info'](_0xd9df('0x19'),_0x12b73e);logger[_0xd9df('0x1a')](_0xd9df('0x19'),_0x12b73e,JSON[_0xd9df('0x1b')](_0x5cd275));_0x1c5756(_0x5cd275);})[_0xd9df('0x14')](function(_0x40cffc){logger[_0xd9df('0x15')](_0xd9df('0x19'),_0x40cffc[_0xd9df('0x16')],_0x12b73e);_0x5bbdc3(_0x4f2ae0['error'](0x1f4,_0x40cffc['message']));});});}; \ No newline at end of file +var _0x299c=['../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','error','ShowSquareProject','find','where','catch','message','lodash','ioredis','../../mysqldb'];(function(_0x4e0b8c,_0x443f31){var _0x633ecc=function(_0x1f1f36){while(--_0x1f1f36){_0x4e0b8c['push'](_0x4e0b8c['shift']());}};_0x633ecc(++_0x443f31);}(_0x299c,0xb1));var _0xc299=function(_0x39be73,_0x31a022){_0x39be73=_0x39be73-0x0;var _0x14b572=_0x299c[_0x39be73];return _0x14b572;};'use strict';var _=require(_0xc299('0x0'));var Redis=require(_0xc299('0x1'));var db=require(_0xc299('0x2'))['db'];var logger=require(_0xc299('0x3'))('rpc');var config=require(_0xc299('0x4'));config[_0xc299('0x5')]=_[_0xc299('0x6')](config[_0xc299('0x5')],{'host':_0xc299('0x7'),'port':0x18eb});var socket=require(_0xc299('0x8'))(new Redis(config[_0xc299('0x5')]));require('./squareProject.socket')[_0xc299('0x9')](socket);exports[_0xc299('0xa')]=function(_0x306577){var _0x1c5c9c=this;return new Promise(function(_0x39824e,_0x18f2b6){return db[_0xc299('0xb')][_0xc299('0xc')]({'raw':_0x306577['options']?_0x306577[_0xc299('0xd')][_0xc299('0xe')]===undefined?!![]:![]:!![],'where':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')]['where']||null:null,'attributes':_0x306577[_0xc299('0xd')]?_0x306577['options'][_0xc299('0xf')]||null:null,'limit':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')][_0xc299('0x10')]||null:null,'include':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')]['include']?_['map'](_0x306577[_0xc299('0xd')][_0xc299('0x11')],function(_0x59a2ce){return{'model':db[_0x59a2ce[_0xc299('0x12')]],'as':_0x59a2ce['as'],'attributes':_0x59a2ce['attributes'],'include':_0x59a2ce['include']?_[_0xc299('0x13')](_0x59a2ce[_0xc299('0x11')],function(_0x33cc1e){return{'model':db[_0x33cc1e['model']],'as':_0x33cc1e['as'],'attributes':_0x33cc1e[_0xc299('0xf')],'include':_0x33cc1e['include']?_['map'](_0x33cc1e[_0xc299('0x11')],function(_0x12dc08){return{'model':db[_0x12dc08[_0xc299('0x12')]],'as':_0x12dc08['as'],'attributes':_0x12dc08[_0xc299('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc299('0x14')](function(_0x323820){logger[_0xc299('0x15')](_0xc299('0xa'),_0x306577);logger[_0xc299('0x16')](_0xc299('0xa'),_0x306577,JSON[_0xc299('0x17')](_0x323820));_0x39824e(_0x323820);})['catch'](function(_0x26a80c){logger['error'](_0xc299('0xa'),_0x26a80c['message'],_0x306577);_0x18f2b6(_0x1c5c9c[_0xc299('0x18')](0x1f4,_0x26a80c['message']));});});};exports[_0xc299('0x19')]=function(_0x432588){var _0x494fa5=this;return new Promise(function(_0x3896d8,_0x4733da){return db['SquareProject'][_0xc299('0x1a')]({'raw':_0x432588['options']?_0x432588['options'][_0xc299('0xe')]===undefined?!![]:![]:!![],'where':_0x432588[_0xc299('0xd')]?_0x432588[_0xc299('0xd')][_0xc299('0x1b')]||null:null,'attributes':_0x432588['options']?_0x432588[_0xc299('0xd')]['attributes']||null:null,'include':_0x432588[_0xc299('0xd')]?_0x432588[_0xc299('0xd')][_0xc299('0x11')]?_[_0xc299('0x13')](_0x432588['options']['include'],function(_0x16091c){return{'model':db[_0x16091c['model']],'as':_0x16091c['as'],'attributes':_0x16091c[_0xc299('0xf')],'include':_0x16091c['include']?_[_0xc299('0x13')](_0x16091c[_0xc299('0x11')],function(_0x2f84b8){return{'model':db[_0x2f84b8[_0xc299('0x12')]],'as':_0x2f84b8['as'],'attributes':_0x2f84b8[_0xc299('0xf')],'include':_0x2f84b8[_0xc299('0x11')]?_['map'](_0x2f84b8[_0xc299('0x11')],function(_0x1d5f3b){return{'model':db[_0x1d5f3b[_0xc299('0x12')]],'as':_0x1d5f3b['as'],'attributes':_0x1d5f3b[_0xc299('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc299('0x14')](function(_0x1514d4){logger['info'](_0xc299('0x19'),_0x432588);logger[_0xc299('0x16')](_0xc299('0x19'),_0x432588,JSON[_0xc299('0x17')](_0x1514d4));_0x3896d8(_0x1514d4);})[_0xc299('0x1c')](function(_0x4b116b){logger[_0xc299('0x18')](_0xc299('0x19'),_0x4b116b['message'],_0x432588);_0x4733da(_0x494fa5[_0xc299('0x18')](0x1f4,_0x4b116b[_0xc299('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a9c9c04..82e357a 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 _0x6b6b=['emit','length','./squareProject.events','save','remove','update'];(function(_0x14e490,_0x15caa5){var _0x4e9a64=function(_0x1003b8){while(--_0x1003b8){_0x14e490['push'](_0x14e490['shift']());}};_0x4e9a64(++_0x15caa5);}(_0x6b6b,0x15e));var _0xb6b6=function(_0x1131b2,_0x1cd5b8){_0x1131b2=_0x1131b2-0x0;var _0x487778=_0x6b6b[_0x1131b2];return _0x487778;};'use strict';var SquareProjectEvents=require(_0xb6b6('0x0'));var events=[_0xb6b6('0x1'),_0xb6b6('0x2'),_0xb6b6('0x3')];function createListener(_0x57bd24,_0x3185a){return function(_0x2780a2){_0x3185a[_0xb6b6('0x4')](_0x57bd24,_0x2780a2);};}function removeListener(_0x3b9049,_0xc158e5){return function(){SquareProjectEvents['removeListener'](_0x3b9049,_0xc158e5);};}exports['register']=function(_0x49469a){for(var _0xe3da08=0x0,_0x1671d7=events[_0xb6b6('0x5')];_0xe3da08<_0x1671d7;_0xe3da08++){var _0x4b472c=events[_0xe3da08];var _0x1004d3=createListener('squareProject:'+_0x4b472c,_0x49469a);SquareProjectEvents['on'](_0x4b472c,_0x1004d3);}}; \ No newline at end of file +var _0x4b8c=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x5a0e5a,_0x5dbdf0){var _0x52c110=function(_0x4645da){while(--_0x4645da){_0x5a0e5a['push'](_0x5a0e5a['shift']());}};_0x52c110(++_0x5dbdf0);}(_0x4b8c,0x10d));var _0xc4b8=function(_0x5d4077,_0x3f4c6b){_0x5d4077=_0x5d4077-0x0;var _0x1eb14b=_0x4b8c[_0x5d4077];return _0x1eb14b;};'use strict';var SquareProjectEvents=require(_0xc4b8('0x0'));var events=[_0xc4b8('0x1'),_0xc4b8('0x2'),'update'];function createListener(_0xe8de2b,_0x364473){return function(_0x1328de){_0x364473[_0xc4b8('0x3')](_0xe8de2b,_0x1328de);};}function removeListener(_0x1dd239,_0x46816c){return function(){SquareProjectEvents[_0xc4b8('0x4')](_0x1dd239,_0x46816c);};}exports[_0xc4b8('0x5')]=function(_0x1040ec){for(var _0x575b81=0x0,_0x4b189b=events[_0xc4b8('0x6')];_0x575b81<_0x4b189b;_0x575b81++){var _0x233243=events[_0x575b81];var _0x5c2791=createListener(_0xc4b8('0x7')+_0x233243,_0x1040ec);SquareProjectEvents['on'](_0x233243,_0x5c2791);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 40c6e6b..4417142 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x394f90,_0x2906b1){var _0x20e2b5=function(_0x569911){while(--_0x569911){_0x394f90['push'](_0x394f90['shift']());}};_0x20e2b5(++_0x2906b1);}(_0xf494,0x1c6));var _0x4f49=function(_0x160245,_0x4a2e52){_0x160245=_0x160245-0x0;var _0x77c88=_0xf494[_0x160245];return _0x77c88;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1305db,_0x1222c9){var _0x4b71d3=function(_0x3b68cb){while(--_0x3b68cb){_0x1305db['push'](_0x1305db['shift']());}};_0x4b71d3(++_0x1222c9);}(_0x5fab,0x177));var _0xb5fa=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x5fab[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 538cdb5..3a7f6af 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 _0x8958=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL'];(function(_0x2b78e5,_0x3126f8){var _0xa8d52d=function(_0x51fd7f){while(--_0x51fd7f){_0x2b78e5['push'](_0x2b78e5['shift']());}};_0xa8d52d(++_0x3126f8);}(_0x8958,0x93));var _0x8895=function(_0x5a5d55,_0x1bef36){_0x5a5d55=_0x5a5d55-0x0;var _0x35e31e=_0x8958[_0x5a5d55];return _0x35e31e;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8895('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8895('0x1')]},'dnid':{'type':Sequelize[_0x8895('0x1')]},'projectName':{'type':Sequelize[_0x8895('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8895('0x1')]},'savePath':{'type':Sequelize[_0x8895('0x1')]},'format':{'type':Sequelize[_0x8895('0x2')],'get':function(){var _0x40cec6='';var _0x33013a=this['getDataValue'](_0x8895('0x3'));if(_0x33013a){_0x40cec6=_0x33013a[_0x8895('0x4')](_0x33013a[_0x8895('0x5')]('.'));}return _0x40cec6;}}}; \ No newline at end of file +var _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x1d041e,_0x19c235){var _0xa30ea9=function(_0x5d7714){while(--_0x5d7714){_0x1d041e['push'](_0x1d041e['shift']());}};_0xa30ea9(++_0x19c235);}(_0x814b,0x1a2));var _0xb814=function(_0xc84e3,_0xd631b){_0xc84e3=_0xc84e3-0x0;var _0x437a90=_0x814b[_0xc84e3];return _0x437a90;};'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 diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index cb230de..71285af 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 _0x8684=['include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','apply','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','SquareRecording','includeAll'];(function(_0x1183e7,_0x5e3eea){var _0x23f1fe=function(_0x220c73){while(--_0x220c73){_0x1183e7['push'](_0x1183e7['shift']());}};_0x23f1fe(++_0x5e3eea);}(_0x8684,0x86));var _0x4868=function(_0x2a2c21,_0x80f894){_0x2a2c21=_0x2a2c21-0x0;var _0x3b754b=_0x8684[_0x2a2c21];return _0x3b754b;};'use strict';var emlformat=require(_0x4868('0x0'));var rimraf=require(_0x4868('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4868('0x2'));var rp=require(_0x4868('0x3'));var moment=require(_0x4868('0x4'));var BPromise=require(_0x4868('0x5'));var Mustache=require(_0x4868('0x6'));var util=require(_0x4868('0x7'));var path=require(_0x4868('0x8'));var sox=require(_0x4868('0x9'));var csv=require(_0x4868('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4868('0xb'));var _=require(_0x4868('0xc'));var squel=require('squel');var crypto=require(_0x4868('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4868('0xe'));var toCsv=require(_0x4868('0xa'));var querystring=require(_0x4868('0xf'));var Papa=require(_0x4868('0x10'));var Redis=require(_0x4868('0x11'));var authService=require(_0x4868('0x12'));var qs=require(_0x4868('0x13'));var as=require(_0x4868('0x14'));var hardwareService=require(_0x4868('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4868('0x16'));var config=require(_0x4868('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4868('0x18'))['db'];function respondWithStatusCode(_0x53dfd6,_0x16f70e){_0x16f70e=_0x16f70e||0xcc;return function(_0xe6bdc){if(_0xe6bdc){return _0x53dfd6[_0x4868('0x19')](_0x16f70e);}return _0x53dfd6['status'](_0x16f70e)[_0x4868('0x1a')]();};}function respondWithResult(_0x4dba86,_0x1433dd){_0x1433dd=_0x1433dd||0xc8;return function(_0xec22d4){if(_0xec22d4){return _0x4dba86['status'](_0x1433dd)[_0x4868('0x1b')](_0xec22d4);}};}function respondWithFilteredResult(_0x3f46e7,_0x4df2f1){return function(_0x1ad3d9){if(_0x1ad3d9){var _0x3bf167=typeof _0x4df2f1['offset']===_0x4868('0x1c')&&typeof _0x4df2f1[_0x4868('0x1d')]==='undefined';var _0x47ec32=_0x1ad3d9[_0x4868('0x1e')];var _0x51f6a9=_0x3bf167?0x0:_0x4df2f1[_0x4868('0x1f')];var _0x7e53cd=_0x3bf167?_0x1ad3d9[_0x4868('0x1e')]:_0x4df2f1[_0x4868('0x1f')]+_0x4df2f1[_0x4868('0x1d')];var _0x5868a4;if(_0x7e53cd>=_0x47ec32){_0x7e53cd=_0x47ec32;_0x5868a4=0xc8;}else{_0x5868a4=0xce;}_0x3f46e7[_0x4868('0x20')](_0x5868a4);return _0x3f46e7['set']('Content-Range',_0x51f6a9+'-'+_0x7e53cd+'/'+_0x47ec32)[_0x4868('0x1b')](_0x1ad3d9);}return null;};}function patchUpdates(_0x410c57){return function(_0xcea435){try{jsonpatch[_0x4868('0x21')](_0xcea435,_0x410c57,!![]);}catch(_0x5e6195){return BPromise['reject'](_0x5e6195);}return _0xcea435[_0x4868('0x22')]();};}function saveUpdates(_0x18a0cd,_0x4f0745){return function(_0x58aef6){if(_0x58aef6){return _0x58aef6[_0x4868('0x23')](_0x18a0cd)[_0x4868('0x24')](function(_0x124cdd){return _0x124cdd;});}return null;};}function removeEntity(_0x1ed112,_0x3f4a8a){return function(_0x50c51a){if(_0x50c51a){return _0x50c51a[_0x4868('0x25')]()[_0x4868('0x24')](function(){_0x1ed112[_0x4868('0x20')](0xcc)[_0x4868('0x1a')]();});}};}function handleEntityNotFound(_0x3eff86,_0x5b245a){return function(_0xc559fc){if(!_0xc559fc){_0x3eff86[_0x4868('0x19')](0x194);}return _0xc559fc;};}function handleError(_0x51cb3c,_0x4e2636){_0x4e2636=_0x4e2636||0x1f4;return function(_0x5b7695){logger[_0x4868('0x26')](_0x5b7695['stack']);if(_0x5b7695[_0x4868('0x27')]){delete _0x5b7695[_0x4868('0x27')];}_0x51cb3c[_0x4868('0x20')](_0x4e2636)[_0x4868('0x28')](_0x5b7695);};}exports[_0x4868('0x29')]=function(_0x2e7366,_0x4f94d1){var _0x2e7d99={},_0x4a036d={},_0xcd4b53={'count':0x0,'rows':[]};var _0x9b6602=_[_0x4868('0x2a')](db['SquareRecording']['rawAttributes'],function(_0x472c60){return{'name':_0x472c60[_0x4868('0x2b')],'type':_0x472c60[_0x4868('0x2c')][_0x4868('0x2d')]};});_0x4a036d['model']=_['map'](_0x9b6602,'name');_0x4a036d['query']=_[_0x4868('0x2e')](_0x2e7366[_0x4868('0x2f')]);_0x4a036d[_0x4868('0x30')]=_['intersection'](_0x4a036d['model'],_0x4a036d[_0x4868('0x2f')]);_0x2e7d99[_0x4868('0x31')]=_[_0x4868('0x32')](_0x4a036d[_0x4868('0x33')],qs[_0x4868('0x34')](_0x2e7366[_0x4868('0x2f')][_0x4868('0x34')]));_0x2e7d99[_0x4868('0x31')]=_0x2e7d99[_0x4868('0x31')]['length']?_0x2e7d99[_0x4868('0x31')]:_0x4a036d[_0x4868('0x33')];if(!_0x2e7366['query']['hasOwnProperty'](_0x4868('0x35'))){_0x2e7d99[_0x4868('0x1d')]=qs[_0x4868('0x1d')](_0x2e7366[_0x4868('0x2f')]['limit']);_0x2e7d99[_0x4868('0x1f')]=qs[_0x4868('0x1f')](_0x2e7366[_0x4868('0x2f')][_0x4868('0x1f')]);}_0x2e7d99[_0x4868('0x36')]=qs[_0x4868('0x37')](_0x2e7366[_0x4868('0x2f')]['sort']);_0x2e7d99[_0x4868('0x38')]=qs['filters'](_[_0x4868('0x39')](_0x2e7366[_0x4868('0x2f')],_0x4a036d[_0x4868('0x30')]),_0x9b6602);if(_0x2e7366[_0x4868('0x2f')]['filter']){_0x2e7d99['where']=_[_0x4868('0x3a')](_0x2e7d99[_0x4868('0x38')],{'$or':_[_0x4868('0x2a')](_0x9b6602,function(_0x30bbee){if(_0x30bbee[_0x4868('0x2c')]!==_0x4868('0x3b')){var _0x2ddfd7={};_0x2ddfd7[_0x30bbee[_0x4868('0x27')]]={'$like':'%'+_0x2e7366[_0x4868('0x2f')]['filter']+'%'};return _0x2ddfd7;}})});}_0x2e7d99=_[_0x4868('0x3a')]({},_0x2e7d99,_0x2e7366['options']);var _0x503500={'where':_0x2e7d99[_0x4868('0x38')]};return db[_0x4868('0x3c')][_0x4868('0x1e')](_0x503500)['then'](function(_0x52cff1){_0xcd4b53[_0x4868('0x1e')]=_0x52cff1;if(_0x2e7366[_0x4868('0x2f')][_0x4868('0x3d')]){_0x2e7d99[_0x4868('0x3e')]=[{'all':!![]}];}return db[_0x4868('0x3c')][_0x4868('0x3f')](_0x2e7d99);})[_0x4868('0x24')](function(_0x2f2ca6){_0xcd4b53[_0x4868('0x40')]=_0x2f2ca6;return _0xcd4b53;})['then'](respondWithFilteredResult(_0x4f94d1,_0x2e7d99))[_0x4868('0x41')](handleError(_0x4f94d1,null));};exports[_0x4868('0x42')]=function(_0x136c9a,_0x46acf8){var _0x3d4e3f={'raw':!![],'where':{'id':_0x136c9a[_0x4868('0x43')]['id']}},_0x4ccbe8={};_0x4ccbe8['model']=_[_0x4868('0x2e')](db['SquareRecording'][_0x4868('0x44')]);_0x4ccbe8[_0x4868('0x2f')]=_[_0x4868('0x2e')](_0x136c9a[_0x4868('0x2f')]);_0x4ccbe8[_0x4868('0x30')]=_['intersection'](_0x4ccbe8[_0x4868('0x33')],_0x4ccbe8[_0x4868('0x2f')]);_0x3d4e3f['attributes']=_[_0x4868('0x32')](_0x4ccbe8[_0x4868('0x33')],qs['fields'](_0x136c9a[_0x4868('0x2f')][_0x4868('0x34')]));_0x3d4e3f['attributes']=_0x3d4e3f['attributes'][_0x4868('0x45')]?_0x3d4e3f[_0x4868('0x31')]:_0x4ccbe8[_0x4868('0x33')];if(_0x136c9a[_0x4868('0x2f')][_0x4868('0x3d')]){_0x3d4e3f[_0x4868('0x3e')]=[{'all':!![]}];}_0x3d4e3f=_[_0x4868('0x3a')]({},_0x3d4e3f,_0x136c9a[_0x4868('0x46')]);return db[_0x4868('0x3c')][_0x4868('0x47')](_0x3d4e3f)[_0x4868('0x24')](handleEntityNotFound(_0x46acf8,null))['then'](respondWithResult(_0x46acf8,null))[_0x4868('0x41')](handleError(_0x46acf8,null));};exports[_0x4868('0x48')]=function(_0x24cff9,_0x377534){return db[_0x4868('0x3c')][_0x4868('0x48')](_0x24cff9[_0x4868('0x49')],{})['then'](respondWithResult(_0x377534,0xc9))['catch'](handleError(_0x377534,null));};exports[_0x4868('0x23')]=function(_0x526a41,_0x4840f5){if(_0x526a41[_0x4868('0x49')]['id']){delete _0x526a41['body']['id'];}return db[_0x4868('0x3c')][_0x4868('0x47')]({'where':{'id':_0x526a41['params']['id']}})['then'](handleEntityNotFound(_0x4840f5,null))[_0x4868('0x24')](saveUpdates(_0x526a41[_0x4868('0x49')],null))[_0x4868('0x24')](respondWithResult(_0x4840f5,null))['catch'](handleError(_0x4840f5,null));};exports[_0x4868('0x4a')]=function(_0x5024d,_0x29a2f2,_0x49674a){var _0x3b9860=require(_0x4868('0x4b'));var _0x187d98=![];var _0x51cab4={};if(_0x5024d[_0x4868('0x2f')][_0x4868('0x2c')]&&_0x5024d[_0x4868('0x2f')][_0x4868('0x2c')]===_0x4868('0x4c')){_0x51cab4['uniqueid']=_0x5024d[_0x4868('0x43')]['id'];}else{_0x51cab4['id']=_0x5024d['params']['id'];}return db['SquareRecording'][_0x4868('0x47')]({'where':_0x51cab4,'attributes':['id',_0x4868('0x4d'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x29a2f2,null))[_0x4868('0x24')](function(_0xd577a8){if(_0xd577a8){var _0x438d2c=_0xd577a8[_0x4868('0x4d')];var _0x1b286b=util['format'](_0x4868('0x4e'),_0x438d2c);if(fs[_0x4868('0x4f')](_0x1b286b)){_0x187d98=!![];return _0x3b9860['decryptFile'](_0x1b286b,_0x438d2c,config[_0x4868('0x50')][_0x4868('0x51')])[_0x4868('0x24')](function(){return _0xd577a8;});}return _0xd577a8;}})['then'](function(_0x5ed526){if(_0x5ed526){var _0x50cc18=_0x5ed526['savePath'];if(!fs[_0x4868('0x4f')](_0x50cc18)){throw new db[(_0x4868('0x52'))][(_0x4868('0x53'))](_0x4868('0x54'));}if(_0x5ed526[_0x4868('0x55')]){return _0x29a2f2[_0x4868('0x4a')](_0x50cc18,_0x5ed526[_0x4868('0x55')]+path[_0x4868('0x56')](_0x50cc18),function(){if(_0x187d98){fs['unlink'](_0x50cc18);}});}else{return _0x29a2f2[_0x4868('0x4a')](_0x50cc18,function(_0x531fcd){if(_0x187d98){fs[_0x4868('0x57')](_0x50cc18);}});}}})[_0x4868('0x41')](function(_0x20def9){if(_0x20def9[_0x4868('0x58')]===_0x4868('0x54')){_0x29a2f2[_0x4868('0x20')](0x194)[_0x4868('0x28')](_0x4868('0x59'));}else{return handleError(_0x29a2f2,null);}});};exports['destroy']=function(_0x441f29,_0x3d76e4){return db['SquareRecording'][_0x4868('0x47')]({'where':{'id':_0x441f29[_0x4868('0x43')]['id']}})['then'](function(_0x6cf9a1){if(_[_0x4868('0x5a')](_0x6cf9a1)){throw new ReferenceError(_0x4868('0x5b'));}return _0x6cf9a1;})[_0x4868('0x24')](function(_0x41e396){var _0x9c7631=_0x41e396[_0x4868('0x4d')];logger[_0x4868('0x5c')](_0x4868('0x5d'),_0x9c7631);if(!_[_0x4868('0x5a')](_0x41e396['savePath'])&&fs[_0x4868('0x4f')](_0x9c7631)){logger[_0x4868('0x5c')](_0x4868('0x5e')+_0x9c7631+_0x4868('0x5f'));fs[_0x4868('0x60')](_0x9c7631);}_0x9c7631=_0x9c7631+_0x4868('0x61');if(!_['isNil'](_0x41e396[_0x4868('0x4d')])&&fs[_0x4868('0x4f')](_0x9c7631)){logger[_0x4868('0x5c')](_0x4868('0x5e')+_0x9c7631+_0x4868('0x5f'));fs[_0x4868('0x60')](_0x9c7631);}return _0x41e396;})[_0x4868('0x24')](function(_0x5f3adf){if(!_0x5f3adf)throw new InternalError();return _0x5f3adf['destroy']();})[_0x4868('0x24')](function(){_0x3d76e4[_0x4868('0x20')](0xcc)[_0x4868('0x1a')]();})[_0x4868('0x41')](handleError(_0x3d76e4,null));}; \ No newline at end of file +var _0x28a3=['VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','extname','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','end','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x4b19b3,_0x59b162){var _0x2780e7=function(_0x5edd11){while(--_0x5edd11){_0x4b19b3['push'](_0x4b19b3['shift']());}};_0x2780e7(++_0x59b162);}(_0x28a3,0x14e));var _0x328a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x28a3[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x328a('0x0'));var zipdir=require(_0x328a('0x1'));var jsonpatch=require(_0x328a('0x2'));var rp=require(_0x328a('0x3'));var moment=require(_0x328a('0x4'));var BPromise=require(_0x328a('0x5'));var Mustache=require(_0x328a('0x6'));var util=require(_0x328a('0x7'));var path=require(_0x328a('0x8'));var sox=require(_0x328a('0x9'));var csv=require('to-csv');var ejs=require(_0x328a('0xa'));var fs=require('fs');var fs_extra=require(_0x328a('0xb'));var _=require(_0x328a('0xc'));var squel=require(_0x328a('0xd'));var crypto=require(_0x328a('0xe'));var jsforce=require(_0x328a('0xf'));var deskjs=require(_0x328a('0x10'));var toCsv=require(_0x328a('0x11'));var querystring=require(_0x328a('0x12'));var Papa=require(_0x328a('0x13'));var Redis=require(_0x328a('0x14'));var authService=require(_0x328a('0x15'));var qs=require(_0x328a('0x16'));var as=require(_0x328a('0x17'));var hardwareService=require(_0x328a('0x18'));var logger=require(_0x328a('0x19'))(_0x328a('0x1a'));var utils=require(_0x328a('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x328a('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cb63d,_0x373297){_0x373297=_0x373297||0xcc;return function(_0x5bc5d7){if(_0x5bc5d7){return _0x4cb63d[_0x328a('0x1d')](_0x373297);}return _0x4cb63d[_0x328a('0x1e')](_0x373297)['end']();};}function respondWithResult(_0xfadb12,_0x2cf4e5){_0x2cf4e5=_0x2cf4e5||0xc8;return function(_0x162242){if(_0x162242){return _0xfadb12[_0x328a('0x1e')](_0x2cf4e5)[_0x328a('0x1f')](_0x162242);}};}function respondWithFilteredResult(_0x3125d7,_0x122cbd){return function(_0x6548ef){if(_0x6548ef){var _0x3fc381=typeof _0x122cbd[_0x328a('0x20')]===_0x328a('0x21')&&typeof _0x122cbd[_0x328a('0x22')]==='undefined';var _0x206eac=_0x6548ef[_0x328a('0x23')];var _0x54fe52=_0x3fc381?0x0:_0x122cbd[_0x328a('0x20')];var _0x1bdf29=_0x3fc381?_0x6548ef['count']:_0x122cbd['offset']+_0x122cbd[_0x328a('0x22')];var _0x2416b3;if(_0x1bdf29>=_0x206eac){_0x1bdf29=_0x206eac;_0x2416b3=0xc8;}else{_0x2416b3=0xce;}_0x3125d7[_0x328a('0x1e')](_0x2416b3);return _0x3125d7['set']('Content-Range',_0x54fe52+'-'+_0x1bdf29+'/'+_0x206eac)['json'](_0x6548ef);}return null;};}function patchUpdates(_0x2d5547){return function(_0x3ffff5){try{jsonpatch[_0x328a('0x24')](_0x3ffff5,_0x2d5547,!![]);}catch(_0xff6410){return BPromise['reject'](_0xff6410);}return _0x3ffff5[_0x328a('0x25')]();};}function saveUpdates(_0x5413bb,_0x51c162){return function(_0x2cb846){if(_0x2cb846){return _0x2cb846[_0x328a('0x26')](_0x5413bb)[_0x328a('0x27')](function(_0x334d58){return _0x334d58;});}return null;};}function removeEntity(_0x5b165f,_0x3ffecf){return function(_0x4744fa){if(_0x4744fa){return _0x4744fa[_0x328a('0x28')]()['then'](function(){_0x5b165f['status'](0xcc)[_0x328a('0x29')]();});}};}function handleEntityNotFound(_0xc2be7f,_0x221754){return function(_0x1e0b75){if(!_0x1e0b75){_0xc2be7f[_0x328a('0x1d')](0x194);}return _0x1e0b75;};}function handleError(_0x2d59b1,_0x10f8cd){_0x10f8cd=_0x10f8cd||0x1f4;return function(_0x551d36){logger['error'](_0x551d36[_0x328a('0x2a')]);if(_0x551d36['name']){delete _0x551d36[_0x328a('0x2b')];}_0x2d59b1['status'](_0x10f8cd)[_0x328a('0x2c')](_0x551d36);};}exports[_0x328a('0x2d')]=function(_0x366e55,_0x58c5b5){var _0x536eac={},_0x28d545={},_0x1bb9fe={'count':0x0,'rows':[]};var _0xfd3934=_[_0x328a('0x2e')](db[_0x328a('0x2f')][_0x328a('0x30')],function(_0x36dc5d){return{'name':_0x36dc5d[_0x328a('0x31')],'type':_0x36dc5d[_0x328a('0x32')]['key']};});_0x28d545[_0x328a('0x33')]=_[_0x328a('0x2e')](_0xfd3934,_0x328a('0x2b'));_0x28d545[_0x328a('0x34')]=_[_0x328a('0x35')](_0x366e55[_0x328a('0x34')]);_0x28d545['filters']=_['intersection'](_0x28d545[_0x328a('0x33')],_0x28d545[_0x328a('0x34')]);_0x536eac[_0x328a('0x36')]=_[_0x328a('0x37')](_0x28d545['model'],qs[_0x328a('0x38')](_0x366e55[_0x328a('0x34')]['fields']));_0x536eac['attributes']=_0x536eac[_0x328a('0x36')][_0x328a('0x39')]?_0x536eac[_0x328a('0x36')]:_0x28d545[_0x328a('0x33')];if(!_0x366e55['query']['hasOwnProperty'](_0x328a('0x3a'))){_0x536eac['limit']=qs['limit'](_0x366e55[_0x328a('0x34')][_0x328a('0x22')]);_0x536eac['offset']=qs[_0x328a('0x20')](_0x366e55[_0x328a('0x34')][_0x328a('0x20')]);}_0x536eac[_0x328a('0x3b')]=qs[_0x328a('0x3c')](_0x366e55[_0x328a('0x34')][_0x328a('0x3c')]);_0x536eac[_0x328a('0x3d')]=qs[_0x328a('0x3e')](_[_0x328a('0x3f')](_0x366e55[_0x328a('0x34')],_0x28d545[_0x328a('0x3e')]),_0xfd3934);if(_0x366e55[_0x328a('0x34')][_0x328a('0x40')]){_0x536eac[_0x328a('0x3d')]=_[_0x328a('0x41')](_0x536eac['where'],{'$or':_['map'](_0xfd3934,function(_0x46bd40){if(_0x46bd40['type']!==_0x328a('0x42')){var _0x56ce08={};_0x56ce08[_0x46bd40['name']]={'$like':'%'+_0x366e55[_0x328a('0x34')][_0x328a('0x40')]+'%'};return _0x56ce08;}})});}_0x536eac=_[_0x328a('0x41')]({},_0x536eac,_0x366e55['options']);var _0x2ab266={'where':_0x536eac['where']};return db[_0x328a('0x2f')][_0x328a('0x23')](_0x2ab266)['then'](function(_0xdc4d5d){_0x1bb9fe[_0x328a('0x23')]=_0xdc4d5d;if(_0x366e55[_0x328a('0x34')]['includeAll']){_0x536eac[_0x328a('0x43')]=[{'all':!![]}];}return db[_0x328a('0x2f')][_0x328a('0x44')](_0x536eac);})[_0x328a('0x27')](function(_0x5e17b7){_0x1bb9fe[_0x328a('0x45')]=_0x5e17b7;return _0x1bb9fe;})[_0x328a('0x27')](respondWithFilteredResult(_0x58c5b5,_0x536eac))[_0x328a('0x46')](handleError(_0x58c5b5,null));};exports[_0x328a('0x47')]=function(_0x514eeb,_0x21ab9f){var _0x4618c3={'raw':!![],'where':{'id':_0x514eeb[_0x328a('0x48')]['id']}},_0x49c051={};_0x49c051['model']=_['keys'](db['SquareRecording'][_0x328a('0x30')]);_0x49c051[_0x328a('0x34')]=_[_0x328a('0x35')](_0x514eeb[_0x328a('0x34')]);_0x49c051[_0x328a('0x3e')]=_['intersection'](_0x49c051['model'],_0x49c051['query']);_0x4618c3[_0x328a('0x36')]=_[_0x328a('0x37')](_0x49c051[_0x328a('0x33')],qs['fields'](_0x514eeb['query'][_0x328a('0x38')]));_0x4618c3['attributes']=_0x4618c3[_0x328a('0x36')][_0x328a('0x39')]?_0x4618c3[_0x328a('0x36')]:_0x49c051[_0x328a('0x33')];if(_0x514eeb[_0x328a('0x34')][_0x328a('0x49')]){_0x4618c3[_0x328a('0x43')]=[{'all':!![]}];}_0x4618c3=_['merge']({},_0x4618c3,_0x514eeb[_0x328a('0x4a')]);return db[_0x328a('0x2f')]['find'](_0x4618c3)[_0x328a('0x27')](handleEntityNotFound(_0x21ab9f,null))['then'](respondWithResult(_0x21ab9f,null))[_0x328a('0x46')](handleError(_0x21ab9f,null));};exports[_0x328a('0x4b')]=function(_0x1da26a,_0xf1bb9a){return db['SquareRecording']['create'](_0x1da26a[_0x328a('0x4c')],{})[_0x328a('0x27')](respondWithResult(_0xf1bb9a,0xc9))[_0x328a('0x46')](handleError(_0xf1bb9a,null));};exports[_0x328a('0x26')]=function(_0x267a00,_0x2cc0fe){if(_0x267a00[_0x328a('0x4c')]['id']){delete _0x267a00['body']['id'];}return db['SquareRecording'][_0x328a('0x4d')]({'where':{'id':_0x267a00[_0x328a('0x48')]['id']}})[_0x328a('0x27')](handleEntityNotFound(_0x2cc0fe,null))[_0x328a('0x27')](saveUpdates(_0x267a00[_0x328a('0x4c')],null))[_0x328a('0x27')](respondWithResult(_0x2cc0fe,null))['catch'](handleError(_0x2cc0fe,null));};exports[_0x328a('0x4e')]=function(_0x2e04aa,_0x4f7063,_0x53b8b7){var _0x2d91d7=require(_0x328a('0x4f'));var _0x5479d6=![];var _0x53ba2d={};if(_0x2e04aa[_0x328a('0x34')][_0x328a('0x32')]&&_0x2e04aa[_0x328a('0x34')][_0x328a('0x32')]===_0x328a('0x50')){_0x53ba2d[_0x328a('0x50')]=_0x2e04aa[_0x328a('0x48')]['id'];}else{_0x53ba2d['id']=_0x2e04aa[_0x328a('0x48')]['id'];}return db[_0x328a('0x2f')][_0x328a('0x4d')]({'where':_0x53ba2d,'attributes':['id','savePath',_0x328a('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x4f7063,null))['then'](function(_0x57bffd){if(_0x57bffd){var _0x24bd74=_0x57bffd[_0x328a('0x52')];var _0x59ac03=util[_0x328a('0x53')](_0x328a('0x54'),_0x24bd74);if(fs[_0x328a('0x55')](_0x59ac03)){_0x5479d6=!![];return _0x2d91d7['decryptFile'](_0x59ac03,_0x24bd74,config[_0x328a('0x56')][_0x328a('0x57')])[_0x328a('0x27')](function(){return _0x57bffd;});}return _0x57bffd;}})[_0x328a('0x27')](function(_0x1c937c){if(_0x1c937c){var _0x42ff47=_0x1c937c[_0x328a('0x52')];if(!fs[_0x328a('0x55')](_0x42ff47)){throw new db[(_0x328a('0x58'))][(_0x328a('0x59'))]('SquareRecording\x20not\x20found');}if(_0x1c937c['filename']){return _0x4f7063[_0x328a('0x4e')](_0x42ff47,_0x1c937c[_0x328a('0x51')]+path[_0x328a('0x5a')](_0x42ff47),function(){if(_0x5479d6){fs['unlink'](_0x42ff47);}});}else{return _0x4f7063[_0x328a('0x4e')](_0x42ff47,function(_0x3fa4d8){if(_0x5479d6){fs['unlink'](_0x42ff47);}});}}})[_0x328a('0x46')](function(_0x366f06){if(_0x366f06[_0x328a('0x5b')]==='SquareRecording\x20not\x20found'){_0x4f7063[_0x328a('0x1e')](0x194)[_0x328a('0x2c')](_0x328a('0x5c'));}else{return handleError(_0x4f7063,null);}});};exports['destroy']=function(_0x117e62,_0x582d90){return db['SquareRecording'][_0x328a('0x4d')]({'where':{'id':_0x117e62[_0x328a('0x48')]['id']}})[_0x328a('0x27')](function(_0xe11ed){if(_['isNil'](_0xe11ed)){throw new ReferenceError('Entity\x20not\x20found');}return _0xe11ed;})['then'](function(_0x5d28b5){var _0x3d8b20=_0x5d28b5[_0x328a('0x52')];logger['info'](_0x328a('0x5d'),_0x3d8b20);if(!_[_0x328a('0x5e')](_0x5d28b5['savePath'])&&fs['existsSync'](_0x3d8b20)){logger[_0x328a('0x5f')](_0x328a('0x60')+_0x3d8b20+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x328a('0x61')](_0x3d8b20);}_0x3d8b20=_0x3d8b20+_0x328a('0x62');if(!_['isNil'](_0x5d28b5[_0x328a('0x52')])&&fs[_0x328a('0x55')](_0x3d8b20)){logger[_0x328a('0x5f')](_0x328a('0x60')+_0x3d8b20+_0x328a('0x63'));fs[_0x328a('0x61')](_0x3d8b20);}return _0x5d28b5;})[_0x328a('0x27')](function(_0x1952b8){if(!_0x1952b8)throw new InternalError();return _0x1952b8[_0x328a('0x28')]();})[_0x328a('0x27')](function(){_0x582d90[_0x328a('0x1e')](0xcc)['end']();})[_0x328a('0x46')](handleError(_0x582d90,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f6f7adb..905be8c 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 _0x87bc=['request-promise','rimraf','define','lodash','util','api'];(function(_0x51708f,_0x511834){var _0x5c60a3=function(_0x29fbec){while(--_0x29fbec){_0x51708f['push'](_0x51708f['shift']());}};_0x5c60a3(++_0x511834);}(_0x87bc,0x189));var _0xc87b=function(_0x51facd,_0x337a1a){_0x51facd=_0x51facd-0x0;var _0x176720=_0x87bc[_0x51facd];return _0x176720;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var logger=require('../../config/logger')(_0xc87b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc87b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc87b('0x4'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x1a2172,_0x1dfa75){return _0x1a2172[_0xc87b('0x5')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63a6=['rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','util','../../config/logger','moment','bluebird','path'];(function(_0x4b32d5,_0xd28713){var _0x1ab2b6=function(_0x4b2336){while(--_0x4b2336){_0x4b32d5['push'](_0x4b32d5['shift']());}};_0x1ab2b6(++_0xd28713);}(_0x63a6,0x1c7));var _0x663a=function(_0xc3b595,_0x4108fd){_0xc3b595=_0xc3b595-0x0;var _0x26befa=_0x63a6[_0xc3b595];return _0x26befa;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index b4813e6..65bda46 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 _0x58e5=['code','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body','options','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x58e5,0x8d));var _0x558e=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x58e5[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var moment=require('moment');var BPromise=require(_0x558e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x558e('0x3'))['db'];var utils=require(_0x558e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x558e('0x5'));var jayson=require(_0x558e('0x6'));var client=jayson['client'][_0x558e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x512cb9,_0xde35b3,_0x39ed55){return new BPromise(function(_0x53d791,_0x16ead4){return client[_0x558e('0x8')](_0x512cb9,_0x39ed55)[_0x558e('0x9')](function(_0x35a033){logger['info'](_0x558e('0xa'),_0xde35b3,_0x558e('0xb'));logger['debug'](_0x558e('0xc'),_0xde35b3,_0x558e('0xb'),JSON[_0x558e('0xd')](_0x35a033));if(_0x35a033[_0x558e('0xe')]){if(_0x35a033[_0x558e('0xe')][_0x558e('0xf')]===0x1f4){logger[_0x558e('0xe')](_0x558e('0xa'),_0xde35b3,_0x35a033['error'][_0x558e('0x10')]);return _0x16ead4(_0x35a033[_0x558e('0xe')][_0x558e('0x10')]);}logger[_0x558e('0xe')](_0x558e('0xa'),_0xde35b3,_0x35a033[_0x558e('0xe')][_0x558e('0x10')]);return _0x53d791(_0x35a033['error'][_0x558e('0x10')]);}else{logger[_0x558e('0x11')]('SquareRecording,\x20%s,\x20%s',_0xde35b3,'request\x20sent');_0x53d791(_0x35a033[_0x558e('0x12')][_0x558e('0x10')]);}})[_0x558e('0x13')](function(_0x3e7acb){logger[_0x558e('0xe')]('SquareRecording,\x20%s,\x20%s',_0xde35b3,_0x3e7acb);_0x16ead4(_0x3e7acb);});});}exports[_0x558e('0x14')]=function(_0x113992){var _0x58a3c6=this;return new Promise(function(_0x291295,_0x5d6dc1){return db[_0x558e('0x15')][_0x558e('0x16')](_0x113992[_0x558e('0x17')],{'raw':_0x113992[_0x558e('0x18')]?_0x113992['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x194a72){logger[_0x558e('0x11')]('CreateSquareRecording',_0x113992);logger[_0x558e('0x19')]('CreateSquareRecording',_0x113992,JSON[_0x558e('0xd')](_0x194a72));_0x291295(_0x194a72);})[_0x558e('0x13')](function(_0x2dbfb7){logger[_0x558e('0xe')](_0x558e('0x14'),_0x2dbfb7[_0x558e('0x10')],_0x113992);_0x5d6dc1(_0x58a3c6[_0x558e('0xe')](0x1f4,_0x2dbfb7[_0x558e('0x10')]));});});}; \ No newline at end of file +var _0xdfd9=['client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x13cbed,_0x1c57d8){var _0x39c603=function(_0x4f6d63){while(--_0x4f6d63){_0x13cbed['push'](_0x13cbed['shift']());}};_0x39c603(++_0x1c57d8);}(_0xdfd9,0x6a));var _0x9dfd=function(_0x264083,_0x56107e){_0x264083=_0x264083-0x0;var _0x5513f9=_0xdfd9[_0x264083];return _0x5513f9;};'use strict';var _=require(_0x9dfd('0x0'));var util=require(_0x9dfd('0x1'));var moment=require(_0x9dfd('0x2'));var BPromise=require(_0x9dfd('0x3'));var rs=require(_0x9dfd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dfd('0x5'))['db'];var utils=require(_0x9dfd('0x6'));var logger=require(_0x9dfd('0x7'))(_0x9dfd('0x8'));var config=require(_0x9dfd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dfd('0xa')][_0x9dfd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3801eb,_0x55a8,_0x3e2563){return new BPromise(function(_0xb5832f,_0x3d54db){return client[_0x9dfd('0xc')](_0x3801eb,_0x3e2563)[_0x9dfd('0xd')](function(_0x2c708e){logger[_0x9dfd('0xe')](_0x9dfd('0xf'),_0x55a8,'request\x20sent');logger[_0x9dfd('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x55a8,_0x9dfd('0x11'),JSON[_0x9dfd('0x12')](_0x2c708e));if(_0x2c708e[_0x9dfd('0x13')]){if(_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x14')]===0x1f4){logger[_0x9dfd('0x13')]('SquareRecording,\x20%s,\x20%s',_0x55a8,_0x2c708e[_0x9dfd('0x13')]['message']);return _0x3d54db(_0x2c708e[_0x9dfd('0x13')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x55a8,_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x15')]);return _0xb5832f(_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x15')]);}else{logger['info'](_0x9dfd('0xf'),_0x55a8,_0x9dfd('0x11'));_0xb5832f(_0x2c708e[_0x9dfd('0x16')][_0x9dfd('0x15')]);}})['catch'](function(_0x5cd7a8){logger[_0x9dfd('0x13')](_0x9dfd('0xf'),_0x55a8,_0x5cd7a8);_0x3d54db(_0x5cd7a8);});});}exports[_0x9dfd('0x17')]=function(_0x373010){var _0x2ab601=this;return new Promise(function(_0x25461f,_0x5dec86){return db[_0x9dfd('0x18')][_0x9dfd('0x19')](_0x373010[_0x9dfd('0x1a')],{'raw':_0x373010['options']?_0x373010[_0x9dfd('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x9dfd('0xd')](function(_0xd4cf3c){logger[_0x9dfd('0xe')](_0x9dfd('0x17'),_0x373010);logger['debug'](_0x9dfd('0x17'),_0x373010,JSON[_0x9dfd('0x12')](_0xd4cf3c));_0x25461f(_0xd4cf3c);})[_0x9dfd('0x1c')](function(_0x3bd0e1){logger[_0x9dfd('0x13')]('CreateSquareRecording',_0x3bd0e1[_0x9dfd('0x15')],_0x373010);_0x5dec86(_0x2ab601['error'](0x1f4,_0x3bd0e1[_0x9dfd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3fe8577..8ab46bf 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x48854d,_0x1cc13f){var _0x2e48e1=function(_0x362c9e){while(--_0x362c9e){_0x48854d['push'](_0x48854d['shift']());}};_0x2e48e1(++_0x1cc13f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 6d1db44..e088f09 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 _0x9573=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x515cff,_0x27d4a5){var _0x419c0e=function(_0x4a0ad2){while(--_0x4a0ad2){_0x515cff['push'](_0x515cff['shift']());}};_0x419c0e(++_0x27d4a5);}(_0x9573,0x19f));var _0x3957=function(_0x4a3b9e,_0x1f678a){_0x4a3b9e=_0x4a3b9e-0x0;var _0x4e2e3c=_0x9573[_0x4a3b9e];return _0x4e2e3c;};'use strict';var Sequelize=require(_0x3957('0x0'));module[_0x3957('0x1')]={'network':{'type':Sequelize[_0x3957('0x2')]},'network_script':{'type':Sequelize[_0x3957('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3957('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3957('0x2')]},'uniqueid':{'type':Sequelize[_0x3957('0x2')]},'version':{'type':Sequelize[_0x3957('0x2')]},'callerid':{'type':Sequelize[_0x3957('0x2')]},'calleridname':{'type':Sequelize[_0x3957('0x2')]},'callingpres':{'type':Sequelize[_0x3957('0x2')]},'callingani2':{'type':Sequelize[_0x3957('0x2')]},'callington':{'type':Sequelize[_0x3957('0x2')]},'callingtns':{'type':Sequelize[_0x3957('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x3957('0x2')]},'context':{'type':Sequelize[_0x3957('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3957('0x2')]},'enhanced':{'type':Sequelize[_0x3957('0x2')]},'accountcode':{'type':Sequelize[_0x3957('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x3957('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3957('0x3')]},'bot':{'type':Sequelize[_0x3957('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c03=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c03,0x1f4));var _0x33c0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3c03[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x33c0('0x0'));module[_0x33c0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x33c0('0x2')]},'channel':{'type':Sequelize[_0x33c0('0x2')]},'language':{'type':Sequelize[_0x33c0('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x33c0('0x2')]},'callerid':{'type':Sequelize[_0x33c0('0x2')]},'calleridname':{'type':Sequelize[_0x33c0('0x2')]},'callingpres':{'type':Sequelize[_0x33c0('0x2')]},'callingani2':{'type':Sequelize[_0x33c0('0x2')]},'callington':{'type':Sequelize[_0x33c0('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x33c0('0x2')]},'rdnis':{'type':Sequelize[_0x33c0('0x2')]},'context':{'type':Sequelize[_0x33c0('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x33c0('0x2')]},'enhanced':{'type':Sequelize[_0x33c0('0x2')]},'accountcode':{'type':Sequelize[_0x33c0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x33c0('0x2')]},'joinAt':{'type':Sequelize[_0x33c0('0x3')]},'leaveAt':{'type':Sequelize[_0x33c0('0x3')]},'bot':{'type':Sequelize[_0x33c0('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 5d12645..861851c 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 _0x8888=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','findAll','rows','catch','merge','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','model','keys','query','intersection'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x8888,0x18e));var _0x8888=function(_0x2339a0,_0x550aba){_0x2339a0=_0x2339a0-0x0;var _0x194345=_0x8888[_0x2339a0];return _0x194345;};'use strict';var emlformat=require(_0x8888('0x0'));var rimraf=require(_0x8888('0x1'));var zipdir=require(_0x8888('0x2'));var jsonpatch=require(_0x8888('0x3'));var rp=require('request-promise');var moment=require(_0x8888('0x4'));var BPromise=require(_0x8888('0x5'));var Mustache=require('mustache');var util=require(_0x8888('0x6'));var path=require(_0x8888('0x7'));var sox=require(_0x8888('0x8'));var csv=require(_0x8888('0x9'));var ejs=require(_0x8888('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8888('0xb'));var squel=require(_0x8888('0xc'));var crypto=require(_0x8888('0xd'));var jsforce=require(_0x8888('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8888('0x9'));var querystring=require('querystring');var Papa=require(_0x8888('0xf'));var Redis=require(_0x8888('0x10'));var authService=require(_0x8888('0x11'));var qs=require(_0x8888('0x12'));var as=require(_0x8888('0x13'));var hardwareService=require(_0x8888('0x14'));var logger=require(_0x8888('0x15'))(_0x8888('0x16'));var utils=require(_0x8888('0x17'));var config=require(_0x8888('0x18'));var licenseUtil=require(_0x8888('0x19'));var db=require(_0x8888('0x1a'))['db'];function respondWithStatusCode(_0x27a4f4,_0x312541){_0x312541=_0x312541||0xcc;return function(_0x193a5b){if(_0x193a5b){return _0x27a4f4[_0x8888('0x1b')](_0x312541);}return _0x27a4f4[_0x8888('0x1c')](_0x312541)[_0x8888('0x1d')]();};}function respondWithResult(_0x500a2d,_0x49d6e3){_0x49d6e3=_0x49d6e3||0xc8;return function(_0x3d0ed3){if(_0x3d0ed3){return _0x500a2d[_0x8888('0x1c')](_0x49d6e3)['json'](_0x3d0ed3);}};}function respondWithFilteredResult(_0x5d1060,_0x344cb4){return function(_0x101eda){if(_0x101eda){var _0x59f029=typeof _0x344cb4['offset']==='undefined'&&typeof _0x344cb4['limit']==='undefined';var _0x26712f=_0x101eda['count'];var _0x211de3=_0x59f029?0x0:_0x344cb4[_0x8888('0x1e')];var _0xd03275=_0x59f029?_0x101eda[_0x8888('0x1f')]:_0x344cb4['offset']+_0x344cb4[_0x8888('0x20')];var _0x3395e4;if(_0xd03275>=_0x26712f){_0xd03275=_0x26712f;_0x3395e4=0xc8;}else{_0x3395e4=0xce;}_0x5d1060[_0x8888('0x1c')](_0x3395e4);return _0x5d1060['set'](_0x8888('0x21'),_0x211de3+'-'+_0xd03275+'/'+_0x26712f)[_0x8888('0x22')](_0x101eda);}return null;};}function patchUpdates(_0x2108a5){return function(_0xa700b9){try{jsonpatch[_0x8888('0x23')](_0xa700b9,_0x2108a5,!![]);}catch(_0x592b65){return BPromise['reject'](_0x592b65);}return _0xa700b9[_0x8888('0x24')]();};}function saveUpdates(_0x4c3319,_0x8f745c){return function(_0x3ce4c5){if(_0x3ce4c5){return _0x3ce4c5[_0x8888('0x25')](_0x4c3319)[_0x8888('0x26')](function(_0x402729){return _0x402729;});}return null;};}function removeEntity(_0x341f74,_0x4c2db7){return function(_0x53226b){if(_0x53226b){return _0x53226b['destroy']()[_0x8888('0x26')](function(){_0x341f74[_0x8888('0x1c')](0xcc)[_0x8888('0x1d')]();});}};}function handleEntityNotFound(_0x279b22,_0x12fd6a){return function(_0x117273){if(!_0x117273){_0x279b22[_0x8888('0x1b')](0x194);}return _0x117273;};}function handleError(_0x11b95f,_0x2465d3){_0x2465d3=_0x2465d3||0x1f4;return function(_0x49c526){logger[_0x8888('0x27')](_0x49c526[_0x8888('0x28')]);if(_0x49c526['name']){delete _0x49c526[_0x8888('0x29')];}_0x11b95f[_0x8888('0x1c')](_0x2465d3)[_0x8888('0x2a')](_0x49c526);};}exports[_0x8888('0x2b')]=function(_0x7eed31,_0x1445bf){var _0xa71037={},_0xcf5839={},_0x291f45={'count':0x0,'rows':[]};var _0x37a993=_[_0x8888('0x2c')](db[_0x8888('0x2d')][_0x8888('0x2e')],function(_0x27617b){return{'name':_0x27617b[_0x8888('0x2f')],'type':_0x27617b['type']['key']};});_0xcf5839[_0x8888('0x30')]=_[_0x8888('0x2c')](_0x37a993,_0x8888('0x29'));_0xcf5839['query']=_[_0x8888('0x31')](_0x7eed31[_0x8888('0x32')]);_0xcf5839['filters']=_[_0x8888('0x33')](_0xcf5839[_0x8888('0x30')],_0xcf5839[_0x8888('0x32')]);_0xa71037['attributes']=_[_0x8888('0x33')](_0xcf5839[_0x8888('0x30')],qs[_0x8888('0x34')](_0x7eed31[_0x8888('0x32')][_0x8888('0x34')]));_0xa71037[_0x8888('0x35')]=_0xa71037[_0x8888('0x35')][_0x8888('0x36')]?_0xa71037[_0x8888('0x35')]:_0xcf5839[_0x8888('0x30')];if(!_0x7eed31['query'][_0x8888('0x37')](_0x8888('0x38'))){_0xa71037[_0x8888('0x20')]=qs[_0x8888('0x20')](_0x7eed31[_0x8888('0x32')][_0x8888('0x20')]);_0xa71037['offset']=qs[_0x8888('0x1e')](_0x7eed31[_0x8888('0x32')][_0x8888('0x1e')]);}_0xa71037[_0x8888('0x39')]=qs['sort'](_0x7eed31['query'][_0x8888('0x3a')]);_0xa71037[_0x8888('0x3b')]=qs[_0x8888('0x3c')](_[_0x8888('0x3d')](_0x7eed31[_0x8888('0x32')],_0xcf5839[_0x8888('0x3c')]),_0x37a993);if(_0x7eed31[_0x8888('0x32')]['filter']){_0xa71037[_0x8888('0x3b')]=_['merge'](_0xa71037[_0x8888('0x3b')],{'$or':_[_0x8888('0x2c')](_0x37a993,function(_0x1118d7){if(_0x1118d7[_0x8888('0x3e')]!==_0x8888('0x3f')){var _0x56eb1f={};_0x56eb1f[_0x1118d7['name']]={'$like':'%'+_0x7eed31['query'][_0x8888('0x40')]+'%'};return _0x56eb1f;}})});}_0xa71037=_['merge']({},_0xa71037,_0x7eed31['options']);var _0x542dd6={'where':_0xa71037[_0x8888('0x3b')]};return db[_0x8888('0x2d')][_0x8888('0x1f')](_0x542dd6)[_0x8888('0x26')](function(_0x13bdd3){_0x291f45['count']=_0x13bdd3;if(_0x7eed31[_0x8888('0x32')]['includeAll']){_0xa71037['include']=[{'all':!![]}];}return db[_0x8888('0x2d')][_0x8888('0x41')](_0xa71037);})['then'](function(_0x236fd7){_0x291f45[_0x8888('0x42')]=_0x236fd7;return _0x291f45;})[_0x8888('0x26')](respondWithFilteredResult(_0x1445bf,_0xa71037))[_0x8888('0x43')](handleError(_0x1445bf,null));};exports['show']=function(_0x585118,_0x206e33){var _0x36707d={'raw':!![],'where':{'id':_0x585118['params']['id']}},_0x3c75c9={};_0x3c75c9[_0x8888('0x30')]=_[_0x8888('0x31')](db['SquareReport'][_0x8888('0x2e')]);_0x3c75c9[_0x8888('0x32')]=_['keys'](_0x585118[_0x8888('0x32')]);_0x3c75c9[_0x8888('0x3c')]=_['intersection'](_0x3c75c9[_0x8888('0x30')],_0x3c75c9[_0x8888('0x32')]);_0x36707d[_0x8888('0x35')]=_[_0x8888('0x33')](_0x3c75c9['model'],qs[_0x8888('0x34')](_0x585118[_0x8888('0x32')][_0x8888('0x34')]));_0x36707d[_0x8888('0x35')]=_0x36707d[_0x8888('0x35')][_0x8888('0x36')]?_0x36707d[_0x8888('0x35')]:_0x3c75c9[_0x8888('0x30')];if(_0x585118['query']['includeAll']){_0x36707d['include']=[{'all':!![]}];}_0x36707d=_[_0x8888('0x44')]({},_0x36707d,_0x585118['options']);return db[_0x8888('0x2d')][_0x8888('0x45')](_0x36707d)[_0x8888('0x26')](handleEntityNotFound(_0x206e33,null))[_0x8888('0x26')](respondWithResult(_0x206e33,null))[_0x8888('0x43')](handleError(_0x206e33,null));};exports[_0x8888('0x46')]=function(_0x214f53,_0x15d66e){return db['SquareReport'][_0x8888('0x46')](_0x214f53[_0x8888('0x47')],{})[_0x8888('0x26')](respondWithResult(_0x15d66e,0xc9))[_0x8888('0x43')](handleError(_0x15d66e,null));};exports['update']=function(_0x6d2637,_0x1c79f7){if(_0x6d2637[_0x8888('0x47')]['id']){delete _0x6d2637['body']['id'];}return db['SquareReport'][_0x8888('0x45')]({'where':{'id':_0x6d2637[_0x8888('0x48')]['id']}})[_0x8888('0x26')](handleEntityNotFound(_0x1c79f7,null))[_0x8888('0x26')](saveUpdates(_0x6d2637[_0x8888('0x47')],null))['then'](respondWithResult(_0x1c79f7,null))[_0x8888('0x43')](handleError(_0x1c79f7,null));};exports[_0x8888('0x49')]=function(_0x42332d,_0x54dc7a){return db[_0x8888('0x2d')][_0x8888('0x45')]({'where':{'id':_0x42332d[_0x8888('0x48')]['id']}})[_0x8888('0x26')](handleEntityNotFound(_0x54dc7a,null))[_0x8888('0x26')](removeEntity(_0x54dc7a,null))['catch'](handleError(_0x54dc7a,null));};exports[_0x8888('0x4a')]=function(_0x486180,_0x9cb6f3){return db['SquareReport'][_0x8888('0x4a')]()[_0x8888('0x26')](respondWithResult(_0x9cb6f3,null))['catch'](handleError(_0x9cb6f3,null));}; \ No newline at end of file +var _0xb82a=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SquareReport','includeAll','include','catch','show','params','options','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xb82a,0xc1));var _0xab82=function(_0x5f2543,_0x353740){_0x5f2543=_0x5f2543-0x0;var _0x420ebc=_0xb82a[_0x5f2543];return _0x420ebc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab82('0x0'));var zipdir=require(_0xab82('0x1'));var jsonpatch=require(_0xab82('0x2'));var rp=require(_0xab82('0x3'));var moment=require('moment');var BPromise=require(_0xab82('0x4'));var Mustache=require('mustache');var util=require(_0xab82('0x5'));var path=require(_0xab82('0x6'));var sox=require(_0xab82('0x7'));var csv=require(_0xab82('0x8'));var ejs=require(_0xab82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab82('0xa'));var squel=require(_0xab82('0xb'));var crypto=require(_0xab82('0xc'));var jsforce=require(_0xab82('0xd'));var deskjs=require(_0xab82('0xe'));var toCsv=require(_0xab82('0x8'));var querystring=require(_0xab82('0xf'));var Papa=require(_0xab82('0x10'));var Redis=require(_0xab82('0x11'));var authService=require(_0xab82('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab82('0x13'));var logger=require('../../config/logger')(_0xab82('0x14'));var utils=require(_0xab82('0x15'));var config=require(_0xab82('0x16'));var licenseUtil=require(_0xab82('0x17'));var db=require(_0xab82('0x18'))['db'];function respondWithStatusCode(_0x2c88a8,_0x35bd25){_0x35bd25=_0x35bd25||0xcc;return function(_0x1f75ec){if(_0x1f75ec){return _0x2c88a8[_0xab82('0x19')](_0x35bd25);}return _0x2c88a8[_0xab82('0x1a')](_0x35bd25)[_0xab82('0x1b')]();};}function respondWithResult(_0x37fa2f,_0x17c269){_0x17c269=_0x17c269||0xc8;return function(_0x19737d){if(_0x19737d){return _0x37fa2f['status'](_0x17c269)[_0xab82('0x1c')](_0x19737d);}};}function respondWithFilteredResult(_0x5102cf,_0x20c7a2){return function(_0x2d6375){if(_0x2d6375){var _0x3163e4=typeof _0x20c7a2[_0xab82('0x1d')]===_0xab82('0x1e')&&typeof _0x20c7a2[_0xab82('0x1f')]===_0xab82('0x1e');var _0x328405=_0x2d6375[_0xab82('0x20')];var _0x564334=_0x3163e4?0x0:_0x20c7a2[_0xab82('0x1d')];var _0x3d2612=_0x3163e4?_0x2d6375[_0xab82('0x20')]:_0x20c7a2[_0xab82('0x1d')]+_0x20c7a2[_0xab82('0x1f')];var _0x18cc15;if(_0x3d2612>=_0x328405){_0x3d2612=_0x328405;_0x18cc15=0xc8;}else{_0x18cc15=0xce;}_0x5102cf[_0xab82('0x1a')](_0x18cc15);return _0x5102cf[_0xab82('0x21')](_0xab82('0x22'),_0x564334+'-'+_0x3d2612+'/'+_0x328405)[_0xab82('0x1c')](_0x2d6375);}return null;};}function patchUpdates(_0x4742b4){return function(_0x4afcf6){try{jsonpatch['apply'](_0x4afcf6,_0x4742b4,!![]);}catch(_0xdf3da9){return BPromise[_0xab82('0x23')](_0xdf3da9);}return _0x4afcf6[_0xab82('0x24')]();};}function saveUpdates(_0x178d56,_0x4c4cdb){return function(_0x47c89a){if(_0x47c89a){return _0x47c89a['update'](_0x178d56)[_0xab82('0x25')](function(_0x6a6202){return _0x6a6202;});}return null;};}function removeEntity(_0x2c4dff,_0x53696a){return function(_0x42b254){if(_0x42b254){return _0x42b254[_0xab82('0x26')]()[_0xab82('0x25')](function(){_0x2c4dff[_0xab82('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510dab,_0x1e64c8){return function(_0x48ce4e){if(!_0x48ce4e){_0x510dab[_0xab82('0x19')](0x194);}return _0x48ce4e;};}function handleError(_0x283b1d,_0x22af5a){_0x22af5a=_0x22af5a||0x1f4;return function(_0x55169a){logger[_0xab82('0x27')](_0x55169a[_0xab82('0x28')]);if(_0x55169a['name']){delete _0x55169a[_0xab82('0x29')];}_0x283b1d[_0xab82('0x1a')](_0x22af5a)[_0xab82('0x2a')](_0x55169a);};}exports[_0xab82('0x2b')]=function(_0x55ee34,_0x54934d){var _0x504a7b={},_0x38e5e4={},_0x3726d1={'count':0x0,'rows':[]};var _0x401781=_[_0xab82('0x2c')](db['SquareReport'][_0xab82('0x2d')],function(_0x3d7e57){return{'name':_0x3d7e57[_0xab82('0x2e')],'type':_0x3d7e57['type']['key']};});_0x38e5e4[_0xab82('0x2f')]=_[_0xab82('0x2c')](_0x401781,_0xab82('0x29'));_0x38e5e4[_0xab82('0x30')]=_[_0xab82('0x31')](_0x55ee34['query']);_0x38e5e4[_0xab82('0x32')]=_[_0xab82('0x33')](_0x38e5e4[_0xab82('0x2f')],_0x38e5e4['query']);_0x504a7b['attributes']=_[_0xab82('0x33')](_0x38e5e4[_0xab82('0x2f')],qs[_0xab82('0x34')](_0x55ee34[_0xab82('0x30')]['fields']));_0x504a7b[_0xab82('0x35')]=_0x504a7b[_0xab82('0x35')][_0xab82('0x36')]?_0x504a7b['attributes']:_0x38e5e4[_0xab82('0x2f')];if(!_0x55ee34[_0xab82('0x30')][_0xab82('0x37')](_0xab82('0x38'))){_0x504a7b[_0xab82('0x1f')]=qs[_0xab82('0x1f')](_0x55ee34['query'][_0xab82('0x1f')]);_0x504a7b['offset']=qs[_0xab82('0x1d')](_0x55ee34[_0xab82('0x30')][_0xab82('0x1d')]);}_0x504a7b[_0xab82('0x39')]=qs[_0xab82('0x3a')](_0x55ee34['query'][_0xab82('0x3a')]);_0x504a7b[_0xab82('0x3b')]=qs[_0xab82('0x32')](_[_0xab82('0x3c')](_0x55ee34[_0xab82('0x30')],_0x38e5e4['filters']),_0x401781);if(_0x55ee34['query'][_0xab82('0x3d')]){_0x504a7b[_0xab82('0x3b')]=_[_0xab82('0x3e')](_0x504a7b[_0xab82('0x3b')],{'$or':_[_0xab82('0x2c')](_0x401781,function(_0x30e1d2){if(_0x30e1d2[_0xab82('0x3f')]!==_0xab82('0x40')){var _0x4ef765={};_0x4ef765[_0x30e1d2[_0xab82('0x29')]]={'$like':'%'+_0x55ee34['query'][_0xab82('0x3d')]+'%'};return _0x4ef765;}})});}_0x504a7b=_[_0xab82('0x3e')]({},_0x504a7b,_0x55ee34['options']);var _0x39d6be={'where':_0x504a7b['where']};return db[_0xab82('0x41')][_0xab82('0x20')](_0x39d6be)['then'](function(_0x1bbd63){_0x3726d1[_0xab82('0x20')]=_0x1bbd63;if(_0x55ee34['query'][_0xab82('0x42')]){_0x504a7b[_0xab82('0x43')]=[{'all':!![]}];}return db[_0xab82('0x41')]['findAll'](_0x504a7b);})['then'](function(_0x5d13b6){_0x3726d1['rows']=_0x5d13b6;return _0x3726d1;})[_0xab82('0x25')](respondWithFilteredResult(_0x54934d,_0x504a7b))[_0xab82('0x44')](handleError(_0x54934d,null));};exports[_0xab82('0x45')]=function(_0x4096a4,_0x33b70f){var _0x34da06={'raw':!![],'where':{'id':_0x4096a4[_0xab82('0x46')]['id']}},_0x370977={};_0x370977[_0xab82('0x2f')]=_[_0xab82('0x31')](db['SquareReport'][_0xab82('0x2d')]);_0x370977[_0xab82('0x30')]=_[_0xab82('0x31')](_0x4096a4[_0xab82('0x30')]);_0x370977[_0xab82('0x32')]=_[_0xab82('0x33')](_0x370977[_0xab82('0x2f')],_0x370977[_0xab82('0x30')]);_0x34da06[_0xab82('0x35')]=_[_0xab82('0x33')](_0x370977['model'],qs[_0xab82('0x34')](_0x4096a4[_0xab82('0x30')][_0xab82('0x34')]));_0x34da06[_0xab82('0x35')]=_0x34da06[_0xab82('0x35')][_0xab82('0x36')]?_0x34da06['attributes']:_0x370977[_0xab82('0x2f')];if(_0x4096a4['query']['includeAll']){_0x34da06[_0xab82('0x43')]=[{'all':!![]}];}_0x34da06=_[_0xab82('0x3e')]({},_0x34da06,_0x4096a4[_0xab82('0x47')]);return db[_0xab82('0x41')]['find'](_0x34da06)[_0xab82('0x25')](handleEntityNotFound(_0x33b70f,null))['then'](respondWithResult(_0x33b70f,null))[_0xab82('0x44')](handleError(_0x33b70f,null));};exports[_0xab82('0x48')]=function(_0x4bd619,_0x140590){return db[_0xab82('0x41')][_0xab82('0x48')](_0x4bd619['body'],{})[_0xab82('0x25')](respondWithResult(_0x140590,0xc9))['catch'](handleError(_0x140590,null));};exports[_0xab82('0x49')]=function(_0x2e4499,_0x27fae4){if(_0x2e4499[_0xab82('0x4a')]['id']){delete _0x2e4499[_0xab82('0x4a')]['id'];}return db[_0xab82('0x41')][_0xab82('0x4b')]({'where':{'id':_0x2e4499[_0xab82('0x46')]['id']}})['then'](handleEntityNotFound(_0x27fae4,null))[_0xab82('0x25')](saveUpdates(_0x2e4499[_0xab82('0x4a')],null))[_0xab82('0x25')](respondWithResult(_0x27fae4,null))[_0xab82('0x44')](handleError(_0x27fae4,null));};exports[_0xab82('0x26')]=function(_0x389cc2,_0x2f0bf3){return db[_0xab82('0x41')]['find']({'where':{'id':_0x389cc2['params']['id']}})[_0xab82('0x25')](handleEntityNotFound(_0x2f0bf3,null))[_0xab82('0x25')](removeEntity(_0x2f0bf3,null))[_0xab82('0x44')](handleError(_0x2f0bf3,null));};exports[_0xab82('0x4c')]=function(_0x4a67fa,_0x1cdcdf){return db[_0xab82('0x41')][_0xab82('0x4c')]()[_0xab82('0x25')](respondWithResult(_0x1cdcdf,null))['catch'](handleError(_0x1cdcdf,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 22d8c9f..5055bfb 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 _0x4775=['define','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1415f8,_0x5a11be){var _0x20ce5a=function(_0x1a90cd){while(--_0x1a90cd){_0x1415f8['push'](_0x1415f8['shift']());}};_0x20ce5a(++_0x5a11be);}(_0x4775,0xf3));var _0x5477=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x4775[_0x409fb8];return _0x278270;};'use strict';var _=require('lodash');var util=require(_0x5477('0x0'));var logger=require(_0x5477('0x1'))(_0x5477('0x2'));var moment=require(_0x5477('0x3'));var BPromise=require('bluebird');var rp=require(_0x5477('0x4'));var fs=require('fs');var path=require(_0x5477('0x5'));var rimraf=require(_0x5477('0x6'));var config=require(_0x5477('0x7'));var attributes=require('./squareReport.attributes');module[_0x5477('0x8')]=function(_0x8be01a,_0x5d4fe8){return _0x8be01a[_0x5477('0x9')]('SquareReport',attributes,{'tableName':_0x5477('0xa'),'paranoid':![],'indexes':[{'name':_0x5477('0xb'),'fields':[_0x5477('0xc'),'project_name']},{'name':_0x5477('0xd'),'fields':[_0x5477('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad5f=['SquareReport','report_square','uniqueid','project_name','leaveAt','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5e2525,_0x39e00a){var _0x2328a6=function(_0x55078d){while(--_0x55078d){_0x5e2525['push'](_0x5e2525['shift']());}};_0x2328a6(++_0x39e00a);}(_0xad5f,0x18b));var _0xfad5=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0xad5f[_0x1db153];return _0x530cbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfad5('0x0'))(_0xfad5('0x1'));var moment=require(_0xfad5('0x2'));var BPromise=require('bluebird');var rp=require(_0xfad5('0x3'));var fs=require('fs');var path=require(_0xfad5('0x4'));var rimraf=require(_0xfad5('0x5'));var config=require(_0xfad5('0x6'));var attributes=require('./squareReport.attributes');module[_0xfad5('0x7')]=function(_0x35db19,_0x3a9632){return _0x35db19['define'](_0xfad5('0x8'),attributes,{'tableName':_0xfad5('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xfad5('0xa'),_0xfad5('0xb')]},{'name':'leaveAt','fields':[_0xfad5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 06ddfcc..ba1f78f 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 _0xba03=['CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','where','attributes','limit','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xd3da2a,_0x22241c){var _0x10ab61=function(_0x12b964){while(--_0x12b964){_0xd3da2a['push'](_0xd3da2a['shift']());}};_0x10ab61(++_0x22241c);}(_0xba03,0x122));var _0x3ba0=function(_0x26d2aa,_0x36deb8){_0x26d2aa=_0x26d2aa-0x0;var _0xf7463=_0xba03[_0x26d2aa];return _0xf7463;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3ba0('0x0'));var rs=require(_0x3ba0('0x1'));var fs=require('fs');var Redis=require(_0x3ba0('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ba0('0x3'))(_0x3ba0('0x4'));var config=require(_0x3ba0('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3ba0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e20a1,_0xa25208,_0x6de38c){return new BPromise(function(_0x347fad,_0x2bf254){return client[_0x3ba0('0x7')](_0x3e20a1,_0x6de38c)[_0x3ba0('0x8')](function(_0x132ea4){logger[_0x3ba0('0x9')](_0x3ba0('0xa'),_0xa25208,'request\x20sent');logger[_0x3ba0('0xb')](_0x3ba0('0xc'),_0xa25208,_0x3ba0('0xd'),JSON[_0x3ba0('0xe')](_0x132ea4));if(_0x132ea4[_0x3ba0('0xf')]){if(_0x132ea4[_0x3ba0('0xf')][_0x3ba0('0x10')]===0x1f4){logger['error'](_0x3ba0('0xa'),_0xa25208,_0x132ea4[_0x3ba0('0xf')][_0x3ba0('0x11')]);return _0x2bf254(_0x132ea4['error']['message']);}logger[_0x3ba0('0xf')](_0x3ba0('0xa'),_0xa25208,_0x132ea4[_0x3ba0('0xf')]['message']);return _0x347fad(_0x132ea4['error'][_0x3ba0('0x11')]);}else{logger[_0x3ba0('0x9')](_0x3ba0('0xa'),_0xa25208,_0x3ba0('0xd'));_0x347fad(_0x132ea4[_0x3ba0('0x12')][_0x3ba0('0x11')]);}})[_0x3ba0('0x13')](function(_0x724bc9){logger['error'](_0x3ba0('0xa'),_0xa25208,_0x724bc9);_0x2bf254(_0x724bc9);});});}exports[_0x3ba0('0x14')]=function(_0x19cfd7){var _0x391f35=this;return new Promise(function(_0x2ea38d,_0xd1da8e){return db[_0x3ba0('0x15')][_0x3ba0('0x16')](_0x19cfd7['body'],{'raw':_0x19cfd7[_0x3ba0('0x17')]?_0x19cfd7[_0x3ba0('0x17')][_0x3ba0('0x18')]===undefined?!![]:![]:!![]})[_0x3ba0('0x8')](function(_0x511e24){logger[_0x3ba0('0x9')](_0x3ba0('0x14'),_0x19cfd7);logger[_0x3ba0('0xb')](_0x3ba0('0x14'),_0x19cfd7,JSON['stringify'](_0x511e24));_0x2ea38d(_0x511e24);})[_0x3ba0('0x13')](function(_0x1a21a6){logger[_0x3ba0('0xf')](_0x3ba0('0x14'),_0x1a21a6['message'],_0x19cfd7);_0xd1da8e(_0x391f35[_0x3ba0('0xf')](0x1f4,_0x1a21a6[_0x3ba0('0x11')]));});});};exports[_0x3ba0('0x19')]=function(_0x18ad84){var _0x42aaa0=this;return new Promise(function(_0xe86865,_0x1600ac){return db[_0x3ba0('0x15')][_0x3ba0('0x1a')](_0x18ad84[_0x3ba0('0x1b')],{'raw':_0x18ad84[_0x3ba0('0x17')]?_0x18ad84['options'][_0x3ba0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ad84[_0x3ba0('0x17')]?_0x18ad84[_0x3ba0('0x17')][_0x3ba0('0x1c')]||null:null,'attributes':_0x18ad84[_0x3ba0('0x17')]?_0x18ad84['options'][_0x3ba0('0x1d')]||null:null,'limit':_0x18ad84[_0x3ba0('0x17')]?_0x18ad84['options'][_0x3ba0('0x1e')]||null:null})['then'](function(_0x593515){logger[_0x3ba0('0x9')](_0x3ba0('0x19'),_0x18ad84);logger[_0x3ba0('0xb')](_0x3ba0('0x19'),_0x18ad84,JSON[_0x3ba0('0xe')](_0x593515));_0xe86865(_0x593515);})['catch'](function(_0x39921b){logger[_0x3ba0('0xf')](_0x3ba0('0x19'),_0x39921b[_0x3ba0('0x11')],_0x18ad84);_0x1600ac(_0x42aaa0[_0x3ba0('0xf')](0x1f4,_0x39921b[_0x3ba0('0x11')]));});});}; \ No newline at end of file +var _0x9170=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','create','body','options','catch','UpdateSquareReport','SquareReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x9170,0x1a3));var _0x0917=function(_0x55074e,_0x307bdb){_0x55074e=_0x55074e-0x0;var _0x46c714=_0x9170[_0x55074e];return _0x46c714;};'use strict';var _=require(_0x0917('0x0'));var util=require(_0x0917('0x1'));var moment=require(_0x0917('0x2'));var BPromise=require(_0x0917('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0917('0x4'))['db'];var utils=require(_0x0917('0x5'));var logger=require(_0x0917('0x6'))(_0x0917('0x7'));var config=require(_0x0917('0x8'));var jayson=require(_0x0917('0x9'));var client=jayson[_0x0917('0xa')][_0x0917('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c3c47,_0x575f5e,_0x15a889){return new BPromise(function(_0x261ed4,_0x39b5d2){return client[_0x0917('0xc')](_0x1c3c47,_0x15a889)[_0x0917('0xd')](function(_0x32b52b){logger[_0x0917('0xe')](_0x0917('0xf'),_0x575f5e,_0x0917('0x10'));logger[_0x0917('0x11')](_0x0917('0x12'),_0x575f5e,_0x0917('0x10'),JSON[_0x0917('0x13')](_0x32b52b));if(_0x32b52b['error']){if(_0x32b52b[_0x0917('0x14')][_0x0917('0x15')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x575f5e,_0x32b52b[_0x0917('0x14')]['message']);return _0x39b5d2(_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);}logger[_0x0917('0x14')](_0x0917('0xf'),_0x575f5e,_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);return _0x261ed4(_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);}else{logger['info'](_0x0917('0xf'),_0x575f5e,_0x0917('0x10'));_0x261ed4(_0x32b52b[_0x0917('0x17')][_0x0917('0x16')]);}})['catch'](function(_0x4d39fc){logger[_0x0917('0x14')]('SquareReport,\x20%s,\x20%s',_0x575f5e,_0x4d39fc);_0x39b5d2(_0x4d39fc);});});}exports[_0x0917('0x18')]=function(_0x224f18){var _0x27181c=this;return new Promise(function(_0x4ac488,_0x57e168){return db['SquareReport'][_0x0917('0x19')](_0x224f18[_0x0917('0x1a')],{'raw':_0x224f18['options']?_0x224f18[_0x0917('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0917('0xd')](function(_0x191aa9){logger[_0x0917('0xe')](_0x0917('0x18'),_0x224f18);logger[_0x0917('0x11')](_0x0917('0x18'),_0x224f18,JSON[_0x0917('0x13')](_0x191aa9));_0x4ac488(_0x191aa9);})[_0x0917('0x1c')](function(_0x46405d){logger['error'](_0x0917('0x18'),_0x46405d[_0x0917('0x16')],_0x224f18);_0x57e168(_0x27181c[_0x0917('0x14')](0x1f4,_0x46405d[_0x0917('0x16')]));});});};exports[_0x0917('0x1d')]=function(_0x4eb6dd){var _0x5cb043=this;return new Promise(function(_0x53815c,_0x3ccfa1){return db[_0x0917('0x1e')][_0x0917('0x1f')](_0x4eb6dd['body'],{'raw':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x21')]||null:null,'attributes':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd['options'][_0x0917('0x22')]||null:null,'limit':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x23')]||null:null})['then'](function(_0x2812b7){logger['info'](_0x0917('0x1d'),_0x4eb6dd);logger['debug']('UpdateSquareReport',_0x4eb6dd,JSON[_0x0917('0x13')](_0x2812b7));_0x53815c(_0x2812b7);})[_0x0917('0x1c')](function(_0x1bce05){logger[_0x0917('0x14')](_0x0917('0x1d'),_0x1bce05[_0x0917('0x16')],_0x4eb6dd);_0x3ccfa1(_0x5cb043['error'](0x1f4,_0x1bce05['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6dd1e62..b6bdf0c 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 _0xeace=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get'];(function(_0x290907,_0x1e8855){var _0x4d5e48=function(_0x1b3112){while(--_0x1b3112){_0x290907['push'](_0x290907['shift']());}};_0x4d5e48(++_0x1e8855);}(_0xeace,0xc8));var _0xeeac=function(_0x123911,_0x735872){_0x123911=_0x123911-0x0;var _0x15803c=_0xeace[_0x123911];return _0x15803c;};'use strict';var multer=require('multer');var util=require(_0xeeac('0x0'));var path=require(_0xeeac('0x1'));var timeout=require(_0xeeac('0x2'));var express=require(_0xeeac('0x3'));var router=express[_0xeeac('0x4')]();var fs_extra=require(_0xeeac('0x5'));var auth=require(_0xeeac('0x6'));var interaction=require(_0xeeac('0x7'));var config=require('../../config/environment');var controller=require(_0xeeac('0x8'));router[_0xeeac('0x9')]('/',auth[_0xeeac('0xa')](),controller[_0xeeac('0xb')]);router[_0xeeac('0x9')](_0xeeac('0xc'),auth[_0xeeac('0xa')](),controller[_0xeeac('0xd')]);router[_0xeeac('0x9')](_0xeeac('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeeac('0xf')]('/',auth[_0xeeac('0xa')](),controller[_0xeeac('0x10')]);router[_0xeeac('0x11')](_0xeeac('0xe'),auth[_0xeeac('0xa')](),controller[_0xeeac('0x12')]);router['delete'](_0xeeac('0xe'),auth['isAuthenticated'](),controller[_0xeeac('0x13')]);module[_0xeeac('0x14')]=router; \ No newline at end of file +var _0x3c36=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x3a5d52,_0x8dfc74){var _0x3efc01=function(_0x1dece6){while(--_0x1dece6){_0x3a5d52['push'](_0x3a5d52['shift']());}};_0x3efc01(++_0x8dfc74);}(_0x3c36,0x181));var _0x63c3=function(_0x1fe66c,_0x3ff70b){_0x1fe66c=_0x1fe66c-0x0;var _0x5c4632=_0x3c36[_0x1fe66c];return _0x5c4632;};'use strict';var multer=require(_0x63c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63c3('0x1'));var express=require(_0x63c3('0x2'));var router=express[_0x63c3('0x3')]();var fs_extra=require(_0x63c3('0x4'));var auth=require(_0x63c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x63c3('0x6'));var controller=require(_0x63c3('0x7'));router[_0x63c3('0x8')]('/',auth[_0x63c3('0x9')](),controller[_0x63c3('0xa')]);router['get'](_0x63c3('0xb'),auth[_0x63c3('0x9')](),controller['describe']);router[_0x63c3('0x8')](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['show']);router[_0x63c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x63c3('0xe')]);router['put'](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['update']);router['delete'](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['destroy']);module[_0x63c3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c2a2a61..695aa11 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 _0x0ef4=['exports','STRING','TEXT'];(function(_0x794bdc,_0x18e3b1){var _0x2a6108=function(_0x2637b4){while(--_0x2637b4){_0x794bdc['push'](_0x794bdc['shift']());}};_0x2a6108(++_0x18e3b1);}(_0x0ef4,0x1c8));var _0x40ef=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x0ef4[_0x3792e6];return _0x441e44;};'use strict';var Sequelize=require('sequelize');module[_0x40ef('0x0')]={'uniqueid':{'type':Sequelize[_0x40ef('0x1')]},'node':{'type':Sequelize[_0x40ef('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x40ef('0x2')]},'project_name':{'type':Sequelize[_0x40ef('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8aac=['TEXT','sequelize','exports','STRING'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x8aac,0x1e1));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8aa('0x0'));module[_0xc8aa('0x1')]={'uniqueid':{'type':Sequelize[_0xc8aa('0x2')]},'node':{'type':Sequelize[_0xc8aa('0x2')]},'application':{'type':Sequelize[_0xc8aa('0x2')]},'data':{'type':Sequelize[_0xc8aa('0x3')]},'project_name':{'type':Sequelize[_0xc8aa('0x2')]},'callerid':{'type':Sequelize[_0xc8aa('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 04df529..2d94705 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 _0xf776=['Content-Range','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','keys','intersection','attributes','query','fields','length','hasOwnProperty','sort','filters','filter','where','merge','options','includeAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set'];(function(_0x1850b0,_0x1ebf3e){var _0x2ffa76=function(_0x3da48e){while(--_0x3da48e){_0x1850b0['push'](_0x1850b0['shift']());}};_0x2ffa76(++_0x1ebf3e);}(_0xf776,0x1c9));var _0x6f77=function(_0x37db5d,_0x26a74c){_0x37db5d=_0x37db5d-0x0;var _0xcf563c=_0xf776[_0x37db5d];return _0xcf563c;};'use strict';var emlformat=require(_0x6f77('0x0'));var rimraf=require(_0x6f77('0x1'));var zipdir=require(_0x6f77('0x2'));var jsonpatch=require(_0x6f77('0x3'));var rp=require('request-promise');var moment=require(_0x6f77('0x4'));var BPromise=require(_0x6f77('0x5'));var Mustache=require(_0x6f77('0x6'));var util=require(_0x6f77('0x7'));var path=require(_0x6f77('0x8'));var sox=require('sox');var csv=require(_0x6f77('0x9'));var ejs=require(_0x6f77('0xa'));var fs=require('fs');var fs_extra=require(_0x6f77('0xb'));var _=require(_0x6f77('0xc'));var squel=require(_0x6f77('0xd'));var crypto=require(_0x6f77('0xe'));var jsforce=require(_0x6f77('0xf'));var deskjs=require(_0x6f77('0x10'));var toCsv=require(_0x6f77('0x9'));var querystring=require(_0x6f77('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6f77('0x12'));var qs=require(_0x6f77('0x13'));var as=require(_0x6f77('0x14'));var hardwareService=require(_0x6f77('0x15'));var logger=require(_0x6f77('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6f77('0x17'));var db=require(_0x6f77('0x18'))['db'];function respondWithStatusCode(_0x1a60c8,_0x49f942){_0x49f942=_0x49f942||0xcc;return function(_0x185417){if(_0x185417){return _0x1a60c8[_0x6f77('0x19')](_0x49f942);}return _0x1a60c8[_0x6f77('0x1a')](_0x49f942)[_0x6f77('0x1b')]();};}function respondWithResult(_0x351248,_0x49ae69){_0x49ae69=_0x49ae69||0xc8;return function(_0x16e14e){if(_0x16e14e){return _0x351248['status'](_0x49ae69)['json'](_0x16e14e);}};}function respondWithFilteredResult(_0x2c7d46,_0x1b8972){return function(_0x5484a1){if(_0x5484a1){var _0x13d171=typeof _0x1b8972['offset']==='undefined'&&typeof _0x1b8972[_0x6f77('0x1c')]===_0x6f77('0x1d');var _0x4cbe08=_0x5484a1[_0x6f77('0x1e')];var _0xc710c=_0x13d171?0x0:_0x1b8972['offset'];var _0x419540=_0x13d171?_0x5484a1[_0x6f77('0x1e')]:_0x1b8972[_0x6f77('0x1f')]+_0x1b8972[_0x6f77('0x1c')];var _0x1c8566;if(_0x419540>=_0x4cbe08){_0x419540=_0x4cbe08;_0x1c8566=0xc8;}else{_0x1c8566=0xce;}_0x2c7d46[_0x6f77('0x1a')](_0x1c8566);return _0x2c7d46[_0x6f77('0x20')](_0x6f77('0x21'),_0xc710c+'-'+_0x419540+'/'+_0x4cbe08)['json'](_0x5484a1);}return null;};}function patchUpdates(_0x4b03c4){return function(_0x410ae9){try{jsonpatch['apply'](_0x410ae9,_0x4b03c4,!![]);}catch(_0x2a0f48){return BPromise['reject'](_0x2a0f48);}return _0x410ae9['save']();};}function saveUpdates(_0x133065,_0x9fdf70){return function(_0x3654a8){if(_0x3654a8){return _0x3654a8[_0x6f77('0x22')](_0x133065)[_0x6f77('0x23')](function(_0x317317){return _0x317317;});}return null;};}function removeEntity(_0x1c7558,_0xa41ace){return function(_0x4a19ab){if(_0x4a19ab){return _0x4a19ab[_0x6f77('0x24')]()[_0x6f77('0x23')](function(){_0x1c7558['status'](0xcc)[_0x6f77('0x1b')]();});}};}function handleEntityNotFound(_0x16b099,_0x11d76b){return function(_0x5c64c7){if(!_0x5c64c7){_0x16b099['sendStatus'](0x194);}return _0x5c64c7;};}function handleError(_0x443ff5,_0x121da9){_0x121da9=_0x121da9||0x1f4;return function(_0x150d18){logger[_0x6f77('0x25')](_0x150d18[_0x6f77('0x26')]);if(_0x150d18[_0x6f77('0x27')]){delete _0x150d18[_0x6f77('0x27')];}_0x443ff5['status'](_0x121da9)[_0x6f77('0x28')](_0x150d18);};}exports[_0x6f77('0x29')]=function(_0x18a26c,_0x5c48df){var _0x21c407={},_0x44e017={},_0x4ab6e3={'count':0x0,'rows':[]};var _0x2eed3c=_[_0x6f77('0x2a')](db[_0x6f77('0x2b')][_0x6f77('0x2c')],function(_0x25f28e){return{'name':_0x25f28e['fieldName'],'type':_0x25f28e[_0x6f77('0x2d')][_0x6f77('0x2e')]};});_0x44e017[_0x6f77('0x2f')]=_[_0x6f77('0x2a')](_0x2eed3c,_0x6f77('0x27'));_0x44e017['query']=_[_0x6f77('0x30')](_0x18a26c['query']);_0x44e017['filters']=_[_0x6f77('0x31')](_0x44e017[_0x6f77('0x2f')],_0x44e017['query']);_0x21c407[_0x6f77('0x32')]=_[_0x6f77('0x31')](_0x44e017[_0x6f77('0x2f')],qs['fields'](_0x18a26c[_0x6f77('0x33')][_0x6f77('0x34')]));_0x21c407[_0x6f77('0x32')]=_0x21c407[_0x6f77('0x32')][_0x6f77('0x35')]?_0x21c407['attributes']:_0x44e017[_0x6f77('0x2f')];if(!_0x18a26c['query'][_0x6f77('0x36')]('nolimit')){_0x21c407['limit']=qs[_0x6f77('0x1c')](_0x18a26c[_0x6f77('0x33')][_0x6f77('0x1c')]);_0x21c407[_0x6f77('0x1f')]=qs['offset'](_0x18a26c['query']['offset']);}_0x21c407['order']=qs[_0x6f77('0x37')](_0x18a26c[_0x6f77('0x33')][_0x6f77('0x37')]);_0x21c407['where']=qs['filters'](_['pick'](_0x18a26c['query'],_0x44e017[_0x6f77('0x38')]),_0x2eed3c);if(_0x18a26c[_0x6f77('0x33')][_0x6f77('0x39')]){_0x21c407[_0x6f77('0x3a')]=_[_0x6f77('0x3b')](_0x21c407['where'],{'$or':_[_0x6f77('0x2a')](_0x2eed3c,function(_0x5d8751){if(_0x5d8751[_0x6f77('0x2d')]!=='VIRTUAL'){var _0x28e58a={};_0x28e58a[_0x5d8751['name']]={'$like':'%'+_0x18a26c[_0x6f77('0x33')][_0x6f77('0x39')]+'%'};return _0x28e58a;}})});}_0x21c407=_[_0x6f77('0x3b')]({},_0x21c407,_0x18a26c[_0x6f77('0x3c')]);var _0x124647={'where':_0x21c407[_0x6f77('0x3a')]};return db[_0x6f77('0x2b')]['count'](_0x124647)['then'](function(_0x22c413){_0x4ab6e3['count']=_0x22c413;if(_0x18a26c['query'][_0x6f77('0x3d')]){_0x21c407['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x21c407);})['then'](function(_0x6dfa38){_0x4ab6e3['rows']=_0x6dfa38;return _0x4ab6e3;})[_0x6f77('0x23')](respondWithFilteredResult(_0x5c48df,_0x21c407))[_0x6f77('0x3e')](handleError(_0x5c48df,null));};exports[_0x6f77('0x3f')]=function(_0x37ad23,_0x29c1d8){var _0x4d56f2={'raw':!![],'where':{'id':_0x37ad23[_0x6f77('0x40')]['id']}},_0x3eee6d={};_0x3eee6d[_0x6f77('0x2f')]=_['keys'](db[_0x6f77('0x2b')]['rawAttributes']);_0x3eee6d[_0x6f77('0x33')]=_['keys'](_0x37ad23[_0x6f77('0x33')]);_0x3eee6d[_0x6f77('0x38')]=_[_0x6f77('0x31')](_0x3eee6d[_0x6f77('0x2f')],_0x3eee6d[_0x6f77('0x33')]);_0x4d56f2[_0x6f77('0x32')]=_[_0x6f77('0x31')](_0x3eee6d[_0x6f77('0x2f')],qs[_0x6f77('0x34')](_0x37ad23['query']['fields']));_0x4d56f2[_0x6f77('0x32')]=_0x4d56f2['attributes'][_0x6f77('0x35')]?_0x4d56f2['attributes']:_0x3eee6d[_0x6f77('0x2f')];if(_0x37ad23[_0x6f77('0x33')][_0x6f77('0x3d')]){_0x4d56f2[_0x6f77('0x41')]=[{'all':!![]}];}_0x4d56f2=_['merge']({},_0x4d56f2,_0x37ad23[_0x6f77('0x3c')]);return db[_0x6f77('0x2b')][_0x6f77('0x42')](_0x4d56f2)[_0x6f77('0x23')](handleEntityNotFound(_0x29c1d8,null))['then'](respondWithResult(_0x29c1d8,null))[_0x6f77('0x3e')](handleError(_0x29c1d8,null));};exports[_0x6f77('0x43')]=function(_0x3987f2,_0x2160bb){return db['SquareDetailsReport']['create'](_0x3987f2['body'],{})['then'](respondWithResult(_0x2160bb,0xc9))[_0x6f77('0x3e')](handleError(_0x2160bb,null));};exports['update']=function(_0x4b2342,_0x4a5382){if(_0x4b2342[_0x6f77('0x44')]['id']){delete _0x4b2342['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x4b2342[_0x6f77('0x40')]['id']}})[_0x6f77('0x23')](handleEntityNotFound(_0x4a5382,null))[_0x6f77('0x23')](saveUpdates(_0x4b2342[_0x6f77('0x44')],null))['then'](respondWithResult(_0x4a5382,null))[_0x6f77('0x3e')](handleError(_0x4a5382,null));};exports[_0x6f77('0x24')]=function(_0x3b0299,_0x2e531a){return db[_0x6f77('0x2b')][_0x6f77('0x42')]({'where':{'id':_0x3b0299[_0x6f77('0x40')]['id']}})[_0x6f77('0x23')](handleEntityNotFound(_0x2e531a,null))[_0x6f77('0x23')](removeEntity(_0x2e531a,null))[_0x6f77('0x3e')](handleError(_0x2e531a,null));};exports[_0x6f77('0x45')]=function(_0x5ed7bb,_0x43f7cb){return db[_0x6f77('0x2b')]['describe']()[_0x6f77('0x23')](respondWithResult(_0x43f7cb,null))[_0x6f77('0x3e')](handleError(_0x43f7cb,null));}; \ No newline at end of file +var _0x1e43=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','save','update','then','destroy','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','create','body','find','params','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x128313,_0x50691d){var _0x77a919=function(_0x320065){while(--_0x320065){_0x128313['push'](_0x128313['shift']());}};_0x77a919(++_0x50691d);}(_0x1e43,0x1d1));var _0x31e4=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x1e43[_0x592e40];return _0x5d4288;};'use strict';var emlformat=require(_0x31e4('0x0'));var rimraf=require(_0x31e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x31e4('0x2'));var moment=require(_0x31e4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31e4('0x4'));var path=require(_0x31e4('0x5'));var sox=require(_0x31e4('0x6'));var csv=require(_0x31e4('0x7'));var ejs=require(_0x31e4('0x8'));var fs=require('fs');var fs_extra=require(_0x31e4('0x9'));var _=require(_0x31e4('0xa'));var squel=require(_0x31e4('0xb'));var crypto=require('crypto');var jsforce=require(_0x31e4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x31e4('0x7'));var querystring=require(_0x31e4('0xd'));var Papa=require(_0x31e4('0xe'));var Redis=require(_0x31e4('0xf'));var authService=require(_0x31e4('0x10'));var qs=require(_0x31e4('0x11'));var as=require(_0x31e4('0x12'));var hardwareService=require(_0x31e4('0x13'));var logger=require(_0x31e4('0x14'))(_0x31e4('0x15'));var utils=require(_0x31e4('0x16'));var config=require(_0x31e4('0x17'));var licenseUtil=require(_0x31e4('0x18'));var db=require(_0x31e4('0x19'))['db'];function respondWithStatusCode(_0x3efa2f,_0x4a25e0){_0x4a25e0=_0x4a25e0||0xcc;return function(_0x508cb9){if(_0x508cb9){return _0x3efa2f[_0x31e4('0x1a')](_0x4a25e0);}return _0x3efa2f[_0x31e4('0x1b')](_0x4a25e0)[_0x31e4('0x1c')]();};}function respondWithResult(_0x231bdb,_0x30fced){_0x30fced=_0x30fced||0xc8;return function(_0x2af530){if(_0x2af530){return _0x231bdb[_0x31e4('0x1b')](_0x30fced)[_0x31e4('0x1d')](_0x2af530);}};}function respondWithFilteredResult(_0x4d32c2,_0x37ac09){return function(_0x5e67a0){if(_0x5e67a0){var _0x2299ab=typeof _0x37ac09[_0x31e4('0x1e')]==='undefined'&&typeof _0x37ac09[_0x31e4('0x1f')]==='undefined';var _0x310135=_0x5e67a0[_0x31e4('0x20')];var _0x2fca3f=_0x2299ab?0x0:_0x37ac09[_0x31e4('0x1e')];var _0x20b8c7=_0x2299ab?_0x5e67a0[_0x31e4('0x20')]:_0x37ac09[_0x31e4('0x1e')]+_0x37ac09[_0x31e4('0x1f')];var _0x88373d;if(_0x20b8c7>=_0x310135){_0x20b8c7=_0x310135;_0x88373d=0xc8;}else{_0x88373d=0xce;}_0x4d32c2['status'](_0x88373d);return _0x4d32c2['set']('Content-Range',_0x2fca3f+'-'+_0x20b8c7+'/'+_0x310135)[_0x31e4('0x1d')](_0x5e67a0);}return null;};}function patchUpdates(_0x1eb228){return function(_0x108049){try{jsonpatch['apply'](_0x108049,_0x1eb228,!![]);}catch(_0x31b458){return BPromise['reject'](_0x31b458);}return _0x108049[_0x31e4('0x21')]();};}function saveUpdates(_0x1ff4c5,_0x133686){return function(_0xecb9a3){if(_0xecb9a3){return _0xecb9a3[_0x31e4('0x22')](_0x1ff4c5)[_0x31e4('0x23')](function(_0x769307){return _0x769307;});}return null;};}function removeEntity(_0x321183,_0x1146ec){return function(_0x924ba8){if(_0x924ba8){return _0x924ba8[_0x31e4('0x24')]()['then'](function(){_0x321183[_0x31e4('0x1b')](0xcc)[_0x31e4('0x1c')]();});}};}function handleEntityNotFound(_0x36c6a9,_0x7f7e18){return function(_0x1da1ec){if(!_0x1da1ec){_0x36c6a9['sendStatus'](0x194);}return _0x1da1ec;};}function handleError(_0x54f71b,_0x234690){_0x234690=_0x234690||0x1f4;return function(_0x926b9c){logger[_0x31e4('0x25')](_0x926b9c['stack']);if(_0x926b9c[_0x31e4('0x26')]){delete _0x926b9c[_0x31e4('0x26')];}_0x54f71b['status'](_0x234690)[_0x31e4('0x27')](_0x926b9c);};}exports['index']=function(_0x3d1ebb,_0x411908){var _0x151321={},_0x10dfec={},_0x1ebb36={'count':0x0,'rows':[]};var _0x32269e=_[_0x31e4('0x28')](db[_0x31e4('0x29')][_0x31e4('0x2a')],function(_0x13ccde){return{'name':_0x13ccde[_0x31e4('0x2b')],'type':_0x13ccde[_0x31e4('0x2c')][_0x31e4('0x2d')]};});_0x10dfec[_0x31e4('0x2e')]=_['map'](_0x32269e,_0x31e4('0x26'));_0x10dfec[_0x31e4('0x2f')]=_[_0x31e4('0x30')](_0x3d1ebb[_0x31e4('0x2f')]);_0x10dfec[_0x31e4('0x31')]=_[_0x31e4('0x32')](_0x10dfec['model'],_0x10dfec['query']);_0x151321[_0x31e4('0x33')]=_[_0x31e4('0x32')](_0x10dfec['model'],qs[_0x31e4('0x34')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x34')]));_0x151321[_0x31e4('0x33')]=_0x151321['attributes'][_0x31e4('0x35')]?_0x151321[_0x31e4('0x33')]:_0x10dfec[_0x31e4('0x2e')];if(!_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x36')](_0x31e4('0x37'))){_0x151321[_0x31e4('0x1f')]=qs[_0x31e4('0x1f')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x1f')]);_0x151321[_0x31e4('0x1e')]=qs['offset'](_0x3d1ebb[_0x31e4('0x2f')]['offset']);}_0x151321['order']=qs[_0x31e4('0x38')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x38')]);_0x151321[_0x31e4('0x39')]=qs['filters'](_['pick'](_0x3d1ebb[_0x31e4('0x2f')],_0x10dfec[_0x31e4('0x31')]),_0x32269e);if(_0x3d1ebb['query']['filter']){_0x151321[_0x31e4('0x39')]=_[_0x31e4('0x3a')](_0x151321[_0x31e4('0x39')],{'$or':_['map'](_0x32269e,function(_0x9577ad){if(_0x9577ad['type']!==_0x31e4('0x3b')){var _0x3fe065={};_0x3fe065[_0x9577ad[_0x31e4('0x26')]]={'$like':'%'+_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x3c')]+'%'};return _0x3fe065;}})});}_0x151321=_[_0x31e4('0x3a')]({},_0x151321,_0x3d1ebb[_0x31e4('0x3d')]);var _0xb0bb82={'where':_0x151321[_0x31e4('0x39')]};return db[_0x31e4('0x29')][_0x31e4('0x20')](_0xb0bb82)[_0x31e4('0x23')](function(_0x10e65a){_0x1ebb36[_0x31e4('0x20')]=_0x10e65a;if(_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x3e')]){_0x151321[_0x31e4('0x3f')]=[{'all':!![]}];}return db[_0x31e4('0x29')]['findAll'](_0x151321);})[_0x31e4('0x23')](function(_0x12548f){_0x1ebb36[_0x31e4('0x40')]=_0x12548f;return _0x1ebb36;})[_0x31e4('0x23')](respondWithFilteredResult(_0x411908,_0x151321))[_0x31e4('0x41')](handleError(_0x411908,null));};exports['show']=function(_0x1bcd45,_0xe37ac4){var _0x5d05b6={'raw':!![],'where':{'id':_0x1bcd45['params']['id']}},_0x39ca23={};_0x39ca23['model']=_[_0x31e4('0x30')](db[_0x31e4('0x29')][_0x31e4('0x2a')]);_0x39ca23[_0x31e4('0x2f')]=_[_0x31e4('0x30')](_0x1bcd45[_0x31e4('0x2f')]);_0x39ca23['filters']=_[_0x31e4('0x32')](_0x39ca23[_0x31e4('0x2e')],_0x39ca23[_0x31e4('0x2f')]);_0x5d05b6[_0x31e4('0x33')]=_[_0x31e4('0x32')](_0x39ca23[_0x31e4('0x2e')],qs[_0x31e4('0x34')](_0x1bcd45[_0x31e4('0x2f')][_0x31e4('0x34')]));_0x5d05b6[_0x31e4('0x33')]=_0x5d05b6[_0x31e4('0x33')][_0x31e4('0x35')]?_0x5d05b6[_0x31e4('0x33')]:_0x39ca23[_0x31e4('0x2e')];if(_0x1bcd45['query'][_0x31e4('0x3e')]){_0x5d05b6[_0x31e4('0x3f')]=[{'all':!![]}];}_0x5d05b6=_['merge']({},_0x5d05b6,_0x1bcd45['options']);return db[_0x31e4('0x29')]['find'](_0x5d05b6)[_0x31e4('0x23')](handleEntityNotFound(_0xe37ac4,null))[_0x31e4('0x23')](respondWithResult(_0xe37ac4,null))['catch'](handleError(_0xe37ac4,null));};exports[_0x31e4('0x42')]=function(_0x1c5077,_0xac211){return db[_0x31e4('0x29')]['create'](_0x1c5077[_0x31e4('0x43')],{})[_0x31e4('0x23')](respondWithResult(_0xac211,0xc9))[_0x31e4('0x41')](handleError(_0xac211,null));};exports['update']=function(_0x1e80a4,_0x48bbf2){if(_0x1e80a4[_0x31e4('0x43')]['id']){delete _0x1e80a4[_0x31e4('0x43')]['id'];}return db[_0x31e4('0x29')][_0x31e4('0x44')]({'where':{'id':_0x1e80a4[_0x31e4('0x45')]['id']}})[_0x31e4('0x23')](handleEntityNotFound(_0x48bbf2,null))['then'](saveUpdates(_0x1e80a4['body'],null))[_0x31e4('0x23')](respondWithResult(_0x48bbf2,null))[_0x31e4('0x41')](handleError(_0x48bbf2,null));};exports['destroy']=function(_0x105f46,_0x3127e3){return db[_0x31e4('0x29')][_0x31e4('0x44')]({'where':{'id':_0x105f46[_0x31e4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3127e3,null))['then'](removeEntity(_0x3127e3,null))[_0x31e4('0x41')](handleError(_0x3127e3,null));};exports['describe']=function(_0x45a37a,_0x370bfa){return db[_0x31e4('0x29')]['describe']()[_0x31e4('0x23')](respondWithResult(_0x370bfa,null))[_0x31e4('0x41')](handleError(_0x370bfa,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 82e7c93..1480ec1 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 _0x8a4b=['SquareDetailsReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./squareReportDetail.attributes','exports','define'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8a4b,0x156));var _0xb8a4=function(_0xc71f27,_0x1c9acc){_0xc71f27=_0xc71f27-0x0;var _0x737ed1=_0x8a4b[_0xc71f27];return _0x737ed1;};'use strict';var _=require(_0xb8a4('0x0'));var util=require('util');var logger=require(_0xb8a4('0x1'))(_0xb8a4('0x2'));var moment=require(_0xb8a4('0x3'));var BPromise=require(_0xb8a4('0x4'));var rp=require(_0xb8a4('0x5'));var fs=require('fs');var path=require(_0xb8a4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb8a4('0x7'));module[_0xb8a4('0x8')]=function(_0xacbcc5,_0x5b09e7){return _0xacbcc5[_0xb8a4('0x9')](_0xb8a4('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e6=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa0e6,0xa2));var _0x6a0e=function(_0x38bc73,_0x15d23b){_0x38bc73=_0x38bc73-0x0;var _0x39029c=_0xa0e6[_0x38bc73];return _0x39029c;};'use strict';var _=require(_0x6a0e('0x0'));var util=require('util');var logger=require(_0x6a0e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6a0e('0x2'));var rp=require(_0x6a0e('0x3'));var fs=require('fs');var path=require(_0x6a0e('0x4'));var rimraf=require(_0x6a0e('0x5'));var config=require(_0x6a0e('0x6'));var attributes=require(_0x6a0e('0x7'));module['exports']=function(_0xa88ef,_0x1cca8d){return _0xa88ef[_0x6a0e('0x8')](_0x6a0e('0x9'),attributes,{'tableName':_0x6a0e('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 6592b7b..3104c54 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw'];(function(_0x2005db,_0x2b99b0){var _0x40e19a=function(_0x1bc6f0){while(--_0x1bc6f0){_0x2005db['push'](_0x2005db['shift']());}};_0x40e19a(++_0x2b99b0);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x52ce14,_0x42fdeb){_0x52ce14=_0x52ce14-0x0;var _0x499693=_0xd7d1[_0x52ce14];return _0x499693;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['SquareDetailsReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateSquareDetailsReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});}; \ No newline at end of file +var _0x536f=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','options','debug','catch','lodash','ioredis','../../mysqldb'];(function(_0x5d7de9,_0x5c2549){var _0x464f90=function(_0x4ffe83){while(--_0x4ffe83){_0x5d7de9['push'](_0x5d7de9['shift']());}};_0x464f90(++_0x5c2549);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf536('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf536('0x1'));var db=require(_0xf536('0x2'))['db'];var utils=require(_0xf536('0x3'));var logger=require(_0xf536('0x4'))('rpc');var config=require(_0xf536('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf536('0x6')][_0xf536('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fc517,_0x486ee3,_0x5952b7){return new BPromise(function(_0x3b5191,_0x422541){return client[_0xf536('0x8')](_0x2fc517,_0x5952b7)[_0xf536('0x9')](function(_0x4f2eaf){logger['info'](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x486ee3,_0xf536('0xb'),JSON[_0xf536('0xc')](_0x4f2eaf));if(_0x4f2eaf[_0xf536('0xd')]){if(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xe')]===0x1f4){logger['error'](_0xf536('0xa'),_0x486ee3,_0x4f2eaf['error'][_0xf536('0xf')]);return _0x422541(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}logger[_0xf536('0xd')](_0xf536('0xa'),_0x486ee3,_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);return _0x3b5191(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}else{logger[_0xf536('0x10')](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));_0x3b5191(_0x4f2eaf['result'][_0xf536('0xf')]);}})['catch'](function(_0x238b9d){logger['error'](_0xf536('0xa'),_0x486ee3,_0x238b9d);_0x422541(_0x238b9d);});});}exports[_0xf536('0x11')]=function(_0xbca324){var _0x19756b=this;return new Promise(function(_0x4532a0,_0x189334){return db[_0xf536('0x12')][_0xf536('0x13')](_0xbca324['body'],{'raw':_0xbca324[_0xf536('0x14')]?_0xbca324[_0xf536('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x466f95){logger[_0xf536('0x10')](_0xf536('0x11'),_0xbca324);logger[_0xf536('0x15')](_0xf536('0x11'),_0xbca324,JSON[_0xf536('0xc')](_0x466f95));_0x4532a0(_0x466f95);})[_0xf536('0x16')](function(_0xe1d6a8){logger[_0xf536('0xd')](_0xf536('0x11'),_0xe1d6a8['message'],_0xbca324);_0x189334(_0x19756b[_0xf536('0xd')](0x1f4,_0xe1d6a8[_0xf536('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9482380..fdd7d5a 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 _0xa940=['express','Router','./system.controller','get','isAuthenticated','exports'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xa940,0x11a));var _0x0a94=function(_0x5a29b1,_0x289beb){_0x5a29b1=_0x5a29b1-0x0;var _0x33c05d=_0xa940[_0x5a29b1];return _0x33c05d;};'use strict';var express=require(_0x0a94('0x0'));var router=express[_0x0a94('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0a94('0x2'));router[_0x0a94('0x3')]('/',auth[_0x0a94('0x4')](),controller['index']);router['get']('/process/:pid/kill',auth[_0x0a94('0x4')](),controller['killProcess']);module[_0x0a94('0x5')]=router; \ No newline at end of file +var _0x3023=['get','/process/:pid/kill','exports','express','Router','../../components/auth/service','isAuthenticated','index'];(function(_0x48777e,_0x4f2067){var _0x496f73=function(_0x41c814){while(--_0x41c814){_0x48777e['push'](_0x48777e['shift']());}};_0x496f73(++_0x4f2067);}(_0x3023,0xe3));var _0x3302=function(_0x13963b,_0x522396){_0x13963b=_0x13963b-0x0;var _0x36ee75=_0x3023[_0x13963b];return _0x36ee75;};'use strict';var express=require(_0x3302('0x0'));var router=express[_0x3302('0x1')]();var auth=require(_0x3302('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0x3302('0x3')](),controller[_0x3302('0x4')]);router[_0x3302('0x5')](_0x3302('0x6'),auth[_0x3302('0x3')](),controller['killProcess']);module[_0x3302('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a5403ca..bd62caf 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 _0xadfc=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','then','status','json','killProcess','params','pid','split','length','indexOf','format'];(function(_0x5e186d,_0x4cbcb4){var _0x20e313=function(_0x83a093){while(--_0x83a093){_0x5e186d['push'](_0x5e186d['shift']());}};_0x20e313(++_0x4cbcb4);}(_0xadfc,0xef));var _0xcadf=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xadfc[_0x1d9aa0];return _0x226868;};'use strict';var info=require(_0xcadf('0x0'));var exec=require(_0xcadf('0x1'))[_0xcadf('0x2')];var logger=require(_0xcadf('0x3'))('api');var util=require(_0xcadf('0x4'));var BPromise=require(_0xcadf('0x5'));var _=require('lodash');function handleError(_0x1766c6,_0x3fdc2d,_0x3c7b0c){_0x3fdc2d=_0x3fdc2d||0x1f4;return function(_0x3846bc){logger[_0xcadf('0x6')](_0xcadf('0x7'),_0x3c7b0c,_0x3fdc2d,util[_0xcadf('0x8')](_0x3846bc,{'showHidden':![],'depth':null}));delete _0x3846bc[_0xcadf('0x9')];_0x1766c6['status'](_0x3fdc2d)[_0xcadf('0xa')](_0x3846bc);};}exports['index']=function(_0x5c7dab,_0x5cbe3d){return info['getAllData']()[_0xcadf('0xb')](function(_0x79ede9){return _0x5cbe3d[_0xcadf('0xc')](0xc8)[_0xcadf('0xd')](_0x79ede9);})['catch'](function(_0x4fa542){return _0x5cbe3d['status'](0x1f4)[_0xcadf('0xd')](_0x4fa542);});};exports[_0xcadf('0xe')]=function(_0x55569e,_0x210635){var _0x5e5ffb=['components/import/cm'];return new BPromise(function(_0x539644,_0x3e7c2d){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x55569e[_0xcadf('0xf')][_0xcadf('0x10')]),function(_0xc89234,_0x39020a,_0x17bd31){if(_0xc89234){return _0x3e7c2d(_0xc89234);}return _0x539644(_0x39020a);});})[_0xcadf('0xb')](function(_0x1f8b69){var _0x49139a=![];var _0x4fdb4a=_0x1f8b69[_0xcadf('0x11')](/\n/);for(var _0x1aac10=0x0,_0x48dbac=_0x5e5ffb[_0xcadf('0x12')];_0x1aac10<_0x48dbac,_0x49139a===![];_0x1aac10+=0x1){if(_0x1f8b69[_0xcadf('0x13')](_0x5e5ffb[_0x1aac10])>=0x0){_0x49139a=!![];}}if(!_0x49139a){throw new Error(util[_0xcadf('0x14')](_0xcadf('0x15'),_0x55569e[_0xcadf('0xf')][_0xcadf('0x10')]));}process[_0xcadf('0x16')](_0x55569e['params'][_0xcadf('0x10')],_0xcadf('0x17'));return _0x210635['status'](0xc8)['json']({'message':util[_0xcadf('0x14')](_0xcadf('0x18'),_0x55569e[_0xcadf('0xf')][_0xcadf('0x10')])});})[_0xcadf('0x19')](handleError(_0x210635,null,_0xcadf('0xe')));}; \ No newline at end of file +var _0x8389=['exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process'];(function(_0x1e2866,_0xb1ddc3){var _0x16fcf4=function(_0x3f3cf4){while(--_0x3f3cf4){_0x1e2866['push'](_0x1e2866['shift']());}};_0x16fcf4(++_0xb1ddc3);}(_0x8389,0x14e));var _0x9838=function(_0xafc1d1,_0x56b26f){_0xafc1d1=_0xafc1d1-0x0;var _0x3e9a55=_0x8389[_0xafc1d1];return _0x3e9a55;};'use strict';var info=require(_0x9838('0x0'));var exec=require(_0x9838('0x1'))[_0x9838('0x2')];var logger=require(_0x9838('0x3'))(_0x9838('0x4'));var util=require(_0x9838('0x5'));var BPromise=require(_0x9838('0x6'));var _=require('lodash');function handleError(_0x95ea1b,_0xdb9699,_0x460b0d){_0xdb9699=_0xdb9699||0x1f4;return function(_0x3bb501){logger[_0x9838('0x7')](_0x9838('0x8'),_0x460b0d,_0xdb9699,util[_0x9838('0x9')](_0x3bb501,{'showHidden':![],'depth':null}));delete _0x3bb501['name'];_0x95ea1b[_0x9838('0xa')](_0xdb9699)['send'](_0x3bb501);};}exports[_0x9838('0xb')]=function(_0x1f29e5,_0x23cadf){return info[_0x9838('0xc')]()[_0x9838('0xd')](function(_0x279bbb){return _0x23cadf[_0x9838('0xa')](0xc8)[_0x9838('0xe')](_0x279bbb);})[_0x9838('0xf')](function(_0x50b9ea){return _0x23cadf['status'](0x1f4)['json'](_0x50b9ea);});};exports[_0x9838('0x10')]=function(_0x286484,_0x34b46f){var _0x1dbb9b=[_0x9838('0x11')];return new BPromise(function(_0x3ff484,_0x371ff3){return exec(util[_0x9838('0x12')](_0x9838('0x13'),_0x286484[_0x9838('0x14')]['pid']),function(_0x360028,_0x3a0437,_0x4a77d8){if(_0x360028){return _0x371ff3(_0x360028);}return _0x3ff484(_0x3a0437);});})[_0x9838('0xd')](function(_0x44e8b9){var _0x55bfbf=![];var _0x4c87ad=_0x44e8b9[_0x9838('0x15')](/\n/);for(var _0x4b1f50=0x0,_0x59f0e2=_0x1dbb9b[_0x9838('0x16')];_0x4b1f50<_0x59f0e2,_0x55bfbf===![];_0x4b1f50+=0x1){if(_0x44e8b9['indexOf'](_0x1dbb9b[_0x4b1f50])>=0x0){_0x55bfbf=!![];}}if(!_0x55bfbf){throw new Error(util['format'](_0x9838('0x17'),_0x286484[_0x9838('0x14')][_0x9838('0x18')]));}process[_0x9838('0x19')](_0x286484[_0x9838('0x14')][_0x9838('0x18')],_0x9838('0x1a'));return _0x34b46f[_0x9838('0xa')](0xc8)[_0x9838('0xe')]({'message':util[_0x9838('0x12')](_0x9838('0x1b'),_0x286484[_0x9838('0x14')][_0x9838('0x18')])});})['catch'](handleError(_0x34b46f,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a7deab6..c0b1be4 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 _0xd509=['post','create','/:id','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','show'];(function(_0x4465e1,_0x240d0a){var _0x3d1718=function(_0x380353){while(--_0x380353){_0x4465e1['push'](_0x4465e1['shift']());}};_0x3d1718(++_0x240d0a);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d50('0x0'));var timeout=require(_0x9d50('0x1'));var express=require(_0x9d50('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9d50('0x3'));var interaction=require(_0x9d50('0x4'));var config=require('../../config/environment');var controller=require(_0x9d50('0x5'));router[_0x9d50('0x6')]('/',auth[_0x9d50('0x7')](),controller['index']);router[_0x9d50('0x6')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0x8')]);router[_0x9d50('0x9')]('/',auth[_0x9d50('0x7')](),controller[_0x9d50('0xa')]);router['put'](_0x9d50('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9d50('0xc')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0xd')]);module[_0x9d50('0xe')]=router; \ No newline at end of file +var _0x48fa=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48fa,0x127));var _0xa48f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x48fa[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0xa48f('0x0'));var util=require(_0xa48f('0x1'));var path=require(_0xa48f('0x2'));var timeout=require(_0xa48f('0x3'));var express=require(_0xa48f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa48f('0x5'));var config=require(_0xa48f('0x6'));var controller=require(_0xa48f('0x7'));router['get']('/',auth[_0xa48f('0x8')](),controller[_0xa48f('0x9')]);router[_0xa48f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa48f('0xb')]);router[_0xa48f('0xc')]('/',auth['isAuthenticated'](),controller[_0xa48f('0xd')]);router[_0xa48f('0xe')](_0xa48f('0xf'),auth[_0xa48f('0x8')](),controller[_0xa48f('0x10')]);router['delete'](_0xa48f('0xf'),auth[_0xa48f('0x8')](),controller[_0xa48f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 035d328..36b0d7e 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 _0xf6ed=['sequelize','STRING','name'];(function(_0x27907f,_0x85a907){var _0x4764e7=function(_0x5acfed){while(--_0x5acfed){_0x27907f['push'](_0x27907f['shift']());}};_0x4764e7(++_0x85a907);}(_0xf6ed,0x1ce));var _0xdf6e=function(_0x28d7ac,_0xaec5b7){_0x28d7ac=_0x28d7ac-0x0;var _0x24d2ac=_0xf6ed[_0x28d7ac];return _0x24d2ac;};'use strict';var Sequelize=require(_0xdf6e('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf6e('0x1')],'unique':_0xdf6e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xdf6e('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7d25=['name','#0091EA','exports','STRING'];(function(_0x4dfcfe,_0x3a8926){var _0x3dcad5=function(_0x1b1471){while(--_0x1b1471){_0x4dfcfe['push'](_0x4dfcfe['shift']());}};_0x3dcad5(++_0x3a8926);}(_0x7d25,0x8a));var _0x57d2=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7d25[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'unique':_0x57d2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x57d2('0x1')],'defaultValue':_0x57d2('0x3')},'description':{'type':Sequelize[_0x57d2('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 28a7b8a..fcaebaa 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 _0x2dae=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','save','update','then','get','Tags','UserProfileResource','destroy','stack','name','map','Tag','rawAttributes','type','key','model','query','keys'];(function(_0x69166c,_0x5195f1){var _0x4a9d8=function(_0x3d2d55){while(--_0x3d2d55){_0x69166c['push'](_0x69166c['shift']());}};_0x4a9d8(++_0x5195f1);}(_0x2dae,0xc3));var _0xe2da=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x2dae[_0x4226d6];return _0x19655b;};'use strict';var emlformat=require(_0xe2da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2da('0x1'));var jsonpatch=require(_0xe2da('0x2'));var rp=require(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require(_0xe2da('0x5'));var Mustache=require('mustache');var util=require(_0xe2da('0x6'));var path=require(_0xe2da('0x7'));var sox=require(_0xe2da('0x8'));var csv=require(_0xe2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2da('0xa'));var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x9'));var querystring=require(_0xe2da('0x10'));var Papa=require(_0xe2da('0x11'));var Redis=require('ioredis');var authService=require(_0xe2da('0x12'));var qs=require(_0xe2da('0x13'));var as=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2da('0x1a'))['db'];function respondWithStatusCode(_0x5200b1,_0x4377c6){_0x4377c6=_0x4377c6||0xcc;return function(_0x245ad7){if(_0x245ad7){return _0x5200b1[_0xe2da('0x1b')](_0x4377c6);}return _0x5200b1[_0xe2da('0x1c')](_0x4377c6)[_0xe2da('0x1d')]();};}function respondWithResult(_0x5660b5,_0x295a86){_0x295a86=_0x295a86||0xc8;return function(_0x48584b){if(_0x48584b){return _0x5660b5[_0xe2da('0x1c')](_0x295a86)['json'](_0x48584b);}};}function respondWithFilteredResult(_0x586b27,_0x403d1c){return function(_0x3dfc52){if(_0x3dfc52){var _0x33f919=typeof _0x403d1c['offset']===_0xe2da('0x1e')&&typeof _0x403d1c[_0xe2da('0x1f')]===_0xe2da('0x1e');var _0x33568f=_0x3dfc52['count'];var _0x45bb92=_0x33f919?0x0:_0x403d1c[_0xe2da('0x20')];var _0x417363=_0x33f919?_0x3dfc52[_0xe2da('0x21')]:_0x403d1c[_0xe2da('0x20')]+_0x403d1c['limit'];var _0x56eeb1;if(_0x417363>=_0x33568f){_0x417363=_0x33568f;_0x56eeb1=0xc8;}else{_0x56eeb1=0xce;}_0x586b27[_0xe2da('0x1c')](_0x56eeb1);return _0x586b27['set'](_0xe2da('0x22'),_0x45bb92+'-'+_0x417363+'/'+_0x33568f)[_0xe2da('0x23')](_0x3dfc52);}return null;};}function patchUpdates(_0x332193){return function(_0x203d36){try{jsonpatch[_0xe2da('0x24')](_0x203d36,_0x332193,!![]);}catch(_0x3e22de){return BPromise['reject'](_0x3e22de);}return _0x203d36[_0xe2da('0x25')]();};}function saveUpdates(_0x53cc4e,_0x30efdc){return function(_0x191d38){if(_0x191d38){return _0x191d38[_0xe2da('0x26')](_0x53cc4e)[_0xe2da('0x27')](function(_0x30dea4){return _0x30dea4;});}return null;};}function removeEntity(_0x1e45e9,_0x38f2c4){return function(_0x221e98){if(_0x221e98){return _0x221e98['destroy']()[_0xe2da('0x27')](function(){var _0x357bff=_0x221e98[_0xe2da('0x28')]({'plain':!![]});var _0x14704d=_0xe2da('0x29');return db[_0xe2da('0x2a')][_0xe2da('0x2b')]({'where':{'type':_0x14704d,'resourceId':_0x357bff['id']}})['then'](function(){return _0x221e98;});})[_0xe2da('0x27')](function(){_0x1e45e9[_0xe2da('0x1c')](0xcc)[_0xe2da('0x1d')]();});}};}function handleEntityNotFound(_0x38ee5e,_0x36ca43){return function(_0x2b6c9e){if(!_0x2b6c9e){_0x38ee5e[_0xe2da('0x1b')](0x194);}return _0x2b6c9e;};}function handleError(_0x39f60e,_0x516f42){_0x516f42=_0x516f42||0x1f4;return function(_0x487a7c){logger['error'](_0x487a7c[_0xe2da('0x2c')]);if(_0x487a7c[_0xe2da('0x2d')]){delete _0x487a7c[_0xe2da('0x2d')];}_0x39f60e[_0xe2da('0x1c')](_0x516f42)['send'](_0x487a7c);};}exports['index']=function(_0x356ab4,_0x1ec8ca){var _0x262d40={},_0x39f983={},_0x7ab5ee={'count':0x0,'rows':[]};var _0x15df33=_[_0xe2da('0x2e')](db[_0xe2da('0x2f')][_0xe2da('0x30')],function(_0x499400){return{'name':_0x499400['fieldName'],'type':_0x499400[_0xe2da('0x31')][_0xe2da('0x32')]};});_0x39f983[_0xe2da('0x33')]=_[_0xe2da('0x2e')](_0x15df33,_0xe2da('0x2d'));_0x39f983[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x356ab4[_0xe2da('0x34')]);_0x39f983[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],_0x39f983[_0xe2da('0x34')]);_0x262d40[_0xe2da('0x38')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x39')]));_0x262d40['attributes']=_0x262d40[_0xe2da('0x38')][_0xe2da('0x3a')]?_0x262d40[_0xe2da('0x38')]:_0x39f983['model'];if(!_0x356ab4[_0xe2da('0x34')][_0xe2da('0x3b')](_0xe2da('0x3c'))){_0x262d40['limit']=qs['limit'](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x1f')]);_0x262d40['offset']=qs[_0xe2da('0x20')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x20')]);}_0x262d40[_0xe2da('0x3d')]=qs[_0xe2da('0x3e')](_0x356ab4['query'][_0xe2da('0x3e')]);_0x262d40['where']=qs['filters'](_[_0xe2da('0x3f')](_0x356ab4['query'],_0x39f983[_0xe2da('0x36')]),_0x15df33);if(_0x356ab4[_0xe2da('0x34')]['filter']){_0x262d40[_0xe2da('0x40')]=_[_0xe2da('0x41')](_0x262d40['where'],{'$or':_['map'](_0x15df33,function(_0x55be3e){if(_0x55be3e[_0xe2da('0x31')]!==_0xe2da('0x42')){var _0x26ba99={};_0x26ba99[_0x55be3e[_0xe2da('0x2d')]]={'$like':'%'+_0x356ab4[_0xe2da('0x34')][_0xe2da('0x43')]+'%'};return _0x26ba99;}})});}_0x262d40=_[_0xe2da('0x41')]({},_0x262d40,_0x356ab4['options']);var _0x3d1fd={'where':_0x262d40[_0xe2da('0x40')]};return db[_0xe2da('0x2f')][_0xe2da('0x21')](_0x3d1fd)[_0xe2da('0x27')](function(_0x5a1550){_0x7ab5ee[_0xe2da('0x21')]=_0x5a1550;if(_0x356ab4[_0xe2da('0x34')][_0xe2da('0x44')]){_0x262d40['include']=[{'all':!![]}];}return db[_0xe2da('0x2f')][_0xe2da('0x45')](_0x262d40);})[_0xe2da('0x27')](function(_0x4096c5){_0x7ab5ee[_0xe2da('0x46')]=_0x4096c5;return _0x7ab5ee;})[_0xe2da('0x27')](respondWithFilteredResult(_0x1ec8ca,_0x262d40))[_0xe2da('0x47')](handleError(_0x1ec8ca,null));};exports[_0xe2da('0x48')]=function(_0x4aec15,_0x21cc34){var _0x472d1e={'raw':!![],'where':{'id':_0x4aec15[_0xe2da('0x49')]['id']}},_0x2113e8={};_0x2113e8[_0xe2da('0x33')]=_['keys'](db[_0xe2da('0x2f')][_0xe2da('0x30')]);_0x2113e8[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x4aec15[_0xe2da('0x34')]);_0x2113e8[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x2113e8['model'],_0x2113e8[_0xe2da('0x34')]);_0x472d1e['attributes']=_[_0xe2da('0x37')](_0x2113e8[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x4aec15['query'][_0xe2da('0x39')]));_0x472d1e[_0xe2da('0x38')]=_0x472d1e['attributes'][_0xe2da('0x3a')]?_0x472d1e[_0xe2da('0x38')]:_0x2113e8[_0xe2da('0x33')];if(_0x4aec15['query'][_0xe2da('0x44')]){_0x472d1e['include']=[{'all':!![]}];}_0x472d1e=_['merge']({},_0x472d1e,_0x4aec15[_0xe2da('0x4a')]);return db['Tag'][_0xe2da('0x4b')](_0x472d1e)[_0xe2da('0x27')](handleEntityNotFound(_0x21cc34,null))['then'](respondWithResult(_0x21cc34,null))[_0xe2da('0x47')](handleError(_0x21cc34,null));};exports[_0xe2da('0x4c')]=function(_0x482547,_0x4a6d80){return db[_0xe2da('0x2f')]['create'](_0x482547[_0xe2da('0x4d')],{})[_0xe2da('0x27')](function(_0x259546){var _0x1c17f1=_0x482547[_0xe2da('0x4e')][_0xe2da('0x28')]({'plain':!![]});if(!_0x1c17f1)throw new Error(_0xe2da('0x4f'));if(_0x1c17f1[_0xe2da('0x50')]===_0xe2da('0x4e')){var _0x515f9b=_0x259546[_0xe2da('0x28')]({'plain':!![]});var _0x157c36=_0xe2da('0x29');return db['UserProfileSection'][_0xe2da('0x4b')]({'where':{'name':_0x157c36,'userProfileId':_0x1c17f1[_0xe2da('0x51')]},'raw':!![]})[_0xe2da('0x27')](function(_0x125118){if(_0x125118&&_0x125118[_0xe2da('0x52')]===0x0){return db[_0xe2da('0x2a')][_0xe2da('0x4c')]({'name':_0x515f9b['name'],'resourceId':_0x515f9b['id'],'type':_0x125118['name'],'sectionId':_0x125118['id']},{})[_0xe2da('0x27')](function(){return _0x259546;});}else{return _0x259546;}})[_0xe2da('0x47')](function(_0x28f916){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28f916);throw _0x28f916;});}return _0x259546;})[_0xe2da('0x27')](respondWithResult(_0x4a6d80,0xc9))['catch'](handleError(_0x4a6d80,null));};exports[_0xe2da('0x26')]=function(_0x153749,_0x8e78b9){if(_0x153749[_0xe2da('0x4d')]['id']){delete _0x153749[_0xe2da('0x4d')]['id'];}return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x153749[_0xe2da('0x49')]['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x8e78b9,null))['then'](saveUpdates(_0x153749[_0xe2da('0x4d')],null))[_0xe2da('0x27')](respondWithResult(_0x8e78b9,null))[_0xe2da('0x47')](handleError(_0x8e78b9,null));};exports[_0xe2da('0x2b')]=function(_0x51d174,_0x25b8a7){return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x51d174['params']['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x25b8a7,null))[_0xe2da('0x27')](removeEntity(_0x25b8a7,null))[_0xe2da('0x47')](handleError(_0x25b8a7,null));}; \ No newline at end of file +var _0xb821=['create','body','user','get','role','Tags','find','catch','update','rimraf','zip-dir','moment','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','include','findAll','show','params','keys','includeAll','options'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb821,0xa7));var _0x1b82=function(_0x391730,_0x3f5410){_0x391730=_0x391730-0x0;var _0x408dfe=_0xb821[_0x391730];return _0x408dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];function respondWithStatusCode(_0x241d11,_0x2391f5){_0x2391f5=_0x2391f5||0xcc;return function(_0x61b6eb){if(_0x61b6eb){return _0x241d11['sendStatus'](_0x2391f5);}return _0x241d11[_0x1b82('0x18')](_0x2391f5)['end']();};}function respondWithResult(_0x54915f,_0x1e553a){_0x1e553a=_0x1e553a||0xc8;return function(_0x4bf75b){if(_0x4bf75b){return _0x54915f[_0x1b82('0x18')](_0x1e553a)[_0x1b82('0x19')](_0x4bf75b);}};}function respondWithFilteredResult(_0x5d4cf1,_0x46c2cf){return function(_0x5dab7d){if(_0x5dab7d){var _0x563261=typeof _0x46c2cf[_0x1b82('0x1a')]==='undefined'&&typeof _0x46c2cf[_0x1b82('0x1b')]===_0x1b82('0x1c');var _0xf42818=_0x5dab7d['count'];var _0x514082=_0x563261?0x0:_0x46c2cf[_0x1b82('0x1a')];var _0x5d66c3=_0x563261?_0x5dab7d[_0x1b82('0x1d')]:_0x46c2cf[_0x1b82('0x1a')]+_0x46c2cf[_0x1b82('0x1b')];var _0x594a63;if(_0x5d66c3>=_0xf42818){_0x5d66c3=_0xf42818;_0x594a63=0xc8;}else{_0x594a63=0xce;}_0x5d4cf1[_0x1b82('0x18')](_0x594a63);return _0x5d4cf1[_0x1b82('0x1e')](_0x1b82('0x1f'),_0x514082+'-'+_0x5d66c3+'/'+_0xf42818)[_0x1b82('0x19')](_0x5dab7d);}return null;};}function patchUpdates(_0x10d45c){return function(_0x47e99b){try{jsonpatch[_0x1b82('0x20')](_0x47e99b,_0x10d45c,!![]);}catch(_0x1892b0){return BPromise[_0x1b82('0x21')](_0x1892b0);}return _0x47e99b[_0x1b82('0x22')]();};}function saveUpdates(_0x26e481,_0x31fd64){return function(_0x2d07f4){if(_0x2d07f4){return _0x2d07f4['update'](_0x26e481)[_0x1b82('0x23')](function(_0x233740){return _0x233740;});}return null;};}function removeEntity(_0x5b8d09,_0x561d78){return function(_0x225b81){if(_0x225b81){return _0x225b81[_0x1b82('0x24')]()['then'](function(){var _0x3a1226=_0x225b81['get']({'plain':!![]});var _0x5cd458='Tags';return db[_0x1b82('0x25')][_0x1b82('0x24')]({'where':{'type':_0x5cd458,'resourceId':_0x3a1226['id']}})[_0x1b82('0x23')](function(){return _0x225b81;});})[_0x1b82('0x23')](function(){_0x5b8d09['status'](0xcc)[_0x1b82('0x26')]();});}};}function handleEntityNotFound(_0x165b45,_0x1b5260){return function(_0x7455e8){if(!_0x7455e8){_0x165b45[_0x1b82('0x27')](0x194);}return _0x7455e8;};}function handleError(_0x1b8b6f,_0x223b6a){_0x223b6a=_0x223b6a||0x1f4;return function(_0x21ea34){logger[_0x1b82('0x28')](_0x21ea34[_0x1b82('0x29')]);if(_0x21ea34[_0x1b82('0x2a')]){delete _0x21ea34[_0x1b82('0x2a')];}_0x1b8b6f[_0x1b82('0x18')](_0x223b6a)['send'](_0x21ea34);};}exports[_0x1b82('0x2b')]=function(_0x2931d0,_0x155a34){var _0x457dbb={},_0x18e4ff={},_0x115ce7={'count':0x0,'rows':[]};var _0xd3c4a=_[_0x1b82('0x2c')](db[_0x1b82('0x2d')][_0x1b82('0x2e')],function(_0x501ab0){return{'name':_0x501ab0[_0x1b82('0x2f')],'type':_0x501ab0[_0x1b82('0x30')][_0x1b82('0x31')]};});_0x18e4ff[_0x1b82('0x32')]=_['map'](_0xd3c4a,_0x1b82('0x2a'));_0x18e4ff[_0x1b82('0x33')]=_['keys'](_0x2931d0[_0x1b82('0x33')]);_0x18e4ff[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x18e4ff['model'],_0x18e4ff['query']);_0x457dbb[_0x1b82('0x36')]=_['intersection'](_0x18e4ff['model'],qs[_0x1b82('0x37')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x37')]));_0x457dbb['attributes']=_0x457dbb[_0x1b82('0x36')][_0x1b82('0x38')]?_0x457dbb[_0x1b82('0x36')]:_0x18e4ff[_0x1b82('0x32')];if(!_0x2931d0['query'][_0x1b82('0x39')](_0x1b82('0x3a'))){_0x457dbb[_0x1b82('0x1b')]=qs['limit'](_0x2931d0['query'][_0x1b82('0x1b')]);_0x457dbb['offset']=qs[_0x1b82('0x1a')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x1a')]);}_0x457dbb[_0x1b82('0x3b')]=qs[_0x1b82('0x3c')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x3c')]);_0x457dbb[_0x1b82('0x3d')]=qs['filters'](_['pick'](_0x2931d0[_0x1b82('0x33')],_0x18e4ff['filters']),_0xd3c4a);if(_0x2931d0[_0x1b82('0x33')]['filter']){_0x457dbb[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x457dbb[_0x1b82('0x3d')],{'$or':_[_0x1b82('0x2c')](_0xd3c4a,function(_0x2af0bd){if(_0x2af0bd[_0x1b82('0x30')]!=='VIRTUAL'){var _0x17d214={};_0x17d214[_0x2af0bd['name']]={'$like':'%'+_0x2931d0[_0x1b82('0x33')]['filter']+'%'};return _0x17d214;}})});}_0x457dbb=_[_0x1b82('0x3e')]({},_0x457dbb,_0x2931d0['options']);var _0x5aeac1={'where':_0x457dbb[_0x1b82('0x3d')]};return db[_0x1b82('0x2d')][_0x1b82('0x1d')](_0x5aeac1)[_0x1b82('0x23')](function(_0x3eb429){_0x115ce7['count']=_0x3eb429;if(_0x2931d0[_0x1b82('0x33')]['includeAll']){_0x457dbb[_0x1b82('0x3f')]=[{'all':!![]}];}return db[_0x1b82('0x2d')][_0x1b82('0x40')](_0x457dbb);})[_0x1b82('0x23')](function(_0x365ab4){_0x115ce7['rows']=_0x365ab4;return _0x115ce7;})[_0x1b82('0x23')](respondWithFilteredResult(_0x155a34,_0x457dbb))['catch'](handleError(_0x155a34,null));};exports[_0x1b82('0x41')]=function(_0x14b3ab,_0x5a50ba){var _0xa88eb2={'raw':!![],'where':{'id':_0x14b3ab[_0x1b82('0x42')]['id']}},_0x225f6b={};_0x225f6b[_0x1b82('0x32')]=_[_0x1b82('0x43')](db[_0x1b82('0x2d')][_0x1b82('0x2e')]);_0x225f6b['query']=_[_0x1b82('0x43')](_0x14b3ab['query']);_0x225f6b[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],_0x225f6b[_0x1b82('0x33')]);_0xa88eb2[_0x1b82('0x36')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],qs[_0x1b82('0x37')](_0x14b3ab[_0x1b82('0x33')][_0x1b82('0x37')]));_0xa88eb2[_0x1b82('0x36')]=_0xa88eb2[_0x1b82('0x36')][_0x1b82('0x38')]?_0xa88eb2[_0x1b82('0x36')]:_0x225f6b['model'];if(_0x14b3ab['query'][_0x1b82('0x44')]){_0xa88eb2['include']=[{'all':!![]}];}_0xa88eb2=_[_0x1b82('0x3e')]({},_0xa88eb2,_0x14b3ab[_0x1b82('0x45')]);return db[_0x1b82('0x2d')]['find'](_0xa88eb2)[_0x1b82('0x23')](handleEntityNotFound(_0x5a50ba,null))['then'](respondWithResult(_0x5a50ba,null))['catch'](handleError(_0x5a50ba,null));};exports[_0x1b82('0x46')]=function(_0x2aadf7,_0x242324){return db['Tag'][_0x1b82('0x46')](_0x2aadf7[_0x1b82('0x47')],{})['then'](function(_0x5ca898){var _0x106282=_0x2aadf7[_0x1b82('0x48')][_0x1b82('0x49')]({'plain':!![]});if(!_0x106282)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x106282[_0x1b82('0x4a')]===_0x1b82('0x48')){var _0x31fb5d=_0x5ca898[_0x1b82('0x49')]({'plain':!![]});var _0xbba448=_0x1b82('0x4b');return db['UserProfileSection'][_0x1b82('0x4c')]({'where':{'name':_0xbba448,'userProfileId':_0x106282['userProfileId']},'raw':!![]})[_0x1b82('0x23')](function(_0x247cb7){if(_0x247cb7&&_0x247cb7['autoAssociation']===0x0){return db[_0x1b82('0x25')]['create']({'name':_0x31fb5d[_0x1b82('0x2a')],'resourceId':_0x31fb5d['id'],'type':_0x247cb7[_0x1b82('0x2a')],'sectionId':_0x247cb7['id']},{})[_0x1b82('0x23')](function(){return _0x5ca898;});}else{return _0x5ca898;}})[_0x1b82('0x4d')](function(_0xd46842){logger[_0x1b82('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd46842);throw _0xd46842;});}return _0x5ca898;})['then'](respondWithResult(_0x242324,0xc9))[_0x1b82('0x4d')](handleError(_0x242324,null));};exports[_0x1b82('0x4e')]=function(_0x1b9e81,_0x26c1ec){if(_0x1b9e81[_0x1b82('0x47')]['id']){delete _0x1b9e81[_0x1b82('0x47')]['id'];}return db[_0x1b82('0x2d')][_0x1b82('0x4c')]({'where':{'id':_0x1b9e81['params']['id']}})['then'](handleEntityNotFound(_0x26c1ec,null))['then'](saveUpdates(_0x1b9e81[_0x1b82('0x47')],null))[_0x1b82('0x23')](respondWithResult(_0x26c1ec,null))[_0x1b82('0x4d')](handleError(_0x26c1ec,null));};exports[_0x1b82('0x24')]=function(_0x1eb4a4,_0x15b0d3){return db[_0x1b82('0x2d')]['find']({'where':{'id':_0x1eb4a4[_0x1b82('0x42')]['id']}})[_0x1b82('0x23')](handleEntityNotFound(_0x15b0d3,null))[_0x1b82('0x23')](removeEntity(_0x15b0d3,null))[_0x1b82('0x4d')](handleError(_0x15b0d3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 4cf66fe..6c014c4 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 _0x6237=['moment','bluebird','request-promise','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6237,0x7e));var _0x7623=function(_0x205e83,_0x2df5a4){_0x205e83=_0x205e83-0x0;var _0x10bb19=_0x6237[_0x205e83];return _0x10bb19;};'use strict';var _=require(_0x7623('0x0'));var util=require(_0x7623('0x1'));var logger=require(_0x7623('0x2'))(_0x7623('0x3'));var moment=require(_0x7623('0x4'));var BPromise=require(_0x7623('0x5'));var rp=require(_0x7623('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7623('0x7'));var attributes=require(_0x7623('0x8'));module[_0x7623('0x9')]=function(_0x2cf84f,_0x420618){return _0x2cf84f[_0x7623('0xa')](_0x7623('0xb'),attributes,{'tableName':_0x7623('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xead3=['rimraf','../../config/environment','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb860cb,_0x581959){var _0x2d14bf=function(_0x386991){while(--_0x386991){_0xb860cb['push'](_0xb860cb['shift']());}};_0x2d14bf(++_0x581959);}(_0xead3,0xcc));var _0x3ead=function(_0x2c7061,_0x324fa7){_0x2c7061=_0x2c7061-0x0;var _0x576748=_0xead3[_0x2c7061];return _0x576748;};'use strict';var _=require('lodash');var util=require(_0x3ead('0x0'));var logger=require(_0x3ead('0x1'))(_0x3ead('0x2'));var moment=require(_0x3ead('0x3'));var BPromise=require(_0x3ead('0x4'));var rp=require(_0x3ead('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ead('0x6'));var config=require(_0x3ead('0x7'));var attributes=require('./tag.attributes');module['exports']=function(_0x103e08,_0x2bf61d){return _0x103e08['define'](_0x3ead('0x8'),attributes,{'tableName':_0x3ead('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 ef9bec9..261db6f 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 _0x6b19=['error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0x5bd682,_0x40144e){_0x5bd682=_0x5bd682-0x0;var _0x11b0c7=_0x6b19[_0x5bd682];return _0x11b0c7;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});} \ No newline at end of file +var _0x5db8=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5db8,0xbb));var _0x85db=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x5db8[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('Tag,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7d78e8b..6141ccd 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_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/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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 8779e38..a7e6676 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(_0x2ea74f,_0x249ca4){var _0x5e41bd=function(_0x72e43f){while(--_0x72e43f){_0x2ea74f['push'](_0x2ea74f['shift']());}};_0x5e41bd(++_0x249ca4);}(_0xb10b,0x12a));var _0xbb10=function(_0x3b45d7,_0xbc2848){_0x3b45d7=_0x3b45d7-0x0;var _0x4690e8=_0xb10b[_0x3b45d7];return _0x4690e8;};'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 _0xd8b0=['exports','sequelize'];(function(_0x3b938d,_0x5512f8){var _0x230c60=function(_0x55c3dc){while(--_0x55c3dc){_0x3b938d['push'](_0x3b938d['shift']());}};_0x230c60(++_0x5512f8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index d621ebc..74ad7d7 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 _0x22a4=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./team.socket','json','undefined','limit','count','offset','status','set','apply','save','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','ValidationError','ids','remove','addAgents','Voice','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','Queue','emit','Queue:save','User','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','all','spread','isArray','Sms','Queue:remove','removeAgents','TeamVoicePrefix','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x131dab,_0x894aea){var _0x43a4cd=function(_0xf3d6ce){while(--_0xf3d6ce){_0x131dab['push'](_0x131dab['shift']());}};_0x43a4cd(++_0x894aea);}(_0x22a4,0x1bc));var _0x422a=function(_0x4e59da,_0x57d444){_0x4e59da=_0x4e59da-0x0;var _0x53c209=_0x22a4[_0x4e59da];return _0x53c209;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x422a('0x0'));var zipdir=require(_0x422a('0x1'));var jsonpatch=require(_0x422a('0x2'));var rp=require(_0x422a('0x3'));var moment=require(_0x422a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x422a('0x5'));var util=require(_0x422a('0x6'));var path=require(_0x422a('0x7'));var sox=require(_0x422a('0x8'));var csv=require(_0x422a('0x9'));var ejs=require(_0x422a('0xa'));var fs=require('fs');var fs_extra=require(_0x422a('0xb'));var _=require(_0x422a('0xc'));var squel=require(_0x422a('0xd'));var crypto=require('crypto');var jsforce=require(_0x422a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x422a('0x9'));var querystring=require(_0x422a('0xf'));var Papa=require(_0x422a('0x10'));var Redis=require(_0x422a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x422a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x422a('0x13'));var logger=require(_0x422a('0x14'))(_0x422a('0x15'));var utils=require(_0x422a('0x16'));var config=require(_0x422a('0x17'));var licenseUtil=require(_0x422a('0x18'));var db=require(_0x422a('0x19'))['db'];config[_0x422a('0x1a')]=_['defaults'](config[_0x422a('0x1a')],{'host':_0x422a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x422a('0x1a')]));require(_0x422a('0x1c'))['register'](socket);function respondWithStatusCode(_0xd368d0,_0x5c99a7){_0x5c99a7=_0x5c99a7||0xcc;return function(_0x5e5710){if(_0x5e5710){return _0xd368d0['sendStatus'](_0x5c99a7);}return _0xd368d0['status'](_0x5c99a7)['end']();};}function respondWithResult(_0x3e01cf,_0x46c4fb){_0x46c4fb=_0x46c4fb||0xc8;return function(_0x3be058){if(_0x3be058){return _0x3e01cf['status'](_0x46c4fb)[_0x422a('0x1d')](_0x3be058);}};}function respondWithFilteredResult(_0x5cd785,_0x6261a5){return function(_0x26c11e){if(_0x26c11e){var _0x371cab=typeof _0x6261a5['offset']===_0x422a('0x1e')&&typeof _0x6261a5[_0x422a('0x1f')]===_0x422a('0x1e');var _0x11a7ea=_0x26c11e[_0x422a('0x20')];var _0x11145c=_0x371cab?0x0:_0x6261a5[_0x422a('0x21')];var _0x1e4f87=_0x371cab?_0x26c11e[_0x422a('0x20')]:_0x6261a5[_0x422a('0x21')]+_0x6261a5['limit'];var _0x404bc7;if(_0x1e4f87>=_0x11a7ea){_0x1e4f87=_0x11a7ea;_0x404bc7=0xc8;}else{_0x404bc7=0xce;}_0x5cd785[_0x422a('0x22')](_0x404bc7);return _0x5cd785[_0x422a('0x23')]('Content-Range',_0x11145c+'-'+_0x1e4f87+'/'+_0x11a7ea)['json'](_0x26c11e);}return null;};}function patchUpdates(_0x5b8b4b){return function(_0x16400e){try{jsonpatch[_0x422a('0x24')](_0x16400e,_0x5b8b4b,!![]);}catch(_0x29f304){return BPromise['reject'](_0x29f304);}return _0x16400e[_0x422a('0x25')]();};}function saveUpdates(_0x2907e6,_0x211969){return function(_0xfc4f04){if(_0xfc4f04){return _0xfc4f04['update'](_0x2907e6)[_0x422a('0x26')](function(_0x5b6e75){return _0x5b6e75;});}return null;};}function handleEntityNotFound(_0x3672d2,_0x45877b){return function(_0x1801be){if(!_0x1801be){_0x3672d2[_0x422a('0x27')](0x194);}return _0x1801be;};}function handleError(_0x1b17dd,_0x536243){_0x536243=_0x536243||0x1f4;return function(_0x2f6f92){logger[_0x422a('0x28')](_0x2f6f92[_0x422a('0x29')]);if(_0x2f6f92[_0x422a('0x2a')]){delete _0x2f6f92['name'];}_0x1b17dd[_0x422a('0x22')](_0x536243)[_0x422a('0x2b')](_0x2f6f92);};}exports['index']=function(_0x48f26e,_0xcfb2ca){var _0x5cefe9={},_0x168ad5={},_0x496792={'count':0x0,'rows':[]};var _0x5b4d9f=_[_0x422a('0x2c')](db['Team'][_0x422a('0x2d')],function(_0x12d264){return{'name':_0x12d264[_0x422a('0x2e')],'type':_0x12d264[_0x422a('0x2f')]['key']};});_0x168ad5[_0x422a('0x30')]=_[_0x422a('0x2c')](_0x5b4d9f,_0x422a('0x2a'));_0x168ad5['query']=_[_0x422a('0x31')](_0x48f26e['query']);_0x168ad5[_0x422a('0x32')]=_[_0x422a('0x33')](_0x168ad5[_0x422a('0x30')],_0x168ad5['query']);_0x5cefe9[_0x422a('0x34')]=_[_0x422a('0x33')](_0x168ad5[_0x422a('0x30')],qs[_0x422a('0x35')](_0x48f26e[_0x422a('0x36')][_0x422a('0x35')]));_0x5cefe9['attributes']=_0x5cefe9[_0x422a('0x34')][_0x422a('0x37')]?_0x5cefe9[_0x422a('0x34')]:_0x168ad5['model'];if(!_0x48f26e[_0x422a('0x36')][_0x422a('0x38')]('nolimit')){_0x5cefe9[_0x422a('0x1f')]=qs[_0x422a('0x1f')](_0x48f26e[_0x422a('0x36')][_0x422a('0x1f')]);_0x5cefe9[_0x422a('0x21')]=qs['offset'](_0x48f26e[_0x422a('0x36')][_0x422a('0x21')]);}_0x5cefe9[_0x422a('0x39')]=qs[_0x422a('0x3a')](_0x48f26e['query']['sort']);_0x5cefe9[_0x422a('0x3b')]=qs[_0x422a('0x32')](_[_0x422a('0x3c')](_0x48f26e['query'],_0x168ad5[_0x422a('0x32')]),_0x5b4d9f);if(_0x48f26e[_0x422a('0x36')][_0x422a('0x3d')]){_0x5cefe9[_0x422a('0x3b')]=_[_0x422a('0x3e')](_0x5cefe9[_0x422a('0x3b')],{'$or':_['map'](_0x5b4d9f,function(_0xc6b273){if(_0xc6b273['type']!==_0x422a('0x3f')){var _0xe6f562={};_0xe6f562[_0xc6b273['name']]={'$like':'%'+_0x48f26e[_0x422a('0x36')][_0x422a('0x3d')]+'%'};return _0xe6f562;}})});}_0x5cefe9=_[_0x422a('0x3e')]({},_0x5cefe9,_0x48f26e[_0x422a('0x40')]);var _0x88fb36={'where':_0x5cefe9[_0x422a('0x3b')]};return db[_0x422a('0x41')][_0x422a('0x20')](_0x88fb36)[_0x422a('0x26')](function(_0x172642){_0x496792[_0x422a('0x20')]=_0x172642;if(_0x48f26e[_0x422a('0x36')][_0x422a('0x42')]){_0x5cefe9[_0x422a('0x43')]=[{'all':!![]}];}return db[_0x422a('0x41')][_0x422a('0x44')](_0x5cefe9);})[_0x422a('0x26')](function(_0x2285b5){_0x496792[_0x422a('0x45')]=_0x2285b5;return _0x496792;})[_0x422a('0x26')](respondWithFilteredResult(_0xcfb2ca,_0x5cefe9))[_0x422a('0x46')](handleError(_0xcfb2ca,null));};exports[_0x422a('0x47')]=function(_0x39d185,_0x3b4872){var _0x4b0863={'raw':![],'where':{'id':_0x39d185[_0x422a('0x48')]['id']}},_0x350f94={};_0x350f94['model']=_[_0x422a('0x31')](db[_0x422a('0x41')]['rawAttributes']);_0x350f94[_0x422a('0x36')]=_[_0x422a('0x31')](_0x39d185[_0x422a('0x36')]);_0x350f94['filters']=_[_0x422a('0x33')](_0x350f94[_0x422a('0x30')],_0x350f94[_0x422a('0x36')]);_0x4b0863[_0x422a('0x34')]=_[_0x422a('0x33')](_0x350f94['model'],qs[_0x422a('0x35')](_0x39d185[_0x422a('0x36')][_0x422a('0x35')]));_0x4b0863[_0x422a('0x34')]=_0x4b0863[_0x422a('0x34')][_0x422a('0x37')]?_0x4b0863[_0x422a('0x34')]:_0x350f94[_0x422a('0x30')];if(_0x39d185[_0x422a('0x36')][_0x422a('0x42')]){_0x4b0863[_0x422a('0x43')]=[{'all':!![]}];}_0x4b0863=_[_0x422a('0x3e')]({},_0x4b0863,_0x39d185[_0x422a('0x40')]);return db[_0x422a('0x41')][_0x422a('0x49')](_0x4b0863)['then'](handleEntityNotFound(_0x3b4872,null))[_0x422a('0x26')](respondWithResult(_0x3b4872,null))['catch'](handleError(_0x3b4872,null));};exports['create']=function(_0x1ccf6a,_0x581a87){return db[_0x422a('0x41')][_0x422a('0x4a')](_0x1ccf6a['body'],{})[_0x422a('0x26')](function(_0x5eadc5){var _0x5a6e1d=_0x1ccf6a[_0x422a('0x4b')][_0x422a('0x4c')]({'plain':!![]});if(!_0x5a6e1d)throw new Error(_0x422a('0x4d'));if(_0x5a6e1d['role']===_0x422a('0x4b')){var _0x5bc562=_0x5eadc5[_0x422a('0x4c')]({'plain':!![]});var _0x25e9c6=_0x422a('0x4e');return db[_0x422a('0x4f')][_0x422a('0x49')]({'where':{'name':_0x25e9c6,'userProfileId':_0x5a6e1d[_0x422a('0x50')]},'raw':!![]})[_0x422a('0x26')](function(_0x50728){if(_0x50728&&_0x50728[_0x422a('0x51')]===0x0){return db[_0x422a('0x52')][_0x422a('0x4a')]({'name':_0x5bc562[_0x422a('0x2a')],'resourceId':_0x5bc562['id'],'type':_0x50728[_0x422a('0x2a')],'sectionId':_0x50728['id']},{})['then'](function(){return _0x5eadc5;});}else{return _0x5eadc5;}})[_0x422a('0x46')](function(_0x300cb6){logger['error'](_0x422a('0x53'),_0x300cb6);throw _0x300cb6;});}return _0x5eadc5;})[_0x422a('0x26')](respondWithResult(_0x581a87,0xc9))[_0x422a('0x46')](handleError(_0x581a87,null));};exports[_0x422a('0x54')]=function(_0x3b0735,_0x26c392){if(_0x3b0735[_0x422a('0x55')]['id']){delete _0x3b0735[_0x422a('0x55')]['id'];}return db['Team']['find']({'where':{'id':_0x3b0735['params']['id']}})[_0x422a('0x26')](handleEntityNotFound(_0x26c392,null))[_0x422a('0x26')](saveUpdates(_0x3b0735[_0x422a('0x55')],null))[_0x422a('0x26')](respondWithResult(_0x26c392,null))[_0x422a('0x46')](handleError(_0x26c392,null));};exports[_0x422a('0x56')]=function(_0x1ad09e,_0x25211a){var _0x148578=_0x1ad09e['params']['id'];var _0xc6553c=[];return db['sequelize'][_0x422a('0x57')](function(_0x106aa6){var _0x182ab4=_0x422a('0x58')+_0x148578;return db[_0x422a('0x59')]['query'](_0x182ab4,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6})[_0x422a('0x26')](function(_0x4e35ed){_0xc6553c=_[_0x422a('0x2c')](_0x4e35ed,function(_0x40e9b9){return Number(_0x40e9b9[_0x422a('0x5d')]);});})[_0x422a('0x26')](function(){var _0x365b08=_0x422a('0x5e')+_0x148578;return db[_0x422a('0x59')][_0x422a('0x36')](_0x365b08,{'type':db['Sequelize'][_0x422a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x3fb940){var _0x34f8cd=_['map'](_0x3fb940,function(_0x465342){return Number(_0x465342[_0x422a('0x5f')]);});return db[_0x422a('0x60')]['destroy']({'where':{'UserId':{'$in':_0xc6553c},'VoiceQueueId':{'$in':_0x34f8cd}},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){var _0x4c2665=_0x422a('0x61')+_0x148578;return db['sequelize'][_0x422a('0x36')](_0x4c2665,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x576c52){var _0x5517c4=_[_0x422a('0x2c')](_0x576c52,function(_0x4da07e){return Number(_0x4da07e['MailQueueId']);});return db[_0x422a('0x62')][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'MailQueueId':{'$in':_0x5517c4}},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){var _0x1c5993=_0x422a('0x63')+_0x148578;return db[_0x422a('0x59')][_0x422a('0x36')](_0x1c5993,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x16441f){var _0x296f28=_['map'](_0x16441f,function(_0x13aa22){return Number(_0x13aa22[_0x422a('0x64')]);});return db[_0x422a('0x65')][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'SmsQueueId':{'$in':_0x296f28}},'transaction':_0x106aa6});})['then'](function(){var _0x315bf3=_0x422a('0x66')+_0x148578;return db[_0x422a('0x59')]['query'](_0x315bf3,{'type':db['Sequelize'][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6});})['then'](function(_0x590938){var _0x115f96=_[_0x422a('0x2c')](_0x590938,function(_0x55a9fd){return Number(_0x55a9fd[_0x422a('0x67')]);});return db['UserChatQueue'][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'ChatQueueId':{'$in':_0x115f96}},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){var _0x1d86ae=_0x422a('0x68')+_0x148578;return db[_0x422a('0x59')][_0x422a('0x36')](_0x1d86ae,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x488453){var _0x189775=_[_0x422a('0x2c')](_0x488453,function(_0x534988){return Number(_0x534988[_0x422a('0x69')]);});return db['UserFaxQueue'][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'FaxQueueId':{'$in':_0x189775}},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){var _0x5b84aa=_0x422a('0x6a')+_0x148578;return db[_0x422a('0x59')]['query'](_0x5b84aa,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x2c7485){var _0xb65d3d=_['map'](_0x2c7485,function(_0x2e657d){return Number(_0x2e657d[_0x422a('0x6b')]);});return db['UserOpenchannelQueue'][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'OpenchannelQueueId':{'$in':_0xb65d3d}},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){var _0x5542e8=_0x422a('0x6c')+_0x148578;return db[_0x422a('0x59')][_0x422a('0x36')](_0x5542e8,{'type':db[_0x422a('0x5a')][_0x422a('0x5b')][_0x422a('0x5c')],'raw':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x53125f){var _0x1897e6=_[_0x422a('0x2c')](_0x53125f,function(_0x1e8a8a){return Number(_0x1e8a8a[_0x422a('0x6d')]);});return db[_0x422a('0x6e')][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'WhatsappQueueId':{'$in':_0x1897e6}},'transaction':_0x106aa6});})['then'](function(){return db['TeamVoicePrefix'][_0x422a('0x49')]({'where':{'TeamId':_0x148578}});})[_0x422a('0x26')](function(_0x2df5be){if(_0x2df5be===null){return;}return db[_0x422a('0x6f')][_0x422a('0x56')]({'where':{'UserId':{'$in':_0xc6553c},'VoicePrefixId':_0x2df5be[_0x422a('0x70')]},'transaction':_0x106aa6});})[_0x422a('0x26')](function(){return db[_0x422a('0x41')][_0x422a('0x56')]({'where':{'id':_0x148578},'cascade':!![],'transaction':_0x106aa6});})[_0x422a('0x26')](function(_0x2a0355){if(_0x2a0355===0x0){_0x25211a[_0x422a('0x27')](0x194);}else{return db[_0x422a('0x52')][_0x422a('0x56')]({'where':{'type':'Teams','resourceId':_0x148578},'cascade':!![],'transaction':_0x106aa6})[_0x422a('0x26')](function(){_0x25211a[_0x422a('0x22')](0xcc)[_0x422a('0x71')]();});}})[_0x422a('0x46')](function(_0x3cfc9a){_0x25211a[_0x422a('0x22')](0x1f4)[_0x422a('0x2b')](_0x3cfc9a);});});};exports[_0x422a('0x72')]=function(_0x19b38a,_0x1a412d,_0xe8ac37){return db['Team'][_0x422a('0x73')]({'where':{'id':_0x19b38a[_0x422a('0x48')]['id']}})[_0x422a('0x26')](handleEntityNotFound(_0x1a412d,null))['then'](function(_0x480d49){if(!_0x19b38a[_0x422a('0x36')][_0x422a('0x74')]||!utils[_0x422a('0x75')](_0x19b38a[_0x422a('0x36')][_0x422a('0x74')])){throw new db[(_0x422a('0x5a'))]['ValidationError'](_0x422a('0x76'));}var _0x5583e2={};var _0x50d376={};_0x50d376[_0x422a('0x30')]=_[_0x422a('0x31')](db[_[_0x422a('0x77')](_0x19b38a['query'][_0x422a('0x74')][_0x422a('0x78')]())+'Queue']['rawAttributes']);_0x50d376['query']=_[_0x422a('0x31')](_0x19b38a[_0x422a('0x36')]);_0x50d376[_0x422a('0x32')]=_[_0x422a('0x33')](_0x50d376[_0x422a('0x30')],_0x50d376[_0x422a('0x36')]);_0x5583e2[_0x422a('0x34')]=_[_0x422a('0x33')](_0x50d376[_0x422a('0x30')],qs['fields'](_0x19b38a[_0x422a('0x36')][_0x422a('0x35')]));_0x5583e2[_0x422a('0x34')]=_0x5583e2['attributes'][_0x422a('0x37')]?_0x5583e2[_0x422a('0x34')]:_0x50d376[_0x422a('0x30')];_0x5583e2[_0x422a('0x1f')]=qs[_0x422a('0x1f')](_0x19b38a[_0x422a('0x36')][_0x422a('0x1f')]);_0x5583e2[_0x422a('0x21')]=qs[_0x422a('0x21')](_0x19b38a[_0x422a('0x36')][_0x422a('0x21')]);_0x5583e2[_0x422a('0x39')]=qs[_0x422a('0x3a')](_0x19b38a[_0x422a('0x36')][_0x422a('0x3a')]);_0x5583e2[_0x422a('0x3b')]=qs[_0x422a('0x32')](_[_0x422a('0x3c')](_0x19b38a['query'],_0x50d376[_0x422a('0x32')]));_0x5583e2=_[_0x422a('0x3e')]({},_0x5583e2,_0x19b38a[_0x422a('0x40')]);return _0x480d49['get'+_['capitalize'](_0x19b38a[_0x422a('0x36')]['channel'][_0x422a('0x78')]())+_0x422a('0x79')](_0x5583e2);})['then'](respondWithResult(_0x1a412d,null))[_0x422a('0x46')](handleError(_0x1a412d,null));};exports[_0x422a('0x7a')]=function(_0x4f7216,_0x27a057,_0x1396c6){return db[_0x422a('0x41')][_0x422a('0x73')]({'where':{'id':_0x4f7216['params']['id']}})[_0x422a('0x26')](function(_0x11db30){if(_0x11db30){if(!_0x4f7216['body'][_0x422a('0x74')]||!utils[_0x422a('0x75')](_0x4f7216[_0x422a('0x55')][_0x422a('0x74')])){throw new db[(_0x422a('0x5a'))][(_0x422a('0x7b'))](_0x422a('0x76'));}return _0x11db30['add'+_['capitalize'](_0x4f7216['body'][_0x422a('0x74')]['toLowerCase']())+_0x422a('0x79')](_0x4f7216[_0x422a('0x55')][_0x422a('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x27a057,null))[_0x422a('0x26')](respondWithStatusCode(_0x27a057,null))[_0x422a('0x46')](handleError(_0x27a057,null));};exports['removeQueues']=function(_0x29599c,_0x3382ef,_0x2ee181){return db['Team'][_0x422a('0x73')]({'where':{'id':_0x29599c['params']['id']}})[_0x422a('0x26')](function(_0x393fd2){if(_0x393fd2){if(!_0x29599c['query'][_0x422a('0x74')]||!utils[_0x422a('0x75')](_0x29599c[_0x422a('0x36')][_0x422a('0x74')])){throw new db[(_0x422a('0x5a'))]['ValidationError'](_0x422a('0x76'));}return _0x393fd2[_0x422a('0x7d')+_[_0x422a('0x77')](_0x29599c[_0x422a('0x36')][_0x422a('0x74')]['toLowerCase']())+'Queues'](_0x29599c[_0x422a('0x36')][_0x422a('0x7c')]);}return null;})[_0x422a('0x26')](handleEntityNotFound(_0x3382ef,null))['then'](respondWithStatusCode(_0x3382ef,null))[_0x422a('0x46')](handleError(_0x3382ef,null));};exports[_0x422a('0x7e')]=function(_0x2f860d,_0x3fdd88){var _0x5e7110=_['isArray'](_0x2f860d['body'][_0x422a('0x7c')])?_0x2f860d[_0x422a('0x55')][_0x422a('0x7c')]:[_0x2f860d[_0x422a('0x55')][_0x422a('0x7c')]];var _0x35f417=_0x2f860d[_0x422a('0x48')]['id'];return db[_0x422a('0x41')]['find']({'where':{'id':_0x35f417}})[_0x422a('0x26')](handleEntityNotFound(_0x3fdd88,null))['then'](function(_0x39c0e8){if(_0x39c0e8){var _0x4de9fa=[_0x422a('0x7f'),'Chat',_0x422a('0x80'),'Sms',_0x422a('0x81'),_0x422a('0x82'),_0x422a('0x83')];return db[_0x422a('0x59')]['transaction'](function(_0x37826f){var _0x3e8e5b=_[_0x422a('0x2c')](_0x4de9fa,function(_0x3cfe90){var _0x1e32f8={'attributes':['id',_0x422a('0x2a')]};if(_0x3cfe90===_0x422a('0x7f')){_0x1e32f8[_0x422a('0x84')]={'attributes':[_0x422a('0x85')]};}return _0x39c0e8[_0x422a('0x4c')+_0x3cfe90+_0x422a('0x79')](_0x1e32f8)['then'](function(_0x1de15a){var _0x1ce9d2=_[_0x422a('0x2c')](_0x1de15a,function(_0x59ff84){var _0x242470=_[_0x422a('0x2c')](_0x5e7110,function(_0xcf8bd0){var _0x49b8d8={'where':{'UserId':_0xcf8bd0,[_0x3cfe90+_0x422a('0x86')]:_0x59ff84['id']},'transaction':_0x37826f};if(_0x3cfe90===_0x422a('0x7f')){_0x49b8d8['defaults']={'penalty':_0x59ff84[_0x422a('0x87')][_0x422a('0x85')]};}return db['User'+_0x3cfe90+_0x422a('0x88')]['findOrCreate'](_0x49b8d8)['then'](function(){socket[_0x422a('0x89')]('user'+_0x3cfe90+_0x422a('0x8a'),{'UserId':_0xcf8bd0,[_0x3cfe90+'QueueId']:_0x59ff84['id']});if(_0x3cfe90!==_0x422a('0x7f')){return;}return db[_0x422a('0x8b')][_0x422a('0x44')]({'where':{'id':_0x5e7110,'online':0x1},'attributes':['id',_0x422a('0x2a'),_0x422a('0x8c'),_0x422a('0x8d'),'interface'],'raw':!![]})[_0x422a('0x26')](function(_0xdcd5fe){var _0x2680ca=_['map'](_0xdcd5fe,function(_0x56d619){return db[_0x422a('0x8e')][_0x422a('0x8f')]({'membername':_0x56d619[_0x422a('0x2a')],'UserId':_0x56d619['id'],'queue_name':_0x59ff84['name'],'VoiceQueueId':_0x59ff84['id'],'interface':_[_0x422a('0x90')](_0x56d619['interface'])?util['format']('SIP/%s',_0x56d619[_0x422a('0x2a')]):_0x56d619[_0x422a('0x91')],'paused':_0x56d619['voicePause']||![],'penalty':_0x59ff84[_0x422a('0x87')][_0x422a('0x85')]},{'transaction':_0x37826f});});return Promise['all'](_0x2680ca);});});});return Promise[_0x422a('0x92')](_0x242470);});return Promise[_0x422a('0x92')](_0x1ce9d2);})[_0x422a('0x26')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x35f417}})[_0x422a('0x26')](function(_0x1baaa9){if(_0x1baaa9){var _0x4dbda3=_['map'](_0x5e7110,function(_0x40f275){db[_0x422a('0x6f')][_0x422a('0x8f')]({'UserId':_0x40f275,'VoicePrefixId':_0x1baaa9['VoicePrefixId']});});return Promise[_0x422a('0x92')](_0x4dbda3);}});});});return Promise[_0x422a('0x92')](_0x3e8e5b)[_0x422a('0x26')](function(){return _0x39c0e8[_0x422a('0x7e')](_0x5e7110,{'transaction':_0x37826f})[_0x422a('0x93')](function(_0x3cdff7){return _0x3cdff7;});});});}})[_0x422a('0x26')](respondWithResult(_0x3fdd88,null))[_0x422a('0x46')](handleError(_0x3fdd88,null));};exports['removeAgents']=function(_0x2e5ec6,_0x2a4b5d){var _0x101022=_[_0x422a('0x94')](_0x2e5ec6[_0x422a('0x36')][_0x422a('0x7c')])?_0x2e5ec6[_0x422a('0x36')][_0x422a('0x7c')]:[_0x2e5ec6[_0x422a('0x36')][_0x422a('0x7c')]];var _0x194b19=_0x2e5ec6[_0x422a('0x48')]['id'];return db[_0x422a('0x41')][_0x422a('0x49')]({'where':{'id':_0x194b19}})['then'](handleEntityNotFound(_0x2a4b5d,null))[_0x422a('0x26')](function(_0x450003){if(_0x450003){var _0x32e8fe=[_0x422a('0x7f'),'Chat',_0x422a('0x80'),_0x422a('0x95'),_0x422a('0x81'),_0x422a('0x82'),_0x422a('0x83')];return db[_0x422a('0x59')][_0x422a('0x57')](function(_0x541697){var _0x25be55=_[_0x422a('0x2c')](_0x32e8fe,function(_0xdb1dcc){var _0x3e01b9={'attributes':['id',_0x422a('0x2a')]};return _0x450003[_0x422a('0x4c')+_0xdb1dcc+_0x422a('0x79')](_0x3e01b9)['then'](function(_0x388e46){var _0x227123=_[_0x422a('0x2c')](_0x388e46,function(_0x4debbb){return _0x4debbb['removeAgents'](_0x101022,{'transaction':_0x541697})[_0x422a('0x26')](function(){var _0x244dc7=_['map'](_0x101022,function(_0x14a14c){socket[_0x422a('0x89')](_0x422a('0x4b')+_0xdb1dcc+_0x422a('0x96'),{'UserId':Number(_0x14a14c),[_0xdb1dcc+_0x422a('0x86')]:_0x4debbb['id']});if(_0xdb1dcc!=='Voice'){return;}return db[_0x422a('0x8e')][_0x422a('0x56')]({'where':{'VoiceQueueId':_0x4debbb['id'],'UserId':_0x14a14c},'transaction':_0x541697});});return Promise['all'](_0x244dc7);});});return Promise[_0x422a('0x92')](_0x227123);});});return Promise[_0x422a('0x92')](_0x25be55)[_0x422a('0x26')](function(){return _0x450003[_0x422a('0x97')](_0x101022,{'transaction':_0x541697});})[_0x422a('0x26')](function(){return db[_0x422a('0x98')][_0x422a('0x73')]({'where':{'teamId':_0x194b19}})[_0x422a('0x26')](function(_0xc9af0e){if(_0xc9af0e){var _0x2a1c68=_[_0x422a('0x2c')](_0x101022,function(_0x22d1c6){db[_0x422a('0x6f')][_0x422a('0x56')]({'where':{'UserId':_0x22d1c6,'VoicePrefixId':_0xc9af0e[_0x422a('0x70')]}});});return Promise[_0x422a('0x92')](_0x2a1c68);}});});});}})[_0x422a('0x26')](respondWithStatusCode(_0x2a4b5d,null))[_0x422a('0x46')](handleError(_0x2a4b5d,null));};exports[_0x422a('0x99')]=function(_0xffc874,_0x3eedee,_0x1b3708){var _0x11cd83={};var _0x55e2c5={};var _0x677186;var _0x9f59c5;return db['Team'][_0x422a('0x73')]({'where':{'id':_0xffc874['params']['id']}})['then'](handleEntityNotFound(_0x3eedee,null))[_0x422a('0x26')](function(_0x21a248){if(_0x21a248){_0x677186=_0x21a248;_0x55e2c5['model']=_['keys'](db[_0x422a('0x8b')]['rawAttributes']);_0x55e2c5['query']=_[_0x422a('0x31')](_0xffc874[_0x422a('0x36')]);_0x55e2c5[_0x422a('0x32')]=_[_0x422a('0x33')](_0x55e2c5[_0x422a('0x30')],_0x55e2c5[_0x422a('0x36')]);_0x11cd83[_0x422a('0x34')]=_[_0x422a('0x33')](_0x55e2c5[_0x422a('0x30')],qs[_0x422a('0x35')](_0xffc874[_0x422a('0x36')][_0x422a('0x35')]));_0x11cd83[_0x422a('0x34')]=_0x11cd83[_0x422a('0x34')][_0x422a('0x37')]?_0x11cd83['attributes']:_0x55e2c5[_0x422a('0x30')];_0x11cd83[_0x422a('0x39')]=qs[_0x422a('0x3a')](_0xffc874['query'][_0x422a('0x3a')]);_0x11cd83['where']=qs[_0x422a('0x32')](_['pick'](_0xffc874['query'],_0x55e2c5[_0x422a('0x32')]));if(_0xffc874['query'][_0x422a('0x3d')]){_0x11cd83['where']=_[_0x422a('0x3e')](_0x11cd83[_0x422a('0x3b')],{'$or':_[_0x422a('0x2c')](_0x11cd83[_0x422a('0x34')],function(_0x4367a5){var _0x2974b3={};_0x2974b3[_0x4367a5]={'$like':'%'+_0xffc874[_0x422a('0x36')]['filter']+'%'};return _0x2974b3;})});}_0x11cd83=_[_0x422a('0x3e')]({},_0x11cd83,_0xffc874[_0x422a('0x40')]);return _0x677186[_0x422a('0x99')](_0x11cd83);}})['then'](function(_0x1a6ae7){if(_0x1a6ae7){_0x9f59c5=_0x1a6ae7['length'];if(!_0xffc874[_0x422a('0x36')][_0x422a('0x38')](_0x422a('0x9a'))){_0x11cd83[_0x422a('0x1f')]=qs[_0x422a('0x1f')](_0xffc874['query'][_0x422a('0x1f')]);_0x11cd83[_0x422a('0x21')]=qs[_0x422a('0x21')](_0xffc874['query']['offset']);}return _0x677186[_0x422a('0x99')](_0x11cd83);}})['then'](function(_0x7b101d){if(_0x7b101d){return _0x7b101d?{'count':_0x9f59c5,'rows':_0x7b101d}:null;}})[_0x422a('0x26')](respondWithResult(_0x3eedee,null))[_0x422a('0x46')](handleError(_0x3eedee,null));}; \ No newline at end of file +var _0x90db=['then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','Team','includeAll','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','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','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','isValidChannel','channel','capitalize','toLowerCase','Queue','order','addQueues','ValidationError','add','Queues','ids','Unknown\x20channel','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','spread','removeAgents','Mail','Queue:remove','getAgents','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','update'];(function(_0x52338b,_0x295a6c){var _0x546138=function(_0x4afbba){while(--_0x4afbba){_0x52338b['push'](_0x52338b['shift']());}};_0x546138(++_0x295a6c);}(_0x90db,0x1a4));var _0xb90d=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x90db[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb90d('0x0'));var zipdir=require(_0xb90d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb90d('0x2'));var moment=require(_0xb90d('0x3'));var BPromise=require(_0xb90d('0x4'));var Mustache=require(_0xb90d('0x5'));var util=require(_0xb90d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb90d('0x7'));var fs=require('fs');var fs_extra=require(_0xb90d('0x8'));var _=require(_0xb90d('0x9'));var squel=require(_0xb90d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb90d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb90d('0xf'));var as=require(_0xb90d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb90d('0x11'))(_0xb90d('0x12'));var utils=require(_0xb90d('0x13'));var config=require(_0xb90d('0x14'));var licenseUtil=require(_0xb90d('0x15'));var db=require(_0xb90d('0x16'))['db'];config[_0xb90d('0x17')]=_[_0xb90d('0x18')](config[_0xb90d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb90d('0x19'))(new Redis(config['redis']));require(_0xb90d('0x1a'))[_0xb90d('0x1b')](socket);function respondWithStatusCode(_0x46d04d,_0x1b5bdd){_0x1b5bdd=_0x1b5bdd||0xcc;return function(_0x17a708){if(_0x17a708){return _0x46d04d[_0xb90d('0x1c')](_0x1b5bdd);}return _0x46d04d[_0xb90d('0x1d')](_0x1b5bdd)[_0xb90d('0x1e')]();};}function respondWithResult(_0x1829f0,_0x151d31){_0x151d31=_0x151d31||0xc8;return function(_0x14d32b){if(_0x14d32b){return _0x1829f0[_0xb90d('0x1d')](_0x151d31)[_0xb90d('0x1f')](_0x14d32b);}};}function respondWithFilteredResult(_0x36589a,_0x495fe5){return function(_0x4f47ac){if(_0x4f47ac){var _0x2388c6=typeof _0x495fe5[_0xb90d('0x20')]==='undefined'&&typeof _0x495fe5[_0xb90d('0x21')]==='undefined';var _0x12bd58=_0x4f47ac['count'];var _0x52dcce=_0x2388c6?0x0:_0x495fe5[_0xb90d('0x20')];var _0x478512=_0x2388c6?_0x4f47ac[_0xb90d('0x22')]:_0x495fe5[_0xb90d('0x20')]+_0x495fe5[_0xb90d('0x21')];var _0x1ceeee;if(_0x478512>=_0x12bd58){_0x478512=_0x12bd58;_0x1ceeee=0xc8;}else{_0x1ceeee=0xce;}_0x36589a['status'](_0x1ceeee);return _0x36589a['set'](_0xb90d('0x23'),_0x52dcce+'-'+_0x478512+'/'+_0x12bd58)[_0xb90d('0x1f')](_0x4f47ac);}return null;};}function patchUpdates(_0x15a54f){return function(_0x332942){try{jsonpatch[_0xb90d('0x24')](_0x332942,_0x15a54f,!![]);}catch(_0x1c1fc6){return BPromise['reject'](_0x1c1fc6);}return _0x332942[_0xb90d('0x25')]();};}function saveUpdates(_0x79f630,_0x948a10){return function(_0x590329){if(_0x590329){return _0x590329[_0xb90d('0x26')](_0x79f630)[_0xb90d('0x27')](function(_0x2cac6e){return _0x2cac6e;});}return null;};}function handleEntityNotFound(_0x5a7e40,_0x4803de){return function(_0x3c9da5){if(!_0x3c9da5){_0x5a7e40['sendStatus'](0x194);}return _0x3c9da5;};}function handleError(_0x216a8f,_0x25893e){_0x25893e=_0x25893e||0x1f4;return function(_0x243e55){logger[_0xb90d('0x28')](_0x243e55[_0xb90d('0x29')]);if(_0x243e55[_0xb90d('0x2a')]){delete _0x243e55[_0xb90d('0x2a')];}_0x216a8f[_0xb90d('0x1d')](_0x25893e)[_0xb90d('0x2b')](_0x243e55);};}exports[_0xb90d('0x2c')]=function(_0x10d5e1,_0x3b9f19){var _0x6fc04e={},_0x3cd64a={},_0x5ab90f={'count':0x0,'rows':[]};var _0x5ccead=_[_0xb90d('0x2d')](db['Team'][_0xb90d('0x2e')],function(_0x4fe41a){return{'name':_0x4fe41a['fieldName'],'type':_0x4fe41a[_0xb90d('0x2f')][_0xb90d('0x30')]};});_0x3cd64a[_0xb90d('0x31')]=_['map'](_0x5ccead,_0xb90d('0x2a'));_0x3cd64a[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x10d5e1['query']);_0x3cd64a[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x3cd64a[_0xb90d('0x31')],_0x3cd64a[_0xb90d('0x32')]);_0x6fc04e[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x3cd64a['model'],qs['fields'](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x37')]));_0x6fc04e[_0xb90d('0x36')]=_0x6fc04e[_0xb90d('0x36')][_0xb90d('0x38')]?_0x6fc04e[_0xb90d('0x36')]:_0x3cd64a['model'];if(!_0x10d5e1['query']['hasOwnProperty'](_0xb90d('0x39'))){_0x6fc04e[_0xb90d('0x21')]=qs[_0xb90d('0x21')](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x21')]);_0x6fc04e['offset']=qs[_0xb90d('0x20')](_0x10d5e1['query'][_0xb90d('0x20')]);}_0x6fc04e['order']=qs[_0xb90d('0x3a')](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3a')]);_0x6fc04e['where']=qs['filters'](_[_0xb90d('0x3b')](_0x10d5e1[_0xb90d('0x32')],_0x3cd64a[_0xb90d('0x34')]),_0x5ccead);if(_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3c')]){_0x6fc04e[_0xb90d('0x3d')]=_[_0xb90d('0x3e')](_0x6fc04e['where'],{'$or':_[_0xb90d('0x2d')](_0x5ccead,function(_0xa671f2){if(_0xa671f2[_0xb90d('0x2f')]!=='VIRTUAL'){var _0x460d0f={};_0x460d0f[_0xa671f2['name']]={'$like':'%'+_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3c')]+'%'};return _0x460d0f;}})});}_0x6fc04e=_[_0xb90d('0x3e')]({},_0x6fc04e,_0x10d5e1[_0xb90d('0x3f')]);var _0x408e1c={'where':_0x6fc04e['where']};return db[_0xb90d('0x40')][_0xb90d('0x22')](_0x408e1c)[_0xb90d('0x27')](function(_0x499425){_0x5ab90f['count']=_0x499425;if(_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x41')]){_0x6fc04e[_0xb90d('0x42')]=[{'all':!![]}];}return db[_0xb90d('0x40')][_0xb90d('0x43')](_0x6fc04e);})[_0xb90d('0x27')](function(_0x3d9f89){_0x5ab90f[_0xb90d('0x44')]=_0x3d9f89;return _0x5ab90f;})[_0xb90d('0x27')](respondWithFilteredResult(_0x3b9f19,_0x6fc04e))[_0xb90d('0x45')](handleError(_0x3b9f19,null));};exports[_0xb90d('0x46')]=function(_0x51d892,_0x4e8fe4){var _0x65e393={'raw':![],'where':{'id':_0x51d892['params']['id']}},_0x3ef1c1={};_0x3ef1c1[_0xb90d('0x31')]=_['keys'](db[_0xb90d('0x40')][_0xb90d('0x2e')]);_0x3ef1c1[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x51d892[_0xb90d('0x32')]);_0x3ef1c1[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x3ef1c1['model'],_0x3ef1c1['query']);_0x65e393['attributes']=_[_0xb90d('0x35')](_0x3ef1c1[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x51d892['query']['fields']));_0x65e393[_0xb90d('0x36')]=_0x65e393[_0xb90d('0x36')]['length']?_0x65e393[_0xb90d('0x36')]:_0x3ef1c1[_0xb90d('0x31')];if(_0x51d892['query'][_0xb90d('0x41')]){_0x65e393[_0xb90d('0x42')]=[{'all':!![]}];}_0x65e393=_[_0xb90d('0x3e')]({},_0x65e393,_0x51d892['options']);return db[_0xb90d('0x40')][_0xb90d('0x47')](_0x65e393)[_0xb90d('0x27')](handleEntityNotFound(_0x4e8fe4,null))[_0xb90d('0x27')](respondWithResult(_0x4e8fe4,null))[_0xb90d('0x45')](handleError(_0x4e8fe4,null));};exports[_0xb90d('0x48')]=function(_0x224b0e,_0xf0dc80){return db[_0xb90d('0x40')][_0xb90d('0x48')](_0x224b0e['body'],{})[_0xb90d('0x27')](function(_0x5b1731){var _0x3d0420=_0x224b0e['user']['get']({'plain':!![]});if(!_0x3d0420)throw new Error(_0xb90d('0x49'));if(_0x3d0420['role']===_0xb90d('0x4a')){var _0xe1e0dd=_0x5b1731[_0xb90d('0x4b')]({'plain':!![]});var _0x4fc275='Teams';return db[_0xb90d('0x4c')]['find']({'where':{'name':_0x4fc275,'userProfileId':_0x3d0420['userProfileId']},'raw':!![]})[_0xb90d('0x27')](function(_0x206df7){if(_0x206df7&&_0x206df7[_0xb90d('0x4d')]===0x0){return db[_0xb90d('0x4e')][_0xb90d('0x48')]({'name':_0xe1e0dd['name'],'resourceId':_0xe1e0dd['id'],'type':_0x206df7[_0xb90d('0x2a')],'sectionId':_0x206df7['id']},{})[_0xb90d('0x27')](function(){return _0x5b1731;});}else{return _0x5b1731;}})[_0xb90d('0x45')](function(_0x13bbbb){logger[_0xb90d('0x28')](_0xb90d('0x4f'),_0x13bbbb);throw _0x13bbbb;});}return _0x5b1731;})[_0xb90d('0x27')](respondWithResult(_0xf0dc80,0xc9))[_0xb90d('0x45')](handleError(_0xf0dc80,null));};exports[_0xb90d('0x26')]=function(_0x18b872,_0x47327b){if(_0x18b872['body']['id']){delete _0x18b872[_0xb90d('0x50')]['id'];}return db[_0xb90d('0x40')]['find']({'where':{'id':_0x18b872[_0xb90d('0x51')]['id']}})['then'](handleEntityNotFound(_0x47327b,null))[_0xb90d('0x27')](saveUpdates(_0x18b872[_0xb90d('0x50')],null))[_0xb90d('0x27')](respondWithResult(_0x47327b,null))[_0xb90d('0x45')](handleError(_0x47327b,null));};exports[_0xb90d('0x52')]=function(_0x556c87,_0x5fdcea){var _0x4ef9e9=_0x556c87['params']['id'];var _0x506e5d=[];return db['sequelize']['transaction'](function(_0x420b62){var _0x1178b6=_0xb90d('0x53')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x1178b6,{'type':db['Sequelize'][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62})[_0xb90d('0x27')](function(_0x2c36db){_0x506e5d=_[_0xb90d('0x2d')](_0x2c36db,function(_0x50c041){return Number(_0x50c041['UserId']);});})[_0xb90d('0x27')](function(){var _0x625afe=_0xb90d('0x57')+_0x4ef9e9;return db[_0xb90d('0x54')]['query'](_0x625afe,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x1c6731){var _0x31b09d=_[_0xb90d('0x2d')](_0x1c6731,function(_0xe701c2){return Number(_0xe701c2[_0xb90d('0x59')]);});return db[_0xb90d('0x5a')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'VoiceQueueId':{'$in':_0x31b09d}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x170a7a=_0xb90d('0x5b')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x170a7a,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})['then'](function(_0xf5ba46){var _0x5ee83f=_[_0xb90d('0x2d')](_0xf5ba46,function(_0x5a8205){return Number(_0x5a8205[_0xb90d('0x5c')]);});return db[_0xb90d('0x5d')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'MailQueueId':{'$in':_0x5ee83f}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x582c18='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')]['query'](_0x582c18,{'type':db['Sequelize'][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x5f0121){var _0x309372=_[_0xb90d('0x2d')](_0x5f0121,function(_0x476225){return Number(_0x476225['SmsQueueId']);});return db[_0xb90d('0x5e')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'SmsQueueId':{'$in':_0x309372}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x1a7839='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x1a7839,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x1a5790){var _0x62052b=_['map'](_0x1a5790,function(_0x3f672f){return Number(_0x3f672f[_0xb90d('0x5f')]);});return db['UserChatQueue'][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'ChatQueueId':{'$in':_0x62052b}},'transaction':_0x420b62});})['then'](function(){var _0x54d646=_0xb90d('0x60')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x54d646,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')]['SELECT'],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x50f76d){var _0x2bc071=_[_0xb90d('0x2d')](_0x50f76d,function(_0x2cee8a){return Number(_0x2cee8a[_0xb90d('0x61')]);});return db['UserFaxQueue'][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'FaxQueueId':{'$in':_0x2bc071}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x16dcbc='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x16dcbc,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')]['SELECT'],'raw':!![],'transaction':_0x420b62});})['then'](function(_0x4d8013){var _0x101522=_['map'](_0x4d8013,function(_0x2d9ffd){return Number(_0x2d9ffd[_0xb90d('0x62')]);});return db[_0xb90d('0x63')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'OpenchannelQueueId':{'$in':_0x101522}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x4f33a0=_0xb90d('0x64')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x4f33a0,{'type':db[_0xb90d('0x58')]['QueryTypes'][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x4a9487){var _0x5a8f54=_[_0xb90d('0x2d')](_0x4a9487,function(_0x61306d){return Number(_0x61306d[_0xb90d('0x65')]);});return db[_0xb90d('0x66')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'WhatsappQueueId':{'$in':_0x5a8f54}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){return db['TeamVoicePrefix'][_0xb90d('0x47')]({'where':{'TeamId':_0x4ef9e9}});})[_0xb90d('0x27')](function(_0x36a531){if(_0x36a531===null){return;}return db[_0xb90d('0x67')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'VoicePrefixId':_0x36a531[_0xb90d('0x68')]},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){return db[_0xb90d('0x40')][_0xb90d('0x52')]({'where':{'id':_0x4ef9e9},'cascade':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x56ddfe){if(_0x56ddfe===0x0){_0x5fdcea[_0xb90d('0x1c')](0x194);}else{return db['UserProfileResource'][_0xb90d('0x52')]({'where':{'type':_0xb90d('0x69'),'resourceId':_0x4ef9e9},'cascade':!![],'transaction':_0x420b62})[_0xb90d('0x27')](function(){_0x5fdcea[_0xb90d('0x1d')](0xcc)['end']();});}})[_0xb90d('0x45')](function(_0x329a69){_0x5fdcea[_0xb90d('0x1d')](0x1f4)[_0xb90d('0x2b')](_0x329a69);});});};exports[_0xb90d('0x6a')]=function(_0x57c8f5,_0x563045,_0x5d5f6d){return db[_0xb90d('0x40')][_0xb90d('0x6b')]({'where':{'id':_0x57c8f5[_0xb90d('0x51')]['id']}})['then'](handleEntityNotFound(_0x563045,null))[_0xb90d('0x27')](function(_0x160273){if(!_0x57c8f5[_0xb90d('0x32')]['channel']||!utils[_0xb90d('0x6c')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x3a948f={};var _0x1e3b83={};_0x1e3b83[_0xb90d('0x31')]=_[_0xb90d('0x33')](db[_[_0xb90d('0x6e')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x70')][_0xb90d('0x2e')]);_0x1e3b83[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x57c8f5['query']);_0x1e3b83[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x1e3b83['model'],_0x1e3b83[_0xb90d('0x32')]);_0x3a948f[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x1e3b83[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x37')]));_0x3a948f[_0xb90d('0x36')]=_0x3a948f[_0xb90d('0x36')][_0xb90d('0x38')]?_0x3a948f[_0xb90d('0x36')]:_0x1e3b83[_0xb90d('0x31')];_0x3a948f['limit']=qs[_0xb90d('0x21')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x21')]);_0x3a948f[_0xb90d('0x20')]=qs[_0xb90d('0x20')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x20')]);_0x3a948f[_0xb90d('0x71')]=qs[_0xb90d('0x3a')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x3a')]);_0x3a948f[_0xb90d('0x3d')]=qs[_0xb90d('0x34')](_['pick'](_0x57c8f5['query'],_0x1e3b83[_0xb90d('0x34')]));_0x3a948f=_[_0xb90d('0x3e')]({},_0x3a948f,_0x57c8f5[_0xb90d('0x3f')]);return _0x160273[_0xb90d('0x4b')+_[_0xb90d('0x6e')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')]['toLowerCase']())+'Queues'](_0x3a948f);})[_0xb90d('0x27')](respondWithResult(_0x563045,null))[_0xb90d('0x45')](handleError(_0x563045,null));};exports[_0xb90d('0x72')]=function(_0x647291,_0x3db5c9,_0x58419e){return db[_0xb90d('0x40')][_0xb90d('0x6b')]({'where':{'id':_0x647291['params']['id']}})[_0xb90d('0x27')](function(_0x79895c){if(_0x79895c){if(!_0x647291[_0xb90d('0x50')][_0xb90d('0x6d')]||!utils[_0xb90d('0x6c')](_0x647291['body'][_0xb90d('0x6d')])){throw new db[(_0xb90d('0x58'))][(_0xb90d('0x73'))]('Unknown\x20channel');}return _0x79895c[_0xb90d('0x74')+_['capitalize'](_0x647291[_0xb90d('0x50')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x75')](_0x647291['body'][_0xb90d('0x76')]);}return null;})[_0xb90d('0x27')](handleEntityNotFound(_0x3db5c9,null))['then'](respondWithStatusCode(_0x3db5c9,null))['catch'](handleError(_0x3db5c9,null));};exports['removeQueues']=function(_0x2d63b6,_0x3355ca,_0x5e4c22){return db['Team'][_0xb90d('0x6b')]({'where':{'id':_0x2d63b6[_0xb90d('0x51')]['id']}})[_0xb90d('0x27')](function(_0x455e26){if(_0x455e26){if(!_0x2d63b6['query'][_0xb90d('0x6d')]||!utils[_0xb90d('0x6c')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x6d')])){throw new db[(_0xb90d('0x58'))]['ValidationError'](_0xb90d('0x77'));}return _0x455e26['remove'+_[_0xb90d('0x6e')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x75')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x76')]);}return null;})[_0xb90d('0x27')](handleEntityNotFound(_0x3355ca,null))[_0xb90d('0x27')](respondWithStatusCode(_0x3355ca,null))[_0xb90d('0x45')](handleError(_0x3355ca,null));};exports[_0xb90d('0x78')]=function(_0x5c431f,_0x324974){var _0x4d1c65=_[_0xb90d('0x79')](_0x5c431f['body'][_0xb90d('0x76')])?_0x5c431f['body']['ids']:[_0x5c431f[_0xb90d('0x50')][_0xb90d('0x76')]];var _0x25b894=_0x5c431f[_0xb90d('0x51')]['id'];return db['Team']['find']({'where':{'id':_0x25b894}})[_0xb90d('0x27')](handleEntityNotFound(_0x324974,null))[_0xb90d('0x27')](function(_0x3cd949){if(_0x3cd949){var _0x5eb243=[_0xb90d('0x7a'),_0xb90d('0x7b'),'Mail',_0xb90d('0x7c'),_0xb90d('0x7d'),_0xb90d('0x7e'),_0xb90d('0x7f')];return db[_0xb90d('0x54')][_0xb90d('0x80')](function(_0x2be2b8){var _0x66945d=_[_0xb90d('0x2d')](_0x5eb243,function(_0x687154){var _0x1dc543={'attributes':['id','name']};if(_0x687154===_0xb90d('0x7a')){_0x1dc543[_0xb90d('0x81')]={'attributes':[_0xb90d('0x82')]};}return _0x3cd949[_0xb90d('0x4b')+_0x687154+_0xb90d('0x75')](_0x1dc543)[_0xb90d('0x27')](function(_0x5f5ca1){var _0x412eae=_[_0xb90d('0x2d')](_0x5f5ca1,function(_0x47b05d){var _0x4b30a8=_[_0xb90d('0x2d')](_0x4d1c65,function(_0x25a38b){var _0x3b1dfa={'where':{'UserId':_0x25a38b,[_0x687154+_0xb90d('0x83')]:_0x47b05d['id']},'transaction':_0x2be2b8};if(_0x687154===_0xb90d('0x7a')){_0x3b1dfa[_0xb90d('0x18')]={'penalty':_0x47b05d['TeamVoiceQueue'][_0xb90d('0x82')]};}return db[_0xb90d('0x84')+_0x687154+'Queue'][_0xb90d('0x85')](_0x3b1dfa)[_0xb90d('0x27')](function(){socket[_0xb90d('0x86')]('user'+_0x687154+_0xb90d('0x87'),{'UserId':_0x25a38b,[_0x687154+_0xb90d('0x83')]:_0x47b05d['id']});if(_0x687154!==_0xb90d('0x7a')){return;}return db[_0xb90d('0x84')][_0xb90d('0x43')]({'where':{'id':_0x4d1c65,'online':0x1},'attributes':['id',_0xb90d('0x2a'),_0xb90d('0x88'),_0xb90d('0x89'),'interface'],'raw':!![]})['then'](function(_0x25dc31){var _0x17208a=_[_0xb90d('0x2d')](_0x25dc31,function(_0x596d3a){return db[_0xb90d('0x8a')][_0xb90d('0x8b')]({'membername':_0x596d3a[_0xb90d('0x2a')],'UserId':_0x596d3a['id'],'queue_name':_0x47b05d[_0xb90d('0x2a')],'VoiceQueueId':_0x47b05d['id'],'interface':_[_0xb90d('0x8c')](_0x596d3a[_0xb90d('0x8d')])?util[_0xb90d('0x8e')](_0xb90d('0x8f'),_0x596d3a[_0xb90d('0x2a')]):_0x596d3a[_0xb90d('0x8d')],'paused':_0x596d3a[_0xb90d('0x89')]||![],'penalty':_0x47b05d[_0xb90d('0x90')][_0xb90d('0x82')]},{'transaction':_0x2be2b8});});return Promise[_0xb90d('0x91')](_0x17208a);});});});return Promise[_0xb90d('0x91')](_0x4b30a8);});return Promise[_0xb90d('0x91')](_0x412eae);})[_0xb90d('0x27')](function(){return db[_0xb90d('0x92')][_0xb90d('0x6b')]({'where':{'teamId':_0x25b894}})['then'](function(_0x1f501f){if(_0x1f501f){var _0x53d600=_[_0xb90d('0x2d')](_0x4d1c65,function(_0x3337e0){db[_0xb90d('0x67')][_0xb90d('0x8b')]({'UserId':_0x3337e0,'VoicePrefixId':_0x1f501f[_0xb90d('0x68')]});});return Promise['all'](_0x53d600);}});});});return Promise[_0xb90d('0x91')](_0x66945d)[_0xb90d('0x27')](function(){return _0x3cd949[_0xb90d('0x78')](_0x4d1c65,{'transaction':_0x2be2b8})[_0xb90d('0x93')](function(_0x2ac749){return _0x2ac749;});});});}})[_0xb90d('0x27')](respondWithResult(_0x324974,null))[_0xb90d('0x45')](handleError(_0x324974,null));};exports[_0xb90d('0x94')]=function(_0x2b0ac5,_0x38f576){var _0x2cd07c=_[_0xb90d('0x79')](_0x2b0ac5[_0xb90d('0x32')][_0xb90d('0x76')])?_0x2b0ac5[_0xb90d('0x32')]['ids']:[_0x2b0ac5[_0xb90d('0x32')][_0xb90d('0x76')]];var _0x3106f2=_0x2b0ac5[_0xb90d('0x51')]['id'];return db[_0xb90d('0x40')]['find']({'where':{'id':_0x3106f2}})[_0xb90d('0x27')](handleEntityNotFound(_0x38f576,null))['then'](function(_0x2e10b7){if(_0x2e10b7){var _0x24fdf3=[_0xb90d('0x7a'),_0xb90d('0x7b'),_0xb90d('0x95'),'Sms','Fax','Openchannel','Whatsapp'];return db['sequelize'][_0xb90d('0x80')](function(_0x447e7b){var _0x31ba9f=_[_0xb90d('0x2d')](_0x24fdf3,function(_0x2a36f8){var _0x90551a={'attributes':['id',_0xb90d('0x2a')]};return _0x2e10b7[_0xb90d('0x4b')+_0x2a36f8+_0xb90d('0x75')](_0x90551a)[_0xb90d('0x27')](function(_0x339b40){var _0xe0dc0a=_[_0xb90d('0x2d')](_0x339b40,function(_0x3a5152){return _0x3a5152[_0xb90d('0x94')](_0x2cd07c,{'transaction':_0x447e7b})[_0xb90d('0x27')](function(){var _0x324b66=_[_0xb90d('0x2d')](_0x2cd07c,function(_0x5d8a38){socket['emit'](_0xb90d('0x4a')+_0x2a36f8+_0xb90d('0x96'),{'UserId':Number(_0x5d8a38),[_0x2a36f8+_0xb90d('0x83')]:_0x3a5152['id']});if(_0x2a36f8!==_0xb90d('0x7a')){return;}return db['UserVoiceQueueRt'][_0xb90d('0x52')]({'where':{'VoiceQueueId':_0x3a5152['id'],'UserId':_0x5d8a38},'transaction':_0x447e7b});});return Promise['all'](_0x324b66);});});return Promise[_0xb90d('0x91')](_0xe0dc0a);});});return Promise[_0xb90d('0x91')](_0x31ba9f)[_0xb90d('0x27')](function(){return _0x2e10b7['removeAgents'](_0x2cd07c,{'transaction':_0x447e7b});})[_0xb90d('0x27')](function(){return db[_0xb90d('0x92')][_0xb90d('0x6b')]({'where':{'teamId':_0x3106f2}})[_0xb90d('0x27')](function(_0x2459c3){if(_0x2459c3){var _0x5b933f=_[_0xb90d('0x2d')](_0x2cd07c,function(_0x3d1fbc){db[_0xb90d('0x67')][_0xb90d('0x52')]({'where':{'UserId':_0x3d1fbc,'VoicePrefixId':_0x2459c3[_0xb90d('0x68')]}});});return Promise['all'](_0x5b933f);}});});});}})[_0xb90d('0x27')](respondWithStatusCode(_0x38f576,null))[_0xb90d('0x45')](handleError(_0x38f576,null));};exports[_0xb90d('0x97')]=function(_0x23cbe1,_0x5c2ff7,_0x3aebb9){var _0x20505c={};var _0x98d3e9={};var _0x214eec;var _0x1d6573;return db['Team'][_0xb90d('0x6b')]({'where':{'id':_0x23cbe1[_0xb90d('0x51')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x5c2ff7,null))[_0xb90d('0x27')](function(_0x1948e9){if(_0x1948e9){_0x214eec=_0x1948e9;_0x98d3e9['model']=_['keys'](db[_0xb90d('0x84')][_0xb90d('0x2e')]);_0x98d3e9[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x23cbe1[_0xb90d('0x32')]);_0x98d3e9[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x98d3e9['model'],_0x98d3e9[_0xb90d('0x32')]);_0x20505c[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x98d3e9[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x37')]));_0x20505c[_0xb90d('0x36')]=_0x20505c[_0xb90d('0x36')][_0xb90d('0x38')]?_0x20505c[_0xb90d('0x36')]:_0x98d3e9[_0xb90d('0x31')];_0x20505c[_0xb90d('0x71')]=qs['sort'](_0x23cbe1['query'][_0xb90d('0x3a')]);_0x20505c['where']=qs['filters'](_[_0xb90d('0x3b')](_0x23cbe1['query'],_0x98d3e9[_0xb90d('0x34')]));if(_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x3c')]){_0x20505c[_0xb90d('0x3d')]=_['merge'](_0x20505c[_0xb90d('0x3d')],{'$or':_['map'](_0x20505c[_0xb90d('0x36')],function(_0x5f15d8){var _0x5195ff={};_0x5195ff[_0x5f15d8]={'$like':'%'+_0x23cbe1['query'][_0xb90d('0x3c')]+'%'};return _0x5195ff;})});}_0x20505c=_['merge']({},_0x20505c,_0x23cbe1[_0xb90d('0x3f')]);return _0x214eec[_0xb90d('0x97')](_0x20505c);}})[_0xb90d('0x27')](function(_0x66fc41){if(_0x66fc41){_0x1d6573=_0x66fc41['length'];if(!_0x23cbe1['query'][_0xb90d('0x98')](_0xb90d('0x39'))){_0x20505c[_0xb90d('0x21')]=qs[_0xb90d('0x21')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x21')]);_0x20505c[_0xb90d('0x20')]=qs[_0xb90d('0x20')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x20')]);}return _0x214eec[_0xb90d('0x97')](_0x20505c);}})[_0xb90d('0x27')](function(_0x3116b4){if(_0x3116b4){return _0x3116b4?{'count':_0x1d6573,'rows':_0x3116b4}:null;}})['then'](respondWithResult(_0x5c2ff7,null))['catch'](handleError(_0x5c2ff7,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6e635a8..0decb25 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 _0xd1a4=['hook','exports','events','Team','update','remove','emit','hasOwnProperty'];(function(_0x2598f0,_0x3d61ff){var _0x4448c8=function(_0x3cc057){while(--_0x3cc057){_0x2598f0['push'](_0x2598f0['shift']());}};_0x4448c8(++_0x3d61ff);}(_0xd1a4,0x1ca));var _0x4d1a=function(_0x257449,_0x180d1a){_0x257449=_0x257449-0x0;var _0x502252=_0xd1a4[_0x257449];return _0x502252;};'use strict';var EventEmitter=require(_0x4d1a('0x0'));var Team=require('../../mysqldb')['db'][_0x4d1a('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d1a('0x2'),'afterDestroy':_0x4d1a('0x3')};function emitEvent(_0x908e61){return function(_0x46be7b,_0x588c3e,_0x898564){TeamEvents['emit'](_0x908e61+':'+_0x46be7b['id'],_0x46be7b);TeamEvents[_0x4d1a('0x4')](_0x908e61,_0x46be7b);_0x898564(null);};}for(var e in events){if(events[_0x4d1a('0x5')](e)){var event=events[e];Team[_0x4d1a('0x6')](e,emitEvent(event));}}module[_0x4d1a('0x7')]=TeamEvents; \ No newline at end of file +var _0x8089=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x549daf,_0x22ae61){var _0x513d31=function(_0xe11d95){while(--_0xe11d95){_0x549daf['push'](_0x549daf['shift']());}};_0x513d31(++_0x22ae61);}(_0x8089,0x158));var _0x9808=function(_0x665225,_0x2255e8){_0x665225=_0x665225-0x0;var _0x4d0bec=_0x8089[_0x665225];return _0x4d0bec;};'use strict';var EventEmitter=require(_0x9808('0x0'));var Team=require(_0x9808('0x1'))['db'][_0x9808('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9808('0x3')](0x0);var events={'afterCreate':_0x9808('0x4'),'afterUpdate':'update','afterDestroy':_0x9808('0x5')};function emitEvent(_0x225213){return function(_0x13cf4d,_0x8fee5e,_0x3f9f5f){TeamEvents[_0x9808('0x6')](_0x225213+':'+_0x13cf4d['id'],_0x13cf4d);TeamEvents[_0x9808('0x6')](_0x225213,_0x13cf4d);_0x3f9f5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x9808('0x7')](e,emitEvent(event));}}module[_0x9808('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 64c1950..ab7caaa 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 _0x551b=['then','map','setDataValue','channel','catch','exports','define','teams','Chat','Fax','Whatsapp','resolve','all','lodash','./team.attributes'];(function(_0x176f4e,_0x5d7d44){var _0x23e2e8=function(_0x5d0157){while(--_0x5d0157){_0x176f4e['push'](_0x176f4e['shift']());}};_0x23e2e8(++_0x5d7d44);}(_0x551b,0xa3));var _0xb551=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x551b[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xb551('0x0'));var attributes=require(_0xb551('0x1'));function getQueuesByChannel(_0x48c0dc,_0x61fad5){var _0x1d030a='get'+_0x61fad5+'Queues';return _0x48c0dc[_0x1d030a]()[_0xb551('0x2')](function(_0x3ac3ac){return _[_0xb551('0x3')](_0x3ac3ac,function(_0x2d0262){_0x2d0262[_0xb551('0x4')](_0xb551('0x5'),_0x61fad5);return _0x2d0262;});})[_0xb551('0x6')](function(_0x3253b2){throw _0x3253b2;});}module[_0xb551('0x7')]=function(_0x2e4de4){return _0x2e4de4[_0xb551('0x8')]('Team',attributes,{'tableName':_0xb551('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x389983=this;var _0x2ac762=[_0xb551('0xa'),_0xb551('0xb'),'Mail','Openchannel','Sms','Voice',_0xb551('0xc')];return Promise[_0xb551('0xd')]()[_0xb551('0x2')](function(){var _0x5bbda1=_['map'](_0x2ac762,function(_0x56e464){return getQueuesByChannel(_0x389983,_0x56e464);});return Promise[_0xb551('0xe')](_0x5bbda1);})['catch'](function(_0x2147a7){throw _0x2147a7;});}}});}; \ No newline at end of file +var _0x31ae=['teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','all','get','then','map','channel','catch','exports','define','Team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31ae,0x88));var _0xe31a=function(_0x3c5503,_0x2b568d){_0x3c5503=_0x3c5503-0x0;var _0x5571a6=_0x31ae[_0x3c5503];return _0x5571a6;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x5c0565,_0x4b6ca0){var _0x150858=_0xe31a('0x0')+_0x4b6ca0+'Queues';return _0x5c0565[_0x150858]()[_0xe31a('0x1')](function(_0x3b2bd0){return _[_0xe31a('0x2')](_0x3b2bd0,function(_0x42d954){_0x42d954['setDataValue'](_0xe31a('0x3'),_0x4b6ca0);return _0x42d954;});})[_0xe31a('0x4')](function(_0x31b08e){throw _0x31b08e;});}module[_0xe31a('0x5')]=function(_0x2f1ab0){return _0x2f1ab0[_0xe31a('0x6')](_0xe31a('0x7'),attributes,{'tableName':_0xe31a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x50e632=this;var _0x382d93=[_0xe31a('0x9'),'Fax',_0xe31a('0xa'),_0xe31a('0xb'),_0xe31a('0xc'),_0xe31a('0xd'),_0xe31a('0xe')];return Promise['resolve']()[_0xe31a('0x1')](function(){var _0x3f1c25=_[_0xe31a('0x2')](_0x382d93,function(_0x59c2ee){return getQueuesByChannel(_0x50e632,_0x59c2ee);});return Promise[_0xe31a('0xf')](_0x3f1c25);})['catch'](function(_0x54674b){throw _0x54674b;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9c228f4..b483305 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 _0x75ae=['defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x59c7e7,_0xd443d7){var _0x49d754=function(_0x164dd0){while(--_0x164dd0){_0x59c7e7['push'](_0x59c7e7['shift']());}};_0x49d754(++_0xd443d7);}(_0x75ae,0x1c2));var _0xe75a=function(_0x23ce02,_0x260d71){_0x23ce02=_0x23ce02-0x0;var _0xf12f7f=_0x75ae[_0x23ce02];return _0xf12f7f;};'use strict';var _=require(_0xe75a('0x0'));var util=require(_0xe75a('0x1'));var moment=require(_0xe75a('0x2'));var BPromise=require(_0xe75a('0x3'));var rs=require(_0xe75a('0x4'));var fs=require('fs');var Redis=require(_0xe75a('0x5'));var db=require(_0xe75a('0x6'))['db'];var utils=require(_0xe75a('0x7'));var logger=require(_0xe75a('0x8'))(_0xe75a('0x9'));var config=require(_0xe75a('0xa'));var jayson=require(_0xe75a('0xb'));var client=jayson[_0xe75a('0xc')][_0xe75a('0xd')]({'port':0x232a});config[_0xe75a('0xe')]=_[_0xe75a('0xf')](config[_0xe75a('0xe')],{'host':_0xe75a('0x10'),'port':0x18eb});var socket=require(_0xe75a('0x11'))(new Redis(config[_0xe75a('0xe')]));require(_0xe75a('0x12'))[_0xe75a('0x13')](socket);function respondWithRpcPromise(_0x4a9c26,_0x4c6868,_0x243a6b){return new BPromise(function(_0xc9704e,_0x75b3d1){return client[_0xe75a('0x14')](_0x4a9c26,_0x243a6b)['then'](function(_0x177346){logger[_0xe75a('0x15')](_0xe75a('0x16'),_0x4c6868,_0xe75a('0x17'));logger['debug'](_0xe75a('0x18'),_0x4c6868,_0xe75a('0x17'),JSON[_0xe75a('0x19')](_0x177346));if(_0x177346[_0xe75a('0x1a')]){if(_0x177346['error'][_0xe75a('0x1b')]===0x1f4){logger[_0xe75a('0x1a')]('Team,\x20%s,\x20%s',_0x4c6868,_0x177346[_0xe75a('0x1a')][_0xe75a('0x1c')]);return _0x75b3d1(_0x177346['error'][_0xe75a('0x1c')]);}logger[_0xe75a('0x1a')](_0xe75a('0x16'),_0x4c6868,_0x177346[_0xe75a('0x1a')][_0xe75a('0x1c')]);return _0xc9704e(_0x177346['error'][_0xe75a('0x1c')]);}else{logger['info'](_0xe75a('0x16'),_0x4c6868,_0xe75a('0x17'));_0xc9704e(_0x177346[_0xe75a('0x1d')][_0xe75a('0x1c')]);}})[_0xe75a('0x1e')](function(_0x563cc6){logger['error'](_0xe75a('0x16'),_0x4c6868,_0x563cc6);_0x75b3d1(_0x563cc6);});});} \ No newline at end of file +var _0x74b6=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2cd9ed,_0x5b50f3){var _0x44d6ba=function(_0x1b989e){while(--_0x1b989e){_0x2cd9ed['push'](_0x2cd9ed['shift']());}};_0x44d6ba(++_0x5b50f3);}(_0x74b6,0x178));var _0x674b=function(_0x4ccfd7,_0x3681f8){_0x4ccfd7=_0x4ccfd7-0x0;var _0x2ee3db=_0x74b6[_0x4ccfd7];return _0x2ee3db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x674b('0x0'));var BPromise=require(_0x674b('0x1'));var rs=require(_0x674b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x674b('0x3'))['db'];var utils=require(_0x674b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x674b('0x5'));var jayson=require(_0x674b('0x6'));var client=jayson['client'][_0x674b('0x7')]({'port':0x232a});config[_0x674b('0x8')]=_['defaults'](config[_0x674b('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x674b('0x9'))(new Redis(config[_0x674b('0x8')]));require(_0x674b('0xa'))[_0x674b('0xb')](socket);function respondWithRpcPromise(_0x47bda1,_0x11476f,_0x2a5825){return new BPromise(function(_0x31341d,_0x4a7caa){return client[_0x674b('0xc')](_0x47bda1,_0x2a5825)[_0x674b('0xd')](function(_0x39235a){logger[_0x674b('0xe')](_0x674b('0xf'),_0x11476f,'request\x20sent');logger[_0x674b('0x10')](_0x674b('0x11'),_0x11476f,_0x674b('0x12'),JSON[_0x674b('0x13')](_0x39235a));if(_0x39235a['error']){if(_0x39235a[_0x674b('0x14')][_0x674b('0x15')]===0x1f4){logger[_0x674b('0x14')](_0x674b('0xf'),_0x11476f,_0x39235a[_0x674b('0x14')]['message']);return _0x4a7caa(_0x39235a[_0x674b('0x14')]['message']);}logger[_0x674b('0x14')](_0x674b('0xf'),_0x11476f,_0x39235a[_0x674b('0x14')][_0x674b('0x16')]);return _0x31341d(_0x39235a[_0x674b('0x14')][_0x674b('0x16')]);}else{logger[_0x674b('0xe')](_0x674b('0xf'),_0x11476f,_0x674b('0x12'));_0x31341d(_0x39235a[_0x674b('0x17')]['message']);}})[_0x674b('0x18')](function(_0x5acd41){logger[_0x674b('0x14')]('Team,\x20%s,\x20%s',_0x11476f,_0x5acd41);_0x4a7caa(_0x5acd41);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3a49b31..b870be0 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 _0x3946=['length','team:','save','remove','update','emit','removeListener'];(function(_0x350d60,_0x381563){var _0x1c8210=function(_0x139031){while(--_0x139031){_0x350d60['push'](_0x350d60['shift']());}};_0x1c8210(++_0x381563);}(_0x3946,0x1d0));var _0x6394=function(_0x188888,_0x2a0a1c){_0x188888=_0x188888-0x0;var _0x1491a8=_0x3946[_0x188888];return _0x1491a8;};'use strict';var TeamEvents=require('./team.events');var events=[_0x6394('0x0'),_0x6394('0x1'),_0x6394('0x2')];function createListener(_0x1fce9c,_0xa72380){return function(_0x4e6546){_0xa72380[_0x6394('0x3')](_0x1fce9c,_0x4e6546);};}function removeListener(_0x2dbc9b,_0x119d13){return function(){TeamEvents[_0x6394('0x4')](_0x2dbc9b,_0x119d13);};}exports['register']=function(_0x413d9d){for(var _0x1cf698=0x0,_0x3f5163=events[_0x6394('0x5')];_0x1cf698<_0x3f5163;_0x1cf698++){var _0x244ca1=events[_0x1cf698];var _0x10d154=createListener(_0x6394('0x6')+_0x244ca1,_0x413d9d);TeamEvents['on'](_0x244ca1,_0x10d154);}}; \ No newline at end of file +var _0x46d1=['team:','./team.events','save','remove','update','removeListener','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46d1,0xbe));var _0x146d=function(_0x16b6c8,_0x50cb52){_0x16b6c8=_0x16b6c8-0x0;var _0x196c4e=_0x46d1[_0x16b6c8];return _0x196c4e;};'use strict';var TeamEvents=require(_0x146d('0x0'));var events=[_0x146d('0x1'),_0x146d('0x2'),_0x146d('0x3')];function createListener(_0x3f4105,_0x3b4d39){return function(_0x4766e6){_0x3b4d39['emit'](_0x3f4105,_0x4766e6);};}function removeListener(_0x28792c,_0x430bb9){return function(){TeamEvents[_0x146d('0x4')](_0x28792c,_0x430bb9);};}exports['register']=function(_0x3a122d){for(var _0x5aa0d8=0x0,_0x88a7fe=events[_0x146d('0x5')];_0x5aa0d8<_0x88a7fe;_0x5aa0d8++){var _0x37e0ca=events[_0x5aa0d8];var _0x4b67f2=createListener(_0x146d('0x6')+_0x37e0ca,_0x3a122d);TeamEvents['on'](_0x37e0ca,_0x4b67f2);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index b295f5d..74c110d 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 _0x55e0=['INTEGER','sequelize','exports'];(function(_0x3c52d4,_0x526304){var _0x3c487e=function(_0x852c72){while(--_0x852c72){_0x3c52d4['push'](_0x3c52d4['shift']());}};_0x3c487e(++_0x526304);}(_0x55e0,0xdc));var _0x055e=function(_0x30e375,_0x1d460d){_0x30e375=_0x30e375-0x0;var _0x4c1f5e=_0x55e0[_0x30e375];return _0x4c1f5e;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'TeamId':{'type':Sequelize[_0x055e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x055e('0x2')]}}; \ No newline at end of file +var _0x7c21=['exports','INTEGER','sequelize'];(function(_0x19c37a,_0x26827a){var _0x38fae9=function(_0x1b558f){while(--_0x1b558f){_0x19c37a['push'](_0x19c37a['shift']());}};_0x38fae9(++_0x26827a);}(_0x7c21,0x1e2));var _0x17c2=function(_0x3f8c4,_0xbce0dc){_0x3f8c4=_0x3f8c4-0x0;var _0xcaa405=_0x7c21[_0x3f8c4];return _0xcaa405;};'use strict';var Sequelize=require(_0x17c2('0x0'));module[_0x17c2('0x1')]={'TeamId':{'type':Sequelize[_0x17c2('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d18eef5..5d7c57c 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 _0x352e=['define','TeamVoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x139dbf,_0x552754){var _0x21ef84=function(_0xf1b7dc){while(--_0xf1b7dc){_0x139dbf['push'](_0x139dbf['shift']());}};_0x21ef84(++_0x552754);}(_0x352e,0x1a6));var _0xe352=function(_0x3a5cbc,_0x52db64){_0x3a5cbc=_0x3a5cbc-0x0;var _0xd527ba=_0x352e[_0x3a5cbc];return _0xd527ba;};'use strict';var _=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var logger=require(_0xe352('0x2'))(_0xe352('0x3'));var moment=require(_0xe352('0x4'));var BPromise=require(_0xe352('0x5'));var rp=require(_0xe352('0x6'));var fs=require('fs');var path=require(_0xe352('0x7'));var rimraf=require('rimraf');var config=require(_0xe352('0x8'));var attributes=require(_0xe352('0x9'));module['exports']=function(_0x2fed6a,_0x31aac8){return _0x2fed6a[_0xe352('0xa')](_0xe352('0xb'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabad,0x150));var _0xdaba=function(_0x319d77,_0x445f72){_0x319d77=_0x319d77-0x0;var _0x1dd41c=_0xabad[_0x319d77];return _0x1dd41c;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index dba9d6d..98c7110 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4e05cd,_0xcdce6d){var _0x5b31d0=function(_0x55e85f){while(--_0x55e85f){_0x4e05cd['push'](_0x4e05cd['shift']());}};_0x5b31d0(++_0xcdce6d);}(_0x70e0,0x17b));var _0x070e=function(_0x32ff7e,_0x48e1f7){_0x32ff7e=_0x32ff7e-0x0;var _0x470856=_0x70e0[_0x32ff7e];return _0x470856;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9949f60..1d3d442 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 _0xb1bd=['sequelize'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0xb1bd,0x105));var _0xdb1b=function(_0x1dc8e0,_0x4ddf10){_0x1dc8e0=_0x1dc8e0-0x0;var _0x4e0682=_0xb1bd[_0x1dc8e0];return _0x4e0682;};'use strict';var Sequelize=require(_0xdb1b('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e79=['sequelize','exports','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1e79,0xff));var _0x91e7=function(_0x718468,_0x108296){_0x718468=_0x718468-0x0;var _0x1bb4ac=_0x1e79[_0x718468];return _0x1bb4ac;};'use strict';var Sequelize=require(_0x91e7('0x0'));module[_0x91e7('0x1')]={'penalty':{'type':Sequelize[_0x91e7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index e5aaab4..4018dec 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 _0xc737=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','define','team_has_voice_queues','lodash'];(function(_0x3df234,_0x13dba4){var _0x33eaac=function(_0x4dee81){while(--_0x4dee81){_0x3df234['push'](_0x3df234['shift']());}};_0x33eaac(++_0x13dba4);}(_0xc737,0x154));var _0x7c73=function(_0x37026f,_0x2df88f){_0x37026f=_0x37026f-0x0;var _0x40cb74=_0xc737[_0x37026f];return _0x40cb74;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var logger=require(_0x7c73('0x2'))(_0x7c73('0x3'));var moment=require('moment');var BPromise=require(_0x7c73('0x4'));var rp=require(_0x7c73('0x5'));var fs=require('fs');var path=require(_0x7c73('0x6'));var rimraf=require('rimraf');var config=require(_0x7c73('0x7'));var attributes=require(_0x7c73('0x8'));module['exports']=function(_0x5ad227,_0x37635c){return _0x5ad227[_0x7c73('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x7c73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['path','rimraf','./teamVoiceQueue.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54e0e7,_0x14240e){var _0x598f7f=function(_0x153e6f){while(--_0x153e6f){_0x54e0e7['push'](_0x54e0e7['shift']());}};_0x598f7f(++_0x14240e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0xb4e6[_0x287a47];return _0x3fb726;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 623b62d..7a58788 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 _0x4262=['info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x46e379,_0x33ae98){var _0x2365fe=function(_0x39ecf7){while(--_0x39ecf7){_0x46e379['push'](_0x46e379['shift']());}};_0x2365fe(++_0x33ae98);}(_0x4262,0x15f));var _0x2426=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4262[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2426('0x0'));var util=require(_0x2426('0x1'));var moment=require(_0x2426('0x2'));var BPromise=require('bluebird');var rs=require(_0x2426('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2426('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2426('0x5'));var config=require(_0x2426('0x6'));var jayson=require(_0x2426('0x7'));var client=jayson[_0x2426('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12f6f0,_0x398a5b,_0x2ba584){return new BPromise(function(_0x2bffc1,_0x129b0d){return client['request'](_0x12f6f0,_0x2ba584)[_0x2426('0x9')](function(_0x1e27e0){logger[_0x2426('0xa')](_0x2426('0xb'),_0x398a5b,_0x2426('0xc'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x398a5b,_0x2426('0xc'),JSON[_0x2426('0xd')](_0x1e27e0));if(_0x1e27e0[_0x2426('0xe')]){if(_0x1e27e0[_0x2426('0xe')][_0x2426('0xf')]===0x1f4){logger['error'](_0x2426('0xb'),_0x398a5b,_0x1e27e0[_0x2426('0xe')][_0x2426('0x10')]);return _0x129b0d(_0x1e27e0[_0x2426('0xe')]['message']);}logger[_0x2426('0xe')](_0x2426('0xb'),_0x398a5b,_0x1e27e0[_0x2426('0xe')][_0x2426('0x10')]);return _0x2bffc1(_0x1e27e0[_0x2426('0xe')][_0x2426('0x10')]);}else{logger['info'](_0x2426('0xb'),_0x398a5b,_0x2426('0xc'));_0x2bffc1(_0x1e27e0[_0x2426('0x11')][_0x2426('0x10')]);}})[_0x2426('0x12')](function(_0x4d6928){logger['error'](_0x2426('0xb'),_0x398a5b,_0x4d6928);_0x129b0d(_0x4d6928);});});} \ No newline at end of file +var _0x98b8=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x575c88,_0x424679){var _0x31ef9a=function(_0x1d6a4f){while(--_0x1d6a4f){_0x575c88['push'](_0x575c88['shift']());}};_0x31ef9a(++_0x424679);}(_0x98b8,0x93));var _0x898b=function(_0x5216d1,_0x3f9ae9){_0x5216d1=_0x5216d1-0x0;var _0x13865a=_0x98b8[_0x5216d1];return _0x13865a;};'use strict';var _=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var moment=require(_0x898b('0x2'));var BPromise=require(_0x898b('0x3'));var rs=require(_0x898b('0x4'));var fs=require('fs');var Redis=require(_0x898b('0x5'));var db=require(_0x898b('0x6'))['db'];var utils=require(_0x898b('0x7'));var logger=require(_0x898b('0x8'))(_0x898b('0x9'));var config=require(_0x898b('0xa'));var jayson=require(_0x898b('0xb'));var client=jayson[_0x898b('0xc')][_0x898b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x124030,_0x4e9410,_0x3989f9){return new BPromise(function(_0x32e2e,_0x4220a7){return client[_0x898b('0xe')](_0x124030,_0x3989f9)[_0x898b('0xf')](function(_0x46118b){logger[_0x898b('0x10')](_0x898b('0x11'),_0x4e9410,'request\x20sent');logger[_0x898b('0x12')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4e9410,'request\x20sent',JSON[_0x898b('0x13')](_0x46118b));if(_0x46118b[_0x898b('0x14')]){if(_0x46118b[_0x898b('0x14')][_0x898b('0x15')]===0x1f4){logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);return _0x4220a7(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b['error'][_0x898b('0x16')]);return _0x32e2e(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4e9410,_0x898b('0x17'));_0x32e2e(_0x46118b[_0x898b('0x18')][_0x898b('0x16')]);}})[_0x898b('0x19')](function(_0x54cd3b){logger[_0x898b('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4e9410,_0x54cd3b);_0x4220a7(_0x54cd3b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 2c2d38b..7225af4 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 _0xbe2c=['isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x11e496,_0x550762){var _0x4b2c4b=function(_0x1f6b6a){while(--_0x1f6b6a){_0x11e496['push'](_0x11e496['shift']());}};_0x4b2c4b(++_0x550762);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x55659a,_0x4a775c){_0x55659a=_0x55659a-0x0;var _0xc7b3eb=_0xbe2c[_0x55659a];return _0xc7b3eb;};'use strict';var multer=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var path=require('path');var timeout=require(_0xcbe2('0x2'));var express=require('express');var router=express[_0xcbe2('0x3')]();var fs_extra=require(_0xcbe2('0x4'));var auth=require(_0xcbe2('0x5'));var interaction=require(_0xcbe2('0x6'));var config=require(_0xcbe2('0x7'));var controller=require('./template.controller');router[_0xcbe2('0x8')]('/',auth[_0xcbe2('0x9')](),controller['index']);router[_0xcbe2('0x8')](_0xcbe2('0xa'),auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xb')]);router[_0xcbe2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcbe2('0xd')](_0xcbe2('0xa'),auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xe')]);router['delete']('/:id',auth[_0xcbe2('0x9')](),controller[_0xcbe2('0xf')]);module[_0xcbe2('0x10')]=router; \ No newline at end of file +var _0x0650=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','delete','multer','path','connect-timeout'];(function(_0x4cbe23,_0x526d2b){var _0x2d972c=function(_0xa73500){while(--_0xa73500){_0x4cbe23['push'](_0x4cbe23['shift']());}};_0x2d972c(++_0x526d2b);}(_0x0650,0xed));var _0x0065=function(_0x395c24,_0x48d2cb){_0x395c24=_0x395c24-0x0;var _0x1d708b=_0x0650[_0x395c24];return _0x1d708b;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0065('0x4'));var interaction=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var controller=require('./template.controller');router[_0x0065('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0065('0x8'),auth[_0x0065('0x9')](),controller[_0x0065('0xa')]);router[_0x0065('0xb')]('/',auth[_0x0065('0x9')](),controller[_0x0065('0xc')]);router[_0x0065('0xd')](_0x0065('0x8'),auth[_0x0065('0x9')](),controller['update']);router[_0x0065('0xe')](_0x0065('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index c43239b..0440711 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 _0xa61e=['exports','STRING','sequelize'];(function(_0x1c6041,_0x142544){var _0x42ba16=function(_0x2478dc){while(--_0x2478dc){_0x1c6041['push'](_0x1c6041['shift']());}};_0x42ba16(++_0x142544);}(_0xa61e,0x1ac));var _0xea61=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa61e[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xea61('0x0'));module[_0xea61('0x1')]={'name':{'type':Sequelize[_0xea61('0x2')]},'description':{'type':Sequelize[_0xea61('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x584a=['sequelize','STRING','TEXT'];(function(_0x49238c,_0x5e67d7){var _0x5271cb=function(_0x3cf51e){while(--_0x3cf51e){_0x49238c['push'](_0x49238c['shift']());}};_0x5271cb(++_0x5e67d7);}(_0x584a,0xdb));var _0xa584=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x584a[_0x53a7a8];return _0x555f71;};'use strict';var Sequelize=require(_0xa584('0x0'));module['exports']={'name':{'type':Sequelize[_0xa584('0x1')]},'description':{'type':Sequelize[_0xa584('0x1')]},'html':{'type':Sequelize[_0xa584('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ed83a23..0f156d8 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 _0x15b5=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','reject','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','offset','order','where','pick'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x15b5,0x102));var _0x515b=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0x15b5[_0x356e8d];return _0x39e65a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x515b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x515b('0x1'));var rp=require('request-promise');var moment=require(_0x515b('0x2'));var BPromise=require(_0x515b('0x3'));var Mustache=require(_0x515b('0x4'));var util=require(_0x515b('0x5'));var path=require(_0x515b('0x6'));var sox=require('sox');var csv=require(_0x515b('0x7'));var ejs=require(_0x515b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x515b('0x9'));var crypto=require(_0x515b('0xa'));var jsforce=require(_0x515b('0xb'));var deskjs=require(_0x515b('0xc'));var toCsv=require(_0x515b('0x7'));var querystring=require(_0x515b('0xd'));var Papa=require(_0x515b('0xe'));var Redis=require(_0x515b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x515b('0x10'));var as=require(_0x515b('0x11'));var hardwareService=require(_0x515b('0x12'));var logger=require('../../config/logger')(_0x515b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x515b('0x14'))['db'];function respondWithStatusCode(_0x136d31,_0x124d1a){_0x124d1a=_0x124d1a||0xcc;return function(_0x2eccab){if(_0x2eccab){return _0x136d31[_0x515b('0x15')](_0x124d1a);}return _0x136d31[_0x515b('0x16')](_0x124d1a)[_0x515b('0x17')]();};}function respondWithResult(_0x5b24be,_0x4e7306){_0x4e7306=_0x4e7306||0xc8;return function(_0x41452){if(_0x41452){return _0x5b24be[_0x515b('0x16')](_0x4e7306)[_0x515b('0x18')](_0x41452);}};}function respondWithFilteredResult(_0x27a611,_0x110a98){return function(_0x5b4029){if(_0x5b4029){var _0x143a40=typeof _0x110a98['offset']==='undefined'&&typeof _0x110a98[_0x515b('0x19')]===_0x515b('0x1a');var _0x5c7d9e=_0x5b4029['count'];var _0x203546=_0x143a40?0x0:_0x110a98['offset'];var _0x271551=_0x143a40?_0x5b4029[_0x515b('0x1b')]:_0x110a98['offset']+_0x110a98[_0x515b('0x19')];var _0x5f10d9;if(_0x271551>=_0x5c7d9e){_0x271551=_0x5c7d9e;_0x5f10d9=0xc8;}else{_0x5f10d9=0xce;}_0x27a611[_0x515b('0x16')](_0x5f10d9);return _0x27a611['set'](_0x515b('0x1c'),_0x203546+'-'+_0x271551+'/'+_0x5c7d9e)['json'](_0x5b4029);}return null;};}function patchUpdates(_0x4aab0e){return function(_0x2583d3){try{jsonpatch['apply'](_0x2583d3,_0x4aab0e,!![]);}catch(_0x2c35a1){return BPromise[_0x515b('0x1d')](_0x2c35a1);}return _0x2583d3['save']();};}function saveUpdates(_0x50b592,_0x4c814f){return function(_0xca2645){if(_0xca2645){return _0xca2645[_0x515b('0x1e')](_0x50b592)[_0x515b('0x1f')](function(_0x714202){return _0x714202;});}return null;};}function removeEntity(_0x48f954,_0x2f3c07){return function(_0x4d30b1){if(_0x4d30b1){return _0x4d30b1[_0x515b('0x20')]()[_0x515b('0x1f')](function(){var _0x1fa6b5=_0x4d30b1[_0x515b('0x21')]({'plain':!![]});var _0x954eb9=_0x515b('0x22');return db[_0x515b('0x23')][_0x515b('0x20')]({'where':{'type':_0x954eb9,'resourceId':_0x1fa6b5['id']}})[_0x515b('0x1f')](function(){return _0x4d30b1;});})[_0x515b('0x1f')](function(){_0x48f954[_0x515b('0x16')](0xcc)[_0x515b('0x17')]();});}};}function handleEntityNotFound(_0x234c7e,_0x4fda81){return function(_0x445a40){if(!_0x445a40){_0x234c7e[_0x515b('0x15')](0x194);}return _0x445a40;};}function handleError(_0x292198,_0x17bdc2){_0x17bdc2=_0x17bdc2||0x1f4;return function(_0x559bb9){logger[_0x515b('0x24')](_0x559bb9[_0x515b('0x25')]);if(_0x559bb9[_0x515b('0x26')]){delete _0x559bb9[_0x515b('0x26')];}_0x292198['status'](_0x17bdc2)['send'](_0x559bb9);};}exports[_0x515b('0x27')]=function(_0x2c2e26,_0x4702fc){var _0x128d38={},_0xafa466={},_0x550322={'count':0x0,'rows':[]};var _0x3af55d=_['map'](db[_0x515b('0x28')][_0x515b('0x29')],function(_0x5ca662){return{'name':_0x5ca662[_0x515b('0x2a')],'type':_0x5ca662[_0x515b('0x2b')][_0x515b('0x2c')]};});_0xafa466[_0x515b('0x2d')]=_[_0x515b('0x2e')](_0x3af55d,_0x515b('0x26'));_0xafa466[_0x515b('0x2f')]=_[_0x515b('0x30')](_0x2c2e26[_0x515b('0x2f')]);_0xafa466[_0x515b('0x31')]=_[_0x515b('0x32')](_0xafa466[_0x515b('0x2d')],_0xafa466['query']);_0x128d38['attributes']=_[_0x515b('0x32')](_0xafa466['model'],qs[_0x515b('0x33')](_0x2c2e26[_0x515b('0x2f')][_0x515b('0x33')]));_0x128d38[_0x515b('0x34')]=_0x128d38[_0x515b('0x34')]['length']?_0x128d38[_0x515b('0x34')]:_0xafa466[_0x515b('0x2d')];if(!_0x2c2e26['query'][_0x515b('0x35')]('nolimit')){_0x128d38[_0x515b('0x19')]=qs[_0x515b('0x19')](_0x2c2e26['query'][_0x515b('0x19')]);_0x128d38['offset']=qs[_0x515b('0x36')](_0x2c2e26[_0x515b('0x2f')][_0x515b('0x36')]);}_0x128d38[_0x515b('0x37')]=qs['sort'](_0x2c2e26[_0x515b('0x2f')]['sort']);_0x128d38[_0x515b('0x38')]=qs['filters'](_[_0x515b('0x39')](_0x2c2e26[_0x515b('0x2f')],_0xafa466['filters']),_0x3af55d);if(_0x2c2e26[_0x515b('0x2f')][_0x515b('0x3a')]){_0x128d38['where']=_[_0x515b('0x3b')](_0x128d38[_0x515b('0x38')],{'$or':_[_0x515b('0x2e')](_0x3af55d,function(_0x20b693){if(_0x20b693[_0x515b('0x2b')]!==_0x515b('0x3c')){var _0x8c71b4={};_0x8c71b4[_0x20b693[_0x515b('0x26')]]={'$like':'%'+_0x2c2e26[_0x515b('0x2f')]['filter']+'%'};return _0x8c71b4;}})});}_0x128d38=_[_0x515b('0x3b')]({},_0x128d38,_0x2c2e26[_0x515b('0x3d')]);var _0x172d2c={'where':_0x128d38[_0x515b('0x38')]};return db[_0x515b('0x28')]['count'](_0x172d2c)[_0x515b('0x1f')](function(_0x55521e){_0x550322['count']=_0x55521e;if(_0x2c2e26[_0x515b('0x2f')][_0x515b('0x3e')]){_0x128d38['include']=[{'all':!![]}];}return db['Template'][_0x515b('0x3f')](_0x128d38);})[_0x515b('0x1f')](function(_0x316a2c){_0x550322[_0x515b('0x40')]=_0x316a2c;return _0x550322;})[_0x515b('0x1f')](respondWithFilteredResult(_0x4702fc,_0x128d38))[_0x515b('0x41')](handleError(_0x4702fc,null));};exports[_0x515b('0x42')]=function(_0x32840d,_0x220846){var _0x3c9f2d={'raw':!![],'where':{'id':_0x32840d[_0x515b('0x43')]['id']}},_0x100432={};_0x100432['model']=_[_0x515b('0x30')](db['Template'][_0x515b('0x29')]);_0x100432[_0x515b('0x2f')]=_[_0x515b('0x30')](_0x32840d['query']);_0x100432[_0x515b('0x31')]=_['intersection'](_0x100432['model'],_0x100432[_0x515b('0x2f')]);_0x3c9f2d[_0x515b('0x34')]=_[_0x515b('0x32')](_0x100432[_0x515b('0x2d')],qs[_0x515b('0x33')](_0x32840d['query'][_0x515b('0x33')]));_0x3c9f2d[_0x515b('0x34')]=_0x3c9f2d['attributes'][_0x515b('0x44')]?_0x3c9f2d[_0x515b('0x34')]:_0x100432[_0x515b('0x2d')];if(_0x32840d[_0x515b('0x2f')]['includeAll']){_0x3c9f2d[_0x515b('0x45')]=[{'all':!![]}];}_0x3c9f2d=_['merge']({},_0x3c9f2d,_0x32840d[_0x515b('0x3d')]);return db[_0x515b('0x28')]['find'](_0x3c9f2d)[_0x515b('0x1f')](handleEntityNotFound(_0x220846,null))[_0x515b('0x1f')](respondWithResult(_0x220846,null))['catch'](handleError(_0x220846,null));};exports[_0x515b('0x46')]=function(_0x7d1d38,_0xc868e6){return db['Template'][_0x515b('0x46')](_0x7d1d38[_0x515b('0x47')],{})['then'](function(_0x4b572b){var _0x1aa890=_0x7d1d38[_0x515b('0x48')][_0x515b('0x21')]({'plain':!![]});if(!_0x1aa890)throw new Error(_0x515b('0x49'));if(_0x1aa890[_0x515b('0x4a')]===_0x515b('0x48')){var _0x339dae=_0x4b572b['get']({'plain':!![]});var _0x4ebd4a=_0x515b('0x22');return db[_0x515b('0x4b')]['find']({'where':{'name':_0x4ebd4a,'userProfileId':_0x1aa890[_0x515b('0x4c')]},'raw':!![]})[_0x515b('0x1f')](function(_0x4b3e5d){if(_0x4b3e5d&&_0x4b3e5d['autoAssociation']===0x0){return db[_0x515b('0x23')][_0x515b('0x46')]({'name':_0x339dae[_0x515b('0x26')],'resourceId':_0x339dae['id'],'type':_0x4b3e5d[_0x515b('0x26')],'sectionId':_0x4b3e5d['id']},{})[_0x515b('0x1f')](function(){return _0x4b572b;});}else{return _0x4b572b;}})[_0x515b('0x41')](function(_0x1fa4ce){logger['error'](_0x515b('0x4d'),_0x1fa4ce);throw _0x1fa4ce;});}return _0x4b572b;})[_0x515b('0x1f')](respondWithResult(_0xc868e6,0xc9))['catch'](handleError(_0xc868e6,null));};exports[_0x515b('0x1e')]=function(_0x7a71d,_0x57d2fd){if(_0x7a71d['body']['id']){delete _0x7a71d[_0x515b('0x47')]['id'];}return db[_0x515b('0x28')][_0x515b('0x4e')]({'where':{'id':_0x7a71d[_0x515b('0x43')]['id']}})['then'](handleEntityNotFound(_0x57d2fd,null))[_0x515b('0x1f')](saveUpdates(_0x7a71d[_0x515b('0x47')],null))[_0x515b('0x1f')](respondWithResult(_0x57d2fd,null))[_0x515b('0x41')](handleError(_0x57d2fd,null));};exports['destroy']=function(_0x1c0464,_0x5c4d55){return db[_0x515b('0x28')][_0x515b('0x4e')]({'where':{'id':_0x1c0464[_0x515b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c4d55,null))[_0x515b('0x1f')](removeEntity(_0x5c4d55,null))[_0x515b('0x41')](handleError(_0x5c4d55,null));}; \ No newline at end of file +var _0x4def=['stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','length','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Templates','UserProfileResource'];(function(_0x5ce509,_0x46f9ab){var _0x5d6deb=function(_0x37d2f2){while(--_0x37d2f2){_0x5ce509['push'](_0x5ce509['shift']());}};_0x5d6deb(++_0x46f9ab);}(_0x4def,0xc8));var _0xf4de=function(_0x4b4c68,_0x14d416){_0x4b4c68=_0x4b4c68-0x0;var _0x1686e6=_0x4def[_0x4b4c68];return _0x1686e6;};'use strict';var emlformat=require(_0xf4de('0x0'));var rimraf=require(_0xf4de('0x1'));var zipdir=require(_0xf4de('0x2'));var jsonpatch=require(_0xf4de('0x3'));var rp=require(_0xf4de('0x4'));var moment=require('moment');var BPromise=require(_0xf4de('0x5'));var Mustache=require('mustache');var util=require(_0xf4de('0x6'));var path=require(_0xf4de('0x7'));var sox=require(_0xf4de('0x8'));var csv=require(_0xf4de('0x9'));var ejs=require(_0xf4de('0xa'));var fs=require('fs');var fs_extra=require(_0xf4de('0xb'));var _=require(_0xf4de('0xc'));var squel=require(_0xf4de('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4de('0xe'));var Papa=require(_0xf4de('0xf'));var Redis=require(_0xf4de('0x10'));var authService=require(_0xf4de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf4de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4de('0x13'))('api');var utils=require(_0xf4de('0x14'));var config=require(_0xf4de('0x15'));var licenseUtil=require(_0xf4de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cfa4b,_0x583211){_0x583211=_0x583211||0xcc;return function(_0x4cb107){if(_0x4cb107){return _0x2cfa4b[_0xf4de('0x17')](_0x583211);}return _0x2cfa4b[_0xf4de('0x18')](_0x583211)[_0xf4de('0x19')]();};}function respondWithResult(_0xececd4,_0x52093d){_0x52093d=_0x52093d||0xc8;return function(_0x46ce13){if(_0x46ce13){return _0xececd4[_0xf4de('0x18')](_0x52093d)[_0xf4de('0x1a')](_0x46ce13);}};}function respondWithFilteredResult(_0x17569c,_0x9a879d){return function(_0x264dce){if(_0x264dce){var _0x46320a=typeof _0x9a879d[_0xf4de('0x1b')]===_0xf4de('0x1c')&&typeof _0x9a879d[_0xf4de('0x1d')]===_0xf4de('0x1c');var _0x568a03=_0x264dce[_0xf4de('0x1e')];var _0x502136=_0x46320a?0x0:_0x9a879d[_0xf4de('0x1b')];var _0x2446bd=_0x46320a?_0x264dce['count']:_0x9a879d['offset']+_0x9a879d['limit'];var _0x2525e5;if(_0x2446bd>=_0x568a03){_0x2446bd=_0x568a03;_0x2525e5=0xc8;}else{_0x2525e5=0xce;}_0x17569c['status'](_0x2525e5);return _0x17569c[_0xf4de('0x1f')](_0xf4de('0x20'),_0x502136+'-'+_0x2446bd+'/'+_0x568a03)['json'](_0x264dce);}return null;};}function patchUpdates(_0x5d96a5){return function(_0x2f529e){try{jsonpatch['apply'](_0x2f529e,_0x5d96a5,!![]);}catch(_0x595b60){return BPromise['reject'](_0x595b60);}return _0x2f529e[_0xf4de('0x21')]();};}function saveUpdates(_0x530f47,_0x1d8ded){return function(_0x524ec1){if(_0x524ec1){return _0x524ec1[_0xf4de('0x22')](_0x530f47)[_0xf4de('0x23')](function(_0x189a3a){return _0x189a3a;});}return null;};}function removeEntity(_0x4a87aa,_0x30c2ea){return function(_0x15570a){if(_0x15570a){return _0x15570a[_0xf4de('0x24')]()[_0xf4de('0x23')](function(){var _0x1e70c8=_0x15570a[_0xf4de('0x25')]({'plain':!![]});var _0x535e6c=_0xf4de('0x26');return db[_0xf4de('0x27')][_0xf4de('0x24')]({'where':{'type':_0x535e6c,'resourceId':_0x1e70c8['id']}})[_0xf4de('0x23')](function(){return _0x15570a;});})[_0xf4de('0x23')](function(){_0x4a87aa[_0xf4de('0x18')](0xcc)[_0xf4de('0x19')]();});}};}function handleEntityNotFound(_0x5c9df1,_0x43f3ed){return function(_0xe3f1b9){if(!_0xe3f1b9){_0x5c9df1[_0xf4de('0x17')](0x194);}return _0xe3f1b9;};}function handleError(_0x49de71,_0x2187af){_0x2187af=_0x2187af||0x1f4;return function(_0x153839){logger['error'](_0x153839[_0xf4de('0x28')]);if(_0x153839[_0xf4de('0x29')]){delete _0x153839[_0xf4de('0x29')];}_0x49de71[_0xf4de('0x18')](_0x2187af)[_0xf4de('0x2a')](_0x153839);};}exports['index']=function(_0x473b64,_0x50b395){var _0x361217={},_0x47ce4d={},_0x2c124d={'count':0x0,'rows':[]};var _0x4f13f4=_['map'](db[_0xf4de('0x2b')][_0xf4de('0x2c')],function(_0x365883){return{'name':_0x365883[_0xf4de('0x2d')],'type':_0x365883[_0xf4de('0x2e')][_0xf4de('0x2f')]};});_0x47ce4d[_0xf4de('0x30')]=_[_0xf4de('0x31')](_0x4f13f4,'name');_0x47ce4d[_0xf4de('0x32')]=_['keys'](_0x473b64['query']);_0x47ce4d[_0xf4de('0x33')]=_[_0xf4de('0x34')](_0x47ce4d[_0xf4de('0x30')],_0x47ce4d[_0xf4de('0x32')]);_0x361217[_0xf4de('0x35')]=_[_0xf4de('0x34')](_0x47ce4d[_0xf4de('0x30')],qs[_0xf4de('0x36')](_0x473b64['query'][_0xf4de('0x36')]));_0x361217[_0xf4de('0x35')]=_0x361217[_0xf4de('0x35')]['length']?_0x361217[_0xf4de('0x35')]:_0x47ce4d[_0xf4de('0x30')];if(!_0x473b64[_0xf4de('0x32')][_0xf4de('0x37')](_0xf4de('0x38'))){_0x361217[_0xf4de('0x1d')]=qs[_0xf4de('0x1d')](_0x473b64[_0xf4de('0x32')][_0xf4de('0x1d')]);_0x361217[_0xf4de('0x1b')]=qs['offset'](_0x473b64['query']['offset']);}_0x361217['order']=qs['sort'](_0x473b64[_0xf4de('0x32')]['sort']);_0x361217[_0xf4de('0x39')]=qs[_0xf4de('0x33')](_[_0xf4de('0x3a')](_0x473b64[_0xf4de('0x32')],_0x47ce4d['filters']),_0x4f13f4);if(_0x473b64[_0xf4de('0x32')][_0xf4de('0x3b')]){_0x361217[_0xf4de('0x39')]=_[_0xf4de('0x3c')](_0x361217[_0xf4de('0x39')],{'$or':_[_0xf4de('0x31')](_0x4f13f4,function(_0x5614cf){if(_0x5614cf[_0xf4de('0x2e')]!==_0xf4de('0x3d')){var _0x359495={};_0x359495[_0x5614cf[_0xf4de('0x29')]]={'$like':'%'+_0x473b64[_0xf4de('0x32')][_0xf4de('0x3b')]+'%'};return _0x359495;}})});}_0x361217=_['merge']({},_0x361217,_0x473b64['options']);var _0x1c25e2={'where':_0x361217[_0xf4de('0x39')]};return db[_0xf4de('0x2b')][_0xf4de('0x1e')](_0x1c25e2)[_0xf4de('0x23')](function(_0x3be5bd){_0x2c124d[_0xf4de('0x1e')]=_0x3be5bd;if(_0x473b64[_0xf4de('0x32')]['includeAll']){_0x361217[_0xf4de('0x3e')]=[{'all':!![]}];}return db[_0xf4de('0x2b')][_0xf4de('0x3f')](_0x361217);})[_0xf4de('0x23')](function(_0x30670f){_0x2c124d[_0xf4de('0x40')]=_0x30670f;return _0x2c124d;})[_0xf4de('0x23')](respondWithFilteredResult(_0x50b395,_0x361217))[_0xf4de('0x41')](handleError(_0x50b395,null));};exports['show']=function(_0x41f575,_0x30bf7c){var _0x39e82f={'raw':!![],'where':{'id':_0x41f575[_0xf4de('0x42')]['id']}},_0x3309f3={};_0x3309f3[_0xf4de('0x30')]=_[_0xf4de('0x43')](db[_0xf4de('0x2b')]['rawAttributes']);_0x3309f3[_0xf4de('0x32')]=_[_0xf4de('0x43')](_0x41f575[_0xf4de('0x32')]);_0x3309f3['filters']=_[_0xf4de('0x34')](_0x3309f3[_0xf4de('0x30')],_0x3309f3[_0xf4de('0x32')]);_0x39e82f['attributes']=_[_0xf4de('0x34')](_0x3309f3[_0xf4de('0x30')],qs[_0xf4de('0x36')](_0x41f575[_0xf4de('0x32')][_0xf4de('0x36')]));_0x39e82f[_0xf4de('0x35')]=_0x39e82f['attributes'][_0xf4de('0x44')]?_0x39e82f[_0xf4de('0x35')]:_0x3309f3[_0xf4de('0x30')];if(_0x41f575[_0xf4de('0x32')][_0xf4de('0x45')]){_0x39e82f['include']=[{'all':!![]}];}_0x39e82f=_['merge']({},_0x39e82f,_0x41f575[_0xf4de('0x46')]);return db[_0xf4de('0x2b')][_0xf4de('0x47')](_0x39e82f)[_0xf4de('0x23')](handleEntityNotFound(_0x30bf7c,null))['then'](respondWithResult(_0x30bf7c,null))[_0xf4de('0x41')](handleError(_0x30bf7c,null));};exports['create']=function(_0x31b1f4,_0x1312d1){return db[_0xf4de('0x2b')][_0xf4de('0x48')](_0x31b1f4['body'],{})[_0xf4de('0x23')](function(_0x1c746a){var _0xf9b190=_0x31b1f4['user']['get']({'plain':!![]});if(!_0xf9b190)throw new Error(_0xf4de('0x49'));if(_0xf9b190['role']===_0xf4de('0x4a')){var _0x2fded5=_0x1c746a[_0xf4de('0x25')]({'plain':!![]});var _0x17098d=_0xf4de('0x26');return db['UserProfileSection'][_0xf4de('0x47')]({'where':{'name':_0x17098d,'userProfileId':_0xf9b190[_0xf4de('0x4b')]},'raw':!![]})[_0xf4de('0x23')](function(_0xa11457){if(_0xa11457&&_0xa11457[_0xf4de('0x4c')]===0x0){return db[_0xf4de('0x27')]['create']({'name':_0x2fded5[_0xf4de('0x29')],'resourceId':_0x2fded5['id'],'type':_0xa11457[_0xf4de('0x29')],'sectionId':_0xa11457['id']},{})[_0xf4de('0x23')](function(){return _0x1c746a;});}else{return _0x1c746a;}})[_0xf4de('0x41')](function(_0x28079a){logger[_0xf4de('0x4d')](_0xf4de('0x4e'),_0x28079a);throw _0x28079a;});}return _0x1c746a;})[_0xf4de('0x23')](respondWithResult(_0x1312d1,0xc9))[_0xf4de('0x41')](handleError(_0x1312d1,null));};exports[_0xf4de('0x22')]=function(_0x2bbfbf,_0x5b2d6b){if(_0x2bbfbf[_0xf4de('0x4f')]['id']){delete _0x2bbfbf[_0xf4de('0x4f')]['id'];}return db[_0xf4de('0x2b')][_0xf4de('0x47')]({'where':{'id':_0x2bbfbf[_0xf4de('0x42')]['id']}})[_0xf4de('0x23')](handleEntityNotFound(_0x5b2d6b,null))[_0xf4de('0x23')](saveUpdates(_0x2bbfbf[_0xf4de('0x4f')],null))[_0xf4de('0x23')](respondWithResult(_0x5b2d6b,null))[_0xf4de('0x41')](handleError(_0x5b2d6b,null));};exports['destroy']=function(_0x2a7ea3,_0x2fb049){return db[_0xf4de('0x2b')][_0xf4de('0x47')]({'where':{'id':_0x2a7ea3[_0xf4de('0x42')]['id']}})['then'](handleEntityNotFound(_0x2fb049,null))['then'](removeEntity(_0x2fb049,null))[_0xf4de('0x41')](handleError(_0x2fb049,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e1c5f9a..14c5d8b 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 _0xe6ef=['Template','tools_templates','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x4dba58,_0x5a42ba){var _0x524cfa=function(_0x173fc4){while(--_0x173fc4){_0x4dba58['push'](_0x4dba58['shift']());}};_0x524cfa(++_0x5a42ba);}(_0xe6ef,0xd2));var _0xfe6e=function(_0x26e57c,_0x50475c){_0x26e57c=_0x26e57c-0x0;var _0x1dc7f7=_0xe6ef[_0x26e57c];return _0x1dc7f7;};'use strict';var _=require(_0xfe6e('0x0'));var util=require(_0xfe6e('0x1'));var logger=require('../../config/logger')(_0xfe6e('0x2'));var moment=require(_0xfe6e('0x3'));var BPromise=require(_0xfe6e('0x4'));var rp=require(_0xfe6e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe6e('0x6'));var config=require(_0xfe6e('0x7'));var attributes=require(_0xfe6e('0x8'));module[_0xfe6e('0x9')]=function(_0x101349,_0x1054c9){return _0x101349[_0xfe6e('0xa')](_0xfe6e('0xb'),attributes,{'tableName':_0xfe6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48cf=['../../config/environment','./template.attributes','define','Template','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48cf,0xf4));var _0xf48c=function(_0x52eff3,_0x1a00bf){_0x52eff3=_0x52eff3-0x0;var _0x31a1fb=_0x48cf[_0x52eff3];return _0x31a1fb;};'use strict';var _=require(_0xf48c('0x0'));var util=require(_0xf48c('0x1'));var logger=require('../../config/logger')(_0xf48c('0x2'));var moment=require(_0xf48c('0x3'));var BPromise=require(_0xf48c('0x4'));var rp=require(_0xf48c('0x5'));var fs=require('fs');var path=require(_0xf48c('0x6'));var rimraf=require(_0xf48c('0x7'));var config=require(_0xf48c('0x8'));var attributes=require(_0xf48c('0x9'));module['exports']=function(_0x5096e6,_0x43b087){return _0x5096e6[_0xf48c('0xa')](_0xf48c('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 0970ed2..8e4b63d 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 _0xd672=['model','attributes','GetTemplate','stringify','catch','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','Template','findAll','options','where','limit','include','map'];(function(_0x545be8,_0x32ef2b){var _0x5a4e90=function(_0x20a2c5){while(--_0x20a2c5){_0x545be8['push'](_0x545be8['shift']());}};_0x5a4e90(++_0x32ef2b);}(_0xd672,0x96));var _0x2d67=function(_0x2fcfbb,_0x19e0c0){_0x2fcfbb=_0x2fcfbb-0x0;var _0x4de3dc=_0xd672[_0x2fcfbb];return _0x4de3dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d67('0x0'));var BPromise=require('bluebird');var rs=require(_0x2d67('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d67('0x2'))['db'];var utils=require(_0x2d67('0x3'));var logger=require('../../config/logger')(_0x2d67('0x4'));var config=require(_0x2d67('0x5'));var jayson=require(_0x2d67('0x6'));var client=jayson[_0x2d67('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47c36d,_0x20ed66,_0x750f27){return new BPromise(function(_0x2c1963,_0x158747){return client['request'](_0x47c36d,_0x750f27)[_0x2d67('0x8')](function(_0x259114){logger[_0x2d67('0x9')](_0x2d67('0xa'),_0x20ed66,'request\x20sent');logger[_0x2d67('0xb')](_0x2d67('0xc'),_0x20ed66,_0x2d67('0xd'),JSON['stringify'](_0x259114));if(_0x259114['error']){if(_0x259114[_0x2d67('0xe')]['code']===0x1f4){logger[_0x2d67('0xe')](_0x2d67('0xa'),_0x20ed66,_0x259114[_0x2d67('0xe')]['message']);return _0x158747(_0x259114['error']['message']);}logger[_0x2d67('0xe')]('Template,\x20%s,\x20%s',_0x20ed66,_0x259114[_0x2d67('0xe')][_0x2d67('0xf')]);return _0x2c1963(_0x259114[_0x2d67('0xe')][_0x2d67('0xf')]);}else{logger[_0x2d67('0x9')](_0x2d67('0xa'),_0x20ed66,_0x2d67('0xd'));_0x2c1963(_0x259114[_0x2d67('0x10')][_0x2d67('0xf')]);}})['catch'](function(_0x5ef9ee){logger[_0x2d67('0xe')](_0x2d67('0xa'),_0x20ed66,_0x5ef9ee);_0x158747(_0x5ef9ee);});});}exports['GetTemplate']=function(_0x5ad412){var _0x1198b1=this;return new Promise(function(_0xfad30f,_0x21410a){return db[_0x2d67('0x11')][_0x2d67('0x12')]({'raw':_0x5ad412[_0x2d67('0x13')]?_0x5ad412[_0x2d67('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x5ad412[_0x2d67('0x13')]?_0x5ad412[_0x2d67('0x13')][_0x2d67('0x14')]||null:null,'attributes':_0x5ad412['options']?_0x5ad412[_0x2d67('0x13')]['attributes']||null:null,'limit':_0x5ad412[_0x2d67('0x13')]?_0x5ad412[_0x2d67('0x13')][_0x2d67('0x15')]||null:null,'include':_0x5ad412['options']?_0x5ad412[_0x2d67('0x13')][_0x2d67('0x16')]?_[_0x2d67('0x17')](_0x5ad412[_0x2d67('0x13')][_0x2d67('0x16')],function(_0x30581d){return{'model':db[_0x30581d[_0x2d67('0x18')]],'as':_0x30581d['as'],'attributes':_0x30581d['attributes'],'include':_0x30581d[_0x2d67('0x16')]?_[_0x2d67('0x17')](_0x30581d[_0x2d67('0x16')],function(_0x4b3750){return{'model':db[_0x4b3750[_0x2d67('0x18')]],'as':_0x4b3750['as'],'attributes':_0x4b3750[_0x2d67('0x19')],'include':_0x4b3750[_0x2d67('0x16')]?_[_0x2d67('0x17')](_0x4b3750[_0x2d67('0x16')],function(_0x1ac3e7){return{'model':db[_0x1ac3e7[_0x2d67('0x18')]],'as':_0x1ac3e7['as'],'attributes':_0x1ac3e7[_0x2d67('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x259dd4){logger[_0x2d67('0x9')](_0x2d67('0x1a'),_0x5ad412);logger[_0x2d67('0xb')](_0x2d67('0x1a'),_0x5ad412,JSON[_0x2d67('0x1b')](_0x259dd4));_0xfad30f(_0x259dd4);})[_0x2d67('0x1c')](function(_0xb9abe3){logger[_0x2d67('0xe')](_0x2d67('0x1a'),_0xb9abe3[_0x2d67('0xf')],_0x5ad412);_0x21410a(_0x1198b1[_0x2d67('0xe')](0x1f4,_0xb9abe3['message']));});});}; \ No newline at end of file +var _0x5346=['ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','where','attributes','limit','include','map','model','catch','GetTemplate','lodash','util','moment','bluebird','randomstring'];(function(_0x3ea3dc,_0x2eb364){var _0x1c0125=function(_0x276c83){while(--_0x276c83){_0x3ea3dc['push'](_0x3ea3dc['shift']());}};_0x1c0125(++_0x2eb364);}(_0x5346,0x112));var _0x6534=function(_0x36799c,_0x3dc841){_0x36799c=_0x36799c-0x0;var _0x39b396=_0x5346[_0x36799c];return _0x39b396;};'use strict';var _=require(_0x6534('0x0'));var util=require(_0x6534('0x1'));var moment=require(_0x6534('0x2'));var BPromise=require(_0x6534('0x3'));var rs=require(_0x6534('0x4'));var fs=require('fs');var Redis=require(_0x6534('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6534('0x6'));var config=require(_0x6534('0x7'));var jayson=require(_0x6534('0x8'));var client=jayson[_0x6534('0x9')][_0x6534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c8b2,_0x5af09f,_0x9a1ab3){return new BPromise(function(_0x531b2f,_0x300fee){return client['request'](_0x10c8b2,_0x9a1ab3)[_0x6534('0xb')](function(_0x432f84){logger[_0x6534('0xc')](_0x6534('0xd'),_0x5af09f,_0x6534('0xe'));logger[_0x6534('0xf')](_0x6534('0x10'),_0x5af09f,_0x6534('0xe'),JSON[_0x6534('0x11')](_0x432f84));if(_0x432f84[_0x6534('0x12')]){if(_0x432f84[_0x6534('0x12')][_0x6534('0x13')]===0x1f4){logger[_0x6534('0x12')](_0x6534('0xd'),_0x5af09f,_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);return _0x300fee(_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);}logger[_0x6534('0x12')]('Template,\x20%s,\x20%s',_0x5af09f,_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);return _0x531b2f(_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);}else{logger[_0x6534('0xc')](_0x6534('0xd'),_0x5af09f,_0x6534('0xe'));_0x531b2f(_0x432f84['result']['message']);}})['catch'](function(_0x18ee9b){logger[_0x6534('0x12')](_0x6534('0xd'),_0x5af09f,_0x18ee9b);_0x300fee(_0x18ee9b);});});}exports['GetTemplate']=function(_0x1ec1e6){var _0x287971=this;return new Promise(function(_0x580931,_0x4a21eb){return db['Template'][_0x6534('0x15')]({'raw':_0x1ec1e6['options']?_0x1ec1e6[_0x6534('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec1e6['options']?_0x1ec1e6['options'][_0x6534('0x17')]||null:null,'attributes':_0x1ec1e6[_0x6534('0x16')]?_0x1ec1e6[_0x6534('0x16')][_0x6534('0x18')]||null:null,'limit':_0x1ec1e6['options']?_0x1ec1e6[_0x6534('0x16')][_0x6534('0x19')]||null:null,'include':_0x1ec1e6[_0x6534('0x16')]?_0x1ec1e6['options'][_0x6534('0x1a')]?_[_0x6534('0x1b')](_0x1ec1e6[_0x6534('0x16')][_0x6534('0x1a')],function(_0x1a7bda){return{'model':db[_0x1a7bda[_0x6534('0x1c')]],'as':_0x1a7bda['as'],'attributes':_0x1a7bda[_0x6534('0x18')],'include':_0x1a7bda[_0x6534('0x1a')]?_[_0x6534('0x1b')](_0x1a7bda[_0x6534('0x1a')],function(_0x42caae){return{'model':db[_0x42caae[_0x6534('0x1c')]],'as':_0x42caae['as'],'attributes':_0x42caae[_0x6534('0x18')],'include':_0x42caae[_0x6534('0x1a')]?_['map'](_0x42caae[_0x6534('0x1a')],function(_0x463f21){return{'model':db[_0x463f21[_0x6534('0x1c')]],'as':_0x463f21['as'],'attributes':_0x463f21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25ca7f){logger[_0x6534('0xc')]('GetTemplate',_0x1ec1e6);logger[_0x6534('0xf')]('GetTemplate',_0x1ec1e6,JSON[_0x6534('0x11')](_0x25ca7f));_0x580931(_0x25ca7f);})[_0x6534('0x1d')](function(_0x3e2a53){logger[_0x6534('0x12')](_0x6534('0x1e'),_0x3e2a53[_0x6534('0x14')],_0x1ec1e6);_0x4a21eb(_0x287971[_0x6534('0x12')](0x1f4,_0x3e2a53['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index f7561b7..61e6e57 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 _0xa161=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAction','/:id','destroy','exports','multer','util','path'];(function(_0x38fe29,_0x144f88){var _0x5cd612=function(_0xa3c6e1){while(--_0xa3c6e1){_0x38fe29['push'](_0x38fe29['shift']());}};_0x5cd612(++_0x144f88);}(_0xa161,0x1bf));var _0x1a16=function(_0x2e1934,_0x27b76d){_0x2e1934=_0x2e1934-0x0;var _0x43792a=_0xa161[_0x2e1934];return _0x43792a;};'use strict';var multer=require(_0x1a16('0x0'));var util=require(_0x1a16('0x1'));var path=require(_0x1a16('0x2'));var timeout=require(_0x1a16('0x3'));var express=require('express');var router=express[_0x1a16('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a16('0x5'));var interaction=require(_0x1a16('0x6'));var config=require(_0x1a16('0x7'));var controller=require(_0x1a16('0x8'));router[_0x1a16('0x9')]('/',auth[_0x1a16('0xa')](),controller[_0x1a16('0xb')]);router[_0x1a16('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1a16('0xc')]);router[_0x1a16('0x9')](_0x1a16('0xd'),auth['isAuthenticated'](),controller[_0x1a16('0xe')]);router['get'](_0x1a16('0xf'),auth[_0x1a16('0xa')](),controller[_0x1a16('0x10')]);router[_0x1a16('0x9')](_0x1a16('0x11'),auth[_0x1a16('0xa')](),controller[_0x1a16('0x12')]);router[_0x1a16('0x13')]('/',auth[_0x1a16('0xa')](),controller[_0x1a16('0x14')]);router[_0x1a16('0x13')](_0x1a16('0xd'),auth[_0x1a16('0xa')](),controller['addAllCondition']);router[_0x1a16('0x13')](_0x1a16('0xf'),auth[_0x1a16('0xa')](),controller['addAnyCondition']);router[_0x1a16('0x13')](_0x1a16('0x11'),auth['isAuthenticated'](),controller[_0x1a16('0x15')]);router['put'](_0x1a16('0x16'),auth[_0x1a16('0xa')](),controller['update']);router['delete'](_0x1a16('0x16'),auth[_0x1a16('0xa')](),controller[_0x1a16('0x17')]);module[_0x1a16('0x18')]=router; \ No newline at end of file +var _0x676b=['./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x676b,0x6d));var _0xb676=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0x676b[_0x257495];return _0x3849aa;};'use strict';var multer=require('multer');var util=require(_0xb676('0x0'));var path=require(_0xb676('0x1'));var timeout=require(_0xb676('0x2'));var express=require('express');var router=express[_0xb676('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb676('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb676('0x5'));var controller=require(_0xb676('0x6'));router[_0xb676('0x7')]('/',auth[_0xb676('0x8')](),controller['index']);router[_0xb676('0x7')](_0xb676('0x9'),auth[_0xb676('0x8')](),controller['show']);router[_0xb676('0x7')](_0xb676('0xa'),auth['isAuthenticated'](),controller[_0xb676('0xb')]);router[_0xb676('0x7')](_0xb676('0xc'),auth[_0xb676('0x8')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0xb676('0x8')](),controller[_0xb676('0xd')]);router[_0xb676('0xe')]('/',auth[_0xb676('0x8')](),controller['create']);router['post'](_0xb676('0xa'),auth['isAuthenticated'](),controller[_0xb676('0xf')]);router[_0xb676('0xe')](_0xb676('0xc'),auth[_0xb676('0x8')](),controller[_0xb676('0x10')]);router[_0xb676('0xe')]('/:id/actions',auth[_0xb676('0x8')](),controller[_0xb676('0x11')]);router[_0xb676('0x12')](_0xb676('0x9'),auth['isAuthenticated'](),controller[_0xb676('0x13')]);router[_0xb676('0x14')](_0xb676('0x9'),auth[_0xb676('0x8')](),controller[_0xb676('0x15')]);module[_0xb676('0x16')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index af70bde..c3f9830 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 _0x9988=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1abda8,_0x4d2bd9){var _0x5d9c5a=function(_0x70b05f){while(--_0x70b05f){_0x1abda8['push'](_0x1abda8['shift']());}};_0x5d9c5a(++_0x4d2bd9);}(_0x9988,0x177));var _0x8998=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0x9988[_0x4d8789];return _0x404e41;};'use strict';var Sequelize=require(_0x8998('0x0'));module[_0x8998('0x1')]={'name':{'type':Sequelize[_0x8998('0x2')]},'channel':{'type':Sequelize[_0x8998('0x2')]},'description':{'type':Sequelize[_0x8998('0x2')]},'status':{'type':Sequelize[_0x8998('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8fce=['exports','STRING','BOOLEAN','sequelize'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8fce,0x1b7));var _0xe8fc=function(_0x2b05fa,_0x481073){_0x2b05fa=_0x2b05fa-0x0;var _0x25633c=_0x8fce[_0x2b05fa];return _0x25633c;};'use strict';var Sequelize=require(_0xe8fc('0x0'));module[_0xe8fc('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe8fc('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe8fc('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 07148fd..ed92467 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 _0x1567=['TriggerId','getActions','findOne','Action','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','user','role','userProfileId','autoAssociation','body','addAllCondition','TriggerAllId','create','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','Condition','pick'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0x1567,0x1ad));var _0x7156=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1567[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x7156('0x0'));var rimraf=require(_0x7156('0x1'));var zipdir=require(_0x7156('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7156('0x3'));var Mustache=require(_0x7156('0x4'));var util=require('util');var path=require(_0x7156('0x5'));var sox=require(_0x7156('0x6'));var csv=require(_0x7156('0x7'));var ejs=require(_0x7156('0x8'));var fs=require('fs');var fs_extra=require(_0x7156('0x9'));var _=require(_0x7156('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7156('0x7'));var querystring=require(_0x7156('0xb'));var Papa=require(_0x7156('0xc'));var Redis=require(_0x7156('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7156('0xe'));var as=require(_0x7156('0xf'));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(_0x7156('0x10'));var db=require(_0x7156('0x11'))['db'];function respondWithStatusCode(_0x385cfc,_0x3ff3a0){_0x3ff3a0=_0x3ff3a0||0xcc;return function(_0xd8a6e2){if(_0xd8a6e2){return _0x385cfc['sendStatus'](_0x3ff3a0);}return _0x385cfc[_0x7156('0x12')](_0x3ff3a0)[_0x7156('0x13')]();};}function respondWithResult(_0x22ca4a,_0x45f277){_0x45f277=_0x45f277||0xc8;return function(_0x5d6c2a){if(_0x5d6c2a){return _0x22ca4a['status'](_0x45f277)['json'](_0x5d6c2a);}};}function respondWithFilteredResult(_0x300575,_0xa14d73){return function(_0x590aca){if(_0x590aca){var _0x53098c=typeof _0xa14d73[_0x7156('0x14')]===_0x7156('0x15')&&typeof _0xa14d73['limit']==='undefined';var _0x259ac3=_0x590aca[_0x7156('0x16')];var _0x401002=_0x53098c?0x0:_0xa14d73[_0x7156('0x14')];var _0x37e6e1=_0x53098c?_0x590aca['count']:_0xa14d73[_0x7156('0x14')]+_0xa14d73['limit'];var _0x439639;if(_0x37e6e1>=_0x259ac3){_0x37e6e1=_0x259ac3;_0x439639=0xc8;}else{_0x439639=0xce;}_0x300575[_0x7156('0x12')](_0x439639);return _0x300575[_0x7156('0x17')](_0x7156('0x18'),_0x401002+'-'+_0x37e6e1+'/'+_0x259ac3)['json'](_0x590aca);}return null;};}function patchUpdates(_0x47c3df){return function(_0x18737d){try{jsonpatch[_0x7156('0x19')](_0x18737d,_0x47c3df,!![]);}catch(_0x1a1c58){return BPromise['reject'](_0x1a1c58);}return _0x18737d['save']();};}function saveUpdates(_0x5a82a0,_0xdd231){return function(_0xd7d093){if(_0xd7d093){return _0xd7d093[_0x7156('0x1a')](_0x5a82a0)[_0x7156('0x1b')](function(_0x24e244){return _0x24e244;});}return null;};}function removeEntity(_0x2d79f7,_0x54d259){return function(_0x4d85b3){if(_0x4d85b3){return _0x4d85b3[_0x7156('0x1c')]()[_0x7156('0x1b')](function(){var _0x4d4828=_0x4d85b3[_0x7156('0x1d')]({'plain':!![]});var _0x4aaa03=_0x7156('0x1e');return db[_0x7156('0x1f')]['destroy']({'where':{'type':_0x4aaa03,'resourceId':_0x4d4828['id']}})['then'](function(){return _0x4d85b3;});})[_0x7156('0x1b')](function(){_0x2d79f7[_0x7156('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c884,_0x550e1b){return function(_0x54110b){if(!_0x54110b){_0x51c884['sendStatus'](0x194);}return _0x54110b;};}function handleError(_0x403f50,_0x4f1a7e){_0x4f1a7e=_0x4f1a7e||0x1f4;return function(_0x48c5ae){logger[_0x7156('0x20')](_0x48c5ae[_0x7156('0x21')]);if(_0x48c5ae['name']){delete _0x48c5ae[_0x7156('0x22')];}_0x403f50[_0x7156('0x12')](_0x4f1a7e)[_0x7156('0x23')](_0x48c5ae);};}exports['index']=function(_0xa1f477,_0x226bdf){var _0xad887c={},_0x2f08df={},_0x4001fd={'count':0x0,'rows':[]};var _0x54ae9a=_[_0x7156('0x24')](db[_0x7156('0x25')][_0x7156('0x26')],function(_0x1d1241){return{'name':_0x1d1241[_0x7156('0x27')],'type':_0x1d1241['type'][_0x7156('0x28')]};});_0x2f08df[_0x7156('0x29')]=_[_0x7156('0x24')](_0x54ae9a,_0x7156('0x22'));_0x2f08df[_0x7156('0x2a')]=_[_0x7156('0x2b')](_0xa1f477[_0x7156('0x2a')]);_0x2f08df[_0x7156('0x2c')]=_[_0x7156('0x2d')](_0x2f08df['model'],_0x2f08df[_0x7156('0x2a')]);_0xad887c['attributes']=_[_0x7156('0x2d')](_0x2f08df[_0x7156('0x29')],qs[_0x7156('0x2e')](_0xa1f477['query'][_0x7156('0x2e')]));_0xad887c[_0x7156('0x2f')]=_0xad887c[_0x7156('0x2f')][_0x7156('0x30')]?_0xad887c[_0x7156('0x2f')]:_0x2f08df[_0x7156('0x29')];if(!_0xa1f477[_0x7156('0x2a')][_0x7156('0x31')]('nolimit')){_0xad887c[_0x7156('0x32')]=qs[_0x7156('0x32')](_0xa1f477[_0x7156('0x2a')][_0x7156('0x32')]);_0xad887c[_0x7156('0x14')]=qs[_0x7156('0x14')](_0xa1f477['query'][_0x7156('0x14')]);}_0xad887c[_0x7156('0x33')]=qs['sort'](_0xa1f477[_0x7156('0x2a')][_0x7156('0x34')]);_0xad887c[_0x7156('0x35')]=qs[_0x7156('0x2c')](_['pick'](_0xa1f477['query'],_0x2f08df['filters']),_0x54ae9a);if(_0xa1f477[_0x7156('0x2a')][_0x7156('0x36')]){_0xad887c['where']=_[_0x7156('0x37')](_0xad887c[_0x7156('0x35')],{'$or':_[_0x7156('0x24')](_0x54ae9a,function(_0x5eefff){if(_0x5eefff[_0x7156('0x38')]!==_0x7156('0x39')){var _0x2a8107={};_0x2a8107[_0x5eefff[_0x7156('0x22')]]={'$like':'%'+_0xa1f477['query'][_0x7156('0x36')]+'%'};return _0x2a8107;}})});}_0xad887c=_[_0x7156('0x37')]({},_0xad887c,_0xa1f477[_0x7156('0x3a')]);var _0x3e9802={'where':_0xad887c[_0x7156('0x35')]};return db['Trigger'][_0x7156('0x16')](_0x3e9802)[_0x7156('0x1b')](function(_0x25efd8){_0x4001fd[_0x7156('0x16')]=_0x25efd8;if(_0xa1f477[_0x7156('0x2a')]['includeAll']){_0xad887c[_0x7156('0x3b')]=[{'all':!![]}];}return db[_0x7156('0x25')][_0x7156('0x3c')](_0xad887c);})[_0x7156('0x1b')](function(_0x15aa22){_0x4001fd[_0x7156('0x3d')]=_0x15aa22;return _0x4001fd;})['then'](respondWithFilteredResult(_0x226bdf,_0xad887c))['catch'](handleError(_0x226bdf,null));};exports['show']=function(_0x5cb2a0,_0x28abf2){var _0x498dde={'raw':![],'where':{'id':_0x5cb2a0[_0x7156('0x3e')]['id']}},_0x29fc4e={};_0x29fc4e['model']=_[_0x7156('0x2b')](db[_0x7156('0x25')][_0x7156('0x26')]);_0x29fc4e[_0x7156('0x2a')]=_[_0x7156('0x2b')](_0x5cb2a0[_0x7156('0x2a')]);_0x29fc4e[_0x7156('0x2c')]=_[_0x7156('0x2d')](_0x29fc4e[_0x7156('0x29')],_0x29fc4e[_0x7156('0x2a')]);_0x498dde[_0x7156('0x2f')]=_[_0x7156('0x2d')](_0x29fc4e[_0x7156('0x29')],qs['fields'](_0x5cb2a0['query'][_0x7156('0x2e')]));_0x498dde[_0x7156('0x2f')]=_0x498dde[_0x7156('0x2f')][_0x7156('0x30')]?_0x498dde['attributes']:_0x29fc4e[_0x7156('0x29')];if(_0x5cb2a0[_0x7156('0x2a')][_0x7156('0x3f')]){_0x498dde['include']=[{'all':!![]}];}_0x498dde=_[_0x7156('0x37')]({},_0x498dde,_0x5cb2a0[_0x7156('0x3a')]);return db[_0x7156('0x25')][_0x7156('0x40')](_0x498dde)[_0x7156('0x1b')](handleEntityNotFound(_0x28abf2,null))[_0x7156('0x1b')](respondWithResult(_0x28abf2,null))[_0x7156('0x41')](handleError(_0x28abf2,null));};exports['create']=function(_0x23459a,_0x28bdcb){return db['Trigger']['create'](_0x23459a['body'],{})['then'](function(_0x44fb15){var _0x1d5481=_0x23459a[_0x7156('0x42')]['get']({'plain':!![]});if(!_0x1d5481)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d5481[_0x7156('0x43')]===_0x7156('0x42')){var _0x528a5c=_0x44fb15['get']({'plain':!![]});var _0x3def9f='Triggers';return db['UserProfileSection'][_0x7156('0x40')]({'where':{'name':_0x3def9f,'userProfileId':_0x1d5481[_0x7156('0x44')]},'raw':!![]})[_0x7156('0x1b')](function(_0x588af8){if(_0x588af8&&_0x588af8[_0x7156('0x45')]===0x0){return db[_0x7156('0x1f')]['create']({'name':_0x528a5c[_0x7156('0x22')],'resourceId':_0x528a5c['id'],'type':_0x588af8[_0x7156('0x22')],'sectionId':_0x588af8['id']},{})[_0x7156('0x1b')](function(){return _0x44fb15;});}else{return _0x44fb15;}})[_0x7156('0x41')](function(_0x5c3c3b){logger[_0x7156('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3c3b);throw _0x5c3c3b;});}return _0x44fb15;})[_0x7156('0x1b')](respondWithResult(_0x28bdcb,0xc9))[_0x7156('0x41')](handleError(_0x28bdcb,null));};exports[_0x7156('0x1a')]=function(_0x5029b6,_0xf0a744){if(_0x5029b6[_0x7156('0x46')]['id']){delete _0x5029b6[_0x7156('0x46')]['id'];}return db[_0x7156('0x25')][_0x7156('0x40')]({'where':{'id':_0x5029b6[_0x7156('0x3e')]['id']}})[_0x7156('0x1b')](handleEntityNotFound(_0xf0a744,null))['then'](saveUpdates(_0x5029b6['body'],null))[_0x7156('0x1b')](respondWithResult(_0xf0a744,null))[_0x7156('0x41')](handleError(_0xf0a744,null));};exports[_0x7156('0x1c')]=function(_0x460ced,_0x3cce2f){return db['Trigger'][_0x7156('0x40')]({'where':{'id':_0x460ced[_0x7156('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3cce2f,null))['then'](removeEntity(_0x3cce2f,null))[_0x7156('0x41')](handleError(_0x3cce2f,null));};exports[_0x7156('0x47')]=function(_0x3e4198,_0x35d934,_0x22b233){if(_0x3e4198['body']['id']){delete _0x3e4198[_0x7156('0x46')]['id'];}return db[_0x7156('0x25')][_0x7156('0x40')]({'where':{'id':_0x3e4198[_0x7156('0x3e')]['id']}})[_0x7156('0x1b')](handleEntityNotFound(_0x35d934,null))[_0x7156('0x1b')](function(_0x40c220){if(_0x40c220){_0x3e4198[_0x7156('0x46')][_0x7156('0x48')]=_0x40c220['id'];return db['Condition'][_0x7156('0x49')](_0x3e4198['body']);}})[_0x7156('0x1b')](respondWithResult(_0x35d934,null))[_0x7156('0x41')](handleError(_0x35d934,null));};exports[_0x7156('0x4a')]=function(_0x5cc1bd,_0x4cac9d,_0x8eceaa){if(_0x5cc1bd[_0x7156('0x46')]['id']){delete _0x5cc1bd[_0x7156('0x46')]['id'];}return db[_0x7156('0x25')][_0x7156('0x40')]({'where':{'id':_0x5cc1bd[_0x7156('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4cac9d,null))[_0x7156('0x1b')](function(_0x3c23bf){if(_0x3c23bf){_0x5cc1bd['body'][_0x7156('0x4b')]=_0x3c23bf['id'];return db['Condition'][_0x7156('0x49')](_0x5cc1bd[_0x7156('0x46')]);}})[_0x7156('0x1b')](respondWithResult(_0x4cac9d,null))['catch'](handleError(_0x4cac9d,null));};exports['getAllConditions']=function(_0x4962cb,_0x4724f4,_0x3d0f43){var _0x2ecdcf={};var _0x514934={};var _0x21461d;var _0x5a3b46;return db['Trigger']['findOne']({'where':{'id':_0x4962cb['params']['id']}})['then'](handleEntityNotFound(_0x4724f4,null))['then'](function(_0x15daf5){if(_0x15daf5){_0x21461d=_0x15daf5;_0x514934['model']=_[_0x7156('0x2b')](db['Condition'][_0x7156('0x26')]);_0x514934['query']=_['keys'](_0x4962cb['query']);_0x514934[_0x7156('0x2c')]=_[_0x7156('0x2d')](_0x514934[_0x7156('0x29')],_0x514934[_0x7156('0x2a')]);_0x2ecdcf[_0x7156('0x2f')]=_[_0x7156('0x2d')](_0x514934[_0x7156('0x29')],qs[_0x7156('0x2e')](_0x4962cb[_0x7156('0x2a')]['fields']));_0x2ecdcf[_0x7156('0x2f')]=_0x2ecdcf[_0x7156('0x2f')][_0x7156('0x30')]?_0x2ecdcf['attributes']:_0x514934[_0x7156('0x29')];_0x2ecdcf[_0x7156('0x33')]=qs[_0x7156('0x34')](_0x4962cb['query'][_0x7156('0x34')]);_0x2ecdcf['where']=qs[_0x7156('0x2c')](_['pick'](_0x4962cb[_0x7156('0x2a')],_0x514934[_0x7156('0x2c')]));if(_0x4962cb[_0x7156('0x2a')][_0x7156('0x36')]){_0x2ecdcf[_0x7156('0x35')]=_[_0x7156('0x37')](_0x2ecdcf[_0x7156('0x35')],{'$or':_[_0x7156('0x24')](_0x2ecdcf['attributes'],function(_0x1cb36f){var _0x26e4f9={};_0x26e4f9[_0x1cb36f]={'$like':'%'+_0x4962cb['query'][_0x7156('0x36')]+'%'};return _0x26e4f9;})});}_0x2ecdcf=_[_0x7156('0x37')]({},_0x2ecdcf,_0x4962cb[_0x7156('0x3a')]);return _0x21461d[_0x7156('0x4c')](_0x2ecdcf);}})[_0x7156('0x1b')](function(_0x229ae9){if(_0x229ae9){_0x5a3b46=_0x229ae9[_0x7156('0x30')];if(!_0x4962cb[_0x7156('0x2a')][_0x7156('0x31')](_0x7156('0x4d'))){_0x2ecdcf[_0x7156('0x32')]=qs[_0x7156('0x32')](_0x4962cb[_0x7156('0x2a')]['limit']);_0x2ecdcf[_0x7156('0x14')]=qs[_0x7156('0x14')](_0x4962cb[_0x7156('0x2a')][_0x7156('0x14')]);}return _0x21461d[_0x7156('0x4c')](_0x2ecdcf);}})['then'](function(_0x31b92c){if(_0x31b92c){return _0x31b92c?{'count':_0x5a3b46,'rows':_0x31b92c}:null;}})[_0x7156('0x1b')](respondWithResult(_0x4724f4,null))[_0x7156('0x41')](handleError(_0x4724f4,null));};exports[_0x7156('0x4e')]=function(_0x42c9ca,_0x2809f6,_0x2db85f){var _0x3a4b1a={};var _0x23e341={};var _0x3e7cdb;var _0x400d3f;return db['Trigger']['findOne']({'where':{'id':_0x42c9ca[_0x7156('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2809f6,null))[_0x7156('0x1b')](function(_0x2e6920){if(_0x2e6920){_0x3e7cdb=_0x2e6920;_0x23e341[_0x7156('0x29')]=_[_0x7156('0x2b')](db[_0x7156('0x4f')][_0x7156('0x26')]);_0x23e341['query']=_[_0x7156('0x2b')](_0x42c9ca[_0x7156('0x2a')]);_0x23e341[_0x7156('0x2c')]=_[_0x7156('0x2d')](_0x23e341[_0x7156('0x29')],_0x23e341['query']);_0x3a4b1a[_0x7156('0x2f')]=_['intersection'](_0x23e341[_0x7156('0x29')],qs[_0x7156('0x2e')](_0x42c9ca[_0x7156('0x2a')][_0x7156('0x2e')]));_0x3a4b1a[_0x7156('0x2f')]=_0x3a4b1a[_0x7156('0x2f')][_0x7156('0x30')]?_0x3a4b1a[_0x7156('0x2f')]:_0x23e341[_0x7156('0x29')];_0x3a4b1a[_0x7156('0x33')]=qs[_0x7156('0x34')](_0x42c9ca[_0x7156('0x2a')][_0x7156('0x34')]);_0x3a4b1a['where']=qs[_0x7156('0x2c')](_[_0x7156('0x50')](_0x42c9ca['query'],_0x23e341[_0x7156('0x2c')]));if(_0x42c9ca[_0x7156('0x2a')][_0x7156('0x36')]){_0x3a4b1a[_0x7156('0x35')]=_[_0x7156('0x37')](_0x3a4b1a['where'],{'$or':_['map'](_0x3a4b1a[_0x7156('0x2f')],function(_0x19550d){var _0x1bb031={};_0x1bb031[_0x19550d]={'$like':'%'+_0x42c9ca[_0x7156('0x2a')][_0x7156('0x36')]+'%'};return _0x1bb031;})});}_0x3a4b1a=_['merge']({},_0x3a4b1a,_0x42c9ca[_0x7156('0x3a')]);return _0x3e7cdb[_0x7156('0x4e')](_0x3a4b1a);}})[_0x7156('0x1b')](function(_0x3725da){if(_0x3725da){_0x400d3f=_0x3725da[_0x7156('0x30')];if(!_0x42c9ca[_0x7156('0x2a')][_0x7156('0x31')]('nolimit')){_0x3a4b1a[_0x7156('0x32')]=qs['limit'](_0x42c9ca[_0x7156('0x2a')][_0x7156('0x32')]);_0x3a4b1a[_0x7156('0x14')]=qs[_0x7156('0x14')](_0x42c9ca['query'][_0x7156('0x14')]);}return _0x3e7cdb[_0x7156('0x4e')](_0x3a4b1a);}})[_0x7156('0x1b')](function(_0x3f29a0){if(_0x3f29a0){return _0x3f29a0?{'count':_0x400d3f,'rows':_0x3f29a0}:null;}})[_0x7156('0x1b')](respondWithResult(_0x2809f6,null))[_0x7156('0x41')](handleError(_0x2809f6,null));};exports['addAction']=function(_0xe37c58,_0xd9dbec,_0x5107db){if(_0xe37c58[_0x7156('0x46')]['id']){delete _0xe37c58['body']['id'];}return db['Trigger'][_0x7156('0x40')]({'where':{'id':_0xe37c58[_0x7156('0x3e')]['id']}})[_0x7156('0x1b')](handleEntityNotFound(_0xd9dbec,null))[_0x7156('0x1b')](function(_0x148557){if(_0x148557){_0xe37c58[_0x7156('0x46')][_0x7156('0x51')]=_0x148557['id'];return db['Action'][_0x7156('0x49')](_0xe37c58['body']);}})[_0x7156('0x1b')](respondWithResult(_0xd9dbec,null))[_0x7156('0x41')](handleError(_0xd9dbec,null));};exports[_0x7156('0x52')]=function(_0xe7a5f0,_0x18a2f0,_0x4ee208){var _0xc4d7c2={};var _0x42c7b8={};var _0x16a4b2;var _0x34d32;return db['Trigger'][_0x7156('0x53')]({'where':{'id':_0xe7a5f0[_0x7156('0x3e')]['id']}})['then'](handleEntityNotFound(_0x18a2f0,null))['then'](function(_0x52868b){if(_0x52868b){_0x16a4b2=_0x52868b;_0x42c7b8[_0x7156('0x29')]=_[_0x7156('0x2b')](db[_0x7156('0x54')][_0x7156('0x26')]);_0x42c7b8['query']=_[_0x7156('0x2b')](_0xe7a5f0[_0x7156('0x2a')]);_0x42c7b8[_0x7156('0x2c')]=_[_0x7156('0x2d')](_0x42c7b8[_0x7156('0x29')],_0x42c7b8[_0x7156('0x2a')]);_0xc4d7c2[_0x7156('0x2f')]=_[_0x7156('0x2d')](_0x42c7b8[_0x7156('0x29')],qs[_0x7156('0x2e')](_0xe7a5f0['query'][_0x7156('0x2e')]));_0xc4d7c2[_0x7156('0x2f')]=_0xc4d7c2[_0x7156('0x2f')]['length']?_0xc4d7c2['attributes']:_0x42c7b8['model'];_0xc4d7c2[_0x7156('0x33')]=qs['sort'](_0xe7a5f0[_0x7156('0x2a')][_0x7156('0x34')]);_0xc4d7c2['where']=qs[_0x7156('0x2c')](_[_0x7156('0x50')](_0xe7a5f0['query'],_0x42c7b8[_0x7156('0x2c')]));if(_0xe7a5f0[_0x7156('0x2a')][_0x7156('0x36')]){_0xc4d7c2[_0x7156('0x35')]=_['merge'](_0xc4d7c2[_0x7156('0x35')],{'$or':_[_0x7156('0x24')](_0xc4d7c2['attributes'],function(_0xaeafa8){var _0x5e3291={};_0x5e3291[_0xaeafa8]={'$like':'%'+_0xe7a5f0[_0x7156('0x2a')][_0x7156('0x36')]+'%'};return _0x5e3291;})});}_0xc4d7c2=_[_0x7156('0x37')]({},_0xc4d7c2,_0xe7a5f0[_0x7156('0x3a')]);return _0x16a4b2[_0x7156('0x52')](_0xc4d7c2);}})[_0x7156('0x1b')](function(_0x40e306){if(_0x40e306){_0x34d32=_0x40e306[_0x7156('0x30')];if(!_0xe7a5f0[_0x7156('0x2a')][_0x7156('0x31')](_0x7156('0x4d'))){_0xc4d7c2['limit']=qs['limit'](_0xe7a5f0['query'][_0x7156('0x32')]);_0xc4d7c2[_0x7156('0x14')]=qs[_0x7156('0x14')](_0xe7a5f0[_0x7156('0x2a')]['offset']);}return _0x16a4b2['getActions'](_0xc4d7c2);}})['then'](function(_0x550389){if(_0x550389){return _0x550389?{'count':_0x34d32,'rows':_0x550389}:null;}})[_0x7156('0x1b')](respondWithResult(_0x18a2f0,null))['catch'](handleError(_0x18a2f0,null));}; \ No newline at end of file +var _0x123a=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','TriggerId','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','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','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','status','error','stack','name','send','index','map','Trigger','fieldName','key','query'];(function(_0x3946d1,_0x19771f){var _0x410bcf=function(_0x49c13d){while(--_0x49c13d){_0x3946d1['push'](_0x3946d1['shift']());}};_0x410bcf(++_0x19771f);}(_0x123a,0x1c2));var _0xa123=function(_0xe5f6d8,_0x14d787){_0xe5f6d8=_0xe5f6d8-0x0;var _0x239ce6=_0x123a[_0xe5f6d8];return _0x239ce6;};'use strict';var emlformat=require(_0xa123('0x0'));var rimraf=require(_0xa123('0x1'));var zipdir=require(_0xa123('0x2'));var jsonpatch=require(_0xa123('0x3'));var rp=require(_0xa123('0x4'));var moment=require(_0xa123('0x5'));var BPromise=require(_0xa123('0x6'));var Mustache=require(_0xa123('0x7'));var util=require(_0xa123('0x8'));var path=require(_0xa123('0x9'));var sox=require(_0xa123('0xa'));var csv=require('to-csv');var ejs=require(_0xa123('0xb'));var fs=require('fs');var fs_extra=require(_0xa123('0xc'));var _=require(_0xa123('0xd'));var squel=require('squel');var crypto=require(_0xa123('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa123('0xf'));var toCsv=require(_0xa123('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa123('0x11'));var authService=require(_0xa123('0x12'));var qs=require(_0xa123('0x13'));var as=require(_0xa123('0x14'));var hardwareService=require(_0xa123('0x15'));var logger=require(_0xa123('0x16'))(_0xa123('0x17'));var utils=require(_0xa123('0x18'));var config=require(_0xa123('0x19'));var licenseUtil=require(_0xa123('0x1a'));var db=require(_0xa123('0x1b'))['db'];function respondWithStatusCode(_0x5c4d88,_0x3a1106){_0x3a1106=_0x3a1106||0xcc;return function(_0x4f931e){if(_0x4f931e){return _0x5c4d88[_0xa123('0x1c')](_0x3a1106);}return _0x5c4d88['status'](_0x3a1106)[_0xa123('0x1d')]();};}function respondWithResult(_0x17f616,_0x131dff){_0x131dff=_0x131dff||0xc8;return function(_0x241d93){if(_0x241d93){return _0x17f616['status'](_0x131dff)[_0xa123('0x1e')](_0x241d93);}};}function respondWithFilteredResult(_0xbc81a4,_0x4bd484){return function(_0x1152c9){if(_0x1152c9){var _0x4fd6d5=typeof _0x4bd484[_0xa123('0x1f')]===_0xa123('0x20')&&typeof _0x4bd484['limit']===_0xa123('0x20');var _0x340950=_0x1152c9[_0xa123('0x21')];var _0x1210f5=_0x4fd6d5?0x0:_0x4bd484[_0xa123('0x1f')];var _0x14a08c=_0x4fd6d5?_0x1152c9[_0xa123('0x21')]:_0x4bd484[_0xa123('0x1f')]+_0x4bd484['limit'];var _0x8de153;if(_0x14a08c>=_0x340950){_0x14a08c=_0x340950;_0x8de153=0xc8;}else{_0x8de153=0xce;}_0xbc81a4['status'](_0x8de153);return _0xbc81a4['set'](_0xa123('0x22'),_0x1210f5+'-'+_0x14a08c+'/'+_0x340950)[_0xa123('0x1e')](_0x1152c9);}return null;};}function patchUpdates(_0x525cc8){return function(_0x2a6588){try{jsonpatch[_0xa123('0x23')](_0x2a6588,_0x525cc8,!![]);}catch(_0x40e930){return BPromise[_0xa123('0x24')](_0x40e930);}return _0x2a6588[_0xa123('0x25')]();};}function saveUpdates(_0x2e29f0,_0x6de225){return function(_0x38f026){if(_0x38f026){return _0x38f026[_0xa123('0x26')](_0x2e29f0)[_0xa123('0x27')](function(_0x357ff2){return _0x357ff2;});}return null;};}function removeEntity(_0x46e0f3,_0xdc104a){return function(_0x12f394){if(_0x12f394){return _0x12f394[_0xa123('0x28')]()[_0xa123('0x27')](function(){var _0x5d0707=_0x12f394[_0xa123('0x29')]({'plain':!![]});var _0x1c93c3=_0xa123('0x2a');return db[_0xa123('0x2b')][_0xa123('0x28')]({'where':{'type':_0x1c93c3,'resourceId':_0x5d0707['id']}})['then'](function(){return _0x12f394;});})[_0xa123('0x27')](function(){_0x46e0f3[_0xa123('0x2c')](0xcc)[_0xa123('0x1d')]();});}};}function handleEntityNotFound(_0x107c73,_0x34a69f){return function(_0x343394){if(!_0x343394){_0x107c73[_0xa123('0x1c')](0x194);}return _0x343394;};}function handleError(_0x4a8256,_0x575d46){_0x575d46=_0x575d46||0x1f4;return function(_0x514d49){logger[_0xa123('0x2d')](_0x514d49[_0xa123('0x2e')]);if(_0x514d49[_0xa123('0x2f')]){delete _0x514d49[_0xa123('0x2f')];}_0x4a8256[_0xa123('0x2c')](_0x575d46)[_0xa123('0x30')](_0x514d49);};}exports[_0xa123('0x31')]=function(_0x57a4e9,_0x1ad027){var _0x4f6d16={},_0x2e0d14={},_0x43e3e2={'count':0x0,'rows':[]};var _0x512b6f=_[_0xa123('0x32')](db[_0xa123('0x33')]['rawAttributes'],function(_0x342cf3){return{'name':_0x342cf3[_0xa123('0x34')],'type':_0x342cf3['type'][_0xa123('0x35')]};});_0x2e0d14['model']=_[_0xa123('0x32')](_0x512b6f,'name');_0x2e0d14[_0xa123('0x36')]=_[_0xa123('0x37')](_0x57a4e9['query']);_0x2e0d14[_0xa123('0x38')]=_[_0xa123('0x39')](_0x2e0d14[_0xa123('0x3a')],_0x2e0d14[_0xa123('0x36')]);_0x4f6d16[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x2e0d14[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x57a4e9[_0xa123('0x36')]['fields']));_0x4f6d16[_0xa123('0x3b')]=_0x4f6d16[_0xa123('0x3b')][_0xa123('0x3d')]?_0x4f6d16[_0xa123('0x3b')]:_0x2e0d14[_0xa123('0x3a')];if(!_0x57a4e9['query'][_0xa123('0x3e')](_0xa123('0x3f'))){_0x4f6d16[_0xa123('0x40')]=qs[_0xa123('0x40')](_0x57a4e9[_0xa123('0x36')][_0xa123('0x40')]);_0x4f6d16[_0xa123('0x1f')]=qs['offset'](_0x57a4e9[_0xa123('0x36')]['offset']);}_0x4f6d16[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x57a4e9[_0xa123('0x36')]['sort']);_0x4f6d16['where']=qs['filters'](_[_0xa123('0x43')](_0x57a4e9[_0xa123('0x36')],_0x2e0d14[_0xa123('0x38')]),_0x512b6f);if(_0x57a4e9[_0xa123('0x36')][_0xa123('0x44')]){_0x4f6d16[_0xa123('0x45')]=_[_0xa123('0x46')](_0x4f6d16[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x512b6f,function(_0x39a6e1){if(_0x39a6e1[_0xa123('0x47')]!=='VIRTUAL'){var _0x129921={};_0x129921[_0x39a6e1['name']]={'$like':'%'+_0x57a4e9['query'][_0xa123('0x44')]+'%'};return _0x129921;}})});}_0x4f6d16=_[_0xa123('0x46')]({},_0x4f6d16,_0x57a4e9[_0xa123('0x48')]);var _0x985a7b={'where':_0x4f6d16[_0xa123('0x45')]};return db[_0xa123('0x33')]['count'](_0x985a7b)[_0xa123('0x27')](function(_0x751b51){_0x43e3e2[_0xa123('0x21')]=_0x751b51;if(_0x57a4e9['query']['includeAll']){_0x4f6d16['include']=[{'all':!![]}];}return db[_0xa123('0x33')][_0xa123('0x49')](_0x4f6d16);})[_0xa123('0x27')](function(_0x49a270){_0x43e3e2[_0xa123('0x4a')]=_0x49a270;return _0x43e3e2;})[_0xa123('0x27')](respondWithFilteredResult(_0x1ad027,_0x4f6d16))[_0xa123('0x4b')](handleError(_0x1ad027,null));};exports[_0xa123('0x4c')]=function(_0x469add,_0x51917c){var _0xb341b0={'raw':![],'where':{'id':_0x469add[_0xa123('0x4d')]['id']}},_0x5591e0={};_0x5591e0[_0xa123('0x3a')]=_['keys'](db[_0xa123('0x33')][_0xa123('0x4e')]);_0x5591e0[_0xa123('0x36')]=_[_0xa123('0x37')](_0x469add[_0xa123('0x36')]);_0x5591e0[_0xa123('0x38')]=_[_0xa123('0x39')](_0x5591e0['model'],_0x5591e0[_0xa123('0x36')]);_0xb341b0[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x5591e0[_0xa123('0x3a')],qs['fields'](_0x469add[_0xa123('0x36')][_0xa123('0x3c')]));_0xb341b0[_0xa123('0x3b')]=_0xb341b0[_0xa123('0x3b')][_0xa123('0x3d')]?_0xb341b0[_0xa123('0x3b')]:_0x5591e0['model'];if(_0x469add[_0xa123('0x36')][_0xa123('0x4f')]){_0xb341b0[_0xa123('0x50')]=[{'all':!![]}];}_0xb341b0=_[_0xa123('0x46')]({},_0xb341b0,_0x469add[_0xa123('0x48')]);return db[_0xa123('0x33')][_0xa123('0x51')](_0xb341b0)['then'](handleEntityNotFound(_0x51917c,null))['then'](respondWithResult(_0x51917c,null))['catch'](handleError(_0x51917c,null));};exports[_0xa123('0x52')]=function(_0x30041a,_0x4497bc){return db[_0xa123('0x33')][_0xa123('0x52')](_0x30041a[_0xa123('0x53')],{})['then'](function(_0x1a6bce){var _0x31ceb8=_0x30041a[_0xa123('0x54')]['get']({'plain':!![]});if(!_0x31ceb8)throw new Error(_0xa123('0x55'));if(_0x31ceb8['role']==='user'){var _0x41b8fd=_0x1a6bce[_0xa123('0x29')]({'plain':!![]});var _0x5a0727=_0xa123('0x2a');return db[_0xa123('0x56')][_0xa123('0x51')]({'where':{'name':_0x5a0727,'userProfileId':_0x31ceb8[_0xa123('0x57')]},'raw':!![]})[_0xa123('0x27')](function(_0x20d044){if(_0x20d044&&_0x20d044[_0xa123('0x58')]===0x0){return db[_0xa123('0x2b')][_0xa123('0x52')]({'name':_0x41b8fd[_0xa123('0x2f')],'resourceId':_0x41b8fd['id'],'type':_0x20d044[_0xa123('0x2f')],'sectionId':_0x20d044['id']},{})[_0xa123('0x27')](function(){return _0x1a6bce;});}else{return _0x1a6bce;}})['catch'](function(_0x25f8b0){logger[_0xa123('0x2d')](_0xa123('0x59'),_0x25f8b0);throw _0x25f8b0;});}return _0x1a6bce;})['then'](respondWithResult(_0x4497bc,0xc9))[_0xa123('0x4b')](handleError(_0x4497bc,null));};exports[_0xa123('0x26')]=function(_0x1a575c,_0x464bb2){if(_0x1a575c[_0xa123('0x53')]['id']){delete _0x1a575c[_0xa123('0x53')]['id'];}return db[_0xa123('0x33')][_0xa123('0x51')]({'where':{'id':_0x1a575c['params']['id']}})['then'](handleEntityNotFound(_0x464bb2,null))[_0xa123('0x27')](saveUpdates(_0x1a575c[_0xa123('0x53')],null))[_0xa123('0x27')](respondWithResult(_0x464bb2,null))['catch'](handleError(_0x464bb2,null));};exports[_0xa123('0x28')]=function(_0x2dcdc2,_0x1c51d4){return db[_0xa123('0x33')]['find']({'where':{'id':_0x2dcdc2[_0xa123('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c51d4,null))[_0xa123('0x27')](removeEntity(_0x1c51d4,null))[_0xa123('0x4b')](handleError(_0x1c51d4,null));};exports[_0xa123('0x5a')]=function(_0x38f05c,_0x2e71a9,_0x5b040d){if(_0x38f05c[_0xa123('0x53')]['id']){delete _0x38f05c['body']['id'];}return db[_0xa123('0x33')][_0xa123('0x51')]({'where':{'id':_0x38f05c['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x2e71a9,null))[_0xa123('0x27')](function(_0xca00f8){if(_0xca00f8){_0x38f05c[_0xa123('0x53')][_0xa123('0x5b')]=_0xca00f8['id'];return db['Condition'][_0xa123('0x52')](_0x38f05c[_0xa123('0x53')]);}})[_0xa123('0x27')](respondWithResult(_0x2e71a9,null))[_0xa123('0x4b')](handleError(_0x2e71a9,null));};exports[_0xa123('0x5c')]=function(_0x407ba2,_0x615e05,_0x307e85){if(_0x407ba2[_0xa123('0x53')]['id']){delete _0x407ba2[_0xa123('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0x407ba2['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x615e05,null))[_0xa123('0x27')](function(_0x5bf9a1){if(_0x5bf9a1){_0x407ba2[_0xa123('0x53')][_0xa123('0x5d')]=_0x5bf9a1['id'];return db[_0xa123('0x5e')]['create'](_0x407ba2['body']);}})['then'](respondWithResult(_0x615e05,null))[_0xa123('0x4b')](handleError(_0x615e05,null));};exports[_0xa123('0x5f')]=function(_0x34a01b,_0x98d058,_0x47a7eb){var _0x5b4a12={};var _0x1a7907={};var _0x106e01;var _0x2fb0cb;return db[_0xa123('0x33')]['findOne']({'where':{'id':_0x34a01b['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x98d058,null))[_0xa123('0x27')](function(_0x24a790){if(_0x24a790){_0x106e01=_0x24a790;_0x1a7907['model']=_[_0xa123('0x37')](db[_0xa123('0x5e')][_0xa123('0x4e')]);_0x1a7907[_0xa123('0x36')]=_['keys'](_0x34a01b[_0xa123('0x36')]);_0x1a7907['filters']=_['intersection'](_0x1a7907[_0xa123('0x3a')],_0x1a7907[_0xa123('0x36')]);_0x5b4a12['attributes']=_['intersection'](_0x1a7907['model'],qs['fields'](_0x34a01b['query'][_0xa123('0x3c')]));_0x5b4a12['attributes']=_0x5b4a12[_0xa123('0x3b')][_0xa123('0x3d')]?_0x5b4a12['attributes']:_0x1a7907[_0xa123('0x3a')];_0x5b4a12[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x34a01b[_0xa123('0x36')][_0xa123('0x42')]);_0x5b4a12[_0xa123('0x45')]=qs[_0xa123('0x38')](_[_0xa123('0x43')](_0x34a01b[_0xa123('0x36')],_0x1a7907['filters']));if(_0x34a01b[_0xa123('0x36')][_0xa123('0x44')]){_0x5b4a12[_0xa123('0x45')]=_[_0xa123('0x46')](_0x5b4a12[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x5b4a12[_0xa123('0x3b')],function(_0x45340e){var _0xafd11d={};_0xafd11d[_0x45340e]={'$like':'%'+_0x34a01b[_0xa123('0x36')][_0xa123('0x44')]+'%'};return _0xafd11d;})});}_0x5b4a12=_[_0xa123('0x46')]({},_0x5b4a12,_0x34a01b[_0xa123('0x48')]);return _0x106e01[_0xa123('0x5f')](_0x5b4a12);}})[_0xa123('0x27')](function(_0x229fcb){if(_0x229fcb){_0x2fb0cb=_0x229fcb[_0xa123('0x3d')];if(!_0x34a01b[_0xa123('0x36')][_0xa123('0x3e')](_0xa123('0x3f'))){_0x5b4a12['limit']=qs[_0xa123('0x40')](_0x34a01b[_0xa123('0x36')]['limit']);_0x5b4a12['offset']=qs[_0xa123('0x1f')](_0x34a01b[_0xa123('0x36')][_0xa123('0x1f')]);}return _0x106e01['getAllConditions'](_0x5b4a12);}})[_0xa123('0x27')](function(_0x40a2e2){if(_0x40a2e2){return _0x40a2e2?{'count':_0x2fb0cb,'rows':_0x40a2e2}:null;}})[_0xa123('0x27')](respondWithResult(_0x98d058,null))[_0xa123('0x4b')](handleError(_0x98d058,null));};exports[_0xa123('0x60')]=function(_0x48ca37,_0x31a64c,_0x3beb6a){var _0x179231={};var _0x3dcf9f={};var _0x15ae5f;var _0x54a84f;return db[_0xa123('0x33')]['findOne']({'where':{'id':_0x48ca37['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x31a64c,null))[_0xa123('0x27')](function(_0x2fc53c){if(_0x2fc53c){_0x15ae5f=_0x2fc53c;_0x3dcf9f['model']=_[_0xa123('0x37')](db[_0xa123('0x5e')][_0xa123('0x4e')]);_0x3dcf9f[_0xa123('0x36')]=_[_0xa123('0x37')](_0x48ca37[_0xa123('0x36')]);_0x3dcf9f[_0xa123('0x38')]=_['intersection'](_0x3dcf9f[_0xa123('0x3a')],_0x3dcf9f[_0xa123('0x36')]);_0x179231[_0xa123('0x3b')]=_['intersection'](_0x3dcf9f[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x48ca37['query'][_0xa123('0x3c')]));_0x179231['attributes']=_0x179231['attributes'][_0xa123('0x3d')]?_0x179231[_0xa123('0x3b')]:_0x3dcf9f[_0xa123('0x3a')];_0x179231[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x48ca37[_0xa123('0x36')]['sort']);_0x179231['where']=qs[_0xa123('0x38')](_['pick'](_0x48ca37[_0xa123('0x36')],_0x3dcf9f[_0xa123('0x38')]));if(_0x48ca37[_0xa123('0x36')][_0xa123('0x44')]){_0x179231[_0xa123('0x45')]=_[_0xa123('0x46')](_0x179231[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x179231[_0xa123('0x3b')],function(_0x1c21e5){var _0x1dc0df={};_0x1dc0df[_0x1c21e5]={'$like':'%'+_0x48ca37['query'][_0xa123('0x44')]+'%'};return _0x1dc0df;})});}_0x179231=_[_0xa123('0x46')]({},_0x179231,_0x48ca37[_0xa123('0x48')]);return _0x15ae5f[_0xa123('0x60')](_0x179231);}})[_0xa123('0x27')](function(_0x474057){if(_0x474057){_0x54a84f=_0x474057[_0xa123('0x3d')];if(!_0x48ca37[_0xa123('0x36')][_0xa123('0x3e')](_0xa123('0x3f'))){_0x179231['limit']=qs['limit'](_0x48ca37[_0xa123('0x36')]['limit']);_0x179231['offset']=qs['offset'](_0x48ca37[_0xa123('0x36')][_0xa123('0x1f')]);}return _0x15ae5f['getAnyConditions'](_0x179231);}})[_0xa123('0x27')](function(_0x37168d){if(_0x37168d){return _0x37168d?{'count':_0x54a84f,'rows':_0x37168d}:null;}})[_0xa123('0x27')](respondWithResult(_0x31a64c,null))[_0xa123('0x4b')](handleError(_0x31a64c,null));};exports['addAction']=function(_0x5652b4,_0x401373,_0x2c49c9){if(_0x5652b4[_0xa123('0x53')]['id']){delete _0x5652b4['body']['id'];}return db['Trigger'][_0xa123('0x51')]({'where':{'id':_0x5652b4[_0xa123('0x4d')]['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x401373,null))[_0xa123('0x27')](function(_0x3a8d26){if(_0x3a8d26){_0x5652b4[_0xa123('0x53')][_0xa123('0x61')]=_0x3a8d26['id'];return db[_0xa123('0x62')][_0xa123('0x52')](_0x5652b4[_0xa123('0x53')]);}})[_0xa123('0x27')](respondWithResult(_0x401373,null))[_0xa123('0x4b')](handleError(_0x401373,null));};exports[_0xa123('0x63')]=function(_0x9076a2,_0x1d5659,_0x2b1643){var _0x26dab1={};var _0x103c1b={};var _0x58006;var _0x10e630;return db[_0xa123('0x33')][_0xa123('0x64')]({'where':{'id':_0x9076a2[_0xa123('0x4d')]['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x1d5659,null))[_0xa123('0x27')](function(_0x47b2b9){if(_0x47b2b9){_0x58006=_0x47b2b9;_0x103c1b['model']=_['keys'](db[_0xa123('0x62')][_0xa123('0x4e')]);_0x103c1b[_0xa123('0x36')]=_['keys'](_0x9076a2[_0xa123('0x36')]);_0x103c1b[_0xa123('0x38')]=_['intersection'](_0x103c1b[_0xa123('0x3a')],_0x103c1b[_0xa123('0x36')]);_0x26dab1[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x103c1b[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x9076a2[_0xa123('0x36')][_0xa123('0x3c')]));_0x26dab1['attributes']=_0x26dab1[_0xa123('0x3b')][_0xa123('0x3d')]?_0x26dab1[_0xa123('0x3b')]:_0x103c1b[_0xa123('0x3a')];_0x26dab1[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x9076a2[_0xa123('0x36')][_0xa123('0x42')]);_0x26dab1[_0xa123('0x45')]=qs[_0xa123('0x38')](_[_0xa123('0x43')](_0x9076a2['query'],_0x103c1b[_0xa123('0x38')]));if(_0x9076a2[_0xa123('0x36')][_0xa123('0x44')]){_0x26dab1['where']=_['merge'](_0x26dab1[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x26dab1[_0xa123('0x3b')],function(_0x1261c4){var _0x552b97={};_0x552b97[_0x1261c4]={'$like':'%'+_0x9076a2[_0xa123('0x36')][_0xa123('0x44')]+'%'};return _0x552b97;})});}_0x26dab1=_[_0xa123('0x46')]({},_0x26dab1,_0x9076a2['options']);return _0x58006['getActions'](_0x26dab1);}})[_0xa123('0x27')](function(_0x1bba32){if(_0x1bba32){_0x10e630=_0x1bba32[_0xa123('0x3d')];if(!_0x9076a2['query'][_0xa123('0x3e')](_0xa123('0x3f'))){_0x26dab1[_0xa123('0x40')]=qs[_0xa123('0x40')](_0x9076a2[_0xa123('0x36')][_0xa123('0x40')]);_0x26dab1[_0xa123('0x1f')]=qs[_0xa123('0x1f')](_0x9076a2['query'][_0xa123('0x1f')]);}return _0x58006['getActions'](_0x26dab1);}})[_0xa123('0x27')](function(_0x47e0ff){if(_0x47e0ff){return _0x47e0ff?{'count':_0x10e630,'rows':_0x47e0ff}:null;}})[_0xa123('0x27')](respondWithResult(_0x1d5659,null))[_0xa123('0x4b')](handleError(_0x1d5659,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ab266d2..2455519 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 _0x130d=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3de6c1,_0x4cb097){var _0x4453c8=function(_0x198e77){while(--_0x198e77){_0x3de6c1['push'](_0x3de6c1['shift']());}};_0x4453c8(++_0x4cb097);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require('util');var logger=require(_0xd130('0x1'))('api');var moment=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var rp=require(_0xd130('0x4'));var fs=require('fs');var path=require(_0xd130('0x5'));var rimraf=require(_0xd130('0x6'));var config=require(_0xd130('0x7'));var attributes=require(_0xd130('0x8'));module[_0xd130('0x9')]=function(_0x287e61,_0x4689a8){return _0x287e61[_0xd130('0xa')](_0xd130('0xb'),attributes,{'tableName':_0xd130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fdc=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','api','moment'];(function(_0x2808ee,_0x4bd9bb){var _0x4a6eb8=function(_0x8e36e8){while(--_0x8e36e8){_0x2808ee['push'](_0x2808ee['shift']());}};_0x4a6eb8(++_0x4bd9bb);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x1fdc[_0x12b8ec];return _0x21af77;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var logger=require('../../config/logger')(_0xc1fd('0x2'));var moment=require(_0xc1fd('0x3'));var BPromise=require(_0xc1fd('0x4'));var rp=require(_0xc1fd('0x5'));var fs=require('fs');var path=require(_0xc1fd('0x6'));var rimraf=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var attributes=require('./trigger.attributes');module[_0xc1fd('0x9')]=function(_0x141dab,_0x43cd02){return _0x141dab[_0xc1fd('0xa')](_0xc1fd('0xb'),attributes,{'tableName':_0xc1fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index bac7b8f..da93668 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 _0x9f56=['Trigger','findAll','options','raw','where','limit','include','model','attributes','map','then','GetTrigger','find','ShowTrigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x9f56,0x7a));var _0x69f5=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x9f56[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0x69f5('0x0'));var util=require('util');var moment=require(_0x69f5('0x1'));var BPromise=require(_0x69f5('0x2'));var rs=require(_0x69f5('0x3'));var fs=require('fs');var Redis=require(_0x69f5('0x4'));var db=require(_0x69f5('0x5'))['db'];var utils=require(_0x69f5('0x6'));var logger=require(_0x69f5('0x7'))('rpc');var config=require(_0x69f5('0x8'));var jayson=require(_0x69f5('0x9'));var client=jayson['client'][_0x69f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8c1288,_0x548e51,_0x240181){return new BPromise(function(_0x194623,_0x455662){return client[_0x69f5('0xb')](_0x8c1288,_0x240181)['then'](function(_0x31fda3){logger[_0x69f5('0xc')](_0x69f5('0xd'),_0x548e51,_0x69f5('0xe'));logger['debug'](_0x69f5('0xf'),_0x548e51,_0x69f5('0xe'),JSON[_0x69f5('0x10')](_0x31fda3));if(_0x31fda3[_0x69f5('0x11')]){if(_0x31fda3[_0x69f5('0x11')][_0x69f5('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x548e51,_0x31fda3[_0x69f5('0x11')][_0x69f5('0x13')]);return _0x455662(_0x31fda3[_0x69f5('0x11')]['message']);}logger[_0x69f5('0x11')]('Trigger,\x20%s,\x20%s',_0x548e51,_0x31fda3[_0x69f5('0x11')][_0x69f5('0x13')]);return _0x194623(_0x31fda3[_0x69f5('0x11')]['message']);}else{logger[_0x69f5('0xc')]('Trigger,\x20%s,\x20%s',_0x548e51,_0x69f5('0xe'));_0x194623(_0x31fda3[_0x69f5('0x14')]['message']);}})[_0x69f5('0x15')](function(_0x1e36e8){logger[_0x69f5('0x11')](_0x69f5('0xd'),_0x548e51,_0x1e36e8);_0x455662(_0x1e36e8);});});}exports['GetTrigger']=function(_0x3384e5){var _0x89a3=this;return new Promise(function(_0xc1154c,_0x57573f){return db[_0x69f5('0x16')][_0x69f5('0x17')]({'raw':_0x3384e5[_0x69f5('0x18')]?_0x3384e5[_0x69f5('0x18')][_0x69f5('0x19')]===undefined?!![]:![]:!![],'where':_0x3384e5[_0x69f5('0x18')]?_0x3384e5[_0x69f5('0x18')][_0x69f5('0x1a')]||null:null,'attributes':_0x3384e5[_0x69f5('0x18')]?_0x3384e5[_0x69f5('0x18')]['attributes']||null:null,'limit':_0x3384e5['options']?_0x3384e5[_0x69f5('0x18')][_0x69f5('0x1b')]||null:null,'include':_0x3384e5[_0x69f5('0x18')]?_0x3384e5['options']['include']?_['map'](_0x3384e5[_0x69f5('0x18')][_0x69f5('0x1c')],function(_0x1180c7){return{'model':db[_0x1180c7[_0x69f5('0x1d')]],'as':_0x1180c7['as'],'attributes':_0x1180c7[_0x69f5('0x1e')],'include':_0x1180c7['include']?_['map'](_0x1180c7['include'],function(_0x3edee6){return{'model':db[_0x3edee6[_0x69f5('0x1d')]],'as':_0x3edee6['as'],'attributes':_0x3edee6[_0x69f5('0x1e')],'include':_0x3edee6[_0x69f5('0x1c')]?_[_0x69f5('0x1f')](_0x3edee6['include'],function(_0x3bb72c){return{'model':db[_0x3bb72c['model']],'as':_0x3bb72c['as'],'attributes':_0x3bb72c[_0x69f5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x69f5('0x20')](function(_0x6c86b2){logger[_0x69f5('0xc')]('GetTrigger',_0x3384e5);logger['debug'](_0x69f5('0x21'),_0x3384e5,JSON[_0x69f5('0x10')](_0x6c86b2));_0xc1154c(_0x6c86b2);})[_0x69f5('0x15')](function(_0x761784){logger[_0x69f5('0x11')]('GetTrigger',_0x761784[_0x69f5('0x13')],_0x3384e5);_0x57573f(_0x89a3[_0x69f5('0x11')](0x1f4,_0x761784[_0x69f5('0x13')]));});});};exports['ShowTrigger']=function(_0xdcebaa){var _0xeffe44=this;return new Promise(function(_0x55afd2,_0x470273){return db[_0x69f5('0x16')][_0x69f5('0x22')]({'raw':_0xdcebaa['options']?_0xdcebaa[_0x69f5('0x18')][_0x69f5('0x19')]===undefined?!![]:![]:!![],'where':_0xdcebaa[_0x69f5('0x18')]?_0xdcebaa[_0x69f5('0x18')][_0x69f5('0x1a')]||null:null,'attributes':_0xdcebaa[_0x69f5('0x18')]?_0xdcebaa[_0x69f5('0x18')][_0x69f5('0x1e')]||null:null,'include':_0xdcebaa['options']?_0xdcebaa[_0x69f5('0x18')][_0x69f5('0x1c')]?_[_0x69f5('0x1f')](_0xdcebaa[_0x69f5('0x18')]['include'],function(_0x1e55e9){return{'model':db[_0x1e55e9[_0x69f5('0x1d')]],'as':_0x1e55e9['as'],'attributes':_0x1e55e9[_0x69f5('0x1e')],'include':_0x1e55e9[_0x69f5('0x1c')]?_[_0x69f5('0x1f')](_0x1e55e9[_0x69f5('0x1c')],function(_0x50dcb7){return{'model':db[_0x50dcb7[_0x69f5('0x1d')]],'as':_0x50dcb7['as'],'attributes':_0x50dcb7[_0x69f5('0x1e')],'include':_0x50dcb7['include']?_[_0x69f5('0x1f')](_0x50dcb7[_0x69f5('0x1c')],function(_0x5a1017){return{'model':db[_0x5a1017[_0x69f5('0x1d')]],'as':_0x5a1017['as'],'attributes':_0x5a1017[_0x69f5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57d155){logger['info'](_0x69f5('0x23'),_0xdcebaa);logger['debug']('ShowTrigger',_0xdcebaa,JSON[_0x69f5('0x10')](_0x57d155));_0x55afd2(_0x57d155);})[_0x69f5('0x15')](function(_0x17b484){logger[_0x69f5('0x11')](_0x69f5('0x23'),_0x17b484[_0x69f5('0x13')],_0xdcebaa);_0x470273(_0xeffe44[_0x69f5('0x11')](0x1f4,_0x17b484['message']));});});}; \ No newline at end of file +var _0x9e01=['lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrigger','Trigger','findAll','options','raw','attributes','include','map','model','then','debug','ShowTrigger','find','where','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9e01,0x7c));var _0x19e0=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9e01[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x19e0('0x0'));var util=require(_0x19e0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19e0('0x2'));var fs=require('fs');var Redis=require(_0x19e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19e0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x19e0('0x5'));var jayson=require(_0x19e0('0x6'));var client=jayson[_0x19e0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447820,_0x36eb70,_0x30efbc){return new BPromise(function(_0x5c1ddc,_0xe69aba){return client['request'](_0x447820,_0x30efbc)['then'](function(_0x4f2bb2){logger[_0x19e0('0x8')](_0x19e0('0x9'),_0x36eb70,_0x19e0('0xa'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x36eb70,_0x19e0('0xa'),JSON[_0x19e0('0xb')](_0x4f2bb2));if(_0x4f2bb2[_0x19e0('0xc')]){if(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xd')]===0x1f4){logger['error'](_0x19e0('0x9'),_0x36eb70,_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);return _0xe69aba(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);}logger['error'](_0x19e0('0x9'),_0x36eb70,_0x4f2bb2[_0x19e0('0xc')]['message']);return _0x5c1ddc(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);}else{logger[_0x19e0('0x8')](_0x19e0('0x9'),_0x36eb70,'request\x20sent');_0x5c1ddc(_0x4f2bb2[_0x19e0('0xf')][_0x19e0('0xe')]);}})['catch'](function(_0xa027e5){logger[_0x19e0('0xc')]('Trigger,\x20%s,\x20%s',_0x36eb70,_0xa027e5);_0xe69aba(_0xa027e5);});});}exports[_0x19e0('0x10')]=function(_0x2c820a){var _0x5a998a=this;return new Promise(function(_0xe6545c,_0x3d381e){return db[_0x19e0('0x11')][_0x19e0('0x12')]({'raw':_0x2c820a[_0x19e0('0x13')]?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x14')]===undefined?!![]:![]:!![],'where':_0x2c820a[_0x19e0('0x13')]?_0x2c820a['options']['where']||null:null,'attributes':_0x2c820a['options']?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x15')]||null:null,'limit':_0x2c820a[_0x19e0('0x13')]?_0x2c820a['options']['limit']||null:null,'include':_0x2c820a['options']?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x2c820a['options'][_0x19e0('0x16')],function(_0x20f7f7){return{'model':db[_0x20f7f7[_0x19e0('0x18')]],'as':_0x20f7f7['as'],'attributes':_0x20f7f7[_0x19e0('0x15')],'include':_0x20f7f7[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x20f7f7[_0x19e0('0x16')],function(_0x5a4928){return{'model':db[_0x5a4928['model']],'as':_0x5a4928['as'],'attributes':_0x5a4928[_0x19e0('0x15')],'include':_0x5a4928[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x5a4928['include'],function(_0x51708b){return{'model':db[_0x51708b[_0x19e0('0x18')]],'as':_0x51708b['as'],'attributes':_0x51708b[_0x19e0('0x15')]};}):[]};}):[]};}):[]:[]})[_0x19e0('0x19')](function(_0x304bde){logger[_0x19e0('0x8')]('GetTrigger',_0x2c820a);logger[_0x19e0('0x1a')]('GetTrigger',_0x2c820a,JSON[_0x19e0('0xb')](_0x304bde));_0xe6545c(_0x304bde);})['catch'](function(_0x2043b2){logger[_0x19e0('0xc')](_0x19e0('0x10'),_0x2043b2[_0x19e0('0xe')],_0x2c820a);_0x3d381e(_0x5a998a['error'](0x1f4,_0x2043b2[_0x19e0('0xe')]));});});};exports[_0x19e0('0x1b')]=function(_0x5571ac){var _0x4b7f89=this;return new Promise(function(_0x55cb95,_0x2eac81){return db[_0x19e0('0x11')][_0x19e0('0x1c')]({'raw':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x14')]===undefined?!![]:![]:!![],'where':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x1d')]||null:null,'attributes':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x15')]||null:null,'include':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')]['include']?_[_0x19e0('0x17')](_0x5571ac['options'][_0x19e0('0x16')],function(_0x2c5b9b){return{'model':db[_0x2c5b9b[_0x19e0('0x18')]],'as':_0x2c5b9b['as'],'attributes':_0x2c5b9b['attributes'],'include':_0x2c5b9b['include']?_[_0x19e0('0x17')](_0x2c5b9b[_0x19e0('0x16')],function(_0x1f1b77){return{'model':db[_0x1f1b77['model']],'as':_0x1f1b77['as'],'attributes':_0x1f1b77[_0x19e0('0x15')],'include':_0x1f1b77[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x1f1b77[_0x19e0('0x16')],function(_0x489721){return{'model':db[_0x489721[_0x19e0('0x18')]],'as':_0x489721['as'],'attributes':_0x489721[_0x19e0('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x220b81){logger[_0x19e0('0x8')](_0x19e0('0x1b'),_0x5571ac);logger['debug'](_0x19e0('0x1b'),_0x5571ac,JSON[_0x19e0('0xb')](_0x220b81));_0x55cb95(_0x220b81);})[_0x19e0('0x1e')](function(_0x9ade08){logger[_0x19e0('0xc')](_0x19e0('0x1b'),_0x9ade08['message'],_0x5571ac);_0x2eac81(_0x4b7f89[_0x19e0('0xc')](0x1f4,_0x9ade08[_0x19e0('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c05aeff..b999fed 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 _0xe60a=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone'];(function(_0x32be62,_0x22e6fd){var _0x1a37e9=function(_0x35a9c1){while(--_0x35a9c1){_0x32be62['push'](_0x32be62['shift']());}};_0x1a37e9(++_0x22e6fd);}(_0xe60a,0x17c));var _0xae60=function(_0x3c0f39,_0x416b9c){_0x3c0f39=_0x3c0f39-0x0;var _0x3bca52=_0xe60a[_0x3c0f39];return _0x3bca52;};'use strict';var multer=require(_0xae60('0x0'));var util=require(_0xae60('0x1'));var path=require(_0xae60('0x2'));var timeout=require(_0xae60('0x3'));var express=require(_0xae60('0x4'));var router=express['Router']();var fs_extra=require(_0xae60('0x5'));var auth=require(_0xae60('0x6'));var interaction=require(_0xae60('0x7'));var config=require(_0xae60('0x8'));var controller=require(_0xae60('0x9'));router[_0xae60('0xa')]('/',auth[_0xae60('0xb')](),controller['index']);router[_0xae60('0xa')](_0xae60('0xc'),auth['isAuthenticated'](),controller[_0xae60('0xd')]);router[_0xae60('0xe')](_0xae60('0xf'),auth[_0xae60('0xb')](),controller['clone']);router['post']('/',auth[_0xae60('0xb')](),controller[_0xae60('0x10')]);router[_0xae60('0x11')](_0xae60('0xc'),auth['isAuthenticated'](),controller[_0xae60('0x12')]);router[_0xae60('0x13')](_0xae60('0xc'),auth[_0xae60('0xb')](),controller[_0xae60('0x14')]);module[_0xae60('0x15')]=router; \ No newline at end of file +var _0x1fea=['./trunk.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x335395,_0x5a5706){var _0x5774a3=function(_0x473620){while(--_0x473620){_0x335395['push'](_0x335395['shift']());}};_0x5774a3(++_0x5a5706);}(_0x1fea,0xde));var _0xa1fe=function(_0x1d3236,_0x309f10){_0x1d3236=_0x1d3236-0x0;var _0x18459e=_0x1fea[_0x1d3236];return _0x18459e;};'use strict';var multer=require(_0xa1fe('0x0'));var util=require(_0xa1fe('0x1'));var path=require(_0xa1fe('0x2'));var timeout=require(_0xa1fe('0x3'));var express=require(_0xa1fe('0x4'));var router=express[_0xa1fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa1fe('0x6'));var interaction=require(_0xa1fe('0x7'));var config=require(_0xa1fe('0x8'));var controller=require(_0xa1fe('0x9'));router[_0xa1fe('0xa')]('/',auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xc')]);router[_0xa1fe('0xa')](_0xa1fe('0xd'),auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xe')]);router['post']('/:id/clone',auth[_0xa1fe('0xb')](),controller['clone']);router['post']('/',auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xf')]);router[_0xa1fe('0x10')](_0xa1fe('0xd'),auth[_0xa1fe('0xb')](),controller[_0xa1fe('0x11')]);router[_0xa1fe('0x12')](_0xa1fe('0xd'),auth['isAuthenticated'](),controller[_0xa1fe('0x13')]);module[_0xa1fe('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c2e6010..eb7ac0f 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 _0x0ea6=['setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','getDataValue','split','rfc2833','shortinfo','auto','yes','update','outgoing','force_rport,comedia','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all'];(function(_0x40155d,_0x4fddf0){var _0x213afe=function(_0x4e1928){while(--_0x4e1928){_0x40155d['push'](_0x40155d['shift']());}};_0x213afe(++_0x4fddf0);}(_0x0ea6,0x135));var _0x60ea=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x0ea6[_0x424501];return _0xb719af;};'use strict';var Sequelize=require(_0x60ea('0x0'));module[_0x60ea('0x1')]={'name':{'type':Sequelize[_0x60ea('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x4'),'user',_0x60ea('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x60ea('0x2')],'allowNull':![],'defaultValue':_0x60ea('0x6')},'callingpres':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x7'),_0x60ea('0x8'),_0x60ea('0x9'),'ALLOWED',_0x60ea('0xa'),_0x60ea('0xb'),_0x60ea('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x60ea('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x60ea('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x60ea('0x2')]},'transport':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':_0x60ea('0xd'),'set':function(_0x4a150a){this['setDataValue'](_0x60ea('0xe'),_0x4a150a?_0x4a150a['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x60ea('0xf')](_0x60ea('0xe'))[_0x60ea('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x60ea('0x11'),'info',_0x60ea('0x12'),'inband',_0x60ea('0x13')),'defaultValue':_0x60ea('0x11')},'directmedia':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no','nonat',_0x60ea('0x15'),_0x60ea('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x60ea('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':_0x60ea('0x17'),'set':function(_0x888aa6){this['setDataValue']('nat',_0x888aa6?_0x888aa6[_0x60ea('0x18')](','):null);},'get':function(){return this[_0x60ea('0xf')]('nat')?this[_0x60ea('0xf')]('nat')[_0x60ea('0x10')](','):null;},'comment':_0x60ea('0x19')},'callgroup':{'type':Sequelize[_0x60ea('0x2')]},'namedcallgroup':{'type':Sequelize[_0x60ea('0x2')]},'pickupgroup':{'type':Sequelize[_0x60ea('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x60ea('0x2')]},'language':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':_0x60ea('0x1a')},'allow':{'type':Sequelize[_0x60ea('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x230fed){this[_0x60ea('0x1b')]('allow',_0x230fed?_0x230fed['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x60ea('0xf')](_0x60ea('0x1c'))?this[_0x60ea('0xf')](_0x60ea('0x1c'))[_0x60ea('0x10')](';'):null;},'comment':_0x60ea('0x1d')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':'port,invite','set':function(_0x207ea3){this[_0x60ea('0x1b')](_0x60ea('0x1e'),_0x207ea3?_0x207ea3[_0x60ea('0x18')](','):null);},'get':function(){return this[_0x60ea('0xf')](_0x60ea('0x1e'))?this['getDataValue'](_0x60ea('0x1e'))[_0x60ea('0x10')](','):null;},'comment':_0x60ea('0x1f')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x60ea('0x3')]('yes','no',_0x60ea('0x20'))},'promiscredir':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'useclientcode':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'accountcode':{'type':Sequelize[_0x60ea('0x21')](0xb)},'setvar':{'type':Sequelize[_0x60ea('0x2')]},'callerid':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':_0x60ea('0x22')},'amaflags':{'type':Sequelize[_0x60ea('0x2')]},'callcounter':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no'),'defaultValue':_0x60ea('0x14')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x60ea('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x60ea('0x2')]},'template':{'type':Sequelize[_0x60ea('0x2')]},'videosupport':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no',_0x60ea('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x60ea('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x60ea('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x60ea('0x2')]},'session_timers':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x24'),_0x60ea('0x25'),_0x60ea('0x26'))},'session_expires':{'type':Sequelize[_0x60ea('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x60ea('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x27'),_0x60ea('0x28')),'defaultValue':_0x60ea('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x60ea('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x60ea('0x2')]},'fromuser':{'type':Sequelize[_0x60ea('0x2')]},'port':{'type':Sequelize[_0x60ea('0x21')](0x5)},'qualify':{'type':Sequelize[_0x60ea('0x3')]('yes','no'),'defaultValue':_0x60ea('0x14')},'keepalive':{'type':Sequelize[_0x60ea('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x60ea('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x60ea('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x60ea('0x3')]('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x60ea('0x2')]},'timert1':{'type':Sequelize[_0x60ea('0x21')](0xb)},'timerb':{'type':Sequelize[_0x60ea('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x60ea('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x60ea('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x60ea('0x2')]},'maxforwards':{'type':Sequelize[_0x60ea('0x21')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x60ea('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'icesupport':{'type':Sequelize[_0x60ea('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x60ea('0x3')]('yes','no',_0x60ea('0x29'),_0x60ea('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x60ea('0x21')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x60ea('0x2')]},'dtlscafile':{'type':Sequelize[_0x60ea('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x2b'),_0x60ea('0x2c'),_0x60ea('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x60ea('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x60ea('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x60ea('0x2')]},'recordofffeature':{'type':Sequelize[_0x60ea('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x60ea('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60ea('0x2')]},'host':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':_0x60ea('0x2e')},'canreinvite':{'type':Sequelize[_0x60ea('0x3')](_0x60ea('0x14'),'no','nonat',_0x60ea('0x15'),_0x60ea('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x60ea('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x60ea('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x0f27=['fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','update,nonat','BOOLEAN','exports','STRING','name','friend','user','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x0f27,0xde));var _0x70f2=function(_0x4a4d8e,_0x22a7a9){_0x4a4d8e=_0x4a4d8e-0x0;var _0x1a5cb4=_0x0f27[_0x4a4d8e];return _0x1a5cb4;};'use strict';var Sequelize=require('sequelize');module[_0x70f2('0x0')]={'name':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'unique':_0x70f2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x70f2('0x3'),_0x70f2('0x4'),'peer'),'allowNull':![],'defaultValue':_0x70f2('0x3')},'context':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x6'),'ALLOWED_PASSED_SCREEN',_0x70f2('0x7'),'ALLOWED',_0x70f2('0x8'),_0x70f2('0x9'),_0x70f2('0xa'),_0x70f2('0xb'))},'deny':{'type':Sequelize[_0x70f2('0x1')]},'permit':{'type':Sequelize[_0x70f2('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0xc'),'set':function(_0x4f7599){this[_0x70f2('0xd')]('transport',_0x4f7599?_0x4f7599[_0x70f2('0xe')](','):null);},'get':function(){return this[_0x70f2('0xf')](_0x70f2('0x10'))?this[_0x70f2('0xf')]('transport')['split'](','):null;},'comment':_0x70f2('0x11')},'dtmfmode':{'type':Sequelize[_0x70f2('0x5')]('rfc2833',_0x70f2('0x12'),_0x70f2('0x13'),_0x70f2('0x14'),'auto'),'defaultValue':_0x70f2('0x15')},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x70f2('0x1')]},'directmediadeny':{'type':Sequelize[_0x70f2('0x1')]},'nat':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x3555b0){this['setDataValue'](_0x70f2('0x17'),_0x3555b0?_0x3555b0[_0x70f2('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x70f2('0x17'))?this[_0x70f2('0xf')](_0x70f2('0x17'))[_0x70f2('0x18')](','):null;},'comment':_0x70f2('0x19')},'callgroup':{'type':Sequelize[_0x70f2('0x1')]},'namedcallgroup':{'type':Sequelize[_0x70f2('0x1')]},'pickupgroup':{'type':Sequelize[_0x70f2('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x70f2('0x1')]},'language':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x1a')},'allow':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'defaultValue':_0x70f2('0x1b'),'set':function(_0x52cdfa){this[_0x70f2('0xd')](_0x70f2('0x1c'),_0x52cdfa?_0x52cdfa['join'](';'):_0x70f2('0x1b'));},'get':function(){return this['getDataValue'](_0x70f2('0x1c'))?this[_0x70f2('0xf')](_0x70f2('0x1c'))[_0x70f2('0x18')](';'):null;},'comment':_0x70f2('0x1d')},'autoframing':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'insecure':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x1e'),'set':function(_0xb2d1e9){this[_0x70f2('0xd')]('insecure',_0xb2d1e9?_0xb2d1e9[_0x70f2('0xe')](','):null);},'get':function(){return this[_0x70f2('0xf')](_0x70f2('0x1f'))?this[_0x70f2('0xf')](_0x70f2('0x1f'))['split'](','):null;},'comment':_0x70f2('0x20')},'trustrpid':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x21'))},'promiscredir':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'accountcode':{'type':Sequelize[_0x70f2('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x23')},'amaflags':{'type':Sequelize[_0x70f2('0x1')]},'callcounter':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':_0x70f2('0x16')},'busylevel':{'type':Sequelize[_0x70f2('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x70f2('0x1')]},'template':{'type':Sequelize[_0x70f2('0x1')]},'videosupport':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x70f2('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'mailbox':{'type':Sequelize[_0x70f2('0x1')]},'session_timers':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x25'),_0x70f2('0x26'),_0x70f2('0x27'))},'session_expires':{'type':Sequelize[_0x70f2('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x70f2('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x28'),_0x70f2('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x70f2('0x1')]},'regexten':{'type':Sequelize[_0x70f2('0x1')]},'fromdomain':{'type':Sequelize[_0x70f2('0x1')]},'fromuser':{'type':Sequelize[_0x70f2('0x1')]},'port':{'type':Sequelize[_0x70f2('0x22')](0x5)},'qualify':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':_0x70f2('0x16')},'keepalive':{'type':Sequelize[_0x70f2('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x70f2('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x70f2('0x1')]},'callbackextension':{'type':Sequelize[_0x70f2('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x70f2('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x70f2('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x70f2('0x1')]},'maxforwards':{'type':Sequelize[_0x70f2('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no')},'force_avp':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'icesupport':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x2b'),_0x70f2('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x70f2('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x70f2('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x70f2('0x1')]},'dtlscafile':{'type':Sequelize[_0x70f2('0x1')]},'dtlscapath':{'type':Sequelize[_0x70f2('0x1')]},'dtlssetup':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x2d'),_0x70f2('0x2e'),_0x70f2('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x70f2('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'vmexten':{'type':Sequelize[_0x70f2('0x1')]},'mohinterpret':{'type':Sequelize[_0x70f2('0x1')]},'mohsuggest':{'type':Sequelize[_0x70f2('0x1')]},'parkinglot':{'type':Sequelize[_0x70f2('0x1')]},'description':{'type':Sequelize[_0x70f2('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x70f2('0x30')},'canreinvite':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x31'),_0x70f2('0x32'),_0x70f2('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x70f2('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x70f2('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index c2636b8..065e3b8 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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x5584fc,_0x152291){var _0x17d44d=function(_0x4c9f00){while(--_0x4c9f00){_0x5584fc['push'](_0x5584fc['shift']());}};_0x17d44d(++_0x152291);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x40e17c,_0x4c4db4){_0x40e17c=_0x40e17c-0x0;var _0x46312a=_0xd6d6[_0x40e17c];return _0x46312a;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1e7fbd,_0x394862){var _0xf289eb=function(_0x5ec249){while(--_0x5ec249){_0x1e7fbd['push'](_0x1e7fbd['shift']());}};_0xf289eb(++_0x394862);}(_0x98a8,0x12c));var _0x898a=function(_0x587b7d,_0x2e2431){_0x587b7d=_0x587b7d-0x0;var _0xd5f7f8=_0x98a8[_0x587b7d];return _0xd5f7f8;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 20a6622..7eac831 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 _0xd07a=['Trunk','tools_trunks','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x606116,_0x9907ea){var _0x279614=function(_0xe3ff82){while(--_0xe3ff82){_0x606116['push'](_0x606116['shift']());}};_0x279614(++_0x9907ea);}(_0xd07a,0x9e));var _0xad07=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0xd07a[_0x37d0bc];return _0x170e60;};'use strict';var _=require(_0xad07('0x0'));var util=require(_0xad07('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xad07('0x2'));var BPromise=require(_0xad07('0x3'));var rp=require(_0xad07('0x4'));var fs=require('fs');var path=require(_0xad07('0x5'));var rimraf=require(_0xad07('0x6'));var config=require(_0xad07('0x7'));var attributes=require(_0xad07('0x8'));module[_0xad07('0x9')]=function(_0x2c2c58,_0x521bff){return _0x2c2c58['define'](_0xad07('0xa'),attributes,{'tableName':_0xad07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe181=['exports','Trunk','lodash','util','../../config/logger','moment','request-promise','rimraf','./trunk.attributes'];(function(_0x1c6656,_0x4bbbff){var _0x43640b=function(_0x106780){while(--_0x106780){_0x1c6656['push'](_0x1c6656['shift']());}};_0x43640b(++_0x4bbbff);}(_0xe181,0x92));var _0x1e18=function(_0x6bb814,_0x17196b){_0x6bb814=_0x6bb814-0x0;var _0x3c4bf6=_0xe181[_0x6bb814];return _0x3c4bf6;};'use strict';var _=require(_0x1e18('0x0'));var util=require(_0x1e18('0x1'));var logger=require(_0x1e18('0x2'))('api');var moment=require(_0x1e18('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e18('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e18('0x6'));module[_0x1e18('0x7')]=function(_0x1d0b20,_0xb6ecca){return _0x1d0b20['define'](_0x1e18('0x8'),attributes,{'tableName':'tools_trunks','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 fb0786e..6f7bb81 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 _0x73eb=['find','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','attributes','limit','include','map','model','then','stringify','ShowTrunk'];(function(_0x2949f2,_0x3f2b63){var _0x4f94d1=function(_0x2762ce){while(--_0x2762ce){_0x2949f2['push'](_0x2949f2['shift']());}};_0x4f94d1(++_0x3f2b63);}(_0x73eb,0x18e));var _0xb73e=function(_0x2d205b,_0xe23977){_0x2d205b=_0x2d205b-0x0;var _0x2b93df=_0x73eb[_0x2d205b];return _0x2b93df;};'use strict';var _=require(_0xb73e('0x0'));var util=require(_0xb73e('0x1'));var moment=require(_0xb73e('0x2'));var BPromise=require(_0xb73e('0x3'));var rs=require(_0xb73e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb73e('0x5'));var logger=require(_0xb73e('0x6'))(_0xb73e('0x7'));var config=require(_0xb73e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb73e('0x9')][_0xb73e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283673,_0x1c699d,_0xb62f1d){return new BPromise(function(_0x8e4f29,_0x61ca12){return client[_0xb73e('0xb')](_0x283673,_0xb62f1d)['then'](function(_0x40ba4c){logger[_0xb73e('0xc')](_0xb73e('0xd'),_0x1c699d,'request\x20sent');logger[_0xb73e('0xe')](_0xb73e('0xf'),_0x1c699d,'request\x20sent',JSON['stringify'](_0x40ba4c));if(_0x40ba4c[_0xb73e('0x10')]){if(_0x40ba4c[_0xb73e('0x10')][_0xb73e('0x11')]===0x1f4){logger[_0xb73e('0x10')](_0xb73e('0xd'),_0x1c699d,_0x40ba4c['error'][_0xb73e('0x12')]);return _0x61ca12(_0x40ba4c['error'][_0xb73e('0x12')]);}logger[_0xb73e('0x10')](_0xb73e('0xd'),_0x1c699d,_0x40ba4c[_0xb73e('0x10')]['message']);return _0x8e4f29(_0x40ba4c['error'][_0xb73e('0x12')]);}else{logger[_0xb73e('0xc')](_0xb73e('0xd'),_0x1c699d,_0xb73e('0x13'));_0x8e4f29(_0x40ba4c[_0xb73e('0x14')][_0xb73e('0x12')]);}})[_0xb73e('0x15')](function(_0x40212b){logger[_0xb73e('0x10')](_0xb73e('0xd'),_0x1c699d,_0x40212b);_0x61ca12(_0x40212b);});});}exports[_0xb73e('0x16')]=function(_0x2a6a77){var _0x392094=this;return new Promise(function(_0x56f67e,_0x40cb30){return db[_0xb73e('0x17')][_0xb73e('0x18')]({'raw':_0x2a6a77['options']?_0x2a6a77[_0xb73e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2a6a77[_0xb73e('0x19')]?_0x2a6a77[_0xb73e('0x19')]['where']||null:null,'attributes':_0x2a6a77[_0xb73e('0x19')]?_0x2a6a77['options'][_0xb73e('0x1a')]||null:null,'limit':_0x2a6a77['options']?_0x2a6a77['options'][_0xb73e('0x1b')]||null:null,'include':_0x2a6a77[_0xb73e('0x19')]?_0x2a6a77['options'][_0xb73e('0x1c')]?_[_0xb73e('0x1d')](_0x2a6a77[_0xb73e('0x19')][_0xb73e('0x1c')],function(_0x48ddec){return{'model':db[_0x48ddec[_0xb73e('0x1e')]],'as':_0x48ddec['as'],'attributes':_0x48ddec[_0xb73e('0x1a')],'include':_0x48ddec[_0xb73e('0x1c')]?_['map'](_0x48ddec['include'],function(_0x29bf4b){return{'model':db[_0x29bf4b[_0xb73e('0x1e')]],'as':_0x29bf4b['as'],'attributes':_0x29bf4b['attributes'],'include':_0x29bf4b[_0xb73e('0x1c')]?_[_0xb73e('0x1d')](_0x29bf4b[_0xb73e('0x1c')],function(_0x6f20e9){return{'model':db[_0x6f20e9[_0xb73e('0x1e')]],'as':_0x6f20e9['as'],'attributes':_0x6f20e9[_0xb73e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb73e('0x1f')](function(_0x55c2a1){logger[_0xb73e('0xc')](_0xb73e('0x16'),_0x2a6a77);logger[_0xb73e('0xe')](_0xb73e('0x16'),_0x2a6a77,JSON[_0xb73e('0x20')](_0x55c2a1));_0x56f67e(_0x55c2a1);})[_0xb73e('0x15')](function(_0x1a0a2d){logger[_0xb73e('0x10')]('GetTrunk',_0x1a0a2d[_0xb73e('0x12')],_0x2a6a77);_0x40cb30(_0x392094[_0xb73e('0x10')](0x1f4,_0x1a0a2d[_0xb73e('0x12')]));});});};exports[_0xb73e('0x21')]=function(_0x18a7f8){var _0x2cab43=this;return new Promise(function(_0x3a8997,_0x1befe6){return db[_0xb73e('0x17')][_0xb73e('0x22')]({'raw':_0x18a7f8['options']?_0x18a7f8[_0xb73e('0x19')][_0xb73e('0x23')]===undefined?!![]:![]:!![],'where':_0x18a7f8['options']?_0x18a7f8[_0xb73e('0x19')]['where']||null:null,'attributes':_0x18a7f8[_0xb73e('0x19')]?_0x18a7f8[_0xb73e('0x19')][_0xb73e('0x1a')]||null:null,'include':_0x18a7f8['options']?_0x18a7f8['options'][_0xb73e('0x1c')]?_[_0xb73e('0x1d')](_0x18a7f8[_0xb73e('0x19')]['include'],function(_0x3a6ba2){return{'model':db[_0x3a6ba2[_0xb73e('0x1e')]],'as':_0x3a6ba2['as'],'attributes':_0x3a6ba2[_0xb73e('0x1a')],'include':_0x3a6ba2[_0xb73e('0x1c')]?_[_0xb73e('0x1d')](_0x3a6ba2[_0xb73e('0x1c')],function(_0xe80d97){return{'model':db[_0xe80d97[_0xb73e('0x1e')]],'as':_0xe80d97['as'],'attributes':_0xe80d97['attributes'],'include':_0xe80d97[_0xb73e('0x1c')]?_['map'](_0xe80d97['include'],function(_0x4a5603){return{'model':db[_0x4a5603[_0xb73e('0x1e')]],'as':_0x4a5603['as'],'attributes':_0x4a5603[_0xb73e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb73e('0x1f')](function(_0x3193c7){logger[_0xb73e('0xc')](_0xb73e('0x21'),_0x18a7f8);logger['debug'](_0xb73e('0x21'),_0x18a7f8,JSON[_0xb73e('0x20')](_0x3193c7));_0x3a8997(_0x3193c7);})[_0xb73e('0x15')](function(_0x4f0321){logger['error']('ShowTrunk',_0x4f0321[_0xb73e('0x12')],_0x18a7f8);_0x1befe6(_0x2cab43['error'](0x1f4,_0x4f0321['message']));});});}; \ No newline at end of file +var _0xf64a=['find','raw','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','findAll','options','where','limit','map','include','model','attributes','GetTrunk','Trunk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf64a,0x19a));var _0xaf64=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xf64a[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0xaf64('0x0'));var util=require(_0xaf64('0x1'));var moment=require(_0xaf64('0x2'));var BPromise=require(_0xaf64('0x3'));var rs=require(_0xaf64('0x4'));var fs=require('fs');var Redis=require(_0xaf64('0x5'));var db=require(_0xaf64('0x6'))['db'];var utils=require(_0xaf64('0x7'));var logger=require(_0xaf64('0x8'))(_0xaf64('0x9'));var config=require(_0xaf64('0xa'));var jayson=require(_0xaf64('0xb'));var client=jayson['client'][_0xaf64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb49bc1,_0x25f1fd,_0x21e968){return new BPromise(function(_0x5c5f0f,_0x5206cb){return client[_0xaf64('0xd')](_0xb49bc1,_0x21e968)[_0xaf64('0xe')](function(_0x421b25){logger[_0xaf64('0xf')](_0xaf64('0x10'),_0x25f1fd,'request\x20sent');logger[_0xaf64('0x11')]('Trunk,\x20%s,\x20%s,\x20%s',_0x25f1fd,_0xaf64('0x12'),JSON[_0xaf64('0x13')](_0x421b25));if(_0x421b25[_0xaf64('0x14')]){if(_0x421b25[_0xaf64('0x14')]['code']===0x1f4){logger[_0xaf64('0x14')](_0xaf64('0x10'),_0x25f1fd,_0x421b25['error'][_0xaf64('0x15')]);return _0x5206cb(_0x421b25[_0xaf64('0x14')][_0xaf64('0x15')]);}logger[_0xaf64('0x14')](_0xaf64('0x10'),_0x25f1fd,_0x421b25[_0xaf64('0x14')][_0xaf64('0x15')]);return _0x5c5f0f(_0x421b25['error'][_0xaf64('0x15')]);}else{logger[_0xaf64('0xf')](_0xaf64('0x10'),_0x25f1fd,'request\x20sent');_0x5c5f0f(_0x421b25[_0xaf64('0x16')][_0xaf64('0x15')]);}})[_0xaf64('0x17')](function(_0x43085c){logger['error'](_0xaf64('0x10'),_0x25f1fd,_0x43085c);_0x5206cb(_0x43085c);});});}exports['GetTrunk']=function(_0x50b0ea){var _0x504ff3=this;return new Promise(function(_0x56dcd2,_0x54a198){return db['Trunk'][_0xaf64('0x18')]({'raw':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x50b0ea['options']?_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1a')]||null:null,'attributes':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea['options']['attributes']||null:null,'limit':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1b')]||null:null,'include':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')]['include']?_[_0xaf64('0x1c')](_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1d')],function(_0x1f1e59){return{'model':db[_0x1f1e59[_0xaf64('0x1e')]],'as':_0x1f1e59['as'],'attributes':_0x1f1e59[_0xaf64('0x1f')],'include':_0x1f1e59[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x1f1e59['include'],function(_0x30d615){return{'model':db[_0x30d615[_0xaf64('0x1e')]],'as':_0x30d615['as'],'attributes':_0x30d615[_0xaf64('0x1f')],'include':_0x30d615[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x30d615[_0xaf64('0x1d')],function(_0x57b734){return{'model':db[_0x57b734['model']],'as':_0x57b734['as'],'attributes':_0x57b734['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf64('0xe')](function(_0x5517d0){logger[_0xaf64('0xf')]('GetTrunk',_0x50b0ea);logger[_0xaf64('0x11')](_0xaf64('0x20'),_0x50b0ea,JSON[_0xaf64('0x13')](_0x5517d0));_0x56dcd2(_0x5517d0);})[_0xaf64('0x17')](function(_0x453ac6){logger['error'](_0xaf64('0x20'),_0x453ac6['message'],_0x50b0ea);_0x54a198(_0x504ff3[_0xaf64('0x14')](0x1f4,_0x453ac6[_0xaf64('0x15')]));});});};exports['ShowTrunk']=function(_0x4e75a7){var _0x522ff7=this;return new Promise(function(_0x4484ed,_0x5c0810){return db[_0xaf64('0x21')][_0xaf64('0x22')]({'raw':_0x4e75a7[_0xaf64('0x19')]?_0x4e75a7['options'][_0xaf64('0x23')]===undefined?!![]:![]:!![],'where':_0x4e75a7['options']?_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1a')]||null:null,'attributes':_0x4e75a7[_0xaf64('0x19')]?_0x4e75a7['options'][_0xaf64('0x1f')]||null:null,'include':_0x4e75a7['options']?_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1d')],function(_0x52ba7a){return{'model':db[_0x52ba7a[_0xaf64('0x1e')]],'as':_0x52ba7a['as'],'attributes':_0x52ba7a[_0xaf64('0x1f')],'include':_0x52ba7a['include']?_['map'](_0x52ba7a[_0xaf64('0x1d')],function(_0x2a6ea1){return{'model':db[_0x2a6ea1['model']],'as':_0x2a6ea1['as'],'attributes':_0x2a6ea1['attributes'],'include':_0x2a6ea1[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x2a6ea1['include'],function(_0x452cb8){return{'model':db[_0x452cb8[_0xaf64('0x1e')]],'as':_0x452cb8['as'],'attributes':_0x452cb8['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf64('0xe')](function(_0x699ba4){logger[_0xaf64('0xf')](_0xaf64('0x24'),_0x4e75a7);logger[_0xaf64('0x11')]('ShowTrunk',_0x4e75a7,JSON['stringify'](_0x699ba4));_0x4484ed(_0x699ba4);})[_0xaf64('0x17')](function(_0x186b7e){logger[_0xaf64('0x14')]('ShowTrunk',_0x186b7e[_0xaf64('0x15')],_0x4e75a7);_0x5c0810(_0x522ff7['error'](0x1f4,_0x186b7e[_0xaf64('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 1b8383e..4dc9a50 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 _0xae79=['Router','../../components/auth/service','./user-setting.controller','put','/:id','update','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae79,0x11f));var _0x9ae7=function(_0x1fa4f9,_0x3bbe5f){_0x1fa4f9=_0x1fa4f9-0x0;var _0x3e60e9=_0xae79[_0x1fa4f9];return _0x3e60e9;};'use strict';var express=require(_0x9ae7('0x0'));var router=express[_0x9ae7('0x1')]();var auth=require(_0x9ae7('0x2'));var controller=require(_0x9ae7('0x3'));router[_0x9ae7('0x4')](_0x9ae7('0x5'),auth['isAuthenticated'](),controller[_0x9ae7('0x6')]);module[_0x9ae7('0x7')]=router; \ No newline at end of file +var _0xf649=['isAuthenticated','exports','express','../../components/auth/service','./user-setting.controller','/:id'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf649,0x1d0));var _0x9f64=function(_0x18d1bc,_0xc79a86){_0x18d1bc=_0x18d1bc-0x0;var _0x55d0d6=_0xf649[_0x18d1bc];return _0x55d0d6;};'use strict';var express=require(_0x9f64('0x0'));var router=express['Router']();var auth=require(_0x9f64('0x1'));var controller=require(_0x9f64('0x2'));router['put'](_0x9f64('0x3'),auth[_0x9f64('0x4')](),controller['update']);module[_0x9f64('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 dd9f245..8bfcb03 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 _0x8da1=['TEXT','INTEGER','warning','info','debug','exports','ENUM','BOOLEAN'];(function(_0x40bd56,_0x2491d1){var _0x20947d=function(_0x26a39c){while(--_0x26a39c){_0x40bd56['push'](_0x40bd56['shift']());}};_0x20947d(++_0x2491d1);}(_0x8da1,0xa2));var _0x18da=function(_0xca1585,_0x219dfb){_0xca1585=_0xca1585-0x0;var _0x117736=_0x8da1[_0xca1585];return _0x117736;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x18da('0x0'),_0x18da('0x1'),_0x18da('0x2')];module[_0x18da('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x18da('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x18da('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x18da('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x18da('0x7')],'unique':'UserId'}}; \ No newline at end of file +var _0x7f2a=['TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug','exports','BOOLEAN'];(function(_0x6ce94,_0x1b3464){var _0x137074=function(_0x3a7f29){while(--_0x3a7f29){_0x6ce94['push'](_0x6ce94['shift']());}};_0x137074(++_0x1b3464);}(_0x7f2a,0xbf));var _0xa7f2=function(_0x48bba2,_0x1b103f){_0x48bba2=_0x48bba2-0x0;var _0x51a83d=_0x7f2a[_0x48bba2];return _0x51a83d;};'use strict';var Sequelize=require(_0xa7f2('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa7f2('0x1'),_0xa7f2('0x2'),_0xa7f2('0x3'),_0xa7f2('0x4')];module[_0xa7f2('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xa7f2('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa7f2('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xa7f2('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xa7f2('0x9')],'unique':_0xa7f2('0xa')}}; \ 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 5156400..cc0f23a 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 _0x33a1=['name','send','user','role','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','socket.io-emitter','redis','./user-setting.socket','defaults','json','update','sendStatus'];(function(_0x416750,_0x2b3813){var _0x37e23d=function(_0x35128e){while(--_0x35128e){_0x416750['push'](_0x416750['shift']());}};_0x37e23d(++_0x2b3813);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var Redis=require(_0x133a('0x1'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x133a('0x2'))(new Redis(config[_0x133a('0x3')]));require(_0x133a('0x4'))['register'](socket);config[_0x133a('0x3')]=_[_0x133a('0x5')](config[_0x133a('0x3')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x13fe1d,_0x1a6b64){_0x1a6b64=_0x1a6b64||0xc8;return function(_0x31409d){if(_0x31409d){return _0x13fe1d['status'](_0x1a6b64)[_0x133a('0x6')](_0x31409d);}};}function saveUpdates(_0x1dd1bf){return function(_0x113522){if(_0x113522){return _0x113522[_0x133a('0x7')](_0x1dd1bf)['then'](function(_0x5cba56){return _0x5cba56;});}return null;};}function handleEntityNotFound(_0x4866ce){return function(_0x3b022c){if(!_0x3b022c){_0x4866ce[_0x133a('0x8')](0x194);}return _0x3b022c;};}function handleError(_0x1f989c,_0x453900){_0x453900=_0x453900||0x1f4;return function(_0x1b60c3){logger['error'](_0x1b60c3['stack']);if(_0x1b60c3[_0x133a('0x9')]){delete _0x1b60c3['name'];}_0x1f989c['status'](_0x453900)[_0x133a('0xa')](_0x1b60c3);};}exports[_0x133a('0x7')]=function(_0x4ab7f3,_0x6e17){if(_0x4ab7f3[_0x133a('0xb')][_0x133a('0xc')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x4ab7f3[_0x133a('0xd')]['id'])))throw new Error(_0x133a('0xe'));return db[_0x133a('0xf')][_0x133a('0x10')]({'where':{'id':_0x4ab7f3['params']['id']}})['then'](handleEntityNotFound(_0x6e17,null))['then'](saveUpdates(_0x4ab7f3[_0x133a('0x11')],null))['then'](respondWithResult(_0x6e17,null))[_0x133a('0x12')](handleError(_0x6e17,null));}; \ No newline at end of file +var _0x1f38=['ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','name','send','user','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash'];(function(_0x216429,_0x2fb9d5){var _0x5d8ede=function(_0x499055){while(--_0x499055){_0x216429['push'](_0x216429['shift']());}};_0x5d8ede(++_0x2fb9d5);}(_0x1f38,0xd7));var _0x81f3=function(_0x1973a3,_0x53bee8){_0x1973a3=_0x1973a3-0x0;var _0x229ecf=_0x1f38[_0x1973a3];return _0x229ecf;};'use strict';var _=require(_0x81f3('0x0'));var Redis=require(_0x81f3('0x1'));var logger=require(_0x81f3('0x2'))(_0x81f3('0x3'));var config=require(_0x81f3('0x4'));var db=require(_0x81f3('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x81f3('0x6')]));require(_0x81f3('0x7'))[_0x81f3('0x8')](socket);config[_0x81f3('0x6')]=_[_0x81f3('0x9')](config['redis'],{'host':_0x81f3('0xa'),'port':0x18eb});function respondWithResult(_0x14ccf0,_0x17e044){_0x17e044=_0x17e044||0xc8;return function(_0x34b897){if(_0x34b897){return _0x14ccf0[_0x81f3('0xb')](_0x17e044)[_0x81f3('0xc')](_0x34b897);}};}function saveUpdates(_0x665f37){return function(_0x20d8ae){if(_0x20d8ae){return _0x20d8ae[_0x81f3('0xd')](_0x665f37)[_0x81f3('0xe')](function(_0x10b956){return _0x10b956;});}return null;};}function handleEntityNotFound(_0x4b9760){return function(_0xa4ee1d){if(!_0xa4ee1d){_0x4b9760[_0x81f3('0xf')](0x194);}return _0xa4ee1d;};}function handleError(_0x39948f,_0x532ba){_0x532ba=_0x532ba||0x1f4;return function(_0x255570){logger['error'](_0x255570['stack']);if(_0x255570[_0x81f3('0x10')]){delete _0x255570[_0x81f3('0x10')];}_0x39948f[_0x81f3('0xb')](_0x532ba)[_0x81f3('0x11')](_0x255570);};}exports[_0x81f3('0xd')]=function(_0x232c74,_0x4ffea5){if(_0x232c74[_0x81f3('0x12')][_0x81f3('0x13')]!==_0x81f3('0x14'))throw new Error('Unauthorized');if(isNaN(Number(_0x232c74[_0x81f3('0x15')]['id'])))throw new Error(_0x81f3('0x16'));return db[_0x81f3('0x17')][_0x81f3('0x18')]({'where':{'id':_0x232c74[_0x81f3('0x15')]['id']}})[_0x81f3('0xe')](handleEntityNotFound(_0x4ffea5,null))[_0x81f3('0xe')](saveUpdates(_0x232c74[_0x81f3('0x19')],null))[_0x81f3('0xe')](respondWithResult(_0x4ffea5,null))[_0x81f3('0x1a')](handleError(_0x4ffea5,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 9f7fc87..076299a 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 _0x32bd=['events','UserSetting','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x32bd,0xfc));var _0xd32b=function(_0x1436f4,_0x220178){_0x1436f4=_0x1436f4-0x0;var _0x1192d8=_0x32bd[_0x1436f4];return _0x1192d8;};'use strict';var EventEmitter=require(_0xd32b('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xd32b('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd32b('0x2')](0x0);var events={'afterCreate':_0xd32b('0x3'),'afterUpdate':'update','afterDestroy':_0xd32b('0x4')};function emitEvent(_0x3e2a9b){return function(_0x50a9f0,_0x312c97,_0x2974f1){UserSettingEvents[_0xd32b('0x5')](_0x3e2a9b+':'+_0x50a9f0['id'],_0x50a9f0);UserSettingEvents[_0xd32b('0x5')](_0x3e2a9b,_0x50a9f0);_0x2974f1(null);};}for(var e in events){if(events[_0xd32b('0x6')](e)){var event=events[e];UserSetting[_0xd32b('0x7')](e,emitEvent(event));}}module[_0xd32b('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x319a=['UserSetting','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x5dfc0c,_0x52a754){var _0x3c61dc=function(_0x150c30){while(--_0x150c30){_0x5dfc0c['push'](_0x5dfc0c['shift']());}};_0x3c61dc(++_0x52a754);}(_0x319a,0x9f));var _0xa319=function(_0xee86b9,_0x21daa7){_0xee86b9=_0xee86b9-0x0;var _0x1a54bf=_0x319a[_0xee86b9];return _0x1a54bf;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xa319('0x0'))['db'][_0xa319('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa319('0x2'),'afterUpdate':_0xa319('0x3'),'afterDestroy':_0xa319('0x4')};function emitEvent(_0x2e6416){return function(_0x5c587a,_0x44ea3a,_0x2cd4c7){UserSettingEvents['emit'](_0x2e6416+':'+_0x5c587a['id'],_0x5c587a);UserSettingEvents[_0xa319('0x5')](_0x2e6416,_0x5c587a);_0x2cd4c7(null);};}for(var e in events){if(events[_0xa319('0x6')](e)){var event=events[e];UserSetting[_0xa319('0x7')](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 9354ead..b61e806 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 _0xbaf0=['UserSetting','user_settings','clientSideLoggingEnabledSince','exports','define'];(function(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var attributes=require('./user-setting.attributes');module[_0x0baf('0x0')]=function(_0x2a3620){return _0x2a3620[_0x0baf('0x1')](_0x0baf('0x2'),attributes,{'tableName':_0x0baf('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d2e72){if(!_0x4d2e72['clientSideLoggingEnabled'])_0x4d2e72[_0x0baf('0x4')]=null;else if(_0x4d2e72[_0x0baf('0x4')]===null)_0x4d2e72[_0x0baf('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x6931=['./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabledSince'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0x6931,0xa5));var _0x1693=function(_0x472692,_0x340d36){_0x472692=_0x472692-0x0;var _0x54c760=_0x6931[_0x472692];return _0x54c760;};'use strict';var attributes=require(_0x1693('0x0'));module[_0x1693('0x1')]=function(_0x51e896){return _0x51e896['define'](_0x1693('0x2'),attributes,{'tableName':_0x1693('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37c53b){if(!_0x37c53b['clientSideLoggingEnabled'])_0x37c53b[_0x1693('0x4')]=null;else if(_0x37c53b[_0x1693('0x4')]===null)_0x37c53b[_0x1693('0x4')]=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 bf14c0c..582a126 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 _0xb955=['length','./user-setting.events','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb955,0x81));var _0x5b95=function(_0x320a32,_0x5aa00e){_0x320a32=_0x320a32-0x0;var _0x1e1293=_0xb955[_0x320a32];return _0x1e1293;};'use strict';var UserSettingEvents=require(_0x5b95('0x0'));var events=['save','remove',_0x5b95('0x1')];function createListener(_0x300370,_0x4d01b5){return function(_0x3abb26){_0x4d01b5[_0x5b95('0x2')](_0x300370,_0x3abb26);if(_0x300370===_0x5b95('0x3')){_0x4d01b5['emit'](_0x5b95('0x4')+_0x3abb26[_0x5b95('0x5')],_0x3abb26);}};}exports[_0x5b95('0x6')]=function(_0xd5f32a){for(var _0x78cfd0=0x0,_0x3b9e98=events[_0x5b95('0x7')];_0x78cfd0<_0x3b9e98;_0x78cfd0++){var _0x197751=events[_0x78cfd0];var _0x25a4e3=createListener('user-setting:'+_0x197751,_0xd5f32a);UserSettingEvents['on'](_0x197751,_0x25a4e3);}}; \ No newline at end of file +var _0xd67c=['UserId','length','user-setting:','./user-setting.events','emit','user-setting:update:user-'];(function(_0x256ebb,_0x21ef58){var _0x48b70b=function(_0xdc9a9d){while(--_0xdc9a9d){_0x256ebb['push'](_0x256ebb['shift']());}};_0x48b70b(++_0x21ef58);}(_0xd67c,0x15f));var _0xcd67=function(_0x11a0b0,_0x13077c){_0x11a0b0=_0x11a0b0-0x0;var _0x1382e6=_0xd67c[_0x11a0b0];return _0x1382e6;};'use strict';var UserSettingEvents=require(_0xcd67('0x0'));var events=['save','remove','update'];function createListener(_0x1301f1,_0x36c060){return function(_0x2263e8){_0x36c060[_0xcd67('0x1')](_0x1301f1,_0x2263e8);if(_0x1301f1==='user-setting:update'){_0x36c060[_0xcd67('0x1')](_0xcd67('0x2')+_0x2263e8[_0xcd67('0x3')],_0x2263e8);}};}exports['register']=function(_0x367662){for(var _0x35ab4d=0x0,_0x357335=events[_0xcd67('0x4')];_0x35ab4d<_0x357335;_0x35ab4d++){var _0x28533a=events[_0x35ab4d];var _0x167742=createListener(_0xcd67('0x5')+_0x28533a,_0x367662);UserSettingEvents['on'](_0x28533a,_0x167742);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index a6726a1..f5a7f69 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 _0x4198=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','file','/:id/login','login','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','multer','path','connect-timeout','express','Router'];(function(_0x59ce3f,_0x3d288f){var _0x1fa60a=function(_0x2b5df0){while(--_0x2b5df0){_0x59ce3f['push'](_0x59ce3f['shift']());}};_0x1fa60a(++_0x3d288f);}(_0x4198,0x69));var _0x8419=function(_0x47661c,_0x5f6f0){_0x47661c=_0x47661c-0x0;var _0x1c6341=_0x4198[_0x47661c];return _0x1c6341;};'use strict';var multer=require(_0x8419('0x0'));var util=require('util');var path=require(_0x8419('0x1'));var timeout=require(_0x8419('0x2'));var express=require(_0x8419('0x3'));var router=express[_0x8419('0x4')]();var fs_extra=require(_0x8419('0x5'));var auth=require(_0x8419('0x6'));var interaction=require(_0x8419('0x7'));var config=require(_0x8419('0x8'));var controller=require(_0x8419('0x9'));router[_0x8419('0xa')]('/',auth['isAuthenticated'](),controller[_0x8419('0xb')]);router[_0x8419('0xa')](_0x8419('0xc'),auth[_0x8419('0xd')](),controller[_0x8419('0xe')]);router[_0x8419('0xa')](_0x8419('0xf'),auth[_0x8419('0xd')](),controller[_0x8419('0x10')]);router[_0x8419('0xa')](_0x8419('0x11'),auth[_0x8419('0xd')](),controller[_0x8419('0x12')]);router[_0x8419('0xa')](_0x8419('0x13'),auth['isAuthenticated'](),controller[_0x8419('0x14')]);router['get'](_0x8419('0x15'),controller[_0x8419('0x16')]);router[_0x8419('0xa')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x8419('0x17')]);router[_0x8419('0xa')]('/:id/contacts',auth[_0x8419('0xd')](),controller[_0x8419('0x18')]);router[_0x8419('0xa')](_0x8419('0x19'),auth[_0x8419('0xd')](),controller['getQueues']);router[_0x8419('0xa')](_0x8419('0x1a'),auth['isAuthenticated'](),controller[_0x8419('0x1b')]);router[_0x8419('0xa')](_0x8419('0x1c'),auth[_0x8419('0xd')](),controller[_0x8419('0x1d')]);router[_0x8419('0xa')](_0x8419('0x1e'),auth[_0x8419('0xd')](),controller[_0x8419('0x1f')]);router['get']('/:id/screen_recordings',auth[_0x8419('0xd')](),controller[_0x8419('0x20')]);router[_0x8419('0xa')](_0x8419('0x21'),auth[_0x8419('0xd')](),controller[_0x8419('0x22')]);router[_0x8419('0xa')](_0x8419('0x23'),auth[_0x8419('0xd')](),controller[_0x8419('0x24')]);router[_0x8419('0xa')]('/:id/mail/interactions',auth[_0x8419('0xd')](),controller[_0x8419('0x25')]);router[_0x8419('0xa')](_0x8419('0x26'),auth['isAuthenticated'](),controller[_0x8419('0x27')]);router['get']('/:id/fax/interactions',auth[_0x8419('0xd')](),controller[_0x8419('0x28')]);router[_0x8419('0xa')](_0x8419('0x29'),auth[_0x8419('0xd')](),controller['getWhatsappInteractions']);router[_0x8419('0xa')](_0x8419('0x2a'),auth[_0x8419('0xd')](),controller[_0x8419('0x2b')]);router[_0x8419('0xa')](_0x8419('0x2c'),auth[_0x8419('0xd')](),controller[_0x8419('0x2d')]);router[_0x8419('0xa')](_0x8419('0x2e'),auth[_0x8419('0xd')](),controller[_0x8419('0x2f')]);router[_0x8419('0xa')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x8419('0x30')]);router[_0x8419('0xa')](_0x8419('0x31'),auth[_0x8419('0xd')](),controller[_0x8419('0x32')]);router['get']('/:id/mail_accounts',auth[_0x8419('0xd')](),controller['getMailAccounts']);router[_0x8419('0xa')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x8419('0x33')]);router[_0x8419('0xa')]('/:id/sms_accounts',auth[_0x8419('0xd')](),controller['getSmsAccounts']);router['get'](_0x8419('0x34'),auth[_0x8419('0xd')](),controller[_0x8419('0x35')]);router['get'](_0x8419('0x36'),auth[_0x8419('0xd')](),controller[_0x8419('0x37')]);router[_0x8419('0xa')]('/:id/scheduled_calls',auth[_0x8419('0xd')](),controller[_0x8419('0x38')]);router[_0x8419('0xa')](_0x8419('0x39'),auth[_0x8419('0xd')](),controller[_0x8419('0x3a')]);router[_0x8419('0x3b')](_0x8419('0x3c'),auth[_0x8419('0xd')](),controller[_0x8419('0x3d')]);router[_0x8419('0x3b')]('/',auth[_0x8419('0xd')](),controller['create']);router['post'](_0x8419('0x3e'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x8419('0x3b')](_0x8419('0x19'),auth[_0x8419('0xd')](),controller[_0x8419('0x3f')]);var upload=multer({'storage':multer[_0x8419('0x40')]({'destination':function(_0x13c2f8,_0x3a3493,_0x2ea7de){_0x2ea7de(null,path[_0x8419('0x41')](config[_0x8419('0x42')],_0x8419('0x43')));},'filename':function(_0x135d12,_0x14b049,_0x26d063){_0x26d063(null,util['format'](_0x8419('0x44'),Date[_0x8419('0x45')](),_0x14b049['originalname']));}})});router[_0x8419('0x3b')](_0x8419('0x15'),upload['single'](_0x8419('0x46')),controller['addAvatar']);router[_0x8419('0x3b')](_0x8419('0x47'),auth[_0x8419('0xd')](),controller[_0x8419('0x48')]);router[_0x8419('0x3b')]('/:id/logout',auth[_0x8419('0xd')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0x8419('0x49')]);router[_0x8419('0x3b')](_0x8419('0x4a'),auth[_0x8419('0xd')](),controller[_0x8419('0x4b')]);router[_0x8419('0x3b')](_0x8419('0x2a'),auth['isAuthenticated'](),controller[_0x8419('0x4c')]);router[_0x8419('0x3b')](_0x8419('0x4d'),auth[_0x8419('0xd')](),controller['addChatInteractions']);router[_0x8419('0x3b')]('/:id/mail_interactions',auth[_0x8419('0xd')](),controller[_0x8419('0x4e')]);router[_0x8419('0x3b')](_0x8419('0x4f'),auth[_0x8419('0xd')](),controller[_0x8419('0x50')]);router[_0x8419('0x3b')](_0x8419('0x51'),auth[_0x8419('0xd')](),controller['addSmsInteractions']);router['post']('/:id/openchannel_interactions',auth[_0x8419('0xd')](),controller[_0x8419('0x52')]);router[_0x8419('0x3b')](_0x8419('0x53'),auth[_0x8419('0xd')](),controller[_0x8419('0x54')]);router[_0x8419('0x3b')](_0x8419('0x31'),auth[_0x8419('0xd')](),controller[_0x8419('0x55')]);router[_0x8419('0x3b')](_0x8419('0x56'),auth[_0x8419('0xd')](),controller[_0x8419('0x57')]);router[_0x8419('0x3b')]('/:id/openchannel_accounts',auth[_0x8419('0xd')](),controller[_0x8419('0x58')]);router[_0x8419('0x3b')](_0x8419('0x59'),auth[_0x8419('0xd')](),controller[_0x8419('0x5a')]);router['post'](_0x8419('0x34'),auth[_0x8419('0xd')](),controller['addChatWebsites']);router[_0x8419('0x3b')](_0x8419('0x36'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0x8419('0x39'),auth[_0x8419('0xd')](),controller['createApiKey']);router[_0x8419('0x5b')](_0x8419('0x13'),auth['isAuthenticated'](),controller[_0x8419('0x5c')]);router[_0x8419('0x5b')](_0x8419('0x5d'),auth[_0x8419('0xd')](),controller[_0x8419('0x5e')]);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0x8419('0x5f')]);router[_0x8419('0x60')](_0x8419('0x2a'),auth[_0x8419('0xd')](),controller[_0x8419('0x61')]);router['delete'](_0x8419('0x13'),auth[_0x8419('0xd')](),controller[_0x8419('0x62')]);router['delete'](_0x8419('0x4d'),auth['isAuthenticated'](),controller[_0x8419('0x63')]);router[_0x8419('0x60')](_0x8419('0x64'),auth[_0x8419('0xd')](),controller[_0x8419('0x65')]);router[_0x8419('0x60')](_0x8419('0x4f'),auth[_0x8419('0xd')](),controller[_0x8419('0x66')]);router[_0x8419('0x60')](_0x8419('0x51'),auth[_0x8419('0xd')](),controller[_0x8419('0x67')]);router[_0x8419('0x60')]('/:id/openchannel_interactions',auth[_0x8419('0xd')](),controller['removeOpenchannelInteractions']);router[_0x8419('0x60')](_0x8419('0x53'),auth[_0x8419('0xd')](),controller['removeWhatsappInteractions']);router['delete'](_0x8419('0x31'),auth[_0x8419('0xd')](),controller['removeFaxAccounts']);router['delete'](_0x8419('0x56'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x8419('0x60')](_0x8419('0x68'),auth['isAuthenticated'](),controller[_0x8419('0x69')]);router[_0x8419('0x60')](_0x8419('0x59'),auth[_0x8419('0xd')](),controller[_0x8419('0x6a')]);router[_0x8419('0x60')](_0x8419('0x34'),auth['isAuthenticated'](),controller[_0x8419('0x6b')]);router[_0x8419('0x60')](_0x8419('0x36'),auth['isAuthenticated'](),controller[_0x8419('0x6c')]);router[_0x8419('0x60')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8419('0x6d')]);module['exports']=router; \ No newline at end of file +var _0xc547=['logout','/:id/pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','getPresence','/:id','show','/:id/open_tabs','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/:id/queues','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout'];(function(_0x1207ba,_0x2e3b95){var _0x48b733=function(_0x566867){while(--_0x566867){_0x1207ba['push'](_0x1207ba['shift']());}};_0x48b733(++_0x2e3b95);}(_0xc547,0x153));var _0x7c54=function(_0x30b72b,_0x1844e2){_0x30b72b=_0x30b72b-0x0;var _0x23225e=_0xc547[_0x30b72b];return _0x23225e;};'use strict';var multer=require('multer');var util=require(_0x7c54('0x0'));var path=require('path');var timeout=require(_0x7c54('0x1'));var express=require('express');var router=express[_0x7c54('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7c54('0x3'));var config=require(_0x7c54('0x4'));var controller=require(_0x7c54('0x5'));router[_0x7c54('0x6')]('/',auth[_0x7c54('0x7')](),controller['index']);router['get'](_0x7c54('0x8'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x9')]);router[_0x7c54('0x6')]('/whoami',auth[_0x7c54('0x7')](),controller['whoami']);router[_0x7c54('0x6')]('/presence',auth[_0x7c54('0x7')](),controller[_0x7c54('0xa')]);router[_0x7c54('0x6')](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0xc')]);router[_0x7c54('0x6')]('/:id/avatar',controller['getAvatar']);router[_0x7c54('0x6')](_0x7c54('0xd'),auth[_0x7c54('0x7')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x7c54('0x7')](),controller['getContacts']);router[_0x7c54('0x6')]('/:id/queues',auth[_0x7c54('0x7')](),controller['getQueues']);router['get'](_0x7c54('0xe'),auth['isAuthenticated'](),controller[_0x7c54('0xf')]);router['get']('/:id/groups',auth[_0x7c54('0x7')](),controller[_0x7c54('0x10')]);router[_0x7c54('0x6')](_0x7c54('0x11'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x12')]);router[_0x7c54('0x6')]('/:id/screen_recordings',auth[_0x7c54('0x7')](),controller['getScreenRecordings']);router['get'](_0x7c54('0x13'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x14')]);router[_0x7c54('0x6')]('/:id/openchannel/interactions',auth[_0x7c54('0x7')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x15')]);router[_0x7c54('0x6')]('/:id/sms/interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x16')]);router[_0x7c54('0x6')](_0x7c54('0x17'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x7c54('0x6')](_0x7c54('0x18'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x7c54('0x7')](),controller['getTeams']);router[_0x7c54('0x6')]('/:id/lists',auth[_0x7c54('0x7')](),controller['getLists']);router[_0x7c54('0x6')](_0x7c54('0x19'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x1a')]);router[_0x7c54('0x6')](_0x7c54('0x1b'),auth[_0x7c54('0x7')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7c54('0x1c')]);router[_0x7c54('0x6')](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x1e')]);router['get'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x20')]);router[_0x7c54('0x6')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x22')]);router[_0x7c54('0x6')]('/:id/chat_websites',auth[_0x7c54('0x7')](),controller[_0x7c54('0x23')]);router[_0x7c54('0x6')](_0x7c54('0x24'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x25')]);router[_0x7c54('0x6')]('/:id/scheduled_calls',auth[_0x7c54('0x7')](),controller[_0x7c54('0x26')]);router[_0x7c54('0x6')](_0x7c54('0x27'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x7c54('0x28')](_0x7c54('0x29'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x2a')]);router[_0x7c54('0x28')]('/',auth['isAuthenticated'](),controller[_0x7c54('0x2b')]);router[_0x7c54('0x28')]('/create_many',auth[_0x7c54('0x7')](),controller['bulkCreate']);router[_0x7c54('0x28')](_0x7c54('0x2c'),auth[_0x7c54('0x7')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b429b,_0x354a5a,_0x508034){_0x508034(null,path['join'](config[_0x7c54('0x2d')],_0x7c54('0x2e')));},'filename':function(_0x4804cb,_0x528da9,_0x16c3aa){_0x16c3aa(null,util[_0x7c54('0x2f')](_0x7c54('0x30'),Date['now'](),_0x528da9[_0x7c54('0x31')]));}})});router['post'](_0x7c54('0x32'),upload[_0x7c54('0x33')](_0x7c54('0x34')),controller[_0x7c54('0x35')]);router[_0x7c54('0x28')](_0x7c54('0x36'),auth['isAuthenticated'](),controller[_0x7c54('0x37')]);router[_0x7c54('0x28')](_0x7c54('0x38'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x39')]);router[_0x7c54('0x28')](_0x7c54('0x3a'),auth[_0x7c54('0x7')](),controller['pause']);router['post'](_0x7c54('0x3b'),auth['isAuthenticated'](),controller[_0x7c54('0x3c')]);router[_0x7c54('0x28')]('/:id/teams',auth[_0x7c54('0x7')](),controller['addTeams']);router['post'](_0x7c54('0x3d'),auth['isAuthenticated'](),controller[_0x7c54('0x3e')]);router[_0x7c54('0x28')](_0x7c54('0x3f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x40')]);router[_0x7c54('0x28')]('/:id/fax_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x41')]);router[_0x7c54('0x28')](_0x7c54('0x42'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x7c54('0x28')](_0x7c54('0x43'),auth['isAuthenticated'](),controller[_0x7c54('0x44')]);router[_0x7c54('0x28')](_0x7c54('0x45'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x46')]);router[_0x7c54('0x28')](_0x7c54('0x47'),auth[_0x7c54('0x7')](),controller['addFaxAccounts']);router['post'](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x48')]);router['post'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller['addOpenchannelAccounts']);router[_0x7c54('0x28')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x49')]);router[_0x7c54('0x28')](_0x7c54('0x4a'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x4b')]);router[_0x7c54('0x28')](_0x7c54('0x24'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x7c54('0x28')](_0x7c54('0x27'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x4c')]);router[_0x7c54('0x4d')](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0x4e')]);router[_0x7c54('0x4d')](_0x7c54('0x4f'),auth['isAuthenticated'](),controller[_0x7c54('0x50')]);router[_0x7c54('0x51')](_0x7c54('0x2c'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x52')]);router['delete'](_0x7c54('0x53'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x54')]);router['delete'](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0x55')]);router[_0x7c54('0x51')](_0x7c54('0x3d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x56')]);router[_0x7c54('0x51')](_0x7c54('0x3f'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x7c54('0x51')](_0x7c54('0x57'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x58')]);router[_0x7c54('0x51')](_0x7c54('0x42'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x59')]);router['delete']('/:id/openchannel_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x5a')]);router[_0x7c54('0x51')]('/:id/whatsapp_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x5b')]);router[_0x7c54('0x51')](_0x7c54('0x47'),auth[_0x7c54('0x7')](),controller['removeFaxAccounts']);router[_0x7c54('0x51')](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5c')]);router['delete'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5d')]);router[_0x7c54('0x51')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5e')]);router[_0x7c54('0x51')](_0x7c54('0x4a'),auth['isAuthenticated'](),controller[_0x7c54('0x5f')]);router[_0x7c54('0x51')](_0x7c54('0x24'),auth['isAuthenticated'](),controller[_0x7c54('0x60')]);router[_0x7c54('0x51')](_0x7c54('0x27'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x61')]);module[_0x7c54('0x62')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 471a204..bbc03b1 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x108fca,_0x50d8b4){var _0x4dc09b=function(_0x1a1736){while(--_0x1a1736){_0x108fca['push'](_0x108fca['shift']());}};_0x4dc09b(++_0x50d8b4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xcb91[_0x1b64dd];return _0xeb464c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x418499,_0xaaf338){var _0x46a581=function(_0x3e6a42){while(--_0x3e6a42){_0x418499['push'](_0x418499['shift']());}};_0x46a581(++_0xaaf338);}(_0x34e8,0x12c));var _0x834e=function(_0x2090aa,_0x52b447){_0x2090aa=_0x2090aa-0x0;var _0x30d93c=_0x34e8[_0x2090aa];return _0x30d93c;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'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 20fd34d..62617a6 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 _0xdcd0=['CmHopper','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','firstName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','QueryTypes','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','socket.io-emitter','redis','register','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Agents','Telephones','telephone','ignore','map','value','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','filter','includes','password','salt','getOptions','where','User','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','chat','dataValues','sms','fax','mail','openchannel','whatsapp','params','model','differenceBy','keys','length','merge','all','body','describe','addContacts','ids','omit','internal','Setting','validatePasswordPattern','max','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','113','105','106','107','108','109','100','111','114','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','VoiceMail','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','isEmpty','compact','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','ValidationError','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','penalty','spread','toLowerCase','QueueId','Queue:save','voice','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WHATSAPP','getContacts','findOne','intersection','fields','order','sort','filters','pick','options','CmList','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','Queue','Queues','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','pause','QueuePause','updateAttributes','getChannels','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','smsPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','addAgent','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','removeAgent','Voice','getLists','getAgents','values','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','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdcd0,0x1d3));var _0x0dcd=function(_0x11a16c,_0x135f19){_0x11a16c=_0x11a16c-0x0;var _0x56a779=_0xdcd0[_0x11a16c];return _0x56a779;};'use strict';var moment=require(_0x0dcd('0x0'));var util=require('util');var path=require(_0x0dcd('0x1'));var fs=require('fs');var _=require(_0x0dcd('0x2'));var squel=require(_0x0dcd('0x3'));var jayson=require(_0x0dcd('0x4'));var Redis=require(_0x0dcd('0x5'));var authService=require(_0x0dcd('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0dcd('0x7'));var utils=require(_0x0dcd('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0x0dcd('0x9'));var APIBadRequestError=require(_0x0dcd('0xa'))[_0x0dcd('0xb')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x0dcd('0xa'))[_0x0dcd('0xc')];var db=require(_0x0dcd('0xd'))['db'];var socket=require(_0x0dcd('0xe'))(new Redis(config[_0x0dcd('0xf')]));require('./user.socket')[_0x0dcd('0x10')](socket);config[_0x0dcd('0xf')]=_['defaults'](config[_0x0dcd('0xf')],{'host':_0x0dcd('0x11'),'port':0x18eb});var amiClient=jayson[_0x0dcd('0x12')][_0x0dcd('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5483ad,_0x410e12,_0x5b921c,_0x1cda21){return new Promise(function(_0x4ec609,_0x5d7ee3){var _0xc3faac=_0x1cda21||amiClient;return _0xc3faac[_0x0dcd('0x14')](_0x5483ad,_0x5b921c)[_0x0dcd('0x15')](function(_0x380cf5){logger[_0x0dcd('0x16')](_0x0dcd('0x17'),_0x410e12,_0x0dcd('0x18'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x410e12,'request\x20sent',JSON[_0x0dcd('0x19')](_0x380cf5));if(_0x380cf5['error']){if(_0x380cf5[_0x0dcd('0x1a')][_0x0dcd('0x1b')]===0x1f4){logger[_0x0dcd('0x1a')]('User,\x20%s,\x20%s',_0x410e12,_0x380cf5['error'][_0x0dcd('0x1c')]);return _0x5d7ee3(_0x380cf5[_0x0dcd('0x1a')]['message']);}logger[_0x0dcd('0x1a')](_0x0dcd('0x17'),_0x410e12,_0x380cf5[_0x0dcd('0x1a')]['message']);return _0x4ec609(_0x380cf5['error'][_0x0dcd('0x1c')]);}else{logger[_0x0dcd('0x16')](_0x0dcd('0x17'),_0x410e12,_0x0dcd('0x18'));_0x4ec609(_0x380cf5[_0x0dcd('0x1d')]['message']);}})[_0x0dcd('0x1e')](function(_0x4ddce4){logger[_0x0dcd('0x1a')](_0x0dcd('0x17'),_0x410e12,_0x4ddce4);_0x5d7ee3(_0x4ddce4);});});}function respondWithStatusCode(_0x312e55,_0x25a42f){_0x25a42f=_0x25a42f||0xcc;return function(_0x3522a3){if(_0x3522a3){return _0x312e55[_0x0dcd('0x1f')](_0x25a42f);}return _0x312e55[_0x0dcd('0x20')](_0x25a42f)[_0x0dcd('0x21')]();};}function respondWithResult(_0x8aba0f,_0x341764){_0x341764=_0x341764||0xc8;return function(_0x551385){if(_0x551385){return _0x8aba0f[_0x0dcd('0x20')](_0x341764)[_0x0dcd('0x22')](_0x551385);}};}function respondWithFilteredResult(_0x185793,_0x1f8ef5){return function(_0x2bffcb){if(_0x2bffcb){var _0x414e7e=typeof _0x1f8ef5['offset']===_0x0dcd('0x23')&&typeof _0x1f8ef5[_0x0dcd('0x24')]===_0x0dcd('0x23');var _0xaec361=_0x2bffcb[_0x0dcd('0x25')];var _0x18f7ec=_0x414e7e?0x0:_0x1f8ef5[_0x0dcd('0x26')];var _0x4a48c1=_0x414e7e?_0x2bffcb[_0x0dcd('0x25')]:_0x1f8ef5[_0x0dcd('0x26')]+_0x1f8ef5[_0x0dcd('0x24')];var _0x91f327;if(_0x4a48c1>=_0xaec361){_0x4a48c1=_0xaec361;_0x91f327=0xc8;}else{_0x91f327=0xce;}_0x185793[_0x0dcd('0x20')](_0x91f327);return _0x185793[_0x0dcd('0x27')](_0x0dcd('0x28'),_0x18f7ec+'-'+_0x4a48c1+'/'+_0xaec361)[_0x0dcd('0x22')](_0x2bffcb);}return null;};}function saveUpdates(_0x8064de){return function(_0x3d2890){if(_0x3d2890){return _0x3d2890[_0x0dcd('0x29')](_0x8064de)['then'](function(_0x5b88bc){if(_0x5b88bc[_0x0dcd('0x2a')]===_0x0dcd('0x2b')){socket[_0x0dcd('0x2c')](_0x0dcd('0x2d')+_0x5b88bc['id'],_0x5b88bc);}return _0x5b88bc;});}return null;};}function removeEntity(_0x1c8174){return function(_0x58d85a){if(_0x58d85a){return _0x58d85a[_0x0dcd('0x2e')]()[_0x0dcd('0x15')](function(){var _0x167c17=_0x58d85a[_0x0dcd('0x2f')]({'plain':!![]});if(_0x167c17['role']===_0x0dcd('0x30'))return;var _0x51fa49=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x0dcd('0x31'),'value':_0x0dcd('0x2b'),'ignore':![]},{'name':_0x0dcd('0x32'),'value':_0x0dcd('0x33'),'ignore':![]}];var _0x47bea8=_(_0x51fa49)['filter'](_0x0dcd('0x34'))[_0x0dcd('0x35')](_0x0dcd('0x36'))[_0x0dcd('0x36')]();if(_['includes'](_0x47bea8,_0x167c17[_0x0dcd('0x2a')])){return;}var _0x3164c4=_[_0x0dcd('0x37')](_0x51fa49,[_0x0dcd('0x36'),_0x167c17['role']])['name'];return db[_0x0dcd('0x38')][_0x0dcd('0x2e')]({'where':{'type':_0x3164c4,'resourceId':_0x167c17['id']}})[_0x0dcd('0x15')](function(){return _0x58d85a;});})['then'](function(){_0x1c8174['status'](0xcc)[_0x0dcd('0x21')]();});}};}function handleEntityNotFound(_0x3f3b0c){return function(_0x415580){if(!_0x415580){_0x3f3b0c[_0x0dcd('0x1f')](0x194);}return _0x415580;};}function handleError(_0x37023e,_0x4dcc3c){_0x4dcc3c=_0x4dcc3c||0x1f4;return function(_0x1bdab2){logger[_0x0dcd('0x1a')](_0x1bdab2[_0x0dcd('0x39')]);if(_0x1bdab2[_0x0dcd('0x3a')]){delete _0x1bdab2[_0x0dcd('0x3a')];}_0x37023e[_0x0dcd('0x20')](_0x4dcc3c)[_0x0dcd('0x3b')](_0x1bdab2);};}exports[_0x0dcd('0x3c')]=function(_0x4e83e9,_0x24529b){var _0x10e8de={},_0x2edfa0={'count':0x0,'rows':[]};var _0x16c568=_(db['User'][_0x0dcd('0x3d')])[_0x0dcd('0x35')](function(_0x58a850){return{'name':_0x58a850[_0x0dcd('0x3e')],'type':_0x58a850[_0x0dcd('0x3f')][_0x0dcd('0x40')]};})[_0x0dcd('0x41')](function(_0x1bce8d){return!_[_0x0dcd('0x42')]([_0x0dcd('0x43'),_0x0dcd('0x44')],_0x1bce8d['name']);})[_0x0dcd('0x36')]();_0x10e8de=qs[_0x0dcd('0x45')](_0x16c568,_0x4e83e9);var _0x588619={'where':_0x10e8de[_0x0dcd('0x46')]};return db[_0x0dcd('0x47')][_0x0dcd('0x25')](_0x588619)[_0x0dcd('0x15')](function(_0x97e979){_0x2edfa0[_0x0dcd('0x25')]=_0x97e979;if(_0x4e83e9[_0x0dcd('0x48')][_0x0dcd('0x49')]){_0x10e8de[_0x0dcd('0x4a')]=[{'all':!![]}];}if(_0x4e83e9[_0x0dcd('0x48')][_0x0dcd('0x4b')]===_0x0dcd('0x4c')){_0x10e8de[_0x0dcd('0x4a')]=[{'model':db[_0x0dcd('0x4d')],'as':_0x0dcd('0x4b')}];}if(!_[_0x0dcd('0x42')](_0x10e8de[_0x0dcd('0x4e')],'id')){_0x10e8de[_0x0dcd('0x4e')][_0x0dcd('0x4f')]('id');}return db[_0x0dcd('0x47')][_0x0dcd('0x50')](_0x10e8de);})[_0x0dcd('0x15')](function(_0x1fe2e0){_0x2edfa0[_0x0dcd('0x51')]=_0x1fe2e0;if(_0x4e83e9[_0x0dcd('0x48')]['openTabs']===_0x0dcd('0x4c')){var _0x3cf3cb=[];for(var _0x13bcae=0x0;_0x13bcae<_0x2edfa0[_0x0dcd('0x51')]['length'];_0x13bcae++){_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x52'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae][_0x0dcd('0x53')]));_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x54'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae][_0x0dcd('0x53')]));_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x55'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae][_0x0dcd('0x53')]));_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x56'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae][_0x0dcd('0x53')]));_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x57'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae][_0x0dcd('0x53')]));_0x3cf3cb[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x58'),_0x2edfa0[_0x0dcd('0x51')][_0x13bcae]['dataValues']));}return Promise['all'](_0x3cf3cb)[_0x0dcd('0x15')](function(){return _0x2edfa0;});}else{return _0x2edfa0;}})['then'](respondWithFilteredResult(_0x24529b,_0x10e8de))[_0x0dcd('0x1e')](handleError(_0x24529b,null));};exports['show']=function(_0x1fb007,_0x515676){var _0x2724e2={'raw':![],'where':{'id':_0x1fb007[_0x0dcd('0x59')]['id']}},_0x1df07d={};_0x1df07d[_0x0dcd('0x5a')]=_[_0x0dcd('0x5b')](_[_0x0dcd('0x5c')](db[_0x0dcd('0x47')][_0x0dcd('0x3d')]),[_0x0dcd('0x43'),_0x0dcd('0x44')]);_0x1df07d[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x1fb007['query']);_0x1df07d['filters']=_['intersection'](_0x1df07d[_0x0dcd('0x5a')],_0x1df07d[_0x0dcd('0x48')]);_0x2724e2[_0x0dcd('0x4e')]=_['intersection'](_0x1df07d[_0x0dcd('0x5a')],qs['fields'](_0x1fb007[_0x0dcd('0x48')]['fields']));_0x2724e2['attributes']=_0x2724e2[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x2724e2[_0x0dcd('0x4e')]:_0x1df07d[_0x0dcd('0x5a')];if(_0x1fb007['query'][_0x0dcd('0x49')]){_0x2724e2['include']=[{'all':!![]}];}if(_0x1fb007[_0x0dcd('0x48')][_0x0dcd('0x4b')]===_0x0dcd('0x4c')){_0x2724e2[_0x0dcd('0x4a')]=[{'model':db[_0x0dcd('0x4d')],'as':_0x0dcd('0x4b')}];}_0x2724e2=_[_0x0dcd('0x5e')]({},_0x2724e2,_0x1fb007['options']);if(!_[_0x0dcd('0x42')](_0x2724e2[_0x0dcd('0x4e')],'id')){_0x2724e2[_0x0dcd('0x4e')][_0x0dcd('0x4f')]('id');}return db[_0x0dcd('0x47')][_0x0dcd('0x37')](_0x2724e2)[_0x0dcd('0x15')](handleEntityNotFound(_0x515676,null))[_0x0dcd('0x15')](function(_0x4db00b){var _0x33f537=[];values=_0x4db00b;if(_0x1fb007[_0x0dcd('0x48')]['openTabs']==='true'){_0x33f537[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x52'),_0x4db00b[_0x0dcd('0x53')]));_0x33f537[_0x0dcd('0x4f')](get_open_tabs('sms',_0x4db00b[_0x0dcd('0x53')]));_0x33f537[_0x0dcd('0x4f')](get_open_tabs('openchannel',_0x4db00b[_0x0dcd('0x53')]));_0x33f537[_0x0dcd('0x4f')](get_open_tabs('whatsapp',_0x4db00b[_0x0dcd('0x53')]));_0x33f537[_0x0dcd('0x4f')](get_open_tabs('fax',_0x4db00b[_0x0dcd('0x53')]));_0x33f537[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x56'),_0x4db00b['dataValues']));return Promise[_0x0dcd('0x5f')](_0x33f537);}else{return values;}})[_0x0dcd('0x15')](function(){return values;})[_0x0dcd('0x15')](respondWithResult(_0x515676,null))[_0x0dcd('0x1e')](handleError(_0x515676,null));};exports[_0x0dcd('0x29')]=function(_0x2aaa25,_0x42ca2c){if(_0x2aaa25[_0x0dcd('0x60')]['id']){delete _0x2aaa25[_0x0dcd('0x60')]['id'];}delete _0x2aaa25['body'][_0x0dcd('0x2a')];return db['User']['find']({'where':{'id':_0x2aaa25[_0x0dcd('0x59')]['id']}})['then'](handleEntityNotFound(_0x42ca2c,null))[_0x0dcd('0x15')](saveUpdates(_0x2aaa25[_0x0dcd('0x60')],null))[_0x0dcd('0x15')](respondWithResult(_0x42ca2c,null))[_0x0dcd('0x1e')](handleError(_0x42ca2c,null));};exports[_0x0dcd('0x61')]=function(_0x69d9b1,_0x5e4f80){return db[_0x0dcd('0x47')][_0x0dcd('0x61')]()['then'](respondWithResult(_0x5e4f80,null))['catch'](handleError(_0x5e4f80,null));};exports['addContacts']=function(_0x38f88c,_0x3e6540){return db['User'][_0x0dcd('0x37')]({'where':{'id':_0x38f88c[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x3e6540,null))[_0x0dcd('0x15')](function(_0x3d8534){if(_0x3d8534){return _0x3d8534[_0x0dcd('0x62')](_0x38f88c[_0x0dcd('0x60')][_0x0dcd('0x63')],_[_0x0dcd('0x64')](_0x38f88c[_0x0dcd('0x60')],[_0x0dcd('0x63'),'id'])||{});}})['then'](respondWithResult(_0x3e6540,null))[_0x0dcd('0x1e')](handleError(_0x3e6540,null));};function validateUser(_0x1245e2){return new Promise(function(_0x28dc8a,_0x36d515){if(_0x1245e2[_0x0dcd('0x65')])return _0x28dc8a(_0x1245e2);return db[_0x0dcd('0x66')]['findById'](0x1)[_0x0dcd('0x15')](function(_0x3638ff){if(_0x3638ff['securePassword'])authService[_0x0dcd('0x67')](_0x1245e2['password']);db[_0x0dcd('0x47')][_0x0dcd('0x68')](_0x0dcd('0x65'))[_0x0dcd('0x15')](function(_0x242518){if(_[_0x0dcd('0x69')](_0x242518)){_0x1245e2['internal']=_0x3638ff['min_internal']||0x1;return;}if(_[_0x0dcd('0x69')](_0x3638ff[_0x0dcd('0x6a')])||_0x3638ff[_0x0dcd('0x6a')]===_0x242518){_0x1245e2['internal']=_0x242518+0x1;return;}if(_0x3638ff['min_internal']>_0x242518){_0x1245e2['internal']=_0x3638ff[_0x0dcd('0x6a')];return;}return db[_0x0dcd('0x6b')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x0dcd('0x6b')]['QueryTypes'][_0x0dcd('0x6c')]})[_0x0dcd('0x15')](function(_0x5f3feb){if(_0x5f3feb&&_0x5f3feb[_0x0dcd('0x5d')]){for(var _0x15ed89=0x0,_0x2699d9=_0x5f3feb['length'];_0x15ed89<_0x2699d9&&_['isNil'](_0x1245e2[_0x0dcd('0x65')]);_0x15ed89++){if(_0x3638ff['min_internal']<=_0x5f3feb[_0x15ed89][_0x0dcd('0x6d')]){_0x1245e2[_0x0dcd('0x65')]=_0x5f3feb[_0x15ed89][_0x0dcd('0x6d')];}else if(_0x3638ff['min_internal']>_0x5f3feb[_0x15ed89][_0x0dcd('0x6d')]&&_0x3638ff[_0x0dcd('0x6a')]<=_0x5f3feb[_0x15ed89]['to']){_0x1245e2['internal']=_0x3638ff[_0x0dcd('0x6a')];}}}if(_['isNil'](_0x1245e2[_0x0dcd('0x65')])){_0x1245e2['internal']=_0x242518+0x1;}return _0x28dc8a(_0x1245e2);});});})[_0x0dcd('0x1e')](function(_0x21e295){_0x36d515(_0x21e295);});});}function updateUser(_0x30cc1a){return new Promise(function(_0x7ff263,_0x2886c7){try{if(_0x30cc1a[_0x0dcd('0x6e')]){_0x30cc1a[_0x0dcd('0x6f')]=_0x30cc1a['internal'];_0x30cc1a['VoiceMail']={'mailbox':_0x30cc1a['internal'],'password':_0x30cc1a[_0x0dcd('0x43')],'fullname':_0x30cc1a[_0x0dcd('0x70')],'email':_0x30cc1a['email']};}if(_0x30cc1a['role']==='agent'){if(!_0x30cc1a[_0x0dcd('0x71')])_0x30cc1a[_0x0dcd('0x71')]=[_0x0dcd('0x72'),_0x0dcd('0x73'),_0x0dcd('0x74'),_0x0dcd('0x75'),'110','104',_0x0dcd('0x76'),_0x0dcd('0x77'),_0x0dcd('0x78'),_0x0dcd('0x79'),_0x0dcd('0x7a'),_0x0dcd('0x7b'),_0x0dcd('0x7c'),_0x0dcd('0x7d'),_0x0dcd('0x7e')];}_0x7ff263(_0x30cc1a);}catch(_0x280aff){_0x2886c7(_0x280aff);}});}exports[_0x0dcd('0x7f')]=function(_0xccd5dd,_0x5b8ab4){if(_0xccd5dd[_0x0dcd('0x80')][_0x0dcd('0x2a')]==='agent')throw new Error(_0x0dcd('0x81'));if(_0xccd5dd[_0x0dcd('0x60')][_0x0dcd('0x2a')]===_0x0dcd('0x80')&&_0xccd5dd[_0x0dcd('0x80')][_0x0dcd('0x2a')]!==_0x0dcd('0x30')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xccd5dd[_0x0dcd('0x60')][_0x0dcd('0x2a')]===_0x0dcd('0x30')&&_0xccd5dd[_0x0dcd('0x80')][_0x0dcd('0x2a')]!==_0x0dcd('0x30')){throw new Error(_0x0dcd('0x82'));}return licenseUtil['checkUserLimits']([_0xccd5dd[_0x0dcd('0x60')]])['then'](function(){return validateUser(_0xccd5dd[_0x0dcd('0x60')]);})['then'](function(_0x26c171){return updateUser(_0x26c171)[_0x0dcd('0x15')](function(_0x518705){if(_0x518705[_0x0dcd('0x2a')]===_0x0dcd('0x30')){_0x518705[_0x0dcd('0x83')]=_0xccd5dd['user'][_0x0dcd('0x83')];delete _0x518705[_0x0dcd('0x84')];}return _0x518705;});})[_0x0dcd('0x15')](function(_0x567986){return db[_0x0dcd('0x47')][_0x0dcd('0x7f')](_0x567986,{'include':[{'model':db[_0x0dcd('0x85')],'as':_0x0dcd('0x85')}]});})[_0x0dcd('0x15')](function(_0x1e3ee1){if(_0xccd5dd[_0x0dcd('0x60')][_0x0dcd('0x2a')]===_0x0dcd('0x80'))return _0x1e3ee1;if(_0xccd5dd['user'][_0x0dcd('0x2a')]!==_0x0dcd('0x80'))return _0x1e3ee1;return db['UserProfileSection'][_0x0dcd('0x37')]({'where':{'name':_0x1e3ee1[_0x0dcd('0x2a')]===_0x0dcd('0x2b')?'Agents':_0x0dcd('0x32'),'userProfileId':_0xccd5dd[_0x0dcd('0x80')][_0x0dcd('0x84')]},'raw':!![]})[_0x0dcd('0x15')](function(_0x3ae750){if(!_0x3ae750||_0x3ae750[_0x0dcd('0x86')]!=0x0)return _0x1e3ee1;return db[_0x0dcd('0x38')][_0x0dcd('0x7f')]({'name':_0x1e3ee1['name'],'resourceId':_0x1e3ee1['id'],'type':_0x3ae750[_0x0dcd('0x3a')],'sectionId':_0x3ae750['id']},{})[_0x0dcd('0x15')](function(){return _0x1e3ee1;});})['catch'](function(_0x305eea){logger[_0x0dcd('0x1a')](_0x0dcd('0x87'),_0x305eea);throw _0x305eea;});})[_0x0dcd('0x15')](respondWithResult(_0x5b8ab4,0xc9))[_0x0dcd('0x1e')](handleError(_0x5b8ab4,null));};exports[_0x0dcd('0x88')]=function(_0x5281d4,_0xeb6537){var _0x240978=_0x5281d4[_0x0dcd('0x60')];var _0x59b412=[];if(_0x5281d4['user']['role']==='agent')throw new Error('Unauthorized');if(_[_0x0dcd('0x89')](_0x240978,[_0x0dcd('0x2a'),_0x0dcd('0x80')])&&_0x5281d4[_0x0dcd('0x80')]['role']!=='admin'){throw new Error(_0x0dcd('0x8a'));}if(_[_0x0dcd('0x89')](_0x240978,[_0x0dcd('0x2a'),_0x0dcd('0x30')])&&_0x5281d4[_0x0dcd('0x80')][_0x0dcd('0x2a')]!==_0x0dcd('0x30')){throw new Error(_0x0dcd('0x8b'));}return licenseUtil[_0x0dcd('0x8c')](_0x240978)['then'](function(){return validateUser(_0x240978[0x0]);})[_0x0dcd('0x15')](function(){for(var _0x4af908=0x1;_0x4af908<_0x240978['length'];_0x4af908++){var _0x3e4d16=_0x240978[_0x4af908-0x1][_0x0dcd('0x65')];if(!_0x240978[_0x4af908]['internal'])_0x240978[_0x4af908][_0x0dcd('0x65')]=_0x3e4d16+0x1;_0x59b412[_0x0dcd('0x4f')](validateUser(_0x240978[_0x4af908]));}return Promise['all'](_0x59b412);})[_0x0dcd('0x15')](function(){_0x59b412=[];for(var _0x249ab0=0x0;_0x249ab0<_0x240978['length'];_0x249ab0++){_0x59b412[_0x0dcd('0x4f')](updateUser(_0x240978[_0x249ab0]));}return Promise[_0x0dcd('0x5f')](_0x59b412);})[_0x0dcd('0x15')](function(){_0x59b412=_0x240978[_0x0dcd('0x35')](function(_0x376a2e){return db[_0x0dcd('0x47')]['create'](_0x376a2e,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x0dcd('0x15')](function(_0x45db12){_0x376a2e['id']=_0x45db12['id'];return _0x376a2e;});});return Promise[_0x0dcd('0x5f')](_0x59b412);})['then'](function(_0x4e855d){if(_0x5281d4[_0x0dcd('0x60')]['role']===_0x0dcd('0x80'))return _0x4e855d;if(_0x5281d4[_0x0dcd('0x80')][_0x0dcd('0x2a')]!=='user')return _0x4e855d;var _0x3a71c7=_[_0x0dcd('0x89')](_0x4e855d,function(_0x116525){return _0x116525[_0x0dcd('0x2a')]===_0x0dcd('0x2b')||_0x116525[_0x0dcd('0x2a')]===_0x0dcd('0x33');});if(!_0x3a71c7)return _0x4e855d;return db['UserProfileSection'][_0x0dcd('0x50')]({'where':{'name':{'$or':['Agents',_0x0dcd('0x32')]},'userProfileId':_0x5281d4[_0x0dcd('0x80')][_0x0dcd('0x84')]},'raw':!![]})[_0x0dcd('0x15')](function(_0x3c415a){if(_[_0x0dcd('0x8d')](_0x3c415a)||!_[_0x0dcd('0x89')](_0x3c415a,[_0x0dcd('0x86'),0x0]))return _0x4e855d;_0x59b412=[];var _0x2dfdec=_(_0x3c415a)[_0x0dcd('0x35')](function(_0xdcefc){if(_0xdcefc[_0x0dcd('0x86')]===0x1)return;return _0xdcefc[_0x0dcd('0x3a')]===_0x0dcd('0x31')?_0x0dcd('0x2b'):'telephone';})[_0x0dcd('0x8e')]()[_0x0dcd('0x36')]();for(var _0x58a147=0x0;_0x58a147<_0x4e855d[_0x0dcd('0x5d')];_0x58a147++){if(!_[_0x0dcd('0x42')](_0x2dfdec,_0x4e855d[_0x58a147][_0x0dcd('0x2a')]))return;var _0x2a2674=_0x4e855d[_0x58a147]['role']===_0x0dcd('0x2b')?'Agents':_0x0dcd('0x32');_0x59b412[_0x0dcd('0x4f')](db['UserProfileResource']['create']({'name':_0x4e855d[_0x58a147][_0x0dcd('0x3a')],'resourceId':_0x4e855d[_0x58a147]['id'],'type':_0x2a2674,'sectionId':_[_0x0dcd('0x37')](_0x3c415a,[_0x0dcd('0x3a'),_0x2a2674])['id']},{}));}return Promise[_0x0dcd('0x5f')](_0x59b412);});})[_0x0dcd('0x15')](respondWithResult(_0xeb6537,0xc9))[_0x0dcd('0x1e')](handleError(_0xeb6537,null));};exports[_0x0dcd('0x8f')]=function(_0x5cc7f1,_0x54dc8d){if(_0x5cc7f1[_0x0dcd('0x60')]['id']){delete _0x5cc7f1[_0x0dcd('0x60')]['id'];}return db[_0x0dcd('0x47')]['find']({'where':{'id':_0x5cc7f1[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](function(_0x34be03){if(!_0x34be03)return null;if(_0x34be03['id']===_0x5cc7f1[_0x0dcd('0x80')]['id']){if(!_0x5cc7f1[_0x0dcd('0x60')][_0x0dcd('0x90')]||!_0x5cc7f1[_0x0dcd('0x60')]['newPassword']){throw new db[(_0x0dcd('0x91'))]['ValidationError'](_0x0dcd('0x92'));}if(!_0x34be03['authenticate'](_0x5cc7f1[_0x0dcd('0x60')][_0x0dcd('0x90')])){throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))]('Wrong\x20credentials');}if(_0x5cc7f1['body'][_0x0dcd('0x90')]===_0x5cc7f1[_0x0dcd('0x60')][_0x0dcd('0x94')]){throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))](_0x0dcd('0x95'));}}else if(_0x5cc7f1['user']['role']===_0x0dcd('0x30')){if(!_0x5cc7f1[_0x0dcd('0x60')][_0x0dcd('0x94')]){throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))](_0x0dcd('0x96'));}}else if(_0x5cc7f1['user'][_0x0dcd('0x2a')]===_0x0dcd('0x80')){if(!_0x5cc7f1[_0x0dcd('0x60')][_0x0dcd('0x94')]){throw new db['Sequelize'][(_0x0dcd('0x93'))](_0x0dcd('0x96'));}if(_0x34be03[_0x0dcd('0x2a')]!==_0x0dcd('0x2b')){throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))](_0x0dcd('0x81'));}}else{throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))](_0x0dcd('0x81'));}return _0x34be03;})['then'](handleEntityNotFound(_0x54dc8d,null))[_0x0dcd('0x15')](function(_0x547e4e){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x0dcd('0x97'),_0x0dcd('0x98')]})[_0x0dcd('0x15')](function(_0xbf31ff){if(_0xbf31ff[_0x0dcd('0x99')])authService[_0x0dcd('0x67')](_0x5cc7f1[_0x0dcd('0x60')]['newPassword']);if(!_0xbf31ff['enforcePasswordHistory']||!_0x547e4e[_0x0dcd('0x9a')])return _0x547e4e;authService['validatePasswordHistory'](_0x5cc7f1['body'][_0x0dcd('0x94')],_0x547e4e['previousPasswords'],_0xbf31ff[_0x0dcd('0x98')]);return _0x547e4e;})[_0x0dcd('0x15')](saveUpdates({'password':_0x5cc7f1['body'][_0x0dcd('0x94')],'passwordResetAt':_0x5cc7f1['user']['id']==_0x5cc7f1[_0x0dcd('0x59')]['id']?moment():null,'previousPasswords':authService[_0x0dcd('0x9b')](_0x5cc7f1['body'][_0x0dcd('0x94')],_0x547e4e[_0x0dcd('0x9a')])},null));})['then'](respondWithResult(_0x54dc8d,null))[_0x0dcd('0x1e')](handleError(_0x54dc8d,null));};exports[_0x0dcd('0x9c')]=function(_0x4c7aff,_0x43881d){var _0x5a6283=_0x4c7aff['body'][_0x0dcd('0x9d')];return db['User'][_0x0dcd('0x37')]({'where':{'id':_0x4c7aff[_0x0dcd('0x59')]['id']},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0x2a'),_0x0dcd('0x9e'),_0x0dcd('0x9f'),_0x0dcd('0xa0'),_0x0dcd('0xa1')]})[_0x0dcd('0x15')](handleEntityNotFound(_0x43881d,null))['then'](function(_0x1e88ab){if(_0x1e88ab){if(!utils[_0x0dcd('0xa2')](_0x5a6283)){throw new db[(_0x0dcd('0x91'))]['ValidationError'](_0x0dcd('0xa3'));}return _0x1e88ab['add'+_[_0x0dcd('0xa4')](_0x5a6283['toLowerCase']())+'Queues'](_0x4c7aff[_0x0dcd('0x60')][_0x0dcd('0x63')],{'penalty':_0x4c7aff[_0x0dcd('0x60')][_0x0dcd('0xa5')]||0x0})[_0x0dcd('0xa6')](function(_0x393194){for(var _0x463d59=0x0;_0x463d59<_0x4c7aff[_0x0dcd('0x60')][_0x0dcd('0x63')][_0x0dcd('0x5d')];_0x463d59+=0x1){var _0x572bca={'UserId':Number(_0x4c7aff[_0x0dcd('0x59')]['id'])};_0x572bca[_['capitalize'](_0x5a6283[_0x0dcd('0xa7')]())+_0x0dcd('0xa8')]=Number(_0x4c7aff[_0x0dcd('0x60')][_0x0dcd('0x63')][_0x463d59]);socket['emit'](_0x0dcd('0x80')+_[_0x0dcd('0xa4')](_0x5a6283[_0x0dcd('0xa7')]())+_0x0dcd('0xa9'),_0x572bca);}return _0x393194;})[_0x0dcd('0x15')](function(){if(_0x5a6283===_0x0dcd('0xaa')){return db['VoiceQueue'][_0x0dcd('0x50')]({'where':{'id':_0x4c7aff[_0x0dcd('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0x0dcd('0x3a')]});}})['then'](function(_0x585085){var _0x53031f=_0x1e88ab[_0x0dcd('0x2f')]({'plain':!![]});var _0x4f2c2a=[];if(_0x5a6283==='voice'&&_0x53031f[_0x0dcd('0x2a')]===_0x0dcd('0x2b')&&_0x53031f['online']){for(let _0x151412=0x0;_0x151412<_0x585085['length'];_0x151412+=0x1){_0x4f2c2a['push']({'membername':_0x53031f[_0x0dcd('0x3a')],'UserId':_0x53031f['id'],'queue_name':_0x585085[_0x151412][_0x0dcd('0x3a')],'VoiceQueueId':_0x585085[_0x151412]['id'],'interface':_[_0x0dcd('0x69')](_0x53031f[_0x0dcd('0xa1')])?util[_0x0dcd('0xab')](_0x0dcd('0xac'),_0x53031f['name']):_0x53031f['interface'],'paused':_0x53031f['voicePause']||![],'penalty':_0x4c7aff[_0x0dcd('0x60')][_0x0dcd('0xa5')]||0x0});}return Promise['all'](_0x4f2c2a['map'](function(_0x4e6143){return db[_0x0dcd('0xad')][_0x0dcd('0xae')](_0x4e6143);}));}return _0x1e88ab;});}})['then'](respondWithStatusCode(_0x43881d,null))[_0x0dcd('0x1e')](handleError(_0x43881d,null));};exports[_0x0dcd('0xaf')]=function(_0x2eb986,_0x377edb){var _0x15d26f,_0x494f36;return db[_0x0dcd('0x47')][_0x0dcd('0x37')]({'where':{'id':_0x2eb986[_0x0dcd('0x59')]['id']},'attributes':['id','name',_0x0dcd('0x2a')]})[_0x0dcd('0x15')](handleEntityNotFound(_0x377edb,null))[_0x0dcd('0x15')](function(_0x3dfe3c){if(_0x3dfe3c){_0x15d26f=_0x3dfe3c;if(!_0x2eb986[_0x0dcd('0x48')]['channel']||!utils['isValidChannel'](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')])){throw new db['Sequelize'][(_0x0dcd('0x93'))]('Unknown\x20channel');}return _0x3dfe3c[_0x0dcd('0xb0')+_[_0x0dcd('0xa4')](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')][_0x0dcd('0xa7')]())+'Queues'](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x63')]);}})[_0x0dcd('0x15')](function(_0x313f8e){if(_[_0x0dcd('0xb1')](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x63')])){for(var _0x546369=0x0;_0x546369<_0x2eb986[_0x0dcd('0x48')]['ids'][_0x0dcd('0x5d')];_0x546369+=0x1){_0x494f36={'UserId':Number(_0x2eb986[_0x0dcd('0x59')]['id'])};_0x494f36[_['capitalize'](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')][_0x0dcd('0xa7')]())+_0x0dcd('0xa8')]=Number(_0x2eb986['query'][_0x0dcd('0x63')][_0x546369]);socket[_0x0dcd('0x2c')](_0x0dcd('0x80')+_[_0x0dcd('0xa4')](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')][_0x0dcd('0xa7')]())+_0x0dcd('0xb2'),_0x494f36);}}else{_0x494f36={'UserId':Number(_0x2eb986[_0x0dcd('0x59')]['id'])};_0x494f36[_[_0x0dcd('0xa4')](_0x2eb986['query'][_0x0dcd('0x9d')][_0x0dcd('0xa7')]())+_0x0dcd('0xa8')]=Number(_0x2eb986['query']['ids']);socket[_0x0dcd('0x2c')](_0x0dcd('0x80')+_['capitalize'](_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')][_0x0dcd('0xa7')]())+'Queue:remove',_0x494f36);}return _0x313f8e;})[_0x0dcd('0x15')](function(){if(_0x2eb986[_0x0dcd('0x48')][_0x0dcd('0x9d')]===_0x0dcd('0xaa')){return db[_0x0dcd('0xad')][_0x0dcd('0x2e')]({'where':{'UserId':_0x2eb986[_0x0dcd('0x59')]['id'],'VoiceQueueId':_0x2eb986[_0x0dcd('0x48')]['ids']},'individualHooks':!![]})['then'](function(){return _0x15d26f;});}return _0x15d26f;})[_0x0dcd('0x15')](respondWithStatusCode(_0x377edb,null))['catch'](handleError(_0x377edb,null));};exports[_0x0dcd('0xb3')]=function(_0x19e0a8,_0x1fd44a){_0x19e0a8[_0x0dcd('0x60')][_0x0dcd('0xb4')]=_0x19e0a8[_0x0dcd('0xb5')][_0x0dcd('0xb6')];return db[_0x0dcd('0x47')][_0x0dcd('0x37')]({'where':{'id':_0x19e0a8[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x1fd44a,null))[_0x0dcd('0x15')](saveUpdates(_0x19e0a8['body'],null))['then'](respondWithResult(_0x1fd44a,null))[_0x0dcd('0x1e')](handleError(_0x1fd44a,null));};exports[_0x0dcd('0xb7')]=function(_0x346a23,_0x391306){var _0x35664d=path[_0x0dcd('0xb8')](config['root'],_0x0dcd('0xb9'));return db[_0x0dcd('0x47')][_0x0dcd('0x37')]({'where':{'id':_0x346a23[_0x0dcd('0x59')]['id']},'attributes':['id',_0x0dcd('0xb4')],'raw':!![]})[_0x0dcd('0x15')](handleEntityNotFound(_0x391306,null))[_0x0dcd('0x15')](function(_0x2882ac){if(_0x2882ac){if(_[_0x0dcd('0x69')](_0x2882ac['userpic'])){return _0x391306[_0x0dcd('0xba')](_0x35664d);}else{if(!fs[_0x0dcd('0xbb')](path[_0x0dcd('0xb8')](config[_0x0dcd('0xbc')],_0x0dcd('0xbd'),_0x2882ac[_0x0dcd('0xb4')]))){return _0x391306['download'](_0x35664d);}return _0x391306[_0x0dcd('0xba')](path[_0x0dcd('0xb8')](config[_0x0dcd('0xbc')],_0x0dcd('0xbd'),_0x2882ac['userpic']));}}})[_0x0dcd('0x1e')](handleError(_0x391306,null));};exports[_0x0dcd('0xbe')]=function(_0x42810d,_0x28477f){return db[_0x0dcd('0x47')]['find']({'where':{'id':_0x42810d[_0x0dcd('0x59')]['id']},'attributes':['id']})[_0x0dcd('0x15')](handleEntityNotFound(_0x28477f,null))[_0x0dcd('0x15')](function(_0x1fa4f9){var _0x4fccb8=[];values=_0x1fa4f9[_0x0dcd('0x53')];_0x4fccb8[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x52'),_0x1fa4f9[_0x0dcd('0x53')]));_0x4fccb8[_0x0dcd('0x4f')](get_open_tabs('sms',_0x1fa4f9[_0x0dcd('0x53')]));_0x4fccb8[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x57'),_0x1fa4f9[_0x0dcd('0x53')]));_0x4fccb8[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x58'),_0x1fa4f9[_0x0dcd('0x53')]));_0x4fccb8[_0x0dcd('0x4f')](get_open_tabs(_0x0dcd('0x55'),_0x1fa4f9[_0x0dcd('0x53')]));_0x4fccb8['push'](get_open_tabs('mail',_0x1fa4f9['dataValues']));return Promise[_0x0dcd('0x5f')](_0x4fccb8);})[_0x0dcd('0x15')](function(_0xf285a1){if(_0xf285a1){var _0x2af959=_['map'](values[_0x0dcd('0xbf')],function(_0x47d7cc){return{'channel':'CHAT','id':_0x47d7cc['id'],'createdAt':_0x47d7cc[_0x0dcd('0xc0')]};});var _0x5b2698=_[_0x0dcd('0x35')](values['FaxOpenTabs'],function(_0x5607e6){return{'channel':_0x0dcd('0xc1'),'id':_0x5607e6['id'],'createdAt':_0x5607e6[_0x0dcd('0xc0')]};});var _0x47ee39=_[_0x0dcd('0x35')](values[_0x0dcd('0xc2')],function(_0x1ccd99){return{'channel':_0x0dcd('0xc3'),'id':_0x1ccd99['id'],'createdAt':_0x1ccd99[_0x0dcd('0xc0')]};});var _0x3dc918=_['map'](values[_0x0dcd('0xc4')],function(_0x5a46f1){return{'channel':_0x0dcd('0xc5'),'id':_0x5a46f1['id'],'createdAt':_0x5a46f1['createdAt']};});var _0x397928=_[_0x0dcd('0x35')](values['SmsOpenTabs'],function(_0x14a735){return{'channel':_0x0dcd('0xc6'),'id':_0x14a735['id'],'createdAt':_0x14a735['createdAt']};});var _0x1f5ceb=_[_0x0dcd('0x35')](values['WhatsappOpenTabs'],function(_0x5287b8){return{'channel':_0x0dcd('0xc7'),'id':_0x5287b8['id'],'createdAt':_0x5287b8[_0x0dcd('0xc0')]};});var _0x502e75=_['concat'](_0x2af959,_0x5b2698,_0x47ee39,_0x3dc918,_0x397928,_0x1f5ceb);var _0x3ae129={'count':_0x502e75[_0x0dcd('0x5d')],'rows':_0x502e75};return _0x3ae129;}else return null;})[_0x0dcd('0x15')](respondWithResult(_0x28477f,null))[_0x0dcd('0x1e')](handleError(_0x28477f,null));};exports[_0x0dcd('0xc8')]=function(_0x2d6911,_0xb7ef28){var _0xf4223f={};var _0x5dd958={};var _0x5e31b7;var _0x180012;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x2d6911[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0xb7ef28,null))[_0x0dcd('0x15')](function(_0x3589f8){if(_0x3589f8){_0x5e31b7=_0x3589f8;_0x5dd958[_0x0dcd('0x5a')]=_[_0x0dcd('0x5c')](db['CmContact']['rawAttributes']);_0x5dd958[_0x0dcd('0x48')]=_['keys'](_0x2d6911[_0x0dcd('0x48')]);_0x5dd958['filters']=_[_0x0dcd('0xca')](_0x5dd958[_0x0dcd('0x5a')],_0x5dd958[_0x0dcd('0x48')]);_0xf4223f[_0x0dcd('0x4e')]=_['intersection'](_0x5dd958[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x2d6911[_0x0dcd('0x48')]['fields']));_0xf4223f[_0x0dcd('0x4e')]=_0xf4223f['attributes'][_0x0dcd('0x5d')]?_0xf4223f[_0x0dcd('0x4e')]:_0x5dd958['model'];_0xf4223f[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x2d6911[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0xf4223f['where']=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x2d6911[_0x0dcd('0x48')],_0x5dd958[_0x0dcd('0xce')]));if(_0x2d6911[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0xf4223f[_0x0dcd('0x46')]=_['merge'](_0xf4223f['where'],{'$or':_[_0x0dcd('0x35')](_0xf4223f[_0x0dcd('0x4e')],function(_0x1bd964){var _0x36aa4b={};_0x36aa4b[_0x1bd964]={'$like':'%'+_0x2d6911['query'][_0x0dcd('0x41')]+'%'};return _0x36aa4b;})});}_0xf4223f=_['merge']({},_0xf4223f,_0x2d6911[_0x0dcd('0xd0')]);return _0x5e31b7[_0x0dcd('0xc8')](_0xf4223f);}})[_0x0dcd('0x15')](function(_0x2274b3){if(_0x2274b3){_0x180012=_0x2274b3[_0x0dcd('0x5d')];if(_0x2d6911[_0x0dcd('0x48')]['hasOwnProperty'](_0x0dcd('0x49'))){_0xf4223f[_0x0dcd('0x4a')]=[{'model':db[_0x0dcd('0xd1')],'as':'List','required':![]},{'model':db[_0x0dcd('0xd2')],'as':_0x0dcd('0xd3'),'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0xd4')],'where':_0x2d6911[_0x0dcd('0x48')][_0x0dcd('0xd5')]?{'id':_0x2d6911['query'][_0x0dcd('0xd5')]}:undefined,'required':_0x2d6911[_0x0dcd('0x48')]['tag']?!![]:![]}];}if(!_0x2d6911[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0xf4223f[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x2d6911['query'][_0x0dcd('0x24')]);_0xf4223f[_0x0dcd('0x26')]=qs['offset'](_0x2d6911[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x5e31b7[_0x0dcd('0xc8')](_0xf4223f);}})['then'](function(_0x1a838d){if(_0x1a838d){return _0x1a838d?{'count':_0x180012,'rows':_0x1a838d}:null;}})[_0x0dcd('0x15')](respondWithResult(_0xb7ef28,null))[_0x0dcd('0x1e')](handleError(_0xb7ef28,null));};exports[_0x0dcd('0xd8')]=function(_0x20e844,_0x384256){var _0x33e7d6;var _0x2131fd={};var _0x335e2;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x20e844['params']['id']},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0x2a')]})[_0x0dcd('0x15')](handleEntityNotFound(_0x384256,null))[_0x0dcd('0x15')](function(_0x4ed690){if(!utils[_0x0dcd('0xa2')](_0x20e844[_0x0dcd('0x48')][_0x0dcd('0x9d')])){throw new db['Sequelize'][(_0x0dcd('0x93'))](_0x0dcd('0xa3'));}_0x33e7d6=_0x4ed690;var _0x2f225b={};_0x2f225b[_0x0dcd('0x5a')]=_[_0x0dcd('0x5c')](db[_[_0x0dcd('0xa4')](_0x20e844[_0x0dcd('0x48')]['channel'])+_0x0dcd('0xd9')][_0x0dcd('0x3d')]);_0x2f225b[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x20e844[_0x0dcd('0x48')]);_0x2f225b[_0x0dcd('0xce')]=_['intersection'](_0x2f225b[_0x0dcd('0x5a')],_0x2f225b['query']);_0x2131fd[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x2f225b[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x20e844[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x2131fd[_0x0dcd('0x4e')]=_0x2131fd['attributes'][_0x0dcd('0x5d')]?_0x2131fd[_0x0dcd('0x4e')]:_0x2f225b[_0x0dcd('0x5a')];_0x2131fd[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x20e844[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x2131fd[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x20e844[_0x0dcd('0x48')],_0x2f225b['filters']));if(_0x20e844[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x2131fd[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x2131fd[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x2131fd[_0x0dcd('0x4e')],function(_0x4cc6d3){var _0x206dde={};_0x206dde[_0x4cc6d3]={'$like':'%'+_0x20e844[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x206dde;})});}_0x2131fd=_[_0x0dcd('0x5e')]({},_0x2131fd,_0x20e844['options']);switch(_0x33e7d6[_0x0dcd('0x2a')]){case'admin':return db[_['capitalize'](_0x20e844[_0x0dcd('0x48')]['channel'])+'Queue'][_0x0dcd('0x50')](_0x2131fd);case _0x0dcd('0x80'):case'agent':return _0x33e7d6[_0x0dcd('0x2f')+_[_0x0dcd('0xa4')](_0x20e844[_0x0dcd('0x48')][_0x0dcd('0x9d')])+_0x0dcd('0xda')](_0x2131fd);default:throw new db['Sequelize'][(_0x0dcd('0x93'))]('Unknown\x20role');}})[_0x0dcd('0x15')](function(_0x566ce9){_0x335e2=_0x566ce9['length'];if(!_0x20e844['query'][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x2131fd[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x20e844['query'][_0x0dcd('0x24')]);_0x2131fd['offset']=qs['offset'](_0x20e844[_0x0dcd('0x48')]['offset']);}switch(_0x33e7d6[_0x0dcd('0x2a')]){case'admin':return db[_[_0x0dcd('0xa4')](_0x20e844['query'][_0x0dcd('0x9d')])+_0x0dcd('0xd9')][_0x0dcd('0x50')](_0x2131fd);case _0x0dcd('0x80'):case'agent':return _0x33e7d6[_0x0dcd('0x2f')+_[_0x0dcd('0xa4')](_0x20e844[_0x0dcd('0x48')][_0x0dcd('0x9d')])+_0x0dcd('0xda')](_0x2131fd);}})[_0x0dcd('0x15')](function(_0x57a93a){return{'count':_0x335e2,'rows':_0x57a93a};})[_0x0dcd('0x15')](respondWithResult(_0x384256,null))[_0x0dcd('0x1e')](handleError(_0x384256,null));};exports[_0x0dcd('0xdb')]=function(_0x458207,_0x11ed00){var _0x2972b6={};var _0x2df224={};var _0x408dfa;var _0x32b3ce;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x458207[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x11ed00,null))[_0x0dcd('0x15')](function(_0x248d6a){if(_0x248d6a){_0x408dfa=_0x248d6a;_0x2df224[_0x0dcd('0x5a')]=_['keys'](db[_0x0dcd('0xad')]['rawAttributes']);_0x2df224[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x458207[_0x0dcd('0x48')]);_0x2df224[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x2df224['model'],_0x2df224['query']);_0x2972b6[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x2df224['model'],qs[_0x0dcd('0xcb')](_0x458207['query']['fields']));_0x2972b6['attributes']=_0x2972b6['attributes'][_0x0dcd('0x5d')]?_0x2972b6[_0x0dcd('0x4e')]:_0x2df224[_0x0dcd('0x5a')];_0x2972b6[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x458207[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x2972b6[_0x0dcd('0x46')]=qs['filters'](_[_0x0dcd('0xcf')](_0x458207[_0x0dcd('0x48')],_0x2df224['filters']));if(_0x458207[_0x0dcd('0x48')]['filter']){_0x2972b6[_0x0dcd('0x46')]=_['merge'](_0x2972b6[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x2972b6[_0x0dcd('0x4e')],function(_0x128186){var _0x42a070={};_0x42a070[_0x128186]={'$like':'%'+_0x458207['query'][_0x0dcd('0x41')]+'%'};return _0x42a070;})});}_0x2972b6=_[_0x0dcd('0x5e')]({},_0x2972b6,_0x458207[_0x0dcd('0xd0')]);return _0x408dfa[_0x0dcd('0xdb')](_0x2972b6);}})[_0x0dcd('0x15')](function(_0x1de3bf){if(_0x1de3bf){_0x32b3ce=_0x1de3bf[_0x0dcd('0x5d')];if(!_0x458207[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x2972b6[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x458207[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x2972b6[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x458207[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x408dfa[_0x0dcd('0xdb')](_0x2972b6);}})['then'](function(_0x5c63aa){if(_0x5c63aa){return _0x5c63aa?{'count':_0x32b3ce,'rows':_0x5c63aa}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x11ed00,null))[_0x0dcd('0x1e')](handleError(_0x11ed00,null));};exports[_0x0dcd('0xdc')]=function(_0x22aed4,_0x5d9551){var _0x29f09e={};var _0x3c86cd={};var _0x515794;var _0x3f923b;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x22aed4['params']['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x5d9551,null))[_0x0dcd('0x15')](function(_0x51e809){if(_0x51e809){_0x515794=_0x51e809;_0x3c86cd[_0x0dcd('0x5a')]=_['keys'](db['ChatGroup'][_0x0dcd('0x3d')]);_0x3c86cd['query']=_[_0x0dcd('0x5c')](_0x22aed4[_0x0dcd('0x48')]);_0x3c86cd[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x3c86cd[_0x0dcd('0x5a')],_0x3c86cd[_0x0dcd('0x48')]);_0x29f09e[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x3c86cd[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x22aed4[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x29f09e[_0x0dcd('0x4e')]=_0x29f09e[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x29f09e[_0x0dcd('0x4e')]:_0x3c86cd['model'];_0x29f09e[_0x0dcd('0xcc')]=qs['sort'](_0x22aed4[_0x0dcd('0x48')]['sort']);_0x29f09e[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x22aed4[_0x0dcd('0x48')],_0x3c86cd['filters']));if(_0x22aed4[_0x0dcd('0x48')]['filter']){_0x29f09e[_0x0dcd('0x46')]=_['merge'](_0x29f09e[_0x0dcd('0x46')],{'$or':_['map'](_0x29f09e[_0x0dcd('0x4e')],function(_0x2163f7){var _0x3ea426={};_0x3ea426[_0x2163f7]={'$like':'%'+_0x22aed4[_0x0dcd('0x48')]['filter']+'%'};return _0x3ea426;})});}_0x29f09e=_[_0x0dcd('0x5e')]({},_0x29f09e,_0x22aed4[_0x0dcd('0xd0')]);return _0x515794[_0x0dcd('0xdc')](_0x29f09e);}})[_0x0dcd('0x15')](function(_0x4a9103){if(_0x4a9103){_0x3f923b=_0x4a9103[_0x0dcd('0x5d')];if(!_0x22aed4[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x29f09e[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x22aed4[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x29f09e[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x22aed4[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x515794[_0x0dcd('0xdc')](_0x29f09e);}})[_0x0dcd('0x15')](function(_0x175813){if(_0x175813){return _0x175813?{'count':_0x3f923b,'rows':_0x175813}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x5d9551,null))['catch'](handleError(_0x5d9551,null));};exports[_0x0dcd('0xdd')]=function(_0xbd6da4,_0x32a5e6){var _0x48c7d8={'raw':!![],'where':{}};var _0xa32575={};var _0x27992d={'count':0x0,'rows':[]};return db[_0x0dcd('0x47')]['findOne']({'where':{'id':_0xbd6da4[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x32a5e6,null))[_0x0dcd('0x15')](function(_0x10fdef){if(_0x10fdef){_0xa32575[_0x0dcd('0x5a')]=_['keys'](db[_0x0dcd('0xde')][_0x0dcd('0x3d')]);_0xa32575[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0xbd6da4[_0x0dcd('0x48')]);_0xa32575[_0x0dcd('0xce')]=_['intersection'](_0xa32575[_0x0dcd('0x5a')],_0xa32575['query']);_0x48c7d8['attributes']=_[_0x0dcd('0xca')](_0xa32575[_0x0dcd('0x5a')],qs['fields'](_0xbd6da4['query']['fields']));_0x48c7d8[_0x0dcd('0x4e')]=_0x48c7d8[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x48c7d8[_0x0dcd('0x4e')]:_0xa32575[_0x0dcd('0x5a')];if(!_0xbd6da4[_0x0dcd('0x48')]['hasOwnProperty'](_0x0dcd('0xd7'))){_0x48c7d8[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0xbd6da4['query'][_0x0dcd('0x24')]);_0x48c7d8['offset']=qs[_0x0dcd('0x26')](_0xbd6da4[_0x0dcd('0x48')][_0x0dcd('0x26')]);}_0x48c7d8[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0xbd6da4[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x48c7d8[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0xbd6da4[_0x0dcd('0x48')],_0xa32575[_0x0dcd('0xce')]));_0x48c7d8['where'][_0x0dcd('0xdf')]=_0x10fdef['id'];if(_0xbd6da4['query'][_0x0dcd('0x41')]){_0x48c7d8['where']=_[_0x0dcd('0x5e')](_0x48c7d8[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x48c7d8[_0x0dcd('0x4e')],function(_0x3012ee){var _0x213336={};_0x213336[_0x3012ee]={'$like':'%'+_0xbd6da4[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x213336;})});}_0x48c7d8=_['merge']({},_0x48c7d8,_0xbd6da4[_0x0dcd('0xd0')]);return db[_0x0dcd('0xde')][_0x0dcd('0x25')]({'where':_0x48c7d8[_0x0dcd('0x46')]})[_0x0dcd('0x15')](function(_0x63755e){_0x27992d['count']=_0x63755e;if(_0xbd6da4['query']['includeAll']){_0x48c7d8['include']=[{'all':!![]}];}return db[_0x0dcd('0xde')][_0x0dcd('0x50')](_0x48c7d8);})[_0x0dcd('0x15')](function(_0x68688d){_0x27992d[_0x0dcd('0x51')]=_0x68688d;return _0x27992d;});}})['then'](respondWithFilteredResult(_0x32a5e6,_0x48c7d8))[_0x0dcd('0x1e')](handleError(_0x32a5e6,null));};exports['getScreenRecordings']=function(_0x1fdf79,_0x5aa3cc){var _0x739895={'raw':!![],'where':{}};var _0x2eddbb={};var _0x3be9e8={'count':0x0,'rows':[]};return db['User'][_0x0dcd('0xc9')]({'where':{'id':_0x1fdf79[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x5aa3cc,null))[_0x0dcd('0x15')](function(_0x585165){if(_0x585165){_0x2eddbb[_0x0dcd('0x5a')]=_['keys'](db[_0x0dcd('0xe0')][_0x0dcd('0x3d')]);_0x2eddbb[_0x0dcd('0x48')]=_['keys'](_0x1fdf79[_0x0dcd('0x48')]);_0x2eddbb[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x2eddbb[_0x0dcd('0x5a')],_0x2eddbb[_0x0dcd('0x48')]);_0x739895[_0x0dcd('0x4e')]=_['intersection'](_0x2eddbb[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x1fdf79[_0x0dcd('0x48')]['fields']));_0x739895[_0x0dcd('0x4e')]=_0x739895[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x739895[_0x0dcd('0x4e')]:_0x2eddbb[_0x0dcd('0x5a')];if(!_0x1fdf79[_0x0dcd('0x48')]['hasOwnProperty'](_0x0dcd('0xd7'))){_0x739895[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x1fdf79[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x739895[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x1fdf79[_0x0dcd('0x48')][_0x0dcd('0x26')]);}_0x739895[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x1fdf79[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x739895[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x1fdf79['query'],_0x2eddbb[_0x0dcd('0xce')]));_0x739895['where'][_0x0dcd('0xdf')]=_0x585165['id'];if(_0x1fdf79['query']['filter']){_0x739895[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x739895[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x739895[_0x0dcd('0x4e')],function(_0x585973){var _0x5baf5a={};_0x5baf5a[_0x585973]={'$like':'%'+_0x1fdf79[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x5baf5a;})});}_0x739895=_[_0x0dcd('0x5e')]({},_0x739895,_0x1fdf79['options']);return db['ScreenRecording']['count']({'where':_0x739895[_0x0dcd('0x46')]})[_0x0dcd('0x15')](function(_0x3127fd){_0x3be9e8['count']=_0x3127fd;if(_0x1fdf79[_0x0dcd('0x48')][_0x0dcd('0x49')]){_0x739895['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x739895);})[_0x0dcd('0x15')](function(_0x41258a){_0x3be9e8[_0x0dcd('0x51')]=_0x41258a;return _0x3be9e8;});}})[_0x0dcd('0x15')](respondWithFilteredResult(_0x5aa3cc,_0x739895))[_0x0dcd('0x1e')](handleError(_0x5aa3cc,null));};exports[_0x0dcd('0xe1')]=function(_0x516b54,_0x1242c){var _0x398dd1={};var _0x1340f5={};var _0x14203a;var _0xf47bce;return db['User'][_0x0dcd('0xc9')]({'where':{'id':_0x516b54[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x1242c,null))[_0x0dcd('0x15')](function(_0x596419){if(_0x596419){_0x14203a=_0x596419;_0x1340f5[_0x0dcd('0x5a')]=_[_0x0dcd('0x5c')](db[_0x0dcd('0xe2')]['rawAttributes']);_0x1340f5[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x516b54[_0x0dcd('0x48')]);_0x1340f5['filters']=_[_0x0dcd('0xca')](_0x1340f5[_0x0dcd('0x5a')],_0x1340f5[_0x0dcd('0x48')]);_0x398dd1[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x1340f5[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x516b54[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x398dd1[_0x0dcd('0x4e')]=_0x398dd1['attributes'][_0x0dcd('0x5d')]?_0x398dd1[_0x0dcd('0x4e')]:_0x1340f5[_0x0dcd('0x5a')];_0x398dd1[_0x0dcd('0xcc')]=qs['sort'](_0x516b54[_0x0dcd('0x48')]['sort']);_0x398dd1[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x516b54[_0x0dcd('0x48')],_0x1340f5[_0x0dcd('0xce')]));if(_0x516b54[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x398dd1[_0x0dcd('0x46')]=_['merge'](_0x398dd1[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x398dd1['attributes'],function(_0x3f4927){var _0x140721={};_0x140721[_0x3f4927]={'$like':'%'+_0x516b54[_0x0dcd('0x48')]['filter']+'%'};return _0x140721;})});}_0x398dd1=_[_0x0dcd('0x5e')]({},_0x398dd1,_0x516b54['options']);return _0x14203a['getChatInteractions'](_0x398dd1);}})[_0x0dcd('0x15')](function(_0x37d2b6){if(_0x37d2b6){_0xf47bce=_0x37d2b6['length'];if(!_0x516b54[_0x0dcd('0x48')][_0x0dcd('0xd6')]('nolimit')){_0x398dd1[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x516b54[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x398dd1[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x516b54['query']['offset']);}return _0x14203a['getChatInteractions'](_0x398dd1);}})['then'](function(_0x53dd03){if(_0x53dd03){return _0x53dd03?{'count':_0xf47bce,'rows':_0x53dd03}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x1242c,null))[_0x0dcd('0x1e')](handleError(_0x1242c,null));};exports[_0x0dcd('0xe3')]=function(_0x2313c4,_0xed72db){var _0x50b05f={};var _0x580c24={};var _0x4b7ce4;var _0x426b61;return db['User'][_0x0dcd('0xc9')]({'where':{'id':_0x2313c4['params']['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0xed72db,null))[_0x0dcd('0x15')](function(_0x369903){if(_0x369903){_0x4b7ce4=_0x369903;_0x580c24[_0x0dcd('0x5a')]=_['keys'](db[_0x0dcd('0xe4')][_0x0dcd('0x3d')]);_0x580c24[_0x0dcd('0x48')]=_['keys'](_0x2313c4[_0x0dcd('0x48')]);_0x580c24[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x580c24[_0x0dcd('0x5a')],_0x580c24[_0x0dcd('0x48')]);_0x50b05f['attributes']=_[_0x0dcd('0xca')](_0x580c24['model'],qs['fields'](_0x2313c4['query'][_0x0dcd('0xcb')]));_0x50b05f[_0x0dcd('0x4e')]=_0x50b05f['attributes'][_0x0dcd('0x5d')]?_0x50b05f['attributes']:_0x580c24[_0x0dcd('0x5a')];_0x50b05f[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x2313c4[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x50b05f['where']=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x2313c4[_0x0dcd('0x48')],_0x580c24[_0x0dcd('0xce')]));if(_0x2313c4['query'][_0x0dcd('0x41')]){_0x50b05f['where']=_['merge'](_0x50b05f[_0x0dcd('0x46')],{'$or':_['map'](_0x50b05f[_0x0dcd('0x4e')],function(_0x1a8141){var _0x26ac36={};_0x26ac36[_0x1a8141]={'$like':'%'+_0x2313c4['query']['filter']+'%'};return _0x26ac36;})});}_0x50b05f=_[_0x0dcd('0x5e')]({},_0x50b05f,_0x2313c4[_0x0dcd('0xd0')]);return _0x4b7ce4[_0x0dcd('0xe3')](_0x50b05f);}})[_0x0dcd('0x15')](function(_0x495827){if(_0x495827){_0x426b61=_0x495827['length'];if(!_0x2313c4[_0x0dcd('0x48')]['hasOwnProperty'](_0x0dcd('0xd7'))){_0x50b05f[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x2313c4['query']['limit']);_0x50b05f[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x2313c4[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x4b7ce4['getOpenchannelInteractions'](_0x50b05f);}})['then'](function(_0x581736){if(_0x581736){return _0x581736?{'count':_0x426b61,'rows':_0x581736}:null;}})[_0x0dcd('0x15')](respondWithResult(_0xed72db,null))['catch'](handleError(_0xed72db,null));};exports['getMailInteractions']=function(_0x38f174,_0x2af886){var _0x4b03a2={'raw':!![],'where':{}};var _0x48364d={};var _0x5479e4={'count':0x0,'rows':[]};return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x38f174[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x2af886,null))[_0x0dcd('0x15')](function(_0x57f1f3){if(_0x57f1f3){_0x48364d['model']=_[_0x0dcd('0x5c')](db['MailInteraction'][_0x0dcd('0x3d')]);_0x48364d['query']=_[_0x0dcd('0x5c')](_0x38f174[_0x0dcd('0x48')]);_0x48364d[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x48364d['model'],_0x48364d[_0x0dcd('0x48')]);_0x4b03a2[_0x0dcd('0x4e')]=_['intersection'](_0x48364d[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x38f174[_0x0dcd('0x48')]['fields']));_0x4b03a2[_0x0dcd('0x4e')]=_0x4b03a2['attributes'][_0x0dcd('0x5d')]?_0x4b03a2[_0x0dcd('0x4e')]:_0x48364d[_0x0dcd('0x5a')];if(!_0x38f174[_0x0dcd('0x48')]['hasOwnProperty'](_0x0dcd('0xd7'))){_0x4b03a2[_0x0dcd('0x24')]=qs['limit'](_0x38f174[_0x0dcd('0x48')]['limit']);_0x4b03a2[_0x0dcd('0x26')]=qs['offset'](_0x38f174['query']['offset']);}_0x4b03a2[_0x0dcd('0xcc')]=qs['sort'](_0x38f174['query'][_0x0dcd('0xcd')]);_0x4b03a2['where']=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x38f174[_0x0dcd('0x48')],_0x48364d[_0x0dcd('0xce')]));_0x4b03a2[_0x0dcd('0x46')][_0x0dcd('0xdf')]=_0x57f1f3['id'];if(_0x38f174[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x4b03a2[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x4b03a2[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x4b03a2[_0x0dcd('0x4e')],function(_0xe6460){var _0x552f18={};_0x552f18[_0xe6460]={'$like':'%'+_0x38f174['query']['filter']+'%'};return _0x552f18;})});}_0x4b03a2=_[_0x0dcd('0x5e')]({},_0x4b03a2,_0x38f174[_0x0dcd('0xd0')]);return db[_0x0dcd('0xe5')][_0x0dcd('0x25')]({'where':_0x4b03a2['where']})['then'](function(_0x2551db){_0x5479e4[_0x0dcd('0x25')]=_0x2551db;if(_0x38f174[_0x0dcd('0x48')][_0x0dcd('0x49')]){_0x4b03a2[_0x0dcd('0x4a')]=[{'all':!![]}];}return db['MailInteraction'][_0x0dcd('0x50')](_0x4b03a2);})[_0x0dcd('0x15')](function(_0x211dc1){_0x5479e4[_0x0dcd('0x51')]=_0x211dc1;return _0x5479e4;});}})['then'](respondWithFilteredResult(_0x2af886,_0x4b03a2))['catch'](handleError(_0x2af886,null));};exports[_0x0dcd('0xe6')]=function(_0xeac557,_0x3e5b18){var _0x2a2230={};var _0x5dc934={};var _0x47a8c3;var _0x361e29;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0xeac557[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x3e5b18,null))[_0x0dcd('0x15')](function(_0x2e9e8a){if(_0x2e9e8a){_0x47a8c3=_0x2e9e8a;_0x5dc934[_0x0dcd('0x5a')]=_[_0x0dcd('0x5c')](db[_0x0dcd('0xe7')]['rawAttributes']);_0x5dc934[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0xeac557[_0x0dcd('0x48')]);_0x5dc934[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x5dc934['model'],_0x5dc934[_0x0dcd('0x48')]);_0x2a2230[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x5dc934[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0xeac557['query'][_0x0dcd('0xcb')]));_0x2a2230['attributes']=_0x2a2230[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x2a2230[_0x0dcd('0x4e')]:_0x5dc934[_0x0dcd('0x5a')];_0x2a2230[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0xeac557[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x2a2230[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0xeac557[_0x0dcd('0x48')],_0x5dc934[_0x0dcd('0xce')]));if(_0xeac557[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x2a2230[_0x0dcd('0x46')]=_['merge'](_0x2a2230['where'],{'$or':_[_0x0dcd('0x35')](_0x2a2230[_0x0dcd('0x4e')],function(_0x48fd06){var _0x3661fc={};_0x3661fc[_0x48fd06]={'$like':'%'+_0xeac557[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x3661fc;})});}_0x2a2230=_[_0x0dcd('0x5e')]({},_0x2a2230,_0xeac557[_0x0dcd('0xd0')]);return _0x47a8c3[_0x0dcd('0xe6')](_0x2a2230);}})[_0x0dcd('0x15')](function(_0xcabf9a){if(_0xcabf9a){_0x361e29=_0xcabf9a[_0x0dcd('0x5d')];if(!_0xeac557[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x2a2230['limit']=qs['limit'](_0xeac557[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x2a2230['offset']=qs[_0x0dcd('0x26')](_0xeac557[_0x0dcd('0x48')]['offset']);}return _0x47a8c3['getSmsInteractions'](_0x2a2230);}})[_0x0dcd('0x15')](function(_0x21c802){if(_0x21c802){return _0x21c802?{'count':_0x361e29,'rows':_0x21c802}:null;}})['then'](respondWithResult(_0x3e5b18,null))[_0x0dcd('0x1e')](handleError(_0x3e5b18,null));};exports[_0x0dcd('0xe8')]=function(_0x5d09ee,_0x3bdaa3){var _0x3d1dae={};var _0x539a0e={};var _0xc8292a;var _0xa27108;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x5d09ee[_0x0dcd('0x59')]['id']}})['then'](handleEntityNotFound(_0x3bdaa3,null))[_0x0dcd('0x15')](function(_0x387599){if(_0x387599){_0xc8292a=_0x387599;_0x539a0e[_0x0dcd('0x5a')]=_[_0x0dcd('0x5c')](db[_0x0dcd('0xe9')][_0x0dcd('0x3d')]);_0x539a0e[_0x0dcd('0x48')]=_['keys'](_0x5d09ee['query']);_0x539a0e[_0x0dcd('0xce')]=_['intersection'](_0x539a0e[_0x0dcd('0x5a')],_0x539a0e[_0x0dcd('0x48')]);_0x3d1dae[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x539a0e[_0x0dcd('0x5a')],qs['fields'](_0x5d09ee[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x3d1dae[_0x0dcd('0x4e')]=_0x3d1dae[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x3d1dae[_0x0dcd('0x4e')]:_0x539a0e[_0x0dcd('0x5a')];_0x3d1dae[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x5d09ee[_0x0dcd('0x48')]['sort']);_0x3d1dae['where']=qs['filters'](_[_0x0dcd('0xcf')](_0x5d09ee['query'],_0x539a0e[_0x0dcd('0xce')]));if(_0x5d09ee['query'][_0x0dcd('0x41')]){_0x3d1dae[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x3d1dae[_0x0dcd('0x46')],{'$or':_['map'](_0x3d1dae[_0x0dcd('0x4e')],function(_0x4f63e2){var _0x3dace9={};_0x3dace9[_0x4f63e2]={'$like':'%'+_0x5d09ee[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x3dace9;})});}_0x3d1dae=_[_0x0dcd('0x5e')]({},_0x3d1dae,_0x5d09ee[_0x0dcd('0xd0')]);return _0xc8292a[_0x0dcd('0xe8')](_0x3d1dae);}})['then'](function(_0x191fed){if(_0x191fed){_0xa27108=_0x191fed[_0x0dcd('0x5d')];if(!_0x5d09ee[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x3d1dae['limit']=qs[_0x0dcd('0x24')](_0x5d09ee[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x3d1dae[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x5d09ee['query'][_0x0dcd('0x26')]);}return _0xc8292a[_0x0dcd('0xe8')](_0x3d1dae);}})[_0x0dcd('0x15')](function(_0x55eaff){if(_0x55eaff){return _0x55eaff?{'count':_0xa27108,'rows':_0x55eaff}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x3bdaa3,null))[_0x0dcd('0x1e')](handleError(_0x3bdaa3,null));};exports[_0x0dcd('0xea')]=function(_0x1667e6,_0x51e0a7){var _0x1dab1c={};var _0x59a1e6={};var _0x5b22a8;var _0x2fd468;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x1667e6[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x51e0a7,null))[_0x0dcd('0x15')](function(_0x23d1a6){if(_0x23d1a6){_0x5b22a8=_0x23d1a6;_0x59a1e6['model']=_['keys'](db[_0x0dcd('0xeb')][_0x0dcd('0x3d')]);_0x59a1e6[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x1667e6[_0x0dcd('0x48')]);_0x59a1e6[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x59a1e6[_0x0dcd('0x5a')],_0x59a1e6[_0x0dcd('0x48')]);_0x1dab1c[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x59a1e6[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x1667e6[_0x0dcd('0x48')]['fields']));_0x1dab1c[_0x0dcd('0x4e')]=_0x1dab1c[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x1dab1c['attributes']:_0x59a1e6[_0x0dcd('0x5a')];_0x1dab1c[_0x0dcd('0xcc')]=qs['sort'](_0x1667e6[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x1dab1c[_0x0dcd('0x46')]=qs['filters'](_['pick'](_0x1667e6['query'],_0x59a1e6[_0x0dcd('0xce')]));if(_0x1667e6[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x1dab1c['where']=_[_0x0dcd('0x5e')](_0x1dab1c[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x1dab1c[_0x0dcd('0x4e')],function(_0x800307){var _0x2bffc5={};_0x2bffc5[_0x800307]={'$like':'%'+_0x1667e6[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x2bffc5;})});}_0x1dab1c=_[_0x0dcd('0x5e')]({},_0x1dab1c,_0x1667e6[_0x0dcd('0xd0')]);return _0x5b22a8['getWhatsappInteractions'](_0x1dab1c);}})['then'](function(_0x4f1fec){if(_0x4f1fec){_0x2fd468=_0x4f1fec['length'];if(!_0x1667e6['query'][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x1dab1c[_0x0dcd('0x24')]=qs['limit'](_0x1667e6[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x1dab1c[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x1667e6[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x5b22a8[_0x0dcd('0xea')](_0x1dab1c);}})[_0x0dcd('0x15')](function(_0x210198){if(_0x210198){return _0x210198?{'count':_0x2fd468,'rows':_0x210198}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x51e0a7,null))[_0x0dcd('0x1e')](handleError(_0x51e0a7,null));};exports[_0x0dcd('0xec')]=function(_0x256013,_0x2c1ba5,_0x382f2f){var _0x141db2;var _0x1474bc;var _0x3e80a1;var _0x440426=!_[_0x0dcd('0x69')](_0x256013['params']['id'])?_0x256013[_0x0dcd('0x59')]['id']:!_[_0x0dcd('0x69')](_0x256013[_0x0dcd('0x80')]['id'])?_0x256013[_0x0dcd('0x80')]['id']:null;return db[_0x0dcd('0x47')][_0x0dcd('0x37')]({'where':{'id':_0x440426,'role':{'$or':[_0x0dcd('0x30'),'user',_0x0dcd('0x2b')]}},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0xed'),_0x0dcd('0xee'),_0x0dcd('0x2a'),_0x0dcd('0x65'),_0x0dcd('0x9f')]})[_0x0dcd('0x15')](function(_0x572892){if(_0x572892){if(_0x572892[_0x0dcd('0x2a')]===_0x0dcd('0x2b')){_0x141db2=_0x572892;if(_0x256013[_0x0dcd('0x60')][_0x0dcd('0xa1')]){_0x3e80a1=util[_0x0dcd('0xab')](_0x0dcd('0xef'),_0x141db2[_0x256013[_0x0dcd('0x60')]['interface']]);}else if(_0x256013[_0x0dcd('0x60')][_0x0dcd('0xf0')]){_0x3e80a1=util['format'](_0x0dcd('0xac'),_0x256013[_0x0dcd('0x60')][_0x0dcd('0xf0')]);}else{_0x3e80a1=util[_0x0dcd('0xab')](_0x0dcd('0xac'),_0x141db2[_0x0dcd('0x3a')]);}socket['to'](util[_0x0dcd('0xab')](_0x0dcd('0xf1'),_0x141db2[_0x0dcd('0x3a')]))[_0x0dcd('0x2c')](_0x0dcd('0xf2'),{'user':{'id':_0x141db2['id'],'name':_0x141db2[_0x0dcd('0x3a')]},'ip':_0x256013[_0x0dcd('0xf3')][_0x0dcd('0xf4')]||_0x256013['connection']['remoteAddress']||_0x256013[_0x0dcd('0xf5')][_0x0dcd('0xf6')]||_0x256013[_0x0dcd('0xf7')][_0x0dcd('0xf5')]['remoteAddress']});return db[_0x0dcd('0xad')][_0x0dcd('0x2e')]({'where':{'membername':_0x141db2['name']},'individualHooks':!![]});}}else{throw new db[(_0x0dcd('0x91'))][(_0x0dcd('0x93'))](_0x0dcd('0xf8'));}})[_0x0dcd('0x15')](function(){if(_0x141db2){return _0x141db2['getVoiceQueues']({'raw':!![]});}})[_0x0dcd('0x15')](function(_0x3bb535){if(_0x141db2){if(_0x3bb535){_0x1474bc=_0x3bb535;if(_0x1474bc[_0x0dcd('0x5d')]){var _0x3d00a6=_0x1474bc[_0x0dcd('0x35')](function(_0x1561ef){var _0x1f9732={'membername':_0x141db2['name'],'UserId':_0x141db2['id'],'queue_name':_0x1561ef[_0x0dcd('0x3a')],'VoiceQueueId':_0x1561ef['id'],'interface':_0x3e80a1,'paused':_0x141db2[_0x0dcd('0x9f')]||![],'penalty':_0x1561ef[_0x0dcd('0xf9')]||0x0};return db[_0x0dcd('0xad')][_0x0dcd('0xae')](_0x1f9732);});return Promise[_0x0dcd('0x5f')](_0x3d00a6);}}}})['then'](function(){if(_0x141db2){return db[_0x0dcd('0xfa')][_0x0dcd('0x50')]({'where':{'membername':_0x141db2[_0x0dcd('0x3a')],'exitAt':null}});}})[_0x0dcd('0x15')](function(_0x459aec){if(_0x141db2){var _0x24feec=[];_0x459aec['forEach'](function(_0x599770){_0x24feec['push'](_0x599770[_0x0dcd('0x29')]({'exitAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb'))}));});return Promise['all'](_0x24feec);}})[_0x0dcd('0x15')](function(){if(_0x141db2){var _0x33f33a=[];var _0x23dfb5=[];var _0x3c05a5=utils['getChannels']();var _0x307c4b={'membername':_0x141db2[_0x0dcd('0x3a')],'interface':_0x3e80a1,'enterAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb')),'role':_0x141db2[_0x0dcd('0x2a')],'internal':_0x141db2['internal']};_0x3c05a5[_0x0dcd('0xfc')](function(_0x4fad16){_0x33f33a['push'](_[_0x0dcd('0x5e')]({'channel':_0x4fad16,'type':_0x0dcd('0xfd'),'data1':_0x256013[_0x0dcd('0x60')]['device'],'data2':_0x3e80a1},_0x307c4b));if(_0x141db2[_0x0dcd('0x9f')]){_0x23dfb5[_0x0dcd('0x4f')](_['merge']({'channel':_0x4fad16,'type':_0x0dcd('0xfe'),'data1':_0x0dcd('0xff')},_0x307c4b));}});return db[_0x0dcd('0xfa')]['bulkCreate'](_0x33f33a[_0x0dcd('0x100')](_0x23dfb5),{'individualHooks':!![]});}})[_0x0dcd('0x15')](function(){if(_0x141db2){return _0x141db2[_0x0dcd('0x29')]({'online':!![],'lastLoginAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb')),'voicePause':_0x141db2[_0x0dcd('0x9f')]||![],'mailPause':_0x141db2[_0x0dcd('0x9f')]||![],'chatPause':_0x141db2['loginInPause']||![],'faxPause':_0x141db2[_0x0dcd('0x9f')]||![],'smsPause':_0x141db2[_0x0dcd('0x9f')]||![],'openchannelPause':_0x141db2['loginInPause']||![],'whatsappPause':_0x141db2['loginInPause']||![],'pauseType':_0x141db2[_0x0dcd('0x9f')]?_0x0dcd('0xff'):null,'interface':_0x3e80a1,'lastPauseAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb'))});}})[_0x0dcd('0x15')](function(_0x4e93da){if(_0x256013[_0x0dcd('0x101')]){return _0x382f2f();}else{return Promise['resolve'](_0x4e93da)['then'](respondWithResult(_0x2c1ba5,null));}})[_0x0dcd('0x1e')](handleError(_0x2c1ba5,null));};exports['logout']=function(_0xadfbd5,_0x50c466){var _0x20f40c;return db[_0x0dcd('0x47')]['find']({'where':{'id':_0xadfbd5[_0x0dcd('0x59')]['id'],'role':_0x0dcd('0x2b')},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0x2a')]})[_0x0dcd('0x15')](handleEntityNotFound(_0x50c466,null))[_0x0dcd('0x15')](function(_0x4ae705){if(_0x4ae705){_0x20f40c=_0x4ae705;return db[_0x0dcd('0xad')][_0x0dcd('0x2e')]({'where':{'membername':_0x20f40c[_0x0dcd('0x3a')]},'individualHooks':!![]});}})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0xfa')]['findAll']({'where':{'membername':_0x20f40c[_0x0dcd('0x3a')],'exitAt':null}});})[_0x0dcd('0x15')](function(_0x460706){var _0x4298c4=[];_0x460706[_0x0dcd('0xfc')](function(_0x2359b1){_0x4298c4['push'](_0x2359b1[_0x0dcd('0x29')]({'exitAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb'))}));});return Promise['all'](_0x4298c4);})[_0x0dcd('0x15')](function(){return _0x20f40c[_0x0dcd('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0dcd('0x15')](respondWithResult(_0x50c466,null))[_0x0dcd('0x1e')](handleError(_0x50c466,null));};exports[_0x0dcd('0x102')]=function(_0x1fc9ae,_0x532cad){var _0x286e45;return db[_0x0dcd('0xad')][_0x0dcd('0x29')]({'paused':0x1},{'where':{'UserId':_0x1fc9ae['params']['id']},'individualHooks':!![]})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x47')][_0x0dcd('0x37')]({'where':{'id':_0x1fc9ae[_0x0dcd('0x59')]['id'],'role':_0x0dcd('0x2b')},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0x2a'),_0x0dcd('0x65'),'interface',_0x0dcd('0x9e')]});})['then'](handleEntityNotFound(_0x532cad,null))[_0x0dcd('0x15')](function(_0x351532){if(_0x351532){_0x286e45=_0x351532;return respondWithRpcPromise(_0x0dcd('0x103'),'pause',{'id':_0x286e45['id'],'name':_0x286e45[_0x0dcd('0x3a')],'pause':!![]});}})['then'](function(){if(_0x286e45){return db[_0x0dcd('0xfa')][_0x0dcd('0x50')]({'where':{'membername':_0x286e45[_0x0dcd('0x3a')],'type':_0x0dcd('0xfe'),'exitAt':null}});}})[_0x0dcd('0x15')](function(_0x55ae2a){if(_0x55ae2a[_0x0dcd('0x5d')]){var _0x8c8ce0=moment()[_0x0dcd('0xab')](_0x0dcd('0xfb'));for(var _0x1748af=0x0,_0xe7457b=_0x55ae2a[_0x0dcd('0x5d')];_0x1748af<_0xe7457b;_0x1748af++){_0x55ae2a[_0x1748af][_0x0dcd('0x104')]({'exitAt':_0x8c8ce0});}}})['then'](function(){var _0x37ea45=[];var _0x4f738f=utils[_0x0dcd('0x105')]();_0x4f738f[_0x0dcd('0xfc')](function(_0x19a561){_0x37ea45['push']({'channel':_0x19a561,'membername':_0x286e45[_0x0dcd('0x3a')],'interface':_['isNil'](_0x286e45[_0x0dcd('0xa1')])?util[_0x0dcd('0xab')](_0x0dcd('0xac'),_0x286e45['name']):_0x286e45[_0x0dcd('0xa1')],'type':_0x0dcd('0xfe'),'enterAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb')),'data1':_0x1fc9ae[_0x0dcd('0x60')][_0x0dcd('0x3f')]||'DEFAULT\x20PAUSE','role':_0x286e45[_0x0dcd('0x2a')],'internal':_0x286e45[_0x0dcd('0x65')]});});return db[_0x0dcd('0xfa')][_0x0dcd('0x88')](_0x37ea45,{'individualHooks':!![]});})[_0x0dcd('0x15')](function(){return _0x286e45[_0x0dcd('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1fc9ae[_0x0dcd('0x60')][_0x0dcd('0x3f')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x0dcd('0xab')](_0x0dcd('0xfb'))});})[_0x0dcd('0x15')](respondWithResult(_0x532cad,null))[_0x0dcd('0x1e')](handleError(_0x532cad,null));};exports[_0x0dcd('0x106')]=function(_0x33c306,_0x20ddcf){if(_0x33c306[_0x0dcd('0x60')][_0x0dcd('0x9d')]&&!utils[_0x0dcd('0xa2')](_0x33c306[_0x0dcd('0x60')][_0x0dcd('0x9d')])){throw new APIBadRequestError(util[_0x0dcd('0xab')](_0x0dcd('0x107'),_0x33c306[_0x0dcd('0x60')][_0x0dcd('0x9d')]));}return db[_0x0dcd('0x47')]['find']({'where':{'id':_0x33c306['params']['id']},'attributes':['id',_0x0dcd('0x3a'),_0x0dcd('0x2a'),_0x0dcd('0x65'),_0x0dcd('0xa1'),'online',_0x0dcd('0xa0'),_0x0dcd('0x108'),_0x0dcd('0x109'),'faxPause',_0x0dcd('0x10a'),_0x0dcd('0x10b'),'whatsappPause','pauseType',_0x0dcd('0x10c')]})['then'](function(_0x3628c5){if(!_0x3628c5){throw new APINotFoundError(util[_0x0dcd('0xab')](_0x0dcd('0x10d'),_0x33c306[_0x0dcd('0x59')]['id']));}return _0x3628c5[_0x0dcd('0x106')](_0x33c306['body'][_0x0dcd('0x9d')]);})[_0x0dcd('0x15')](respondWithResult(_0x20ddcf,null))[_0x0dcd('0x1e')](APIHandleError(_0x20ddcf));};exports[_0x0dcd('0x10e')]=function(_0x4d17b1,_0x589662){var _0x1aebf8={};var _0x40e60c={};var _0x20d41d;var _0x452b23;return db[_0x0dcd('0x47')]['findOne']({'where':{'id':_0x4d17b1[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x589662,null))[_0x0dcd('0x15')](function(_0x58dd5b){if(_0x58dd5b){_0x20d41d=_0x58dd5b;_0x40e60c['model']=_['keys'](db[_0x0dcd('0x10f')][_0x0dcd('0x3d')]);_0x40e60c['query']=_[_0x0dcd('0x5c')](_0x4d17b1[_0x0dcd('0x48')]);_0x40e60c[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x40e60c['model'],_0x40e60c['query']);_0x1aebf8[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x40e60c[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x4d17b1[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x1aebf8['attributes']=_0x1aebf8[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x1aebf8['attributes']:_0x40e60c[_0x0dcd('0x5a')];_0x1aebf8[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x4d17b1[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x1aebf8[_0x0dcd('0x46')]=qs[_0x0dcd('0xce')](_[_0x0dcd('0xcf')](_0x4d17b1['query'],_0x40e60c[_0x0dcd('0xce')]));if(_0x4d17b1[_0x0dcd('0x48')][_0x0dcd('0x41')]){_0x1aebf8[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x1aebf8[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x1aebf8[_0x0dcd('0x4e')],function(_0x1c5899){var _0x15bd64={};_0x15bd64[_0x1c5899]={'$like':'%'+_0x4d17b1[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x15bd64;})});}_0x1aebf8=_[_0x0dcd('0x5e')]({},_0x1aebf8,_0x4d17b1[_0x0dcd('0xd0')]);return _0x20d41d[_0x0dcd('0x10e')](_0x1aebf8);}})['then'](function(_0x537def){if(_0x537def){_0x452b23=_0x537def[_0x0dcd('0x5d')];if(!_0x4d17b1['query']['hasOwnProperty'](_0x0dcd('0xd7'))){_0x1aebf8[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x4d17b1[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x1aebf8[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x4d17b1['query']['offset']);}return _0x20d41d[_0x0dcd('0x10e')](_0x1aebf8);}})['then'](function(_0x12cd53){if(_0x12cd53){return _0x12cd53?{'count':_0x452b23,'rows':_0x12cd53}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x589662,null))['catch'](handleError(_0x589662,null));};exports[_0x0dcd('0x110')]=function(_0x2a9709,_0x67e829){var _0x7f814c=_0x2a9709[_0x0dcd('0x59')]['id'];var _0x20207d=_0x2a9709[_0x0dcd('0x60')]?_0x2a9709[_0x0dcd('0x60')][_0x0dcd('0x63')]:null;var _0x11202a=[];return Promise[_0x0dcd('0x111')]()[_0x0dcd('0x15')](function(){if(!_0x20207d)throw new APIBadRequestError(_0x0dcd('0x112'));})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x47')]['findOne']({'where':{'id':_0x7f814c}});})[_0x0dcd('0x15')](function(_0x1c40c8){if(!_0x1c40c8)throw new APINotFoundError(util[_0x0dcd('0xab')](_0x0dcd('0x10d'),_0x2a9709['params']['id']));return db[_0x0dcd('0x6b')]['transaction'](function(_0x113a06){return _0x1c40c8['addTeams'](_0x20207d,{'transaction':_0x113a06})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x10f')][_0x0dcd('0x50')]({'where':{'id':{'$in':_0x20207d}}});})[_0x0dcd('0x15')](function(_0x464556){var _0x24b824=_[_0x0dcd('0x35')](_0x464556,function(_0x45cffe){return _0x45cffe[_0x0dcd('0x113')]();});return Promise[_0x0dcd('0x5f')](_0x24b824);})[_0x0dcd('0x15')](function(_0x42a173){_0x11202a=_['flattenDeep'](_0x42a173);var _0x3d967a=_[_0x0dcd('0x35')](_0x11202a,function(_0x5115aa){return _0x5115aa[_0x0dcd('0x114')](_0x1c40c8['id'],{'transaction':_0x113a06});});return Promise['all'](_0x3d967a);})[_0x0dcd('0x15')](function(){if(!_0x1c40c8['online'])return;var _0x182ece=_[_0x0dcd('0x41')](_0x11202a,function(_0x339ee0){return _0x339ee0['getDataValue'](_0x0dcd('0x9d'))==='Voice';});var _0x1a57cc=_['map'](_0x182ece,function(_0xa1b3f0){return db[_0x0dcd('0xad')][_0x0dcd('0xae')]({'membername':_0x1c40c8[_0x0dcd('0x3a')],'UserId':_0x1c40c8['id'],'queue_name':_0xa1b3f0[_0x0dcd('0x3a')],'VoiceQueueId':_0xa1b3f0['id'],'interface':_[_0x0dcd('0x69')](_0x1c40c8[_0x0dcd('0xa1')])?util[_0x0dcd('0xab')](_0x0dcd('0xac'),_0x1c40c8['name']):_0x1c40c8[_0x0dcd('0xa1')],'paused':_0x1c40c8[_0x0dcd('0xa0')]||![],'penalty':_0x1c40c8['penalty']},{'transaction':_0x113a06});});return Promise[_0x0dcd('0x5f')](_0x1a57cc);})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x115')][_0x0dcd('0x50')]({'where':{'teamId':{'$in':_0x20207d}}});})[_0x0dcd('0x15')](function(_0x5b9ba6){var _0x3c4bc8=_[_0x0dcd('0x35')](_0x5b9ba6,function(_0x48bfd7){return db[_0x0dcd('0x116')][_0x0dcd('0x7f')]({'UserId':_0x1c40c8['id'],'VoicePrefixId':_0x48bfd7[_0x0dcd('0x117')]},{'transaction':_0x113a06});});return Promise['all'](_0x3c4bc8);});});})[_0x0dcd('0x15')](function(){for(var _0x556a71=0x0;_0x556a71<_0x11202a['length'];_0x556a71++){var _0x1b7263=_0x11202a[_0x556a71][_0x0dcd('0x118')]('channel');var _0x20cb7b=_0x1b7263+_0x0dcd('0xa8');socket['emit'](_0x0dcd('0x80')+_0x1b7263+_0x0dcd('0xa9'),{'UserId':_0x7f814c,['queueField']:_0x11202a[_0x556a71]['id']});}})[_0x0dcd('0x15')](respondWithStatusCode(_0x67e829,null))['catch'](APIHandleError(_0x67e829));};exports[_0x0dcd('0x119')]=function(_0x430a4a,_0x174662){var _0x46cb83=_0x430a4a[_0x0dcd('0x59')]['id'];var _0x58eef0=null;if(_0x430a4a[_0x0dcd('0x48')][_0x0dcd('0x63')]){_0x58eef0=_[_0x0dcd('0xb1')](_0x430a4a[_0x0dcd('0x48')]['ids'])?_0x430a4a['query'][_0x0dcd('0x63')]:[_0x430a4a[_0x0dcd('0x48')]['ids']];}var _0x225007=[];return Promise['resolve']()[_0x0dcd('0x15')](function(){if(!_0x58eef0)throw new APIBadRequestError(_0x0dcd('0x11a'));})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x47')]['findOne']({'where':{'id':_0x46cb83}});})[_0x0dcd('0x15')](function(_0x32f673){if(!_0x32f673)throw new APINotFoundError(util[_0x0dcd('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x430a4a['params']['id']));return db[_0x0dcd('0x6b')][_0x0dcd('0x11b')](function(_0x4bfddc){return _0x32f673['removeTeams'](_0x58eef0,{'transaction':_0x4bfddc})[_0x0dcd('0x15')](function(){return db['Team'][_0x0dcd('0x50')]({'where':{'id':{'$in':_0x58eef0}}});})[_0x0dcd('0x15')](function(_0x211dc6){var _0x332c7f=_[_0x0dcd('0x35')](_0x211dc6,function(_0x501889){return _0x501889[_0x0dcd('0x113')]();});return Promise[_0x0dcd('0x5f')](_0x332c7f);})['then'](function(_0x38bf35){_0x225007=_[_0x0dcd('0x11c')](_0x38bf35);var _0x25327a=_[_0x0dcd('0x35')](_0x225007,function(_0x3933dd){return _0x3933dd[_0x0dcd('0x11d')](_0x32f673['id'],{'transaction':_0x4bfddc});});return Promise[_0x0dcd('0x5f')](_0x25327a);})[_0x0dcd('0x15')](function(){if(!_0x32f673[_0x0dcd('0x9e')])return;var _0x55b884=_[_0x0dcd('0x41')](_0x225007,function(_0x3def82){return _0x3def82['getDataValue']('channel')===_0x0dcd('0x11e');});var _0x20d724=_[_0x0dcd('0x35')](_0x55b884,function(_0xc81c6f){return db['UserVoiceQueueRt'][_0x0dcd('0x2e')]({'where':{'VoiceQueueId':_0xc81c6f['id'],'UserId':_0x32f673['id']},'transaction':_0x4bfddc});});return Promise[_0x0dcd('0x5f')](_0x20d724);})[_0x0dcd('0x15')](function(){return db[_0x0dcd('0x115')][_0x0dcd('0x50')]({'where':{'teamId':{'$in':_0x58eef0}}});})[_0x0dcd('0x15')](function(_0x530d69){var _0x153411=_[_0x0dcd('0x35')](_0x530d69,function(_0x8d7b58){return db[_0x0dcd('0x116')][_0x0dcd('0x2e')]({'where':{'UserId':_0x32f673['id'],'VoicePrefixId':_0x8d7b58[_0x0dcd('0x117')]}},{'transaction':_0x4bfddc});});return Promise[_0x0dcd('0x5f')](_0x153411);});});})[_0x0dcd('0x15')](function(){for(var _0x3c651a=0x0;_0x3c651a<_0x225007[_0x0dcd('0x5d')];_0x3c651a++){var _0x5d85de=_0x225007[_0x3c651a][_0x0dcd('0x118')](_0x0dcd('0x9d'));var _0x147bb0=_0x5d85de+_0x0dcd('0xa8');socket[_0x0dcd('0x2c')](_0x0dcd('0x80')+_0x5d85de+_0x0dcd('0xb2'),{'UserId':_0x46cb83,['queueField']:_0x225007[_0x3c651a]['id']});}})[_0x0dcd('0x15')](respondWithStatusCode(_0x174662,null))[_0x0dcd('0x1e')](APIHandleError(_0x174662));};exports[_0x0dcd('0x11f')]=function(_0x3ff294,_0x40d581){var _0x775497={};var _0x47a9cf={};var _0x1caeab;var _0x251414;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x3ff294[_0x0dcd('0x59')]['id']}})[_0x0dcd('0x15')](handleEntityNotFound(_0x40d581,null))[_0x0dcd('0x15')](function(_0x3ab7f4){if(_0x3ab7f4){_0x1caeab=_0x3ab7f4;_0x47a9cf['model']=_[_0x0dcd('0x5c')](db['CmList'][_0x0dcd('0x3d')]);_0x47a9cf[_0x0dcd('0x48')]=_[_0x0dcd('0x5c')](_0x3ff294[_0x0dcd('0x48')]);_0x47a9cf[_0x0dcd('0xce')]=_[_0x0dcd('0xca')](_0x47a9cf['model'],_0x47a9cf[_0x0dcd('0x48')]);_0x775497[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x47a9cf[_0x0dcd('0x5a')],qs[_0x0dcd('0xcb')](_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x775497[_0x0dcd('0x4e')]=_0x775497[_0x0dcd('0x4e')][_0x0dcd('0x5d')]?_0x775497['attributes']:_0x47a9cf[_0x0dcd('0x5a')];_0x775497[_0x0dcd('0xcc')]=qs[_0x0dcd('0xcd')](_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0xcd')]);_0x775497[_0x0dcd('0x46')]=qs['filters'](_[_0x0dcd('0xcf')](_0x3ff294['query'],_0x47a9cf[_0x0dcd('0xce')]));if(_0x3ff294['query']['filter']){_0x775497[_0x0dcd('0x46')]=_[_0x0dcd('0x5e')](_0x775497[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x775497[_0x0dcd('0x4e')],function(_0x4f9df9){var _0x457b45={};_0x457b45[_0x4f9df9]={'$like':'%'+_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x457b45;})});}_0x775497=_['merge']({},_0x775497,_0x3ff294['options']);return _0x1caeab[_0x0dcd('0x11f')](_0x775497);}})[_0x0dcd('0x15')](function(_0x203a98){if(_0x203a98){_0x251414=_0x203a98['length'];if(!_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0xd6')](_0x0dcd('0xd7'))){_0x775497[_0x0dcd('0x24')]=qs[_0x0dcd('0x24')](_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0x24')]);_0x775497[_0x0dcd('0x26')]=qs[_0x0dcd('0x26')](_0x3ff294[_0x0dcd('0x48')][_0x0dcd('0x26')]);}return _0x1caeab['getLists'](_0x775497);}})[_0x0dcd('0x15')](function(_0x238302){if(_0x238302){return _0x238302?{'count':_0x251414,'rows':_0x238302}:null;}})[_0x0dcd('0x15')](respondWithResult(_0x40d581,null))[_0x0dcd('0x1e')](handleError(_0x40d581,null));};exports[_0x0dcd('0x120')]=function(_0x43b66d,_0x5dd056){var _0x378c6a={};var _0x27fa2b={};var _0x47b473;return db[_0x0dcd('0x47')][_0x0dcd('0xc9')]({'where':{'id':_0x43b66d[_0x0dcd('0x59')]['id']}})['then'](handleEntityNotFound(_0x5dd056,null))['then'](function(_0xb47d39){if(_0xb47d39){_0x47b473=_0xb47d39;_0x27fa2b['model']=_[_0x0dcd('0x5c')](db[_0x0dcd('0x47')]['rawAttributes']);_0x27fa2b['query']=_[_0x0dcd('0x5c')](_0x43b66d[_0x0dcd('0x48')]);_0x27fa2b[_0x0dcd('0xce')]=_['intersection'](_0x27fa2b[_0x0dcd('0x5a')],_0x27fa2b[_0x0dcd('0x48')]);_0x378c6a[_0x0dcd('0x4e')]=_[_0x0dcd('0xca')](_0x27fa2b[_0x0dcd('0x5a')],qs['fields'](_0x43b66d[_0x0dcd('0x48')][_0x0dcd('0xcb')]));_0x378c6a['attributes']=_0x378c6a[_0x0dcd('0x4e')]['length']?_0x378c6a['attributes']:_0x27fa2b['model'];_0x378c6a['order']=qs[_0x0dcd('0xcd')](_0x43b66d[_0x0dcd('0x48')]['sort']);_0x378c6a[_0x0dcd('0x46')]=qs['filters'](_[_0x0dcd('0xcf')](_0x43b66d[_0x0dcd('0x48')],_0x27fa2b[_0x0dcd('0xce')]));if(_0x43b66d[_0x0dcd('0x48')]['filter']){_0x378c6a['where']=_[_0x0dcd('0x5e')](_0x378c6a[_0x0dcd('0x46')],{'$or':_[_0x0dcd('0x35')](_0x378c6a['attributes'],function(_0x1d1aaa){var _0x176c56={};_0x176c56[_0x1d1aaa]={'$like':'%'+_0x43b66d[_0x0dcd('0x48')][_0x0dcd('0x41')]+'%'};return _0x176c56;})});}_0x378c6a[_0x0dcd('0x5a')]=db[_0x0dcd('0x47')];_0x378c6a['as']=_0x0dcd('0x31');_0x378c6a=_[_0x0dcd('0x5e')]({},_0x378c6a,_0x43b66d[_0x0dcd('0xd0')]);return _0x47b473['getVoiceQueues']({'include':[_0x378c6a]});}})['then'](function(_0x28d62d){if(_0x28d62d){var _0x5cb9cf={},_0x126c70=[];for(var _0x4dd0f9=0x0;_0x4dd0f9<_0x28d62d[_0x0dcd('0x5d')];_0x4dd0f9+=0x1){for(var _0x483b3d=0x0,_0x408f27;_0x483b3d<_0x28d62d[_0x4dd0f9][_0x0dcd('0x31')][_0x0dcd('0x5d')];_0x483b3d+=0x1){_0x408f27=_0x28d62d[_0x4dd0f9][_0x0dcd('0x31')][_0x483b3d][_0x0dcd('0x2f')]({'plain':!![]});_0x5cb9cf[_0x408f27['id']]=_0x408f27;}}_0x5cb9cf=_[_0x0dcd('0x121')](_0x5cb9cf);for(var _0x23e079=qs['offset'](_0x43b66d[_0x0dcd('0x48')][_0x0dcd('0x26')]);_0x23e079<_0x5cb9cf[_0x0dcd('0x5d')]&&_0x126c70['length']=_0x2d7f47){_0x337d3c=_0x2d7f47;_0xd0db69=0xc8;}else{_0xd0db69=0xce;}_0x37d3f1['status'](_0xd0db69);return _0x37d3f1[_0x5f31('0x25')](_0x5f31('0x26'),_0x905a0c+'-'+_0x337d3c+'/'+_0x2d7f47)[_0x5f31('0x21')](_0x3abe49);}return null;};}function saveUpdates(_0x15b23f){return function(_0x2bcad6){if(_0x2bcad6){return _0x2bcad6[_0x5f31('0x27')](_0x15b23f)[_0x5f31('0x28')](function(_0x4618dc){if(_0x4618dc['role']===_0x5f31('0x29')){socket['emit'](_0x5f31('0x2a')+_0x4618dc['id'],_0x4618dc);}return _0x4618dc;});}return null;};}function removeEntity(_0x114999){return function(_0x902510){if(_0x902510){return _0x902510[_0x5f31('0x2b')]()[_0x5f31('0x28')](function(){var _0x1c9e59=_0x902510[_0x5f31('0x2c')]({'plain':!![]});if(_0x1c9e59[_0x5f31('0x2d')]==='admin')return;var _0x60f46a=[{'name':'Users','value':_0x5f31('0x2e'),'ignore':!![]},{'name':_0x5f31('0x2f'),'value':_0x5f31('0x29'),'ignore':![]},{'name':_0x5f31('0x30'),'value':_0x5f31('0x31'),'ignore':![]}];var _0x3d5940=_(_0x60f46a)[_0x5f31('0x32')]('ignore')['map'](_0x5f31('0x33'))['value']();if(_['includes'](_0x3d5940,_0x1c9e59[_0x5f31('0x2d')])){return;}var _0x56fdbc=_[_0x5f31('0x34')](_0x60f46a,[_0x5f31('0x33'),_0x1c9e59[_0x5f31('0x2d')]])[_0x5f31('0x35')];return db[_0x5f31('0x36')][_0x5f31('0x2b')]({'where':{'type':_0x56fdbc,'resourceId':_0x1c9e59['id']}})[_0x5f31('0x28')](function(){return _0x902510;});})['then'](function(){_0x114999[_0x5f31('0x20')](0xcc)[_0x5f31('0x37')]();});}};}function handleEntityNotFound(_0x20af79){return function(_0x311fb2){if(!_0x311fb2){_0x20af79[_0x5f31('0x38')](0x194);}return _0x311fb2;};}function handleError(_0x724e8e,_0x1f1b00){_0x1f1b00=_0x1f1b00||0x1f4;return function(_0x4ac8cc){logger[_0x5f31('0x1a')](_0x4ac8cc[_0x5f31('0x39')]);if(_0x4ac8cc[_0x5f31('0x35')]){delete _0x4ac8cc[_0x5f31('0x35')];}_0x724e8e[_0x5f31('0x20')](_0x1f1b00)[_0x5f31('0x3a')](_0x4ac8cc);};}exports[_0x5f31('0x3b')]=function(_0x48bf9f,_0x59b007){var _0x1d23f2={},_0x4e82e1={'count':0x0,'rows':[]};var _0x4df093=_(db['User'][_0x5f31('0x3c')])[_0x5f31('0x3d')](function(_0x1d1087){return{'name':_0x1d1087[_0x5f31('0x3e')],'type':_0x1d1087['type'][_0x5f31('0x3f')]};})['filter'](function(_0x4b161e){return!_['includes']([_0x5f31('0x40'),_0x5f31('0x41')],_0x4b161e[_0x5f31('0x35')]);})[_0x5f31('0x33')]();_0x1d23f2=qs[_0x5f31('0x42')](_0x4df093,_0x48bf9f);var _0x3a0fde={'where':_0x1d23f2[_0x5f31('0x43')]};return db[_0x5f31('0x44')]['count'](_0x3a0fde)['then'](function(_0x2a8c4c){_0x4e82e1[_0x5f31('0x24')]=_0x2a8c4c;if(_0x48bf9f[_0x5f31('0x45')]['includeAll']){_0x1d23f2['include']=[{'all':!![]}];}if(_0x48bf9f[_0x5f31('0x45')][_0x5f31('0x46')]===_0x5f31('0x47')){_0x1d23f2['include']=[{'model':db[_0x5f31('0x48')],'as':_0x5f31('0x46')}];}if(!_[_0x5f31('0x49')](_0x1d23f2[_0x5f31('0x4a')],'id')){_0x1d23f2[_0x5f31('0x4a')]['push']('id');}return db[_0x5f31('0x44')][_0x5f31('0x4b')](_0x1d23f2);})['then'](function(_0x5b37fc){_0x4e82e1[_0x5f31('0x4c')]=_0x5b37fc;if(_0x48bf9f[_0x5f31('0x45')]['openTabs']===_0x5f31('0x47')){var _0x478156=[];for(var _0xc307eb=0x0;_0xc307eb<_0x4e82e1[_0x5f31('0x4c')][_0x5f31('0x4d')];_0xc307eb++){_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x4e82e1['rows'][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x4e82e1['rows'][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs('fax',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb]['dataValues']));_0x478156[_0x5f31('0x4e')](get_open_tabs('mail',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs('openchannel',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x52'),_0x4e82e1['rows'][_0xc307eb]['dataValues']));}return Promise[_0x5f31('0x53')](_0x478156)[_0x5f31('0x28')](function(){return _0x4e82e1;});}else{return _0x4e82e1;}})['then'](respondWithFilteredResult(_0x59b007,_0x1d23f2))[_0x5f31('0x54')](handleError(_0x59b007,null));};exports[_0x5f31('0x55')]=function(_0x414d6a,_0x4552b7){var _0x181673={'raw':![],'where':{'id':_0x414d6a['params']['id']}},_0x71cd3f={};_0x71cd3f['model']=_[_0x5f31('0x56')](_[_0x5f31('0x57')](db[_0x5f31('0x44')]['rawAttributes']),[_0x5f31('0x40'),_0x5f31('0x41')]);_0x71cd3f[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x414d6a['query']);_0x71cd3f['filters']=_[_0x5f31('0x58')](_0x71cd3f[_0x5f31('0x59')],_0x71cd3f[_0x5f31('0x45')]);_0x181673[_0x5f31('0x4a')]=_['intersection'](_0x71cd3f[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x181673[_0x5f31('0x4a')]=_0x181673[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x181673[_0x5f31('0x4a')]:_0x71cd3f['model'];if(_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5b')]){_0x181673['include']=[{'all':!![]}];}if(_0x414d6a['query']['userSetting']===_0x5f31('0x47')){_0x181673[_0x5f31('0x5c')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x181673=_['merge']({},_0x181673,_0x414d6a[_0x5f31('0x5d')]);if(!_[_0x5f31('0x49')](_0x181673[_0x5f31('0x4a')],'id')){_0x181673[_0x5f31('0x4a')][_0x5f31('0x4e')]('id');}return db[_0x5f31('0x44')][_0x5f31('0x34')](_0x181673)[_0x5f31('0x28')](handleEntityNotFound(_0x4552b7,null))[_0x5f31('0x28')](function(_0x172592){var _0xeaf17f=[];values=_0x172592;if(_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5e')]==='true'){_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x172592[_0x5f31('0x50')]));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x172592[_0x5f31('0x50')]));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x5f'),_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x52'),_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs('fax',_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x60'),_0x172592[_0x5f31('0x50')]));return Promise[_0x5f31('0x53')](_0xeaf17f);}else{return values;}})['then'](function(){return values;})[_0x5f31('0x28')](respondWithResult(_0x4552b7,null))[_0x5f31('0x54')](handleError(_0x4552b7,null));};exports[_0x5f31('0x27')]=function(_0x140001,_0x274cbc){if(_0x140001['body']['id']){delete _0x140001[_0x5f31('0x61')]['id'];}delete _0x140001[_0x5f31('0x61')]['role'];return db[_0x5f31('0x44')]['find']({'where':{'id':_0x140001[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x274cbc,null))[_0x5f31('0x28')](saveUpdates(_0x140001['body'],null))[_0x5f31('0x28')](respondWithResult(_0x274cbc,null))[_0x5f31('0x54')](handleError(_0x274cbc,null));};exports[_0x5f31('0x63')]=function(_0x2299dd,_0x2c7060){return db[_0x5f31('0x44')][_0x5f31('0x63')]()[_0x5f31('0x28')](respondWithResult(_0x2c7060,null))[_0x5f31('0x54')](handleError(_0x2c7060,null));};exports[_0x5f31('0x64')]=function(_0x5bcb04,_0xa8769e){return db['User'][_0x5f31('0x34')]({'where':{'id':_0x5bcb04[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0xa8769e,null))['then'](function(_0x3b9812){if(_0x3b9812){return _0x3b9812[_0x5f31('0x64')](_0x5bcb04[_0x5f31('0x61')][_0x5f31('0x65')],_[_0x5f31('0x66')](_0x5bcb04[_0x5f31('0x61')],['ids','id'])||{});}})[_0x5f31('0x28')](respondWithResult(_0xa8769e,null))[_0x5f31('0x54')](handleError(_0xa8769e,null));};function validateUser(_0x2c7c75){return new Promise(function(_0x5b0ca4,_0x498293){if(_0x2c7c75['internal'])return _0x5b0ca4(_0x2c7c75);return db[_0x5f31('0x67')][_0x5f31('0x68')](0x1)['then'](function(_0x51d3e7){if(_0x51d3e7['securePassword'])authService[_0x5f31('0x69')](_0x2c7c75[_0x5f31('0x40')]);db[_0x5f31('0x44')][_0x5f31('0x6a')](_0x5f31('0x6b'))[_0x5f31('0x28')](function(_0x64d2c0){if(_[_0x5f31('0x6c')](_0x64d2c0)){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')]||0x1;return;}if(_[_0x5f31('0x6c')](_0x51d3e7['min_internal'])||_0x51d3e7[_0x5f31('0x6d')]===_0x64d2c0){_0x2c7c75[_0x5f31('0x6b')]=_0x64d2c0+0x1;return;}if(_0x51d3e7['min_internal']>_0x64d2c0){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')];return;}return db['sequelize'][_0x5f31('0x45')](_0x5f31('0x6e'),{'type':db[_0x5f31('0x6f')][_0x5f31('0x70')][_0x5f31('0x71')]})[_0x5f31('0x28')](function(_0x1d25cb){if(_0x1d25cb&&_0x1d25cb[_0x5f31('0x4d')]){for(var _0x5f1279=0x0,_0xff49=_0x1d25cb[_0x5f31('0x4d')];_0x5f1279<_0xff49&&_[_0x5f31('0x6c')](_0x2c7c75['internal']);_0x5f1279++){if(_0x51d3e7['min_internal']<=_0x1d25cb[_0x5f1279]['from']){_0x2c7c75[_0x5f31('0x6b')]=_0x1d25cb[_0x5f1279]['from'];}else if(_0x51d3e7[_0x5f31('0x6d')]>_0x1d25cb[_0x5f1279][_0x5f31('0x72')]&&_0x51d3e7[_0x5f31('0x6d')]<=_0x1d25cb[_0x5f1279]['to']){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')];}}}if(_['isNil'](_0x2c7c75[_0x5f31('0x6b')])){_0x2c7c75['internal']=_0x64d2c0+0x1;}return _0x5b0ca4(_0x2c7c75);});});})['catch'](function(_0x16b037){_0x498293(_0x16b037);});});}function updateUser(_0x79e150){return new Promise(function(_0x122a17,_0x4116f6){try{if(_0x79e150[_0x5f31('0x73')]){_0x79e150[_0x5f31('0x74')]=_0x79e150[_0x5f31('0x6b')];_0x79e150[_0x5f31('0x75')]={'mailbox':_0x79e150[_0x5f31('0x6b')],'password':_0x79e150[_0x5f31('0x40')],'fullname':_0x79e150['fullname'],'email':_0x79e150['email']};}if(_0x79e150[_0x5f31('0x2d')]===_0x5f31('0x29')){if(!_0x79e150[_0x5f31('0x76')])_0x79e150[_0x5f31('0x76')]=['101','102',_0x5f31('0x77'),'113',_0x5f31('0x78'),_0x5f31('0x79'),_0x5f31('0x7a'),'106',_0x5f31('0x7b'),_0x5f31('0x7c'),_0x5f31('0x7d'),_0x5f31('0x7e'),_0x5f31('0x7f'),'114',_0x5f31('0x80')];}_0x122a17(_0x79e150);}catch(_0x1093e4){_0x4116f6(_0x1093e4);}});}exports['create']=function(_0x3bfaf1,_0xaf7746){if(_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x2d')]===_0x5f31('0x29'))throw new Error(_0x5f31('0x81'));if(_0x3bfaf1[_0x5f31('0x61')][_0x5f31('0x2d')]==='user'&&_0x3bfaf1['user']['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bfaf1[_0x5f31('0x61')][_0x5f31('0x2d')]===_0x5f31('0x82')&&_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x2d')]!==_0x5f31('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x3bfaf1[_0x5f31('0x61')]])['then'](function(){return validateUser(_0x3bfaf1['body']);})[_0x5f31('0x28')](function(_0x21d977){return updateUser(_0x21d977)[_0x5f31('0x28')](function(_0x459798){if(_0x459798[_0x5f31('0x2d')]==='admin'){_0x459798['settingsEnabled']=_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x83')];delete _0x459798['userProfileId'];}return _0x459798;});})[_0x5f31('0x28')](function(_0x4eddb3){return db['User']['create'](_0x4eddb3,{'include':[{'model':db[_0x5f31('0x75')],'as':_0x5f31('0x75')}]});})[_0x5f31('0x28')](function(_0x599254){if(_0x3bfaf1[_0x5f31('0x61')]['role']===_0x5f31('0x2e'))return _0x599254;if(_0x3bfaf1['user']['role']!==_0x5f31('0x2e'))return _0x599254;return db[_0x5f31('0x84')][_0x5f31('0x34')]({'where':{'name':_0x599254[_0x5f31('0x2d')]===_0x5f31('0x29')?_0x5f31('0x2f'):_0x5f31('0x30'),'userProfileId':_0x3bfaf1['user'][_0x5f31('0x85')]},'raw':!![]})[_0x5f31('0x28')](function(_0x916495){if(!_0x916495||_0x916495[_0x5f31('0x86')]!=0x0)return _0x599254;return db[_0x5f31('0x36')][_0x5f31('0x87')]({'name':_0x599254[_0x5f31('0x35')],'resourceId':_0x599254['id'],'type':_0x916495[_0x5f31('0x35')],'sectionId':_0x916495['id']},{})[_0x5f31('0x28')](function(){return _0x599254;});})[_0x5f31('0x54')](function(_0x96beb3){logger[_0x5f31('0x1a')](_0x5f31('0x88'),_0x96beb3);throw _0x96beb3;});})[_0x5f31('0x28')](respondWithResult(_0xaf7746,0xc9))['catch'](handleError(_0xaf7746,null));};exports[_0x5f31('0x89')]=function(_0x52be1f,_0x287337){var _0x4064d1=_0x52be1f[_0x5f31('0x61')];var _0x133129=[];if(_0x52be1f['user']['role']===_0x5f31('0x29'))throw new Error(_0x5f31('0x81'));if(_[_0x5f31('0x8a')](_0x4064d1,[_0x5f31('0x2d'),_0x5f31('0x2e')])&&_0x52be1f['user'][_0x5f31('0x2d')]!==_0x5f31('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x5f31('0x8a')](_0x4064d1,[_0x5f31('0x2d'),_0x5f31('0x82')])&&_0x52be1f[_0x5f31('0x2e')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x5f31('0x8b')](_0x4064d1)[_0x5f31('0x28')](function(){return validateUser(_0x4064d1[0x0]);})[_0x5f31('0x28')](function(){for(var _0x2a5a53=0x1;_0x2a5a53<_0x4064d1[_0x5f31('0x4d')];_0x2a5a53++){var _0x19c995=_0x4064d1[_0x2a5a53-0x1][_0x5f31('0x6b')];if(!_0x4064d1[_0x2a5a53][_0x5f31('0x6b')])_0x4064d1[_0x2a5a53][_0x5f31('0x6b')]=_0x19c995+0x1;_0x133129[_0x5f31('0x4e')](validateUser(_0x4064d1[_0x2a5a53]));}return Promise[_0x5f31('0x53')](_0x133129);})['then'](function(){_0x133129=[];for(var _0x354f31=0x0;_0x354f31<_0x4064d1[_0x5f31('0x4d')];_0x354f31++){_0x133129[_0x5f31('0x4e')](updateUser(_0x4064d1[_0x354f31]));}return Promise[_0x5f31('0x53')](_0x133129);})['then'](function(){_0x133129=_0x4064d1['map'](function(_0xd839ff){return db[_0x5f31('0x44')][_0x5f31('0x87')](_0xd839ff,{'include':[{'model':db[_0x5f31('0x75')],'as':_0x5f31('0x75')}]})[_0x5f31('0x28')](function(_0x2a2e27){_0xd839ff['id']=_0x2a2e27['id'];return _0xd839ff;});});return Promise['all'](_0x133129);})[_0x5f31('0x28')](function(_0x558b6c){if(_0x52be1f[_0x5f31('0x61')]['role']===_0x5f31('0x2e'))return _0x558b6c;if(_0x52be1f[_0x5f31('0x2e')][_0x5f31('0x2d')]!=='user')return _0x558b6c;var _0x5b4342=_[_0x5f31('0x8a')](_0x558b6c,function(_0x34d69f){return _0x34d69f['role']==='agent'||_0x34d69f['role']===_0x5f31('0x31');});if(!_0x5b4342)return _0x558b6c;return db[_0x5f31('0x84')][_0x5f31('0x4b')]({'where':{'name':{'$or':['Agents',_0x5f31('0x30')]},'userProfileId':_0x52be1f[_0x5f31('0x2e')]['userProfileId']},'raw':!![]})['then'](function(_0x2ca801){if(_['isEmpty'](_0x2ca801)||!_[_0x5f31('0x8a')](_0x2ca801,[_0x5f31('0x86'),0x0]))return _0x558b6c;_0x133129=[];var _0x9b2ba5=_(_0x2ca801)[_0x5f31('0x3d')](function(_0xd9c1c6){if(_0xd9c1c6[_0x5f31('0x86')]===0x1)return;return _0xd9c1c6[_0x5f31('0x35')]==='Agents'?'agent':_0x5f31('0x31');})['compact']()['value']();for(var _0x3dbc65=0x0;_0x3dbc65<_0x558b6c[_0x5f31('0x4d')];_0x3dbc65++){if(!_[_0x5f31('0x49')](_0x9b2ba5,_0x558b6c[_0x3dbc65]['role']))return;var _0x181192=_0x558b6c[_0x3dbc65]['role']===_0x5f31('0x29')?_0x5f31('0x2f'):_0x5f31('0x30');_0x133129[_0x5f31('0x4e')](db[_0x5f31('0x36')][_0x5f31('0x87')]({'name':_0x558b6c[_0x3dbc65][_0x5f31('0x35')],'resourceId':_0x558b6c[_0x3dbc65]['id'],'type':_0x181192,'sectionId':_[_0x5f31('0x34')](_0x2ca801,[_0x5f31('0x35'),_0x181192])['id']},{}));}return Promise[_0x5f31('0x53')](_0x133129);});})[_0x5f31('0x28')](respondWithResult(_0x287337,0xc9))['catch'](handleError(_0x287337,null));};exports[_0x5f31('0x8c')]=function(_0x4934cc,_0x4a148e){if(_0x4934cc[_0x5f31('0x61')]['id']){delete _0x4934cc[_0x5f31('0x61')]['id'];}return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4934cc[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](function(_0x1c608d){if(!_0x1c608d)return null;if(_0x1c608d['id']===_0x4934cc[_0x5f31('0x2e')]['id']){if(!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8d')]||!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x91'));}if(!_0x1c608d[_0x5f31('0x92')](_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8d')])){throw new db[(_0x5f31('0x8f'))]['ValidationError']('Wrong\x20credentials');}if(_0x4934cc['body'][_0x5f31('0x8d')]===_0x4934cc['body'][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4934cc[_0x5f31('0x2e')][_0x5f31('0x2d')]==='admin'){if(!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x93'));}}else if(_0x4934cc[_0x5f31('0x2e')][_0x5f31('0x2d')]===_0x5f31('0x2e')){if(!_0x4934cc[_0x5f31('0x61')]['newPassword']){throw new db[(_0x5f31('0x8f'))]['ValidationError'](_0x5f31('0x93'));}if(_0x1c608d[_0x5f31('0x2d')]!==_0x5f31('0x29')){throw new db['Sequelize'][(_0x5f31('0x90'))]('Unauthorized');}}else{throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x81'));}return _0x1c608d;})['then'](handleEntityNotFound(_0x4a148e,null))['then'](function(_0x238479){return db['Setting'][_0x5f31('0x94')]({'attributes':['id',_0x5f31('0x95'),_0x5f31('0x96'),_0x5f31('0x97')]})[_0x5f31('0x28')](function(_0x3ce54a){if(_0x3ce54a[_0x5f31('0x95')])authService[_0x5f31('0x69')](_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]);if(!_0x3ce54a[_0x5f31('0x96')]||!_0x238479[_0x5f31('0x98')])return _0x238479;authService['validatePasswordHistory'](_0x4934cc['body'][_0x5f31('0x8e')],_0x238479[_0x5f31('0x98')],_0x3ce54a[_0x5f31('0x97')]);return _0x238479;})[_0x5f31('0x28')](saveUpdates({'password':_0x4934cc['body']['newPassword'],'passwordResetAt':_0x4934cc['user']['id']==_0x4934cc[_0x5f31('0x62')]['id']?moment():null,'previousPasswords':authService[_0x5f31('0x99')](_0x4934cc[_0x5f31('0x61')]['newPassword'],_0x238479[_0x5f31('0x98')])},null));})['then'](respondWithResult(_0x4a148e,null))[_0x5f31('0x54')](handleError(_0x4a148e,null));};exports[_0x5f31('0x9a')]=function(_0x3852f4,_0x502111){var _0x3d7035=_0x3852f4['body'][_0x5f31('0x9b')];return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x3852f4[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d'),_0x5f31('0x9c'),_0x5f31('0x9d'),_0x5f31('0x9e'),'interface']})[_0x5f31('0x28')](handleEntityNotFound(_0x502111,null))['then'](function(_0x56b9a6){if(_0x56b9a6){if(!utils[_0x5f31('0x9f')](_0x3d7035)){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}return _0x56b9a6[_0x5f31('0xa1')+_[_0x5f31('0xa2')](_0x3d7035[_0x5f31('0xa3')]())+'Queues'](_0x3852f4[_0x5f31('0x61')]['ids'],{'penalty':_0x3852f4[_0x5f31('0x61')]['penalty']||0x0})[_0x5f31('0xa4')](function(_0xb2278c){for(var _0x1a644b=0x0;_0x1a644b<_0x3852f4[_0x5f31('0x61')][_0x5f31('0x65')][_0x5f31('0x4d')];_0x1a644b+=0x1){var _0x3f3e14={'UserId':Number(_0x3852f4[_0x5f31('0x62')]['id'])};_0x3f3e14[_[_0x5f31('0xa2')](_0x3d7035[_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x3852f4[_0x5f31('0x61')]['ids'][_0x1a644b]);socket[_0x5f31('0xa6')]('user'+_['capitalize'](_0x3d7035[_0x5f31('0xa3')]())+_0x5f31('0xa7'),_0x3f3e14);}return _0xb2278c;})[_0x5f31('0x28')](function(){if(_0x3d7035===_0x5f31('0xa8')){return db[_0x5f31('0xa9')]['findAll']({'where':{'id':_0x3852f4['body']['ids']||[]},'raw':!![],'attributes':['id',_0x5f31('0x35')]});}})[_0x5f31('0x28')](function(_0x4ee5d2){var _0x4fa32d=_0x56b9a6[_0x5f31('0x2c')]({'plain':!![]});var _0x2d00e4=[];if(_0x3d7035==='voice'&&_0x4fa32d[_0x5f31('0x2d')]==='agent'&&_0x4fa32d['online']){for(let _0x488a76=0x0;_0x488a76<_0x4ee5d2[_0x5f31('0x4d')];_0x488a76+=0x1){_0x2d00e4[_0x5f31('0x4e')]({'membername':_0x4fa32d[_0x5f31('0x35')],'UserId':_0x4fa32d['id'],'queue_name':_0x4ee5d2[_0x488a76][_0x5f31('0x35')],'VoiceQueueId':_0x4ee5d2[_0x488a76]['id'],'interface':_[_0x5f31('0x6c')](_0x4fa32d[_0x5f31('0xaa')])?util[_0x5f31('0xab')]('SIP/%s',_0x4fa32d[_0x5f31('0x35')]):_0x4fa32d[_0x5f31('0xaa')],'paused':_0x4fa32d[_0x5f31('0x9e')]||![],'penalty':_0x3852f4['body'][_0x5f31('0xac')]||0x0});}return Promise[_0x5f31('0x53')](_0x2d00e4[_0x5f31('0x3d')](function(_0x76f00a){return db[_0x5f31('0xad')]['upsert'](_0x76f00a);}));}return _0x56b9a6;});}})[_0x5f31('0x28')](respondWithStatusCode(_0x502111,null))['catch'](handleError(_0x502111,null));};exports[_0x5f31('0xae')]=function(_0x4f4562,_0x2fe31a){var _0x195d0e,_0x186c86;return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4f4562[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})['then'](handleEntityNotFound(_0x2fe31a,null))[_0x5f31('0x28')](function(_0x42483a){if(_0x42483a){_0x195d0e=_0x42483a;if(!_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')]||!utils[_0x5f31('0x9f')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')])){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}return _0x42483a[_0x5f31('0xaf')+_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')]['channel'][_0x5f31('0xa3')]())+'Queues'](_0x4f4562[_0x5f31('0x45')]['ids']);}})[_0x5f31('0x28')](function(_0x6b9c34){if(_['isArray'](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x65')])){for(var _0x3b407d=0x0;_0x3b407d<_0x4f4562[_0x5f31('0x45')][_0x5f31('0x65')]['length'];_0x3b407d+=0x1){_0x186c86={'UserId':Number(_0x4f4562[_0x5f31('0x62')]['id'])};_0x186c86[_[_0x5f31('0xa2')](_0x4f4562['query']['channel'][_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x4f4562['query'][_0x5f31('0x65')][_0x3b407d]);socket[_0x5f31('0xa6')](_0x5f31('0x2e')+_[_0x5f31('0xa2')](_0x4f4562['query'][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xb0'),_0x186c86);}}else{_0x186c86={'UserId':Number(_0x4f4562['params']['id'])};_0x186c86[_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x4f4562[_0x5f31('0x45')]['ids']);socket[_0x5f31('0xa6')]('user'+_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xb0'),_0x186c86);}return _0x6b9c34;})[_0x5f31('0x28')](function(){if(_0x4f4562['query']['channel']==='voice'){return db[_0x5f31('0xad')]['destroy']({'where':{'UserId':_0x4f4562['params']['id'],'VoiceQueueId':_0x4f4562[_0x5f31('0x45')]['ids']},'individualHooks':!![]})[_0x5f31('0x28')](function(){return _0x195d0e;});}return _0x195d0e;})[_0x5f31('0x28')](respondWithStatusCode(_0x2fe31a,null))[_0x5f31('0x54')](handleError(_0x2fe31a,null));};exports[_0x5f31('0xb1')]=function(_0x7376fb,_0x4db7b1){_0x7376fb[_0x5f31('0x61')]['userpic']=_0x7376fb[_0x5f31('0xb2')][_0x5f31('0xb3')];return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x7376fb[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4db7b1,null))[_0x5f31('0x28')](saveUpdates(_0x7376fb[_0x5f31('0x61')],null))['then'](respondWithResult(_0x4db7b1,null))[_0x5f31('0x54')](handleError(_0x4db7b1,null));};exports[_0x5f31('0xb4')]=function(_0x50ce2f,_0x472cf7){var _0x2ef78b=path['join'](config['root'],_0x5f31('0xb5'));return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x50ce2f[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0xb6')],'raw':!![]})[_0x5f31('0x28')](handleEntityNotFound(_0x472cf7,null))[_0x5f31('0x28')](function(_0x5037a9){if(_0x5037a9){if(_[_0x5f31('0x6c')](_0x5037a9[_0x5f31('0xb6')])){return _0x472cf7[_0x5f31('0xb7')](_0x2ef78b);}else{if(!fs[_0x5f31('0xb8')](path[_0x5f31('0xb9')](config[_0x5f31('0xba')],_0x5f31('0xbb'),_0x5037a9['userpic']))){return _0x472cf7[_0x5f31('0xb7')](_0x2ef78b);}return _0x472cf7[_0x5f31('0xb7')](path[_0x5f31('0xb9')](config[_0x5f31('0xba')],_0x5f31('0xbb'),_0x5037a9['userpic']));}}})['catch'](handleError(_0x472cf7,null));};exports[_0x5f31('0xbc')]=function(_0x5b14de,_0x348899){return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x5b14de[_0x5f31('0x62')]['id']},'attributes':['id']})[_0x5f31('0x28')](handleEntityNotFound(_0x348899,null))[_0x5f31('0x28')](function(_0x37c646){var _0x3f8fa4=[];values=_0x37c646[_0x5f31('0x50')];_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x5f'),_0x37c646['dataValues']));_0x3f8fa4['push'](get_open_tabs(_0x5f31('0x52'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4['push'](get_open_tabs('fax',_0x37c646['dataValues']));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs('mail',_0x37c646[_0x5f31('0x50')]));return Promise['all'](_0x3f8fa4);})['then'](function(_0x6c8d2e){if(_0x6c8d2e){var _0x5f408a=_[_0x5f31('0x3d')](values['ChatOpenTabs'],function(_0x1848e7){return{'channel':_0x5f31('0xbd'),'id':_0x1848e7['id'],'createdAt':_0x1848e7[_0x5f31('0xbe')]};});var _0x587e07=_['map'](values['FaxOpenTabs'],function(_0x42d49e){return{'channel':_0x5f31('0xbf'),'id':_0x42d49e['id'],'createdAt':_0x42d49e[_0x5f31('0xbe')]};});var _0x111671=_[_0x5f31('0x3d')](values[_0x5f31('0xc0')],function(_0x574f80){return{'channel':'OPENCHANNEL','id':_0x574f80['id'],'createdAt':_0x574f80['createdAt']};});var _0x2c6f31=_['map'](values[_0x5f31('0xc1')],function(_0x524d1b){return{'channel':_0x5f31('0xc2'),'id':_0x524d1b['id'],'createdAt':_0x524d1b[_0x5f31('0xbe')]};});var _0x3bb49a=_['map'](values[_0x5f31('0xc3')],function(_0x12bedd){return{'channel':_0x5f31('0xc4'),'id':_0x12bedd['id'],'createdAt':_0x12bedd[_0x5f31('0xbe')]};});var _0x39af48=_[_0x5f31('0x3d')](values[_0x5f31('0xc5')],function(_0x42ea02){return{'channel':_0x5f31('0xc6'),'id':_0x42ea02['id'],'createdAt':_0x42ea02[_0x5f31('0xbe')]};});var _0x392704=_[_0x5f31('0xc7')](_0x5f408a,_0x587e07,_0x111671,_0x2c6f31,_0x3bb49a,_0x39af48);var _0x3199d0={'count':_0x392704['length'],'rows':_0x392704};return _0x3199d0;}else return null;})[_0x5f31('0x28')](respondWithResult(_0x348899,null))['catch'](handleError(_0x348899,null));};exports[_0x5f31('0xc8')]=function(_0x5d9d32,_0x4c0db8){var _0x4f61c5={};var _0x1968a4={};var _0x338abe;var _0x8305d4;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x5d9d32[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4c0db8,null))['then'](function(_0x45f89a){if(_0x45f89a){_0x338abe=_0x45f89a;_0x1968a4[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xc9')][_0x5f31('0x3c')]);_0x1968a4['query']=_['keys'](_0x5d9d32[_0x5f31('0x45')]);_0x1968a4[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x1968a4[_0x5f31('0x59')],_0x1968a4[_0x5f31('0x45')]);_0x4f61c5['attributes']=_[_0x5f31('0x58')](_0x1968a4[_0x5f31('0x59')],qs['fields'](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x4f61c5['attributes']=_0x4f61c5['attributes'][_0x5f31('0x4d')]?_0x4f61c5[_0x5f31('0x4a')]:_0x1968a4[_0x5f31('0x59')];_0x4f61c5[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x4f61c5[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x5d9d32[_0x5f31('0x45')],_0x1968a4[_0x5f31('0xca')]));if(_0x5d9d32['query'][_0x5f31('0x32')]){_0x4f61c5['where']=_['merge'](_0x4f61c5[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x4f61c5[_0x5f31('0x4a')],function(_0x3d4656){var _0x2653ff={};_0x2653ff[_0x3d4656]={'$like':'%'+_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x2653ff;})});}_0x4f61c5=_[_0x5f31('0xce')]({},_0x4f61c5,_0x5d9d32[_0x5f31('0x5d')]);return _0x338abe['getContacts'](_0x4f61c5);}})[_0x5f31('0x28')](function(_0xe86e87){if(_0xe86e87){_0x8305d4=_0xe86e87['length'];if(_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0x5b'))){_0x4f61c5[_0x5f31('0x5c')]=[{'model':db[_0x5f31('0xd0')],'as':'List','required':![]},{'model':db[_0x5f31('0xd1')],'as':'Tags','attributes':['id',_0x5f31('0x35'),_0x5f31('0xd2')],'where':_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xd3')]?{'id':_0x5d9d32['query']['tag']}:undefined,'required':_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xd3')]?!![]:![]}];}if(!_0x5d9d32[_0x5f31('0x45')]['hasOwnProperty'](_0x5f31('0xd4'))){_0x4f61c5[_0x5f31('0xd5')]=qs['limit'](_0x5d9d32['query'][_0x5f31('0xd5')]);_0x4f61c5[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x338abe[_0x5f31('0xc8')](_0x4f61c5);}})['then'](function(_0x53da25){if(_0x53da25){return _0x53da25?{'count':_0x8305d4,'rows':_0x53da25}:null;}})['then'](respondWithResult(_0x4c0db8,null))[_0x5f31('0x54')](handleError(_0x4c0db8,null));};exports[_0x5f31('0xd6')]=function(_0x838017,_0xb5e189){var _0x1c0787;var _0x2e84fd={};var _0x43ce17;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x838017['params']['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})[_0x5f31('0x28')](handleEntityNotFound(_0xb5e189,null))[_0x5f31('0x28')](function(_0x5abb0e){if(!utils[_0x5f31('0x9f')](_0x838017['query'][_0x5f31('0x9b')])){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}_0x1c0787=_0x5abb0e;var _0x1b58a0={};_0x1b58a0[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_['capitalize'](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd7')][_0x5f31('0x3c')]);_0x1b58a0[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x838017['query']);_0x1b58a0['filters']=_[_0x5f31('0x58')](_0x1b58a0['model'],_0x1b58a0[_0x5f31('0x45')]);_0x2e84fd[_0x5f31('0x4a')]=_['intersection'](_0x1b58a0[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x838017[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x2e84fd[_0x5f31('0x4a')]=_0x2e84fd[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x2e84fd[_0x5f31('0x4a')]:_0x1b58a0[_0x5f31('0x59')];_0x2e84fd[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x838017['query']['sort']);_0x2e84fd[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x838017[_0x5f31('0x45')],_0x1b58a0[_0x5f31('0xca')]));if(_0x838017[_0x5f31('0x45')][_0x5f31('0x32')]){_0x2e84fd[_0x5f31('0x43')]=_['merge'](_0x2e84fd[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x2e84fd[_0x5f31('0x4a')],function(_0x3baff0){var _0x557c79={};_0x557c79[_0x3baff0]={'$like':'%'+_0x838017[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x557c79;})});}_0x2e84fd=_[_0x5f31('0xce')]({},_0x2e84fd,_0x838017[_0x5f31('0x5d')]);switch(_0x1c0787['role']){case _0x5f31('0x82'):return db[_[_0x5f31('0xa2')](_0x838017['query'][_0x5f31('0x9b')])+_0x5f31('0xd7')][_0x5f31('0x4b')](_0x2e84fd);case _0x5f31('0x2e'):case _0x5f31('0x29'):return _0x1c0787[_0x5f31('0x2c')+_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd8')](_0x2e84fd);default:throw new db['Sequelize'][(_0x5f31('0x90'))](_0x5f31('0xd9'));}})[_0x5f31('0x28')](function(_0x36c6df){_0x43ce17=_0x36c6df['length'];if(!_0x838017[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x2e84fd[_0x5f31('0xd5')]=qs['limit'](_0x838017[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x2e84fd[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x838017[_0x5f31('0x45')]['offset']);}switch(_0x1c0787['role']){case _0x5f31('0x82'):return db[_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+'Queue'][_0x5f31('0x4b')](_0x2e84fd);case _0x5f31('0x2e'):case _0x5f31('0x29'):return _0x1c0787[_0x5f31('0x2c')+_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd8')](_0x2e84fd);}})['then'](function(_0x28034d){return{'count':_0x43ce17,'rows':_0x28034d};})[_0x5f31('0x28')](respondWithResult(_0xb5e189,null))[_0x5f31('0x54')](handleError(_0xb5e189,null));};exports[_0x5f31('0xda')]=function(_0x228e30,_0x21b3f3){var _0x2e3e1e={};var _0xe20453={};var _0x22a49d;var _0x35e91e;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x228e30[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x21b3f3,null))[_0x5f31('0x28')](function(_0x241a4b){if(_0x241a4b){_0x22a49d=_0x241a4b;_0xe20453[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xad')][_0x5f31('0x3c')]);_0xe20453[_0x5f31('0x45')]=_['keys'](_0x228e30['query']);_0xe20453[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0xe20453[_0x5f31('0x59')],_0xe20453[_0x5f31('0x45')]);_0x2e3e1e[_0x5f31('0x4a')]=_['intersection'](_0xe20453[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x228e30[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x2e3e1e[_0x5f31('0x4a')]=_0x2e3e1e[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x2e3e1e[_0x5f31('0x4a')]:_0xe20453[_0x5f31('0x59')];_0x2e3e1e[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x228e30[_0x5f31('0x45')]['sort']);_0x2e3e1e['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x228e30[_0x5f31('0x45')],_0xe20453[_0x5f31('0xca')]));if(_0x228e30[_0x5f31('0x45')]['filter']){_0x2e3e1e[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x2e3e1e[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x2e3e1e['attributes'],function(_0x1eb907){var _0x46af6e={};_0x46af6e[_0x1eb907]={'$like':'%'+_0x228e30[_0x5f31('0x45')]['filter']+'%'};return _0x46af6e;})});}_0x2e3e1e=_['merge']({},_0x2e3e1e,_0x228e30['options']);return _0x22a49d[_0x5f31('0xda')](_0x2e3e1e);}})[_0x5f31('0x28')](function(_0x1c8c08){if(_0x1c8c08){_0x35e91e=_0x1c8c08[_0x5f31('0x4d')];if(!_0x228e30[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x2e3e1e['limit']=qs[_0x5f31('0xd5')](_0x228e30[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x2e3e1e[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x228e30[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x22a49d[_0x5f31('0xda')](_0x2e3e1e);}})[_0x5f31('0x28')](function(_0x21b259){if(_0x21b259){return _0x21b259?{'count':_0x35e91e,'rows':_0x21b259}:null;}})['then'](respondWithResult(_0x21b3f3,null))[_0x5f31('0x54')](handleError(_0x21b3f3,null));};exports[_0x5f31('0xdb')]=function(_0xde5b4f,_0x11deb3){var _0x507031={};var _0x370941={};var _0x4a8038;var _0x2ea4e1;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xde5b4f[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x11deb3,null))[_0x5f31('0x28')](function(_0x385106){if(_0x385106){_0x4a8038=_0x385106;_0x370941[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xdc')]['rawAttributes']);_0x370941[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0xde5b4f[_0x5f31('0x45')]);_0x370941[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x370941[_0x5f31('0x59')],_0x370941[_0x5f31('0x45')]);_0x507031[_0x5f31('0x4a')]=_[_0x5f31('0x58')](_0x370941[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xde5b4f[_0x5f31('0x45')]['fields']));_0x507031['attributes']=_0x507031['attributes'][_0x5f31('0x4d')]?_0x507031['attributes']:_0x370941['model'];_0x507031['order']=qs[_0x5f31('0xcc')](_0xde5b4f[_0x5f31('0x45')]['sort']);_0x507031['where']=qs[_0x5f31('0xca')](_['pick'](_0xde5b4f[_0x5f31('0x45')],_0x370941[_0x5f31('0xca')]));if(_0xde5b4f[_0x5f31('0x45')]['filter']){_0x507031[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x507031[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x507031[_0x5f31('0x4a')],function(_0x1e2cb1){var _0x21df9f={};_0x21df9f[_0x1e2cb1]={'$like':'%'+_0xde5b4f[_0x5f31('0x45')]['filter']+'%'};return _0x21df9f;})});}_0x507031=_[_0x5f31('0xce')]({},_0x507031,_0xde5b4f['options']);return _0x4a8038[_0x5f31('0xdb')](_0x507031);}})[_0x5f31('0x28')](function(_0x53ede8){if(_0x53ede8){_0x2ea4e1=_0x53ede8[_0x5f31('0x4d')];if(!_0xde5b4f[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x507031['limit']=qs['limit'](_0xde5b4f[_0x5f31('0x45')]['limit']);_0x507031[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xde5b4f['query'][_0x5f31('0x22')]);}return _0x4a8038[_0x5f31('0xdb')](_0x507031);}})[_0x5f31('0x28')](function(_0x2c82b9){if(_0x2c82b9){return _0x2c82b9?{'count':_0x2ea4e1,'rows':_0x2c82b9}:null;}})['then'](respondWithResult(_0x11deb3,null))['catch'](handleError(_0x11deb3,null));};exports['getRecordings']=function(_0x956620,_0x4351d7){var _0x4626af={'raw':!![],'where':{}};var _0x15a7cb={};var _0x46d841={'count':0x0,'rows':[]};return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x956620['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4351d7,null))[_0x5f31('0x28')](function(_0x3cc1ac){if(_0x3cc1ac){_0x15a7cb[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xdd')][_0x5f31('0x3c')]);_0x15a7cb['query']=_[_0x5f31('0x57')](_0x956620['query']);_0x15a7cb[_0x5f31('0xca')]=_['intersection'](_0x15a7cb['model'],_0x15a7cb[_0x5f31('0x45')]);_0x4626af['attributes']=_[_0x5f31('0x58')](_0x15a7cb[_0x5f31('0x59')],qs['fields'](_0x956620[_0x5f31('0x45')]['fields']));_0x4626af[_0x5f31('0x4a')]=_0x4626af['attributes'][_0x5f31('0x4d')]?_0x4626af[_0x5f31('0x4a')]:_0x15a7cb[_0x5f31('0x59')];if(!_0x956620[_0x5f31('0x45')][_0x5f31('0xcf')]('nolimit')){_0x4626af['limit']=qs['limit'](_0x956620[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x4626af[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x956620[_0x5f31('0x45')][_0x5f31('0x22')]);}_0x4626af[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x956620[_0x5f31('0x45')]['sort']);_0x4626af[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x956620[_0x5f31('0x45')],_0x15a7cb[_0x5f31('0xca')]));_0x4626af[_0x5f31('0x43')][_0x5f31('0xde')]=_0x3cc1ac['id'];if(_0x956620[_0x5f31('0x45')][_0x5f31('0x32')]){_0x4626af['where']=_['merge'](_0x4626af['where'],{'$or':_[_0x5f31('0x3d')](_0x4626af[_0x5f31('0x4a')],function(_0xeb72f3){var _0x136cd0={};_0x136cd0[_0xeb72f3]={'$like':'%'+_0x956620[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x136cd0;})});}_0x4626af=_[_0x5f31('0xce')]({},_0x4626af,_0x956620[_0x5f31('0x5d')]);return db[_0x5f31('0xdd')][_0x5f31('0x24')]({'where':_0x4626af[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x461f06){_0x46d841[_0x5f31('0x24')]=_0x461f06;if(_0x956620['query'][_0x5f31('0x5b')]){_0x4626af['include']=[{'all':!![]}];}return db[_0x5f31('0xdd')][_0x5f31('0x4b')](_0x4626af);})['then'](function(_0x4283c3){_0x46d841['rows']=_0x4283c3;return _0x46d841;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x4351d7,_0x4626af))[_0x5f31('0x54')](handleError(_0x4351d7,null));};exports[_0x5f31('0xdf')]=function(_0x8b2ddf,_0x3ef433){var _0x6b47e7={'raw':!![],'where':{}};var _0x13b2c1={};var _0x3b1327={'count':0x0,'rows':[]};return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x8b2ddf[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x3ef433,null))['then'](function(_0x1369f5){if(_0x1369f5){_0x13b2c1['model']=_[_0x5f31('0x57')](db[_0x5f31('0xe0')]['rawAttributes']);_0x13b2c1[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x8b2ddf[_0x5f31('0x45')]);_0x13b2c1[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x13b2c1[_0x5f31('0x59')],_0x13b2c1[_0x5f31('0x45')]);_0x6b47e7['attributes']=_[_0x5f31('0x58')](_0x13b2c1[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x8b2ddf['query'][_0x5f31('0x5a')]));_0x6b47e7['attributes']=_0x6b47e7[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x6b47e7[_0x5f31('0x4a')]:_0x13b2c1['model'];if(!_0x8b2ddf[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x6b47e7[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x8b2ddf[_0x5f31('0x45')]['limit']);_0x6b47e7[_0x5f31('0x22')]=qs['offset'](_0x8b2ddf['query']['offset']);}_0x6b47e7['order']=qs[_0x5f31('0xcc')](_0x8b2ddf['query'][_0x5f31('0xcc')]);_0x6b47e7[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_['pick'](_0x8b2ddf['query'],_0x13b2c1[_0x5f31('0xca')]));_0x6b47e7[_0x5f31('0x43')][_0x5f31('0xde')]=_0x1369f5['id'];if(_0x8b2ddf['query'][_0x5f31('0x32')]){_0x6b47e7[_0x5f31('0x43')]=_['merge'](_0x6b47e7[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x6b47e7[_0x5f31('0x4a')],function(_0x5bed2e){var _0x3649b3={};_0x3649b3[_0x5bed2e]={'$like':'%'+_0x8b2ddf[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x3649b3;})});}_0x6b47e7=_[_0x5f31('0xce')]({},_0x6b47e7,_0x8b2ddf['options']);return db[_0x5f31('0xe0')][_0x5f31('0x24')]({'where':_0x6b47e7[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x3d5fb0){_0x3b1327[_0x5f31('0x24')]=_0x3d5fb0;if(_0x8b2ddf[_0x5f31('0x45')]['includeAll']){_0x6b47e7[_0x5f31('0x5c')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5f31('0x4b')](_0x6b47e7);})['then'](function(_0x26193a){_0x3b1327[_0x5f31('0x4c')]=_0x26193a;return _0x3b1327;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x3ef433,_0x6b47e7))[_0x5f31('0x54')](handleError(_0x3ef433,null));};exports[_0x5f31('0xe1')]=function(_0xb420f2,_0x12eb1b){var _0x4d5e8e={};var _0x22f8da={};var _0x656d1;var _0x53fe1f;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xb420f2['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x12eb1b,null))[_0x5f31('0x28')](function(_0x3a22b6){if(_0x3a22b6){_0x656d1=_0x3a22b6;_0x22f8da['model']=_[_0x5f31('0x57')](db[_0x5f31('0xe2')][_0x5f31('0x3c')]);_0x22f8da[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0xb420f2['query']);_0x22f8da[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x22f8da[_0x5f31('0x59')],_0x22f8da[_0x5f31('0x45')]);_0x4d5e8e['attributes']=_[_0x5f31('0x58')](_0x22f8da[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xb420f2[_0x5f31('0x45')]['fields']));_0x4d5e8e[_0x5f31('0x4a')]=_0x4d5e8e['attributes'][_0x5f31('0x4d')]?_0x4d5e8e['attributes']:_0x22f8da[_0x5f31('0x59')];_0x4d5e8e['order']=qs[_0x5f31('0xcc')](_0xb420f2[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x4d5e8e[_0x5f31('0x43')]=qs['filters'](_[_0x5f31('0xcd')](_0xb420f2[_0x5f31('0x45')],_0x22f8da[_0x5f31('0xca')]));if(_0xb420f2[_0x5f31('0x45')]['filter']){_0x4d5e8e[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x4d5e8e[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x4d5e8e[_0x5f31('0x4a')],function(_0x146f6d){var _0x1fb095={};_0x1fb095[_0x146f6d]={'$like':'%'+_0xb420f2[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x1fb095;})});}_0x4d5e8e=_[_0x5f31('0xce')]({},_0x4d5e8e,_0xb420f2[_0x5f31('0x5d')]);return _0x656d1[_0x5f31('0xe1')](_0x4d5e8e);}})[_0x5f31('0x28')](function(_0x27b1c2){if(_0x27b1c2){_0x53fe1f=_0x27b1c2[_0x5f31('0x4d')];if(!_0xb420f2[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x4d5e8e[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0xb420f2[_0x5f31('0x45')]['limit']);_0x4d5e8e[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xb420f2[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x656d1[_0x5f31('0xe1')](_0x4d5e8e);}})['then'](function(_0x4d69d1){if(_0x4d69d1){return _0x4d69d1?{'count':_0x53fe1f,'rows':_0x4d69d1}:null;}})['then'](respondWithResult(_0x12eb1b,null))['catch'](handleError(_0x12eb1b,null));};exports[_0x5f31('0xe3')]=function(_0x24fa67,_0x8fe09c){var _0x13a00d={};var _0x4272eb={};var _0x243837;var _0x179f9c;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x24fa67[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x8fe09c,null))[_0x5f31('0x28')](function(_0x480c4f){if(_0x480c4f){_0x243837=_0x480c4f;_0x4272eb[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xe4')][_0x5f31('0x3c')]);_0x4272eb[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x24fa67[_0x5f31('0x45')]);_0x4272eb[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x4272eb[_0x5f31('0x59')],_0x4272eb[_0x5f31('0x45')]);_0x13a00d[_0x5f31('0x4a')]=_['intersection'](_0x4272eb[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x24fa67[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x13a00d[_0x5f31('0x4a')]=_0x13a00d[_0x5f31('0x4a')]['length']?_0x13a00d['attributes']:_0x4272eb['model'];_0x13a00d['order']=qs[_0x5f31('0xcc')](_0x24fa67[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x13a00d['where']=qs['filters'](_[_0x5f31('0xcd')](_0x24fa67[_0x5f31('0x45')],_0x4272eb[_0x5f31('0xca')]));if(_0x24fa67[_0x5f31('0x45')][_0x5f31('0x32')]){_0x13a00d['where']=_['merge'](_0x13a00d[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x13a00d[_0x5f31('0x4a')],function(_0x3a53a9){var _0x333b89={};_0x333b89[_0x3a53a9]={'$like':'%'+_0x24fa67['query'][_0x5f31('0x32')]+'%'};return _0x333b89;})});}_0x13a00d=_[_0x5f31('0xce')]({},_0x13a00d,_0x24fa67[_0x5f31('0x5d')]);return _0x243837[_0x5f31('0xe3')](_0x13a00d);}})['then'](function(_0xac43ef){if(_0xac43ef){_0x179f9c=_0xac43ef[_0x5f31('0x4d')];if(!_0x24fa67[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x13a00d[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x24fa67[_0x5f31('0x45')]['limit']);_0x13a00d['offset']=qs[_0x5f31('0x22')](_0x24fa67[_0x5f31('0x45')]['offset']);}return _0x243837[_0x5f31('0xe3')](_0x13a00d);}})[_0x5f31('0x28')](function(_0xb516ae){if(_0xb516ae){return _0xb516ae?{'count':_0x179f9c,'rows':_0xb516ae}:null;}})['then'](respondWithResult(_0x8fe09c,null))[_0x5f31('0x54')](handleError(_0x8fe09c,null));};exports[_0x5f31('0xe5')]=function(_0x6bb6ef,_0x4126d7){var _0x1c3bdc={'raw':!![],'where':{}};var _0x315144={};var _0x9c19da={'count':0x0,'rows':[]};return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x6bb6ef[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4126d7,null))['then'](function(_0x395f17){if(_0x395f17){_0x315144[_0x5f31('0x59')]=_[_0x5f31('0x57')](db['MailInteraction'][_0x5f31('0x3c')]);_0x315144[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x6bb6ef['query']);_0x315144[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x315144[_0x5f31('0x59')],_0x315144['query']);_0x1c3bdc['attributes']=_[_0x5f31('0x58')](_0x315144[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x6bb6ef['query']['fields']));_0x1c3bdc['attributes']=_0x1c3bdc[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x1c3bdc['attributes']:_0x315144['model'];if(!_0x6bb6ef['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x1c3bdc[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x6bb6ef[_0x5f31('0x45')]['limit']);_0x1c3bdc[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x6bb6ef[_0x5f31('0x45')][_0x5f31('0x22')]);}_0x1c3bdc[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x6bb6ef[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x1c3bdc['where']=qs[_0x5f31('0xca')](_['pick'](_0x6bb6ef[_0x5f31('0x45')],_0x315144[_0x5f31('0xca')]));_0x1c3bdc[_0x5f31('0x43')][_0x5f31('0xde')]=_0x395f17['id'];if(_0x6bb6ef[_0x5f31('0x45')]['filter']){_0x1c3bdc[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x1c3bdc[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x1c3bdc[_0x5f31('0x4a')],function(_0x37fc7c){var _0x1a9e9f={};_0x1a9e9f[_0x37fc7c]={'$like':'%'+_0x6bb6ef[_0x5f31('0x45')]['filter']+'%'};return _0x1a9e9f;})});}_0x1c3bdc=_[_0x5f31('0xce')]({},_0x1c3bdc,_0x6bb6ef[_0x5f31('0x5d')]);return db[_0x5f31('0xe6')][_0x5f31('0x24')]({'where':_0x1c3bdc[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x3f7e89){_0x9c19da[_0x5f31('0x24')]=_0x3f7e89;if(_0x6bb6ef['query'][_0x5f31('0x5b')]){_0x1c3bdc[_0x5f31('0x5c')]=[{'all':!![]}];}return db[_0x5f31('0xe6')][_0x5f31('0x4b')](_0x1c3bdc);})[_0x5f31('0x28')](function(_0x505c88){_0x9c19da[_0x5f31('0x4c')]=_0x505c88;return _0x9c19da;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x4126d7,_0x1c3bdc))[_0x5f31('0x54')](handleError(_0x4126d7,null));};exports[_0x5f31('0xe7')]=function(_0x43f99f,_0x49057c){var _0x412681={};var _0x211585={};var _0x16ab22;var _0x334e28;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x43f99f[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x49057c,null))[_0x5f31('0x28')](function(_0x72935c){if(_0x72935c){_0x16ab22=_0x72935c;_0x211585[_0x5f31('0x59')]=_['keys'](db[_0x5f31('0xe8')][_0x5f31('0x3c')]);_0x211585['query']=_[_0x5f31('0x57')](_0x43f99f[_0x5f31('0x45')]);_0x211585[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x211585[_0x5f31('0x59')],_0x211585['query']);_0x412681[_0x5f31('0x4a')]=_['intersection'](_0x211585[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x412681[_0x5f31('0x4a')]=_0x412681[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x412681[_0x5f31('0x4a')]:_0x211585[_0x5f31('0x59')];_0x412681[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x43f99f[_0x5f31('0x45')]['sort']);_0x412681[_0x5f31('0x43')]=qs['filters'](_['pick'](_0x43f99f['query'],_0x211585[_0x5f31('0xca')]));if(_0x43f99f[_0x5f31('0x45')]['filter']){_0x412681[_0x5f31('0x43')]=_['merge'](_0x412681[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x412681[_0x5f31('0x4a')],function(_0x234fb1){var _0x567b31={};_0x567b31[_0x234fb1]={'$like':'%'+_0x43f99f[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x567b31;})});}_0x412681=_['merge']({},_0x412681,_0x43f99f[_0x5f31('0x5d')]);return _0x16ab22[_0x5f31('0xe7')](_0x412681);}})[_0x5f31('0x28')](function(_0x1380c6){if(_0x1380c6){_0x334e28=_0x1380c6['length'];if(!_0x43f99f[_0x5f31('0x45')]['hasOwnProperty']('nolimit')){_0x412681[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x412681[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x16ab22['getSmsInteractions'](_0x412681);}})['then'](function(_0x18a0d1){if(_0x18a0d1){return _0x18a0d1?{'count':_0x334e28,'rows':_0x18a0d1}:null;}})[_0x5f31('0x28')](respondWithResult(_0x49057c,null))[_0x5f31('0x54')](handleError(_0x49057c,null));};exports[_0x5f31('0xe9')]=function(_0x415e30,_0x5b94c8){var _0x3bc18a={};var _0x2e36a5={};var _0x2a141e;var _0x3c79df;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x415e30['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5b94c8,null))['then'](function(_0x4d1fc1){if(_0x4d1fc1){_0x2a141e=_0x4d1fc1;_0x2e36a5['model']=_[_0x5f31('0x57')](db[_0x5f31('0xea')][_0x5f31('0x3c')]);_0x2e36a5['query']=_[_0x5f31('0x57')](_0x415e30[_0x5f31('0x45')]);_0x2e36a5[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x2e36a5[_0x5f31('0x59')],_0x2e36a5[_0x5f31('0x45')]);_0x3bc18a[_0x5f31('0x4a')]=_[_0x5f31('0x58')](_0x2e36a5[_0x5f31('0x59')],qs['fields'](_0x415e30['query']['fields']));_0x3bc18a[_0x5f31('0x4a')]=_0x3bc18a['attributes']['length']?_0x3bc18a['attributes']:_0x2e36a5['model'];_0x3bc18a[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x415e30[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x3bc18a[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x415e30[_0x5f31('0x45')],_0x2e36a5['filters']));if(_0x415e30['query'][_0x5f31('0x32')]){_0x3bc18a[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x3bc18a[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x3bc18a['attributes'],function(_0x3387a1){var _0x4bd21a={};_0x4bd21a[_0x3387a1]={'$like':'%'+_0x415e30[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x4bd21a;})});}_0x3bc18a=_['merge']({},_0x3bc18a,_0x415e30[_0x5f31('0x5d')]);return _0x2a141e[_0x5f31('0xe9')](_0x3bc18a);}})[_0x5f31('0x28')](function(_0x2a1d30){if(_0x2a1d30){_0x3c79df=_0x2a1d30[_0x5f31('0x4d')];if(!_0x415e30[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x3bc18a[_0x5f31('0xd5')]=qs['limit'](_0x415e30[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x3bc18a[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x415e30[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x2a141e['getFaxInteractions'](_0x3bc18a);}})['then'](function(_0x1172e0){if(_0x1172e0){return _0x1172e0?{'count':_0x3c79df,'rows':_0x1172e0}:null;}})[_0x5f31('0x28')](respondWithResult(_0x5b94c8,null))[_0x5f31('0x54')](handleError(_0x5b94c8,null));};exports[_0x5f31('0xeb')]=function(_0x5424b6,_0x366294){var _0x528614={};var _0x26f98a={};var _0x504be0;var _0x45020c;return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x5424b6[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x366294,null))[_0x5f31('0x28')](function(_0x496691){if(_0x496691){_0x504be0=_0x496691;_0x26f98a[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xec')][_0x5f31('0x3c')]);_0x26f98a[_0x5f31('0x45')]=_['keys'](_0x5424b6[_0x5f31('0x45')]);_0x26f98a[_0x5f31('0xca')]=_['intersection'](_0x26f98a[_0x5f31('0x59')],_0x26f98a[_0x5f31('0x45')]);_0x528614['attributes']=_[_0x5f31('0x58')](_0x26f98a[_0x5f31('0x59')],qs['fields'](_0x5424b6[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x528614[_0x5f31('0x4a')]=_0x528614[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x528614[_0x5f31('0x4a')]:_0x26f98a[_0x5f31('0x59')];_0x528614['order']=qs[_0x5f31('0xcc')](_0x5424b6['query'][_0x5f31('0xcc')]);_0x528614[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x5424b6['query'],_0x26f98a['filters']));if(_0x5424b6[_0x5f31('0x45')][_0x5f31('0x32')]){_0x528614[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x528614['where'],{'$or':_[_0x5f31('0x3d')](_0x528614[_0x5f31('0x4a')],function(_0x53ea63){var _0x1f3e7b={};_0x1f3e7b[_0x53ea63]={'$like':'%'+_0x5424b6['query'][_0x5f31('0x32')]+'%'};return _0x1f3e7b;})});}_0x528614=_[_0x5f31('0xce')]({},_0x528614,_0x5424b6[_0x5f31('0x5d')]);return _0x504be0['getWhatsappInteractions'](_0x528614);}})[_0x5f31('0x28')](function(_0x21d6fc){if(_0x21d6fc){_0x45020c=_0x21d6fc['length'];if(!_0x5424b6['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x528614[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x5424b6[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x528614[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x5424b6['query']['offset']);}return _0x504be0['getWhatsappInteractions'](_0x528614);}})[_0x5f31('0x28')](function(_0x4ff2a8){if(_0x4ff2a8){return _0x4ff2a8?{'count':_0x45020c,'rows':_0x4ff2a8}:null;}})[_0x5f31('0x28')](respondWithResult(_0x366294,null))[_0x5f31('0x54')](handleError(_0x366294,null));};exports[_0x5f31('0xed')]=function(_0x5a2e98,_0x1e3324,_0x1bf8be){var _0x4299f3;var _0x17964b;var _0x17e673;var _0x11d55e=!_['isNil'](_0x5a2e98[_0x5f31('0x62')]['id'])?_0x5a2e98[_0x5f31('0x62')]['id']:!_[_0x5f31('0x6c')](_0x5a2e98[_0x5f31('0x2e')]['id'])?_0x5a2e98[_0x5f31('0x2e')]['id']:null;return db['User'][_0x5f31('0x34')]({'where':{'id':_0x11d55e,'role':{'$or':['admin',_0x5f31('0x2e'),_0x5f31('0x29')]}},'attributes':['id','name',_0x5f31('0xee'),'mobile',_0x5f31('0x2d'),_0x5f31('0x6b'),_0x5f31('0x9d')]})[_0x5f31('0x28')](function(_0x47f154){if(_0x47f154){if(_0x47f154[_0x5f31('0x2d')]==='agent'){_0x4299f3=_0x47f154;if(_0x5a2e98[_0x5f31('0x61')][_0x5f31('0xaa')]){_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xef'),_0x4299f3[_0x5a2e98['body'][_0x5f31('0xaa')]]);}else if(_0x5a2e98[_0x5f31('0x61')]['intrf']){_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x5a2e98['body'][_0x5f31('0xf1')]);}else{_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x4299f3[_0x5f31('0x35')]);}socket['to'](util[_0x5f31('0xab')](_0x5f31('0xf2'),_0x4299f3[_0x5f31('0x35')]))[_0x5f31('0xa6')](_0x5f31('0xf3'),{'user':{'id':_0x4299f3['id'],'name':_0x4299f3[_0x5f31('0x35')]},'ip':_0x5a2e98[_0x5f31('0xf4')]['x-forwarded-for']||_0x5a2e98[_0x5f31('0xf5')][_0x5f31('0xf6')]||_0x5a2e98['socket'][_0x5f31('0xf6')]||_0x5a2e98['connection'][_0x5f31('0xf7')][_0x5f31('0xf6')]});return db[_0x5f31('0xad')][_0x5f31('0x2b')]({'where':{'membername':_0x4299f3['name']},'individualHooks':!![]});}}else{throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xf8'));}})[_0x5f31('0x28')](function(){if(_0x4299f3){return _0x4299f3[_0x5f31('0xf9')]({'raw':!![]});}})['then'](function(_0x1200ba){if(_0x4299f3){if(_0x1200ba){_0x17964b=_0x1200ba;if(_0x17964b[_0x5f31('0x4d')]){var _0x8d5b01=_0x17964b[_0x5f31('0x3d')](function(_0xc49bf4){var _0x2f4ffa={'membername':_0x4299f3[_0x5f31('0x35')],'UserId':_0x4299f3['id'],'queue_name':_0xc49bf4[_0x5f31('0x35')],'VoiceQueueId':_0xc49bf4['id'],'interface':_0x17e673,'paused':_0x4299f3[_0x5f31('0x9d')]||![],'penalty':_0xc49bf4[_0x5f31('0xfa')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x2f4ffa);});return Promise[_0x5f31('0x53')](_0x8d5b01);}}}})['then'](function(){if(_0x4299f3){return db['MemberReport'][_0x5f31('0x4b')]({'where':{'membername':_0x4299f3['name'],'exitAt':null}});}})[_0x5f31('0x28')](function(_0x7a7860){if(_0x4299f3){var _0x6614b1=[];_0x7a7860[_0x5f31('0xfb')](function(_0x5a679e){_0x6614b1[_0x5f31('0x4e')](_0x5a679e['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5f31('0x53')](_0x6614b1);}})[_0x5f31('0x28')](function(){if(_0x4299f3){var _0x1cf4e3=[];var _0x280fa8=[];var _0x2ad128=utils[_0x5f31('0xfc')]();var _0x57ae3c={'membername':_0x4299f3[_0x5f31('0x35')],'interface':_0x17e673,'enterAt':moment()['format'](_0x5f31('0xfd')),'role':_0x4299f3['role'],'internal':_0x4299f3[_0x5f31('0x6b')]};_0x2ad128[_0x5f31('0xfb')](function(_0x1af979){_0x1cf4e3[_0x5f31('0x4e')](_[_0x5f31('0xce')]({'channel':_0x1af979,'type':'LOGIN','data1':_0x5a2e98[_0x5f31('0x61')][_0x5f31('0xfe')],'data2':_0x17e673},_0x57ae3c));if(_0x4299f3[_0x5f31('0x9d')]){_0x280fa8[_0x5f31('0x4e')](_['merge']({'channel':_0x1af979,'type':_0x5f31('0xff'),'data1':_0x5f31('0x100')},_0x57ae3c));}});return db['MemberReport'][_0x5f31('0x89')](_0x1cf4e3[_0x5f31('0xc7')](_0x280fa8),{'individualHooks':!![]});}})['then'](function(){if(_0x4299f3){return _0x4299f3['update']({'online':!![],'lastLoginAt':moment()[_0x5f31('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4299f3[_0x5f31('0x9d')]||![],'mailPause':_0x4299f3['loginInPause']||![],'chatPause':_0x4299f3['loginInPause']||![],'faxPause':_0x4299f3['loginInPause']||![],'smsPause':_0x4299f3[_0x5f31('0x9d')]||![],'openchannelPause':_0x4299f3[_0x5f31('0x9d')]||![],'whatsappPause':_0x4299f3['loginInPause']||![],'pauseType':_0x4299f3[_0x5f31('0x9d')]?_0x5f31('0x100'):null,'interface':_0x17e673,'lastPauseAt':moment()['format'](_0x5f31('0xfd'))});}})[_0x5f31('0x28')](function(_0x205162){if(_0x5a2e98['isMiddleware']){return _0x1bf8be();}else{return Promise['resolve'](_0x205162)['then'](respondWithResult(_0x1e3324,null));}})[_0x5f31('0x54')](handleError(_0x1e3324,null));};exports[_0x5f31('0x101')]=function(_0x4e9ae3,_0x3a6021){var _0x66c628;return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4e9ae3[_0x5f31('0x62')]['id'],'role':_0x5f31('0x29')},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})[_0x5f31('0x28')](handleEntityNotFound(_0x3a6021,null))[_0x5f31('0x28')](function(_0xdb7e76){if(_0xdb7e76){_0x66c628=_0xdb7e76;return db[_0x5f31('0xad')][_0x5f31('0x2b')]({'where':{'membername':_0x66c628['name']},'individualHooks':!![]});}})[_0x5f31('0x28')](function(){return db[_0x5f31('0x102')]['findAll']({'where':{'membername':_0x66c628[_0x5f31('0x35')],'exitAt':null}});})[_0x5f31('0x28')](function(_0x524bd1){var _0x2cca91=[];_0x524bd1['forEach'](function(_0x13f934){_0x2cca91['push'](_0x13f934[_0x5f31('0x27')]({'exitAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd'))}));});return Promise[_0x5f31('0x53')](_0x2cca91);})[_0x5f31('0x28')](function(){return _0x66c628[_0x5f31('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5f31('0x28')](respondWithResult(_0x3a6021,null))[_0x5f31('0x54')](handleError(_0x3a6021,null));};exports[_0x5f31('0x103')]=function(_0x52f005,_0x222247){var _0x2e2869;return db['UserVoiceQueueRt'][_0x5f31('0x27')]({'paused':0x1},{'where':{'UserId':_0x52f005[_0x5f31('0x62')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x52f005['params']['id'],'role':_0x5f31('0x29')},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d'),_0x5f31('0x6b'),'interface',_0x5f31('0x9c')]});})[_0x5f31('0x28')](handleEntityNotFound(_0x222247,null))[_0x5f31('0x28')](function(_0x5e7fb5){if(_0x5e7fb5){_0x2e2869=_0x5e7fb5;return respondWithRpcPromise(_0x5f31('0x104'),'pause',{'id':_0x2e2869['id'],'name':_0x2e2869[_0x5f31('0x35')],'pause':!![]});}})[_0x5f31('0x28')](function(){if(_0x2e2869){return db[_0x5f31('0x102')][_0x5f31('0x4b')]({'where':{'membername':_0x2e2869[_0x5f31('0x35')],'type':_0x5f31('0xff'),'exitAt':null}});}})[_0x5f31('0x28')](function(_0x5a0abb){if(_0x5a0abb[_0x5f31('0x4d')]){var _0x2c6442=moment()[_0x5f31('0xab')](_0x5f31('0xfd'));for(var _0x2a3d15=0x0,_0x479886=_0x5a0abb[_0x5f31('0x4d')];_0x2a3d15<_0x479886;_0x2a3d15++){_0x5a0abb[_0x2a3d15]['updateAttributes']({'exitAt':_0x2c6442});}}})[_0x5f31('0x28')](function(){var _0x4cdf3e=[];var _0x459e25=utils[_0x5f31('0xfc')]();_0x459e25['forEach'](function(_0x2b8428){_0x4cdf3e[_0x5f31('0x4e')]({'channel':_0x2b8428,'membername':_0x2e2869[_0x5f31('0x35')],'interface':_[_0x5f31('0x6c')](_0x2e2869[_0x5f31('0xaa')])?util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x2e2869[_0x5f31('0x35')]):_0x2e2869[_0x5f31('0xaa')],'type':_0x5f31('0xff'),'enterAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd')),'data1':_0x52f005[_0x5f31('0x61')][_0x5f31('0x105')]||_0x5f31('0x106'),'role':_0x2e2869['role'],'internal':_0x2e2869['internal']});});return db['MemberReport'][_0x5f31('0x89')](_0x4cdf3e,{'individualHooks':!![]});})[_0x5f31('0x28')](function(){return _0x2e2869[_0x5f31('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x52f005[_0x5f31('0x61')][_0x5f31('0x105')]||_0x5f31('0x106'),'lastPauseAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd'))});})[_0x5f31('0x28')](respondWithResult(_0x222247,null))[_0x5f31('0x54')](handleError(_0x222247,null));};exports[_0x5f31('0x107')]=function(_0x184bcb,_0x5205d7){if(_0x184bcb['body'][_0x5f31('0x9b')]&&!utils[_0x5f31('0x9f')](_0x184bcb[_0x5f31('0x61')][_0x5f31('0x9b')])){throw new APIBadRequestError(util[_0x5f31('0xab')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x184bcb['body'][_0x5f31('0x9b')]));}return db['User'][_0x5f31('0x34')]({'where':{'id':_0x184bcb[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),'role',_0x5f31('0x6b'),_0x5f31('0xaa'),_0x5f31('0x9c'),_0x5f31('0x9e'),_0x5f31('0x108'),_0x5f31('0x109'),_0x5f31('0x10a'),_0x5f31('0x10b'),_0x5f31('0x10c'),_0x5f31('0x10d'),_0x5f31('0x10e'),_0x5f31('0x10f')]})['then'](function(_0x15aace){if(!_0x15aace){throw new APINotFoundError(util['format'](_0x5f31('0x110'),_0x184bcb[_0x5f31('0x62')]['id']));}return _0x15aace[_0x5f31('0x107')](_0x184bcb[_0x5f31('0x61')]['channel']);})[_0x5f31('0x28')](respondWithResult(_0x5205d7,null))[_0x5f31('0x54')](APIHandleError(_0x5205d7));};exports[_0x5f31('0x111')]=function(_0xa816c8,_0x5da145){var _0x3ad1a2={};var _0x4451fc={};var _0x425a62;var _0x81af45;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xa816c8[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5da145,null))[_0x5f31('0x28')](function(_0x59f62e){if(_0x59f62e){_0x425a62=_0x59f62e;_0x4451fc['model']=_[_0x5f31('0x57')](db['Team'][_0x5f31('0x3c')]);_0x4451fc['query']=_['keys'](_0xa816c8[_0x5f31('0x45')]);_0x4451fc[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x4451fc[_0x5f31('0x59')],_0x4451fc[_0x5f31('0x45')]);_0x3ad1a2['attributes']=_[_0x5f31('0x58')](_0x4451fc[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xa816c8[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x3ad1a2[_0x5f31('0x4a')]=_0x3ad1a2[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x3ad1a2['attributes']:_0x4451fc[_0x5f31('0x59')];_0x3ad1a2['order']=qs[_0x5f31('0xcc')](_0xa816c8[_0x5f31('0x45')]['sort']);_0x3ad1a2['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0xa816c8[_0x5f31('0x45')],_0x4451fc[_0x5f31('0xca')]));if(_0xa816c8[_0x5f31('0x45')][_0x5f31('0x32')]){_0x3ad1a2[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x3ad1a2[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x3ad1a2[_0x5f31('0x4a')],function(_0x570681){var _0x4a2e37={};_0x4a2e37[_0x570681]={'$like':'%'+_0xa816c8[_0x5f31('0x45')]['filter']+'%'};return _0x4a2e37;})});}_0x3ad1a2=_[_0x5f31('0xce')]({},_0x3ad1a2,_0xa816c8[_0x5f31('0x5d')]);return _0x425a62[_0x5f31('0x111')](_0x3ad1a2);}})[_0x5f31('0x28')](function(_0x799260){if(_0x799260){_0x81af45=_0x799260[_0x5f31('0x4d')];if(!_0xa816c8[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x3ad1a2[_0x5f31('0xd5')]=qs['limit'](_0xa816c8[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x3ad1a2[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xa816c8[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x425a62[_0x5f31('0x111')](_0x3ad1a2);}})['then'](function(_0x9b1ce){if(_0x9b1ce){return _0x9b1ce?{'count':_0x81af45,'rows':_0x9b1ce}:null;}})[_0x5f31('0x28')](respondWithResult(_0x5da145,null))[_0x5f31('0x54')](handleError(_0x5da145,null));};exports[_0x5f31('0x112')]=function(_0x1dabf4,_0x4f9b33){var _0x3be62e=_0x1dabf4[_0x5f31('0x62')]['id'];var _0x166426=_0x1dabf4['body']?_0x1dabf4[_0x5f31('0x61')]['ids']:null;var _0x2eac16=[];return Promise[_0x5f31('0x113')]()['then'](function(){if(!_0x166426)throw new APIBadRequestError(_0x5f31('0x114'));})[_0x5f31('0x28')](function(){return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x3be62e}});})[_0x5f31('0x28')](function(_0x41ca2c){if(!_0x41ca2c)throw new APINotFoundError(util[_0x5f31('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1dabf4[_0x5f31('0x62')]['id']));return db[_0x5f31('0x6f')][_0x5f31('0x115')](function(_0x898557){return _0x41ca2c[_0x5f31('0x112')](_0x166426,{'transaction':_0x898557})['then'](function(){return db[_0x5f31('0x116')]['findAll']({'where':{'id':{'$in':_0x166426}}});})[_0x5f31('0x28')](function(_0x50dd26){var _0x2e02df=_['map'](_0x50dd26,function(_0x2643e3){return _0x2643e3[_0x5f31('0x117')]();});return Promise['all'](_0x2e02df);})[_0x5f31('0x28')](function(_0x5b4047){_0x2eac16=_[_0x5f31('0x118')](_0x5b4047);var _0x458fe4=_[_0x5f31('0x3d')](_0x2eac16,function(_0x3bc937){return _0x3bc937[_0x5f31('0x119')](_0x41ca2c['id'],{'transaction':_0x898557});});return Promise['all'](_0x458fe4);})[_0x5f31('0x28')](function(){if(!_0x41ca2c[_0x5f31('0x9c')])return;var _0x318e8f=_[_0x5f31('0x32')](_0x2eac16,function(_0x47bd35){return _0x47bd35[_0x5f31('0x11a')](_0x5f31('0x9b'))===_0x5f31('0x11b');});var _0xef886d=_[_0x5f31('0x3d')](_0x318e8f,function(_0x56a2bc){return db[_0x5f31('0xad')][_0x5f31('0x11c')]({'membername':_0x41ca2c['name'],'UserId':_0x41ca2c['id'],'queue_name':_0x56a2bc[_0x5f31('0x35')],'VoiceQueueId':_0x56a2bc['id'],'interface':_[_0x5f31('0x6c')](_0x41ca2c[_0x5f31('0xaa')])?util[_0x5f31('0xab')]('SIP/%s',_0x41ca2c['name']):_0x41ca2c[_0x5f31('0xaa')],'paused':_0x41ca2c[_0x5f31('0x9e')]||![],'penalty':_0x41ca2c['penalty']},{'transaction':_0x898557});});return Promise[_0x5f31('0x53')](_0xef886d);})['then'](function(){return db[_0x5f31('0x11d')][_0x5f31('0x4b')]({'where':{'teamId':{'$in':_0x166426}}});})['then'](function(_0x2aba69){var _0x5bacb9=_[_0x5f31('0x3d')](_0x2aba69,function(_0x58f3bb){return db[_0x5f31('0x11e')][_0x5f31('0x87')]({'UserId':_0x41ca2c['id'],'VoicePrefixId':_0x58f3bb['VoicePrefixId']},{'transaction':_0x898557});});return Promise[_0x5f31('0x53')](_0x5bacb9);});});})[_0x5f31('0x28')](function(){for(var _0xeb38cf=0x0;_0xeb38cf<_0x2eac16[_0x5f31('0x4d')];_0xeb38cf++){var _0x34bf42=_0x2eac16[_0xeb38cf][_0x5f31('0x11a')]('channel');var _0x3f24c7=_0x34bf42+_0x5f31('0xa5');socket['emit'](_0x5f31('0x2e')+_0x34bf42+_0x5f31('0xa7'),{'UserId':_0x3be62e,['queueField']:_0x2eac16[_0xeb38cf]['id']});}})[_0x5f31('0x28')](respondWithStatusCode(_0x4f9b33,null))[_0x5f31('0x54')](APIHandleError(_0x4f9b33));};exports[_0x5f31('0x11f')]=function(_0x2d3bc8,_0x4755d9){var _0x35b4db=_0x2d3bc8[_0x5f31('0x62')]['id'];var _0x4cabae=null;if(_0x2d3bc8[_0x5f31('0x45')][_0x5f31('0x65')]){_0x4cabae=_[_0x5f31('0x120')](_0x2d3bc8[_0x5f31('0x45')]['ids'])?_0x2d3bc8[_0x5f31('0x45')][_0x5f31('0x65')]:[_0x2d3bc8[_0x5f31('0x45')]['ids']];}var _0x234784=[];return Promise[_0x5f31('0x113')]()[_0x5f31('0x28')](function(){if(!_0x4cabae)throw new APIBadRequestError(_0x5f31('0x121'));})[_0x5f31('0x28')](function(){return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x35b4db}});})['then'](function(_0x158425){if(!_0x158425)throw new APINotFoundError(util[_0x5f31('0xab')](_0x5f31('0x110'),_0x2d3bc8[_0x5f31('0x62')]['id']));return db[_0x5f31('0x6f')][_0x5f31('0x115')](function(_0x4eef8c){return _0x158425['removeTeams'](_0x4cabae,{'transaction':_0x4eef8c})[_0x5f31('0x28')](function(){return db['Team'][_0x5f31('0x4b')]({'where':{'id':{'$in':_0x4cabae}}});})[_0x5f31('0x28')](function(_0x393c5e){var _0x27e49a=_['map'](_0x393c5e,function(_0x36e722){return _0x36e722['getAssociatedQueues']();});return Promise['all'](_0x27e49a);})[_0x5f31('0x28')](function(_0x647b8c){_0x234784=_[_0x5f31('0x118')](_0x647b8c);var _0x12d724=_['map'](_0x234784,function(_0x81f215){return _0x81f215[_0x5f31('0x122')](_0x158425['id'],{'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x12d724);})['then'](function(){if(!_0x158425[_0x5f31('0x9c')])return;var _0x56e76b=_[_0x5f31('0x32')](_0x234784,function(_0x3fa33f){return _0x3fa33f[_0x5f31('0x11a')]('channel')===_0x5f31('0x11b');});var _0x21a1a4=_[_0x5f31('0x3d')](_0x56e76b,function(_0x2bfb88){return db['UserVoiceQueueRt'][_0x5f31('0x2b')]({'where':{'VoiceQueueId':_0x2bfb88['id'],'UserId':_0x158425['id']},'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x21a1a4);})[_0x5f31('0x28')](function(){return db[_0x5f31('0x11d')]['findAll']({'where':{'teamId':{'$in':_0x4cabae}}});})[_0x5f31('0x28')](function(_0x528ec9){var _0x550e14=_[_0x5f31('0x3d')](_0x528ec9,function(_0x29b1d2){return db[_0x5f31('0x11e')][_0x5f31('0x2b')]({'where':{'UserId':_0x158425['id'],'VoicePrefixId':_0x29b1d2[_0x5f31('0x123')]}},{'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x550e14);});});})[_0x5f31('0x28')](function(){for(var _0x18892d=0x0;_0x18892d<_0x234784[_0x5f31('0x4d')];_0x18892d++){var _0x15d188=_0x234784[_0x18892d]['getDataValue'](_0x5f31('0x9b'));var _0x5416de=_0x15d188+_0x5f31('0xa5');socket[_0x5f31('0xa6')](_0x5f31('0x2e')+_0x15d188+_0x5f31('0xb0'),{'UserId':_0x35b4db,['queueField']:_0x234784[_0x18892d]['id']});}})[_0x5f31('0x28')](respondWithStatusCode(_0x4755d9,null))[_0x5f31('0x54')](APIHandleError(_0x4755d9));};exports[_0x5f31('0x124')]=function(_0x186ef8,_0x124f33){var _0x122ad1={};var _0x381a20={};var _0x2b09ff;var _0x2cbd9b;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x186ef8[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x124f33,null))[_0x5f31('0x28')](function(_0x51192a){if(_0x51192a){_0x2b09ff=_0x51192a;_0x381a20['model']=_[_0x5f31('0x57')](db['CmList'][_0x5f31('0x3c')]);_0x381a20['query']=_['keys'](_0x186ef8[_0x5f31('0x45')]);_0x381a20['filters']=_[_0x5f31('0x58')](_0x381a20[_0x5f31('0x59')],_0x381a20[_0x5f31('0x45')]);_0x122ad1['attributes']=_['intersection'](_0x381a20['model'],qs[_0x5f31('0x5a')](_0x186ef8['query']['fields']));_0x122ad1[_0x5f31('0x4a')]=_0x122ad1[_0x5f31('0x4a')]['length']?_0x122ad1[_0x5f31('0x4a')]:_0x381a20[_0x5f31('0x59')];_0x122ad1[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x186ef8['query'][_0x5f31('0xcc')]);_0x122ad1[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_['pick'](_0x186ef8[_0x5f31('0x45')],_0x381a20[_0x5f31('0xca')]));if(_0x186ef8[_0x5f31('0x45')][_0x5f31('0x32')]){_0x122ad1['where']=_[_0x5f31('0xce')](_0x122ad1['where'],{'$or':_[_0x5f31('0x3d')](_0x122ad1[_0x5f31('0x4a')],function(_0xef44d6){var _0x9f3dc6={};_0x9f3dc6[_0xef44d6]={'$like':'%'+_0x186ef8[_0x5f31('0x45')]['filter']+'%'};return _0x9f3dc6;})});}_0x122ad1=_['merge']({},_0x122ad1,_0x186ef8[_0x5f31('0x5d')]);return _0x2b09ff[_0x5f31('0x124')](_0x122ad1);}})[_0x5f31('0x28')](function(_0x2748e8){if(_0x2748e8){_0x2cbd9b=_0x2748e8[_0x5f31('0x4d')];if(!_0x186ef8['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x122ad1[_0x5f31('0xd5')]=qs['limit'](_0x186ef8[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x122ad1['offset']=qs['offset'](_0x186ef8['query'][_0x5f31('0x22')]);}return _0x2b09ff[_0x5f31('0x124')](_0x122ad1);}})[_0x5f31('0x28')](function(_0x5beb47){if(_0x5beb47){return _0x5beb47?{'count':_0x2cbd9b,'rows':_0x5beb47}:null;}})[_0x5f31('0x28')](respondWithResult(_0x124f33,null))[_0x5f31('0x54')](handleError(_0x124f33,null));};exports[_0x5f31('0x125')]=function(_0x1a61bf,_0x5175c2){var _0x5aeae6={};var _0x52c8e8={};var _0x12a1ef;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x1a61bf[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5175c2,null))['then'](function(_0x562ef5){if(_0x562ef5){_0x12a1ef=_0x562ef5;_0x52c8e8[_0x5f31('0x59')]=_['keys'](db[_0x5f31('0x44')]['rawAttributes']);_0x52c8e8[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x1a61bf['query']);_0x52c8e8[_0x5f31('0xca')]=_['intersection'](_0x52c8e8[_0x5f31('0x59')],_0x52c8e8[_0x5f31('0x45')]);_0x5aeae6['attributes']=_[_0x5f31('0x58')](_0x52c8e8[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x1a61bf[_0x5f31('0x45')]['fields']));_0x5aeae6[_0x5f31('0x4a')]=_0x5aeae6['attributes'][_0x5f31('0x4d')]?_0x5aeae6[_0x5f31('0x4a')]:_0x52c8e8[_0x5f31('0x59')];_0x5aeae6[_0x5f31('0xcb')]=qs['sort'](_0x1a61bf['query']['sort']);_0x5aeae6['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x1a61bf[_0x5f31('0x45')],_0x52c8e8['filters']));if(_0x1a61bf['query'][_0x5f31('0x32')]){_0x5aeae6[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x5aeae6[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x5aeae6[_0x5f31('0x4a')],function(_0x3a751a){var _0x24f235={};_0x24f235[_0x3a751a]={'$like':'%'+_0x1a61bf[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x24f235;})});}_0x5aeae6[_0x5f31('0x59')]=db[_0x5f31('0x44')];_0x5aeae6['as']=_0x5f31('0x2f');_0x5aeae6=_[_0x5f31('0xce')]({},_0x5aeae6,_0x1a61bf[_0x5f31('0x5d')]);return _0x12a1ef['getVoiceQueues']({'include':[_0x5aeae6]});}})[_0x5f31('0x28')](function(_0x346511){if(_0x346511){var _0x16f0bb={},_0x32b00a=[];for(var _0x481952=0x0;_0x481952<_0x346511['length'];_0x481952+=0x1){for(var _0x201996=0x0,_0x488b2e;_0x201996<_0x346511[_0x481952]['Agents']['length'];_0x201996+=0x1){_0x488b2e=_0x346511[_0x481952]['Agents'][_0x201996][_0x5f31('0x2c')]({'plain':!![]});_0x16f0bb[_0x488b2e['id']]=_0x488b2e;}}_0x16f0bb=_['values'](_0x16f0bb);for(var _0x3786cf=qs['offset'](_0x1a61bf[_0x5f31('0x45')]['offset']);_0x3786cf<_0x16f0bb[_0x5f31('0x4d')]&&_0x32b00a[_0x5f31('0x4d')]=_0xe3bd48['agents']){throw new Error(_0xd2d1('0x49'));}})[_0xd2d1('0x14')](function(){if(_0xec1bf0){return db['UserVoiceQueueRt'][_0xd2d1('0x42')]({'where':{'membername':_0xec1bf0[_0xd2d1('0x1f')]},'individualHooks':!![]});}})[_0xd2d1('0x14')](function(){if(_0xec1bf0){return _0xec1bf0[_0xd2d1('0x4a')]({'raw':!![]});}})[_0xd2d1('0x14')](function(_0x334618){if(_0xec1bf0){if(_0x334618){var _0x5588d8=[];_0x1c053d=_0x334618;if(_0x1c053d[_0xd2d1('0x23')]){for(var _0x5ea3ae=0x0;_0x5ea3ae<_0x1c053d[_0xd2d1('0x23')];_0x5ea3ae++){_0x5588d8[_0xd2d1('0x27')](db[_0xd2d1('0x21')][_0xd2d1('0x4b')]({'membername':_0xec1bf0[_0xd2d1('0x1f')],'UserId':_0xec1bf0['id'],'queue_name':_0x1c053d[_0x5ea3ae]['name'],'VoiceQueueId':_0x1c053d[_0x5ea3ae]['id'],'interface':_0x4b5b36,'paused':_0xec1bf0[_0xd2d1('0x47')]||![],'penalty':_0x1c053d[_0x5ea3ae][_0xd2d1('0x4c')]||0x0}));}return BPromise['all'](_0x5588d8);}}}})[_0xd2d1('0x14')](function(){if(_0xec1bf0){return db[_0xd2d1('0x22')][_0xd2d1('0x43')]({'where':{'membername':_0xec1bf0[_0xd2d1('0x1f')],'exitAt':null}});}})[_0xd2d1('0x14')](function(_0x36a16c){if(_0xec1bf0){if(_0x36a16c&&_0x36a16c[_0xd2d1('0x23')]){var _0x2c812c=[];_0x36a16c[_0xd2d1('0x26')](function(_0x48ce73){_0x2c812c[_0xd2d1('0x27')](_0x48ce73[_0xd2d1('0x2f')]({'exitAt':moment()['format'](_0xd2d1('0x31'))}));});return BPromise['all'](_0x2c812c);}}})[_0xd2d1('0x14')](function(){if(_0xec1bf0){var _0x3f2c8b=[];var _0x5e7e24=[];var _0x51b0ca=utils[_0xd2d1('0x25')]();var _0xfe3114={'membername':_0xec1bf0[_0xd2d1('0x1f')],'interface':_0x4b5b36,'enterAt':moment()['format'](_0xd2d1('0x31')),'role':_0xec1bf0[_0xd2d1('0x20')],'internal':_0xec1bf0['internal']};_0x51b0ca['forEach'](function(_0x4722e5){_0x3f2c8b[_0xd2d1('0x27')](_['merge']({'channel':_0x4722e5,'type':'LOGIN','data1':'callysquare','data2':_0x4b5b36},_0xfe3114));if(_0xec1bf0['loginInPause']){_0x5e7e24[_0xd2d1('0x27')](_['merge']({'channel':_0x4722e5,'type':_0xd2d1('0x2b'),'data1':'LOGININPAUSE'},_0xfe3114));}});return db[_0xd2d1('0x22')][_0xd2d1('0x4d')](_0x3f2c8b[_0xd2d1('0x4e')](_0x5e7e24),{'individualHooks':!![]});}})[_0xd2d1('0x14')](function(){if(_0xec1bf0){return _0xec1bf0[_0xd2d1('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xd2d1('0x24')](_0xd2d1('0x31')),'voicePause':_0xec1bf0[_0xd2d1('0x47')]||![],'mailPause':_0xec1bf0[_0xd2d1('0x47')]||![],'chatPause':_0xec1bf0[_0xd2d1('0x47')]||![],'faxPause':_0xec1bf0[_0xd2d1('0x47')]||![],'smsPause':_0xec1bf0[_0xd2d1('0x47')]||![],'openchannelPause':_0xec1bf0[_0xd2d1('0x47')]||![],'pauseType':_0xec1bf0[_0xd2d1('0x47')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xd2d1('0x24')](_0xd2d1('0x31')),'interface':_0x4b5b36});}})[_0xd2d1('0x14')](function(_0x220249){_0x1cee0c(_0x220249);})['catch'](function(_0x347f5d){_0x7a7bd8(_0x555b9e[_0xd2d1('0x19')](0x1f4,_0x347f5d[_0xd2d1('0x18')]));});});}; \ No newline at end of file +var _0xcb58=['bulkCreate','type','UnpauseUser','channel','isValidChannel','findOne','online','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','system','LogoutUser','destroy','all','LoginUser','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./user.socket','register','GetUser','User','options','raw','where','attributes','limit','model','include','map','then','info','debug','stringify','error','message','ShowUser','catch','PauseUser','role','internal','update','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','SIP/%s','name','interface','body','DEFAULT\x20PAUSE'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xcb58,0x182));var _0x8cb5=function(_0x40a7d8,_0xd59683){_0x40a7d8=_0x40a7d8-0x0;var _0x59c6a9=_0xcb58[_0x40a7d8];return _0x59c6a9;};'use strict';var _=require('lodash');var util=require(_0x8cb5('0x0'));var moment=require(_0x8cb5('0x1'));var BPromise=require(_0x8cb5('0x2'));var Redis=require(_0x8cb5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cb5('0x4'));var logger=require(_0x8cb5('0x5'))('rpc');var config=require(_0x8cb5('0x6'));config['redis']=_[_0x8cb5('0x7')](config[_0x8cb5('0x8')],{'host':_0x8cb5('0x9'),'port':0x18eb});var socket=require(_0x8cb5('0xa'))(new Redis(config[_0x8cb5('0x8')]));require(_0x8cb5('0xb'))[_0x8cb5('0xc')](socket);exports[_0x8cb5('0xd')]=function(_0x12ac34){var _0x21e983=this;return new Promise(function(_0x3bc206,_0x310e7b){return db[_0x8cb5('0xe')]['findAll']({'raw':_0x12ac34[_0x8cb5('0xf')]?_0x12ac34[_0x8cb5('0xf')][_0x8cb5('0x10')]===undefined?!![]:![]:!![],'where':_0x12ac34['options']?_0x12ac34['options'][_0x8cb5('0x11')]||null:null,'attributes':_0x12ac34[_0x8cb5('0xf')]?_0x12ac34[_0x8cb5('0xf')][_0x8cb5('0x12')]||null:null,'limit':_0x12ac34[_0x8cb5('0xf')]?_0x12ac34[_0x8cb5('0xf')][_0x8cb5('0x13')]||null:null,'include':_0x12ac34[_0x8cb5('0xf')]?_0x12ac34['options']['include']?_['map'](_0x12ac34[_0x8cb5('0xf')]['include'],function(_0x2d465f){return{'model':db[_0x2d465f[_0x8cb5('0x14')]],'as':_0x2d465f['as'],'attributes':_0x2d465f[_0x8cb5('0x12')],'include':_0x2d465f[_0x8cb5('0x15')]?_[_0x8cb5('0x16')](_0x2d465f[_0x8cb5('0x15')],function(_0x59be57){return{'model':db[_0x59be57[_0x8cb5('0x14')]],'as':_0x59be57['as'],'attributes':_0x59be57[_0x8cb5('0x12')],'include':_0x59be57['include']?_[_0x8cb5('0x16')](_0x59be57[_0x8cb5('0x15')],function(_0x4c9eef){return{'model':db[_0x4c9eef[_0x8cb5('0x14')]],'as':_0x4c9eef['as'],'attributes':_0x4c9eef['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cb5('0x17')](function(_0xbc7c73){logger[_0x8cb5('0x18')](_0x8cb5('0xd'),_0x12ac34);logger[_0x8cb5('0x19')](_0x8cb5('0xd'),_0x12ac34,JSON[_0x8cb5('0x1a')](_0xbc7c73));_0x3bc206(_0xbc7c73);})['catch'](function(_0x512d13){logger[_0x8cb5('0x1b')](_0x8cb5('0xd'),_0x512d13[_0x8cb5('0x1c')],_0x12ac34);_0x310e7b(_0x21e983['error'](0x1f4,_0x512d13[_0x8cb5('0x1c')]));});});};exports[_0x8cb5('0x1d')]=function(_0x1151d5){var _0x3ed248=this;return new Promise(function(_0x309b2d,_0x3d76ef){return db[_0x8cb5('0xe')]['find']({'raw':_0x1151d5[_0x8cb5('0xf')]?_0x1151d5[_0x8cb5('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x1151d5[_0x8cb5('0xf')]?_0x1151d5[_0x8cb5('0xf')][_0x8cb5('0x11')]||null:null,'attributes':_0x1151d5[_0x8cb5('0xf')]?_0x1151d5[_0x8cb5('0xf')][_0x8cb5('0x12')]||null:null,'include':_0x1151d5[_0x8cb5('0xf')]?_0x1151d5[_0x8cb5('0xf')][_0x8cb5('0x15')]?_['map'](_0x1151d5[_0x8cb5('0xf')][_0x8cb5('0x15')],function(_0x53ed31){return{'model':db[_0x53ed31[_0x8cb5('0x14')]],'as':_0x53ed31['as'],'attributes':_0x53ed31[_0x8cb5('0x12')],'include':_0x53ed31['include']?_[_0x8cb5('0x16')](_0x53ed31['include'],function(_0x331bcf){return{'model':db[_0x331bcf[_0x8cb5('0x14')]],'as':_0x331bcf['as'],'attributes':_0x331bcf[_0x8cb5('0x12')],'include':_0x331bcf['include']?_[_0x8cb5('0x16')](_0x331bcf[_0x8cb5('0x15')],function(_0x8c3c38){return{'model':db[_0x8c3c38[_0x8cb5('0x14')]],'as':_0x8c3c38['as'],'attributes':_0x8c3c38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x127e03){logger[_0x8cb5('0x18')](_0x8cb5('0x1d'),_0x1151d5);logger[_0x8cb5('0x19')]('ShowUser',_0x1151d5,JSON[_0x8cb5('0x1a')](_0x127e03));_0x309b2d(_0x127e03);})[_0x8cb5('0x1e')](function(_0x431c72){logger['error'](_0x8cb5('0x1d'),_0x431c72[_0x8cb5('0x1c')],_0x1151d5);_0x3d76ef(_0x3ed248['error'](0x1f4,_0x431c72[_0x8cb5('0x1c')]));});});};exports[_0x8cb5('0x1f')]=function(_0x1b0d1b){var _0x43171c=this;return new Promise(function(_0x4fb712,_0xeb2881){var _0x22e17d;return db['User']['find']({'where':_0x1b0d1b['options'][_0x8cb5('0x11')]||{},'attributes':['id','name',_0x8cb5('0x20'),_0x8cb5('0x21'),'interface']})[_0x8cb5('0x17')](function(_0x554522){if(_0x554522){_0x22e17d=_0x554522;return db['UserVoiceQueueRt'][_0x8cb5('0x22')]({'paused':0x1},{'where':{'UserId':_0x22e17d['id']},'individualHooks':!![]});}})['then'](function(){if(_0x22e17d){return db[_0x8cb5('0x23')][_0x8cb5('0x24')]({'where':{'membername':_0x22e17d['name'],'type':'PAUSE','exitAt':null}});}})[_0x8cb5('0x17')](function(_0x2f9c89){if(_0x22e17d){if(_0x2f9c89&&_0x2f9c89[_0x8cb5('0x25')]){var _0x10de75=moment()[_0x8cb5('0x26')](_0x8cb5('0x27'));for(var _0x4f6eab=0x0,_0x45b7b9=_0x2f9c89[_0x8cb5('0x25')];_0x4f6eab<_0x45b7b9;_0x4f6eab++){_0x2f9c89[_0x4f6eab]['updateAttributes']({'exitAt':_0x10de75});}}}})[_0x8cb5('0x17')](function(){if(_0x22e17d){var _0x3d8c4c=[];var _0x3d78b9=utils[_0x8cb5('0x28')]();_0x3d78b9[_0x8cb5('0x29')](function(_0x27454e){_0x3d8c4c[_0x8cb5('0x2a')]({'channel':_0x27454e,'membername':_0x22e17d['name'],'interface':_[_0x8cb5('0x2b')](_0x22e17d['interface'])?util[_0x8cb5('0x26')](_0x8cb5('0x2c'),_0x22e17d[_0x8cb5('0x2d')]):_0x22e17d[_0x8cb5('0x2e')],'type':'PAUSE','enterAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27')),'data1':_0x1b0d1b[_0x8cb5('0x2f')]['type']||_0x8cb5('0x30'),'role':_0x22e17d[_0x8cb5('0x20')],'internal':_0x22e17d['internal'],'uniqueid':_0x1b0d1b[_0x8cb5('0x2f')]['uniqueid']||null});});return db[_0x8cb5('0x23')][_0x8cb5('0x31')](_0x3d8c4c,{'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x22e17d){return _0x22e17d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1b0d1b['body'][_0x8cb5('0x32')]||_0x8cb5('0x30'),'lastPauseAt':moment()[_0x8cb5('0x26')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x8cb5('0x17')](function(_0x33014c){_0x4fb712(_0x33014c);})[_0x8cb5('0x1e')](function(_0x2e5b9e){_0xeb2881(_0x43171c[_0x8cb5('0x1b')](0x1f4,_0x2e5b9e[_0x8cb5('0x1c')]));});});};exports[_0x8cb5('0x33')]=function(_0x1f8310){var _0x5dd364=this;return new Promise(function(_0x30efd5,_0x1c6452){if(_0x1f8310[_0x8cb5('0x2f')][_0x8cb5('0x34')]&&!utils[_0x8cb5('0x35')](_0x1f8310[_0x8cb5('0x2f')][_0x8cb5('0x34')])){throw new Error(util[_0x8cb5('0x26')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1f8310[_0x8cb5('0x2f')][_0x8cb5('0x34')]));}return db[_0x8cb5('0xe')][_0x8cb5('0x36')]({'where':_0x1f8310[_0x8cb5('0xf')]['where']||{},'attributes':['id',_0x8cb5('0x2d'),_0x8cb5('0x20'),_0x8cb5('0x21'),_0x8cb5('0x2e'),_0x8cb5('0x37'),'voicePause',_0x8cb5('0x38'),_0x8cb5('0x39'),_0x8cb5('0x3a'),_0x8cb5('0x3b'),_0x8cb5('0x3c'),_0x8cb5('0x3d'),_0x8cb5('0x3e'),_0x8cb5('0x3f')]})[_0x8cb5('0x17')](function(_0xa065dd){if(!_0xa065dd){throw new Error(util['format'](_0x8cb5('0x40'),_0x1f8310[_0x8cb5('0x41')]['id']));}return _0xa065dd[_0x8cb5('0x42')](_0x1f8310[_0x8cb5('0x2f')][_0x8cb5('0x34')],_0x8cb5('0x43'));})['then'](function(_0x434041){_0x30efd5(_0x434041);})[_0x8cb5('0x1e')](function(_0x5455bb){_0x1c6452(_0x5dd364[_0x8cb5('0x1b')](0x1f4,_0x5455bb[_0x8cb5('0x1c')]));});});};exports[_0x8cb5('0x44')]=function(_0x1a84b3){var _0x3cd8d4=this;return new Promise(function(_0x503655,_0x5b4e84){var _0x50adc6;return db[_0x8cb5('0xe')][_0x8cb5('0x36')]({'where':_0x1a84b3['options'][_0x8cb5('0x11')]||{},'attributes':['id','name']})[_0x8cb5('0x17')](function(_0x4bb8d0){if(_0x4bb8d0){_0x50adc6=_0x4bb8d0;return db['UserVoiceQueueRt'][_0x8cb5('0x45')]({'where':{'membername':_0x50adc6[_0x8cb5('0x2d')]},'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x50adc6){return db['MemberReport'][_0x8cb5('0x24')]({'where':{'membername':_0x50adc6[_0x8cb5('0x2d')],'exitAt':null}});}})[_0x8cb5('0x17')](function(_0x57d8eb){if(_0x50adc6){if(_0x57d8eb&&_0x57d8eb[_0x8cb5('0x25')]){var _0x209702=[];_0x57d8eb[_0x8cb5('0x29')](function(_0x1ffbad){_0x209702[_0x8cb5('0x2a')](_0x1ffbad[_0x8cb5('0x22')]({'exitAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27'))}));});return BPromise[_0x8cb5('0x46')](_0x209702);}}})[_0x8cb5('0x17')](function(){if(_0x50adc6){return _0x50adc6[_0x8cb5('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x8cb5('0x17')](function(_0x2decb2){_0x503655(_0x2decb2);})[_0x8cb5('0x1e')](function(_0x3b200d){_0x5b4e84(_0x3cd8d4[_0x8cb5('0x1b')](0x1f4,_0x3b200d[_0x8cb5('0x1c')]));});});};exports[_0x8cb5('0x47')]=function(_0x25ab9f){var _0x46ea38=this;return new Promise(function(_0x2f373f,_0x69aa7c){var _0x4db2d4;var _0x5efd59;var _0x4d068c;var _0x394e29;return db[_0x8cb5('0xe')][_0x8cb5('0x36')]({'where':_0x25ab9f[_0x8cb5('0xf')][_0x8cb5('0x11')]||{},'attributes':['id',_0x8cb5('0x2d'),_0x8cb5('0x20'),'mobile','phone',_0x8cb5('0x21'),_0x8cb5('0x48'),_0x8cb5('0x2e')]})['then'](function(_0x50d911){if(_0x50d911){_0x4db2d4=_0x50d911;_0x394e29=_0x25ab9f[_0x8cb5('0x2f')][_0x8cb5('0x2e')]?_0x25ab9f[_0x8cb5('0x2f')][_0x8cb5('0x2e')]:util[_0x8cb5('0x26')](_0x8cb5('0x2c'),_0x4db2d4[_0x8cb5('0x2d')]);return db['User'][_0x8cb5('0x49')]({'where':{'role':_0x8cb5('0x4a'),'online':!![],'id':{'$ne':_0x4db2d4['id']}}});}})[_0x8cb5('0x17')](function(_0x49ca92){if(_0x49ca92){_0x4d068c=_0x49ca92;return require(_0x8cb5('0x4b'))[_0x8cb5('0x4c')]();}})[_0x8cb5('0x17')](function(_0x30de0d){if(_0x30de0d&&_0x30de0d[_0x8cb5('0x4d')]&&_0x4d068c>=_0x30de0d['agents']){throw new Error(_0x8cb5('0x4e'));}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return db[_0x8cb5('0x4f')]['destroy']({'where':{'membername':_0x4db2d4['name']},'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return _0x4db2d4[_0x8cb5('0x50')]({'raw':!![]});}})[_0x8cb5('0x17')](function(_0x22d883){if(_0x4db2d4){if(_0x22d883){var _0x3ab76f=[];_0x5efd59=_0x22d883;if(_0x5efd59[_0x8cb5('0x25')]){for(var _0x33825d=0x0;_0x33825d<_0x5efd59[_0x8cb5('0x25')];_0x33825d++){_0x3ab76f['push'](db['UserVoiceQueueRt'][_0x8cb5('0x51')]({'membername':_0x4db2d4['name'],'UserId':_0x4db2d4['id'],'queue_name':_0x5efd59[_0x33825d]['name'],'VoiceQueueId':_0x5efd59[_0x33825d]['id'],'interface':_0x394e29,'paused':_0x4db2d4['loginInPause']||![],'penalty':_0x5efd59[_0x33825d]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x3ab76f);}}}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return db['MemberReport'][_0x8cb5('0x24')]({'where':{'membername':_0x4db2d4[_0x8cb5('0x2d')],'exitAt':null}});}})[_0x8cb5('0x17')](function(_0x312f5c){if(_0x4db2d4){if(_0x312f5c&&_0x312f5c[_0x8cb5('0x25')]){var _0x2af7fc=[];_0x312f5c[_0x8cb5('0x29')](function(_0x4abb48){_0x2af7fc['push'](_0x4abb48[_0x8cb5('0x22')]({'exitAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27'))}));});return BPromise['all'](_0x2af7fc);}}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){var _0x55bfcb=[];var _0x3c4cac=[];var _0x4c4d3b=utils[_0x8cb5('0x28')]();var _0x115a53={'membername':_0x4db2d4[_0x8cb5('0x2d')],'interface':_0x394e29,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4db2d4[_0x8cb5('0x20')],'internal':_0x4db2d4[_0x8cb5('0x21')]};_0x4c4d3b[_0x8cb5('0x29')](function(_0xf2d2bf){_0x55bfcb['push'](_[_0x8cb5('0x52')]({'channel':_0xf2d2bf,'type':_0x8cb5('0x53'),'data1':_0x8cb5('0x54'),'data2':_0x394e29},_0x115a53));if(_0x4db2d4[_0x8cb5('0x48')]){_0x3c4cac[_0x8cb5('0x2a')](_[_0x8cb5('0x52')]({'channel':_0xf2d2bf,'type':'PAUSE','data1':_0x8cb5('0x55')},_0x115a53));}});return db[_0x8cb5('0x23')][_0x8cb5('0x31')](_0x55bfcb[_0x8cb5('0x56')](_0x3c4cac),{'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return _0x4db2d4[_0x8cb5('0x22')]({'online':!![],'lastLoginAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27')),'voicePause':_0x4db2d4[_0x8cb5('0x48')]||![],'mailPause':_0x4db2d4['loginInPause']||![],'chatPause':_0x4db2d4[_0x8cb5('0x48')]||![],'faxPause':_0x4db2d4[_0x8cb5('0x48')]||![],'smsPause':_0x4db2d4[_0x8cb5('0x48')]||![],'openchannelPause':_0x4db2d4[_0x8cb5('0x48')]||![],'pauseType':_0x4db2d4['loginInPause']?_0x8cb5('0x55'):null,'lastPauseAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27')),'interface':_0x394e29});}})[_0x8cb5('0x17')](function(_0x1545f7){_0x2f373f(_0x1545f7);})[_0x8cb5('0x1e')](function(_0x4d2494){_0x69aa7c(_0x46ea38[_0x8cb5('0x1b')](0x1f4,_0x4d2494[_0x8cb5('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 590712a..142ce58 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 _0xcbb0=['emit','removeListener','register','user:','./user.events','save','remove','update'];(function(_0x29c3d3,_0x5ae16e){var _0x2072eb=function(_0x11083c){while(--_0x11083c){_0x29c3d3['push'](_0x29c3d3['shift']());}};_0x2072eb(++_0x5ae16e);}(_0xcbb0,0x19c));var _0x0cbb=function(_0x4963c4,_0x3a38c3){_0x4963c4=_0x4963c4-0x0;var _0x36b9d4=_0xcbb0[_0x4963c4];return _0x36b9d4;};'use strict';var UserEvents=require(_0x0cbb('0x0'));var events=[_0x0cbb('0x1'),_0x0cbb('0x2'),_0x0cbb('0x3')];function createListener(_0x366da0,_0x168d40){return function(_0x427be4){_0x168d40[_0x0cbb('0x4')](_0x366da0,_0x427be4);};}function removeListener(_0x4693c3,_0x434031){return function(){UserEvents[_0x0cbb('0x5')](_0x4693c3,_0x434031);};}exports[_0x0cbb('0x6')]=function(_0x520301){for(var _0x4e6f0b=0x0,_0x1009eb=events['length'];_0x4e6f0b<_0x1009eb;_0x4e6f0b++){var _0x58d0bb=events[_0x4e6f0b];var _0x3108ba=createListener(_0x0cbb('0x7')+_0x58d0bb,_0x520301);UserEvents['on'](_0x58d0bb,_0x3108ba);}}; \ No newline at end of file +var _0x2f8a=['update','emit','length','save'];(function(_0xd45ed0,_0x482068){var _0x17f4ea=function(_0x3074eb){while(--_0x3074eb){_0xd45ed0['push'](_0xd45ed0['shift']());}};_0x17f4ea(++_0x482068);}(_0x2f8a,0x1d7));var _0xa2f8=function(_0x32ce4f,_0x11a0b8){_0x32ce4f=_0x32ce4f-0x0;var _0x53a7f9=_0x2f8a[_0x32ce4f];return _0x53a7f9;};'use strict';var UserEvents=require('./user.events');var events=[_0xa2f8('0x0'),'remove',_0xa2f8('0x1')];function createListener(_0x5c69c6,_0x1598f6){return function(_0x1666c2){_0x1598f6[_0xa2f8('0x2')](_0x5c69c6,_0x1666c2);};}function removeListener(_0x13ed01,_0x345061){return function(){UserEvents['removeListener'](_0x13ed01,_0x345061);};}exports['register']=function(_0xf0d6ed){for(var _0x4d59b6=0x0,_0x21de8d=events[_0xa2f8('0x3')];_0x4d59b6<_0x21de8d;_0x4d59b6++){var _0x2886f1=events[_0x4d59b6];var _0x23e340=createListener('user:'+_0x2886f1,_0xf0d6ed);UserEvents['on'](_0x2886f1,_0x23e340);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0e53724..9774367 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x11008e,_0x3c9be6){var _0x4ae70d=function(_0x1f9c52){while(--_0x1f9c52){_0x11008e['push'](_0x11008e['shift']());}};_0x4ae70d(++_0x3c9be6);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2041a4,_0x55946d){var _0x5464b8=function(_0x5c6d2f){while(--_0x5c6d2f){_0x2041a4['push'](_0x2041a4['shift']());}};_0x5464b8(++_0x55946d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index bb5a5d5..afc28b8 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 _0xa6ca=['INTEGER','exports'];(function(_0x18b44a,_0x37eddd){var _0x4a5004=function(_0x3c17c5){while(--_0x3c17c5){_0x18b44a['push'](_0x18b44a['shift']());}};_0x4a5004(++_0x37eddd);}(_0xa6ca,0x167));var _0xaa6c=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xa6ca[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require('sequelize');module[_0xaa6c('0x0')]={'penalty':{'type':Sequelize[_0xaa6c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd7f0=['INTEGER','sequelize','exports'];(function(_0x2d74e4,_0x4543c4){var _0x4868cb=function(_0x3366b9){while(--_0x3366b9){_0x2d74e4['push'](_0x2d74e4['shift']());}};_0x4868cb(++_0x4543c4);}(_0xd7f0,0x145));var _0x0d7f=function(_0x571ecc,_0x57f9c8){_0x571ecc=_0x571ecc-0x0;var _0x411653=_0xd7f0[_0x571ecc];return _0x411653;};'use strict';var Sequelize=require(_0x0d7f('0x0'));module[_0x0d7f('0x1')]={'penalty':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index be41a19..8972023 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 _0x5667=['exports','user_has_chat_queues','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x5667,0x1c4));var _0x7566=function(_0x41f45c,_0x1f4311){_0x41f45c=_0x41f45c-0x0;var _0x2151fb=_0x5667[_0x41f45c];return _0x2151fb;};'use strict';var _=require(_0x7566('0x0'));var util=require(_0x7566('0x1'));var logger=require(_0x7566('0x2'))('api');var moment=require(_0x7566('0x3'));var BPromise=require('bluebird');var rp=require(_0x7566('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7566('0x5'));var config=require(_0x7566('0x6'));var attributes=require(_0x7566('0x7'));module[_0x7566('0x8')]=function(_0x343a08,_0x10f4c3){return _0x343a08['define']('UserChatQueue',attributes,{'tableName':_0x7566('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x247e=['exports','define','UserChatQueue','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x77651c,_0x2bd29b){var _0x1cba5d=function(_0x241ab3){while(--_0x241ab3){_0x77651c['push'](_0x77651c['shift']());}};_0x1cba5d(++_0x2bd29b);}(_0x247e,0xcb));var _0xe247=function(_0xe2c701,_0x42c78d){_0xe2c701=_0xe2c701-0x0;var _0x36db09=_0x247e[_0xe2c701];return _0x36db09;};'use strict';var _=require('lodash');var util=require(_0xe247('0x0'));var logger=require('../../config/logger')(_0xe247('0x1'));var moment=require(_0xe247('0x2'));var BPromise=require(_0xe247('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe247('0x4'));var rimraf=require(_0xe247('0x5'));var config=require(_0xe247('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xe247('0x7')]=function(_0x283e33,_0x16c855){return _0x283e33[_0xe247('0x8')](_0xe247('0x9'),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 7653c2c..7993dc5 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 _0x07dd=['catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x3c7616,_0x1ad775){var _0x290716=function(_0x32257b){while(--_0x32257b){_0x3c7616['push'](_0x3c7616['shift']());}};_0x290716(++_0x1ad775);}(_0x07dd,0x169));var _0xd07d=function(_0x33389b,_0x31bce2){_0x33389b=_0x33389b-0x0;var _0x48cf42=_0x07dd[_0x33389b];return _0x48cf42;};'use strict';var _=require(_0xd07d('0x0'));var util=require(_0xd07d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd07d('0x2'));var db=require(_0xd07d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd07d('0x4'))(_0xd07d('0x5'));var config=require(_0xd07d('0x6'));var jayson=require(_0xd07d('0x7'));var client=jayson[_0xd07d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15bfa6,_0x3dd983,_0x126d04){return new BPromise(function(_0xf2b474,_0x1e3da6){return client[_0xd07d('0x9')](_0x15bfa6,_0x126d04)['then'](function(_0x25caf1){logger[_0xd07d('0xa')](_0xd07d('0xb'),_0x3dd983,_0xd07d('0xc'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3dd983,'request\x20sent',JSON['stringify'](_0x25caf1));if(_0x25caf1[_0xd07d('0xd')]){if(_0x25caf1[_0xd07d('0xd')][_0xd07d('0xe')]===0x1f4){logger['error'](_0xd07d('0xb'),_0x3dd983,_0x25caf1[_0xd07d('0xd')]['message']);return _0x1e3da6(_0x25caf1[_0xd07d('0xd')][_0xd07d('0xf')]);}logger[_0xd07d('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x3dd983,_0x25caf1[_0xd07d('0xd')][_0xd07d('0xf')]);return _0xf2b474(_0x25caf1[_0xd07d('0xd')]['message']);}else{logger[_0xd07d('0xa')](_0xd07d('0xb'),_0x3dd983,_0xd07d('0xc'));_0xf2b474(_0x25caf1[_0xd07d('0x10')][_0xd07d('0xf')]);}})[_0xd07d('0x11')](function(_0x34e637){logger['error'](_0xd07d('0xb'),_0x3dd983,_0x34e637);_0x1e3da6(_0x34e637);});});} \ No newline at end of file +var _0xdb4b=['info','debug','stringify','error','message','UserChatQueue,\x20%s,\x20%s','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x565e4d,_0x23d683){var _0x47e665=function(_0x85d9e){while(--_0x85d9e){_0x565e4d['push'](_0x565e4d['shift']());}};_0x47e665(++_0x23d683);}(_0xdb4b,0x15d));var _0xbdb4=function(_0xcd3806,_0x3182ad){_0xcd3806=_0xcd3806-0x0;var _0x5e3594=_0xdb4b[_0xcd3806];return _0x5e3594;};'use strict';var _=require(_0xbdb4('0x0'));var util=require('util');var moment=require(_0xbdb4('0x1'));var BPromise=require(_0xbdb4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdb4('0x3'));var db=require(_0xbdb4('0x4'))['db'];var utils=require(_0xbdb4('0x5'));var logger=require(_0xbdb4('0x6'))(_0xbdb4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbdb4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x463394,_0x4432a5,_0x16cc80){return new BPromise(function(_0x52bbd1,_0x406d05){return client[_0xbdb4('0x9')](_0x463394,_0x16cc80)[_0xbdb4('0xa')](function(_0x130b66){logger[_0xbdb4('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x4432a5,'request\x20sent');logger[_0xbdb4('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4432a5,'request\x20sent',JSON[_0xbdb4('0xd')](_0x130b66));if(_0x130b66[_0xbdb4('0xe')]){if(_0x130b66[_0xbdb4('0xe')]['code']===0x1f4){logger[_0xbdb4('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x4432a5,_0x130b66['error'][_0xbdb4('0xf')]);return _0x406d05(_0x130b66['error'][_0xbdb4('0xf')]);}logger['error'](_0xbdb4('0x10'),_0x4432a5,_0x130b66['error']['message']);return _0x52bbd1(_0x130b66[_0xbdb4('0xe')][_0xbdb4('0xf')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4432a5,_0xbdb4('0x11'));_0x52bbd1(_0x130b66[_0xbdb4('0x12')][_0xbdb4('0xf')]);}})[_0xbdb4('0x13')](function(_0x1e4d63){logger[_0xbdb4('0xe')](_0xbdb4('0x10'),_0x4432a5,_0x1e4d63);_0x406d05(_0x1e4d63);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f187d93..14b5afa 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x41ec2f,_0xedb083){var _0x2abd9f=function(_0x14ce42){while(--_0x14ce42){_0x41ec2f['push'](_0x41ec2f['shift']());}};_0x2abd9f(++_0xedb083);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xcb91[_0x48d6a3];return _0x38bfa0;};'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(_0x2e11ea,_0x30a954){var _0x3dd60a=function(_0xefac15){while(--_0xefac15){_0x2e11ea['push'](_0x2e11ea['shift']());}};_0x3dd60a(++_0x30a954);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index da6c477..f129427 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 _0xf920=['exports','INTEGER','sequelize'];(function(_0x78c323,_0xafa30a){var _0x183e04=function(_0x1b20d9){while(--_0x1b20d9){_0x78c323['push'](_0x78c323['shift']());}};_0x183e04(++_0xafa30a);}(_0xf920,0x134));var _0x0f92=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0xf920[_0x22093a];return _0x2f4989;};'use strict';var Sequelize=require(_0x0f92('0x0'));module[_0x0f92('0x1')]={'penalty':{'type':Sequelize[_0x0f92('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0f92('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xea90=['INTEGER','sequelize'];(function(_0x2f4635,_0x5b5805){var _0x197052=function(_0x1659cc){while(--_0x1659cc){_0x2f4635['push'](_0x2f4635['shift']());}};_0x197052(++_0x5b5805);}(_0xea90,0x18d));var _0x0ea9=function(_0x192f9f,_0x3052e7){_0x192f9f=_0x192f9f-0x0;var _0x1465a7=_0xea90[_0x192f9f];return _0x1465a7;};'use strict';var Sequelize=require(_0x0ea9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0ea9('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a74cc84..b4fef9c 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 _0x03d3=['request-promise','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24c4b8,_0x55506d){var _0x3900ec=function(_0x35d29a){while(--_0x35d29a){_0x24c4b8['push'](_0x24c4b8['shift']());}};_0x3900ec(++_0x55506d);}(_0x03d3,0x186));var _0x303d=function(_0x6d8949,_0x1ad3e5){_0x6d8949=_0x6d8949-0x0;var _0x51ad38=_0x03d3[_0x6d8949];return _0x51ad38;};'use strict';var _=require(_0x303d('0x0'));var util=require(_0x303d('0x1'));var logger=require(_0x303d('0x2'))(_0x303d('0x3'));var moment=require(_0x303d('0x4'));var BPromise=require(_0x303d('0x5'));var rp=require(_0x303d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x303d('0x7'));var config=require('../../config/environment');var attributes=require(_0x303d('0x8'));module[_0x303d('0x9')]=function(_0x3630cb,_0x3cf752){return _0x3630cb['define'](_0x303d('0xa'),attributes,{'tableName':_0x303d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff82=['exports','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xff82,0xbe));var _0x2ff8=function(_0x230682,_0x96cff4){_0x230682=_0x230682-0x0;var _0x51e1c9=_0xff82[_0x230682];return _0x51e1c9;};'use strict';var _=require(_0x2ff8('0x0'));var util=require('util');var logger=require(_0x2ff8('0x1'))(_0x2ff8('0x2'));var moment=require(_0x2ff8('0x3'));var BPromise=require(_0x2ff8('0x4'));var rp=require(_0x2ff8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2ff8('0x6'));var attributes=require(_0x2ff8('0x7'));module[_0x2ff8('0x8')]=function(_0x45c31f,_0x191025){return _0x45c31f['define'](_0x2ff8('0x9'),attributes,{'tableName':_0x2ff8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 5d69ccc..643fe37 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 _0x0055=['code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x0055,0xeb));var _0x5005=function(_0x436366,_0x4e627d){_0x436366=_0x436366-0x0;var _0x2c3b6e=_0x0055[_0x436366];return _0x2c3b6e;};'use strict';var _=require(_0x5005('0x0'));var util=require(_0x5005('0x1'));var moment=require(_0x5005('0x2'));var BPromise=require('bluebird');var rs=require(_0x5005('0x3'));var fs=require('fs');var Redis=require(_0x5005('0x4'));var db=require(_0x5005('0x5'))['db'];var utils=require(_0x5005('0x6'));var logger=require(_0x5005('0x7'))(_0x5005('0x8'));var config=require(_0x5005('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5005('0xa')][_0x5005('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc78c7,_0x34e075,_0xe19bae){return new BPromise(function(_0x26c875,_0xa25222){return client['request'](_0xdc78c7,_0xe19bae)[_0x5005('0xc')](function(_0xebe16f){logger[_0x5005('0xd')](_0x5005('0xe'),_0x34e075,_0x5005('0xf'));logger[_0x5005('0x10')](_0x5005('0x11'),_0x34e075,_0x5005('0xf'),JSON['stringify'](_0xebe16f));if(_0xebe16f['error']){if(_0xebe16f['error'][_0x5005('0x12')]===0x1f4){logger[_0x5005('0x13')](_0x5005('0xe'),_0x34e075,_0xebe16f[_0x5005('0x13')][_0x5005('0x14')]);return _0xa25222(_0xebe16f[_0x5005('0x13')][_0x5005('0x14')]);}logger[_0x5005('0x13')](_0x5005('0xe'),_0x34e075,_0xebe16f[_0x5005('0x13')][_0x5005('0x14')]);return _0x26c875(_0xebe16f[_0x5005('0x13')][_0x5005('0x14')]);}else{logger[_0x5005('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x34e075,_0x5005('0xf'));_0x26c875(_0xebe16f[_0x5005('0x15')][_0x5005('0x14')]);}})[_0x5005('0x16')](function(_0x3fdbd6){logger[_0x5005('0x13')](_0x5005('0xe'),_0x34e075,_0x3fdbd6);_0xa25222(_0x3fdbd6);});});} \ No newline at end of file +var _0x3973=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x3973,0x72));var _0x3397=function(_0x325034,_0x4f082d){_0x325034=_0x325034-0x0;var _0x39f373=_0x3973[_0x325034];return _0x39f373;};'use strict';var _=require(_0x3397('0x0'));var util=require(_0x3397('0x1'));var moment=require(_0x3397('0x2'));var BPromise=require(_0x3397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3397('0x4'));var db=require(_0x3397('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3397('0x6'))(_0x3397('0x7'));var config=require(_0x3397('0x8'));var jayson=require(_0x3397('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58762a,_0x3d6a0a,_0x1fa1a8){return new BPromise(function(_0x48d6b7,_0x4a3f7f){return client[_0x3397('0xa')](_0x58762a,_0x1fa1a8)[_0x3397('0xb')](function(_0x110f16){logger[_0x3397('0xc')](_0x3397('0xd'),_0x3d6a0a,_0x3397('0xe'));logger[_0x3397('0xf')](_0x3397('0x10'),_0x3d6a0a,'request\x20sent',JSON[_0x3397('0x11')](_0x110f16));if(_0x110f16[_0x3397('0x12')]){if(_0x110f16['error'][_0x3397('0x13')]===0x1f4){logger[_0x3397('0x12')](_0x3397('0xd'),_0x3d6a0a,_0x110f16[_0x3397('0x12')][_0x3397('0x14')]);return _0x4a3f7f(_0x110f16['error'][_0x3397('0x14')]);}logger['error'](_0x3397('0xd'),_0x3d6a0a,_0x110f16['error'][_0x3397('0x14')]);return _0x48d6b7(_0x110f16[_0x3397('0x12')]['message']);}else{logger[_0x3397('0xc')](_0x3397('0xd'),_0x3d6a0a,_0x3397('0xe'));_0x48d6b7(_0x110f16['result'][_0x3397('0x14')]);}})['catch'](function(_0x434ba4){logger['error'](_0x3397('0xd'),_0x3d6a0a,_0x434ba4);_0x4a3f7f(_0x434ba4);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c4d96d4..e1c28e3 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(_0x50ba6a,_0x33ab17){var _0x7088b5=function(_0x52a4b5){while(--_0x52a4b5){_0x50ba6a['push'](_0x50ba6a['shift']());}};_0x7088b5(++_0x33ab17);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xcb91[_0x22663b];return _0x310d0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x641f18,_0x2919e8){var _0x16eefe=function(_0x578a89){while(--_0x578a89){_0x641f18['push'](_0x641f18['shift']());}};_0x16eefe(++_0x2919e8);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 3369b6e..1991244 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 _0x762d=['sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x762d,0xdc));var _0xd762=function(_0xc4075d,_0x594953){_0xc4075d=_0xc4075d-0x0;var _0x6df199=_0x762d[_0xc4075d];return _0x6df199;};'use strict';var Sequelize=require(_0xd762('0x0'));module[_0xd762('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x86ce=['sequelize','exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x86ce,0x174));var _0xe86c=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x86ce[_0x1591d4];return _0x4c46bb;};'use strict';var Sequelize=require(_0xe86c('0x0'));module[_0xe86c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 7a39d6b..dfb7e7a 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 _0x53b1=['rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1745b1,_0x2e6a46){var _0x25bf24=function(_0x6270){while(--_0x6270){_0x1745b1['push'](_0x1745b1['shift']());}};_0x25bf24(++_0x2e6a46);}(_0x53b1,0x166));var _0x153b=function(_0x420e60,_0x1dd618){_0x420e60=_0x420e60-0x0;var _0x4f583b=_0x53b1[_0x420e60];return _0x4f583b;};'use strict';var _=require(_0x153b('0x0'));var util=require(_0x153b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x153b('0x2'));var BPromise=require(_0x153b('0x3'));var rp=require(_0x153b('0x4'));var fs=require('fs');var path=require(_0x153b('0x5'));var rimraf=require(_0x153b('0x6'));var config=require(_0x153b('0x7'));var attributes=require(_0x153b('0x8'));module[_0x153b('0x9')]=function(_0x26de6b,_0xa7bce1){return _0x26de6b[_0x153b('0xa')](_0x153b('0xb'),attributes,{'tableName':_0x153b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eb7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','util','../../config/logger'];(function(_0x5e4c34,_0x387a28){var _0xfd8fb0=function(_0x1fed41){while(--_0x1fed41){_0x5e4c34['push'](_0x5e4c34['shift']());}};_0xfd8fb0(++_0x387a28);}(_0x3eb7,0x15c));var _0x73eb=function(_0x2d4ef8,_0x59358b){_0x2d4ef8=_0x2d4ef8-0x0;var _0xea511a=_0x3eb7[_0x2d4ef8];return _0xea511a;};'use strict';var _=require(_0x73eb('0x0'));var util=require(_0x73eb('0x1'));var logger=require(_0x73eb('0x2'))(_0x73eb('0x3'));var moment=require(_0x73eb('0x4'));var BPromise=require(_0x73eb('0x5'));var rp=require(_0x73eb('0x6'));var fs=require('fs');var path=require(_0x73eb('0x7'));var rimraf=require(_0x73eb('0x8'));var config=require(_0x73eb('0x9'));var attributes=require(_0x73eb('0xa'));module['exports']=function(_0x2f6ff1,_0x311cd8){return _0x2f6ff1[_0x73eb('0xb')](_0x73eb('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 adf1cee..03e83fc 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x485f95,_0x174b92){var _0x4254f0=function(_0x5bee28){while(--_0x5bee28){_0x485f95['push'](_0x485f95['shift']());}};_0x4254f0(++_0x174b92);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3afe0f,_0x458547){var _0x2791de=function(_0x25b83c){while(--_0x25b83c){_0x3afe0f['push'](_0x3afe0f['shift']());}};_0x2791de(++_0x458547);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1c210b,_0x35c01){_0x1c210b=_0x1c210b-0x0;var _0x294e4f=_0x8ef6[_0x1c210b];return _0x294e4f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index ed4cf39..5140891 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 _0x0e00=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x24b79a,_0x1e3377){var _0x105c23=function(_0x2c9f3a){while(--_0x2c9f3a){_0x24b79a['push'](_0x24b79a['shift']());}};_0x105c23(++_0x1e3377);}(_0x0e00,0xcb));var _0x00e0=function(_0x4a17cd,_0x51844a){_0x4a17cd=_0x4a17cd-0x0;var _0x48639b=_0x0e00[_0x4a17cd];return _0x48639b;};'use strict';var multer=require(_0x00e0('0x0'));var util=require(_0x00e0('0x1'));var path=require(_0x00e0('0x2'));var timeout=require(_0x00e0('0x3'));var express=require(_0x00e0('0x4'));var router=express[_0x00e0('0x5')]();var fs_extra=require(_0x00e0('0x6'));var auth=require(_0x00e0('0x7'));var interaction=require(_0x00e0('0x8'));var config=require(_0x00e0('0x9'));var controller=require(_0x00e0('0xa'));router[_0x00e0('0xb')]('/',auth[_0x00e0('0xc')](),controller[_0x00e0('0xd')]);module[_0x00e0('0xe')]=router; \ No newline at end of file +var _0xc923=['../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','util','path','Router','fs-extra'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0xc923,0x1b4));var _0x3c92=function(_0x5dba24,_0x2867d2){_0x5dba24=_0x5dba24-0x0;var _0x1c23cb=_0xc923[_0x5dba24];return _0x1c23cb;};'use strict';var multer=require('multer');var util=require(_0x3c92('0x0'));var path=require(_0x3c92('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3c92('0x2')]();var fs_extra=require(_0x3c92('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x4'));var config=require(_0x3c92('0x5'));var controller=require('./userNotification.controller');router[_0x3c92('0x6')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0x8')]);module[_0x3c92('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 8a5fa10..2d622fd 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 _0xae96=['sequelize','exports','TEXT','STRING'];(function(_0x453dce,_0xa705e6){var _0x41d2e8=function(_0x59cc80){while(--_0x59cc80){_0x453dce['push'](_0x453dce['shift']());}};_0x41d2e8(++_0xa705e6);}(_0xae96,0x108));var _0x6ae9=function(_0xdb6b04,_0xaa0dae){_0xdb6b04=_0xdb6b04-0x0;var _0x2573d6=_0xae96[_0xdb6b04];return _0x2573d6;};'use strict';var Sequelize=require(_0x6ae9('0x0'));module[_0x6ae9('0x1')]={'body':{'type':Sequelize[_0x6ae9('0x2')]},'senderName':{'type':Sequelize[_0x6ae9('0x3')]},'recipientsId':{'type':Sequelize[_0x6ae9('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xdd30=['STRING','BOOLEAN','exports','TEXT'];(function(_0x938070,_0x558037){var _0x8b6b38=function(_0x2a9ff5){while(--_0x2a9ff5){_0x938070['push'](_0x938070['shift']());}};_0x8b6b38(++_0x558037);}(_0xdd30,0x1ba));var _0x0dd3=function(_0x257d1d,_0x55c66a){_0x257d1d=_0x257d1d-0x0;var _0x4cdea5=_0xdd30[_0x257d1d];return _0x4cdea5;};'use strict';var Sequelize=require('sequelize');module[_0x0dd3('0x0')]={'body':{'type':Sequelize[_0x0dd3('0x1')]},'senderName':{'type':Sequelize[_0x0dd3('0x2')]},'recipientsId':{'type':Sequelize[_0x0dd3('0x1')]},'recipientsDescription':{'type':Sequelize[_0x0dd3('0x2')]},'beep':{'type':Sequelize[_0x0dd3('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6c77027..116b566 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 _0xd624=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','text','body','hasOwnProperty','Sequelize','ValidationError','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','sequelize','transaction','UserNotification','forEach','emit','userNotification:send','catch','Template','render','html','startCase','User','union','ids','queue','replace','Queue','push','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x217dae,_0x2dfc7f){var _0x311403=function(_0x2e51e8){while(--_0x2e51e8){_0x217dae['push'](_0x217dae['shift']());}};_0x311403(++_0x2dfc7f);}(_0xd624,0x1d3));var _0x4d62=function(_0x2ec561,_0x591384){_0x2ec561=_0x2ec561-0x0;var _0xb897c2=_0xd624[_0x2ec561];return _0xb897c2;};'use strict';var emlformat=require(_0x4d62('0x0'));var rimraf=require(_0x4d62('0x1'));var zipdir=require(_0x4d62('0x2'));var jsonpatch=require(_0x4d62('0x3'));var rp=require(_0x4d62('0x4'));var moment=require('moment');var BPromise=require(_0x4d62('0x5'));var Mustache=require(_0x4d62('0x6'));var util=require(_0x4d62('0x7'));var path=require(_0x4d62('0x8'));var sox=require(_0x4d62('0x9'));var csv=require(_0x4d62('0xa'));var ejs=require(_0x4d62('0xb'));var fs=require('fs');var fs_extra=require(_0x4d62('0xc'));var _=require(_0x4d62('0xd'));var squel=require(_0x4d62('0xe'));var crypto=require('crypto');var jsforce=require(_0x4d62('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4d62('0xa'));var querystring=require('querystring');var Papa=require(_0x4d62('0x10'));var Redis=require(_0x4d62('0x11'));var authService=require(_0x4d62('0x12'));var qs=require(_0x4d62('0x13'));var as=require(_0x4d62('0x14'));var hardwareService=require(_0x4d62('0x15'));var logger=require('../../config/logger')(_0x4d62('0x16'));var utils=require(_0x4d62('0x17'));var config=require(_0x4d62('0x18'));var licenseUtil=require(_0x4d62('0x19'));var db=require(_0x4d62('0x1a'))['db'];config['redis']=_[_0x4d62('0x1b')](config['redis'],{'host':_0x4d62('0x1c'),'port':0x18eb});var socket=require(_0x4d62('0x1d'))(new Redis(config[_0x4d62('0x1e')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x45f0fb,_0x174087){_0x174087=_0x174087||0xcc;return function(_0xea8896){if(_0xea8896){return _0x45f0fb['sendStatus'](_0x174087);}return _0x45f0fb['status'](_0x174087)[_0x4d62('0x1f')]();};}function respondWithResult(_0x1bc8d5,_0x54d34a){_0x54d34a=_0x54d34a||0xc8;return function(_0x3c50fb){if(_0x3c50fb){return _0x1bc8d5[_0x4d62('0x20')](_0x54d34a)['json'](_0x3c50fb);}};}function respondWithFilteredResult(_0x41c7da,_0x3d9f94){return function(_0x24cf12){if(_0x24cf12){var _0x3bb691=typeof _0x3d9f94[_0x4d62('0x21')]===_0x4d62('0x22')&&typeof _0x3d9f94[_0x4d62('0x23')]===_0x4d62('0x22');var _0x26df49=_0x24cf12[_0x4d62('0x24')];var _0x205fef=_0x3bb691?0x0:_0x3d9f94[_0x4d62('0x21')];var _0x461da7=_0x3bb691?_0x24cf12[_0x4d62('0x24')]:_0x3d9f94['offset']+_0x3d9f94['limit'];var _0x28de6e;if(_0x461da7>=_0x26df49){_0x461da7=_0x26df49;_0x28de6e=0xc8;}else{_0x28de6e=0xce;}_0x41c7da[_0x4d62('0x20')](_0x28de6e);return _0x41c7da[_0x4d62('0x25')](_0x4d62('0x26'),_0x205fef+'-'+_0x461da7+'/'+_0x26df49)[_0x4d62('0x27')](_0x24cf12);}return null;};}function patchUpdates(_0x369c0b){return function(_0x235c64){try{jsonpatch[_0x4d62('0x28')](_0x235c64,_0x369c0b,!![]);}catch(_0x14c559){return BPromise[_0x4d62('0x29')](_0x14c559);}return _0x235c64[_0x4d62('0x2a')]();};}function saveUpdates(_0x1e4623,_0x23481f){return function(_0x1e9d5a){if(_0x1e9d5a){return _0x1e9d5a[_0x4d62('0x2b')](_0x1e4623)[_0x4d62('0x2c')](function(_0x16047b){return _0x16047b;});}return null;};}function removeEntity(_0x3dffe6,_0xd87699){return function(_0x4cb4b3){if(_0x4cb4b3){return _0x4cb4b3['destroy']()[_0x4d62('0x2c')](function(){_0x3dffe6['status'](0xcc)[_0x4d62('0x1f')]();});}};}function handleEntityNotFound(_0x221a71,_0x287169){return function(_0x4fbb69){if(!_0x4fbb69){_0x221a71[_0x4d62('0x2d')](0x194);}return _0x4fbb69;};}function handleError(_0x1f948c,_0x320a46){_0x320a46=_0x320a46||0x1f4;return function(_0x45c0b9){logger[_0x4d62('0x2e')](_0x45c0b9['stack']);if(_0x45c0b9[_0x4d62('0x2f')]){delete _0x45c0b9[_0x4d62('0x2f')];}_0x1f948c[_0x4d62('0x20')](_0x320a46)[_0x4d62('0x30')](_0x45c0b9);};}exports['sendUserNotification']=function(_0x390e12,_0x57574b,_0x4bc7ac){if(!_0x390e12['body']['hasOwnProperty'](_0x4d62('0x31'))&&!_0x390e12[_0x4d62('0x32')][_0x4d62('0x33')]('TemplateId')){throw new db[(_0x4d62('0x34'))][(_0x4d62('0x35'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x390e12[_0x4d62('0x32')][_0x4d62('0x33')](_0x4d62('0x36'))&&!_0x390e12[_0x4d62('0x32')][_0x4d62('0x33')]('view')){throw new db[(_0x4d62('0x34'))][(_0x4d62('0x35'))](_0x4d62('0x37'));}if(!_0x390e12[_0x4d62('0x32')]['hasOwnProperty'](_0x4d62('0x38'))){throw new db[(_0x4d62('0x34'))][(_0x4d62('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x408a6e=JSON[_0x4d62('0x39')](_0x390e12[_0x4d62('0x32')][_0x4d62('0x38')]);}catch(_0xd3787a){logger[_0x4d62('0x2e')](_0xd3787a);throw new db[(_0x4d62('0x34'))][(_0x4d62('0x35'))](_0x4d62('0x3a'));}var _0xd275e1=[_0x4d62('0x3b'),'faxqueue','mailqueue',_0x4d62('0x3c'),'smsqueue',_0x4d62('0x3d'),_0x4d62('0x3e'),_0x4d62('0x3f'),_0x4d62('0x40')];if(_[_0x4d62('0x41')](_0x408a6e,function(_0x18237d){return!_['includes'](_0xd275e1,_0x18237d[_0x4d62('0x42')][_0x4d62('0x43')]());})){throw new db[(_0x4d62('0x34'))][(_0x4d62('0x35'))](_0x4d62('0x44'));}}}var _0x29a229={};_0x29a229[_0x4d62('0x45')]=_0x390e12['body'][_0x4d62('0x33')](_0x4d62('0x45'))?_0x390e12[_0x4d62('0x32')]['senderName']:_0x390e12['user'][_0x4d62('0x46')];_0x29a229[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x390e12['body'][_0x4d62('0x47')])?null:_0x390e12[_0x4d62('0x32')]['recipientsDescription'];_0x29a229[_0x4d62('0x49')]=_0x390e12[_0x4d62('0x32')][_0x4d62('0x49')]||![];_0x29a229['SenderId']=_0x390e12['user']['id'];return getContent(_0x390e12[_0x4d62('0x32')])[_0x4d62('0x2c')](function(_0x16128f){_0x29a229[_0x4d62('0x32')]=_0x16128f;return getRecipients(_0x408a6e);})[_0x4d62('0x2c')](function(_0x61a953){_0x29a229[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x61a953)['join'](',');return db[_0x4d62('0x4c')][_0x4d62('0x4d')](function(_0x456d8d){return db[_0x4d62('0x4e')]['create'](_0x29a229,{'raw':!![],'transaction':_0x456d8d})[_0x4d62('0x2c')](function(_0x5ab680){var _0x568d5a={'sender':_0x29a229[_0x4d62('0x45')],'description':_0x29a229[_0x4d62('0x47')],'content':_0x29a229[_0x4d62('0x32')],'beep':_0x29a229[_0x4d62('0x49')]};_0x61a953[_0x4d62('0x4f')](function(_0x59b3a3){_0x568d5a['recipient']=_0x59b3a3;socket[_0x4d62('0x50')](_0x4d62('0x51'),_0x568d5a);});return _0x5ab680;});});})[_0x4d62('0x2c')](respondWithResult(_0x57574b,0xc9))[_0x4d62('0x52')](handleError(_0x57574b,null));};function getContent(_0x3aa4c3){return new BPromise(function(_0x408cab,_0x3e68d8){if(_0x3aa4c3[_0x4d62('0x31')]){_0x408cab(_0x3aa4c3[_0x4d62('0x31')]);return;}return db[_0x4d62('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x3aa4c3['TemplateId']},'raw':!![]})['then'](function(_0x5b48d3){if(!_0x5b48d3)throw new db['Sequelize'][(_0x4d62('0x35'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x584e50=Mustache[_0x4d62('0x54')](_0x5b48d3[_0x4d62('0x55')],_0x3aa4c3['view']);_0x408cab(_0x584e50);})['catch'](function(_0x7236de){_0x3e68d8(_0x7236de);});});}function getRecipients(_0x30c5cf){return new BPromise(function(_0x22701f,_0x11c134){var _0x2a7f14=[];var _0x29526b=[];_0x30c5cf[_0x4d62('0x4f')](function(_0x29b9d9){var _0x59f032=_[_0x4d62('0x56')](_0x29b9d9[_0x4d62('0x42')][_0x4d62('0x43')]());if(_0x59f032===_0x4d62('0x57')){_0x2a7f14=_[_0x4d62('0x58')](_0x2a7f14,_0x29b9d9[_0x4d62('0x59')]);}else{if(_['includes'](_0x59f032,_0x4d62('0x5a')))_0x59f032=_0x59f032[_0x4d62('0x5b')](_0x4d62('0x5a'),_0x4d62('0x5c'));_0x29b9d9[_0x4d62('0x59')][_0x4d62('0x4f')](function(_0x5335da){_0x29526b[_0x4d62('0x5d')](getAgents(_0x59f032,_0x5335da));});}});return BPromise['all'](_0x29526b)[_0x4d62('0x2c')](function(_0x10da9c){_0x2a7f14=_[_0x4d62('0x58')](_0x2a7f14,_[_0x4d62('0x5e')](_0x10da9c));_0x22701f(_0x2a7f14);})['catch'](function(_0x157924){_0x11c134(_0x157924);});});}function getAgents(_0x3d4f94,_0xeaa033){return new BPromise(function(_0x113754,_0x1b737c){return db[_0x3d4f94][_0x4d62('0x5f')]({'where':{'id':_0xeaa033}})['then'](function(_0x30cb59){return _0x30cb59[_0x4d62('0x60')]({'attributes':['id'],'raw':!![]})[_0x4d62('0x2c')](function(_0x54f6fd){var _0x2d773a=_[_0x4d62('0x61')](_0x54f6fd,'id');_0x113754(_0x2d773a);});})[_0x4d62('0x52')](function(_0x325fb9){_0x1b737c(_0x325fb9);});});} \ No newline at end of file +var _0xa45e=['faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue'];(function(_0x3e6480,_0x4b7e13){var _0x55beef=function(_0x3fea62){while(--_0x3fea62){_0x3e6480['push'](_0x3e6480['shift']());}};_0x55beef(++_0x4b7e13);}(_0xa45e,0x16f));var _0xea45=function(_0x3c5e8b,_0x53a259){_0x3c5e8b=_0x3c5e8b-0x0;var _0x5217d7=_0xa45e[_0x3c5e8b];return _0x5217d7;};'use strict';var emlformat=require(_0xea45('0x0'));var rimraf=require(_0xea45('0x1'));var zipdir=require(_0xea45('0x2'));var jsonpatch=require(_0xea45('0x3'));var rp=require(_0xea45('0x4'));var moment=require(_0xea45('0x5'));var BPromise=require(_0xea45('0x6'));var Mustache=require(_0xea45('0x7'));var util=require(_0xea45('0x8'));var path=require(_0xea45('0x9'));var sox=require(_0xea45('0xa'));var csv=require(_0xea45('0xb'));var ejs=require(_0xea45('0xc'));var fs=require('fs');var fs_extra=require(_0xea45('0xd'));var _=require(_0xea45('0xe'));var squel=require(_0xea45('0xf'));var crypto=require(_0xea45('0x10'));var jsforce=require(_0xea45('0x11'));var deskjs=require(_0xea45('0x12'));var toCsv=require(_0xea45('0xb'));var querystring=require(_0xea45('0x13'));var Papa=require(_0xea45('0x14'));var Redis=require(_0xea45('0x15'));var authService=require(_0xea45('0x16'));var qs=require(_0xea45('0x17'));var as=require(_0xea45('0x18'));var hardwareService=require(_0xea45('0x19'));var logger=require(_0xea45('0x1a'))(_0xea45('0x1b'));var utils=require(_0xea45('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0xea45('0x1d'));var db=require(_0xea45('0x1e'))['db'];config[_0xea45('0x1f')]=_[_0xea45('0x20')](config[_0xea45('0x1f')],{'host':_0xea45('0x21'),'port':0x18eb});var socket=require(_0xea45('0x22'))(new Redis(config[_0xea45('0x1f')]));require(_0xea45('0x23'))[_0xea45('0x24')](socket);function respondWithStatusCode(_0x5ab008,_0x5254d6){_0x5254d6=_0x5254d6||0xcc;return function(_0x565b10){if(_0x565b10){return _0x5ab008[_0xea45('0x25')](_0x5254d6);}return _0x5ab008[_0xea45('0x26')](_0x5254d6)[_0xea45('0x27')]();};}function respondWithResult(_0x19e032,_0x2bf07c){_0x2bf07c=_0x2bf07c||0xc8;return function(_0x163721){if(_0x163721){return _0x19e032['status'](_0x2bf07c)['json'](_0x163721);}};}function respondWithFilteredResult(_0x571393,_0x112cf4){return function(_0x514b59){if(_0x514b59){var _0x2a1443=typeof _0x112cf4[_0xea45('0x28')]===_0xea45('0x29')&&typeof _0x112cf4['limit']===_0xea45('0x29');var _0x1bccec=_0x514b59[_0xea45('0x2a')];var _0x230e9c=_0x2a1443?0x0:_0x112cf4[_0xea45('0x28')];var _0xb28d6f=_0x2a1443?_0x514b59[_0xea45('0x2a')]:_0x112cf4[_0xea45('0x28')]+_0x112cf4[_0xea45('0x2b')];var _0x6a433;if(_0xb28d6f>=_0x1bccec){_0xb28d6f=_0x1bccec;_0x6a433=0xc8;}else{_0x6a433=0xce;}_0x571393[_0xea45('0x26')](_0x6a433);return _0x571393[_0xea45('0x2c')](_0xea45('0x2d'),_0x230e9c+'-'+_0xb28d6f+'/'+_0x1bccec)[_0xea45('0x2e')](_0x514b59);}return null;};}function patchUpdates(_0x3534bf){return function(_0x5df6a0){try{jsonpatch[_0xea45('0x2f')](_0x5df6a0,_0x3534bf,!![]);}catch(_0x521e29){return BPromise[_0xea45('0x30')](_0x521e29);}return _0x5df6a0[_0xea45('0x31')]();};}function saveUpdates(_0x1cd5d4,_0x55fe5e){return function(_0x4ed527){if(_0x4ed527){return _0x4ed527['update'](_0x1cd5d4)['then'](function(_0x3769e4){return _0x3769e4;});}return null;};}function removeEntity(_0x60dbb5,_0x13fe82){return function(_0x486a6e){if(_0x486a6e){return _0x486a6e[_0xea45('0x32')]()[_0xea45('0x33')](function(){_0x60dbb5[_0xea45('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc665,_0x49c69f){return function(_0x47557e){if(!_0x47557e){_0x2dc665[_0xea45('0x25')](0x194);}return _0x47557e;};}function handleError(_0x474194,_0x11cb0a){_0x11cb0a=_0x11cb0a||0x1f4;return function(_0x47577e){logger[_0xea45('0x34')](_0x47577e[_0xea45('0x35')]);if(_0x47577e[_0xea45('0x36')]){delete _0x47577e[_0xea45('0x36')];}_0x474194[_0xea45('0x26')](_0x11cb0a)['send'](_0x47577e);};}exports['sendUserNotification']=function(_0x3f65fd,_0x2ff085,_0x36dca9){if(!_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')](_0xea45('0x39'))&&!_0x3f65fd[_0xea45('0x37')]['hasOwnProperty'](_0xea45('0x3a'))){throw new db[(_0xea45('0x3b'))][(_0xea45('0x3c'))](_0xea45('0x3d'));}else{if(_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')]('TemplateId')&&!_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')](_0xea45('0x3e'))){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x3f'));}if(!_0x3f65fd['body'][_0xea45('0x38')](_0xea45('0x40'))){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x41'));}else{try{var _0x3764a4=JSON[_0xea45('0x42')](_0x3f65fd[_0xea45('0x37')][_0xea45('0x40')]);}catch(_0x41c8bc){logger['error'](_0x41c8bc);throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x43'));}var _0x13a7db=[_0xea45('0x44'),_0xea45('0x45'),'mailqueue',_0xea45('0x46'),_0xea45('0x47'),_0xea45('0x48'),_0xea45('0x49'),_0xea45('0x4a'),_0xea45('0x4b')];if(_[_0xea45('0x4c')](_0x3764a4,function(_0x203351){return!_['includes'](_0x13a7db,_0x203351[_0xea45('0x4d')][_0xea45('0x4e')]());})){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x4f'));}}}var _0x405472={};_0x405472[_0xea45('0x50')]=_0x3f65fd['body'][_0xea45('0x38')](_0xea45('0x50'))?_0x3f65fd[_0xea45('0x37')][_0xea45('0x50')]:_0x3f65fd['user'][_0xea45('0x51')];_0x405472['recipientsDescription']=_['isEmpty'](_0x3f65fd[_0xea45('0x37')][_0xea45('0x52')])?null:_0x3f65fd[_0xea45('0x37')][_0xea45('0x52')];_0x405472[_0xea45('0x53')]=_0x3f65fd[_0xea45('0x37')][_0xea45('0x53')]||![];_0x405472[_0xea45('0x54')]=_0x3f65fd[_0xea45('0x4b')]['id'];return getContent(_0x3f65fd['body'])[_0xea45('0x33')](function(_0x3f8ab2){_0x405472['body']=_0x3f8ab2;return getRecipients(_0x3764a4);})[_0xea45('0x33')](function(_0xf1c034){_0x405472['recipientsId']=_['sortBy'](_0xf1c034)['join'](',');return db[_0xea45('0x55')][_0xea45('0x56')](function(_0x41e509){return db[_0xea45('0x57')]['create'](_0x405472,{'raw':!![],'transaction':_0x41e509})[_0xea45('0x33')](function(_0x4174fe){var _0x25a5c5={'sender':_0x405472[_0xea45('0x50')],'description':_0x405472[_0xea45('0x52')],'content':_0x405472[_0xea45('0x37')],'beep':_0x405472[_0xea45('0x53')]};_0xf1c034[_0xea45('0x58')](function(_0x45b1e7){_0x25a5c5[_0xea45('0x59')]=_0x45b1e7;socket[_0xea45('0x5a')](_0xea45('0x5b'),_0x25a5c5);});return _0x4174fe;});});})[_0xea45('0x33')](respondWithResult(_0x2ff085,0xc9))[_0xea45('0x5c')](handleError(_0x2ff085,null));};function getContent(_0x11a51b){return new BPromise(function(_0xfee26,_0x4bcd49){if(_0x11a51b[_0xea45('0x39')]){_0xfee26(_0x11a51b[_0xea45('0x39')]);return;}return db[_0xea45('0x5d')][_0xea45('0x5e')]({'attributes':[_0xea45('0x5f')],'where':{'id':_0x11a51b[_0xea45('0x3a')]},'raw':!![]})[_0xea45('0x33')](function(_0x5e959c){if(!_0x5e959c)throw new db[(_0xea45('0x3b'))][(_0xea45('0x3c'))](_0xea45('0x60'));var _0x19c4e8=Mustache[_0xea45('0x61')](_0x5e959c['html'],_0x11a51b[_0xea45('0x3e')]);_0xfee26(_0x19c4e8);})[_0xea45('0x5c')](function(_0x57b517){_0x4bcd49(_0x57b517);});});}function getRecipients(_0x234df2){return new BPromise(function(_0x2925e3,_0x512ec8){var _0x2131cd=[];var _0x2322c8=[];_0x234df2[_0xea45('0x58')](function(_0x1dad8d){var _0x586e32=_[_0xea45('0x62')](_0x1dad8d[_0xea45('0x4d')][_0xea45('0x4e')]());if(_0x586e32==='User'){_0x2131cd=_[_0xea45('0x63')](_0x2131cd,_0x1dad8d[_0xea45('0x64')]);}else{if(_['includes'](_0x586e32,_0xea45('0x65')))_0x586e32=_0x586e32[_0xea45('0x66')](_0xea45('0x65'),_0xea45('0x67'));_0x1dad8d[_0xea45('0x64')][_0xea45('0x58')](function(_0x49357e){_0x2322c8[_0xea45('0x68')](getAgents(_0x586e32,_0x49357e));});}});return BPromise[_0xea45('0x69')](_0x2322c8)[_0xea45('0x33')](function(_0x104867){_0x2131cd=_[_0xea45('0x63')](_0x2131cd,_[_0xea45('0x6a')](_0x104867));_0x2925e3(_0x2131cd);})['catch'](function(_0x1ffd84){_0x512ec8(_0x1ffd84);});});}function getAgents(_0x6a9ec0,_0x42cbfe){return new BPromise(function(_0x7c332e,_0x21bfd7){return db[_0x6a9ec0]['findOne']({'where':{'id':_0x42cbfe}})[_0xea45('0x33')](function(_0x162aee){return _0x162aee[_0xea45('0x6b')]({'attributes':['id'],'raw':!![]})[_0xea45('0x33')](function(_0x3742bf){var _0x5568bc=_[_0xea45('0x6c')](_0x3742bf,'id');_0x7c332e(_0x5568bc);});})[_0xea45('0x5c')](function(_0x4e8eaf){_0x21bfd7(_0x4e8eaf);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index adfea8a..cf30ac0 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 _0x8cbd=['../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hook','events'];(function(_0x2ecb26,_0x3db364){var _0x18e39a=function(_0x5e6af){while(--_0x5e6af){_0x2ecb26['push'](_0x2ecb26['shift']());}};_0x18e39a(++_0x3db364);}(_0x8cbd,0x137));var _0xd8cb=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x8cbd[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0xd8cb('0x0'));var UserNotification=require(_0xd8cb('0x1'))['db'][_0xd8cb('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xd8cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd8cb('0x4'),'afterDestroy':_0xd8cb('0x5')};function emitEvent(_0x5a7b66){return function(_0x47be0e,_0x423b8f,_0x35b4f7){UserNotificationEvents[_0xd8cb('0x6')](_0x5a7b66+':'+_0x47be0e['id'],_0x47be0e);UserNotificationEvents[_0xd8cb('0x6')](_0x5a7b66,_0x47be0e);_0x35b4f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xd8cb('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x9a12=['UserNotification','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x388531,_0x5a9979){var _0x36414c=function(_0x21865a){while(--_0x21865a){_0x388531['push'](_0x388531['shift']());}};_0x36414c(++_0x5a9979);}(_0x9a12,0x156));var _0x29a1=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0x9a12[_0x18cfc7];return _0x3d0e73;};'use strict';var EventEmitter=require(_0x29a1('0x0'));var UserNotification=require(_0x29a1('0x1'))['db'][_0x29a1('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29a1('0x3'),'afterUpdate':_0x29a1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d795b){return function(_0x3f4c88,_0x1d6470,_0x184a71){UserNotificationEvents[_0x29a1('0x5')](_0x5d795b+':'+_0x3f4c88['id'],_0x3f4c88);UserNotificationEvents[_0x29a1('0x5')](_0x5d795b,_0x3f4c88);_0x184a71(null);};}for(var e in events){if(events[_0x29a1('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x29a1('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 a80b5d9..41942f7 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 _0x0e8c=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','userNotifications'];(function(_0x23efb4,_0x45c16a){var _0x238457=function(_0x122825){while(--_0x122825){_0x23efb4['push'](_0x23efb4['shift']());}};_0x238457(++_0x45c16a);}(_0x0e8c,0x19b));var _0xc0e8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e8c[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xc0e8('0x0'));var logger=require(_0xc0e8('0x1'))(_0xc0e8('0x2'));var moment=require(_0xc0e8('0x3'));var BPromise=require('bluebird');var rp=require(_0xc0e8('0x4'));var fs=require('fs');var path=require(_0xc0e8('0x5'));var rimraf=require('rimraf');var config=require(_0xc0e8('0x6'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x49f0c9,_0x1b6514){return _0x49f0c9[_0xc0e8('0x7')]('UserNotification',attributes,{'tableName':_0xc0e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc0e8('0x9')});}; \ No newline at end of file +var _0x4a57=['path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x2d380a,_0x4e2ba3){var _0x1ee691=function(_0x3303ab){while(--_0x3303ab){_0x2d380a['push'](_0x2d380a['shift']());}};_0x1ee691(++_0x4e2ba3);}(_0x4a57,0xff));var _0x74a5=function(_0x1754db,_0x3e32f7){_0x1754db=_0x1754db-0x0;var _0x273e77=_0x4a57[_0x1754db];return _0x273e77;};'use strict';var _=require('lodash');var util=require(_0x74a5('0x0'));var logger=require(_0x74a5('0x1'))(_0x74a5('0x2'));var moment=require(_0x74a5('0x3'));var BPromise=require('bluebird');var rp=require(_0x74a5('0x4'));var fs=require('fs');var path=require(_0x74a5('0x5'));var rimraf=require(_0x74a5('0x6'));var config=require(_0x74a5('0x7'));var attributes=require(_0x74a5('0x8'));module['exports']=function(_0x2af11b,_0x11d36c){return _0x2af11b[_0x74a5('0x9')](_0x74a5('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74a5('0xb'),'collate':_0x74a5('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 0cdc143..5c8487a 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 _0xb980=['socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost'];(function(_0x4338bb,_0x5cc4fc){var _0x31d0b2=function(_0x28c261){while(--_0x28c261){_0x4338bb['push'](_0x4338bb['shift']());}};_0x31d0b2(++_0x5cc4fc);}(_0xb980,0x14e));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0b98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b98('0x1'));var fs=require('fs');var Redis=require(_0x0b98('0x2'));var db=require(_0x0b98('0x3'))['db'];var utils=require(_0x0b98('0x4'));var logger=require('../../config/logger')(_0x0b98('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b98('0x6')][_0x0b98('0x7')]({'port':0x232a});config[_0x0b98('0x8')]=_[_0x0b98('0x9')](config[_0x0b98('0x8')],{'host':_0x0b98('0xa'),'port':0x18eb});var socket=require(_0x0b98('0xb'))(new Redis(config[_0x0b98('0x8')]));require(_0x0b98('0xc'))[_0x0b98('0xd')](socket);function respondWithRpcPromise(_0x2d8d24,_0x16b62b,_0x2f3601){return new BPromise(function(_0x59500a,_0x291046){return client['request'](_0x2d8d24,_0x2f3601)[_0x0b98('0xe')](function(_0x51a7ae){logger['info'](_0x0b98('0xf'),_0x16b62b,'request\x20sent');logger[_0x0b98('0x10')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x16b62b,_0x0b98('0x11'),JSON[_0x0b98('0x12')](_0x51a7ae));if(_0x51a7ae['error']){if(_0x51a7ae[_0x0b98('0x13')]['code']===0x1f4){logger[_0x0b98('0x13')](_0x0b98('0xf'),_0x16b62b,_0x51a7ae['error'][_0x0b98('0x14')]);return _0x291046(_0x51a7ae[_0x0b98('0x13')][_0x0b98('0x14')]);}logger[_0x0b98('0x13')](_0x0b98('0xf'),_0x16b62b,_0x51a7ae[_0x0b98('0x13')][_0x0b98('0x14')]);return _0x59500a(_0x51a7ae[_0x0b98('0x13')][_0x0b98('0x14')]);}else{logger[_0x0b98('0x15')](_0x0b98('0xf'),_0x16b62b,'request\x20sent');_0x59500a(_0x51a7ae['result'][_0x0b98('0x14')]);}})[_0x0b98('0x16')](function(_0x6af2c1){logger[_0x0b98('0x13')](_0x0b98('0xf'),_0x16b62b,_0x6af2c1);_0x291046(_0x6af2c1);});});} \ No newline at end of file +var _0xb5f4=['./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x3a60e9,_0x441453){var _0x51a476=function(_0x36a41c){while(--_0x36a41c){_0x3a60e9['push'](_0x3a60e9['shift']());}};_0x51a476(++_0x441453);}(_0xb5f4,0x1e9));var _0x4b5f=function(_0x27a4b2,_0x231b8d){_0x27a4b2=_0x27a4b2-0x0;var _0x189df2=_0xb5f4[_0x27a4b2];return _0x189df2;};'use strict';var _=require(_0x4b5f('0x0'));var util=require(_0x4b5f('0x1'));var moment=require(_0x4b5f('0x2'));var BPromise=require(_0x4b5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b5f('0x4'));var db=require(_0x4b5f('0x5'))['db'];var utils=require(_0x4b5f('0x6'));var logger=require(_0x4b5f('0x7'))(_0x4b5f('0x8'));var config=require(_0x4b5f('0x9'));var jayson=require(_0x4b5f('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x4b5f('0xb')]=_[_0x4b5f('0xc')](config['redis'],{'host':_0x4b5f('0xd'),'port':0x18eb});var socket=require(_0x4b5f('0xe'))(new Redis(config['redis']));require(_0x4b5f('0xf'))[_0x4b5f('0x10')](socket);function respondWithRpcPromise(_0x5cab36,_0x359f4c,_0x405722){return new BPromise(function(_0x32724d,_0x5dd717){return client[_0x4b5f('0x11')](_0x5cab36,_0x405722)[_0x4b5f('0x12')](function(_0x1494c7){logger[_0x4b5f('0x13')](_0x4b5f('0x14'),_0x359f4c,_0x4b5f('0x15'));logger['debug'](_0x4b5f('0x16'),_0x359f4c,'request\x20sent',JSON[_0x4b5f('0x17')](_0x1494c7));if(_0x1494c7['error']){if(_0x1494c7[_0x4b5f('0x18')]['code']===0x1f4){logger[_0x4b5f('0x18')](_0x4b5f('0x14'),_0x359f4c,_0x1494c7['error'][_0x4b5f('0x19')]);return _0x5dd717(_0x1494c7[_0x4b5f('0x18')][_0x4b5f('0x19')]);}logger['error'](_0x4b5f('0x14'),_0x359f4c,_0x1494c7['error'][_0x4b5f('0x19')]);return _0x32724d(_0x1494c7[_0x4b5f('0x18')]['message']);}else{logger[_0x4b5f('0x13')](_0x4b5f('0x14'),_0x359f4c,_0x4b5f('0x15'));_0x32724d(_0x1494c7[_0x4b5f('0x1a')][_0x4b5f('0x19')]);}})[_0x4b5f('0x1b')](function(_0xa6c0ad){logger[_0x4b5f('0x18')](_0x4b5f('0x14'),_0x359f4c,_0xa6c0ad);_0x5dd717(_0xa6c0ad);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7f6af01..22caa9f 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 _0x4e0a=['removeListener','register','userNotification:','./userNotification.events','save','update','emit'];(function(_0x212eba,_0xfb99d7){var _0x18de49=function(_0x41a179){while(--_0x41a179){_0x212eba['push'](_0x212eba['shift']());}};_0x18de49(++_0xfb99d7);}(_0x4e0a,0xe3));var _0xa4e0=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x4e0a[_0x3e7804];return _0x56efda;};'use strict';var UserNotificationEvents=require(_0xa4e0('0x0'));var events=[_0xa4e0('0x1'),'remove',_0xa4e0('0x2')];function createListener(_0x3d2569,_0x296539){return function(_0x268e0b){_0x296539[_0xa4e0('0x3')](_0x3d2569,_0x268e0b);};}function removeListener(_0x168520,_0x49c8e7){return function(){UserNotificationEvents[_0xa4e0('0x4')](_0x168520,_0x49c8e7);};}exports[_0xa4e0('0x5')]=function(_0x419890){for(var _0x447eba=0x0,_0x52f5ba=events['length'];_0x447eba<_0x52f5ba;_0x447eba++){var _0x87effa=events[_0x447eba];var _0x4e8491=createListener(_0xa4e0('0x6')+_0x87effa,_0x419890);UserNotificationEvents['on'](_0x87effa,_0x4e8491);}}; \ No newline at end of file +var _0x9bc7=['emit','removeListener','length','./userNotification.events','remove','update'];(function(_0xe17667,_0x4b64fe){var _0x25ff01=function(_0x16c1c4){while(--_0x16c1c4){_0xe17667['push'](_0xe17667['shift']());}};_0x25ff01(++_0x4b64fe);}(_0x9bc7,0x7b));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var UserNotificationEvents=require(_0x79bc('0x0'));var events=['save',_0x79bc('0x1'),_0x79bc('0x2')];function createListener(_0x4d1ac9,_0x53cbbc){return function(_0x3620ec){_0x53cbbc[_0x79bc('0x3')](_0x4d1ac9,_0x3620ec);};}function removeListener(_0xa91be1,_0x559191){return function(){UserNotificationEvents[_0x79bc('0x4')](_0xa91be1,_0x559191);};}exports['register']=function(_0x5afdb2){for(var _0x5b73f2=0x0,_0x41c86d=events[_0x79bc('0x5')];_0x5b73f2<_0x41c86d;_0x5b73f2++){var _0x25df68=events[_0x5b73f2];var _0x425aef=createListener('userNotification:'+_0x25df68,_0x5afdb2);UserNotificationEvents['on'](_0x25df68,_0x425aef);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 74a8358..bd3a03c 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x43f1b5,_0xcee793){var _0x3e01a9=function(_0x20518b){while(--_0x20518b){_0x43f1b5['push'](_0x43f1b5['shift']());}};_0x3e01a9(++_0xcee793);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6f8dc5,_0x15d9c7){var _0x2748e7=function(_0x38f3cb){while(--_0x38f3cb){_0x6f8dc5['push'](_0x6f8dc5['shift']());}};_0x2748e7(++_0x15d9c7);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 461f49e..6f1f2d6 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 _0x8514=['sequelize','exports','INTEGER'];(function(_0x4eb118,_0x497546){var _0x10a3b7=function(_0x56f66e){while(--_0x56f66e){_0x4eb118['push'](_0x4eb118['shift']());}};_0x10a3b7(++_0x497546);}(_0x8514,0x93));var _0x4851=function(_0x31a94c,_0x289026){_0x31a94c=_0x31a94c-0x0;var _0x5181d5=_0x8514[_0x31a94c];return _0x5181d5;};'use strict';var Sequelize=require(_0x4851('0x0'));module[_0x4851('0x1')]={'penalty':{'type':Sequelize[_0x4851('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc213=['sequelize','exports','INTEGER'];(function(_0x2d5b64,_0x525685){var _0x311393=function(_0x8b0f75){while(--_0x8b0f75){_0x2d5b64['push'](_0x2d5b64['shift']());}};_0x311393(++_0x525685);}(_0xc213,0x19b));var _0x3c21=function(_0x2b0800,_0x3da853){_0x2b0800=_0x2b0800-0x0;var _0x1e044b=_0xc213[_0x2b0800];return _0x1e044b;};'use strict';var Sequelize=require(_0x3c21('0x0'));module[_0x3c21('0x1')]={'penalty':{'type':Sequelize[_0x3c21('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 24c8c49..a50cea6 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 _0x05c2=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','UserOpenchannelQueue','lodash'];(function(_0x49ebcb,_0x35d919){var _0x581436=function(_0x397655){while(--_0x397655){_0x49ebcb['push'](_0x49ebcb['shift']());}};_0x581436(++_0x35d919);}(_0x05c2,0x153));var _0x205c=function(_0x1afa48,_0x1e9e74){_0x1afa48=_0x1afa48-0x0;var _0x42bc77=_0x05c2[_0x1afa48];return _0x42bc77;};'use strict';var _=require(_0x205c('0x0'));var util=require(_0x205c('0x1'));var logger=require(_0x205c('0x2'))('api');var moment=require(_0x205c('0x3'));var BPromise=require(_0x205c('0x4'));var rp=require(_0x205c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x205c('0x6'));var config=require(_0x205c('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x375c7a,_0x23352b){return _0x375c7a[_0x205c('0x8')](_0x205c('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c32=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x13fa73,_0x3640ec){var _0x5842ba=function(_0x56ea77){while(--_0x56ea77){_0x13fa73['push'](_0x13fa73['shift']());}};_0x5842ba(++_0x3640ec);}(_0x1c32,0x184));var _0x21c3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1c32[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x21c3('0x0'));var util=require(_0x21c3('0x1'));var logger=require(_0x21c3('0x2'))('api');var moment=require(_0x21c3('0x3'));var BPromise=require(_0x21c3('0x4'));var rp=require(_0x21c3('0x5'));var fs=require('fs');var path=require(_0x21c3('0x6'));var rimraf=require(_0x21c3('0x7'));var config=require(_0x21c3('0x8'));var attributes=require(_0x21c3('0x9'));module['exports']=function(_0x1cf4c0,_0x25e295){return _0x1cf4c0[_0x21c3('0xa')](_0x21c3('0xb'),attributes,{'tableName':_0x21c3('0xc'),'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 546813a..dfdf342 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 _0x7e4d=['stringify','UserOpenchannelQueue,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x130a54,_0x27c46b){var _0x1e1f1f=function(_0x5a0751){while(--_0x5a0751){_0x130a54['push'](_0x130a54['shift']());}};_0x1e1f1f(++_0x27c46b);}(_0x7e4d,0xeb));var _0xd7e4=function(_0x45dafe,_0x9ff797){_0x45dafe=_0x45dafe-0x0;var _0x5e7f7e=_0x7e4d[_0x45dafe];return _0x5e7f7e;};'use strict';var _=require(_0xd7e4('0x0'));var util=require(_0xd7e4('0x1'));var moment=require(_0xd7e4('0x2'));var BPromise=require(_0xd7e4('0x3'));var rs=require(_0xd7e4('0x4'));var fs=require('fs');var Redis=require(_0xd7e4('0x5'));var db=require(_0xd7e4('0x6'))['db'];var utils=require(_0xd7e4('0x7'));var logger=require(_0xd7e4('0x8'))(_0xd7e4('0x9'));var config=require(_0xd7e4('0xa'));var jayson=require(_0xd7e4('0xb'));var client=jayson[_0xd7e4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3809d3,_0x28ff9f,_0x434387){return new BPromise(function(_0x404b0b,_0x1a90be){return client[_0xd7e4('0xd')](_0x3809d3,_0x434387)['then'](function(_0x4209e4){logger[_0xd7e4('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x28ff9f,_0xd7e4('0xf'));logger[_0xd7e4('0x10')](_0xd7e4('0x11'),_0x28ff9f,_0xd7e4('0xf'),JSON[_0xd7e4('0x12')](_0x4209e4));if(_0x4209e4['error']){if(_0x4209e4['error']['code']===0x1f4){logger['error'](_0xd7e4('0x13'),_0x28ff9f,_0x4209e4[_0xd7e4('0x14')][_0xd7e4('0x15')]);return _0x1a90be(_0x4209e4[_0xd7e4('0x14')][_0xd7e4('0x15')]);}logger[_0xd7e4('0x14')](_0xd7e4('0x13'),_0x28ff9f,_0x4209e4[_0xd7e4('0x14')]['message']);return _0x404b0b(_0x4209e4[_0xd7e4('0x14')][_0xd7e4('0x15')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x28ff9f,_0xd7e4('0xf'));_0x404b0b(_0x4209e4[_0xd7e4('0x16')][_0xd7e4('0x15')]);}})['catch'](function(_0x2e554d){logger[_0xd7e4('0x14')](_0xd7e4('0x13'),_0x28ff9f,_0x2e554d);_0x1a90be(_0x2e554d);});});} \ No newline at end of file +var _0x0815=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x589dcd,_0x2e6d1a){var _0x261bff=function(_0x4108a8){while(--_0x4108a8){_0x589dcd['push'](_0x589dcd['shift']());}};_0x261bff(++_0x2e6d1a);}(_0x0815,0x100));var _0x5081=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0815[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5081('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5081('0x1'))['db'];var utils=require(_0x5081('0x2'));var logger=require(_0x5081('0x3'))(_0x5081('0x4'));var config=require(_0x5081('0x5'));var jayson=require(_0x5081('0x6'));var client=jayson[_0x5081('0x7')][_0x5081('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b1127,_0x33af08,_0x4edc8d){return new BPromise(function(_0x4ccd80,_0x22209e){return client[_0x5081('0x9')](_0x3b1127,_0x4edc8d)['then'](function(_0x37c4bc){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x33af08,_0x5081('0xa'));logger[_0x5081('0xb')](_0x5081('0xc'),_0x33af08,_0x5081('0xa'),JSON['stringify'](_0x37c4bc));if(_0x37c4bc['error']){if(_0x37c4bc[_0x5081('0xd')][_0x5081('0xe')]===0x1f4){logger['error'](_0x5081('0xf'),_0x33af08,_0x37c4bc['error'][_0x5081('0x10')]);return _0x22209e(_0x37c4bc['error']['message']);}logger[_0x5081('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33af08,_0x37c4bc['error'][_0x5081('0x10')]);return _0x4ccd80(_0x37c4bc[_0x5081('0xd')]['message']);}else{logger[_0x5081('0x11')](_0x5081('0xf'),_0x33af08,_0x5081('0xa'));_0x4ccd80(_0x37c4bc[_0x5081('0x12')][_0x5081('0x10')]);}})[_0x5081('0x13')](function(_0x422da6){logger['error'](_0x5081('0xf'),_0x33af08,_0x422da6);_0x22209e(_0x422da6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 2ad4167..6701fbe 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 _0x7b72=['Router','fs-extra','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','/:id','delete','removeResources','exports','multer','util','path','express'];(function(_0x498433,_0x361451){var _0xcac726=function(_0x20a4c8){while(--_0x20a4c8){_0x498433['push'](_0x498433['shift']());}};_0xcac726(++_0x361451);}(_0x7b72,0xb9));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x27b7('0x0'));var util=require(_0x27b7('0x1'));var path=require(_0x27b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x27b7('0x3'));var router=express[_0x27b7('0x4')]();var fs_extra=require(_0x27b7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x27b7('0x6'));var config=require('../../config/environment');var controller=require(_0x27b7('0x7'));router[_0x27b7('0x8')]('/',auth[_0x27b7('0x9')](),controller[_0x27b7('0xa')]);router[_0x27b7('0x8')]('/describe',auth[_0x27b7('0x9')](),controller['describe']);router[_0x27b7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x27b7('0xb')]);router['get'](_0x27b7('0xc'),auth[_0x27b7('0x9')](),controller['getSections']);router['get'](_0x27b7('0xd'),auth['isAuthenticated'](),controller[_0x27b7('0xe')]);router[_0x27b7('0xf')]('/',auth['isAuthenticated'](),controller[_0x27b7('0x10')]);router[_0x27b7('0xf')](_0x27b7('0x11'),auth[_0x27b7('0x9')](),controller[_0x27b7('0x12')]);router[_0x27b7('0xf')](_0x27b7('0xc'),auth[_0x27b7('0x9')](),controller[_0x27b7('0x13')]);router[_0x27b7('0xf')]('/:id/resources',auth[_0x27b7('0x9')](),controller[_0x27b7('0x14')]);router[_0x27b7('0x15')]('/:id',auth[_0x27b7('0x9')](),controller[_0x27b7('0x16')]);router['delete'](_0x27b7('0x17'),auth[_0x27b7('0x9')](),controller['destroy']);router[_0x27b7('0x18')]('/:id/sections',auth[_0x27b7('0x9')](),controller['removeSections']);router[_0x27b7('0x18')](_0x27b7('0xd'),auth['isAuthenticated'](),controller[_0x27b7('0x19')]);module[_0x27b7('0x1a')]=router; \ No newline at end of file +var _0x8dd6=['post','addSections','put','update','delete','destroy','removeResources','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','describe','get','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dd6,0x1b1));var _0x68dd=function(_0x3be128,_0x1eef7d){_0x3be128=_0x3be128-0x0;var _0x5e4369=_0x8dd6[_0x3be128];return _0x5e4369;};'use strict';var multer=require(_0x68dd('0x0'));var util=require(_0x68dd('0x1'));var path=require(_0x68dd('0x2'));var timeout=require('connect-timeout');var express=require(_0x68dd('0x3'));var router=express['Router']();var fs_extra=require(_0x68dd('0x4'));var auth=require(_0x68dd('0x5'));var interaction=require(_0x68dd('0x6'));var config=require(_0x68dd('0x7'));var controller=require(_0x68dd('0x8'));router['get']('/',auth[_0x68dd('0x9')](),controller['index']);router['get']('/describe',auth[_0x68dd('0x9')](),controller[_0x68dd('0xa')]);router[_0x68dd('0xb')](_0x68dd('0xc'),auth[_0x68dd('0x9')](),controller[_0x68dd('0xd')]);router[_0x68dd('0xb')](_0x68dd('0xe'),auth['isAuthenticated'](),controller[_0x68dd('0xf')]);router['get'](_0x68dd('0x10'),auth[_0x68dd('0x9')](),controller['getResources']);router['post']('/',auth[_0x68dd('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x68dd('0x9')](),controller['clone']);router[_0x68dd('0x11')](_0x68dd('0xe'),auth[_0x68dd('0x9')](),controller[_0x68dd('0x12')]);router[_0x68dd('0x11')]('/:id/resources',auth[_0x68dd('0x9')](),controller['addResources']);router[_0x68dd('0x13')](_0x68dd('0xc'),auth['isAuthenticated'](),controller[_0x68dd('0x14')]);router[_0x68dd('0x15')](_0x68dd('0xc'),auth['isAuthenticated'](),controller[_0x68dd('0x16')]);router[_0x68dd('0x15')](_0x68dd('0xe'),auth['isAuthenticated'](),controller['removeSections']);router[_0x68dd('0x15')](_0x68dd('0x10'),auth['isAuthenticated'](),controller[_0x68dd('0x17')]);module[_0x68dd('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 63b726e..ac84f6a 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 _0xb47d=['STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','name'];(function(_0x245772,_0x2c0818){var _0x1a1c3b=function(_0x4087ac){while(--_0x4087ac){_0x245772['push'](_0x245772['shift']());}};_0x1a1c3b(++_0x2c0818);}(_0xb47d,0xe8));var _0xdb47=function(_0xcee669,_0x2f96eb){_0xcee669=_0xcee669-0x0;var _0x1f0bc2=_0xb47d[_0xcee669];return _0x1f0bc2;};'use strict';var Sequelize=require(_0xdb47('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdb47('0x1')},'crudPermissions':{'type':Sequelize[_0xdb47('0x2')],'set':function(_0x3738cb){this[_0xdb47('0x3')]('crudPermissions',_0x3738cb?_0x3738cb[_0xdb47('0x4')](''):[]);},'get':function(){return this[_0xdb47('0x5')](_0xdb47('0x6'))?this[_0xdb47('0x5')](_0xdb47('0x6'))[_0xdb47('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xdb47('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xdb47('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xdb47('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xdb47('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdb47('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5f3d=['STRING','name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x19af2b,_0x274ecc){var _0x1d7b79=function(_0x37e6ab){while(--_0x37e6ab){_0x19af2b['push'](_0x19af2b['shift']());}};_0x1d7b79(++_0x274ecc);}(_0x5f3d,0x142));var _0xd5f3=function(_0x1b7ec3,_0x3affe9){_0x1b7ec3=_0x1b7ec3-0x0;var _0x388fc7=_0x5f3d[_0x1b7ec3];return _0x388fc7;};'use strict';var Sequelize=require(_0xd5f3('0x0'));module[_0xd5f3('0x1')]={'name':{'type':Sequelize[_0xd5f3('0x2')],'allowNull':![],'unique':_0xd5f3('0x3')},'crudPermissions':{'type':Sequelize[_0xd5f3('0x2')],'set':function(_0x201ada){this[_0xd5f3('0x4')](_0xd5f3('0x5'),_0x201ada?_0x201ada['join'](''):[]);},'get':function(){return this[_0xd5f3('0x6')](_0xd5f3('0x5'))?this[_0xd5f3('0x6')](_0xd5f3('0x5'))[_0xd5f3('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 5f3a94a..fd0a69a 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 _0xe820=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','UserProfile','includeAll','include','findAll','params','catch','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','sequelize','transaction','removeSections','ids','enabled','includes','subsections','findOne','forEach','push','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash'];(function(_0x1aaf79,_0x298f15){var _0x12e371=function(_0x245a49){while(--_0x245a49){_0x1aaf79['push'](_0x1aaf79['shift']());}};_0x12e371(++_0x298f15);}(_0xe820,0xd2));var _0x0e82=function(_0x2222cc,_0x2b068c){_0x2222cc=_0x2222cc-0x0;var _0x50932a=_0xe820[_0x2222cc];return _0x50932a;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];config[_0x0e82('0x18')]=_[_0x0e82('0x19')](config[_0x0e82('0x18')],{'host':_0x0e82('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e82('0x18')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x1e4ddb,_0x4b748a){_0x4b748a=_0x4b748a||0xcc;return function(_0x5b4ffd){if(_0x5b4ffd){return _0x1e4ddb['sendStatus'](_0x4b748a);}return _0x1e4ddb[_0x0e82('0x1b')](_0x4b748a)['end']();};}function respondWithResult(_0x585b9b,_0x1149b1){_0x1149b1=_0x1149b1||0xc8;return function(_0x582f45){if(_0x582f45){return _0x585b9b[_0x0e82('0x1b')](_0x1149b1)[_0x0e82('0x1c')](_0x582f45);}};}function respondWithFilteredResult(_0x233c6d,_0x315ce4){return function(_0x53622b){if(_0x53622b){var _0x25ac21=typeof _0x315ce4[_0x0e82('0x1d')]===_0x0e82('0x1e')&&typeof _0x315ce4[_0x0e82('0x1f')]===_0x0e82('0x1e');var _0x1230e6=_0x53622b[_0x0e82('0x20')];var _0x3735c0=_0x25ac21?0x0:_0x315ce4[_0x0e82('0x1d')];var _0x224455=_0x25ac21?_0x53622b[_0x0e82('0x20')]:_0x315ce4['offset']+_0x315ce4['limit'];var _0x294696;if(_0x224455>=_0x1230e6){_0x224455=_0x1230e6;_0x294696=0xc8;}else{_0x294696=0xce;}_0x233c6d[_0x0e82('0x1b')](_0x294696);return _0x233c6d[_0x0e82('0x21')](_0x0e82('0x22'),_0x3735c0+'-'+_0x224455+'/'+_0x1230e6)[_0x0e82('0x1c')](_0x53622b);}return null;};}function patchUpdates(_0x1bdad4){return function(_0x39fcbe){try{jsonpatch[_0x0e82('0x23')](_0x39fcbe,_0x1bdad4,!![]);}catch(_0x56b3ad){return BPromise[_0x0e82('0x24')](_0x56b3ad);}return _0x39fcbe[_0x0e82('0x25')]();};}function saveUpdates(_0x3d6c28,_0x24f883){return function(_0x507f08){if(_0x507f08){return _0x507f08[_0x0e82('0x26')](_0x3d6c28)[_0x0e82('0x27')](function(_0x7a9399){return _0x7a9399;});}return null;};}function removeEntity(_0x16e11c,_0x4900d3){return function(_0x1ef751){if(_0x1ef751){return _0x1ef751['destroy']()['then'](function(){_0x16e11c[_0x0e82('0x1b')](0xcc)[_0x0e82('0x28')]();});}};}function handleEntityNotFound(_0x4c5fc1,_0x19b96d){return function(_0xe3c530){if(!_0xe3c530){_0x4c5fc1[_0x0e82('0x29')](0x194);}return _0xe3c530;};}function handleError(_0x5ca9e3,_0x93d2f1){_0x93d2f1=_0x93d2f1||0x1f4;return function(_0x25fa4e){logger['error'](_0x25fa4e[_0x0e82('0x2a')]);if(_0x25fa4e['name']){delete _0x25fa4e[_0x0e82('0x2b')];}_0x5ca9e3[_0x0e82('0x1b')](_0x93d2f1)['send'](_0x25fa4e);};}exports[_0x0e82('0x2c')]=function(_0x268af5,_0x661718){var _0x4d74d0={},_0x50adb7={},_0x2dc021={'count':0x0,'rows':[]};var _0x4a8c43=_[_0x0e82('0x2d')](db['UserProfile'][_0x0e82('0x2e')],function(_0x264022){return{'name':_0x264022[_0x0e82('0x2f')],'type':_0x264022['type'][_0x0e82('0x30')]};});_0x50adb7['model']=_[_0x0e82('0x2d')](_0x4a8c43,_0x0e82('0x2b'));_0x50adb7[_0x0e82('0x31')]=_[_0x0e82('0x32')](_0x268af5[_0x0e82('0x31')]);_0x50adb7[_0x0e82('0x33')]=_['intersection'](_0x50adb7[_0x0e82('0x34')],_0x50adb7[_0x0e82('0x31')]);_0x4d74d0[_0x0e82('0x35')]=_[_0x0e82('0x36')](_0x50adb7[_0x0e82('0x34')],qs[_0x0e82('0x37')](_0x268af5[_0x0e82('0x31')][_0x0e82('0x37')]));_0x4d74d0[_0x0e82('0x35')]=_0x4d74d0[_0x0e82('0x35')][_0x0e82('0x38')]?_0x4d74d0[_0x0e82('0x35')]:_0x50adb7[_0x0e82('0x34')];if(!_0x268af5[_0x0e82('0x31')][_0x0e82('0x39')]('nolimit')){_0x4d74d0[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x268af5[_0x0e82('0x31')][_0x0e82('0x1f')]);_0x4d74d0['offset']=qs[_0x0e82('0x1d')](_0x268af5[_0x0e82('0x31')]['offset']);}_0x4d74d0[_0x0e82('0x3a')]=qs['sort'](_0x268af5['query'][_0x0e82('0x3b')]);_0x4d74d0[_0x0e82('0x3c')]=qs[_0x0e82('0x33')](_[_0x0e82('0x3d')](_0x268af5[_0x0e82('0x31')],_0x50adb7[_0x0e82('0x33')]),_0x4a8c43);if(_0x268af5[_0x0e82('0x31')]['filter']){_0x4d74d0['where']=_[_0x0e82('0x3e')](_0x4d74d0[_0x0e82('0x3c')],{'$or':_[_0x0e82('0x2d')](_0x4a8c43,function(_0x135c1b){if(_0x135c1b[_0x0e82('0x3f')]!==_0x0e82('0x40')){var _0x2abed6={};_0x2abed6[_0x135c1b[_0x0e82('0x2b')]]={'$like':'%'+_0x268af5['query'][_0x0e82('0x41')]+'%'};return _0x2abed6;}})});}_0x4d74d0=_[_0x0e82('0x3e')]({},_0x4d74d0,_0x268af5[_0x0e82('0x42')]);var _0x417389={'where':_0x4d74d0[_0x0e82('0x3c')]};return db[_0x0e82('0x43')][_0x0e82('0x20')](_0x417389)['then'](function(_0x311cb8){_0x2dc021[_0x0e82('0x20')]=_0x311cb8;if(_0x268af5[_0x0e82('0x31')][_0x0e82('0x44')]){_0x4d74d0[_0x0e82('0x45')]=[{'all':!![]}];}return db[_0x0e82('0x43')][_0x0e82('0x46')](_0x4d74d0);})['then'](function(_0x581764){_0x2dc021['rows']=_0x581764;return _0x2dc021;})['then'](respondWithFilteredResult(_0x661718,_0x4d74d0))['catch'](handleError(_0x661718,null));};exports['show']=function(_0x651c76,_0x182333){var _0x3d37e8={'raw':![],'where':{'id':_0x651c76[_0x0e82('0x47')]['id']}},_0x199495={};_0x199495[_0x0e82('0x34')]=_[_0x0e82('0x32')](db[_0x0e82('0x43')]['rawAttributes']);_0x199495['query']=_[_0x0e82('0x32')](_0x651c76[_0x0e82('0x31')]);_0x199495[_0x0e82('0x33')]=_[_0x0e82('0x36')](_0x199495[_0x0e82('0x34')],_0x199495[_0x0e82('0x31')]);_0x3d37e8[_0x0e82('0x35')]=_[_0x0e82('0x36')](_0x199495['model'],qs[_0x0e82('0x37')](_0x651c76['query'][_0x0e82('0x37')]));_0x3d37e8['attributes']=_0x3d37e8[_0x0e82('0x35')]['length']?_0x3d37e8[_0x0e82('0x35')]:_0x199495[_0x0e82('0x34')];if(_0x651c76[_0x0e82('0x31')]['includeAll']){_0x3d37e8['include']=[{'all':!![]}];}_0x3d37e8=_[_0x0e82('0x3e')]({},_0x3d37e8,_0x651c76[_0x0e82('0x42')]);return db[_0x0e82('0x43')]['find'](_0x3d37e8)[_0x0e82('0x27')](handleEntityNotFound(_0x182333,null))['then'](respondWithResult(_0x182333,null))[_0x0e82('0x48')](handleError(_0x182333,null));};exports[_0x0e82('0x49')]=function(_0x162890,_0x64406e){return db[_0x0e82('0x43')][_0x0e82('0x49')](_0x162890[_0x0e82('0x4a')],{})[_0x0e82('0x27')](respondWithResult(_0x64406e,0xc9))[_0x0e82('0x48')](handleError(_0x64406e,null));};exports[_0x0e82('0x4b')]=function(_0x41e27e,_0x22c249){var _0x4e9030={'where':{'id':_0x41e27e[_0x0e82('0x47')]['id']}},_0xf29232={};_0xf29232['model']=_[_0x0e82('0x32')](db['UserProfile']['rawAttributes']);_0x4e9030[_0x0e82('0x35')]=_['intersection'](_0xf29232[_0x0e82('0x34')],qs[_0x0e82('0x37')](_0x41e27e[_0x0e82('0x31')][_0x0e82('0x37')]));_0x4e9030[_0x0e82('0x35')]=_0x4e9030['attributes'][_0x0e82('0x38')]?_0x4e9030['attributes']:_0xf29232[_0x0e82('0x34')];if(_0x41e27e[_0x0e82('0x31')][_0x0e82('0x44')]){_0x4e9030[_0x0e82('0x45')]=[{'all':!![]}];}_0x4e9030=_[_0x0e82('0x3e')]({},_0x4e9030,_0x41e27e['options']);return db[_0x0e82('0x43')][_0x0e82('0x4c')](_0x4e9030)[_0x0e82('0x27')](handleEntityNotFound(_0x22c249,null))[_0x0e82('0x27')](function(_0x31b62f){if(_0x31b62f){var _0x53aaa5=_0x31b62f[_0x0e82('0x4d')]({'plain':!![]});_0x53aaa5=qs[_0x0e82('0x4e')](_0x53aaa5,['id',_0x0e82('0x4f'),_0x0e82('0x50'),_0x0e82('0x51')]);_0x41e27e[_0x0e82('0x4a')]=_[_0x0e82('0x4e')](_0x41e27e[_0x0e82('0x4a')],['id',_0x0e82('0x4f'),_0x0e82('0x50')]);return db['sequelize']['transaction'](function(_0x5ba392){return db[_0x0e82('0x43')]['create'](_[_0x0e82('0x3e')](_0x53aaa5,_0x41e27e[_0x0e82('0x4a')]),{'include':_0x41e27e['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5ba392})[_0x0e82('0x27')](function(_0xbca0e4){var _0x3e58cf=_0xbca0e4[_0x0e82('0x4d')]({'plain':!![]});return db[_0x0e82('0x52')][_0x0e82('0x46')]({'where':{'userProfileId':_0x41e27e[_0x0e82('0x47')]['id']},'raw':!![]})[_0x0e82('0x27')](function(_0xc1648){if(_0xc1648){return BPromise[_0x0e82('0x53')](_0xc1648,function(_0x4ce423){return new BPromise(function(_0x30e9f1,_0x21aaac){if(_0x4ce423[_0x0e82('0x54')]===null||_0x4ce423[_0x0e82('0x54')]===0x1)_0x30e9f1(null);return db[_0x0e82('0x55')][_0x0e82('0x46')]({'where':{'sectionId':_0x4ce423['id']},'raw':!![]})[_0x0e82('0x27')](function(_0x1a3110){var _0x5aab5a=_[_0x0e82('0x2d')](_0x1a3110,function(_0x3c7e1a){return qs[_0x0e82('0x4e')](_0x3c7e1a,['id',_0x0e82('0x4f'),_0x0e82('0x50'),_0x0e82('0x56')]);});_0x30e9f1(_0x5aab5a);})[_0x0e82('0x48')](function(_0x11ef9e){_0x21aaac(_0x11ef9e);});})[_0x0e82('0x27')](function(_0x4df351){var _0x3cc8f9=qs['omit'](_0x4ce423,['id',_0x0e82('0x4f'),'updatedAt']);_0x3cc8f9[_0x0e82('0x57')]=_0x3e58cf['id'];if(_0x4df351)_0x3cc8f9[_0x0e82('0x58')]=_0x4df351;return _0x3cc8f9;})['then'](function(_0x30e0a3){return db[_0x0e82('0x52')][_0x0e82('0x49')](_0x30e0a3,{'include':[{'model':db[_0x0e82('0x55')],'as':_0x0e82('0x58')}],'raw':!![],'transaction':_0x5ba392});});})['then'](function(){return _0x3e58cf;});}});});});}})[_0x0e82('0x27')](respondWithResult(_0x22c249,0xc9))['catch'](handleError(_0x22c249,null));};exports['update']=function(_0x17c402,_0x2cf29f){if(_0x17c402[_0x0e82('0x4a')]['id']){delete _0x17c402[_0x0e82('0x4a')]['id'];}return db[_0x0e82('0x43')][_0x0e82('0x4c')]({'where':{'id':_0x17c402[_0x0e82('0x47')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x2cf29f,null))[_0x0e82('0x27')](saveUpdates(_0x17c402[_0x0e82('0x4a')],null))['then'](respondWithResult(_0x2cf29f,null))['catch'](handleError(_0x2cf29f,null));};exports[_0x0e82('0x59')]=function(_0x5c461b,_0x469b9e){return db[_0x0e82('0x43')]['find']({'where':{'id':_0x5c461b[_0x0e82('0x47')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x469b9e,null))['then'](removeEntity(_0x469b9e,null))[_0x0e82('0x48')](handleError(_0x469b9e,null));};exports[_0x0e82('0x5a')]=function(_0x4c7d71,_0x3cf127){return db['UserProfile'][_0x0e82('0x5a')]()[_0x0e82('0x27')](respondWithResult(_0x3cf127,null))[_0x0e82('0x48')](handleError(_0x3cf127,null));};exports[_0x0e82('0x5b')]=function(_0x34faf5,_0x75a64d){var _0x1091af=_0x34faf5[_0x0e82('0x4a')];return db[_0x0e82('0x43')][_0x0e82('0x4c')]({'where':{'id':_0x34faf5['params']['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x75a64d,null))['then'](function(_0x131698){if(_0x131698){return db[_0x0e82('0x5c')][_0x0e82('0x5d')](function(_0x4891e7){return db[_0x0e82('0x52')][_0x0e82('0x59')]({'where':{'userProfileId':_0x34faf5[_0x0e82('0x47')]['id'],'sectionId':_[_0x0e82('0x2d')](_0x1091af,function(_0x1a67bc){return _0x1a67bc['sectionId'];})},'transaction':_0x4891e7})[_0x0e82('0x27')](function(){var _0x5e7655=_[_0x0e82('0x2d')](_0x1091af,function(_0x3b028b){_0x3b028b['userProfileId']=_0x34faf5['params']['id'];return _0x3b028b;});var _0x16e719=[];return BPromise[_0x0e82('0x53')](_0x5e7655,function(_0x1b2b8c){return db[_0x0e82('0x52')][_0x0e82('0x49')](_0x1b2b8c,{'include':[{'model':db[_0x0e82('0x55')],'as':_0x0e82('0x58')}],'raw':!![],'transaction':_0x4891e7})[_0x0e82('0x27')](function(_0x3cac74){_0x16e719['push'](_0x3cac74[_0x0e82('0x4d')]({'plain':!![]}));});})[_0x0e82('0x27')](function(){return _0x16e719;});});});}})['then'](function(_0x4e34ba){return _0x4e34ba;})['then'](respondWithResult(_0x75a64d,null))[_0x0e82('0x48')](handleError(_0x75a64d,null));};exports[_0x0e82('0x5e')]=function(_0x28ec5,_0x542b28){var _0x3dd6ab;return db['UserProfile'][_0x0e82('0x4c')]({'where':{'id':_0x28ec5[_0x0e82('0x47')]['id']},'attributes':['id',_0x0e82('0x2b')]})[_0x0e82('0x27')](handleEntityNotFound(_0x542b28,null))[_0x0e82('0x27')](function(_0x48ac18){if(_0x48ac18){_0x3dd6ab=_0x48ac18;return db[_0x0e82('0x52')][_0x0e82('0x59')]({'where':{'userProfileId':_0x28ec5['params']['id'],'sectionId':_0x28ec5[_0x0e82('0x31')][_0x0e82('0x5f')]}});}})[_0x0e82('0x27')](function(){return _0x3dd6ab;})['then'](respondWithStatusCode(_0x542b28,null))[_0x0e82('0x48')](handleError(_0x542b28,null));};exports['getSections']=function(_0x349038,_0xd87b95){var _0x36d95a=[];var _0x5ca20d=[];return db[_0x0e82('0x52')][_0x0e82('0x46')]({'where':{'userProfileId':_0x349038[_0x0e82('0x47')]['id']},'raw':!![]})[_0x0e82('0x27')](function(_0x4a1e4d){_0x36d95a=_[_0x0e82('0x41')](_0x4a1e4d,function(_0x3a004d){return _0x3a004d[_0x0e82('0x60')]===0x1||_[_0x0e82('0x61')]([0x3eb,0x709],_0x3a004d[_0x0e82('0x56')]);});if(!_['isEmpty'](_0x36d95a)){return _[_0x0e82('0x2d')](_0x36d95a,function(_0x4fadaa){return _0x4fadaa[_0x0e82('0x56')];});}else{return;}})['then'](function(_0x40e10c){if(_0x40e10c)_0x5ca20d=_0x40e10c;if(_[_0x0e82('0x61')](_0x5ca20d,0x64)){var _0x5d8c32=_[_0x0e82('0x4c')](_0x36d95a,{'sectionId':0x64});return hasDefaultDashboard(_0x5d8c32)[_0x0e82('0x27')](function(_0x354da6){return _['map'](_0x36d95a,function(_0x5777c2){if(_0x5777c2['sectionId']===0x64){_0x5777c2[_0x0e82('0x62')]=_0x354da6;}return _0x5777c2;});});}else{return;}})[_0x0e82('0x27')](function(_0x2c7f9a){if(_0x2c7f9a)_0x36d95a=_0x2c7f9a;if(_['includes'](_0x5ca20d,0x3eb)){var _0x9dc5ff=_[_0x0e82('0x4c')](_0x36d95a,{'sectionId':0x3eb});return getCustomDashboards(_0x9dc5ff)[_0x0e82('0x27')](function(_0x28378b){return _[_0x0e82('0x2d')](_0x36d95a,function(_0x27928f){if(_0x9dc5ff[_0x0e82('0x60')]){if(_0x27928f[_0x0e82('0x56')]===0x3eb){_0x27928f['subsections']=_0x28378b;}}else{if(_0x27928f[_0x0e82('0x56')]===0x64){_0x27928f[_0x0e82('0x62')]=_0x28378b;}}return _0x27928f;});});}else{return;}})[_0x0e82('0x27')](function(_0x1ee1dd){if(_0x1ee1dd)_0x36d95a=_0x1ee1dd;if(_[_0x0e82('0x61')](_0x5ca20d,0x709)){var _0x36b423=_[_0x0e82('0x4c')](_0x36d95a,{'sectionId':0x709});return getPlugins(_0x36b423)[_0x0e82('0x27')](function(_0x5d09b2){if(_0x36b423[_0x0e82('0x60')]){return _['map'](_0x36d95a,function(_0x4a9876){if(_0x4a9876['sectionId']===0x709){_0x4a9876[_0x0e82('0x62')]=_0x5d09b2;}return _0x4a9876;});}else{var _0xdd6323={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5d09b2};var _0x3fc898=_[_0x0e82('0x2d')](_0x36d95a);_0x3fc898['push'](_0xdd6323);return _0x3fc898;}});}else{return;}})[_0x0e82('0x27')](function(_0x5a82df){if(_0x5a82df)_0x36d95a=_0x5a82df;return _[_0x0e82('0x41')](_0x36d95a,[_0x0e82('0x60'),0x1]);})['then'](respondWithResult(_0xd87b95,null))[_0x0e82('0x48')](handleError(_0xd87b95,null));};function hasDefaultDashboard(_0x53a5d5){var _0x4da7ab=[0x65];return new BPromise(function(_0x726b92,_0x473c5a){try{if(_0x53a5d5['autoAssociation']){_0x726b92(_0x4da7ab);}else{return db['UserProfileResource'][_0x0e82('0x63')]({'where':{'sectionId':_0x53a5d5['id']},'raw':!![]})[_0x0e82('0x27')](function(_0x154a14){_0x154a14?_0x726b92(_0x4da7ab):_0x726b92();});}}catch(_0x4027cb){_0x473c5a(_0x4027cb);}});}function getCustomDashboards(_0x11bdeb){var _0x3fb407=[];return new BPromise(function(_0xb579bc,_0xccc800){try{if(_0x11bdeb['autoAssociation']){return db['Dashboard'][_0x0e82('0x46')]({'raw':!![]})[_0x0e82('0x27')](function(_0x4345d3){_0x4345d3[_0x0e82('0x64')](function(_0x39edc1){_0x3fb407[_0x0e82('0x65')](_0x39edc1['id']+0x1869f);});_0xb579bc(_0x3fb407);});}else{return db[_0x0e82('0x55')]['findAll']({'where':{'sectionId':_0x11bdeb['id']},'raw':!![]})[_0x0e82('0x27')](function(_0x520d49){_0x520d49['forEach'](function(_0x3bb2b3){_0x3fb407['push'](_0x3bb2b3[_0x0e82('0x66')]+0x1869f);});_0xb579bc(_0x3fb407);});}}catch(_0x2ca1e2){_0xccc800(_0x2ca1e2);}});}function getPlugins(_0x4c0e0c){var _0x427aee=[];return new BPromise(function(_0x3c6340,_0x29129a){try{if(_0x4c0e0c[_0x0e82('0x54')]){return db[_0x0e82('0x67')][_0x0e82('0x46')]({'raw':!![]})[_0x0e82('0x27')](function(_0x5a3b88){_0x5a3b88[_0x0e82('0x64')](function(_0x55a7a4){_0x427aee['push'](_0x55a7a4['id']+0x15b38);});_0x3c6340(_0x427aee);});}else{return db['UserProfileResource'][_0x0e82('0x46')]({'where':{'sectionId':_0x4c0e0c['id']},'raw':!![]})[_0x0e82('0x27')](function(_0x3bb220){_0x3bb220[_0x0e82('0x64')](function(_0xc6def3){_0x427aee[_0x0e82('0x65')](_0xc6def3['resourceId']+0x15b38);});_0x3c6340(_0x427aee);});}}catch(_0x890f08){_0x29129a(_0x890f08);}});}exports['addResources']=function(_0x5f59f1,_0x48bd88){return db[_0x0e82('0x43')]['find']({'where':{'id':_0x5f59f1['params']['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x48bd88,null))[_0x0e82('0x27')](function(_0x4d8b98){if(_0x4d8b98){return db[_0x0e82('0x5c')][_0x0e82('0x5d')](function(_0x4d1ea3){return db[_0x0e82('0x52')][_0x0e82('0x46')]({'where':{'userProfileId':_0x5f59f1[_0x0e82('0x47')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x408886){if(_0x408886){return db[_0x0e82('0x52')]['destroy']({'where':{'userProfileId':_0x5f59f1[_0x0e82('0x47')]['id'],'id':_[_0x0e82('0x2d')](_0x408886,function(_0x4eee13){return _0x4eee13['id'];})},'transaction':_0x4d1ea3});}})[_0x0e82('0x27')](function(_0x17a608){var _0x5b68bb=_[_0x0e82('0x2d')](_0x5f59f1[_0x0e82('0x4a')],function(_0x15910c){_0x15910c[_0x0e82('0x57')]=_0x5f59f1['params']['id'];return _0x15910c;});return db['UserProfileSection'][_0x0e82('0x68')](_0x5b68bb,{'raw':!![],'transaction':_0x4d1ea3});})[_0x0e82('0x27')](function(_0x447250){var _0x2b09fb=_[_0x0e82('0x41')](_[_0x0e82('0x2d')](_0x447250,function(_0x3d1b8a){return _0x3d1b8a[_0x0e82('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x2b09fb){return db[_0x0e82('0x52')]['findAll']({'where':{'userProfileId':_0x5f59f1[_0x0e82('0x47')]['id'],'sectionId':_[_0x0e82('0x2d')](_0x2b09fb,function(_0x34c912){return _0x34c912[_0x0e82('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x0e82('0x27')](function(_0x3a9746){var _0x51b943=_[_0x0e82('0x2d')](_0x5f59f1[_0x0e82('0x4a')],function(_0x342f54){_0x342f54[_0x0e82('0x57')]=_0x5f59f1[_0x0e82('0x47')]['id'];return _0x342f54;});return db[_0x0e82('0x55')]['bulkCreate'](_0x51b943,{'raw':!![],'transaction':_0x4d1ea3});});}})[_0x0e82('0x48')](handleError(_0x48bd88,null));});}})['then'](function(_0x962792){var _0x7d4f=_[_0x0e82('0x2d')](_0x962792,function(_0x23d60f){return _0x23d60f[_0x0e82('0x4d')]({'plain':!![]});});})[_0x0e82('0x27')](respondWithResult(_0x48bd88,null))[_0x0e82('0x48')](handleError(_0x48bd88,null));};exports[_0x0e82('0x69')]=function(_0x52bbcb,_0x346938,_0x16c9ae){return db[_0x0e82('0x43')]['find']({'where':{'id':_0x52bbcb[_0x0e82('0x47')]['id']}})['then'](handleEntityNotFound(_0x346938,null))[_0x0e82('0x27')](function(_0x50d0de){if(_0x50d0de){return _0x50d0de[_0x0e82('0x69')](_0x52bbcb[_0x0e82('0x31')][_0x0e82('0x5f')]);}})['then'](respondWithStatusCode(_0x346938,null))[_0x0e82('0x48')](handleError(_0x346938,null));};exports[_0x0e82('0x6a')]=function(_0xae4be5,_0x1fc939){var _0x52397d={};if(!_0xae4be5[_0x0e82('0x31')][_0x0e82('0x6b')])throw new Error(_0x0e82('0x6c'));if(!_0xae4be5[_0x0e82('0x31')][_0x0e82('0x39')]('nolimit')){_0x52397d[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0xae4be5[_0x0e82('0x31')][_0x0e82('0x1f')]);_0x52397d[_0x0e82('0x1d')]=qs['offset'](_0xae4be5['query'][_0x0e82('0x1d')]);}return db[_0x0e82('0x43')]['find']({'where':{'id':_0xae4be5['params']['id']}})[_0x0e82('0x27')](function(_0x226726){if(!_0x226726)throw new Error(_0x0e82('0x6d')+_0xae4be5[_0x0e82('0x47')]['id']);return db[_0x0e82('0x43')][_0x0e82('0x6a')](_0xae4be5);})['then'](respondWithFilteredResult(_0x1fc939,_0x52397d))[_0x0e82('0x48')](handleError(_0x1fc939,null));}; \ No newline at end of file +var _0x9e6d=['Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','addSections','each','push','removeSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section'];(function(_0xc3a3cb,_0xa6d008){var _0x536d7a=function(_0x21e6b9){while(--_0x21e6b9){_0xc3a3cb['push'](_0xc3a3cb['shift']());}};_0x536d7a(++_0xa6d008);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x3047d7,_0x4f67f9){_0x3047d7=_0x3047d7-0x0;var _0xc173cc=_0x9e6d[_0x3047d7];return _0xc173cc;};'use strict';var emlformat=require(_0xd9e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd9e6('0x1'));var jsonpatch=require(_0xd9e6('0x2'));var rp=require(_0xd9e6('0x3'));var moment=require('moment');var BPromise=require(_0xd9e6('0x4'));var Mustache=require(_0xd9e6('0x5'));var util=require(_0xd9e6('0x6'));var path=require(_0xd9e6('0x7'));var sox=require('sox');var csv=require(_0xd9e6('0x8'));var ejs=require(_0xd9e6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9e6('0xa'));var crypto=require(_0xd9e6('0xb'));var jsforce=require(_0xd9e6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9e6('0x8'));var querystring=require(_0xd9e6('0xd'));var Papa=require('papaparse');var Redis=require(_0xd9e6('0xe'));var authService=require(_0xd9e6('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9e6('0x10'));var logger=require(_0xd9e6('0x11'))(_0xd9e6('0x12'));var utils=require(_0xd9e6('0x13'));var config=require(_0xd9e6('0x14'));var licenseUtil=require(_0xd9e6('0x15'));var db=require(_0xd9e6('0x16'))['db'];config[_0xd9e6('0x17')]=_[_0xd9e6('0x18')](config['redis'],{'host':_0xd9e6('0x19'),'port':0x18eb});var socket=require(_0xd9e6('0x1a'))(new Redis(config['redis']));require('./userProfile.socket')[_0xd9e6('0x1b')](socket);function respondWithStatusCode(_0x5a9940,_0x3c69bb){_0x3c69bb=_0x3c69bb||0xcc;return function(_0x1b3e86){if(_0x1b3e86){return _0x5a9940[_0xd9e6('0x1c')](_0x3c69bb);}return _0x5a9940[_0xd9e6('0x1d')](_0x3c69bb)[_0xd9e6('0x1e')]();};}function respondWithResult(_0x4eb591,_0x5ddd5a){_0x5ddd5a=_0x5ddd5a||0xc8;return function(_0x10d104){if(_0x10d104){return _0x4eb591['status'](_0x5ddd5a)[_0xd9e6('0x1f')](_0x10d104);}};}function respondWithFilteredResult(_0x232770,_0xbe657c){return function(_0x2db831){if(_0x2db831){var _0xe30afc=typeof _0xbe657c[_0xd9e6('0x20')]===_0xd9e6('0x21')&&typeof _0xbe657c[_0xd9e6('0x22')]===_0xd9e6('0x21');var _0x2604a0=_0x2db831['count'];var _0x4eb9b0=_0xe30afc?0x0:_0xbe657c[_0xd9e6('0x20')];var _0x1063b4=_0xe30afc?_0x2db831[_0xd9e6('0x23')]:_0xbe657c['offset']+_0xbe657c[_0xd9e6('0x22')];var _0x106026;if(_0x1063b4>=_0x2604a0){_0x1063b4=_0x2604a0;_0x106026=0xc8;}else{_0x106026=0xce;}_0x232770[_0xd9e6('0x1d')](_0x106026);return _0x232770[_0xd9e6('0x24')]('Content-Range',_0x4eb9b0+'-'+_0x1063b4+'/'+_0x2604a0)['json'](_0x2db831);}return null;};}function patchUpdates(_0x162e67){return function(_0x3ada59){try{jsonpatch[_0xd9e6('0x25')](_0x3ada59,_0x162e67,!![]);}catch(_0x5dc0bd){return BPromise[_0xd9e6('0x26')](_0x5dc0bd);}return _0x3ada59[_0xd9e6('0x27')]();};}function saveUpdates(_0x2393b9,_0xdfd442){return function(_0x1cebad){if(_0x1cebad){return _0x1cebad[_0xd9e6('0x28')](_0x2393b9)[_0xd9e6('0x29')](function(_0x5e2eef){return _0x5e2eef;});}return null;};}function removeEntity(_0x3a8c62,_0x3b17f9){return function(_0x33b7af){if(_0x33b7af){return _0x33b7af[_0xd9e6('0x2a')]()[_0xd9e6('0x29')](function(){_0x3a8c62[_0xd9e6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e6de,_0xa32093){return function(_0x38df16){if(!_0x38df16){_0x32e6de[_0xd9e6('0x1c')](0x194);}return _0x38df16;};}function handleError(_0x3708a2,_0x2f815e){_0x2f815e=_0x2f815e||0x1f4;return function(_0x105831){logger[_0xd9e6('0x2b')](_0x105831[_0xd9e6('0x2c')]);if(_0x105831[_0xd9e6('0x2d')]){delete _0x105831[_0xd9e6('0x2d')];}_0x3708a2[_0xd9e6('0x1d')](_0x2f815e)[_0xd9e6('0x2e')](_0x105831);};}exports[_0xd9e6('0x2f')]=function(_0x5367c9,_0x339d5f){var _0x138473={},_0x45a52c={},_0x468052={'count':0x0,'rows':[]};var _0x436a48=_[_0xd9e6('0x30')](db[_0xd9e6('0x31')][_0xd9e6('0x32')],function(_0x53689c){return{'name':_0x53689c[_0xd9e6('0x33')],'type':_0x53689c[_0xd9e6('0x34')][_0xd9e6('0x35')]};});_0x45a52c['model']=_[_0xd9e6('0x30')](_0x436a48,'name');_0x45a52c[_0xd9e6('0x36')]=_[_0xd9e6('0x37')](_0x5367c9['query']);_0x45a52c['filters']=_[_0xd9e6('0x38')](_0x45a52c[_0xd9e6('0x39')],_0x45a52c['query']);_0x138473[_0xd9e6('0x3a')]=_['intersection'](_0x45a52c[_0xd9e6('0x39')],qs[_0xd9e6('0x3b')](_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x138473[_0xd9e6('0x3a')]=_0x138473[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x138473[_0xd9e6('0x3a')]:_0x45a52c['model'];if(!_0x5367c9['query'][_0xd9e6('0x3d')](_0xd9e6('0x3e'))){_0x138473[_0xd9e6('0x22')]=qs[_0xd9e6('0x22')](_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x22')]);_0x138473[_0xd9e6('0x20')]=qs[_0xd9e6('0x20')](_0x5367c9['query'][_0xd9e6('0x20')]);}_0x138473[_0xd9e6('0x3f')]=qs[_0xd9e6('0x40')](_0x5367c9['query'][_0xd9e6('0x40')]);_0x138473[_0xd9e6('0x41')]=qs[_0xd9e6('0x42')](_[_0xd9e6('0x43')](_0x5367c9[_0xd9e6('0x36')],_0x45a52c[_0xd9e6('0x42')]),_0x436a48);if(_0x5367c9[_0xd9e6('0x36')]['filter']){_0x138473['where']=_['merge'](_0x138473[_0xd9e6('0x41')],{'$or':_['map'](_0x436a48,function(_0x56b0a5){if(_0x56b0a5[_0xd9e6('0x34')]!==_0xd9e6('0x44')){var _0x44b173={};_0x44b173[_0x56b0a5['name']]={'$like':'%'+_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x45')]+'%'};return _0x44b173;}})});}_0x138473=_[_0xd9e6('0x46')]({},_0x138473,_0x5367c9['options']);var _0x27bce0={'where':_0x138473[_0xd9e6('0x41')]};return db[_0xd9e6('0x31')][_0xd9e6('0x23')](_0x27bce0)[_0xd9e6('0x29')](function(_0x4b874e){_0x468052[_0xd9e6('0x23')]=_0x4b874e;if(_0x5367c9['query']['includeAll']){_0x138473['include']=[{'all':!![]}];}return db[_0xd9e6('0x31')][_0xd9e6('0x47')](_0x138473);})['then'](function(_0x2e3fa8){_0x468052[_0xd9e6('0x48')]=_0x2e3fa8;return _0x468052;})[_0xd9e6('0x29')](respondWithFilteredResult(_0x339d5f,_0x138473))[_0xd9e6('0x49')](handleError(_0x339d5f,null));};exports[_0xd9e6('0x4a')]=function(_0xb60bc4,_0x3935a6){var _0x1c6641={'raw':![],'where':{'id':_0xb60bc4[_0xd9e6('0x4b')]['id']}},_0x57ddee={};_0x57ddee[_0xd9e6('0x39')]=_[_0xd9e6('0x37')](db[_0xd9e6('0x31')][_0xd9e6('0x32')]);_0x57ddee[_0xd9e6('0x36')]=_[_0xd9e6('0x37')](_0xb60bc4[_0xd9e6('0x36')]);_0x57ddee[_0xd9e6('0x42')]=_['intersection'](_0x57ddee[_0xd9e6('0x39')],_0x57ddee[_0xd9e6('0x36')]);_0x1c6641[_0xd9e6('0x3a')]=_[_0xd9e6('0x38')](_0x57ddee[_0xd9e6('0x39')],qs[_0xd9e6('0x3b')](_0xb60bc4[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x1c6641['attributes']=_0x1c6641[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x1c6641[_0xd9e6('0x3a')]:_0x57ddee[_0xd9e6('0x39')];if(_0xb60bc4[_0xd9e6('0x36')][_0xd9e6('0x4c')]){_0x1c6641[_0xd9e6('0x4d')]=[{'all':!![]}];}_0x1c6641=_[_0xd9e6('0x46')]({},_0x1c6641,_0xb60bc4[_0xd9e6('0x4e')]);return db['UserProfile'][_0xd9e6('0x4f')](_0x1c6641)[_0xd9e6('0x29')](handleEntityNotFound(_0x3935a6,null))[_0xd9e6('0x29')](respondWithResult(_0x3935a6,null))['catch'](handleError(_0x3935a6,null));};exports[_0xd9e6('0x50')]=function(_0x324fe8,_0x14719a){return db[_0xd9e6('0x31')][_0xd9e6('0x50')](_0x324fe8[_0xd9e6('0x51')],{})[_0xd9e6('0x29')](respondWithResult(_0x14719a,0xc9))[_0xd9e6('0x49')](handleError(_0x14719a,null));};exports[_0xd9e6('0x52')]=function(_0x20a822,_0x289407){var _0x550796={'where':{'id':_0x20a822[_0xd9e6('0x4b')]['id']}},_0x4aea71={};_0x4aea71[_0xd9e6('0x39')]=_[_0xd9e6('0x37')](db[_0xd9e6('0x31')][_0xd9e6('0x32')]);_0x550796[_0xd9e6('0x3a')]=_['intersection'](_0x4aea71[_0xd9e6('0x39')],qs['fields'](_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x550796[_0xd9e6('0x3a')]=_0x550796[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x550796['attributes']:_0x4aea71['model'];if(_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x4c')]){_0x550796['include']=[{'all':!![]}];}_0x550796=_[_0xd9e6('0x46')]({},_0x550796,_0x20a822[_0xd9e6('0x4e')]);return db[_0xd9e6('0x31')][_0xd9e6('0x4f')](_0x550796)['then'](handleEntityNotFound(_0x289407,null))[_0xd9e6('0x29')](function(_0x5f16d5){if(_0x5f16d5){var _0x1e08f8=_0x5f16d5[_0xd9e6('0x53')]({'plain':!![]});_0x1e08f8=qs[_0xd9e6('0x54')](_0x1e08f8,['id',_0xd9e6('0x55'),_0xd9e6('0x56'),_0xd9e6('0x57')]);_0x20a822[_0xd9e6('0x51')]=_[_0xd9e6('0x54')](_0x20a822[_0xd9e6('0x51')],['id',_0xd9e6('0x55'),_0xd9e6('0x56')]);return db[_0xd9e6('0x58')][_0xd9e6('0x59')](function(_0x47df54){return db[_0xd9e6('0x31')][_0xd9e6('0x50')](_['merge'](_0x1e08f8,_0x20a822[_0xd9e6('0x51')]),{'include':_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x47df54})['then'](function(_0x254b8f){var _0x5d2472=_0x254b8f[_0xd9e6('0x53')]({'plain':!![]});return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x20a822[_0xd9e6('0x4b')]['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x4e642a){if(_0x4e642a){return BPromise['each'](_0x4e642a,function(_0x4865b2){return new BPromise(function(_0x5cde8b,_0xb58033){if(_0x4865b2[_0xd9e6('0x5a')]===null||_0x4865b2['autoAssociation']===0x1)_0x5cde8b(null);return db['UserProfileResource'][_0xd9e6('0x47')]({'where':{'sectionId':_0x4865b2['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x63cb6){var _0x22bb73=_[_0xd9e6('0x30')](_0x63cb6,function(_0x47b709){return qs[_0xd9e6('0x54')](_0x47b709,['id',_0xd9e6('0x55'),_0xd9e6('0x56'),_0xd9e6('0x5b')]);});_0x5cde8b(_0x22bb73);})[_0xd9e6('0x49')](function(_0x4e8620){_0xb58033(_0x4e8620);});})['then'](function(_0x1203de){var _0x17ef8e=qs[_0xd9e6('0x54')](_0x4865b2,['id',_0xd9e6('0x55'),_0xd9e6('0x56')]);_0x17ef8e[_0xd9e6('0x5c')]=_0x5d2472['id'];if(_0x1203de)_0x17ef8e[_0xd9e6('0x5d')]=_0x1203de;return _0x17ef8e;})[_0xd9e6('0x29')](function(_0x24d58d){return db[_0xd9e6('0x5e')][_0xd9e6('0x50')](_0x24d58d,{'include':[{'model':db[_0xd9e6('0x5f')],'as':'Resources'}],'raw':!![],'transaction':_0x47df54});});})[_0xd9e6('0x29')](function(){return _0x5d2472;});}});});});}})[_0xd9e6('0x29')](respondWithResult(_0x289407,0xc9))[_0xd9e6('0x49')](handleError(_0x289407,null));};exports[_0xd9e6('0x28')]=function(_0x2e4352,_0x7a6900){if(_0x2e4352[_0xd9e6('0x51')]['id']){delete _0x2e4352[_0xd9e6('0x51')]['id'];}return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x2e4352[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x7a6900,null))[_0xd9e6('0x29')](saveUpdates(_0x2e4352[_0xd9e6('0x51')],null))[_0xd9e6('0x29')](respondWithResult(_0x7a6900,null))[_0xd9e6('0x49')](handleError(_0x7a6900,null));};exports[_0xd9e6('0x2a')]=function(_0x37dfe2,_0x51e765){return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x37dfe2[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x51e765,null))['then'](removeEntity(_0x51e765,null))[_0xd9e6('0x49')](handleError(_0x51e765,null));};exports[_0xd9e6('0x60')]=function(_0x2dc460,_0x224c8a){return db['UserProfile'][_0xd9e6('0x60')]()[_0xd9e6('0x29')](respondWithResult(_0x224c8a,null))[_0xd9e6('0x49')](handleError(_0x224c8a,null));};exports[_0xd9e6('0x61')]=function(_0x384c9b,_0x5438e1){var _0x2294e2=_0x384c9b[_0xd9e6('0x51')];return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x384c9b[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x5438e1,null))[_0xd9e6('0x29')](function(_0x99e2c6){if(_0x99e2c6){return db[_0xd9e6('0x58')]['transaction'](function(_0x11382c){return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x384c9b[_0xd9e6('0x4b')]['id'],'sectionId':_[_0xd9e6('0x30')](_0x2294e2,function(_0x24c143){return _0x24c143[_0xd9e6('0x5b')];})},'transaction':_0x11382c})[_0xd9e6('0x29')](function(){var _0x5cca00=_['map'](_0x2294e2,function(_0x3d4b19){_0x3d4b19['userProfileId']=_0x384c9b['params']['id'];return _0x3d4b19;});var _0x2c0ed0=[];return BPromise[_0xd9e6('0x62')](_0x5cca00,function(_0x11c1d2){return db[_0xd9e6('0x5e')][_0xd9e6('0x50')](_0x11c1d2,{'include':[{'model':db['UserProfileResource'],'as':_0xd9e6('0x5d')}],'raw':!![],'transaction':_0x11382c})['then'](function(_0x36e4e6){_0x2c0ed0[_0xd9e6('0x63')](_0x36e4e6[_0xd9e6('0x53')]({'plain':!![]}));});})[_0xd9e6('0x29')](function(){return _0x2c0ed0;});});});}})[_0xd9e6('0x29')](function(_0x4f11b4){return _0x4f11b4;})[_0xd9e6('0x29')](respondWithResult(_0x5438e1,null))[_0xd9e6('0x49')](handleError(_0x5438e1,null));};exports[_0xd9e6('0x64')]=function(_0x2246f1,_0x3c39a0){var _0x2c642f;return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x2246f1['params']['id']},'attributes':['id',_0xd9e6('0x2d')]})[_0xd9e6('0x29')](handleEntityNotFound(_0x3c39a0,null))[_0xd9e6('0x29')](function(_0x127e1c){if(_0x127e1c){_0x2c642f=_0x127e1c;return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x2246f1['params']['id'],'sectionId':_0x2246f1[_0xd9e6('0x36')]['ids']}});}})['then'](function(){return _0x2c642f;})[_0xd9e6('0x29')](respondWithStatusCode(_0x3c39a0,null))[_0xd9e6('0x49')](handleError(_0x3c39a0,null));};exports['getSections']=function(_0x469fec,_0x57f35b){var _0x1a4308=[];var _0x4e08d1=[];return db[_0xd9e6('0x5e')][_0xd9e6('0x47')]({'where':{'userProfileId':_0x469fec[_0xd9e6('0x4b')]['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x5c8337){_0x1a4308=_['filter'](_0x5c8337,function(_0x59f6e9){return _0x59f6e9[_0xd9e6('0x65')]===0x1||_[_0xd9e6('0x66')]([0x3eb,0x709],_0x59f6e9[_0xd9e6('0x5b')]);});if(!_[_0xd9e6('0x67')](_0x1a4308)){return _['map'](_0x1a4308,function(_0x300a6d){return _0x300a6d[_0xd9e6('0x5b')];});}else{return;}})[_0xd9e6('0x29')](function(_0x5a71a1){if(_0x5a71a1)_0x4e08d1=_0x5a71a1;if(_['includes'](_0x4e08d1,0x64)){var _0xdd7835=_[_0xd9e6('0x4f')](_0x1a4308,{'sectionId':0x64});return hasDefaultDashboard(_0xdd7835)[_0xd9e6('0x29')](function(_0x40fe0a){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x5ed76a){if(_0x5ed76a[_0xd9e6('0x5b')]===0x64){_0x5ed76a[_0xd9e6('0x68')]=_0x40fe0a;}return _0x5ed76a;});});}else{return;}})[_0xd9e6('0x29')](function(_0x35cd20){if(_0x35cd20)_0x1a4308=_0x35cd20;if(_[_0xd9e6('0x66')](_0x4e08d1,0x3eb)){var _0x4197c8=_[_0xd9e6('0x4f')](_0x1a4308,{'sectionId':0x3eb});return getCustomDashboards(_0x4197c8)['then'](function(_0x1b958c){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x318b6d){if(_0x4197c8['enabled']){if(_0x318b6d['sectionId']===0x3eb){_0x318b6d[_0xd9e6('0x68')]=_0x1b958c;}}else{if(_0x318b6d[_0xd9e6('0x5b')]===0x64){_0x318b6d[_0xd9e6('0x68')]=_0x1b958c;}}return _0x318b6d;});});}else{return;}})['then'](function(_0x43b96b){if(_0x43b96b)_0x1a4308=_0x43b96b;if(_[_0xd9e6('0x66')](_0x4e08d1,0x709)){var _0x515b6=_['find'](_0x1a4308,{'sectionId':0x709});return getPlugins(_0x515b6)['then'](function(_0x15a136){if(_0x515b6['enabled']){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x2fa56b){if(_0x2fa56b['sectionId']===0x709){_0x2fa56b['subsections']=_0x15a136;}return _0x2fa56b;});}else{var _0x162a31={'sectionId':0x76c,'enabled':0x1,'subsections':_0x15a136};var _0x2f5fe3=_[_0xd9e6('0x30')](_0x1a4308);_0x2f5fe3[_0xd9e6('0x63')](_0x162a31);return _0x2f5fe3;}});}else{return;}})[_0xd9e6('0x29')](function(_0x460562){if(_0x460562)_0x1a4308=_0x460562;return _['filter'](_0x1a4308,['enabled',0x1]);})[_0xd9e6('0x29')](respondWithResult(_0x57f35b,null))[_0xd9e6('0x49')](handleError(_0x57f35b,null));};function hasDefaultDashboard(_0x587c9c){var _0xa94c26=[0x65];return new BPromise(function(_0x1047fd,_0x1db8b4){try{if(_0x587c9c[_0xd9e6('0x5a')]){_0x1047fd(_0xa94c26);}else{return db[_0xd9e6('0x5f')]['findOne']({'where':{'sectionId':_0x587c9c['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x1551cf){_0x1551cf?_0x1047fd(_0xa94c26):_0x1047fd();});}}catch(_0xf13ed8){_0x1db8b4(_0xf13ed8);}});}function getCustomDashboards(_0x436f88){var _0x4810e3=[];return new BPromise(function(_0x242da1,_0x4b5d21){try{if(_0x436f88['autoAssociation']){return db[_0xd9e6('0x69')][_0xd9e6('0x47')]({'raw':!![]})[_0xd9e6('0x29')](function(_0x1e44f8){_0x1e44f8[_0xd9e6('0x6a')](function(_0x4ff27c){_0x4810e3[_0xd9e6('0x63')](_0x4ff27c['id']+0x1869f);});_0x242da1(_0x4810e3);});}else{return db['UserProfileResource'][_0xd9e6('0x47')]({'where':{'sectionId':_0x436f88['id']},'raw':!![]})['then'](function(_0x5332f4){_0x5332f4[_0xd9e6('0x6a')](function(_0x4f8f94){_0x4810e3['push'](_0x4f8f94[_0xd9e6('0x6b')]+0x1869f);});_0x242da1(_0x4810e3);});}}catch(_0x2cdd54){_0x4b5d21(_0x2cdd54);}});}function getPlugins(_0x5b1d62){var _0x496e58=[];return new BPromise(function(_0x309964,_0x207d7e){try{if(_0x5b1d62[_0xd9e6('0x5a')]){return db[_0xd9e6('0x6c')][_0xd9e6('0x47')]({'raw':!![]})[_0xd9e6('0x29')](function(_0x56d94e){_0x56d94e[_0xd9e6('0x6a')](function(_0x3a99b2){_0x496e58[_0xd9e6('0x63')](_0x3a99b2['id']+0x15b38);});_0x309964(_0x496e58);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5b1d62['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x3f31f1){_0x3f31f1[_0xd9e6('0x6a')](function(_0x1fbea1){_0x496e58[_0xd9e6('0x63')](_0x1fbea1['resourceId']+0x15b38);});_0x309964(_0x496e58);});}}catch(_0x4aec06){_0x207d7e(_0x4aec06);}});}exports['addResources']=function(_0x3d1f97,_0x11cd13){return db[_0xd9e6('0x31')]['find']({'where':{'id':_0x3d1f97[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x11cd13,null))[_0xd9e6('0x29')](function(_0x5a3a80){if(_0x5a3a80){return db[_0xd9e6('0x58')][_0xd9e6('0x59')](function(_0x4ab3f1){return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0xd9e6('0x29')](function(_0x20d948){if(_0x20d948){return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id'],'id':_[_0xd9e6('0x30')](_0x20d948,function(_0x3630a5){return _0x3630a5['id'];})},'transaction':_0x4ab3f1});}})[_0xd9e6('0x29')](function(_0x2360d2){var _0x2175c3=_[_0xd9e6('0x30')](_0x3d1f97['body'],function(_0x1a2d1f){_0x1a2d1f[_0xd9e6('0x5c')]=_0x3d1f97[_0xd9e6('0x4b')]['id'];return _0x1a2d1f;});return db[_0xd9e6('0x5e')][_0xd9e6('0x6d')](_0x2175c3,{'raw':!![],'transaction':_0x4ab3f1});})[_0xd9e6('0x29')](function(_0x13382e){var _0x4be99a=_['filter'](_[_0xd9e6('0x30')](_0x13382e,function(_0x2b42d1){return _0x2b42d1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4be99a){return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id'],'sectionId':_['map'](_0x4be99a,function(_0x28c1ba){return _0x28c1ba[_0xd9e6('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd9e6('0x29')](function(_0x23f04a){var _0x9f20c6=_[_0xd9e6('0x30')](_0x3d1f97['body'],function(_0x49e92d){_0x49e92d[_0xd9e6('0x5c')]=_0x3d1f97[_0xd9e6('0x4b')]['id'];return _0x49e92d;});return db[_0xd9e6('0x5f')][_0xd9e6('0x6d')](_0x9f20c6,{'raw':!![],'transaction':_0x4ab3f1});});}})['catch'](handleError(_0x11cd13,null));});}})[_0xd9e6('0x29')](function(_0x229db3){var _0x3002a5=_[_0xd9e6('0x30')](_0x229db3,function(_0x5b28de){return _0x5b28de[_0xd9e6('0x53')]({'plain':!![]});});})[_0xd9e6('0x29')](respondWithResult(_0x11cd13,null))[_0xd9e6('0x49')](handleError(_0x11cd13,null));};exports[_0xd9e6('0x6e')]=function(_0x582201,_0x193817,_0x46feae){return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x582201[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x193817,null))[_0xd9e6('0x29')](function(_0x3058fd){if(_0x3058fd){return _0x3058fd['removeResources'](_0x582201[_0xd9e6('0x36')][_0xd9e6('0x6f')]);}})[_0xd9e6('0x29')](respondWithStatusCode(_0x193817,null))[_0xd9e6('0x49')](handleError(_0x193817,null));};exports[_0xd9e6('0x70')]=function(_0x1ac814,_0x1f80f5){var _0x34dab3={};if(!_0x1ac814[_0xd9e6('0x36')][_0xd9e6('0x71')])throw new Error(_0xd9e6('0x72'));if(!_0x1ac814['query'][_0xd9e6('0x3d')]('nolimit')){_0x34dab3[_0xd9e6('0x22')]=qs[_0xd9e6('0x22')](_0x1ac814[_0xd9e6('0x36')]['limit']);_0x34dab3[_0xd9e6('0x20')]=qs[_0xd9e6('0x20')](_0x1ac814[_0xd9e6('0x36')][_0xd9e6('0x20')]);}return db['UserProfile'][_0xd9e6('0x4f')]({'where':{'id':_0x1ac814[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](function(_0x3c4d8c){if(!_0x3c4d8c)throw new Error(_0xd9e6('0x73')+_0x1ac814[_0xd9e6('0x4b')]['id']);return db[_0xd9e6('0x31')][_0xd9e6('0x70')](_0x1ac814);})[_0xd9e6('0x29')](respondWithFilteredResult(_0x1f80f5,_0x34dab3))[_0xd9e6('0x49')](handleError(_0x1f80f5,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bda44fd..834cfe4 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 _0xc0d7=['save','update','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x4ce69a,_0x15710e){var _0x3f05d2=function(_0x2aca15){while(--_0x2aca15){_0x4ce69a['push'](_0x4ce69a['shift']());}};_0x3f05d2(++_0x15710e);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x197a90,_0x569d6c){_0x197a90=_0x197a90-0x0;var _0x4f3fdb=_0xc0d7[_0x197a90];return _0x4f3fdb;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7c0d('0x0')](0x0);var events={'afterCreate':_0x7c0d('0x1'),'afterUpdate':_0x7c0d('0x2'),'afterDestroy':_0x7c0d('0x3')};function emitEvent(_0x2c03ef){return function(_0x2e1cc8,_0xfbd3c8,_0x276b49){UserProfileEvents[_0x7c0d('0x4')](_0x2c03ef+':'+_0x2e1cc8['id'],_0x2e1cc8);UserProfileEvents['emit'](_0x2c03ef,_0x2e1cc8);_0x276b49(null);};}for(var e in events){if(events[_0x7c0d('0x5')](e)){var event=events[e];UserProfile[_0x7c0d('0x6')](e,emitEvent(event));}}module[_0x7c0d('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x49fe=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x57ff7b,_0x470f0d){var _0x2b15d3=function(_0x17c685){while(--_0x17c685){_0x57ff7b['push'](_0x57ff7b['shift']());}};_0x2b15d3(++_0x470f0d);}(_0x49fe,0x75));var _0xe49f=function(_0x2a0390,_0x1bc633){_0x2a0390=_0x2a0390-0x0;var _0x2b5fd3=_0x49fe[_0x2a0390];return _0x2b5fd3;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe49f('0x1'),'afterUpdate':_0xe49f('0x2'),'afterDestroy':_0xe49f('0x3')};function emitEvent(_0xb99c7){return function(_0x1cac40,_0x2db0ec,_0x1235f4){UserProfileEvents[_0xe49f('0x4')](_0xb99c7+':'+_0x1cac40['id'],_0x1cac40);UserProfileEvents[_0xe49f('0x4')](_0xb99c7,_0x1cac40);_0x1235f4(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];UserProfile[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 716fa31..056758b 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 _0xd262=['ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','Agents','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','name','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','scheduler','Schedule','sounds','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','AnalyticExtractedReport','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','all','union','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','merge','where','key','VIRTUAL','foreignKey','forEach','autoAssociation','includeAll','reportType','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','include','Tags','color','tag','openTabs','true','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','map','model','UserProfileResource','resourceId','catch','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0x6f0198,_0x90267f){var _0x2737f7=function(_0x574680){while(--_0x574680){_0x6f0198['push'](_0x6f0198['shift']());}};_0x2737f7(++_0x90267f);}(_0xd262,0x14c));var _0x2d26=function(_0x44cf9f,_0x3f58a4){_0x44cf9f=_0x44cf9f-0x0;var _0x2896c9=_0xd262[_0x44cf9f];return _0x2896c9;};'use strict';var _=require(_0x2d26('0x0'));var attributes=require(_0x2d26('0x1'));var qs=require(_0x2d26('0x2'));var squel=require(_0x2d26('0x3'));module['exports']=function(_0x504380){var _0x58012f=_0x504380[_0x2d26('0x4')];function _0x5e776e(_0x357b88,_0x832965){return new Promise(function(_0x1dc298,_0x188fe0){if(!_0x832965)return _0x1dc298(null);var _0x14bdc7=_0x832965['filter']?{[_0x832965[_0x2d26('0x5')][_0x2d26('0x6')]]:_0x832965['filter'][_0x2d26('0x7')]}:undefined;return _0x58012f[_0x357b88][_0x2d26('0x8')]({'where':_0x14bdc7,'raw':!![]})[_0x2d26('0x9')](function(_0x348a1b){_0x832965[_0x2d26('0xa')]=_[_0x2d26('0xb')](_0x348a1b,'id');_0x1dc298(_0x832965);})['catch'](function(_0x22025e){_0x188fe0(_0x22025e);});});}function _0x1acd7c(_0x1f30b3,_0x159f84){return new Promise(function(_0x18c5b5,_0x143944){var _0x365d0b=_0x1f30b3['filter']?{[_0x1f30b3[_0x2d26('0x5')][_0x2d26('0x6')]]:_0x1f30b3[_0x2d26('0x5')][_0x2d26('0x7')]}:undefined;return _0x58012f[_0x1f30b3[_0x2d26('0xc')]][_0x2d26('0x8')]({'where':_0x365d0b,'raw':!![]})[_0x2d26('0x9')](function(_0x49d377){_0x159f84[_0x2d26('0xa')]=_['map'](_0x49d377,function(_0x1b2bf8){return _0x1b2bf8['name'];});_0x18c5b5(_0x159f84);})['catch'](function(_0x5cbcdb){_0x143944(_0x5cbcdb);});});}function _0x34f99f(_0x384b5c,_0x3c479c,_0x26c416){if(!_0x3c479c)return Promise['resolve'](null);return new Promise(function(_0x3b96f0,_0x29399a){return _0x58012f[_0x2d26('0xd')]['findAll']({'where':{'sectionId':_0x3c479c['id']},'raw':!![]})[_0x2d26('0x9')](function(_0x1abbcf){if(_0x384b5c[_0x2d26('0x6')]&&_0x384b5c['field']!=='id'){_0x3c479c[_0x2d26('0xa')]=_['map'](_0x1abbcf,function(_0x34de09){return _0x34de09[_0x384b5c[_0x2d26('0x6')]];});}else{if(_0x26c416==='AnalyticExtractedReport'){_0x3c479c[_0x2d26('0xa')]=_['map'](_0x1abbcf,function(_0x403712){return{'id':_0x403712[_0x2d26('0xe')],'type':_0x403712['type']};});}else{_0x3c479c[_0x2d26('0xa')]=_[_0x2d26('0xb')](_0x1abbcf,function(_0x4c859d){return _0x4c859d['resourceId'];});}}_0x3b96f0(_0x3c479c);})[_0x2d26('0xf')](function(_0x3e4d19){_0x29399a(_0x3e4d19);});});}function _0x2f39c7(_0x45e780,_0x3ac623){var _0xb9597b={'parentSections':[]};switch(_0x45e780[_0x2d26('0x10')]()){case _0x2d26('0x11'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x13');break;case _0x2d26('0x14'):_0xb9597b[_0x2d26('0x12')]='SquareOdbc';break;case _0x2d26('0x15'):_0xb9597b[_0x2d26('0x12')]='SquareRecording';_0xb9597b[_0x2d26('0x16')]=[{'name':_0x2d26('0x17'),'field':'name','foreignKey':_0x2d26('0x18')}];break;case _0x2d26('0x19'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x1a');break;case'contacts':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x1b');_0xb9597b['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x2d26('0x1c'):_0xb9597b[_0x2d26('0x12')]='CmList';break;case _0x2d26('0x1d'):_0xb9597b['childModel']=_0x2d26('0x1e');break;case _0x2d26('0x1f'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x20');break;case _0x2d26('0x21'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x22');break;case _0x2d26('0x23'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x24');break;case _0x2d26('0x25'):_0xb9597b[_0x2d26('0x12')]='FaxQueue';break;case'faxaccounts':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x26');break;case _0x2d26('0x27'):case _0x2d26('0x28'):case _0x2d26('0x29'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x2a');break;case _0x2d26('0x2b'):_0xb9597b['childModel']='VoiceContext';break;case'voicemails':_0xb9597b[_0x2d26('0x12')]='VoiceMail';break;case'voicerecordings':_0xb9597b[_0x2d26('0x12')]='VoiceRecording';_0xb9597b['parentSections']=[{'name':_0x2d26('0x2c'),'field':'name','foreignKey':'membername','model':_0x2d26('0x2d'),'filter':{'field':_0x2d26('0x2e'),'value':[_0x2d26('0x2f')]}},{'name':_0x2d26('0x30'),'field':'name','foreignKey':'membername','model':_0x2d26('0x2d'),'filter':{'field':_0x2d26('0x2e'),'value':[_0x2d26('0x31')]}},{'name':_0x2d26('0x32'),'field':'name','foreignKey':_0x2d26('0x33'),'model':_0x2d26('0x34'),'filter':{'field':_0x2d26('0x35'),'value':[_0x2d26('0x36')]}},{'name':'QueueCampaigns','field':_0x2d26('0x37'),'foreignKey':_0x2d26('0x33'),'model':_0x2d26('0x34'),'filter':{'field':_0x2d26('0x35'),'value':[_0x2d26('0x38')]}}];break;case _0x2d26('0x39'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x3a');break;case _0x2d26('0x3b'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x3c');break;case _0x2d26('0x3d'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x3e');break;case _0x2d26('0x3f'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x40');break;case _0x2d26('0x41'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x42');break;case _0x2d26('0x43'):_0xb9597b['childModel']=_0x2d26('0x44');break;case _0x2d26('0x45'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x46');break;case _0x2d26('0x47'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x48');break;case'openchannelaccounts':_0xb9597b['childModel']=_0x2d26('0x49');break;case _0x2d26('0x4a'):_0xb9597b['childModel']=_0x2d26('0x4b');break;case _0x2d26('0x4c'):_0xb9597b[_0x2d26('0x12')]='SmsAccount';break;case _0x2d26('0x4d'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x4e');break;case'whatsappaccounts':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x4f');break;case _0x2d26('0x50'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x51');break;case'voicequeues':case _0x2d26('0x52'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x34');if(_0x3ac623){_0xb9597b[_0x2d26('0x16')]=[{'name':_0x2d26('0x32')},{'name':'QueueCampaigns'}];}break;case _0x2d26('0x53'):case _0x2d26('0x54'):case _0x2d26('0x55'):_0xb9597b['childModel']=_0x2d26('0x2d');if(_0x3ac623){_0xb9597b[_0x2d26('0x16')]=[{'name':_0x2d26('0x56'),'filter':{'field':_0x2d26('0x2e'),'value':[_0x2d26('0x57'),_0x2d26('0x58')]},'ignore':!![]},{'name':_0x2d26('0x2c')},{'name':_0x2d26('0x30')}];}break;case _0x2d26('0x59'):_0xb9597b['childModel']=_0x2d26('0x5a');break;case'salesforceaccounts':_0xb9597b['childModel']=_0x2d26('0x5b');break;case _0x2d26('0x5c'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x5d');break;case _0x2d26('0x5e'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x5f');break;case _0x2d26('0x60'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x61');break;case _0x2d26('0x62'):_0xb9597b['childModel']='ZohoAccount';break;case'vtigeraccounts':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x2d');break;case _0x2d26('0x63'):_0xb9597b[_0x2d26('0x12')]='CannedAnswer';break;case _0x2d26('0x64'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x65');break;case _0x2d26('0x66'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x67');break;case _0x2d26('0x68'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x69');break;case'pauses':_0xb9597b[_0x2d26('0x12')]='Pause';break;case _0x2d26('0x6a'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x6b');break;case _0x2d26('0x6c'):_0xb9597b[_0x2d26('0x12')]='Sound';break;case'tags':_0xb9597b['childModel']=_0x2d26('0x6d');break;case _0x2d26('0x6e'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x6f');break;case _0x2d26('0x70'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x71');break;case _0x2d26('0x72'):_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x73');break;case'variables':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x74');break;case'plugins':_0xb9597b[_0x2d26('0x12')]='Plugin';break;case'extractedreports':_0xb9597b['childModel']=_0x2d26('0x75');_0xb9597b[_0x2d26('0x16')]=[{'name':_0x2d26('0x76'),'field':'id','foreignKey':_0x2d26('0x77')}];break;case'metrics':_0xb9597b[_0x2d26('0x12')]=_0x2d26('0x78');break;}return _0xb9597b;}function _0x439995(_0x48e400,_0x25f6a7){var _0x4e62dd=_0x48e400[_0x2d26('0x79')](0x0)[_0x2d26('0x7a')]()+_0x48e400[_0x2d26('0x7b')](0x1);var _0x3e3f3e={'type':_0x58012f[_0x2d26('0x7c')]['QueryTypes'][_0x2d26('0x7d')],'raw':!![]};return new Promise(function(_0x38dc52,_0x1350a2){var _0x236ede=squel[_0x2d26('0x7e')]()[_0x2d26('0x6')](_0x2d26('0x7f')+_0x4e62dd+_0x2d26('0x80'),'id')['field']('ui.createdAt')[_0x2d26('0x81')](_0x2d26('0x82')+_0x48e400+_0x2d26('0x83'),'ui')['where'](_0x2d26('0x84'),_0x25f6a7['id']);return _0x58012f[_0x2d26('0x85')][_0x2d26('0x86')](_0x236ede[_0x2d26('0x87')](),_0x3e3f3e)['then'](function(_0x1ad91d){_0x25f6a7[_0x4e62dd+_0x2d26('0x88')]=_0x1ad91d;_0x38dc52(_0x1ad91d);})[_0x2d26('0xf')](function(_0x4d4ce7){_0x1350a2(_0x4d4ce7);});});}return _0x504380['define']('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x21f4fb){var _0x1b1251={'raw':_0x21f4fb[_0x2d26('0x86')][_0x2d26('0x89')],'where':{}};var _0x5c22ab={};var _0x48b116={'count':0x0,'rows':[]};var _0x2df1ef=_0x21f4fb[_0x2d26('0x86')]['section'];var _0x189720=_0x21f4fb[_0x2d26('0x86')][_0x2d26('0x8a')]||![];var _0xfe6b2d=_0x2f39c7(_0x2df1ef,_0x189720);if(!_0xfe6b2d[_0x2d26('0x12')])throw new Error(_0x2d26('0x8b')+_0x2df1ef+'\x27');var _0x1d93ad=[{'name':_0x2df1ef}];if(!_[_0x2d26('0x8c')](_0xfe6b2d[_0x2d26('0x16')]))_0x1d93ad=_0xfe6b2d[_0x2d26('0x16')];var _0x25125b=[];for(var _0xded71b=0x0;_0xded71b<_0x1d93ad[_0x2d26('0x8d')];_0xded71b++){_0x25125b[_0x2d26('0x8e')](_0x58012f['UserProfileSection'][_0x2d26('0x8f')]({'where':{'userProfileId':_0x21f4fb['params']['id'],'name':_0x1d93ad[_0xded71b][_0x2d26('0x37')]},'raw':!![]}));}return Promise[_0x2d26('0x90')](_0x25125b)['then'](function(_0x584b8f){var _0x593346=_[_0x2d26('0x5')](_0x584b8f,function(_0x3fd359){return _0x3fd359?_0x3fd359:undefined;});var _0x16873d=_[_0x2d26('0x5')](_0x1d93ad,['ignore',!![]]);var _0x102837=_[_0x2d26('0x8c')](_0x593346)&&_[_0x2d26('0x8c')](_0x16873d)?null:_[_0x2d26('0x91')](_0x16873d,_0x593346);if(!_0x102837)return null;var _0xfea625=[];for(var _0x3422cc=0x0;_0x3422cc<_0x102837[_0x2d26('0x8d')];_0x3422cc++){var _0x5dff2a=_['find'](_0x1d93ad,function(_0x28f35b){return _0x102837[_0x3422cc]?_0x28f35b[_0x2d26('0x37')]===_0x102837[_0x3422cc][_0x2d26('0x37')]:null;});if(_0x5dff2a){if(_0x102837[_0x3422cc]['ignore']){_0xfea625[_0x2d26('0x8e')](_0x5e776e(_0xfe6b2d[_0x2d26('0x12')],_0x102837[_0x3422cc]));}else{if(!_0x102837[_0x3422cc]['autoAssociation']){_0xfea625['push'](_0x34f99f(_0x5dff2a,_0x102837[_0x3422cc],_0xfe6b2d['childModel']));}else{if(_0x5dff2a[_0x2d26('0xc')]){_0xfea625[_0x2d26('0x8e')](_0x1acd7c(_0x5dff2a,_0x102837[_0x3422cc]));}}}}}return Promise['all'](_0xfea625);})[_0x2d26('0x9')](function(_0x2eb922){var _0x4316e4=_0x2eb922;var _0x5dc85f=null;if(_0x4316e4){_0x5dc85f=_0x4316e4['length']===0x1?_0x4316e4[0x0]:null;}if(!_0x5dc85f&&!_0x4316e4)return _0x48b116;var _0x50a516=_0x58012f[_0xfe6b2d[_0x2d26('0x12')]]['rawAttributes'];_0x5c22ab[_0x2d26('0xc')]=_[_0x2d26('0x92')](_0x50a516);_0x5c22ab[_0x2d26('0x86')]=_[_0x2d26('0x92')](_0x21f4fb['query']);_0x5c22ab[_0x2d26('0x93')]=_[_0x2d26('0x94')](_0x5c22ab[_0x2d26('0xc')],_0x5c22ab[_0x2d26('0x86')]);_0x1b1251[_0x2d26('0x95')]=_['intersection'](_0x5c22ab[_0x2d26('0xc')],qs[_0x2d26('0x96')](_0x21f4fb[_0x2d26('0x86')][_0x2d26('0x96')]));_0x1b1251[_0x2d26('0x95')]=_0x1b1251['attributes'][_0x2d26('0x8d')]?_0x1b1251[_0x2d26('0x95')]:_0x5c22ab[_0x2d26('0xc')];if(!_0x21f4fb[_0x2d26('0x86')]['hasOwnProperty'](_0x2d26('0x97'))){_0x1b1251['limit']=qs['limit'](_0x21f4fb[_0x2d26('0x86')][_0x2d26('0x98')]);_0x1b1251['offset']=qs['offset'](_0x21f4fb[_0x2d26('0x86')]['offset']);}_0x1b1251[_0x2d26('0x99')]=qs[_0x2d26('0x9a')](_0x21f4fb['query'][_0x2d26('0x9a')]);_0x1b1251['where']=qs[_0x2d26('0x93')](_[_0x2d26('0x9b')](_0x21f4fb['query'],_0x5c22ab[_0x2d26('0x93')]));if(_0x21f4fb['query'][_0x2d26('0x5')]){_0x1b1251['where']=_[_0x2d26('0x9c')](_0x1b1251[_0x2d26('0x9d')],{'$or':_[_0x2d26('0xb')](_0x50a516,function(_0x544944){if(_0x544944['type'][_0x2d26('0x9e')]!==_0x2d26('0x9f')){var _0x14c0a1={};_0x14c0a1[_0x544944['field']]={'$like':'%'+_0x21f4fb[_0x2d26('0x86')][_0x2d26('0x5')]+'%'};return _0x14c0a1;}})});}var _0x767d1b=[];var _0x2d326e=null;var _0xb71df={};if(_0x5dc85f){_0x2d326e=_['find'](_0x1d93ad,[_0x2d26('0x37'),_0x5dc85f[_0x2d26('0x37')]]);if(_0x2d326e['field']){_0xb71df={};if(_0xfe6b2d[_0x2d26('0x12')]===_0x2d26('0x75')){_0xb71df[_0x2d326e[_0x2d26('0xa0')]]=_[_0x2d26('0xb')](_0x5dc85f[_0x2d26('0xa')],'id');}else{_0xb71df[_0x2d326e[_0x2d26('0xa0')]]=_0x5dc85f[_0x2d26('0xa')];}_0x767d1b[_0x2d26('0x8e')](_0xb71df);}else{_0x1b1251[_0x2d26('0x9d')]['id']=_0x5dc85f[_0x2d26('0xa')];}}else{for(var _0x16629b=0x0;_0x16629b<_0x4316e4['length'];_0x16629b++){_0x2d326e=_[_0x2d26('0x8f')](_0x1d93ad,['name',_0x4316e4[_0x16629b][_0x2d26('0x37')]]);if(_0x2d326e[_0x2d26('0x6')]){_0xb71df={};_0xb71df[_0x2d326e[_0x2d26('0xa0')]]=_0x4316e4[_0x16629b][_0x2d26('0xa')];_0x767d1b['push'](_0xb71df);}else{if(!_0x1b1251[_0x2d26('0x9d')]['id'])_0x1b1251['where']['id']=[];_0x4316e4[_0x16629b]['associatedResources'][_0x2d26('0xa1')](function(_0x2860aa){_0x1b1251['where']['id'][_0x2d26('0x8e')](_0x2860aa);});}}}if(!_[_0x2d26('0x8c')](_0x767d1b)){_0x1b1251[_0x2d26('0x9d')]=_[_0x2d26('0x9c')](_0x1b1251[_0x2d26('0x9d')],{'$and':{'$or':_0x767d1b}});}_0x1b1251=_[_0x2d26('0x9c')]({},_0x1b1251,_0x21f4fb['options']);if(_0x5dc85f&&!_0x5dc85f[_0x2d26('0xa2')]&&_0xfe6b2d['childModel']===_0x2d26('0x75')){if(_0x21f4fb['query'][_0x2d26('0xa3')]){_0x1b1251['include']=[{'all':!![]}];}return _0x58012f[_0xfe6b2d['childModel']][_0x2d26('0x8')](_0x1b1251)[_0x2d26('0x9')](function(_0x2a8ce5){var _0x232bfe=[];_0x2a8ce5[_0x2d26('0xa1')](function(_0x5f00d2){var _0x5f432a;switch(_0x5f00d2[_0x2d26('0xa4')]){case'default':_0x5f432a=_['find'](_0x5dc85f[_0x2d26('0xa')],function(_0x4e4f0d){return _0x4e4f0d['id']===_0x5f00d2['reportId']&&_0x4e4f0d[_0x2d26('0x35')]===_0x2d26('0xa5');});break;case _0x2d26('0xa6'):_0x5f432a=_[_0x2d26('0x8f')](_0x5dc85f['associatedResources'],function(_0x42e104){return _0x42e104['id']===_0x5f00d2[_0x2d26('0x77')]&&_0x42e104[_0x2d26('0x35')]===_0x2d26('0xa7');});break;}if(_0x5f432a)_0x232bfe[_0x2d26('0x8e')](_0x5f00d2);});_0x48b116[_0x2d26('0xa8')]=_0x232bfe['length'];_0x48b116[_0x2d26('0xa9')]=_0x232bfe;return _0x48b116;});}else{if(!_[_0x2d26('0x8c')](_0x21f4fb['query'][_0x2d26('0xaa')])){_0x1b1251[_0x2d26('0x9d')]['id']=_0x1b1251[_0x2d26('0x9d')]['id']?_[_0x2d26('0x94')](_0x1b1251[_0x2d26('0x9d')]['id'],_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xaa')]):_0x21f4fb['query'][_0x2d26('0xaa')];if(_0x21f4fb[_0x2d26('0x86')]['customSorting']){_0x1b1251[_0x2d26('0x99')]=_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xab')];}}if(_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xac')]){_0x1b1251[_0x2d26('0x9d')]=_['merge'](_0x1b1251[_0x2d26('0x9d')],{'$and':_0x21f4fb[_0x2d26('0x86')]['extraQueryConditions']});}return _0x58012f[_0xfe6b2d[_0x2d26('0x12')]][_0x2d26('0xa8')]({'where':_0x1b1251[_0x2d26('0x9d')]})[_0x2d26('0x9')](function(_0x5a6ea5){_0x48b116[_0x2d26('0xa8')]=_0x5a6ea5;if(_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xa3')]){if(_0xfe6b2d[_0x2d26('0x12')]===_0x2d26('0x1b')){_0x1b1251[_0x2d26('0xad')]=[{'model':_0x58012f[_0x2d26('0x6d')],'as':_0x2d26('0xae'),'attributes':['id',_0x2d26('0x37'),_0x2d26('0xaf')],'required':_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xb0')]?!![]:![]},{'model':_0x58012f[_0x2d26('0x6d')],'as':'ThroughTags','attributes':['id','name','color'],'through':_0x21f4fb[_0x2d26('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x21f4fb['query'][_0x2d26('0xb0')]||undefined}}:{},'required':_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xb0')]?!![]:![]}];}else{_0x1b1251[_0x2d26('0xad')]=[{'all':!![]}];}}return _0x58012f[_0xfe6b2d[_0x2d26('0x12')]]['findAll'](_0x1b1251);})[_0x2d26('0x9')](function(_0x5b2747){_0x48b116[_0x2d26('0xa9')]=_0x5b2747;if(_0x2df1ef===_0x2d26('0x2c')&&_0x21f4fb[_0x2d26('0x86')][_0x2d26('0xb1')]===_0x2d26('0xb2')){var _0x25d93f=[];for(var _0x39ca37=0x0;_0x39ca37<_0x48b116[_0x2d26('0xa9')][_0x2d26('0x8d')];_0x39ca37++){_0x25d93f['push'](_0x439995(_0x2d26('0xb3'),_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));_0x25d93f[_0x2d26('0x8e')](_0x439995('sms',_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));_0x25d93f[_0x2d26('0x8e')](_0x439995(_0x2d26('0xb5'),_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));_0x25d93f[_0x2d26('0x8e')](_0x439995(_0x2d26('0xb6'),_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));_0x25d93f[_0x2d26('0x8e')](_0x439995(_0x2d26('0xb7'),_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));_0x25d93f[_0x2d26('0x8e')](_0x439995('whatsapp',_0x48b116[_0x2d26('0xa9')][_0x39ca37][_0x2d26('0xb4')]));}return Promise[_0x2d26('0x90')](_0x25d93f)[_0x2d26('0x9')](function(){return _0x48b116;});}return _0x48b116;});}});}}});}; \ No newline at end of file +var _0x814c=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','User','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','triggers','Trigger','trunks','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','union','length','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','include','Tag','Tags','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','catch','value','model','findAll','then','map','name','resolve','UserProfileResource','AnalyticExtractedReport','associatedResources','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','Telephones','telephone','VoiceQueues','VoiceQueue','type','QueueCampaigns','queue','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts'];(function(_0x57e477,_0xec10a4){var _0x3c47b5=function(_0x4bfc4b){while(--_0x4bfc4b){_0x57e477['push'](_0x57e477['shift']());}};_0x3c47b5(++_0xec10a4);}(_0x814c,0x12b));var _0xc814=function(_0x3e82a0,_0x16e564){_0x3e82a0=_0x3e82a0-0x0;var _0x4ea8a7=_0x814c[_0x3e82a0];return _0x4ea8a7;};'use strict';var _=require(_0xc814('0x0'));var attributes=require(_0xc814('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xc814('0x2'));module[_0xc814('0x3')]=function(_0x36928d){var _0x1ed0d9=_0x36928d[_0xc814('0x4')];function _0x5e9d9e(_0x50c05e,_0x44fa11){return new Promise(function(_0x1b5f4b,_0x3248ae){if(!_0x44fa11)return _0x1b5f4b(null);var _0x3a8d30=_0x44fa11[_0xc814('0x5')]?{[_0x44fa11[_0xc814('0x5')][_0xc814('0x6')]]:_0x44fa11[_0xc814('0x5')]['value']}:undefined;return _0x1ed0d9[_0x50c05e]['findAll']({'where':_0x3a8d30,'raw':!![]})['then'](function(_0x5dc606){_0x44fa11['associatedResources']=_['map'](_0x5dc606,'id');_0x1b5f4b(_0x44fa11);})[_0xc814('0x7')](function(_0x3eb2c3){_0x3248ae(_0x3eb2c3);});});}function _0x12f196(_0x4e792c,_0x5476d0){return new Promise(function(_0x46b3a7,_0x297545){var _0x3ae44e=_0x4e792c[_0xc814('0x5')]?{[_0x4e792c[_0xc814('0x5')][_0xc814('0x6')]]:_0x4e792c[_0xc814('0x5')][_0xc814('0x8')]}:undefined;return _0x1ed0d9[_0x4e792c[_0xc814('0x9')]][_0xc814('0xa')]({'where':_0x3ae44e,'raw':!![]})[_0xc814('0xb')](function(_0x3ffbcd){_0x5476d0['associatedResources']=_[_0xc814('0xc')](_0x3ffbcd,function(_0xd9c53b){return _0xd9c53b[_0xc814('0xd')];});_0x46b3a7(_0x5476d0);})[_0xc814('0x7')](function(_0x28b315){_0x297545(_0x28b315);});});}function _0x27c0dd(_0x5aa507,_0x24c0f9,_0x41dc32){if(!_0x24c0f9)return Promise[_0xc814('0xe')](null);return new Promise(function(_0x3a5c69,_0x49cb48){return _0x1ed0d9[_0xc814('0xf')]['findAll']({'where':{'sectionId':_0x24c0f9['id']},'raw':!![]})['then'](function(_0x5ef101){if(_0x5aa507[_0xc814('0x6')]&&_0x5aa507[_0xc814('0x6')]!=='id'){_0x24c0f9['associatedResources']=_[_0xc814('0xc')](_0x5ef101,function(_0x9eef2a){return _0x9eef2a[_0x5aa507['field']];});}else{if(_0x41dc32===_0xc814('0x10')){_0x24c0f9[_0xc814('0x11')]=_[_0xc814('0xc')](_0x5ef101,function(_0x223976){return{'id':_0x223976[_0xc814('0x12')],'type':_0x223976['type']};});}else{_0x24c0f9[_0xc814('0x11')]=_['map'](_0x5ef101,function(_0x4db27f){return _0x4db27f[_0xc814('0x12')];});}}_0x3a5c69(_0x24c0f9);})[_0xc814('0x7')](function(_0x45bb94){_0x49cb48(_0x45bb94);});});}function _0x7f320d(_0x396ed8,_0x312d52){var _0x38c723={'parentSections':[]};switch(_0x396ed8['toLowerCase']()){case _0xc814('0x13'):_0x38c723[_0xc814('0x14')]=_0xc814('0x15');break;case _0xc814('0x16'):_0x38c723[_0xc814('0x14')]=_0xc814('0x17');break;case _0xc814('0x18'):_0x38c723[_0xc814('0x14')]='SquareRecording';_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x1a'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x1b')}];break;case _0xc814('0x1c'):_0x38c723[_0xc814('0x14')]=_0xc814('0x1d');break;case _0xc814('0x1e'):_0x38c723['childModel']=_0xc814('0x1f');_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x20'),'field':'id','foreignKey':_0xc814('0x21')}];break;case _0xc814('0x22'):_0x38c723[_0xc814('0x14')]=_0xc814('0x23');break;case'companies':_0x38c723[_0xc814('0x14')]=_0xc814('0x24');break;case _0xc814('0x25'):_0x38c723[_0xc814('0x14')]='CmCustomField';break;case _0xc814('0x26'):_0x38c723[_0xc814('0x14')]=_0xc814('0x27');break;case _0xc814('0x28'):_0x38c723[_0xc814('0x14')]=_0xc814('0x29');break;case'faxqueues':_0x38c723[_0xc814('0x14')]=_0xc814('0x2a');break;case _0xc814('0x2b'):_0x38c723['childModel']='FaxAccount';break;case'inboundroutes':case _0xc814('0x2c'):case _0xc814('0x2d'):_0x38c723[_0xc814('0x14')]='VoiceExtension';break;case'contexts':_0x38c723[_0xc814('0x14')]=_0xc814('0x2e');break;case _0xc814('0x2f'):_0x38c723[_0xc814('0x14')]='VoiceMail';break;case _0xc814('0x30'):_0x38c723[_0xc814('0x14')]=_0xc814('0x31');_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x32'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x33'),'model':'User','filter':{'field':_0xc814('0x34'),'value':['agent']}},{'name':_0xc814('0x35'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x33'),'model':'User','filter':{'field':_0xc814('0x34'),'value':[_0xc814('0x36')]}},{'name':_0xc814('0x37'),'field':_0xc814('0xd'),'foreignKey':'queue','model':_0xc814('0x38'),'filter':{'field':_0xc814('0x39'),'value':['inbound']}},{'name':_0xc814('0x3a'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x3b'),'model':_0xc814('0x38'),'filter':{'field':_0xc814('0x39'),'value':['outbound']}}];break;case _0xc814('0x3c'):_0x38c723[_0xc814('0x14')]='VoiceMusicOnHold';break;case _0xc814('0x3d'):_0x38c723[_0xc814('0x14')]=_0xc814('0x3e');break;case _0xc814('0x3f'):_0x38c723[_0xc814('0x14')]=_0xc814('0x40');break;case'ivrcampaigns':_0x38c723['childModel']=_0xc814('0x41');break;case _0xc814('0x42'):_0x38c723[_0xc814('0x14')]=_0xc814('0x43');break;case'mailaccounts':_0x38c723[_0xc814('0x14')]=_0xc814('0x44');break;case'mailsubstatuses':_0x38c723['childModel']=_0xc814('0x45');break;case _0xc814('0x46'):_0x38c723['childModel']=_0xc814('0x47');break;case'openchannelaccounts':_0x38c723[_0xc814('0x14')]=_0xc814('0x48');break;case _0xc814('0x49'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4a');break;case _0xc814('0x4b'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4c');break;case'whatsappqueues':_0x38c723['childModel']=_0xc814('0x4d');break;case _0xc814('0x4e'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4f');break;case'teams':_0x38c723[_0xc814('0x14')]='Team';break;case'voicequeues':case _0xc814('0x50'):_0x38c723[_0xc814('0x14')]=_0xc814('0x38');if(_0x312d52){_0x38c723['parentSections']=[{'name':_0xc814('0x37')},{'name':_0xc814('0x3a')}];}break;case _0xc814('0x51'):case _0xc814('0x52'):case _0xc814('0x53'):_0x38c723[_0xc814('0x14')]='User';if(_0x312d52){_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x54'),'filter':{'field':_0xc814('0x34'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xc814('0x55'):_0x38c723['childModel']=_0xc814('0x56');break;case _0xc814('0x57'):_0x38c723[_0xc814('0x14')]=_0xc814('0x58');break;case _0xc814('0x59'):_0x38c723[_0xc814('0x14')]='FreshdeskAccount';break;case _0xc814('0x5a'):_0x38c723['childModel']=_0xc814('0x5b');break;case _0xc814('0x5c'):_0x38c723['childModel']=_0xc814('0x5d');break;case _0xc814('0x5e'):_0x38c723[_0xc814('0x14')]='ZohoAccount';break;case _0xc814('0x5f'):_0x38c723['childModel']=_0xc814('0x60');break;case _0xc814('0x61'):_0x38c723[_0xc814('0x14')]=_0xc814('0x62');break;case _0xc814('0x63'):_0x38c723[_0xc814('0x14')]=_0xc814('0x64');break;case _0xc814('0x65'):_0x38c723[_0xc814('0x14')]=_0xc814('0x66');break;case _0xc814('0x67'):_0x38c723[_0xc814('0x14')]=_0xc814('0x68');break;case _0xc814('0x69'):_0x38c723['childModel']=_0xc814('0x6a');break;case _0xc814('0x6b'):_0x38c723[_0xc814('0x14')]=_0xc814('0x6c');break;case _0xc814('0x6d'):_0x38c723[_0xc814('0x14')]=_0xc814('0x6e');break;case'tags':_0x38c723[_0xc814('0x14')]='Tag';break;case _0xc814('0x6f'):_0x38c723[_0xc814('0x14')]='Template';break;case _0xc814('0x70'):_0x38c723[_0xc814('0x14')]=_0xc814('0x71');break;case _0xc814('0x72'):_0x38c723[_0xc814('0x14')]='Trunk';break;case'variables':_0x38c723[_0xc814('0x14')]='Variable';break;case _0xc814('0x73'):_0x38c723[_0xc814('0x14')]=_0xc814('0x74');break;case _0xc814('0x75'):_0x38c723[_0xc814('0x14')]='AnalyticExtractedReport';_0x38c723[_0xc814('0x19')]=[{'name':'Reports','field':'id','foreignKey':_0xc814('0x76')}];break;case _0xc814('0x77'):_0x38c723[_0xc814('0x14')]=_0xc814('0x78');break;}return _0x38c723;}function _0x36001d(_0x2be71f,_0x2a7c3a){var _0x2425fd=_0x2be71f[_0xc814('0x79')](0x0)[_0xc814('0x7a')]()+_0x2be71f[_0xc814('0x7b')](0x1);var _0x80fb72={'type':_0x1ed0d9[_0xc814('0x7c')][_0xc814('0x7d')][_0xc814('0x7e')],'raw':!![]};return new Promise(function(_0x62bf1a,_0x5a09c5){var _0x352b13=squel[_0xc814('0x7f')]()[_0xc814('0x6')](_0xc814('0x80')+_0x2425fd+_0xc814('0x81'),'id')[_0xc814('0x6')](_0xc814('0x82'))['from'](_0xc814('0x83')+_0x2be71f+'_interactions','ui')[_0xc814('0x84')](_0xc814('0x85'),_0x2a7c3a['id']);return _0x1ed0d9['sequelize'][_0xc814('0x86')](_0x352b13[_0xc814('0x87')](),_0x80fb72)[_0xc814('0xb')](function(_0x532d2f){_0x2a7c3a[_0x2425fd+_0xc814('0x88')]=_0x532d2f;_0x62bf1a(_0x532d2f);})['catch'](function(_0x4c4556){_0x5a09c5(_0x4c4556);});});}return _0x36928d[_0xc814('0x89')](_0xc814('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1a7554){var _0x2970ed={'raw':_0x1a7554[_0xc814('0x86')]['raw'],'where':{}};var _0x4b8ca9={};var _0x5b65fb={'count':0x0,'rows':[]};var _0x35d196=_0x1a7554[_0xc814('0x86')][_0xc814('0x8b')];var _0x515a03=_0x1a7554[_0xc814('0x86')][_0xc814('0x8c')]||![];var _0x10e33a=_0x7f320d(_0x35d196,_0x515a03);if(!_0x10e33a[_0xc814('0x14')])throw new Error(_0xc814('0x8d')+_0x35d196+'\x27');var _0x456e22=[{'name':_0x35d196}];if(!_[_0xc814('0x8e')](_0x10e33a[_0xc814('0x19')]))_0x456e22=_0x10e33a[_0xc814('0x19')];var _0x36ea45=[];for(var _0xc8d8b8=0x0;_0xc8d8b8<_0x456e22['length'];_0xc8d8b8++){_0x36ea45[_0xc814('0x8f')](_0x1ed0d9[_0xc814('0x90')][_0xc814('0x91')]({'where':{'userProfileId':_0x1a7554[_0xc814('0x92')]['id'],'name':_0x456e22[_0xc8d8b8][_0xc814('0xd')]},'raw':!![]}));}return Promise[_0xc814('0x93')](_0x36ea45)['then'](function(_0x5d4c3d){var _0x258bd6=_[_0xc814('0x5')](_0x5d4c3d,function(_0x5ba818){return _0x5ba818?_0x5ba818:undefined;});var _0x1d1048=_[_0xc814('0x5')](_0x456e22,['ignore',!![]]);var _0x694636=_[_0xc814('0x8e')](_0x258bd6)&&_[_0xc814('0x8e')](_0x1d1048)?null:_[_0xc814('0x94')](_0x1d1048,_0x258bd6);if(!_0x694636)return null;var _0x44d0ed=[];for(var _0x2a864e=0x0;_0x2a864e<_0x694636[_0xc814('0x95')];_0x2a864e++){var _0x5db343=_[_0xc814('0x91')](_0x456e22,function(_0x330b90){return _0x694636[_0x2a864e]?_0x330b90['name']===_0x694636[_0x2a864e][_0xc814('0xd')]:null;});if(_0x5db343){if(_0x694636[_0x2a864e][_0xc814('0x96')]){_0x44d0ed[_0xc814('0x8f')](_0x5e9d9e(_0x10e33a[_0xc814('0x14')],_0x694636[_0x2a864e]));}else{if(!_0x694636[_0x2a864e][_0xc814('0x97')]){_0x44d0ed[_0xc814('0x8f')](_0x27c0dd(_0x5db343,_0x694636[_0x2a864e],_0x10e33a[_0xc814('0x14')]));}else{if(_0x5db343[_0xc814('0x9')]){_0x44d0ed[_0xc814('0x8f')](_0x12f196(_0x5db343,_0x694636[_0x2a864e]));}}}}}return Promise[_0xc814('0x93')](_0x44d0ed);})['then'](function(_0x16cd55){var _0xe0691e=_0x16cd55;var _0x2f65e4=null;if(_0xe0691e){_0x2f65e4=_0xe0691e[_0xc814('0x95')]===0x1?_0xe0691e[0x0]:null;}if(!_0x2f65e4&&!_0xe0691e)return _0x5b65fb;var _0x38df0e=_0x1ed0d9[_0x10e33a[_0xc814('0x14')]][_0xc814('0x98')];_0x4b8ca9[_0xc814('0x9')]=_[_0xc814('0x99')](_0x38df0e);_0x4b8ca9[_0xc814('0x86')]=_['keys'](_0x1a7554[_0xc814('0x86')]);_0x4b8ca9[_0xc814('0x9a')]=_[_0xc814('0x9b')](_0x4b8ca9['model'],_0x4b8ca9[_0xc814('0x86')]);_0x2970ed[_0xc814('0x9c')]=_[_0xc814('0x9b')](_0x4b8ca9[_0xc814('0x9')],qs[_0xc814('0x9d')](_0x1a7554[_0xc814('0x86')][_0xc814('0x9d')]));_0x2970ed['attributes']=_0x2970ed['attributes'][_0xc814('0x95')]?_0x2970ed[_0xc814('0x9c')]:_0x4b8ca9[_0xc814('0x9')];if(!_0x1a7554[_0xc814('0x86')][_0xc814('0x9e')](_0xc814('0x9f'))){_0x2970ed['limit']=qs[_0xc814('0xa0')](_0x1a7554[_0xc814('0x86')][_0xc814('0xa0')]);_0x2970ed[_0xc814('0xa1')]=qs[_0xc814('0xa1')](_0x1a7554['query'][_0xc814('0xa1')]);}_0x2970ed[_0xc814('0xa2')]=qs[_0xc814('0xa3')](_0x1a7554[_0xc814('0x86')][_0xc814('0xa3')]);_0x2970ed['where']=qs[_0xc814('0x9a')](_[_0xc814('0xa4')](_0x1a7554[_0xc814('0x86')],_0x4b8ca9[_0xc814('0x9a')]));if(_0x1a7554[_0xc814('0x86')][_0xc814('0x5')]){_0x2970ed['where']=_[_0xc814('0xa5')](_0x2970ed[_0xc814('0x84')],{'$or':_[_0xc814('0xc')](_0x38df0e,function(_0x468190){if(_0x468190[_0xc814('0x39')][_0xc814('0xa6')]!==_0xc814('0xa7')){var _0x4d7dd2={};_0x4d7dd2[_0x468190[_0xc814('0x6')]]={'$like':'%'+_0x1a7554[_0xc814('0x86')][_0xc814('0x5')]+'%'};return _0x4d7dd2;}})});}var _0x589fbc=[];var _0x149ae9=null;var _0x5939ec={};if(_0x2f65e4){_0x149ae9=_['find'](_0x456e22,[_0xc814('0xd'),_0x2f65e4[_0xc814('0xd')]]);if(_0x149ae9[_0xc814('0x6')]){_0x5939ec={};if(_0x10e33a[_0xc814('0x14')]==='AnalyticExtractedReport'){_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_[_0xc814('0xc')](_0x2f65e4[_0xc814('0x11')],'id');}else{_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_0x2f65e4['associatedResources'];}_0x589fbc['push'](_0x5939ec);}else{_0x2970ed['where']['id']=_0x2f65e4[_0xc814('0x11')];}}else{for(var _0xefbe4c=0x0;_0xefbe4c<_0xe0691e[_0xc814('0x95')];_0xefbe4c++){_0x149ae9=_[_0xc814('0x91')](_0x456e22,[_0xc814('0xd'),_0xe0691e[_0xefbe4c][_0xc814('0xd')]]);if(_0x149ae9[_0xc814('0x6')]){_0x5939ec={};_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_0xe0691e[_0xefbe4c][_0xc814('0x11')];_0x589fbc[_0xc814('0x8f')](_0x5939ec);}else{if(!_0x2970ed[_0xc814('0x84')]['id'])_0x2970ed['where']['id']=[];_0xe0691e[_0xefbe4c][_0xc814('0x11')][_0xc814('0xa9')](function(_0x1df2af){_0x2970ed['where']['id'][_0xc814('0x8f')](_0x1df2af);});}}}if(!_[_0xc814('0x8e')](_0x589fbc)){_0x2970ed['where']=_['merge'](_0x2970ed[_0xc814('0x84')],{'$and':{'$or':_0x589fbc}});}_0x2970ed=_['merge']({},_0x2970ed,_0x1a7554[_0xc814('0xaa')]);if(_0x2f65e4&&!_0x2f65e4[_0xc814('0x97')]&&_0x10e33a[_0xc814('0x14')]==='AnalyticExtractedReport'){if(_0x1a7554[_0xc814('0x86')][_0xc814('0xab')]){_0x2970ed['include']=[{'all':!![]}];}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]]['findAll'](_0x2970ed)[_0xc814('0xb')](function(_0x3ff75d){var _0x58ef91=[];_0x3ff75d[_0xc814('0xa9')](function(_0x50883a){var _0x457c4a;switch(_0x50883a[_0xc814('0xac')]){case _0xc814('0xad'):_0x457c4a=_[_0xc814('0x91')](_0x2f65e4[_0xc814('0x11')],function(_0x5b5c75){return _0x5b5c75['id']===_0x50883a['reportId']&&_0x5b5c75['type']===_0xc814('0xae');});break;case _0xc814('0xaf'):_0x457c4a=_['find'](_0x2f65e4[_0xc814('0x11')],function(_0x424525){return _0x424525['id']===_0x50883a[_0xc814('0x76')]&&_0x424525[_0xc814('0x39')]==='CustomReports';});break;}if(_0x457c4a)_0x58ef91['push'](_0x50883a);});_0x5b65fb[_0xc814('0xb0')]=_0x58ef91[_0xc814('0x95')];_0x5b65fb[_0xc814('0xb1')]=_0x58ef91;return _0x5b65fb;});}else{if(!_[_0xc814('0x8e')](_0x1a7554[_0xc814('0x86')][_0xc814('0xb2')])){_0x2970ed[_0xc814('0x84')]['id']=_0x2970ed['where']['id']?_[_0xc814('0x9b')](_0x2970ed['where']['id'],_0x1a7554['query']['ids']):_0x1a7554['query'][_0xc814('0xb2')];if(_0x1a7554[_0xc814('0x86')][_0xc814('0xb3')]){_0x2970ed[_0xc814('0xa2')]=_0x1a7554['query'][_0xc814('0xb3')];}}if(_0x1a7554[_0xc814('0x86')]['extraQueryConditions']){_0x2970ed[_0xc814('0x84')]=_[_0xc814('0xa5')](_0x2970ed['where'],{'$and':_0x1a7554[_0xc814('0x86')][_0xc814('0xb4')]});}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]][_0xc814('0xb0')]({'where':_0x2970ed[_0xc814('0x84')]})['then'](function(_0x33fc3b){_0x5b65fb[_0xc814('0xb0')]=_0x33fc3b;if(_0x1a7554[_0xc814('0x86')][_0xc814('0xab')]){if(_0x10e33a['childModel']==='CmContact'){_0x2970ed[_0xc814('0xb5')]=[{'model':_0x1ed0d9[_0xc814('0xb6')],'as':_0xc814('0xb7'),'attributes':['id',_0xc814('0xd'),'color'],'required':_0x1a7554['query'][_0xc814('0xb8')]?!![]:![]},{'model':_0x1ed0d9[_0xc814('0xb6')],'as':_0xc814('0xb9'),'attributes':['id','name','color'],'through':_0x1a7554[_0xc814('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x1a7554[_0xc814('0x86')][_0xc814('0xb8')]||undefined}}:{},'required':_0x1a7554[_0xc814('0x86')]['tag']?!![]:![]}];}else{_0x2970ed[_0xc814('0xb5')]=[{'all':!![]}];}}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]]['findAll'](_0x2970ed);})[_0xc814('0xb')](function(_0x2bdacf){_0x5b65fb[_0xc814('0xb1')]=_0x2bdacf;if(_0x35d196===_0xc814('0x32')&&_0x1a7554[_0xc814('0x86')][_0xc814('0xba')]===_0xc814('0xbb')){var _0x1fe2ac=[];for(var _0x348e5b=0x0;_0x348e5b<_0x5b65fb['rows'][_0xc814('0x95')];_0x348e5b++){_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xbc'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac['push'](_0x36001d(_0xc814('0xbe'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xbf'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac['push'](_0x36001d(_0xc814('0xc0'),_0x5b65fb['rows'][_0x348e5b]['dataValues']));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xc1'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xc2'),_0x5b65fb['rows'][_0x348e5b][_0xc814('0xbd')]));}return Promise[_0xc814('0x93')](_0x1fe2ac)[_0xc814('0xb')](function(){return _0x5b65fb;});}return _0x5b65fb;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 88310af..6ed4550 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 _0xad5f=['code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','then','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xad5f,0x1a8));var _0xfad5=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0xad5f[_0x55cc58];return _0x26062e;};'use strict';var _=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var moment=require(_0xfad5('0x2'));var BPromise=require(_0xfad5('0x3'));var rs=require(_0xfad5('0x4'));var fs=require('fs');var Redis=require(_0xfad5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfad5('0x6'));var logger=require(_0xfad5('0x7'))(_0xfad5('0x8'));var config=require(_0xfad5('0x9'));var jayson=require(_0xfad5('0xa'));var client=jayson[_0xfad5('0xb')][_0xfad5('0xc')]({'port':0x232a});config['redis']=_[_0xfad5('0xd')](config[_0xfad5('0xe')],{'host':_0xfad5('0xf'),'port':0x18eb});var socket=require(_0xfad5('0x10'))(new Redis(config['redis']));require(_0xfad5('0x11'))[_0xfad5('0x12')](socket);function respondWithRpcPromise(_0x35e8d3,_0x84b640,_0x1baeb8){return new BPromise(function(_0x154840,_0x23d032){return client['request'](_0x35e8d3,_0x1baeb8)[_0xfad5('0x13')](function(_0x3dd0f7){logger[_0xfad5('0x14')]('UserProfile,\x20%s,\x20%s',_0x84b640,'request\x20sent');logger[_0xfad5('0x15')](_0xfad5('0x16'),_0x84b640,_0xfad5('0x17'),JSON[_0xfad5('0x18')](_0x3dd0f7));if(_0x3dd0f7[_0xfad5('0x19')]){if(_0x3dd0f7['error'][_0xfad5('0x1a')]===0x1f4){logger[_0xfad5('0x19')](_0xfad5('0x1b'),_0x84b640,_0x3dd0f7[_0xfad5('0x19')][_0xfad5('0x1c')]);return _0x23d032(_0x3dd0f7[_0xfad5('0x19')][_0xfad5('0x1c')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x84b640,_0x3dd0f7[_0xfad5('0x19')][_0xfad5('0x1c')]);return _0x154840(_0x3dd0f7[_0xfad5('0x19')][_0xfad5('0x1c')]);}else{logger[_0xfad5('0x14')](_0xfad5('0x1b'),_0x84b640,_0xfad5('0x17'));_0x154840(_0x3dd0f7[_0xfad5('0x1d')][_0xfad5('0x1c')]);}})['catch'](function(_0x492ab7){logger[_0xfad5('0x19')](_0xfad5('0x1b'),_0x84b640,_0x492ab7);_0x23d032(_0x492ab7);});});} \ No newline at end of file +var _0x8daf=['request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4addf8,_0x49d9b8){var _0x2ce2da=function(_0x4f66ef){while(--_0x4f66ef){_0x4addf8['push'](_0x4addf8['shift']());}};_0x2ce2da(++_0x49d9b8);}(_0x8daf,0x15c));var _0xf8da=function(_0x41594f,_0x32bc97){_0x41594f=_0x41594f-0x0;var _0x41a1ab=_0x8daf[_0x41594f];return _0x41a1ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8da('0x0'));var fs=require('fs');var Redis=require(_0xf8da('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8da('0x2'));var logger=require(_0xf8da('0x3'))(_0xf8da('0x4'));var config=require(_0xf8da('0x5'));var jayson=require(_0xf8da('0x6'));var client=jayson[_0xf8da('0x7')][_0xf8da('0x8')]({'port':0x232a});config[_0xf8da('0x9')]=_[_0xf8da('0xa')](config['redis'],{'host':_0xf8da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8da('0x9')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x2f16ba,_0x44dabc,_0xbd4f48){return new BPromise(function(_0x408b04,_0x4463eb){return client[_0xf8da('0xc')](_0x2f16ba,_0xbd4f48)[_0xf8da('0xd')](function(_0x31193e){logger['info'](_0xf8da('0xe'),_0x44dabc,_0xf8da('0xf'));logger[_0xf8da('0x10')](_0xf8da('0x11'),_0x44dabc,'request\x20sent',JSON[_0xf8da('0x12')](_0x31193e));if(_0x31193e['error']){if(_0x31193e[_0xf8da('0x13')][_0xf8da('0x14')]===0x1f4){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')]['message']);return _0x4463eb(_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);}logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);return _0x408b04(_0x31193e[_0xf8da('0x13')]['message']);}else{logger[_0xf8da('0x16')]('UserProfile,\x20%s,\x20%s',_0x44dabc,'request\x20sent');_0x408b04(_0x31193e[_0xf8da('0x17')][_0xf8da('0x15')]);}})['catch'](function(_0x3e427){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x3e427);_0x4463eb(_0x3e427);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 596ce71..3437c4d 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 _0x71c5=['removeListener','userProfile:','./userProfile.events','save','remove'];(function(_0x3ef99f,_0x2b54f6){var _0x4cd714=function(_0x44611a){while(--_0x44611a){_0x3ef99f['push'](_0x3ef99f['shift']());}};_0x4cd714(++_0x2b54f6);}(_0x71c5,0x115));var _0x571c=function(_0x153145,_0x38ea92){_0x153145=_0x153145-0x0;var _0x5dea59=_0x71c5[_0x153145];return _0x5dea59;};'use strict';var UserProfileEvents=require(_0x571c('0x0'));var events=[_0x571c('0x1'),_0x571c('0x2'),'update'];function createListener(_0x10a303,_0x2a95ad){return function(_0x4b0297){_0x2a95ad['emit'](_0x10a303,_0x4b0297);};}function removeListener(_0x28a18f,_0x4c72f1){return function(){UserProfileEvents[_0x571c('0x3')](_0x28a18f,_0x4c72f1);};}exports['register']=function(_0x488ef5){for(var _0x86cc10=0x0,_0x27b929=events['length'];_0x86cc10<_0x27b929;_0x86cc10++){var _0x2ea9c7=events[_0x86cc10];var _0x4facad=createListener(_0x571c('0x4')+_0x2ea9c7,_0x488ef5);UserProfileEvents['on'](_0x2ea9c7,_0x4facad);}}; \ No newline at end of file +var _0x6bae=['register','length','userProfile:','./userProfile.events','emit','removeListener'];(function(_0x14f135,_0x2acbc3){var _0x282598=function(_0x3b6451){while(--_0x3b6451){_0x14f135['push'](_0x14f135['shift']());}};_0x282598(++_0x2acbc3);}(_0x6bae,0x15f));var _0xe6ba=function(_0xf66018,_0x43a4ea){_0xf66018=_0xf66018-0x0;var _0x2136df=_0x6bae[_0xf66018];return _0x2136df;};'use strict';var UserProfileEvents=require(_0xe6ba('0x0'));var events=['save','remove','update'];function createListener(_0x50c1c1,_0x4951fd){return function(_0x37f005){_0x4951fd[_0xe6ba('0x1')](_0x50c1c1,_0x37f005);};}function removeListener(_0x18765d,_0x3e4404){return function(){UserProfileEvents[_0xe6ba('0x2')](_0x18765d,_0x3e4404);};}exports[_0xe6ba('0x3')]=function(_0x5e1292){for(var _0x37c31b=0x0,_0x21c3f4=events[_0xe6ba('0x4')];_0x37c31b<_0x21c3f4;_0x37c31b++){var _0x27504e=events[_0x37c31b];var _0x4eee69=createListener(_0xe6ba('0x5')+_0x27504e,_0x5e1292);UserProfileEvents['on'](_0x27504e,_0x4eee69);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 5c8a090..a3fefe5 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 _0x1774=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x3127b4,_0x3fe7c6){var _0x2957ac=function(_0x13b1d8){while(--_0x13b1d8){_0x3127b4['push'](_0x3127b4['shift']());}};_0x2957ac(++_0x3fe7c6);}(_0x1774,0xe9));var _0x4177=function(_0x5d4151,_0x54f8dd){_0x5d4151=_0x5d4151-0x0;var _0x1b3198=_0x1774[_0x5d4151];return _0x1b3198;};'use strict';var multer=require(_0x4177('0x0'));var util=require('util');var path=require(_0x4177('0x1'));var timeout=require(_0x4177('0x2'));var express=require(_0x4177('0x3'));var router=express[_0x4177('0x4')]();var fs_extra=require(_0x4177('0x5'));var auth=require(_0x4177('0x6'));var interaction=require(_0x4177('0x7'));var config=require(_0x4177('0x8'));var controller=require(_0x4177('0x9'));router[_0x4177('0xa')]('/',auth[_0x4177('0xb')](),controller[_0x4177('0xc')]);router[_0x4177('0xa')](_0x4177('0xd'),auth[_0x4177('0xb')](),controller['describe']);router[_0x4177('0xa')](_0x4177('0xe'),auth[_0x4177('0xb')](),controller['show']);router[_0x4177('0xf')]('/',auth[_0x4177('0xb')](),controller[_0x4177('0x10')]);router[_0x4177('0x11')](_0x4177('0xe'),auth[_0x4177('0xb')](),controller[_0x4177('0x12')]);router['delete'](_0x4177('0xe'),auth[_0x4177('0xb')](),controller[_0x4177('0x13')]);module[_0x4177('0x14')]=router; \ No newline at end of file +var _0xb33c=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb33c,0x168));var _0xcb33=function(_0xdb78b6,_0x4b95c4){_0xdb78b6=_0xdb78b6-0x0;var _0x48b7b7=_0xb33c[_0xdb78b6];return _0x48b7b7;};'use strict';var multer=require(_0xcb33('0x0'));var util=require(_0xcb33('0x1'));var path=require(_0xcb33('0x2'));var timeout=require(_0xcb33('0x3'));var express=require(_0xcb33('0x4'));var router=express[_0xcb33('0x5')]();var fs_extra=require(_0xcb33('0x6'));var auth=require(_0xcb33('0x7'));var interaction=require(_0xcb33('0x8'));var config=require('../../config/environment');var controller=require(_0xcb33('0x9'));router[_0xcb33('0xa')]('/',auth[_0xcb33('0xb')](),controller[_0xcb33('0xc')]);router[_0xcb33('0xa')]('/describe',auth[_0xcb33('0xb')](),controller[_0xcb33('0xd')]);router['get'](_0xcb33('0xe'),auth['isAuthenticated'](),controller[_0xcb33('0xf')]);router[_0xcb33('0x10')]('/',auth[_0xcb33('0xb')](),controller[_0xcb33('0x11')]);router[_0xcb33('0x12')](_0xcb33('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xcb33('0x13')](_0xcb33('0xe'),auth[_0xcb33('0xb')](),controller[_0xcb33('0x14')]);module[_0xcb33('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 27ed84d..f626b76 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 _0x5ee3=['exports','STRING','INTEGER','sequelize'];(function(_0x14ae4f,_0x297d3e){var _0x38debc=function(_0x4560ba){while(--_0x4560ba){_0x14ae4f['push'](_0x14ae4f['shift']());}};_0x38debc(++_0x297d3e);}(_0x5ee3,0xab));var _0x35ee=function(_0x238837,_0xe5f1d9){_0x238837=_0x238837-0x0;var _0x33b3c0=_0x5ee3[_0x238837];return _0x33b3c0;};'use strict';var Sequelize=require(_0x35ee('0x0'));module[_0x35ee('0x1')]={'name':{'type':Sequelize[_0x35ee('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x35ee('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x35ee('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5e22=['INTEGER','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5e22,0xa9));var _0x25e2=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x5e22[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x25e2('0x0'));module[_0x25e2('0x1')]={'name':{'type':Sequelize[_0x25e2('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x25e2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x25e2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index e15c052..0bfe295 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 _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileResource','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x2e1665,_0x42c2f4){var _0x1f1ca1=function(_0x513edf){while(--_0x513edf){_0x2e1665['push'](_0x2e1665['shift']());}};_0x1f1ca1(++_0x42c2f4);}(_0xef0f,0x168));var _0xfef0=function(_0x4b2929,_0x349763){_0x4b2929=_0x4b2929-0x0;var _0x4ab4ad=_0xef0f[_0x4b2929];return _0x4ab4ad;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['UserProfileResource']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file +var _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','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','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','UserProfileResource','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x2281d4,_0x1dc3f5){var _0x171e1d=function(_0x4d39f6){while(--_0x4d39f6){_0x2281d4['push'](_0x2281d4['shift']());}};_0x171e1d(++_0x1dc3f5);}(_0xf61e,0x191));var _0xef61=function(_0x590678,_0x4d09d7){_0x590678=_0x590678-0x0;var _0x38c01c=_0xf61e[_0x590678];return _0x38c01c;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['UserProfileResource']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['UserProfileResource'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index d9775f1..34aa7ba 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 _0x8c33=['resourceId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x3d410c,_0x53298c){var _0x321c96=function(_0x3cb502){while(--_0x3cb502){_0x3d410c['push'](_0x3d410c['shift']());}};_0x321c96(++_0x53298c);}(_0x8c33,0x7f));var _0x38c3=function(_0x20ba15,_0x3fb4a9){_0x20ba15=_0x20ba15-0x0;var _0x32a55c=_0x8c33[_0x20ba15];return _0x32a55c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x38c3('0x0'))(_0x38c3('0x1'));var moment=require(_0x38c3('0x2'));var BPromise=require(_0x38c3('0x3'));var rp=require(_0x38c3('0x4'));var fs=require('fs');var path=require(_0x38c3('0x5'));var rimraf=require(_0x38c3('0x6'));var config=require(_0x38c3('0x7'));var attributes=require(_0x38c3('0x8'));module['exports']=function(_0x157815,_0x662a8d){return _0x157815[_0x38c3('0x9')](_0x38c3('0xa'),attributes,{'tableName':_0x38c3('0xb'),'paranoid':![],'indexes':[{'name':_0x38c3('0xc'),'fields':[_0x38c3('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff5=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0x4e1331,_0x530883){var _0x416406=function(_0x3fe01f){while(--_0x3fe01f){_0x4e1331['push'](_0x4e1331['shift']());}};_0x416406(++_0x530883);}(_0x8ff5,0x6d));var _0x58ff=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8ff5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x58ff('0x0'));var util=require(_0x58ff('0x1'));var logger=require(_0x58ff('0x2'))(_0x58ff('0x3'));var moment=require('moment');var BPromise=require(_0x58ff('0x4'));var rp=require(_0x58ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58ff('0x6'));var config=require(_0x58ff('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x58ff('0x8')]=function(_0x375563,_0x9b6f05){return _0x375563[_0x58ff('0x9')](_0x58ff('0xa'),attributes,{'tableName':_0x58ff('0xb'),'paranoid':![],'indexes':[{'name':_0x58ff('0xc'),'fields':['resourceId',_0x58ff('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 5cfeb2f..0093780 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 _0xb301=['info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error','UserProfileResource,\x20%s,\x20%s','message','catch','moment','bluebird','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x3f29cd,_0x32f142){var _0x3e6a52=function(_0x4e774c){while(--_0x4e774c){_0x3f29cd['push'](_0x3f29cd['shift']());}};_0x3e6a52(++_0x32f142);}(_0xb301,0xb2));var _0x1b30=function(_0x1423e7,_0x5b0dde){_0x1423e7=_0x1423e7-0x0;var _0x4221cc=_0xb301[_0x1423e7];return _0x4221cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b30('0x0'));var BPromise=require(_0x1b30('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b30('0x2'));var logger=require('../../config/logger')(_0x1b30('0x3'));var config=require(_0x1b30('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x1b30('0x5')][_0x1b30('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x56fbdb,_0x301872,_0x308ed7){return new BPromise(function(_0x8b10bb,_0x2b2784){return client[_0x1b30('0x7')](_0x56fbdb,_0x308ed7)[_0x1b30('0x8')](function(_0x2f0d3e){logger[_0x1b30('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x301872,'request\x20sent');logger[_0x1b30('0xa')](_0x1b30('0xb'),_0x301872,_0x1b30('0xc'),JSON['stringify'](_0x2f0d3e));if(_0x2f0d3e[_0x1b30('0xd')]){if(_0x2f0d3e['error']['code']===0x1f4){logger[_0x1b30('0xd')](_0x1b30('0xe'),_0x301872,_0x2f0d3e['error'][_0x1b30('0xf')]);return _0x2b2784(_0x2f0d3e[_0x1b30('0xd')]['message']);}logger['error'](_0x1b30('0xe'),_0x301872,_0x2f0d3e[_0x1b30('0xd')][_0x1b30('0xf')]);return _0x8b10bb(_0x2f0d3e[_0x1b30('0xd')][_0x1b30('0xf')]);}else{logger[_0x1b30('0x9')](_0x1b30('0xe'),_0x301872,_0x1b30('0xc'));_0x8b10bb(_0x2f0d3e['result'][_0x1b30('0xf')]);}})[_0x1b30('0x10')](function(_0x4c4b39){logger[_0x1b30('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x301872,_0x4c4b39);_0x2b2784(_0x4c4b39);});});} \ No newline at end of file +var _0x3bb1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x3bb1,0xda));var _0x13bb=function(_0x15ae07,_0x4f9fef){_0x15ae07=_0x15ae07-0x0;var _0x384dd4=_0x3bb1[_0x15ae07];return _0x384dd4;};'use strict';var _=require(_0x13bb('0x0'));var util=require(_0x13bb('0x1'));var moment=require(_0x13bb('0x2'));var BPromise=require(_0x13bb('0x3'));var rs=require(_0x13bb('0x4'));var fs=require('fs');var Redis=require(_0x13bb('0x5'));var db=require(_0x13bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x13bb('0x7'))(_0x13bb('0x8'));var config=require(_0x13bb('0x9'));var jayson=require(_0x13bb('0xa'));var client=jayson[_0x13bb('0xb')][_0x13bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1003ef,_0x587a0a,_0x16d816){return new BPromise(function(_0x2f691e,_0x2b7d31){return client['request'](_0x1003ef,_0x16d816)[_0x13bb('0xd')](function(_0x57650b){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x587a0a,_0x13bb('0xe'));logger[_0x13bb('0xf')](_0x13bb('0x10'),_0x587a0a,_0x13bb('0xe'),JSON[_0x13bb('0x11')](_0x57650b));if(_0x57650b['error']){if(_0x57650b[_0x13bb('0x12')][_0x13bb('0x13')]===0x1f4){logger[_0x13bb('0x12')](_0x13bb('0x14'),_0x587a0a,_0x57650b['error'][_0x13bb('0x15')]);return _0x2b7d31(_0x57650b[_0x13bb('0x12')][_0x13bb('0x15')]);}logger[_0x13bb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x587a0a,_0x57650b[_0x13bb('0x12')][_0x13bb('0x15')]);return _0x2f691e(_0x57650b['error']['message']);}else{logger[_0x13bb('0x16')](_0x13bb('0x14'),_0x587a0a,'request\x20sent');_0x2f691e(_0x57650b[_0x13bb('0x17')]['message']);}})[_0x13bb('0x18')](function(_0x475dd5){logger[_0x13bb('0x12')](_0x13bb('0x14'),_0x587a0a,_0x475dd5);_0x2b7d31(_0x475dd5);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 7224575..9182b79 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 _0x2a8c=['get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x2a8c,0xb6));var _0xc2a8=function(_0x4b40e3,_0x1740ec){_0x4b40e3=_0x4b40e3-0x0;var _0x517497=_0x2a8c[_0x4b40e3];return _0x517497;};'use strict';var multer=require(_0xc2a8('0x0'));var util=require('util');var path=require(_0xc2a8('0x1'));var timeout=require(_0xc2a8('0x2'));var express=require(_0xc2a8('0x3'));var router=express[_0xc2a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc2a8('0x5'));var interaction=require(_0xc2a8('0x6'));var config=require('../../config/environment');var controller=require(_0xc2a8('0x7'));router[_0xc2a8('0x8')]('/',auth[_0xc2a8('0x9')](),controller[_0xc2a8('0xa')]);router[_0xc2a8('0x8')](_0xc2a8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc2a8('0x8')](_0xc2a8('0xc'),auth[_0xc2a8('0x9')](),controller[_0xc2a8('0xd')]);router[_0xc2a8('0xe')]('/',auth[_0xc2a8('0x9')](),controller['create']);router[_0xc2a8('0xf')]('/:id',auth[_0xc2a8('0x9')](),controller[_0xc2a8('0x10')]);router[_0xc2a8('0x11')](_0xc2a8('0xc'),auth[_0xc2a8('0x9')](),controller[_0xc2a8('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc1c3=['/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get'];(function(_0x490298,_0x13f61a){var _0x24cdea=function(_0x48377a){while(--_0x48377a){_0x490298['push'](_0x490298['shift']());}};_0x24cdea(++_0x13f61a);}(_0xc1c3,0x88));var _0x3c1c=function(_0x9ac182,_0x4fecb4){_0x9ac182=_0x9ac182-0x0;var _0x22378e=_0xc1c3[_0x9ac182];return _0x22378e;};'use strict';var multer=require(_0x3c1c('0x0'));var util=require(_0x3c1c('0x1'));var path=require(_0x3c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x3c1c('0x4'));var auth=require(_0x3c1c('0x5'));var interaction=require(_0x3c1c('0x6'));var config=require(_0x3c1c('0x7'));var controller=require(_0x3c1c('0x8'));router['get']('/',auth[_0x3c1c('0x9')](),controller['index']);router[_0x3c1c('0xa')](_0x3c1c('0xb'),auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xc')]);router[_0x3c1c('0xa')]('/:id',auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xd')]);router[_0x3c1c('0xe')]('/',auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xf')]);router[_0x3c1c('0x10')](_0x3c1c('0x11'),auth[_0x3c1c('0x9')](),controller['update']);router[_0x3c1c('0x12')](_0x3c1c('0x11'),auth[_0x3c1c('0x9')](),controller[_0x3c1c('0x13')]);module[_0x3c1c('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5033a44..7bbb4ef 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 _0x5c00=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue'];(function(_0x3a3d04,_0x561c86){var _0x8560a2=function(_0x5ca564){while(--_0x5ca564){_0x3a3d04['push'](_0x3a3d04['shift']());}};_0x8560a2(++_0x561c86);}(_0x5c00,0x17e));var _0x05c0=function(_0x3ba748,_0x4b8fb9){_0x3ba748=_0x3ba748-0x0;var _0x5b04e2=_0x5c00[_0x3ba748];return _0x5b04e2;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'name':{'type':Sequelize[_0x05c0('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x05c0('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x05c0('0x2')],'set':function(_0x37b644){this[_0x05c0('0x5')]('crudPermissions',_0x37b644?_0x37b644[_0x05c0('0x6')](''):[]);},'get':function(){return this[_0x05c0('0x7')](_0x05c0('0x8'))?this[_0x05c0('0x7')]('crudPermissions')[_0x05c0('0x9')](''):[];}}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x177b1d,_0x2776d0){var _0x4800a5=function(_0x389728){while(--_0x389728){_0x177b1d['push'](_0x177b1d['shift']());}};_0x4800a5(++_0x2776d0);}(_0xe820,0xd2));var _0x0e82=function(_0x259764,_0x13848f){_0x259764=_0x259764-0x0;var _0x44c434=_0xe820[_0x259764];return _0x44c434;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0e82('0x1')],'set':function(_0x59b28d){this[_0x0e82('0x3')]('crudPermissions',_0x59b28d?_0x59b28d[_0x0e82('0x4')](''):[]);},'get':function(){return this[_0x0e82('0x5')](_0x0e82('0x6'))?this[_0x0e82('0x5')](_0x0e82('0x6'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 076f1fc..6a23e0f 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 _0xf626=['then','destroy','sendStatus','error','name','send','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','UserProfileSection','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x477678,_0x45746e){var _0x5139bb=function(_0x3f0ac5){while(--_0x3f0ac5){_0x477678['push'](_0x477678['shift']());}};_0x5139bb(++_0x45746e);}(_0xf626,0x1d5));var _0x6f62=function(_0x27a01d,_0x1f2bdb){_0x27a01d=_0x27a01d-0x0;var _0xd6188d=_0xf626[_0x27a01d];return _0xd6188d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f62('0x0'));var zipdir=require(_0x6f62('0x1'));var jsonpatch=require(_0x6f62('0x2'));var rp=require('request-promise');var moment=require(_0x6f62('0x3'));var BPromise=require(_0x6f62('0x4'));var Mustache=require('mustache');var util=require(_0x6f62('0x5'));var path=require('path');var sox=require(_0x6f62('0x6'));var csv=require(_0x6f62('0x7'));var ejs=require(_0x6f62('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f62('0x9'));var squel=require(_0x6f62('0xa'));var crypto=require(_0x6f62('0xb'));var jsforce=require(_0x6f62('0xc'));var deskjs=require(_0x6f62('0xd'));var toCsv=require(_0x6f62('0x7'));var querystring=require('querystring');var Papa=require(_0x6f62('0xe'));var Redis=require(_0x6f62('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6f62('0x10'));var as=require(_0x6f62('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f62('0x12'))(_0x6f62('0x13'));var utils=require(_0x6f62('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f62('0x15'))['db'];function respondWithStatusCode(_0x55bb36,_0x4e221e){_0x4e221e=_0x4e221e||0xcc;return function(_0x38b4d9){if(_0x38b4d9){return _0x55bb36['sendStatus'](_0x4e221e);}return _0x55bb36[_0x6f62('0x16')](_0x4e221e)[_0x6f62('0x17')]();};}function respondWithResult(_0x100c8c,_0x217b56){_0x217b56=_0x217b56||0xc8;return function(_0xca5cda){if(_0xca5cda){return _0x100c8c[_0x6f62('0x16')](_0x217b56)[_0x6f62('0x18')](_0xca5cda);}};}function respondWithFilteredResult(_0xc92a76,_0x4ece21){return function(_0xd4b3f7){if(_0xd4b3f7){var _0xd893e4=typeof _0x4ece21[_0x6f62('0x19')]===_0x6f62('0x1a')&&typeof _0x4ece21['limit']===_0x6f62('0x1a');var _0x4f929a=_0xd4b3f7[_0x6f62('0x1b')];var _0x59b6fc=_0xd893e4?0x0:_0x4ece21[_0x6f62('0x19')];var _0x2c80ed=_0xd893e4?_0xd4b3f7[_0x6f62('0x1b')]:_0x4ece21['offset']+_0x4ece21[_0x6f62('0x1c')];var _0x30b75e;if(_0x2c80ed>=_0x4f929a){_0x2c80ed=_0x4f929a;_0x30b75e=0xc8;}else{_0x30b75e=0xce;}_0xc92a76['status'](_0x30b75e);return _0xc92a76[_0x6f62('0x1d')](_0x6f62('0x1e'),_0x59b6fc+'-'+_0x2c80ed+'/'+_0x4f929a)[_0x6f62('0x18')](_0xd4b3f7);}return null;};}function patchUpdates(_0x451fa0){return function(_0x539be5){try{jsonpatch[_0x6f62('0x1f')](_0x539be5,_0x451fa0,!![]);}catch(_0x50ca59){return BPromise[_0x6f62('0x20')](_0x50ca59);}return _0x539be5[_0x6f62('0x21')]();};}function saveUpdates(_0x12a3f2,_0x28e3e1){return function(_0x101b1f){if(_0x101b1f){return _0x101b1f[_0x6f62('0x22')](_0x12a3f2)[_0x6f62('0x23')](function(_0x869d83){return _0x869d83;});}return null;};}function removeEntity(_0x50fd71,_0x2abdb1){return function(_0x297896){if(_0x297896){return _0x297896[_0x6f62('0x24')]()[_0x6f62('0x23')](function(){_0x50fd71[_0x6f62('0x16')](0xcc)[_0x6f62('0x17')]();});}};}function handleEntityNotFound(_0x8ad826,_0x390b3e){return function(_0x4d6f57){if(!_0x4d6f57){_0x8ad826[_0x6f62('0x25')](0x194);}return _0x4d6f57;};}function handleError(_0x4060e3,_0x5876e8){_0x5876e8=_0x5876e8||0x1f4;return function(_0x51b855){logger[_0x6f62('0x26')](_0x51b855['stack']);if(_0x51b855[_0x6f62('0x27')]){delete _0x51b855['name'];}_0x4060e3[_0x6f62('0x16')](_0x5876e8)[_0x6f62('0x28')](_0x51b855);};}exports['index']=function(_0x1eeb6d,_0x5502b0){var _0x81bbab={},_0x2986f7={},_0x340b3d={'count':0x0,'rows':[]};var _0x59d75e=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x9a2077){return{'name':_0x9a2077[_0x6f62('0x29')],'type':_0x9a2077[_0x6f62('0x2a')]['key']};});_0x2986f7[_0x6f62('0x2b')]=_[_0x6f62('0x2c')](_0x59d75e,_0x6f62('0x27'));_0x2986f7[_0x6f62('0x2d')]=_[_0x6f62('0x2e')](_0x1eeb6d[_0x6f62('0x2d')]);_0x2986f7[_0x6f62('0x2f')]=_[_0x6f62('0x30')](_0x2986f7[_0x6f62('0x2b')],_0x2986f7[_0x6f62('0x2d')]);_0x81bbab[_0x6f62('0x31')]=_[_0x6f62('0x30')](_0x2986f7[_0x6f62('0x2b')],qs[_0x6f62('0x32')](_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x32')]));_0x81bbab[_0x6f62('0x31')]=_0x81bbab[_0x6f62('0x31')][_0x6f62('0x33')]?_0x81bbab[_0x6f62('0x31')]:_0x2986f7[_0x6f62('0x2b')];if(!_0x1eeb6d[_0x6f62('0x2d')]['hasOwnProperty'](_0x6f62('0x34'))){_0x81bbab[_0x6f62('0x1c')]=qs['limit'](_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x1c')]);_0x81bbab[_0x6f62('0x19')]=qs[_0x6f62('0x19')](_0x1eeb6d['query'][_0x6f62('0x19')]);}_0x81bbab[_0x6f62('0x35')]=qs[_0x6f62('0x36')](_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x36')]);_0x81bbab[_0x6f62('0x37')]=qs['filters'](_['pick'](_0x1eeb6d['query'],_0x2986f7[_0x6f62('0x2f')]),_0x59d75e);if(_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x38')]){_0x81bbab[_0x6f62('0x37')]=_[_0x6f62('0x39')](_0x81bbab[_0x6f62('0x37')],{'$or':_[_0x6f62('0x2c')](_0x59d75e,function(_0x27084d){if(_0x27084d[_0x6f62('0x2a')]!==_0x6f62('0x3a')){var _0x298bc2={};_0x298bc2[_0x27084d['name']]={'$like':'%'+_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x38')]+'%'};return _0x298bc2;}})});}_0x81bbab=_[_0x6f62('0x39')]({},_0x81bbab,_0x1eeb6d[_0x6f62('0x3b')]);var _0xce3d27={'where':_0x81bbab[_0x6f62('0x37')]};return db['UserProfileSection'][_0x6f62('0x1b')](_0xce3d27)[_0x6f62('0x23')](function(_0x4716b9){_0x340b3d['count']=_0x4716b9;if(_0x1eeb6d[_0x6f62('0x2d')][_0x6f62('0x3c')]){_0x81bbab[_0x6f62('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0x6f62('0x3e')](_0x81bbab);})[_0x6f62('0x23')](function(_0x48b32e){_0x340b3d['rows']=_0x48b32e;return _0x340b3d;})['then'](respondWithFilteredResult(_0x5502b0,_0x81bbab))[_0x6f62('0x3f')](handleError(_0x5502b0,null));};exports[_0x6f62('0x40')]=function(_0x32d22f,_0x22f4ba){var _0x18b0e6={'raw':![],'where':{'id':_0x32d22f[_0x6f62('0x41')]['id']}},_0x555640={};_0x555640[_0x6f62('0x2b')]=_[_0x6f62('0x2e')](db[_0x6f62('0x42')][_0x6f62('0x43')]);_0x555640[_0x6f62('0x2d')]=_[_0x6f62('0x2e')](_0x32d22f[_0x6f62('0x2d')]);_0x555640[_0x6f62('0x2f')]=_[_0x6f62('0x30')](_0x555640['model'],_0x555640['query']);_0x18b0e6[_0x6f62('0x31')]=_[_0x6f62('0x30')](_0x555640['model'],qs[_0x6f62('0x32')](_0x32d22f[_0x6f62('0x2d')][_0x6f62('0x32')]));_0x18b0e6[_0x6f62('0x31')]=_0x18b0e6['attributes'][_0x6f62('0x33')]?_0x18b0e6['attributes']:_0x555640[_0x6f62('0x2b')];if(_0x32d22f[_0x6f62('0x2d')]['includeAll']){_0x18b0e6[_0x6f62('0x3d')]=[{'all':!![]}];}_0x18b0e6=_[_0x6f62('0x39')]({},_0x18b0e6,_0x32d22f[_0x6f62('0x3b')]);return db['UserProfileSection'][_0x6f62('0x44')](_0x18b0e6)[_0x6f62('0x23')](handleEntityNotFound(_0x22f4ba,null))[_0x6f62('0x23')](respondWithResult(_0x22f4ba,null))[_0x6f62('0x3f')](handleError(_0x22f4ba,null));};exports[_0x6f62('0x45')]=function(_0x585ef7,_0x162671){return db[_0x6f62('0x42')][_0x6f62('0x45')](_0x585ef7[_0x6f62('0x46')],{})[_0x6f62('0x23')](respondWithResult(_0x162671,0xc9))['catch'](handleError(_0x162671,null));};exports[_0x6f62('0x22')]=function(_0x7f8279,_0x5591fd){if(_0x7f8279[_0x6f62('0x46')]['id']){delete _0x7f8279[_0x6f62('0x46')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x7f8279[_0x6f62('0x41')]['id']}})[_0x6f62('0x23')](handleEntityNotFound(_0x5591fd,null))[_0x6f62('0x23')](saveUpdates(_0x7f8279['body'],null))[_0x6f62('0x23')](respondWithResult(_0x5591fd,null))[_0x6f62('0x3f')](handleError(_0x5591fd,null));};exports['destroy']=function(_0xce35f,_0x499f53){return db[_0x6f62('0x42')][_0x6f62('0x44')]({'where':{'id':_0xce35f[_0x6f62('0x41')]['id']}})['then'](handleEntityNotFound(_0x499f53,null))[_0x6f62('0x23')](removeEntity(_0x499f53,null))['catch'](handleError(_0x499f53,null));};exports[_0x6f62('0x47')]=function(_0x416670,_0x5ddb92){return db[_0x6f62('0x42')][_0x6f62('0x47')]()[_0x6f62('0x23')](respondWithResult(_0x5ddb92,null))[_0x6f62('0x3f')](handleError(_0x5ddb92,null));}; \ No newline at end of file +var _0x8c68=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','UserProfileSection','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c68,0x65));var _0x88c6=function(_0x208763,_0x528f91){_0x208763=_0x208763-0x0;var _0x2e1d57=_0x8c68[_0x208763];return _0x2e1d57;};'use strict';var emlformat=require(_0x88c6('0x0'));var rimraf=require(_0x88c6('0x1'));var zipdir=require(_0x88c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88c6('0x3'));var moment=require(_0x88c6('0x4'));var BPromise=require(_0x88c6('0x5'));var Mustache=require(_0x88c6('0x6'));var util=require(_0x88c6('0x7'));var path=require(_0x88c6('0x8'));var sox=require(_0x88c6('0x9'));var csv=require(_0x88c6('0xa'));var ejs=require(_0x88c6('0xb'));var fs=require('fs');var fs_extra=require(_0x88c6('0xc'));var _=require(_0x88c6('0xd'));var squel=require(_0x88c6('0xe'));var crypto=require('crypto');var jsforce=require(_0x88c6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x88c6('0x10'));var Papa=require('papaparse');var Redis=require(_0x88c6('0x11'));var authService=require(_0x88c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x88c6('0x13'));var hardwareService=require(_0x88c6('0x14'));var logger=require('../../config/logger')(_0x88c6('0x15'));var utils=require(_0x88c6('0x16'));var config=require(_0x88c6('0x17'));var licenseUtil=require(_0x88c6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee5737,_0x25e0ce){_0x25e0ce=_0x25e0ce||0xcc;return function(_0x42aad2){if(_0x42aad2){return _0xee5737[_0x88c6('0x19')](_0x25e0ce);}return _0xee5737[_0x88c6('0x1a')](_0x25e0ce)['end']();};}function respondWithResult(_0xab33b,_0x5321ec){_0x5321ec=_0x5321ec||0xc8;return function(_0x4f5b90){if(_0x4f5b90){return _0xab33b[_0x88c6('0x1a')](_0x5321ec)[_0x88c6('0x1b')](_0x4f5b90);}};}function respondWithFilteredResult(_0x24dfe9,_0x3f06e8){return function(_0x76313a){if(_0x76313a){var _0x3f8cc=typeof _0x3f06e8[_0x88c6('0x1c')]==='undefined'&&typeof _0x3f06e8['limit']===_0x88c6('0x1d');var _0x4c1c6c=_0x76313a[_0x88c6('0x1e')];var _0x2cafc0=_0x3f8cc?0x0:_0x3f06e8[_0x88c6('0x1c')];var _0x344886=_0x3f8cc?_0x76313a[_0x88c6('0x1e')]:_0x3f06e8[_0x88c6('0x1c')]+_0x3f06e8[_0x88c6('0x1f')];var _0x27b0b8;if(_0x344886>=_0x4c1c6c){_0x344886=_0x4c1c6c;_0x27b0b8=0xc8;}else{_0x27b0b8=0xce;}_0x24dfe9[_0x88c6('0x1a')](_0x27b0b8);return _0x24dfe9[_0x88c6('0x20')](_0x88c6('0x21'),_0x2cafc0+'-'+_0x344886+'/'+_0x4c1c6c)[_0x88c6('0x1b')](_0x76313a);}return null;};}function patchUpdates(_0x2b2a2a){return function(_0x1f48b0){try{jsonpatch[_0x88c6('0x22')](_0x1f48b0,_0x2b2a2a,!![]);}catch(_0x3c49c8){return BPromise[_0x88c6('0x23')](_0x3c49c8);}return _0x1f48b0[_0x88c6('0x24')]();};}function saveUpdates(_0x51b29f,_0x260a22){return function(_0x4aa6d3){if(_0x4aa6d3){return _0x4aa6d3[_0x88c6('0x25')](_0x51b29f)[_0x88c6('0x26')](function(_0x44bb1e){return _0x44bb1e;});}return null;};}function removeEntity(_0x2a57ec,_0xc3d259){return function(_0x3caff6){if(_0x3caff6){return _0x3caff6[_0x88c6('0x27')]()['then'](function(){_0x2a57ec[_0x88c6('0x1a')](0xcc)[_0x88c6('0x28')]();});}};}function handleEntityNotFound(_0x4adde9,_0x4f84fe){return function(_0x620397){if(!_0x620397){_0x4adde9['sendStatus'](0x194);}return _0x620397;};}function handleError(_0x1a94b5,_0x77baf7){_0x77baf7=_0x77baf7||0x1f4;return function(_0x1c3b02){logger[_0x88c6('0x29')](_0x1c3b02[_0x88c6('0x2a')]);if(_0x1c3b02[_0x88c6('0x2b')]){delete _0x1c3b02[_0x88c6('0x2b')];}_0x1a94b5[_0x88c6('0x1a')](_0x77baf7)[_0x88c6('0x2c')](_0x1c3b02);};}exports[_0x88c6('0x2d')]=function(_0x1c9950,_0xe4e273){var _0x589aec={},_0x31f2b6={},_0x37f6d4={'count':0x0,'rows':[]};var _0x1dd8a6=_[_0x88c6('0x2e')](db['UserProfileSection']['rawAttributes'],function(_0x38549e){return{'name':_0x38549e[_0x88c6('0x2f')],'type':_0x38549e[_0x88c6('0x30')][_0x88c6('0x31')]};});_0x31f2b6[_0x88c6('0x32')]=_[_0x88c6('0x2e')](_0x1dd8a6,_0x88c6('0x2b'));_0x31f2b6[_0x88c6('0x33')]=_[_0x88c6('0x34')](_0x1c9950[_0x88c6('0x33')]);_0x31f2b6[_0x88c6('0x35')]=_[_0x88c6('0x36')](_0x31f2b6[_0x88c6('0x32')],_0x31f2b6[_0x88c6('0x33')]);_0x589aec['attributes']=_['intersection'](_0x31f2b6[_0x88c6('0x32')],qs[_0x88c6('0x37')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x37')]));_0x589aec[_0x88c6('0x38')]=_0x589aec[_0x88c6('0x38')][_0x88c6('0x39')]?_0x589aec[_0x88c6('0x38')]:_0x31f2b6[_0x88c6('0x32')];if(!_0x1c9950['query'][_0x88c6('0x3a')]('nolimit')){_0x589aec[_0x88c6('0x1f')]=qs[_0x88c6('0x1f')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x1f')]);_0x589aec['offset']=qs['offset'](_0x1c9950['query']['offset']);}_0x589aec[_0x88c6('0x3b')]=qs[_0x88c6('0x3c')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3c')]);_0x589aec[_0x88c6('0x3d')]=qs[_0x88c6('0x35')](_[_0x88c6('0x3e')](_0x1c9950['query'],_0x31f2b6['filters']),_0x1dd8a6);if(_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3f')]){_0x589aec[_0x88c6('0x3d')]=_['merge'](_0x589aec[_0x88c6('0x3d')],{'$or':_[_0x88c6('0x2e')](_0x1dd8a6,function(_0x1e1302){if(_0x1e1302[_0x88c6('0x30')]!==_0x88c6('0x40')){var _0x4449bf={};_0x4449bf[_0x1e1302[_0x88c6('0x2b')]]={'$like':'%'+_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3f')]+'%'};return _0x4449bf;}})});}_0x589aec=_[_0x88c6('0x41')]({},_0x589aec,_0x1c9950[_0x88c6('0x42')]);var _0x3f91c4={'where':_0x589aec['where']};return db['UserProfileSection'][_0x88c6('0x1e')](_0x3f91c4)[_0x88c6('0x26')](function(_0x313f36){_0x37f6d4[_0x88c6('0x1e')]=_0x313f36;if(_0x1c9950['query']['includeAll']){_0x589aec['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x88c6('0x43')](_0x589aec);})['then'](function(_0x35ab13){_0x37f6d4[_0x88c6('0x44')]=_0x35ab13;return _0x37f6d4;})[_0x88c6('0x26')](respondWithFilteredResult(_0xe4e273,_0x589aec))[_0x88c6('0x45')](handleError(_0xe4e273,null));};exports['show']=function(_0x505a21,_0x4253a4){var _0x57ae3f={'raw':![],'where':{'id':_0x505a21[_0x88c6('0x46')]['id']}},_0x16e146={};_0x16e146[_0x88c6('0x32')]=_['keys'](db[_0x88c6('0x47')][_0x88c6('0x48')]);_0x16e146[_0x88c6('0x33')]=_[_0x88c6('0x34')](_0x505a21[_0x88c6('0x33')]);_0x16e146[_0x88c6('0x35')]=_[_0x88c6('0x36')](_0x16e146['model'],_0x16e146[_0x88c6('0x33')]);_0x57ae3f[_0x88c6('0x38')]=_[_0x88c6('0x36')](_0x16e146[_0x88c6('0x32')],qs[_0x88c6('0x37')](_0x505a21[_0x88c6('0x33')][_0x88c6('0x37')]));_0x57ae3f[_0x88c6('0x38')]=_0x57ae3f['attributes'][_0x88c6('0x39')]?_0x57ae3f['attributes']:_0x16e146[_0x88c6('0x32')];if(_0x505a21[_0x88c6('0x33')]['includeAll']){_0x57ae3f['include']=[{'all':!![]}];}_0x57ae3f=_[_0x88c6('0x41')]({},_0x57ae3f,_0x505a21['options']);return db[_0x88c6('0x47')][_0x88c6('0x49')](_0x57ae3f)[_0x88c6('0x26')](handleEntityNotFound(_0x4253a4,null))[_0x88c6('0x26')](respondWithResult(_0x4253a4,null))[_0x88c6('0x45')](handleError(_0x4253a4,null));};exports[_0x88c6('0x4a')]=function(_0x3ee1da,_0x22a176){return db[_0x88c6('0x47')][_0x88c6('0x4a')](_0x3ee1da[_0x88c6('0x4b')],{})['then'](respondWithResult(_0x22a176,0xc9))['catch'](handleError(_0x22a176,null));};exports[_0x88c6('0x25')]=function(_0x52123a,_0x94a6d7){if(_0x52123a['body']['id']){delete _0x52123a[_0x88c6('0x4b')]['id'];}return db[_0x88c6('0x47')][_0x88c6('0x49')]({'where':{'id':_0x52123a[_0x88c6('0x46')]['id']}})[_0x88c6('0x26')](handleEntityNotFound(_0x94a6d7,null))[_0x88c6('0x26')](saveUpdates(_0x52123a[_0x88c6('0x4b')],null))['then'](respondWithResult(_0x94a6d7,null))[_0x88c6('0x45')](handleError(_0x94a6d7,null));};exports[_0x88c6('0x27')]=function(_0x1089f2,_0xcf2365){return db[_0x88c6('0x47')]['find']({'where':{'id':_0x1089f2[_0x88c6('0x46')]['id']}})[_0x88c6('0x26')](handleEntityNotFound(_0xcf2365,null))[_0x88c6('0x26')](removeEntity(_0xcf2365,null))[_0x88c6('0x45')](handleError(_0xcf2365,null));};exports[_0x88c6('0x4c')]=function(_0x1d1bfd,_0x2176c2){return db[_0x88c6('0x47')][_0x88c6('0x4c')]()[_0x88c6('0x26')](respondWithResult(_0x2176c2,null))['catch'](handleError(_0x2176c2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 105e29a..61a752c 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 _0x689f=['user_profile_has_sections','sectionId','userProfileId','api','moment','path','../../config/environment','exports','UserProfileSection'];(function(_0x3de79b,_0x554cc9){var _0x2dd0af=function(_0x4bca2c){while(--_0x4bca2c){_0x3de79b['push'](_0x3de79b['shift']());}};_0x2dd0af(++_0x554cc9);}(_0x689f,0x81));var _0xf689=function(_0x1a0eb6,_0x1d61b0){_0x1a0eb6=_0x1a0eb6-0x0;var _0x1f47c3=_0x689f[_0x1a0eb6];return _0x1f47c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf689('0x0'));var moment=require(_0xf689('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf689('0x2'));var rimraf=require('rimraf');var config=require(_0xf689('0x3'));var attributes=require('./userProfileSection.attributes');module[_0xf689('0x4')]=function(_0x29c686,_0x118179){return _0x29c686['define'](_0xf689('0x5'),attributes,{'tableName':_0xf689('0x6'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf689('0x7'),_0xf689('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c7b=['exports','define','UserProfileSection','user_profile_has_sections','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes'];(function(_0x10a548,_0x26a534){var _0x2a8b3b=function(_0x540934){while(--_0x540934){_0x10a548['push'](_0x10a548['shift']());}};_0x2a8b3b(++_0x26a534);}(_0x3c7b,0x1e0));var _0xb3c7=function(_0x512a1c,_0x344f83){_0x512a1c=_0x512a1c-0x0;var _0x29074e=_0x3c7b[_0x512a1c];return _0x29074e;};'use strict';var _=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var logger=require(_0xb3c7('0x2'))(_0xb3c7('0x3'));var moment=require(_0xb3c7('0x4'));var BPromise=require(_0xb3c7('0x5'));var rp=require(_0xb3c7('0x6'));var fs=require('fs');var path=require(_0xb3c7('0x7'));var rimraf=require(_0xb3c7('0x8'));var config=require('../../config/environment');var attributes=require(_0xb3c7('0x9'));module[_0xb3c7('0xa')]=function(_0x67cac8,_0x43ae0b){return _0x67cac8[_0xb3c7('0xb')](_0xb3c7('0xc'),attributes,{'tableName':_0xb3c7('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 41886d8..fc80609 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 _0x2ee5=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x40ad6e,_0x3bfc26){var _0x4b3eaa=function(_0x4c7f39){while(--_0x4c7f39){_0x40ad6e['push'](_0x40ad6e['shift']());}};_0x4b3eaa(++_0x3bfc26);}(_0x2ee5,0x14b));var _0x52ee=function(_0x42c38d,_0x393918){_0x42c38d=_0x42c38d-0x0;var _0x155420=_0x2ee5[_0x42c38d];return _0x155420;};'use strict';var _=require(_0x52ee('0x0'));var util=require(_0x52ee('0x1'));var moment=require('moment');var BPromise=require(_0x52ee('0x2'));var rs=require(_0x52ee('0x3'));var fs=require('fs');var Redis=require(_0x52ee('0x4'));var db=require(_0x52ee('0x5'))['db'];var utils=require(_0x52ee('0x6'));var logger=require('../../config/logger')(_0x52ee('0x7'));var config=require(_0x52ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x52ee('0x9')][_0x52ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x525134,_0x445ef2,_0x18bbbe){return new BPromise(function(_0x172a64,_0x5d558d){return client[_0x52ee('0xb')](_0x525134,_0x18bbbe)['then'](function(_0x56b557){logger['info'](_0x52ee('0xc'),_0x445ef2,'request\x20sent');logger['debug'](_0x52ee('0xd'),_0x445ef2,_0x52ee('0xe'),JSON[_0x52ee('0xf')](_0x56b557));if(_0x56b557['error']){if(_0x56b557['error']['code']===0x1f4){logger[_0x52ee('0x10')](_0x52ee('0xc'),_0x445ef2,_0x56b557[_0x52ee('0x10')][_0x52ee('0x11')]);return _0x5d558d(_0x56b557[_0x52ee('0x10')]['message']);}logger[_0x52ee('0x10')](_0x52ee('0xc'),_0x445ef2,_0x56b557[_0x52ee('0x10')][_0x52ee('0x11')]);return _0x172a64(_0x56b557[_0x52ee('0x10')]['message']);}else{logger[_0x52ee('0x12')](_0x52ee('0xc'),_0x445ef2,_0x52ee('0xe'));_0x172a64(_0x56b557[_0x52ee('0x13')][_0x52ee('0x11')]);}})[_0x52ee('0x14')](function(_0x37a5ea){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x445ef2,_0x37a5ea);_0x5d558d(_0x37a5ea);});});} \ No newline at end of file +var _0x4627=['../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4627,0xa0));var _0x7462=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x4627[_0x1db251];return _0x56685a;};'use strict';var _=require(_0x7462('0x0'));var util=require(_0x7462('0x1'));var moment=require(_0x7462('0x2'));var BPromise=require(_0x7462('0x3'));var rs=require(_0x7462('0x4'));var fs=require('fs');var Redis=require(_0x7462('0x5'));var db=require(_0x7462('0x6'))['db'];var utils=require(_0x7462('0x7'));var logger=require(_0x7462('0x8'))(_0x7462('0x9'));var config=require('../../config/environment');var jayson=require(_0x7462('0xa'));var client=jayson[_0x7462('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ef92,_0x2160ad,_0x25faf8){return new BPromise(function(_0x2e0ba3,_0x287e17){return client[_0x7462('0xc')](_0x48ef92,_0x25faf8)[_0x7462('0xd')](function(_0x2d8757){logger[_0x7462('0xe')](_0x7462('0xf'),_0x2160ad,_0x7462('0x10'));logger[_0x7462('0x11')](_0x7462('0x12'),_0x2160ad,_0x7462('0x10'),JSON[_0x7462('0x13')](_0x2d8757));if(_0x2d8757[_0x7462('0x14')]){if(_0x2d8757[_0x7462('0x14')][_0x7462('0x15')]===0x1f4){logger[_0x7462('0x14')](_0x7462('0xf'),_0x2160ad,_0x2d8757[_0x7462('0x14')][_0x7462('0x16')]);return _0x287e17(_0x2d8757['error'][_0x7462('0x16')]);}logger[_0x7462('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x2160ad,_0x2d8757[_0x7462('0x14')][_0x7462('0x16')]);return _0x2e0ba3(_0x2d8757['error']['message']);}else{logger['info'](_0x7462('0xf'),_0x2160ad,_0x7462('0x10'));_0x2e0ba3(_0x2d8757['result'][_0x7462('0x16')]);}})[_0x7462('0x17')](function(_0x1e2bec){logger[_0x7462('0x14')](_0x7462('0xf'),_0x2160ad,_0x1e2bec);_0x287e17(_0x1e2bec);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bd75298..b7b9137 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x26b5cb,_0x15f879){var _0x3b2277=function(_0x12fe27){while(--_0x12fe27){_0x26b5cb['push'](_0x26b5cb['shift']());}};_0x3b2277(++_0x15f879);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x185067,_0x3881af){var _0x455b6e=function(_0x1e0494){while(--_0x1e0494){_0x185067['push'](_0x185067['shift']());}};_0x455b6e(++_0x3881af);}(_0xe706,0xa3));var _0x6e70=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xe706[_0x486f1d];return _0x5a2c2d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 402b485..2b88c28 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 _0x5fc3=['sequelize','exports'];(function(_0x18bd82,_0x4b53cc){var _0x465df6=function(_0x417a3a){while(--_0x417a3a){_0x18bd82['push'](_0x18bd82['shift']());}};_0x465df6(++_0x4b53cc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x5fc3[_0x487ab4];return _0x3bef77;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x297d=['sequelize'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x297d,0x157));var _0xd297=function(_0xfbc991,_0x67c37e){_0xfbc991=_0xfbc991-0x0;var _0xe60518=_0x297d[_0xfbc991];return _0xe60518;};'use strict';var Sequelize=require(_0xd297('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 68609af..1ee673e 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 _0x0af5=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4b63e5,_0x46b855){var _0x1f8150=function(_0x1c8b4b){while(--_0x1c8b4b){_0x4b63e5['push'](_0x4b63e5['shift']());}};_0x1f8150(++_0x46b855);}(_0x0af5,0x158));var _0x50af=function(_0x367080,_0x2a615b){_0x367080=_0x367080-0x0;var _0x5d9e21=_0x0af5[_0x367080];return _0x5d9e21;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xafc4,0x69));var _0x4afc=function(_0x358ac6,_0x5b0a50){_0x358ac6=_0x358ac6-0x0;var _0x20a09f=_0xafc4[_0x358ac6];return _0x20a09f;};'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('./userSmsQueue.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'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 fed1d87..53b44f3 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 _0x6ec2=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x27aa45,_0xfd9d54){var _0x32bbf9=function(_0x4df0ee){while(--_0x4df0ee){_0x27aa45['push'](_0x27aa45['shift']());}};_0x32bbf9(++_0xfd9d54);}(_0x6ec2,0x112));var _0x26ec=function(_0xa4401,_0xd36423){_0xa4401=_0xa4401-0x0;var _0x53ec1b=_0x6ec2[_0xa4401];return _0x53ec1b;};'use strict';var _=require('lodash');var util=require(_0x26ec('0x0'));var moment=require(_0x26ec('0x1'));var BPromise=require(_0x26ec('0x2'));var rs=require(_0x26ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26ec('0x4'))['db'];var utils=require(_0x26ec('0x5'));var logger=require(_0x26ec('0x6'))(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var jayson=require(_0x26ec('0x9'));var client=jayson[_0x26ec('0xa')][_0x26ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20c4fa,_0x4a9bd5,_0x231acc){return new BPromise(function(_0x53830f,_0x8e979b){return client[_0x26ec('0xc')](_0x20c4fa,_0x231acc)[_0x26ec('0xd')](function(_0x3b1d98){logger[_0x26ec('0xe')](_0x26ec('0xf'),_0x4a9bd5,_0x26ec('0x10'));logger[_0x26ec('0x11')](_0x26ec('0x12'),_0x4a9bd5,_0x26ec('0x10'),JSON[_0x26ec('0x13')](_0x3b1d98));if(_0x3b1d98[_0x26ec('0x14')]){if(_0x3b1d98['error'][_0x26ec('0x15')]===0x1f4){logger[_0x26ec('0x14')](_0x26ec('0xf'),_0x4a9bd5,_0x3b1d98[_0x26ec('0x14')][_0x26ec('0x16')]);return _0x8e979b(_0x3b1d98[_0x26ec('0x14')][_0x26ec('0x16')]);}logger[_0x26ec('0x14')](_0x26ec('0xf'),_0x4a9bd5,_0x3b1d98[_0x26ec('0x14')][_0x26ec('0x16')]);return _0x53830f(_0x3b1d98[_0x26ec('0x14')][_0x26ec('0x16')]);}else{logger[_0x26ec('0xe')](_0x26ec('0xf'),_0x4a9bd5,'request\x20sent');_0x53830f(_0x3b1d98[_0x26ec('0x17')][_0x26ec('0x16')]);}})['catch'](function(_0x129e37){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4a9bd5,_0x129e37);_0x8e979b(_0x129e37);});});} \ No newline at end of file +var _0x787f=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x3a0579,_0x17d535){var _0xa6faf3=function(_0x17a11b){while(--_0x17a11b){_0x3a0579['push'](_0x3a0579['shift']());}};_0xa6faf3(++_0x17d535);}(_0x787f,0x1ea));var _0xf787=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x787f[_0x51e79c];return _0x2467be;};'use strict';var _=require(_0xf787('0x0'));var util=require(_0xf787('0x1'));var moment=require(_0xf787('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf787('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf787('0x4'));var logger=require(_0xf787('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf787('0x6'));var client=jayson['client'][_0xf787('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57db75,_0x40f508,_0x1f367d){return new BPromise(function(_0x448fb6,_0x4373ed){return client[_0xf787('0x8')](_0x57db75,_0x1f367d)[_0xf787('0x9')](function(_0x3893e4){logger['info'](_0xf787('0xa'),_0x40f508,_0xf787('0xb'));logger[_0xf787('0xc')](_0xf787('0xd'),_0x40f508,_0xf787('0xb'),JSON[_0xf787('0xe')](_0x3893e4));if(_0x3893e4[_0xf787('0xf')]){if(_0x3893e4[_0xf787('0xf')]['code']===0x1f4){logger['error'](_0xf787('0xa'),_0x40f508,_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);return _0x4373ed(_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);}logger[_0xf787('0xf')](_0xf787('0xa'),_0x40f508,_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);return _0x448fb6(_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);}else{logger[_0xf787('0x11')](_0xf787('0xa'),_0x40f508,_0xf787('0xb'));_0x448fb6(_0x3893e4[_0xf787('0x12')][_0xf787('0x10')]);}})[_0xf787('0x13')](function(_0x3a0f32){logger[_0xf787('0xf')](_0xf787('0xa'),_0x40f508,_0x3a0f32);_0x4373ed(_0x3a0f32);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index d7a9421..83a96ec 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 _0x472d=['exports','INTEGER'];(function(_0x3cad6a,_0x150baf){var _0x3bd94d=function(_0x3fd619){while(--_0x3fd619){_0x3cad6a['push'](_0x3cad6a['shift']());}};_0x3bd94d(++_0x150baf);}(_0x472d,0x1e8));var _0xd472=function(_0x15d218,_0xdc1e25){_0x15d218=_0x15d218-0x0;var _0x5e940b=_0x472d[_0x15d218];return _0x5e940b;};'use strict';var Sequelize=require('sequelize');module[_0xd472('0x0')]={'UserId':{'type':Sequelize[_0xd472('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xd472('0x1')]}}; \ No newline at end of file +var _0xe3db=['INTEGER','sequelize'];(function(_0x2fdc55,_0x205f53){var _0x12d2a8=function(_0x575289){while(--_0x575289){_0x2fdc55['push'](_0x2fdc55['shift']());}};_0x12d2a8(++_0x205f53);}(_0xe3db,0x1c3));var _0xbe3d=function(_0x15fab1,_0x49e5e0){_0x15fab1=_0x15fab1-0x0;var _0x374ccd=_0xe3db[_0x15fab1];return _0x374ccd;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xbe3d('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index ee3245c..ad12f3c 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(_0xe2483b,_0x1a1cc1){var _0x3740b5=function(_0x28b96d){while(--_0x28b96d){_0xe2483b['push'](_0xe2483b['shift']());}};_0x3740b5(++_0x1a1cc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x209fd2,_0x3cc08a){var _0x21bcbb=function(_0x46d600){while(--_0x46d600){_0x209fd2['push'](_0x209fd2['shift']());}};_0x21bcbb(++_0x3cc08a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 e0b2436..fce8551 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(_0x42c3ec,_0x5dc907){var _0x5a89eb=function(_0x18f3ad){while(--_0x18f3ad){_0x42c3ec['push'](_0x42c3ec['shift']());}};_0x5a89eb(++_0x5dc907);}(_0xe706,0xa3));var _0x6e70=function(_0x52b828,_0x359d0f){_0x52b828=_0x52b828-0x0;var _0x2721d8=_0xe706[_0x52b828];return _0x2721d8;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d6bef,_0x25b68d){var _0x2b7826=function(_0x5c3a59){while(--_0x5c3a59){_0x5d6bef['push'](_0x5d6bef['shift']());}};_0x2b7826(++_0x25b68d);}(_0x70e0,0x17b));var _0x070e=function(_0x4cdffd,_0xa325f1){_0x4cdffd=_0x4cdffd-0x0;var _0xf31be6=_0x70e0[_0x4cdffd];return _0xf31be6;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 238107a..d41785a 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 _0xa205=['sequelize','exports','INTEGER'];(function(_0x58538f,_0x5d9925){var _0x21c344=function(_0x440a87){while(--_0x440a87){_0x58538f['push'](_0x58538f['shift']());}};_0x21c344(++_0x5d9925);}(_0xa205,0x177));var _0x5a20=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xa205[_0x1a8bbc];return _0x212fc2;};'use strict';var Sequelize=require(_0x5a20('0x0'));module[_0x5a20('0x1')]={'penalty':{'type':Sequelize[_0x5a20('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d5b=['exports','INTEGER'];(function(_0x3f64ba,_0x2afe32){var _0x2b5d08=function(_0x128ba8){while(--_0x128ba8){_0x3f64ba['push'](_0x3f64ba['shift']());}};_0x2b5d08(++_0x2afe32);}(_0x2d5b,0x1ce));var _0xb2d5=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x2d5b[_0x3403d5];return _0xf9df4f;};'use strict';var Sequelize=require('sequelize');module[_0xb2d5('0x0')]={'penalty':{'type':Sequelize[_0xb2d5('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 40ddba0..a5dfb06 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 _0x9f15=['request-promise','path','../../config/environment','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x347a49,_0x5655de){var _0x225847=function(_0xc034b){while(--_0xc034b){_0x347a49['push'](_0x347a49['shift']());}};_0x225847(++_0x5655de);}(_0x9f15,0x94));var _0x59f1=function(_0x1a89e4,_0x252986){_0x1a89e4=_0x1a89e4-0x0;var _0x25befe=_0x9f15[_0x1a89e4];return _0x25befe;};'use strict';var _=require(_0x59f1('0x0'));var util=require(_0x59f1('0x1'));var logger=require(_0x59f1('0x2'))(_0x59f1('0x3'));var moment=require(_0x59f1('0x4'));var BPromise=require(_0x59f1('0x5'));var rp=require(_0x59f1('0x6'));var fs=require('fs');var path=require(_0x59f1('0x7'));var rimraf=require('rimraf');var config=require(_0x59f1('0x8'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x3a294c,_0x40f1c6){return _0x3a294c['define'](_0x59f1('0x9'),attributes,{'tableName':_0x59f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd408=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xd408,0x113));var _0x8d40=function(_0x581abc,_0x55677e){_0x581abc=_0x581abc-0x0;var _0x192c82=_0xd408[_0x581abc];return _0x192c82;};'use strict';var _=require(_0x8d40('0x0'));var util=require(_0x8d40('0x1'));var logger=require('../../config/logger')(_0x8d40('0x2'));var moment=require(_0x8d40('0x3'));var BPromise=require(_0x8d40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d40('0x5'));var rimraf=require('rimraf');var config=require(_0x8d40('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x8d40('0x7')]=function(_0x48538e,_0x5a7259){return _0x48538e[_0x8d40('0x8')](_0x8d40('0x9'),attributes,{'tableName':_0x8d40('0xa'),'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 7124dc0..2fe7222 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 _0x575a=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x8d8168,_0x599a93){var _0x459175=function(_0x153687){while(--_0x153687){_0x8d8168['push'](_0x8d8168['shift']());}};_0x459175(++_0x599a93);}(_0x575a,0x19f));var _0xa575=function(_0xd98ca3,_0x38fbd9){_0xd98ca3=_0xd98ca3-0x0;var _0x35960d=_0x575a[_0xd98ca3];return _0x35960d;};'use strict';var _=require(_0xa575('0x0'));var util=require('util');var moment=require(_0xa575('0x1'));var BPromise=require(_0xa575('0x2'));var rs=require(_0xa575('0x3'));var fs=require('fs');var Redis=require(_0xa575('0x4'));var db=require(_0xa575('0x5'))['db'];var utils=require(_0xa575('0x6'));var logger=require(_0xa575('0x7'))(_0xa575('0x8'));var config=require('../../config/environment');var jayson=require(_0xa575('0x9'));var client=jayson[_0xa575('0xa')][_0xa575('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56a5e1,_0xdb9529,_0x106e52){return new BPromise(function(_0x5a16da,_0x2a6f8a){return client[_0xa575('0xc')](_0x56a5e1,_0x106e52)[_0xa575('0xd')](function(_0x2a2243){logger[_0xa575('0xe')](_0xa575('0xf'),_0xdb9529,_0xa575('0x10'));logger[_0xa575('0x11')](_0xa575('0x12'),_0xdb9529,_0xa575('0x10'),JSON[_0xa575('0x13')](_0x2a2243));if(_0x2a2243[_0xa575('0x14')]){if(_0x2a2243[_0xa575('0x14')]['code']===0x1f4){logger[_0xa575('0x14')](_0xa575('0xf'),_0xdb9529,_0x2a2243[_0xa575('0x14')][_0xa575('0x15')]);return _0x2a6f8a(_0x2a2243['error'][_0xa575('0x15')]);}logger['error'](_0xa575('0xf'),_0xdb9529,_0x2a2243[_0xa575('0x14')][_0xa575('0x15')]);return _0x5a16da(_0x2a2243['error'][_0xa575('0x15')]);}else{logger[_0xa575('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0xdb9529,'request\x20sent');_0x5a16da(_0x2a2243['result'][_0xa575('0x15')]);}})[_0xa575('0x16')](function(_0x4df71e){logger[_0xa575('0x14')](_0xa575('0xf'),_0xdb9529,_0x4df71e);_0x2a6f8a(_0x4df71e);});});} \ No newline at end of file +var _0xa6eb=['stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x189e42,_0x280d1a){var _0x2c99ee=function(_0x58e168){while(--_0x58e168){_0x189e42['push'](_0x189e42['shift']());}};_0x2c99ee(++_0x280d1a);}(_0xa6eb,0x1e9));var _0xba6e=function(_0x4cb93c,_0x40ddc1){_0x4cb93c=_0x4cb93c-0x0;var _0x3107af=_0xa6eb[_0x4cb93c];return _0x3107af;};'use strict';var _=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var moment=require(_0xba6e('0x2'));var BPromise=require('bluebird');var rs=require(_0xba6e('0x3'));var fs=require('fs');var Redis=require(_0xba6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba6e('0x5'));var logger=require('../../config/logger')(_0xba6e('0x6'));var config=require(_0xba6e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba6e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe94bfb,_0x36f841,_0x1a2583){return new BPromise(function(_0x47a48d,_0x2ef2cc){return client[_0xba6e('0x9')](_0xe94bfb,_0x1a2583)[_0xba6e('0xa')](function(_0x1421c3){logger['info'](_0xba6e('0xb'),_0x36f841,_0xba6e('0xc'));logger[_0xba6e('0xd')](_0xba6e('0xe'),_0x36f841,_0xba6e('0xc'),JSON[_0xba6e('0xf')](_0x1421c3));if(_0x1421c3[_0xba6e('0x10')]){if(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x11')]===0x1f4){logger[_0xba6e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x36f841,_0x1421c3['error']['message']);return _0x2ef2cc(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x12')]);}logger[_0xba6e('0x10')](_0xba6e('0xb'),_0x36f841,_0x1421c3['error'][_0xba6e('0x12')]);return _0x47a48d(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x12')]);}else{logger[_0xba6e('0x13')](_0xba6e('0xb'),_0x36f841,'request\x20sent');_0x47a48d(_0x1421c3['result'][_0xba6e('0x12')]);}})[_0xba6e('0x14')](function(_0x588d58){logger[_0xba6e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x36f841,_0x588d58);_0x2ef2cc(_0x588d58);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 399667b..70bb517 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4247b0,_0x399f8f){var _0x5eaf61=function(_0x178dba){while(--_0x178dba){_0x4247b0['push'](_0x4247b0['shift']());}};_0x5eaf61(++_0x399f8f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xcb91[_0x114b7c];return _0x47185f;};'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(_0x96e457,_0x44f424){var _0x186bd0=function(_0x133bd4){while(--_0x133bd4){_0x96e457['push'](_0x96e457['shift']());}};_0x186bd0(++_0x44f424);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xcb91[_0x3e182f];return _0x23edc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 85c4195..29c256f 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 _0x6f01=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6f01,0x1ee));var _0x16f0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6f01[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x16f0('0x0'));module[_0x16f0('0x1')]={'uniqueid':{'type':Sequelize[_0x16f0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x16f0('0x3')},'membername':{'type':Sequelize[_0x16f0('0x4')],'allowNull':![],'comment':_0x16f0('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x16f0('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x16f0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x16f0('0x4')],'allowNull':![],'unique':_0x16f0('0x5'),'comment':_0x16f0('0x3')},'penalty':{'type':Sequelize[_0x16f0('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x16f0('0x2')](0xb),'defaultValue':0x0,'comment':_0x16f0('0x3')}}; \ No newline at end of file +var _0x356e=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x356e,0x1dc));var _0xe356=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x356e[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe356('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe356('0x1')},'membername':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'comment':_0xe356('0x1')},'UserId':{'type':Sequelize[_0xe356('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xe356('0x1')},'VoiceQueueId':{'type':Sequelize[_0xe356('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'unique':_0xe356('0x3'),'comment':_0xe356('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xe356('0x1')},'paused':{'type':Sequelize[_0xe356('0x0')](0xb),'defaultValue':0x0,'comment':_0xe356('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 5a56140..ee06b31 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 _0x8e84=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x3081db,_0x4a4c32){var _0x4ebbf9=function(_0x236f7c){while(--_0x236f7c){_0x3081db['push'](_0x3081db['shift']());}};_0x4ebbf9(++_0x4a4c32);}(_0x8e84,0x1e7));var _0x48e8=function(_0x3bfa0c,_0x5bbbab){_0x3bfa0c=_0x3bfa0c-0x0;var _0x3e4899=_0x8e84[_0x3bfa0c];return _0x3e4899;};'use strict';var EventEmitter=require(_0x48e8('0x0'));var UserVoiceQueueRt=require(_0x48e8('0x1'))['db'][_0x48e8('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x48e8('0x3')](0x0);var events={'afterCreate':_0x48e8('0x4'),'afterUpdate':_0x48e8('0x5'),'afterDestroy':_0x48e8('0x6')};function emitEvent(_0x7159e3){return function(_0x50fc7a,_0x4abb65,_0x2cfcbf){UserVoiceQueueRtEvents['emit'](_0x7159e3+':'+_0x50fc7a['id'],_0x50fc7a);UserVoiceQueueRtEvents['emit'](_0x7159e3,_0x50fc7a);_0x2cfcbf(null);};}for(var e in events){if(events[_0x48e8('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x48e8('0x8')](e,emitEvent(event));}}module[_0x48e8('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf17e=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x84fa15,_0x370960){var _0x125cfc=function(_0x1106f6){while(--_0x1106f6){_0x84fa15['push'](_0x84fa15['shift']());}};_0x125cfc(++_0x370960);}(_0xf17e,0x7c));var _0xef17=function(_0x93a5f6,_0x3cb97e){_0x93a5f6=_0x93a5f6-0x0;var _0x305f74=_0xf17e[_0x93a5f6];return _0x305f74;};'use strict';var EventEmitter=require(_0xef17('0x0'));var UserVoiceQueueRt=require(_0xef17('0x1'))['db'][_0xef17('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xef17('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef17('0x4'),'afterDestroy':_0xef17('0x5')};function emitEvent(_0x437556){return function(_0xcf5993,_0x5b2dd5,_0x431ba1){UserVoiceQueueRtEvents['emit'](_0x437556+':'+_0xcf5993['id'],_0xcf5993);UserVoiceQueueRtEvents[_0xef17('0x6')](_0x437556,_0xcf5993);_0x431ba1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xef17('0x7')](e,emitEvent(event));}}module[_0xef17('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c477464..7db48bf 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 _0x4803=['exports','define','UserVoiceQueueRt','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1ed0a7,_0x535bbb){var _0x3cc528=function(_0x2eeebd){while(--_0x2eeebd){_0x1ed0a7['push'](_0x1ed0a7['shift']());}};_0x3cc528(++_0x535bbb);}(_0x4803,0xb3));var _0x3480=function(_0x36c3aa,_0x10854c){_0x36c3aa=_0x36c3aa-0x0;var _0x4f4f40=_0x4803[_0x36c3aa];return _0x4f4f40;};'use strict';var _=require(_0x3480('0x0'));var util=require('util');var logger=require(_0x3480('0x1'))(_0x3480('0x2'));var moment=require(_0x3480('0x3'));var BPromise=require(_0x3480('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3480('0x5'));var rimraf=require(_0x3480('0x6'));var config=require(_0x3480('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x3480('0x8')]=function(_0x27992a,_0x34e1d2){return _0x27992a[_0x3480('0x9')](_0x3480('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc324=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39b307,_0x485a20){var _0xc39d31=function(_0x2d638d){while(--_0x2d638d){_0x39b307['push'](_0x39b307['shift']());}};_0xc39d31(++_0x485a20);}(_0xc324,0x7d));var _0x4c32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc324[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c32('0x0'));var util=require(_0x4c32('0x1'));var logger=require(_0x4c32('0x2'))(_0x4c32('0x3'));var moment=require(_0x4c32('0x4'));var BPromise=require(_0x4c32('0x5'));var rp=require(_0x4c32('0x6'));var fs=require('fs');var path=require(_0x4c32('0x7'));var rimraf=require(_0x4c32('0x8'));var config=require(_0x4c32('0x9'));var attributes=require(_0x4c32('0xa'));module[_0x4c32('0xb')]=function(_0x333b3c,_0x3f1f9f){return _0x333b3c[_0x4c32('0xc')](_0x4c32('0xd'),attributes,{'tableName':_0x4c32('0xe'),'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 8a33547..63e3f13 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 _0xbdeb=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','then','GetVoiceQueueRtPauses','lodash'];(function(_0x53fb75,_0x58a68b){var _0x2f393f=function(_0x50e921){while(--_0x50e921){_0x53fb75['push'](_0x53fb75['shift']());}};_0x2f393f(++_0x58a68b);}(_0xbdeb,0x87));var _0xbbde=function(_0x1f1caa,_0x2b1e4b){_0x1f1caa=_0x1f1caa-0x0;var _0x2b03a6=_0xbdeb[_0x1f1caa];return _0x2b03a6;};'use strict';var _=require(_0xbbde('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbbde('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbde('0x2'))['db'];var utils=require(_0xbbde('0x3'));var logger=require(_0xbbde('0x4'))(_0xbbde('0x5'));var config=require('../../config/environment');var jayson=require(_0xbbde('0x6'));var client=jayson[_0xbbde('0x7')][_0xbbde('0x8')]({'port':0x232a});config[_0xbbde('0x9')]=_[_0xbbde('0xa')](config[_0xbbde('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbde('0xb'))(new Redis(config[_0xbbde('0x9')]));require(_0xbbde('0xc'))['register'](socket);function respondWithRpcPromise(_0x5e49bc,_0x1bdbb8,_0x23b2b8){return new BPromise(function(_0x230331,_0x5a6236){return client[_0xbbde('0xd')](_0x5e49bc,_0x23b2b8)['then'](function(_0x13605f){logger[_0xbbde('0xe')](_0xbbde('0xf'),_0x1bdbb8,_0xbbde('0x10'));logger[_0xbbde('0x11')](_0xbbde('0x12'),_0x1bdbb8,_0xbbde('0x10'),JSON[_0xbbde('0x13')](_0x13605f));if(_0x13605f['error']){if(_0x13605f[_0xbbde('0x14')][_0xbbde('0x15')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1bdbb8,_0x13605f[_0xbbde('0x14')]['message']);return _0x5a6236(_0x13605f[_0xbbde('0x14')][_0xbbde('0x16')]);}logger[_0xbbde('0x14')](_0xbbde('0xf'),_0x1bdbb8,_0x13605f[_0xbbde('0x14')]['message']);return _0x230331(_0x13605f[_0xbbde('0x14')][_0xbbde('0x16')]);}else{logger[_0xbbde('0xe')](_0xbbde('0xf'),_0x1bdbb8,'request\x20sent');_0x230331(_0x13605f['result'][_0xbbde('0x16')]);}})[_0xbbde('0x17')](function(_0x11ed0b){logger[_0xbbde('0x14')](_0xbbde('0xf'),_0x1bdbb8,_0x11ed0b);_0x5a6236(_0x11ed0b);});});}exports['GetVoiceQueueRtPauses']=function(_0x2ebfe0){var _0x1e105e=this;return new Promise(function(_0x59e3c2,_0x255dc5){return db[_0xbbde('0x18')]['findAll']({'raw':_0x2ebfe0[_0xbbde('0x19')]?_0x2ebfe0[_0xbbde('0x19')][_0xbbde('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ebfe0[_0xbbde('0x19')]?_0x2ebfe0[_0xbbde('0x19')][_0xbbde('0x1b')]||null:null,'attributes':[[db[_0xbbde('0x1c')]['fn'](_0xbbde('0x1d'),db[_0xbbde('0x1c')]['fn']('IF',db[_0xbbde('0x1c')][_0xbbde('0x1e')](_0xbbde('0x1f')))),'outboundQueuePauses']]})[_0xbbde('0x20')](function(_0x17b172){logger[_0xbbde('0xe')](_0xbbde('0x21'),_0x2ebfe0);logger['debug']('GetVoiceQueueRtPauses',_0x2ebfe0,JSON[_0xbbde('0x13')](_0x17b172));_0x59e3c2(_0x17b172);})[_0xbbde('0x17')](function(_0x21eb1e){logger['error'](_0xbbde('0x21'),_0x21eb1e[_0xbbde('0x16')],_0x2ebfe0);_0x255dc5(_0x1e105e[_0xbbde('0x14')](0x1f4,_0x21eb1e['message']));});});}; \ No newline at end of file +var _0x75ea=['options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','GetVoiceQueueRtPauses'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x75ea,0x93));var _0xa75e=function(_0xf0ae5f,_0x1eef94){_0xf0ae5f=_0xf0ae5f-0x0;var _0x38d55c=_0x75ea[_0xf0ae5f];return _0x38d55c;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require(_0xa75e('0x2'));var BPromise=require(_0xa75e('0x3'));var rs=require(_0xa75e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require(_0xa75e('0x9'));var client=jayson[_0xa75e('0xa')][_0xa75e('0xb')]({'port':0x232a});config[_0xa75e('0xc')]=_[_0xa75e('0xd')](config[_0xa75e('0xc')],{'host':_0xa75e('0xe'),'port':0x18eb});var socket=require(_0xa75e('0xf'))(new Redis(config['redis']));require(_0xa75e('0x10'))[_0xa75e('0x11')](socket);function respondWithRpcPromise(_0x36da0b,_0x188262,_0x5e7b5a){return new BPromise(function(_0x3fcc46,_0x976447){return client['request'](_0x36da0b,_0x5e7b5a)[_0xa75e('0x12')](function(_0x253139){logger[_0xa75e('0x13')](_0xa75e('0x14'),_0x188262,_0xa75e('0x15'));logger[_0xa75e('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x188262,'request\x20sent',JSON[_0xa75e('0x17')](_0x253139));if(_0x253139['error']){if(_0x253139['error'][_0xa75e('0x18')]===0x1f4){logger[_0xa75e('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x188262,_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);return _0x976447(_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);}logger[_0xa75e('0x19')](_0xa75e('0x14'),_0x188262,_0x253139[_0xa75e('0x19')]['message']);return _0x3fcc46(_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);}else{logger['info'](_0xa75e('0x14'),_0x188262,_0xa75e('0x15'));_0x3fcc46(_0x253139['result']['message']);}})['catch'](function(_0x2c0ea1){logger[_0xa75e('0x19')](_0xa75e('0x14'),_0x188262,_0x2c0ea1);_0x976447(_0x2c0ea1);});});}exports[_0xa75e('0x1b')]=function(_0x54ded8){var _0x3a3c18=this;return new Promise(function(_0x453f46,_0x5a2be3){return db['UserVoiceQueueRt']['findAll']({'raw':_0x54ded8['options']?_0x54ded8[_0xa75e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x54ded8[_0xa75e('0x1c')]?_0x54ded8[_0xa75e('0x1c')]['where']||null:null,'attributes':[[db[_0xa75e('0x1d')]['fn'](_0xa75e('0x1e'),db[_0xa75e('0x1d')]['fn']('IF',db[_0xa75e('0x1d')][_0xa75e('0x1f')](_0xa75e('0x20')))),_0xa75e('0x21')]]})['then'](function(_0x27c7cc){logger[_0xa75e('0x13')](_0xa75e('0x1b'),_0x54ded8);logger[_0xa75e('0x16')](_0xa75e('0x1b'),_0x54ded8,JSON[_0xa75e('0x17')](_0x27c7cc));_0x453f46(_0x27c7cc);})[_0xa75e('0x22')](function(_0x4d0bdb){logger['error'](_0xa75e('0x1b'),_0x4d0bdb['message'],_0x54ded8);_0x5a2be3(_0x3a3c18[_0xa75e('0x19')](0x1f4,_0x4d0bdb[_0xa75e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b896a34..d70b827 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 _0xf417=['update','length','userVoiceQueueRt:','save','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf417,0x8f));var _0x7f41=function(_0x417df0,_0x47917c){_0x417df0=_0x417df0-0x0;var _0x51048e=_0xf417[_0x417df0];return _0x51048e;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7f41('0x0'),_0x7f41('0x1'),_0x7f41('0x2')];function createListener(_0x57aab7,_0x85053){return function(_0x5d5098){_0x85053['emit'](_0x57aab7,_0x5d5098);};}function removeListener(_0x2b7d4c,_0x5170ec){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2b7d4c,_0x5170ec);};}exports['register']=function(_0x5ecdb2){for(var _0x1775d8=0x0,_0x4e37b5=events[_0x7f41('0x3')];_0x1775d8<_0x4e37b5;_0x1775d8++){var _0x295136=events[_0x1775d8];var _0x507ac0=createListener(_0x7f41('0x4')+_0x295136,_0x5ecdb2);UserVoiceQueueRtEvents['on'](_0x295136,_0x507ac0);}}; \ No newline at end of file +var _0x1052=['save','remove','update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x5a0383,_0x312ffe){var _0x1adda7=function(_0x1a0cf5){while(--_0x1a0cf5){_0x5a0383['push'](_0x5a0383['shift']());}};_0x1adda7(++_0x312ffe);}(_0x1052,0xf4));var _0x2105=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0x1052[_0x3c04d7];return _0x2fb24;};'use strict';var UserVoiceQueueRtEvents=require(_0x2105('0x0'));var events=[_0x2105('0x1'),_0x2105('0x2'),_0x2105('0x3')];function createListener(_0x1644e8,_0x7d7b47){return function(_0x265e12){_0x7d7b47[_0x2105('0x4')](_0x1644e8,_0x265e12);};}function removeListener(_0x1e106c,_0x5c1e84){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1e106c,_0x5c1e84);};}exports[_0x2105('0x5')]=function(_0x4a4e6b){for(var _0x126cd9=0x0,_0x9b262=events['length'];_0x126cd9<_0x9b262;_0x126cd9++){var _0x1e6ad5=events[_0x126cd9];var _0x20d2b4=createListener(_0x2105('0x6')+_0x1e6ad5,_0x4a4e6b);UserVoiceQueueRtEvents['on'](_0x1e6ad5,_0x20d2b4);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5585e53..7a1595a 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a4c69,_0x3fc205){var _0x42dc68=function(_0x36d48f){while(--_0x36d48f){_0x5a4c69['push'](_0x5a4c69['shift']());}};_0x42dc68(++_0x3fc205);}(_0xe706,0xa3));var _0x6e70=function(_0x41dd6b,_0x5ae4ba){_0x41dd6b=_0x41dd6b-0x0;var _0x156c5a=_0xe706[_0x41dd6b];return _0x156c5a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x397c64,_0x2be3e6){var _0x1de351=function(_0x5e2240){while(--_0x5e2240){_0x397c64['push'](_0x397c64['shift']());}};_0x1de351(++_0x2be3e6);}(_0xe706,0xa3));var _0x6e70=function(_0x5a0681,_0x5cbc10){_0x5a0681=_0x5a0681-0x0;var _0x2d3a74=_0xe706[_0x5a0681];return _0x2d3a74;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f7d963c..69a3e96 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 _0x799b=['sequelize'];(function(_0x51b10b,_0x311567){var _0x45b2cf=function(_0xa17759){while(--_0xa17759){_0x51b10b['push'](_0x51b10b['shift']());}};_0x45b2cf(++_0x311567);}(_0x799b,0x8c));var _0xb799=function(_0x5c78e5,_0xdcd8f1){_0x5c78e5=_0x5c78e5-0x0;var _0x24e7f3=_0x799b[_0x5c78e5];return _0x24e7f3;};'use strict';var Sequelize=require(_0xb799('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf576=['exports','INTEGER','sequelize'];(function(_0x17a963,_0x291584){var _0x549ebc=function(_0x995173){while(--_0x995173){_0x17a963['push'](_0x17a963['shift']());}};_0x549ebc(++_0x291584);}(_0xf576,0xef));var _0x6f57=function(_0x1ab43b,_0x14bd76){_0x1ab43b=_0x1ab43b-0x0;var _0x44fc81=_0xf576[_0x1ab43b];return _0x44fc81;};'use strict';var Sequelize=require(_0x6f57('0x0'));module[_0x6f57('0x1')]={'penalty':{'type':Sequelize[_0x6f57('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index b7cce75..b21a385 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 _0xcb9b=['bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment'];(function(_0x3e1d8e,_0x367a9b){var _0x557f6a=function(_0x989439){while(--_0x989439){_0x3e1d8e['push'](_0x3e1d8e['shift']());}};_0x557f6a(++_0x367a9b);}(_0xcb9b,0x11c));var _0xbcb9=function(_0x5e2ac3,_0x4eaae1){_0x5e2ac3=_0x5e2ac3-0x0;var _0x1e0a34=_0xcb9b[_0x5e2ac3];return _0x1e0a34;};'use strict';var _=require(_0xbcb9('0x0'));var util=require('util');var logger=require(_0xbcb9('0x1'))(_0xbcb9('0x2'));var moment=require(_0xbcb9('0x3'));var BPromise=require(_0xbcb9('0x4'));var rp=require(_0xbcb9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcb9('0x6'));var config=require(_0xbcb9('0x7'));var attributes=require(_0xbcb9('0x8'));module['exports']=function(_0x207da1,_0xb36e01){return _0x207da1[_0xbcb9('0x9')](_0xbcb9('0xa'),attributes,{'tableName':_0xbcb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb527=['UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','moment','request-promise','path','./userWhatsappQueue.attributes','exports','define'];(function(_0x95d4aa,_0x549b27){var _0x40ed9f=function(_0x52fdbb){while(--_0x52fdbb){_0x95d4aa['push'](_0x95d4aa['shift']());}};_0x40ed9f(++_0x549b27);}(_0xb527,0x1ba));var _0x7b52=function(_0x20e26a,_0x20b87d){_0x20e26a=_0x20e26a-0x0;var _0x450dee=_0xb527[_0x20e26a];return _0x450dee;};'use strict';var _=require('lodash');var util=require(_0x7b52('0x0'));var logger=require(_0x7b52('0x1'))(_0x7b52('0x2'));var moment=require(_0x7b52('0x3'));var BPromise=require('bluebird');var rp=require(_0x7b52('0x4'));var fs=require('fs');var path=require(_0x7b52('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b52('0x6'));module[_0x7b52('0x7')]=function(_0xe52368,_0x2ed2cd){return _0xe52368[_0x7b52('0x8')](_0x7b52('0x9'),attributes,{'tableName':_0x7b52('0xa'),'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 eeb2c6b..7324a47 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 _0x7b8f=['error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x454709,_0xa28117){var _0x3fb5dc=function(_0x49dbb2){while(--_0x49dbb2){_0x454709['push'](_0x454709['shift']());}};_0x3fb5dc(++_0xa28117);}(_0x7b8f,0x123));var _0xf7b8=function(_0x430953,_0x4b6180){_0x430953=_0x430953-0x0;var _0x2945b=_0x7b8f[_0x430953];return _0x2945b;};'use strict';var _=require(_0xf7b8('0x0'));var util=require('util');var moment=require(_0xf7b8('0x1'));var BPromise=require(_0xf7b8('0x2'));var rs=require(_0xf7b8('0x3'));var fs=require('fs');var Redis=require(_0xf7b8('0x4'));var db=require(_0xf7b8('0x5'))['db'];var utils=require(_0xf7b8('0x6'));var logger=require('../../config/logger')(_0xf7b8('0x7'));var config=require(_0xf7b8('0x8'));var jayson=require(_0xf7b8('0x9'));var client=jayson[_0xf7b8('0xa')][_0xf7b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2556da,_0x58a018,_0x107421){return new BPromise(function(_0x546616,_0x5cdb83){return client['request'](_0x2556da,_0x107421)[_0xf7b8('0xc')](function(_0x4ec74f){logger[_0xf7b8('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x58a018,_0xf7b8('0xe'));logger[_0xf7b8('0xf')](_0xf7b8('0x10'),_0x58a018,_0xf7b8('0xe'),JSON['stringify'](_0x4ec74f));if(_0x4ec74f[_0xf7b8('0x11')]){if(_0x4ec74f[_0xf7b8('0x11')][_0xf7b8('0x12')]===0x1f4){logger['error'](_0xf7b8('0x13'),_0x58a018,_0x4ec74f[_0xf7b8('0x11')]['message']);return _0x5cdb83(_0x4ec74f[_0xf7b8('0x11')][_0xf7b8('0x14')]);}logger[_0xf7b8('0x11')](_0xf7b8('0x13'),_0x58a018,_0x4ec74f['error'][_0xf7b8('0x14')]);return _0x546616(_0x4ec74f[_0xf7b8('0x11')][_0xf7b8('0x14')]);}else{logger[_0xf7b8('0xd')](_0xf7b8('0x13'),_0x58a018,_0xf7b8('0xe'));_0x546616(_0x4ec74f['result']['message']);}})[_0xf7b8('0x15')](function(_0x2805a7){logger[_0xf7b8('0x11')](_0xf7b8('0x13'),_0x58a018,_0x2805a7);_0x5cdb83(_0x2805a7);});});} \ No newline at end of file +var _0xad72=['../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x554505,_0x5013e8){var _0xf4d23b=function(_0x16973d){while(--_0x16973d){_0x554505['push'](_0x554505['shift']());}};_0xf4d23b(++_0x5013e8);}(_0xad72,0x12d));var _0x2ad7=function(_0x12f85e,_0x217706){_0x12f85e=_0x12f85e-0x0;var _0x316c77=_0xad72[_0x12f85e];return _0x316c77;};'use strict';var _=require(_0x2ad7('0x0'));var util=require('util');var moment=require(_0x2ad7('0x1'));var BPromise=require(_0x2ad7('0x2'));var rs=require(_0x2ad7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ad7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ad7('0x5'))(_0x2ad7('0x6'));var config=require(_0x2ad7('0x7'));var jayson=require(_0x2ad7('0x8'));var client=jayson[_0x2ad7('0x9')][_0x2ad7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ea2ae,_0x1d23a2,_0x45f8cc){return new BPromise(function(_0x176dc8,_0x5a4edd){return client[_0x2ad7('0xb')](_0x5ea2ae,_0x45f8cc)[_0x2ad7('0xc')](function(_0x3406ff){logger['info'](_0x2ad7('0xd'),_0x1d23a2,_0x2ad7('0xe'));logger[_0x2ad7('0xf')](_0x2ad7('0x10'),_0x1d23a2,_0x2ad7('0xe'),JSON[_0x2ad7('0x11')](_0x3406ff));if(_0x3406ff[_0x2ad7('0x12')]){if(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x13')]===0x1f4){logger['error'](_0x2ad7('0xd'),_0x1d23a2,_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);return _0x5a4edd(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);}logger[_0x2ad7('0x12')](_0x2ad7('0xd'),_0x1d23a2,_0x3406ff[_0x2ad7('0x12')]['message']);return _0x176dc8(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);}else{logger['info'](_0x2ad7('0xd'),_0x1d23a2,_0x2ad7('0xe'));_0x176dc8(_0x3406ff['result'][_0x2ad7('0x14')]);}})[_0x2ad7('0x15')](function(_0x30ba7d){logger[_0x2ad7('0x12')](_0x2ad7('0xd'),_0x1d23a2,_0x30ba7d);_0x5a4edd(_0x30ba7d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index acc9cf4..3ebc11f 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 _0x0f69=['put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0xf559d8,_0x394684){var _0x17eb30=function(_0x5dff50){while(--_0x5dff50){_0xf559d8['push'](_0xf559d8['shift']());}};_0x17eb30(++_0x394684);}(_0x0f69,0x173));var _0x90f6=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x0f69[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x90f6('0x0'));var timeout=require('connect-timeout');var express=require(_0x90f6('0x1'));var router=express[_0x90f6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x90f6('0x3'));var interaction=require(_0x90f6('0x4'));var config=require('../../config/environment');var controller=require(_0x90f6('0x5'));router['get']('/',auth[_0x90f6('0x6')](),controller[_0x90f6('0x7')]);router[_0x90f6('0x8')](_0x90f6('0x9'),auth[_0x90f6('0x6')](),controller[_0x90f6('0xa')]);router[_0x90f6('0xb')]('/',auth[_0x90f6('0x6')](),controller[_0x90f6('0xc')]);router[_0x90f6('0xd')](_0x90f6('0x9'),auth[_0x90f6('0x6')](),controller[_0x90f6('0xe')]);router['delete'](_0x90f6('0x9'),auth[_0x90f6('0x6')](),controller['destroy']);module[_0x90f6('0xf')]=router; \ No newline at end of file +var _0xb2ef=['Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x24b323,_0x15e297){_0x24b323=_0x24b323-0x0;var _0x368a68=_0xb2ef[_0x24b323];return _0x368a68;};'use strict';var multer=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var path=require(_0xfb2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb2e('0x3'));var router=express[_0xfb2e('0x4')]();var fs_extra=require(_0xfb2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var controller=require(_0xfb2e('0x8'));router[_0xfb2e('0x9')]('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xb')]);router[_0xfb2e('0x9')](_0xfb2e('0xc'),auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xd')]);router['post']('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xe')]);router[_0xfb2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfb2e('0x10')]);router[_0xfb2e('0x11')]('/:id',auth[_0xfb2e('0xa')](),controller[_0xfb2e('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 80bb402..b55160d 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 _0x7196=['name','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7196,0xb4));var _0x6719=function(_0x294545,_0x133b6f){_0x294545=_0x294545-0x0;var _0x2abdd3=_0x7196[_0x294545];return _0x2abdd3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6719('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6719('0x1')]}}; \ No newline at end of file +var _0x47aa=['exports','STRING','sequelize'];(function(_0x508a99,_0x42b963){var _0x4ed68d=function(_0x1228ee){while(--_0x1228ee){_0x508a99['push'](_0x508a99['shift']());}};_0x4ed68d(++_0x42b963);}(_0x47aa,0x9e));var _0xa47a=function(_0x3e0613,_0x8ed990){_0x3e0613=_0x3e0613-0x0;var _0xbe84c3=_0x47aa[_0x3e0613];return _0xbe84c3;};'use strict';var Sequelize=require(_0xa47a('0x0'));module[_0xa47a('0x1')]={'name':{'type':Sequelize[_0xa47a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa47a('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 51d8747..466c806 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 _0x07c4=['limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','find','create','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count'];(function(_0x42827a,_0x1f14dc){var _0x122510=function(_0x406401){while(--_0x406401){_0x42827a['push'](_0x42827a['shift']());}};_0x122510(++_0x1f14dc);}(_0x07c4,0xd4));var _0x407c=function(_0x20b759,_0x5a56ab){_0x20b759=_0x20b759-0x0;var _0x455656=_0x07c4[_0x20b759];return _0x455656;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x407c('0x0'));var jsonpatch=require(_0x407c('0x1'));var rp=require(_0x407c('0x2'));var moment=require('moment');var BPromise=require(_0x407c('0x3'));var Mustache=require(_0x407c('0x4'));var util=require(_0x407c('0x5'));var path=require(_0x407c('0x6'));var sox=require(_0x407c('0x7'));var csv=require('to-csv');var ejs=require(_0x407c('0x8'));var fs=require('fs');var fs_extra=require(_0x407c('0x9'));var _=require(_0x407c('0xa'));var squel=require(_0x407c('0xb'));var crypto=require(_0x407c('0xc'));var jsforce=require(_0x407c('0xd'));var deskjs=require(_0x407c('0xe'));var toCsv=require(_0x407c('0xf'));var querystring=require(_0x407c('0x10'));var Papa=require(_0x407c('0x11'));var Redis=require(_0x407c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x407c('0x13'));var as=require(_0x407c('0x14'));var hardwareService=require(_0x407c('0x15'));var logger=require(_0x407c('0x16'))(_0x407c('0x17'));var utils=require(_0x407c('0x18'));var config=require(_0x407c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x407c('0x1a'))['db'];function respondWithStatusCode(_0x16f50b,_0x4d45fc){_0x4d45fc=_0x4d45fc||0xcc;return function(_0x54b80b){if(_0x54b80b){return _0x16f50b[_0x407c('0x1b')](_0x4d45fc);}return _0x16f50b['status'](_0x4d45fc)[_0x407c('0x1c')]();};}function respondWithResult(_0xfd059e,_0x5ea80e){_0x5ea80e=_0x5ea80e||0xc8;return function(_0x192d6d){if(_0x192d6d){return _0xfd059e[_0x407c('0x1d')](_0x5ea80e)[_0x407c('0x1e')](_0x192d6d);}};}function respondWithFilteredResult(_0x1a3a5d,_0x58249b){return function(_0x357327){if(_0x357327){var _0x47f166=typeof _0x58249b[_0x407c('0x1f')]===_0x407c('0x20')&&typeof _0x58249b['limit']===_0x407c('0x20');var _0x2c75f6=_0x357327[_0x407c('0x21')];var _0x37352c=_0x47f166?0x0:_0x58249b[_0x407c('0x1f')];var _0x3bafca=_0x47f166?_0x357327[_0x407c('0x21')]:_0x58249b[_0x407c('0x1f')]+_0x58249b[_0x407c('0x22')];var _0x232be3;if(_0x3bafca>=_0x2c75f6){_0x3bafca=_0x2c75f6;_0x232be3=0xc8;}else{_0x232be3=0xce;}_0x1a3a5d['status'](_0x232be3);return _0x1a3a5d['set'](_0x407c('0x23'),_0x37352c+'-'+_0x3bafca+'/'+_0x2c75f6)[_0x407c('0x1e')](_0x357327);}return null;};}function patchUpdates(_0x510e9a){return function(_0xeba1fe){try{jsonpatch[_0x407c('0x24')](_0xeba1fe,_0x510e9a,!![]);}catch(_0x4ffc96){return BPromise[_0x407c('0x25')](_0x4ffc96);}return _0xeba1fe[_0x407c('0x26')]();};}function saveUpdates(_0x21ac7d,_0xff99b){return function(_0x4ed6f7){if(_0x4ed6f7){return _0x4ed6f7[_0x407c('0x27')](_0x21ac7d)[_0x407c('0x28')](function(_0x19f00f){return _0x19f00f;});}return null;};}function removeEntity(_0x5e0a3a,_0xffa24){return function(_0x2cc817){if(_0x2cc817){return _0x2cc817[_0x407c('0x29')]()[_0x407c('0x28')](function(){var _0x2098b0=_0x2cc817['get']({'plain':!![]});var _0x2b5021='Variables';return db[_0x407c('0x2a')][_0x407c('0x29')]({'where':{'type':_0x2b5021,'resourceId':_0x2098b0['id']}})[_0x407c('0x28')](function(){return _0x2cc817;});})[_0x407c('0x28')](function(){_0x5e0a3a[_0x407c('0x1d')](0xcc)[_0x407c('0x1c')]();});}};}function handleEntityNotFound(_0x25aae5,_0x10b455){return function(_0x589346){if(!_0x589346){_0x25aae5[_0x407c('0x1b')](0x194);}return _0x589346;};}function handleError(_0x37fbc1,_0x54fd26){_0x54fd26=_0x54fd26||0x1f4;return function(_0x3f571d){logger[_0x407c('0x2b')](_0x3f571d['stack']);if(_0x3f571d[_0x407c('0x2c')]){delete _0x3f571d[_0x407c('0x2c')];}_0x37fbc1[_0x407c('0x1d')](_0x54fd26)[_0x407c('0x2d')](_0x3f571d);};}exports['index']=function(_0x3edcd1,_0x374cda){var _0x4a9eca={},_0xc3489d={},_0xfa53b9={'count':0x0,'rows':[]};var _0x1cd84e=_[_0x407c('0x2e')](db[_0x407c('0x2f')][_0x407c('0x30')],function(_0x486c7d){return{'name':_0x486c7d[_0x407c('0x31')],'type':_0x486c7d[_0x407c('0x32')][_0x407c('0x33')]};});_0xc3489d[_0x407c('0x34')]=_[_0x407c('0x2e')](_0x1cd84e,_0x407c('0x2c'));_0xc3489d[_0x407c('0x35')]=_['keys'](_0x3edcd1[_0x407c('0x35')]);_0xc3489d[_0x407c('0x36')]=_[_0x407c('0x37')](_0xc3489d[_0x407c('0x34')],_0xc3489d[_0x407c('0x35')]);_0x4a9eca[_0x407c('0x38')]=_[_0x407c('0x37')](_0xc3489d[_0x407c('0x34')],qs[_0x407c('0x39')](_0x3edcd1['query'][_0x407c('0x39')]));_0x4a9eca[_0x407c('0x38')]=_0x4a9eca[_0x407c('0x38')]['length']?_0x4a9eca[_0x407c('0x38')]:_0xc3489d['model'];if(!_0x3edcd1[_0x407c('0x35')][_0x407c('0x3a')](_0x407c('0x3b'))){_0x4a9eca[_0x407c('0x22')]=qs[_0x407c('0x22')](_0x3edcd1[_0x407c('0x35')][_0x407c('0x22')]);_0x4a9eca['offset']=qs[_0x407c('0x1f')](_0x3edcd1[_0x407c('0x35')][_0x407c('0x1f')]);}_0x4a9eca[_0x407c('0x3c')]=qs['sort'](_0x3edcd1['query'][_0x407c('0x3d')]);_0x4a9eca[_0x407c('0x3e')]=qs['filters'](_[_0x407c('0x3f')](_0x3edcd1[_0x407c('0x35')],_0xc3489d[_0x407c('0x36')]),_0x1cd84e);if(_0x3edcd1['query']['filter']){_0x4a9eca[_0x407c('0x3e')]=_[_0x407c('0x40')](_0x4a9eca['where'],{'$or':_['map'](_0x1cd84e,function(_0x37c139){if(_0x37c139[_0x407c('0x32')]!==_0x407c('0x41')){var _0xe5f468={};_0xe5f468[_0x37c139[_0x407c('0x2c')]]={'$like':'%'+_0x3edcd1[_0x407c('0x35')]['filter']+'%'};return _0xe5f468;}})});}_0x4a9eca=_[_0x407c('0x40')]({},_0x4a9eca,_0x3edcd1[_0x407c('0x42')]);var _0x3dfc39={'where':_0x4a9eca[_0x407c('0x3e')]};return db[_0x407c('0x2f')][_0x407c('0x21')](_0x3dfc39)[_0x407c('0x28')](function(_0x1c620e){_0xfa53b9[_0x407c('0x21')]=_0x1c620e;if(_0x3edcd1['query']['includeAll']){_0x4a9eca[_0x407c('0x43')]=[{'all':!![]}];}return db[_0x407c('0x2f')][_0x407c('0x44')](_0x4a9eca);})[_0x407c('0x28')](function(_0x29dcf0){_0xfa53b9[_0x407c('0x45')]=_0x29dcf0;return _0xfa53b9;})[_0x407c('0x28')](respondWithFilteredResult(_0x374cda,_0x4a9eca))[_0x407c('0x46')](handleError(_0x374cda,null));};exports['show']=function(_0x19780c,_0x2258b0){var _0x44b545={'raw':!![],'where':{'id':_0x19780c[_0x407c('0x47')]['id']}},_0x351373={};_0x351373['model']=_[_0x407c('0x48')](db['Variable'][_0x407c('0x30')]);_0x351373[_0x407c('0x35')]=_[_0x407c('0x48')](_0x19780c[_0x407c('0x35')]);_0x351373[_0x407c('0x36')]=_['intersection'](_0x351373['model'],_0x351373[_0x407c('0x35')]);_0x44b545[_0x407c('0x38')]=_['intersection'](_0x351373[_0x407c('0x34')],qs['fields'](_0x19780c[_0x407c('0x35')][_0x407c('0x39')]));_0x44b545[_0x407c('0x38')]=_0x44b545[_0x407c('0x38')]['length']?_0x44b545[_0x407c('0x38')]:_0x351373[_0x407c('0x34')];if(_0x19780c[_0x407c('0x35')]['includeAll']){_0x44b545[_0x407c('0x43')]=[{'all':!![]}];}_0x44b545=_[_0x407c('0x40')]({},_0x44b545,_0x19780c[_0x407c('0x42')]);return db[_0x407c('0x2f')][_0x407c('0x49')](_0x44b545)[_0x407c('0x28')](handleEntityNotFound(_0x2258b0,null))[_0x407c('0x28')](respondWithResult(_0x2258b0,null))[_0x407c('0x46')](handleError(_0x2258b0,null));};exports[_0x407c('0x4a')]=function(_0x3d39cf,_0x2d44df){return db[_0x407c('0x2f')][_0x407c('0x4a')](_0x3d39cf['body'],{})['then'](function(_0x587086){var _0x5c17ab=_0x3d39cf[_0x407c('0x4b')]['get']({'plain':!![]});if(!_0x5c17ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c17ab[_0x407c('0x4c')]===_0x407c('0x4b')){var _0x542a53=_0x587086[_0x407c('0x4d')]({'plain':!![]});var _0xc70c84='Variables';return db[_0x407c('0x4e')][_0x407c('0x49')]({'where':{'name':_0xc70c84,'userProfileId':_0x5c17ab[_0x407c('0x4f')]},'raw':!![]})['then'](function(_0x5e0d1a){if(_0x5e0d1a&&_0x5e0d1a['autoAssociation']===0x0){return db[_0x407c('0x2a')][_0x407c('0x4a')]({'name':_0x542a53[_0x407c('0x2c')],'resourceId':_0x542a53['id'],'type':_0x5e0d1a[_0x407c('0x2c')],'sectionId':_0x5e0d1a['id']},{})[_0x407c('0x28')](function(){return _0x587086;});}else{return _0x587086;}})[_0x407c('0x46')](function(_0x4e4404){logger['error'](_0x407c('0x50'),_0x4e4404);throw _0x4e4404;});}return _0x587086;})[_0x407c('0x28')](respondWithResult(_0x2d44df,0xc9))[_0x407c('0x46')](handleError(_0x2d44df,null));};exports[_0x407c('0x27')]=function(_0x317ecb,_0x53442a){if(_0x317ecb[_0x407c('0x51')]['id']){delete _0x317ecb[_0x407c('0x51')]['id'];}return db['Variable'][_0x407c('0x49')]({'where':{'id':_0x317ecb[_0x407c('0x47')]['id']}})[_0x407c('0x28')](handleEntityNotFound(_0x53442a,null))[_0x407c('0x28')](saveUpdates(_0x317ecb['body'],null))[_0x407c('0x28')](respondWithResult(_0x53442a,null))[_0x407c('0x46')](handleError(_0x53442a,null));};exports['destroy']=function(_0x4e8551,_0x5462e3){return db[_0x407c('0x2f')][_0x407c('0x49')]({'where':{'id':_0x4e8551[_0x407c('0x47')]['id']}})[_0x407c('0x28')](handleEntityNotFound(_0x5462e3,null))[_0x407c('0x28')](removeEntity(_0x5462e3,null))[_0x407c('0x46')](handleError(_0x5462e3,null));}; \ No newline at end of file +var _0x736a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Variables','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','Variable','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','eml-format'];(function(_0x3e6e66,_0x3f8f4e){var _0x4b3e0a=function(_0x2cb7a3){while(--_0x2cb7a3){_0x3e6e66['push'](_0x3e6e66['shift']());}};_0x4b3e0a(++_0x3f8f4e);}(_0x736a,0xa7));var _0xa736=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x736a[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0xa736('0x0'));var rimraf=require(_0xa736('0x1'));var zipdir=require(_0xa736('0x2'));var jsonpatch=require(_0xa736('0x3'));var rp=require(_0xa736('0x4'));var moment=require(_0xa736('0x5'));var BPromise=require(_0xa736('0x6'));var Mustache=require('mustache');var util=require(_0xa736('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa736('0x8'));var ejs=require(_0xa736('0x9'));var fs=require('fs');var fs_extra=require(_0xa736('0xa'));var _=require(_0xa736('0xb'));var squel=require(_0xa736('0xc'));var crypto=require(_0xa736('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa736('0xe'));var toCsv=require(_0xa736('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa736('0xf'));var authService=require(_0xa736('0x10'));var qs=require(_0xa736('0x11'));var as=require(_0xa736('0x12'));var hardwareService=require(_0xa736('0x13'));var logger=require('../../config/logger')(_0xa736('0x14'));var utils=require(_0xa736('0x15'));var config=require(_0xa736('0x16'));var licenseUtil=require(_0xa736('0x17'));var db=require(_0xa736('0x18'))['db'];function respondWithStatusCode(_0x147012,_0x52b797){_0x52b797=_0x52b797||0xcc;return function(_0x1bd4b5){if(_0x1bd4b5){return _0x147012['sendStatus'](_0x52b797);}return _0x147012[_0xa736('0x19')](_0x52b797)['end']();};}function respondWithResult(_0x3dab62,_0xd40399){_0xd40399=_0xd40399||0xc8;return function(_0x17f6dc){if(_0x17f6dc){return _0x3dab62[_0xa736('0x19')](_0xd40399)[_0xa736('0x1a')](_0x17f6dc);}};}function respondWithFilteredResult(_0xe7c759,_0x69e6ff){return function(_0x2fd4a2){if(_0x2fd4a2){var _0x2c8bbe=typeof _0x69e6ff[_0xa736('0x1b')]===_0xa736('0x1c')&&typeof _0x69e6ff[_0xa736('0x1d')]==='undefined';var _0x2cc52f=_0x2fd4a2[_0xa736('0x1e')];var _0x406c8a=_0x2c8bbe?0x0:_0x69e6ff[_0xa736('0x1b')];var _0x550168=_0x2c8bbe?_0x2fd4a2[_0xa736('0x1e')]:_0x69e6ff[_0xa736('0x1b')]+_0x69e6ff['limit'];var _0x538430;if(_0x550168>=_0x2cc52f){_0x550168=_0x2cc52f;_0x538430=0xc8;}else{_0x538430=0xce;}_0xe7c759[_0xa736('0x19')](_0x538430);return _0xe7c759[_0xa736('0x1f')](_0xa736('0x20'),_0x406c8a+'-'+_0x550168+'/'+_0x2cc52f)['json'](_0x2fd4a2);}return null;};}function patchUpdates(_0xbead9e){return function(_0x48c0cc){try{jsonpatch[_0xa736('0x21')](_0x48c0cc,_0xbead9e,!![]);}catch(_0x8f89fc){return BPromise[_0xa736('0x22')](_0x8f89fc);}return _0x48c0cc['save']();};}function saveUpdates(_0x39a389,_0x42497e){return function(_0x3ce519){if(_0x3ce519){return _0x3ce519[_0xa736('0x23')](_0x39a389)[_0xa736('0x24')](function(_0x2ac3e4){return _0x2ac3e4;});}return null;};}function removeEntity(_0x102cc3,_0x245b74){return function(_0x29890f){if(_0x29890f){return _0x29890f['destroy']()[_0xa736('0x24')](function(){var _0x5b8a5c=_0x29890f[_0xa736('0x25')]({'plain':!![]});var _0x427d20=_0xa736('0x26');return db[_0xa736('0x27')][_0xa736('0x28')]({'where':{'type':_0x427d20,'resourceId':_0x5b8a5c['id']}})[_0xa736('0x24')](function(){return _0x29890f;});})['then'](function(){_0x102cc3['status'](0xcc)[_0xa736('0x29')]();});}};}function handleEntityNotFound(_0x49a502,_0x156de1){return function(_0x112ce7){if(!_0x112ce7){_0x49a502[_0xa736('0x2a')](0x194);}return _0x112ce7;};}function handleError(_0x3b85b5,_0x1f4b1d){_0x1f4b1d=_0x1f4b1d||0x1f4;return function(_0x56e40e){logger[_0xa736('0x2b')](_0x56e40e[_0xa736('0x2c')]);if(_0x56e40e[_0xa736('0x2d')]){delete _0x56e40e[_0xa736('0x2d')];}_0x3b85b5[_0xa736('0x19')](_0x1f4b1d)[_0xa736('0x2e')](_0x56e40e);};}exports[_0xa736('0x2f')]=function(_0xde7a5,_0x4a8c45){var _0x35ca78={},_0x3007c9={},_0x525f55={'count':0x0,'rows':[]};var _0x2f3fe4=_['map'](db[_0xa736('0x30')][_0xa736('0x31')],function(_0x583392){return{'name':_0x583392['fieldName'],'type':_0x583392[_0xa736('0x32')][_0xa736('0x33')]};});_0x3007c9['model']=_[_0xa736('0x34')](_0x2f3fe4,'name');_0x3007c9[_0xa736('0x35')]=_[_0xa736('0x36')](_0xde7a5[_0xa736('0x35')]);_0x3007c9[_0xa736('0x37')]=_['intersection'](_0x3007c9[_0xa736('0x38')],_0x3007c9[_0xa736('0x35')]);_0x35ca78[_0xa736('0x39')]=_[_0xa736('0x3a')](_0x3007c9['model'],qs['fields'](_0xde7a5[_0xa736('0x35')][_0xa736('0x3b')]));_0x35ca78['attributes']=_0x35ca78[_0xa736('0x39')]['length']?_0x35ca78[_0xa736('0x39')]:_0x3007c9[_0xa736('0x38')];if(!_0xde7a5[_0xa736('0x35')][_0xa736('0x3c')](_0xa736('0x3d'))){_0x35ca78['limit']=qs[_0xa736('0x1d')](_0xde7a5[_0xa736('0x35')]['limit']);_0x35ca78[_0xa736('0x1b')]=qs[_0xa736('0x1b')](_0xde7a5[_0xa736('0x35')]['offset']);}_0x35ca78[_0xa736('0x3e')]=qs['sort'](_0xde7a5[_0xa736('0x35')][_0xa736('0x3f')]);_0x35ca78[_0xa736('0x40')]=qs[_0xa736('0x37')](_[_0xa736('0x41')](_0xde7a5[_0xa736('0x35')],_0x3007c9[_0xa736('0x37')]),_0x2f3fe4);if(_0xde7a5['query']['filter']){_0x35ca78[_0xa736('0x40')]=_[_0xa736('0x42')](_0x35ca78[_0xa736('0x40')],{'$or':_[_0xa736('0x34')](_0x2f3fe4,function(_0x57a08f){if(_0x57a08f[_0xa736('0x32')]!==_0xa736('0x43')){var _0x31cd31={};_0x31cd31[_0x57a08f['name']]={'$like':'%'+_0xde7a5[_0xa736('0x35')][_0xa736('0x44')]+'%'};return _0x31cd31;}})});}_0x35ca78=_[_0xa736('0x42')]({},_0x35ca78,_0xde7a5[_0xa736('0x45')]);var _0x4d79bc={'where':_0x35ca78['where']};return db[_0xa736('0x30')][_0xa736('0x1e')](_0x4d79bc)[_0xa736('0x24')](function(_0x35c3ec){_0x525f55[_0xa736('0x1e')]=_0x35c3ec;if(_0xde7a5[_0xa736('0x35')]['includeAll']){_0x35ca78[_0xa736('0x46')]=[{'all':!![]}];}return db[_0xa736('0x30')][_0xa736('0x47')](_0x35ca78);})[_0xa736('0x24')](function(_0x4c6db3){_0x525f55[_0xa736('0x48')]=_0x4c6db3;return _0x525f55;})[_0xa736('0x24')](respondWithFilteredResult(_0x4a8c45,_0x35ca78))[_0xa736('0x49')](handleError(_0x4a8c45,null));};exports['show']=function(_0x372cb2,_0x587d57){var _0x23b773={'raw':!![],'where':{'id':_0x372cb2[_0xa736('0x4a')]['id']}},_0x5d87ab={};_0x5d87ab['model']=_[_0xa736('0x36')](db[_0xa736('0x30')]['rawAttributes']);_0x5d87ab[_0xa736('0x35')]=_[_0xa736('0x36')](_0x372cb2[_0xa736('0x35')]);_0x5d87ab[_0xa736('0x37')]=_[_0xa736('0x3a')](_0x5d87ab[_0xa736('0x38')],_0x5d87ab['query']);_0x23b773['attributes']=_[_0xa736('0x3a')](_0x5d87ab[_0xa736('0x38')],qs[_0xa736('0x3b')](_0x372cb2[_0xa736('0x35')][_0xa736('0x3b')]));_0x23b773[_0xa736('0x39')]=_0x23b773[_0xa736('0x39')][_0xa736('0x4b')]?_0x23b773[_0xa736('0x39')]:_0x5d87ab['model'];if(_0x372cb2[_0xa736('0x35')][_0xa736('0x4c')]){_0x23b773[_0xa736('0x46')]=[{'all':!![]}];}_0x23b773=_[_0xa736('0x42')]({},_0x23b773,_0x372cb2[_0xa736('0x45')]);return db[_0xa736('0x30')][_0xa736('0x4d')](_0x23b773)[_0xa736('0x24')](handleEntityNotFound(_0x587d57,null))[_0xa736('0x24')](respondWithResult(_0x587d57,null))[_0xa736('0x49')](handleError(_0x587d57,null));};exports['create']=function(_0x1f5476,_0x58cd72){return db[_0xa736('0x30')][_0xa736('0x4e')](_0x1f5476[_0xa736('0x4f')],{})[_0xa736('0x24')](function(_0x15073e){var _0x345684=_0x1f5476['user']['get']({'plain':!![]});if(!_0x345684)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x345684[_0xa736('0x50')]===_0xa736('0x51')){var _0x54ce9f=_0x15073e['get']({'plain':!![]});var _0x3a18de='Variables';return db[_0xa736('0x52')][_0xa736('0x4d')]({'where':{'name':_0x3a18de,'userProfileId':_0x345684['userProfileId']},'raw':!![]})[_0xa736('0x24')](function(_0x1fdf9e){if(_0x1fdf9e&&_0x1fdf9e[_0xa736('0x53')]===0x0){return db[_0xa736('0x27')]['create']({'name':_0x54ce9f[_0xa736('0x2d')],'resourceId':_0x54ce9f['id'],'type':_0x1fdf9e[_0xa736('0x2d')],'sectionId':_0x1fdf9e['id']},{})[_0xa736('0x24')](function(){return _0x15073e;});}else{return _0x15073e;}})[_0xa736('0x49')](function(_0x255880){logger[_0xa736('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x255880);throw _0x255880;});}return _0x15073e;})['then'](respondWithResult(_0x58cd72,0xc9))['catch'](handleError(_0x58cd72,null));};exports[_0xa736('0x23')]=function(_0x270239,_0x30dc20){if(_0x270239[_0xa736('0x4f')]['id']){delete _0x270239[_0xa736('0x4f')]['id'];}return db[_0xa736('0x30')][_0xa736('0x4d')]({'where':{'id':_0x270239[_0xa736('0x4a')]['id']}})[_0xa736('0x24')](handleEntityNotFound(_0x30dc20,null))[_0xa736('0x24')](saveUpdates(_0x270239[_0xa736('0x4f')],null))['then'](respondWithResult(_0x30dc20,null))[_0xa736('0x49')](handleError(_0x30dc20,null));};exports[_0xa736('0x28')]=function(_0x2d82f3,_0x1b637e){return db[_0xa736('0x30')][_0xa736('0x4d')]({'where':{'id':_0x2d82f3[_0xa736('0x4a')]['id']}})[_0xa736('0x24')](handleEntityNotFound(_0x1b637e,null))['then'](removeEntity(_0x1b637e,null))[_0xa736('0x49')](handleError(_0x1b637e,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 84fc710..479ad2d 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 _0x7b8e=['request-promise','path','rimraf','../../config/environment','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7b8e,0x1ac));var _0xe7b8=function(_0x2e042f,_0x9186ee){_0x2e042f=_0x2e042f-0x0;var _0x4bc2bd=_0x7b8e[_0x2e042f];return _0x4bc2bd;};'use strict';var _=require(_0xe7b8('0x0'));var util=require(_0xe7b8('0x1'));var logger=require(_0xe7b8('0x2'))(_0xe7b8('0x3'));var moment=require(_0xe7b8('0x4'));var BPromise=require(_0xe7b8('0x5'));var rp=require(_0xe7b8('0x6'));var fs=require('fs');var path=require(_0xe7b8('0x7'));var rimraf=require(_0xe7b8('0x8'));var config=require(_0xe7b8('0x9'));var attributes=require('./variable.attributes');module[_0xe7b8('0xa')]=function(_0x57529b,_0xa5c055){return _0x57529b[_0xe7b8('0xb')](_0xe7b8('0xc'),attributes,{'tableName':_0xe7b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b1b=['Variable','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0b1b,0x6f));var _0xb0b1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x0b1b[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xb0b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0b1('0x1'));var moment=require(_0xb0b1('0x2'));var BPromise=require(_0xb0b1('0x3'));var rp=require(_0xb0b1('0x4'));var fs=require('fs');var path=require(_0xb0b1('0x5'));var rimraf=require(_0xb0b1('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xb0b1('0x7')]=function(_0x52a582,_0x457829){return _0x52a582[_0xb0b1('0x8')](_0xb0b1('0x9'),attributes,{'tableName':'tools_variables','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 e53c7d5..5dd6313 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x8c7160,_0x3eb34d){var _0x4fddba=function(_0x5bd61c){while(--_0x5bd61c){_0x8c7160['push'](_0x8c7160['shift']());}};_0x4fddba(++_0x3eb34d);}(_0x6aa7,0x178));var _0x76aa=function(_0x4a8c28,_0x21d9fd){_0x4a8c28=_0x4a8c28-0x0;var _0x20b395=_0x6aa7[_0x4a8c28];return _0x20b395;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x544d42,_0x1253e1){var _0x40cefb=function(_0x5c705f){while(--_0x5c705f){_0x544d42['push'](_0x544d42['shift']());}};_0x40cefb(++_0x1253e1);}(_0xabce,0x103));var _0xeabc=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xabce[_0x4dbaad];return _0x226c72;};'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')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d33f931..3f2f5f4 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 _0xf318=['/migrations','migrations','exports','express','Router','../../components/auth/service','index','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xf318,0x1c5));var _0x8f31=function(_0x188ddf,_0x3efd7c){_0x188ddf=_0x188ddf-0x0;var _0x3e7e9e=_0xf318[_0x188ddf];return _0x3e7e9e;};'use strict';var express=require(_0x8f31('0x0'));var router=express[_0x8f31('0x1')]();var auth=require(_0x8f31('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x8f31('0x3')]);router[_0x8f31('0x4')](_0x8f31('0x5'),auth[_0x8f31('0x6')](),auth[_0x8f31('0x7')](),controller[_0x8f31('0x8')]);router[_0x8f31('0x4')](_0x8f31('0x9'),auth[_0x8f31('0x6')](),auth['canUpdate'](),controller[_0x8f31('0xa')]);router[_0x8f31('0x4')](_0x8f31('0xb'),auth['isAuthenticated'](),auth[_0x8f31('0x7')](),controller[_0x8f31('0xc')]);router[_0x8f31('0x4')](_0x8f31('0xd'),auth[_0x8f31('0x6')](),controller[_0x8f31('0xe')]);router['get'](_0x8f31('0xf'),controller[_0x8f31('0x10')]);module[_0x8f31('0x11')]=router; \ No newline at end of file +var _0x60f5=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x60f5,0x85));var _0x560f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60f5[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x560f('0x0'));var router=express[_0x560f('0x1')]();var auth=require(_0x560f('0x2'));var controller=require(_0x560f('0x3'));router[_0x560f('0x4')]('/',controller[_0x560f('0x5')]);router[_0x560f('0x4')](_0x560f('0x6'),auth[_0x560f('0x7')](),auth[_0x560f('0x8')](),controller[_0x560f('0x9')]);router['get'](_0x560f('0xa'),auth[_0x560f('0x7')](),auth[_0x560f('0x8')](),controller[_0x560f('0xb')]);router[_0x560f('0x4')]('/pull',auth[_0x560f('0x7')](),auth['canUpdate'](),controller[_0x560f('0xc')]);router['get'](_0x560f('0xd'),auth[_0x560f('0x7')](),controller[_0x560f('0xe')]);router[_0x560f('0x4')](_0x560f('0xf'),controller['migrations']);module[_0x560f('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 1f88d50..62ae101 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 _0x0a97=['sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','root','server','length','.js','push','sort'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x0a97,0x183));var _0x70a9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0a97[_0x4565bf];return _0x5610ba;};'use strict';var Umzug=require(_0x70a9('0x0'));var path=require(_0x70a9('0x1'));var fs=require('fs');var _=require(_0x70a9('0x2'));var pkginfo=require('pkginfo')(module,_0x70a9('0x3'));var compareVersions=require(_0x70a9('0x4'));var exec=require(_0x70a9('0x5'))[_0x70a9('0x6')];var db=require(_0x70a9('0x7'))['db'];var config=require(_0x70a9('0x8'));var pm2=require(_0x70a9('0x9'));var logger=require(_0x70a9('0xa'))(_0x70a9('0xb'));var git=require('simple-git')(config['root']);exports[_0x70a9('0xc')]=function(_0x3ac364,_0x89d558){var _0xed0f7e={'current':module[_0x70a9('0xd')][_0x70a9('0x3')],'phonebar':0x2};if(_0x3ac364['query']&&_0x3ac364[_0x70a9('0xe')][_0x70a9('0xf')]){return git[_0x70a9('0x10')]()[_0x70a9('0x11')](function(_0x27c451,_0x2fc4f4){_0xed0f7e[_0x70a9('0xf')]=(_0x27c451?module['exports'][_0x70a9('0x3')]:_0x2fc4f4['latest'])||_0x70a9('0x12');return _0x89d558['status'](0xc8)[_0x70a9('0x13')](_0xed0f7e);});}else{return _0x89d558[_0x70a9('0x14')](0xc8)[_0x70a9('0x13')](_0xed0f7e);}};exports[_0x70a9('0x10')]=function(_0x3965c3,_0xc62aed){return git[_0x70a9('0x10')]([_0x70a9('0x15'),_0x70a9('0x16')],function(_0x2a6845){if(_0x2a6845){logger[_0x70a9('0x17')](_0x2a6845);return _0xc62aed['status'](0x1f4)[_0x70a9('0x13')](_0x2a6845);}logger[_0x70a9('0x18')](_0x70a9('0x19'));return _0xc62aed['status'](0xc8)[_0x70a9('0x13')]({'output':_0x70a9('0x1a')});});};exports[_0x70a9('0x1b')]=function(_0x23ddcb,_0x21284f){return git[_0x70a9('0x1b')]([_0x70a9('0x1c'),'FETCH_HEAD'],function(_0x54b94a){if(_0x54b94a){logger[_0x70a9('0x17')](_0x54b94a);return _0x21284f['status'](0x1f4)[_0x70a9('0x13')](_0x54b94a);}logger[_0x70a9('0x18')](_0x70a9('0x1d'));return _0x21284f['status'](0xc8)[_0x70a9('0x13')]({'output':_0x70a9('0x1e')});});};exports[_0x70a9('0x1f')]=function(_0x4db3e0,_0x307f06){exec('npm\x20install\x20--production',function(_0x4d4575,_0xd1385c,_0x30352d){logger[_0x70a9('0x18')](_0xd1385c);logger[_0x70a9('0x18')](_0x30352d);if(_0x4d4575){logger[_0x70a9('0x17')](_0x4d4575);return _0x307f06[_0x70a9('0x14')](0x1f4)[_0x70a9('0x13')](_0x4d4575);}return _0x307f06[_0x70a9('0x14')](0xc8)['json']({'output':_0xd1385c});});};exports[_0x70a9('0x20')]=function(_0x596f94,_0x4f47ec){return pm2[_0x70a9('0x20')](_0x70a9('0x21'))['then'](function(_0x10dfb3){logger['info'](_0x70a9('0x22'),_0x10dfb3);return _0x4f47ec[_0x70a9('0x14')](0xc8)[_0x70a9('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x70a9('0x23')](function(_0x2d7f7c){logger[_0x70a9('0x17')](_0x2d7f7c);return _0x4f47ec[_0x70a9('0x14')](0x1f4)['json'](_0x2d7f7c);});};exports[_0x70a9('0x24')]=function(_0x5eb284,_0x10e822){var _0x59d430=fs[_0x70a9('0x25')](path[_0x70a9('0x26')](config[_0x70a9('0x27')],_0x70a9('0x28'),_0x70a9('0x24')));var _0xe14c2b=[];for(var _0x31a1db=0x0;_0x31a1db<_0x59d430[_0x70a9('0x29')];_0x31a1db++){var _0x57cf5f=_0x59d430[_0x31a1db]['replace'](_0x70a9('0x2a'),'');if(compareVersions(module[_0x70a9('0xd')]['version'],_0x57cf5f)===-0x1){_0xe14c2b[_0x70a9('0x2b')](_0x57cf5f);}}if(_0xe14c2b[_0x70a9('0x29')]){var _0x1402fa=_0xe14c2b[_0x70a9('0x2c')](compareVersions);var _0x3b485f=new Umzug({'storage':_0x70a9('0x2d'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x70a9('0x3')},'migrations':{'params':[db['sequelize'][_0x70a9('0x2e')](),db['sequelize'][_0x70a9('0x2f')],function(){throw new Error(_0x70a9('0x30'));}],'path':path['join'](config[_0x70a9('0x27')],_0x70a9('0x28'),_0x70a9('0x24')),'pattern':/\.js$/}});_0x3b485f['up']({'migrations':_[_0x70a9('0x31')](_0x1402fa,function(_0x424753){return _0x424753+_0x70a9('0x2a');})})['then'](function(){return _0x10e822['status'](0xc8)[_0x70a9('0x13')]({'output':_0x70a9('0x32')+module[_0x70a9('0xd')][_0x70a9('0x3')]+_0x70a9('0x33')+_['last'](_0x1402fa),'migrations':_['join'](_0x1402fa)});})['catch'](function(_0x7adcca){if(_0x7adcca instanceof db[_0x70a9('0x2d')][_0x70a9('0x34')]){return _0x10e822[_0x70a9('0x14')](0xc8)['json']({'output':_0x70a9('0x35')});}else{return _0x10e822['status'](0x1f4)[_0x70a9('0x13')](_0x7adcca);}});}else{return _0x10e822['status'](0xc8)[_0x70a9('0x13')]({'output':_0x70a9('0x35')});}}; \ No newline at end of file +var _0x6b9a=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','replace','.js','length','sort','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','join','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/logger','update','root','exports','query','latest','fetch','tags','version','json','status','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info'];(function(_0x5c8dca,_0x1ecbf1){var _0x5d1e32=function(_0x54001c){while(--_0x54001c){_0x5c8dca['push'](_0x5c8dca['shift']());}};_0x5d1e32(++_0x1ecbf1);}(_0x6b9a,0x17f));var _0xa6b9=function(_0x42e26d,_0x371a2b){_0x42e26d=_0x42e26d-0x0;var _0x324331=_0x6b9a[_0x42e26d];return _0x324331;};'use strict';var Umzug=require('umzug');var path=require(_0xa6b9('0x0'));var fs=require('fs');var _=require(_0xa6b9('0x1'));var pkginfo=require(_0xa6b9('0x2'))(module,'version');var compareVersions=require(_0xa6b9('0x3'));var exec=require(_0xa6b9('0x4'))['exec'];var db=require(_0xa6b9('0x5'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xa6b9('0x6'))(_0xa6b9('0x7'));var git=require('simple-git')(config[_0xa6b9('0x8')]);exports['index']=function(_0x2be900,_0x23817f){var _0x59b919={'current':module[_0xa6b9('0x9')]['version'],'phonebar':0x2};if(_0x2be900[_0xa6b9('0xa')]&&_0x2be900[_0xa6b9('0xa')][_0xa6b9('0xb')]){return git[_0xa6b9('0xc')]()[_0xa6b9('0xd')](function(_0x42192a,_0x1c1c84){_0x59b919[_0xa6b9('0xb')]=(_0x42192a?module[_0xa6b9('0x9')][_0xa6b9('0xe')]:_0x1c1c84['latest'])||'2.0.0';return _0x23817f['status'](0xc8)[_0xa6b9('0xf')](_0x59b919);});}else{return _0x23817f[_0xa6b9('0x10')](0xc8)['json'](_0x59b919);}};exports['fetch']=function(_0x281d29,_0x1b3b70){return git[_0xa6b9('0xc')]([_0xa6b9('0x11'),_0xa6b9('0x12')],function(_0x228b03){if(_0x228b03){logger[_0xa6b9('0x13')](_0x228b03);return _0x1b3b70['status'](0x1f4)[_0xa6b9('0xf')](_0x228b03);}logger['info']('git\x20fetch');return _0x1b3b70[_0xa6b9('0x10')](0xc8)['json']({'output':_0xa6b9('0x14')});});};exports['reset']=function(_0x2f582c,_0x44b85e){return git[_0xa6b9('0x15')]([_0xa6b9('0x16'),_0xa6b9('0x17')],function(_0x49906a){if(_0x49906a){logger[_0xa6b9('0x13')](_0x49906a);return _0x44b85e[_0xa6b9('0x10')](0x1f4)[_0xa6b9('0xf')](_0x49906a);}logger[_0xa6b9('0x18')](_0xa6b9('0x19'));return _0x44b85e['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x1a')});});};exports[_0xa6b9('0x1b')]=function(_0x77ec02,_0x1662cb){exec(_0xa6b9('0x1c'),function(_0x1b129a,_0x243304,_0x9fe936){logger[_0xa6b9('0x18')](_0x243304);logger[_0xa6b9('0x18')](_0x9fe936);if(_0x1b129a){logger[_0xa6b9('0x13')](_0x1b129a);return _0x1662cb[_0xa6b9('0x10')](0x1f4)['json'](_0x1b129a);}return _0x1662cb[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0x243304});});};exports[_0xa6b9('0x1d')]=function(_0x21b3c3,_0x5726be){return pm2['restart'](_0xa6b9('0x1e'))[_0xa6b9('0x1f')](function(_0x36193c){logger[_0xa6b9('0x18')]('pm2\x20restart\x20motion\x20%s',_0x36193c);return _0x5726be['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x20')});})[_0xa6b9('0x21')](function(_0x22a863){logger['error'](_0x22a863);return _0x5726be[_0xa6b9('0x10')](0x1f4)[_0xa6b9('0xf')](_0x22a863);});};exports[_0xa6b9('0x22')]=function(_0x488bf1,_0x2a391f){var _0x24baf8=fs[_0xa6b9('0x23')](path['join'](config[_0xa6b9('0x8')],'server',_0xa6b9('0x22')));var _0x4115b0=[];for(var _0xeebaa0=0x0;_0xeebaa0<_0x24baf8['length'];_0xeebaa0++){var _0x39a287=_0x24baf8[_0xeebaa0][_0xa6b9('0x24')](_0xa6b9('0x25'),'');if(compareVersions(module[_0xa6b9('0x9')][_0xa6b9('0xe')],_0x39a287)===-0x1){_0x4115b0['push'](_0x39a287);}}if(_0x4115b0[_0xa6b9('0x26')]){var _0x3eb42b=_0x4115b0[_0xa6b9('0x27')](compareVersions);var _0x1be8d0=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xa6b9('0x28')],'modelName':_0xa6b9('0x28'),'columnName':_0xa6b9('0xe')},'migrations':{'params':[db['sequelize'][_0xa6b9('0x29')](),db['sequelize'][_0xa6b9('0x2a')],function(){throw new Error(_0xa6b9('0x2b'));}],'path':path['join'](config[_0xa6b9('0x8')],_0xa6b9('0x2c'),_0xa6b9('0x22')),'pattern':/\.js$/}});_0x1be8d0['up']({'migrations':_[_0xa6b9('0x2d')](_0x3eb42b,function(_0x265245){return _0x265245+'.js';})})[_0xa6b9('0x1f')](function(){return _0x2a391f['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x2e')+module[_0xa6b9('0x9')][_0xa6b9('0xe')]+'\x20to\x20'+_['last'](_0x3eb42b),'migrations':_[_0xa6b9('0x2f')](_0x3eb42b)});})[_0xa6b9('0x21')](function(_0x262156){if(_0x262156 instanceof db[_0xa6b9('0x30')][_0xa6b9('0x31')]){return _0x2a391f[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x32')});}else{return _0x2a391f['status'](0x1f4)[_0xa6b9('0xf')](_0x262156);}});}else{return _0x2a391f[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c4c4196..13e5a54 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 _0xeb24=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x3c976e,_0x3833d0){var _0x1b1dc3=function(_0x474029){while(--_0x474029){_0x3c976e['push'](_0x3c976e['shift']());}};_0x1b1dc3(++_0x3833d0);}(_0xeb24,0x16b));var _0x4eb2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xeb24[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x4eb2('0x0'));var util=require(_0x4eb2('0x1'));var path=require(_0x4eb2('0x2'));var timeout=require(_0x4eb2('0x3'));var express=require('express');var router=express[_0x4eb2('0x4')]();var fs_extra=require(_0x4eb2('0x5'));var auth=require(_0x4eb2('0x6'));var interaction=require(_0x4eb2('0x7'));var config=require(_0x4eb2('0x8'));var controller=require(_0x4eb2('0x9'));router[_0x4eb2('0xa')]('/',auth[_0x4eb2('0xb')](),controller[_0x4eb2('0xc')]);router[_0x4eb2('0xa')](_0x4eb2('0xd'),auth[_0x4eb2('0xb')](),controller[_0x4eb2('0xe')]);router[_0x4eb2('0xa')](_0x4eb2('0xf'),auth['isAuthenticated'](),controller[_0x4eb2('0x10')]);router[_0x4eb2('0x11')]('/',auth[_0x4eb2('0xb')](),controller[_0x4eb2('0x12')]);router[_0x4eb2('0x13')](_0x4eb2('0xf'),auth[_0x4eb2('0xb')](),controller[_0x4eb2('0x14')]);router[_0x4eb2('0x15')](_0x4eb2('0xf'),auth[_0x4eb2('0xb')](),controller[_0x4eb2('0x16')]);module[_0x4eb2('0x17')]=router; \ No newline at end of file +var _0xddd2=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xddd2,0x1da));var _0x2ddd=function(_0x200770,_0x4391ed){_0x200770=_0x200770-0x0;var _0x303db6=_0xddd2[_0x200770];return _0x303db6;};'use strict';var multer=require(_0x2ddd('0x0'));var util=require(_0x2ddd('0x1'));var path=require(_0x2ddd('0x2'));var timeout=require(_0x2ddd('0x3'));var express=require(_0x2ddd('0x4'));var router=express[_0x2ddd('0x5')]();var fs_extra=require(_0x2ddd('0x6'));var auth=require(_0x2ddd('0x7'));var interaction=require(_0x2ddd('0x8'));var config=require(_0x2ddd('0x9'));var controller=require(_0x2ddd('0xa'));router[_0x2ddd('0xb')]('/',auth[_0x2ddd('0xc')](),controller[_0x2ddd('0xd')]);router[_0x2ddd('0xb')](_0x2ddd('0xe'),auth[_0x2ddd('0xc')](),controller[_0x2ddd('0xf')]);router[_0x2ddd('0xb')](_0x2ddd('0x10'),auth['isAuthenticated'](),controller[_0x2ddd('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2ddd('0x12')](_0x2ddd('0x10'),auth[_0x2ddd('0xc')](),controller[_0x2ddd('0x13')]);router[_0x2ddd('0x14')](_0x2ddd('0x10'),auth[_0x2ddd('0xc')](),controller['destroy']);module[_0x2ddd('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 3c5cfbb..e6b49e9 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 _0xd3f5=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x77240,_0xce7b54){var _0x27708b=function(_0xf310e6){while(--_0xf310e6){_0x77240['push'](_0x77240['shift']());}};_0x27708b(++_0xce7b54);}(_0xd3f5,0x147));var _0x5d3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3f5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5d3f('0x0'));module[_0x5d3f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5d3f('0x2')]},'calleridnum':{'type':Sequelize[_0x5d3f('0x2')]},'calleridname':{'type':Sequelize[_0x5d3f('0x2')]},'queue':{'type':Sequelize[_0x5d3f('0x2')]},'interface':{'type':Sequelize[_0x5d3f('0x2')]},'membername':{'type':Sequelize[_0x5d3f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5d3f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5d3f('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5d3f('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5d3f('0x4')]},'agentcomplete':{'type':Sequelize[_0x5d3f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5d3f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x5d3f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x5d3f('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5d3f('0x2')]},'channelstate':{'type':Sequelize[_0x5d3f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5d3f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5d3f('0x2')]},'connectedlinename':{'type':Sequelize[_0x5d3f('0x2')]},'language':{'type':Sequelize[_0x5d3f('0x2')]},'accountcode':{'type':Sequelize[_0x5d3f('0x2')]},'context':{'type':Sequelize[_0x5d3f('0x2')]},'exten':{'type':Sequelize[_0x5d3f('0x2')]},'priority':{'type':Sequelize[_0x5d3f('0x2')]},'destchannel':{'type':Sequelize[_0x5d3f('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5d3f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5d3f('0x2')]},'destcalleridname':{'type':Sequelize[_0x5d3f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5d3f('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5d3f('0x2')]},'destaccountcode':{'type':Sequelize[_0x5d3f('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5d3f('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x5d3f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5d3f('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5d3f('0x2')]},'transfer':{'type':Sequelize[_0x5d3f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5d3f('0x2')],'comment':_0x5d3f('0x6')},'transferexten':{'type':Sequelize[_0x5d3f('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x5d3f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4325=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5432('0x2')]},'calleridnum':{'type':Sequelize[_0x5432('0x2')]},'calleridname':{'type':Sequelize[_0x5432('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5432('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5432('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5432('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5432('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5432('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5432('0x5')]},'agentacw':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5432('0x5')]},'reason':{'type':Sequelize[_0x5432('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5432('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'connectedlinename':{'type':Sequelize[_0x5432('0x2')]},'language':{'type':Sequelize[_0x5432('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5432('0x2')]},'priority':{'type':Sequelize[_0x5432('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5432('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5432('0x2')]},'destcalleridname':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5432('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5432('0x2')]},'destexten':{'type':Sequelize[_0x5432('0x2')]},'destpriority':{'type':Sequelize[_0x5432('0x2')]},'destuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5432('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5432('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5432('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5432('0x2')]},'agententerreason':{'type':Sequelize[_0x5432('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index ef2c9b1..9892e83 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(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 0e34c38..cea0132 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 _0xde64=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','VoiceAgentReport'];(function(_0x153bf4,_0x46da96){var _0x873a5f=function(_0x31c7d0){while(--_0x31c7d0){_0x153bf4['push'](_0x153bf4['shift']());}};_0x873a5f(++_0x46da96);}(_0xde64,0x17c));var _0x4de6=function(_0x515339,_0x4a8dc1){_0x515339=_0x515339-0x0;var _0x45d00c=_0xde64[_0x515339];return _0x45d00c;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var logger=require(_0x4de6('0x2'))(_0x4de6('0x3'));var moment=require(_0x4de6('0x4'));var BPromise=require(_0x4de6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4de6('0x6'));var rimraf=require(_0x4de6('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x4de6('0x8')]=function(_0x45867b,_0x4da17f){return _0x45867b['define'](_0x4de6('0x9'),attributes,{'tableName':_0x4de6('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4de6('0xb'),_0x4de6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3bd7=['VoiceAgentReport','../../config/logger','api','moment','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0x2e3756,_0x32670f){var _0x442861=function(_0x3cb36e){while(--_0x3cb36e){_0x2e3756['push'](_0x2e3756['shift']());}};_0x442861(++_0x32670f);}(_0x3bd7,0x199));var _0x73bd=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x3bd7[_0x210d7f];return _0x42d687;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73bd('0x0'))(_0x73bd('0x1'));var moment=require(_0x73bd('0x2'));var BPromise=require('bluebird');var rp=require(_0x73bd('0x3'));var fs=require('fs');var path=require(_0x73bd('0x4'));var rimraf=require(_0x73bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x73bd('0x6'));module['exports']=function(_0xe20fe9,_0x1aa5e1){return _0xe20fe9['define'](_0x73bd('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3661d84..4515657 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 _0xe743=['body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport'];(function(_0x583a9c,_0x5dd018){var _0x328603=function(_0x31b23f){while(--_0x31b23f){_0x583a9c['push'](_0x583a9c['shift']());}};_0x328603(++_0x5dd018);}(_0xe743,0x1a0));var _0x3e74=function(_0x4d19a9,_0x13654f){_0x4d19a9=_0x4d19a9-0x0;var _0x25f71a=_0xe743[_0x4d19a9];return _0x25f71a;};'use strict';var _=require(_0x3e74('0x0'));var util=require(_0x3e74('0x1'));var moment=require(_0x3e74('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e74('0x3'));var fs=require('fs');var Redis=require(_0x3e74('0x4'));var db=require(_0x3e74('0x5'))['db'];var utils=require(_0x3e74('0x6'));var logger=require(_0x3e74('0x7'))(_0x3e74('0x8'));var config=require(_0x3e74('0x9'));var jayson=require(_0x3e74('0xa'));var client=jayson[_0x3e74('0xb')][_0x3e74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e8120,_0x5af694,_0x46b6a7){return new BPromise(function(_0x404aab,_0x5d2f23){return client[_0x3e74('0xd')](_0x2e8120,_0x46b6a7)[_0x3e74('0xe')](function(_0xa1519){logger[_0x3e74('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5af694,_0x3e74('0x10'));logger[_0x3e74('0x11')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x5af694,_0x3e74('0x10'),JSON[_0x3e74('0x12')](_0xa1519));if(_0xa1519['error']){if(_0xa1519[_0x3e74('0x13')][_0x3e74('0x14')]===0x1f4){logger[_0x3e74('0x13')](_0x3e74('0x15'),_0x5af694,_0xa1519[_0x3e74('0x13')]['message']);return _0x5d2f23(_0xa1519['error'][_0x3e74('0x16')]);}logger[_0x3e74('0x13')](_0x3e74('0x15'),_0x5af694,_0xa1519['error'][_0x3e74('0x16')]);return _0x404aab(_0xa1519[_0x3e74('0x13')][_0x3e74('0x16')]);}else{logger[_0x3e74('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5af694,_0x3e74('0x10'));_0x404aab(_0xa1519[_0x3e74('0x17')][_0x3e74('0x16')]);}})[_0x3e74('0x18')](function(_0x54a0c3){logger[_0x3e74('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x5af694,_0x54a0c3);_0x5d2f23(_0x54a0c3);});});}exports['CreateVoiceAgentReport']=function(_0xa729ab){var _0x54f5e4=this;return new Promise(function(_0x10e0fb,_0xf2c86a){return db[_0x3e74('0x19')]['create'](_0xa729ab[_0x3e74('0x1a')],{'raw':_0xa729ab[_0x3e74('0x1b')]?_0xa729ab['options'][_0x3e74('0x1c')]===undefined?!![]:![]:!![]})[_0x3e74('0xe')](function(_0x44bb6e){logger[_0x3e74('0xf')](_0x3e74('0x1d'),_0xa729ab);logger[_0x3e74('0x11')](_0x3e74('0x1d'),_0xa729ab,JSON[_0x3e74('0x12')](_0x44bb6e));_0x10e0fb(_0x44bb6e);})[_0x3e74('0x18')](function(_0x11eb10){logger[_0x3e74('0x13')](_0x3e74('0x1d'),_0x11eb10[_0x3e74('0x16')],_0xa729ab);_0xf2c86a(_0x54f5e4[_0x3e74('0x13')](0x1f4,_0x11eb10[_0x3e74('0x16')]));});});};exports[_0x3e74('0x1e')]=function(_0x47d022){var _0x392773=this;return new Promise(function(_0x451970,_0xba7d99){return db[_0x3e74('0x19')][_0x3e74('0x1f')](_0x47d022[_0x3e74('0x1a')],{'raw':_0x47d022[_0x3e74('0x1b')]?_0x47d022[_0x3e74('0x1b')][_0x3e74('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47d022[_0x3e74('0x1b')]?_0x47d022[_0x3e74('0x1b')][_0x3e74('0x20')]||null:null,'attributes':_0x47d022['options']?_0x47d022['options']['attributes']||null:null,'limit':_0x47d022[_0x3e74('0x1b')]?_0x47d022['options'][_0x3e74('0x21')]||null:null})[_0x3e74('0xe')](function(_0x2a7a9e){logger[_0x3e74('0xf')](_0x3e74('0x1e'),_0x47d022);logger[_0x3e74('0x11')](_0x3e74('0x1e'),_0x47d022,JSON[_0x3e74('0x12')](_0x2a7a9e));_0x451970(_0x2a7a9e);})[_0x3e74('0x18')](function(_0x9ac29e){logger[_0x3e74('0x13')](_0x3e74('0x1e'),_0x9ac29e[_0x3e74('0x16')],_0x47d022);_0xba7d99(_0x392773['error'](0x1f4,_0x9ac29e[_0x3e74('0x16')]));});});}; \ No newline at end of file +var _0xf9d7=['CreateVoiceAgentReport','VoiceAgentReport','body','options','UpdateVoiceAgentReport','raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x26840e,_0x281551){var _0x1ce00b=function(_0x111fd9){while(--_0x111fd9){_0x26840e['push'](_0x26840e['shift']());}};_0x1ce00b(++_0x281551);}(_0xf9d7,0x18d));var _0x7f9d=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0xf9d7[_0x14f458];return _0x4ff2da;};'use strict';var _=require('lodash');var util=require(_0x7f9d('0x0'));var moment=require(_0x7f9d('0x1'));var BPromise=require(_0x7f9d('0x2'));var rs=require(_0x7f9d('0x3'));var fs=require('fs');var Redis=require(_0x7f9d('0x4'));var db=require(_0x7f9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7f9d('0x6'));var config=require(_0x7f9d('0x7'));var jayson=require(_0x7f9d('0x8'));var client=jayson[_0x7f9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336a8f,_0x1d0af8,_0xfc36){return new BPromise(function(_0xdb9a65,_0x473c99){return client[_0x7f9d('0xa')](_0x336a8f,_0xfc36)[_0x7f9d('0xb')](function(_0x357ca3){logger[_0x7f9d('0xc')](_0x7f9d('0xd'),_0x1d0af8,_0x7f9d('0xe'));logger[_0x7f9d('0xf')](_0x7f9d('0x10'),_0x1d0af8,'request\x20sent',JSON[_0x7f9d('0x11')](_0x357ca3));if(_0x357ca3[_0x7f9d('0x12')]){if(_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x13')]===0x1f4){logger[_0x7f9d('0x12')](_0x7f9d('0xd'),_0x1d0af8,_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);return _0x473c99(_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);}logger['error'](_0x7f9d('0xd'),_0x1d0af8,_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);return _0xdb9a65(_0x357ca3['error']['message']);}else{logger[_0x7f9d('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d0af8,_0x7f9d('0xe'));_0xdb9a65(_0x357ca3[_0x7f9d('0x15')][_0x7f9d('0x14')]);}})[_0x7f9d('0x16')](function(_0xfe30a0){logger[_0x7f9d('0x12')](_0x7f9d('0xd'),_0x1d0af8,_0xfe30a0);_0x473c99(_0xfe30a0);});});}exports[_0x7f9d('0x17')]=function(_0x4124f9){var _0x449a30=this;return new Promise(function(_0x29984e,_0x438ed8){return db[_0x7f9d('0x18')]['create'](_0x4124f9[_0x7f9d('0x19')],{'raw':_0x4124f9[_0x7f9d('0x1a')]?_0x4124f9[_0x7f9d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7f9d('0xb')](function(_0x1854ce){logger['info']('CreateVoiceAgentReport',_0x4124f9);logger[_0x7f9d('0xf')](_0x7f9d('0x17'),_0x4124f9,JSON['stringify'](_0x1854ce));_0x29984e(_0x1854ce);})[_0x7f9d('0x16')](function(_0x3f4f32){logger[_0x7f9d('0x12')](_0x7f9d('0x17'),_0x3f4f32[_0x7f9d('0x14')],_0x4124f9);_0x438ed8(_0x449a30['error'](0x1f4,_0x3f4f32[_0x7f9d('0x14')]));});});};exports[_0x7f9d('0x1b')]=function(_0x21caab){var _0x4660b1=this;return new Promise(function(_0x6eb673,_0x12e097){return db[_0x7f9d('0x18')]['update'](_0x21caab[_0x7f9d('0x19')],{'raw':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')][_0x7f9d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')][_0x7f9d('0x1d')]||null:null,'attributes':_0x21caab['options']?_0x21caab['options']['attributes']||null:null,'limit':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')]['limit']||null:null})[_0x7f9d('0xb')](function(_0x4cf295){logger[_0x7f9d('0xc')]('UpdateVoiceAgentReport',_0x21caab);logger[_0x7f9d('0xf')](_0x7f9d('0x1b'),_0x21caab,JSON['stringify'](_0x4cf295));_0x6eb673(_0x4cf295);})[_0x7f9d('0x16')](function(_0x2610ba){logger[_0x7f9d('0x12')](_0x7f9d('0x1b'),_0x2610ba['message'],_0x21caab);_0x12e097(_0x4660b1['error'](0x1f4,_0x2610ba['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4541e1e..f10b144 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 _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xbd50,0x196));var _0x0bd5=function(_0x4823a0,_0x456b11){_0x4823a0=_0x4823a0-0x0;var _0x51c73a=_0xbd50[_0x4823a0];return _0x51c73a;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router; \ No newline at end of file +var _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xca9e,0x136));var _0xeca9=function(_0x1c72df,_0x47d2ac){_0x1c72df=_0x1c72df-0x0;var _0x3dac21=_0xca9e[_0x1c72df];return _0x3dac21;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 60c7e4b..e0eae34 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 _0x2977=['inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM'];(function(_0x10b9b2,_0x416a49){var _0x4075ea=function(_0x2ca0a6){while(--_0x2ca0a6){_0x10b9b2['push'](_0x10b9b2['shift']());}};_0x4075ea(++_0x416a49);}(_0x2977,0xa5));var _0x7297=function(_0x34bb96,_0x3ca12b){_0x34bb96=_0x34bb96-0x0;var _0x36a8a7=_0x2977[_0x34bb96];return _0x36a8a7;};'use strict';var Sequelize=require(_0x7297('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7297('0x1')]},'type':{'type':Sequelize[_0x7297('0x2')](_0x7297('0x3'),_0x7297('0x4'),_0x7297('0x5'),_0x7297('0x6'),_0x7297('0x7'),_0x7297('0x8'))},'tag':{'type':Sequelize[_0x7297('0x1')]},'accountcode':{'type':Sequelize[_0x7297('0x1')]},'source':{'type':Sequelize[_0x7297('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x7297('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7297('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7297('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x7297('0xa')]},'answertime':{'type':Sequelize[_0x7297('0xa')]},'endtime':{'type':Sequelize[_0x7297('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7297('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7297('0x1')]},'amaflags':{'type':Sequelize[_0x7297('0x1')]},'userfield':{'type':Sequelize[_0x7297('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x7297('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7297('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x7297('0x1')]}}; \ No newline at end of file +var _0x7e3b=['internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x4a1db4,_0x48b131){var _0x17073c=function(_0x1fe1e5){while(--_0x1fe1e5){_0x4a1db4['push'](_0x4a1db4['shift']());}};_0x17073c(++_0x48b131);}(_0x7e3b,0xd8));var _0xb7e3=function(_0x54b314,_0x426c6c){_0x54b314=_0x54b314-0x0;var _0x23c139=_0x7e3b[_0x54b314];return _0x23c139;};'use strict';var Sequelize=require('sequelize');module[_0xb7e3('0x0')]={'uniqueid':{'type':Sequelize[_0xb7e3('0x1')]},'type':{'type':Sequelize[_0xb7e3('0x2')](_0xb7e3('0x3'),_0xb7e3('0x4'),_0xb7e3('0x5'),_0xb7e3('0x6'),_0xb7e3('0x7'),_0xb7e3('0x8'))},'tag':{'type':Sequelize[_0xb7e3('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xb7e3('0x1')]},'destination':{'type':Sequelize[_0xb7e3('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb7e3('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xb7e3('0x1')]},'lastapplication':{'type':Sequelize[_0xb7e3('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xb7e3('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb7e3('0x9')]},'endtime':{'type':Sequelize[_0xb7e3('0x9')]},'duration':{'type':Sequelize[_0xb7e3('0xa')]},'billableseconds':{'type':Sequelize[_0xb7e3('0xa')]},'mohtime':{'type':Sequelize[_0xb7e3('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb7e3('0x1')]},'amaflags':{'type':Sequelize[_0xb7e3('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb7e3('0x1')]},'routeid':{'type':Sequelize[_0xb7e3('0xa')]},'sipcallid':{'type':Sequelize[_0xb7e3('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 36a1d44..36802b2 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x2ef3,0xba));var _0x32ef=function(_0x27ddef,_0x2eba1a){_0x27ddef=_0x27ddef-0x0;var _0x3d50a5=_0x2ef3[_0x27ddef];return _0x3d50a5;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 942f75d..c618068 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 _0x3220=['VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x30f1ea,_0x4d1425){var _0x4a4c68=function(_0x53b704){while(--_0x53b704){_0x30f1ea['push'](_0x30f1ea['shift']());}};_0x4a4c68(++_0x4d1425);}(_0x3220,0x1c5));var _0x0322=function(_0xcd161b,_0xddd08c){_0xcd161b=_0xcd161b-0x0;var _0x595dc2=_0x3220[_0xcd161b];return _0x595dc2;};'use strict';var _=require('lodash');var util=require(_0x0322('0x0'));var logger=require(_0x0322('0x1'))(_0x0322('0x2'));var moment=require(_0x0322('0x3'));var BPromise=require(_0x0322('0x4'));var rp=require(_0x0322('0x5'));var fs=require('fs');var path=require(_0x0322('0x6'));var rimraf=require(_0x0322('0x7'));var config=require(_0x0322('0x8'));var attributes=require(_0x0322('0x9'));module[_0x0322('0xa')]=function(_0x2726c5,_0x377c2d){return _0x2726c5[_0x0322('0xb')](_0x0322('0xc'),attributes,{'tableName':_0x0322('0xd'),'paranoid':![],'indexes':[{'fields':[_0x0322('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x851e=['api','moment','request-promise','path','rimraf','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x42d0bb,_0x11dfb2){var _0x29aca9=function(_0x12cad7){while(--_0x12cad7){_0x42d0bb['push'](_0x42d0bb['shift']());}};_0x29aca9(++_0x11dfb2);}(_0x851e,0x13c));var _0xe851=function(_0x337565,_0x3198ec){_0x337565=_0x337565-0x0;var _0x197ff3=_0x851e[_0x337565];return _0x197ff3;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))(_0xe851('0x3'));var moment=require(_0xe851('0x4'));var BPromise=require('bluebird');var rp=require(_0xe851('0x5'));var fs=require('fs');var path=require(_0xe851('0x6'));var rimraf=require(_0xe851('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xe851('0x8')]=function(_0x51d60b,_0x2c4082){return _0x51d60b[_0xe851('0x9')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xe851('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 b9dc8e0..d0f29ee 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 _0x8e4a=['catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','UpdateVoiceCallReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result'];(function(_0x449504,_0x33a666){var _0x1fb62f=function(_0x5f151e){while(--_0x5f151e){_0x449504['push'](_0x449504['shift']());}};_0x1fb62f(++_0x33a666);}(_0x8e4a,0x113));var _0xa8e4=function(_0x4934e6,_0x4767fb){_0x4934e6=_0x4934e6-0x0;var _0x2bdbe7=_0x8e4a[_0x4934e6];return _0x2bdbe7;};'use strict';var _=require(_0xa8e4('0x0'));var util=require(_0xa8e4('0x1'));var moment=require('moment');var BPromise=require(_0xa8e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8e4('0x3'));var db=require(_0xa8e4('0x4'))['db'];var utils=require(_0xa8e4('0x5'));var logger=require(_0xa8e4('0x6'))(_0xa8e4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8e4('0x8')][_0xa8e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x206b99,_0x97f936,_0x14b3ed){return new BPromise(function(_0x4134ec,_0x155023){return client['request'](_0x206b99,_0x14b3ed)[_0xa8e4('0xa')](function(_0x40cc47){logger[_0xa8e4('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x97f936,_0xa8e4('0xc'));logger[_0xa8e4('0xd')](_0xa8e4('0xe'),_0x97f936,_0xa8e4('0xc'),JSON[_0xa8e4('0xf')](_0x40cc47));if(_0x40cc47[_0xa8e4('0x10')]){if(_0x40cc47[_0xa8e4('0x10')][_0xa8e4('0x11')]===0x1f4){logger['error'](_0xa8e4('0x12'),_0x97f936,_0x40cc47[_0xa8e4('0x10')]['message']);return _0x155023(_0x40cc47[_0xa8e4('0x10')][_0xa8e4('0x13')]);}logger[_0xa8e4('0x10')](_0xa8e4('0x12'),_0x97f936,_0x40cc47[_0xa8e4('0x10')][_0xa8e4('0x13')]);return _0x4134ec(_0x40cc47[_0xa8e4('0x10')][_0xa8e4('0x13')]);}else{logger[_0xa8e4('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x97f936,'request\x20sent');_0x4134ec(_0x40cc47[_0xa8e4('0x14')][_0xa8e4('0x13')]);}})[_0xa8e4('0x15')](function(_0x6d1630){logger[_0xa8e4('0x10')](_0xa8e4('0x12'),_0x97f936,_0x6d1630);_0x155023(_0x6d1630);});});}exports[_0xa8e4('0x16')]=function(_0x3bcbda){var _0x51fadc=this;return new Promise(function(_0x2a67de,_0x5023ca){return db['VoiceCallReport'][_0xa8e4('0x17')]({'raw':_0x3bcbda[_0xa8e4('0x18')]?_0x3bcbda[_0xa8e4('0x18')][_0xa8e4('0x19')]===undefined?!![]:![]:!![],'where':_0x3bcbda[_0xa8e4('0x18')]?_0x3bcbda[_0xa8e4('0x18')][_0xa8e4('0x1a')]||null:null,'attributes':_0x3bcbda[_0xa8e4('0x18')]?_0x3bcbda[_0xa8e4('0x18')][_0xa8e4('0x1b')]||null:null,'limit':_0x3bcbda[_0xa8e4('0x18')]?_0x3bcbda['options'][_0xa8e4('0x1c')]||null:null,'include':_0x3bcbda[_0xa8e4('0x18')]?_0x3bcbda[_0xa8e4('0x18')][_0xa8e4('0x1d')]?_[_0xa8e4('0x1e')](_0x3bcbda[_0xa8e4('0x18')][_0xa8e4('0x1d')],function(_0x2fec5e){return{'model':db[_0x2fec5e[_0xa8e4('0x1f')]],'as':_0x2fec5e['as'],'attributes':_0x2fec5e[_0xa8e4('0x1b')],'include':_0x2fec5e[_0xa8e4('0x1d')]?_[_0xa8e4('0x1e')](_0x2fec5e[_0xa8e4('0x1d')],function(_0x138c14){return{'model':db[_0x138c14[_0xa8e4('0x1f')]],'as':_0x138c14['as'],'attributes':_0x138c14[_0xa8e4('0x1b')],'include':_0x138c14[_0xa8e4('0x1d')]?_['map'](_0x138c14[_0xa8e4('0x1d')],function(_0xc5d56b){return{'model':db[_0xc5d56b[_0xa8e4('0x1f')]],'as':_0xc5d56b['as'],'attributes':_0xc5d56b[_0xa8e4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa8e4('0xa')](function(_0x3bb340){logger[_0xa8e4('0xb')](_0xa8e4('0x16'),_0x3bcbda);logger[_0xa8e4('0xd')](_0xa8e4('0x16'),_0x3bcbda,JSON[_0xa8e4('0xf')](_0x3bb340));_0x2a67de(_0x3bb340);})[_0xa8e4('0x15')](function(_0x5c0842){logger[_0xa8e4('0x10')]('GetVoiceCallReport',_0x5c0842['message'],_0x3bcbda);_0x5023ca(_0x51fadc[_0xa8e4('0x10')](0x1f4,_0x5c0842[_0xa8e4('0x13')]));});});};exports[_0xa8e4('0x20')]=function(_0x458a1f){var _0x196382=this;return new Promise(function(_0x16c71a,_0x127d97){return db[_0xa8e4('0x21')][_0xa8e4('0x22')](_0x458a1f['body'],{'raw':_0x458a1f['options']?_0x458a1f[_0xa8e4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xa8e4('0xa')](function(_0x2a2b33){logger[_0xa8e4('0xb')]('CreateVoiceCallReport',_0x458a1f);logger[_0xa8e4('0xd')]('CreateVoiceCallReport',_0x458a1f,JSON[_0xa8e4('0xf')](_0x2a2b33));_0x16c71a(_0x2a2b33);})[_0xa8e4('0x15')](function(_0x506564){logger[_0xa8e4('0x10')](_0xa8e4('0x20'),_0x506564['message'],_0x458a1f);_0x127d97(_0x196382['error'](0x1f4,_0x506564[_0xa8e4('0x13')]));});});};exports[_0xa8e4('0x23')]=function(_0xc43aa8){var _0x4245f3=this;return new Promise(function(_0x250876,_0x11e3d8){return db[_0xa8e4('0x21')][_0xa8e4('0x24')](_0xc43aa8['body'],{'raw':_0xc43aa8[_0xa8e4('0x18')]?_0xc43aa8['options'][_0xa8e4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc43aa8[_0xa8e4('0x18')]?_0xc43aa8[_0xa8e4('0x18')]['where']||null:null,'attributes':_0xc43aa8[_0xa8e4('0x18')]?_0xc43aa8[_0xa8e4('0x18')][_0xa8e4('0x1b')]||null:null,'limit':_0xc43aa8[_0xa8e4('0x18')]?_0xc43aa8[_0xa8e4('0x18')][_0xa8e4('0x1c')]||null:null})[_0xa8e4('0xa')](function(_0x34bcba){logger[_0xa8e4('0xb')](_0xa8e4('0x23'),_0xc43aa8);logger['debug'](_0xa8e4('0x23'),_0xc43aa8,JSON[_0xa8e4('0xf')](_0x34bcba));_0x250876(_0x34bcba);})[_0xa8e4('0x15')](function(_0xabdfed){logger['error'](_0xa8e4('0x23'),_0xabdfed[_0xa8e4('0x13')],_0xc43aa8);_0x11e3d8(_0x4245f3[_0xa8e4('0x10')](0x1f4,_0xabdfed[_0xa8e4('0x13')]));});});}; \ No newline at end of file +var _0x2435=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','stringify','VoiceCallReport','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2435,0xde));var _0x5243=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x2435[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require('lodash');var util=require(_0x5243('0x0'));var moment=require(_0x5243('0x1'));var BPromise=require(_0x5243('0x2'));var rs=require(_0x5243('0x3'));var fs=require('fs');var Redis=require(_0x5243('0x4'));var db=require(_0x5243('0x5'))['db'];var utils=require(_0x5243('0x6'));var logger=require(_0x5243('0x7'))(_0x5243('0x8'));var config=require(_0x5243('0x9'));var jayson=require(_0x5243('0xa'));var client=jayson[_0x5243('0xb')][_0x5243('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x199df3,_0x3e2656,_0x1fe72d){return new BPromise(function(_0x1379fa,_0x24ad9e){return client[_0x5243('0xd')](_0x199df3,_0x1fe72d)[_0x5243('0xe')](function(_0x3c5b66){logger[_0x5243('0xf')](_0x5243('0x10'),_0x3e2656,_0x5243('0x11'));logger[_0x5243('0x12')](_0x5243('0x13'),_0x3e2656,'request\x20sent',JSON['stringify'](_0x3c5b66));if(_0x3c5b66[_0x5243('0x14')]){if(_0x3c5b66['error'][_0x5243('0x15')]===0x1f4){logger[_0x5243('0x14')](_0x5243('0x10'),_0x3e2656,_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);return _0x24ad9e(_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3e2656,_0x3c5b66['error'][_0x5243('0x16')]);return _0x1379fa(_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);}else{logger[_0x5243('0xf')](_0x5243('0x10'),_0x3e2656,_0x5243('0x11'));_0x1379fa(_0x3c5b66[_0x5243('0x17')][_0x5243('0x16')]);}})[_0x5243('0x18')](function(_0x345c83){logger[_0x5243('0x14')](_0x5243('0x10'),_0x3e2656,_0x345c83);_0x24ad9e(_0x345c83);});});}exports['GetVoiceCallReport']=function(_0x3167d3){var _0x5e8c47=this;return new Promise(function(_0x112284,_0x424b71){return db['VoiceCallReport']['findAll']({'raw':_0x3167d3['options']?_0x3167d3[_0x5243('0x19')][_0x5243('0x1a')]===undefined?!![]:![]:!![],'where':_0x3167d3[_0x5243('0x19')]?_0x3167d3['options'][_0x5243('0x1b')]||null:null,'attributes':_0x3167d3['options']?_0x3167d3[_0x5243('0x19')][_0x5243('0x1c')]||null:null,'limit':_0x3167d3[_0x5243('0x19')]?_0x3167d3[_0x5243('0x19')][_0x5243('0x1d')]||null:null,'include':_0x3167d3[_0x5243('0x19')]?_0x3167d3[_0x5243('0x19')][_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x3167d3[_0x5243('0x19')][_0x5243('0x1e')],function(_0x112921){return{'model':db[_0x112921[_0x5243('0x20')]],'as':_0x112921['as'],'attributes':_0x112921['attributes'],'include':_0x112921[_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x112921['include'],function(_0x3c2d0b){return{'model':db[_0x3c2d0b[_0x5243('0x20')]],'as':_0x3c2d0b['as'],'attributes':_0x3c2d0b['attributes'],'include':_0x3c2d0b[_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x3c2d0b[_0x5243('0x1e')],function(_0x38b8a2){return{'model':db[_0x38b8a2[_0x5243('0x20')]],'as':_0x38b8a2['as'],'attributes':_0x38b8a2[_0x5243('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5243('0xe')](function(_0x3527cc){logger['info']('GetVoiceCallReport',_0x3167d3);logger['debug'](_0x5243('0x21'),_0x3167d3,JSON[_0x5243('0x22')](_0x3527cc));_0x112284(_0x3527cc);})['catch'](function(_0x57e21a){logger['error'](_0x5243('0x21'),_0x57e21a['message'],_0x3167d3);_0x424b71(_0x5e8c47[_0x5243('0x14')](0x1f4,_0x57e21a[_0x5243('0x16')]));});});};exports['CreateVoiceCallReport']=function(_0x218e17){var _0x2eda36=this;return new Promise(function(_0x269573,_0x1061e5){return db[_0x5243('0x23')]['create'](_0x218e17[_0x5243('0x24')],{'raw':_0x218e17[_0x5243('0x19')]?_0x218e17[_0x5243('0x19')][_0x5243('0x1a')]===undefined?!![]:![]:!![]})[_0x5243('0xe')](function(_0x108544){logger['info']('CreateVoiceCallReport',_0x218e17);logger[_0x5243('0x12')](_0x5243('0x25'),_0x218e17,JSON[_0x5243('0x22')](_0x108544));_0x269573(_0x108544);})[_0x5243('0x18')](function(_0x2a9ec2){logger[_0x5243('0x14')](_0x5243('0x25'),_0x2a9ec2[_0x5243('0x16')],_0x218e17);_0x1061e5(_0x2eda36[_0x5243('0x14')](0x1f4,_0x2a9ec2[_0x5243('0x16')]));});});};exports[_0x5243('0x26')]=function(_0x1ead73){var _0x277037=this;return new Promise(function(_0x53f4c2,_0x185cfa){return db[_0x5243('0x23')][_0x5243('0x27')](_0x1ead73[_0x5243('0x24')],{'raw':_0x1ead73[_0x5243('0x19')]?_0x1ead73['options'][_0x5243('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ead73[_0x5243('0x19')]?_0x1ead73[_0x5243('0x19')][_0x5243('0x1b')]||null:null,'attributes':_0x1ead73['options']?_0x1ead73[_0x5243('0x19')][_0x5243('0x1c')]||null:null,'limit':_0x1ead73[_0x5243('0x19')]?_0x1ead73[_0x5243('0x19')][_0x5243('0x1d')]||null:null})[_0x5243('0xe')](function(_0xe4ccb6){logger[_0x5243('0xf')]('UpdateVoiceCallReport',_0x1ead73);logger[_0x5243('0x12')](_0x5243('0x26'),_0x1ead73,JSON[_0x5243('0x22')](_0xe4ccb6));_0x53f4c2(_0xe4ccb6);})[_0x5243('0x18')](function(_0x5af4ab){logger[_0x5243('0x14')](_0x5243('0x26'),_0x5af4ab[_0x5243('0x16')],_0x1ead73);_0x185cfa(_0x277037['error'](0x1f4,_0x5af4ab['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9b8e31c..ad308a7 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 _0x24ad=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','put','update','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ad,0xfa));var _0xd24a=function(_0x41f254,_0x545f8a){_0x41f254=_0x41f254-0x0;var _0x11b5a5=_0x24ad[_0x41f254];return _0x11b5a5;};'use strict';var multer=require(_0xd24a('0x0'));var util=require(_0xd24a('0x1'));var path=require('path');var timeout=require(_0xd24a('0x2'));var express=require(_0xd24a('0x3'));var router=express['Router']();var fs_extra=require(_0xd24a('0x4'));var auth=require(_0xd24a('0x5'));var interaction=require(_0xd24a('0x6'));var config=require(_0xd24a('0x7'));var controller=require(_0xd24a('0x8'));router[_0xd24a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd24a('0xa')]);router[_0xd24a('0x9')](_0xd24a('0xb'),auth[_0xd24a('0xc')](),controller[_0xd24a('0xd')]);router['post']('/',auth[_0xd24a('0xc')](),controller['create']);router[_0xd24a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd24a('0xf')]);router[_0xd24a('0x10')](_0xd24a('0xb'),auth[_0xd24a('0xc')](),controller['destroy']);module[_0xd24a('0x11')]=router; \ No newline at end of file +var _0x2331=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','post','create','put','/:id'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x2331,0x1b3));var _0x1233=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2331[_0x3d13bb];return _0x4b5a1b;};'use strict';var multer=require(_0x1233('0x0'));var util=require(_0x1233('0x1'));var path=require(_0x1233('0x2'));var timeout=require(_0x1233('0x3'));var express=require(_0x1233('0x4'));var router=express[_0x1233('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1233('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1233('0x7'));var controller=require(_0x1233('0x8'));router[_0x1233('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x1233('0xa')](),controller['show']);router[_0x1233('0xb')]('/',auth[_0x1233('0xa')](),controller[_0x1233('0xc')]);router[_0x1233('0xd')](_0x1233('0xe'),auth[_0x1233('0xa')](),controller[_0x1233('0xf')]);router['delete'](_0x1233('0xe'),auth['isAuthenticated'](),controller[_0x1233('0x10')]);module[_0x1233('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4b8f229..9810ed8 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 _0x4f0a=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','options'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x4f0a,0xf3));var _0xa4f0=function(_0x47e93d,_0x26bbdd){_0x47e93d=_0x47e93d-0x0;var _0xe86c46=_0x4f0a[_0x47e93d];return _0xe86c46;};'use strict';var Sequelize=require(_0xa4f0('0x0'));module[_0xa4f0('0x1')]={'name':{'type':Sequelize[_0xa4f0('0x2')]},'prefix':{'type':Sequelize[_0xa4f0('0x2')],'unique':_0xa4f0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xa4f0('0x2')],'set':function(_0xe048e9){this['setDataValue'](_0xa4f0('0x4'),_0xe048e9?_0xe048e9[_0xa4f0('0x5')](''):[]);},'get':function(){return this[_0xa4f0('0x6')]('options')?this['getDataValue'](_0xa4f0('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xa4f0('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xa4f0('0x2')]},'record':{'type':Sequelize[_0xa4f0('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa4f0('0x2')]}}; \ No newline at end of file +var _0x385b=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x3ba0e8,_0x96adc1){var _0x1ae36a=function(_0x5be0ff){while(--_0x5be0ff){_0x3ba0e8['push'](_0x3ba0e8['shift']());}};_0x1ae36a(++_0x96adc1);}(_0x385b,0x6f));var _0xb385=function(_0x33c9d7,_0x65cd8f){_0x33c9d7=_0x33c9d7-0x0;var _0x99cd88=_0x385b[_0x33c9d7];return _0x99cd88;};'use strict';var Sequelize=require(_0xb385('0x0'));module[_0xb385('0x1')]={'name':{'type':Sequelize[_0xb385('0x2')]},'prefix':{'type':Sequelize[_0xb385('0x2')],'unique':_0xb385('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb385('0x2')],'set':function(_0x40d0f7){this[_0xb385('0x4')](_0xb385('0x5'),_0x40d0f7?_0x40d0f7[_0xb385('0x6')](''):[]);},'get':function(){return this[_0xb385('0x7')](_0xb385('0x5'))?this[_0xb385('0x7')](_0xb385('0x5'))[_0xb385('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xb385('0x2')]},'record':{'type':Sequelize[_0xb385('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e8d8c89..4376cce 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 _0x823c=['find','create','body','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','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','end','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4bbb10,_0x417407){var _0x513ac6=function(_0x234b31){while(--_0x234b31){_0x4bbb10['push'](_0x4bbb10['shift']());}};_0x513ac6(++_0x417407);}(_0x823c,0x143));var _0xc823=function(_0x4e58c7,_0x185884){_0x4e58c7=_0x4e58c7-0x0;var _0x54f3ab=_0x823c[_0x4e58c7];return _0x54f3ab;};'use strict';var emlformat=require(_0xc823('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc823('0x1'));var jsonpatch=require(_0xc823('0x2'));var rp=require(_0xc823('0x3'));var moment=require(_0xc823('0x4'));var BPromise=require(_0xc823('0x5'));var Mustache=require(_0xc823('0x6'));var util=require('util');var path=require(_0xc823('0x7'));var sox=require(_0xc823('0x8'));var csv=require(_0xc823('0x9'));var ejs=require(_0xc823('0xa'));var fs=require('fs');var fs_extra=require(_0xc823('0xb'));var _=require('lodash');var squel=require(_0xc823('0xc'));var crypto=require(_0xc823('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc823('0x9'));var querystring=require(_0xc823('0xe'));var Papa=require('papaparse');var Redis=require(_0xc823('0xf'));var authService=require(_0xc823('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc823('0x11'));var logger=require(_0xc823('0x12'))(_0xc823('0x13'));var utils=require(_0xc823('0x14'));var config=require(_0xc823('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc823('0x16'))['db'];function respondWithStatusCode(_0x80372,_0x11c0fd){_0x11c0fd=_0x11c0fd||0xcc;return function(_0x1546b9){if(_0x1546b9){return _0x80372[_0xc823('0x17')](_0x11c0fd);}return _0x80372[_0xc823('0x18')](_0x11c0fd)['end']();};}function respondWithResult(_0x1e4425,_0xff0ec2){_0xff0ec2=_0xff0ec2||0xc8;return function(_0x4daac9){if(_0x4daac9){return _0x1e4425[_0xc823('0x18')](_0xff0ec2)['json'](_0x4daac9);}};}function respondWithFilteredResult(_0x4bc9c9,_0x59749d){return function(_0x5bdfc9){if(_0x5bdfc9){var _0x565aeb=typeof _0x59749d['offset']===_0xc823('0x19')&&typeof _0x59749d[_0xc823('0x1a')]===_0xc823('0x19');var _0x2ff583=_0x5bdfc9[_0xc823('0x1b')];var _0x1aca6d=_0x565aeb?0x0:_0x59749d[_0xc823('0x1c')];var _0x58b7c7=_0x565aeb?_0x5bdfc9[_0xc823('0x1b')]:_0x59749d['offset']+_0x59749d[_0xc823('0x1a')];var _0x3aa68f;if(_0x58b7c7>=_0x2ff583){_0x58b7c7=_0x2ff583;_0x3aa68f=0xc8;}else{_0x3aa68f=0xce;}_0x4bc9c9[_0xc823('0x18')](_0x3aa68f);return _0x4bc9c9['set'](_0xc823('0x1d'),_0x1aca6d+'-'+_0x58b7c7+'/'+_0x2ff583)[_0xc823('0x1e')](_0x5bdfc9);}return null;};}function patchUpdates(_0x3a3fcd){return function(_0x599e59){try{jsonpatch[_0xc823('0x1f')](_0x599e59,_0x3a3fcd,!![]);}catch(_0x325c8a){return BPromise[_0xc823('0x20')](_0x325c8a);}return _0x599e59[_0xc823('0x21')]();};}function saveUpdates(_0x574c76,_0x414c86){return function(_0x5dcb4e){if(_0x5dcb4e){return _0x5dcb4e[_0xc823('0x22')](_0x574c76)['then'](function(_0x510460){return _0x510460;});}return null;};}function removeEntity(_0x3af14f,_0x3cead8){return function(_0x52c941){if(_0x52c941){return _0x52c941[_0xc823('0x23')]()[_0xc823('0x24')](function(){var _0x451f7a=_0x52c941[_0xc823('0x25')]({'plain':!![]});var _0x263865=_0xc823('0x26');return db[_0xc823('0x27')][_0xc823('0x23')]({'where':{'type':_0x263865,'resourceId':_0x451f7a['id']}})[_0xc823('0x24')](function(){return _0x52c941;});})[_0xc823('0x24')](function(){_0x3af14f['status'](0xcc)[_0xc823('0x28')]();});}};}function handleEntityNotFound(_0x533560,_0x54e956){return function(_0x15ac97){if(!_0x15ac97){_0x533560[_0xc823('0x17')](0x194);}return _0x15ac97;};}function handleError(_0x1c79dd,_0x2d60ee){_0x2d60ee=_0x2d60ee||0x1f4;return function(_0x20d2b1){logger[_0xc823('0x29')](_0x20d2b1[_0xc823('0x2a')]);if(_0x20d2b1[_0xc823('0x2b')]){delete _0x20d2b1[_0xc823('0x2b')];}_0x1c79dd[_0xc823('0x18')](_0x2d60ee)[_0xc823('0x2c')](_0x20d2b1);};}exports[_0xc823('0x2d')]=function(_0x352b61,_0xda39a3){var _0x1c839f={},_0x52bd31={},_0x1b492a={'count':0x0,'rows':[]};var _0x34af84=_[_0xc823('0x2e')](db[_0xc823('0x2f')][_0xc823('0x30')],function(_0x507a10){return{'name':_0x507a10['fieldName'],'type':_0x507a10['type'][_0xc823('0x31')]};});_0x52bd31[_0xc823('0x32')]=_[_0xc823('0x2e')](_0x34af84,_0xc823('0x2b'));_0x52bd31['query']=_[_0xc823('0x33')](_0x352b61[_0xc823('0x34')]);_0x52bd31[_0xc823('0x35')]=_[_0xc823('0x36')](_0x52bd31[_0xc823('0x32')],_0x52bd31[_0xc823('0x34')]);_0x1c839f[_0xc823('0x37')]=_[_0xc823('0x36')](_0x52bd31[_0xc823('0x32')],qs[_0xc823('0x38')](_0x352b61[_0xc823('0x34')][_0xc823('0x38')]));_0x1c839f[_0xc823('0x37')]=_0x1c839f['attributes'][_0xc823('0x39')]?_0x1c839f[_0xc823('0x37')]:_0x52bd31[_0xc823('0x32')];if(!_0x352b61[_0xc823('0x34')][_0xc823('0x3a')](_0xc823('0x3b'))){_0x1c839f['limit']=qs[_0xc823('0x1a')](_0x352b61[_0xc823('0x34')]['limit']);_0x1c839f[_0xc823('0x1c')]=qs['offset'](_0x352b61[_0xc823('0x34')][_0xc823('0x1c')]);}_0x1c839f['order']=qs[_0xc823('0x3c')](_0x352b61[_0xc823('0x34')][_0xc823('0x3c')]);_0x1c839f[_0xc823('0x3d')]=qs[_0xc823('0x35')](_[_0xc823('0x3e')](_0x352b61[_0xc823('0x34')],_0x52bd31['filters']),_0x34af84);if(_0x352b61['query']['filter']){_0x1c839f[_0xc823('0x3d')]=_[_0xc823('0x3f')](_0x1c839f[_0xc823('0x3d')],{'$or':_[_0xc823('0x2e')](_0x34af84,function(_0xc3bba){if(_0xc3bba['type']!==_0xc823('0x40')){var _0x28e575={};_0x28e575[_0xc3bba[_0xc823('0x2b')]]={'$like':'%'+_0x352b61[_0xc823('0x34')]['filter']+'%'};return _0x28e575;}})});}_0x1c839f=_['merge']({},_0x1c839f,_0x352b61['options']);var _0x3f72a4={'where':_0x1c839f[_0xc823('0x3d')]};return db[_0xc823('0x2f')]['count'](_0x3f72a4)[_0xc823('0x24')](function(_0x4aa160){_0x1b492a[_0xc823('0x1b')]=_0x4aa160;if(_0x352b61[_0xc823('0x34')][_0xc823('0x41')]){_0x1c839f[_0xc823('0x42')]=[{'all':!![]}];}return db[_0xc823('0x2f')][_0xc823('0x43')](_0x1c839f);})[_0xc823('0x24')](function(_0x521e47){_0x1b492a[_0xc823('0x44')]=_0x521e47;return _0x1b492a;})['then'](respondWithFilteredResult(_0xda39a3,_0x1c839f))[_0xc823('0x45')](handleError(_0xda39a3,null));};exports[_0xc823('0x46')]=function(_0x3f6955,_0x4a5c9f){var _0xa54cc1={'raw':![],'where':{'id':_0x3f6955[_0xc823('0x47')]['id']}},_0x2978a9={};_0x2978a9[_0xc823('0x32')]=_['keys'](db[_0xc823('0x2f')][_0xc823('0x30')]);_0x2978a9['query']=_[_0xc823('0x33')](_0x3f6955[_0xc823('0x34')]);_0x2978a9[_0xc823('0x35')]=_[_0xc823('0x36')](_0x2978a9[_0xc823('0x32')],_0x2978a9[_0xc823('0x34')]);_0xa54cc1[_0xc823('0x37')]=_[_0xc823('0x36')](_0x2978a9[_0xc823('0x32')],qs['fields'](_0x3f6955[_0xc823('0x34')][_0xc823('0x38')]));_0xa54cc1['attributes']=_0xa54cc1[_0xc823('0x37')][_0xc823('0x39')]?_0xa54cc1['attributes']:_0x2978a9[_0xc823('0x32')];if(_0x3f6955['query'][_0xc823('0x41')]){_0xa54cc1[_0xc823('0x42')]=[{'all':!![]}];}_0xa54cc1=_['merge']({},_0xa54cc1,_0x3f6955['options']);return db[_0xc823('0x2f')][_0xc823('0x48')](_0xa54cc1)[_0xc823('0x24')](handleEntityNotFound(_0x4a5c9f,null))[_0xc823('0x24')](respondWithResult(_0x4a5c9f,null))[_0xc823('0x45')](handleError(_0x4a5c9f,null));};exports[_0xc823('0x49')]=function(_0x190a72,_0x1ae82d){return db['VoiceChanSpy'][_0xc823('0x49')](_0x190a72[_0xc823('0x4a')],{})['then'](function(_0x56fc87){var _0xffa480=_0x190a72['user']['get']({'plain':!![]});if(!_0xffa480)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffa480['role']==='user'){var _0x511d71=_0x56fc87[_0xc823('0x25')]({'plain':!![]});var _0x4b5cdb='ChanSpies';return db[_0xc823('0x4b')]['find']({'where':{'name':_0x4b5cdb,'userProfileId':_0xffa480[_0xc823('0x4c')]},'raw':!![]})[_0xc823('0x24')](function(_0x5b1612){if(_0x5b1612&&_0x5b1612[_0xc823('0x4d')]===0x0){return db[_0xc823('0x27')][_0xc823('0x49')]({'name':_0x511d71['name'],'resourceId':_0x511d71['id'],'type':_0x5b1612['name'],'sectionId':_0x5b1612['id']},{})[_0xc823('0x24')](function(){return _0x56fc87;});}else{return _0x56fc87;}})[_0xc823('0x45')](function(_0x5bbf90){logger[_0xc823('0x29')](_0xc823('0x4e'),_0x5bbf90);throw _0x5bbf90;});}return _0x56fc87;})[_0xc823('0x24')](respondWithResult(_0x1ae82d,0xc9))['catch'](handleError(_0x1ae82d,null));};exports[_0xc823('0x22')]=function(_0x5ea2f0,_0x36ffba){if(_0x5ea2f0[_0xc823('0x4a')]['id']){delete _0x5ea2f0[_0xc823('0x4a')]['id'];}return db[_0xc823('0x2f')][_0xc823('0x48')]({'where':{'id':_0x5ea2f0['params']['id']}})[_0xc823('0x24')](handleEntityNotFound(_0x36ffba,null))[_0xc823('0x24')](saveUpdates(_0x5ea2f0[_0xc823('0x4a')],null))[_0xc823('0x24')](respondWithResult(_0x36ffba,null))[_0xc823('0x45')](handleError(_0x36ffba,null));};exports[_0xc823('0x23')]=function(_0x37d7b4,_0x5e7527){return db[_0xc823('0x2f')][_0xc823('0x48')]({'where':{'id':_0x37d7b4[_0xc823('0x47')]['id']}})[_0xc823('0x24')](handleEntityNotFound(_0x5e7527,null))[_0xc823('0x24')](removeEntity(_0x5e7527,null))[_0xc823('0x45')](handleError(_0x5e7527,null));}; \ No newline at end of file +var _0x25a3=['end','sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25a3,0x121));var _0x325a=function(_0x17c2d9,_0x3596b0){_0x17c2d9=_0x17c2d9-0x0;var _0x450828=_0x25a3[_0x17c2d9];return _0x450828;};'use strict';var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x325a('0x3'));var moment=require('moment');var BPromise=require(_0x325a('0x4'));var Mustache=require(_0x325a('0x5'));var util=require(_0x325a('0x6'));var path=require('path');var sox=require(_0x325a('0x7'));var csv=require(_0x325a('0x8'));var ejs=require(_0x325a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x325a('0xa'));var crypto=require(_0x325a('0xb'));var jsforce=require(_0x325a('0xc'));var deskjs=require(_0x325a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325a('0xe'));var Redis=require(_0x325a('0xf'));var authService=require(_0x325a('0x10'));var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require('../../config/logger')(_0x325a('0x14'));var utils=require(_0x325a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x325a('0x16'));var db=require(_0x325a('0x17'))['db'];function respondWithStatusCode(_0x2a8750,_0x3e90fe){_0x3e90fe=_0x3e90fe||0xcc;return function(_0x4e3b88){if(_0x4e3b88){return _0x2a8750['sendStatus'](_0x3e90fe);}return _0x2a8750[_0x325a('0x18')](_0x3e90fe)['end']();};}function respondWithResult(_0x3d12d5,_0xa8dc3a){_0xa8dc3a=_0xa8dc3a||0xc8;return function(_0x3db556){if(_0x3db556){return _0x3d12d5[_0x325a('0x18')](_0xa8dc3a)[_0x325a('0x19')](_0x3db556);}};}function respondWithFilteredResult(_0x3d198c,_0x1d7efc){return function(_0x4412ba){if(_0x4412ba){var _0x1fd4ec=typeof _0x1d7efc[_0x325a('0x1a')]===_0x325a('0x1b')&&typeof _0x1d7efc[_0x325a('0x1c')]===_0x325a('0x1b');var _0x1dcafe=_0x4412ba['count'];var _0x4cba7=_0x1fd4ec?0x0:_0x1d7efc[_0x325a('0x1a')];var _0x4a1f9f=_0x1fd4ec?_0x4412ba[_0x325a('0x1d')]:_0x1d7efc[_0x325a('0x1a')]+_0x1d7efc[_0x325a('0x1c')];var _0x297599;if(_0x4a1f9f>=_0x1dcafe){_0x4a1f9f=_0x1dcafe;_0x297599=0xc8;}else{_0x297599=0xce;}_0x3d198c[_0x325a('0x18')](_0x297599);return _0x3d198c[_0x325a('0x1e')](_0x325a('0x1f'),_0x4cba7+'-'+_0x4a1f9f+'/'+_0x1dcafe)[_0x325a('0x19')](_0x4412ba);}return null;};}function patchUpdates(_0x347f2d){return function(_0x1d76b7){try{jsonpatch[_0x325a('0x20')](_0x1d76b7,_0x347f2d,!![]);}catch(_0x11f0cb){return BPromise['reject'](_0x11f0cb);}return _0x1d76b7[_0x325a('0x21')]();};}function saveUpdates(_0x32a2f5,_0x18e29f){return function(_0x192e83){if(_0x192e83){return _0x192e83[_0x325a('0x22')](_0x32a2f5)[_0x325a('0x23')](function(_0x4c21bf){return _0x4c21bf;});}return null;};}function removeEntity(_0x36b2ac,_0x4c403d){return function(_0x15b5a6){if(_0x15b5a6){return _0x15b5a6[_0x325a('0x24')]()[_0x325a('0x23')](function(){var _0x22c4a6=_0x15b5a6[_0x325a('0x25')]({'plain':!![]});var _0x4b3d65=_0x325a('0x26');return db['UserProfileResource'][_0x325a('0x24')]({'where':{'type':_0x4b3d65,'resourceId':_0x22c4a6['id']}})[_0x325a('0x23')](function(){return _0x15b5a6;});})[_0x325a('0x23')](function(){_0x36b2ac['status'](0xcc)[_0x325a('0x27')]();});}};}function handleEntityNotFound(_0x33bfc0,_0x2514df){return function(_0x473d91){if(!_0x473d91){_0x33bfc0[_0x325a('0x28')](0x194);}return _0x473d91;};}function handleError(_0x18a8d7,_0x19b002){_0x19b002=_0x19b002||0x1f4;return function(_0x49d93b){logger[_0x325a('0x29')](_0x49d93b['stack']);if(_0x49d93b[_0x325a('0x2a')]){delete _0x49d93b[_0x325a('0x2a')];}_0x18a8d7[_0x325a('0x18')](_0x19b002)[_0x325a('0x2b')](_0x49d93b);};}exports[_0x325a('0x2c')]=function(_0x5acbcd,_0x27b3f7){var _0x4b1e46={},_0x34ef69={},_0x1f487e={'count':0x0,'rows':[]};var _0x5b66e9=_[_0x325a('0x2d')](db[_0x325a('0x2e')][_0x325a('0x2f')],function(_0x4129b3){return{'name':_0x4129b3['fieldName'],'type':_0x4129b3[_0x325a('0x30')][_0x325a('0x31')]};});_0x34ef69[_0x325a('0x32')]=_[_0x325a('0x2d')](_0x5b66e9,'name');_0x34ef69[_0x325a('0x33')]=_[_0x325a('0x34')](_0x5acbcd[_0x325a('0x33')]);_0x34ef69[_0x325a('0x35')]=_[_0x325a('0x36')](_0x34ef69[_0x325a('0x32')],_0x34ef69['query']);_0x4b1e46[_0x325a('0x37')]=_[_0x325a('0x36')](_0x34ef69['model'],qs[_0x325a('0x38')](_0x5acbcd[_0x325a('0x33')]['fields']));_0x4b1e46[_0x325a('0x37')]=_0x4b1e46['attributes'][_0x325a('0x39')]?_0x4b1e46[_0x325a('0x37')]:_0x34ef69[_0x325a('0x32')];if(!_0x5acbcd[_0x325a('0x33')]['hasOwnProperty'](_0x325a('0x3a'))){_0x4b1e46['limit']=qs[_0x325a('0x1c')](_0x5acbcd['query']['limit']);_0x4b1e46[_0x325a('0x1a')]=qs[_0x325a('0x1a')](_0x5acbcd[_0x325a('0x33')]['offset']);}_0x4b1e46[_0x325a('0x3b')]=qs['sort'](_0x5acbcd[_0x325a('0x33')][_0x325a('0x3c')]);_0x4b1e46[_0x325a('0x3d')]=qs[_0x325a('0x35')](_[_0x325a('0x3e')](_0x5acbcd[_0x325a('0x33')],_0x34ef69[_0x325a('0x35')]),_0x5b66e9);if(_0x5acbcd[_0x325a('0x33')]['filter']){_0x4b1e46[_0x325a('0x3d')]=_[_0x325a('0x3f')](_0x4b1e46[_0x325a('0x3d')],{'$or':_[_0x325a('0x2d')](_0x5b66e9,function(_0x3056f8){if(_0x3056f8[_0x325a('0x30')]!==_0x325a('0x40')){var _0x145c1f={};_0x145c1f[_0x3056f8[_0x325a('0x2a')]]={'$like':'%'+_0x5acbcd['query'][_0x325a('0x41')]+'%'};return _0x145c1f;}})});}_0x4b1e46=_[_0x325a('0x3f')]({},_0x4b1e46,_0x5acbcd[_0x325a('0x42')]);var _0x2b2f05={'where':_0x4b1e46[_0x325a('0x3d')]};return db[_0x325a('0x2e')][_0x325a('0x1d')](_0x2b2f05)[_0x325a('0x23')](function(_0x384e62){_0x1f487e[_0x325a('0x1d')]=_0x384e62;if(_0x5acbcd[_0x325a('0x33')]['includeAll']){_0x4b1e46[_0x325a('0x43')]=[{'all':!![]}];}return db[_0x325a('0x2e')][_0x325a('0x44')](_0x4b1e46);})[_0x325a('0x23')](function(_0x2750dd){_0x1f487e[_0x325a('0x45')]=_0x2750dd;return _0x1f487e;})['then'](respondWithFilteredResult(_0x27b3f7,_0x4b1e46))[_0x325a('0x46')](handleError(_0x27b3f7,null));};exports[_0x325a('0x47')]=function(_0x2984f3,_0x363682){var _0x1f46e9={'raw':![],'where':{'id':_0x2984f3[_0x325a('0x48')]['id']}},_0x5924af={};_0x5924af[_0x325a('0x32')]=_[_0x325a('0x34')](db['VoiceChanSpy'][_0x325a('0x2f')]);_0x5924af[_0x325a('0x33')]=_[_0x325a('0x34')](_0x2984f3['query']);_0x5924af['filters']=_[_0x325a('0x36')](_0x5924af[_0x325a('0x32')],_0x5924af[_0x325a('0x33')]);_0x1f46e9[_0x325a('0x37')]=_['intersection'](_0x5924af[_0x325a('0x32')],qs[_0x325a('0x38')](_0x2984f3['query'][_0x325a('0x38')]));_0x1f46e9[_0x325a('0x37')]=_0x1f46e9['attributes'][_0x325a('0x39')]?_0x1f46e9[_0x325a('0x37')]:_0x5924af['model'];if(_0x2984f3[_0x325a('0x33')]['includeAll']){_0x1f46e9['include']=[{'all':!![]}];}_0x1f46e9=_[_0x325a('0x3f')]({},_0x1f46e9,_0x2984f3[_0x325a('0x42')]);return db[_0x325a('0x2e')]['find'](_0x1f46e9)[_0x325a('0x23')](handleEntityNotFound(_0x363682,null))[_0x325a('0x23')](respondWithResult(_0x363682,null))['catch'](handleError(_0x363682,null));};exports['create']=function(_0x1009dc,_0x2002c4){return db['VoiceChanSpy'][_0x325a('0x49')](_0x1009dc['body'],{})['then'](function(_0x54b6d4){var _0x5f6c4b=_0x1009dc[_0x325a('0x4a')]['get']({'plain':!![]});if(!_0x5f6c4b)throw new Error(_0x325a('0x4b'));if(_0x5f6c4b[_0x325a('0x4c')]==='user'){var _0x37b66f=_0x54b6d4[_0x325a('0x25')]({'plain':!![]});var _0x12a4c6=_0x325a('0x26');return db[_0x325a('0x4d')][_0x325a('0x4e')]({'where':{'name':_0x12a4c6,'userProfileId':_0x5f6c4b['userProfileId']},'raw':!![]})[_0x325a('0x23')](function(_0x97414a){if(_0x97414a&&_0x97414a['autoAssociation']===0x0){return db[_0x325a('0x4f')]['create']({'name':_0x37b66f[_0x325a('0x2a')],'resourceId':_0x37b66f['id'],'type':_0x97414a[_0x325a('0x2a')],'sectionId':_0x97414a['id']},{})[_0x325a('0x23')](function(){return _0x54b6d4;});}else{return _0x54b6d4;}})[_0x325a('0x46')](function(_0x2854e6){logger[_0x325a('0x29')](_0x325a('0x50'),_0x2854e6);throw _0x2854e6;});}return _0x54b6d4;})[_0x325a('0x23')](respondWithResult(_0x2002c4,0xc9))[_0x325a('0x46')](handleError(_0x2002c4,null));};exports[_0x325a('0x22')]=function(_0x52a211,_0x112dd4){if(_0x52a211[_0x325a('0x51')]['id']){delete _0x52a211['body']['id'];}return db[_0x325a('0x2e')][_0x325a('0x4e')]({'where':{'id':_0x52a211[_0x325a('0x48')]['id']}})[_0x325a('0x23')](handleEntityNotFound(_0x112dd4,null))[_0x325a('0x23')](saveUpdates(_0x52a211[_0x325a('0x51')],null))[_0x325a('0x23')](respondWithResult(_0x112dd4,null))[_0x325a('0x46')](handleError(_0x112dd4,null));};exports[_0x325a('0x24')]=function(_0xc022fd,_0x1a0dcc){return db[_0x325a('0x2e')][_0x325a('0x4e')]({'where':{'id':_0xc022fd[_0x325a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a0dcc,null))[_0x325a('0x23')](removeEntity(_0x1a0dcc,null))[_0x325a('0x46')](handleError(_0x1a0dcc,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d631fb8..61275fc 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 _0xd5a3=['options','join','StopMixMonitor','internal','concat','User','findAll','agent','then','exports','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','catch','lodash','util','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','SIP/%s,%s','name'];(function(_0x37bc16,_0x3b3585){var _0xbde296=function(_0x5d4cbf){while(--_0x5d4cbf){_0x37bc16['push'](_0x37bc16['shift']());}};_0xbde296(++_0x3b3585);}(_0xd5a3,0x1b3));var _0x3d5a=function(_0x422a6a,_0x34cc4){_0x422a6a=_0x422a6a-0x0;var _0x137714=_0xd5a3[_0x422a6a];return _0x137714;};'use strict';var _=require(_0x3d5a('0x0'));var util=require(_0x3d5a('0x1'));var BPromise=require('bluebird');var attributes=require(_0x3d5a('0x2'));var getUserApplications=function(_0x450fcf,_0x1a7ac5,_0x269143){var _0x5d6c94=0x1;var _0x458dc2=[];var _0x44a85d={'context':_0x1a7ac5[_0x3d5a('0x3')]||_0x3d5a('0x4'),'exten':util['format'](_0x3d5a('0x5'),_0x450fcf[_0x3d5a('0x6')],_0x269143),'type':_0x3d5a('0x7'),'isApp':![],'ChanSpyId':_0x450fcf['id'],'UserId':_0x1a7ac5['id']};_0x458dc2[_0x3d5a('0x8')](_[_0x3d5a('0x9')]({'app':_0x3d5a('0xa'),'appdata':util[_0x3d5a('0xb')](_0x3d5a('0xc'),_0x3d5a('0xd')),'priority':_0x5d6c94++},_0x44a85d));if(_0x450fcf['record']){_0x458dc2[_0x3d5a('0x8')](_[_0x3d5a('0x9')]({'app':_0x3d5a('0xe'),'appdata':util[_0x3d5a('0xb')](_0x3d5a('0xf'),_0x450fcf[_0x3d5a('0x10')]),'priority':_0x5d6c94++},_0x44a85d));}if(_0x450fcf[_0x3d5a('0x11')]){_0x458dc2[_0x3d5a('0x8')](_['merge']({'app':_0x3d5a('0x12'),'appdata':_0x450fcf['password'],'priority':_0x5d6c94++},_0x44a85d));}_0x458dc2[_0x3d5a('0x8')](_[_0x3d5a('0x9')]({'app':'ChanSpy','appdata':util[_0x3d5a('0xb')](_0x3d5a('0x13'),_0x1a7ac5[_0x3d5a('0x14')],_0x450fcf[_0x3d5a('0x15')]?_0x450fcf[_0x3d5a('0x15')][_0x3d5a('0x16')](''):''),'priority':_0x5d6c94++},_0x44a85d));if(_0x450fcf['record']){_0x458dc2[_0x3d5a('0x8')](_[_0x3d5a('0x9')]({'app':_0x3d5a('0x17'),'priority':_0x5d6c94++},_0x44a85d));}return _0x458dc2;};var getChanSpyApplications=function(_0x365216,_0x5b06a4){var _0x16e2dc=[];for(var _0x5a9163=0x0,_0x2a61e6=0x1;_0x5a9163<_0x5b06a4['length'];_0x5a9163++,_0x2a61e6=0x1){_0x16e2dc=_0x16e2dc['concat'](getUserApplications(_0x365216,_0x5b06a4[_0x5a9163],_0x5b06a4[_0x5a9163][_0x3d5a('0x18')]));if(_0x5b06a4[_0x5a9163][_0x3d5a('0x18')]!=_0x5b06a4[_0x5a9163]['name']){_0x16e2dc=_0x16e2dc[_0x3d5a('0x19')](getUserApplications(_0x365216,_0x5b06a4[_0x5a9163],_0x5b06a4[_0x5a9163][_0x3d5a('0x14')]));}}return _0x16e2dc;};var getChanSpyPromise=function(_0x58888f,_0xc5d3b4){return new BPromise(function(_0x373950,_0x23a01f){return _0x58888f[_0x3d5a('0x1a')][_0x3d5a('0x1b')]({'attributes':['id',_0x3d5a('0x14'),'internal'],'where':{'role':_0x3d5a('0x1c'),'chanspy':!![]},'raw':!![]})[_0x3d5a('0x1d')](function(_0x46e8a6){if(_0x46e8a6){return _0x373950(getChanSpyApplications(_0xc5d3b4,_0x46e8a6));}return _0x373950([]);})['catch'](function(_0x1e44f4){_0x23a01f(_0x1e44f4);});});};module[_0x3d5a('0x1e')]=function(_0x572d1e,_0x2a1c00){var _0x50ee7f=_0x572d1e['models'];return _0x572d1e[_0x3d5a('0x1f')](_0x3d5a('0x20'),attributes,{'tableName':_0x3d5a('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29a62f,_0x5ead7c,_0x42d22a){return getChanSpyPromise(_0x50ee7f,_0x29a62f)[_0x3d5a('0x1d')](function(_0x5a76b5){if(_0x5a76b5&&_0x5a76b5[_0x3d5a('0x22')]){return _0x50ee7f[_0x3d5a('0x23')][_0x3d5a('0x24')](_0x5a76b5);}})['then'](function(){_0x42d22a();})['catch'](function(_0x1f760b){_0x42d22a(_0x1f760b);});},'afterUpdate':function(_0x34929b,_0x48bc21,_0x5d4bda){return _0x50ee7f['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x34929b['id']}})[_0x3d5a('0x1d')](function(){return getChanSpyPromise(_0x50ee7f,_0x34929b);})['then'](function(_0x5d49ec){if(_0x5d49ec&&_0x5d49ec[_0x3d5a('0x22')]){return _0x50ee7f[_0x3d5a('0x23')][_0x3d5a('0x24')](_0x5d49ec);}})['then'](function(){_0x5d4bda();})[_0x3d5a('0x25')](function(_0xe620f9){_0x5d4bda(_0xe620f9);});},'afterDestroy':function(_0xb2d14f,_0x21d737,_0x1cd2e0){return _0x50ee7f[_0x3d5a('0x23')]['destroy']({'where':{'ChanSpyId':_0xb2d14f['id']}})[_0x3d5a('0x1d')](function(){_0x1cd2e0();})[_0x3d5a('0x25')](function(_0x106fb7){_0x1cd2e0(_0x106fb7);});}}});}; \ No newline at end of file +var _0xebd9=['agent','then','catch','exports','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','format','%s%s','merge','Set','chanspy','record','push','${UNIQUEID}.%s,a','auth','password','ChanSpy','name','options','concat','findAll','internal'];(function(_0x349cff,_0x49aa80){var _0x45fe96=function(_0x14597f){while(--_0x14597f){_0x349cff['push'](_0x349cff['shift']());}};_0x45fe96(++_0x49aa80);}(_0xebd9,0x8f));var _0x9ebd=function(_0x3624e8,_0x16081e){_0x3624e8=_0x3624e8-0x0;var _0x32fabc=_0xebd9[_0x3624e8];return _0x32fabc;};'use strict';var _=require(_0x9ebd('0x0'));var util=require(_0x9ebd('0x1'));var BPromise=require(_0x9ebd('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3a23c3,_0x1bc6c8,_0x427516){var _0x550758=0x1;var _0x535087=[];var _0x2df250={'context':_0x1bc6c8['context']||'from-sip','exten':util[_0x9ebd('0x3')](_0x9ebd('0x4'),_0x3a23c3['prefix'],_0x427516),'type':'system','isApp':![],'ChanSpyId':_0x3a23c3['id'],'UserId':_0x1bc6c8['id']};_0x535087['push'](_[_0x9ebd('0x5')]({'app':_0x9ebd('0x6'),'appdata':util['format']('CDR(type)=%s',_0x9ebd('0x7')),'priority':_0x550758++},_0x2df250));if(_0x3a23c3[_0x9ebd('0x8')]){_0x535087[_0x9ebd('0x9')](_[_0x9ebd('0x5')]({'app':'MixMonitor','appdata':util['format'](_0x9ebd('0xa'),_0x3a23c3['recordingFormat']),'priority':_0x550758++},_0x2df250));}if(_0x3a23c3[_0x9ebd('0xb')]){_0x535087['push'](_[_0x9ebd('0x5')]({'app':'Authenticate','appdata':_0x3a23c3[_0x9ebd('0xc')],'priority':_0x550758++},_0x2df250));}_0x535087[_0x9ebd('0x9')](_[_0x9ebd('0x5')]({'app':_0x9ebd('0xd'),'appdata':util[_0x9ebd('0x3')]('SIP/%s,%s',_0x1bc6c8[_0x9ebd('0xe')],_0x3a23c3['options']?_0x3a23c3[_0x9ebd('0xf')]['join'](''):''),'priority':_0x550758++},_0x2df250));if(_0x3a23c3[_0x9ebd('0x8')]){_0x535087[_0x9ebd('0x9')](_['merge']({'app':'StopMixMonitor','priority':_0x550758++},_0x2df250));}return _0x535087;};var getChanSpyApplications=function(_0x48eab5,_0x5f1295){var _0x1780e0=[];for(var _0x716e23=0x0,_0x2278c4=0x1;_0x716e23<_0x5f1295['length'];_0x716e23++,_0x2278c4=0x1){_0x1780e0=_0x1780e0[_0x9ebd('0x10')](getUserApplications(_0x48eab5,_0x5f1295[_0x716e23],_0x5f1295[_0x716e23]['internal']));if(_0x5f1295[_0x716e23]['internal']!=_0x5f1295[_0x716e23][_0x9ebd('0xe')]){_0x1780e0=_0x1780e0['concat'](getUserApplications(_0x48eab5,_0x5f1295[_0x716e23],_0x5f1295[_0x716e23][_0x9ebd('0xe')]));}}return _0x1780e0;};var getChanSpyPromise=function(_0x1393a6,_0xabae9f){return new BPromise(function(_0x2992b8,_0x192c93){return _0x1393a6['User'][_0x9ebd('0x11')]({'attributes':['id',_0x9ebd('0xe'),_0x9ebd('0x12')],'where':{'role':_0x9ebd('0x13'),'chanspy':!![]},'raw':!![]})[_0x9ebd('0x14')](function(_0x4384ae){if(_0x4384ae){return _0x2992b8(getChanSpyApplications(_0xabae9f,_0x4384ae));}return _0x2992b8([]);})[_0x9ebd('0x15')](function(_0x1eccd5){_0x192c93(_0x1eccd5);});});};module[_0x9ebd('0x16')]=function(_0x1bb4ee,_0x26a611){var _0x219e05=_0x1bb4ee['models'];return _0x1bb4ee['define']('VoiceChanSpy',attributes,{'tableName':_0x9ebd('0x17'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40fe36,_0x1e0908,_0x1bc907){return getChanSpyPromise(_0x219e05,_0x40fe36)[_0x9ebd('0x14')](function(_0xe72f4f){if(_0xe72f4f&&_0xe72f4f['length']){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x19')](_0xe72f4f);}})[_0x9ebd('0x14')](function(){_0x1bc907();})[_0x9ebd('0x15')](function(_0x4c25e5){_0x1bc907(_0x4c25e5);});},'afterUpdate':function(_0x4ca7e4,_0x1a6b58,_0x345874){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x1a')]({'where':{'ChanSpyId':_0x4ca7e4['id']}})[_0x9ebd('0x14')](function(){return getChanSpyPromise(_0x219e05,_0x4ca7e4);})[_0x9ebd('0x14')](function(_0x3f8755){if(_0x3f8755&&_0x3f8755['length']){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x19')](_0x3f8755);}})[_0x9ebd('0x14')](function(){_0x345874();})[_0x9ebd('0x15')](function(_0x5d83ef){_0x345874(_0x5d83ef);});},'afterDestroy':function(_0x4553d2,_0x141b7f,_0x52876e){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x1a')]({'where':{'ChanSpyId':_0x4553d2['id']}})[_0x9ebd('0x14')](function(){_0x52876e();})[_0x9ebd('0x15')](function(_0x3179e2){_0x52876e(_0x3179e2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 204eaae..5185a28 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e9f=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x0e9f,0x116));var _0xf0e9=function(_0x56fd98,_0x236f94){_0x56fd98=_0x56fd98-0x0;var _0x371a5c=_0x0e9f[_0x56fd98];return _0x371a5c;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file +var _0xa5fa=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x3b2983,_0x553477){var _0x303cfe=function(_0x30e397){while(--_0x30e397){_0x3b2983['push'](_0x3b2983['shift']());}};_0x303cfe(++_0x553477);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x59a098,_0x2064c1){_0x59a098=_0x59a098-0x0;var _0x5d56dd=_0xa5fa[_0x59a098];return _0x5d56dd;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 8144fb6..7a5c089 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 _0x1a5e=['fs-extra','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x20aba8,_0x291eed){var _0x48a95f=function(_0x4d037c){while(--_0x4d037c){_0x20aba8['push'](_0x20aba8['shift']());}};_0x48a95f(++_0x291eed);}(_0x1a5e,0xe4));var _0xe1a5=function(_0x1b0329,_0x17d2ec){_0x1b0329=_0x1b0329-0x0;var _0x2b443e=_0x1a5e[_0x1b0329];return _0x2b443e;};'use strict';var multer=require(_0xe1a5('0x0'));var util=require(_0xe1a5('0x1'));var path=require(_0xe1a5('0x2'));var timeout=require(_0xe1a5('0x3'));var express=require(_0xe1a5('0x4'));var router=express[_0xe1a5('0x5')]();var fs_extra=require(_0xe1a5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1a5('0x7'));var controller=require(_0xe1a5('0x8'));router[_0xe1a5('0x9')]('/',auth[_0xe1a5('0xa')](),controller[_0xe1a5('0xb')]);router['get']('/:id',auth[_0xe1a5('0xa')](),controller['show']);router[_0xe1a5('0xc')]('/',auth[_0xe1a5('0xa')](),controller[_0xe1a5('0xd')]);router['put'](_0xe1a5('0xe'),auth[_0xe1a5('0xa')](),controller['update']);router[_0xe1a5('0xf')](_0xe1a5('0xe'),auth[_0xe1a5('0xa')](),controller[_0xe1a5('0x10')]);module[_0xe1a5('0x11')]=router; \ No newline at end of file +var _0x8226=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8226,0x184));var _0x6822=function(_0x264136,_0x22508f){_0x264136=_0x264136-0x0;var _0x414056=_0x8226[_0x264136];return _0x414056;};'use strict';var multer=require(_0x6822('0x0'));var util=require(_0x6822('0x1'));var path=require(_0x6822('0x2'));var timeout=require('connect-timeout');var express=require(_0x6822('0x3'));var router=express[_0x6822('0x4')]();var fs_extra=require(_0x6822('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6822('0x6'));var config=require(_0x6822('0x7'));var controller=require('./voiceContext.controller');router[_0x6822('0x8')]('/',auth[_0x6822('0x9')](),controller[_0x6822('0xa')]);router[_0x6822('0x8')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller['show']);router[_0x6822('0xc')]('/',auth['isAuthenticated'](),controller[_0x6822('0xd')]);router[_0x6822('0xe')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller[_0x6822('0xf')]);router[_0x6822('0x10')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller[_0x6822('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 539592f..d74b8c9 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 _0x7291=['BOOLEAN','exports','STRING','name'];(function(_0x450c23,_0x20db47){var _0x2680e4=function(_0x396f10){while(--_0x396f10){_0x450c23['push'](_0x450c23['shift']());}};_0x2680e4(++_0x20db47);}(_0x7291,0xe5));var _0x1729=function(_0x32c383,_0x306d2d){_0x32c383=_0x32c383-0x0;var _0x151a56=_0x7291[_0x32c383];return _0x151a56;};'use strict';var Sequelize=require('sequelize');module[_0x1729('0x0')]={'name':{'type':Sequelize[_0x1729('0x1')],'unique':_0x1729('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1729('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb08=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0xfe5df4,_0x5db816){var _0x39c311=function(_0x6caa7){while(--_0x6caa7){_0xfe5df4['push'](_0xfe5df4['shift']());}};_0x39c311(++_0x5db816);}(_0xcb08,0x10f));var _0x8cb0=function(_0x25ed96,_0x282ce9){_0x25ed96=_0x25ed96-0x0;var _0x15f358=_0xcb08[_0x25ed96];return _0x15f358;};'use strict';var Sequelize=require(_0x8cb0('0x0'));module[_0x8cb0('0x1')]={'name':{'type':Sequelize[_0x8cb0('0x2')],'unique':_0x8cb0('0x3')},'description':{'type':Sequelize[_0x8cb0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8cb0('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 7e6f1b3..bf88e43 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 _0xf2c5=['moment','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','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xd79494,_0x1fcda7){var _0x1c1698=function(_0x15e012){while(--_0x15e012){_0xd79494['push'](_0xd79494['shift']());}};_0x1c1698(++_0x1fcda7);}(_0xf2c5,0xd5));var _0x5f2c=function(_0x308294,_0x56a8c3){_0x308294=_0x308294-0x0;var _0x315fc6=_0xf2c5[_0x308294];return _0x315fc6;};'use strict';var emlformat=require(_0x5f2c('0x0'));var rimraf=require(_0x5f2c('0x1'));var zipdir=require(_0x5f2c('0x2'));var jsonpatch=require(_0x5f2c('0x3'));var rp=require(_0x5f2c('0x4'));var moment=require(_0x5f2c('0x5'));var BPromise=require(_0x5f2c('0x6'));var Mustache=require('mustache');var util=require(_0x5f2c('0x7'));var path=require(_0x5f2c('0x8'));var sox=require(_0x5f2c('0x9'));var csv=require(_0x5f2c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f2c('0xb'));var _=require(_0x5f2c('0xc'));var squel=require(_0x5f2c('0xd'));var crypto=require(_0x5f2c('0xe'));var jsforce=require(_0x5f2c('0xf'));var deskjs=require(_0x5f2c('0x10'));var toCsv=require(_0x5f2c('0xa'));var querystring=require(_0x5f2c('0x11'));var Papa=require('papaparse');var Redis=require(_0x5f2c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5f2c('0x13'));var as=require(_0x5f2c('0x14'));var hardwareService=require(_0x5f2c('0x15'));var logger=require(_0x5f2c('0x16'))('api');var utils=require(_0x5f2c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5f2c('0x18'));var db=require(_0x5f2c('0x19'))['db'];var jayson=require(_0x5f2c('0x1a'));var client=jayson[_0x5f2c('0x1b')][_0x5f2c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3f24e0,_0xbd3491,_0x3e493d,_0x54cc7e){return new BPromise(function(_0xc61767,_0x2b11d9){var _0x2d16af=_0x54cc7e||client;return _0x2d16af[_0x5f2c('0x1d')](_0x3f24e0,_0x3e493d)[_0x5f2c('0x1e')](function(_0x4c25ff){logger[_0x5f2c('0x1f')](_0x5f2c('0x20'),_0xbd3491,'request\x20sent');logger[_0x5f2c('0x21')](_0x5f2c('0x22'),_0xbd3491,_0x5f2c('0x23'),JSON[_0x5f2c('0x24')](_0x4c25ff));if(_0x4c25ff[_0x5f2c('0x25')]){if(_0x4c25ff[_0x5f2c('0x25')]['code']===0x1f4){logger[_0x5f2c('0x25')](_0x5f2c('0x20'),_0xbd3491,_0x4c25ff[_0x5f2c('0x25')][_0x5f2c('0x26')]);return _0x2b11d9(_0x4c25ff[_0x5f2c('0x25')][_0x5f2c('0x26')]);}logger['error'](_0x5f2c('0x20'),_0xbd3491,_0x4c25ff['error']['message']);return _0xc61767(_0x4c25ff[_0x5f2c('0x25')][_0x5f2c('0x26')]);}else{logger[_0x5f2c('0x1f')](_0x5f2c('0x20'),_0xbd3491,_0x5f2c('0x23'));_0xc61767(_0x4c25ff[_0x5f2c('0x27')][_0x5f2c('0x26')]);}})[_0x5f2c('0x28')](function(_0x790ef0){logger[_0x5f2c('0x25')](_0x5f2c('0x20'),_0xbd3491,_0x790ef0);_0x2b11d9(_0x790ef0);});});}function respondWithStatusCode(_0x2d3301,_0x3d752b){_0x3d752b=_0x3d752b||0xcc;return function(_0x28f5c8){if(_0x28f5c8){return _0x2d3301[_0x5f2c('0x29')](_0x3d752b);}return _0x2d3301['status'](_0x3d752b)[_0x5f2c('0x2a')]();};}function respondWithResult(_0x31c16f,_0x49d58a){_0x49d58a=_0x49d58a||0xc8;return function(_0x352297){if(_0x352297){return _0x31c16f[_0x5f2c('0x2b')](_0x49d58a)[_0x5f2c('0x2c')](_0x352297);}};}function respondWithFilteredResult(_0x2b82c7,_0x19afe5){return function(_0x25f8be){if(_0x25f8be){var _0x5446ee=typeof _0x19afe5[_0x5f2c('0x2d')]===_0x5f2c('0x2e')&&typeof _0x19afe5['limit']===_0x5f2c('0x2e');var _0x8663cb=_0x25f8be[_0x5f2c('0x2f')];var _0x256141=_0x5446ee?0x0:_0x19afe5[_0x5f2c('0x2d')];var _0x5b24e6=_0x5446ee?_0x25f8be[_0x5f2c('0x2f')]:_0x19afe5['offset']+_0x19afe5[_0x5f2c('0x30')];var _0x250233;if(_0x5b24e6>=_0x8663cb){_0x5b24e6=_0x8663cb;_0x250233=0xc8;}else{_0x250233=0xce;}_0x2b82c7[_0x5f2c('0x2b')](_0x250233);return _0x2b82c7[_0x5f2c('0x31')](_0x5f2c('0x32'),_0x256141+'-'+_0x5b24e6+'/'+_0x8663cb)['json'](_0x25f8be);}return null;};}function patchUpdates(_0x31d171){return function(_0x49b299){try{jsonpatch[_0x5f2c('0x33')](_0x49b299,_0x31d171,!![]);}catch(_0x4af070){return BPromise[_0x5f2c('0x34')](_0x4af070);}return _0x49b299[_0x5f2c('0x35')]();};}function saveUpdates(_0x11334d,_0x70bc29){return function(_0x24b23d){if(_0x24b23d){return _0x24b23d['update'](_0x11334d)[_0x5f2c('0x1e')](function(_0xe13de5){return _0xe13de5;});}return null;};}function removeEntity(_0x2d8b7a,_0xa74ad9){return function(_0x2c0974){if(_0x2c0974){return _0x2c0974['destroy']()[_0x5f2c('0x1e')](function(){var _0x219c4c=_0x2c0974[_0x5f2c('0x36')]({'plain':!![]});var _0x33fad3='Contexts';return db[_0x5f2c('0x37')][_0x5f2c('0x38')]({'where':{'type':_0x33fad3,'resourceId':_0x219c4c['id']}})['then'](function(){return _0x2c0974;});})['then'](function(){_0x2d8b7a[_0x5f2c('0x2b')](0xcc)[_0x5f2c('0x2a')]();});}};}function handleEntityNotFound(_0x54a0bb,_0x1d3706){return function(_0x99de7b){if(!_0x99de7b){_0x54a0bb[_0x5f2c('0x29')](0x194);}return _0x99de7b;};}function handleError(_0x102e6c,_0x4f30ca){_0x4f30ca=_0x4f30ca||0x1f4;return function(_0xe1ac62){logger[_0x5f2c('0x25')](_0xe1ac62['stack']);if(_0xe1ac62[_0x5f2c('0x39')]){delete _0xe1ac62[_0x5f2c('0x39')];}_0x102e6c[_0x5f2c('0x2b')](_0x4f30ca)[_0x5f2c('0x3a')](_0xe1ac62);};}exports[_0x5f2c('0x3b')]=function(_0x2d06fa,_0xa022d0){var _0x5cf561={},_0x222e2d={},_0xca4d26={'count':0x0,'rows':[]};var _0xc01cca=_[_0x5f2c('0x3c')](db[_0x5f2c('0x3d')][_0x5f2c('0x3e')],function(_0x3ab042){return{'name':_0x3ab042[_0x5f2c('0x3f')],'type':_0x3ab042[_0x5f2c('0x40')][_0x5f2c('0x41')]};});_0x222e2d[_0x5f2c('0x42')]=_[_0x5f2c('0x3c')](_0xc01cca,_0x5f2c('0x39'));_0x222e2d[_0x5f2c('0x43')]=_[_0x5f2c('0x44')](_0x2d06fa[_0x5f2c('0x43')]);_0x222e2d[_0x5f2c('0x45')]=_[_0x5f2c('0x46')](_0x222e2d[_0x5f2c('0x42')],_0x222e2d[_0x5f2c('0x43')]);_0x5cf561[_0x5f2c('0x47')]=_[_0x5f2c('0x46')](_0x222e2d['model'],qs['fields'](_0x2d06fa[_0x5f2c('0x43')][_0x5f2c('0x48')]));_0x5cf561[_0x5f2c('0x47')]=_0x5cf561['attributes'][_0x5f2c('0x49')]?_0x5cf561[_0x5f2c('0x47')]:_0x222e2d[_0x5f2c('0x42')];if(!_0x2d06fa['query'][_0x5f2c('0x4a')](_0x5f2c('0x4b'))){_0x5cf561[_0x5f2c('0x30')]=qs[_0x5f2c('0x30')](_0x2d06fa[_0x5f2c('0x43')]['limit']);_0x5cf561[_0x5f2c('0x2d')]=qs[_0x5f2c('0x2d')](_0x2d06fa[_0x5f2c('0x43')][_0x5f2c('0x2d')]);}_0x5cf561[_0x5f2c('0x4c')]=qs[_0x5f2c('0x4d')](_0x2d06fa['query'][_0x5f2c('0x4d')]);_0x5cf561[_0x5f2c('0x4e')]=qs[_0x5f2c('0x45')](_[_0x5f2c('0x4f')](_0x2d06fa[_0x5f2c('0x43')],_0x222e2d[_0x5f2c('0x45')]),_0xc01cca);if(_0x2d06fa[_0x5f2c('0x43')]['filter']){_0x5cf561[_0x5f2c('0x4e')]=_['merge'](_0x5cf561[_0x5f2c('0x4e')],{'$or':_[_0x5f2c('0x3c')](_0xc01cca,function(_0x325383){if(_0x325383[_0x5f2c('0x40')]!=='VIRTUAL'){var _0x14950c={};_0x14950c[_0x325383[_0x5f2c('0x39')]]={'$like':'%'+_0x2d06fa['query'][_0x5f2c('0x50')]+'%'};return _0x14950c;}})});}_0x5cf561=_[_0x5f2c('0x51')]({},_0x5cf561,_0x2d06fa[_0x5f2c('0x52')]);var _0x31dab8={'where':_0x5cf561[_0x5f2c('0x4e')]};return db['VoiceContext']['count'](_0x31dab8)[_0x5f2c('0x1e')](function(_0x41bbbd){_0xca4d26[_0x5f2c('0x2f')]=_0x41bbbd;if(_0x2d06fa['query'][_0x5f2c('0x53')]){_0x5cf561[_0x5f2c('0x54')]=[{'all':!![]}];}return db[_0x5f2c('0x3d')][_0x5f2c('0x55')](_0x5cf561);})[_0x5f2c('0x1e')](function(_0x9003d1){_0xca4d26[_0x5f2c('0x56')]=_0x9003d1;return _0xca4d26;})[_0x5f2c('0x1e')](respondWithFilteredResult(_0xa022d0,_0x5cf561))['catch'](handleError(_0xa022d0,null));};exports[_0x5f2c('0x57')]=function(_0x1f260b,_0x1a0faa){var _0x439d08={'raw':![],'where':{'id':_0x1f260b[_0x5f2c('0x58')]['id']}},_0x58247a={};_0x58247a[_0x5f2c('0x42')]=_['keys'](db[_0x5f2c('0x3d')][_0x5f2c('0x3e')]);_0x58247a['query']=_[_0x5f2c('0x44')](_0x1f260b[_0x5f2c('0x43')]);_0x58247a[_0x5f2c('0x45')]=_['intersection'](_0x58247a[_0x5f2c('0x42')],_0x58247a['query']);_0x439d08[_0x5f2c('0x47')]=_[_0x5f2c('0x46')](_0x58247a[_0x5f2c('0x42')],qs[_0x5f2c('0x48')](_0x1f260b[_0x5f2c('0x43')]['fields']));_0x439d08[_0x5f2c('0x47')]=_0x439d08['attributes'][_0x5f2c('0x49')]?_0x439d08['attributes']:_0x58247a[_0x5f2c('0x42')];if(_0x1f260b[_0x5f2c('0x43')][_0x5f2c('0x53')]){_0x439d08[_0x5f2c('0x54')]=[{'all':!![]}];}_0x439d08=_['merge']({},_0x439d08,_0x1f260b[_0x5f2c('0x52')]);return db['VoiceContext'][_0x5f2c('0x59')](_0x439d08)[_0x5f2c('0x1e')](handleEntityNotFound(_0x1a0faa,null))['then'](respondWithResult(_0x1a0faa,null))[_0x5f2c('0x28')](handleError(_0x1a0faa,null));};exports[_0x5f2c('0x5a')]=function(_0x5ec65d,_0x124a57,_0x11d6b6){var _0x243fde;return db[_0x5f2c('0x3d')][_0x5f2c('0x5a')](_0x5ec65d['body'],{'raw':!![]})['then'](function(_0x10e736){_0x243fde=_0x10e736;return db['VoiceContext'][_0x5f2c('0x55')]({'raw':!![]});})['then'](function(_0x330211){var _0x4cad2f=fs[_0x5f2c('0x5b')](path[_0x5f2c('0x5c')](config['root'],_0x5f2c('0x5d')),_0x5f2c('0x5e'));var _0x1245f9=ejs['render'](_0x4cad2f,{'contexts':_0x330211||[]});fs[_0x5f2c('0x5f')](_0x5f2c('0x60'),_0x1245f9);})[_0x5f2c('0x1e')](function(){return respondWithRpcPromise(_0x5f2c('0x61'),_0x5f2c('0x5a'),{'module':_0x5f2c('0x62')});})[_0x5f2c('0x1e')](function(){var _0x18f119=_0x5ec65d[_0x5f2c('0x63')]['get']({'plain':!![]});if(!_0x18f119)throw new Error(_0x5f2c('0x64'));if(_0x18f119[_0x5f2c('0x65')]===_0x5f2c('0x63')){var _0x8af8cb=_0x243fde['get']({'plain':!![]});return db['UserProfileSection'][_0x5f2c('0x59')]({'where':{'name':_0x5f2c('0x66'),'userProfileId':_0x18f119[_0x5f2c('0x67')]},'raw':!![]})['then'](function(_0x2dc84e){if(_0x2dc84e&&_0x2dc84e[_0x5f2c('0x68')]===0x0){return db[_0x5f2c('0x37')][_0x5f2c('0x5a')]({'name':_0x8af8cb[_0x5f2c('0x39')],'resourceId':_0x8af8cb['id'],'type':_0x2dc84e[_0x5f2c('0x39')],'sectionId':_0x2dc84e['id']},{})['then'](function(){return _0x243fde;});}else{return _0x243fde;}})[_0x5f2c('0x28')](function(_0x1fa86e){logger[_0x5f2c('0x25')](_0x5f2c('0x69'),_0x1fa86e);throw _0x1fa86e;});}return _0x243fde;})[_0x5f2c('0x1e')](respondWithResult(_0x124a57,0xc9))['catch'](handleError(_0x124a57,null));};exports[_0x5f2c('0x6a')]=function(_0x5b9147,_0x30dc66,_0x5ebed1){var _0x49b983;return db['VoiceContext'][_0x5f2c('0x59')]({'where':{'id':_0x5b9147[_0x5f2c('0x58')]['id']}})[_0x5f2c('0x1e')](handleEntityNotFound(_0x30dc66,null))['then'](saveUpdates(_0x5b9147[_0x5f2c('0x6b')],null))['then'](function(_0x3d0814){if(_0x3d0814){_0x49b983=_0x3d0814;return db[_0x5f2c('0x3d')]['findAll']({'raw':!![]});}})[_0x5f2c('0x1e')](function(_0x234c73){var _0x1755d2=fs['readFileSync'](path['join'](config[_0x5f2c('0x6c')],_0x5f2c('0x5d')),'utf8');var _0x484075=ejs['render'](_0x1755d2,{'contexts':_0x234c73||[]});fs[_0x5f2c('0x5f')](_0x5f2c('0x60'),_0x484075);})[_0x5f2c('0x1e')](function(){return respondWithRpcPromise(_0x5f2c('0x61'),'update',{'module':_0x5f2c('0x62')});})['then'](function(){return _0x49b983;})[_0x5f2c('0x1e')](respondWithResult(_0x30dc66,null))['catch'](handleError(_0x30dc66,null));};exports[_0x5f2c('0x38')]=function(_0x878ffe,_0x136b0b,_0x3f4cea){var _0x19f242;return db[_0x5f2c('0x3d')][_0x5f2c('0x59')]({'where':{'id':_0x878ffe[_0x5f2c('0x58')]['id']}})[_0x5f2c('0x1e')](handleEntityNotFound(_0x136b0b,null))['then'](removeEntity(_0x136b0b,null))[_0x5f2c('0x1e')](function(){return db['VoiceContext'][_0x5f2c('0x55')]({'raw':!![]});})['then'](function(_0x556574){var _0x46119e=fs[_0x5f2c('0x5b')](path['join'](config[_0x5f2c('0x6c')],_0x5f2c('0x5d')),_0x5f2c('0x5e'));var _0x4cafa=ejs['render'](_0x46119e,{'contexts':_0x556574});fs['writeFileSync'](_0x5f2c('0x60'),_0x4cafa);return respondWithRpcPromise(_0x5f2c('0x61'),_0x5f2c('0x38'),{'module':_0x5f2c('0x62')});})[_0x5f2c('0x28')](handleError(_0x136b0b,null));}; \ No newline at end of file +var _0x54c8=['count','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2a1a38,_0x5e817d){var _0x23cc97=function(_0x2315ac){while(--_0x2315ac){_0x2a1a38['push'](_0x2a1a38['shift']());}};_0x23cc97(++_0x5e817d);}(_0x54c8,0x9b));var _0x854c=function(_0x254081,_0x175fd7){_0x254081=_0x254081-0x0;var _0x3b3502=_0x54c8[_0x254081];return _0x3b3502;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x854c('0x0'));var zipdir=require(_0x854c('0x1'));var jsonpatch=require(_0x854c('0x2'));var rp=require(_0x854c('0x3'));var moment=require('moment');var BPromise=require(_0x854c('0x4'));var Mustache=require(_0x854c('0x5'));var util=require(_0x854c('0x6'));var path=require('path');var sox=require(_0x854c('0x7'));var csv=require(_0x854c('0x8'));var ejs=require(_0x854c('0x9'));var fs=require('fs');var fs_extra=require(_0x854c('0xa'));var _=require('lodash');var squel=require(_0x854c('0xb'));var crypto=require(_0x854c('0xc'));var jsforce=require(_0x854c('0xd'));var deskjs=require(_0x854c('0xe'));var toCsv=require(_0x854c('0x8'));var querystring=require(_0x854c('0xf'));var Papa=require(_0x854c('0x10'));var Redis=require(_0x854c('0x11'));var authService=require(_0x854c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x854c('0x13'));var hardwareService=require(_0x854c('0x14'));var logger=require(_0x854c('0x15'))(_0x854c('0x16'));var utils=require(_0x854c('0x17'));var config=require(_0x854c('0x18'));var licenseUtil=require(_0x854c('0x19'));var db=require(_0x854c('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x854c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2f8a,_0x515268,_0x1317a3,_0x5d38e5){return new BPromise(function(_0x5b745c,_0x1a24b1){var _0x3d9fc7=_0x5d38e5||client;return _0x3d9fc7[_0x854c('0x1c')](_0x4d2f8a,_0x1317a3)[_0x854c('0x1d')](function(_0x1e5a97){logger[_0x854c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x515268,_0x854c('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x515268,_0x854c('0x1f'),JSON[_0x854c('0x20')](_0x1e5a97));if(_0x1e5a97[_0x854c('0x21')]){if(_0x1e5a97[_0x854c('0x21')]['code']===0x1f4){logger[_0x854c('0x21')](_0x854c('0x22'),_0x515268,_0x1e5a97['error'][_0x854c('0x23')]);return _0x1a24b1(_0x1e5a97[_0x854c('0x21')]['message']);}logger[_0x854c('0x21')](_0x854c('0x22'),_0x515268,_0x1e5a97[_0x854c('0x21')][_0x854c('0x23')]);return _0x5b745c(_0x1e5a97['error']['message']);}else{logger[_0x854c('0x1e')](_0x854c('0x22'),_0x515268,'request\x20sent');_0x5b745c(_0x1e5a97[_0x854c('0x24')][_0x854c('0x23')]);}})[_0x854c('0x25')](function(_0x115490){logger['error'](_0x854c('0x22'),_0x515268,_0x115490);_0x1a24b1(_0x115490);});});}function respondWithStatusCode(_0x407028,_0x5a9daf){_0x5a9daf=_0x5a9daf||0xcc;return function(_0x3b31f2){if(_0x3b31f2){return _0x407028[_0x854c('0x26')](_0x5a9daf);}return _0x407028[_0x854c('0x27')](_0x5a9daf)[_0x854c('0x28')]();};}function respondWithResult(_0x1aa0bc,_0x4264a7){_0x4264a7=_0x4264a7||0xc8;return function(_0x3eb8e2){if(_0x3eb8e2){return _0x1aa0bc[_0x854c('0x27')](_0x4264a7)[_0x854c('0x29')](_0x3eb8e2);}};}function respondWithFilteredResult(_0x1060f4,_0x4e5c4a){return function(_0x1142ce){if(_0x1142ce){var _0x306103=typeof _0x4e5c4a[_0x854c('0x2a')]===_0x854c('0x2b')&&typeof _0x4e5c4a[_0x854c('0x2c')]===_0x854c('0x2b');var _0x21eaca=_0x1142ce[_0x854c('0x2d')];var _0xa4e6ba=_0x306103?0x0:_0x4e5c4a[_0x854c('0x2a')];var _0x4ecb88=_0x306103?_0x1142ce['count']:_0x4e5c4a[_0x854c('0x2a')]+_0x4e5c4a[_0x854c('0x2c')];var _0xdef6c8;if(_0x4ecb88>=_0x21eaca){_0x4ecb88=_0x21eaca;_0xdef6c8=0xc8;}else{_0xdef6c8=0xce;}_0x1060f4[_0x854c('0x27')](_0xdef6c8);return _0x1060f4['set'](_0x854c('0x2e'),_0xa4e6ba+'-'+_0x4ecb88+'/'+_0x21eaca)['json'](_0x1142ce);}return null;};}function patchUpdates(_0x44d3a8){return function(_0x43d073){try{jsonpatch[_0x854c('0x2f')](_0x43d073,_0x44d3a8,!![]);}catch(_0x2a9904){return BPromise['reject'](_0x2a9904);}return _0x43d073[_0x854c('0x30')]();};}function saveUpdates(_0xc28ff8,_0x1e7dec){return function(_0xca083){if(_0xca083){return _0xca083[_0x854c('0x31')](_0xc28ff8)['then'](function(_0x31de2f){return _0x31de2f;});}return null;};}function removeEntity(_0x94780e,_0x415ea8){return function(_0x2c20a7){if(_0x2c20a7){return _0x2c20a7[_0x854c('0x32')]()[_0x854c('0x1d')](function(){var _0xb7a143=_0x2c20a7[_0x854c('0x33')]({'plain':!![]});var _0x2d0105='Contexts';return db[_0x854c('0x34')][_0x854c('0x32')]({'where':{'type':_0x2d0105,'resourceId':_0xb7a143['id']}})[_0x854c('0x1d')](function(){return _0x2c20a7;});})[_0x854c('0x1d')](function(){_0x94780e[_0x854c('0x27')](0xcc)[_0x854c('0x28')]();});}};}function handleEntityNotFound(_0x1b8e96,_0x1ce320){return function(_0x1d6836){if(!_0x1d6836){_0x1b8e96[_0x854c('0x26')](0x194);}return _0x1d6836;};}function handleError(_0x5244a7,_0x1b7da0){_0x1b7da0=_0x1b7da0||0x1f4;return function(_0x62c854){logger['error'](_0x62c854[_0x854c('0x35')]);if(_0x62c854[_0x854c('0x36')]){delete _0x62c854['name'];}_0x5244a7[_0x854c('0x27')](_0x1b7da0)['send'](_0x62c854);};}exports[_0x854c('0x37')]=function(_0x4ca05e,_0x15ae53){var _0x5042e2={},_0x39a636={},_0x3c3447={'count':0x0,'rows':[]};var _0x5d167e=_['map'](db[_0x854c('0x38')][_0x854c('0x39')],function(_0x14705e){return{'name':_0x14705e[_0x854c('0x3a')],'type':_0x14705e[_0x854c('0x3b')][_0x854c('0x3c')]};});_0x39a636[_0x854c('0x3d')]=_[_0x854c('0x3e')](_0x5d167e,_0x854c('0x36'));_0x39a636[_0x854c('0x3f')]=_[_0x854c('0x40')](_0x4ca05e['query']);_0x39a636[_0x854c('0x41')]=_['intersection'](_0x39a636[_0x854c('0x3d')],_0x39a636[_0x854c('0x3f')]);_0x5042e2['attributes']=_[_0x854c('0x42')](_0x39a636['model'],qs['fields'](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x43')]));_0x5042e2[_0x854c('0x44')]=_0x5042e2[_0x854c('0x44')][_0x854c('0x45')]?_0x5042e2['attributes']:_0x39a636['model'];if(!_0x4ca05e[_0x854c('0x3f')][_0x854c('0x46')](_0x854c('0x47'))){_0x5042e2['limit']=qs[_0x854c('0x2c')](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x2c')]);_0x5042e2[_0x854c('0x2a')]=qs['offset'](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x2a')]);}_0x5042e2['order']=qs[_0x854c('0x48')](_0x4ca05e['query']['sort']);_0x5042e2['where']=qs[_0x854c('0x41')](_[_0x854c('0x49')](_0x4ca05e['query'],_0x39a636[_0x854c('0x41')]),_0x5d167e);if(_0x4ca05e[_0x854c('0x3f')]['filter']){_0x5042e2['where']=_[_0x854c('0x4a')](_0x5042e2['where'],{'$or':_[_0x854c('0x3e')](_0x5d167e,function(_0x59bd2c){if(_0x59bd2c[_0x854c('0x3b')]!==_0x854c('0x4b')){var _0x7c7616={};_0x7c7616[_0x59bd2c[_0x854c('0x36')]]={'$like':'%'+_0x4ca05e['query']['filter']+'%'};return _0x7c7616;}})});}_0x5042e2=_[_0x854c('0x4a')]({},_0x5042e2,_0x4ca05e[_0x854c('0x4c')]);var _0x1edbd2={'where':_0x5042e2['where']};return db[_0x854c('0x38')]['count'](_0x1edbd2)['then'](function(_0xe98c6d){_0x3c3447[_0x854c('0x2d')]=_0xe98c6d;if(_0x4ca05e[_0x854c('0x3f')][_0x854c('0x4d')]){_0x5042e2[_0x854c('0x4e')]=[{'all':!![]}];}return db[_0x854c('0x38')][_0x854c('0x4f')](_0x5042e2);})[_0x854c('0x1d')](function(_0x23f5e5){_0x3c3447[_0x854c('0x50')]=_0x23f5e5;return _0x3c3447;})[_0x854c('0x1d')](respondWithFilteredResult(_0x15ae53,_0x5042e2))[_0x854c('0x25')](handleError(_0x15ae53,null));};exports['show']=function(_0x1a8dab,_0x477825){var _0x5b2fe9={'raw':![],'where':{'id':_0x1a8dab['params']['id']}},_0x8ff6c2={};_0x8ff6c2[_0x854c('0x3d')]=_[_0x854c('0x40')](db[_0x854c('0x38')][_0x854c('0x39')]);_0x8ff6c2[_0x854c('0x3f')]=_[_0x854c('0x40')](_0x1a8dab[_0x854c('0x3f')]);_0x8ff6c2[_0x854c('0x41')]=_['intersection'](_0x8ff6c2[_0x854c('0x3d')],_0x8ff6c2['query']);_0x5b2fe9[_0x854c('0x44')]=_[_0x854c('0x42')](_0x8ff6c2['model'],qs['fields'](_0x1a8dab[_0x854c('0x3f')][_0x854c('0x43')]));_0x5b2fe9[_0x854c('0x44')]=_0x5b2fe9['attributes'][_0x854c('0x45')]?_0x5b2fe9[_0x854c('0x44')]:_0x8ff6c2[_0x854c('0x3d')];if(_0x1a8dab[_0x854c('0x3f')][_0x854c('0x4d')]){_0x5b2fe9[_0x854c('0x4e')]=[{'all':!![]}];}_0x5b2fe9=_[_0x854c('0x4a')]({},_0x5b2fe9,_0x1a8dab[_0x854c('0x4c')]);return db[_0x854c('0x38')][_0x854c('0x51')](_0x5b2fe9)[_0x854c('0x1d')](handleEntityNotFound(_0x477825,null))[_0x854c('0x1d')](respondWithResult(_0x477825,null))[_0x854c('0x25')](handleError(_0x477825,null));};exports[_0x854c('0x52')]=function(_0x5aef93,_0x3c9b7c,_0x891294){var _0x142fbc;return db[_0x854c('0x38')]['create'](_0x5aef93[_0x854c('0x53')],{'raw':!![]})[_0x854c('0x1d')](function(_0x2a23b4){_0x142fbc=_0x2a23b4;return db['VoiceContext'][_0x854c('0x4f')]({'raw':!![]});})[_0x854c('0x1d')](function(_0xedca18){var _0xcaf687=fs[_0x854c('0x54')](path[_0x854c('0x55')](config[_0x854c('0x56')],_0x854c('0x57')),'utf8');var _0x247294=ejs[_0x854c('0x58')](_0xcaf687,{'contexts':_0xedca18||[]});fs[_0x854c('0x59')](_0x854c('0x5a'),_0x247294);})[_0x854c('0x1d')](function(){return respondWithRpcPromise(_0x854c('0x5b'),_0x854c('0x52'),{'module':_0x854c('0x5c')});})[_0x854c('0x1d')](function(){var _0x49e9a3=_0x5aef93[_0x854c('0x5d')]['get']({'plain':!![]});if(!_0x49e9a3)throw new Error(_0x854c('0x5e'));if(_0x49e9a3['role']===_0x854c('0x5d')){var _0x1a361e=_0x142fbc[_0x854c('0x33')]({'plain':!![]});return db[_0x854c('0x5f')]['find']({'where':{'name':_0x854c('0x60'),'userProfileId':_0x49e9a3['userProfileId']},'raw':!![]})[_0x854c('0x1d')](function(_0x3d686d){if(_0x3d686d&&_0x3d686d['autoAssociation']===0x0){return db[_0x854c('0x34')][_0x854c('0x52')]({'name':_0x1a361e[_0x854c('0x36')],'resourceId':_0x1a361e['id'],'type':_0x3d686d[_0x854c('0x36')],'sectionId':_0x3d686d['id']},{})[_0x854c('0x1d')](function(){return _0x142fbc;});}else{return _0x142fbc;}})[_0x854c('0x25')](function(_0x2e4aff){logger[_0x854c('0x21')](_0x854c('0x61'),_0x2e4aff);throw _0x2e4aff;});}return _0x142fbc;})[_0x854c('0x1d')](respondWithResult(_0x3c9b7c,0xc9))[_0x854c('0x25')](handleError(_0x3c9b7c,null));};exports[_0x854c('0x31')]=function(_0x1470ae,_0x2d8e84,_0x515461){var _0x15abed;return db['VoiceContext'][_0x854c('0x51')]({'where':{'id':_0x1470ae[_0x854c('0x62')]['id']}})['then'](handleEntityNotFound(_0x2d8e84,null))['then'](saveUpdates(_0x1470ae[_0x854c('0x53')],null))[_0x854c('0x1d')](function(_0x483dc1){if(_0x483dc1){_0x15abed=_0x483dc1;return db[_0x854c('0x38')][_0x854c('0x4f')]({'raw':!![]});}})[_0x854c('0x1d')](function(_0x54c0f0){var _0x70ff57=fs['readFileSync'](path[_0x854c('0x55')](config[_0x854c('0x56')],_0x854c('0x57')),_0x854c('0x63'));var _0x20224f=ejs[_0x854c('0x58')](_0x70ff57,{'contexts':_0x54c0f0||[]});fs[_0x854c('0x59')](_0x854c('0x5a'),_0x20224f);})['then'](function(){return respondWithRpcPromise('Reload',_0x854c('0x31'),{'module':'chan_sip.so'});})[_0x854c('0x1d')](function(){return _0x15abed;})[_0x854c('0x1d')](respondWithResult(_0x2d8e84,null))[_0x854c('0x25')](handleError(_0x2d8e84,null));};exports[_0x854c('0x32')]=function(_0x56a096,_0x1acce0,_0x561f26){var _0x51cc07;return db[_0x854c('0x38')]['find']({'where':{'id':_0x56a096[_0x854c('0x62')]['id']}})[_0x854c('0x1d')](handleEntityNotFound(_0x1acce0,null))[_0x854c('0x1d')](removeEntity(_0x1acce0,null))['then'](function(){return db['VoiceContext'][_0x854c('0x4f')]({'raw':!![]});})[_0x854c('0x1d')](function(_0x321a74){var _0xf00c78=fs[_0x854c('0x54')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x854c('0x63'));var _0x5ae014=ejs['render'](_0xf00c78,{'contexts':_0x321a74});fs[_0x854c('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5ae014);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x854c('0x25')](handleError(_0x1acce0,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 957f6c6..3bbea5b 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 _0x7f6f=['exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x5cde53,_0xc36a9b){var _0x46e6c1=function(_0xaf36ea){while(--_0xaf36ea){_0x5cde53['push'](_0x5cde53['shift']());}};_0x46e6c1(++_0xc36a9b);}(_0x7f6f,0x6c));var _0xf7f6=function(_0x34b661,_0x507a7a){_0x34b661=_0x34b661-0x0;var _0x4a97dc=_0x7f6f[_0x34b661];return _0x4a97dc;};'use strict';var _=require(_0xf7f6('0x0'));var util=require(_0xf7f6('0x1'));var logger=require(_0xf7f6('0x2'))(_0xf7f6('0x3'));var moment=require(_0xf7f6('0x4'));var BPromise=require(_0xf7f6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf7f6('0x6'));var config=require(_0xf7f6('0x7'));var attributes=require(_0xf7f6('0x8'));module[_0xf7f6('0x9')]=function(_0x46075f,_0x37f221){return _0x46075f[_0xf7f6('0xa')](_0xf7f6('0xb'),attributes,{'tableName':_0xf7f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b7e=['../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2b7e,0x13d));var _0xe2b7=function(_0x39d945,_0x359b9d){_0x39d945=_0x39d945-0x0;var _0x333401=_0x2b7e[_0x39d945];return _0x333401;};'use strict';var _=require(_0xe2b7('0x0'));var util=require(_0xe2b7('0x1'));var logger=require('../../config/logger')(_0xe2b7('0x2'));var moment=require(_0xe2b7('0x3'));var BPromise=require(_0xe2b7('0x4'));var rp=require(_0xe2b7('0x5'));var fs=require('fs');var path=require(_0xe2b7('0x6'));var rimraf=require(_0xe2b7('0x7'));var config=require(_0xe2b7('0x8'));var attributes=require(_0xe2b7('0x9'));module[_0xe2b7('0xa')]=function(_0x374f94,_0x20a31b){return _0x374f94[_0xe2b7('0xb')]('VoiceContext',attributes,{'tableName':_0xe2b7('0xc'),'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 dbbce3a..99325a5 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 _0x32d4=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','bluebird'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0x32d4,0x82));var _0x432d=function(_0x27246d,_0x5a0328){_0x27246d=_0x27246d-0x0;var _0xb31992=_0x32d4[_0x27246d];return _0xb31992;};'use strict';var _=require('lodash');var util=require(_0x432d('0x0'));var moment=require('moment');var BPromise=require(_0x432d('0x1'));var rs=require(_0x432d('0x2'));var fs=require('fs');var Redis=require(_0x432d('0x3'));var db=require(_0x432d('0x4'))['db'];var utils=require(_0x432d('0x5'));var logger=require(_0x432d('0x6'))(_0x432d('0x7'));var config=require('../../config/environment');var jayson=require(_0x432d('0x8'));var client=jayson[_0x432d('0x9')][_0x432d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4816,_0x2e8301,_0x439a84){return new BPromise(function(_0x222fd1,_0x5c4c37){return client[_0x432d('0xb')](_0x5e4816,_0x439a84)[_0x432d('0xc')](function(_0x2fd766){logger[_0x432d('0xd')](_0x432d('0xe'),_0x2e8301,'request\x20sent');logger[_0x432d('0xf')](_0x432d('0x10'),_0x2e8301,_0x432d('0x11'),JSON['stringify'](_0x2fd766));if(_0x2fd766['error']){if(_0x2fd766[_0x432d('0x12')]['code']===0x1f4){logger['error'](_0x432d('0xe'),_0x2e8301,_0x2fd766[_0x432d('0x12')][_0x432d('0x13')]);return _0x5c4c37(_0x2fd766[_0x432d('0x12')][_0x432d('0x13')]);}logger[_0x432d('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2e8301,_0x2fd766['error'][_0x432d('0x13')]);return _0x222fd1(_0x2fd766[_0x432d('0x12')]['message']);}else{logger[_0x432d('0xd')]('VoiceContext,\x20%s,\x20%s',_0x2e8301,'request\x20sent');_0x222fd1(_0x2fd766[_0x432d('0x14')][_0x432d('0x13')]);}})[_0x432d('0x15')](function(_0x4e2778){logger[_0x432d('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2e8301,_0x4e2778);_0x5c4c37(_0x4e2778);});});} \ No newline at end of file +var _0xd38f=['code','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x239875,_0x52a793){var _0x55a8d6=function(_0x1c48db){while(--_0x1c48db){_0x239875['push'](_0x239875['shift']());}};_0x55a8d6(++_0x52a793);}(_0xd38f,0xa3));var _0xfd38=function(_0x21adf0,_0x5303dc){_0x21adf0=_0x21adf0-0x0;var _0x4504bf=_0xd38f[_0x21adf0];return _0x4504bf;};'use strict';var _=require(_0xfd38('0x0'));var util=require(_0xfd38('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd38('0x2'));var db=require(_0xfd38('0x3'))['db'];var utils=require(_0xfd38('0x4'));var logger=require(_0xfd38('0x5'))(_0xfd38('0x6'));var config=require(_0xfd38('0x7'));var jayson=require(_0xfd38('0x8'));var client=jayson[_0xfd38('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318785,_0x9e8238,_0x433783){return new BPromise(function(_0xd0d6d8,_0x57ffcb){return client['request'](_0x318785,_0x433783)[_0xfd38('0xa')](function(_0x2f789a){logger['info'](_0xfd38('0xb'),_0x9e8238,_0xfd38('0xc'));logger[_0xfd38('0xd')](_0xfd38('0xe'),_0x9e8238,_0xfd38('0xc'),JSON[_0xfd38('0xf')](_0x2f789a));if(_0x2f789a[_0xfd38('0x10')]){if(_0x2f789a[_0xfd38('0x10')][_0xfd38('0x11')]===0x1f4){logger[_0xfd38('0x10')]('VoiceContext,\x20%s,\x20%s',_0x9e8238,_0x2f789a[_0xfd38('0x10')]['message']);return _0x57ffcb(_0x2f789a[_0xfd38('0x10')][_0xfd38('0x12')]);}logger[_0xfd38('0x10')](_0xfd38('0xb'),_0x9e8238,_0x2f789a[_0xfd38('0x10')]['message']);return _0xd0d6d8(_0x2f789a['error'][_0xfd38('0x12')]);}else{logger['info'](_0xfd38('0xb'),_0x9e8238,_0xfd38('0xc'));_0xd0d6d8(_0x2f789a['result'][_0xfd38('0x12')]);}})[_0xfd38('0x13')](function(_0x447252){logger[_0xfd38('0x10')](_0xfd38('0xb'),_0x9e8238,_0x447252);_0x57ffcb(_0x447252);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 50e9974..2d98b10 100644 --- a/server/api/voiceDialReport/index.js +++ b/server/api/voiceDialReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c5c=['delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x8c5c,0x7f));var _0xc8c5=function(_0x2f09d5,_0x214cec){_0x2f09d5=_0x2f09d5-0x0;var _0x3f92dc=_0x8c5c[_0x2f09d5];return _0x3f92dc;};'use strict';var multer=require('multer');var util=require(_0xc8c5('0x0'));var path=require('path');var timeout=require(_0xc8c5('0x1'));var express=require('express');var router=express[_0xc8c5('0x2')]();var fs_extra=require(_0xc8c5('0x3'));var auth=require(_0xc8c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc8c5('0x5'));var controller=require(_0xc8c5('0x6'));router[_0xc8c5('0x7')]('/',auth[_0xc8c5('0x8')](),controller[_0xc8c5('0x9')]);router[_0xc8c5('0x7')](_0xc8c5('0xa'),auth['isAuthenticated'](),controller[_0xc8c5('0xb')]);router[_0xc8c5('0x7')](_0xc8c5('0xc'),auth[_0xc8c5('0x8')](),controller[_0xc8c5('0xd')]);router[_0xc8c5('0xe')]('/',auth[_0xc8c5('0x8')](),controller[_0xc8c5('0xf')]);router[_0xc8c5('0x10')]('/:id',auth[_0xc8c5('0x8')](),controller['update']);router[_0xc8c5('0x11')](_0xc8c5('0xc'),auth[_0xc8c5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7883=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete'];(function(_0x2c75ef,_0xab78e9){var _0x49a4b1=function(_0x268ab){while(--_0x268ab){_0x2c75ef['push'](_0x2c75ef['shift']());}};_0x49a4b1(++_0xab78e9);}(_0x7883,0x1b6));var _0x3788=function(_0x133ab6,_0x5140c9){_0x133ab6=_0x133ab6-0x0;var _0xe6075a=_0x7883[_0x133ab6];return _0xe6075a;};'use strict';var multer=require(_0x3788('0x0'));var util=require('util');var path=require(_0x3788('0x1'));var timeout=require(_0x3788('0x2'));var express=require(_0x3788('0x3'));var router=express[_0x3788('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3788('0x5'));var interaction=require(_0x3788('0x6'));var config=require(_0x3788('0x7'));var controller=require(_0x3788('0x8'));router[_0x3788('0x9')]('/',auth[_0x3788('0xa')](),controller[_0x3788('0xb')]);router[_0x3788('0x9')](_0x3788('0xc'),auth['isAuthenticated'](),controller[_0x3788('0xd')]);router[_0x3788('0x9')](_0x3788('0xe'),auth[_0x3788('0xa')](),controller[_0x3788('0xf')]);router['post']('/',auth[_0x3788('0xa')](),controller[_0x3788('0x10')]);router['put'](_0x3788('0xe'),auth[_0x3788('0xa')](),controller['update']);router[_0x3788('0x11')](_0x3788('0xe'),auth[_0x3788('0xa')](),controller['destroy']);module[_0x3788('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c326aa1..12696c7 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 _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x592f46,_0x268ae3){var _0x225678=function(_0x451593){while(--_0x451593){_0x592f46['push'](_0x592f46['shift']());}};_0x225678(++_0x268ae3);}(_0x9a19,0x114));var _0x99a1=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x9a19[_0x1b1e76];return _0x3d743a;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x51e871,_0x194890){var _0x1fb16f=function(_0x40559b){while(--_0x40559b){_0x51e871['push'](_0x51e871['shift']());}};_0x1fb16f(++_0x194890);}(_0xbec5,0xe5));var _0x5bec=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xbec5[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a02acde..2e0d046 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 _0x274f=['send','index','map','VoiceDialReport','rawAttributes','type','keys','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name'];(function(_0x46afd8,_0x45ff58){var _0x33e4f5=function(_0x16f8a3){while(--_0x16f8a3){_0x46afd8['push'](_0x46afd8['shift']());}};_0x33e4f5(++_0x45ff58);}(_0x274f,0xbd));var _0xf274=function(_0x439f40,_0x549895){_0x439f40=_0x439f40-0x0;var _0x1e6abb=_0x274f[_0x439f40];return _0x1e6abb;};'use strict';var emlformat=require(_0xf274('0x0'));var rimraf=require(_0xf274('0x1'));var zipdir=require(_0xf274('0x2'));var jsonpatch=require(_0xf274('0x3'));var rp=require('request-promise');var moment=require(_0xf274('0x4'));var BPromise=require(_0xf274('0x5'));var Mustache=require(_0xf274('0x6'));var util=require(_0xf274('0x7'));var path=require(_0xf274('0x8'));var sox=require(_0xf274('0x9'));var csv=require(_0xf274('0xa'));var ejs=require(_0xf274('0xb'));var fs=require('fs');var fs_extra=require(_0xf274('0xc'));var _=require(_0xf274('0xd'));var squel=require(_0xf274('0xe'));var crypto=require(_0xf274('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf274('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf274('0x11'));var Papa=require(_0xf274('0x12'));var Redis=require(_0xf274('0x13'));var authService=require(_0xf274('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf274('0x15'));var logger=require(_0xf274('0x16'))('api');var utils=require(_0xf274('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf274('0x18'));var db=require(_0xf274('0x19'))['db'];function respondWithStatusCode(_0x709b01,_0x2ee185){_0x2ee185=_0x2ee185||0xcc;return function(_0x3bcdc5){if(_0x3bcdc5){return _0x709b01['sendStatus'](_0x2ee185);}return _0x709b01[_0xf274('0x1a')](_0x2ee185)[_0xf274('0x1b')]();};}function respondWithResult(_0x5a091b,_0x51c147){_0x51c147=_0x51c147||0xc8;return function(_0x248844){if(_0x248844){return _0x5a091b[_0xf274('0x1a')](_0x51c147)[_0xf274('0x1c')](_0x248844);}};}function respondWithFilteredResult(_0x4fe60a,_0x923a24){return function(_0x88a9ec){if(_0x88a9ec){var _0x4bda03=typeof _0x923a24[_0xf274('0x1d')]==='undefined'&&typeof _0x923a24[_0xf274('0x1e')]===_0xf274('0x1f');var _0x2805a2=_0x88a9ec[_0xf274('0x20')];var _0x5f375c=_0x4bda03?0x0:_0x923a24[_0xf274('0x1d')];var _0x8ae052=_0x4bda03?_0x88a9ec['count']:_0x923a24[_0xf274('0x1d')]+_0x923a24[_0xf274('0x1e')];var _0x758d52;if(_0x8ae052>=_0x2805a2){_0x8ae052=_0x2805a2;_0x758d52=0xc8;}else{_0x758d52=0xce;}_0x4fe60a['status'](_0x758d52);return _0x4fe60a[_0xf274('0x21')]('Content-Range',_0x5f375c+'-'+_0x8ae052+'/'+_0x2805a2)[_0xf274('0x1c')](_0x88a9ec);}return null;};}function patchUpdates(_0x4bc1f2){return function(_0x43202b){try{jsonpatch[_0xf274('0x22')](_0x43202b,_0x4bc1f2,!![]);}catch(_0x4a0302){return BPromise[_0xf274('0x23')](_0x4a0302);}return _0x43202b[_0xf274('0x24')]();};}function saveUpdates(_0x2ca092,_0x12ba56){return function(_0x353658){if(_0x353658){return _0x353658[_0xf274('0x25')](_0x2ca092)[_0xf274('0x26')](function(_0x52522a){return _0x52522a;});}return null;};}function removeEntity(_0x29c1cd,_0x1e4501){return function(_0x560dcc){if(_0x560dcc){return _0x560dcc[_0xf274('0x27')]()[_0xf274('0x26')](function(){_0x29c1cd[_0xf274('0x1a')](0xcc)[_0xf274('0x1b')]();});}};}function handleEntityNotFound(_0x160675,_0x57770a){return function(_0x1b5967){if(!_0x1b5967){_0x160675['sendStatus'](0x194);}return _0x1b5967;};}function handleError(_0x25f136,_0x293291){_0x293291=_0x293291||0x1f4;return function(_0x2a14c3){logger[_0xf274('0x28')](_0x2a14c3['stack']);if(_0x2a14c3['name']){delete _0x2a14c3[_0xf274('0x29')];}_0x25f136[_0xf274('0x1a')](_0x293291)[_0xf274('0x2a')](_0x2a14c3);};}exports[_0xf274('0x2b')]=function(_0x5145af,_0x11c127){var _0x585c3c={},_0x1a0a65={},_0x43583a={'count':0x0,'rows':[]};var _0x5233d2=_[_0xf274('0x2c')](db[_0xf274('0x2d')][_0xf274('0x2e')],function(_0x112ca6){return{'name':_0x112ca6['fieldName'],'type':_0x112ca6[_0xf274('0x2f')]['key']};});_0x1a0a65['model']=_[_0xf274('0x2c')](_0x5233d2,_0xf274('0x29'));_0x1a0a65['query']=_[_0xf274('0x30')](_0x5145af[_0xf274('0x31')]);_0x1a0a65[_0xf274('0x32')]=_['intersection'](_0x1a0a65['model'],_0x1a0a65['query']);_0x585c3c[_0xf274('0x33')]=_[_0xf274('0x34')](_0x1a0a65['model'],qs[_0xf274('0x35')](_0x5145af[_0xf274('0x31')][_0xf274('0x35')]));_0x585c3c[_0xf274('0x33')]=_0x585c3c[_0xf274('0x33')][_0xf274('0x36')]?_0x585c3c[_0xf274('0x33')]:_0x1a0a65[_0xf274('0x37')];if(!_0x5145af[_0xf274('0x31')][_0xf274('0x38')](_0xf274('0x39'))){_0x585c3c['limit']=qs[_0xf274('0x1e')](_0x5145af[_0xf274('0x31')][_0xf274('0x1e')]);_0x585c3c[_0xf274('0x1d')]=qs[_0xf274('0x1d')](_0x5145af[_0xf274('0x31')][_0xf274('0x1d')]);}_0x585c3c[_0xf274('0x3a')]=qs[_0xf274('0x3b')](_0x5145af[_0xf274('0x31')][_0xf274('0x3b')]);_0x585c3c[_0xf274('0x3c')]=qs['filters'](_[_0xf274('0x3d')](_0x5145af[_0xf274('0x31')],_0x1a0a65[_0xf274('0x32')]),_0x5233d2);if(_0x5145af['query'][_0xf274('0x3e')]){_0x585c3c['where']=_['merge'](_0x585c3c['where'],{'$or':_[_0xf274('0x2c')](_0x5233d2,function(_0x2e93bc){if(_0x2e93bc[_0xf274('0x2f')]!==_0xf274('0x3f')){var _0x5329c1={};_0x5329c1[_0x2e93bc['name']]={'$like':'%'+_0x5145af[_0xf274('0x31')]['filter']+'%'};return _0x5329c1;}})});}_0x585c3c=_[_0xf274('0x40')]({},_0x585c3c,_0x5145af[_0xf274('0x41')]);var _0x94548e={'where':_0x585c3c['where']};return db['VoiceDialReport']['count'](_0x94548e)[_0xf274('0x26')](function(_0x23efe1){_0x43583a[_0xf274('0x20')]=_0x23efe1;if(_0x5145af[_0xf274('0x31')][_0xf274('0x42')]){_0x585c3c[_0xf274('0x43')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xf274('0x44')](_0x585c3c);})[_0xf274('0x26')](function(_0x1457b6){_0x43583a[_0xf274('0x45')]=_0x1457b6;return _0x43583a;})[_0xf274('0x26')](respondWithFilteredResult(_0x11c127,_0x585c3c))['catch'](handleError(_0x11c127,null));};exports[_0xf274('0x46')]=function(_0x64682d,_0x351bff){var _0x3e4ed5={'raw':!![],'where':{'id':_0x64682d[_0xf274('0x47')]['id']}},_0xd569a0={};_0xd569a0[_0xf274('0x37')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0xd569a0[_0xf274('0x31')]=_[_0xf274('0x30')](_0x64682d[_0xf274('0x31')]);_0xd569a0[_0xf274('0x32')]=_[_0xf274('0x34')](_0xd569a0[_0xf274('0x37')],_0xd569a0[_0xf274('0x31')]);_0x3e4ed5[_0xf274('0x33')]=_[_0xf274('0x34')](_0xd569a0[_0xf274('0x37')],qs['fields'](_0x64682d[_0xf274('0x31')][_0xf274('0x35')]));_0x3e4ed5[_0xf274('0x33')]=_0x3e4ed5[_0xf274('0x33')][_0xf274('0x36')]?_0x3e4ed5[_0xf274('0x33')]:_0xd569a0['model'];if(_0x64682d[_0xf274('0x31')][_0xf274('0x42')]){_0x3e4ed5[_0xf274('0x43')]=[{'all':!![]}];}_0x3e4ed5=_[_0xf274('0x40')]({},_0x3e4ed5,_0x64682d['options']);return db[_0xf274('0x2d')]['find'](_0x3e4ed5)[_0xf274('0x26')](handleEntityNotFound(_0x351bff,null))[_0xf274('0x26')](respondWithResult(_0x351bff,null))[_0xf274('0x48')](handleError(_0x351bff,null));};exports[_0xf274('0x49')]=function(_0x1eb890,_0x1755a4){return db[_0xf274('0x2d')][_0xf274('0x49')](_0x1eb890[_0xf274('0x4a')],{})[_0xf274('0x26')](respondWithResult(_0x1755a4,0xc9))[_0xf274('0x48')](handleError(_0x1755a4,null));};exports['update']=function(_0x3acaa0,_0x410153){if(_0x3acaa0[_0xf274('0x4a')]['id']){delete _0x3acaa0[_0xf274('0x4a')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x3acaa0[_0xf274('0x47')]['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x410153,null))['then'](saveUpdates(_0x3acaa0[_0xf274('0x4a')],null))[_0xf274('0x26')](respondWithResult(_0x410153,null))[_0xf274('0x48')](handleError(_0x410153,null));};exports[_0xf274('0x27')]=function(_0x5c9801,_0x17a758){return db[_0xf274('0x2d')][_0xf274('0x4b')]({'where':{'id':_0x5c9801['params']['id']}})[_0xf274('0x26')](handleEntityNotFound(_0x17a758,null))[_0xf274('0x26')](removeEntity(_0x17a758,null))[_0xf274('0x48')](handleError(_0x17a758,null));};exports['describe']=function(_0x25361d,_0x5b2cf8){return db[_0xf274('0x2d')][_0xf274('0x4c')]()[_0xf274('0x26')](respondWithResult(_0x5b2cf8,null))[_0xf274('0x48')](handleError(_0x5b2cf8,null));}; \ No newline at end of file +var _0xe4aa=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','error','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra'];(function(_0x161312,_0x28f518){var _0x50f468=function(_0x26a1ab){while(--_0x26a1ab){_0x161312['push'](_0x161312['shift']());}};_0x50f468(++_0x28f518);}(_0xe4aa,0x87));var _0xae4a=function(_0x49929e,_0x72b8ac){_0x49929e=_0x49929e-0x0;var _0x2112e3=_0xe4aa[_0x49929e];return _0x2112e3;};'use strict';var emlformat=require(_0xae4a('0x0'));var rimraf=require(_0xae4a('0x1'));var zipdir=require(_0xae4a('0x2'));var jsonpatch=require(_0xae4a('0x3'));var rp=require(_0xae4a('0x4'));var moment=require(_0xae4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xae4a('0x6'));var path=require(_0xae4a('0x7'));var sox=require('sox');var csv=require(_0xae4a('0x8'));var ejs=require(_0xae4a('0x9'));var fs=require('fs');var fs_extra=require(_0xae4a('0xa'));var _=require('lodash');var squel=require(_0xae4a('0xb'));var crypto=require(_0xae4a('0xc'));var jsforce=require(_0xae4a('0xd'));var deskjs=require(_0xae4a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae4a('0xf'));var Papa=require(_0xae4a('0x10'));var Redis=require(_0xae4a('0x11'));var authService=require(_0xae4a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xae4a('0x13'));var hardwareService=require(_0xae4a('0x14'));var logger=require(_0xae4a('0x15'))(_0xae4a('0x16'));var utils=require(_0xae4a('0x17'));var config=require(_0xae4a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xae4a('0x19'))['db'];function respondWithStatusCode(_0x4dff2d,_0x38190d){_0x38190d=_0x38190d||0xcc;return function(_0x5695d6){if(_0x5695d6){return _0x4dff2d[_0xae4a('0x1a')](_0x38190d);}return _0x4dff2d[_0xae4a('0x1b')](_0x38190d)[_0xae4a('0x1c')]();};}function respondWithResult(_0x171519,_0x2100e5){_0x2100e5=_0x2100e5||0xc8;return function(_0x51eebf){if(_0x51eebf){return _0x171519[_0xae4a('0x1b')](_0x2100e5)[_0xae4a('0x1d')](_0x51eebf);}};}function respondWithFilteredResult(_0x2f622d,_0xcd4361){return function(_0x2c14e1){if(_0x2c14e1){var _0x5e5266=typeof _0xcd4361['offset']===_0xae4a('0x1e')&&typeof _0xcd4361[_0xae4a('0x1f')]===_0xae4a('0x1e');var _0x312143=_0x2c14e1[_0xae4a('0x20')];var _0x51e1d9=_0x5e5266?0x0:_0xcd4361[_0xae4a('0x21')];var _0x57bd71=_0x5e5266?_0x2c14e1[_0xae4a('0x20')]:_0xcd4361[_0xae4a('0x21')]+_0xcd4361[_0xae4a('0x1f')];var _0x153a8b;if(_0x57bd71>=_0x312143){_0x57bd71=_0x312143;_0x153a8b=0xc8;}else{_0x153a8b=0xce;}_0x2f622d[_0xae4a('0x1b')](_0x153a8b);return _0x2f622d['set']('Content-Range',_0x51e1d9+'-'+_0x57bd71+'/'+_0x312143)[_0xae4a('0x1d')](_0x2c14e1);}return null;};}function patchUpdates(_0x2b9f49){return function(_0x545e56){try{jsonpatch['apply'](_0x545e56,_0x2b9f49,!![]);}catch(_0x23c259){return BPromise[_0xae4a('0x22')](_0x23c259);}return _0x545e56[_0xae4a('0x23')]();};}function saveUpdates(_0x9c14de,_0x1f2d2b){return function(_0x7dcdc5){if(_0x7dcdc5){return _0x7dcdc5[_0xae4a('0x24')](_0x9c14de)[_0xae4a('0x25')](function(_0x270ff0){return _0x270ff0;});}return null;};}function removeEntity(_0x54c34d,_0x498784){return function(_0x3ed96d){if(_0x3ed96d){return _0x3ed96d['destroy']()[_0xae4a('0x25')](function(){_0x54c34d[_0xae4a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315e86,_0x2b9dc4){return function(_0x514c12){if(!_0x514c12){_0x315e86[_0xae4a('0x1a')](0x194);}return _0x514c12;};}function handleError(_0x127263,_0x4c2b62){_0x4c2b62=_0x4c2b62||0x1f4;return function(_0xf46072){logger[_0xae4a('0x26')](_0xf46072['stack']);if(_0xf46072[_0xae4a('0x27')]){delete _0xf46072['name'];}_0x127263[_0xae4a('0x1b')](_0x4c2b62)[_0xae4a('0x28')](_0xf46072);};}exports['index']=function(_0x393aa3,_0x113daa){var _0x392fbb={},_0x87d1e6={},_0x160fb6={'count':0x0,'rows':[]};var _0x108284=_[_0xae4a('0x29')](db[_0xae4a('0x2a')]['rawAttributes'],function(_0x2466ee){return{'name':_0x2466ee[_0xae4a('0x2b')],'type':_0x2466ee[_0xae4a('0x2c')][_0xae4a('0x2d')]};});_0x87d1e6[_0xae4a('0x2e')]=_[_0xae4a('0x29')](_0x108284,_0xae4a('0x27'));_0x87d1e6[_0xae4a('0x2f')]=_[_0xae4a('0x30')](_0x393aa3['query']);_0x87d1e6[_0xae4a('0x31')]=_['intersection'](_0x87d1e6[_0xae4a('0x2e')],_0x87d1e6['query']);_0x392fbb[_0xae4a('0x32')]=_[_0xae4a('0x33')](_0x87d1e6[_0xae4a('0x2e')],qs[_0xae4a('0x34')](_0x393aa3['query'][_0xae4a('0x34')]));_0x392fbb[_0xae4a('0x32')]=_0x392fbb[_0xae4a('0x32')][_0xae4a('0x35')]?_0x392fbb[_0xae4a('0x32')]:_0x87d1e6['model'];if(!_0x393aa3['query']['hasOwnProperty'](_0xae4a('0x36'))){_0x392fbb['limit']=qs['limit'](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x1f')]);_0x392fbb[_0xae4a('0x21')]=qs[_0xae4a('0x21')](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x21')]);}_0x392fbb['order']=qs[_0xae4a('0x37')](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x37')]);_0x392fbb[_0xae4a('0x38')]=qs[_0xae4a('0x31')](_['pick'](_0x393aa3['query'],_0x87d1e6[_0xae4a('0x31')]),_0x108284);if(_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x39')]){_0x392fbb[_0xae4a('0x38')]=_[_0xae4a('0x3a')](_0x392fbb['where'],{'$or':_[_0xae4a('0x29')](_0x108284,function(_0x4a6e75){if(_0x4a6e75[_0xae4a('0x2c')]!==_0xae4a('0x3b')){var _0x10ced7={};_0x10ced7[_0x4a6e75[_0xae4a('0x27')]]={'$like':'%'+_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x39')]+'%'};return _0x10ced7;}})});}_0x392fbb=_['merge']({},_0x392fbb,_0x393aa3[_0xae4a('0x3c')]);var _0x5e759c={'where':_0x392fbb[_0xae4a('0x38')]};return db[_0xae4a('0x2a')][_0xae4a('0x20')](_0x5e759c)['then'](function(_0x1f9b67){_0x160fb6[_0xae4a('0x20')]=_0x1f9b67;if(_0x393aa3[_0xae4a('0x2f')]['includeAll']){_0x392fbb[_0xae4a('0x3d')]=[{'all':!![]}];}return db[_0xae4a('0x2a')][_0xae4a('0x3e')](_0x392fbb);})[_0xae4a('0x25')](function(_0x35c48a){_0x160fb6['rows']=_0x35c48a;return _0x160fb6;})['then'](respondWithFilteredResult(_0x113daa,_0x392fbb))[_0xae4a('0x3f')](handleError(_0x113daa,null));};exports[_0xae4a('0x40')]=function(_0x3a8b6f,_0x554fc8){var _0x3ba0ee={'raw':!![],'where':{'id':_0x3a8b6f[_0xae4a('0x41')]['id']}},_0xa4f890={};_0xa4f890[_0xae4a('0x2e')]=_[_0xae4a('0x30')](db[_0xae4a('0x2a')][_0xae4a('0x42')]);_0xa4f890[_0xae4a('0x2f')]=_[_0xae4a('0x30')](_0x3a8b6f[_0xae4a('0x2f')]);_0xa4f890[_0xae4a('0x31')]=_[_0xae4a('0x33')](_0xa4f890[_0xae4a('0x2e')],_0xa4f890[_0xae4a('0x2f')]);_0x3ba0ee[_0xae4a('0x32')]=_[_0xae4a('0x33')](_0xa4f890[_0xae4a('0x2e')],qs[_0xae4a('0x34')](_0x3a8b6f[_0xae4a('0x2f')]['fields']));_0x3ba0ee['attributes']=_0x3ba0ee[_0xae4a('0x32')]['length']?_0x3ba0ee['attributes']:_0xa4f890[_0xae4a('0x2e')];if(_0x3a8b6f[_0xae4a('0x2f')][_0xae4a('0x43')]){_0x3ba0ee['include']=[{'all':!![]}];}_0x3ba0ee=_[_0xae4a('0x3a')]({},_0x3ba0ee,_0x3a8b6f[_0xae4a('0x3c')]);return db[_0xae4a('0x2a')]['find'](_0x3ba0ee)[_0xae4a('0x25')](handleEntityNotFound(_0x554fc8,null))[_0xae4a('0x25')](respondWithResult(_0x554fc8,null))['catch'](handleError(_0x554fc8,null));};exports[_0xae4a('0x44')]=function(_0x336162,_0x258e6f){return db[_0xae4a('0x2a')][_0xae4a('0x44')](_0x336162[_0xae4a('0x45')],{})['then'](respondWithResult(_0x258e6f,0xc9))[_0xae4a('0x3f')](handleError(_0x258e6f,null));};exports['update']=function(_0x6f219a,_0x20241e){if(_0x6f219a['body']['id']){delete _0x6f219a['body']['id'];}return db[_0xae4a('0x2a')][_0xae4a('0x46')]({'where':{'id':_0x6f219a[_0xae4a('0x41')]['id']}})[_0xae4a('0x25')](handleEntityNotFound(_0x20241e,null))[_0xae4a('0x25')](saveUpdates(_0x6f219a[_0xae4a('0x45')],null))[_0xae4a('0x25')](respondWithResult(_0x20241e,null))[_0xae4a('0x3f')](handleError(_0x20241e,null));};exports[_0xae4a('0x47')]=function(_0x1fbefe,_0x5a89a5){return db[_0xae4a('0x2a')][_0xae4a('0x46')]({'where':{'id':_0x1fbefe[_0xae4a('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a89a5,null))['then'](removeEntity(_0x5a89a5,null))[_0xae4a('0x3f')](handleError(_0x5a89a5,null));};exports[_0xae4a('0x48')]=function(_0x8a3eb6,_0xd71434){return db[_0xae4a('0x2a')][_0xae4a('0x48')]()['then'](respondWithResult(_0xd71434,null))[_0xae4a('0x3f')](handleError(_0xd71434,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index af74fbe..391ad2b 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 _0x8626=['report_dial','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceDialReport'];(function(_0xa34fa6,_0x43bff6){var _0xc3250c=function(_0x370359){while(--_0x370359){_0xa34fa6['push'](_0xa34fa6['shift']());}};_0xc3250c(++_0x43bff6);}(_0x8626,0xd9));var _0x6862=function(_0x27a7c0,_0x1b1a01){_0x27a7c0=_0x27a7c0-0x0;var _0x109744=_0x8626[_0x27a7c0];return _0x109744;};'use strict';var _=require('lodash');var util=require(_0x6862('0x0'));var logger=require(_0x6862('0x1'))(_0x6862('0x2'));var moment=require(_0x6862('0x3'));var BPromise=require(_0x6862('0x4'));var rp=require(_0x6862('0x5'));var fs=require('fs');var path=require(_0x6862('0x6'));var rimraf=require(_0x6862('0x7'));var config=require(_0x6862('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x6862('0x9')]=function(_0x347558,_0x59d335){return _0x347558['define'](_0x6862('0xa'),attributes,{'tableName':_0x6862('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6881=['../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','bluebird','request-promise','path'];(function(_0x394798,_0x14af05){var _0x80638c=function(_0x3321cb){while(--_0x3321cb){_0x394798['push'](_0x394798['shift']());}};_0x80638c(++_0x14af05);}(_0x6881,0x10e));var _0x1688=function(_0x63358a,_0xa611af){_0x63358a=_0x63358a-0x0;var _0x2242a5=_0x6881[_0x63358a];return _0x2242a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1688('0x0'))(_0x1688('0x1'));var moment=require('moment');var BPromise=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var fs=require('fs');var path=require(_0x1688('0x4'));var rimraf=require('rimraf');var config=require(_0x1688('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0x1688('0x6')]=function(_0x4cad07,_0x323ca9){return _0x4cad07[_0x1688('0x7')](_0x1688('0x8'),attributes,{'tableName':_0x1688('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1688('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 3760489..a0e94e1 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 _0x7725=['VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','UpdateVoiceDialReport','update','raw','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug'];(function(_0x1155c8,_0x54367b){var _0x347ad3=function(_0x32ab4a){while(--_0x32ab4a){_0x1155c8['push'](_0x1155c8['shift']());}};_0x347ad3(++_0x54367b);}(_0x7725,0xd8));var _0x5772=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0x7725[_0x14f458];return _0x4ff2da;};'use strict';var _=require(_0x5772('0x0'));var util=require(_0x5772('0x1'));var moment=require(_0x5772('0x2'));var BPromise=require(_0x5772('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5772('0x4'));var db=require(_0x5772('0x5'))['db'];var utils=require(_0x5772('0x6'));var logger=require(_0x5772('0x7'))('rpc');var config=require(_0x5772('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5772('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x226f1b,_0x1323d4,_0x1da85e){return new BPromise(function(_0x19c76e,_0x509c4f){return client[_0x5772('0xa')](_0x226f1b,_0x1da85e)[_0x5772('0xb')](function(_0x557c34){logger[_0x5772('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x1323d4,_0x5772('0xd'));logger[_0x5772('0xe')](_0x5772('0xf'),_0x1323d4,'request\x20sent',JSON[_0x5772('0x10')](_0x557c34));if(_0x557c34[_0x5772('0x11')]){if(_0x557c34[_0x5772('0x11')][_0x5772('0x12')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1323d4,_0x557c34[_0x5772('0x11')][_0x5772('0x13')]);return _0x509c4f(_0x557c34['error']['message']);}logger['error'](_0x5772('0x14'),_0x1323d4,_0x557c34[_0x5772('0x11')][_0x5772('0x13')]);return _0x19c76e(_0x557c34['error'][_0x5772('0x13')]);}else{logger[_0x5772('0xc')](_0x5772('0x14'),_0x1323d4,_0x5772('0xd'));_0x19c76e(_0x557c34[_0x5772('0x15')][_0x5772('0x13')]);}})[_0x5772('0x16')](function(_0x2474a8){logger[_0x5772('0x11')](_0x5772('0x14'),_0x1323d4,_0x2474a8);_0x509c4f(_0x2474a8);});});}exports[_0x5772('0x17')]=function(_0x13512c){var _0x3d5c21=this;return new Promise(function(_0x5bd0f5,_0x4765fe){return db[_0x5772('0x18')][_0x5772('0x19')](_0x13512c[_0x5772('0x1a')],{'raw':_0x13512c[_0x5772('0x1b')]?_0x13512c[_0x5772('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x5772('0xb')](function(_0xdd5994){logger[_0x5772('0xc')]('CreateVoiceDialReport',_0x13512c);logger[_0x5772('0xe')](_0x5772('0x17'),_0x13512c,JSON[_0x5772('0x10')](_0xdd5994));_0x5bd0f5(_0xdd5994);})[_0x5772('0x16')](function(_0x434b37){logger['error'](_0x5772('0x17'),_0x434b37[_0x5772('0x13')],_0x13512c);_0x4765fe(_0x3d5c21[_0x5772('0x11')](0x1f4,_0x434b37['message']));});});};exports[_0x5772('0x1c')]=function(_0x4896ff){var _0x1b4a67=this;return new Promise(function(_0x2b2245,_0x188048){return db[_0x5772('0x18')][_0x5772('0x1d')](_0x4896ff[_0x5772('0x1a')],{'raw':_0x4896ff['options']?_0x4896ff['options'][_0x5772('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4896ff['options']?_0x4896ff[_0x5772('0x1b')]['where']||null:null,'attributes':_0x4896ff[_0x5772('0x1b')]?_0x4896ff['options'][_0x5772('0x1f')]||null:null,'limit':_0x4896ff[_0x5772('0x1b')]?_0x4896ff['options'][_0x5772('0x20')]||null:null})[_0x5772('0xb')](function(_0x3f3e34){logger[_0x5772('0xc')](_0x5772('0x1c'),_0x4896ff);logger['debug'](_0x5772('0x1c'),_0x4896ff,JSON['stringify'](_0x3f3e34));_0x2b2245(_0x3f3e34);})[_0x5772('0x16')](function(_0x4baeb8){logger['error'](_0x5772('0x1c'),_0x4baeb8['message'],_0x4896ff);_0x188048(_0x1b4a67[_0x5772('0x11')](0x1f4,_0x4baeb8[_0x5772('0x13')]));});});}; \ No newline at end of file +var _0x43d4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceDialReport','create','body','options','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','raw','where','attributes','limit','lodash'];(function(_0x25a560,_0x1251ba){var _0x79f289=function(_0x5b99b6){while(--_0x5b99b6){_0x25a560['push'](_0x25a560['shift']());}};_0x79f289(++_0x1251ba);}(_0x43d4,0x11f));var _0x443d=function(_0x76502a,_0x19ac88){_0x76502a=_0x76502a-0x0;var _0x25a79b=_0x43d4[_0x76502a];return _0x25a79b;};'use strict';var _=require(_0x443d('0x0'));var util=require(_0x443d('0x1'));var moment=require(_0x443d('0x2'));var BPromise=require(_0x443d('0x3'));var rs=require(_0x443d('0x4'));var fs=require('fs');var Redis=require(_0x443d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x443d('0x6'));var logger=require(_0x443d('0x7'))(_0x443d('0x8'));var config=require(_0x443d('0x9'));var jayson=require(_0x443d('0xa'));var client=jayson[_0x443d('0xb')][_0x443d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x322b1a,_0x4d13ab,_0x24e18e){return new BPromise(function(_0x152241,_0x3acaf4){return client[_0x443d('0xd')](_0x322b1a,_0x24e18e)[_0x443d('0xe')](function(_0x2747ec){logger[_0x443d('0xf')](_0x443d('0x10'),_0x4d13ab,'request\x20sent');logger['debug'](_0x443d('0x11'),_0x4d13ab,_0x443d('0x12'),JSON[_0x443d('0x13')](_0x2747ec));if(_0x2747ec[_0x443d('0x14')]){if(_0x2747ec[_0x443d('0x14')]['code']===0x1f4){logger[_0x443d('0x14')](_0x443d('0x10'),_0x4d13ab,_0x2747ec['error'][_0x443d('0x15')]);return _0x3acaf4(_0x2747ec[_0x443d('0x14')]['message']);}logger[_0x443d('0x14')](_0x443d('0x10'),_0x4d13ab,_0x2747ec[_0x443d('0x14')]['message']);return _0x152241(_0x2747ec[_0x443d('0x14')][_0x443d('0x15')]);}else{logger[_0x443d('0xf')](_0x443d('0x10'),_0x4d13ab,_0x443d('0x12'));_0x152241(_0x2747ec[_0x443d('0x16')][_0x443d('0x15')]);}})[_0x443d('0x17')](function(_0x35eae5){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4d13ab,_0x35eae5);_0x3acaf4(_0x35eae5);});});}exports['CreateVoiceDialReport']=function(_0x372bf2){var _0xca03cd=this;return new Promise(function(_0x5a8ef5,_0x4dfe12){return db[_0x443d('0x18')][_0x443d('0x19')](_0x372bf2[_0x443d('0x1a')],{'raw':_0x372bf2['options']?_0x372bf2[_0x443d('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x443d('0xe')](function(_0x33077e){logger[_0x443d('0xf')](_0x443d('0x1c'),_0x372bf2);logger[_0x443d('0x1d')](_0x443d('0x1c'),_0x372bf2,JSON['stringify'](_0x33077e));_0x5a8ef5(_0x33077e);})[_0x443d('0x17')](function(_0x4ce09d){logger[_0x443d('0x14')](_0x443d('0x1c'),_0x4ce09d['message'],_0x372bf2);_0x4dfe12(_0xca03cd['error'](0x1f4,_0x4ce09d[_0x443d('0x15')]));});});};exports[_0x443d('0x1e')]=function(_0x2a1e){var _0x4cb538=this;return new Promise(function(_0x18df43,_0x54ef02){return db[_0x443d('0x18')][_0x443d('0x1f')](_0x2a1e['body'],{'raw':_0x2a1e['options']?_0x2a1e['options'][_0x443d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1e['options']?_0x2a1e[_0x443d('0x1b')][_0x443d('0x21')]||null:null,'attributes':_0x2a1e[_0x443d('0x1b')]?_0x2a1e[_0x443d('0x1b')][_0x443d('0x22')]||null:null,'limit':_0x2a1e[_0x443d('0x1b')]?_0x2a1e[_0x443d('0x1b')][_0x443d('0x23')]||null:null})[_0x443d('0xe')](function(_0xcbeaea){logger[_0x443d('0xf')]('UpdateVoiceDialReport',_0x2a1e);logger[_0x443d('0x1d')]('UpdateVoiceDialReport',_0x2a1e,JSON['stringify'](_0xcbeaea));_0x18df43(_0xcbeaea);})[_0x443d('0x17')](function(_0x104e35){logger[_0x443d('0x14')](_0x443d('0x1e'),_0x104e35['message'],_0x2a1e);_0x54ef02(_0x4cb538[_0x443d('0x14')](0x1f4,_0x104e35[_0x443d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 4fd80e1..e266af9 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 _0x8195=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','create','post','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x8195,0x104));var _0x5819=function(_0x20dedb,_0x2b87fd){_0x20dedb=_0x20dedb-0x0;var _0x1eafbf=_0x8195[_0x20dedb];return _0x1eafbf;};'use strict';var multer=require(_0x5819('0x0'));var util=require(_0x5819('0x1'));var path=require(_0x5819('0x2'));var timeout=require(_0x5819('0x3'));var express=require(_0x5819('0x4'));var router=express['Router']();var fs_extra=require(_0x5819('0x5'));var auth=require(_0x5819('0x6'));var interaction=require(_0x5819('0x7'));var config=require(_0x5819('0x8'));var controller=require(_0x5819('0x9'));router[_0x5819('0xa')]('/',auth[_0x5819('0xb')](),controller[_0x5819('0xc')]);router[_0x5819('0xa')](_0x5819('0xd'),auth[_0x5819('0xb')](),controller['show']);router['post']('/',auth[_0x5819('0xb')](),controller[_0x5819('0xe')]);router[_0x5819('0xf')]('/:id/applications',auth[_0x5819('0xb')](),controller[_0x5819('0x10')]);router[_0x5819('0x11')](_0x5819('0xd'),auth[_0x5819('0xb')](),controller[_0x5819('0x12')]);router[_0x5819('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5819('0x14')]);module[_0x5819('0x15')]=router; \ No newline at end of file +var _0xead9=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','/:id/applications','addApplications','put','update'];(function(_0x1e5e4a,_0x2463a9){var _0x2d7dd2=function(_0x543bf2){while(--_0x543bf2){_0x1e5e4a['push'](_0x1e5e4a['shift']());}};_0x2d7dd2(++_0x2463a9);}(_0xead9,0x1a5));var _0x9ead=function(_0xaa2dd6,_0x12016a){_0xaa2dd6=_0xaa2dd6-0x0;var _0x1ee8a5=_0xead9[_0xaa2dd6];return _0x1ee8a5;};'use strict';var multer=require(_0x9ead('0x0'));var util=require(_0x9ead('0x1'));var path=require(_0x9ead('0x2'));var timeout=require(_0x9ead('0x3'));var express=require(_0x9ead('0x4'));var router=express['Router']();var fs_extra=require(_0x9ead('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ead('0x6'));var config=require(_0x9ead('0x7'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x9ead('0x8')](),controller['index']);router[_0x9ead('0x9')](_0x9ead('0xa'),auth[_0x9ead('0x8')](),controller['show']);router[_0x9ead('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9ead('0xc'),auth[_0x9ead('0x8')](),controller[_0x9ead('0xd')]);router[_0x9ead('0xe')](_0x9ead('0xa'),auth[_0x9ead('0x8')](),controller[_0x9ead('0xf')]);router[_0x9ead('0x10')]('/:id',auth[_0x9ead('0x8')](),controller[_0x9ead('0x11')]);module[_0x9ead('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 02215a9..dfbfd0b 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 _0x7117=['compositeIndex','STRING','NoOp','ENUM','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports'];(function(_0x248938,_0x5e60a1){var _0x4bc973=function(_0x633ba9){while(--_0x633ba9){_0x248938['push'](_0x248938['shift']());}};_0x4bc973(++_0x5e60a1);}(_0x7117,0x10e));var _0x7711=function(_0x1023c4,_0x5acfe7){_0x1023c4=_0x1023c4-0x0;var _0x5451a9=_0x7117[_0x1023c4];return _0x5451a9;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7711('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7711('0x3')],'allowNull':![],'unique':_0x7711('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7711('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7711('0x3')],'allowNull':![],'defaultValue':_0x7711('0x4')},'appdata':{'type':Sequelize[_0x7711('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7711('0x5')]('inbound','outbound',_0x7711('0x6'),_0x7711('0x7'),_0x7711('0x8'),_0x7711('0x9'),_0x7711('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x7711('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7711('0xb')},'IntervalId':{'type':Sequelize[_0x7711('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x7711('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x7711('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7711('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x7711('0xe')},'answer':{'type':Sequelize[_0x7711('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x47757e){return this[_0x7711('0xf')](_0x7711('0x10'));}},'alias':{'type':Sequelize[_0x7711('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x6c7b=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6c7b,0x1ec));var _0xb6c7=function(_0x583c72,_0x3aac93){_0x583c72=_0x583c72-0x0;var _0x1fdd0f=_0x6c7b[_0x583c72];return _0x1fdd0f;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'context':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'unique':_0xb6c7('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':_0xb6c7('0x3')},'appdata':{'type':Sequelize[_0xb6c7('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb6c7('0x4')](_0xb6c7('0x5'),_0xb6c7('0x6'),_0xb6c7('0x7'),_0xb6c7('0x8'),_0xb6c7('0x9'),_0xb6c7('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xb6c7('0x1')]},'interval':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':_0xb6c7('0xb')},'IntervalId':{'type':Sequelize[_0xb6c7('0xc')]},'isApp':{'type':Sequelize[_0xb6c7('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb6c7('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xb6c7('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb6c7('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb6c7('0xe')},'answer':{'type':Sequelize[_0xb6c7('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3e4458){return this[_0xb6c7('0xf')](_0xb6c7('0x10'));}},'alias':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c8d8df2..d47565b 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 _0x8b4a=['show','params','rawAttributes','options','create','startsWith','body','exten','user','role','UserProfileSection','userProfileId','autoAssociation','update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','destroy','then','error','send','index','VoiceExtension','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','includeAll','include','findAll','rows','catch'];(function(_0x5e036d,_0x25240e){var _0x59acac=function(_0x3834b5){while(--_0x3834b5){_0x5e036d['push'](_0x5e036d['shift']());}};_0x59acac(++_0x25240e);}(_0x8b4a,0x12f));var _0xa8b4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8b4a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa8b4('0x0'));var Redis=require(_0xa8b4('0x1'));var qs=require(_0xa8b4('0x2'));var logger=require(_0xa8b4('0x3'))('api');var config=require('../../config/environment');var db=require(_0xa8b4('0x4'))['db'];config[_0xa8b4('0x5')]=_[_0xa8b4('0x6')](config[_0xa8b4('0x5')],{'host':_0xa8b4('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8b4('0x5')]));require(_0xa8b4('0x8'))[_0xa8b4('0x9')](socket);function respondWithStatusCode(_0x5cf946,_0x2d4ffb){_0x2d4ffb=_0x2d4ffb||0xcc;return function(_0x48325a){if(_0x48325a){return _0x5cf946[_0xa8b4('0xa')](_0x2d4ffb);}return _0x5cf946[_0xa8b4('0xb')](_0x2d4ffb)[_0xa8b4('0xc')]();};}function respondWithResult(_0xa3f2df,_0x54a667){_0x54a667=_0x54a667||0xc8;return function(_0x5458dd){if(_0x5458dd){return _0xa3f2df[_0xa8b4('0xb')](_0x54a667)[_0xa8b4('0xd')](_0x5458dd);}};}function respondWithFilteredResult(_0x543d5a,_0x1964b1){return function(_0x208702){if(_0x208702){var _0x475cf6=typeof _0x1964b1[_0xa8b4('0xe')]===_0xa8b4('0xf')&&typeof _0x1964b1[_0xa8b4('0x10')]===_0xa8b4('0xf');var _0x553cdc=_0x208702[_0xa8b4('0x11')];var _0x4339be=_0x475cf6?0x0:_0x1964b1['offset'];var _0xd96ab3=_0x475cf6?_0x208702[_0xa8b4('0x11')]:_0x1964b1['offset']+_0x1964b1['limit'];var _0x9eb3d6;if(_0xd96ab3>=_0x553cdc){_0xd96ab3=_0x553cdc;_0x9eb3d6=0xc8;}else{_0x9eb3d6=0xce;}_0x543d5a[_0xa8b4('0xb')](_0x9eb3d6);return _0x543d5a['set'](_0xa8b4('0x12'),_0x4339be+'-'+_0xd96ab3+'/'+_0x553cdc)['json'](_0x208702);}return null;};}function removeEntity(_0x43c20b){return function(_0x3234c7){if(_0x3234c7){return _0x3234c7['destroy']()['then'](function(){var _0x2113e8=_0x3234c7[_0xa8b4('0x13')]({'plain':!![]});var _0x4499da=[{'name':_0xa8b4('0x14'),'value':_0xa8b4('0x15'),'ignore':![]},{'name':_0xa8b4('0x16'),'value':_0xa8b4('0x17'),'ignore':![]},{'name':_0xa8b4('0x18'),'value':_0xa8b4('0x19'),'ignore':![]}];var _0xb57d96=_(_0x4499da)[_0xa8b4('0x1a')]('ignore')[_0xa8b4('0x1b')](_0xa8b4('0x1c'))['value']();if(_[_0xa8b4('0x1d')](_0xb57d96,_0x2113e8[_0xa8b4('0x1e')])){return;}var _0x55f36e=_[_0xa8b4('0x1f')](_0x4499da,['value',_0x2113e8[_0xa8b4('0x1e')]])[_0xa8b4('0x20')];return db[_0xa8b4('0x21')][_0xa8b4('0x22')]({'where':{'type':_0x55f36e,'resourceId':_0x2113e8['id']}})[_0xa8b4('0x23')](function(){return _0x3234c7;});})['then'](function(){_0x43c20b[_0xa8b4('0xb')](0xcc)[_0xa8b4('0xc')]();});}};}function handleEntityNotFound(_0x4e4b55){return function(_0x1fdcb7){if(!_0x1fdcb7){_0x4e4b55[_0xa8b4('0xa')](0x194);}return _0x1fdcb7;};}function handleError(_0x1a3f26,_0xffaf17){_0xffaf17=_0xffaf17||0x1f4;return function(_0x442a32){logger[_0xa8b4('0x24')](_0x442a32['stack']);if(_0x442a32['name']){delete _0x442a32[_0xa8b4('0x20')];}_0x1a3f26[_0xa8b4('0xb')](_0xffaf17)[_0xa8b4('0x25')](_0x442a32);};}exports[_0xa8b4('0x26')]=function(_0x2d3ba3,_0x33f5c5){var _0x15267d={},_0x1a4cbf={},_0x215866={'count':0x0,'rows':[]};var _0xda9d07=_['map'](db[_0xa8b4('0x27')]['rawAttributes'],function(_0x14cfe0){return{'name':_0x14cfe0[_0xa8b4('0x28')],'type':_0x14cfe0[_0xa8b4('0x1e')][_0xa8b4('0x29')]};});_0x1a4cbf['model']=_['map'](_0xda9d07,_0xa8b4('0x20'));_0x1a4cbf[_0xa8b4('0x2a')]=_[_0xa8b4('0x2b')](_0x2d3ba3[_0xa8b4('0x2a')]);_0x1a4cbf['filters']=_[_0xa8b4('0x2c')](_0x1a4cbf[_0xa8b4('0x2d')],_0x1a4cbf['query']);_0x15267d[_0xa8b4('0x2e')]=_[_0xa8b4('0x2c')](_0x1a4cbf[_0xa8b4('0x2d')],qs[_0xa8b4('0x2f')](_0x2d3ba3[_0xa8b4('0x2a')][_0xa8b4('0x2f')]));_0x15267d['attributes']=_0x15267d[_0xa8b4('0x2e')][_0xa8b4('0x30')]?_0x15267d[_0xa8b4('0x2e')]:_0x1a4cbf[_0xa8b4('0x2d')];if(!_0x2d3ba3['query'][_0xa8b4('0x31')](_0xa8b4('0x32'))){_0x15267d[_0xa8b4('0x10')]=qs[_0xa8b4('0x10')](_0x2d3ba3[_0xa8b4('0x2a')]['limit']);_0x15267d[_0xa8b4('0xe')]=qs[_0xa8b4('0xe')](_0x2d3ba3[_0xa8b4('0x2a')][_0xa8b4('0xe')]);}_0x15267d['order']=qs[_0xa8b4('0x33')](_0x2d3ba3[_0xa8b4('0x2a')][_0xa8b4('0x33')]);_0x15267d[_0xa8b4('0x34')]=qs[_0xa8b4('0x35')](_[_0xa8b4('0x36')](_0x2d3ba3[_0xa8b4('0x2a')],_0x1a4cbf['filters']),_0xda9d07);if(_0x2d3ba3[_0xa8b4('0x2a')][_0xa8b4('0x1a')]){_0x15267d[_0xa8b4('0x34')]=_[_0xa8b4('0x37')](_0x15267d[_0xa8b4('0x34')],{'$or':_[_0xa8b4('0x1b')](_0xda9d07,function(_0x19646b){if(_0x19646b['type']!=='VIRTUAL'){var _0x4a0eef={};_0x4a0eef[_0x19646b[_0xa8b4('0x20')]]={'$like':'%'+_0x2d3ba3[_0xa8b4('0x2a')][_0xa8b4('0x1a')]+'%'};return _0x4a0eef;}})});}_0x15267d=_[_0xa8b4('0x37')]({},_0x15267d,_0x2d3ba3['options']);var _0x35f889={'where':_0x15267d[_0xa8b4('0x34')]};return db['VoiceExtension'][_0xa8b4('0x11')](_0x35f889)[_0xa8b4('0x23')](function(_0x35b3ca){_0x215866[_0xa8b4('0x11')]=_0x35b3ca;if(_0x2d3ba3['query'][_0xa8b4('0x38')]){_0x15267d[_0xa8b4('0x39')]=[{'all':!![]}];}return db[_0xa8b4('0x27')][_0xa8b4('0x3a')](_0x15267d);})['then'](function(_0x3c7e12){_0x215866[_0xa8b4('0x3b')]=_0x3c7e12;return _0x215866;})[_0xa8b4('0x23')](respondWithFilteredResult(_0x33f5c5,_0x15267d))[_0xa8b4('0x3c')](handleError(_0x33f5c5,null));};exports[_0xa8b4('0x3d')]=function(_0x3af37b,_0x587604){var _0x5cec03={'raw':![],'where':{'id':_0x3af37b[_0xa8b4('0x3e')]['id']}},_0x4873e2={};_0x4873e2['model']=_[_0xa8b4('0x2b')](db['VoiceExtension'][_0xa8b4('0x3f')]);_0x4873e2[_0xa8b4('0x2a')]=_[_0xa8b4('0x2b')](_0x3af37b[_0xa8b4('0x2a')]);_0x4873e2['filters']=_[_0xa8b4('0x2c')](_0x4873e2[_0xa8b4('0x2d')],_0x4873e2[_0xa8b4('0x2a')]);_0x5cec03[_0xa8b4('0x2e')]=_[_0xa8b4('0x2c')](_0x4873e2[_0xa8b4('0x2d')],qs['fields'](_0x3af37b['query'][_0xa8b4('0x2f')]));_0x5cec03[_0xa8b4('0x2e')]=_0x5cec03[_0xa8b4('0x2e')][_0xa8b4('0x30')]?_0x5cec03['attributes']:_0x4873e2['model'];if(_0x3af37b['query']['includeAll']){_0x5cec03[_0xa8b4('0x39')]=[{'all':!![]}];}_0x5cec03=_[_0xa8b4('0x37')]({},_0x5cec03,_0x3af37b[_0xa8b4('0x40')]);return db[_0xa8b4('0x27')]['find'](_0x5cec03)[_0xa8b4('0x23')](handleEntityNotFound(_0x587604,null))[_0xa8b4('0x23')](respondWithResult(_0x587604,null))[_0xa8b4('0x3c')](handleError(_0x587604,null));};exports[_0xa8b4('0x22')]=function(_0x2122c9,_0x26f10a){return db[_0xa8b4('0x27')]['find']({'where':{'id':_0x2122c9[_0xa8b4('0x3e')]['id']}})[_0xa8b4('0x23')](handleEntityNotFound(_0x26f10a,null))[_0xa8b4('0x23')](removeEntity(_0x26f10a,null))[_0xa8b4('0x3c')](handleError(_0x26f10a,null));};exports[_0xa8b4('0x41')]=function(_0x16dfb7,_0x970452){if(_0x16dfb7['body'][_0xa8b4('0x1e')]===_0xa8b4('0x17')&&!_[_0xa8b4('0x42')](_0x16dfb7[_0xa8b4('0x43')][_0xa8b4('0x44')],'_')){_0x16dfb7[_0xa8b4('0x43')][_0xa8b4('0x44')]='_'['concat'](_0x16dfb7['body']['exten']);}return db[_0xa8b4('0x27')][_0xa8b4('0x41')](_0x16dfb7[_0xa8b4('0x43')],{'raw':![]})[_0xa8b4('0x23')](function(_0x2467e6){var _0x1c50da=_0x16dfb7[_0xa8b4('0x45')][_0xa8b4('0x13')]({'plain':!![]});if(!_0x1c50da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c50da[_0xa8b4('0x46')]==='user'){var _0xa424bc=_0x2467e6['get']({'plain':!![]});var _0x48de1c=[{'name':_0xa8b4('0x14'),'value':_0xa8b4('0x15')},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':_0xa8b4('0x19')}];var _0x3075bc=_['find'](_0x48de1c,[_0xa8b4('0x1c'),_0xa424bc[_0xa8b4('0x1e')]])[_0xa8b4('0x20')];return db[_0xa8b4('0x47')][_0xa8b4('0x1f')]({'where':{'name':_0x3075bc,'userProfileId':_0x1c50da[_0xa8b4('0x48')]},'raw':!![]})[_0xa8b4('0x23')](function(_0x4b94f8){if(_0x4b94f8&&_0x4b94f8[_0xa8b4('0x49')]===0x0){return db[_0xa8b4('0x21')][_0xa8b4('0x41')]({'name':_0xa424bc[_0xa8b4('0x20')],'resourceId':_0xa424bc['id'],'type':_0x4b94f8['name'],'sectionId':_0x4b94f8['id']},{})[_0xa8b4('0x23')](function(){return _0x2467e6;});}else{return _0x2467e6;}})['catch'](function(_0x16982e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16982e);throw _0x16982e;});}return _0x2467e6;})[_0xa8b4('0x23')](respondWithResult(_0x970452,0xc9))[_0xa8b4('0x3c')](handleError(_0x970452,null));};exports[_0xa8b4('0x4a')]=function(_0x11be9a,_0x45f045){if(_0x11be9a[_0xa8b4('0x43')]['id']){delete _0x11be9a[_0xa8b4('0x43')]['id'];}return db[_0xa8b4('0x27')][_0xa8b4('0x1f')]({'where':{'id':_0x11be9a[_0xa8b4('0x3e')]['id']}})[_0xa8b4('0x23')](handleEntityNotFound(_0x45f045,null))['then'](function(_0xc51a2a){if(_0xc51a2a){return db[_0xa8b4('0x27')]['update'](_[_0xa8b4('0x36')](_0x11be9a[_0xa8b4('0x43')],[_0xa8b4('0x44'),_0xa8b4('0x4b'),_0xa8b4('0x4c'),_0xa8b4('0x4d'),'cutdigits',_0xa8b4('0x4e'),_0xa8b4('0x4f')]),{'where':{'context':_0xc51a2a[_0xa8b4('0x4b')],'exten':_0xc51a2a[_0xa8b4('0x44')]},'individualHooks':!![]})[_0xa8b4('0x23')](function(_0x3cd141){return _0x3cd141;});}return null;})[_0xa8b4('0x23')](respondWithStatusCode(_0x45f045,null))[_0xa8b4('0x3c')](handleError(_0x45f045,null));};exports[_0xa8b4('0x50')]=function(_0x284e10,_0x33b72d){var _0x3c6ec9=_0x284e10[_0xa8b4('0x3e')]['id'];var _0x4533e5=_0x284e10[_0xa8b4('0x43')];var _0x367706=0xc8;var _0x49a459=null;return db[_0xa8b4('0x51')][_0xa8b4('0x52')]({'isolationLevel':db[_0xa8b4('0x51')][_0xa8b4('0x53')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5b7446){return db['VoiceExtension']['findOne']({'where':{'id':_0x3c6ec9},'transaction':_0x5b7446})[_0xa8b4('0x23')](function(_0x5c36dd){if(_0x5c36dd){return db[_0xa8b4('0x27')][_0xa8b4('0x22')]({'where':{'VoiceExtensionId':_0x3c6ec9},'transaction':_0x5b7446})[_0xa8b4('0x23')](function(){var _0x18255a=_[_0xa8b4('0x1b')](_0x4533e5,function(_0xa2a1d9){_0xa2a1d9[_0xa8b4('0x54')]=_0x3c6ec9;_0xa2a1d9[_0xa8b4('0x55')]=!![];return _0xa2a1d9;});return _0x5c36dd[_0xa8b4('0x56')](_0x18255a);})[_0xa8b4('0x23')](function(_0x16fec0){return db[_0xa8b4('0x27')][_0xa8b4('0x57')](_0x16fec0,{'transaction':_0x5b7446});});}else{_0x367706=0x194;_0x49a459=[];}});})[_0xa8b4('0x23')](function(){if(_0x367706!==0x194){return db[_0xa8b4('0x27')][_0xa8b4('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3c6ec9},'order':_0xa8b4('0x59')})[_0xa8b4('0x23')](function(_0x33a03f){_0x49a459=_0x33a03f;});}})[_0xa8b4('0x3c')](function(_0x313d25){_0x367706=0x1f4;logger['error'](_0x313d25[_0xa8b4('0x5a')]);if(_0x313d25[_0xa8b4('0x20')]){delete _0x313d25[_0xa8b4('0x20')];}_0x49a459=_0x313d25;})['finally'](function(){if(_0x49a459===null){_0x33b72d[_0xa8b4('0xa')](_0x367706);}else{if(_0x367706===0x1f4){_0x33b72d[_0xa8b4('0xb')](_0x367706)[_0xa8b4('0x25')](_0x49a459);}else{_0x33b72d[_0xa8b4('0xb')](_0x367706)['json'](_0x49a459);}}});}; \ No newline at end of file +var _0xf98b=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','then','get','InboundRoutes','outbound','internal','ignore','value','type','destroy','error','stack','name','send','map','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','length','merge','find','params','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','OutboundRoutes','UserProfileSection','autoAssociation'];(function(_0x816507,_0x310a55){var _0xcffa37=function(_0x20d8c8){while(--_0x20d8c8){_0x816507['push'](_0x816507['shift']());}};_0xcffa37(++_0x310a55);}(_0xf98b,0x6e));var _0xbf98=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xf98b[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xbf98('0x0'));var Redis=require('ioredis');var qs=require(_0xbf98('0x1'));var logger=require('../../config/logger')('api');var config=require(_0xbf98('0x2'));var db=require(_0xbf98('0x3'))['db'];config[_0xbf98('0x4')]=_['defaults'](config['redis'],{'host':_0xbf98('0x5'),'port':0x18eb});var socket=require(_0xbf98('0x6'))(new Redis(config[_0xbf98('0x4')]));require(_0xbf98('0x7'))['register'](socket);function respondWithStatusCode(_0x246537,_0x12fa55){_0x12fa55=_0x12fa55||0xcc;return function(_0x31388a){if(_0x31388a){return _0x246537[_0xbf98('0x8')](_0x12fa55);}return _0x246537[_0xbf98('0x9')](_0x12fa55)[_0xbf98('0xa')]();};}function respondWithResult(_0x244492,_0x98795f){_0x98795f=_0x98795f||0xc8;return function(_0x2e8b77){if(_0x2e8b77){return _0x244492[_0xbf98('0x9')](_0x98795f)[_0xbf98('0xb')](_0x2e8b77);}};}function respondWithFilteredResult(_0x4ebb40,_0x554613){return function(_0x1801a7){if(_0x1801a7){var _0x1a1bba=typeof _0x554613['offset']===_0xbf98('0xc')&&typeof _0x554613[_0xbf98('0xd')]===_0xbf98('0xc');var _0x453349=_0x1801a7[_0xbf98('0xe')];var _0x514d8a=_0x1a1bba?0x0:_0x554613['offset'];var _0x282622=_0x1a1bba?_0x1801a7[_0xbf98('0xe')]:_0x554613[_0xbf98('0xf')]+_0x554613['limit'];var _0x391f14;if(_0x282622>=_0x453349){_0x282622=_0x453349;_0x391f14=0xc8;}else{_0x391f14=0xce;}_0x4ebb40[_0xbf98('0x9')](_0x391f14);return _0x4ebb40['set'](_0xbf98('0x10'),_0x514d8a+'-'+_0x282622+'/'+_0x453349)[_0xbf98('0xb')](_0x1801a7);}return null;};}function removeEntity(_0x44402e){return function(_0x209916){if(_0x209916){return _0x209916['destroy']()[_0xbf98('0x11')](function(){var _0x37074d=_0x209916[_0xbf98('0x12')]({'plain':!![]});var _0x421fb2=[{'name':_0xbf98('0x13'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xbf98('0x14'),'ignore':![]},{'name':'InternalRoutes','value':_0xbf98('0x15'),'ignore':![]}];var _0x14e396=_(_0x421fb2)['filter'](_0xbf98('0x16'))['map'](_0xbf98('0x17'))['value']();if(_['includes'](_0x14e396,_0x37074d['type'])){return;}var _0x4e3804=_['find'](_0x421fb2,[_0xbf98('0x17'),_0x37074d[_0xbf98('0x18')]])['name'];return db['UserProfileResource'][_0xbf98('0x19')]({'where':{'type':_0x4e3804,'resourceId':_0x37074d['id']}})[_0xbf98('0x11')](function(){return _0x209916;});})[_0xbf98('0x11')](function(){_0x44402e['status'](0xcc)[_0xbf98('0xa')]();});}};}function handleEntityNotFound(_0x11b931){return function(_0x8f7bcb){if(!_0x8f7bcb){_0x11b931[_0xbf98('0x8')](0x194);}return _0x8f7bcb;};}function handleError(_0xc1a79c,_0x3f8431){_0x3f8431=_0x3f8431||0x1f4;return function(_0x25d01d){logger[_0xbf98('0x1a')](_0x25d01d[_0xbf98('0x1b')]);if(_0x25d01d[_0xbf98('0x1c')]){delete _0x25d01d['name'];}_0xc1a79c[_0xbf98('0x9')](_0x3f8431)[_0xbf98('0x1d')](_0x25d01d);};}exports['index']=function(_0xe2703b,_0x24b50d){var _0x53deb0={},_0x4a4c0f={},_0x20fd96={'count':0x0,'rows':[]};var _0x3c8795=_[_0xbf98('0x1e')](db[_0xbf98('0x1f')][_0xbf98('0x20')],function(_0x4fb020){return{'name':_0x4fb020['fieldName'],'type':_0x4fb020[_0xbf98('0x18')]['key']};});_0x4a4c0f[_0xbf98('0x21')]=_[_0xbf98('0x1e')](_0x3c8795,_0xbf98('0x1c'));_0x4a4c0f[_0xbf98('0x22')]=_[_0xbf98('0x23')](_0xe2703b['query']);_0x4a4c0f[_0xbf98('0x24')]=_['intersection'](_0x4a4c0f[_0xbf98('0x21')],_0x4a4c0f[_0xbf98('0x22')]);_0x53deb0['attributes']=_[_0xbf98('0x25')](_0x4a4c0f[_0xbf98('0x21')],qs[_0xbf98('0x26')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0x26')]));_0x53deb0[_0xbf98('0x27')]=_0x53deb0[_0xbf98('0x27')]['length']?_0x53deb0[_0xbf98('0x27')]:_0x4a4c0f[_0xbf98('0x21')];if(!_0xe2703b['query'][_0xbf98('0x28')](_0xbf98('0x29'))){_0x53deb0['limit']=qs[_0xbf98('0xd')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0xd')]);_0x53deb0[_0xbf98('0xf')]=qs[_0xbf98('0xf')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0xf')]);}_0x53deb0[_0xbf98('0x2a')]=qs[_0xbf98('0x2b')](_0xe2703b['query']['sort']);_0x53deb0[_0xbf98('0x2c')]=qs[_0xbf98('0x24')](_['pick'](_0xe2703b[_0xbf98('0x22')],_0x4a4c0f[_0xbf98('0x24')]),_0x3c8795);if(_0xe2703b[_0xbf98('0x22')]['filter']){_0x53deb0[_0xbf98('0x2c')]=_['merge'](_0x53deb0[_0xbf98('0x2c')],{'$or':_[_0xbf98('0x1e')](_0x3c8795,function(_0x1bd616){if(_0x1bd616['type']!=='VIRTUAL'){var _0x30c25c={};_0x30c25c[_0x1bd616[_0xbf98('0x1c')]]={'$like':'%'+_0xe2703b['query'][_0xbf98('0x2d')]+'%'};return _0x30c25c;}})});}_0x53deb0=_['merge']({},_0x53deb0,_0xe2703b[_0xbf98('0x2e')]);var _0x1a9808={'where':_0x53deb0[_0xbf98('0x2c')]};return db['VoiceExtension'][_0xbf98('0xe')](_0x1a9808)[_0xbf98('0x11')](function(_0x61c0fc){_0x20fd96[_0xbf98('0xe')]=_0x61c0fc;if(_0xe2703b[_0xbf98('0x22')][_0xbf98('0x2f')]){_0x53deb0[_0xbf98('0x30')]=[{'all':!![]}];}return db[_0xbf98('0x1f')][_0xbf98('0x31')](_0x53deb0);})['then'](function(_0x219a0f){_0x20fd96[_0xbf98('0x32')]=_0x219a0f;return _0x20fd96;})[_0xbf98('0x11')](respondWithFilteredResult(_0x24b50d,_0x53deb0))[_0xbf98('0x33')](handleError(_0x24b50d,null));};exports[_0xbf98('0x34')]=function(_0x2eb3e7,_0x4fcda3){var _0x198c90={'raw':![],'where':{'id':_0x2eb3e7['params']['id']}},_0x5025e5={};_0x5025e5[_0xbf98('0x21')]=_[_0xbf98('0x23')](db['VoiceExtension'][_0xbf98('0x20')]);_0x5025e5[_0xbf98('0x22')]=_[_0xbf98('0x23')](_0x2eb3e7[_0xbf98('0x22')]);_0x5025e5['filters']=_[_0xbf98('0x25')](_0x5025e5[_0xbf98('0x21')],_0x5025e5[_0xbf98('0x22')]);_0x198c90[_0xbf98('0x27')]=_[_0xbf98('0x25')](_0x5025e5[_0xbf98('0x21')],qs[_0xbf98('0x26')](_0x2eb3e7[_0xbf98('0x22')][_0xbf98('0x26')]));_0x198c90[_0xbf98('0x27')]=_0x198c90['attributes'][_0xbf98('0x35')]?_0x198c90['attributes']:_0x5025e5['model'];if(_0x2eb3e7[_0xbf98('0x22')][_0xbf98('0x2f')]){_0x198c90[_0xbf98('0x30')]=[{'all':!![]}];}_0x198c90=_[_0xbf98('0x36')]({},_0x198c90,_0x2eb3e7[_0xbf98('0x2e')]);return db[_0xbf98('0x1f')][_0xbf98('0x37')](_0x198c90)[_0xbf98('0x11')](handleEntityNotFound(_0x4fcda3,null))[_0xbf98('0x11')](respondWithResult(_0x4fcda3,null))['catch'](handleError(_0x4fcda3,null));};exports[_0xbf98('0x19')]=function(_0x203d92,_0x32206f){return db[_0xbf98('0x1f')]['find']({'where':{'id':_0x203d92[_0xbf98('0x38')]['id']}})['then'](handleEntityNotFound(_0x32206f,null))[_0xbf98('0x11')](removeEntity(_0x32206f,null))[_0xbf98('0x33')](handleError(_0x32206f,null));};exports[_0xbf98('0x39')]=function(_0x4b036a,_0x55b7f2){if(_0x4b036a[_0xbf98('0x3a')][_0xbf98('0x18')]===_0xbf98('0x14')&&!_['startsWith'](_0x4b036a[_0xbf98('0x3a')]['exten'],'_')){_0x4b036a[_0xbf98('0x3a')]['exten']='_'['concat'](_0x4b036a[_0xbf98('0x3a')][_0xbf98('0x3b')]);}return db[_0xbf98('0x1f')][_0xbf98('0x39')](_0x4b036a['body'],{'raw':![]})[_0xbf98('0x11')](function(_0x4d0a36){var _0x4469de=_0x4b036a[_0xbf98('0x3c')]['get']({'plain':!![]});if(!_0x4469de)throw new Error(_0xbf98('0x3d'));if(_0x4469de['role']===_0xbf98('0x3c')){var _0x1c84bb=_0x4d0a36['get']({'plain':!![]});var _0x4ffa08=[{'name':_0xbf98('0x13'),'value':_0xbf98('0x3e')},{'name':_0xbf98('0x3f'),'value':_0xbf98('0x14')},{'name':'InternalRoutes','value':'internal'}];var _0x14a877=_[_0xbf98('0x37')](_0x4ffa08,[_0xbf98('0x17'),_0x1c84bb['type']])[_0xbf98('0x1c')];return db[_0xbf98('0x40')][_0xbf98('0x37')]({'where':{'name':_0x14a877,'userProfileId':_0x4469de['userProfileId']},'raw':!![]})[_0xbf98('0x11')](function(_0x20bf55){if(_0x20bf55&&_0x20bf55[_0xbf98('0x41')]===0x0){return db[_0xbf98('0x42')]['create']({'name':_0x1c84bb[_0xbf98('0x1c')],'resourceId':_0x1c84bb['id'],'type':_0x20bf55['name'],'sectionId':_0x20bf55['id']},{})['then'](function(){return _0x4d0a36;});}else{return _0x4d0a36;}})['catch'](function(_0x5e1b42){logger['error'](_0xbf98('0x43'),_0x5e1b42);throw _0x5e1b42;});}return _0x4d0a36;})[_0xbf98('0x11')](respondWithResult(_0x55b7f2,0xc9))[_0xbf98('0x33')](handleError(_0x55b7f2,null));};exports[_0xbf98('0x44')]=function(_0x53b288,_0x36934b){if(_0x53b288[_0xbf98('0x3a')]['id']){delete _0x53b288[_0xbf98('0x3a')]['id'];}return db['VoiceExtension'][_0xbf98('0x37')]({'where':{'id':_0x53b288[_0xbf98('0x38')]['id']}})[_0xbf98('0x11')](handleEntityNotFound(_0x36934b,null))[_0xbf98('0x11')](function(_0x5eb42c){if(_0x5eb42c){return db['VoiceExtension']['update'](_[_0xbf98('0x45')](_0x53b288[_0xbf98('0x3a')],[_0xbf98('0x3b'),'context',_0xbf98('0x46'),_0xbf98('0x47'),_0xbf98('0x48'),_0xbf98('0x49'),_0xbf98('0x4a')]),{'where':{'context':_0x5eb42c[_0xbf98('0x4b')],'exten':_0x5eb42c['exten']},'individualHooks':!![]})[_0xbf98('0x11')](function(_0x5e2c78){return _0x5e2c78;});}return null;})['then'](respondWithStatusCode(_0x36934b,null))[_0xbf98('0x33')](handleError(_0x36934b,null));};exports['addApplications']=function(_0x26cf83,_0x2febec){var _0x4a9fc2=_0x26cf83[_0xbf98('0x38')]['id'];var _0x3b2987=_0x26cf83['body'];var _0x3809ac=0xc8;var _0x436783=null;return db[_0xbf98('0x4c')][_0xbf98('0x4d')]({'isolationLevel':db[_0xbf98('0x4c')][_0xbf98('0x4e')][_0xbf98('0x4f')][_0xbf98('0x50')]},function(_0xe7f07){return db['VoiceExtension'][_0xbf98('0x51')]({'where':{'id':_0x4a9fc2},'transaction':_0xe7f07})[_0xbf98('0x11')](function(_0x649001){if(_0x649001){return db[_0xbf98('0x1f')][_0xbf98('0x19')]({'where':{'VoiceExtensionId':_0x4a9fc2},'transaction':_0xe7f07})[_0xbf98('0x11')](function(){var _0x7cc210=_[_0xbf98('0x1e')](_0x3b2987,function(_0x333d06){_0x333d06[_0xbf98('0x52')]=_0x4a9fc2;_0x333d06[_0xbf98('0x53')]=!![];return _0x333d06;});return _0x649001[_0xbf98('0x54')](_0x7cc210);})[_0xbf98('0x11')](function(_0x398235){return db[_0xbf98('0x1f')][_0xbf98('0x55')](_0x398235,{'transaction':_0xe7f07});});}else{_0x3809ac=0x194;_0x436783=[];}});})[_0xbf98('0x11')](function(){if(_0x3809ac!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4a9fc2},'order':_0xbf98('0x56')})['then'](function(_0x4a66e7){_0x436783=_0x4a66e7;});}})[_0xbf98('0x33')](function(_0x36ee31){_0x3809ac=0x1f4;logger[_0xbf98('0x1a')](_0x36ee31[_0xbf98('0x1b')]);if(_0x36ee31[_0xbf98('0x1c')]){delete _0x36ee31[_0xbf98('0x1c')];}_0x436783=_0x36ee31;})[_0xbf98('0x57')](function(){if(_0x436783===null){_0x2febec['sendStatus'](_0x3809ac);}else{if(_0x3809ac===0x1f4){_0x2febec[_0xbf98('0x9')](_0x3809ac)['send'](_0x436783);}else{_0x2febec['status'](_0x3809ac)[_0xbf98('0xb')](_0x436783);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 967d322..d7de94c 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 _0x83c4=['hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x48db63,_0x3f2030){var _0x257378=function(_0x18ba99){while(--_0x18ba99){_0x48db63['push'](_0x48db63['shift']());}};_0x257378(++_0x3f2030);}(_0x83c4,0x1ec));var _0x483c=function(_0x3a6437,_0x4e3187){_0x3a6437=_0x3a6437-0x0;var _0xdf5822=_0x83c4[_0x3a6437];return _0xdf5822;};'use strict';var EventEmitter=require(_0x483c('0x0'));var VoiceExtension=require(_0x483c('0x1'))['db'][_0x483c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x483c('0x3')](0x0);var events={'afterCreate':_0x483c('0x4'),'afterUpdate':_0x483c('0x5'),'afterDestroy':_0x483c('0x6')};function emitEvent(_0x3f26d4){return function(_0x24af73,_0x59acad,_0x4c748f){VoiceExtensionEvents[_0x483c('0x7')](_0x3f26d4+':'+_0x24af73['id'],_0x24af73);VoiceExtensionEvents['emit'](_0x3f26d4,_0x24af73);_0x4c748f(null);};}for(var e in events){if(events[_0x483c('0x8')](e)){var event=events[e];VoiceExtension[_0x483c('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xef57=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4fcd21,_0x3b4148){var _0x3af7b8=function(_0x4a0f72){while(--_0x4a0f72){_0x4fcd21['push'](_0x4fcd21['shift']());}};_0x3af7b8(++_0x3b4148);}(_0xef57,0x143));var _0x7ef5=function(_0x21985e,_0x2e090f){_0x21985e=_0x21985e-0x0;var _0x448ede=_0xef57[_0x21985e];return _0x448ede;};'use strict';var EventEmitter=require(_0x7ef5('0x0'));var VoiceExtension=require(_0x7ef5('0x1'))['db'][_0x7ef5('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7ef5('0x3')](0x0);var events={'afterCreate':_0x7ef5('0x4'),'afterUpdate':'update','afterDestroy':_0x7ef5('0x5')};function emitEvent(_0x357b6c){return function(_0x2f8648,_0x184f2d,_0x1f53d2){VoiceExtensionEvents[_0x7ef5('0x6')](_0x357b6c+':'+_0x2f8648['id'],_0x2f8648);VoiceExtensionEvents['emit'](_0x357b6c,_0x2f8648);_0x1f53d2(null);};}for(var e in events){if(events[_0x7ef5('0x7')](e)){var event=events[e];VoiceExtension[_0x7ef5('0x8')](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 de1ff3e..f1ea76c 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 _0x27bf=['ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','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','concat','catch','define','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','Set','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','join','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','toLowerCase','hasOwnProperty','tag','CDR(tag)='];(function(_0x4e8aea,_0x4e4a92){var _0x1e70a9=function(_0x3113f1){while(--_0x3113f1){_0x4e8aea['push'](_0x4e8aea['shift']());}};_0x1e70a9(++_0x4e4a92);}(_0x27bf,0x117));var _0xf27b=function(_0x17ae04,_0x263957){_0x17ae04=_0x17ae04-0x0;var _0x3cdb8c=_0x27bf[_0x17ae04];return _0x3cdb8c;};'use strict';var _=require(_0xf27b('0x0'));var attributes=require(_0xf27b('0x1'));module[_0xf27b('0x2')]=function(_0x43cecf){var _0x18005f=_0x43cecf[_0xf27b('0x3')];function _0x430f3a(_0x2ff64c){var _0x339bb9=0x2;var _0x1542e3=[{'type':_0x2ff64c[_0xf27b('0x4')],'app':'Set','appdata':_0xf27b('0x5')+_0x2ff64c[_0xf27b('0x4')],'context':_0x2ff64c[_0xf27b('0x6')],'exten':_0x2ff64c[_0xf27b('0x7')],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']},{'type':_0x2ff64c[_0xf27b('0x4')],'app':_0x2ff64c[_0xf27b('0x8')]?'Set':_0xf27b('0x9'),'appdata':_0x2ff64c[_0xf27b('0x8')]?_0xf27b('0xa')+_0x2ff64c[_0xf27b('0x8')]:_0xf27b('0xb'),'context':_0x2ff64c[_0xf27b('0x6')],'exten':_0x2ff64c[_0xf27b('0x7')],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']}];if(_0x2ff64c['type']==='inbound'){_0x1542e3['push']({'type':_0xf27b('0xc'),'app':'Set','appdata':_0xf27b('0xd')+_0x2ff64c['id'],'context':_0x2ff64c[_0xf27b('0x6')],'exten':_0x2ff64c[_0xf27b('0x7')],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']});}_0x1542e3[_0xf27b('0xe')]({'type':_0x2ff64c['type'],'app':_0xf27b('0xf'),'appdata':_0xf27b('0x10'),'context':_0x2ff64c[_0xf27b('0x6')],'exten':_0x2ff64c[_0xf27b('0x7')],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']},{'type':_0x2ff64c['type'],'app':_0xf27b('0xf'),'appdata':_0xf27b('0x11'),'context':_0x2ff64c['context'],'exten':_0x2ff64c['exten'],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']},{'type':_0x2ff64c[_0xf27b('0x4')],'app':'Set','appdata':_0xf27b('0x12'),'context':_0x2ff64c[_0xf27b('0x6')],'exten':_0x2ff64c[_0xf27b('0x7')],'priority':_0x339bb9++,'VoiceExtensionId':_0x2ff64c['id']});return _0x1542e3;}function _0x5305d9(_0x42f512){var _0x216423=0x2;var _0x1350d8=[{'type':'outbound','app':_0xf27b('0xf'),'appdata':_0xf27b('0x13'),'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0x42f512[_0xf27b('0x8')]?_0xf27b('0xf'):_0xf27b('0x9'),'appdata':_0x42f512[_0xf27b('0x8')]?'CDR(routeAlias)='+_0x42f512[_0xf27b('0x8')]:'No\x20alias\x20set','context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':'CDR(destination)='+(_0x42f512[_0xf27b('0x15')]?_0xf27b('0x16')+_0x42f512[_0xf27b('0x15')]+'}':_0xf27b('0x17')),'context':_0x42f512['context'],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':_0xf27b('0xd')+_0x42f512['id'],'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x216423+0x2)+_0xf27b('0x18')+(_0x216423+0x1)+')','context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':'outbound','app':_0xf27b('0xf'),'appdata':_0x42f512['cutdigits']?_0xf27b('0x19')+_0x42f512[_0xf27b('0x15')]+'}':_0xf27b('0x1a'),'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512['exten'],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x11'),'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512['exten'],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x12'),'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':_0xf27b('0x14'),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x1b')+_0x42f512['id'],'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512[_0xf27b('0x7')],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']}];if(_0x42f512['hasOwnProperty'](_0xf27b('0x1c'))&&_0x42f512[_0xf27b('0x1c')]!==_0xf27b('0x1d')){_0x1350d8[_0xf27b('0xe')]({'type':_0xf27b('0x14'),'app':'Set','appdata':_0xf27b('0x1e'),'context':_0x42f512[_0xf27b('0x6')],'exten':_0x42f512['exten'],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']},{'type':'outbound','app':_0xf27b('0xf'),'appdata':_0xf27b('0x1f')+_0x42f512[_0xf27b('0x1c')]||_0xf27b('0x20'),'context':_0x42f512['context'],'exten':_0x42f512['exten'],'priority':_0x216423++,'VoiceExtensionId':_0x42f512['id']});}return _0x1350d8;}function _0x35f507(_0x35ded7,_0x48f8fc){var _0x4d4ac6=[{'name':_0xf27b('0x21'),'param':0x0},{'name':_0xf27b('0x22'),'param':0x1},{'name':_0xf27b('0x23'),'param':0x2},{'name':_0xf27b('0x24'),'param':0x3}];var _0x3f435a={};var _0x537ca9=_0x48f8fc['split'](',');var _0x3441bd=[];for(var _0x210ae4=0x0;_0x210ae4<_0x4d4ac6[_0xf27b('0x25')];_0x210ae4++){switch(_0x4d4ac6[_0x210ae4][_0xf27b('0x26')]){case'trunk':_0x3f435a[_0xf27b('0x21')]=_0x537ca9[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]][_0xf27b('0x28')]('/')[0x1];_0x3f435a[_0xf27b('0x29')]=_0x537ca9[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]]['split']('/')[0x2];_0x3f435a[_0xf27b('0x2a')]=_0x3f435a[_0xf27b('0x29')]?_0x3f435a[_0xf27b('0x29')][_0xf27b('0x28')]('$')[0x0]:undefined;_0x3f435a[_0xf27b('0x29')]=_0x35ded7[_0xf27b('0x15')]?(_0x3f435a['prefix']||'')+_0xf27b('0x16')+_0x35ded7['cutdigits']+'}':(_0x3f435a[_0xf27b('0x2a')]||'')+_0xf27b('0x17');_0x3441bd[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]]=['SIP',_0x3f435a[_0xf27b('0x21')],_0x3f435a[_0xf27b('0x29')]][_0xf27b('0x2b')]('/');break;case'options':_0x3f435a[_0xf27b('0x23')]=_0x537ca9[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]];if(_0x35ded7[_0xf27b('0x1c')]!==_0xf27b('0x1d')){if(_0x3f435a['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3f435a[_0xf27b('0x23')]+=_0xf27b('0x2c');}}else{_0x3f435a[_0xf27b('0x23')]=_0x3f435a[_0xf27b('0x23')]['replace'](_0xf27b('0x2c'),'');}_0x3441bd[_0x4d4ac6[_0x210ae4]['param']]=_0x3f435a[_0xf27b('0x23')];break;default:_0x3441bd[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]]=_0x537ca9[_0x4d4ac6[_0x210ae4][_0xf27b('0x27')]];}}return _0x3441bd[_0xf27b('0x2b')](',');}function _0x385ca6(_0x2511ee,_0x7cbcb8,_0x43e55c){return new Promise(function(_0x1a1e13,_0x8913e5){var _0x430f9f=[];if(_[_0xf27b('0x2d')](_0x7cbcb8))return _0x1a1e13(_0x430f9f);_0x18005f[_0xf27b('0x2e')][_0xf27b('0x2f')]({'attributes':['id',_0xf27b('0x30'),_0xf27b('0x31')],'raw':!![]})['then'](function(_0x35a382){for(var _0x75cfea=0x0,_0x255d2a=0x0;_0x75cfea<_0x7cbcb8['length'];_0x75cfea++,_0x255d2a=0x0){var _0x27a94f=_0x7cbcb8[_0x75cfea];var _0x2c78b5=[];var _0x14d6d5=[];delete _0x27a94f['id'];if(_0x27a94f[_0xf27b('0x30')]!==_0xf27b('0x32')){_0x27a94f[_0xf27b('0x33')]=[_0x27a94f[_0xf27b('0x30')]];}else{_0x27a94f[_0xf27b('0x33')]=_0x27a94f[_0xf27b('0x31')]?_[_0xf27b('0x34')](_['filter'](_0x35a382,{'IntervalId':_0x27a94f[_0xf27b('0x31')]}),_0xf27b('0x30')):[];}_0x27a94f[_0xf27b('0x6')]=_0x2511ee[_0xf27b('0x6')];_0x27a94f[_0xf27b('0x7')]=_0x2511ee[_0xf27b('0x7')];if(_0x27a94f['type'])_0x27a94f['type']=_0x27a94f[_0xf27b('0x4')][_0xf27b('0x35')]();if(_0x2511ee[_0xf27b('0x4')]===_0xf27b('0x14')){if(_0x27a94f[_0xf27b('0x36')](_0xf27b('0x37'))&&_0x27a94f['tag']&&_0x27a94f[_0xf27b('0x37')]!=='--'){_0x2c78b5['push']({'type':_0x27a94f[_0xf27b('0x4')][_0xf27b('0x35')](),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x38')+_0x27a94f['tag'],'context':_0x2511ee['context'],'exten':_0x2511ee[_0xf27b('0x7')],'priority':_0x27a94f[_0xf27b('0x33')][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});}_0x2c78b5[_0xf27b('0xe')]({'type':_0x27a94f['type']['toLowerCase'](),'app':_0xf27b('0x39'),'appdata':_0xf27b('0x3a')+(_0x27a94f['callerID']?_0xf27b('0x3b')+_0x27a94f[_0xf27b('0x3c')]+')':_0xf27b('0x3d')),'context':_0x2511ee['context'],'exten':_0x2511ee[_0xf27b('0x7')],'priority':_0x27a94f['intervals'][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});}else{if(_0x27a94f['hasOwnProperty'](_0xf27b('0x3e'))){if([_0xf27b('0x3f'),'playback'][_0xf27b('0x40')](_0x27a94f['app']['toLowerCase']())&&_0x27a94f[_0xf27b('0x41')]!==_0xf27b('0x42')){if(_0x27a94f['answer']){_0x2c78b5['push']({'type':_0x27a94f['type'][_0xf27b('0x35')](),'app':_0xf27b('0x39'),'appdata':_0xf27b('0x43'),'context':_0x2511ee[_0xf27b('0x6')],'exten':_0x2511ee[_0xf27b('0x7')],'priority':_0x27a94f[_0xf27b('0x33')][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});_0x2c78b5[_0xf27b('0xe')]({'type':_0x27a94f[_0xf27b('0x4')]['toLowerCase'](),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x44'),'context':_0x2511ee['context'],'exten':_0x2511ee['exten'],'priority':_0x27a94f['intervals'][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});}else{_0x2c78b5['push']({'type':_0x27a94f[_0xf27b('0x4')][_0xf27b('0x35')](),'app':_0xf27b('0x39'),'appdata':_0xf27b('0x45'),'context':_0x2511ee[_0xf27b('0x6')],'exten':_0x2511ee[_0xf27b('0x7')],'priority':_0x27a94f[_0xf27b('0x33')][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});_0x2c78b5['push']({'type':_0x27a94f['type'][_0xf27b('0x35')](),'app':_0xf27b('0xf'),'appdata':_0xf27b('0x46'),'context':_0x2511ee[_0xf27b('0x6')],'exten':_0x2511ee[_0xf27b('0x7')],'priority':_0x27a94f[_0xf27b('0x33')][_0xf27b('0x25')]+_0x43e55c+_0x255d2a++,'VoiceExtensionId':_0x2511ee['id']});}}}}for(var _0x234040=0x0;_0x234040<_0x27a94f[_0xf27b('0x33')]['length'];_0x234040++){var _0x1d8dae=_0x43e55c+_0x27a94f[_0xf27b('0x33')][_0xf27b('0x25')];var _0x575664=_0x234040===_0x27a94f[_0xf27b('0x33')]['length']-0x1?_0x43e55c+_0x2c78b5[_0xf27b('0x25')]+_0x14d6d5[_0xf27b('0x25')]+0x2:_0x43e55c+_0x234040+0x1;_0x2c78b5[_0xf27b('0x47')](_0x234040,0x0,{'type':_0x2511ee['type'],'app':_0xf27b('0x48'),'appdata':_0x27a94f[_0xf27b('0x33')][_0x234040]+'?'+_0x2511ee[_0xf27b('0x6')]+_0xf27b('0x49')+_0x1d8dae+':'+_0x2511ee[_0xf27b('0x6')]+_0xf27b('0x49')+_0x575664,'exten':_0x2511ee[_0xf27b('0x7')],'context':_0x2511ee[_0xf27b('0x6')],'priority':_0x43e55c+_0x234040,'VoiceExtensionId':_0x2511ee['id']});}if(_0x27a94f[_0xf27b('0x41')]===_0xf27b('0x4a'))_0x27a94f[_0xf27b('0x4b')]=_0x35f507(_0x2511ee,_0x27a94f[_0xf27b('0x4b')]);_0x27a94f[_0xf27b('0x4c')]=_0x2c78b5[_0xf27b('0x25')]?_[_0xf27b('0x4d')](_0x2c78b5)[_0xf27b('0x4c')]+0x1:_0x43e55c;_0x430f9f=_[_0xf27b('0x4e')](_0x430f9f,_0x2c78b5,[_0x27a94f],_0x14d6d5);_0x43e55c=_['last'](_0x430f9f)[_0xf27b('0x4c')]+0x1;}return _0x1a1e13(_0x430f9f);})[_0xf27b('0x4f')](function(_0x11d310){_0x8913e5(_0x11d310);});});}return _0x43cecf[_0xf27b('0x50')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5a9035){var _0x1e7be3=this[_0xf27b('0x51')]({'plain':!![]});var _0x194dfc=_0x1e7be3[_0xf27b('0x4')]==='outbound'?_0x5305d9(_0x1e7be3):_0x430f3a(_0x1e7be3);return _0x385ca6(_0x1e7be3,_0x5a9035,_[_0xf27b('0x4d')](_0x194dfc)[_0xf27b('0x4c')]+0x1)[_0xf27b('0x52')](function(_0x140ad2){var _0x45d951=_[_0xf27b('0x4e')](_0x194dfc,_0x140ad2);_0x45d951[_0xf27b('0xe')]({'type':_0x1e7be3[_0xf27b('0x4')],'app':_0xf27b('0x53'),'exten':_0x1e7be3[_0xf27b('0x7')],'context':_0x1e7be3[_0xf27b('0x6')],'priority':_[_0xf27b('0x4d')](_0x45d951)['priority']+0x1,'VoiceExtensionId':_0x1e7be3['id']});return _0x45d951;});}}});}; \ No newline at end of file +var _0x5977=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','prefix','phone','${EXTEN}','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf'];(function(_0x2cd5d7,_0x4662a9){var _0x3ab7f0=function(_0x5c220b){while(--_0x5c220b){_0x2cd5d7['push'](_0x2cd5d7['shift']());}};_0x3ab7f0(++_0x4662a9);}(_0x5977,0xe1));var _0x7597=function(_0x135156,_0x5dbd78){_0x135156=_0x135156-0x0;var _0x20df4e=_0x5977[_0x135156];return _0x20df4e;};'use strict';var _=require(_0x7597('0x0'));var attributes=require(_0x7597('0x1'));module[_0x7597('0x2')]=function(_0xd2e8e4){var _0x5f0d35=_0xd2e8e4[_0x7597('0x3')];function _0x1970b0(_0x38374f){var _0x536908=0x2;var _0x402e4d=[{'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x6')+_0x38374f[_0x7597('0x4')],'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':_0x38374f[_0x7597('0x9')]?_0x7597('0x5'):_0x7597('0xa'),'appdata':_0x38374f['alias']?_0x7597('0xb')+_0x38374f[_0x7597('0x9')]:_0x7597('0xc'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']}];if(_0x38374f[_0x7597('0x4')]===_0x7597('0xd')){_0x402e4d[_0x7597('0xe')]({'type':_0x7597('0xd'),'app':_0x7597('0x5'),'appdata':_0x7597('0xf')+_0x38374f['id'],'context':_0x38374f['context'],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']});}_0x402e4d[_0x7597('0xe')]({'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x10'),'context':_0x38374f['context'],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':'Set','appdata':_0x7597('0x11'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x12'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']});return _0x402e4d;}function _0x5948b8(_0x55b28b){var _0x24be0d=0x2;var _0x5e2857=[{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x14'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':'outbound','app':_0x55b28b[_0x7597('0x9')]?_0x7597('0x5'):_0x7597('0xa'),'appdata':_0x55b28b['alias']?_0x7597('0xb')+_0x55b28b[_0x7597('0x9')]:_0x7597('0xc'),'context':_0x55b28b['context'],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':'CDR(destination)='+(_0x55b28b[_0x7597('0x15')]?_0x7597('0x16')+_0x55b28b['cutdigits']+'}':'${EXTEN}'),'context':_0x55b28b['context'],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0xf')+_0x55b28b['id'],'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x17'),'appdata':_0x7597('0x18')+(_0x24be0d+0x2)+_0x7597('0x19')+(_0x24be0d+0x1)+')','context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x55b28b[_0x7597('0x15')]?_0x7597('0x1a')+_0x55b28b[_0x7597('0x15')]+'}':_0x7597('0x1b'),'context':_0x55b28b['context'],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':_0x7597('0x10'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':_0x7597('0x12'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x1c')+_0x55b28b['id'],'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']}];if(_0x55b28b[_0x7597('0x1d')]('recordingFormat')&&_0x55b28b[_0x7597('0x1e')]!==_0x7597('0x1f')){_0x5e2857[_0x7597('0xe')]({'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x20'),'context':_0x55b28b['context'],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x21')+_0x55b28b[_0x7597('0x1e')]||_0x7597('0x22'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']});}return _0x5e2857;}function _0x15c18c(_0x30ea7c,_0x1603b4){var _0x5cc5c6=[{'name':_0x7597('0x23'),'param':0x0},{'name':_0x7597('0x24'),'param':0x1},{'name':_0x7597('0x25'),'param':0x2},{'name':'url','param':0x3}];var _0x462e56={};var _0x5f2c62=_0x1603b4[_0x7597('0x26')](',');var _0xceba73=[];for(var _0x5bc5de=0x0;_0x5bc5de<_0x5cc5c6[_0x7597('0x27')];_0x5bc5de++){switch(_0x5cc5c6[_0x5bc5de][_0x7597('0x28')]){case _0x7597('0x23'):_0x462e56[_0x7597('0x23')]=_0x5f2c62[_0x5cc5c6[_0x5bc5de]['param']][_0x7597('0x26')]('/')[0x1];_0x462e56['phone']=_0x5f2c62[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]['split']('/')[0x2];_0x462e56[_0x7597('0x2a')]=_0x462e56[_0x7597('0x2b')]?_0x462e56[_0x7597('0x2b')][_0x7597('0x26')]('$')[0x0]:undefined;_0x462e56[_0x7597('0x2b')]=_0x30ea7c[_0x7597('0x15')]?(_0x462e56[_0x7597('0x2a')]||'')+'${EXTEN:'+_0x30ea7c[_0x7597('0x15')]+'}':(_0x462e56['prefix']||'')+_0x7597('0x2c');_0xceba73[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]=[_0x7597('0x2d'),_0x462e56[_0x7597('0x23')],_0x462e56[_0x7597('0x2b')]][_0x7597('0x2e')]('/');break;case _0x7597('0x25'):_0x462e56[_0x7597('0x25')]=_0x5f2c62[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]];if(_0x30ea7c[_0x7597('0x1e')]!==_0x7597('0x1f')){if(_0x462e56['options']['indexOf'](_0x7597('0x2f'))<0x0){_0x462e56[_0x7597('0x25')]+=_0x7597('0x2f');}}else{_0x462e56[_0x7597('0x25')]=_0x462e56[_0x7597('0x25')][_0x7597('0x30')](_0x7597('0x2f'),'');}_0xceba73[_0x5cc5c6[_0x5bc5de]['param']]=_0x462e56[_0x7597('0x25')];break;default:_0xceba73[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]=_0x5f2c62[_0x5cc5c6[_0x5bc5de]['param']];}}return _0xceba73['join'](',');}function _0x1ec74e(_0x31be6f,_0x2b2828,_0x1cb806){return new Promise(function(_0x5a99c7,_0x4f48ac){var _0x5f2fe4=[];if(_[_0x7597('0x31')](_0x2b2828))return _0x5a99c7(_0x5f2fe4);_0x5f0d35[_0x7597('0x32')][_0x7597('0x33')]({'attributes':['id',_0x7597('0x34'),_0x7597('0x35')],'raw':!![]})[_0x7597('0x36')](function(_0x57e48c){for(var _0x3ab9e8=0x0,_0x309c9f=0x0;_0x3ab9e8<_0x2b2828[_0x7597('0x27')];_0x3ab9e8++,_0x309c9f=0x0){var _0x428201=_0x2b2828[_0x3ab9e8];var _0x58c29a=[];var _0x1e40ff=[];delete _0x428201['id'];if(_0x428201['interval']!==_0x7597('0x37')){_0x428201['intervals']=[_0x428201['interval']];}else{_0x428201[_0x7597('0x38')]=_0x428201[_0x7597('0x35')]?_[_0x7597('0x39')](_[_0x7597('0x3a')](_0x57e48c,{'IntervalId':_0x428201['IntervalId']}),'interval'):[];}_0x428201['context']=_0x31be6f[_0x7597('0x7')];_0x428201[_0x7597('0x8')]=_0x31be6f[_0x7597('0x8')];if(_0x428201['type'])_0x428201[_0x7597('0x4')]=_0x428201['type']['toLowerCase']();if(_0x31be6f[_0x7597('0x4')]==='outbound'){if(_0x428201[_0x7597('0x1d')](_0x7597('0x3b'))&&_0x428201[_0x7597('0x3b')]&&_0x428201['tag']!=='--'){_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x5'),'appdata':_0x7597('0x3d')+_0x428201[_0x7597('0x3b')],'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201['intervals']['length']+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':'ExecIf','appdata':_0x7597('0x3e')+(_0x428201[_0x7597('0x3f')]?'Set(CALLERID(all)='+_0x428201[_0x7597('0x3f')]+')':'NoOp(No\x20number\x20available)'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f['exten'],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}else{if(_0x428201[_0x7597('0x1d')](_0x7597('0x40'))){if([_0x7597('0x41'),_0x7597('0x42')]['includes'](_0x428201[_0x7597('0x43')][_0x7597('0x3c')]())&&_0x428201['appType']!==_0x7597('0x44')){if(_0x428201[_0x7597('0x40')]){_0x58c29a['push']({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x17'),'appdata':_0x7597('0x45'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')]['length']+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});_0x58c29a['push']({'type':_0x428201['type'][_0x7597('0x3c')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}else{_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x17'),'appdata':_0x7597('0x46'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f['exten'],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x5'),'appdata':_0x7597('0x47'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}}}}for(var _0x17e0d6=0x0;_0x17e0d6<_0x428201[_0x7597('0x38')][_0x7597('0x27')];_0x17e0d6++){var _0x361ba6=_0x1cb806+_0x428201[_0x7597('0x38')][_0x7597('0x27')];var _0x3d2ec=_0x17e0d6===_0x428201['intervals']['length']-0x1?_0x1cb806+_0x58c29a[_0x7597('0x27')]+_0x1e40ff[_0x7597('0x27')]+0x2:_0x1cb806+_0x17e0d6+0x1;_0x58c29a['splice'](_0x17e0d6,0x0,{'type':_0x31be6f['type'],'app':_0x7597('0x48'),'appdata':_0x428201['intervals'][_0x17e0d6]+'?'+_0x31be6f[_0x7597('0x7')]+_0x7597('0x49')+_0x361ba6+':'+_0x31be6f['context']+_0x7597('0x49')+_0x3d2ec,'exten':_0x31be6f[_0x7597('0x8')],'context':_0x31be6f[_0x7597('0x7')],'priority':_0x1cb806+_0x17e0d6,'VoiceExtensionId':_0x31be6f['id']});}if(_0x428201['appType']==='outboundDial')_0x428201[_0x7597('0x4a')]=_0x15c18c(_0x31be6f,_0x428201['appdata']);_0x428201[_0x7597('0x4b')]=_0x58c29a[_0x7597('0x27')]?_[_0x7597('0x4c')](_0x58c29a)['priority']+0x1:_0x1cb806;_0x5f2fe4=_[_0x7597('0x4d')](_0x5f2fe4,_0x58c29a,[_0x428201],_0x1e40ff);_0x1cb806=_['last'](_0x5f2fe4)[_0x7597('0x4b')]+0x1;}return _0x5a99c7(_0x5f2fe4);})[_0x7597('0x4e')](function(_0x1727bd){_0x4f48ac(_0x1727bd);});});}return _0xd2e8e4[_0x7597('0x4f')](_0x7597('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xb65df0){var _0x4ab615=this[_0x7597('0x51')]({'plain':!![]});var _0x804772=_0x4ab615[_0x7597('0x4')]===_0x7597('0x13')?_0x5948b8(_0x4ab615):_0x1970b0(_0x4ab615);return _0x1ec74e(_0x4ab615,_0xb65df0,_[_0x7597('0x4c')](_0x804772)[_0x7597('0x4b')]+0x1)['then'](function(_0x247153){var _0xd00bd=_[_0x7597('0x4d')](_0x804772,_0x247153);_0xd00bd[_0x7597('0xe')]({'type':_0x4ab615[_0x7597('0x4')],'app':_0x7597('0x52'),'exten':_0x4ab615['exten'],'context':_0x4ab615[_0x7597('0x7')],'priority':_[_0x7597('0x4c')](_0xd00bd)[_0x7597('0x4b')]+0x1,'VoiceExtensionId':_0x4ab615['id']});return _0xd00bd;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index f54c4b9..44f2b4b 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 _0x24ce=['VoiceExtension','findAll','options','where','attributes','limit','include','map','model','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','code','VoiceExtension,\x20%s,\x20%s','error','message','result','catch','GetVoiceExtension'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x24ce,0x1de));var _0xe24c=function(_0x20548e,_0x405e0b){_0x20548e=_0x20548e-0x0;var _0x7de6ba=_0x24ce[_0x20548e];return _0x7de6ba;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var moment=require(_0xe24c('0x1'));var BPromise=require(_0xe24c('0x2'));var rs=require(_0xe24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe24c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe24c('0x5'));var jayson=require(_0xe24c('0x6'));var client=jayson[_0xe24c('0x7')][_0xe24c('0x8')]({'port':0x232a});config[_0xe24c('0x9')]=_['defaults'](config[_0xe24c('0x9')],{'host':_0xe24c('0xa'),'port':0x18eb});var socket=require(_0xe24c('0xb'))(new Redis(config[_0xe24c('0x9')]));require(_0xe24c('0xc'))[_0xe24c('0xd')](socket);function respondWithRpcPromise(_0x3b72f5,_0x3eed6b,_0x4384e7){return new BPromise(function(_0x7b13c,_0x66c829){return client[_0xe24c('0xe')](_0x3b72f5,_0x4384e7)[_0xe24c('0xf')](function(_0x49fc72){logger[_0xe24c('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x3eed6b,_0xe24c('0x11'));logger['debug'](_0xe24c('0x12'),_0x3eed6b,_0xe24c('0x11'),JSON['stringify'](_0x49fc72));if(_0x49fc72['error']){if(_0x49fc72['error'][_0xe24c('0x13')]===0x1f4){logger['error'](_0xe24c('0x14'),_0x3eed6b,_0x49fc72[_0xe24c('0x15')][_0xe24c('0x16')]);return _0x66c829(_0x49fc72[_0xe24c('0x15')]['message']);}logger[_0xe24c('0x15')](_0xe24c('0x14'),_0x3eed6b,_0x49fc72[_0xe24c('0x15')][_0xe24c('0x16')]);return _0x7b13c(_0x49fc72[_0xe24c('0x15')][_0xe24c('0x16')]);}else{logger[_0xe24c('0x10')](_0xe24c('0x14'),_0x3eed6b,_0xe24c('0x11'));_0x7b13c(_0x49fc72[_0xe24c('0x17')][_0xe24c('0x16')]);}})[_0xe24c('0x18')](function(_0x14810d){logger['error'](_0xe24c('0x14'),_0x3eed6b,_0x14810d);_0x66c829(_0x14810d);});});}exports[_0xe24c('0x19')]=function(_0x2b17d2){var _0x58e408=this;return new Promise(function(_0xdbbc78,_0x258d10){return db[_0xe24c('0x1a')][_0xe24c('0x1b')]({'raw':_0x2b17d2[_0xe24c('0x1c')]?_0x2b17d2[_0xe24c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2b17d2['options']?_0x2b17d2['options'][_0xe24c('0x1d')]||null:null,'attributes':_0x2b17d2['options']?_0x2b17d2['options'][_0xe24c('0x1e')]||null:null,'limit':_0x2b17d2[_0xe24c('0x1c')]?_0x2b17d2[_0xe24c('0x1c')][_0xe24c('0x1f')]||null:null,'include':_0x2b17d2[_0xe24c('0x1c')]?_0x2b17d2[_0xe24c('0x1c')][_0xe24c('0x20')]?_[_0xe24c('0x21')](_0x2b17d2[_0xe24c('0x1c')][_0xe24c('0x20')],function(_0x25aeb2){return{'model':db[_0x25aeb2['model']],'as':_0x25aeb2['as'],'attributes':_0x25aeb2[_0xe24c('0x1e')],'include':_0x25aeb2[_0xe24c('0x20')]?_[_0xe24c('0x21')](_0x25aeb2[_0xe24c('0x20')],function(_0x15a59d){return{'model':db[_0x15a59d[_0xe24c('0x22')]],'as':_0x15a59d['as'],'attributes':_0x15a59d[_0xe24c('0x1e')],'include':_0x15a59d[_0xe24c('0x20')]?_[_0xe24c('0x21')](_0x15a59d[_0xe24c('0x20')],function(_0x5c668e){return{'model':db[_0x5c668e[_0xe24c('0x22')]],'as':_0x5c668e['as'],'attributes':_0x5c668e[_0xe24c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x318972){logger[_0xe24c('0x10')]('GetVoiceExtension',_0x2b17d2);logger['debug'](_0xe24c('0x19'),_0x2b17d2,JSON[_0xe24c('0x23')](_0x318972));_0xdbbc78(_0x318972);})[_0xe24c('0x18')](function(_0x4d6e7d){logger[_0xe24c('0x15')]('GetVoiceExtension',_0x4d6e7d['message'],_0x2b17d2);_0x258d10(_0x58e408[_0xe24c('0x15')](0x1f4,_0x4d6e7d[_0xe24c('0x16')]));});});}; \ No newline at end of file +var _0x00cd=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x00cd,0xee));var _0xd00c=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x00cd[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xd00c('0x0'));var util=require(_0xd00c('0x1'));var moment=require(_0xd00c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd00c('0x3'));var db=require(_0xd00c('0x4'))['db'];var utils=require(_0xd00c('0x5'));var logger=require(_0xd00c('0x6'))(_0xd00c('0x7'));var config=require('../../config/environment');var jayson=require(_0xd00c('0x8'));var client=jayson[_0xd00c('0x9')][_0xd00c('0xa')]({'port':0x232a});config[_0xd00c('0xb')]=_[_0xd00c('0xc')](config[_0xd00c('0xb')],{'host':_0xd00c('0xd'),'port':0x18eb});var socket=require(_0xd00c('0xe'))(new Redis(config[_0xd00c('0xb')]));require(_0xd00c('0xf'))['register'](socket);function respondWithRpcPromise(_0x5b6955,_0x462615,_0x267343){return new BPromise(function(_0x3c7e4f,_0x1dee65){return client['request'](_0x5b6955,_0x267343)[_0xd00c('0x10')](function(_0x532556){logger[_0xd00c('0x11')](_0xd00c('0x12'),_0x462615,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x462615,'request\x20sent',JSON[_0xd00c('0x13')](_0x532556));if(_0x532556[_0xd00c('0x14')]){if(_0x532556[_0xd00c('0x14')]['code']===0x1f4){logger[_0xd00c('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x462615,_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);return _0x1dee65(_0x532556[_0xd00c('0x14')]['message']);}logger['error'](_0xd00c('0x12'),_0x462615,_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);return _0x3c7e4f(_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);}else{logger[_0xd00c('0x11')](_0xd00c('0x12'),_0x462615,_0xd00c('0x16'));_0x3c7e4f(_0x532556['result'][_0xd00c('0x15')]);}})[_0xd00c('0x17')](function(_0x110464){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x462615,_0x110464);_0x1dee65(_0x110464);});});}exports[_0xd00c('0x18')]=function(_0x271543){var _0x42b1b9=this;return new Promise(function(_0x29a748,_0xbced81){return db[_0xd00c('0x19')][_0xd00c('0x1a')]({'raw':_0x271543['options']?_0x271543[_0xd00c('0x1b')][_0xd00c('0x1c')]===undefined?!![]:![]:!![],'where':_0x271543[_0xd00c('0x1b')]?_0x271543[_0xd00c('0x1b')][_0xd00c('0x1d')]||null:null,'attributes':_0x271543['options']?_0x271543['options'][_0xd00c('0x1e')]||null:null,'limit':_0x271543[_0xd00c('0x1b')]?_0x271543['options']['limit']||null:null,'include':_0x271543['options']?_0x271543[_0xd00c('0x1b')]['include']?_[_0xd00c('0x1f')](_0x271543['options'][_0xd00c('0x20')],function(_0x276eef){return{'model':db[_0x276eef['model']],'as':_0x276eef['as'],'attributes':_0x276eef['attributes'],'include':_0x276eef[_0xd00c('0x20')]?_[_0xd00c('0x1f')](_0x276eef[_0xd00c('0x20')],function(_0x2f95e4){return{'model':db[_0x2f95e4['model']],'as':_0x2f95e4['as'],'attributes':_0x2f95e4[_0xd00c('0x1e')],'include':_0x2f95e4[_0xd00c('0x20')]?_[_0xd00c('0x1f')](_0x2f95e4[_0xd00c('0x20')],function(_0x4987c5){return{'model':db[_0x4987c5[_0xd00c('0x21')]],'as':_0x4987c5['as'],'attributes':_0x4987c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd00c('0x10')](function(_0x127a0b){logger[_0xd00c('0x11')](_0xd00c('0x18'),_0x271543);logger[_0xd00c('0x22')](_0xd00c('0x18'),_0x271543,JSON[_0xd00c('0x13')](_0x127a0b));_0x29a748(_0x127a0b);})[_0xd00c('0x17')](function(_0x1345dd){logger[_0xd00c('0x14')](_0xd00c('0x18'),_0x1345dd[_0xd00c('0x15')],_0x271543);_0xbced81(_0x42b1b9[_0xd00c('0x14')](0x1f4,_0x1345dd[_0xd00c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index af04ba5..2cb7f8b 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x991775,_0x190be0){var _0x4ea4f7=function(_0x5d47a4){while(--_0x5d47a4){_0x991775['push'](_0x991775['shift']());}};_0x4ea4f7(++_0x190be0);}(_0x7a54,0x106));var _0x47a5=function(_0x5bab8e,_0x4e523f){_0x5bab8e=_0x5bab8e-0x0;var _0x584bb7=_0x7a54[_0x5bab8e];return _0x584bb7;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x814b,0x1a2));var _0xb814=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x814b[_0x149a9b];return _0x2c2bf6;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 19449c6..0e72ad7 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 _0x4c60=['exports','multer','util','path','connect-timeout','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','put','update','destroy'];(function(_0x168718,_0x305fbb){var _0x33dcda=function(_0x3f8274){while(--_0x3f8274){_0x168718['push'](_0x168718['shift']());}};_0x33dcda(++_0x305fbb);}(_0x4c60,0xc1));var _0x04c6=function(_0x5207b0,_0x4aad76){_0x5207b0=_0x5207b0-0x0;var _0x3b20ec=_0x4c60[_0x5207b0];return _0x3b20ec;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['show']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x04c6('0xc')]('/:id',auth[_0x04c6('0x7')](),controller[_0x04c6('0xd')]);router['delete'](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xe')]);module[_0x04c6('0xf')]=router; \ No newline at end of file +var _0xdf55=['/:id/messages','getMessages','create','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x254081,_0x133020){var _0x15e822=function(_0x5835ea){while(--_0x5835ea){_0x254081['push'](_0x254081['shift']());}};_0x15e822(++_0x133020);}(_0xdf55,0x83));var _0x5df5=function(_0x5229bb,_0x4b17f5){_0x5229bb=_0x5229bb-0x0;var _0x15db9b=_0xdf55[_0x5229bb];return _0x15db9b;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5df5('0xf')]);router['put'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller['update']);router['delete'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 9650c0a..a0c538c 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 _0xc30e=['string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize','from-voicemail','contest_mailbox','STRING','email'];(function(_0x124c5b,_0x342d52){var _0x325dc1=function(_0x1a3e55){while(--_0x1a3e55){_0x124c5b['push'](_0x124c5b['shift']());}};_0x325dc1(++_0x342d52);}(_0xc30e,0x17b));var _0xec30=function(_0x52543f,_0x205e87){_0x52543f=_0x52543f-0x0;var _0x2ce929=_0xc30e[_0x52543f];return _0x2ce929;};'use strict';var Sequelize=require(_0xec30('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xec30('0x1'),'unique':_0xec30('0x2')},'mailbox':{'type':Sequelize[_0xec30('0x3')],'defaultValue':'','allowNull':![],'unique':_0xec30('0x2')},'password':{'type':Sequelize[_0xec30('0x3')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xec30('0x3')],'validate':{'isEmail':!![]},'set':function(_0x5778b0){this['setDataValue'](_0xec30('0x4'),typeof _0x5778b0===_0xec30('0x5')&&_0x5778b0[_0xec30('0x6')]()?_0x5778b0[_0xec30('0x6')]():null);}},'pager':{'type':Sequelize[_0xec30('0x3')]},'tz':{'type':Sequelize[_0xec30('0x3')],'defaultValue':_0xec30('0x7')},'attach':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xec30('0x3')]},'callback':{'type':Sequelize[_0xec30('0x3')]},'review':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xec30('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xec30('0x8')](_0xec30('0x9'),'no'),'defaultValue':_0xec30('0x9'),'allowNull':![]},'stamp':{'type':_0xec30('0xa')},'emailsubject':{'type':Sequelize[_0xec30('0x3')]},'emailbody':{'type':Sequelize[_0xec30('0x3')]},'maxsecs':{'type':Sequelize[_0xec30('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xec30('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xec30('0xc')],'get':function(){return this['getDataValue']('fullname')+_0xec30('0xd')+this[_0xec30('0xe')](_0xec30('0xf'));}}}; \ No newline at end of file +var _0x0991=['STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x5a056e,_0x382a98){var _0x5e1dab=function(_0x1059a4){while(--_0x1059a4){_0x5a056e['push'](_0x5a056e['shift']());}};_0x5e1dab(++_0x382a98);}(_0x0991,0x12f));var _0x1099=function(_0x56bb3d,_0xcc1932){_0x56bb3d=_0x56bb3d-0x0;var _0x336a5e=_0x0991[_0x56bb3d];return _0x336a5e;};'use strict';var Sequelize=require(_0x1099('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1099('0x1')],'defaultValue':_0x1099('0x2'),'unique':_0x1099('0x3')},'mailbox':{'type':Sequelize[_0x1099('0x1')],'defaultValue':'','allowNull':![],'unique':_0x1099('0x3')},'password':{'type':Sequelize[_0x1099('0x1')]},'fullname':{'type':Sequelize[_0x1099('0x1')]},'email':{'type':Sequelize[_0x1099('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1e10d3){this['setDataValue'](_0x1099('0x4'),typeof _0x1e10d3==='string'&&_0x1e10d3[_0x1099('0x5')]()?_0x1e10d3[_0x1099('0x5')]():null);}},'pager':{'type':Sequelize[_0x1099('0x1')]},'tz':{'type':Sequelize[_0x1099('0x1')],'defaultValue':_0x1099('0x6')},'attach':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x1099('0x1')]},'review':{'type':Sequelize[_0x1099('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1099('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x1099('0xa')},'emailsubject':{'type':Sequelize[_0x1099('0x1')]},'emailbody':{'type':Sequelize[_0x1099('0x1')]},'maxsecs':{'type':Sequelize[_0x1099('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1099('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x1099('0xc'))+_0x1099('0xd')+this[_0x1099('0xe')](_0x1099('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index e07c555..b0b1602 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 _0x0713=['userProfileId','autoAssociation','getMessages','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceMail','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){var _0x2793ef=_0xb05b1d[_0x3071('0x29')]({'plain':!![]});var _0x7a4cb4=_0x3071('0x2a');return db[_0x3071('0x2b')]['destroy']({'where':{'type':_0x7a4cb4,'resourceId':_0x2793ef['id']}})[_0x3071('0x27')](function(){return _0xb05b1d;});})[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb1ca,_0x28792d){return function(_0x163604){if(!_0x163604){_0x4fb1ca[_0x3071('0x2c')](0x194);}return _0x163604;};}function handleError(_0x3fa3b8,_0x25b96b){_0x25b96b=_0x25b96b||0x1f4;return function(_0x177b5f){logger[_0x3071('0x2d')](_0x177b5f[_0x3071('0x2e')]);if(_0x177b5f[_0x3071('0x2f')]){delete _0x177b5f[_0x3071('0x2f')];}_0x3fa3b8['status'](_0x25b96b)['send'](_0x177b5f);};}exports[_0x3071('0x30')]=function(_0x149e0d,_0x6ddf96){var _0x40be95={},_0x3f6d90={},_0x29538c={'count':0x0,'rows':[]};var _0x32b6b1=_[_0x3071('0x31')](db['VoiceMail']['rawAttributes'],function(_0x4ab983){return{'name':_0x4ab983[_0x3071('0x32')],'type':_0x4ab983[_0x3071('0x33')]['key']};});_0x3f6d90[_0x3071('0x34')]=_[_0x3071('0x31')](_0x32b6b1,_0x3071('0x2f'));_0x3f6d90[_0x3071('0x35')]=_['keys'](_0x149e0d[_0x3071('0x35')]);_0x3f6d90[_0x3071('0x36')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],_0x3f6d90[_0x3071('0x35')]);_0x40be95[_0x3071('0x38')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],qs['fields'](_0x149e0d[_0x3071('0x35')]['fields']));_0x40be95['attributes']=_0x40be95[_0x3071('0x38')][_0x3071('0x39')]?_0x40be95['attributes']:_0x3f6d90[_0x3071('0x34')];if(!_0x149e0d[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x40be95[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x149e0d['query'][_0x3071('0x20')]);_0x40be95[_0x3071('0x1e')]=qs['offset'](_0x149e0d[_0x3071('0x35')]['offset']);}_0x40be95[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x149e0d['query']['sort']);_0x40be95[_0x3071('0x3e')]=qs[_0x3071('0x36')](_[_0x3071('0x3f')](_0x149e0d['query'],_0x3f6d90[_0x3071('0x36')]),_0x32b6b1);if(_0x149e0d['query'][_0x3071('0x40')]){_0x40be95['where']=_[_0x3071('0x41')](_0x40be95[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x32b6b1,function(_0x3113ef){if(_0x3113ef[_0x3071('0x33')]!=='VIRTUAL'){var _0x53ed25={};_0x53ed25[_0x3113ef[_0x3071('0x2f')]]={'$like':'%'+_0x149e0d[_0x3071('0x35')][_0x3071('0x40')]+'%'};return _0x53ed25;}})});}_0x40be95=_[_0x3071('0x41')]({},_0x40be95,_0x149e0d['options']);var _0x3cfc05={'where':_0x40be95[_0x3071('0x3e')]};return db[_0x3071('0x42')][_0x3071('0x21')](_0x3cfc05)[_0x3071('0x27')](function(_0xb9a4b8){_0x29538c['count']=_0xb9a4b8;if(_0x149e0d[_0x3071('0x35')]['includeAll']){_0x40be95['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x40be95);})[_0x3071('0x27')](function(_0x1be8b6){_0x29538c[_0x3071('0x43')]=_0x1be8b6;return _0x29538c;})[_0x3071('0x27')](respondWithFilteredResult(_0x6ddf96,_0x40be95))[_0x3071('0x44')](handleError(_0x6ddf96,null));};exports[_0x3071('0x45')]=function(_0xa711b5,_0x2e6c70){var _0x56589e={'raw':!![],'where':{'id':_0xa711b5[_0x3071('0x46')]['id']}},_0x1e8222={};_0x1e8222[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x42')]['rawAttributes']);_0x1e8222['query']=_[_0x3071('0x47')](_0xa711b5[_0x3071('0x35')]);_0x1e8222[_0x3071('0x36')]=_[_0x3071('0x37')](_0x1e8222[_0x3071('0x34')],_0x1e8222['query']);_0x56589e[_0x3071('0x38')]=_['intersection'](_0x1e8222[_0x3071('0x34')],qs['fields'](_0xa711b5['query'][_0x3071('0x48')]));_0x56589e['attributes']=_0x56589e[_0x3071('0x38')]['length']?_0x56589e[_0x3071('0x38')]:_0x1e8222[_0x3071('0x34')];if(_0xa711b5[_0x3071('0x35')][_0x3071('0x49')]){_0x56589e['include']=[{'all':!![]}];}_0x56589e=_[_0x3071('0x41')]({},_0x56589e,_0xa711b5['options']);return db[_0x3071('0x42')]['find'](_0x56589e)[_0x3071('0x27')](handleEntityNotFound(_0x2e6c70,null))[_0x3071('0x27')](respondWithResult(_0x2e6c70,null))['catch'](handleError(_0x2e6c70,null));};exports[_0x3071('0x4a')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x42')][_0x3071('0x4a')](_0x117e73[_0x3071('0x4b')],{})[_0x3071('0x27')](function(_0x577060){var _0x2c6e4c=_0x117e73[_0x3071('0x4c')][_0x3071('0x29')]({'plain':!![]});if(!_0x2c6e4c)throw new Error(_0x3071('0x4d'));if(_0x2c6e4c['role']===_0x3071('0x4c')){var _0x2aea37=_0x577060[_0x3071('0x29')]({'plain':!![]});var _0x2307dd=_0x3071('0x2a');return db[_0x3071('0x4e')][_0x3071('0x4f')]({'where':{'name':_0x2307dd,'userProfileId':_0x2c6e4c[_0x3071('0x50')]},'raw':!![]})[_0x3071('0x27')](function(_0x886f7){if(_0x886f7&&_0x886f7[_0x3071('0x51')]===0x0){return db[_0x3071('0x2b')][_0x3071('0x4a')]({'name':_0x2aea37[_0x3071('0x2f')],'resourceId':_0x2aea37['id'],'type':_0x886f7[_0x3071('0x2f')],'sectionId':_0x886f7['id']},{})[_0x3071('0x27')](function(){return _0x577060;});}else{return _0x577060;}})['catch'](function(_0x47a438){logger[_0x3071('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a438);throw _0x47a438;});}return _0x577060;})[_0x3071('0x27')](respondWithResult(_0x224a70,0xc9))[_0x3071('0x44')](handleError(_0x224a70,null));};exports[_0x3071('0x26')]=function(_0x514821,_0x1ec428){if(_0x514821[_0x3071('0x4b')]['id']){delete _0x514821['body']['id'];}return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x514821[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1ec428,null))[_0x3071('0x27')](saveUpdates(_0x514821['body'],null))[_0x3071('0x27')](respondWithResult(_0x1ec428,null))[_0x3071('0x44')](handleError(_0x1ec428,null));};exports[_0x3071('0x28')]=function(_0x41f02a,_0x123323){return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x41f02a[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x123323,null))[_0x3071('0x27')](removeEntity(_0x123323,null))[_0x3071('0x44')](handleError(_0x123323,null));};exports[_0x3071('0x52')]=function(_0x71d921,_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x42')]['findOne']({'where':{'id':_0x71d921[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x4bea5d,null))['then'](function(_0x19dc95){var _0x1bf911;var _0x4d3886={},_0x108b14={};_0x108b14[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x53')][_0x3071('0x54')]);_0x108b14['query']=_[_0x3071('0x47')](_0x71d921[_0x3071('0x35')]);_0x108b14[_0x3071('0x36')]=_['intersection'](_0x108b14[_0x3071('0x34')],_0x108b14[_0x3071('0x35')]);_0x4d3886[_0x3071('0x38')]=_[_0x3071('0x37')](_0x108b14[_0x3071('0x34')],qs[_0x3071('0x48')](_0x71d921[_0x3071('0x35')][_0x3071('0x48')]));_0x4d3886[_0x3071('0x38')]=_0x4d3886['attributes'][_0x3071('0x39')]?_0x4d3886[_0x3071('0x38')]:_0x108b14[_0x3071('0x34')];if(!_0x71d921[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x4d3886[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x71d921[_0x3071('0x35')][_0x3071('0x20')]);_0x4d3886[_0x3071('0x1e')]=qs['offset'](_0x71d921[_0x3071('0x35')][_0x3071('0x1e')]);}_0x4d3886[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x71d921[_0x3071('0x35')][_0x3071('0x3d')]);_0x4d3886[_0x3071('0x3e')]=qs[_0x3071('0x36')](_['pick'](_0x71d921[_0x3071('0x35')],_0x108b14[_0x3071('0x36')]));if(_0x71d921['query']['filter']){_0x4d3886[_0x3071('0x3e')]=_[_0x3071('0x41')](_0x4d3886[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x4d3886['attributes'],function(_0x52955a){var _0x33c39a={};_0x33c39a[_0x52955a]={'$like':'%'+_0x71d921['query']['filter']+'%'};return _0x33c39a;})});}_0x4d3886['where']=_['merge'](_0x4d3886[_0x3071('0x3e')],{'mailboxuser':_0x19dc95[_0x3071('0x55')]});_0x4d3886=_[_0x3071('0x41')]({},_0x4d3886,_0x71d921['options']);return db[_0x3071('0x53')][_0x3071('0x56')](_0x4d3886)[_0x3071('0x27')](respondWithFilteredResult(_0x4bea5d,_0x4d3886));})[_0x3071('0x44')](handleError(_0x4bea5d,null));}; \ No newline at end of file +var _0x96cc=['find','userProfileId','UserProfileResource','getMessages','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Voicemails','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0x96cc,0x16c));var _0xc96c=function(_0x625a73,_0x50ae08){_0x625a73=_0x625a73-0x0;var _0x3eceb5=_0x96cc[_0x625a73];return _0x3eceb5;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){var _0x40f23d=_0x10ae21[_0xc96c('0x29')]({'plain':!![]});var _0x1a77df=_0xc96c('0x2a');return db['UserProfileResource'][_0xc96c('0x27')]({'where':{'type':_0x1a77df,'resourceId':_0x40f23d['id']}})[_0xc96c('0x28')](function(){return _0x10ae21;});})[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c00b6,_0x39c191){return function(_0x12c293){if(!_0x12c293){_0x5c00b6[_0xc96c('0x19')](0x194);}return _0x12c293;};}function handleError(_0x1ef845,_0x3c0eb1){_0x3c0eb1=_0x3c0eb1||0x1f4;return function(_0x5e1727){logger[_0xc96c('0x2b')](_0x5e1727[_0xc96c('0x2c')]);if(_0x5e1727[_0xc96c('0x2d')]){delete _0x5e1727[_0xc96c('0x2d')];}_0x1ef845[_0xc96c('0x1a')](_0x3c0eb1)[_0xc96c('0x2e')](_0x5e1727);};}exports[_0xc96c('0x2f')]=function(_0x328ee4,_0x556108){var _0x3aa436={},_0x53c994={},_0x3f4b0e={'count':0x0,'rows':[]};var _0x442c7f=_[_0xc96c('0x30')](db['VoiceMail'][_0xc96c('0x31')],function(_0x3240ba){return{'name':_0x3240ba[_0xc96c('0x32')],'type':_0x3240ba[_0xc96c('0x33')]['key']};});_0x53c994['model']=_[_0xc96c('0x30')](_0x442c7f,_0xc96c('0x2d'));_0x53c994[_0xc96c('0x34')]=_['keys'](_0x328ee4[_0xc96c('0x34')]);_0x53c994[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x53c994[_0xc96c('0x37')],_0x53c994['query']);_0x3aa436[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x53c994['model'],qs[_0xc96c('0x39')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x39')]));_0x3aa436[_0xc96c('0x38')]=_0x3aa436[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x3aa436['attributes']:_0x53c994[_0xc96c('0x37')];if(!_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x3aa436[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x328ee4['query']['limit']);_0x3aa436[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x328ee4['query']['offset']);}_0x3aa436[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3aa436[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x328ee4[_0xc96c('0x34')],_0x53c994[_0xc96c('0x35')]),_0x442c7f);if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x41')]){_0x3aa436['where']=_[_0xc96c('0x42')](_0x3aa436[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x442c7f,function(_0x16b1f1){if(_0x16b1f1['type']!==_0xc96c('0x43')){var _0x3a0848={};_0x3a0848[_0x16b1f1[_0xc96c('0x2d')]]={'$like':'%'+_0x328ee4['query']['filter']+'%'};return _0x3a0848;}})});}_0x3aa436=_[_0xc96c('0x42')]({},_0x3aa436,_0x328ee4[_0xc96c('0x44')]);var _0x2e3bc3={'where':_0x3aa436['where']};return db[_0xc96c('0x45')][_0xc96c('0x20')](_0x2e3bc3)[_0xc96c('0x28')](function(_0x2a8ea7){_0x3f4b0e[_0xc96c('0x20')]=_0x2a8ea7;if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3aa436[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x45')]['findAll'](_0x3aa436);})['then'](function(_0x30b3ac){_0x3f4b0e[_0xc96c('0x48')]=_0x30b3ac;return _0x3f4b0e;})[_0xc96c('0x28')](respondWithFilteredResult(_0x556108,_0x3aa436))[_0xc96c('0x49')](handleError(_0x556108,null));};exports['show']=function(_0x5ee6ac,_0x14b712){var _0x1c18c1={'raw':!![],'where':{'id':_0x5ee6ac[_0xc96c('0x4a')]['id']}},_0x44eb20={};_0x44eb20[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x45')]['rawAttributes']);_0x44eb20[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x5ee6ac[_0xc96c('0x34')]);_0x44eb20[_0xc96c('0x35')]=_['intersection'](_0x44eb20['model'],_0x44eb20[_0xc96c('0x34')]);_0x1c18c1[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x44eb20[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x5ee6ac[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1c18c1[_0xc96c('0x38')]=_0x1c18c1[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1c18c1[_0xc96c('0x38')]:_0x44eb20[_0xc96c('0x37')];if(_0x5ee6ac[_0xc96c('0x34')]['includeAll']){_0x1c18c1[_0xc96c('0x47')]=[{'all':!![]}];}_0x1c18c1=_[_0xc96c('0x42')]({},_0x1c18c1,_0x5ee6ac[_0xc96c('0x44')]);return db[_0xc96c('0x45')]['find'](_0x1c18c1)[_0xc96c('0x28')](handleEntityNotFound(_0x14b712,null))['then'](respondWithResult(_0x14b712,null))[_0xc96c('0x49')](handleError(_0x14b712,null));};exports[_0xc96c('0x4c')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x45')][_0xc96c('0x4c')](_0x565812[_0xc96c('0x4d')],{})[_0xc96c('0x28')](function(_0x1bd694){var _0x57e699=_0x565812['user']['get']({'plain':!![]});if(!_0x57e699)throw new Error(_0xc96c('0x4e'));if(_0x57e699['role']===_0xc96c('0x4f')){var _0x22b2e3=_0x1bd694[_0xc96c('0x29')]({'plain':!![]});var _0x17c764=_0xc96c('0x2a');return db[_0xc96c('0x50')][_0xc96c('0x51')]({'where':{'name':_0x17c764,'userProfileId':_0x57e699[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0xd78e10){if(_0xd78e10&&_0xd78e10['autoAssociation']===0x0){return db[_0xc96c('0x53')][_0xc96c('0x4c')]({'name':_0x22b2e3[_0xc96c('0x2d')],'resourceId':_0x22b2e3['id'],'type':_0xd78e10[_0xc96c('0x2d')],'sectionId':_0xd78e10['id']},{})[_0xc96c('0x28')](function(){return _0x1bd694;});}else{return _0x1bd694;}})[_0xc96c('0x49')](function(_0xad88c3){logger[_0xc96c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad88c3);throw _0xad88c3;});}return _0x1bd694;})['then'](respondWithResult(_0x2581ae,0xc9))['catch'](handleError(_0x2581ae,null));};exports['update']=function(_0x356ef3,_0x46c6fb){if(_0x356ef3[_0xc96c('0x4d')]['id']){delete _0x356ef3[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x45')][_0xc96c('0x51')]({'where':{'id':_0x356ef3[_0xc96c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x28')](saveUpdates(_0x356ef3[_0xc96c('0x4d')],null))[_0xc96c('0x28')](respondWithResult(_0x46c6fb,null))[_0xc96c('0x49')](handleError(_0x46c6fb,null));};exports[_0xc96c('0x27')]=function(_0x1dbea5,_0x3aa216){return db['VoiceMail'][_0xc96c('0x51')]({'where':{'id':_0x1dbea5[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3aa216,null))[_0xc96c('0x28')](removeEntity(_0x3aa216,null))[_0xc96c('0x49')](handleError(_0x3aa216,null));};exports[_0xc96c('0x54')]=function(_0x258f79,_0x34bb98,_0x10b1b8){return db[_0xc96c('0x45')][_0xc96c('0x55')]({'where':{'id':_0x258f79[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x34bb98,null))[_0xc96c('0x28')](function(_0x5a6e3e){var _0xb1629c;var _0x183211={},_0x3d879a={};_0x3d879a[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['VoiceMailMessage'][_0xc96c('0x31')]);_0x3d879a[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x258f79[_0xc96c('0x34')]);_0x3d879a['filters']=_[_0xc96c('0x36')](_0x3d879a[_0xc96c('0x37')],_0x3d879a['query']);_0x183211['attributes']=_['intersection'](_0x3d879a[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x39')]));_0x183211[_0xc96c('0x38')]=_0x183211['attributes']['length']?_0x183211[_0xc96c('0x38')]:_0x3d879a[_0xc96c('0x37')];if(!_0x258f79[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x183211['limit']=qs[_0xc96c('0x1f')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x1f')]);_0x183211[_0xc96c('0x1d')]=qs['offset'](_0x258f79['query'][_0xc96c('0x1d')]);}_0x183211[_0xc96c('0x3d')]=qs['sort'](_0x258f79[_0xc96c('0x34')]['sort']);_0x183211[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x258f79[_0xc96c('0x34')],_0x3d879a[_0xc96c('0x35')]));if(_0x258f79[_0xc96c('0x34')][_0xc96c('0x41')]){_0x183211[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x183211[_0xc96c('0x3f')],{'$or':_['map'](_0x183211[_0xc96c('0x38')],function(_0x5e94fa){var _0xe34ef={};_0xe34ef[_0x5e94fa]={'$like':'%'+_0x258f79[_0xc96c('0x34')]['filter']+'%'};return _0xe34ef;})});}_0x183211[_0xc96c('0x3f')]=_['merge'](_0x183211[_0xc96c('0x3f')],{'mailboxuser':_0x5a6e3e[_0xc96c('0x56')]});_0x183211=_[_0xc96c('0x42')]({},_0x183211,_0x258f79[_0xc96c('0x44')]);return db[_0xc96c('0x57')][_0xc96c('0x58')](_0x183211)[_0xc96c('0x28')](respondWithFilteredResult(_0x34bb98,_0x183211));})[_0xc96c('0x49')](handleError(_0x34bb98,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c1ea546..0df0ed8 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 _0xda1c=['rimraf','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','util','../../config/logger','api','moment','request-promise'];(function(_0x4978dd,_0x12923b){var _0x1e9e7c=function(_0x49fd10){while(--_0x49fd10){_0x4978dd['push'](_0x4978dd['shift']());}};_0x1e9e7c(++_0x12923b);}(_0xda1c,0x14b));var _0xcda1=function(_0x55d05e,_0x3097c3){_0x55d05e=_0x55d05e-0x0;var _0x4babc7=_0xda1c[_0x55d05e];return _0x4babc7;};'use strict';var _=require('lodash');var util=require(_0xcda1('0x0'));var logger=require(_0xcda1('0x1'))(_0xcda1('0x2'));var moment=require(_0xcda1('0x3'));var BPromise=require('bluebird');var rp=require(_0xcda1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcda1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcda1('0x6'));module[_0xcda1('0x7')]=function(_0x167258,_0xfd550b){return _0x167258['define'](_0xcda1('0x8'),attributes,{'tableName':_0xcda1('0x9'),'paranoid':![],'indexes':[{'name':_0xcda1('0xa'),'fields':[_0xcda1('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x88fe=['context','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x3da2cd,_0x59aa26){var _0x160082=function(_0x36e81b){while(--_0x36e81b){_0x3da2cd['push'](_0x3da2cd['shift']());}};_0x160082(++_0x59aa26);}(_0x88fe,0x187));var _0xe88f=function(_0xaec935,_0x5f3d12){_0xaec935=_0xaec935-0x0;var _0x28a8e1=_0x88fe[_0xaec935];return _0x28a8e1;};'use strict';var _=require('lodash');var util=require(_0xe88f('0x0'));var logger=require(_0xe88f('0x1'))(_0xe88f('0x2'));var moment=require(_0xe88f('0x3'));var BPromise=require(_0xe88f('0x4'));var rp=require(_0xe88f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe88f('0x6'));var attributes=require(_0xe88f('0x7'));module[_0xe88f('0x8')]=function(_0x3dd8b6,_0x3a6661){return _0x3dd8b6[_0xe88f('0x9')](_0xe88f('0xa'),attributes,{'tableName':_0xe88f('0xb'),'paranoid':![],'indexes':[{'name':_0xe88f('0xc'),'fields':[_0xe88f('0xd'),_0xe88f('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 0419936..805c89b 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 _0xff3e=['util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result'];(function(_0x29ec91,_0x350764){var _0x5ee460=function(_0x120242){while(--_0x120242){_0x29ec91['push'](_0x29ec91['shift']());}};_0x5ee460(++_0x350764);}(_0xff3e,0x69));var _0xeff3=function(_0x143dd2,_0x49d61d){_0x143dd2=_0x143dd2-0x0;var _0x2c287f=_0xff3e[_0x143dd2];return _0x2c287f;};'use strict';var _=require('lodash');var util=require(_0xeff3('0x0'));var moment=require(_0xeff3('0x1'));var BPromise=require('bluebird');var rs=require(_0xeff3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeff3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeff3('0x4'))(_0xeff3('0x5'));var config=require(_0xeff3('0x6'));var jayson=require(_0xeff3('0x7'));var client=jayson[_0xeff3('0x8')][_0xeff3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x430244,_0x56c252,_0x53b966){return new BPromise(function(_0x2b650c,_0x1f43e6){return client[_0xeff3('0xa')](_0x430244,_0x53b966)[_0xeff3('0xb')](function(_0x21cde9){logger[_0xeff3('0xc')]('VoiceMail,\x20%s,\x20%s',_0x56c252,_0xeff3('0xd'));logger[_0xeff3('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x56c252,_0xeff3('0xd'),JSON[_0xeff3('0xf')](_0x21cde9));if(_0x21cde9[_0xeff3('0x10')]){if(_0x21cde9[_0xeff3('0x10')][_0xeff3('0x11')]===0x1f4){logger[_0xeff3('0x10')](_0xeff3('0x12'),_0x56c252,_0x21cde9['error']['message']);return _0x1f43e6(_0x21cde9[_0xeff3('0x10')][_0xeff3('0x13')]);}logger[_0xeff3('0x10')]('VoiceMail,\x20%s,\x20%s',_0x56c252,_0x21cde9[_0xeff3('0x10')][_0xeff3('0x13')]);return _0x2b650c(_0x21cde9[_0xeff3('0x10')][_0xeff3('0x13')]);}else{logger[_0xeff3('0xc')](_0xeff3('0x12'),_0x56c252,'request\x20sent');_0x2b650c(_0x21cde9[_0xeff3('0x14')][_0xeff3('0x13')]);}})['catch'](function(_0x1871fb){logger[_0xeff3('0x10')]('VoiceMail,\x20%s,\x20%s',_0x56c252,_0x1871fb);_0x1f43e6(_0x1871fb);});});} \ No newline at end of file +var _0xbb03=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x561f4c,_0x1d434d){var _0x3c45f3=function(_0x56e6da){while(--_0x56e6da){_0x561f4c['push'](_0x561f4c['shift']());}};_0x3c45f3(++_0x1d434d);}(_0xbb03,0x96));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3bb0('0x0'));var BPromise=require(_0x3bb0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bb0('0x2'));var db=require(_0x3bb0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3bb0('0x4'));var config=require(_0x3bb0('0x5'));var jayson=require(_0x3bb0('0x6'));var client=jayson[_0x3bb0('0x7')][_0x3bb0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ea0dc,_0x1b9bd0,_0x5b4579){return new BPromise(function(_0x12f12e,_0x147211){return client[_0x3bb0('0x9')](_0x5ea0dc,_0x5b4579)[_0x3bb0('0xa')](function(_0x2f0bdc){logger[_0x3bb0('0xb')]('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x3bb0('0xc'));logger[_0x3bb0('0xd')](_0x3bb0('0xe'),_0x1b9bd0,_0x3bb0('0xc'),JSON[_0x3bb0('0xf')](_0x2f0bdc));if(_0x2f0bdc['error']){if(_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x11')]===0x1f4){logger[_0x3bb0('0x10')]('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x12')]);return _0x147211(_0x2f0bdc[_0x3bb0('0x10')]['message']);}logger[_0x3bb0('0x10')](_0x3bb0('0x13'),_0x1b9bd0,_0x2f0bdc['error'][_0x3bb0('0x12')]);return _0x12f12e(_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x12')]);}else{logger['info'](_0x3bb0('0x13'),_0x1b9bd0,_0x3bb0('0xc'));_0x12f12e(_0x2f0bdc[_0x3bb0('0x14')][_0x3bb0('0x12')]);}})[_0x3bb0('0x15')](function(_0x15040e){logger['error']('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x15040e);_0x147211(_0x15040e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2bec0cf..bd76221 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 _0x9e50=['Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','download','create','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x364fbb,_0x1b6721){var _0x29a2cb=function(_0x4699c3){while(--_0x4699c3){_0x364fbb['push'](_0x364fbb['shift']());}};_0x29a2cb(++_0x1b6721);}(_0x9e50,0x12c));var _0x09e5=function(_0xfb3fce,_0x2014b5){_0xfb3fce=_0xfb3fce-0x0;var _0x473150=_0x9e50[_0xfb3fce];return _0x473150;};'use strict';var multer=require(_0x09e5('0x0'));var util=require('util');var path=require(_0x09e5('0x1'));var timeout=require(_0x09e5('0x2'));var express=require(_0x09e5('0x3'));var router=express[_0x09e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x09e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x09e5('0x6'));var controller=require(_0x09e5('0x7'));router[_0x09e5('0x8')]('/',auth['isAuthenticated'](),controller[_0x09e5('0x9')]);router[_0x09e5('0x8')](_0x09e5('0xa'),auth[_0x09e5('0xb')](),controller[_0x09e5('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x09e5('0xd')]);router['post']('/',auth[_0x09e5('0xb')](),controller[_0x09e5('0xe')]);router['put']('/:id',auth[_0x09e5('0xb')](),controller[_0x09e5('0xf')]);router[_0x09e5('0x10')](_0x09e5('0xa'),auth[_0x09e5('0xb')](),controller[_0x09e5('0x11')]);module[_0x09e5('0x12')]=router; \ No newline at end of file +var _0x6adc=['post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/:id','get','/:id/download','download'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6adc,0x17e));var _0xc6ad=function(_0x3a5541,_0x34dc2e){_0x3a5541=_0x3a5541-0x0;var _0x549d59=_0x6adc[_0x3a5541];return _0x549d59;};'use strict';var multer=require(_0xc6ad('0x0'));var util=require(_0xc6ad('0x1'));var path=require(_0xc6ad('0x2'));var timeout=require(_0xc6ad('0x3'));var express=require(_0xc6ad('0x4'));var router=express[_0xc6ad('0x5')]();var fs_extra=require(_0xc6ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc6ad('0x7'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xc6ad('0x8')](),controller[_0xc6ad('0x9')]);router['get'](_0xc6ad('0xa'),auth[_0xc6ad('0x8')](),controller['show']);router[_0xc6ad('0xb')](_0xc6ad('0xc'),auth[_0xc6ad('0x8')](),controller[_0xc6ad('0xd')]);router[_0xc6ad('0xe')]('/',auth[_0xc6ad('0x8')](),controller[_0xc6ad('0xf')]);router[_0xc6ad('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc6ad('0x11')]);router['delete'](_0xc6ad('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a054e5a..6212909 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 _0x3705=['BLOB','long','TIMESTAMP','literal','sequelize','getDataValue','INTEGER','STRING'];(function(_0x408ce3,_0x22c695){var _0x241f72=function(_0x2e6ce1){while(--_0x2e6ce1){_0x408ce3['push'](_0x408ce3['shift']());}};_0x241f72(++_0x22c695);}(_0x3705,0x74));var _0x5370=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x3705[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x5370('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5816d9){return this[_0x5370('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x5370('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x5370('0x4')](_0x5370('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5370('0x3')],'defaultValue':''},'stamp':{'type':_0x5370('0x6'),'defaultValue':Sequelize[_0x5370('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x0542=['literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x37f68f,_0xc576e5){var _0x5bba69=function(_0x45174e){while(--_0x45174e){_0x37f68f['push'](_0x37f68f['shift']());}};_0x5bba69(++_0xc576e5);}(_0x0542,0x12d));var _0x2054=function(_0x26ae63,_0x321902){_0x26ae63=_0x26ae63-0x0;var _0x318359=_0x0542[_0x26ae63];return _0x318359;};'use strict';var Sequelize=require(_0x2054('0x0'));module[_0x2054('0x1')]={'name':{'type':Sequelize[_0x2054('0x2')],'get':function(_0x1f0c8b){return this[_0x2054('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x2054('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x2054('0x6')](_0x2054('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2054('0x8'),'defaultValue':Sequelize[_0x2054('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a204701..00c7341 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 _0x78b8=['apply','reject','update','sendStatus','error','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','merge','where','VIRTUAL','options','includeAll','findAll','then','rows','params','keys','length','include','find','catch','create','body','destroy','download','recording','ValidationError','audio/wav','attachment','msg_id','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x1e6994,_0x9b99a0){var _0x36d7c0=function(_0x20feff){while(--_0x20feff){_0x1e6994['push'](_0x1e6994['shift']());}};_0x36d7c0(++_0x9b99a0);}(_0x78b8,0x156));var _0x878b=function(_0x5b5add,_0x3a7004){_0x5b5add=_0x5b5add-0x0;var _0x338a4a=_0x78b8[_0x5b5add];return _0x338a4a;};'use strict';var emlformat=require(_0x878b('0x0'));var rimraf=require(_0x878b('0x1'));var zipdir=require(_0x878b('0x2'));var jsonpatch=require(_0x878b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x878b('0x4'));var Mustache=require(_0x878b('0x5'));var util=require('util');var path=require(_0x878b('0x6'));var sox=require(_0x878b('0x7'));var csv=require(_0x878b('0x8'));var ejs=require(_0x878b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x878b('0xa'));var crypto=require(_0x878b('0xb'));var jsforce=require(_0x878b('0xc'));var deskjs=require(_0x878b('0xd'));var toCsv=require(_0x878b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x878b('0xe'));var qs=require(_0x878b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x878b('0x10'));var logger=require(_0x878b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x878b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x878b('0x13'))['db'];function respondWithStatusCode(_0x175d2b,_0x39bf0a){_0x39bf0a=_0x39bf0a||0xcc;return function(_0x58d6b2){if(_0x58d6b2){return _0x175d2b['sendStatus'](_0x39bf0a);}return _0x175d2b[_0x878b('0x14')](_0x39bf0a)[_0x878b('0x15')]();};}function respondWithResult(_0x2aa038,_0x412ec9){_0x412ec9=_0x412ec9||0xc8;return function(_0x1d5786){if(_0x1d5786){return _0x2aa038['status'](_0x412ec9)[_0x878b('0x16')](_0x1d5786);}};}function respondWithFilteredResult(_0x297271,_0x579065){return function(_0x14a2df){if(_0x14a2df){var _0x30cb95=typeof _0x579065[_0x878b('0x17')]===_0x878b('0x18')&&typeof _0x579065[_0x878b('0x19')]===_0x878b('0x18');var _0x551299=_0x14a2df[_0x878b('0x1a')];var _0x2c42a6=_0x30cb95?0x0:_0x579065[_0x878b('0x17')];var _0x596d69=_0x30cb95?_0x14a2df[_0x878b('0x1a')]:_0x579065['offset']+_0x579065['limit'];var _0x382e34;if(_0x596d69>=_0x551299){_0x596d69=_0x551299;_0x382e34=0xc8;}else{_0x382e34=0xce;}_0x297271[_0x878b('0x14')](_0x382e34);return _0x297271[_0x878b('0x1b')]('Content-Range',_0x2c42a6+'-'+_0x596d69+'/'+_0x551299)[_0x878b('0x16')](_0x14a2df);}return null;};}function patchUpdates(_0x2c9157){return function(_0x313004){try{jsonpatch[_0x878b('0x1c')](_0x313004,_0x2c9157,!![]);}catch(_0x3eef78){return BPromise[_0x878b('0x1d')](_0x3eef78);}return _0x313004['save']();};}function saveUpdates(_0x265cd0,_0x2e26cc){return function(_0x12bc72){if(_0x12bc72){return _0x12bc72[_0x878b('0x1e')](_0x265cd0)['then'](function(_0x2ff2f9){return _0x2ff2f9;});}return null;};}function removeEntity(_0x1b7dcb,_0x2c1d7d){return function(_0x598ca0){if(_0x598ca0){return _0x598ca0['destroy']()['then'](function(){_0x1b7dcb[_0x878b('0x14')](0xcc)[_0x878b('0x15')]();});}};}function handleEntityNotFound(_0x71d6f4,_0x55d8b9){return function(_0x4aae8c){if(!_0x4aae8c){_0x71d6f4[_0x878b('0x1f')](0x194);}return _0x4aae8c;};}function handleError(_0x4418da,_0x8cb074){_0x8cb074=_0x8cb074||0x1f4;return function(_0x5ac42e){logger[_0x878b('0x20')](_0x5ac42e['stack']);if(_0x5ac42e[_0x878b('0x21')]){delete _0x5ac42e[_0x878b('0x21')];}_0x4418da[_0x878b('0x14')](_0x8cb074)['send'](_0x5ac42e);};}exports[_0x878b('0x22')]=function(_0x216d14,_0x5e5f5c){var _0x25958f={},_0x3d240b={},_0x4d2c07={'count':0x0,'rows':[]};var _0x2c6c67=_[_0x878b('0x23')](db[_0x878b('0x24')][_0x878b('0x25')],function(_0xe59379){return{'name':_0xe59379['fieldName'],'type':_0xe59379[_0x878b('0x26')][_0x878b('0x27')]};});_0x3d240b[_0x878b('0x28')]=_['differenceBy'](_[_0x878b('0x23')](_0x2c6c67,_0x878b('0x21')),[_0x878b('0x21')]);_0x3d240b[_0x878b('0x29')]=_['keys'](_0x216d14[_0x878b('0x29')]);_0x3d240b[_0x878b('0x2a')]=_[_0x878b('0x2b')](_0x3d240b[_0x878b('0x28')],_0x3d240b['query']);_0x25958f[_0x878b('0x2c')]=_[_0x878b('0x2b')](_0x3d240b[_0x878b('0x28')],qs[_0x878b('0x2d')](_0x216d14[_0x878b('0x29')][_0x878b('0x2d')]));_0x25958f[_0x878b('0x2c')]=_0x25958f[_0x878b('0x2c')]['length']?_0x25958f[_0x878b('0x2c')]:_0x3d240b[_0x878b('0x28')];if(!_0x216d14[_0x878b('0x29')][_0x878b('0x2e')]('nolimit')){_0x25958f[_0x878b('0x19')]=qs[_0x878b('0x19')](_0x216d14[_0x878b('0x29')][_0x878b('0x19')]);_0x25958f[_0x878b('0x17')]=qs[_0x878b('0x17')](_0x216d14['query'][_0x878b('0x17')]);}_0x25958f['order']=qs[_0x878b('0x2f')](_0x216d14[_0x878b('0x29')]['sort']);_0x25958f['where']=qs['filters'](_[_0x878b('0x30')](_0x216d14[_0x878b('0x29')],_0x3d240b[_0x878b('0x2a')]),_0x2c6c67);if(_0x216d14[_0x878b('0x29')]['filter']){_0x25958f['where']=_[_0x878b('0x31')](_0x25958f[_0x878b('0x32')],{'$or':_[_0x878b('0x23')](_0x2c6c67,function(_0x4b08f4){if(_0x4b08f4['type']!==_0x878b('0x33')){var _0x548c66={};_0x548c66[_0x4b08f4[_0x878b('0x21')]]={'$like':'%'+_0x216d14['query']['filter']+'%'};return _0x548c66;}})});}_0x25958f=_[_0x878b('0x31')]({},_0x25958f,_0x216d14[_0x878b('0x34')]);var _0x27e72d={'where':_0x25958f[_0x878b('0x32')]};return db['VoiceMailMessage'][_0x878b('0x1a')](_0x27e72d)['then'](function(_0x324dab){_0x4d2c07[_0x878b('0x1a')]=_0x324dab;if(_0x216d14[_0x878b('0x29')][_0x878b('0x35')]){_0x25958f['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x878b('0x36')](_0x25958f);})[_0x878b('0x37')](function(_0x399e89){_0x4d2c07[_0x878b('0x38')]=_0x399e89;return _0x4d2c07;})['then'](respondWithFilteredResult(_0x5e5f5c,_0x25958f))['catch'](handleError(_0x5e5f5c,null));};exports['show']=function(_0x1ef37b,_0x1b7211){var _0x2f4e0d={'raw':!![],'where':{'id':_0x1ef37b[_0x878b('0x39')]['id']}},_0x517a8f={};_0x517a8f[_0x878b('0x28')]=_['keys'](db[_0x878b('0x24')]['rawAttributes']);_0x517a8f['query']=_[_0x878b('0x3a')](_0x1ef37b[_0x878b('0x29')]);_0x517a8f['filters']=_[_0x878b('0x2b')](_0x517a8f['model'],_0x517a8f[_0x878b('0x29')]);_0x2f4e0d[_0x878b('0x2c')]=_['intersection'](_0x517a8f[_0x878b('0x28')],qs[_0x878b('0x2d')](_0x1ef37b[_0x878b('0x29')][_0x878b('0x2d')]));_0x2f4e0d[_0x878b('0x2c')]=_0x2f4e0d[_0x878b('0x2c')][_0x878b('0x3b')]?_0x2f4e0d[_0x878b('0x2c')]:_0x517a8f[_0x878b('0x28')];if(_0x1ef37b[_0x878b('0x29')]['includeAll']){_0x2f4e0d[_0x878b('0x3c')]=[{'all':!![]}];}_0x2f4e0d=_[_0x878b('0x31')]({},_0x2f4e0d,_0x1ef37b[_0x878b('0x34')]);return db['VoiceMailMessage'][_0x878b('0x3d')](_0x2f4e0d)[_0x878b('0x37')](handleEntityNotFound(_0x1b7211,null))[_0x878b('0x37')](respondWithResult(_0x1b7211,null))[_0x878b('0x3e')](handleError(_0x1b7211,null));};exports[_0x878b('0x3f')]=function(_0x544673,_0xd6127b){return db[_0x878b('0x24')]['create'](_0x544673['body'],{})['then'](respondWithResult(_0xd6127b,0xc9))[_0x878b('0x3e')](handleError(_0xd6127b,null));};exports['update']=function(_0x391c44,_0x45221d){if(_0x391c44[_0x878b('0x40')]['id']){delete _0x391c44[_0x878b('0x40')]['id'];}return db[_0x878b('0x24')]['find']({'where':{'id':_0x391c44[_0x878b('0x39')]['id']}})[_0x878b('0x37')](handleEntityNotFound(_0x45221d,null))[_0x878b('0x37')](saveUpdates(_0x391c44[_0x878b('0x40')],null))[_0x878b('0x37')](respondWithResult(_0x45221d,null))[_0x878b('0x3e')](handleError(_0x45221d,null));};exports[_0x878b('0x41')]=function(_0xe46726,_0x118f86){return db[_0x878b('0x24')]['find']({'where':{'id':_0xe46726[_0x878b('0x39')]['id']}})[_0x878b('0x37')](handleEntityNotFound(_0x118f86,null))[_0x878b('0x37')](removeEntity(_0x118f86,null))[_0x878b('0x3e')](handleError(_0x118f86,null));};exports[_0x878b('0x42')]=function(_0x48333f,_0x3b0139,_0x288de9){return db[_0x878b('0x24')][_0x878b('0x3d')]({'where':{'id':_0x48333f['params']['id']},'attributes':['id',_0x878b('0x43'),'msg_id']})[_0x878b('0x37')](handleEntityNotFound(_0x3b0139,null))['then'](function(_0xc7eaf8){if(_0xc7eaf8){if(!_0xc7eaf8[_0x878b('0x43')]){throw new db['Sequelize'][(_0x878b('0x44'))]('VoiceMailMessage\x20not\x20found');}var _0x39c194={'Content-Type':_0x878b('0x45'),'Content-Disposition':_0x878b('0x46')};if(_0xc7eaf8[_0x878b('0x47')]){_0x39c194['Content-Disposition']='attachment;\x20filename=\x22'+_0xc7eaf8[_0x878b('0x47')]+_0x878b('0x48');}_0x3b0139[_0x878b('0x1b')](_0x39c194);return _0x3b0139[_0x878b('0x49')](new Buffer(_0xc7eaf8['recording']));}})[_0x878b('0x3e')](handleError(_0x3b0139,null));}; \ No newline at end of file +var _0xe122=['mustache','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','VoiceMailMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xe122,0xf3));var _0x2e12=function(_0xe9f60d,_0x7f0501){_0xe9f60d=_0xe9f60d-0x0;var _0x4e91a3=_0xe122[_0xe9f60d];return _0x4e91a3;};'use strict';var emlformat=require(_0x2e12('0x0'));var rimraf=require(_0x2e12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e12('0x2'));var rp=require(_0x2e12('0x3'));var moment=require(_0x2e12('0x4'));var BPromise=require(_0x2e12('0x5'));var Mustache=require(_0x2e12('0x6'));var util=require('util');var path=require(_0x2e12('0x7'));var sox=require(_0x2e12('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e12('0x9'));var _=require(_0x2e12('0xa'));var squel=require(_0x2e12('0xb'));var crypto=require('crypto');var jsforce=require(_0x2e12('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2e12('0xd'));var querystring=require(_0x2e12('0xe'));var Papa=require(_0x2e12('0xf'));var Redis=require(_0x2e12('0x10'));var authService=require(_0x2e12('0x11'));var qs=require(_0x2e12('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e12('0x13'))(_0x2e12('0x14'));var utils=require(_0x2e12('0x15'));var config=require(_0x2e12('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e12('0x17'))['db'];function respondWithStatusCode(_0x967361,_0x2922e2){_0x2922e2=_0x2922e2||0xcc;return function(_0x2a8715){if(_0x2a8715){return _0x967361['sendStatus'](_0x2922e2);}return _0x967361['status'](_0x2922e2)['end']();};}function respondWithResult(_0x457832,_0x11a922){_0x11a922=_0x11a922||0xc8;return function(_0x214d3c){if(_0x214d3c){return _0x457832[_0x2e12('0x18')](_0x11a922)['json'](_0x214d3c);}};}function respondWithFilteredResult(_0x2a1de3,_0x38320b){return function(_0x44ce89){if(_0x44ce89){var _0x1ffb84=typeof _0x38320b[_0x2e12('0x19')]==='undefined'&&typeof _0x38320b[_0x2e12('0x1a')]===_0x2e12('0x1b');var _0xdb324c=_0x44ce89[_0x2e12('0x1c')];var _0x410b15=_0x1ffb84?0x0:_0x38320b[_0x2e12('0x19')];var _0x422c31=_0x1ffb84?_0x44ce89[_0x2e12('0x1c')]:_0x38320b[_0x2e12('0x19')]+_0x38320b[_0x2e12('0x1a')];var _0x3e16f1;if(_0x422c31>=_0xdb324c){_0x422c31=_0xdb324c;_0x3e16f1=0xc8;}else{_0x3e16f1=0xce;}_0x2a1de3['status'](_0x3e16f1);return _0x2a1de3[_0x2e12('0x1d')](_0x2e12('0x1e'),_0x410b15+'-'+_0x422c31+'/'+_0xdb324c)[_0x2e12('0x1f')](_0x44ce89);}return null;};}function patchUpdates(_0x1b7739){return function(_0x5ea598){try{jsonpatch[_0x2e12('0x20')](_0x5ea598,_0x1b7739,!![]);}catch(_0x495d93){return BPromise[_0x2e12('0x21')](_0x495d93);}return _0x5ea598[_0x2e12('0x22')]();};}function saveUpdates(_0x2792a6,_0x399ed4){return function(_0x37c505){if(_0x37c505){return _0x37c505[_0x2e12('0x23')](_0x2792a6)[_0x2e12('0x24')](function(_0xe5b05b){return _0xe5b05b;});}return null;};}function removeEntity(_0x412175,_0x42d60d){return function(_0x26e1c6){if(_0x26e1c6){return _0x26e1c6[_0x2e12('0x25')]()[_0x2e12('0x24')](function(){_0x412175[_0x2e12('0x18')](0xcc)[_0x2e12('0x26')]();});}};}function handleEntityNotFound(_0x5f4431,_0x15c6cc){return function(_0x3a5d36){if(!_0x3a5d36){_0x5f4431[_0x2e12('0x27')](0x194);}return _0x3a5d36;};}function handleError(_0x4edce4,_0x15e5f3){_0x15e5f3=_0x15e5f3||0x1f4;return function(_0x28624d){logger[_0x2e12('0x28')](_0x28624d['stack']);if(_0x28624d[_0x2e12('0x29')]){delete _0x28624d[_0x2e12('0x29')];}_0x4edce4[_0x2e12('0x18')](_0x15e5f3)[_0x2e12('0x2a')](_0x28624d);};}exports['index']=function(_0x1edee6,_0x434992){var _0x16933d={},_0x397bf6={},_0x526041={'count':0x0,'rows':[]};var _0x1db61f=_['map'](db[_0x2e12('0x2b')][_0x2e12('0x2c')],function(_0xdf9a02){return{'name':_0xdf9a02[_0x2e12('0x2d')],'type':_0xdf9a02[_0x2e12('0x2e')]['key']};});_0x397bf6[_0x2e12('0x2f')]=_['differenceBy'](_[_0x2e12('0x30')](_0x1db61f,'name'),['name']);_0x397bf6[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0x1edee6[_0x2e12('0x31')]);_0x397bf6[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x397bf6['model'],_0x397bf6['query']);_0x16933d['attributes']=_['intersection'](_0x397bf6['model'],qs[_0x2e12('0x35')](_0x1edee6[_0x2e12('0x31')][_0x2e12('0x35')]));_0x16933d[_0x2e12('0x36')]=_0x16933d['attributes'][_0x2e12('0x37')]?_0x16933d[_0x2e12('0x36')]:_0x397bf6[_0x2e12('0x2f')];if(!_0x1edee6[_0x2e12('0x31')][_0x2e12('0x38')]('nolimit')){_0x16933d['limit']=qs[_0x2e12('0x1a')](_0x1edee6['query'][_0x2e12('0x1a')]);_0x16933d[_0x2e12('0x19')]=qs[_0x2e12('0x19')](_0x1edee6['query']['offset']);}_0x16933d[_0x2e12('0x39')]=qs[_0x2e12('0x3a')](_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3a')]);_0x16933d[_0x2e12('0x3b')]=qs[_0x2e12('0x33')](_[_0x2e12('0x3c')](_0x1edee6[_0x2e12('0x31')],_0x397bf6[_0x2e12('0x33')]),_0x1db61f);if(_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3d')]){_0x16933d[_0x2e12('0x3b')]=_[_0x2e12('0x3e')](_0x16933d[_0x2e12('0x3b')],{'$or':_['map'](_0x1db61f,function(_0x55b20e){if(_0x55b20e[_0x2e12('0x2e')]!==_0x2e12('0x3f')){var _0x5ce744={};_0x5ce744[_0x55b20e['name']]={'$like':'%'+_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3d')]+'%'};return _0x5ce744;}})});}_0x16933d=_[_0x2e12('0x3e')]({},_0x16933d,_0x1edee6[_0x2e12('0x40')]);var _0x28a798={'where':_0x16933d[_0x2e12('0x3b')]};return db[_0x2e12('0x2b')]['count'](_0x28a798)['then'](function(_0x59d2d5){_0x526041[_0x2e12('0x1c')]=_0x59d2d5;if(_0x1edee6[_0x2e12('0x31')]['includeAll']){_0x16933d[_0x2e12('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2e12('0x42')](_0x16933d);})[_0x2e12('0x24')](function(_0x4c33f0){_0x526041[_0x2e12('0x43')]=_0x4c33f0;return _0x526041;})['then'](respondWithFilteredResult(_0x434992,_0x16933d))['catch'](handleError(_0x434992,null));};exports[_0x2e12('0x44')]=function(_0xccf4f2,_0x2cebeb){var _0x40debf={'raw':!![],'where':{'id':_0xccf4f2[_0x2e12('0x45')]['id']}},_0x147913={};_0x147913[_0x2e12('0x2f')]=_['keys'](db[_0x2e12('0x2b')][_0x2e12('0x2c')]);_0x147913[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0xccf4f2['query']);_0x147913[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x147913[_0x2e12('0x2f')],_0x147913[_0x2e12('0x31')]);_0x40debf['attributes']=_[_0x2e12('0x34')](_0x147913['model'],qs[_0x2e12('0x35')](_0xccf4f2['query'][_0x2e12('0x35')]));_0x40debf[_0x2e12('0x36')]=_0x40debf[_0x2e12('0x36')]['length']?_0x40debf[_0x2e12('0x36')]:_0x147913[_0x2e12('0x2f')];if(_0xccf4f2[_0x2e12('0x31')][_0x2e12('0x46')]){_0x40debf[_0x2e12('0x41')]=[{'all':!![]}];}_0x40debf=_[_0x2e12('0x3e')]({},_0x40debf,_0xccf4f2['options']);return db[_0x2e12('0x2b')]['find'](_0x40debf)[_0x2e12('0x24')](handleEntityNotFound(_0x2cebeb,null))['then'](respondWithResult(_0x2cebeb,null))[_0x2e12('0x47')](handleError(_0x2cebeb,null));};exports[_0x2e12('0x48')]=function(_0x39f4e5,_0x32ce12){return db[_0x2e12('0x2b')]['create'](_0x39f4e5[_0x2e12('0x49')],{})[_0x2e12('0x24')](respondWithResult(_0x32ce12,0xc9))[_0x2e12('0x47')](handleError(_0x32ce12,null));};exports[_0x2e12('0x23')]=function(_0x29b16b,_0x4ce71d){if(_0x29b16b[_0x2e12('0x49')]['id']){delete _0x29b16b[_0x2e12('0x49')]['id'];}return db['VoiceMailMessage'][_0x2e12('0x4a')]({'where':{'id':_0x29b16b['params']['id']}})[_0x2e12('0x24')](handleEntityNotFound(_0x4ce71d,null))[_0x2e12('0x24')](saveUpdates(_0x29b16b['body'],null))[_0x2e12('0x24')](respondWithResult(_0x4ce71d,null))[_0x2e12('0x47')](handleError(_0x4ce71d,null));};exports['destroy']=function(_0x1b3371,_0x3d14a9){return db[_0x2e12('0x2b')][_0x2e12('0x4a')]({'where':{'id':_0x1b3371[_0x2e12('0x45')]['id']}})[_0x2e12('0x24')](handleEntityNotFound(_0x3d14a9,null))[_0x2e12('0x24')](removeEntity(_0x3d14a9,null))['catch'](handleError(_0x3d14a9,null));};exports[_0x2e12('0x4b')]=function(_0x3c2e2a,_0x3a2eaa,_0x51fb70){return db[_0x2e12('0x2b')][_0x2e12('0x4a')]({'where':{'id':_0x3c2e2a[_0x2e12('0x45')]['id']},'attributes':['id',_0x2e12('0x4c'),_0x2e12('0x4d')]})[_0x2e12('0x24')](handleEntityNotFound(_0x3a2eaa,null))[_0x2e12('0x24')](function(_0x503016){if(_0x503016){if(!_0x503016[_0x2e12('0x4c')]){throw new db['Sequelize'][(_0x2e12('0x4e'))](_0x2e12('0x4f'));}var _0x58f88e={'Content-Type':_0x2e12('0x50'),'Content-Disposition':'attachment'};if(_0x503016[_0x2e12('0x4d')]){_0x58f88e['Content-Disposition']=_0x2e12('0x51')+_0x503016[_0x2e12('0x4d')]+_0x2e12('0x52');}_0x3a2eaa['set'](_0x58f88e);return _0x3a2eaa['send'](new Buffer(_0x503016['recording']));}})[_0x2e12('0x47')](handleError(_0x3a2eaa,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 8ca5014..8ab04f9 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 _0xa40e=['exports','define','VoiceMailMessage','dir','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x1c980c,_0xd2fdeb){var _0x155950=function(_0x4a8433){while(--_0x4a8433){_0x1c980c['push'](_0x1c980c['shift']());}};_0x155950(++_0xd2fdeb);}(_0xa40e,0x1f2));var _0xea40=function(_0xe5bdae,_0x128047){_0xe5bdae=_0xe5bdae-0x0;var _0x2e3c53=_0xa40e[_0xe5bdae];return _0x2e3c53;};'use strict';var _=require(_0xea40('0x0'));var util=require(_0xea40('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xea40('0x2'));var BPromise=require(_0xea40('0x3'));var rp=require(_0xea40('0x4'));var fs=require('fs');var path=require(_0xea40('0x5'));var rimraf=require(_0xea40('0x6'));var config=require(_0xea40('0x7'));var attributes=require(_0xea40('0x8'));module[_0xea40('0x9')]=function(_0x2aa59b,_0xd45897){return _0x2aa59b[_0xea40('0xa')](_0xea40('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xea40('0xc'),'fields':[_0xea40('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0832=['request-promise','path','rimraf','../../config/environment','exports','define','dir','util','api','moment'];(function(_0x162f05,_0x328e0f){var _0x54f59a=function(_0x2cf002){while(--_0x2cf002){_0x162f05['push'](_0x162f05['shift']());}};_0x54f59a(++_0x328e0f);}(_0x0832,0x129));var _0x2083=function(_0x1a4b0b,_0x20698c){_0x1a4b0b=_0x1a4b0b-0x0;var _0xe5b4ae=_0x0832[_0x1a4b0b];return _0xe5b4ae;};'use strict';var _=require('lodash');var util=require(_0x2083('0x0'));var logger=require('../../config/logger')(_0x2083('0x1'));var moment=require(_0x2083('0x2'));var BPromise=require('bluebird');var rp=require(_0x2083('0x3'));var fs=require('fs');var path=require(_0x2083('0x4'));var rimraf=require(_0x2083('0x5'));var config=require(_0x2083('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x2083('0x7')]=function(_0x474946,_0x5771ba){return _0x474946[_0x2083('0x8')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x2083('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 8ea2719..76f84a8 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 _0xc266=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x9597ae,_0x5c3891){var _0x33f44b=function(_0x5d481d){while(--_0x5d481d){_0x9597ae['push'](_0x9597ae['shift']());}};_0x33f44b(++_0x5c3891);}(_0xc266,0xca));var _0x6c26=function(_0x51d18d,_0x7197fe){_0x51d18d=_0x51d18d-0x0;var _0x35dde4=_0xc266[_0x51d18d];return _0x35dde4;};'use strict';var _=require(_0x6c26('0x0'));var util=require(_0x6c26('0x1'));var moment=require(_0x6c26('0x2'));var BPromise=require(_0x6c26('0x3'));var rs=require(_0x6c26('0x4'));var fs=require('fs');var Redis=require(_0x6c26('0x5'));var db=require(_0x6c26('0x6'))['db'];var utils=require(_0x6c26('0x7'));var logger=require(_0x6c26('0x8'))('rpc');var config=require(_0x6c26('0x9'));var jayson=require(_0x6c26('0xa'));var client=jayson[_0x6c26('0xb')][_0x6c26('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41eb33,_0x2aee49,_0x516274){return new BPromise(function(_0x4471ec,_0x40632e){return client[_0x6c26('0xd')](_0x41eb33,_0x516274)['then'](function(_0xb3e9a4){logger[_0x6c26('0xe')](_0x6c26('0xf'),_0x2aee49,'request\x20sent');logger[_0x6c26('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2aee49,'request\x20sent',JSON['stringify'](_0xb3e9a4));if(_0xb3e9a4[_0x6c26('0x11')]){if(_0xb3e9a4[_0x6c26('0x11')][_0x6c26('0x12')]===0x1f4){logger[_0x6c26('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x2aee49,_0xb3e9a4[_0x6c26('0x11')][_0x6c26('0x13')]);return _0x40632e(_0xb3e9a4[_0x6c26('0x11')][_0x6c26('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2aee49,_0xb3e9a4[_0x6c26('0x11')][_0x6c26('0x13')]);return _0x4471ec(_0xb3e9a4[_0x6c26('0x11')]['message']);}else{logger['info'](_0x6c26('0xf'),_0x2aee49,_0x6c26('0x14'));_0x4471ec(_0xb3e9a4[_0x6c26('0x15')][_0x6c26('0x13')]);}})[_0x6c26('0x16')](function(_0x476dc3){logger[_0x6c26('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x2aee49,_0x476dc3);_0x40632e(_0x476dc3);});});} \ No newline at end of file +var _0xf7d8=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','util','moment'];(function(_0x4b3153,_0x51d21d){var _0x1d98b5=function(_0x33c622){while(--_0x33c622){_0x4b3153['push'](_0x4b3153['shift']());}};_0x1d98b5(++_0x51d21d);}(_0xf7d8,0x1c6));var _0x8f7d=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xf7d8[_0x525af9];return _0x129fbf;};'use strict';var _=require('lodash');var util=require(_0x8f7d('0x0'));var moment=require(_0x8f7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f7d('0x3'))['db'];var utils=require(_0x8f7d('0x4'));var logger=require('../../config/logger')(_0x8f7d('0x5'));var config=require(_0x8f7d('0x6'));var jayson=require(_0x8f7d('0x7'));var client=jayson[_0x8f7d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52dd7f,_0x17cc97,_0x42f550){return new BPromise(function(_0x488877,_0x35d48b){return client[_0x8f7d('0x9')](_0x52dd7f,_0x42f550)[_0x8f7d('0xa')](function(_0x56c38c){logger['info'](_0x8f7d('0xb'),_0x17cc97,_0x8f7d('0xc'));logger[_0x8f7d('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x17cc97,'request\x20sent',JSON['stringify'](_0x56c38c));if(_0x56c38c[_0x8f7d('0xe')]){if(_0x56c38c[_0x8f7d('0xe')][_0x8f7d('0xf')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x17cc97,_0x56c38c[_0x8f7d('0xe')]['message']);return _0x35d48b(_0x56c38c['error'][_0x8f7d('0x10')]);}logger[_0x8f7d('0xe')](_0x8f7d('0xb'),_0x17cc97,_0x56c38c[_0x8f7d('0xe')]['message']);return _0x488877(_0x56c38c[_0x8f7d('0xe')][_0x8f7d('0x10')]);}else{logger[_0x8f7d('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x17cc97,_0x8f7d('0xc'));_0x488877(_0x56c38c[_0x8f7d('0x12')][_0x8f7d('0x10')]);}})['catch'](function(_0xfe9256){logger[_0x8f7d('0xe')](_0x8f7d('0xb'),_0x17cc97,_0xfe9256);_0x35d48b(_0xfe9256);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index bff03fd..f26b4d4 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 _0xdc99=['show','getSounds','post','/:id/sounds','/:id','update','delete','destroy','/:id/sounds/:id2','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xdc99,0x82));var _0x9dc9=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xdc99[_0x386525];return _0x14d015;};'use strict';var multer=require(_0x9dc9('0x0'));var util=require('util');var path=require(_0x9dc9('0x1'));var timeout=require(_0x9dc9('0x2'));var express=require(_0x9dc9('0x3'));var router=express[_0x9dc9('0x4')]();var fs_extra=require(_0x9dc9('0x5'));var auth=require(_0x9dc9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9dc9('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x9dc9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x9dc9('0x9')](),controller[_0x9dc9('0xa')]);router[_0x9dc9('0x8')]('/:id/sounds',auth[_0x9dc9('0x9')](),controller[_0x9dc9('0xb')]);router[_0x9dc9('0xc')]('/',auth[_0x9dc9('0x9')](),controller['create']);router[_0x9dc9('0xc')](_0x9dc9('0xd'),auth[_0x9dc9('0x9')](),controller['addSound']);router['put'](_0x9dc9('0xe'),auth[_0x9dc9('0x9')](),controller[_0x9dc9('0xf')]);router[_0x9dc9('0x10')](_0x9dc9('0xe'),auth[_0x9dc9('0x9')](),controller[_0x9dc9('0x11')]);router['delete'](_0x9dc9('0x12'),auth[_0x9dc9('0x9')](),controller['removeSound']);module[_0x9dc9('0x13')]=router; \ No newline at end of file +var _0x54e3=['update','delete','destroy','/:id/sounds/:id2','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','/:id/sounds','getSounds','post','create','put'];(function(_0x44093b,_0xc7f5a7){var _0x46c798=function(_0x3ac7d0){while(--_0x3ac7d0){_0x44093b['push'](_0x44093b['shift']());}};_0x46c798(++_0xc7f5a7);}(_0x54e3,0x180));var _0x354e=function(_0x37ad0c,_0x377664){_0x37ad0c=_0x37ad0c-0x0;var _0x552015=_0x54e3[_0x37ad0c];return _0x552015;};'use strict';var multer=require(_0x354e('0x0'));var util=require(_0x354e('0x1'));var path=require(_0x354e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x354e('0x3'));var auth=require(_0x354e('0x4'));var interaction=require(_0x354e('0x5'));var config=require(_0x354e('0x6'));var controller=require(_0x354e('0x7'));router[_0x354e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x354e('0x8')](_0x354e('0x9'),auth[_0x354e('0xa')](),controller['show']);router['get'](_0x354e('0xb'),auth[_0x354e('0xa')](),controller[_0x354e('0xc')]);router[_0x354e('0xd')]('/',auth[_0x354e('0xa')](),controller[_0x354e('0xe')]);router[_0x354e('0xd')]('/:id/sounds',auth[_0x354e('0xa')](),controller['addSound']);router[_0x354e('0xf')](_0x354e('0x9'),auth[_0x354e('0xa')](),controller[_0x354e('0x10')]);router[_0x354e('0x11')](_0x354e('0x9'),auth['isAuthenticated'](),controller[_0x354e('0x12')]);router['delete'](_0x354e('0x13'),auth[_0x354e('0xa')](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 37d9cce..da4d0c4 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 _0x9f0a=['BOOLEAN','exports','STRING','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0xa3f123,_0x46db29){var _0x29e45f=function(_0x3d0856){while(--_0x3d0856){_0xa3f123['push'](_0xa3f123['shift']());}};_0x29e45f(++_0x46db29);}(_0x9f0a,0x9b));var _0xa9f0=function(_0x3f6753,_0x456998){_0x3f6753=_0x3f6753-0x0;var _0x3ad092=_0x9f0a[_0x3f6753];return _0x3ad092;};'use strict';var Sequelize=require('sequelize');module[_0xa9f0('0x0')]={'name':{'type':Sequelize[_0xa9f0('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa9f0('0x2')](_0xa9f0('0x3'),_0xa9f0('0x4'),'mp3nb',_0xa9f0('0x5'),_0xa9f0('0x6'),_0xa9f0('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa9f0('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa9f0('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa9f0('0x1')],'allowNull':!![],'defaultValue':_0xa9f0('0x8')},'format':{'type':Sequelize[_0xa9f0('0x1')],'allowNull':!![]},'stamp':{'type':_0xa9f0('0x9')},'defaultEntry':{'type':Sequelize[_0xa9f0('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a87=['name','ENUM','custom','files','quietmp3','mp3','alpha','exports','STRING'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x6a87,0x7c));var _0x76a8=function(_0x40f945,_0xd1d5){_0x40f945=_0x40f945-0x0;var _0x41f33a=_0x6a87[_0x40f945];return _0x41f33a;};'use strict';var Sequelize=require('sequelize');module[_0x76a8('0x0')]={'name':{'type':Sequelize[_0x76a8('0x1')],'allowNull':![],'unique':_0x76a8('0x2')},'mode':{'type':Sequelize[_0x76a8('0x3')](_0x76a8('0x4'),_0x76a8('0x5'),'mp3nb','quietmp3nb',_0x76a8('0x6'),_0x76a8('0x7')),'allowNull':!![],'defaultValue':_0x76a8('0x5')},'directory':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![],'defaultValue':_0x76a8('0x8')},'format':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 4e3e0a0..298749f 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 _0x5cc9=['options','includeAll','catch','show','length','find','update','body','create','sequelize','directory','join','root','server/files/moh','mode','files','mkdirSync','0777','user','get','UserProfileSection','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','transaction','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','getSounds','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','end','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type'];(function(_0x4944f1,_0x482a52){var _0x433494=function(_0x40d7f3){while(--_0x40d7f3){_0x4944f1['push'](_0x4944f1['shift']());}};_0x433494(++_0x482a52);}(_0x5cc9,0x118));var _0x95cc=function(_0x43fd7f,_0x4781f5){_0x43fd7f=_0x43fd7f-0x0;var _0x2e0fa1=_0x5cc9[_0x43fd7f];return _0x2e0fa1;};'use strict';var emlformat=require(_0x95cc('0x0'));var rimraf=require(_0x95cc('0x1'));var zipdir=require(_0x95cc('0x2'));var jsonpatch=require(_0x95cc('0x3'));var rp=require(_0x95cc('0x4'));var moment=require(_0x95cc('0x5'));var BPromise=require(_0x95cc('0x6'));var Mustache=require(_0x95cc('0x7'));var util=require(_0x95cc('0x8'));var path=require(_0x95cc('0x9'));var sox=require(_0x95cc('0xa'));var csv=require(_0x95cc('0xb'));var ejs=require(_0x95cc('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95cc('0xd'));var squel=require(_0x95cc('0xe'));var crypto=require(_0x95cc('0xf'));var jsforce=require(_0x95cc('0x10'));var deskjs=require(_0x95cc('0x11'));var toCsv=require('to-csv');var querystring=require(_0x95cc('0x12'));var Papa=require(_0x95cc('0x13'));var Redis=require(_0x95cc('0x14'));var authService=require(_0x95cc('0x15'));var qs=require(_0x95cc('0x16'));var as=require(_0x95cc('0x17'));var hardwareService=require(_0x95cc('0x18'));var logger=require(_0x95cc('0x19'))('api');var utils=require(_0x95cc('0x1a'));var config=require(_0x95cc('0x1b'));var licenseUtil=require(_0x95cc('0x1c'));var db=require(_0x95cc('0x1d'))['db'];function respondWithStatusCode(_0x2712a0,_0x46d36a){_0x46d36a=_0x46d36a||0xcc;return function(_0x461a09){if(_0x461a09){return _0x2712a0[_0x95cc('0x1e')](_0x46d36a);}return _0x2712a0[_0x95cc('0x1f')](_0x46d36a)['end']();};}function respondWithResult(_0x5d13,_0x1ced51){_0x1ced51=_0x1ced51||0xc8;return function(_0x1989b6){if(_0x1989b6){return _0x5d13[_0x95cc('0x1f')](_0x1ced51)[_0x95cc('0x20')](_0x1989b6);}};}function respondWithFilteredResult(_0xb2a9a9,_0x1d52e0){return function(_0x534863){if(_0x534863){var _0x3662ef=typeof _0x1d52e0[_0x95cc('0x21')]===_0x95cc('0x22')&&typeof _0x1d52e0[_0x95cc('0x23')]==='undefined';var _0x5c7133=_0x534863[_0x95cc('0x24')];var _0x334186=_0x3662ef?0x0:_0x1d52e0[_0x95cc('0x21')];var _0x20b7e0=_0x3662ef?_0x534863[_0x95cc('0x24')]:_0x1d52e0[_0x95cc('0x21')]+_0x1d52e0[_0x95cc('0x23')];var _0x2955f4;if(_0x20b7e0>=_0x5c7133){_0x20b7e0=_0x5c7133;_0x2955f4=0xc8;}else{_0x2955f4=0xce;}_0xb2a9a9[_0x95cc('0x1f')](_0x2955f4);return _0xb2a9a9[_0x95cc('0x25')](_0x95cc('0x26'),_0x334186+'-'+_0x20b7e0+'/'+_0x5c7133)[_0x95cc('0x20')](_0x534863);}return null;};}function patchUpdates(_0x5c9021){return function(_0x3843f3){try{jsonpatch['apply'](_0x3843f3,_0x5c9021,!![]);}catch(_0x1cdc66){return BPromise[_0x95cc('0x27')](_0x1cdc66);}return _0x3843f3[_0x95cc('0x28')]();};}function saveUpdates(_0x44defa,_0x1f13e9){return function(_0x50008c){if(_0x50008c){return _0x50008c['update'](_0x44defa)[_0x95cc('0x29')](function(_0x20c7f0){return _0x20c7f0;});}return null;};}function removeEntity(_0x2e7f65,_0x1839f1){return function(_0x3997ab){if(_0x3997ab){return _0x3997ab[_0x95cc('0x2a')]()[_0x95cc('0x29')](function(){var _0x26024e=_0x3997ab['get']({'plain':!![]});var _0x41e8b0='MusicOnHolds';return db[_0x95cc('0x2b')][_0x95cc('0x2a')]({'where':{'type':_0x41e8b0,'resourceId':_0x26024e['id']}})[_0x95cc('0x29')](function(){return _0x3997ab;});})[_0x95cc('0x29')](function(){_0x2e7f65[_0x95cc('0x1f')](0xcc)[_0x95cc('0x2c')]();});}};}function handleEntityNotFound(_0x497c70,_0x24fadd){return function(_0x2d744d){if(!_0x2d744d){_0x497c70[_0x95cc('0x1e')](0x194);}return _0x2d744d;};}function handleError(_0x40e877,_0x227bf1){_0x227bf1=_0x227bf1||0x1f4;return function(_0x3c46a5){logger[_0x95cc('0x2d')](_0x3c46a5[_0x95cc('0x2e')]);if(_0x3c46a5[_0x95cc('0x2f')]){delete _0x3c46a5['name'];}_0x40e877[_0x95cc('0x1f')](_0x227bf1)[_0x95cc('0x30')](_0x3c46a5);};}exports[_0x95cc('0x31')]=function(_0x50c905,_0x4227ff){var _0x3dbc6c={},_0x1b197e={},_0x17ea7e={'count':0x0,'rows':[]};var _0x2a0488=_['map'](db[_0x95cc('0x32')][_0x95cc('0x33')],function(_0x361f46){return{'name':_0x361f46['fieldName'],'type':_0x361f46['type'][_0x95cc('0x34')]};});_0x1b197e[_0x95cc('0x35')]=_[_0x95cc('0x36')](_0x2a0488,_0x95cc('0x2f'));_0x1b197e[_0x95cc('0x37')]=_[_0x95cc('0x38')](_0x50c905[_0x95cc('0x37')]);_0x1b197e[_0x95cc('0x39')]=_[_0x95cc('0x3a')](_0x1b197e[_0x95cc('0x35')],_0x1b197e[_0x95cc('0x37')]);_0x3dbc6c[_0x95cc('0x3b')]=_[_0x95cc('0x3a')](_0x1b197e['model'],qs[_0x95cc('0x3c')](_0x50c905[_0x95cc('0x37')]['fields']));_0x3dbc6c['attributes']=_0x3dbc6c[_0x95cc('0x3b')]['length']?_0x3dbc6c[_0x95cc('0x3b')]:_0x1b197e[_0x95cc('0x35')];if(!_0x50c905[_0x95cc('0x37')][_0x95cc('0x3d')](_0x95cc('0x3e'))){_0x3dbc6c[_0x95cc('0x23')]=qs[_0x95cc('0x23')](_0x50c905[_0x95cc('0x37')][_0x95cc('0x23')]);_0x3dbc6c['offset']=qs['offset'](_0x50c905['query'][_0x95cc('0x21')]);}_0x3dbc6c[_0x95cc('0x3f')]=qs[_0x95cc('0x40')](_0x50c905['query']['sort']);delete _0x50c905[_0x95cc('0x37')]['sort'];_0x3dbc6c[_0x95cc('0x41')]=qs[_0x95cc('0x39')](_['pick'](_0x50c905[_0x95cc('0x37')],_0x1b197e[_0x95cc('0x39')]),_0x2a0488);if(_0x50c905[_0x95cc('0x37')]['filter']){_0x3dbc6c['where']=_[_0x95cc('0x42')](_0x3dbc6c[_0x95cc('0x41')],{'$or':_[_0x95cc('0x36')](_0x2a0488,function(_0x5a297a){if(_0x5a297a[_0x95cc('0x43')]!=='VIRTUAL'){var _0x5996a5={};_0x5996a5[_0x5a297a[_0x95cc('0x2f')]]={'$like':'%'+_0x50c905[_0x95cc('0x37')]['filter']+'%'};return _0x5996a5;}})});}_0x3dbc6c=_[_0x95cc('0x42')]({},_0x3dbc6c,_0x50c905[_0x95cc('0x44')]);var _0x2b7ebe={'where':_0x3dbc6c[_0x95cc('0x41')]};return db[_0x95cc('0x32')][_0x95cc('0x24')](_0x2b7ebe)[_0x95cc('0x29')](function(_0x460d6c){_0x17ea7e[_0x95cc('0x24')]=_0x460d6c;if(_0x50c905['query'][_0x95cc('0x45')]){_0x3dbc6c['include']=[{'all':!![]}];}return db[_0x95cc('0x32')]['findAll'](_0x3dbc6c);})['then'](function(_0x14a525){_0x17ea7e['rows']=_0x14a525;return _0x17ea7e;})[_0x95cc('0x29')](respondWithFilteredResult(_0x4227ff,_0x3dbc6c))[_0x95cc('0x46')](handleError(_0x4227ff,null));};exports[_0x95cc('0x47')]=function(_0x522cc5,_0x2a90c2){var _0x3007d0={'raw':![],'where':{'id':_0x522cc5['params']['id']}},_0x3be6ef={};_0x3be6ef[_0x95cc('0x35')]=_[_0x95cc('0x38')](db[_0x95cc('0x32')][_0x95cc('0x33')]);_0x3be6ef[_0x95cc('0x37')]=_['keys'](_0x522cc5['query']);_0x3be6ef[_0x95cc('0x39')]=_[_0x95cc('0x3a')](_0x3be6ef[_0x95cc('0x35')],_0x3be6ef[_0x95cc('0x37')]);_0x3007d0['attributes']=_[_0x95cc('0x3a')](_0x3be6ef['model'],qs[_0x95cc('0x3c')](_0x522cc5[_0x95cc('0x37')]['fields']));_0x3007d0[_0x95cc('0x3b')]=_0x3007d0[_0x95cc('0x3b')][_0x95cc('0x48')]?_0x3007d0['attributes']:_0x3be6ef['model'];if(_0x522cc5[_0x95cc('0x37')]['includeAll']){_0x3007d0['include']=[{'all':!![]}];}_0x3007d0=_['merge']({},_0x3007d0,_0x522cc5[_0x95cc('0x44')]);return db[_0x95cc('0x32')][_0x95cc('0x49')](_0x3007d0)['then'](handleEntityNotFound(_0x2a90c2,null))['then'](respondWithResult(_0x2a90c2,null))[_0x95cc('0x46')](handleError(_0x2a90c2,null));};exports[_0x95cc('0x4a')]=function(_0x56fe34,_0x3764e3){if(_0x56fe34[_0x95cc('0x4b')]['id']){delete _0x56fe34['body']['id'];}return db[_0x95cc('0x32')][_0x95cc('0x49')]({'where':{'id':_0x56fe34['params']['id']}})[_0x95cc('0x29')](handleEntityNotFound(_0x3764e3,null))[_0x95cc('0x29')](saveUpdates(_0x56fe34[_0x95cc('0x4b')],null))[_0x95cc('0x29')](respondWithResult(_0x3764e3,null))[_0x95cc('0x46')](handleError(_0x3764e3,null));};exports[_0x95cc('0x4c')]=function(_0x400cdd,_0x58fa0d,_0x28367a){return db[_0x95cc('0x4d')]['transaction'](function(_0x444fff){if(_0x400cdd[_0x95cc('0x4b')]['mode']==='files'){_0x400cdd[_0x95cc('0x4b')][_0x95cc('0x4e')]=path[_0x95cc('0x4f')](config[_0x95cc('0x50')],_0x95cc('0x51'),_0x400cdd[_0x95cc('0x4b')][_0x95cc('0x2f')]);}return db[_0x95cc('0x32')][_0x95cc('0x4c')](_0x400cdd[_0x95cc('0x4b')],{'transaction':_0x444fff})[_0x95cc('0x29')](function(_0x5b41e5){if(_0x400cdd[_0x95cc('0x4b')][_0x95cc('0x52')]===_0x95cc('0x53')){fs[_0x95cc('0x54')](_0x5b41e5[_0x95cc('0x4e')],parseInt(_0x95cc('0x55'),0x8));}var _0xbb4859=_0x400cdd[_0x95cc('0x56')][_0x95cc('0x57')]({'plain':!![]});if(!_0xbb4859)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbb4859['role']===_0x95cc('0x56')){var _0x119605=_0x5b41e5[_0x95cc('0x57')]({'plain':!![]});return db[_0x95cc('0x58')][_0x95cc('0x49')]({'where':{'name':_0x95cc('0x59'),'userProfileId':_0xbb4859[_0x95cc('0x5a')]},'raw':!![]})[_0x95cc('0x29')](function(_0x2d67c2){if(_0x2d67c2&&_0x2d67c2['autoAssociation']===0x0){return db[_0x95cc('0x2b')][_0x95cc('0x4c')]({'name':_0x119605[_0x95cc('0x2f')],'resourceId':_0x119605['id'],'type':_0x2d67c2[_0x95cc('0x2f')],'sectionId':_0x2d67c2['id']},{})[_0x95cc('0x29')](function(){return _0x5b41e5;});}else{return _0x5b41e5;}})[_0x95cc('0x46')](function(_0x5133f9){logger[_0x95cc('0x2d')](_0x95cc('0x5b'),_0x5133f9);});}return _0x5b41e5;});})[_0x95cc('0x29')](respondWithResult(_0x58fa0d,0xc9))[_0x95cc('0x46')](handleError(_0x58fa0d,null));};exports[_0x95cc('0x2a')]=function(_0x4e6b0d,_0x5d3831,_0x566663){var _0x3948f6;return db[_0x95cc('0x32')][_0x95cc('0x49')]({'where':{'id':_0x4e6b0d[_0x95cc('0x5c')]['id']}})[_0x95cc('0x29')](function(_0x1a1e8c){if(_0x1a1e8c){return db['sequelize'][_0x95cc('0x5d')](function(_0x41db1a){return _0x1a1e8c[_0x95cc('0x2a')]({'transaction':_0x41db1a,'raw':!![]})[_0x95cc('0x29')](function(_0x5485e6){if(_0x5485e6[_0x95cc('0x4e')]){fs[_0x95cc('0x5e')](_0x5485e6[_0x95cc('0x4e')])[_0x95cc('0x5f')](function(_0x3bfa22){fs[_0x95cc('0x60')](path[_0x95cc('0x4f')](_0x5485e6[_0x95cc('0x4e')],_0x3bfa22));});fs[_0x95cc('0x61')](_0x5485e6[_0x95cc('0x4e')]);}return _0x5485e6;});})[_0x95cc('0x46')](function(_0x35cd21){throw new db['Sequelize'][(_0x95cc('0x62'))](_0x35cd21[_0x95cc('0x63')]);});}})[_0x95cc('0x29')](handleEntityNotFound(_0x5d3831,null))[_0x95cc('0x29')](removeEntity(_0x5d3831,null))[_0x95cc('0x46')](handleError(_0x5d3831,null));};exports[_0x95cc('0x64')]=function(_0x2d7c6c,_0xa029f4,_0x1e3edd){return db['sequelize'][_0x95cc('0x5d')](function(_0x296539){var _0x3189a7;return db[_0x95cc('0x32')][_0x95cc('0x49')]({'where':{'id':_0x2d7c6c[_0x95cc('0x5c')]['id']}})[_0x95cc('0x29')](function(_0x1721d0){if(_0x1721d0){_0x3189a7=_0x1721d0;return _0x1721d0[_0x95cc('0x64')](_0x2d7c6c[_0x95cc('0x4b')]['id'],{'transaction':_0x296539});}})[_0x95cc('0x29')](function(_0x8039b9){if(_0x8039b9){return db[_0x95cc('0x65')][_0x95cc('0x66')]({'where':{'id':_0x2d7c6c[_0x95cc('0x4b')]['id']},'attributes':['id',_0x95cc('0x2f'),_0x95cc('0x67'),'converted_format',_0x95cc('0x68')],'raw':!![]});}})[_0x95cc('0x29')](function(_0x483437){if(_0x483437){var _0x896f97=path[_0x95cc('0x4f')](config[_0x95cc('0x50')],_0x95cc('0x69'),util['format'](_0x95cc('0x6a'),path[_0x95cc('0x6b')](_0x483437['save_name'],path[_0x95cc('0x6c')](_0x483437[_0x95cc('0x67')])),_0x483437[_0x95cc('0x6d')]));var _0x5dd947=path[_0x95cc('0x4f')](config[_0x95cc('0x50')],_0x95cc('0x51'),_0x3189a7[_0x95cc('0x2f')],util['format'](_0x95cc('0x6a'),_0x483437[_0x95cc('0x2f')],_0x483437['converted_format']));fs[_0x95cc('0x6e')](_0x896f97,_0x5dd947);return _0x483437;}})[_0x95cc('0x46')](function(_0x53bd54){throw new db['Sequelize'][(_0x95cc('0x62'))](_0x53bd54[_0x95cc('0x63')]);});})['then'](handleEntityNotFound(_0xa029f4,null))[_0x95cc('0x29')](respondWithResult(_0xa029f4,0xc9))[_0x95cc('0x46')](handleError(_0xa029f4,null));};exports[_0x95cc('0x6f')]=function(_0x28bc4a,_0x1dd9a6,_0x1f04e0){return db[_0x95cc('0x4d')][_0x95cc('0x5d')](function(_0x37e385){var _0x2eb049;return db[_0x95cc('0x32')][_0x95cc('0x66')]({'where':{'id':_0x28bc4a[_0x95cc('0x5c')]['id']}})[_0x95cc('0x29')](handleEntityNotFound(_0x1dd9a6,null))['then'](function(_0x568b6f){if(_0x568b6f){_0x2eb049=_0x568b6f;return _0x568b6f[_0x95cc('0x6f')](_0x28bc4a[_0x95cc('0x5c')][_0x95cc('0x70')]);}})['then'](function(_0x22398b){if(_0x22398b){return db['Sound'][_0x95cc('0x66')]({'where':{'id':_0x28bc4a[_0x95cc('0x5c')][_0x95cc('0x70')]},'attributes':['id',_0x95cc('0x2f'),_0x95cc('0x67'),_0x95cc('0x6d'),_0x95cc('0x68')],'raw':!![]});}})[_0x95cc('0x29')](function(_0xe5b414){if(_0xe5b414){fs[_0x95cc('0x60')](path[_0x95cc('0x4f')](_0x2eb049[_0x95cc('0x4e')],util['format'](_0x95cc('0x6a'),_0xe5b414[_0x95cc('0x2f')],_0xe5b414[_0x95cc('0x6d')])));return _0xe5b414;}})['catch'](function(_0x20d9f3){throw new db['Sequelize']['ValidationError'](_0x20d9f3[_0x95cc('0x63')]);});})[_0x95cc('0x29')](handleEntityNotFound(_0x1dd9a6,null))['then'](respondWithStatusCode(_0x1dd9a6,0xcc))['catch'](handleError(_0x1dd9a6,null));};exports[_0x95cc('0x71')]=function(_0x170514,_0x981629,_0xbe5fa8){var _0x137834={};var _0x4a93e8={};var _0x49127b;var _0x481b05;return db['VoiceMusicOnHold'][_0x95cc('0x66')]({'where':{'id':_0x170514[_0x95cc('0x5c')]['id']}})[_0x95cc('0x29')](handleEntityNotFound(_0x981629,null))[_0x95cc('0x29')](function(_0x283f40){if(_0x283f40){_0x49127b=_0x283f40;_0x4a93e8[_0x95cc('0x35')]=_['keys'](db[_0x95cc('0x65')][_0x95cc('0x33')]);_0x4a93e8[_0x95cc('0x37')]=_[_0x95cc('0x38')](_0x170514[_0x95cc('0x37')]);_0x4a93e8[_0x95cc('0x39')]=_[_0x95cc('0x3a')](_0x4a93e8[_0x95cc('0x35')],_0x4a93e8[_0x95cc('0x37')]);_0x137834[_0x95cc('0x3b')]=_['intersection'](_0x4a93e8[_0x95cc('0x35')],qs[_0x95cc('0x3c')](_0x170514[_0x95cc('0x37')]['fields']));_0x137834[_0x95cc('0x3b')]=_0x137834[_0x95cc('0x3b')][_0x95cc('0x48')]?_0x137834[_0x95cc('0x3b')]:_0x4a93e8[_0x95cc('0x35')];_0x137834[_0x95cc('0x3f')]=qs[_0x95cc('0x40')](_0x170514[_0x95cc('0x37')][_0x95cc('0x40')]);_0x137834[_0x95cc('0x41')]=qs['filters'](_[_0x95cc('0x72')](_0x170514[_0x95cc('0x37')],_0x4a93e8[_0x95cc('0x39')]));if(_0x170514[_0x95cc('0x37')][_0x95cc('0x73')]){_0x137834[_0x95cc('0x41')]=_[_0x95cc('0x42')](_0x137834[_0x95cc('0x41')],{'$or':_[_0x95cc('0x36')](_0x137834[_0x95cc('0x3b')],function(_0x5354e7){var _0x1a7b1f={};_0x1a7b1f[_0x5354e7]={'$like':'%'+_0x170514[_0x95cc('0x37')]['filter']+'%'};return _0x1a7b1f;})});}_0x137834=_[_0x95cc('0x42')]({},_0x137834,_0x170514[_0x95cc('0x44')]);return _0x49127b[_0x95cc('0x71')](_0x137834);}})[_0x95cc('0x29')](function(_0xcc5fc3){if(_0xcc5fc3){_0x481b05=_0xcc5fc3[_0x95cc('0x48')];if(!_0x170514[_0x95cc('0x37')]['hasOwnProperty'](_0x95cc('0x3e'))){_0x137834[_0x95cc('0x23')]=qs[_0x95cc('0x23')](_0x170514[_0x95cc('0x37')][_0x95cc('0x23')]);_0x137834[_0x95cc('0x21')]=qs[_0x95cc('0x21')](_0x170514[_0x95cc('0x37')][_0x95cc('0x21')]);}return _0x49127b[_0x95cc('0x71')](_0x137834);}})[_0x95cc('0x29')](function(_0x40894f){if(_0x40894f){return _0x40894f?{'count':_0x481b05,'rows':_0x40894f}:null;}})[_0x95cc('0x29')](respondWithResult(_0x981629,null))[_0x95cc('0x46')](handleError(_0x981629,null));}; \ No newline at end of file +var _0xd7c1=['Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','error','stack','name','index','VoiceMusicOnHold','rawAttributes','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','fields','body','find','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','removeSound','id2','message','getSounds','length','order','nolimit','rimraf','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x38c82d,_0x430408){var _0x2d7429=function(_0x288d8c){while(--_0x288d8c){_0x38c82d['push'](_0x38c82d['shift']());}};_0x2d7429(++_0x430408);}(_0xd7c1,0x1f4));var _0x1d7c=function(_0x4db8d3,_0x2a2f70){_0x4db8d3=_0x4db8d3-0x0;var _0x24a266=_0xd7c1[_0x4db8d3];return _0x24a266;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d7c('0x0'));var zipdir=require(_0x1d7c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d7c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1d7c('0x3'));var util=require('util');var path=require(_0x1d7c('0x4'));var sox=require(_0x1d7c('0x5'));var csv=require(_0x1d7c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d7c('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d7c('0x8'));var Redis=require(_0x1d7c('0x9'));var authService=require(_0x1d7c('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x1d7c('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d7c('0xc'));var utils=require(_0x1d7c('0xd'));var config=require(_0x1d7c('0xe'));var licenseUtil=require(_0x1d7c('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17eed6,_0x28ed0b){_0x28ed0b=_0x28ed0b||0xcc;return function(_0x405685){if(_0x405685){return _0x17eed6[_0x1d7c('0x10')](_0x28ed0b);}return _0x17eed6[_0x1d7c('0x11')](_0x28ed0b)[_0x1d7c('0x12')]();};}function respondWithResult(_0xffc54c,_0x3989a2){_0x3989a2=_0x3989a2||0xc8;return function(_0x1b8b15){if(_0x1b8b15){return _0xffc54c[_0x1d7c('0x11')](_0x3989a2)[_0x1d7c('0x13')](_0x1b8b15);}};}function respondWithFilteredResult(_0x12745d,_0x121cf0){return function(_0xf88bcf){if(_0xf88bcf){var _0x424aae=typeof _0x121cf0[_0x1d7c('0x14')]==='undefined'&&typeof _0x121cf0[_0x1d7c('0x15')]===_0x1d7c('0x16');var _0x3c08ff=_0xf88bcf['count'];var _0x2e8d6e=_0x424aae?0x0:_0x121cf0[_0x1d7c('0x14')];var _0x40e763=_0x424aae?_0xf88bcf[_0x1d7c('0x17')]:_0x121cf0[_0x1d7c('0x14')]+_0x121cf0[_0x1d7c('0x15')];var _0xbb1151;if(_0x40e763>=_0x3c08ff){_0x40e763=_0x3c08ff;_0xbb1151=0xc8;}else{_0xbb1151=0xce;}_0x12745d[_0x1d7c('0x11')](_0xbb1151);return _0x12745d[_0x1d7c('0x18')](_0x1d7c('0x19'),_0x2e8d6e+'-'+_0x40e763+'/'+_0x3c08ff)['json'](_0xf88bcf);}return null;};}function patchUpdates(_0x257dca){return function(_0x3cf2d7){try{jsonpatch[_0x1d7c('0x1a')](_0x3cf2d7,_0x257dca,!![]);}catch(_0x5334e5){return BPromise['reject'](_0x5334e5);}return _0x3cf2d7[_0x1d7c('0x1b')]();};}function saveUpdates(_0x5e6a20,_0x1c71f6){return function(_0x38ac9b){if(_0x38ac9b){return _0x38ac9b[_0x1d7c('0x1c')](_0x5e6a20)[_0x1d7c('0x1d')](function(_0x35c2c1){return _0x35c2c1;});}return null;};}function removeEntity(_0x2ddb4f,_0x1879ae){return function(_0x2b9296){if(_0x2b9296){return _0x2b9296[_0x1d7c('0x1e')]()[_0x1d7c('0x1d')](function(){var _0x3f5af9=_0x2b9296[_0x1d7c('0x1f')]({'plain':!![]});var _0x187322=_0x1d7c('0x20');return db['UserProfileResource'][_0x1d7c('0x1e')]({'where':{'type':_0x187322,'resourceId':_0x3f5af9['id']}})[_0x1d7c('0x1d')](function(){return _0x2b9296;});})[_0x1d7c('0x1d')](function(){_0x2ddb4f[_0x1d7c('0x11')](0xcc)[_0x1d7c('0x12')]();});}};}function handleEntityNotFound(_0x6f9063,_0x40c53){return function(_0x500319){if(!_0x500319){_0x6f9063[_0x1d7c('0x10')](0x194);}return _0x500319;};}function handleError(_0x47fc73,_0x1ad9ce){_0x1ad9ce=_0x1ad9ce||0x1f4;return function(_0x2a887d){logger[_0x1d7c('0x21')](_0x2a887d[_0x1d7c('0x22')]);if(_0x2a887d['name']){delete _0x2a887d[_0x1d7c('0x23')];}_0x47fc73[_0x1d7c('0x11')](_0x1ad9ce)['send'](_0x2a887d);};}exports[_0x1d7c('0x24')]=function(_0x5460e7,_0x1a2de4){var _0x539519={},_0x59c2bf={},_0x558bdb={'count':0x0,'rows':[]};var _0x229e1f=_['map'](db[_0x1d7c('0x25')][_0x1d7c('0x26')],function(_0x449c6e){return{'name':_0x449c6e['fieldName'],'type':_0x449c6e[_0x1d7c('0x27')][_0x1d7c('0x28')]};});_0x59c2bf[_0x1d7c('0x29')]=_[_0x1d7c('0x2a')](_0x229e1f,_0x1d7c('0x23'));_0x59c2bf[_0x1d7c('0x2b')]=_['keys'](_0x5460e7[_0x1d7c('0x2b')]);_0x59c2bf[_0x1d7c('0x2c')]=_[_0x1d7c('0x2d')](_0x59c2bf[_0x1d7c('0x29')],_0x59c2bf[_0x1d7c('0x2b')]);_0x539519[_0x1d7c('0x2e')]=_['intersection'](_0x59c2bf[_0x1d7c('0x29')],qs['fields'](_0x5460e7[_0x1d7c('0x2b')]['fields']));_0x539519[_0x1d7c('0x2e')]=_0x539519[_0x1d7c('0x2e')]['length']?_0x539519['attributes']:_0x59c2bf[_0x1d7c('0x29')];if(!_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x2f')]('nolimit')){_0x539519[_0x1d7c('0x15')]=qs[_0x1d7c('0x15')](_0x5460e7[_0x1d7c('0x2b')]['limit']);_0x539519[_0x1d7c('0x14')]=qs[_0x1d7c('0x14')](_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x14')]);}_0x539519['order']=qs[_0x1d7c('0x30')](_0x5460e7['query'][_0x1d7c('0x30')]);delete _0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x30')];_0x539519[_0x1d7c('0x31')]=qs[_0x1d7c('0x2c')](_[_0x1d7c('0x32')](_0x5460e7['query'],_0x59c2bf[_0x1d7c('0x2c')]),_0x229e1f);if(_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x33')]){_0x539519['where']=_[_0x1d7c('0x34')](_0x539519[_0x1d7c('0x31')],{'$or':_[_0x1d7c('0x2a')](_0x229e1f,function(_0x2d8487){if(_0x2d8487[_0x1d7c('0x27')]!=='VIRTUAL'){var _0x3b8a03={};_0x3b8a03[_0x2d8487['name']]={'$like':'%'+_0x5460e7['query'][_0x1d7c('0x33')]+'%'};return _0x3b8a03;}})});}_0x539519=_['merge']({},_0x539519,_0x5460e7[_0x1d7c('0x35')]);var _0x396507={'where':_0x539519[_0x1d7c('0x31')]};return db[_0x1d7c('0x25')][_0x1d7c('0x17')](_0x396507)['then'](function(_0xbf8166){_0x558bdb['count']=_0xbf8166;if(_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x36')]){_0x539519[_0x1d7c('0x37')]=[{'all':!![]}];}return db[_0x1d7c('0x25')][_0x1d7c('0x38')](_0x539519);})[_0x1d7c('0x1d')](function(_0x32219c){_0x558bdb[_0x1d7c('0x39')]=_0x32219c;return _0x558bdb;})[_0x1d7c('0x1d')](respondWithFilteredResult(_0x1a2de4,_0x539519))[_0x1d7c('0x3a')](handleError(_0x1a2de4,null));};exports['show']=function(_0x314859,_0x42978f){var _0xbd9bb1={'raw':![],'where':{'id':_0x314859[_0x1d7c('0x3b')]['id']}},_0x5846df={};_0x5846df[_0x1d7c('0x29')]=_[_0x1d7c('0x3c')](db['VoiceMusicOnHold'][_0x1d7c('0x26')]);_0x5846df['query']=_[_0x1d7c('0x3c')](_0x314859[_0x1d7c('0x2b')]);_0x5846df[_0x1d7c('0x2c')]=_[_0x1d7c('0x2d')](_0x5846df[_0x1d7c('0x29')],_0x5846df['query']);_0xbd9bb1[_0x1d7c('0x2e')]=_[_0x1d7c('0x2d')](_0x5846df[_0x1d7c('0x29')],qs['fields'](_0x314859[_0x1d7c('0x2b')][_0x1d7c('0x3d')]));_0xbd9bb1[_0x1d7c('0x2e')]=_0xbd9bb1[_0x1d7c('0x2e')]['length']?_0xbd9bb1[_0x1d7c('0x2e')]:_0x5846df[_0x1d7c('0x29')];if(_0x314859['query']['includeAll']){_0xbd9bb1[_0x1d7c('0x37')]=[{'all':!![]}];}_0xbd9bb1=_[_0x1d7c('0x34')]({},_0xbd9bb1,_0x314859[_0x1d7c('0x35')]);return db[_0x1d7c('0x25')]['find'](_0xbd9bb1)[_0x1d7c('0x1d')](handleEntityNotFound(_0x42978f,null))[_0x1d7c('0x1d')](respondWithResult(_0x42978f,null))[_0x1d7c('0x3a')](handleError(_0x42978f,null));};exports[_0x1d7c('0x1c')]=function(_0x5f0f5e,_0x2195b8){if(_0x5f0f5e[_0x1d7c('0x3e')]['id']){delete _0x5f0f5e[_0x1d7c('0x3e')]['id'];}return db[_0x1d7c('0x25')][_0x1d7c('0x3f')]({'where':{'id':_0x5f0f5e[_0x1d7c('0x3b')]['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x2195b8,null))[_0x1d7c('0x1d')](saveUpdates(_0x5f0f5e[_0x1d7c('0x3e')],null))['then'](respondWithResult(_0x2195b8,null))[_0x1d7c('0x3a')](handleError(_0x2195b8,null));};exports[_0x1d7c('0x40')]=function(_0xfa894c,_0x563569,_0x9d54b6){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x1af449){if(_0xfa894c[_0x1d7c('0x3e')][_0x1d7c('0x43')]===_0x1d7c('0x44')){_0xfa894c['body'][_0x1d7c('0x45')]=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x48'),_0xfa894c[_0x1d7c('0x3e')][_0x1d7c('0x23')]);}return db[_0x1d7c('0x25')][_0x1d7c('0x40')](_0xfa894c[_0x1d7c('0x3e')],{'transaction':_0x1af449})['then'](function(_0x236248){if(_0xfa894c[_0x1d7c('0x3e')]['mode']===_0x1d7c('0x44')){fs[_0x1d7c('0x49')](_0x236248[_0x1d7c('0x45')],parseInt('0777',0x8));}var _0x1421e9=_0xfa894c[_0x1d7c('0x4a')][_0x1d7c('0x1f')]({'plain':!![]});if(!_0x1421e9)throw new Error(_0x1d7c('0x4b'));if(_0x1421e9[_0x1d7c('0x4c')]===_0x1d7c('0x4a')){var _0x1f4d5c=_0x236248[_0x1d7c('0x1f')]({'plain':!![]});return db[_0x1d7c('0x4d')][_0x1d7c('0x3f')]({'where':{'name':_0x1d7c('0x20'),'userProfileId':_0x1421e9['userProfileId']},'raw':!![]})['then'](function(_0x4d5509){if(_0x4d5509&&_0x4d5509[_0x1d7c('0x4e')]===0x0){return db[_0x1d7c('0x4f')][_0x1d7c('0x40')]({'name':_0x1f4d5c[_0x1d7c('0x23')],'resourceId':_0x1f4d5c['id'],'type':_0x4d5509[_0x1d7c('0x23')],'sectionId':_0x4d5509['id']},{})[_0x1d7c('0x1d')](function(){return _0x236248;});}else{return _0x236248;}})[_0x1d7c('0x3a')](function(_0x5a7b20){logger['error'](_0x1d7c('0x50'),_0x5a7b20);});}return _0x236248;});})[_0x1d7c('0x1d')](respondWithResult(_0x563569,0xc9))[_0x1d7c('0x3a')](handleError(_0x563569,null));};exports[_0x1d7c('0x1e')]=function(_0x2b2fad,_0x3f86d3,_0x15bae2){var _0x23593e;return db[_0x1d7c('0x25')]['find']({'where':{'id':_0x2b2fad[_0x1d7c('0x3b')]['id']}})['then'](function(_0x310802){if(_0x310802){return db[_0x1d7c('0x41')]['transaction'](function(_0x2e18a2){return _0x310802[_0x1d7c('0x1e')]({'transaction':_0x2e18a2,'raw':!![]})[_0x1d7c('0x1d')](function(_0x482935){if(_0x482935[_0x1d7c('0x45')]){fs[_0x1d7c('0x51')](_0x482935[_0x1d7c('0x45')])[_0x1d7c('0x52')](function(_0x3c3559){fs[_0x1d7c('0x53')](path[_0x1d7c('0x46')](_0x482935[_0x1d7c('0x45')],_0x3c3559));});fs['rmdirSync'](_0x482935[_0x1d7c('0x45')]);}return _0x482935;});})['catch'](function(_0x39cf29){throw new db[(_0x1d7c('0x54'))]['ValidationError'](_0x39cf29['message']);});}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x3f86d3,null))[_0x1d7c('0x1d')](removeEntity(_0x3f86d3,null))[_0x1d7c('0x3a')](handleError(_0x3f86d3,null));};exports[_0x1d7c('0x55')]=function(_0x5afa82,_0xaf7217,_0x353ec4){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x185de0){var _0x1e7d61;return db['VoiceMusicOnHold'][_0x1d7c('0x3f')]({'where':{'id':_0x5afa82[_0x1d7c('0x3b')]['id']}})['then'](function(_0x1996a5){if(_0x1996a5){_0x1e7d61=_0x1996a5;return _0x1996a5[_0x1d7c('0x55')](_0x5afa82['body']['id'],{'transaction':_0x185de0});}})[_0x1d7c('0x1d')](function(_0x408aa9){if(_0x408aa9){return db[_0x1d7c('0x56')][_0x1d7c('0x57')]({'where':{'id':_0x5afa82['body']['id']},'attributes':['id',_0x1d7c('0x23'),_0x1d7c('0x58'),'converted_format',_0x1d7c('0x59')],'raw':!![]});}})[_0x1d7c('0x1d')](function(_0x4b1d88){if(_0x4b1d88){var _0x4ac48f=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x5a'),util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),path[_0x1d7c('0x5d')](_0x4b1d88[_0x1d7c('0x58')],path[_0x1d7c('0x5e')](_0x4b1d88['save_name'])),_0x4b1d88[_0x1d7c('0x5f')]));var _0x5787d1=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x48'),_0x1e7d61[_0x1d7c('0x23')],util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),_0x4b1d88[_0x1d7c('0x23')],_0x4b1d88[_0x1d7c('0x5f')]));fs[_0x1d7c('0x60')](_0x4ac48f,_0x5787d1);return _0x4b1d88;}})[_0x1d7c('0x3a')](function(_0x141f6b){throw new db[(_0x1d7c('0x54'))][(_0x1d7c('0x61'))](_0x141f6b['message']);});})['then'](handleEntityNotFound(_0xaf7217,null))[_0x1d7c('0x1d')](respondWithResult(_0xaf7217,0xc9))[_0x1d7c('0x3a')](handleError(_0xaf7217,null));};exports[_0x1d7c('0x62')]=function(_0x2e05ec,_0x5f30b2,_0x3ab8b9){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x2eaaeb){var _0x3650d2;return db[_0x1d7c('0x25')]['findOne']({'where':{'id':_0x2e05ec[_0x1d7c('0x3b')]['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x5f30b2,null))[_0x1d7c('0x1d')](function(_0x1e2bfc){if(_0x1e2bfc){_0x3650d2=_0x1e2bfc;return _0x1e2bfc[_0x1d7c('0x62')](_0x2e05ec[_0x1d7c('0x3b')][_0x1d7c('0x63')]);}})['then'](function(_0x1b4a19){if(_0x1b4a19){return db[_0x1d7c('0x56')][_0x1d7c('0x57')]({'where':{'id':_0x2e05ec[_0x1d7c('0x3b')][_0x1d7c('0x63')]},'attributes':['id',_0x1d7c('0x23'),'save_name',_0x1d7c('0x5f'),_0x1d7c('0x59')],'raw':!![]});}})['then'](function(_0x2d81e5){if(_0x2d81e5){fs[_0x1d7c('0x53')](path[_0x1d7c('0x46')](_0x3650d2[_0x1d7c('0x45')],util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),_0x2d81e5[_0x1d7c('0x23')],_0x2d81e5[_0x1d7c('0x5f')])));return _0x2d81e5;}})[_0x1d7c('0x3a')](function(_0x45b6e0){throw new db['Sequelize'][(_0x1d7c('0x61'))](_0x45b6e0[_0x1d7c('0x64')]);});})[_0x1d7c('0x1d')](handleEntityNotFound(_0x5f30b2,null))['then'](respondWithStatusCode(_0x5f30b2,0xcc))['catch'](handleError(_0x5f30b2,null));};exports[_0x1d7c('0x65')]=function(_0x3a589d,_0x544437,_0x2f8ffe){var _0x434a53={};var _0x4245a3={};var _0x25fa30;var _0x574cce;return db[_0x1d7c('0x25')][_0x1d7c('0x57')]({'where':{'id':_0x3a589d['params']['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x544437,null))[_0x1d7c('0x1d')](function(_0x984d29){if(_0x984d29){_0x25fa30=_0x984d29;_0x4245a3[_0x1d7c('0x29')]=_['keys'](db[_0x1d7c('0x56')][_0x1d7c('0x26')]);_0x4245a3['query']=_[_0x1d7c('0x3c')](_0x3a589d[_0x1d7c('0x2b')]);_0x4245a3['filters']=_[_0x1d7c('0x2d')](_0x4245a3['model'],_0x4245a3[_0x1d7c('0x2b')]);_0x434a53[_0x1d7c('0x2e')]=_[_0x1d7c('0x2d')](_0x4245a3[_0x1d7c('0x29')],qs['fields'](_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x3d')]));_0x434a53['attributes']=_0x434a53[_0x1d7c('0x2e')][_0x1d7c('0x66')]?_0x434a53[_0x1d7c('0x2e')]:_0x4245a3[_0x1d7c('0x29')];_0x434a53[_0x1d7c('0x67')]=qs[_0x1d7c('0x30')](_0x3a589d['query'][_0x1d7c('0x30')]);_0x434a53[_0x1d7c('0x31')]=qs['filters'](_[_0x1d7c('0x32')](_0x3a589d[_0x1d7c('0x2b')],_0x4245a3[_0x1d7c('0x2c')]));if(_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x33')]){_0x434a53['where']=_['merge'](_0x434a53[_0x1d7c('0x31')],{'$or':_[_0x1d7c('0x2a')](_0x434a53[_0x1d7c('0x2e')],function(_0x40e1e0){var _0x4ae5f2={};_0x4ae5f2[_0x40e1e0]={'$like':'%'+_0x3a589d['query'][_0x1d7c('0x33')]+'%'};return _0x4ae5f2;})});}_0x434a53=_['merge']({},_0x434a53,_0x3a589d[_0x1d7c('0x35')]);return _0x25fa30[_0x1d7c('0x65')](_0x434a53);}})[_0x1d7c('0x1d')](function(_0x52f8c5){if(_0x52f8c5){_0x574cce=_0x52f8c5['length'];if(!_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x2f')](_0x1d7c('0x68'))){_0x434a53[_0x1d7c('0x15')]=qs[_0x1d7c('0x15')](_0x3a589d['query'][_0x1d7c('0x15')]);_0x434a53[_0x1d7c('0x14')]=qs[_0x1d7c('0x14')](_0x3a589d['query'][_0x1d7c('0x14')]);}return _0x25fa30['getSounds'](_0x434a53);}})[_0x1d7c('0x1d')](function(_0x4ce19b){if(_0x4ce19b){return _0x4ce19b?{'count':_0x574cce,'rows':_0x4ce19b}:null;}})['then'](respondWithResult(_0x544437,null))[_0x1d7c('0x3a')](handleError(_0x544437,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2dcf499..1a8d8d7 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 _0x259b=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x259b,0x1da));var _0xb259=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x259b[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xb259('0x0'));var util=require(_0xb259('0x1'));var logger=require(_0xb259('0x2'))(_0xb259('0x3'));var moment=require(_0xb259('0x4'));var BPromise=require(_0xb259('0x5'));var rp=require(_0xb259('0x6'));var fs=require('fs');var path=require(_0xb259('0x7'));var rimraf=require(_0xb259('0x8'));var config=require('../../config/environment');var attributes=require(_0xb259('0x9'));module[_0xb259('0xa')]=function(_0x58e384,_0x3cf4b0){return _0x58e384[_0xb259('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0xb259('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26b4=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x394d06,_0x4ed578){var _0x22c2c8=function(_0x5ef2a1){while(--_0x5ef2a1){_0x394d06['push'](_0x394d06['shift']());}};_0x22c2c8(++_0x4ed578);}(_0x26b4,0x174));var _0x426b=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x26b4[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require(_0x426b('0x0'));var logger=require(_0x426b('0x1'))(_0x426b('0x2'));var moment=require(_0x426b('0x3'));var BPromise=require(_0x426b('0x4'));var rp=require(_0x426b('0x5'));var fs=require('fs');var path=require(_0x426b('0x6'));var rimraf=require(_0x426b('0x7'));var config=require(_0x426b('0x8'));var attributes=require(_0x426b('0x9'));module[_0x426b('0xa')]=function(_0x19ab9a,_0x4f2b70){return _0x19ab9a[_0x426b('0xb')](_0x426b('0xc'),attributes,{'tableName':_0x426b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 94cbdf8..338a7dc 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 _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(_0x3369a2,_0x267f09){var _0x1f92e4=function(_0x5f0f78){while(--_0x5f0f78){_0x3369a2['push'](_0x3369a2['shift']());}};_0x1f92e4(++_0x267f09);}(_0xe706,0xa3));var _0x6e70=function(_0x4af42d,_0x226c6d){_0x4af42d=_0x4af42d-0x0;var _0x14b54f=_0xe706[_0x4af42d];return _0x14b54f;};'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 +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x41a6db,_0x2e7370){var _0x392e32=function(_0x5e009c){while(--_0x5e009c){_0x41a6db['push'](_0x41a6db['shift']());}};_0x392e32(++_0x2e7370);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xcb91[_0x3bab09];return _0x164376;};'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')]('VoiceMusicOnHold,\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/voicePrefix/index.js b/server/api/voicePrefix/index.js index cf46d21..fe8455c 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 _0x864a=['addAgents','addTeams','put','update','destroy','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x864a,0x8a));var _0xa864=function(_0x4fd703,_0x333def){_0x4fd703=_0x4fd703-0x0;var _0x26352f=_0x864a[_0x4fd703];return _0x26352f;};'use strict';var multer=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var path=require(_0xa864('0x2'));var timeout=require(_0xa864('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa864('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa864('0x5'));router[_0xa864('0x6')]('/',auth[_0xa864('0x7')](),controller[_0xa864('0x8')]);router[_0xa864('0x6')]('/describe',auth[_0xa864('0x7')](),controller[_0xa864('0x9')]);router['get'](_0xa864('0xa'),auth[_0xa864('0x7')](),controller[_0xa864('0xb')]);router[_0xa864('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xa864('0xc')]);router[_0xa864('0x6')](_0xa864('0xd'),auth[_0xa864('0x7')](),controller[_0xa864('0xe')]);router[_0xa864('0xf')]('/',auth[_0xa864('0x7')](),controller[_0xa864('0x10')]);router[_0xa864('0xf')](_0xa864('0x11'),auth['isAuthenticated'](),controller[_0xa864('0x12')]);router[_0xa864('0xf')]('/:id/teams',auth[_0xa864('0x7')](),controller[_0xa864('0x13')]);router[_0xa864('0x14')](_0xa864('0xa'),auth[_0xa864('0x7')](),controller[_0xa864('0x15')]);router['delete'](_0xa864('0xa'),auth[_0xa864('0x7')](),controller[_0xa864('0x16')]);router[_0xa864('0x17')](_0xa864('0x11'),auth[_0xa864('0x7')](),controller[_0xa864('0x18')]);router[_0xa864('0x17')]('/:id/teams',auth[_0xa864('0x7')](),controller[_0xa864('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6a39=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addTeams','put','update','destroy','delete','removeAgents','removeTeams','multer','util','path','connect-timeout'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6a39,0x140));var _0x96a3=function(_0x50fc19,_0x2685e7){_0x50fc19=_0x50fc19-0x0;var _0x30c392=_0x6a39[_0x50fc19];return _0x30c392;};'use strict';var multer=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var path=require(_0x96a3('0x2'));var timeout=require(_0x96a3('0x3'));var express=require(_0x96a3('0x4'));var router=express[_0x96a3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x96a3('0x6'));var interaction=require(_0x96a3('0x7'));var config=require(_0x96a3('0x8'));var controller=require(_0x96a3('0x9'));router[_0x96a3('0xa')]('/',auth[_0x96a3('0xb')](),controller[_0x96a3('0xc')]);router[_0x96a3('0xa')](_0x96a3('0xd'),auth[_0x96a3('0xb')](),controller['describe']);router[_0x96a3('0xa')](_0x96a3('0xe'),auth[_0x96a3('0xb')](),controller['show']);router[_0x96a3('0xa')](_0x96a3('0xf'),auth[_0x96a3('0xb')](),controller[_0x96a3('0x10')]);router[_0x96a3('0xa')](_0x96a3('0x11'),auth[_0x96a3('0xb')](),controller[_0x96a3('0x12')]);router[_0x96a3('0x13')]('/',auth[_0x96a3('0xb')](),controller['create']);router[_0x96a3('0x13')]('/:id/users',auth[_0x96a3('0xb')](),controller['addAgents']);router[_0x96a3('0x13')]('/:id/teams',auth[_0x96a3('0xb')](),controller[_0x96a3('0x14')]);router[_0x96a3('0x15')]('/:id',auth[_0x96a3('0xb')](),controller[_0x96a3('0x16')]);router['delete']('/:id',auth[_0x96a3('0xb')](),controller[_0x96a3('0x17')]);router[_0x96a3('0x18')](_0x96a3('0xf'),auth['isAuthenticated'](),controller[_0x96a3('0x19')]);router[_0x96a3('0x18')]('/:id/teams',auth[_0x96a3('0xb')](),controller[_0x96a3('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b6bb639..a48bf0f 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 _0x58e6=['sequelize','name','VIRTUAL','getDataValue','STRING','INTEGER'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x58e6,0xde));var _0x658e=function(_0x277acd,_0xd15ad4){_0x277acd=_0x277acd-0x0;var _0x4455eb=_0x58e6[_0x277acd];return _0x4455eb;};'use strict';var Sequelize=require(_0x658e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x658e('0x1')},'prefix':{'type':Sequelize[_0x658e('0x2')],'get':function(_0x230e5d){return'system-'+this[_0x658e('0x3')](_0x658e('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x658e('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x658e('0x5')]}}; \ No newline at end of file +var _0x5db3=['VIRTUAL','system-','getDataValue','STRING','INTEGER','exports','name'];(function(_0x1b83ab,_0x177b36){var _0x152034=function(_0x359c82){while(--_0x359c82){_0x1b83ab['push'](_0x1b83ab['shift']());}};_0x152034(++_0x177b36);}(_0x5db3,0x1a9));var _0x35db=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x5db3[_0x59b439];return _0x521ea3;};'use strict';var Sequelize=require('sequelize');module[_0x35db('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35db('0x1')},'prefix':{'type':Sequelize[_0x35db('0x2')],'get':function(_0x41177e){return _0x35db('0x3')+this[_0x35db('0x4')](_0x35db('0x1'))+'-';}},'description':{'type':Sequelize[_0x35db('0x5')]},'callerIdAll':{'type':Sequelize[_0x35db('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x35db('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index ad0f2c2..a02cffd 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 _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x3540ec,_0x5c676c){var _0x5e2428=function(_0x3f720e){while(--_0x3f720e){_0x3540ec['push'](_0x3540ec['shift']());}};_0x5e2428(++_0x5c676c);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xf3d8c0,_0x1f09cb){_0xf3d8c0=_0xf3d8c0-0x0;var _0x37ee53=_0xdd4f[_0xf3d8c0];return _0x37ee53;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));}; \ No newline at end of file +var _0xe820=['appdata','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','User','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','value','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','name','send','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority'];(function(_0x10b53c,_0xa0c4){var _0x43326f=function(_0xac80b2){while(--_0xac80b2){_0x10b53c['push'](_0x10b53c['shift']());}};_0x43326f(++_0xa0c4);}(_0xe820,0xd2));var _0x0e82=function(_0xe69b7e,_0x7fdc36){_0xe69b7e=_0xe69b7e-0x0;var _0x5e6a0f=_0xe820[_0xe69b7e];return _0x5e6a0f;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];config[_0x0e82('0x18')]=_[_0x0e82('0x19')](config[_0x0e82('0x18')],{'host':_0x0e82('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e82('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x1e4ddb,_0x4b748a){_0x4b748a=_0x4b748a||0xcc;return function(_0x5b4ffd){if(_0x5b4ffd){return _0x1e4ddb['sendStatus'](_0x4b748a);}return _0x1e4ddb[_0x0e82('0x1b')](_0x4b748a)['end']();};}function respondWithResult(_0x585b9b,_0x1149b1){_0x1149b1=_0x1149b1||0xc8;return function(_0x582f45){if(_0x582f45){return _0x585b9b[_0x0e82('0x1b')](_0x1149b1)[_0x0e82('0x1c')](_0x582f45);}};}function respondWithFilteredResult(_0x233c6d,_0x315ce4){return function(_0x53622b){if(_0x53622b){var _0x25ac21=typeof _0x315ce4[_0x0e82('0x1d')]===_0x0e82('0x1e')&&typeof _0x315ce4[_0x0e82('0x1f')]===_0x0e82('0x1e');var _0x1230e6=_0x53622b[_0x0e82('0x20')];var _0x3735c0=_0x25ac21?0x0:_0x315ce4[_0x0e82('0x1d')];var _0x224455=_0x25ac21?_0x53622b[_0x0e82('0x20')]:_0x315ce4['offset']+_0x315ce4['limit'];var _0x294696;if(_0x224455>=_0x1230e6){_0x224455=_0x1230e6;_0x294696=0xc8;}else{_0x294696=0xce;}_0x233c6d[_0x0e82('0x1b')](_0x294696);return _0x233c6d[_0x0e82('0x21')](_0x0e82('0x22'),_0x3735c0+'-'+_0x224455+'/'+_0x1230e6)[_0x0e82('0x1c')](_0x53622b);}return null;};}function patchUpdates(_0x1bdad4){return function(_0x39fcbe){try{jsonpatch[_0x0e82('0x23')](_0x39fcbe,_0x1bdad4,!![]);}catch(_0x56b3ad){return BPromise[_0x0e82('0x24')](_0x56b3ad);}return _0x39fcbe[_0x0e82('0x25')]();};}function saveUpdates(_0x3d6c28,_0x24f883){return function(_0x507f08){if(_0x507f08){return _0x507f08[_0x0e82('0x26')](_0x3d6c28)[_0x0e82('0x27')](function(_0x7a9399){return _0x7a9399;});}return null;};}function removeEntity(_0x16e11c,_0x4900d3){return function(_0x1ef751){if(_0x1ef751){return _0x1ef751['destroy']()['then'](function(){var _0x384f88=_0x1ef751[_0x0e82('0x28')]({'plain':!![]});var _0x4c5fc1=_0x0e82('0x29');return db[_0x0e82('0x2a')][_0x0e82('0x2b')]({'where':{'type':_0x4c5fc1,'resourceId':_0x384f88['id']}})['then'](function(){return _0x1ef751;});})[_0x0e82('0x27')](function(){_0x16e11c[_0x0e82('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xabc536,_0x59a5b6){return function(_0x4300f9){if(!_0x4300f9){_0xabc536[_0x0e82('0x2c')](0x194);}return _0x4300f9;};}function handleError(_0x551f96,_0x38cbbc){_0x38cbbc=_0x38cbbc||0x1f4;return function(_0x268af5){logger[_0x0e82('0x2d')](_0x268af5['stack']);if(_0x268af5['name']){delete _0x268af5[_0x0e82('0x2e')];}_0x551f96['status'](_0x38cbbc)[_0x0e82('0x2f')](_0x268af5);};}exports['index']=function(_0x1a3b2e,_0x264022){var _0x44e177={},_0x56ca79={},_0x45a40e={'count':0x0,'rows':[]};var _0x59d2f8=_[_0x0e82('0x30')](db[_0x0e82('0x31')][_0x0e82('0x32')],function(_0x30c993){return{'name':_0x30c993[_0x0e82('0x33')],'type':_0x30c993[_0x0e82('0x34')]['key']};});_0x56ca79[_0x0e82('0x35')]=_[_0x0e82('0x30')](_0x59d2f8,_0x0e82('0x2e'));_0x56ca79[_0x0e82('0x36')]=_[_0x0e82('0x37')](_0x1a3b2e[_0x0e82('0x36')]);_0x56ca79[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],_0x56ca79[_0x0e82('0x36')]);_0x44e177[_0x0e82('0x3a')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x1a3b2e[_0x0e82('0x36')]['fields']));_0x44e177[_0x0e82('0x3a')]=_0x44e177[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x44e177[_0x0e82('0x3a')]:_0x56ca79['model'];if(!_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x3d')]('nolimit')){_0x44e177[_0x0e82('0x1f')]=qs['limit'](_0x1a3b2e['query'][_0x0e82('0x1f')]);_0x44e177[_0x0e82('0x1d')]=qs[_0x0e82('0x1d')](_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x1d')]);}_0x44e177[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x1a3b2e['query']['sort']);_0x44e177[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x1a3b2e[_0x0e82('0x36')],_0x56ca79[_0x0e82('0x38')]),_0x59d2f8);if(_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x42')]){_0x44e177[_0x0e82('0x40')]=_['merge'](_0x44e177[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x59d2f8,function(_0x233a18){if(_0x233a18[_0x0e82('0x34')]!==_0x0e82('0x43')){var _0x3d0a45={};_0x3d0a45[_0x233a18[_0x0e82('0x2e')]]={'$like':'%'+_0x1a3b2e['query'][_0x0e82('0x42')]+'%'};return _0x3d0a45;}})});}_0x44e177=_[_0x0e82('0x44')]({},_0x44e177,_0x1a3b2e[_0x0e82('0x45')]);var _0x36fe4c={'where':_0x44e177[_0x0e82('0x40')]};return db[_0x0e82('0x31')][_0x0e82('0x20')](_0x36fe4c)['then'](function(_0x581764){_0x45a40e['count']=_0x581764;if(_0x1a3b2e['query']['includeAll']){_0x44e177['include']=[{'all':!![]}];}return db[_0x0e82('0x31')][_0x0e82('0x46')](_0x44e177);})[_0x0e82('0x27')](function(_0x199495){_0x45a40e[_0x0e82('0x47')]=_0x199495;return _0x45a40e;})[_0x0e82('0x27')](respondWithFilteredResult(_0x264022,_0x44e177))[_0x0e82('0x48')](handleError(_0x264022,null));};exports[_0x0e82('0x49')]=function(_0x55b53a,_0x484f94){var _0x2ae914={'raw':![],'where':{'id':_0x55b53a[_0x0e82('0x4a')]['id']}},_0x36a0c2={};_0x36a0c2[_0x0e82('0x35')]=_[_0x0e82('0x37')](db[_0x0e82('0x31')][_0x0e82('0x32')]);_0x36a0c2[_0x0e82('0x36')]=_['keys'](_0x55b53a[_0x0e82('0x36')]);_0x36a0c2['filters']=_[_0x0e82('0x39')](_0x36a0c2['model'],_0x36a0c2[_0x0e82('0x36')]);_0x2ae914['attributes']=_[_0x0e82('0x39')](_0x36a0c2[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x55b53a['query']['fields']));_0x2ae914[_0x0e82('0x3a')]=_0x2ae914[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x2ae914['attributes']:_0x36a0c2[_0x0e82('0x35')];if(_0x55b53a['query'][_0x0e82('0x4b')]){_0x2ae914[_0x0e82('0x4c')]=[{'all':!![]}];}_0x2ae914=_[_0x0e82('0x44')]({},_0x2ae914,_0x55b53a[_0x0e82('0x45')]);return db[_0x0e82('0x31')][_0x0e82('0x4d')](_0x2ae914)[_0x0e82('0x27')](handleEntityNotFound(_0x484f94,null))[_0x0e82('0x27')](respondWithResult(_0x484f94,null))[_0x0e82('0x48')](handleError(_0x484f94,null));};exports[_0x0e82('0x2b')]=function(_0x41e27e,_0x22c249){return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x41e27e[_0x0e82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c249,null))[_0x0e82('0x27')](removeEntity(_0x22c249,null))['catch'](handleError(_0x22c249,null));};exports['describe']=function(_0x42a535,_0x505663){return db[_0x0e82('0x31')][_0x0e82('0x4e')]()[_0x0e82('0x27')](respondWithResult(_0x505663,null))[_0x0e82('0x48')](handleError(_0x505663,null));};exports[_0x0e82('0x4f')]=function(_0x535f6d,_0x104bfe){var _0x4cb6e7;return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x42c4a7){return db[_0x0e82('0x31')][_0x0e82('0x4f')](_0x535f6d['body'],{'transaction':_0x42c4a7})[_0x0e82('0x27')](function(_0x22d56b){_0x4cb6e7=_0x22d56b[_0x0e82('0x28')]({'plain':!![]});return db[_0x0e82('0x52')][_0x0e82('0x4d')]({'where':{'id':_0x4cb6e7['VoiceExtensionId']},'raw':!![]})[_0x0e82('0x27')](function(_0x348b00){return createVoicePrefixExtensions(_0x4cb6e7,_0x348b00,_0x42c4a7);});});})[_0x0e82('0x27')](function(){var _0x1e6d69=_0x535f6d[_0x0e82('0x53')][_0x0e82('0x28')]({'plain':!![]});if(!_0x1e6d69)throw new Error(_0x0e82('0x54'));if(_0x1e6d69[_0x0e82('0x55')]===_0x0e82('0x53')){var _0x2852d4=_0x4cb6e7;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x1e6d69[_0x0e82('0x56')]},'raw':!![]})['then'](function(_0x23741c){if(_0x23741c&&_0x23741c[_0x0e82('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x2852d4[_0x0e82('0x2e')],'resourceId':_0x2852d4['id'],'type':_0x23741c[_0x0e82('0x2e')],'sectionId':_0x23741c['id']},{})[_0x0e82('0x27')](function(){return _0x4cb6e7;});}else{return _0x4cb6e7;}})[_0x0e82('0x48')](function(_0x174da5){logger[_0x0e82('0x2d')](_0x0e82('0x58'),_0x174da5);throw _0x174da5;});}return _0x4cb6e7;})[_0x0e82('0x27')](respondWithResult(_0x104bfe,null))[_0x0e82('0x48')](handleError(_0x104bfe,null));};function Extension(_0x3b35e0,_0x4ce423,_0x30e9f1,_0x21aaac){this[_0x0e82('0x59')]=_0x0e82('0x5a');this[_0x0e82('0x5b')]=_0x3b35e0;this[_0x0e82('0x5c')]=_0x30e9f1;this[_0x0e82('0x34')]=_0x0e82('0x5d');this['description']=_0x0e82('0x5e');this[_0x0e82('0x5f')]=_0x4ce423;this[_0x0e82('0x60')]=_0x21aaac;}function createVoicePrefixExtensions(_0x1ea2fc,_0x21c870,_0x28f3b7){return new BPromise(function(_0x2d1e59,_0x11ef9e){var _0x20bf0c=new Extension(formatPrefixName(_0x1ea2fc['prefix']),0x1,_0x0e82('0x61'),'Voice\x20Prefix');_0x20bf0c[_0x0e82('0x62')]=_0x1ea2fc['id'];return db['VoiceExtension'][_0x0e82('0x4f')](_0x20bf0c,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x5f3ec3){var _0x30e0a3=_0x5f3ec3[_0x0e82('0x28')]({'plain':!![]});var _0x244b42=_[_0x0e82('0x30')](addVoicePrefixExtensions(_0x1ea2fc,_0x21c870),function(_0x336df1){_0x336df1['VoiceExtensionId']=_0x30e0a3['id'];_0x336df1[_0x0e82('0x62')]=_0x1ea2fc['id'];return _0x336df1;});return db['VoiceExtension']['bulkCreate'](_0x244b42,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x2cf29f){if(!_0x2cf29f){return _0x11ef9e(_0x0e82('0x63'));}else{return _0x2d1e59(_0x2cf29f);}})[_0x0e82('0x48')](function(_0x2bdca1){return _0x11ef9e(_0x2bdca1);});});;});};function addVoicePrefixExtensions(_0xa4fe1f,_0xb1a061){var _0x41ef93=[];var _0x277327=formatPrefixName(_0xa4fe1f[_0x0e82('0x64')]);_0x41ef93['push'](new Extension(_0x277327,0x2,'Set',_0x0e82('0x65')+_0xa4fe1f['name']));if(_0xa4fe1f[_0x0e82('0x66')]){_0x41ef93[_0x0e82('0x67')](new Extension(_0x277327,0x3,'Set',_0x0e82('0x68')+_0xa4fe1f[_0x0e82('0x66')]));}else{_0x41ef93['push'](new Extension(_0x277327,0x3,_0x0e82('0x61'),_0x0e82('0x69')));}_0x41ef93['push'](new Extension(_0x277327,0x4,_0x0e82('0x6a'),_0xb1a061['context']+','+_0x0e82('0x6b')+(0x8+_0xa4fe1f[_0x0e82('0x2e')][_0x0e82('0x3c')])+'}'+','+0x1));return _0x41ef93;}function formatPrefixName(_0x3bdc68){var _0x34faf5='_';for(var _0x75a64d=0x0;_0x75a64d<_0x3bdc68[_0x0e82('0x3c')];_0x75a64d++){if(_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)=='-'){_0x34faf5+=_0x3bdc68[_0x0e82('0x6c')](_0x75a64d);}else{_0x34faf5+='['+_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)+']';}}_0x34faf5+='.';return _0x34faf5;}exports['update']=function(_0x39911a,_0x4a696b,_0x131698){var _0x2dfd03=_0x39911a[_0x0e82('0x6d')];_0x2dfd03['prefix']=_0x0e82('0x6e')+_0x2dfd03[_0x0e82('0x2e')]+'-';return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x1a67bc){return db['VoicePrefix'][_0x0e82('0x26')](_0x2dfd03,{'where':{'id':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db[_0x0e82('0x52')][_0x0e82('0x2b')]({'where':{'VoicePrefixId':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db['VoiceExtension'][_0x0e82('0x4d')]({'where':{'id':_0x2dfd03[_0x0e82('0x6f')]},'raw':!![]})[_0x0e82('0x27')](function(_0x22791b){return createVoicePrefixExtensions(_0x2dfd03,_0x22791b,_0x1a67bc);});});});})[_0x0e82('0x27')](function(){return db[_0x0e82('0x31')][_0x0e82('0x70')](_0x2dfd03['id']);})[_0x0e82('0x27')](respondWithResult(_0x4a696b,null))[_0x0e82('0x48')](handleError(_0x4a696b,null));};exports['addAgents']=function(_0x4249fd,_0x328d74,_0x480d15){return db['VoicePrefix']['find']({'where':{'id':_0x4249fd[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x328d74,null))[_0x0e82('0x27')](function(_0x542b28){if(_0x542b28){return _0x542b28[_0x0e82('0x71')](_0x4249fd['body'][_0x0e82('0x72')],_[_0x0e82('0x73')](_0x4249fd[_0x0e82('0x6d')],[_0x0e82('0x72'),'id'])||{})[_0x0e82('0x74')](function(_0x48ac18){for(var _0x28097c=0x0;_0x28097c<_0x4249fd[_0x0e82('0x6d')]['ids'][_0x0e82('0x3c')];_0x28097c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x76'),{'UserId':Number(_0x4249fd['body'][_0x0e82('0x72')][_0x28097c]),'VoicePrefixId':Number(_0x4249fd['params']['id'])});}return _0x48ac18;});}})[_0x0e82('0x27')](respondWithResult(_0x328d74,null))[_0x0e82('0x48')](handleError(_0x328d74,null));};exports[_0x0e82('0x77')]=function(_0x5ca20d,_0xe258d4,_0x115800){return db[_0x0e82('0x31')][_0x0e82('0x4d')]({'where':{'id':_0x5ca20d['params']['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0xe258d4,null))[_0x0e82('0x27')](function(_0x168bf1){if(_0x168bf1){return _0x168bf1[_0x0e82('0x77')](_0x5ca20d[_0x0e82('0x36')]['ids'])[_0x0e82('0x27')](function(){if(_['isArray'](_0x5ca20d[_0x0e82('0x36')]['ids'])){for(var _0x40e10c=0x0;_0x40e10c<_0x5ca20d[_0x0e82('0x36')]['ids'][_0x0e82('0x3c')];_0x40e10c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d['query']['ids'][_0x40e10c]),'VoicePrefixId':Number(_0x5ca20d['params']['id'])});}}else{socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d[_0x0e82('0x36')]['ids']),'VoicePrefixId':Number(_0x5ca20d[_0x0e82('0x4a')]['id'])});}});}})[_0x0e82('0x27')](respondWithStatusCode(_0xe258d4,null))[_0x0e82('0x48')](handleError(_0xe258d4,null));};exports[_0x0e82('0x79')]=function(_0x183fe7,_0x27928f,_0x6fcbe1){var _0x446a39={};var _0x556a2d={};var _0x445d82;var _0x384428;return db[_0x0e82('0x31')][_0x0e82('0x7a')]({'where':{'id':_0x183fe7[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x27928f,null))[_0x0e82('0x27')](function(_0x42b39c){if(_0x42b39c){_0x445d82=_0x42b39c;_0x556a2d['model']=_[_0x0e82('0x37')](db['User']['rawAttributes']);_0x556a2d['query']=_[_0x0e82('0x37')](_0x183fe7[_0x0e82('0x36')]);_0x556a2d[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x556a2d['model'],_0x556a2d[_0x0e82('0x36')]);_0x446a39['attributes']=_[_0x0e82('0x39')](_0x556a2d[_0x0e82('0x35')],qs['fields'](_0x183fe7[_0x0e82('0x36')]['fields']));_0x446a39['attributes']=_0x446a39[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x446a39['attributes']:_0x556a2d['model'];_0x446a39[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x446a39[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x183fe7[_0x0e82('0x36')],_0x556a2d['filters']));if(_0x183fe7['query'][_0x0e82('0x42')]){_0x446a39[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x446a39[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x446a39[_0x0e82('0x3a')],function(_0x350b6c){var _0x56804d={};_0x56804d[_0x350b6c]={'$like':'%'+_0x183fe7[_0x0e82('0x36')]['filter']+'%'};return _0x56804d;})});}_0x446a39=_['merge']({},_0x446a39,_0x183fe7[_0x0e82('0x45')]);return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x2ca1e2){if(_0x2ca1e2){_0x384428=_0x2ca1e2['length'];if(!_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x446a39[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x446a39['offset']=qs[_0x0e82('0x1d')](_0x183fe7['query']['offset']);}return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x30f947){if(_0x30f947){return _0x30f947?{'count':_0x384428,'rows':_0x30f947}:null;}})[_0x0e82('0x27')](respondWithResult(_0x27928f,null))[_0x0e82('0x48')](handleError(_0x27928f,null));};exports[_0x0e82('0x7c')]=function(_0x33eaa3,_0x57d238,_0x890f08){var _0x4a5773={};var _0x5f59f1={};var _0x48bd88;var _0x1fad5a;return db['VoicePrefix']['findOne']({'where':{'id':_0x33eaa3[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x57d238,null))['then'](function(_0x5800a5){if(_0x5800a5){_0x48bd88=_0x5800a5;_0x5f59f1[_0x0e82('0x35')]=_['keys'](db[_0x0e82('0x7d')][_0x0e82('0x32')]);_0x5f59f1[_0x0e82('0x36')]=_['keys'](_0x33eaa3[_0x0e82('0x36')]);_0x5f59f1[_0x0e82('0x38')]=_['intersection'](_0x5f59f1[_0x0e82('0x35')],_0x5f59f1[_0x0e82('0x36')]);_0x4a5773['attributes']=_[_0x0e82('0x39')](_0x5f59f1[_0x0e82('0x35')],qs['fields'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3b')]));_0x4a5773[_0x0e82('0x3a')]=_0x4a5773[_0x0e82('0x3a')]['length']?_0x4a5773['attributes']:_0x5f59f1[_0x0e82('0x35')];_0x4a5773[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x4a5773[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x33eaa3[_0x0e82('0x36')],_0x5f59f1['filters']));if(_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]){_0x4a5773[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x4a5773['where'],{'$or':_[_0x0e82('0x30')](_0x4a5773[_0x0e82('0x3a')],function(_0x51b943){var _0x148a2f={};_0x148a2f[_0x51b943]={'$like':'%'+_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]+'%'};return _0x148a2f;})});}_0x4a5773=_[_0x0e82('0x44')]({},_0x4a5773,_0x33eaa3[_0x0e82('0x45')]);return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x17a56d){if(_0x17a56d){_0x1fad5a=_0x17a56d['length'];if(!_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x4a5773[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x4a5773[_0x0e82('0x1d')]=qs['offset'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1d')]);}return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x273036){if(_0x273036){return _0x273036?{'count':_0x1fad5a,'rows':_0x273036}:null;}})['then'](respondWithResult(_0x57d238,null))[_0x0e82('0x48')](handleError(_0x57d238,null));};exports['addTeams']=function(_0x317358,_0x3691ac,_0x436572){var _0x532041=_0x317358[_0x0e82('0x6d')][_0x0e82('0x72')];var _0xae4be5;return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x532041},'attributes':['id'],'include':[{'model':db[_0x0e82('0x7e')],'as':_0x0e82('0x7f'),'attributes':['id',_0x0e82('0x2e'),_0x0e82('0x80'),_0x0e82('0x81'),'interface'],'raw':!![]}]})[_0x0e82('0x27')](function(_0x252df2){if(_0x252df2){_0xae4be5=_0x252df2;var _0xca734b=_[_0x0e82('0x82')](_0x252df2,function(_0x456bad){var _0x4ed7ba=_0x456bad['get']({'plain':!![]});return _0x4ed7ba[_0x0e82('0x7f')];});return db[_0x0e82('0x31')]['find']({'where':{'id':_0x317358['params']['id']}})[_0x0e82('0x27')](function(_0x226726){return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x326ed0){return _0x226726[_0x0e82('0x83')](_0x532041,{'transaction':_0x326ed0})['then'](function(){return BPromise[_0x0e82('0x84')](_0xae4be5,function(_0x270ad0){return db[_0x0e82('0x85')][_0x0e82('0x86')]({'TeamId':_0x270ad0['id'],'VoicePrefixId':_0x317358['params']['id']},{'transaction':_0x326ed0});});})['then'](function(){return BPromise[_0x0e82('0x84')](_0xca734b,function(_0x38a73a){return db[_0x0e82('0x87')][_0x0e82('0x88')]({'where':{'UserId':_0x38a73a['id'],'VoicePrefixId':_0x317358[_0x0e82('0x4a')]['id']},'transaction':_0x326ed0});});})['then'](function(){_0xca734b['forEach'](function(_0x3ab464){socket['emit'](_0x0e82('0x76'),{'UserId':_0x3ab464['id'],'VoicePrefixId':_0x226726['id']});});});});});}})['then'](respondWithStatusCode(_0x3691ac,null))[_0x0e82('0x48')](handleError(_0x3691ac,null));};exports[_0x0e82('0x89')]=function(_0x33d446,_0x34d730,_0x1c1a0d){return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x33d446['query'][_0x0e82('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e82('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x0e82('0x27')](handleEntityNotFound(_0x34d730,null))[_0x0e82('0x27')](function(_0x1c5350){var _0x396f44=_[_0x0e82('0x30')](_0x1c5350,'id');var _0x1d79b5=[];var _0x1e305f=[];var _0x25c63b=squel['select']();_0x25c63b[_0x0e82('0x8a')](_0x0e82('0x8b'))[_0x0e82('0x8c')](_0x0e82('0x8d'),'tq')[_0x0e82('0x8e')](_0x0e82('0x8f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0e82('0x40')](_0x0e82('0x90'),_0x33d446[_0x0e82('0x4a')]['id']);for(var _0x5d13ab=0x0;_0x5d13ab<_0x1c5350[_0x0e82('0x3c')];_0x5d13ab+=0x1){let _0xf8b029=_0x1c5350[_0x5d13ab];for(var _0x5581e6=0x0;_0x5581e6<_0xf8b029[_0x0e82('0x7f')][_0x0e82('0x3c')];_0x5581e6+=0x1){let _0x524665=_0xf8b029[_0x0e82('0x7f')][_0x5581e6];var _0x32264b=_0x25c63b[_0x0e82('0x91')]();_0x32264b[_0x0e82('0x40')](_0x0e82('0x92'),_0x524665['id']);_0x1e305f[_0x0e82('0x67')](db[_0x0e82('0x50')][_0x0e82('0x36')](_0x32264b[_0x0e82('0x93')](),{'type':db[_0x0e82('0x50')]['QueryTypes'][_0x0e82('0x94')]})['then'](function(_0x546f99){if(_0x546f99[_0x0e82('0x3c')]===0x1){return _0x524665['id'];}else{var _0x4b3009=_[_0x0e82('0x95')](_[_0x0e82('0x30')](_0x546f99,_0x0e82('0x96')),function(_0x414250){return _[_0x0e82('0x97')](_0x396f44,_0x414250);});if(_0x4b3009){return _0x524665['id'];}}}));}}return BPromise['all'](_0x1e305f)[_0x0e82('0x27')](function(_0x1df810){_0x1d79b5=_(_0x1d79b5)['union'](_0x1df810)['compact']()[_0x0e82('0x98')]();return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x33d446[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](function(_0x4f2118){return db['sequelize'][_0x0e82('0x51')](function(_0x5e7f11){return _0x4f2118[_0x0e82('0x89')](_0x33d446['query'][_0x0e82('0x72')],{'transaction':_0x5e7f11})[_0x0e82('0x27')](function(){if(!_['isEmpty'](_0x1d79b5)){return _0x4f2118[_0x0e82('0x77')](_0x1d79b5,{'transaction':_0x5e7f11});}})[_0x0e82('0x27')](function(){_0x1d79b5['forEach'](function(_0x22da22){socket[_0x0e82('0x75')]('userVoicePrefix:remove',{'UserId':_0x22da22,'VoicePrefixId':_0x4f2118['id']});});});});});});})['then'](respondWithStatusCode(_0x34d730,null))[_0x0e82('0x48')](handleError(_0x34d730,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index ade1617..3c3f693 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 _0xdd92=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4295bc,_0x55b581){var _0x2f0298=function(_0x3015e2){while(--_0x3015e2){_0x4295bc['push'](_0x4295bc['shift']());}};_0x2f0298(++_0x55b581);}(_0xdd92,0x18b));var _0x2dd9=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xdd92[_0x2642cb];return _0xe6e41;};'use strict';var EventEmitter=require(_0x2dd9('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2dd9('0x1')](0x0);var events={'afterCreate':_0x2dd9('0x2'),'afterUpdate':_0x2dd9('0x3'),'afterDestroy':_0x2dd9('0x4')};function emitEvent(_0x439bf5){return function(_0x53544a,_0x3a3d0e,_0x1562cf){VoicePrefixEvents[_0x2dd9('0x5')](_0x439bf5+':'+_0x53544a['id'],_0x53544a);VoicePrefixEvents['emit'](_0x439bf5,_0x53544a);_0x1562cf(null);};}for(var e in events){if(events[_0x2dd9('0x6')](e)){var event=events[e];VoicePrefix[_0x2dd9('0x7')](e,emitEvent(event));}}module[_0x2dd9('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xcc7e=['update','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xcc7e,0x136));var _0xecc7=function(_0x239ddb,_0x523839){_0x239ddb=_0x239ddb-0x0;var _0xc2879d=_0xcc7e[_0x239ddb];return _0xc2879d;};'use strict';var EventEmitter=require(_0xecc7('0x0'));var VoicePrefix=require(_0xecc7('0x1'))['db'][_0xecc7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xecc7('0x3')](0x0);var events={'afterCreate':_0xecc7('0x4'),'afterUpdate':_0xecc7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4afa99){return function(_0x255925,_0x23cb89,_0x2dd82a){VoicePrefixEvents[_0xecc7('0x6')](_0x4afa99+':'+_0x255925['id'],_0x255925);VoicePrefixEvents[_0xecc7('0x6')](_0x4afa99,_0x255925);_0x2dd82a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xecc7('0x7')](e,emitEvent(event));}}module[_0xecc7('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 4594a09..8c8177f 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 _0xec4a=['exports','define','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5ecde7,_0x411905){var _0x4c037e=function(_0x2f0cfc){while(--_0x2f0cfc){_0x5ecde7['push'](_0x5ecde7['shift']());}};_0x4c037e(++_0x411905);}(_0xec4a,0x146));var _0xaec4=function(_0x4f9ad5,_0x3c1acb){_0x4f9ad5=_0x4f9ad5-0x0;var _0x53a0dd=_0xec4a[_0x4f9ad5];return _0x53a0dd;};'use strict';var _=require(_0xaec4('0x0'));var util=require(_0xaec4('0x1'));var logger=require('../../config/logger')(_0xaec4('0x2'));var moment=require(_0xaec4('0x3'));var BPromise=require(_0xaec4('0x4'));var rp=require(_0xaec4('0x5'));var fs=require('fs');var path=require(_0xaec4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0xaec4('0x7')]=function(_0x566ab1,_0xc1650c){return _0x566ab1[_0xaec4('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b6e=['VoicePrefix','util','api','bluebird','path','./voicePrefix.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b6e,0x15f));var _0xe4b6=function(_0x1e43bd,_0x63fb56){_0x1e43bd=_0x1e43bd-0x0;var _0x4b80b1=_0x4b6e[_0x1e43bd];return _0x4b80b1;};'use strict';var _=require('lodash');var util=require(_0xe4b6('0x0'));var logger=require('../../config/logger')(_0xe4b6('0x1'));var moment=require('moment');var BPromise=require(_0xe4b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4b6('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe4b6('0x4'));module[_0xe4b6('0x5')]=function(_0x2906bc,_0x42078d){return _0x2906bc['define'](_0xe4b6('0x6'),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 5f1dd28..1edf980 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 _0x29eb=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1538df,_0xc036bb){var _0x55b12e=function(_0xd5df6b){while(--_0xd5df6b){_0x1538df['push'](_0x1538df['shift']());}};_0x55b12e(++_0xc036bb);}(_0x29eb,0x1c5));var _0xb29e=function(_0xdb199b,_0x188c25){_0xdb199b=_0xdb199b-0x0;var _0x171f83=_0x29eb[_0xdb199b];return _0x171f83;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var moment=require(_0xb29e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb29e('0x3'));var fs=require('fs');var Redis=require(_0xb29e('0x4'));var db=require(_0xb29e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb29e('0x6'))('rpc');var config=require(_0xb29e('0x7'));var jayson=require(_0xb29e('0x8'));var client=jayson[_0xb29e('0x9')][_0xb29e('0xa')]({'port':0x232a});config[_0xb29e('0xb')]=_[_0xb29e('0xc')](config['redis'],{'host':_0xb29e('0xd'),'port':0x18eb});var socket=require(_0xb29e('0xe'))(new Redis(config[_0xb29e('0xb')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x12eebb,_0x521d07,_0x57d868){return new BPromise(function(_0x3844ef,_0x449db2){return client['request'](_0x12eebb,_0x57d868)[_0xb29e('0xf')](function(_0x2dc3d7){logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));logger['debug'](_0xb29e('0x13'),_0x521d07,'request\x20sent',JSON['stringify'](_0x2dc3d7));if(_0x2dc3d7['error']){if(_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x15')]===0x1f4){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x16')]);return _0x449db2(_0x2dc3d7['error'][_0xb29e('0x16')]);}logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')]['message']);return _0x3844ef(_0x2dc3d7['error'][_0xb29e('0x16')]);}else{logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));_0x3844ef(_0x2dc3d7[_0xb29e('0x17')][_0xb29e('0x16')]);}})[_0xb29e('0x18')](function(_0x33f51f){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x33f51f);_0x449db2(_0x33f51f);});});} \ No newline at end of file +var _0xb89c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x5d90d1,_0x547e47){var _0x1cdcee=function(_0x1dffc6){while(--_0x1dffc6){_0x5d90d1['push'](_0x5d90d1['shift']());}};_0x1cdcee(++_0x547e47);}(_0xb89c,0x198));var _0xcb89=function(_0x5bcfd0,_0x4b61e8){_0x5bcfd0=_0x5bcfd0-0x0;var _0x51bfd=_0xb89c[_0x5bcfd0];return _0x51bfd;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var moment=require(_0xcb89('0x2'));var BPromise=require(_0xcb89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb89('0x4'));var db=require(_0xcb89('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb89('0x6'))(_0xcb89('0x7'));var config=require(_0xcb89('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb89('0x9')]({'port':0x232a});config[_0xcb89('0xa')]=_[_0xcb89('0xb')](config['redis'],{'host':_0xcb89('0xc'),'port':0x18eb});var socket=require(_0xcb89('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xcb89('0xe')](socket);function respondWithRpcPromise(_0x53c5a7,_0x41e33c,_0x13d505){return new BPromise(function(_0xbff62,_0x24c1b6){return client[_0xcb89('0xf')](_0x53c5a7,_0x13d505)[_0xcb89('0x10')](function(_0x4be56e){logger[_0xcb89('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x41e33c,_0xcb89('0x12'));logger[_0xcb89('0x13')](_0xcb89('0x14'),_0x41e33c,_0xcb89('0x12'),JSON[_0xcb89('0x15')](_0x4be56e));if(_0x4be56e[_0xcb89('0x16')]){if(_0x4be56e[_0xcb89('0x16')]['code']===0x1f4){logger[_0xcb89('0x16')](_0xcb89('0x17'),_0x41e33c,_0x4be56e['error'][_0xcb89('0x18')]);return _0x24c1b6(_0x4be56e[_0xcb89('0x16')][_0xcb89('0x18')]);}logger['error'](_0xcb89('0x17'),_0x41e33c,_0x4be56e['error']['message']);return _0xbff62(_0x4be56e[_0xcb89('0x16')][_0xcb89('0x18')]);}else{logger[_0xcb89('0x11')](_0xcb89('0x17'),_0x41e33c,_0xcb89('0x12'));_0xbff62(_0x4be56e[_0xcb89('0x19')][_0xcb89('0x18')]);}})[_0xcb89('0x1a')](function(_0x5d17a7){logger[_0xcb89('0x16')](_0xcb89('0x17'),_0x41e33c,_0x5d17a7);_0x24c1b6(_0x5d17a7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 43bf6fc..ca8542d 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 _0xaf1d=['update','removeListener','register','./voicePrefix.events','save','remove'];(function(_0x408cb6,_0x24ed7d){var _0x432758=function(_0x16e090){while(--_0x16e090){_0x408cb6['push'](_0x408cb6['shift']());}};_0x432758(++_0x24ed7d);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x36e1c5,_0x35050b){_0x36e1c5=_0x36e1c5-0x0;var _0x23f89c=_0xaf1d[_0x36e1c5];return _0x23f89c;};'use strict';var VoicePrefixEvents=require(_0xdaf1('0x0'));var events=[_0xdaf1('0x1'),_0xdaf1('0x2'),_0xdaf1('0x3')];function createListener(_0x5da77c,_0x30f9b1){return function(_0x258708){_0x30f9b1['emit'](_0x5da77c,_0x258708);};}function removeListener(_0x159ded,_0x38059d){return function(){VoicePrefixEvents[_0xdaf1('0x4')](_0x159ded,_0x38059d);};}exports[_0xdaf1('0x5')]=function(_0x1f6731){for(var _0x46f030=0x0,_0x4d6c50=events['length'];_0x46f030<_0x4d6c50;_0x46f030++){var _0x5ed9cd=events[_0x46f030];var _0xfb18fc=createListener('voicePrefix:'+_0x5ed9cd,_0x1f6731);VoicePrefixEvents['on'](_0x5ed9cd,_0xfb18fc);}}; \ No newline at end of file +var _0xee4e=['length','voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener','register'];(function(_0x5d43be,_0x62e23c){var _0x493270=function(_0x23a255){while(--_0x23a255){_0x5d43be['push'](_0x5d43be['shift']());}};_0x493270(++_0x62e23c);}(_0xee4e,0x122));var _0xeee4=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xee4e[_0x173441];return _0x2423a8;};'use strict';var VoicePrefixEvents=require(_0xeee4('0x0'));var events=[_0xeee4('0x1'),_0xeee4('0x2'),'update'];function createListener(_0x171016,_0x827900){return function(_0x33e574){_0x827900[_0xeee4('0x3')](_0x171016,_0x33e574);};}function removeListener(_0x2012a1,_0x30fe5a){return function(){VoicePrefixEvents[_0xeee4('0x4')](_0x2012a1,_0x30fe5a);};}exports[_0xeee4('0x5')]=function(_0x5564f7){for(var _0xcf3bbd=0x0,_0x148296=events[_0xeee4('0x6')];_0xcf3bbd<_0x148296;_0xcf3bbd++){var _0x593262=events[_0xcf3bbd];var _0x25f0ed=createListener(_0xeee4('0x7')+_0x593262,_0x5564f7);VoicePrefixEvents['on'](_0x593262,_0x25f0ed);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 49b80df..ace5293 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x1a9c75,_0xa83750){var _0xb2f37e=function(_0x2b90f6){while(--_0x2b90f6){_0x1a9c75['push'](_0x1a9c75['shift']());}};_0xb2f37e(++_0xa83750);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b2e8c,_0x54f172){_0x2b2e8c=_0x2b2e8c-0x0;var _0x4e8fac=_0xb10b[_0x2b2e8c];return _0x4e8fac;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x123df5,_0x5a535b){var _0x115fc5=function(_0x44e410){while(--_0x44e410){_0x123df5['push'](_0x123df5['shift']());}};_0x115fc5(++_0x5a535b);}(_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('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 e98bc37..75b67dc 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 _0xce0d=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','inbound','outbound','STRING','default','ENUM','ringall','rrmemory','linear','wrandom','rrordered','strategy','type','getDataValue','dialMethod','booked','roundrobin','predictive','INTEGER','yes','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#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','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0x37843a,_0xdfe28d){var _0x4e7142=function(_0x498fb9){while(--_0x498fb9){_0x37843a['push'](_0x37843a['shift']());}};_0x4e7142(++_0xdfe28d);}(_0xce0d,0x133));var _0xdce0=function(_0xfcfc24,_0x48ca53){_0xfcfc24=_0xfcfc24-0x0;var _0x58f773=_0xce0d[_0xfcfc24];return _0x58f773;};'use strict';var Sequelize=require(_0xdce0('0x0'));module[_0xdce0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdce0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xdce0('0x3'),_0xdce0('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':_0xdce0('0x6')},'announce':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0xdce0('0x7')]('rr',_0xdce0('0x8'),'leastrecent','fewestcalls','random',_0xdce0('0x9'),_0xdce0('0xa'),_0xdce0('0xb'),_0xdce0('0xc')),'allowNull':![],'defaultValue':_0xdce0('0x8'),'set':function(_0x541c82){this['setDataValue'](_0xdce0('0xd'),_0x541c82?_0x541c82:_0xdce0('0x9'));},'get':function(){var _0x18edb1=this['getDataValue'](_0xdce0('0xe'));var _0xa629a3=this[_0xdce0('0xf')](_0xdce0('0x10'));var _0x2c4a96=this[_0xdce0('0xf')](_0xdce0('0xd'));if(_0x18edb1==='inbound'){return _0x2c4a96;}if(_0xa629a3==='booked'&&_0x2c4a96===_0xdce0('0x9')||_0xa629a3===_0xdce0('0x11')&&_0x2c4a96===_0xdce0('0x12')){return _0x2c4a96;}if(_0xa629a3==='progressive'||_0xa629a3===_0xdce0('0x13')||_0xa629a3==='power'){return _0x2c4a96;}return null;}},'servicelevel':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdce0('0x14')](0xb)},'timeout':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdce0('0x5')]},'weight':{'type':Sequelize[_0xdce0('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xdce0('0x15'),'no'),'defaultValue':_0xdce0('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xdce0('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xdce0('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xdce0('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xdce0('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xdce0('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdce0('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdce0('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdce0('0x7')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no'),'defaultValue':_0xdce0('0x15')},'announce_holdtime':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xdce0('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdce0('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdce0('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdce0('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdce0('0x5')]},'queue_quantity1':{'type':Sequelize[_0xdce0('0x5')]},'queue_quantity2':{'type':Sequelize[_0xdce0('0x5')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xdce0('0x5')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x57b876){this[_0xdce0('0x16')](_0xdce0('0x17'),_0x57b876?_0x57b876[_0xdce0('0x18')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this['getDataValue'](_0xdce0('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':_0xdce0('0x15'),'set':function(_0x2ddd80){this[_0xdce0('0x16')](_0xdce0('0x19'),_0x2ddd80?_0x2ddd80['join'](','):undefined);},'get':function(){return this[_0xdce0('0xf')](_0xdce0('0x19'))?this[_0xdce0('0xf')](_0xdce0('0x19'))[_0xdce0('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x52a123){this[_0xdce0('0x16')](_0xdce0('0x1b'),_0x52a123?_0x52a123[_0xdce0('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0xdce0('0x1b'))?this[_0xdce0('0xf')](_0xdce0('0x1b'))[_0xdce0('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdce0('0x7')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdce0('0x5')]},'description':{'type':Sequelize[_0xdce0('0x5')]},'acw':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':0x0,'set':function(_0x2ab54f){this[_0xdce0('0x16')]('acw',_0x2ab54f);if(_0x2ab54f){if(this['getDataValue'](_0xdce0('0x1d'))<0x2){this[_0xdce0('0x16')](_0xdce0('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdce0('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':0x0,'comment':_0xdce0('0x1e')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xdce0('0x1f'),_0xdce0('0x20'),_0xdce0('0x13'),'booked'),'defaultValue':_0xdce0('0x1f'),'comment':_0xdce0('0x21')},'dialLimitChannel':{'type':Sequelize[_0xdce0('0x14')](0x4)[_0xdce0('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xdce0('0x14')](0x4)[_0xdce0('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xdce0('0x23')](0x2)[_0xdce0('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdce0('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0xdce0('0x7')](_0xdce0('0x25'),_0xdce0('0x26')),'defaultValue':_0xdce0('0x26'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdce0('0x23')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xdce0('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdce0('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdce0('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdce0('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xdce0('0x29'),'comment':_0xdce0('0x2a')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x2b')},'dialQueueProject':{'type':Sequelize[_0xdce0('0x5')],'comment':_0xdce0('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdce0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x3,'comment':_0xdce0('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdce0('0x14')](0x5)[_0xdce0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdce0('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':_0xdce0('0x32')},'dialPrefix':{'type':Sequelize[_0xdce0('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xdce0('0x33'),_0xdce0('0x34'),'onlyIfOpen'),'defaultValue':_0xdce0('0x33')},'dialAMDActive':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdce0('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdce0('0x35')},'dialAMDGreeting':{'type':Sequelize[_0xdce0('0x14')](0x9)[_0xdce0('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdce0('0x14')](0x9)[_0xdce0('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdce0('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xdce0('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdce0('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0xdce0('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdce0('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdce0('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdce0('0x14')](0x9)[_0xdce0('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xdce0('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdce0('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdce0('0x14')](0x9)[_0xdce0('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdce0('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0xdce0('0x14')](0x5)[_0xdce0('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':0x0,'comment':_0xdce0('0x3b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdce0('0x7')]('DESC','ASC'),'defaultValue':_0xdce0('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xdce0('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdce0('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdce0('0x3d')},'dialCutDigit':{'type':Sequelize[_0xdce0('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdce0('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdce0('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x3f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x40')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdce0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x41')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdce0('0x14')](0x5)[_0xdce0('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdce0('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x44')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdce0('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdce0('0x45')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdce0('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdce0('0x14')],'allowNull':!![],'comment':_0xdce0('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1cd577){if(!_0x1cd577)this[_0xdce0('0x16')](_0xdce0('0x48'),null);this[_0xdce0('0x16')](_0xdce0('0x49'),_0x1cd577);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xdce0('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xdce0('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xdce0('0x14')](0x3)[_0xdce0('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xcec4=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','inbound','default','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','UNSIGNED','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x54c9af,_0x4f3942){var _0x234b50=function(_0x5756f0){while(--_0x5756f0){_0x54c9af['push'](_0x54c9af['shift']());}};_0x234b50(++_0x4f3942);}(_0xcec4,0xe3));var _0x4cec=function(_0x729c45,_0x4488c4){_0x729c45=_0x729c45-0x0;var _0xd4b462=_0xcec4[_0x729c45];return _0xd4b462;};'use strict';var Sequelize=require(_0x4cec('0x0'));module[_0x4cec('0x1')]={'name':{'type':Sequelize[_0x4cec('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4cec('0x3')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x4cec('0x4')},'musiconhold':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x4cec('0x3')]('rr','ringall','leastrecent',_0x4cec('0x6'),_0x4cec('0x7'),_0x4cec('0x8'),_0x4cec('0x9'),_0x4cec('0xa'),_0x4cec('0xb')),'allowNull':![],'defaultValue':_0x4cec('0xc'),'set':function(_0x2ed9f8){this[_0x4cec('0xd')](_0x4cec('0xe'),_0x2ed9f8?_0x2ed9f8:'rrmemory');},'get':function(){var _0x24d4a8=this[_0x4cec('0xf')]('type');var _0xf9be07=this[_0x4cec('0xf')](_0x4cec('0x10'));var _0x3d2810=this[_0x4cec('0xf')]('strategy');if(_0x24d4a8===_0x4cec('0x4')){return _0x3d2810;}if(_0xf9be07==='booked'&&_0x3d2810===_0x4cec('0x8')||_0xf9be07===_0x4cec('0x11')&&_0x3d2810==='roundrobin'){return _0x3d2810;}if(_0xf9be07===_0x4cec('0x12')||_0xf9be07===_0x4cec('0x13')||_0xf9be07===_0x4cec('0x14')){return _0x3d2810;}return null;}},'servicelevel':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4cec('0x15')](0xb)},'timeout':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4cec('0x2')]},'weight':{'type':Sequelize[_0x4cec('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':_0x4cec('0x16')},'autopause':{'type':Sequelize[_0x4cec('0x3')]('yes','no',_0x4cec('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4cec('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x4cec('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4cec('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':_0x4cec('0x16')},'announce_holdtime':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no',_0x4cec('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4cec('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4cec('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4cec('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4cec('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x4cec('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4cec('0x2')]},'periodic_announce':{'type':Sequelize[_0x4cec('0x19')],'set':function(_0x35f983){this['setDataValue'](_0x4cec('0x1a'),_0x35f983?_0x35f983[_0x4cec('0x1b')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x4cec('0xf')](_0x4cec('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x16'),'set':function(_0x18283c){this[_0x4cec('0xd')](_0x4cec('0x1c'),_0x18283c?_0x18283c[_0x4cec('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x4cec('0xf')](_0x4cec('0x1c'))[_0x4cec('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x144e33){this['setDataValue']('leavewhenempty',_0x144e33?_0x144e33['join'](','):undefined);},'get':function(){return this[_0x4cec('0xf')](_0x4cec('0x1e'))?this['getDataValue'](_0x4cec('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4cec('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4cec('0x2')]},'acw':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'set':function(_0x1f8aa6){this[_0x4cec('0xd')](_0x4cec('0x20'),_0x1f8aa6);if(_0x1f8aa6){if(this['getDataValue'](_0x4cec('0x21'))<0x2){this[_0x4cec('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x22'),_0x4cec('0x12'),'power',_0x4cec('0x13'),_0x4cec('0x11')),'defaultValue':_0x4cec('0x12'),'comment':_0x4cec('0x23')},'dialLimitChannel':{'type':Sequelize[_0x4cec('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4cec('0x24')},'dialLimitQueue':{'type':Sequelize[_0x4cec('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4cec('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x4cec('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x27'),_0x4cec('0x28')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4cec('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4cec('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4cec('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x2c'),'comment':_0x4cec('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x4cec('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4cec('0x32')},'dialTimezone':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x33'),_0x4cec('0x34'),_0x4cec('0x35')),'defaultValue':_0x4cec('0x33')},'dialAMDActive':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':_0x4cec('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4cec('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4cec('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4cec('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4cec('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4cec('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4cec('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'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':_0x4cec('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x4cec('0x15')](0x5)[_0x4cec('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4cec('0x3c')},'dialRecallInQueue':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':_0x4cec('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4cec('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x4cec('0x2')],'comment':_0x4cec('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4cec('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x41')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x42')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x43')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4cec('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x41ffa3){if(!_0x41ffa3)this[_0x4cec('0xd')](_0x4cec('0x46'),null);this['setDataValue']('mandatoryDisposition',_0x41ffa3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4cec('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 95a4ae9..21ca7bd 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 _0x16a6=['json','offset','undefined','count','Content-Range','apply','reject','update','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','type','UserProfileResource','destroy','then','end','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','VoiceQueue','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','options','omit','updatedAt','createdAt','role','findOne','CmHopper','hasOwnProperty','getHopperHistories','CmHopperHistory','VoiceQueueId','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','isNil','format','SIP/%s','forEach','emit','removeTeams','ids','User','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','spread','isArray','getAgents','getMembers','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','CmListId','from','deletedAt\x20IS\x20NULL','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','fromQuery','scheduledAt','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','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','./voiceQueue.socket','sendStatus','status'];(function(_0x492eb8,_0x124b75){var _0x3d525b=function(_0x16c846){while(--_0x16c846){_0x492eb8['push'](_0x492eb8['shift']());}};_0x3d525b(++_0x124b75);}(_0x16a6,0x15c));var _0x616a=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x16a6[_0x5a6de2];return _0x2c0525;};'use strict';var emlformat=require(_0x616a('0x0'));var rimraf=require(_0x616a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616a('0x2'));var rp=require(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var Mustache=require(_0x616a('0x6'));var util=require(_0x616a('0x7'));var path=require('path');var sox=require(_0x616a('0x8'));var csv=require(_0x616a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var licenseUtil=require(_0x616a('0x16'));var db=require(_0x616a('0x17'))['db'];config[_0x616a('0x18')]=_['defaults'](config[_0x616a('0x18')],{'host':_0x616a('0x19'),'port':0x18eb});var socket=require(_0x616a('0x1a'))(new Redis(config[_0x616a('0x18')]));require(_0x616a('0x1b'))['register'](socket);function respondWithStatusCode(_0x1399c1,_0x16dbfe){_0x16dbfe=_0x16dbfe||0xcc;return function(_0x24eb7c){if(_0x24eb7c){return _0x1399c1[_0x616a('0x1c')](_0x16dbfe);}return _0x1399c1[_0x616a('0x1d')](_0x16dbfe)['end']();};}function respondWithResult(_0x204e68,_0x1803bc){_0x1803bc=_0x1803bc||0xc8;return function(_0x4eb3ba){if(_0x4eb3ba){return _0x204e68['status'](_0x1803bc)[_0x616a('0x1e')](_0x4eb3ba);}};}function respondWithFilteredResult(_0x4768b2,_0x23052c){return function(_0x4d59e7){if(_0x4d59e7){var _0x5f447d=typeof _0x23052c[_0x616a('0x1f')]==='undefined'&&typeof _0x23052c['limit']===_0x616a('0x20');var _0x27e95c=_0x4d59e7[_0x616a('0x21')];var _0x31b711=_0x5f447d?0x0:_0x23052c['offset'];var _0x499132=_0x5f447d?_0x4d59e7['count']:_0x23052c['offset']+_0x23052c['limit'];var _0x5ee3f2;if(_0x499132>=_0x27e95c){_0x499132=_0x27e95c;_0x5ee3f2=0xc8;}else{_0x5ee3f2=0xce;}_0x4768b2[_0x616a('0x1d')](_0x5ee3f2);return _0x4768b2['set'](_0x616a('0x22'),_0x31b711+'-'+_0x499132+'/'+_0x27e95c)[_0x616a('0x1e')](_0x4d59e7);}return null;};}function patchUpdates(_0x4f5594){return function(_0x46ac5d){try{jsonpatch[_0x616a('0x23')](_0x46ac5d,_0x4f5594,!![]);}catch(_0x3d484b){return BPromise[_0x616a('0x24')](_0x3d484b);}return _0x46ac5d['save']();};}function saveUpdates(_0x2db2bb,_0x71e642){return function(_0x3d1728){if(_0x3d1728){return _0x3d1728[_0x616a('0x25')](_0x2db2bb)['then'](function(_0x3e11f2){return _0x3e11f2;});}return null;};}function removeEntity(_0x4be8a8,_0x30c1a){return function(_0x397a69){if(_0x397a69){return _0x397a69['destroy']()['then'](function(){var _0x50c6b8=_0x397a69[_0x616a('0x26')]({'plain':!![]});var _0x7ebd63=[{'name':_0x616a('0x27'),'value':_0x616a('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0x616a('0x29'),'ignore':![]}];var _0x3fb030=_(_0x7ebd63)[_0x616a('0x2a')](_0x616a('0x2b'))[_0x616a('0x2c')](_0x616a('0x2d'))[_0x616a('0x2d')]();if(_['includes'](_0x3fb030,_0x50c6b8[_0x616a('0x2e')])){return;}var _0x1ded22=_['find'](_0x7ebd63,[_0x616a('0x2d'),_0x50c6b8['type']])['name'];return db[_0x616a('0x2f')][_0x616a('0x30')]({'where':{'type':_0x1ded22,'resourceId':_0x50c6b8['id']}})[_0x616a('0x31')](function(){return _0x397a69;});})['then'](function(){_0x4be8a8[_0x616a('0x1d')](0xcc)[_0x616a('0x32')]();});}};}function handleEntityNotFound(_0x213f6a,_0x2d85ce){return function(_0x172675){if(!_0x172675){_0x213f6a[_0x616a('0x1c')](0x194);}return _0x172675;};}function handleError(_0x5191d2,_0x147b50){_0x147b50=_0x147b50||0x1f4;return function(_0x4a938c){logger[_0x616a('0x33')](_0x4a938c[_0x616a('0x34')]);if(_0x4a938c[_0x616a('0x35')]){delete _0x4a938c['name'];}_0x5191d2[_0x616a('0x1d')](_0x147b50)[_0x616a('0x36')](_0x4a938c);};}exports['index']=function(_0x5ad055,_0x419198){var _0x34697a={},_0x3e7301={},_0x12fd21={'count':0x0,'rows':[]};var _0x562688=_['map'](db['VoiceQueue'][_0x616a('0x37')],function(_0x36c583){return{'name':_0x36c583[_0x616a('0x38')],'type':_0x36c583[_0x616a('0x2e')][_0x616a('0x39')]};});_0x3e7301[_0x616a('0x3a')]=_[_0x616a('0x2c')](_0x562688,_0x616a('0x35'));_0x3e7301[_0x616a('0x3b')]=_[_0x616a('0x3c')](_0x5ad055['query']);_0x3e7301[_0x616a('0x3d')]=_['intersection'](_0x3e7301[_0x616a('0x3a')],_0x3e7301[_0x616a('0x3b')]);_0x34697a[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x3e7301[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x5ad055[_0x616a('0x3b')][_0x616a('0x40')]));_0x34697a[_0x616a('0x3e')]=_0x34697a['attributes'][_0x616a('0x41')]?_0x34697a[_0x616a('0x3e')]:_0x3e7301[_0x616a('0x3a')];if(!_0x5ad055[_0x616a('0x3b')]['hasOwnProperty'](_0x616a('0x42'))){_0x34697a['limit']=qs[_0x616a('0x43')](_0x5ad055['query'][_0x616a('0x43')]);_0x34697a[_0x616a('0x1f')]=qs['offset'](_0x5ad055[_0x616a('0x3b')]['offset']);}_0x34697a[_0x616a('0x44')]=qs[_0x616a('0x45')](_0x5ad055[_0x616a('0x3b')][_0x616a('0x45')]);_0x34697a[_0x616a('0x46')]=qs[_0x616a('0x3d')](_[_0x616a('0x47')](_0x5ad055['query'],_0x3e7301[_0x616a('0x3d')]),_0x562688);if(_0x5ad055['query'][_0x616a('0x2a')]){_0x34697a[_0x616a('0x46')]=_[_0x616a('0x48')](_0x34697a['where'],{'$or':_[_0x616a('0x2c')](_0x562688,function(_0x2c0b4d){if(_0x2c0b4d[_0x616a('0x2e')]!==_0x616a('0x49')){var _0x130ed8={};_0x130ed8[_0x2c0b4d['name']]={'$like':'%'+_0x5ad055[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x130ed8;}})});}_0x34697a=_[_0x616a('0x48')]({},_0x34697a,_0x5ad055['options']);var _0x26c844={'where':_0x34697a[_0x616a('0x46')]};return db[_0x616a('0x4a')][_0x616a('0x21')](_0x26c844)[_0x616a('0x31')](function(_0x19b41e){_0x12fd21[_0x616a('0x21')]=_0x19b41e;if(_0x5ad055['query'][_0x616a('0x4b')]){_0x34697a[_0x616a('0x4c')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x34697a);})[_0x616a('0x31')](function(_0x3460dd){_0x12fd21[_0x616a('0x4d')]=_0x3460dd;return _0x12fd21;})[_0x616a('0x31')](respondWithFilteredResult(_0x419198,_0x34697a))[_0x616a('0x4e')](handleError(_0x419198,null));};exports[_0x616a('0x4f')]=function(_0x5ec6d1,_0xdb9138){var _0x21c8dd={'raw':![],'where':{'id':_0x5ec6d1['params']['id']}},_0x1f1774={};_0x1f1774[_0x616a('0x3a')]=_['keys'](db[_0x616a('0x4a')][_0x616a('0x37')]);_0x1f1774[_0x616a('0x3b')]=_[_0x616a('0x3c')](_0x5ec6d1['query']);_0x1f1774[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x1f1774[_0x616a('0x3a')],_0x1f1774[_0x616a('0x3b')]);_0x21c8dd[_0x616a('0x3e')]=_['intersection'](_0x1f1774[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x5ec6d1[_0x616a('0x3b')][_0x616a('0x40')]));_0x21c8dd[_0x616a('0x3e')]=_0x21c8dd[_0x616a('0x3e')]['length']?_0x21c8dd[_0x616a('0x3e')]:_0x1f1774[_0x616a('0x3a')];if(_0x5ec6d1[_0x616a('0x3b')][_0x616a('0x4b')]){_0x21c8dd['include']=[{'all':!![]}];}_0x21c8dd=_[_0x616a('0x48')]({},_0x21c8dd,_0x5ec6d1['options']);return db[_0x616a('0x4a')][_0x616a('0x50')](_0x21c8dd)['then'](handleEntityNotFound(_0xdb9138,null))[_0x616a('0x31')](respondWithResult(_0xdb9138,null))[_0x616a('0x4e')](handleError(_0xdb9138,null));};exports[_0x616a('0x51')]=function(_0x57d4fa,_0x32749f){return db[_0x616a('0x4a')][_0x616a('0x51')](_0x57d4fa[_0x616a('0x52')],{})['then'](function(_0x583bd4){var _0x944a82=_0x57d4fa[_0x616a('0x53')][_0x616a('0x26')]({'plain':!![]});if(!_0x944a82)throw new Error(_0x616a('0x54'));if(_0x944a82['role']===_0x616a('0x53')){var _0x241f86=_0x583bd4[_0x616a('0x26')]({'plain':!![]});var _0x5f0483=[{'name':'VoiceQueues','value':_0x616a('0x28')},{'name':_0x616a('0x55'),'value':_0x616a('0x29')}];var _0x387abd=_[_0x616a('0x50')](_0x5f0483,[_0x616a('0x2d'),_0x241f86[_0x616a('0x2e')]])[_0x616a('0x35')];return db[_0x616a('0x56')][_0x616a('0x50')]({'where':{'name':_0x387abd,'userProfileId':_0x944a82[_0x616a('0x57')]},'raw':!![]})['then'](function(_0x53b398){if(_0x53b398&&_0x53b398[_0x616a('0x58')]===0x0){return db[_0x616a('0x2f')][_0x616a('0x51')]({'name':_0x241f86[_0x616a('0x35')],'resourceId':_0x241f86['id'],'type':_0x53b398['name'],'sectionId':_0x53b398['id']},{})['then'](function(){return _0x583bd4;});}else{return _0x583bd4;}})[_0x616a('0x4e')](function(_0x5401e8){logger[_0x616a('0x33')](_0x616a('0x59'),_0x5401e8);throw _0x5401e8;});}return _0x583bd4;})[_0x616a('0x31')](respondWithResult(_0x32749f,0xc9))[_0x616a('0x4e')](handleError(_0x32749f,null));};exports['clone']=function(_0x44be05,_0x338736){var _0x148fbe={'where':{'id':_0x44be05[_0x616a('0x5a')]['id']}},_0xa38f0c={};_0xa38f0c['model']=_['keys'](db['VoiceQueue'][_0x616a('0x37')]);_0x148fbe['attributes']=_[_0x616a('0x3f')](_0xa38f0c[_0x616a('0x3a')],qs['fields'](_0x44be05[_0x616a('0x3b')]['fields']));_0x148fbe['attributes']=_0x148fbe[_0x616a('0x3e')]['length']?_0x148fbe['attributes']:_0xa38f0c[_0x616a('0x3a')];if(_0x44be05['query'][_0x616a('0x4b')]){_0x148fbe[_0x616a('0x4c')]=[{'all':!![]}];}_0x148fbe=_[_0x616a('0x48')]({},_0x148fbe,_0x44be05[_0x616a('0x5b')]);return db[_0x616a('0x4a')][_0x616a('0x50')](_0x148fbe)[_0x616a('0x31')](handleEntityNotFound(_0x338736,null))[_0x616a('0x31')](function(_0x508a12){if(_0x508a12){var _0x487576=_0x508a12[_0x616a('0x26')]({'plain':!![]});_0x487576=qs[_0x616a('0x5c')](_0x487576,['id','createdAt',_0x616a('0x5d')]);_0x44be05[_0x616a('0x52')]=_['omit'](_0x44be05[_0x616a('0x52')],['id',_0x616a('0x5e'),_0x616a('0x5d')]);return db['VoiceQueue'][_0x616a('0x51')](_[_0x616a('0x48')](_0x487576,_0x44be05['body']),{'include':_0x44be05[_0x616a('0x3b')]['includeAll']?[{'all':!![]}]:undefined})[_0x616a('0x31')](function(_0xcbc23b){var _0x4512bf=_0x44be05[_0x616a('0x53')][_0x616a('0x26')]({'plain':!![]});if(!_0x4512bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4512bf[_0x616a('0x5f')]===_0x616a('0x53')){var _0x1821f4=_0xcbc23b[_0x616a('0x26')]({'plain':!![]});var _0x384ad5=[{'name':_0x616a('0x27'),'value':'inbound'},{'name':_0x616a('0x55'),'value':_0x616a('0x29')}];var _0x1211d0=_[_0x616a('0x50')](_0x384ad5,[_0x616a('0x2d'),_0x1821f4[_0x616a('0x2e')]])['name'];return db[_0x616a('0x56')][_0x616a('0x50')]({'where':{'name':_0x1211d0,'userProfileId':_0x4512bf[_0x616a('0x57')]},'raw':!![]})[_0x616a('0x31')](function(_0x5a64b9){if(_0x5a64b9&&_0x5a64b9[_0x616a('0x58')]===0x0){return db[_0x616a('0x2f')][_0x616a('0x51')]({'name':_0x1821f4[_0x616a('0x35')],'resourceId':_0x1821f4['id'],'type':_0x5a64b9['name'],'sectionId':_0x5a64b9['id']},{})[_0x616a('0x31')](function(){return _0xcbc23b;});}else{return _0xcbc23b;}})[_0x616a('0x4e')](function(_0x485bcf){logger[_0x616a('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x485bcf);throw _0x485bcf;});}return _0xcbc23b;});}})[_0x616a('0x31')](respondWithResult(_0x338736,0xc9))[_0x616a('0x4e')](handleError(_0x338736,null));};exports[_0x616a('0x25')]=function(_0x48a0e1,_0x141eb2){if(_0x48a0e1[_0x616a('0x52')]['id']){delete _0x48a0e1[_0x616a('0x52')]['id'];}return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x48a0e1[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x141eb2,null))['then'](saveUpdates(_0x48a0e1['body'],null))[_0x616a('0x31')](respondWithResult(_0x141eb2,null))['catch'](handleError(_0x141eb2,null));};exports[_0x616a('0x30')]=function(_0x70b288,_0x5bb86f){return db[_0x616a('0x4a')]['find']({'where':{'id':_0x70b288[_0x616a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5bb86f,null))[_0x616a('0x31')](removeEntity(_0x5bb86f,null))[_0x616a('0x4e')](handleError(_0x5bb86f,null));};exports['getHoppers']=function(_0x2bdb14,_0x49d6cd,_0x590241){var _0x4220f6={'raw':![],'where':{}};var _0x9fb16b={};var _0x50a874={'count':0x0,'rows':[]};return db[_0x616a('0x4a')][_0x616a('0x60')]({'where':{'id':_0x2bdb14[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x49d6cd,null))[_0x616a('0x31')](function(_0x24f999){if(_0x24f999){_0x9fb16b[_0x616a('0x3a')]=_['keys'](db[_0x616a('0x61')][_0x616a('0x37')]);_0x9fb16b[_0x616a('0x3b')]=_['keys'](_0x2bdb14[_0x616a('0x3b')]);_0x9fb16b[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x9fb16b['model'],_0x9fb16b[_0x616a('0x3b')]);_0x4220f6[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x9fb16b[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x2bdb14['query'][_0x616a('0x40')]));_0x4220f6[_0x616a('0x3e')]=_0x4220f6[_0x616a('0x3e')]['length']?_0x4220f6[_0x616a('0x3e')]:_0x9fb16b['model'];if(!_0x2bdb14['query'][_0x616a('0x62')](_0x616a('0x42'))){_0x4220f6[_0x616a('0x43')]=qs[_0x616a('0x43')](_0x2bdb14['query'][_0x616a('0x43')]);_0x4220f6[_0x616a('0x1f')]=qs[_0x616a('0x1f')](_0x2bdb14['query'][_0x616a('0x1f')]);}_0x4220f6[_0x616a('0x44')]=qs[_0x616a('0x45')](_0x2bdb14[_0x616a('0x3b')][_0x616a('0x45')]);_0x4220f6[_0x616a('0x46')]=qs[_0x616a('0x3d')](_['pick'](_0x2bdb14['query'],_0x9fb16b[_0x616a('0x3d')]));_0x4220f6[_0x616a('0x46')]['VoiceQueueId']=_0x24f999['id'];if(_0x2bdb14[_0x616a('0x3b')][_0x616a('0x2a')]){_0x4220f6[_0x616a('0x46')]=_[_0x616a('0x48')](_0x4220f6[_0x616a('0x46')],{'$or':_['map'](_0x4220f6[_0x616a('0x3e')],function(_0x1c27b3){var _0x2e6f86={};_0x2e6f86[_0x1c27b3]={'$like':'%'+_0x2bdb14[_0x616a('0x3b')]['filter']+'%'};return _0x2e6f86;})});}_0x4220f6=_[_0x616a('0x48')]({},_0x4220f6,_0x2bdb14[_0x616a('0x5b')]);return db[_0x616a('0x61')]['count']({'where':_0x4220f6[_0x616a('0x46')]})[_0x616a('0x31')](function(_0xa97c08){_0x50a874['count']=_0xa97c08;if(_0x2bdb14[_0x616a('0x3b')]['includeAll']){_0x4220f6['include']=[{'all':!![]}];}return db[_0x616a('0x61')]['findAll'](_0x4220f6);})[_0x616a('0x31')](function(_0x267018){_0x50a874['rows']=_0x267018;return _0x50a874;});}})['then'](respondWithFilteredResult(_0x49d6cd,_0x4220f6))[_0x616a('0x4e')](handleError(_0x49d6cd,null));};exports[_0x616a('0x63')]=function(_0xaec586,_0xbf037e,_0x452bbd){var _0x157403={'raw':!![],'where':{}};var _0x573625={};var _0x1ce5be={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x616a('0x60')]({'where':{'id':_0xaec586[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0xbf037e,null))[_0x616a('0x31')](function(_0xdfad1b){if(_0xdfad1b){_0x573625[_0x616a('0x3a')]=_[_0x616a('0x3c')](db[_0x616a('0x64')][_0x616a('0x37')]);_0x573625['query']=_[_0x616a('0x3c')](_0xaec586['query']);_0x573625[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x573625[_0x616a('0x3a')],_0x573625[_0x616a('0x3b')]);_0x157403['attributes']=_[_0x616a('0x3f')](_0x573625['model'],qs[_0x616a('0x40')](_0xaec586[_0x616a('0x3b')][_0x616a('0x40')]));_0x157403[_0x616a('0x3e')]=_0x157403['attributes']['length']?_0x157403['attributes']:_0x573625[_0x616a('0x3a')];if(!_0xaec586['query']['hasOwnProperty'](_0x616a('0x42'))){_0x157403[_0x616a('0x43')]=qs[_0x616a('0x43')](_0xaec586['query'][_0x616a('0x43')]);_0x157403['offset']=qs[_0x616a('0x1f')](_0xaec586[_0x616a('0x3b')][_0x616a('0x1f')]);}_0x157403[_0x616a('0x44')]=qs['sort'](_0xaec586['query']['sort']);_0x157403[_0x616a('0x46')]=qs[_0x616a('0x3d')](_[_0x616a('0x47')](_0xaec586[_0x616a('0x3b')],_0x573625[_0x616a('0x3d')]));_0x157403[_0x616a('0x46')][_0x616a('0x65')]=_0xdfad1b['id'];if(_0xaec586[_0x616a('0x3b')]['filter']){_0x157403[_0x616a('0x46')]=_[_0x616a('0x48')](_0x157403[_0x616a('0x46')],{'$or':_[_0x616a('0x2c')](_0x157403['attributes'],function(_0x325c9a){var _0x1f2101={};_0x1f2101[_0x325c9a]={'$like':'%'+_0xaec586[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x1f2101;})});}_0x157403=_[_0x616a('0x48')]({},_0x157403,_0xaec586[_0x616a('0x5b')]);return db[_0x616a('0x64')][_0x616a('0x21')]({'where':_0x157403[_0x616a('0x46')]})[_0x616a('0x31')](function(_0x14022f){_0x1ce5be[_0x616a('0x21')]=_0x14022f;if(_0xaec586[_0x616a('0x3b')][_0x616a('0x4b')]){_0x157403[_0x616a('0x4c')]=[{'all':!![]}];}return db[_0x616a('0x64')][_0x616a('0x66')](_0x157403);})[_0x616a('0x31')](function(_0x50ea06){_0x1ce5be[_0x616a('0x4d')]=_0x50ea06;return _0x1ce5be;});}})[_0x616a('0x31')](respondWithFilteredResult(_0xbf037e,_0x157403))[_0x616a('0x4e')](handleError(_0xbf037e,null));};exports['getHopperFinals']=function(_0x5ed6ee,_0x4919a1,_0x2a2d67){var _0xf86f6f={'raw':!![],'where':{}};var _0x283f42={};var _0x18f59a={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5ed6ee[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x4919a1,null))[_0x616a('0x31')](function(_0x3c2ae7){if(_0x3c2ae7){_0x283f42[_0x616a('0x3a')]=_['keys'](db[_0x616a('0x67')][_0x616a('0x37')]);_0x283f42['query']=_[_0x616a('0x3c')](_0x5ed6ee[_0x616a('0x3b')]);_0x283f42['filters']=_[_0x616a('0x3f')](_0x283f42['model'],_0x283f42[_0x616a('0x3b')]);_0xf86f6f[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x283f42[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x5ed6ee[_0x616a('0x3b')][_0x616a('0x40')]));_0xf86f6f[_0x616a('0x3e')]=_0xf86f6f['attributes'][_0x616a('0x41')]?_0xf86f6f[_0x616a('0x3e')]:_0x283f42[_0x616a('0x3a')];if(!_0x5ed6ee[_0x616a('0x3b')]['hasOwnProperty'](_0x616a('0x42'))){_0xf86f6f[_0x616a('0x43')]=qs[_0x616a('0x43')](_0x5ed6ee['query']['limit']);_0xf86f6f[_0x616a('0x1f')]=qs[_0x616a('0x1f')](_0x5ed6ee[_0x616a('0x3b')][_0x616a('0x1f')]);}_0xf86f6f[_0x616a('0x44')]=qs['sort'](_0x5ed6ee['query'][_0x616a('0x45')]);_0xf86f6f['where']=qs[_0x616a('0x3d')](_[_0x616a('0x47')](_0x5ed6ee[_0x616a('0x3b')],_0x283f42['filters']));_0xf86f6f[_0x616a('0x46')][_0x616a('0x65')]=_0x3c2ae7['id'];if(_0x5ed6ee[_0x616a('0x3b')][_0x616a('0x2a')]){_0xf86f6f['where']=_['merge'](_0xf86f6f[_0x616a('0x46')],{'$or':_[_0x616a('0x2c')](_0xf86f6f[_0x616a('0x3e')],function(_0x4ff7b4){var _0x482354={};_0x482354[_0x4ff7b4]={'$like':'%'+_0x5ed6ee['query']['filter']+'%'};return _0x482354;})});}_0xf86f6f=_[_0x616a('0x48')]({},_0xf86f6f,_0x5ed6ee['options']);return db[_0x616a('0x67')][_0x616a('0x21')]({'where':_0xf86f6f[_0x616a('0x46')]})[_0x616a('0x31')](function(_0x4356f1){_0x18f59a[_0x616a('0x21')]=_0x4356f1;if(_0x5ed6ee[_0x616a('0x3b')]['includeAll']){_0xf86f6f[_0x616a('0x4c')]=[{'all':!![]}];}return db[_0x616a('0x67')]['findAll'](_0xf86f6f);})[_0x616a('0x31')](function(_0x5efbaf){_0x18f59a[_0x616a('0x4d')]=_0x5efbaf;return _0x18f59a;});}})[_0x616a('0x31')](respondWithFilteredResult(_0x4919a1,_0xf86f6f))[_0x616a('0x4e')](handleError(_0x4919a1,null));};exports[_0x616a('0x68')]=function(_0x398cb4,_0x64be5e,_0x36565d){var _0x200da9={'raw':!![],'where':{}};var _0x41d0c4={};var _0x48ff54={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x398cb4[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x64be5e,null))[_0x616a('0x31')](function(_0x5ef9c8){if(_0x5ef9c8){_0x41d0c4['model']=_['keys'](db[_0x616a('0x69')][_0x616a('0x37')]);_0x41d0c4[_0x616a('0x3b')]=_[_0x616a('0x3c')](_0x398cb4[_0x616a('0x3b')]);_0x41d0c4[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x41d0c4[_0x616a('0x3a')],_0x41d0c4['query']);_0x200da9[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x41d0c4[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x398cb4['query']['fields']));_0x200da9[_0x616a('0x3e')]=_0x200da9[_0x616a('0x3e')][_0x616a('0x41')]?_0x200da9[_0x616a('0x3e')]:_0x41d0c4['model'];if(!_0x398cb4[_0x616a('0x3b')][_0x616a('0x62')](_0x616a('0x42'))){_0x200da9[_0x616a('0x43')]=qs['limit'](_0x398cb4[_0x616a('0x3b')][_0x616a('0x43')]);_0x200da9[_0x616a('0x1f')]=qs[_0x616a('0x1f')](_0x398cb4[_0x616a('0x3b')][_0x616a('0x1f')]);}_0x200da9['order']=qs[_0x616a('0x45')](_0x398cb4[_0x616a('0x3b')][_0x616a('0x45')]);_0x200da9['where']=qs[_0x616a('0x3d')](_['pick'](_0x398cb4[_0x616a('0x3b')],_0x41d0c4['filters']));_0x200da9[_0x616a('0x46')][_0x616a('0x65')]=_0x5ef9c8['id'];if(_0x398cb4[_0x616a('0x3b')][_0x616a('0x2a')]){_0x200da9['where']=_[_0x616a('0x48')](_0x200da9[_0x616a('0x46')],{'$or':_[_0x616a('0x2c')](_0x200da9['attributes'],function(_0x16c033){var _0xa14da9={};_0xa14da9[_0x16c033]={'$like':'%'+_0x398cb4[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0xa14da9;})});}_0x200da9=_[_0x616a('0x48')]({},_0x200da9,_0x398cb4[_0x616a('0x5b')]);return db['CmHopperBlack']['count']({'where':_0x200da9[_0x616a('0x46')]})[_0x616a('0x31')](function(_0x392531){_0x48ff54[_0x616a('0x21')]=_0x392531;if(_0x398cb4[_0x616a('0x3b')][_0x616a('0x4b')]){_0x200da9[_0x616a('0x4c')]=[{'all':!![]}];}return db[_0x616a('0x69')][_0x616a('0x66')](_0x200da9);})['then'](function(_0x154de6){_0x48ff54[_0x616a('0x4d')]=_0x154de6;return _0x48ff54;});}})['then'](respondWithFilteredResult(_0x64be5e,_0x200da9))[_0x616a('0x4e')](handleError(_0x64be5e,null));};exports[_0x616a('0x6a')]=function(_0x2abc19,_0x19549a,_0x2aafb5){var _0x421833={};var _0x5ca011={};var _0x483d5e;var _0x2e6b9c;return db[_0x616a('0x4a')][_0x616a('0x60')]({'where':{'id':_0x2abc19[_0x616a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x19549a,null))[_0x616a('0x31')](function(_0x40a024){if(_0x40a024){_0x483d5e=_0x40a024;_0x5ca011[_0x616a('0x3a')]=_[_0x616a('0x3c')](db[_0x616a('0x6b')][_0x616a('0x37')]);_0x5ca011['query']=_[_0x616a('0x3c')](_0x2abc19[_0x616a('0x3b')]);_0x5ca011[_0x616a('0x3d')]=_['intersection'](_0x5ca011[_0x616a('0x3a')],_0x5ca011[_0x616a('0x3b')]);_0x421833['attributes']=_[_0x616a('0x3f')](_0x5ca011[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x2abc19[_0x616a('0x3b')][_0x616a('0x40')]));_0x421833[_0x616a('0x3e')]=_0x421833[_0x616a('0x3e')]['length']?_0x421833[_0x616a('0x3e')]:_0x5ca011['model'];_0x421833['order']=qs[_0x616a('0x45')](_0x2abc19[_0x616a('0x3b')]['sort']);_0x421833[_0x616a('0x46')]=qs[_0x616a('0x3d')](_['pick'](_0x2abc19['query'],_0x5ca011['filters']));if(_0x2abc19[_0x616a('0x3b')][_0x616a('0x2a')]){_0x421833[_0x616a('0x46')]=_[_0x616a('0x48')](_0x421833[_0x616a('0x46')],{'$or':_[_0x616a('0x2c')](_0x421833[_0x616a('0x3e')],function(_0xcfa87e){var _0x5c795f={};_0x5c795f[_0xcfa87e]={'$like':'%'+_0x2abc19[_0x616a('0x3b')]['filter']+'%'};return _0x5c795f;})});}_0x421833=_['merge']({},_0x421833,_0x2abc19[_0x616a('0x5b')]);return _0x483d5e['getTeams'](_0x421833);}})[_0x616a('0x31')](function(_0x32611f){if(_0x32611f){_0x2e6b9c=_0x32611f['length'];if(!_0x2abc19[_0x616a('0x3b')][_0x616a('0x62')](_0x616a('0x42'))){_0x421833[_0x616a('0x43')]=qs['limit'](_0x2abc19[_0x616a('0x3b')][_0x616a('0x43')]);_0x421833[_0x616a('0x1f')]=qs[_0x616a('0x1f')](_0x2abc19[_0x616a('0x3b')][_0x616a('0x1f')]);}return _0x483d5e[_0x616a('0x6a')](_0x421833);}})[_0x616a('0x31')](function(_0x50e3fd){if(_0x50e3fd){return _0x50e3fd?{'count':_0x2e6b9c,'rows':_0x50e3fd}:null;}})[_0x616a('0x31')](respondWithResult(_0x19549a,null))[_0x616a('0x4e')](handleError(_0x19549a,null));};exports[_0x616a('0x6c')]=function(_0x1ad319,_0x53b299,_0x1995c3){var _0x45a2a1=_0x1ad319[_0x616a('0x52')][_0x616a('0x6d')];var _0x3aec50=_[_0x616a('0x2c')](_0x45a2a1,'id');return db[_0x616a('0x6b')][_0x616a('0x66')]({'where':{'id':_0x3aec50},'attributes':['id'],'include':[{'model':db['User'],'as':_0x616a('0x6e'),'attributes':['id','name',_0x616a('0x6f'),_0x616a('0x70'),_0x616a('0x71')],'raw':!![]}]})[_0x616a('0x31')](function(_0x518838){if(_0x518838){var _0x2e42d1=_['flatMap'](_0x518838,function(_0x3bd1c8){var _0x1c934b=_0x3bd1c8['get']({'plain':!![]});_0x1c934b[_0x616a('0x6e')]['forEach'](function(_0x42c8a0){_0x42c8a0[_0x616a('0x72')]=_[_0x616a('0x50')](_0x45a2a1,{'id':_0x1c934b['id']})[_0x616a('0x72')];});return _0x1c934b[_0x616a('0x6e')];});return db['VoiceQueue'][_0x616a('0x50')]({'where':{'id':_0x1ad319[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](function(_0x584b0f){return db[_0x616a('0x73')][_0x616a('0x74')](function(_0x498eeb){return _0x584b0f[_0x616a('0x6c')](_0x3aec50,{'transaction':_0x498eeb})[_0x616a('0x31')](function(){return BPromise[_0x616a('0x75')](_0x45a2a1,function(_0x5dde4b){return db[_0x616a('0x76')][_0x616a('0x77')]({'TeamId':_0x5dde4b['id'],'VoiceQueueId':_0x1ad319[_0x616a('0x5a')]['id'],'penalty':_0x5dde4b[_0x616a('0x72')]},{'transaction':_0x498eeb});});})['then'](function(){return BPromise['each'](_0x2e42d1,function(_0x286d19){return db[_0x616a('0x78')]['findOrCreate']({'where':{'UserId':_0x286d19['id'],'VoiceQueueId':_0x1ad319[_0x616a('0x5a')]['id']},'defaults':{'penalty':_0x286d19[_0x616a('0x72')]},'transaction':_0x498eeb});});})[_0x616a('0x31')](function(){return BPromise[_0x616a('0x75')](_[_0x616a('0x2a')](_0x2e42d1,{'online':!![]}),function(_0xf6cb7f){return db['UserVoiceQueueRt'][_0x616a('0x77')]({'membername':_0xf6cb7f['name'],'UserId':_0xf6cb7f['id'],'queue_name':_0x584b0f['name'],'VoiceQueueId':_0x584b0f['id'],'interface':_[_0x616a('0x79')](_0xf6cb7f[_0x616a('0x71')])?util[_0x616a('0x7a')](_0x616a('0x7b'),_0xf6cb7f['name']):_0xf6cb7f[_0x616a('0x71')],'paused':_0xf6cb7f[_0x616a('0x70')]||![],'penalty':_0xf6cb7f['penalty']},{'transaction':_0x498eeb});});})[_0x616a('0x31')](function(){_0x2e42d1[_0x616a('0x7c')](function(_0x48e98f){socket[_0x616a('0x7d')]('userVoiceQueue:save',{'UserId':_0x48e98f['id'],'VoiceQueueId':_0x584b0f['id']});});});});});}})['then'](respondWithStatusCode(_0x53b299,null))[_0x616a('0x4e')](handleError(_0x53b299,null));};exports[_0x616a('0x7e')]=function(_0x35c412,_0xe6dffc,_0x51883e){return db[_0x616a('0x6b')][_0x616a('0x66')]({'where':{'id':_0x35c412[_0x616a('0x3b')][_0x616a('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x616a('0x80')],'as':_0x616a('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe6dffc,null))[_0x616a('0x31')](function(_0x3f6075){var _0x2da237=_['map'](_0x3f6075,'id');var _0x4e5bfe=[];var _0x5286ce=[];var _0x3e520c=squel['select']();_0x3e520c[_0x616a('0x81')](_0x616a('0x82'))['from'](_0x616a('0x83'),'tq')[_0x616a('0x84')](_0x616a('0x85'),'ut',_0x616a('0x86'))['where']('VoiceQueueId\x20=\x20?',_0x35c412[_0x616a('0x5a')]['id']);for(var _0x208ea9=0x0;_0x208ea9<_0x3f6075[_0x616a('0x41')];_0x208ea9+=0x1){let _0x360ee3=_0x3f6075[_0x208ea9];for(var _0x30c782=0x0;_0x30c782<_0x360ee3[_0x616a('0x6e')]['length'];_0x30c782+=0x1){let _0x20b629=_0x360ee3[_0x616a('0x6e')][_0x30c782];var _0x570099=_0x3e520c['clone']();_0x570099[_0x616a('0x46')](_0x616a('0x87'),_0x20b629['id']);_0x5286ce[_0x616a('0x88')](db[_0x616a('0x73')][_0x616a('0x3b')](_0x570099['toString'](),{'type':db[_0x616a('0x73')][_0x616a('0x89')][_0x616a('0x8a')]})[_0x616a('0x31')](function(_0x53de6c){if(_0x53de6c['length']===0x1){return _0x20b629['id'];}else{var _0x392269=_[_0x616a('0x8b')](_['map'](_0x53de6c,_0x616a('0x8c')),function(_0x53f229){return _[_0x616a('0x8d')](_0x2da237,_0x53f229);});if(_0x392269){return _0x20b629['id'];}}}));}}return BPromise[_0x616a('0x8e')](_0x5286ce)[_0x616a('0x31')](function(_0x4a6eaf){_0x4e5bfe=_(_0x4e5bfe)[_0x616a('0x8f')](_0x4a6eaf)[_0x616a('0x90')]()[_0x616a('0x2d')]();return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x35c412[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](function(_0x4ecd40){return db[_0x616a('0x73')]['transaction'](function(_0x22c109){return _0x4ecd40[_0x616a('0x7e')](_0x35c412['query'][_0x616a('0x7f')],{'transaction':_0x22c109})[_0x616a('0x31')](function(){if(!_[_0x616a('0x91')](_0x4e5bfe)){return _0x4ecd40[_0x616a('0x92')](_0x4e5bfe,{'transaction':_0x22c109})['then'](function(){return db[_0x616a('0x93')][_0x616a('0x30')]({'where':{'VoiceQueueId':_0x35c412['params']['id'],'UserId':_0x4e5bfe},'transaction':_0x22c109});});}})['then'](function(){_0x4e5bfe['forEach'](function(_0x2800ab){socket[_0x616a('0x7d')](_0x616a('0x94'),{'UserId':_0x2800ab,'VoiceQueueId':_0x4ecd40['id']});});});});});});})[_0x616a('0x31')](respondWithStatusCode(_0xe6dffc,null))[_0x616a('0x4e')](handleError(_0xe6dffc,null));};exports['addAgents']=function(_0x38b5be,_0x35b59,_0x5e57e2){var _0x4f22af,_0x34e937;return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x38b5be[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x35b59,null))[_0x616a('0x31')](function(_0x14bdac){if(_0x14bdac){_0x34e937=_0x14bdac;return _0x14bdac['addAgents'](_0x38b5be[_0x616a('0x52')]['ids'],_[_0x616a('0x5c')](_0x38b5be[_0x616a('0x52')],[_0x616a('0x7f'),'id'])||{})[_0x616a('0x95')](function(_0x3dd3e2){for(var _0x127519=0x0;_0x127519<_0x38b5be[_0x616a('0x52')][_0x616a('0x7f')]['length'];_0x127519+=0x1){socket[_0x616a('0x7d')]('userVoiceQueue:save',{'UserId':Number(_0x38b5be[_0x616a('0x52')][_0x616a('0x7f')][_0x127519]),'VoiceQueueId':Number(_0x38b5be[_0x616a('0x5a')]['id'])});}return _0x3dd3e2;});}})[_0x616a('0x31')](function(_0x45060c){_0x4f22af=_0x45060c||[];if(_0x34e937){return db[_0x616a('0x80')][_0x616a('0x66')]({'where':{'id':_0x38b5be[_0x616a('0x52')]['ids']},'attributes':['id',_0x616a('0x35'),_0x616a('0x6f'),_0x616a('0x70'),'interface'],'raw':!![]});}})[_0x616a('0x31')](function(_0x1c6f3e){if(!_[_0x616a('0x91')](_0x1c6f3e)){var _0x379b80=[];for(var _0x2afddd=0x0;_0x2afddd<_0x1c6f3e[_0x616a('0x41')];_0x2afddd++){if(_0x1c6f3e[_0x2afddd][_0x616a('0x6f')]){_0x379b80['push'](db[_0x616a('0x93')]['upsert']({'membername':_0x1c6f3e[_0x2afddd]['name'],'UserId':_0x1c6f3e[_0x2afddd]['id'],'queue_name':_0x34e937[_0x616a('0x35')],'VoiceQueueId':_0x34e937['id'],'interface':_['isNil'](_0x1c6f3e[_0x2afddd]['interface'])?util[_0x616a('0x7a')]('SIP/%s',_0x1c6f3e[_0x2afddd][_0x616a('0x35')]):_0x1c6f3e[_0x2afddd][_0x616a('0x71')],'paused':_0x1c6f3e[_0x2afddd][_0x616a('0x70')]||![],'penalty':_0x38b5be[_0x616a('0x52')][_0x616a('0x72')]||0x0}));}}return BPromise[_0x616a('0x8e')](_0x379b80);}})[_0x616a('0x31')](function(){return _0x4f22af;})[_0x616a('0x31')](respondWithResult(_0x35b59,null))[_0x616a('0x4e')](handleError(_0x35b59,null));};exports[_0x616a('0x92')]=function(_0x462151,_0x4c2579,_0x1654cf){return db['VoiceQueue']['find']({'where':{'id':_0x462151['params']['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x4c2579,null))[_0x616a('0x31')](function(_0x5e456d){if(_0x5e456d){return _0x5e456d['removeAgents'](_0x462151[_0x616a('0x3b')][_0x616a('0x7f')])[_0x616a('0x31')](function(){if(_[_0x616a('0x96')](_0x462151[_0x616a('0x3b')][_0x616a('0x7f')])){for(var _0x336da9=0x0;_0x336da9<_0x462151[_0x616a('0x3b')]['ids'][_0x616a('0x41')];_0x336da9+=0x1){socket['emit'](_0x616a('0x94'),{'UserId':Number(_0x462151[_0x616a('0x3b')][_0x616a('0x7f')][_0x336da9]),'VoiceQueueId':Number(_0x462151['params']['id'])});}}else{socket[_0x616a('0x7d')](_0x616a('0x94'),{'UserId':Number(_0x462151[_0x616a('0x3b')]['ids']),'VoiceQueueId':Number(_0x462151[_0x616a('0x5a')]['id'])});}});}})[_0x616a('0x31')](function(_0x19403a){return db[_0x616a('0x93')]['destroy']({'where':{'VoiceQueueId':_0x462151[_0x616a('0x5a')]['id'],'UserId':_0x462151[_0x616a('0x3b')][_0x616a('0x7f')]}})[_0x616a('0x31')](function(){return _0x19403a;});})['then'](respondWithStatusCode(_0x4c2579,null))[_0x616a('0x4e')](handleError(_0x4c2579,null));};exports[_0x616a('0x97')]=function(_0x522155,_0x33290e,_0x42c760){var _0x3485e7={};var _0x29023c={};var _0x3a75b9;var _0x55b501;return db['VoiceQueue'][_0x616a('0x60')]({'where':{'id':_0x522155['params']['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x33290e,null))[_0x616a('0x31')](function(_0x3c4b14){if(_0x3c4b14){_0x3a75b9=_0x3c4b14;_0x29023c[_0x616a('0x3a')]=_[_0x616a('0x3c')](db[_0x616a('0x80')][_0x616a('0x37')]);_0x29023c[_0x616a('0x3b')]=_['keys'](_0x522155[_0x616a('0x3b')]);_0x29023c[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x29023c[_0x616a('0x3a')],_0x29023c['query']);_0x3485e7['attributes']=_[_0x616a('0x3f')](_0x29023c[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x522155['query'][_0x616a('0x40')]));_0x3485e7['attributes']=_0x3485e7[_0x616a('0x3e')][_0x616a('0x41')]?_0x3485e7['attributes']:_0x29023c['model'];_0x3485e7['order']=qs['sort'](_0x522155[_0x616a('0x3b')]['sort']);_0x3485e7[_0x616a('0x46')]=qs[_0x616a('0x3d')](_['pick'](_0x522155[_0x616a('0x3b')],_0x29023c[_0x616a('0x3d')]));if(_0x522155[_0x616a('0x3b')][_0x616a('0x2a')]){_0x3485e7[_0x616a('0x46')]=_['merge'](_0x3485e7[_0x616a('0x46')],{'$or':_[_0x616a('0x2c')](_0x3485e7[_0x616a('0x3e')],function(_0x57e35a){var _0x6ae2c1={};_0x6ae2c1[_0x57e35a]={'$like':'%'+_0x522155[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x6ae2c1;})});}_0x3485e7=_['merge']({},_0x3485e7,_0x522155['options']);return _0x3a75b9[_0x616a('0x97')](_0x3485e7);}})[_0x616a('0x31')](function(_0xc473c6){if(_0xc473c6){_0x55b501=_0xc473c6[_0x616a('0x41')];if(!_0x522155[_0x616a('0x3b')][_0x616a('0x62')](_0x616a('0x42'))){_0x3485e7[_0x616a('0x43')]=qs['limit'](_0x522155['query'][_0x616a('0x43')]);_0x3485e7[_0x616a('0x1f')]=qs['offset'](_0x522155[_0x616a('0x3b')]['offset']);}return _0x3a75b9[_0x616a('0x97')](_0x3485e7);}})[_0x616a('0x31')](function(_0x171de1){if(_0x171de1){return _0x171de1?{'count':_0x55b501,'rows':_0x171de1}:null;}})['then'](respondWithResult(_0x33290e,null))['catch'](handleError(_0x33290e,null));};exports[_0x616a('0x98')]=function(_0x533ad9,_0x3a2cad,_0x50e2b2){var _0x1a3e70={};var _0x12f2f3={};var _0x427f44;var _0x50b6ff;return db[_0x616a('0x4a')][_0x616a('0x60')]({'where':{'id':_0x533ad9[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x3a2cad,null))['then'](function(_0x202f5d){if(_0x202f5d){_0x427f44=_0x202f5d;_0x12f2f3[_0x616a('0x3a')]=_['keys'](db[_0x616a('0x93')]['rawAttributes']);_0x12f2f3[_0x616a('0x3b')]=_['keys'](_0x533ad9[_0x616a('0x3b')]);_0x12f2f3[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x12f2f3['model'],_0x12f2f3[_0x616a('0x3b')]);_0x1a3e70['attributes']=_['intersection'](_0x12f2f3[_0x616a('0x3a')],qs[_0x616a('0x40')](_0x533ad9[_0x616a('0x3b')]['fields']));_0x1a3e70['attributes']=_0x1a3e70['attributes'][_0x616a('0x41')]?_0x1a3e70['attributes']:_0x12f2f3[_0x616a('0x3a')];_0x1a3e70[_0x616a('0x44')]=qs[_0x616a('0x45')](_0x533ad9[_0x616a('0x3b')]['sort']);_0x1a3e70[_0x616a('0x46')]=qs['filters'](_['pick'](_0x533ad9[_0x616a('0x3b')],_0x12f2f3[_0x616a('0x3d')]));if(_0x533ad9['query']['filter']){_0x1a3e70[_0x616a('0x46')]=_[_0x616a('0x48')](_0x1a3e70[_0x616a('0x46')],{'$or':_['map'](_0x1a3e70[_0x616a('0x3e')],function(_0x1fcb15){var _0x300eee={};_0x300eee[_0x1fcb15]={'$like':'%'+_0x533ad9[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x300eee;})});}_0x1a3e70=_[_0x616a('0x48')]({},_0x1a3e70,_0x533ad9[_0x616a('0x5b')]);return _0x427f44[_0x616a('0x98')](_0x1a3e70);}})[_0x616a('0x31')](function(_0x3a202e){if(_0x3a202e){_0x50b6ff=_0x3a202e[_0x616a('0x41')];if(!_0x533ad9['query'][_0x616a('0x62')](_0x616a('0x42'))){_0x1a3e70['limit']=qs[_0x616a('0x43')](_0x533ad9['query'][_0x616a('0x43')]);_0x1a3e70[_0x616a('0x1f')]=qs['offset'](_0x533ad9[_0x616a('0x3b')][_0x616a('0x1f')]);}return _0x427f44['getMembers'](_0x1a3e70);}})[_0x616a('0x31')](function(_0x457fc8){return _0x457fc8?{'count':_0x50b6ff,'rows':_0x457fc8}:null;})[_0x616a('0x31')](respondWithResult(_0x3a2cad,null))[_0x616a('0x4e')](handleError(_0x3a2cad,null));};exports[_0x616a('0x99')]=function(_0x828b34,_0x428ecd,_0x46fd81){var _0x18e79c={};var _0x4ebd63={};var _0x105505;var _0x36f7c7;return db[_0x616a('0x4a')][_0x616a('0x60')]({'where':{'id':_0x828b34[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x428ecd,null))[_0x616a('0x31')](function(_0x5d572c){if(_0x5d572c){_0x105505=_0x5d572c;_0x4ebd63['model']=_[_0x616a('0x3c')](db['CmList']['rawAttributes']);_0x4ebd63[_0x616a('0x3b')]=_[_0x616a('0x3c')](_0x828b34[_0x616a('0x3b')]);_0x4ebd63[_0x616a('0x3d')]=_[_0x616a('0x3f')](_0x4ebd63[_0x616a('0x3a')],_0x4ebd63[_0x616a('0x3b')]);_0x18e79c[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x4ebd63['model'],qs[_0x616a('0x40')](_0x828b34[_0x616a('0x3b')][_0x616a('0x40')]));_0x18e79c[_0x616a('0x3e')]=_0x18e79c['attributes'][_0x616a('0x41')]?_0x18e79c[_0x616a('0x3e')]:_0x4ebd63['model'];_0x18e79c[_0x616a('0x44')]=qs[_0x616a('0x45')](_0x828b34['query']['sort']);_0x18e79c[_0x616a('0x46')]=qs['filters'](_[_0x616a('0x47')](_0x828b34[_0x616a('0x3b')],_0x4ebd63['filters']));if(_0x828b34[_0x616a('0x3b')][_0x616a('0x2a')]){_0x18e79c[_0x616a('0x46')]=_[_0x616a('0x48')](_0x18e79c['where'],{'$or':_['map'](_0x18e79c['attributes'],function(_0x330045){var _0x134656={};_0x134656[_0x330045]={'$like':'%'+_0x828b34[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x134656;})});}_0x18e79c=_[_0x616a('0x48')]({},_0x18e79c,_0x828b34['options']);return _0x105505[_0x616a('0x99')](_0x18e79c);}})['then'](function(_0x53bed9){if(_0x53bed9){_0x36f7c7=_0x53bed9[_0x616a('0x41')];if(!_0x828b34['query'][_0x616a('0x62')](_0x616a('0x42'))){_0x18e79c[_0x616a('0x43')]=qs[_0x616a('0x43')](_0x828b34[_0x616a('0x3b')][_0x616a('0x43')]);_0x18e79c[_0x616a('0x1f')]=qs[_0x616a('0x1f')](_0x828b34['query'][_0x616a('0x1f')]);}return _0x105505[_0x616a('0x99')](_0x18e79c);}})['then'](function(_0x6033ce){if(_0x6033ce){return _0x6033ce?{'count':_0x36f7c7,'rows':_0x6033ce}:null;}})[_0x616a('0x31')](respondWithResult(_0x428ecd,null))[_0x616a('0x4e')](handleError(_0x428ecd,null));};exports['addLists']=function(_0x283d05,_0x3b48d1,_0x4abaef){var _0x1ea549=moment()[_0x616a('0x7a')](_0x616a('0x9a'));var _0x50a885,_0x18ca77;return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x283d05[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x3b48d1,null))[_0x616a('0x31')](function(_0x3d3ba1){if(_0x3d3ba1){_0x18ca77=_0x3d3ba1;return _0x3d3ba1[_0x616a('0x9b')](_0x283d05[_0x616a('0x52')][_0x616a('0x7f')],_['omit'](_0x283d05['body'],[_0x616a('0x7f'),'id'])||{});}return null;})[_0x616a('0x95')](function(_0x43d552){var _0x2843cd;_0x50a885=_0x43d552||[];var _0x2e5ed0=[];if(_0x43d552){for(var _0x1949bb=0x0;_0x1949bb<_0x43d552[_0x616a('0x41')];_0x1949bb+=0x1){var _0x2997b5=_0x43d552[_0x1949bb]['get']({'plain':!![]});_0x18ca77[_0x616a('0x9c')]=_0x283d05['body'][_0x616a('0x9c')]?_0x283d05['body'][_0x616a('0x9c')]:_0x18ca77[_0x616a('0x9c')];switch(_0x18ca77[_0x616a('0x9c')]){case _0x616a('0x9d'):_0x2843cd=squel[_0x616a('0x9e')]()[_0x616a('0x9f')](_0x616a('0xa0'))['fromQuery']([_0x616a('0xa1'),'scheduledAt',_0x616a('0xa2'),_0x616a('0xa3'),_0x616a('0x65'),_0x616a('0x5e'),_0x616a('0x5d')],squel['select']()[_0x616a('0x81')](_0x616a('0xa1'),_0x616a('0xa1'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27','scheduledAt')[_0x616a('0x81')]('id',_0x616a('0xa2'))[_0x616a('0x81')](_0x2997b5[_0x616a('0xa4')]['toString'](),_0x616a('0xa3'))[_0x616a('0x81')](_0x283d05['params']['id']['toString'](),'VoiceQueueId')[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0x5e'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0x5d'))[_0x616a('0xa5')]('cm_contacts')[_0x616a('0x46')](_0x616a('0xa6'))[_0x616a('0x46')]('ListId\x20=\x20?',_0x2997b5[_0x616a('0xa4')][_0x616a('0xa7')]())[_0x616a('0x46')](_0x616a('0xa8'))[_0x616a('0x46')](_0x616a('0xa9'),squel[_0x616a('0xaa')]()[_0x616a('0x81')]('COALESCE(calleridnum,\x27\x27)')[_0x616a('0xa5')](_0x616a('0xab'))['where']('VoiceQueueId\x20=\x20?',_0x283d05[_0x616a('0x5a')]['id']['toString']()))[_0x616a('0x46')](_0x616a('0xa9'),squel[_0x616a('0xaa')]()[_0x616a('0x81')](_0x616a('0xac'))['from'](_0x616a('0xa0'))[_0x616a('0x46')](_0x616a('0xad'),_0x283d05[_0x616a('0x5a')]['id']['toString']())))[_0x616a('0xa7')]();break;case'onlyIfOpen':_0x2843cd=squel[_0x616a('0x9e')]()['into'](_0x616a('0xa0'))[_0x616a('0xae')]([_0x616a('0xa1'),_0x616a('0xaf'),'ContactId',_0x616a('0xa3'),'VoiceQueueId',_0x616a('0x5e'),_0x616a('0x5d')],squel[_0x616a('0xaa')]()['field'](_0x616a('0xa1'),_0x616a('0xa1'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0xaf'))[_0x616a('0x81')]('id',_0x616a('0xa2'))[_0x616a('0x81')](_0x2997b5['CmListId'][_0x616a('0xa7')](),_0x616a('0xa3'))[_0x616a('0x81')](_0x283d05[_0x616a('0x5a')]['id']['toString'](),'VoiceQueueId')[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0x5e'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0x5d'))[_0x616a('0xa5')]('cm_contacts')[_0x616a('0x46')](_0x616a('0xa6'))['where']('ListId\x20=\x20?',_0x2997b5[_0x616a('0xa4')][_0x616a('0xa7')]())[_0x616a('0x46')](_0x616a('0xa8'))[_0x616a('0x46')](_0x616a('0xa9'),squel[_0x616a('0xaa')]()['field'](_0x616a('0xac'))['from'](_0x616a('0xa0'))[_0x616a('0x46')](_0x616a('0xad'),_0x283d05[_0x616a('0x5a')]['id']['toString']())))['toString']();break;default:_0x2843cd=squel['insert']()[_0x616a('0x9f')](_0x616a('0xa0'))[_0x616a('0xae')]([_0x616a('0xa1'),_0x616a('0xaf'),_0x616a('0xa2'),_0x616a('0xa3'),'VoiceQueueId','createdAt',_0x616a('0x5d')],squel[_0x616a('0xaa')]()[_0x616a('0x81')](_0x616a('0xa1'),_0x616a('0xa1'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27','scheduledAt')[_0x616a('0x81')]('id','ContactId')[_0x616a('0x81')](_0x2997b5['CmListId']['toString'](),_0x616a('0xa3'))[_0x616a('0x81')](_0x283d05['params']['id'][_0x616a('0xa7')](),_0x616a('0x65'))['field']('\x27'+_0x1ea549+'\x27',_0x616a('0x5e'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27',_0x616a('0x5d'))[_0x616a('0xa5')]('cm_contacts')['where'](_0x616a('0xa6'))['where'](_0x616a('0xb0'),_0x2997b5[_0x616a('0xa4')][_0x616a('0xa7')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x616a('0xa7')]();}_0x2e5ed0[_0x616a('0x88')](db[_0x616a('0x73')][_0x616a('0x3b')](_0x2843cd));}return BPromise[_0x616a('0x8e')](_0x2e5ed0);}})[_0x616a('0x31')](function(){var _0x8c40cc=[];var _0xbbb0b0=squel[_0x616a('0x9e')]()[_0x616a('0x9f')](_0x616a('0xb1'))[_0x616a('0xae')](['CmHopperId',_0x616a('0xa1'),_0x616a('0xb2'),_0x616a('0x5e'),_0x616a('0x5d')],squel[_0x616a('0xaa')]()['field']('h.id')[_0x616a('0x81')]('ci.item')[_0x616a('0x81')](_0x616a('0xb3'))[_0x616a('0x81')]('\x27'+_0x1ea549+'\x27','createdAt')['field']('\x27'+_0x1ea549+'\x27','updatedAt')[_0x616a('0xa5')]('cm_contact_has_items','ci')[_0x616a('0x84')](_0x616a('0xa0'),'h',_0x616a('0xb4'))[_0x616a('0x46')](_0x616a('0xb5'),_0x1ea549)[_0x616a('0x46')](_0x616a('0xb6'),_0x616a('0xb7')))[_0x616a('0xa7')]();_0x8c40cc[_0x616a('0x88')](db['sequelize'][_0x616a('0x3b')](_0xbbb0b0));return BPromise['all'](_0x8c40cc);})['then'](function(){return _0x50a885;})[_0x616a('0x31')](respondWithResult(_0x3b48d1,null))[_0x616a('0x4e')](handleError(_0x3b48d1,null));};exports['removeLists']=function(_0x224b61,_0x55b725,_0x31d0b6){return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x224b61[_0x616a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x55b725,null))['then'](function(_0x332ccb){if(_0x332ccb){return _0x332ccb['removeLists'](_0x224b61[_0x616a('0x3b')][_0x616a('0x7f')]);}})[_0x616a('0x31')](function(_0x4193ee){if(_0x4193ee){return db[_0x616a('0x61')]['destroy']({'where':{'ListId':_0x224b61[_0x616a('0x3b')]['ids'],'VoiceQueueId':_0x224b61[_0x616a('0x5a')]['id']}})[_0x616a('0x31')](function(){return _0x4193ee;});}})[_0x616a('0x31')](respondWithStatusCode(_0x55b725,null))[_0x616a('0x4e')](handleError(_0x55b725,null));};exports[_0x616a('0xb8')]=function(_0x154d4a,_0x38c2f8,_0x194584){var _0x57b469={};var _0x2ccb78={};var _0x297301;var _0x4341c8;return db[_0x616a('0x4a')][_0x616a('0x60')]({'where':{'id':_0x154d4a[_0x616a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x38c2f8,null))['then'](function(_0x18af30){if(_0x18af30){_0x297301=_0x18af30;_0x2ccb78[_0x616a('0x3a')]=_[_0x616a('0x3c')](db['CmList'][_0x616a('0x37')]);_0x2ccb78[_0x616a('0x3b')]=_[_0x616a('0x3c')](_0x154d4a[_0x616a('0x3b')]);_0x2ccb78['filters']=_[_0x616a('0x3f')](_0x2ccb78['model'],_0x2ccb78[_0x616a('0x3b')]);_0x57b469[_0x616a('0x3e')]=_[_0x616a('0x3f')](_0x2ccb78[_0x616a('0x3a')],qs['fields'](_0x154d4a[_0x616a('0x3b')][_0x616a('0x40')]));_0x57b469[_0x616a('0x3e')]=_0x57b469[_0x616a('0x3e')][_0x616a('0x41')]?_0x57b469[_0x616a('0x3e')]:_0x2ccb78[_0x616a('0x3a')];_0x57b469['order']=qs[_0x616a('0x45')](_0x154d4a['query'][_0x616a('0x45')]);_0x57b469[_0x616a('0x46')]=qs[_0x616a('0x3d')](_['pick'](_0x154d4a['query'],_0x2ccb78[_0x616a('0x3d')]));if(_0x154d4a['query'][_0x616a('0x2a')]){_0x57b469[_0x616a('0x46')]=_[_0x616a('0x48')](_0x57b469['where'],{'$or':_[_0x616a('0x2c')](_0x57b469[_0x616a('0x3e')],function(_0x1e672c){var _0x807cd9={};_0x807cd9[_0x1e672c]={'$like':'%'+_0x154d4a[_0x616a('0x3b')][_0x616a('0x2a')]+'%'};return _0x807cd9;})});}_0x57b469=_[_0x616a('0x48')]({},_0x57b469,_0x154d4a[_0x616a('0x5b')]);return _0x297301[_0x616a('0xb8')](_0x57b469);}})[_0x616a('0x31')](function(_0x3c94f5){if(_0x3c94f5){_0x4341c8=_0x3c94f5[_0x616a('0x41')];if(!_0x154d4a[_0x616a('0x3b')]['hasOwnProperty'](_0x616a('0x42'))){_0x57b469['limit']=qs[_0x616a('0x43')](_0x154d4a[_0x616a('0x3b')][_0x616a('0x43')]);_0x57b469['offset']=qs['offset'](_0x154d4a['query']['offset']);}return _0x297301[_0x616a('0xb8')](_0x57b469);}})['then'](function(_0x44ef33){if(_0x44ef33){return _0x44ef33?{'count':_0x4341c8,'rows':_0x44ef33}:null;}})[_0x616a('0x31')](respondWithResult(_0x38c2f8,null))[_0x616a('0x4e')](handleError(_0x38c2f8,null));};exports[_0x616a('0xb9')]=function(_0x3eb2ee,_0x2da708,_0x331fc0){var _0x43592c,_0xb8ebfb;return db[_0x616a('0x4a')][_0x616a('0x50')]({'where':{'id':_0x3eb2ee['params']['id']}})[_0x616a('0x31')](handleEntityNotFound(_0x2da708,null))[_0x616a('0x31')](function(_0x249300){if(_0x249300){_0xb8ebfb=_0x249300;return _0x249300[_0x616a('0xb9')](_0x3eb2ee[_0x616a('0x52')][_0x616a('0x7f')],_[_0x616a('0x5c')](_0x3eb2ee['body'],['ids','id'])||{});}return null;})[_0x616a('0x95')](function(_0x14286d){var _0x240e69;_0x43592c=_0x14286d||[];var _0x3cab52=[];if(_0x14286d){for(var _0xafe413=0x0;_0xafe413<_0x14286d['length'];_0xafe413+=0x1){var _0x1c3925=_0x14286d[_0xafe413][_0x616a('0x26')]({'plain':!![]});_0x240e69=squel[_0x616a('0x9e')]()[_0x616a('0x9f')](_0x616a('0xba'))[_0x616a('0xae')]([_0x616a('0xa1'),_0x616a('0xa2'),_0x616a('0xa3'),_0x616a('0x65'),'createdAt',_0x616a('0x5d')],squel[_0x616a('0xaa')]()['field']('phone',_0x616a('0xa1'))[_0x616a('0x81')]('id',_0x616a('0xa2'))[_0x616a('0x81')](_0x1c3925[_0x616a('0xa4')][_0x616a('0xa7')](),_0x616a('0xa3'))[_0x616a('0x81')](_0x3eb2ee[_0x616a('0x5a')]['id'][_0x616a('0xa7')](),_0x616a('0x65'))[_0x616a('0x81')]('NOW()',_0x616a('0x5e'))[_0x616a('0x81')]('NOW()',_0x616a('0x5d'))[_0x616a('0xa5')](_0x616a('0xbb'))['where'](_0x616a('0xa6'))[_0x616a('0x46')](_0x616a('0xb0'),_0x1c3925[_0x616a('0xa4')]['toString']())['where'](_0x616a('0xa8')))[_0x616a('0xa7')]();_0x3cab52[_0x616a('0x88')](db[_0x616a('0x73')][_0x616a('0x3b')](_0x240e69));}return BPromise[_0x616a('0x8e')](_0x3cab52);}})[_0x616a('0x31')](function(){return _0x43592c;})[_0x616a('0x31')](respondWithResult(_0x2da708,null))[_0x616a('0x4e')](handleError(_0x2da708,null));};exports[_0x616a('0xbc')]=function(_0x1325fb,_0xe661ea,_0x2def5b){return db['VoiceQueue'][_0x616a('0x50')]({'where':{'id':_0x1325fb['params']['id']}})[_0x616a('0x31')](handleEntityNotFound(_0xe661ea,null))[_0x616a('0x31')](function(_0x3c38a0){if(_0x3c38a0){return _0x3c38a0[_0x616a('0xbc')](_0x1325fb['query']['ids']);}})['then'](function(_0x294012){if(_0x294012){return db['CmHopperBlack'][_0x616a('0x30')]({'where':{'ListId':_0x1325fb[_0x616a('0x3b')][_0x616a('0x7f')],'VoiceQueueId':_0x1325fb['params']['id']}})[_0x616a('0x31')](function(){return _0x294012;});}})[_0x616a('0x31')](respondWithStatusCode(_0xe661ea,null))['catch'](handleError(_0xe661ea,null));}; \ No newline at end of file +var _0x88b0=['addTeams','teams','Team','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','removeAgents','forEach','addAgents','spread','format','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','reject','then','destroy','get','inbound','QueueCampaigns','outbound','map','value','includes','type','find','name','UserProfileResource','stack','index','VoiceQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x88b0,0x1cb));var _0x088b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x88b0[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x088b('0x0'));var rimraf=require(_0x088b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x088b('0x2'));var moment=require(_0x088b('0x3'));var BPromise=require(_0x088b('0x4'));var Mustache=require(_0x088b('0x5'));var util=require('util');var path=require(_0x088b('0x6'));var sox=require(_0x088b('0x7'));var csv=require(_0x088b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x088b('0x9'));var squel=require(_0x088b('0xa'));var crypto=require(_0x088b('0xb'));var jsforce=require(_0x088b('0xc'));var deskjs=require(_0x088b('0xd'));var toCsv=require(_0x088b('0x8'));var querystring=require(_0x088b('0xe'));var Papa=require('papaparse');var Redis=require(_0x088b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088b('0x11'));var logger=require(_0x088b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x088b('0x13'));var licenseUtil=require(_0x088b('0x14'));var db=require(_0x088b('0x15'))['db'];config['redis']=_[_0x088b('0x16')](config[_0x088b('0x17')],{'host':_0x088b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x088b('0x17')]));require(_0x088b('0x19'))[_0x088b('0x1a')](socket);function respondWithStatusCode(_0xf6bd53,_0x1ec5e5){_0x1ec5e5=_0x1ec5e5||0xcc;return function(_0x3d659d){if(_0x3d659d){return _0xf6bd53[_0x088b('0x1b')](_0x1ec5e5);}return _0xf6bd53['status'](_0x1ec5e5)[_0x088b('0x1c')]();};}function respondWithResult(_0x1c1096,_0x458b47){_0x458b47=_0x458b47||0xc8;return function(_0xdee68a){if(_0xdee68a){return _0x1c1096[_0x088b('0x1d')](_0x458b47)[_0x088b('0x1e')](_0xdee68a);}};}function respondWithFilteredResult(_0x54a27e,_0x331cb0){return function(_0x3ce059){if(_0x3ce059){var _0x135e00=typeof _0x331cb0[_0x088b('0x1f')]===_0x088b('0x20')&&typeof _0x331cb0['limit']==='undefined';var _0x35e006=_0x3ce059[_0x088b('0x21')];var _0x12e3ac=_0x135e00?0x0:_0x331cb0[_0x088b('0x1f')];var _0x3c9c1d=_0x135e00?_0x3ce059[_0x088b('0x21')]:_0x331cb0['offset']+_0x331cb0[_0x088b('0x22')];var _0x293604;if(_0x3c9c1d>=_0x35e006){_0x3c9c1d=_0x35e006;_0x293604=0xc8;}else{_0x293604=0xce;}_0x54a27e[_0x088b('0x1d')](_0x293604);return _0x54a27e['set']('Content-Range',_0x12e3ac+'-'+_0x3c9c1d+'/'+_0x35e006)[_0x088b('0x1e')](_0x3ce059);}return null;};}function patchUpdates(_0x1db300){return function(_0x587bad){try{jsonpatch['apply'](_0x587bad,_0x1db300,!![]);}catch(_0x187350){return BPromise[_0x088b('0x23')](_0x187350);}return _0x587bad['save']();};}function saveUpdates(_0x4b4d3f,_0x48bbaa){return function(_0x282156){if(_0x282156){return _0x282156['update'](_0x4b4d3f)[_0x088b('0x24')](function(_0x4178d0){return _0x4178d0;});}return null;};}function removeEntity(_0x8f18b7,_0x2c551f){return function(_0x43ee2e){if(_0x43ee2e){return _0x43ee2e[_0x088b('0x25')]()['then'](function(){var _0x339eb9=_0x43ee2e[_0x088b('0x26')]({'plain':!![]});var _0x3da9e1=[{'name':'VoiceQueues','value':_0x088b('0x27'),'ignore':![]},{'name':_0x088b('0x28'),'value':_0x088b('0x29'),'ignore':![]}];var _0x3ed176=_(_0x3da9e1)['filter']('ignore')[_0x088b('0x2a')](_0x088b('0x2b'))[_0x088b('0x2b')]();if(_[_0x088b('0x2c')](_0x3ed176,_0x339eb9[_0x088b('0x2d')])){return;}var _0x4f17f9=_[_0x088b('0x2e')](_0x3da9e1,[_0x088b('0x2b'),_0x339eb9[_0x088b('0x2d')]])[_0x088b('0x2f')];return db[_0x088b('0x30')]['destroy']({'where':{'type':_0x4f17f9,'resourceId':_0x339eb9['id']}})[_0x088b('0x24')](function(){return _0x43ee2e;});})[_0x088b('0x24')](function(){_0x8f18b7[_0x088b('0x1d')](0xcc)[_0x088b('0x1c')]();});}};}function handleEntityNotFound(_0x124bb6,_0x296ffa){return function(_0x13f87f){if(!_0x13f87f){_0x124bb6[_0x088b('0x1b')](0x194);}return _0x13f87f;};}function handleError(_0x1fff93,_0x17f4bc){_0x17f4bc=_0x17f4bc||0x1f4;return function(_0x46c0c0){logger['error'](_0x46c0c0[_0x088b('0x31')]);if(_0x46c0c0[_0x088b('0x2f')]){delete _0x46c0c0[_0x088b('0x2f')];}_0x1fff93[_0x088b('0x1d')](_0x17f4bc)['send'](_0x46c0c0);};}exports[_0x088b('0x32')]=function(_0x5a7a9f,_0x213b0e){var _0x59a607={},_0x572e24={},_0x172edc={'count':0x0,'rows':[]};var _0x38f851=_[_0x088b('0x2a')](db[_0x088b('0x33')][_0x088b('0x34')],function(_0x1e3700){return{'name':_0x1e3700['fieldName'],'type':_0x1e3700[_0x088b('0x2d')][_0x088b('0x35')]};});_0x572e24[_0x088b('0x36')]=_['map'](_0x38f851,_0x088b('0x2f'));_0x572e24[_0x088b('0x37')]=_['keys'](_0x5a7a9f[_0x088b('0x37')]);_0x572e24[_0x088b('0x38')]=_[_0x088b('0x39')](_0x572e24[_0x088b('0x36')],_0x572e24['query']);_0x59a607[_0x088b('0x3a')]=_['intersection'](_0x572e24[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5a7a9f[_0x088b('0x37')]['fields']));_0x59a607[_0x088b('0x3a')]=_0x59a607['attributes'][_0x088b('0x3c')]?_0x59a607[_0x088b('0x3a')]:_0x572e24[_0x088b('0x36')];if(!_0x5a7a9f[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x59a607[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x5a7a9f['query'][_0x088b('0x22')]);_0x59a607[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5a7a9f['query'][_0x088b('0x1f')]);}_0x59a607[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5a7a9f['query']['sort']);_0x59a607['where']=qs['filters'](_[_0x088b('0x41')](_0x5a7a9f[_0x088b('0x37')],_0x572e24[_0x088b('0x38')]),_0x38f851);if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]){_0x59a607[_0x088b('0x43')]=_['merge'](_0x59a607[_0x088b('0x43')],{'$or':_['map'](_0x38f851,function(_0x5c8cb3){if(_0x5c8cb3['type']!=='VIRTUAL'){var _0x2cb360={};_0x2cb360[_0x5c8cb3[_0x088b('0x2f')]]={'$like':'%'+_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x2cb360;}})});}_0x59a607=_[_0x088b('0x44')]({},_0x59a607,_0x5a7a9f[_0x088b('0x45')]);var _0x3aa0bc={'where':_0x59a607[_0x088b('0x43')]};return db[_0x088b('0x33')][_0x088b('0x21')](_0x3aa0bc)[_0x088b('0x24')](function(_0x55be78){_0x172edc[_0x088b('0x21')]=_0x55be78;if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x46')]){_0x59a607[_0x088b('0x47')]=[{'all':!![]}];}return db['VoiceQueue'][_0x088b('0x48')](_0x59a607);})['then'](function(_0x2153c7){_0x172edc[_0x088b('0x49')]=_0x2153c7;return _0x172edc;})[_0x088b('0x24')](respondWithFilteredResult(_0x213b0e,_0x59a607))['catch'](handleError(_0x213b0e,null));};exports[_0x088b('0x4a')]=function(_0x31b3fc,_0x266e8b){var _0x1dbf16={'raw':![],'where':{'id':_0x31b3fc[_0x088b('0x4b')]['id']}},_0x3dc19b={};_0x3dc19b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x3dc19b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x31b3fc[_0x088b('0x37')]);_0x3dc19b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x3dc19b[_0x088b('0x36')],_0x3dc19b[_0x088b('0x37')]);_0x1dbf16[_0x088b('0x3a')]=_['intersection'](_0x3dc19b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x31b3fc[_0x088b('0x37')][_0x088b('0x3b')]));_0x1dbf16['attributes']=_0x1dbf16[_0x088b('0x3a')][_0x088b('0x3c')]?_0x1dbf16[_0x088b('0x3a')]:_0x3dc19b['model'];if(_0x31b3fc[_0x088b('0x37')]['includeAll']){_0x1dbf16['include']=[{'all':!![]}];}_0x1dbf16=_[_0x088b('0x44')]({},_0x1dbf16,_0x31b3fc[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x1dbf16)[_0x088b('0x24')](handleEntityNotFound(_0x266e8b,null))[_0x088b('0x24')](respondWithResult(_0x266e8b,null))[_0x088b('0x4d')](handleError(_0x266e8b,null));};exports['create']=function(_0x409db7,_0x30d235){return db['VoiceQueue'][_0x088b('0x4e')](_0x409db7[_0x088b('0x4f')],{})[_0x088b('0x24')](function(_0x2d9e32){var _0x12d063=_0x409db7[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x12d063)throw new Error(_0x088b('0x51'));if(_0x12d063[_0x088b('0x52')]===_0x088b('0x50')){var _0x316ab4=_0x2d9e32['get']({'plain':!![]});var _0x5ec1f1=[{'name':_0x088b('0x53'),'value':'inbound'},{'name':_0x088b('0x28'),'value':_0x088b('0x29')}];var _0x99fbd6=_[_0x088b('0x2e')](_0x5ec1f1,[_0x088b('0x2b'),_0x316ab4[_0x088b('0x2d')]])['name'];return db[_0x088b('0x54')][_0x088b('0x2e')]({'where':{'name':_0x99fbd6,'userProfileId':_0x12d063[_0x088b('0x55')]},'raw':!![]})['then'](function(_0x118e13){if(_0x118e13&&_0x118e13[_0x088b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x316ab4[_0x088b('0x2f')],'resourceId':_0x316ab4['id'],'type':_0x118e13[_0x088b('0x2f')],'sectionId':_0x118e13['id']},{})[_0x088b('0x24')](function(){return _0x2d9e32;});}else{return _0x2d9e32;}})['catch'](function(_0x26c7b9){logger[_0x088b('0x57')](_0x088b('0x58'),_0x26c7b9);throw _0x26c7b9;});}return _0x2d9e32;})[_0x088b('0x24')](respondWithResult(_0x30d235,0xc9))[_0x088b('0x4d')](handleError(_0x30d235,null));};exports[_0x088b('0x59')]=function(_0x151a66,_0x46e33c){var _0x289a3b={'where':{'id':_0x151a66[_0x088b('0x4b')]['id']}},_0x333066={};_0x333066[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x289a3b[_0x088b('0x3a')]=_['intersection'](_0x333066['model'],qs['fields'](_0x151a66[_0x088b('0x37')][_0x088b('0x3b')]));_0x289a3b[_0x088b('0x3a')]=_0x289a3b['attributes']['length']?_0x289a3b[_0x088b('0x3a')]:_0x333066[_0x088b('0x36')];if(_0x151a66[_0x088b('0x37')][_0x088b('0x46')]){_0x289a3b[_0x088b('0x47')]=[{'all':!![]}];}_0x289a3b=_[_0x088b('0x44')]({},_0x289a3b,_0x151a66[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x289a3b)[_0x088b('0x24')](handleEntityNotFound(_0x46e33c,null))[_0x088b('0x24')](function(_0x33ff98){if(_0x33ff98){var _0x2496da=_0x33ff98['get']({'plain':!![]});_0x2496da=qs[_0x088b('0x5a')](_0x2496da,['id','createdAt',_0x088b('0x5b')]);_0x151a66['body']=_[_0x088b('0x5a')](_0x151a66['body'],['id',_0x088b('0x5c'),_0x088b('0x5b')]);return db[_0x088b('0x33')][_0x088b('0x4e')](_[_0x088b('0x44')](_0x2496da,_0x151a66['body']),{'include':_0x151a66[_0x088b('0x37')][_0x088b('0x46')]?[{'all':!![]}]:undefined})[_0x088b('0x24')](function(_0x5b2935){var _0x3ad76b=_0x151a66[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x3ad76b)throw new Error(_0x088b('0x51'));if(_0x3ad76b[_0x088b('0x52')]===_0x088b('0x50')){var _0x429e7d=_0x5b2935['get']({'plain':!![]});var _0x181e0a=[{'name':_0x088b('0x53'),'value':_0x088b('0x27')},{'name':_0x088b('0x28'),'value':'outbound'}];var _0x228a8d=_[_0x088b('0x2e')](_0x181e0a,[_0x088b('0x2b'),_0x429e7d[_0x088b('0x2d')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x228a8d,'userProfileId':_0x3ad76b[_0x088b('0x55')]},'raw':!![]})[_0x088b('0x24')](function(_0x1b98ce){if(_0x1b98ce&&_0x1b98ce['autoAssociation']===0x0){return db[_0x088b('0x30')]['create']({'name':_0x429e7d['name'],'resourceId':_0x429e7d['id'],'type':_0x1b98ce[_0x088b('0x2f')],'sectionId':_0x1b98ce['id']},{})[_0x088b('0x24')](function(){return _0x5b2935;});}else{return _0x5b2935;}})['catch'](function(_0x20484c){logger[_0x088b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20484c);throw _0x20484c;});}return _0x5b2935;});}})[_0x088b('0x24')](respondWithResult(_0x46e33c,0xc9))['catch'](handleError(_0x46e33c,null));};exports[_0x088b('0x5d')]=function(_0x255632,_0x35b07a){if(_0x255632[_0x088b('0x4f')]['id']){delete _0x255632['body']['id'];}return db[_0x088b('0x33')]['find']({'where':{'id':_0x255632[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x35b07a,null))[_0x088b('0x24')](saveUpdates(_0x255632['body'],null))[_0x088b('0x24')](respondWithResult(_0x35b07a,null))['catch'](handleError(_0x35b07a,null));};exports['destroy']=function(_0x1bd60d,_0x2387cd){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1bd60d['params']['id']}})['then'](handleEntityNotFound(_0x2387cd,null))['then'](removeEntity(_0x2387cd,null))[_0x088b('0x4d')](handleError(_0x2387cd,null));};exports[_0x088b('0x5e')]=function(_0x406e94,_0x2e726e,_0x10ecfb){var _0x3cc35f={'raw':![],'where':{}};var _0x24c6e7={};var _0x4ea258={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x406e94['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2e726e,null))['then'](function(_0x1d0a90){if(_0x1d0a90){_0x24c6e7[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x60')][_0x088b('0x34')]);_0x24c6e7[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x406e94[_0x088b('0x37')]);_0x24c6e7[_0x088b('0x38')]=_[_0x088b('0x39')](_0x24c6e7[_0x088b('0x36')],_0x24c6e7['query']);_0x3cc35f[_0x088b('0x3a')]=_['intersection'](_0x24c6e7['model'],qs['fields'](_0x406e94[_0x088b('0x37')][_0x088b('0x3b')]));_0x3cc35f[_0x088b('0x3a')]=_0x3cc35f[_0x088b('0x3a')][_0x088b('0x3c')]?_0x3cc35f['attributes']:_0x24c6e7['model'];if(!_0x406e94[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x3cc35f['limit']=qs[_0x088b('0x22')](_0x406e94[_0x088b('0x37')]['limit']);_0x3cc35f[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x406e94[_0x088b('0x37')][_0x088b('0x1f')]);}_0x3cc35f[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x406e94[_0x088b('0x37')][_0x088b('0x40')]);_0x3cc35f[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x406e94[_0x088b('0x37')],_0x24c6e7[_0x088b('0x38')]));_0x3cc35f[_0x088b('0x43')][_0x088b('0x61')]=_0x1d0a90['id'];if(_0x406e94[_0x088b('0x37')][_0x088b('0x42')]){_0x3cc35f[_0x088b('0x43')]=_[_0x088b('0x44')](_0x3cc35f[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x3cc35f[_0x088b('0x3a')],function(_0x4a297f){var _0x4b3f78={};_0x4b3f78[_0x4a297f]={'$like':'%'+_0x406e94['query'][_0x088b('0x42')]+'%'};return _0x4b3f78;})});}_0x3cc35f=_[_0x088b('0x44')]({},_0x3cc35f,_0x406e94[_0x088b('0x45')]);return db[_0x088b('0x60')][_0x088b('0x21')]({'where':_0x3cc35f[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x2cade3){_0x4ea258[_0x088b('0x21')]=_0x2cade3;if(_0x406e94[_0x088b('0x37')][_0x088b('0x46')]){_0x3cc35f[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x088b('0x48')](_0x3cc35f);})['then'](function(_0x48af4a){_0x4ea258[_0x088b('0x49')]=_0x48af4a;return _0x4ea258;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x2e726e,_0x3cc35f))['catch'](handleError(_0x2e726e,null));};exports[_0x088b('0x62')]=function(_0x3dd39b,_0x3b8e17,_0x1dfed6){var _0xedd84={'raw':!![],'where':{}};var _0x34841b={};var _0x30e553={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x3dd39b[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b8e17,null))[_0x088b('0x24')](function(_0x162350){if(_0x162350){_0x34841b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x63')][_0x088b('0x34')]);_0x34841b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x3dd39b[_0x088b('0x37')]);_0x34841b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],_0x34841b[_0x088b('0x37')]);_0xedd84[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x3dd39b['query']['fields']));_0xedd84[_0x088b('0x3a')]=_0xedd84['attributes'][_0x088b('0x3c')]?_0xedd84[_0x088b('0x3a')]:_0x34841b[_0x088b('0x36')];if(!_0x3dd39b[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0xedd84[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x3dd39b['query'][_0x088b('0x22')]);_0xedd84['offset']=qs[_0x088b('0x1f')](_0x3dd39b['query'][_0x088b('0x1f')]);}_0xedd84[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x3dd39b[_0x088b('0x37')]['sort']);_0xedd84[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x3dd39b['query'],_0x34841b[_0x088b('0x38')]));_0xedd84['where']['VoiceQueueId']=_0x162350['id'];if(_0x3dd39b[_0x088b('0x37')]['filter']){_0xedd84[_0x088b('0x43')]=_[_0x088b('0x44')](_0xedd84[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0xedd84['attributes'],function(_0x3be504){var _0x3e6399={};_0x3e6399[_0x3be504]={'$like':'%'+_0x3dd39b[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3e6399;})});}_0xedd84=_[_0x088b('0x44')]({},_0xedd84,_0x3dd39b[_0x088b('0x45')]);return db[_0x088b('0x63')][_0x088b('0x21')]({'where':_0xedd84[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x503737){_0x30e553[_0x088b('0x21')]=_0x503737;if(_0x3dd39b[_0x088b('0x37')][_0x088b('0x46')]){_0xedd84[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x088b('0x48')](_0xedd84);})[_0x088b('0x24')](function(_0x392ed3){_0x30e553[_0x088b('0x49')]=_0x392ed3;return _0x30e553;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x3b8e17,_0xedd84))[_0x088b('0x4d')](handleError(_0x3b8e17,null));};exports[_0x088b('0x64')]=function(_0x118f0c,_0x4c7693,_0x5c54c6){var _0x56b40c={'raw':!![],'where':{}};var _0x14f011={};var _0x29d3c7={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x118f0c['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x4c7693,null))[_0x088b('0x24')](function(_0x2cbac7){if(_0x2cbac7){_0x14f011[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x65')]['rawAttributes']);_0x14f011[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x118f0c[_0x088b('0x37')]);_0x14f011[_0x088b('0x38')]=_['intersection'](_0x14f011[_0x088b('0x36')],_0x14f011[_0x088b('0x37')]);_0x56b40c['attributes']=_[_0x088b('0x39')](_0x14f011['model'],qs[_0x088b('0x3b')](_0x118f0c[_0x088b('0x37')][_0x088b('0x3b')]));_0x56b40c[_0x088b('0x3a')]=_0x56b40c[_0x088b('0x3a')][_0x088b('0x3c')]?_0x56b40c[_0x088b('0x3a')]:_0x14f011[_0x088b('0x36')];if(!_0x118f0c[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x56b40c['limit']=qs[_0x088b('0x22')](_0x118f0c['query'][_0x088b('0x22')]);_0x56b40c[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x118f0c[_0x088b('0x37')][_0x088b('0x1f')]);}_0x56b40c[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x118f0c[_0x088b('0x37')][_0x088b('0x40')]);_0x56b40c['where']=qs['filters'](_[_0x088b('0x41')](_0x118f0c[_0x088b('0x37')],_0x14f011[_0x088b('0x38')]));_0x56b40c[_0x088b('0x43')][_0x088b('0x61')]=_0x2cbac7['id'];if(_0x118f0c['query'][_0x088b('0x42')]){_0x56b40c[_0x088b('0x43')]=_[_0x088b('0x44')](_0x56b40c['where'],{'$or':_[_0x088b('0x2a')](_0x56b40c[_0x088b('0x3a')],function(_0x199244){var _0x8f2c44={};_0x8f2c44[_0x199244]={'$like':'%'+_0x118f0c[_0x088b('0x37')]['filter']+'%'};return _0x8f2c44;})});}_0x56b40c=_['merge']({},_0x56b40c,_0x118f0c[_0x088b('0x45')]);return db['CmHopperFinal'][_0x088b('0x21')]({'where':_0x56b40c['where']})[_0x088b('0x24')](function(_0x195d45){_0x29d3c7[_0x088b('0x21')]=_0x195d45;if(_0x118f0c['query']['includeAll']){_0x56b40c['include']=[{'all':!![]}];}return db[_0x088b('0x65')][_0x088b('0x48')](_0x56b40c);})['then'](function(_0x451e38){_0x29d3c7[_0x088b('0x49')]=_0x451e38;return _0x29d3c7;});}})['then'](respondWithFilteredResult(_0x4c7693,_0x56b40c))[_0x088b('0x4d')](handleError(_0x4c7693,null));};exports[_0x088b('0x66')]=function(_0x5adbbe,_0x525706,_0x4c47f1){var _0x3b1a0b={'raw':!![],'where':{}};var _0x20ad09={};var _0xf8109={'count':0x0,'rows':[]};return db[_0x088b('0x33')]['findOne']({'where':{'id':_0x5adbbe[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x525706,null))[_0x088b('0x24')](function(_0x2751ba){if(_0x2751ba){_0x20ad09[_0x088b('0x36')]=_['keys'](db[_0x088b('0x67')][_0x088b('0x34')]);_0x20ad09[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x5adbbe[_0x088b('0x37')]);_0x20ad09['filters']=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],_0x20ad09[_0x088b('0x37')]);_0x3b1a0b[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5adbbe[_0x088b('0x37')]['fields']));_0x3b1a0b[_0x088b('0x3a')]=_0x3b1a0b['attributes'][_0x088b('0x3c')]?_0x3b1a0b['attributes']:_0x20ad09[_0x088b('0x36')];if(!_0x5adbbe['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x3b1a0b[_0x088b('0x22')]=qs['limit'](_0x5adbbe['query']['limit']);_0x3b1a0b[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5adbbe['query'][_0x088b('0x1f')]);}_0x3b1a0b[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5adbbe[_0x088b('0x37')]['sort']);_0x3b1a0b[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x5adbbe['query'],_0x20ad09[_0x088b('0x38')]));_0x3b1a0b[_0x088b('0x43')][_0x088b('0x61')]=_0x2751ba['id'];if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]){_0x3b1a0b['where']=_['merge'](_0x3b1a0b['where'],{'$or':_['map'](_0x3b1a0b[_0x088b('0x3a')],function(_0x47262b){var _0x3dee93={};_0x3dee93[_0x47262b]={'$like':'%'+_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3dee93;})});}_0x3b1a0b=_[_0x088b('0x44')]({},_0x3b1a0b,_0x5adbbe[_0x088b('0x45')]);return db['CmHopperBlack'][_0x088b('0x21')]({'where':_0x3b1a0b['where']})[_0x088b('0x24')](function(_0xb90164){_0xf8109[_0x088b('0x21')]=_0xb90164;if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x46')]){_0x3b1a0b[_0x088b('0x47')]=[{'all':!![]}];}return db[_0x088b('0x67')][_0x088b('0x48')](_0x3b1a0b);})[_0x088b('0x24')](function(_0x1d0f7d){_0xf8109[_0x088b('0x49')]=_0x1d0f7d;return _0xf8109;});}})['then'](respondWithFilteredResult(_0x525706,_0x3b1a0b))[_0x088b('0x4d')](handleError(_0x525706,null));};exports[_0x088b('0x68')]=function(_0x18b7b5,_0x1f44f1,_0x1de83){var _0x27cc10={};var _0x249451={};var _0x4e69fd;var _0x25cd56;return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x18b7b5[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x1f44f1,null))[_0x088b('0x24')](function(_0x388373){if(_0x388373){_0x4e69fd=_0x388373;_0x249451[_0x088b('0x36')]=_[_0x088b('0x4c')](db['Team'][_0x088b('0x34')]);_0x249451[_0x088b('0x37')]=_['keys'](_0x18b7b5[_0x088b('0x37')]);_0x249451[_0x088b('0x38')]=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],_0x249451[_0x088b('0x37')]);_0x27cc10['attributes']=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x18b7b5[_0x088b('0x37')]['fields']));_0x27cc10[_0x088b('0x3a')]=_0x27cc10[_0x088b('0x3a')][_0x088b('0x3c')]?_0x27cc10[_0x088b('0x3a')]:_0x249451[_0x088b('0x36')];_0x27cc10[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x40')]);_0x27cc10[_0x088b('0x43')]=qs[_0x088b('0x38')](_['pick'](_0x18b7b5[_0x088b('0x37')],_0x249451[_0x088b('0x38')]));if(_0x18b7b5[_0x088b('0x37')][_0x088b('0x42')]){_0x27cc10[_0x088b('0x43')]=_[_0x088b('0x44')](_0x27cc10[_0x088b('0x43')],{'$or':_['map'](_0x27cc10[_0x088b('0x3a')],function(_0x5dc63c){var _0x21cd5a={};_0x21cd5a[_0x5dc63c]={'$like':'%'+_0x18b7b5['query'][_0x088b('0x42')]+'%'};return _0x21cd5a;})});}_0x27cc10=_[_0x088b('0x44')]({},_0x27cc10,_0x18b7b5['options']);return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x2ed071){if(_0x2ed071){_0x25cd56=_0x2ed071['length'];if(!_0x18b7b5['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x27cc10['limit']=qs['limit'](_0x18b7b5[_0x088b('0x37')][_0x088b('0x22')]);_0x27cc10['offset']=qs[_0x088b('0x1f')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x4bbd7d){if(_0x4bbd7d){return _0x4bbd7d?{'count':_0x25cd56,'rows':_0x4bbd7d}:null;}})['then'](respondWithResult(_0x1f44f1,null))['catch'](handleError(_0x1f44f1,null));};exports[_0x088b('0x69')]=function(_0x1483b6,_0x1d9c64,_0x539bd3){var _0x5c75ea=_0x1483b6['body'][_0x088b('0x6a')];var _0x514106=_[_0x088b('0x2a')](_0x5c75ea,'id');return db[_0x088b('0x6b')]['findAll']({'where':{'id':_0x514106},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':'Agents','attributes':['id','name',_0x088b('0x6d'),_0x088b('0x6e'),_0x088b('0x6f')],'raw':!![]}]})[_0x088b('0x24')](function(_0x57ead5){if(_0x57ead5){var _0x29eeaf=_[_0x088b('0x70')](_0x57ead5,function(_0x58a0e6){var _0x42f94a=_0x58a0e6[_0x088b('0x26')]({'plain':!![]});_0x42f94a[_0x088b('0x71')]['forEach'](function(_0x5cbc9d){_0x5cbc9d[_0x088b('0x72')]=_[_0x088b('0x2e')](_0x5c75ea,{'id':_0x42f94a['id']})[_0x088b('0x72')];});return _0x42f94a['Agents'];});return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1483b6[_0x088b('0x4b')]['id']}})['then'](function(_0x9c3501){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x2e82e9){return _0x9c3501[_0x088b('0x69')](_0x514106,{'transaction':_0x2e82e9})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_0x5c75ea,function(_0x5b7b2e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x5b7b2e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id'],'penalty':_0x5b7b2e[_0x088b('0x72')]},{'transaction':_0x2e82e9});});})['then'](function(){return BPromise[_0x088b('0x75')](_0x29eeaf,function(_0x4e248e){return db['UserVoiceQueue'][_0x088b('0x76')]({'where':{'UserId':_0x4e248e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id']},'defaults':{'penalty':_0x4e248e[_0x088b('0x72')]},'transaction':_0x2e82e9});});})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_[_0x088b('0x42')](_0x29eeaf,{'online':!![]}),function(_0x13717f){return db[_0x088b('0x77')][_0x088b('0x78')]({'membername':_0x13717f['name'],'UserId':_0x13717f['id'],'queue_name':_0x9c3501['name'],'VoiceQueueId':_0x9c3501['id'],'interface':_[_0x088b('0x79')](_0x13717f[_0x088b('0x6f')])?util['format'](_0x088b('0x7a'),_0x13717f[_0x088b('0x2f')]):_0x13717f[_0x088b('0x6f')],'paused':_0x13717f[_0x088b('0x6e')]||![],'penalty':_0x13717f['penalty']},{'transaction':_0x2e82e9});});})['then'](function(){_0x29eeaf['forEach'](function(_0x3465d6){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':_0x3465d6['id'],'VoiceQueueId':_0x9c3501['id']});});});});});}})[_0x088b('0x24')](respondWithStatusCode(_0x1d9c64,null))[_0x088b('0x4d')](handleError(_0x1d9c64,null));};exports['removeTeams']=function(_0x55e165,_0xc99d64,_0x1e11ca){return db[_0x088b('0x6b')][_0x088b('0x48')]({'where':{'id':_0x55e165['query'][_0x088b('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':_0x088b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x088b('0x24')](handleEntityNotFound(_0xc99d64,null))[_0x088b('0x24')](function(_0x4e9679){var _0x2f022d=_['map'](_0x4e9679,'id');var _0x5590a3=[];var _0x1b2f26=[];var _0x270d6c=squel[_0x088b('0x7e')]();_0x270d6c[_0x088b('0x7f')](_0x088b('0x80'))[_0x088b('0x81')](_0x088b('0x82'),'tq')[_0x088b('0x83')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x088b('0x43')]('VoiceQueueId\x20=\x20?',_0x55e165[_0x088b('0x4b')]['id']);for(var _0x136109=0x0;_0x136109<_0x4e9679[_0x088b('0x3c')];_0x136109+=0x1){let _0x160f2a=_0x4e9679[_0x136109];for(var _0x5b570d=0x0;_0x5b570d<_0x160f2a[_0x088b('0x71')][_0x088b('0x3c')];_0x5b570d+=0x1){let _0x363227=_0x160f2a[_0x088b('0x71')][_0x5b570d];var _0x12bd5e=_0x270d6c[_0x088b('0x59')]();_0x12bd5e[_0x088b('0x43')](_0x088b('0x84'),_0x363227['id']);_0x1b2f26[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x12bd5e['toString'](),{'type':db['sequelize'][_0x088b('0x86')][_0x088b('0x87')]})[_0x088b('0x24')](function(_0x36755b){if(_0x36755b[_0x088b('0x3c')]===0x1){return _0x363227['id'];}else{var _0xff60c5=_['every'](_[_0x088b('0x2a')](_0x36755b,_0x088b('0x88')),function(_0x473c76){return _[_0x088b('0x2c')](_0x2f022d,_0x473c76);});if(_0xff60c5){return _0x363227['id'];}}}));}}return BPromise[_0x088b('0x89')](_0x1b2f26)[_0x088b('0x24')](function(_0xf59f24){_0x5590a3=_(_0x5590a3)[_0x088b('0x8a')](_0xf59f24)[_0x088b('0x8b')]()[_0x088b('0x2b')]();return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x55e165[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(_0x25ac59){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x5aa732){return _0x25ac59['removeTeams'](_0x55e165['query'][_0x088b('0x7d')],{'transaction':_0x5aa732})[_0x088b('0x24')](function(){if(!_['isEmpty'](_0x5590a3)){return _0x25ac59[_0x088b('0x8c')](_0x5590a3,{'transaction':_0x5aa732})[_0x088b('0x24')](function(){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x55e165[_0x088b('0x4b')]['id'],'UserId':_0x5590a3},'transaction':_0x5aa732});});}})[_0x088b('0x24')](function(){_0x5590a3[_0x088b('0x8d')](function(_0x5dc854){socket[_0x088b('0x7b')]('userVoiceQueue:remove',{'UserId':_0x5dc854,'VoiceQueueId':_0x25ac59['id']});});});});});});})[_0x088b('0x24')](respondWithStatusCode(_0xc99d64,null))[_0x088b('0x4d')](handleError(_0xc99d64,null));};exports[_0x088b('0x8e')]=function(_0x6b8fb1,_0x3ed607,_0x47c2f5){var _0x27fbca,_0x831e;return db[_0x088b('0x33')]['find']({'where':{'id':_0x6b8fb1['params']['id']}})['then'](handleEntityNotFound(_0x3ed607,null))[_0x088b('0x24')](function(_0x42601a){if(_0x42601a){_0x831e=_0x42601a;return _0x42601a[_0x088b('0x8e')](_0x6b8fb1[_0x088b('0x4f')]['ids'],_['omit'](_0x6b8fb1[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{})[_0x088b('0x8f')](function(_0x16948b){for(var _0x18c2f4=0x0;_0x18c2f4<_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')][_0x088b('0x3c')];_0x18c2f4+=0x1){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':Number(_0x6b8fb1['body'][_0x088b('0x7d')][_0x18c2f4]),'VoiceQueueId':Number(_0x6b8fb1[_0x088b('0x4b')]['id'])});}return _0x16948b;});}})[_0x088b('0x24')](function(_0x58a9a5){_0x27fbca=_0x58a9a5||[];if(_0x831e){return db[_0x088b('0x6c')][_0x088b('0x48')]({'where':{'id':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')]},'attributes':['id',_0x088b('0x2f'),_0x088b('0x6d'),'voicePause',_0x088b('0x6f')],'raw':!![]});}})[_0x088b('0x24')](function(_0x246914){if(!_['isEmpty'](_0x246914)){var _0x1e3ec2=[];for(var _0x553fc0=0x0;_0x553fc0<_0x246914[_0x088b('0x3c')];_0x553fc0++){if(_0x246914[_0x553fc0]['online']){_0x1e3ec2[_0x088b('0x85')](db['UserVoiceQueueRt'][_0x088b('0x78')]({'membername':_0x246914[_0x553fc0]['name'],'UserId':_0x246914[_0x553fc0]['id'],'queue_name':_0x831e['name'],'VoiceQueueId':_0x831e['id'],'interface':_[_0x088b('0x79')](_0x246914[_0x553fc0][_0x088b('0x6f')])?util[_0x088b('0x90')](_0x088b('0x7a'),_0x246914[_0x553fc0][_0x088b('0x2f')]):_0x246914[_0x553fc0][_0x088b('0x6f')],'paused':_0x246914[_0x553fc0][_0x088b('0x6e')]||![],'penalty':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x72')]||0x0}));}}return BPromise[_0x088b('0x89')](_0x1e3ec2);}})[_0x088b('0x24')](function(){return _0x27fbca;})[_0x088b('0x24')](respondWithResult(_0x3ed607,null))[_0x088b('0x4d')](handleError(_0x3ed607,null));};exports[_0x088b('0x8c')]=function(_0x214947,_0x53fe94,_0x444cb6){return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x214947[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53fe94,null))[_0x088b('0x24')](function(_0x2a2532){if(_0x2a2532){return _0x2a2532['removeAgents'](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])[_0x088b('0x24')](function(){if(_[_0x088b('0x91')](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])){for(var _0x250787=0x0;_0x250787<_0x214947[_0x088b('0x37')]['ids'][_0x088b('0x3c')];_0x250787+=0x1){socket['emit'](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')][_0x250787]),'VoiceQueueId':Number(_0x214947[_0x088b('0x4b')]['id'])});}}else{socket[_0x088b('0x7b')](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')]),'VoiceQueueId':Number(_0x214947['params']['id'])});}});}})[_0x088b('0x24')](function(_0x19955d){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x214947['params']['id'],'UserId':_0x214947[_0x088b('0x37')]['ids']}})[_0x088b('0x24')](function(){return _0x19955d;});})[_0x088b('0x24')](respondWithStatusCode(_0x53fe94,null))[_0x088b('0x4d')](handleError(_0x53fe94,null));};exports[_0x088b('0x93')]=function(_0x29a112,_0x27bf16,_0x316497){var _0x901fe3={};var _0x387fac={};var _0x2f7a4c;var _0x361401;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x29a112[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x27bf16,null))[_0x088b('0x24')](function(_0x212cdb){if(_0x212cdb){_0x2f7a4c=_0x212cdb;_0x387fac[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x6c')][_0x088b('0x34')]);_0x387fac[_0x088b('0x37')]=_['keys'](_0x29a112[_0x088b('0x37')]);_0x387fac[_0x088b('0x38')]=_['intersection'](_0x387fac['model'],_0x387fac['query']);_0x901fe3[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x387fac[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x29a112[_0x088b('0x37')][_0x088b('0x3b')]));_0x901fe3[_0x088b('0x3a')]=_0x901fe3['attributes'][_0x088b('0x3c')]?_0x901fe3[_0x088b('0x3a')]:_0x387fac[_0x088b('0x36')];_0x901fe3[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x29a112[_0x088b('0x37')][_0x088b('0x40')]);_0x901fe3[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x29a112['query'],_0x387fac[_0x088b('0x38')]));if(_0x29a112[_0x088b('0x37')][_0x088b('0x42')]){_0x901fe3[_0x088b('0x43')]=_[_0x088b('0x44')](_0x901fe3[_0x088b('0x43')],{'$or':_['map'](_0x901fe3[_0x088b('0x3a')],function(_0x1a8df5){var _0xb0fa12={};_0xb0fa12[_0x1a8df5]={'$like':'%'+_0x29a112['query'][_0x088b('0x42')]+'%'};return _0xb0fa12;})});}_0x901fe3=_[_0x088b('0x44')]({},_0x901fe3,_0x29a112[_0x088b('0x45')]);return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x244e7f){if(_0x244e7f){_0x361401=_0x244e7f[_0x088b('0x3c')];if(!_0x29a112[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x901fe3[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x29a112[_0x088b('0x37')]['limit']);_0x901fe3[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x29a112[_0x088b('0x37')]['offset']);}return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x3a78bf){if(_0x3a78bf){return _0x3a78bf?{'count':_0x361401,'rows':_0x3a78bf}:null;}})[_0x088b('0x24')](respondWithResult(_0x27bf16,null))['catch'](handleError(_0x27bf16,null));};exports[_0x088b('0x94')]=function(_0x132915,_0x3dc68c,_0x461937){var _0x2258ed={};var _0x119e15={};var _0x4759ab;var _0x5dd5aa;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x132915[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3dc68c,null))[_0x088b('0x24')](function(_0x4a8642){if(_0x4a8642){_0x4759ab=_0x4a8642;_0x119e15['model']=_[_0x088b('0x4c')](db[_0x088b('0x77')]['rawAttributes']);_0x119e15[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x132915['query']);_0x119e15[_0x088b('0x38')]=_[_0x088b('0x39')](_0x119e15['model'],_0x119e15[_0x088b('0x37')]);_0x2258ed[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x119e15[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x132915[_0x088b('0x37')][_0x088b('0x3b')]));_0x2258ed[_0x088b('0x3a')]=_0x2258ed[_0x088b('0x3a')][_0x088b('0x3c')]?_0x2258ed[_0x088b('0x3a')]:_0x119e15[_0x088b('0x36')];_0x2258ed['order']=qs[_0x088b('0x40')](_0x132915[_0x088b('0x37')][_0x088b('0x40')]);_0x2258ed[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x132915['query'],_0x119e15[_0x088b('0x38')]));if(_0x132915[_0x088b('0x37')][_0x088b('0x42')]){_0x2258ed['where']=_[_0x088b('0x44')](_0x2258ed[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x2258ed[_0x088b('0x3a')],function(_0x12013c){var _0x18e831={};_0x18e831[_0x12013c]={'$like':'%'+_0x132915['query'][_0x088b('0x42')]+'%'};return _0x18e831;})});}_0x2258ed=_[_0x088b('0x44')]({},_0x2258ed,_0x132915[_0x088b('0x45')]);return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x51eb91){if(_0x51eb91){_0x5dd5aa=_0x51eb91[_0x088b('0x3c')];if(!_0x132915[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x2258ed[_0x088b('0x22')]=qs['limit'](_0x132915[_0x088b('0x37')][_0x088b('0x22')]);_0x2258ed[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x132915['query']['offset']);}return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x110fb8){return _0x110fb8?{'count':_0x5dd5aa,'rows':_0x110fb8}:null;})[_0x088b('0x24')](respondWithResult(_0x3dc68c,null))[_0x088b('0x4d')](handleError(_0x3dc68c,null));};exports[_0x088b('0x95')]=function(_0x2b4bbe,_0x2d5f08,_0x1fcfa8){var _0x1500ba={};var _0x14d87d={};var _0x17258f;var _0x22c53a;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x2b4bbe[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2d5f08,null))[_0x088b('0x24')](function(_0x260235){if(_0x260235){_0x17258f=_0x260235;_0x14d87d[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x96')][_0x088b('0x34')]);_0x14d87d[_0x088b('0x37')]=_['keys'](_0x2b4bbe[_0x088b('0x37')]);_0x14d87d[_0x088b('0x38')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],_0x14d87d[_0x088b('0x37')]);_0x1500ba[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x3b')]));_0x1500ba['attributes']=_0x1500ba['attributes'][_0x088b('0x3c')]?_0x1500ba[_0x088b('0x3a')]:_0x14d87d[_0x088b('0x36')];_0x1500ba[_0x088b('0x3f')]=qs['sort'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x40')]);_0x1500ba[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x2b4bbe[_0x088b('0x37')],_0x14d87d['filters']));if(_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]){_0x1500ba[_0x088b('0x43')]=_[_0x088b('0x44')](_0x1500ba[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x1500ba[_0x088b('0x3a')],function(_0x37e0fa){var _0x565723={};_0x565723[_0x37e0fa]={'$like':'%'+_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x565723;})});}_0x1500ba=_[_0x088b('0x44')]({},_0x1500ba,_0x2b4bbe[_0x088b('0x45')]);return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x4d68ef){if(_0x4d68ef){_0x22c53a=_0x4d68ef[_0x088b('0x3c')];if(!_0x2b4bbe[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x1500ba['limit']=qs['limit'](_0x2b4bbe['query'][_0x088b('0x22')]);_0x1500ba['offset']=qs['offset'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x3da9f7){if(_0x3da9f7){return _0x3da9f7?{'count':_0x22c53a,'rows':_0x3da9f7}:null;}})[_0x088b('0x24')](respondWithResult(_0x2d5f08,null))['catch'](handleError(_0x2d5f08,null));};exports['addLists']=function(_0xcec66f,_0x46d0c6,_0x52a461){var _0x4546f6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x299d3d,_0x5a2cdc;return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0xcec66f['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x46d0c6,null))[_0x088b('0x24')](function(_0x43af00){if(_0x43af00){_0x5a2cdc=_0x43af00;return _0x43af00[_0x088b('0x97')](_0xcec66f[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0xcec66f[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x5e5162){var _0xa3a341;_0x299d3d=_0x5e5162||[];var _0x4f521d=[];if(_0x5e5162){for(var _0x4077a2=0x0;_0x4077a2<_0x5e5162['length'];_0x4077a2+=0x1){var _0x5aa1a2=_0x5e5162[_0x4077a2][_0x088b('0x26')]({'plain':!![]});_0x5a2cdc[_0x088b('0x98')]=_0xcec66f[_0x088b('0x4f')]['dialCheckDuplicateType']?_0xcec66f[_0x088b('0x4f')][_0x088b('0x98')]:_0x5a2cdc['dialCheckDuplicateType'];switch(_0x5a2cdc[_0x088b('0x98')]){case _0x088b('0x99'):_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id','ContactId')[_0x088b('0x7f')](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2['CmListId'][_0x088b('0xa0')]())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa5'))['from'](_0x088b('0xa6'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]()))[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()['field'](_0x088b('0xa8'))[_0x088b('0x81')](_0x088b('0xa9'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f['params']['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;case _0x088b('0xaa'):_0xa3a341=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x088b('0x9e'),_0x088b('0xab'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),'createdAt',_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('phone',_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),'ListId')[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa8'))[_0x088b('0x81')]('cm_hopper')['where'](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;default:_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xa9'))['fromQuery']([_0x088b('0x9e'),'scheduledAt','ContactId',_0x088b('0x9d'),'VoiceQueueId',_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0xab'))[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f['params']['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4f521d['push'](db['sequelize'][_0x088b('0x37')](_0xa3a341));}return BPromise[_0x088b('0x89')](_0x4f521d);}})['then'](function(){var _0x3dfa80=[];var _0x55cc74=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xac'))['fromQuery']([_0x088b('0xad'),_0x088b('0x9e'),_0x088b('0xae'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('h.id')[_0x088b('0x7f')](_0x088b('0xaf'))['field'](_0x088b('0xb0'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','updatedAt')[_0x088b('0x81')](_0x088b('0xb1'),'ci')['join'](_0x088b('0xa9'),'h','h.ContactId=ci.CmContactId')[_0x088b('0x43')](_0x088b('0xb2'),_0x4546f6)[_0x088b('0x43')]('ci.ItemClass=?',_0x088b('0xb3')))[_0x088b('0xa0')]();_0x3dfa80['push'](db[_0x088b('0x73')]['query'](_0x55cc74));return BPromise[_0x088b('0x89')](_0x3dfa80);})[_0x088b('0x24')](function(){return _0x299d3d;})[_0x088b('0x24')](respondWithResult(_0x46d0c6,null))['catch'](handleError(_0x46d0c6,null));};exports[_0x088b('0xb4')]=function(_0x2bb3ba,_0x395ed0,_0x3db304){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x2bb3ba[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x395ed0,null))[_0x088b('0x24')](function(_0x32b9e2){if(_0x32b9e2){return _0x32b9e2[_0x088b('0xb4')](_0x2bb3ba[_0x088b('0x37')]['ids']);}})[_0x088b('0x24')](function(_0x598c86){if(_0x598c86){return db[_0x088b('0x60')]['destroy']({'where':{'ListId':_0x2bb3ba['query'][_0x088b('0x7d')],'VoiceQueueId':_0x2bb3ba[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(){return _0x598c86;});}})['then'](respondWithStatusCode(_0x395ed0,null))['catch'](handleError(_0x395ed0,null));};exports[_0x088b('0xb5')]=function(_0x4979b7,_0x43732f,_0x3df719){var _0x741eec={};var _0x383b52={};var _0x3beb37;var _0x536038;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x4979b7[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x43732f,null))['then'](function(_0x29c794){if(_0x29c794){_0x3beb37=_0x29c794;_0x383b52[_0x088b('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x383b52[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x4979b7[_0x088b('0x37')]);_0x383b52[_0x088b('0x38')]=_[_0x088b('0x39')](_0x383b52['model'],_0x383b52[_0x088b('0x37')]);_0x741eec[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x383b52[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x4979b7[_0x088b('0x37')][_0x088b('0x3b')]));_0x741eec['attributes']=_0x741eec[_0x088b('0x3a')]['length']?_0x741eec[_0x088b('0x3a')]:_0x383b52[_0x088b('0x36')];_0x741eec['order']=qs[_0x088b('0x40')](_0x4979b7['query'][_0x088b('0x40')]);_0x741eec[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x4979b7['query'],_0x383b52[_0x088b('0x38')]));if(_0x4979b7[_0x088b('0x37')][_0x088b('0x42')]){_0x741eec[_0x088b('0x43')]=_[_0x088b('0x44')](_0x741eec[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x741eec['attributes'],function(_0x155644){var _0x205475={};_0x205475[_0x155644]={'$like':'%'+_0x4979b7[_0x088b('0x37')]['filter']+'%'};return _0x205475;})});}_0x741eec=_[_0x088b('0x44')]({},_0x741eec,_0x4979b7['options']);return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})[_0x088b('0x24')](function(_0x1877fb){if(_0x1877fb){_0x536038=_0x1877fb['length'];if(!_0x4979b7['query'][_0x088b('0x3d')]('nolimit')){_0x741eec[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x4979b7[_0x088b('0x37')][_0x088b('0x22')]);_0x741eec[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x4979b7[_0x088b('0x37')]['offset']);}return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})['then'](function(_0x201539){if(_0x201539){return _0x201539?{'count':_0x536038,'rows':_0x201539}:null;}})[_0x088b('0x24')](respondWithResult(_0x43732f,null))[_0x088b('0x4d')](handleError(_0x43732f,null));};exports[_0x088b('0xb6')]=function(_0x42ad81,_0xacacf7,_0x183cfb){var _0x50a6c8,_0x1621de;return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x42ad81['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0xacacf7,null))[_0x088b('0x24')](function(_0xff8164){if(_0xff8164){_0x1621de=_0xff8164;return _0xff8164[_0x088b('0xb6')](_0x42ad81[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0x42ad81[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x54ea92){var _0x223021;_0x50a6c8=_0x54ea92||[];var _0x2776bc=[];if(_0x54ea92){for(var _0x3cf220=0x0;_0x3cf220<_0x54ea92[_0x088b('0x3c')];_0x3cf220+=0x1){var _0x14e077=_0x54ea92[_0x3cf220][_0x088b('0x26')]({'plain':!![]});_0x223021=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xb7'))[_0x088b('0xb8')]([_0x088b('0x9e'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),'phone')['field']('id',_0x088b('0x9c'))[_0x088b('0x7f')](_0x14e077[_0x088b('0x9f')]['toString'](),_0x088b('0x9d'))[_0x088b('0x7f')](_0x42ad81[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5c'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x14e077[_0x088b('0x9f')][_0x088b('0xa0')]())[_0x088b('0x43')](_0x088b('0xba')))[_0x088b('0xa0')]();_0x2776bc[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x223021));}return BPromise['all'](_0x2776bc);}})[_0x088b('0x24')](function(){return _0x50a6c8;})[_0x088b('0x24')](respondWithResult(_0xacacf7,null))[_0x088b('0x4d')](handleError(_0xacacf7,null));};exports[_0x088b('0xbb')]=function(_0x1414b6,_0x3d20f0,_0x27542b){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1414b6[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d20f0,null))[_0x088b('0x24')](function(_0x1ed3c2){if(_0x1ed3c2){return _0x1ed3c2[_0x088b('0xbb')](_0x1414b6[_0x088b('0x37')][_0x088b('0x7d')]);}})[_0x088b('0x24')](function(_0x470b5b){if(_0x470b5b){return db[_0x088b('0x67')][_0x088b('0x25')]({'where':{'ListId':_0x1414b6['query'][_0x088b('0x7d')],'VoiceQueueId':_0x1414b6['params']['id']}})[_0x088b('0x24')](function(){return _0x470b5b;});}})[_0x088b('0x24')](respondWithStatusCode(_0x3d20f0,null))[_0x088b('0x4d')](handleError(_0x3d20f0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 11ad2a7..5684e85 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 _0xa33d=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4189c1,_0x550ed7){var _0x1b53c3=function(_0x28f0b2){while(--_0x28f0b2){_0x4189c1['push'](_0x4189c1['shift']());}};_0x1b53c3(++_0x550ed7);}(_0xa33d,0xd2));var _0xda33=function(_0x1aa841,_0xda4c17){_0x1aa841=_0x1aa841-0x0;var _0x745781=_0xa33d[_0x1aa841];return _0x745781;};'use strict';var EventEmitter=require(_0xda33('0x0'));var VoiceQueue=require(_0xda33('0x1'))['db'][_0xda33('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xda33('0x3')](0x0);var events={'afterCreate':_0xda33('0x4'),'afterUpdate':_0xda33('0x5'),'afterDestroy':_0xda33('0x6')};function emitEvent(_0x4fac9d){return function(_0x9950ed,_0x94a875,_0xfcec7){VoiceQueueEvents[_0xda33('0x7')](_0x4fac9d+':'+_0x9950ed['id'],_0x9950ed);VoiceQueueEvents[_0xda33('0x7')](_0x4fac9d,_0x9950ed);_0xfcec7(null);};}for(var e in events){if(events[_0xda33('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xda33('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x0c6c=['exports','events','../../mysqldb','VoiceQueue','save','remove','emit'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x0c6c,0x1a5));var _0xc0c6=function(_0x372b9d,_0x547e8c){_0x372b9d=_0x372b9d-0x0;var _0x48cb9b=_0x0c6c[_0x372b9d];return _0x48cb9b;};'use strict';var EventEmitter=require(_0xc0c6('0x0'));var VoiceQueue=require(_0xc0c6('0x1'))['db'][_0xc0c6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc0c6('0x3'),'afterUpdate':'update','afterDestroy':_0xc0c6('0x4')};function emitEvent(_0x3877b8){return function(_0x27a949,_0xf1bcd1,_0x3109a4){VoiceQueueEvents[_0xc0c6('0x5')](_0x3877b8+':'+_0x27a949['id'],_0x27a949);VoiceQueueEvents[_0xc0c6('0x5')](_0x3877b8,_0x27a949);_0x3109a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xc0c6('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 19d423f..5ff291d 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x5e9396,_0x161fdd){var _0x4172e3=function(_0x4acd42){while(--_0x4acd42){_0x5e9396['push'](_0x5e9396['shift']());}};_0x4172e3(++_0x161fdd);}(_0x008c,0x188));var _0xc008=function(_0x282530,_0x5a31b2){_0x282530=_0x282530-0x0;var _0x266c57=_0x008c[_0x282530];return _0x266c57;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x51a299,_0x1d8091){var _0x3c1128=function(_0x6a622d){while(--_0x6a622d){_0x51a299['push'](_0x51a299['shift']());}};_0x3c1128(++_0x1d8091);}(_0xedd9,0xfc));var _0x9edd=function(_0xf4b49,_0x7c2356){_0xf4b49=_0xf4b49-0x0;var _0x181c78=_0xedd9[_0xf4b49];return _0x181c78;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index aaee5f2..ebb1cb2 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 _0x7adc=['attributes','GetVoiceQueue','catch','find','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueue','findAll','options','raw','where','include','map','model'];(function(_0x12b82e,_0x183d8b){var _0x1daae5=function(_0x22e34c){while(--_0x22e34c){_0x12b82e['push'](_0x12b82e['shift']());}};_0x1daae5(++_0x183d8b);}(_0x7adc,0xa5));var _0xc7ad=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x7adc[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require('lodash');var util=require(_0xc7ad('0x0'));var moment=require(_0xc7ad('0x1'));var BPromise=require(_0xc7ad('0x2'));var rs=require(_0xc7ad('0x3'));var fs=require('fs');var Redis=require(_0xc7ad('0x4'));var db=require(_0xc7ad('0x5'))['db'];var utils=require(_0xc7ad('0x6'));var logger=require(_0xc7ad('0x7'))(_0xc7ad('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7ad('0x9'));var client=jayson[_0xc7ad('0xa')][_0xc7ad('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc7ad('0xc')],{'host':_0xc7ad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xc7ad('0xe')](socket);function respondWithRpcPromise(_0x5178c0,_0x47568a,_0x85d7f2){return new BPromise(function(_0x3287ba,_0x164e51){return client[_0xc7ad('0xf')](_0x5178c0,_0x85d7f2)[_0xc7ad('0x10')](function(_0x590922){logger[_0xc7ad('0x11')](_0xc7ad('0x12'),_0x47568a,_0xc7ad('0x13'));logger[_0xc7ad('0x14')](_0xc7ad('0x15'),_0x47568a,_0xc7ad('0x13'),JSON[_0xc7ad('0x16')](_0x590922));if(_0x590922[_0xc7ad('0x17')]){if(_0x590922['error'][_0xc7ad('0x18')]===0x1f4){logger[_0xc7ad('0x17')](_0xc7ad('0x12'),_0x47568a,_0x590922[_0xc7ad('0x17')][_0xc7ad('0x19')]);return _0x164e51(_0x590922[_0xc7ad('0x17')]['message']);}logger[_0xc7ad('0x17')](_0xc7ad('0x12'),_0x47568a,_0x590922[_0xc7ad('0x17')][_0xc7ad('0x19')]);return _0x3287ba(_0x590922[_0xc7ad('0x17')][_0xc7ad('0x19')]);}else{logger[_0xc7ad('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x47568a,_0xc7ad('0x13'));_0x3287ba(_0x590922[_0xc7ad('0x1a')][_0xc7ad('0x19')]);}})['catch'](function(_0x3a3795){logger[_0xc7ad('0x17')](_0xc7ad('0x12'),_0x47568a,_0x3a3795);_0x164e51(_0x3a3795);});});}exports['GetVoiceQueue']=function(_0xa3f415){var _0x1efd14=this;return new Promise(function(_0x4e148a,_0x54b278){return db[_0xc7ad('0x1b')][_0xc7ad('0x1c')]({'raw':_0xa3f415[_0xc7ad('0x1d')]?_0xa3f415[_0xc7ad('0x1d')][_0xc7ad('0x1e')]===undefined?!![]:![]:!![],'where':_0xa3f415[_0xc7ad('0x1d')]?_0xa3f415[_0xc7ad('0x1d')][_0xc7ad('0x1f')]||null:null,'attributes':_0xa3f415[_0xc7ad('0x1d')]?_0xa3f415[_0xc7ad('0x1d')]['attributes']||null:null,'limit':_0xa3f415[_0xc7ad('0x1d')]?_0xa3f415[_0xc7ad('0x1d')]['limit']||null:null,'include':_0xa3f415['options']?_0xa3f415[_0xc7ad('0x1d')][_0xc7ad('0x20')]?_[_0xc7ad('0x21')](_0xa3f415[_0xc7ad('0x1d')][_0xc7ad('0x20')],function(_0x67aa38){return{'model':db[_0x67aa38[_0xc7ad('0x22')]],'as':_0x67aa38['as'],'attributes':_0x67aa38[_0xc7ad('0x23')],'include':_0x67aa38[_0xc7ad('0x20')]?_[_0xc7ad('0x21')](_0x67aa38[_0xc7ad('0x20')],function(_0x3d4705){return{'model':db[_0x3d4705[_0xc7ad('0x22')]],'as':_0x3d4705['as'],'attributes':_0x3d4705['attributes'],'include':_0x3d4705[_0xc7ad('0x20')]?_[_0xc7ad('0x21')](_0x3d4705[_0xc7ad('0x20')],function(_0x26ace4){return{'model':db[_0x26ace4[_0xc7ad('0x22')]],'as':_0x26ace4['as'],'attributes':_0x26ace4[_0xc7ad('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5831e0){logger[_0xc7ad('0x11')](_0xc7ad('0x24'),_0xa3f415);logger[_0xc7ad('0x14')](_0xc7ad('0x24'),_0xa3f415,JSON[_0xc7ad('0x16')](_0x5831e0));_0x4e148a(_0x5831e0);})[_0xc7ad('0x25')](function(_0x90bbf1){logger[_0xc7ad('0x17')](_0xc7ad('0x24'),_0x90bbf1[_0xc7ad('0x19')],_0xa3f415);_0x54b278(_0x1efd14['error'](0x1f4,_0x90bbf1[_0xc7ad('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x567c83){var _0x25fc11=this;return new Promise(function(_0x4d79f2,_0x1f3ca5){return db[_0xc7ad('0x1b')][_0xc7ad('0x26')]({'raw':_0x567c83[_0xc7ad('0x1d')]?_0x567c83['options'][_0xc7ad('0x1e')]===undefined?!![]:![]:!![],'where':_0x567c83[_0xc7ad('0x1d')]?_0x567c83[_0xc7ad('0x1d')][_0xc7ad('0x1f')]||null:null,'attributes':_0x567c83[_0xc7ad('0x1d')]?_0x567c83[_0xc7ad('0x1d')][_0xc7ad('0x23')]||null:null,'include':_0x567c83[_0xc7ad('0x1d')]?_0x567c83[_0xc7ad('0x1d')]['include']?_[_0xc7ad('0x21')](_0x567c83[_0xc7ad('0x1d')]['include'],function(_0x578aea){return{'model':db[_0x578aea[_0xc7ad('0x22')]],'as':_0x578aea['as'],'attributes':_0x578aea['attributes'],'include':_0x578aea[_0xc7ad('0x20')]?_[_0xc7ad('0x21')](_0x578aea[_0xc7ad('0x20')],function(_0x4688fe){return{'model':db[_0x4688fe[_0xc7ad('0x22')]],'as':_0x4688fe['as'],'attributes':_0x4688fe[_0xc7ad('0x23')],'include':_0x4688fe[_0xc7ad('0x20')]?_[_0xc7ad('0x21')](_0x4688fe['include'],function(_0x48d727){return{'model':db[_0x48d727['model']],'as':_0x48d727['as'],'attributes':_0x48d727[_0xc7ad('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc7ad('0x10')](function(_0x1506ed){logger['info'](_0xc7ad('0x27'),_0x567c83);logger[_0xc7ad('0x14')](_0xc7ad('0x27'),_0x567c83,JSON[_0xc7ad('0x16')](_0x1506ed));_0x4d79f2(_0x1506ed);})[_0xc7ad('0x25')](function(_0x3a22b5){logger[_0xc7ad('0x17')](_0xc7ad('0x27'),_0x3a22b5[_0xc7ad('0x19')],_0x567c83);_0x1f3ca5(_0x25fc11[_0xc7ad('0x17')](0x1f4,_0x3a22b5[_0xc7ad('0x19')]));});});}; \ No newline at end of file +var _0x4819=['request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','limit','include','attributes','map','model','debug','ShowVoiceQueue','VoiceQueue','find','where','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x4114ef,_0x59b4b9){var _0x33b4f5=function(_0x3e0251){while(--_0x3e0251){_0x4114ef['push'](_0x4114ef['shift']());}};_0x33b4f5(++_0x59b4b9);}(_0x4819,0x14c));var _0x9481=function(_0x4cb9d5,_0x187d5a){_0x4cb9d5=_0x4cb9d5-0x0;var _0x444523=_0x4819[_0x4cb9d5];return _0x444523;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9481('0x3'));var logger=require(_0x9481('0x4'))(_0x9481('0x5'));var config=require(_0x9481('0x6'));var jayson=require(_0x9481('0x7'));var client=jayson['client'][_0x9481('0x8')]({'port':0x232a});config['redis']=_[_0x9481('0x9')](config['redis'],{'host':_0x9481('0xa'),'port':0x18eb});var socket=require(_0x9481('0xb'))(new Redis(config[_0x9481('0xc')]));require(_0x9481('0xd'))[_0x9481('0xe')](socket);function respondWithRpcPromise(_0xe98ee0,_0x5c064a,_0x2f7e40){return new BPromise(function(_0x1f4064,_0x519837){return client[_0x9481('0xf')](_0xe98ee0,_0x2f7e40)[_0x9481('0x10')](function(_0x43f75f){logger[_0x9481('0x11')](_0x9481('0x12'),_0x5c064a,_0x9481('0x13'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5c064a,_0x9481('0x13'),JSON[_0x9481('0x14')](_0x43f75f));if(_0x43f75f[_0x9481('0x15')]){if(_0x43f75f[_0x9481('0x15')][_0x9481('0x16')]===0x1f4){logger[_0x9481('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,_0x43f75f['error']['message']);return _0x519837(_0x43f75f[_0x9481('0x15')][_0x9481('0x17')]);}logger[_0x9481('0x15')](_0x9481('0x12'),_0x5c064a,_0x43f75f['error'][_0x9481('0x17')]);return _0x1f4064(_0x43f75f[_0x9481('0x15')][_0x9481('0x17')]);}else{logger[_0x9481('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,'request\x20sent');_0x1f4064(_0x43f75f[_0x9481('0x18')][_0x9481('0x17')]);}})[_0x9481('0x19')](function(_0x2928a0){logger[_0x9481('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,_0x2928a0);_0x519837(_0x2928a0);});});}exports[_0x9481('0x1a')]=function(_0x252fa3){var _0x1abf01=this;return new Promise(function(_0x1f973c,_0x186494){return db['VoiceQueue'][_0x9481('0x1b')]({'raw':_0x252fa3['options']?_0x252fa3[_0x9481('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')]['where']||null:null,'attributes':_0x252fa3['options']?_0x252fa3['options']['attributes']||null:null,'limit':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')][_0x9481('0x1d')]||null:null,'include':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')][_0x9481('0x1e')]?_['map'](_0x252fa3[_0x9481('0x1c')][_0x9481('0x1e')],function(_0x1c9f39){return{'model':db[_0x1c9f39['model']],'as':_0x1c9f39['as'],'attributes':_0x1c9f39[_0x9481('0x1f')],'include':_0x1c9f39['include']?_[_0x9481('0x20')](_0x1c9f39[_0x9481('0x1e')],function(_0x105050){return{'model':db[_0x105050[_0x9481('0x21')]],'as':_0x105050['as'],'attributes':_0x105050[_0x9481('0x1f')],'include':_0x105050['include']?_['map'](_0x105050[_0x9481('0x1e')],function(_0x381164){return{'model':db[_0x381164[_0x9481('0x21')]],'as':_0x381164['as'],'attributes':_0x381164['attributes']};}):[]};}):[]};}):[]:[]})[_0x9481('0x10')](function(_0x33ef3e){logger['info'](_0x9481('0x1a'),_0x252fa3);logger[_0x9481('0x22')](_0x9481('0x1a'),_0x252fa3,JSON[_0x9481('0x14')](_0x33ef3e));_0x1f973c(_0x33ef3e);})[_0x9481('0x19')](function(_0x101347){logger['error'](_0x9481('0x1a'),_0x101347[_0x9481('0x17')],_0x252fa3);_0x186494(_0x1abf01[_0x9481('0x15')](0x1f4,_0x101347[_0x9481('0x17')]));});});};exports[_0x9481('0x23')]=function(_0x11ffc7){var _0x2cfb6b=this;return new Promise(function(_0x58a50a,_0x36cbcd){return db[_0x9481('0x24')][_0x9481('0x25')]({'raw':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x26')]||null:null,'attributes':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1f')]||null:null,'include':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1e')]?_[_0x9481('0x20')](_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1e')],function(_0x46e95b){return{'model':db[_0x46e95b[_0x9481('0x21')]],'as':_0x46e95b['as'],'attributes':_0x46e95b[_0x9481('0x1f')],'include':_0x46e95b['include']?_['map'](_0x46e95b['include'],function(_0x54f732){return{'model':db[_0x54f732[_0x9481('0x21')]],'as':_0x54f732['as'],'attributes':_0x54f732[_0x9481('0x1f')],'include':_0x54f732[_0x9481('0x1e')]?_[_0x9481('0x20')](_0x54f732[_0x9481('0x1e')],function(_0x5008ce){return{'model':db[_0x5008ce[_0x9481('0x21')]],'as':_0x5008ce['as'],'attributes':_0x5008ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x9481('0x10')](function(_0x818de){logger['info'](_0x9481('0x23'),_0x11ffc7);logger['debug']('ShowVoiceQueue',_0x11ffc7,JSON[_0x9481('0x14')](_0x818de));_0x58a50a(_0x818de);})[_0x9481('0x19')](function(_0x1c076d){logger[_0x9481('0x15')](_0x9481('0x23'),_0x1c076d[_0x9481('0x17')],_0x11ffc7);_0x36cbcd(_0x2cfb6b[_0x9481('0x15')](0x1f4,_0x1c076d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aaab7dd..7743307 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 _0x803b=['length','voiceQueue:','./voiceQueue.events','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x803b,0x18a));var _0xb803=function(_0x580203,_0x3dc6d3){_0x580203=_0x580203-0x0;var _0x3d034e=_0x803b[_0x580203];return _0x3d034e;};'use strict';var VoiceQueueEvents=require(_0xb803('0x0'));var events=['save','remove',_0xb803('0x1')];function createListener(_0x49617e,_0x23f1cd){return function(_0x4c3e48){_0x23f1cd[_0xb803('0x2')](_0x49617e,_0x4c3e48);};}function removeListener(_0x3a172b,_0x4733b3){return function(){VoiceQueueEvents[_0xb803('0x3')](_0x3a172b,_0x4733b3);};}exports[_0xb803('0x4')]=function(_0x4bc46a){for(var _0x142ff4=0x0,_0x290413=events[_0xb803('0x5')];_0x142ff4<_0x290413;_0x142ff4++){var _0x48068d=events[_0x142ff4];var _0x47b354=createListener(_0xb803('0x6')+_0x48068d,_0x4bc46a);VoiceQueueEvents['on'](_0x48068d,_0x47b354);}}; \ No newline at end of file +var _0xf47a=['length','voiceQueue:','./voiceQueue.events','save','remove','removeListener','register'];(function(_0x5d16fb,_0x4fcc7a){var _0x8b5e9d=function(_0x224374){while(--_0x224374){_0x5d16fb['push'](_0x5d16fb['shift']());}};_0x8b5e9d(++_0x4fcc7a);}(_0xf47a,0x11a));var _0xaf47=function(_0x154163,_0x2eb88c){_0x154163=_0x154163-0x0;var _0x41dd43=_0xf47a[_0x154163];return _0x41dd43;};'use strict';var VoiceQueueEvents=require(_0xaf47('0x0'));var events=[_0xaf47('0x1'),_0xaf47('0x2'),'update'];function createListener(_0x382be3,_0x691b69){return function(_0x104479){_0x691b69['emit'](_0x382be3,_0x104479);};}function removeListener(_0x53e486,_0x429ab1){return function(){VoiceQueueEvents[_0xaf47('0x3')](_0x53e486,_0x429ab1);};}exports[_0xaf47('0x4')]=function(_0x3430f5){for(var _0x12cb46=0x0,_0x3771c6=events[_0xaf47('0x5')];_0x12cb46<_0x3771c6;_0x12cb46++){var _0x2a4d1e=events[_0x12cb46];var _0x2e9e87=createListener(_0xaf47('0x6')+_0x2a4d1e,_0x3430f5);VoiceQueueEvents['on'](_0x2a4d1e,_0x2e9e87);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 17b1092..659e898 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 _0xdb62=['../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xdb62,0x1dc));var _0x2db6=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xdb62[_0x11f226];return _0x30be77;};'use strict';var multer=require(_0x2db6('0x0'));var util=require(_0x2db6('0x1'));var path=require(_0x2db6('0x2'));var timeout=require(_0x2db6('0x3'));var express=require(_0x2db6('0x4'));var router=express[_0x2db6('0x5')]();var fs_extra=require(_0x2db6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2db6('0x7'));var config=require('../../config/environment');var controller=require(_0x2db6('0x8'));router[_0x2db6('0x9')]('/',auth[_0x2db6('0xa')](),controller[_0x2db6('0xb')]);router[_0x2db6('0x9')](_0x2db6('0xc'),auth[_0x2db6('0xa')](),controller['describe']);router[_0x2db6('0x9')](_0x2db6('0xd'),auth[_0x2db6('0xa')](),controller[_0x2db6('0xe')]);router[_0x2db6('0x9')](_0x2db6('0xf'),auth[_0x2db6('0xa')](),controller['show']);router[_0x2db6('0x10')]('/',auth[_0x2db6('0xa')](),controller[_0x2db6('0x11')]);router['put'](_0x2db6('0xf'),auth[_0x2db6('0xa')](),controller['update']);router[_0x2db6('0x12')]('/:id',auth[_0x2db6('0xa')](),controller[_0x2db6('0x13')]);module[_0x2db6('0x14')]=router; \ No newline at end of file +var _0x07da=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete'];(function(_0x50e6bf,_0x5cc3cc){var _0xe072b1=function(_0x300474){while(--_0x300474){_0x50e6bf['push'](_0x50e6bf['shift']());}};_0xe072b1(++_0x5cc3cc);}(_0x07da,0x177));var _0xa07d=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x07da[_0x39ffd1];return _0x31267e;};'use strict';var multer=require(_0xa07d('0x0'));var util=require(_0xa07d('0x1'));var path=require(_0xa07d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa07d('0x3'));var auth=require(_0xa07d('0x4'));var interaction=require(_0xa07d('0x5'));var config=require(_0xa07d('0x6'));var controller=require(_0xa07d('0x7'));router[_0xa07d('0x8')]('/',auth[_0xa07d('0x9')](),controller[_0xa07d('0xa')]);router['get'](_0xa07d('0xb'),auth['isAuthenticated'](),controller[_0xa07d('0xc')]);router[_0xa07d('0x8')](_0xa07d('0xd'),auth['isAuthenticated'](),controller[_0xa07d('0xe')]);router[_0xa07d('0x8')](_0xa07d('0xf'),auth[_0xa07d('0x9')](),controller[_0xa07d('0x10')]);router[_0xa07d('0x11')]('/',auth['isAuthenticated'](),controller[_0xa07d('0x12')]);router[_0xa07d('0x13')]('/:id',auth[_0xa07d('0x9')](),controller['update']);router[_0xa07d('0x14')]('/:id',auth[_0xa07d('0x9')](),controller['destroy']);module[_0xa07d('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 59a3809..fd8001e 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 _0xd870=['setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0x2cbaa7,_0x25ab2b){var _0x8a7ab0=function(_0x242cfb){while(--_0x242cfb){_0x2cbaa7['push'](_0x2cbaa7['shift']());}};_0x8a7ab0(++_0x25ab2b);}(_0xd870,0x1aa));var _0x0d87=function(_0x932aba,_0xca9b00){_0x932aba=_0x932aba-0x0;var _0x2201e8=_0xd870[_0x932aba];return _0x2201e8;};'use strict';var Sequelize=require(_0x0d87('0x0'));var moment=require(_0x0d87('0x1'));module[_0x0d87('0x2')]={'type':{'type':Sequelize[_0x0d87('0x3')]},'uniqueid':{'type':Sequelize[_0x0d87('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0d87('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x0d87('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x0d87('0x4')],'set':function(_0x28b913){var _0x318d33=moment(_0x28b913);var _0x312d3a=moment(this['getDataValue'](_0x0d87('0x5')))['format'](_0x0d87('0x6'));var _0x4399ec=_0x318d33['diff'](_0x312d3a,_0x0d87('0x7'));this['setDataValue']('queuecallerleaveAt',_0x28b913);this[_0x0d87('0x8')](_0x0d87('0x9'),_0x4399ec||null);}},'position':{'type':Sequelize[_0x0d87('0xa')]},'count':{'type':Sequelize[_0x0d87('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x0d87('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0d87('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0d87('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0d87('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x0d87('0x3')],'comment':_0x0d87('0xc')},'originalposition':{'type':Sequelize[_0x0d87('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0d87('0x3')]},'connectedlinename':{'type':Sequelize[_0x0d87('0x3')]},'accountcode':{'type':Sequelize[_0x0d87('0x3')]},'context':{'type':Sequelize[_0x0d87('0x3')]},'exten':{'type':Sequelize[_0x0d87('0x3')]},'priority':{'type':Sequelize[_0x0d87('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0d87('0x3')]},'transfer':{'type':Sequelize[_0x0d87('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0d87('0x3')],'comment':_0x0d87('0xd')},'transferexten':{'type':Sequelize[_0x0d87('0x3')]},'transferuniqueid':{'type':Sequelize[_0x0d87('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0d87('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0d87('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x0d87('0xa')],'defaultValue':0x0},'note':{'type':Sequelize[_0x0d87('0x3')]}}; \ No newline at end of file +var _0x7eab=['sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x511929,_0x18d1eb){var _0x296489=function(_0x2bc675){while(--_0x2bc675){_0x511929['push'](_0x511929['shift']());}};_0x296489(++_0x18d1eb);}(_0x7eab,0x177));var _0xb7ea=function(_0x15f67d,_0x15cbb0){_0x15f67d=_0x15f67d-0x0;var _0x2f0ac2=_0x7eab[_0x15f67d];return _0x2f0ac2;};'use strict';var Sequelize=require(_0xb7ea('0x0'));var moment=require('moment');module[_0xb7ea('0x1')]={'type':{'type':Sequelize[_0xb7ea('0x2')]},'uniqueid':{'type':Sequelize[_0xb7ea('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb7ea('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xb7ea('0x3')],'set':function(_0x147c31){var _0x4a6706=moment(_0x147c31);var _0x4e28ef=moment(this[_0xb7ea('0x4')]('queuecallerjoinAt'))[_0xb7ea('0x5')](_0xb7ea('0x6'));var _0x1bf687=_0x4a6706[_0xb7ea('0x7')](_0x4e28ef,_0xb7ea('0x8'));this[_0xb7ea('0x9')](_0xb7ea('0xa'),_0x147c31);this[_0xb7ea('0x9')](_0xb7ea('0xb'),_0x1bf687||null);}},'position':{'type':Sequelize[_0xb7ea('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb7ea('0x3')]},'queuecallerexit':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb7ea('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xb7ea('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xb7ea('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb7ea('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb7ea('0x2')]},'context':{'type':Sequelize[_0xb7ea('0x2')]},'exten':{'type':Sequelize[_0xb7ea('0x2')]},'priority':{'type':Sequelize[_0xb7ea('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xb7ea('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb7ea('0x2')]},'transfer':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb7ea('0x2')],'comment':_0xb7ea('0xe')},'transferexten':{'type':Sequelize[_0xb7ea('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb7ea('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb7ea('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb7ea('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xb7ea('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb7ea('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 42a2265..c61c291 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 _0x422f=['filter','options','VoiceQueueReport','then','includeAll','findAll','rows','show','find','catch','create','body','params','describe','getVoiceQueuesReport','nolimit','include','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL'];(function(_0x5ba304,_0x4c97c9){var _0x1fa547=function(_0x1aa1dd){while(--_0x1aa1dd){_0x5ba304['push'](_0x5ba304['shift']());}};_0x1fa547(++_0x4c97c9);}(_0x422f,0x1dd));var _0xf422=function(_0x143a2e,_0x8079bf){_0x143a2e=_0x143a2e-0x0;var _0x213235=_0x422f[_0x143a2e];return _0x213235;};'use strict';var emlformat=require(_0xf422('0x0'));var rimraf=require(_0xf422('0x1'));var zipdir=require(_0xf422('0x2'));var jsonpatch=require(_0xf422('0x3'));var rp=require(_0xf422('0x4'));var moment=require(_0xf422('0x5'));var BPromise=require(_0xf422('0x6'));var Mustache=require(_0xf422('0x7'));var util=require(_0xf422('0x8'));var path=require(_0xf422('0x9'));var sox=require(_0xf422('0xa'));var csv=require(_0xf422('0xb'));var ejs=require(_0xf422('0xc'));var fs=require('fs');var fs_extra=require(_0xf422('0xd'));var _=require(_0xf422('0xe'));var squel=require(_0xf422('0xf'));var crypto=require(_0xf422('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf422('0x11'));var toCsv=require(_0xf422('0xb'));var querystring=require(_0xf422('0x12'));var Papa=require('papaparse');var Redis=require(_0xf422('0x13'));var authService=require(_0xf422('0x14'));var qs=require(_0xf422('0x15'));var as=require(_0xf422('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf422('0x17'))(_0xf422('0x18'));var utils=require(_0xf422('0x19'));var config=require(_0xf422('0x1a'));var licenseUtil=require(_0xf422('0x1b'));var db=require(_0xf422('0x1c'))['db'];config['redis']=_[_0xf422('0x1d')](config['redis'],{'host':_0xf422('0x1e'),'port':0x18eb});var socket=require(_0xf422('0x1f'))(new Redis(config[_0xf422('0x20')]));require(_0xf422('0x21'))[_0xf422('0x22')](socket);function respondWithStatusCode(_0x1021f7,_0x1c62b6){_0x1c62b6=_0x1c62b6||0xcc;return function(_0x8c08d4){if(_0x8c08d4){return _0x1021f7[_0xf422('0x23')](_0x1c62b6);}return _0x1021f7['status'](_0x1c62b6)[_0xf422('0x24')]();};}function respondWithResult(_0x23381d,_0x5276da){_0x5276da=_0x5276da||0xc8;return function(_0x225579){if(_0x225579){return _0x23381d['status'](_0x5276da)[_0xf422('0x25')](_0x225579);}};}function respondWithFilteredResult(_0x376796,_0x5dfba1){return function(_0x20f9cc){if(_0x20f9cc){var _0x4ddd2b=typeof _0x5dfba1[_0xf422('0x26')]===_0xf422('0x27')&&typeof _0x5dfba1[_0xf422('0x28')]===_0xf422('0x27');var _0x5ca259=_0x20f9cc['count'];var _0x2a99c0=_0x4ddd2b?0x0:_0x5dfba1[_0xf422('0x26')];var _0x328b81=_0x4ddd2b?_0x20f9cc[_0xf422('0x29')]:_0x5dfba1[_0xf422('0x26')]+_0x5dfba1[_0xf422('0x28')];var _0x5e759e;if(_0x328b81>=_0x5ca259){_0x328b81=_0x5ca259;_0x5e759e=0xc8;}else{_0x5e759e=0xce;}_0x376796[_0xf422('0x2a')](_0x5e759e);return _0x376796[_0xf422('0x2b')](_0xf422('0x2c'),_0x2a99c0+'-'+_0x328b81+'/'+_0x5ca259)['json'](_0x20f9cc);}return null;};}function patchUpdates(_0x2ee0b7){return function(_0x52c804){try{jsonpatch[_0xf422('0x2d')](_0x52c804,_0x2ee0b7,!![]);}catch(_0x1c4acd){return BPromise[_0xf422('0x2e')](_0x1c4acd);}return _0x52c804[_0xf422('0x2f')]();};}function saveUpdates(_0x2f4369,_0x2bd101){return function(_0x2c5416){if(_0x2c5416){return _0x2c5416[_0xf422('0x30')](_0x2f4369)['then'](function(_0x231008){return _0x231008;});}return null;};}function removeEntity(_0x2507d0,_0x4ad178){return function(_0x4d3882){if(_0x4d3882){return _0x4d3882[_0xf422('0x31')]()['then'](function(){_0x2507d0['status'](0xcc)[_0xf422('0x24')]();});}};}function handleEntityNotFound(_0x364350,_0x10294e){return function(_0x123cd7){if(!_0x123cd7){_0x364350[_0xf422('0x23')](0x194);}return _0x123cd7;};}function handleError(_0x4bdc72,_0x15d34d){_0x15d34d=_0x15d34d||0x1f4;return function(_0x21bb26){logger[_0xf422('0x32')](_0x21bb26[_0xf422('0x33')]);if(_0x21bb26[_0xf422('0x34')]){delete _0x21bb26[_0xf422('0x34')];}_0x4bdc72[_0xf422('0x2a')](_0x15d34d)[_0xf422('0x35')](_0x21bb26);};}exports[_0xf422('0x36')]=function(_0x2a9216,_0x80d4ab){var _0x977cfc={},_0x5ceb79={},_0x4704d6={'count':0x0,'rows':[]};var _0x311253=_['map'](db['VoiceQueueReport'][_0xf422('0x37')],function(_0x482e0d){return{'name':_0x482e0d[_0xf422('0x38')],'type':_0x482e0d[_0xf422('0x39')][_0xf422('0x3a')]};});_0x5ceb79[_0xf422('0x3b')]=_['map'](_0x311253,_0xf422('0x34'));_0x5ceb79[_0xf422('0x3c')]=_[_0xf422('0x3d')](_0x2a9216[_0xf422('0x3c')]);_0x5ceb79[_0xf422('0x3e')]=_['intersection'](_0x5ceb79['model'],_0x5ceb79[_0xf422('0x3c')]);_0x977cfc['attributes']=_[_0xf422('0x3f')](_0x5ceb79[_0xf422('0x3b')],qs[_0xf422('0x40')](_0x2a9216['query'][_0xf422('0x40')]));_0x977cfc[_0xf422('0x41')]=_0x977cfc[_0xf422('0x41')][_0xf422('0x42')]?_0x977cfc[_0xf422('0x41')]:_0x5ceb79['model'];if(!_0x2a9216['query'][_0xf422('0x43')]('nolimit')){_0x977cfc['limit']=qs[_0xf422('0x28')](_0x2a9216[_0xf422('0x3c')][_0xf422('0x28')]);_0x977cfc['offset']=qs[_0xf422('0x26')](_0x2a9216[_0xf422('0x3c')][_0xf422('0x26')]);}_0x977cfc[_0xf422('0x44')]=qs[_0xf422('0x45')](_0x2a9216['query'][_0xf422('0x45')]);_0x977cfc[_0xf422('0x46')]=qs[_0xf422('0x3e')](_[_0xf422('0x47')](_0x2a9216['query'],_0x5ceb79[_0xf422('0x3e')]),_0x311253);if(_0x2a9216[_0xf422('0x3c')]['filter']){_0x977cfc[_0xf422('0x46')]=_[_0xf422('0x48')](_0x977cfc[_0xf422('0x46')],{'$or':_[_0xf422('0x49')](_0x311253,function(_0x3b9a58){if(_0x3b9a58[_0xf422('0x39')]!==_0xf422('0x4a')){var _0x41ef60={};_0x41ef60[_0x3b9a58[_0xf422('0x34')]]={'$like':'%'+_0x2a9216[_0xf422('0x3c')][_0xf422('0x4b')]+'%'};return _0x41ef60;}})});}_0x977cfc=_[_0xf422('0x48')]({},_0x977cfc,_0x2a9216[_0xf422('0x4c')]);var _0x4c0472={'where':_0x977cfc['where']};return db[_0xf422('0x4d')][_0xf422('0x29')](_0x4c0472)[_0xf422('0x4e')](function(_0x8fa38a){_0x4704d6[_0xf422('0x29')]=_0x8fa38a;if(_0x2a9216['query'][_0xf422('0x4f')]){_0x977cfc['include']=[{'all':!![]}];}return db[_0xf422('0x4d')][_0xf422('0x50')](_0x977cfc);})[_0xf422('0x4e')](function(_0x5b082f){_0x4704d6[_0xf422('0x51')]=_0x5b082f;return _0x4704d6;})[_0xf422('0x4e')](respondWithFilteredResult(_0x80d4ab,_0x977cfc))['catch'](handleError(_0x80d4ab,null));};exports[_0xf422('0x52')]=function(_0x2e51ba,_0x13d0e6){var _0x136aec={'raw':![],'where':{'id':_0x2e51ba['params']['id']}},_0x4407b2={};_0x4407b2['model']=_['keys'](db['VoiceQueueReport'][_0xf422('0x37')]);_0x4407b2[_0xf422('0x3c')]=_[_0xf422('0x3d')](_0x2e51ba[_0xf422('0x3c')]);_0x4407b2[_0xf422('0x3e')]=_[_0xf422('0x3f')](_0x4407b2[_0xf422('0x3b')],_0x4407b2[_0xf422('0x3c')]);_0x136aec[_0xf422('0x41')]=_[_0xf422('0x3f')](_0x4407b2[_0xf422('0x3b')],qs[_0xf422('0x40')](_0x2e51ba[_0xf422('0x3c')][_0xf422('0x40')]));_0x136aec[_0xf422('0x41')]=_0x136aec['attributes'][_0xf422('0x42')]?_0x136aec[_0xf422('0x41')]:_0x4407b2['model'];if(_0x2e51ba[_0xf422('0x3c')][_0xf422('0x4f')]){_0x136aec['include']=[{'all':!![]}];}_0x136aec=_[_0xf422('0x48')]({},_0x136aec,_0x2e51ba[_0xf422('0x4c')]);return db[_0xf422('0x4d')][_0xf422('0x53')](_0x136aec)[_0xf422('0x4e')](handleEntityNotFound(_0x13d0e6,null))[_0xf422('0x4e')](respondWithResult(_0x13d0e6,null))[_0xf422('0x54')](handleError(_0x13d0e6,null));};exports[_0xf422('0x55')]=function(_0x435b7d,_0x671bfa){return db[_0xf422('0x4d')][_0xf422('0x55')](_0x435b7d[_0xf422('0x56')],{})[_0xf422('0x4e')](respondWithResult(_0x671bfa,0xc9))[_0xf422('0x54')](handleError(_0x671bfa,null));};exports[_0xf422('0x30')]=function(_0x499876,_0x3ad50a){if(_0x499876[_0xf422('0x56')]['id']){delete _0x499876['body']['id'];}return db[_0xf422('0x4d')][_0xf422('0x53')]({'where':{'id':_0x499876[_0xf422('0x57')]['id']}})[_0xf422('0x4e')](handleEntityNotFound(_0x3ad50a,null))[_0xf422('0x4e')](saveUpdates(_0x499876[_0xf422('0x56')],null))[_0xf422('0x4e')](respondWithResult(_0x3ad50a,null))['catch'](handleError(_0x3ad50a,null));};exports['destroy']=function(_0x53b191,_0x154c49){return db[_0xf422('0x4d')][_0xf422('0x53')]({'where':{'id':_0x53b191[_0xf422('0x57')]['id']}})[_0xf422('0x4e')](handleEntityNotFound(_0x154c49,null))[_0xf422('0x4e')](removeEntity(_0x154c49,null))[_0xf422('0x54')](handleError(_0x154c49,null));};exports[_0xf422('0x58')]=function(_0x2f06e0,_0x2394e0){return db[_0xf422('0x4d')]['describe']()[_0xf422('0x4e')](respondWithResult(_0x2394e0,null))['catch'](handleError(_0x2394e0,null));};exports[_0xf422('0x59')]=function(_0x5ce199,_0x1d2537){var _0x5659a7={},_0x575bf7={},_0x4f87cb={'count':0x0,'rows':[]};_0x575bf7['model']=_[_0xf422('0x3d')](db[_0xf422('0x4d')][_0xf422('0x37')]);_0x575bf7[_0xf422('0x3c')]=_[_0xf422('0x3d')](_0x5ce199[_0xf422('0x3c')]);_0x575bf7[_0xf422('0x3e')]=_[_0xf422('0x3f')](_0x575bf7['model'],_0x575bf7[_0xf422('0x3c')]);_0x5659a7[_0xf422('0x41')]=_[_0xf422('0x3f')](_0x575bf7['model'],qs[_0xf422('0x40')](_0x5ce199['query'][_0xf422('0x40')]));_0x5659a7[_0xf422('0x41')]=_0x5659a7[_0xf422('0x41')][_0xf422('0x42')]?_0x5659a7[_0xf422('0x41')]:_0x575bf7['model'];if(!_0x5ce199[_0xf422('0x3c')]['hasOwnProperty'](_0xf422('0x5a'))){_0x5659a7[_0xf422('0x28')]=qs[_0xf422('0x28')](_0x5ce199['query'][_0xf422('0x28')]);_0x5659a7[_0xf422('0x26')]=qs['offset'](_0x5ce199['query'][_0xf422('0x26')]);}_0x5659a7[_0xf422('0x44')]=qs['sort'](_0x5ce199[_0xf422('0x3c')][_0xf422('0x45')]);_0x5659a7['where']=qs[_0xf422('0x3e')](_[_0xf422('0x47')](_0x5ce199[_0xf422('0x3c')],_0x575bf7[_0xf422('0x3e')]));if(_0x5ce199[_0xf422('0x3c')][_0xf422('0x4b')]){_0x5659a7['where']=_['merge'](_0x5659a7['where'],{'$or':_[_0xf422('0x49')](_0x5659a7[_0xf422('0x41')],function(_0x15775c){var _0x2907bf={};_0x2907bf[_0x15775c]={'$like':'%'+_0x5ce199[_0xf422('0x3c')][_0xf422('0x4b')]+'%'};return _0x2907bf;})});}_0x5659a7=_['merge']({},_0x5659a7,_0x5ce199[_0xf422('0x4c')]);var _0x59886e={'where':_0x5659a7[_0xf422('0x46')]};return db['VoiceQueueReport']['count'](_0x59886e)['then'](function(_0x2f89b1){_0x4f87cb[_0xf422('0x29')]=_0x2f89b1;if(_0x5ce199[_0xf422('0x3c')][_0xf422('0x4f')]){_0x5659a7[_0xf422('0x5b')]=[{'all':!![]}];}return db[_0xf422('0x4d')][_0xf422('0x50')](_0x5659a7);})[_0xf422('0x4e')](function(_0x361fc8){_0x4f87cb[_0xf422('0x51')]=_0x361fc8;return _0x4f87cb;})['then'](respondWithFilteredResult(_0x1d2537,_0x5659a7,_0xf422('0x59')))[_0xf422('0x54')](handleError(_0x1d2537,null,_0xf422('0x59')));}; \ No newline at end of file +var _0x129b=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','describe','getVoiceQueuesReport','rawAttributes','hasOwnProperty','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x129b,0x1dd));var _0xb129=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0x129b[_0x527824];return _0xc8b8ed;};'use strict';var emlformat=require(_0xb129('0x0'));var rimraf=require(_0xb129('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb129('0x2'));var BPromise=require(_0xb129('0x3'));var Mustache=require(_0xb129('0x4'));var util=require(_0xb129('0x5'));var path=require(_0xb129('0x6'));var sox=require(_0xb129('0x7'));var csv=require(_0xb129('0x8'));var ejs=require(_0xb129('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb129('0xa'));var squel=require(_0xb129('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb129('0xc'));var toCsv=require(_0xb129('0x8'));var querystring=require(_0xb129('0xd'));var Papa=require(_0xb129('0xe'));var Redis=require(_0xb129('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb129('0x10'));var hardwareService=require(_0xb129('0x11'));var logger=require(_0xb129('0x12'))(_0xb129('0x13'));var utils=require(_0xb129('0x14'));var config=require(_0xb129('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb129('0x16'))['db'];config[_0xb129('0x17')]=_[_0xb129('0x18')](config[_0xb129('0x17')],{'host':_0xb129('0x19'),'port':0x18eb});var socket=require(_0xb129('0x1a'))(new Redis(config[_0xb129('0x17')]));require(_0xb129('0x1b'))[_0xb129('0x1c')](socket);function respondWithStatusCode(_0x13bf58,_0x448509){_0x448509=_0x448509||0xcc;return function(_0xe0384){if(_0xe0384){return _0x13bf58['sendStatus'](_0x448509);}return _0x13bf58[_0xb129('0x1d')](_0x448509)[_0xb129('0x1e')]();};}function respondWithResult(_0xd27ab8,_0x429d7c){_0x429d7c=_0x429d7c||0xc8;return function(_0x33c167){if(_0x33c167){return _0xd27ab8['status'](_0x429d7c)[_0xb129('0x1f')](_0x33c167);}};}function respondWithFilteredResult(_0x151e7f,_0x4ce7d8){return function(_0x5c02e5){if(_0x5c02e5){var _0x53d502=typeof _0x4ce7d8[_0xb129('0x20')]===_0xb129('0x21')&&typeof _0x4ce7d8[_0xb129('0x22')]===_0xb129('0x21');var _0x5f00c7=_0x5c02e5[_0xb129('0x23')];var _0xa6f26c=_0x53d502?0x0:_0x4ce7d8[_0xb129('0x20')];var _0x4094d7=_0x53d502?_0x5c02e5[_0xb129('0x23')]:_0x4ce7d8[_0xb129('0x20')]+_0x4ce7d8['limit'];var _0xb1a8e2;if(_0x4094d7>=_0x5f00c7){_0x4094d7=_0x5f00c7;_0xb1a8e2=0xc8;}else{_0xb1a8e2=0xce;}_0x151e7f['status'](_0xb1a8e2);return _0x151e7f['set'](_0xb129('0x24'),_0xa6f26c+'-'+_0x4094d7+'/'+_0x5f00c7)['json'](_0x5c02e5);}return null;};}function patchUpdates(_0x1b3dbf){return function(_0x17bcf9){try{jsonpatch[_0xb129('0x25')](_0x17bcf9,_0x1b3dbf,!![]);}catch(_0x334e22){return BPromise[_0xb129('0x26')](_0x334e22);}return _0x17bcf9[_0xb129('0x27')]();};}function saveUpdates(_0xe8a916,_0x5c0951){return function(_0x47c47b){if(_0x47c47b){return _0x47c47b[_0xb129('0x28')](_0xe8a916)['then'](function(_0x29f5d4){return _0x29f5d4;});}return null;};}function removeEntity(_0x1a3bd0,_0x48e781){return function(_0x2d1c84){if(_0x2d1c84){return _0x2d1c84[_0xb129('0x29')]()[_0xb129('0x2a')](function(){_0x1a3bd0[_0xb129('0x1d')](0xcc)[_0xb129('0x1e')]();});}};}function handleEntityNotFound(_0x23f959,_0x363c91){return function(_0x1df707){if(!_0x1df707){_0x23f959[_0xb129('0x2b')](0x194);}return _0x1df707;};}function handleError(_0x2c4f5a,_0x2b2003){_0x2b2003=_0x2b2003||0x1f4;return function(_0x365753){logger[_0xb129('0x2c')](_0x365753['stack']);if(_0x365753[_0xb129('0x2d')]){delete _0x365753[_0xb129('0x2d')];}_0x2c4f5a['status'](_0x2b2003)[_0xb129('0x2e')](_0x365753);};}exports[_0xb129('0x2f')]=function(_0x4b6a16,_0x2fb950){var _0x553ccf={},_0x5c1947={},_0x5f3af4={'count':0x0,'rows':[]};var _0x5b6ac3=_[_0xb129('0x30')](db[_0xb129('0x31')]['rawAttributes'],function(_0x1f503b){return{'name':_0x1f503b[_0xb129('0x32')],'type':_0x1f503b['type'][_0xb129('0x33')]};});_0x5c1947[_0xb129('0x34')]=_[_0xb129('0x30')](_0x5b6ac3,_0xb129('0x2d'));_0x5c1947[_0xb129('0x35')]=_['keys'](_0x4b6a16[_0xb129('0x35')]);_0x5c1947['filters']=_[_0xb129('0x36')](_0x5c1947['model'],_0x5c1947[_0xb129('0x35')]);_0x553ccf['attributes']=_['intersection'](_0x5c1947[_0xb129('0x34')],qs[_0xb129('0x37')](_0x4b6a16[_0xb129('0x35')]['fields']));_0x553ccf['attributes']=_0x553ccf[_0xb129('0x38')]['length']?_0x553ccf[_0xb129('0x38')]:_0x5c1947[_0xb129('0x34')];if(!_0x4b6a16[_0xb129('0x35')]['hasOwnProperty'](_0xb129('0x39'))){_0x553ccf['limit']=qs['limit'](_0x4b6a16[_0xb129('0x35')][_0xb129('0x22')]);_0x553ccf['offset']=qs[_0xb129('0x20')](_0x4b6a16[_0xb129('0x35')][_0xb129('0x20')]);}_0x553ccf[_0xb129('0x3a')]=qs[_0xb129('0x3b')](_0x4b6a16[_0xb129('0x35')][_0xb129('0x3b')]);_0x553ccf[_0xb129('0x3c')]=qs[_0xb129('0x3d')](_[_0xb129('0x3e')](_0x4b6a16['query'],_0x5c1947[_0xb129('0x3d')]),_0x5b6ac3);if(_0x4b6a16[_0xb129('0x35')]['filter']){_0x553ccf[_0xb129('0x3c')]=_[_0xb129('0x3f')](_0x553ccf[_0xb129('0x3c')],{'$or':_[_0xb129('0x30')](_0x5b6ac3,function(_0xaa8808){if(_0xaa8808['type']!==_0xb129('0x40')){var _0x1b5f6d={};_0x1b5f6d[_0xaa8808[_0xb129('0x2d')]]={'$like':'%'+_0x4b6a16[_0xb129('0x35')][_0xb129('0x41')]+'%'};return _0x1b5f6d;}})});}_0x553ccf=_[_0xb129('0x3f')]({},_0x553ccf,_0x4b6a16[_0xb129('0x42')]);var _0x12aed3={'where':_0x553ccf[_0xb129('0x3c')]};return db[_0xb129('0x31')][_0xb129('0x23')](_0x12aed3)['then'](function(_0x46c9a5){_0x5f3af4[_0xb129('0x23')]=_0x46c9a5;if(_0x4b6a16[_0xb129('0x35')][_0xb129('0x43')]){_0x553ccf[_0xb129('0x44')]=[{'all':!![]}];}return db[_0xb129('0x31')][_0xb129('0x45')](_0x553ccf);})[_0xb129('0x2a')](function(_0x147f1e){_0x5f3af4[_0xb129('0x46')]=_0x147f1e;return _0x5f3af4;})[_0xb129('0x2a')](respondWithFilteredResult(_0x2fb950,_0x553ccf))[_0xb129('0x47')](handleError(_0x2fb950,null));};exports[_0xb129('0x48')]=function(_0xd45ad0,_0x2ef03c){var _0x15c3c9={'raw':![],'where':{'id':_0xd45ad0['params']['id']}},_0x529475={};_0x529475[_0xb129('0x34')]=_[_0xb129('0x49')](db[_0xb129('0x31')]['rawAttributes']);_0x529475['query']=_['keys'](_0xd45ad0['query']);_0x529475[_0xb129('0x3d')]=_[_0xb129('0x36')](_0x529475[_0xb129('0x34')],_0x529475[_0xb129('0x35')]);_0x15c3c9[_0xb129('0x38')]=_['intersection'](_0x529475[_0xb129('0x34')],qs[_0xb129('0x37')](_0xd45ad0[_0xb129('0x35')][_0xb129('0x37')]));_0x15c3c9[_0xb129('0x38')]=_0x15c3c9[_0xb129('0x38')][_0xb129('0x4a')]?_0x15c3c9['attributes']:_0x529475[_0xb129('0x34')];if(_0xd45ad0[_0xb129('0x35')][_0xb129('0x43')]){_0x15c3c9[_0xb129('0x44')]=[{'all':!![]}];}_0x15c3c9=_[_0xb129('0x3f')]({},_0x15c3c9,_0xd45ad0[_0xb129('0x42')]);return db[_0xb129('0x31')][_0xb129('0x4b')](_0x15c3c9)[_0xb129('0x2a')](handleEntityNotFound(_0x2ef03c,null))[_0xb129('0x2a')](respondWithResult(_0x2ef03c,null))[_0xb129('0x47')](handleError(_0x2ef03c,null));};exports['create']=function(_0x491cc9,_0x566a14){return db[_0xb129('0x31')]['create'](_0x491cc9[_0xb129('0x4c')],{})[_0xb129('0x2a')](respondWithResult(_0x566a14,0xc9))[_0xb129('0x47')](handleError(_0x566a14,null));};exports[_0xb129('0x28')]=function(_0x39c655,_0x4a2e06){if(_0x39c655[_0xb129('0x4c')]['id']){delete _0x39c655[_0xb129('0x4c')]['id'];}return db['VoiceQueueReport'][_0xb129('0x4b')]({'where':{'id':_0x39c655[_0xb129('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a2e06,null))[_0xb129('0x2a')](saveUpdates(_0x39c655[_0xb129('0x4c')],null))[_0xb129('0x2a')](respondWithResult(_0x4a2e06,null))[_0xb129('0x47')](handleError(_0x4a2e06,null));};exports[_0xb129('0x29')]=function(_0x2eddaa,_0x645489){return db[_0xb129('0x31')][_0xb129('0x4b')]({'where':{'id':_0x2eddaa[_0xb129('0x4d')]['id']}})[_0xb129('0x2a')](handleEntityNotFound(_0x645489,null))[_0xb129('0x2a')](removeEntity(_0x645489,null))[_0xb129('0x47')](handleError(_0x645489,null));};exports[_0xb129('0x4e')]=function(_0x3184ae,_0x17c817){return db['VoiceQueueReport'][_0xb129('0x4e')]()[_0xb129('0x2a')](respondWithResult(_0x17c817,null))[_0xb129('0x47')](handleError(_0x17c817,null));};exports[_0xb129('0x4f')]=function(_0x596bc3,_0x20425e){var _0x6cfcd4={},_0x3a1fad={},_0x2204ff={'count':0x0,'rows':[]};_0x3a1fad[_0xb129('0x34')]=_[_0xb129('0x49')](db[_0xb129('0x31')][_0xb129('0x50')]);_0x3a1fad['query']=_[_0xb129('0x49')](_0x596bc3[_0xb129('0x35')]);_0x3a1fad[_0xb129('0x3d')]=_[_0xb129('0x36')](_0x3a1fad['model'],_0x3a1fad['query']);_0x6cfcd4[_0xb129('0x38')]=_[_0xb129('0x36')](_0x3a1fad[_0xb129('0x34')],qs[_0xb129('0x37')](_0x596bc3[_0xb129('0x35')]['fields']));_0x6cfcd4[_0xb129('0x38')]=_0x6cfcd4[_0xb129('0x38')][_0xb129('0x4a')]?_0x6cfcd4[_0xb129('0x38')]:_0x3a1fad[_0xb129('0x34')];if(!_0x596bc3[_0xb129('0x35')][_0xb129('0x51')](_0xb129('0x39'))){_0x6cfcd4['limit']=qs[_0xb129('0x22')](_0x596bc3[_0xb129('0x35')]['limit']);_0x6cfcd4[_0xb129('0x20')]=qs[_0xb129('0x20')](_0x596bc3['query'][_0xb129('0x20')]);}_0x6cfcd4[_0xb129('0x3a')]=qs['sort'](_0x596bc3[_0xb129('0x35')]['sort']);_0x6cfcd4['where']=qs[_0xb129('0x3d')](_[_0xb129('0x3e')](_0x596bc3[_0xb129('0x35')],_0x3a1fad[_0xb129('0x3d')]));if(_0x596bc3[_0xb129('0x35')]['filter']){_0x6cfcd4['where']=_[_0xb129('0x3f')](_0x6cfcd4['where'],{'$or':_[_0xb129('0x30')](_0x6cfcd4[_0xb129('0x38')],function(_0x39536b){var _0x5579c4={};_0x5579c4[_0x39536b]={'$like':'%'+_0x596bc3[_0xb129('0x35')][_0xb129('0x41')]+'%'};return _0x5579c4;})});}_0x6cfcd4=_['merge']({},_0x6cfcd4,_0x596bc3[_0xb129('0x42')]);var _0x66c34e={'where':_0x6cfcd4[_0xb129('0x3c')]};return db['VoiceQueueReport'][_0xb129('0x23')](_0x66c34e)[_0xb129('0x2a')](function(_0x338785){_0x2204ff[_0xb129('0x23')]=_0x338785;if(_0x596bc3[_0xb129('0x35')][_0xb129('0x43')]){_0x6cfcd4[_0xb129('0x44')]=[{'all':!![]}];}return db[_0xb129('0x31')][_0xb129('0x45')](_0x6cfcd4);})[_0xb129('0x2a')](function(_0x2f918d){_0x2204ff[_0xb129('0x46')]=_0x2f918d;return _0x2204ff;})[_0xb129('0x2a')](respondWithFilteredResult(_0x20425e,_0x6cfcd4,_0xb129('0x4f')))['catch'](handleError(_0x20425e,null,_0xb129('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 68ed1c3..8fcb3a8 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 _0x1ee0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1ee0,0x10b));var _0x01ee=function(_0x6a9d9,_0x15998d){_0x6a9d9=_0x6a9d9-0x0;var _0x33026c=_0x1ee0[_0x6a9d9];return _0x33026c;};'use strict';var EventEmitter=require(_0x01ee('0x0'));var VoiceQueueReport=require(_0x01ee('0x1'))['db'][_0x01ee('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x01ee('0x3')](0x0);var events={'afterCreate':_0x01ee('0x4'),'afterUpdate':_0x01ee('0x5'),'afterDestroy':_0x01ee('0x6')};function emitEvent(_0x5bd376){return function(_0x59741b,_0x36185f,_0x35854e){VoiceQueueReportEvents[_0x01ee('0x7')](_0x5bd376+':'+_0x59741b['id'],_0x59741b);VoiceQueueReportEvents[_0x01ee('0x7')](_0x5bd376,_0x59741b);_0x35854e(null);};}for(var e in events){if(events[_0x01ee('0x8')](e)){var event=events[e];VoiceQueueReport[_0x01ee('0x9')](e,emitEvent(event));}}module[_0x01ee('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6b94=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x53544c,_0xb36295){var _0x12bcc6=function(_0x580582){while(--_0x580582){_0x53544c['push'](_0x53544c['shift']());}};_0x12bcc6(++_0xb36295);}(_0x6b94,0x1e5));var _0x46b9=function(_0x208429,_0x3f8848){_0x208429=_0x208429-0x0;var _0x406352=_0x6b94[_0x208429];return _0x406352;};'use strict';var EventEmitter=require(_0x46b9('0x0'));var VoiceQueueReport=require(_0x46b9('0x1'))['db'][_0x46b9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x46b9('0x3')](0x0);var events={'afterCreate':_0x46b9('0x4'),'afterUpdate':'update','afterDestroy':_0x46b9('0x5')};function emitEvent(_0x3ab726){return function(_0x1c541f,_0x24312e,_0x183f7c){VoiceQueueReportEvents['emit'](_0x3ab726+':'+_0x1c541f['id'],_0x1c541f);VoiceQueueReportEvents[_0x46b9('0x6')](_0x3ab726,_0x1c541f);_0x183f7c(null);};}for(var e in events){if(events[_0x46b9('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x46b9('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index d023bec..fa47c81 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 _0x37c9=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','util','api','moment'];(function(_0x9b11c9,_0x20548a){var _0x272265=function(_0x30b837){while(--_0x30b837){_0x9b11c9['push'](_0x9b11c9['shift']());}};_0x272265(++_0x20548a);}(_0x37c9,0x81));var _0x937c=function(_0x6b4c2c,_0x307620){_0x6b4c2c=_0x6b4c2c-0x0;var _0x30975b=_0x37c9[_0x6b4c2c];return _0x30975b;};'use strict';var _=require('lodash');var util=require(_0x937c('0x0'));var logger=require('../../config/logger')(_0x937c('0x1'));var moment=require(_0x937c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x937c('0x3'));var rimraf=require(_0x937c('0x4'));var config=require(_0x937c('0x5'));var attributes=require(_0x937c('0x6'));module[_0x937c('0x7')]=function(_0x6dd2d7,_0x3c3ef7){return _0x6dd2d7[_0x937c('0x8')](_0x937c('0x9'),attributes,{'tableName':_0x937c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x937c('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d98=['./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4e8acf,_0x360b15){var _0x5e5a48=function(_0x177174){while(--_0x177174){_0x4e8acf['push'](_0x4e8acf['shift']());}};_0x5e5a48(++_0x360b15);}(_0x3d98,0x1cc));var _0x83d9=function(_0xb532e7,_0x4e98c8){_0xb532e7=_0xb532e7-0x0;var _0x4ff8a6=_0x3d98[_0xb532e7];return _0x4ff8a6;};'use strict';var _=require(_0x83d9('0x0'));var util=require(_0x83d9('0x1'));var logger=require(_0x83d9('0x2'))('api');var moment=require(_0x83d9('0x3'));var BPromise=require(_0x83d9('0x4'));var rp=require(_0x83d9('0x5'));var fs=require('fs');var path=require(_0x83d9('0x6'));var rimraf=require('rimraf');var config=require(_0x83d9('0x7'));var attributes=require(_0x83d9('0x8'));module[_0x83d9('0x9')]=function(_0x4e74cb,_0x407e2d){return _0x4e74cb[_0x83d9('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x83d9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x83d9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d6f0298..0efde4b 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 _0x4cf0=['socket.io-emitter','./voiceQueueReport.socket','register','request','then','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x51ea4d,_0xba551d){var _0x2e6ff3=function(_0x7adf7){while(--_0x7adf7){_0x51ea4d['push'](_0x51ea4d['shift']());}};_0x2e6ff3(++_0xba551d);}(_0x4cf0,0x1ee));var _0x04cf=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4cf0[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04cf('0x0'));var BPromise=require(_0x04cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04cf('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x04cf('0x3'))(_0x04cf('0x4'));var config=require(_0x04cf('0x5'));var jayson=require(_0x04cf('0x6'));var client=jayson[_0x04cf('0x7')][_0x04cf('0x8')]({'port':0x232a});config[_0x04cf('0x9')]=_['defaults'](config[_0x04cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x04cf('0xa'))(new Redis(config[_0x04cf('0x9')]));require(_0x04cf('0xb'))[_0x04cf('0xc')](socket);function respondWithRpcPromise(_0x2bef7e,_0x3260fb,_0x5461f5){return new BPromise(function(_0x58b363,_0x1abac5){return client[_0x04cf('0xd')](_0x2bef7e,_0x5461f5)[_0x04cf('0xe')](function(_0x2e5453){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x3260fb,'request\x20sent');logger[_0x04cf('0xf')](_0x04cf('0x10'),_0x3260fb,_0x04cf('0x11'),JSON[_0x04cf('0x12')](_0x2e5453));if(_0x2e5453[_0x04cf('0x13')]){if(_0x2e5453[_0x04cf('0x13')][_0x04cf('0x14')]===0x1f4){logger['error'](_0x04cf('0x15'),_0x3260fb,_0x2e5453[_0x04cf('0x13')][_0x04cf('0x16')]);return _0x1abac5(_0x2e5453[_0x04cf('0x13')][_0x04cf('0x16')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3260fb,_0x2e5453['error'][_0x04cf('0x16')]);return _0x58b363(_0x2e5453['error'][_0x04cf('0x16')]);}else{logger[_0x04cf('0x17')](_0x04cf('0x15'),_0x3260fb,'request\x20sent');_0x58b363(_0x2e5453[_0x04cf('0x18')][_0x04cf('0x16')]);}})[_0x04cf('0x19')](function(_0x5259fc){logger[_0x04cf('0x13')](_0x04cf('0x15'),_0x3260fb,_0x5259fc);_0x1abac5(_0x5259fc);});});}exports[_0x04cf('0x1a')]=function(_0x28f793){var _0x2403b2=this;return new Promise(function(_0x1c01ee,_0x25157f){return db[_0x04cf('0x1b')][_0x04cf('0x1c')]({'raw':_0x28f793[_0x04cf('0x1d')]?_0x28f793[_0x04cf('0x1d')][_0x04cf('0x1e')]===undefined?!![]:![]:!![],'where':_0x28f793['options']?_0x28f793[_0x04cf('0x1d')][_0x04cf('0x1f')]||null:null,'attributes':_0x28f793[_0x04cf('0x1d')]?_0x28f793[_0x04cf('0x1d')][_0x04cf('0x20')]||null:null,'limit':_0x28f793['options']?_0x28f793[_0x04cf('0x1d')]['limit']||null:null,'include':_0x28f793[_0x04cf('0x1d')]?_0x28f793['options'][_0x04cf('0x21')]?_[_0x04cf('0x22')](_0x28f793[_0x04cf('0x1d')][_0x04cf('0x21')],function(_0x737870){return{'model':db[_0x737870[_0x04cf('0x23')]],'as':_0x737870['as'],'attributes':_0x737870['attributes'],'include':_0x737870[_0x04cf('0x21')]?_['map'](_0x737870[_0x04cf('0x21')],function(_0x244746){return{'model':db[_0x244746[_0x04cf('0x23')]],'as':_0x244746['as'],'attributes':_0x244746[_0x04cf('0x20')],'include':_0x244746['include']?_[_0x04cf('0x22')](_0x244746['include'],function(_0x13c6ee){return{'model':db[_0x13c6ee[_0x04cf('0x23')]],'as':_0x13c6ee['as'],'attributes':_0x13c6ee[_0x04cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x04cf('0xe')](function(_0x450de9){logger['info'](_0x04cf('0x1a'),_0x28f793);logger['debug'](_0x04cf('0x1a'),_0x28f793,JSON[_0x04cf('0x12')](_0x450de9));_0x1c01ee(_0x450de9);})[_0x04cf('0x19')](function(_0x3d6cc8){logger[_0x04cf('0x13')](_0x04cf('0x1a'),_0x3d6cc8[_0x04cf('0x16')],_0x28f793);_0x25157f(_0x2403b2[_0x04cf('0x13')](0x1f4,_0x3d6cc8[_0x04cf('0x16')]));});});};exports[_0x04cf('0x24')]=function(_0x559da2){var _0x5ebde2=this;return new Promise(function(_0x3b1873,_0x1493b4){return db['VoiceQueueReport'][_0x04cf('0x25')](_0x559da2[_0x04cf('0x26')],{'raw':_0x559da2[_0x04cf('0x1d')]?_0x559da2[_0x04cf('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x04cf('0xe')](function(_0x3c3831){logger['info'](_0x04cf('0x24'),_0x559da2);logger['debug']('CreateVoiceQueueReport',_0x559da2,JSON[_0x04cf('0x12')](_0x3c3831));_0x3b1873(_0x3c3831);})[_0x04cf('0x19')](function(_0x30ce99){logger[_0x04cf('0x13')](_0x04cf('0x24'),_0x30ce99[_0x04cf('0x16')],_0x559da2);_0x1493b4(_0x5ebde2[_0x04cf('0x13')](0x1f4,_0x30ce99[_0x04cf('0x16')]));});});};exports[_0x04cf('0x27')]=function(_0x2cd111){var _0x2e0b28=this;return new Promise(function(_0x5e9fa2,_0x531db9){return db[_0x04cf('0x1b')][_0x04cf('0x28')](_0x2cd111['body'],{'raw':_0x2cd111[_0x04cf('0x1d')]?_0x2cd111[_0x04cf('0x1d')][_0x04cf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cd111['options']?_0x2cd111[_0x04cf('0x1d')][_0x04cf('0x1f')]||null:null,'attributes':_0x2cd111[_0x04cf('0x1d')]?_0x2cd111['options'][_0x04cf('0x20')]||null:null,'limit':_0x2cd111[_0x04cf('0x1d')]?_0x2cd111['options'][_0x04cf('0x29')]||null:null})[_0x04cf('0xe')](function(_0x4178c9){logger[_0x04cf('0x17')]('UpdateVoiceQueueReport',_0x2cd111);logger['debug'](_0x04cf('0x27'),_0x2cd111,JSON[_0x04cf('0x12')](_0x4178c9));_0x5e9fa2(_0x4178c9);})[_0x04cf('0x19')](function(_0x26edd4){logger[_0x04cf('0x13')](_0x04cf('0x27'),_0x26edd4[_0x04cf('0x16')],_0x2cd111);_0x531db9(_0x2e0b28['error'](0x1f4,_0x26edd4['message']));});});}; \ No newline at end of file +var _0x6000=['then','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','map','include','model'];(function(_0x229cd2,_0x1ed556){var _0x3804b7=function(_0x3dadff){while(--_0x3dadff){_0x229cd2['push'](_0x229cd2['shift']());}};_0x3804b7(++_0x1ed556);}(_0x6000,0x1b6));var _0x0600=function(_0x270a15,_0x65933d){_0x270a15=_0x270a15-0x0;var _0x280e81=_0x6000[_0x270a15];return _0x280e81;};'use strict';var _=require(_0x0600('0x0'));var util=require('util');var moment=require(_0x0600('0x1'));var BPromise=require(_0x0600('0x2'));var rs=require(_0x0600('0x3'));var fs=require('fs');var Redis=require(_0x0600('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0600('0x5'));var logger=require(_0x0600('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0600('0x7'));var client=jayson[_0x0600('0x8')][_0x0600('0x9')]({'port':0x232a});config[_0x0600('0xa')]=_[_0x0600('0xb')](config[_0x0600('0xa')],{'host':_0x0600('0xc'),'port':0x18eb});var socket=require(_0x0600('0xd'))(new Redis(config[_0x0600('0xa')]));require('./voiceQueueReport.socket')[_0x0600('0xe')](socket);function respondWithRpcPromise(_0x559743,_0x5869f2,_0x2c584f){return new BPromise(function(_0x3f3fa6,_0x26d769){return client[_0x0600('0xf')](_0x559743,_0x2c584f)['then'](function(_0x2594ae){logger['info'](_0x0600('0x10'),_0x5869f2,'request\x20sent');logger[_0x0600('0x11')](_0x0600('0x12'),_0x5869f2,'request\x20sent',JSON['stringify'](_0x2594ae));if(_0x2594ae['error']){if(_0x2594ae[_0x0600('0x13')][_0x0600('0x14')]===0x1f4){logger[_0x0600('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x5869f2,_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);return _0x26d769(_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);}logger[_0x0600('0x13')](_0x0600('0x10'),_0x5869f2,_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);return _0x3f3fa6(_0x2594ae[_0x0600('0x13')]['message']);}else{logger[_0x0600('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x5869f2,'request\x20sent');_0x3f3fa6(_0x2594ae[_0x0600('0x17')][_0x0600('0x15')]);}})[_0x0600('0x18')](function(_0x2dcad1){logger[_0x0600('0x13')](_0x0600('0x10'),_0x5869f2,_0x2dcad1);_0x26d769(_0x2dcad1);});});}exports[_0x0600('0x19')]=function(_0x460bad){var _0x222642=this;return new Promise(function(_0x58e24,_0x224676){return db[_0x0600('0x1a')][_0x0600('0x1b')]({'raw':_0x460bad['options']?_0x460bad['options'][_0x0600('0x1c')]===undefined?!![]:![]:!![],'where':_0x460bad[_0x0600('0x1d')]?_0x460bad['options'][_0x0600('0x1e')]||null:null,'attributes':_0x460bad['options']?_0x460bad[_0x0600('0x1d')][_0x0600('0x1f')]||null:null,'limit':_0x460bad[_0x0600('0x1d')]?_0x460bad['options']['limit']||null:null,'include':_0x460bad[_0x0600('0x1d')]?_0x460bad[_0x0600('0x1d')]['include']?_[_0x0600('0x20')](_0x460bad[_0x0600('0x1d')][_0x0600('0x21')],function(_0x1b719d){return{'model':db[_0x1b719d[_0x0600('0x22')]],'as':_0x1b719d['as'],'attributes':_0x1b719d['attributes'],'include':_0x1b719d[_0x0600('0x21')]?_['map'](_0x1b719d[_0x0600('0x21')],function(_0x59bfb1){return{'model':db[_0x59bfb1[_0x0600('0x22')]],'as':_0x59bfb1['as'],'attributes':_0x59bfb1['attributes'],'include':_0x59bfb1[_0x0600('0x21')]?_[_0x0600('0x20')](_0x59bfb1[_0x0600('0x21')],function(_0x2c25c2){return{'model':db[_0x2c25c2[_0x0600('0x22')]],'as':_0x2c25c2['as'],'attributes':_0x2c25c2[_0x0600('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0600('0x23')](function(_0x2833ac){logger[_0x0600('0x16')](_0x0600('0x19'),_0x460bad);logger['debug'](_0x0600('0x19'),_0x460bad,JSON[_0x0600('0x24')](_0x2833ac));_0x58e24(_0x2833ac);})[_0x0600('0x18')](function(_0x2adced){logger[_0x0600('0x13')](_0x0600('0x19'),_0x2adced[_0x0600('0x15')],_0x460bad);_0x224676(_0x222642[_0x0600('0x13')](0x1f4,_0x2adced[_0x0600('0x15')]));});});};exports[_0x0600('0x25')]=function(_0x1b44a3){var _0x58b80e=this;return new Promise(function(_0x15d2bb,_0x555c3b){return db[_0x0600('0x1a')][_0x0600('0x26')](_0x1b44a3[_0x0600('0x27')],{'raw':_0x1b44a3[_0x0600('0x1d')]?_0x1b44a3[_0x0600('0x1d')][_0x0600('0x1c')]===undefined?!![]:![]:!![]})[_0x0600('0x23')](function(_0xce5d9f){logger['info']('CreateVoiceQueueReport',_0x1b44a3);logger[_0x0600('0x11')]('CreateVoiceQueueReport',_0x1b44a3,JSON[_0x0600('0x24')](_0xce5d9f));_0x15d2bb(_0xce5d9f);})[_0x0600('0x18')](function(_0x13600c){logger['error'](_0x0600('0x25'),_0x13600c[_0x0600('0x15')],_0x1b44a3);_0x555c3b(_0x58b80e[_0x0600('0x13')](0x1f4,_0x13600c['message']));});});};exports[_0x0600('0x28')]=function(_0xbc9d7f){var _0x2cff71=this;return new Promise(function(_0x55f7f8,_0x2c72a7){return db[_0x0600('0x1a')][_0x0600('0x29')](_0xbc9d7f['body'],{'raw':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x1e')]||null:null,'attributes':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x1f')]||null:null,'limit':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x2a')]||null:null})[_0x0600('0x23')](function(_0x3060ff){logger['info'](_0x0600('0x28'),_0xbc9d7f);logger['debug']('UpdateVoiceQueueReport',_0xbc9d7f,JSON['stringify'](_0x3060ff));_0x55f7f8(_0x3060ff);})['catch'](function(_0x39d475){logger[_0x0600('0x13')](_0x0600('0x28'),_0x39d475[_0x0600('0x15')],_0xbc9d7f);_0x2c72a7(_0x2cff71[_0x0600('0x13')](0x1f4,_0x39d475['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7f66890..ecfe279 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 _0x9efe=['remove','update','emit','removeListener','register','voiceQueueReport:','save'];(function(_0xb91c5d,_0x3d4c70){var _0xa8d0b2=function(_0x43887f){while(--_0x43887f){_0xb91c5d['push'](_0xb91c5d['shift']());}};_0xa8d0b2(++_0x3d4c70);}(_0x9efe,0xca));var _0xe9ef=function(_0x46d134,_0x209701){_0x46d134=_0x46d134-0x0;var _0x430d2c=_0x9efe[_0x46d134];return _0x430d2c;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe9ef('0x0'),_0xe9ef('0x1'),_0xe9ef('0x2')];function createListener(_0x24c094,_0x41a87c){return function(_0x50b614){_0x41a87c[_0xe9ef('0x3')](_0x24c094,_0x50b614);};}function removeListener(_0x186a70,_0x3deea3){return function(){VoiceQueueReportEvents[_0xe9ef('0x4')](_0x186a70,_0x3deea3);};}exports[_0xe9ef('0x5')]=function(_0x2cc202){for(var _0x466baf=0x0,_0x58d664=events['length'];_0x466baf<_0x58d664;_0x466baf++){var _0x590cea=events[_0x466baf];var _0x40ffdc=createListener(_0xe9ef('0x6')+_0x590cea,_0x2cc202);VoiceQueueReportEvents['on'](_0x590cea,_0x40ffdc);}}; \ No newline at end of file +var _0xd90b=['register','length','voiceQueueReport:','./voiceQueueReport.events','update','removeListener'];(function(_0x31cba6,_0xa48959){var _0x2bf1a4=function(_0x5cce09){while(--_0x5cce09){_0x31cba6['push'](_0x31cba6['shift']());}};_0x2bf1a4(++_0xa48959);}(_0xd90b,0xbd));var _0xbd90=function(_0x24a537,_0x3d69dc){_0x24a537=_0x24a537-0x0;var _0x3dfc5b=_0xd90b[_0x24a537];return _0x3dfc5b;};'use strict';var VoiceQueueReportEvents=require(_0xbd90('0x0'));var events=['save','remove',_0xbd90('0x1')];function createListener(_0x5a9a50,_0x5e0407){return function(_0x40bb8c){_0x5e0407['emit'](_0x5a9a50,_0x40bb8c);};}function removeListener(_0x3d994c,_0x1813c7){return function(){VoiceQueueReportEvents[_0xbd90('0x2')](_0x3d994c,_0x1813c7);};}exports[_0xbd90('0x3')]=function(_0x448c24){for(var _0x257fd3=0x0,_0x524ad0=events[_0xbd90('0x4')];_0x257fd3<_0x524ad0;_0x257fd3++){var _0x2f612f=events[_0x257fd3];var _0x35be45=createListener(_0xbd90('0x5')+_0x2f612f,_0x448c24);VoiceQueueReportEvents['on'](_0x2f612f,_0x35be45);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 7040ec7..de42075 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 _0x4fde=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','update','destroy'];(function(_0x4344f9,_0x736dd){var _0x28b8a6=function(_0x5ec81e){while(--_0x5ec81e){_0x4344f9['push'](_0x4344f9['shift']());}};_0x28b8a6(++_0x736dd);}(_0x4fde,0x19f));var _0xe4fd=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x4fde[_0x5678b5];return _0x4c09a5;};'use strict';var multer=require(_0xe4fd('0x0'));var util=require(_0xe4fd('0x1'));var path=require(_0xe4fd('0x2'));var timeout=require(_0xe4fd('0x3'));var express=require('express');var router=express[_0xe4fd('0x4')]();var fs_extra=require(_0xe4fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4fd('0x6'));var config=require(_0xe4fd('0x7'));var controller=require(_0xe4fd('0x8'));router[_0xe4fd('0x9')]('/',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0xb')]);router[_0xe4fd('0x9')](_0xe4fd('0xc'),auth[_0xe4fd('0xa')](),controller['show']);router[_0xe4fd('0xd')]('/',auth['isAuthenticated'](),controller[_0xe4fd('0xe')]);router['put']('/:id',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0xf')]);router['delete']('/:id',auth[_0xe4fd('0xa')](),controller[_0xe4fd('0x10')]);module[_0xe4fd('0x11')]=router; \ No newline at end of file +var _0x7d70=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id'];(function(_0x280e8e,_0x39f681){var _0x2d5c1f=function(_0x184fc4){while(--_0x184fc4){_0x280e8e['push'](_0x280e8e['shift']());}};_0x2d5c1f(++_0x39f681);}(_0x7d70,0x12e));var _0x07d7=function(_0x1e903c,_0x11b69c){_0x1e903c=_0x1e903c-0x0;var _0x1c0230=_0x7d70[_0x1e903c];return _0x1c0230;};'use strict';var multer=require(_0x07d7('0x0'));var util=require(_0x07d7('0x1'));var path=require(_0x07d7('0x2'));var timeout=require(_0x07d7('0x3'));var express=require(_0x07d7('0x4'));var router=express['Router']();var fs_extra=require(_0x07d7('0x5'));var auth=require(_0x07d7('0x6'));var interaction=require(_0x07d7('0x7'));var config=require(_0x07d7('0x8'));var controller=require(_0x07d7('0x9'));router[_0x07d7('0xa')]('/',auth[_0x07d7('0xb')](),controller['index']);router[_0x07d7('0xa')](_0x07d7('0xc'),auth[_0x07d7('0xb')](),controller[_0x07d7('0xd')]);router[_0x07d7('0xe')]('/',auth[_0x07d7('0xb')](),controller[_0x07d7('0xf')]);router[_0x07d7('0x10')]('/:id',auth[_0x07d7('0xb')](),controller[_0x07d7('0x11')]);router[_0x07d7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x07d7('0x13')]);module[_0x07d7('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 129fd4c..5de6d8d 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 _0x3ecc=['exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x2ad99e,_0x4c8769){var _0x3ddc5c=function(_0x1bd422){while(--_0x1bd422){_0x2ad99e['push'](_0x2ad99e['shift']());}};_0x3ddc5c(++_0x4c8769);}(_0x3ecc,0xd1));var _0xc3ec=function(_0x12c7de,_0x39debe){_0x12c7de=_0x12c7de-0x0;var _0x5bcbfd=_0x3ecc[_0x12c7de];return _0x5bcbfd;};'use strict';var Sequelize=require(_0xc3ec('0x0'));var moment=require('moment');module[_0xc3ec('0x1')]={'time':{'type':Sequelize[_0xc3ec('0x2')]},'callid':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc3ec('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc3ec('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xc3ec('0x4')](_0xc3ec('0x5'))}}; \ No newline at end of file +var _0x9010=['sequelize','moment','STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3416d9,_0x6a56f9){var _0x589ad9=function(_0x451180){while(--_0x451180){_0x3416d9['push'](_0x3416d9['shift']());}};_0x589ad9(++_0x6a56f9);}(_0x9010,0x98));var _0x0901=function(_0x52903e,_0x360bfb){_0x52903e=_0x52903e-0x0;var _0x1a86e6=_0x9010[_0x52903e];return _0x1a86e6;};'use strict';var Sequelize=require(_0x0901('0x0'));var moment=require(_0x0901('0x1'));module['exports']={'time':{'type':Sequelize[_0x0901('0x2')]},'callid':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0x0901('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 48b0721..2199ed6 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 _0x4d2f=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5ca03b,_0x48bc49){var _0xa1257b=function(_0x1ae7e2){while(--_0x1ae7e2){_0x5ca03b['push'](_0x5ca03b['shift']());}};_0xa1257b(++_0x48bc49);}(_0x4d2f,0x199));var _0xf4d2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4d2f[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf4d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4d2('0x1'));var jsonpatch=require(_0xf4d2('0x2'));var rp=require(_0xf4d2('0x3'));var moment=require(_0xf4d2('0x4'));var BPromise=require(_0xf4d2('0x5'));var Mustache=require(_0xf4d2('0x6'));var util=require(_0xf4d2('0x7'));var path=require(_0xf4d2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4d2('0x9'));var _=require(_0xf4d2('0xa'));var squel=require(_0xf4d2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf4d2('0xc'));var toCsv=require(_0xf4d2('0xd'));var querystring=require(_0xf4d2('0xe'));var Papa=require(_0xf4d2('0xf'));var Redis=require('ioredis');var authService=require(_0xf4d2('0x10'));var qs=require(_0xf4d2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4d2('0x12'));var logger=require('../../config/logger')(_0xf4d2('0x13'));var utils=require(_0xf4d2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf4d2('0x15'));var db=require(_0xf4d2('0x16'))['db'];function respondWithStatusCode(_0x9a339c,_0x1c9ae1){_0x1c9ae1=_0x1c9ae1||0xcc;return function(_0x4cefcb){if(_0x4cefcb){return _0x9a339c['sendStatus'](_0x1c9ae1);}return _0x9a339c[_0xf4d2('0x17')](_0x1c9ae1)[_0xf4d2('0x18')]();};}function respondWithResult(_0x420033,_0x5a6eb9){_0x5a6eb9=_0x5a6eb9||0xc8;return function(_0x244776){if(_0x244776){return _0x420033['status'](_0x5a6eb9)['json'](_0x244776);}};}function respondWithFilteredResult(_0x39e416,_0x5a98ed){return function(_0x44f3de){if(_0x44f3de){var _0x37752f=typeof _0x5a98ed[_0xf4d2('0x19')]===_0xf4d2('0x1a')&&typeof _0x5a98ed[_0xf4d2('0x1b')]===_0xf4d2('0x1a');var _0x4694c0=_0x44f3de[_0xf4d2('0x1c')];var _0x10e6cd=_0x37752f?0x0:_0x5a98ed[_0xf4d2('0x19')];var _0x550643=_0x37752f?_0x44f3de['count']:_0x5a98ed[_0xf4d2('0x19')]+_0x5a98ed[_0xf4d2('0x1b')];var _0x56242e;if(_0x550643>=_0x4694c0){_0x550643=_0x4694c0;_0x56242e=0xc8;}else{_0x56242e=0xce;}_0x39e416['status'](_0x56242e);return _0x39e416['set'](_0xf4d2('0x1d'),_0x10e6cd+'-'+_0x550643+'/'+_0x4694c0)[_0xf4d2('0x1e')](_0x44f3de);}return null;};}function patchUpdates(_0x17ef70){return function(_0x5ca6d7){try{jsonpatch[_0xf4d2('0x1f')](_0x5ca6d7,_0x17ef70,!![]);}catch(_0x2ea633){return BPromise[_0xf4d2('0x20')](_0x2ea633);}return _0x5ca6d7[_0xf4d2('0x21')]();};}function saveUpdates(_0x48cd06,_0x41810b){return function(_0x38d1d5){if(_0x38d1d5){return _0x38d1d5[_0xf4d2('0x22')](_0x48cd06)['then'](function(_0x13fd03){return _0x13fd03;});}return null;};}function removeEntity(_0x235e98,_0x54ce87){return function(_0x464add){if(_0x464add){return _0x464add[_0xf4d2('0x23')]()[_0xf4d2('0x24')](function(){_0x235e98['status'](0xcc)[_0xf4d2('0x18')]();});}};}function handleEntityNotFound(_0x4d1237,_0x4b8344){return function(_0xc1f053){if(!_0xc1f053){_0x4d1237['sendStatus'](0x194);}return _0xc1f053;};}function handleError(_0x320618,_0x531a3a){_0x531a3a=_0x531a3a||0x1f4;return function(_0x38c4a7){logger[_0xf4d2('0x25')](_0x38c4a7[_0xf4d2('0x26')]);if(_0x38c4a7[_0xf4d2('0x27')]){delete _0x38c4a7[_0xf4d2('0x27')];}_0x320618[_0xf4d2('0x17')](_0x531a3a)[_0xf4d2('0x28')](_0x38c4a7);};}exports[_0xf4d2('0x29')]=function(_0x534437,_0x1e7d85){var _0x4377d7={},_0x3949bb={},_0x1f0241={'count':0x0,'rows':[]};var _0x5c9b36=_[_0xf4d2('0x2a')](db[_0xf4d2('0x2b')][_0xf4d2('0x2c')],function(_0x1d7747){return{'name':_0x1d7747['fieldName'],'type':_0x1d7747[_0xf4d2('0x2d')][_0xf4d2('0x2e')]};});_0x3949bb[_0xf4d2('0x2f')]=_['map'](_0x5c9b36,'name');_0x3949bb['query']=_[_0xf4d2('0x30')](_0x534437[_0xf4d2('0x31')]);_0x3949bb[_0xf4d2('0x32')]=_[_0xf4d2('0x33')](_0x3949bb[_0xf4d2('0x2f')],_0x3949bb[_0xf4d2('0x31')]);_0x4377d7[_0xf4d2('0x34')]=_['intersection'](_0x3949bb[_0xf4d2('0x2f')],qs[_0xf4d2('0x35')](_0x534437[_0xf4d2('0x31')][_0xf4d2('0x35')]));_0x4377d7[_0xf4d2('0x34')]=_0x4377d7[_0xf4d2('0x34')][_0xf4d2('0x36')]?_0x4377d7[_0xf4d2('0x34')]:_0x3949bb[_0xf4d2('0x2f')];if(!_0x534437['query'][_0xf4d2('0x37')](_0xf4d2('0x38'))){_0x4377d7[_0xf4d2('0x1b')]=qs[_0xf4d2('0x1b')](_0x534437[_0xf4d2('0x31')]['limit']);_0x4377d7[_0xf4d2('0x19')]=qs[_0xf4d2('0x19')](_0x534437['query'][_0xf4d2('0x19')]);}_0x4377d7['order']=qs[_0xf4d2('0x39')](_0x534437[_0xf4d2('0x31')][_0xf4d2('0x39')]);_0x4377d7[_0xf4d2('0x3a')]=qs['filters'](_['pick'](_0x534437['query'],_0x3949bb[_0xf4d2('0x32')]),_0x5c9b36);if(_0x534437[_0xf4d2('0x31')][_0xf4d2('0x3b')]){_0x4377d7[_0xf4d2('0x3a')]=_[_0xf4d2('0x3c')](_0x4377d7[_0xf4d2('0x3a')],{'$or':_[_0xf4d2('0x2a')](_0x5c9b36,function(_0x33e30c){if(_0x33e30c[_0xf4d2('0x2d')]!==_0xf4d2('0x3d')){var _0x5e92f0={};_0x5e92f0[_0x33e30c['name']]={'$like':'%'+_0x534437['query']['filter']+'%'};return _0x5e92f0;}})});}_0x4377d7=_[_0xf4d2('0x3c')]({},_0x4377d7,_0x534437[_0xf4d2('0x3e')]);var _0x9b37d0={'where':_0x4377d7[_0xf4d2('0x3a')]};return db[_0xf4d2('0x2b')]['count'](_0x9b37d0)[_0xf4d2('0x24')](function(_0x47cbdf){_0x1f0241['count']=_0x47cbdf;if(_0x534437[_0xf4d2('0x31')][_0xf4d2('0x3f')]){_0x4377d7[_0xf4d2('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xf4d2('0x41')](_0x4377d7);})[_0xf4d2('0x24')](function(_0x166e20){_0x1f0241['rows']=_0x166e20;return _0x1f0241;})['then'](respondWithFilteredResult(_0x1e7d85,_0x4377d7))[_0xf4d2('0x42')](handleError(_0x1e7d85,null));};exports[_0xf4d2('0x43')]=function(_0x181958,_0x57ef8d){var _0x5a194c={'raw':!![],'where':{'id':_0x181958['params']['id']}},_0x349fbd={};_0x349fbd[_0xf4d2('0x2f')]=_[_0xf4d2('0x30')](db[_0xf4d2('0x2b')][_0xf4d2('0x2c')]);_0x349fbd['query']=_[_0xf4d2('0x30')](_0x181958[_0xf4d2('0x31')]);_0x349fbd[_0xf4d2('0x32')]=_[_0xf4d2('0x33')](_0x349fbd['model'],_0x349fbd['query']);_0x5a194c['attributes']=_[_0xf4d2('0x33')](_0x349fbd['model'],qs[_0xf4d2('0x35')](_0x181958[_0xf4d2('0x31')][_0xf4d2('0x35')]));_0x5a194c['attributes']=_0x5a194c[_0xf4d2('0x34')][_0xf4d2('0x36')]?_0x5a194c[_0xf4d2('0x34')]:_0x349fbd[_0xf4d2('0x2f')];if(_0x181958[_0xf4d2('0x31')][_0xf4d2('0x3f')]){_0x5a194c[_0xf4d2('0x40')]=[{'all':!![]}];}_0x5a194c=_[_0xf4d2('0x3c')]({},_0x5a194c,_0x181958[_0xf4d2('0x3e')]);return db[_0xf4d2('0x2b')][_0xf4d2('0x44')](_0x5a194c)['then'](handleEntityNotFound(_0x57ef8d,null))[_0xf4d2('0x24')](respondWithResult(_0x57ef8d,null))['catch'](handleError(_0x57ef8d,null));};exports['create']=function(_0x5eb1eb,_0x29c479){return db[_0xf4d2('0x2b')][_0xf4d2('0x45')](_0x5eb1eb[_0xf4d2('0x46')],{})[_0xf4d2('0x24')](respondWithResult(_0x29c479,0xc9))['catch'](handleError(_0x29c479,null));};exports[_0xf4d2('0x22')]=function(_0x26cedc,_0x442f66){if(_0x26cedc['body']['id']){delete _0x26cedc[_0xf4d2('0x46')]['id'];}return db[_0xf4d2('0x2b')]['find']({'where':{'id':_0x26cedc[_0xf4d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x442f66,null))[_0xf4d2('0x24')](saveUpdates(_0x26cedc[_0xf4d2('0x46')],null))[_0xf4d2('0x24')](respondWithResult(_0x442f66,null))[_0xf4d2('0x42')](handleError(_0x442f66,null));};exports['destroy']=function(_0x35cdf8,_0x43ae35){return db[_0xf4d2('0x2b')][_0xf4d2('0x44')]({'where':{'id':_0x35cdf8[_0xf4d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x43ae35,null))[_0xf4d2('0x24')](removeEntity(_0x43ae35,null))[_0xf4d2('0x42')](handleError(_0x43ae35,null));}; \ No newline at end of file +var _0x4b50=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','index','VoiceQueuesLog','fieldName','type','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','findAll','catch','params','rawAttributes','fields','include','options','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x10b465,_0x2cccb8){var _0x550ddc=function(_0x192664){while(--_0x192664){_0x10b465['push'](_0x10b465['shift']());}};_0x550ddc(++_0x2cccb8);}(_0x4b50,0x1ea));var _0x04b5=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x4b50[_0x8a969d];return _0x1d8dc7;};'use strict';var emlformat=require(_0x04b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04b5('0x1'));var jsonpatch=require(_0x04b5('0x2'));var rp=require(_0x04b5('0x3'));var moment=require('moment');var BPromise=require(_0x04b5('0x4'));var Mustache=require(_0x04b5('0x5'));var util=require('util');var path=require(_0x04b5('0x6'));var sox=require(_0x04b5('0x7'));var csv=require('to-csv');var ejs=require(_0x04b5('0x8'));var fs=require('fs');var fs_extra=require(_0x04b5('0x9'));var _=require(_0x04b5('0xa'));var squel=require('squel');var crypto=require(_0x04b5('0xb'));var jsforce=require(_0x04b5('0xc'));var deskjs=require(_0x04b5('0xd'));var toCsv=require(_0x04b5('0xe'));var querystring=require(_0x04b5('0xf'));var Papa=require(_0x04b5('0x10'));var Redis=require(_0x04b5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04b5('0x12'));var as=require(_0x04b5('0x13'));var hardwareService=require(_0x04b5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x04b5('0x15'));var config=require(_0x04b5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x04b5('0x17'))['db'];function respondWithStatusCode(_0xf2abda,_0x5d6c77){_0x5d6c77=_0x5d6c77||0xcc;return function(_0x24def2){if(_0x24def2){return _0xf2abda[_0x04b5('0x18')](_0x5d6c77);}return _0xf2abda['status'](_0x5d6c77)[_0x04b5('0x19')]();};}function respondWithResult(_0xa8253a,_0x39708e){_0x39708e=_0x39708e||0xc8;return function(_0x3245d8){if(_0x3245d8){return _0xa8253a[_0x04b5('0x1a')](_0x39708e)[_0x04b5('0x1b')](_0x3245d8);}};}function respondWithFilteredResult(_0x3d5596,_0x338bd5){return function(_0x5dafcd){if(_0x5dafcd){var _0x16f280=typeof _0x338bd5[_0x04b5('0x1c')]===_0x04b5('0x1d')&&typeof _0x338bd5['limit']===_0x04b5('0x1d');var _0x5e2748=_0x5dafcd[_0x04b5('0x1e')];var _0x1dabb7=_0x16f280?0x0:_0x338bd5['offset'];var _0x2095f9=_0x16f280?_0x5dafcd[_0x04b5('0x1e')]:_0x338bd5[_0x04b5('0x1c')]+_0x338bd5[_0x04b5('0x1f')];var _0x315ced;if(_0x2095f9>=_0x5e2748){_0x2095f9=_0x5e2748;_0x315ced=0xc8;}else{_0x315ced=0xce;}_0x3d5596[_0x04b5('0x1a')](_0x315ced);return _0x3d5596[_0x04b5('0x20')](_0x04b5('0x21'),_0x1dabb7+'-'+_0x2095f9+'/'+_0x5e2748)['json'](_0x5dafcd);}return null;};}function patchUpdates(_0x4e0c9a){return function(_0x5ce3c3){try{jsonpatch[_0x04b5('0x22')](_0x5ce3c3,_0x4e0c9a,!![]);}catch(_0x119b29){return BPromise[_0x04b5('0x23')](_0x119b29);}return _0x5ce3c3[_0x04b5('0x24')]();};}function saveUpdates(_0x151f56,_0x19f26f){return function(_0x1d10d5){if(_0x1d10d5){return _0x1d10d5['update'](_0x151f56)[_0x04b5('0x25')](function(_0x3f7c23){return _0x3f7c23;});}return null;};}function removeEntity(_0x2fd002,_0x4600c8){return function(_0x44a421){if(_0x44a421){return _0x44a421[_0x04b5('0x26')]()[_0x04b5('0x25')](function(){_0x2fd002[_0x04b5('0x1a')](0xcc)[_0x04b5('0x19')]();});}};}function handleEntityNotFound(_0x408b44,_0x43f17d){return function(_0x1c21ac){if(!_0x1c21ac){_0x408b44[_0x04b5('0x18')](0x194);}return _0x1c21ac;};}function handleError(_0x2399e3,_0x3f812d){_0x3f812d=_0x3f812d||0x1f4;return function(_0x2438dc){logger['error'](_0x2438dc['stack']);if(_0x2438dc[_0x04b5('0x27')]){delete _0x2438dc[_0x04b5('0x27')];}_0x2399e3[_0x04b5('0x1a')](_0x3f812d)['send'](_0x2438dc);};}exports[_0x04b5('0x28')]=function(_0x576944,_0x415025){var _0x401a42={},_0x49cc5a={},_0x38db71={'count':0x0,'rows':[]};var _0x188df6=_['map'](db[_0x04b5('0x29')]['rawAttributes'],function(_0x50f1af){return{'name':_0x50f1af[_0x04b5('0x2a')],'type':_0x50f1af[_0x04b5('0x2b')]['key']};});_0x49cc5a[_0x04b5('0x2c')]=_[_0x04b5('0x2d')](_0x188df6,_0x04b5('0x27'));_0x49cc5a[_0x04b5('0x2e')]=_[_0x04b5('0x2f')](_0x576944[_0x04b5('0x2e')]);_0x49cc5a['filters']=_[_0x04b5('0x30')](_0x49cc5a['model'],_0x49cc5a['query']);_0x401a42[_0x04b5('0x31')]=_[_0x04b5('0x30')](_0x49cc5a['model'],qs['fields'](_0x576944['query']['fields']));_0x401a42[_0x04b5('0x31')]=_0x401a42[_0x04b5('0x31')][_0x04b5('0x32')]?_0x401a42['attributes']:_0x49cc5a[_0x04b5('0x2c')];if(!_0x576944[_0x04b5('0x2e')][_0x04b5('0x33')](_0x04b5('0x34'))){_0x401a42[_0x04b5('0x1f')]=qs[_0x04b5('0x1f')](_0x576944['query'][_0x04b5('0x1f')]);_0x401a42[_0x04b5('0x1c')]=qs[_0x04b5('0x1c')](_0x576944[_0x04b5('0x2e')][_0x04b5('0x1c')]);}_0x401a42[_0x04b5('0x35')]=qs['sort'](_0x576944['query'][_0x04b5('0x36')]);_0x401a42[_0x04b5('0x37')]=qs['filters'](_['pick'](_0x576944[_0x04b5('0x2e')],_0x49cc5a[_0x04b5('0x38')]),_0x188df6);if(_0x576944[_0x04b5('0x2e')]['filter']){_0x401a42[_0x04b5('0x37')]=_[_0x04b5('0x39')](_0x401a42[_0x04b5('0x37')],{'$or':_[_0x04b5('0x2d')](_0x188df6,function(_0x54b20e){if(_0x54b20e[_0x04b5('0x2b')]!==_0x04b5('0x3a')){var _0x2bcadb={};_0x2bcadb[_0x54b20e[_0x04b5('0x27')]]={'$like':'%'+_0x576944[_0x04b5('0x2e')][_0x04b5('0x3b')]+'%'};return _0x2bcadb;}})});}_0x401a42=_[_0x04b5('0x39')]({},_0x401a42,_0x576944['options']);var _0x3fb17f={'where':_0x401a42[_0x04b5('0x37')]};return db[_0x04b5('0x29')][_0x04b5('0x1e')](_0x3fb17f)['then'](function(_0x2c8e40){_0x38db71[_0x04b5('0x1e')]=_0x2c8e40;if(_0x576944[_0x04b5('0x2e')][_0x04b5('0x3c')]){_0x401a42['include']=[{'all':!![]}];}return db[_0x04b5('0x29')][_0x04b5('0x3d')](_0x401a42);})[_0x04b5('0x25')](function(_0x4b0ea2){_0x38db71['rows']=_0x4b0ea2;return _0x38db71;})[_0x04b5('0x25')](respondWithFilteredResult(_0x415025,_0x401a42))[_0x04b5('0x3e')](handleError(_0x415025,null));};exports['show']=function(_0x3f36ee,_0x58ce15){var _0x3ad4a2={'raw':!![],'where':{'id':_0x3f36ee[_0x04b5('0x3f')]['id']}},_0x409897={};_0x409897[_0x04b5('0x2c')]=_[_0x04b5('0x2f')](db[_0x04b5('0x29')][_0x04b5('0x40')]);_0x409897[_0x04b5('0x2e')]=_[_0x04b5('0x2f')](_0x3f36ee[_0x04b5('0x2e')]);_0x409897[_0x04b5('0x38')]=_[_0x04b5('0x30')](_0x409897[_0x04b5('0x2c')],_0x409897[_0x04b5('0x2e')]);_0x3ad4a2[_0x04b5('0x31')]=_[_0x04b5('0x30')](_0x409897[_0x04b5('0x2c')],qs[_0x04b5('0x41')](_0x3f36ee[_0x04b5('0x2e')][_0x04b5('0x41')]));_0x3ad4a2[_0x04b5('0x31')]=_0x3ad4a2[_0x04b5('0x31')][_0x04b5('0x32')]?_0x3ad4a2[_0x04b5('0x31')]:_0x409897[_0x04b5('0x2c')];if(_0x3f36ee[_0x04b5('0x2e')][_0x04b5('0x3c')]){_0x3ad4a2[_0x04b5('0x42')]=[{'all':!![]}];}_0x3ad4a2=_[_0x04b5('0x39')]({},_0x3ad4a2,_0x3f36ee[_0x04b5('0x43')]);return db[_0x04b5('0x29')][_0x04b5('0x44')](_0x3ad4a2)[_0x04b5('0x25')](handleEntityNotFound(_0x58ce15,null))['then'](respondWithResult(_0x58ce15,null))[_0x04b5('0x3e')](handleError(_0x58ce15,null));};exports[_0x04b5('0x45')]=function(_0x422cd3,_0x2f4df3){return db[_0x04b5('0x29')][_0x04b5('0x45')](_0x422cd3['body'],{})[_0x04b5('0x25')](respondWithResult(_0x2f4df3,0xc9))[_0x04b5('0x3e')](handleError(_0x2f4df3,null));};exports[_0x04b5('0x46')]=function(_0x50e24d,_0x2385cb){if(_0x50e24d['body']['id']){delete _0x50e24d[_0x04b5('0x47')]['id'];}return db[_0x04b5('0x29')][_0x04b5('0x44')]({'where':{'id':_0x50e24d[_0x04b5('0x3f')]['id']}})[_0x04b5('0x25')](handleEntityNotFound(_0x2385cb,null))[_0x04b5('0x25')](saveUpdates(_0x50e24d[_0x04b5('0x47')],null))[_0x04b5('0x25')](respondWithResult(_0x2385cb,null))[_0x04b5('0x3e')](handleError(_0x2385cb,null));};exports['destroy']=function(_0x45dedc,_0x9170fc){return db[_0x04b5('0x29')][_0x04b5('0x44')]({'where':{'id':_0x45dedc[_0x04b5('0x3f')]['id']}})[_0x04b5('0x25')](handleEntityNotFound(_0x9170fc,null))[_0x04b5('0x25')](removeEntity(_0x9170fc,null))['catch'](handleError(_0x9170fc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 487e156..aa7a285 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 _0xe343=['./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x337d59,_0x28a50f){var _0x4f99d8=function(_0xcf83f3){while(--_0xcf83f3){_0x337d59['push'](_0x337d59['shift']());}};_0x4f99d8(++_0x28a50f);}(_0xe343,0x6e));var _0x3e34=function(_0x5d4460,_0x400e28){_0x5d4460=_0x5d4460-0x0;var _0x5bdc5e=_0xe343[_0x5d4460];return _0x5bdc5e;};'use strict';var _=require(_0x3e34('0x0'));var util=require(_0x3e34('0x1'));var logger=require(_0x3e34('0x2'))('api');var moment=require(_0x3e34('0x3'));var BPromise=require(_0x3e34('0x4'));var rp=require(_0x3e34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e34('0x6'));var attributes=require(_0x3e34('0x7'));module[_0x3e34('0x8')]=function(_0x2b0223,_0x418c19){return _0x2b0223[_0x3e34('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x3e34('0xa'),'paranoid':![],'indexes':[{'name':_0x3e34('0xb'),'fields':[_0x3e34('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x2746=['request-promise','path','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','../../config/logger','api','moment','bluebird'];(function(_0x4da39b,_0x8eae6){var _0x4d6739=function(_0x4936f0){while(--_0x4936f0){_0x4da39b['push'](_0x4da39b['shift']());}};_0x4d6739(++_0x8eae6);}(_0x2746,0x19c));var _0x6274=function(_0xee396,_0x496dce){_0xee396=_0xee396-0x0;var _0xc95140=_0x2746[_0xee396];return _0xc95140;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6274('0x0'))(_0x6274('0x1'));var moment=require(_0x6274('0x2'));var BPromise=require(_0x6274('0x3'));var rp=require(_0x6274('0x4'));var fs=require('fs');var path=require(_0x6274('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6274('0x6'));module[_0x6274('0x7')]=function(_0x1978ff,_0x534aee){return _0x1978ff[_0x6274('0x8')](_0x6274('0x9'),attributes,{'tableName':_0x6274('0xa'),'paranoid':![],'indexes':[{'name':_0x6274('0xb'),'fields':[_0x6274('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 9c1849c..9fc06d0 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 _0x4f88=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x176c38,_0x4f51a8){var _0x3bce97=function(_0x418911){while(--_0x418911){_0x176c38['push'](_0x176c38['shift']());}};_0x3bce97(++_0x4f51a8);}(_0x4f88,0xf3));var _0x84f8=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x4f88[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var moment=require('moment');var BPromise=require(_0x84f8('0x2'));var rs=require(_0x84f8('0x3'));var fs=require('fs');var Redis=require(_0x84f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84f8('0x5'))(_0x84f8('0x6'));var config=require(_0x84f8('0x7'));var jayson=require(_0x84f8('0x8'));var client=jayson[_0x84f8('0x9')][_0x84f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa345,_0x11747c,_0x40e5f3){return new BPromise(function(_0x4ae430,_0x4a09d3){return client[_0x84f8('0xb')](_0x5aa345,_0x40e5f3)[_0x84f8('0xc')](function(_0x432edd){logger[_0x84f8('0xd')](_0x84f8('0xe'),_0x11747c,_0x84f8('0xf'));logger[_0x84f8('0x10')](_0x84f8('0x11'),_0x11747c,'request\x20sent',JSON['stringify'](_0x432edd));if(_0x432edd[_0x84f8('0x12')]){if(_0x432edd[_0x84f8('0x12')][_0x84f8('0x13')]===0x1f4){logger[_0x84f8('0x12')](_0x84f8('0xe'),_0x11747c,_0x432edd['error'][_0x84f8('0x14')]);return _0x4a09d3(_0x432edd[_0x84f8('0x12')][_0x84f8('0x14')]);}logger[_0x84f8('0x12')](_0x84f8('0xe'),_0x11747c,_0x432edd['error'][_0x84f8('0x14')]);return _0x4ae430(_0x432edd[_0x84f8('0x12')][_0x84f8('0x14')]);}else{logger[_0x84f8('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x11747c,_0x84f8('0xf'));_0x4ae430(_0x432edd['result'][_0x84f8('0x14')]);}})[_0x84f8('0x15')](function(_0x1eba7e){logger['error'](_0x84f8('0xe'),_0x11747c,_0x1eba7e);_0x4a09d3(_0x1eba7e);});});} \ No newline at end of file +var _0x4c73=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3c3982,_0x163010){var _0x66448f=function(_0x35f37f){while(--_0x35f37f){_0x3c3982['push'](_0x3c3982['shift']());}};_0x66448f(++_0x163010);}(_0x4c73,0x14c));var _0x34c7=function(_0x1b44bb,_0x34a5d4){_0x1b44bb=_0x1b44bb-0x0;var _0x1672ff=_0x4c73[_0x1b44bb];return _0x1672ff;};'use strict';var _=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var moment=require(_0x34c7('0x2'));var BPromise=require(_0x34c7('0x3'));var rs=require(_0x34c7('0x4'));var fs=require('fs');var Redis=require(_0x34c7('0x5'));var db=require(_0x34c7('0x6'))['db'];var utils=require(_0x34c7('0x7'));var logger=require('../../config/logger')(_0x34c7('0x8'));var config=require(_0x34c7('0x9'));var jayson=require(_0x34c7('0xa'));var client=jayson[_0x34c7('0xb')][_0x34c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x758dae,_0x4aaefc,_0x1f5afc){return new BPromise(function(_0x4a9793,_0x6cf575){return client[_0x34c7('0xd')](_0x758dae,_0x1f5afc)['then'](function(_0x439d7b){logger['info'](_0x34c7('0xe'),_0x4aaefc,_0x34c7('0xf'));logger[_0x34c7('0x10')](_0x34c7('0x11'),_0x4aaefc,_0x34c7('0xf'),JSON[_0x34c7('0x12')](_0x439d7b));if(_0x439d7b[_0x34c7('0x13')]){if(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x14')]===0x1f4){logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);return _0x6cf575(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);}logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x439d7b[_0x34c7('0x13')]['message']);return _0x4a9793(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);}else{logger['info'](_0x34c7('0xe'),_0x4aaefc,_0x34c7('0xf'));_0x4a9793(_0x439d7b[_0x34c7('0x16')][_0x34c7('0x15')]);}})[_0x34c7('0x17')](function(_0x169f43){logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x169f43);_0x6cf575(_0x169f43);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 24da860..4318e4d 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 _0xb2d8=['update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2d8,0xc7));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8b2d('0x0'));var util=require('util');var path=require(_0x8b2d('0x1'));var timeout=require(_0x8b2d('0x2'));var express=require(_0x8b2d('0x3'));var router=express['Router']();var fs_extra=require(_0x8b2d('0x4'));var auth=require(_0x8b2d('0x5'));var interaction=require(_0x8b2d('0x6'));var config=require(_0x8b2d('0x7'));var controller=require(_0x8b2d('0x8'));router[_0x8b2d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b2d('0x9')](_0x8b2d('0xa'),auth[_0x8b2d('0xb')](),controller[_0x8b2d('0xc')]);router[_0x8b2d('0x9')]('/:id',auth[_0x8b2d('0xb')](),controller[_0x8b2d('0xd')]);router[_0x8b2d('0x9')](_0x8b2d('0xe'),auth[_0x8b2d('0xb')](),controller[_0x8b2d('0xf')]);router[_0x8b2d('0x9')](_0x8b2d('0x10'),controller[_0x8b2d('0x11')]);router['get'](_0x8b2d('0x12'),auth['isAuthenticated'](),controller[_0x8b2d('0x13')]);router['post']('/',auth[_0x8b2d('0xb')](),controller[_0x8b2d('0x14')]);router[_0x8b2d('0x15')](_0x8b2d('0x12'),auth[_0x8b2d('0xb')](),controller[_0x8b2d('0x16')]);router[_0x8b2d('0x17')](_0x8b2d('0x18'),auth[_0x8b2d('0xb')](),controller[_0x8b2d('0x19')]);router['delete']('/:id',auth[_0x8b2d('0xb')](),controller[_0x8b2d('0x1a')]);module[_0x8b2d('0x1b')]=router; \ No newline at end of file +var _0x5ba7=['/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/download'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5ba7,0x1df));var _0x75ba=function(_0x27e0c6,_0x472b19){_0x27e0c6=_0x27e0c6-0x0;var _0x11ddb9=_0x5ba7[_0x27e0c6];return _0x11ddb9;};'use strict';var multer=require('multer');var util=require(_0x75ba('0x0'));var path=require(_0x75ba('0x1'));var timeout=require(_0x75ba('0x2'));var express=require(_0x75ba('0x3'));var router=express[_0x75ba('0x4')]();var fs_extra=require(_0x75ba('0x5'));var auth=require(_0x75ba('0x6'));var interaction=require(_0x75ba('0x7'));var config=require(_0x75ba('0x8'));var controller=require('./voiceRecording.controller');router[_0x75ba('0x9')]('/',auth['isAuthenticated'](),controller[_0x75ba('0xa')]);router[_0x75ba('0x9')]('/describe',auth[_0x75ba('0xb')](),controller[_0x75ba('0xc')]);router[_0x75ba('0x9')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller['show']);router[_0x75ba('0x9')](_0x75ba('0xe'),auth[_0x75ba('0xb')](),controller['download']);router['get'](_0x75ba('0xf'),controller[_0x75ba('0x10')]);router['get'](_0x75ba('0x11'),auth['isAuthenticated'](),controller[_0x75ba('0x12')]);router['post']('/',auth[_0x75ba('0xb')](),controller['create']);router[_0x75ba('0x13')](_0x75ba('0x11'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x14')]);router[_0x75ba('0x15')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x16')]);router[_0x75ba('0x17')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x18')]);module[_0x75ba('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ce16c15..c7dc255 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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 44f41bc..1bc9fa8 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 _0x44b4=['decryptFile','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','runSentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../config/logger','api','../../config/environment','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','extname','Entity\x20not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x44b4,0x1c8));var _0x444b=function(_0x2ec76d,_0x533bf4){_0x2ec76d=_0x2ec76d-0x0;var _0x1fb57b=_0x44b4[_0x2ec76d];return _0x1fb57b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x444b('0x0'));var jsonpatch=require(_0x444b('0x1'));var rp=require(_0x444b('0x2'));var moment=require(_0x444b('0x3'));var BPromise=require(_0x444b('0x4'));var Mustache=require(_0x444b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x444b('0x6'));var ejs=require(_0x444b('0x7'));var fs=require('fs');var fs_extra=require(_0x444b('0x8'));var _=require(_0x444b('0x9'));var squel=require(_0x444b('0xa'));var crypto=require(_0x444b('0xb'));var jsforce=require(_0x444b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x444b('0xd'));var Papa=require(_0x444b('0xe'));var AWS=require(_0x444b('0xf'));var uuidv4=require(_0x444b('0x10'));var Redis=require('ioredis');var authService=require(_0x444b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x444b('0x12'))(_0x444b('0x13'));var utils=require('../../config/utils');var config=require(_0x444b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7a50db,_0x578ffe){_0x578ffe=_0x578ffe||0xcc;return function(_0x1ddc3a){if(_0x1ddc3a){return _0x7a50db['sendStatus'](_0x578ffe);}return _0x7a50db[_0x444b('0x15')](_0x578ffe)['end']();};}function respondWithResult(_0x166c96,_0x56896a){_0x56896a=_0x56896a||0xc8;return function(_0x31347b){if(_0x31347b){return _0x166c96[_0x444b('0x15')](_0x56896a)[_0x444b('0x16')](_0x31347b);}};}function respondWithFilteredResult(_0x3fd9e0,_0x46ba1a){return function(_0x3991fa){if(_0x3991fa){var _0x4434dd=typeof _0x46ba1a[_0x444b('0x17')]===_0x444b('0x18')&&typeof _0x46ba1a['limit']==='undefined';var _0x5c544f=_0x3991fa[_0x444b('0x19')];var _0xdf629e=_0x4434dd?0x0:_0x46ba1a['offset'];var _0x173394=_0x4434dd?_0x3991fa[_0x444b('0x19')]:_0x46ba1a[_0x444b('0x17')]+_0x46ba1a[_0x444b('0x1a')];var _0xedbde2;if(_0x173394>=_0x5c544f){_0x173394=_0x5c544f;_0xedbde2=0xc8;}else{_0xedbde2=0xce;}_0x3fd9e0[_0x444b('0x15')](_0xedbde2);return _0x3fd9e0['set'](_0x444b('0x1b'),_0xdf629e+'-'+_0x173394+'/'+_0x5c544f)[_0x444b('0x16')](_0x3991fa);}return null;};}function patchUpdates(_0x1dd757){return function(_0x38db30){try{jsonpatch[_0x444b('0x1c')](_0x38db30,_0x1dd757,!![]);}catch(_0x4a8ec1){return BPromise[_0x444b('0x1d')](_0x4a8ec1);}return _0x38db30['save']();};}function saveUpdates(_0x5f4a87,_0x5101d1){return function(_0x4c4939){if(_0x4c4939){return _0x4c4939[_0x444b('0x1e')](_0x5f4a87)[_0x444b('0x1f')](function(_0x54975a){return _0x54975a;});}return null;};}function removeEntity(_0x529f46,_0x16b5de){return function(_0x2dfb05){if(_0x2dfb05){return _0x2dfb05[_0x444b('0x20')]()['then'](function(){_0x529f46['status'](0xcc)[_0x444b('0x21')]();});}};}function handleEntityNotFound(_0x333b99,_0x136a1b){return function(_0x3f1be2){if(!_0x3f1be2){_0x333b99['sendStatus'](0x194);}return _0x3f1be2;};}function handleError(_0x1745c9,_0x7670e){_0x7670e=_0x7670e||0x1f4;return function(_0x513779){logger[_0x444b('0x22')](_0x513779[_0x444b('0x23')]);if(_0x513779[_0x444b('0x24')]){delete _0x513779['name'];}_0x1745c9[_0x444b('0x15')](_0x7670e)[_0x444b('0x25')](_0x513779);};}exports[_0x444b('0x26')]=function(_0x302bc3,_0x587579){var _0x7f02c5={},_0x260f39={},_0x434cdd={'count':0x0,'rows':[]};var _0x151aee=_[_0x444b('0x27')](db[_0x444b('0x28')]['rawAttributes'],function(_0x3602ea){return{'name':_0x3602ea[_0x444b('0x29')],'type':_0x3602ea[_0x444b('0x2a')][_0x444b('0x2b')]};});_0x260f39[_0x444b('0x2c')]=_[_0x444b('0x2d')](_[_0x444b('0x27')](_0x151aee,_0x444b('0x24')),[_0x444b('0x2e')]);_0x260f39[_0x444b('0x2f')]=_['keys'](_0x302bc3[_0x444b('0x2f')]);_0x260f39['filters']=_['intersection'](_0x260f39[_0x444b('0x2c')],_0x260f39[_0x444b('0x2f')]);_0x7f02c5[_0x444b('0x30')]=_[_0x444b('0x31')](_0x260f39['model'],qs['fields'](_0x302bc3[_0x444b('0x2f')][_0x444b('0x32')]));_0x7f02c5[_0x444b('0x30')]=_0x7f02c5[_0x444b('0x30')][_0x444b('0x33')]?_0x7f02c5[_0x444b('0x30')]:_0x260f39[_0x444b('0x2c')];if(!_0x302bc3['query']['hasOwnProperty'](_0x444b('0x34'))){_0x7f02c5[_0x444b('0x1a')]=qs[_0x444b('0x1a')](_0x302bc3['query'][_0x444b('0x1a')]);_0x7f02c5[_0x444b('0x17')]=qs[_0x444b('0x17')](_0x302bc3[_0x444b('0x2f')][_0x444b('0x17')]);}_0x7f02c5['order']=qs['sort'](_0x302bc3[_0x444b('0x2f')][_0x444b('0x35')]);_0x7f02c5[_0x444b('0x36')]=qs[_0x444b('0x37')](_[_0x444b('0x38')](_0x302bc3[_0x444b('0x2f')],_0x260f39[_0x444b('0x37')]),_0x151aee);if(_0x302bc3[_0x444b('0x2f')][_0x444b('0x39')]){_0x7f02c5[_0x444b('0x36')]=_[_0x444b('0x3a')](_0x7f02c5[_0x444b('0x36')],{'$or':_[_0x444b('0x27')](_0x151aee,function(_0x42abf4){if(_0x42abf4[_0x444b('0x2a')]!==_0x444b('0x3b')){var _0xa27448={};_0xa27448[_0x42abf4[_0x444b('0x24')]]={'$like':'%'+_0x302bc3[_0x444b('0x2f')]['filter']+'%'};return _0xa27448;}})});}_0x7f02c5=_[_0x444b('0x3a')]({},_0x7f02c5,_0x302bc3[_0x444b('0x3c')]);var _0x57fe46={'where':_0x7f02c5[_0x444b('0x36')]};return db[_0x444b('0x28')][_0x444b('0x19')](_0x57fe46)[_0x444b('0x1f')](function(_0x312ea3){_0x434cdd['count']=_0x312ea3;if(_0x302bc3[_0x444b('0x2f')][_0x444b('0x3d')]){_0x7f02c5[_0x444b('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0x444b('0x3f')](_0x7f02c5);})[_0x444b('0x1f')](function(_0x2be350){_0x434cdd[_0x444b('0x40')]=_0x2be350;return _0x434cdd;})['then'](respondWithFilteredResult(_0x587579,_0x7f02c5))['catch'](handleError(_0x587579,null));};exports[_0x444b('0x41')]=function(_0x195f9a,_0x14bb08){var _0x47ffaa={'raw':![],'where':{'id':_0x195f9a[_0x444b('0x42')]['id']}},_0x401bb2={};_0x401bb2[_0x444b('0x2c')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x401bb2['query']=_[_0x444b('0x43')](_0x195f9a[_0x444b('0x2f')]);_0x401bb2['filters']=_[_0x444b('0x31')](_0x401bb2[_0x444b('0x2c')],_0x401bb2[_0x444b('0x2f')]);_0x47ffaa[_0x444b('0x30')]=_[_0x444b('0x31')](_0x401bb2['model'],qs[_0x444b('0x32')](_0x195f9a[_0x444b('0x2f')][_0x444b('0x32')]));_0x47ffaa[_0x444b('0x30')]=_0x47ffaa['attributes'][_0x444b('0x33')]?_0x47ffaa[_0x444b('0x30')]:_0x401bb2['model'];if(_0x195f9a[_0x444b('0x2f')][_0x444b('0x3d')]){_0x47ffaa[_0x444b('0x3e')]=[{'all':!![]}];}_0x47ffaa=_[_0x444b('0x3a')]({},_0x47ffaa,_0x195f9a[_0x444b('0x3c')]);return db[_0x444b('0x28')][_0x444b('0x44')](_0x47ffaa)[_0x444b('0x1f')](handleEntityNotFound(_0x14bb08,null))[_0x444b('0x1f')](respondWithResult(_0x14bb08,null))[_0x444b('0x45')](handleError(_0x14bb08,null));};exports[_0x444b('0x46')]=function(_0x16a454,_0x3f9a7f){return db[_0x444b('0x28')][_0x444b('0x46')](_0x16a454[_0x444b('0x47')],{})[_0x444b('0x1f')](respondWithResult(_0x3f9a7f,0xc9))[_0x444b('0x45')](handleError(_0x3f9a7f,null));};exports[_0x444b('0x1e')]=function(_0x206f67,_0x480d9c){if(_0x206f67[_0x444b('0x47')]['id']){delete _0x206f67[_0x444b('0x47')]['id'];}return db[_0x444b('0x28')][_0x444b('0x44')]({'where':{'id':_0x206f67['params']['id']}})['then'](handleEntityNotFound(_0x480d9c,null))['then'](saveUpdates(_0x206f67[_0x444b('0x47')],null))[_0x444b('0x1f')](respondWithResult(_0x480d9c,null))['catch'](handleError(_0x480d9c,null));};exports[_0x444b('0x48')]=function(_0x214672,_0x5dcc97){return db[_0x444b('0x28')][_0x444b('0x48')]()[_0x444b('0x1f')](respondWithResult(_0x5dcc97,null))[_0x444b('0x45')](handleError(_0x5dcc97,null));};exports[_0x444b('0x49')]=function(_0x392c61,_0x25b941,_0x3fcb4c){var _0x1e3082=require('../../components/encryptor');var _0x17e739=![];var _0x3d5259={};if(_0x392c61[_0x444b('0x2f')][_0x444b('0x2a')]&&_0x392c61['query']['type']===_0x444b('0x4a')){_0x3d5259[_0x444b('0x4a')]=_0x392c61[_0x444b('0x42')]['id'];}else{_0x3d5259['id']=_0x392c61[_0x444b('0x42')]['id'];}return db[_0x444b('0x28')]['find']({'where':_0x3d5259,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x25b941,null))['then'](function(_0x1ce567){if(_0x1ce567){var _0x59f0c4=_0x1ce567[_0x444b('0x4b')];var _0x3dafba=util[_0x444b('0x2e')](_0x444b('0x4c'),_0x59f0c4);if(fs[_0x444b('0x4d')](_0x3dafba)){_0x17e739=!![];return _0x1e3082['decryptFile'](_0x3dafba,_0x59f0c4,config[_0x444b('0x4e')]['recording'])['then'](function(){return _0x1ce567;});}return _0x1ce567;}})[_0x444b('0x1f')](function(_0x5a3634){if(_0x5a3634){var _0x56a14a=_0x5a3634[_0x444b('0x4b')];if(!fs['existsSync'](_0x56a14a)){throw new db[(_0x444b('0x4f'))][(_0x444b('0x50'))](_0x444b('0x51'));}if(_0x5a3634['filename']){return _0x25b941[_0x444b('0x49')](_0x56a14a,_0x5a3634[_0x444b('0x52')]+path['extname'](_0x56a14a),function(){if(_0x17e739){fs[_0x444b('0x53')](_0x56a14a);}});}else{return _0x25b941[_0x444b('0x49')](_0x56a14a,function(_0x4936b6){if(_0x17e739){fs['unlink'](_0x56a14a);}});}}})[_0x444b('0x45')](function(_0xb72921){if(_0xb72921['message']===_0x444b('0x51')){_0x25b941['status'](0x194)[_0x444b('0x25')](_0x444b('0x54'));}else{return handleError(_0x25b941,null);}});};exports[_0x444b('0x55')]=function(_0x4926de,_0x1eb3f1,_0x4a6ce7){var _0x5c8128=require(_0x444b('0x56'));var _0x140788=![];var _0x29b150={'$and':[db['sequelize']['where'](db[_0x444b('0x57')]['fn'](_0x444b('0x58'),db[_0x444b('0x57')][_0x444b('0x59')]('uniqueid')),_0x4926de['query'][_0x444b('0x5a')])]};if(_0x4926de[_0x444b('0x2f')]['type']&&_0x4926de[_0x444b('0x2f')][_0x444b('0x2a')]==='uniqueid'){_0x29b150[_0x444b('0x5b')][_0x444b('0x5c')]({'uniqueid':_0x4926de['params']['id']});}else{_0x29b150['$and'][_0x444b('0x5c')]({'id':_0x4926de[_0x444b('0x42')]['id']});}return db[_0x444b('0x28')][_0x444b('0x44')]({'where':_0x29b150,'attributes':['id',_0x444b('0x4b')],'raw':!![]})[_0x444b('0x1f')](handleEntityNotFound(_0x1eb3f1,null))['then'](function(_0x309b20){if(_0x309b20){var _0x4646c0=util[_0x444b('0x2e')](_0x444b('0x4c'),_0x309b20[_0x444b('0x4b')]);if(fs[_0x444b('0x4d')](_0x4646c0)){_0x140788=!![];return _0x5c8128['decryptFile'](_0x4646c0,_0x309b20[_0x444b('0x4b')],config[_0x444b('0x4e')]['recording'])[_0x444b('0x1f')](function(){return _0x309b20;});}return _0x309b20;}})[_0x444b('0x1f')](function(_0x338d6c){if(_0x338d6c){if(!fs[_0x444b('0x4d')](_0x338d6c[_0x444b('0x4b')])){throw new db[(_0x444b('0x4f'))]['ValidationError'](_0x444b('0x51'));}if(_0x338d6c[_0x444b('0x52')]){return _0x1eb3f1['download'](_0x338d6c[_0x444b('0x4b')],_0x338d6c['filename']+path[_0x444b('0x5d')](_0x338d6c[_0x444b('0x4b')]),function(){if(_0x140788){fs[_0x444b('0x53')](_0x338d6c[_0x444b('0x4b')]);}});}else{return _0x1eb3f1[_0x444b('0x49')](_0x338d6c[_0x444b('0x4b')],function(_0x67f4ab){if(_0x140788){fs[_0x444b('0x53')](_0x338d6c[_0x444b('0x4b')]);}});}}})[_0x444b('0x45')](handleError(_0x1eb3f1,null));};exports[_0x444b('0x20')]=function(_0x512e71,_0x34228b){return db[_0x444b('0x28')][_0x444b('0x44')]({'where':{'id':_0x512e71[_0x444b('0x42')]['id']}})[_0x444b('0x1f')](function(_0x59cd50){if(_['isNil'](_0x59cd50)){throw new ReferenceError(_0x444b('0x5e'));}return _0x59cd50;})[_0x444b('0x1f')](function(_0x4ff567){var _0xfbc9b4=_0x4ff567[_0x444b('0x4b')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xfbc9b4);if(!_[_0x444b('0x5f')](_0x4ff567[_0x444b('0x4b')])&&fs[_0x444b('0x4d')](_0xfbc9b4)){logger[_0x444b('0x60')](_0x444b('0x61')+_0xfbc9b4+_0x444b('0x62'));fs[_0x444b('0x63')](_0xfbc9b4);}_0xfbc9b4=_0xfbc9b4+_0x444b('0x64');if(!_[_0x444b('0x5f')](_0x4ff567[_0x444b('0x4b')])&&fs[_0x444b('0x4d')](_0xfbc9b4)){logger[_0x444b('0x60')]('File:\x20\x22'+_0xfbc9b4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x444b('0x63')](_0xfbc9b4);}return _0x4ff567;})[_0x444b('0x1f')](function(_0x38c9e2){if(!_0x38c9e2)throw new InternalError();return _0x38c9e2['destroy']();})[_0x444b('0x1f')](function(){_0x34228b['status'](0xcc)[_0x444b('0x21')]();})[_0x444b('0x45')](handleError(_0x34228b,null));};function getBucketslist(_0x249fbc,_0xdf9f13,_0x36b41d){return new Promise(function(_0x4084c9,_0xf1d5de){var _0x24262c=new AWS['S3']({'accessKeyId':_0xdf9f13,'secretAccessKey':_0x249fbc,'region':_0x36b41d});_0x24262c[_0x444b('0x65')]({},function(_0xcab50,_0xb79aff){if(_0xcab50){return _0xf1d5de(_0xcab50);}else{return _0x4084c9(_0xb79aff);}});});}function createBucket(_0x4c4f37,_0x2c1fe5,_0x3ac2f1,_0x8b8c55){return new Promise(function(_0x5f055a,_0x339478){var _0x3506f8=new AWS['S3']({'accessKeyId':_0x2c1fe5,'secretAccessKey':_0x4c4f37,'region':_0x3ac2f1});_0x3506f8['createBucket']({'Bucket':_0x8b8c55},function(_0x470a24,_0x5422ea){if(_0x470a24){return _0x339478(_0x470a24);}else{return _0x5f055a(_0x5422ea);}});});}function uploadFile(_0x75dbcf,_0x234e35,_0x32377a,_0x1cca23,_0x5c6f0d,_0xa9995c){return new Promise(function(_0xdf75c6,_0x564b89){var _0x3fa495=new AWS['S3']({'accessKeyId':_0x234e35,'secretAccessKey':_0x75dbcf,'region':_0x32377a});_0x3fa495['upload']({'Bucket':_0x1cca23,'Key':_0x5c6f0d,'Body':_0xa9995c},function(_0x453662,_0x186c19){if(_0x453662){return _0x564b89(_0x453662);}else{return _0xdf75c6(_0x186c19);}});});}function startTranscribe(_0x4e3bbb,_0xcbb79a,_0x4b7dad,_0x852d5,_0x11b9fd,_0x206458){return new Promise(function(_0x5ec6b8,_0x3e55c8){var _0x5aaa54=new AWS['TranscribeService']({'accessKeyId':_0xcbb79a,'secretAccessKey':_0x4e3bbb,'region':_0x4b7dad});_0x5aaa54['startTranscriptionJob']({'TranscriptionJobName':_0x852d5,'LanguageCode':_0x11b9fd,'Media':{'MediaFileUri':_0x206458}},function(_0x581dd0,_0x2e1f7b){if(_0x581dd0){return _0x3e55c8(_0x581dd0);}else{return _0x5ec6b8(_0x2e1f7b);}});});}function transcribe(_0x49860b,_0x2037a2,_0x13aa10,_0x39d790,_0x4c0931,_0x13f152,_0x6999d8){return new Promise(function(_0x351268,_0x469b4e){var _0x480390={};logger[_0x444b('0x60')](util[_0x444b('0x2e')](_0x444b('0x66'),_0x49860b,_0x4c0931));return uploadFile(_0x2037a2,_0x13aa10,_0x39d790,_0x4c0931,path[_0x444b('0x67')](_0x13f152),fs['readFileSync'](_0x13f152))[_0x444b('0x1f')](function(_0x368ab0){logger[_0x444b('0x60')](util[_0x444b('0x2e')](_0x444b('0x68'),_0x49860b,_0x4c0931,_0x368ab0[_0x444b('0x69')]));_0x480390[_0x444b('0x6a')]=_0x368ab0['Bucket'];_0x480390['location']=_0x368ab0['Location'];logger['info'](util[_0x444b('0x2e')](_0x444b('0x6b'),_0x49860b));return startTranscribe(_0x2037a2,_0x13aa10,_0x39d790,uuidv4(),_0x6999d8,_0x368ab0['Location']);})[_0x444b('0x1f')](function(_0x1cad05){logger[_0x444b('0x60')](util[_0x444b('0x2e')](_0x444b('0x6c'),_0x49860b,_0x1cad05[_0x444b('0x6d')][_0x444b('0x6e')]));_0x480390[_0x444b('0x6f')]=_0x1cad05['TranscriptionJob'][_0x444b('0x6e')];_0x480390[_0x444b('0x70')]=_0x1cad05[_0x444b('0x6d')][_0x444b('0x71')];return _0x351268(_0x480390);})[_0x444b('0x45')](function(_0x4fd409){return _0x469b4e(_0x4fd409);});});}exports[_0x444b('0x72')]=function(_0x42bd1a,_0x173177,_0x2ebb84){var _0x59464f;var _0x1441d3;var _0x340bab;var _0x5b14c5=require(_0x444b('0x56'));return db['VoiceRecording'][_0x444b('0x73')]({'where':{'id':_0x42bd1a[_0x444b('0x42')]['id']}})['then'](function(_0x3372cf){if(_0x3372cf){var _0x404f59=util[_0x444b('0x2e')](_0x444b('0x4c'),_0x3372cf[_0x444b('0x4b')]);if(fs[_0x444b('0x4d')](_0x404f59)){cypher=!![];return _0x5b14c5[_0x444b('0x74')](_0x404f59,_0x3372cf[_0x444b('0x4b')],config[_0x444b('0x4e')][_0x444b('0x75')])['then'](function(){return _0x3372cf;});}return _0x3372cf;}})[_0x444b('0x1f')](function(_0x54cf76){if(!_0x54cf76){throw new db[(_0x444b('0x4f'))][(_0x444b('0x50'))](_0x444b('0x76'));}_0x1441d3=_0x54cf76;return db[_0x444b('0x77')][_0x444b('0x73')]({'where':{'id':0x1}});})[_0x444b('0x1f')](handleEntityNotFound(_0x173177,null))[_0x444b('0x1f')](function(_0x267198){if(_0x267198){_0x59464f=_0x267198;if(!_0x59464f[_0x444b('0x78')]||!_0x59464f['transcribeAccountId']||!_0x59464f[_0x444b('0x79')]||!_0x59464f['language']||!_0x59464f[_0x444b('0x6a')]){throw new db[(_0x444b('0x4f'))][(_0x444b('0x50'))]('Transcribe\x20not\x20configured');}if(_0x42bd1a[_0x444b('0x47')][_0x444b('0x7a')]&&(!_0x59464f['sentiment']||!_0x59464f[_0x444b('0x7b')]||!_0x59464f[_0x444b('0x7c')]||!_0x59464f[_0x444b('0x7d')]||!_0x59464f[_0x444b('0x6a')])){throw new db[(_0x444b('0x4f'))][(_0x444b('0x50'))](_0x444b('0x7e'));}return db[_0x444b('0x7f')][_0x444b('0x73')]({'where':{'id':_0x59464f[_0x444b('0x80')]}});}})[_0x444b('0x1f')](function(_0x5800df){if(!_0x5800df){throw new db[(_0x444b('0x4f'))][(_0x444b('0x50'))](_0x444b('0x81'));}if(!_0x5800df[_0x444b('0x82')]||!_0x5800df['data2']){throw new db['Sequelize'][(_0x444b('0x50'))](_0x444b('0x83'));}_0x340bab=_0x5800df;return getBucketslist(_0x340bab['data1'],_0x340bab['data2'],_0x59464f[_0x444b('0x79')]);})['then'](function(_0x155300){if(_0x155300&&_0x155300[_0x444b('0x84')]){var _0x4ab3c0=_[_0x444b('0x44')](_0x155300[_0x444b('0x84')],function(_0x5cfa1a){return _0x5cfa1a[_0x444b('0x85')]===_0x59464f['bucket'];});if(!_0x4ab3c0){logger[_0x444b('0x60')](util[_0x444b('0x2e')](_0x444b('0x86'),_0x42bd1a['params']['id'],_0x59464f['bucket']));return createBucket(_0x340bab[_0x444b('0x82')],_0x340bab[_0x444b('0x87')],_0x59464f[_0x444b('0x79')],_0x59464f['bucket']);}logger['info'](util[_0x444b('0x2e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x42bd1a[_0x444b('0x42')]['id'],_0x59464f[_0x444b('0x6a')]));return;}})[_0x444b('0x1f')](function(_0x1c44d5){if(_0x1441d3[_0x444b('0x70')]==='NEW'){return transcribe(_0x42bd1a[_0x444b('0x42')]['id'],_0x340bab[_0x444b('0x82')],_0x340bab[_0x444b('0x87')],_0x59464f[_0x444b('0x79')],_0x59464f[_0x444b('0x6a')],_0x1441d3[_0x444b('0x4b')],_0x59464f[_0x444b('0x7d')]);}else{logger[_0x444b('0x60')](util[_0x444b('0x2e')](_0x444b('0x88'),_0x42bd1a[_0x444b('0x42')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x444b('0x1f')](function(_0x5c2ac6){if(_0x5c2ac6){_0x5c2ac6['tempSentiment']=_0x42bd1a[_0x444b('0x47')][_0x444b('0x7a')];return _0x1441d3['updateAttributes'](_0x5c2ac6);}})[_0x444b('0x1f')](respondWithResult(_0x173177,null))['catch'](handleError(_0x173177,null));};function writeFile(_0x42c959,_0x434c70){return new Promise(function(_0x4cd765,_0x3fcac6){fs[_0x444b('0x89')](_0x434c70,_0x42c959,function(_0x3e978f,_0x1f8e34){if(_0x3e978f){return _0x3fcac6(_0x3e978f);}else{return _0x4cd765(_0x1f8e34);}});});}exports[_0x444b('0x8a')]=function(_0x5bebb7,_0x43723a,_0x2882b1){return db[_0x444b('0x28')][_0x444b('0x73')]({'where':{'id':_0x5bebb7[_0x444b('0x42')]['id']}})[_0x444b('0x1f')](handleEntityNotFound(_0x43723a))['then'](function(_0x46e43d){if(_0x46e43d&&_0x46e43d[_0x444b('0x8b')]){var _0x511bf6=_0x46e43d[_0x444b('0x8b')];var _0x35c2fa=config[_0x444b('0x8c')]+_0x444b('0x8d')+_0x46e43d['id']+'.txt';if(fs[_0x444b('0x4d')](_0x35c2fa)){return _0x35c2fa;}return writeFile(_0x511bf6,_0x35c2fa)[_0x444b('0x1f')](function(){return _0x35c2fa;});}else{throw new db[(_0x444b('0x4f'))]['ValidationError'](_0x444b('0x8e'));}})[_0x444b('0x1f')](function(_0x24e75d){return _0x43723a['download'](_0x24e75d);})[_0x444b('0x45')](handleError(_0x43723a));}; \ No newline at end of file +var _0xa3ea=['ejs','fs-extra','lodash','squel','jsforce','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceRecording','findAll','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','format','isNil','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name','NEW','IN_PROGRESS','runSentiment','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xb22617,_0x374ab8){var _0x19b5ec=function(_0x5edfb9){while(--_0x5edfb9){_0xb22617['push'](_0xb22617['shift']());}};_0x19b5ec(++_0x374ab8);}(_0xa3ea,0x1ac));var _0xaa3e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa3ea[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa3e('0x0'));var zipdir=require(_0xaa3e('0x1'));var jsonpatch=require(_0xaa3e('0x2'));var rp=require(_0xaa3e('0x3'));var moment=require(_0xaa3e('0x4'));var BPromise=require(_0xaa3e('0x5'));var Mustache=require(_0xaa3e('0x6'));var util=require('util');var path=require(_0xaa3e('0x7'));var sox=require(_0xaa3e('0x8'));var csv=require(_0xaa3e('0x9'));var ejs=require(_0xaa3e('0xa'));var fs=require('fs');var fs_extra=require(_0xaa3e('0xb'));var _=require(_0xaa3e('0xc'));var squel=require(_0xaa3e('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa3e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa3e('0xf'));var Papa=require('papaparse');var AWS=require(_0xaa3e('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xaa3e('0x11'));var authService=require(_0xaa3e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaa3e('0x13'));var hardwareService=require(_0xaa3e('0x14'));var logger=require(_0xaa3e('0x15'))(_0xaa3e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaa3e('0x17'));var db=require(_0xaa3e('0x18'))['db'];function respondWithStatusCode(_0x207584,_0x2c3c63){_0x2c3c63=_0x2c3c63||0xcc;return function(_0x18711b){if(_0x18711b){return _0x207584['sendStatus'](_0x2c3c63);}return _0x207584[_0xaa3e('0x19')](_0x2c3c63)[_0xaa3e('0x1a')]();};}function respondWithResult(_0x4918be,_0x2d6633){_0x2d6633=_0x2d6633||0xc8;return function(_0x555ed3){if(_0x555ed3){return _0x4918be['status'](_0x2d6633)[_0xaa3e('0x1b')](_0x555ed3);}};}function respondWithFilteredResult(_0x500adb,_0x117214){return function(_0x67f94a){if(_0x67f94a){var _0xa315d4=typeof _0x117214[_0xaa3e('0x1c')]===_0xaa3e('0x1d')&&typeof _0x117214[_0xaa3e('0x1e')]===_0xaa3e('0x1d');var _0x346953=_0x67f94a[_0xaa3e('0x1f')];var _0x47d987=_0xa315d4?0x0:_0x117214[_0xaa3e('0x1c')];var _0xbe8611=_0xa315d4?_0x67f94a['count']:_0x117214['offset']+_0x117214[_0xaa3e('0x1e')];var _0x328268;if(_0xbe8611>=_0x346953){_0xbe8611=_0x346953;_0x328268=0xc8;}else{_0x328268=0xce;}_0x500adb[_0xaa3e('0x19')](_0x328268);return _0x500adb['set'](_0xaa3e('0x20'),_0x47d987+'-'+_0xbe8611+'/'+_0x346953)[_0xaa3e('0x1b')](_0x67f94a);}return null;};}function patchUpdates(_0x400cb1){return function(_0x55e825){try{jsonpatch[_0xaa3e('0x21')](_0x55e825,_0x400cb1,!![]);}catch(_0x4594a2){return BPromise[_0xaa3e('0x22')](_0x4594a2);}return _0x55e825[_0xaa3e('0x23')]();};}function saveUpdates(_0x16d63a,_0x20ec65){return function(_0x5814c1){if(_0x5814c1){return _0x5814c1[_0xaa3e('0x24')](_0x16d63a)[_0xaa3e('0x25')](function(_0x54f35f){return _0x54f35f;});}return null;};}function removeEntity(_0x21e932,_0x5d0452){return function(_0x3164e0){if(_0x3164e0){return _0x3164e0[_0xaa3e('0x26')]()[_0xaa3e('0x25')](function(){_0x21e932['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c0e9,_0x1e77bc){return function(_0x434fed){if(!_0x434fed){_0x31c0e9[_0xaa3e('0x27')](0x194);}return _0x434fed;};}function handleError(_0x5f2fc4,_0x33edc2){_0x33edc2=_0x33edc2||0x1f4;return function(_0x3a0c85){logger[_0xaa3e('0x28')](_0x3a0c85['stack']);if(_0x3a0c85[_0xaa3e('0x29')]){delete _0x3a0c85[_0xaa3e('0x29')];}_0x5f2fc4[_0xaa3e('0x19')](_0x33edc2)[_0xaa3e('0x2a')](_0x3a0c85);};}exports[_0xaa3e('0x2b')]=function(_0x1bd3f8,_0x1c9ba6){var _0xc6879b={},_0x309b51={},_0x4f90dd={'count':0x0,'rows':[]};var _0x2e53c4=_['map'](db['VoiceRecording']['rawAttributes'],function(_0x5d5de7){return{'name':_0x5d5de7[_0xaa3e('0x2c')],'type':_0x5d5de7[_0xaa3e('0x2d')][_0xaa3e('0x2e')]};});_0x309b51[_0xaa3e('0x2f')]=_[_0xaa3e('0x30')](_[_0xaa3e('0x31')](_0x2e53c4,_0xaa3e('0x29')),['format']);_0x309b51['query']=_[_0xaa3e('0x32')](_0x1bd3f8[_0xaa3e('0x33')]);_0x309b51[_0xaa3e('0x34')]=_[_0xaa3e('0x35')](_0x309b51['model'],_0x309b51[_0xaa3e('0x33')]);_0xc6879b[_0xaa3e('0x36')]=_[_0xaa3e('0x35')](_0x309b51['model'],qs['fields'](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x37')]));_0xc6879b[_0xaa3e('0x36')]=_0xc6879b[_0xaa3e('0x36')][_0xaa3e('0x38')]?_0xc6879b[_0xaa3e('0x36')]:_0x309b51[_0xaa3e('0x2f')];if(!_0x1bd3f8['query']['hasOwnProperty'](_0xaa3e('0x39'))){_0xc6879b[_0xaa3e('0x1e')]=qs[_0xaa3e('0x1e')](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x1e')]);_0xc6879b[_0xaa3e('0x1c')]=qs['offset'](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x1c')]);}_0xc6879b['order']=qs[_0xaa3e('0x3a')](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3a')]);_0xc6879b[_0xaa3e('0x3b')]=qs[_0xaa3e('0x34')](_[_0xaa3e('0x3c')](_0x1bd3f8[_0xaa3e('0x33')],_0x309b51[_0xaa3e('0x34')]),_0x2e53c4);if(_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3d')]){_0xc6879b['where']=_[_0xaa3e('0x3e')](_0xc6879b[_0xaa3e('0x3b')],{'$or':_[_0xaa3e('0x31')](_0x2e53c4,function(_0x542e87){if(_0x542e87[_0xaa3e('0x2d')]!==_0xaa3e('0x3f')){var _0xed2bc5={};_0xed2bc5[_0x542e87[_0xaa3e('0x29')]]={'$like':'%'+_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3d')]+'%'};return _0xed2bc5;}})});}_0xc6879b=_[_0xaa3e('0x3e')]({},_0xc6879b,_0x1bd3f8[_0xaa3e('0x40')]);var _0x33e966={'where':_0xc6879b[_0xaa3e('0x3b')]};return db['VoiceRecording']['count'](_0x33e966)[_0xaa3e('0x25')](function(_0x5fd37b){_0x4f90dd[_0xaa3e('0x1f')]=_0x5fd37b;if(_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x41')]){_0xc6879b[_0xaa3e('0x42')]=[{'all':!![]}];}return db[_0xaa3e('0x43')][_0xaa3e('0x44')](_0xc6879b);})[_0xaa3e('0x25')](function(_0x2f7eaf){_0x4f90dd['rows']=_0x2f7eaf;return _0x4f90dd;})[_0xaa3e('0x25')](respondWithFilteredResult(_0x1c9ba6,_0xc6879b))[_0xaa3e('0x45')](handleError(_0x1c9ba6,null));};exports[_0xaa3e('0x46')]=function(_0x8816dd,_0x1d274c){var _0x634b86={'raw':![],'where':{'id':_0x8816dd[_0xaa3e('0x47')]['id']}},_0x3a85dd={};_0x3a85dd[_0xaa3e('0x2f')]=_[_0xaa3e('0x32')](db[_0xaa3e('0x43')]['rawAttributes']);_0x3a85dd[_0xaa3e('0x33')]=_['keys'](_0x8816dd[_0xaa3e('0x33')]);_0x3a85dd[_0xaa3e('0x34')]=_['intersection'](_0x3a85dd[_0xaa3e('0x2f')],_0x3a85dd[_0xaa3e('0x33')]);_0x634b86[_0xaa3e('0x36')]=_['intersection'](_0x3a85dd[_0xaa3e('0x2f')],qs[_0xaa3e('0x37')](_0x8816dd[_0xaa3e('0x33')][_0xaa3e('0x37')]));_0x634b86['attributes']=_0x634b86[_0xaa3e('0x36')]['length']?_0x634b86[_0xaa3e('0x36')]:_0x3a85dd[_0xaa3e('0x2f')];if(_0x8816dd[_0xaa3e('0x33')][_0xaa3e('0x41')]){_0x634b86['include']=[{'all':!![]}];}_0x634b86=_[_0xaa3e('0x3e')]({},_0x634b86,_0x8816dd[_0xaa3e('0x40')]);return db[_0xaa3e('0x43')][_0xaa3e('0x48')](_0x634b86)[_0xaa3e('0x25')](handleEntityNotFound(_0x1d274c,null))[_0xaa3e('0x25')](respondWithResult(_0x1d274c,null))[_0xaa3e('0x45')](handleError(_0x1d274c,null));};exports[_0xaa3e('0x49')]=function(_0xbb4a93,_0x1a6ad1){return db['VoiceRecording'][_0xaa3e('0x49')](_0xbb4a93[_0xaa3e('0x4a')],{})['then'](respondWithResult(_0x1a6ad1,0xc9))[_0xaa3e('0x45')](handleError(_0x1a6ad1,null));};exports['update']=function(_0x28893d,_0x3c3445){if(_0x28893d[_0xaa3e('0x4a')]['id']){delete _0x28893d[_0xaa3e('0x4a')]['id'];}return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':{'id':_0x28893d[_0xaa3e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c3445,null))['then'](saveUpdates(_0x28893d[_0xaa3e('0x4a')],null))[_0xaa3e('0x25')](respondWithResult(_0x3c3445,null))[_0xaa3e('0x45')](handleError(_0x3c3445,null));};exports[_0xaa3e('0x4b')]=function(_0x373be5,_0x1d275c){return db['VoiceRecording'][_0xaa3e('0x4b')]()[_0xaa3e('0x25')](respondWithResult(_0x1d275c,null))['catch'](handleError(_0x1d275c,null));};exports[_0xaa3e('0x4c')]=function(_0x1c2675,_0x56cdbf,_0x22aca4){var _0x32a994=require(_0xaa3e('0x4d'));var _0x39d050=![];var _0x40740c={};if(_0x1c2675[_0xaa3e('0x33')][_0xaa3e('0x2d')]&&_0x1c2675[_0xaa3e('0x33')]['type']===_0xaa3e('0x4e')){_0x40740c[_0xaa3e('0x4e')]=_0x1c2675[_0xaa3e('0x47')]['id'];}else{_0x40740c['id']=_0x1c2675[_0xaa3e('0x47')]['id'];}return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':_0x40740c,'attributes':['id',_0xaa3e('0x4f')],'raw':!![]})[_0xaa3e('0x25')](handleEntityNotFound(_0x56cdbf,null))['then'](function(_0xdad89a){if(_0xdad89a){var _0x15bffe=_0xdad89a[_0xaa3e('0x4f')];var _0x4a5ffd=util['format'](_0xaa3e('0x50'),_0x15bffe);if(fs[_0xaa3e('0x51')](_0x4a5ffd)){_0x39d050=!![];return _0x32a994[_0xaa3e('0x52')](_0x4a5ffd,_0x15bffe,config[_0xaa3e('0x53')]['recording'])['then'](function(){return _0xdad89a;});}return _0xdad89a;}})['then'](function(_0x4af1af){if(_0x4af1af){var _0x2e846b=_0x4af1af[_0xaa3e('0x4f')];if(!fs[_0xaa3e('0x51')](_0x2e846b)){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x56'));}if(_0x4af1af[_0xaa3e('0x57')]){return _0x56cdbf['download'](_0x2e846b,_0x4af1af[_0xaa3e('0x57')]+path[_0xaa3e('0x58')](_0x2e846b),function(){if(_0x39d050){fs[_0xaa3e('0x59')](_0x2e846b);}});}else{return _0x56cdbf[_0xaa3e('0x4c')](_0x2e846b,function(_0xbc8315){if(_0x39d050){fs['unlink'](_0x2e846b);}});}}})[_0xaa3e('0x45')](function(_0x28bac9){if(_0x28bac9[_0xaa3e('0x5a')]==='VoiceRecording\x20not\x20found'){_0x56cdbf[_0xaa3e('0x19')](0x194)[_0xaa3e('0x2a')](_0xaa3e('0x5b'));}else{return handleError(_0x56cdbf,null);}});};exports[_0xaa3e('0x5c')]=function(_0x51513e,_0x1fbcea,_0x144e9d){var _0x4cd513=require(_0xaa3e('0x4d'));var _0x8304de=![];var _0x277be7={'$and':[db[_0xaa3e('0x5d')][_0xaa3e('0x3b')](db['sequelize']['fn'](_0xaa3e('0x5e'),db['sequelize'][_0xaa3e('0x5f')](_0xaa3e('0x4e'))),_0x51513e[_0xaa3e('0x33')]['token'])]};if(_0x51513e[_0xaa3e('0x33')][_0xaa3e('0x2d')]&&_0x51513e[_0xaa3e('0x33')][_0xaa3e('0x2d')]===_0xaa3e('0x4e')){_0x277be7['$and']['push']({'uniqueid':_0x51513e['params']['id']});}else{_0x277be7[_0xaa3e('0x60')][_0xaa3e('0x61')]({'id':_0x51513e[_0xaa3e('0x47')]['id']});}return db['VoiceRecording'][_0xaa3e('0x48')]({'where':_0x277be7,'attributes':['id',_0xaa3e('0x4f')],'raw':!![]})[_0xaa3e('0x25')](handleEntityNotFound(_0x1fbcea,null))['then'](function(_0xe35dba){if(_0xe35dba){var _0x59ee87=util[_0xaa3e('0x62')](_0xaa3e('0x50'),_0xe35dba[_0xaa3e('0x4f')]);if(fs[_0xaa3e('0x51')](_0x59ee87)){_0x8304de=!![];return _0x4cd513[_0xaa3e('0x52')](_0x59ee87,_0xe35dba[_0xaa3e('0x4f')],config[_0xaa3e('0x53')]['recording'])[_0xaa3e('0x25')](function(){return _0xe35dba;});}return _0xe35dba;}})[_0xaa3e('0x25')](function(_0x4af15d){if(_0x4af15d){if(!fs[_0xaa3e('0x51')](_0x4af15d['value'])){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x4af15d[_0xaa3e('0x57')]){return _0x1fbcea['download'](_0x4af15d[_0xaa3e('0x4f')],_0x4af15d[_0xaa3e('0x57')]+path[_0xaa3e('0x58')](_0x4af15d[_0xaa3e('0x4f')]),function(){if(_0x8304de){fs[_0xaa3e('0x59')](_0x4af15d[_0xaa3e('0x4f')]);}});}else{return _0x1fbcea[_0xaa3e('0x4c')](_0x4af15d[_0xaa3e('0x4f')],function(_0x58202f){if(_0x8304de){fs[_0xaa3e('0x59')](_0x4af15d[_0xaa3e('0x4f')]);}});}}})[_0xaa3e('0x45')](handleError(_0x1fbcea,null));};exports[_0xaa3e('0x26')]=function(_0x4cc583,_0x44e7f4){return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':{'id':_0x4cc583[_0xaa3e('0x47')]['id']}})[_0xaa3e('0x25')](function(_0x48fdf4){if(_[_0xaa3e('0x63')](_0x48fdf4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x48fdf4;})[_0xaa3e('0x25')](function(_0x44a897){var _0x2f6c1d=_0x44a897[_0xaa3e('0x4f')];logger['info'](_0xaa3e('0x64'),_0x2f6c1d);if(!_[_0xaa3e('0x63')](_0x44a897[_0xaa3e('0x4f')])&&fs[_0xaa3e('0x51')](_0x2f6c1d)){logger[_0xaa3e('0x65')]('File:\x20\x22'+_0x2f6c1d+_0xaa3e('0x66'));fs[_0xaa3e('0x67')](_0x2f6c1d);}_0x2f6c1d=_0x2f6c1d+_0xaa3e('0x68');if(!_[_0xaa3e('0x63')](_0x44a897['value'])&&fs[_0xaa3e('0x51')](_0x2f6c1d)){logger['info'](_0xaa3e('0x69')+_0x2f6c1d+_0xaa3e('0x66'));fs[_0xaa3e('0x67')](_0x2f6c1d);}return _0x44a897;})[_0xaa3e('0x25')](function(_0x3ac5a1){if(!_0x3ac5a1)throw new InternalError();return _0x3ac5a1[_0xaa3e('0x26')]();})[_0xaa3e('0x25')](function(){_0x44e7f4[_0xaa3e('0x19')](0xcc)[_0xaa3e('0x1a')]();})[_0xaa3e('0x45')](handleError(_0x44e7f4,null));};function getBucketslist(_0x11723d,_0xd4a44c,_0x56563d){return new Promise(function(_0x110283,_0x3ae2af){var _0x13d123=new AWS['S3']({'accessKeyId':_0xd4a44c,'secretAccessKey':_0x11723d,'region':_0x56563d});_0x13d123[_0xaa3e('0x6a')]({},function(_0x29ee22,_0x2ba441){if(_0x29ee22){return _0x3ae2af(_0x29ee22);}else{return _0x110283(_0x2ba441);}});});}function createBucket(_0x2d1332,_0x16e96c,_0x104691,_0x125b30){return new Promise(function(_0xbc3e8b,_0x5e2019){var _0x3c2b72=new AWS['S3']({'accessKeyId':_0x16e96c,'secretAccessKey':_0x2d1332,'region':_0x104691});_0x3c2b72[_0xaa3e('0x6b')]({'Bucket':_0x125b30},function(_0x2bb3da,_0x4e6b13){if(_0x2bb3da){return _0x5e2019(_0x2bb3da);}else{return _0xbc3e8b(_0x4e6b13);}});});}function uploadFile(_0x4543cd,_0x1fba2a,_0x123be5,_0x121f97,_0x560bc2,_0x592ce5){return new Promise(function(_0x4f9da9,_0x2a9f54){var _0x2f5efa=new AWS['S3']({'accessKeyId':_0x1fba2a,'secretAccessKey':_0x4543cd,'region':_0x123be5});_0x2f5efa[_0xaa3e('0x6c')]({'Bucket':_0x121f97,'Key':_0x560bc2,'Body':_0x592ce5},function(_0x3a5936,_0x59b3b3){if(_0x3a5936){return _0x2a9f54(_0x3a5936);}else{return _0x4f9da9(_0x59b3b3);}});});}function startTranscribe(_0x2e5410,_0x174ee8,_0x306332,_0x2f19a4,_0x3040ab,_0x5d10ea){return new Promise(function(_0x2532eb,_0x28beca){var _0xb5fdbb=new AWS[(_0xaa3e('0x6d'))]({'accessKeyId':_0x174ee8,'secretAccessKey':_0x2e5410,'region':_0x306332});_0xb5fdbb[_0xaa3e('0x6e')]({'TranscriptionJobName':_0x2f19a4,'LanguageCode':_0x3040ab,'Media':{'MediaFileUri':_0x5d10ea}},function(_0x5f1e2a,_0x59b393){if(_0x5f1e2a){return _0x28beca(_0x5f1e2a);}else{return _0x2532eb(_0x59b393);}});});}function transcribe(_0x14a900,_0x142c5f,_0x338611,_0x23846b,_0x46990a,_0x444355,_0x3da920){return new Promise(function(_0x47408a,_0x57eb5a){var _0x46c051={};logger[_0xaa3e('0x65')](util[_0xaa3e('0x62')](_0xaa3e('0x6f'),_0x14a900,_0x46990a));return uploadFile(_0x142c5f,_0x338611,_0x23846b,_0x46990a,path['basename'](_0x444355),fs['readFileSync'](_0x444355))['then'](function(_0x93d031){logger[_0xaa3e('0x65')](util['format'](_0xaa3e('0x70'),_0x14a900,_0x46990a,_0x93d031[_0xaa3e('0x71')]));_0x46c051[_0xaa3e('0x72')]=_0x93d031['Bucket'];_0x46c051[_0xaa3e('0x73')]=_0x93d031['Location'];logger[_0xaa3e('0x65')](util[_0xaa3e('0x62')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x14a900));return startTranscribe(_0x142c5f,_0x338611,_0x23846b,uuidv4(),_0x3da920,_0x93d031[_0xaa3e('0x71')]);})['then'](function(_0x58ca24){logger[_0xaa3e('0x65')](util['format'](_0xaa3e('0x74'),_0x14a900,_0x58ca24[_0xaa3e('0x75')][_0xaa3e('0x76')]));_0x46c051[_0xaa3e('0x77')]=_0x58ca24['TranscriptionJob'][_0xaa3e('0x76')];_0x46c051[_0xaa3e('0x78')]=_0x58ca24[_0xaa3e('0x75')][_0xaa3e('0x79')];return _0x47408a(_0x46c051);})['catch'](function(_0x5aecd9){return _0x57eb5a(_0x5aecd9);});});}exports[_0xaa3e('0x7a')]=function(_0xe12c82,_0x2bf09a,_0x3fa31d){var _0x2be86e;var _0x58eec7;var _0x3f4d59;var _0x5b0277=require('../../components/encryptor');return db[_0xaa3e('0x43')][_0xaa3e('0x7b')]({'where':{'id':_0xe12c82[_0xaa3e('0x47')]['id']}})[_0xaa3e('0x25')](function(_0x26c6ad){if(_0x26c6ad){var _0x1f29a7=util['format'](_0xaa3e('0x50'),_0x26c6ad[_0xaa3e('0x4f')]);if(fs[_0xaa3e('0x51')](_0x1f29a7)){cypher=!![];return _0x5b0277['decryptFile'](_0x1f29a7,_0x26c6ad[_0xaa3e('0x4f')],config[_0xaa3e('0x53')][_0xaa3e('0x7c')])[_0xaa3e('0x25')](function(){return _0x26c6ad;});}return _0x26c6ad;}})['then'](function(_0x319330){if(!_0x319330){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x7d'));}_0x58eec7=_0x319330;return db[_0xaa3e('0x7e')][_0xaa3e('0x7b')]({'where':{'id':0x1}});})[_0xaa3e('0x25')](handleEntityNotFound(_0x2bf09a,null))[_0xaa3e('0x25')](function(_0x1bf4ae){if(_0x1bf4ae){_0x2be86e=_0x1bf4ae;if(!_0x2be86e['transcribe']||!_0x2be86e[_0xaa3e('0x7f')]||!_0x2be86e[_0xaa3e('0x80')]||!_0x2be86e[_0xaa3e('0x81')]||!_0x2be86e[_0xaa3e('0x72')]){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x82'));}if(_0xe12c82[_0xaa3e('0x4a')]['runSentiment']&&(!_0x2be86e[_0xaa3e('0x83')]||!_0x2be86e['sentimentAccountId']||!_0x2be86e[_0xaa3e('0x84')]||!_0x2be86e[_0xaa3e('0x81')]||!_0x2be86e[_0xaa3e('0x72')])){throw new db['Sequelize'][(_0xaa3e('0x55'))](_0xaa3e('0x85'));}return db[_0xaa3e('0x86')][_0xaa3e('0x7b')]({'where':{'id':_0x2be86e[_0xaa3e('0x7f')]}});}})['then'](function(_0x5f2865){if(!_0x5f2865){throw new db['Sequelize'][(_0xaa3e('0x55'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5f2865[_0xaa3e('0x87')]||!_0x5f2865['data2']){throw new db['Sequelize'][(_0xaa3e('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x3f4d59=_0x5f2865;return getBucketslist(_0x3f4d59[_0xaa3e('0x87')],_0x3f4d59[_0xaa3e('0x88')],_0x2be86e[_0xaa3e('0x80')]);})[_0xaa3e('0x25')](function(_0x4c430a){if(_0x4c430a&&_0x4c430a[_0xaa3e('0x89')]){var _0x15aed9=_[_0xaa3e('0x48')](_0x4c430a[_0xaa3e('0x89')],function(_0x16d8d5){return _0x16d8d5[_0xaa3e('0x8a')]===_0x2be86e[_0xaa3e('0x72')];});if(!_0x15aed9){logger[_0xaa3e('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xe12c82[_0xaa3e('0x47')]['id'],_0x2be86e['bucket']));return createBucket(_0x3f4d59['data1'],_0x3f4d59['data2'],_0x2be86e[_0xaa3e('0x80')],_0x2be86e['bucket']);}logger[_0xaa3e('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xe12c82[_0xaa3e('0x47')]['id'],_0x2be86e[_0xaa3e('0x72')]));return;}})[_0xaa3e('0x25')](function(_0x4c71cd){if(_0x58eec7[_0xaa3e('0x78')]===_0xaa3e('0x8b')){return transcribe(_0xe12c82[_0xaa3e('0x47')]['id'],_0x3f4d59['data1'],_0x3f4d59['data2'],_0x2be86e[_0xaa3e('0x80')],_0x2be86e['bucket'],_0x58eec7[_0xaa3e('0x4f')],_0x2be86e[_0xaa3e('0x81')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xe12c82[_0xaa3e('0x47')]['id']));return{'transcribeStatus':_0xaa3e('0x8c')};}})[_0xaa3e('0x25')](function(_0x53321d){if(_0x53321d){_0x53321d['tempSentiment']=_0xe12c82[_0xaa3e('0x4a')][_0xaa3e('0x8d')];return _0x58eec7['updateAttributes'](_0x53321d);}})[_0xaa3e('0x25')](respondWithResult(_0x2bf09a,null))['catch'](handleError(_0x2bf09a,null));};function writeFile(_0xa38ea6,_0x5d76e2){return new Promise(function(_0x455d7f,_0x5555b8){fs['writeFile'](_0x5d76e2,_0xa38ea6,function(_0x187f32,_0x176340){if(_0x187f32){return _0x5555b8(_0x187f32);}else{return _0x455d7f(_0x176340);}});});}exports[_0xaa3e('0x8e')]=function(_0x4a5ec2,_0x48f989,_0x47705f){return db[_0xaa3e('0x43')]['findOne']({'where':{'id':_0x4a5ec2[_0xaa3e('0x47')]['id']}})['then'](handleEntityNotFound(_0x48f989))[_0xaa3e('0x25')](function(_0x2d4ba2){if(_0x2d4ba2&&_0x2d4ba2['fileText']){var _0x9a94a1=_0x2d4ba2[_0xaa3e('0x8f')];var _0x256118=config['root']+'/server/files/transcribes/transcribe_'+_0x2d4ba2['id']+_0xaa3e('0x90');if(fs[_0xaa3e('0x51')](_0x256118)){return _0x256118;}return writeFile(_0x9a94a1,_0x256118)[_0xaa3e('0x25')](function(){return _0x256118;});}else{throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x91'));}})[_0xaa3e('0x25')](function(_0x48da9e){return _0x48f989[_0xaa3e('0x4c')](_0x48da9e);})[_0xaa3e('0x45')](handleError(_0x48f989));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index be40a7a..efb4ce7 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 _0xf296=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x1defb2,_0x429099){var _0xad8973=function(_0xe26c42){while(--_0xe26c42){_0x1defb2['push'](_0x1defb2['shift']());}};_0xad8973(++_0x429099);}(_0xf296,0x94));var _0x6f29=function(_0x45c856,_0x5e6a1e){_0x45c856=_0x45c856-0x0;var _0x4961aa=_0xf296[_0x45c856];return _0x4961aa;};'use strict';var attributes=require(_0x6f29('0x0'));module[_0x6f29('0x1')]=function(_0x4e5239,_0x45ff60){return _0x4e5239['define']('VoiceRecording',attributes,{'tableName':_0x6f29('0x2'),'paranoid':![],'indexes':[{'name':_0x6f29('0x3'),'fields':['uniqueid']},{'name':_0x6f29('0x4'),'fields':[_0x6f29('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27c5=['voice_recordings','uniqueid','transcribeStatus','define'];(function(_0x8ffee8,_0x4a5954){var _0x109982=function(_0x27fb14){while(--_0x27fb14){_0x8ffee8['push'](_0x8ffee8['shift']());}};_0x109982(++_0x4a5954);}(_0x27c5,0x173));var _0x527c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x27c5[_0x1b6c6d];return _0x290d9d;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x157017,_0x46cdc0){return _0x157017[_0x527c('0x0')]('VoiceRecording',attributes,{'tableName':_0x527c('0x1'),'paranoid':![],'indexes':[{'name':_0x527c('0x2'),'fields':[_0x527c('0x2')]},{'name':_0x527c('0x3'),'fields':[_0x527c('0x3')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 176ead0..a2ec550 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 _0x47c5=['secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceRecording','update','body','options','raw','where','attributes','limit','UpdateVoiceRecording','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher'];(function(_0x3541da,_0x5b2254){var _0xa24cff=function(_0x17f5a3){while(--_0x17f5a3){_0x3541da['push'](_0x3541da['shift']());}};_0xa24cff(++_0x5b2254);}(_0x47c5,0x165));var _0x547c=function(_0x15e17c,_0x39f6c8){_0x15e17c=_0x15e17c-0x0;var _0x55d8c7=_0x47c5[_0x15e17c];return _0x55d8c7;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['UpdateVoiceRecording']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23fa9e['options']?_0x23fa9e['options'][_0x547c('0x1d')]||null:null,'attributes':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1e')]||null:null,'limit':_0x23fa9e[_0x547c('0x1b')]?_0x23fa9e['options'][_0x547c('0x1f')]||null:null})[_0x547c('0xc')](function(_0x436e67){logger['info'](_0x547c('0x20'),_0x23fa9e);logger[_0x547c('0x10')](_0x547c('0x20'),_0x23fa9e,JSON[_0x547c('0x12')](_0x436e67));_0xeb059e(_0x436e67);})[_0x547c('0x17')](function(_0x2663bc){logger[_0x547c('0x13')](_0x547c('0x20'),_0x2663bc['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2663bc['message']));});});};exports['CreateVoiceRecording']=function(_0x4855fd){var _0x478f04=this;return new Promise(function(_0x2c725d,_0x4c5256){var _0x93985c=require('../../components/encryptor');var _0x3ea493;return db['Setting'][_0x547c('0x21')]({'attributes':['id',_0x547c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x547c('0xc')](function(_0x30a96c){_0x3ea493=_0x30a96c;return db[_0x547c('0x18')]['create'](_0x4855fd['body']);})[_0x547c('0xc')](function(_0x54de6f){if(_0x3ea493[_0x547c('0x22')]&&fs[_0x547c('0x23')](_0x54de6f[_0x547c('0x24')])){var _0x1695be=util[_0x547c('0x25')](_0x547c('0x26'),_0x54de6f[_0x547c('0x24')]);return _0x93985c['encryptFile'](_0x54de6f['value'],_0x1695be,config[_0x547c('0x27')][_0x547c('0x28')])[_0x547c('0xc')](function(){fs[_0x547c('0x29')](_0x54de6f[_0x547c('0x24')]);logger[_0x547c('0xd')](_0x547c('0x2a'));return _0x54de6f;});}return _0x54de6f;})[_0x547c('0xc')](function(_0x378bac){logger[_0x547c('0xd')](_0x547c('0x2b'),_0x4855fd);logger[_0x547c('0x10')](_0x547c('0x2b'),_0x4855fd,JSON[_0x547c('0x12')](_0x378bac));_0x2c725d(_0x378bac);})['catch'](function(_0x3afc28){logger['error']('CreateVoiceRecording',_0x3afc28['message'],_0x4855fd);_0x4c5256(_0x478f04[_0x547c('0x13')](0x1f4,_0x3afc28[_0x547c('0x15')]));});});}; \ No newline at end of file +var _0x66fa=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','body','options','raw','where','attributes','UpdateVoiceRecording','stringify'];(function(_0x296110,_0x214375){var _0x47a5cc=function(_0x3461e5){while(--_0x3461e5){_0x296110['push'](_0x296110['shift']());}};_0x47a5cc(++_0x214375);}(_0x66fa,0x117));var _0xa66f=function(_0x35ad4e,_0x164583){_0x35ad4e=_0x35ad4e-0x0;var _0x57c148=_0x66fa[_0x35ad4e];return _0x57c148;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}exports['UpdateVoiceRecording']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')](_0x1cbe64[_0xa66f('0x16')],{'raw':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x19')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x1a')]||null:null,'limit':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')]['limit']||null:null})[_0xa66f('0xb')](function(_0xc5c82e){logger[_0xa66f('0xc')](_0xa66f('0x1b'),_0x1cbe64);logger['debug'](_0xa66f('0x1b'),_0x1cbe64,JSON[_0xa66f('0x1c')](_0xc5c82e));_0x4a28d4(_0xc5c82e);})[_0xa66f('0x13')](function(_0x16f1fa){logger['error']('UpdateVoiceRecording',_0x16f1fa[_0xa66f('0x12')],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x16f1fa[_0xa66f('0x12')]));});});};exports[_0xa66f('0x1d')]=function(_0x384164){var _0x57da7f=this;return new Promise(function(_0x4683c7,_0x1c2903){var _0x13495f=require(_0xa66f('0x1e'));var _0x17c103;return db[_0xa66f('0x1f')][_0xa66f('0x20')]({'attributes':['id',_0xa66f('0x21')],'where':{'id':0x1},'raw':!![]})[_0xa66f('0xb')](function(_0x117d03){_0x17c103=_0x117d03;return db[_0xa66f('0x14')][_0xa66f('0x22')](_0x384164[_0xa66f('0x16')]);})[_0xa66f('0xb')](function(_0x49f615){if(_0x17c103['callRecordingEncryption']&&fs[_0xa66f('0x23')](_0x49f615[_0xa66f('0x24')])){var _0x55f309=util[_0xa66f('0x25')](_0xa66f('0x26'),_0x49f615['value']);return _0x13495f[_0xa66f('0x27')](_0x49f615[_0xa66f('0x24')],_0x55f309,config[_0xa66f('0x28')][_0xa66f('0x29')])[_0xa66f('0xb')](function(){fs['unlink'](_0x49f615[_0xa66f('0x24')]);logger['info'](_0xa66f('0x2a'));return _0x49f615;});}return _0x49f615;})[_0xa66f('0xb')](function(_0x2e4dc8){logger['info'](_0xa66f('0x1d'),_0x384164);logger[_0xa66f('0x2b')]('CreateVoiceRecording',_0x384164,JSON[_0xa66f('0x1c')](_0x2e4dc8));_0x4683c7(_0x2e4dc8);})[_0xa66f('0x13')](function(_0xba9457){logger[_0xa66f('0xf')](_0xa66f('0x1d'),_0xba9457[_0xa66f('0x12')],_0x384164);_0x1c2903(_0x57da7f[_0xa66f('0xf')](0x1f4,_0xba9457[_0xa66f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3d84def..96225ab 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 _0x7295=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x7295,0x1d0));var _0x5729=function(_0xf02353,_0x5d599b){_0xf02353=_0xf02353-0x0;var _0x59f7df=_0x7295[_0xf02353];return _0x59f7df;};'use strict';var multer=require(_0x5729('0x0'));var util=require(_0x5729('0x1'));var path=require('path');var timeout=require(_0x5729('0x2'));var express=require(_0x5729('0x3'));var router=express[_0x5729('0x4')]();var fs_extra=require(_0x5729('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5729('0x6'));var controller=require(_0x5729('0x7'));router[_0x5729('0x8')]('/',auth[_0x5729('0x9')](),controller[_0x5729('0xa')]);router[_0x5729('0x8')](_0x5729('0xb'),auth[_0x5729('0x9')](),controller[_0x5729('0xc')]);router[_0x5729('0x8')](_0x5729('0xd'),auth['isAuthenticated'](),controller[_0x5729('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5729('0xf')]);router[_0x5729('0x10')](_0x5729('0xd'),auth[_0x5729('0x9')](),controller['update']);router[_0x5729('0x11')](_0x5729('0xd'),auth[_0x5729('0x9')](),controller[_0x5729('0x12')]);module[_0x5729('0x13')]=router; \ No newline at end of file +var _0x007e=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','update','delete'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0x007e,0xad));var _0xe007=function(_0x116fcd,_0x207538){_0x116fcd=_0x116fcd-0x0;var _0x914264=_0x007e[_0x116fcd];return _0x914264;};'use strict';var multer=require(_0xe007('0x0'));var util=require(_0xe007('0x1'));var path=require('path');var timeout=require(_0xe007('0x2'));var express=require(_0xe007('0x3'));var router=express[_0xe007('0x4')]();var fs_extra=require(_0xe007('0x5'));var auth=require(_0xe007('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe007('0x7'));var controller=require(_0xe007('0x8'));router[_0xe007('0x9')]('/',auth[_0xe007('0xa')](),controller[_0xe007('0xb')]);router[_0xe007('0x9')](_0xe007('0xc'),auth[_0xe007('0xa')](),controller[_0xe007('0xd')]);router[_0xe007('0x9')](_0xe007('0xe'),auth[_0xe007('0xa')](),controller['show']);router['post']('/',auth[_0xe007('0xa')](),controller['create']);router['put'](_0xe007('0xe'),auth[_0xe007('0xa')](),controller[_0xe007('0xf')]);router[_0xe007('0x10')](_0xe007('0xe'),auth[_0xe007('0xa')](),controller[_0xe007('0x11')]);module[_0xe007('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ea82a36..c5e7702 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 _0xb19e=['blind','attended','STRING','Yes','sequelize','exports','ENUM'];(function(_0x1342c1,_0xb7243c){var _0x33e9f7=function(_0x54cbb5){while(--_0x54cbb5){_0x1342c1['push'](_0x1342c1['shift']());}};_0x33e9f7(++_0xb7243c);}(_0xb19e,0x1a8));var _0xeb19=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0xb19e[_0x1aed80];return _0x43961e;};'use strict';var Sequelize=require(_0xeb19('0x0'));var moment=require('moment');module[_0xeb19('0x1')]={'type':{'type':Sequelize[_0xeb19('0x2')](_0xeb19('0x3'),_0xeb19('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xeb19('0x5')]},'transferercalleridname':{'type':Sequelize[_0xeb19('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xeb19('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xeb19('0x5')]},'transferercontext':{'type':Sequelize[_0xeb19('0x5')]},'transfererexten':{'type':Sequelize[_0xeb19('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xeb19('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xeb19('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xeb19('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xeb19('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xeb19('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xeb19('0x5')]},'transfereecontext':{'type':Sequelize[_0xeb19('0x5')]},'transfereeexten':{'type':Sequelize[_0xeb19('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xeb19('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xeb19('0x6'),'No')},'context':{'type':Sequelize[_0xeb19('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x63bf=['Yes','moment','exports','ENUM','blind','STRING'];(function(_0x232c80,_0x5bb7d5){var _0x1d29aa=function(_0x7a0eca){while(--_0x7a0eca){_0x232c80['push'](_0x232c80['shift']());}};_0x1d29aa(++_0x5bb7d5);}(_0x63bf,0x109));var _0xf63b=function(_0x21c287,_0x576a39){_0x21c287=_0x21c287-0x0;var _0x15a5e7=_0x63bf[_0x21c287];return _0x15a5e7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf63b('0x0'));module[_0xf63b('0x1')]={'type':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x3'),'attended')},'result':{'type':Sequelize[_0xf63b('0x4')]},'transfererchannel':{'type':Sequelize[_0xf63b('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xf63b('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xf63b('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xf63b('0x4')]},'transferercontext':{'type':Sequelize[_0xf63b('0x4')]},'transfererexten':{'type':Sequelize[_0xf63b('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf63b('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf63b('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xf63b('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf63b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf63b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xf63b('0x4')]},'transfereecontext':{'type':Sequelize[_0xf63b('0x4')]},'transfereeexten':{'type':Sequelize[_0xf63b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf63b('0x4')]},'isexternal':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x5'),'No')},'context':{'type':Sequelize[_0xf63b('0x4')]},'extension':{'type':Sequelize[_0xf63b('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6043644..b5e2515 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 _0x6444=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','rows','catch','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x2ea4f0,_0x420118){var _0x5c5877=function(_0x16f450){while(--_0x16f450){_0x2ea4f0['push'](_0x2ea4f0['shift']());}};_0x5c5877(++_0x420118);}(_0x6444,0xe1));var _0x4644=function(_0x18eb3f,_0x78181b){_0x18eb3f=_0x18eb3f-0x0;var _0x2ed457=_0x6444[_0x18eb3f];return _0x2ed457;};'use strict';var emlformat=require(_0x4644('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4644('0x1'));var jsonpatch=require(_0x4644('0x2'));var rp=require(_0x4644('0x3'));var moment=require(_0x4644('0x4'));var BPromise=require(_0x4644('0x5'));var Mustache=require(_0x4644('0x6'));var util=require('util');var path=require(_0x4644('0x7'));var sox=require(_0x4644('0x8'));var csv=require(_0x4644('0x9'));var ejs=require(_0x4644('0xa'));var fs=require('fs');var fs_extra=require(_0x4644('0xb'));var _=require(_0x4644('0xc'));var squel=require(_0x4644('0xd'));var crypto=require(_0x4644('0xe'));var jsforce=require(_0x4644('0xf'));var deskjs=require(_0x4644('0x10'));var toCsv=require(_0x4644('0x9'));var querystring=require(_0x4644('0x11'));var Papa=require(_0x4644('0x12'));var Redis=require(_0x4644('0x13'));var authService=require(_0x4644('0x14'));var qs=require(_0x4644('0x15'));var as=require(_0x4644('0x16'));var hardwareService=require(_0x4644('0x17'));var logger=require(_0x4644('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x4644('0x19'));var licenseUtil=require(_0x4644('0x1a'));var db=require(_0x4644('0x1b'))['db'];function respondWithStatusCode(_0x24c498,_0x3f06be){_0x3f06be=_0x3f06be||0xcc;return function(_0x3d3572){if(_0x3d3572){return _0x24c498[_0x4644('0x1c')](_0x3f06be);}return _0x24c498[_0x4644('0x1d')](_0x3f06be)['end']();};}function respondWithResult(_0x22e1bc,_0x3e5d2f){_0x3e5d2f=_0x3e5d2f||0xc8;return function(_0x2fdb30){if(_0x2fdb30){return _0x22e1bc[_0x4644('0x1d')](_0x3e5d2f)[_0x4644('0x1e')](_0x2fdb30);}};}function respondWithFilteredResult(_0x1db7e8,_0x2838f9){return function(_0x2b4f08){if(_0x2b4f08){var _0x465d1f=typeof _0x2838f9['offset']===_0x4644('0x1f')&&typeof _0x2838f9[_0x4644('0x20')]===_0x4644('0x1f');var _0x4c20f4=_0x2b4f08['count'];var _0x4d6b4f=_0x465d1f?0x0:_0x2838f9[_0x4644('0x21')];var _0x5f4efb=_0x465d1f?_0x2b4f08[_0x4644('0x22')]:_0x2838f9['offset']+_0x2838f9['limit'];var _0x51352e;if(_0x5f4efb>=_0x4c20f4){_0x5f4efb=_0x4c20f4;_0x51352e=0xc8;}else{_0x51352e=0xce;}_0x1db7e8[_0x4644('0x1d')](_0x51352e);return _0x1db7e8['set'](_0x4644('0x23'),_0x4d6b4f+'-'+_0x5f4efb+'/'+_0x4c20f4)[_0x4644('0x1e')](_0x2b4f08);}return null;};}function patchUpdates(_0x288c9e){return function(_0xb94e28){try{jsonpatch[_0x4644('0x24')](_0xb94e28,_0x288c9e,!![]);}catch(_0xf5f2d3){return BPromise['reject'](_0xf5f2d3);}return _0xb94e28[_0x4644('0x25')]();};}function saveUpdates(_0x291065,_0x3b276c){return function(_0xf02c9b){if(_0xf02c9b){return _0xf02c9b[_0x4644('0x26')](_0x291065)[_0x4644('0x27')](function(_0x2ed317){return _0x2ed317;});}return null;};}function removeEntity(_0x563364,_0x112172){return function(_0x269f92){if(_0x269f92){return _0x269f92['destroy']()['then'](function(){_0x563364[_0x4644('0x1d')](0xcc)[_0x4644('0x28')]();});}};}function handleEntityNotFound(_0x2c7d95,_0x59934a){return function(_0x396d10){if(!_0x396d10){_0x2c7d95[_0x4644('0x1c')](0x194);}return _0x396d10;};}function handleError(_0x4ccd51,_0x1ea816){_0x1ea816=_0x1ea816||0x1f4;return function(_0x36be07){logger[_0x4644('0x29')](_0x36be07[_0x4644('0x2a')]);if(_0x36be07[_0x4644('0x2b')]){delete _0x36be07[_0x4644('0x2b')];}_0x4ccd51['status'](_0x1ea816)[_0x4644('0x2c')](_0x36be07);};}exports[_0x4644('0x2d')]=function(_0x50b4e6,_0x1a1090){var _0x150841={},_0x1cc184={},_0x51e6eb={'count':0x0,'rows':[]};var _0xee3d8=_[_0x4644('0x2e')](db[_0x4644('0x2f')][_0x4644('0x30')],function(_0x34b9b0){return{'name':_0x34b9b0[_0x4644('0x31')],'type':_0x34b9b0[_0x4644('0x32')][_0x4644('0x33')]};});_0x1cc184[_0x4644('0x34')]=_[_0x4644('0x2e')](_0xee3d8,_0x4644('0x2b'));_0x1cc184[_0x4644('0x35')]=_[_0x4644('0x36')](_0x50b4e6[_0x4644('0x35')]);_0x1cc184[_0x4644('0x37')]=_[_0x4644('0x38')](_0x1cc184['model'],_0x1cc184[_0x4644('0x35')]);_0x150841[_0x4644('0x39')]=_[_0x4644('0x38')](_0x1cc184['model'],qs['fields'](_0x50b4e6[_0x4644('0x35')][_0x4644('0x3a')]));_0x150841[_0x4644('0x39')]=_0x150841['attributes'][_0x4644('0x3b')]?_0x150841[_0x4644('0x39')]:_0x1cc184[_0x4644('0x34')];if(!_0x50b4e6[_0x4644('0x35')][_0x4644('0x3c')](_0x4644('0x3d'))){_0x150841[_0x4644('0x20')]=qs[_0x4644('0x20')](_0x50b4e6['query'][_0x4644('0x20')]);_0x150841[_0x4644('0x21')]=qs[_0x4644('0x21')](_0x50b4e6[_0x4644('0x35')][_0x4644('0x21')]);}_0x150841[_0x4644('0x3e')]=qs[_0x4644('0x3f')](_0x50b4e6[_0x4644('0x35')][_0x4644('0x3f')]);_0x150841[_0x4644('0x40')]=qs[_0x4644('0x37')](_['pick'](_0x50b4e6[_0x4644('0x35')],_0x1cc184[_0x4644('0x37')]),_0xee3d8);if(_0x50b4e6[_0x4644('0x35')]['filter']){_0x150841['where']=_[_0x4644('0x41')](_0x150841[_0x4644('0x40')],{'$or':_[_0x4644('0x2e')](_0xee3d8,function(_0x1af0d8){if(_0x1af0d8[_0x4644('0x32')]!=='VIRTUAL'){var _0x54cf12={};_0x54cf12[_0x1af0d8[_0x4644('0x2b')]]={'$like':'%'+_0x50b4e6[_0x4644('0x35')][_0x4644('0x42')]+'%'};return _0x54cf12;}})});}_0x150841=_[_0x4644('0x41')]({},_0x150841,_0x50b4e6[_0x4644('0x43')]);var _0x24619d={'where':_0x150841[_0x4644('0x40')]};return db[_0x4644('0x2f')]['count'](_0x24619d)[_0x4644('0x27')](function(_0x1b29aa){_0x51e6eb[_0x4644('0x22')]=_0x1b29aa;if(_0x50b4e6[_0x4644('0x35')][_0x4644('0x44')]){_0x150841[_0x4644('0x45')]=[{'all':!![]}];}return db[_0x4644('0x2f')]['findAll'](_0x150841);})[_0x4644('0x27')](function(_0x59536e){_0x51e6eb[_0x4644('0x46')]=_0x59536e;return _0x51e6eb;})['then'](respondWithFilteredResult(_0x1a1090,_0x150841))[_0x4644('0x47')](handleError(_0x1a1090,null));};exports['show']=function(_0x4fd79c,_0x31794b){var _0x56f1f2={'raw':!![],'where':{'id':_0x4fd79c['params']['id']}},_0x3b64ae={};_0x3b64ae[_0x4644('0x34')]=_[_0x4644('0x36')](db[_0x4644('0x2f')]['rawAttributes']);_0x3b64ae[_0x4644('0x35')]=_[_0x4644('0x36')](_0x4fd79c[_0x4644('0x35')]);_0x3b64ae[_0x4644('0x37')]=_[_0x4644('0x38')](_0x3b64ae[_0x4644('0x34')],_0x3b64ae[_0x4644('0x35')]);_0x56f1f2[_0x4644('0x39')]=_[_0x4644('0x38')](_0x3b64ae['model'],qs[_0x4644('0x3a')](_0x4fd79c[_0x4644('0x35')][_0x4644('0x3a')]));_0x56f1f2[_0x4644('0x39')]=_0x56f1f2[_0x4644('0x39')][_0x4644('0x3b')]?_0x56f1f2[_0x4644('0x39')]:_0x3b64ae[_0x4644('0x34')];if(_0x4fd79c[_0x4644('0x35')][_0x4644('0x44')]){_0x56f1f2[_0x4644('0x45')]=[{'all':!![]}];}_0x56f1f2=_['merge']({},_0x56f1f2,_0x4fd79c[_0x4644('0x43')]);return db[_0x4644('0x2f')][_0x4644('0x48')](_0x56f1f2)[_0x4644('0x27')](handleEntityNotFound(_0x31794b,null))[_0x4644('0x27')](respondWithResult(_0x31794b,null))[_0x4644('0x47')](handleError(_0x31794b,null));};exports['create']=function(_0x4418a9,_0xd5f0ef){return db['VoiceTransferReport'][_0x4644('0x49')](_0x4418a9['body'],{})[_0x4644('0x27')](respondWithResult(_0xd5f0ef,0xc9))[_0x4644('0x47')](handleError(_0xd5f0ef,null));};exports[_0x4644('0x26')]=function(_0x4694f1,_0x44c1e9){if(_0x4694f1['body']['id']){delete _0x4694f1[_0x4644('0x4a')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x4694f1[_0x4644('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44c1e9,null))[_0x4644('0x27')](saveUpdates(_0x4694f1['body'],null))[_0x4644('0x27')](respondWithResult(_0x44c1e9,null))[_0x4644('0x47')](handleError(_0x44c1e9,null));};exports[_0x4644('0x4c')]=function(_0xb8e97c,_0x4270c9){return db['VoiceTransferReport'][_0x4644('0x48')]({'where':{'id':_0xb8e97c['params']['id']}})[_0x4644('0x27')](handleEntityNotFound(_0x4270c9,null))[_0x4644('0x27')](removeEntity(_0x4270c9,null))[_0x4644('0x47')](handleError(_0x4270c9,null));};exports[_0x4644('0x4d')]=function(_0x1c2421,_0x49ecfd){return db[_0x4644('0x2f')][_0x4644('0x4d')]()[_0x4644('0x27')](respondWithResult(_0x49ecfd,null))[_0x4644('0x47')](handleError(_0x49ecfd,null));}; \ No newline at end of file +var _0xe12e=['type','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','error','stack','name','map','VoiceTransferReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x3febf9,_0x196358){var _0x19c2f7=function(_0x5202b8){while(--_0x5202b8){_0x3febf9['push'](_0x3febf9['shift']());}};_0x19c2f7(++_0x196358);}(_0xe12e,0x129));var _0xee12=function(_0x3addde,_0x251294){_0x3addde=_0x3addde-0x0;var _0x55364e=_0xe12e[_0x3addde];return _0x55364e;};'use strict';var emlformat=require(_0xee12('0x0'));var rimraf=require(_0xee12('0x1'));var zipdir=require(_0xee12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee12('0x3'));var moment=require(_0xee12('0x4'));var BPromise=require(_0xee12('0x5'));var Mustache=require(_0xee12('0x6'));var util=require(_0xee12('0x7'));var path=require('path');var sox=require(_0xee12('0x8'));var csv=require(_0xee12('0x9'));var ejs=require(_0xee12('0xa'));var fs=require('fs');var fs_extra=require(_0xee12('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xee12('0xc'));var jsforce=require(_0xee12('0xd'));var deskjs=require(_0xee12('0xe'));var toCsv=require('to-csv');var querystring=require(_0xee12('0xf'));var Papa=require(_0xee12('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee12('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xee12('0x12'))('api');var utils=require(_0xee12('0x13'));var config=require(_0xee12('0x14'));var licenseUtil=require(_0xee12('0x15'));var db=require(_0xee12('0x16'))['db'];function respondWithStatusCode(_0x204039,_0x5aaecd){_0x5aaecd=_0x5aaecd||0xcc;return function(_0x25fb85){if(_0x25fb85){return _0x204039[_0xee12('0x17')](_0x5aaecd);}return _0x204039['status'](_0x5aaecd)[_0xee12('0x18')]();};}function respondWithResult(_0x5c1dd3,_0x51dde2){_0x51dde2=_0x51dde2||0xc8;return function(_0x38ae60){if(_0x38ae60){return _0x5c1dd3[_0xee12('0x19')](_0x51dde2)[_0xee12('0x1a')](_0x38ae60);}};}function respondWithFilteredResult(_0x3286b1,_0x124fd6){return function(_0x12ded7){if(_0x12ded7){var _0xf0cd0b=typeof _0x124fd6[_0xee12('0x1b')]==='undefined'&&typeof _0x124fd6[_0xee12('0x1c')]===_0xee12('0x1d');var _0x4cc9c8=_0x12ded7['count'];var _0x417ca5=_0xf0cd0b?0x0:_0x124fd6[_0xee12('0x1b')];var _0x59fece=_0xf0cd0b?_0x12ded7[_0xee12('0x1e')]:_0x124fd6['offset']+_0x124fd6[_0xee12('0x1c')];var _0x33ac6c;if(_0x59fece>=_0x4cc9c8){_0x59fece=_0x4cc9c8;_0x33ac6c=0xc8;}else{_0x33ac6c=0xce;}_0x3286b1['status'](_0x33ac6c);return _0x3286b1[_0xee12('0x1f')]('Content-Range',_0x417ca5+'-'+_0x59fece+'/'+_0x4cc9c8)[_0xee12('0x1a')](_0x12ded7);}return null;};}function patchUpdates(_0x2c01fb){return function(_0x18a555){try{jsonpatch['apply'](_0x18a555,_0x2c01fb,!![]);}catch(_0x4dfa4e){return BPromise[_0xee12('0x20')](_0x4dfa4e);}return _0x18a555[_0xee12('0x21')]();};}function saveUpdates(_0x30b40e,_0x4e945d){return function(_0x18655a){if(_0x18655a){return _0x18655a[_0xee12('0x22')](_0x30b40e)['then'](function(_0x357e89){return _0x357e89;});}return null;};}function removeEntity(_0x2c72c7,_0x42a9d7){return function(_0x680d2){if(_0x680d2){return _0x680d2[_0xee12('0x23')]()[_0xee12('0x24')](function(){_0x2c72c7[_0xee12('0x19')](0xcc)[_0xee12('0x18')]();});}};}function handleEntityNotFound(_0x13ad54,_0x29e257){return function(_0x4090a8){if(!_0x4090a8){_0x13ad54[_0xee12('0x17')](0x194);}return _0x4090a8;};}function handleError(_0x3eb550,_0x50fc59){_0x50fc59=_0x50fc59||0x1f4;return function(_0x484c52){logger[_0xee12('0x25')](_0x484c52[_0xee12('0x26')]);if(_0x484c52[_0xee12('0x27')]){delete _0x484c52['name'];}_0x3eb550['status'](_0x50fc59)['send'](_0x484c52);};}exports['index']=function(_0x186b82,_0x514c2e){var _0x3fd710={},_0x285a6e={},_0x22db61={'count':0x0,'rows':[]};var _0x132b0a=_[_0xee12('0x28')](db[_0xee12('0x29')][_0xee12('0x2a')],function(_0x5b4f50){return{'name':_0x5b4f50['fieldName'],'type':_0x5b4f50['type']['key']};});_0x285a6e[_0xee12('0x2b')]=_[_0xee12('0x28')](_0x132b0a,'name');_0x285a6e[_0xee12('0x2c')]=_[_0xee12('0x2d')](_0x186b82[_0xee12('0x2c')]);_0x285a6e[_0xee12('0x2e')]=_['intersection'](_0x285a6e[_0xee12('0x2b')],_0x285a6e[_0xee12('0x2c')]);_0x3fd710[_0xee12('0x2f')]=_[_0xee12('0x30')](_0x285a6e[_0xee12('0x2b')],qs['fields'](_0x186b82[_0xee12('0x2c')][_0xee12('0x31')]));_0x3fd710[_0xee12('0x2f')]=_0x3fd710[_0xee12('0x2f')][_0xee12('0x32')]?_0x3fd710['attributes']:_0x285a6e['model'];if(!_0x186b82[_0xee12('0x2c')][_0xee12('0x33')](_0xee12('0x34'))){_0x3fd710['limit']=qs[_0xee12('0x1c')](_0x186b82[_0xee12('0x2c')]['limit']);_0x3fd710[_0xee12('0x1b')]=qs['offset'](_0x186b82['query'][_0xee12('0x1b')]);}_0x3fd710[_0xee12('0x35')]=qs['sort'](_0x186b82[_0xee12('0x2c')][_0xee12('0x36')]);_0x3fd710[_0xee12('0x37')]=qs[_0xee12('0x2e')](_[_0xee12('0x38')](_0x186b82[_0xee12('0x2c')],_0x285a6e[_0xee12('0x2e')]),_0x132b0a);if(_0x186b82[_0xee12('0x2c')]['filter']){_0x3fd710['where']=_[_0xee12('0x39')](_0x3fd710[_0xee12('0x37')],{'$or':_[_0xee12('0x28')](_0x132b0a,function(_0x496fe5){if(_0x496fe5[_0xee12('0x3a')]!=='VIRTUAL'){var _0x612eab={};_0x612eab[_0x496fe5[_0xee12('0x27')]]={'$like':'%'+_0x186b82[_0xee12('0x2c')]['filter']+'%'};return _0x612eab;}})});}_0x3fd710=_[_0xee12('0x39')]({},_0x3fd710,_0x186b82['options']);var _0x3683a4={'where':_0x3fd710[_0xee12('0x37')]};return db[_0xee12('0x29')][_0xee12('0x1e')](_0x3683a4)[_0xee12('0x24')](function(_0x5755c4){_0x22db61[_0xee12('0x1e')]=_0x5755c4;if(_0x186b82[_0xee12('0x2c')][_0xee12('0x3b')]){_0x3fd710['include']=[{'all':!![]}];}return db[_0xee12('0x29')][_0xee12('0x3c')](_0x3fd710);})[_0xee12('0x24')](function(_0x40820c){_0x22db61[_0xee12('0x3d')]=_0x40820c;return _0x22db61;})[_0xee12('0x24')](respondWithFilteredResult(_0x514c2e,_0x3fd710))[_0xee12('0x3e')](handleError(_0x514c2e,null));};exports[_0xee12('0x3f')]=function(_0x328b1c,_0x37ccd4){var _0x4fd400={'raw':!![],'where':{'id':_0x328b1c[_0xee12('0x40')]['id']}},_0x5b4572={};_0x5b4572['model']=_[_0xee12('0x2d')](db[_0xee12('0x29')]['rawAttributes']);_0x5b4572[_0xee12('0x2c')]=_[_0xee12('0x2d')](_0x328b1c[_0xee12('0x2c')]);_0x5b4572['filters']=_[_0xee12('0x30')](_0x5b4572['model'],_0x5b4572[_0xee12('0x2c')]);_0x4fd400[_0xee12('0x2f')]=_['intersection'](_0x5b4572[_0xee12('0x2b')],qs['fields'](_0x328b1c[_0xee12('0x2c')][_0xee12('0x31')]));_0x4fd400[_0xee12('0x2f')]=_0x4fd400[_0xee12('0x2f')][_0xee12('0x32')]?_0x4fd400[_0xee12('0x2f')]:_0x5b4572['model'];if(_0x328b1c[_0xee12('0x2c')][_0xee12('0x3b')]){_0x4fd400[_0xee12('0x41')]=[{'all':!![]}];}_0x4fd400=_[_0xee12('0x39')]({},_0x4fd400,_0x328b1c[_0xee12('0x42')]);return db['VoiceTransferReport']['find'](_0x4fd400)[_0xee12('0x24')](handleEntityNotFound(_0x37ccd4,null))[_0xee12('0x24')](respondWithResult(_0x37ccd4,null))[_0xee12('0x3e')](handleError(_0x37ccd4,null));};exports['create']=function(_0x5d36e4,_0x48c385){return db[_0xee12('0x29')][_0xee12('0x43')](_0x5d36e4[_0xee12('0x44')],{})[_0xee12('0x24')](respondWithResult(_0x48c385,0xc9))['catch'](handleError(_0x48c385,null));};exports[_0xee12('0x22')]=function(_0x4e359e,_0x5c75e7){if(_0x4e359e[_0xee12('0x44')]['id']){delete _0x4e359e[_0xee12('0x44')]['id'];}return db['VoiceTransferReport'][_0xee12('0x45')]({'where':{'id':_0x4e359e[_0xee12('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c75e7,null))['then'](saveUpdates(_0x4e359e[_0xee12('0x44')],null))[_0xee12('0x24')](respondWithResult(_0x5c75e7,null))[_0xee12('0x3e')](handleError(_0x5c75e7,null));};exports[_0xee12('0x23')]=function(_0xd57b8,_0x110328){return db['VoiceTransferReport'][_0xee12('0x45')]({'where':{'id':_0xd57b8[_0xee12('0x40')]['id']}})[_0xee12('0x24')](handleEntityNotFound(_0x110328,null))[_0xee12('0x24')](removeEntity(_0x110328,null))[_0xee12('0x3e')](handleError(_0x110328,null));};exports[_0xee12('0x46')]=function(_0x304d8a,_0x379aab){return db[_0xee12('0x29')][_0xee12('0x46')]()['then'](respondWithResult(_0x379aab,null))['catch'](handleError(_0x379aab,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 16b3c46..1a4bb89 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 _0x7896=['api','moment','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x7896,0x185));var _0x6789=function(_0x2ea20d,_0x5e8e3c){_0x2ea20d=_0x2ea20d-0x0;var _0x3ba66a=_0x7896[_0x2ea20d];return _0x3ba66a;};'use strict';var _=require(_0x6789('0x0'));var util=require(_0x6789('0x1'));var logger=require(_0x6789('0x2'))(_0x6789('0x3'));var moment=require(_0x6789('0x4'));var BPromise=require('bluebird');var rp=require(_0x6789('0x5'));var fs=require('fs');var path=require(_0x6789('0x6'));var rimraf=require(_0x6789('0x7'));var config=require(_0x6789('0x8'));var attributes=require(_0x6789('0x9'));module[_0x6789('0xa')]=function(_0x496f00,_0x1c3e67){return _0x496f00[_0x6789('0xb')](_0x6789('0xc'),attributes,{'tableName':_0x6789('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb13b=['./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb13b,0x122));var _0xbb13=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb13b[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))('api');var moment=require(_0xbb13('0x2'));var BPromise=require(_0xbb13('0x3'));var rp=require(_0xbb13('0x4'));var fs=require('fs');var path=require(_0xbb13('0x5'));var rimraf=require('rimraf');var config=require(_0xbb13('0x6'));var attributes=require(_0xbb13('0x7'));module[_0xbb13('0x8')]=function(_0x6fe38b,_0x1c4c4e){return _0x6fe38b[_0xbb13('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xbb13('0xa'),'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 fe6a470..cd44d47 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 _0x671a=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','create','options','raw','then','CreateVoiceTransferReport','util','randomstring'];(function(_0xa8a20d,_0x2f781e){var _0x33cf7f=function(_0x397a53){while(--_0x397a53){_0xa8a20d['push'](_0xa8a20d['shift']());}};_0x33cf7f(++_0x2f781e);}(_0x671a,0x1cc));var _0xa671=function(_0x3a5df2,_0x2b5517){_0x3a5df2=_0x3a5df2-0x0;var _0x3a65b6=_0x671a[_0x3a5df2];return _0x3a65b6;};'use strict';var _=require('lodash');var util=require(_0xa671('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa671('0x1'));var fs=require('fs');var Redis=require(_0xa671('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa671('0x3'));var logger=require(_0xa671('0x4'))('rpc');var config=require(_0xa671('0x5'));var jayson=require(_0xa671('0x6'));var client=jayson[_0xa671('0x7')][_0xa671('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x677f97,_0x5c255a,_0x5f3754){return new BPromise(function(_0xe2435f,_0x55be18){return client['request'](_0x677f97,_0x5f3754)['then'](function(_0x41c402){logger[_0xa671('0x9')](_0xa671('0xa'),_0x5c255a,_0xa671('0xb'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5c255a,_0xa671('0xb'),JSON[_0xa671('0xc')](_0x41c402));if(_0x41c402['error']){if(_0x41c402['error'][_0xa671('0xd')]===0x1f4){logger['error'](_0xa671('0xa'),_0x5c255a,_0x41c402[_0xa671('0xe')][_0xa671('0xf')]);return _0x55be18(_0x41c402['error'][_0xa671('0xf')]);}logger[_0xa671('0xe')](_0xa671('0xa'),_0x5c255a,_0x41c402[_0xa671('0xe')]['message']);return _0xe2435f(_0x41c402['error'][_0xa671('0xf')]);}else{logger[_0xa671('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c255a,_0xa671('0xb'));_0xe2435f(_0x41c402['result'][_0xa671('0xf')]);}})[_0xa671('0x10')](function(_0x55c571){logger[_0xa671('0xe')](_0xa671('0xa'),_0x5c255a,_0x55c571);_0x55be18(_0x55c571);});});}exports['CreateVoiceTransferReport']=function(_0x437021){var _0x4f2316=this;return new Promise(function(_0x405dd5,_0x293310){return db['VoiceTransferReport'][_0xa671('0x11')](_0x437021['body'],{'raw':_0x437021[_0xa671('0x12')]?_0x437021[_0xa671('0x12')][_0xa671('0x13')]===undefined?!![]:![]:!![]})[_0xa671('0x14')](function(_0x1fd488){logger[_0xa671('0x9')](_0xa671('0x15'),_0x437021);logger['debug'](_0xa671('0x15'),_0x437021,JSON[_0xa671('0xc')](_0x1fd488));_0x405dd5(_0x1fd488);})[_0xa671('0x10')](function(_0x30a867){logger[_0xa671('0xe')](_0xa671('0x15'),_0x30a867[_0xa671('0xf')],_0x437021);_0x293310(_0x4f2316[_0xa671('0xe')](0x1f4,_0x30a867['message']));});});}; \ No newline at end of file +var _0x53f4=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x314294,_0x2ab1ae){var _0xbecc35=function(_0x2d6f4c){while(--_0x2d6f4c){_0x314294['push'](_0x314294['shift']());}};_0xbecc35(++_0x2ab1ae);}(_0x53f4,0xbd));var _0x453f=function(_0x4aefb9,_0x55959c){_0x4aefb9=_0x4aefb9-0x0;var _0x3152dc=_0x53f4[_0x4aefb9];return _0x3152dc;};'use strict';var _=require('lodash');var util=require(_0x453f('0x0'));var moment=require(_0x453f('0x1'));var BPromise=require(_0x453f('0x2'));var rs=require(_0x453f('0x3'));var fs=require('fs');var Redis=require(_0x453f('0x4'));var db=require(_0x453f('0x5'))['db'];var utils=require(_0x453f('0x6'));var logger=require(_0x453f('0x7'))(_0x453f('0x8'));var config=require('../../config/environment');var jayson=require(_0x453f('0x9'));var client=jayson[_0x453f('0xa')][_0x453f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28dc2a,_0x3b24ad,_0x4215f8){return new BPromise(function(_0x12294d,_0x1c77c9){return client[_0x453f('0xc')](_0x28dc2a,_0x4215f8)['then'](function(_0x9dd979){logger[_0x453f('0xd')](_0x453f('0xe'),_0x3b24ad,_0x453f('0xf'));logger['debug'](_0x453f('0x10'),_0x3b24ad,_0x453f('0xf'),JSON[_0x453f('0x11')](_0x9dd979));if(_0x9dd979[_0x453f('0x12')]){if(_0x9dd979[_0x453f('0x12')]['code']===0x1f4){logger[_0x453f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b24ad,_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);return _0x1c77c9(_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);}logger['error'](_0x453f('0xe'),_0x3b24ad,_0x9dd979[_0x453f('0x12')]['message']);return _0x12294d(_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);}else{logger[_0x453f('0xd')](_0x453f('0xe'),_0x3b24ad,'request\x20sent');_0x12294d(_0x9dd979[_0x453f('0x14')][_0x453f('0x13')]);}})[_0x453f('0x15')](function(_0xf50632){logger[_0x453f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b24ad,_0xf50632);_0x1c77c9(_0xf50632);});});}exports['CreateVoiceTransferReport']=function(_0x5c63ad){var _0x260f9e=this;return new Promise(function(_0x3ce80d,_0x1eae4b){return db[_0x453f('0x16')][_0x453f('0x17')](_0x5c63ad[_0x453f('0x18')],{'raw':_0x5c63ad[_0x453f('0x19')]?_0x5c63ad['options'][_0x453f('0x1a')]===undefined?!![]:![]:!![]})[_0x453f('0x1b')](function(_0x344483){logger[_0x453f('0xd')](_0x453f('0x1c'),_0x5c63ad);logger['debug'](_0x453f('0x1c'),_0x5c63ad,JSON['stringify'](_0x344483));_0x3ce80d(_0x344483);})[_0x453f('0x15')](function(_0x3f53aa){logger[_0x453f('0x12')](_0x453f('0x1c'),_0x3f53aa[_0x453f('0x13')],_0x5c63ad);_0x1eae4b(_0x260f9e[_0x453f('0x12')](0x1f4,_0x3f53aa['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index eb9c760..dc93b89 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 _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xcb91[_0x4ae829];return _0x256b31;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0x9f62=['/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','hold','/calls','/transfer','transfer','exports','Router','./webbar.controller','post','/originate','originate'];(function(_0x4a0c62,_0x27b244){var _0x3d8cf0=function(_0x57f803){while(--_0x57f803){_0x4a0c62['push'](_0x4a0c62['shift']());}};_0x3d8cf0(++_0x27b244);}(_0x9f62,0x154));var _0x29f6=function(_0x30a3a6,_0xa67cc5){_0x30a3a6=_0x30a3a6-0x0;var _0x3920b9=_0x9f62[_0x30a3a6];return _0x3920b9;};'use strict';var express=require('express');var router=express[_0x29f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x29f6('0x1'));router[_0x29f6('0x2')](_0x29f6('0x3'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x29f6('0x4')]);router[_0x29f6('0x2')](_0x29f6('0x5'),auth[_0x29f6('0x6')](),auth['isWebrtcLicence'](),controller[_0x29f6('0x7')]);router[_0x29f6('0x2')](_0x29f6('0x8'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router['post']('/unhold',auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['unhold']);router[_0x29f6('0x2')](_0x29f6('0xb'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['calls']);router['post'](_0x29f6('0xc'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 759f9fd..afa4cac 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 _0xb6b1=['hold\x20executed!','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','filter','rows','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','transfer\x20executed!','path','../../mysqldb','util','bluebird','client','../../config/logger','webbarapi','ioredis','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','error','stack','name','status','send','NotFound','request','then','message','result','User','findOne','agent','UserId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','webbar:hangup','hangup\x20executed!','answer\x20fired:','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold'];(function(_0x17141f,_0x4d7c4b){var _0x3ee900=function(_0x5ec0f4){while(--_0x5ec0f4){_0x17141f['push'](_0x17141f['shift']());}};_0x3ee900(++_0x4d7c4b);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xb6b1[_0xbc2974];return _0x3a5b4f;};'use strict';var path=require(_0x1b6b('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x1b6b('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1b6b('0x4')]['http']({'port':0x232a});var logger=require(_0x1b6b('0x5'))(_0x1b6b('0x6'));var Redis=require(_0x1b6b('0x7'));config[_0x1b6b('0x8')]=_['defaults'](config[_0x1b6b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x1b6b('0x9'))(new Redis(config['redis']));var Schema=require(_0x1b6b('0xa'));var originateValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'callNumber':{'type':_0x1b6b('0xd'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x1b6b('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':[!![],_0x1b6b('0xe')]},'transferNumber':{'type':'string','required':[!![],_0x1b6b('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]},'sessionId':{'type':_0x1b6b('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],_0x1b6b('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1b6b('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x1069a4,_0x251821,_0x10af08){logger[_0x1b6b('0x10')](_0x1069a4,_0x251821,JSON['stringify'](_0x10af08));io['to'](_0x1069a4)[_0x1b6b('0x11')](_0x251821,_0x10af08);}function handleError(_0x3dd677){return function(_0x2e608b){console['log'](_0x1b6b('0x12'),_0x2e608b,_0x2e608b instanceof RangeError);logger[_0x1b6b('0x13')](_0x2e608b[_0x1b6b('0x14')]);if(_0x2e608b instanceof RangeError){if(_0x2e608b[_0x1b6b('0x15')]){delete _0x2e608b[_0x1b6b('0x15')];}_0x3dd677[_0x1b6b('0x16')](0x194)[_0x1b6b('0x17')](_0x2e608b);}else{if(_0x2e608b[_0x1b6b('0x15')]){delete _0x2e608b[_0x1b6b('0x15')];}_0x3dd677[_0x1b6b('0x16')](0x1f4)['send'](_0x2e608b);}};}function checkError(){return function(_0x283675){if(!_0x283675){throw new RangeError(_0x1b6b('0x18'));}return _0x283675;};}function respondWithRpcPromise(_0x3b427d,_0xa8cd35){return new BPromise(function(_0x27974f,_0x276713){var _0x3d4ec2=amiClient;return _0x3d4ec2[_0x1b6b('0x19')](_0x3b427d,_0xa8cd35)[_0x1b6b('0x1a')](function(_0x4987ee){if(_0x4987ee[_0x1b6b('0x13')]){if(_0x4987ee['error']['code']===0x1f4){return _0x276713(_0x4987ee['error'][_0x1b6b('0x1b')]);}return _0x27974f(_0x4987ee[_0x1b6b('0x13')]['message']);}else{_0x27974f(_0x4987ee[_0x1b6b('0x1c')]);}})['catch'](function(_0x15dfc7){_0x276713(_0x15dfc7);});});}function getAgent(_0x440658){return db[_0x1b6b('0x1d')][_0x1b6b('0x1e')]({'where':{'id':_0x440658,'role':_0x1b6b('0x1f')}})[_0x1b6b('0x1a')](checkError());}function getAgentCheckSession(_0x5d0a0a,_0xe8b7b5){return new BPromise(function(_0x1bb7f3,_0x173961){var _0x3b33d4=respondWithRpcPromise('VoiceChannels');var _0x23dac4=getAgent(_0x5d0a0a);Promise['all']([_0x3b33d4,_0x23dac4])['then'](function(_0x39b055){var _0x4e9843=_0x39b055[0x0];var _0x165fe8=_0x39b055[0x1];var _0x5c6faa=_['filter'](_0x4e9843['rows'],function(_0x36878c){return _0x36878c[_0x1b6b('0x20')]==_0x165fe8['id']&&_0x36878c['sessionId']==_0xe8b7b5;});if(_0x5c6faa['length']==0x1){_0x1bb7f3(_0x165fe8);}else{_0x173961(new RangeError(_0x1b6b('0x21')+_0xe8b7b5+_0x1b6b('0x22')));}});});}exports[_0x1b6b('0x23')]=function(_0x1bf52c,_0x56f31b){logger[_0x1b6b('0x10')](_0x1b6b('0x24'),_0x1bf52c[_0x1b6b('0x25')]);var _0x34cb27=originateValidation[_0x1b6b('0xa')](_0x1bf52c[_0x1b6b('0x25')]);if(_0x34cb27[_0x1b6b('0x26')]>0x0){return _0x56f31b[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x34cb27);}var _0x517cf7=_0x1bf52c[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x3d6e4d=_0x1bf52c[_0x1b6b('0x25')]['callNumber'];var _0x281350=_0x1bf52c['body'][_0x1b6b('0x29')];var _0x54aade=_0x1bf52c['body'][_0x1b6b('0x2a')];return getAgent(_0x517cf7)[_0x1b6b('0x1a')](function(_0xb658f1){logger['info'](_0x1b6b('0x2b'),_0xb658f1[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0xb658f1[_0x1b6b('0x15')]),_0x1b6b('0x2e'),{'callNumber':_0x3d6e4d,'callerId':_0x281350,'callbackUrl':_0x54aade});return _0x56f31b[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x2f')});})[_0x1b6b('0x30')](handleError(_0x56f31b));};exports[_0x1b6b('0x31')]=function(_0x279022,_0x3fbbb3){logger[_0x1b6b('0x10')]('hangup\x20fired:',_0x279022[_0x1b6b('0x25')]);var _0x47349b=hangupValidation['validate'](_0x279022[_0x1b6b('0x25')]);if(_0x47349b['length']>0x0){return _0x3fbbb3[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x47349b);}var _0x18f725=_0x279022['body'][_0x1b6b('0x28')];var _0x89482a=_0x279022[_0x1b6b('0x25')]['sessionId'];return getAgent(_0x18f725)[_0x1b6b('0x1a')](function(_0x478287){logger[_0x1b6b('0x10')]('entityFound:',_0x478287['name']);emit(util['format'](_0x1b6b('0x2d'),_0x478287[_0x1b6b('0x15')]),_0x1b6b('0x32'),{'sessionId':_0x89482a});return _0x3fbbb3[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x33')});})[_0x1b6b('0x30')](handleError(_0x3fbbb3));};exports['answer']=function(_0x229d9e,_0x165384){logger[_0x1b6b('0x10')](_0x1b6b('0x34'),_0x229d9e[_0x1b6b('0x25')]);var _0x3d8374=answerValidation['validate'](_0x229d9e[_0x1b6b('0x25')]);if(_0x3d8374[_0x1b6b('0x26')]>0x0){return _0x165384[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x3d8374);}var _0x27f41f=_0x229d9e[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x393a56=_0x229d9e[_0x1b6b('0x25')][_0x1b6b('0x35')];return getAgent(_0x27f41f)[_0x1b6b('0x1a')](function(_0x32ee2f){logger['info'](_0x1b6b('0x2b'),_0x32ee2f[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x32ee2f[_0x1b6b('0x15')]),_0x1b6b('0x36'),{'sessionId':_0x393a56});return _0x165384['status'](0xc8)['json']({'error':![],'message':_0x1b6b('0x37')});})['catch'](handleError(_0x165384));};exports[_0x1b6b('0x38')]=function(_0x5bd593,_0x24c009){logger[_0x1b6b('0x10')](_0x1b6b('0x39'),_0x5bd593[_0x1b6b('0x25')]);var _0x53cb3d=holdValidation[_0x1b6b('0xa')](_0x5bd593['body']);if(_0x53cb3d['length']>0x0){return _0x24c009[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x53cb3d);}var _0x151774=_0x5bd593[_0x1b6b('0x25')]['userId'];var _0x45f31b=_0x5bd593['body'][_0x1b6b('0x35')];return getAgent(_0x151774)[_0x1b6b('0x1a')](function(_0x281f19){logger['info'](_0x1b6b('0x2b'),_0x281f19['name']);emit(util[_0x1b6b('0x2c')]('user:%s',_0x281f19[_0x1b6b('0x15')]),_0x1b6b('0x3a'),{'sessionId':_0x45f31b});return _0x24c009[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x3b')});})[_0x1b6b('0x30')](handleError(_0x24c009));};exports['unhold']=function(_0x4c1e02,_0x2be336){logger[_0x1b6b('0x10')]('unhold\x20fired:',_0x4c1e02[_0x1b6b('0x25')]);var _0x459030=unholdValidation[_0x1b6b('0xa')](_0x4c1e02[_0x1b6b('0x25')]);if(_0x459030[_0x1b6b('0x26')]>0x0){return _0x2be336['status'](0x190)[_0x1b6b('0x27')](_0x459030);}var _0x5ed55b=_0x4c1e02[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x295002=_0x4c1e02[_0x1b6b('0x25')][_0x1b6b('0x35')];return getAgent(_0x5ed55b)[_0x1b6b('0x1a')](function(_0x32cde4){logger[_0x1b6b('0x10')](_0x1b6b('0x2b'),_0x32cde4['name']);emit(util['format']('user:%s',_0x32cde4[_0x1b6b('0x15')]),'webbar:unhold',{'sessionId':_0x295002});return _0x2be336['status'](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x3c')});})[_0x1b6b('0x30')](handleError(_0x2be336));};exports[_0x1b6b('0x3d')]=function(_0x527aca,_0x1f549c){logger[_0x1b6b('0x10')](_0x1b6b('0x3e'),_0x1f549c['body']);var _0x4df1e4=callsValidation[_0x1b6b('0xa')](_0x527aca[_0x1b6b('0x25')]);if(_0x4df1e4[_0x1b6b('0x26')]>0x0){return _0x1f549c['status'](0x190)['json'](_0x4df1e4);}var _0x5c3276=_0x527aca['body'][_0x1b6b('0x28')];var _0x13f3d8=respondWithRpcPromise(_0x1b6b('0x3f'));var _0x2de012=getAgent(_0x5c3276);return Promise[_0x1b6b('0x40')]([_0x13f3d8,_0x2de012])[_0x1b6b('0x1a')](function(_0x4be484){var _0x1e16fd=_0x4be484[0x0];var _0x3f80d6=_0x4be484[0x1];var _0x1d87d6=_[_0x1b6b('0x41')](_0x1e16fd[_0x1b6b('0x42')],function(_0x1e3ce2){return _0x1e3ce2['UserId']==_0x3f80d6['id'];});return _0x1f549c[_0x1b6b('0x16')](0xc8)['json']({'count':_0x1d87d6['length'],'rows':_0x1d87d6});})['catch'](handleError(_0x1f549c));};exports[_0x1b6b('0x43')]=function(_0x57228d,_0x593726){logger[_0x1b6b('0x10')](_0x1b6b('0x44'),_0x57228d[_0x1b6b('0x25')]);var _0x3cba4a=conferenceValidation[_0x1b6b('0xa')](_0x57228d[_0x1b6b('0x25')]);if(_0x3cba4a[_0x1b6b('0x26')]>0x0){return _0x593726['status'](0x190)[_0x1b6b('0x27')](_0x3cba4a);}var _0x5e8781=_0x57228d[_0x1b6b('0x25')][_0x1b6b('0x28')];return getAgent(_0x5e8781)[_0x1b6b('0x1a')](function(_0x54fc6b){logger['info'](_0x1b6b('0x2b'),_0x54fc6b[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x54fc6b[_0x1b6b('0x15')]),_0x1b6b('0x45'));return _0x593726[_0x1b6b('0x16')](0xc8)[_0x1b6b('0x27')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x593726));};exports[_0x1b6b('0x46')]=function(_0x1f4752,_0x19b1c6){logger[_0x1b6b('0x10')]('transfer\x20fired:',_0x1f4752[_0x1b6b('0x25')]);var _0x4dac8f=transferValidation[_0x1b6b('0xa')](_0x1f4752[_0x1b6b('0x25')]);if(_0x4dac8f['length']>0x0){return _0x19b1c6[_0x1b6b('0x16')](0x190)[_0x1b6b('0x27')](_0x4dac8f);}var _0x358ea9=_0x1f4752[_0x1b6b('0x25')][_0x1b6b('0x28')];var _0x10bd40=_0x1f4752['body'][_0x1b6b('0x35')];var _0x3fbc4b=_0x1f4752['body'][_0x1b6b('0x47')];return getAgent(_0x358ea9)[_0x1b6b('0x1a')](function(_0x2a816b){logger[_0x1b6b('0x10')](_0x1b6b('0x2b'),_0x2a816b[_0x1b6b('0x15')]);emit(util[_0x1b6b('0x2c')](_0x1b6b('0x2d'),_0x2a816b['name']),'webbar:transfer',{'sessionId':_0x10bd40,'transferNumber':_0x3fbc4b});return _0x19b1c6['status'](0xc8)[_0x1b6b('0x27')]({'error':![],'message':_0x1b6b('0x48')});})[_0x1b6b('0x30')](handleError(_0x19b1c6));}; \ No newline at end of file +var _0x2121=['string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','message','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required'];(function(_0x580d82,_0x384529){var _0x509125=function(_0x4d1e1e){while(--_0x4d1e1e){_0x580d82['push'](_0x580d82['shift']());}};_0x509125(++_0x384529);}(_0x2121,0x1b4));var _0x1212=function(_0x4dceaa,_0x478997){_0x4dceaa=_0x4dceaa-0x0;var _0x120034=_0x2121[_0x4dceaa];return _0x120034;};'use strict';var path=require(_0x1212('0x0'));var fs=require('fs');var _=require(_0x1212('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1212('0x2'));var BPromise=require(_0x1212('0x3'));var jayson=require(_0x1212('0x4'));var amiClient=jayson[_0x1212('0x5')][_0x1212('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x1212('0x7'));var Redis=require('ioredis');config[_0x1212('0x8')]=_[_0x1212('0x9')](config[_0x1212('0x8')],{'host':_0x1212('0xa'),'port':0x18eb});var io=require(_0x1212('0xb'))(new Redis(config[_0x1212('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'callNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0xf')]},'callerId':{'type':_0x1212('0xe')},'callbackUrl':{'type':_0x1212('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x10')]},'transferNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});function emit(_0x5cc246,_0x568870,_0x54ae52){logger[_0x1212('0x12')](_0x5cc246,_0x568870,JSON[_0x1212('0x13')](_0x54ae52));io['to'](_0x5cc246)[_0x1212('0x14')](_0x568870,_0x54ae52);}function handleError(_0x3dd9dd){return function(_0x3cf284){console[_0x1212('0x15')](_0x1212('0x16'),_0x3cf284,_0x3cf284 instanceof RangeError);logger[_0x1212('0x17')](_0x3cf284[_0x1212('0x18')]);if(_0x3cf284 instanceof RangeError){if(_0x3cf284['name']){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x194)[_0x1212('0x1b')](_0x3cf284);}else{if(_0x3cf284[_0x1212('0x19')]){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x1f4)[_0x1212('0x1b')](_0x3cf284);}};}function checkError(){return function(_0x8d4002){if(!_0x8d4002){throw new RangeError('NotFound');}return _0x8d4002;};}function respondWithRpcPromise(_0x38a5e2,_0x3a9664){return new BPromise(function(_0x46d6df,_0x5d15ca){var _0x1571fd=amiClient;return _0x1571fd[_0x1212('0x1c')](_0x38a5e2,_0x3a9664)[_0x1212('0x1d')](function(_0x28c92b){if(_0x28c92b['error']){if(_0x28c92b['error']['code']===0x1f4){return _0x5d15ca(_0x28c92b['error']['message']);}return _0x46d6df(_0x28c92b[_0x1212('0x17')][_0x1212('0x1e')]);}else{_0x46d6df(_0x28c92b['result']);}})[_0x1212('0x1f')](function(_0xa1c850){_0x5d15ca(_0xa1c850);});});}function getAgent(_0x52c7b0){return db[_0x1212('0x20')][_0x1212('0x21')]({'where':{'id':_0x52c7b0,'role':_0x1212('0x22')}})[_0x1212('0x1d')](checkError());}function getAgentCheckSession(_0x3a0ddf,_0x3f6be3){return new BPromise(function(_0x2750b0,_0x2666be){var _0x53aa25=respondWithRpcPromise(_0x1212('0x23'));var _0x7706a0=getAgent(_0x3a0ddf);Promise[_0x1212('0x24')]([_0x53aa25,_0x7706a0])[_0x1212('0x1d')](function(_0x17d0f6){var _0x26446d=_0x17d0f6[0x0];var _0x315f00=_0x17d0f6[0x1];var _0x40b8f6=_[_0x1212('0x25')](_0x26446d[_0x1212('0x26')],function(_0x4b8e34){return _0x4b8e34['UserId']==_0x315f00['id']&&_0x4b8e34[_0x1212('0x27')]==_0x3f6be3;});if(_0x40b8f6['length']==0x1){_0x2750b0(_0x315f00);}else{_0x2666be(new RangeError(_0x1212('0x28')+_0x3f6be3+'\x20not\x20found!'));}});});}exports[_0x1212('0x29')]=function(_0x585bb6,_0x2c9313){logger[_0x1212('0x12')](_0x1212('0x2a'),_0x585bb6[_0x1212('0x2b')]);var _0x4df9d1=originateValidation[_0x1212('0x2c')](_0x585bb6[_0x1212('0x2b')]);if(_0x4df9d1[_0x1212('0x2d')]>0x0){return _0x2c9313[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x4df9d1);}var _0x47c63f=_0x585bb6[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1cf542=_0x585bb6['body'][_0x1212('0x30')];var _0x33309a=_0x585bb6[_0x1212('0x2b')][_0x1212('0x31')];var _0x52c611=_0x585bb6[_0x1212('0x2b')][_0x1212('0x32')];return getAgent(_0x47c63f)['then'](function(_0x405feb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x405feb['name']);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x405feb[_0x1212('0x19')]),'webbar:originate',{'callNumber':_0x1cf542,'callerId':_0x33309a,'callbackUrl':_0x52c611});return _0x2c9313[_0x1212('0x1a')](0xc8)['json']({'error':![],'message':_0x1212('0x36')});})[_0x1212('0x1f')](handleError(_0x2c9313));};exports['hangup']=function(_0x4e5be7,_0x2447c6){logger['info'](_0x1212('0x37'),_0x4e5be7[_0x1212('0x2b')]);var _0x31a69c=hangupValidation[_0x1212('0x2c')](_0x4e5be7[_0x1212('0x2b')]);if(_0x31a69c[_0x1212('0x2d')]>0x0){return _0x2447c6[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x31a69c);}var _0x320a5c=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1bbb84=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x320a5c)[_0x1212('0x1d')](function(_0x42b95a){logger[_0x1212('0x12')](_0x1212('0x33'),_0x42b95a['name']);emit(util[_0x1212('0x34')]('user:%s',_0x42b95a['name']),_0x1212('0x38'),{'sessionId':_0x1bbb84});return _0x2447c6[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x39')});})[_0x1212('0x1f')](handleError(_0x2447c6));};exports['answer']=function(_0x497c20,_0x37391e){logger[_0x1212('0x12')](_0x1212('0x3a'),_0x497c20[_0x1212('0x2b')]);var _0x45fc95=answerValidation[_0x1212('0x2c')](_0x497c20[_0x1212('0x2b')]);if(_0x45fc95[_0x1212('0x2d')]>0x0){return _0x37391e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x45fc95);}var _0x1af6ae=_0x497c20[_0x1212('0x2b')]['userId'];var _0x584d32=_0x497c20[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x1af6ae)['then'](function(_0x1a9c63){logger['info'](_0x1212('0x33'),_0x1a9c63[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1a9c63[_0x1212('0x19')]),'webbar:answer',{'sessionId':_0x584d32});return _0x37391e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x3b')});})['catch'](handleError(_0x37391e));};exports[_0x1212('0x3c')]=function(_0x298538,_0x4b1625){logger[_0x1212('0x12')](_0x1212('0x3d'),_0x298538[_0x1212('0x2b')]);var _0x126df5=holdValidation[_0x1212('0x2c')](_0x298538[_0x1212('0x2b')]);if(_0x126df5['length']>0x0){return _0x4b1625[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x126df5);}var _0x3a4f8c=_0x298538['body']['userId'];var _0xf7d207=_0x298538['body'][_0x1212('0x27')];return getAgent(_0x3a4f8c)['then'](function(_0x50a8ef){logger[_0x1212('0x12')](_0x1212('0x33'),_0x50a8ef['name']);emit(util[_0x1212('0x34')]('user:%s',_0x50a8ef[_0x1212('0x19')]),_0x1212('0x3e'),{'sessionId':_0xf7d207});return _0x4b1625['status'](0xc8)['json']({'error':![],'message':_0x1212('0x3f')});})['catch'](handleError(_0x4b1625));};exports[_0x1212('0x40')]=function(_0x53a46f,_0x20e66f){logger['info'](_0x1212('0x41'),_0x53a46f[_0x1212('0x2b')]);var _0x249066=unholdValidation[_0x1212('0x2c')](_0x53a46f[_0x1212('0x2b')]);if(_0x249066[_0x1212('0x2d')]>0x0){return _0x20e66f['status'](0x190)['json'](_0x249066);}var _0x2a983e=_0x53a46f[_0x1212('0x2b')][_0x1212('0x2f')];var _0x140984=_0x53a46f[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x2a983e)['then'](function(_0x5e3644){logger['info'](_0x1212('0x33'),_0x5e3644[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x5e3644[_0x1212('0x19')]),'webbar:unhold',{'sessionId':_0x140984});return _0x20e66f[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x42')});})[_0x1212('0x1f')](handleError(_0x20e66f));};exports[_0x1212('0x43')]=function(_0x271ecf,_0x4901c1){logger[_0x1212('0x12')](_0x1212('0x44'),_0x4901c1[_0x1212('0x2b')]);var _0x4a86bd=callsValidation[_0x1212('0x2c')](_0x271ecf[_0x1212('0x2b')]);if(_0x4a86bd[_0x1212('0x2d')]>0x0){return _0x4901c1[_0x1212('0x1a')](0x190)['json'](_0x4a86bd);}var _0x27e94b=_0x271ecf[_0x1212('0x2b')][_0x1212('0x2f')];var _0x41e155=respondWithRpcPromise(_0x1212('0x23'));var _0x162fb0=getAgent(_0x27e94b);return Promise['all']([_0x41e155,_0x162fb0])[_0x1212('0x1d')](function(_0x4ee27a){var _0x568935=_0x4ee27a[0x0];var _0x3c940a=_0x4ee27a[0x1];var _0x343e54=_['filter'](_0x568935[_0x1212('0x26')],function(_0x486162){return _0x486162['UserId']==_0x3c940a['id'];});return _0x4901c1['status'](0xc8)['json']({'count':_0x343e54['length'],'rows':_0x343e54});})[_0x1212('0x1f')](handleError(_0x4901c1));};exports[_0x1212('0x45')]=function(_0x467c40,_0x121f00){logger[_0x1212('0x12')](_0x1212('0x46'),_0x467c40[_0x1212('0x2b')]);var _0x41f7be=conferenceValidation[_0x1212('0x2c')](_0x467c40[_0x1212('0x2b')]);if(_0x41f7be[_0x1212('0x2d')]>0x0){return _0x121f00[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x41f7be);}var _0x49c742=_0x467c40[_0x1212('0x2b')]['userId'];return getAgent(_0x49c742)[_0x1212('0x1d')](function(_0x1170cb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x1170cb[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1170cb[_0x1212('0x19')]),'webbar:conference');return _0x121f00[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x47')});})[_0x1212('0x1f')](handleError(_0x121f00));};exports['transfer']=function(_0xa0f4f2,_0x28bb5e){logger['info'](_0x1212('0x48'),_0xa0f4f2[_0x1212('0x2b')]);var _0x519879=transferValidation[_0x1212('0x2c')](_0xa0f4f2[_0x1212('0x2b')]);if(_0x519879[_0x1212('0x2d')]>0x0){return _0x28bb5e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x519879);}var _0x3a9843=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x2f')];var _0x388432=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x27')];var _0x59b660=_0xa0f4f2[_0x1212('0x2b')]['transferNumber'];return getAgent(_0x3a9843)[_0x1212('0x1d')](function(_0x54cca8){logger[_0x1212('0x12')](_0x1212('0x33'),_0x54cca8[_0x1212('0x19')]);emit(util[_0x1212('0x34')]('user:%s',_0x54cca8['name']),_0x1212('0x49'),{'sessionId':_0x388432,'transferNumber':_0x59b660});return _0x28bb5e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x4a')});})['catch'](handleError(_0x28bb5e));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4011176..eb3dd64 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7708=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','../../components/interaction/service'];(function(_0x2294b6,_0x3df3c5){var _0x5e8208=function(_0x5046dd){while(--_0x5046dd){_0x2294b6['push'](_0x2294b6['shift']());}};_0x5e8208(++_0x3df3c5);}(_0x7708,0x188));var _0x8770=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7708[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./whatsappAccount.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['getAnswers']);router[_0x8770('0x5')](_0x8770('0xf'),auth[_0x8770('0x8')](),controller['getAgents']);router[_0x8770('0x5')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0x12')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x13')]);router[_0x8770('0x12')]('/:id/dispositions',auth[_0x8770('0x8')](),controller[_0x8770('0x14')]);router['post'](_0x8770('0xe'),auth['isAuthenticated'](),controller[_0x8770('0x15')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8770('0x16')]);router[_0x8770('0x12')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller['addApplications']);router['post'](_0x8770('0x17'),controller[_0x8770('0x18')]);router[_0x8770('0x12')](_0x8770('0x19'),auth[_0x8770('0x8')](),controller['send']);router[_0x8770('0x1a')](_0x8770('0xa'),auth[_0x8770('0x8')](),controller[_0x8770('0x1b')]);router['delete']('/:id',auth[_0x8770('0x8')](),controller[_0x8770('0x1c')]);router[_0x8770('0x1d')](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x1e')]);router['delete'](_0x8770('0xe'),auth[_0x8770('0x8')](),controller[_0x8770('0x1f')]);router[_0x8770('0x1d')]('/:id/users',auth[_0x8770('0x8')](),controller['removeAgents']);module[_0x8770('0x20')]=router; \ No newline at end of file +var _0x1623=['destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addAgents','/:id/notify','notify','update'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x1623,0xab));var _0x3162=function(_0x1d8699,_0x7377ee){_0x1d8699=_0x1d8699-0x0;var _0xd4b68a=_0x1623[_0x1d8699];return _0xd4b68a;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3162('0xe')]);router[_0x3162('0xb')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0xb')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);router['get'](_0x3162('0x13'),auth['isAuthenticated'](),controller[_0x3162('0x14')]);router[_0x3162('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0x15')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller['addDisposition']);router[_0x3162('0x15')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller['addAnswer']);router[_0x3162('0x15')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x17')]);router[_0x3162('0x15')](_0x3162('0x13'),auth[_0x3162('0x7')](),controller['addApplications']);router[_0x3162('0x15')](_0x3162('0x18'),controller[_0x3162('0x19')]);router[_0x3162('0x15')]('/:id/send',auth[_0x3162('0x7')](),controller['send']);router['put'](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x1a')]);router['delete']('/:id',auth[_0x3162('0x7')](),controller[_0x3162('0x1b')]);router[_0x3162('0x1c')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller[_0x3162('0x1d')]);router[_0x3162('0x1c')](_0x3162('0xf'),auth['isAuthenticated'](),controller[_0x3162('0x1e')]);router[_0x3162('0x1c')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x1f')]);module[_0x3162('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 88985a9..158341b 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 _0xce6e=['BOOLEAN','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','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xce6e,0x16c));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xece6('0x0'));var rs=require(_0xece6('0x1'));module[_0xece6('0x2')]={'name':{'type':Sequelize[_0xece6('0x3')],'unique':_0xece6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xece6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xece6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xece6('0x3')],'defaultValue':function(){return rs[_0xece6('0x5')]();}},'phone':{'type':Sequelize[_0xece6('0x3')]},'type':{'type':Sequelize['ENUM'](_0xece6('0x6'),_0xece6('0x7'))},'accountSid':{'type':Sequelize[_0xece6('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xece6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xece6('0x8')],'defaultValue':function(){return _0xece6('0x9');}},'notificationSound':{'type':Sequelize[_0xece6('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xece6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xece6('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xece6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xece6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xece6('0xb')],'comment':_0xece6('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xece6('0xd'),'set':function(_0x11d897){if(!_0x11d897){this[_0xece6('0xe')](_0xece6('0xf'),null);}this[_0xece6('0xe')](_0xece6('0x10'),_0x11d897);}},'description':{'type':Sequelize[_0xece6('0x3')]}}; \ No newline at end of file +var _0xd640=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xd640,0x1e8));var _0x0d64=function(_0x238469,_0x13fe16){_0x238469=_0x238469-0x0;var _0x5ddc4a=_0xd640[_0x238469];return _0x5ddc4a;};'use strict';var Sequelize=require(_0x0d64('0x0'));var rs=require(_0x0d64('0x1'));module[_0x0d64('0x2')]={'name':{'type':Sequelize[_0x0d64('0x3')],'unique':_0x0d64('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0d64('0x3')],'defaultValue':function(){return rs[_0x0d64('0x5')]();}},'phone':{'type':Sequelize[_0x0d64('0x3')]},'type':{'type':Sequelize[_0x0d64('0x6')](_0x0d64('0x7'),_0x0d64('0x8'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0d64('0x9')],'defaultValue':function(){return _0x0d64('0xa');}},'notificationSound':{'type':Sequelize[_0x0d64('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0d64('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0d64('0xd'),'set':function(_0x102374){if(!_0x102374){this[_0x0d64('0xe')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x0d64('0xf'),_0x102374);}},'description':{'type':Sequelize[_0x0d64('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 7ffe783..35992fd 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 _0x61d2=['MessageSid','from','notifications','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','stringify','set','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','rawAttributes','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','whatsapp:','Body','messageId'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x61d2,0xf6));var _0x261d=function(_0x1d68e4,_0x1a0b66){_0x1d68e4=_0x1d68e4-0x0;var _0x5290f8=_0x61d2[_0x1d68e4];return _0x5290f8;};'use strict';var emlformat=require(_0x261d('0x0'));var rimraf=require(_0x261d('0x1'));var zipdir=require(_0x261d('0x2'));var jsonpatch=require(_0x261d('0x3'));var rp=require(_0x261d('0x4'));var moment=require(_0x261d('0x5'));var BPromise=require(_0x261d('0x6'));var Mustache=require(_0x261d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x261d('0x8'));var csv=require(_0x261d('0x9'));var ejs=require(_0x261d('0xa'));var fs=require('fs');var fs_extra=require(_0x261d('0xb'));var _=require(_0x261d('0xc'));var squel=require('squel');var crypto=require(_0x261d('0xd'));var jsforce=require(_0x261d('0xe'));var deskjs=require(_0x261d('0xf'));var toCsv=require(_0x261d('0x9'));var querystring=require(_0x261d('0x10'));var Papa=require(_0x261d('0x11'));var Redis=require(_0x261d('0x12'));var authService=require(_0x261d('0x13'));var qs=require(_0x261d('0x14'));var as=require(_0x261d('0x15'));var hardwareService=require(_0x261d('0x16'));var logger=require(_0x261d('0x17'))('api');var utils=require(_0x261d('0x18'));var config=require(_0x261d('0x19'));var licenseUtil=require(_0x261d('0x1a'));var db=require('../../mysqldb')['db'];config[_0x261d('0x1b')]=_[_0x261d('0x1c')](config['redis'],{'host':_0x261d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x261d('0x1b')]));require(_0x261d('0x1e'))[_0x261d('0x1f')](socket);var jayson=require(_0x261d('0x20'));var client=jayson[_0x261d('0x21')][_0x261d('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x245155,_0x5d42bf,_0x81dacf,_0x57f896){return new BPromise(function(_0x51834b,_0x28a71a){var _0x4d22ff=_0x57f896||client;return _0x4d22ff[_0x261d('0x23')](_0x245155,_0x81dacf)[_0x261d('0x24')](function(_0x103e75){logger['info'](_0x261d('0x25'),_0x5d42bf,'request\x20sent');logger[_0x261d('0x26')](_0x261d('0x27'),_0x5d42bf,_0x261d('0x28'),JSON['stringify'](_0x103e75));if(_0x103e75['error']){if(_0x103e75[_0x261d('0x29')]['code']===0x1f4){logger[_0x261d('0x29')](_0x261d('0x25'),_0x5d42bf,_0x103e75['error'][_0x261d('0x2a')]);return _0x28a71a(_0x103e75['error'][_0x261d('0x2a')]);}logger['error'](_0x261d('0x25'),_0x5d42bf,_0x103e75[_0x261d('0x29')][_0x261d('0x2a')]);return _0x51834b(_0x103e75[_0x261d('0x29')][_0x261d('0x2a')]);}else{logger[_0x261d('0x2b')](_0x261d('0x25'),_0x5d42bf,_0x261d('0x28'));_0x51834b(_0x103e75[_0x261d('0x2c')][_0x261d('0x2a')]);}})[_0x261d('0x2d')](function(_0x3f209d){logger['error'](_0x261d('0x25'),_0x5d42bf,_0x3f209d);_0x28a71a(_0x3f209d);});});}function respondWithStatusCode(_0x2be6e0,_0x1b0d6b){_0x1b0d6b=_0x1b0d6b||0xcc;return function(_0x2c6f4b){if(_0x2c6f4b){return _0x2be6e0[_0x261d('0x2e')](_0x1b0d6b);}return _0x2be6e0[_0x261d('0x2f')](_0x1b0d6b)['end']();};}function respondWithResult(_0x53d009,_0x3491cb){_0x3491cb=_0x3491cb||0xc8;return function(_0x3d15c8){if(_0x3d15c8){return _0x53d009[_0x261d('0x2f')](_0x3491cb)[_0x261d('0x30')](_0x3d15c8);}};}function respondWithFilteredResult(_0x2b5661,_0x223acf){return function(_0x9a1968){if(_0x9a1968){var _0x1ba2a8=typeof _0x223acf[_0x261d('0x31')]===_0x261d('0x32')&&typeof _0x223acf[_0x261d('0x33')]===_0x261d('0x32');var _0x2616b5=_0x9a1968[_0x261d('0x34')];var _0x30133d=_0x1ba2a8?0x0:_0x223acf[_0x261d('0x31')];var _0x2da7c3=_0x1ba2a8?_0x9a1968['count']:_0x223acf['offset']+_0x223acf[_0x261d('0x33')];var _0x4d51ea;if(_0x2da7c3>=_0x2616b5){_0x2da7c3=_0x2616b5;_0x4d51ea=0xc8;}else{_0x4d51ea=0xce;}_0x2b5661['status'](_0x4d51ea);return _0x2b5661['set']('Content-Range',_0x30133d+'-'+_0x2da7c3+'/'+_0x2616b5)['json'](_0x9a1968);}return null;};}function patchUpdates(_0x2b2474){return function(_0x3dd43c){try{jsonpatch[_0x261d('0x35')](_0x3dd43c,_0x2b2474,!![]);}catch(_0x30039b){return BPromise[_0x261d('0x36')](_0x30039b);}return _0x3dd43c[_0x261d('0x37')]();};}function saveUpdates(_0x1e957a,_0x5f373c){return function(_0x21df6d){if(_0x21df6d){return _0x21df6d[_0x261d('0x38')](_0x1e957a)[_0x261d('0x24')](function(_0x279dd2){return _0x279dd2;});}return null;};}function removeEntity(_0xdd9931,_0x1e459e){return function(_0x35fdf9){if(_0x35fdf9){return _0x35fdf9[_0x261d('0x39')]()['then'](function(){var _0x453e8c=_0x35fdf9[_0x261d('0x3a')]({'plain':!![]});var _0x926fde=_0x261d('0x3b');return db[_0x261d('0x3c')]['destroy']({'where':{'type':_0x926fde,'resourceId':_0x453e8c['id']}})[_0x261d('0x24')](function(){return _0x35fdf9;});})[_0x261d('0x24')](function(){_0xdd9931[_0x261d('0x2f')](0xcc)[_0x261d('0x3d')]();});}};}function handleEntityNotFound(_0x5721ea,_0x4c59c9){return function(_0x1ed11f){if(!_0x1ed11f){_0x5721ea[_0x261d('0x2e')](0x194);}return _0x1ed11f;};}function handleError(_0x24a267,_0x1c40c3){_0x1c40c3=_0x1c40c3||0x1f4;return function(_0x52d48d){logger[_0x261d('0x29')](_0x52d48d['stack']);if(_0x52d48d[_0x261d('0x3e')]){delete _0x52d48d[_0x261d('0x3e')];}_0x24a267['status'](_0x1c40c3)[_0x261d('0x3f')](_0x52d48d);};}exports[_0x261d('0x40')]=function(_0x1e4ef0,_0x530faf){var _0x2df8a4={'include':[{'model':db[_0x261d('0x41')],'as':_0x261d('0x42')}]},_0x14851f={},_0x4abe55={'count':0x0,'rows':[]};var _0x57f2ff=_[_0x261d('0x43')](db[_0x261d('0x44')]['rawAttributes'],function(_0x13942f){return{'name':_0x13942f[_0x261d('0x45')],'type':_0x13942f['type'][_0x261d('0x46')]};});_0x14851f[_0x261d('0x47')]=_['map'](_0x57f2ff,_0x261d('0x3e'));_0x14851f[_0x261d('0x48')]=_['keys'](_0x1e4ef0[_0x261d('0x48')]);_0x14851f[_0x261d('0x49')]=_[_0x261d('0x4a')](_0x14851f[_0x261d('0x47')],_0x14851f['query']);_0x2df8a4[_0x261d('0x4b')]=_[_0x261d('0x4a')](_0x14851f[_0x261d('0x47')],qs[_0x261d('0x4c')](_0x1e4ef0['query'][_0x261d('0x4c')]));_0x2df8a4[_0x261d('0x4b')]=_0x2df8a4[_0x261d('0x4b')][_0x261d('0x4d')]?_0x2df8a4[_0x261d('0x4b')]:_0x14851f[_0x261d('0x47')];if(!_0x1e4ef0['query'][_0x261d('0x4e')](_0x261d('0x4f'))){_0x2df8a4['limit']=qs[_0x261d('0x33')](_0x1e4ef0[_0x261d('0x48')][_0x261d('0x33')]);_0x2df8a4[_0x261d('0x31')]=qs[_0x261d('0x31')](_0x1e4ef0[_0x261d('0x48')][_0x261d('0x31')]);}_0x2df8a4[_0x261d('0x50')]=qs[_0x261d('0x51')](_0x1e4ef0[_0x261d('0x48')][_0x261d('0x51')]);_0x2df8a4[_0x261d('0x52')]=qs['filters'](_[_0x261d('0x53')](_0x1e4ef0[_0x261d('0x48')],_0x14851f['filters']),_0x57f2ff);if(_0x1e4ef0[_0x261d('0x48')][_0x261d('0x54')]){_0x2df8a4[_0x261d('0x52')]=_[_0x261d('0x55')](_0x2df8a4[_0x261d('0x52')],{'$or':_[_0x261d('0x43')](_0x57f2ff,function(_0x20332c){if(_0x20332c[_0x261d('0x56')]!==_0x261d('0x57')){var _0x532819={};_0x532819[_0x20332c['name']]={'$like':'%'+_0x1e4ef0[_0x261d('0x48')]['filter']+'%'};return _0x532819;}})});}_0x2df8a4=_[_0x261d('0x55')]({},_0x2df8a4,_0x1e4ef0[_0x261d('0x58')]);var _0x264d8e={'where':_0x2df8a4[_0x261d('0x52')]};return db[_0x261d('0x44')]['count'](_0x264d8e)['then'](function(_0x5e4acc){_0x4abe55[_0x261d('0x34')]=_0x5e4acc;if(_0x1e4ef0[_0x261d('0x48')][_0x261d('0x59')]){_0x2df8a4[_0x261d('0x5a')]=[{'all':!![]}];}return db[_0x261d('0x44')]['findAll'](_0x2df8a4);})[_0x261d('0x24')](function(_0x4589a0){_0x4abe55[_0x261d('0x5b')]=_0x4589a0;return _0x4abe55;})[_0x261d('0x24')](respondWithFilteredResult(_0x530faf,_0x2df8a4))[_0x261d('0x2d')](handleError(_0x530faf,null));};exports['show']=function(_0x440062,_0x2d6e8e){var _0xef2610={'raw':![],'where':{'id':_0x440062[_0x261d('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x261d('0x42')}]},_0x269487={};_0x269487[_0x261d('0x47')]=_[_0x261d('0x5d')](db['WhatsappAccount']['rawAttributes']);_0x269487[_0x261d('0x48')]=_['keys'](_0x440062[_0x261d('0x48')]);_0x269487['filters']=_[_0x261d('0x4a')](_0x269487['model'],_0x269487[_0x261d('0x48')]);_0xef2610[_0x261d('0x4b')]=_[_0x261d('0x4a')](_0x269487[_0x261d('0x47')],qs[_0x261d('0x4c')](_0x440062['query']['fields']));_0xef2610[_0x261d('0x4b')]=_0xef2610[_0x261d('0x4b')]['length']?_0xef2610[_0x261d('0x4b')]:_0x269487[_0x261d('0x47')];if(_0x440062[_0x261d('0x48')][_0x261d('0x59')]){_0xef2610['include']=[{'all':!![]}];}_0xef2610=_[_0x261d('0x55')]({},_0xef2610,_0x440062['options']);return db['WhatsappAccount']['find'](_0xef2610)[_0x261d('0x24')](handleEntityNotFound(_0x2d6e8e,null))[_0x261d('0x24')](respondWithResult(_0x2d6e8e,null))[_0x261d('0x2d')](handleError(_0x2d6e8e,null));};exports[_0x261d('0x5e')]=function(_0x57c950,_0x403306){return db[_0x261d('0x44')][_0x261d('0x5e')](_0x57c950[_0x261d('0x5f')],{})[_0x261d('0x24')](function(_0x1bc15d){var _0x38f2fb=_0x57c950[_0x261d('0x60')][_0x261d('0x3a')]({'plain':!![]});if(!_0x38f2fb)throw new Error(_0x261d('0x61'));if(_0x38f2fb[_0x261d('0x62')]==='user'){var _0x4b1df6=_0x1bc15d['get']({'plain':!![]});var _0x1c195c=_0x261d('0x3b');return db[_0x261d('0x63')][_0x261d('0x64')]({'where':{'name':_0x1c195c,'userProfileId':_0x38f2fb[_0x261d('0x65')]},'raw':!![]})[_0x261d('0x24')](function(_0x1496f3){if(_0x1496f3&&_0x1496f3[_0x261d('0x66')]===0x0){return db[_0x261d('0x3c')][_0x261d('0x5e')]({'name':_0x4b1df6[_0x261d('0x3e')],'resourceId':_0x4b1df6['id'],'type':_0x1496f3[_0x261d('0x3e')],'sectionId':_0x1496f3['id']},{})[_0x261d('0x24')](function(){return _0x1bc15d;});}else{return _0x1bc15d;}})[_0x261d('0x2d')](function(_0x11bd70){logger[_0x261d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11bd70);throw _0x11bd70;});}return _0x1bc15d;})[_0x261d('0x24')](respondWithResult(_0x403306,0xc9))['catch'](handleError(_0x403306,null));};exports[_0x261d('0x38')]=function(_0x4c4db3,_0x40d54a){if(_0x4c4db3[_0x261d('0x5f')]['id']){delete _0x4c4db3['body']['id'];}return db[_0x261d('0x44')][_0x261d('0x64')]({'where':{'id':_0x4c4db3['params']['id']},'include':[{'model':db['Pause'],'as':_0x261d('0x42')}]})['then'](handleEntityNotFound(_0x40d54a,null))[_0x261d('0x24')](saveUpdates(_0x4c4db3[_0x261d('0x5f')],null))[_0x261d('0x24')](respondWithResult(_0x40d54a,null))[_0x261d('0x2d')](handleError(_0x40d54a,null));};exports[_0x261d('0x39')]=function(_0xba19b6,_0x419101){return db[_0x261d('0x44')][_0x261d('0x64')]({'where':{'id':_0xba19b6[_0x261d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x419101,null))[_0x261d('0x24')](removeEntity(_0x419101,null))['catch'](handleError(_0x419101,null));};exports[_0x261d('0x67')]=function(_0x4f53cd,_0x434a58){return db[_0x261d('0x44')][_0x261d('0x67')]()[_0x261d('0x24')](respondWithResult(_0x434a58,null))[_0x261d('0x2d')](handleError(_0x434a58,null));};exports[_0x261d('0x68')]=function(_0x5911b4,_0x15edab,_0x2dd394){if(_0x5911b4[_0x261d('0x5f')]['id']){delete _0x5911b4[_0x261d('0x5f')]['id'];}return db[_0x261d('0x44')][_0x261d('0x64')]({'where':{'id':_0x5911b4[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x15edab,null))['then'](function(_0x262eac){if(_0x262eac){_0x5911b4[_0x261d('0x5f')][_0x261d('0x69')]=_0x262eac['id'];return db['Disposition']['create'](_0x5911b4['body']);}})[_0x261d('0x24')](respondWithResult(_0x15edab,null))[_0x261d('0x2d')](handleError(_0x15edab,null));};exports[_0x261d('0x6a')]=function(_0x46fbc2,_0x29d2f9,_0x4c63b1){var _0x3a1b54={'raw':![],'where':{}};var _0xa42ed3={};var _0x42ab39={'count':0x0,'rows':[]};return db[_0x261d('0x44')][_0x261d('0x6b')]({'where':{'id':_0x46fbc2[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x29d2f9,null))['then'](function(_0x102378){if(_0x102378){_0xa42ed3['model']=_[_0x261d('0x5d')](db['Disposition'][_0x261d('0x6c')]);_0xa42ed3[_0x261d('0x48')]=_[_0x261d('0x5d')](_0x46fbc2[_0x261d('0x48')]);_0xa42ed3['filters']=_[_0x261d('0x4a')](_0xa42ed3['model'],_0xa42ed3[_0x261d('0x48')]);_0x3a1b54['attributes']=_[_0x261d('0x4a')](_0xa42ed3[_0x261d('0x47')],qs[_0x261d('0x4c')](_0x46fbc2['query'][_0x261d('0x4c')]));_0x3a1b54[_0x261d('0x4b')]=_0x3a1b54[_0x261d('0x4b')][_0x261d('0x4d')]?_0x3a1b54[_0x261d('0x4b')]:_0xa42ed3[_0x261d('0x47')];if(!_0x46fbc2[_0x261d('0x48')][_0x261d('0x4e')](_0x261d('0x4f'))){_0x3a1b54['limit']=qs[_0x261d('0x33')](_0x46fbc2[_0x261d('0x48')][_0x261d('0x33')]);_0x3a1b54[_0x261d('0x31')]=qs[_0x261d('0x31')](_0x46fbc2['query']['offset']);}_0x3a1b54[_0x261d('0x50')]=qs[_0x261d('0x51')](_0x46fbc2[_0x261d('0x48')][_0x261d('0x51')]);_0x3a1b54[_0x261d('0x52')]=qs[_0x261d('0x49')](_[_0x261d('0x53')](_0x46fbc2['query'],_0xa42ed3[_0x261d('0x49')]));_0x3a1b54[_0x261d('0x52')][_0x261d('0x69')]=_0x102378['id'];if(_0x46fbc2[_0x261d('0x48')][_0x261d('0x54')]){_0x3a1b54[_0x261d('0x52')]=_[_0x261d('0x55')](_0x3a1b54[_0x261d('0x52')],{'$or':_[_0x261d('0x43')](_0x3a1b54[_0x261d('0x4b')],function(_0x5406d8){var _0x408d3f={};_0x408d3f[_0x5406d8]={'$like':'%'+_0x46fbc2[_0x261d('0x48')][_0x261d('0x54')]+'%'};return _0x408d3f;})});}_0x3a1b54=_['merge']({},_0x3a1b54,_0x46fbc2[_0x261d('0x58')]);return db[_0x261d('0x6d')][_0x261d('0x34')]({'where':_0x3a1b54[_0x261d('0x52')]})['then'](function(_0xb72beb){_0x42ab39['count']=_0xb72beb;if(_0x46fbc2[_0x261d('0x48')][_0x261d('0x59')]){_0x3a1b54[_0x261d('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x261d('0x6e')](_0x3a1b54);})[_0x261d('0x24')](function(_0x4445b1){_0x42ab39[_0x261d('0x5b')]=_0x4445b1;return _0x42ab39;});}})[_0x261d('0x24')](respondWithFilteredResult(_0x29d2f9,_0x3a1b54))['catch'](handleError(_0x29d2f9,null));};exports['removeDispositions']=function(_0x3d4cdd,_0x14aee8,_0x5002af){return db['WhatsappAccount']['find']({'where':{'id':_0x3d4cdd[_0x261d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x14aee8,null))[_0x261d('0x24')](function(_0x1b9931){if(_0x1b9931){return _0x1b9931[_0x261d('0x6f')](_0x3d4cdd['query']['ids']);}})['then'](respondWithStatusCode(_0x14aee8,null))[_0x261d('0x2d')](handleError(_0x14aee8,null));};exports[_0x261d('0x70')]=function(_0x105475,_0xc25dc3,_0x3f9660){if(_0x105475['body']['id']){delete _0x105475[_0x261d('0x5f')]['id'];}return db[_0x261d('0x44')][_0x261d('0x64')]({'where':{'id':_0x105475[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0xc25dc3,null))[_0x261d('0x24')](function(_0x24f036){if(_0x24f036){_0x105475[_0x261d('0x5f')]['WhatsappAccountId']=_0x24f036['id'];return db[_0x261d('0x71')][_0x261d('0x5e')](_0x105475[_0x261d('0x5f')]);}})[_0x261d('0x24')](respondWithResult(_0xc25dc3,null))[_0x261d('0x2d')](handleError(_0xc25dc3,null));};exports['getAnswers']=function(_0x525148,_0x32d5be,_0x4f55b7){var _0x4fa461={'raw':![],'where':{}};var _0x5b8b48={};var _0x10f854={'count':0x0,'rows':[]};return db[_0x261d('0x44')][_0x261d('0x6b')]({'where':{'id':_0x525148[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x32d5be,null))[_0x261d('0x24')](function(_0x18843f){if(_0x18843f){_0x5b8b48['model']=_[_0x261d('0x5d')](db[_0x261d('0x71')][_0x261d('0x6c')]);_0x5b8b48[_0x261d('0x48')]=_['keys'](_0x525148[_0x261d('0x48')]);_0x5b8b48[_0x261d('0x49')]=_[_0x261d('0x4a')](_0x5b8b48[_0x261d('0x47')],_0x5b8b48[_0x261d('0x48')]);_0x4fa461[_0x261d('0x4b')]=_[_0x261d('0x4a')](_0x5b8b48[_0x261d('0x47')],qs['fields'](_0x525148[_0x261d('0x48')][_0x261d('0x4c')]));_0x4fa461[_0x261d('0x4b')]=_0x4fa461[_0x261d('0x4b')][_0x261d('0x4d')]?_0x4fa461[_0x261d('0x4b')]:_0x5b8b48['model'];if(!_0x525148['query'][_0x261d('0x4e')](_0x261d('0x4f'))){_0x4fa461[_0x261d('0x33')]=qs[_0x261d('0x33')](_0x525148[_0x261d('0x48')][_0x261d('0x33')]);_0x4fa461[_0x261d('0x31')]=qs[_0x261d('0x31')](_0x525148[_0x261d('0x48')]['offset']);}_0x4fa461['order']=qs['sort'](_0x525148[_0x261d('0x48')][_0x261d('0x51')]);_0x4fa461['where']=qs[_0x261d('0x49')](_[_0x261d('0x53')](_0x525148[_0x261d('0x48')],_0x5b8b48[_0x261d('0x49')]));_0x4fa461[_0x261d('0x52')][_0x261d('0x69')]=_0x18843f['id'];if(_0x525148[_0x261d('0x48')][_0x261d('0x54')]){_0x4fa461['where']=_[_0x261d('0x55')](_0x4fa461['where'],{'$or':_[_0x261d('0x43')](_0x4fa461[_0x261d('0x4b')],function(_0x3a5213){var _0x53f12d={};_0x53f12d[_0x3a5213]={'$like':'%'+_0x525148[_0x261d('0x48')][_0x261d('0x54')]+'%'};return _0x53f12d;})});}_0x4fa461=_['merge']({},_0x4fa461,_0x525148['options']);return db[_0x261d('0x71')][_0x261d('0x34')]({'where':_0x4fa461[_0x261d('0x52')]})['then'](function(_0x349851){_0x10f854[_0x261d('0x34')]=_0x349851;if(_0x525148[_0x261d('0x48')][_0x261d('0x59')]){_0x4fa461[_0x261d('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x261d('0x6e')](_0x4fa461);})[_0x261d('0x24')](function(_0xd5dc4d){_0x10f854[_0x261d('0x5b')]=_0xd5dc4d;return _0x10f854;});}})[_0x261d('0x24')](respondWithFilteredResult(_0x32d5be,_0x4fa461))[_0x261d('0x2d')](handleError(_0x32d5be,null));};exports[_0x261d('0x72')]=function(_0x196230,_0x5c662f,_0x1f74b9){return db[_0x261d('0x44')][_0x261d('0x64')]({'where':{'id':_0x196230[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x5c662f,null))[_0x261d('0x24')](function(_0x2907ef){if(_0x2907ef){return _0x2907ef[_0x261d('0x72')](_0x196230[_0x261d('0x48')][_0x261d('0x73')]);}})[_0x261d('0x24')](respondWithStatusCode(_0x5c662f,null))[_0x261d('0x2d')](handleError(_0x5c662f,null));};exports[_0x261d('0x74')]=function(_0x309665,_0x246e99,_0x438b53){return db[_0x261d('0x44')]['find']({'where':{'id':_0x309665[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x246e99,null))[_0x261d('0x24')](function(_0x6b74f7){if(_0x6b74f7){return _0x6b74f7['addAgents'](_0x309665[_0x261d('0x5f')][_0x261d('0x73')],_[_0x261d('0x75')](_0x309665[_0x261d('0x5f')],[_0x261d('0x73'),'id'])||{})[_0x261d('0x76')](function(_0x3a3c23){for(var _0x535681=0x0;_0x535681<_0x309665['body'][_0x261d('0x73')]['length'];_0x535681+=0x1){socket[_0x261d('0x77')](_0x261d('0x78'),{'UserId':Number(_0x309665[_0x261d('0x5f')][_0x261d('0x73')][_0x535681]),'WhatsappAccountId':Number(_0x309665[_0x261d('0x5c')]['id'])});}return _0x3a3c23;});}})['then'](respondWithResult(_0x246e99,null))[_0x261d('0x2d')](handleError(_0x246e99,null));};exports[_0x261d('0x79')]=function(_0x4b33d3,_0x2d3246,_0x23bda3){return db['WhatsappAccount'][_0x261d('0x64')]({'where':{'id':_0x4b33d3[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x2d3246,null))[_0x261d('0x24')](function(_0x5e69e){if(_0x5e69e){return _0x5e69e['removeAgents'](_0x4b33d3[_0x261d('0x48')][_0x261d('0x73')])['then'](function(){if(_[_0x261d('0x7a')](_0x4b33d3[_0x261d('0x48')]['ids'])){for(var _0x5a2e4e=0x0;_0x5a2e4e<_0x4b33d3[_0x261d('0x48')][_0x261d('0x73')][_0x261d('0x4d')];_0x5a2e4e+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x4b33d3[_0x261d('0x48')][_0x261d('0x73')][_0x5a2e4e]),'WhatsappAccountId':Number(_0x4b33d3['params']['id'])});}}else{socket[_0x261d('0x77')](_0x261d('0x7b'),{'UserId':Number(_0x4b33d3[_0x261d('0x48')][_0x261d('0x73')]),'WhatsappAccountId':Number(_0x4b33d3[_0x261d('0x5c')]['id'])});}});}})[_0x261d('0x24')](respondWithStatusCode(_0x2d3246,null))[_0x261d('0x2d')](handleError(_0x2d3246,null));};exports[_0x261d('0x7c')]=function(_0x4f633e,_0x3b5370,_0x1d4496){var _0x146893={};var _0x118535={};var _0x51b501;var _0x2ccf6c;return db['WhatsappAccount'][_0x261d('0x6b')]({'where':{'id':_0x4f633e[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x3b5370,null))[_0x261d('0x24')](function(_0x61997){if(_0x61997){_0x51b501=_0x61997;_0x118535[_0x261d('0x47')]=_[_0x261d('0x5d')](db['User'][_0x261d('0x6c')]);_0x118535[_0x261d('0x48')]=_[_0x261d('0x5d')](_0x4f633e[_0x261d('0x48')]);_0x118535['filters']=_['intersection'](_0x118535[_0x261d('0x47')],_0x118535[_0x261d('0x48')]);_0x146893['attributes']=_['intersection'](_0x118535[_0x261d('0x47')],qs[_0x261d('0x4c')](_0x4f633e[_0x261d('0x48')][_0x261d('0x4c')]));_0x146893[_0x261d('0x4b')]=_0x146893['attributes'][_0x261d('0x4d')]?_0x146893[_0x261d('0x4b')]:_0x118535['model'];_0x146893['order']=qs[_0x261d('0x51')](_0x4f633e['query'][_0x261d('0x51')]);_0x146893['where']=qs['filters'](_[_0x261d('0x53')](_0x4f633e[_0x261d('0x48')],_0x118535[_0x261d('0x49')]));if(_0x4f633e[_0x261d('0x48')][_0x261d('0x54')]){_0x146893[_0x261d('0x52')]=_[_0x261d('0x55')](_0x146893[_0x261d('0x52')],{'$or':_[_0x261d('0x43')](_0x146893['attributes'],function(_0x581dd0){var _0x513961={};_0x513961[_0x581dd0]={'$like':'%'+_0x4f633e['query'][_0x261d('0x54')]+'%'};return _0x513961;})});}_0x146893=_['merge']({},_0x146893,_0x4f633e[_0x261d('0x58')]);return _0x51b501[_0x261d('0x7c')](_0x146893);}})['then'](function(_0x140c78){if(_0x140c78){_0x2ccf6c=_0x140c78[_0x261d('0x4d')];if(!_0x4f633e['query'][_0x261d('0x4e')](_0x261d('0x4f'))){_0x146893['limit']=qs[_0x261d('0x33')](_0x4f633e[_0x261d('0x48')][_0x261d('0x33')]);_0x146893['offset']=qs[_0x261d('0x31')](_0x4f633e[_0x261d('0x48')][_0x261d('0x31')]);}return _0x51b501['getAgents'](_0x146893);}})[_0x261d('0x24')](function(_0x324023){if(_0x324023){return _0x324023?{'count':_0x2ccf6c,'rows':_0x324023}:null;}})[_0x261d('0x24')](respondWithResult(_0x3b5370,null))[_0x261d('0x2d')](handleError(_0x3b5370,null));};exports[_0x261d('0x7d')]=function(_0x21edea,_0x36242e){var _0x4aa45c=_0x21edea[_0x261d('0x5c')]['id'];var _0x320e59=_0x21edea[_0x261d('0x5f')];var _0x47e434=0xc8;var _0x3bce0f=null;return db[_0x261d('0x7e')][_0x261d('0x7f')]({'isolationLevel':db[_0x261d('0x7e')][_0x261d('0x80')][_0x261d('0x81')][_0x261d('0x82')]},function(_0x13f7e9){return db['WhatsappAccount'][_0x261d('0x6b')]({'where':{'id':_0x4aa45c},'transaction':_0x13f7e9})[_0x261d('0x24')](function(_0x1b123a){if(_0x1b123a){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4aa45c},'transaction':_0x13f7e9})[_0x261d('0x24')](function(){var _0x107367=_[_0x261d('0x43')](_0x320e59,function(_0x119b11){_0x119b11[_0x261d('0x69')]=_0x4aa45c;return _0x119b11;});return db[_0x261d('0x83')][_0x261d('0x84')](_0x107367,{'transaction':_0x13f7e9});});}else{_0x47e434=0x194;_0x3bce0f=[];}});})[_0x261d('0x24')](function(){if(_0x47e434!==0x194){return db[_0x261d('0x83')][_0x261d('0x85')]({'where':{'WhatsappAccountId':_0x4aa45c},'order':_0x261d('0x86')})['then'](function(_0x322c66){_0x3bce0f=_0x322c66;});}})[_0x261d('0x2d')](function(_0x286165){_0x47e434=0x1f4;logger[_0x261d('0x29')](_0x286165[_0x261d('0x87')]);if(_0x286165[_0x261d('0x3e')]){delete _0x286165[_0x261d('0x3e')];}_0x3bce0f=_0x286165;})[_0x261d('0x88')](function(){if(_0x3bce0f===null){_0x36242e[_0x261d('0x2e')](_0x47e434);}else{if(_0x47e434===0x1f4){_0x36242e[_0x261d('0x2f')](_0x47e434)[_0x261d('0x3f')](_0x3bce0f);}else{_0x36242e[_0x261d('0x2f')](_0x47e434)[_0x261d('0x30')](_0x3bce0f);}}});};exports[_0x261d('0x89')]=function(_0x29017b,_0x4e8002,_0x521b56){var _0x57b5c9={};var _0x4f68d5={};var _0x3bde14;var _0x50959e;return db[_0x261d('0x44')][_0x261d('0x6b')]({'where':{'id':_0x29017b[_0x261d('0x5c')]['id']}})[_0x261d('0x24')](handleEntityNotFound(_0x4e8002,null))['then'](function(_0x5773dc){if(_0x5773dc){_0x3bde14=_0x5773dc;_0x4f68d5[_0x261d('0x47')]=_['keys'](db[_0x261d('0x83')][_0x261d('0x6c')]);_0x4f68d5[_0x261d('0x48')]=_[_0x261d('0x5d')](_0x29017b['query']);_0x4f68d5[_0x261d('0x49')]=_[_0x261d('0x4a')](_0x4f68d5[_0x261d('0x47')],_0x4f68d5[_0x261d('0x48')]);_0x57b5c9[_0x261d('0x4b')]=_[_0x261d('0x4a')](_0x4f68d5[_0x261d('0x47')],qs[_0x261d('0x4c')](_0x29017b[_0x261d('0x48')][_0x261d('0x4c')]));_0x57b5c9['attributes']=_0x57b5c9[_0x261d('0x4b')][_0x261d('0x4d')]?_0x57b5c9['attributes']:_0x4f68d5['model'];_0x57b5c9[_0x261d('0x50')]=qs[_0x261d('0x51')](_0x29017b[_0x261d('0x48')][_0x261d('0x51')]);_0x57b5c9[_0x261d('0x52')]=qs[_0x261d('0x49')](_[_0x261d('0x53')](_0x29017b[_0x261d('0x48')],_0x4f68d5[_0x261d('0x49')]));if(_0x29017b[_0x261d('0x48')]['filter']){_0x57b5c9[_0x261d('0x52')]=_[_0x261d('0x55')](_0x57b5c9[_0x261d('0x52')],{'$or':_[_0x261d('0x43')](_0x57b5c9[_0x261d('0x4b')],function(_0x5e52ba){var _0x14e003={};_0x14e003[_0x5e52ba]={'$like':'%'+_0x29017b[_0x261d('0x48')][_0x261d('0x54')]+'%'};return _0x14e003;})});}_0x57b5c9=_['merge']({},_0x57b5c9,_0x29017b[_0x261d('0x58')]);return _0x3bde14[_0x261d('0x89')](_0x57b5c9);}})[_0x261d('0x24')](function(_0x4723cf){if(_0x4723cf){_0x50959e=_0x4723cf[_0x261d('0x4d')];if(!_0x29017b[_0x261d('0x48')][_0x261d('0x4e')](_0x261d('0x4f'))){_0x57b5c9[_0x261d('0x33')]=qs[_0x261d('0x33')](_0x29017b[_0x261d('0x48')]['limit']);_0x57b5c9['offset']=qs[_0x261d('0x31')](_0x29017b[_0x261d('0x48')][_0x261d('0x31')]);}return _0x3bde14[_0x261d('0x89')](_0x57b5c9);}})['then'](function(_0x11177c){if(_0x11177c){return _0x11177c?{'count':_0x50959e,'rows':_0x11177c}:null;}})['then'](respondWithResult(_0x4e8002,null))[_0x261d('0x2d')](handleError(_0x4e8002,null));};exports[_0x261d('0x8a')]=function(_0x3dbada,_0x442dc7,_0x25ad3b){var _0x540f80={'channel':_0x261d('0x8b')};var _0x275f49=[];var _0x2c5dfc=[];var _0x55c7dd={};return db['WhatsappAccount'][_0x261d('0x64')]({'where':{'id':_0x3dbada[_0x261d('0x5c')]['id']},'include':[{'model':db[_0x261d('0x83')],'as':'Applications'}]})[_0x261d('0x24')](handleEntityNotFound(_0x442dc7,null))[_0x261d('0x24')](function(_0x4ae78f){_0x540f80[_0x261d('0x8c')]=_0x4ae78f;if(_0x540f80[_0x261d('0x8c')]&&_0x540f80['account'][_0x261d('0x56')]===_0x261d('0x8d')&&_0x3dbada[_0x261d('0x5f')][_0x261d('0x8e')]){if(_0x3dbada[_0x261d('0x5f')][_0x261d('0x8e')][_0x261d('0x4d')]===0x0)return;if(_0x3dbada[_0x261d('0x5f')]['statuses'][0x0]['state']!==_0x261d('0x8f'))return;return db[_0x261d('0x90')]['update']({'read':!![],'readAt':_0x3dbada[_0x261d('0x5f')][_0x261d('0x8e')][0x0][_0x261d('0x91')]},{'where':{'messageId':_0x3dbada[_0x261d('0x5f')][_0x261d('0x8e')][0x0][_0x261d('0x92')]},'individualHooks':!![]})[_0x261d('0x24')](function(_0x73c7b7){return _0x442dc7[_0x261d('0x2f')](0xc8)[_0x261d('0x30')](_0x73c7b7);});}_0x540f80[_0x261d('0x93')]=_[_0x261d('0x94')](_0x4ae78f['Applications'],['priority'],['asc']);if(_0x540f80[_0x261d('0x8c')][_0x261d('0x95')]){delete _0x540f80[_0x261d('0x8c')][_0x261d('0x95')];}return db[_0x261d('0x96')][_0x261d('0x67')]()[_0x261d('0x24')](function(_0x194cb8){if(!_0x194cb8){throw new db[(_0x261d('0x97'))]['ValidationError'](_0x261d('0x98'));}_0x275f49=_[_0x261d('0x99')](_[_0x261d('0x5d')](_0x194cb8),[_0x261d('0x9a'),_0x261d('0x9b')]);_0x2c5dfc=_[_0x261d('0x99')](_[_0x261d('0x5d')](_0x194cb8),['createdAt',_0x261d('0x9b'),_0x261d('0x9c'),_0x261d('0x9d')]);_0x540f80[_0x261d('0x5f')]={'mapKey':_0x261d('0x9e')};if(_0x540f80[_0x261d('0x8c')]&&_0x540f80[_0x261d('0x8c')][_0x261d('0x56')]===_0x261d('0x9f')){_0x540f80[_0x261d('0x5f')]['from']=_0x3dbada[_0x261d('0x5f')][_0x261d('0xa0')]['replace'](_0x261d('0xa1'),'');_0x540f80[_0x261d('0x5f')][_0x261d('0x5f')]=_0x3dbada['body'][_0x261d('0xa2')];_0x540f80[_0x261d('0x5f')][_0x261d('0xa3')]=_0x3dbada[_0x261d('0x5f')][_0x261d('0xa4')];}if(_0x540f80['account']&&_0x540f80['account']['type']===_0x261d('0x8d')){_0x540f80[_0x261d('0x5f')][_0x261d('0xa5')]=_0x3dbada[_0x261d('0x5f')][_0x261d('0xa6')][0x0]['from'];_0x540f80['body'][_0x261d('0x5f')]=_0x3dbada[_0x261d('0x5f')][_0x261d('0xa6')][0x0][_0x261d('0x2a')][_0x261d('0x5f')];_0x540f80[_0x261d('0x5f')][_0x261d('0xa3')]=_0x3dbada[_0x261d('0x5f')][_0x261d('0xa6')][0x0][_0x261d('0x92')];}if(_0x540f80['body']['id']){delete _0x540f80[_0x261d('0x5f')]['id'];}if(_[_0x261d('0xa7')](_0x540f80[_0x261d('0x5f')][_0x261d('0xa5')])){throw new db[(_0x261d('0x97'))][(_0x261d('0xa8'))](_0x261d('0xa9'));}if(_[_0x261d('0xa7')](_0x540f80[_0x261d('0x5f')]['body'])||_0x540f80[_0x261d('0x5f')][_0x261d('0x5f')]===''){throw new db[(_0x261d('0x97'))]['ValidationError'](_0x261d('0xaa'));}if(_['isNil'](_0x540f80[_0x261d('0x5f')][_0x261d('0xab')])){throw new db[(_0x261d('0x97'))][(_0x261d('0xa8'))](_0x261d('0xac')+_0x2c5dfc);}if(!_[_0x261d('0xad')](_0x2c5dfc,_0x540f80[_0x261d('0x5f')][_0x261d('0xab')])){throw new db[(_0x261d('0x97'))][(_0x261d('0xa8'))](_0x261d('0xae')+_0x2c5dfc);}_0x55c7dd[_0x540f80[_0x261d('0x5f')][_0x261d('0xab')]]=_0x540f80[_0x261d('0x5f')]['from'];return db[_0x261d('0xaf')]['find']({'where':{'id':_0x540f80[_0x261d('0x8c')][_0x261d('0x9d')]},'include':[{'model':db[_0x261d('0x96')],'as':_0x261d('0xb0'),'where':_0x55c7dd,'limit':0x1,'order':[[_0x261d('0x9b'),_0x261d('0xb1')]]}]});})[_0x261d('0x24')](handleEntityNotFound(_0x442dc7,null))['then'](function(_0x3089ce){if(_0x3089ce){_0x540f80[_0x261d('0xb2')]=_[_0x261d('0x75')](_0x3089ce,['Contacts']);if(_0x3089ce[_0x261d('0xb0')][_0x261d('0x4d')]){return _0x3089ce['Contacts'][0x0];}var _0x1c9d31=_[_0x261d('0x1c')](_0x540f80[_0x261d('0x5f')],{'firstName':_0x540f80['body'][_0x261d('0xa5')],'ListId':_0x3089ce['id']});_0x1c9d31[_0x540f80[_0x261d('0x5f')]['mapKey']]=_0x540f80[_0x261d('0x5f')][_0x261d('0xa5')];return db['CmContact']['create'](_0x1c9d31,{'fields':_0x275f49,'raw':!![]});}})[_0x261d('0x24')](handleEntityNotFound(_0x442dc7,null))[_0x261d('0x24')](function(_0x526edf){if(_0x526edf){_0x540f80[_0x261d('0xb3')]=_0x526edf;var _0x3d6b65={'ContactId':_0x526edf['id'],'phone':_0x540f80[_0x261d('0x5f')]['from'],'WhatsappAccountId':_0x3dbada[_0x261d('0x5c')]['id']};var _0x5e8fb0={'ContactId':_0x526edf['id'],'WhatsappAccountId':_0x3dbada[_0x261d('0x5c')]['id'],'closed':![]};return db[_0x261d('0xb4')]['find']({'where':_0x5e8fb0})['then'](function(_0x12d8c4){if(_0x12d8c4){return[_0x12d8c4,![]];}return db['WhatsappInteraction'][_0x261d('0x5e')](_0x3d6b65)[_0x261d('0x24')](function(_0x300f46){return[_0x300f46,!![]];});});}})[_0x261d('0x76')](function(_0x9c4ff9,_0x179b08){_0x540f80[_0x261d('0xb5')]=_0x9c4ff9[_0x261d('0x3a')]({'plain':!![]});_0x540f80[_0x261d('0xb5')][_0x261d('0xb6')]=![];if(_0x179b08){if(_0x540f80[_0x261d('0x8c')][_0x261d('0xb7')]){_0x540f80[_0x261d('0x93')][_0x261d('0xb8')]({'id':0x0,'priority':_0x540f80[_0x261d('0x93')]['length']+0x1,'app':_0x261d('0xb9'),'appdata':_0x261d('0xba'),'interval':'*,*,*,*'});}_0x540f80[_0x261d('0xb5')][_0x261d('0xb6')]=!![];}return db[_0x261d('0x90')][_0x261d('0x5e')]({'phone':_0x540f80['body'][_0x261d('0xa5')],'messageId':_0x540f80[_0x261d('0x5f')][_0x261d('0xa3')],'body':_0x540f80[_0x261d('0x5f')][_0x261d('0x5f')],'WhatsappAccountId':_0x3dbada[_0x261d('0x5c')]['id'],'WhatsappInteractionId':_0x9c4ff9['id'],'direction':'in','ContactId':_0x9c4ff9[_0x261d('0xbb')],'AttachmentId':_0x540f80[_0x261d('0x5f')][_0x261d('0xbc')]});})[_0x261d('0x24')](function(_0x1ca4dc){_0x540f80[_0x261d('0x2a')]=_0x1ca4dc;if(_0x540f80[_0x261d('0xb5')]['UserId']){return db['User'][_0x261d('0x64')]({'attributes':['id',_0x261d('0x3e')],'where':{'id':_0x540f80[_0x261d('0xb5')][_0x261d('0xbd')]}})['then'](function(_0x3c2cac){if(_0x3c2cac){_0x540f80[_0x261d('0x93')][_0x261d('0xbe')]({'id':0x0,'priority':0x0,'app':_0x261d('0xbf'),'appdata':_0x3c2cac[_0x261d('0x3e')]+','+(_0x540f80[_0x261d('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':_0x261d('0xc0')});}return respondWithRpcPromise(_0x261d('0xc1'),_0x261d('0xc2'),_0x540f80);});}return respondWithRpcPromise('Start',_0x261d('0xc2'),_0x540f80);})['then'](function(_0x50e569){if(_0x50e569){var _0x19240c=0xc8;var _0x21c8a4=_0x261d('0xc3');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x21c8a4,_0x19240c,_0x261d('0xc4'));logger[_0x261d('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x21c8a4,_0x19240c,_0x261d('0xc4'),JSON[_0x261d('0xc5')](_0x50e569));if(_0x540f80[_0x261d('0x8c')][_0x261d('0x56')]===_0x261d('0x9f')){return _0x442dc7[_0x261d('0x2f')](_0x19240c)[_0x261d('0xc6')]('Content-Type',_0x261d('0xc7'))['send'](_0x261d('0xc8'));}else{return _0x442dc7[_0x261d('0x2f')](_0x19240c)[_0x261d('0x30')](_0x50e569);}}});})[_0x261d('0x2d')](handleError(_0x442dc7,null));};exports['send']=function(_0x4be2ed,_0x5f06d4,_0x2825d6){var _0x58ea05,_0x5668cf,_0x9d8651;if(_[_0x261d('0xa7')](_0x4be2ed[_0x261d('0x5f')][_0x261d('0x5f')])||_0x4be2ed[_0x261d('0x5f')][_0x261d('0x5f')]===''){throw new db[(_0x261d('0x97'))][(_0x261d('0xa8'))](_0x261d('0xaa'));}if(_['isNil'](_0x4be2ed[_0x261d('0x5f')]['to'])){throw new db[(_0x261d('0x97'))][(_0x261d('0xa8'))](_0x261d('0xc9'));}_0x58ea05=_0x4be2ed[_0x261d('0x5f')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x4be2ed['params']['id']},'include':[{'model':db[_0x261d('0xaf')],'as':_0x261d('0xca'),'include':[{'model':db[_0x261d('0x96')],'as':_0x261d('0xb0'),'where':{'mobile':_0x58ea05},'limit':0x1,'order':[[_0x261d('0x9b'),_0x261d('0xb1')]]}]}]})['then'](handleEntityNotFound(_0x5f06d4,null))[_0x261d('0x24')](function(_0x3d7c1b){if(_0x3d7c1b&&_0x3d7c1b[_0x261d('0xca')]){_0x5668cf=_0x3d7c1b[_0x261d('0x3a')]({'plain':!![]});if(_0x5668cf['List']&&_0x5668cf[_0x261d('0xca')][_0x261d('0xb0')][_0x261d('0x4d')]){return _0x5668cf[_0x261d('0xca')][_0x261d('0xb0')][0x0];}return db[_0x261d('0x96')][_0x261d('0x5e')](_['defaults'](_0x4be2ed[_0x261d('0x5f')],{'firstName':_0x58ea05,'mobile':_0x58ea05,'phone':_0x58ea05,'ListId':_0x5668cf['ListId']}));}})['then'](handleEntityNotFound(_0x5f06d4,null))[_0x261d('0x24')](function(_0x3db307){if(_0x3db307){_0x9d8651=_0x3db307;return db[_0x261d('0xb4')][_0x261d('0x64')]({'where':{'ContactId':_0x9d8651['id'],'closed':![],'WhatsappAccountId':_0x5668cf['id']}})[_0x261d('0x24')](function(_0x531c4d){if(_0x531c4d){return[_0x531c4d,![]];}return db[_0x261d('0xb4')][_0x261d('0x5e')]({'UserId':_0x4be2ed[_0x261d('0x60')]['id'],'ContactId':_0x9d8651['id'],'WhatsappAccountId':_0x5668cf['id'],'phone':_0x58ea05,'firstMsgDirection':'out','Messages':[_['merge'](_0x4be2ed[_0x261d('0x5f')],{'read':![],'body':_0x4be2ed[_0x261d('0x5f')]['body'],'phone':_0x58ea05,'WhatsappAccountId':_0x5668cf['id'],'UserId':_0x4be2ed['user']['id'],'ContactId':_0x9d8651['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x261d('0xcb')}]})[_0x261d('0x24')](function(_0x2dc76d){return[_0x2dc76d,!![]];});});}})['spread'](function(_0x3d6457,_0x2d9b54){if(_0x2d9b54){return _0x3d6457;}return db[_0x261d('0x90')][_0x261d('0x5e')](_[_0x261d('0x55')](_0x4be2ed['body'],{'read':![],'body':_0x4be2ed[_0x261d('0x5f')]['body'],'phone':_0x58ea05,'WhatsappAccountId':_0x5668cf['id'],'WhatsappInteractionId':_0x3d6457['id'],'UserId':_0x4be2ed[_0x261d('0x60')]['id'],'ContactId':_0x9d8651['id']}))[_0x261d('0x24')](function(_0x26e5f8){_0x3d6457['dataValues'][_0x261d('0xcb')]=[];_0x3d6457[_0x261d('0xcc')][_0x261d('0xcb')][_0x261d('0xb8')](_0x26e5f8['dataValues']);return _0x3d6457;});})[_0x261d('0x24')](respondWithResult(_0x5f06d4,null))[_0x261d('0x2d')](handleError(_0x5f06d4,null));}; \ No newline at end of file +var _0xfefe=['read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','From','replace','Body','messageId','MessageSid','from','notifications','ValidationError','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','CmList','ListId','Contacts','DESC','list','omit','defaults','CmContact','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','created','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','get','out','Messages','dataValues','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','map','WhatsappAccount','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','Pause','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','pick','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Applications','account','type','sinch','statuses','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfefe,0x1ca));var _0xefef=function(_0x272156,_0x898895){_0x272156=_0x272156-0x0;var _0x1e5e1a=_0xfefe[_0x272156];return _0x1e5e1a;};'use strict';var emlformat=require(_0xefef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefef('0x2'));var BPromise=require(_0xefef('0x3'));var Mustache=require(_0xefef('0x4'));var util=require(_0xefef('0x5'));var path=require(_0xefef('0x6'));var sox=require(_0xefef('0x7'));var csv=require(_0xefef('0x8'));var ejs=require(_0xefef('0x9'));var fs=require('fs');var fs_extra=require(_0xefef('0xa'));var _=require(_0xefef('0xb'));var squel=require(_0xefef('0xc'));var crypto=require(_0xefef('0xd'));var jsforce=require(_0xefef('0xe'));var deskjs=require(_0xefef('0xf'));var toCsv=require('to-csv');var querystring=require(_0xefef('0x10'));var Papa=require(_0xefef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xefef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefef('0x13'))(_0xefef('0x14'));var utils=require(_0xefef('0x15'));var config=require(_0xefef('0x16'));var licenseUtil=require(_0xefef('0x17'));var db=require(_0xefef('0x18'))['db'];config[_0xefef('0x19')]=_['defaults'](config['redis'],{'host':_0xefef('0x1a'),'port':0x18eb});var socket=require(_0xefef('0x1b'))(new Redis(config[_0xefef('0x19')]));require(_0xefef('0x1c'))[_0xefef('0x1d')](socket);var jayson=require(_0xefef('0x1e'));var client=jayson[_0xefef('0x1f')][_0xefef('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x49540a,_0x46185c,_0x1627b4,_0x2ab1ed){return new BPromise(function(_0x36f9a8,_0x4c6525){var _0x1510d9=_0x2ab1ed||client;return _0x1510d9[_0xefef('0x21')](_0x49540a,_0x1627b4)[_0xefef('0x22')](function(_0x443419){logger[_0xefef('0x23')](_0xefef('0x24'),_0x46185c,'request\x20sent');logger[_0xefef('0x25')](_0xefef('0x26'),_0x46185c,'request\x20sent',JSON[_0xefef('0x27')](_0x443419));if(_0x443419[_0xefef('0x28')]){if(_0x443419['error'][_0xefef('0x29')]===0x1f4){logger[_0xefef('0x28')](_0xefef('0x24'),_0x46185c,_0x443419[_0xefef('0x28')][_0xefef('0x2a')]);return _0x4c6525(_0x443419[_0xefef('0x28')][_0xefef('0x2a')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x46185c,_0x443419[_0xefef('0x28')]['message']);return _0x36f9a8(_0x443419['error'][_0xefef('0x2a')]);}else{logger[_0xefef('0x23')](_0xefef('0x24'),_0x46185c,_0xefef('0x2b'));_0x36f9a8(_0x443419[_0xefef('0x2c')]['message']);}})[_0xefef('0x2d')](function(_0x2bbdba){logger['error'](_0xefef('0x24'),_0x46185c,_0x2bbdba);_0x4c6525(_0x2bbdba);});});}function respondWithStatusCode(_0x5a24ff,_0xa125a8){_0xa125a8=_0xa125a8||0xcc;return function(_0x5e967f){if(_0x5e967f){return _0x5a24ff[_0xefef('0x2e')](_0xa125a8);}return _0x5a24ff['status'](_0xa125a8)['end']();};}function respondWithResult(_0x110db6,_0x7e7e82){_0x7e7e82=_0x7e7e82||0xc8;return function(_0x11a3ea){if(_0x11a3ea){return _0x110db6[_0xefef('0x2f')](_0x7e7e82)[_0xefef('0x30')](_0x11a3ea);}};}function respondWithFilteredResult(_0x2aeda6,_0x3c929f){return function(_0x22e585){if(_0x22e585){var _0x8a3afe=typeof _0x3c929f[_0xefef('0x31')]===_0xefef('0x32')&&typeof _0x3c929f['limit']===_0xefef('0x32');var _0x579219=_0x22e585[_0xefef('0x33')];var _0x4247bd=_0x8a3afe?0x0:_0x3c929f[_0xefef('0x31')];var _0x1e495f=_0x8a3afe?_0x22e585['count']:_0x3c929f[_0xefef('0x31')]+_0x3c929f['limit'];var _0x193418;if(_0x1e495f>=_0x579219){_0x1e495f=_0x579219;_0x193418=0xc8;}else{_0x193418=0xce;}_0x2aeda6['status'](_0x193418);return _0x2aeda6[_0xefef('0x34')](_0xefef('0x35'),_0x4247bd+'-'+_0x1e495f+'/'+_0x579219)['json'](_0x22e585);}return null;};}function patchUpdates(_0xb83883){return function(_0x2d10bb){try{jsonpatch[_0xefef('0x36')](_0x2d10bb,_0xb83883,!![]);}catch(_0x4f29ce){return BPromise[_0xefef('0x37')](_0x4f29ce);}return _0x2d10bb['save']();};}function saveUpdates(_0x3f4350,_0x29012f){return function(_0x4192d6){if(_0x4192d6){return _0x4192d6[_0xefef('0x38')](_0x3f4350)[_0xefef('0x22')](function(_0x5a629f){return _0x5a629f;});}return null;};}function removeEntity(_0x89d1c0,_0x42b678){return function(_0x378072){if(_0x378072){return _0x378072[_0xefef('0x39')]()['then'](function(){var _0x3df41b=_0x378072['get']({'plain':!![]});var _0x5b029e=_0xefef('0x3a');return db[_0xefef('0x3b')]['destroy']({'where':{'type':_0x5b029e,'resourceId':_0x3df41b['id']}})[_0xefef('0x22')](function(){return _0x378072;});})[_0xefef('0x22')](function(){_0x89d1c0['status'](0xcc)[_0xefef('0x3c')]();});}};}function handleEntityNotFound(_0x3fd419,_0x4376ce){return function(_0x403c4c){if(!_0x403c4c){_0x3fd419['sendStatus'](0x194);}return _0x403c4c;};}function handleError(_0x1ea9f9,_0x3ab8f9){_0x3ab8f9=_0x3ab8f9||0x1f4;return function(_0x35f49a){logger['error'](_0x35f49a[_0xefef('0x3d')]);if(_0x35f49a[_0xefef('0x3e')]){delete _0x35f49a[_0xefef('0x3e')];}_0x1ea9f9[_0xefef('0x2f')](_0x3ab8f9)[_0xefef('0x3f')](_0x35f49a);};}exports[_0xefef('0x40')]=function(_0x51590e,_0x49dcfd){var _0x142488={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3a2dc9={},_0x4fbccc={'count':0x0,'rows':[]};var _0x4efca2=_[_0xefef('0x41')](db[_0xefef('0x42')][_0xefef('0x43')],function(_0x2ab4f5){return{'name':_0x2ab4f5[_0xefef('0x44')],'type':_0x2ab4f5['type']['key']};});_0x3a2dc9[_0xefef('0x45')]=_['map'](_0x4efca2,_0xefef('0x3e'));_0x3a2dc9[_0xefef('0x46')]=_['keys'](_0x51590e[_0xefef('0x46')]);_0x3a2dc9[_0xefef('0x47')]=_[_0xefef('0x48')](_0x3a2dc9[_0xefef('0x45')],_0x3a2dc9[_0xefef('0x46')]);_0x142488['attributes']=_[_0xefef('0x48')](_0x3a2dc9['model'],qs[_0xefef('0x49')](_0x51590e[_0xefef('0x46')][_0xefef('0x49')]));_0x142488[_0xefef('0x4a')]=_0x142488['attributes'][_0xefef('0x4b')]?_0x142488['attributes']:_0x3a2dc9[_0xefef('0x45')];if(!_0x51590e[_0xefef('0x46')][_0xefef('0x4c')](_0xefef('0x4d'))){_0x142488[_0xefef('0x4e')]=qs['limit'](_0x51590e[_0xefef('0x46')]['limit']);_0x142488[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x51590e[_0xefef('0x46')][_0xefef('0x31')]);}_0x142488['order']=qs[_0xefef('0x4f')](_0x51590e['query'][_0xefef('0x4f')]);_0x142488[_0xefef('0x50')]=qs['filters'](_['pick'](_0x51590e['query'],_0x3a2dc9[_0xefef('0x47')]),_0x4efca2);if(_0x51590e[_0xefef('0x46')][_0xefef('0x51')]){_0x142488[_0xefef('0x50')]=_['merge'](_0x142488[_0xefef('0x50')],{'$or':_[_0xefef('0x41')](_0x4efca2,function(_0x4f4de9){if(_0x4f4de9['type']!==_0xefef('0x52')){var _0x413a8e={};_0x413a8e[_0x4f4de9[_0xefef('0x3e')]]={'$like':'%'+_0x51590e[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x413a8e;}})});}_0x142488=_[_0xefef('0x53')]({},_0x142488,_0x51590e[_0xefef('0x54')]);var _0x4d22e6={'where':_0x142488['where']};return db['WhatsappAccount'][_0xefef('0x33')](_0x4d22e6)[_0xefef('0x22')](function(_0x1d2979){_0x4fbccc[_0xefef('0x33')]=_0x1d2979;if(_0x51590e[_0xefef('0x46')][_0xefef('0x55')]){_0x142488[_0xefef('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xefef('0x57')](_0x142488);})[_0xefef('0x22')](function(_0x472fd8){_0x4fbccc['rows']=_0x472fd8;return _0x4fbccc;})['then'](respondWithFilteredResult(_0x49dcfd,_0x142488))['catch'](handleError(_0x49dcfd,null));};exports['show']=function(_0x1c5f01,_0x5d9b28){var _0x27f577={'raw':![],'where':{'id':_0x1c5f01[_0xefef('0x58')]['id']},'include':[{'model':db[_0xefef('0x59')],'as':'mandatoryDispositionPause'}]},_0x44eaef={};_0x44eaef[_0xefef('0x45')]=_[_0xefef('0x5a')](db[_0xefef('0x42')][_0xefef('0x43')]);_0x44eaef[_0xefef('0x46')]=_[_0xefef('0x5a')](_0x1c5f01[_0xefef('0x46')]);_0x44eaef[_0xefef('0x47')]=_[_0xefef('0x48')](_0x44eaef['model'],_0x44eaef[_0xefef('0x46')]);_0x27f577[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x44eaef[_0xefef('0x45')],qs[_0xefef('0x49')](_0x1c5f01[_0xefef('0x46')]['fields']));_0x27f577[_0xefef('0x4a')]=_0x27f577[_0xefef('0x4a')][_0xefef('0x4b')]?_0x27f577['attributes']:_0x44eaef[_0xefef('0x45')];if(_0x1c5f01[_0xefef('0x46')]['includeAll']){_0x27f577[_0xefef('0x56')]=[{'all':!![]}];}_0x27f577=_[_0xefef('0x53')]({},_0x27f577,_0x1c5f01[_0xefef('0x54')]);return db[_0xefef('0x42')][_0xefef('0x5b')](_0x27f577)[_0xefef('0x22')](handleEntityNotFound(_0x5d9b28,null))[_0xefef('0x22')](respondWithResult(_0x5d9b28,null))[_0xefef('0x2d')](handleError(_0x5d9b28,null));};exports[_0xefef('0x5c')]=function(_0x58a061,_0x3a3244){return db[_0xefef('0x42')][_0xefef('0x5c')](_0x58a061['body'],{})['then'](function(_0x517c0e){var _0x88ab5c=_0x58a061[_0xefef('0x5d')]['get']({'plain':!![]});if(!_0x88ab5c)throw new Error(_0xefef('0x5e'));if(_0x88ab5c['role']===_0xefef('0x5d')){var _0x236718=_0x517c0e['get']({'plain':!![]});var _0x1fef5f=_0xefef('0x3a');return db['UserProfileSection'][_0xefef('0x5b')]({'where':{'name':_0x1fef5f,'userProfileId':_0x88ab5c[_0xefef('0x5f')]},'raw':!![]})[_0xefef('0x22')](function(_0x11bb69){if(_0x11bb69&&_0x11bb69[_0xefef('0x60')]===0x0){return db[_0xefef('0x3b')][_0xefef('0x5c')]({'name':_0x236718[_0xefef('0x3e')],'resourceId':_0x236718['id'],'type':_0x11bb69['name'],'sectionId':_0x11bb69['id']},{})['then'](function(){return _0x517c0e;});}else{return _0x517c0e;}})[_0xefef('0x2d')](function(_0x4d6647){logger['error'](_0xefef('0x61'),_0x4d6647);throw _0x4d6647;});}return _0x517c0e;})[_0xefef('0x22')](respondWithResult(_0x3a3244,0xc9))['catch'](handleError(_0x3a3244,null));};exports['update']=function(_0x24894e,_0x39e4a0){if(_0x24894e[_0xefef('0x62')]['id']){delete _0x24894e['body']['id'];}return db[_0xefef('0x42')]['find']({'where':{'id':_0x24894e['params']['id']},'include':[{'model':db[_0xefef('0x59')],'as':_0xefef('0x63')}]})[_0xefef('0x22')](handleEntityNotFound(_0x39e4a0,null))['then'](saveUpdates(_0x24894e[_0xefef('0x62')],null))[_0xefef('0x22')](respondWithResult(_0x39e4a0,null))[_0xefef('0x2d')](handleError(_0x39e4a0,null));};exports[_0xefef('0x39')]=function(_0x2a07b2,_0x3dae25){return db['WhatsappAccount'][_0xefef('0x5b')]({'where':{'id':_0x2a07b2[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x3dae25,null))[_0xefef('0x22')](removeEntity(_0x3dae25,null))[_0xefef('0x2d')](handleError(_0x3dae25,null));};exports[_0xefef('0x64')]=function(_0x323ed3,_0x36b6e2){return db[_0xefef('0x42')][_0xefef('0x64')]()[_0xefef('0x22')](respondWithResult(_0x36b6e2,null))['catch'](handleError(_0x36b6e2,null));};exports[_0xefef('0x65')]=function(_0x30890b,_0x2220a9,_0x55ecb9){if(_0x30890b[_0xefef('0x62')]['id']){delete _0x30890b['body']['id'];}return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x30890b[_0xefef('0x58')]['id']}})['then'](handleEntityNotFound(_0x2220a9,null))[_0xefef('0x22')](function(_0x438e1a){if(_0x438e1a){_0x30890b[_0xefef('0x62')][_0xefef('0x66')]=_0x438e1a['id'];return db[_0xefef('0x67')]['create'](_0x30890b['body']);}})['then'](respondWithResult(_0x2220a9,null))[_0xefef('0x2d')](handleError(_0x2220a9,null));};exports[_0xefef('0x68')]=function(_0x59837a,_0x117349,_0x5a9feb){var _0xdd815a={'raw':![],'where':{}};var _0x1fad1e={};var _0x1d9315={'count':0x0,'rows':[]};return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x59837a['params']['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x117349,null))['then'](function(_0x4ff95b){if(_0x4ff95b){_0x1fad1e[_0xefef('0x45')]=_[_0xefef('0x5a')](db['Disposition'][_0xefef('0x43')]);_0x1fad1e['query']=_['keys'](_0x59837a[_0xefef('0x46')]);_0x1fad1e[_0xefef('0x47')]=_[_0xefef('0x48')](_0x1fad1e[_0xefef('0x45')],_0x1fad1e[_0xefef('0x46')]);_0xdd815a[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x1fad1e[_0xefef('0x45')],qs['fields'](_0x59837a[_0xefef('0x46')]['fields']));_0xdd815a[_0xefef('0x4a')]=_0xdd815a[_0xefef('0x4a')][_0xefef('0x4b')]?_0xdd815a['attributes']:_0x1fad1e[_0xefef('0x45')];if(!_0x59837a['query'][_0xefef('0x4c')](_0xefef('0x4d'))){_0xdd815a[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x59837a[_0xefef('0x46')][_0xefef('0x4e')]);_0xdd815a[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x59837a[_0xefef('0x46')][_0xefef('0x31')]);}_0xdd815a[_0xefef('0x6a')]=qs['sort'](_0x59837a['query'][_0xefef('0x4f')]);_0xdd815a[_0xefef('0x50')]=qs['filters'](_[_0xefef('0x6b')](_0x59837a[_0xefef('0x46')],_0x1fad1e[_0xefef('0x47')]));_0xdd815a[_0xefef('0x50')][_0xefef('0x66')]=_0x4ff95b['id'];if(_0x59837a[_0xefef('0x46')][_0xefef('0x51')]){_0xdd815a['where']=_[_0xefef('0x53')](_0xdd815a[_0xefef('0x50')],{'$or':_['map'](_0xdd815a[_0xefef('0x4a')],function(_0x484d8c){var _0x3a7b0d={};_0x3a7b0d[_0x484d8c]={'$like':'%'+_0x59837a[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x3a7b0d;})});}_0xdd815a=_['merge']({},_0xdd815a,_0x59837a[_0xefef('0x54')]);return db[_0xefef('0x67')][_0xefef('0x33')]({'where':_0xdd815a[_0xefef('0x50')]})[_0xefef('0x22')](function(_0x60e281){_0x1d9315[_0xefef('0x33')]=_0x60e281;if(_0x59837a[_0xefef('0x46')][_0xefef('0x55')]){_0xdd815a[_0xefef('0x56')]=[{'all':!![]}];}return db[_0xefef('0x67')][_0xefef('0x57')](_0xdd815a);})['then'](function(_0x4077f8){_0x1d9315[_0xefef('0x6c')]=_0x4077f8;return _0x1d9315;});}})[_0xefef('0x22')](respondWithFilteredResult(_0x117349,_0xdd815a))['catch'](handleError(_0x117349,null));};exports[_0xefef('0x6d')]=function(_0x229227,_0x3a9f2d,_0x374a42){return db['WhatsappAccount'][_0xefef('0x5b')]({'where':{'id':_0x229227[_0xefef('0x58')]['id']}})['then'](handleEntityNotFound(_0x3a9f2d,null))[_0xefef('0x22')](function(_0x8cfcad){if(_0x8cfcad){return _0x8cfcad[_0xefef('0x6d')](_0x229227[_0xefef('0x46')][_0xefef('0x6e')]);}})[_0xefef('0x22')](respondWithStatusCode(_0x3a9f2d,null))[_0xefef('0x2d')](handleError(_0x3a9f2d,null));};exports['addAnswer']=function(_0x47c0db,_0x362225,_0x3f200c){if(_0x47c0db[_0xefef('0x62')]['id']){delete _0x47c0db[_0xefef('0x62')]['id'];}return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x47c0db[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x362225,null))['then'](function(_0x24b744){if(_0x24b744){_0x47c0db[_0xefef('0x62')][_0xefef('0x66')]=_0x24b744['id'];return db['CannedAnswer'][_0xefef('0x5c')](_0x47c0db[_0xefef('0x62')]);}})[_0xefef('0x22')](respondWithResult(_0x362225,null))[_0xefef('0x2d')](handleError(_0x362225,null));};exports[_0xefef('0x6f')]=function(_0x2572b3,_0x20b5c9,_0x1b6d14){var _0x2f75ff={'raw':![],'where':{}};var _0x1ba13e={};var _0x392cec={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xefef('0x69')]({'where':{'id':_0x2572b3[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x20b5c9,null))[_0xefef('0x22')](function(_0x4b04c4){if(_0x4b04c4){_0x1ba13e['model']=_[_0xefef('0x5a')](db[_0xefef('0x70')]['rawAttributes']);_0x1ba13e[_0xefef('0x46')]=_[_0xefef('0x5a')](_0x2572b3[_0xefef('0x46')]);_0x1ba13e['filters']=_[_0xefef('0x48')](_0x1ba13e[_0xefef('0x45')],_0x1ba13e[_0xefef('0x46')]);_0x2f75ff[_0xefef('0x4a')]=_['intersection'](_0x1ba13e['model'],qs['fields'](_0x2572b3[_0xefef('0x46')][_0xefef('0x49')]));_0x2f75ff[_0xefef('0x4a')]=_0x2f75ff['attributes']['length']?_0x2f75ff[_0xefef('0x4a')]:_0x1ba13e[_0xefef('0x45')];if(!_0x2572b3['query']['hasOwnProperty'](_0xefef('0x4d'))){_0x2f75ff[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x2572b3['query']['limit']);_0x2f75ff[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x2572b3[_0xefef('0x46')][_0xefef('0x31')]);}_0x2f75ff[_0xefef('0x6a')]=qs['sort'](_0x2572b3['query'][_0xefef('0x4f')]);_0x2f75ff[_0xefef('0x50')]=qs[_0xefef('0x47')](_[_0xefef('0x6b')](_0x2572b3[_0xefef('0x46')],_0x1ba13e[_0xefef('0x47')]));_0x2f75ff[_0xefef('0x50')][_0xefef('0x66')]=_0x4b04c4['id'];if(_0x2572b3[_0xefef('0x46')][_0xefef('0x51')]){_0x2f75ff[_0xefef('0x50')]=_[_0xefef('0x53')](_0x2f75ff[_0xefef('0x50')],{'$or':_[_0xefef('0x41')](_0x2f75ff[_0xefef('0x4a')],function(_0x53132b){var _0x45687e={};_0x45687e[_0x53132b]={'$like':'%'+_0x2572b3[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x45687e;})});}_0x2f75ff=_['merge']({},_0x2f75ff,_0x2572b3['options']);return db['CannedAnswer']['count']({'where':_0x2f75ff[_0xefef('0x50')]})[_0xefef('0x22')](function(_0x304bc2){_0x392cec['count']=_0x304bc2;if(_0x2572b3[_0xefef('0x46')]['includeAll']){_0x2f75ff[_0xefef('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xefef('0x57')](_0x2f75ff);})['then'](function(_0x656cd5){_0x392cec[_0xefef('0x6c')]=_0x656cd5;return _0x392cec;});}})[_0xefef('0x22')](respondWithFilteredResult(_0x20b5c9,_0x2f75ff))[_0xefef('0x2d')](handleError(_0x20b5c9,null));};exports[_0xefef('0x71')]=function(_0xb5c40,_0x1f5024,_0x1e745b){return db[_0xefef('0x42')]['find']({'where':{'id':_0xb5c40[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x1f5024,null))[_0xefef('0x22')](function(_0x501e37){if(_0x501e37){return _0x501e37[_0xefef('0x71')](_0xb5c40[_0xefef('0x46')][_0xefef('0x6e')]);}})['then'](respondWithStatusCode(_0x1f5024,null))[_0xefef('0x2d')](handleError(_0x1f5024,null));};exports['addAgents']=function(_0xd6058f,_0x39185d,_0x520957){return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0xd6058f[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x39185d,null))['then'](function(_0x163242){if(_0x163242){return _0x163242[_0xefef('0x72')](_0xd6058f[_0xefef('0x62')][_0xefef('0x6e')],_['omit'](_0xd6058f['body'],['ids','id'])||{})[_0xefef('0x73')](function(_0x513b51){for(var _0x497bce=0x0;_0x497bce<_0xd6058f[_0xefef('0x62')][_0xefef('0x6e')][_0xefef('0x4b')];_0x497bce+=0x1){socket['emit'](_0xefef('0x74'),{'UserId':Number(_0xd6058f['body'][_0xefef('0x6e')][_0x497bce]),'WhatsappAccountId':Number(_0xd6058f['params']['id'])});}return _0x513b51;});}})[_0xefef('0x22')](respondWithResult(_0x39185d,null))['catch'](handleError(_0x39185d,null));};exports[_0xefef('0x75')]=function(_0x1b6a83,_0x5d933a,_0x3a9267){return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x1b6a83[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x5d933a,null))['then'](function(_0x355d95){if(_0x355d95){return _0x355d95[_0xefef('0x75')](_0x1b6a83[_0xefef('0x46')]['ids'])['then'](function(){if(_[_0xefef('0x76')](_0x1b6a83[_0xefef('0x46')][_0xefef('0x6e')])){for(var _0x44ccea=0x0;_0x44ccea<_0x1b6a83[_0xefef('0x46')][_0xefef('0x6e')][_0xefef('0x4b')];_0x44ccea+=0x1){socket[_0xefef('0x77')](_0xefef('0x78'),{'UserId':Number(_0x1b6a83['query'][_0xefef('0x6e')][_0x44ccea]),'WhatsappAccountId':Number(_0x1b6a83['params']['id'])});}}else{socket[_0xefef('0x77')](_0xefef('0x78'),{'UserId':Number(_0x1b6a83['query'][_0xefef('0x6e')]),'WhatsappAccountId':Number(_0x1b6a83[_0xefef('0x58')]['id'])});}});}})[_0xefef('0x22')](respondWithStatusCode(_0x5d933a,null))[_0xefef('0x2d')](handleError(_0x5d933a,null));};exports[_0xefef('0x79')]=function(_0x1a97fe,_0x21bdee,_0x3d3215){var _0xe7c716={};var _0x1fefc4={};var _0x23115d;var _0x251655;return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x1a97fe[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x21bdee,null))[_0xefef('0x22')](function(_0x3bfc9c){if(_0x3bfc9c){_0x23115d=_0x3bfc9c;_0x1fefc4['model']=_[_0xefef('0x5a')](db[_0xefef('0x7a')][_0xefef('0x43')]);_0x1fefc4['query']=_[_0xefef('0x5a')](_0x1a97fe[_0xefef('0x46')]);_0x1fefc4[_0xefef('0x47')]=_[_0xefef('0x48')](_0x1fefc4[_0xefef('0x45')],_0x1fefc4[_0xefef('0x46')]);_0xe7c716[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x1fefc4['model'],qs[_0xefef('0x49')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x49')]));_0xe7c716[_0xefef('0x4a')]=_0xe7c716[_0xefef('0x4a')][_0xefef('0x4b')]?_0xe7c716[_0xefef('0x4a')]:_0x1fefc4[_0xefef('0x45')];_0xe7c716[_0xefef('0x6a')]=qs[_0xefef('0x4f')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x4f')]);_0xe7c716[_0xefef('0x50')]=qs[_0xefef('0x47')](_[_0xefef('0x6b')](_0x1a97fe[_0xefef('0x46')],_0x1fefc4[_0xefef('0x47')]));if(_0x1a97fe[_0xefef('0x46')][_0xefef('0x51')]){_0xe7c716[_0xefef('0x50')]=_[_0xefef('0x53')](_0xe7c716['where'],{'$or':_[_0xefef('0x41')](_0xe7c716['attributes'],function(_0x7a2a4e){var _0x497735={};_0x497735[_0x7a2a4e]={'$like':'%'+_0x1a97fe[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x497735;})});}_0xe7c716=_[_0xefef('0x53')]({},_0xe7c716,_0x1a97fe[_0xefef('0x54')]);return _0x23115d['getAgents'](_0xe7c716);}})[_0xefef('0x22')](function(_0x362760){if(_0x362760){_0x251655=_0x362760[_0xefef('0x4b')];if(!_0x1a97fe[_0xefef('0x46')][_0xefef('0x4c')]('nolimit')){_0xe7c716[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x4e')]);_0xe7c716[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x31')]);}return _0x23115d[_0xefef('0x79')](_0xe7c716);}})[_0xefef('0x22')](function(_0x2423f2){if(_0x2423f2){return _0x2423f2?{'count':_0x251655,'rows':_0x2423f2}:null;}})[_0xefef('0x22')](respondWithResult(_0x21bdee,null))[_0xefef('0x2d')](handleError(_0x21bdee,null));};exports['addApplications']=function(_0x2250c6,_0x2f5cd5){var _0x66138c=_0x2250c6[_0xefef('0x58')]['id'];var _0x3e3fc4=_0x2250c6[_0xefef('0x62')];var _0x558fad=0xc8;var _0x571f0d=null;return db[_0xefef('0x7b')][_0xefef('0x7c')]({'isolationLevel':db[_0xefef('0x7b')][_0xefef('0x7d')]['ISOLATION_LEVELS'][_0xefef('0x7e')]},function(_0x4d18eb){return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x66138c},'transaction':_0x4d18eb})[_0xefef('0x22')](function(_0x1de9c5){if(_0x1de9c5){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x66138c},'transaction':_0x4d18eb})[_0xefef('0x22')](function(){var _0x620798=_[_0xefef('0x41')](_0x3e3fc4,function(_0x11842a){_0x11842a[_0xefef('0x66')]=_0x66138c;return _0x11842a;});return db[_0xefef('0x7f')][_0xefef('0x80')](_0x620798,{'transaction':_0x4d18eb});});}else{_0x558fad=0x194;_0x571f0d=[];}});})[_0xefef('0x22')](function(){if(_0x558fad!==0x194){return db[_0xefef('0x7f')][_0xefef('0x81')]({'where':{'WhatsappAccountId':_0x66138c},'order':_0xefef('0x82')})[_0xefef('0x22')](function(_0x4d2811){_0x571f0d=_0x4d2811;});}})['catch'](function(_0x5b2acf){_0x558fad=0x1f4;logger[_0xefef('0x28')](_0x5b2acf['stack']);if(_0x5b2acf[_0xefef('0x3e')]){delete _0x5b2acf[_0xefef('0x3e')];}_0x571f0d=_0x5b2acf;})[_0xefef('0x83')](function(){if(_0x571f0d===null){_0x2f5cd5[_0xefef('0x2e')](_0x558fad);}else{if(_0x558fad===0x1f4){_0x2f5cd5['status'](_0x558fad)['send'](_0x571f0d);}else{_0x2f5cd5[_0xefef('0x2f')](_0x558fad)[_0xefef('0x30')](_0x571f0d);}}});};exports['getApplications']=function(_0x54ed2a,_0xde628e,_0x5dc306){var _0x170e44={};var _0x171f8f={};var _0x43de39;var _0x2a3459;return db['WhatsappAccount']['findOne']({'where':{'id':_0x54ed2a[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0xde628e,null))[_0xefef('0x22')](function(_0x49db5a){if(_0x49db5a){_0x43de39=_0x49db5a;_0x171f8f['model']=_[_0xefef('0x5a')](db[_0xefef('0x7f')][_0xefef('0x43')]);_0x171f8f[_0xefef('0x46')]=_['keys'](_0x54ed2a[_0xefef('0x46')]);_0x171f8f[_0xefef('0x47')]=_[_0xefef('0x48')](_0x171f8f['model'],_0x171f8f[_0xefef('0x46')]);_0x170e44[_0xefef('0x4a')]=_['intersection'](_0x171f8f[_0xefef('0x45')],qs[_0xefef('0x49')](_0x54ed2a['query'][_0xefef('0x49')]));_0x170e44[_0xefef('0x4a')]=_0x170e44[_0xefef('0x4a')]['length']?_0x170e44['attributes']:_0x171f8f[_0xefef('0x45')];_0x170e44[_0xefef('0x6a')]=qs[_0xefef('0x4f')](_0x54ed2a[_0xefef('0x46')][_0xefef('0x4f')]);_0x170e44[_0xefef('0x50')]=qs['filters'](_[_0xefef('0x6b')](_0x54ed2a[_0xefef('0x46')],_0x171f8f['filters']));if(_0x54ed2a['query']['filter']){_0x170e44[_0xefef('0x50')]=_[_0xefef('0x53')](_0x170e44[_0xefef('0x50')],{'$or':_['map'](_0x170e44[_0xefef('0x4a')],function(_0x5796d0){var _0x273dbe={};_0x273dbe[_0x5796d0]={'$like':'%'+_0x54ed2a[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x273dbe;})});}_0x170e44=_[_0xefef('0x53')]({},_0x170e44,_0x54ed2a['options']);return _0x43de39['getApplications'](_0x170e44);}})['then'](function(_0x3ab7e3){if(_0x3ab7e3){_0x2a3459=_0x3ab7e3[_0xefef('0x4b')];if(!_0x54ed2a[_0xefef('0x46')][_0xefef('0x4c')](_0xefef('0x4d'))){_0x170e44[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x54ed2a[_0xefef('0x46')][_0xefef('0x4e')]);_0x170e44[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x54ed2a[_0xefef('0x46')]['offset']);}return _0x43de39[_0xefef('0x84')](_0x170e44);}})[_0xefef('0x22')](function(_0x4a249e){if(_0x4a249e){return _0x4a249e?{'count':_0x2a3459,'rows':_0x4a249e}:null;}})[_0xefef('0x22')](respondWithResult(_0xde628e,null))[_0xefef('0x2d')](handleError(_0xde628e,null));};exports['notify']=function(_0x45ac3b,_0x598e3c,_0x2f85c5){var _0x16c63f={'channel':'whatsapp'};var _0x2fd36a=[];var _0x1e4c26=[];var _0x7c0432={};return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x45ac3b[_0xefef('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xefef('0x85')}]})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x1b752a){_0x16c63f[_0xefef('0x86')]=_0x1b752a;if(_0x16c63f[_0xefef('0x86')]&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]===_0xefef('0x88')&&_0x45ac3b['body'][_0xefef('0x89')]){if(_0x45ac3b[_0xefef('0x62')]['statuses']['length']===0x0)return;if(_0x45ac3b['body'][_0xefef('0x89')][0x0][_0xefef('0x8a')]!==_0xefef('0x8b'))return;return db[_0xefef('0x8c')][_0xefef('0x38')]({'read':!![],'readAt':_0x45ac3b['body']['statuses'][0x0][_0xefef('0x8d')]},{'where':{'messageId':_0x45ac3b[_0xefef('0x62')]['statuses'][0x0][_0xefef('0x8e')]},'individualHooks':!![]})['then'](function(_0x25cc0e){return _0x598e3c['status'](0xc8)[_0xefef('0x30')](_0x25cc0e);});}_0x16c63f[_0xefef('0x8f')]=_[_0xefef('0x90')](_0x1b752a[_0xefef('0x85')],['priority'],[_0xefef('0x91')]);if(_0x16c63f[_0xefef('0x86')][_0xefef('0x85')]){delete _0x16c63f[_0xefef('0x86')][_0xefef('0x85')];}return db['CmContact'][_0xefef('0x64')]()[_0xefef('0x22')](function(_0x51cf57){if(!_0x51cf57){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0x93'));}_0x2fd36a=_[_0xefef('0x94')](_[_0xefef('0x5a')](_0x51cf57),[_0xefef('0x95'),_0xefef('0x96')]);_0x1e4c26=_[_0xefef('0x94')](_[_0xefef('0x5a')](_0x51cf57),[_0xefef('0x95'),_0xefef('0x96'),_0xefef('0x97'),'ListId']);_0x16c63f[_0xefef('0x62')]={'mapKey':_0xefef('0x98')};if(_0x16c63f['account']&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]==='twilio'){_0x16c63f[_0xefef('0x62')]['from']=_0x45ac3b['body'][_0xefef('0x99')][_0xefef('0x9a')]('whatsapp:','');_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9b')];_0x16c63f['body'][_0xefef('0x9c')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9d')];}if(_0x16c63f['account']&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]===_0xefef('0x88')){_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0][_0xefef('0x9e')];_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0]['message']['body'];_0x16c63f['body']['messageId']=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0][_0xefef('0x8e')];}if(_0x16c63f[_0xefef('0x62')]['id']){delete _0x16c63f['body']['id'];}if(_['isNil'](_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')])){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))]('from\x20is\x20mandatory');}if(_[_0xefef('0xa1')](_0x16c63f[_0xefef('0x62')][_0xefef('0x62')])||_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]===''){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))](_0xefef('0xa2'));}if(_[_0xefef('0xa1')](_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')])){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0xa4')+_0x1e4c26);}if(!_['includes'](_0x1e4c26,_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')])){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0xa5')+_0x1e4c26);}_0x7c0432[_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')]]=_0x16c63f['body']['from'];return db[_0xefef('0xa6')][_0xefef('0x5b')]({'where':{'id':_0x16c63f['account'][_0xefef('0xa7')]},'include':[{'model':db['CmContact'],'as':_0xefef('0xa8'),'where':_0x7c0432,'limit':0x1,'order':[[_0xefef('0x96'),_0xefef('0xa9')]]}]});})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x3a0e78){if(_0x3a0e78){_0x16c63f[_0xefef('0xaa')]=_[_0xefef('0xab')](_0x3a0e78,['Contacts']);if(_0x3a0e78[_0xefef('0xa8')][_0xefef('0x4b')]){return _0x3a0e78[_0xefef('0xa8')][0x0];}var _0xaf0c2d=_[_0xefef('0xac')](_0x16c63f[_0xefef('0x62')],{'firstName':_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')],'ListId':_0x3a0e78['id']});_0xaf0c2d[_0x16c63f['body'][_0xefef('0xa3')]]=_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')];return db[_0xefef('0xad')]['create'](_0xaf0c2d,{'fields':_0x2fd36a,'raw':!![]});}})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x18e4ba){if(_0x18e4ba){_0x16c63f['contact']=_0x18e4ba;var _0x521bcf={'ContactId':_0x18e4ba['id'],'phone':_0x16c63f['body'][_0xefef('0x9e')],'WhatsappAccountId':_0x45ac3b[_0xefef('0x58')]['id']};var _0x11e7c6={'ContactId':_0x18e4ba['id'],'WhatsappAccountId':_0x45ac3b['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x11e7c6})[_0xefef('0x22')](function(_0x356a12){if(_0x356a12){return[_0x356a12,![]];}return db[_0xefef('0xae')][_0xefef('0x5c')](_0x521bcf)['then'](function(_0x5a3a60){return[_0x5a3a60,!![]];});});}})[_0xefef('0x73')](function(_0x4f2f52,_0x57bf3b){_0x16c63f[_0xefef('0xaf')]=_0x4f2f52['get']({'plain':!![]});_0x16c63f[_0xefef('0xaf')]['created']=![];if(_0x57bf3b){if(_0x16c63f[_0xefef('0x86')]['autoclose']){_0x16c63f[_0xefef('0x8f')][_0xefef('0xb0')]({'id':0x0,'priority':_0x16c63f[_0xefef('0x8f')][_0xefef('0x4b')]+0x1,'app':_0xefef('0xb1'),'appdata':_0xefef('0xb2'),'interval':_0xefef('0xb3')});}_0x16c63f['interaction'][_0xefef('0xb4')]=!![];}return db[_0xefef('0x8c')]['create']({'phone':_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')],'messageId':_0x16c63f['body'][_0xefef('0x9c')],'body':_0x16c63f[_0xefef('0x62')][_0xefef('0x62')],'WhatsappAccountId':_0x45ac3b[_0xefef('0x58')]['id'],'WhatsappInteractionId':_0x4f2f52['id'],'direction':'in','ContactId':_0x4f2f52['ContactId'],'AttachmentId':_0x16c63f[_0xefef('0x62')][_0xefef('0xb5')]});})[_0xefef('0x22')](function(_0x46290e){_0x16c63f['message']=_0x46290e;if(_0x16c63f[_0xefef('0xaf')][_0xefef('0xb6')]){return db[_0xefef('0x7a')]['find']({'attributes':['id',_0xefef('0x3e')],'where':{'id':_0x16c63f['interaction']['UserId']}})[_0xefef('0x22')](function(_0x36b260){if(_0x36b260){_0x16c63f['applications'][_0xefef('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36b260['name']+','+(_0x16c63f[_0xefef('0x86')][_0xefef('0xb8')]||0xa),'interval':_0xefef('0xb3')});}return respondWithRpcPromise(_0xefef('0xb9'),_0xefef('0xba'),_0x16c63f);});}return respondWithRpcPromise('Start',_0xefef('0xba'),_0x16c63f);})[_0xefef('0x22')](function(_0x110669){if(_0x110669){var _0xf54d27=0xc8;var _0x1ad142=_0xefef('0xbb');logger[_0xefef('0x23')](_0xefef('0x26'),_0x1ad142,_0xf54d27,_0xefef('0xbc'));logger['debug'](_0xefef('0xbd'),_0x1ad142,_0xf54d27,_0xefef('0xbc'),JSON[_0xefef('0x27')](_0x110669));if(_0x16c63f[_0xefef('0x86')]['type']===_0xefef('0xbe')){return _0x598e3c['status'](_0xf54d27)[_0xefef('0x34')](_0xefef('0xbf'),_0xefef('0xc0'))[_0xefef('0x3f')]('\x0a');}else{return _0x598e3c[_0xefef('0x2f')](_0xf54d27)[_0xefef('0x30')](_0x110669);}}});})[_0xefef('0x2d')](handleError(_0x598e3c,null));};exports[_0xefef('0x3f')]=function(_0x1d7e21,_0xdfb9be,_0x2d71cf){var _0x56d5ab,_0x54288b,_0x490078;if(_[_0xefef('0xa1')](_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')])||_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')]===''){throw new db['Sequelize'][(_0xefef('0xa0'))](_0xefef('0xa2'));}if(_[_0xefef('0xa1')](_0x1d7e21[_0xefef('0x62')]['to'])){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))](_0xefef('0xc1'));}_0x56d5ab=_0x1d7e21['body']['to'];return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x1d7e21[_0xefef('0x58')]['id']},'include':[{'model':db[_0xefef('0xa6')],'as':_0xefef('0xc2'),'include':[{'model':db[_0xefef('0xad')],'as':_0xefef('0xa8'),'where':{'mobile':_0x56d5ab},'limit':0x1,'order':[[_0xefef('0x96'),'DESC']]}]}]})[_0xefef('0x22')](handleEntityNotFound(_0xdfb9be,null))[_0xefef('0x22')](function(_0x485d38){if(_0x485d38&&_0x485d38['List']){_0x54288b=_0x485d38[_0xefef('0xc3')]({'plain':!![]});if(_0x54288b[_0xefef('0xc2')]&&_0x54288b[_0xefef('0xc2')][_0xefef('0xa8')]['length']){return _0x54288b[_0xefef('0xc2')][_0xefef('0xa8')][0x0];}return db[_0xefef('0xad')][_0xefef('0x5c')](_[_0xefef('0xac')](_0x1d7e21[_0xefef('0x62')],{'firstName':_0x56d5ab,'mobile':_0x56d5ab,'phone':_0x56d5ab,'ListId':_0x54288b[_0xefef('0xa7')]}));}})['then'](handleEntityNotFound(_0xdfb9be,null))[_0xefef('0x22')](function(_0x3d0db7){if(_0x3d0db7){_0x490078=_0x3d0db7;return db[_0xefef('0xae')]['find']({'where':{'ContactId':_0x490078['id'],'closed':![],'WhatsappAccountId':_0x54288b['id']}})[_0xefef('0x22')](function(_0xc588d9){if(_0xc588d9){return[_0xc588d9,![]];}return db[_0xefef('0xae')][_0xefef('0x5c')]({'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id'],'WhatsappAccountId':_0x54288b['id'],'phone':_0x56d5ab,'firstMsgDirection':_0xefef('0xc4'),'Messages':[_[_0xefef('0x53')](_0x1d7e21[_0xefef('0x62')],{'read':![],'body':_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')],'phone':_0x56d5ab,'WhatsappAccountId':_0x54288b['id'],'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xefef('0xc5')}]})[_0xefef('0x22')](function(_0x3ca5a3){return[_0x3ca5a3,!![]];});});}})[_0xefef('0x73')](function(_0x1774e5,_0x32461f){if(_0x32461f){return _0x1774e5;}return db[_0xefef('0x8c')]['create'](_[_0xefef('0x53')](_0x1d7e21[_0xefef('0x62')],{'read':![],'body':_0x1d7e21['body'][_0xefef('0x62')],'phone':_0x56d5ab,'WhatsappAccountId':_0x54288b['id'],'WhatsappInteractionId':_0x1774e5['id'],'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id']}))[_0xefef('0x22')](function(_0x1d9050){_0x1774e5[_0xefef('0xc6')]['Messages']=[];_0x1774e5['dataValues'][_0xefef('0xc5')][_0xefef('0xb0')](_0x1d9050[_0xefef('0xc6')]);return _0x1774e5;});})[_0xefef('0x22')](respondWithResult(_0xdfb9be,null))[_0xefef('0x2d')](handleError(_0xdfb9be,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index c610c97..3305cda 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 _0xb5ae=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2bcacc,_0x5a1ef6){var _0xa0b467=function(_0x595210){while(--_0x595210){_0x2bcacc['push'](_0x2bcacc['shift']());}};_0xa0b467(++_0x5a1ef6);}(_0xb5ae,0x82));var _0xeb5a=function(_0x465478,_0x46f064){_0x465478=_0x465478-0x0;var _0x4756a2=_0xb5ae[_0x465478];return _0x4756a2;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xeb5a('0x0'))['db'][_0xeb5a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xeb5a('0x2')](0x0);var events={'afterCreate':_0xeb5a('0x3'),'afterUpdate':_0xeb5a('0x4'),'afterDestroy':_0xeb5a('0x5')};function emitEvent(_0xbd4de4){return function(_0x289977,_0x5557b0,_0x407a89){WhatsappAccountEvents[_0xeb5a('0x6')](_0xbd4de4+':'+_0x289977['id'],_0x289977);WhatsappAccountEvents['emit'](_0xbd4de4,_0x289977);_0x407a89(null);};}for(var e in events){if(events[_0xeb5a('0x7')](e)){var event=events[e];WhatsappAccount[_0xeb5a('0x8')](e,emitEvent(event));}}module[_0xeb5a('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3b3c=['emit','hasOwnProperty','exports','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x4dfe4c,_0x8050ad){var _0x11769d=function(_0x13cb76){while(--_0x13cb76){_0x4dfe4c['push'](_0x4dfe4c['shift']());}};_0x11769d(++_0x8050ad);}(_0x3b3c,0xd3));var _0xc3b3=function(_0x5b7327,_0x3da7cc){_0x5b7327=_0x5b7327-0x0;var _0x1518a1=_0x3b3c[_0x5b7327];return _0x1518a1;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xc3b3('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc3b3('0x1')](0x0);var events={'afterCreate':_0xc3b3('0x2'),'afterUpdate':_0xc3b3('0x3'),'afterDestroy':_0xc3b3('0x4')};function emitEvent(_0x7a4878){return function(_0xc10ef,_0x12b963,_0x438ff8){WhatsappAccountEvents[_0xc3b3('0x5')](_0x7a4878+':'+_0xc10ef['id'],_0xc10ef);WhatsappAccountEvents[_0xc3b3('0x5')](_0x7a4878,_0xc10ef);_0x438ff8(null);};}for(var e in events){if(events[_0xc3b3('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xc3b3('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index c558573..7dd38f4 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 _0xfe20=['util','rimraf','../../config/environment','exports','define','whatsapp_accounts','lodash'];(function(_0x3b9846,_0x27b261){var _0x523a32=function(_0x58f509){while(--_0x58f509){_0x3b9846['push'](_0x3b9846['shift']());}};_0x523a32(++_0x27b261);}(_0xfe20,0x13a));var _0x0fe2=function(_0x923ec6,_0x2571df){_0x923ec6=_0x923ec6-0x0;var _0x114f98=_0xfe20[_0x923ec6];return _0x114f98;};'use strict';var _=require(_0x0fe2('0x0'));var util=require(_0x0fe2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fe2('0x2'));var config=require(_0x0fe2('0x3'));var attributes=require('./whatsappAccount.attributes');module[_0x0fe2('0x4')]=function(_0x4e94de,_0x1072f6){return _0x4e94de[_0x0fe2('0x5')]('WhatsappAccount',attributes,{'tableName':_0x0fe2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a8a=['rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','api','moment','bluebird','path'];(function(_0x1b1dd4,_0x17fd4c){var _0x1a248b=function(_0x4dc972){while(--_0x4dc972){_0x1b1dd4['push'](_0x1b1dd4['shift']());}};_0x1a248b(++_0x17fd4c);}(_0x9a8a,0x17f));var _0xa9a8=function(_0x3c41e8,_0x1bb0ce){_0x3c41e8=_0x3c41e8-0x0;var _0x546c75=_0x9a8a[_0x3c41e8];return _0x546c75;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa9a8('0x0'));var moment=require(_0xa9a8('0x1'));var BPromise=require(_0xa9a8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9a8('0x3'));var rimraf=require(_0xa9a8('0x4'));var config=require('../../config/environment');var attributes=require(_0xa9a8('0x5'));module['exports']=function(_0x2859c6,_0x142a52){return _0x2859c6[_0xa9a8('0x6')](_0xa9a8('0x7'),attributes,{'tableName':_0xa9a8('0x8'),'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 932279f..dc9bba5 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 _0x3a65=['redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','WhatsappAccount','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a65,0x124));var _0x53a6=function(_0x227bff,_0x4196e5){_0x227bff=_0x227bff-0x0;var _0x45f679=_0x3a65[_0x227bff];return _0x45f679;};'use strict';var _=require(_0x53a6('0x0'));var util=require(_0x53a6('0x1'));var moment=require(_0x53a6('0x2'));var BPromise=require(_0x53a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53a6('0x4'));var db=require(_0x53a6('0x5'))['db'];var utils=require(_0x53a6('0x6'));var logger=require(_0x53a6('0x7'))(_0x53a6('0x8'));var config=require(_0x53a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x53a6('0xa')][_0x53a6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x53a6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x53a6('0xd'))(new Redis(config[_0x53a6('0xc')]));require(_0x53a6('0xe'))[_0x53a6('0xf')](socket);function respondWithRpcPromise(_0x301315,_0x497f65,_0x4dcbcc){return new BPromise(function(_0x5620df,_0x3b5e7d){return client[_0x53a6('0x10')](_0x301315,_0x4dcbcc)[_0x53a6('0x11')](function(_0x4d66b3){logger[_0x53a6('0x12')](_0x53a6('0x13'),_0x497f65,_0x53a6('0x14'));logger['debug'](_0x53a6('0x15'),_0x497f65,_0x53a6('0x14'),JSON['stringify'](_0x4d66b3));if(_0x4d66b3['error']){if(_0x4d66b3[_0x53a6('0x16')][_0x53a6('0x17')]===0x1f4){logger[_0x53a6('0x16')](_0x53a6('0x13'),_0x497f65,_0x4d66b3['error'][_0x53a6('0x18')]);return _0x3b5e7d(_0x4d66b3['error'][_0x53a6('0x18')]);}logger[_0x53a6('0x16')](_0x53a6('0x13'),_0x497f65,_0x4d66b3['error'][_0x53a6('0x18')]);return _0x5620df(_0x4d66b3[_0x53a6('0x16')][_0x53a6('0x18')]);}else{logger[_0x53a6('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x497f65,'request\x20sent');_0x5620df(_0x4d66b3[_0x53a6('0x19')][_0x53a6('0x18')]);}})['catch'](function(_0x15a06d){logger[_0x53a6('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x497f65,_0x15a06d);_0x3b5e7d(_0x15a06d);});});}exports['ShowWhatsappAccount']=function(_0x1dcae1){var _0x36b603=this;return new Promise(function(_0x1ce75f,_0x16ce97){return db[_0x53a6('0x1a')]['find']({'raw':_0x1dcae1[_0x53a6('0x1b')]?_0x1dcae1[_0x53a6('0x1b')][_0x53a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1dcae1[_0x53a6('0x1b')]?_0x1dcae1[_0x53a6('0x1b')][_0x53a6('0x1d')]||null:null,'attributes':_0x1dcae1[_0x53a6('0x1b')]?_0x1dcae1[_0x53a6('0x1b')][_0x53a6('0x1e')]||null:null,'include':_0x1dcae1[_0x53a6('0x1b')]?_0x1dcae1[_0x53a6('0x1b')][_0x53a6('0x1f')]?_[_0x53a6('0x20')](_0x1dcae1[_0x53a6('0x1b')][_0x53a6('0x1f')],function(_0x109679){return{'model':db[_0x109679[_0x53a6('0x21')]],'as':_0x109679['as'],'attributes':_0x109679['attributes'],'include':_0x109679[_0x53a6('0x1f')]?_[_0x53a6('0x20')](_0x109679[_0x53a6('0x1f')],function(_0x3518f5){return{'model':db[_0x3518f5[_0x53a6('0x21')]],'as':_0x3518f5['as'],'attributes':_0x3518f5['attributes'],'include':_0x3518f5[_0x53a6('0x1f')]?_['map'](_0x3518f5[_0x53a6('0x1f')],function(_0x5a2bf9){return{'model':db[_0x5a2bf9[_0x53a6('0x21')]],'as':_0x5a2bf9['as'],'attributes':_0x5a2bf9[_0x53a6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x53a6('0x11')](function(_0xa645f){logger[_0x53a6('0x12')](_0x53a6('0x22'),_0x1dcae1);logger[_0x53a6('0x23')](_0x53a6('0x22'),_0x1dcae1,JSON[_0x53a6('0x24')](_0xa645f));_0x1ce75f(_0xa645f);})[_0x53a6('0x25')](function(_0xe2f1f1){logger['error'](_0x53a6('0x22'),_0xe2f1f1[_0x53a6('0x18')],_0x1dcae1);_0x16ce97(_0x36b603[_0x53a6('0x16')](0x1f4,_0xe2f1f1[_0x53a6('0x18')]));});});}; \ No newline at end of file +var _0x6157=['find','options','raw','attributes','map','model','include','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount'];(function(_0x52ab62,_0x203d25){var _0x42f499=function(_0x56adfd){while(--_0x56adfd){_0x52ab62['push'](_0x52ab62['shift']());}};_0x42f499(++_0x203d25);}(_0x6157,0x1a0));var _0x7615=function(_0x159330,_0x514203){_0x159330=_0x159330-0x0;var _0x1f5698=_0x6157[_0x159330];return _0x1f5698;};'use strict';var _=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var moment=require('moment');var BPromise=require(_0x7615('0x2'));var rs=require(_0x7615('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7615('0x4'))['db'];var utils=require(_0x7615('0x5'));var logger=require(_0x7615('0x6'))(_0x7615('0x7'));var config=require(_0x7615('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7615('0x9')](config[_0x7615('0xa')],{'host':_0x7615('0xb'),'port':0x18eb});var socket=require(_0x7615('0xc'))(new Redis(config[_0x7615('0xa')]));require('./whatsappAccount.socket')[_0x7615('0xd')](socket);function respondWithRpcPromise(_0x1b97ec,_0x551add,_0x167b04){return new BPromise(function(_0x4e4374,_0x1574de){return client['request'](_0x1b97ec,_0x167b04)['then'](function(_0x3a5b3d){logger['info'](_0x7615('0xe'),_0x551add,_0x7615('0xf'));logger[_0x7615('0x10')](_0x7615('0x11'),_0x551add,_0x7615('0xf'),JSON[_0x7615('0x12')](_0x3a5b3d));if(_0x3a5b3d[_0x7615('0x13')]){if(_0x3a5b3d[_0x7615('0x13')]['code']===0x1f4){logger['error'](_0x7615('0xe'),_0x551add,_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);return _0x1574de(_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);}logger[_0x7615('0x13')](_0x7615('0xe'),_0x551add,_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);return _0x4e4374(_0x3a5b3d[_0x7615('0x13')]['message']);}else{logger[_0x7615('0x15')](_0x7615('0xe'),_0x551add,_0x7615('0xf'));_0x4e4374(_0x3a5b3d[_0x7615('0x16')]['message']);}})[_0x7615('0x17')](function(_0x45290e){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x551add,_0x45290e);_0x1574de(_0x45290e);});});}exports[_0x7615('0x18')]=function(_0x31409a){var _0x573fb7=this;return new Promise(function(_0x126e75,_0x263c2b){return db[_0x7615('0x19')][_0x7615('0x1a')]({'raw':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')][_0x7615('0x1c')]===undefined?!![]:![]:!![],'where':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')]['where']||null:null,'attributes':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')][_0x7615('0x1d')]||null:null,'include':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')]['include']?_[_0x7615('0x1e')](_0x31409a[_0x7615('0x1b')]['include'],function(_0x154543){return{'model':db[_0x154543[_0x7615('0x1f')]],'as':_0x154543['as'],'attributes':_0x154543['attributes'],'include':_0x154543[_0x7615('0x20')]?_[_0x7615('0x1e')](_0x154543[_0x7615('0x20')],function(_0x2b7f9d){return{'model':db[_0x2b7f9d[_0x7615('0x1f')]],'as':_0x2b7f9d['as'],'attributes':_0x2b7f9d['attributes'],'include':_0x2b7f9d[_0x7615('0x20')]?_[_0x7615('0x1e')](_0x2b7f9d['include'],function(_0x2757d1){return{'model':db[_0x2757d1[_0x7615('0x1f')]],'as':_0x2757d1['as'],'attributes':_0x2757d1[_0x7615('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7615('0x21')](function(_0x491d80){logger[_0x7615('0x15')](_0x7615('0x18'),_0x31409a);logger['debug'](_0x7615('0x18'),_0x31409a,JSON[_0x7615('0x12')](_0x491d80));_0x126e75(_0x491d80);})[_0x7615('0x17')](function(_0x15f231){logger[_0x7615('0x13')](_0x7615('0x18'),_0x15f231[_0x7615('0x14')],_0x31409a);_0x263c2b(_0x573fb7[_0x7615('0x13')](0x1f4,_0x15f231[_0x7615('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7e069f0..359a71c 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 _0x22ea=['./whatsappAccount.events','save','remove','emit','removeListener','register','whatsappAccount:'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0x22ea,0x15e));var _0xa22e=function(_0x2a314d,_0xb3d629){_0x2a314d=_0x2a314d-0x0;var _0x3d3e20=_0x22ea[_0x2a314d];return _0x3d3e20;};'use strict';var WhatsappAccountEvents=require(_0xa22e('0x0'));var events=[_0xa22e('0x1'),_0xa22e('0x2'),'update'];function createListener(_0x313e7c,_0x15b8f0){return function(_0x45b837){_0x15b8f0[_0xa22e('0x3')](_0x313e7c,_0x45b837);};}function removeListener(_0x3f60b4,_0x53b7ac){return function(){WhatsappAccountEvents[_0xa22e('0x4')](_0x3f60b4,_0x53b7ac);};}exports[_0xa22e('0x5')]=function(_0x3404b6){for(var _0x7f11d1=0x0,_0x4ced72=events['length'];_0x7f11d1<_0x4ced72;_0x7f11d1++){var _0x3b863f=events[_0x7f11d1];var _0x508da4=createListener(_0xa22e('0x6')+_0x3b863f,_0x3404b6);WhatsappAccountEvents['on'](_0x3b863f,_0x508da4);}}; \ No newline at end of file +var _0x35a4=['removeListener','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x5820f6,_0x543488){var _0x7c8fec=function(_0x5e2e4d){while(--_0x5e2e4d){_0x5820f6['push'](_0x5820f6['shift']());}};_0x7c8fec(++_0x543488);}(_0x35a4,0x128));var _0x435a=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x35a4[_0x680821];return _0x3f132c;};'use strict';var WhatsappAccountEvents=require(_0x435a('0x0'));var events=[_0x435a('0x1'),_0x435a('0x2'),_0x435a('0x3')];function createListener(_0xf8f056,_0x1dfc89){return function(_0x51153a){_0x1dfc89[_0x435a('0x4')](_0xf8f056,_0x51153a);};}function removeListener(_0x1e63b0,_0x201a1b){return function(){WhatsappAccountEvents[_0x435a('0x5')](_0x1e63b0,_0x201a1b);};}exports['register']=function(_0x22f8e6){for(var _0x511bba=0x0,_0x565e9f=events['length'];_0x511bba<_0x565e9f;_0x511bba++){var _0xccebb6=events[_0x511bba];var _0x6ce798=createListener(_0x435a('0x6')+_0xccebb6,_0x22f8e6);WhatsappAccountEvents['on'](_0xccebb6,_0x6ce798);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 0318968..ad0c9bb 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 _0x7e91=['isAuthenticated','get','show','post','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7e91,0x14b));var _0x17e9=function(_0x99462b,_0x5135dd){_0x99462b=_0x99462b-0x0;var _0x4e8a47=_0x7e91[_0x99462b];return _0x4e8a47;};'use strict';var multer=require('multer');var util=require(_0x17e9('0x0'));var path=require(_0x17e9('0x1'));var timeout=require(_0x17e9('0x2'));var express=require(_0x17e9('0x3'));var router=express[_0x17e9('0x4')]();var fs_extra=require(_0x17e9('0x5'));var auth=require(_0x17e9('0x6'));var interaction=require(_0x17e9('0x7'));var config=require(_0x17e9('0x8'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x17e9('0x9')](),controller['index']);router[_0x17e9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x17e9('0xb')]);router[_0x17e9('0xc')]('/',auth[_0x17e9('0x9')](),controller['create']);router[_0x17e9('0xd')](_0x17e9('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x17e9('0xf')](_0x17e9('0xe'),auth[_0x17e9('0x9')](),controller[_0x17e9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc701=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x20552b,_0x13b1b8){var _0x3b0b6e=function(_0x293f01){while(--_0x293f01){_0x20552b['push'](_0x20552b['shift']());}};_0x3b0b6e(++_0x13b1b8);}(_0xc701,0x159));var _0x1c70=function(_0x1427e2,_0x5a60ba){_0x1427e2=_0x1427e2-0x0;var _0x3b2772=_0xc701[_0x1427e2];return _0x3b2772;};'use strict';var multer=require(_0x1c70('0x0'));var util=require(_0x1c70('0x1'));var path=require(_0x1c70('0x2'));var timeout=require(_0x1c70('0x3'));var express=require(_0x1c70('0x4'));var router=express[_0x1c70('0x5')]();var fs_extra=require(_0x1c70('0x6'));var auth=require(_0x1c70('0x7'));var interaction=require(_0x1c70('0x8'));var config=require(_0x1c70('0x9'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x1c70('0xa')](),controller[_0x1c70('0xb')]);router[_0x1c70('0xc')](_0x1c70('0xd'),auth[_0x1c70('0xa')](),controller[_0x1c70('0xe')]);router[_0x1c70('0xf')]('/',auth[_0x1c70('0xa')](),controller[_0x1c70('0x10')]);router['put']('/:id',auth[_0x1c70('0xa')](),controller[_0x1c70('0x11')]);router['delete'](_0x1c70('0xd'),auth[_0x1c70('0xa')](),controller[_0x1c70('0x12')]);module[_0x1c70('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index fca8611..707a1e7 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 _0x0d98=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x0d98,0x106));var _0x80d9=function(_0x48859a,_0x2716d0){_0x48859a=_0x48859a-0x0;var _0x57004e=_0x0d98[_0x48859a];return _0x57004e;};'use strict';var Sequelize=require(_0x80d9('0x0'));module[_0x80d9('0x1')]={'priority':{'type':Sequelize[_0x80d9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x80d9('0x3')],'allowNull':![],'defaultValue':_0x80d9('0x4')},'appdata':{'type':Sequelize[_0x80d9('0x5')]()},'description':{'type':Sequelize[_0x80d9('0x3')]},'interval':{'type':Sequelize[_0x80d9('0x3')],'defaultValue':_0x80d9('0x6')}}; \ No newline at end of file +var _0xa860=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x19ecaa,_0x48a0ff){var _0x473fa2=function(_0x36881c){while(--_0x36881c){_0x19ecaa['push'](_0x19ecaa['shift']());}};_0x473fa2(++_0x48a0ff);}(_0xa860,0x1b2));var _0x0a86=function(_0x3c3569,_0x5b54bf){_0x3c3569=_0x3c3569-0x0;var _0x23d45e=_0xa860[_0x3c3569];return _0x23d45e;};'use strict';var Sequelize=require(_0x0a86('0x0'));module[_0x0a86('0x1')]={'priority':{'type':Sequelize[_0x0a86('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a86('0x3')},'appdata':{'type':Sequelize[_0x0a86('0x4')]()},'description':{'type':Sequelize[_0x0a86('0x5')]},'interval':{'type':Sequelize[_0x0a86('0x5')],'defaultValue':_0x0a86('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 05157c2..beedcab 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 _0xc891=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','WhatsappApplication','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','eml-format','fast-json-patch'];(function(_0xea9ad7,_0x212dfc){var _0x20b99b=function(_0x598970){while(--_0x598970){_0xea9ad7['push'](_0xea9ad7['shift']());}};_0x20b99b(++_0x212dfc);}(_0xc891,0x152));var _0x1c89=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc891[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['WhatsappApplication']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['WhatsappApplication'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['WhatsappApplication'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));}; \ No newline at end of file +var _0x1241=['key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','reject','update','then','destroy','end','error','stack','name','send','index','WhatsappApplication','fieldName','type'];(function(_0x132152,_0x364966){var _0x518966=function(_0x340ba0){while(--_0x340ba0){_0x132152['push'](_0x132152['shift']());}};_0x518966(++_0x364966);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1124('0x1'));var jsonpatch=require(_0x1124('0x2'));var rp=require(_0x1124('0x3'));var moment=require(_0x1124('0x4'));var BPromise=require(_0x1124('0x5'));var Mustache=require('mustache');var util=require(_0x1124('0x6'));var path=require(_0x1124('0x7'));var sox=require(_0x1124('0x8'));var csv=require('to-csv');var ejs=require(_0x1124('0x9'));var fs=require('fs');var fs_extra=require(_0x1124('0xa'));var _=require(_0x1124('0xb'));var squel=require(_0x1124('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1124('0xd'));var querystring=require('querystring');var Papa=require(_0x1124('0xe'));var Redis=require(_0x1124('0xf'));var authService=require(_0x1124('0x10'));var qs=require(_0x1124('0x11'));var as=require(_0x1124('0x12'));var hardwareService=require(_0x1124('0x13'));var logger=require('../../config/logger')(_0x1124('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1124('0x15'))['db'];function respondWithStatusCode(_0x480e39,_0x548734){_0x548734=_0x548734||0xcc;return function(_0x249f75){if(_0x249f75){return _0x480e39[_0x1124('0x16')](_0x548734);}return _0x480e39[_0x1124('0x17')](_0x548734)['end']();};}function respondWithResult(_0x227291,_0x109f00){_0x109f00=_0x109f00||0xc8;return function(_0xb7e22b){if(_0xb7e22b){return _0x227291[_0x1124('0x17')](_0x109f00)['json'](_0xb7e22b);}};}function respondWithFilteredResult(_0x12ea42,_0x3d040d){return function(_0x2a8271){if(_0x2a8271){var _0x74a148=typeof _0x3d040d[_0x1124('0x18')]===_0x1124('0x19')&&typeof _0x3d040d[_0x1124('0x1a')]===_0x1124('0x19');var _0x3eed9d=_0x2a8271['count'];var _0x5e7506=_0x74a148?0x0:_0x3d040d[_0x1124('0x18')];var _0x55d2e3=_0x74a148?_0x2a8271['count']:_0x3d040d[_0x1124('0x18')]+_0x3d040d[_0x1124('0x1a')];var _0x392bc7;if(_0x55d2e3>=_0x3eed9d){_0x55d2e3=_0x3eed9d;_0x392bc7=0xc8;}else{_0x392bc7=0xce;}_0x12ea42[_0x1124('0x17')](_0x392bc7);return _0x12ea42[_0x1124('0x1b')]('Content-Range',_0x5e7506+'-'+_0x55d2e3+'/'+_0x3eed9d)[_0x1124('0x1c')](_0x2a8271);}return null;};}function patchUpdates(_0x19639a){return function(_0x8c1d68){try{jsonpatch['apply'](_0x8c1d68,_0x19639a,!![]);}catch(_0x4edfa8){return BPromise[_0x1124('0x1d')](_0x4edfa8);}return _0x8c1d68['save']();};}function saveUpdates(_0x294201,_0x48a548){return function(_0x32ad7a){if(_0x32ad7a){return _0x32ad7a[_0x1124('0x1e')](_0x294201)[_0x1124('0x1f')](function(_0xe5854f){return _0xe5854f;});}return null;};}function removeEntity(_0x3078c4,_0x3e98a7){return function(_0x94dc0b){if(_0x94dc0b){return _0x94dc0b[_0x1124('0x20')]()[_0x1124('0x1f')](function(){_0x3078c4[_0x1124('0x17')](0xcc)[_0x1124('0x21')]();});}};}function handleEntityNotFound(_0x4ff6e6,_0x5eb15f){return function(_0x1909fc){if(!_0x1909fc){_0x4ff6e6[_0x1124('0x16')](0x194);}return _0x1909fc;};}function handleError(_0x4c5299,_0xd91727){_0xd91727=_0xd91727||0x1f4;return function(_0x54cf47){logger[_0x1124('0x22')](_0x54cf47[_0x1124('0x23')]);if(_0x54cf47['name']){delete _0x54cf47[_0x1124('0x24')];}_0x4c5299[_0x1124('0x17')](_0xd91727)[_0x1124('0x25')](_0x54cf47);};}exports[_0x1124('0x26')]=function(_0x351ca9,_0x4d36e1){var _0x462825={},_0x38dddd={},_0x5b876f={'count':0x0,'rows':[]};var _0x5dac66=_['map'](db[_0x1124('0x27')]['rawAttributes'],function(_0x2227ac){return{'name':_0x2227ac[_0x1124('0x28')],'type':_0x2227ac[_0x1124('0x29')][_0x1124('0x2a')]};});_0x38dddd[_0x1124('0x2b')]=_[_0x1124('0x2c')](_0x5dac66,_0x1124('0x24'));_0x38dddd['query']=_[_0x1124('0x2d')](_0x351ca9[_0x1124('0x2e')]);_0x38dddd['filters']=_[_0x1124('0x2f')](_0x38dddd['model'],_0x38dddd[_0x1124('0x2e')]);_0x462825[_0x1124('0x30')]=_[_0x1124('0x2f')](_0x38dddd['model'],qs['fields'](_0x351ca9[_0x1124('0x2e')][_0x1124('0x31')]));_0x462825[_0x1124('0x30')]=_0x462825[_0x1124('0x30')][_0x1124('0x32')]?_0x462825[_0x1124('0x30')]:_0x38dddd[_0x1124('0x2b')];if(!_0x351ca9['query'][_0x1124('0x33')](_0x1124('0x34'))){_0x462825[_0x1124('0x1a')]=qs[_0x1124('0x1a')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x1a')]);_0x462825[_0x1124('0x18')]=qs[_0x1124('0x18')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x18')]);}_0x462825[_0x1124('0x35')]=qs[_0x1124('0x36')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x36')]);_0x462825[_0x1124('0x37')]=qs['filters'](_[_0x1124('0x38')](_0x351ca9['query'],_0x38dddd['filters']),_0x5dac66);if(_0x351ca9[_0x1124('0x2e')]['filter']){_0x462825[_0x1124('0x37')]=_[_0x1124('0x39')](_0x462825[_0x1124('0x37')],{'$or':_[_0x1124('0x2c')](_0x5dac66,function(_0xf1414a){if(_0xf1414a[_0x1124('0x29')]!==_0x1124('0x3a')){var _0x450a96={};_0x450a96[_0xf1414a['name']]={'$like':'%'+_0x351ca9[_0x1124('0x2e')][_0x1124('0x3b')]+'%'};return _0x450a96;}})});}_0x462825=_[_0x1124('0x39')]({},_0x462825,_0x351ca9[_0x1124('0x3c')]);var _0x2362d1={'where':_0x462825['where']};return db['WhatsappApplication']['count'](_0x2362d1)[_0x1124('0x1f')](function(_0x34722d){_0x5b876f[_0x1124('0x3d')]=_0x34722d;if(_0x351ca9['query'][_0x1124('0x3e')]){_0x462825[_0x1124('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x1124('0x40')](_0x462825);})[_0x1124('0x1f')](function(_0x1a3af7){_0x5b876f[_0x1124('0x41')]=_0x1a3af7;return _0x5b876f;})['then'](respondWithFilteredResult(_0x4d36e1,_0x462825))[_0x1124('0x42')](handleError(_0x4d36e1,null));};exports[_0x1124('0x43')]=function(_0x22bdbf,_0x1d508c){var _0x22c2ed={'raw':!![],'where':{'id':_0x22bdbf[_0x1124('0x44')]['id']}},_0x365328={};_0x365328[_0x1124('0x2b')]=_[_0x1124('0x2d')](db[_0x1124('0x27')][_0x1124('0x45')]);_0x365328[_0x1124('0x2e')]=_[_0x1124('0x2d')](_0x22bdbf[_0x1124('0x2e')]);_0x365328[_0x1124('0x46')]=_[_0x1124('0x2f')](_0x365328['model'],_0x365328[_0x1124('0x2e')]);_0x22c2ed[_0x1124('0x30')]=_[_0x1124('0x2f')](_0x365328[_0x1124('0x2b')],qs[_0x1124('0x31')](_0x22bdbf[_0x1124('0x2e')][_0x1124('0x31')]));_0x22c2ed[_0x1124('0x30')]=_0x22c2ed[_0x1124('0x30')]['length']?_0x22c2ed[_0x1124('0x30')]:_0x365328['model'];if(_0x22bdbf[_0x1124('0x2e')][_0x1124('0x3e')]){_0x22c2ed['include']=[{'all':!![]}];}_0x22c2ed=_[_0x1124('0x39')]({},_0x22c2ed,_0x22bdbf[_0x1124('0x3c')]);return db[_0x1124('0x27')][_0x1124('0x47')](_0x22c2ed)[_0x1124('0x1f')](handleEntityNotFound(_0x1d508c,null))[_0x1124('0x1f')](respondWithResult(_0x1d508c,null))[_0x1124('0x42')](handleError(_0x1d508c,null));};exports[_0x1124('0x48')]=function(_0xbe24f5,_0x23896b){return db[_0x1124('0x27')]['create'](_0xbe24f5[_0x1124('0x49')],{})['then'](respondWithResult(_0x23896b,0xc9))[_0x1124('0x42')](handleError(_0x23896b,null));};exports[_0x1124('0x1e')]=function(_0x36f9fc,_0x236fee){if(_0x36f9fc[_0x1124('0x49')]['id']){delete _0x36f9fc['body']['id'];}return db[_0x1124('0x27')]['find']({'where':{'id':_0x36f9fc['params']['id']}})[_0x1124('0x1f')](handleEntityNotFound(_0x236fee,null))[_0x1124('0x1f')](saveUpdates(_0x36f9fc['body'],null))[_0x1124('0x1f')](respondWithResult(_0x236fee,null))[_0x1124('0x42')](handleError(_0x236fee,null));};exports['destroy']=function(_0x3ced54,_0x4a4adb){return db['WhatsappApplication']['find']({'where':{'id':_0x3ced54['params']['id']}})[_0x1124('0x1f')](handleEntityNotFound(_0x4a4adb,null))[_0x1124('0x1f')](removeEntity(_0x4a4adb,null))[_0x1124('0x42')](handleError(_0x4a4adb,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5a72e82..aa1b77c 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 _0xe644=['bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x436215,_0x496ed5){var _0x63694b=function(_0x504459){while(--_0x504459){_0x436215['push'](_0x436215['shift']());}};_0x63694b(++_0x496ed5);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4e64('0xd')});}; \ No newline at end of file +var _0x0689=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x58b860,_0x41cc53){var _0x1fc128=function(_0x2c67a4){while(--_0x2c67a4){_0x58b860['push'](_0x58b860['shift']());}};_0x1fc128(++_0x41cc53);}(_0x0689,0x161));var _0x9068=function(_0x38aa55,_0x527d35){_0x38aa55=_0x38aa55-0x0;var _0x4e951f=_0x0689[_0x38aa55];return _0x4e951f;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9068('0xb'),'collate':_0x9068('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 672e07a..1184dff 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 _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x1ae34b,_0x2db19d){var _0x5f3007=function(_0x54fa48){while(--_0x54fa48){_0x1ae34b['push'](_0x1ae34b['shift']());}};_0x5f3007(++_0x2db19d);}(_0xa8a8,0xec));var _0x8a8a=function(_0x679cf9,_0x193944){_0x679cf9=_0x679cf9-0x0;var _0x15274=_0xa8a8[_0x679cf9];return _0x15274;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file +var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x584fab,_0x5e818c){var _0x2f1330=function(_0x381ffd){while(--_0x381ffd){_0x584fab['push'](_0x584fab['shift']());}};_0x2f1330(++_0x5e818c);}(_0xfd28,0x148));var _0x8fd2=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xfd28[_0xe45118];return _0x15e15d;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 01e52f9..5e6c5af 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 _0x41fe=['addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','download','post','create','/:id/messages'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x41fe,0xd1));var _0xe41f=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x41fe[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var path=require(_0xe41f('0x2'));var timeout=require(_0xe41f('0x3'));var express=require(_0xe41f('0x4'));var router=express[_0xe41f('0x5')]();var fs_extra=require(_0xe41f('0x6'));var auth=require(_0xe41f('0x7'));var interaction=require(_0xe41f('0x8'));var config=require(_0xe41f('0x9'));var controller=require(_0xe41f('0xa'));router[_0xe41f('0xb')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0xd')]);router[_0xe41f('0xb')](_0xe41f('0xe'),auth[_0xe41f('0xc')](),controller['describe']);router[_0xe41f('0xb')](_0xe41f('0xf'),auth['isAuthenticated'](),controller[_0xe41f('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xe41f('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xe41f('0x12')]);router[_0xe41f('0x13')]('/',auth[_0xe41f('0xc')](),controller[_0xe41f('0x14')]);router[_0xe41f('0x13')](_0xe41f('0x15'),auth[_0xe41f('0xc')](),controller[_0xe41f('0x16')]);router[_0xe41f('0x13')](_0xe41f('0x17'),auth['isAuthenticated'](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),'whatsappinteraction:addtags'),controller[_0xe41f('0x1a')]);router[_0xe41f('0x1b')](_0xe41f('0xf'),auth[_0xe41f('0xc')](),interaction[_0xe41f('0x18')](_0xe41f('0x19'),_0xe41f('0x1c')),controller['update']);router['delete'](_0xe41f('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0xe41f('0x19'),_0xe41f('0x1d')),controller[_0xe41f('0x1e')]);router[_0xe41f('0x1f')](_0xe41f('0x17'),auth['isAuthenticated'](),controller[_0xe41f('0x20')]);module['exports']=router; \ No newline at end of file +var _0x44e8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','connect-timeout'];(function(_0x56928f,_0x229473){var _0x159b5d=function(_0x8ef81){while(--_0x8ef81){_0x56928f['push'](_0x56928f['shift']());}};_0x159b5d(++_0x229473);}(_0x44e8,0xd7));var _0x844e=function(_0x2c5f53,_0x108035){_0x2c5f53=_0x2c5f53-0x0;var _0x38c7fb=_0x44e8[_0x2c5f53];return _0x38c7fb;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0x8')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0xf')]);router[_0x844e('0x8')](_0x844e('0x10'),auth[_0x844e('0xb')](),controller[_0x844e('0x11')]);router[_0x844e('0x12')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0x12')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0x13')]);router[_0x844e('0x12')]('/:id/tags',auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),'whatsappinteraction:addtags'),controller[_0x844e('0x16')]);router[_0x844e('0x17')](_0x844e('0xc'),auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),_0x844e('0x18')),controller[_0x844e('0x19')]);router['delete'](_0x844e('0xc'),auth['isAuthenticated'](),interaction[_0x844e('0x14')]('whatsapp',_0x844e('0x1a')),controller['destroy']);router[_0x844e('0x1b')](_0x844e('0x1c'),auth[_0x844e('0xb')](),controller[_0x844e('0x1d')]);module[_0x844e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index ddea44c..66596f5 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 _0xece0=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x3bf7a5,_0x23a328){var _0x12bf98=function(_0x4bfc41){while(--_0x4bfc41){_0x3bf7a5['push'](_0x3bf7a5['shift']());}};_0x12bf98(++_0x23a328);}(_0xece0,0xa5));var _0x0ece=function(_0x37365a,_0x526806){_0x37365a=_0x37365a-0x0;var _0x19591a=_0xece0[_0x37365a];return _0x19591a;};'use strict';var Sequelize=require(_0x0ece('0x0'));var moment=require(_0x0ece('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0ece('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0ece('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0ece('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0ece('0x4')]},'note':{'type':Sequelize[_0x0ece('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0ece('0x5')]('in',_0x0ece('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0ece('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0ece('0x5')]('in',_0x0ece('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0ece('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb76d=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb76d,0x119));var _0xdb76=function(_0x11b2ae,_0x5c5f90){_0x11b2ae=_0x11b2ae-0x0;var _0x75ad9e=_0xb76d[_0x11b2ae];return _0x75ad9e;};'use strict';var Sequelize=require(_0xdb76('0x0'));var moment=require('moment');module[_0xdb76('0x1')]={'closed':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdb76('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdb76('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdb76('0x4')]},'note':{'type':Sequelize[_0xdb76('0x4')]},'phone':{'type':Sequelize[_0xdb76('0x4')]},'read1stAt':{'type':Sequelize[_0xdb76('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdb76('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in',_0xdb76('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 19d1c19..e9e7d17 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 _0x5690=['type','getOptions','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','ids','omit','findOne','WhatsappMessage','hasOwnProperty','order','sort','pick','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','lastName','Attachment','Messages','secret','read','WhatsappAccount','Account','fullname','get','mkdirSync','Whatsapp','Owner','N.A.','createdAt','disposition','basename','createWriteStream','out','System','firstName','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','err','rimraf','zip-dir','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','destroy','then','end','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName'];(function(_0x5c1d89,_0x527fdb){var _0xabaf1b=function(_0x814fbf){while(--_0x814fbf){_0x5c1d89['push'](_0x5c1d89['shift']());}};_0xabaf1b(++_0x527fdb);}(_0x5690,0x14e));var _0x0569=function(_0x65cd03,_0x2913ee){_0x65cd03=_0x65cd03-0x0;var _0x21c579=_0x5690[_0x65cd03];return _0x21c579;};'use strict';var rimraf=require(_0x0569('0x0'));var zipdir=require(_0x0569('0x1'));var moment=require('moment');var BPromise=require(_0x0569('0x2'));var util=require(_0x0569('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0569('0x4'));var Redis=require(_0x0569('0x5'));var interaction=require(_0x0569('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x0569('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x0569('0x8'));var db=require(_0x0569('0x9'))['db'];config[_0x0569('0xa')]=_['defaults'](config[_0x0569('0xa')],{'host':_0x0569('0xb'),'port':0x18eb});var socket=require(_0x0569('0xc'))(new Redis(config[_0x0569('0xa')]));require(_0x0569('0xd'))[_0x0569('0xe')](socket);function respondWithStatusCode(_0x31d7c5,_0x4aa938){_0x4aa938=_0x4aa938||0xcc;return function(_0x2f971e){if(_0x2f971e){return _0x31d7c5[_0x0569('0xf')](_0x4aa938);}return _0x31d7c5[_0x0569('0x10')](_0x4aa938)['end']();};}function respondWithResult(_0xa17cd0,_0xb2eaff){_0xb2eaff=_0xb2eaff||0xc8;return function(_0x3eae58){if(_0x3eae58){return _0xa17cd0['status'](_0xb2eaff)[_0x0569('0x11')](_0x3eae58);}};}function respondWithFilteredResult(_0x264c01,_0x553785){return function(_0xc4c1b8){if(_0xc4c1b8){var _0x193809=typeof _0x553785['offset']===_0x0569('0x12')&&typeof _0x553785[_0x0569('0x13')]===_0x0569('0x12');var _0x556bbe=_0xc4c1b8[_0x0569('0x14')];var _0x167440=_0x193809?0x0:_0x553785['offset'];var _0x5b7d6c=_0x193809?_0xc4c1b8['count']:_0x553785[_0x0569('0x15')]+_0x553785[_0x0569('0x13')];var _0x360856;if(_0x5b7d6c>=_0x556bbe){_0x5b7d6c=_0x556bbe;_0x360856=0xc8;}else{_0x360856=0xce;}_0x264c01[_0x0569('0x10')](_0x360856);return _0x264c01[_0x0569('0x16')](_0x0569('0x17'),_0x167440+'-'+_0x5b7d6c+'/'+_0x556bbe)[_0x0569('0x11')](_0xc4c1b8);}return null;};}function saveUpdates(_0x579262){return function(_0x369253){if(_0x369253){return _0x369253['update'](_0x579262)['then'](function(_0x114c0d){return _0x114c0d;});}return null;};}function removeEntity(_0x3b43f2){return function(_0x42e545){if(_0x42e545){return _0x42e545[_0x0569('0x18')]()[_0x0569('0x19')](function(){_0x3b43f2[_0x0569('0x10')](0xcc)[_0x0569('0x1a')]();});}};}function handleEntityNotFound(_0x312f9c){return function(_0x1db584){if(!_0x1db584){_0x312f9c['sendStatus'](0x194);}return _0x1db584;};}function handleError(_0x4f8f3b,_0x25d270){_0x25d270=_0x25d270||0x1f4;return function(_0x11675b){logger[_0x0569('0x1b')](_0x11675b[_0x0569('0x1c')]);if(_0x11675b[_0x0569('0x1d')]){delete _0x11675b[_0x0569('0x1d')];}_0x4f8f3b[_0x0569('0x10')](_0x25d270)[_0x0569('0x1e')](_0x11675b);};}exports['index']=function(_0x28a0e4,_0x329308){var _0x42ddb0={};var _0x8697a0=_[_0x0569('0x1f')](db[_0x0569('0x20')][_0x0569('0x21')],function(_0x1ee6e3){return{'name':_0x1ee6e3[_0x0569('0x22')],'type':_0x1ee6e3[_0x0569('0x23')]['key']};});_0x42ddb0=qs[_0x0569('0x24')](_0x8697a0,_0x28a0e4);return interaction['findAll'](_0x0569('0x25'),_0x28a0e4[_0x0569('0x26')],_0x28a0e4[_0x0569('0x27')],_0x42ddb0,_0x8697a0)[_0x0569('0x19')](respondWithFilteredResult(_0x329308,_0x42ddb0))[_0x0569('0x28')](handleError(_0x329308,null));};exports[_0x0569('0x29')]=function(_0x1f408e,_0x28c296){var _0x580092={'raw':![],'where':{'id':_0x1f408e[_0x0569('0x2a')]['id']}},_0x5e3c2e={};_0x5e3c2e[_0x0569('0x2b')]=_[_0x0569('0x2c')](db[_0x0569('0x20')][_0x0569('0x21')]);_0x5e3c2e[_0x0569('0x26')]=_['keys'](_0x1f408e[_0x0569('0x26')]);_0x5e3c2e[_0x0569('0x2d')]=_[_0x0569('0x2e')](_0x5e3c2e[_0x0569('0x2b')],_0x5e3c2e[_0x0569('0x26')]);_0x580092[_0x0569('0x2f')]=_['intersection'](_0x5e3c2e[_0x0569('0x2b')],qs[_0x0569('0x30')](_0x1f408e[_0x0569('0x26')][_0x0569('0x30')]));_0x580092['attributes']=_0x580092[_0x0569('0x2f')][_0x0569('0x31')]?_0x580092[_0x0569('0x2f')]:_0x5e3c2e[_0x0569('0x2b')];if(_0x1f408e[_0x0569('0x26')]['includeAll']){_0x580092[_0x0569('0x32')]=[{'all':!![]}];}_0x580092=_[_0x0569('0x33')]({},_0x580092,_0x1f408e[_0x0569('0x34')]);return db[_0x0569('0x20')][_0x0569('0x35')](_0x580092)['then'](handleEntityNotFound(_0x28c296,null))['then'](respondWithResult(_0x28c296,null))[_0x0569('0x28')](handleError(_0x28c296,null));};exports[_0x0569('0x36')]=function(_0x5caab5,_0x2816e3){return db[_0x0569('0x20')][_0x0569('0x36')](_0x5caab5[_0x0569('0x37')],{})[_0x0569('0x19')](respondWithResult(_0x2816e3,0xc9))[_0x0569('0x28')](handleError(_0x2816e3,null));};exports['update']=function(_0x18e8d7,_0x5b0192){if(_0x18e8d7[_0x0569('0x37')]['id']){delete _0x18e8d7[_0x0569('0x37')]['id'];}return db[_0x0569('0x20')]['find']({'where':{'id':_0x18e8d7[_0x0569('0x2a')]['id']}})[_0x0569('0x19')](handleEntityNotFound(_0x5b0192,null))[_0x0569('0x19')](saveUpdates(_0x18e8d7['body'],null))[_0x0569('0x19')](respondWithResult(_0x5b0192,null))[_0x0569('0x28')](handleError(_0x5b0192,null));};exports['destroy']=function(_0x435b12,_0x2e041b){return db['WhatsappInteraction']['find']({'where':{'id':_0x435b12[_0x0569('0x2a')]['id']}})[_0x0569('0x19')](handleEntityNotFound(_0x2e041b,null))[_0x0569('0x19')](removeEntity(_0x2e041b,null))[_0x0569('0x28')](handleError(_0x2e041b,null));};exports[_0x0569('0x38')]=function(_0x26c8d1,_0x29cc7b){return db[_0x0569('0x20')][_0x0569('0x38')]()[_0x0569('0x19')](respondWithResult(_0x29cc7b,null))[_0x0569('0x28')](handleError(_0x29cc7b,null));};exports[_0x0569('0x39')]=function(_0x3cac22,_0x478f93){return db['WhatsappMessage'][_0x0569('0x35')]({'where':{'id':_0x3cac22['params']['id']}})[_0x0569('0x19')](handleEntityNotFound(_0x478f93,null))['then'](function(_0x54090c){if(_0x54090c){return _0x54090c[_0x0569('0x39')](_0x3cac22[_0x0569('0x37')][_0x0569('0x3a')],_[_0x0569('0x3b')](_0x3cac22[_0x0569('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x478f93,null))[_0x0569('0x28')](handleError(_0x478f93,null));};exports['getMessages']=function(_0x3e4789,_0x337f1d){var _0x4cddcc={'raw':![],'where':{}};var _0x1ffc80={};var _0x2fefe0={'count':0x0,'rows':[]};return db[_0x0569('0x20')][_0x0569('0x3c')]({'where':{'id':_0x3e4789[_0x0569('0x2a')]['id']}})[_0x0569('0x19')](handleEntityNotFound(_0x337f1d,null))[_0x0569('0x19')](function(_0x44b849){if(_0x44b849){_0x1ffc80[_0x0569('0x2b')]=_['keys'](db[_0x0569('0x3d')]['rawAttributes']);_0x1ffc80[_0x0569('0x26')]=_['keys'](_0x3e4789[_0x0569('0x26')]);_0x1ffc80[_0x0569('0x2d')]=_[_0x0569('0x2e')](_0x1ffc80[_0x0569('0x2b')],_0x1ffc80[_0x0569('0x26')]);_0x4cddcc['attributes']=_['intersection'](_0x1ffc80[_0x0569('0x2b')],qs[_0x0569('0x30')](_0x3e4789[_0x0569('0x26')]['fields']));_0x4cddcc[_0x0569('0x2f')]=_0x4cddcc[_0x0569('0x2f')][_0x0569('0x31')]?_0x4cddcc[_0x0569('0x2f')]:_0x1ffc80[_0x0569('0x2b')];if(!_0x3e4789[_0x0569('0x26')][_0x0569('0x3e')]('nolimit')){_0x4cddcc[_0x0569('0x13')]=qs['limit'](_0x3e4789[_0x0569('0x26')]['limit']);_0x4cddcc[_0x0569('0x15')]=qs['offset'](_0x3e4789[_0x0569('0x26')][_0x0569('0x15')]);}_0x4cddcc[_0x0569('0x3f')]=qs['sort'](_0x3e4789[_0x0569('0x26')][_0x0569('0x40')]);_0x4cddcc['where']=qs[_0x0569('0x2d')](_[_0x0569('0x41')](_0x3e4789['query'],_0x1ffc80[_0x0569('0x2d')]));_0x4cddcc[_0x0569('0x42')][_0x0569('0x43')]=_0x44b849['id'];if(_0x3e4789['query'][_0x0569('0x44')]){_0x4cddcc[_0x0569('0x42')]=_[_0x0569('0x33')](_0x4cddcc[_0x0569('0x42')],{'$or':_['map'](_0x4cddcc[_0x0569('0x2f')],function(_0x17bc5d){var _0x24ec88={};_0x24ec88[_0x17bc5d]={'$like':'%'+_0x3e4789[_0x0569('0x26')][_0x0569('0x44')]+'%'};return _0x24ec88;})});}if(_0x3e4789[_0x0569('0x26')][_0x0569('0x45')]){var _0x5cadfd=_0x3e4789[_0x0569('0x26')][_0x0569('0x45')]['split'](',');var _0x4bc4f4={};_0x4bc4f4[_0x5cadfd[0x0]]={'$gte':moment(_0x5cadfd[0x1])[_0x0569('0x46')](_0x0569('0x47'))};_0x4cddcc[_0x0569('0x42')]=_[_0x0569('0x33')](_0x4cddcc[_0x0569('0x42')],_0x4bc4f4);}_0x4cddcc=_[_0x0569('0x33')]({},_0x4cddcc,_0x3e4789[_0x0569('0x34')]);return db[_0x0569('0x3d')][_0x0569('0x14')]({'where':_0x4cddcc[_0x0569('0x42')]})[_0x0569('0x19')](function(_0x3a0e56){_0x2fefe0[_0x0569('0x14')]=_0x3a0e56;if(_0x3e4789[_0x0569('0x26')][_0x0569('0x48')]){_0x4cddcc[_0x0569('0x32')]=[{'all':!![]}];}return db[_0x0569('0x3d')][_0x0569('0x49')](_0x4cddcc);})[_0x0569('0x19')](function(_0x3a4005){_0x2fefe0[_0x0569('0x4a')]=_0x3a4005;return _0x2fefe0;});}})['then'](respondWithFilteredResult(_0x337f1d,_0x4cddcc))[_0x0569('0x28')](handleError(_0x337f1d,null));};exports[_0x0569('0x4b')]=function(_0x1fc3b0,_0x1d6dc7){return db[_0x0569('0x20')][_0x0569('0x35')]({'where':{'id':_0x1fc3b0[_0x0569('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1d6dc7,null))[_0x0569('0x19')](function(_0x350851){if(_0x350851){return _0x350851[_0x0569('0x4c')](_0x1fc3b0['body'][_0x0569('0x3a')],_[_0x0569('0x3b')](_0x1fc3b0[_0x0569('0x37')],[_0x0569('0x3a'),'id'])||{})['spread'](function(){return db[_0x0569('0x4d')][_0x0569('0x49')]({'attributes':['id',_0x0569('0x1d'),_0x0569('0x4e')],'where':{'id':_0x1fc3b0[_0x0569('0x37')][_0x0569('0x3a')]}});})[_0x0569('0x19')](function(_0x426023){socket[_0x0569('0x4f')](_0x0569('0x50'),{'id':Number(_0x1fc3b0[_0x0569('0x2a')]['id']),'tags':_0x426023||[]});return{'id':Number(_0x1fc3b0[_0x0569('0x2a')]['id']),'tags':_0x426023||[]};});}})[_0x0569('0x19')](respondWithResult(_0x1d6dc7,null))[_0x0569('0x28')](handleError(_0x1d6dc7,null));};exports['removeTags']=function(_0x3b4e07,_0x59eb0d){return db[_0x0569('0x20')][_0x0569('0x35')]({'where':{'id':_0x3b4e07[_0x0569('0x2a')]['id']}})[_0x0569('0x19')](handleEntityNotFound(_0x59eb0d,null))['then'](function(_0x74a8d4){if(_0x74a8d4){return _0x74a8d4[_0x0569('0x51')](_0x3b4e07['query'][_0x0569('0x3a')]);}})[_0x0569('0x19')](respondWithStatusCode(_0x59eb0d,null))[_0x0569('0x28')](handleError(_0x59eb0d,null));};exports[_0x0569('0x52')]=function(_0xf64eb8,_0x5a7ce0){var _0x5322ed=moment()[_0x0569('0x53')]()[_0x0569('0x54')]();var _0x135b27=path['join'](config[_0x0569('0x55')],_0x0569('0x56'),_0x0569('0x57'),_0x0569('0x58'));var _0x5e1004=path[_0x0569('0x59')](config['root'],_0x0569('0x56'),'files',_0x0569('0x5a'));var _0x2f034e=path[_0x0569('0x59')](_0x135b27,_0x5322ed);var _0x474d46=util[_0x0569('0x46')](_0x0569('0x5b'),_0xf64eb8[_0x0569('0x2a')]['id'],_0x5322ed);var _0x5d67ac=path[_0x0569('0x59')](_0x135b27,_0x474d46);var _0x1c2d43=[];_0x1c2d43[_0x0569('0x5c')]({'model':db[_0x0569('0x5d')],'as':_0x0569('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x1c2d43[_0x0569('0x5c')]({'model':db[_0x0569('0x5e')],'as':_0x0569('0x5f'),'attributes':['id','firstName',_0x0569('0x60')],'raw':!![]});if(_0xf64eb8[_0x0569('0x26')][_0x0569('0x5a')]){_0x1c2d43[_0x0569('0x5c')]({'model':db[_0x0569('0x61')],'as':'Attachment','raw':!![]});}var _0x1016a5=[{'model':db['WhatsappMessage'],'as':_0x0569('0x62'),'attributes':['id',_0x0569('0x37'),'createdAt','direction',_0x0569('0x63'),_0x0569('0x64')],'include':_0x1c2d43}];_0x1016a5[_0x0569('0x5c')]({'model':db[_0x0569('0x65')],'as':_0x0569('0x66'),'attributes':['id','name']});_0x1016a5[_0x0569('0x5c')]({'model':db[_0x0569('0x5d')],'as':'Owner','attributes':['id',_0x0569('0x67')]});return db[_0x0569('0x20')][_0x0569('0x35')]({'where':{'id':_0xf64eb8[_0x0569('0x2a')]['id']},'include':_0x1016a5})[_0x0569('0x19')](handleEntityNotFound(_0x5a7ce0,null))['then'](function(_0x45934c){if(_0x45934c){var _0x4dc364=_0x45934c[_0x0569('0x68')]({'plain':!![]});fs[_0x0569('0x69')](_0x2f034e);var _0x37bef1={'channel':_0x0569('0x6a'),'account':_0x4dc364[_0x0569('0x66')][_0x0569('0x1d')],'agent':_0x4dc364[_0x0569('0x6b')]?_0x4dc364['Owner']['fullname']:_0x0569('0x6c'),'createdAt':moment(_0x4dc364[_0x0569('0x6d')])['format'](_0x0569('0x47'))[_0x0569('0x54')](),'closedAt':_0x4dc364['closed']?moment(_0x4dc364['closedAt'])[_0x0569('0x46')](_0x0569('0x47'))[_0x0569('0x54')]():'','disposition':_0x4dc364[_0x0569('0x6e')],'messages':_(_0x4dc364[_0x0569('0x62')])[_0x0569('0x44')]({'secret':![]})[_0x0569('0x1f')](function(_0x35336e){if(_0x35336e[_0x0569('0x61')]){var _0x519154=path[_0x0569('0x59')](_0x5e1004,_0x35336e[_0x0569('0x61')][_0x0569('0x6f')]);if(fs['existsSync'](_0x519154)){fs['createReadStream'](_0x519154)['pipe'](fs[_0x0569('0x70')](path[_0x0569('0x59')](_0x2f034e,_0x35336e[_0x0569('0x61')]['basename'])));}}return{'date':moment(_0x35336e[_0x0569('0x6d')])[_0x0569('0x46')](_0x0569('0x47'))[_0x0569('0x54')](),'sender':_0x35336e['direction']===_0x0569('0x71')?_0x35336e[_0x0569('0x5d')]?_0x35336e['User'][_0x0569('0x67')]:_0x0569('0x72'):_0x35336e[_0x0569('0x5f')][_0x0569('0x73')]+(_0x35336e[_0x0569('0x5f')]['lastName']?'\x20'+_0x35336e[_0x0569('0x5f')]['lastName']:''),'body':_0x35336e[_0x0569('0x61')]?_0x35336e[_0x0569('0x61')][_0x0569('0x6f')]:_0x35336e[_0x0569('0x37')],'direction':_0x35336e[_0x0569('0x74')]==='out'?'A':'C','secret':_0x35336e[_0x0569('0x63')],'read':_0x35336e['read'],'attachment':_0x35336e[_0x0569('0x61')]};})[_0x0569('0x75')]()};return ejs[_0x0569('0x76')](path[_0x0569('0x59')](config['root'],_0x0569('0x56'),_0x0569('0x77'),_0x0569('0x78')),{'interaction':_0x37bef1})[_0x0569('0x19')](function(_0x2ceddc){var _0x4c3505=path[_0x0569('0x59')](_0x2f034e,_0x0569('0x79')+_0x4dc364['id']+'-'+_0x5322ed+'.pdf');var _0x489dd6={'path':_0x4c3505,'channel':_0x0569('0x6a'),'interactionId':_0x4dc364['id']};return pdf['createPdfFromHTML'](_0x2ceddc,_0x489dd6);})[_0x0569('0x19')](function(){return new BPromise(function(_0x4ed603,_0x4362e1){zipdir(_0x2f034e,{'saveTo':_0x5d67ac},function(_0x5795b1,_0x218740){if(_0x5795b1)return _0x4362e1(_0x5795b1);return _0x4ed603(_0x218740);});})[_0x0569('0x19')](function(){return new BPromise(function(_0x3d31af,_0x5095b9){rimraf(_0x2f034e,function(_0x502126){if(_0x502126)_0x5095b9(_0x502126);return _0x3d31af();});});})['then'](function(){return _0x5a7ce0[_0x0569('0x52')](_0x5d67ac,_0x474d46,function(_0x4d68e3){if(_0x4d68e3){console['log'](_0x0569('0x7a'),_0x4d68e3);}else{fs['unlinkSync'](_0x5d67ac);}});});});}else{return _0x5a7ce0[_0x0569('0xf')](0xc8);}})[_0x0569('0x28')](handleError(_0x5a7ce0,null));}; \ No newline at end of file +var _0x7a79=['WhatsappInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','where','rows','setTags','spread','Tag','emit','removeTags','download','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','get','mkdirSync','Owner','fullname','N.A.','closed','closedAt','disposition','existsSync','createReadStream','createWriteStream','out','System','renderFile','.pdf','Whatsapp','log','unlinkSync','zip-dir','bluebird','util','path','ejs','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','offset','undefined','limit','count','Content-Range','json','update','then','sendStatus','error','name','send','index','WhatsappInteraction','fieldName','type','key','findAll','whatsapp','query','user','catch','show','params','model','keys','rawAttributes','filters','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','intersection','hasOwnProperty','sort','pick'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a79,0x11f));var _0x97a7=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x7a79[_0x3fa7d3];return _0x4c51bd;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x97a7('0x0'));var moment=require('moment');var BPromise=require(_0x97a7('0x1'));var util=require(_0x97a7('0x2'));var path=require(_0x97a7('0x3'));var ejs=require(_0x97a7('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x97a7('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x97a7('0x6'));var logger=require(_0x97a7('0x7'))(_0x97a7('0x8'));var config=require(_0x97a7('0x9'));var db=require(_0x97a7('0xa'))['db'];config[_0x97a7('0xb')]=_[_0x97a7('0xc')](config['redis'],{'host':_0x97a7('0xd'),'port':0x18eb});var socket=require(_0x97a7('0xe'))(new Redis(config['redis']));require(_0x97a7('0xf'))['register'](socket);function respondWithStatusCode(_0x19ca2b,_0x46b197){_0x46b197=_0x46b197||0xcc;return function(_0x27faca){if(_0x27faca){return _0x19ca2b['sendStatus'](_0x46b197);}return _0x19ca2b[_0x97a7('0x10')](_0x46b197)[_0x97a7('0x11')]();};}function respondWithResult(_0x50b93a,_0x1c3232){_0x1c3232=_0x1c3232||0xc8;return function(_0x3d665e){if(_0x3d665e){return _0x50b93a['status'](_0x1c3232)['json'](_0x3d665e);}};}function respondWithFilteredResult(_0x115f10,_0x10241d){return function(_0x54f9ab){if(_0x54f9ab){var _0x6fbe21=typeof _0x10241d[_0x97a7('0x12')]===_0x97a7('0x13')&&typeof _0x10241d[_0x97a7('0x14')]==='undefined';var _0x5e2de6=_0x54f9ab['count'];var _0x1581d7=_0x6fbe21?0x0:_0x10241d[_0x97a7('0x12')];var _0x2e3f28=_0x6fbe21?_0x54f9ab[_0x97a7('0x15')]:_0x10241d[_0x97a7('0x12')]+_0x10241d['limit'];var _0x1ec1ae;if(_0x2e3f28>=_0x5e2de6){_0x2e3f28=_0x5e2de6;_0x1ec1ae=0xc8;}else{_0x1ec1ae=0xce;}_0x115f10[_0x97a7('0x10')](_0x1ec1ae);return _0x115f10['set'](_0x97a7('0x16'),_0x1581d7+'-'+_0x2e3f28+'/'+_0x5e2de6)[_0x97a7('0x17')](_0x54f9ab);}return null;};}function saveUpdates(_0x371cb0){return function(_0x6c99c9){if(_0x6c99c9){return _0x6c99c9[_0x97a7('0x18')](_0x371cb0)[_0x97a7('0x19')](function(_0x29c524){return _0x29c524;});}return null;};}function removeEntity(_0x43f4dd){return function(_0x4b9c43){if(_0x4b9c43){return _0x4b9c43['destroy']()[_0x97a7('0x19')](function(){_0x43f4dd[_0x97a7('0x10')](0xcc)[_0x97a7('0x11')]();});}};}function handleEntityNotFound(_0x408148){return function(_0x53e90f){if(!_0x53e90f){_0x408148[_0x97a7('0x1a')](0x194);}return _0x53e90f;};}function handleError(_0x112233,_0xfc6d13){_0xfc6d13=_0xfc6d13||0x1f4;return function(_0x58341e){logger[_0x97a7('0x1b')](_0x58341e['stack']);if(_0x58341e[_0x97a7('0x1c')]){delete _0x58341e[_0x97a7('0x1c')];}_0x112233[_0x97a7('0x10')](_0xfc6d13)[_0x97a7('0x1d')](_0x58341e);};}exports[_0x97a7('0x1e')]=function(_0x1853af,_0xa24001){var _0x10d268={};var _0x4c9a67=_['map'](db[_0x97a7('0x1f')]['rawAttributes'],function(_0xe29c83){return{'name':_0xe29c83[_0x97a7('0x20')],'type':_0xe29c83[_0x97a7('0x21')][_0x97a7('0x22')]};});_0x10d268=qs['getOptions'](_0x4c9a67,_0x1853af);return interaction[_0x97a7('0x23')](_0x97a7('0x24'),_0x1853af[_0x97a7('0x25')],_0x1853af[_0x97a7('0x26')],_0x10d268,_0x4c9a67)[_0x97a7('0x19')](respondWithFilteredResult(_0xa24001,_0x10d268))[_0x97a7('0x27')](handleError(_0xa24001,null));};exports[_0x97a7('0x28')]=function(_0x58a614,_0x442040){var _0xa808f8={'raw':![],'where':{'id':_0x58a614[_0x97a7('0x29')]['id']}},_0x57c0ee={};_0x57c0ee[_0x97a7('0x2a')]=_[_0x97a7('0x2b')](db[_0x97a7('0x1f')][_0x97a7('0x2c')]);_0x57c0ee[_0x97a7('0x25')]=_[_0x97a7('0x2b')](_0x58a614[_0x97a7('0x25')]);_0x57c0ee[_0x97a7('0x2d')]=_['intersection'](_0x57c0ee['model'],_0x57c0ee[_0x97a7('0x25')]);_0xa808f8[_0x97a7('0x2e')]=_['intersection'](_0x57c0ee['model'],qs[_0x97a7('0x2f')](_0x58a614[_0x97a7('0x25')][_0x97a7('0x2f')]));_0xa808f8[_0x97a7('0x2e')]=_0xa808f8[_0x97a7('0x2e')][_0x97a7('0x30')]?_0xa808f8[_0x97a7('0x2e')]:_0x57c0ee[_0x97a7('0x2a')];if(_0x58a614['query'][_0x97a7('0x31')]){_0xa808f8[_0x97a7('0x32')]=[{'all':!![]}];}_0xa808f8=_[_0x97a7('0x33')]({},_0xa808f8,_0x58a614[_0x97a7('0x34')]);return db[_0x97a7('0x1f')][_0x97a7('0x35')](_0xa808f8)[_0x97a7('0x19')](handleEntityNotFound(_0x442040,null))[_0x97a7('0x19')](respondWithResult(_0x442040,null))[_0x97a7('0x27')](handleError(_0x442040,null));};exports[_0x97a7('0x36')]=function(_0x3985ca,_0x33d9b4){return db[_0x97a7('0x1f')][_0x97a7('0x36')](_0x3985ca['body'],{})[_0x97a7('0x19')](respondWithResult(_0x33d9b4,0xc9))[_0x97a7('0x27')](handleError(_0x33d9b4,null));};exports['update']=function(_0xc11482,_0x4de79b){if(_0xc11482[_0x97a7('0x37')]['id']){delete _0xc11482[_0x97a7('0x37')]['id'];}return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0xc11482[_0x97a7('0x29')]['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x4de79b,null))[_0x97a7('0x19')](saveUpdates(_0xc11482['body'],null))[_0x97a7('0x19')](respondWithResult(_0x4de79b,null))[_0x97a7('0x27')](handleError(_0x4de79b,null));};exports[_0x97a7('0x38')]=function(_0x52ed72,_0x3f3243){return db['WhatsappInteraction']['find']({'where':{'id':_0x52ed72['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x3f3243,null))['then'](removeEntity(_0x3f3243,null))['catch'](handleError(_0x3f3243,null));};exports[_0x97a7('0x39')]=function(_0x479989,_0x13d7e1){return db[_0x97a7('0x1f')]['describe']()[_0x97a7('0x19')](respondWithResult(_0x13d7e1,null))[_0x97a7('0x27')](handleError(_0x13d7e1,null));};exports[_0x97a7('0x3a')]=function(_0x55ec20,_0x594416){return db[_0x97a7('0x3b')][_0x97a7('0x35')]({'where':{'id':_0x55ec20['params']['id']}})['then'](handleEntityNotFound(_0x594416,null))[_0x97a7('0x19')](function(_0x590542){if(_0x590542){return _0x590542[_0x97a7('0x3a')](_0x55ec20[_0x97a7('0x37')][_0x97a7('0x3c')],_[_0x97a7('0x3d')](_0x55ec20['body'],[_0x97a7('0x3c'),'id'])||{});}})[_0x97a7('0x19')](respondWithResult(_0x594416,null))[_0x97a7('0x27')](handleError(_0x594416,null));};exports[_0x97a7('0x3e')]=function(_0x2ea04c,_0x70cccd){var _0x2c0c4a={'raw':![],'where':{}};var _0xc88615={};var _0x16760c={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x2ea04c[_0x97a7('0x29')]['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x70cccd,null))[_0x97a7('0x19')](function(_0x104823){if(_0x104823){_0xc88615['model']=_[_0x97a7('0x2b')](db[_0x97a7('0x3b')][_0x97a7('0x2c')]);_0xc88615['query']=_[_0x97a7('0x2b')](_0x2ea04c[_0x97a7('0x25')]);_0xc88615[_0x97a7('0x2d')]=_['intersection'](_0xc88615[_0x97a7('0x2a')],_0xc88615['query']);_0x2c0c4a[_0x97a7('0x2e')]=_[_0x97a7('0x3f')](_0xc88615[_0x97a7('0x2a')],qs[_0x97a7('0x2f')](_0x2ea04c[_0x97a7('0x25')]['fields']));_0x2c0c4a[_0x97a7('0x2e')]=_0x2c0c4a[_0x97a7('0x2e')][_0x97a7('0x30')]?_0x2c0c4a[_0x97a7('0x2e')]:_0xc88615[_0x97a7('0x2a')];if(!_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x40')]('nolimit')){_0x2c0c4a[_0x97a7('0x14')]=qs[_0x97a7('0x14')](_0x2ea04c['query'][_0x97a7('0x14')]);_0x2c0c4a[_0x97a7('0x12')]=qs[_0x97a7('0x12')](_0x2ea04c['query']['offset']);}_0x2c0c4a['order']=qs[_0x97a7('0x41')](_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x41')]);_0x2c0c4a['where']=qs[_0x97a7('0x2d')](_[_0x97a7('0x42')](_0x2ea04c[_0x97a7('0x25')],_0xc88615['filters']));_0x2c0c4a['where'][_0x97a7('0x43')]=_0x104823['id'];if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x44')]){_0x2c0c4a['where']=_[_0x97a7('0x33')](_0x2c0c4a['where'],{'$or':_[_0x97a7('0x45')](_0x2c0c4a[_0x97a7('0x2e')],function(_0x445f4b){var _0x53a241={};_0x53a241[_0x445f4b]={'$like':'%'+_0x2ea04c['query'][_0x97a7('0x44')]+'%'};return _0x53a241;})});}if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x46')]){var _0x4b08f3=_0x2ea04c['query']['$gte']['split'](',');var _0x3ec2ab={};_0x3ec2ab[_0x4b08f3[0x0]]={'$gte':moment(_0x4b08f3[0x1])[_0x97a7('0x47')](_0x97a7('0x48'))};_0x2c0c4a[_0x97a7('0x49')]=_[_0x97a7('0x33')](_0x2c0c4a[_0x97a7('0x49')],_0x3ec2ab);}_0x2c0c4a=_['merge']({},_0x2c0c4a,_0x2ea04c[_0x97a7('0x34')]);return db[_0x97a7('0x3b')][_0x97a7('0x15')]({'where':_0x2c0c4a['where']})[_0x97a7('0x19')](function(_0x5f5a89){_0x16760c[_0x97a7('0x15')]=_0x5f5a89;if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x31')]){_0x2c0c4a[_0x97a7('0x32')]=[{'all':!![]}];}return db[_0x97a7('0x3b')][_0x97a7('0x23')](_0x2c0c4a);})[_0x97a7('0x19')](function(_0x355737){_0x16760c[_0x97a7('0x4a')]=_0x355737;return _0x16760c;});}})['then'](respondWithFilteredResult(_0x70cccd,_0x2c0c4a))['catch'](handleError(_0x70cccd,null));};exports['addTags']=function(_0x2da28c,_0x1aa926){return db['WhatsappInteraction']['find']({'where':{'id':_0x2da28c['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x1aa926,null))[_0x97a7('0x19')](function(_0x42b43b){if(_0x42b43b){return _0x42b43b[_0x97a7('0x4b')](_0x2da28c[_0x97a7('0x37')][_0x97a7('0x3c')],_[_0x97a7('0x3d')](_0x2da28c[_0x97a7('0x37')],[_0x97a7('0x3c'),'id'])||{})[_0x97a7('0x4c')](function(){return db[_0x97a7('0x4d')][_0x97a7('0x23')]({'attributes':['id',_0x97a7('0x1c'),'color'],'where':{'id':_0x2da28c['body'][_0x97a7('0x3c')]}});})[_0x97a7('0x19')](function(_0x33b12d){socket[_0x97a7('0x4e')]('whatsappInteractionTags:save',{'id':Number(_0x2da28c[_0x97a7('0x29')]['id']),'tags':_0x33b12d||[]});return{'id':Number(_0x2da28c['params']['id']),'tags':_0x33b12d||[]};});}})[_0x97a7('0x19')](respondWithResult(_0x1aa926,null))[_0x97a7('0x27')](handleError(_0x1aa926,null));};exports[_0x97a7('0x4f')]=function(_0x1731e8,_0x91977d){return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0x1731e8['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x91977d,null))['then'](function(_0x350813){if(_0x350813){return _0x350813[_0x97a7('0x4f')](_0x1731e8[_0x97a7('0x25')][_0x97a7('0x3c')]);}})[_0x97a7('0x19')](respondWithStatusCode(_0x91977d,null))['catch'](handleError(_0x91977d,null));};exports[_0x97a7('0x50')]=function(_0x3ce377,_0x2761d8){var _0x45cded=moment()['unix']()[_0x97a7('0x51')]();var _0x21222d=path[_0x97a7('0x52')](config[_0x97a7('0x53')],_0x97a7('0x54'),_0x97a7('0x55'),'tmp');var _0x54c345=path['join'](config['root'],_0x97a7('0x54'),_0x97a7('0x55'),_0x97a7('0x56'));var _0x581732=path[_0x97a7('0x52')](_0x21222d,_0x45cded);var _0x355c86=util[_0x97a7('0x47')](_0x97a7('0x57'),_0x3ce377[_0x97a7('0x29')]['id'],_0x45cded);var _0x18e7bc=path[_0x97a7('0x52')](_0x21222d,_0x355c86);var _0x5eace2=[];_0x5eace2[_0x97a7('0x58')]({'model':db[_0x97a7('0x59')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5eace2[_0x97a7('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x97a7('0x5a'),_0x97a7('0x5b')],'raw':!![]});if(_0x3ce377[_0x97a7('0x25')][_0x97a7('0x56')]){_0x5eace2[_0x97a7('0x58')]({'model':db[_0x97a7('0x5c')],'as':_0x97a7('0x5c'),'raw':!![]});}var _0x292197=[{'model':db['WhatsappMessage'],'as':_0x97a7('0x5d'),'attributes':['id',_0x97a7('0x37'),_0x97a7('0x5e'),_0x97a7('0x5f'),_0x97a7('0x60'),_0x97a7('0x61')],'include':_0x5eace2}];_0x292197[_0x97a7('0x58')]({'model':db[_0x97a7('0x62')],'as':_0x97a7('0x63'),'attributes':['id',_0x97a7('0x1c')]});_0x292197[_0x97a7('0x58')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0x3ce377[_0x97a7('0x29')]['id']},'include':_0x292197})[_0x97a7('0x19')](handleEntityNotFound(_0x2761d8,null))[_0x97a7('0x19')](function(_0x48717e){if(_0x48717e){var _0xdc104a=_0x48717e[_0x97a7('0x64')]({'plain':!![]});fs[_0x97a7('0x65')](_0x581732);var _0x1e9dbc={'channel':'Whatsapp','account':_0xdc104a[_0x97a7('0x63')][_0x97a7('0x1c')],'agent':_0xdc104a[_0x97a7('0x66')]?_0xdc104a[_0x97a7('0x66')][_0x97a7('0x67')]:_0x97a7('0x68'),'createdAt':moment(_0xdc104a[_0x97a7('0x5e')])[_0x97a7('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0xdc104a[_0x97a7('0x69')]?moment(_0xdc104a[_0x97a7('0x6a')])[_0x97a7('0x47')](_0x97a7('0x48'))[_0x97a7('0x51')]():'','disposition':_0xdc104a[_0x97a7('0x6b')],'messages':_(_0xdc104a[_0x97a7('0x5d')])[_0x97a7('0x44')]({'secret':![]})['map'](function(_0x1bb570){if(_0x1bb570[_0x97a7('0x5c')]){var _0x2c1bac=path[_0x97a7('0x52')](_0x54c345,_0x1bb570[_0x97a7('0x5c')]['basename']);if(fs[_0x97a7('0x6c')](_0x2c1bac)){fs[_0x97a7('0x6d')](_0x2c1bac)['pipe'](fs[_0x97a7('0x6e')](path['join'](_0x581732,_0x1bb570['Attachment']['basename'])));}}return{'date':moment(_0x1bb570['createdAt'])[_0x97a7('0x47')](_0x97a7('0x48'))['toString'](),'sender':_0x1bb570['direction']===_0x97a7('0x6f')?_0x1bb570[_0x97a7('0x59')]?_0x1bb570['User'][_0x97a7('0x67')]:_0x97a7('0x70'):_0x1bb570['Contact'][_0x97a7('0x5a')]+(_0x1bb570['Contact'][_0x97a7('0x5b')]?'\x20'+_0x1bb570['Contact'][_0x97a7('0x5b')]:''),'body':_0x1bb570['Attachment']?_0x1bb570[_0x97a7('0x5c')]['basename']:_0x1bb570[_0x97a7('0x37')],'direction':_0x1bb570[_0x97a7('0x5f')]===_0x97a7('0x6f')?'A':'C','secret':_0x1bb570[_0x97a7('0x60')],'read':_0x1bb570[_0x97a7('0x61')],'attachment':_0x1bb570[_0x97a7('0x5c')]};})['value']()};return ejs[_0x97a7('0x71')](path[_0x97a7('0x52')](config[_0x97a7('0x53')],'server','views','downloadInteraction.ejs'),{'interaction':_0x1e9dbc})[_0x97a7('0x19')](function(_0xfbe280){var _0x5a68ca=path[_0x97a7('0x52')](_0x581732,'transcript-'+_0xdc104a['id']+'-'+_0x45cded+_0x97a7('0x72'));var _0x3a6a09={'path':_0x5a68ca,'channel':_0x97a7('0x73'),'interactionId':_0xdc104a['id']};return pdf['createPdfFromHTML'](_0xfbe280,_0x3a6a09);})[_0x97a7('0x19')](function(){return new BPromise(function(_0x41ea7f,_0x114d02){zipdir(_0x581732,{'saveTo':_0x18e7bc},function(_0x1f1d12,_0x2658dc){if(_0x1f1d12)return _0x114d02(_0x1f1d12);return _0x41ea7f(_0x2658dc);});})[_0x97a7('0x19')](function(){return new BPromise(function(_0x25f170,_0x54be6e){rimraf(_0x581732,function(_0x52216c){if(_0x52216c)_0x54be6e(_0x52216c);return _0x25f170();});});})[_0x97a7('0x19')](function(){return _0x2761d8[_0x97a7('0x50')](_0x18e7bc,_0x355c86,function(_0x597dfe){if(_0x597dfe){console[_0x97a7('0x74')]('err',_0x597dfe);}else{fs[_0x97a7('0x75')](_0x18e7bc);}});});});}else{return _0x2761d8[_0x97a7('0x1a')](0xc8);}})['catch'](handleError(_0x2761d8,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 11c3c72..031321b 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 _0x65b3=['events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x882c43,_0x3f9678){var _0x297932=function(_0x3437a8){while(--_0x3437a8){_0x882c43['push'](_0x882c43['shift']());}};_0x297932(++_0x3f9678);}(_0x65b3,0xc6));var _0x365b=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x65b3[_0x31a576];return _0x30b1d3;};'use strict';var EventEmitter=require(_0x365b('0x0'));var WhatsappInteraction=require(_0x365b('0x1'))['db'][_0x365b('0x2')];var WhatsappMessage=require(_0x365b('0x1'))['db'][_0x365b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x365b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x365b('0x5'),'afterDestroy':_0x365b('0x6')};function emitEvent(_0x44ced6){return function(_0x58fc3c,_0x41c876,_0x43cb8f){_0x58fc3c[_0x365b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x160565){_0x58fc3c[_0x365b('0x8')](_0x365b('0x9'),_0x160565[_0x365b('0xa')](function(_0x25e24c){return{'id':_0x25e24c['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x58fc3c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x365b('0xb')](function(_0x29bc7b){_0x58fc3c[_0x365b('0x8')](_0x365b('0xc'),_0x29bc7b[_0x365b('0xd')]);WhatsappInteractionEvents['emit'](_0x44ced6+':'+_0x58fc3c['id'],_0x58fc3c);WhatsappInteractionEvents[_0x365b('0xe')](_0x44ced6,_0x58fc3c);_0x43cb8f(null);})[_0x365b('0xf')](_0x43cb8f(null));};}for(var e in events){if(events[_0x365b('0x10')](e)){var event=events[e];WhatsappInteraction[_0x365b('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xd353=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','catch','events','../../mysqldb','WhatsappMessage','update'];(function(_0xe40606,_0x352502){var _0x1f6230=function(_0x4ead96){while(--_0x4ead96){_0xe40606['push'](_0xe40606['shift']());}};_0x1f6230(++_0x352502);}(_0xd353,0x7e));var _0x3d35=function(_0x46fbda,_0x2cf27f){_0x46fbda=_0x46fbda-0x0;var _0x348db3=_0xd353[_0x46fbda];return _0x348db3;};'use strict';var EventEmitter=require(_0x3d35('0x0'));var WhatsappInteraction=require(_0x3d35('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x3d35('0x1'))['db'][_0x3d35('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3bc47e){return function(_0x23d65e,_0x2287bd,_0xb43971){_0x23d65e[_0x3d35('0x4')]({'attributes':['id'],'raw':!![]})[_0x3d35('0x5')](function(_0x1cf467){_0x23d65e['setDataValue'](_0x3d35('0x6'),_0x1cf467[_0x3d35('0x7')](function(_0x19126c){return{'id':_0x19126c['id']};}));return WhatsappMessage[_0x3d35('0x8')]({'where':{'WhatsappInteractionId':_0x23d65e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d35('0x5')](function(_0x3539f9){_0x23d65e[_0x3d35('0x9')](_0x3d35('0xa'),_0x3539f9[_0x3d35('0xb')]);WhatsappInteractionEvents['emit'](_0x3bc47e+':'+_0x23d65e['id'],_0x23d65e);WhatsappInteractionEvents['emit'](_0x3bc47e,_0x23d65e);_0xb43971(null);})[_0x3d35('0xc')](_0xb43971(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 462924c..09ead2e 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 _0x9fa9=['format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt'];(function(_0x3c9eee,_0x144f4a){var _0x2eb293=function(_0x380c82){while(--_0x380c82){_0x3c9eee['push'](_0x3c9eee['shift']());}};_0x2eb293(++_0x144f4a);}(_0x9fa9,0xb2));var _0x99fa=function(_0x528722,_0xccb51f){_0x528722=_0x528722-0x0;var _0x27c9b1=_0x9fa9[_0x528722];return _0x27c9b1;};'use strict';var _=require('lodash');var util=require(_0x99fa('0x0'));var logger=require(_0x99fa('0x1'))('api');var moment=require(_0x99fa('0x2'));var BPromise=require('bluebird');var rp=require(_0x99fa('0x3'));var fs=require('fs');var path=require(_0x99fa('0x4'));var rimraf=require(_0x99fa('0x5'));var config=require(_0x99fa('0x6'));var attributes=require(_0x99fa('0x7'));module['exports']=function(_0x4b1eba,_0x2c67b2){return _0x4b1eba[_0x99fa('0x8')](_0x99fa('0x9'),attributes,{'tableName':_0x99fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50be2d,_0x406f42,_0x414ba5){if(_0x50be2d[_0x99fa('0xb')](_0x99fa('0xc'))){_0x50be2d[_0x99fa('0xd')]=moment()[_0x99fa('0xe')](_0x99fa('0xf'));}_0x414ba5(null,_0x50be2d);}}});}; \ No newline at end of file +var _0x1123=['request-promise','path','rimraf','./whatsappInteraction.attributes','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird'];(function(_0x4c27de,_0x44ca11){var _0x482a1e=function(_0x225321){while(--_0x225321){_0x4c27de['push'](_0x4c27de['shift']());}};_0x482a1e(++_0x44ca11);}(_0x1123,0x1e7));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x3112('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3112('0x1'));var BPromise=require(_0x3112('0x2'));var rp=require(_0x3112('0x3'));var fs=require('fs');var path=require(_0x3112('0x4'));var rimraf=require(_0x3112('0x5'));var config=require('../../config/environment');var attributes=require(_0x3112('0x6'));module['exports']=function(_0x2479a0,_0x3b72ee){return _0x2479a0['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b01f0,_0x533669,_0x55d764){if(_0x5b01f0['changed'](_0x3112('0x7'))){_0x5b01f0[_0x3112('0x8')]=moment()['format'](_0x3112('0x9'));}_0x55d764(null,_0x5b01f0);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 975b3e4..9c8805a 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 _0x978a=['raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','omit','ids','spread','info','AddTags','stringify','lodash','util','moment','randomstring','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','WhatsappInteraction','update','body','options'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x978a,0xd0));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa978('0x0'));var util=require(_0xa978('0x1'));var moment=require(_0xa978('0x2'));var BPromise=require('bluebird');var rs=require(_0xa978('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa978('0x4'));var logger=require('../../config/logger')(_0xa978('0x5'));var config=require('../../config/environment');var jayson=require(_0xa978('0x6'));var client=jayson['client'][_0xa978('0x7')]({'port':0x232a});config[_0xa978('0x8')]=_[_0xa978('0x9')](config[_0xa978('0x8')],{'host':_0xa978('0xa'),'port':0x18eb});var socket=require(_0xa978('0xb'))(new Redis(config[_0xa978('0x8')]));require(_0xa978('0xc'))[_0xa978('0xd')](socket);function respondWithRpcPromise(_0x146b3a,_0x46a2ef,_0x346f9e){return new BPromise(function(_0x57ffd2,_0x41aea0){return client['request'](_0x146b3a,_0x346f9e)[_0xa978('0xe')](function(_0x455b03){logger['info'](_0xa978('0xf'),_0x46a2ef,_0xa978('0x10'));logger[_0xa978('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x46a2ef,_0xa978('0x10'),JSON['stringify'](_0x455b03));if(_0x455b03[_0xa978('0x12')]){if(_0x455b03[_0xa978('0x12')]['code']===0x1f4){logger[_0xa978('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x46a2ef,_0x455b03['error']['message']);return _0x41aea0(_0x455b03[_0xa978('0x12')][_0xa978('0x13')]);}logger[_0xa978('0x12')](_0xa978('0xf'),_0x46a2ef,_0x455b03[_0xa978('0x12')][_0xa978('0x13')]);return _0x57ffd2(_0x455b03['error']['message']);}else{logger['info'](_0xa978('0xf'),_0x46a2ef,_0xa978('0x10'));_0x57ffd2(_0x455b03[_0xa978('0x14')][_0xa978('0x13')]);}})[_0xa978('0x15')](function(_0xc00731){logger['error'](_0xa978('0xf'),_0x46a2ef,_0xc00731);_0x41aea0(_0xc00731);});});}exports['UpdateWhatsappInteraction']=function(_0xe6140b){var _0x336c64=this;return new Promise(function(_0x3fb28a,_0x56b04c){return db[_0xa978('0x16')][_0xa978('0x17')](_0xe6140b[_0xa978('0x18')],{'raw':_0xe6140b[_0xa978('0x19')]?_0xe6140b[_0xa978('0x19')][_0xa978('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe6140b['options']?_0xe6140b[_0xa978('0x19')][_0xa978('0x1b')]||null:null,'attributes':_0xe6140b[_0xa978('0x19')]?_0xe6140b[_0xa978('0x19')][_0xa978('0x1c')]||null:null,'limit':_0xe6140b['options']?_0xe6140b[_0xa978('0x19')][_0xa978('0x1d')]||null:null})[_0xa978('0xe')](function(_0x3151a7){logger['info'](_0xa978('0x1e'),_0xe6140b);logger['debug'](_0xa978('0x1e'),_0xe6140b,JSON['stringify'](_0x3151a7));_0x3fb28a(_0x3151a7);})[_0xa978('0x15')](function(_0x47d96b){logger[_0xa978('0x12')](_0xa978('0x1e'),_0x47d96b['message'],_0xe6140b);_0x56b04c(_0x336c64['error'](0x1f4,_0x47d96b[_0xa978('0x13')]));});});};exports[_0xa978('0x1f')]=function(_0x11aff9){return new Promise(function(_0x27637e,_0x3413f6){return db['WhatsappInteraction'][_0xa978('0x20')]({'where':_0x11aff9[_0xa978('0x19')]?_0x11aff9['options']['where']||null:null})[_0xa978('0xe')](function(_0x4cff10){if(_0x4cff10){return _0x4cff10['addTags'](_0x11aff9[_0xa978('0x18')]['ids'],_[_0xa978('0x21')](_0x11aff9[_0xa978('0x18')],[_0xa978('0x22'),'id'])||{});}})[_0xa978('0x23')](function(_0x348a3b){logger[_0xa978('0x24')](_0xa978('0x25'),_0x11aff9);logger[_0xa978('0x11')]('AddTags',_0x11aff9,JSON[_0xa978('0x26')](_0x348a3b));_0x27637e(_0x348a3b);})[_0xa978('0x15')](function(_0x3f9b4c){logger[_0xa978('0x12')](_0xa978('0x25'),_0x3f9b4c[_0xa978('0x13')],_0x11aff9);_0x3413f6(_this['error'](0x1f4,_0x3f9b4c[_0xa978('0x13')]));});});}; \ No newline at end of file +var _0xef81=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0x3aa13d,_0x57a0c9){var _0xd3e8c5=function(_0x4115c6){while(--_0x4115c6){_0x3aa13d['push'](_0x3aa13d['shift']());}};_0xd3e8c5(++_0x57a0c9);}(_0xef81,0x114));var _0x1ef8=function(_0x1ef132,_0x54d977){_0x1ef132=_0x1ef132-0x0;var _0xa2b53f=_0xef81[_0x1ef132];return _0xa2b53f;};'use strict';var _=require(_0x1ef8('0x0'));var util=require(_0x1ef8('0x1'));var moment=require(_0x1ef8('0x2'));var BPromise=require(_0x1ef8('0x3'));var rs=require(_0x1ef8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ef8('0x5'))['db'];var utils=require(_0x1ef8('0x6'));var logger=require('../../config/logger')(_0x1ef8('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ef8('0x8'));var client=jayson['client'][_0x1ef8('0x9')]({'port':0x232a});config[_0x1ef8('0xa')]=_[_0x1ef8('0xb')](config[_0x1ef8('0xa')],{'host':_0x1ef8('0xc'),'port':0x18eb});var socket=require(_0x1ef8('0xd'))(new Redis(config[_0x1ef8('0xa')]));require(_0x1ef8('0xe'))[_0x1ef8('0xf')](socket);function respondWithRpcPromise(_0x1b581f,_0x146afb,_0x31ec12){return new BPromise(function(_0x37c62f,_0x415805){return client[_0x1ef8('0x10')](_0x1b581f,_0x31ec12)[_0x1ef8('0x11')](function(_0x5cf8aa){logger[_0x1ef8('0x12')](_0x1ef8('0x13'),_0x146afb,_0x1ef8('0x14'));logger[_0x1ef8('0x15')](_0x1ef8('0x16'),_0x146afb,_0x1ef8('0x14'),JSON[_0x1ef8('0x17')](_0x5cf8aa));if(_0x5cf8aa[_0x1ef8('0x18')]){if(_0x5cf8aa[_0x1ef8('0x18')]['code']===0x1f4){logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0x5cf8aa['error'][_0x1ef8('0x19')]);return _0x415805(_0x5cf8aa[_0x1ef8('0x18')]['message']);}logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0x5cf8aa[_0x1ef8('0x18')][_0x1ef8('0x19')]);return _0x37c62f(_0x5cf8aa[_0x1ef8('0x18')]['message']);}else{logger[_0x1ef8('0x12')](_0x1ef8('0x13'),_0x146afb,_0x1ef8('0x14'));_0x37c62f(_0x5cf8aa[_0x1ef8('0x1a')][_0x1ef8('0x19')]);}})[_0x1ef8('0x1b')](function(_0xd6637b){logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0xd6637b);_0x415805(_0xd6637b);});});}exports[_0x1ef8('0x1c')]=function(_0x52b3bd){var _0x3f557c=this;return new Promise(function(_0x2edc6c,_0x2d3646){return db['WhatsappInteraction'][_0x1ef8('0x1d')](_0x52b3bd[_0x1ef8('0x1e')],{'raw':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52b3bd['options']?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x20')]||null:null,'attributes':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x21')]||null:null,'limit':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x22')]||null:null})[_0x1ef8('0x11')](function(_0x43ef9a){logger[_0x1ef8('0x12')](_0x1ef8('0x1c'),_0x52b3bd);logger[_0x1ef8('0x15')]('UpdateWhatsappInteraction',_0x52b3bd,JSON['stringify'](_0x43ef9a));_0x2edc6c(_0x43ef9a);})[_0x1ef8('0x1b')](function(_0x5b1324){logger[_0x1ef8('0x18')](_0x1ef8('0x1c'),_0x5b1324[_0x1ef8('0x19')],_0x52b3bd);_0x2d3646(_0x3f557c['error'](0x1f4,_0x5b1324[_0x1ef8('0x19')]));});});};exports[_0x1ef8('0x23')]=function(_0x162339){return new Promise(function(_0x5f337e,_0x48e77e){return db[_0x1ef8('0x24')]['find']({'where':_0x162339['options']?_0x162339['options'][_0x1ef8('0x20')]||null:null})[_0x1ef8('0x11')](function(_0x1c59e5){if(_0x1c59e5){return _0x1c59e5[_0x1ef8('0x25')](_0x162339['body']['ids'],_[_0x1ef8('0x26')](_0x162339[_0x1ef8('0x1e')],[_0x1ef8('0x27'),'id'])||{});}})[_0x1ef8('0x28')](function(_0x5327ce){logger[_0x1ef8('0x12')]('AddTags',_0x162339);logger[_0x1ef8('0x15')]('AddTags',_0x162339,JSON[_0x1ef8('0x17')](_0x5327ce));_0x5f337e(_0x5327ce);})['catch'](function(_0x15976a){logger[_0x1ef8('0x18')](_0x1ef8('0x29'),_0x15976a[_0x1ef8('0x19')],_0x162339);_0x48e77e(_this[_0x1ef8('0x18')](0x1f4,_0x15976a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 0ec0e12..c5db02f 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 _0x57f0=['length','whatsappInteraction:','remove','emit','removeListener'];(function(_0x1419ff,_0x64356f){var _0x4c70d3=function(_0x3bfff8){while(--_0x3bfff8){_0x1419ff['push'](_0x1419ff['shift']());}};_0x4c70d3(++_0x64356f);}(_0x57f0,0x147));var _0x057f=function(_0x45af22,_0x15e0c7){_0x45af22=_0x45af22-0x0;var _0x2dc472=_0x57f0[_0x45af22];return _0x2dc472;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x057f('0x0'),'update'];function createListener(_0x408e6b,_0xeca025){return function(_0x2a193c){_0xeca025[_0x057f('0x1')](_0x408e6b,_0x2a193c);};}function removeListener(_0x3f7fda,_0x22ccb9){return function(){WhatsappInteractionEvents[_0x057f('0x2')](_0x3f7fda,_0x22ccb9);};}exports['register']=function(_0x5e5579){for(var _0x3b8024=0x0,_0x2d21f2=events[_0x057f('0x3')];_0x3b8024<_0x2d21f2;_0x3b8024++){var _0x300650=events[_0x3b8024];var _0x42d720=createListener(_0x057f('0x4')+_0x300650,_0x5e5579);WhatsappInteractionEvents['on'](_0x300650,_0x42d720);}}; \ No newline at end of file +var _0xae97=['register','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xae97,0x80));var _0x7ae9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xae97[_0x21549c];return _0x426cbd;};'use strict';var WhatsappInteractionEvents=require(_0x7ae9('0x0'));var events=['save',_0x7ae9('0x1'),_0x7ae9('0x2')];function createListener(_0x537d96,_0xd644d6){return function(_0x3afd55){_0xd644d6[_0x7ae9('0x3')](_0x537d96,_0x3afd55);};}function removeListener(_0x522802,_0x5e9b2c){return function(){WhatsappInteractionEvents[_0x7ae9('0x4')](_0x522802,_0x5e9b2c);};}exports[_0x7ae9('0x5')]=function(_0x531057){for(var _0x3040ba=0x0,_0x3843b4=events['length'];_0x3040ba<_0x3843b4;_0x3040ba++){var _0x4faac9=events[_0x3040ba];var _0x32a463=createListener(_0x7ae9('0x6')+_0x4faac9,_0x531057);WhatsappInteractionEvents['on'](_0x4faac9,_0x32a463);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 5574d20..45b3b37 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 _0xe497=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','reject','delete','destroy'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xe497,0xfc));var _0x7e49=function(_0x227c2a,_0x2a265e){_0x227c2a=_0x227c2a-0x0;var _0x3effc4=_0xe497[_0x227c2a];return _0x3effc4;};'use strict';var multer=require(_0x7e49('0x0'));var util=require(_0x7e49('0x1'));var path=require(_0x7e49('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e49('0x3'));var router=express[_0x7e49('0x4')]();var fs_extra=require(_0x7e49('0x5'));var auth=require(_0x7e49('0x6'));var interaction=require(_0x7e49('0x7'));var config=require(_0x7e49('0x8'));var controller=require(_0x7e49('0x9'));router[_0x7e49('0xa')]('/',auth[_0x7e49('0xb')](),controller['index']);router[_0x7e49('0xa')](_0x7e49('0xc'),auth['isAuthenticated'](),controller[_0x7e49('0xd')]);router['get'](_0x7e49('0xe'),auth[_0x7e49('0xb')](),controller[_0x7e49('0xf')]);router[_0x7e49('0x10')]('/',auth[_0x7e49('0xb')](),interaction[_0x7e49('0x11')](_0x7e49('0x12'),_0x7e49('0x13')),controller['create']);router[_0x7e49('0x10')](_0x7e49('0x14'),controller[_0x7e49('0x15')]);router[_0x7e49('0x16')](_0x7e49('0xe'),auth[_0x7e49('0xb')](),controller[_0x7e49('0x17')]);router[_0x7e49('0x16')](_0x7e49('0x18'),auth[_0x7e49('0xb')](),controller['accept']);router[_0x7e49('0x16')]('/:id/reject',auth['isAuthenticated'](),controller[_0x7e49('0x19')]);router[_0x7e49('0x1a')](_0x7e49('0xe'),auth[_0x7e49('0xb')](),controller[_0x7e49('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xceb3=['create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xceb3,0xcf));var _0x3ceb=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0xceb3[_0x212a37];return _0x5d0bf9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3ceb('0x0'));var express=require(_0x3ceb('0x1'));var router=express[_0x3ceb('0x2')]();var fs_extra=require(_0x3ceb('0x3'));var auth=require(_0x3ceb('0x4'));var interaction=require(_0x3ceb('0x5'));var config=require(_0x3ceb('0x6'));var controller=require(_0x3ceb('0x7'));router[_0x3ceb('0x8')]('/',auth[_0x3ceb('0x9')](),controller[_0x3ceb('0xa')]);router['get'](_0x3ceb('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0xd')]);router[_0x3ceb('0xe')]('/',auth[_0x3ceb('0x9')](),interaction[_0x3ceb('0xf')](_0x3ceb('0x10'),'whatsappmessage:create'),controller[_0x3ceb('0x11')]);router[_0x3ceb('0xe')](_0x3ceb('0x12'),controller[_0x3ceb('0x13')]);router[_0x3ceb('0x14')](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0x15')]);router[_0x3ceb('0x14')](_0x3ceb('0x16'),auth[_0x3ceb('0x9')](),controller['accept']);router[_0x3ceb('0x14')](_0x3ceb('0x17'),auth['isAuthenticated'](),controller[_0x3ceb('0x18')]);router[_0x3ceb('0x19')](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0x1a')]);module[_0x3ceb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 45343f4..3bf9c0f 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 _0xcd3a=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd3a,0x8e));var _0xacd3=function(_0x191e01,_0x5c504f){_0x191e01=_0x191e01-0x0;var _0x1ef3c3=_0xcd3a[_0x191e01];return _0x1ef3c3;};'use strict';var Sequelize=require('sequelize');module[_0xacd3('0x0')]={'body':{'type':Sequelize[_0xacd3('0x1')](_0xacd3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xacd3('0x4')]('in',_0xacd3('0x5')),'defaultValue':_0xacd3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xacd3('0x6')](0xbe)},'phone':{'type':Sequelize[_0xacd3('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xacd3('0x6')]},'providerResponse':{'type':Sequelize[_0xacd3('0x1')]}}; \ No newline at end of file +var _0xa6ee=['out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6ee,0xd3));var _0xea6e=function(_0x2e61e9,_0x21040a){_0x2e61e9=_0x2e61e9-0x0;var _0x31dff9=_0xa6ee[_0x2e61e9];return _0x31dff9;};'use strict';var Sequelize=require(_0xea6e('0x0'));module['exports']={'body':{'type':Sequelize[_0xea6e('0x1')](_0xea6e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xea6e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xea6e('0x4')]('in',_0xea6e('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xea6e('0x6')]},'readAt':{'type':Sequelize[_0xea6e('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xea6e('0x6')]},'providerResponse':{'type':Sequelize[_0xea6e('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 15024b2..3e1bfb6 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 _0xbaee=['messageId','MessageStatus','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','type','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','WhatsappInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','fullname','email','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid'];(function(_0x263897,_0x438346){var _0x1a79f3=function(_0x3c4585){while(--_0x3c4585){_0x263897['push'](_0x263897['shift']());}};_0x1a79f3(++_0x438346);}(_0xbaee,0x8b));var _0xebae=function(_0x1f7360,_0x1cc69e){_0x1f7360=_0x1f7360-0x0;var _0x1a5b64=_0xbaee[_0x1f7360];return _0x1a5b64;};'use strict';var emlformat=require(_0xebae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebae('0x1'));var jsonpatch=require(_0xebae('0x2'));var rp=require(_0xebae('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xebae('0x4'));var util=require(_0xebae('0x5'));var path=require(_0xebae('0x6'));var sox=require('sox');var csv=require(_0xebae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebae('0x8'));var _=require(_0xebae('0x9'));var squel=require(_0xebae('0xa'));var crypto=require(_0xebae('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xebae('0xc'));var toCsv=require(_0xebae('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebae('0xd'));var authService=require(_0xebae('0xe'));var qs=require(_0xebae('0xf'));var as=require(_0xebae('0x10'));var hardwareService=require(_0xebae('0x11'));var logger=require(_0xebae('0x12'))(_0xebae('0x13'));var utils=require('../../config/utils');var config=require(_0xebae('0x14'));var licenseUtil=require(_0xebae('0x15'));var db=require(_0xebae('0x16'))['db'];config[_0xebae('0x17')]=_['defaults'](config[_0xebae('0x17')],{'host':_0xebae('0x18'),'port':0x18eb});var socket=require(_0xebae('0x19'))(new Redis(config[_0xebae('0x17')]));require(_0xebae('0x1a'))[_0xebae('0x1b')](socket);var jayson=require(_0xebae('0x1c'));var client=jayson[_0xebae('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xebae('0x1d')][_0xebae('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2413f5,_0x4e986d,_0x66d5d5,_0x42b95a){return new BPromise(function(_0x173626,_0x1e192c){var _0x1b4475=_0x42b95a||client;return _0x1b4475[_0xebae('0x1f')](_0x2413f5,_0x66d5d5)['then'](function(_0x2c0051){logger[_0xebae('0x20')](_0xebae('0x21'),_0x4e986d,'request\x20sent');logger['debug'](_0xebae('0x22'),_0x4e986d,_0xebae('0x23'),JSON[_0xebae('0x24')](_0x2c0051));if(_0x2c0051[_0xebae('0x25')]){if(_0x2c0051[_0xebae('0x25')][_0xebae('0x26')]===0x1f4){logger[_0xebae('0x25')](_0xebae('0x21'),_0x4e986d,_0x2c0051[_0xebae('0x25')]['message']);return _0x1e192c(_0x2c0051[_0xebae('0x25')][_0xebae('0x27')]);}logger['error'](_0xebae('0x21'),_0x4e986d,_0x2c0051[_0xebae('0x25')][_0xebae('0x27')]);return _0x173626(_0x2c0051[_0xebae('0x25')][_0xebae('0x27')]);}else{logger[_0xebae('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x4e986d,_0xebae('0x23'));_0x173626(_0x2c0051[_0xebae('0x28')][_0xebae('0x27')]);}})[_0xebae('0x29')](function(_0x1b3011){logger[_0xebae('0x25')](_0xebae('0x21'),_0x4e986d,_0x1b3011);_0x1e192c(_0x1b3011);});});}function respondWithStatusCode(_0x529644,_0x558cd1){_0x558cd1=_0x558cd1||0xcc;return function(_0x10a35f){if(_0x10a35f){return _0x529644[_0xebae('0x2a')](_0x558cd1);}return _0x529644['status'](_0x558cd1)['end']();};}function respondWithResult(_0x314679,_0xb4ef6f){_0xb4ef6f=_0xb4ef6f||0xc8;return function(_0x34c186){if(_0x34c186){return _0x314679[_0xebae('0x2b')](_0xb4ef6f)[_0xebae('0x2c')](_0x34c186);}};}function respondWithFilteredResult(_0x5ebdb8,_0x4fade0){return function(_0x53426f){if(_0x53426f){var _0x7d3188=typeof _0x4fade0[_0xebae('0x2d')]===_0xebae('0x2e')&&typeof _0x4fade0[_0xebae('0x2f')]===_0xebae('0x2e');var _0x60f6d5=_0x53426f[_0xebae('0x30')];var _0x15d9c2=_0x7d3188?0x0:_0x4fade0[_0xebae('0x2d')];var _0x5408b3=_0x7d3188?_0x53426f['count']:_0x4fade0['offset']+_0x4fade0[_0xebae('0x2f')];var _0x167b56;if(_0x5408b3>=_0x60f6d5){_0x5408b3=_0x60f6d5;_0x167b56=0xc8;}else{_0x167b56=0xce;}_0x5ebdb8[_0xebae('0x2b')](_0x167b56);return _0x5ebdb8['set'](_0xebae('0x31'),_0x15d9c2+'-'+_0x5408b3+'/'+_0x60f6d5)['json'](_0x53426f);}return null;};}function patchUpdates(_0x14dcb4){return function(_0x5859df){try{jsonpatch[_0xebae('0x32')](_0x5859df,_0x14dcb4,!![]);}catch(_0x3fea9f){return BPromise[_0xebae('0x33')](_0x3fea9f);}return _0x5859df[_0xebae('0x34')]();};}function saveUpdates(_0x450719,_0x3b4723){return function(_0xe9f077){if(_0xe9f077){return _0xe9f077[_0xebae('0x35')](_0x450719)[_0xebae('0x36')](function(_0x3d6f5f){return _0x3d6f5f;});}return null;};}function removeEntity(_0x213629,_0x45da97){return function(_0x4a40be){if(_0x4a40be){return _0x4a40be['destroy']()[_0xebae('0x36')](function(){_0x213629['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdce64d,_0x3b3efa){return function(_0x23ff62){if(!_0x23ff62){_0xdce64d[_0xebae('0x2a')](0x194);}return _0x23ff62;};}function handleError(_0x5d95bd,_0x282615){_0x282615=_0x282615||0x1f4;return function(_0x5cfdc4){logger[_0xebae('0x25')](_0x5cfdc4['stack']);if(_0x5cfdc4[_0xebae('0x37')]){delete _0x5cfdc4[_0xebae('0x37')];}_0x5d95bd[_0xebae('0x2b')](_0x282615)['send'](_0x5cfdc4);};}exports[_0xebae('0x38')]=function(_0x4dfbbe,_0x356d56){var _0x4e1c3d={},_0x2b876f={},_0x27ab3a={'count':0x0,'rows':[]};var _0x3352d5=_[_0xebae('0x39')](db[_0xebae('0x3a')][_0xebae('0x3b')],function(_0x51be8a){return{'name':_0x51be8a[_0xebae('0x3c')],'type':_0x51be8a['type'][_0xebae('0x3d')]};});_0x2b876f[_0xebae('0x3e')]=_['map'](_0x3352d5,_0xebae('0x37'));_0x2b876f[_0xebae('0x3f')]=_[_0xebae('0x40')](_0x4dfbbe['query']);_0x2b876f[_0xebae('0x41')]=_['intersection'](_0x2b876f[_0xebae('0x3e')],_0x2b876f[_0xebae('0x3f')]);_0x4e1c3d[_0xebae('0x42')]=_[_0xebae('0x43')](_0x2b876f['model'],qs[_0xebae('0x44')](_0x4dfbbe[_0xebae('0x3f')]['fields']));_0x4e1c3d['attributes']=_0x4e1c3d[_0xebae('0x42')][_0xebae('0x45')]?_0x4e1c3d['attributes']:_0x2b876f[_0xebae('0x3e')];if(!_0x4dfbbe[_0xebae('0x3f')][_0xebae('0x46')]('nolimit')){_0x4e1c3d['limit']=qs[_0xebae('0x2f')](_0x4dfbbe[_0xebae('0x3f')][_0xebae('0x2f')]);_0x4e1c3d[_0xebae('0x2d')]=qs['offset'](_0x4dfbbe[_0xebae('0x3f')][_0xebae('0x2d')]);}_0x4e1c3d[_0xebae('0x47')]=qs['sort'](_0x4dfbbe[_0xebae('0x3f')]['sort']);_0x4e1c3d[_0xebae('0x48')]=qs[_0xebae('0x41')](_[_0xebae('0x49')](_0x4dfbbe[_0xebae('0x3f')],_0x2b876f['filters']),_0x3352d5);if(_0x4dfbbe['query']['filter']){_0x4e1c3d[_0xebae('0x48')]=_['merge'](_0x4e1c3d[_0xebae('0x48')],{'$or':_[_0xebae('0x39')](_0x3352d5,function(_0x1ca2eb){if(_0x1ca2eb[_0xebae('0x4a')]!=='VIRTUAL'){var _0x10640f={};_0x10640f[_0x1ca2eb[_0xebae('0x37')]]={'$like':'%'+_0x4dfbbe[_0xebae('0x3f')][_0xebae('0x4b')]+'%'};return _0x10640f;}})});}_0x4e1c3d=_[_0xebae('0x4c')]({},_0x4e1c3d,_0x4dfbbe[_0xebae('0x4d')]);var _0x236830={'where':_0x4e1c3d[_0xebae('0x48')]};return db['WhatsappMessage'][_0xebae('0x30')](_0x236830)[_0xebae('0x36')](function(_0x4bac80){_0x27ab3a[_0xebae('0x30')]=_0x4bac80;if(_0x4dfbbe[_0xebae('0x3f')][_0xebae('0x4e')]){_0x4e1c3d[_0xebae('0x4f')]=[{'all':!![]}];}return db[_0xebae('0x3a')][_0xebae('0x50')](_0x4e1c3d);})[_0xebae('0x36')](function(_0x17ec19){_0x27ab3a[_0xebae('0x51')]=_0x17ec19;return _0x27ab3a;})[_0xebae('0x36')](respondWithFilteredResult(_0x356d56,_0x4e1c3d))[_0xebae('0x29')](handleError(_0x356d56,null));};exports[_0xebae('0x52')]=function(_0x37fc12,_0x64b5da){var _0x445c33={'raw':!![],'where':{'id':_0x37fc12[_0xebae('0x53')]['id']}},_0x2f3620={};_0x2f3620[_0xebae('0x3e')]=_['keys'](db[_0xebae('0x3a')][_0xebae('0x3b')]);_0x2f3620[_0xebae('0x3f')]=_[_0xebae('0x40')](_0x37fc12[_0xebae('0x3f')]);_0x2f3620[_0xebae('0x41')]=_[_0xebae('0x43')](_0x2f3620[_0xebae('0x3e')],_0x2f3620[_0xebae('0x3f')]);_0x445c33[_0xebae('0x42')]=_[_0xebae('0x43')](_0x2f3620['model'],qs[_0xebae('0x44')](_0x37fc12[_0xebae('0x3f')]['fields']));_0x445c33['attributes']=_0x445c33[_0xebae('0x42')]['length']?_0x445c33[_0xebae('0x42')]:_0x2f3620[_0xebae('0x3e')];if(_0x37fc12[_0xebae('0x3f')][_0xebae('0x4e')]){_0x445c33['include']=[{'all':!![]}];}_0x445c33=_[_0xebae('0x4c')]({},_0x445c33,_0x37fc12[_0xebae('0x4d')]);return db['WhatsappMessage'][_0xebae('0x54')](_0x445c33)[_0xebae('0x36')](handleEntityNotFound(_0x64b5da,null))[_0xebae('0x36')](respondWithResult(_0x64b5da,null))[_0xebae('0x29')](handleError(_0x64b5da,null));};exports[_0xebae('0x55')]=function(_0x2aa5ca,_0x40ade8){return db[_0xebae('0x3a')][_0xebae('0x55')](_0x2aa5ca['body'],{})[_0xebae('0x36')](respondWithResult(_0x40ade8,0xc9))['catch'](handleError(_0x40ade8,null));};exports[_0xebae('0x35')]=function(_0x2c1ec3,_0x17eb3){if(_0x2c1ec3['body']['id']){delete _0x2c1ec3[_0xebae('0x56')]['id'];}return db['WhatsappMessage'][_0xebae('0x54')]({'where':{'id':_0x2c1ec3[_0xebae('0x53')]['id']}})[_0xebae('0x36')](handleEntityNotFound(_0x17eb3,null))[_0xebae('0x36')](saveUpdates(_0x2c1ec3[_0xebae('0x56')],null))[_0xebae('0x36')](respondWithResult(_0x17eb3,null))[_0xebae('0x29')](handleError(_0x17eb3,null));};exports[_0xebae('0x57')]=function(_0x26776c,_0x3e051c){return db[_0xebae('0x3a')][_0xebae('0x54')]({'where':{'id':_0x26776c[_0xebae('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e051c,null))[_0xebae('0x36')](removeEntity(_0x3e051c,null))['catch'](handleError(_0x3e051c,null));};exports[_0xebae('0x58')]=function(_0x3c1314,_0x1bea5c){return db[_0xebae('0x3a')][_0xebae('0x58')]()[_0xebae('0x36')](respondWithResult(_0x1bea5c,null))[_0xebae('0x29')](handleError(_0x1bea5c,null));};var interaction_log=require(_0xebae('0x12'))(_0xebae('0x59'));exports[_0xebae('0x5a')]=function(_0x1b4728,_0x3f484b,_0x178605){var _0x34decb={'agent':{},'channel':_0xebae('0x5b')};if(_0x1b4728[_0xebae('0x56')]['id']){delete _0x1b4728[_0xebae('0x56')]['id'];}_0x1b4728[_0xebae('0x56')][_0xebae('0x5c')]=!![];_0x1b4728[_0xebae('0x56')]['readAt']=moment()[_0xebae('0x5d')](_0xebae('0x5e'));_0x1b4728[_0xebae('0x56')][_0xebae('0x5f')]=_0x1b4728[_0xebae('0x56')]['UserId']||_0x1b4728[_0xebae('0x60')]['id'];_0x34decb['agent']['id']=_0x1b4728[_0xebae('0x56')]['UserId'];return db[_0xebae('0x3a')][_0xebae('0x54')]({'where':{'id':_0x1b4728[_0xebae('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f484b,null))[_0xebae('0x36')](saveUpdates(_0x1b4728['body'],null))[_0xebae('0x36')](function(_0x38e768){if(_0x38e768){_0x34decb['message']=_0x38e768[_0xebae('0x61')]({'plain':!![]});return db['WhatsappInteraction'][_0xebae('0x54')]({'where':{'id':_0x38e768[_0xebae('0x62')]}});}return null;})[_0xebae('0x36')](handleEntityNotFound(_0x3f484b,null))[_0xebae('0x36')](function(_0x123272){if(_0x123272){return _0x123272['update']({'UserId':_0x1b4728[_0xebae('0x56')]['UserId'],'read1stAt':_[_0xebae('0x63')](_0x123272[_0xebae('0x64')])?moment()[_0xebae('0x5d')](_0xebae('0x5e')):undefined});}return null;})[_0xebae('0x36')](function(_0x25f1de){if(_0x25f1de){_0x34decb[_0xebae('0x65')]=_0x25f1de[_0xebae('0x61')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b4728[_0xebae('0x60')]['id'],_0x1b4728['user']['name'],_0x1b4728[_0xebae('0x60')][_0xebae('0x66')],_0x34decb[_0xebae('0x65')]['id'],_0x1b4728[_0xebae('0x56')]?JSON['stringify'](_0x1b4728[_0xebae('0x56')]):_0xebae('0x67'));return respondWithRpcPromise(_0xebae('0x68'),_0xebae('0x69'),_0x34decb);}return null;})[_0xebae('0x36')](function(_0x2c97f2){var _0x1c3858='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c97f2['message'][_0xebae('0x6a')];return db['sequelize'][_0xebae('0x3f')](_0x1c3858,{'type':db[_0xebae('0x6b')][_0xebae('0x6c')][_0xebae('0x6d')],'raw':!![]})['then'](function(_0x4fc8f2){return _0x4fc8f2;});})[_0xebae('0x36')](function(_0x3e6d74){if(_0x3e6d74){_0x34decb[_0xebae('0x27')][_0xebae('0x6e')]=_0x3e6d74[0x0];if(!_0x1b4728[_0xebae('0x56')][_0xebae('0x5f')])return;return db[_0xebae('0x6f')]['find']({'where':{'id':_0x1b4728[_0xebae('0x56')][_0xebae('0x5f')],'role':_0xebae('0x70')},'attributes':['id',_0xebae('0x37'),'fullname','email',_0xebae('0x71')],'raw':!![]});}return null;})['then'](function(_0x178dde){if(!_0x178dde)return null;_0x34decb[_0xebae('0x27')][_0xebae('0x70')]=_0x178dde;return _0x34decb;})['then'](function(_0x5574a7){if(_0x5574a7){if(_0x1b4728[_0xebae('0x56')][_0xebae('0x72')]){_0x34decb[_0xebae('0x27')][_0xebae('0x73')]=util['format'](_0xebae('0x74'),_0x1b4728[_0xebae('0x60')][_0xebae('0x37')]);_0x34decb[_0xebae('0x27')]['channel']=_0x34decb[_0xebae('0x75')];_0x34decb['message']['motionChannel']=_0x34decb[_0xebae('0x75')];_0x34decb[_0xebae('0x27')][_0xebae('0x76')]=_0xebae('0x5a');return respondWithRpcPromise(_0xebae('0x77'),'EventManager',{'event':_0xebae('0x78'),'message':_0x34decb[_0xebae('0x27')]},client9002)[_0xebae('0x36')](function(){return _0x34decb;});}return _0x34decb;}return null;})[_0xebae('0x36')](respondWithResult(_0x3f484b,null))[_0xebae('0x29')](handleError(_0x3f484b,null));};var interaction_log=require(_0xebae('0x12'))('whatsapp-interactions');exports['reject']=function(_0x4ce76e,_0xa60511,_0x28b70b){var _0x1efda6={'agent':{},'channel':'whatsapp'};if(_0x4ce76e[_0xebae('0x56')]['id']){delete _0x4ce76e[_0xebae('0x56')]['id'];}_0x4ce76e[_0xebae('0x56')][_0xebae('0x5f')]=_0x4ce76e[_0xebae('0x56')]['UserId']||_0x4ce76e['user']['id'];_0x1efda6['agent']['id']=_0x4ce76e[_0xebae('0x56')]['UserId'];return db['WhatsappMessage'][_0xebae('0x54')]({'where':{'id':_0x4ce76e[_0xebae('0x53')]['id'],'UserId':null}})[_0xebae('0x36')](handleEntityNotFound(_0xa60511,null))[_0xebae('0x36')](function(_0x4577a7){if(_0x4577a7){_0x1efda6[_0xebae('0x27')]=_0x4577a7[_0xebae('0x61')]({'plain':!![]});return db[_0xebae('0x79')][_0xebae('0x54')]({'where':{'id':_0x4577a7[_0xebae('0x62')]}});}return null;})['then'](handleEntityNotFound(_0xa60511,null))[_0xebae('0x36')](function(_0x4ef970){if(_0x4ef970){_0x1efda6[_0xebae('0x65')]=_0x4ef970[_0xebae('0x61')]({'plain':!![]});interaction_log[_0xebae('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ce76e[_0xebae('0x60')]['id'],_0x4ce76e[_0xebae('0x60')]['name'],_0x4ce76e['user']['role'],_0x1efda6[_0xebae('0x65')]['id'],_0x4ce76e[_0xebae('0x56')]?JSON[_0xebae('0x24')](_0x4ce76e['body']):'null');return respondWithRpcPromise(_0xebae('0x7a'),_0xebae('0x7b'),_0x1efda6);}return null;})[_0xebae('0x36')](function(_0xe70f0c){var _0x44e19f=_0xebae('0x7c')+_0xe70f0c[_0xebae('0x27')]['ContactId'];return db[_0xebae('0x7d')]['query'](_0x44e19f,{'type':db[_0xebae('0x6b')][_0xebae('0x6c')][_0xebae('0x6d')],'raw':!![]})[_0xebae('0x36')](function(_0x580b35){return _0x580b35;});})[_0xebae('0x36')](function(_0x321eac){if(_0x321eac){_0x1efda6[_0xebae('0x27')][_0xebae('0x6e')]=_0x321eac[0x0];if(!_0x4ce76e[_0xebae('0x56')][_0xebae('0x5f')])return;return db[_0xebae('0x6f')][_0xebae('0x54')]({'where':{'id':_0x4ce76e['body'][_0xebae('0x5f')],'role':_0xebae('0x70')},'attributes':['id',_0xebae('0x37'),_0xebae('0x7e'),_0xebae('0x7f'),_0xebae('0x71')],'raw':!![]});}return null;})[_0xebae('0x36')](function(_0x1e826f){if(!_0x1e826f)return null;_0x1efda6[_0xebae('0x27')]['agent']=_0x1e826f;return _0x1efda6;})[_0xebae('0x36')](function(_0x462a5a){if(_0x462a5a){_0x462a5a['message']['interface']=util[_0xebae('0x5d')](_0xebae('0x74'),_0x4ce76e[_0xebae('0x60')][_0xebae('0x37')]);_0x462a5a[_0xebae('0x27')][_0xebae('0x75')]=_0x1efda6['channel'];_0x462a5a[_0xebae('0x27')]['motionChannel']=_0x1efda6[_0xebae('0x75')];_0x462a5a[_0xebae('0x27')][_0xebae('0x76')]='reject';respondWithRpcPromise(_0xebae('0x77'),'EventManager',{'event':_0xebae('0x80'),'message':_0x462a5a[_0xebae('0x27')]},client9002);return _0x1efda6;}return null;})[_0xebae('0x36')](respondWithResult(_0xa60511,null))['catch'](handleError(_0xa60511,null));};exports[_0xebae('0x2b')]=function(_0x33e452,_0x2e65af,_0x3b3b1d){if(_0x33e452[_0xebae('0x56')]['id']){delete _0x33e452[_0xebae('0x56')]['id'];}var _0x6fccf6;return db[_0xebae('0x3a')][_0xebae('0x54')]({'where':{'id':_0x33e452[_0xebae('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e65af,null))[_0xebae('0x36')](function(_0x3723cc){if(_0x3723cc){_0x6fccf6=_0x3723cc;return db['WhatsappAccount'][_0xebae('0x54')]({'where':{'id':_0x3723cc[_0xebae('0x81')]}});}})[_0xebae('0x36')](handleEntityNotFound(_0x2e65af,null))['then'](function(_0xd7d8aa){if(_0xd7d8aa){logger[_0xebae('0x82')](_0xebae('0x83'),_0xebae('0x2b'),'received\x20delivery\x20report\x20from',_0xd7d8aa[_0xebae('0x4a')],util[_0xebae('0x84')](_0x33e452[_0xebae('0x56')],{'showHidden':![],'depth':null}));switch(_0xd7d8aa[_0xebae('0x4a')]){case _0xebae('0x85'):if(_0x33e452[_0xebae('0x56')]['MessageSid']&&_0x33e452['body'][_0xebae('0x86')]===_0x6fccf6[_0xebae('0x87')]&&_0x33e452[_0xebae('0x56')][_0xebae('0x88')]&&_0x33e452[_0xebae('0x56')][_0xebae('0x88')]===_0xebae('0x5c')){return _0x6fccf6['update']({'read':!![]});}else{logger[_0xebae('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xebae('0x2b'),'twilio',util[_0xebae('0x84')](_0x33e452['body'],{'showHidden':![],'depth':null}));}break;}return _0x6fccf6;}})[_0xebae('0x36')](respondWithResult(_0x2e65af,null))[_0xebae('0x29')](handleError(_0x2e65af,null));}; \ No newline at end of file +var _0xf229=['QueryTypes','User','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','defaults','localhost','./whatsappMessage.socket','register','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','includeAll','find','create','body','params','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','null','rejectMessage','Sequelize'];(function(_0x324d02,_0x6d9c0b){var _0x3d4f59=function(_0x279f6b){while(--_0x279f6b){_0x324d02['push'](_0x324d02['shift']());}};_0x3d4f59(++_0x6d9c0b);}(_0xf229,0x1a5));var _0x9f22=function(_0x32a4e7,_0x3fc8c5){_0x32a4e7=_0x32a4e7-0x0;var _0x55a210=_0xf229[_0x32a4e7];return _0x55a210;};'use strict';var emlformat=require(_0x9f22('0x0'));var rimraf=require(_0x9f22('0x1'));var zipdir=require(_0x9f22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f22('0x3'));var moment=require(_0x9f22('0x4'));var BPromise=require(_0x9f22('0x5'));var Mustache=require(_0x9f22('0x6'));var util=require(_0x9f22('0x7'));var path=require(_0x9f22('0x8'));var sox=require(_0x9f22('0x9'));var csv=require(_0x9f22('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f22('0xb'));var _=require('lodash');var squel=require(_0x9f22('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f22('0xd'));var deskjs=require(_0x9f22('0xe'));var toCsv=require(_0x9f22('0xa'));var querystring=require(_0x9f22('0xf'));var Papa=require(_0x9f22('0x10'));var Redis=require(_0x9f22('0x11'));var authService=require(_0x9f22('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9f22('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f22('0x14'))('api');var utils=require(_0x9f22('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9f22('0x16')]=_[_0x9f22('0x17')](config[_0x9f22('0x16')],{'host':_0x9f22('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f22('0x16')]));require(_0x9f22('0x19'))[_0x9f22('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9f22('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x9f22('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x489466,_0x3a44c3,_0x259744,_0x15bd82){return new BPromise(function(_0x32753b,_0x561564){var _0x556904=_0x15bd82||client;return _0x556904[_0x9f22('0x1c')](_0x489466,_0x259744)[_0x9f22('0x1d')](function(_0x1ca1b7){logger[_0x9f22('0x1e')](_0x9f22('0x1f'),_0x3a44c3,_0x9f22('0x20'));logger[_0x9f22('0x21')](_0x9f22('0x22'),_0x3a44c3,'request\x20sent',JSON[_0x9f22('0x23')](_0x1ca1b7));if(_0x1ca1b7['error']){if(_0x1ca1b7[_0x9f22('0x24')]['code']===0x1f4){logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);return _0x561564(_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);}logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);return _0x32753b(_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);}else{logger[_0x9f22('0x1e')](_0x9f22('0x1f'),_0x3a44c3,'request\x20sent');_0x32753b(_0x1ca1b7[_0x9f22('0x26')][_0x9f22('0x25')]);}})['catch'](function(_0x222791){logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x222791);_0x561564(_0x222791);});});}function respondWithStatusCode(_0x5b09be,_0x1ad0d3){_0x1ad0d3=_0x1ad0d3||0xcc;return function(_0x2e73ed){if(_0x2e73ed){return _0x5b09be['sendStatus'](_0x1ad0d3);}return _0x5b09be['status'](_0x1ad0d3)[_0x9f22('0x27')]();};}function respondWithResult(_0x1957f1,_0x3d7f72){_0x3d7f72=_0x3d7f72||0xc8;return function(_0x14ed94){if(_0x14ed94){return _0x1957f1[_0x9f22('0x28')](_0x3d7f72)['json'](_0x14ed94);}};}function respondWithFilteredResult(_0x3d9b5d,_0xebbb9c){return function(_0x5379fc){if(_0x5379fc){var _0x24a949=typeof _0xebbb9c[_0x9f22('0x29')]==='undefined'&&typeof _0xebbb9c['limit']===_0x9f22('0x2a');var _0x1859c6=_0x5379fc[_0x9f22('0x2b')];var _0x55b164=_0x24a949?0x0:_0xebbb9c[_0x9f22('0x29')];var _0x29556e=_0x24a949?_0x5379fc[_0x9f22('0x2b')]:_0xebbb9c[_0x9f22('0x29')]+_0xebbb9c[_0x9f22('0x2c')];var _0x23d441;if(_0x29556e>=_0x1859c6){_0x29556e=_0x1859c6;_0x23d441=0xc8;}else{_0x23d441=0xce;}_0x3d9b5d[_0x9f22('0x28')](_0x23d441);return _0x3d9b5d['set'](_0x9f22('0x2d'),_0x55b164+'-'+_0x29556e+'/'+_0x1859c6)[_0x9f22('0x2e')](_0x5379fc);}return null;};}function patchUpdates(_0x2e6877){return function(_0x514084){try{jsonpatch[_0x9f22('0x2f')](_0x514084,_0x2e6877,!![]);}catch(_0x52fccc){return BPromise[_0x9f22('0x30')](_0x52fccc);}return _0x514084[_0x9f22('0x31')]();};}function saveUpdates(_0x1e72e3,_0x2ebd81){return function(_0x1f681b){if(_0x1f681b){return _0x1f681b[_0x9f22('0x32')](_0x1e72e3)[_0x9f22('0x1d')](function(_0x33d159){return _0x33d159;});}return null;};}function removeEntity(_0x55b320,_0x5ce5c9){return function(_0x3c7bd9){if(_0x3c7bd9){return _0x3c7bd9['destroy']()['then'](function(){_0x55b320['status'](0xcc)[_0x9f22('0x27')]();});}};}function handleEntityNotFound(_0x4968de,_0x3b5d23){return function(_0xb37af7){if(!_0xb37af7){_0x4968de['sendStatus'](0x194);}return _0xb37af7;};}function handleError(_0x2bb211,_0x40c67d){_0x40c67d=_0x40c67d||0x1f4;return function(_0x5afe45){logger[_0x9f22('0x24')](_0x5afe45[_0x9f22('0x33')]);if(_0x5afe45[_0x9f22('0x34')]){delete _0x5afe45[_0x9f22('0x34')];}_0x2bb211[_0x9f22('0x28')](_0x40c67d)[_0x9f22('0x35')](_0x5afe45);};}exports[_0x9f22('0x36')]=function(_0x2c814e,_0x3ff6a0){var _0xf81554={},_0x42ad00={},_0x3f59d7={'count':0x0,'rows':[]};var _0x15b039=_[_0x9f22('0x37')](db[_0x9f22('0x38')][_0x9f22('0x39')],function(_0x5ba9ba){return{'name':_0x5ba9ba[_0x9f22('0x3a')],'type':_0x5ba9ba['type'][_0x9f22('0x3b')]};});_0x42ad00['model']=_[_0x9f22('0x37')](_0x15b039,'name');_0x42ad00[_0x9f22('0x3c')]=_[_0x9f22('0x3d')](_0x2c814e[_0x9f22('0x3c')]);_0x42ad00['filters']=_['intersection'](_0x42ad00[_0x9f22('0x3e')],_0x42ad00[_0x9f22('0x3c')]);_0xf81554[_0x9f22('0x3f')]=_[_0x9f22('0x40')](_0x42ad00[_0x9f22('0x3e')],qs[_0x9f22('0x41')](_0x2c814e[_0x9f22('0x3c')]['fields']));_0xf81554[_0x9f22('0x3f')]=_0xf81554['attributes'][_0x9f22('0x42')]?_0xf81554['attributes']:_0x42ad00['model'];if(!_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x43')](_0x9f22('0x44'))){_0xf81554[_0x9f22('0x2c')]=qs[_0x9f22('0x2c')](_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x2c')]);_0xf81554[_0x9f22('0x29')]=qs[_0x9f22('0x29')](_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x29')]);}_0xf81554[_0x9f22('0x45')]=qs[_0x9f22('0x46')](_0x2c814e['query'][_0x9f22('0x46')]);_0xf81554['where']=qs['filters'](_[_0x9f22('0x47')](_0x2c814e[_0x9f22('0x3c')],_0x42ad00[_0x9f22('0x48')]),_0x15b039);if(_0x2c814e[_0x9f22('0x3c')]['filter']){_0xf81554[_0x9f22('0x49')]=_['merge'](_0xf81554[_0x9f22('0x49')],{'$or':_[_0x9f22('0x37')](_0x15b039,function(_0x191c9f){if(_0x191c9f[_0x9f22('0x4a')]!==_0x9f22('0x4b')){var _0xc4e9c6={};_0xc4e9c6[_0x191c9f[_0x9f22('0x34')]]={'$like':'%'+_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x4c')]+'%'};return _0xc4e9c6;}})});}_0xf81554=_[_0x9f22('0x4d')]({},_0xf81554,_0x2c814e[_0x9f22('0x4e')]);var _0x2a749b={'where':_0xf81554['where']};return db[_0x9f22('0x38')]['count'](_0x2a749b)['then'](function(_0x5bc734){_0x3f59d7[_0x9f22('0x2b')]=_0x5bc734;if(_0x2c814e['query']['includeAll']){_0xf81554[_0x9f22('0x4f')]=[{'all':!![]}];}return db[_0x9f22('0x38')][_0x9f22('0x50')](_0xf81554);})['then'](function(_0x40ba83){_0x3f59d7[_0x9f22('0x51')]=_0x40ba83;return _0x3f59d7;})['then'](respondWithFilteredResult(_0x3ff6a0,_0xf81554))[_0x9f22('0x52')](handleError(_0x3ff6a0,null));};exports['show']=function(_0x5d0dce,_0xe7cda1){var _0x554332={'raw':!![],'where':{'id':_0x5d0dce['params']['id']}},_0x2c17ba={};_0x2c17ba[_0x9f22('0x3e')]=_[_0x9f22('0x3d')](db[_0x9f22('0x38')][_0x9f22('0x39')]);_0x2c17ba[_0x9f22('0x3c')]=_[_0x9f22('0x3d')](_0x5d0dce[_0x9f22('0x3c')]);_0x2c17ba[_0x9f22('0x48')]=_['intersection'](_0x2c17ba[_0x9f22('0x3e')],_0x2c17ba['query']);_0x554332['attributes']=_[_0x9f22('0x40')](_0x2c17ba[_0x9f22('0x3e')],qs[_0x9f22('0x41')](_0x5d0dce[_0x9f22('0x3c')][_0x9f22('0x41')]));_0x554332['attributes']=_0x554332[_0x9f22('0x3f')]['length']?_0x554332[_0x9f22('0x3f')]:_0x2c17ba[_0x9f22('0x3e')];if(_0x5d0dce['query'][_0x9f22('0x53')]){_0x554332[_0x9f22('0x4f')]=[{'all':!![]}];}_0x554332=_['merge']({},_0x554332,_0x5d0dce[_0x9f22('0x4e')]);return db['WhatsappMessage'][_0x9f22('0x54')](_0x554332)['then'](handleEntityNotFound(_0xe7cda1,null))['then'](respondWithResult(_0xe7cda1,null))[_0x9f22('0x52')](handleError(_0xe7cda1,null));};exports[_0x9f22('0x55')]=function(_0x24bb52,_0x23b994){return db[_0x9f22('0x38')][_0x9f22('0x55')](_0x24bb52[_0x9f22('0x56')],{})['then'](respondWithResult(_0x23b994,0xc9))['catch'](handleError(_0x23b994,null));};exports[_0x9f22('0x32')]=function(_0x5485e3,_0x3b078f){if(_0x5485e3['body']['id']){delete _0x5485e3[_0x9f22('0x56')]['id'];}return db[_0x9f22('0x38')][_0x9f22('0x54')]({'where':{'id':_0x5485e3[_0x9f22('0x57')]['id']}})[_0x9f22('0x1d')](handleEntityNotFound(_0x3b078f,null))[_0x9f22('0x1d')](saveUpdates(_0x5485e3['body'],null))[_0x9f22('0x1d')](respondWithResult(_0x3b078f,null))[_0x9f22('0x52')](handleError(_0x3b078f,null));};exports['destroy']=function(_0x34e667,_0x1de249){return db[_0x9f22('0x38')][_0x9f22('0x54')]({'where':{'id':_0x34e667[_0x9f22('0x57')]['id']}})[_0x9f22('0x1d')](handleEntityNotFound(_0x1de249,null))['then'](removeEntity(_0x1de249,null))[_0x9f22('0x52')](handleError(_0x1de249,null));};exports[_0x9f22('0x58')]=function(_0x490102,_0x3d6972){return db[_0x9f22('0x38')][_0x9f22('0x58')]()[_0x9f22('0x1d')](respondWithResult(_0x3d6972,null))[_0x9f22('0x52')](handleError(_0x3d6972,null));};var interaction_log=require(_0x9f22('0x14'))('whatsapp-interactions');exports[_0x9f22('0x59')]=function(_0x1736da,_0x291e06,_0x59f026){var _0x4a50e4={'agent':{},'channel':_0x9f22('0x5a')};if(_0x1736da[_0x9f22('0x56')]['id']){delete _0x1736da['body']['id'];}_0x1736da[_0x9f22('0x56')][_0x9f22('0x5b')]=!![];_0x1736da[_0x9f22('0x56')][_0x9f22('0x5c')]=moment()[_0x9f22('0x5d')](_0x9f22('0x5e'));_0x1736da[_0x9f22('0x56')]['UserId']=_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')]||_0x1736da[_0x9f22('0x60')]['id'];_0x4a50e4[_0x9f22('0x61')]['id']=_0x1736da[_0x9f22('0x56')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x1736da[_0x9f22('0x57')]['id'],'UserId':null}})[_0x9f22('0x1d')](handleEntityNotFound(_0x291e06,null))[_0x9f22('0x1d')](saveUpdates(_0x1736da['body'],null))[_0x9f22('0x1d')](function(_0x53cff3){if(_0x53cff3){_0x4a50e4['message']=_0x53cff3[_0x9f22('0x62')]({'plain':!![]});return db[_0x9f22('0x63')][_0x9f22('0x54')]({'where':{'id':_0x53cff3[_0x9f22('0x64')]}});}return null;})[_0x9f22('0x1d')](handleEntityNotFound(_0x291e06,null))[_0x9f22('0x1d')](function(_0x15518d){if(_0x15518d){return _0x15518d['update']({'UserId':_0x1736da[_0x9f22('0x56')]['UserId'],'read1stAt':_[_0x9f22('0x65')](_0x15518d[_0x9f22('0x66')])?moment()[_0x9f22('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x35f8b8){if(_0x35f8b8){_0x4a50e4[_0x9f22('0x67')]=_0x35f8b8[_0x9f22('0x62')]({'plain':!![]});interaction_log[_0x9f22('0x1e')](_0x9f22('0x68'),_0x1736da[_0x9f22('0x60')]['id'],_0x1736da[_0x9f22('0x60')]['name'],_0x1736da[_0x9f22('0x60')][_0x9f22('0x69')],_0x4a50e4[_0x9f22('0x67')]['id'],_0x1736da['body']?JSON['stringify'](_0x1736da[_0x9f22('0x56')]):'null');return respondWithRpcPromise(_0x9f22('0x6a'),_0x9f22('0x6b'),_0x4a50e4);}return null;})['then'](function(_0x4137ee){var _0x362814=_0x9f22('0x6c')+_0x4137ee['message'][_0x9f22('0x6d')];return db[_0x9f22('0x6e')][_0x9f22('0x3c')](_0x362814,{'type':db['Sequelize']['QueryTypes'][_0x9f22('0x6f')],'raw':!![]})[_0x9f22('0x1d')](function(_0x44eab2){return _0x44eab2;});})[_0x9f22('0x1d')](function(_0x26e3bc){if(_0x26e3bc){_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x70')]=_0x26e3bc[0x0];if(!_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')])return;return db['User']['find']({'where':{'id':_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')],'role':'agent'},'attributes':['id','name',_0x9f22('0x71'),_0x9f22('0x72'),_0x9f22('0x73')],'raw':!![]});}return null;})[_0x9f22('0x1d')](function(_0x1dd476){if(!_0x1dd476)return null;_0x4a50e4[_0x9f22('0x25')]['agent']=_0x1dd476;return _0x4a50e4;})[_0x9f22('0x1d')](function(_0x37e8e){if(_0x37e8e){if(_0x1736da['body'][_0x9f22('0x74')]){_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x75')]=util[_0x9f22('0x5d')](_0x9f22('0x76'),_0x1736da[_0x9f22('0x60')][_0x9f22('0x34')]);_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x77')]=_0x4a50e4['channel'];_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x78')]=_0x4a50e4[_0x9f22('0x77')];_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x79')]='accept';return respondWithRpcPromise(_0x9f22('0x7a'),_0x9f22('0x7a'),{'event':'acceptmessage','message':_0x4a50e4[_0x9f22('0x25')]},client9002)[_0x9f22('0x1d')](function(){return _0x4a50e4;});}return _0x4a50e4;}return null;})[_0x9f22('0x1d')](respondWithResult(_0x291e06,null))['catch'](handleError(_0x291e06,null));};var interaction_log=require(_0x9f22('0x14'))(_0x9f22('0x7b'));exports[_0x9f22('0x30')]=function(_0xdf4d63,_0x181f9a,_0x533686){var _0x4f5b2f={'agent':{},'channel':_0x9f22('0x5a')};if(_0xdf4d63[_0x9f22('0x56')]['id']){delete _0xdf4d63['body']['id'];}_0xdf4d63['body'][_0x9f22('0x5f')]=_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')]||_0xdf4d63[_0x9f22('0x60')]['id'];_0x4f5b2f[_0x9f22('0x61')]['id']=_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')];return db['WhatsappMessage'][_0x9f22('0x54')]({'where':{'id':_0xdf4d63[_0x9f22('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x181f9a,null))[_0x9f22('0x1d')](function(_0x4aed7b){if(_0x4aed7b){_0x4f5b2f[_0x9f22('0x25')]=_0x4aed7b['get']({'plain':!![]});return db[_0x9f22('0x63')][_0x9f22('0x54')]({'where':{'id':_0x4aed7b[_0x9f22('0x64')]}});}return null;})[_0x9f22('0x1d')](handleEntityNotFound(_0x181f9a,null))[_0x9f22('0x1d')](function(_0x3ed97d){if(_0x3ed97d){_0x4f5b2f[_0x9f22('0x67')]=_0x3ed97d[_0x9f22('0x62')]({'plain':!![]});interaction_log[_0x9f22('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xdf4d63[_0x9f22('0x60')]['id'],_0xdf4d63['user'][_0x9f22('0x34')],_0xdf4d63[_0x9f22('0x60')][_0x9f22('0x69')],_0x4f5b2f[_0x9f22('0x67')]['id'],_0xdf4d63[_0x9f22('0x56')]?JSON[_0x9f22('0x23')](_0xdf4d63[_0x9f22('0x56')]):_0x9f22('0x7c'));return respondWithRpcPromise('RejectMessage',_0x9f22('0x7d'),_0x4f5b2f);}return null;})[_0x9f22('0x1d')](function(_0x32f4b2){var _0x1aab1e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32f4b2[_0x9f22('0x25')]['ContactId'];return db['sequelize'][_0x9f22('0x3c')](_0x1aab1e,{'type':db[_0x9f22('0x7e')][_0x9f22('0x7f')][_0x9f22('0x6f')],'raw':!![]})[_0x9f22('0x1d')](function(_0x22603d){return _0x22603d;});})[_0x9f22('0x1d')](function(_0x12ec8d){if(_0x12ec8d){_0x4f5b2f[_0x9f22('0x25')][_0x9f22('0x70')]=_0x12ec8d[0x0];if(!_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')])return;return db[_0x9f22('0x80')]['find']({'where':{'id':_0xdf4d63['body']['UserId'],'role':_0x9f22('0x61')},'attributes':['id',_0x9f22('0x34'),_0x9f22('0x71'),_0x9f22('0x72'),_0x9f22('0x73')],'raw':!![]});}return null;})[_0x9f22('0x1d')](function(_0x5daccb){if(!_0x5daccb)return null;_0x4f5b2f['message'][_0x9f22('0x61')]=_0x5daccb;return _0x4f5b2f;})[_0x9f22('0x1d')](function(_0x218939){if(_0x218939){_0x218939[_0x9f22('0x25')]['interface']=util[_0x9f22('0x5d')]('SIP/%s',_0xdf4d63[_0x9f22('0x60')][_0x9f22('0x34')]);_0x218939[_0x9f22('0x25')][_0x9f22('0x77')]=_0x4f5b2f[_0x9f22('0x77')];_0x218939[_0x9f22('0x25')][_0x9f22('0x78')]=_0x4f5b2f['channel'];_0x218939[_0x9f22('0x25')]['event']=_0x9f22('0x30');respondWithRpcPromise(_0x9f22('0x7a'),_0x9f22('0x7a'),{'event':_0x9f22('0x81'),'message':_0x218939[_0x9f22('0x25')]},client9002);return _0x4f5b2f;}return null;})[_0x9f22('0x1d')](respondWithResult(_0x181f9a,null))[_0x9f22('0x52')](handleError(_0x181f9a,null));};exports['status']=function(_0xed9dc9,_0x571546,_0x35b4aa){if(_0xed9dc9['body']['id']){delete _0xed9dc9[_0x9f22('0x56')]['id'];}var _0x1bb2e6;return db[_0x9f22('0x38')]['find']({'where':{'id':_0xed9dc9[_0x9f22('0x57')]['id']}})['then'](handleEntityNotFound(_0x571546,null))[_0x9f22('0x1d')](function(_0x524532){if(_0x524532){_0x1bb2e6=_0x524532;return db['WhatsappAccount']['find']({'where':{'id':_0x524532['WhatsappAccountId']}});}})[_0x9f22('0x1d')](handleEntityNotFound(_0x571546,null))[_0x9f22('0x1d')](function(_0x324b9f){if(_0x324b9f){logger[_0x9f22('0x21')](_0x9f22('0x82'),'status',_0x9f22('0x83'),_0x324b9f[_0x9f22('0x4a')],util[_0x9f22('0x84')](_0xed9dc9[_0x9f22('0x56')],{'showHidden':![],'depth':null}));switch(_0x324b9f[_0x9f22('0x4a')]){case _0x9f22('0x85'):if(_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x86')]&&_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x86')]===_0x1bb2e6[_0x9f22('0x87')]&&_0xed9dc9[_0x9f22('0x56')]['MessageStatus']&&_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x88')]===_0x9f22('0x5b')){return _0x1bb2e6[_0x9f22('0x32')]({'read':!![]});}else{logger[_0x9f22('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x9f22('0x85'),util[_0x9f22('0x84')](_0xed9dc9['body'],{'showHidden':![],'depth':null}));}break;}return _0x1bb2e6;}})[_0x9f22('0x1d')](respondWithResult(_0x571546,null))[_0x9f22('0x52')](handleError(_0x571546,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 020ad0a..028111c 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 _0x6599=['hasOwnProperty','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit'];(function(_0xc1abf4,_0x36f95e){var _0x20acd0=function(_0x39be8a){while(--_0x39be8a){_0xc1abf4['push'](_0xc1abf4['shift']());}};_0x20acd0(++_0x36f95e);}(_0x6599,0xb0));var _0x9659=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0x6599[_0x4fa166];return _0x5dd974;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x9659('0x0'))['db'][_0x9659('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x9659('0x2')](0x0);var events={'afterCreate':_0x9659('0x3'),'afterUpdate':_0x9659('0x4'),'afterDestroy':'remove'};function emitEvent(_0xb8bddb){return function(_0x5e2a8e,_0x2f5d38,_0x4fd132){WhatsappMessageEvents[_0x9659('0x5')](_0xb8bddb+':'+_0x5e2a8e['id'],_0x5e2a8e);WhatsappMessageEvents[_0x9659('0x5')](_0xb8bddb,_0x5e2a8e);_0x4fd132(null);};}for(var e in events){if(events[_0x9659('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x5eb8=['WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x28c069,_0x3857d0){var _0x23c598=function(_0x169739){while(--_0x169739){_0x28c069['push'](_0x28c069['shift']());}};_0x23c598(++_0x3857d0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x206338,_0x2d800b){_0x206338=_0x206338-0x0;var _0x2b87f2=_0x5eb8[_0x206338];return _0x2b87f2;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x85eb('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x85eb('0x1')](0x0);var events={'afterCreate':_0x85eb('0x2'),'afterUpdate':_0x85eb('0x3'),'afterDestroy':_0x85eb('0x4')};function emitEvent(_0x13d8a9){return function(_0x13b1df,_0x44e313,_0x3c5798){WhatsappMessageEvents[_0x85eb('0x5')](_0x13d8a9+':'+_0x13b1df['id'],_0x13b1df);WhatsappMessageEvents[_0x85eb('0x5')](_0x13d8a9,_0x13b1df);_0x3c5798(null);};}for(var e in events){if(events[_0x85eb('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x85eb('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0ef9d62..092efe5 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 _0x9fdc=['FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','messageId','fti_whatsapp_messages'];(function(_0x53ad2a,_0x253e9a){var _0x1c616b=function(_0x3f5c26){while(--_0x3f5c26){_0x53ad2a['push'](_0x53ad2a['shift']());}};_0x1c616b(++_0x253e9a);}(_0x9fdc,0x18e));var _0xc9fd=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x9fdc[_0x35d775];return _0x59384d;};'use strict';var _=require(_0xc9fd('0x0'));var util=require(_0xc9fd('0x1'));var logger=require('../../config/logger')(_0xc9fd('0x2'));var moment=require(_0xc9fd('0x3'));var BPromise=require(_0xc9fd('0x4'));var rp=require(_0xc9fd('0x5'));var fetch=require(_0xc9fd('0x6'));var fs=require('fs');var path=require(_0xc9fd('0x7'));var rimraf=require(_0xc9fd('0x8'));var config=require(_0xc9fd('0x9'));var attributes=require(_0xc9fd('0xa'));module[_0xc9fd('0xb')]=function(_0x4697b7,_0x102dd2){return _0x4697b7[_0xc9fd('0xc')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc9fd('0xd'),'fields':[_0xc9fd('0xd')]},{'name':_0xc9fd('0xe'),'fields':['body'],'type':_0xc9fd('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55f553,_0x36d01e,_0x5a06b1){var _0x20304f=_0x4697b7[_0xc9fd('0x10')];var _0x562c8c=_0x55f553[_0xc9fd('0x11')]({'plain':!![]});if(_0x562c8c[_0xc9fd('0x12')]['toLowerCase']()==='in'||_0x562c8c['direction'][_0xc9fd('0x13')]()===_0xc9fd('0x14')&&!_0x562c8c['secret']&&!_[_0xc9fd('0x15')](_0x562c8c['UserId'])){_0x20304f[_0xc9fd('0x16')][_0xc9fd('0x17')]({'where':{'id':_0x562c8c[_0xc9fd('0x18')]}})['then'](function(_0xc97cd4){if(_0xc97cd4){_0xc97cd4[_0xc9fd('0x19')]({'lastMsgAt':_0x562c8c[_0xc9fd('0x1a')],'lastMsgDirection':_0x562c8c[_0xc9fd('0x12')]['toLowerCase']()});}})[_0xc9fd('0x1b')](function(_0x334e76){console['error'](_0x334e76);});}if(_0x562c8c[_0xc9fd('0x12')]===_0xc9fd('0x14')&&!_0x562c8c[_0xc9fd('0x1c')]){var _0x43e1e1;_0x20304f[_0xc9fd('0x1d')][_0xc9fd('0x1e')]({'where':{'id':_0x562c8c[_0xc9fd('0x1f')]},'raw':!![]})['then'](function(_0xe59fd2){_0x43e1e1=_0xe59fd2;if(_0x43e1e1&&_0x43e1e1['type']){switch(_0x43e1e1[_0xc9fd('0x20')]){case _0xc9fd('0x21'):var _0x116287=require(_0xc9fd('0x21'));if(_0x43e1e1[_0xc9fd('0x22')]&&_0x43e1e1[_0xc9fd('0x23')]&&_0x43e1e1['phone']){var _0xb8c209=new _0x116287(_0x43e1e1[_0xc9fd('0x22')],_0x43e1e1[_0xc9fd('0x23')]);_0xb8c209[_0xc9fd('0x24')]['create']({'body':_0x562c8c['body'],'to':_0xc9fd('0x25')+_0x562c8c[_0xc9fd('0x26')],'from':_0xc9fd('0x25')+_0x43e1e1['phone'],'statusCallback':_0x43e1e1[_0xc9fd('0x27')]+_0xc9fd('0x28')+_0x562c8c['id']+_0xc9fd('0x29')+_0x43e1e1[_0xc9fd('0x2a')]})['then'](function(_0x300426){if(_0x300426['sid']){return _0x55f553['update']({'messageId':_0x300426['sid']});}})['catch'](function(_0x331647){logger[_0xc9fd('0x2b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc9fd('0x2c'),_0xc9fd('0x21'),util[_0xc9fd('0x2d')](_0x331647,{'showHidden':![],'depth':null}));});}else{logger[_0xc9fd('0x2b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc9fd('0x2c'),_0xc9fd('0x21'),_0xc9fd('0x2e'));}break;case _0xc9fd('0x2f'):var _0xdd1d7f=_0x43e1e1[_0xc9fd('0x22')];var _0x2ca098=_0x43e1e1['authToken'];var _0x33aee8=_0x43e1e1[_0xc9fd('0x30')]+'/whatsapp/v1/'+_0xdd1d7f+_0xc9fd('0x31');var _0x22054d={'to':[_0x562c8c[_0xc9fd('0x26')]],'message':{'type':'text','text':_0x562c8c['body']}};var _0x74507b={'method':_0xc9fd('0x32'),'uri':_0x33aee8,'headers':{'Authorization':_0xc9fd('0x33')+_0x2ca098,'Content-Type':_0xc9fd('0x34')},'body':_0x22054d,'json':!![]};rp(_0x74507b)['then'](function(_0x37c5e7){if(_0x37c5e7[_0xc9fd('0x35')][0x0][_0xc9fd('0x36')]){return _0x55f553['update']({'messageId':_0x37c5e7[_0xc9fd('0x35')][0x0][_0xc9fd('0x36')]});}})[_0xc9fd('0x1b')](function(_0x4ab16e){logger[_0xc9fd('0x37')](_0xc9fd('0x38'),_0x4ab16e);});break;}}})['finally'](function(){_0x5a06b1();});}else{_0x5a06b1();}}},'charset':_0xc9fd('0x39'),'collate':_0xc9fd('0x3a')});}; \ No newline at end of file +var _0xac8d=['path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','direction','toLowerCase','out','UserId','findOne','WhatsappInteractionId','then','update','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch'];(function(_0x3342b3,_0x590643){var _0x4fddb7=function(_0x2a755a){while(--_0x2a755a){_0x3342b3['push'](_0x3342b3['shift']());}};_0x4fddb7(++_0x590643);}(_0xac8d,0x1d8));var _0xdac8=function(_0x4c2f54,_0xdc401a){_0x4c2f54=_0x4c2f54-0x0;var _0x41b37b=_0xac8d[_0x4c2f54];return _0x41b37b;};'use strict';var _=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var logger=require(_0xdac8('0x2'))(_0xdac8('0x3'));var moment=require(_0xdac8('0x4'));var BPromise=require(_0xdac8('0x5'));var rp=require(_0xdac8('0x6'));var fetch=require(_0xdac8('0x7'));var fs=require('fs');var path=require(_0xdac8('0x8'));var rimraf=require('rimraf');var config=require(_0xdac8('0x9'));var attributes=require(_0xdac8('0xa'));module[_0xdac8('0xb')]=function(_0x13d70e,_0x1e1cc7){return _0x13d70e[_0xdac8('0xc')](_0xdac8('0xd'),attributes,{'tableName':_0xdac8('0xe'),'paranoid':![],'indexes':[{'name':_0xdac8('0xf'),'fields':['messageId']},{'name':_0xdac8('0x10'),'fields':['body'],'type':_0xdac8('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c6884,_0x1c1c20,_0x2f9c0d){var _0x2d68be=_0x13d70e['models'];var _0xfbdce0=_0x3c6884['get']({'plain':!![]});if(_0xfbdce0[_0xdac8('0x12')][_0xdac8('0x13')]()==='in'||_0xfbdce0[_0xdac8('0x12')]['toLowerCase']()===_0xdac8('0x14')&&!_0xfbdce0['secret']&&!_['isNil'](_0xfbdce0[_0xdac8('0x15')])){_0x2d68be['WhatsappInteraction'][_0xdac8('0x16')]({'where':{'id':_0xfbdce0[_0xdac8('0x17')]}})[_0xdac8('0x18')](function(_0x3830b4){if(_0x3830b4){_0x3830b4[_0xdac8('0x19')]({'lastMsgAt':_0xfbdce0['createdAt'],'lastMsgDirection':_0xfbdce0[_0xdac8('0x12')][_0xdac8('0x13')]()});}})[_0xdac8('0x1a')](function(_0x31bcd3){console['error'](_0x31bcd3);});}if(_0xfbdce0[_0xdac8('0x12')]===_0xdac8('0x14')&&!_0xfbdce0[_0xdac8('0x1b')]){var _0x18dcb5;_0x2d68be[_0xdac8('0x1c')][_0xdac8('0x1d')]({'where':{'id':_0xfbdce0[_0xdac8('0x1e')]},'raw':!![]})[_0xdac8('0x18')](function(_0x11ef2d){_0x18dcb5=_0x11ef2d;if(_0x18dcb5&&_0x18dcb5[_0xdac8('0x1f')]){switch(_0x18dcb5[_0xdac8('0x1f')]){case'twilio':var _0x13a6fe=require(_0xdac8('0x20'));if(_0x18dcb5[_0xdac8('0x21')]&&_0x18dcb5[_0xdac8('0x22')]&&_0x18dcb5[_0xdac8('0x23')]){var _0x498db4=new _0x13a6fe(_0x18dcb5[_0xdac8('0x21')],_0x18dcb5['authToken']);_0x498db4[_0xdac8('0x24')][_0xdac8('0x25')]({'body':_0xfbdce0[_0xdac8('0x26')],'to':_0xdac8('0x27')+_0xfbdce0[_0xdac8('0x23')],'from':_0xdac8('0x27')+_0x18dcb5[_0xdac8('0x23')],'statusCallback':_0x18dcb5['remote']+_0xdac8('0x28')+_0xfbdce0['id']+_0xdac8('0x29')+_0x18dcb5[_0xdac8('0x2a')]})[_0xdac8('0x18')](function(_0xb41b5a){if(_0xb41b5a[_0xdac8('0x2b')]){return _0x3c6884[_0xdac8('0x19')]({'messageId':_0xb41b5a[_0xdac8('0x2b')]});}})[_0xdac8('0x1a')](function(_0x3b0cb2){logger[_0xdac8('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xdac8('0x2d'),_0xdac8('0x20'),util[_0xdac8('0x2e')](_0x3b0cb2,{'showHidden':![],'depth':null}));});}else{logger[_0xdac8('0x2c')](_0xdac8('0x2f'),_0xdac8('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xdac8('0x30'):var _0x2f6551=_0x18dcb5[_0xdac8('0x21')];var _0x3b9c7a=_0x18dcb5['authToken'];var _0x910db6=_0x18dcb5[_0xdac8('0x31')]+_0xdac8('0x32')+_0x2f6551+_0xdac8('0x33');var _0x3ebebd={'to':[_0xfbdce0[_0xdac8('0x23')]],'message':{'type':'text','text':_0xfbdce0[_0xdac8('0x26')]}};var _0x23f81c={'method':_0xdac8('0x34'),'uri':_0x910db6,'headers':{'Authorization':'Bearer\x20'+_0x3b9c7a,'Content-Type':_0xdac8('0x35')},'body':_0x3ebebd,'json':!![]};rp(_0x23f81c)[_0xdac8('0x18')](function(_0x539e46){if(_0x539e46['statuses'][0x0][_0xdac8('0x36')]){return _0x3c6884[_0xdac8('0x19')]({'messageId':_0x539e46[_0xdac8('0x37')][0x0][_0xdac8('0x36')]});}})[_0xdac8('0x1a')](function(_0x2dc875){logger[_0xdac8('0x38')](_0xdac8('0x39'),_0x2dc875);});break;}}})[_0xdac8('0x3a')](function(){_0x2f9c0d();});}else{_0x2f9c0d();}}},'charset':'utf8mb4','collate':_0xdac8('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 0765b1c..da9656b 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 _0xfb85=['ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','defaults','localhost','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','create','body','options','lodash','util','moment','bluebird'];(function(_0x325a1f,_0x3049e5){var _0x5b2059=function(_0x582b50){while(--_0x582b50){_0x325a1f['push'](_0x325a1f['shift']());}};_0x5b2059(++_0x3049e5);}(_0xfb85,0x1af));var _0x5fb8=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xfb85[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x5fb8('0x0'));var util=require(_0x5fb8('0x1'));var moment=require(_0x5fb8('0x2'));var BPromise=require(_0x5fb8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fb8('0x4'));var db=require(_0x5fb8('0x5'))['db'];var utils=require(_0x5fb8('0x6'));var logger=require(_0x5fb8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5fb8('0x8')]({'port':0x232a});config[_0x5fb8('0x9')]=_[_0x5fb8('0xa')](config[_0x5fb8('0x9')],{'host':_0x5fb8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fb8('0x9')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x41f5c4,_0x28743b,_0x3375f1){return new BPromise(function(_0x315254,_0x2b0396){return client[_0x5fb8('0xc')](_0x41f5c4,_0x3375f1)[_0x5fb8('0xd')](function(_0x2ca5ad){logger[_0x5fb8('0xe')](_0x5fb8('0xf'),_0x28743b,_0x5fb8('0x10'));logger[_0x5fb8('0x11')](_0x5fb8('0x12'),_0x28743b,_0x5fb8('0x10'),JSON[_0x5fb8('0x13')](_0x2ca5ad));if(_0x2ca5ad[_0x5fb8('0x14')]){if(_0x2ca5ad[_0x5fb8('0x14')][_0x5fb8('0x15')]===0x1f4){logger[_0x5fb8('0x14')](_0x5fb8('0xf'),_0x28743b,_0x2ca5ad['error'][_0x5fb8('0x16')]);return _0x2b0396(_0x2ca5ad['error']['message']);}logger[_0x5fb8('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x28743b,_0x2ca5ad[_0x5fb8('0x14')][_0x5fb8('0x16')]);return _0x315254(_0x2ca5ad[_0x5fb8('0x14')][_0x5fb8('0x16')]);}else{logger[_0x5fb8('0xe')](_0x5fb8('0xf'),_0x28743b,_0x5fb8('0x10'));_0x315254(_0x2ca5ad[_0x5fb8('0x17')][_0x5fb8('0x16')]);}})[_0x5fb8('0x18')](function(_0x1cdd6f){logger[_0x5fb8('0x14')](_0x5fb8('0xf'),_0x28743b,_0x1cdd6f);_0x2b0396(_0x1cdd6f);});});}exports[_0x5fb8('0x19')]=function(_0x4a40f1){var _0x30aa1e=this;return new Promise(function(_0x178dfc,_0x4a8f85){return db['WhatsappMessage'][_0x5fb8('0x1a')](_0x4a40f1[_0x5fb8('0x1b')],{'raw':_0x4a40f1['options']?_0x4a40f1[_0x5fb8('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5fb8('0xd')](function(_0x45e12c){logger[_0x5fb8('0xe')]('CreateWhatsappMessage',_0x4a40f1);logger[_0x5fb8('0x11')](_0x5fb8('0x19'),_0x4a40f1,JSON[_0x5fb8('0x13')](_0x45e12c));_0x178dfc(_0x45e12c);})[_0x5fb8('0x18')](function(_0x47653e){logger[_0x5fb8('0x14')](_0x5fb8('0x19'),_0x47653e[_0x5fb8('0x16')],_0x4a40f1);_0x4a8f85(_0x30aa1e[_0x5fb8('0x14')](0x1f4,_0x47653e[_0x5fb8('0x16')]));});});}; \ No newline at end of file +var _0x466f=['redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','WhatsappMessage','create','body','options','debug','catch','CreateWhatsappMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5aaa82,_0x5d2e28){var _0x2aa517=function(_0x346c22){while(--_0x346c22){_0x5aaa82['push'](_0x5aaa82['shift']());}};_0x2aa517(++_0x5d2e28);}(_0x466f,0xf5));var _0xf466=function(_0x3c7291,_0x1beb39){_0x3c7291=_0x3c7291-0x0;var _0x372ca7=_0x466f[_0x3c7291];return _0x372ca7;};'use strict';var _=require(_0xf466('0x0'));var util=require(_0xf466('0x1'));var moment=require(_0xf466('0x2'));var BPromise=require('bluebird');var rs=require(_0xf466('0x3'));var fs=require('fs');var Redis=require(_0xf466('0x4'));var db=require(_0xf466('0x5'))['db'];var utils=require(_0xf466('0x6'));var logger=require('../../config/logger')(_0xf466('0x7'));var config=require(_0xf466('0x8'));var jayson=require(_0xf466('0x9'));var client=jayson['client'][_0xf466('0xa')]({'port':0x232a});config[_0xf466('0xb')]=_['defaults'](config[_0xf466('0xb')],{'host':_0xf466('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf466('0xb')]));require(_0xf466('0xd'))[_0xf466('0xe')](socket);function respondWithRpcPromise(_0x598190,_0x4c1219,_0x9a46d1){return new BPromise(function(_0x29bdc2,_0x2523fd){return client[_0xf466('0xf')](_0x598190,_0x9a46d1)[_0xf466('0x10')](function(_0xe4c683){logger[_0xf466('0x11')](_0xf466('0x12'),_0x4c1219,_0xf466('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4c1219,_0xf466('0x13'),JSON[_0xf466('0x14')](_0xe4c683));if(_0xe4c683['error']){if(_0xe4c683[_0xf466('0x15')][_0xf466('0x16')]===0x1f4){logger[_0xf466('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4c1219,_0xe4c683[_0xf466('0x15')][_0xf466('0x17')]);return _0x2523fd(_0xe4c683[_0xf466('0x15')]['message']);}logger[_0xf466('0x15')](_0xf466('0x12'),_0x4c1219,_0xe4c683[_0xf466('0x15')]['message']);return _0x29bdc2(_0xe4c683[_0xf466('0x15')][_0xf466('0x17')]);}else{logger[_0xf466('0x11')](_0xf466('0x12'),_0x4c1219,'request\x20sent');_0x29bdc2(_0xe4c683[_0xf466('0x18')][_0xf466('0x17')]);}})['catch'](function(_0x4f8e86){logger['error'](_0xf466('0x12'),_0x4c1219,_0x4f8e86);_0x2523fd(_0x4f8e86);});});}exports['CreateWhatsappMessage']=function(_0x32d843){var _0x3ac6e5=this;return new Promise(function(_0x452cb2,_0x386dfa){return db[_0xf466('0x19')][_0xf466('0x1a')](_0x32d843[_0xf466('0x1b')],{'raw':_0x32d843[_0xf466('0x1c')]?_0x32d843['options']['raw']===undefined?!![]:![]:!![]})[_0xf466('0x10')](function(_0x53e195){logger[_0xf466('0x11')]('CreateWhatsappMessage',_0x32d843);logger[_0xf466('0x1d')]('CreateWhatsappMessage',_0x32d843,JSON[_0xf466('0x14')](_0x53e195));_0x452cb2(_0x53e195);})[_0xf466('0x1e')](function(_0x4bef1c){logger[_0xf466('0x15')](_0xf466('0x1f'),_0x4bef1c['message'],_0x32d843);_0x386dfa(_0x3ac6e5[_0xf466('0x15')](0x1f4,_0x4bef1c[_0xf466('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2bb7c33..8637bb3 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 _0xf581=['save','remove','emit','removeListener','register','length'];(function(_0x343707,_0xeaa98){var _0xdc7ccb=function(_0x2407f4){while(--_0x2407f4){_0x343707['push'](_0x343707['shift']());}};_0xdc7ccb(++_0xeaa98);}(_0xf581,0x1ec));var _0x1f58=function(_0x50709f,_0x471e8a){_0x50709f=_0x50709f-0x0;var _0x8cfd9=_0xf581[_0x50709f];return _0x8cfd9;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x1f58('0x0'),_0x1f58('0x1'),'update'];function createListener(_0x3e2f14,_0x5b265d){return function(_0x53d8ab){_0x5b265d[_0x1f58('0x2')](_0x3e2f14,_0x53d8ab);};}function removeListener(_0x48e9fc,_0x29a201){return function(){WhatsappMessageEvents[_0x1f58('0x3')](_0x48e9fc,_0x29a201);};}exports[_0x1f58('0x4')]=function(_0xa9103d){for(var _0x2879e6=0x0,_0x445b2d=events[_0x1f58('0x5')];_0x2879e6<_0x445b2d;_0x2879e6++){var _0x5f242c=events[_0x2879e6];var _0x629a7f=createListener('whatsappMessage:'+_0x5f242c,_0xa9103d);WhatsappMessageEvents['on'](_0x5f242c,_0x629a7f);}}; \ No newline at end of file +var _0x6c04=['length','whatsappMessage:','./whatsappMessage.events','save','emit','removeListener','register'];(function(_0x2ca3d8,_0xf83cb8){var _0x2639d9=function(_0x5ee2bc){while(--_0x5ee2bc){_0x2ca3d8['push'](_0x2ca3d8['shift']());}};_0x2639d9(++_0xf83cb8);}(_0x6c04,0x79));var _0x46c0=function(_0x11489d,_0x1738d4){_0x11489d=_0x11489d-0x0;var _0x56a378=_0x6c04[_0x11489d];return _0x56a378;};'use strict';var WhatsappMessageEvents=require(_0x46c0('0x0'));var events=[_0x46c0('0x1'),'remove','update'];function createListener(_0x3a6b25,_0x8c57c4){return function(_0x37925e){_0x8c57c4[_0x46c0('0x2')](_0x3a6b25,_0x37925e);};}function removeListener(_0x23ab77,_0x406bc7){return function(){WhatsappMessageEvents[_0x46c0('0x3')](_0x23ab77,_0x406bc7);};}exports[_0x46c0('0x4')]=function(_0x1c4a05){for(var _0xebb088=0x0,_0x2ef42f=events[_0x46c0('0x5')];_0xebb088<_0x2ef42f;_0xebb088++){var _0x728bab=events[_0xebb088];var _0x32ebcc=createListener(_0x46c0('0x6')+_0x728bab,_0x1c4a05);WhatsappMessageEvents['on'](_0x728bab,_0x32ebcc);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 9f07a11..eb67337 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 _0xfaf2=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','put','/:id','update','destroy','delete','removeTeams','removeAgents'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfaf2,0x169));var _0x2faf=function(_0x51c560,_0x285633){_0x51c560=_0x51c560-0x0;var _0x1e7c21=_0xfaf2[_0x51c560];return _0x1e7c21;};'use strict';var multer=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var path=require(_0x2faf('0x2'));var timeout=require(_0x2faf('0x3'));var express=require(_0x2faf('0x4'));var router=express['Router']();var fs_extra=require(_0x2faf('0x5'));var auth=require(_0x2faf('0x6'));var interaction=require(_0x2faf('0x7'));var config=require(_0x2faf('0x8'));var controller=require(_0x2faf('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2faf('0xa')](_0x2faf('0xb'),auth[_0x2faf('0xc')](),controller[_0x2faf('0xd')]);router[_0x2faf('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2faf('0xe')]);router[_0x2faf('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x2faf('0xf')]);router[_0x2faf('0xa')](_0x2faf('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x2faf('0xa')](_0x2faf('0x11'),auth['isAuthenticated'](),controller[_0x2faf('0x12')]);router['post']('/',auth[_0x2faf('0xc')](),controller[_0x2faf('0x13')]);router[_0x2faf('0x14')](_0x2faf('0x10'),auth[_0x2faf('0xc')](),controller[_0x2faf('0x15')]);router['post'](_0x2faf('0x11'),auth[_0x2faf('0xc')](),controller['addAgents']);router[_0x2faf('0x16')](_0x2faf('0x17'),auth[_0x2faf('0xc')](),controller[_0x2faf('0x18')]);router['delete'](_0x2faf('0x17'),auth[_0x2faf('0xc')](),controller[_0x2faf('0x19')]);router[_0x2faf('0x1a')]('/:id/teams',auth[_0x2faf('0xc')](),controller[_0x2faf('0x1b')]);router[_0x2faf('0x1a')](_0x2faf('0x11'),auth[_0x2faf('0xc')](),controller[_0x2faf('0x1c')]);module[_0x2faf('0x1d')]=router; \ No newline at end of file +var _0xfcf8=['../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1aa3f4,_0x197b65){var _0x1ec6b7=function(_0x55283a){while(--_0x55283a){_0x1aa3f4['push'](_0x1aa3f4['shift']());}};_0x1ec6b7(++_0x197b65);}(_0xfcf8,0x8f));var _0x8fcf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfcf8[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x8fcf('0x0'));var util=require(_0x8fcf('0x1'));var path=require(_0x8fcf('0x2'));var timeout=require(_0x8fcf('0x3'));var express=require(_0x8fcf('0x4'));var router=express[_0x8fcf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8fcf('0x6'));var interaction=require(_0x8fcf('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x8fcf('0x8')]('/',auth['isAuthenticated'](),controller[_0x8fcf('0x9')]);router[_0x8fcf('0x8')](_0x8fcf('0xa'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0xc')]);router[_0x8fcf('0x8')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller[_0x8fcf('0xe')]);router[_0x8fcf('0x8')](_0x8fcf('0xf'),auth[_0x8fcf('0xb')](),controller['getMembers']);router[_0x8fcf('0x8')](_0x8fcf('0x10'),auth['isAuthenticated'](),controller[_0x8fcf('0x11')]);router['get'](_0x8fcf('0x12'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8fcf('0x14')]);router[_0x8fcf('0x15')](_0x8fcf('0x10'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x16')]);router[_0x8fcf('0x15')](_0x8fcf('0x12'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x17')]);router[_0x8fcf('0x18')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller[_0x8fcf('0x19')]);router[_0x8fcf('0x1a')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x8fcf('0x1a')](_0x8fcf('0x10'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x1b')]);router[_0x8fcf('0x1a')]('/:id/users',auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x1c')]);module[_0x8fcf('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 2d703a3..dff9fc9 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 _0x3c81=['name','INTEGER','STRING','sequelize','exports'];(function(_0x3e60a3,_0x3cb4e8){var _0x2ae01=function(_0x2030e7){while(--_0x2030e7){_0x3e60a3['push'](_0x3e60a3['shift']());}};_0x2ae01(++_0x3cb4e8);}(_0x3c81,0x102));var _0x13c8=function(_0x28a27a,_0x23ce3a){_0x28a27a=_0x28a27a-0x0;var _0x3b322a=_0x3c81[_0x28a27a];return _0x3b322a;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x13c8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x13c8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')},'description':{'type':Sequelize[_0x13c8('0x4')]}}; \ No newline at end of file +var _0x4522=['beepall','roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x1323df,_0x1fdc48){var _0x9bd3cd=function(_0x16f849){while(--_0x16f849){_0x1323df['push'](_0x1323df['shift']());}};_0x9bd3cd(++_0x1fdc48);}(_0x4522,0x1a0));var _0x2452=function(_0x4d72b0,_0x6ba7fa){_0x4d72b0=_0x4d72b0-0x0;var _0x159901=_0x4522[_0x4d72b0];return _0x159901;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2452('0x0')],'unique':_0x2452('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2452('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2452('0x3'),_0x2452('0x4'),_0x2452('0x5'))},'description':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d49ae9e..97ab890 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 _0x2678=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserWhatsappQueue','nolimit','WhatsappQueueId','UserId','agent','whatsappPause','updatedAt','rows','format','getTeams','findOne','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','includes','all','union','compact','isEmpty','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x45f00e,_0x24fb51){var _0x2cf245=function(_0x484f9c){while(--_0x484f9c){_0x45f00e['push'](_0x45f00e['shift']());}};_0x2cf245(++_0x24fb51);}(_0x2678,0x186));var _0x8267=function(_0x3bfa98,_0x3ed6f5){_0x3bfa98=_0x3bfa98-0x0;var _0x226a36=_0x2678[_0x3bfa98];return _0x226a36;};'use strict';var emlformat=require(_0x8267('0x0'));var rimraf=require(_0x8267('0x1'));var zipdir=require(_0x8267('0x2'));var jsonpatch=require(_0x8267('0x3'));var rp=require('request-promise');var moment=require(_0x8267('0x4'));var BPromise=require(_0x8267('0x5'));var Mustache=require(_0x8267('0x6'));var util=require(_0x8267('0x7'));var path=require('path');var sox=require(_0x8267('0x8'));var csv=require(_0x8267('0x9'));var ejs=require(_0x8267('0xa'));var fs=require('fs');var fs_extra=require(_0x8267('0xb'));var _=require(_0x8267('0xc'));var squel=require(_0x8267('0xd'));var crypto=require(_0x8267('0xe'));var jsforce=require(_0x8267('0xf'));var deskjs=require(_0x8267('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8267('0x11'));var Papa=require(_0x8267('0x12'));var Redis=require(_0x8267('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8267('0x14'));var as=require(_0x8267('0x15'));var hardwareService=require(_0x8267('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x8267('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8267('0x18'));var db=require(_0x8267('0x19'))['db'];config['redis']=_[_0x8267('0x1a')](config[_0x8267('0x1b')],{'host':_0x8267('0x1c'),'port':0x18eb});var socket=require(_0x8267('0x1d'))(new Redis(config[_0x8267('0x1b')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x4523be,_0x142d6f){_0x142d6f=_0x142d6f||0xcc;return function(_0x598c33){if(_0x598c33){return _0x4523be[_0x8267('0x1e')](_0x142d6f);}return _0x4523be['status'](_0x142d6f)[_0x8267('0x1f')]();};}function respondWithResult(_0x2cc1a4,_0x201bda){_0x201bda=_0x201bda||0xc8;return function(_0x57b4cb){if(_0x57b4cb){return _0x2cc1a4[_0x8267('0x20')](_0x201bda)[_0x8267('0x21')](_0x57b4cb);}};}function respondWithFilteredResult(_0x47e7d5,_0x5111a8){return function(_0x2705c6){if(_0x2705c6){var _0x2a4384=typeof _0x5111a8[_0x8267('0x22')]===_0x8267('0x23')&&typeof _0x5111a8[_0x8267('0x24')]===_0x8267('0x23');var _0x3e5a9d=_0x2705c6['count'];var _0x4f48e8=_0x2a4384?0x0:_0x5111a8[_0x8267('0x22')];var _0x30381c=_0x2a4384?_0x2705c6[_0x8267('0x25')]:_0x5111a8['offset']+_0x5111a8[_0x8267('0x24')];var _0x32e29c;if(_0x30381c>=_0x3e5a9d){_0x30381c=_0x3e5a9d;_0x32e29c=0xc8;}else{_0x32e29c=0xce;}_0x47e7d5[_0x8267('0x20')](_0x32e29c);return _0x47e7d5['set']('Content-Range',_0x4f48e8+'-'+_0x30381c+'/'+_0x3e5a9d)['json'](_0x2705c6);}return null;};}function patchUpdates(_0xf7f6f8){return function(_0x1454fc){try{jsonpatch[_0x8267('0x26')](_0x1454fc,_0xf7f6f8,!![]);}catch(_0x53d00b){return BPromise['reject'](_0x53d00b);}return _0x1454fc[_0x8267('0x27')]();};}function saveUpdates(_0x36fe6e,_0x2287cb){return function(_0x3df94f){if(_0x3df94f){return _0x3df94f['update'](_0x36fe6e)[_0x8267('0x28')](function(_0x395f2b){return _0x395f2b;});}return null;};}function removeEntity(_0x595bea,_0x25bd91){return function(_0x577f8a){if(_0x577f8a){return _0x577f8a[_0x8267('0x29')]()[_0x8267('0x28')](function(){var _0x1cb84b=_0x577f8a['get']({'plain':!![]});var _0x1e39c4=_0x8267('0x2a');return db[_0x8267('0x2b')][_0x8267('0x29')]({'where':{'type':_0x1e39c4,'resourceId':_0x1cb84b['id']}})[_0x8267('0x28')](function(){return _0x577f8a;});})[_0x8267('0x28')](function(){_0x595bea['status'](0xcc)[_0x8267('0x1f')]();});}};}function handleEntityNotFound(_0x77ada0,_0x1b70d2){return function(_0x265c5c){if(!_0x265c5c){_0x77ada0[_0x8267('0x1e')](0x194);}return _0x265c5c;};}function handleError(_0x42e09c,_0x63253e){_0x63253e=_0x63253e||0x1f4;return function(_0x3f4039){logger[_0x8267('0x2c')](_0x3f4039[_0x8267('0x2d')]);if(_0x3f4039['name']){delete _0x3f4039[_0x8267('0x2e')];}_0x42e09c[_0x8267('0x20')](_0x63253e)[_0x8267('0x2f')](_0x3f4039);};}exports[_0x8267('0x30')]=function(_0x1cc325,_0x5713c1){var _0x58acc8={},_0x260375={},_0x44d2f4={'count':0x0,'rows':[]};var _0x3da42c=_[_0x8267('0x31')](db[_0x8267('0x32')][_0x8267('0x33')],function(_0x25f21b){return{'name':_0x25f21b[_0x8267('0x34')],'type':_0x25f21b[_0x8267('0x35')][_0x8267('0x36')]};});_0x260375[_0x8267('0x37')]=_['map'](_0x3da42c,_0x8267('0x2e'));_0x260375['query']=_['keys'](_0x1cc325[_0x8267('0x38')]);_0x260375[_0x8267('0x39')]=_[_0x8267('0x3a')](_0x260375['model'],_0x260375[_0x8267('0x38')]);_0x58acc8['attributes']=_[_0x8267('0x3a')](_0x260375['model'],qs[_0x8267('0x3b')](_0x1cc325[_0x8267('0x38')][_0x8267('0x3b')]));_0x58acc8[_0x8267('0x3c')]=_0x58acc8[_0x8267('0x3c')][_0x8267('0x3d')]?_0x58acc8[_0x8267('0x3c')]:_0x260375[_0x8267('0x37')];if(!_0x1cc325['query'][_0x8267('0x3e')]('nolimit')){_0x58acc8[_0x8267('0x24')]=qs[_0x8267('0x24')](_0x1cc325[_0x8267('0x38')]['limit']);_0x58acc8['offset']=qs[_0x8267('0x22')](_0x1cc325[_0x8267('0x38')][_0x8267('0x22')]);}_0x58acc8[_0x8267('0x3f')]=qs[_0x8267('0x40')](_0x1cc325[_0x8267('0x38')][_0x8267('0x40')]);_0x58acc8['where']=qs[_0x8267('0x39')](_[_0x8267('0x41')](_0x1cc325[_0x8267('0x38')],_0x260375[_0x8267('0x39')]),_0x3da42c);if(_0x1cc325[_0x8267('0x38')][_0x8267('0x42')]){_0x58acc8[_0x8267('0x43')]=_['merge'](_0x58acc8[_0x8267('0x43')],{'$or':_[_0x8267('0x31')](_0x3da42c,function(_0x2a10cb){if(_0x2a10cb['type']!=='VIRTUAL'){var _0x376456={};_0x376456[_0x2a10cb[_0x8267('0x2e')]]={'$like':'%'+_0x1cc325[_0x8267('0x38')][_0x8267('0x42')]+'%'};return _0x376456;}})});}_0x58acc8=_[_0x8267('0x44')]({},_0x58acc8,_0x1cc325[_0x8267('0x45')]);var _0x1d507f={'where':_0x58acc8[_0x8267('0x43')]};return db['WhatsappQueue'][_0x8267('0x25')](_0x1d507f)[_0x8267('0x28')](function(_0x272a50){_0x44d2f4[_0x8267('0x25')]=_0x272a50;if(_0x1cc325[_0x8267('0x38')][_0x8267('0x46')]){_0x58acc8[_0x8267('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x8267('0x48')](_0x58acc8);})[_0x8267('0x28')](function(_0x4d7703){_0x44d2f4['rows']=_0x4d7703;return _0x44d2f4;})[_0x8267('0x28')](respondWithFilteredResult(_0x5713c1,_0x58acc8))['catch'](handleError(_0x5713c1,null));};exports['show']=function(_0x132f14,_0x40a25e){var _0xd048a7={'raw':!![],'where':{'id':_0x132f14[_0x8267('0x49')]['id']}},_0x18b42e={};_0x18b42e[_0x8267('0x37')]=_[_0x8267('0x4a')](db[_0x8267('0x32')][_0x8267('0x33')]);_0x18b42e[_0x8267('0x38')]=_['keys'](_0x132f14[_0x8267('0x38')]);_0x18b42e[_0x8267('0x39')]=_[_0x8267('0x3a')](_0x18b42e[_0x8267('0x37')],_0x18b42e[_0x8267('0x38')]);_0xd048a7[_0x8267('0x3c')]=_[_0x8267('0x3a')](_0x18b42e['model'],qs[_0x8267('0x3b')](_0x132f14[_0x8267('0x38')][_0x8267('0x3b')]));_0xd048a7[_0x8267('0x3c')]=_0xd048a7[_0x8267('0x3c')][_0x8267('0x3d')]?_0xd048a7[_0x8267('0x3c')]:_0x18b42e[_0x8267('0x37')];if(_0x132f14['query'][_0x8267('0x46')]){_0xd048a7[_0x8267('0x47')]=[{'all':!![]}];}_0xd048a7=_[_0x8267('0x44')]({},_0xd048a7,_0x132f14[_0x8267('0x45')]);return db['WhatsappQueue'][_0x8267('0x4b')](_0xd048a7)[_0x8267('0x28')](handleEntityNotFound(_0x40a25e,null))['then'](respondWithResult(_0x40a25e,null))[_0x8267('0x4c')](handleError(_0x40a25e,null));};exports[_0x8267('0x4d')]=function(_0x4d6dcf,_0x510d11){return db[_0x8267('0x32')][_0x8267('0x4d')](_0x4d6dcf['body'],{})[_0x8267('0x28')](function(_0x581ab3){var _0xa1ca18=_0x4d6dcf[_0x8267('0x4e')][_0x8267('0x4f')]({'plain':!![]});if(!_0xa1ca18)throw new Error(_0x8267('0x50'));if(_0xa1ca18['role']===_0x8267('0x4e')){var _0x250743=_0x581ab3[_0x8267('0x4f')]({'plain':!![]});var _0x3d8bb1=_0x8267('0x2a');return db[_0x8267('0x51')][_0x8267('0x4b')]({'where':{'name':_0x3d8bb1,'userProfileId':_0xa1ca18['userProfileId']},'raw':!![]})[_0x8267('0x28')](function(_0x43d83f){if(_0x43d83f&&_0x43d83f[_0x8267('0x52')]===0x0){return db[_0x8267('0x2b')][_0x8267('0x4d')]({'name':_0x250743[_0x8267('0x2e')],'resourceId':_0x250743['id'],'type':_0x43d83f['name'],'sectionId':_0x43d83f['id']},{})[_0x8267('0x28')](function(){return _0x581ab3;});}else{return _0x581ab3;}})[_0x8267('0x4c')](function(_0x8864ca){logger[_0x8267('0x2c')](_0x8267('0x53'),_0x8864ca);throw _0x8864ca;});}return _0x581ab3;})[_0x8267('0x28')](respondWithResult(_0x510d11,0xc9))[_0x8267('0x4c')](handleError(_0x510d11,null));};exports[_0x8267('0x54')]=function(_0xcab56d,_0x410e40){if(_0xcab56d[_0x8267('0x55')]['id']){delete _0xcab56d[_0x8267('0x55')]['id'];}return db[_0x8267('0x32')][_0x8267('0x4b')]({'where':{'id':_0xcab56d[_0x8267('0x49')]['id']}})['then'](handleEntityNotFound(_0x410e40,null))[_0x8267('0x28')](saveUpdates(_0xcab56d[_0x8267('0x55')],null))[_0x8267('0x28')](respondWithResult(_0x410e40,null))[_0x8267('0x4c')](handleError(_0x410e40,null));};exports['destroy']=function(_0x561c91,_0x4bdeee){return db[_0x8267('0x32')][_0x8267('0x4b')]({'where':{'id':_0x561c91['params']['id']}})['then'](handleEntityNotFound(_0x4bdeee,null))[_0x8267('0x28')](removeEntity(_0x4bdeee,null))[_0x8267('0x4c')](handleError(_0x4bdeee,null));};exports[_0x8267('0x56')]=function(_0x3a7ec8,_0x591b90){return db[_0x8267('0x32')][_0x8267('0x56')]()[_0x8267('0x28')](respondWithResult(_0x591b90,null))[_0x8267('0x4c')](handleError(_0x591b90,null));};exports[_0x8267('0x57')]=function(_0x4dcbf9,_0x3de8f4,_0x38b849){var _0x415c67={'raw':!![],'where':{}},_0x592699={},_0x5f3228;return db[_0x8267('0x32')]['findOne']({'where':{'id':_0x4dcbf9[_0x8267('0x49')]['id']}})[_0x8267('0x28')](handleEntityNotFound(_0x3de8f4,null))[_0x8267('0x28')](function(_0x31bf3b){if(_0x31bf3b){_0x5f3228=_0x31bf3b[_0x8267('0x4f')]({'plain':!![]});_0x592699[_0x8267('0x37')]=_[_0x8267('0x4a')](db[_0x8267('0x58')][_0x8267('0x33')]);_0x592699[_0x8267('0x38')]=_['keys'](_0x4dcbf9[_0x8267('0x38')]);_0x592699[_0x8267('0x39')]=_[_0x8267('0x3a')](_0x592699[_0x8267('0x37')],_0x592699[_0x8267('0x38')]);_0x415c67[_0x8267('0x3c')]=_['intersection'](_0x592699[_0x8267('0x37')],qs[_0x8267('0x3b')](_0x4dcbf9[_0x8267('0x38')]['fields']));_0x415c67[_0x8267('0x3c')]=_0x415c67['attributes'][_0x8267('0x3d')]?_0x415c67[_0x8267('0x3c')]:_0x592699[_0x8267('0x37')];if(!_0x4dcbf9[_0x8267('0x38')][_0x8267('0x3e')](_0x8267('0x59'))){_0x415c67[_0x8267('0x24')]=qs[_0x8267('0x24')](_0x4dcbf9[_0x8267('0x38')][_0x8267('0x24')]);_0x415c67[_0x8267('0x22')]=qs['offset'](_0x4dcbf9[_0x8267('0x38')]['offset']);}_0x415c67['order']=qs['sort'](_0x4dcbf9[_0x8267('0x38')][_0x8267('0x40')]);_0x415c67['where']=qs[_0x8267('0x39')](_[_0x8267('0x41')](_0x4dcbf9[_0x8267('0x38')],_0x592699['filters']));_0x415c67[_0x8267('0x43')][_0x8267('0x5a')]=_0x31bf3b['id'];if(_0x4dcbf9[_0x8267('0x38')][_0x8267('0x42')]){_0x415c67['where']=_[_0x8267('0x44')](_0x415c67[_0x8267('0x43')],{'$or':_[_0x8267('0x31')](_0x415c67['attributes'],function(_0x23f631){var _0x390a60={};_0x390a60[_0x23f631]={'$like':'%'+_0x4dcbf9[_0x8267('0x38')][_0x8267('0x42')]+'%'};return _0x390a60;})});}_0x415c67=_[_0x8267('0x44')]({},_0x415c67,_0x4dcbf9[_0x8267('0x45')]);return db[_0x8267('0x58')][_0x8267('0x48')](_0x415c67);}})['then'](function(_0x2980df){if(_0x2980df){return db['User']['findAndCountAll']({'where':{'id':_[_0x8267('0x31')](_0x2980df,_0x8267('0x5b')),'role':_0x8267('0x5c')},'attributes':['id',_0x8267('0x2e'),_0x8267('0x5d'),_0x8267('0x5e'),'createdAt']});}})[_0x8267('0x28')](function(_0x5b9eeb){if(_0x5b9eeb){return{'count':_0x5b9eeb[_0x8267('0x25')],'rows':_['map'](_0x5b9eeb[_0x8267('0x5f')],function(_0x1ec94b){return{'membername':_0x1ec94b[_0x8267('0x2e')],'UserId':_0x1ec94b['id'],'queue_name':_0x5f3228[_0x8267('0x2e')],'WhatsappQueueId':_0x5f3228['id'],'interface':util[_0x8267('0x60')]('%s/%s','SIP',_0x1ec94b['name']),'penalty':0x0,'paused':_0x1ec94b[_0x8267('0x5d')],'createdAt':_0x1ec94b['createdAt'],'updatedAt':_0x1ec94b[_0x8267('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3de8f4,_0x415c67))['catch'](handleError(_0x3de8f4,null));};exports[_0x8267('0x61')]=function(_0x792ebc,_0x1f7a08,_0x2f4367){var _0x4d9570={};var _0x22bf40={};var _0x429791;var _0x599602;return db['WhatsappQueue'][_0x8267('0x62')]({'where':{'id':_0x792ebc['params']['id']}})[_0x8267('0x28')](handleEntityNotFound(_0x1f7a08,null))[_0x8267('0x28')](function(_0x29d0b7){if(_0x29d0b7){_0x429791=_0x29d0b7;_0x22bf40[_0x8267('0x37')]=_[_0x8267('0x4a')](db['Team'][_0x8267('0x33')]);_0x22bf40[_0x8267('0x38')]=_['keys'](_0x792ebc[_0x8267('0x38')]);_0x22bf40['filters']=_['intersection'](_0x22bf40[_0x8267('0x37')],_0x22bf40[_0x8267('0x38')]);_0x4d9570[_0x8267('0x3c')]=_['intersection'](_0x22bf40[_0x8267('0x37')],qs[_0x8267('0x3b')](_0x792ebc[_0x8267('0x38')]['fields']));_0x4d9570[_0x8267('0x3c')]=_0x4d9570[_0x8267('0x3c')][_0x8267('0x3d')]?_0x4d9570[_0x8267('0x3c')]:_0x22bf40['model'];_0x4d9570[_0x8267('0x3f')]=qs[_0x8267('0x40')](_0x792ebc['query']['sort']);_0x4d9570[_0x8267('0x43')]=qs[_0x8267('0x39')](_[_0x8267('0x41')](_0x792ebc[_0x8267('0x38')],_0x22bf40[_0x8267('0x39')]));if(_0x792ebc[_0x8267('0x38')][_0x8267('0x42')]){_0x4d9570[_0x8267('0x43')]=_[_0x8267('0x44')](_0x4d9570[_0x8267('0x43')],{'$or':_[_0x8267('0x31')](_0x4d9570[_0x8267('0x3c')],function(_0x5d15c2){var _0x57c81f={};_0x57c81f[_0x5d15c2]={'$like':'%'+_0x792ebc[_0x8267('0x38')][_0x8267('0x42')]+'%'};return _0x57c81f;})});}_0x4d9570=_['merge']({},_0x4d9570,_0x792ebc[_0x8267('0x45')]);return _0x429791[_0x8267('0x61')](_0x4d9570);}})[_0x8267('0x28')](function(_0x3975a0){if(_0x3975a0){_0x599602=_0x3975a0[_0x8267('0x3d')];if(!_0x792ebc[_0x8267('0x38')][_0x8267('0x3e')](_0x8267('0x59'))){_0x4d9570[_0x8267('0x24')]=qs[_0x8267('0x24')](_0x792ebc[_0x8267('0x38')][_0x8267('0x24')]);_0x4d9570[_0x8267('0x22')]=qs[_0x8267('0x22')](_0x792ebc['query'][_0x8267('0x22')]);}return _0x429791[_0x8267('0x61')](_0x4d9570);}})[_0x8267('0x28')](function(_0x497672){if(_0x497672){return _0x497672?{'count':_0x599602,'rows':_0x497672}:null;}})[_0x8267('0x28')](respondWithResult(_0x1f7a08,null))[_0x8267('0x4c')](handleError(_0x1f7a08,null));};exports[_0x8267('0x63')]=function(_0x325b4b,_0x3414f0,_0x260bef){var _0x40a3e3=_0x325b4b[_0x8267('0x55')]['ids'];return db['Team'][_0x8267('0x48')]({'where':{'id':_0x40a3e3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8267('0x64'),'attributes':['id',_0x8267('0x2e'),_0x8267('0x65'),_0x8267('0x66'),_0x8267('0x67')],'raw':!![]}]})['then'](function(_0x212074){if(_0x212074){var _0x284294=_[_0x8267('0x68')](_0x212074,function(_0x181004){var _0x5f1318=_0x181004[_0x8267('0x4f')]({'plain':!![]});return _0x5f1318[_0x8267('0x64')];});return db[_0x8267('0x32')]['find']({'where':{'id':_0x325b4b[_0x8267('0x49')]['id']}})[_0x8267('0x28')](function(_0x1d688d){return db[_0x8267('0x69')][_0x8267('0x6a')](function(_0xa344b9){return _0x1d688d[_0x8267('0x63')](_0x40a3e3,{'transaction':_0xa344b9})[_0x8267('0x28')](function(){return BPromise[_0x8267('0x6b')](_0x284294,function(_0x2cc495){return db[_0x8267('0x58')][_0x8267('0x6c')]({'where':{'UserId':_0x2cc495['id'],'WhatsappQueueId':_0x325b4b['params']['id']},'transaction':_0xa344b9});});})['then'](function(){_0x284294[_0x8267('0x6d')](function(_0x10f7d5){socket[_0x8267('0x6e')](_0x8267('0x6f'),{'UserId':_0x10f7d5['id'],'WhatsappQueueId':_0x1d688d['id']});});});});});}})[_0x8267('0x28')](respondWithStatusCode(_0x3414f0,null))[_0x8267('0x4c')](handleError(_0x3414f0,null));};exports[_0x8267('0x70')]=function(_0x59de80,_0x4ff998,_0x158bbd){return db['Team'][_0x8267('0x48')]({'where':{'id':_0x59de80[_0x8267('0x38')][_0x8267('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8267('0x72')],'as':_0x8267('0x64'),'attributes':['id'],'raw':!![]}]})[_0x8267('0x28')](handleEntityNotFound(_0x4ff998,null))[_0x8267('0x28')](function(_0x2c7bff){var _0x5c021d=_['map'](_0x2c7bff,'id');var _0x5d43c5=[];var _0x21a0ab=[];var _0x5e7a1d=squel[_0x8267('0x73')]();_0x5e7a1d[_0x8267('0x74')](_0x8267('0x75'))['from'](_0x8267('0x76'),'tq')['join'](_0x8267('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8267('0x78'),_0x59de80[_0x8267('0x49')]['id']);for(var _0x296881=0x0;_0x296881<_0x2c7bff[_0x8267('0x3d')];_0x296881+=0x1){let _0x4eed15=_0x2c7bff[_0x296881];for(var _0x2608b9=0x0;_0x2608b9<_0x4eed15[_0x8267('0x64')][_0x8267('0x3d')];_0x2608b9+=0x1){let _0x1d179c=_0x4eed15[_0x8267('0x64')][_0x2608b9];var _0x1e2325=_0x5e7a1d[_0x8267('0x79')]();_0x1e2325['where'](_0x8267('0x7a'),_0x1d179c['id']);_0x21a0ab[_0x8267('0x7b')](db[_0x8267('0x69')][_0x8267('0x38')](_0x1e2325[_0x8267('0x7c')](),{'type':db[_0x8267('0x69')]['QueryTypes'][_0x8267('0x7d')]})['then'](function(_0x29c89b){if(_0x29c89b[_0x8267('0x3d')]===0x1){return _0x1d179c['id'];}else{var _0x2c42f9=_['every'](_['map'](_0x29c89b,'TeamId'),function(_0x580eae){return _[_0x8267('0x7e')](_0x5c021d,_0x580eae);});if(_0x2c42f9){return _0x1d179c['id'];}}}));}}return BPromise[_0x8267('0x7f')](_0x21a0ab)[_0x8267('0x28')](function(_0x48e79a){_0x5d43c5=_(_0x5d43c5)[_0x8267('0x80')](_0x48e79a)[_0x8267('0x81')]()['value']();return db[_0x8267('0x32')][_0x8267('0x4b')]({'where':{'id':_0x59de80['params']['id']}})[_0x8267('0x28')](function(_0x2a8b84){return db[_0x8267('0x69')][_0x8267('0x6a')](function(_0x281c7c){return _0x2a8b84[_0x8267('0x70')](_0x59de80[_0x8267('0x38')][_0x8267('0x71')],{'transaction':_0x281c7c})[_0x8267('0x28')](function(){if(!_[_0x8267('0x82')](_0x5d43c5)){return _0x2a8b84['removeAgents'](_0x5d43c5,{'transaction':_0x281c7c});}})[_0x8267('0x28')](function(){_0x5d43c5['forEach'](function(_0x48ff62){socket[_0x8267('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x48ff62,'WhatsappQueueId':_0x2a8b84['id']});});});});});});})['then'](respondWithStatusCode(_0x4ff998,null))[_0x8267('0x4c')](handleError(_0x4ff998,null));};exports[_0x8267('0x83')]=function(_0x5b5d87,_0x44c979,_0x301541){return db['WhatsappQueue']['find']({'where':{'id':_0x5b5d87['params']['id']}})[_0x8267('0x28')](handleEntityNotFound(_0x44c979,null))[_0x8267('0x28')](function(_0x144bc3){if(_0x144bc3){return _0x144bc3['addAgents'](_0x5b5d87[_0x8267('0x55')][_0x8267('0x71')],_[_0x8267('0x84')](_0x5b5d87[_0x8267('0x55')],[_0x8267('0x71'),'id'])||{})[_0x8267('0x85')](function(_0xc1c4a2){for(var _0x3626e3=0x0;_0x3626e3<_0x5b5d87[_0x8267('0x55')]['ids'][_0x8267('0x3d')];_0x3626e3+=0x1){socket[_0x8267('0x6e')]('userWhatsappQueue:save',{'UserId':Number(_0x5b5d87['body'][_0x8267('0x71')][_0x3626e3]),'WhatsappQueueId':Number(_0x5b5d87[_0x8267('0x49')]['id'])});}return _0xc1c4a2;});}})['then'](respondWithResult(_0x44c979,null))[_0x8267('0x4c')](handleError(_0x44c979,null));};exports['removeAgents']=function(_0x102fc6,_0xc8815,_0x3259a7){return db[_0x8267('0x32')]['find']({'where':{'id':_0x102fc6[_0x8267('0x49')]['id']}})[_0x8267('0x28')](handleEntityNotFound(_0xc8815,null))[_0x8267('0x28')](function(_0x1b8bb1){if(_0x1b8bb1){return _0x1b8bb1['removeAgents'](_0x102fc6['query']['ids'])[_0x8267('0x28')](function(){if(_[_0x8267('0x86')](_0x102fc6[_0x8267('0x38')]['ids'])){for(var _0x482400=0x0;_0x482400<_0x102fc6[_0x8267('0x38')][_0x8267('0x71')][_0x8267('0x3d')];_0x482400+=0x1){socket[_0x8267('0x6e')](_0x8267('0x87'),{'UserId':Number(_0x102fc6[_0x8267('0x38')]['ids'][_0x482400]),'WhatsappQueueId':Number(_0x102fc6['params']['id'])});}}else{socket['emit'](_0x8267('0x87'),{'UserId':Number(_0x102fc6[_0x8267('0x38')]['ids']),'WhatsappQueueId':Number(_0x102fc6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xc8815,null))['catch'](handleError(_0xc8815,null));};exports['getAgents']=function(_0x7bac1f,_0x17e14f,_0x326232){var _0xc6ec8c={};var _0xeea5e3={};var _0x5506c9;var _0x5af805;return db[_0x8267('0x32')][_0x8267('0x62')]({'where':{'id':_0x7bac1f[_0x8267('0x49')]['id']}})[_0x8267('0x28')](handleEntityNotFound(_0x17e14f,null))['then'](function(_0x35f80){if(_0x35f80){_0x5506c9=_0x35f80;_0xeea5e3['model']=_[_0x8267('0x4a')](db[_0x8267('0x72')]['rawAttributes']);_0xeea5e3[_0x8267('0x38')]=_[_0x8267('0x4a')](_0x7bac1f['query']);_0xeea5e3[_0x8267('0x39')]=_[_0x8267('0x3a')](_0xeea5e3[_0x8267('0x37')],_0xeea5e3[_0x8267('0x38')]);_0xc6ec8c[_0x8267('0x3c')]=_[_0x8267('0x3a')](_0xeea5e3['model'],qs[_0x8267('0x3b')](_0x7bac1f[_0x8267('0x38')][_0x8267('0x3b')]));_0xc6ec8c[_0x8267('0x3c')]=_0xc6ec8c[_0x8267('0x3c')]['length']?_0xc6ec8c[_0x8267('0x3c')]:_0xeea5e3[_0x8267('0x37')];_0xc6ec8c[_0x8267('0x3f')]=qs[_0x8267('0x40')](_0x7bac1f[_0x8267('0x38')][_0x8267('0x40')]);_0xc6ec8c['where']=qs['filters'](_[_0x8267('0x41')](_0x7bac1f[_0x8267('0x38')],_0xeea5e3[_0x8267('0x39')]));if(_0x7bac1f[_0x8267('0x38')]['filter']){_0xc6ec8c[_0x8267('0x43')]=_['merge'](_0xc6ec8c[_0x8267('0x43')],{'$or':_[_0x8267('0x31')](_0xc6ec8c[_0x8267('0x3c')],function(_0x1c2524){var _0x510dbf={};_0x510dbf[_0x1c2524]={'$like':'%'+_0x7bac1f[_0x8267('0x38')]['filter']+'%'};return _0x510dbf;})});}_0xc6ec8c=_[_0x8267('0x44')]({},_0xc6ec8c,_0x7bac1f[_0x8267('0x45')]);return _0x5506c9[_0x8267('0x88')](_0xc6ec8c);}})[_0x8267('0x28')](function(_0x8d9f4b){if(_0x8d9f4b){_0x5af805=_0x8d9f4b['length'];if(!_0x7bac1f['query'][_0x8267('0x3e')](_0x8267('0x59'))){_0xc6ec8c[_0x8267('0x24')]=qs[_0x8267('0x24')](_0x7bac1f[_0x8267('0x38')][_0x8267('0x24')]);_0xc6ec8c[_0x8267('0x22')]=qs['offset'](_0x7bac1f[_0x8267('0x38')][_0x8267('0x22')]);}return _0x5506c9[_0x8267('0x88')](_0xc6ec8c);}})[_0x8267('0x28')](function(_0x351e0b){if(_0x351e0b){return _0x351e0b?{'count':_0x5af805,'rows':_0x351e0b}:null;}})['then'](respondWithResult(_0x17e14f,null))[_0x8267('0x4c')](handleError(_0x17e14f,null));}; \ No newline at end of file +var _0xc4cf=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','WhatsappQueues','end','error','stack','name','send','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserWhatsappQueue','hasOwnProperty','nolimit','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x13931a,_0x1c9eb5){var _0x58a813=function(_0x81cdcf){while(--_0x81cdcf){_0x13931a['push'](_0x13931a['shift']());}};_0x58a813(++_0x1c9eb5);}(_0xc4cf,0x10f));var _0xfc4c=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xc4cf[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc4c('0x0'));var zipdir=require(_0xfc4c('0x1'));var jsonpatch=require(_0xfc4c('0x2'));var rp=require(_0xfc4c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfc4c('0x4'));var sox=require('sox');var csv=require(_0xfc4c('0x5'));var ejs=require(_0xfc4c('0x6'));var fs=require('fs');var fs_extra=require(_0xfc4c('0x7'));var _=require(_0xfc4c('0x8'));var squel=require(_0xfc4c('0x9'));var crypto=require(_0xfc4c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc4c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfc4c('0xc'));var Redis=require('ioredis');var authService=require(_0xfc4c('0xd'));var qs=require(_0xfc4c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc4c('0xf'));var logger=require(_0xfc4c('0x10'))(_0xfc4c('0x11'));var utils=require(_0xfc4c('0x12'));var config=require(_0xfc4c('0x13'));var licenseUtil=require(_0xfc4c('0x14'));var db=require(_0xfc4c('0x15'))['db'];config[_0xfc4c('0x16')]=_['defaults'](config[_0xfc4c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc4c('0x17'))(new Redis(config['redis']));require(_0xfc4c('0x18'))[_0xfc4c('0x19')](socket);function respondWithStatusCode(_0x57ea02,_0x490c2f){_0x490c2f=_0x490c2f||0xcc;return function(_0x237c1e){if(_0x237c1e){return _0x57ea02[_0xfc4c('0x1a')](_0x490c2f);}return _0x57ea02['status'](_0x490c2f)['end']();};}function respondWithResult(_0x26f420,_0x112008){_0x112008=_0x112008||0xc8;return function(_0x293904){if(_0x293904){return _0x26f420[_0xfc4c('0x1b')](_0x112008)['json'](_0x293904);}};}function respondWithFilteredResult(_0x2940fb,_0x3a89db){return function(_0x1d43fd){if(_0x1d43fd){var _0xc88b30=typeof _0x3a89db[_0xfc4c('0x1c')]===_0xfc4c('0x1d')&&typeof _0x3a89db[_0xfc4c('0x1e')]===_0xfc4c('0x1d');var _0x40c9b4=_0x1d43fd['count'];var _0x244d54=_0xc88b30?0x0:_0x3a89db['offset'];var _0x35375c=_0xc88b30?_0x1d43fd['count']:_0x3a89db[_0xfc4c('0x1c')]+_0x3a89db[_0xfc4c('0x1e')];var _0xfcf9f7;if(_0x35375c>=_0x40c9b4){_0x35375c=_0x40c9b4;_0xfcf9f7=0xc8;}else{_0xfcf9f7=0xce;}_0x2940fb[_0xfc4c('0x1b')](_0xfcf9f7);return _0x2940fb[_0xfc4c('0x1f')](_0xfc4c('0x20'),_0x244d54+'-'+_0x35375c+'/'+_0x40c9b4)[_0xfc4c('0x21')](_0x1d43fd);}return null;};}function patchUpdates(_0x3da899){return function(_0x44f566){try{jsonpatch[_0xfc4c('0x22')](_0x44f566,_0x3da899,!![]);}catch(_0x35d179){return BPromise['reject'](_0x35d179);}return _0x44f566[_0xfc4c('0x23')]();};}function saveUpdates(_0x542459,_0x429524){return function(_0x44b225){if(_0x44b225){return _0x44b225[_0xfc4c('0x24')](_0x542459)[_0xfc4c('0x25')](function(_0x5c0f2f){return _0x5c0f2f;});}return null;};}function removeEntity(_0x178069,_0x92b3f4){return function(_0xc1bc08){if(_0xc1bc08){return _0xc1bc08[_0xfc4c('0x26')]()[_0xfc4c('0x25')](function(){var _0x517527=_0xc1bc08['get']({'plain':!![]});var _0x42fc7e=_0xfc4c('0x27');return db['UserProfileResource'][_0xfc4c('0x26')]({'where':{'type':_0x42fc7e,'resourceId':_0x517527['id']}})[_0xfc4c('0x25')](function(){return _0xc1bc08;});})[_0xfc4c('0x25')](function(){_0x178069[_0xfc4c('0x1b')](0xcc)[_0xfc4c('0x28')]();});}};}function handleEntityNotFound(_0x4e7425,_0x56dfd3){return function(_0x12900f){if(!_0x12900f){_0x4e7425[_0xfc4c('0x1a')](0x194);}return _0x12900f;};}function handleError(_0x54d289,_0xf84a5c){_0xf84a5c=_0xf84a5c||0x1f4;return function(_0x5587f6){logger[_0xfc4c('0x29')](_0x5587f6[_0xfc4c('0x2a')]);if(_0x5587f6[_0xfc4c('0x2b')]){delete _0x5587f6[_0xfc4c('0x2b')];}_0x54d289['status'](_0xf84a5c)[_0xfc4c('0x2c')](_0x5587f6);};}exports['index']=function(_0x1a2839,_0x3ab737){var _0x577dd6={},_0x49feec={},_0x575a47={'count':0x0,'rows':[]};var _0x339034=_[_0xfc4c('0x2d')](db[_0xfc4c('0x2e')]['rawAttributes'],function(_0x567c13){return{'name':_0x567c13[_0xfc4c('0x2f')],'type':_0x567c13[_0xfc4c('0x30')][_0xfc4c('0x31')]};});_0x49feec[_0xfc4c('0x32')]=_[_0xfc4c('0x2d')](_0x339034,_0xfc4c('0x2b'));_0x49feec[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0x1a2839[_0xfc4c('0x33')]);_0x49feec[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x49feec[_0xfc4c('0x32')],_0x49feec['query']);_0x577dd6[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x49feec[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x577dd6['attributes']=_0x577dd6[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x577dd6[_0xfc4c('0x37')]:_0x49feec[_0xfc4c('0x32')];if(!_0x1a2839[_0xfc4c('0x33')]['hasOwnProperty']('nolimit')){_0x577dd6[_0xfc4c('0x1e')]=qs[_0xfc4c('0x1e')](_0x1a2839[_0xfc4c('0x33')]['limit']);_0x577dd6[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x1c')]);}_0x577dd6[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3b')]);_0x577dd6[_0xfc4c('0x3c')]=qs[_0xfc4c('0x35')](_['pick'](_0x1a2839[_0xfc4c('0x33')],_0x49feec['filters']),_0x339034);if(_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3d')]){_0x577dd6[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x577dd6[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x339034,function(_0x277514){if(_0x277514['type']!=='VIRTUAL'){var _0x597502={};_0x597502[_0x277514[_0xfc4c('0x2b')]]={'$like':'%'+_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x597502;}})});}_0x577dd6=_[_0xfc4c('0x3e')]({},_0x577dd6,_0x1a2839[_0xfc4c('0x3f')]);var _0xfb8be6={'where':_0x577dd6[_0xfc4c('0x3c')]};return db[_0xfc4c('0x2e')][_0xfc4c('0x40')](_0xfb8be6)[_0xfc4c('0x25')](function(_0x3d0316){_0x575a47[_0xfc4c('0x40')]=_0x3d0316;if(_0x1a2839['query'][_0xfc4c('0x41')]){_0x577dd6[_0xfc4c('0x42')]=[{'all':!![]}];}return db[_0xfc4c('0x2e')][_0xfc4c('0x43')](_0x577dd6);})[_0xfc4c('0x25')](function(_0x5b3223){_0x575a47[_0xfc4c('0x44')]=_0x5b3223;return _0x575a47;})[_0xfc4c('0x25')](respondWithFilteredResult(_0x3ab737,_0x577dd6))[_0xfc4c('0x45')](handleError(_0x3ab737,null));};exports[_0xfc4c('0x46')]=function(_0xfae758,_0x5dccd1){var _0x504279={'raw':!![],'where':{'id':_0xfae758[_0xfc4c('0x47')]['id']}},_0x2eef16={};_0x2eef16[_0xfc4c('0x32')]=_[_0xfc4c('0x34')](db[_0xfc4c('0x2e')][_0xfc4c('0x48')]);_0x2eef16[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0xfae758[_0xfc4c('0x33')]);_0x2eef16[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x2eef16['model'],_0x2eef16[_0xfc4c('0x33')]);_0x504279[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x2eef16['model'],qs['fields'](_0xfae758[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x504279[_0xfc4c('0x37')]=_0x504279[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x504279[_0xfc4c('0x37')]:_0x2eef16[_0xfc4c('0x32')];if(_0xfae758[_0xfc4c('0x33')][_0xfc4c('0x41')]){_0x504279[_0xfc4c('0x42')]=[{'all':!![]}];}_0x504279=_['merge']({},_0x504279,_0xfae758[_0xfc4c('0x3f')]);return db[_0xfc4c('0x2e')][_0xfc4c('0x49')](_0x504279)['then'](handleEntityNotFound(_0x5dccd1,null))['then'](respondWithResult(_0x5dccd1,null))[_0xfc4c('0x45')](handleError(_0x5dccd1,null));};exports['create']=function(_0x523428,_0x24d356){return db[_0xfc4c('0x2e')]['create'](_0x523428[_0xfc4c('0x4a')],{})[_0xfc4c('0x25')](function(_0x5337e8){var _0x479ab5=_0x523428[_0xfc4c('0x4b')][_0xfc4c('0x4c')]({'plain':!![]});if(!_0x479ab5)throw new Error(_0xfc4c('0x4d'));if(_0x479ab5[_0xfc4c('0x4e')]===_0xfc4c('0x4b')){var _0x261873=_0x5337e8[_0xfc4c('0x4c')]({'plain':!![]});var _0x4d2fa4=_0xfc4c('0x27');return db['UserProfileSection'][_0xfc4c('0x49')]({'where':{'name':_0x4d2fa4,'userProfileId':_0x479ab5[_0xfc4c('0x4f')]},'raw':!![]})['then'](function(_0x2a2d5d){if(_0x2a2d5d&&_0x2a2d5d[_0xfc4c('0x50')]===0x0){return db[_0xfc4c('0x51')][_0xfc4c('0x52')]({'name':_0x261873[_0xfc4c('0x2b')],'resourceId':_0x261873['id'],'type':_0x2a2d5d[_0xfc4c('0x2b')],'sectionId':_0x2a2d5d['id']},{})[_0xfc4c('0x25')](function(){return _0x5337e8;});}else{return _0x5337e8;}})[_0xfc4c('0x45')](function(_0x1a13f3){logger[_0xfc4c('0x29')](_0xfc4c('0x53'),_0x1a13f3);throw _0x1a13f3;});}return _0x5337e8;})[_0xfc4c('0x25')](respondWithResult(_0x24d356,0xc9))[_0xfc4c('0x45')](handleError(_0x24d356,null));};exports[_0xfc4c('0x24')]=function(_0x324a0a,_0x1a7480){if(_0x324a0a[_0xfc4c('0x4a')]['id']){delete _0x324a0a['body']['id'];}return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x324a0a[_0xfc4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a7480,null))[_0xfc4c('0x25')](saveUpdates(_0x324a0a[_0xfc4c('0x4a')],null))[_0xfc4c('0x25')](respondWithResult(_0x1a7480,null))[_0xfc4c('0x45')](handleError(_0x1a7480,null));};exports[_0xfc4c('0x26')]=function(_0x15e09e,_0x1c6fd4){return db['WhatsappQueue'][_0xfc4c('0x49')]({'where':{'id':_0x15e09e[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x1c6fd4,null))['then'](removeEntity(_0x1c6fd4,null))[_0xfc4c('0x45')](handleError(_0x1c6fd4,null));};exports[_0xfc4c('0x54')]=function(_0x5a3717,_0x4c3a87){return db[_0xfc4c('0x2e')]['describe']()[_0xfc4c('0x25')](respondWithResult(_0x4c3a87,null))[_0xfc4c('0x45')](handleError(_0x4c3a87,null));};exports['getMembers']=function(_0x21fe36,_0x39ead9,_0x237048){var _0x44716b={'raw':!![],'where':{}},_0x345619={},_0x3da383;return db[_0xfc4c('0x2e')]['findOne']({'where':{'id':_0x21fe36[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x39ead9,null))[_0xfc4c('0x25')](function(_0x4f90dc){if(_0x4f90dc){_0x3da383=_0x4f90dc[_0xfc4c('0x4c')]({'plain':!![]});_0x345619['model']=_['keys'](db[_0xfc4c('0x55')][_0xfc4c('0x48')]);_0x345619[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0x21fe36[_0xfc4c('0x33')]);_0x345619[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x345619[_0xfc4c('0x32')],_0x345619[_0xfc4c('0x33')]);_0x44716b['attributes']=_['intersection'](_0x345619[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x44716b[_0xfc4c('0x37')]=_0x44716b['attributes'][_0xfc4c('0x39')]?_0x44716b[_0xfc4c('0x37')]:_0x345619['model'];if(!_0x21fe36['query'][_0xfc4c('0x56')](_0xfc4c('0x57'))){_0x44716b['limit']=qs['limit'](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x1e')]);_0x44716b[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x21fe36['query']['offset']);}_0x44716b[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x3b')]);_0x44716b[_0xfc4c('0x3c')]=qs[_0xfc4c('0x35')](_[_0xfc4c('0x58')](_0x21fe36[_0xfc4c('0x33')],_0x345619[_0xfc4c('0x35')]));_0x44716b['where'][_0xfc4c('0x59')]=_0x4f90dc['id'];if(_0x21fe36[_0xfc4c('0x33')]['filter']){_0x44716b[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x44716b[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x44716b[_0xfc4c('0x37')],function(_0x224d21){var _0x520084={};_0x520084[_0x224d21]={'$like':'%'+_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x520084;})});}_0x44716b=_[_0xfc4c('0x3e')]({},_0x44716b,_0x21fe36[_0xfc4c('0x3f')]);return db[_0xfc4c('0x55')][_0xfc4c('0x43')](_0x44716b);}})[_0xfc4c('0x25')](function(_0x30c836){if(_0x30c836){return db[_0xfc4c('0x5a')][_0xfc4c('0x5b')]({'where':{'id':_[_0xfc4c('0x2d')](_0x30c836,_0xfc4c('0x5c')),'role':_0xfc4c('0x5d')},'attributes':['id','name',_0xfc4c('0x5e'),_0xfc4c('0x5f'),_0xfc4c('0x60')]});}})[_0xfc4c('0x25')](function(_0x5a906b){if(_0x5a906b){return{'count':_0x5a906b[_0xfc4c('0x40')],'rows':_[_0xfc4c('0x2d')](_0x5a906b[_0xfc4c('0x44')],function(_0x401a22){return{'membername':_0x401a22[_0xfc4c('0x2b')],'UserId':_0x401a22['id'],'queue_name':_0x3da383[_0xfc4c('0x2b')],'WhatsappQueueId':_0x3da383['id'],'interface':util[_0xfc4c('0x61')]('%s/%s',_0xfc4c('0x62'),_0x401a22[_0xfc4c('0x2b')]),'penalty':0x0,'paused':_0x401a22[_0xfc4c('0x5e')],'createdAt':_0x401a22[_0xfc4c('0x60')],'updatedAt':_0x401a22[_0xfc4c('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfc4c('0x25')](respondWithFilteredResult(_0x39ead9,_0x44716b))[_0xfc4c('0x45')](handleError(_0x39ead9,null));};exports[_0xfc4c('0x63')]=function(_0x10241e,_0x471518,_0x3fdbfb){var _0x4b18f3={};var _0x3c00c0={};var _0x3c1550;var _0x2afa5b;return db[_0xfc4c('0x2e')][_0xfc4c('0x64')]({'where':{'id':_0x10241e['params']['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x471518,null))[_0xfc4c('0x25')](function(_0x503ccb){if(_0x503ccb){_0x3c1550=_0x503ccb;_0x3c00c0[_0xfc4c('0x32')]=_[_0xfc4c('0x34')](db[_0xfc4c('0x65')][_0xfc4c('0x48')]);_0x3c00c0['query']=_[_0xfc4c('0x34')](_0x10241e['query']);_0x3c00c0[_0xfc4c('0x35')]=_['intersection'](_0x3c00c0[_0xfc4c('0x32')],_0x3c00c0[_0xfc4c('0x33')]);_0x4b18f3[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x3c00c0[_0xfc4c('0x32')],qs['fields'](_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x4b18f3[_0xfc4c('0x37')]=_0x4b18f3[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x4b18f3['attributes']:_0x3c00c0['model'];_0x4b18f3[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x10241e['query'][_0xfc4c('0x3b')]);_0x4b18f3[_0xfc4c('0x3c')]=qs['filters'](_[_0xfc4c('0x58')](_0x10241e[_0xfc4c('0x33')],_0x3c00c0[_0xfc4c('0x35')]));if(_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x3d')]){_0x4b18f3['where']=_['merge'](_0x4b18f3[_0xfc4c('0x3c')],{'$or':_['map'](_0x4b18f3[_0xfc4c('0x37')],function(_0x127afb){var _0x3fd6ad={};_0x3fd6ad[_0x127afb]={'$like':'%'+_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x3fd6ad;})});}_0x4b18f3=_[_0xfc4c('0x3e')]({},_0x4b18f3,_0x10241e[_0xfc4c('0x3f')]);return _0x3c1550['getTeams'](_0x4b18f3);}})[_0xfc4c('0x25')](function(_0x37ddb9){if(_0x37ddb9){_0x2afa5b=_0x37ddb9[_0xfc4c('0x39')];if(!_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x56')]('nolimit')){_0x4b18f3[_0xfc4c('0x1e')]=qs[_0xfc4c('0x1e')](_0x10241e[_0xfc4c('0x33')]['limit']);_0x4b18f3[_0xfc4c('0x1c')]=qs['offset'](_0x10241e[_0xfc4c('0x33')]['offset']);}return _0x3c1550[_0xfc4c('0x63')](_0x4b18f3);}})[_0xfc4c('0x25')](function(_0x266ea8){if(_0x266ea8){return _0x266ea8?{'count':_0x2afa5b,'rows':_0x266ea8}:null;}})[_0xfc4c('0x25')](respondWithResult(_0x471518,null))[_0xfc4c('0x45')](handleError(_0x471518,null));};exports[_0xfc4c('0x66')]=function(_0x306769,_0x49d638,_0xfaf987){var _0x49cee9=_0x306769['body'][_0xfc4c('0x67')];return db[_0xfc4c('0x65')][_0xfc4c('0x43')]({'where':{'id':_0x49cee9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfc4c('0x68'),'attributes':['id','name',_0xfc4c('0x69'),_0xfc4c('0x6a'),_0xfc4c('0x6b')],'raw':!![]}]})['then'](function(_0x5b7322){if(_0x5b7322){var _0x469a9c=_['flatMap'](_0x5b7322,function(_0x279931){var _0xec474f=_0x279931[_0xfc4c('0x4c')]({'plain':!![]});return _0xec474f[_0xfc4c('0x68')];});return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x306769['params']['id']}})[_0xfc4c('0x25')](function(_0x57a4c2){return db['sequelize'][_0xfc4c('0x6c')](function(_0xd8516d){return _0x57a4c2[_0xfc4c('0x66')](_0x49cee9,{'transaction':_0xd8516d})[_0xfc4c('0x25')](function(){return BPromise[_0xfc4c('0x6d')](_0x469a9c,function(_0x34c206){return db[_0xfc4c('0x55')][_0xfc4c('0x6e')]({'where':{'UserId':_0x34c206['id'],'WhatsappQueueId':_0x306769[_0xfc4c('0x47')]['id']},'transaction':_0xd8516d});});})['then'](function(){_0x469a9c[_0xfc4c('0x6f')](function(_0x307b6b){socket[_0xfc4c('0x70')](_0xfc4c('0x71'),{'UserId':_0x307b6b['id'],'WhatsappQueueId':_0x57a4c2['id']});});});});});}})['then'](respondWithStatusCode(_0x49d638,null))[_0xfc4c('0x45')](handleError(_0x49d638,null));};exports['removeTeams']=function(_0x1940e7,_0x2c0e16,_0x3477cb){return db[_0xfc4c('0x65')]['findAll']({'where':{'id':_0x1940e7[_0xfc4c('0x33')][_0xfc4c('0x67')]},'attributes':['id'],'include':[{'model':db[_0xfc4c('0x5a')],'as':_0xfc4c('0x68'),'attributes':['id'],'raw':!![]}]})[_0xfc4c('0x25')](handleEntityNotFound(_0x2c0e16,null))[_0xfc4c('0x25')](function(_0x4213d4){var _0x4d4471=_[_0xfc4c('0x2d')](_0x4213d4,'id');var _0x4e2e8e=[];var _0x1c8629=[];var _0x1f8356=squel['select']();_0x1f8356[_0xfc4c('0x72')](_0xfc4c('0x73'))[_0xfc4c('0x74')](_0xfc4c('0x75'),'tq')[_0xfc4c('0x76')](_0xfc4c('0x77'),'ut',_0xfc4c('0x78'))['where'](_0xfc4c('0x79'),_0x1940e7[_0xfc4c('0x47')]['id']);for(var _0x14232e=0x0;_0x14232e<_0x4213d4[_0xfc4c('0x39')];_0x14232e+=0x1){let _0x5b070f=_0x4213d4[_0x14232e];for(var _0x1123be=0x0;_0x1123be<_0x5b070f[_0xfc4c('0x68')]['length'];_0x1123be+=0x1){let _0x1a9af7=_0x5b070f['Agents'][_0x1123be];var _0x5407e5=_0x1f8356[_0xfc4c('0x7a')]();_0x5407e5[_0xfc4c('0x3c')](_0xfc4c('0x7b'),_0x1a9af7['id']);_0x1c8629[_0xfc4c('0x7c')](db[_0xfc4c('0x7d')][_0xfc4c('0x33')](_0x5407e5[_0xfc4c('0x7e')](),{'type':db['sequelize'][_0xfc4c('0x7f')]['SELECT']})[_0xfc4c('0x25')](function(_0x2dcf41){if(_0x2dcf41[_0xfc4c('0x39')]===0x1){return _0x1a9af7['id'];}else{var _0x368e48=_[_0xfc4c('0x80')](_['map'](_0x2dcf41,_0xfc4c('0x81')),function(_0x2c84fd){return _[_0xfc4c('0x82')](_0x4d4471,_0x2c84fd);});if(_0x368e48){return _0x1a9af7['id'];}}}));}}return BPromise[_0xfc4c('0x83')](_0x1c8629)[_0xfc4c('0x25')](function(_0x1d1062){_0x4e2e8e=_(_0x4e2e8e)[_0xfc4c('0x84')](_0x1d1062)[_0xfc4c('0x85')]()[_0xfc4c('0x86')]();return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x1940e7[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](function(_0x26e784){return db[_0xfc4c('0x7d')][_0xfc4c('0x6c')](function(_0x59b2ca){return _0x26e784[_0xfc4c('0x87')](_0x1940e7[_0xfc4c('0x33')]['ids'],{'transaction':_0x59b2ca})[_0xfc4c('0x25')](function(){if(!_[_0xfc4c('0x88')](_0x4e2e8e)){return _0x26e784[_0xfc4c('0x89')](_0x4e2e8e,{'transaction':_0x59b2ca});}})[_0xfc4c('0x25')](function(){_0x4e2e8e[_0xfc4c('0x6f')](function(_0x26909b){socket[_0xfc4c('0x70')](_0xfc4c('0x8a'),{'UserId':_0x26909b,'WhatsappQueueId':_0x26e784['id']});});});});});});})[_0xfc4c('0x25')](respondWithStatusCode(_0x2c0e16,null))[_0xfc4c('0x45')](handleError(_0x2c0e16,null));};exports[_0xfc4c('0x8b')]=function(_0x2ffcb5,_0xac1391,_0x351f7b){return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x2ffcb5[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0xac1391,null))['then'](function(_0x16ef18){if(_0x16ef18){return _0x16ef18[_0xfc4c('0x8b')](_0x2ffcb5['body'][_0xfc4c('0x67')],_[_0xfc4c('0x8c')](_0x2ffcb5[_0xfc4c('0x4a')],['ids','id'])||{})[_0xfc4c('0x8d')](function(_0x5002d8){for(var _0x58dda7=0x0;_0x58dda7<_0x2ffcb5[_0xfc4c('0x4a')][_0xfc4c('0x67')][_0xfc4c('0x39')];_0x58dda7+=0x1){socket[_0xfc4c('0x70')](_0xfc4c('0x71'),{'UserId':Number(_0x2ffcb5[_0xfc4c('0x4a')][_0xfc4c('0x67')][_0x58dda7]),'WhatsappQueueId':Number(_0x2ffcb5[_0xfc4c('0x47')]['id'])});}return _0x5002d8;});}})[_0xfc4c('0x25')](respondWithResult(_0xac1391,null))[_0xfc4c('0x45')](handleError(_0xac1391,null));};exports[_0xfc4c('0x89')]=function(_0x41875f,_0xcf1c81,_0x9e11e){return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x41875f[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0xcf1c81,null))[_0xfc4c('0x25')](function(_0x3cf8ba){if(_0x3cf8ba){return _0x3cf8ba['removeAgents'](_0x41875f[_0xfc4c('0x33')][_0xfc4c('0x67')])[_0xfc4c('0x25')](function(){if(_[_0xfc4c('0x8e')](_0x41875f[_0xfc4c('0x33')]['ids'])){for(var _0x237fd6=0x0;_0x237fd6<_0x41875f['query'][_0xfc4c('0x67')][_0xfc4c('0x39')];_0x237fd6+=0x1){socket['emit'](_0xfc4c('0x8a'),{'UserId':Number(_0x41875f[_0xfc4c('0x33')][_0xfc4c('0x67')][_0x237fd6]),'WhatsappQueueId':Number(_0x41875f[_0xfc4c('0x47')]['id'])});}}else{socket['emit'](_0xfc4c('0x8a'),{'UserId':Number(_0x41875f['query'][_0xfc4c('0x67')]),'WhatsappQueueId':Number(_0x41875f[_0xfc4c('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xcf1c81,null))['catch'](handleError(_0xcf1c81,null));};exports[_0xfc4c('0x8f')]=function(_0x2168ee,_0x520a23,_0x46c455){var _0x45e385={};var _0x32b0c3={};var _0x6f5934;var _0x133dce;return db[_0xfc4c('0x2e')][_0xfc4c('0x64')]({'where':{'id':_0x2168ee['params']['id']}})['then'](handleEntityNotFound(_0x520a23,null))['then'](function(_0x5a8511){if(_0x5a8511){_0x6f5934=_0x5a8511;_0x32b0c3['model']=_[_0xfc4c('0x34')](db[_0xfc4c('0x5a')][_0xfc4c('0x48')]);_0x32b0c3[_0xfc4c('0x33')]=_['keys'](_0x2168ee['query']);_0x32b0c3[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x32b0c3[_0xfc4c('0x32')],_0x32b0c3['query']);_0x45e385['attributes']=_[_0xfc4c('0x36')](_0x32b0c3[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x45e385[_0xfc4c('0x37')]=_0x45e385['attributes'][_0xfc4c('0x39')]?_0x45e385['attributes']:_0x32b0c3[_0xfc4c('0x32')];_0x45e385[_0xfc4c('0x3a')]=qs['sort'](_0x2168ee[_0xfc4c('0x33')]['sort']);_0x45e385['where']=qs[_0xfc4c('0x35')](_[_0xfc4c('0x58')](_0x2168ee['query'],_0x32b0c3[_0xfc4c('0x35')]));if(_0x2168ee['query'][_0xfc4c('0x3d')]){_0x45e385[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x45e385[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x45e385[_0xfc4c('0x37')],function(_0x5f0a25){var _0x37a656={};_0x37a656[_0x5f0a25]={'$like':'%'+_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x37a656;})});}_0x45e385=_['merge']({},_0x45e385,_0x2168ee[_0xfc4c('0x3f')]);return _0x6f5934[_0xfc4c('0x8f')](_0x45e385);}})[_0xfc4c('0x25')](function(_0x12ff6d){if(_0x12ff6d){_0x133dce=_0x12ff6d[_0xfc4c('0x39')];if(!_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x56')](_0xfc4c('0x57'))){_0x45e385['limit']=qs[_0xfc4c('0x1e')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x1e')]);_0x45e385[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x1c')]);}return _0x6f5934[_0xfc4c('0x8f')](_0x45e385);}})[_0xfc4c('0x25')](function(_0x3ddd39){if(_0x3ddd39){return _0x3ddd39?{'count':_0x133dce,'rows':_0x3ddd39}:null;}})[_0xfc4c('0x25')](respondWithResult(_0x520a23,null))['catch'](handleError(_0x520a23,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b2a39ce..d25f239 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 _0x5996=['hook','exports','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x4c1e3c,_0x15836c){var _0x346e3b=function(_0x59afaf){while(--_0x59afaf){_0x4c1e3c['push'](_0x4c1e3c['shift']());}};_0x346e3b(++_0x15836c);}(_0x5996,0x112));var _0x6599=function(_0x2424c7,_0x508707){_0x2424c7=_0x2424c7-0x0;var _0xd535f3=_0x5996[_0x2424c7];return _0xd535f3;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6599('0x0'))['db'][_0x6599('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6599('0x2')](0x0);var events={'afterCreate':_0x6599('0x3'),'afterUpdate':'update','afterDestroy':_0x6599('0x4')};function emitEvent(_0x4f8bae){return function(_0x541123,_0x5878a1,_0x267943){WhatsappQueueEvents['emit'](_0x4f8bae+':'+_0x541123['id'],_0x541123);WhatsappQueueEvents['emit'](_0x4f8bae,_0x541123);_0x267943(null);};}for(var e in events){if(events[_0x6599('0x5')](e)){var event=events[e];WhatsappQueue[_0x6599('0x6')](e,emitEvent(event));}}module[_0x6599('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc6ba=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save','update','remove','emit'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0xc6ba,0x71));var _0xac6b=function(_0x65ded6,_0x44949e){_0x65ded6=_0x65ded6-0x0;var _0x208438=_0xc6ba[_0x65ded6];return _0x208438;};'use strict';var EventEmitter=require(_0xac6b('0x0'));var WhatsappQueue=require(_0xac6b('0x1'))['db'][_0xac6b('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac6b('0x3'),'afterUpdate':_0xac6b('0x4'),'afterDestroy':_0xac6b('0x5')};function emitEvent(_0x2b7f30){return function(_0x3bbc1b,_0xcf30d6,_0x4a70c9){WhatsappQueueEvents[_0xac6b('0x6')](_0x2b7f30+':'+_0x3bbc1b['id'],_0x3bbc1b);WhatsappQueueEvents[_0xac6b('0x6')](_0x2b7f30,_0x3bbc1b);_0x4a70c9(null);};}for(var e in events){if(events[_0xac6b('0x7')](e)){var event=events[e];WhatsappQueue[_0xac6b('0x8')](e,emitEvent(event));}}module[_0xac6b('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 48415d6..f20a6bf 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 _0x09fb=['bluebird','request-promise','rimraf','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','api','moment'];(function(_0x262d53,_0x588a57){var _0x94f0ec=function(_0x496010){while(--_0x496010){_0x262d53['push'](_0x262d53['shift']());}};_0x94f0ec(++_0x588a57);}(_0x09fb,0x172));var _0xb09f=function(_0x155c7c,_0x38910a){_0x155c7c=_0x155c7c-0x0;var _0x451e45=_0x09fb[_0x155c7c];return _0x451e45;};'use strict';var _=require(_0xb09f('0x0'));var util=require(_0xb09f('0x1'));var logger=require('../../config/logger')(_0xb09f('0x2'));var moment=require(_0xb09f('0x3'));var BPromise=require(_0xb09f('0x4'));var rp=require(_0xb09f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb09f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb09f('0x7'));module[_0xb09f('0x8')]=function(_0x3746c7,_0x5be262){return _0x3746c7[_0xb09f('0x9')]('WhatsappQueue',attributes,{'tableName':_0xb09f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bd0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappQueue','lodash','util'];(function(_0x39595c,_0x214c9b){var _0x4e0117=function(_0x5d58d7){while(--_0x5d58d7){_0x39595c['push'](_0x39595c['shift']());}};_0x4e0117(++_0x214c9b);}(_0x5bd0,0x166));var _0x05bd=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x5bd0[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x05bd('0x0'));var util=require(_0x05bd('0x1'));var logger=require('../../config/logger')(_0x05bd('0x2'));var moment=require(_0x05bd('0x3'));var BPromise=require(_0x05bd('0x4'));var rp=require(_0x05bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05bd('0x6'));var config=require(_0x05bd('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x05bd('0x8')]=function(_0x310ddd,_0x34b083){return _0x310ddd['define'](_0x05bd('0x9'),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 29d4740..8da2c6e 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 _0xd59f=['raw','where','attributes','limit','map','model','include','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','WhatsappQueue','findAll','options'];(function(_0x562ec2,_0x33932b){var _0xd3a205=function(_0x21aac4){while(--_0x21aac4){_0x562ec2['push'](_0x562ec2['shift']());}};_0xd3a205(++_0x33932b);}(_0xd59f,0x173));var _0xfd59=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0xd59f[_0x15ca1a];return _0x507626;};'use strict';var _=require('lodash');var util=require(_0xfd59('0x0'));var moment=require(_0xfd59('0x1'));var BPromise=require(_0xfd59('0x2'));var rs=require(_0xfd59('0x3'));var fs=require('fs');var Redis=require(_0xfd59('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd59('0x5'));var logger=require('../../config/logger')(_0xfd59('0x6'));var config=require(_0xfd59('0x7'));var jayson=require(_0xfd59('0x8'));var client=jayson[_0xfd59('0x9')][_0xfd59('0xa')]({'port':0x232a});config[_0xfd59('0xb')]=_['defaults'](config['redis'],{'host':_0xfd59('0xc'),'port':0x18eb});var socket=require(_0xfd59('0xd'))(new Redis(config[_0xfd59('0xb')]));require(_0xfd59('0xe'))['register'](socket);function respondWithRpcPromise(_0x17956f,_0x1fe35d,_0x4d6107){return new BPromise(function(_0x2b5502,_0xfb7283){return client[_0xfd59('0xf')](_0x17956f,_0x4d6107)[_0xfd59('0x10')](function(_0x959e94){logger['info'](_0xfd59('0x11'),_0x1fe35d,_0xfd59('0x12'));logger[_0xfd59('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1fe35d,_0xfd59('0x12'),JSON['stringify'](_0x959e94));if(_0x959e94[_0xfd59('0x14')]){if(_0x959e94[_0xfd59('0x14')][_0xfd59('0x15')]===0x1f4){logger[_0xfd59('0x14')](_0xfd59('0x11'),_0x1fe35d,_0x959e94[_0xfd59('0x14')]['message']);return _0xfb7283(_0x959e94['error'][_0xfd59('0x16')]);}logger[_0xfd59('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x1fe35d,_0x959e94[_0xfd59('0x14')][_0xfd59('0x16')]);return _0x2b5502(_0x959e94[_0xfd59('0x14')]['message']);}else{logger[_0xfd59('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x1fe35d,_0xfd59('0x12'));_0x2b5502(_0x959e94[_0xfd59('0x18')][_0xfd59('0x16')]);}})[_0xfd59('0x19')](function(_0x5ddc96){logger[_0xfd59('0x14')](_0xfd59('0x11'),_0x1fe35d,_0x5ddc96);_0xfb7283(_0x5ddc96);});});}exports['GetWhatsappQueue']=function(_0x1e8685){var _0xbbff31=this;return new Promise(function(_0x18055f,_0x1b43c3){return db[_0xfd59('0x1a')][_0xfd59('0x1b')]({'raw':_0x1e8685[_0xfd59('0x1c')]?_0x1e8685[_0xfd59('0x1c')][_0xfd59('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e8685[_0xfd59('0x1c')]?_0x1e8685[_0xfd59('0x1c')][_0xfd59('0x1e')]||null:null,'attributes':_0x1e8685[_0xfd59('0x1c')]?_0x1e8685[_0xfd59('0x1c')][_0xfd59('0x1f')]||null:null,'limit':_0x1e8685['options']?_0x1e8685[_0xfd59('0x1c')][_0xfd59('0x20')]||null:null,'include':_0x1e8685['options']?_0x1e8685['options']['include']?_[_0xfd59('0x21')](_0x1e8685['options']['include'],function(_0x1fc99e){return{'model':db[_0x1fc99e[_0xfd59('0x22')]],'as':_0x1fc99e['as'],'attributes':_0x1fc99e[_0xfd59('0x1f')],'include':_0x1fc99e[_0xfd59('0x23')]?_[_0xfd59('0x21')](_0x1fc99e[_0xfd59('0x23')],function(_0x25711d){return{'model':db[_0x25711d[_0xfd59('0x22')]],'as':_0x25711d['as'],'attributes':_0x25711d[_0xfd59('0x1f')],'include':_0x25711d[_0xfd59('0x23')]?_[_0xfd59('0x21')](_0x25711d['include'],function(_0x1dba97){return{'model':db[_0x1dba97[_0xfd59('0x22')]],'as':_0x1dba97['as'],'attributes':_0x1dba97[_0xfd59('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfd59('0x10')](function(_0x221d1c){logger['info'](_0xfd59('0x24'),_0x1e8685);logger[_0xfd59('0x13')](_0xfd59('0x24'),_0x1e8685,JSON[_0xfd59('0x25')](_0x221d1c));_0x18055f(_0x221d1c);})[_0xfd59('0x19')](function(_0x37ebe4){logger[_0xfd59('0x14')](_0xfd59('0x24'),_0x37ebe4[_0xfd59('0x16')],_0x1e8685);_0x1b43c3(_0xbbff31[_0xfd59('0x14')](0x1f4,_0x37ebe4[_0xfd59('0x16')]));});});};exports[_0xfd59('0x26')]=function(_0xb6a28e){var _0xcbd92f=this;return new Promise(function(_0x59e1f0,_0x1c2fb1){return db[_0xfd59('0x1a')][_0xfd59('0x27')]({'raw':_0xb6a28e[_0xfd59('0x1c')]?_0xb6a28e[_0xfd59('0x1c')][_0xfd59('0x1d')]===undefined?!![]:![]:!![],'where':_0xb6a28e[_0xfd59('0x1c')]?_0xb6a28e[_0xfd59('0x1c')][_0xfd59('0x1e')]||null:null,'attributes':_0xb6a28e['options']?_0xb6a28e[_0xfd59('0x1c')][_0xfd59('0x1f')]||null:null,'include':_0xb6a28e[_0xfd59('0x1c')]?_0xb6a28e[_0xfd59('0x1c')][_0xfd59('0x23')]?_[_0xfd59('0x21')](_0xb6a28e[_0xfd59('0x1c')][_0xfd59('0x23')],function(_0x13f230){return{'model':db[_0x13f230[_0xfd59('0x22')]],'as':_0x13f230['as'],'attributes':_0x13f230[_0xfd59('0x1f')],'include':_0x13f230['include']?_['map'](_0x13f230[_0xfd59('0x23')],function(_0xba8ff0){return{'model':db[_0xba8ff0['model']],'as':_0xba8ff0['as'],'attributes':_0xba8ff0['attributes'],'include':_0xba8ff0[_0xfd59('0x23')]?_[_0xfd59('0x21')](_0xba8ff0[_0xfd59('0x23')],function(_0x5cbc64){return{'model':db[_0x5cbc64[_0xfd59('0x22')]],'as':_0x5cbc64['as'],'attributes':_0x5cbc64['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd59('0x10')](function(_0x394157){logger[_0xfd59('0x17')](_0xfd59('0x26'),_0xb6a28e);logger[_0xfd59('0x13')](_0xfd59('0x26'),_0xb6a28e,JSON[_0xfd59('0x25')](_0x394157));_0x59e1f0(_0x394157);})[_0xfd59('0x19')](function(_0x43b88d){logger[_0xfd59('0x14')](_0xfd59('0x26'),_0x43b88d[_0xfd59('0x16')],_0xb6a28e);_0x1c2fb1(_0xcbd92f[_0xfd59('0x14')](0x1f4,_0x43b88d[_0xfd59('0x16')]));});});}; \ No newline at end of file +var _0x023e=['stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','ShowWhatsappQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2b6fdc,_0x564d66){var _0x40295c=function(_0x392184){while(--_0x392184){_0x2b6fdc['push'](_0x2b6fdc['shift']());}};_0x40295c(++_0x564d66);}(_0x023e,0x131));var _0xe023=function(_0x4be43b,_0x52b04f){_0x4be43b=_0x4be43b-0x0;var _0x40e949=_0x023e[_0x4be43b];return _0x40e949;};'use strict';var _=require(_0xe023('0x0'));var util=require('util');var moment=require(_0xe023('0x1'));var BPromise=require('bluebird');var rs=require(_0xe023('0x2'));var fs=require('fs');var Redis=require(_0xe023('0x3'));var db=require(_0xe023('0x4'))['db'];var utils=require(_0xe023('0x5'));var logger=require(_0xe023('0x6'))(_0xe023('0x7'));var config=require('../../config/environment');var jayson=require(_0xe023('0x8'));var client=jayson[_0xe023('0x9')][_0xe023('0xa')]({'port':0x232a});config[_0xe023('0xb')]=_[_0xe023('0xc')](config[_0xe023('0xb')],{'host':_0xe023('0xd'),'port':0x18eb});var socket=require(_0xe023('0xe'))(new Redis(config[_0xe023('0xb')]));require(_0xe023('0xf'))[_0xe023('0x10')](socket);function respondWithRpcPromise(_0x10df77,_0x4c47ea,_0x473dbb){return new BPromise(function(_0xea60b6,_0xf5449f){return client[_0xe023('0x11')](_0x10df77,_0x473dbb)[_0xe023('0x12')](function(_0x2657c9){logger[_0xe023('0x13')](_0xe023('0x14'),_0x4c47ea,'request\x20sent');logger[_0xe023('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4c47ea,_0xe023('0x16'),JSON[_0xe023('0x17')](_0x2657c9));if(_0x2657c9['error']){if(_0x2657c9[_0xe023('0x18')][_0xe023('0x19')]===0x1f4){logger[_0xe023('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4c47ea,_0x2657c9[_0xe023('0x18')][_0xe023('0x1a')]);return _0xf5449f(_0x2657c9[_0xe023('0x18')]['message']);}logger[_0xe023('0x18')](_0xe023('0x14'),_0x4c47ea,_0x2657c9['error'][_0xe023('0x1a')]);return _0xea60b6(_0x2657c9[_0xe023('0x18')][_0xe023('0x1a')]);}else{logger[_0xe023('0x13')](_0xe023('0x14'),_0x4c47ea,_0xe023('0x16'));_0xea60b6(_0x2657c9[_0xe023('0x1b')][_0xe023('0x1a')]);}})[_0xe023('0x1c')](function(_0xae10e8){logger[_0xe023('0x18')](_0xe023('0x14'),_0x4c47ea,_0xae10e8);_0xf5449f(_0xae10e8);});});}exports[_0xe023('0x1d')]=function(_0x5a5250){var _0x4f2842=this;return new Promise(function(_0x533279,_0x2e6d94){return db[_0xe023('0x1e')][_0xe023('0x1f')]({'raw':_0x5a5250[_0xe023('0x20')]?_0x5a5250[_0xe023('0x20')][_0xe023('0x21')]===undefined?!![]:![]:!![],'where':_0x5a5250[_0xe023('0x20')]?_0x5a5250['options'][_0xe023('0x22')]||null:null,'attributes':_0x5a5250[_0xe023('0x20')]?_0x5a5250[_0xe023('0x20')][_0xe023('0x23')]||null:null,'limit':_0x5a5250['options']?_0x5a5250[_0xe023('0x20')]['limit']||null:null,'include':_0x5a5250[_0xe023('0x20')]?_0x5a5250['options'][_0xe023('0x24')]?_[_0xe023('0x25')](_0x5a5250[_0xe023('0x20')][_0xe023('0x24')],function(_0x4c9887){return{'model':db[_0x4c9887['model']],'as':_0x4c9887['as'],'attributes':_0x4c9887[_0xe023('0x23')],'include':_0x4c9887[_0xe023('0x24')]?_[_0xe023('0x25')](_0x4c9887[_0xe023('0x24')],function(_0xf15e84){return{'model':db[_0xf15e84['model']],'as':_0xf15e84['as'],'attributes':_0xf15e84[_0xe023('0x23')],'include':_0xf15e84[_0xe023('0x24')]?_[_0xe023('0x25')](_0xf15e84['include'],function(_0x5d4f45){return{'model':db[_0x5d4f45[_0xe023('0x26')]],'as':_0x5d4f45['as'],'attributes':_0x5d4f45['attributes']};}):[]};}):[]};}):[]:[]})[_0xe023('0x12')](function(_0x234bf6){logger[_0xe023('0x13')]('GetWhatsappQueue',_0x5a5250);logger['debug'](_0xe023('0x1d'),_0x5a5250,JSON[_0xe023('0x17')](_0x234bf6));_0x533279(_0x234bf6);})['catch'](function(_0x2a9bf3){logger[_0xe023('0x18')](_0xe023('0x1d'),_0x2a9bf3[_0xe023('0x1a')],_0x5a5250);_0x2e6d94(_0x4f2842['error'](0x1f4,_0x2a9bf3[_0xe023('0x1a')]));});});};exports[_0xe023('0x27')]=function(_0x197163){var _0x1e74bb=this;return new Promise(function(_0x199042,_0x1eeb66){return db[_0xe023('0x1e')][_0xe023('0x28')]({'raw':_0x197163['options']?_0x197163[_0xe023('0x20')][_0xe023('0x21')]===undefined?!![]:![]:!![],'where':_0x197163['options']?_0x197163['options']['where']||null:null,'attributes':_0x197163[_0xe023('0x20')]?_0x197163[_0xe023('0x20')][_0xe023('0x23')]||null:null,'include':_0x197163['options']?_0x197163[_0xe023('0x20')][_0xe023('0x24')]?_[_0xe023('0x25')](_0x197163[_0xe023('0x20')][_0xe023('0x24')],function(_0x5be10a){return{'model':db[_0x5be10a['model']],'as':_0x5be10a['as'],'attributes':_0x5be10a[_0xe023('0x23')],'include':_0x5be10a[_0xe023('0x24')]?_['map'](_0x5be10a[_0xe023('0x24')],function(_0x9afe07){return{'model':db[_0x9afe07[_0xe023('0x26')]],'as':_0x9afe07['as'],'attributes':_0x9afe07[_0xe023('0x23')],'include':_0x9afe07['include']?_[_0xe023('0x25')](_0x9afe07[_0xe023('0x24')],function(_0x158ec5){return{'model':db[_0x158ec5[_0xe023('0x26')]],'as':_0x158ec5['as'],'attributes':_0x158ec5[_0xe023('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x248eba){logger['info'](_0xe023('0x27'),_0x197163);logger[_0xe023('0x15')](_0xe023('0x27'),_0x197163,JSON[_0xe023('0x17')](_0x248eba));_0x199042(_0x248eba);})[_0xe023('0x1c')](function(_0x29a469){logger[_0xe023('0x18')](_0xe023('0x27'),_0x29a469[_0xe023('0x1a')],_0x197163);_0x1eeb66(_0x1e74bb[_0xe023('0x18')](0x1f4,_0x29a469[_0xe023('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index bfce544..696fac4 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 _0xb678=['remove','removeListener','register','length','./whatsappQueue.events','save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb678,0xee));var _0x8b67=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb678[_0x3511d3];return _0x5d6321;};'use strict';var WhatsappQueueEvents=require(_0x8b67('0x0'));var events=[_0x8b67('0x1'),_0x8b67('0x2'),'update'];function createListener(_0x2f08e4,_0x11e0dc){return function(_0x2f2d20){_0x11e0dc['emit'](_0x2f08e4,_0x2f2d20);};}function removeListener(_0x193a0e,_0x1875ba){return function(){WhatsappQueueEvents[_0x8b67('0x3')](_0x193a0e,_0x1875ba);};}exports[_0x8b67('0x4')]=function(_0x5a5acd){for(var _0x379642=0x0,_0x46eacf=events[_0x8b67('0x5')];_0x379642<_0x46eacf;_0x379642++){var _0x1c4f9e=events[_0x379642];var _0x46ba1b=createListener('whatsappQueue:'+_0x1c4f9e,_0x5a5acd);WhatsappQueueEvents['on'](_0x1c4f9e,_0x46ba1b);}}; \ No newline at end of file +var _0x9c18=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x7424aa,_0x52f4c6){var _0x4d489c=function(_0x288a8f){while(--_0x288a8f){_0x7424aa['push'](_0x7424aa['shift']());}};_0x4d489c(++_0x52f4c6);}(_0x9c18,0xa7));var _0x89c1=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x9c18[_0x31cb5f];return _0x586042;};'use strict';var WhatsappQueueEvents=require(_0x89c1('0x0'));var events=['save',_0x89c1('0x1'),_0x89c1('0x2')];function createListener(_0x502d23,_0x4d68d4){return function(_0x55d6e){_0x4d68d4[_0x89c1('0x3')](_0x502d23,_0x55d6e);};}function removeListener(_0xcc08dd,_0x14bb78){return function(){WhatsappQueueEvents[_0x89c1('0x4')](_0xcc08dd,_0x14bb78);};}exports[_0x89c1('0x5')]=function(_0x4f49af){for(var _0x1144d6=0x0,_0x10b270=events[_0x89c1('0x6')];_0x1144d6<_0x10b270;_0x1144d6++){var _0x432066=events[_0x1144d6];var _0x40bfbf=createListener(_0x89c1('0x7')+_0x432066,_0x4f49af);WhatsappQueueEvents['on'](_0x432066,_0x40bfbf);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d5e6196..a93d721 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 _0xa3fc=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x81ea81,_0x494517){var _0x11c73b=function(_0x19d205){while(--_0x19d205){_0x81ea81['push'](_0x81ea81['shift']());}};_0x11c73b(++_0x494517);}(_0xa3fc,0xd5));var _0xca3f=function(_0x54727f,_0x81ee6f){_0x54727f=_0x54727f-0x0;var _0x5900df=_0xa3fc[_0x54727f];return _0x5900df;};'use strict';var multer=require(_0xca3f('0x0'));var util=require(_0xca3f('0x1'));var path=require('path');var timeout=require(_0xca3f('0x2'));var express=require(_0xca3f('0x3'));var router=express[_0xca3f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca3f('0x5'));var interaction=require(_0xca3f('0x6'));var config=require(_0xca3f('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0xca3f('0x8')]('/',auth[_0xca3f('0x9')](),controller[_0xca3f('0xa')]);router['get'](_0xca3f('0xb'),auth[_0xca3f('0x9')](),controller['describe']);router[_0xca3f('0x8')](_0xca3f('0xc'),auth['isAuthenticated'](),controller[_0xca3f('0xd')]);router[_0xca3f('0xe')]('/',auth[_0xca3f('0x9')](),controller['create']);router[_0xca3f('0xf')](_0xca3f('0xc'),auth[_0xca3f('0x9')](),controller[_0xca3f('0x10')]);router[_0xca3f('0x11')](_0xca3f('0xc'),auth[_0xca3f('0x9')](),controller['destroy']);module[_0xca3f('0x12')]=router; \ No newline at end of file +var _0xba83=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','exports','util','path','express','Router'];(function(_0x4fe456,_0x4ff847){var _0x2865d4=function(_0x47980d){while(--_0x47980d){_0x4fe456['push'](_0x4fe456['shift']());}};_0x2865d4(++_0x4ff847);}(_0xba83,0xc2));var _0x3ba8=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xba83[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require('multer');var util=require(_0x3ba8('0x0'));var path=require(_0x3ba8('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ba8('0x2'));var router=express[_0x3ba8('0x3')]();var fs_extra=require(_0x3ba8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ba8('0x5'));var config=require(_0x3ba8('0x6'));var controller=require(_0x3ba8('0x7'));router[_0x3ba8('0x8')]('/',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xa')]);router[_0x3ba8('0x8')](_0x3ba8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3ba8('0x8')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xd')]);router[_0x3ba8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller['update']);router[_0x3ba8('0xf')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0x10')]);module[_0x3ba8('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 12c8fbd..b002fba 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3866ff,_0x12c064){var _0x18c6b4=function(_0x31f611){while(--_0x31f611){_0x3866ff['push'](_0x3866ff['shift']());}};_0x18c6b4(++_0x12c064);}(_0x7a54,0x106));var _0x47a5=function(_0x569399,_0x283d5c){_0x569399=_0x569399-0x0;var _0x1ae669=_0x7a54[_0x569399];return _0x1ae669;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4ea32f,_0x1a992e){var _0x147e03=function(_0x36ce6e){while(--_0x36ce6e){_0x4ea32f['push'](_0x4ea32f['shift']());}};_0x147e03(++_0x1a992e);}(_0x7a54,0x106));var _0x47a5=function(_0x2f54a1,_0x18a261){_0x2f54a1=_0x2f54a1-0x0;var _0x246c54=_0x7a54[_0x2f54a1];return _0x246c54;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index a75843e..f967b8c 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 _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x91fbc7,_0x207e4c){var _0x32a811=function(_0x3d6a42){while(--_0x3d6a42){_0x91fbc7['push'](_0x91fbc7['shift']());}};_0x32a811(++_0x207e4c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5f2c7c,_0x3599e6){_0x5f2c7c=_0x5f2c7c-0x0;var _0x525844=_0x1c9a[_0x5f2c7c];return _0x525844;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));}; \ No newline at end of file +var _0x3f8c=['end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3fd9d0,_0xdfe805){var _0x3e1d65=function(_0xf4d655){while(--_0xf4d655){_0x3fd9d0['push'](_0x3fd9d0['shift']());}};_0x3e1d65(++_0xdfe805);}(_0x3f8c,0x104));var _0xc3f8=function(_0x38a77e,_0x192a56){_0x38a77e=_0x38a77e-0x0;var _0x4bd270=_0x3f8c[_0x38a77e];return _0x4bd270;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={},_0x218029={},_0x5bf6e2={'count':0x0,'rows':[]};var _0x151bba=_['map'](db[_0xc3f8('0x27')][_0xc3f8('0x28')],function(_0x47ab53){return{'name':_0x47ab53['fieldName'],'type':_0x47ab53[_0xc3f8('0x29')][_0xc3f8('0x2a')]};});_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x151bba,_0xc3f8('0x24'));_0x218029[_0xc3f8('0x2d')]=_[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2d')]);_0x218029[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x218029['model'],_0x218029[_0xc3f8('0x2d')]);_0x2909f8[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x218029[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x59e4dd['query']['fields']));_0x2909f8[_0xc3f8('0x31')]=_0x2909f8[_0xc3f8('0x31')][_0xc3f8('0x33')]?_0x2909f8[_0xc3f8('0x31')]:_0x218029[_0xc3f8('0x2b')];if(!_0x59e4dd['query'][_0xc3f8('0x34')](_0xc3f8('0x35'))){_0x2909f8[_0xc3f8('0x1b')]=qs['limit'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1b')]);_0x2909f8[_0xc3f8('0x1a')]=qs['offset'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1a')]);}_0x2909f8['order']=qs[_0xc3f8('0x36')](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x36')]);_0x2909f8[_0xc3f8('0x37')]=qs[_0xc3f8('0x2f')](_[_0xc3f8('0x38')](_0x59e4dd['query'],_0x218029[_0xc3f8('0x2f')]),_0x151bba);if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]){_0x2909f8[_0xc3f8('0x37')]=_[_0xc3f8('0x3a')](_0x2909f8['where'],{'$or':_[_0xc3f8('0x2c')](_0x151bba,function(_0x4451a2){if(_0x4451a2[_0xc3f8('0x29')]!=='VIRTUAL'){var _0x316643={};_0x316643[_0x4451a2[_0xc3f8('0x24')]]={'$like':'%'+_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]+'%'};return _0x316643;}})});}_0x2909f8=_['merge']({},_0x2909f8,_0x59e4dd[_0xc3f8('0x3b')]);var _0x45d416={'where':_0x2909f8[_0xc3f8('0x37')]};return db[_0xc3f8('0x27')]['count'](_0x45d416)[_0xc3f8('0x21')](function(_0x5db44d){_0x5bf6e2['count']=_0x5db44d;if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x3c')]){_0x2909f8[_0xc3f8('0x3d')]=[{'all':!![]}];}return db[_0xc3f8('0x27')]['findAll'](_0x2909f8);})['then'](function(_0x361a85){_0x5bf6e2[_0xc3f8('0x3e')]=_0x361a85;return _0x5bf6e2;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x58b303,_0x2909f8))[_0xc3f8('0x3f')](handleError(_0x58b303,null));};exports[_0xc3f8('0x40')]=function(_0x465547,_0x3113b4){var _0x45e6ea={'raw':!![],'where':{'id':_0x465547[_0xc3f8('0x41')]['id']}},_0x13d8dc={};_0x13d8dc[_0xc3f8('0x2b')]=_['keys'](db[_0xc3f8('0x27')][_0xc3f8('0x28')]);_0x13d8dc['query']=_[_0xc3f8('0x2e')](_0x465547[_0xc3f8('0x2d')]);_0x13d8dc['filters']=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],_0x13d8dc[_0xc3f8('0x2d')]);_0x45e6ea[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x465547[_0xc3f8('0x2d')][_0xc3f8('0x32')]));_0x45e6ea[_0xc3f8('0x31')]=_0x45e6ea[_0xc3f8('0x31')]['length']?_0x45e6ea[_0xc3f8('0x31')]:_0x13d8dc[_0xc3f8('0x2b')];if(_0x465547['query'][_0xc3f8('0x3c')]){_0x45e6ea[_0xc3f8('0x3d')]=[{'all':!![]}];}_0x45e6ea=_[_0xc3f8('0x3a')]({},_0x45e6ea,_0x465547[_0xc3f8('0x3b')]);return db['WhatsappQueueReport']['find'](_0x45e6ea)[_0xc3f8('0x21')](handleEntityNotFound(_0x3113b4,null))[_0xc3f8('0x21')](respondWithResult(_0x3113b4,null))[_0xc3f8('0x3f')](handleError(_0x3113b4,null));};exports['create']=function(_0x1b5777,_0x3a665e){return db[_0xc3f8('0x27')][_0xc3f8('0x42')](_0x1b5777[_0xc3f8('0x43')],{})['then'](respondWithResult(_0x3a665e,0xc9))[_0xc3f8('0x3f')](handleError(_0x3a665e,null));};exports[_0xc3f8('0x20')]=function(_0x5961ab,_0x1becae){if(_0x5961ab[_0xc3f8('0x43')]['id']){delete _0x5961ab[_0xc3f8('0x43')]['id'];}return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x5961ab[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1becae,null))['then'](saveUpdates(_0x5961ab[_0xc3f8('0x43')],null))[_0xc3f8('0x21')](respondWithResult(_0x1becae,null))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x45')]=function(_0x2e9f93,_0x2448bf){return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x2e9f93[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x2448bf,null))['then'](removeEntity(_0x2448bf,null))[_0xc3f8('0x3f')](handleError(_0x2448bf,null));};exports[_0xc3f8('0x46')]=function(_0x425fee,_0x267c95){return db[_0xc3f8('0x27')][_0xc3f8('0x46')]()[_0xc3f8('0x21')](respondWithResult(_0x267c95,null))[_0xc3f8('0x3f')](handleError(_0x267c95,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 86c0259..753e138 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 _0xe038=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x4cac95,_0x2d4b7a){var _0x27c851=function(_0xeca85c){while(--_0xeca85c){_0x4cac95['push'](_0x4cac95['shift']());}};_0x27c851(++_0x2d4b7a);}(_0xe038,0x167));var _0x8e03=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe038[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x8e03('0x0'));var util=require(_0x8e03('0x1'));var logger=require(_0x8e03('0x2'))('api');var moment=require(_0x8e03('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e03('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e03('0x5'));var config=require(_0x8e03('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x8e03('0x7')]=function(_0x5f30a3,_0x4f26d8){return _0x5f30a3[_0x8e03('0x8')](_0x8e03('0x9'),attributes,{'tableName':_0x8e03('0xa'),'paranoid':![],'indexes':[{'name':_0x8e03('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf41c=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45b2c3,_0x4a0966){var _0x4d1323=function(_0x24bcd8){while(--_0x24bcd8){_0x45b2c3['push'](_0x45b2c3['shift']());}};_0x4d1323(++_0x4a0966);}(_0xf41c,0x139));var _0xcf41=function(_0x31114c,_0x39e7be){_0x31114c=_0x31114c-0x0;var _0x39ea34=_0xf41c[_0x31114c];return _0x39ea34;};'use strict';var _=require(_0xcf41('0x0'));var util=require(_0xcf41('0x1'));var logger=require(_0xcf41('0x2'))('api');var moment=require(_0xcf41('0x3'));var BPromise=require(_0xcf41('0x4'));var rp=require(_0xcf41('0x5'));var fs=require('fs');var path=require(_0xcf41('0x6'));var rimraf=require(_0xcf41('0x7'));var config=require(_0xcf41('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xcf41('0x9')]=function(_0x54e807,_0xb6a61){return _0x54e807[_0xcf41('0xa')](_0xcf41('0xb'),attributes,{'tableName':_0xcf41('0xc'),'paranoid':![],'indexes':[{'name':_0xcf41('0xd'),'fields':[_0xcf41('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 9d14d70..343f4f5 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 _0xce69=['jayson/promise','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','options','catch','update','body','where','attributes','limit','UpdateWhatsappQueueReport','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xce69,0x1e8));var _0x9ce6=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0xce69[_0x4536a4];return _0x4fd1c1;};'use strict';var _=require(_0x9ce6('0x0'));var util=require(_0x9ce6('0x1'));var moment=require(_0x9ce6('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ce6('0x3'));var fs=require('fs');var Redis=require(_0x9ce6('0x4'));var db=require(_0x9ce6('0x5'))['db'];var utils=require(_0x9ce6('0x6'));var logger=require(_0x9ce6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9ce6('0x8'));var client=jayson[_0x9ce6('0x9')][_0x9ce6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fed6b,_0x29946a,_0x119d82){return new BPromise(function(_0x4077c6,_0x3bce7d){return client['request'](_0x4fed6b,_0x119d82)[_0x9ce6('0xb')](function(_0x3fb0ae){logger['info'](_0x9ce6('0xc'),_0x29946a,_0x9ce6('0xd'));logger[_0x9ce6('0xe')](_0x9ce6('0xf'),_0x29946a,_0x9ce6('0xd'),JSON['stringify'](_0x3fb0ae));if(_0x3fb0ae[_0x9ce6('0x10')]){if(_0x3fb0ae['error'][_0x9ce6('0x11')]===0x1f4){logger[_0x9ce6('0x10')](_0x9ce6('0xc'),_0x29946a,_0x3fb0ae[_0x9ce6('0x10')][_0x9ce6('0x12')]);return _0x3bce7d(_0x3fb0ae[_0x9ce6('0x10')][_0x9ce6('0x12')]);}logger[_0x9ce6('0x10')](_0x9ce6('0xc'),_0x29946a,_0x3fb0ae['error'][_0x9ce6('0x12')]);return _0x4077c6(_0x3fb0ae[_0x9ce6('0x10')]['message']);}else{logger[_0x9ce6('0x13')](_0x9ce6('0xc'),_0x29946a,_0x9ce6('0xd'));_0x4077c6(_0x3fb0ae['result'][_0x9ce6('0x12')]);}})['catch'](function(_0x2fe605){logger[_0x9ce6('0x10')](_0x9ce6('0xc'),_0x29946a,_0x2fe605);_0x3bce7d(_0x2fe605);});});}exports[_0x9ce6('0x14')]=function(_0xd45b8){var _0x436ee1=this;return new Promise(function(_0x2a81d6,_0x254aa5){return db[_0x9ce6('0x15')]['create'](_0xd45b8['body'],{'raw':_0xd45b8['options']?_0xd45b8[_0x9ce6('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9ce6('0xb')](function(_0x1cf4eb){logger[_0x9ce6('0x13')](_0x9ce6('0x14'),_0xd45b8);logger[_0x9ce6('0xe')](_0x9ce6('0x14'),_0xd45b8,JSON['stringify'](_0x1cf4eb));_0x2a81d6(_0x1cf4eb);})[_0x9ce6('0x17')](function(_0x2342f9){logger['error'](_0x9ce6('0x14'),_0x2342f9[_0x9ce6('0x12')],_0xd45b8);_0x254aa5(_0x436ee1[_0x9ce6('0x10')](0x1f4,_0x2342f9[_0x9ce6('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2c59e8){var _0x5366c3=this;return new Promise(function(_0x4b469c,_0x1a26cb){return db[_0x9ce6('0x15')][_0x9ce6('0x18')](_0x2c59e8[_0x9ce6('0x19')],{'raw':_0x2c59e8[_0x9ce6('0x16')]?_0x2c59e8[_0x9ce6('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c59e8[_0x9ce6('0x16')]?_0x2c59e8[_0x9ce6('0x16')][_0x9ce6('0x1a')]||null:null,'attributes':_0x2c59e8[_0x9ce6('0x16')]?_0x2c59e8[_0x9ce6('0x16')][_0x9ce6('0x1b')]||null:null,'limit':_0x2c59e8[_0x9ce6('0x16')]?_0x2c59e8[_0x9ce6('0x16')][_0x9ce6('0x1c')]||null:null})['then'](function(_0x39572c){logger['info'](_0x9ce6('0x1d'),_0x2c59e8);logger[_0x9ce6('0xe')]('UpdateWhatsappQueueReport',_0x2c59e8,JSON[_0x9ce6('0x1e')](_0x39572c));_0x4b469c(_0x39572c);})['catch'](function(_0x13a9f8){logger[_0x9ce6('0x10')](_0x9ce6('0x1d'),_0x13a9f8['message'],_0x2c59e8);_0x1a26cb(_0x5366c3[_0x9ce6('0x10')](0x1f4,_0x13a9f8[_0x9ce6('0x12')]));});});}; \ No newline at end of file +var _0x2d33=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','update','body','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4934b3,_0x479b1c){var _0x202e51=function(_0x250228){while(--_0x250228){_0x4934b3['push'](_0x4934b3['shift']());}};_0x202e51(++_0x479b1c);}(_0x2d33,0x17e));var _0x32d3=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0x2d33[_0x1e2372];return _0x4cd59b;};'use strict';var _=require(_0x32d3('0x0'));var util=require(_0x32d3('0x1'));var moment=require(_0x32d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x32d3('0x3'));var fs=require('fs');var Redis=require(_0x32d3('0x4'));var db=require(_0x32d3('0x5'))['db'];var utils=require(_0x32d3('0x6'));var logger=require(_0x32d3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32d3('0x8'));var client=jayson[_0x32d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b1b1c,_0x180324,_0x23d72c){return new BPromise(function(_0x3f68e3,_0x4b94fe){return client[_0x32d3('0xa')](_0x1b1b1c,_0x23d72c)['then'](function(_0x26f9b9){logger['info'](_0x32d3('0xb'),_0x180324,_0x32d3('0xc'));logger[_0x32d3('0xd')](_0x32d3('0xe'),_0x180324,_0x32d3('0xc'),JSON[_0x32d3('0xf')](_0x26f9b9));if(_0x26f9b9['error']){if(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x11')]===0x1f4){logger[_0x32d3('0x10')](_0x32d3('0xb'),_0x180324,_0x26f9b9[_0x32d3('0x10')]['message']);return _0x4b94fe(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);}logger[_0x32d3('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x180324,_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);return _0x3f68e3(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);}else{logger[_0x32d3('0x13')](_0x32d3('0xb'),_0x180324,_0x32d3('0xc'));_0x3f68e3(_0x26f9b9[_0x32d3('0x14')]['message']);}})[_0x32d3('0x15')](function(_0x346875){logger[_0x32d3('0x10')](_0x32d3('0xb'),_0x180324,_0x346875);_0x4b94fe(_0x346875);});});}exports[_0x32d3('0x16')]=function(_0x207075){var _0x1e0575=this;return new Promise(function(_0x361706,_0xe1c8c6){return db[_0x32d3('0x17')][_0x32d3('0x18')](_0x207075['body'],{'raw':_0x207075[_0x32d3('0x19')]?_0x207075[_0x32d3('0x19')][_0x32d3('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x8cb7db){logger['info'](_0x32d3('0x16'),_0x207075);logger[_0x32d3('0xd')]('CreateWhatsappQueueReport',_0x207075,JSON[_0x32d3('0xf')](_0x8cb7db));_0x361706(_0x8cb7db);})[_0x32d3('0x15')](function(_0x2b051c){logger[_0x32d3('0x10')](_0x32d3('0x16'),_0x2b051c[_0x32d3('0x12')],_0x207075);_0xe1c8c6(_0x1e0575['error'](0x1f4,_0x2b051c[_0x32d3('0x12')]));});});};exports[_0x32d3('0x1b')]=function(_0x2088d0){var _0x656423=this;return new Promise(function(_0x3e5dcf,_0xb4f64a){return db[_0x32d3('0x17')][_0x32d3('0x1c')](_0x2088d0[_0x32d3('0x1d')],{'raw':_0x2088d0['options']?_0x2088d0[_0x32d3('0x19')][_0x32d3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2088d0[_0x32d3('0x19')]?_0x2088d0[_0x32d3('0x19')]['where']||null:null,'attributes':_0x2088d0[_0x32d3('0x19')]?_0x2088d0[_0x32d3('0x19')]['attributes']||null:null,'limit':_0x2088d0[_0x32d3('0x19')]?_0x2088d0['options'][_0x32d3('0x1e')]||null:null})['then'](function(_0x4beac0){logger[_0x32d3('0x13')](_0x32d3('0x1b'),_0x2088d0);logger[_0x32d3('0xd')](_0x32d3('0x1b'),_0x2088d0,JSON[_0x32d3('0xf')](_0x4beac0));_0x3e5dcf(_0x4beac0);})['catch'](function(_0x51d5b2){logger['error'](_0x32d3('0x1b'),_0x51d5b2[_0x32d3('0x12')],_0x2088d0);_0xb4f64a(_0x656423[_0x32d3('0x10')](0x1f4,_0x51d5b2[_0x32d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f33d01b..09bea4c 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 _0xaf6a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x43ccfb,_0x46365e){var _0x2bb862=function(_0x54e956){while(--_0x54e956){_0x43ccfb['push'](_0x43ccfb['shift']());}};_0x2bb862(++_0x46365e);}(_0xaf6a,0xbb));var _0xaaf6=function(_0x157111,_0x3a9771){_0x157111=_0x157111-0x0;var _0x5b00c4=_0xaf6a[_0x157111];return _0x5b00c4;};'use strict';var multer=require(_0xaaf6('0x0'));var util=require(_0xaaf6('0x1'));var path=require('path');var timeout=require(_0xaaf6('0x2'));var express=require(_0xaaf6('0x3'));var router=express['Router']();var fs_extra=require(_0xaaf6('0x4'));var auth=require(_0xaaf6('0x5'));var interaction=require(_0xaaf6('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xaaf6('0x7')](),controller['index']);router[_0xaaf6('0x8')](_0xaaf6('0x9'),auth[_0xaaf6('0x7')](),controller[_0xaaf6('0xa')]);router[_0xaaf6('0x8')](_0xaaf6('0xb'),auth['isAuthenticated'](),controller[_0xaaf6('0xc')]);router[_0xaaf6('0xd')]('/',auth['isAuthenticated'](),controller[_0xaaf6('0xe')]);router[_0xaaf6('0xf')](_0xaaf6('0xb'),auth[_0xaaf6('0x7')](),controller[_0xaaf6('0x10')]);router[_0xaaf6('0x11')](_0xaaf6('0xb'),auth[_0xaaf6('0x7')](),controller['destroy']);module[_0xaaf6('0x12')]=router; \ No newline at end of file +var _0x38c4=['/describe','describe','show','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x5f2a0d,_0x305eb1){var _0x4f38dc=function(_0x2653af){while(--_0x2653af){_0x5f2a0d['push'](_0x5f2a0d['shift']());}};_0x4f38dc(++_0x305eb1);}(_0x38c4,0x7a));var _0x438c=function(_0x101f71,_0x1eb4d1){_0x101f71=_0x101f71-0x0;var _0x5012ff=_0x38c4[_0x101f71];return _0x5012ff;};'use strict';var multer=require('multer');var util=require(_0x438c('0x0'));var path=require(_0x438c('0x1'));var timeout=require(_0x438c('0x2'));var express=require(_0x438c('0x3'));var router=express[_0x438c('0x4')]();var fs_extra=require(_0x438c('0x5'));var auth=require(_0x438c('0x6'));var interaction=require(_0x438c('0x7'));var config=require(_0x438c('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x438c('0x9')]('/',auth['isAuthenticated'](),controller[_0x438c('0xa')]);router[_0x438c('0x9')](_0x438c('0xb'),auth['isAuthenticated'](),controller[_0x438c('0xc')]);router[_0x438c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x438c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x438c('0xe')]);router['put'](_0x438c('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x438c('0x10')](_0x438c('0xf'),auth['isAuthenticated'](),controller[_0x438c('0x11')]);module[_0x438c('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4264a2d..b85dbda 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 _0x97e6=['account','queue','DATE','sequelize','STRING','ENUM'];(function(_0x343259,_0x4d0476){var _0x51bf=function(_0x476649){while(--_0x476649){_0x343259['push'](_0x343259['shift']());}};_0x51bf(++_0x4d0476);}(_0x97e6,0x159));var _0x697e=function(_0x69c0c2,_0x2af0bf){_0x69c0c2=_0x69c0c2-0x0;var _0x3422f6=_0x97e6[_0x69c0c2];return _0x3422f6;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x697e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x697e('0x2')](_0x697e('0x3'),'agent',_0x697e('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x697e('0x5')]}}; \ No newline at end of file +var _0x6df9=['sequelize','exports','ENUM','queue'];(function(_0x18758b,_0xdacc5){var _0x505b72=function(_0x266111){while(--_0x266111){_0x18758b['push'](_0x18758b['shift']());}};_0x505b72(++_0xdacc5);}(_0x6df9,0x84));var _0x96df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6df9[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x96df('0x0'));module[_0x96df('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x96df('0x2')]('account','agent',_0x96df('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 6b3015e..7794bd0 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 _0x7752=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','update','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x112ee4,_0x5affa4){var _0xc51021=function(_0x58c9f4){while(--_0x58c9f4){_0x112ee4['push'](_0x112ee4['shift']());}};_0xc51021(++_0x5affa4);}(_0x7752,0x92));var _0x2775=function(_0x54e9f1,_0x5b0a7d){_0x54e9f1=_0x54e9f1-0x0;var _0x483eb3=_0x7752[_0x54e9f1];return _0x483eb3;};'use strict';var emlformat=require(_0x2775('0x0'));var rimraf=require(_0x2775('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2775('0x2'));var rp=require(_0x2775('0x3'));var moment=require(_0x2775('0x4'));var BPromise=require(_0x2775('0x5'));var Mustache=require(_0x2775('0x6'));var util=require(_0x2775('0x7'));var path=require(_0x2775('0x8'));var sox=require(_0x2775('0x9'));var csv=require(_0x2775('0xa'));var ejs=require(_0x2775('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2775('0xc'));var crypto=require(_0x2775('0xd'));var jsforce=require(_0x2775('0xe'));var deskjs=require(_0x2775('0xf'));var toCsv=require(_0x2775('0xa'));var querystring=require(_0x2775('0x10'));var Papa=require(_0x2775('0x11'));var Redis=require(_0x2775('0x12'));var authService=require(_0x2775('0x13'));var qs=require(_0x2775('0x14'));var as=require(_0x2775('0x15'));var hardwareService=require(_0x2775('0x16'));var logger=require('../../config/logger')(_0x2775('0x17'));var utils=require(_0x2775('0x18'));var config=require(_0x2775('0x19'));var licenseUtil=require(_0x2775('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c5998,_0x1835d6){_0x1835d6=_0x1835d6||0xcc;return function(_0x41889b){if(_0x41889b){return _0x2c5998[_0x2775('0x1b')](_0x1835d6);}return _0x2c5998[_0x2775('0x1c')](_0x1835d6)[_0x2775('0x1d')]();};}function respondWithResult(_0x4079bf,_0x59d8bc){_0x59d8bc=_0x59d8bc||0xc8;return function(_0x43d568){if(_0x43d568){return _0x4079bf[_0x2775('0x1c')](_0x59d8bc)[_0x2775('0x1e')](_0x43d568);}};}function respondWithFilteredResult(_0x1a9d9c,_0x1a0981){return function(_0x444bbd){if(_0x444bbd){var _0x1c99de=typeof _0x1a0981['offset']==='undefined'&&typeof _0x1a0981['limit']===_0x2775('0x1f');var _0x3ba1e8=_0x444bbd[_0x2775('0x20')];var _0x106f9f=_0x1c99de?0x0:_0x1a0981[_0x2775('0x21')];var _0x268c5b=_0x1c99de?_0x444bbd[_0x2775('0x20')]:_0x1a0981['offset']+_0x1a0981[_0x2775('0x22')];var _0x15a308;if(_0x268c5b>=_0x3ba1e8){_0x268c5b=_0x3ba1e8;_0x15a308=0xc8;}else{_0x15a308=0xce;}_0x1a9d9c[_0x2775('0x1c')](_0x15a308);return _0x1a9d9c[_0x2775('0x23')](_0x2775('0x24'),_0x106f9f+'-'+_0x268c5b+'/'+_0x3ba1e8)['json'](_0x444bbd);}return null;};}function patchUpdates(_0x8f6cc6){return function(_0x50952d){try{jsonpatch[_0x2775('0x25')](_0x50952d,_0x8f6cc6,!![]);}catch(_0x3ba2be){return BPromise[_0x2775('0x26')](_0x3ba2be);}return _0x50952d[_0x2775('0x27')]();};}function saveUpdates(_0x674e48,_0xea6b88){return function(_0x48b525){if(_0x48b525){return _0x48b525['update'](_0x674e48)[_0x2775('0x28')](function(_0x5524d1){return _0x5524d1;});}return null;};}function removeEntity(_0x5b6f7e,_0x4e7b8c){return function(_0x141a4d){if(_0x141a4d){return _0x141a4d['destroy']()['then'](function(){_0x5b6f7e[_0x2775('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4557e0,_0x1c70f9){return function(_0x52d2c0){if(!_0x52d2c0){_0x4557e0[_0x2775('0x1b')](0x194);}return _0x52d2c0;};}function handleError(_0x266d5a,_0x3093f4){_0x3093f4=_0x3093f4||0x1f4;return function(_0x946cd4){logger['error'](_0x946cd4['stack']);if(_0x946cd4['name']){delete _0x946cd4[_0x2775('0x29')];}_0x266d5a['status'](_0x3093f4)['send'](_0x946cd4);};}exports[_0x2775('0x2a')]=function(_0x3fd845,_0x1c96f3){var _0x5d7f1d={},_0x2eec7e={},_0x488da4={'count':0x0,'rows':[]};var _0x83f83f=_[_0x2775('0x2b')](db[_0x2775('0x2c')][_0x2775('0x2d')],function(_0x564ecd){return{'name':_0x564ecd[_0x2775('0x2e')],'type':_0x564ecd[_0x2775('0x2f')][_0x2775('0x30')]};});_0x2eec7e[_0x2775('0x31')]=_[_0x2775('0x2b')](_0x83f83f,_0x2775('0x29'));_0x2eec7e[_0x2775('0x32')]=_[_0x2775('0x33')](_0x3fd845[_0x2775('0x32')]);_0x2eec7e[_0x2775('0x34')]=_['intersection'](_0x2eec7e[_0x2775('0x31')],_0x2eec7e[_0x2775('0x32')]);_0x5d7f1d[_0x2775('0x35')]=_[_0x2775('0x36')](_0x2eec7e[_0x2775('0x31')],qs[_0x2775('0x37')](_0x3fd845[_0x2775('0x32')][_0x2775('0x37')]));_0x5d7f1d[_0x2775('0x35')]=_0x5d7f1d[_0x2775('0x35')][_0x2775('0x38')]?_0x5d7f1d[_0x2775('0x35')]:_0x2eec7e[_0x2775('0x31')];if(!_0x3fd845[_0x2775('0x32')][_0x2775('0x39')](_0x2775('0x3a'))){_0x5d7f1d[_0x2775('0x22')]=qs['limit'](_0x3fd845[_0x2775('0x32')][_0x2775('0x22')]);_0x5d7f1d[_0x2775('0x21')]=qs[_0x2775('0x21')](_0x3fd845['query']['offset']);}_0x5d7f1d[_0x2775('0x3b')]=qs[_0x2775('0x3c')](_0x3fd845['query']['sort']);_0x5d7f1d[_0x2775('0x3d')]=qs['filters'](_[_0x2775('0x3e')](_0x3fd845[_0x2775('0x32')],_0x2eec7e['filters']),_0x83f83f);if(_0x3fd845['query']['filter']){_0x5d7f1d[_0x2775('0x3d')]=_['merge'](_0x5d7f1d[_0x2775('0x3d')],{'$or':_['map'](_0x83f83f,function(_0x5c0dd3){if(_0x5c0dd3[_0x2775('0x2f')]!==_0x2775('0x3f')){var _0x1b5330={};_0x1b5330[_0x5c0dd3[_0x2775('0x29')]]={'$like':'%'+_0x3fd845[_0x2775('0x32')][_0x2775('0x40')]+'%'};return _0x1b5330;}})});}_0x5d7f1d=_[_0x2775('0x41')]({},_0x5d7f1d,_0x3fd845[_0x2775('0x42')]);var _0xc36e9e={'where':_0x5d7f1d[_0x2775('0x3d')]};return db[_0x2775('0x2c')]['count'](_0xc36e9e)[_0x2775('0x28')](function(_0x1090cb){_0x488da4[_0x2775('0x20')]=_0x1090cb;if(_0x3fd845[_0x2775('0x32')]['includeAll']){_0x5d7f1d[_0x2775('0x43')]=[{'all':!![]}];}return db[_0x2775('0x2c')][_0x2775('0x44')](_0x5d7f1d);})[_0x2775('0x28')](function(_0x41096a){_0x488da4[_0x2775('0x45')]=_0x41096a;return _0x488da4;})['then'](respondWithFilteredResult(_0x1c96f3,_0x5d7f1d))[_0x2775('0x46')](handleError(_0x1c96f3,null));};exports[_0x2775('0x47')]=function(_0x2dec3d,_0x27ed28){var _0x1448d={'raw':!![],'where':{'id':_0x2dec3d[_0x2775('0x48')]['id']}},_0x4e9fec={};_0x4e9fec[_0x2775('0x31')]=_[_0x2775('0x33')](db[_0x2775('0x2c')]['rawAttributes']);_0x4e9fec[_0x2775('0x32')]=_['keys'](_0x2dec3d[_0x2775('0x32')]);_0x4e9fec[_0x2775('0x34')]=_['intersection'](_0x4e9fec[_0x2775('0x31')],_0x4e9fec[_0x2775('0x32')]);_0x1448d[_0x2775('0x35')]=_[_0x2775('0x36')](_0x4e9fec['model'],qs['fields'](_0x2dec3d[_0x2775('0x32')][_0x2775('0x37')]));_0x1448d[_0x2775('0x35')]=_0x1448d[_0x2775('0x35')]['length']?_0x1448d['attributes']:_0x4e9fec['model'];if(_0x2dec3d[_0x2775('0x32')][_0x2775('0x49')]){_0x1448d[_0x2775('0x43')]=[{'all':!![]}];}_0x1448d=_[_0x2775('0x41')]({},_0x1448d,_0x2dec3d[_0x2775('0x42')]);return db[_0x2775('0x2c')]['find'](_0x1448d)[_0x2775('0x28')](handleEntityNotFound(_0x27ed28,null))[_0x2775('0x28')](respondWithResult(_0x27ed28,null))['catch'](handleError(_0x27ed28,null));};exports['create']=function(_0x44a8d0,_0x151882){return db[_0x2775('0x2c')][_0x2775('0x4a')](_0x44a8d0['body'],{})['then'](respondWithResult(_0x151882,0xc9))['catch'](handleError(_0x151882,null));};exports[_0x2775('0x4b')]=function(_0x1046b3,_0x391b21){if(_0x1046b3[_0x2775('0x4c')]['id']){delete _0x1046b3[_0x2775('0x4c')]['id'];}return db[_0x2775('0x2c')][_0x2775('0x4d')]({'where':{'id':_0x1046b3['params']['id']}})[_0x2775('0x28')](handleEntityNotFound(_0x391b21,null))['then'](saveUpdates(_0x1046b3[_0x2775('0x4c')],null))['then'](respondWithResult(_0x391b21,null))[_0x2775('0x46')](handleError(_0x391b21,null));};exports[_0x2775('0x4e')]=function(_0x19efe7,_0x4f2d03){return db['WhatsappTransferReport']['find']({'where':{'id':_0x19efe7[_0x2775('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f2d03,null))[_0x2775('0x28')](removeEntity(_0x4f2d03,null))[_0x2775('0x46')](handleError(_0x4f2d03,null));};exports[_0x2775('0x4f')]=function(_0x2d0b0a,_0x4cafa5){return db['WhatsappTransferReport'][_0x2775('0x4f')]()[_0x2775('0x28')](respondWithResult(_0x4cafa5,null))[_0x2775('0x46')](handleError(_0x4cafa5,null));}; \ No newline at end of file +var _0xa161=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','apply','reject','save','update','then','sendStatus','error','name','send','map','WhatsappTransferReport','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xa161,0x1bf));var _0x1a16=function(_0x1ff8c1,_0x485f98){_0x1ff8c1=_0x1ff8c1-0x0;var _0x528e4c=_0xa161[_0x1ff8c1];return _0x528e4c;};'use strict';var emlformat=require(_0x1a16('0x0'));var rimraf=require(_0x1a16('0x1'));var zipdir=require(_0x1a16('0x2'));var jsonpatch=require(_0x1a16('0x3'));var rp=require('request-promise');var moment=require(_0x1a16('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a16('0x5'));var util=require(_0x1a16('0x6'));var path=require(_0x1a16('0x7'));var sox=require(_0x1a16('0x8'));var csv=require(_0x1a16('0x9'));var ejs=require(_0x1a16('0xa'));var fs=require('fs');var fs_extra=require(_0x1a16('0xb'));var _=require(_0x1a16('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a16('0xd'));var deskjs=require(_0x1a16('0xe'));var toCsv=require(_0x1a16('0x9'));var querystring=require('querystring');var Papa=require(_0x1a16('0xf'));var Redis=require('ioredis');var authService=require(_0x1a16('0x10'));var qs=require(_0x1a16('0x11'));var as=require(_0x1a16('0x12'));var hardwareService=require(_0x1a16('0x13'));var logger=require(_0x1a16('0x14'))(_0x1a16('0x15'));var utils=require(_0x1a16('0x16'));var config=require(_0x1a16('0x17'));var licenseUtil=require(_0x1a16('0x18'));var db=require(_0x1a16('0x19'))['db'];function respondWithStatusCode(_0x1a846d,_0x36a52a){_0x36a52a=_0x36a52a||0xcc;return function(_0x33ebed){if(_0x33ebed){return _0x1a846d['sendStatus'](_0x36a52a);}return _0x1a846d[_0x1a16('0x1a')](_0x36a52a)[_0x1a16('0x1b')]();};}function respondWithResult(_0x2d29b8,_0x5614aa){_0x5614aa=_0x5614aa||0xc8;return function(_0x2a445f){if(_0x2a445f){return _0x2d29b8[_0x1a16('0x1a')](_0x5614aa)['json'](_0x2a445f);}};}function respondWithFilteredResult(_0x1bedb3,_0x55f63a){return function(_0x6e004a){if(_0x6e004a){var _0x1e59a2=typeof _0x55f63a['offset']==='undefined'&&typeof _0x55f63a[_0x1a16('0x1c')]===_0x1a16('0x1d');var _0x33da16=_0x6e004a[_0x1a16('0x1e')];var _0x2afd75=_0x1e59a2?0x0:_0x55f63a[_0x1a16('0x1f')];var _0x369d2c=_0x1e59a2?_0x6e004a['count']:_0x55f63a[_0x1a16('0x1f')]+_0x55f63a['limit'];var _0x44f885;if(_0x369d2c>=_0x33da16){_0x369d2c=_0x33da16;_0x44f885=0xc8;}else{_0x44f885=0xce;}_0x1bedb3[_0x1a16('0x1a')](_0x44f885);return _0x1bedb3['set']('Content-Range',_0x2afd75+'-'+_0x369d2c+'/'+_0x33da16)['json'](_0x6e004a);}return null;};}function patchUpdates(_0x1dbee8){return function(_0xa394e9){try{jsonpatch[_0x1a16('0x20')](_0xa394e9,_0x1dbee8,!![]);}catch(_0x4e1c3a){return BPromise[_0x1a16('0x21')](_0x4e1c3a);}return _0xa394e9[_0x1a16('0x22')]();};}function saveUpdates(_0x6fe317,_0xd1ef26){return function(_0x19f8f2){if(_0x19f8f2){return _0x19f8f2[_0x1a16('0x23')](_0x6fe317)[_0x1a16('0x24')](function(_0x43d864){return _0x43d864;});}return null;};}function removeEntity(_0x4d2ebe,_0x55fdf9){return function(_0x4730ee){if(_0x4730ee){return _0x4730ee['destroy']()['then'](function(){_0x4d2ebe[_0x1a16('0x1a')](0xcc)[_0x1a16('0x1b')]();});}};}function handleEntityNotFound(_0x15e02d,_0x3a92a7){return function(_0x2718c0){if(!_0x2718c0){_0x15e02d[_0x1a16('0x25')](0x194);}return _0x2718c0;};}function handleError(_0x3991a6,_0x16ff23){_0x16ff23=_0x16ff23||0x1f4;return function(_0x563343){logger[_0x1a16('0x26')](_0x563343['stack']);if(_0x563343[_0x1a16('0x27')]){delete _0x563343[_0x1a16('0x27')];}_0x3991a6[_0x1a16('0x1a')](_0x16ff23)[_0x1a16('0x28')](_0x563343);};}exports['index']=function(_0x60b051,_0x2999a4){var _0x178139={},_0x24c014={},_0xade469={'count':0x0,'rows':[]};var _0x2ba7f8=_[_0x1a16('0x29')](db[_0x1a16('0x2a')]['rawAttributes'],function(_0x4447ba){return{'name':_0x4447ba[_0x1a16('0x2b')],'type':_0x4447ba[_0x1a16('0x2c')][_0x1a16('0x2d')]};});_0x24c014[_0x1a16('0x2e')]=_[_0x1a16('0x29')](_0x2ba7f8,_0x1a16('0x27'));_0x24c014['query']=_[_0x1a16('0x2f')](_0x60b051['query']);_0x24c014['filters']=_[_0x1a16('0x30')](_0x24c014[_0x1a16('0x2e')],_0x24c014[_0x1a16('0x31')]);_0x178139['attributes']=_[_0x1a16('0x30')](_0x24c014[_0x1a16('0x2e')],qs[_0x1a16('0x32')](_0x60b051[_0x1a16('0x31')][_0x1a16('0x32')]));_0x178139['attributes']=_0x178139[_0x1a16('0x33')][_0x1a16('0x34')]?_0x178139[_0x1a16('0x33')]:_0x24c014[_0x1a16('0x2e')];if(!_0x60b051['query'][_0x1a16('0x35')](_0x1a16('0x36'))){_0x178139[_0x1a16('0x1c')]=qs['limit'](_0x60b051[_0x1a16('0x31')][_0x1a16('0x1c')]);_0x178139[_0x1a16('0x1f')]=qs['offset'](_0x60b051['query'][_0x1a16('0x1f')]);}_0x178139['order']=qs['sort'](_0x60b051[_0x1a16('0x31')][_0x1a16('0x37')]);_0x178139['where']=qs[_0x1a16('0x38')](_[_0x1a16('0x39')](_0x60b051[_0x1a16('0x31')],_0x24c014[_0x1a16('0x38')]),_0x2ba7f8);if(_0x60b051['query'][_0x1a16('0x3a')]){_0x178139[_0x1a16('0x3b')]=_['merge'](_0x178139[_0x1a16('0x3b')],{'$or':_['map'](_0x2ba7f8,function(_0xca6efd){if(_0xca6efd[_0x1a16('0x2c')]!=='VIRTUAL'){var _0x10dccd={};_0x10dccd[_0xca6efd[_0x1a16('0x27')]]={'$like':'%'+_0x60b051[_0x1a16('0x31')][_0x1a16('0x3a')]+'%'};return _0x10dccd;}})});}_0x178139=_[_0x1a16('0x3c')]({},_0x178139,_0x60b051[_0x1a16('0x3d')]);var _0x5658b2={'where':_0x178139[_0x1a16('0x3b')]};return db[_0x1a16('0x2a')][_0x1a16('0x1e')](_0x5658b2)[_0x1a16('0x24')](function(_0x34c688){_0xade469[_0x1a16('0x1e')]=_0x34c688;if(_0x60b051[_0x1a16('0x31')][_0x1a16('0x3e')]){_0x178139[_0x1a16('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x1a16('0x40')](_0x178139);})[_0x1a16('0x24')](function(_0x5fa084){_0xade469[_0x1a16('0x41')]=_0x5fa084;return _0xade469;})[_0x1a16('0x24')](respondWithFilteredResult(_0x2999a4,_0x178139))[_0x1a16('0x42')](handleError(_0x2999a4,null));};exports[_0x1a16('0x43')]=function(_0x4afbcd,_0x40fcaa){var _0xf6f02={'raw':!![],'where':{'id':_0x4afbcd[_0x1a16('0x44')]['id']}},_0x39f37a={};_0x39f37a[_0x1a16('0x2e')]=_[_0x1a16('0x2f')](db[_0x1a16('0x2a')][_0x1a16('0x45')]);_0x39f37a[_0x1a16('0x31')]=_[_0x1a16('0x2f')](_0x4afbcd[_0x1a16('0x31')]);_0x39f37a[_0x1a16('0x38')]=_['intersection'](_0x39f37a['model'],_0x39f37a[_0x1a16('0x31')]);_0xf6f02[_0x1a16('0x33')]=_[_0x1a16('0x30')](_0x39f37a[_0x1a16('0x2e')],qs[_0x1a16('0x32')](_0x4afbcd[_0x1a16('0x31')][_0x1a16('0x32')]));_0xf6f02[_0x1a16('0x33')]=_0xf6f02['attributes'][_0x1a16('0x34')]?_0xf6f02[_0x1a16('0x33')]:_0x39f37a[_0x1a16('0x2e')];if(_0x4afbcd['query'][_0x1a16('0x3e')]){_0xf6f02[_0x1a16('0x3f')]=[{'all':!![]}];}_0xf6f02=_[_0x1a16('0x3c')]({},_0xf6f02,_0x4afbcd[_0x1a16('0x3d')]);return db[_0x1a16('0x2a')][_0x1a16('0x46')](_0xf6f02)[_0x1a16('0x24')](handleEntityNotFound(_0x40fcaa,null))['then'](respondWithResult(_0x40fcaa,null))[_0x1a16('0x42')](handleError(_0x40fcaa,null));};exports[_0x1a16('0x47')]=function(_0x163a58,_0x568579){return db['WhatsappTransferReport'][_0x1a16('0x47')](_0x163a58[_0x1a16('0x48')],{})[_0x1a16('0x24')](respondWithResult(_0x568579,0xc9))[_0x1a16('0x42')](handleError(_0x568579,null));};exports[_0x1a16('0x23')]=function(_0x59c853,_0x2f97bb){if(_0x59c853[_0x1a16('0x48')]['id']){delete _0x59c853[_0x1a16('0x48')]['id'];}return db['WhatsappTransferReport'][_0x1a16('0x46')]({'where':{'id':_0x59c853[_0x1a16('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f97bb,null))[_0x1a16('0x24')](saveUpdates(_0x59c853[_0x1a16('0x48')],null))['then'](respondWithResult(_0x2f97bb,null))[_0x1a16('0x42')](handleError(_0x2f97bb,null));};exports['destroy']=function(_0x466a2a,_0x4ad3bf){return db['WhatsappTransferReport'][_0x1a16('0x46')]({'where':{'id':_0x466a2a[_0x1a16('0x44')]['id']}})[_0x1a16('0x24')](handleEntityNotFound(_0x4ad3bf,null))[_0x1a16('0x24')](removeEntity(_0x4ad3bf,null))[_0x1a16('0x42')](handleError(_0x4ad3bf,null));};exports['describe']=function(_0x340b9f,_0x3272e4){return db[_0x1a16('0x2a')][_0x1a16('0x49')]()['then'](respondWithResult(_0x3272e4,null))[_0x1a16('0x42')](handleError(_0x3272e4,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ef9be4f..6dd171d 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 _0xe55b=['bluebird','request-promise','rimraf','exports','define','uniqueid','util','../../config/logger','api'];(function(_0x2e6023,_0x3497e3){var _0x48ae6e=function(_0x2159fa){while(--_0x2159fa){_0x2e6023['push'](_0x2e6023['shift']());}};_0x48ae6e(++_0x3497e3);}(_0xe55b,0x1bf));var _0xbe55=function(_0x5185c6,_0x4e7c65){_0x5185c6=_0x5185c6-0x0;var _0x1a9c19=_0xe55b[_0x5185c6];return _0x1a9c19;};'use strict';var _=require('lodash');var util=require(_0xbe55('0x0'));var logger=require(_0xbe55('0x1'))(_0xbe55('0x2'));var moment=require('moment');var BPromise=require(_0xbe55('0x3'));var rp=require(_0xbe55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe55('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0xbe55('0x6')]=function(_0x55e4ef,_0x504249){return _0x55e4ef[_0xbe55('0x7')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xbe55('0x8'),'fields':[_0xbe55('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f0d=['api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xa72ce,_0xdaaef8){var _0x41a95b=function(_0x842109){while(--_0x842109){_0xa72ce['push'](_0xa72ce['shift']());}};_0x41a95b(++_0xdaaef8);}(_0x5f0d,0x66));var _0xd5f0=function(_0x55b305,_0xb048cd){_0x55b305=_0x55b305-0x0;var _0x110ddd=_0x5f0d[_0x55b305];return _0x110ddd;};'use strict';var _=require(_0xd5f0('0x0'));var util=require(_0xd5f0('0x1'));var logger=require(_0xd5f0('0x2'))(_0xd5f0('0x3'));var moment=require(_0xd5f0('0x4'));var BPromise=require(_0xd5f0('0x5'));var rp=require(_0xd5f0('0x6'));var fs=require('fs');var path=require(_0xd5f0('0x7'));var rimraf=require(_0xd5f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5f0('0x9'));module[_0xd5f0('0xa')]=function(_0x38e9db,_0x114e5e){return _0x38e9db[_0xd5f0('0xb')](_0xd5f0('0xc'),attributes,{'tableName':_0xd5f0('0xd'),'paranoid':![],'indexes':[{'name':_0xd5f0('0xe'),'fields':[_0xd5f0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index bf2b15d..db4196c 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 _0x31ae=['stringify','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x12fca3,_0x1dd5e4){var _0x1aa91f=function(_0x4db804){while(--_0x4db804){_0x12fca3['push'](_0x12fca3['shift']());}};_0x1aa91f(++_0x1dd5e4);}(_0x31ae,0xb0));var _0xe31a=function(_0x3df70c,_0x3da797){_0x3df70c=_0x3df70c-0x0;var _0x137bca=_0x31ae[_0x3df70c];return _0x137bca;};'use strict';var _=require(_0xe31a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe31a('0x1'));var rs=require(_0xe31a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31a('0x3'))['db'];var utils=require(_0xe31a('0x4'));var logger=require('../../config/logger')(_0xe31a('0x5'));var config=require(_0xe31a('0x6'));var jayson=require(_0xe31a('0x7'));var client=jayson[_0xe31a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x62e2ac,_0x2b98f9,_0x30a04e){return new BPromise(function(_0x5387f7,_0x367e10){return client['request'](_0x62e2ac,_0x30a04e)['then'](function(_0xb1ecb9){logger[_0xe31a('0x9')](_0xe31a('0xa'),_0x2b98f9,'request\x20sent');logger[_0xe31a('0xb')](_0xe31a('0xc'),_0x2b98f9,_0xe31a('0xd'),JSON[_0xe31a('0xe')](_0xb1ecb9));if(_0xb1ecb9['error']){if(_0xb1ecb9[_0xe31a('0xf')]['code']===0x1f4){logger[_0xe31a('0xf')](_0xe31a('0xa'),_0x2b98f9,_0xb1ecb9[_0xe31a('0xf')][_0xe31a('0x10')]);return _0x367e10(_0xb1ecb9[_0xe31a('0xf')][_0xe31a('0x10')]);}logger[_0xe31a('0xf')](_0xe31a('0xa'),_0x2b98f9,_0xb1ecb9[_0xe31a('0xf')]['message']);return _0x5387f7(_0xb1ecb9[_0xe31a('0xf')][_0xe31a('0x10')]);}else{logger[_0xe31a('0x9')](_0xe31a('0xa'),_0x2b98f9,_0xe31a('0xd'));_0x5387f7(_0xb1ecb9[_0xe31a('0x11')][_0xe31a('0x10')]);}})[_0xe31a('0x12')](function(_0x5ee9ba){logger[_0xe31a('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2b98f9,_0x5ee9ba);_0x367e10(_0x5ee9ba);});});} \ No newline at end of file +var _0x89d0=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x89d0,0x130));var _0x089d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x89d0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x089d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x089d('0x1'));var rs=require(_0x089d('0x2'));var fs=require('fs');var Redis=require(_0x089d('0x3'));var db=require(_0x089d('0x4'))['db'];var utils=require(_0x089d('0x5'));var logger=require('../../config/logger')(_0x089d('0x6'));var config=require('../../config/environment');var jayson=require(_0x089d('0x7'));var client=jayson['client'][_0x089d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43022c,_0x8ac28e,_0x440cf1){return new BPromise(function(_0xa663cf,_0x1fed0d){return client[_0x089d('0x9')](_0x43022c,_0x440cf1)[_0x089d('0xa')](function(_0x4a7c04){logger[_0x089d('0xb')](_0x089d('0xc'),_0x8ac28e,'request\x20sent');logger[_0x089d('0xd')](_0x089d('0xe'),_0x8ac28e,_0x089d('0xf'),JSON[_0x089d('0x10')](_0x4a7c04));if(_0x4a7c04[_0x089d('0x11')]){if(_0x4a7c04[_0x089d('0x11')][_0x089d('0x12')]===0x1f4){logger[_0x089d('0x11')](_0x089d('0xc'),_0x8ac28e,_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);return _0x1fed0d(_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);}logger[_0x089d('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x8ac28e,_0x4a7c04['error'][_0x089d('0x13')]);return _0xa663cf(_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);}else{logger[_0x089d('0xb')](_0x089d('0xc'),_0x8ac28e,'request\x20sent');_0xa663cf(_0x4a7c04[_0x089d('0x14')]['message']);}})[_0x089d('0x15')](function(_0x1cc35a){logger[_0x089d('0x11')](_0x089d('0xc'),_0x8ac28e,_0x1cc35a);_0x1fed0d(_0x1cc35a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index af9a52c..901457a 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9b0=['start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','listen','info'];(function(_0x1a43c9,_0x1e6cae){var _0xc5169=function(_0x4f921f){while(--_0x4f921f){_0x1a43c9['push'](_0x1a43c9['shift']());}};_0xc5169(++_0x1e6cae);}(_0xc9b0,0x143));var _0x0c9b=function(_0x1874b6,_0x4b6363){_0x1874b6=_0x1874b6-0x0;var _0x38f450=_0xc9b0[_0x1874b6];return _0x38f450;};'use strict';var _=require(_0x0c9b('0x0'));var db=require(_0x0c9b('0x1'))['db'];var seedDb=require(_0x0c9b('0x2'));var checkLicense=require(_0x0c9b('0x3'));var rpc=require(_0x0c9b('0x4'));var config=require(_0x0c9b('0x5'));var logger=require(_0x0c9b('0x6'))(_0x0c9b('0x7'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x0c9b('0x8'));var chat=require(_0x0c9b('0x9'));var whatsapp=require(_0x0c9b('0xa'));var transcribe=require(_0x0c9b('0xb'));var provider=require(_0x0c9b('0xc'));function main(){return db[_0x0c9b('0xd')][_0x0c9b('0xe')]()[_0x0c9b('0xf')](function(){if(config[_0x0c9b('0x10')]){return seedDb['default']();}})['then'](function(){return checkLicense['default']();})[_0x0c9b('0xf')](function(){return rpc[_0x0c9b('0x11')]();})[_0x0c9b('0xf')](function(_0x3e271f){logger[_0x0c9b('0x12')](_0x3e271f);return chat[_0x0c9b('0x13')]();})['then'](function(){return whatsapp[_0x0c9b('0x13')]();})[_0x0c9b('0xf')](function(){return schedule['start']();})[_0x0c9b('0xf')](function(){return transcribe['start']();})[_0x0c9b('0xf')](function(){return provider[_0x0c9b('0x13')]();})[_0x0c9b('0xf')](function(_0xec0b75){logger[_0x0c9b('0x12')](_0xec0b75);return pm2[_0x0c9b('0x13')](pm2Config);})[_0x0c9b('0xf')](function(_0x41603d){var _0x40d68f=_0x41603d[_0x0c9b('0x14')](function(_0x4daf5e){return typeof _0x4daf5e['exitCode']==='number'&&_0x4daf5e[_0x0c9b('0x15')]>=0x0;});if(_0x40d68f[_0x0c9b('0x16')]>0x0){throw new Error(_0x40d68f['length']+_0x0c9b('0x17')+_[_0x0c9b('0x18')](_0x40d68f,function(_0x3279cd){return'\x22'+_0x3279cd[_0x0c9b('0x19')][_0x0c9b('0x1a')]+'\x22';}));}logger[_0x0c9b('0x12')](_0x0c9b('0x1b'),_['map'](_['filter'](_0x41603d,{'status':_0x0c9b('0x1c')}),'name')[_0x0c9b('0x1d')]());logger[_0x0c9b('0x12')](_0x0c9b('0x1e'),_[_0x0c9b('0x18')](_[_0x0c9b('0x14')](_0x41603d,function(_0x3d335c){return _0x3d335c[_0x0c9b('0x1f')]!==_0x0c9b('0x1c');}),_0x0c9b('0x1a'))[_0x0c9b('0x1d')]()||'None');console[_0x0c9b('0x20')](_0x0c9b('0x21'));})[_0x0c9b('0x22')](function(_0x517ab6){console[_0x0c9b('0x20')](_0x0c9b('0x23'),_0x517ab6);logger[_0x0c9b('0x24')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x517ab6);process[_0x0c9b('0x25')](0x1);});}main(); \ No newline at end of file +var _0xa630=['catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','join','log'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa630,0xbe));var _0x0a63=function(_0x23bea8,_0x2f1246){_0x23bea8=_0x23bea8-0x0;var _0x5a3a56=_0xa630[_0x23bea8];return _0x5a3a56;};'use strict';var _=require(_0x0a63('0x0'));var db=require(_0x0a63('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x0a63('0x2'));var config=require('./config/environment');var logger=require(_0x0a63('0x3'))('app');var pm2=require(_0x0a63('0x4'));var pm2Config=require(_0x0a63('0x5'));var schedule=require(_0x0a63('0x6'));var chat=require(_0x0a63('0x7'));var whatsapp=require(_0x0a63('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x0a63('0x9'));function main(){return db[_0x0a63('0xa')][_0x0a63('0xb')]()[_0x0a63('0xc')](function(){if(config[_0x0a63('0xd')]){return seedDb[_0x0a63('0xe')]();}})['then'](function(){return checkLicense[_0x0a63('0xe')]();})[_0x0a63('0xc')](function(){return rpc[_0x0a63('0xf')]();})[_0x0a63('0xc')](function(_0x327bb0){logger[_0x0a63('0x10')](_0x327bb0);return chat[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return whatsapp[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return schedule['start']();})[_0x0a63('0xc')](function(){return transcribe[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return provider[_0x0a63('0x11')]();})['then'](function(_0x23f655){logger['info'](_0x23f655);return pm2[_0x0a63('0x11')](pm2Config);})[_0x0a63('0xc')](function(_0x26b2bc){var _0x23f8b5=_0x26b2bc[_0x0a63('0x12')](function(_0x23b49d){return typeof _0x23b49d[_0x0a63('0x13')]===_0x0a63('0x14')&&_0x23b49d['exitCode']>=0x0;});if(_0x23f8b5[_0x0a63('0x15')]>0x0){throw new Error(_0x23f8b5['length']+_0x0a63('0x16')+_[_0x0a63('0x17')](_0x23f8b5,function(_0x36a9e8){return'\x22'+_0x36a9e8[_0x0a63('0x18')][_0x0a63('0x19')]+'\x22';}));}logger[_0x0a63('0x10')](_0x0a63('0x1a'),_[_0x0a63('0x17')](_[_0x0a63('0x12')](_0x26b2bc,{'status':_0x0a63('0x1b')}),_0x0a63('0x19'))['join']());logger['info'](_0x0a63('0x1c'),_['map'](_[_0x0a63('0x12')](_0x26b2bc,function(_0x5937df){return _0x5937df[_0x0a63('0x1d')]!==_0x0a63('0x1b');}),_0x0a63('0x19'))[_0x0a63('0x1e')]()||'None');console[_0x0a63('0x1f')]('App\x20Ready!');})[_0x0a63('0x20')](function(_0x11fe64){console[_0x0a63('0x1f')](_0x0a63('0x21'),_0x11fe64);logger[_0x0a63('0x22')](_0x0a63('0x23'),_0x11fe64);process[_0x0a63('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 59d6857..520bcfe 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 _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','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','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x105ac9,_0x1be596){var _0x1104b5=function(_0x27477a){while(--_0x27477a){_0x105ac9['push'](_0x105ac9['shift']());}};_0x1104b5(++_0x1be596);}(_0x54ef,0x112));var _0xf54e=function(_0x4467b2,_0x3d29a2){_0x4467b2=_0x4467b2-0x0;var _0x5e047a=_0x54ef[_0x4467b2];return _0x5e047a;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file +var _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x008c,0x188));var _0xc008=function(_0x524bb0,_0x326327){_0x524bb0=_0x524bb0-0x0;var _0x2fb947=_0x008c[_0x524bb0];return _0x2fb947;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 44d6c7a..0cff9b0 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 _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x4cd78d,_0x2061e5){var _0x2ce79d=function(_0x1b164b){while(--_0x1b164b){_0x4cd78d['push'](_0x4cd78d['shift']());}};_0x2ce79d(++_0x2061e5);}(_0x2032,0xd9));var _0x2203=function(_0x487e4e,_0x27efc4){_0x487e4e=_0x487e4e-0x0;var _0x3b5781=_0x2032[_0x487e4e];return _0x3b5781;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file +var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x4c9e61,_0xc050a1){var _0x11a1ac=function(_0x218a22){while(--_0x218a22){_0x4c9e61['push'](_0x4c9e61['shift']());}};_0x11a1ac(++_0xc050a1);}(_0xb10b,0x12a));var _0xbb10=function(_0x50ede0,_0x7e6410){_0x50ede0=_0x50ede0-0x0;var _0x5cbe32=_0xb10b[_0x50ede0];return _0x5cbe32;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index ab04857..35a6f8a 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 _0x873d=['SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','exports','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','firstName','lastName','fax','email','CompanyId','createdAt','deletedAt','includes','push','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','Tag','map','tags','ids','User','clause','and','uc.UserId\x20=\x20?','user','keys','some','compact','Contact','forEach','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','group','c.id','limit','offset','order','DESC','findAll','color','keyBy','QueryTypes'];(function(_0x22569f,_0x2a2deb){var _0x555702=function(_0x605966){while(--_0x605966){_0x22569f['push'](_0x22569f['shift']());}};_0x555702(++_0x2a2deb);}(_0x873d,0xde));var _0xd873=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x873d[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var utils=require(_0xd873('0x0'));var db=require(_0xd873('0x1'))['db'];function skipContactsQuery(_0x41d652,_0x42ecbf){var _0x3ce90f=![];if(_0x41d652[_0xd873('0x2')]===_0xd873('0x3')&&!_0x42ecbf[_0xd873('0x4')]&&!_0x42ecbf[_0xd873('0x5')]&&_0x42ecbf[_0xd873('0x6')]!==_0xd873('0x7')){_0x3ce90f=!![];}return _0x3ce90f;}function getContactsSubquery(){return squel[_0xd873('0x8')]()[_0xd873('0x9')](_0xd873('0xa'),'c')[_0xd873('0xb')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x19445d,_0x5a544a){var _0x1262ff=_0x5a544a?'c':_0xd873('0xc');_0x19445d[_0xd873('0xd')](_0xd873('0xe'),'uc',_0xd873('0xf')+_0x1262ff+_0xd873('0x10'))[_0xd873('0xd')](_0xd873('0x11'),'ct','ct.CmContactId\x20=\x20'+_0x1262ff+_0xd873('0x10'))['left_join'](_0xd873('0x12'),'t','t.id\x20=\x20ct.TagId');return _0x19445d;}function addFieldsToQuery(_0x33e7bb,_0x907dd1,_0x2cf2ff,_0x243044,_0x3372c0){var _0x5f4330=_0x3372c0?'c':'subqry';if(!_0x907dd1){_0x907dd1=['id',_0xd873('0x13'),_0xd873('0x14'),'phone','mobile',_0xd873('0x15'),_0xd873('0x16'),_0xd873('0x5'),_0xd873('0x17'),_0xd873('0x18'),'updatedAt',_0xd873('0x19'),'TagIds'];}else if(!_0x907dd1[_0xd873('0x1a')]('id')){_0x907dd1[_0xd873('0x1b')]('id');}var _0x2457a0=_0x2cf2ff&&_0x3372c0||!_0x2cf2ff&&!_0x3372c0;if(_0x243044){_0x2457a0=_0x243044&&_0x3372c0||!_0x243044&&!_0x3372c0;}_0x907dd1['forEach'](function(_0x55b30e){if(_0x55b30e===_0xd873('0x1c')){if(_0x2457a0){_0x33e7bb[_0xd873('0x1d')](_0xd873('0x1e'),_0x55b30e);}else if(_0x2cf2ff||_0x243044){_0x33e7bb[_0xd873('0x1d')](_0x5f4330+'.'+_0x55b30e);}}else{_0x33e7bb['field'](_0x5f4330+'.'+_0x55b30e);}});return _0x33e7bb;}function getSqlClauses(){var _0x4fb58f={'default':squel['expr'](),'fields':squel[_0xd873('0x1f')](),'filter':squel[_0xd873('0x1f')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4fb58f;}function parseTagParameter(_0x57c78f){var _0x5ece34=squel[_0xd873('0x1f')]();if(_0x57c78f){var _0x288de2=utils['getSelectedTags'](_0x57c78f);_0x288de2['forEach'](function(_0x1ae198){_0x5ece34['or'](_0xd873('0x20'),'%,'+_0x1ae198+',%');});}return _0x5ece34;}function parseSearchFilter(_0x32e879){var _0xf722b1=squel['expr']();if(_0x32e879){var _0x2e86c9=_0x32e879[_0xd873('0x21')]('\x5c','\x5c\x5c')[_0xd873('0x21')](/'/g,'\x27\x27');if(_0x2e86c9[_0xd873('0x22')]('\x20')[_0xd873('0x23')]>0x1){_0xf722b1['or'](_0xd873('0x24'),qs[_0xd873('0x25')](_0x2e86c9),null);}else{if(qs['isNumeric'](_0x2e86c9)){_0xf722b1['or'](_0xd873('0x26'),_0x2e86c9+'%');_0xf722b1['or'](_0xd873('0x27'),_0x2e86c9+'%');_0xf722b1['or'](_0xd873('0x28'),_0x2e86c9+'%');_0xf722b1['or']('c.fax\x20LIKE\x20?',_0x2e86c9+'%');}else if(qs[_0xd873('0x29')](_0x2e86c9)){_0xf722b1['or'](_0xd873('0x2a'),_0x2e86c9+'%');}else{_0xf722b1['or'](_0xd873('0x2b'),'%'+_0x2e86c9+'%');_0xf722b1['or'](_0xd873('0x2c'),'%'+_0x2e86c9+'%');_0xf722b1['or'](_0xd873('0x2a'),'%'+_0x2e86c9+'%');}}}return _0xf722b1;}function parseAdvancedSearchFilter(_0x19ae49,_0x29e00a){var _0x9a735a=getSqlClauses();var _0x46b096=as[_0xd873('0x2d')](_0x19ae49);var _0x5e4352=_0x46b096[_0xd873('0x2e')];for(var _0x1dca78=0x0;_0x1dca78<_0x46b096[_0xd873('0x2f')][_0xd873('0x23')];_0x1dca78++){var _0x41bc14=_0x46b096[_0xd873('0x2f')][_0x1dca78];var _0x9ca9ff='c';var _0xa79380=_[_0xd873('0x30')](_0x29e00a,[_0xd873('0x31'),_0x41bc14[_0xd873('0x1d')]]);if(_0xa79380){if(_0x41bc14[_0xd873('0x1d')]===_0xd873('0x32')||_0xa79380[_0xd873('0x33')]===_0xd873('0x34')){_0x41bc14[_0xd873('0x35')]=_0xd873('0x36');}var _0x557ad3=as[_0xd873('0x37')](_0x9ca9ff,_0xa79380[_0xd873('0x38')],_0x41bc14);_0x9a735a[_0xd873('0x39')][_0x5e4352](_0x557ad3[_0xd873('0x3a')],_0x557ad3[_0xd873('0x3b')][_0xd873('0x3c')],_0x557ad3[_0xd873('0x3b')]['end']);}else{if(_0x41bc14[_0xd873('0x1d')]===_0xd873('0x3d')){var _0x26350a=_0x41bc14[_0xd873('0x3b')][_0xd873('0x22')](',')[_0xd873('0x3e')](function(_0x445b04){return Number(_0x445b04);});var _0xedb6d8=parseTagParameter(_0x26350a);_0x9a735a[_0xd873('0x3f')]['clause']['and'](_0xedb6d8);_0x9a735a['tags'][_0xd873('0x40')]=_0x26350a;}else if(_0x41bc14[_0xd873('0x1d')]===_0xd873('0x41')){_0x9a735a['user'][_0xd873('0x42')][_0xd873('0x43')](_0xd873('0x44'),_0x41bc14[_0xd873('0x3b')]);_0x9a735a[_0xd873('0x45')]['skip']=!![];}}}return _0x9a735a;}function parseModelFields(_0x41c633,_0x2ffcb5){var _0x209e2e=squel[_0xd873('0x1f')]();var _0x498db9=_(_0x41c633)[_0xd873('0x46')]()[_0xd873('0x3e')](function(_0x40829c){return _[_0xd873('0x47')](_0x2ffcb5,[_0xd873('0x31'),_0x40829c])?_0x40829c:undefined;})[_0xd873('0x48')]()[_0xd873('0x3b')]();if(_0x41c633['Contact']){_0x498db9[_0xd873('0x1b')](_0xd873('0x49'));}if(_0x498db9[_0xd873('0x23')]>0x0){_0x498db9[_0xd873('0x4a')](function(_0x2be07a){if(_0x2be07a===_0xd873('0x5')){_0x209e2e[_0xd873('0x43')]('c.ListId\x20IN\x20?',[]['concat'](_0x41c633[_0x2be07a]));}else if(_0x2be07a===_0xd873('0x49')){var _0x387e01='%'+_0x41c633[_0x2be07a]+'%';_0x209e2e[_0xd873('0x43')](_0xd873('0x4b'),_0x387e01);}else{_0x209e2e['and']('c.'+_0x2be07a+'\x20=\x20?',_0x41c633[_0x2be07a]);}});}return _0x209e2e;}function parseQueryParameters(_0x21f715,_0x3b0961){var _0xfb8fa3=getSqlClauses();return Promise[_0xd873('0x4c')]()[_0xd873('0x4d')](function(){return parseModelFields(_0x21f715,_0x3b0961);})[_0xd873('0x4d')](function(_0x5b661e){_0xfb8fa3['fields'][_0xd873('0x43')](_0x5b661e);return parseTagParameter(_0x21f715[_0xd873('0x4e')]);})[_0xd873('0x4d')](function(_0x3f41a0){_0xfb8fa3[_0xd873('0x3f')][_0xd873('0x42')][_0xd873('0x43')](_0x3f41a0);return parseSearchFilter(_0x21f715[_0xd873('0x4f')]);})['then'](function(_0x42fa75){_0xfb8fa3[_0xd873('0x4f')]=_0x42fa75;return _0xfb8fa3;});}function checkListsRestrictions(_0x280d9b,_0x32ef98,_0x1c4147){var _0x2480ee=squel[_0xd873('0x1f')]();return Promise['resolve']()[_0xd873('0x4d')](function(){if(_0x32ef98[_0xd873('0x4')]&&_0x280d9b[_0xd873('0x2')]===_0xd873('0x3')&&!_0x1c4147){return _0x280d9b[_0xd873('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x85e8cb){if(_0x85e8cb){if(_0x85e8cb[_0xd873('0x23')]===0x0){_0x2480ee[_0xd873('0x43')](_0xd873('0x51'));}else{_0x2480ee[_0xd873('0x43')](_0xd873('0x52'),_[_0xd873('0x3e')](_0x85e8cb,'id'));}}})[_0xd873('0x4d')](function(){return _0x2480ee;});}function buildContactsQuery(_0x386de6,_0x5ee637,_0x3031b3,_0x43d545,_0x35f347,_0x1fe342){if(_0x5ee637){_0x5ee637=_0x3031b3['attributes'];}_0x386de6=addFieldsToQuery(_0x386de6,_0x5ee637,_0x43d545,_0x1fe342,!![]);var _0xa7d09b=squel['select']();_0xa7d09b=addFieldsToQuery(_0xa7d09b,_0x5ee637,_0x43d545,_0x1fe342,![]);if(_0x43d545||_0x1fe342){_0x386de6=applyJoinClauses(_0x386de6,!![]);_0x386de6[_0xd873('0x53')](_0xd873('0x54'));if(_0x3031b3[_0xd873('0x55')]){_0xa7d09b[_0xd873('0x55')](_0x3031b3['limit']);}if(_0x3031b3[_0xd873('0x56')]){_0xa7d09b[_0xd873('0x56')](_0x3031b3['offset']);}}else{_0xa7d09b=applyJoinClauses(_0xa7d09b,![]);_0xa7d09b['group']('subqry.id');if(_0x3031b3[_0xd873('0x55')]){_0x386de6[_0xd873('0x55')](_0x3031b3[_0xd873('0x55')]);}if(_0x3031b3[_0xd873('0x56')]){_0x386de6[_0xd873('0x56')](_0x3031b3[_0xd873('0x56')]);}}_0xa7d09b['having'](_0x35f347);if(_0x3031b3[_0xd873('0x57')]){_0x3031b3[_0xd873('0x57')]['forEach'](function(_0x3372ed){_0x386de6[_0xd873('0x57')]('c.'+_0x3372ed[0x0],_0x3372ed[0x1]===_0xd873('0x58')?![]:!![]);_0xa7d09b['order']('subqry.'+_0x3372ed[0x0],_0x3372ed[0x1]===_0xd873('0x58')?![]:!![]);});}_0xa7d09b['from'](_0x386de6,_0xd873('0xc'));return _0xa7d09b;}function getFilteredContacts(_0x495d47){var _0x59df9f=[];return db['Tag'][_0xd873('0x59')]({'attributes':['id',_0xd873('0x31'),_0xd873('0x5a')],'raw':!![]})[_0xd873('0x4d')](function(_0x44c8ab){_0x59df9f=_[_0xd873('0x5b')](_0x44c8ab,'id');var _0x2c3101={'type':db['Sequelize'][_0xd873('0x5c')][_0xd873('0x5d')],'model':db[_0xd873('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xd873('0x5f')][_0xd873('0x60')](_0x495d47[_0xd873('0x61')](),_0x2c3101);})['then'](function(_0x2422b7){_0x2422b7[_0xd873('0x4a')](function(_0x2efbcc){if(_0x2efbcc[_0xd873('0x1c')]){_0x2efbcc['Tags']=[];_0x2efbcc[_0xd873('0x1c')][_0xd873('0x22')](',')['forEach'](function(_0x31aeac){_0x2efbcc[_0xd873('0x62')][_0xd873('0x1b')](_0x59df9f[_0x31aeac]);});}delete _0x2efbcc[_0xd873('0x1c')];});return _0x2422b7;});}function countFilteredContacts(_0x1f06ee,_0x1fb7c0){var _0x4d108c=_0x1f06ee[_0xd873('0x63')]();_0x4d108c[_0xd873('0x1d')](_0xd873('0x64'));_0x4d108c=applyJoinClauses(_0x4d108c,!![]);_0x1f06ee[_0xd873('0x53')]('c.id');var _0x406929=utils['getSelectedTags'](_0x1fb7c0);if(!_[_0xd873('0x65')](_0x406929)){_0x4d108c['where'](_0xd873('0x66'),_0x406929);}var _0x1126aa={'type':db[_0xd873('0x67')]['QueryTypes'][_0xd873('0x5d')],'raw':!![]};return db[_0xd873('0x5f')][_0xd873('0x60')](_0x4d108c['toString'](),_0x1126aa)['then'](function(_0x421e9b){return _0x421e9b[0x0][_0xd873('0x64')];});}module[_0xd873('0x68')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xbac0=['value','Tag','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','and','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tag','filter','resolve','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','left_join','cm_contact_has_tags','.id','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','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)','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text'];(function(_0x28f1a8,_0x5c853e){var _0x4293c9=function(_0x103823){while(--_0x103823){_0x28f1a8['push'](_0x28f1a8['shift']());}};_0x4293c9(++_0x5c853e);}(_0xbac0,0x1e8));var _0x0bac=function(_0x11cd17,_0x489e02){_0x11cd17=_0x11cd17-0x0;var _0x3343ad=_0xbac0[_0x11cd17];return _0x3343ad;};'use strict';var _=require('lodash');var squel=require(_0x0bac('0x0'));var as=require(_0x0bac('0x1'));var qs=require(_0x0bac('0x2'));var utils=require(_0x0bac('0x3'));var db=require(_0x0bac('0x4'))['db'];function skipContactsQuery(_0x46177c,_0x2ad975){var _0x20e7da=![];if(_0x46177c[_0x0bac('0x5')]===_0x0bac('0x6')&&!_0x2ad975[_0x0bac('0x7')]&&!_0x2ad975[_0x0bac('0x8')]&&_0x2ad975[_0x0bac('0x9')]!==_0x0bac('0xa')){_0x20e7da=!![];}return _0x20e7da;}function getContactsSubquery(){return squel['select']()[_0x0bac('0xb')]('cm_contacts','c')[_0x0bac('0xc')](_0x0bac('0xd'));}function applyJoinClauses(_0x3a783f,_0x2a1a0f){var _0x1ca994=_0x2a1a0f?'c':_0x0bac('0xe');_0x3a783f['left_join'](_0x0bac('0xf'),'uc',_0x0bac('0x10')+_0x1ca994+'.id')[_0x0bac('0x11')](_0x0bac('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x1ca994+_0x0bac('0x13'))[_0x0bac('0x11')](_0x0bac('0x14'),'t',_0x0bac('0x15'));return _0x3a783f;}function addFieldsToQuery(_0x54f846,_0x711eab,_0x353e2c,_0x55b94c,_0x5aecb1){var _0x2df847=_0x5aecb1?'c':_0x0bac('0xe');if(!_0x711eab){_0x711eab=['id','firstName',_0x0bac('0x16'),_0x0bac('0x17'),_0x0bac('0x18'),'fax',_0x0bac('0x19'),_0x0bac('0x8'),_0x0bac('0x1a'),_0x0bac('0x1b'),_0x0bac('0x1c'),_0x0bac('0x1d'),_0x0bac('0x1e')];}else if(!_0x711eab[_0x0bac('0x1f')]('id')){_0x711eab[_0x0bac('0x20')]('id');}var _0xf0a249=_0x353e2c&&_0x5aecb1||!_0x353e2c&&!_0x5aecb1;if(_0x55b94c){_0xf0a249=_0x55b94c&&_0x5aecb1||!_0x55b94c&&!_0x5aecb1;}_0x711eab[_0x0bac('0x21')](function(_0x5e54dd){if(_0x5e54dd===_0x0bac('0x1e')){if(_0xf0a249){_0x54f846[_0x0bac('0x22')](_0x0bac('0x23'),_0x5e54dd);}else if(_0x353e2c||_0x55b94c){_0x54f846[_0x0bac('0x22')](_0x2df847+'.'+_0x5e54dd);}}else{_0x54f846[_0x0bac('0x22')](_0x2df847+'.'+_0x5e54dd);}});return _0x54f846;}function getSqlClauses(){var _0x2ebb29={'default':squel[_0x0bac('0x24')](),'fields':squel[_0x0bac('0x24')](),'filter':squel[_0x0bac('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x0bac('0x24')](),'skip':![]}};return _0x2ebb29;}function parseTagParameter(_0x9ec56c){var _0x17fd37=squel[_0x0bac('0x24')]();if(_0x9ec56c){var _0x410f4d=utils[_0x0bac('0x25')](_0x9ec56c);_0x410f4d[_0x0bac('0x21')](function(_0x233dbd){_0x17fd37['or'](_0x0bac('0x26'),'%,'+_0x233dbd+',%');});}return _0x17fd37;}function parseSearchFilter(_0x2686f0){var _0x36c57c=squel[_0x0bac('0x24')]();if(_0x2686f0){var _0x31d35a=_0x2686f0[_0x0bac('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x31d35a[_0x0bac('0x28')]('\x20')['length']>0x1){_0x36c57c['or'](_0x0bac('0x29'),qs['getFullTextValue'](_0x31d35a),null);}else{if(qs[_0x0bac('0x2a')](_0x31d35a)){_0x36c57c['or'](_0x0bac('0x2b'),_0x31d35a+'%');_0x36c57c['or']('c.phone\x20LIKE\x20?',_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2c'),_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2d'),_0x31d35a+'%');}else if(qs[_0x0bac('0x2e')](_0x31d35a)){_0x36c57c['or'](_0x0bac('0x2f'),_0x31d35a+'%');}else{_0x36c57c['or'](_0x0bac('0x30'),'%'+_0x31d35a+'%');_0x36c57c['or']('c.lastName\x20LIKE\x20?','%'+_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2f'),'%'+_0x31d35a+'%');}}}return _0x36c57c;}function parseAdvancedSearchFilter(_0x5b187c,_0x3e3223){var _0x480af7=getSqlClauses();var _0x3874bc=as[_0x0bac('0x31')](_0x5b187c);var _0x2761e1=_0x3874bc[_0x0bac('0x32')];for(var _0x4d04ce=0x0;_0x4d04ce<_0x3874bc[_0x0bac('0x33')][_0x0bac('0x34')];_0x4d04ce++){var _0x44974b=_0x3874bc[_0x0bac('0x33')][_0x4d04ce];var _0x31adea='c';var _0x410672=_[_0x0bac('0x35')](_0x3e3223,[_0x0bac('0x36'),_0x44974b[_0x0bac('0x22')]]);if(_0x410672){if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x37')||_0x410672[_0x0bac('0x38')]===_0x0bac('0x39')){_0x44974b[_0x0bac('0x3a')]=_0x0bac('0x3b');}var _0x174d06=as[_0x0bac('0x3c')](_0x31adea,_0x410672['type'],_0x44974b);_0x480af7['default'][_0x2761e1](_0x174d06[_0x0bac('0x3d')],_0x174d06[_0x0bac('0x3e')]['start'],_0x174d06['value']['end']);}else{if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x3f')){var _0x219b3b=_0x44974b[_0x0bac('0x3e')]['split'](',')[_0x0bac('0x40')](function(_0x35f031){return Number(_0x35f031);});var _0x400c0b=parseTagParameter(_0x219b3b);_0x480af7[_0x0bac('0x41')][_0x0bac('0x42')]['and'](_0x400c0b);_0x480af7[_0x0bac('0x41')][_0x0bac('0x43')]=_0x219b3b;}else if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x44')){_0x480af7[_0x0bac('0x45')][_0x0bac('0x42')]['and'](_0x0bac('0x46'),_0x44974b[_0x0bac('0x3e')]);_0x480af7[_0x0bac('0x45')][_0x0bac('0x47')]=!![];}}}return _0x480af7;}function parseModelFields(_0x3646b6,_0x19092b){var _0x1d7db2=squel[_0x0bac('0x24')]();var _0x85816=_(_0x3646b6)[_0x0bac('0x48')]()[_0x0bac('0x40')](function(_0x439499){return _[_0x0bac('0x49')](_0x19092b,['name',_0x439499])?_0x439499:undefined;})['compact']()['value']();if(_0x3646b6[_0x0bac('0x4a')]){_0x85816['push'](_0x0bac('0x4a'));}if(_0x85816[_0x0bac('0x34')]>0x0){_0x85816[_0x0bac('0x21')](function(_0x13b230){if(_0x13b230===_0x0bac('0x8')){_0x1d7db2['and'](_0x0bac('0x4b'),[]['concat'](_0x3646b6[_0x13b230]));}else if(_0x13b230===_0x0bac('0x4a')){var _0x578152='%'+_0x3646b6[_0x13b230]+'%';_0x1d7db2[_0x0bac('0x4c')](_0x0bac('0x4d'),_0x578152);}else{_0x1d7db2[_0x0bac('0x4c')]('c.'+_0x13b230+'\x20=\x20?',_0x3646b6[_0x13b230]);}});}return _0x1d7db2;}function parseQueryParameters(_0x34e4fd,_0x1e956e){var _0x36221a=getSqlClauses();return Promise['resolve']()[_0x0bac('0x4e')](function(){return parseModelFields(_0x34e4fd,_0x1e956e);})['then'](function(_0x2c5202){_0x36221a[_0x0bac('0x4f')][_0x0bac('0x4c')](_0x2c5202);return parseTagParameter(_0x34e4fd[_0x0bac('0x50')]);})[_0x0bac('0x4e')](function(_0x1950bb){_0x36221a['tags'][_0x0bac('0x42')]['and'](_0x1950bb);return parseSearchFilter(_0x34e4fd['filter']);})[_0x0bac('0x4e')](function(_0x251008){_0x36221a[_0x0bac('0x51')]=_0x251008;return _0x36221a;});}function checkListsRestrictions(_0x1dc874,_0x1f95e2,_0x3a723b){var _0x3dbae1=squel['expr']();return Promise[_0x0bac('0x52')]()[_0x0bac('0x4e')](function(){if(_0x1f95e2['search']&&_0x1dc874[_0x0bac('0x5')]==='agent'&&!_0x3a723b){return _0x1dc874['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x510b85){if(_0x510b85){if(_0x510b85['length']===0x0){_0x3dbae1[_0x0bac('0x4c')](_0x0bac('0x53'));}else{_0x3dbae1[_0x0bac('0x4c')](_0x0bac('0x4b'),_['map'](_0x510b85,'id'));}}})[_0x0bac('0x4e')](function(){return _0x3dbae1;});}function buildContactsQuery(_0x11204e,_0x181559,_0x3ff385,_0x532f0b,_0x1efb87,_0x1cdcdf){if(_0x181559){_0x181559=_0x3ff385[_0x0bac('0x54')];}_0x11204e=addFieldsToQuery(_0x11204e,_0x181559,_0x532f0b,_0x1cdcdf,!![]);var _0x19ed4f=squel['select']();_0x19ed4f=addFieldsToQuery(_0x19ed4f,_0x181559,_0x532f0b,_0x1cdcdf,![]);if(_0x532f0b||_0x1cdcdf){_0x11204e=applyJoinClauses(_0x11204e,!![]);_0x11204e[_0x0bac('0x55')](_0x0bac('0x56'));if(_0x3ff385[_0x0bac('0x57')]){_0x19ed4f['limit'](_0x3ff385[_0x0bac('0x57')]);}if(_0x3ff385[_0x0bac('0x58')]){_0x19ed4f[_0x0bac('0x58')](_0x3ff385[_0x0bac('0x58')]);}}else{_0x19ed4f=applyJoinClauses(_0x19ed4f,![]);_0x19ed4f[_0x0bac('0x55')](_0x0bac('0x59'));if(_0x3ff385[_0x0bac('0x57')]){_0x11204e[_0x0bac('0x57')](_0x3ff385[_0x0bac('0x57')]);}if(_0x3ff385['offset']){_0x11204e[_0x0bac('0x58')](_0x3ff385[_0x0bac('0x58')]);}}_0x19ed4f[_0x0bac('0x5a')](_0x1efb87);if(_0x3ff385[_0x0bac('0x5b')]){_0x3ff385[_0x0bac('0x5b')][_0x0bac('0x21')](function(_0x19716a){_0x11204e['order']('c.'+_0x19716a[0x0],_0x19716a[0x1]===_0x0bac('0x5c')?![]:!![]);_0x19ed4f['order'](_0x0bac('0x5d')+_0x19716a[0x0],_0x19716a[0x1]===_0x0bac('0x5c')?![]:!![]);});}_0x19ed4f[_0x0bac('0xb')](_0x11204e,_0x0bac('0xe'));return _0x19ed4f;}function getFilteredContacts(_0x9647fd){var _0x6de194=[];return db[_0x0bac('0x3f')][_0x0bac('0x5e')]({'attributes':['id',_0x0bac('0x36'),_0x0bac('0x5f')],'raw':!![]})['then'](function(_0x1084dc){_0x6de194=_[_0x0bac('0x60')](_0x1084dc,'id');var _0x399ac8={'type':db[_0x0bac('0x61')][_0x0bac('0x62')][_0x0bac('0x63')],'model':db[_0x0bac('0x64')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x0bac('0x65')][_0x0bac('0x66')](_0x9647fd[_0x0bac('0x67')](),_0x399ac8);})[_0x0bac('0x4e')](function(_0x95269e){_0x95269e[_0x0bac('0x21')](function(_0x5414a1){if(_0x5414a1[_0x0bac('0x1e')]){_0x5414a1[_0x0bac('0x68')]=[];_0x5414a1[_0x0bac('0x1e')][_0x0bac('0x28')](',')['forEach'](function(_0x263e8e){_0x5414a1['Tags'][_0x0bac('0x20')](_0x6de194[_0x263e8e]);});}delete _0x5414a1[_0x0bac('0x1e')];});return _0x95269e;});}function countFilteredContacts(_0x4de423,_0x4e4127){var _0xd81c38=_0x4de423[_0x0bac('0x69')]();_0xd81c38['field'](_0x0bac('0x6a'));_0xd81c38=applyJoinClauses(_0xd81c38,!![]);_0x4de423['group']('c.id');var _0x47b0e4=utils['getSelectedTags'](_0x4e4127);if(!_[_0x0bac('0x6b')](_0x47b0e4)){_0xd81c38[_0x0bac('0xc')](_0x0bac('0x6c'),_0x47b0e4);}var _0x2e526c={'type':db[_0x0bac('0x61')][_0x0bac('0x62')][_0x0bac('0x63')],'raw':!![]};return db[_0x0bac('0x65')][_0x0bac('0x66')](_0xd81c38['toString'](),_0x2e526c)[_0x0bac('0x4e')](function(_0x461686){return _0x461686[0x0][_0x0bac('0x6a')];});}module[_0x0bac('0x6d')]={'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 27d9f19..904c422 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 _0x6eb2=['bluebird','lodash','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','binary','write','final','close','unlink','decryptFile','createDecipher','end','encryptString','secret','utf8','crypto'];(function(_0x5a2372,_0x412af2){var _0x3f4739=function(_0x1c6f53){while(--_0x1c6f53){_0x5a2372['push'](_0x5a2372['shift']());}};_0x3f4739(++_0x412af2);}(_0x6eb2,0xd8));var _0x26eb=function(_0x532054,_0x32fe3d){_0x532054=_0x532054-0x0;var _0x25446a=_0x6eb2[_0x532054];return _0x25446a;};'use strict';var crypto=require(_0x26eb('0x0'));var fs=require('fs');var BPromise=require(_0x26eb('0x1'));var _=require(_0x26eb('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x26eb('0x3')][_0x26eb('0x4')],'algorithm':_0x26eb('0x5')};const fileOptions={'algorithm':_0x26eb('0x6')};if(config[_0x26eb('0x7')]&&config[_0x26eb('0x7')][_0x26eb('0x8')]){var isSupported=isAlgorithmSupported(config[_0x26eb('0x7')][_0x26eb('0x8')]);if(isSupported){fileOptions[_0x26eb('0x8')]=config[_0x26eb('0x7')][_0x26eb('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x26eb('0x9')](',\x20');logger[_0x26eb('0xa')](config[_0x26eb('0x7')][_0x26eb('0x8')],_0x26eb('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x8733b0){return AES_SUPPORTED_RX['test'](_0x8733b0);}function getSupportedCiphers(){return crypto[_0x26eb('0xc')]()[_0x26eb('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x17dcaa){return getSupportedCiphers()['indexOf'](_0x17dcaa)>-0x1;}function combineOptions(_0x5f4f09){var _0x40835f={};for(var _0x33232b in fileOptions){if(fileOptions[_0x26eb('0xe')](_0x33232b)){_0x40835f[_0x33232b]=fileOptions[_0x33232b];}}if(_0x5f4f09){for(var _0x569955 in _0x5f4f09){if(_0x5f4f09['hasOwnProperty'](_0x569955)){_0x40835f[_0x569955]=_0x5f4f09[_0x569955];}}}return _0x40835f;}exports[_0x26eb('0xf')]=function(_0x1362dc,_0x8dcdcb,_0x565eb1,_0x141d06){return new BPromise(function(_0x383598,_0x498956){_0x141d06=combineOptions(_0x141d06);var _0x499064=new Buffer(_0x565eb1);var _0x4619ea=fs[_0x26eb('0x10')](_0x1362dc);var _0x7e3435=fs['createWriteStream'](_0x8dcdcb);var _0x57a351=crypto[_0x26eb('0x11')](_0x141d06[_0x26eb('0x8')],_0x499064);_0x4619ea['on'](_0x26eb('0x12'),function(_0x5686bb){var _0x1d927c=new Buffer(_0x57a351[_0x26eb('0x13')](_0x5686bb),_0x26eb('0x14'));_0x7e3435[_0x26eb('0x15')](_0x1d927c);});_0x4619ea['on']('end',function(){try{var _0x30c902=new Buffer(_0x57a351[_0x26eb('0x16')]('binary'),_0x26eb('0x14'));_0x7e3435[_0x26eb('0x15')](_0x30c902);_0x7e3435['end']();_0x7e3435['on'](_0x26eb('0x17'),function(){return _0x383598(_0x8dcdcb);});}catch(_0x54ad17){fs[_0x26eb('0x18')](_0x8dcdcb);return _0x498956(_0x54ad17);}});});};exports[_0x26eb('0x19')]=function(_0x5630af,_0x2de3da,_0x122cac,_0x4faa76){return new BPromise(function(_0x506bb2,_0x1a3674){_0x4faa76=combineOptions(_0x4faa76);var _0x24d343=new Buffer(_0x122cac);var _0x560dfb=fs[_0x26eb('0x10')](_0x5630af);var _0x2c7cb5=fs['createWriteStream'](_0x2de3da);var _0x1d3e55=crypto[_0x26eb('0x1a')](_0x4faa76[_0x26eb('0x8')],_0x24d343);_0x560dfb['on'](_0x26eb('0x12'),function(_0x1149e6){var _0x1be3bd=new Buffer(_0x1d3e55[_0x26eb('0x13')](_0x1149e6),_0x26eb('0x14'));_0x2c7cb5['write'](_0x1be3bd);});_0x560dfb['on'](_0x26eb('0x1b'),function(){try{var _0x399752=new Buffer(_0x1d3e55[_0x26eb('0x16')](_0x26eb('0x14')),_0x26eb('0x14'));_0x2c7cb5[_0x26eb('0x15')](_0x399752);_0x2c7cb5[_0x26eb('0x1b')]();_0x2c7cb5['on']('close',function(){return _0x506bb2(_0x2de3da);});}catch(_0x34bb5f){fs[_0x26eb('0x18')](_0x2de3da);return _0x1a3674(_0x34bb5f);}});});};exports[_0x26eb('0x1c')]=function(_0x34110a,_0x20ee87,_0x27879b){var _0x37672a=_0x27879b||stringOptions[_0x26eb('0x8')];var _0x5bdc4f=_0x20ee87||stringOptions[_0x26eb('0x1d')];var _0x46ba7d=crypto[_0x26eb('0x11')](_0x37672a,_0x5bdc4f);var _0x5299ad=_0x46ba7d[_0x26eb('0x13')](_0x34110a,_0x26eb('0x1e'),'base64');_0x5299ad+=_0x46ba7d[_0x26eb('0x16')]('base64');return _0x5299ad;};exports['decryptString']=function(_0x4996fb,_0x57d246,_0x75ad3e){var _0x3df8a1=_0x75ad3e||stringOptions['algorithm'];var _0x22d6ce=_0x57d246||stringOptions[_0x26eb('0x1d')];var _0x4cb347=crypto['createDecipher'](_0x3df8a1,_0x22d6ce);var _0x362020=_0x4cb347[_0x26eb('0x13')](_0x4996fb,'base64',_0x26eb('0x1e'));_0x362020+=_0x4cb347[_0x26eb('0x16')](_0x26eb('0x1e'));return _0x362020;}; \ No newline at end of file +var _0xe07c=['final','end','close','decryptFile','createDecipher','unlink','secret','createCipher','base64','decryptString','utf8','crypto','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','write'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe07c,0xcb));var _0xce07=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe07c[_0x27af45];return _0x18df21;};'use strict';var crypto=require(_0xce07('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xce07('0x1'));var config=require(_0xce07('0x2'));var logger=require('../../config/logger')(_0xce07('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xce07('0x4')]['session'],'algorithm':_0xce07('0x5')};const fileOptions={'algorithm':_0xce07('0x6')};if(config[_0xce07('0x7')]&&config[_0xce07('0x7')][_0xce07('0x8')]){var isSupported=isAlgorithmSupported(config[_0xce07('0x7')][_0xce07('0x8')]);if(isSupported){fileOptions[_0xce07('0x8')]=config['encrypt'][_0xce07('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xce07('0x9')](config[_0xce07('0x7')][_0xce07('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x392bee){return AES_SUPPORTED_RX[_0xce07('0xa')](_0x392bee);}function getSupportedCiphers(){return crypto[_0xce07('0xb')]()[_0xce07('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x48d96f){return getSupportedCiphers()[_0xce07('0xd')](_0x48d96f)>-0x1;}function combineOptions(_0x4af3a6){var _0x4d4eec={};for(var _0x4ab7cb in fileOptions){if(fileOptions[_0xce07('0xe')](_0x4ab7cb)){_0x4d4eec[_0x4ab7cb]=fileOptions[_0x4ab7cb];}}if(_0x4af3a6){for(var _0x392cec in _0x4af3a6){if(_0x4af3a6[_0xce07('0xe')](_0x392cec)){_0x4d4eec[_0x392cec]=_0x4af3a6[_0x392cec];}}}return _0x4d4eec;}exports[_0xce07('0xf')]=function(_0x3d4c59,_0x146b11,_0x5ebccb,_0xa8d272){return new BPromise(function(_0x5a8d03,_0x2ba7a7){_0xa8d272=combineOptions(_0xa8d272);var _0x118d95=new Buffer(_0x5ebccb);var _0x4ba148=fs['createReadStream'](_0x3d4c59);var _0x35e05a=fs[_0xce07('0x10')](_0x146b11);var _0x2f00a7=crypto['createCipher'](_0xa8d272['algorithm'],_0x118d95);_0x4ba148['on'](_0xce07('0x11'),function(_0x2178e9){var _0x21f1fe=new Buffer(_0x2f00a7[_0xce07('0x12')](_0x2178e9),_0xce07('0x13'));_0x35e05a[_0xce07('0x14')](_0x21f1fe);});_0x4ba148['on']('end',function(){try{var _0x597d6b=new Buffer(_0x2f00a7[_0xce07('0x15')](_0xce07('0x13')),'binary');_0x35e05a[_0xce07('0x14')](_0x597d6b);_0x35e05a[_0xce07('0x16')]();_0x35e05a['on'](_0xce07('0x17'),function(){return _0x5a8d03(_0x146b11);});}catch(_0x4e7d14){fs['unlink'](_0x146b11);return _0x2ba7a7(_0x4e7d14);}});});};exports[_0xce07('0x18')]=function(_0x2c6895,_0xd9cdb1,_0xcbe740,_0x412eee){return new BPromise(function(_0x4ffbb9,_0xab4f47){_0x412eee=combineOptions(_0x412eee);var _0x3410e7=new Buffer(_0xcbe740);var _0x138016=fs['createReadStream'](_0x2c6895);var _0x22b0c9=fs[_0xce07('0x10')](_0xd9cdb1);var _0x16b27d=crypto[_0xce07('0x19')](_0x412eee['algorithm'],_0x3410e7);_0x138016['on'](_0xce07('0x11'),function(_0x4a35be){var _0x566490=new Buffer(_0x16b27d['update'](_0x4a35be),_0xce07('0x13'));_0x22b0c9[_0xce07('0x14')](_0x566490);});_0x138016['on']('end',function(){try{var _0x5f023d=new Buffer(_0x16b27d[_0xce07('0x15')](_0xce07('0x13')),'binary');_0x22b0c9[_0xce07('0x14')](_0x5f023d);_0x22b0c9[_0xce07('0x16')]();_0x22b0c9['on'](_0xce07('0x17'),function(){return _0x4ffbb9(_0xd9cdb1);});}catch(_0x3cc963){fs[_0xce07('0x1a')](_0xd9cdb1);return _0xab4f47(_0x3cc963);}});});};exports['encryptString']=function(_0x4fef0e,_0x1bd410,_0x2f3eaf){var _0x19d47f=_0x2f3eaf||stringOptions[_0xce07('0x8')];var _0x278f6b=_0x1bd410||stringOptions[_0xce07('0x1b')];var _0x204693=crypto[_0xce07('0x1c')](_0x19d47f,_0x278f6b);var _0x38a59a=_0x204693[_0xce07('0x12')](_0x4fef0e,'utf8',_0xce07('0x1d'));_0x38a59a+=_0x204693['final'](_0xce07('0x1d'));return _0x38a59a;};exports[_0xce07('0x1e')]=function(_0x4fc816,_0x1e8626,_0x1b7d9e){var _0x3d990b=_0x1b7d9e||stringOptions[_0xce07('0x8')];var _0x3ab96c=_0x1e8626||stringOptions[_0xce07('0x1b')];var _0x5d6984=crypto[_0xce07('0x19')](_0x3d990b,_0x3ab96c);var _0x58a9e0=_0x5d6984[_0xce07('0x12')](_0x4fc816,_0xce07('0x1d'),_0xce07('0x1f'));_0x58a9e0+=_0x5d6984['final'](_0xce07('0x1f'));return _0x58a9e0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 1dc1c8e..8f77df6 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 _0xc5cf=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','split','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport'];(function(_0x33a5b5,_0x4603f2){var _0x27da61=function(_0x42d885){while(--_0x42d885){_0x33a5b5['push'](_0x33a5b5['shift']());}};_0x27da61(++_0x4603f2);}(_0xc5cf,0x1a5));var _0xfc5c=function(_0x273149,_0x3bed81){_0x273149=_0x273149-0x0;var _0x67adde=_0xc5cf[_0x273149];return _0x67adde;};'use strict';var util=require('util');var path=require(_0xfc5c('0x0'));var _=require(_0xfc5c('0x1'));var csv=require(_0xfc5c('0x2'));var fs=require('fs');var BPromise=require(_0xfc5c('0x3'));var zipdir=require(_0xfc5c('0x4'));var rimraf=require('rimraf');var db=require(_0xfc5c('0x5'))['db'];var dbH=require(_0xfc5c('0x5'))[_0xfc5c('0x6')];var logger=require(_0xfc5c('0x7'))(_0xfc5c('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xfc5c('0x9')][0x3];var PATH=process[_0xfc5c('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e24c2,_0x3779f6){var _0x55729e={'status':_0x2e24c2};var _0x2c13e3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3779f6){_0x55729e['savename']=_0x3779f6;}return db[_0xfc5c('0xa')][_0xfc5c('0xb')](_0x55729e,_0x2c13e3);}function main(){var _0x54fa77=0x1388;var _0x331934;logger[_0xfc5c('0xc')](util[_0xfc5c('0xd')](_0xfc5c('0xe'),EXTRACTED_REPORT_ID,_0xfc5c('0xf')));return db['Setting'][_0xfc5c('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfc5c('0x11')]})['then'](function(_0x461ef5){if(_0x461ef5){_0x331934=_0x461ef5;_0x54fa77=_0x331934[_0xfc5c('0x11')]||0x1388;}})[_0xfc5c('0x12')](function(){return dbH['sequelize'][_0xfc5c('0x13')](util[_0xfc5c('0xd')](_0xfc5c('0x14'),QUERY),{'type':dbH[_0xfc5c('0x15')][_0xfc5c('0x16')]['SELECT']});})[_0xfc5c('0x12')](function(_0x173199){if(!_0x173199[0x0][_0xfc5c('0x17')]){return analyticExtractedReport(_0xfc5c('0x18'));}var _0x28fb91=[];var _0x208d37=0x0;if(_0x331934[_0xfc5c('0x19')]){if(_0x173199&&_0x173199[_0xfc5c('0x1a')]){var _0x28c58a=_[_0xfc5c('0x1b')](_0x173199[0x0]['num']/_0x54fa77);var _0x19a057=Number[_0xfc5c('0x1c')](_0x173199[0x0][_0xfc5c('0x17')]/_0x54fa77)?_0x173199[0x0][_0xfc5c('0x17')]%_0x54fa77:0x0;_0x28c58a['forEach'](function(_0x3b92cd){if(_0x3b92cd>0x0){_0x208d37+=_0x54fa77;}_0x28fb91['push'](dbH[_0xfc5c('0x15')][_0xfc5c('0x13')](util[_0xfc5c('0xd')](_0xfc5c('0x1d'),QUERY,_0x54fa77,_0x208d37),{'type':dbH[_0xfc5c('0x15')]['QueryTypes'][_0xfc5c('0x1e')]}));});if(_0x19a057>0x0){_0x208d37+=_0x54fa77;_0x28fb91[_0xfc5c('0x1f')](dbH[_0xfc5c('0x15')]['query'](util[_0xfc5c('0xd')](_0xfc5c('0x1d'),QUERY,_0x19a057,_0x208d37),{'type':dbH[_0xfc5c('0x15')]['QueryTypes'][_0xfc5c('0x1e')]}));}}}else{_0x28fb91[_0xfc5c('0x1f')](dbH['sequelize'][_0xfc5c('0x13')](QUERY,{'type':dbH[_0xfc5c('0x15')][_0xfc5c('0x16')][_0xfc5c('0x1e')]}));}var _0x15b6cd=path[_0xfc5c('0x20')](PATH);var _0x332dc5=path[_0xfc5c('0x21')](PATH,_0xfc5c('0x22'));var _0x4d4a73=_0x331934[_0xfc5c('0x19')]&&_0x28fb91[_0xfc5c('0x1a')]>0x1;var _0x1b909b=[];if(!fs[_0xfc5c('0x23')](path[_0xfc5c('0x24')](_0x15b6cd,_0x332dc5))&&_0x4d4a73){fs[_0xfc5c('0x25')](path[_0xfc5c('0x24')](_0x15b6cd,_0x332dc5));}return BPromise[_0xfc5c('0x26')](_0x28fb91,function(_0xe2ec9b){_0x1b909b['push'](_0xe2ec9b);})[_0xfc5c('0x12')](function(){for(var _0x2ad0f6=0x0;_0x2ad0f6<_0x1b909b['length'];_0x2ad0f6+=0x1){var _0x48114e;var _0x6721e3=_0x1b909b[_0x2ad0f6];if(_0x4d4a73){_0x48114e=path[_0xfc5c('0x24')](_0x15b6cd,_0x332dc5,util[_0xfc5c('0xd')](_0xfc5c('0x27'),_0x332dc5,_0x2ad0f6,_0xfc5c('0x28')));}else{_0x48114e=path[_0xfc5c('0x24')](_0x15b6cd,util[_0xfc5c('0xd')](_0xfc5c('0x29'),_0x332dc5,_0xfc5c('0x28')));}fs['writeFileSync'](_0x48114e,csv(_0x6721e3));}})[_0xfc5c('0x12')](function(){if(_0x4d4a73){return new Promise(function(_0x5d4448){zipdir(path[_0xfc5c('0x24')](_0x15b6cd,_0x332dc5),{'saveTo':path[_0xfc5c('0x24')](_0x15b6cd,util[_0xfc5c('0xd')]('%s.%s',_0x332dc5,_0xfc5c('0x2a')))},function(_0x5936ad,_0x31e94a){rimraf(path[_0xfc5c('0x24')](_0x15b6cd,_0x332dc5),function(){});_0x5d4448('zip\x20finished');});});}})[_0xfc5c('0x12')](function(){logger[_0xfc5c('0xc')](util[_0xfc5c('0xd')](_0xfc5c('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x4d4a73?util[_0xfc5c('0xd')]('%s.%s',_0x332dc5,_0x4d4a73?'zip':_0xfc5c('0x28')):null);});})['catch'](function(_0x22220e){logger[_0xfc5c('0xc')](util[_0xfc5c('0xd')](_0xfc5c('0x2c'),EXTRACTED_REPORT_ID,_0xfc5c('0xf')),util[_0xfc5c('0x2d')](_0x22220e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfc5c('0x2e'));})[_0xfc5c('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5281=['QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x586890,_0x57399f){var _0x3bbc16=function(_0x5362fd){while(--_0x5362fd){_0x586890['push'](_0x586890['shift']());}};_0x3bbc16(++_0x57399f);}(_0x5281,0xb7));var _0x1528=function(_0x76401d,_0x170972){_0x76401d=_0x76401d-0x0;var _0x5cd76b=_0x5281[_0x76401d];return _0x5cd76b;};'use strict';var util=require(_0x1528('0x0'));var path=require(_0x1528('0x1'));var _=require('lodash');var csv=require(_0x1528('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x1528('0x3'));var rimraf=require(_0x1528('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1528('0x5'))[_0x1528('0x6')];var logger=require(_0x1528('0x7'))(_0x1528('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1528('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x571c94,_0x3cc618){var _0x1da6bf={'status':_0x571c94};var _0x4ba89c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3cc618){_0x1da6bf[_0x1528('0xa')]=_0x3cc618;}return db[_0x1528('0xb')][_0x1528('0xc')](_0x1da6bf,_0x4ba89c);}function main(){var _0x1e1378=0x1388;var _0x13d15c;logger['info'](util[_0x1528('0xd')](_0x1528('0xe'),EXTRACTED_REPORT_ID,_0x1528('0xf')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1528('0x10'),_0x1528('0x11')]})[_0x1528('0x12')](function(_0x56f9b4){if(_0x56f9b4){_0x13d15c=_0x56f9b4;_0x1e1378=_0x13d15c[_0x1528('0x11')]||0x1388;}})['then'](function(){return dbH[_0x1528('0x13')]['query'](util[_0x1528('0xd')](_0x1528('0x14'),QUERY),{'type':dbH[_0x1528('0x13')][_0x1528('0x15')][_0x1528('0x16')]});})[_0x1528('0x12')](function(_0x4e0419){if(!_0x4e0419[0x0][_0x1528('0x17')]){return analyticExtractedReport(_0x1528('0x18'));}var _0x3b3a73=[];var _0x48e2ca=0x0;if(_0x13d15c['split']){if(_0x4e0419&&_0x4e0419['length']){var _0x3c9805=_[_0x1528('0x19')](_0x4e0419[0x0][_0x1528('0x17')]/_0x1e1378);var _0x240ce3=Number[_0x1528('0x1a')](_0x4e0419[0x0][_0x1528('0x17')]/_0x1e1378)?_0x4e0419[0x0][_0x1528('0x17')]%_0x1e1378:0x0;_0x3c9805[_0x1528('0x1b')](function(_0x18febd){if(_0x18febd>0x0){_0x48e2ca+=_0x1e1378;}_0x3b3a73[_0x1528('0x1c')](dbH['sequelize']['query'](util[_0x1528('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e1378,_0x48e2ca),{'type':dbH[_0x1528('0x13')]['QueryTypes'][_0x1528('0x16')]}));});if(_0x240ce3>0x0){_0x48e2ca+=_0x1e1378;_0x3b3a73[_0x1528('0x1c')](dbH[_0x1528('0x13')][_0x1528('0x1d')](util[_0x1528('0xd')](_0x1528('0x1e'),QUERY,_0x240ce3,_0x48e2ca),{'type':dbH['sequelize']['QueryTypes'][_0x1528('0x16')]}));}}}else{_0x3b3a73[_0x1528('0x1c')](dbH['sequelize'][_0x1528('0x1d')](QUERY,{'type':dbH[_0x1528('0x13')][_0x1528('0x15')]['SELECT']}));}var _0x5e34ec=path[_0x1528('0x1f')](PATH);var _0x34784a=path[_0x1528('0x20')](PATH,_0x1528('0x21'));var _0x446112=_0x13d15c[_0x1528('0x10')]&&_0x3b3a73[_0x1528('0x22')]>0x1;var _0x488728=[];if(!fs[_0x1528('0x23')](path[_0x1528('0x24')](_0x5e34ec,_0x34784a))&&_0x446112){fs[_0x1528('0x25')](path[_0x1528('0x24')](_0x5e34ec,_0x34784a));}return BPromise['each'](_0x3b3a73,function(_0x35ade6){_0x488728[_0x1528('0x1c')](_0x35ade6);})[_0x1528('0x12')](function(){for(var _0x41309e=0x0;_0x41309e<_0x488728[_0x1528('0x22')];_0x41309e+=0x1){var _0x50c38f;var _0x2bd031=_0x488728[_0x41309e];if(_0x446112){_0x50c38f=path['join'](_0x5e34ec,_0x34784a,util[_0x1528('0xd')](_0x1528('0x26'),_0x34784a,_0x41309e,'csv'));}else{_0x50c38f=path[_0x1528('0x24')](_0x5e34ec,util[_0x1528('0xd')](_0x1528('0x27'),_0x34784a,_0x1528('0x28')));}fs[_0x1528('0x29')](_0x50c38f,csv(_0x2bd031));}})[_0x1528('0x12')](function(){if(_0x446112){return new Promise(function(_0x4eefee){zipdir(path[_0x1528('0x24')](_0x5e34ec,_0x34784a),{'saveTo':path[_0x1528('0x24')](_0x5e34ec,util['format'](_0x1528('0x27'),_0x34784a,_0x1528('0x2a')))},function(_0x117d45,_0x6a90cc){rimraf(path['join'](_0x5e34ec,_0x34784a),function(){});_0x4eefee(_0x1528('0x2b'));});});}})['then'](function(){logger[_0x1528('0x2c')](util['format'](_0x1528('0x2d'),EXTRACTED_REPORT_ID,_0x1528('0xf')));return analyticExtractedReport(_0x1528('0x2e'),_0x446112?util[_0x1528('0xd')](_0x1528('0x27'),_0x34784a,_0x446112?'zip':_0x1528('0x28')):null);});})['catch'](function(_0x3fecb5){logger[_0x1528('0x2c')](util[_0x1528('0xd')](_0x1528('0x2f'),EXTRACTED_REPORT_ID,_0x1528('0xf')),util[_0x1528('0x30')](_0x3fecb5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1528('0x31'));})['finally'](function(){process[_0x1528('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 18a59e4..897ee0f 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 _0x026d=['../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','header','before','landscape','toString','\x20/\x20','Arial','black','right','num','Empty','find','split','splitSizePdf','then','isInteger','query','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','flatten','%s%d.%s','pdf','all','info','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','finish','end','createPdfKitDocument','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','JSDOM','window'];(function(_0x5d6b45,_0x55a2b1){var _0xa53537=function(_0x46cd9f){while(--_0x46cd9f){_0x5d6b45['push'](_0x5d6b45['shift']());}};_0xa53537(++_0x55a2b1);}(_0x026d,0x1dd));var _0xd026=function(_0x4b78b1,_0x3b1925){_0x4b78b1=_0x4b78b1-0x0;var _0x28de4c=_0x026d[_0x4b78b1];return _0x28de4c;};'use strict';var _=require(_0xd026('0x0'));var fs=require('fs');var util=require(_0xd026('0x1'));var path=require(_0xd026('0x2'));var moment=require(_0xd026('0x3'));var htmlToPdfmake=require(_0xd026('0x4'));var PdfPrinter=require(_0xd026('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0xd026('0x6'));var JSDOM=require('jsdom')[_0xd026('0x7')];var window=new JSDOM('')[_0xd026('0x8')];var BPromise=require('bluebird');var db=require(_0xd026('0x9'))['db'];var dbH=require('../../mysqldb')[_0xd026('0xa')];var logger=require('../../config/logger')(_0xd026('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xd026('0xc')][0x2]);var QUERY=process[_0xd026('0xc')][0x3];var PATH=process[_0xd026('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd026('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2722d8,_0x86fc50){var _0x44aa25={'status':_0x2722d8};var _0xcbc097={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x86fc50){_0x44aa25[_0xd026('0xe')]=_0x86fc50;}return db[_0xd026('0xf')]['update'](_0x44aa25,_0xcbc097);}function getHeaders(_0x1aafdf){return _[_0xd026('0x10')](_0x1aafdf,function(_0x1e320d){return{'text':_0x1e320d,'style':_0xd026('0x11')};});}function getRows(_0x48cc36,_0x276664){return _['map'](_0x276664,function(_0x5ec7a1){return _(_0x5ec7a1)[_0xd026('0x12')](_0x48cc36)[_0xd026('0x10')](function(_0x2071ae){return _0x2071ae?_['toString'](_0x2071ae):'';})[_0xd026('0x13')]();});}function createTable(_0x20aced,_0x52ccdc){var _0x1fa0e5={'widths':_[_0xd026('0x14')](Array(_0x20aced[_0xd026('0x15')]),0x91),'heights':function(_0x3981c2){return _0x3981c2===0x0?_0xd026('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x363e5b=getHeaders(_0x20aced);_0x1fa0e5[_0xd026('0x17')][_0xd026('0x18')](_0x363e5b);var _0x517e09=getRows(_0x20aced,_0x52ccdc);_0x1fa0e5[_0xd026('0x17')]=_0x1fa0e5[_0xd026('0x17')][_0xd026('0x19')](_0x517e09);return _0x1fa0e5;}function createTables(_0x11801c){var _0x1103a9=[];var _0x30e32f=_[_0xd026('0x1a')](Object[_0xd026('0x1b')](_0x11801c[0x0]),0x5);_0x30e32f[_0xd026('0x1c')](function(_0x58885c){_0x1103a9[_0xd026('0x18')](createTable(_0x58885c,_0x11801c));});return _0x1103a9;}function getPDFDocDefinition(_0x224a6f){var _0xbe1aa7=util[_0xd026('0x1d')](_0xd026('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xd026('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x5c72d3=[];for(var _0x39ac1d=0x0;_0x39ac1d<_0x224a6f[_0xd026('0x15')];_0x39ac1d++){var _0x67177d=[];if(_0x39ac1d===0x0){_0x67177d[_0xd026('0x18')]({'text':_0xbe1aa7,'style':_0xd026('0x1f')});}var _0x212fb5={'table':_0x224a6f[_0x39ac1d]};if(_0x39ac1d>0x0){_0x212fb5['pageBreak']=_0xd026('0x20');_0x212fb5['margin']=[0x0,0x46,0x0,0x0];}_0x67177d[_0xd026('0x18')](_0x212fb5);_0x5c72d3[_0xd026('0x18')](_0x67177d);}return{'pageSize':'A4','pageOrientation':_0xd026('0x21'),'content':_0x5c72d3,'footer':function(_0x4ac6eb,_0x138ad2){return{'text':_0x4ac6eb[_0xd026('0x22')]()+_0xd026('0x23')+_0x138ad2,'style':'footer'};},'defaultStyle':{'font':_0xd026('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd026('0x25')},'footer':{'alignment':_0xd026('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3de7bd){var _0x9c2b32=0x1388;var _0x9653ac;if(!_0x3de7bd[0x0][_0xd026('0x27')]){return analyticExtractedReport(_0xd026('0x28'));}return db['Setting'][_0xd026('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd026('0x2a'),_0xd026('0x2b')]})[_0xd026('0x2c')](function(_0x2c32a7){if(_0x2c32a7){_0x9653ac=_0x2c32a7;_0x9c2b32=_0x9653ac[_0xd026('0x2b')]||0x3e8;}})['then'](function(){var _0xcfae1=[];var _0x568fcb=0x0;if(_0x9653ac[_0xd026('0x2a')]){if(_0x3de7bd&&_0x3de7bd[_0xd026('0x15')]){var _0x39c9f9=_['range'](_0x3de7bd[0x0][_0xd026('0x27')]/_0x9c2b32);var _0x48c23e=Number[_0xd026('0x2d')](_0x3de7bd[0x0][_0xd026('0x27')]/_0x9c2b32)?_0x3de7bd[0x0][_0xd026('0x27')]%_0x9c2b32:0x0;_0x39c9f9['forEach'](function(_0x1804fd){if(_0x1804fd>0x0){_0x568fcb+=_0x9c2b32;}_0xcfae1[_0xd026('0x18')](dbH['sequelize'][_0xd026('0x2e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x9c2b32,_0x568fcb),{'type':dbH[_0xd026('0x2f')]['QueryTypes'][_0xd026('0x30')]}));});if(_0x48c23e>0x0){_0x568fcb+=_0x9c2b32;_0xcfae1[_0xd026('0x18')](dbH['sequelize']['query'](util[_0xd026('0x1d')](_0xd026('0x31'),QUERY,_0x48c23e,_0x568fcb),{'type':dbH['sequelize'][_0xd026('0x32')]['SELECT']}));}}}else{_0xcfae1[_0xd026('0x18')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xd026('0x2f')][_0xd026('0x32')]['SELECT']}));}var _0x4cd7cd=path[_0xd026('0x33')](PATH);var _0x30ddab=path[_0xd026('0x34')](PATH,'.pdf');var _0x3fcec8=_0x9653ac[_0xd026('0x2a')]&&_0xcfae1[_0xd026('0x15')]>0x1;var _0x4a4872=[];if(!fs[_0xd026('0x35')](path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab))&&_0x3fcec8){fs['mkdirSync'](path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab));}return BPromise['each'](_0xcfae1,function(_0x44f8ea){_0x4a4872[_0xd026('0x18')](_0x44f8ea);})[_0xd026('0x2c')](function(){var _0x5a54cd=[];for(var _0x51a91d=0x0;_0x51a91d<_0x4a4872['length'];_0x51a91d+=0x1){var _0x5a7960=_0x4a4872[_0x51a91d];var _0x1d04de=createTables(_[_0xd026('0x37')](_0x5a7960));var _0x1f63f9;var _0x288ff7=getPDFDocDefinition(_0x1d04de);var _0x24104a=getPDFPrinter();var _0x3286dc=_0x24104a['createPdfKitDocument'](_0x288ff7);if(_0x3fcec8){_0x1f63f9=path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab,util[_0xd026('0x1d')](_0xd026('0x38'),_0x30ddab,_0x51a91d,_0xd026('0x39')));}else{_0x1f63f9=path[_0xd026('0x36')](_0x4cd7cd,util['format']('%s.%s',_0x30ddab,_0xd026('0x39')));}_0x5a54cd[_0xd026('0x18')](writePDFDocument(_0x3286dc,_0x1f63f9));}return Promise[_0xd026('0x3a')](_0x5a54cd);})[_0xd026('0x2c')](function(){if(_0x3fcec8){return new Promise(function(_0x767acc){zipdir(path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab),{'saveTo':path[_0xd026('0x36')](_0x4cd7cd,util['format']('%s.%s',_0x30ddab,'zip'))},function(){rimraf(path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab),function(){});_0x767acc('zip\x20finished');});});}})[_0xd026('0x2c')](function(){if(!_0x3fcec8)return;rimraf(path[_0xd026('0x36')](_0x4cd7cd,_0x30ddab),function(){});})['then'](function(){logger[_0xd026('0x3b')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd026('0x3c')));return analyticExtractedReport('Completed',_0x3fcec8?util[_0xd026('0x1d')]('%s.%s',_0x30ddab,_0x3fcec8?'zip':_0xd026('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd026('0x3b')](util[_0xd026('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xd026('0xf')][_0xd026('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd026('0x2c')](function(_0x461e86){EXTRACTED_REPORT=_0x461e86;return dbH[_0xd026('0x2f')][_0xd026('0x2e')](util[_0xd026('0x1d')](_0xd026('0x3e'),QUERY),{'type':dbH[_0xd026('0x2f')]['QueryTypes'][_0xd026('0x30')]});})['then'](extractReport)['catch'](function(_0x232401){logger[_0xd026('0x3b')](util['format'](_0xd026('0x3f'),EXTRACTED_REPORT_ID,_0xd026('0x3c')),util['inspect'](_0x232401,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd026('0x40'));})[_0xd026('0x41')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x978f6c=new PdfPrinter({'Arial':{'normal':__dirname+_0xd026('0x42'),'bold':__dirname+_0xd026('0x43'),'italics':__dirname+_0xd026('0x44'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x978f6c;}function getPDFDocDefinitionFromHTML(_0x5d2507,_0x3ccbdb){var _0x2622b7=util[_0xd026('0x1d')](_0xd026('0x45'),_0x3ccbdb[_0xd026('0x46')],_0x3ccbdb[_0xd026('0x47')]);var _0x481810=moment()[_0xd026('0x1d')](_0xd026('0x48'))[_0xd026('0x22')]();var _0x41fe79=htmlToPdfmake(_0x5d2507,{'window':window,'tableAutoSize':!![]});return{'content':[_0x41fe79],'defaultStyle':{'font':_0xd026('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd026('0x49'),'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':_0xd026('0x49')}},'header':function(){return[{'text':_0xd026('0x4a'),'style':_0xd026('0x1f')}];},'footer':function(_0x196ac2,_0x4b06b5){return[{'text':util[_0xd026('0x1d')](_0xd026('0x4b'),_0x2622b7,_0x196ac2,_0x4b06b5,_0x481810),'style':_0xd026('0x4c')}];}};}function writePDFDocument(_0xbff649,_0x23be35){return new Promise(function(_0x546bef,_0x236aa2){var _0x1a58f9=_0xbff649['pipe'](fs['createWriteStream'](_0x23be35));_0x1a58f9['on'](_0xd026('0x4d'),function(){_0x546bef(_0xd026('0x4d'));});_0x1a58f9['on']('error',function(_0x3c8806){_0x236aa2(_0x3c8806);});_0xbff649[_0xd026('0x4e')]();});}exports['createPdfFromHTML']=function(_0x30ae1e,_0x210f8f){var _0x5cb1d9=getPDFPrinter();var _0x4b8eb9=getPDFDocDefinitionFromHTML(_0x30ae1e,_0x210f8f);var _0x581872=_0x5cb1d9[_0xd026('0x4f')](_0x4b8eb9);return writePDFDocument(_0x581872,_0x210f8f[_0xd026('0x2')])[_0xd026('0x50')](function(_0x148f6c){throw _0x148f6c;});}; \ No newline at end of file +var _0xd43a=['pick','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','before','margin','landscape','toString','\x20/\x20','footer','Arial','num','Empty','Setting','find','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','moment','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xd43a,0xa4));var _0xad43=function(_0x3600f7,_0x4d0042){_0x3600f7=_0x3600f7-0x0;var _0x2afdba=_0xd43a[_0x3600f7];return _0x2afdba;};'use strict';var _=require(_0xad43('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xad43('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0xad43('0x2'))[_0xad43('0x3')];var window=new JSDOM('')[_0xad43('0x4')];var BPromise=require(_0xad43('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xad43('0x6'))['dbH'];var logger=require(_0xad43('0x7'))(_0xad43('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xad43('0x9')][0x2]);var QUERY=process[_0xad43('0x9')][0x3];var PATH=process[_0xad43('0x9')][0x4];var NAME=process[_0xad43('0x9')][0x5];var FORMAT=_0xad43('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x45aef4,_0x142572){var _0x3d94f0={'status':_0x45aef4};var _0x2feba8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x142572){_0x3d94f0[_0xad43('0xb')]=_0x142572;}return db[_0xad43('0xc')][_0xad43('0xd')](_0x3d94f0,_0x2feba8);}function getHeaders(_0x308c6e){return _[_0xad43('0xe')](_0x308c6e,function(_0x5280ff){return{'text':_0x5280ff,'style':_0xad43('0xf')};});}function getRows(_0x48b39f,_0x215a7a){return _[_0xad43('0xe')](_0x215a7a,function(_0x2c3285){return _(_0x2c3285)[_0xad43('0x10')](_0x48b39f)['map'](function(_0x4c71e6){return _0x4c71e6?_['toString'](_0x4c71e6):'';})[_0xad43('0x11')]();});}function createTable(_0x192849,_0x35abdf){var _0x28d45a={'widths':_[_0xad43('0x12')](Array(_0x192849[_0xad43('0x13')]),0x91),'heights':function(_0xe57e61){return _0xe57e61===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2aa079=getHeaders(_0x192849);_0x28d45a[_0xad43('0x14')][_0xad43('0x15')](_0x2aa079);var _0x1d0e32=getRows(_0x192849,_0x35abdf);_0x28d45a[_0xad43('0x14')]=_0x28d45a[_0xad43('0x14')][_0xad43('0x16')](_0x1d0e32);return _0x28d45a;}function createTables(_0x4aba8a){var _0x3ec17c=[];var _0x42f1c8=_[_0xad43('0x17')](Object[_0xad43('0x18')](_0x4aba8a[0x0]),0x5);_0x42f1c8[_0xad43('0x19')](function(_0x121e5c){_0x3ec17c[_0xad43('0x15')](createTable(_0x121e5c,_0x4aba8a));});return _0x3ec17c;}function getPDFDocDefinition(_0x31ef73){var _0x4de4e0=util[_0xad43('0x1a')](_0xad43('0x1b'),NAME,EXTRACTED_REPORT[_0xad43('0x1c')],moment(EXTRACTED_REPORT[_0xad43('0x1d')])[_0xad43('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xad43('0x1a')](FORMAT));var _0x28b9e0=[];for(var _0x52da6d=0x0;_0x52da6d<_0x31ef73[_0xad43('0x13')];_0x52da6d++){var _0x85b655=[];if(_0x52da6d===0x0){_0x85b655[_0xad43('0x15')]({'text':_0x4de4e0,'style':'header'});}var _0x167f80={'table':_0x31ef73[_0x52da6d]};if(_0x52da6d>0x0){_0x167f80['pageBreak']=_0xad43('0x1e');_0x167f80[_0xad43('0x1f')]=[0x0,0x46,0x0,0x0];}_0x85b655[_0xad43('0x15')](_0x167f80);_0x28b9e0[_0xad43('0x15')](_0x85b655);}return{'pageSize':'A4','pageOrientation':_0xad43('0x20'),'content':_0x28b9e0,'footer':function(_0x4ae4fb,_0x2450e7){return{'text':_0x4ae4fb[_0xad43('0x21')]()+_0xad43('0x22')+_0x2450e7,'style':_0xad43('0x23')};},'defaultStyle':{'font':_0xad43('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43601f){var _0x3c1a9b=0x1388;var _0x572b6d;if(!_0x43601f[0x0][_0xad43('0x25')]){return analyticExtractedReport(_0xad43('0x26'));}return db[_0xad43('0x27')][_0xad43('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xad43('0x29')]})[_0xad43('0x2a')](function(_0x264e0e){if(_0x264e0e){_0x572b6d=_0x264e0e;_0x3c1a9b=_0x572b6d[_0xad43('0x29')]||0x3e8;}})[_0xad43('0x2a')](function(){var _0x43b633=[];var _0x1e01a4=0x0;if(_0x572b6d['split']){if(_0x43601f&&_0x43601f['length']){var _0x46610d=_[_0xad43('0x2b')](_0x43601f[0x0][_0xad43('0x25')]/_0x3c1a9b);var _0xb23253=Number['isInteger'](_0x43601f[0x0][_0xad43('0x25')]/_0x3c1a9b)?_0x43601f[0x0]['num']%_0x3c1a9b:0x0;_0x46610d[_0xad43('0x19')](function(_0x171e83){if(_0x171e83>0x0){_0x1e01a4+=_0x3c1a9b;}_0x43b633[_0xad43('0x15')](dbH[_0xad43('0x2c')][_0xad43('0x2d')](util[_0xad43('0x1a')](_0xad43('0x2e'),QUERY,_0x3c1a9b,_0x1e01a4),{'type':dbH['sequelize'][_0xad43('0x2f')]['SELECT']}));});if(_0xb23253>0x0){_0x1e01a4+=_0x3c1a9b;_0x43b633[_0xad43('0x15')](dbH[_0xad43('0x2c')][_0xad43('0x2d')](util[_0xad43('0x1a')](_0xad43('0x2e'),QUERY,_0xb23253,_0x1e01a4),{'type':dbH['sequelize'][_0xad43('0x2f')][_0xad43('0x30')]}));}}}else{_0x43b633['push'](dbH[_0xad43('0x2c')][_0xad43('0x2d')](QUERY,{'type':dbH[_0xad43('0x2c')]['QueryTypes']['SELECT']}));}var _0x5bae82=path[_0xad43('0x31')](PATH);var _0x211ee8=path[_0xad43('0x32')](PATH,'.pdf');var _0x41e988=_0x572b6d['split']&&_0x43b633[_0xad43('0x13')]>0x1;var _0x5bff42=[];if(!fs[_0xad43('0x33')](path[_0xad43('0x34')](_0x5bae82,_0x211ee8))&&_0x41e988){fs[_0xad43('0x35')](path[_0xad43('0x34')](_0x5bae82,_0x211ee8));}return BPromise[_0xad43('0x36')](_0x43b633,function(_0x26ed51){_0x5bff42['push'](_0x26ed51);})['then'](function(){var _0x2c07f9=[];for(var _0x17be10=0x0;_0x17be10<_0x5bff42[_0xad43('0x13')];_0x17be10+=0x1){var _0x37ad4f=_0x5bff42[_0x17be10];var _0x3aca26=createTables(_[_0xad43('0x37')](_0x37ad4f));var _0x3fe634;var _0x146ebe=getPDFDocDefinition(_0x3aca26);var _0x5b5b68=getPDFPrinter();var _0x3e57e1=_0x5b5b68[_0xad43('0x38')](_0x146ebe);if(_0x41e988){_0x3fe634=path[_0xad43('0x34')](_0x5bae82,_0x211ee8,util[_0xad43('0x1a')]('%s%d.%s',_0x211ee8,_0x17be10,_0xad43('0x39')));}else{_0x3fe634=path[_0xad43('0x34')](_0x5bae82,util[_0xad43('0x1a')](_0xad43('0x3a'),_0x211ee8,_0xad43('0x39')));}_0x2c07f9[_0xad43('0x15')](writePDFDocument(_0x3e57e1,_0x3fe634));}return Promise[_0xad43('0x3b')](_0x2c07f9);})[_0xad43('0x2a')](function(){if(_0x41e988){return new Promise(function(_0x596385){zipdir(path[_0xad43('0x34')](_0x5bae82,_0x211ee8),{'saveTo':path[_0xad43('0x34')](_0x5bae82,util[_0xad43('0x1a')](_0xad43('0x3a'),_0x211ee8,_0xad43('0x3c')))},function(){rimraf(path[_0xad43('0x34')](_0x5bae82,_0x211ee8),function(){});_0x596385(_0xad43('0x3d'));});});}})[_0xad43('0x2a')](function(){if(!_0x41e988)return;rimraf(path['join'](_0x5bae82,_0x211ee8),function(){});})[_0xad43('0x2a')](function(){logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x3f'),EXTRACTED_REPORT_ID,_0xad43('0x40')));return analyticExtractedReport(_0xad43('0x41'),_0x41e988?util['format'](_0xad43('0x3a'),_0x211ee8,_0x41e988?_0xad43('0x3c'):_0xad43('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x42'),EXTRACTED_REPORT_ID,_0xad43('0x40')));return db['AnalyticExtractedReport'][_0xad43('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x447c7b){EXTRACTED_REPORT=_0x447c7b;return dbH['sequelize']['query'](util[_0xad43('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xad43('0x2c')][_0xad43('0x2f')][_0xad43('0x30')]});})[_0xad43('0x2a')](extractReport)[_0xad43('0x44')](function(_0x420125){logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0xad43('0x46')](_0x420125,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xad43('0x47'));})['finally'](function(){process[_0xad43('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x257bb4=new PdfPrinter({'Arial':{'normal':__dirname+_0xad43('0x49'),'bold':__dirname+_0xad43('0x4a'),'italics':__dirname+_0xad43('0x4b'),'bolditalics':__dirname+_0xad43('0x4c')}});return _0x257bb4;}function getPDFDocDefinitionFromHTML(_0x666eda,_0x2418fa){var _0x4209dd=util[_0xad43('0x1a')](_0xad43('0x4d'),_0x2418fa['channel'],_0x2418fa[_0xad43('0x4e')]);var _0x41814e=moment()[_0xad43('0x1a')](_0xad43('0x4f'))['toString']();var _0x3b0349=htmlToPdfmake(_0x666eda,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b0349],'defaultStyle':{'font':_0xad43('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xad43('0x50'),'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':_0xad43('0x50')}},'header':function(){return[{'text':_0xad43('0x51'),'style':_0xad43('0x52')}];},'footer':function(_0x14dd63,_0x461638){return[{'text':util[_0xad43('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x4209dd,_0x14dd63,_0x461638,_0x41814e),'style':_0xad43('0x23')}];}};}function writePDFDocument(_0x23b88b,_0x56c9f8){return new Promise(function(_0x193ea6,_0x3e99c3){var _0x472a64=_0x23b88b[_0xad43('0x53')](fs[_0xad43('0x54')](_0x56c9f8));_0x472a64['on']('finish',function(){_0x193ea6(_0xad43('0x55'));});_0x472a64['on'](_0xad43('0x56'),function(_0xdbeb3){_0x3e99c3(_0xdbeb3);});_0x23b88b[_0xad43('0x57')]();});}exports[_0xad43('0x58')]=function(_0x220be4,_0x5d0be2){var _0x707f73=getPDFPrinter();var _0x1ce6c3=getPDFDocDefinitionFromHTML(_0x220be4,_0x5d0be2);var _0x453f3a=_0x707f73[_0xad43('0x38')](_0x1ce6c3);return writePDFDocument(_0x453f3a,_0x5d0be2[_0xad43('0x59')])[_0xad43('0x44')](function(_0x37566c){throw _0x37566c;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index dc05a26..0e24a89 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 _0x8580=['dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','range','forEach','push','query','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','json2xls','rimraf','../../mysqldb'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0x8580,0x1c7));var _0x0858=function(_0xbec04b,_0x1dba24){_0xbec04b=_0xbec04b-0x0;var _0x492f55=_0x8580[_0xbec04b];return _0x492f55;};'use strict';var util=require('util');var path=require(_0x0858('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x0858('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x0858('0x2'));var db=require(_0x0858('0x3'))['db'];var dbH=require('../../mysqldb')[_0x0858('0x4')];var logger=require(_0x0858('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0858('0x6')][0x2]);var QUERY=process[_0x0858('0x6')][0x3];var PATH=process[_0x0858('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38e3f7,_0x4981a7){var _0x9c611c={'status':_0x38e3f7};var _0x3ae92b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4981a7){_0x9c611c[_0x0858('0x7')]=_0x4981a7;}return db['AnalyticExtractedReport']['update'](_0x9c611c,_0x3ae92b);}function main(){var _0x470459=0x1388;var _0x4b5072;logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0xa'),EXTRACTED_REPORT_ID,_0x0858('0xb')));return db[_0x0858('0xc')][_0x0858('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0858('0xe'),_0x0858('0xf')]})['then'](function(_0x49eb34){if(_0x49eb34){_0x4b5072=_0x49eb34;_0x470459=_0x4b5072[_0x0858('0xf')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x0858('0x9')](_0x0858('0x10'),QUERY),{'type':dbH['sequelize'][_0x0858('0x11')][_0x0858('0x12')]});})[_0x0858('0x13')](function(_0x44e3ac){if(!_0x44e3ac[0x0][_0x0858('0x14')]){return analyticExtractedReport(_0x0858('0x15'));}var _0xca6a95=[];var _0x2ed26b=0x0;if(_0x4b5072[_0x0858('0xe')]){if(_0x44e3ac&&_0x44e3ac[_0x0858('0x16')]){var _0x163a6e=_[_0x0858('0x17')](_0x44e3ac[0x0]['num']/_0x470459);var _0x2b73c2=Number['isInteger'](_0x44e3ac[0x0][_0x0858('0x14')]/_0x470459)?_0x44e3ac[0x0][_0x0858('0x14')]%_0x470459:0x0;_0x163a6e[_0x0858('0x18')](function(_0x725295){if(_0x725295>0x0){_0x2ed26b+=_0x470459;}_0xca6a95[_0x0858('0x19')](dbH['sequelize'][_0x0858('0x1a')](util[_0x0858('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x470459,_0x2ed26b),{'type':dbH[_0x0858('0x1b')]['QueryTypes']['SELECT']}));});if(_0x2b73c2>0x0){_0x2ed26b+=_0x470459;_0xca6a95[_0x0858('0x19')](dbH[_0x0858('0x1b')][_0x0858('0x1a')](util[_0x0858('0x9')](_0x0858('0x1c'),QUERY,_0x2b73c2,_0x2ed26b),{'type':dbH['sequelize'][_0x0858('0x11')]['SELECT']}));}}}else{_0xca6a95[_0x0858('0x19')](dbH['sequelize'][_0x0858('0x1a')](QUERY,{'type':dbH[_0x0858('0x1b')][_0x0858('0x11')][_0x0858('0x12')]}));}var _0x4fe016=path[_0x0858('0x1d')](PATH);var _0x34dca9=path[_0x0858('0x1e')](PATH,_0x0858('0x1f'));var _0x14f05c=_0x4b5072[_0x0858('0xe')]&&_0xca6a95[_0x0858('0x16')]>0x1;var _0x83f104=[];if(!fs[_0x0858('0x20')](path[_0x0858('0x21')](_0x4fe016,_0x34dca9))&&_0x14f05c){fs[_0x0858('0x22')](path[_0x0858('0x21')](_0x4fe016,_0x34dca9));}return BPromise[_0x0858('0x23')](_0xca6a95,function(_0x73fb56){_0x83f104[_0x0858('0x19')](_0x73fb56);})[_0x0858('0x13')](function(){for(var _0x2607c1=0x0;_0x2607c1<_0x83f104[_0x0858('0x16')];_0x2607c1+=0x1){var _0x5630be;var _0x102cfc=_0x83f104[_0x2607c1];if(_0x14f05c){_0x5630be=path[_0x0858('0x21')](_0x4fe016,_0x34dca9,util[_0x0858('0x9')](_0x0858('0x24'),_0x34dca9,_0x2607c1,_0x0858('0x25')));}else{_0x5630be=path[_0x0858('0x21')](_0x4fe016,util[_0x0858('0x9')](_0x0858('0x26'),_0x34dca9,'xlsx'));}fs[_0x0858('0x27')](_0x5630be,json2xls(_0x102cfc),_0x0858('0x28'));}})[_0x0858('0x13')](function(){if(_0x14f05c){return new Promise(function(_0x2ab544){zipdir(path['join'](_0x4fe016,_0x34dca9),{'saveTo':path[_0x0858('0x21')](_0x4fe016,util[_0x0858('0x9')]('%s.%s',_0x34dca9,_0x0858('0x29')))},function(_0x1cdf5b,_0x49f259){rimraf(path[_0x0858('0x21')](_0x4fe016,_0x34dca9),function(){});_0x2ab544(_0x0858('0x2a'));});});}})[_0x0858('0x13')](function(){logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0x2b'),EXTRACTED_REPORT_ID,_0x0858('0xb')));return analyticExtractedReport(_0x0858('0x2c'),_0x14f05c?util[_0x0858('0x9')]('%s.%s',_0x34dca9,_0x14f05c?'zip':_0x0858('0x25')):null);});})[_0x0858('0x2d')](function(_0x270055){logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0x2e'),EXTRACTED_REPORT_ID,_0x0858('0xb')),util[_0x0858('0x2f')](_0x270055,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0858('0x30'));})[_0x0858('0x31')](function(){process[_0x0858('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x127c=['../../config/logger','analytics','argv','savename','format','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','range','isInteger','forEach','push','dirname','basename','.xlsx','existsSync','join','each','length','%s%d.%s','xlsx','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','inspect','exit','util','lodash','rimraf','../../mysqldb','dbH'];(function(_0x4cc85f,_0x1c1044){var _0x1daf99=function(_0xf9e68b){while(--_0xf9e68b){_0x4cc85f['push'](_0x4cc85f['shift']());}};_0x1daf99(++_0x1c1044);}(_0x127c,0x121));var _0xc127=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x127c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc127('0x0'));var path=require('path');var _=require(_0xc127('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xc127('0x2'));var db=require(_0xc127('0x3'))['db'];var dbH=require(_0xc127('0x3'))[_0xc127('0x4')];var logger=require(_0xc127('0x5'))(_0xc127('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc127('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x210aed,_0x271289){var _0x430a54={'status':_0x210aed};var _0x2d2e63={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x271289){_0x430a54[_0xc127('0x8')]=_0x271289;}return db['AnalyticExtractedReport']['update'](_0x430a54,_0x2d2e63);}function main(){var _0xd518e7=0x1388;var _0x100b6c;logger['info'](util[_0xc127('0x9')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc127('0xa'),'splitSizeXlsx']})['then'](function(_0x31fdd4){if(_0x31fdd4){_0x100b6c=_0x31fdd4;_0xd518e7=_0x100b6c[_0xc127('0xb')]||0x1388;}})[_0xc127('0xc')](function(){return dbH[_0xc127('0xd')][_0xc127('0xe')](util[_0xc127('0x9')](_0xc127('0xf'),QUERY),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]});})[_0xc127('0xc')](function(_0x2d7024){if(!_0x2d7024[0x0][_0xc127('0x12')]){return analyticExtractedReport('Empty');}var _0x4086b3=[];var _0x9f6ecc=0x0;if(_0x100b6c['split']){if(_0x2d7024&&_0x2d7024['length']){var _0x136656=_[_0xc127('0x13')](_0x2d7024[0x0][_0xc127('0x12')]/_0xd518e7);var _0x24fb7c=Number[_0xc127('0x14')](_0x2d7024[0x0][_0xc127('0x12')]/_0xd518e7)?_0x2d7024[0x0][_0xc127('0x12')]%_0xd518e7:0x0;_0x136656[_0xc127('0x15')](function(_0x16de69){if(_0x16de69>0x0){_0x9f6ecc+=_0xd518e7;}_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')][_0xc127('0xe')](util[_0xc127('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xd518e7,_0x9f6ecc),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')]['SELECT']}));});if(_0x24fb7c>0x0){_0x9f6ecc+=_0xd518e7;_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')]['query'](util[_0xc127('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24fb7c,_0x9f6ecc),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]}));}}}else{_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')][_0xc127('0xe')](QUERY,{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]}));}var _0x1e76e2=path[_0xc127('0x17')](PATH);var _0x5a1599=path[_0xc127('0x18')](PATH,_0xc127('0x19'));var _0x4b5583=_0x100b6c[_0xc127('0xa')]&&_0x4086b3['length']>0x1;var _0x2323f4=[];if(!fs[_0xc127('0x1a')](path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599))&&_0x4b5583){fs['mkdirSync'](path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599));}return BPromise[_0xc127('0x1c')](_0x4086b3,function(_0x3d6a32){_0x2323f4[_0xc127('0x16')](_0x3d6a32);})[_0xc127('0xc')](function(){for(var _0x47ddaa=0x0;_0x47ddaa<_0x2323f4[_0xc127('0x1d')];_0x47ddaa+=0x1){var _0x5b60b7;var _0x598a51=_0x2323f4[_0x47ddaa];if(_0x4b5583){_0x5b60b7=path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599,util[_0xc127('0x9')](_0xc127('0x1e'),_0x5a1599,_0x47ddaa,_0xc127('0x1f')));}else{_0x5b60b7=path[_0xc127('0x1b')](_0x1e76e2,util['format']('%s.%s',_0x5a1599,_0xc127('0x1f')));}fs[_0xc127('0x20')](_0x5b60b7,json2xls(_0x598a51),'binary');}})[_0xc127('0xc')](function(){if(_0x4b5583){return new Promise(function(_0x223ddd){zipdir(path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599),{'saveTo':path[_0xc127('0x1b')](_0x1e76e2,util[_0xc127('0x9')]('%s.%s',_0x5a1599,_0xc127('0x21')))},function(_0x4c4b5a,_0xdd30f2){rimraf(path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599),function(){});_0x223ddd(_0xc127('0x22'));});});}})[_0xc127('0xc')](function(){logger[_0xc127('0x23')](util['format'](_0xc127('0x24'),EXTRACTED_REPORT_ID,_0xc127('0x25')));return analyticExtractedReport(_0xc127('0x26'),_0x4b5583?util[_0xc127('0x9')]('%s.%s',_0x5a1599,_0x4b5583?_0xc127('0x21'):_0xc127('0x1f')):null);});})[_0xc127('0x27')](function(_0x84fcc8){logger[_0xc127('0x23')](util[_0xc127('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc127('0x25')),util[_0xc127('0x28')](_0x84fcc8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xc127('0x29')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 824620f..14b6c67 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 _0xcdf3=['VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','*,*,*,*','interval','IntervalId','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','priority','extensions','find','push','type','Set','format','CDR(type)=%s','context'];(function(_0x77239f,_0x73ca2b){var _0x320f45=function(_0x5b9e95){while(--_0x5b9e95){_0x77239f['push'](_0x77239f['shift']());}};_0x320f45(++_0x73ca2b);}(_0xcdf3,0x71));var _0x3cdf=function(_0x32b54d,_0xc2f0b4){_0x32b54d=_0x32b54d-0x0;var _0x22c3fc=_0xcdf3[_0x32b54d];return _0x22c3fc;};'use strict';var _=require(_0x3cdf('0x0'));var util=require(_0x3cdf('0x1'));function rewrite(_0x51d03c,_0x138a19){var _0x21e686=this;return _0x51d03c[_0x3cdf('0x2')]['Interval'][_0x3cdf('0x3')]({'raw':!![]})[_0x3cdf('0x4')](function(_0x4bca90){_0x21e686[_0x3cdf('0x5')]=_0x4bca90;return _0x51d03c[_0x3cdf('0x2')][_0x3cdf('0x6')]['findAll']({'where':{'IntervalId':_0x138a19['IntervalId']},'raw':!![]});})[_0x3cdf('0x4')](function(_0x10278){return _0x51d03c[_0x3cdf('0x2')][_0x3cdf('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x10278,'exten'))}},'order':[{'raw':_0x3cdf('0x7')}],'raw':!![]});})['then'](function(_0x1947da){var _0x4c1bf0=_[_0x3cdf('0x8')](_0x1947da,{'priority':'1'});var _0x433dbf=_['filter'](_0x1947da,{'isApp':0x1});var _0x22125f=_['groupBy'](_0x433dbf,_0x3cdf('0x9'));var _0x13c044=[_0x3cdf('0xa'),_0x3cdf('0xb')];var _0x55e93e=[];var _0x15dbb9=[];for(var _0x36c0dc in _0x22125f){if(_0x22125f['hasOwnProperty'](_0x36c0dc)){_0x21e686[_0x3cdf('0xc')]=0x2;_0x21e686[_0x3cdf('0xd')]=[];_0x21e686['extension']=_[_0x3cdf('0xe')](_0x4c1bf0,{'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')]});_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':util[_0x3cdf('0x12')](_0x3cdf('0x13'),_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')]),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});if(_0x22125f[_0x36c0dc][0x0]['type']===_0x3cdf('0x16')){_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x17')+_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')],'context':_0x22125f[_0x36c0dc][0x0]['context'],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});}else if(_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')]===_0x3cdf('0x18')){if(_0x21e686[_0x3cdf('0x19')]){_0x21e686['extensions']['push']({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':'CDR(destination)='+(_0x21e686['extension'][_0x3cdf('0x1a')]?'${EXTEN:'+_0x21e686['extension'][_0x3cdf('0x1a')]+'}':'${EXTEN}'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0]['VoiceExtensionId']});}_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x17')+_0x22125f[_0x36c0dc][0x0]['VoiceExtensionId'],'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});var _0x3387f7=_0x21e686[_0x3cdf('0xc')]++;_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x1b'),'appdata':_0x3cdf('0x1c')+(_0x3387f7+0x2)+_0x3cdf('0x1d')+(_0x3387f7+0x1)+')','context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0]['exten'],'priority':_0x3387f7,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});if(_0x21e686['extension']){_0x21e686['extensions'][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0]['type'],'app':_0x3cdf('0x11'),'appdata':_0x21e686['extension'][_0x3cdf('0x1a')]?_0x3cdf('0x1e')+_0x21e686['extension'][_0x3cdf('0x1a')]+'}':_0x3cdf('0x1f'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});}_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x20')+_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')],'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686['priority']++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});if(_0x21e686['extension']&&_0x21e686[_0x3cdf('0x19')][_0x3cdf('0x21')](_0x3cdf('0x22'))&&_0x21e686[_0x3cdf('0x19')][_0x3cdf('0x22')]!==_0x3cdf('0x23')){_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0]['exten'],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x21e686[_0x3cdf('0x19')]['recordingFormat']||_0x3cdf('0x24'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0]['VoiceExtensionId']});}}_0x21e686[_0x3cdf('0xd')]['push']({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x25'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0]['exten'],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});_0x21e686[_0x3cdf('0xd')]['push']({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x26'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});_0x21e686[_0x3cdf('0xd')][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0]['type'],'app':'Set','appdata':_0x3cdf('0x27'),'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'exten':_0x22125f[_0x36c0dc][0x0]['exten'],'priority':_0x21e686[_0x3cdf('0xc')]++,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});for(var _0x2feed5=0x0,_0x5c4877=0x0;_0x2feed5<_0x22125f[_0x36c0dc]['length'];_0x2feed5+=0x1,_0x5c4877=0x0){var _0x269072=_0x22125f[_0x36c0dc][_0x2feed5];if(_0x269072[_0x3cdf('0x10')]){_0x269072[_0x3cdf('0x10')]=_0x269072['type'][_0x3cdf('0x28')]();}var _0x32d430=[];var _0x14ffbb=[];delete _0x269072['id'];delete _0x269072[_0x3cdf('0x29')];delete _0x269072['updatedAt'];var _0x3bb58f=_0x269072['interval']!==_0x3cdf('0x2a')?[_0x269072[_0x3cdf('0x2b')]]:_0x269072[_0x3cdf('0x2c')]?_[_0x3cdf('0x2d')](_['filter'](_0x21e686[_0x3cdf('0x5')],{'IntervalId':_0x269072[_0x3cdf('0x2c')]}),_0x3cdf('0x2b')):[];if(_0x269072[_0x3cdf('0x21')]('tag')){if(_0x269072[_0x3cdf('0x2e')]&&_0x269072[_0x3cdf('0x2e')]!=='--'){_0x32d430[_0x3cdf('0xf')]({'type':_0x269072[_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x2f')+_0x269072[_0x3cdf('0x2e')],'context':_0x269072[_0x3cdf('0x14')],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f['length']+_0x21e686['priority']+_0x5c4877++,'VoiceExtensionId':_0x269072[_0x3cdf('0x15')]});}}if(_0x269072[_0x3cdf('0x10')]===_0x3cdf('0x18')&&_0x269072[_0x3cdf('0x21')]('callerID')){if(_0x269072[_0x3cdf('0x30')]){_0x32d430[_0x3cdf('0xf')]({'type':_0x269072[_0x3cdf('0x10')],'app':_0x3cdf('0x1b'),'appdata':_0x3cdf('0x31')+_0x269072[_0x3cdf('0x30')]+')','context':_0x269072[_0x3cdf('0x14')],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f[_0x3cdf('0x32')]+_0x21e686[_0x3cdf('0xc')]+_0x5c4877++,'VoiceExtensionId':_0x269072['VoiceExtensionId']});}else{_0x32d430[_0x3cdf('0xf')]({'type':_0x269072['type'],'app':_0x3cdf('0x1b'),'appdata':_0x3cdf('0x33'),'context':_0x269072['context'],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f[_0x3cdf('0x32')]+_0x21e686[_0x3cdf('0xc')]+_0x5c4877++,'VoiceExtensionId':_0x269072[_0x3cdf('0x15')]});}}if(_0x269072[_0x3cdf('0x21')](_0x3cdf('0x34'))){if(_0x13c044['indexOf'](_0x269072[_0x3cdf('0x35')]['toLowerCase']())>=0x0&&_0x269072['appType']!=='custom'){if(_0x269072[_0x3cdf('0x34')]){_0x32d430[_0x3cdf('0xf')]({'type':_0x269072[_0x3cdf('0x10')],'app':_0x3cdf('0x1b'),'appdata':_0x3cdf('0x36'),'context':_0x269072[_0x3cdf('0x14')],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f['length']+_0x21e686[_0x3cdf('0xc')]+_0x5c4877++,'VoiceExtensionId':_0x269072[_0x3cdf('0x15')]});_0x32d430[_0x3cdf('0xf')]({'type':_0x269072[_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':_0x3cdf('0x37'),'context':_0x269072[_0x3cdf('0x14')],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f[_0x3cdf('0x32')]+_0x21e686['priority']+_0x5c4877++,'VoiceExtensionId':_0x269072['VoiceExtensionId']});}else{_0x32d430[_0x3cdf('0xf')]({'type':_0x269072['type'],'app':_0x3cdf('0x1b'),'appdata':_0x3cdf('0x38'),'context':_0x269072['context'],'exten':_0x269072[_0x3cdf('0x9')],'priority':_0x3bb58f['length']+_0x21e686[_0x3cdf('0xc')]+_0x5c4877++,'VoiceExtensionId':_0x269072[_0x3cdf('0x15')]});_0x32d430['push']({'type':_0x269072[_0x3cdf('0x10')],'app':_0x3cdf('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x269072[_0x3cdf('0x14')],'exten':_0x269072['exten'],'priority':_0x3bb58f[_0x3cdf('0x32')]+_0x21e686[_0x3cdf('0xc')]+_0x5c4877++,'VoiceExtensionId':_0x269072[_0x3cdf('0x15')]});}}}for(var _0x4826a1=0x0;_0x4826a1<_0x3bb58f[_0x3cdf('0x32')];_0x4826a1+=0x1){var _0x96515a=_0x21e686[_0x3cdf('0xc')]+_0x3bb58f[_0x3cdf('0x32')];var _0x36d50c=_0x4826a1===_0x3bb58f[_0x3cdf('0x32')]-0x1?_0x21e686[_0x3cdf('0xc')]+_0x32d430[_0x3cdf('0x32')]+_0x14ffbb[_0x3cdf('0x32')]+0x2:_0x21e686[_0x3cdf('0xc')]+_0x4826a1+0x1;_0x32d430[_0x3cdf('0x39')](_0x4826a1,0x0,{'type':_0x269072[_0x3cdf('0x10')],'app':'GotoIfTime','appdata':_0x3bb58f[_0x4826a1]+'?'+_0x269072['context']+',${EXTEN},'+_0x96515a+':'+_0x269072[_0x3cdf('0x14')]+_0x3cdf('0x3a')+_0x36d50c,'exten':_0x269072[_0x3cdf('0x9')],'context':_0x269072[_0x3cdf('0x14')],'priority':_0x21e686[_0x3cdf('0xc')]+_0x4826a1,'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});}_0x269072[_0x3cdf('0xc')]=_0x32d430[_0x3cdf('0x32')]?_[_0x3cdf('0x3b')](_0x32d430)['priority']+0x1:_0x21e686['priority'];_0x21e686[_0x3cdf('0xc')]=(_0x14ffbb[_0x3cdf('0x32')]?_[_0x3cdf('0x3b')](_0x14ffbb)[_0x3cdf('0xc')]:_0x269072[_0x3cdf('0xc')])+0x1;_0x21e686['extensions']=_[_0x3cdf('0x3c')](_0x21e686[_0x3cdf('0xd')],_0x32d430,[_0x269072],_0x14ffbb);}_0x21e686['extensions'][_0x3cdf('0xf')]({'type':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x10')],'app':_0x3cdf('0x3d'),'exten':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x9')],'context':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x14')],'priority':_0x21e686[_0x3cdf('0xc')],'VoiceExtensionId':_0x22125f[_0x36c0dc][0x0][_0x3cdf('0x15')]});_0x55e93e[_0x3cdf('0xf')](_0x22125f[_0x36c0dc][0x0]['VoiceExtensionId']);_0x15dbb9=_[_0x3cdf('0x3c')](_0x15dbb9,_0x21e686[_0x3cdf('0xd')]);}}return _0x51d03c[_0x3cdf('0x3e')](function(_0x5c8b9d){return _0x51d03c[_0x3cdf('0x2')][_0x3cdf('0x6')][_0x3cdf('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x55e93e}},'transaction':_0x5c8b9d})['then'](function(_0x1f13df){return _0x51d03c['models'][_0x3cdf('0x6')][_0x3cdf('0x40')](_[_0x3cdf('0x41')](_0x15dbb9,'priority'),{'transaction':_0x5c8b9d});});});})['catch'](function(_0x3691d3){console['error'](_0x3691d3);});}exports[_0x3cdf('0x42')]=rewrite; \ No newline at end of file +var _0x3c69=['toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','models','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','format','CDR(type)=%s','type','context','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','interval','*,*,*,*','intervals','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)','answer','indexOf','app'];(function(_0x2e0fd6,_0x149cb7){var _0xed91f5=function(_0x2813b3){while(--_0x2813b3){_0x2e0fd6['push'](_0x2e0fd6['shift']());}};_0xed91f5(++_0x149cb7);}(_0x3c69,0x1b9));var _0x93c6=function(_0x161f85,_0x1b1968){_0x161f85=_0x161f85-0x0;var _0x3f98ad=_0x3c69[_0x161f85];return _0x3f98ad;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x3721b1,_0x4cc200){var _0x367157=this;return _0x3721b1[_0x93c6('0x0')]['Interval'][_0x93c6('0x1')]({'raw':!![]})[_0x93c6('0x2')](function(_0xc25ed9){_0x367157['intervals']=_0xc25ed9;return _0x3721b1[_0x93c6('0x0')][_0x93c6('0x3')][_0x93c6('0x1')]({'where':{'IntervalId':_0x4cc200[_0x93c6('0x4')]},'raw':!![]});})[_0x93c6('0x2')](function(_0x2ab11d){return _0x3721b1[_0x93c6('0x0')]['VoiceExtension'][_0x93c6('0x1')]({'where':{'exten':{'$in':_[_0x93c6('0x5')](_[_0x93c6('0x6')](_0x2ab11d,_0x93c6('0x7')))}},'order':[{'raw':_0x93c6('0x8')}],'raw':!![]});})[_0x93c6('0x2')](function(_0x4e6032){var _0x575370=_[_0x93c6('0x9')](_0x4e6032,{'priority':'1'});var _0x596c14=_[_0x93c6('0x9')](_0x4e6032,{'isApp':0x1});var _0x3c06c9=_[_0x93c6('0xa')](_0x596c14,_0x93c6('0x7'));var _0x493fac=[_0x93c6('0xb'),'playback'];var _0x50e177=[];var _0x59d6f2=[];for(var _0x5007a0 in _0x3c06c9){if(_0x3c06c9['hasOwnProperty'](_0x5007a0)){_0x367157[_0x93c6('0xc')]=0x2;_0x367157[_0x93c6('0xd')]=[];_0x367157[_0x93c6('0xe')]=_[_0x93c6('0xf')](_0x575370,{'exten':_0x3c06c9[_0x5007a0][0x0]['exten']});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':util[_0x93c6('0x11')](_0x93c6('0x12'),_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});if(_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]===_0x93c6('0x15')){_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x17')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});}else if(_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]===_0x93c6('0x18')){if(_0x367157[_0x93c6('0xe')]){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':_0x93c6('0x19')+(_0x367157['extension'][_0x93c6('0x1a')]?_0x93c6('0x1b')+_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]+'}':_0x93c6('0x1c')),'context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':_0x93c6('0x17')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});var _0x3e0e87=_0x367157['priority']++;_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':'ExecIf','appdata':_0x93c6('0x1e')+(_0x3e0e87+0x2)+_0x93c6('0x1f')+(_0x3e0e87+0x1)+')','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x3e0e87,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});if(_0x367157[_0x93c6('0xe')]){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]?_0x93c6('0x20')+_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0]['exten'],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':'Set','appdata':_0x93c6('0x21')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});if(_0x367157[_0x93c6('0xe')]&&_0x367157[_0x93c6('0xe')][_0x93c6('0x22')](_0x93c6('0x23'))&&_0x367157[_0x93c6('0xe')][_0x93c6('0x23')]!==_0x93c6('0x24')){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x25')+_0x367157[_0x93c6('0xe')][_0x93c6('0x23')]||_0x93c6('0x26'),'context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}}_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x27'),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x28'),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0]['exten'],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});for(var _0x409864=0x0,_0x52fa69=0x0;_0x409864<_0x3c06c9[_0x5007a0][_0x93c6('0x29')];_0x409864+=0x1,_0x52fa69=0x0){var _0x1a063f=_0x3c06c9[_0x5007a0][_0x409864];if(_0x1a063f['type']){_0x1a063f[_0x93c6('0x13')]=_0x1a063f[_0x93c6('0x13')]['toLowerCase']();}var _0x5c967b=[];var _0x295c07=[];delete _0x1a063f['id'];delete _0x1a063f[_0x93c6('0x2a')];delete _0x1a063f[_0x93c6('0x2b')];var _0x565152=_0x1a063f[_0x93c6('0x2c')]!==_0x93c6('0x2d')?[_0x1a063f[_0x93c6('0x2c')]]:_0x1a063f[_0x93c6('0x4')]?_[_0x93c6('0x6')](_[_0x93c6('0x9')](_0x367157[_0x93c6('0x2e')],{'IntervalId':_0x1a063f[_0x93c6('0x4')]}),_0x93c6('0x2c')):[];if(_0x1a063f[_0x93c6('0x22')](_0x93c6('0x2f'))){if(_0x1a063f['tag']&&_0x1a063f['tag']!=='--'){_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':'Set','appdata':_0x93c6('0x30')+_0x1a063f[_0x93c6('0x2f')],'context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f['VoiceExtensionId']});}}if(_0x1a063f[_0x93c6('0x13')]==='outbound'&&_0x1a063f[_0x93c6('0x22')](_0x93c6('0x31'))){if(_0x1a063f['callerID']){_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':_0x93c6('0x33')+_0x1a063f[_0x93c6('0x31')]+')','context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}else{_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':_0x93c6('0x34'),'context':_0x1a063f['context'],'exten':_0x1a063f['exten'],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}}if(_0x1a063f[_0x93c6('0x22')](_0x93c6('0x35'))){if(_0x493fac[_0x93c6('0x36')](_0x1a063f[_0x93c6('0x37')][_0x93c6('0x38')]())>=0x0&&_0x1a063f[_0x93c6('0x39')]!==_0x93c6('0x3a')){if(_0x1a063f[_0x93c6('0x35')]){_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f['type'],'app':_0x93c6('0x32'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1a063f['context'],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152[_0x93c6('0x29')]+_0x367157['priority']+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x3b'),'context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}else{_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1a063f['context'],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}}}for(var _0x4a1905=0x0;_0x4a1905<_0x565152['length'];_0x4a1905+=0x1){var _0x3ce861=_0x367157[_0x93c6('0xc')]+_0x565152['length'];var _0x47d8d1=_0x4a1905===_0x565152[_0x93c6('0x29')]-0x1?_0x367157[_0x93c6('0xc')]+_0x5c967b[_0x93c6('0x29')]+_0x295c07[_0x93c6('0x29')]+0x2:_0x367157[_0x93c6('0xc')]+_0x4a1905+0x1;_0x5c967b[_0x93c6('0x3c')](_0x4a1905,0x0,{'type':_0x1a063f[_0x93c6('0x13')],'app':'GotoIfTime','appdata':_0x565152[_0x4a1905]+'?'+_0x1a063f['context']+_0x93c6('0x3d')+_0x3ce861+':'+_0x1a063f['context']+_0x93c6('0x3d')+_0x47d8d1,'exten':_0x1a063f['exten'],'context':_0x1a063f[_0x93c6('0x14')],'priority':_0x367157[_0x93c6('0xc')]+_0x4a1905,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}_0x1a063f[_0x93c6('0xc')]=_0x5c967b[_0x93c6('0x29')]?_['last'](_0x5c967b)[_0x93c6('0xc')]+0x1:_0x367157[_0x93c6('0xc')];_0x367157[_0x93c6('0xc')]=(_0x295c07[_0x93c6('0x29')]?_[_0x93c6('0x3e')](_0x295c07)[_0x93c6('0xc')]:_0x1a063f[_0x93c6('0xc')])+0x1;_0x367157[_0x93c6('0xd')]=_[_0x93c6('0x3f')](_0x367157['extensions'],_0x5c967b,[_0x1a063f],_0x295c07);}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x40'),'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'priority':_0x367157[_0x93c6('0xc')],'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x50e177[_0x93c6('0x10')](_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]);_0x59d6f2=_[_0x93c6('0x3f')](_0x59d6f2,_0x367157['extensions']);}}return _0x3721b1[_0x93c6('0x41')](function(_0x9fff0){return _0x3721b1[_0x93c6('0x0')][_0x93c6('0x3')][_0x93c6('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x50e177}},'transaction':_0x9fff0})[_0x93c6('0x2')](function(_0x4778dc){return _0x3721b1[_0x93c6('0x0')]['VoiceExtension'][_0x93c6('0x43')](_[_0x93c6('0x44')](_0x59d6f2,_0x93c6('0xc')),{'transaction':_0x9fff0});});});})[_0x93c6('0x45')](function(_0x4c57ab){console[_0x93c6('0x46')](_0x4c57ab);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f93bf8d..eddf7f6 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 _0x9f0b=['CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','errors','length','map','join','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','create','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','phone','field','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','into','NOW()','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','then','get','always','query','VoiceQueueId','catch','onlyIfOpen','sequelize','all','BlackLists','dialCheckDuplicateType','CampaignId','Campaign','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','CmContact','parse','info','CSV\x20parsed\x20correctly!'];(function(_0xc43d5a,_0x1c381b){var _0x3ab8bf=function(_0x58d0a0){while(--_0x58d0a0){_0xc43d5a['push'](_0xc43d5a['shift']());}};_0x3ab8bf(++_0x1c381b);}(_0x9f0b,0xda));var _0xb9f0=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x9f0b[_0x1cfe2e];return _0x39233f;};'use strict';var BPromise=require(_0xb9f0('0x0'));var util=require(_0xb9f0('0x1'));var _=require(_0xb9f0('0x2'));var fs=require('fs');var squel=require(_0xb9f0('0x3'));var Papa=require(_0xb9f0('0x4'));var Redis=require(_0xb9f0('0x5'));var db=require(_0xb9f0('0x6'))['db'];var config=require(_0xb9f0('0x7'));var logger=require(_0xb9f0('0x8'))(_0xb9f0('0x9'));config[_0xb9f0('0xa')]=_['defaults'](config[_0xb9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9f0('0xb'))(new Redis(config[_0xb9f0('0xa')]));require(_0xb9f0('0xc'))[_0xb9f0('0xd')](socket);try{if(!process['argv'][0x2]||process[_0xb9f0('0xe')][0x2]===_0xb9f0('0xf')||process['argv'][0x2]===_0xb9f0('0x10')){throw new Error(_0xb9f0('0x11'));}var FILEPATH=process[_0xb9f0('0xe')][0x2];if(!process[_0xb9f0('0xe')][0x3]||process['argv'][0x3]===_0xb9f0('0xf')||process['argv'][0x3]===_0xb9f0('0x10')||!process[_0xb9f0('0xe')][0x4]||process[_0xb9f0('0xe')][0x4]==='undefined'||process[_0xb9f0('0xe')][0x4]===_0xb9f0('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb9f0('0x12')](process[_0xb9f0('0xe')][0x3][_0xb9f0('0x13')](','),process['argv'][0x4][_0xb9f0('0x13')](','));if(!process['argv'][0x5]||process[_0xb9f0('0xe')][0x5]===_0xb9f0('0xf')||process[_0xb9f0('0xe')][0x5]===_0xb9f0('0x10')){throw new Error(_0xb9f0('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xb9f0('0xe')][0x6]&&process[_0xb9f0('0xe')][0x6]!=='undefined'&&process[_0xb9f0('0xe')][0x6]!=='null'?process[_0xb9f0('0xe')][0x6]:null;var DUPLICATES=process[_0xb9f0('0xe')][0x7]&&process['argv'][0x7]!==_0xb9f0('0xf')&&process['argv'][0x7]!==_0xb9f0('0x10')?process[_0xb9f0('0xe')][0x7]:null;if(!process[_0xb9f0('0xe')][0x8]||process[_0xb9f0('0xe')][0x8]===_0xb9f0('0xf')||process[_0xb9f0('0xe')][0x8]===_0xb9f0('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4f6f7f){logger[_0xb9f0('0x15')](_0x4f6f7f);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(_0x329ccf,_0x545a9a,_0x3744b9,_0x45f846){var _0x21cf94={'message':_0x545a9a};_0x21cf94[_0x329ccf]=!![];if(_0x3744b9){_0x21cf94[_0xb9f0('0x16')]=_0x3744b9;}if(_0x45f846){_0x21cf94[_0xb9f0('0x17')]=_0x45f846;}return _0x21cf94;}function isEmail(_0x1b648f){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))*$/[_0xb9f0('0x18')](_0x1b648f);}function checkRow(_0x326376,_0x5bc6ed,_0x260f2d){return new BPromise(function(_0x583bcd,_0x423696){if(_[_0xb9f0('0x19')](_0x326376)){return _0x423696(handleCheckRowError(_0xb9f0('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x260f2d));}if(_0x326376[_0xb9f0('0x1a')]&&_0x326376[_0xb9f0('0x1a')][_0xb9f0('0x1b')]){var _0x3679e1=_[_0xb9f0('0x1c')](_0x326376[_0xb9f0('0x1a')],'message')[_0xb9f0('0x1d')](';');return _0x423696(handleCheckRowError(_0xb9f0('0x15'),_0x3679e1,null,_0x260f2d));}var _0x9ea7b0={};for(var _0xdf00e9 in FIELDS){if(FIELDS['hasOwnProperty'](_0xdf00e9)&&FIELDS[_0xdf00e9]){_0x9ea7b0[_0xdf00e9]=_0x326376[_0xb9f0('0x1e')][0x0][FIELDS[_0xdf00e9]]||_0x326376['data'][0x0]['\ufeff'+FIELDS[_0xdf00e9]];}}if(!_0x9ea7b0['firstName']){return _0x423696(handleCheckRowError('error',_0xb9f0('0x1f'),null,_0x260f2d));}if(!_0x9ea7b0['phone']){return _0x423696(handleCheckRowError('error',_0xb9f0('0x20'),null,_0x260f2d));}if(_0x9ea7b0[_0xb9f0('0x21')]){var _0x4a7b5d=moment(_0x9ea7b0[_0xb9f0('0x21')],_0xb9f0('0x22'));if(!_0x4a7b5d[_0xb9f0('0x23')]()){return _0x423696(handleCheckRowError(_0xb9f0('0x15'),_0xb9f0('0x24'),null,_0x260f2d));}}if(_0x9ea7b0[_0xb9f0('0x25')]){if(!isEmail(_0x9ea7b0[_0xb9f0('0x25')])){return _0x423696(handleCheckRowError('error',_0xb9f0('0x26'),null,_0x260f2d));}}_0x9ea7b0[_0xb9f0('0x27')]=LISTID;_0x9ea7b0[_0xb9f0('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb9f0('0x1b')]&&_0x5bc6ed){var _0x16f02a={};for(var _0x575b1d=0x0,_0x51d5e1=DUPLICATES['length'];_0x575b1d<_0x51d5e1;_0x575b1d+=0x1){_0x16f02a[DUPLICATES[_0x575b1d]]=_0x9ea7b0[DUPLICATES[_0x575b1d]];}var _0x323b1f=_['find'](_0x5bc6ed,_0x16f02a);if(_0x323b1f){return _0x423696(handleCheckRowError(_0xb9f0('0x29'),_0xb9f0('0x2a'),_0x323b1f,_0x260f2d));}}return db['CmContact'][_0xb9f0('0x2b')](_0x9ea7b0,{'raw':!![],'hooks':![],'fields':_['keys'](_0x9ea7b0)})['then'](function(_0x1cf52){if(DUPLICATES&&DUPLICATES[_0xb9f0('0x1b')]&&_0x5bc6ed){_0x5bc6ed[_0xb9f0('0x2c')](_[_0xb9f0('0x2d')](_0x9ea7b0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1cf52['id'];return _0x583bcd();})['catch'](function(_0x42f6fe){return _0x423696(handleCheckRowError('error',_0xb9f0('0x2e')+(_0x42f6fe[_0xb9f0('0x2f')]||JSON[_0xb9f0('0x30')](_0x42f6fe)),null,_0x260f2d));});});}function checkHopper(){function _0x431ba7(){return function(_0x20af32){logger['error'](_0xb9f0('0x31'),'checkHopper',util['inspect'](_0x20af32,{'showHidden':![],'depth':null}));};}var _0x249481=function(_0x3aed8f,_0x208e36){var _0xc412d7=squel['insert']()['into'](_0xb9f0('0x32'))[_0xb9f0('0x33')](['phone',_0xb9f0('0x34'),_0xb9f0('0x35'),'ListId',_0x208e36,_0xb9f0('0x36'),_0xb9f0('0x37')],squel[_0xb9f0('0x38')]()['field'](_0xb9f0('0x39'),'phone')[_0xb9f0('0x3a')]('NOW()',_0xb9f0('0x34'))[_0xb9f0('0x3a')]('id',_0xb9f0('0x35'))[_0xb9f0('0x3a')](LISTID[_0xb9f0('0x3b')](),'ListId')[_0xb9f0('0x3a')](_0x3aed8f['id'][_0xb9f0('0x3b')](),_0x208e36)[_0xb9f0('0x3a')]('NOW()',_0xb9f0('0x36'))[_0xb9f0('0x3a')]('NOW()','updatedAt')[_0xb9f0('0x3c')](_0xb9f0('0x3d'))[_0xb9f0('0x3e')](_0xb9f0('0x3f'))[_0xb9f0('0x3e')](_0xb9f0('0x40'),LISTID['toString']())[_0xb9f0('0x3e')](_0xb9f0('0x41'))[_0xb9f0('0x3e')](_0xb9f0('0x42'),squel[_0xb9f0('0x38')]()[_0xb9f0('0x3a')]('phone')['from'](_0xb9f0('0x32'))[_0xb9f0('0x3e')](_0x208e36+'\x20=\x20?',_0x3aed8f['id'][_0xb9f0('0x3b')]())))[_0xb9f0('0x3b')]();return _0xc412d7;};var _0x313065=function(_0xe9124c,_0x529bc0){var _0x2795c0=squel[_0xb9f0('0x43')]()[_0xb9f0('0x44')](_0xb9f0('0x32'))[_0xb9f0('0x33')]([_0xb9f0('0x39'),_0xb9f0('0x34'),_0xb9f0('0x35'),_0xb9f0('0x27'),_0x529bc0,_0xb9f0('0x36'),_0xb9f0('0x37')],squel[_0xb9f0('0x38')]()[_0xb9f0('0x3a')](_0xb9f0('0x39'),'phone')[_0xb9f0('0x3a')]('NOW()','scheduledAt')[_0xb9f0('0x3a')]('id',_0xb9f0('0x35'))['field'](LISTID['toString'](),'ListId')[_0xb9f0('0x3a')](_0xe9124c['id'][_0xb9f0('0x3b')](),_0x529bc0)[_0xb9f0('0x3a')](_0xb9f0('0x45'),_0xb9f0('0x36'))[_0xb9f0('0x3a')]('NOW()',_0xb9f0('0x37'))[_0xb9f0('0x3c')](_0xb9f0('0x3d'))[_0xb9f0('0x3e')]('deletedAt\x20IS\x20NULL')[_0xb9f0('0x3e')]('ListId\x20=\x20?',LISTID[_0xb9f0('0x3b')]())[_0xb9f0('0x3e')]('id\x20IN\x20?',squel[_0xb9f0('0x46')](hopperContacts))[_0xb9f0('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb9f0('0x42'),squel['select']()[_0xb9f0('0x3a')](_0xb9f0('0x47'))[_0xb9f0('0x3c')](_0xb9f0('0x48'))[_0xb9f0('0x3e')](_0x529bc0+'\x20=\x20?',_0xe9124c['id'][_0xb9f0('0x3b')]()))[_0xb9f0('0x3e')](_0xb9f0('0x42'),squel[_0xb9f0('0x38')]()[_0xb9f0('0x3a')]('phone')[_0xb9f0('0x3c')](_0xb9f0('0x32'))[_0xb9f0('0x3e')](_0x529bc0+'\x20=\x20?',_0xe9124c['id']['toString']())))[_0xb9f0('0x3b')]();return _0x2795c0;};function _0x9bc41a(_0x16809c,_0x2b206b){var _0x1cddb9=squel[_0xb9f0('0x43')]()[_0xb9f0('0x44')](_0xb9f0('0x32'))[_0xb9f0('0x33')]([_0xb9f0('0x39'),_0xb9f0('0x34'),_0xb9f0('0x35'),_0xb9f0('0x27'),_0x2b206b,_0xb9f0('0x36'),_0xb9f0('0x37')],squel[_0xb9f0('0x38')]()[_0xb9f0('0x3a')]('phone',_0xb9f0('0x39'))[_0xb9f0('0x3a')]('NOW()',_0xb9f0('0x34'))[_0xb9f0('0x3a')]('id',_0xb9f0('0x35'))['field'](LISTID[_0xb9f0('0x3b')](),_0xb9f0('0x27'))['field'](_0x16809c['id'][_0xb9f0('0x3b')](),_0x2b206b)[_0xb9f0('0x3a')](_0xb9f0('0x45'),_0xb9f0('0x36'))[_0xb9f0('0x3a')](_0xb9f0('0x45'),_0xb9f0('0x37'))[_0xb9f0('0x3c')](_0xb9f0('0x3d'))[_0xb9f0('0x3e')](_0xb9f0('0x3f'))[_0xb9f0('0x3e')]('ListId\x20=\x20?',LISTID[_0xb9f0('0x3b')]())['where'](_0xb9f0('0x49'),squel[_0xb9f0('0x46')](hopperContacts))[_0xb9f0('0x3e')](_0xb9f0('0x41')))[_0xb9f0('0x3b')]();return _0x1cddb9;}function _0x4a2db0(_0x293576,_0x214736){var _0x5d392b=squel['insert']()[_0xb9f0('0x44')](_0xb9f0('0x4a'))[_0xb9f0('0x33')]([_0xb9f0('0x39'),_0xb9f0('0x35'),_0xb9f0('0x27'),_0x214736,'createdAt',_0xb9f0('0x37')],squel['select']()[_0xb9f0('0x3a')](_0xb9f0('0x39'),'phone')[_0xb9f0('0x3a')]('id',_0xb9f0('0x35'))[_0xb9f0('0x3a')](LISTID[_0xb9f0('0x3b')](),_0xb9f0('0x27'))[_0xb9f0('0x3a')](_0x293576['id']['toString'](),_0x214736)['field'](_0xb9f0('0x45'),_0xb9f0('0x36'))[_0xb9f0('0x3a')]('NOW()',_0xb9f0('0x37'))[_0xb9f0('0x3c')](_0xb9f0('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xb9f0('0x3e')](_0xb9f0('0x40'),LISTID[_0xb9f0('0x3b')]())[_0xb9f0('0x3e')](_0xb9f0('0x49'),squel[_0xb9f0('0x46')](hopperContacts))['where'](_0xb9f0('0x41')))[_0xb9f0('0x3b')]();return _0x5d392b;}return db[_0xb9f0('0x4b')][_0xb9f0('0x4c')]({'where':{'type':_0xb9f0('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb9f0('0x4e')],'as':_0xb9f0('0x4f'),'where':{'id':LISTID}}]})[_0xb9f0('0x50')](function(_0x5184f0){var _0x1009af=[];if(_0x5184f0){var _0x13ba50;for(var _0x426b55=0x0,_0x4d2401;_0x426b55<_0x5184f0[_0xb9f0('0x1b')];_0x426b55+=0x1){_0x4d2401=_0x5184f0[_0x426b55][_0xb9f0('0x51')]({'plain':!![]});switch(_0x4d2401['dialCheckDuplicateType']){case _0xb9f0('0x52'):_0x1009af['push'](db['sequelize'][_0xb9f0('0x53')](_0x313065(_0x4d2401,_0xb9f0('0x54')))[_0xb9f0('0x50')](function(){})[_0xb9f0('0x55')](_0x431ba7()));break;case _0xb9f0('0x56'):_0x1009af[_0xb9f0('0x2c')](db['sequelize'][_0xb9f0('0x53')](_0x249481(_0x4d2401,_0xb9f0('0x54')))[_0xb9f0('0x50')](function(){})[_0xb9f0('0x55')](_0x431ba7()));break;default:_0x1009af[_0xb9f0('0x2c')](db[_0xb9f0('0x57')][_0xb9f0('0x53')](_0x9bc41a(_0x4d2401,_0xb9f0('0x54')))[_0xb9f0('0x50')](function(){})[_0xb9f0('0x55')](_0x431ba7()));}}}return _0x1009af;})[_0xb9f0('0x58')]()[_0xb9f0('0x50')](function(){return db[_0xb9f0('0x4b')][_0xb9f0('0x4c')]({'where':{'type':_0xb9f0('0x4d')},'attributes':['id'],'include':[{'model':db[_0xb9f0('0x4e')],'as':_0xb9f0('0x59'),'where':{'id':LISTID}}]})[_0xb9f0('0x50')](function(_0x589aaf){var _0x241bba=[];if(_0x589aaf){var _0x588bd9;for(var _0x5ecd17=0x0,_0xa82f54;_0x5ecd17<_0x589aaf['length'];_0x5ecd17+=0x1){_0xa82f54=_0x589aaf[_0x5ecd17][_0xb9f0('0x51')]({'plain':!![]});_0x241bba[_0xb9f0('0x2c')](db[_0xb9f0('0x57')][_0xb9f0('0x53')](_0x4a2db0(_0xa82f54,_0xb9f0('0x54')))[_0xb9f0('0x50')](function(){})['catch'](_0x431ba7()));}}return _0x241bba;})[_0xb9f0('0x58')]();})[_0xb9f0('0x50')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xb9f0('0x5a')],'include':[{'model':db[_0xb9f0('0x4e')],'as':_0xb9f0('0x4f'),'where':{'id':LISTID}}]})[_0xb9f0('0x50')](function(_0x4ebeed){var _0xc54e05=[];if(_0x4ebeed){for(var _0x5ca5a9=0x0,_0xc11e17;_0x5ca5a9<_0x4ebeed[_0xb9f0('0x1b')];_0x5ca5a9+=0x1){_0xc11e17=_0x4ebeed[_0x5ca5a9][_0xb9f0('0x51')]({'plain':!![]});switch(_0xc11e17['dialCheckDuplicateType']){case _0xb9f0('0x52'):_0xc54e05[_0xb9f0('0x2c')](db[_0xb9f0('0x57')][_0xb9f0('0x53')](_0x313065(_0xc11e17,_0xb9f0('0x5b')))[_0xb9f0('0x50')](function(){})[_0xb9f0('0x55')](_0x431ba7()));break;case'onlyIfOpen':_0xc54e05['push'](db[_0xb9f0('0x57')][_0xb9f0('0x53')](_0x249481(_0xc11e17,'CampaignId'))[_0xb9f0('0x50')](function(){})[_0xb9f0('0x55')](_0x431ba7()));break;default:_0xc54e05[_0xb9f0('0x2c')](db[_0xb9f0('0x57')][_0xb9f0('0x53')](_0x9bc41a(_0xc11e17,_0xb9f0('0x5b')))[_0xb9f0('0x50')](function(){})['catch'](_0x431ba7()));}}}return _0xc54e05;})[_0xb9f0('0x58')]();})['then'](function(){return db[_0xb9f0('0x5c')][_0xb9f0('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xb9f0('0x4e')],'as':_0xb9f0('0x59'),'where':{'id':LISTID}}]})[_0xb9f0('0x50')](function(_0x298acb){var _0x4f0df8=[];if(_0x298acb){for(var _0x482b27=0x0,_0x44c150;_0x482b27<_0x298acb['length'];_0x482b27+=0x1){_0x44c150=_0x298acb[_0x482b27][_0xb9f0('0x51')]({'plain':!![]});_0x4f0df8[_0xb9f0('0x2c')](db['sequelize']['query'](_0x4a2db0(_0x44c150,_0xb9f0('0x5b')))[_0xb9f0('0x50')](function(){})['catch'](_0x431ba7()));}}return _0x4f0df8;})[_0xb9f0('0x58')]();})[_0xb9f0('0x55')](function(_0x4bc28c){logger[_0xb9f0('0x15')]('cmContact,\x20%s,\x20%s',_0xb9f0('0x5d'),_0x4bc28c[_0xb9f0('0x2f')]);});}var processPromises=function(_0x397430){return BPromise[_0xb9f0('0x58')](promises)['then'](function(_0x15402e){})[_0xb9f0('0x55')](function(_0x2b5340){logger[_0xb9f0('0x15')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x2b5340));})[_0xb9f0('0x5e')](function(){socket[_0xb9f0('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x397430){return _0x397430[_0xb9f0('0x60')]();}});};var endCsv=function(){return BPromise[_0xb9f0('0x61')]()[_0xb9f0('0x50')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xb9f0('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x37089c){logger['error'](_0xb9f0('0x63'),JSON[_0xb9f0('0x30')](_0x37089c));}finally{process['exit'](0x0);}});};process['on'](_0xb9f0('0x64'),function(){logger['info'](_0xb9f0('0x65'));endCsv();});function main(){return BPromise['resolve']()[_0xb9f0('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb9f0('0x13')](',');return db[_0xb9f0('0x66')][_0xb9f0('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb9f0('0x50')](function(_0x487166){var _0x25181d=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb9f0('0x67')](_0x25181d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3bd32d,_0x19f51a){total+=0x1;var _0x55c866=total;promises[_0xb9f0('0x2c')](checkRow(_0x3bd32d,_0x487166,_0x55c866)[_0xb9f0('0x50')](function(){success+=0x1;})[_0xb9f0('0x55')](function(_0x3b2581){if(_0x3b2581[_0xb9f0('0x15')]){errors+=0x1;delete _0x3b2581[_0xb9f0('0x15')];}else if(_0x3b2581[_0xb9f0('0x29')]){duplicates+=0x1;delete _0x3b2581[_0xb9f0('0x29')];}rows[_0xb9f0('0x2c')](_0x3b2581);}));if(total%0xc8===0x0){_0x19f51a['pause']();return processPromises(_0x19f51a);}},'complete':function(){return processPromises()[_0xb9f0('0x50')](function(){logger[_0xb9f0('0x68')](_0xb9f0('0x69'));endCsv();});},'error':function(_0x43d9aa,_0x2c9218){logger['info'](_0xb9f0('0x6a'),JSON[_0xb9f0('0x30')](_0x43d9aa));endCsv();}});})[_0xb9f0('0x55')](function(_0x31f8e7){logger[_0xb9f0('0x15')](_0xb9f0('0x6b'),JSON['stringify'](_0x31f8e7));});}main(); \ No newline at end of file +var _0xecbe=['The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','str','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','catch','all','findAll','BlackLists','get','Campaign','CampaignId','onlyIfOpen','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xecbe,0x19f));var _0xeecb=function(_0x50b57f,_0x2f01e9){_0x50b57f=_0x50b57f-0x0;var _0x4386fd=_0xecbe[_0x50b57f];return _0x4386fd;};'use strict';var BPromise=require('bluebird');var util=require(_0xeecb('0x0'));var _=require(_0xeecb('0x1'));var fs=require('fs');var squel=require(_0xeecb('0x2'));var Papa=require('papaparse');var Redis=require(_0xeecb('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xeecb('0x4'));var logger=require(_0xeecb('0x5'))(_0xeecb('0x6'));config['redis']=_[_0xeecb('0x7')](config['redis'],{'host':_0xeecb('0x8'),'port':0x18eb});var socket=require(_0xeecb('0x9'))(new Redis(config[_0xeecb('0xa')]));require(_0xeecb('0xb'))[_0xeecb('0xc')](socket);try{if(!process[_0xeecb('0xd')][0x2]||process[_0xeecb('0xd')][0x2]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x2]===_0xeecb('0xf')){throw new Error(_0xeecb('0x10'));}var FILEPATH=process[_0xeecb('0xd')][0x2];if(!process[_0xeecb('0xd')][0x3]||process['argv'][0x3]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x3]===_0xeecb('0xf')||!process[_0xeecb('0xd')][0x4]||process[_0xeecb('0xd')][0x4]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x4]==='null'){throw new Error(_0xeecb('0x11'));}var FIELDS=_['zipObject'](process[_0xeecb('0xd')][0x3]['split'](','),process[_0xeecb('0xd')][0x4][_0xeecb('0x12')](','));if(!process[_0xeecb('0xd')][0x5]||process['argv'][0x5]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x5]===_0xeecb('0xf')){throw new Error(_0xeecb('0x13'));}var LISTID=process[_0xeecb('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xeecb('0xd')][0x6]!==_0xeecb('0xe')&&process[_0xeecb('0xd')][0x6]!==_0xeecb('0xf')?process[_0xeecb('0xd')][0x6]:null;var DUPLICATES=process[_0xeecb('0xd')][0x7]&&process[_0xeecb('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0xeecb('0xf')?process['argv'][0x7]:null;if(!process[_0xeecb('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xeecb('0xd')][0x8]===_0xeecb('0xf')){throw new Error(_0xeecb('0x14'));}var SOCKET_TIMESTAMP=process[_0xeecb('0xd')][0x8];}catch(_0x30853c){logger[_0xeecb('0x15')](_0x30853c);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(_0x3a36cd,_0x1c761d,_0x584cbb,_0x116a43){var _0x458989={'message':_0x1c761d};_0x458989[_0x3a36cd]=!![];if(_0x584cbb){_0x458989[_0xeecb('0x16')]=_0x584cbb;}if(_0x116a43){_0x458989[_0xeecb('0x17')]=_0x116a43;}return _0x458989;}function isEmail(_0x4ed6d2){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'](_0x4ed6d2);}function checkRow(_0x4741c5,_0x1ccb1c,_0x1b70b1){return new BPromise(function(_0x1ea84b,_0xf766d0){if(_[_0xeecb('0x18')](_0x4741c5)){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x19'),null,_0x1b70b1));}if(_0x4741c5['errors']&&_0x4741c5[_0xeecb('0x1a')][_0xeecb('0x1b')]){var _0xb2247f=_[_0xeecb('0x1c')](_0x4741c5[_0xeecb('0x1a')],_0xeecb('0x1d'))[_0xeecb('0x1e')](';');return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xb2247f,null,_0x1b70b1));}var _0x579e9a={};for(var _0x56ea26 in FIELDS){if(FIELDS['hasOwnProperty'](_0x56ea26)&&FIELDS[_0x56ea26]){_0x579e9a[_0x56ea26]=_0x4741c5[_0xeecb('0x1f')][0x0][FIELDS[_0x56ea26]]||_0x4741c5[_0xeecb('0x1f')][0x0]['\ufeff'+FIELDS[_0x56ea26]];}}if(!_0x579e9a[_0xeecb('0x20')]){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x21'),null,_0x1b70b1));}if(!_0x579e9a[_0xeecb('0x22')]){return _0xf766d0(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x1b70b1));}if(_0x579e9a[_0xeecb('0x23')]){var _0x39d697=moment(_0x579e9a[_0xeecb('0x23')],_0xeecb('0x24'));if(!_0x39d697[_0xeecb('0x25')]()){return _0xf766d0(handleCheckRowError('error',_0xeecb('0x26'),null,_0x1b70b1));}}if(_0x579e9a[_0xeecb('0x27')]){if(!isEmail(_0x579e9a['email'])){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x28'),null,_0x1b70b1));}}_0x579e9a[_0xeecb('0x29')]=LISTID;_0x579e9a[_0xeecb('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeecb('0x1b')]&&_0x1ccb1c){var _0x507494={};for(var _0x2bb0d9=0x0,_0x1c74e3=DUPLICATES['length'];_0x2bb0d9<_0x1c74e3;_0x2bb0d9+=0x1){_0x507494[DUPLICATES[_0x2bb0d9]]=_0x579e9a[DUPLICATES[_0x2bb0d9]];}var _0x599ece=_[_0xeecb('0x2b')](_0x1ccb1c,_0x507494);if(_0x599ece){return _0xf766d0(handleCheckRowError(_0xeecb('0x2c'),_0xeecb('0x2d'),_0x599ece,_0x1b70b1));}}return db[_0xeecb('0x2e')][_0xeecb('0x2f')](_0x579e9a,{'raw':!![],'hooks':![],'fields':_[_0xeecb('0x30')](_0x579e9a)})[_0xeecb('0x31')](function(_0x4a7d2f){if(DUPLICATES&&DUPLICATES[_0xeecb('0x1b')]&&_0x1ccb1c){_0x1ccb1c[_0xeecb('0x32')](_['pick'](_0x579e9a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4a7d2f['id'];return _0x1ea84b();})['catch'](function(_0x19dd8a){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x19dd8a[_0xeecb('0x1d')]||JSON[_0xeecb('0x33')](_0x19dd8a)),null,_0x1b70b1));});});}function checkHopper(){function _0x1cf5e6(){return function(_0x465185){logger[_0xeecb('0x15')]('cmContact',_0xeecb('0x34'),util[_0xeecb('0x35')](_0x465185,{'showHidden':![],'depth':null}));};}var _0x4f7a2a=function(_0x2b5f92,_0x264e85){var _0x33c37a=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x38'))[_0xeecb('0x39')](['phone',_0xeecb('0x3a'),_0xeecb('0x3b'),'ListId',_0x264e85,'createdAt',_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x22'),_0xeecb('0x22'))[_0xeecb('0x3e')](_0xeecb('0x3f'),'scheduledAt')[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID['toString'](),_0xeecb('0x29'))[_0xeecb('0x3e')](_0x2b5f92['id'][_0xeecb('0x40')](),_0x264e85)['field'](_0xeecb('0x3f'),_0xeecb('0x41'))[_0xeecb('0x3e')](_0xeecb('0x3f'),_0xeecb('0x3c'))[_0xeecb('0x42')](_0xeecb('0x43'))[_0xeecb('0x44')]('deletedAt\x20IS\x20NULL')[_0xeecb('0x44')]('ListId\x20=\x20?',LISTID['toString']())[_0xeecb('0x44')](_0xeecb('0x45'))[_0xeecb('0x44')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'))[_0xeecb('0x42')](_0xeecb('0x38'))[_0xeecb('0x44')](_0x264e85+_0xeecb('0x47'),_0x2b5f92['id'][_0xeecb('0x40')]())))[_0xeecb('0x40')]();return _0x33c37a;};var _0x3a30ec=function(_0x8c41a9,_0x1a9c80){var _0x300eef=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x38'))['fromQuery']([_0xeecb('0x22'),'scheduledAt',_0xeecb('0x3b'),_0xeecb('0x29'),_0x1a9c80,'createdAt',_0xeecb('0x3c')],squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'),_0xeecb('0x22'))[_0xeecb('0x3e')]('NOW()',_0xeecb('0x3a'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))['field'](LISTID[_0xeecb('0x40')](),'ListId')[_0xeecb('0x3e')](_0x8c41a9['id'][_0xeecb('0x40')](),_0x1a9c80)['field'](_0xeecb('0x3f'),_0xeecb('0x41'))['field'](_0xeecb('0x3f'),_0xeecb('0x3c'))['from'](_0xeecb('0x43'))[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')](_0xeecb('0x4a'),squel['str'](hopperContacts))[_0xeecb('0x44')](_0xeecb('0x45'))[_0xeecb('0x44')](_0xeecb('0x46'),squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x4b'))[_0xeecb('0x42')](_0xeecb('0x4c'))['where'](_0x1a9c80+_0xeecb('0x47'),_0x8c41a9['id']['toString']()))[_0xeecb('0x44')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'))[_0xeecb('0x42')]('cm_hopper')[_0xeecb('0x44')](_0x1a9c80+_0xeecb('0x47'),_0x8c41a9['id']['toString']())))[_0xeecb('0x40')]();return _0x300eef;};function _0x45972f(_0x30ef2f,_0x3494ef){var _0xd1a77b=squel['insert']()[_0xeecb('0x37')](_0xeecb('0x38'))['fromQuery']([_0xeecb('0x22'),_0xeecb('0x3a'),'ContactId',_0xeecb('0x29'),_0x3494ef,_0xeecb('0x41'),_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x22'),'phone')['field'](_0xeecb('0x3f'),_0xeecb('0x3a'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID[_0xeecb('0x40')](),_0xeecb('0x29'))[_0xeecb('0x3e')](_0x30ef2f['id']['toString'](),_0x3494ef)[_0xeecb('0x3e')]('NOW()',_0xeecb('0x41'))['field'](_0xeecb('0x3f'),'updatedAt')[_0xeecb('0x42')]('cm_contacts')[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')](_0xeecb('0x4a'),squel[_0xeecb('0x4d')](hopperContacts))[_0xeecb('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xeecb('0x40')]();return _0xd1a77b;}function _0x759dbc(_0x41e29f,_0x52c5cd){var _0x3a9714=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x4e'))[_0xeecb('0x39')]([_0xeecb('0x22'),_0xeecb('0x3b'),'ListId',_0x52c5cd,_0xeecb('0x41'),_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')]('phone',_0xeecb('0x22'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID[_0xeecb('0x40')](),'ListId')[_0xeecb('0x3e')](_0x41e29f['id'][_0xeecb('0x40')](),_0x52c5cd)[_0xeecb('0x3e')](_0xeecb('0x3f'),_0xeecb('0x41'))[_0xeecb('0x3e')](_0xeecb('0x3f'),'updatedAt')[_0xeecb('0x42')]('cm_contacts')[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')]('id\x20IN\x20?',squel[_0xeecb('0x4d')](hopperContacts))['where'](_0xeecb('0x45')))['toString']();return _0x3a9714;}return db[_0xeecb('0x4f')]['findAll']({'where':{'type':_0xeecb('0x50')},'attributes':['id',_0xeecb('0x51')],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x53'),'where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x1a0b5c){var _0x2f58c4=[];if(_0x1a0b5c){var _0x292d17;for(var _0x4c4104=0x0,_0x530a93;_0x4c4104<_0x1a0b5c['length'];_0x4c4104+=0x1){_0x530a93=_0x1a0b5c[_0x4c4104]['get']({'plain':!![]});switch(_0x530a93[_0xeecb('0x51')]){case _0xeecb('0x54'):_0x2f58c4[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x3a30ec(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;case'onlyIfOpen':_0x2f58c4[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x4f7a2a(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;default:_0x2f58c4['push'](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x45972f(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}}return _0x2f58c4;})[_0xeecb('0x59')]()['then'](function(){return db[_0xeecb('0x4f')][_0xeecb('0x5a')]({'where':{'type':_0xeecb('0x50')},'attributes':['id'],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x5b'),'where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x509566){var _0xff2009=[];if(_0x509566){var _0x3aa1d1;for(var _0x59f1aa=0x0,_0x111d02;_0x59f1aa<_0x509566[_0xeecb('0x1b')];_0x59f1aa+=0x1){_0x111d02=_0x509566[_0x59f1aa][_0xeecb('0x5c')]({'plain':!![]});_0xff2009[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x759dbc(_0x111d02,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})['catch'](_0x1cf5e6()));}}return _0xff2009;})['all']();})[_0xeecb('0x31')](function(){return db[_0xeecb('0x5d')][_0xeecb('0x5a')]({'attributes':['id',_0xeecb('0x51')],'include':[{'model':db[_0xeecb('0x52')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x455aa2){var _0x49c129=[];if(_0x455aa2){for(var _0x2a27e4=0x0,_0x558474;_0x2a27e4<_0x455aa2[_0xeecb('0x1b')];_0x2a27e4+=0x1){_0x558474=_0x455aa2[_0x2a27e4]['get']({'plain':!![]});switch(_0x558474['dialCheckDuplicateType']){case'always':_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x3a30ec(_0x558474,_0xeecb('0x5e')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;case _0xeecb('0x5f'):_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x4f7a2a(_0x558474,'CampaignId'))['then'](function(){})['catch'](_0x1cf5e6()));break;default:_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x45972f(_0x558474,'CampaignId'))['then'](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}}return _0x49c129;})[_0xeecb('0x59')]();})[_0xeecb('0x31')](function(){return db[_0xeecb('0x5d')][_0xeecb('0x5a')]({'attributes':['id'],'include':[{'model':db[_0xeecb('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x45f4c3){var _0x1d33f6=[];if(_0x45f4c3){for(var _0x48702d=0x0,_0x547e16;_0x48702d<_0x45f4c3[_0xeecb('0x1b')];_0x48702d+=0x1){_0x547e16=_0x45f4c3[_0x48702d]['get']({'plain':!![]});_0x1d33f6['push'](db['sequelize']['query'](_0x759dbc(_0x547e16,_0xeecb('0x5e')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}return _0x1d33f6;})['all']();})[_0xeecb('0x58')](function(_0x5a099e){logger[_0xeecb('0x15')]('cmContact,\x20%s,\x20%s',_0xeecb('0x60'),_0x5a099e['message']);});}var processPromises=function(_0x5ea4e4){return BPromise[_0xeecb('0x59')](promises)[_0xeecb('0x31')](function(_0x469ac0){})[_0xeecb('0x58')](function(_0x4e6893){logger['error'](_0xeecb('0x61'),JSON[_0xeecb('0x33')](_0x4e6893));})[_0xeecb('0x62')](function(){socket[_0xeecb('0x63')](_0xeecb('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5ea4e4){return _0x5ea4e4[_0xeecb('0x65')]();}});};var endCsv=function(){return BPromise[_0xeecb('0x66')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xeecb('0x63')](_0xeecb('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5f5935){logger[_0xeecb('0x15')](_0xeecb('0x67'),JSON[_0xeecb('0x33')](_0x5f5935));}finally{process[_0xeecb('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0xeecb('0x69')](_0xeecb('0x6a'));endCsv();});function main(){return BPromise[_0xeecb('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xeecb('0x12')](',');return db[_0xeecb('0x2e')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeecb('0x31')](function(_0x3f9ec5){var _0x5855dc=fs[_0xeecb('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeecb('0x6c')](_0x5855dc,{'header':!![],'skipEmptyLines':!![],'step':function(_0x380f7e,_0x274318){total+=0x1;var _0xe65b08=total;promises[_0xeecb('0x32')](checkRow(_0x380f7e,_0x3f9ec5,_0xe65b08)[_0xeecb('0x31')](function(){success+=0x1;})[_0xeecb('0x58')](function(_0xba38f2){if(_0xba38f2['error']){errors+=0x1;delete _0xba38f2[_0xeecb('0x15')];}else if(_0xba38f2[_0xeecb('0x2c')]){duplicates+=0x1;delete _0xba38f2[_0xeecb('0x2c')];}rows[_0xeecb('0x32')](_0xba38f2);}));if(total%0xc8===0x0){_0x274318['pause']();return processPromises(_0x274318);}},'complete':function(){return processPromises()['then'](function(){logger[_0xeecb('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x213248,_0x36d813){logger[_0xeecb('0x69')](_0xeecb('0x6d'),JSON[_0xeecb('0x33')](_0x213248));endCsv();}});})[_0xeecb('0x58')](function(_0x8b49a4){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xeecb('0x33')](_0x8b49a4));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1a70dfa..a69dab2 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 _0x4af8=['ContactId','ListId','createdAt','updatedAt','priority','UserId','cm_contacts','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.createdAt','cm_hopper_black','fields','cm_contacts.createdAt\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','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','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','sequelize','query','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','root','server/files/tmp','.csv','header','ContactItemType','name','_description','writeFileSync','createReadStream','data','hasOwnProperty','replace','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)','timezones','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','contactTypeId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','argv','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','push','all','split','length','isNil','filter','CmContactHasItem','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat'];(function(_0x47e47a,_0x2b769b){var _0x4eaa5c=function(_0x55c689){while(--_0x55c689){_0x47e47a['push'](_0x47e47a['shift']());}};_0x4eaa5c(++_0x2b769b);}(_0x4af8,0x81));var _0x84af=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x4af8[_0x4ae625];return _0x31accf;};'use strict';var fs=require('fs');var path=require(_0x84af('0x0'));var _=require(_0x84af('0x1'));var Papa=require(_0x84af('0x2'));var util=require(_0x84af('0x3'));var BPromise=require(_0x84af('0x4'));var moment=require(_0x84af('0x5'));var squel=require(_0x84af('0x6'));var Redis=require(_0x84af('0x7'));var db=require(_0x84af('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0x84af('0x9'));var logger=require(_0x84af('0xa'))(_0x84af('0xb'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x84af('0xc'))(new Redis(config[_0x84af('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x84af('0xe')](_0x84af('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x84af('0xf'));function isEmail(_0x32e89f){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))*$/[_0x84af('0x10')](_0x32e89f);}function selectNotIn(_0x1e82ce,_0x4a3060,_0x288b4c,_0x13ca2c,_0x3fd098){return squel[_0x84af('0x11')]()[_0x84af('0x12')]('phone')[_0x84af('0x13')](_0x13ca2c)[_0x84af('0x14')](_0x4a3060,null,_0x4a3060+_0x84af('0x15')+_0x13ca2c+'.'+_0x288b4c)[_0x84af('0x16')](_0x13ca2c+'.'+_0x288b4c+_0x84af('0x17')+_0x1e82ce+'.'+_0x288b4c)['where'](_0x4a3060+'.dialCheckDuplicateType\x20IN\x20('+_0x3fd098[_0x84af('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3b45e6,_0xbd68e3){promisesAdditionalPhones=[];return db[_0x84af('0x18')][_0x84af('0x19')]({'raw':!![],'attributes':['id',_0x84af('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x84af('0x1b')](function(_0x1ae9d5){if(_0x1ae9d5!==null){var _0x250259=[];for(var _0x4668e4=0x0;_0x4668e4<_0x1ae9d5['length'];_0x4668e4++){var _0x4df05f=_0x1ae9d5[_0x4668e4];_0x250259[_0x84af('0x1c')](insertAdditionalPhones(_0x4df05f));}}Promise[_0x84af('0x1d')](_0x250259)[_0x84af('0x1b')](function(){_0x3b45e6({'val':0x1});});});});}function insertAdditionalPhones(_0x19ccf4){return new Promise(function(_0x1425c1,_0x219e95){var _0x173f41=_0x19ccf4['AdditionalPhones'];var _0x38fabc=_0x173f41[_0x84af('0x1e')](';');var _0x259c10=[];orderBy=0x0;for(var _0x77995a=0x0;_0x77995a<_0x38fabc[_0x84af('0x1f')];_0x77995a++){_0x259c10[_0x84af('0x1c')](splitAdditionalPhone(_0x19ccf4['id'],_0x38fabc[_0x77995a]));}Promise[_0x84af('0x1d')](_0x259c10)['then'](function(){_0x1425c1({'val':_0x38fabc[_0x84af('0x1f')]});});});}function splitAdditionalPhone(_0x1b5871,_0x2befc9){return new Promise(function(_0x50f5ba,_0x54f1aa){var _0x36ab49=_0x2befc9[_0x84af('0x1e')](':');var _0xe38928=_0x36ab49[0x0];var _0x2fceba=_0x36ab49[0x1];if(!_[_0x84af('0x20')](_0x2fceba)){var _0x40baab=_0x2fceba[_0x84af('0x1e')]('|');var _0x50de0b=[];for(var _0x28c39b=0x0;_0x28c39b<_0x40baab['length'];_0x28c39b++){if(_0x40baab[_0x28c39b]!==''){var _0x2b9b54=_[_0x84af('0x21')](promisesAdditionalPhones,{'contactId':_0x1b5871,'phone':_0x40baab[_0x28c39b]});if(_0x2b9b54['length']==0x0){orderBy++;promisesAdditionalPhones[_0x84af('0x1c')]({'contactId':_0x1b5871,'contactTypeId':_0xe38928,'phone':_0x40baab[_0x28c39b],'orderBy':orderBy});}}}_0x50f5ba({'ok':0x1});}else _0x50f5ba({'res':0x0});});}function createAdditionalPhone(_0x18ef6b,_0x3b3b95,_0x117a2c,_0x21d2da){var _0x4a0132='';var _0x145aa8='';var _0x6fcaed=_0x117a2c['split']('§');_0x4a0132=_0x6fcaed[0x0];if(_0x6fcaed[_0x84af('0x1f')]==0x2)_0x145aa8=_0x6fcaed[0x1];return new Promise(function(_0x5dfe10,_0x244f97){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x18ef6b,'item':_0x4a0132}})[_0x84af('0x1b')](function(_0xa7d4b5){if(_0xa7d4b5){return db[_0x84af('0x22')]['update']({'ItemTypeId':_0x3b3b95,'description':_0x145aa8,'OrderBy':_0x21d2da},{'where':{'CmContactId':_0x18ef6b,'item':_0x4a0132}})['then'](function(_0x95453a){_0x5dfe10({'res':_0x84af('0x23')});});}else{return db[_0x84af('0x22')][_0x84af('0x24')]({'CmContactId':_0x18ef6b,'item':_0x4a0132,'description':_0x145aa8,'ItemTypeId':_0x3b3b95,'OrderBy':_0x21d2da,'ItemClass':_0x84af('0x25')})[_0x84af('0x1b')](function(_0x2fa1e1){_0x5dfe10({'res':_0x84af('0x26')});});}});});}function insertCmHopper(_0x2ea920,_0x1015fb,_0x48183f,_0xdbf2d2,_0x2f74e6){var _0x5e34b5=[_0x84af('0x27'),'cm_contacts.scheduledat',_0x84af('0x28'),_0x84af('0x29'),_0x1015fb+'.'+_0xdbf2d2,'cm_contacts.createdAt',_0x84af('0x2a'),'cm_contacts.priority',_0x84af('0x2b'),'\x22'+_0x2f74e6+'\x22'];return squel[_0x84af('0x2c')]()[_0x84af('0x2d')](_0x84af('0x2e'))[_0x84af('0x2f')]([_0x84af('0x30'),_0x84af('0x31'),_0x84af('0x32'),_0x84af('0x33'),_0xdbf2d2,_0x84af('0x34'),_0x84af('0x35'),_0x84af('0x36'),_0x84af('0x37'),'recallme'],squel['select']()['fields'](_0x5e34b5)[_0x84af('0x13')](_0x1015fb)[_0x84af('0x14')](_0x84af('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x1015fb+_0x84af('0x39'))[_0x84af('0x14')](_0x48183f,null,_0x48183f+_0x84af('0x15')+_0x1015fb+'.'+_0xdbf2d2)[_0x84af('0x16')](_0x1015fb+'.CmListId\x20=\x20?',_0x2ea920)[_0x84af('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x84af('0x16')](_0x84af('0x3a'),selectNotIn(_0x1015fb,_0x48183f,_0xdbf2d2,_0x84af('0x2e'),['\x22always\x22',_0x84af('0x3b')]))[_0x84af('0x16')](_0x84af('0x3a'),selectNotIn(_0x1015fb,_0x48183f,_0xdbf2d2,'cm_hopper',[_0x84af('0x3c')])))[_0x84af('0x3d')]();}function insertCmHopperBlack(_0x3f195d,_0x16ae75,_0x3419a6,_0x575d55){var _0x3e8d63=[_0x84af('0x27'),_0x84af('0x28'),_0x84af('0x29'),_0x16ae75+'.'+_0x575d55,_0x84af('0x3e'),'cm_contacts.updatedAt'];return squel[_0x84af('0x2c')]()[_0x84af('0x2d')](_0x84af('0x3f'))[_0x84af('0x2f')]([_0x84af('0x30'),_0x84af('0x32'),'ListId',_0x575d55,'createdAt',_0x84af('0x35')],squel[_0x84af('0x11')]()[_0x84af('0x40')](_0x3e8d63)[_0x84af('0x13')](_0x16ae75)[_0x84af('0x14')](_0x84af('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x16ae75+'.CmListId')[_0x84af('0x14')](_0x3419a6,null,_0x3419a6+_0x84af('0x15')+_0x16ae75+'.'+_0x575d55)[_0x84af('0x16')](_0x16ae75+'.CmListId\x20=\x20?',_0x3f195d)[_0x84af('0x16')](_0x84af('0x41'),NOW)[_0x84af('0x16')](_0x84af('0x3a'),squel[_0x84af('0x11')]()[_0x84af('0x12')](_0x84af('0x30'))[_0x84af('0x13')](_0x84af('0x3f'))[_0x84af('0x16')]('ListId\x20=\x20?',_0x3f195d)[_0x84af('0x16')](_0x575d55+_0x84af('0x17')+_0x16ae75+'.'+_0x575d55)))[_0x84af('0x3d')]();}function insertTzCmHopper(_0xb7d47e,_0x35c132,_0x5d5472,_0x1a51a7,_0x4895b0,_0xec390d){var _0x341e70=[_0x84af('0x27'),_0x84af('0x42')+_0xec390d+_0x84af('0x43'),_0x84af('0x28'),_0x84af('0x29'),_0x35c132+'.'+_0x1a51a7,_0x84af('0x3e'),_0x84af('0x2a'),_0x84af('0x44'),_0x84af('0x2b'),'\x22'+_0x4895b0+'\x22'];var _0x5b7dfd=squel['insert']()['into'](_0x84af('0x2e'))[_0x84af('0x2f')]([_0x84af('0x30'),_0x84af('0x31'),_0x84af('0x32'),'ListId',_0x1a51a7,'createdAt','updatedAt','priority',_0x84af('0x37'),'recallme'],squel[_0x84af('0x11')]()[_0x84af('0x40')](_0x341e70)[_0x84af('0x13')](_0x35c132)[_0x84af('0x14')](_0x84af('0x38'),null,_0x84af('0x45')+_0x35c132+_0x84af('0x39'))[_0x84af('0x14')](_0x5d5472,null,_0x5d5472+_0x84af('0x15')+_0x35c132+'.'+_0x1a51a7)[_0x84af('0x14')](_0xec390d,null,_0xec390d+_0x84af('0x15')+_0x35c132+'.'+_0x1a51a7)[_0x84af('0x16')](_0x35c132+_0x84af('0x46'),_0xb7d47e)[_0x84af('0x16')](_0x84af('0x41'),NOW)[_0x84af('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x35c132,_0x5d5472,_0x1a51a7,_0x84af('0x2e'),[_0x84af('0x3c'),'\x22onlyIfOpen\x22']))[_0x84af('0x16')](_0x84af('0x3a'),selectNotIn(_0x35c132,_0x5d5472,_0x1a51a7,_0x84af('0x2e'),[_0x84af('0x3c')])))['toString']();return _0x5b7dfd;}function insertTzCmHopperBlack(_0x1f444c,_0xc171d2,_0x43aeda,_0x2792ed){var _0x43b131=[_0x84af('0x27'),_0x84af('0x28'),_0x84af('0x29'),_0xc171d2+'.'+_0x2792ed,'cm_contacts.createdAt',_0x84af('0x2a')];return squel[_0x84af('0x2c')]()[_0x84af('0x2d')](_0x84af('0x3f'))[_0x84af('0x2f')](['phone','ContactId',_0x84af('0x33'),_0x2792ed,_0x84af('0x34'),_0x84af('0x35')],squel[_0x84af('0x11')]()['fields'](_0x43b131)[_0x84af('0x13')](_0xc171d2)[_0x84af('0x14')](_0x84af('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0xc171d2+'.CmListId')[_0x84af('0x14')](_0x43aeda,null,_0x43aeda+_0x84af('0x15')+_0xc171d2+'.'+_0x2792ed)[_0x84af('0x16')](_0xc171d2+_0x84af('0x46'),_0x1f444c)[_0x84af('0x16')](_0x84af('0x41'),NOW)[_0x84af('0x16')](_0x84af('0x3a'),squel['select']()[_0x84af('0x12')](_0x84af('0x30'))[_0x84af('0x13')](_0x84af('0x3f'))[_0x84af('0x16')](_0x84af('0x47'),_0x1f444c)[_0x84af('0x16')](_0x2792ed+_0x84af('0x17')+_0xc171d2+'.'+_0x2792ed)))[_0x84af('0x3d')]();}function insertCmHopperAdditionalPhones(_0x2e4159){var _0x5133bf=[_0x84af('0x48'),_0x84af('0x49'),_0x84af('0x4a'),_0x84af('0x4b'),_0x84af('0x4c')];return squel[_0x84af('0x2c')]()[_0x84af('0x2d')]('cm_hopper_additional_phones')[_0x84af('0x2f')]([_0x84af('0x4d'),_0x84af('0x30'),_0x84af('0x4e'),_0x84af('0x34'),_0x84af('0x35')],squel[_0x84af('0x11')]()[_0x84af('0x40')](_0x5133bf)[_0x84af('0x13')](_0x84af('0x2e'))[_0x84af('0x14')](_0x84af('0x38'),null,_0x84af('0x4f'))[_0x84af('0x14')](_0x84af('0x50'),null,_0x84af('0x51'))['where'](_0x84af('0x52'),_0x2e4159)[_0x84af('0x16')](_0x84af('0x41'),NOW))[_0x84af('0x3d')]();}function insertCmContact(_0x9430e5,_0x4848a2,_0x404db6,_0x527121){var _0x2479a7=_[_0x84af('0x53')](_[_0x84af('0x54')](_0x527121),[_0x84af('0x33'),_0x84af('0x55'),_0x84af('0x34'),_0x84af('0x35')]);return squel['insert']()[_0x84af('0x2d')]('cm_contacts')['fromQuery'](_0x2479a7,squel[_0x84af('0x11')]()[_0x84af('0x40')](_0x2479a7)[_0x84af('0x13')](_0x4848a2)['where']('('+_0x404db6[_0x84af('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x404db6)['from'](_0x84af('0x38'))[_0x84af('0x16')](_0x84af('0x47'),_0x9430e5)[_0x84af('0x16')](_0x84af('0x56')))[_0x84af('0x16')](_0x84af('0x57'),squel['select']()[_0x84af('0x12')](_0x84af('0x58'),_0x84af('0x59'))[_0x84af('0x13')](_0x4848a2)[_0x84af('0x5a')](_0x404db6[_0x84af('0x14')](','))))[_0x84af('0x3d')]();}function handleStop(){logger[_0x84af('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x414ac8){logger[_0x84af('0x5c')](_0x414ac8[_0x84af('0x5d')]);process[_0x84af('0x5e')](0x1);}function handleError(_0x2e06c5,_0x2c5025){stats[_0x84af('0x5f')]['push']({'name':_0x2c5025['code'],'message':_0x2c5025[_0x84af('0x5d')],'row':_0x2e06c5});}function handleQuery(_0x22c3fb){logger[_0x84af('0x5b')](_0x22c3fb);return db[_0x84af('0x60')][_0x84af('0x61')](_0x22c3fb)['spread'](function(_0xcf38fd){results[_0x84af('0x1c')](_0xcf38fd);})[_0x84af('0x62')](function(_0x32a72a){logger[_0x84af('0x5c')](_0x32a72a[_0x84af('0x5d')]);});}function updateTzCampaigns(_0x25d27a){return new Promise(function(_0x310f0d,_0x2f81f1){var _0x2482b3=squel[_0x84af('0x11')]()[_0x84af('0x40')]([_0x84af('0x63'),_0x84af('0x64')])[_0x84af('0x13')](_0x84af('0x65'))[_0x84af('0x14')]('campaigns_has_cm_lists',null,_0x84af('0x66'))[_0x84af('0x16')]('campaigns_has_cm_lists.CmListId='+_0x25d27a);db['sequelize'][_0x84af('0x61')](_0x2482b3['toString']())[_0x84af('0x67')](function(_0xd5ae44){var _0x305b18=[];for(var _0x14e935=0x0;_0x14e935<_0xd5ae44[_0x84af('0x1f')];_0x14e935++){_0x305b18[_0x84af('0x1c')](getTimezoneData(_0xd5ae44[_0x14e935],tmp_campaigns));}BPromise[_0x84af('0x1d')](_0x305b18)[_0x84af('0x1b')](function(){_0x310f0d({'val':0x1});});})[_0x84af('0x62')](function(_0x5e6425){logger[_0x84af('0x5c')](_0x5e6425['message']);_0x310f0d({'val':0x0});});});}function updateTzVoiceQueues(_0x5aed9a){return new Promise(function(_0x302269,_0x54a8a){var _0x5d8b7a=squel[_0x84af('0x11')]()['fields']([_0x84af('0x68'),_0x84af('0x69')])[_0x84af('0x13')](_0x84af('0x6a'))['join'](_0x84af('0x6b'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x84af('0x16')](_0x84af('0x6c')+_0x5aed9a);db[_0x84af('0x60')]['query'](_0x5d8b7a[_0x84af('0x3d')]())[_0x84af('0x67')](function(_0x6bce65){var _0x23b2e5=[];for(var _0x50780f=0x0;_0x50780f<_0x6bce65[_0x84af('0x1f')];_0x50780f++){_0x23b2e5['push'](getTimezoneData(_0x6bce65[_0x50780f],tmp_voice_queues));}BPromise[_0x84af('0x1d')](_0x23b2e5)[_0x84af('0x1b')](function(){_0x302269({'val':0x1});});})[_0x84af('0x62')](function(_0x4e18fa){logger['error'](_0x4e18fa[_0x84af('0x5d')]);_0x302269({'val':0x0});});});}function getTimezoneData(_0x192e0c,_0x4f6a63){return new Promise(function(_0x5630db,_0x56bb69){var _0x32de79=shared['timezones'];var _0x9ff8b4=_0x32de79[_0x192e0c[_0x84af('0x6d')]];if(_['isNil'](_0x9ff8b4)){_0x5630db({'ret':0x1});}else{var _0xc7f082=_0x9ff8b4[_0x84af('0x6e')];var _0x1980df=squel[_0x84af('0x2c')]()[_0x84af('0x2d')](_0x4f6a63)[_0x84af('0x6f')]('id',_0x192e0c['id'])[_0x84af('0x6f')](_0x84af('0x70'),_0xc7f082)[_0x84af('0x6f')](_0x84af('0x6d'),_0x192e0c[_0x84af('0x6d')])[_0x84af('0x3d')]();return db[_0x84af('0x60')][_0x84af('0x61')](_0x1980df)['spread'](function(_0x3565e7){_0x5630db({'ret':0x1});})['catch'](function(_0x11573e){logger[_0x84af('0x5c')](_0x11573e[_0x84af('0x5d')]);_0x56bb69({'ret':0x1});});}});}function handleTZQuery(_0x7df0ed){logger[_0x84af('0x5b')](_0x7df0ed);return db['sequelize'][_0x84af('0x61')](_0x7df0ed)[_0x84af('0x67')](function(_0x2307c0){})[_0x84af('0x62')](function(_0x715d0d){logger[_0x84af('0x5c')](_0x715d0d[_0x84af('0x5d')]);});}function main(_0x2a29fd,_0x3f53e0,_0x127ab1,_0x43c798){logger[_0x84af('0x5b')](_0x84af('0x71'),_0x2a29fd,JSON[_0x84af('0x72')](_0x3f53e0));process[_0x84af('0x73')](_0x84af('0x74'));var _0x467385=_0x3f53e0[_0x84af('0x75')];var _0x58a70e=_['clone'](_0x467385);var _0x2ca9c0=_0x3f53e0['socket_timestamp'];var _0x3badbb=path[_0x84af('0x14')](config[_0x84af('0x76')],_0x84af('0x77'),_0x2ca9c0+_0x84af('0x78'));hasTZ=_[_0x84af('0x54')](_0x467385)['includes'](_0x84af('0x6d'));var _0x4cc3dd=_['keys'](_0x467385)[_0x84af('0x14')]();logger[_0x84af('0x5b')](_0x84af('0x79'),_0x4cc3dd);db[_0x84af('0x7a')][_0x84af('0x19')]({'raw':!![],'attributes':['id','name']})[_0x84af('0x1b')](function(_0x16e563){for(var _0x3e6545=0x0;_0x3e6545<_0x16e563[_0x84af('0x1f')];_0x3e6545++){if(_0x16e563[_0x3e6545]['name']in _0x467385){contactItemTypes[_0x84af('0x1c')](_0x16e563[_0x3e6545]);delete _0x58a70e[_0x16e563[_0x3e6545][_0x84af('0x7b')]];hasAdditionalPhones=!![];}for(var _0x2b563d in _0x467385){if(_0x16e563[_0x3e6545]['name']+_0x84af('0x7c')===_0x2b563d){phoneDescriptions['push']({'itemTypeId':_0x16e563[_0x3e6545]['id'],'description':_0x2b563d});delete _0x58a70e[_0x2b563d];}}}if(hasAdditionalPhones)_0x58a70e[_0x84af('0x1a')]='';var _0x124892=_[_0x84af('0x54')](_0x58a70e)[_0x84af('0x14')]();logger[_0x84af('0x5b')](_0x84af('0x79'),_0x124892);fs[_0x84af('0x7d')](_0x3badbb,_0x124892+'\x0a');Papa['parse'](fs[_0x84af('0x7e')](_0x2a29fd),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c5671,_0x341a01){try{for(var _0x6295ed=0x0,_0x508c82=[];_0x6295ed<_0x2c5671[_0x84af('0x7f')][_0x84af('0x1f')];_0x6295ed++){stats['rows']+=0x1;if(_0x2c5671[_0x84af('0x5f')][_0x6295ed]){handleError(_0x2c5671['data'][_0x6295ed],_0x2c5671['errors'][_0x6295ed]);}else{var _0xae75d0=[];var _0x3d5467=[];var _0x25b238={};for(var _0x5188de in _0x467385){let _0x3bc3c2=contactItemTypes['find'](_0x17053e=>_0x17053e[_0x84af('0x7b')]===_0x5188de);let _0x17f5af=contactItemTypes['find'](_0xb7b1ea=>_0xb7b1ea[_0x84af('0x7b')]+_0x84af('0x7c')===_0x5188de);if(_[_0x84af('0x20')](_0x3bc3c2)&&_[_0x84af('0x20')](_0x17f5af)){if(_0x467385[_0x84af('0x80')](_0x5188de)){if(_0x2c5671[_0x84af('0x7f')][_0x6295ed][_0x467385[_0x5188de]]){var _0x18c3d9=_['trim'](_0x2c5671[_0x84af('0x7f')][_0x6295ed][_0x467385[_0x5188de]][_0x84af('0x81')](/"/g,'\x27'));switch(_0x5188de){case _0x84af('0x31'):var _0x48dfbe=moment(_0x18c3d9,_0x84af('0xf'),!![]);if(_0x48dfbe[_0x84af('0x82')]()){_0x508c82[_0x84af('0x1c')]('\x22'+_0x18c3d9+'\x22');}else{_0xae75d0[_0x84af('0x1c')](_0x84af('0x83'));}break;case'priority':var _0x176efc=parseInt(_0x18c3d9);_0x18c3d9=_[_0x84af('0x84')](_0x176efc)||_0x176efc<0x0||_0x176efc>0x4?_0x43c798?0x3:0x2:_0x176efc;_0x508c82['push']('\x22'+_0x18c3d9+'\x22');break;case _0x84af('0x37'):var _0x1363a8=parseInt(_0x18c3d9);if(_[_0x84af('0x85')](_0x1363a8)&&_['includes'](_0x127ab1,_0x1363a8)){_0x508c82[_0x84af('0x1c')]('\x22'+_0x1363a8+'\x22');}else{_0xae75d0[_0x84af('0x1c')](_0x84af('0x86'));}break;case'email':if(isEmail(_0x18c3d9)){_0x508c82['push']('\x22'+_0x18c3d9+'\x22');}else{_0xae75d0['push']('email\x20wrong\x20format');}break;case _0x84af('0x87'):var _0x1ea0ab=moment(_0x18c3d9,_0x84af('0x88'),!![]);if(_0x1ea0ab['isValid']()){_0x508c82[_0x84af('0x1c')]('\x22'+_0x18c3d9+'\x22');}else{_0xae75d0['push'](_0x84af('0x89'));}break;case _0x84af('0x6d'):var _0x31bb37=shared[_0x84af('0x8a')];var _0x3e107c=_0x31bb37[_0x18c3d9];if(!_['isNil'](_0x3e107c)){var _0x394b5d=_0x3e107c[_0x84af('0x6e')];_0x508c82[_0x84af('0x1c')]('\x22'+_0x18c3d9+'\x22');_0x508c82[_0x84af('0x1c')]('\x22'+_0x394b5d+'\x22');}break;default:_0x508c82['push']('\x22'+_0x18c3d9+'\x22');}}else{switch(_0x5188de){case _0x84af('0x8b'):case _0x84af('0x30'):_0xae75d0[_0x84af('0x1c')](_0x5188de+_0x84af('0x8c'));break;default:_0x508c82[_0x84af('0x1c')]('\x22\x22');}}}}else{var _0x46162d='';if(!_[_0x84af('0x20')](_0x3bc3c2)){if(!_0x25b238[_0x84af('0x80')](_0x3bc3c2['id'])){if(!_[_0x84af('0x20')](_0x2c5671[_0x84af('0x7f')][_0x6295ed][_0x467385[_0x5188de]])){var _0x18c3d9=_['trim'](_0x2c5671[_0x84af('0x7f')][_0x6295ed][_0x467385[_0x5188de]][_0x84af('0x81')](/"/g,'\x27'));var _0x2d32f1=phoneDescriptions['find'](_0x2fe81e=>_0x2fe81e[_0x84af('0x8d')]===_0x3bc3c2['id']);if(!_[_0x84af('0x20')](_0x2d32f1)){var _0x22d215=_['trim'](_0x2c5671[_0x84af('0x7f')][_0x6295ed][_0x467385[_0x2d32f1[_0x84af('0x8e')]]][_0x84af('0x81')](/"/g,'\x27'));if(!_[_0x84af('0x20')](_0x22d215))_0x18c3d9=_0x18c3d9+'§'+_0x22d215;}if(_0x46162d=='')_0x46162d=_0x18c3d9;else _0x46162d+='|'+_0x18c3d9;}_0x3d5467[_0x84af('0x1c')](_0x3bc3c2['id']+':'+_0x46162d);_0x25b238[_0x3bc3c2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x508c82[_0x84af('0x1c')]('\x22'+_0x3d5467[_0x84af('0x14')](';')+'\x22');}if(_0xae75d0[_0x84af('0x1f')]){handleError(_0x2c5671['data'][_0x6295ed],{'code':'SystemRow','message':_0xae75d0['join']()});}else{fs[_0x84af('0x8f')](_0x3badbb,_0x508c82[_0x84af('0x14')]()+'\x0a');}_0x508c82=[];}if(!(stats['rows']%0xc8)){socket[_0x84af('0x90')](_0x84af('0x91')+_0x2ca9c0,stats);stats['errors']=[];}}if(stopped){logger[_0x84af('0x5b')](_0x84af('0x92'));_0x341a01['abort']();}}catch(_0x13edc4){handleError(_0x2c5671['data'][_0x6295ed],{'code':_0x84af('0x93'),'message':_0x13edc4[_0x84af('0x5d')]});logger['error'](_0x84af('0x94'),_0x13edc4[_0x84af('0x5d')]);}},'complete':function(){try{var _0x55fedf=[];var _0x4dce51=[];var _0x42d9fd=_0x84af('0x38');if(_0x3f53e0['duplicates']&&_0x3f53e0['duplicates'][_0x84af('0x1f')]){_0x42d9fd='cm_contacts_'+_0x2ca9c0;_0x55fedf[_0x84af('0x1c')](_0x84af('0x95')+_0x42d9fd+_0x84af('0x96'));}tmp_campaigns=_0x84af('0x97')+_0x2ca9c0;tmp_voice_queues='voice_queues_'+_0x2ca9c0;_0x4dce51[_0x84af('0x1c')](_0x84af('0x95')+tmp_campaigns+_0x84af('0x98'));_0x4dce51[_0x84af('0x1c')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x84af('0x99')](_0x4dce51,handleTZQuery)[_0x84af('0x1b')](function(_0x14a3e8){updateTzCampaigns(_0x3f53e0[_0x84af('0x33')])[_0x84af('0x1b')](function(_0x39e806){updateTzVoiceQueues(_0x3f53e0[_0x84af('0x33')])['then'](function(_0x30f6d7){if(hasTZ)_0x124892=_0x124892['replace'](_0x84af('0x6d'),_0x84af('0x9a'));var _0x338555=util['format'](_0x84af('0x9b'),_0x3badbb,_0x42d9fd,_0x124892,_0x3f53e0[_0x84af('0x33')],_0x3f53e0[_0x84af('0x55')]||null,NOW,NOW);if(_['isNil'](_0x467385[_0x84af('0x31')])){_0x338555+=_0x84af('0x9c');}_0x55fedf[_0x84af('0x1c')](_0x338555);if(_0x3f53e0[_0x84af('0x9d')]&&_0x3f53e0[_0x84af('0x9d')][_0x84af('0x1f')]){_0x55fedf['push'](insertCmContact(_0x3f53e0[_0x84af('0x33')],_0x42d9fd,_0x3f53e0[_0x84af('0x9d')],_0x467385));_0x55fedf[_0x84af('0x1c')](_0x84af('0x9e')+_0x42d9fd+';');}BPromise[_0x84af('0x99')](_0x55fedf,handleQuery)[_0x84af('0x1b')](function(_0x18a828){BPromise['all']([handleAdditionalPhones()])[_0x84af('0x1b')](function(){_0x55fedf=[];for(var _0x3050f7=0x0;_0x3050f7\x20\x20');}var _0x949f0e=path[_0x84af('0x14')](config[_0x84af('0x76')],_0x84af('0x77'),process[_0x84af('0xa9')][0x2]);if(!fs[_0x84af('0xaa')](_0x949f0e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x371236={};try{_0x371236=JSON['parse'](process[_0x84af('0xa9')][0x3]);if(!_0x371236[_0x84af('0x75')]){throw new Error(_0x84af('0xab'));}if(!_0x371236['binding'][_0x84af('0x30')]){throw new Error(_0x84af('0xac'));}if(!_0x371236[_0x84af('0x75')][_0x84af('0x8b')]){throw new Error(_0x84af('0xad'));}var _0x587658=0x0;if(_0x371236[_0x84af('0x75')][_0x84af('0x37')]){_0x587658=0x1;}if(!_0x371236[_0x84af('0x33')]){throw new Error(_0x84af('0xae'));}}catch(_0x555c48){throw new Error(_0x84af('0xaf'));}var _0x252e98=[];try{_0x252e98=_[_0x84af('0xb0')](JSON[_0x84af('0xb1')](process[_0x84af('0xa9')][0x4]),'id');}catch(_0x1831e4){logger['info']('No\x20agent\x20available');}main(_0x949f0e,_0x371236,_0x252e98,_0x587658);}validate();process['on']('SIGINT',handleStop);process['on'](_0x84af('0xb2'),handleUncaughtException); \ No newline at end of file +var _0x9f62=['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','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','error','exit','errors','message','query','spread','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','catch','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=','dialTimezone','isNil','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','utcOffset','firstName','\x20not\x20specified','itemTypeId','trim','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','duplicates','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','then','length','push','all','AdditionalPhones','filter','split','findOne','CmContactHasItem','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','phone','cm_contacts','cm_hopper_black','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','ListId','\x22onlyIfOpen\x22','ContactId','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy'];(function(_0x2518d9,_0x154d81){var _0x84d4ad=function(_0x3cd44c){while(--_0x3cd44c){_0x2518d9['push'](_0x2518d9['shift']());}};_0x84d4ad(++_0x154d81);}(_0x9f62,0x12c));var _0x29f6=function(_0x5d8a13,_0x27aea5){_0x5d8a13=_0x5d8a13-0x0;var _0x4593c1=_0x9f62[_0x5d8a13];return _0x4593c1;};'use strict';var fs=require('fs');var path=require(_0x29f6('0x0'));var _=require(_0x29f6('0x1'));var Papa=require(_0x29f6('0x2'));var util=require(_0x29f6('0x3'));var BPromise=require(_0x29f6('0x4'));var moment=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var db=require(_0x29f6('0x8'))['db'];var config=require(_0x29f6('0x9'));var shared=require(_0x29f6('0xa'));var logger=require(_0x29f6('0xb'))('import');config['redis']=_[_0x29f6('0xc')](config[_0x29f6('0xd')],{'host':_0x29f6('0xe'),'port':0x18eb});var socket=require(_0x29f6('0xf'))(new Redis(config[_0x29f6('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x29f6('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x29f6('0x11')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x14395a){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))*$/[_0x29f6('0x12')](_0x14395a);}function selectNotIn(_0x1aecee,_0x4f6af5,_0x5347eb,_0x50c4e6,_0x548bf2){return squel['select']()[_0x29f6('0x13')]('phone')[_0x29f6('0x14')](_0x50c4e6)[_0x29f6('0x15')](_0x4f6af5,null,_0x4f6af5+_0x29f6('0x16')+_0x50c4e6+'.'+_0x5347eb)[_0x29f6('0x17')](_0x50c4e6+'.'+_0x5347eb+_0x29f6('0x18')+_0x1aecee+'.'+_0x5347eb)[_0x29f6('0x17')](_0x4f6af5+_0x29f6('0x19')+_0x548bf2[_0x29f6('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xd59009,_0x2c99e8){promisesAdditionalPhones=[];return db['CmContact'][_0x29f6('0x1a')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x29f6('0x1b')](function(_0x3a10cb){if(_0x3a10cb!==null){var _0x3005d5=[];for(var _0xa898b2=0x0;_0xa898b2<_0x3a10cb[_0x29f6('0x1c')];_0xa898b2++){var _0x3c9c98=_0x3a10cb[_0xa898b2];_0x3005d5[_0x29f6('0x1d')](insertAdditionalPhones(_0x3c9c98));}}Promise[_0x29f6('0x1e')](_0x3005d5)[_0x29f6('0x1b')](function(){_0xd59009({'val':0x1});});});});}function insertAdditionalPhones(_0x24976f){return new Promise(function(_0x2bb464,_0x1d7029){var _0x1a88d2=_0x24976f[_0x29f6('0x1f')];var _0x1535b5=_0x1a88d2['split'](';');var _0x143aa1=[];orderBy=0x0;for(var _0x43899d=0x0;_0x43899d<_0x1535b5[_0x29f6('0x1c')];_0x43899d++){_0x143aa1['push'](splitAdditionalPhone(_0x24976f['id'],_0x1535b5[_0x43899d]));}Promise[_0x29f6('0x1e')](_0x143aa1)['then'](function(){_0x2bb464({'val':_0x1535b5[_0x29f6('0x1c')]});});});}function splitAdditionalPhone(_0x33920a,_0x2042aa){return new Promise(function(_0x54d62a,_0x97c6ee){var _0x4eaa7a=_0x2042aa['split'](':');var _0x434339=_0x4eaa7a[0x0];var _0x184568=_0x4eaa7a[0x1];if(!_['isNil'](_0x184568)){var _0x541816=_0x184568['split']('|');var _0x563690=[];for(var _0x161d24=0x0;_0x161d24<_0x541816[_0x29f6('0x1c')];_0x161d24++){if(_0x541816[_0x161d24]!==''){var _0x2e42d9=_[_0x29f6('0x20')](promisesAdditionalPhones,{'contactId':_0x33920a,'phone':_0x541816[_0x161d24]});if(_0x2e42d9[_0x29f6('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x29f6('0x1d')]({'contactId':_0x33920a,'contactTypeId':_0x434339,'phone':_0x541816[_0x161d24],'orderBy':orderBy});}}}_0x54d62a({'ok':0x1});}else _0x54d62a({'res':0x0});});}function createAdditionalPhone(_0x222686,_0x2dfe05,_0xe962ea,_0x4dacbb){var _0x32230e='';var _0x3cf16c='';var _0x47fda2=_0xe962ea[_0x29f6('0x21')]('§');_0x32230e=_0x47fda2[0x0];if(_0x47fda2[_0x29f6('0x1c')]==0x2)_0x3cf16c=_0x47fda2[0x1];return new Promise(function(_0x35c055,_0x32fc62){return db['CmContactHasItem'][_0x29f6('0x22')]({'where':{'CmContactId':_0x222686,'item':_0x32230e}})['then'](function(_0xd01468){if(_0xd01468){return db[_0x29f6('0x23')][_0x29f6('0x24')]({'ItemTypeId':_0x2dfe05,'description':_0x3cf16c,'OrderBy':_0x4dacbb},{'where':{'CmContactId':_0x222686,'item':_0x32230e}})[_0x29f6('0x1b')](function(_0x2e7185){_0x35c055({'res':_0x29f6('0x25')});});}else{return db[_0x29f6('0x23')][_0x29f6('0x26')]({'CmContactId':_0x222686,'item':_0x32230e,'description':_0x3cf16c,'ItemTypeId':_0x2dfe05,'OrderBy':_0x4dacbb,'ItemClass':'PHONE'})[_0x29f6('0x1b')](function(_0x5b7aff){_0x35c055({'res':_0x29f6('0x27')});});}});});}function insertCmHopper(_0x2f3903,_0x461acf,_0x2abdde,_0xafbc68,_0x3cf834){var _0x1c6c41=[_0x29f6('0x28'),_0x29f6('0x29'),_0x29f6('0x2a'),_0x29f6('0x2b'),_0x461acf+'.'+_0xafbc68,_0x29f6('0x2c'),_0x29f6('0x2d'),'cm_contacts.priority',_0x29f6('0x2e'),'\x22'+_0x3cf834+'\x22'];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x31'))[_0x29f6('0x32')](['phone',_0x29f6('0x33'),'ContactId','ListId',_0xafbc68,_0x29f6('0x34'),_0x29f6('0x35'),_0x29f6('0x36'),_0x29f6('0x37'),_0x29f6('0x38')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x1c6c41)['from'](_0x461acf)[_0x29f6('0x15')]('cm_contacts',null,_0x29f6('0x3b')+_0x461acf+_0x29f6('0x3c'))[_0x29f6('0x15')](_0x2abdde,null,_0x2abdde+'.id\x20=\x20'+_0x461acf+'.'+_0xafbc68)[_0x29f6('0x17')](_0x461acf+_0x29f6('0x3d'),_0x2f3903)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x461acf,_0x2abdde,_0xafbc68,_0x29f6('0x31'),[_0x29f6('0x3f'),'\x22onlyIfOpen\x22']))[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x461acf,_0x2abdde,_0xafbc68,_0x29f6('0x31'),[_0x29f6('0x3f')])))[_0x29f6('0x41')]();}function insertCmHopperBlack(_0x4343af,_0x259d38,_0x2fa021,_0x4b854f){var _0x52feb1=[_0x29f6('0x28'),_0x29f6('0x2a'),'cm_contacts.ListId',_0x259d38+'.'+_0x4b854f,_0x29f6('0x2c'),_0x29f6('0x2d')];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')]('cm_hopper_black')[_0x29f6('0x32')]([_0x29f6('0x42'),'ContactId','ListId',_0x4b854f,'createdAt',_0x29f6('0x35')],squel['select']()[_0x29f6('0x3a')](_0x52feb1)['from'](_0x259d38)[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x3b')+_0x259d38+_0x29f6('0x3c'))[_0x29f6('0x15')](_0x2fa021,null,_0x2fa021+'.id\x20=\x20'+_0x259d38+'.'+_0x4b854f)['where'](_0x259d38+_0x29f6('0x3d'),_0x4343af)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')](_0x29f6('0x40'),squel['select']()['field']('phone')[_0x29f6('0x14')](_0x29f6('0x44'))[_0x29f6('0x17')]('ListId\x20=\x20?',_0x4343af)[_0x29f6('0x17')](_0x4b854f+_0x29f6('0x18')+_0x259d38+'.'+_0x4b854f)))['toString']();}function insertTzCmHopper(_0x44f4cc,_0x427c18,_0x16e367,_0xfd5e5f,_0x5c30cc,_0x39801a){var _0x14f5d0=[_0x29f6('0x28'),_0x29f6('0x45')+_0x39801a+_0x29f6('0x46'),_0x29f6('0x2a'),'cm_contacts.ListId',_0x427c18+'.'+_0xfd5e5f,_0x29f6('0x2c'),_0x29f6('0x2d'),'cm_contacts.priority',_0x29f6('0x2e'),'\x22'+_0x5c30cc+'\x22'];var _0x24abbe=squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x31'))[_0x29f6('0x32')]([_0x29f6('0x42'),_0x29f6('0x33'),'ContactId',_0x29f6('0x47'),_0xfd5e5f,_0x29f6('0x34'),_0x29f6('0x35'),_0x29f6('0x36'),_0x29f6('0x37'),_0x29f6('0x38')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x14f5d0)[_0x29f6('0x14')](_0x427c18)[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x3b')+_0x427c18+'.CmListId')[_0x29f6('0x15')](_0x16e367,null,_0x16e367+'.id\x20=\x20'+_0x427c18+'.'+_0xfd5e5f)['join'](_0x39801a,null,_0x39801a+'.id\x20=\x20'+_0x427c18+'.'+_0xfd5e5f)[_0x29f6('0x17')](_0x427c18+_0x29f6('0x3d'),_0x44f4cc)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x427c18,_0x16e367,_0xfd5e5f,'cm_hopper',[_0x29f6('0x3f'),_0x29f6('0x48')]))[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x427c18,_0x16e367,_0xfd5e5f,'cm_hopper',[_0x29f6('0x3f')])))[_0x29f6('0x41')]();return _0x24abbe;}function insertTzCmHopperBlack(_0x3ec4a1,_0x59bd34,_0x59f636,_0x560d9d){var _0x59ffb5=['cm_contacts.phone',_0x29f6('0x2a'),_0x29f6('0x2b'),_0x59bd34+'.'+_0x560d9d,'cm_contacts.createdAt',_0x29f6('0x2d')];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x44'))['fromQuery']([_0x29f6('0x42'),_0x29f6('0x49'),_0x29f6('0x47'),_0x560d9d,_0x29f6('0x34'),_0x29f6('0x35')],squel[_0x29f6('0x39')]()['fields'](_0x59ffb5)[_0x29f6('0x14')](_0x59bd34)[_0x29f6('0x15')](_0x29f6('0x43'),null,'cm_contacts.ListId\x20=\x20'+_0x59bd34+_0x29f6('0x3c'))['join'](_0x59f636,null,_0x59f636+_0x29f6('0x16')+_0x59bd34+'.'+_0x560d9d)['where'](_0x59bd34+_0x29f6('0x3d'),_0x3ec4a1)['where'](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x29f6('0x39')]()[_0x29f6('0x13')](_0x29f6('0x42'))[_0x29f6('0x14')](_0x29f6('0x44'))[_0x29f6('0x17')](_0x29f6('0x4a'),_0x3ec4a1)['where'](_0x560d9d+_0x29f6('0x18')+_0x59bd34+'.'+_0x560d9d)))[_0x29f6('0x41')]();}function insertCmHopperAdditionalPhones(_0xc7f76e){var _0x475f9c=[_0x29f6('0x4b'),'cm_contact_has_items.item',_0x29f6('0x4c'),_0x29f6('0x4d'),_0x29f6('0x4e')];return squel['insert']()['into'](_0x29f6('0x4f'))[_0x29f6('0x32')]([_0x29f6('0x50'),'phone',_0x29f6('0x51'),_0x29f6('0x34'),_0x29f6('0x35')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x475f9c)[_0x29f6('0x14')](_0x29f6('0x31'))[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x52'))['join'](_0x29f6('0x53'),null,_0x29f6('0x54'))[_0x29f6('0x17')](_0x29f6('0x55'),_0xc7f76e)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW))[_0x29f6('0x41')]();}function insertCmContact(_0x3cd01d,_0x32a11e,_0x365a47,_0x5a8665){var _0x432c49=_[_0x29f6('0x56')](_[_0x29f6('0x57')](_0x5a8665),[_0x29f6('0x47'),_0x29f6('0x58'),_0x29f6('0x34'),_0x29f6('0x35')]);return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x43'))[_0x29f6('0x32')](_0x432c49,squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x432c49)[_0x29f6('0x14')](_0x32a11e)['where']('('+_0x365a47[_0x29f6('0x15')](',')+_0x29f6('0x59'),squel['select']()[_0x29f6('0x3a')](_0x365a47)[_0x29f6('0x14')](_0x29f6('0x43'))[_0x29f6('0x17')](_0x29f6('0x4a'),_0x3cd01d)[_0x29f6('0x17')]('deletedAt\x20IS\x20NULL'))[_0x29f6('0x17')](_0x29f6('0x5a'),squel[_0x29f6('0x39')]()[_0x29f6('0x13')](_0x29f6('0x5b'),_0x29f6('0x5c'))[_0x29f6('0x14')](_0x32a11e)['group'](_0x365a47['join'](','))))[_0x29f6('0x41')]();}function handleStop(){logger[_0x29f6('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5d0cfe){logger[_0x29f6('0x5e')](_0x5d0cfe['message']);process[_0x29f6('0x5f')](0x1);}function handleError(_0x50f397,_0x46a94f){stats[_0x29f6('0x60')][_0x29f6('0x1d')]({'name':_0x46a94f['code'],'message':_0x46a94f[_0x29f6('0x61')],'row':_0x50f397});}function handleQuery(_0x2002a5){logger[_0x29f6('0x5d')](_0x2002a5);return db['sequelize'][_0x29f6('0x62')](_0x2002a5)[_0x29f6('0x63')](function(_0x315c48){results[_0x29f6('0x1d')](_0x315c48);})['catch'](function(_0x1fe1f1){logger[_0x29f6('0x5e')](_0x1fe1f1[_0x29f6('0x61')]);});}function updateTzCampaigns(_0x4bd4b6){return new Promise(function(_0x34b77d,_0x3064a5){var _0x5d2d91=squel[_0x29f6('0x39')]()['fields'](['campaigns.id',_0x29f6('0x64')])[_0x29f6('0x14')]('campaigns')[_0x29f6('0x15')](_0x29f6('0x65'),null,_0x29f6('0x66'))[_0x29f6('0x17')](_0x29f6('0x67')+_0x4bd4b6);db[_0x29f6('0x68')]['query'](_0x5d2d91[_0x29f6('0x41')]())[_0x29f6('0x63')](function(_0x404e2a){var _0x3290c5=[];for(var _0x112019=0x0;_0x112019<_0x404e2a['length'];_0x112019++){_0x3290c5[_0x29f6('0x1d')](getTimezoneData(_0x404e2a[_0x112019],tmp_campaigns));}BPromise['all'](_0x3290c5)[_0x29f6('0x1b')](function(){_0x34b77d({'val':0x1});});})[_0x29f6('0x69')](function(_0x2b09d8){logger[_0x29f6('0x5e')](_0x2b09d8['message']);_0x34b77d({'val':0x0});});});}function updateTzVoiceQueues(_0x2309ff){return new Promise(function(_0x77240e,_0x6ab3ca){var _0xfd5c2=squel['select']()[_0x29f6('0x3a')]([_0x29f6('0x6a'),_0x29f6('0x6b')])[_0x29f6('0x14')](_0x29f6('0x6c'))[_0x29f6('0x15')](_0x29f6('0x6d'),null,_0x29f6('0x6e'))[_0x29f6('0x17')](_0x29f6('0x6f')+_0x2309ff);db[_0x29f6('0x68')]['query'](_0xfd5c2[_0x29f6('0x41')]())[_0x29f6('0x63')](function(_0x4c4545){var _0x1024eb=[];for(var _0x59d89c=0x0;_0x59d89c<_0x4c4545['length'];_0x59d89c++){_0x1024eb[_0x29f6('0x1d')](getTimezoneData(_0x4c4545[_0x59d89c],tmp_voice_queues));}BPromise['all'](_0x1024eb)[_0x29f6('0x1b')](function(){_0x77240e({'val':0x1});});})[_0x29f6('0x69')](function(_0x35e5be){logger[_0x29f6('0x5e')](_0x35e5be[_0x29f6('0x61')]);_0x77240e({'val':0x0});});});}function getTimezoneData(_0x1ac6d8,_0x3dcf6d){return new Promise(function(_0x4915a,_0x5e5a74){var _0xdea4a9=shared['timezones'];var _0x4deadf=_0xdea4a9[_0x1ac6d8[_0x29f6('0x70')]];if(_[_0x29f6('0x71')](_0x4deadf)){_0x4915a({'ret':0x1});}else{var _0x413cf3=_0x4deadf['utcOffset'];var _0x1e4401=squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x3dcf6d)[_0x29f6('0x72')]('id',_0x1ac6d8['id'])[_0x29f6('0x72')](_0x29f6('0x73'),_0x413cf3)['set'](_0x29f6('0x70'),_0x1ac6d8['dialTimezone'])['toString']();return db[_0x29f6('0x68')][_0x29f6('0x62')](_0x1e4401)[_0x29f6('0x63')](function(_0x533898){_0x4915a({'ret':0x1});})['catch'](function(_0x443be3){logger[_0x29f6('0x5e')](_0x443be3['message']);_0x5e5a74({'ret':0x1});});}});}function handleTZQuery(_0x170e2a){logger['info'](_0x170e2a);return db['sequelize'][_0x29f6('0x62')](_0x170e2a)[_0x29f6('0x63')](function(_0x4b5859){})['catch'](function(_0x4caa89){logger['error'](_0x4caa89[_0x29f6('0x61')]);});}function main(_0x26124b,_0x127e95,_0x4ab626,_0x11096c){logger['info'](_0x29f6('0x74'),_0x26124b,JSON[_0x29f6('0x75')](_0x127e95));process[_0x29f6('0x76')](_0x29f6('0x77'));var _0x4c2bf3=_0x127e95[_0x29f6('0x78')];var _0x208b6a=_[_0x29f6('0x79')](_0x4c2bf3);var _0x1f574e=_0x127e95[_0x29f6('0x7a')];var _0x5cf519=path[_0x29f6('0x15')](config[_0x29f6('0x7b')],_0x29f6('0x7c'),_0x1f574e+_0x29f6('0x7d'));hasTZ=_[_0x29f6('0x57')](_0x4c2bf3)[_0x29f6('0x7e')]('dialTimezone');var _0x4e9bc6=_['keys'](_0x4c2bf3)['join']();logger[_0x29f6('0x5d')](_0x29f6('0x7f'),_0x4e9bc6);db[_0x29f6('0x80')][_0x29f6('0x1a')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x3dcde1){for(var _0x45efd6=0x0;_0x45efd6<_0x3dcde1['length'];_0x45efd6++){if(_0x3dcde1[_0x45efd6][_0x29f6('0x81')]in _0x4c2bf3){contactItemTypes['push'](_0x3dcde1[_0x45efd6]);delete _0x208b6a[_0x3dcde1[_0x45efd6][_0x29f6('0x81')]];hasAdditionalPhones=!![];}for(var _0x3e1f6f in _0x4c2bf3){if(_0x3dcde1[_0x45efd6][_0x29f6('0x81')]+_0x29f6('0x82')===_0x3e1f6f){phoneDescriptions[_0x29f6('0x1d')]({'itemTypeId':_0x3dcde1[_0x45efd6]['id'],'description':_0x3e1f6f});delete _0x208b6a[_0x3e1f6f];}}}if(hasAdditionalPhones)_0x208b6a[_0x29f6('0x1f')]='';var _0x3cae30=_[_0x29f6('0x57')](_0x208b6a)['join']();logger[_0x29f6('0x5d')](_0x29f6('0x7f'),_0x3cae30);fs[_0x29f6('0x83')](_0x5cf519,_0x3cae30+'\x0a');Papa[_0x29f6('0x84')](fs[_0x29f6('0x85')](_0x26124b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2fcf19,_0xbd8c69){try{for(var _0x1c0ee4=0x0,_0x2ba4d6=[];_0x1c0ee4<_0x2fcf19['data'][_0x29f6('0x1c')];_0x1c0ee4++){stats[_0x29f6('0x86')]+=0x1;if(_0x2fcf19[_0x29f6('0x60')][_0x1c0ee4]){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],_0x2fcf19[_0x29f6('0x60')][_0x1c0ee4]);}else{var _0x590263=[];var _0x1d5940=[];var _0x15f15a={};for(var _0x12045b in _0x4c2bf3){let _0x360566=contactItemTypes[_0x29f6('0x88')](_0x34be2c=>_0x34be2c[_0x29f6('0x81')]===_0x12045b);let _0x1cfe50=contactItemTypes[_0x29f6('0x88')](_0x1b8a71=>_0x1b8a71[_0x29f6('0x81')]+_0x29f6('0x82')===_0x12045b);if(_['isNil'](_0x360566)&&_[_0x29f6('0x71')](_0x1cfe50)){if(_0x4c2bf3[_0x29f6('0x89')](_0x12045b)){if(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]]){var _0x52f851=_['trim'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]][_0x29f6('0x8a')](/"/g,'\x27'));switch(_0x12045b){case _0x29f6('0x33'):var _0x4167d1=moment(_0x52f851,_0x29f6('0x10'),!![]);if(_0x4167d1[_0x29f6('0x8b')]()){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263['push'](_0x29f6('0x8c'));}break;case _0x29f6('0x36'):var _0x3f6516=parseInt(_0x52f851);_0x52f851=_['isNaN'](_0x3f6516)||_0x3f6516<0x0||_0x3f6516>0x4?_0x11096c?0x3:0x2:_0x3f6516;_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');break;case _0x29f6('0x37'):var _0x18f024=parseInt(_0x52f851);if(_[_0x29f6('0x8d')](_0x18f024)&&_[_0x29f6('0x7e')](_0x4ab626,_0x18f024)){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x18f024+'\x22');}else{_0x590263[_0x29f6('0x1d')]('agent\x20not\x20exists');}break;case _0x29f6('0x8e'):if(isEmail(_0x52f851)){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263['push'](_0x29f6('0x8f'));}break;case'dateOfBirth':var _0x2bed40=moment(_0x52f851,_0x29f6('0x90'),!![]);if(_0x2bed40['isValid']()){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263[_0x29f6('0x1d')](_0x29f6('0x91'));}break;case _0x29f6('0x70'):var _0x3c6619=shared[_0x29f6('0x92')];var _0x46d06d=_0x3c6619[_0x52f851];if(!_[_0x29f6('0x71')](_0x46d06d)){var _0x5e73c7=_0x46d06d[_0x29f6('0x93')];_0x2ba4d6['push']('\x22'+_0x52f851+'\x22');_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x5e73c7+'\x22');}break;default:_0x2ba4d6['push']('\x22'+_0x52f851+'\x22');}}else{switch(_0x12045b){case _0x29f6('0x94'):case'phone':_0x590263[_0x29f6('0x1d')](_0x12045b+_0x29f6('0x95'));break;default:_0x2ba4d6[_0x29f6('0x1d')]('\x22\x22');}}}}else{var _0xf0c663='';if(!_[_0x29f6('0x71')](_0x360566)){if(!_0x15f15a[_0x29f6('0x89')](_0x360566['id'])){if(!_['isNil'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]])){var _0x52f851=_['trim'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]][_0x29f6('0x8a')](/"/g,'\x27'));var _0x49f077=phoneDescriptions['find'](_0x2cb0be=>_0x2cb0be[_0x29f6('0x96')]===_0x360566['id']);if(!_['isNil'](_0x49f077)){var _0x573a2e=_[_0x29f6('0x97')](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x49f077['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x573a2e))_0x52f851=_0x52f851+'§'+_0x573a2e;}if(_0xf0c663=='')_0xf0c663=_0x52f851;else _0xf0c663+='|'+_0x52f851;}_0x1d5940[_0x29f6('0x1d')](_0x360566['id']+':'+_0xf0c663);_0x15f15a[_0x360566['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x1d5940['join'](';')+'\x22');}if(_0x590263[_0x29f6('0x1c')]){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],{'code':_0x29f6('0x98'),'message':_0x590263['join']()});}else{fs[_0x29f6('0x99')](_0x5cf519,_0x2ba4d6[_0x29f6('0x15')]()+'\x0a');}_0x2ba4d6=[];}if(!(stats[_0x29f6('0x86')]%0xc8)){socket[_0x29f6('0x9a')]('contact:import:'+_0x1f574e,stats);stats[_0x29f6('0x60')]=[];}}if(stopped){logger[_0x29f6('0x5d')](_0x29f6('0x9b'));_0xbd8c69[_0x29f6('0x9c')]();}}catch(_0x195798){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],{'code':_0x29f6('0x9d'),'message':_0x195798['message']});logger['error']('step',_0x195798[_0x29f6('0x61')]);}},'complete':function(){try{var _0x5dbcc2=[];var _0x48a690=[];var _0x2560d6='cm_contacts';if(_0x127e95['duplicates']&&_0x127e95['duplicates']['length']){_0x2560d6=_0x29f6('0x9e')+_0x1f574e;_0x5dbcc2['push'](_0x29f6('0x9f')+_0x2560d6+_0x29f6('0xa0'));}tmp_campaigns=_0x29f6('0xa1')+_0x1f574e;tmp_voice_queues=_0x29f6('0xa2')+_0x1f574e;_0x48a690[_0x29f6('0x1d')](_0x29f6('0x9f')+tmp_campaigns+_0x29f6('0xa3'));_0x48a690[_0x29f6('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x29f6('0xa3'));BPromise[_0x29f6('0xa4')](_0x48a690,handleTZQuery)['then'](function(_0x42372a){updateTzCampaigns(_0x127e95['ListId'])[_0x29f6('0x1b')](function(_0x17039){updateTzVoiceQueues(_0x127e95['ListId'])['then'](function(_0x44aa05){if(hasTZ)_0x3cae30=_0x3cae30[_0x29f6('0x8a')](_0x29f6('0x70'),_0x29f6('0xa5'));var _0x2b0302=util[_0x29f6('0x11')](_0x29f6('0xa6'),_0x5cf519,_0x2560d6,_0x3cae30,_0x127e95['ListId'],_0x127e95['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x4c2bf3['scheduledat'])){_0x2b0302+=_0x29f6('0xa7');}_0x5dbcc2[_0x29f6('0x1d')](_0x2b0302);if(_0x127e95[_0x29f6('0xa8')]&&_0x127e95[_0x29f6('0xa8')][_0x29f6('0x1c')]){_0x5dbcc2['push'](insertCmContact(_0x127e95[_0x29f6('0x47')],_0x2560d6,_0x127e95[_0x29f6('0xa8')],_0x4c2bf3));_0x5dbcc2[_0x29f6('0x1d')]('DROP\x20TABLE\x20'+_0x2560d6+';');}BPromise[_0x29f6('0xa4')](_0x5dbcc2,handleQuery)[_0x29f6('0x1b')](function(_0x47a296){BPromise[_0x29f6('0x1e')]([handleAdditionalPhones()])[_0x29f6('0x1b')](function(){_0x5dbcc2=[];for(var _0x426363=0x0;_0x426363_0x2a50b6[_0x59f9('0x6b')]===_0x31841a);let _0x248c93=contactItemTypes[_0x59f9('0x74')](_0x1335c0=>_0x1335c0['name']+'_description'===_0x31841a);if(_[_0x59f9('0x19')](_0x21fb31)&&_[_0x59f9('0x19')](_0x248c93)){if(_0x45b86c['hasOwnProperty'](_0x31841a)){if(_0x38544c['data'][_0x3074e4][_0x45b86c[_0x31841a]]){var _0x40ff61=_[_0x59f9('0x75')](_0x38544c['data'][_0x3074e4][_0x45b86c[_0x31841a]][_0x59f9('0x76')](/"/g,'\x27'));switch(_0x31841a){case _0x59f9('0x34'):var _0x15b23b=moment(_0x40ff61,_0x59f9('0xd'),!![]);if(_0x15b23b[_0x59f9('0x77')]()){_0x5c99c5[_0x59f9('0x1b')]('\x22'+_0x40ff61+'\x22');}else{_0x5288da[_0x59f9('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x59f9('0x78'):var _0x1f354c=parseInt(_0x40ff61);_0x40ff61=_['isNaN'](_0x1f354c)||_0x1f354c<0x0||_0x1f354c>0x4?_0x5a05e2?0x3:0x2:_0x1f354c;_0x5c99c5[_0x59f9('0x1b')]('\x22'+_0x40ff61+'\x22');break;case _0x59f9('0x79'):var _0x5488aa=parseInt(_0x40ff61);if(_[_0x59f9('0x7a')](_0x5488aa)&&_[_0x59f9('0x7b')](_0x46bf3c,_0x5488aa)){_0x5c99c5[_0x59f9('0x1b')]('\x22'+_0x5488aa+'\x22');}else{_0x5288da[_0x59f9('0x1b')](_0x59f9('0x7c'));}break;case _0x59f9('0x7d'):if(isEmail(_0x40ff61)){_0x5c99c5[_0x59f9('0x1b')]('\x22'+_0x40ff61+'\x22');}else{_0x5288da['push']('email\x20wrong\x20format');}break;case _0x59f9('0x7e'):var _0x5decea=moment(_0x40ff61,_0x59f9('0x7f'),!![]);if(_0x5decea[_0x59f9('0x77')]()){_0x5c99c5['push']('\x22'+_0x40ff61+'\x22');}else{_0x5288da[_0x59f9('0x1b')](_0x59f9('0x80'));}break;default:_0x5c99c5[_0x59f9('0x1b')]('\x22'+_0x40ff61+'\x22');}}else{switch(_0x31841a){case _0x59f9('0x81'):case _0x59f9('0xf'):_0x5288da[_0x59f9('0x1b')](_0x31841a+'\x20not\x20specified');break;default:_0x5c99c5[_0x59f9('0x1b')]('\x22\x22');}}}}else{var _0x41355a='';if(!_[_0x59f9('0x19')](_0x21fb31)){if(!_0x1faecf[_0x59f9('0x82')](_0x21fb31['id'])){for(var _0x3f8895=0x0;_0x3f8895<_0x45b86c[_0x31841a][_0x59f9('0x18')];_0x3f8895++){var _0x40ff61=_[_0x59f9('0x75')](_0x38544c[_0x59f9('0x71')][_0x3074e4][_0x45b86c[_0x31841a][_0x3f8895]]['replace'](/"/g,'\x27'));var _0x3b57e1=phoneDescriptions[_0x59f9('0x74')](_0xae12=>_0xae12['itemTypeId']===_0x21fb31['id']);if(!_[_0x59f9('0x19')](_0x3b57e1)){var _0x576193=_[_0x59f9('0x75')](_0x38544c[_0x59f9('0x71')][_0x3074e4][_0x45b86c[_0x3b57e1[_0x59f9('0x83')]][0x0]][_0x59f9('0x76')](/"/g,'\x27'));if(!_[_0x59f9('0x19')](_0x576193))_0x40ff61=_0x40ff61+'§'+_0x576193;}if(_0x41355a=='')_0x41355a=_0x40ff61;else _0x41355a+='|'+_0x40ff61;}_0x20ae07[_0x59f9('0x1b')](_0x21fb31['id']+':'+_0x41355a);_0x1faecf[_0x21fb31['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5c99c5['push']('\x22'+_0x20ae07['join'](';')+'\x22');}if(_0x5288da[_0x59f9('0x18')]){handleError(_0x38544c['data'][_0x3074e4],{'code':'SystemRow','message':_0x5288da[_0x59f9('0x11')]()});}else{fs['appendFileSync'](_0x54fe63,_0x5c99c5[_0x59f9('0x11')]()+'\x0a');}_0x5c99c5=[];}if(!(stats[_0x59f9('0x72')]%0xc8)){socket[_0x59f9('0x84')](_0x59f9('0x85')+_0x34738d,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x239f63[_0x59f9('0x86')]();}}catch(_0xc9bf81){handleError(_0x38544c[_0x59f9('0x71')][_0x3074e4],{'code':_0x59f9('0x87'),'message':_0xc9bf81[_0x59f9('0x5d')]});logger[_0x59f9('0x1f')](_0x59f9('0x88'),_0xc9bf81[_0x59f9('0x5d')]);}},'complete':function(){try{var _0x4c758c=[];var _0x368111=tempTableName;_0x4c758c['push']('CREATE\x20TABLE\x20'+_0x368111+_0x59f9('0x89'));logger['info'](_0x59f9('0x8a'),contactItemTypes[_0x59f9('0x18')]);var _0xe96f1=util[_0x59f9('0xc')](_0x59f9('0x8b'),_0x54fe63,_0x368111,_0x115262,_0x30b088[_0x59f9('0x36')],_0x30b088[_0x59f9('0x55')]||null,NOW,NOW);if(_[_0x59f9('0x19')](_0x45b86c[_0x59f9('0x34')])){_0xe96f1+=_0x59f9('0x8c');}_0x4c758c[_0x59f9('0x1b')](_0xe96f1);BPromise[_0x59f9('0x8d')](_0x4c758c,handleQuery)['then'](function(_0x49b04c){BPromise[_0x59f9('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x4c758c=[];for(var _0x1fdf99=0x0;_0x1fdf99\x20\x20');}var _0x18c252=path[_0x59f9('0x11')](config[_0x59f9('0x96')],_0x59f9('0x67'),process[_0x59f9('0x95')][0x2]);if(!fs[_0x59f9('0x97')](_0x18c252)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x1029f2={};try{_0x1029f2=JSON[_0x59f9('0x6f')](process[_0x59f9('0x95')][0x3]);if(!_0x1029f2[_0x59f9('0x65')]){throw new Error(_0x59f9('0x98'));}var _0x1fe6ce=0x0;if(_0x1029f2[_0x59f9('0x65')]['UserId']){_0x1fe6ce=0x1;}if(!_0x1029f2[_0x59f9('0x36')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x3702c0){throw new Error(_0x59f9('0x99'));}var _0x5a4410=[];try{_0x5a4410=_[_0x59f9('0x9a')](JSON[_0x59f9('0x6f')](process[_0x59f9('0x95')][0x4]),'id');}catch(_0x1e1568){logger[_0x59f9('0x5b')](_0x59f9('0x9b'));}main(_0x18c252,_0x1029f2,_0x5a4410,_0x1fe6ce);}validate();process['on'](_0x59f9('0x9c'),handleStop);process['on'](_0x59f9('0x9d'),handleUncaughtException); \ No newline at end of file +var _0xe54c=['length','AdditionalPhones','push','then','catch','error','message','isNil','split','CmContactHasItem','update','updated','create','PHONE','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','createdAt','updatedAt','priority','UserId','recallme','fields','from','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.phone','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','toString','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','main','stringify','send','start','socket_timestamp','root','.csv','ContactItemType','findAll','name','_description','header','writeFileSync','createReadStream','data','find','hasOwnProperty','trim','replace','isValid','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','contact:import:','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','all','contactId','contactTypeId','orderBy','finish','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','parse','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','import','redis','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','phone','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xe54c,0x79));var _0xce54=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0xe54c[_0x4f51f9];return _0x533984;};'use strict';var fs=require('fs');var path=require(_0xce54('0x0'));var _=require(_0xce54('0x1'));var Papa=require(_0xce54('0x2'));var util=require(_0xce54('0x3'));var BPromise=require(_0xce54('0x4'));var moment=require(_0xce54('0x5'));var squel=require(_0xce54('0x6'));var Redis=require(_0xce54('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0xce54('0x8'));var logger=require('../../../config/logger')(_0xce54('0x9'));config[_0xce54('0xa')]=_['defaults'](config[_0xce54('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xce54('0xb'))(new Redis(config[_0xce54('0xa')]));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'](_0xce54('0xc'));var tempTableName=_0xce54('0xd')+moment()[_0xce54('0xe')](_0xce54('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xb0f2df){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))*$/[_0xce54('0x10')](_0xb0f2df);}function selectNotIn(_0x41a8ac,_0x4b73ec,_0x236549,_0xf75956,_0x1c84a9){return squel[_0xce54('0x11')]()[_0xce54('0x12')](_0xce54('0x13'))['from'](_0xf75956)['join'](_0x4b73ec,null,_0x4b73ec+'.id\x20=\x20'+_0xf75956+'.'+_0x236549)[_0xce54('0x14')](_0xf75956+'.'+_0x236549+'\x20=\x20'+_0x41a8ac+'.'+_0x236549)[_0xce54('0x14')](_0x4b73ec+_0xce54('0x15')+_0x1c84a9['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x586520,_0x355e0f){promisesAdditionalPhones=[];promisesContact=[];return db[_0xce54('0x16')][_0xce54('0x17')](_0xce54('0x18')+tempTableName)[_0xce54('0x19')](function(_0x57effb){if(_0x57effb!==null){var _0x4fafc0=[];for(var _0x3eee0d=0x0;_0x3eee0d<_0x57effb[_0xce54('0x1a')];_0x3eee0d++){var _0x2b60e8=_0x57effb[_0x3eee0d];if(!_['isNil'](_0x2b60e8[_0xce54('0x13')])){if(!_['isNil'](_0x2b60e8[_0xce54('0x1b')]))_0x4fafc0['push'](insertAdditionalPhones(_0x2b60e8));promisesContact[_0xce54('0x1c')]({'contact':_0x2b60e8});}}}Promise['all'](_0x4fafc0)[_0xce54('0x1d')](function(){_0x586520({'val':0x1});});})[_0xce54('0x1e')](function(_0x268acd){logger[_0xce54('0x1f')](_0x268acd[_0xce54('0x20')]);});});}function insertAdditionalPhones(_0x58739c){return new Promise(function(_0x50fe8c,_0x375ae4){var _0x348770=_0x58739c[_0xce54('0x1b')];if(_[_0xce54('0x21')](_0x348770))_0x375ae4({'val':0x0});else{var _0x13e074=_0x348770[_0xce54('0x22')](';');var _0x35c3a8=[];orderBy=0x0;for(var _0x486d35=0x0;_0x486d35<_0x13e074['length'];_0x486d35++){_0x35c3a8[_0xce54('0x1c')](splitAdditionalPhone(_0x58739c['id'],_0x13e074[_0x486d35]));}Promise['all'](_0x35c3a8)[_0xce54('0x1d')](function(){_0x50fe8c({'val':_0x13e074[_0xce54('0x1a')]});});}});}function splitAdditionalPhone(_0x3a96e6,_0xdde13e){return new Promise(function(_0x2057fa,_0x2d83be){var _0x490621=_0xdde13e[_0xce54('0x22')](':');var _0x12622e=_0x490621[0x0];var _0x4d0bd7=_0x490621[0x1];if(_0x4d0bd7!==''){var _0x38cf3b=_0x4d0bd7[_0xce54('0x22')]('|');var _0x1c48ab=[];for(var _0x3243f6=0x0;_0x3243f6<_0x38cf3b[_0xce54('0x1a')];_0x3243f6++){if(_0x38cf3b[_0x3243f6]!==''){var _0x1cb75f=_['filter'](promisesAdditionalPhones,{'contactId':_0x3a96e6,'phone':_0x38cf3b[_0x3243f6]});if(_0x1cb75f[_0xce54('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3a96e6,'contactTypeId':_0x12622e,'phone':_0x38cf3b[_0x3243f6],'orderBy':orderBy});}}}_0x2057fa({'ok':0x1});}else _0x2057fa({'res':0x0});});}function createAdditionalPhone(_0x585ef3,_0x1461c7,_0x243aff,_0x2c7a7e){var _0x4b94ca='';var _0x2cd689='';var _0x215c16=_0x243aff['split']('§');_0x4b94ca=_0x215c16[0x0];if(_0x215c16['length']==0x2)_0x2cd689=_0x215c16[0x1];return new Promise(function(_0xd7800f,_0x1bb48d){return db[_0xce54('0x23')]['findOne']({'where':{'CmContactId':_0x585ef3,'item':_0x4b94ca}})[_0xce54('0x1d')](function(_0x27a65e){if(_0x27a65e){return db[_0xce54('0x23')][_0xce54('0x24')]({'ItemTypeId':_0x1461c7,'description':_0x2cd689,'OrderBy':_0x2c7a7e},{'where':{'CmContactId':_0x585ef3,'item':_0x4b94ca}})[_0xce54('0x1d')](function(_0x1b9e07){_0xd7800f({'res':_0xce54('0x25')});});}else{return db[_0xce54('0x23')][_0xce54('0x26')]({'CmContactId':_0x585ef3,'item':_0x4b94ca,'ItemTypeId':_0x1461c7,'description':_0x2cd689,'OrderBy':_0x2c7a7e,'ItemClass':_0xce54('0x27')})[_0xce54('0x1d')](function(_0x37ef02){_0xd7800f({'res':'inserted'});});}});});}function updateContact(_0x5c8e55){return new Promise(function(_0x575779,_0x4053d7){var _0x2a9ee8=_0x5c8e55['id'];delete _0x5c8e55['id'];return db['CmContact']['update'](_0x5c8e55,{'where':{'id':_0x2a9ee8}})[_0xce54('0x1d')](function(_0x18c242){updatedRows+=0x1;return db[_0xce54('0x28')][_0xce54('0x24')]({'phone':_0x5c8e55[_0xce54('0x13')]},{'where':{'ContactId':_0x2a9ee8}})[_0xce54('0x1d')](function(_0x12bd9f){_0x575779({'ret':'OK'});});});});}function insertCmHopper(_0x432ba2,_0x29824b,_0xd1d6bc,_0x595d8b,_0x5c81b8){var _0x52e664=['cm_contacts.phone',_0xce54('0x29'),_0xce54('0x2a'),_0xce54('0x2b'),_0x29824b+'.'+_0x595d8b,_0xce54('0x2c'),'cm_contacts.updatedAt',_0xce54('0x2d'),'cm_contacts.UserId','\x22'+_0x5c81b8+'\x22'];return squel[_0xce54('0x2e')]()[_0xce54('0x2f')](_0xce54('0x30'))['fromQuery'](['phone',_0xce54('0x31'),'ContactId','ListId',_0x595d8b,_0xce54('0x32'),_0xce54('0x33'),_0xce54('0x34'),_0xce54('0x35'),_0xce54('0x36')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x52e664)[_0xce54('0x38')](_0x29824b)[_0xce54('0x39')](_0xce54('0x3a'),null,_0xce54('0x3b')+_0x29824b+_0xce54('0x3c'))[_0xce54('0x39')](_0xd1d6bc,null,_0xd1d6bc+_0xce54('0x3d')+_0x29824b+'.'+_0x595d8b)[_0xce54('0x14')](_0x29824b+_0xce54('0x3e'),_0x432ba2)['where'](_0xce54('0x3f'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x29824b,_0xd1d6bc,_0x595d8b,'cm_hopper',[_0xce54('0x40'),'\x22onlyIfOpen\x22']))['where'](_0xce54('0x41'),selectNotIn(_0x29824b,_0xd1d6bc,_0x595d8b,_0xce54('0x30'),[_0xce54('0x40')])))['toString']();}function insertCmHopperBlack(_0x11d53a,_0x11e240,_0x5b929a,_0x34ba65){var _0x243282=[_0xce54('0x42'),_0xce54('0x2a'),'cm_contacts.ListId',_0x11e240+'.'+_0x34ba65,_0xce54('0x2c'),'cm_contacts.updatedAt'];return squel['insert']()[_0xce54('0x2f')](_0xce54('0x43'))['fromQuery'](['phone','ContactId',_0xce54('0x44'),_0x34ba65,_0xce54('0x32'),_0xce54('0x33')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x243282)[_0xce54('0x38')](_0x11e240)[_0xce54('0x39')](_0xce54('0x3a'),null,_0xce54('0x3b')+_0x11e240+_0xce54('0x3c'))[_0xce54('0x39')](_0x5b929a,null,_0x5b929a+_0xce54('0x3d')+_0x11e240+'.'+_0x34ba65)['where'](_0x11e240+_0xce54('0x3e'),_0x11d53a)[_0xce54('0x14')](_0xce54('0x3f'),NOW)['where'](_0xce54('0x41'),squel[_0xce54('0x11')]()[_0xce54('0x12')](_0xce54('0x13'))[_0xce54('0x38')](_0xce54('0x43'))[_0xce54('0x14')](_0xce54('0x45'),_0x11d53a)[_0xce54('0x14')](_0x34ba65+_0xce54('0x46'),_0x11e240+'.'+_0x34ba65)))[_0xce54('0x47')]();}function insertCmHopperAdditionalPhones(_0x405b3f){var _0x51814c=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xce54('0x48'),_0xce54('0x49')];return squel[_0xce54('0x2e')]()[_0xce54('0x2f')](_0xce54('0x4a'))[_0xce54('0x4b')](['CmHopperId',_0xce54('0x13'),_0xce54('0x4c'),_0xce54('0x32'),_0xce54('0x33')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x51814c)['from']('cm_hopper')[_0xce54('0x39')](_0xce54('0x3a'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xce54('0x39')]('cm_contact_has_items',null,_0xce54('0x4d'))[_0xce54('0x14')](_0xce54('0x4e'),_0x405b3f)['where'](_0xce54('0x3f'),NOW))[_0xce54('0x47')]();}function insertCmContact(_0x322dc4,_0x13f78b,_0x208943,_0xdaa118){var _0x43fda2=_['concat'](_[_0xce54('0x4f')](_0xdaa118),[_0xce54('0x44'),_0xce54('0x50'),_0xce54('0x32'),_0xce54('0x33')]);return squel[_0xce54('0x2e')]()['into'](_0xce54('0x3a'))[_0xce54('0x4b')](_0x43fda2,squel['select']()[_0xce54('0x37')](_0x43fda2)[_0xce54('0x38')](_0x13f78b)[_0xce54('0x14')]('('+_0x208943[_0xce54('0x39')](',')+_0xce54('0x51'),squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x208943)['from'](_0xce54('0x3a'))[_0xce54('0x14')](_0xce54('0x45'),_0x322dc4))['where']('id\x20IN\x20?',squel[_0xce54('0x11')]()['field'](_0xce54('0x52'),_0xce54('0x53'))[_0xce54('0x38')](_0x13f78b)['group'](_0x208943['join'](','))))[_0xce54('0x47')]();}function handleStop(){logger[_0xce54('0x54')](_0xce54('0x55'));stopped=!![];}function handleUncaughtException(_0x42305e){logger[_0xce54('0x1f')](_0x42305e[_0xce54('0x20')]);process[_0xce54('0x56')](0x1);}function handleError(_0x50db00,_0x17ccb1){stats[_0xce54('0x57')][_0xce54('0x1c')]({'name':_0x17ccb1[_0xce54('0x58')],'message':_0x17ccb1['message'],'row':_0x50db00});}function handleQuery(_0x5e2c97){logger['info'](_0x5e2c97);return db[_0xce54('0x16')][_0xce54('0x17')](_0x5e2c97)[_0xce54('0x19')](function(_0x24ecb5){results[_0xce54('0x1c')](_0x24ecb5);})['catch'](function(_0x53b8ba){logger[_0xce54('0x1f')](_0x53b8ba['message']);});}function main(_0x43931e,_0x450484,_0x4621a5,_0x504302){logger['info'](_0xce54('0x59'),_0x43931e,JSON[_0xce54('0x5a')](_0x450484));process[_0xce54('0x5b')](_0xce54('0x5c'));var _0x51a685=_0x450484['binding'];var _0x34361a=_['clone'](_0x51a685);var _0x3d78ab=_0x450484[_0xce54('0x5d')];var _0x927424=path[_0xce54('0x39')](config[_0xce54('0x5e')],'server/files/tmp',_0x3d78ab+_0xce54('0x5f'));logger[_0xce54('0x54')]('body',_0x450484);db[_0xce54('0x60')][_0xce54('0x61')]({'raw':!![],'attributes':['id',_0xce54('0x62')]})[_0xce54('0x1d')](function(_0x3b940a){for(var _0x3d8a07=0x0;_0x3d8a07<_0x3b940a[_0xce54('0x1a')];_0x3d8a07++){if(_0x3b940a[_0x3d8a07][_0xce54('0x62')]in _0x51a685){contactItemTypes[_0xce54('0x1c')](_0x3b940a[_0x3d8a07]);delete _0x34361a[_0x3b940a[_0x3d8a07][_0xce54('0x62')]];hasAdditionalPhones=!![];}for(var _0x20d33f in _0x51a685){if(_0x3b940a[_0x3d8a07][_0xce54('0x62')]+_0xce54('0x63')===_0x20d33f){phoneDescriptions['push']({'itemTypeId':_0x3b940a[_0x3d8a07]['id'],'description':_0x20d33f});delete _0x34361a[_0x20d33f];}}}if(hasAdditionalPhones)_0x34361a[_0xce54('0x1b')]='';var _0x1741e8=_[_0xce54('0x4f')](_0x34361a)['join']();logger['info'](_0xce54('0x64'),_0x1741e8);fs[_0xce54('0x65')](_0x927424,_0x1741e8+'\x0a');Papa['parse'](fs[_0xce54('0x66')](_0x43931e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ca193,_0x67afb9){try{for(var _0x56023d=0x0,_0x4e15af=[];_0x56023d<_0x1ca193['data'][_0xce54('0x1a')];_0x56023d++){stats['rows']+=0x1;if(_0x1ca193[_0xce54('0x57')][_0x56023d]){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],_0x1ca193[_0xce54('0x57')][_0x56023d]);}else{var _0x403053=[];var _0x306092=[];var _0xa94508={};for(var _0x95205b in _0x51a685){let _0x811f6a=contactItemTypes[_0xce54('0x68')](_0x226a4d=>_0x226a4d[_0xce54('0x62')]===_0x95205b);let _0x2aa4c9=contactItemTypes[_0xce54('0x68')](_0x5a5ef9=>_0x5a5ef9['name']+'_description'===_0x95205b);if(_[_0xce54('0x21')](_0x811f6a)&&_[_0xce54('0x21')](_0x2aa4c9)){if(_0x51a685[_0xce54('0x69')](_0x95205b)){if(_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b]]){var _0x25cd90=_[_0xce54('0x6a')](_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b]][_0xce54('0x6b')](/"/g,'\x27'));switch(_0x95205b){case _0xce54('0x31'):var _0xf16f4d=moment(_0x25cd90,_0xce54('0xc'),!![]);if(_0xf16f4d[_0xce54('0x6c')]()){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xce54('0x34'):var _0x36b3f6=parseInt(_0x25cd90);_0x25cd90=_['isNaN'](_0x36b3f6)||_0x36b3f6<0x0||_0x36b3f6>0x4?_0x504302?0x3:0x2:_0x36b3f6;_0x4e15af['push']('\x22'+_0x25cd90+'\x22');break;case _0xce54('0x35'):var _0x165c44=parseInt(_0x25cd90);if(_[_0xce54('0x6d')](_0x165c44)&&_[_0xce54('0x6e')](_0x4621a5,_0x165c44)){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x165c44+'\x22');}else{_0x403053['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x25cd90)){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')](_0xce54('0x6f'));}break;case _0xce54('0x70'):var _0x2beaef=moment(_0x25cd90,_0xce54('0x71'),!![]);if(_0x2beaef[_0xce54('0x6c')]()){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}}else{switch(_0x95205b){case _0xce54('0x72'):case'phone':_0x403053[_0xce54('0x1c')](_0x95205b+_0xce54('0x73'));break;default:_0x4e15af[_0xce54('0x1c')]('\x22\x22');}}}}else{var _0x2bda86='';if(!_[_0xce54('0x21')](_0x811f6a)){if(!_0xa94508[_0xce54('0x69')](_0x811f6a['id'])){for(var _0x12a82b=0x0;_0x12a82b<_0x51a685[_0x95205b][_0xce54('0x1a')];_0x12a82b++){var _0x25cd90=_[_0xce54('0x6a')](_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b][_0x12a82b]][_0xce54('0x6b')](/"/g,'\x27'));var _0x3716ec=phoneDescriptions[_0xce54('0x68')](_0x259caa=>_0x259caa['itemTypeId']===_0x811f6a['id']);if(!_[_0xce54('0x21')](_0x3716ec)){var _0x4a8bea=_[_0xce54('0x6a')](_0x1ca193['data'][_0x56023d][_0x51a685[_0x3716ec[_0xce54('0x74')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xce54('0x21')](_0x4a8bea))_0x25cd90=_0x25cd90+'§'+_0x4a8bea;}if(_0x2bda86=='')_0x2bda86=_0x25cd90;else _0x2bda86+='|'+_0x25cd90;}_0x306092['push'](_0x811f6a['id']+':'+_0x2bda86);_0xa94508[_0x811f6a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x306092[_0xce54('0x39')](';')+'\x22');}if(_0x403053[_0xce54('0x1a')]){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],{'code':_0xce54('0x75'),'message':_0x403053[_0xce54('0x39')]()});}else{fs[_0xce54('0x76')](_0x927424,_0x4e15af[_0xce54('0x39')]()+'\x0a');}_0x4e15af=[];}if(!(stats['rows']%0xc8)){socket[_0xce54('0x77')](_0xce54('0x78')+_0x3d78ab,stats);stats[_0xce54('0x57')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x67afb9['abort']();}}catch(_0xc219b0){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],{'code':_0xce54('0x79'),'message':_0xc219b0[_0xce54('0x20')]});logger[_0xce54('0x1f')]('step',_0xc219b0['message']);}},'complete':function(){try{var _0x28a28a=[];var _0x227c7f=tempTableName;_0x28a28a[_0xce54('0x1c')](_0xce54('0x7a')+_0x227c7f+_0xce54('0x7b'));logger[_0xce54('0x54')](_0xce54('0x7c'),contactItemTypes[_0xce54('0x1a')]);var _0x49afe0=util[_0xce54('0xe')](_0xce54('0x7d'),_0x927424,_0x227c7f,_0x1741e8,_0x450484[_0xce54('0x44')],_0x450484[_0xce54('0x50')]||null,NOW,NOW);if(_['isNil'](_0x51a685[_0xce54('0x31')])){_0x49afe0+=_0xce54('0x7e');}_0x28a28a[_0xce54('0x1c')](_0x49afe0);BPromise[_0xce54('0x7f')](_0x28a28a,handleQuery)[_0xce54('0x1d')](function(_0x21d1f5){BPromise['all']([handleAdditionalPhones()])[_0xce54('0x1d')](function(){_0x28a28a=[];for(var _0x1db5fc=0x0;_0x1db5fc\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','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','sequelize','query','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','getSelectedTags','isEmpty'];(function(_0x6b942a,_0x311643){var _0x22129d=function(_0x5a1a52){while(--_0x5a1a52){_0x6b942a['push'](_0x6b942a['shift']());}};_0x22129d(++_0x311643);}(_0x68fc,0xa5));var _0xc68f=function(_0x215c8d,_0x5073f8){_0x215c8d=_0x215c8d-0x0;var _0x4113ed=_0x68fc[_0x215c8d];return _0x4113ed;};'use strict';var _=require(_0xc68f('0x0'));var squel=require(_0xc68f('0x1'));var as=require(_0xc68f('0x2'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xc68f('0x3')];var utils=require('./utils');var db=require(_0xc68f('0x4'))['db'];function skipInteractionsQuery(_0x593648,_0x5899ea,_0x3b2744){var _0x2ad310=![];var _0x1c6df9=utils[_0xc68f('0x5')](_0x593648);if(_0x5899ea['role']==='agent'&&!_0x3b2744[_0xc68f('0x6')]&&!_0x3b2744[_0x1c6df9]){_0x2ad310=!![];}return _0x2ad310;}function getTagsQuery(){return squel[_0xc68f('0x7')]()[_0xc68f('0x8')]('id')[_0xc68f('0x8')](_0xc68f('0x9'))[_0xc68f('0x8')](_0xc68f('0xa'))[_0xc68f('0xb')](_0xc68f('0xc'));}function getUsersQuery(_0x34691b,_0x5777f9){var _0x3b1a43=utils[_0xc68f('0xd')](_0x34691b);var _0x1f2758=_0xc68f('0xe')+_0x34691b+_0xc68f('0xf');var _0x2a0a52=squel[_0xc68f('0x7')]()[_0xc68f('0x8')](_0xc68f('0x10'))[_0xc68f('0x8')](_0xc68f('0x11'))['field'](_0xc68f('0x12')+_0x3b1a43)[_0xc68f('0xb')](_0x1f2758,'ui')[_0xc68f('0x13')](_0xc68f('0x14'),'u',_0xc68f('0x15'));if(_0x5777f9[_0xc68f('0x16')]>0x0){_0x2a0a52[_0xc68f('0x17')](_0xc68f('0x12')+_0x3b1a43+_0xc68f('0x18'),_['map'](_0x5777f9,'id'));}return _0x2a0a52;}function getInteractionsQuery(_0x541828){var _0x3a6c06=utils[_0xc68f('0x19')](_0x541828);var _0x171eea=utils[_0xc68f('0x5')](_0x541828);var _0x2d9d85=utils[_0xc68f('0xd')](_0x541828);return squel['select']()[_0xc68f('0xb')](_0x3a6c06[_0xc68f('0x1a')],'i')[_0xc68f('0x13')](_0xc68f('0x1b'),'c',_0xc68f('0x1c'))[_0xc68f('0x13')](_0xc68f('0x14'),'o',_0xc68f('0x1d'))['left_join'](_0x3a6c06[_0xc68f('0x1e')],'a',_0xc68f('0x1f')+_0x171eea)[_0xc68f('0x13')](_0x3a6c06['messages'],'me',_0xc68f('0x20')+_0x2d9d85+_0xc68f('0x21'))[_0xc68f('0x13')](_0x3a6c06[_0xc68f('0x22')],'it',_0xc68f('0x23')+_0x2d9d85+_0xc68f('0x21'))[_0xc68f('0x13')]('tools_tags','t',_0xc68f('0x24'));}function getSqlClauses(){var _0x288957={'body':squel['expr'](),'contact':squel[_0xc68f('0x25')](),'default':squel[_0xc68f('0x25')](),'fields':squel[_0xc68f('0x25')](),'filter':squel[_0xc68f('0x25')](),'read':squel[_0xc68f('0x25')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xc68f('0x25')]()};return _0x288957;}function parseTagParameter(_0x417de2){var _0x5d4632=squel[_0xc68f('0x25')]();if(_0x417de2){var _0x27e5b8=utils['getSelectedTags'](_0x417de2);_0x27e5b8[_0xc68f('0x26')](function(_0xdde47e){_0x5d4632['or'](_0xc68f('0x27'),'%,'+_0xdde47e+',%');});}return _0x5d4632;}function parseReadParameter(_0x3abc1e){var _0x58dd95='';if(_0x3abc1e){_0x58dd95=_0xc68f('0x28');if(_0x3abc1e==='1'){_0x58dd95=_0x58dd95[_0xc68f('0x29')](_0xc68f('0x2a'),'=');}else{_0x58dd95=_0x58dd95[_0xc68f('0x29')](_0xc68f('0x2a'),'>');}}return _0x58dd95;}function parseSearchFilter(_0x11b203,_0x9dc424){var _0x65f58a=squel['expr']();if(_0x9dc424){var _0x37f947=_0x9dc424[_0xc68f('0x29')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc68f('0x2b')](_0x37f947)){_0x65f58a['or'](_0xc68f('0x2c'),_0x37f947+'%');if([_0xc68f('0x2d'),_0xc68f('0x2e')]['includes'](_0x11b203)){_0x65f58a['or'](_0xc68f('0x2f'),_0x37f947+'%');}else if(_0x11b203===_0xc68f('0x30')){_0x65f58a['or']('i.fax\x20LIKE\x20?',_0x37f947+'%');}else if(_0x11b203===_0xc68f('0x31')){_0x65f58a['or'](_0xc68f('0x32'),_0x37f947+'%');}}else if(_0x11b203===_0xc68f('0x33')&&qs[_0xc68f('0x34')](_0x37f947)){_0x65f58a['or'](_0xc68f('0x35'),_0x37f947+'%');}else{if(_0x11b203==='mail'){_0x65f58a['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc68f('0x36')](_0x37f947))['or'](_0xc68f('0x37'),qs[_0xc68f('0x36')](_0x37f947));}else{if(_0x11b203!==_0xc68f('0x30')){_0x65f58a['or'](_0xc68f('0x38'),qs['getFullTextValue'](_0x37f947));}_0x65f58a['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x37f947+'%');}}}return _0x65f58a;}function parseAdvancedSearchFilter(_0xa34e31,_0x5c9a7e){var _0x378e75=getSqlClauses();var _0x115f74=as[_0xc68f('0x39')](_0xa34e31);var _0x3eee68=_0x115f74[_0xc68f('0x3a')];for(var _0x343787=0x0;_0x343787<_0x115f74[_0xc68f('0x3b')]['length'];_0x343787++){var _0x4282b7=_0x115f74[_0xc68f('0x3b')][_0x343787];var _0x8ce922='i';var _0x360810=_[_0xc68f('0x3c')](_0x5c9a7e,[_0xc68f('0x9'),_0x4282b7[_0xc68f('0x8')]]);if(_0x360810){var _0x253c81=as[_0xc68f('0x3d')](_0x8ce922,_0x360810[_0xc68f('0x3e')],_0x4282b7);_0x378e75[_0xc68f('0x3f')][_0x3eee68](_0x253c81['text'],_0x253c81['value']['start'],_0x253c81[_0xc68f('0x40')][_0xc68f('0x41')]);}else{switch(_0x4282b7[_0xc68f('0x8')]){case _0xc68f('0x42'):var _0x49222d=parseReadParameter(_0x4282b7[_0xc68f('0x40')]);_0x378e75[_0xc68f('0x43')][_0xc68f('0x44')](_0x49222d);break;case'Contact':if(_0x4282b7[_0xc68f('0x45')]===_0xc68f('0x46')){if(_0x4282b7['value'][_0xc68f('0x47')]('\x20')[_0xc68f('0x16')]>0x1){_0x378e75[_0xc68f('0x48')][_0x3eee68]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc68f('0x36')](_0x4282b7[_0xc68f('0x40')]),null);}else{var _0x1edda2='%'+_0x4282b7[_0xc68f('0x40')]+'%';_0x378e75[_0xc68f('0x48')][_0x3eee68](_0xc68f('0x49'),_0x1edda2,_0x1edda2,_0x1edda2);}}else{_0x360810=_[_0xc68f('0x3c')](_0x5c9a7e,['name',_0xc68f('0x4a')]);_0x4282b7[_0xc68f('0x8')]=_0xc68f('0x4a');_0x253c81=as[_0xc68f('0x3d')](_0x8ce922,_0x360810[_0xc68f('0x3e')],_0x4282b7);_0x378e75[_0xc68f('0x48')][_0x3eee68](_0x253c81[_0xc68f('0x4b')],_0x253c81[_0xc68f('0x40')][_0xc68f('0x4c')],_0x253c81['value'][_0xc68f('0x41')]);}break;case _0xc68f('0x4d'):var _0x38567a=_0x4282b7[_0xc68f('0x40')][_0xc68f('0x47')](',')[_0xc68f('0x4e')](function(_0x3e7b43){return Number(_0x3e7b43);});var _0x58e0f8=parseTagParameter(_0x38567a);_0x378e75[_0xc68f('0x4f')]['clause']['and'](_0x58e0f8);_0x378e75[_0xc68f('0x4f')][_0xc68f('0x50')]=_0x38567a;break;case'User':if(_0x4282b7['operator']===_0xc68f('0x46')){_0x378e75[_0xc68f('0x51')][_0x3eee68](_0xc68f('0x52'),'%'+_0x4282b7[_0xc68f('0x40')]+'%',null);}else{_0x360810=_[_0xc68f('0x3c')](_0x5c9a7e,[_0xc68f('0x9'),_0xc68f('0x53')]);_0x4282b7[_0xc68f('0x8')]=_0xc68f('0x53');_0x253c81=as[_0xc68f('0x3d')](_0x8ce922,_0x360810[_0xc68f('0x3e')],_0x4282b7);_0x378e75['user'][_0x3eee68](_0x253c81[_0xc68f('0x4b')],_0x253c81['value'][_0xc68f('0x4c')],_0x253c81[_0xc68f('0x40')]['end']);}break;case _0xc68f('0x54'):case _0xc68f('0x55'):_0x253c81=as[_0xc68f('0x3d')]('me',null,_0x4282b7);_0x378e75[_0xc68f('0x54')][_0x3eee68](_0x253c81[_0xc68f('0x4b')],_0x253c81[_0xc68f('0x40')][_0xc68f('0x4c')],_0x253c81[_0xc68f('0x40')]['end']);break;}}}return _0x378e75;}function parseModelFields(_0x2920d5,_0x15eaa2,_0x45861f){var _0x57d99c=utils['getAccountFK'](_0x2920d5);var _0x4be0b5=squel[_0xc68f('0x25')]();var _0x237327=_(_0x15eaa2)['keys']()[_0xc68f('0x4e')](function(_0x53b98d){return _[_0xc68f('0x56')](_0x45861f,[_0xc68f('0x9'),_0x53b98d])?_0x53b98d:undefined;})[_0xc68f('0x57')]()[_0xc68f('0x40')]();if(_0x237327[_0xc68f('0x16')]>0x0){_0x237327[_0xc68f('0x26')](function(_0x28224f){if(_0x28224f===_0x57d99c){_0x4be0b5[_0xc68f('0x44')]('i.'+_0x57d99c+_0xc68f('0x18'),[][_0xc68f('0x58')](_0x15eaa2[_0x28224f]));}else if(_0x28224f===_0xc68f('0x59')){var _0x5e36c7=JSON[_0xc68f('0x5a')](_0x15eaa2[_0x28224f])[_0xc68f('0x5b')];var _0x58da89=JSON['parse'](_0x15eaa2[_0x28224f])[_0xc68f('0x5c')];_0x4be0b5[_0xc68f('0x44')](_0xc68f('0x5d'),_0x5e36c7,_0x58da89);}else{if(_0x15eaa2[_0x28224f]==='null'){_0x4be0b5[_0xc68f('0x44')]('i.'+_0x28224f+_0xc68f('0x5e'));}else{_0x4be0b5['and']('i.'+_0x28224f+'\x20=\x20?',_0x15eaa2[_0x28224f]);}}});}return _0x4be0b5;}function parseQueryParameters(_0x2eb1e8,_0x4281a5,_0x44b5ce){var _0x456157=getSqlClauses();return Promise[_0xc68f('0x5f')]()[_0xc68f('0x60')](function(){return parseModelFields(_0x2eb1e8,_0x4281a5,_0x44b5ce);})[_0xc68f('0x60')](function(_0x332e14){_0x456157[_0xc68f('0x61')][_0xc68f('0x44')](_0x332e14);return parseReadParameter(_0x4281a5[_0xc68f('0x43')]);})[_0xc68f('0x60')](function(_0x37e2eb){_0x456157[_0xc68f('0x43')][_0xc68f('0x44')](_0x37e2eb);return parseTagParameter(_0x4281a5[_0xc68f('0x62')]);})[_0xc68f('0x60')](function(_0x46d737){_0x456157[_0xc68f('0x4f')][_0xc68f('0x63')][_0xc68f('0x44')](_0x46d737);return parseSearchFilter(_0x2eb1e8,_0x4281a5['filter']);})['then'](function(_0x10c4ea){_0x456157[_0xc68f('0x64')]=_0x10c4ea;return _0x456157;});}function checkAccountsRestrictions(_0x29c3e0,_0x444d04,_0xda86d){var _0x21a39e=utils['getAccountFK'](_0x29c3e0);var _0x3d0c5f=_0xc68f('0x65')+_[_0xc68f('0x66')](_0x29c3e0)+(_0x29c3e0==='chat'?_0xc68f('0x67'):'Accounts');var _0x3f2d96=squel[_0xc68f('0x25')]();return Promise[_0xc68f('0x5f')]()[_0xc68f('0x60')](function(){if(_0xda86d[_0xc68f('0x6')]&&_0x444d04['role']===_0xc68f('0x68')){return _0x444d04[_0x3d0c5f]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x432ff0){if(_0x432ff0){if(_0x432ff0[_0xc68f('0x16')]===0x0){_0x3f2d96[_0xc68f('0x44')]('i.'+_0x21a39e+_0xc68f('0x5e'));}else{_0x3f2d96['and']('i.'+_0x21a39e+'\x20IN\x20?',_[_0xc68f('0x4e')](_0x432ff0,'id'));}}else if(!_0xda86d[_0x21a39e]){_0x3f2d96[_0xc68f('0x44')]('i.'+_0x21a39e+'\x20IS\x20NOT\x20NULL');}})[_0xc68f('0x60')](function(){return _0x3f2d96;});}function getClosedOrderClause(_0x580f79,_0x1e4c93){var _0x13c0cf='';var _0xde8c3=[_0xc68f('0x69'),_0xc68f('0x6a'),'i.disposition'];if(_0x580f79==='mail'){_0xde8c3[_0xc68f('0x6b')](_0xc68f('0x6c'));}if(_0x1e4c93[_0xc68f('0x6d')]==='0'&&_0x580f79===_0xc68f('0x33')){_0x13c0cf='i.substatus';}else{if(_0x1e4c93[_0xc68f('0x6d')]==='1'){_0xde8c3[_0xc68f('0x6e')]();}_0x13c0cf=_0xc68f('0x6f')+_0xde8c3[_0xc68f('0x70')](',\x20')+')';}return _0x13c0cf;}function getFilteredInteractions(_0x140a67,_0x2ebe1c,_0x5a81b2,_0xedc6df){var _0x238b54=utils['getInteractionFK'](_0x140a67);var _0x3689ec=_[_0xc68f('0x66')](_0x140a67)+'Interaction';var _0x44ce7f=[];var _0x51053c=getTagsQuery();var _0x34f3c3={'type':db[_0xc68f('0x71')][_0xc68f('0x72')][_0xc68f('0x73')],'raw':!![]};var _0x5cdfb7=[];var _0x1beb4f=[];return db['sequelize']['query'](_0x51053c[_0xc68f('0x74')](),_0x34f3c3)[_0xc68f('0x60')](function(_0x36daa3){_0x44ce7f=_[_0xc68f('0x75')](_0x36daa3,'id');_0x34f3c3=_['merge'](_0x34f3c3,{'model':db[_0x3689ec],'mapToModel':!![],'nest':!![]});if(_0x5a81b2['fields']){_0xedc6df['attributes']['forEach'](function(_0xabbfa9){_0x2ebe1c[_0xc68f('0x8')]('i.'+_0xabbfa9);});}else{_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x76'),_0xc68f('0x42'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x77'),_0xc68f('0x78'));_0x2ebe1c[_0xc68f('0x8')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x140a67==='mail'){_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x79'),_0xc68f('0x7a'));_0x2ebe1c['field']('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',_0xc68f('0x7b'));_0x2ebe1c['field'](_0xc68f('0x7c'));_0x2ebe1c['field']('i.createdAt');_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x7d'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x7e'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x7f'));_0x2ebe1c[_0xc68f('0x8')]('i.attach');_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x80'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x81'));_0x2ebe1c[_0xc68f('0x8')]('i.subject');_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x82'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x6a'));_0x2ebe1c[_0xc68f('0x8')]('i.thirdDisposition');_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x6c'));_0x2ebe1c[_0xc68f('0x8')]('i.to');_0x2ebe1c['field']('i.ContactId');_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x83'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x84'));}else if(_0x140a67==='openchannel'){_0x2ebe1c['field'](_0xc68f('0x85'),_0xc68f('0x7b'));}else{_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x86'),_0xc68f('0x7b'));}if(_0x140a67!==_0xc68f('0x33')){_0x2ebe1c['field'](_0xc68f('0x87'));}_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x88'),_0xc68f('0x89'));_0x2ebe1c[_0xc68f('0x8')]('c.lastName',_0xc68f('0x8a'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x8b'),_0xc68f('0x8c'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x8d'),_0xc68f('0x8e'));_0x2ebe1c['field']('c.mobile',_0xc68f('0x8f'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x90'),_0xc68f('0x91'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x92'),_0xc68f('0x93'));_0x2ebe1c[_0xc68f('0x8')](_0xc68f('0x94'),_0xc68f('0x95'));_0x2ebe1c[_0xc68f('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc68f('0x96'));}if(_0xedc6df['limit']){_0x2ebe1c[_0xc68f('0x97')](_0xedc6df[_0xc68f('0x97')]);}if(_0xedc6df[_0xc68f('0x98')]){_0x2ebe1c['offset'](_0xedc6df[_0xc68f('0x98')]);}return db[_0xc68f('0x99')][_0xc68f('0x9a')](_0x2ebe1c[_0xc68f('0x74')](),_0x34f3c3);})[_0xc68f('0x60')](function(_0xf25ead){_0x5cdfb7=_0xf25ead;var _0x2c1c8a=getUsersQuery(_0x140a67,_0x5cdfb7);return db['sequelize'][_0xc68f('0x9a')](_0x2c1c8a[_0xc68f('0x74')](),_0x34f3c3);})[_0xc68f('0x60')](function(_0x10f814){_0x1beb4f=_[_0xc68f('0x9b')](_0x10f814,_0x238b54);if(_0x140a67==='mail'){return db[_0xc68f('0x9c')][_0xc68f('0x9d')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x5c31a1){var _0x34fc63=_0x5c31a1?_0x5c31a1[_0xc68f('0x9e')]:undefined;var _0x262290=_0x5cdfb7[_0xc68f('0x4e')](function(_0x1a3331){return updateInteraction(_0x1a3331,_0x44ce7f,_0x1beb4f,_0x34fc63);});return Promise[_0xc68f('0x9f')](_0x262290);});}function countFilteredInteractions(_0xc8f2f,_0x4d88a0){var _0x42ab59=_0xc8f2f['clone']();_0x42ab59[_0xc68f('0x8')](_0xc68f('0xa0'));_0x42ab59[_0xc68f('0x8')](_0xc68f('0x76'),'unreadMessages');var _0x5b4254=utils[_0xc68f('0xa1')](_0x4d88a0);if(!_[_0xc68f('0xa2')](_0x5b4254)){_0x42ab59[_0xc68f('0x17')](_0xc68f('0xa3'),_0x5b4254);}var _0x5b3849={'type':db[_0xc68f('0x71')][_0xc68f('0x72')][_0xc68f('0x73')],'raw':!![]};return db[_0xc68f('0x99')][_0xc68f('0x9a')](_0x42ab59[_0xc68f('0x74')](),_0x5b3849);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xf4eb=['chat','Websites','Accounts','resolve','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','unreadMessages','getSelectedTags','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','updateInteraction','getAccountFK','role','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.fullname','ui.','left_join','length','where','map','getInteractionsTables','interactions','cm_contacts','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','isEmail','mail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','end','read','and','Contact','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','tags','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','some','compact','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','then','fields','filter','capitalize'];(function(_0x3777ba,_0x2e3a47){var _0x4d04a7=function(_0x3e25b0){while(--_0x3e25b0){_0x3777ba['push'](_0x3777ba['shift']());}};_0x4d04a7(++_0x2e3a47);}(_0xf4eb,0xec));var _0xbf4e=function(_0x23d492,_0x18ef3d){_0x23d492=_0x23d492-0x0;var _0x55d076=_0xf4eb[_0x23d492];return _0x55d076;};'use strict';var _=require(_0xbf4e('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xbf4e('0x1')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x2e3070,_0x1c7606,_0x32d1d7){var _0x18c665=![];var _0xa4dcf5=utils[_0xbf4e('0x2')](_0x2e3070);if(_0x1c7606[_0xbf4e('0x3')]==='agent'&&!_0x32d1d7[_0xbf4e('0x4')]&&!_0x32d1d7[_0xa4dcf5]){_0x18c665=!![];}return _0x18c665;}function getTagsQuery(){return squel['select']()['field']('id')[_0xbf4e('0x5')](_0xbf4e('0x6'))[_0xbf4e('0x5')](_0xbf4e('0x7'))[_0xbf4e('0x8')](_0xbf4e('0x9'));}function getUsersQuery(_0x177342,_0x580a26){var _0x4d9a07=utils[_0xbf4e('0xa')](_0x177342);var _0x5a8397=_0xbf4e('0xb')+_0x177342+_0xbf4e('0xc');var _0x54a96e=squel[_0xbf4e('0xd')]()['field']('u.id')[_0xbf4e('0x5')](_0xbf4e('0xe'))[_0xbf4e('0x5')](_0xbf4e('0xf')+_0x4d9a07)[_0xbf4e('0x8')](_0x5a8397,'ui')[_0xbf4e('0x10')]('users','u','u.id\x20=\x20ui.UserId');if(_0x580a26[_0xbf4e('0x11')]>0x0){_0x54a96e[_0xbf4e('0x12')](_0xbf4e('0xf')+_0x4d9a07+'\x20IN\x20?',_[_0xbf4e('0x13')](_0x580a26,'id'));}return _0x54a96e;}function getInteractionsQuery(_0x2c292c){var _0x912fc0=utils[_0xbf4e('0x14')](_0x2c292c);var _0x5a631e=utils[_0xbf4e('0x2')](_0x2c292c);var _0x577c27=utils['getInteractionFK'](_0x2c292c);return squel['select']()['from'](_0x912fc0[_0xbf4e('0x15')],'i')[_0xbf4e('0x10')](_0xbf4e('0x16'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xbf4e('0x17'),'o',_0xbf4e('0x18'))[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x19')],'a',_0xbf4e('0x1a')+_0x5a631e)[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x1b')],'me',_0xbf4e('0x1c')+_0x577c27+_0xbf4e('0x1d'))[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x1e')],'it','it.'+_0x577c27+_0xbf4e('0x1d'))[_0xbf4e('0x10')]('tools_tags','t',_0xbf4e('0x1f'));}function getSqlClauses(){var _0x30994d={'body':squel[_0xbf4e('0x20')](),'contact':squel[_0xbf4e('0x20')](),'default':squel[_0xbf4e('0x20')](),'fields':squel['expr'](),'filter':squel[_0xbf4e('0x20')](),'read':squel[_0xbf4e('0x20')](),'tags':{'clause':squel[_0xbf4e('0x20')](),'ids':null},'user':squel['expr']()};return _0x30994d;}function parseTagParameter(_0x2fb490){var _0x5e08b1=squel['expr']();if(_0x2fb490){var _0x2bfccf=utils['getSelectedTags'](_0x2fb490);_0x2bfccf[_0xbf4e('0x21')](function(_0x315df3){_0x5e08b1['or'](_0xbf4e('0x22'),'%,'+_0x315df3+',%');});}return _0x5e08b1;}function parseReadParameter(_0x41f918){var _0x5c912f='';if(_0x41f918){_0x5c912f=_0xbf4e('0x23');if(_0x41f918==='1'){_0x5c912f=_0x5c912f[_0xbf4e('0x24')](_0xbf4e('0x25'),'=');}else{_0x5c912f=_0x5c912f['replace'](_0xbf4e('0x25'),'>');}}return _0x5c912f;}function parseSearchFilter(_0x590c85,_0x1dfa81){var _0x1421e1=squel[_0xbf4e('0x20')]();if(_0x1dfa81){var _0x498dbd=_0x1dfa81[_0xbf4e('0x24')]('\x5c','\x5c\x5c')[_0xbf4e('0x24')](/'/g,'\x27\x27');if(qs[_0xbf4e('0x26')](_0x498dbd)){_0x1421e1['or'](_0xbf4e('0x27'),_0x498dbd+'%');if([_0xbf4e('0x28'),_0xbf4e('0x29')]['includes'](_0x590c85)){_0x1421e1['or'](_0xbf4e('0x2a'),_0x498dbd+'%');}else if(_0x590c85===_0xbf4e('0x2b')){_0x1421e1['or']('i.fax\x20LIKE\x20?',_0x498dbd+'%');}else if(_0x590c85===_0xbf4e('0x2c')){_0x1421e1['or'](_0xbf4e('0x2d'),_0x498dbd+'%');}}else if(_0x590c85==='mail'&&qs[_0xbf4e('0x2e')](_0x498dbd)){_0x1421e1['or']('c.email\x20LIKE\x20?',_0x498dbd+'%');}else{if(_0x590c85===_0xbf4e('0x2f')){_0x1421e1['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf4e('0x30')](_0x498dbd))['or'](_0xbf4e('0x31'),qs[_0xbf4e('0x30')](_0x498dbd));}else{if(_0x590c85!=='fax'){_0x1421e1['or'](_0xbf4e('0x32'),qs[_0xbf4e('0x30')](_0x498dbd));}_0x1421e1['or'](_0xbf4e('0x33'),_0x498dbd+'%');}}}return _0x1421e1;}function parseAdvancedSearchFilter(_0x29d6aa,_0xb93672){var _0x477873=getSqlClauses();var _0x5b8440=as[_0xbf4e('0x34')](_0x29d6aa);var _0x3dbb2b=_0x5b8440[_0xbf4e('0x35')];for(var _0x3bba55=0x0;_0x3bba55<_0x5b8440[_0xbf4e('0x36')]['length'];_0x3bba55++){var _0x4864bd=_0x5b8440['conditions'][_0x3bba55];var _0x4be59a='i';var _0x429c07=_[_0xbf4e('0x37')](_0xb93672,[_0xbf4e('0x6'),_0x4864bd[_0xbf4e('0x5')]]);if(_0x429c07){var _0x22ddde=as[_0xbf4e('0x38')](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x3a')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde['value']['start'],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);}else{switch(_0x4864bd[_0xbf4e('0x5')]){case'unreadMessages':var _0x3f46f1=parseReadParameter(_0x4864bd['value']);_0x477873[_0xbf4e('0x3e')][_0xbf4e('0x3f')](_0x3f46f1);break;case _0xbf4e('0x40'):if(_0x4864bd[_0xbf4e('0x41')]==='$substring'){if(_0x4864bd[_0xbf4e('0x3c')][_0xbf4e('0x42')]('\x20')[_0xbf4e('0x11')]>0x1){_0x477873[_0xbf4e('0x43')][_0x3dbb2b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf4e('0x30')](_0x4864bd[_0xbf4e('0x3c')]),null);}else{var _0x148d94='%'+_0x4864bd[_0xbf4e('0x3c')]+'%';_0x477873[_0xbf4e('0x43')][_0x3dbb2b](_0xbf4e('0x44'),_0x148d94,_0x148d94,_0x148d94);}}else{_0x429c07=_[_0xbf4e('0x37')](_0xb93672,['name',_0xbf4e('0x45')]);_0x4864bd[_0xbf4e('0x5')]='ContactId';_0x22ddde=as['buildExpression'](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x43')][_0x3dbb2b](_0x22ddde['text'],_0x22ddde['value'][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);}break;case _0xbf4e('0x47'):var _0x2ee1b4=_0x4864bd[_0xbf4e('0x3c')]['split'](',')[_0xbf4e('0x13')](function(_0x7bd91){return Number(_0x7bd91);});var _0x4d31b6=parseTagParameter(_0x2ee1b4);_0x477873['tags']['clause']['and'](_0x4d31b6);_0x477873[_0xbf4e('0x48')]['ids']=_0x2ee1b4;break;case _0xbf4e('0x49'):if(_0x4864bd[_0xbf4e('0x41')]==='$substring'){_0x477873['user'][_0x3dbb2b](_0xbf4e('0x4a'),'%'+_0x4864bd[_0xbf4e('0x3c')]+'%',null);}else{_0x429c07=_[_0xbf4e('0x37')](_0xb93672,[_0xbf4e('0x6'),_0xbf4e('0x4b')]);_0x4864bd['field']=_0xbf4e('0x4b');_0x22ddde=as[_0xbf4e('0x38')](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x4c')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')]['end']);}break;case _0xbf4e('0x4d'):case _0xbf4e('0x4e'):_0x22ddde=as[_0xbf4e('0x38')]('me',null,_0x4864bd);_0x477873[_0xbf4e('0x4d')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);break;}}}return _0x477873;}function parseModelFields(_0x3447ab,_0x2fdba9,_0x6fd78d){var _0x370d4c=utils[_0xbf4e('0x2')](_0x3447ab);var _0x24fb7d=squel[_0xbf4e('0x20')]();var _0x10bc23=_(_0x2fdba9)['keys']()[_0xbf4e('0x13')](function(_0x17a7be){return _[_0xbf4e('0x4f')](_0x6fd78d,['name',_0x17a7be])?_0x17a7be:undefined;})[_0xbf4e('0x50')]()['value']();if(_0x10bc23['length']>0x0){_0x10bc23[_0xbf4e('0x21')](function(_0x200393){if(_0x200393===_0x370d4c){_0x24fb7d['and']('i.'+_0x370d4c+_0xbf4e('0x51'),[][_0xbf4e('0x52')](_0x2fdba9[_0x200393]));}else if(_0x200393===_0xbf4e('0x53')){var _0xa7af68=JSON[_0xbf4e('0x54')](_0x2fdba9[_0x200393])[_0xbf4e('0x55')];var _0x419969=JSON[_0xbf4e('0x54')](_0x2fdba9[_0x200393])[_0xbf4e('0x56')];_0x24fb7d[_0xbf4e('0x3f')](_0xbf4e('0x57'),_0xa7af68,_0x419969);}else{if(_0x2fdba9[_0x200393]==='null'){_0x24fb7d['and']('i.'+_0x200393+_0xbf4e('0x58'));}else{_0x24fb7d[_0xbf4e('0x3f')]('i.'+_0x200393+_0xbf4e('0x59'),_0x2fdba9[_0x200393]);}}});}return _0x24fb7d;}function parseQueryParameters(_0x586f5d,_0x339ce6,_0x3924dc){var _0x481c06=getSqlClauses();return Promise['resolve']()[_0xbf4e('0x5a')](function(){return parseModelFields(_0x586f5d,_0x339ce6,_0x3924dc);})['then'](function(_0x510548){_0x481c06[_0xbf4e('0x5b')][_0xbf4e('0x3f')](_0x510548);return parseReadParameter(_0x339ce6[_0xbf4e('0x3e')]);})[_0xbf4e('0x5a')](function(_0x6ff233){_0x481c06['read'][_0xbf4e('0x3f')](_0x6ff233);return parseTagParameter(_0x339ce6['tag']);})[_0xbf4e('0x5a')](function(_0x53875e){_0x481c06[_0xbf4e('0x48')]['clause'][_0xbf4e('0x3f')](_0x53875e);return parseSearchFilter(_0x586f5d,_0x339ce6[_0xbf4e('0x5c')]);})[_0xbf4e('0x5a')](function(_0x16592f){_0x481c06[_0xbf4e('0x5c')]=_0x16592f;return _0x481c06;});}function checkAccountsRestrictions(_0x52dfc4,_0x55a17d,_0x5a0f4a){var _0x52ea6e=utils[_0xbf4e('0x2')](_0x52dfc4);var _0x453411='get'+_[_0xbf4e('0x5d')](_0x52dfc4)+(_0x52dfc4===_0xbf4e('0x5e')?_0xbf4e('0x5f'):_0xbf4e('0x60'));var _0x17c2e1=squel[_0xbf4e('0x20')]();return Promise[_0xbf4e('0x61')]()['then'](function(){if(_0x5a0f4a[_0xbf4e('0x4')]&&_0x55a17d[_0xbf4e('0x3')]===_0xbf4e('0x62')){return _0x55a17d[_0x453411]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x56338e){if(_0x56338e){if(_0x56338e[_0xbf4e('0x11')]===0x0){_0x17c2e1[_0xbf4e('0x3f')]('i.'+_0x52ea6e+_0xbf4e('0x58'));}else{_0x17c2e1['and']('i.'+_0x52ea6e+_0xbf4e('0x51'),_[_0xbf4e('0x13')](_0x56338e,'id'));}}else if(!_0x5a0f4a[_0x52ea6e]){_0x17c2e1[_0xbf4e('0x3f')]('i.'+_0x52ea6e+_0xbf4e('0x63'));}})[_0xbf4e('0x5a')](function(){return _0x17c2e1;});}function getClosedOrderClause(_0x5532df,_0x35ce41){var _0x3ee848='';var _0x238a99=[_0xbf4e('0x64'),_0xbf4e('0x65'),_0xbf4e('0x66')];if(_0x5532df==='mail'){_0x238a99[_0xbf4e('0x67')]('i.substatus');}if(_0x35ce41[_0xbf4e('0x68')]==='0'&&_0x5532df===_0xbf4e('0x2f')){_0x3ee848=_0xbf4e('0x69');}else{if(_0x35ce41[_0xbf4e('0x68')]==='1'){_0x238a99[_0xbf4e('0x6a')]();}_0x3ee848=_0xbf4e('0x6b')+_0x238a99[_0xbf4e('0x6c')](',\x20')+')';}return _0x3ee848;}function getFilteredInteractions(_0x1149c2,_0x4ea377,_0x1aeedd,_0x325d09){var _0x22d5e1=utils[_0xbf4e('0xa')](_0x1149c2);var _0x1c0ecb=_['capitalize'](_0x1149c2)+_0xbf4e('0x6d');var _0x753f25=[];var _0x405bec=getTagsQuery();var _0x1770ca={'type':db[_0xbf4e('0x6e')][_0xbf4e('0x6f')]['SELECT'],'raw':!![]};var _0x2246a2=[];var _0x59ea50=[];return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x405bec[_0xbf4e('0x72')](),_0x1770ca)[_0xbf4e('0x5a')](function(_0x4bff77){_0x753f25=_[_0xbf4e('0x73')](_0x4bff77,'id');_0x1770ca=_['merge'](_0x1770ca,{'model':db[_0x1c0ecb],'mapToModel':!![],'nest':!![]});if(_0x1aeedd['fields']){_0x325d09[_0xbf4e('0x74')][_0xbf4e('0x21')](function(_0x3a00ca){_0x4ea377['field']('i.'+_0x3a00ca);});}else{_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x75'),'unreadMessages');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x76'),_0xbf4e('0x77'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x78'),_0xbf4e('0x79'));if(_0x1149c2===_0xbf4e('0x2f')){_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7a'),'Account.email');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7b'),_0xbf4e('0x7c'));_0x4ea377[_0xbf4e('0x5')]('i.id');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7d'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7e'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7f'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x80'));_0x4ea377[_0xbf4e('0x5')]('i.attach');_0x4ea377[_0xbf4e('0x5')]('i.lastMsgAt');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x81'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x82'));_0x4ea377[_0xbf4e('0x5')]('i.disposition');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x65'));_0x4ea377[_0xbf4e('0x5')]('i.thirdDisposition');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x69'));_0x4ea377[_0xbf4e('0x5')]('i.to');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x83'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x84'));_0x4ea377[_0xbf4e('0x5')]('i.UserId');}else if(_0x1149c2===_0xbf4e('0x2c')){_0x4ea377['field'](_0xbf4e('0x85'),'contactName');}else{_0x4ea377[_0xbf4e('0x5')]('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',_0xbf4e('0x7c'));}if(_0x1149c2!=='mail'){_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x86'));}_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x87'),_0xbf4e('0x88'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x89'),'Contact.lastName');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x8a'),_0xbf4e('0x8b'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x8c'),_0xbf4e('0x8d'));_0x4ea377['field'](_0xbf4e('0x8e'),_0xbf4e('0x8f'));_0x4ea377['field'](_0xbf4e('0x90'),_0xbf4e('0x91'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x92'),_0xbf4e('0x93'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x94'),_0xbf4e('0x95'));_0x4ea377[_0xbf4e('0x5')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbf4e('0x96'));}if(_0x325d09[_0xbf4e('0x97')]){_0x4ea377[_0xbf4e('0x97')](_0x325d09['limit']);}if(_0x325d09[_0xbf4e('0x98')]){_0x4ea377[_0xbf4e('0x98')](_0x325d09['offset']);}return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x4ea377[_0xbf4e('0x72')](),_0x1770ca);})[_0xbf4e('0x5a')](function(_0x15d424){_0x2246a2=_0x15d424;var _0x1cc939=getUsersQuery(_0x1149c2,_0x2246a2);return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x1cc939[_0xbf4e('0x72')](),_0x1770ca);})[_0xbf4e('0x5a')](function(_0x55bc7c){_0x59ea50=_['groupBy'](_0x55bc7c,_0x22d5e1);if(_0x1149c2===_0xbf4e('0x2f')){return db[_0xbf4e('0x99')][_0xbf4e('0x9a')]({'attributes':[_0xbf4e('0x9b')],'raw':!![]});}})['then'](function(_0x19108b){var _0x30e5c1=_0x19108b?_0x19108b[_0xbf4e('0x9b')]:undefined;var _0x99d48d=_0x2246a2[_0xbf4e('0x13')](function(_0xf27015){return updateInteraction(_0xf27015,_0x753f25,_0x59ea50,_0x30e5c1);});return Promise[_0xbf4e('0x9c')](_0x99d48d);});}function countFilteredInteractions(_0x4af65a,_0x34b766){var _0x54d5ac=_0x4af65a[_0xbf4e('0x9d')]();_0x54d5ac[_0xbf4e('0x5')](_0xbf4e('0x9e'));_0x54d5ac[_0xbf4e('0x5')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbf4e('0x9f'));var _0x25ce6d=utils[_0xbf4e('0xa0')](_0x34b766);if(!_[_0xbf4e('0xa1')](_0x25ce6d)){_0x54d5ac[_0xbf4e('0x12')](_0xbf4e('0xa2'),_0x25ce6d);}var _0x2992b4={'type':db['Sequelize']['QueryTypes'][_0xbf4e('0xa3')],'raw':!![]};return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x54d5ac[_0xbf4e('0x72')](),_0x2992b4);}module[_0xbf4e('0xa4')]={'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 9e394f9..b0908e2 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 _0xed79=['fullname','split','forEach','push','waiting','talking','answered','unmanaged','total','disposition','abandoned','UserId','MailMessage','findOne','out','plainBody','-id','then','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map'];(function(_0x10bf80,_0x322339){var _0x373261=function(_0x5c6927){while(--_0x5c6927){_0x10bf80['push'](_0x10bf80['shift']());}};_0x373261(++_0x322339);}(_0xed79,0x1eb));var _0x9ed7=function(_0x1814b4,_0x1ebeac){_0x1814b4=_0x1814b4-0x0;var _0x1925d4=_0xed79[_0x1814b4];return _0x1925d4;};'use strict';var _=require(_0x9ed7('0x0'));var db=require(_0x9ed7('0x1'))['db'];function getInteractionUsers(_0x5baf02,_0x5a416d){return new Promise(function(_0x2075f2,_0x41dcc4){try{var _0x52bebc=[];if(_0x5a416d[_0x5baf02]){_0x52bebc=_0x5a416d[_0x5baf02][_0x9ed7('0x2')](function(_0x5ac457){return{'id':_0x5ac457['id'],'fullname':_0x5ac457[_0x9ed7('0x3')]};});}return _0x2075f2(_0x52bebc);}catch(_0x54f08a){_0x41dcc4(_0x54f08a);}});}function getInteractionTags(_0x17295a,_0x1dea8b){var _0x409b05=[];if(_0x17295a){_0x17295a[_0x9ed7('0x4')](',')[_0x9ed7('0x5')](function(_0x584be9){_0x409b05[_0x9ed7('0x6')](_0x1dea8b[_0x584be9]);});}return _0x409b05;}function updateWaitingCounter(_0x56f96e){if(_0x56f96e['waiting']){_0x56f96e[_0x9ed7('0x7')]-=0x1;}}function updateInteractionCounters(_0x3ff6cb){_0x3ff6cb[_0x9ed7('0x7')]=0x0;_0x3ff6cb[_0x9ed7('0x8')]=0x0;_0x3ff6cb[_0x9ed7('0x9')]=0x0;_0x3ff6cb[_0x9ed7('0xa')]=0x0;_0x3ff6cb['abandoned']=0x0;_0x3ff6cb[_0x9ed7('0xb')]=0x0;if(_0x3ff6cb['closed']){if(_0x3ff6cb[_0x9ed7('0xc')]===_0x9ed7('0xd')){_0x3ff6cb[_0x9ed7('0xd')]+=0x1;updateWaitingCounter(_0x3ff6cb);}if(_0x3ff6cb[_0x9ed7('0xe')]){_0x3ff6cb[_0x9ed7('0x9')]+=0x1;if(_0x3ff6cb[_0x9ed7('0x8')]){_0x3ff6cb[_0x9ed7('0x8')]-=0x1;}}else{if(_0x3ff6cb[_0x9ed7('0xc')]){_0x3ff6cb[_0x9ed7('0xa')]+=0x1;updateWaitingCounter(_0x3ff6cb);}}}else{if(!_0x3ff6cb[_0x9ed7('0xe')]){_0x3ff6cb[_0x9ed7('0x7')]+=0x1;}if(_0x3ff6cb[_0x9ed7('0xe')]){_0x3ff6cb[_0x9ed7('0x8')]+=0x1;updateWaitingCounter(_0x3ff6cb);}}_0x3ff6cb[_0x9ed7('0xb')]+=0x1;return _0x3ff6cb;}function getLastMessageText(_0x3dc8dc){return db[_0x9ed7('0xf')][_0x9ed7('0x10')]({'where':{'$and':[{'MailInteractionId':_0x3dc8dc['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9ed7('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9ed7('0x12')],'order':_0x9ed7('0x13'),'raw':!![]})[_0x9ed7('0x14')](function(_0x17e1fc){if(_0x17e1fc&&_0x17e1fc[_0x9ed7('0x12')]){_0x3dc8dc['lastMsgText']=_[_0x9ed7('0x15')](_0x17e1fc[_0x9ed7('0x12')]);}return _0x3dc8dc;})[_0x9ed7('0x16')](function(_0x5de1c9){throw _0x5de1c9;});}exports[_0x9ed7('0x17')]=function(_0x1e2521,_0x120f0d,_0xb86a38,_0x50c81b){return new Promise(function(_0x142ef9,_0x39278d){return getInteractionUsers(_0x1e2521['id'],_0xb86a38)[_0x9ed7('0x14')](function(_0x4e35dc){_0x1e2521['Users']=_0x4e35dc;return getInteractionTags(_0x1e2521[_0x9ed7('0x18')],_0x120f0d);})['then'](function(_0x39e118){_0x1e2521[_0x9ed7('0x19')]=_0x39e118;delete _0x1e2521[_0x9ed7('0x18')];return updateInteractionCounters(_0x1e2521);})[_0x9ed7('0x14')](function(_0x452398){if(_0x50c81b){return getLastMessageText(_0x452398);}else{return _0x452398;}})['then'](function(_0x4ae0a0){_0x142ef9(_0x4ae0a0);})[_0x9ed7('0x16')](function(_0x410c31){_0x39278d(_0x410c31);});});}; \ No newline at end of file +var _0x45d4=['push','waiting','talking','answered','unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','TagIds','lodash','../../mysqldb','forEach'];(function(_0x190733,_0x4536ec){var _0x1021d7=function(_0x5cb8ee){while(--_0x5cb8ee){_0x190733['push'](_0x190733['shift']());}};_0x1021d7(++_0x4536ec);}(_0x45d4,0xb5));var _0x445d=function(_0x2aac38,_0x4cf347){_0x2aac38=_0x2aac38-0x0;var _0x1992af=_0x45d4[_0x2aac38];return _0x1992af;};'use strict';var _=require(_0x445d('0x0'));var db=require(_0x445d('0x1'))['db'];function getInteractionUsers(_0x41c6e0,_0x40a3aa){return new Promise(function(_0x51abe7,_0x895d78){try{var _0x3219b5=[];if(_0x40a3aa[_0x41c6e0]){_0x3219b5=_0x40a3aa[_0x41c6e0]['map'](function(_0x30e6e0){return{'id':_0x30e6e0['id'],'fullname':_0x30e6e0['fullname']};});}return _0x51abe7(_0x3219b5);}catch(_0x40c635){_0x895d78(_0x40c635);}});}function getInteractionTags(_0x286e70,_0x15d8cd){var _0x4a2afd=[];if(_0x286e70){_0x286e70['split'](',')[_0x445d('0x2')](function(_0x5d85ae){_0x4a2afd[_0x445d('0x3')](_0x15d8cd[_0x5d85ae]);});}return _0x4a2afd;}function updateWaitingCounter(_0x544cbc){if(_0x544cbc[_0x445d('0x4')]){_0x544cbc[_0x445d('0x4')]-=0x1;}}function updateInteractionCounters(_0x5052cb){_0x5052cb[_0x445d('0x4')]=0x0;_0x5052cb[_0x445d('0x5')]=0x0;_0x5052cb[_0x445d('0x6')]=0x0;_0x5052cb[_0x445d('0x7')]=0x0;_0x5052cb['abandoned']=0x0;_0x5052cb[_0x445d('0x8')]=0x0;if(_0x5052cb[_0x445d('0x9')]){if(_0x5052cb[_0x445d('0xa')]===_0x445d('0xb')){_0x5052cb[_0x445d('0xb')]+=0x1;updateWaitingCounter(_0x5052cb);}if(_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x6')]+=0x1;if(_0x5052cb['talking']){_0x5052cb[_0x445d('0x5')]-=0x1;}}else{if(_0x5052cb[_0x445d('0xa')]){_0x5052cb['unmanaged']+=0x1;updateWaitingCounter(_0x5052cb);}}}else{if(!_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x4')]+=0x1;}if(_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x5')]+=0x1;updateWaitingCounter(_0x5052cb);}}_0x5052cb[_0x445d('0x8')]+=0x1;return _0x5052cb;}function getLastMessageText(_0x724d8b){return db[_0x445d('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x724d8b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x445d('0xe')],'order':'-id','raw':!![]})[_0x445d('0xf')](function(_0x267404){if(_0x267404&&_0x267404['plainBody']){_0x724d8b[_0x445d('0x10')]=_[_0x445d('0x11')](_0x267404[_0x445d('0xe')]);}return _0x724d8b;})[_0x445d('0x12')](function(_0x3b5ade){throw _0x3b5ade;});}exports[_0x445d('0x13')]=function(_0x396174,_0x190b77,_0x4f52e5,_0xd0aff9){return new Promise(function(_0x150c8a,_0x29982c){return getInteractionUsers(_0x396174['id'],_0x4f52e5)['then'](function(_0x4fb54b){_0x396174[_0x445d('0x14')]=_0x4fb54b;return getInteractionTags(_0x396174['TagIds'],_0x190b77);})[_0x445d('0xf')](function(_0x596cdf){_0x396174[_0x445d('0x15')]=_0x596cdf;delete _0x396174[_0x445d('0x16')];return updateInteractionCounters(_0x396174);})[_0x445d('0xf')](function(_0x136d3b){if(_0xd0aff9){return getLastMessageText(_0x136d3b);}else{return _0x136d3b;}})[_0x445d('0xf')](function(_0x4dd0aa){_0x150c8a(_0x4dd0aa);})[_0x445d('0x12')](function(_0x1605b9){_0x29982c(_0x1605b9);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 06a785f..db82ed7 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 _0x393f=['unknown','accounts','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','update','catch','error','exports','lodash','../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst'];(function(_0x4a8e3b,_0x1cbd0a){var _0x2aa1e9=function(_0x1a83ff){while(--_0x1a83ff){_0x4a8e3b['push'](_0x4a8e3b['shift']());}};_0x2aa1e9(++_0x1cbd0a);}(_0x393f,0x18b));var _0xf393=function(_0x4c24fe,_0x44d7e3){_0x4c24fe=_0x4c24fe-0x0;var _0x1db772=_0x393f[_0x4c24fe];return _0x1db772;};'use strict';var _=require(_0xf393('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xf393('0x1'))(_0xf393('0x2')),'mail':require(_0xf393('0x1'))('mail-interactions'),'fax':require('../../config/logger')(_0xf393('0x3')),'sms':require(_0xf393('0x1'))('sms-interactions'),'chat':require(_0xf393('0x1'))(_0xf393('0x4')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x2601e9){return _[_0xf393('0x5')](_0x2601e9)+(_0x2601e9===_0xf393('0x6')?_0xf393('0x7'):_0xf393('0x8'))+'Id';}function getInteractionFK(_0x428b3e){return _[_0xf393('0x5')](_0x428b3e)+_0xf393('0x9');}function getInteractionId(_0x4b86eb,_0x14b883,_0x4cecbd){if(_0x4b86eb&&_0x4b86eb[_[_0xf393('0xa')](_0x4cecbd)+_0xf393('0x9')]){return _0x4b86eb[_[_0xf393('0xa')](_0x4cecbd)+_0xf393('0x9')];}else if(_0x4b86eb&&_0x4b86eb['id']){return _0x4b86eb['id'];}else if(_0x14b883&&_0x14b883['id']){return _0x14b883['id'];}else{return _0xf393('0xb');}}function getInteractionsTables(_0x129c52){return{'accounts':_0x129c52+'_'+(_0x129c52===_0xf393('0x6')?'websites':_0xf393('0xc')),'interactions':_0x129c52+'_interactions','interactionsTags':_0x129c52+'_interaction_has_tags','messages':_0x129c52+_0xf393('0xd'),'userInteractions':_0xf393('0xe')+_0x129c52+_0xf393('0xf')};}function getSelectedTags(_0x72f5f6){var _0x5c3b6e=[];if(_0x72f5f6){_0x5c3b6e=Array[_0xf393('0x10')](_0x72f5f6)?_0x72f5f6:[_0x72f5f6];}return _0x5c3b6e;}function log(_0x23b38b,_0x48507a,_0x5d65a3,_0x5d9160,_0x1d31d3,_0x3c4555){loggers[_0x1d31d3[_0xf393('0x11')]()][_0x23b38b](_0xf393('0x12'),_0x3c4555['toUpperCase'](),_0x48507a?_0x48507a['id']:null,_0x48507a?_0x48507a[_0xf393('0x13')]:null,_0x48507a?_0x48507a[_0xf393('0x14')]:null,getInteractionId(_0x5d65a3,_0x5d9160,_0x1d31d3),_0x5d65a3?JSON[_0xf393('0x15')](_0x5d65a3):_0xf393('0x16'));}function updateUser(_0x304241,_0x3db37a,_0x634f54,_0x52786c,_0x3f8d3c){db[_[_0xf393('0xa')](_0x52786c)+'Interaction'][_0xf393('0x17')]({'where':{'id':getInteractionId(_0x3db37a,_0x634f54,_0x52786c)}})[_0xf393('0x18')](function(_0x585b22){if(_0x585b22){return _0x585b22[_0xf393('0x19')]({'UserId':_0x304241?_0x304241['id']:null});}})[_0xf393('0x18')](function(_0x50961d){if(_0x50961d){log('info',_0x304241,_0x3db37a,_0x634f54,_0x52786c,_0x3f8d3c);}})[_0xf393('0x1a')](function(){log(_0xf393('0x1b'),_0x304241,_0x3db37a,_0x634f54,_0x52786c,_0x3f8d3c);});}module[_0xf393('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x6670=['capitalize','Account','InteractionId','upperFirst','unknown','chat','websites','accounts','_interaction_has_tags','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','then','update','info','catch','error','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x6670,0x1d9));var _0x0667=function(_0x4d925c,_0x1265ab){_0x4d925c=_0x4d925c-0x0;var _0x334860=_0x6670[_0x4d925c];return _0x334860;};'use strict';var _=require(_0x0667('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0667('0x1'))(_0x0667('0x2')),'mail':require('../../config/logger')(_0x0667('0x3')),'fax':require('../../config/logger')(_0x0667('0x4')),'sms':require('../../config/logger')(_0x0667('0x5')),'chat':require(_0x0667('0x1'))(_0x0667('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x1f9751){return _[_0x0667('0x7')](_0x1f9751)+(_0x1f9751==='chat'?'Website':_0x0667('0x8'))+'Id';}function getInteractionFK(_0x424865){return _[_0x0667('0x7')](_0x424865)+_0x0667('0x9');}function getInteractionId(_0x5a24a1,_0x1312bb,_0x4216f5){if(_0x5a24a1&&_0x5a24a1[_[_0x0667('0xa')](_0x4216f5)+'InteractionId']){return _0x5a24a1[_[_0x0667('0xa')](_0x4216f5)+_0x0667('0x9')];}else if(_0x5a24a1&&_0x5a24a1['id']){return _0x5a24a1['id'];}else if(_0x1312bb&&_0x1312bb['id']){return _0x1312bb['id'];}else{return _0x0667('0xb');}}function getInteractionsTables(_0x4949e6){return{'accounts':_0x4949e6+'_'+(_0x4949e6===_0x0667('0xc')?_0x0667('0xd'):_0x0667('0xe')),'interactions':_0x4949e6+'_interactions','interactionsTags':_0x4949e6+_0x0667('0xf'),'messages':_0x4949e6+'_messages','userInteractions':_0x0667('0x10')+_0x4949e6+_0x0667('0x11')};}function getSelectedTags(_0x3ac84e){var _0x196122=[];if(_0x3ac84e){_0x196122=Array[_0x0667('0x12')](_0x3ac84e)?_0x3ac84e:[_0x3ac84e];}return _0x196122;}function log(_0x947e57,_0x41881a,_0xc99f2,_0x48d6cd,_0x40b9e6,_0x38d0ac){loggers[_0x40b9e6[_0x0667('0x13')]()][_0x947e57](_0x0667('0x14'),_0x38d0ac[_0x0667('0x15')](),_0x41881a?_0x41881a['id']:null,_0x41881a?_0x41881a[_0x0667('0x16')]:null,_0x41881a?_0x41881a[_0x0667('0x17')]:null,getInteractionId(_0xc99f2,_0x48d6cd,_0x40b9e6),_0xc99f2?JSON['stringify'](_0xc99f2):'null');}function updateUser(_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a){db[_[_0x0667('0xa')](_0x4f232c)+_0x0667('0x18')]['findOne']({'where':{'id':getInteractionId(_0x5e5173,_0x383360,_0x4f232c)}})[_0x0667('0x19')](function(_0x2d7bf5){if(_0x2d7bf5){return _0x2d7bf5[_0x0667('0x1a')]({'UserId':_0x2d37bc?_0x2d37bc['id']:null});}})['then'](function(_0x19accd){if(_0x19accd){log(_0x0667('0x1b'),_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a);}})[_0x0667('0x1c')](function(){log(_0x0667('0x1d'),_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a);});}module['exports']={'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 9407935..c37eb99 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 _0x3e64=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','utf8','final','parse','hasOwnProperty','use','findOne','count','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','composable-middleware'];(function(_0x54d6b2,_0x353342){var _0x4e22ca=function(_0xfb8b92){while(--_0xfb8b92){_0x54d6b2['push'](_0x54d6b2['shift']());}};_0x4e22ca(++_0x353342);}(_0x3e64,0x1df));var _0x43e6=function(_0x4d1297,_0x5a9a8c){_0x4d1297=_0x4d1297-0x0;var _0x562304=_0x3e64[_0x4d1297];return _0x562304;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x43e6('0x0'));var db=require(_0x43e6('0x1'))['db'];var config=require(_0x43e6('0x2'));function getValueFromLicense(_0x1ab69b,_0x51763a){if(_0x1ab69b&&_0x51763a){if(_0x51763a[_0x43e6('0x3')]&&_0x51763a['license']){var _0x50d028=_0x51763a['data1'];var _0x1c79e3=_0x51763a[_0x43e6('0x4')];var _0x488729=_0x50d028[_0x43e6('0x5')]('-')[0x4];var _0x3b92f3=_0x50d028['split']('-')[0x0];var _0x34da6b=crypto[_0x43e6('0x6')](_0x43e6('0x7'),util[_0x43e6('0x8')]('%s:%s:%s',_0x488729,_0x50d028,_0x3b92f3));var _0x3105d7=_0x34da6b[_0x43e6('0x9')](_0x1c79e3,'base64',_0x43e6('0xa'));_0x3105d7+=_0x34da6b[_0x43e6('0xb')]('utf8');var _0x44fb4b=JSON[_0x43e6('0xc')](_0x3105d7);return _0x44fb4b[_0x43e6('0xd')](_0x1ab69b)?_0x44fb4b[_0x1ab69b]:null;}}return null;}function isLimit(_0x4435dd,_0x18f034,_0x276c67,_0x4c4e7e){var _0xafe22a=_0x18f034;return compose()[_0x43e6('0xe')](function(_0x5cc807,_0x539a04,_0x42e51c){return db['License'][_0x43e6('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x45f0c9){var _0x37f628=getValueFromLicense(_0x4435dd,_0x45f0c9);return _0x37f628?_0x37f628:_0xafe22a;})['then'](function(_0x280b2f){_0xafe22a=_0x280b2f;return _0x276c67[_0x43e6('0x10')](_0x4c4e7e);})[_0x43e6('0x11')](function(_0x4e85be){if(_0x4e85be>=_0xafe22a){return _0x539a04[_0x43e6('0x12')](0x193)['json']({'message':util[_0x43e6('0x8')](_0x43e6('0x13'),_0x4435dd)});}_0x42e51c();})['catch'](function(_0x1585d4){_0x42e51c(_0x1585d4);});});}function isUserLimit(){return isLimit(_0x43e6('0x14'),0x1,db[_0x43e6('0x15')],{'where':{'$or':[{'role':_0x43e6('0x16')},{'role':'user'}]}});}exports[_0x43e6('0x17')]=isUserLimit; \ No newline at end of file +var _0xc0aa=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','crypto','util','../../mysqldb'];(function(_0x745c75,_0x1d59e1){var _0x3ca2e7=function(_0x4fcd00){while(--_0x4fcd00){_0x745c75['push'](_0x745c75['shift']());}};_0x3ca2e7(++_0x1d59e1);}(_0xc0aa,0x185));var _0xac0a=function(_0x102cdb,_0x2e326){_0x102cdb=_0x102cdb-0x0;var _0x2163c6=_0xc0aa[_0x102cdb];return _0x2163c6;};'use strict';var crypto=require(_0xac0a('0x0'));var util=require(_0xac0a('0x1'));var compose=require('composable-middleware');var db=require(_0xac0a('0x2'))['db'];var config=require(_0xac0a('0x3'));function getValueFromLicense(_0x5e07fd,_0x93e316){if(_0x5e07fd&&_0x93e316){if(_0x93e316[_0xac0a('0x4')]&&_0x93e316[_0xac0a('0x5')]){var _0x1cc3b9=_0x93e316['data1'];var _0x5eb95c=_0x93e316['license'];var _0x126ec9=_0x1cc3b9[_0xac0a('0x6')]('-')[0x4];var _0x30212e=_0x1cc3b9[_0xac0a('0x6')]('-')[0x0];var _0x319fbd=crypto[_0xac0a('0x7')](_0xac0a('0x8'),util[_0xac0a('0x9')](_0xac0a('0xa'),_0x126ec9,_0x1cc3b9,_0x30212e));var _0x462eb5=_0x319fbd[_0xac0a('0xb')](_0x5eb95c,_0xac0a('0xc'),_0xac0a('0xd'));_0x462eb5+=_0x319fbd['final'](_0xac0a('0xd'));var _0x21d725=JSON[_0xac0a('0xe')](_0x462eb5);return _0x21d725[_0xac0a('0xf')](_0x5e07fd)?_0x21d725[_0x5e07fd]:null;}}return null;}function isLimit(_0x2ad592,_0x91be49,_0x114a3b,_0x1f5ba1){var _0xe38dfb=_0x91be49;return compose()[_0xac0a('0x10')](function(_0x13052f,_0x397bc9,_0x42418f){return db[_0xac0a('0x11')][_0xac0a('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xac0a('0x13')](function(_0xcd10e5){var _0x13288b=getValueFromLicense(_0x2ad592,_0xcd10e5);return _0x13288b?_0x13288b:_0xe38dfb;})['then'](function(_0x5cc1e5){_0xe38dfb=_0x5cc1e5;return _0x114a3b[_0xac0a('0x14')](_0x1f5ba1);})[_0xac0a('0x13')](function(_0x3f4fc3){if(_0x3f4fc3>=_0xe38dfb){return _0x397bc9[_0xac0a('0x15')](0x193)[_0xac0a('0x16')]({'message':util[_0xac0a('0x9')](_0xac0a('0x17'),_0x2ad592)});}_0x42418f();})[_0xac0a('0x18')](function(_0x21f493){_0x42418f(_0x21f493);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xac0a('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0xac0a('0x1a')}]}});}exports[_0xac0a('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4e326b4..b1d7171 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 _0xe17c=['$between','value','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$and]','replace','[$or]','split','slice','forEach','shift','indexOf','map','conditions','DATE','operator','$eq'];(function(_0x2c8322,_0x51ddf6){var _0x3386f7=function(_0x540ab1){while(--_0x540ab1){_0x2c8322['push'](_0x2c8322['shift']());}};_0x3386f7(++_0x51ddf6);}(_0xe17c,0xc3));var _0xce17=function(_0x5721fc,_0x5f3c22){_0x5721fc=_0x5721fc-0x0;var _0x1bbf79=_0xe17c[_0x5721fc];return _0x1bbf79;};'use strict';var _=require(_0xce17('0x0'));var moment=require('moment');exports[_0xce17('0x1')]=function(_0x8e8eaa){var _0x4de3cf={'conditions':[]};_0x4de3cf[_0xce17('0x2')]=_[_0xce17('0x3')](_0x8e8eaa,'[$or]')?'or':'and';var _0x525147=_0x8e8eaa['replace'](_0xce17('0x4'),'')[_0xce17('0x5')](_0xce17('0x6'),'')['split']('||');for(var _0x3967b9=0x0;_0x3967b9<_0x525147['length'];_0x3967b9++){var _0x464996=_0x525147[_0x3967b9][_0xce17('0x7')](':=');var _0x23aca0=_0x464996[0x0];var _0x4d0edb=_0x464996[_0xce17('0x8')](0x1);_0x4d0edb[_0xce17('0x9')](function(_0x4abe9e){var _0x439091=_0x4abe9e[_0xce17('0x7')]('[')[_0xce17('0xa')]();var _0x58ee39=_0x4abe9e['match'](/\[(.*?)\]/g);_0x58ee39[_0xce17('0x9')](function(_0x1adad1){var _0x126235=_0x1adad1[_0xce17('0x7')]('[')['filter'](function(_0xd7c708){return _0xd7c708[_0xce17('0xb')](']')>-0x1;})[_0xce17('0xc')](function(_0x11bf59){return _0x11bf59[_0xce17('0x7')](']')[0x0];})[0x0];_0x4de3cf[_0xce17('0xd')]['push']({'field':_0x23aca0,'operator':_0x439091,'value':_0x126235});});});}return _0x4de3cf;};exports['buildExpression']=function(_0x55f2d5,_0x36e744,_0x1b5172){var _0x1c6350={};if(_0x36e744===_0xce17('0xe')){if(_0x1b5172[_0xce17('0xf')]===_0xce17('0x10')){_0x1b5172['operator']=_0xce17('0x11');_0x1b5172['value']+=','+_0x1b5172[_0xce17('0x12')];}else if(_['includes'](['$gt',_0xce17('0x13')],_0x1b5172[_0xce17('0xf')])){_0x1b5172[_0xce17('0x12')]=moment(_0x1b5172['value'])[_0xce17('0x14')](0x1,_0xce17('0x15'))[_0xce17('0x16')]('YYYY-MM-DD');}}if(_0x1b5172[_0xce17('0x17')]){_0x36e744=_0x1b5172[_0xce17('0x17')];_0x1c6350[_0xce17('0x18')]=_0xce17('0x19')+_0x55f2d5+'.'+_0x1b5172[_0xce17('0x1a')]+_0xce17('0x1b')+_0x1b5172[_0xce17('0x17')]+')\x20'+parseOperator(_0x1b5172[_0xce17('0xf')]);}else{_0x1c6350[_0xce17('0x18')]=_0x55f2d5+'.'+_0x1b5172[_0xce17('0x1a')]+'\x20'+parseOperator(_0x1b5172[_0xce17('0xf')]);}if(_[_0xce17('0x1c')]([_0xce17('0x1d'),_0xce17('0x1e')],_0x1b5172[_0xce17('0xf')]))_0x1c6350[_0xce17('0x18')]='('+_0x1c6350[_0xce17('0x18')]+_0xce17('0x1f')+_0x55f2d5+'.'+_0x1b5172['field']+'\x20IS\x20NULL)';_0x1c6350[_0xce17('0x12')]=parseValue(_0x36e744,_0x1b5172['operator'],_0x1b5172['value']);return _0x1c6350;};function parseOperator(_0x188a47){var _0x429d66;switch(_0x188a47){case _0xce17('0x20'):_0x429d66=_0xce17('0x21');break;case _0xce17('0x1e'):_0x429d66=_0xce17('0x22');break;case _0xce17('0x10'):_0x429d66='=\x20?';break;case'$ne':_0x429d66=_0xce17('0x23');break;case _0xce17('0x24'):case'$startsWith':case _0xce17('0x25'):_0x429d66=_0xce17('0x26');break;case _0xce17('0x27'):_0x429d66=_0xce17('0x28');break;case _0xce17('0x29'):_0x429d66=_0xce17('0x2a');break;case _0xce17('0x13'):_0x429d66=_0xce17('0x2b');break;case _0xce17('0x2c'):_0x429d66=_0xce17('0x2d');break;case'$between':_0x429d66=_0xce17('0x2e');break;}return _0x429d66;}function parseValue(_0x1e75f4,_0x31d971,_0x1badce){var _0x12372a={'start':undefined,'end':undefined};switch(_0x31d971){case _0xce17('0x20'):case _0xce17('0x1e'):_0x12372a[_0xce17('0x2f')]=_0x1badce[_0xce17('0x7')](',');break;case _0xce17('0x24'):_0x12372a['start']='%'+_0x1badce+'%';break;case'$startsWith':_0x12372a[_0xce17('0x2f')]=_0x1badce+'%';break;case _0xce17('0x25'):_0x12372a[_0xce17('0x2f')]='%'+_0x1badce;break;case'$between':var _0x313260=_0x1badce[_0xce17('0x7')](',');var _0x1badce=_0x313260[_0xce17('0xa')]();var _0x378e7d=_0x313260[_0xce17('0x30')]();if(_0x1e75f4===_0xce17('0xe')){_0x1badce=moment(_0x1badce)[_0xce17('0x31')](0x0,!![])['format']();_0x378e7d=moment(_0x378e7d)['utcOffset'](0x0,!![])[_0xce17('0x14')](0x17,_0xce17('0x32'))[_0xce17('0x14')](0x3b,_0xce17('0x33'))['add'](0x3b,_0xce17('0x34'))[_0xce17('0x16')]();}_0x12372a={'start':_0x1badce,'end':_0x378e7d};break;default:_0x12372a[_0xce17('0x2f')]=_0x1badce;break;}return _0x12372a;} \ No newline at end of file +var _0x7ae5=['filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','$in','IN\x20?','=\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','minutes','lodash','parseSearch','startsWith','[$or]','[$and]','replace','split','length','slice','forEach','shift','match'];(function(_0x61c999,_0x2bebd8){var _0x25472f=function(_0x5befec){while(--_0x5befec){_0x61c999['push'](_0x61c999['shift']());}};_0x25472f(++_0x2bebd8);}(_0x7ae5,0x1d1));var _0x57ae=function(_0x1781de,_0x5c4b38){_0x1781de=_0x1781de-0x0;var _0x48d7fc=_0x7ae5[_0x1781de];return _0x48d7fc;};'use strict';var _=require(_0x57ae('0x0'));var moment=require('moment');exports[_0x57ae('0x1')]=function(_0x31a84c){var _0x3dcc10={'conditions':[]};_0x3dcc10['sqlOperator']=_[_0x57ae('0x2')](_0x31a84c,_0x57ae('0x3'))?'or':'and';var _0x10b984=_0x31a84c['replace'](_0x57ae('0x4'),'')[_0x57ae('0x5')](_0x57ae('0x3'),'')[_0x57ae('0x6')]('||');for(var _0x9a7746=0x0;_0x9a7746<_0x10b984[_0x57ae('0x7')];_0x9a7746++){var _0x256db2=_0x10b984[_0x9a7746][_0x57ae('0x6')](':=');var _0x49eb67=_0x256db2[0x0];var _0x2ef7ec=_0x256db2[_0x57ae('0x8')](0x1);_0x2ef7ec[_0x57ae('0x9')](function(_0x4b2d0a){var _0x5e6d34=_0x4b2d0a['split']('[')[_0x57ae('0xa')]();var _0x2ae5e1=_0x4b2d0a[_0x57ae('0xb')](/\[(.*?)\]/g);_0x2ae5e1[_0x57ae('0x9')](function(_0x4dec44){var _0x5a6242=_0x4dec44['split']('[')[_0x57ae('0xc')](function(_0x310aab){return _0x310aab[_0x57ae('0xd')](']')>-0x1;})[_0x57ae('0xe')](function(_0x414cee){return _0x414cee['split'](']')[0x0];})[0x0];_0x3dcc10[_0x57ae('0xf')][_0x57ae('0x10')]({'field':_0x49eb67,'operator':_0x5e6d34,'value':_0x5a6242});});});}return _0x3dcc10;};exports['buildExpression']=function(_0xa7773c,_0xd400a9,_0x46877d){var _0x1b6b8f={};if(_0xd400a9===_0x57ae('0x11')){if(_0x46877d[_0x57ae('0x12')]===_0x57ae('0x13')){_0x46877d['operator']=_0x57ae('0x14');_0x46877d[_0x57ae('0x15')]+=','+_0x46877d[_0x57ae('0x15')];}else if(_[_0x57ae('0x16')]([_0x57ae('0x17'),_0x57ae('0x18')],_0x46877d['operator'])){_0x46877d['value']=moment(_0x46877d[_0x57ae('0x15')])[_0x57ae('0x19')](0x1,_0x57ae('0x1a'))[_0x57ae('0x1b')]('YYYY-MM-DD');}}if(_0x46877d[_0x57ae('0x1c')]){_0xd400a9=_0x46877d[_0x57ae('0x1c')];_0x1b6b8f[_0x57ae('0x1d')]=_0x57ae('0x1e')+_0xa7773c+'.'+_0x46877d[_0x57ae('0x1f')]+_0x57ae('0x20')+_0x46877d[_0x57ae('0x1c')]+')\x20'+parseOperator(_0x46877d[_0x57ae('0x12')]);}else{_0x1b6b8f['text']=_0xa7773c+'.'+_0x46877d[_0x57ae('0x1f')]+'\x20'+parseOperator(_0x46877d['operator']);}if(_[_0x57ae('0x16')]([_0x57ae('0x21'),_0x57ae('0x22')],_0x46877d[_0x57ae('0x12')]))_0x1b6b8f[_0x57ae('0x1d')]='('+_0x1b6b8f[_0x57ae('0x1d')]+'\x20OR\x20'+_0xa7773c+'.'+_0x46877d['field']+'\x20IS\x20NULL)';_0x1b6b8f[_0x57ae('0x15')]=parseValue(_0xd400a9,_0x46877d[_0x57ae('0x12')],_0x46877d['value']);return _0x1b6b8f;};function parseOperator(_0x42a4db){var _0x4d4406;switch(_0x42a4db){case _0x57ae('0x23'):_0x4d4406=_0x57ae('0x24');break;case _0x57ae('0x22'):_0x4d4406='NOT\x20IN\x20?';break;case _0x57ae('0x13'):_0x4d4406=_0x57ae('0x25');break;case _0x57ae('0x21'):_0x4d4406='<>\x20?';break;case _0x57ae('0x26'):case'$startsWith':case _0x57ae('0x27'):_0x4d4406=_0x57ae('0x28');break;case _0x57ae('0x29'):_0x4d4406=_0x57ae('0x2a');break;case _0x57ae('0x17'):_0x4d4406=_0x57ae('0x2b');break;case'$lte':_0x4d4406=_0x57ae('0x2c');break;case _0x57ae('0x2d'):_0x4d4406=_0x57ae('0x2e');break;case _0x57ae('0x14'):_0x4d4406=_0x57ae('0x2f');break;}return _0x4d4406;}function parseValue(_0x9f2054,_0xe11b88,_0x2b7c67){var _0x39e153={'start':undefined,'end':undefined};switch(_0xe11b88){case'$in':case _0x57ae('0x22'):_0x39e153[_0x57ae('0x30')]=_0x2b7c67['split'](',');break;case'$substring':_0x39e153[_0x57ae('0x30')]='%'+_0x2b7c67+'%';break;case _0x57ae('0x31'):_0x39e153['start']=_0x2b7c67+'%';break;case _0x57ae('0x27'):_0x39e153[_0x57ae('0x30')]='%'+_0x2b7c67;break;case _0x57ae('0x14'):var _0x16a5ca=_0x2b7c67[_0x57ae('0x6')](',');var _0x2b7c67=_0x16a5ca[_0x57ae('0xa')]();var _0x5255be=_0x16a5ca[_0x57ae('0x32')]();if(_0x9f2054===_0x57ae('0x11')){_0x2b7c67=moment(_0x2b7c67)[_0x57ae('0x33')](0x0,!![])['format']();_0x5255be=moment(_0x5255be)[_0x57ae('0x33')](0x0,!![])[_0x57ae('0x19')](0x17,'hours')[_0x57ae('0x19')](0x3b,_0x57ae('0x34'))['add'](0x3b,'seconds')['format']();}_0x39e153={'start':_0x2b7c67,'end':_0x5255be};break;default:_0x39e153[_0x57ae('0x30')]=_0x2b7c67;break;}return _0x39e153;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index e6aff43..fce2ece 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 _0xb66c=['isEmpty','length','omit','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','forEach','push','join','getOptions','$id','query','model','intersection','attributes','nolimit','limit','offset','where','pick','object','filter','columns','merge','map','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','fields','split','filters','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','name','uniqueid','isArray','sort','cast','priority','unsigned','substr','DESC','col'];(function(_0x449864,_0x49b5a2){var _0x406fff=function(_0x2dcdb3){while(--_0x2dcdb3){_0x449864['push'](_0x449864['shift']());}};_0x406fff(++_0x49b5a2);}(_0xb66c,0x175));var _0xcb66=function(_0x3a0847,_0x188660){_0x3a0847=_0x3a0847-0x0;var _0x26975f=_0xb66c[_0x3a0847];return _0x26975f;};'use strict';var _=require(_0xcb66('0x0'));var sequelize=require('sequelize');var moment=require(_0xcb66('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x55a57b){var _0x2afcb8=['ne'];try{var _0x24ea13=JSON[_0xcb66('0x2')](_0x55a57b);var _0x5f487c=Object[_0xcb66('0x3')](_0x24ea13)[0x0];return _0x2afcb8[_0xcb66('0x4')](_0x5f487c);}catch(_0x3f7cc7){return![];}}function getOperatorValue(_0x21be55){var _0x5d766d=JSON['parse'](_0x21be55);var _0x19adf5=Object[_0xcb66('0x3')](_0x5d766d)[0x0];var _0xa3993=_0x5d766d[_0x19adf5];return{['$'+_0x19adf5]:_0xa3993};}exports[_0xcb66('0x5')]=function(_0xf7bc39){var _0x58582b=null;if(_0xf7bc39){_0x58582b=_0xf7bc39[_0xcb66('0x6')](',');}return _0x58582b;};exports[_0xcb66('0x7')]=function(_0x174969,_0x25b56c){var _0x3c4ce1={};if(!_['isEmpty'](_0x174969)){_[_0xcb66('0x8')](_0x174969,function(_0x2b32ec,_0xf12828){try{if(_0x25b56c){var _0x38c2e6=_['find'](_0x25b56c,{'name':_0xf12828})||{};if(hasSequelizeOperator(_0x2b32ec)){_0x3c4ce1[_0xf12828]=getOperatorValue(_0x2b32ec);}else if(_0x38c2e6[_0xcb66('0x9')]===_0xcb66('0xa')&&_[_0xcb66('0xb')](_0x2b32ec)){var _0x2339bb=JSON['parse'](_0x2b32ec);var _0x4079ae={'$gte':moment(moment(_0x2339bb[_0xcb66('0xc')])[_0xcb66('0xd')](_0xcb66('0xe')))['utc']()[_0xcb66('0xd')](),'$lte':moment(moment(_0x2339bb['$lte'])[_0xcb66('0xd')]('YYYY-MM-DD'))[_0xcb66('0xf')]()['subtract'](0x1,'s')['format']()};_0x3c4ce1[_0xf12828]=_0x4079ae;}else if(_0x38c2e6[_0xcb66('0x10')]===_0xcb66('0x11')){_0x3c4ce1[_0xf12828]=_0x2b32ec;}else{_0x3c4ce1[_0xf12828]=_[_0xcb66('0x12')](_0x2b32ec)?_0x2b32ec:JSON[_0xcb66('0x2')](_0x2b32ec);}}else{_0x3c4ce1[_0xf12828]=_['isArray'](_0x2b32ec)?_0x2b32ec:JSON[_0xcb66('0x2')](_0x2b32ec);}}catch(_0x42ad03){_0x3c4ce1[_0xf12828]=_0x2b32ec[_0xcb66('0x6')](',');}});}return _0x3c4ce1;};exports['limit']=function(_0x2e4126){_0x2e4126=parseInt(_0x2e4126,0xa);if(!_0x2e4126||_0x2e4126<0x0){_0x2e4126=LIMIT_VALUE;}return _0x2e4126;};exports['offset']=function(_0x4165ea){_0x4165ea=parseInt(_0x4165ea,0xa);if(!_0x4165ea||_0x4165ea<0x0){_0x4165ea=0x0;}return _0x4165ea;};exports[_0xcb66('0x13')]=function(_0xdf0ba0){var _0x1ccb71,_0x540782=null;if(_0xdf0ba0){_0x1ccb71=_0xdf0ba0['split'](',');_0x540782=_['map'](_0x1ccb71,function(_0xb39b87){if(_0xb39b87['indexOf']('-')===0x0){return[_0xb39b87==='priority'?sequelize[_0xcb66('0x14')](sequelize['col'](_0xcb66('0x15')),_0xcb66('0x16')):_0xb39b87[_0xcb66('0x17')](0x1),_0xcb66('0x18')];}else{return[_0xb39b87===_0xcb66('0x15')?sequelize[_0xcb66('0x14')](sequelize[_0xcb66('0x19')]('priority'),_0xcb66('0x16')):_0xb39b87,'ASC'];}});}return _0x540782;};exports['omit']=function(_0xf89c0e,_0x37e4c8){if(_[_0xcb66('0x1a')](_0xf89c0e)){return _0xf89c0e;}if(_['isArray'](_0xf89c0e)){for(var _0x341554=0x0;_0x341554<_0xf89c0e[_0xcb66('0x1b')];_0x341554+=0x1){_0xf89c0e[_0x341554]=this[_0xcb66('0x1c')](_0xf89c0e[_0x341554],_0x37e4c8);}return _0xf89c0e;}if(!_[_0xcb66('0x1d')](_0xf89c0e)){return _0xf89c0e;}if(_['isString'](_0x37e4c8)){_0x37e4c8=[_0x37e4c8];}if(!_[_0xcb66('0x12')](_0x37e4c8)){return _0xf89c0e;}for(var _0x31560e=0x0;_0x31560e<_0x37e4c8[_0xcb66('0x1b')];_0x31560e+=0x1){_[_0xcb66('0x1e')](_0xf89c0e,_0x37e4c8[_0x31560e]);}for(var _0x37a676 in _0xf89c0e){if(_0xf89c0e[_0xcb66('0x1f')](_0x37a676)){_0xf89c0e[_0x37a676]=this[_0xcb66('0x1c')](_0xf89c0e[_0x37a676],_0x37e4c8);}}return _0xf89c0e;};exports[_0xcb66('0x20')]=function(_0x28fc0b){return _0x28fc0b[_0xcb66('0x21')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xcb66('0x22')]=function(_0x5b7cf2){return _0x5b7cf2['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x31a10a){var _0x4ca8b4=[];_0x31a10a[_0xcb66('0x6')](/[ ,]+/)[_0xcb66('0x23')](function(_0x1b8a79){_0x1b8a79=_0x1b8a79['replace'](/([^:]")"+/g,'$1');_0x1b8a79='+'+_0x1b8a79+'*';var _0x123787=/[ `!@#$%^&*()_\-?~]/;if(_0x1b8a79[_0xcb66('0x21')](_0x123787))_0x1b8a79='\x22'+_0x1b8a79+'\x22';_0x4ca8b4[_0xcb66('0x24')](_0x1b8a79);});return _0x4ca8b4[_0xcb66('0x25')]('\x20');};exports[_0xcb66('0x26')]=function(_0x375636,_0x2a5e56,_0x36dfe3){var _0x2d27f7={},_0x3e4755={};if(_0x2a5e56['query'][_0xcb66('0x27')]){_0x2a5e56[_0xcb66('0x28')]['id']=_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x27')];delete _0x2a5e56[_0xcb66('0x28')][_0xcb66('0x27')];}_0x2d27f7[_0xcb66('0x29')]=_['map'](_0x375636,_0xcb66('0x10'));_0x2d27f7[_0xcb66('0x28')]=_[_0xcb66('0x3')](_0x2a5e56[_0xcb66('0x28')]);_0x2d27f7['filters']=_[_0xcb66('0x2a')](_0x2d27f7[_0xcb66('0x29')],_0x2d27f7[_0xcb66('0x28')]);_0x3e4755[_0xcb66('0x2b')]=_[_0xcb66('0x2a')](_0x2d27f7[_0xcb66('0x29')],this[_0xcb66('0x5')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x5')]));_0x3e4755[_0xcb66('0x2b')]=_0x3e4755[_0xcb66('0x2b')][_0xcb66('0x1b')]?_0x3e4755['attributes']:_0x2d27f7['model'];if(!_0x2a5e56['query'][_0xcb66('0x1f')](_0xcb66('0x2c'))){_0x3e4755[_0xcb66('0x2d')]=this[_0xcb66('0x2d')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x2d')]);_0x3e4755['offset']=this[_0xcb66('0x2e')](_0x2a5e56['query']['offset']);}_0x3e4755['order']=this[_0xcb66('0x13')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x13')]);_0x3e4755[_0xcb66('0x2f')]=this[_0xcb66('0x7')](_[_0xcb66('0x30')](_0x2a5e56[_0xcb66('0x28')],_0x2d27f7[_0xcb66('0x7')]),_0x375636);if(_0x2a5e56[_0xcb66('0x28')]['filter']){var _0xe45331=_0x375636;var _0x3f2781=_0x2a5e56[_0xcb66('0x28')]['filter'];if(typeof _0x3f2781===_0xcb66('0x31')){_0xe45331=_[_0xcb66('0x32')](_0x375636,function(_0x4a5934){return _['includes'](_0x3f2781[_0xcb66('0x33')],_0x4a5934['name']);});_0x3f2781=_0x3f2781['value'];}_0x3e4755[_0xcb66('0x2f')]=_[_0xcb66('0x34')](_0x3e4755[_0xcb66('0x2f')],{'$or':_[_0xcb66('0x35')](_0xe45331,function(_0x99229){if(_0x99229[_0xcb66('0x9')]!==_0xcb66('0x36')){if(_0x36dfe3){return sequelize[_0xcb66('0x2f')](sequelize['fn'](_0xcb66('0x37'),sequelize['col'](_0x99229['name'])),{'$like':sequelize['fn']('lower','%'+_0x2a5e56[_0xcb66('0x28')]['filter']+'%')});}else{var _0x8736aa={};_0x8736aa[_0x99229['name']]={'$like':'%'+_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x32')]+'%'};return _0x8736aa;}}})});}_0x3e4755=_[_0xcb66('0x34')]({},_0x3e4755,_0x2a5e56[_0xcb66('0x38')]);return _0x3e4755;}; \ No newline at end of file +var _0x032e=['isEmpty','forOwn','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','map','indexOf','priority','cast','unsigned','substr','DESC','col','length','omit','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','query','$id','intersection','model','attributes','nolimit','offset','order','sort','pick','object','filter','where','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','fields','split','filters'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x032e,0x124));var _0xe032=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x032e[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xe032('0x0'));var sequelize=require('sequelize');var moment=require(_0xe032('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1cf95c){var _0x5ca562=['ne'];try{var _0x4afba2=JSON[_0xe032('0x2')](_0x1cf95c);var _0x2ce001=Object[_0xe032('0x3')](_0x4afba2)[0x0];return _0x5ca562[_0xe032('0x4')](_0x2ce001);}catch(_0x306f3d){return![];}}function getOperatorValue(_0x420020){var _0x2ba8a0=JSON[_0xe032('0x2')](_0x420020);var _0x37432f=Object[_0xe032('0x3')](_0x2ba8a0)[0x0];var _0x3289b0=_0x2ba8a0[_0x37432f];return{['$'+_0x37432f]:_0x3289b0};}exports[_0xe032('0x5')]=function(_0xaf3907){var _0x3b0ef8=null;if(_0xaf3907){_0x3b0ef8=_0xaf3907[_0xe032('0x6')](',');}return _0x3b0ef8;};exports[_0xe032('0x7')]=function(_0x2dc9e5,_0x167bd9){var _0x4aec53={};if(!_[_0xe032('0x8')](_0x2dc9e5)){_[_0xe032('0x9')](_0x2dc9e5,function(_0x13c126,_0x42e2ba){try{if(_0x167bd9){var _0x244f93=_[_0xe032('0xa')](_0x167bd9,{'name':_0x42e2ba})||{};if(hasSequelizeOperator(_0x13c126)){_0x4aec53[_0x42e2ba]=getOperatorValue(_0x13c126);}else if(_0x244f93[_0xe032('0xb')]==='DATE'&&_[_0xe032('0xc')](_0x13c126)){var _0x266d71=JSON[_0xe032('0x2')](_0x13c126);var _0x1a53ab={'$gte':moment(moment(_0x266d71['$gte'])[_0xe032('0xd')](_0xe032('0xe')))[_0xe032('0xf')]()[_0xe032('0xd')](),'$lte':moment(moment(_0x266d71[_0xe032('0x10')])[_0xe032('0xd')](_0xe032('0xe')))['utc']()[_0xe032('0x11')](0x1,'s')[_0xe032('0xd')]()};_0x4aec53[_0x42e2ba]=_0x1a53ab;}else if(_0x244f93[_0xe032('0x12')]===_0xe032('0x13')){_0x4aec53[_0x42e2ba]=_0x13c126;}else{_0x4aec53[_0x42e2ba]=_[_0xe032('0x14')](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}else{_0x4aec53[_0x42e2ba]=_['isArray'](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}catch(_0x25cedb){_0x4aec53[_0x42e2ba]=_0x13c126[_0xe032('0x6')](',');}});}return _0x4aec53;};exports[_0xe032('0x15')]=function(_0x208c47){_0x208c47=parseInt(_0x208c47,0xa);if(!_0x208c47||_0x208c47<0x0){_0x208c47=LIMIT_VALUE;}return _0x208c47;};exports['offset']=function(_0x4b644b){_0x4b644b=parseInt(_0x4b644b,0xa);if(!_0x4b644b||_0x4b644b<0x0){_0x4b644b=0x0;}return _0x4b644b;};exports['sort']=function(_0x15475c){var _0x505d8c,_0x46dc27=null;if(_0x15475c){_0x505d8c=_0x15475c[_0xe032('0x6')](',');_0x46dc27=_[_0xe032('0x16')](_0x505d8c,function(_0x2aa342){if(_0x2aa342[_0xe032('0x17')]('-')===0x0){return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize['col'](_0xe032('0x18')),_0xe032('0x1a')):_0x2aa342[_0xe032('0x1b')](0x1),_0xe032('0x1c')];}else{return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize[_0xe032('0x1d')](_0xe032('0x18')),'unsigned'):_0x2aa342,'ASC'];}});}return _0x46dc27;};exports['omit']=function(_0x4ef536,_0x2568ce){if(_[_0xe032('0x8')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x14')](_0x4ef536)){for(var _0x2bfe8f=0x0;_0x2bfe8f<_0x4ef536[_0xe032('0x1e')];_0x2bfe8f+=0x1){_0x4ef536[_0x2bfe8f]=this[_0xe032('0x1f')](_0x4ef536[_0x2bfe8f],_0x2568ce);}return _0x4ef536;}if(!_[_0xe032('0x20')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x21')](_0x2568ce)){_0x2568ce=[_0x2568ce];}if(!_[_0xe032('0x14')](_0x2568ce)){return _0x4ef536;}for(var _0x5bb36a=0x0;_0x5bb36a<_0x2568ce[_0xe032('0x1e')];_0x5bb36a+=0x1){_[_0xe032('0x22')](_0x4ef536,_0x2568ce[_0x5bb36a]);}for(var _0x3106aa in _0x4ef536){if(_0x4ef536[_0xe032('0x23')](_0x3106aa)){_0x4ef536[_0x3106aa]=this['omit'](_0x4ef536[_0x3106aa],_0x2568ce);}}return _0x4ef536;};exports['isNumeric']=function(_0x3e2575){return _0x3e2575[_0xe032('0x24')](RegExp(_0xe032('0x25')))?!![]:![];};exports[_0xe032('0x26')]=function(_0x4e8b72){return _0x4e8b72['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42ec95){var _0x1dd34f=[];_0x42ec95[_0xe032('0x6')](/[ ,]+/)[_0xe032('0x27')](function(_0x50db2d){_0x50db2d=_0x50db2d[_0xe032('0x28')](/([^:]")"+/g,'$1');_0x50db2d='+'+_0x50db2d+'*';var _0x236da9=/[ `!@#$%^&*()_\-?~]/;if(_0x50db2d[_0xe032('0x24')](_0x236da9))_0x50db2d='\x22'+_0x50db2d+'\x22';_0x1dd34f[_0xe032('0x29')](_0x50db2d);});return _0x1dd34f[_0xe032('0x2a')]('\x20');};exports['getOptions']=function(_0xd90bd5,_0x33634c,_0x319a2f){var _0x2cc18c={},_0x522bdc={};if(_0x33634c[_0xe032('0x2b')]['$id']){_0x33634c[_0xe032('0x2b')]['id']=_0x33634c['query'][_0xe032('0x2c')];delete _0x33634c['query'][_0xe032('0x2c')];}_0x2cc18c['model']=_[_0xe032('0x16')](_0xd90bd5,_0xe032('0x12'));_0x2cc18c['query']=_[_0xe032('0x3')](_0x33634c[_0xe032('0x2b')]);_0x2cc18c[_0xe032('0x7')]=_[_0xe032('0x2d')](_0x2cc18c['model'],_0x2cc18c[_0xe032('0x2b')]);_0x522bdc['attributes']=_[_0xe032('0x2d')](_0x2cc18c[_0xe032('0x2e')],this['fields'](_0x33634c[_0xe032('0x2b')][_0xe032('0x5')]));_0x522bdc['attributes']=_0x522bdc[_0xe032('0x2f')][_0xe032('0x1e')]?_0x522bdc[_0xe032('0x2f')]:_0x2cc18c[_0xe032('0x2e')];if(!_0x33634c[_0xe032('0x2b')][_0xe032('0x23')](_0xe032('0x30'))){_0x522bdc[_0xe032('0x15')]=this[_0xe032('0x15')](_0x33634c[_0xe032('0x2b')][_0xe032('0x15')]);_0x522bdc[_0xe032('0x31')]=this[_0xe032('0x31')](_0x33634c[_0xe032('0x2b')][_0xe032('0x31')]);}_0x522bdc[_0xe032('0x32')]=this[_0xe032('0x33')](_0x33634c['query'][_0xe032('0x33')]);_0x522bdc['where']=this[_0xe032('0x7')](_[_0xe032('0x34')](_0x33634c[_0xe032('0x2b')],_0x2cc18c[_0xe032('0x7')]),_0xd90bd5);if(_0x33634c[_0xe032('0x2b')]['filter']){var _0x132d25=_0xd90bd5;var _0x55688b=_0x33634c[_0xe032('0x2b')]['filter'];if(typeof _0x55688b===_0xe032('0x35')){_0x132d25=_[_0xe032('0x36')](_0xd90bd5,function(_0x2644a1){return _[_0xe032('0x4')](_0x55688b['columns'],_0x2644a1[_0xe032('0x12')]);});_0x55688b=_0x55688b['value'];}_0x522bdc[_0xe032('0x37')]=_[_0xe032('0x38')](_0x522bdc[_0xe032('0x37')],{'$or':_[_0xe032('0x16')](_0x132d25,function(_0x4b58eb){if(_0x4b58eb['type']!==_0xe032('0x39')){if(_0x319a2f){return sequelize[_0xe032('0x37')](sequelize['fn']('lower',sequelize[_0xe032('0x1d')](_0x4b58eb[_0xe032('0x12')])),{'$like':sequelize['fn'](_0xe032('0x3a'),'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%')});}else{var _0x4dafef={};_0x4dafef[_0x4b58eb[_0xe032('0x12')]]={'$like':'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%'};return _0x4dafef;}}})});}_0x522bdc=_[_0xe032('0x38')]({},_0x522bdc,_0x33634c[_0xe032('0x3b')]);return _0x522bdc;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 8457adb..8dd3830 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 _0x2ce3=['getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','then','getAgents','all','flatten','value','filter','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','getUpdatedSortOptions','internal','substring','indexOf','DESC','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','whatsappPause','chatCapacity','openchannelCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','../../mysqldb','client','chatPause','faxPause','mailPause','smsPause','voicePause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch'];(function(_0x5aea38,_0x297a1a){var _0x490a52=function(_0x461eb4){while(--_0x461eb4){_0x5aea38['push'](_0x5aea38['shift']());}};_0x490a52(++_0x297a1a);}(_0x2ce3,0xf9));var _0x32ce=function(_0x217b18,_0x1eb807){_0x217b18=_0x217b18-0x0;var _0x38c247=_0x2ce3[_0x217b18];return _0x38c247;};'use strict';var _=require(_0x32ce('0x0'));var jayson=require(_0x32ce('0x1'));var db=require(_0x32ce('0x2'))['db'];var amiClient=jayson[_0x32ce('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x32ce('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x2cc943,_0x390607){var _0x4177b5=[_0x2cc943[_0x32ce('0x4')],_0x2cc943[_0x32ce('0x5')],_0x2cc943[_0x32ce('0x6')],_0x2cc943['openchannelPause'],_0x2cc943[_0x32ce('0x7')],_0x2cc943[_0x32ce('0x8')],_0x2cc943['whatsappPause']];if(!_0x390607)return _[_0x32ce('0x9')](_0x4177b5);var _0x58e9d9=_['filter'](_0x4177b5);return _0x58e9d9[_0x32ce('0xa')]>0x0&&_0x58e9d9[_0x32ce('0xa')]<_0x4177b5[_0x32ce('0xa')]?!![]:![];}function isIdle(_0x58cff9){return _0x58cff9===_0x32ce('0xb')||_0x58cff9===_0x32ce('0xc')||_0x58cff9===_0x32ce('0xd')||_0x58cff9===_0x32ce('0xe')||_[_0x32ce('0xf')](_0x58cff9);}function isAgentIdle(_0x59112f){if(_0x59112f[_0x32ce('0x10')]!=='idle'&&_0x59112f['voicePause']){_0x59112f['voiceStatus']='pause';return![];}return _[_0x32ce('0x9')]([_0x59112f['chatStatus'],_0x59112f[_0x32ce('0x11')],_0x59112f[_0x32ce('0x12')],_0x59112f[_0x32ce('0x13')],_0x59112f[_0x32ce('0x14')],_0x59112f[_0x32ce('0x10')],_0x59112f[_0x32ce('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x32ce('0x16')](_0x32ce('0x17'),{})['then'](function(_0x4dc8b3){if(_0x4dc8b3['error']){throw new Error(_0x32ce('0x18'));}var _0x4145ae=_0x4dc8b3[_0x32ce('0x19')];return routingClient[_0x32ce('0x16')]('Agents',{})['then'](function(_0x5271e8){if(_0x5271e8['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x331f0d=_0x5271e8[_0x32ce('0x19')];return _['merge']({},_0x4145ae,_0x331f0d);});})[_0x32ce('0x1a')](function(_0x116e5e){throw _0x116e5e;});}exports[_0x32ce('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x7b595d){var _0x173c51=_0x32ce('0xc');if(isAgentPaused(_0x7b595d))_0x173c51=_0x32ce('0x1c');else if(isAgentPaused(_0x7b595d,!![]))_0x173c51=_0x32ce('0x1d');else if(isAgentIdle(_0x7b595d))_0x173c51=_0x32ce('0xb');else _0x173c51=_0x32ce('0x1e');return _0x173c51;}exports[_0x32ce('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x45df00,_0x67df15){var _0x15f394=_[_0x32ce('0x20')](_0x45df00)?_0x45df00:[_0x45df00];var _0x2c4362=_[_0x32ce('0x21')](_0x67df15)+_0x32ce('0x22');var _0x147c71=_[_0x32ce('0x23')](_0x15f394,function(_0x483ca2){return db[_0x2c4362][_0x32ce('0x24')]({'where':{'id':_0x483ca2}})[_0x32ce('0x25')](function(_0x2a4228){if(!_0x2a4228)return[];return _0x2a4228[_0x32ce('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x32ce('0x27')](_0x147c71)[_0x32ce('0x25')](function(_0x14c01d){var _0x512a3f=_(_0x14c01d)[_0x32ce('0x28')]()['map']('id')['uniq']()[_0x32ce('0x29')]();return _0x512a3f;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x50d332,_0x2a4a53,_0x4b3fe7){try{if(_0x2a4a53['length']>0x0){_0x50d332=_0x50d332[_0x32ce('0x2a')](function(_0x34ece4){return _0x2a4a53[_0x32ce('0x2b')](_0x34ece4['id']);});}var _0x21dfc0=_0x50d332[_0x32ce('0x2a')](function(_0x581672){var _0x22b809=_0x32ce('0x1e');if(isAgentIdle(_0x581672)){_0x22b809=_0x32ce('0xb');}return _0x22b809===_0x4b3fe7;});return _[_0x32ce('0x23')](_0x21dfc0,'id');}catch(_0x10a558){throw _0x10a558;}}exports[_0x32ce('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x289bdb,_0x5aaf45,_0x1a718d){return Promise[_0x32ce('0x2d')]()[_0x32ce('0x25')](function(){if(_0x5aaf45[_0x32ce('0xa')]>0x0){_0x289bdb=_0x289bdb['filter'](function(_0x2eeac4){return _0x5aaf45[_0x32ce('0x2b')](_0x2eeac4['id']);});}return _0x289bdb;})[_0x32ce('0x25')](function(){return db['User'][_0x32ce('0x2e')]({'attributes':['id',_0x32ce('0x2f'),_0x32ce('0x30'),_0x32ce('0x4'),_0x32ce('0x5'),'mailPause',_0x32ce('0x31'),'smsPause',_0x32ce('0x8'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0x32ce('0x23')](_0x289bdb,'id')}},'raw':!![]});})[_0x32ce('0x25')](function(_0x541168){return _0x541168[_0x32ce('0x23')](function(_0x21a924){var _0x294d79=_[_0x32ce('0x32')](_0x289bdb,['id',_0x21a924['id']]);var _0x2c0fbe=filterAgentAttributes(_0x294d79);_['merge'](_0x21a924,_0x2c0fbe);_0x21a924[_0x32ce('0x33')]=getAgentStatus(_0x21a924);return _0x21a924;});})[_0x32ce('0x25')](function(_0x51c806){var _0x1adb74=sortAgentsByStatus(_0x51c806,_0x1a718d);return _['map'](_0x1adb74,'id');})[_0x32ce('0x1a')](function(_0x2d4468){throw _0x2d4468;});}exports[_0x32ce('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xa9cd9d){var _0xc6fb34={'fields':[],'order':null};var _0x8d8282=_0xa9cd9d[_0x32ce('0x35')](',');_0xc6fb34[_0x32ce('0x36')]=_['filter'](_0x8d8282,function(_0x3093aa){if(!_0x3093aa[_0x32ce('0x2b')]('globalStatus')){return!![];}_0xc6fb34[_0x32ce('0x37')]=_[_0x32ce('0x38')](_0x3093aa,'-')?'DESC':'ASC';return![];});return _0xc6fb34;}exports[_0x32ce('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x204144){if(_0x204144[_0x32ce('0x2b')](_0x32ce('0x30'))&&!_0x204144[_0x32ce('0x2b')](_0x32ce('0x3a'))){var _0x5efdc3=_0x204144[_0x32ce('0x3b')](0x0,_0x204144[_0x32ce('0x3c')](_0x32ce('0x30')));_0x204144+=','+_0x5efdc3+_0x32ce('0x3a');}return _0x204144;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x10a684,_0x48f538){var _0x40b3f2=_0x10a684['sort'](function(_0x55ad6e,_0x381329){if(_0x55ad6e['globalStatus']===_0x381329[_0x32ce('0x33')]){if(_0x55ad6e[_0x32ce('0x33')]===_0x32ce('0x1c')){if(_0x48f538===_0x32ce('0x3d')){return(_0x55ad6e[_0x32ce('0x3e')]||'')<(_0x381329['pauseType']||'')||_0x55ad6e[_0x32ce('0x30')]['toLowerCase']()>_0x381329['fullname'][_0x32ce('0x3f')]()?0x1:-0x1;}else{return(_0x55ad6e[_0x32ce('0x3e')]||'')<(_0x381329[_0x32ce('0x3e')]||'')||_0x55ad6e[_0x32ce('0x30')]['toLowerCase']()>_0x381329[_0x32ce('0x30')][_0x32ce('0x3f')]()?-0x1:0x1;}}else{if(_0x48f538===_0x32ce('0x3d')){return _0x55ad6e[_0x32ce('0x30')][_0x32ce('0x3f')]()<_0x381329[_0x32ce('0x30')][_0x32ce('0x3f')]()?0x1:-0x1;}else{return _0x55ad6e[_0x32ce('0x30')][_0x32ce('0x3f')]()<_0x381329[_0x32ce('0x30')][_0x32ce('0x3f')]()?-0x1:0x1;}}}else{if(_0x48f538==='DESC'){return _0x55ad6e[_0x32ce('0x33')]<_0x381329['globalStatus']?0x1:-0x1;}else{return _0x55ad6e[_0x32ce('0x33')]<_0x381329[_0x32ce('0x33')]?-0x1:0x1;}}});return _0x40b3f2;}exports[_0x32ce('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x3dad75){var _0x5ed862=[_0x32ce('0x41'),_0x32ce('0x42'),_0x32ce('0x43'),_0x32ce('0x44'),'pauseType',_0x32ce('0x44'),_0x32ce('0x3a'),_0x32ce('0x45'),_0x32ce('0x4'),_0x32ce('0x31'),_0x32ce('0x6'),'smsPause',_0x32ce('0x46'),'faxPause',_0x32ce('0x8'),_0x32ce('0x47'),_0x32ce('0x48'),'mailCapacity','smsCapacity',_0x32ce('0x49'),_0x32ce('0x4a'),_0x32ce('0x4b'),_0x32ce('0x4c'),_0x32ce('0x4d'),_0x32ce('0x4e'),_0x32ce('0x4f'),'faxCurrentCapacity',_0x32ce('0x50'),_0x32ce('0x13'),_0x32ce('0x12'),'smsStatus','whatsappStatus',_0x32ce('0x11'),_0x32ce('0x10'),_0x32ce('0x51'),_0x32ce('0x52'),_0x32ce('0x53'),_0x32ce('0x54'),_0x32ce('0x55'),'faxStatusTime','voiceStatusTime','queue',_0x32ce('0x56'),_0x32ce('0x57'),'phoneBarEnableScreenRecordingByAgent',_0x32ce('0x58'),_0x32ce('0x59')];var _0x4a118c=[_0x32ce('0x4'),'openchannelPause',_0x32ce('0x6'),_0x32ce('0x7'),'whatsappPause','faxPause','voicePause',_0x32ce('0x42')];var _0x669750=_(_0x3dad75)[_0x32ce('0x5a')](_0x4a118c)[_0x32ce('0x5b')](_0x5ed862)['value']();return _0x669750;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0xb7cf=['faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','findOne','all','flatten','map','uniq','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','findAll','chatPause','pauseType','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname','internal','substring','sort','toLowerCase','userpic','online','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0xb7cf,0xcb));var _0xfb7c=function(_0x1c53e1,_0x2f11a8){_0x1c53e1=_0x1c53e1-0x0;var _0x1f5b1f=_0xb7cf[_0x1c53e1];return _0x1f5b1f;};'use strict';var _=require('lodash');var jayson=require(_0xfb7c('0x0'));var db=require(_0xfb7c('0x1'))['db'];var amiClient=jayson[_0xfb7c('0x2')][_0xfb7c('0x3')]({'port':0x232a});var routingClient=jayson[_0xfb7c('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x3f9e56,_0x4b6f20){var _0x55675d=[_0x3f9e56['chatPause'],_0x3f9e56[_0xfb7c('0x4')],_0x3f9e56[_0xfb7c('0x5')],_0x3f9e56[_0xfb7c('0x6')],_0x3f9e56[_0xfb7c('0x7')],_0x3f9e56[_0xfb7c('0x8')],_0x3f9e56[_0xfb7c('0x9')]];if(!_0x4b6f20)return _[_0xfb7c('0xa')](_0x55675d);var _0x43ce2d=_['filter'](_0x55675d);return _0x43ce2d[_0xfb7c('0xb')]>0x0&&_0x43ce2d['length']<_0x55675d['length']?!![]:![];}function isIdle(_0x1fa33d){return _0x1fa33d===_0xfb7c('0xc')||_0x1fa33d===_0xfb7c('0xd')||_0x1fa33d===_0xfb7c('0xe')||_0x1fa33d===_0xfb7c('0xf')||_['isNil'](_0x1fa33d);}function isAgentIdle(_0x518ff5){if(_0x518ff5[_0xfb7c('0x10')]!=='idle'&&_0x518ff5[_0xfb7c('0x8')]){_0x518ff5[_0xfb7c('0x10')]=_0xfb7c('0x11');return![];}return _[_0xfb7c('0xa')]([_0x518ff5[_0xfb7c('0x12')],_0x518ff5[_0xfb7c('0x13')],_0x518ff5['mailStatus'],_0x518ff5[_0xfb7c('0x14')],_0x518ff5[_0xfb7c('0x15')],_0x518ff5['voiceStatus'],_0x518ff5['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xfb7c('0x16')](_0xfb7c('0x17'),{})[_0xfb7c('0x18')](function(_0x362b7c){if(_0x362b7c['error']){throw new Error(_0xfb7c('0x19'));}var _0x177fda=_0x362b7c[_0xfb7c('0x1a')];return routingClient[_0xfb7c('0x16')](_0xfb7c('0x17'),{})[_0xfb7c('0x18')](function(_0x2901c9){if(_0x2901c9[_0xfb7c('0x1b')]){throw new Error(_0xfb7c('0x1c'));}var _0x469986=_0x2901c9['result'];return _['merge']({},_0x177fda,_0x469986);});})[_0xfb7c('0x1d')](function(_0x55d7d6){throw _0x55d7d6;});}exports[_0xfb7c('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x3cc7d0){var _0x6126fc=_0xfb7c('0xd');if(isAgentPaused(_0x3cc7d0))_0x6126fc='pause';else if(isAgentPaused(_0x3cc7d0,!![]))_0x6126fc=_0xfb7c('0x1f');else if(isAgentIdle(_0x3cc7d0))_0x6126fc=_0xfb7c('0xc');else _0x6126fc=_0xfb7c('0x20');return _0x6126fc;}exports[_0xfb7c('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x2072af,_0x17383e){var _0x388d8f=_[_0xfb7c('0x22')](_0x2072af)?_0x2072af:[_0x2072af];var _0x203dc5=_['startCase'](_0x17383e)+_0xfb7c('0x23');var _0x394599=_['map'](_0x388d8f,function(_0x21a36f){return db[_0x203dc5][_0xfb7c('0x24')]({'where':{'id':_0x21a36f}})[_0xfb7c('0x18')](function(_0x2e859c){if(!_0x2e859c)return[];return _0x2e859c['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xfb7c('0x25')](_0x394599)[_0xfb7c('0x18')](function(_0x4b33c0){var _0x5554c4=_(_0x4b33c0)[_0xfb7c('0x26')]()[_0xfb7c('0x27')]('id')[_0xfb7c('0x28')]()[_0xfb7c('0x29')]();return _0x5554c4;});}exports[_0xfb7c('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5eefe9,_0x3706fa,_0xd48bbf){try{if(_0x3706fa[_0xfb7c('0xb')]>0x0){_0x5eefe9=_0x5eefe9[_0xfb7c('0x2b')](function(_0x350aa5){return _0x3706fa[_0xfb7c('0x2c')](_0x350aa5['id']);});}var _0x1e6fc8=_0x5eefe9['filter'](function(_0x415ea5){var _0x390104=_0xfb7c('0x20');if(isAgentIdle(_0x415ea5)){_0x390104='idle';}return _0x390104===_0xd48bbf;});return _[_0xfb7c('0x27')](_0x1e6fc8,'id');}catch(_0x2d360d){throw _0x2d360d;}}exports[_0xfb7c('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x10c944,_0xde37fe,_0x38d248){return Promise[_0xfb7c('0x2e')]()['then'](function(){if(_0xde37fe['length']>0x0){_0x10c944=_0x10c944['filter'](function(_0x50d5d1){return _0xde37fe['includes'](_0x50d5d1['id']);});}return _0x10c944;})[_0xfb7c('0x18')](function(){return db['User'][_0xfb7c('0x2f')]({'attributes':['id','name','fullname',_0xfb7c('0x30'),_0xfb7c('0x4'),'mailPause',_0xfb7c('0x6'),'smsPause','voicePause',_0xfb7c('0x9'),_0xfb7c('0x31')],'where':{'id':{'$in':_[_0xfb7c('0x27')](_0x10c944,'id')}},'raw':!![]});})['then'](function(_0x5cba44){return _0x5cba44['map'](function(_0x51c9f8){var _0x4375f9=_[_0xfb7c('0x32')](_0x10c944,['id',_0x51c9f8['id']]);var _0x46abfd=filterAgentAttributes(_0x4375f9);_[_0xfb7c('0x33')](_0x51c9f8,_0x46abfd);_0x51c9f8[_0xfb7c('0x34')]=getAgentStatus(_0x51c9f8);return _0x51c9f8;});})['then'](function(_0x4a4205){var _0x3984db=sortAgentsByStatus(_0x4a4205,_0x38d248);return _[_0xfb7c('0x27')](_0x3984db,'id');})[_0xfb7c('0x1d')](function(_0x24d985){throw _0x24d985;});}exports[_0xfb7c('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xf57e6c){var _0x4b2d6b={'fields':[],'order':null};var _0x36788c=_0xf57e6c[_0xfb7c('0x36')](',');_0x4b2d6b[_0xfb7c('0x37')]=_[_0xfb7c('0x2b')](_0x36788c,function(_0x52cdb1){if(!_0x52cdb1[_0xfb7c('0x2c')](_0xfb7c('0x34'))){return!![];}_0x4b2d6b[_0xfb7c('0x38')]=_[_0xfb7c('0x39')](_0x52cdb1,'-')?_0xfb7c('0x3a'):_0xfb7c('0x3b');return![];});return _0x4b2d6b;}exports[_0xfb7c('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x55a8b2){if(_0x55a8b2[_0xfb7c('0x2c')](_0xfb7c('0x3d'))&&!_0x55a8b2[_0xfb7c('0x2c')](_0xfb7c('0x3e'))){var _0x30cbba=_0x55a8b2[_0xfb7c('0x3f')](0x0,_0x55a8b2['indexOf']('fullname'));_0x55a8b2+=','+_0x30cbba+_0xfb7c('0x3e');}return _0x55a8b2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x48261d,_0x231d47){var _0x206f02=_0x48261d[_0xfb7c('0x40')](function(_0x57e89b,_0x3392b2){if(_0x57e89b['globalStatus']===_0x3392b2['globalStatus']){if(_0x57e89b[_0xfb7c('0x34')]==='pause'){if(_0x231d47===_0xfb7c('0x3a')){return(_0x57e89b[_0xfb7c('0x31')]||'')<(_0x3392b2[_0xfb7c('0x31')]||'')||_0x57e89b[_0xfb7c('0x3d')][_0xfb7c('0x41')]()>_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?0x1:-0x1;}else{return(_0x57e89b[_0xfb7c('0x31')]||'')<(_0x3392b2[_0xfb7c('0x31')]||'')||_0x57e89b[_0xfb7c('0x3d')][_0xfb7c('0x41')]()>_0x3392b2['fullname'][_0xfb7c('0x41')]()?-0x1:0x1;}}else{if(_0x231d47===_0xfb7c('0x3a')){return _0x57e89b['fullname'][_0xfb7c('0x41')]()<_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?0x1:-0x1;}else{return _0x57e89b[_0xfb7c('0x3d')]['toLowerCase']()<_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?-0x1:0x1;}}}else{if(_0x231d47===_0xfb7c('0x3a')){return _0x57e89b[_0xfb7c('0x34')]<_0x3392b2['globalStatus']?0x1:-0x1;}else{return _0x57e89b[_0xfb7c('0x34')]<_0x3392b2[_0xfb7c('0x34')]?-0x1:0x1;}}});return _0x206f02;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x46b69a){var _0x5d0ea5=[_0xfb7c('0x42'),_0xfb7c('0x43'),'lastLoginAt',_0xfb7c('0x44'),_0xfb7c('0x31'),'lastPauseAt','internal',_0xfb7c('0x45'),_0xfb7c('0x30'),'openchannelPause','mailPause',_0xfb7c('0x7'),_0xfb7c('0x9'),_0xfb7c('0x4'),'voicePause',_0xfb7c('0x46'),_0xfb7c('0x47'),_0xfb7c('0x48'),_0xfb7c('0x49'),_0xfb7c('0x4a'),_0xfb7c('0x4b'),_0xfb7c('0x4c'),_0xfb7c('0x4d'),'mailCurrentCapacity',_0xfb7c('0x4e'),'whatsappCurrentCapacity',_0xfb7c('0x4f'),_0xfb7c('0x12'),_0xfb7c('0x14'),_0xfb7c('0x50'),_0xfb7c('0x15'),_0xfb7c('0x51'),_0xfb7c('0x13'),'voiceStatus',_0xfb7c('0x52'),_0xfb7c('0x53'),_0xfb7c('0x54'),'smsStatusTime',_0xfb7c('0x55'),_0xfb7c('0x56'),_0xfb7c('0x57'),_0xfb7c('0x58'),_0xfb7c('0x59'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0xfb7c('0x5a'),'routealias'];var _0x25a1f5=[_0xfb7c('0x30'),_0xfb7c('0x6'),_0xfb7c('0x5'),_0xfb7c('0x7'),_0xfb7c('0x9'),'faxPause',_0xfb7c('0x8'),'online'];var _0x515d18=_(_0x46b69a)[_0xfb7c('0x5b')](_0x25a1f5)[_0xfb7c('0x5c')](_0x5d0ea5)[_0xfb7c('0x29')]();return _0x515d18;}exports[_0xfb7c('0x5d')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e17d902..94c915f 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(_0x4b0ede,_0x1a337d){var _0x425a0f=function(_0x3bb994){while(--_0x3bb994){_0x4b0ede['push'](_0x4b0ede['shift']());}};_0x425a0f(++_0x1a337d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _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(_0x5008d1,_0x71f66){var _0x2b0796=function(_0x5548e0){while(--_0x5548e0){_0x5008d1['push'](_0x5008d1['shift']());}};_0x2b0796(++_0x71f66);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 32a9fe4..904c083 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 _0x4c28=['update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','substring','lodash','child_process','execSync','../environment','orderBy','keys','length','filter','concat','head','mac','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5'];(function(_0x266703,_0x120c3b){var _0x37d275=function(_0x5a300b){while(--_0x5a300b){_0x266703['push'](_0x266703['shift']());}};_0x37d275(++_0x120c3b);}(_0x4c28,0x161));var _0x84c2=function(_0x4d8543,_0x3db473){_0x4d8543=_0x4d8543-0x0;var _0x390e53=_0x4c28[_0x4d8543];return _0x390e53;};'use strict';var _=require(_0x84c2('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x84c2('0x1'))[_0x84c2('0x2')];var config=require(_0x84c2('0x3'));function getInterfaces(){var _0xcc109a=[];var _0x542edc=os['networkInterfaces']();var _0x1b41b4=_[_0x84c2('0x4')](_[_0x84c2('0x5')](_0x542edc));for(var _0x480782=0x0;_0x480782<_0x1b41b4[_0x84c2('0x6')];_0x480782++){var _0x38b55b=_0x542edc[_0x1b41b4[_0x480782]][_0x84c2('0x7')](function(_0x1c9b83){return _0x1c9b83['family']==='IPv4'&&_0x1c9b83['internal']===![];});_0xcc109a=_0xcc109a[_0x84c2('0x8')](_0x38b55b);}return _0xcc109a;}function getFirstInterface(){var _0xc4e6cb=_[_0x84c2('0x9')](getInterfaces());return{'macAddress':_0xc4e6cb&&_0xc4e6cb[_0x84c2('0xa')]?_0xc4e6cb[_0x84c2('0xa')]:'00:00:00:00:00:00','ipAddress':_0xc4e6cb&&_0xc4e6cb['address']?_0xc4e6cb['address']:_0x84c2('0xb')};}exports[_0x84c2('0xc')]=getFirstInterface;function getCPUhash(){var _0x22a8a4=_[_0x84c2('0x4')](os[_0x84c2('0xd')]()[_0x84c2('0xe')](function(_0xe6319a){return _0xe6319a[_0x84c2('0xf')];}))[_0x84c2('0x10')](':');return crypto[_0x84c2('0x11')](_0x84c2('0x12'))[_0x84c2('0x13')](_0x22a8a4)['digest'](_0x84c2('0x14'));}exports[_0x84c2('0x15')]=function(){var _0x476492=os[_0x84c2('0x16')]();var _0x5861d1=/[0-9a-f-]{36}/;if(config[_0x84c2('0x17')]&&_0x5861d1['test'](config[_0x84c2('0x17')])){return config[_0x84c2('0x17')];}else if(_0x476492===_0x84c2('0x18')){return exec(_0x84c2('0x19'),{'encoding':_0x84c2('0x1a')})[_0x84c2('0x1b')]('\x0d\x0a','');}else{var _0x338571=getFirstInterface();var _0x5ed7b4=getCPUhash();var _0x20e18e=_0x5ed7b4+'|'+os[_0x84c2('0x1c')]()+'|'+_0x338571[_0x84c2('0x1d')]+'|'+_0x338571['ipAddress'];var _0x47c988=crypto[_0x84c2('0x11')](_0x84c2('0x12'))[_0x84c2('0x13')](_0x20e18e)['digest'](_0x84c2('0x14'));return _0x47c988[_0x84c2('0x1e')](0x0,0x8)+'-'+_0x47c988[_0x84c2('0x1e')](0x8,0xc)+'-'+_0x47c988[_0x84c2('0x1e')](0xc,0x10)+'-'+_0x47c988[_0x84c2('0x1e')](0x10,0x14)+'-'+_0x47c988['substring'](0x14);}}; \ No newline at end of file +var _0x1f0a=['model','join','md5','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','createHash','update','substring','lodash','crypto','child_process','execSync','../environment','orderBy','keys','length','filter','family','IPv4','internal','mac','address','127.0.0.1','getFirstInterface','cpus','map'];(function(_0x25297f,_0x42dd93){var _0x238f9b=function(_0x22b9d9){while(--_0x22b9d9){_0x25297f['push'](_0x25297f['shift']());}};_0x238f9b(++_0x42dd93);}(_0x1f0a,0x1b5));var _0xa1f0=function(_0x7ca973,_0x425f8b){_0x7ca973=_0x7ca973-0x0;var _0x2750ab=_0x1f0a[_0x7ca973];return _0x2750ab;};'use strict';var _=require(_0xa1f0('0x0'));var os=require('os');var crypto=require(_0xa1f0('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xa1f0('0x2'))[_0xa1f0('0x3')];var config=require(_0xa1f0('0x4'));function getInterfaces(){var _0x121edc=[];var _0x1602ce=os['networkInterfaces']();var _0x4ed6c3=_[_0xa1f0('0x5')](_[_0xa1f0('0x6')](_0x1602ce));for(var _0x56583f=0x0;_0x56583f<_0x4ed6c3[_0xa1f0('0x7')];_0x56583f++){var _0x4db211=_0x1602ce[_0x4ed6c3[_0x56583f]][_0xa1f0('0x8')](function(_0x283452){return _0x283452[_0xa1f0('0x9')]===_0xa1f0('0xa')&&_0x283452[_0xa1f0('0xb')]===![];});_0x121edc=_0x121edc['concat'](_0x4db211);}return _0x121edc;}function getFirstInterface(){var _0x159809=_['head'](getInterfaces());return{'macAddress':_0x159809&&_0x159809['mac']?_0x159809[_0xa1f0('0xc')]:'00:00:00:00:00:00','ipAddress':_0x159809&&_0x159809[_0xa1f0('0xd')]?_0x159809['address']:_0xa1f0('0xe')};}exports[_0xa1f0('0xf')]=getFirstInterface;function getCPUhash(){var _0x4c8e7c=_['orderBy'](os[_0xa1f0('0x10')]()[_0xa1f0('0x11')](function(_0x120fa0){return _0x120fa0[_0xa1f0('0x12')];}))[_0xa1f0('0x13')](':');return crypto['createHash'](_0xa1f0('0x14'))['update'](_0x4c8e7c)[_0xa1f0('0x15')](_0xa1f0('0x16'));}exports[_0xa1f0('0x17')]=function(){var _0x24dfea=os[_0xa1f0('0x18')]();var _0x42784c=/[0-9a-f-]{36}/;if(config[_0xa1f0('0x19')]&&_0x42784c['test'](config[_0xa1f0('0x19')])){return config[_0xa1f0('0x19')];}else if(_0x24dfea===_0xa1f0('0x1a')){return exec(_0xa1f0('0x1b'),{'encoding':_0xa1f0('0x1c')})['replace']('\x0d\x0a','');}else{var _0x27d829=getFirstInterface();var _0x50869a=getCPUhash();var _0x363cbb=_0x50869a+'|'+os[_0xa1f0('0x1d')]()+'|'+_0x27d829[_0xa1f0('0x1e')]+'|'+_0x27d829[_0xa1f0('0x1f')];var _0x539d50=crypto[_0xa1f0('0x20')](_0xa1f0('0x14'))[_0xa1f0('0x21')](_0x363cbb)['digest']('hex');return _0x539d50[_0xa1f0('0x22')](0x0,0x8)+'-'+_0x539d50['substring'](0x8,0xc)+'-'+_0x539d50['substring'](0xc,0x10)+'-'+_0x539d50[_0xa1f0('0x22')](0x10,0x14)+'-'+_0x539d50[_0xa1f0('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 7dbeab3..a917351 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 _0x937a=['../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','version','./hardware'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x937a,0x148));var _0xa937=function(_0x3b677a,_0x274ecc){_0x3b677a=_0x3b677a-0x0;var _0x2e2eb6=_0x937a[_0x3b677a];return _0x2e2eb6;};'use strict';var util=require(_0xa937('0x0'));var moment=require(_0xa937('0x1'));var rp=require(_0xa937('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xa937('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xa937('0x4'));var logger=require(_0xa937('0x5'))(_0xa937('0x6'));var HOST=_0xa937('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4b2109){return new BPromise(function(_0xabc29c,_0x300642){var _0x1bd8e1=util['format'](_0xa937('0x8'),HOST,_0x4b2109,module[_0xa937('0x9')][_0xa937('0x3')]);if(oldToken){_0x1bd8e1=util[_0xa937('0xa')](_0xa937('0xb'),HOST,_0x4b2109,module['exports'][_0xa937('0x3')],oldToken);}var _0xaa421={'uri':_0x1bd8e1,'method':_0xa937('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xaa421)[_0xa937('0xd')](function(_0x574651){_0xabc29c(_0x574651);})[_0xa937('0xe')](function(_0x200c83){_0x300642(_0x200c83);});});}function manageLicense(_0xaaa474,_0x1db195){var _0x56fb0e=_0x1db195['get']({'plain':!![]});if(!isOldTokenSent&&_0x56fb0e[_0xa937('0xf')]!==_0xaaa474&&!_0x56fb0e[_0xa937('0x10')]){oldToken=_0x56fb0e[_0xa937('0xf')];}httpRequest(_0xaaa474)[_0xa937('0xd')](function(_0x1c45ef){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1c45ef[_0xa937('0x11')]){isOldTokenSent=![];if(!_0x56fb0e[_0xa937('0x6')]&&_0x56fb0e['license']!=_0x1c45ef[_0xa937('0x6')]||_0x56fb0e[_0xa937('0x6')]&&_0x56fb0e[_0xa937('0x10')]){logger[_0xa937('0x12')](_0xa937('0x13'));}if(_0x56fb0e[_0xa937('0x6')]&&!_0x56fb0e[_0xa937('0x10')]&&_0x56fb0e[_0xa937('0x6')]!=_0x1c45ef[_0xa937('0x6')]){logger[_0xa937('0x12')](_0xa937('0x14'));}if(_0x56fb0e['license']&&!_0x56fb0e[_0xa937('0x10')]&&_0x56fb0e['license']==_0x1c45ef['license']){return _0x1db195;}return _0x1db195['update']({'data1':_0xaaa474,'data2':null,'license':_0x1c45ef[_0xa937('0x6')]});}else{if(_0x1c45ef[_0xa937('0x6')]||_0x56fb0e[_0xa937('0x6')]){if(!_0x56fb0e['data2']){if(_0x56fb0e[_0xa937('0xf')]==_0xaaa474){GRAY_PERIOD_REASON='Disabled';logger[_0xa937('0x12')](_0xa937('0x15'));}else{GRAY_PERIOD_REASON=_0xa937('0x16');logger[_0xa937('0x12')](_0xa937('0x17'),_0x56fb0e['data1'],_0xaaa474);}logger[_0xa937('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xa937('0x18')](),moment()[_0xa937('0xa')](_0xa937('0x19')));return _0x1db195[_0xa937('0x1a')]({'data2':encryptor[_0xa937('0x1b')](moment()[_0xa937('0xa')](_0xa937('0x19')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x56fb0e['data2']),_0xa937('0x1c'))>DAYS){logger[_0xa937('0x12')](_0xa937('0x1d'),moment()[_0xa937('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1db195[_0xa937('0x1a')]({'data1':_0xaaa474,'data2':null,'license':null});}}}else{if(_0x56fb0e['data1']!=_0xaaa474){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56fb0e[_0xa937('0xf')],_0xaaa474);return _0x1db195[_0xa937('0x1a')]({'data1':_0xaaa474,'data2':null,'license':null});}}}return _0x1db195;})[_0xa937('0xd')](function(_0x4fbbf4){_0x1db195=_0x4fbbf4;})[_0xa937('0xe')](function(_0x3dff5b){logger[_0xa937('0x1e')](_0x3dff5b[_0xa937('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xa937('0x20')](),_0x1db195);},TIME);});}function defaultLicense(){var _0x5abb38=hardware['getUuid']();if(_0x5abb38){return db['License'][_0xa937('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x5abb38}})[_0xa937('0x22')](function(_0x88ba,_0x20ee8f){logger[_0xa937('0x12')](_0xa937('0x23'),_0x5abb38);manageLicense(_0x5abb38,_0x88ba);})[_0xa937('0xe')](function(_0x1993d5){logger['error'](_0x1993d5[_0xa937('0x1f')]);});}}exports[_0xa937('0x24')]=defaultLicense; \ No newline at end of file +var _0x5963=['update','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','data1','then','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5963,0xac));var _0x3596=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5963[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x3596('0x0'));var moment=require(_0x3596('0x1'));var rp=require(_0x3596('0x2'));var BPromise=require(_0x3596('0x3'));var pkginfo=require('pkginfo')(module,_0x3596('0x4'));var db=require(_0x3596('0x5'))['db'];var encryptor=require(_0x3596('0x6'));var hardware=require(_0x3596('0x7'));var logger=require(_0x3596('0x8'))(_0x3596('0x9'));var HOST=_0x3596('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4cfffd){return new BPromise(function(_0x532635,_0x5da80c){var _0x3f5e01=util[_0x3596('0xb')](_0x3596('0xc'),HOST,_0x4cfffd,module[_0x3596('0xd')][_0x3596('0x4')]);if(oldToken){_0x3f5e01=util[_0x3596('0xb')](_0x3596('0xe'),HOST,_0x4cfffd,module[_0x3596('0xd')][_0x3596('0x4')],oldToken);}var _0x2bc5b6={'uri':_0x3f5e01,'method':_0x3596('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2bc5b6)['then'](function(_0x3aa6ce){_0x532635(_0x3aa6ce);})[_0x3596('0x10')](function(_0x5df6ca){_0x5da80c(_0x5df6ca);});});}function manageLicense(_0x5ec29e,_0xe129be){var _0x4a3a1b=_0xe129be['get']({'plain':!![]});if(!isOldTokenSent&&_0x4a3a1b['data1']!==_0x5ec29e&&!_0x4a3a1b['data2']){oldToken=_0x4a3a1b[_0x3596('0x11')];}httpRequest(_0x5ec29e)[_0x3596('0x12')](function(_0x264f62){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x264f62[_0x3596('0x13')]){isOldTokenSent=![];if(!_0x4a3a1b[_0x3596('0x9')]&&_0x4a3a1b[_0x3596('0x9')]!=_0x264f62[_0x3596('0x9')]||_0x4a3a1b[_0x3596('0x9')]&&_0x4a3a1b[_0x3596('0x14')]){logger[_0x3596('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4a3a1b[_0x3596('0x9')]&&!_0x4a3a1b[_0x3596('0x14')]&&_0x4a3a1b['license']!=_0x264f62[_0x3596('0x9')]){logger[_0x3596('0x15')](_0x3596('0x16'));}if(_0x4a3a1b['license']&&!_0x4a3a1b[_0x3596('0x14')]&&_0x4a3a1b['license']==_0x264f62['license']){return _0xe129be;}return _0xe129be['update']({'data1':_0x5ec29e,'data2':null,'license':_0x264f62[_0x3596('0x9')]});}else{if(_0x264f62[_0x3596('0x9')]||_0x4a3a1b[_0x3596('0x9')]){if(!_0x4a3a1b[_0x3596('0x14')]){if(_0x4a3a1b[_0x3596('0x11')]==_0x5ec29e){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x3596('0x17'));}else{GRAY_PERIOD_REASON=_0x3596('0x18');logger[_0x3596('0x15')](_0x3596('0x19'),_0x4a3a1b[_0x3596('0x11')],_0x5ec29e);}logger[_0x3596('0x15')](_0x3596('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xe129be['update']({'data2':encryptor[_0x3596('0x1b')](moment()[_0x3596('0xb')](_0x3596('0x1c')))});}else{if(moment()[_0x3596('0x1d')](encryptor[_0x3596('0x1e')](_0x4a3a1b[_0x3596('0x14')]),_0x3596('0x1f'))>DAYS){logger[_0x3596('0x15')](_0x3596('0x20'),moment()[_0x3596('0xb')](_0x3596('0x1c')));isOldTokenSent=![];return _0xe129be['update']({'data1':_0x5ec29e,'data2':null,'license':null});}}}else{if(_0x4a3a1b[_0x3596('0x11')]!=_0x5ec29e){logger[_0x3596('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4a3a1b[_0x3596('0x11')],_0x5ec29e);return _0xe129be[_0x3596('0x21')]({'data1':_0x5ec29e,'data2':null,'license':null});}}}return _0xe129be;})[_0x3596('0x12')](function(_0x47fa11){_0xe129be=_0x47fa11;})['catch'](function(_0x5a9890){logger[_0x3596('0x22')](_0x5a9890[_0x3596('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xe129be);},TIME);});}function defaultLicense(){var _0x1ac0f1=hardware[_0x3596('0x24')]();if(_0x1ac0f1){return db[_0x3596('0x25')][_0x3596('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x1ac0f1}})[_0x3596('0x27')](function(_0x2fa89b,_0x4b5fd4){logger[_0x3596('0x15')](_0x3596('0x28'),_0x1ac0f1);manageLicense(_0x1ac0f1,_0x2fa89b);})[_0x3596('0x10')](function(_0x23e2b5){logger[_0x3596('0x22')](_0x23e2b5[_0x3596('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 993ed41..36ec072 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 _0x6005=['add','days','grayReason','disabled','User','role','sequelize','COUNT','col','count','admin','users','telephones','forEach','user','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline'];(function(_0x417719,_0x4e0b3a){var _0x178392=function(_0x200a13){while(--_0x200a13){_0x417719['push'](_0x417719['shift']());}};_0x178392(++_0x4e0b3a);}(_0x6005,0x1c4));var _0x5600=function(_0x2cacd1,_0x111683){_0x2cacd1=_0x2cacd1-0x0;var _0x32dbf5=_0x6005[_0x2cacd1];return _0x32dbf5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5600('0x0'));var BPromise=require(_0x5600('0x1'));var hardware=require(_0x5600('0x2'));var encryptor=require(_0x5600('0x3'));var db=require(_0x5600('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5600('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5600('0x6'),'machineUuid':hardware[_0x5600('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5600('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5e3064){return new BPromise(function(_0x282541,_0x1a1770){return db[_0x5600('0x8')][_0x5600('0x9')](_[_0x5600('0xa')](_0x5e3064,{'raw':!![],'where':{'id':0x1}}))[_0x5600('0xb')](function(_0x4186a8){return checkLicense(_0x4186a8,null);})[_0x5600('0xb')](function(_0x451eb9){_0x282541(_0x451eb9);return;})[_0x5600('0xc')](function(_0x558306){_0x1a1770(_0x558306);});});}function checkLicense(_0x5ef515,_0x27daa4){if(!_0x5ef515){demoLicense[_0x5600('0xd')]=_0x5ef515[_0x5600('0xe')];return demoLicense;}try{var _0x11398c=_0x27daa4||_0x5ef515[_0x5600('0xf')];if(_[_0x5600('0x10')](_0x11398c)){throw new Error(_0x5600('0x11'));}var _0x7b05c8=_0x5ef515[_0x5600('0xe')];var _0x4a5afc=_0x5ef515[_0x5600('0x12')];var _0x2e6f4d=_0x7b05c8[_0x5600('0x13')]('-')[0x4];var _0x186023=_0x7b05c8[_0x5600('0x13')]('-')[0x0];var _0x27af96=encryptor[_0x5600('0x14')](_0x11398c,util[_0x5600('0x15')](_0x5600('0x16'),_0x2e6f4d,_0x7b05c8,_0x186023));var _0x3673c4=JSON[_0x5600('0x17')](_0x27af96);_0x3673c4[_0x5600('0x18')]=![];_0x3673c4[_0x5600('0xd')]=_0x7b05c8;_0x3673c4[_0x5600('0x19')]=hardware[_0x5600('0x7')]();if(_0x4a5afc){var _0x5b0123=encryptor['decryptString'](_0x4a5afc);_0x3673c4[_0x5600('0x1a')]=_0x5b0123;_0x3673c4[_0x5600('0x1b')]=moment(_0x5b0123)[_0x5600('0x1c')](0x7,_0x5600('0x1d'))[_0x5600('0x15')]();_0x3673c4[_0x5600('0x1e')]=_0x3673c4[_0x5600('0xd')]!=_0x3673c4['machineUuid']?'changed':_0x5600('0x1f');}return _0x3673c4;}catch(_0x2e1aee){breakingLicense[_0x5600('0xd')]=_0x5ef515['data1'];breakingLicense['message']=_0x2e1aee['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4e240a,_0x509a06){getLicense()[_0x5600('0xb')](function(_0x52b99e){return db[_0x5600('0x20')]['findAll']({'attributes':[_0x5600('0x21'),[db[_0x5600('0x22')]['fn'](_0x5600('0x23'),db[_0x5600('0x22')][_0x5600('0x24')](_0x5600('0x21'))),_0x5600('0x25')]],'group':_0x5600('0x21'),'where':{'role':{'$or':[_0x5600('0x26'),'user','telephone']}},'raw':!![]})[_0x5600('0xb')](function(_0x11a5d0){var _0x4d897a={'user':_0x52b99e[_0x5600('0x27')]||0x0,'telephone':_0x52b99e[_0x5600('0x28')]||0x0};_0x11a5d0[_0x5600('0x29')](function(_0x179a24){var _0x2cf60f=_0x179a24[_0x5600('0x21')]==='admin'?_0x5600('0x2a'):_0x179a24[_0x5600('0x21')];_0x4d897a[_0x2cf60f]-=_0x179a24['count'];if(_0x4d897a[_0x2cf60f]<0x0)_0x4d897a[_0x2cf60f]=0x0;});_0x4e240a(_0x4d897a);return;});})[_0x5600('0xc')](function(_0x594401){_0x509a06(_0x594401);});});}function checkUserLimits(_0x3b1df5){return new BPromise(function(_0x2ff314,_0x9c0acb){getLimits()[_0x5600('0xb')](function(_0x5272bb){var _0x45a256=_[_0x5600('0x2b')](_['countBy'](_0x3b1df5,_0x5600('0x21')),[_0x5600('0x26'),_0x5600('0x2a'),_0x5600('0x2c')]);var _0x398a02=(_0x45a256[_0x5600('0x26')]||0x0)+(_0x45a256[_0x5600('0x2a')]||0x0);var _0x1a473e=_0x45a256[_0x5600('0x2c')]||0x0;if(_0x398a02>_0x5272bb[_0x5600('0x2a')])return _0x9c0acb(_0x5600('0x2d'));if(_0x1a473e>_0x5272bb[_0x5600('0x2c')])return _0x9c0acb(_0x5600('0x2e'));return _0x2ff314();})[_0x5600('0xc')](function(_0x4113ba){_0x9c0acb(_0x4113ba);});});}module[_0x5600('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xe1cc=['decryptString','gray','deadline','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','user','telephones','forEach','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','%s:%s:%s','parse','machineUuid'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0xe1cc,0x68));var _0xce1c=function(_0x27a7b1,_0x59c48f){_0x27a7b1=_0x27a7b1-0x0;var _0xb22e88=_0xe1cc[_0x27a7b1];return _0xb22e88;};'use strict';var util=require(_0xce1c('0x0'));var _=require(_0xce1c('0x1'));var moment=require(_0xce1c('0x2'));var BPromise=require(_0xce1c('0x3'));var hardware=require(_0xce1c('0x4'));var encryptor=require(_0xce1c('0x5'));var db=require(_0xce1c('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xce1c('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xce1c('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xce1c('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xce1c('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x315cc7){return new BPromise(function(_0x3811b3,_0x3ac8e7){return db[_0xce1c('0xa')]['find'](_[_0xce1c('0xb')](_0x315cc7,{'raw':!![],'where':{'id':0x1}}))[_0xce1c('0xc')](function(_0x51c97d){return checkLicense(_0x51c97d,null);})[_0xce1c('0xc')](function(_0x585017){_0x3811b3(_0x585017);return;})[_0xce1c('0xd')](function(_0x59d4af){_0x3ac8e7(_0x59d4af);});});}function checkLicense(_0x580bc7,_0x295ddb){if(!_0x580bc7){demoLicense[_0xce1c('0xe')]=_0x580bc7[_0xce1c('0xf')];return demoLicense;}try{var _0x1a8fe7=_0x295ddb||_0x580bc7['license'];if(_[_0xce1c('0x10')](_0x1a8fe7)){throw new Error(_0xce1c('0x11'));}var _0x20b115=_0x580bc7[_0xce1c('0xf')];var _0x2c95f5=_0x580bc7[_0xce1c('0x12')];var _0x660555=_0x20b115['split']('-')[0x4];var _0x439056=_0x20b115['split']('-')[0x0];var _0xb17766=encryptor['decryptString'](_0x1a8fe7,util['format'](_0xce1c('0x13'),_0x660555,_0x20b115,_0x439056));var _0x249894=JSON[_0xce1c('0x14')](_0xb17766);_0x249894['demo']=![];_0x249894[_0xce1c('0xe')]=_0x20b115;_0x249894[_0xce1c('0x15')]=hardware[_0xce1c('0x9')]();if(_0x2c95f5){var _0x92a2b7=encryptor[_0xce1c('0x16')](_0x2c95f5);_0x249894[_0xce1c('0x17')]=_0x92a2b7;_0x249894[_0xce1c('0x18')]=moment(_0x92a2b7)['add'](0x7,'days')['format']();_0x249894[_0xce1c('0x19')]=_0x249894[_0xce1c('0xe')]!=_0x249894['machineUuid']?_0xce1c('0x1a'):_0xce1c('0x1b');}return _0x249894;}catch(_0x41f250){breakingLicense['uuid']=_0x580bc7[_0xce1c('0xf')];breakingLicense[_0xce1c('0x1c')]=_0x41f250[_0xce1c('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x45fa29,_0x56286d){getLicense()['then'](function(_0xe8be46){return db[_0xce1c('0x1d')][_0xce1c('0x1e')]({'attributes':[_0xce1c('0x1f'),[db[_0xce1c('0x20')]['fn'](_0xce1c('0x21'),db[_0xce1c('0x20')]['col'](_0xce1c('0x1f'))),'count']],'group':_0xce1c('0x1f'),'where':{'role':{'$or':['admin',_0xce1c('0x22'),'telephone']}},'raw':!![]})[_0xce1c('0xc')](function(_0x141d5c){var _0x5813ee={'user':_0xe8be46['users']||0x0,'telephone':_0xe8be46[_0xce1c('0x23')]||0x0};_0x141d5c[_0xce1c('0x24')](function(_0x26a280){var _0x32407e=_0x26a280[_0xce1c('0x1f')]===_0xce1c('0x25')?_0xce1c('0x22'):_0x26a280[_0xce1c('0x1f')];_0x5813ee[_0x32407e]-=_0x26a280['count'];if(_0x5813ee[_0x32407e]<0x0)_0x5813ee[_0x32407e]=0x0;});_0x45fa29(_0x5813ee);return;});})[_0xce1c('0xd')](function(_0x85552c){_0x56286d(_0x85552c);});});}function checkUserLimits(_0x3e00ab){return new BPromise(function(_0x18fdda,_0x2ff8c2){getLimits()[_0xce1c('0xc')](function(_0x17ce06){var _0x515f07=_['pick'](_['countBy'](_0x3e00ab,_0xce1c('0x1f')),[_0xce1c('0x25'),_0xce1c('0x22'),_0xce1c('0x26')]);var _0x25538e=(_0x515f07[_0xce1c('0x25')]||0x0)+(_0x515f07[_0xce1c('0x22')]||0x0);var _0x289584=_0x515f07[_0xce1c('0x26')]||0x0;if(_0x25538e>_0x17ce06['user'])return _0x2ff8c2(_0xce1c('0x27'));if(_0x289584>_0x17ce06[_0xce1c('0x26')])return _0x2ff8c2(_0xce1c('0x28'));return _0x18fdda();})[_0xce1c('0xd')](function(_0x3c1add){_0x2ff8c2(_0x3c1add);});});}module[_0xce1c('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ca90c01..a026aef 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 _0x1399=['app-id','exports','http://localhost:9000'];(function(_0x1c58cd,_0x13ccf0){var _0x4d0956=function(_0x2dc3fc){while(--_0x2dc3fc){_0x1c58cd['push'](_0x1c58cd['shift']());}};_0x4d0956(++_0x13ccf0);}(_0x1399,0x16c));var _0x9139=function(_0x4fd4af,_0x3cfcc7){_0x4fd4af=_0x4fd4af-0x0;var _0x2eaa45=_0x1399[_0x4fd4af];return _0x2eaa45;};'use strict';module[_0x9139('0x0')]={'DOMAIN':_0x9139('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x9139('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x5f66=['app-id','secret','http://localhost:9000'];(function(_0x4b9750,_0x538cbf){var _0x4470b0=function(_0x204609){while(--_0x204609){_0x4b9750['push'](_0x4b9750['shift']());}};_0x4470b0(++_0x538cbf);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';module['exports']={'DOMAIN':_0x65f6('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x65f6('0x1'),'GOOGLE_SECRET':_0x65f6('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 2654337..846101e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffa8=['fileLogger','exports','../utils/loggers'];(function(_0x447f09,_0x94b5b0){var _0x29b2f7=function(_0x2d75a3){while(--_0x2d75a3){_0x447f09['push'](_0x447f09['shift']());}};_0x29b2f7(++_0x94b5b0);}(_0xffa8,0x1dc));var _0x8ffa=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xffa8[_0x5b644e];return _0x49c6bf;};'use strict';var fileLogger=require(_0x8ffa('0x0'))[_0x8ffa('0x1')];module[_0x8ffa('0x2')]=fileLogger; \ No newline at end of file +var _0xf6ea=['exports','../utils/loggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6ea,0x1af));var _0xaf6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf6ea[_0x502c7d];return _0x30b7ed;};'use strict';var fileLogger=require(_0xaf6e('0x0'))['fileLogger'];module[_0xaf6e('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c5be849..bca4167 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 _0x23f5=['../../services/express/index.js','ami','../../services/ami/index.js','agi','join','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x23f5,0x107));var _0x523f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x23f5[_0x21a9d9];return _0x46adce;};'use strict';var path=require(_0x523f('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x523f('0x1'))},{'name':_0x523f('0x2'),'script':path['join'](__dirname,_0x523f('0x3'))},{'name':_0x523f('0x4'),'script':path[_0x523f('0x5')](__dirname,'../../services/agi/index.js')},{'name':_0x523f('0x6'),'script':path[_0x523f('0x5')](__dirname,'../../services/email/index.js')},{'name':_0x523f('0x7'),'script':path[_0x523f('0x5')](__dirname,_0x523f('0x8'))},{'name':_0x523f('0x9'),'script':path[_0x523f('0x5')](__dirname,_0x523f('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0xa824=['join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js'];(function(_0x421ec0,_0x5ae73b){var _0x1d79cf=function(_0x16db00){while(--_0x16db00){_0x421ec0['push'](_0x421ec0['shift']());}};_0x1d79cf(++_0x5ae73b);}(_0xa824,0x15e));var _0x4a82=function(_0x1ddc01,_0x36efdd){_0x1ddc01=_0x1ddc01-0x0;var _0x2cba33=_0xa824[_0x1ddc01];return _0x2cba33;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4a82('0x0'),'script':path['join'](__dirname,_0x4a82('0x1'))},{'name':'ami','script':path[_0x4a82('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x3'))},{'name':_0x4a82('0x4'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x5'))},{'name':_0x4a82('0x6'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x7'))},{'name':_0x4a82('0x8'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x9'))}]};module[_0x4a82('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c53ea51..114f28d 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 _0xe831=['connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xe831,0x1a2));var _0x1e83=function(_0x53b38e,_0xa188c3){_0x53b38e=_0x53b38e-0x0;var _0x87ad78=_0xe831[_0x53b38e];return _0x87ad78;};'use strict';var pm2=require(_0x1e83('0x0'));var BPromise=require(_0x1e83('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x57e030,_0x20a4af){return pm2[_0x1e83('0x2')](function(_0x17e084){if(_0x17e084){return _0x20a4af(_0x17e084);}return _0x57e030(_0x1e83('0x3'));});});};exports['start']=function(_0x35c0fa){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x940730,_0x3c4fbe){return pm2[_0x1e83('0x5')](_0x35c0fa,function(_0x2cec04,_0x8ef041){if(_0x2cec04){return _0x3c4fbe(_0x2cec04);}pm2[_0x1e83('0x6')]();return _0x940730(_0x8ef041);});});});};exports[_0x1e83('0x7')]=function(_0x210878){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x5427b0,_0x3f87c6){return pm2[_0x1e83('0x7')](_0x210878,function(_0x22a398,_0x291a89){if(_0x22a398){return _0x3f87c6(_0x22a398);}pm2['disconnect']();return _0x5427b0(_0x291a89);});});});};exports[_0x1e83('0x8')]=function(_0x42a80b){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x57e3b1,_0x4b53af){return pm2['restart'](_0x42a80b,function(_0x419e8d,_0x126503){if(_0x419e8d){return _0x4b53af(_0x419e8d);}pm2['disconnect']();return _0x57e3b1(_0x126503);});});});};exports['list']=function(){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x5a8e49,_0x481e01){return pm2[_0x1e83('0x9')](function(_0x4615aa,_0x7659ed){if(_0x4615aa){return _0x481e01(_0x4615aa);}pm2[_0x1e83('0x6')]();return _0x5a8e49(_0x7659ed);});});});};exports[_0x1e83('0xa')]=function(_0x5782a6){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x189c0e,_0x1310e0){return pm2[_0x1e83('0xa')](_0x5782a6,function(_0x211324,_0x3c9085){if(_0x211324){return _0x1310e0(_0x211324);}pm2[_0x1e83('0x6')]();return _0x189c0e(_0x3c9085);});});});};exports[_0x1e83('0xb')]=function(_0x164bab){return connect()['then'](function(){return new BPromise(function(_0x4f7d6e,_0x31428b){return pm2['delete'](_0x164bab,function(_0x2a3b95,_0x510452){if(_0x2a3b95){return _0x31428b(_0x2a3b95);}pm2[_0x1e83('0x6')]();return _0x4f7d6e(_0x510452);});});});};exports[_0x1e83('0xc')]=function(){return connect()[_0x1e83('0x4')](function(){return new BPromise(function(_0x1e83d0,_0x3f58f3){return pm2[_0x1e83('0xc')](function(_0x1f320d){if(_0x1f320d){return _0x3f58f3(_0x1f320d);}return _0x1e83d0(_0x1e83('0xd'));});});});}; \ No newline at end of file +var _0x12a6=['connected','start','stop','then','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect'];(function(_0x59c05a,_0x3b004d){var _0x1a0bfd=function(_0x399664){while(--_0x399664){_0x59c05a['push'](_0x59c05a['shift']());}};_0x1a0bfd(++_0x3b004d);}(_0x12a6,0x7a));var _0x612a=function(_0x590a3a,_0xd9db9){_0x590a3a=_0x590a3a-0x0;var _0x49017f=_0x12a6[_0x590a3a];return _0x49017f;};'use strict';var pm2=require(_0x612a('0x0'));var BPromise=require(_0x612a('0x1'));var config=require(_0x612a('0x2'));function connect(){return new BPromise(function(_0x3b0549,_0xc30f62){return pm2[_0x612a('0x3')](function(_0x68dc4b){if(_0x68dc4b){return _0xc30f62(_0x68dc4b);}return _0x3b0549(_0x612a('0x4'));});});};exports[_0x612a('0x5')]=function(_0x26de6e){return connect()['then'](function(){return new BPromise(function(_0x2b73d4,_0x4077ff){return pm2[_0x612a('0x5')](_0x26de6e,function(_0x452036,_0x450104){if(_0x452036){return _0x4077ff(_0x452036);}pm2['disconnect']();return _0x2b73d4(_0x450104);});});});};exports[_0x612a('0x6')]=function(_0x4ec215){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x497a0d,_0x131359){return pm2[_0x612a('0x6')](_0x4ec215,function(_0x22a901,_0x3dd1ca){if(_0x22a901){return _0x131359(_0x22a901);}pm2[_0x612a('0x8')]();return _0x497a0d(_0x3dd1ca);});});});};exports[_0x612a('0x9')]=function(_0x497759){return connect()['then'](function(){return new BPromise(function(_0x43adda,_0x43e6c9){return pm2['restart'](_0x497759,function(_0x2bc8a5,_0x56d167){if(_0x2bc8a5){return _0x43e6c9(_0x2bc8a5);}pm2['disconnect']();return _0x43adda(_0x56d167);});});});};exports['list']=function(){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x2dce03,_0x3a3f7d){return pm2[_0x612a('0xa')](function(_0x1446b,_0x65050){if(_0x1446b){return _0x3a3f7d(_0x1446b);}pm2[_0x612a('0x8')]();return _0x2dce03(_0x65050);});});});};exports[_0x612a('0xb')]=function(_0x4483c1){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x5916ac,_0x435eeb){return pm2[_0x612a('0xb')](_0x4483c1,function(_0x14d2bf,_0x2b345c){if(_0x14d2bf){return _0x435eeb(_0x14d2bf);}pm2['disconnect']();return _0x5916ac(_0x2b345c);});});});};exports[_0x612a('0xc')]=function(_0x2c3b7f){return connect()['then'](function(){return new BPromise(function(_0x72d78c,_0x3a75dd){return pm2[_0x612a('0xc')](_0x2c3b7f,function(_0x349844,_0x32509d){if(_0x349844){return _0x3a75dd(_0x349844);}pm2[_0x612a('0x8')]();return _0x72d78c(_0x32509d);});});});};exports[_0x612a('0xd')]=function(){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x835636,_0x37ca3d){return pm2['dump'](function(_0x4cdcf2){if(_0x4cdcf2){return _0x37ca3d(_0x4cdcf2);}return _0x835636('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8c700c4..34805b2 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 _0xd86e=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xd86e,0x1d8));var _0xed86=function(_0x1f94f7,_0x631a8c){_0x1f94f7=_0x1f94f7-0x0;var _0x2b6fbd=_0xd86e[_0x1f94f7];return _0x2b6fbd;};'use strict';var _=require(_0xed86('0x0'));var moment=require(_0xed86('0x1'));var Redis=require(_0xed86('0x2'));var util=require(_0xed86('0x3'));var config=require(_0xed86('0x4'));var db=require(_0xed86('0x5'))['db'];var logger=require(_0xed86('0x6'))(_0xed86('0x7'));config[_0xed86('0x8')]=_[_0xed86('0x9')](config[_0xed86('0x8')],{'host':_0xed86('0xa'),'port':0x18eb});var io=require(_0xed86('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x24b63e=0x0;var _0x85b9d=[];return db[_0xed86('0xc')][_0xed86('0xd')]({'raw':!![],'attributes':['id',_0xed86('0xe')],'where':{'id':0x1}})['then'](function(_0x2279cf){_0x24b63e=_0x2279cf['chatTimeout'];if(_0x24b63e){return db[_0xed86('0xf')][_0xed86('0x10')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2279cf['chatTimeout'],_0xed86('0x11'))}}});}else{return[];}})['then'](function(_0x4b4634){if(_0x4b4634&&_0x4b4634[_0xed86('0x12')]){_0x85b9d=_[_0xed86('0x13')](_0x4b4634||[],'id');logger[_0xed86('0x14')](_0xed86('0x15'),_0x85b9d['join']());return db[_0xed86('0xf')][_0xed86('0x16')]({'closeReason':_0xed86('0x17'),'disposition':_0xed86('0x18'),'closed':!![],'closedAt':moment()[_0xed86('0x19')](_0xed86('0x1a'))},{'where':{'id':_0x85b9d}});}})['then'](function(){if(_0x85b9d&&_0x85b9d[_0xed86('0x12')]){logger[_0xed86('0x14')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x85b9d['join']());for(var _0x250858=0x0;_0x250858<_0x85b9d[_0xed86('0x12')];_0x250858++){io[_0xed86('0x1b')](_0xed86('0x1c'),{'id':_0x85b9d[_0x250858],'closed':!![]});}}})['catch'](function(_0x36183){logger[_0xed86('0x1d')](_0xed86('0x1e'),_0x36183?util[_0xed86('0x1f')](_0x36183,{'showHidden':![],'depth':null}):'');});}exports[_0xed86('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4e2a=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','join','system','timeout','format'];(function(_0xcbbd05,_0x8c097a){var _0x5538b2=function(_0x3be359){while(--_0x3be359){_0xcbbd05['push'](_0xcbbd05['shift']());}};_0x5538b2(++_0x8c097a);}(_0x4e2a,0xe5));var _0xa4e2=function(_0x367c78,_0x58ee26){_0x367c78=_0x367c78-0x0;var _0x2a1044=_0x4e2a[_0x367c78];return _0x2a1044;};'use strict';var _=require(_0xa4e2('0x0'));var moment=require(_0xa4e2('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xa4e2('0x2'));var db=require(_0xa4e2('0x3'))['db'];var logger=require(_0xa4e2('0x4'))(_0xa4e2('0x5'));config[_0xa4e2('0x6')]=_[_0xa4e2('0x7')](config['redis'],{'host':_0xa4e2('0x8'),'port':0x18eb});var io=require(_0xa4e2('0x9'))(new Redis(config[_0xa4e2('0x6')]));function closeInteractions(){var _0x5555ba=0x0;var _0x3bead=[];return db[_0xa4e2('0xa')][_0xa4e2('0xb')]({'raw':!![],'attributes':['id',_0xa4e2('0xc')],'where':{'id':0x1}})[_0xa4e2('0xd')](function(_0x47e88e){_0x5555ba=_0x47e88e[_0xa4e2('0xc')];if(_0x5555ba){return db[_0xa4e2('0xe')]['findAll']({'raw':!![],'attributes':['id',_0xa4e2('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa4e2('0x10')](_0x47e88e[_0xa4e2('0xc')],_0xa4e2('0x11'))}}});}else{return[];}})[_0xa4e2('0xd')](function(_0x1fd20b){if(_0x1fd20b&&_0x1fd20b[_0xa4e2('0x12')]){_0x3bead=_['map'](_0x1fd20b||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x3bead[_0xa4e2('0x13')]());return db[_0xa4e2('0xe')]['update']({'closeReason':_0xa4e2('0x14'),'disposition':_0xa4e2('0x15'),'closed':!![],'closedAt':moment()[_0xa4e2('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3bead}});}})[_0xa4e2('0xd')](function(){if(_0x3bead&&_0x3bead[_0xa4e2('0x12')]){logger['info'](_0xa4e2('0x17'),_0x3bead['join']());for(var _0x42590=0x0;_0x42590<_0x3bead[_0xa4e2('0x12')];_0x42590++){io['emit'](_0xa4e2('0x18'),{'id':_0x3bead[_0x42590],'closed':!![]});}}})['catch'](function(_0x534907){logger['error'](_0xa4e2('0x19'),_0x534907?util[_0xa4e2('0x1a')](_0x534907,{'showHidden':![],'depth':null}):'');});}exports[_0xa4e2('0x1b')]=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 5a0f6fa..9489607 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 _0x0701=['exports'];(function(_0x340fdf,_0x48ad2b){var _0x1a04c2=function(_0x5bcc8e){while(--_0x5bcc8e){_0x340fdf['push'](_0x340fdf['shift']());}};_0x1a04c2(++_0x48ad2b);}(_0x0701,0xa6));var _0x1070=function(_0x14457c,_0x544b60){_0x14457c=_0x14457c-0x0;var _0x3498f7=_0x0701[_0x14457c];return _0x3498f7;};'use strict';function start(){var _0x2343a9=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2343a9['startAllRefreshIntervals']();}module[_0x1070('0x0')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x8fb9=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x37b803,_0x5d4cb8){var _0x56ab7d=function(_0x4c1f10){while(--_0x4c1f10){_0x37b803['push'](_0x37b803['shift']());}};_0x56ab7d(++_0x5d4cb8);}(_0x8fb9,0x174));var _0x98fb=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x8fb9[_0x295314];return _0x584b0c;};'use strict';function start(){var _0x2908ac=require(_0x98fb('0x0'));return _0x2908ac[_0x98fb('0x1')]();}module[_0x98fb('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 e3361cf..5e36434 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 _0x28f8=['endAt','add','start','add\x20cron','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','basename','savename','extname','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','CustomReportId','runReport','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','active','isBetween','startAt'];(function(_0xc6a24c,_0x14e5e1){var _0x3b4f07=function(_0x4c3ee1){while(--_0x4c3ee1){_0xc6a24c['push'](_0xc6a24c['shift']());}};_0x3b4f07(++_0x14e5e1);}(_0x28f8,0x158));var _0x828f=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x28f8[_0x3a3fcc];return _0xe16438;};'use strict';var fs=require('fs');var util=require(_0x828f('0x0'));var path=require(_0x828f('0x1'));var _=require(_0x828f('0x2'));var moment=require(_0x828f('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x828f('0x4'));var BPromise=require(_0x828f('0x5'));var logger=require(_0x828f('0x6'))(_0x828f('0x7'));var db=require(_0x828f('0x8'))['db'];var analyticCustomReportController=require(_0x828f('0x9'));var analyticDefaultReportController=require(_0x828f('0xa'));var client=jayson[_0x828f('0xb')][_0x828f('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x35d0f5,_0x265f98){return function(){logger[_0x828f('0xd')](_0x828f('0xe'),_0x35d0f5[_0x828f('0xf')]);var _0x5bac00=!![];var _0x4d925c=_0x35d0f5[_0x828f('0x10')][_0x828f('0x11')]();var _0x565907={'account':_0x4d925c,'message':{'from':util[_0x828f('0x12')]('\x22%s\x22\x20<%s>',_0x35d0f5[_0x828f('0x10')][_0x828f('0x13')],_0x35d0f5[_0x828f('0x10')][_0x828f('0xf')]||_0x35d0f5[_0x828f('0x10')][_0x828f('0x14')][_0x828f('0x15')]),'to':_0x35d0f5[_0x828f('0xf')],'cc':_0x35d0f5['cc'],'bcc':_0x35d0f5['bcc'],'subject':util[_0x828f('0x12')](_0x828f('0x16'),_0x265f98[_0x828f('0x13')],_0x35d0f5[_0x828f('0x17')],_0x35d0f5[_0x828f('0x18')])}};var _0x5539af=path[_0x828f('0x19')](__dirname,'../../files/reports');var _0x4aea0c=_0x265f98['savename'];var _0x1ff7dd=util[_0x828f('0x12')]('%s.%s',path[_0x828f('0x1a')](_0x265f98[_0x828f('0x1b')],path[_0x828f('0x1c')](_0x265f98['savename'])),'zip');var _0xc7d3f9=path[_0x828f('0x19')](_0x5539af,_0x4aea0c);var _0x2c91f2=path[_0x828f('0x19')](_0x5539af,_0x1ff7dd);if(fs[_0x828f('0x1d')](_0xc7d3f9)){_0x265f98[_0x828f('0x1e')]=_0x828f('0x1f');_0x565907[_0x828f('0x20')][_0x828f('0x21')]=[{'filename':_0x4aea0c,'path':_0xc7d3f9}];_0x565907[_0x828f('0x20')][_0x828f('0x22')]=util[_0x828f('0x12')](_0x828f('0x23'),JSON[_0x828f('0x24')](_0x265f98,null,0x2));}else if(fs['existsSync'](_0x2c91f2)){_0x265f98['status']=_0x828f('0x1f');_0x565907[_0x828f('0x20')][_0x828f('0x21')]=[{'filename':_0x1ff7dd,'path':_0x2c91f2}];}else{_0x565907[_0x828f('0x20')][_0x828f('0x22')]=_0x828f('0x25');if(!_0x35d0f5['sendIfEmpty']){_0x5bac00=![];logger['info'](_0x828f('0x26'));}}if(_0x5bac00){return client[_0x828f('0x27')]('SendMail',_0x565907)[_0x828f('0x28')](function(_0x2f481a){if(_0x2f481a[_0x828f('0x29')]){return logger[_0x828f('0x29')]('error\x20mail',JSON['stringify'](_0x2f481a));}return logger[_0x828f('0xd')]('email\x20sent');})[_0x828f('0x2a')](function(_0x4abcef){return logger[_0x828f('0x29')](_0x828f('0x2b'),JSON['stringify'](_0x4abcef));});}};}function handleError(){return function(_0x15f1e5){return logger['error'](JSON[_0x828f('0x24')](_0x15f1e5));};}function handleResult(_0x20ca97){return function(_0x3555e7){logger[_0x828f('0xd')](_0x828f('0x2c'),JSON[_0x828f('0x24')](_0x3555e7));if(_0x20ca97[_0x828f('0x10')]&&_0x20ca97[_0x828f('0x10')]['Smtp']&&!_['isNil'](_0x20ca97[_0x828f('0xf')])){setTimeout(handleSendEmail(_0x20ca97,_0x3555e7),0x3c*0x3e8);}};}function handleJob(_0x4914fe){return function(){try{if(_[_0x828f('0x2d')](_0x4914fe[_0x828f('0x17')])){return logger[_0x828f('0xd')](_0x828f('0x2e'));}if(_[_0x828f('0x2d')](_0x4914fe[_0x828f('0x18')])){return logger['info'](_0x828f('0x2f'));}var _0x19a8e8={'startDate':moment()[_0x828f('0x30')](_0x4914fe['subtractNumber'],_0x4914fe[_0x828f('0x18')])[_0x828f('0x12')](_0x828f('0x31')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x4914fe['output'],'name':_0x4914fe[_0x828f('0x13')]};if(!_[_0x828f('0x2d')](_0x4914fe[_0x828f('0x32')])){logger[_0x828f('0xd')]('exec\x20defaul\x20report\x20id:%s',_0x4914fe[_0x828f('0x32')]);return analyticDefaultReportController['runReport']({'id':_0x4914fe[_0x828f('0x32')]},_0x19a8e8)['then'](handleResult(_0x4914fe))[_0x828f('0x2a')](handleError());}if(!_['isNil'](_0x4914fe[_0x828f('0x33')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4914fe['CustomReportId']);return analyticCustomReportController[_0x828f('0x34')]({'id':_0x4914fe[_0x828f('0x33')]},_0x19a8e8)['then'](handleResult(_0x4914fe))[_0x828f('0x2a')](handleError());}}catch(_0x282165){logger[_0x828f('0x29')](JSON[_0x828f('0x24')](_0x282165));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x44304e){var _0x33f0c0={};if(_0x44304e){_0x33f0c0['id']=_0x44304e;}return db[_0x828f('0x35')][_0x828f('0x36')]({'where':_0x33f0c0,'include':[{'model':db[_0x828f('0x10')],'attributes':['id',_0x828f('0x13'),_0x828f('0xf')],'include':[{'model':db[_0x828f('0x37')],'as':_0x828f('0x14'),'include':[{'model':db[_0x828f('0x38')],'as':_0x828f('0x38')}]}]}]})['then'](function(_0x1381da){var _0x1a78f3=_[_0x828f('0x39')](manager[_0x828f('0x3a')]);var _0x388144=_[_0x828f('0x3b')](_0x1381da,function(_0x2f7bac){return _0x2f7bac['id'][_0x828f('0x3c')]();});var _0x4beb55=_[_0x828f('0x3d')](_0x1381da,function(_0x573249){return _0x573249['id'][_0x828f('0x3c')]();});var _0x2aed11=_0x44304e?_0x388144:_[_0x828f('0x3e')](_0x388144,_0x1a78f3);var _0x190f1c=_[_0x828f('0x3f')](_0x388144,_0x1a78f3);var _0x386680=_[_0x828f('0x3e')](_0x1a78f3,_0x388144);var _0x296bc0;var _0x345928;for(_0x296bc0=0x0;_0x296bc0<_0x386680[_0x828f('0x40')]&&!_0x44304e;_0x296bc0+=0x1){_0x345928=_0x386680[_0x296bc0][_0x828f('0x3c')]();if(manager[_0x828f('0x41')](_0x345928)){manager[_0x828f('0x42')](_0x345928);manager[_0x828f('0x43')](_0x345928);logger['info'](_0x828f('0x44'),_0x345928);}}logger['info'](_0x828f('0x45'),JSON[_0x828f('0x24')](_0x2aed11));for(_0x296bc0=0x0;_0x296bc0<_0x2aed11[_0x828f('0x40')];_0x296bc0+=0x1){_0x345928=_0x2aed11[_0x296bc0][_0x828f('0x3c')]();logger[_0x828f('0xd')](_0x828f('0x46'),_0x345928);if(_0x44304e){logger['info']('my\x20id',_0x44304e);logger['info'](JSON['stringify'](_0x4beb55[_0x345928]));BPromise[_0x828f('0x47')]()['then'](handleJob(_0x4beb55[_0x345928]));logger[_0x828f('0xd')]('run\x20job',_0x4beb55[_0x345928][_0x828f('0x13')],_0x4beb55[_0x345928][_0x828f('0x48')]);}else if(_0x4beb55[_0x345928][_0x828f('0x48')]&&_0x4beb55[_0x345928][_0x828f('0x49')]&&moment()[_0x828f('0x4a')](_0x4beb55[_0x345928][_0x828f('0x4b')],_0x4beb55[_0x345928][_0x828f('0x4c')])){manager[_0x828f('0x4d')](_0x345928,_0x4beb55[_0x345928][_0x828f('0x48')],handleJob(_0x4beb55[_0x345928]));manager[_0x828f('0x4e')](_0x345928);logger[_0x828f('0xd')](_0x828f('0x4f'),_0x4beb55[_0x345928]['name'],_0x4beb55[_0x345928][_0x828f('0x48')]);}else if(manager['exists'](_0x345928)){manager[_0x828f('0x42')](_0x345928);manager[_0x828f('0x43')](_0x345928);logger[_0x828f('0xd')]('stop\x20cron',_0x4beb55[_0x345928][_0x828f('0x13')],_0x4beb55[_0x345928][_0x828f('0x48')]);}}for(_0x296bc0=0x0,_0x345928;_0x296bc0<_0x190f1c['length']&&!_0x44304e;_0x296bc0+=0x1){_0x345928=_0x190f1c[_0x296bc0][_0x828f('0x3c')]();if(manager[_0x828f('0x41')](_0x345928)){if(_0x4beb55[_0x345928][_0x828f('0x48')]&&_0x4beb55[_0x345928][_0x828f('0x49')]&&moment()['isBetween'](_0x4beb55[_0x345928][_0x828f('0x4b')],_0x4beb55[_0x345928][_0x828f('0x4c')])){manager[_0x828f('0x50')](_0x345928,_0x4beb55[_0x345928][_0x828f('0x48')],handleJob(_0x4beb55[_0x345928]));logger[_0x828f('0xd')](_0x828f('0x51'),_0x4beb55[_0x345928][_0x828f('0x13')],_0x4beb55[_0x345928][_0x828f('0x48')]);}else{manager['stop'](_0x345928);manager['deleteJob'](_0x345928);logger['info'](_0x828f('0x52'),_0x4beb55[_0x345928]['name'],_0x4beb55[_0x345928][_0x828f('0x48')]);}}}})[_0x828f('0x2a')](function(_0x37ae5b){logger[_0x828f('0x29')](JSON['stringify'](_0x37ae5b));});}exports[_0x828f('0x53')]=function(_0x2a8aab){return getJobs(_0x2a8aab);};exports[_0x828f('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xe6a3=['difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','stop\x20cron','endAt','update','start','util','lodash','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','basename','extname','existsSync','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','map','toString'];(function(_0xb9ddce,_0x524945){var _0x246755=function(_0xb0234d){while(--_0xb0234d){_0xb9ddce['push'](_0xb9ddce['shift']());}};_0x246755(++_0x524945);}(_0xe6a3,0x104));var _0x3e6a=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xe6a3[_0x318410];return _0x2898a3;};'use strict';var fs=require('fs');var util=require(_0x3e6a('0x0'));var path=require('path');var _=require(_0x3e6a('0x1'));var moment=require('moment');var CronJobManager=require(_0x3e6a('0x2'));var jayson=require(_0x3e6a('0x3'));var BPromise=require('bluebird');var logger=require(_0x3e6a('0x4'))('schedule');var db=require(_0x3e6a('0x5'))['db'];var analyticCustomReportController=require(_0x3e6a('0x6'));var analyticDefaultReportController=require(_0x3e6a('0x7'));var client=jayson[_0x3e6a('0x8')][_0x3e6a('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a858e,_0x26e29c){return function(){logger[_0x3e6a('0xa')](_0x3e6a('0xb'),_0x2a858e[_0x3e6a('0xc')]);var _0x56c58e=!![];var _0xa8b8d3=_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0xe')]();var _0xa26930={'account':_0xa8b8d3,'message':{'from':util['format'](_0x3e6a('0xf'),_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0x10')],_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0xc')]||_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0x11')][_0x3e6a('0x12')]),'to':_0x2a858e[_0x3e6a('0xc')],'cc':_0x2a858e['cc'],'bcc':_0x2a858e['bcc'],'subject':util[_0x3e6a('0x13')](_0x3e6a('0x14'),_0x26e29c[_0x3e6a('0x10')],_0x2a858e[_0x3e6a('0x15')],_0x2a858e['subtractUnit'])}};var _0x52eb64=path[_0x3e6a('0x16')](__dirname,'../../files/reports');var _0x34d319=_0x26e29c[_0x3e6a('0x17')];var _0x3d0886=util[_0x3e6a('0x13')](_0x3e6a('0x18'),path[_0x3e6a('0x19')](_0x26e29c[_0x3e6a('0x17')],path[_0x3e6a('0x1a')](_0x26e29c['savename'])),'zip');var _0x4b1d83=path[_0x3e6a('0x16')](_0x52eb64,_0x34d319);var _0x1cb176=path['join'](_0x52eb64,_0x3d0886);if(fs[_0x3e6a('0x1b')](_0x4b1d83)){_0x26e29c['status']='Sent';_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1d')]=[{'filename':_0x34d319,'path':_0x4b1d83}];_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1e')]=util[_0x3e6a('0x13')](_0x3e6a('0x1f'),JSON[_0x3e6a('0x20')](_0x26e29c,null,0x2));}else if(fs[_0x3e6a('0x1b')](_0x1cb176)){_0x26e29c[_0x3e6a('0x21')]=_0x3e6a('0x22');_0xa26930['message']['attachments']=[{'filename':_0x3d0886,'path':_0x1cb176}];}else{_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2a858e[_0x3e6a('0x23')]){_0x56c58e=![];logger[_0x3e6a('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x56c58e){return client['request'](_0x3e6a('0x24'),_0xa26930)[_0x3e6a('0x25')](function(_0x36d046){if(_0x36d046[_0x3e6a('0x26')]){return logger[_0x3e6a('0x26')](_0x3e6a('0x27'),JSON[_0x3e6a('0x20')](_0x36d046));}return logger[_0x3e6a('0xa')](_0x3e6a('0x28'));})[_0x3e6a('0x29')](function(_0x57aca7){return logger[_0x3e6a('0x26')]('error\x20mail',JSON[_0x3e6a('0x20')](_0x57aca7));});}};}function handleError(){return function(_0x479ad0){return logger[_0x3e6a('0x26')](JSON[_0x3e6a('0x20')](_0x479ad0));};}function handleResult(_0x1982c3){return function(_0x574e07){logger[_0x3e6a('0xa')]('data',JSON[_0x3e6a('0x20')](_0x574e07));if(_0x1982c3[_0x3e6a('0xd')]&&_0x1982c3[_0x3e6a('0xd')][_0x3e6a('0x11')]&&!_['isNil'](_0x1982c3[_0x3e6a('0xc')])){setTimeout(handleSendEmail(_0x1982c3,_0x574e07),0x3c*0x3e8);}};}function handleJob(_0x43cf97){return function(){try{if(_[_0x3e6a('0x2a')](_0x43cf97['subtractNumber'])){return logger['info'](_0x3e6a('0x2b'));}if(_[_0x3e6a('0x2a')](_0x43cf97[_0x3e6a('0x2c')])){return logger[_0x3e6a('0xa')](_0x3e6a('0x2d'));}var _0x450901={'startDate':moment()[_0x3e6a('0x2e')](_0x43cf97['subtractNumber'],_0x43cf97[_0x3e6a('0x2c')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x3e6a('0x13')](_0x3e6a('0x2f')),'type':_0x3e6a('0x30'),'output':_0x43cf97[_0x3e6a('0x31')],'name':_0x43cf97[_0x3e6a('0x10')]};if(!_['isNil'](_0x43cf97[_0x3e6a('0x32')])){logger[_0x3e6a('0xa')](_0x3e6a('0x33'),_0x43cf97[_0x3e6a('0x32')]);return analyticDefaultReportController[_0x3e6a('0x34')]({'id':_0x43cf97[_0x3e6a('0x32')]},_0x450901)[_0x3e6a('0x25')](handleResult(_0x43cf97))[_0x3e6a('0x29')](handleError());}if(!_[_0x3e6a('0x2a')](_0x43cf97[_0x3e6a('0x35')])){logger[_0x3e6a('0xa')]('exec\x20custom\x20report\x20id:%s',_0x43cf97[_0x3e6a('0x35')]);return analyticCustomReportController[_0x3e6a('0x34')]({'id':_0x43cf97[_0x3e6a('0x35')]},_0x450901)[_0x3e6a('0x25')](handleResult(_0x43cf97))[_0x3e6a('0x29')](handleError());}}catch(_0xf0422){logger[_0x3e6a('0x26')](JSON[_0x3e6a('0x20')](_0xf0422));}return logger[_0x3e6a('0xa')](_0x3e6a('0x36'));};}function getJobs(_0x125f6b){var _0x46b4a6={};if(_0x125f6b){_0x46b4a6['id']=_0x125f6b;}return db['Schedule'][_0x3e6a('0x37')]({'where':_0x46b4a6,'include':[{'model':db[_0x3e6a('0xd')],'attributes':['id',_0x3e6a('0x10'),'email'],'include':[{'model':db[_0x3e6a('0x38')],'as':_0x3e6a('0x11'),'include':[{'model':db[_0x3e6a('0x39')],'as':_0x3e6a('0x39')}]}]}]})[_0x3e6a('0x25')](function(_0x2dc988){var _0x1a00a1=_['keys'](manager['jobs']);var _0x43cb2d=_[_0x3e6a('0x3a')](_0x2dc988,function(_0x5a0baf){return _0x5a0baf['id'][_0x3e6a('0x3b')]();});var _0x34adde=_['keyBy'](_0x2dc988,function(_0x2bf6d4){return _0x2bf6d4['id'][_0x3e6a('0x3b')]();});var _0x109580=_0x125f6b?_0x43cb2d:_['difference'](_0x43cb2d,_0x1a00a1);var _0x7e357c=_['intersection'](_0x43cb2d,_0x1a00a1);var _0x4448d=_[_0x3e6a('0x3c')](_0x1a00a1,_0x43cb2d);var _0x2ee38c;var _0x114344;for(_0x2ee38c=0x0;_0x2ee38c<_0x4448d['length']&&!_0x125f6b;_0x2ee38c+=0x1){_0x114344=_0x4448d[_0x2ee38c][_0x3e6a('0x3b')]();if(manager[_0x3e6a('0x3d')](_0x114344)){manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x40'),_0x114344);}}logger[_0x3e6a('0xa')](_0x3e6a('0x41'),JSON[_0x3e6a('0x20')](_0x109580));for(_0x2ee38c=0x0;_0x2ee38c<_0x109580[_0x3e6a('0x42')];_0x2ee38c+=0x1){_0x114344=_0x109580[_0x2ee38c]['toString']();logger[_0x3e6a('0xa')](_0x3e6a('0x43'),_0x114344);if(_0x125f6b){logger[_0x3e6a('0xa')](_0x3e6a('0x44'),_0x125f6b);logger['info'](JSON[_0x3e6a('0x20')](_0x34adde[_0x114344]));BPromise['resolve']()['then'](handleJob(_0x34adde[_0x114344]));logger[_0x3e6a('0xa')](_0x3e6a('0x45'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344]['cron']);}else if(_0x34adde[_0x114344][_0x3e6a('0x46')]&&_0x34adde[_0x114344][_0x3e6a('0x47')]&&moment()[_0x3e6a('0x48')](_0x34adde[_0x114344][_0x3e6a('0x49')],_0x34adde[_0x114344]['endAt'])){manager[_0x3e6a('0x4a')](_0x114344,_0x34adde[_0x114344]['cron'],handleJob(_0x34adde[_0x114344]));manager['start'](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4b'),_0x34adde[_0x114344]['name'],_0x34adde[_0x114344][_0x3e6a('0x46')]);}else if(manager[_0x3e6a('0x3d')](_0x114344)){manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4c'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344][_0x3e6a('0x46')]);}}for(_0x2ee38c=0x0,_0x114344;_0x2ee38c<_0x7e357c[_0x3e6a('0x42')]&&!_0x125f6b;_0x2ee38c+=0x1){_0x114344=_0x7e357c[_0x2ee38c][_0x3e6a('0x3b')]();if(manager['exists'](_0x114344)){if(_0x34adde[_0x114344]['cron']&&_0x34adde[_0x114344]['active']&&moment()[_0x3e6a('0x48')](_0x34adde[_0x114344][_0x3e6a('0x49')],_0x34adde[_0x114344][_0x3e6a('0x4d')])){manager[_0x3e6a('0x4e')](_0x114344,_0x34adde[_0x114344][_0x3e6a('0x46')],handleJob(_0x34adde[_0x114344]));logger['info']('update\x20cron',_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344][_0x3e6a('0x46')]);}else{manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4c'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344]['cron']);}}}})[_0x3e6a('0x29')](function(_0x2d07ad){logger[_0x3e6a('0x26')](JSON['stringify'](_0x2d07ad));});}exports['run']=function(_0x472a3e){return getJobs(_0x472a3e);};exports[_0x3e6a('0x4f')]=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 a9005f1..e57e29d 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 _0x0936=['all','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','Transcript\x20not\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push'];(function(_0x2cbc82,_0x30d15a){var _0x222f31=function(_0x51bc14){while(--_0x51bc14){_0x2cbc82['push'](_0x2cbc82['shift']());}};_0x222f31(++_0x30d15a);}(_0x0936,0xde));var _0x6093=function(_0x23abe3,_0x58168a){_0x23abe3=_0x23abe3-0x0;var _0x2ff75b=_0x0936[_0x23abe3];return _0x2ff75b;};var _=require(_0x6093('0x0'));var AWS=require(_0x6093('0x1'));var rp=require(_0x6093('0x2'));var util=require(_0x6093('0x3'));var BPromise=require(_0x6093('0x4'));var db=require(_0x6093('0x5'))['db'];var logger=require(_0x6093('0x6'))('transcribe');function getTranscriptionJob(_0x5027dc,_0x261bcd,_0x4a8e4b,_0x1b13a1){return new Promise(function(_0x30c8e4,_0x3bd339){var _0x7d812e=new AWS[(_0x6093('0x7'))]({'accessKeyId':_0x261bcd,'secretAccessKey':_0x5027dc,'region':_0x4a8e4b});_0x7d812e['getTranscriptionJob']({'TranscriptionJobName':_0x1b13a1},function(_0x5280b8,_0x219592){if(_0x5280b8){return _0x3bd339(_0x5280b8);}else{return _0x30c8e4(_0x219592);}});});}function sentiment(_0xb8d7e8,_0x1dc280,_0x178aba,_0x1a99dc,_0x26d068){return new Promise(function(_0x454a64,_0x2cff70){var _0x5c1841=new AWS['Comprehend']({'accessKeyId':_0x1dc280,'secretAccessKey':_0xb8d7e8,'region':_0x178aba});_0x5c1841[_0x6093('0x8')]({'Text':_0x1a99dc,'LanguageCode':_0x26d068[_0x6093('0x9')](0x0,0x2)},function(_0x23a04c,_0x1f8c4a){if(_0x23a04c){return _0x2cff70(_0x23a04c);}else{return _0x454a64(_0x1f8c4a);}});});}function checkTranscribeJob(_0x259a49,_0x3fb34b,_0x38ac49){var _0x3c70f7;return new BPromise(function(_0x323259,_0x1d7c16){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0xc'),_0x259a49['id'],_0x259a49[_0x6093('0xd')]));return getTranscriptionJob(_0x38ac49[_0x6093('0xe')],_0x38ac49[_0x6093('0xf')],_0x3fb34b[_0x6093('0x10')],_0x259a49[_0x6093('0xd')])[_0x6093('0x11')](function(_0x214118){logger[_0x6093('0xa')](util[_0x6093('0xb')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x259a49['id'],_0x259a49['transcribeName'],_0x214118[_0x6093('0x12')][_0x6093('0x13')]));if(!_0x259a49[_0x6093('0x14')]){switch(_0x214118[_0x6093('0x12')][_0x6093('0x13')]){case _0x6093('0x15'):var _0x5dcc27={'transcribeStatus':_0x214118[_0x6093('0x12')][_0x6093('0x13')],'fileUri':_0x214118[_0x6093('0x12')][_0x6093('0x16')]['TranscriptFileUri']};logger[_0x6093('0xa')](util[_0x6093('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x259a49['id']));return rp({'uri':_0x214118[_0x6093('0x12')][_0x6093('0x16')][_0x6093('0x17')],'json':!![]})[_0x6093('0x11')](function(_0xe35dfc){logger['info'](util[_0x6093('0xb')](_0x6093('0x18'),_0x259a49['id']));if(_0xe35dfc&&_0xe35dfc['results']&&_0xe35dfc[_0x6093('0x19')][_0x6093('0x1a')]&&_0xe35dfc['results'][_0x6093('0x1a')]['length']){_0x5dcc27['fileText']='';for(var _0x2448d1=0x0;_0x2448d1<_0xe35dfc[_0x6093('0x19')]['transcripts'][_0x6093('0x1b')];_0x2448d1++){_0x5dcc27['fileText']+=_0xe35dfc[_0x6093('0x19')][_0x6093('0x1a')][_0x2448d1][_0x6093('0x1c')]+'';}}return _0x259a49[_0x6093('0x1d')](_0x5dcc27);})[_0x6093('0x11')](function(){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x1e'),_0x259a49['id']));if(!_0x259a49[_0x6093('0x1f')]){throw new db['Sequelize'][(_0x6093('0x20'))](_0x6093('0x21'));}if(!_0x3fb34b[_0x6093('0x22')]||!_0x3fb34b[_0x6093('0x23')]||!_0x3fb34b[_0x6093('0x24')]||!_0x3fb34b[_0x6093('0x25')]||!_0x3fb34b[_0x6093('0x26')]){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x28'));}if(!_0x5dcc27[_0x6093('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x3fb34b[_0x6093('0x23')]===_0x38ac49['id']){return _0x38ac49;}else{return db[_0x6093('0x29')][_0x6093('0x2a')]({'where':{'id':_settings[_0x6093('0x23')]}});}})[_0x6093('0x11')](function(_0x55f5f2){if(!_0x55f5f2){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x2b'));}if(!_0x55f5f2['data1']||!_0x55f5f2[_0x6093('0xf')]){throw new db['Sequelize']['ValidationError'](_0x6093('0x2c'));}_0x3c70f7=_0x55f5f2;logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x2d'),_0x259a49['id']));return sentiment(_0x3c70f7[_0x6093('0xe')],_0x3c70f7['data2'],_0x3fb34b['sentimentRegion'],_0x5dcc27[_0x6093('0x14')],_0x3fb34b[_0x6093('0x25')]);})[_0x6093('0x11')](function(_0xc9ba11){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x2e'),_0x259a49['id']));return _0x259a49['update']({'sentiment':_0xc9ba11[_0x6093('0x2f')],'sPositive':_0xc9ba11[_0x6093('0x30')][_0x6093('0x31')],'sNegative':_0xc9ba11[_0x6093('0x30')][_0x6093('0x32')],'sMixed':_0xc9ba11['SentimentScore'][_0x6093('0x33')],'sNeutral':_0xc9ba11[_0x6093('0x30')][_0x6093('0x34')]});})['then'](function(){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x1e'),_0x259a49['id']));_0x323259();});case _0x6093('0x35'):return _0x259a49[_0x6093('0x1d')]({'transcribeStatus':_0x6093('0x35'),'failureReason':_0x214118[_0x6093('0x12')][_0x6093('0x36')]})['then'](function(){logger[_0x6093('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x259a49['id']));_0x323259();});default:logger[_0x6093('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x259a49['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x259a49[_0x6093('0x1f')]){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x21'));}if(!_0x3fb34b['sentiment']||!_0x3fb34b[_0x6093('0x23')]||!_0x3fb34b[_0x6093('0x24')]||!_0x3fb34b['language']||!_0x3fb34b['bucket']){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x259a49[_0x6093('0x14')]){throw new Error(_0x6093('0x37'));}if(_0x3fb34b['sentimentAccountId']===_0x38ac49['id']){return _0x38ac49;}else{return db[_0x6093('0x29')][_0x6093('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x6093('0x11')](function(_0x4b5bf3){if(!_0x4b5bf3){throw new db['Sequelize'][(_0x6093('0x20'))](_0x6093('0x2b'));}if(!_0x4b5bf3[_0x6093('0xe')]||!_0x4b5bf3['data2']){throw new db['Sequelize'][(_0x6093('0x20'))](_0x6093('0x2c'));}_0x3c70f7=_0x4b5bf3;logger[_0x6093('0xa')](util['format'](_0x6093('0x2d'),_0x259a49['id']));return sentiment(_0x3c70f7[_0x6093('0xe')],_0x3c70f7['data2'],_0x3fb34b[_0x6093('0x24')],_0x259a49[_0x6093('0x14')],_0x3fb34b[_0x6093('0x25')]);})['then'](function(_0x1263c5){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x2e'),_0x259a49['id']));return _0x259a49[_0x6093('0x1d')]({'sentiment':_0x1263c5['Sentiment'],'sPositive':_0x1263c5[_0x6093('0x30')][_0x6093('0x31')],'sNegative':_0x1263c5[_0x6093('0x30')]['Negative'],'sMixed':_0x1263c5[_0x6093('0x30')][_0x6093('0x33')],'sNeutral':_0x1263c5[_0x6093('0x30')][_0x6093('0x34')],'transcribeStatus':_0x6093('0x15')});})['then'](function(){logger[_0x6093('0xa')](util[_0x6093('0xb')](_0x6093('0x1e'),_0x259a49['id']));_0x323259();});}})[_0x6093('0x38')](function(_0x2e0548){if(_0x2e0548){if(!_0x2e0548[_0x6093('0x39')]||_0x2e0548[_0x6093('0x39')]!==_0x6093('0x3a')){logger[_0x6093('0x3b')](util[_0x6093('0xb')](_0x6093('0x3c'),_0x259a49['id']),util['inspect'](_0x2e0548,{'showHidden':![],'depth':null}));}}_0x323259();});});}function checkTranscribe(){var _0x102924;var _0x52e6a4;var _0x5c50e7;return db[_0x6093('0x3d')][_0x6093('0x3e')]({'where':{'transcribeStatus':_0x6093('0x3f')}})[_0x6093('0x11')](function(_0x1c9455){if(!_0x1c9455||!_0x1c9455[_0x6093('0x1b')]){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x40'));}_0x102924=_0x1c9455;return db[_0x6093('0x41')][_0x6093('0x2a')]({'where':{'id':0x1}});})['then'](function(_0x3e43a5){if(!_0x3e43a5){throw new db[(_0x6093('0x27'))]['ValidationError'](_0x6093('0x42'));}_0x52e6a4=_0x3e43a5;if(!_0x52e6a4['transcribe']||!_0x52e6a4['transcribeAccountId']||!_0x52e6a4[_0x6093('0x10')]||!_0x52e6a4[_0x6093('0x25')]||!_0x52e6a4[_0x6093('0x26')]){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))]('Transcribe\x20not\x20configured');}return db[_0x6093('0x29')][_0x6093('0x2a')]({'where':{'id':_0x52e6a4[_0x6093('0x43')]}});})['then'](function(_0x1dfb4f){if(!_0x1dfb4f){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x2b'));}if(!_0x1dfb4f[_0x6093('0xe')]||!_0x1dfb4f[_0x6093('0xf')]){throw new db[(_0x6093('0x27'))][(_0x6093('0x20'))](_0x6093('0x2c'));}_0x5c50e7=_0x1dfb4f;var _0x1327fc=[];_0x102924[_0x6093('0x44')](function(_0x2fa524){_0x1327fc[_0x6093('0x45')](checkTranscribeJob(_0x2fa524,_0x52e6a4,_0x5c50e7));});return BPromise[_0x6093('0x46')](_0x1327fc);})[_0x6093('0x38')](function(_0x1b65e5){if(_0x1b65e5){if(!_0x1b65e5[_0x6093('0x39')]||_0x1b65e5[_0x6093('0x39')]!==_0x6093('0x3a')){logger[_0x6093('0x3b')](util[_0x6093('0x47')](_0x1b65e5,{'showHidden':![],'depth':null}));}}});}exports[_0x6093('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa71a=['Negative','Neutral','FAILED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','sentiment','language','sentimentAccountId','findOne','Mixed','name','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','all','SequelizeValidationError','error','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore'];(function(_0x31cdff,_0x545438){var _0x14091f=function(_0x363721){while(--_0x363721){_0x31cdff['push'](_0x31cdff['shift']());}};_0x14091f(++_0x545438);}(_0xa71a,0xf1));var _0xaa71=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa71a[_0x321bb2];return _0x9c12ed;};var _=require(_0xaa71('0x0'));var AWS=require(_0xaa71('0x1'));var rp=require(_0xaa71('0x2'));var util=require(_0xaa71('0x3'));var BPromise=require('bluebird');var db=require(_0xaa71('0x4'))['db'];var logger=require(_0xaa71('0x5'))(_0xaa71('0x6'));function getTranscriptionJob(_0x5efe0e,_0x32d34b,_0x480d9b,_0xd325fb){return new Promise(function(_0x2f476b,_0x1f07bd){var _0x5893aa=new AWS[(_0xaa71('0x7'))]({'accessKeyId':_0x32d34b,'secretAccessKey':_0x5efe0e,'region':_0x480d9b});_0x5893aa[_0xaa71('0x8')]({'TranscriptionJobName':_0xd325fb},function(_0x5a0dca,_0x50ad8f){if(_0x5a0dca){return _0x1f07bd(_0x5a0dca);}else{return _0x2f476b(_0x50ad8f);}});});}function sentiment(_0x2fc645,_0x2ec823,_0xc26148,_0x59f523,_0x59e7b9){return new Promise(function(_0xb81c88,_0x28023d){var _0x1636f5=new AWS[(_0xaa71('0x9'))]({'accessKeyId':_0x2ec823,'secretAccessKey':_0x2fc645,'region':_0xc26148});_0x1636f5[_0xaa71('0xa')]({'Text':_0x59f523,'LanguageCode':_0x59e7b9[_0xaa71('0xb')](0x0,0x2)},function(_0x4ad162,_0x5ce035){if(_0x4ad162){return _0x28023d(_0x4ad162);}else{return _0xb81c88(_0x5ce035);}});});}function checkTranscribeJob(_0x4f9755,_0x464b95,_0x128712){var _0x3b7a53;return new BPromise(function(_0x5603e0,_0x331a56){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0xe'),_0x4f9755['id'],_0x4f9755[_0xaa71('0xf')]));return getTranscriptionJob(_0x128712[_0xaa71('0x10')],_0x128712['data2'],_0x464b95[_0xaa71('0x11')],_0x4f9755[_0xaa71('0xf')])[_0xaa71('0x12')](function(_0x5b4f5a){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x13'),_0x4f9755['id'],_0x4f9755[_0xaa71('0xf')],_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')]));if(!_0x4f9755[_0xaa71('0x16')]){switch(_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')]){case _0xaa71('0x17'):var _0x58155d={'transcribeStatus':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')],'fileUri':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x18')][_0xaa71('0x19')]};logger['info'](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0x4f9755['id']));return rp({'uri':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x18')][_0xaa71('0x19')],'json':!![]})[_0xaa71('0x12')](function(_0x2e3f95){logger['info'](util['format'](_0xaa71('0x1a'),_0x4f9755['id']));if(_0x2e3f95&&_0x2e3f95['results']&&_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')]&&_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0xaa71('0x1d')]){_0x58155d[_0xaa71('0x16')]='';for(var _0x1bde4f=0x0;_0x1bde4f<_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0xaa71('0x1d')];_0x1bde4f++){_0x58155d[_0xaa71('0x16')]+=_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0x1bde4f]['transcript']+'';}}return _0x4f9755['update'](_0x58155d);})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f9755['id']));if(!_0x4f9755['tempSentiment']){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x1f'));}if(!_0x464b95['sentiment']||!_0x464b95['sentimentAccountId']||!_0x464b95[_0xaa71('0x20')]||!_0x464b95['language']||!_0x464b95[_0xaa71('0x21')]){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x22'));}if(!_0x58155d[_0xaa71('0x16')]){throw new Error(_0xaa71('0x23'));}if(_0x464b95['sentimentAccountId']===_0x128712['id']){return _0x128712;}else{return db[_0xaa71('0x24')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xaa71('0x12')](function(_0x4d8050){if(!_0x4d8050){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x25'));}if(!_0x4d8050[_0xaa71('0x10')]||!_0x4d8050[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x3b7a53=_0x4d8050;logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x29'),_0x4f9755['id']));return sentiment(_0x3b7a53['data1'],_0x3b7a53['data2'],_0x464b95[_0xaa71('0x20')],_0x58155d[_0xaa71('0x16')],_0x464b95['language']);})[_0xaa71('0x12')](function(_0x448702){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x2a'),_0x4f9755['id']));return _0x4f9755[_0xaa71('0x2b')]({'sentiment':_0x448702[_0xaa71('0x2c')],'sPositive':_0x448702['SentimentScore'][_0xaa71('0x2d')],'sNegative':_0x448702[_0xaa71('0x2e')][_0xaa71('0x2f')],'sMixed':_0x448702[_0xaa71('0x2e')]['Mixed'],'sNeutral':_0x448702[_0xaa71('0x2e')][_0xaa71('0x30')]});})[_0xaa71('0x12')](function(){logger['info'](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f9755['id']));_0x5603e0();});case'FAILED':return _0x4f9755[_0xaa71('0x2b')]({'transcribeStatus':_0xaa71('0x31'),'failureReason':_0x5b4f5a[_0xaa71('0x14')]['FailureReason']})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x32'),_0x4f9755['id']));_0x5603e0();});default:logger[_0xaa71('0xc')](util['format'](_0xaa71('0x33'),_0x4f9755['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x4f9755[_0xaa71('0x34')]){throw new db['Sequelize'][(_0xaa71('0x27'))](_0xaa71('0x1f'));}if(!_0x464b95[_0xaa71('0x35')]||!_0x464b95['sentimentAccountId']||!_0x464b95[_0xaa71('0x20')]||!_0x464b95[_0xaa71('0x36')]||!_0x464b95['bucket']){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x22'));}if(!_0x4f9755[_0xaa71('0x16')]){throw new Error(_0xaa71('0x23'));}if(_0x464b95[_0xaa71('0x37')]===_0x128712['id']){return _0x128712;}else{return db[_0xaa71('0x24')][_0xaa71('0x38')]({'where':{'id':_settings[_0xaa71('0x37')]}});}})[_0xaa71('0x12')](function(_0x3861bf){if(!_0x3861bf){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x25'));}if(!_0x3861bf[_0xaa71('0x10')]||!_0x3861bf[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x3b7a53=_0x3861bf;logger[_0xaa71('0xc')](util['format'](_0xaa71('0x29'),_0x4f9755['id']));return sentiment(_0x3b7a53[_0xaa71('0x10')],_0x3b7a53[_0xaa71('0x26')],_0x464b95[_0xaa71('0x20')],_0x4f9755[_0xaa71('0x16')],_0x464b95[_0xaa71('0x36')]);})[_0xaa71('0x12')](function(_0xd1ebc0){logger[_0xaa71('0xc')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4f9755['id']));return _0x4f9755[_0xaa71('0x2b')]({'sentiment':_0xd1ebc0[_0xaa71('0x2c')],'sPositive':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x2d')],'sNegative':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x2f')],'sMixed':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x39')],'sNeutral':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x30')],'transcribeStatus':_0xaa71('0x17')});})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x32'),_0x4f9755['id']));_0x5603e0();});}})['catch'](function(_0x10a362){if(_0x10a362){if(!_0x10a362[_0xaa71('0x3a')]||_0x10a362[_0xaa71('0x3a')]!=='SequelizeValidationError'){logger['error'](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4f9755['id']),util[_0xaa71('0x3b')](_0x10a362,{'showHidden':![],'depth':null}));}}_0x5603e0();});});}function checkTranscribe(){var _0x52fa61;var _0x1c9899;var _0x2b670d;return db[_0xaa71('0x3c')][_0xaa71('0x3d')]({'where':{'transcribeStatus':_0xaa71('0x3e')}})[_0xaa71('0x12')](function(_0x4e9be7){if(!_0x4e9be7||!_0x4e9be7[_0xaa71('0x1d')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x3f'));}_0x52fa61=_0x4e9be7;return db[_0xaa71('0x40')][_0xaa71('0x38')]({'where':{'id':0x1}});})[_0xaa71('0x12')](function(_0x303417){if(!_0x303417){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x41'));}_0x1c9899=_0x303417;if(!_0x1c9899[_0xaa71('0x6')]||!_0x1c9899[_0xaa71('0x42')]||!_0x1c9899['transcribeRegion']||!_0x1c9899[_0xaa71('0x36')]||!_0x1c9899[_0xaa71('0x21')]){throw new db[(_0xaa71('0x1e'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xaa71('0x24')][_0xaa71('0x38')]({'where':{'id':_0x1c9899[_0xaa71('0x42')]}});})[_0xaa71('0x12')](function(_0x5762b5){if(!_0x5762b5){throw new db['Sequelize']['ValidationError'](_0xaa71('0x25'));}if(!_0x5762b5[_0xaa71('0x10')]||!_0x5762b5[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x2b670d=_0x5762b5;var _0x5a5c37=[];_0x52fa61[_0xaa71('0x43')](function(_0x1634b8){_0x5a5c37['push'](checkTranscribeJob(_0x1634b8,_0x1c9899,_0x2b670d));});return BPromise[_0xaa71('0x44')](_0x5a5c37);})['catch'](function(_0x331fd9){if(_0x331fd9){if(!_0x331fd9[_0xaa71('0x3a')]||_0x331fd9[_0xaa71('0x3a')]!==_0xaa71('0x45')){logger[_0xaa71('0x46')](util[_0xaa71('0x3b')](_0x331fd9,{'showHidden':![],'depth':null}));}}});}exports[_0xaa71('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 2bd86ab..d1c5741 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 _0xfe52=['error','inspect','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','socket.io-emitter','findAll','lastMsgAt','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','length','whatsappInteraction:update','catch'];(function(_0x1bdae8,_0x1c0cc1){var _0x1a91e5=function(_0x3f8cb8){while(--_0x3f8cb8){_0x1bdae8['push'](_0x1bdae8['shift']());}};_0x1a91e5(++_0x1c0cc1);}(_0xfe52,0x93));var _0x2fe5=function(_0x84847d,_0x2d9e2b){_0x84847d=_0x84847d-0x0;var _0x1abffa=_0xfe52[_0x84847d];return _0x1abffa;};'use strict';var _=require(_0x2fe5('0x0'));var moment=require(_0x2fe5('0x1'));var Redis=require('ioredis');var util=require(_0x2fe5('0x2'));var config=require(_0x2fe5('0x3'));var db=require(_0x2fe5('0x4'))['db'];var logger=require(_0x2fe5('0x5'))(_0x2fe5('0x6'));config[_0x2fe5('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2fe5('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x64ad20=[];return db['WhatsappInteraction'][_0x2fe5('0x9')]({'raw':!![],'attributes':['id',_0x2fe5('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x2fe5('0xb'))}}})[_0x2fe5('0xc')](function(_0x2acf6e){if(_0x2acf6e&&_0x2acf6e['length']){_0x64ad20=_[_0x2fe5('0xd')](_0x2acf6e||[],'id');logger[_0x2fe5('0xe')](_0x2fe5('0xf'),_0x64ad20[_0x2fe5('0x10')]());return db[_0x2fe5('0x11')][_0x2fe5('0x12')]({'closeReason':_0x2fe5('0x13'),'disposition':_0x2fe5('0x14'),'closed':!![],'closedAt':moment()[_0x2fe5('0x15')](_0x2fe5('0x16'))},{'where':{'id':_0x64ad20}});}})['then'](function(){if(_0x64ad20&&_0x64ad20['length']){logger[_0x2fe5('0xe')](_0x2fe5('0x17'),_0x64ad20[_0x2fe5('0x10')]());for(var _0x587183=0x0;_0x587183<_0x64ad20[_0x2fe5('0x18')];_0x587183++){io['emit'](_0x2fe5('0x19'),{'id':_0x64ad20[_0x587183],'closed':!![]});}}})[_0x2fe5('0x1a')](function(_0x1f68d7){logger[_0x2fe5('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1f68d7?util[_0x2fe5('0x1c')](_0x1f68d7,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa9ac=['hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract'];(function(_0x571411,_0x2fcc8b){var _0x34c2a9=function(_0x52e41b){while(--_0x52e41b){_0x571411['push'](_0x571411['shift']());}};_0x34c2a9(++_0x2fcc8b);}(_0xa9ac,0xb4));var _0xca9a=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0xa9ac[_0xff659d];return _0x19c170;};'use strict';var _=require(_0xca9a('0x0'));var moment=require(_0xca9a('0x1'));var Redis=require('ioredis');var util=require(_0xca9a('0x2'));var config=require(_0xca9a('0x3'));var db=require(_0xca9a('0x4'))['db'];var logger=require('../logger')('schedule');config[_0xca9a('0x5')]=_[_0xca9a('0x6')](config['redis'],{'host':_0xca9a('0x7'),'port':0x18eb});var io=require(_0xca9a('0x8'))(new Redis(config[_0xca9a('0x5')]));function closeInteractions(){var _0x4719cc=[];return db[_0xca9a('0x9')][_0xca9a('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xca9a('0xb')](0x18,_0xca9a('0xc'))}}})['then'](function(_0xb324f5){if(_0xb324f5&&_0xb324f5[_0xca9a('0xd')]){_0x4719cc=_[_0xca9a('0xe')](_0xb324f5||[],'id');logger['info'](_0xca9a('0xf'),_0x4719cc[_0xca9a('0x10')]());return db[_0xca9a('0x9')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4719cc}});}})['then'](function(){if(_0x4719cc&&_0x4719cc[_0xca9a('0xd')]){logger[_0xca9a('0x11')](_0xca9a('0x12'),_0x4719cc['join']());for(var _0x4beae1=0x0;_0x4beae1<_0x4719cc['length'];_0x4beae1++){io[_0xca9a('0x13')]('whatsappInteraction:update',{'id':_0x4719cc[_0x4beae1],'closed':!![]});}}})[_0xca9a('0x14')](function(_0x5cf980){logger[_0xca9a('0x15')](_0xca9a('0x16'),_0x5cf980?util['inspect'](_0x5cf980,{'showHidden':![],'depth':null}):'');});}exports[_0xca9a('0x17')]=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 6ecba18..bc4381f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4651=['Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','CmHopper','destroy','hopper1','contacts2','../mysqldb','push','Innocenzo'];(function(_0x2b71da,_0x1a6441){var _0x314281=function(_0x492f51){while(--_0x492f51){_0x2b71da['push'](_0x2b71da['shift']());}};_0x314281(++_0x1a6441);}(_0x4651,0x10d));var _0x1465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4651[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var db=require(_0x1465('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1465('0x1')]({'id':i,'firstName':_0x1465('0x2')+i,'lastName':_0x1465('0x3')+i,'phone':0xf879fb460+i,'email':_0x1465('0x4')+i+_0x1465('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1465('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x1465('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1465('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x1465('0x2')+i,'lastName':_0x1465('0x3')+i,'phone':0xf879fb460+i,'email':_0x1465('0x4')+i+_0x1465('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1465('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x1465('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1465('0x6')](),'updatedAt':Date[_0x1465('0x6')]()});}db[_0x1465('0x7')]['destroy']({'where':{}})[_0x1465('0x8')](function(){return db[_0x1465('0x7')][_0x1465('0x9')](contacts);})[_0x1465('0x8')](function(){console[_0x1465('0xa')](_0x1465('0xb'),'contacts1');return db[_0x1465('0xc')][_0x1465('0xd')]({'where':{}});})['then'](function(){return db[_0x1465('0xc')][_0x1465('0x9')](hopper);})[_0x1465('0x8')](function(){console[_0x1465('0xa')]('finished\x20populating',_0x1465('0xe'));return db['CmContact'][_0x1465('0x9')](contacts2);})[_0x1465('0x8')](function(){console[_0x1465('0xa')](_0x1465('0xb'),_0x1465('0xf'));return db[_0x1465('0xc')][_0x1465('0x9')](hopper2);})['then'](function(){console[_0x1465('0xa')](_0x1465('0xb'),'hopper2');})['catch'](function(_0x33f196){console[_0x1465('0xa')](_0x33f196);}); \ No newline at end of file +var _0xfdcc=['now','CmContact','destroy','then','bulkCreate','finished\x20populating','log','contacts2','CmHopper','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push'];(function(_0x202ea3,_0x38ab41){var _0x58787b=function(_0x1dce0b){while(--_0x1dce0b){_0x202ea3['push'](_0x202ea3['shift']());}};_0x58787b(++_0x38ab41);}(_0xfdcc,0x161));var _0xcfdc=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xfdcc[_0x2ff238];return _0x204a56;};'use strict';var util=require(_0xcfdc('0x0'));var db=require(_0xcfdc('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xcfdc('0x2')+i,'lastName':_0xcfdc('0x3')+i,'phone':0xf879fb460+i,'email':_0xcfdc('0x4')+i+_0xcfdc('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcfdc('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xcfdc('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcfdc('0x7')](),'updatedAt':Date[_0xcfdc('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcfdc('0x6')]({'id':i,'firstName':_0xcfdc('0x2')+i,'lastName':_0xcfdc('0x3')+i,'phone':0xf879fb460+i,'email':_0xcfdc('0x4')+i+_0xcfdc('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcfdc('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xcfdc('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcfdc('0x7')](),'updatedAt':Date[_0xcfdc('0x7')]()});}db[_0xcfdc('0x8')][_0xcfdc('0x9')]({'where':{}})[_0xcfdc('0xa')](function(){return db['CmContact'][_0xcfdc('0xb')](contacts);})['then'](function(){console['log'](_0xcfdc('0xc'),'contacts1');return db['CmHopper']['destroy']({'where':{}});})[_0xcfdc('0xa')](function(){return db['CmHopper'][_0xcfdc('0xb')](hopper);})[_0xcfdc('0xa')](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),'hopper1');return db[_0xcfdc('0x8')][_0xcfdc('0xb')](contacts2);})[_0xcfdc('0xa')](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),_0xcfdc('0xe'));return db[_0xcfdc('0xf')][_0xcfdc('0xb')](hopper2);})['then'](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),_0xcfdc('0x10'));})[_0xcfdc('0x11')](function(_0x570e13){console[_0xcfdc('0xd')](_0x570e13);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 054f936..2a1e9da 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10e0=['util','../mysqldb','%s%s','agent','format','password','friend','udp','wss','all','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','catch'];(function(_0x12aba8,_0x40a036){var _0x2aac66=function(_0x3e56b7){while(--_0x3e56b7){_0x12aba8['push'](_0x12aba8['shift']());}};_0x2aac66(++_0x40a036);}(_0x10e0,0x77));var _0x010e=function(_0x9bb5cb,_0x1f8301){_0x9bb5cb=_0x9bb5cb-0x0;var _0x3d611c=_0x10e0[_0x9bb5cb];return _0x3d611c;};'use strict';var util=require(_0x010e('0x0'));var db=require(_0x010e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x010e('0x2'),_0x010e('0x3'),i),'fullname':util['format']('%s%s',_0x010e('0x3'),i),'email':util[_0x010e('0x4')]('%s%s@xcally.com',_0x010e('0x3'),i),'role':_0x010e('0x3'),'password':_0x010e('0x5'),'internal':0xfa0+i,'type':_0x010e('0x6'),'transport':[_0x010e('0x7'),'ws',_0x010e('0x8')],'disallow':[_0x010e('0x9')],'allow':['ulaw'],'defaultuser':util[_0x010e('0x4')](_0x010e('0x2'),_0x010e('0x3'),i),'encryption':'yes','avpf':_0x010e('0xa'),'force_avp':_0x010e('0xa'),'icesupport':_0x010e('0xa'),'dtlsenable':_0x010e('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x010e('0xb'),'dtlssetup':'actpass','callerid':util[_0x010e('0x4')](_0x010e('0xc'),util[_0x010e('0x4')]('%s%s',_0x010e('0x3'),i),0xfa0+i)});}db[_0x010e('0xd')][_0x010e('0xe')](users)['then'](function(){console[_0x010e('0xf')]('add\x20user');})[_0x010e('0x10')](function(_0x35ab78){console['log'](_0x35ab78);}); \ No newline at end of file +var _0x7364=['/etc/pki/tls/private/motion.key','User','then','add\x20user','catch','log','util','../mysqldb','format','%s%s','agent','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x2e7656,_0xedcebb){var _0x5a770f=function(_0x5ef09e){while(--_0x5ef09e){_0x2e7656['push'](_0x2e7656['shift']());}};_0x5a770f(++_0xedcebb);}(_0x7364,0xd6));var _0x4736=function(_0x588e0e,_0x2893b4){_0x588e0e=_0x588e0e-0x0;var _0x548ead=_0x7364[_0x588e0e];return _0x548ead;};'use strict';var util=require(_0x4736('0x0'));var db=require(_0x4736('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x4736('0x2')](_0x4736('0x3'),_0x4736('0x4'),i),'fullname':util[_0x4736('0x2')]('%s%s',_0x4736('0x4'),i),'email':util[_0x4736('0x2')]('%s%s@xcally.com','agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x4736('0x5'),'transport':['udp','ws',_0x4736('0x6')],'disallow':['all'],'allow':[_0x4736('0x7')],'defaultuser':util['format']('%s%s',_0x4736('0x4'),i),'encryption':_0x4736('0x8'),'avpf':'yes','force_avp':_0x4736('0x8'),'icesupport':_0x4736('0x8'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x4736('0x9'),'dtlsprivatekey':_0x4736('0xa'),'dtlssetup':'actpass','callerid':util[_0x4736('0x2')]('\x22%s\x22\x20<%s>',util[_0x4736('0x2')](_0x4736('0x3'),_0x4736('0x4'),i),0xfa0+i)});}db[_0x4736('0xb')]['bulkCreate'](users)[_0x4736('0xc')](function(){console['log'](_0x4736('0xd'));})[_0x4736('0xe')](function(_0x1895e5){console[_0x4736('0xf')](_0x1895e5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 42586bd..07d4bcd 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3256=['Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','leave','map','removeChatInteractions','emit','MailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','bluebird','../mysqldb','name','Agents','User','agent','telephone','type','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','where','role','ivr','format','%s:queue:%s','length','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Campaign','userProfileId'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x3256,0xee));var _0x6325=function(_0xb45119,_0x90c648){_0xb45119=_0xb45119-0x0;var _0x469da0=_0x3256[_0xb45119];return _0x469da0;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x6325('0x0'));var db=require(_0x6325('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6325('0x2')],'include':[{'as':_0x6325('0x3'),'model':db[_0x6325('0x4')],'attributes':['id',_0x6325('0x2'),'role'],'raw':!![],'where':{'role':_0x6325('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6325('0x2')],'where':{'role':_0x6325('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x6325('0x2')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x6325('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x1c006b,_0x1bd00d,_0x36ebb7){return db['UserProfileSection']['findOne']({'where':{'name':_0x1c006b,'userProfileId':_0x1bd00d},'raw':!![]})[_0x6325('0x8')](function(_0x28a506){if(_0x28a506){if(_0x28a506[_0x6325('0x9')]){switch(_0x1c006b){case _0x6325('0xa'):case _0x6325('0xb'):case _0x6325('0xc'):case _0x6325('0xd'):case _0x6325('0xe'):case _0x6325('0xf'):case _0x6325('0x10'):return db[_0x36ebb7][_0x6325('0x11')](queryQueues);case _0x6325('0x12'):return db[_0x36ebb7]['findAll'](queryTelephones);case'Trunks':return db[_0x36ebb7]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x36ebb7][_0x6325('0x11')](queryCampaigns);}}else{return db[_0x6325('0x13')][_0x6325('0x11')]({'attributes':[_0x6325('0x14')],'where':{'sectionId':_0x28a506['id']},'raw':!![]})[_0x6325('0x8')](function(_0x1605e3){if(_0x1605e3){var _0xfaee3d={'where':{'id':_['map'](_0x1605e3,_0x6325('0x14'))},'raw':!![]};switch(_0x36ebb7){case _0x6325('0x4'):_0xfaee3d[_0x6325('0x15')][_0x6325('0x16')]=_0x6325('0x6');break;case'Campaign':_0xfaee3d[_0x6325('0x15')]['type']=_0x6325('0x17');break;}return db[_0x36ebb7][_0x6325('0x11')](_0xfaee3d);}else{return[];}});}}else{return[];}})[_0x6325('0x8')](function(_0x54492d){return _0x54492d;});}function joinOrLeaveQueues(_0x5d4be2,_0x131e6b,_0x2f85fb,_0x27a224){_0x5d4be2[_0x131e6b](util[_0x6325('0x18')](_0x6325('0x19'),_0x2f85fb,_0x27a224['name']));if(_0x27a224['Agents']){for(var _0x770c8f=0x0;_0x770c8f<_0x27a224[_0x6325('0x3')][_0x6325('0x1a')];_0x770c8f+=0x1){_0x5d4be2[_0x131e6b](util['format'](_0x6325('0x1b'),_0x27a224[_0x6325('0x3')][_0x770c8f][_0x6325('0x2')]));}}}function joinOrLeave(_0xf02781,_0x23a11f,_0x1ce497){var _0x21bb1f;if(_0xf02781[_0x6325('0x1c')][_0x6325('0x1d')]['id']){db['User']['find']({'attributes':['id','name',_0x6325('0x16'),'userProfileId'],'where':{'id':_0xf02781[_0x6325('0x1c')][_0x6325('0x1d')]['id']},'include':[{'model':db[_0x6325('0x1e')],'as':_0x6325('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x6325('0x20')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6325('0x21')],'as':_0x6325('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x6325('0x23')],'as':_0x6325('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6325('0x25')],'as':_0x6325('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x6325('0x27')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x6325('0x8')](function(_0xd3593f){if(_0xd3593f){_0x21bb1f=_0xd3593f;_0xf02781[_0x23a11f](util[_0x6325('0x18')](_0x6325('0x1b'),_0xd3593f[_0x6325('0x2')]));var _0x125128=[];switch(_0xd3593f['role']){case _0x6325('0x28'):_0xf02781[_0x23a11f](_0x6325('0x29'));_0xf02781[_0x23a11f](_0x6325('0x2a'));if(queryQueues[_0x6325('0x2b')]('include')){delete queryQueues['include'];}_0x125128[_0x6325('0x2c')](db[_0x6325('0x2d')][_0x6325('0x11')](queryQueues));_0x125128[_0x6325('0x2c')](db['ChatQueue'][_0x6325('0x11')](queryQueues));_0x125128['push'](db[_0x6325('0x2e')]['findAll'](queryQueues));_0x125128[_0x6325('0x2c')](db[_0x6325('0x2f')]['findAll'](queryQueues));_0x125128['push'](db[_0x6325('0x30')][_0x6325('0x11')](queryQueues));_0x125128[_0x6325('0x2c')](db[_0x6325('0x31')][_0x6325('0x11')](queryQueues));_0x125128[_0x6325('0x2c')](db[_0x6325('0x32')][_0x6325('0x11')](queryQueues));_0x125128[_0x6325('0x2c')](db['User'][_0x6325('0x11')](queryTelephones));_0x125128[_0x6325('0x2c')](db['Trunk'][_0x6325('0x11')](queryTrunks));_0x125128[_0x6325('0x2c')](db[_0x6325('0x33')]['findAll'](queryCampaigns));_0x125128[_0x6325('0x2c')](db[_0x6325('0x4')][_0x6325('0x11')](queryAgents));break;case'user':_0xf02781[_0x23a11f](_0x6325('0x29'));_0xf02781[_0x23a11f]('voice:outbound');_0x125128[_0x6325('0x2c')](getAssociatedResources(_0x6325('0xa'),_0xd3593f[_0x6325('0x34')],'VoiceQueue'));_0x125128[_0x6325('0x2c')](getAssociatedResources('ChatQueues',_0xd3593f[_0x6325('0x34')],'ChatQueue'));_0x125128['push'](getAssociatedResources(_0x6325('0xc'),_0xd3593f['userProfileId'],_0x6325('0x2e')));_0x125128['push'](getAssociatedResources(_0x6325('0xd'),_0xd3593f['userProfileId'],_0x6325('0x2f')));_0x125128['push'](getAssociatedResources(_0x6325('0xe'),_0xd3593f[_0x6325('0x34')],_0x6325('0x30')));_0x125128[_0x6325('0x2c')](getAssociatedResources('OpenchannelQueues',_0xd3593f[_0x6325('0x34')],'OpenchannelQueue'));_0x125128[_0x6325('0x2c')](getAssociatedResources('WhatsappQueues',_0xd3593f['userProfileId'],_0x6325('0x32')));_0x125128[_0x6325('0x2c')](getAssociatedResources(_0x6325('0x12'),_0xd3593f[_0x6325('0x34')],_0x6325('0x4')));_0x125128['push'](getAssociatedResources('Trunks',_0xd3593f['userProfileId'],_0x6325('0x35')));_0x125128['push'](getAssociatedResources(_0x6325('0x36'),_0xd3593f[_0x6325('0x34')],_0x6325('0x33')));_0x125128[_0x6325('0x2c')](db[_0x6325('0x4')][_0x6325('0x11')](queryAgents));break;case _0x6325('0x5'):_0xf02781[_0x23a11f]('voice:inbound');_0xf02781[_0x23a11f](_0x6325('0x2a'));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x37')]({'attributes':['id',_0x6325('0x2')]}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x38')]({'attributes':['id',_0x6325('0x2')]}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x39')]({'attributes':['id',_0x6325('0x2')]}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x3a')]({'attributes':['id',_0x6325('0x2')]}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x3b')]({'attributes':['id',_0x6325('0x2')]}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x3c')]({'attributes':['id','name']}));_0x125128[_0x6325('0x2c')](_0xd3593f[_0x6325('0x3d')]({'attributes':['id',_0x6325('0x2')]}));break;}return BPromise[_0x6325('0x3e')](_0x125128);}})[_0x6325('0x8')](function(_0x5f4d2b){if(_0x5f4d2b&&_0x5f4d2b['length']){for(var _0x3d53ac=0x0;_0x3d53ac<_0x5f4d2b[_0x6325('0x1a')];_0x3d53ac+=0x1){for(var _0x4a030c=0x0;_0x4a030c<_0x5f4d2b[_0x3d53ac][_0x6325('0x1a')];_0x4a030c+=0x1){switch(_0x3d53ac){case 0x0:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x3f'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x1:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x40'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x2:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x41'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x3:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x42'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x4:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x43'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x5:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x44'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x6:joinOrLeaveQueues(_0xf02781,_0x23a11f,_0x6325('0x45'),_0x5f4d2b[_0x3d53ac][_0x4a030c]);break;case 0x7:if(_0x21bb1f['role']!==_0x6325('0x5'))_0xf02781[_0x23a11f](util[_0x6325('0x18')]('telephone:%s',_0x5f4d2b[_0x3d53ac][_0x4a030c]['name']));break;case 0x8:if(_0x21bb1f[_0x6325('0x16')]!==_0x6325('0x5'))_0xf02781[_0x23a11f](util[_0x6325('0x18')](_0x6325('0x46'),_0x5f4d2b[_0x3d53ac][_0x4a030c]['name']));break;case 0x9:if(_0x21bb1f[_0x6325('0x16')]!==_0x6325('0x5'))_0xf02781[_0x23a11f](util['format']('campaign:%s:%s',_0x5f4d2b[_0x3d53ac][_0x4a030c][_0x6325('0x7')],_0x5f4d2b[_0x3d53ac][_0x4a030c]['name']));break;case 0xa:_0xf02781[_0x23a11f](util['format'](_0x6325('0x1b'),_0x5f4d2b[_0x3d53ac][_0x4a030c][_0x6325('0x2')]));break;}}}}})[_0x6325('0x8')](function(){if(_0x23a11f===_0x6325('0x47')){var _0x47aa64=_[_0x6325('0x48')](_0x21bb1f[_0x6325('0x1f')],'id');return _0x21bb1f[_0x6325('0x49')](_0x47aa64)['then'](function(){for(var _0x3226c6=0x0;_0x3226c6<_0x47aa64['length'];_0x3226c6+=0x1){_0x1ce497[_0x6325('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x47aa64[_0x3226c6]),'UserId':Number(_0x21bb1f['id'])});}});}})[_0x6325('0x8')](function(){if(_0x23a11f===_0x6325('0x47')){var _0x1eaf50=_[_0x6325('0x48')](_0x21bb1f[_0x6325('0x4b')],'id');return _0x21bb1f['removeMailInteractions'](_0x1eaf50)[_0x6325('0x8')](function(){for(var _0x2dcb8c=0x0;_0x2dcb8c<_0x1eaf50[_0x6325('0x1a')];_0x2dcb8c+=0x1){_0x1ce497[_0x6325('0x4a')](_0x6325('0x4c'),{'MailInteractionId':Number(_0x1eaf50[_0x2dcb8c]),'UserId':Number(_0x21bb1f['id'])});}});}})[_0x6325('0x8')](function(){if(_0x23a11f==='leave'){var _0x559560=_[_0x6325('0x48')](_0x21bb1f[_0x6325('0x22')],'id');return _0x21bb1f['removeFaxInteractions'](_0x559560)['then'](function(){for(var _0x559d60=0x0;_0x559d60<_0x559560['length'];_0x559d60+=0x1){_0x1ce497[_0x6325('0x4a')](_0x6325('0x4d'),{'FaxInteractionId':Number(_0x559560[_0x559d60]),'UserId':Number(_0x21bb1f['id'])});}});}})[_0x6325('0x8')](function(){if(_0x23a11f===_0x6325('0x47')){var _0x2618b0=_['map'](_0x21bb1f['SmsInteractions'],'id');return _0x21bb1f[_0x6325('0x4e')](_0x2618b0)[_0x6325('0x8')](function(){for(var _0x5e2054=0x0;_0x5e2054<_0x2618b0[_0x6325('0x1a')];_0x5e2054+=0x1){_0x1ce497[_0x6325('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2618b0[_0x5e2054]),'UserId':Number(_0x21bb1f['id'])});}});}})[_0x6325('0x8')](function(){if(_0x23a11f===_0x6325('0x47')){var _0x54f401=_[_0x6325('0x48')](_0x21bb1f['OpenchannelInteractions'],'id');return _0x21bb1f[_0x6325('0x4f')](_0x54f401)[_0x6325('0x8')](function(){for(var _0xdda7a4=0x0;_0xdda7a4<_0x54f401[_0x6325('0x1a')];_0xdda7a4+=0x1){_0x1ce497[_0x6325('0x4a')](_0x6325('0x50'),{'OpenchannelInteractionId':Number(_0x54f401[_0xdda7a4]),'UserId':Number(_0x21bb1f['id'])});}});}})[_0x6325('0x8')](function(){if(_0x23a11f==='leave'){var _0xe652fe=_[_0x6325('0x48')](_0x21bb1f[_0x6325('0x51')],'id');return _0x21bb1f[_0x6325('0x52')](_0xe652fe)['then'](function(){for(var _0xf0dd5d=0x0;_0xf0dd5d<_0xe652fe[_0x6325('0x1a')];_0xf0dd5d+=0x1){_0x1ce497[_0x6325('0x4a')](_0x6325('0x53'),{'WhatsappInteractionId':Number(_0xe652fe[_0xf0dd5d]),'UserId':Number(_0x21bb1f['id'])});}});}})['catch'](function(_0xd73d6){_0xf02781[_0x6325('0x54')](_0xd73d6);});}}function onDisconnect(_0x4fb864,_0x1231d3){joinOrLeave(_0x4fb864,_0x6325('0x47'),_0x1231d3);}function onConnect(_0x5ba580){joinOrLeave(_0x5ba580,_0x6325('0x55'));}exports['default']=function(_0x5cf2cd){_0x5cf2cd['on'](_0x6325('0x56'),function(_0x254135){_0x254135[_0x6325('0x57')](0x0);_0x254135[_0x6325('0x58')]=_0x254135['request'][_0x6325('0x56')]['remoteAddress']+':'+_0x254135[_0x6325('0x59')][_0x6325('0x56')][_0x6325('0x5a')];_0x254135[_0x6325('0x5b')]=new Date();_0x254135[_0x6325('0x54')]=function(_0x2b4243){console[_0x6325('0x54')](_0x6325('0x5c')+_0x254135[_0x6325('0x5d')][_0x6325('0x2')]+'['+_0x254135[_0x6325('0x58')]+']',_0x2b4243);};_0x254135['on'](_0x6325('0x5e'),function(){onDisconnect(_0x254135,_0x5cf2cd);_0x254135[_0x6325('0x54')](_0x6325('0x5f'));});onConnect(_0x254135);_0x254135[_0x6325('0x54')](_0x6325('0x60'));});}; \ No newline at end of file +var _0xaac4=['default','connection','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','type','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','then','resourceId','where','ivr','format','%s:queue:%s','Agents','length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','FaxQueues','FaxQueue','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','map','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join'];(function(_0x387056,_0x5550a5){var _0x3b276d=function(_0x4d375e){while(--_0x4d375e){_0x387056['push'](_0x387056['shift']());}};_0x3b276d(++_0x5550a5);}(_0xaac4,0x6c));var _0x4aac=function(_0x5b2d38,_0x3c461a){_0x5b2d38=_0x5b2d38-0x0;var _0x2f7806=_0xaac4[_0x5b2d38];return _0x2f7806;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var BPromise=require('bluebird');var db=require(_0x4aac('0x2'))['db'];var config=require(_0x4aac('0x3'));var queryQueues={'attributes':['id',_0x4aac('0x4')],'include':[{'as':'Agents','model':db[_0x4aac('0x5')],'attributes':['id',_0x4aac('0x4'),_0x4aac('0x6')],'raw':!![],'where':{'role':_0x4aac('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4aac('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x4aac('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x4aac('0x4')],'where':{'role':_0x4aac('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4aac('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3ba0ea,_0x83c258,_0x239771){return db[_0x4aac('0x9')][_0x4aac('0xa')]({'where':{'name':_0x3ba0ea,'userProfileId':_0x83c258},'raw':!![]})['then'](function(_0xabb74){if(_0xabb74){if(_0xabb74[_0x4aac('0xb')]){switch(_0x3ba0ea){case _0x4aac('0xc'):case _0x4aac('0xd'):case'FaxQueues':case _0x4aac('0xe'):case _0x4aac('0xf'):case _0x4aac('0x10'):case _0x4aac('0x11'):return db[_0x239771][_0x4aac('0x12')](queryQueues);case _0x4aac('0x13'):return db[_0x239771][_0x4aac('0x12')](queryTelephones);case'Trunks':return db[_0x239771][_0x4aac('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x239771][_0x4aac('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x4aac('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0xabb74['id']},'raw':!![]})[_0x4aac('0x14')](function(_0x442883){if(_0x442883){var _0x2dca5b={'where':{'id':_['map'](_0x442883,_0x4aac('0x15'))},'raw':!![]};switch(_0x239771){case _0x4aac('0x5'):_0x2dca5b['where']['role']='telephone';break;case'Campaign':_0x2dca5b[_0x4aac('0x16')][_0x4aac('0x8')]=_0x4aac('0x17');break;}return db[_0x239771]['findAll'](_0x2dca5b);}else{return[];}});}}else{return[];}})[_0x4aac('0x14')](function(_0x375f81){return _0x375f81;});}function joinOrLeaveQueues(_0x2f751b,_0x2b4ab0,_0x22a0fe,_0x2da712){_0x2f751b[_0x2b4ab0](util[_0x4aac('0x18')](_0x4aac('0x19'),_0x22a0fe,_0x2da712[_0x4aac('0x4')]));if(_0x2da712[_0x4aac('0x1a')]){for(var _0x39d457=0x0;_0x39d457<_0x2da712['Agents'][_0x4aac('0x1b')];_0x39d457+=0x1){_0x2f751b[_0x2b4ab0](util[_0x4aac('0x18')]('user:%s',_0x2da712[_0x4aac('0x1a')][_0x39d457]['name']));}}}function joinOrLeave(_0x1f35f3,_0x23fb33,_0x34a384){var _0x3d4836;if(_0x1f35f3[_0x4aac('0x1c')][_0x4aac('0x1d')]['id']){db[_0x4aac('0x5')]['find']({'attributes':['id',_0x4aac('0x4'),_0x4aac('0x6'),_0x4aac('0x1e')],'where':{'id':_0x1f35f3['handshake'][_0x4aac('0x1d')]['id']},'include':[{'model':db[_0x4aac('0x1f')],'as':_0x4aac('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x21')],'as':_0x4aac('0x22'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4aac('0x23'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x24')],'as':_0x4aac('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x26')],'as':_0x4aac('0x27'),'attributes':['id'],'raw':!![]}]})[_0x4aac('0x14')](function(_0x5133b8){if(_0x5133b8){_0x3d4836=_0x5133b8;_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x28'),_0x5133b8['name']));var _0x869ea2=[];switch(_0x5133b8[_0x4aac('0x6')]){case'admin':_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x4aac('0x2a'))){delete queryQueues[_0x4aac('0x2a')];}_0x869ea2[_0x4aac('0x2b')](db['VoiceQueue'][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x2c')][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db['FaxQueue'][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x2d')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x2e')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x2f')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x30')][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db['User']['findAll'](queryTelephones));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x31')]['findAll'](queryTrunks));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x32')]['findAll'](queryCampaigns));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x5')][_0x4aac('0x12')](queryAgents));break;case _0x4aac('0x33'):_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33](_0x4aac('0x34'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xc'),_0x5133b8[_0x4aac('0x1e')],'VoiceQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xd'),_0x5133b8[_0x4aac('0x1e')],'ChatQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x35'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x36')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xe'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x2d')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xf'),_0x5133b8[_0x4aac('0x1e')],'MailQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources('OpenchannelQueues',_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x2f')));_0x869ea2['push'](getAssociatedResources(_0x4aac('0x11'),_0x5133b8['userProfileId'],'WhatsappQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x13'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x5')));_0x869ea2['push'](getAssociatedResources(_0x4aac('0x37'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x31')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x38'),_0x5133b8[_0x4aac('0x1e')],'Campaign'));_0x869ea2[_0x4aac('0x2b')](db['User'][_0x4aac('0x12')](queryAgents));break;case _0x4aac('0x7'):_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33]('voice:outbound');_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x39')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3a')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2['push'](_0x5133b8['getFaxQueues']({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2['push'](_0x5133b8[_0x4aac('0x3b')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3c')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3d')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8['getWhatsappQueues']({'attributes':['id',_0x4aac('0x4')]}));break;}return BPromise[_0x4aac('0x3e')](_0x869ea2);}})['then'](function(_0x47f8bb){if(_0x47f8bb&&_0x47f8bb[_0x4aac('0x1b')]){for(var _0x574e92=0x0;_0x574e92<_0x47f8bb['length'];_0x574e92+=0x1){for(var _0x47d40a=0x0;_0x47d40a<_0x47f8bb[_0x574e92][_0x4aac('0x1b')];_0x47d40a+=0x1){switch(_0x574e92){case 0x0:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,'voice',_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x1:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,'chat',_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x2:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x3f'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x3:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x40'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x4:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x41'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x5:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x42'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x6:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x43'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x7:if(_0x3d4836[_0x4aac('0x6')]!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x44'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0x8:if(_0x3d4836['role']!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')]('trunk:%s',_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0x9:if(_0x3d4836[_0x4aac('0x6')]!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x45'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x8')],_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0xa:_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x28'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;}}}}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x27e987=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x20')],'id');return _0x3d4836['removeChatInteractions'](_0x27e987)[_0x4aac('0x14')](function(){for(var _0x4ba78b=0x0;_0x4ba78b<_0x27e987[_0x4aac('0x1b')];_0x4ba78b+=0x1){_0x34a384['emit'](_0x4aac('0x48'),{'ChatInteractionId':Number(_0x27e987[_0x4ba78b]),'UserId':Number(_0x3d4836['id'])});}});}})['then'](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x114d43=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x22')],'id');return _0x3d4836[_0x4aac('0x49')](_0x114d43)['then'](function(){for(var _0x57442e=0x0;_0x57442e<_0x114d43[_0x4aac('0x1b')];_0x57442e+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x4b'),{'MailInteractionId':Number(_0x114d43[_0x57442e]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x4764ac=_['map'](_0x3d4836['FaxInteractions'],'id');return _0x3d4836[_0x4aac('0x4c')](_0x4764ac)[_0x4aac('0x14')](function(){for(var _0x5f004a=0x0;_0x5f004a<_0x4764ac['length'];_0x5f004a+=0x1){_0x34a384['emit'](_0x4aac('0x4d'),{'FaxInteractionId':Number(_0x4764ac[_0x5f004a]),'UserId':Number(_0x3d4836['id'])});}});}})['then'](function(){if(_0x23fb33==='leave'){var _0xc732b3=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x4e')],'id');return _0x3d4836[_0x4aac('0x4f')](_0xc732b3)[_0x4aac('0x14')](function(){for(var _0x38707d=0x0;_0x38707d<_0xc732b3[_0x4aac('0x1b')];_0x38707d+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x50'),{'SmsInteractionId':Number(_0xc732b3[_0x38707d]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x613835=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x25')],'id');return _0x3d4836[_0x4aac('0x51')](_0x613835)[_0x4aac('0x14')](function(){for(var _0x2d8603=0x0;_0x2d8603<_0x613835['length'];_0x2d8603+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x52'),{'OpenchannelInteractionId':Number(_0x613835[_0x2d8603]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x14c062=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x27')],'id');return _0x3d4836[_0x4aac('0x53')](_0x14c062)[_0x4aac('0x14')](function(){for(var _0x2e0171=0x0;_0x2e0171<_0x14c062['length'];_0x2e0171+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x54'),{'WhatsappInteractionId':Number(_0x14c062[_0x2e0171]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x55')](function(_0x167495){_0x1f35f3[_0x4aac('0x56')](_0x167495);});}}function onDisconnect(_0x30aae5,_0x44f533){joinOrLeave(_0x30aae5,'leave',_0x44f533);}function onConnect(_0x4ca246){joinOrLeave(_0x4ca246,_0x4aac('0x57'));}exports[_0x4aac('0x58')]=function(_0x55146a){_0x55146a['on'](_0x4aac('0x59'),function(_0x10b635){_0x10b635['setMaxListeners'](0x0);_0x10b635['address']=_0x10b635[_0x4aac('0x5a')][_0x4aac('0x59')][_0x4aac('0x5b')]+':'+_0x10b635[_0x4aac('0x5a')][_0x4aac('0x59')][_0x4aac('0x5c')];_0x10b635[_0x4aac('0x5d')]=new Date();_0x10b635['log']=function(_0x1d8bed){console['log'](_0x4aac('0x5e')+_0x10b635[_0x4aac('0x5f')]['name']+'['+_0x10b635[_0x4aac('0x60')]+']',_0x1d8bed);};_0x10b635['on']('disconnect',function(){onDisconnect(_0x10b635,_0x55146a);_0x10b635['log']('DISCONNECTED');});onConnect(_0x10b635);_0x10b635[_0x4aac('0x56')](_0x4aac('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4664799..753dce1 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 _0x76e2=['WhatsappInteraction','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','info','Trigger,\x20%s','EventManager','error','code','catch','get','channel','motionChannel','direction','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','event','offlineMessage','opened','resolve','QueryTypes','contact','AfterCreate','changed','closed','substatus','query','User','find','fullname','email','internal','length','model','hook','toLowerCase','condition','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','SmsMessage','Whatsapp'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x76e2,0x103));var _0x276e=function(_0x1fbd22,_0x10f415){_0x1fbd22=_0x1fbd22-0x0;var _0x22b348=_0x76e2[_0x1fbd22];return _0x22b348;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var client=jayson['client'][_0x276e('0x0')]({'port':0x232a});var triggers=[{'channel':_0x276e('0x1'),'model':_0x276e('0x2'),'event':_0x276e('0x3'),'condition':_0x276e('0x4'),'callback':afterCreate},{'channel':'Chat','model':_0x276e('0x2'),'event':_0x276e('0x5'),'condition':_0x276e('0x6'),'callback':afterUpdate},{'channel':_0x276e('0x1'),'model':_0x276e('0x7'),'event':'afterCreate','condition':_0x276e('0x8'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x276e('0x9'),'event':_0x276e('0x3'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x276e('0x3'),'condition':_0x276e('0x4'),'callback':afterCreate},{'channel':'Sms','model':_0x276e('0xa'),'event':_0x276e('0x5'),'condition':_0x276e('0x6'),'callback':afterUpdate},{'channel':'Sms','model':_0x276e('0xb'),'event':'afterCreate','condition':_0x276e('0x8'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x276e('0x3'),'condition':_0x276e('0x4'),'callback':afterCreate},{'channel':_0x276e('0xc'),'model':_0x276e('0xd'),'event':_0x276e('0x5'),'condition':_0x276e('0x6'),'callback':afterUpdate},{'channel':_0x276e('0xc'),'model':'WhatsappMessage','event':_0x276e('0x3'),'condition':_0x276e('0x8'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':'afterCreate','condition':_0x276e('0x4'),'callback':afterCreate},{'channel':'Fax','model':_0x276e('0xe'),'event':'afterUpdate','condition':_0x276e('0x6'),'callback':afterUpdate},{'channel':'Fax','model':_0x276e('0xf'),'event':'afterCreate','condition':_0x276e('0x8'),'callback':afterCreateMessage},{'channel':_0x276e('0x10'),'model':_0x276e('0x11'),'event':_0x276e('0x3'),'condition':_0x276e('0x4'),'callback':afterCreate},{'channel':_0x276e('0x10'),'model':'MailInteraction','event':_0x276e('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x276e('0x10'),'model':'MailMessage','event':_0x276e('0x3'),'condition':_0x276e('0x8'),'callback':afterCreateMessage},{'channel':_0x276e('0x12'),'model':_0x276e('0x13'),'event':_0x276e('0x3'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x276e('0x12'),'model':_0x276e('0x13'),'event':_0x276e('0x5'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x276e('0x12'),'model':_0x276e('0x14'),'event':_0x276e('0x3'),'condition':_0x276e('0x8'),'callback':afterCreateMessage}];function request(_0x281341){return client[_0x276e('0x15')]('EventManager',_0x281341)['then'](function(_0x5ce0f1){logger[_0x276e('0x16')](_0x276e('0x17'),_0x276e('0x18'),_0x5ce0f1);if(_0x5ce0f1[_0x276e('0x19')]){if(_0x5ce0f1[_0x276e('0x19')][_0x276e('0x1a')]===0x1f4){logger[_0x276e('0x19')]('Trigger,\x20%s','EventManager',_0x5ce0f1[_0x276e('0x19')]);}}})[_0x276e('0x1b')](function(_0x6142a7){logger['error'](_0x276e('0x17'),_0x276e('0x18'),_0x6142a7);});}function afterCreateMessage(_0x59f702){return function(_0x56b4d1){_0x56b4d1=_0x56b4d1[_0x276e('0x1c')]({'plain':!![]});_0x56b4d1[_0x276e('0x1d')]=_0x59f702;_0x56b4d1[_0x276e('0x1e')]=_0x59f702;_0x56b4d1['event']=_0x56b4d1[_0x276e('0x1f')];Promise['resolve']()[_0x276e('0x20')](function(){if(typeof _0x56b4d1[_0x276e('0x21')]===_0x276e('0x22'))return null;var _0x3b9b5f=_0x276e('0x23')+_0x56b4d1[_0x276e('0x21')];return db[_0x276e('0x24')]['query'](_0x3b9b5f,{'type':db[_0x276e('0x25')]['QueryTypes'][_0x276e('0x26')],'raw':!![]});})[_0x276e('0x20')](function(_0x3aac1b){if(_0x3aac1b){_0x56b4d1['contact']=_0x3aac1b[0x0];}if(typeof _0x56b4d1[_0x276e('0x27')]===_0x276e('0x22'))return;return getAgent(_0x56b4d1[_0x276e('0x27')]);})[_0x276e('0x20')](function(_0x1c114a){if(_0x1c114a){_0x56b4d1[_0x276e('0x28')]=util[_0x276e('0x29')](_0x276e('0x2a'),_0x1c114a[_0x276e('0x2b')]);_0x56b4d1[_0x276e('0x2c')]=_0x1c114a;_0x56b4d1[_0x276e('0x1d')]=_0x59f702;return request({'event':_0x276e('0x2d'),'message':_0x56b4d1});}else{return request({'event':_0x276e('0x2e'),'message':_0x56b4d1});}})[_0x276e('0x1b')](function(_0x54aeb9){logger[_0x276e('0x19')]('Trigger,\x20%s','AfterCreateMessage',_0x54aeb9);});};}function afterCreateOfflineMessage(_0x183fe1){return function(_0x1bb8c6){_0x1bb8c6=_0x1bb8c6[_0x276e('0x1c')]({'plain':!![]});_0x1bb8c6[_0x276e('0x1d')]=_0x183fe1;_0x1bb8c6[_0x276e('0x1e')]=_0x183fe1;_0x1bb8c6[_0x276e('0x2f')]=_0x276e('0x30');return request({'event':_0x1bb8c6[_0x276e('0x2f')],'message':_0x1bb8c6});};}function afterCreate(_0x41b3cf,_0x522ce8){return function(_0x49373b){_0x49373b=_0x49373b[_0x276e('0x1c')]({'plain':!![]});_0x49373b[_0x276e('0x1d')]=_0x41b3cf;_0x49373b[_0x276e('0x1e')]=_0x41b3cf;_0x49373b[_0x276e('0x2f')]=_0x276e('0x31');Promise[_0x276e('0x32')]()[_0x276e('0x20')](function(){var _0x2186ce=_0x276e('0x23')+_0x49373b['ContactId'];return db[_0x276e('0x24')]['query'](_0x2186ce,{'type':db[_0x276e('0x25')][_0x276e('0x33')][_0x276e('0x26')],'raw':!![]});})[_0x276e('0x20')](function(_0x30c168){if(_0x30c168){_0x49373b[_0x276e('0x34')]=_0x30c168[0x0];}if(typeof _0x49373b[_0x276e('0x27')]===_0x276e('0x22'))return;return getAgent(_0x49373b['UserId']);})[_0x276e('0x20')](function(_0x2f529c){if(_0x2f529c){_0x49373b[_0x276e('0x28')]=util['format'](_0x276e('0x2a'),_0x2f529c[_0x276e('0x2b')]);_0x49373b[_0x276e('0x2c')]=_0x2f529c;}return request({'event':_0x522ce8,'message':_0x49373b});})[_0x276e('0x1b')](function(_0x18312e){logger[_0x276e('0x19')](_0x276e('0x17'),_0x276e('0x35'),_0x18312e);});};}function afterUpdate(_0x14ad62){return function(_0x144680){var _0x30bacf=_0x144680[_0x276e('0x36')](_0x276e('0x37'))&&_0x144680[_0x276e('0x37')];var _0x50a77b=_0x144680['changed']('substatus');if(_0x30bacf||_0x50a77b){var _0x4388c1=_0x30bacf?_0x276e('0x6'):'substatus';var _0x4a632c=_0x144680[_0x276e('0x1c')]({'plain':!![]});_0x4a632c[_0x276e('0x1d')]=_0x14ad62;_0x4a632c['motionChannel']=_0x14ad62;_0x4a632c['event']=_0x30bacf?'closed':_0x276e('0x38');var _0x23d337='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a632c['ContactId'];return db[_0x276e('0x24')][_0x276e('0x39')](_0x23d337,{'type':db[_0x276e('0x25')][_0x276e('0x33')][_0x276e('0x26')],'raw':!![]})[_0x276e('0x20')](function(_0x275477){if(_0x275477){_0x4a632c[_0x276e('0x34')]=_0x275477[0x0];}if(typeof _0x4a632c[_0x276e('0x27')]==='undefined')return;return getAgent(_0x4a632c[_0x276e('0x27')]);})[_0x276e('0x20')](function(_0x25c62c){if(_0x25c62c){_0x4a632c['interface']=util[_0x276e('0x29')](_0x276e('0x2a'),_0x25c62c[_0x276e('0x2b')]);_0x4a632c[_0x276e('0x2c')]=_0x25c62c;}return request({'event':_0x4388c1,'message':_0x4a632c});})[_0x276e('0x1b')](function(_0x56c957){logger[_0x276e('0x19')]('Trigger,\x20%s','AfterUpdate',_0x56c957);});}};}function getAgent(_0xb5e220){return db[_0x276e('0x3a')][_0x276e('0x3b')]({'where':{'id':_0xb5e220},'attributes':['id','name',_0x276e('0x3c'),_0x276e('0x3d'),_0x276e('0x3e')],'raw':!![]})[_0x276e('0x20')](function(_0x357ec9){return _0x357ec9;});}exports['default']=function(){for(var _0x4d9084=0x0;_0x4d9084=_0x98a236[_0xcd07('0x13')]){throw Error(_0xcd07('0x14'));}_0x247333(_0x80672b);})[_0xcd07('0x15')](function(_0x268cbe){_0x31daa3(_0x268cbe);});});}; \ No newline at end of file +var _0x7fc1=['chat','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail'];(function(_0x48604b,_0x518ed1){var _0x874edb=function(_0x52d62c){while(--_0x52d62c){_0x48604b['push'](_0x48604b['shift']());}};_0x874edb(++_0x518ed1);}(_0x7fc1,0xba));var _0x17fc=function(_0x410d62,_0x1d452b){_0x410d62=_0x410d62-0x0;var _0x55e273=_0x7fc1[_0x410d62];return _0x55e273;};'use strict';var _=require(_0x17fc('0x0'));var BPromise=require(_0x17fc('0x1'));var db=require(_0x17fc('0x2'))['db'];var util=require(_0x17fc('0x3'));var channels=[_0x17fc('0x4'),_0x17fc('0x5'),_0x17fc('0x6'),_0x17fc('0x7'),_0x17fc('0x8'),_0x17fc('0x9'),_0x17fc('0xa')];exports[_0x17fc('0xb')]=function(){return channels;};exports['isValidChannel']=function(_0x466142){_0x466142=_0x466142[_0x17fc('0xc')]();return _['includes'](channels,_0x466142);};exports[_0x17fc('0xd')]=function(_0xf1df22,_0x588a7d,_0x20b841,_0x19984a){var _0xe26bbf={'loginAttempts':_0x588a7d,'blocked':_0x20b841};if(!_[_0x17fc('0xe')](_0x19984a)){_0xe26bbf['blockedAt']=_0x19984a;}return _0xf1df22[_0x17fc('0xf')](_0xe26bbf);};exports[_0x17fc('0x10')]=function(_0x5d35fb){return new BPromise(function(_0x21514f,_0x38283d){var _0x107b3a=0x0;if(_0x5d35fb[_0x17fc('0x11')]!==_0x17fc('0x12')){_0x21514f(_0x5d35fb);}db['User'][_0x17fc('0x13')]({'where':{'role':_0x17fc('0x12'),'online':!![],'id':{'$ne':_0x5d35fb['id']}}})[_0x17fc('0x14')](function(_0x126e22){_0x107b3a=_0x126e22;return util[_0x17fc('0x10')]();})['then'](function(_0x928209){if(_0x928209&&_0x928209[_0x17fc('0x15')]&&_0x107b3a>=_0x928209[_0x17fc('0x15')]){throw Error(_0x17fc('0x16'));}_0x21514f(_0x5d35fb);})[_0x17fc('0x17')](function(_0x418783){_0x38283d(_0x418783);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index b124350..8cc9c0f 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(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xb688,0xcf));var _0x8b68=function(_0x2346d2,_0x5183d4){_0x2346d2=_0x2346d2-0x0;var _0x1f526f=_0xb688[_0x2346d2];return _0x1f526f;};'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 _0x6f0d=['../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','message','Not\x20Found','Forbidden','error','status','send','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3bdce4,_0x5013c2){_0x3bdce4=_0x3bdce4-0x0;var _0x1c338d=_0x6f0d[_0x3bdce4];return _0x1c338d;};'use strict';var util=require('util');var logger=require(_0xd6f0('0x0'))(_0xd6f0('0x1'));var APIError=function(_0xd1480,_0x107a8c){this['message']=_0xd1480||_0xd6f0('0x2');this[_0xd6f0('0x3')]=_0x107a8c||_0xd6f0('0x4');util[_0xd6f0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x3a757f){this['message']=_0x3a757f||_0xd6f0('0x6');this['name']=_0xd6f0('0x6');util[_0xd6f0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x8b89a9){this[_0xd6f0('0x7')]=_0x8b89a9||'Entity\x20not\x20found';this['name']=_0xd6f0('0x8');util[_0xd6f0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x2854cd){switch(_0x2854cd){case _0xd6f0('0x6'):return 0x190;case _0xd6f0('0x9'),'OutOfInterval':return 0x193;case _0xd6f0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xee144c){return function(_0x329f69){logger[_0xd6f0('0xa')](_0x329f69['stack']);var _0x1ce8d5=getStatusCode(_0x329f69[_0xd6f0('0x3')]);if(_0x329f69[_0xd6f0('0x3')])delete _0x329f69[_0xd6f0('0x3')];return _0xee144c[_0xd6f0('0xb')](_0x1ce8d5)[_0xd6f0('0xc')](_0x329f69);};}module[_0xd6f0('0xd')]={'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 9788aad..6cf2ffc 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe79=['send','404','status'];(function(_0x286c0e,_0x40329e){var _0x3e1c87=function(_0x41e6ec){while(--_0x41e6ec){_0x286c0e['push'](_0x286c0e['shift']());}};_0x3e1c87(++_0x40329e);}(_0xfe79,0x160));var _0x9fe7=function(_0x2bfc60,_0xa254ab){_0x2bfc60=_0x2bfc60-0x0;var _0x44ea2c=_0xfe79[_0x2bfc60];return _0x44ea2c;};'use strict';module['exports'][0x194]=function pageNotFound(_0x25960f,_0x17782b){var _0x582bd1=_0x9fe7('0x0');var _0x494aaf=0x194;var _0x21585c={'status':_0x494aaf};_0x17782b[_0x9fe7('0x1')](_0x21585c[_0x9fe7('0x1')]);_0x17782b['render'](_0x582bd1,{},function(_0x2da23d,_0x1963e6){if(_0x2da23d){return _0x17782b[_0x9fe7('0x1')](_0x21585c['status'])['json'](_0x21585c);}_0x17782b[_0x9fe7('0x2')](_0x1963e6);});}; \ No newline at end of file +var _0xe0db=['404','status','render','json','send','exports'];(function(_0xf8cafb,_0x416d92){var _0x5c3f5e=function(_0x3931d1){while(--_0x3931d1){_0xf8cafb['push'](_0xf8cafb['shift']());}};_0x5c3f5e(++_0x416d92);}(_0xe0db,0x65));var _0xbe0d=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xe0db[_0x455c6c];return _0x488242;};'use strict';module[_0xbe0d('0x0')][0x194]=function pageNotFound(_0x4a72a1,_0x30a792){var _0x2b2c07=_0xbe0d('0x1');var _0x167fe6=0x194;var _0x3a6e14={'status':_0x167fe6};_0x30a792[_0xbe0d('0x2')](_0x3a6e14['status']);_0x30a792[_0xbe0d('0x3')](_0x2b2c07,{},function(_0x2d2886,_0x472d15){if(_0x2d2886){return _0x30a792[_0xbe0d('0x2')](_0x3a6e14['status'])[_0xbe0d('0x4')](_0x3a6e14);}_0x30a792[_0xbe0d('0x5')](_0x472d15);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2332335..20d915a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2a0=['FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatInternalMessage','JscriptyAnswerReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','VoiceMail','User','userSetting','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','CmList','Lists','user_has_teams','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','ScreenRecording','Messages','mailboxuser','mailbox','uniqueid','ContactId','MailAccount','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Dispositions','Answers','Applications','List','TemplateId','team_has_mail_queues','MailInteractionId','Contact','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','ListId','Items','FaxAccountId','Interactions','Exntensions','Pause','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','Contacts','Phones','CmContactId','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','OwnerId','OneAll','AutomationAllId','Any','AutomationAnyId','Action','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','Condition','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Variable','VariableId','Descriptions','Field','DeskField','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskField','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','Dynamics365Configuration','FreshsalesConfiguration','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','JscriptyProject','ProjectId','team_has_chat_queues','team_has_fax_queues','SmsQueues','team_has_whatsapp_queues','CampaignId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','cm_user_has_lists','userProfileId','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','sequelizeHistory','motion2','xcall','utf8','utf8_general_ci','database','username','password','options','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserFaxQueue','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model'];(function(_0x22e194,_0x38a24f){var _0x12d486=function(_0x237548){while(--_0x237548){_0x22e194['push'](_0x22e194['shift']());}};_0x12d486(++_0x38a24f);}(_0xc2a0,0x1b7));var _0x0c2a=function(_0x26154e,_0x4fdc63){_0x26154e=_0x26154e-0x0;var _0x1ba4cc=_0xc2a0[_0x26154e];return _0x1ba4cc;};'use strict';var config=require(_0x0c2a('0x0'));var Sequelize=require('sequelize');var _=require(_0x0c2a('0x1'));var jstz=require(_0x0c2a('0x2'));var timezone=jstz[_0x0c2a('0x3')]();config[_0x0c2a('0x4')]=_[_0x0c2a('0x5')](config[_0x0c2a('0x4')],{'database':'motion2','username':'xcall','password':_0x0c2a('0x6'),'options':{'host':_0x0c2a('0x7'),'port':0xcea,'dialect':_0x0c2a('0x8'),'dialectOptions':{'charset':_0x0c2a('0x9')},'logging':![],'timezone':timezone[_0x0c2a('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x0c2a('0xb')]=_[_0x0c2a('0x5')](config[_0x0c2a('0xb')],{'database':_0x0c2a('0xc'),'username':_0x0c2a('0xd'),'password':_0x0c2a('0x6'),'options':{'host':_0x0c2a('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0c2a('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x0c2a('0xe'),'collate':_0x0c2a('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0c2a('0x4')][_0x0c2a('0x10')],config[_0x0c2a('0x4')][_0x0c2a('0x11')],config['sequelize'][_0x0c2a('0x12')],config[_0x0c2a('0x4')][_0x0c2a('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0c2a('0xb')][_0x0c2a('0x10')],config[_0x0c2a('0xb')]['username'],config['sequelizeHistory'][_0x0c2a('0x12')],config[_0x0c2a('0xb')]['options'])};db['User']=db['sequelize'][_0x0c2a('0x14')]('../api/user/user.model');db[_0x0c2a('0x15')]=db[_0x0c2a('0x4')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x16'));db[_0x0c2a('0x17')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x18'));db[_0x0c2a('0x19')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x1a'));db[_0x0c2a('0x1b')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x1c'));db[_0x0c2a('0x1d')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x1e'));db['ScreenRecording']=db['sequelize'][_0x0c2a('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x1f'));db[_0x0c2a('0x20')]=db['sequelize']['import'](_0x0c2a('0x21'));db[_0x0c2a('0x22')]=db['sequelize'][_0x0c2a('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x0c2a('0x23')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x24'));db[_0x0c2a('0x25')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x26'));db['VoiceQueueReport']=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x27'));db['MemberReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/memberReport/memberReport.model');db[_0x0c2a('0x28')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x29'));db[_0x0c2a('0x2a')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x2b'));db[_0x0c2a('0x2c')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x2d'));db[_0x0c2a('0x2e')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x2f'));db['UserChatQueue']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x0c2a('0x4')]['import']('../api/userMailQueue/userMailQueue.model');db[_0x0c2a('0x30')]=db[_0x0c2a('0x4')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x0c2a('0x31')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x32'));db[_0x0c2a('0x33')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x34'));db[_0x0c2a('0x35')]=db['sequelize'][_0x0c2a('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x0c2a('0x36')]=db['sequelize']['import'](_0x0c2a('0x37'));db['MailAccount']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x38'));db[_0x0c2a('0x39')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x3a'));db[_0x0c2a('0x3b')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x3c'));db[_0x0c2a('0x3d')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x3e'));db[_0x0c2a('0x3f')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x40'));db[_0x0c2a('0x41')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x42'));db[_0x0c2a('0x43')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x44'));db[_0x0c2a('0x45')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x46'));db[_0x0c2a('0x47')]=db[_0x0c2a('0x4')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x0c2a('0x48')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x49'));db[_0x0c2a('0x4a')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x4b'));db[_0x0c2a('0x4c')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x4d'));db[_0x0c2a('0x4e')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/faxMessage/faxMessage.model');db[_0x0c2a('0x4f')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x50'));db[_0x0c2a('0x51')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x0c2a('0x52')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x53'));db[_0x0c2a('0x54')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x55'));db[_0x0c2a('0x56')]=db[_0x0c2a('0x4')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x0c2a('0x57')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x58'));db[_0x0c2a('0x59')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x5a'));db['OpenchannelAccount']=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x5b'));db[_0x0c2a('0x5c')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x5d'));db[_0x0c2a('0x5e')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x5f'));db[_0x0c2a('0x60')]=db['sequelize']['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x61'));db[_0x0c2a('0x62')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x63'));db[_0x0c2a('0x64')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/chatApplication/chatApplication.model');db[_0x0c2a('0x65')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x66'));db[_0x0c2a('0x67')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x68'));db['ChatOfflineMessage']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x69'));db[_0x0c2a('0x6a')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x6b'));db[_0x0c2a('0x6c')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x6d'));db[_0x0c2a('0x6e')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x6f'));db[_0x0c2a('0x70')]=db['sequelize']['import'](_0x0c2a('0x71'));db[_0x0c2a('0x72')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/cmContact/cmContact.model');db[_0x0c2a('0x73')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x74'));db[_0x0c2a('0x75')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x76'));db[_0x0c2a('0x77')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x0c2a('0x78')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x79'));db['ReportAgentPreview']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x7a'));db['CmCustomField']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x7b'));db['Action']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x7c'));db[_0x0c2a('0x7d')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/automation/automation.model');db[_0x0c2a('0x7e')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x7f'));db[_0x0c2a('0x80')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/disposition/disposition.model');db['Condition']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x81'));db[_0x0c2a('0x82')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x83'));db['Pause']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x84'));db['Cdr']=db['sequelize'][_0x0c2a('0x14')]('../api/cdr/cdr.model');db[_0x0c2a('0x85')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x86'));db[_0x0c2a('0x87')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x88'));db[_0x0c2a('0x89')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x8a'));db[_0x0c2a('0x8b')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x8c'));db[_0x0c2a('0x8d')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x8e'));db[_0x0c2a('0x8f')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x90'));db['CmHopperAdditionalPhone']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x91'));db['Template']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x92'));db[_0x0c2a('0x93')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x94'));db['Variable']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x95'));db[_0x0c2a('0x96')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x97'));db['IntegrationReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x98'));db[_0x0c2a('0x99')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x9a'));db[_0x0c2a('0x9b')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x9c'));db['AnalyticExtractedReport']=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x9d'));db[_0x0c2a('0x9e')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x9f'));db[_0x0c2a('0xa0')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xa1'));db[_0x0c2a('0xa2')]=db['sequelize']['import'](_0x0c2a('0xa3'));db[_0x0c2a('0xa4')]=db['sequelize'][_0x0c2a('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xa5'));db[_0x0c2a('0xa6')]=db['sequelize']['import'](_0x0c2a('0xa7'));db[_0x0c2a('0xa8')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xa9'));db[_0x0c2a('0xaa')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xab'));db[_0x0c2a('0xac')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xad'));db[_0x0c2a('0xae')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xaf'));db[_0x0c2a('0xb0')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xb1'));db['DeskField']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xb2'));db[_0x0c2a('0xb3')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xb4'));db[_0x0c2a('0xb5')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xb6'));db[_0x0c2a('0xb7')]=db['sequelize']['import'](_0x0c2a('0xb8'));db['ZendeskField']=db[_0x0c2a('0x4')]['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xb9'));db['FreshdeskConfiguration']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xba'));db[_0x0c2a('0xbb')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xbc'));db[_0x0c2a('0xbd')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xbe'));db[_0x0c2a('0xbf')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xc0'));db['VtigerField']=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xc1'));db[_0x0c2a('0xc2')]=db['sequelize']['import'](_0x0c2a('0xc3'));db['ServicenowConfiguration']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xc4'));db[_0x0c2a('0xc5')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0x0c2a('0xc6')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xc7'));db['Dynamics365Configuration']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xc8'));db[_0x0c2a('0xc9')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xca'));db['FreshsalesAccount']=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xcb'));db['FreshsalesConfiguration']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xcc'));db[_0x0c2a('0xcd')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xce'));db['Integration']=db['sequelize']['import'](_0x0c2a('0x97'));db['Network']=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xcf'));db['ChatQueueReport']=db['sequelize'][_0x0c2a('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x0c2a('0xd0')]=db['sequelize'][_0x0c2a('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0c2a('0xd1')]=db['sequelize'][_0x0c2a('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0x0c2a('0x4')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db['sequelize'][_0x0c2a('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xd2'));db[_0x0c2a('0xd3')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/squareReport/squareReport.model');db[_0x0c2a('0xd4')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xd5'));db['JscriptyProject']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xd6'));db[_0x0c2a('0xd7')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xd8'));db[_0x0c2a('0xd9')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xda'));db[_0x0c2a('0xdb')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xdc'));db[_0x0c2a('0xdd')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xde'));db[_0x0c2a('0xdf')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xe0'));db[_0x0c2a('0xe1')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xe2'));db[_0x0c2a('0xe3')]=db[_0x0c2a('0x4')]['import']('../api/campaign/campaign.model');db[_0x0c2a('0xe4')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xe5'));db[_0x0c2a('0xe6')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xe7'));db[_0x0c2a('0xe8')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xe9'));db['MailTransferReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xea'));db[_0x0c2a('0xeb')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xec'));db[_0x0c2a('0xed')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xee'));db['SmsTransferReport']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/cmList/cmList.model');db[_0x0c2a('0xef')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xf0'));db[_0x0c2a('0xf1')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xf2'));db[_0x0c2a('0xf3')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xf4'));db[_0x0c2a('0xf5')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xf6'));db[_0x0c2a('0xf7')]=db[_0x0c2a('0x4')]['import']('../api/userNotification/userNotification.model');db[_0x0c2a('0xf8')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0xf9'));db[_0x0c2a('0xfa')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0xfb'));db[_0x0c2a('0xfc')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xfd'));db[_0x0c2a('0xfe')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0xff'));db[_0x0c2a('0x100')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x101'));db[_0x0c2a('0x102')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x103'));db[_0x0c2a('0x104')]=db[_0x0c2a('0x4')]['import'](_0x0c2a('0x105'));db[_0x0c2a('0x106')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x107'));db[_0x0c2a('0x108')]=db['sequelize'][_0x0c2a('0x14')](_0x0c2a('0x109'));db[_0x0c2a('0x10a')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x0c2a('0x10b')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')](_0x0c2a('0x10c'));db[_0x0c2a('0x10d')]=db[_0x0c2a('0x4')][_0x0c2a('0x14')]('../api/user-setting/user-setting.model');db['User'][_0x0c2a('0x10e')](db['VoiceMail'],{'as':_0x0c2a('0x10f'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x0c2a('0x110')][_0x0c2a('0x10e')](db[_0x0c2a('0x10d')],{'as':_0x0c2a('0x111'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x1d')],{'as':_0x0c2a('0x115'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')]['hasMany'](db[_0x0c2a('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x17')],{'as':_0x0c2a('0x116'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db[_0x0c2a('0x110')]['hasMany'](db[_0x0c2a('0x77')],{'as':_0x0c2a('0x117'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x78')],{'as':_0x0c2a('0x118'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x119')],{'as':_0x0c2a('0x119'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x5c')],{'as':_0x0c2a('0x11a'),'foreignKey':'UserId'});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db[_0x0c2a('0x65')],{'as':_0x0c2a('0x11b'),'foreignKey':'UserId'});db['User'][_0x0c2a('0x114')](db[_0x0c2a('0x56')],{'as':_0x0c2a('0x11c'),'foreignKey':_0x0c2a('0x113')});db['User']['hasMany'](db[_0x0c2a('0x4c')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0x0c2a('0x3d')],{'as':_0x0c2a('0x11d'),'foreignKey':_0x0c2a('0x113')});db['User'][_0x0c2a('0x114')](db[_0x0c2a('0xfc')],{'as':_0x0c2a('0x11e'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x110')][_0x0c2a('0x114')](db['UserNotification'],{'as':_0x0c2a('0x11f'),'foreignKey':_0x0c2a('0x120')});db[_0x0c2a('0x110')][_0x0c2a('0x121')](db[_0x0c2a('0xf1')],{'as':_0x0c2a('0xf1'),'foreignKey':'userProfileId'});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x6c')],{'as':_0x0c2a('0x123'),'through':_0x0c2a('0x124')});db['User'][_0x0c2a('0x122')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x126'),'through':'cm_user_has_lists'});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0xdf')],{'through':_0x0c2a('0x127')});db['User'][_0x0c2a('0x122')](db['MailInteraction'],{'as':_0x0c2a('0x11d'),'through':'user_has_mail_interactions'});db['User'][_0x0c2a('0x122')](db[_0x0c2a('0x65')],{'as':_0x0c2a('0x11b'),'through':_0x0c2a('0x128')});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x4c')],{'as':_0x0c2a('0x129'),'through':_0x0c2a('0x12a')});db['User']['belongsToMany'](db[_0x0c2a('0x56')],{'as':'SmsInteractions','through':_0x0c2a('0x12b')});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x5c')],{'as':'OpenchannelInteractions','through':_0x0c2a('0x12c')});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db['WhatsappInteraction'],{'as':_0x0c2a('0x11e'),'through':_0x0c2a('0x12d')});db['User']['belongsToMany'](db[_0x0c2a('0x1b')],{'as':'VoiceQueues','through':_0x0c2a('0x2e'),'required':![]});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0xef')],{'as':'VoicePrefixes','through':_0x0c2a('0x10b'),'required':![]});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x39')],{'as':_0x0c2a('0x12e'),'through':_0x0c2a('0x12f'),'required':![]});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x6a')],{'as':_0x0c2a('0x130'),'through':_0x0c2a('0x131'),'required':![],'hooks':!![]});db['User'][_0x0c2a('0x122')](db[_0x0c2a('0x4f')],{'as':_0x0c2a('0x132'),'through':_0x0c2a('0x30'),'required':![]});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db['SmsQueue'],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x60')],{'as':'OpenchannelQueues','through':_0x0c2a('0x133'),'required':![]});db[_0x0c2a('0x110')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x0c2a('0x134'),'through':'UserWhatsappQueue','required':![]});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x125')],{'through':'cm_user_has_lists'});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0x135')],{'as':_0x0c2a('0x136'),'through':'user_has_chat_websites'});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db[_0x0c2a('0x48')],{'as':_0x0c2a('0x137'),'through':_0x0c2a('0x138')});db[_0x0c2a('0x110')][_0x0c2a('0x122')](db['MailAccount'],{'as':'MailAccounts','through':_0x0c2a('0x139')});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0x13a')],{'as':_0x0c2a('0x13b'),'through':_0x0c2a('0x13c')});db[_0x0c2a('0x110')]['belongsToMany'](db[_0x0c2a('0x52')],{'as':_0x0c2a('0x13d'),'through':_0x0c2a('0x13e')});db['User']['belongsToMany'](db[_0x0c2a('0xf8')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x0c2a('0x15')][_0x0c2a('0x114')](db[_0x0c2a('0x17')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x0c2a('0x13f')});db[_0x0c2a('0x140')][_0x0c2a('0x114')](db[_0x0c2a('0x17')],{'onDelete':_0x0c2a('0x112')});db['VoiceExtension'][_0x0c2a('0x114')](db['VoiceExtension'],{'as':'Applications','onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x19')][_0x0c2a('0x122')](db[_0x0c2a('0x89')],{'as':_0x0c2a('0x141'),'through':_0x0c2a('0x142')});db['VoiceQueue'][_0x0c2a('0x114')](db['UserVoiceQueueRt'],{'as':_0x0c2a('0x143'),'foreignKey':_0x0c2a('0x144')});db['VoiceQueue']['hasMany'](db[_0x0c2a('0x73')],{'as':_0x0c2a('0x145'),'foreignKey':_0x0c2a('0x144')});db[_0x0c2a('0x1b')][_0x0c2a('0x114')](db['CmHopperFinal'],{'as':_0x0c2a('0x117'),'foreignKey':_0x0c2a('0x144')});db[_0x0c2a('0x1b')][_0x0c2a('0x114')](db[_0x0c2a('0x78')],{'as':_0x0c2a('0x146'),'foreignKey':_0x0c2a('0x144')});db[_0x0c2a('0x1b')]['hasMany'](db[_0x0c2a('0x119')],{'as':_0x0c2a('0x119'),'foreignKey':_0x0c2a('0x144')});db['VoiceQueue']['hasMany'](db[_0x0c2a('0x75')],{'as':_0x0c2a('0x147'),'foreignKey':_0x0c2a('0x144')});db[_0x0c2a('0x1b')]['hasMany'](db[_0x0c2a('0x148')],{'as':_0x0c2a('0x149'),'foreignKey':_0x0c2a('0x144')});db[_0x0c2a('0x1b')][_0x0c2a('0x121')](db[_0x0c2a('0x28')],{'as':_0x0c2a('0x28'),'foreignKey':_0x0c2a('0x14a')});db[_0x0c2a('0x1b')][_0x0c2a('0x121')](db[_0x0c2a('0x28')],{'as':_0x0c2a('0x14b'),'foreignKey':'TrunkBackupId'});db[_0x0c2a('0x1b')]['belongsTo'](db['Interval'],{'as':_0x0c2a('0x82'),'foreignKey':_0x0c2a('0x14c')});db[_0x0c2a('0x1b')][_0x0c2a('0x121')](db['Pause'],{'as':_0x0c2a('0x14d'),'foreignKey':_0x0c2a('0x14e')});db[_0x0c2a('0x1b')][_0x0c2a('0x122')](db[_0x0c2a('0x125')],{'as':'Lists','through':_0x0c2a('0x14f')});db['VoiceQueue'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x2e')});db[_0x0c2a('0x1b')][_0x0c2a('0x122')](db['Team'],{'as':_0x0c2a('0x151'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x0c2a('0x122')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x152'),'through':'voice_queues_has_cm_blacklists'});db[_0x0c2a('0x1d')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':'User','foreignKey':'UserId'});db[_0x0c2a('0x153')][_0x0c2a('0x121')](db['User'],{'as':_0x0c2a('0x110'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x10f')][_0x0c2a('0x114')](db[_0x0c2a('0x20')],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x155'),'sourceKey':_0x0c2a('0x156')});db[_0x0c2a('0x20')][_0x0c2a('0x121')](db[_0x0c2a('0x10f')],{'foreignKey':_0x0c2a('0x155'),'targetKey':_0x0c2a('0x156')});db[_0x0c2a('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x0c2a('0x157'),'constraints':![]});db[_0x0c2a('0x22')][_0x0c2a('0x114')](db[_0x0c2a('0x25')],{'as':'AgentReports','foreignKey':_0x0c2a('0x157'),'constraints':![]});db[_0x0c2a('0x22')][_0x0c2a('0x121')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x0c2a('0x22')][_0x0c2a('0x121')](db['CmContact'],{'as':'Contact','foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x35')][_0x0c2a('0x121')](db[_0x0c2a('0x159')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['MailServerIn'][_0x0c2a('0x121')](db['CloudProvider'],{'as':_0x0c2a('0x106'),'foreignKey':_0x0c2a('0x15a'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x36')]['belongsTo'](db[_0x0c2a('0x159')],{'as':_0x0c2a('0x159'),'foreignKey':_0x0c2a('0x15c')});db[_0x0c2a('0x36')][_0x0c2a('0x121')](db[_0x0c2a('0x106')],{'as':_0x0c2a('0x106'),'foreignKey':_0x0c2a('0x15a'),'onDelete':'restrict'});db['MailAccount'][_0x0c2a('0x10e')](db['MailServerIn'],{'as':_0x0c2a('0x15d'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x159')][_0x0c2a('0x10e')](db['MailServerOut'],{'as':_0x0c2a('0x15e'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x159')][_0x0c2a('0x114')](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x15c'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x159')][_0x0c2a('0x114')](db[_0x0c2a('0x7e')],{'as':_0x0c2a('0x160'),'foreignKey':_0x0c2a('0x15c')});db[_0x0c2a('0x159')]['hasMany'](db[_0x0c2a('0x3f')],{'as':_0x0c2a('0x154'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x3d')],{'as':'Interactions'});db['MailAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x41')],{'as':_0x0c2a('0x161')});db[_0x0c2a('0x159')][_0x0c2a('0x121')](db['CmList'],{'as':_0x0c2a('0x162'),'foreignKey':'ListId'});db['MailAccount']['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0x0c2a('0x163')});db[_0x0c2a('0x159')][_0x0c2a('0x121')](db['Pause'],{'as':_0x0c2a('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x139')});db['MailQueue'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x12f')});db['MailQueue'][_0x0c2a('0x122')](db[_0x0c2a('0xdf')],{'through':_0x0c2a('0x164'),'as':_0x0c2a('0x151')});db[_0x0c2a('0x3d')][_0x0c2a('0x114')](db[_0x0c2a('0x3f')],{'as':'Messages','onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x165')});db[_0x0c2a('0x3d')][_0x0c2a('0x121')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0x0c2a('0x3d')][_0x0c2a('0x121')](db['CmContact'],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db['MailInteraction'][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x167'),'foreignKey':'UserId'});db[_0x0c2a('0x3d')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':'mail_interaction_has_tags','as':_0x0c2a('0x168')});db[_0x0c2a('0x3d')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x169'),'as':_0x0c2a('0x16a')});db[_0x0c2a('0x3d')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x16b'),'through':_0x0c2a('0x16c'),'foreignKey':'MailInteractionId'});db[_0x0c2a('0x3f')][_0x0c2a('0x114')](db[_0x0c2a('0xe6')],{'as':_0x0c2a('0x16d'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x3f')]['belongsTo'](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x110')});db['MailMessage'][_0x0c2a('0x121')](db['CmContact'],{'onDelete':'cascade','as':_0x0c2a('0x166')});db['MailMessage'][_0x0c2a('0x121')](db[_0x0c2a('0x3d')],{'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x165')});db[_0x0c2a('0x3f')][_0x0c2a('0x121')](db[_0x0c2a('0x159')],{'as':_0x0c2a('0x16f'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x0c2a('0x121')](db[_0x0c2a('0x135')],{'as':_0x0c2a('0x135'),'foreignKey':_0x0c2a('0x170')});db[_0x0c2a('0x3f')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x0c2a('0x171'),'foreignKey':_0x0c2a('0x172')});db[_0x0c2a('0x41')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':'restrict'});db['MailApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x39')],{'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x41')]['belongsTo'](db[_0x0c2a('0x159')],{'onDelete':'restrict'});db['MailApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x82')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x14c')});db[_0x0c2a('0x41')][_0x0c2a('0x121')](db[_0x0c2a('0x8b')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x173')});db[_0x0c2a('0x43')][_0x0c2a('0x121')](db['MailAccount'],{});db[_0x0c2a('0x43')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x43')]['belongsTo'](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x43')][_0x0c2a('0x121')](db['MailInteraction'],{});db[_0x0c2a('0x43')]['belongsTo'](db[_0x0c2a('0x3f')],{});db[_0x0c2a('0x43')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{});db[_0x0c2a('0x43')]['belongsTo'](db[_0x0c2a('0x39')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0x0c2a('0x175'),'onDelete':'cascade'});db[_0x0c2a('0x48')][_0x0c2a('0x114')](db['Disposition'],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x176'),'onDelete':_0x0c2a('0x112')});db['FaxAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x7e')],{'as':_0x0c2a('0x160'),'foreignKey':_0x0c2a('0x176')});db[_0x0c2a('0x48')][_0x0c2a('0x114')](db[_0x0c2a('0x4c')],{'as':_0x0c2a('0x177')});db['FaxAccount'][_0x0c2a('0x114')](db['FaxApplication'],{'as':_0x0c2a('0x161')});db[_0x0c2a('0x48')][_0x0c2a('0x114')](db[_0x0c2a('0x17')],{'as':_0x0c2a('0x178'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x48')][_0x0c2a('0x114')](db[_0x0c2a('0x4e')],{'as':_0x0c2a('0x154')});db[_0x0c2a('0x48')][_0x0c2a('0x121')](db[_0x0c2a('0x28')],{'as':'Trunk'});db[_0x0c2a('0x48')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x48')][_0x0c2a('0x121')](db[_0x0c2a('0x179')],{'as':_0x0c2a('0x14d'),'foreignKey':_0x0c2a('0x14e')});db[_0x0c2a('0x48')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x138')});db[_0x0c2a('0x4a')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x4a')][_0x0c2a('0x121')](db[_0x0c2a('0x4f')],{'onDelete':_0x0c2a('0x15b')});db['FaxApplication']['belongsTo'](db[_0x0c2a('0x48')],{'onDelete':'restrict'});db[_0x0c2a('0x4a')][_0x0c2a('0x121')](db[_0x0c2a('0x8b')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':'TagId'});db['FaxInteraction'][_0x0c2a('0x114')](db['FaxMessage'],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x17a')});db[_0x0c2a('0x4c')][_0x0c2a('0x121')](db[_0x0c2a('0x48')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x176')});db[_0x0c2a('0x4c')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':'ContactId'});db[_0x0c2a('0x4c')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x167'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x4c')]['belongsToMany'](db[_0x0c2a('0x8b')],{'through':'fax_interaction_has_tags','as':_0x0c2a('0x168')});db[_0x0c2a('0x4c')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x17b'),'as':_0x0c2a('0x16a')});db['FaxInteraction']['belongsToMany'](db[_0x0c2a('0x110')],{'as':'Users','through':_0x0c2a('0x12a'),'foreignKey':_0x0c2a('0x17a')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x0c2a('0x110')});db[_0x0c2a('0x4e')]['belongsTo'](db['FaxInteraction'],{'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x17a')});db[_0x0c2a('0x4e')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'onDelete':'cascade','as':_0x0c2a('0x166')});db[_0x0c2a('0x4e')][_0x0c2a('0x121')](db[_0x0c2a('0xe6')],{'as':_0x0c2a('0xe6'),'foreignKey':_0x0c2a('0x17c')});db[_0x0c2a('0x4e')][_0x0c2a('0x121')](db[_0x0c2a('0x48')],{'as':_0x0c2a('0x16f'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':'UserFaxQueue'});db['FaxQueue'][_0x0c2a('0x122')](db[_0x0c2a('0xdf')],{'through':'team_has_fax_queues','as':_0x0c2a('0x151')});db[_0x0c2a('0x51')]['belongsTo'](db[_0x0c2a('0x48')],{});db[_0x0c2a('0x51')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x51')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':'ContactId'});db[_0x0c2a('0x51')][_0x0c2a('0x121')](db[_0x0c2a('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['FaxMessage'],{});db[_0x0c2a('0x51')]['belongsTo'](db[_0x0c2a('0x110')],{});db[_0x0c2a('0x51')]['belongsTo'](db[_0x0c2a('0x4f')],{});db[_0x0c2a('0x52')][_0x0c2a('0x114')](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x17d'),'onDelete':_0x0c2a('0x112')});db['SmsAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x7e')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x0c2a('0x57')],{'as':'Messages','foreignKey':_0x0c2a('0x17d')});db[_0x0c2a('0x52')][_0x0c2a('0x114')](db[_0x0c2a('0x56')],{'as':_0x0c2a('0x177')});db[_0x0c2a('0x52')]['hasMany'](db[_0x0c2a('0x54')],{'as':_0x0c2a('0x161')});db[_0x0c2a('0x52')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db['SmsAccount'][_0x0c2a('0x121')](db[_0x0c2a('0x179')],{'as':_0x0c2a('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0c2a('0x52')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x13e')});db[_0x0c2a('0x54')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':'restrict'});db[_0x0c2a('0x54')][_0x0c2a('0x121')](db[_0x0c2a('0x59')],{'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x54')][_0x0c2a('0x121')](db[_0x0c2a('0x52')],{'onDelete':'restrict'});db[_0x0c2a('0x54')][_0x0c2a('0x121')](db[_0x0c2a('0x82')],{'onDelete':'restrict','foreignKey':_0x0c2a('0x14c')});db['SmsApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x8b')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x173')});db['SmsInteraction'][_0x0c2a('0x114')](db[_0x0c2a('0x57')],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x17e')});db[_0x0c2a('0x56')]['belongsTo'](db[_0x0c2a('0x52')],{'as':'Account','foreignKey':_0x0c2a('0x17d')});db[_0x0c2a('0x56')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':'ContactId'});db[_0x0c2a('0x56')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x167'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x56')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':'sms_interaction_has_tags','as':_0x0c2a('0x168')});db[_0x0c2a('0x56')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x17f'),'as':'ThroughTags'});db[_0x0c2a('0x56')]['belongsToMany'](db['User'],{'as':_0x0c2a('0x16b'),'through':_0x0c2a('0x12b'),'foreignKey':_0x0c2a('0x17e')});db[_0x0c2a('0x57')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':'User'});db[_0x0c2a('0x57')][_0x0c2a('0x121')](db['CmContact'],{'onDelete':'cascade','as':_0x0c2a('0x166')});db[_0x0c2a('0x57')][_0x0c2a('0x121')](db['SmsInteraction'],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x17e')});db[_0x0c2a('0x57')][_0x0c2a('0x121')](db[_0x0c2a('0x52')],{'as':'Account','foreignKey':_0x0c2a('0x17d')});db[_0x0c2a('0x59')]['belongsToMany'](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x31'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x0c2a('0x122')](db['Team'],{'through':_0x0c2a('0x180'),'as':_0x0c2a('0x151')});db['OpenchannelAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x181'),'onDelete':_0x0c2a('0x112')});db['OpenchannelAccount'][_0x0c2a('0x114')](db[_0x0c2a('0x7e')],{'as':_0x0c2a('0x160'),'foreignKey':_0x0c2a('0x181')});db['OpenchannelAccount']['hasMany'](db[_0x0c2a('0x5c')],{'as':_0x0c2a('0x177'),'foreignKey':_0x0c2a('0x181')});db['OpenchannelAccount']['hasMany'](db[_0x0c2a('0x5e')],{'as':_0x0c2a('0x154'),'foreignKey':_0x0c2a('0x181')});db[_0x0c2a('0x13a')][_0x0c2a('0x114')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x0c2a('0x181')});db[_0x0c2a('0x13a')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':'List','foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x13a')][_0x0c2a('0x121')](db['Pause'],{'as':_0x0c2a('0x14d'),'foreignKey':_0x0c2a('0x14e')});db['OpenchannelAccount'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':'user_has_openchannel_accounts'});db[_0x0c2a('0x182')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x15b')});db['OpenchannelApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x60')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':'OpenchannelQueueId'});db[_0x0c2a('0x182')][_0x0c2a('0x121')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x0c2a('0x181')});db['OpenchannelApplication'][_0x0c2a('0x121')](db['Interval'],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x14c')});db['OpenchannelApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x8b')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':'TagId'});db[_0x0c2a('0x5c')][_0x0c2a('0x114')](db['OpenchannelMessage'],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x183')});db[_0x0c2a('0x5c')][_0x0c2a('0x121')](db['OpenchannelAccount'],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x181')});db['OpenchannelInteraction'][_0x0c2a('0x121')](db['CmContact'],{'as':'Contact','foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x5c')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x167'),'foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x5c')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0x0c2a('0x168')});db['OpenchannelInteraction'][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x184'),'as':_0x0c2a('0x16a')});db[_0x0c2a('0x5c')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x16b'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x0c2a('0x5e')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x112'),'as':'User'});db[_0x0c2a('0x5e')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'onDelete':'cascade','as':'Contact'});db[_0x0c2a('0x5e')][_0x0c2a('0x121')](db[_0x0c2a('0x5c')],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x183')});db[_0x0c2a('0x5e')]['belongsTo'](db[_0x0c2a('0xe6')],{'as':'Attachment','foreignKey':_0x0c2a('0x17c')});db['OpenchannelMessage']['belongsTo'](db[_0x0c2a('0x13a')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x181')});db[_0x0c2a('0x60')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x133'),'foreignKey':_0x0c2a('0x185')});db['OpenchannelQueue'][_0x0c2a('0x122')](db[_0x0c2a('0xdf')],{'through':_0x0c2a('0x186'),'as':_0x0c2a('0x151')});db[_0x0c2a('0x135')][_0x0c2a('0x114')](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x170'),'onDelete':'cascade'});db[_0x0c2a('0x135')][_0x0c2a('0x114')](db[_0x0c2a('0x7e')],{'as':_0x0c2a('0x160'),'foreignKey':_0x0c2a('0x170')});db[_0x0c2a('0x135')][_0x0c2a('0x114')](db[_0x0c2a('0x6e')],{'as':_0x0c2a('0x187')});db[_0x0c2a('0x135')][_0x0c2a('0x114')](db[_0x0c2a('0x65')],{'as':_0x0c2a('0x177')});db['ChatWebsite'][_0x0c2a('0x114')](db[_0x0c2a('0x64')],{'as':_0x0c2a('0x161')});db[_0x0c2a('0x135')][_0x0c2a('0x114')](db[_0x0c2a('0x67')],{'as':_0x0c2a('0x154')});db[_0x0c2a('0x135')][_0x0c2a('0x121')](db['CmList'],{'as':_0x0c2a('0x162'),'foreignKey':'ListId'});db[_0x0c2a('0x135')][_0x0c2a('0x121')](db[_0x0c2a('0x82')],{'as':_0x0c2a('0x82'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x0c2a('0x121')](db[_0x0c2a('0x159')],{'as':_0x0c2a('0x159'),'foreignKey':_0x0c2a('0x15c')});db[_0x0c2a('0x135')][_0x0c2a('0x121')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0c2a('0x14e')});db['ChatWebsite'][_0x0c2a('0x122')](db['User'],{'as':'Agents','through':_0x0c2a('0x188')});db[_0x0c2a('0x62')][_0x0c2a('0x121')](db[_0x0c2a('0x13a')],{});db[_0x0c2a('0x62')][_0x0c2a('0x121')](db['CmList'],{'as':'List','foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x62')]['belongsTo'](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x62')][_0x0c2a('0x121')](db[_0x0c2a('0x5c')],{});db[_0x0c2a('0x62')][_0x0c2a('0x121')](db[_0x0c2a('0x5e')],{});db[_0x0c2a('0x62')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{});db[_0x0c2a('0x62')]['belongsTo'](db[_0x0c2a('0x60')],{});db[_0x0c2a('0x64')]['belongsTo'](db['User'],{'as':_0x0c2a('0x189'),'foreignKey':'UserId','onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x64')][_0x0c2a('0x121')](db['ChatQueue'],{'as':_0x0c2a('0x18a'),'foreignKey':_0x0c2a('0x18b'),'onDelete':'restrict'});db[_0x0c2a('0x64')]['belongsTo'](db[_0x0c2a('0x135')],{'as':_0x0c2a('0x18c'),'foreignKey':_0x0c2a('0x170'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x64')][_0x0c2a('0x121')](db[_0x0c2a('0x8b')],{'onDelete':'restrict','foreignKey':_0x0c2a('0x173')});db['ChatInteraction']['hasMany'](db[_0x0c2a('0x67')],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':'ChatInteractionId'});db[_0x0c2a('0x65')][_0x0c2a('0x121')](db['ChatWebsite'],{'as':_0x0c2a('0x16f'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x0c2a('0x121')](db['CmContact'],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db['ChatInteraction'][_0x0c2a('0x121')](db['User'],{'as':_0x0c2a('0x167'),'foreignKey':_0x0c2a('0x113')});db['ChatInteraction'][_0x0c2a('0x122')](db['Tag'],{'through':_0x0c2a('0x18d'),'as':_0x0c2a('0x168')});db[_0x0c2a('0x65')][_0x0c2a('0x122')](db['Tag'],{'through':_0x0c2a('0x18d'),'as':_0x0c2a('0x16a')});db[_0x0c2a('0x65')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x16b'),'through':_0x0c2a('0x128'),'foreignKey':_0x0c2a('0x18e')});db[_0x0c2a('0x67')]['belongsTo'](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x110')});db['ChatMessage'][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'onDelete':_0x0c2a('0x112'),'as':'Contact','foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x67')][_0x0c2a('0x121')](db[_0x0c2a('0x65')],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x18e')});db[_0x0c2a('0x67')][_0x0c2a('0x121')](db[_0x0c2a('0xe6')],{'as':'Attachment','foreignKey':_0x0c2a('0x17c')});db['ChatMessage']['belongsTo'](db[_0x0c2a('0x135')],{'as':'Account','foreignKey':_0x0c2a('0x170')});db[_0x0c2a('0x171')]['hasMany'](db['Attachment'],{'as':_0x0c2a('0x16d'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x0c2a('0x112'),'hooks':!![]});db[_0x0c2a('0x171')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x166'),'foreignKey':'ContactId'});db[_0x0c2a('0x171')][_0x0c2a('0x121')](db['ChatWebsite'],{'as':_0x0c2a('0x16f'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':'UserChatQueue','hooks':!![]});db[_0x0c2a('0x6a')][_0x0c2a('0x122')](db[_0x0c2a('0xdf')],{'through':'team_has_chat_queues','as':_0x0c2a('0x151')});db['ChatGroup'][_0x0c2a('0x114')](db[_0x0c2a('0xd0')],{'as':_0x0c2a('0x154'),'foreignKey':_0x0c2a('0x18f'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x6c')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x143'),'through':_0x0c2a('0x124')});db['ChatProactiveAction'][_0x0c2a('0x121')](db[_0x0c2a('0x135')],{'as':'Website','foreignKey':_0x0c2a('0x170')});db[_0x0c2a('0x70')][_0x0c2a('0x114')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x190'),'foreignKey':'CompanyId'});db[_0x0c2a('0x72')]['hasMany'](db[_0x0c2a('0x8f')],{'as':_0x0c2a('0x191'),'foreignKey':_0x0c2a('0x192')});db[_0x0c2a('0x72')]['hasMany'](db[_0x0c2a('0x73')],{'as':'Hoppers','foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db[_0x0c2a('0x77')],{'as':_0x0c2a('0x117'),'foreignKey':_0x0c2a('0x158')});db['CmContact'][_0x0c2a('0x114')](db[_0x0c2a('0x78')],{'as':_0x0c2a('0x146'),'foreignKey':'ContactId'});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db[_0x0c2a('0x148')],{'as':_0x0c2a('0x149'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x72')]['hasMany'](db[_0x0c2a('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0x0c2a('0x158'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db[_0x0c2a('0x65')],{'as':_0x0c2a('0x11b'),'foreignKey':_0x0c2a('0x158'),'onDelete':'restrict'});db['CmContact'][_0x0c2a('0x114')](db[_0x0c2a('0x56')],{'as':_0x0c2a('0x11c'),'foreignKey':_0x0c2a('0x158'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db[_0x0c2a('0x4c')],{'as':'FaxInteractions','foreignKey':_0x0c2a('0x158'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x72')][_0x0c2a('0x114')](db[_0x0c2a('0x3d')],{'as':_0x0c2a('0x11d'),'foreignKey':_0x0c2a('0x158'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x72')]['belongsTo'](db[_0x0c2a('0x70')],{'as':'Company','foreignKey':_0x0c2a('0x193')});db['CmContact'][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x0c2a('0x72')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x16b'),'through':_0x0c2a('0x194')});db[_0x0c2a('0x72')]['belongsToMany'](db['Tag'],{'as':_0x0c2a('0x168'),'through':_0x0c2a('0x195')});db[_0x0c2a('0x72')]['belongsToMany'](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x195'),'as':_0x0c2a('0x16a')});db[_0x0c2a('0x73')]['hasMany'](db[_0x0c2a('0x196')],{'as':_0x0c2a('0x197'),'foreignKey':_0x0c2a('0x198')});db[_0x0c2a('0x73')][_0x0c2a('0x121')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x0c2a('0x73')]['belongsTo'](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174'),'onDelete':'cascade'});db[_0x0c2a('0x73')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':'Agent','foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0x73')][_0x0c2a('0x121')](db[_0x0c2a('0x1b')],{'as':_0x0c2a('0x18a'),'foreignKey':_0x0c2a('0x144'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x73')]['belongsTo'](db['Campaign'],{'as':_0x0c2a('0xe3'),'foreignKey':'CampaignId','onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x73')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x167'),'foreignKey':_0x0c2a('0x199')});db[_0x0c2a('0x75')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158'),'onDelete':'cascade'});db[_0x0c2a('0x75')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x0c2a('0x174'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x75')][_0x0c2a('0x121')](db[_0x0c2a('0x1b')],{'as':_0x0c2a('0x18a'),'foreignKey':'VoiceQueueId','onDelete':_0x0c2a('0x112')});db['CmHopperBlack'][_0x0c2a('0x121')](db[_0x0c2a('0xe3')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x0c2a('0x112')});db['Automation'][_0x0c2a('0x114')](db['Condition'],{'as':{'plural':'All','singular':_0x0c2a('0x19a')},'foreignKey':_0x0c2a('0x19b'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db[_0x0c2a('0x7d')]['hasMany'](db['Condition'],{'as':{'plural':_0x0c2a('0x19c'),'singular':'OneAny'},'foreignKey':_0x0c2a('0x19d'),'onDelete':'cascade','hooks':!![]});db[_0x0c2a('0x7d')][_0x0c2a('0x114')](db[_0x0c2a('0x19e')],{'as':'Actions','foreignKey':_0x0c2a('0x19f'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db['Disposition']['hasMany'](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x1a0'),'onDelete':'cascade'});db['Interval'][_0x0c2a('0x114')](db[_0x0c2a('0x82')],{'as':'Intervals','foreignKey':_0x0c2a('0x14c'),'onDelete':_0x0c2a('0x112'),'hooks':!![],'required':![]});db[_0x0c2a('0x82')]['hasMany'](db[_0x0c2a('0x17')],{'as':_0x0c2a('0x116'),'foreignKey':_0x0c2a('0x14c'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x82')][_0x0c2a('0x114')](db[_0x0c2a('0x41')],{'as':_0x0c2a('0x1a1'),'foreignKey':'IntervalId'});db[_0x0c2a('0x82')][_0x0c2a('0x114')](db[_0x0c2a('0x64')],{'as':_0x0c2a('0x1a2'),'foreignKey':_0x0c2a('0x14c')});db[_0x0c2a('0x82')]['hasMany'](db['FaxApplication'],{'as':_0x0c2a('0x1a3'),'foreignKey':_0x0c2a('0x14c')});db['Interval']['hasMany'](db[_0x0c2a('0x54')],{'as':_0x0c2a('0x1a4'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x0c2a('0x159')],{});db[_0x0c2a('0x87')][_0x0c2a('0x121')](db['AnalyticDefaultReport'],{'foreignKey':_0x0c2a('0x1a5')});db['Schedule'][_0x0c2a('0x121')](db[_0x0c2a('0x99')],{'foreignKey':_0x0c2a('0x1a6')});db['Sound'][_0x0c2a('0x122')](db[_0x0c2a('0x19')],{'as':_0x0c2a('0x1a7'),'through':_0x0c2a('0x142'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x8b')]['belongsToMany'](db['CmContact'],{'through':_0x0c2a('0x195')});db[_0x0c2a('0x8b')][_0x0c2a('0x122')](db[_0x0c2a('0x65')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0c2a('0x122')](db['MailInteraction'],{'through':_0x0c2a('0x169')});db[_0x0c2a('0x8b')][_0x0c2a('0x122')](db[_0x0c2a('0x56')],{'through':'sms_interaction_has_tags'});db[_0x0c2a('0x8b')][_0x0c2a('0x122')](db[_0x0c2a('0x4c')],{'through':_0x0c2a('0x17b')});db[_0x0c2a('0x8b')][_0x0c2a('0x122')](db[_0x0c2a('0x5c')],{'through':_0x0c2a('0x184')});db[_0x0c2a('0x8b')][_0x0c2a('0x122')](db[_0x0c2a('0xfc')],{'through':_0x0c2a('0x1a8')});db[_0x0c2a('0x8f')][_0x0c2a('0x121')](db[_0x0c2a('0x8d')],{'as':_0x0c2a('0x1a9'),'foreignKey':_0x0c2a('0x1aa')});db['CmHopperAdditionalPhone'][_0x0c2a('0x121')](db[_0x0c2a('0x73')],{'as':_0x0c2a('0x1ab'),'foreignKey':_0x0c2a('0x198')});db[_0x0c2a('0x8f')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x192')});db[_0x0c2a('0x93')]['hasMany'](db[_0x0c2a('0x1ac')],{'as':{'plural':'AllConditions','singular':_0x0c2a('0x1ad')},'foreignKey':_0x0c2a('0x1ae'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db[_0x0c2a('0x93')][_0x0c2a('0x114')](db[_0x0c2a('0x1ac')],{'as':{'plural':_0x0c2a('0x1af'),'singular':_0x0c2a('0x1b0')},'foreignKey':_0x0c2a('0x1b1'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0x0c2a('0x1b2'),'onDelete':_0x0c2a('0x112'),'hooks':!![]});db[_0x0c2a('0x99')][_0x0c2a('0x114')](db['AnalyticFieldReport'],{'as':_0x0c2a('0x1b3'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1a6'),'hooks':!![]});db[_0x0c2a('0x9b')]['hasMany'](db[_0x0c2a('0xa0')],{'as':_0x0c2a('0x1b3'),'onDelete':_0x0c2a('0x112'),'foreignKey':'DefaultReportId'});db[_0x0c2a('0x9e')][_0x0c2a('0x114')](db['AnalyticFieldReport'],{'as':_0x0c2a('0x1b3'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b4')});db[_0x0c2a('0xa0')]['belongsTo'](db[_0x0c2a('0x9e')],{'foreignKey':_0x0c2a('0x1b4')});db[_0x0c2a('0xa4')][_0x0c2a('0x114')](db[_0x0c2a('0x1b5')],{'as':_0x0c2a('0x1b6'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0x1b5')][_0x0c2a('0x114')](db[_0x0c2a('0xa6')],{'as':_0x0c2a('0x1b8'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1b5')][_0x0c2a('0x114')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1b5')][_0x0c2a('0x114')](db[_0x0c2a('0xa6')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0x1b5')]['belongsTo'](db[_0x0c2a('0xa4')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xa6')][_0x0c2a('0x114')](db['SalesforceField'],{'as':_0x0c2a('0x1bc'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0xa6')][_0x0c2a('0x114')](db[_0x0c2a('0xa6')],{'as':_0x0c2a('0x1bd'),'foreignKey':_0x0c2a('0x1ba')});db['SalesforceField']['hasMany'](db[_0x0c2a('0xa6')],{'as':'Field','foreignKey':_0x0c2a('0x1bb')});db['SalesforceField'][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0xa8')][_0x0c2a('0x114')](db[_0x0c2a('0xaa')],{'as':_0x0c2a('0x1b6'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xaa')][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':_0x0c2a('0x1b8'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0xaa')][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':_0x0c2a('0x1c0'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1ba')});db['SugarcrmConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':'Fields','onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0xaa')][_0x0c2a('0x121')](db[_0x0c2a('0xa8')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xac')][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':_0x0c2a('0x1bc'),'foreignKey':'SubjectId'});db[_0x0c2a('0xac')][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':_0x0c2a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x0c2a('0xac')][_0x0c2a('0x114')](db[_0x0c2a('0xac')],{'as':_0x0c2a('0x1c1'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0xac')][_0x0c2a('0x121')](db['Variable'],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0xae')][_0x0c2a('0x114')](db[_0x0c2a('0xb0')],{'as':_0x0c2a('0x1b6'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b7')});db['DeskConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0x1c2')],{'as':_0x0c2a('0x1b8'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b9')});db['DeskConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0x1c2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0xb0')][_0x0c2a('0x114')](db['DeskField'],{'as':'Fields','onDelete':_0x0c2a('0x112'),'foreignKey':'FieldId'});db[_0x0c2a('0xb0')][_0x0c2a('0x121')](db[_0x0c2a('0xae')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xb0')]['belongsToMany'](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x1c3')});db['DeskField'][_0x0c2a('0x114')](db[_0x0c2a('0x1c2')],{'as':_0x0c2a('0x1bc'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1c2')][_0x0c2a('0x114')](db[_0x0c2a('0x1c2')],{'as':'Description','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1c2')][_0x0c2a('0x114')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x0c2a('0x1c2')][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':'Variable','foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0x1c4')][_0x0c2a('0x114')](db[_0x0c2a('0x1c5')],{'as':_0x0c2a('0x1b6'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1b7')});db['ZohoConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0xb3')],{'as':_0x0c2a('0x1b8'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1c5')][_0x0c2a('0x114')](db[_0x0c2a('0xb3')],{'as':_0x0c2a('0x1c0'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1ba')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0x0c2a('0x1b3'),'onDelete':_0x0c2a('0x112'),'foreignKey':'FieldId'});db[_0x0c2a('0x1c5')][_0x0c2a('0x121')](db['ZohoAccount'],{'as':'Account','foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xb3')][_0x0c2a('0x114')](db[_0x0c2a('0xb3')],{'as':_0x0c2a('0x1bc'),'foreignKey':'SubjectId'});db[_0x0c2a('0xb3')][_0x0c2a('0x114')](db['ZohoField'],{'as':'Description','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0xb3')][_0x0c2a('0x114')](db[_0x0c2a('0xb3')],{'as':'Field','foreignKey':_0x0c2a('0x1bb')});db['ZohoField'][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0xb5')][_0x0c2a('0x114')](db['ZendeskConfiguration'],{'as':_0x0c2a('0x1b6'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b7')});db['ZendeskConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0x1c6')],{'as':_0x0c2a('0x1b8'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0xb7')]['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x0c2a('0x1ba')});db['ZendeskConfiguration'][_0x0c2a('0x114')](db[_0x0c2a('0x1c6')],{'as':_0x0c2a('0x1b3'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0xb7')][_0x0c2a('0x121')](db['ZendeskAccount'],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db['ZendeskConfiguration'][_0x0c2a('0x122')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x0c2a('0x1c6')]['hasMany'](db['ZendeskField'],{'as':'Subject','foreignKey':_0x0c2a('0x1b9')});db['ZendeskField'][_0x0c2a('0x114')](db['ZendeskField'],{'as':'Description','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1c6')][_0x0c2a('0x114')](db[_0x0c2a('0x1c6')],{'as':_0x0c2a('0x1c1'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0x1c6')][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0x1c7')][_0x0c2a('0x114')](db[_0x0c2a('0x1c8')],{'as':'Configurations','onDelete':_0x0c2a('0x112'),'foreignKey':'AccountId'});db[_0x0c2a('0x1c8')][_0x0c2a('0x114')](db[_0x0c2a('0xbb')],{'as':'Subjects','onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1c8')][_0x0c2a('0x114')](db[_0x0c2a('0xbb')],{'as':_0x0c2a('0x1c0'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1c8')]['hasMany'](db[_0x0c2a('0xbb')],{'as':_0x0c2a('0x1b3'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1bb')});db['FreshdeskConfiguration'][_0x0c2a('0x121')](db[_0x0c2a('0x1c7')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0x1c8')][_0x0c2a('0x122')](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x1c9')});db['FreshdeskField'][_0x0c2a('0x114')](db['FreshdeskField'],{'as':_0x0c2a('0x1bc'),'foreignKey':'SubjectId'});db[_0x0c2a('0xbb')][_0x0c2a('0x114')](db[_0x0c2a('0xbb')],{'as':_0x0c2a('0x1bd'),'foreignKey':'DescriptionId'});db[_0x0c2a('0xbb')][_0x0c2a('0x114')](db[_0x0c2a('0xbb')],{'as':_0x0c2a('0x1c1'),'foreignKey':'FieldId'});db[_0x0c2a('0xbb')][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0xbd')]['hasMany'](db['VtigerConfiguration'],{'as':_0x0c2a('0x1b6'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b7')});db['VtigerConfiguration']['hasMany'](db[_0x0c2a('0x1ca')],{'as':_0x0c2a('0x1b8'),'foreignKey':_0x0c2a('0x1b9')});db['VtigerConfiguration'][_0x0c2a('0x114')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0xbf')]['hasMany'](db[_0x0c2a('0x1ca')],{'as':_0x0c2a('0x1b3'),'foreignKey':_0x0c2a('0x1bb')});db['VtigerConfiguration']['belongsTo'](db[_0x0c2a('0xbd')],{'as':'Account','foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0x1ca')][_0x0c2a('0x114')](db['VtigerField'],{'as':'Subject','foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1ca')][_0x0c2a('0x114')](db[_0x0c2a('0x1ca')],{'as':'Description','foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1ca')][_0x0c2a('0x114')](db[_0x0c2a('0x1ca')],{'as':_0x0c2a('0x1c1'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0x1ca')][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':_0x0c2a('0x1be'),'foreignKey':'VariableId'});db[_0x0c2a('0xc2')][_0x0c2a('0x114')](db[_0x0c2a('0x1cb')],{'as':_0x0c2a('0x1b6'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0x1cb')][_0x0c2a('0x114')](db[_0x0c2a('0xc5')],{'as':_0x0c2a('0x1b8'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1cb')]['hasMany'](db[_0x0c2a('0xc5')],{'as':_0x0c2a('0x1c0'),'foreignKey':_0x0c2a('0x1ba')});db[_0x0c2a('0x1cb')][_0x0c2a('0x114')](db[_0x0c2a('0xc5')],{'as':_0x0c2a('0x1b3'),'foreignKey':'FieldId'});db[_0x0c2a('0x1cb')]['belongsTo'](db[_0x0c2a('0xc2')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xc5')][_0x0c2a('0x114')](db['ServicenowField'],{'as':_0x0c2a('0x1bc'),'foreignKey':'SubjectId'});db[_0x0c2a('0xc5')][_0x0c2a('0x114')](db[_0x0c2a('0xc5')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0c2a('0xc5')][_0x0c2a('0x114')](db['ServicenowField'],{'as':_0x0c2a('0x1c1'),'foreignKey':'FieldId'});db[_0x0c2a('0xc5')][_0x0c2a('0x121')](db['Variable'],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0xc6')][_0x0c2a('0x114')](db[_0x0c2a('0x1cc')],{'as':_0x0c2a('0x1b6'),'onDelete':'cascade','foreignKey':_0x0c2a('0x1b7')});db[_0x0c2a('0xc6')][_0x0c2a('0x121')](db['CloudProvider'],{'as':_0x0c2a('0x106'),'foreignKey':_0x0c2a('0x15a')});db[_0x0c2a('0x1cc')][_0x0c2a('0x114')](db[_0x0c2a('0xc9')],{'as':_0x0c2a('0x1b8'),'onDelete':_0x0c2a('0x112'),'foreignKey':'SubjectId'});db[_0x0c2a('0x1cc')]['hasMany'](db[_0x0c2a('0xc9')],{'as':'Descriptions','onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1ba')});db['Dynamics365Configuration'][_0x0c2a('0x114')](db[_0x0c2a('0xc9')],{'as':_0x0c2a('0x1b3'),'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0x1cc')][_0x0c2a('0x121')](db[_0x0c2a('0xc6')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1b7')});db['Dynamics365Field'][_0x0c2a('0x114')](db[_0x0c2a('0xc9')],{'as':'Subject','foreignKey':_0x0c2a('0x1b9')});db['Dynamics365Field'][_0x0c2a('0x114')](db[_0x0c2a('0xc9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0c2a('0xc9')][_0x0c2a('0x114')](db[_0x0c2a('0xc9')],{'as':_0x0c2a('0x1c1'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0xc9')][_0x0c2a('0x121')](db[_0x0c2a('0x1be')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount']['hasMany'](db[_0x0c2a('0x1cd')],{'as':'Configurations','onDelete':_0x0c2a('0x112'),'foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x0c2a('0x1b8'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0x1cd')][_0x0c2a('0x114')](db[_0x0c2a('0xcd')],{'as':_0x0c2a('0x1c0'),'foreignKey':'DescriptionId'});db[_0x0c2a('0x1cd')]['hasMany'](db['FreshsalesField'],{'as':_0x0c2a('0x1b3'),'foreignKey':_0x0c2a('0x1bb')});db[_0x0c2a('0x1cd')]['belongsTo'](db['FreshsalesAccount'],{'as':_0x0c2a('0x16f'),'foreignKey':'AccountId'});db[_0x0c2a('0xcd')][_0x0c2a('0x114')](db[_0x0c2a('0xcd')],{'as':_0x0c2a('0x1bc'),'foreignKey':_0x0c2a('0x1b9')});db[_0x0c2a('0xcd')]['hasMany'](db[_0x0c2a('0xcd')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshsalesField'][_0x0c2a('0x114')](db[_0x0c2a('0xcd')],{'as':_0x0c2a('0x1c1'),'foreignKey':_0x0c2a('0x1bb')});db['FreshsalesField'][_0x0c2a('0x121')](db['Variable'],{'as':_0x0c2a('0x1be'),'foreignKey':_0x0c2a('0x1bf')});db[_0x0c2a('0x1ce')][_0x0c2a('0x121')](db[_0x0c2a('0x135')],{});db[_0x0c2a('0x1ce')]['belongsTo'](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x1ce')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x1ce')][_0x0c2a('0x121')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x0c2a('0x121')](db[_0x0c2a('0x67')],{});db['ChatQueueReport'][_0x0c2a('0x121')](db['User'],{});db[_0x0c2a('0x1ce')][_0x0c2a('0x121')](db[_0x0c2a('0x6a')],{});db[_0x0c2a('0xd0')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x112'),'foreignKey':'FromId'});db[_0x0c2a('0xd0')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':_0x0c2a('0x112'),'foreignKey':_0x0c2a('0x1cf')});db[_0x0c2a('0x148')]['hasMany'](db[_0x0c2a('0x1d0')],{'foreignKey':_0x0c2a('0x1d1'),'onDelete':'cascade'});db[_0x0c2a('0x148')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x0c2a('0x1d1'),'onDelete':_0x0c2a('0x112')});db['SmsQueueReport']['belongsTo'](db[_0x0c2a('0x52')],{});db[_0x0c2a('0x1d2')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x1d2')][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x1d2')][_0x0c2a('0x121')](db[_0x0c2a('0x56')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0x0c2a('0x1d2')][_0x0c2a('0x121')](db['User'],{});db[_0x0c2a('0x1d2')][_0x0c2a('0x121')](db[_0x0c2a('0x59')],{});db[_0x0c2a('0x1d3')][_0x0c2a('0x114')](db[_0x0c2a('0x148')],{'foreignKey':'ProjectId'});db[_0x0c2a('0x1d3')][_0x0c2a('0x114')](db[_0x0c2a('0x1d0')],{'foreignKey':_0x0c2a('0x1d4')});db[_0x0c2a('0x1d3')][_0x0c2a('0x114')](db[_0x0c2a('0xd1')],{'foreignKey':_0x0c2a('0x1d4')});db[_0x0c2a('0xdf')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':'user_has_teams'});db[_0x0c2a('0xdf')]['belongsToMany'](db[_0x0c2a('0x1b')],{'through':_0x0c2a('0x108'),'as':'VoiceQueues'});db[_0x0c2a('0xdf')]['belongsToMany'](db[_0x0c2a('0x39')],{'through':_0x0c2a('0x164'),'as':_0x0c2a('0x12e')});db[_0x0c2a('0xdf')][_0x0c2a('0x122')](db[_0x0c2a('0x6a')],{'through':_0x0c2a('0x1d5'),'as':_0x0c2a('0x130')});db[_0x0c2a('0xdf')][_0x0c2a('0x122')](db[_0x0c2a('0x4f')],{'through':_0x0c2a('0x1d6'),'as':_0x0c2a('0x132')});db['Team']['belongsToMany'](db[_0x0c2a('0x59')],{'through':'team_has_sms_queues','as':_0x0c2a('0x1d7')});db[_0x0c2a('0xdf')]['belongsToMany'](db[_0x0c2a('0x60')],{'through':_0x0c2a('0x186'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0x0c2a('0x104')],{'through':_0x0c2a('0x1d8'),'as':_0x0c2a('0x134')});db[_0x0c2a('0xdf')]['belongsToMany'](db['VoicePrefix'],{'through':_0x0c2a('0x10a'),'as':'VoicePrefixes'});db[_0x0c2a('0xe3')][_0x0c2a('0x114')](db[_0x0c2a('0x73')],{'as':_0x0c2a('0x145'),'foreignKey':'CampaignId'});db[_0x0c2a('0xe3')]['hasMany'](db[_0x0c2a('0x77')],{'as':_0x0c2a('0x117'),'foreignKey':_0x0c2a('0x1d9')});db[_0x0c2a('0xe3')][_0x0c2a('0x114')](db['CmHopperHistory'],{'as':_0x0c2a('0x146'),'foreignKey':'CampaignId'});db[_0x0c2a('0xe3')][_0x0c2a('0x114')](db[_0x0c2a('0x75')],{'as':_0x0c2a('0x147'),'foreignKey':_0x0c2a('0x1d9')});db['Campaign'][_0x0c2a('0x121')](db[_0x0c2a('0x28')],{'as':_0x0c2a('0x28'),'foreignKey':'TrunkId'});db[_0x0c2a('0xe3')][_0x0c2a('0x121')](db['Trunk'],{'as':_0x0c2a('0x14b'),'foreignKey':_0x0c2a('0x1da')});db[_0x0c2a('0xe3')]['belongsTo'](db[_0x0c2a('0x82')],{'as':_0x0c2a('0x82'),'foreignKey':'IntervalId'});db[_0x0c2a('0xe3')][_0x0c2a('0x121')](db['SquareProject'],{'as':_0x0c2a('0xdb'),'foreignKey':_0x0c2a('0x1db')});db[_0x0c2a('0xe3')][_0x0c2a('0x122')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x126'),'through':_0x0c2a('0x1dc')});db[_0x0c2a('0xe3')][_0x0c2a('0x122')](db['CmList'],{'as':'BlackLists','through':_0x0c2a('0x1dd')});db[_0x0c2a('0xe6')]['belongsTo'](db[_0x0c2a('0x171')],{'as':_0x0c2a('0x171'),'foreignKey':_0x0c2a('0x172')});db['MailTransferReport'][_0x0c2a('0x121')](db['MailMessage'],{});db[_0x0c2a('0x1de')]['belongsTo'](db[_0x0c2a('0x3d')],{});db[_0x0c2a('0x1de')][_0x0c2a('0x121')](db[_0x0c2a('0x159')],{'foreignKey':_0x0c2a('0x1df'),'as':'FromAccount'});db[_0x0c2a('0x1de')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e0'),'as':_0x0c2a('0x1e1')});db[_0x0c2a('0x1de')]['belongsTo'](db[_0x0c2a('0x110')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0c2a('0x1de')][_0x0c2a('0x121')](db[_0x0c2a('0x39')],{'foreignKey':_0x0c2a('0x1e2'),'as':_0x0c2a('0x1e3')});db[_0x0c2a('0x1de')][_0x0c2a('0x121')](db['MailAccount'],{'foreignKey':_0x0c2a('0x1e4'),'as':_0x0c2a('0x1e5')});db['ChatTransferReport'][_0x0c2a('0x121')](db['ChatMessage'],{});db[_0x0c2a('0x1e6')][_0x0c2a('0x121')](db[_0x0c2a('0x65')],{});db[_0x0c2a('0x1e6')]['belongsTo'](db[_0x0c2a('0x135')],{'foreignKey':_0x0c2a('0x1e7'),'as':_0x0c2a('0x1e8')});db['ChatTransferReport'][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e0'),'as':_0x0c2a('0x1e1')});db[_0x0c2a('0x1e6')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e9'),'as':'ToAgent'});db[_0x0c2a('0x1e6')]['belongsTo'](db[_0x0c2a('0x6a')],{'foreignKey':_0x0c2a('0x1ea'),'as':'ToQueue'});db[_0x0c2a('0x1e6')][_0x0c2a('0x121')](db['ChatWebsite'],{'foreignKey':_0x0c2a('0x1eb'),'as':'ToAccount'});db['FaxTransferReport'][_0x0c2a('0x121')](db[_0x0c2a('0x4e')],{});db[_0x0c2a('0xeb')]['belongsTo'](db[_0x0c2a('0x4c')],{});db[_0x0c2a('0xeb')][_0x0c2a('0x121')](db['FaxAccount'],{'foreignKey':_0x0c2a('0x1ec'),'as':_0x0c2a('0x1e8')});db[_0x0c2a('0xeb')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e0'),'as':'FromAgent'});db['FaxTransferReport']['belongsTo'](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e9'),'as':_0x0c2a('0x1ed')});db['FaxTransferReport']['belongsTo'](db[_0x0c2a('0x4f')],{'foreignKey':_0x0c2a('0x1ee'),'as':_0x0c2a('0x1e3')});db[_0x0c2a('0xeb')][_0x0c2a('0x121')](db[_0x0c2a('0x48')],{'foreignKey':_0x0c2a('0x1ef'),'as':_0x0c2a('0x1e5')});db['OpenchannelTransferReport']['belongsTo'](db[_0x0c2a('0x5e')],{});db[_0x0c2a('0xed')]['belongsTo'](db[_0x0c2a('0x5c')],{});db[_0x0c2a('0xed')]['belongsTo'](db[_0x0c2a('0x13a')],{'foreignKey':'FromOpenchannelAccountId','as':_0x0c2a('0x1e8')});db[_0x0c2a('0xed')][_0x0c2a('0x121')](db['User'],{'foreignKey':_0x0c2a('0x1e0'),'as':_0x0c2a('0x1e1')});db[_0x0c2a('0xed')]['belongsTo'](db[_0x0c2a('0x110')],{'foreignKey':'ToUserId','as':_0x0c2a('0x1ed')});db[_0x0c2a('0xed')][_0x0c2a('0x121')](db['OpenchannelQueue'],{'foreignKey':_0x0c2a('0x1f0'),'as':_0x0c2a('0x1e3')});db[_0x0c2a('0xed')][_0x0c2a('0x121')](db['OpenchannelAccount'],{'foreignKey':_0x0c2a('0x1f1'),'as':_0x0c2a('0x1e5')});db[_0x0c2a('0x1f2')][_0x0c2a('0x121')](db['SmsMessage'],{});db[_0x0c2a('0x1f2')][_0x0c2a('0x121')](db[_0x0c2a('0x56')],{});db['SmsTransferReport'][_0x0c2a('0x121')](db['SmsAccount'],{'foreignKey':_0x0c2a('0x1f3'),'as':_0x0c2a('0x1e8')});db['SmsTransferReport'][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'foreignKey':'FromUserId','as':_0x0c2a('0x1e1')});db[_0x0c2a('0x1f2')]['belongsTo'](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e9'),'as':_0x0c2a('0x1ed')});db[_0x0c2a('0x1f2')][_0x0c2a('0x121')](db['SmsQueue'],{'foreignKey':_0x0c2a('0x1f4'),'as':_0x0c2a('0x1e3')});db[_0x0c2a('0x1f2')][_0x0c2a('0x121')](db[_0x0c2a('0x52')],{'foreignKey':_0x0c2a('0x1f5'),'as':_0x0c2a('0x1e5')});db[_0x0c2a('0x125')][_0x0c2a('0x114')](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':_0x0c2a('0x174'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0x125')][_0x0c2a('0x114')](db[_0x0c2a('0x1f6')],{'as':'CustomFields','foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x125')][_0x0c2a('0x114')](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x190'),'onDelete':_0x0c2a('0x112'),'foreignKey':'ListId'});db[_0x0c2a('0x125')][_0x0c2a('0x114')](db[_0x0c2a('0x77')],{'as':_0x0c2a('0x117'),'foreignKey':_0x0c2a('0x174')});db['CmList']['hasMany'](db[_0x0c2a('0x78')],{'as':_0x0c2a('0x118'),'foreignKey':_0x0c2a('0x174')});db[_0x0c2a('0x125')][_0x0c2a('0x114')](db[_0x0c2a('0x119')],{'as':_0x0c2a('0x119'),'foreignKey':'ListId'});db[_0x0c2a('0x125')][_0x0c2a('0x122')](db[_0x0c2a('0x1b')],{'as':'Queues','through':_0x0c2a('0x14f')});db['CmList'][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x1f7')});db[_0x0c2a('0xef')][_0x0c2a('0x114')](db['VoiceExtension'],{'as':_0x0c2a('0x116'),'onDelete':_0x0c2a('0x112')});db[_0x0c2a('0xef')][_0x0c2a('0x122')](db['User'],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x10b')});db['VoicePrefix'][_0x0c2a('0x122')](db[_0x0c2a('0xdf')],{'through':'TeamVoicePrefix','as':_0x0c2a('0x151')});db[_0x0c2a('0xf1')][_0x0c2a('0x114')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x16b'),'foreignKey':_0x0c2a('0x1f8')});db[_0x0c2a('0xf1')][_0x0c2a('0x114')](db[_0x0c2a('0xf3')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':'cascade'});db[_0x0c2a('0xf3')][_0x0c2a('0x114')](db['UserProfileResource'],{'as':_0x0c2a('0x1f9'),'foreignKey':'sectionId','onDelete':_0x0c2a('0x112')});db[_0x0c2a('0xf8')]['hasMany'](db[_0x0c2a('0x80')],{'as':_0x0c2a('0x15f'),'foreignKey':'WhatsappAccountId','onDelete':_0x0c2a('0x112')});db[_0x0c2a('0xf8')]['hasMany'](db[_0x0c2a('0x7e')],{'as':_0x0c2a('0x160'),'foreignKey':_0x0c2a('0x1fa')});db['WhatsappAccount'][_0x0c2a('0x114')](db[_0x0c2a('0xfe')],{'as':_0x0c2a('0x154'),'foreignKey':_0x0c2a('0x1fa')});db[_0x0c2a('0xf8')][_0x0c2a('0x114')](db[_0x0c2a('0xfc')],{'as':_0x0c2a('0x177')});db['WhatsappAccount'][_0x0c2a('0x114')](db[_0x0c2a('0xfa')],{'as':_0x0c2a('0x161')});db['WhatsappAccount'][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db['WhatsappAccount'][_0x0c2a('0x121')](db[_0x0c2a('0x179')],{'as':_0x0c2a('0x14d'),'foreignKey':_0x0c2a('0x14e')});db[_0x0c2a('0xf8')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x1fb')});db['WhatsappApplication'][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'onDelete':'restrict'});db[_0x0c2a('0xfa')][_0x0c2a('0x121')](db[_0x0c2a('0x104')],{'onDelete':_0x0c2a('0x15b')});db['WhatsappApplication'][_0x0c2a('0x121')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x0c2a('0xfa')][_0x0c2a('0x121')](db[_0x0c2a('0x82')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x14c')});db[_0x0c2a('0xfa')]['belongsTo'](db[_0x0c2a('0x8b')],{'onDelete':_0x0c2a('0x15b'),'foreignKey':_0x0c2a('0x173')});db['WhatsappInteraction'][_0x0c2a('0x114')](db[_0x0c2a('0xfe')],{'as':_0x0c2a('0x154'),'onDelete':_0x0c2a('0x112'),'foreignKey':'WhatsappInteractionId'});db[_0x0c2a('0xfc')][_0x0c2a('0x121')](db[_0x0c2a('0xf8')],{'as':_0x0c2a('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0x0c2a('0xfc')]['belongsTo'](db[_0x0c2a('0x72')],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0xfc')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{'as':'Owner','foreignKey':_0x0c2a('0x113')});db[_0x0c2a('0xfc')][_0x0c2a('0x122')](db['Tag'],{'through':_0x0c2a('0x1a8'),'as':_0x0c2a('0x168')});db['WhatsappInteraction']['belongsToMany'](db[_0x0c2a('0x8b')],{'through':_0x0c2a('0x1a8'),'as':'ThroughTags'});db[_0x0c2a('0xfc')][_0x0c2a('0x122')](db['User'],{'as':_0x0c2a('0x16b'),'through':_0x0c2a('0x12d'),'foreignKey':_0x0c2a('0x1fc')});db[_0x0c2a('0xfe')]['belongsTo'](db[_0x0c2a('0x110')],{'as':'User'});db['WhatsappMessage'][_0x0c2a('0x121')](db[_0x0c2a('0x72')],{'onDelete':_0x0c2a('0x112'),'as':'Contact'});db[_0x0c2a('0xfe')][_0x0c2a('0x121')](db[_0x0c2a('0xfc')],{'onDelete':_0x0c2a('0x112'),'as':_0x0c2a('0x16e'),'foreignKey':_0x0c2a('0x1fc')});db[_0x0c2a('0xfe')][_0x0c2a('0x121')](db[_0x0c2a('0xf8')],{'as':_0x0c2a('0x16f'),'foreignKey':_0x0c2a('0x1fa')});db['WhatsappQueueReport'][_0x0c2a('0x121')](db[_0x0c2a('0xf8')],{});db[_0x0c2a('0x100')][_0x0c2a('0x121')](db[_0x0c2a('0x125')],{'as':_0x0c2a('0x162'),'foreignKey':_0x0c2a('0x174')});db['WhatsappQueueReport'][_0x0c2a('0x121')](db['CmContact'],{'as':_0x0c2a('0x166'),'foreignKey':_0x0c2a('0x158')});db[_0x0c2a('0x100')][_0x0c2a('0x121')](db[_0x0c2a('0xfc')],{});db[_0x0c2a('0x100')]['belongsTo'](db[_0x0c2a('0x104')],{});db[_0x0c2a('0x100')][_0x0c2a('0x121')](db[_0x0c2a('0xfe')],{});db[_0x0c2a('0x100')][_0x0c2a('0x121')](db[_0x0c2a('0x110')],{});db[_0x0c2a('0x102')][_0x0c2a('0x121')](db[_0x0c2a('0xfe')],{});db[_0x0c2a('0x102')][_0x0c2a('0x121')](db[_0x0c2a('0xfc')],{});db[_0x0c2a('0x102')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0c2a('0x1fd'),'as':_0x0c2a('0x1e8')});db[_0x0c2a('0x102')][_0x0c2a('0x121')](db['WhatsappAccount'],{'foreignKey':_0x0c2a('0x1fe'),'as':_0x0c2a('0x1e5')});db[_0x0c2a('0x102')]['belongsTo'](db[_0x0c2a('0x104')],{'foreignKey':_0x0c2a('0x1ff'),'as':_0x0c2a('0x1e3')});db[_0x0c2a('0x102')]['belongsTo'](db[_0x0c2a('0x110')],{'foreignKey':_0x0c2a('0x1e0'),'as':_0x0c2a('0x1e1')});db[_0x0c2a('0x102')][_0x0c2a('0x121')](db['User'],{'foreignKey':'ToUserId','as':_0x0c2a('0x1ed')});db[_0x0c2a('0x104')][_0x0c2a('0x122')](db[_0x0c2a('0x110')],{'as':_0x0c2a('0x150'),'through':_0x0c2a('0x33'),'foreignKey':_0x0c2a('0x200')});db[_0x0c2a('0x104')]['belongsToMany'](db[_0x0c2a('0xdf')],{'through':_0x0c2a('0x1d8'),'as':'Teams'});db[_0x0c2a('0x10d')]['belongsTo'](db['User'],{'as':_0x0c2a('0x201'),'foreignKey':_0x0c2a('0x113'),'onDelete':'cascade','hooks':!![]});db[_0x0c2a('0x106')]['hasOne'](db[_0x0c2a('0xc6')],{'as':_0x0c2a('0xc6'),'onDelete':_0x0c2a('0x15b')});db[_0x0c2a('0x106')][_0x0c2a('0x10e')](db[_0x0c2a('0x35')],{'as':_0x0c2a('0x15d'),'onDelete':_0x0c2a('0x15b')});db['CloudProvider'][_0x0c2a('0x10e')](db[_0x0c2a('0x36')],{'as':'Smtp','onDelete':_0x0c2a('0x15b')});module[_0x0c2a('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x1f87=['UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../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','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','User','cascade','hasOne','userSetting','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','ChatQueue','ChatQueues','SmsQueues','WhatsappQueues','user_has_chat_websites','FaxAccount','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Messages','MailApplication','List','TemplateId','team_has_mail_queues','Account','Contact','Owner','Tags','Users','Interaction','MailInteractionId','ChatOfflineMessage','IntervalId','TagId','MailQueueReport','ListId','Items','FaxAccountId','Interactions','FaxApplication','Exntensions','FaxInteractionId','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','Applications','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','Contacts','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','Campaign','CampaignId','Condition','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','moh_has_sounds','mail_interaction_has_tags','fax_interaction_has_tags','ItemType','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','VariableId','SugarcrmAccount','FieldId','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesAccount','FreshsalesField','ToId','SessionId','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','VoicePrefix','Hoppers','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','name','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model'];(function(_0x49c9a,_0x24f68a){var _0x2b03d6=function(_0x4f2232){while(--_0x4f2232){_0x49c9a['push'](_0x49c9a['shift']());}};_0x2b03d6(++_0x24f68a);}(_0x1f87,0x1cf));var _0x71f8=function(_0x4a4b9b,_0x47c325){_0x4a4b9b=_0x4a4b9b-0x0;var _0x260375=_0x1f87[_0x4a4b9b];return _0x260375;};'use strict';var config=require(_0x71f8('0x0'));var Sequelize=require('sequelize');var _=require(_0x71f8('0x1'));var jstz=require(_0x71f8('0x2'));var timezone=jstz[_0x71f8('0x3')]();config['sequelize']=_[_0x71f8('0x4')](config[_0x71f8('0x5')],{'database':_0x71f8('0x6'),'username':_0x71f8('0x7'),'password':_0x71f8('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x71f8('0x9'),'dialectOptions':{'charset':_0x71f8('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x71f8('0xb'),'collate':_0x71f8('0xc')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x71f8('0xd')],{'database':_0x71f8('0x6'),'username':'xcall','password':_0x71f8('0x8'),'options':{'host':_0x71f8('0xe'),'port':0xcea,'dialect':_0x71f8('0x9'),'dialectOptions':{'charset':_0x71f8('0xa')},'logging':![],'timezone':timezone[_0x71f8('0xf')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x71f8('0x10')],config[_0x71f8('0x5')][_0x71f8('0x11')],config['sequelize'][_0x71f8('0x12')],config['sequelize'][_0x71f8('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x71f8('0xd')][_0x71f8('0x10')],config[_0x71f8('0xd')][_0x71f8('0x11')],config[_0x71f8('0xd')][_0x71f8('0x12')],config['sequelizeHistory'][_0x71f8('0x13')])};db['User']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x15'));db[_0x71f8('0x16')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x17'));db[_0x71f8('0x18')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x19'));db[_0x71f8('0x1a')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x1b'));db['VoiceMusicOnHold']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x1c'));db[_0x71f8('0x1d')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x71f8('0x1e')]=db['sequelize']['import'](_0x71f8('0x1f'));db[_0x71f8('0x20')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x21'));db[_0x71f8('0x22')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x23'));db[_0x71f8('0x24')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x25'));db[_0x71f8('0x26')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x27'));db[_0x71f8('0x28')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x29'));db[_0x71f8('0x2a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x2b'));db[_0x71f8('0x2c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x2d'));db[_0x71f8('0x2e')]=db[_0x71f8('0x5')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x2f'));db[_0x71f8('0x30')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x31'));db['UserVoiceQueueRt']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x32'));db[_0x71f8('0x33')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x34'));db[_0x71f8('0x35')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x36'));db[_0x71f8('0x37')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x38'));db[_0x71f8('0x39')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3a'));db[_0x71f8('0x3b')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3c'));db[_0x71f8('0x3d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3e'));db[_0x71f8('0x3f')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x40'));db[_0x71f8('0x41')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x71f8('0x42')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x43'));db[_0x71f8('0x44')]=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db[_0x71f8('0x45')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x46'));db[_0x71f8('0x47')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x48'));db[_0x71f8('0x49')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x71f8('0x4a')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x4b'));db[_0x71f8('0x4c')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x4d'));db[_0x71f8('0x4e')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x4f'));db['FaxAccount']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x50'));db['FaxApplication']=db[_0x71f8('0x5')]['import'](_0x71f8('0x51'));db[_0x71f8('0x52')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x53'));db[_0x71f8('0x54')]=db['sequelize']['import'](_0x71f8('0x55'));db[_0x71f8('0x56')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x57'));db[_0x71f8('0x58')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x59'));db[_0x71f8('0x5a')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x5b'));db[_0x71f8('0x5c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x5d'));db[_0x71f8('0x5e')]=db['sequelize']['import'](_0x71f8('0x5f'));db[_0x71f8('0x60')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x61'));db[_0x71f8('0x62')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x63'));db[_0x71f8('0x64')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x71f8('0x65')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x66'));db[_0x71f8('0x67')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x68'));db[_0x71f8('0x69')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x6a'));db[_0x71f8('0x6b')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x6c'));db[_0x71f8('0x6d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x6e'));db[_0x71f8('0x6f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x70'));db[_0x71f8('0x71')]=db['sequelize'][_0x71f8('0x14')]('../api/chatApplication/chatApplication.model');db[_0x71f8('0x72')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x73'));db[_0x71f8('0x74')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x75'));db['ChatOfflineMessage']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x76'));db['ChatQueue']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x77'));db[_0x71f8('0x78')]=db[_0x71f8('0x5')]['import']('../api/chatGroup/chatGroup.model');db[_0x71f8('0x79')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x7a'));db[_0x71f8('0x7b')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x7c'));db[_0x71f8('0x7d')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/cmContact/cmContact.model');db[_0x71f8('0x7e')]=db['sequelize'][_0x71f8('0x14')]('../api/cmHopper/cmHopper.model');db[_0x71f8('0x7f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x80'));db[_0x71f8('0x81')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x82'));db[_0x71f8('0x83')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x84'));db[_0x71f8('0x85')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x86'));db[_0x71f8('0x87')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x88'));db[_0x71f8('0x89')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x8a'));db[_0x71f8('0x8b')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x8c'));db[_0x71f8('0x8d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x8e'));db[_0x71f8('0x8f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x90'));db['Condition']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/condition/condition.model');db[_0x71f8('0x91')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x92'));db[_0x71f8('0x93')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x94'));db[_0x71f8('0x95')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x96'));db['Schedule']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x97'));db[_0x71f8('0x98')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/sound/sound.model');db[_0x71f8('0x99')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9a'));db[_0x71f8('0x9b')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/contactItemType/contactItemType.model');db[_0x71f8('0x9c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9d'));db[_0x71f8('0x9e')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9f'));db[_0x71f8('0xa0')]=db['sequelize']['import']('../api/template/template.model');db[_0x71f8('0xa1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa2'));db[_0x71f8('0xa3')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xa4'));db[_0x71f8('0xa5')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/integrationReport/integrationReport.model');db[_0x71f8('0xa6')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa7'));db[_0x71f8('0xa8')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa9'));db[_0x71f8('0xaa')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xab'));db[_0x71f8('0xac')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xad'));db[_0x71f8('0xae')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x71f8('0xaf')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb0'));db[_0x71f8('0xb1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb2'));db[_0x71f8('0xb3')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xb4'));db[_0x71f8('0xb5')]=db['sequelize'][_0x71f8('0x14')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb6'));db[_0x71f8('0xb7')]=db['sequelize'][_0x71f8('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x71f8('0xb8')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb9'));db[_0x71f8('0xba')]=db['sequelize'][_0x71f8('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x71f8('0xbb')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xbc'));db['DeskField']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xbd'));db[_0x71f8('0xbe')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xbf'));db['ZohoConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc0'));db[_0x71f8('0xc1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc2'));db[_0x71f8('0xc3')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x71f8('0xc4')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x71f8('0xc5')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x71f8('0xc6')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc7'));db['FreshdeskConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc8'));db[_0x71f8('0xc9')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x71f8('0xca')]=db[_0x71f8('0x5')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x71f8('0xcb')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xcc'));db[_0x71f8('0xcd')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xce'));db[_0x71f8('0xcf')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xd0'));db['ServicenowConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x71f8('0xd1')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xd2'));db[_0x71f8('0xd3')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xd4'));db[_0x71f8('0xd5')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xd6'));db[_0x71f8('0xd7')]=db['sequelize'][_0x71f8('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xd8'));db[_0x71f8('0xd9')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xda'));db['FreshsalesField']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xdb'));db['Integration']=db[_0x71f8('0x5')]['import'](_0x71f8('0xdc'));db[_0x71f8('0xdd')]=db['sequelize']['import'](_0x71f8('0xde'));db[_0x71f8('0xdf')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db[_0x71f8('0xe0')]=db[_0x71f8('0x5')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x71f8('0xe1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xe2'));db[_0x71f8('0xe3')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xe4'));db[_0x71f8('0xe5')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x71f8('0xe6')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xe7'));db[_0x71f8('0xe8')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xe9'));db[_0x71f8('0xea')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xeb'));db[_0x71f8('0xec')]=db['sequelize']['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x71f8('0xed')]=db['sequelize']['import']('../api/setting/setting.model');db[_0x71f8('0xee')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xef'));db[_0x71f8('0xf0')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf1'));db['SquareRecording']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf2'));db[_0x71f8('0xf3')]=db['sequelize']['import'](_0x71f8('0xf4'));db[_0x71f8('0xf5')]=db['sequelize']['import'](_0x71f8('0xf6'));db[_0x71f8('0xf7')]=db[_0x71f8('0x5')]['import']('../api/license/license.model');db['Campaign']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf8'));db['Migration']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/migration/migration.model');db[_0x71f8('0xf9')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xfa'));db[_0x71f8('0xfb')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xfc'));db[_0x71f8('0xfd')]=db['sequelize']['import'](_0x71f8('0xfe'));db[_0x71f8('0xff')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x100'));db[_0x71f8('0x101')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x102'));db[_0x71f8('0x103')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x104'));db[_0x71f8('0x105')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x106'));db[_0x71f8('0x107')]=db['sequelize'][_0x71f8('0x14')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x108'));db[_0x71f8('0x109')]=db[_0x71f8('0x5')]['import']('../api/userProfile/userProfile.model');db[_0x71f8('0x10a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x10b'));db[_0x71f8('0x10c')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x71f8('0x10d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x10e'));db[_0x71f8('0x10f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x110'));db[_0x71f8('0x111')]=db['sequelize'][_0x71f8('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0x71f8('0x112')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x113'));db[_0x71f8('0x114')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x115'));db[_0x71f8('0x116')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x117'));db[_0x71f8('0x118')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x119'));db[_0x71f8('0x11a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x11b'));db[_0x71f8('0x11c')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x71f8('0x11d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x11e'));db[_0x71f8('0x11f')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x120'));db[_0x71f8('0x121')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x71f8('0x122')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x123'));db[_0x71f8('0x124')]['hasOne'](db[_0x71f8('0x22')],{'as':_0x71f8('0x22'),'onDelete':_0x71f8('0x125'),'foreignKey':'UserId'});db[_0x71f8('0x124')][_0x71f8('0x126')](db[_0x71f8('0x122')],{'as':_0x71f8('0x127'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x1e')],{'as':'Recordings','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x12a')],{'as':_0x71f8('0x12b'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x12c'),'onDelete':'cascade','hooks':!![]});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':'HopperFinals','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':_0x71f8('0x12d'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x85')],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x71f8('0x12e'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x72')],{'as':'ChatInteractions','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User']['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x71f8('0x128')});db['User'][_0x71f8('0x129')](db[_0x71f8('0x49')],{'as':_0x71f8('0x12f'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db['WhatsappInteraction'],{'as':_0x71f8('0x130'),'foreignKey':'UserId'});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x10d')],{'as':_0x71f8('0x131'),'foreignKey':_0x71f8('0x132')});db[_0x71f8('0x124')]['belongsTo'](db['UserProfile'],{'as':_0x71f8('0x109'),'foreignKey':_0x71f8('0x133')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['ChatGroup'],{'as':_0x71f8('0x135'),'through':'chat_group_has_users'});db['User']['belongsToMany'](db['CmContact'],{'as':'Contacts','through':_0x71f8('0x136')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0x71f8('0xf5')],{'through':_0x71f8('0x138')});db[_0x71f8('0x124')]['belongsToMany'](db['MailInteraction'],{'as':_0x71f8('0x12f'),'through':_0x71f8('0x139')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x72')],{'as':_0x71f8('0x13a'),'through':_0x71f8('0x13b')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['FaxInteraction'],{'as':_0x71f8('0x13c'),'through':_0x71f8('0x13d')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x13e'),'through':'user_has_sms_interactions'});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x67')],{'as':'OpenchannelInteractions','through':_0x71f8('0x13f')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['WhatsappInteraction'],{'as':_0x71f8('0x130'),'through':_0x71f8('0x140')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'as':_0x71f8('0x141'),'through':_0x71f8('0x33'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x71f8('0x121'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['MailQueue'],{'as':'MailQueues','through':_0x71f8('0x37'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x142')],{'as':_0x71f8('0x143'),'through':_0x71f8('0x35'),'required':![],'hooks':!![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x56')],{'as':'FaxQueues','through':_0x71f8('0x39'),'required':![]});db['User'][_0x71f8('0x134')](db[_0x71f8('0x62')],{'as':_0x71f8('0x144'),'through':_0x71f8('0x3b'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x71f8('0x3d'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x11a')],{'as':_0x71f8('0x145'),'through':_0x71f8('0x3f'),'required':![]});db[_0x71f8('0x124')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x6d')],{'as':'ChatWebsites','through':_0x71f8('0x146')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x147')],{'as':'FaxAccounts','through':_0x71f8('0x148')});db[_0x71f8('0x124')]['belongsToMany'](db[_0x71f8('0x44')],{'as':'MailAccounts','through':_0x71f8('0x149')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['OpenchannelAccount'],{'as':_0x71f8('0x14a'),'through':_0x71f8('0x14b')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x5a')],{'as':_0x71f8('0x14c'),'through':_0x71f8('0x14d')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['WhatsappAccount'],{'as':_0x71f8('0x14e'),'through':_0x71f8('0x14f')});db['VoiceChanSpy'][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x150'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x151')});db['VoiceContext'][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'onDelete':_0x71f8('0x125')});db[_0x71f8('0x1a')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x71f8('0x134')](db[_0x71f8('0x98')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db['UserVoiceQueueRt'],{'as':_0x71f8('0x152'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':'Hoppers','foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':'VoiceQueueId'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':_0x71f8('0x155'),'foreignKey':'VoiceQueueId'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db['ReportAgentPreview'],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x7f')],{'as':_0x71f8('0x156'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')]['hasMany'](db['JscriptySessionReport'],{'as':_0x71f8('0x157'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')]['belongsTo'](db[_0x71f8('0x158')],{'as':_0x71f8('0x158'),'foreignKey':_0x71f8('0x159')});db['VoiceQueue'][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':_0x71f8('0x15b'),'foreignKey':_0x71f8('0x15c')});db['VoiceQueue']['belongsTo'](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':'IntervalId'});db[_0x71f8('0x1d')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x1d')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':_0x71f8('0x15f')});db['VoiceQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'as':_0x71f8('0x161'),'through':_0x71f8('0x11d')});db[_0x71f8('0x1d')]['belongsToMany'](db[_0x71f8('0x107')],{'as':_0x71f8('0x162'),'through':_0x71f8('0x163')});db[_0x71f8('0x1e')]['belongsTo'](db[_0x71f8('0x124')],{'as':'User','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x20')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x22')][_0x71f8('0x129')](db[_0x71f8('0x24')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':'mailboxuser','sourceKey':_0x71f8('0x164')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0x71f8('0x165'),'targetKey':'mailbox'});db[_0x71f8('0x26')][_0x71f8('0x129')](db[_0x71f8('0x2c')],{'as':_0x71f8('0x166'),'foreignKey':_0x71f8('0x167'),'constraints':![]});db[_0x71f8('0x26')][_0x71f8('0x129')](db[_0x71f8('0x2a')],{'as':_0x71f8('0x168'),'foreignKey':_0x71f8('0x167'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x124'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x26')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x41')]['belongsTo'](db['MailAccount'],{'as':_0x71f8('0x44'),'foreignKey':_0x71f8('0x16a')});db['MailServerIn'][_0x71f8('0x15a')](db[_0x71f8('0x11c')],{'as':_0x71f8('0x11c'),'foreignKey':_0x71f8('0x16b'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x42')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'as':_0x71f8('0x44'),'foreignKey':'MailAccountId'});db[_0x71f8('0x42')]['belongsTo'](db[_0x71f8('0x11c')],{'as':'CloudProvider','foreignKey':_0x71f8('0x16b'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x44')][_0x71f8('0x126')](db[_0x71f8('0x41')],{'as':_0x71f8('0x16d'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x44')]['hasOne'](db['MailServerOut'],{'as':_0x71f8('0x16e'),'onDelete':'cascade'});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x16a'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x4a')],{'as':_0x71f8('0x171'),'foreignKey':'MailAccountId'});db[_0x71f8('0x44')]['hasMany'](db[_0x71f8('0x49')],{'as':'Interactions'});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x172')],{'as':'Applications'});db[_0x71f8('0x44')][_0x71f8('0x15a')](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db[_0x71f8('0x44')][_0x71f8('0x15a')](db[_0x71f8('0xa0')],{'as':'Template','foreignKey':_0x71f8('0x174')});db[_0x71f8('0x44')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db['MailAccount'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'user_has_mail_accounts'});db[_0x71f8('0x45')][_0x71f8('0x134')](db['User'],{'as':_0x71f8('0x160'),'through':_0x71f8('0x37')});db[_0x71f8('0x45')][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x175'),'as':_0x71f8('0x161')});db[_0x71f8('0x49')][_0x71f8('0x129')](db[_0x71f8('0x4a')],{'as':_0x71f8('0x171'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x71f8('0x49')]['belongsTo'](db['MailAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x49')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x49')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x49')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'mail_interaction_has_tags','as':_0x71f8('0x179')});db['MailInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x71f8('0x49')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x71f8('0x4a')][_0x71f8('0x129')](db[_0x71f8('0xf9')],{'as':'Attachments','onDelete':'cascade'});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x4a')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{'as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x17c')});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x44')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x6d'),'foreignKey':'ChatWebsiteId'});db[_0x71f8('0x4a')][_0x71f8('0x15a')](db[_0x71f8('0x17d')],{'as':_0x71f8('0x17d'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x172')][_0x71f8('0x15a')](db[_0x71f8('0x45')],{'onDelete':'restrict'});db[_0x71f8('0x172')][_0x71f8('0x15a')](db['MailAccount'],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x172')][_0x71f8('0x15a')](db['Interval'],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17e')});db['MailApplication'][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db['MailAccount'],{});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{});db['MailQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x4a')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x45')],{});db[_0x71f8('0x4c')]['hasMany'](db[_0x71f8('0x4e')],{'as':_0x71f8('0x182'),'onDelete':_0x71f8('0x125')});db['FaxAccount']['hasMany'](db[_0x71f8('0x8f')],{'as':'Dispositions','foreignKey':_0x71f8('0x183'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x147')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':'Answers','foreignKey':_0x71f8('0x183')});db[_0x71f8('0x147')]['hasMany'](db[_0x71f8('0x52')],{'as':_0x71f8('0x184')});db['FaxAccount'][_0x71f8('0x129')](db[_0x71f8('0x185')],{'as':'Applications'});db[_0x71f8('0x147')]['hasMany'](db['VoiceExtension'],{'as':_0x71f8('0x186'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x147')][_0x71f8('0x129')](db[_0x71f8('0x54')],{'as':_0x71f8('0x171')});db[_0x71f8('0x147')][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':_0x71f8('0x158')});db[_0x71f8('0x147')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['FaxAccount'][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x71f8('0x147')]['belongsToMany'](db[_0x71f8('0x124')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x71f8('0x185')][_0x71f8('0x15a')](db['User'],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x52')][_0x71f8('0x129')](db[_0x71f8('0x54')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x187')});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x71f8('0x99')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x71f8('0x52')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'fax_interaction_has_tags','as':_0x71f8('0x188')});db[_0x71f8('0x52')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x13d'),'foreignKey':_0x71f8('0x187')});db['FaxMessage'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':'cascade','as':'User'});db[_0x71f8('0x54')][_0x71f8('0x15a')](db['FaxInteraction'],{'as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x187')});db[_0x71f8('0x54')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x54')]['belongsTo'](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db['FaxMessage'][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x71f8('0x56')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x39')});db[_0x71f8('0x56')][_0x71f8('0x134')](db['Team'],{'through':_0x71f8('0x18a'),'as':_0x71f8('0x161')});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{});db[_0x71f8('0x58')]['belongsTo'](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['FaxQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x58')][_0x71f8('0x15a')](db['FaxInteraction'],{});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x54')],{});db['FaxQueueReport']['belongsTo'](db[_0x71f8('0x124')],{});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{});db[_0x71f8('0x5a')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x18b'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x184')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['SmsApplication'],{'as':_0x71f8('0x18c')});db[_0x71f8('0x5a')]['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x5a')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x5a')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x14d')});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db['SmsApplication'][_0x71f8('0x15a')](db[_0x71f8('0x62')],{'onDelete':'restrict'});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'onDelete':'restrict'});db[_0x71f8('0x5c')]['belongsTo'](db[_0x71f8('0x91')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x5e')][_0x71f8('0x129')](db[_0x71f8('0x60')],{'as':_0x71f8('0x171'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x18d')});db['SmsInteraction']['belongsTo'](db[_0x71f8('0x5a')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5e')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x5e')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':'Owner','foreignKey':'UserId'});db[_0x71f8('0x5e')]['belongsToMany'](db[_0x71f8('0x99')],{'through':_0x71f8('0x18e'),'as':_0x71f8('0x179')});db['SmsInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x18e'),'as':'ThroughTags'});db['SmsInteraction'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x18f'),'foreignKey':'SmsInteractionId'});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db['SmsMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x5e')],{'onDelete':'cascade','as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x18d')});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x18b')});db['SmsQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3b'),'foreignKey':'SmsQueueId'});db[_0x71f8('0x62')][_0x71f8('0x134')](db['Team'],{'through':_0x71f8('0x190'),'as':_0x71f8('0x161')});db[_0x71f8('0x64')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x191'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x64')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')][_0x71f8('0x129')](db['OpenchannelInteraction'],{'as':_0x71f8('0x184'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x71f8('0x65')],{'as':_0x71f8('0x18c'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x64')][_0x71f8('0x134')](db['User'],{'as':'Agents','through':_0x71f8('0x14b')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x6b')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x192')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x71f8('0x191')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x91')],{'onDelete':'restrict','foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x67')]['hasMany'](db[_0x71f8('0x69')],{'as':_0x71f8('0x171'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x193')});db[_0x71f8('0x67')][_0x71f8('0x15a')](db[_0x71f8('0x64')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x67')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db['OpenchannelInteraction'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x67')]['belongsToMany'](db[_0x71f8('0x99')],{'through':_0x71f8('0x194'),'as':_0x71f8('0x179')});db[_0x71f8('0x67')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x194'),'as':_0x71f8('0x188')});db[_0x71f8('0x67')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x13f'),'foreignKey':_0x71f8('0x193')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x124')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x17b'),'foreignKey':'OpenchannelInteractionId'});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db[_0x71f8('0x69')]['belongsTo'](db[_0x71f8('0x64')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x6b')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3d'),'foreignKey':_0x71f8('0x192')});db[_0x71f8('0x6b')]['belongsToMany'](db[_0x71f8('0xf5')],{'through':_0x71f8('0x195'),'as':'Teams'});db[_0x71f8('0x6d')]['hasMany'](db['Disposition'],{'as':_0x71f8('0x16f'),'foreignKey':'ChatWebsiteId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x6d')]['hasMany'](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x196')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x71f8('0x6d')][_0x71f8('0x129')](db[_0x71f8('0x72')],{'as':_0x71f8('0x184')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatApplication'],{'as':_0x71f8('0x18c')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatMessage'],{'as':_0x71f8('0x171')});db[_0x71f8('0x6d')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181')});db['ChatWebsite'][_0x71f8('0x15a')](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'as':_0x71f8('0x44'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x6d')]['belongsTo'](db['Pause'],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x6d')]['belongsToMany'](db['User'],{'as':_0x71f8('0x160'),'through':_0x71f8('0x146')});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x64')],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x6f')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db['OpenchannelMessage'],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db[_0x71f8('0x6f')]['belongsTo'](db[_0x71f8('0x6b')],{});db[_0x71f8('0x71')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x197'),'foreignKey':_0x71f8('0x128'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x71')][_0x71f8('0x15a')](db['ChatQueue'],{'as':_0x71f8('0x198'),'foreignKey':_0x71f8('0x199'),'onDelete':_0x71f8('0x16c')});db['ChatApplication']['belongsTo'](db[_0x71f8('0x6d')],{'as':_0x71f8('0x19a'),'foreignKey':'ChatWebsiteId','onDelete':_0x71f8('0x16c')});db['ChatApplication'][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x72')][_0x71f8('0x129')](db[_0x71f8('0x74')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x19b')});db[_0x71f8('0x72')]['belongsTo'](db[_0x71f8('0x6d')],{'as':'Account','foreignKey':_0x71f8('0x196')});db['ChatInteraction'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db['ChatInteraction'][_0x71f8('0x15a')](db['User'],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db['ChatInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x19c'),'as':'Tags'});db['ChatInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x19c'),'as':_0x71f8('0x188')});db[_0x71f8('0x72')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':'user_has_chat_interactions','foreignKey':_0x71f8('0x19b')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db['User'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x124')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db['CmContact'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x74')]['belongsTo'](db[_0x71f8('0x72')],{'onDelete':'cascade','as':_0x71f8('0x17b'),'foreignKey':'ChatInteractionId'});db[_0x71f8('0x74')][_0x71f8('0x15a')](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x71f8('0x17d')]['hasMany'](db[_0x71f8('0xf9')],{'as':_0x71f8('0x19d'),'foreignKey':_0x71f8('0x19e'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x17d')]['belongsTo'](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x17d')][_0x71f8('0x15a')](db['ChatWebsite'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x196')});db['ChatQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x35'),'hooks':!![]});db['ChatQueue'][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x19f'),'as':_0x71f8('0x161')});db[_0x71f8('0x78')]['hasMany'](db['ChatInternalMessage'],{'as':_0x71f8('0x171'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x71f8('0x78')]['belongsToMany'](db[_0x71f8('0x124')],{'as':'Members','through':'chat_group_has_users'});db[_0x71f8('0x79')][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x19a'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x1a0'),'foreignKey':_0x71f8('0x1a1')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0x9c')],{'as':_0x71f8('0x1a2'),'foreignKey':_0x71f8('0x1a3')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':'Hoppers','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x169')});db['CmContact'][_0x71f8('0x129')](db['CmHopperHistory'],{'as':_0x71f8('0x155'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0x85')],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0xe5')],{'as':_0x71f8('0x157'),'foreignKey':'ContactId'});db['CmContact'][_0x71f8('0x129')](db[_0x71f8('0x67')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db['ChatInteraction'],{'as':_0x71f8('0x13a'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x13e'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x52')],{'as':_0x71f8('0x13c'),'foreignKey':'ContactId','onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x49')],{'as':_0x71f8('0x12f'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x15a')](db[_0x71f8('0x7b')],{'as':_0x71f8('0x1a4'),'foreignKey':'CompanyId'});db['CmContact'][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x7d')]['belongsToMany'](db['User'],{'as':_0x71f8('0x17a'),'through':'cm_user_has_contacts'});db[_0x71f8('0x7d')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'as':_0x71f8('0x179'),'through':_0x71f8('0x1a5')});db[_0x71f8('0x7d')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1a5'),'as':_0x71f8('0x188')});db[_0x71f8('0x7e')][_0x71f8('0x129')](db[_0x71f8('0x9e')],{'as':_0x71f8('0x1a6'),'foreignKey':'CmHopperId'});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')]['belongsTo'](db[_0x71f8('0x124')],{'as':'Agent','foreignKey':'UserId'});db[_0x71f8('0x7e')]['belongsTo'](db[_0x71f8('0x1d')],{'as':_0x71f8('0x198'),'foreignKey':_0x71f8('0x153'),'onDelete':_0x71f8('0x125')});db['CmHopper'][_0x71f8('0x15a')](db[_0x71f8('0x1a7')],{'as':_0x71f8('0x1a7'),'foreignKey':_0x71f8('0x1a8'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x71f8('0x7f')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7f')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181'),'onDelete':_0x71f8('0x125')});db['CmHopperBlack'][_0x71f8('0x15a')](db[_0x71f8('0x1d')],{'as':'Queue','foreignKey':_0x71f8('0x153'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7f')][_0x71f8('0x15a')](db[_0x71f8('0x1a7')],{'as':_0x71f8('0x1a7'),'foreignKey':_0x71f8('0x1a8'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x8b')][_0x71f8('0x129')](db[_0x71f8('0x1a9')],{'as':{'plural':'All','singular':_0x71f8('0x1aa')},'foreignKey':'AutomationAllId','onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x8b')]['hasMany'](db[_0x71f8('0x1a9')],{'as':{'plural':_0x71f8('0x1ab'),'singular':_0x71f8('0x1ac')},'foreignKey':_0x71f8('0x1ad'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x71f8('0x1ae'),'foreignKey':_0x71f8('0x1af'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x8f')]['hasMany'](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x1b0'),'onDelete':'cascade'});db[_0x71f8('0x91')][_0x71f8('0x129')](db['Interval'],{'as':_0x71f8('0x1b1'),'foreignKey':_0x71f8('0x17e'),'onDelete':_0x71f8('0x125'),'hooks':!![],'required':![]});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x12c'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x172')],{'as':_0x71f8('0x1b2'),'foreignKey':'IntervalId'});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x71')],{'as':'ChatApplications','foreignKey':'IntervalId'});db['Interval'][_0x71f8('0x129')](db[_0x71f8('0x185')],{'as':_0x71f8('0x1b3'),'foreignKey':'IntervalId'});db['Interval'][_0x71f8('0x129')](db[_0x71f8('0x5c')],{'as':_0x71f8('0x1b4'),'foreignKey':'IntervalId'});db[_0x71f8('0x1b5')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{});db[_0x71f8('0x1b5')][_0x71f8('0x15a')](db['AnalyticDefaultReport'],{'foreignKey':_0x71f8('0x1b6')});db['Schedule']['belongsTo'](db[_0x71f8('0xa6')],{'foreignKey':'CustomReportId'});db[_0x71f8('0x98')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x71f8('0x1b7'),'through':_0x71f8('0x1b8'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x7d')],{'through':_0x71f8('0x1a5')});db['Tag'][_0x71f8('0x134')](db[_0x71f8('0x72')],{'through':'chat_interaction_has_tags'});db[_0x71f8('0x99')]['belongsToMany'](db['MailInteraction'],{'through':_0x71f8('0x1b9')});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x5e')],{'through':_0x71f8('0x18e')});db[_0x71f8('0x99')]['belongsToMany'](db['FaxInteraction'],{'through':_0x71f8('0x1ba')});db[_0x71f8('0x99')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x112')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem']['belongsTo'](db[_0x71f8('0x9b')],{'as':_0x71f8('0x1bb'),'foreignKey':'ItemTypeId'});db[_0x71f8('0x9e')][_0x71f8('0x15a')](db['CmHopper'],{'as':_0x71f8('0x1bc'),'foreignKey':_0x71f8('0x1bd')});db[_0x71f8('0x9c')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'CmContactId'});db[_0x71f8('0xa1')][_0x71f8('0x129')](db[_0x71f8('0x1a9')],{'as':{'plural':_0x71f8('0x1be'),'singular':_0x71f8('0x1bf')},'foreignKey':'TriggerAllId','onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa1')]['hasMany'](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x71f8('0x1c0'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa1')][_0x71f8('0x129')](db[_0x71f8('0x89')],{'as':_0x71f8('0x1ae'),'foreignKey':_0x71f8('0x1c1'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa6')]['hasMany'](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c3'),'hooks':!![]});db[_0x71f8('0xa8')][_0x71f8('0x129')](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1b6')});db[_0x71f8('0xac')][_0x71f8('0x129')](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x71f8('0x15a')](db[_0x71f8('0xac')],{'foreignKey':_0x71f8('0x1c4')});db[_0x71f8('0xb1')]['hasMany'](db[_0x71f8('0xb3')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb3')]['hasMany'](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xb3')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['SalesforceConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x71f8('0x15a')](db[_0x71f8('0xb1')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb5')][_0x71f8('0x129')](db['SalesforceField'],{'as':_0x71f8('0x1cb'),'foreignKey':'SubjectId'});db[_0x71f8('0xb5')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xb5')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1cd'),'foreignKey':'FieldId'});db[_0x71f8('0xb5')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0x1cf')][_0x71f8('0x129')](db[_0x71f8('0xb7')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db['SugarcrmConfiguration'][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db['SugarcrmConfiguration'][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':'DescriptionId'});db[_0x71f8('0xb7')]['hasMany'](db[_0x71f8('0xb8')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xb7')][_0x71f8('0x15a')](db[_0x71f8('0x1cf')],{'as':'Account','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb8')][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['SugarcrmField'][_0x71f8('0x129')](db[_0x71f8('0xb8')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xb8')][_0x71f8('0x129')](db[_0x71f8('0xb8')],{'as':'Field','foreignKey':'FieldId'});db[_0x71f8('0xb8')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':'VariableId'});db[_0x71f8('0xba')][_0x71f8('0x129')](db[_0x71f8('0xbb')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xbb')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db['DeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1c9'),'onDelete':'cascade','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xbb')][_0x71f8('0x129')](db['DeskField'],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xbb')][_0x71f8('0x15a')](db[_0x71f8('0xba')],{'as':'Account','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xbb')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d2')});db[_0x71f8('0x1d1')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0x1d1')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':'Description','foreignKey':_0x71f8('0x1ca')});db['DeskField'][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d1')][_0x71f8('0x15a')](db['Variable'],{'as':'Variable','foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xbe')][_0x71f8('0x129')](db[_0x71f8('0x1d3')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':'AccountId'});db[_0x71f8('0x1d3')]['hasMany'](db[_0x71f8('0xc1')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':'SubjectId'});db[_0x71f8('0x1d3')]['hasMany'](db[_0x71f8('0xc1')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0x1d3')][_0x71f8('0x129')](db[_0x71f8('0xc1')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d3')][_0x71f8('0x15a')](db['ZohoAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xc1')]['hasMany'](db[_0x71f8('0xc1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x71f8('0xc1')][_0x71f8('0x129')](db['ZohoField'],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc1')][_0x71f8('0x129')](db['ZohoField'],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc1')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xc3')][_0x71f8('0x129')](db[_0x71f8('0xc4')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x71f8('0x129')](db['ZendeskField'],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xc4')][_0x71f8('0x129')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x71f8('0x1ca')});db['ZendeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':'Fields','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc4')][_0x71f8('0x15a')](db[_0x71f8('0xc3')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xc4')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d4')});db[_0x71f8('0xc5')][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['ZendeskField'][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc5')]['hasMany'](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc5')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xc6')][_0x71f8('0x129')](db[_0x71f8('0x1d5')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d5')][_0x71f8('0x129')](db['FreshdeskField'],{'as':_0x71f8('0x1c7'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c8')});db['FreshdeskConfiguration']['hasMany'](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['FreshdeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d5')][_0x71f8('0x15a')](db[_0x71f8('0xc6')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d5')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d6')});db['FreshdeskField']['hasMany'](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xc9')][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc9')][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':'Field','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc9')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xca')][_0x71f8('0x129')](db['VtigerConfiguration'],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c9'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c2'),'foreignKey':'FieldId'});db[_0x71f8('0xcb')][_0x71f8('0x15a')](db['VtigerAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xcd')]['hasMany'](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xcd')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xcd')]['hasMany'](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xcd')]['belongsTo'](db['Variable'],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db['ServicenowAccount']['hasMany'](db[_0x71f8('0x1d7')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d7')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db['ServicenowConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1c9'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Fields','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d7')]['belongsTo'](db['ServicenowAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd1')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Subject','foreignKey':_0x71f8('0x1c8')});db['ServicenowField'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Description','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xd1')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1cd'),'foreignKey':'FieldId'});db[_0x71f8('0xd1')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xd3')][_0x71f8('0x129')](db[_0x71f8('0xd5')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd3')]['belongsTo'](db['CloudProvider'],{'as':_0x71f8('0x11c'),'foreignKey':'CloudProviderId'});db[_0x71f8('0xd5')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1c7'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd5')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['Dynamics365Configuration'][_0x71f8('0x129')](db['Dynamics365Field'],{'as':_0x71f8('0x1c2'),'onDelete':'cascade','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xd5')]['belongsTo'](db[_0x71f8('0xd3')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db['Dynamics365Field'][_0x71f8('0x129')](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd7')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db['Dynamics365Field'][_0x71f8('0x129')](db['Dynamics365Field'],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xd7')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0x1d8')][_0x71f8('0x129')](db[_0x71f8('0xd9')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd9')]['hasMany'](db['FreshsalesField'],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1c9'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xd9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1c2'),'foreignKey':'FieldId'});db[_0x71f8('0xd9')][_0x71f8('0x15a')](db['FreshsalesAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db['FreshsalesField'][_0x71f8('0x129')](db['FreshsalesField'],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['FreshsalesField'][_0x71f8('0x129')](db['FreshsalesField'],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0x1d9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d9')][_0x71f8('0x15a')](db['Variable'],{'as':_0x71f8('0xa3'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{});db['ChatQueueReport']['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['ChatQueueReport'][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0xdf')][_0x71f8('0x15a')](db[_0x71f8('0x72')],{});db[_0x71f8('0xdf')]['belongsTo'](db[_0x71f8('0x74')],{});db[_0x71f8('0xdf')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db['ChatQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x142')],{});db[_0x71f8('0xe0')]['belongsTo'](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'foreignKey':'FromId'});db[_0x71f8('0xe0')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1da')});db[_0x71f8('0xe5')][_0x71f8('0x129')](db['JscriptyQuestionReport'],{'foreignKey':_0x71f8('0x1db'),'onDelete':_0x71f8('0x125')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x71f8('0x125')});db[_0x71f8('0xe6')]['belongsTo'](db[_0x71f8('0x5a')],{});db[_0x71f8('0xe6')]['belongsTo'](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['SmsInteraction'],{});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['SmsMessage'],{});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db['SmsQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x62')],{});db['JscriptyProject'][_0x71f8('0x129')](db[_0x71f8('0xe5')],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xec')][_0x71f8('0x129')](db[_0x71f8('0xe3')],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xec')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x138')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'through':_0x71f8('0x11d'),'as':'VoiceQueues'});db['Team'][_0x71f8('0x134')](db['MailQueue'],{'through':_0x71f8('0x175'),'as':_0x71f8('0x1dd')});db[_0x71f8('0xf5')]['belongsToMany'](db[_0x71f8('0x142')],{'through':_0x71f8('0x19f'),'as':_0x71f8('0x143')});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x56')],{'through':_0x71f8('0x18a'),'as':'FaxQueues'});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x62')],{'through':_0x71f8('0x190'),'as':'SmsQueues'});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x6b')],{'through':'team_has_openchannel_queues','as':_0x71f8('0x1de')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x11a')],{'through':_0x71f8('0x1df'),'as':_0x71f8('0x145')});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x1e0')],{'through':_0x71f8('0x11f'),'as':'VoicePrefixes'});db[_0x71f8('0x1a7')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':_0x71f8('0x1e1'),'foreignKey':_0x71f8('0x1a8')});db['Campaign']['hasMany'](db['CmHopperFinal'],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x1a8')});db[_0x71f8('0x1a7')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':'HopperHistories','foreignKey':_0x71f8('0x1a8')});db['Campaign'][_0x71f8('0x129')](db['CmHopperBlack'],{'as':_0x71f8('0x156'),'foreignKey':'CampaignId'});db['Campaign'][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':'Trunk','foreignKey':_0x71f8('0x159')});db[_0x71f8('0x1a7')]['belongsTo'](db[_0x71f8('0x158')],{'as':_0x71f8('0x15b'),'foreignKey':_0x71f8('0x15c')});db[_0x71f8('0x1a7')]['belongsTo'](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x1a7')][_0x71f8('0x15a')](db[_0x71f8('0xf0')],{'as':_0x71f8('0xf0'),'foreignKey':_0x71f8('0x1e2')});db[_0x71f8('0x1a7')]['belongsToMany'](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':_0x71f8('0x1e3')});db[_0x71f8('0x1a7')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':'BlackLists','through':_0x71f8('0x1e4')});db['Attachment']['belongsTo'](db[_0x71f8('0x17d')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x4a')],{});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{});db['MailTransferReport'][_0x71f8('0x15a')](db['MailAccount'],{'foreignKey':_0x71f8('0x1e5'),'as':_0x71f8('0x1e6')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'FromUserId','as':_0x71f8('0x1e7')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x71f8('0x1ea')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'foreignKey':'ToMailAccountId','as':_0x71f8('0x1eb')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x74')],{});db[_0x71f8('0xff')]['belongsTo'](db[_0x71f8('0x72')],{});db[_0x71f8('0xff')][_0x71f8('0x15a')](db['ChatWebsite'],{'foreignKey':_0x71f8('0x1ec'),'as':_0x71f8('0x1e6')});db['ChatTransferReport'][_0x71f8('0x15a')](db['User'],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x142')],{'foreignKey':_0x71f8('0x1ee'),'as':_0x71f8('0x1ea')});db['ChatTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'foreignKey':_0x71f8('0x1ef'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x101')]['belongsTo'](db[_0x71f8('0x54')],{});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x52')],{});db[_0x71f8('0x101')]['belongsTo'](db[_0x71f8('0x147')],{'foreignKey':'FromFaxAccountId','as':_0x71f8('0x1e6')});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':'ToAgent'});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'foreignKey':_0x71f8('0x1f0'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x103')][_0x71f8('0x15a')](db[_0x71f8('0x69')],{});db[_0x71f8('0x103')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{});db[_0x71f8('0x103')]['belongsTo'](db[_0x71f8('0x64')],{'foreignKey':'FromOpenchannelAccountId','as':_0x71f8('0x1e6')});db['OpenchannelTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'FromUserId','as':'FromAgent'});db['OpenchannelTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0x103')][_0x71f8('0x15a')](db['OpenchannelQueue'],{'foreignKey':_0x71f8('0x1f1'),'as':'ToQueue'});db[_0x71f8('0x103')][_0x71f8('0x15a')](db['OpenchannelAccount'],{'foreignKey':_0x71f8('0x1f2'),'as':_0x71f8('0x1eb')});db['SmsTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x60')],{});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5e')],{});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'foreignKey':_0x71f8('0x1f3'),'as':_0x71f8('0x1e6')});db['SmsTransferReport']['belongsTo'](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'ToUserId','as':_0x71f8('0x1e9')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x62')],{'foreignKey':_0x71f8('0x1f4'),'as':_0x71f8('0x1ea')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'foreignKey':_0x71f8('0x1f5'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x107')][_0x71f8('0x129')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x71f8('0x181'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x107')][_0x71f8('0x129')](db['CmCustomField'],{'as':_0x71f8('0x1f6'),'foreignKey':_0x71f8('0x181')});db['CmList'][_0x71f8('0x129')](db[_0x71f8('0x7d')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db[_0x71f8('0x83')],{'as':_0x71f8('0x12d'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db['ReportAgentPreview'],{'as':_0x71f8('0x85'),'foreignKey':'ListId'});db[_0x71f8('0x107')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'as':_0x71f8('0x1f7'),'through':'voice_queues_has_cm_lists'});db[_0x71f8('0x107')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'cm_user_has_lists'});db[_0x71f8('0x1e0')]['hasMany'](db['VoiceExtension'],{'as':_0x71f8('0x12c'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x1e0')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'UserVoicePrefix'});db[_0x71f8('0x1e0')]['belongsToMany'](db[_0x71f8('0xf5')],{'through':'TeamVoicePrefix','as':_0x71f8('0x161')});db[_0x71f8('0x109')]['hasMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'foreignKey':_0x71f8('0x133')});db[_0x71f8('0x109')][_0x71f8('0x129')](db[_0x71f8('0x10a')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x71f8('0x125')});db['UserProfileSection'][_0x71f8('0x129')](db[_0x71f8('0x10c')],{'as':_0x71f8('0x1f8'),'foreignKey':_0x71f8('0x1f9'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db['Disposition'],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x1fa'),'onDelete':'cascade'});db[_0x71f8('0x10f')]['hasMany'](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x114')],{'as':_0x71f8('0x171'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x112')],{'as':'Interactions'});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x111')],{'as':_0x71f8('0x18c')});db['WhatsappAccount']['belongsTo'](db[_0x71f8('0x107')],{'as':'List','foreignKey':'ListId'});db[_0x71f8('0x10f')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x71f8('0x10f')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':'Agents','through':_0x71f8('0x14f')});db[_0x71f8('0x111')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x111')][_0x71f8('0x15a')](db[_0x71f8('0x11a')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x111')]['belongsTo'](db[_0x71f8('0x10f')],{'onDelete':_0x71f8('0x16c')});db['WhatsappApplication']['belongsTo'](db[_0x71f8('0x91')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x71f8('0x111')][_0x71f8('0x15a')](db['Tag'],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x112')][_0x71f8('0x129')](db['WhatsappMessage'],{'as':_0x71f8('0x171'),'onDelete':'cascade','foreignKey':_0x71f8('0x1fb')});db[_0x71f8('0x112')]['belongsTo'](db['WhatsappAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x112')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'ContactId'});db[_0x71f8('0x112')]['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':'UserId'});db[_0x71f8('0x112')]['belongsToMany'](db['Tag'],{'through':_0x71f8('0x1fc'),'as':_0x71f8('0x179')});db[_0x71f8('0x112')][_0x71f8('0x134')](db['Tag'],{'through':_0x71f8('0x1fc'),'as':_0x71f8('0x188')});db[_0x71f8('0x112')][_0x71f8('0x134')](db['User'],{'as':'Users','through':_0x71f8('0x140'),'foreignKey':_0x71f8('0x1fb')});db[_0x71f8('0x114')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db['WhatsappMessage'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x114')][_0x71f8('0x15a')](db['WhatsappInteraction'],{'onDelete':_0x71f8('0x125'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x71f8('0x114')][_0x71f8('0x15a')](db['WhatsappAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x116')][_0x71f8('0x15a')](db['WhatsappAccount'],{});db[_0x71f8('0x116')]['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'ContactId'});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x112')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x71f8('0x11a')],{});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x114')],{});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db[_0x71f8('0x118')]['belongsTo'](db[_0x71f8('0x114')],{});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x112')],{});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x10f')],{'foreignKey':_0x71f8('0x1fd'),'as':_0x71f8('0x1e6')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x10f')],{'foreignKey':_0x71f8('0x1fe'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x11a')],{'foreignKey':_0x71f8('0x1ff'),'as':_0x71f8('0x1ea')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db['WhatsappTransferReport']['belongsTo'](db[_0x71f8('0x124')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x71f8('0x11a')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3f'),'foreignKey':_0x71f8('0x200')});db[_0x71f8('0x11a')][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x1df'),'as':_0x71f8('0x161')});db[_0x71f8('0x122')][_0x71f8('0x15a')](db['User'],{'as':'user','foreignKey':'UserId','onDelete':'cascade','hooks':!![]});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0xd3')],{'as':_0x71f8('0xd3'),'onDelete':'restrict'});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0x41')],{'as':_0x71f8('0x16d'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0x42')],{'as':_0x71f8('0x16e'),'onDelete':'restrict'});module[_0x71f8('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index c53c002..36f2714 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f11=['./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/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/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./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/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/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/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','/www','static','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','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/voiceRecording','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog'];(function(_0x5a9fad,_0x4a4e40){var _0x1f1585=function(_0x5f4faa){while(--_0x5f4faa){_0x5a9fad['push'](_0x5a9fad['shift']());}};_0x1f1585(++_0x4a4e40);}(_0x7f11,0xa7));var _0x17f1=function(_0x47c700,_0x25f2c8){_0x47c700=_0x47c700-0x0;var _0x26c26c=_0x7f11[_0x47c700];return _0x26c26c;};'use strict';var path=require('path');var express=require(_0x17f1('0x0'));var errors=require(_0x17f1('0x1'));var config=require(_0x17f1('0x2'));var setupLoggers=require(_0x17f1('0x3'))[_0x17f1('0x4')];var clientSideLogs=require(_0x17f1('0x5'));exports['default']=function(_0x5667a8){return setupLoggers(_0x5667a8)[_0x17f1('0x6')](function(){_0x5667a8[_0x17f1('0x7')](_0x17f1('0x8'),require(_0x17f1('0x9')));_0x5667a8['use'](_0x17f1('0xa'),require(_0x17f1('0xb')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc'),require(_0x17f1('0xd')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xe'),require(_0x17f1('0xf')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x10'),require(_0x17f1('0x11')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x12'),require(_0x17f1('0x13')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x14'),require(_0x17f1('0x15')));_0x5667a8['use']('/api/screen/recordings',require(_0x17f1('0x16')));_0x5667a8[_0x17f1('0x7')]('/api/voice/mails',require(_0x17f1('0x17')));_0x5667a8['use'](_0x17f1('0x18'),require(_0x17f1('0x19')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x1a'),require('./api/voiceCallReport'));_0x5667a8[_0x17f1('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x1b'),require('./api/voiceAgentReport'));_0x5667a8[_0x17f1('0x7')]('/api/voice/queues/reports',require(_0x17f1('0x1c')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x1d'),require(_0x17f1('0x1e')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x1f'),require(_0x17f1('0x20')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x21'),require('./api/voiceTransferReport'));_0x5667a8['use']('/api/mail/out_servers',require(_0x17f1('0x22')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x23'),require('./api/mailAccount'));_0x5667a8[_0x17f1('0x7')]('/api/mail/queues',require(_0x17f1('0x24')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x25'),require(_0x17f1('0x26')));_0x5667a8[_0x17f1('0x7')]('/api/mail/interactions',require(_0x17f1('0x27')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x28'),require(_0x17f1('0x29')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x2a'),require(_0x17f1('0x2b')));_0x5667a8[_0x17f1('0x7')]('/api/mail/reports/queue',require(_0x17f1('0x2c')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x2d'),require(_0x17f1('0x2e')));_0x5667a8[_0x17f1('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x2f'),require(_0x17f1('0x30')));_0x5667a8[_0x17f1('0x7')]('/api/fax/applications',require(_0x17f1('0x31')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x32'),require(_0x17f1('0x33')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x34'),require(_0x17f1('0x35')));_0x5667a8['use'](_0x17f1('0x36'),require('./api/faxQueue'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x37'),require('./api/faxQueueReport'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x38'),require(_0x17f1('0x39')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x3a'),require('./api/smsApplication'));_0x5667a8['use'](_0x17f1('0x3b'),require(_0x17f1('0x3c')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x3d'),require(_0x17f1('0x3e')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x3f'),require(_0x17f1('0x40')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x41'),require(_0x17f1('0x42')));_0x5667a8['use'](_0x17f1('0x43'),require(_0x17f1('0x44')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x45'),require('./api/openchannelInteraction'));_0x5667a8['use']('/api/openchannel/messages',require(_0x17f1('0x46')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x47'),require('./api/openchannelQueue'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x48'),require('./api/chatWebsite'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x49'),require('./api/openchannelQueueReport'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x4a'),require(_0x17f1('0x4b')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x4c'),require(_0x17f1('0x4d')));_0x5667a8['use']('/api/chat/messages',require(_0x17f1('0x4e')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x4f'),require(_0x17f1('0x50')));_0x5667a8[_0x17f1('0x7')]('/api/chat/queues',require(_0x17f1('0x51')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x52'),require('./api/chatGroup'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x53'),require(_0x17f1('0x54')));_0x5667a8['use']('/api/cm/companies',require(_0x17f1('0x55')));_0x5667a8['use'](_0x17f1('0x56'),require(_0x17f1('0x57')));_0x5667a8['use'](_0x17f1('0x58'),require('./api/cmHopper'));_0x5667a8['use']('/api/cm/hopper_black',require(_0x17f1('0x59')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x5a'),require(_0x17f1('0x5b')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x5c'),require(_0x17f1('0x5d')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x5e'),require(_0x17f1('0x5f')));_0x5667a8[_0x17f1('0x7')]('/api/actions',require('./api/action'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x60'),require(_0x17f1('0x61')));_0x5667a8[_0x17f1('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x5667a8[_0x17f1('0x7')]('/api/dispositions',require('./api/disposition'));_0x5667a8['use'](_0x17f1('0x62'),require(_0x17f1('0x63')));_0x5667a8['use'](_0x17f1('0x64'),require(_0x17f1('0x65')));_0x5667a8['use'](_0x17f1('0x66'),require(_0x17f1('0x67')));_0x5667a8[_0x17f1('0x7')]('/api/cdr',require(_0x17f1('0x68')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x69'),require(_0x17f1('0x6a')));_0x5667a8[_0x17f1('0x7')]('/api/schedules',require(_0x17f1('0x6b')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x6c'),require(_0x17f1('0x6d')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x6e'),require(_0x17f1('0x6f')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x70'),require('./api/contactItemType'));_0x5667a8['use'](_0x17f1('0x71'),require('./api/cmContactHasItem'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x72'),require(_0x17f1('0x73')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x74'),require('./api/template'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x75'),require(_0x17f1('0x76')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x77'),require(_0x17f1('0x78')));_0x5667a8[_0x17f1('0x7')]('/api/integrations',require(_0x17f1('0x79')));_0x5667a8[_0x17f1('0x7')]('/api/integrations/reports',require(_0x17f1('0x7a')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x7b'),require(_0x17f1('0x7c')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x7d'),require(_0x17f1('0x7e')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x7f'),require(_0x17f1('0x80')));_0x5667a8['use'](_0x17f1('0x81'),require(_0x17f1('0x82')));_0x5667a8['use'](_0x17f1('0x83'),require('./api/analyticFieldReport'));_0x5667a8['use'](_0x17f1('0x84'),require(_0x17f1('0x85')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x86'),require('./api/intSalesforceAccount'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x87'),require('./api/intSalesforceConfiguration'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x88'),require('./api/intSalesforceField'));_0x5667a8['use'](_0x17f1('0x89'),require('./api/intSugarcrmAccount'));_0x5667a8[_0x17f1('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x17f1('0x8a')));_0x5667a8['use'](_0x17f1('0x8b'),require(_0x17f1('0x8c')));_0x5667a8['use']('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x5667a8[_0x17f1('0x7')]('/api/integrations/desk/configurations',require(_0x17f1('0x8d')));_0x5667a8['use'](_0x17f1('0x8e'),require(_0x17f1('0x8f')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x90'),require('./api/intZohoAccount'));_0x5667a8[_0x17f1('0x7')]('/api/integrations/zoho/configurations',require(_0x17f1('0x91')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x92'),require(_0x17f1('0x93')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x94'),require(_0x17f1('0x95')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x96'),require(_0x17f1('0x97')));_0x5667a8['use'](_0x17f1('0x98'),require('./api/intZendeskField'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x99'),require(_0x17f1('0x9a')));_0x5667a8[_0x17f1('0x7')]('/api/integrations/freshdesk/configurations',require(_0x17f1('0x9b')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x9c'),require('./api/intFreshdeskField'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x9d'),require(_0x17f1('0x9e')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x9f'),require(_0x17f1('0xa0')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xa1'),require('./api/intVtigerField'));_0x5667a8[_0x17f1('0x7')]('/api/integrations/servicenow/accounts',require(_0x17f1('0xa2')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xa3'),require(_0x17f1('0xa4')));_0x5667a8[_0x17f1('0x7')]('/api/integrations/servicenow/fields',require(_0x17f1('0xa5')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xa6'),require(_0x17f1('0xa7')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xa8'),require(_0x17f1('0xa9')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xaa'),require(_0x17f1('0xab')));_0x5667a8[_0x17f1('0x7')]('/api/integrations/freshsales/accounts',require(_0x17f1('0xac')));_0x5667a8['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x5667a8['use'](_0x17f1('0xad'),require(_0x17f1('0xae')));_0x5667a8['use'](_0x17f1('0xaf'),require(_0x17f1('0xb0')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xb1'),require(_0x17f1('0xb2')));_0x5667a8['use'](_0x17f1('0xb3'),require(_0x17f1('0xb4')));_0x5667a8['use'](_0x17f1('0xb5'),require(_0x17f1('0xb6')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xb7'),require(_0x17f1('0xb8')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xb9'),require(_0x17f1('0xba')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xbb'),require(_0x17f1('0xbc')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xbd'),require('./api/squareReport'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xbe'),require(_0x17f1('0xbf')));_0x5667a8[_0x17f1('0x7')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x5667a8[_0x17f1('0x7')]('/api/settings',require('./api/setting'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc0'),require(_0x17f1('0xc1')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc2'),require(_0x17f1('0xc3')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc4'),require(_0x17f1('0xc5')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc6'),require('./api/squareMessage'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc7'),require(_0x17f1('0xc8')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xc9'),require(_0x17f1('0xca')));_0x5667a8['use']('/api/campaigns',require(_0x17f1('0xcb')));_0x5667a8[_0x17f1('0x7')]('/api/migrations',require(_0x17f1('0xcc')));_0x5667a8['use'](_0x17f1('0xcd'),require(_0x17f1('0xce')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xcf'),require(_0x17f1('0xd0')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xd1'),require(_0x17f1('0xd2')));_0x5667a8['use'](_0x17f1('0xd3'),require(_0x17f1('0xd4')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xd5'),require('./api/faxTransferReport'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xd6'),require('./api/openchannelTransferReport'));_0x5667a8['use'](_0x17f1('0xd7'),require(_0x17f1('0xd8')));_0x5667a8['use'](_0x17f1('0xd9'),require(_0x17f1('0xda')));_0x5667a8['use'](_0x17f1('0xdb'),require(_0x17f1('0xdc')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xdd'),require('./api/userProfile'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xde'),require(_0x17f1('0xdf')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xe0'),require(_0x17f1('0xe1')));_0x5667a8['use'](_0x17f1('0xe2'),require(_0x17f1('0xe3')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xe4'),require('./api/whatsappAccount'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xe5'),require(_0x17f1('0xe6')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xe7'),require('./api/whatsappInteraction'));_0x5667a8['use'](_0x17f1('0xe8'),require(_0x17f1('0xe9')));_0x5667a8[_0x17f1('0x7')]('/api/whatsapp/reports/queue',require(_0x17f1('0xea')));_0x5667a8['use'](_0x17f1('0xeb'),require(_0x17f1('0xec')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xed'),require(_0x17f1('0xee')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xef'),require(_0x17f1('0xf0')));_0x5667a8['use'](_0x17f1('0xf1'),require(_0x17f1('0xf2')));_0x5667a8[_0x17f1('0x7')]('/api/user-settings',require('./api/user-setting'));_0x5667a8[_0x17f1('0x7')]('/api/auth/local',require('./api/authLocal'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xf3'),require(_0x17f1('0xf4')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xf5'),require(_0x17f1('0xf6')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xf7'),require('./api/jira'));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xf8'),require(_0x17f1('0xf9')));_0x5667a8['use'](_0x17f1('0xfa'),require(_0x17f1('0xfb')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0xfc'),require(_0x17f1('0xfd')));_0x5667a8['use'](_0x17f1('0xfe'),require(_0x17f1('0xff')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x100'),require(_0x17f1('0x101')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x102'),clientSideLogs);_0x5667a8[_0x17f1('0x7')](_0x17f1('0x103'),express['static'](path[_0x17f1('0x104')](config[_0x17f1('0x105')],'/apidoc')));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x106'),express[_0x17f1('0x107')](path[_0x17f1('0x104')](config[_0x17f1('0x105')],_0x17f1('0x106'))));_0x5667a8[_0x17f1('0x7')](_0x17f1('0x108'),express[_0x17f1('0x107')](path[_0x17f1('0x104')](config[_0x17f1('0x105')],_0x17f1('0x108'))));_0x5667a8['use']('/snippet',express['static'](path[_0x17f1('0x104')](config['root'],_0x17f1('0x109'),_0x17f1('0x10a'))));_0x5667a8['use'](_0x17f1('0x10b'),express[_0x17f1('0x107')](path[_0x17f1('0x104')](config[_0x17f1('0x105')],_0x17f1('0x10c'))));_0x5667a8[_0x17f1('0x10d')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x17f1('0x10e')](errors[0x194]);_0x5667a8[_0x17f1('0x10d')]('/*')['get'](function(_0x1bb77e,_0x521172){_0x521172[_0x17f1('0x10f')](path['resolve'](_0x5667a8[_0x17f1('0x10e')](_0x17f1('0x110'))+_0x17f1('0x111')));});return _0x5667a8;});}; \ No newline at end of file +var _0x1f8c=['./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','then','/api/users','./api/user','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./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/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages'];(function(_0x1bc443,_0x244e86){var _0x3c590d=function(_0x346dc7){while(--_0x346dc7){_0x1bc443['push'](_0x1bc443['shift']());}};_0x3c590d(++_0x244e86);}(_0x1f8c,0x163));var _0xc1f8=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x1f8c[_0x1196bd];return _0x26014f;};'use strict';var path=require('path');var express=require(_0xc1f8('0x0'));var errors=require(_0xc1f8('0x1'));var config=require(_0xc1f8('0x2'));var setupLoggers=require(_0xc1f8('0x3'))[_0xc1f8('0x4')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0xab80e7){return setupLoggers(_0xab80e7)[_0xc1f8('0x5')](function(){_0xab80e7['use'](_0xc1f8('0x6'),require(_0xc1f8('0x7')));_0xab80e7[_0xc1f8('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0xab80e7['use'](_0xc1f8('0x9'),require(_0xc1f8('0xa')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb'),require(_0xc1f8('0xc')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd'),require('./api/voiceMusicOnHold'));_0xab80e7[_0xc1f8('0x8')]('/api/voice/queues',require(_0xc1f8('0xe')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf'),require(_0xc1f8('0x10')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x11'),require(_0xc1f8('0x12')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x13'),require(_0xc1f8('0x14')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x15'),require(_0xc1f8('0x16')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x17'),require(_0xc1f8('0x18')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x19'),require(_0xc1f8('0x1a')));_0xab80e7['use']('/api/voice/agents/reports',require(_0xc1f8('0x1b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x1c'),require(_0xc1f8('0x1d')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x1e'),require('./api/memberReport'));_0xab80e7['use'](_0xc1f8('0x1f'),require(_0xc1f8('0x20')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x21'),require(_0xc1f8('0x22')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x23'),require(_0xc1f8('0x24')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x25'),require(_0xc1f8('0x26')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x27'),require(_0xc1f8('0x28')));_0xab80e7[_0xc1f8('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x29'),require(_0xc1f8('0x2a')));_0xab80e7[_0xc1f8('0x8')]('/api/mail/messages',require(_0xc1f8('0x2b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x2c'),require(_0xc1f8('0x2d')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x2e'),require(_0xc1f8('0x2f')));_0xab80e7[_0xc1f8('0x8')]('/api/dashboards',require(_0xc1f8('0x30')));_0xab80e7['use'](_0xc1f8('0x31'),require(_0xc1f8('0x32')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x33'),require(_0xc1f8('0x34')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x35'),require(_0xc1f8('0x36')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x37'),require(_0xc1f8('0x38')));_0xab80e7['use'](_0xc1f8('0x39'),require(_0xc1f8('0x3a')));_0xab80e7[_0xc1f8('0x8')]('/api/fax/queues',require('./api/faxQueue'));_0xab80e7['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3b'),require(_0xc1f8('0x3c')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3d'),require(_0xc1f8('0x3e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3f'),require(_0xc1f8('0x40')));_0xab80e7[_0xc1f8('0x8')]('/api/sms/messages',require(_0xc1f8('0x41')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x42'),require(_0xc1f8('0x43')));_0xab80e7['use'](_0xc1f8('0x44'),require(_0xc1f8('0x45')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x46'),require(_0xc1f8('0x47')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x48'),require('./api/openchannelInteraction'));_0xab80e7['use'](_0xc1f8('0x49'),require(_0xc1f8('0x4a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x4b'),require(_0xc1f8('0x4c')));_0xab80e7['use']('/api/chat/websites',require(_0xc1f8('0x4d')));_0xab80e7[_0xc1f8('0x8')]('/api/openchannel/reports/queue',require(_0xc1f8('0x4e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x4f'),require(_0xc1f8('0x50')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x51'),require(_0xc1f8('0x52')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/messages',require(_0xc1f8('0x53')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x54'),require('./api/chatOfflineMessage'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x55'),require(_0xc1f8('0x56')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/groups',require(_0xc1f8('0x57')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/proactive_actions',require(_0xc1f8('0x58')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x59'),require('./api/cmCompany'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x5a'),require(_0xc1f8('0x5b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x5c'),require(_0xc1f8('0x5d')));_0xab80e7['use'](_0xc1f8('0x5e'),require(_0xc1f8('0x5f')));_0xab80e7['use'](_0xc1f8('0x60'),require('./api/cmHopperFinal'));_0xab80e7['use'](_0xc1f8('0x61'),require(_0xc1f8('0x62')));_0xab80e7['use'](_0xc1f8('0x63'),require('./api/cmCustomField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x64'),require(_0xc1f8('0x65')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x66'),require(_0xc1f8('0x67')));_0xab80e7[_0xc1f8('0x8')]('/api/canned_answers',require('./api/cannedAnswer'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x68'),require(_0xc1f8('0x69')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6a'),require('./api/condition'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6b'),require('./api/interval'));_0xab80e7[_0xc1f8('0x8')]('/api/pauses',require(_0xc1f8('0x6c')));_0xab80e7['use'](_0xc1f8('0x6d'),require(_0xc1f8('0x6e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6f'),require('./api/voiceQueuesLog'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x70'),require(_0xc1f8('0x71')));_0xab80e7['use'](_0xc1f8('0x72'),require(_0xc1f8('0x73')));_0xab80e7['use']('/api/tags',require(_0xc1f8('0x74')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x75'),require(_0xc1f8('0x76')));_0xab80e7['use']('/api/cm_contact_has_items',require(_0xc1f8('0x77')));_0xab80e7['use'](_0xc1f8('0x78'),require(_0xc1f8('0x79')));_0xab80e7[_0xc1f8('0x8')]('/api/templates',require(_0xc1f8('0x7a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x7b'),require(_0xc1f8('0x7c')));_0xab80e7['use'](_0xc1f8('0x7d'),require(_0xc1f8('0x7e')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations',require(_0xc1f8('0x7f')));_0xab80e7['use']('/api/integrations/reports',require(_0xc1f8('0x80')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x81'),require(_0xc1f8('0x82')));_0xab80e7[_0xc1f8('0x8')]('/api/analytics/default_reports',require(_0xc1f8('0x83')));_0xab80e7['use'](_0xc1f8('0x84'),require('./api/analyticExtractedReport'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x85'),require('./api/analyticMetric'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x86'),require(_0xc1f8('0x87')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x88'),require(_0xc1f8('0x89')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8a'),require('./api/intSalesforceAccount'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8b'),require('./api/intSalesforceConfiguration'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8c'),require(_0xc1f8('0x8d')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xc1f8('0x8e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8f'),require(_0xc1f8('0x90')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x91'),require('./api/intSugarcrmField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x92'),require(_0xc1f8('0x93')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x94'),require(_0xc1f8('0x95')));_0xab80e7['use']('/api/integrations/desk/fields',require(_0xc1f8('0x96')));_0xab80e7['use'](_0xc1f8('0x97'),require(_0xc1f8('0x98')));_0xab80e7['use'](_0xc1f8('0x99'),require(_0xc1f8('0x9a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x9b'),require(_0xc1f8('0x9c')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0xab80e7['use'](_0xc1f8('0x9d'),require(_0xc1f8('0x9e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x9f'),require(_0xc1f8('0xa0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa1'),require(_0xc1f8('0xa2')));_0xab80e7['use'](_0xc1f8('0xa3'),require('./api/intFreshdeskConfiguration'));_0xab80e7['use'](_0xc1f8('0xa4'),require(_0xc1f8('0xa5')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa6'),require(_0xc1f8('0xa7')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa8'),require(_0xc1f8('0xa9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xaa'),require('./api/intVtigerField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xab'),require(_0xc1f8('0xac')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xad'),require(_0xc1f8('0xae')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xaf'),require('./api/intServicenowField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb0'),require('./api/intDynamics365Account'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb1'),require(_0xc1f8('0xb2')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb3'),require(_0xc1f8('0xb4')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb5'),require(_0xc1f8('0xb6')));_0xab80e7['use'](_0xc1f8('0xb7'),require('./api/intFreshsalesConfiguration'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb8'),require(_0xc1f8('0xb9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xba'),require(_0xc1f8('0xbb')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbc'),require(_0xc1f8('0xbd')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbe'),require('./api/chatInternalMessage'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbf'),require(_0xc1f8('0xc0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc1'),require(_0xc1f8('0xc2')));_0xab80e7['use']('/api/jscripty/sessions/reports',require(_0xc1f8('0xc3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc4'),require('./api/smsQueueReport'));_0xab80e7['use'](_0xc1f8('0xc5'),require(_0xc1f8('0xc6')));_0xab80e7['use'](_0xc1f8('0xc7'),require(_0xc1f8('0xc8')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc9'),require('./api/jscriptyProject'));_0xab80e7[_0xc1f8('0x8')]('/api/settings',require(_0xc1f8('0xca')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xcb'),require('./api/squareOdbc'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xcc'),require(_0xc1f8('0xcd')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xce'),require(_0xc1f8('0xcf')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd0'),require(_0xc1f8('0xd1')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd2'),require(_0xc1f8('0xd3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd4'),require('./api/license'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd5'),require(_0xc1f8('0xd6')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd7'),require(_0xc1f8('0xd8')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd9'),require(_0xc1f8('0xda')));_0xab80e7['use']('/api/plugins',require(_0xc1f8('0xdb')));_0xab80e7['use']('/api/mail/reports/transfer',require(_0xc1f8('0xdc')));_0xab80e7['use'](_0xc1f8('0xdd'),require(_0xc1f8('0xde')));_0xab80e7[_0xc1f8('0x8')]('/api/fax/reports/transfer',require(_0xc1f8('0xdf')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xe0'),require('./api/openchannelTransferReport'));_0xab80e7['use'](_0xc1f8('0xe1'),require(_0xc1f8('0xe2')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xe3'),require(_0xc1f8('0xe4')));_0xab80e7['use'](_0xc1f8('0xe5'),require(_0xc1f8('0xe6')));_0xab80e7['use'](_0xc1f8('0xe7'),require(_0xc1f8('0xe8')));_0xab80e7['use']('/api/userProfile/sections',require(_0xc1f8('0xe9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xea'),require(_0xc1f8('0xeb')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xec'),require(_0xc1f8('0xed')));_0xab80e7['use'](_0xc1f8('0xee'),require('./api/whatsappAccount'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xef'),require(_0xc1f8('0xf0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf1'),require(_0xc1f8('0xf2')));_0xab80e7['use']('/api/whatsapp/messages',require(_0xc1f8('0xf3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf4'),require(_0xc1f8('0xf5')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf6'),require(_0xc1f8('0xf7')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf8'),require(_0xc1f8('0xf9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xfa'),require(_0xc1f8('0xfb')));_0xab80e7[_0xc1f8('0x8')]('/api/realtime',require(_0xc1f8('0xfc')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xfd'),require(_0xc1f8('0xfe')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xff'),require('./api/authLocal'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x100'),require('./api/authGoogle'));_0xab80e7['use'](_0xc1f8('0x101'),require('./api/authActiveDirectory'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x102'),require(_0xc1f8('0x103')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x104'),require(_0xc1f8('0x105')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x106'),require('./api/version'));_0xab80e7[_0xc1f8('0x8')]('/api/system',require('./api/system'));_0xab80e7[_0xc1f8('0x8')]('/api/pm2',require(_0xc1f8('0x107')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x108'),require('./api/webbar'));_0xab80e7['use'](_0xc1f8('0x109'),clientSideLogs);_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10a'),express[_0xc1f8('0x10b')](path['join'](config[_0xc1f8('0x10c')],_0xc1f8('0x10a'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10d'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config[_0xc1f8('0x10c')],_0xc1f8('0x10d'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10f'),express['static'](path['join'](config[_0xc1f8('0x10c')],_0xc1f8('0x10f'))));_0xab80e7['use'](_0xc1f8('0x110'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config[_0xc1f8('0x10c')],_0xc1f8('0x111'),_0xc1f8('0x112'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x113'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config['root'],'/server/files/plugins')));_0xab80e7[_0xc1f8('0x114')](_0xc1f8('0x115'))['get'](errors[0x194]);_0xab80e7[_0xc1f8('0x114')]('/*')[_0xc1f8('0x116')](function(_0x51c704,_0xa1f171){_0xa1f171[_0xc1f8('0x117')](path[_0xc1f8('0x118')](_0xab80e7['get'](_0xc1f8('0x119'))+'/index.html'));});return _0xab80e7;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9906785..ea85342 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca15=['../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.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/faxQueue/faxQueue.rpc'];(function(_0x5e9e3d,_0x414566){var _0x560fb1=function(_0x46f60a){while(--_0x46f60a){_0x5e9e3d['push'](_0x5e9e3d['shift']());}};_0x560fb1(++_0x414566);}(_0xca15,0x83));var _0x5ca1=function(_0x110e7d,_0x203d97){_0x110e7d=_0x110e7d-0x0;var _0x412b21=_0xca15[_0x110e7d];return _0x412b21;};'use strict';var jayson=require(_0x5ca1('0x0'));var _=require(_0x5ca1('0x1'));var config=require('../config/environment');exports[_0x5ca1('0x2')]=function(){return new Promise(function(_0x2bc723,_0x3d8967){var _0xe6088a={};_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x4')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x5')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x6')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x7')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x8')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x9')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0xa')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0xb')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0xc')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0xd')));_0xe6088a=_['merge'](_0xe6088a,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0xe')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0xf')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x10')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x11')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/mailInteraction/mailInteraction.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/mailMessage/mailMessage.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x12')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x13')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x14')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x15')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x16')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x17')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x18')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x19')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x1a')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x1b')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x1c')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x1d')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x1e')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x1f')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x20')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x21')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x22')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x23')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/chatQueue/chatQueue.rpc'));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x24')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x25')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x26')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x27')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x28')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x29')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x2a')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x2b')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x2c')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x2d')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/template/template.rpc'));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x2e')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x2f')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x30')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x31')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x32')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x33')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x34')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x35')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x36')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x37')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x38')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x39')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x3a')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x3b')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x3c')));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x3d')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/squareRecording/squareRecording.rpc'));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x3e')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x3f')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x40')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x41')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x42')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require(_0x5ca1('0x43')));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xe6088a=_[_0x5ca1('0x3')](_0xe6088a,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0xe6088a=_['merge'](_0xe6088a,require(_0x5ca1('0x44')));var _0x328217=jayson[_0x5ca1('0x45')](_0xe6088a)[_0x5ca1('0x46')]();var _0x40bed5=config['rpc']['port']||config[_0x5ca1('0x47')]+0x1;var _0x17f4bd=config['rpc']['ip']||'localhost';_0x328217['on'](_0x5ca1('0x48'),function(_0x18f584){return _0x3d8967(_0x18f584);});_0x328217['listen'](_0x40bed5,_0x17f4bd,function(){console[_0x5ca1('0x49')](_0x5ca1('0x4a'),_0x17f4bd,_0x40bed5);require(_0x5ca1('0x4b'))[_0x5ca1('0x4c')]();return _0x2bc723(_0x5ca1('0x4d')+_0x17f4bd+':'+_0x40bed5);});});}; \ No newline at end of file +var _0x7ece=['../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc'];(function(_0x20f189,_0x5ebbd8){var _0x4699e6=function(_0x32a77f){while(--_0x32a77f){_0x20f189['push'](_0x20f189['shift']());}};_0x4699e6(++_0x5ebbd8);}(_0x7ece,0xc9));var _0xe7ec=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7ece[_0x35885a];return _0xe86249;};'use strict';var jayson=require('jayson/promise');var _=require(_0xe7ec('0x0'));var config=require(_0xe7ec('0x1'));exports['listen']=function(){return new Promise(function(_0x39b8fd,_0x3ca0fb){var _0x129edf={};_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x3')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceExtension/voiceExtension.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x4')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x5')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x6')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x7')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x8')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x9')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xa')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xb')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xc')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xd')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xe')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0xf')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/mailApplication/mailApplication.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x10')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x11')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x12')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x13')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x14')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x15')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x16')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x17')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x18')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/smsMessage/smsMessage.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/smsQueue/smsQueue.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x19')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1a')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x1b')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1c')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1d')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x1e')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1f')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x20')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmContact/cmContact.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x21')));_0x129edf=_['merge'](_0x129edf,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x22')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x23')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x24')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x25')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x26')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/template/template.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x27')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x28')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x29')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2a')));_0x129edf=_['merge'](_0x129edf,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2b')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2c')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2d')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2e')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x2f')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x30')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x31')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x32')));_0x129edf=_['merge'](_0x129edf,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x33')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x34')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x35')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/squareRecording/squareRecording.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x36')));_0x129edf=_['merge'](_0x129edf,require('../api/campaign/campaign.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x37')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x38')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x39')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x3a')));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x113a26=jayson[_0xe7ec('0x3b')](_0x129edf)[_0xe7ec('0x3c')]();var _0x4a1438=config[_0xe7ec('0x3d')][_0xe7ec('0x3e')]||config['port']+0x1;var _0x242f97=config[_0xe7ec('0x3d')]['ip']||_0xe7ec('0x3f');_0x113a26['on'](_0xe7ec('0x40'),function(_0x3a69e1){return _0x3ca0fb(_0x3a69e1);});_0x113a26[_0xe7ec('0x41')](_0x4a1438,_0x242f97,function(){console[_0xe7ec('0x42')](_0xe7ec('0x43'),_0x242f97,_0x4a1438);require(_0xe7ec('0x44'))['default']();return _0x39b8fd(_0xe7ec('0x45')+_0x242f97+':'+_0x4a1438);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b1ffb73..1fb32fc 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 _0xf9e5=['lodash','events','EventEmitter','./reply','./error','call','setTimeout','setEncoding','headers','line','hangup','emit','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','answer','getData','beep','sendRequest','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','agi','wait','exec','WAIT','util'];(function(_0x438988,_0x2a86cf){var _0x1ce59f=function(_0x26f36a){while(--_0x26f36a){_0x438988['push'](_0x438988['shift']());}};_0x1ce59f(++_0x2a86cf);}(_0xf9e5,0x89));var _0x5f9e=function(_0x2d575b,_0x13c1bf){_0x2d575b=_0x2d575b-0x0;var _0x4f2f0b=_0xf9e5[_0x2d575b];return _0x4f2f0b;};'use strict';var util=require(_0x5f9e('0x0'));var _=require(_0x5f9e('0x1'));var EventEmitter=require(_0x5f9e('0x2'))[_0x5f9e('0x3')];var AGIReply=require(_0x5f9e('0x4'));var AGIError=require(_0x5f9e('0x5'));function AGIChannel(_0x1f868a){var _0x4e7665=this,_0x15b4ed=new AGIReply(),_0x25c34c=![],_0x596261={};EventEmitter[_0x5f9e('0x6')](_0x4e7665);_0x1f868a['setEncoding']('utf8');_0x1f868a[_0x5f9e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x15b4ed[_0x5f9e('0x8')]('utf8');_0x15b4ed['on'](_0x5f9e('0x9'),function(_0x3cebf5){for(var _0x5d3016 in _0x3cebf5){_0x4e7665[_0x5d3016]=_0x3cebf5[_0x5d3016];}_0x4e7665['emit']('ready');});_0x15b4ed['on'](_0x5f9e('0xa'),function(_0x25ad8f){if(_0x25ad8f['toLowerCase']()==_0x5f9e('0xb')){_0x4e7665[_0x5f9e('0xc')](_0x5f9e('0xb'));return;}if(_0x25ad8f[_0x5f9e('0xd')](0x0,0xb)==_0x5f9e('0xe')){_0x25c34c=!![];}if(_0x25c34c){_0x596261['rx']+=_0x25ad8f+'\x0a';if(_0x25ad8f['search'](_0x5f9e('0xf'))!=-0x1){_0x25c34c=![];}}else{_0x596261['rx']=_0x25ad8f;}if(_0x25c34c){return;}if(typeof _0x596261['cb']==_0x5f9e('0x10')){var _0xc6f097=_0x596261['rx'][_0x5f9e('0xd')](0x0,0x3),_0x46013e=null,_0x4a5917=null;_0xc6f097=parseInt(_0xc6f097);if(isNaN(_0xc6f097)){_0x596261['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5f9e('0x11')});return;}if(_0xc6f097!=0xc8){_0x596261['cb'](null,{'code':_0xc6f097,'result':-0x1,'extra':'KO'});return;}_0x46013e=_0x596261['rx']['substring'](0x4)['replace'](_0x5f9e('0x12'),'');if(_0x46013e[_0x5f9e('0x13')]('\x20')!=-0x1){_0x46013e=_0x46013e[_0x5f9e('0x14')](0x0,_0x46013e['indexOf']('\x20'));}if(_[_0x5f9e('0x15')](_0x46013e,'-1')){_0x46013e=parseInt(_0x46013e);}_0x4a5917=_0x596261['rx'][_0x5f9e('0x16')]('\x20');if(_0x4a5917[_0x5f9e('0x17')]==0x3){_0x4a5917=_0x4a5917[0x2][_0x5f9e('0xd')](0x1,_0x4a5917[0x2]['length']-0x1);}else if(_0x4a5917[_0x5f9e('0x17')]>0x3){var _0x293fe2=/\((.+)\)/;var _0x54ee0d=_0x596261['rx']['match'](_0x293fe2);if(_0x54ee0d){_0x4a5917=_0x54ee0d[0x1];}else{_0x4a5917=null;}}else{_0x4a5917=null;}_0x596261['cb'](null,{'code':_0xc6f097,'result':_0x46013e,'extra':_0x4a5917});}});_0x1f868a['on'](_0x5f9e('0x18'),function(_0x5891a2){_0x4e7665['emit'](_0x5f9e('0x18'),new AGIError(_0x5f9e('0x19'),_0x5891a2['code']));});_0x1f868a['on'](_0x5f9e('0x1a'),function(){_0x4e7665['emit'](_0x5f9e('0x1a'),new AGIError(_0x5f9e('0x1b')));});_0x1f868a['on']('timeout',function(){_0x4e7665[_0x5f9e('0xc')](_0x5f9e('0x1c'),new AGIError(_0x5f9e('0x1d')));_0x1f868a[_0x5f9e('0x1e')]();});_0x1f868a[_0x5f9e('0x1f')](_0x15b4ed);this[_0x5f9e('0x20')]=function(_0x17cdfe,_0x496bf3){var _0x17cdfe=_0x17cdfe||'',_0x496bf3=typeof _0x496bf3=='function'?_0x496bf3:new Function();_0x596261={'tx':_0x17cdfe,'rx':'','cb':_0x496bf3};_0x1f868a['write'](_0x17cdfe+'\x0a');},this[_0x5f9e('0x1a')]=function(){_0x1f868a['destroy']();};}util[_0x5f9e('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x5f9e('0x22')]['sendRequest']=function(_0x5abc1a){return this['command']['sync'](this,_0x5abc1a);};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x23')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x24')]=function(_0x31df5c,_0x444ea5,_0x428ddf){_0x31df5c=_0x31df5c===undefined?_0x5f9e('0x25'):_0x31df5c;_0x444ea5=_0x444ea5===undefined?'5':_0x444ea5;_0x428ddf=_0x428ddf===undefined?'1':_0x428ddf;return this[_0x5f9e('0x26')](util['format'](_0x5f9e('0x27'),_0x31df5c,_0x444ea5*0x3e8,_0x428ddf));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x28')]=function(_0x10e8bf){_0x10e8bf=_0x10e8bf||_0x5f9e('0x29');return this[_0x5f9e('0x26')](util['format']('VERBOSE\x20\x22%s\x22',_0x10e8bf));};AGIChannel[_0x5f9e('0x22')]['exec']=function(_0x546274,_0x44ed1f){if(_['isArray'](_0x44ed1f)){return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('EXEC\x20%s\x20%s',_0x546274,_0x44ed1f[_0x5f9e('0x2b')](',')));}return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('EXEC\x20%s\x20%s',_0x546274,_0x44ed1f));};AGIChannel[_0x5f9e('0x22')]['setContext']=function(_0x32ccd9){return this[_0x5f9e('0x26')](util['format'](_0x5f9e('0x2c'),_0x32ccd9));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x2d')]=function(_0x3277db){return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x3277db));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x2e')]=function(_0x45afdb){return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('SET\x20PRIORITY\x20%s',_0x45afdb));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0xb')]=function(){return this['sendRequest'](_0x5f9e('0x2f'));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x30')]=function(_0x13ec5f,_0xf36fe5){var _0x12c697=_['isBoolean'](_0xf36fe5)||_[_0x5f9e('0x31')](_0xf36fe5)?_0xf36fe5[_0x5f9e('0x32')]():_0xf36fe5;return this['sendRequest'](util[_0x5f9e('0x2a')](_0x5f9e('0x33'),_0x13ec5f,_0x12c697?_0x12c697[_0x5f9e('0x32')]()[_0x5f9e('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5f9e('0x22')]['sayNumber']=function(_0x159cd7,_0x22bb15){return this[_0x5f9e('0x26')](util['format'](_0x5f9e('0x35'),_0x159cd7,_0x22bb15));};AGIChannel['prototype'][_0x5f9e('0x36')]=function(_0x538522,_0x3af37e){return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')](_0x5f9e('0x37'),_0x538522,_0x3af37e));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x38')]=function(_0x20ba93,_0x9901fc){return this[_0x5f9e('0x26')](util['format'](_0x5f9e('0x39'),_0x20ba93,_0x9901fc));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x3a')]=function(_0x2d83fe,_0xae055,_0xc500c3){_0xae055=_0xae055||this[_0x5f9e('0x3b')];_0xc500c3=_0xc500c3||0x1;this[_0x5f9e('0x3c')](_0x2d83fe);this['setExtension'](_0xae055);this[_0x5f9e('0x2e')](_0xc500c3);return this[_0x5f9e('0x28')](util[_0x5f9e('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x2d83fe,_0xae055,_0xc500c3));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x3d')]=function(_0x12e1ad){return this['sendRequest'](util['format'](_0x5f9e('0x3e'),_0x12e1ad));};AGIChannel['prototype'][_0x5f9e('0x3f')]=function(_0x411414,_0x43fa32,_0x3cf9fd,_0x49738e,_0x204427,_0x37e274){_0x43fa32=_0x43fa32||'wav';_0x3cf9fd=_0x3cf9fd||'';_0x49738e=_0x49738e===undefined?-0x1:_0x49738e==='-1'?-0x1:_0x49738e*0x3e8;_0x204427=_0x204427===undefined?'':'s='+_0x204427;_0x37e274=_0x37e274?_0x5f9e('0x40'):'';return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x411414,_0x43fa32,_0x3cf9fd,_0x49738e,_0x37e274,_0x204427));};AGIChannel[_0x5f9e('0x22')]['streamFile']=function(_0x46dc7d,_0x5b8cef){_0x5b8cef=_0x5b8cef||'';return this[_0x5f9e('0x26')](util[_0x5f9e('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x46dc7d,_0x5b8cef));};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x41')]=function(_0x3e5293){return this['exec']('AGI',_0x3e5293);};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x42')]=function(_0x239d91){return this[_0x5f9e('0x43')](_0x5f9e('0x44'),_0x239d91);};AGIChannel[_0x5f9e('0x22')][_0x5f9e('0x18')]=function(_0x3b152b,_0x2098bd){this[_0x5f9e('0x28')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3b152b['id'],_0x3b152b['label'],_0x2098bd));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x5c7c=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','replace','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','pipe','command','inherits','prototype','sendRequest','answer','ANSWER','getData','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','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x5c7c,0x172));var _0xc5c7=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x5c7c[_0x48a836];return _0x249dc8;};'use strict';var util=require(_0xc5c7('0x0'));var _=require(_0xc5c7('0x1'));var EventEmitter=require(_0xc5c7('0x2'))[_0xc5c7('0x3')];var AGIReply=require(_0xc5c7('0x4'));var AGIError=require(_0xc5c7('0x5'));function AGIChannel(_0xc17170){var _0x4e4407=this,_0x1c4f6b=new AGIReply(),_0x1cfbf3=![],_0x557ffb={};EventEmitter['call'](_0x4e4407);_0xc17170[_0xc5c7('0x6')](_0xc5c7('0x7'));_0xc17170['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1c4f6b[_0xc5c7('0x6')](_0xc5c7('0x7'));_0x1c4f6b['on'](_0xc5c7('0x8'),function(_0x43520f){for(var _0x571b10 in _0x43520f){_0x4e4407[_0x571b10]=_0x43520f[_0x571b10];}_0x4e4407[_0xc5c7('0x9')](_0xc5c7('0xa'));});_0x1c4f6b['on']('line',function(_0x25ce4e){if(_0x25ce4e[_0xc5c7('0xb')]()==_0xc5c7('0xc')){_0x4e4407['emit']('hangup');return;}if(_0x25ce4e['substring'](0x0,0xb)==_0xc5c7('0xd')){_0x1cfbf3=!![];}if(_0x1cfbf3){_0x557ffb['rx']+=_0x25ce4e+'\x0a';if(_0x25ce4e[_0xc5c7('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x1cfbf3=![];}}else{_0x557ffb['rx']=_0x25ce4e;}if(_0x1cfbf3){return;}if(typeof _0x557ffb['cb']==_0xc5c7('0xf')){var _0x286a3f=_0x557ffb['rx'][_0xc5c7('0x10')](0x0,0x3),_0x1ee659=null,_0x10b566=null;_0x286a3f=parseInt(_0x286a3f);if(isNaN(_0x286a3f)){_0x557ffb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc5c7('0x11')});return;}if(_0x286a3f!=0xc8){_0x557ffb['cb'](null,{'code':_0x286a3f,'result':-0x1,'extra':'KO'});return;}_0x1ee659=_0x557ffb['rx'][_0xc5c7('0x10')](0x4)[_0xc5c7('0x12')]('result=','');if(_0x1ee659[_0xc5c7('0x13')]('\x20')!=-0x1){_0x1ee659=_0x1ee659[_0xc5c7('0x14')](0x0,_0x1ee659['indexOf']('\x20'));}if(_['startsWith'](_0x1ee659,'-1')){_0x1ee659=parseInt(_0x1ee659);}_0x10b566=_0x557ffb['rx'][_0xc5c7('0x15')]('\x20');if(_0x10b566[_0xc5c7('0x16')]==0x3){_0x10b566=_0x10b566[0x2][_0xc5c7('0x10')](0x1,_0x10b566[0x2][_0xc5c7('0x16')]-0x1);}else if(_0x10b566['length']>0x3){var _0x2552ef=/\((.+)\)/;var _0x18bea3=_0x557ffb['rx'][_0xc5c7('0x17')](_0x2552ef);if(_0x18bea3){_0x10b566=_0x18bea3[0x1];}else{_0x10b566=null;}}else{_0x10b566=null;}_0x557ffb['cb'](null,{'code':_0x286a3f,'result':_0x1ee659,'extra':_0x10b566});}});_0xc17170['on'](_0xc5c7('0x18'),function(_0x16e44c){_0x4e4407['emit']('error',new AGIError(_0xc5c7('0x19'),_0x16e44c[_0xc5c7('0x1a')]));});_0xc17170['on']('close',function(){_0x4e4407['emit'](_0xc5c7('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0xc17170['on'](_0xc5c7('0x1c'),function(){_0x4e4407[_0xc5c7('0x9')](_0xc5c7('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0xc17170[_0xc5c7('0x1d')]();});_0xc17170[_0xc5c7('0x1e')](_0x1c4f6b);this[_0xc5c7('0x1f')]=function(_0x3911f7,_0x14dc81){var _0x3911f7=_0x3911f7||'',_0x14dc81=typeof _0x14dc81=='function'?_0x14dc81:new Function();_0x557ffb={'tx':_0x3911f7,'rx':'','cb':_0x14dc81};_0xc17170['write'](_0x3911f7+'\x0a');},this[_0xc5c7('0x1b')]=function(){_0xc17170[_0xc5c7('0x1d')]();};}util[_0xc5c7('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x22')]=function(_0x1e4a3f){return this[_0xc5c7('0x1f')]['sync'](this,_0x1e4a3f);};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x23')]=function(){return this[_0xc5c7('0x22')](_0xc5c7('0x24'));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x25')]=function(_0x579ab5,_0x1e7ab0,_0x5a0dfa){_0x579ab5=_0x579ab5===undefined?'beep':_0x579ab5;_0x1e7ab0=_0x1e7ab0===undefined?'5':_0x1e7ab0;_0x5a0dfa=_0x5a0dfa===undefined?'1':_0x5a0dfa;return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x27'),_0x579ab5,_0x1e7ab0*0x3e8,_0x5a0dfa));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x28')]=function(_0x5e50ed){_0x5e50ed=_0x5e50ed||_0xc5c7('0x29');return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x2a'),_0x5e50ed));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x2b')]=function(_0x5aca5b,_0x51c860){if(_[_0xc5c7('0x2c')](_0x51c860)){return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x5aca5b,_0x51c860['join'](',')));}return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x2d'),_0x5aca5b,_0x51c860));};AGIChannel[_0xc5c7('0x21')]['setContext']=function(_0xa7e082){return this['sendRequest'](util[_0xc5c7('0x26')](_0xc5c7('0x2e'),_0xa7e082));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x2f')]=function(_0x159b29){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x30'),_0x159b29));};AGIChannel[_0xc5c7('0x21')]['setPriority']=function(_0xfebb30){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x31'),_0xfebb30));};AGIChannel[_0xc5c7('0x21')]['hangup']=function(){return this[_0xc5c7('0x22')](_0xc5c7('0x32'));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x33')]=function(_0x841be4,_0x2c074f){var _0x2848da=_[_0xc5c7('0x34')](_0x2c074f)||_['isNumber'](_0x2c074f)?_0x2c074f[_0xc5c7('0x35')]():_0x2c074f;return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x36'),_0x841be4,_0x2848da?_0x2848da[_0xc5c7('0x35')]()[_0xc5c7('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x37')]=function(_0x19ee07,_0x5198e7){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x38'),_0x19ee07,_0x5198e7));};AGIChannel[_0xc5c7('0x21')]['sayDigits']=function(_0x65c14c,_0x3b9096){return this['sendRequest'](util[_0xc5c7('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x65c14c,_0x3b9096));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x39')]=function(_0xb63fd9,_0x2b12be){return this[_0xc5c7('0x22')](util['format'](_0xc5c7('0x3a'),_0xb63fd9,_0x2b12be));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x3b')]=function(_0x4326bf,_0x5e77be,_0x4b6f2){_0x5e77be=_0x5e77be||this[_0xc5c7('0x3c')];_0x4b6f2=_0x4b6f2||0x1;this['setContext'](_0x4326bf);this[_0xc5c7('0x2f')](_0x5e77be);this[_0xc5c7('0x3d')](_0x4b6f2);return this[_0xc5c7('0x28')](util[_0xc5c7('0x26')](_0xc5c7('0x3e'),_0x4326bf,_0x5e77be,_0x4b6f2));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x3f')]=function(_0x2ca5b5){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x40'),_0x2ca5b5));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x41')]=function(_0x2e5f09,_0x3a27d1,_0x269e47,_0x42d3a4,_0x1a67ea,_0x4b0e6a){_0x3a27d1=_0x3a27d1||_0xc5c7('0x42');_0x269e47=_0x269e47||'';_0x42d3a4=_0x42d3a4===undefined?-0x1:_0x42d3a4==='-1'?-0x1:_0x42d3a4*0x3e8;_0x1a67ea=_0x1a67ea===undefined?'':'s='+_0x1a67ea;_0x4b0e6a=_0x4b0e6a?_0xc5c7('0x43'):'';return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2e5f09,_0x3a27d1,_0x269e47,_0x42d3a4,_0x4b0e6a,_0x1a67ea));};AGIChannel[_0xc5c7('0x21')]['streamFile']=function(_0x592976,_0x5c3cf6){_0x5c3cf6=_0x5c3cf6||'';return this[_0xc5c7('0x22')](util['format'](_0xc5c7('0x44'),_0x592976,_0x5c3cf6));};AGIChannel[_0xc5c7('0x21')]['agi']=function(_0x1419e2){return this['exec'](_0xc5c7('0x45'),_0x1419e2);};AGIChannel[_0xc5c7('0x21')]['wait']=function(_0x3f350b){return this[_0xc5c7('0x2b')](_0xc5c7('0x46'),_0x3f350b);};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x18')]=function(_0x1d213,_0x555f5c){this[_0xc5c7('0x28')](util[_0xc5c7('0x26')](_0xc5c7('0x47'),_0x1d213['id'],_0x1d213[_0xc5c7('0x48')],_0x555f5c));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 4face79..79cd8b4 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 _0x1321=['util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports'];(function(_0x41676f,_0x58329a){var _0x4a271a=function(_0x459b6b){while(--_0x459b6b){_0x41676f['push'](_0x41676f['shift']());}};_0x4a271a(++_0x58329a);}(_0x1321,0x10e));var _0x1132=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1321[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0x1132('0x0'));var error={'E_AGI_UNDEFINED':_0x1132('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x1132('0x2'),'E_AGI_SERVER_CLOSE':_0x1132('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x1132('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x1132('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x1132('0x6'),'E_AGI_COMMAND_EMPTY':_0x1132('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x1132('0x8')};function AGIError(_0x2eae8a){var _0x2eae8a=_0x2eae8a||null,_0x363599=_0x363599||[],_0x87e81f=0x1,_0xfbfc55='';if(!error[_0x2eae8a]){_0x2eae8a='E_AGI_UNDEFINED';}_0x363599[_0x1132('0x9')](error[_0x2eae8a]);while(arguments[_0x87e81f]){_0x363599[_0x1132('0x9')](arguments[_0x87e81f]);_0x87e81f++;}_0xfbfc55=util[_0x1132('0xa')][_0x1132('0xb')](util,_0x363599);this[_0x1132('0xc')]=_0xfbfc55;this[_0x1132('0xd')]=_0x2eae8a;}module[_0x1132('0xe')]=AGIError; \ No newline at end of file +var _0xf7d6=['push','format','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0xf7d6,0x1ca));var _0x6f7d=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xf7d6[_0x13ea00];return _0x1f7347;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x6f7d('0x0'),'E_AGI_ARGUMENT_PORT':_0x6f7d('0x1'),'E_AGI_SERVER_ERROR':_0x6f7d('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x6f7d('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x6f7d('0x4'),'E_AGI_SOCKET_ERROR':_0x6f7d('0x5'),'E_AGI_SOCKET_CLOSE':_0x6f7d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6f7d('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6f7d('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2cbc40){var _0x2cbc40=_0x2cbc40||null,_0x2f94a2=_0x2f94a2||[],_0x1f12c6=0x1,_0x2f78dd='';if(!error[_0x2cbc40]){_0x2cbc40=_0x6f7d('0x9');}_0x2f94a2['push'](error[_0x2cbc40]);while(arguments[_0x1f12c6]){_0x2f94a2[_0x6f7d('0xa')](arguments[_0x1f12c6]);_0x1f12c6++;}_0x2f78dd=util[_0x6f7d('0xb')]['apply'](util,_0x2f94a2);this['message']=_0x2f78dd;this[_0x6f7d('0xc')]=_0x2cbc40;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index f0ee1d6..72e6bf3 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 _0xd22c=['redis','emit','E_AGI_SERVER_ERROR','agi','parse','projectUpdate','error','exports','lodash','EventEmitter','../../config/environment','defaults','localhost'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xd22c,0xff));var _0xcd22=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xd22c[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0xcd22('0x0'));var EventEmitter=require('events')[_0xcd22('0x1')];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0xcd22('0x2'));config['redis']=_[_0xcd22('0x3')](config['redis'],{'host':_0xcd22('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xcd22('0x5')]);sub['subscribe']('agi',function(_0x3f6a4a){if(_0x3f6a4a)return eventEmitter[_0xcd22('0x6')]('error',new AGIError(_0xcd22('0x7'),_0x3f6a4a));});sub['on']('message',function(_0x36adcb,_0x48a3af){if(_0x36adcb!==_0xcd22('0x8'))return;try{var _0x1c1aa3=JSON[_0xcd22('0x9')](_0x48a3af);eventEmitter[_0xcd22('0x6')](_0xcd22('0xa'),_0x1c1aa3);}catch(_0x233ea7){eventEmitter[_0xcd22('0x6')](_0xcd22('0xb'),new AGIError(_0xcd22('0x7'),_0x233ea7));}});module[_0xcd22('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xff4f=['agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash','events','./error','../../config/environment','redis','defaults','subscribe'];(function(_0x4f2b00,_0x54cf31){var _0x555e79=function(_0x41cae0){while(--_0x41cae0){_0x4f2b00['push'](_0x4f2b00['shift']());}};_0x555e79(++_0x54cf31);}(_0xff4f,0x1e3));var _0xfff4=function(_0x2e18e3,_0x48d4e1){_0x2e18e3=_0x2e18e3-0x0;var _0x308ceb=_0xff4f[_0x2e18e3];return _0x308ceb;};'use strict';var _=require(_0xfff4('0x0'));var EventEmitter=require(_0xfff4('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0xfff4('0x2'));var config=require(_0xfff4('0x3'));config[_0xfff4('0x4')]=_[_0xfff4('0x5')](config[_0xfff4('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xfff4('0x6')](_0xfff4('0x7'),function(_0x3fc2d4){if(_0x3fc2d4)return eventEmitter[_0xfff4('0x8')]('error',new AGIError(_0xfff4('0x9'),_0x3fc2d4));});sub['on'](_0xfff4('0xa'),function(_0x5a00cb,_0x2e2b0b){if(_0x5a00cb!=='agi')return;try{var _0x3c6c2d=JSON['parse'](_0x2e2b0b);eventEmitter[_0xfff4('0x8')](_0xfff4('0xb'),_0x3c6c2d);}catch(_0x1a8599){eventEmitter['emit'](_0xfff4('0xc'),new AGIError(_0xfff4('0x9'),_0x1a8599));}});module[_0xfff4('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 468e059..b2c7c62 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 _0x0c4e=['info','stop\x20traverse','length','condition','target','default','vswitch','default\x20on\x20switch\x20not\x20found','includes','agicommand','max\x20retry\x20reach','condition\x20not\x20found','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','relations','traverseBFS'];(function(_0x177c35,_0x9ddbcd){var _0x22986f=function(_0x1ba068){while(--_0x1ba068){_0x177c35['push'](_0x177c35['shift']());}};_0x22986f(++_0x9ddbcd);}(_0x0c4e,0x89));var _0xe0c4=function(_0x12ca7d,_0x59a7b2){_0x12ca7d=_0x12ca7d-0x0;var _0x4b936b=_0x0c4e[_0x12ca7d];return _0x4b936b;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xe0c4('0x0'));var verticesWithRetry=[_0xe0c4('0x1'),_0xe0c4('0x2'),_0xe0c4('0x3')];var Graph=function(){this[_0xe0c4('0x4')]={};this[_0xe0c4('0x5')]={};this[_0xe0c4('0x6')]=0x0;};Graph[_0xe0c4('0x7')][_0xe0c4('0x8')]=function(_0x170c10){this[_0xe0c4('0x4')][_0x170c10['id']]=_0x170c10;this[_0xe0c4('0x5')][_0x170c10['id']]=[];};Graph[_0xe0c4('0x7')]['addEdge']=function(_0x7a78f8,_0x40bfa7,_0x251c31){this['edges'][_0x7a78f8][_0xe0c4('0x9')]({'target':_0x40bfa7,'condition':_0x251c31});this['numberOfEdges']+=0x1;};Graph[_0xe0c4('0x7')][_0xe0c4('0xa')]=function(){return _[_0xe0c4('0xa')](this['vertices']);};Graph[_0xe0c4('0x7')][_0xe0c4('0xb')]=function(){return this[_0xe0c4('0x6')];};Graph[_0xe0c4('0x7')]['getVertex']=function(_0x2318d8){return this['vertices'][_0x2318d8];};Graph[_0xe0c4('0x7')][_0xe0c4('0xc')]=function(_0xceccec,_0x212a1b){if(!this[_0xe0c4('0x4')][_0xceccec]){return logger[_0xe0c4('0xd')]('no\x20vertex\x20found');}var _0x40d803=_0x212a1b(this[_0xe0c4('0x4')][_0xceccec]);if(!_0x40d803){return logger[_0xe0c4('0xd')](_0xe0c4('0xe'));}if(this[_0xe0c4('0x5')][_0xceccec][_0xe0c4('0xf')]===0x0){return logger[_0xe0c4('0xd')]('no\x20edge/s\x20available');}for(var _0x15e80e=0x0,_0x1ceaf8=[],_0x5bfe10=![];_0x15e80e\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','createSquareReport','then','catch','indexOf','agi_','substring','debug','stringify','close','timeout','find'];(function(_0x4f963c,_0x343eb9){var _0x8c9153=function(_0x2ef726){while(--_0x2ef726){_0x4f963c['push'](_0x4f963c['shift']());}};_0x8c9153(++_0x343eb9);}(_0xdc43,0x154));var _0x3dc4=function(_0x483eaf,_0x38c70c){_0x483eaf=_0x483eaf-0x0;var _0x38c8a3=_0xdc43[_0x483eaf];return _0x38c8a3;};'use strict';var _=require(_0x3dc4('0x0'));var syncho=require(_0x3dc4('0x1'));var util=require(_0x3dc4('0x2'));var config=require(_0x3dc4('0x3'));var logger=require(_0x3dc4('0x4'))('agi');var utilLicense=require(_0x3dc4('0x5'));var rpc=require(_0x3dc4('0x6'));var Project=require(_0x3dc4('0x7'));var AGIEmitter=require(_0x3dc4('0x8'))[_0x3dc4('0x9')];var projects=[];config[_0x3dc4('0xa')]=_[_0x3dc4('0xb')](config[_0x3dc4('0xa')],{'ip':_0x3dc4('0xc'),'port':0x11dd});AGIEmitter['on'](_0x3dc4('0xd'),projectUpdateHandler);function connectionHandler(_0x166702){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x166702);agiHandler(_0x166702);}catch(_0x478a12){logger[_0x3dc4('0xe')](_0x478a12[_0x3dc4('0xf')]);}});});}function projectUpdateHandler(_0x47c0a7){try{var _0x2e68ae=_[_0x3dc4('0x10')](projects,['id',_0x47c0a7['id']]);if(_0x2e68ae>-0x1){if(_0x47c0a7[_0x3dc4('0x11')]===!![]){projects[_0x3dc4('0x12')](_0x2e68ae,0x1);}else{projects[_0x2e68ae]=_0x47c0a7;}}else{projects[_0x3dc4('0x13')](_0x47c0a7);}}catch(_0x39c21e){logger[_0x3dc4('0xe')](_0x39c21e[_0x3dc4('0xf')]);}}function listeningHandler(){console[_0x3dc4('0x14')](_0x3dc4('0x15'),config[_0x3dc4('0xa')][_0x3dc4('0x16')]);logger['info'](util[_0x3dc4('0x17')](_0x3dc4('0x18'),config[_0x3dc4('0xa')]['ip'],config[_0x3dc4('0xa')][_0x3dc4('0x16')]));}function errorHandler(_0x289f7c){if(_0x289f7c&&_0x289f7c[_0x3dc4('0x19')]&&_0x289f7c[_0x3dc4('0x1a')]){logger[_0x3dc4('0xe')](util[_0x3dc4('0x17')](_0x3dc4('0x1b'),_0x289f7c[_0x3dc4('0x19')],_0x289f7c[_0x3dc4('0x1a')]));}else{logger[_0x3dc4('0xe')](util[_0x3dc4('0x17')](_0x3dc4('0x1c'),_0x289f7c[_0x3dc4('0xf')]));}}function closeHandler(){logger[_0x3dc4('0x1d')](util[_0x3dc4('0x17')](_0x3dc4('0x1e'),this['arg_1'],this[_0x3dc4('0x1f')],this['callerid'],this[_0x3dc4('0x20')],this[_0x3dc4('0x21')]));try{createSquareReport(this);}catch(_0x6bd6b){logger[_0x3dc4('0xe')](_0x6bd6b['stack']);}}function timeoutHandler(){logger[_0x3dc4('0x1d')](util[_0x3dc4('0x17')](_0x3dc4('0x22'),this[_0x3dc4('0x23')],this[_0x3dc4('0x1f')],this['callerid'],this['dnid'],this[_0x3dc4('0x21')]));}function hangupHandler(){logger[_0x3dc4('0x1d')](util[_0x3dc4('0x17')](_0x3dc4('0x24'),this[_0x3dc4('0x23')],this['calleridname'],this[_0x3dc4('0x25')],this[_0x3dc4('0x20')],this[_0x3dc4('0x21')]));this[_0x3dc4('0x26')]=!![];}function createSquareReport(_0x5d96a9,_0x10d419){rpc[_0x3dc4('0x27')](_0x5d96a9)[_0x3dc4('0x28')](function(_0x1ab21e){if(_0x10d419){_0x10d419(null,_0x1ab21e);}})[_0x3dc4('0x29')](function(_0x232d64){if(_0x10d419){_0x10d419(null,_0x232d64);}});}function setChannelVariables(_0xdbea2d){for(var _0x396bb2 in _0xdbea2d){if(_0xdbea2d['hasOwnProperty'](_0x396bb2)){if(_0x396bb2[_0x3dc4('0x2a')](_0x3dc4('0x2b'))===0x0){_0xdbea2d[_0x396bb2[_0x3dc4('0x2c')](0x4)]=_0xdbea2d[_0x396bb2];delete _0xdbea2d[_0x396bb2];}}}}function agiHandler(_0x859a2e){logger[_0x3dc4('0x2d')]('variables',JSON[_0x3dc4('0x2e')](_0x859a2e,null,0x2));logger[_0x3dc4('0x1d')](util[_0x3dc4('0x17')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x859a2e[_0x3dc4('0x23')],_0x859a2e[_0x3dc4('0x1f')],_0x859a2e[_0x3dc4('0x25')],_0x859a2e[_0x3dc4('0x20')],_0x859a2e['uniqueid']));_0x859a2e['on'](_0x3dc4('0xe'),errorHandler);_0x859a2e['on'](_0x3dc4('0x2f'),closeHandler);_0x859a2e['on'](_0x3dc4('0x30'),timeoutHandler);_0x859a2e[_0x3dc4('0x26')]=![];_0x859a2e['on']('hangup',hangupHandler);var _0x1a1574=_[_0x3dc4('0x31')](projects,[_0x3dc4('0x19'),_0x859a2e[_0x3dc4('0x23')]]);if(!_0x1a1574)return Project[_0x3dc4('0x32')](_0x859a2e);if(!_0x1a1574[_0x3dc4('0x33')])return Project[_0x3dc4('0x34')](_0x859a2e);return Project[_0x3dc4('0x35')](_0x1a1574,_0x859a2e);}function main(){var _0x4a154a;return utilLicense[_0x3dc4('0x36')]()[_0x3dc4('0x28')](function(_0x2ee0b1){if(!_0x2ee0b1)return;if(_0x2ee0b1[_0x3dc4('0x37')]){if(_0x2ee0b1['callysquare']&&_0x2ee0b1[_0x3dc4('0x38')]>0x0){logger[_0x3dc4('0x1d')](util[_0x3dc4('0x17')](_0x3dc4('0x39'),_0x2ee0b1[_0x3dc4('0x38')]));_0x4a154a=_0x2ee0b1[_0x3dc4('0x38')];}else{logger[_0x3dc4('0x1d')](_0x3dc4('0x3a'));}}else{logger[_0x3dc4('0x1d')](_0x3dc4('0x3b'));_0x4a154a=-0x1;}})[_0x3dc4('0x28')](function(){return Project['getAll']();})[_0x3dc4('0x28')](function(_0x468ed7){projects=_0x468ed7;return;})[_0x3dc4('0x29')](function(_0x40e3f7){logger[_0x3dc4('0xe')](_0x3dc4('0x3c'),_0x40e3f7[_0x3dc4('0xf')]);})[_0x3dc4('0x3d')](function(){var _0x97edaa=require(_0x3dc4('0x3e'))(config[_0x3dc4('0xa')][_0x3dc4('0x16')],config['agi']['ip'],_0x4a154a);_0x97edaa['on'](_0x3dc4('0xe'),errorHandler);_0x97edaa['on'](_0x3dc4('0x3f'),listeningHandler);_0x97edaa['on'](_0x3dc4('0x40'),connectionHandler);_0x97edaa['on'](_0x3dc4('0x2f'),closeHandler);});}main(); \ No newline at end of file +var _0x2851=['hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','info','callerid','dnid','uniqueid','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close'];(function(_0x20b128,_0x194967){var _0x225697=function(_0x1e92ff){while(--_0x1e92ff){_0x20b128['push'](_0x20b128['shift']());}};_0x225697(++_0x194967);}(_0x2851,0xb7));var _0x1285=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2851[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1285('0x0'));var syncho=require(_0x1285('0x1'));var util=require(_0x1285('0x2'));var config=require(_0x1285('0x3'));var logger=require(_0x1285('0x4'))(_0x1285('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x1285('0x6'));var Project=require(_0x1285('0x7'));var AGIEmitter=require(_0x1285('0x8'))[_0x1285('0x9')];var projects=[];config[_0x1285('0x5')]=_[_0x1285('0xa')](config[_0x1285('0x5')],{'ip':_0x1285('0xb'),'port':0x11dd});AGIEmitter['on'](_0x1285('0xc'),projectUpdateHandler);function connectionHandler(_0x11cc91){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x11cc91);agiHandler(_0x11cc91);}catch(_0x478faf){logger[_0x1285('0xd')](_0x478faf[_0x1285('0xe')]);}});});}function projectUpdateHandler(_0x34f687){try{var _0x136ab8=_[_0x1285('0xf')](projects,['id',_0x34f687['id']]);if(_0x136ab8>-0x1){if(_0x34f687[_0x1285('0x10')]===!![]){projects[_0x1285('0x11')](_0x136ab8,0x1);}else{projects[_0x136ab8]=_0x34f687;}}else{projects[_0x1285('0x12')](_0x34f687);}}catch(_0x708eba){logger[_0x1285('0xd')](_0x708eba[_0x1285('0xe')]);}}function listeningHandler(){console[_0x1285('0x13')](_0x1285('0x14'),config[_0x1285('0x5')][_0x1285('0x15')]);logger['info'](util[_0x1285('0x16')](_0x1285('0x17'),config[_0x1285('0x5')]['ip'],config[_0x1285('0x5')][_0x1285('0x15')]));}function errorHandler(_0x1f14d2){if(_0x1f14d2&&_0x1f14d2[_0x1285('0x18')]&&_0x1f14d2[_0x1285('0x19')]){logger[_0x1285('0xd')](util['format']('[%s]\x20%s',_0x1f14d2[_0x1285('0x18')],_0x1f14d2[_0x1285('0x19')]));}else{logger['error'](util['format'](_0x1285('0x1a'),_0x1f14d2[_0x1285('0xe')]));}}function closeHandler(){logger[_0x1285('0x1b')](util[_0x1285('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x1285('0x1c')],this[_0x1285('0x1d')],this[_0x1285('0x1e')]));try{createSquareReport(this);}catch(_0x342cde){logger[_0x1285('0xd')](_0x342cde[_0x1285('0xe')]);}}function timeoutHandler(){logger[_0x1285('0x1b')](util[_0x1285('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1285('0x1f')],this[_0x1285('0x20')],this[_0x1285('0x1c')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x1285('0x1b')](util['format'](_0x1285('0x21'),this[_0x1285('0x1f')],this[_0x1285('0x20')],this['callerid'],this[_0x1285('0x1d')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x317919,_0x3b18f6){rpc[_0x1285('0x22')](_0x317919)[_0x1285('0x23')](function(_0x5011aa){if(_0x3b18f6){_0x3b18f6(null,_0x5011aa);}})[_0x1285('0x24')](function(_0x3b82c4){if(_0x3b18f6){_0x3b18f6(null,_0x3b82c4);}});}function setChannelVariables(_0x1d042a){for(var _0x30ef34 in _0x1d042a){if(_0x1d042a[_0x1285('0x25')](_0x30ef34)){if(_0x30ef34[_0x1285('0x26')](_0x1285('0x27'))===0x0){_0x1d042a[_0x30ef34[_0x1285('0x28')](0x4)]=_0x1d042a[_0x30ef34];delete _0x1d042a[_0x30ef34];}}}}function agiHandler(_0x4a673e){logger[_0x1285('0x29')](_0x1285('0x2a'),JSON[_0x1285('0x2b')](_0x4a673e,null,0x2));logger['info'](util[_0x1285('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4a673e[_0x1285('0x1f')],_0x4a673e[_0x1285('0x20')],_0x4a673e[_0x1285('0x1c')],_0x4a673e[_0x1285('0x1d')],_0x4a673e[_0x1285('0x1e')]));_0x4a673e['on'](_0x1285('0xd'),errorHandler);_0x4a673e['on'](_0x1285('0x2c'),closeHandler);_0x4a673e['on']('timeout',timeoutHandler);_0x4a673e['evtHangup']=![];_0x4a673e['on'](_0x1285('0x2d'),hangupHandler);var _0x4296b1=_[_0x1285('0x2e')](projects,['name',_0x4a673e['arg_1']]);if(!_0x4296b1)return Project[_0x1285('0x2f')](_0x4a673e);if(!_0x4296b1['production'])return Project[_0x1285('0x30')](_0x4a673e);return Project[_0x1285('0x31')](_0x4296b1,_0x4a673e);}function main(){var _0x91f342;return utilLicense[_0x1285('0x32')]()[_0x1285('0x23')](function(_0x55cfed){if(!_0x55cfed)return;if(_0x55cfed[_0x1285('0x33')]){if(_0x55cfed[_0x1285('0x34')]&&_0x55cfed[_0x1285('0x34')]>0x0){logger['info'](util[_0x1285('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x55cfed[_0x1285('0x34')]));_0x91f342=_0x55cfed[_0x1285('0x34')];}else{logger[_0x1285('0x1b')](_0x1285('0x35'));}}else{logger[_0x1285('0x1b')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x91f342=-0x1;}})['then'](function(){return Project['getAll']();})[_0x1285('0x23')](function(_0x3ab010){projects=_0x3ab010;return;})[_0x1285('0x24')](function(_0x1154cb){logger[_0x1285('0xd')]('[LICENSE]',_0x1154cb[_0x1285('0xe')]);})['finally'](function(){var _0x50bebc=require(_0x1285('0x36'))(config[_0x1285('0x5')]['port'],config[_0x1285('0x5')]['ip'],_0x91f342);_0x50bebc['on'](_0x1285('0xd'),errorHandler);_0x50bebc['on'](_0x1285('0x37'),listeningHandler);_0x50bebc['on'](_0x1285('0x38'),connectionHandler);_0x50bebc['on'](_0x1285('0x2c'),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 e1e7c6d..0f0e0f6 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 _0x0a32=['result','bluebird','client','http','request','then','error','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0a32,0x89));var _0x20a3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0a32[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0x20a3('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x20a3('0x1')][_0x20a3('0x2')]({'port':0x232b});function request(_0x20bd81,_0x16a83b){return new BPromise(function(_0x2e3574,_0x4b32fb){return client[_0x20a3('0x3')](_0x20bd81,_0x16a83b)[_0x20a3('0x4')](function(_0x328120){if(_0x328120['error']){return _0x4b32fb(_0x328120[_0x20a3('0x5')][_0x20a3('0x6')]);}else{return _0x2e3574(_0x328120[_0x20a3('0x7')]);}})['catch'](function(_0x52c5e0){return _0x4b32fb(_0x52c5e0);});});}exports['sendMailMessage']=function(_0x11c663,_0x2be50a){return request('SendMail',{'account':_0x11c663,'message':_0x2be50a});}; \ No newline at end of file +var _0x0caa=['request','then','error','message','catch','SendMail','jayson/promise','client','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0caa,0xf9));var _0xa0ca=function(_0x38a045,_0x402d6b){_0x38a045=_0x38a045-0x0;var _0x45c34c=_0x0caa[_0x38a045];return _0x45c34c;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa0ca('0x0'));var client=jayson[_0xa0ca('0x1')][_0xa0ca('0x2')]({'port':0x232b});function request(_0x5f3728,_0x51791b){return new BPromise(function(_0x511fbe,_0x13570c){return client[_0xa0ca('0x3')](_0x5f3728,_0x51791b)[_0xa0ca('0x4')](function(_0x2f8a4a){if(_0x2f8a4a[_0xa0ca('0x5')]){return _0x13570c(_0x2f8a4a[_0xa0ca('0x5')][_0xa0ca('0x6')]);}else{return _0x511fbe(_0x2f8a4a['result']);}})[_0xa0ca('0x7')](function(_0x6217df){return _0x13570c(_0x6217df);});});}exports['sendMailMessage']=function(_0x47068a,_0x2ad898){return request(_0xa0ca('0x8'),{'account':_0x47068a,'message':_0x2ad898});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 4b24772..2db05ce 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 _0x3600=['isArray','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','production','debug','stringify','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','close','exports','lodash','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty'];(function(_0x4855ce,_0x3fbf65){var _0x150377=function(_0x21555b){while(--_0x21555b){_0x4855ce['push'](_0x4855ce['shift']());}};_0x150377(++_0x3fbf65);}(_0x3600,0xe9));var _0x0360=function(_0x39e97f,_0x29f9f1){_0x39e97f=_0x39e97f-0x0;var _0x540485=_0x3600[_0x39e97f];return _0x540485;};'use strict';var _=require(_0x0360('0x0'));var moment=require('moment');var parser=require(_0x0360('0x1'));var util=require('util');var logger=require(_0x0360('0x2'))(_0x0360('0x3'));var rpc=require(_0x0360('0x4'));var mailRpc=require(_0x0360('0x5'));var Graph=require(_0x0360('0x6'));var Vertices=require(_0x0360('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x0360('0x8')]()[_0x0360('0x9')](function(_0x219ae6){logger['error'](_0x0360('0xa'),_0x219ae6[_0x0360('0xb')]);return[];});}function addVertex(_0x2235a4,_0x24927f,_0x3c119f){_0x24927f[_0x0360('0xc')]=_0x3c119f;if(_0x24927f['hasOwnProperty'](_0x0360('0xd'))){_0x24927f[_0x0360('0xe')]=parseInt(_0x24927f[_0x0360('0xd')],0xa);}_0x2235a4[_0x0360('0xf')](_[_0x0360('0x10')](_0x24927f,_0x0360('0x11')));}function initGraph(_0x20029f,_0x33167a){var _0x5406db=new Graph();for(var _0x1bfdb5 in _0x20029f){if(_0x20029f[_0x0360('0x12')](_0x1bfdb5)){if(_[_0x0360('0x13')](_0x20029f[_0x1bfdb5])){for(var _0x5d8825=0x0;_0x5d8825<_0x20029f[_0x1bfdb5][_0x0360('0x14')];_0x5d8825+=0x1){addVertex(_0x5406db,_0x20029f[_0x1bfdb5][_0x5d8825],_0x1bfdb5);}}else{addVertex(_0x5406db,_0x20029f[_0x1bfdb5],_0x1bfdb5);}}}for(var _0x526ea7=0x0;_0x526ea7<_0x33167a[_0x0360('0x14')];_0x526ea7+=0x1){if(_0x33167a[_0x526ea7][_0x0360('0x15')]&&_0x33167a[_0x526ea7][_0x0360('0x16')]){_0x5406db[_0x0360('0x17')](_0x33167a[_0x526ea7][_0x0360('0x15')],_0x33167a[_0x526ea7]['target'],_0x33167a[_0x526ea7]['value']);}}return _0x5406db;}function getRoot(_0x6b6d2c){return parser[_0x0360('0x18')](_0x6b6d2c,{'object':!![]})[_0x0360('0x19')][_0x0360('0x1a')];}function inspect(_0x1bc377){return util[_0x0360('0x1b')](_0x1bc377,{'showHidden':![],'depth':null});}function initialize(_0x394069,_0x1011ea){var _0x3afc37=getRoot(_0x394069[_0x0360('0x1c')]);if(!_0x3afc37||!_0x3afc37['start'])return;var _0x2e2423,_0x14b4c9,_0x50f603;logger[_0x0360('0x1d')](_0x0360('0x1a'),JSON[_0x0360('0x1e')](_0x3afc37,null,0x2));_0x1011ea['joinAt']=moment()['format'](_0x0360('0x1f'));_0x2e2423=initGraph(_[_0x0360('0x10')](_0x3afc37,_0x0360('0x11')),_0x3afc37[_0x0360('0x11')]);_0x14b4c9=new Vertices(_0x1011ea,rpc,mailRpc);logger[_0x0360('0x20')](util[_0x0360('0x21')](_0x0360('0x22'),_0x1011ea['arg_1'],_0x1011ea[_0x0360('0x23')],_0x1011ea[_0x0360('0x24')],_0x1011ea[_0x0360('0x25')],_0x1011ea['uniqueid']));_0x2e2423[_0x0360('0x26')](_0x3afc37[_0x0360('0x27')]['id'],function(_0x478882){try{_0x478882=_0x14b4c9[_0x0360('0x28')](_0x478882);logger[_0x0360('0x1d')](_0x0360('0x29'),JSON[_0x0360('0x1e')](_0x478882,null,0x2));if(_0x478882['agicommand']===_0x0360('0x2a')){logger[_0x0360('0x20')](_0x0360('0x2b'));_0x1011ea['context']=_0x478882[_0x0360('0x2c')]||_0x1011ea[_0x0360('0x2c')];_0x1011ea[_0x0360('0x2d')]=_0x478882[_0x0360('0x2d')];_0x1011ea[_0x0360('0x2e')]=_0x478882['priority']?_0x478882[_0x0360('0x2e')]-0x1:0x1;return null;}else if(_0x478882&&_0x14b4c9[_0x478882[_0x0360('0xc')]]){_0x50f603=_0x14b4c9[_0x478882['agicommand']](_0x478882);logger[_0x0360('0x20')](_0x0360('0x2f'),JSON[_0x0360('0x1e')](_0x50f603,null,0x2));if(_0x50f603&&_0x50f603[_0x0360('0x30')]===AGI_CODE_SUCCESS&&_0x50f603[_0x0360('0x31')]!==AGI_RESULT_ERROR&&!_0x1011ea['evtHangup']){logger[_0x0360('0x1d')](_0x0360('0x2f'),inspect(_0x50f603));return _[_0x0360('0x32')](_0x50f603[_0x0360('0x31')])?null:_0x50f603[_0x0360('0x31')][_0x0360('0x33')]();}else{logger[_0x0360('0x34')]('response',inspect(_0x50f603));return null;}}else{logger['error'](_0x0360('0x35'));return null;}}catch(_0x4498c1){logger[_0x0360('0x34')](_0x4498c1[_0x0360('0xb')]);return null;}});if(_0x3afc37[_0x0360('0x36')]){logger[_0x0360('0x20')](util[_0x0360('0x21')](_0x0360('0x37'),_0x1011ea[_0x0360('0x38')],_0x1011ea[_0x0360('0x23')],_0x1011ea['callerid'],_0x1011ea[_0x0360('0x25')],_0x1011ea[_0x0360('0x39')]));_0x2e2423[_0x0360('0x26')](_0x3afc37[_0x0360('0x36')]['id'],function(_0x5b0647){try{_0x5b0647=_0x14b4c9['clear'](_0x5b0647);logger[_0x0360('0x1d')]('vertex',JSON['stringify'](_0x5b0647,null,0x2));if(_0x5b0647&&_0x14b4c9[_0x5b0647['agicommand']]){_0x50f603=_0x14b4c9[_0x5b0647[_0x0360('0xc')]](_0x5b0647);if(_0x50f603){logger['debug'](_0x0360('0x2f'),inspect(_0x50f603));return _[_0x0360('0x32')](_0x50f603[_0x0360('0x31')])?null:_0x50f603[_0x0360('0x31')][_0x0360('0x33')]();}else{logger['error'](_0x0360('0x2f'),inspect(_0x50f603));return null;}}else{logger[_0x0360('0x34')](_0x0360('0x35'));return null;}}catch(_0x20d1fa){logger[_0x0360('0x34')](_0x20d1fa[_0x0360('0xb')]);return null;}});}logger[_0x0360('0x20')](util[_0x0360('0x21')](_0x0360('0x3a'),_0x1011ea[_0x0360('0x38')],_0x1011ea[_0x0360('0x23')],_0x1011ea[_0x0360('0x24')],_0x1011ea['dnid'],_0x1011ea[_0x0360('0x39')]));logger[_0x0360('0x20')](util[_0x0360('0x21')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1011ea[_0x0360('0x2c')],_0x1011ea[_0x0360('0x2d')],parseInt(_0x1011ea['priority'],0xa)+0x1));_0x1011ea[_0x0360('0x3b')](_0x1011ea['context'],_0x1011ea[_0x0360('0x2d')],parseInt(_0x1011ea[_0x0360('0x2e')],0xa)+0x1);_0x1011ea['close']();}function handleNotFound(_0x28966f){logger['error'](util[_0x0360('0x21')](_0x0360('0x3c'),_0x28966f[_0x0360('0x38')]));_0x28966f[_0x0360('0x3b')](_0x28966f[_0x0360('0x2c')],_0x28966f[_0x0360('0x2d')],parseInt(_0x28966f[_0x0360('0x2e')],0xa)+0x1);_0x28966f[_0x0360('0x3d')]();}function handleUnpublished(_0x472583){logger[_0x0360('0x34')](util[_0x0360('0x21')]('Project\x20%s\x20not\x20published',_0x472583[_0x0360('0x38')]));_0x472583[_0x0360('0x3b')](_0x472583[_0x0360('0x2c')],_0x472583['extension'],parseInt(_0x472583['priority'],0xa)+0x1);_0x472583[_0x0360('0x3d')]();}module[_0x0360('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xbab8=['util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','target','mxGraphModel','root','inspect','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','start','clear','vertex','agicommand','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','agicommand\x20not\x20found','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json'];(function(_0x31ad2f,_0x385d75){var _0x5b4051=function(_0x19e6a1){while(--_0x19e6a1){_0x31ad2f['push'](_0x31ad2f['shift']());}};_0x5b4051(++_0x385d75);}(_0xbab8,0x16c));var _0x8bab=function(_0x16abc5,_0x2607a4){_0x16abc5=_0x16abc5-0x0;var _0x1d0963=_0xbab8[_0x16abc5];return _0x1d0963;};'use strict';var _=require('lodash');var moment=require(_0x8bab('0x0'));var parser=require(_0x8bab('0x1'));var util=require(_0x8bab('0x2'));var logger=require(_0x8bab('0x3'))(_0x8bab('0x4'));var rpc=require(_0x8bab('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x8bab('0x6'));var Vertices=require(_0x8bab('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x8bab('0x8')]()[_0x8bab('0x9')](function(_0xb37691){logger[_0x8bab('0xa')](_0x8bab('0xb'),_0xb37691[_0x8bab('0xc')]);return[];});}function addVertex(_0x32cfcc,_0x18acee,_0x727ddf){_0x18acee['agicommand']=_0x727ddf;if(_0x18acee[_0x8bab('0xd')](_0x8bab('0xe'))){_0x18acee[_0x8bab('0xf')]=parseInt(_0x18acee[_0x8bab('0xe')],0xa);}_0x32cfcc[_0x8bab('0x10')](_['omit'](_0x18acee,'mxCell'));}function initGraph(_0x39fe33,_0x112c04){var _0x51b3fd=new Graph();for(var _0x3204ba in _0x39fe33){if(_0x39fe33[_0x8bab('0xd')](_0x3204ba)){if(_[_0x8bab('0x11')](_0x39fe33[_0x3204ba])){for(var _0x34674a=0x0;_0x34674a<_0x39fe33[_0x3204ba][_0x8bab('0x12')];_0x34674a+=0x1){addVertex(_0x51b3fd,_0x39fe33[_0x3204ba][_0x34674a],_0x3204ba);}}else{addVertex(_0x51b3fd,_0x39fe33[_0x3204ba],_0x3204ba);}}}for(var _0x388660=0x0;_0x388660<_0x112c04[_0x8bab('0x12')];_0x388660+=0x1){if(_0x112c04[_0x388660][_0x8bab('0x13')]&&_0x112c04[_0x388660]['target']){_0x51b3fd['addEdge'](_0x112c04[_0x388660]['source'],_0x112c04[_0x388660][_0x8bab('0x14')],_0x112c04[_0x388660]['value']);}}return _0x51b3fd;}function getRoot(_0x3f0f50){return parser['toJson'](_0x3f0f50,{'object':!![]})[_0x8bab('0x15')][_0x8bab('0x16')];}function inspect(_0x49632e){return util[_0x8bab('0x17')](_0x49632e,{'showHidden':![],'depth':null});}function initialize(_0x3e0df7,_0x537973){var _0x13d651=getRoot(_0x3e0df7[_0x8bab('0x18')]);if(!_0x13d651||!_0x13d651['start'])return;var _0x2ad2bf,_0x4d6906,_0x276c02;logger[_0x8bab('0x19')](_0x8bab('0x16'),JSON[_0x8bab('0x1a')](_0x13d651,null,0x2));_0x537973['joinAt']=moment()[_0x8bab('0x1b')](_0x8bab('0x1c'));_0x2ad2bf=initGraph(_[_0x8bab('0x1d')](_0x13d651,_0x8bab('0x1e')),_0x13d651['mxCell']);_0x4d6906=new Vertices(_0x537973,rpc,mailRpc);logger[_0x8bab('0x1f')](util[_0x8bab('0x1b')](_0x8bab('0x20'),_0x537973['arg_1'],_0x537973[_0x8bab('0x21')],_0x537973[_0x8bab('0x22')],_0x537973[_0x8bab('0x23')],_0x537973[_0x8bab('0x24')]));_0x2ad2bf['traverseBFS'](_0x13d651[_0x8bab('0x25')]['id'],function(_0x115517){try{_0x115517=_0x4d6906[_0x8bab('0x26')](_0x115517);logger[_0x8bab('0x19')](_0x8bab('0x27'),JSON['stringify'](_0x115517,null,0x2));if(_0x115517[_0x8bab('0x28')]==='gotoc'){logger[_0x8bab('0x1f')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x537973['context']=_0x115517[_0x8bab('0x29')]||_0x537973[_0x8bab('0x29')];_0x537973[_0x8bab('0x2a')]=_0x115517['extension'];_0x537973[_0x8bab('0x2b')]=_0x115517[_0x8bab('0x2b')]?_0x115517[_0x8bab('0x2b')]-0x1:0x1;return null;}else if(_0x115517&&_0x4d6906[_0x115517[_0x8bab('0x28')]]){_0x276c02=_0x4d6906[_0x115517['agicommand']](_0x115517);logger[_0x8bab('0x1f')]('response',JSON[_0x8bab('0x1a')](_0x276c02,null,0x2));if(_0x276c02&&_0x276c02[_0x8bab('0x2c')]===AGI_CODE_SUCCESS&&_0x276c02[_0x8bab('0x2d')]!==AGI_RESULT_ERROR&&!_0x537973[_0x8bab('0x2e')]){logger[_0x8bab('0x19')](_0x8bab('0x2f'),inspect(_0x276c02));return _[_0x8bab('0x30')](_0x276c02[_0x8bab('0x2d')])?null:_0x276c02['result'][_0x8bab('0x31')]();}else{logger[_0x8bab('0xa')](_0x8bab('0x2f'),inspect(_0x276c02));return null;}}else{logger[_0x8bab('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x2dd873){logger['error'](_0x2dd873[_0x8bab('0xc')]);return null;}});if(_0x13d651[_0x8bab('0x32')]){logger['info'](util[_0x8bab('0x1b')](_0x8bab('0x33'),_0x537973['arg_1'],_0x537973[_0x8bab('0x21')],_0x537973['callerid'],_0x537973['dnid'],_0x537973[_0x8bab('0x24')]));_0x2ad2bf[_0x8bab('0x34')](_0x13d651['finally']['id'],function(_0x358d09){try{_0x358d09=_0x4d6906[_0x8bab('0x26')](_0x358d09);logger[_0x8bab('0x19')](_0x8bab('0x27'),JSON[_0x8bab('0x1a')](_0x358d09,null,0x2));if(_0x358d09&&_0x4d6906[_0x358d09[_0x8bab('0x28')]]){_0x276c02=_0x4d6906[_0x358d09[_0x8bab('0x28')]](_0x358d09);if(_0x276c02){logger[_0x8bab('0x19')](_0x8bab('0x2f'),inspect(_0x276c02));return _[_0x8bab('0x30')](_0x276c02[_0x8bab('0x2d')])?null:_0x276c02['result'][_0x8bab('0x31')]();}else{logger[_0x8bab('0xa')](_0x8bab('0x2f'),inspect(_0x276c02));return null;}}else{logger['error'](_0x8bab('0x35'));return null;}}catch(_0x5a77e9){logger[_0x8bab('0xa')](_0x5a77e9['stack']);return null;}});}logger[_0x8bab('0x1f')](util[_0x8bab('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x537973[_0x8bab('0x36')],_0x537973[_0x8bab('0x21')],_0x537973[_0x8bab('0x22')],_0x537973[_0x8bab('0x23')],_0x537973[_0x8bab('0x24')]));logger[_0x8bab('0x1f')](util['format'](_0x8bab('0x37'),_0x537973[_0x8bab('0x29')],_0x537973[_0x8bab('0x2a')],parseInt(_0x537973['priority'],0xa)+0x1));_0x537973[_0x8bab('0x38')](_0x537973[_0x8bab('0x29')],_0x537973[_0x8bab('0x2a')],parseInt(_0x537973[_0x8bab('0x2b')],0xa)+0x1);_0x537973[_0x8bab('0x39')]();}function handleNotFound(_0x37e208){logger[_0x8bab('0xa')](util[_0x8bab('0x1b')](_0x8bab('0x3a'),_0x37e208[_0x8bab('0x36')]));_0x37e208['continueAt'](_0x37e208[_0x8bab('0x29')],_0x37e208['extension'],parseInt(_0x37e208[_0x8bab('0x2b')],0xa)+0x1);_0x37e208[_0x8bab('0x39')]();}function handleUnpublished(_0xb8a07c){logger[_0x8bab('0xa')](util['format'](_0x8bab('0x3b'),_0xb8a07c[_0x8bab('0x36')]));_0xb8a07c[_0x8bab('0x38')](_0xb8a07c[_0x8bab('0x29')],_0xb8a07c[_0x8bab('0x2a')],parseInt(_0xb8a07c[_0x8bab('0x2b')],0xa)+0x1);_0xb8a07c['close']();}module[_0x8bab('0x3c')]={'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 c16b111..e578a7f 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 _0xd4c9=['trim','slice','emit','headers','_inBody','line','length','exports','util','stream','call','_localBuffer','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','split'];(function(_0x4bbaea,_0x5620bf){var _0x5a6371=function(_0xe8da72){while(--_0xe8da72){_0x4bbaea['push'](_0x4bbaea['shift']());}};_0x5a6371(++_0x5620bf);}(_0xd4c9,0x1bd));var _0x9d4c=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd4c9[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x9d4c('0x0'));var Transform=require(_0x9d4c('0x1'))['Transform'];function AGIReply(_0x4ccba2){Transform[_0x9d4c('0x2')](this,_0x4ccba2);this[_0x9d4c('0x3')]='';this['_inBody']=![];}util[_0x9d4c('0x4')](AGIReply,Transform);AGIReply[_0x9d4c('0x5')]['_transform']=function(_0x5a7f35,_0x13e4bb,_0x11af20){var _0x4ab37a='\x0a',_0x6bc2b8=['\x0a\x0a',_0x9d4c('0x6')],_0x45977b=-0x1,_0xf353de=-0x1,_0x22ba7c='',_0x2268b9=0x0,_0x1d5ee5='',_0x2e796c='';this['_localBuffer']+=_0x5a7f35[_0x9d4c('0x7')]();_0x1d5ee5=this[_0x9d4c('0x3')];if(!this['_inBody']){_0x2268b9=0x0;while(_0x6bc2b8[_0x2268b9]){while((_0xf353de=_0x1d5ee5[_0x9d4c('0x8')](_0x6bc2b8[_0x2268b9]))!=-0x1){_0x22ba7c=_0x6bc2b8[_0x2268b9];_0x2e796c=_0x1d5ee5[_0x9d4c('0x9')](0x0,_0xf353de);_0x1d5ee5=_0x1d5ee5['substring'](_0xf353de+_0x22ba7c['length']);var _0x4d7813=_0x2e796c[_0x9d4c('0xa')](_0x4ab37a),_0x265786=0x0,_0x454f18={},_0x5df319='',_0x37a400='',_0x2e970c=-0x1;while(_0x4d7813[_0x265786]){_0x2e970c=_0x4d7813[_0x265786][_0x9d4c('0x8')](':');if(_0x2e970c!=-0x1){_0x5df319=_0x4d7813[_0x265786]['slice'](0x0,_0x2e970c)[_0x9d4c('0xb')]();_0x37a400=_0x4d7813[_0x265786][_0x9d4c('0xc')](_0x2e970c+0x1)[_0x9d4c('0xb')]();if(_0x5df319['length']>0x0){_0x454f18[_0x5df319]=_0x37a400;}}else{}_0x265786++;}this[_0x9d4c('0xd')](_0x9d4c('0xe'),_0x454f18);this[_0x9d4c('0xf')]=!![];}_0x2268b9++;}this[_0x9d4c('0x3')]=_0x1d5ee5;}else{while((_0x45977b=_0x1d5ee5[_0x9d4c('0x8')](_0x4ab37a))!=-0x1){_0x2e796c=_0x1d5ee5[_0x9d4c('0x9')](0x0,_0x45977b);this['emit'](_0x9d4c('0x10'),_0x2e796c);_0x1d5ee5=_0x1d5ee5[_0x9d4c('0x9')](_0x45977b+_0x4ab37a[_0x9d4c('0x11')]);}this[_0x9d4c('0x3')]=_0x1d5ee5;}_0x11af20();};module[_0x9d4c('0x12')]=AGIReply; \ No newline at end of file +var _0xb458=['trim','emit','headers','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring','length','split','slice'];(function(_0x26c336,_0x584614){var _0x5f5d61=function(_0x419e84){while(--_0x419e84){_0x26c336['push'](_0x26c336['shift']());}};_0x5f5d61(++_0x584614);}(_0xb458,0xca));var _0x8b45=function(_0x44a074,_0x5f3ddb){_0x44a074=_0x44a074-0x0;var _0x2c44a4=_0xb458[_0x44a074];return _0x2c44a4;};'use strict';var util=require(_0x8b45('0x0'));var Transform=require(_0x8b45('0x1'))[_0x8b45('0x2')];function AGIReply(_0xa1c236){Transform['call'](this,_0xa1c236);this[_0x8b45('0x3')]='';this[_0x8b45('0x4')]=![];}util[_0x8b45('0x5')](AGIReply,Transform);AGIReply[_0x8b45('0x6')][_0x8b45('0x7')]=function(_0x15c798,_0x3f0efd,_0x35680c){var _0x2a5b3c='\x0a',_0x114de0=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x15dcf4=-0x1,_0x2f0c9e=-0x1,_0x1386a4='',_0x54f299=0x0,_0x122b6d='',_0x4c1403='';this[_0x8b45('0x3')]+=_0x15c798[_0x8b45('0x8')]();_0x122b6d=this[_0x8b45('0x3')];if(!this['_inBody']){_0x54f299=0x0;while(_0x114de0[_0x54f299]){while((_0x2f0c9e=_0x122b6d[_0x8b45('0x9')](_0x114de0[_0x54f299]))!=-0x1){_0x1386a4=_0x114de0[_0x54f299];_0x4c1403=_0x122b6d['substring'](0x0,_0x2f0c9e);_0x122b6d=_0x122b6d[_0x8b45('0xa')](_0x2f0c9e+_0x1386a4[_0x8b45('0xb')]);var _0x42b37e=_0x4c1403[_0x8b45('0xc')](_0x2a5b3c),_0x21f36e=0x0,_0x2d9102={},_0x54c03c='',_0x5559e7='',_0x46a6c4=-0x1;while(_0x42b37e[_0x21f36e]){_0x46a6c4=_0x42b37e[_0x21f36e][_0x8b45('0x9')](':');if(_0x46a6c4!=-0x1){_0x54c03c=_0x42b37e[_0x21f36e][_0x8b45('0xd')](0x0,_0x46a6c4)[_0x8b45('0xe')]();_0x5559e7=_0x42b37e[_0x21f36e][_0x8b45('0xd')](_0x46a6c4+0x1)[_0x8b45('0xe')]();if(_0x54c03c[_0x8b45('0xb')]>0x0){_0x2d9102[_0x54c03c]=_0x5559e7;}}else{}_0x21f36e++;}this[_0x8b45('0xf')](_0x8b45('0x10'),_0x2d9102);this[_0x8b45('0x4')]=!![];}_0x54f299++;}this[_0x8b45('0x3')]=_0x122b6d;}else{while((_0x15dcf4=_0x122b6d[_0x8b45('0x9')](_0x2a5b3c))!=-0x1){_0x4c1403=_0x122b6d[_0x8b45('0xa')](0x0,_0x15dcf4);this[_0x8b45('0xf')]('line',_0x4c1403);_0x122b6d=_0x122b6d['substring'](_0x15dcf4+_0x2a5b3c[_0x8b45('0xb')]);}this[_0x8b45('0x3')]=_0x122b6d;}_0x35680c();};module[_0x8b45('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 808a5c7..d94ee8c 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 _0xae53=['lodash','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser'];(function(_0x143017,_0x8b3508){var _0x22c11a=function(_0x3a51fc){while(--_0x3a51fc){_0x143017['push'](_0x143017['shift']());}};_0x22c11a(++_0x8b3508);}(_0xae53,0x16e));var _0x3ae5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xae53[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3ae5('0x0'));var moment=require('moment');var jayson=require(_0x3ae5('0x1'));var client=jayson[_0x3ae5('0x2')][_0x3ae5('0x3')]({'port':0x2329});function request(_0x564f59,_0x393f55){return new Promise(function(_0x2d4c0b,_0x293589){return client[_0x3ae5('0x4')](_0x564f59,_0x393f55)[_0x3ae5('0x5')](function(_0x4e4218){if(_0x4e4218[_0x3ae5('0x6')]){return _0x293589(_0x4e4218['error'][_0x3ae5('0x7')]);}else{return _0x2d4c0b(_0x4e4218[_0x3ae5('0x8')]);}})[_0x3ae5('0x9')](function(_0x3fdf89){return _0x293589(_0x3fdf89);});});}exports[_0x3ae5('0xa')]=function(){return request(_0x3ae5('0xb'),{'options':{'raw':![],'attributes':['id',_0x3ae5('0xc'),_0x3ae5('0xd')]}});};exports['getSquareProject']=function(_0xbd3c3e){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xbd3c3e},'attributes':[_0x3ae5('0xd')]}});};exports[_0x3ae5('0xe')]=function(_0x315476){return request(_0x3ae5('0xf'),{'options':{'raw':![],'where':{'id':_0x315476},'include':[{'model':_0x3ae5('0x10'),'as':'Smtp','include':[{'model':_0x3ae5('0x11'),'as':_0x3ae5('0x11')}]}],'attributes':['id',_0x3ae5('0xc'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0xaa3ce9){return request('ShowSquareProject',{'options':{'where':{'id':_0xaa3ce9},'attributes':[_0x3ae5('0xc')]}});};exports[_0x3ae5('0x12')]=function(_0x3b9122){return request(_0x3ae5('0x13'),{'options':{'where':{'id':_0x3b9122},'attributes':[_0x3ae5('0xc')]}});};exports['getVariableById']=function(_0x216c62){return request(_0x3ae5('0x14'),{'options':{'where':{'id':_0x216c62},'attributes':[_0x3ae5('0xc')]}});};exports['getSquareOdbcById']=function(_0x521a29){return request(_0x3ae5('0x15'),{'options':{'where':{'id':_0x521a29},'attributes':[_0x3ae5('0x16')]}});};exports[_0x3ae5('0x17')]=function(_0x445a31){return request(_0x3ae5('0x18'),{'options':{'where':{'id':_0x445a31},'attributes':[_0x3ae5('0xc')]}});};exports[_0x3ae5('0x19')]=function(_0x5360a3){return request('GetContactByPhone',{'options':{'where':{'phone':_0x5360a3['phone']},'attributes':['id']}});};exports[_0x3ae5('0x1a')]=function(_0x3f43ca){return request(_0x3ae5('0x1b'),{'options':{'where':{'id':_0x3f43ca},'attributes':[_0x3ae5('0xc')]}});};exports[_0x3ae5('0x1c')]=function(_0x211dff){return request(_0x3ae5('0x1d'),{'options':{'where':{'id':_0x211dff},'attributes':['save_name']}});};exports[_0x3ae5('0x1e')]=function(_0x1078a0){return request(_0x3ae5('0x1f'),{'options':{'raw':![],'where':{'id':_0x1078a0},'include':[{'model':_0x3ae5('0x20'),'as':_0x3ae5('0x21')}]}});};exports[_0x3ae5('0x22')]=function(_0x502671){return request('ShowSmsAccount',{'options':{'where':{'id':_0x502671},'attributes':['id',_0x3ae5('0xc')]}});};exports[_0x3ae5('0x23')]=function(_0x32da8c){return request(_0x3ae5('0x24'),{'body':_0x32da8c});};exports[_0x3ae5('0x25')]=function(_0x9a9714){return request(_0x3ae5('0x26'),{'body':_0x9a9714});};exports[_0x3ae5('0x27')]=function(_0x4a17d8){return request('CreateSquareReport',{'body':_[_0x3ae5('0x28')](_0x4a17d8,{'project_name':_0x4a17d8[_0x3ae5('0x29')],'prev_project_name':_0x4a17d8[_0x3ae5('0x2a')]||'','is_subproject':_0x4a17d8['arg_2']?!![]:![],'leaveAt':moment()[_0x3ae5('0x2b')](_0x3ae5('0x2c'))})});};exports[_0x3ae5('0x2d')]=function(_0x2ba130){return request(_0x3ae5('0x2e'),{'body':_0x2ba130});};exports['createSquareMessage']=function(_0x1705c5){return request(_0x3ae5('0x2f'),{'body':_0x1705c5});};exports[_0x3ae5('0x30')]=function(_0x41ba36){return request(_0x3ae5('0x31'),{'options':{'raw':![],'where':{'phone':_0x41ba36[_0x3ae5('0x32')],'ListId':_0x41ba36[_0x3ae5('0x33')]}}})['then'](function(_0x35847e){if(_0x35847e){return _0x35847e;}return request(_0x3ae5('0x34'),{'body':_0x41ba36});});};exports[_0x3ae5('0x35')]=function(_0x5d7072){return request(_0x3ae5('0x36'),{'options':{'where':{'id':_0x5d7072},'attributes':[_0x3ae5('0xc')]}});};exports[_0x3ae5('0x37')]=function(_0x2993a5,_0x4492a){return request(_0x3ae5('0x38'),{'body':{'interface':_0x4492a},'options':{'where':_0x2993a5}});};exports[_0x3ae5('0x39')]=function(_0x2ca128,_0x47954f,_0x3d4e62){return request(_0x3ae5('0x3a'),{'body':{'type':_0x47954f,'uniqueid':_0x3d4e62},'options':{'where':_0x2ca128}});};exports[_0x3ae5('0x3b')]=function(_0x597d91){return request(_0x3ae5('0x3c'),{'body':{},'options':{'where':_0x597d91}});};exports['agentLogout']=function(_0x53f716){return request('LogoutUser',{'body':{},'options':{'where':_0x53f716}});}; \ No newline at end of file +var _0x28aa=['CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','agentLogout','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','format','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId'];(function(_0x36ad71,_0x3f235d){var _0x45190d=function(_0x158e41){while(--_0x158e41){_0x36ad71['push'](_0x36ad71['shift']());}};_0x45190d(++_0x3f235d);}(_0x28aa,0xf8));var _0xa28a=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x28aa[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var moment=require(_0xa28a('0x0'));var jayson=require(_0xa28a('0x1'));var client=jayson[_0xa28a('0x2')][_0xa28a('0x3')]({'port':0x2329});function request(_0x46d694,_0x3227b6){return new Promise(function(_0x50ad8c,_0x3e0341){return client[_0xa28a('0x4')](_0x46d694,_0x3227b6)[_0xa28a('0x5')](function(_0x22966f){if(_0x22966f['error']){return _0x3e0341(_0x22966f[_0xa28a('0x6')][_0xa28a('0x7')]);}else{return _0x50ad8c(_0x22966f[_0xa28a('0x8')]);}})[_0xa28a('0x9')](function(_0x420947){return _0x3e0341(_0x420947);});});}exports[_0xa28a('0xa')]=function(){return request(_0xa28a('0xb'),{'options':{'raw':![],'attributes':['id',_0xa28a('0xc'),_0xa28a('0xd')]}});};exports[_0xa28a('0xe')]=function(_0x3e8701){return request(_0xa28a('0xf'),{'options':{'raw':![],'where':{'name':_0x3e8701},'attributes':[_0xa28a('0xd')]}});};exports[_0xa28a('0x10')]=function(_0x1d0a82){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1d0a82},'include':[{'model':_0xa28a('0x11'),'as':_0xa28a('0x12'),'include':[{'model':_0xa28a('0x13'),'as':_0xa28a('0x13')}]}],'attributes':['id','name',_0xa28a('0x14')],'smtp':!![]}});};exports[_0xa28a('0x15')]=function(_0x59e606){return request(_0xa28a('0xf'),{'options':{'where':{'id':_0x59e606},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x16')]=function(_0x412e0d){return request(_0xa28a('0x17'),{'options':{'where':{'id':_0x412e0d},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x18')]=function(_0x11ef7c){return request(_0xa28a('0x19'),{'options':{'where':{'id':_0x11ef7c},'attributes':[_0xa28a('0xc')]}});};exports['getSquareOdbcById']=function(_0x3018cd){return request(_0xa28a('0x1a'),{'options':{'where':{'id':_0x3018cd},'attributes':[_0xa28a('0x1b')]}});};exports['getUserById']=function(_0x15d22f){return request(_0xa28a('0x1c'),{'options':{'where':{'id':_0x15d22f},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x1d')]=function(_0x1fc027){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1fc027['phone']},'attributes':['id']}});};exports[_0xa28a('0x1e')]=function(_0x516340){return request('ShowTrunk',{'options':{'where':{'id':_0x516340},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x1f')]=function(_0x1f528c){return request(_0xa28a('0x20'),{'options':{'where':{'id':_0x1f528c},'attributes':[_0xa28a('0x21')]}});};exports[_0xa28a('0x22')]=function(_0x3b0c0f){return request(_0xa28a('0x23'),{'options':{'raw':![],'where':{'id':_0x3b0c0f},'include':[{'model':_0xa28a('0x24'),'as':_0xa28a('0x25')}]}});};exports[_0xa28a('0x26')]=function(_0x43bf00){return request('ShowSmsAccount',{'options':{'where':{'id':_0x43bf00},'attributes':['id',_0xa28a('0xc')]}});};exports[_0xa28a('0x27')]=function(_0x461ab4){return request('CreateSmsMessage',{'body':_0x461ab4});};exports[_0xa28a('0x28')]=function(_0x27d680){return request('CreateSquareDetailsReport',{'body':_0x27d680});};exports[_0xa28a('0x29')]=function(_0x19fff1){return request(_0xa28a('0x2a'),{'body':_[_0xa28a('0x2b')](_0x19fff1,{'project_name':_0x19fff1[_0xa28a('0x2c')],'prev_project_name':_0x19fff1['arg_2']||'','is_subproject':_0x19fff1['arg_2']?!![]:![],'leaveAt':moment()[_0xa28a('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xa28a('0x2e')]=function(_0x5f2579){return request('CreateSquareRecording',{'body':_0x5f2579});};exports[_0xa28a('0x2f')]=function(_0x3d0488){return request(_0xa28a('0x30'),{'body':_0x3d0488});};exports[_0xa28a('0x31')]=function(_0x5514f5){return request(_0xa28a('0x32'),{'options':{'raw':![],'where':{'phone':_0x5514f5['phone'],'ListId':_0x5514f5[_0xa28a('0x33')]}}})[_0xa28a('0x5')](function(_0x2b029f){if(_0x2b029f){return _0x2b029f;}return request(_0xa28a('0x34'),{'body':_0x5514f5});});};exports[_0xa28a('0x35')]=function(_0x271925){return request(_0xa28a('0x36'),{'options':{'where':{'id':_0x271925},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x37')]=function(_0x392d14,_0x5e53d1){return request('LoginUser',{'body':{'interface':_0x5e53d1},'options':{'where':_0x392d14}});};exports[_0xa28a('0x38')]=function(_0x58d32a,_0x1facc7,_0x402af4){return request(_0xa28a('0x39'),{'body':{'type':_0x1facc7,'uniqueid':_0x402af4},'options':{'where':_0x58d32a}});};exports['agentUnpause']=function(_0x43b068){return request(_0xa28a('0x3a'),{'body':{},'options':{'where':_0x43b068}});};exports[_0xa28a('0x3b')]=function(_0x4060af){return request('LogoutUser',{'body':{},'options':{'where':_0x4060af}});}; \ 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 6e2b9a8..66a7408 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 _0xd046=['exports','./lex'];(function(_0x1f8e1c,_0x47413e){var _0x379e75=function(_0xc195ca){while(--_0xc195ca){_0x1f8e1c['push'](_0x1f8e1c['shift']());}};_0x379e75(++_0x47413e);}(_0xd046,0x129));var _0x6d04=function(_0x7135f7,_0x172af6){_0x7135f7=_0x7135f7-0x0;var _0x27e813=_0xd046[_0x7135f7];return _0x27e813;};var polly=require('./polly');var lex=require(_0x6d04('0x0'));module[_0x6d04('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0689=['./lex'];(function(_0x2b5aea,_0xeb8e){var _0x17efd5=function(_0x5656bc){while(--_0x5656bc){_0x2b5aea['push'](_0x2b5aea['shift']());}};_0x17efd5(++_0xeb8e);}(_0x0689,0x161));var _0x9068=function(_0x53673d,_0x1bff0a){_0x53673d=_0x53673d-0x0;var _0x4ea690=_0x0689[_0x53673d];return _0x4ea690;};var polly=require('./polly');var lex=require(_0x9068('0x0'));module['exports']={'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 a1d39c8..c14fc11 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 _0x2dae=['./lib/api'];(function(_0x2a0a6d,_0x25634f){var _0x141c07=function(_0x4945e1){while(--_0x4945e1){_0x2a0a6d['push'](_0x2a0a6d['shift']());}};_0x141c07(++_0x25634f);}(_0x2dae,0xc3));var _0xe2da=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0x2dae[_0x5275b8];return _0x568a9b;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ No newline at end of file +var _0x6324=['./lib/api','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6324,0x142));var _0x4632=function(_0x4b4865,_0xb43449){_0x4b4865=_0x4b4865-0x0;var _0x190dc2=_0x6324[_0x4b4865];return _0x190dc2;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ 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 ca8ae80..54e238b 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(_0x18bf4e,_0x81c26a){var _0x33a2b4=function(_0x3ad883){while(--_0x3ad883){_0x18bf4e['push'](_0x18bf4e['shift']());}};_0x33a2b4(++_0x81c26a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x2321b4,_0x188dea){var _0x35d849=function(_0x4e99e2){while(--_0x4e99e2){_0x2321b4['push'](_0x2321b4['shift']());}};_0x35d849(++_0x188dea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 723ad9a..de6ce38 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0077=['exports','./lib/api'];(function(_0x132996,_0xe5c979){var _0x25f29c=function(_0x474c20){while(--_0x474c20){_0x132996['push'](_0x132996['shift']());}};_0x25f29c(++_0xe5c979);}(_0x0077,0x111));var _0x7007=function(_0x584980,_0x15f9e5){_0x584980=_0x584980-0x0;var _0x40cfbf=_0x0077[_0x584980];return _0x40cfbf;};'use strict';var polly=require(_0x7007('0x0'));module[_0x7007('0x1')]=function(_0x5ec58c,_0x4ec457,_0x3ab18b,_0x5eb4fb,_0x43c1a8,_0x52e8fb,_0x1dcf8e){return polly(_0x5ec58c,_0x4ec457,_0x3ab18b,_0x5eb4fb,_0x43c1a8,_0x52e8fb,_0x1dcf8e);}; \ No newline at end of file +var _0x5bc3=['./lib/api'];(function(_0x16f047,_0x1b64b8){var _0x4f63e5=function(_0x2b4429){while(--_0x2b4429){_0x16f047['push'](_0x16f047['shift']());}};_0x4f63e5(++_0x1b64b8);}(_0x5bc3,0x1e5));var _0x35bc=function(_0x17df0b,_0x4eb806){_0x17df0b=_0x17df0b-0x0;var _0x535e65=_0x5bc3[_0x17df0b];return _0x535e65;};'use strict';var polly=require(_0x35bc('0x0'));module['exports']=function(_0x51e793,_0x520304,_0x4fca76,_0x2a8612,_0x43b886,_0x3e542d,_0xa053c){return polly(_0x51e793,_0x520304,_0x4fca76,_0x2a8612,_0x43b886,_0x3e542d,_0xa053c);}; \ 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 439d7d1..f72da59 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 _0xcea7=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x520bcf,_0x37e2d0){var _0x2cfc01=function(_0x3014f8){while(--_0x3014f8){_0x520bcf['push'](_0x520bcf['shift']());}};_0x2cfc01(++_0x37e2d0);}(_0xcea7,0x1ec));var _0x7cea=function(_0x2fe068,_0x143f23){_0x2fe068=_0x2fe068-0x0;var _0x225087=_0xcea7[_0x2fe068];return _0x225087;};'use strict';var fs=require('fs');var path=require(_0x7cea('0x0'));var BPromise=require(_0x7cea('0x1'));var rs=require(_0x7cea('0x2'));var AWS=require(_0x7cea('0x3'));function pollyResult(_0x5d8a6c,_0x16e88b,_0x1be623){return new BPromise(function(_0x45b36f,_0x3c7d37){_0x5d8a6c[_0x7cea('0x4')](_0x16e88b,function(_0x1960f3,_0x39085c){if(_0x1960f3){_0x3c7d37(_0x1960f3);}else if(_0x39085c){if(_0x39085c[_0x7cea('0x5')]instanceof Buffer){fs[_0x7cea('0x6')](_0x1be623,_0x39085c[_0x7cea('0x5')],function(_0x5688f5){if(_0x5688f5){_0x3c7d37(_0x5688f5);}else{_0x45b36f();}});}else{_0x3c7d37(new Error(_0x7cea('0x7')));}}else{_0x3c7d37(new Error(_0x7cea('0x8')));}});});}module[_0x7cea('0x9')]=function(_0x5627b1,_0x3e7844,_0x3ae584,_0x55ea4c,_0x36107b,_0x519262,_0x488ffd){var _0x26e048=new AWS[(_0x7cea('0xa'))]({'accessKeyId':_0x5627b1,'secretAccessKey':_0x3e7844,'region':_0x3ae584});var _0x2c3ee3={'Text':_0x36107b,'TextType':_0x519262||_0x7cea('0xb'),'OutputFormat':_0x7cea('0xc'),'VoiceId':_0x55ea4c};return pollyResult(_0x26e048,_0x2c3ee3,_0x488ffd);}; \ No newline at end of file +var _0xa9a1=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','bluebird','randomstring','AudioStream','writeFile'];(function(_0x577ce8,_0x3aab34){var _0x206ab9=function(_0x1280e8){while(--_0x1280e8){_0x577ce8['push'](_0x577ce8['shift']());}};_0x206ab9(++_0x3aab34);}(_0xa9a1,0x176));var _0x1a9a=function(_0xab0049,_0x7718cf){_0xab0049=_0xab0049-0x0;var _0x97eb5c=_0xa9a1[_0xab0049];return _0x97eb5c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1a9a('0x0'));var rs=require(_0x1a9a('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4f7322,_0x188f70,_0x2503c2){return new BPromise(function(_0x170e05,_0x3da318){_0x4f7322['synthesizeSpeech'](_0x188f70,function(_0x3f2282,_0x592ae4){if(_0x3f2282){_0x3da318(_0x3f2282);}else if(_0x592ae4){if(_0x592ae4[_0x1a9a('0x2')]instanceof Buffer){fs[_0x1a9a('0x3')](_0x2503c2,_0x592ae4[_0x1a9a('0x2')],function(_0x5378e4){if(_0x5378e4){_0x3da318(_0x5378e4);}else{_0x170e05();}});}else{_0x3da318(new Error(_0x1a9a('0x4')));}}else{_0x3da318(new Error(_0x1a9a('0x5')));}});});}module[_0x1a9a('0x6')]=function(_0x2ca0c6,_0x19bf55,_0x15e9b0,_0x575117,_0x8852ad,_0x52b27d,_0x2200d9){var _0x4d7f52=new AWS['Polly']({'accessKeyId':_0x2ca0c6,'secretAccessKey':_0x19bf55,'region':_0x15e9b0});var _0x36fc42={'Text':_0x8852ad,'TextType':_0x52b27d||_0x1a9a('0x7'),'OutputFormat':_0x1a9a('0x8'),'VoiceId':_0x575117};return pollyResult(_0x4d7f52,_0x36fc42,_0x2200d9);}; \ 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 80955aa..9be4444 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 _0xeecc=['./lib/api','exports'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xeecc,0x90));var _0xceec=function(_0x8b43b1,_0x3209c4){_0x8b43b1=_0x8b43b1-0x0;var _0x2e0e54=_0xeecc[_0x8b43b1];return _0x2e0e54;};'use strict';var asr=require(_0xceec('0x0'));module[_0xceec('0x1')]=function(_0x52e063,_0x43ae82,_0x22dffb,_0x2e64e4){return asr(_0x52e063,_0x43ae82,_0x22dffb);}; \ No newline at end of file +var _0x3e11=['./lib/api','exports'];(function(_0xc7ed29,_0x515330){var _0xf8da19=function(_0x1bd99c){while(--_0x1bd99c){_0xc7ed29['push'](_0xc7ed29['shift']());}};_0xf8da19(++_0x515330);}(_0x3e11,0x18c));var _0x13e1=function(_0x4a4629,_0x3b4f1b){_0x4a4629=_0x4a4629-0x0;var _0xa544fb=_0x3e11[_0x4a4629];return _0xa544fb;};'use strict';var asr=require(_0x13e1('0x0'));module[_0x13e1('0x1')]=function(_0x543943,_0x380f42,_0xc7d421,_0x5452fe){return asr(_0x543943,_0x380f42,_0xc7d421);}; \ 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 cf683c1..d9dc759 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 _0x31c2=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','exports','string','length'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x31c2,0x98));var _0x231c=function(_0x452206,_0x2aa0f7){_0x452206=_0x452206-0x0;var _0x3aa901=_0x31c2[_0x452206];return _0x3aa901;};'use strict';var url=require(_0x231c('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x231c('0x1')]=function(_0x1426bb,_0x4bcfa6,_0x2f0b2c){return new BPromise(function(_0x54b19e,_0x396f04){var _0xe1bfea;if(typeof _0x1426bb!==_0x231c('0x2')||_0x1426bb[_0x231c('0x3')]===0x0){return _0x396f04(_0x231c('0x4'));}if(typeof _0x4bcfa6!==_0x231c('0x2')||_0x4bcfa6['length']===0x0){return _0x396f04(_0x231c('0x5'));}if(typeof _0x2f0b2c!=='undefined'&&(typeof _0x2f0b2c!==_0x231c('0x2')||_0x2f0b2c[_0x231c('0x3')]===0x0)){return _0x396f04(_0x231c('0x6'));}try{_0xe1bfea=fs[_0x231c('0x7')](_0x1426bb)['toString'](_0x231c('0x8'));}catch(_0x1b8eb5){return _0x396f04(_0x1b8eb5);}return _0x54b19e({'method':_0x231c('0x9'),'uri':host+_0x231c('0xa')+_0x4bcfa6,'body':{'config':{'encoding':_0x231c('0xb'),'sampleRateHertz':_0x231c('0xc'),'languageCode':_0x2f0b2c},'audio':{'content':_0xe1bfea}},'json':!![]});});}; \ No newline at end of file +var _0x2209=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2209,0x95));var _0x9220=function(_0x3cfc68,_0x9f3031){_0x3cfc68=_0x3cfc68-0x0;var _0x407e04=_0x2209[_0x3cfc68];return _0x407e04;};'use strict';var url=require(_0x9220('0x0'));var BPromise=require(_0x9220('0x1'));var fs=require('fs');var host=_0x9220('0x2');module[_0x9220('0x3')]=function(_0x29dc9b,_0x5d3fe2,_0x2b23aa){return new BPromise(function(_0x5cc72c,_0x348220){var _0x2fddae;if(typeof _0x29dc9b!==_0x9220('0x4')||_0x29dc9b[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x6'));}if(typeof _0x5d3fe2!==_0x9220('0x4')||_0x5d3fe2[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x7'));}if(typeof _0x2b23aa!==_0x9220('0x8')&&(typeof _0x2b23aa!=='string'||_0x2b23aa[_0x9220('0x5')]===0x0)){return _0x348220(_0x9220('0x9'));}try{_0x2fddae=fs['readFileSync'](_0x29dc9b)[_0x9220('0xa')](_0x9220('0xb'));}catch(_0x18550a){return _0x348220(_0x18550a);}return _0x5cc72c({'method':_0x9220('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x5d3fe2,'body':{'config':{'encoding':_0x9220('0xd'),'sampleRateHertz':_0x9220('0xe'),'languageCode':_0x2b23aa},'audio':{'content':_0x2fddae}},'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 c1d59fb..b03f814 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 _0xc7e0=['./asr'];(function(_0x2ebfd5,_0x516dd4){var _0x1bfb6e=function(_0x33e165){while(--_0x33e165){_0x2ebfd5['push'](_0x2ebfd5['shift']());}};_0x1bfb6e(++_0x516dd4);}(_0xc7e0,0x16f));var _0x0c7e=function(_0x1079b3,_0x5a2f22){_0x1079b3=_0x1079b3-0x0;var _0x3dc92b=_0xc7e0[_0x1079b3];return _0x3dc92b;};var asr=require(_0x0c7e('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2223=['exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2223,0x84));var _0x3222=function(_0x4cb348,_0x3c0cd1){_0x4cb348=_0x4cb348-0x0;var _0xd2944b=_0x2223[_0x4cb348];return _0xd2944b;};var asr=require('./asr');module[_0x3222('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 032aaf5..5990716 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 _0xaa76=['boolValue','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','channelData','CustomAction','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','http','md5','request-promise','randomstring','sox','google-tts-api','url','util','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','error','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','split','?key=','ssml','input','voice','POST','.mp3','from','audioContent','writeFile','777','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','source','result','resolvedQuery','actionIncomplete','fulfillment','score','status','code','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xaa76,0x9b));var _0x6aa7=function(_0x3bd497,_0x34c330){_0x3bd497=_0x3bd497-0x0;var _0xd821bb=_0xaa76[_0x3bd497];return _0xd821bb;};'use strict';var apiai=require(_0x6aa7('0x0'));var BPromise=require(_0x6aa7('0x1'));var dialogflow=require(_0x6aa7('0x2'));var fs=require('fs');var http=require(_0x6aa7('0x3'));var https=require('https');var md5=require(_0x6aa7('0x4'));var path=require('path');var querystring=require('querystring');var rp=require(_0x6aa7('0x5'));var rs=require(_0x6aa7('0x6'));var sox=require(_0x6aa7('0x7'));var tts=require(_0x6aa7('0x8'));var urlParse=require(_0x6aa7('0x9'))['parse'];var util=require(_0x6aa7('0xa'));var aws=require('./aws');var google=require(_0x6aa7('0xb'));var sestek=require(_0x6aa7('0xc'));var tilde=require('./tilde');var logger=require(_0x6aa7('0xd'))(_0x6aa7('0xe'));var ISPEECH_API=_0x6aa7('0xf');function downloadFile(_0x59f43b,_0x10e833){return new BPromise(function(_0x6e24cb,_0x1a1033){var _0x13e3f9=urlParse(_0x59f43b);var _0x3035cb=_0x13e3f9[_0x6aa7('0x10')]===_0x6aa7('0x11')?https:http;var _0x5146fe={'host':_0x13e3f9[_0x6aa7('0x12')],'path':_0x13e3f9[_0x6aa7('0x13')],'headers':{'user-agent':_0x6aa7('0x14')}};_0x3035cb[_0x6aa7('0x15')](_0x5146fe,function(_0x3d7f63){if(_0x3d7f63['statusCode']!==0xc8){logger[_0x6aa7('0x16')]('request\x20to\x20'+_0x59f43b+'\x20failed,\x20status\x20code\x20=\x20'+_0x3d7f63[_0x6aa7('0x17')]+'\x20('+_0x3d7f63[_0x6aa7('0x18')]+')');_0x1a1033(new Error(_0x6aa7('0x19')+_0x59f43b+_0x6aa7('0x1a')+_0x3d7f63['statusCode']+'\x20('+_0x3d7f63[_0x6aa7('0x18')]+')'));return;}var _0x2dc948=fs[_0x6aa7('0x1b')](_0x10e833);_0x2dc948['on'](_0x6aa7('0x1c'),function(){logger[_0x6aa7('0x1d')]('finish\x20download\x20file');_0x2dc948[_0x6aa7('0x1e')](_0x6e24cb);});_0x2dc948['on'](_0x6aa7('0x16'),function(_0x5cf595){fs[_0x6aa7('0x1f')](_0x10e833);logger['error'](_0x6aa7('0x20'),_0x5cf595);_0x1a1033(_0x5cf595);});_0x3d7f63[_0x6aa7('0x21')](_0x2dc948);})['on']('error',function(_0x5d4e66){logger[_0x6aa7('0x16')](_0x5d4e66);_0x1a1033(_0x5d4e66);})[_0x6aa7('0x22')]();});}function uploadFile(_0x60988f){return new BPromise(function(_0x4db2f7,_0x16d541){var _0x402bfe=urlParse(_0x60988f);var _0x2259f3=_0x402bfe['protocol']===_0x6aa7('0x11')?https:http;var _0x350594={'host':_0x402bfe['host'],'path':_0x402bfe[_0x6aa7('0x13')],'headers':{'user-agent':_0x6aa7('0x14')}};_0x2259f3['get'](_0x350594,function(_0x3c24ec){if(_0x3c24ec[_0x6aa7('0x17')]!==0xc8){_0x16d541(new Error('request\x20to\x20'+_0x60988f+_0x6aa7('0x1a')+_0x3c24ec[_0x6aa7('0x17')]+'\x20('+_0x3c24ec[_0x6aa7('0x18')]+')'));return;}var _0x16e405='';_0x3c24ec['on']('data',function(_0x18a049){_0x16e405+=_0x18a049;});_0x3c24ec['on'](_0x6aa7('0x22'),function(){_0x4db2f7(_0x16e405);});})['on'](_0x6aa7('0x16'),function(_0x546756){_0x16d541(_0x546756);})[_0x6aa7('0x22')]();});}function convertFile(_0x3949bd,_0x4752b7){return new BPromise(function(_0x2044b5,_0x4230d7){var _0x56d312=sox[_0x6aa7('0x23')](_0x3949bd,_0x4752b7,{'sampleRate':0x1f40,'format':_0x6aa7('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56d312['on'](_0x6aa7('0x16'),function(_0x3e95e8){logger[_0x6aa7('0x16')]('error\x20convert',_0x3e95e8);_0x4230d7(_0x3e95e8);});_0x56d312['on'](_0x6aa7('0x22'),function(){logger[_0x6aa7('0x1d')](_0x6aa7('0x25'));_0x2044b5();});_0x56d312[_0x6aa7('0x26')]();});}function base64Decode(_0x3bea38,_0x26938a){var _0x4cf710=path[_0x6aa7('0x27')](__dirname,_0x6aa7('0x28'),rs[_0x6aa7('0x29')](0x4)+'.wav');fs[_0x6aa7('0x2a')](_0x4cf710,_0x3bea38,_0x6aa7('0x2b'));return convertFile(_0x4cf710,_0x26938a)[_0x6aa7('0x2c')](function(){try{fs['unlink'](_0x4cf710);fs[_0x6aa7('0x2d')](_0x26938a,'777');}catch(_0x48a13a){logger[_0x6aa7('0x16')](_0x48a13a);}return _0x26938a[_0x6aa7('0x2e')]('.')[0x0];});}function base64Encode(_0x45eb6a){var _0x1adbae=fs['readFileSync'](_0x45eb6a);return new Buffer(_0x1adbae)['toString']('base64');}exports['googleCloudTTS']=function(_0x2968e5,_0x510c42,_0x30fe4d,_0x5aebfc,_0x15107b,_0x4c4108){var _0x5ad396,_0x31f978;var _0x4f7027='https://texttospeech.googleapis.com/v1/';var _0x41d705=_0x6aa7('0x2f')+_0x2968e5;var _0x3e07a1={};if(_0x510c42===_0x6aa7('0x30')){_0x3e07a1[_0x6aa7('0x31')]={'ssml':_0x30fe4d};}else{_0x3e07a1[_0x6aa7('0x31')]={'text':_0x30fe4d};};_0x3e07a1[_0x6aa7('0x32')]={'languageCode':_0x5aebfc,'ssmlGender':_0x15107b};_0x3e07a1['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x610727={'url':_0x4f7027+'text:synthesize'+_0x41d705,'method':_0x6aa7('0x33'),'json':!![],'body':_0x3e07a1};return rp(_0x610727)['then'](function(_0x5870b6){return new BPromise(function(_0x1bd847,_0x1215a8){_0x5ad396=path['resolve'](__dirname,_0x6aa7('0x28'),rs['generate'](0x4)+_0x6aa7('0x34'));var _0x92b793=Buffer[_0x6aa7('0x35')](_0x5870b6[_0x6aa7('0x36')],_0x6aa7('0x2b'));return fs[_0x6aa7('0x37')](_0x5ad396,_0x92b793,function(_0x1910d6){_0x1215a8(_0x1910d6);},function(_0x576618){fs[_0x6aa7('0x2d')](_0x5ad396,_0x6aa7('0x38'));_0x1bd847(_0x576618);});});})[_0x6aa7('0x2c')](function(_0x102e86){_0x31f978=path[_0x6aa7('0x27')](__dirname,_0x6aa7('0x28'),rs[_0x6aa7('0x29')](0x4)+_0x6aa7('0x39'));return convertFile(_0x5ad396,_0x31f978);})[_0x6aa7('0x2c')](function(){try{fs[_0x6aa7('0x1f')](_0x5ad396);fs[_0x6aa7('0x2d')](_0x31f978,_0x6aa7('0x38'));}catch(_0x4a0cc4){logger[_0x6aa7('0x16')](_0x4a0cc4);}logger[_0x6aa7('0x1d')](_0x6aa7('0x3a'),_0x31f978[_0x6aa7('0x2e')]('.')[0x0]);return _0x31f978['split']('.')[0x0];});};exports[_0x6aa7('0x3b')]=function(_0x95d057,_0x2fc9fb){var _0x241f59=_0x6aa7('0x3c');var _0x1fa462,_0x5d3738;var _0x20de45;var _0x234091={'encoding':_0x6aa7('0x3d'),'method':_0x6aa7('0x33'),'timeout':0x2710,'url':_0x241f59,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6aa7('0x3e')+encodeURIComponent(JSON[_0x6aa7('0x3f')]([[[_0x6aa7('0x40'),JSON['stringify']([_0x95d057,_0x2fc9fb||'en',![],'null']),null,_0x6aa7('0x41')]]]))};return rp(_0x234091)[_0x6aa7('0x2c')](function(_0x3494f0){try{_0x20de45=eval(_0x3494f0[_0x6aa7('0x42')](0x5))[0x0][0x2];}catch(_0x3aac63){throw new Error(_0x6aa7('0x43')+_0x3494f0[_0x6aa7('0x44')]);}if(!_0x20de45){if(_0x95d057[_0x6aa7('0x45')]>0xc8){throw new Error(_0x6aa7('0x46'));}else{throw new Error(_0x6aa7('0x47')+_0x2fc9fb+'\x22\x20might\x20not\x20exist');}}try{_0x20de45=eval(_0x20de45)[0x0];}catch(_0x2ed456){throw new Error(_0x6aa7('0x43')+res[_0x6aa7('0x44')]);}const _0x950b8b=_0x20de45;_0x1fa462=path[_0x6aa7('0x27')](__dirname,'tmp',rs[_0x6aa7('0x29')](0x4)+_0x6aa7('0x34'));fs[_0x6aa7('0x2a')](_0x1fa462,_0x20de45,{'encoding':_0x6aa7('0x2b')});_0x5d3738=path[_0x6aa7('0x27')](__dirname,_0x6aa7('0x28'),rs[_0x6aa7('0x29')](0x4)+_0x6aa7('0x39'));return convertFile(_0x1fa462,_0x5d3738);})['then'](function(){try{fs[_0x6aa7('0x1f')](_0x1fa462);fs[_0x6aa7('0x2d')](_0x5d3738,_0x6aa7('0x38'));}catch(_0x119bda){logger[_0x6aa7('0x16')](_0x119bda);}logger['info'](_0x6aa7('0x48'),_0x5d3738['split']('.')[0x0]);return _0x5d3738['split']('.')[0x0];});};exports[_0x6aa7('0x49')]=function(_0x32479c,_0x473fc4,_0x16210b){return google[_0x6aa7('0x4a')](_0x32479c,_0x473fc4,_0x16210b)[_0x6aa7('0x2c')](function(_0x463c65){logger[_0x6aa7('0x1d')](_0x463c65[_0x6aa7('0x4b')]);return rp(_0x463c65);})[_0x6aa7('0x2c')](function(_0x3cfd74){var _0x1ec33a='';var _0x330e9b=0x0;try{fs[_0x6aa7('0x1f')](_0x32479c);}catch(_0x189f87){logger['error'](_0x189f87);}if(_0x3cfd74&&_0x3cfd74[_0x6aa7('0x4c')]){_0x1ec33a=_0x3cfd74[_0x6aa7('0x4c')][_0x6aa7('0x4d')](function(_0x568e15){return _0x568e15&&_0x568e15[_0x6aa7('0x4e')][0x0]&&_0x568e15[_0x6aa7('0x4e')][0x0][_0x6aa7('0x4f')]?_0x568e15[_0x6aa7('0x4e')][0x0][_0x6aa7('0x4f')]:'';})[_0x6aa7('0x50')]('\x0a');_0x330e9b=_0x3cfd74[_0x6aa7('0x4c')][_0x6aa7('0x4d')](function(_0x200a80){return _0x200a80&&_0x200a80[_0x6aa7('0x4e')][0x0]&&_0x200a80[_0x6aa7('0x4e')][0x0][_0x6aa7('0x51')]?_0x200a80[_0x6aa7('0x4e')][0x0][_0x6aa7('0x51')]:0x0;})[_0x6aa7('0x50')]('\x0a');}logger[_0x6aa7('0x1d')](_0x6aa7('0x52'),_0x1ec33a);logger['info'](_0x6aa7('0x53'),_0x330e9b);return{'transcript':_0x1ec33a,'confidence':_0x330e9b};})['catch'](function(_0x2beadf){logger[_0x6aa7('0x16')](_0x6aa7('0x54'),_0x2beadf[_0x6aa7('0x17')],_0x2beadf[_0x6aa7('0x55')],_0x2beadf[_0x6aa7('0x56')]);});};exports['googleDialogflow']=function(_0x5bdf23,_0x24501e,_0x342e3f,_0x4f0829){var _0x21b416=apiai(_0x24501e,{'language':_0x4f0829||'en'});return _0x21b416['textRequest'](_0x342e3f,{'sessionId':md5(_0x5bdf23)})[_0x6aa7('0x2c')](function(_0x56e935){logger[_0x6aa7('0x1d')](JSON[_0x6aa7('0x3f')](_0x56e935));return{'source':_0x56e935['result'][_0x6aa7('0x57')],'resolvedQuery':_0x56e935[_0x6aa7('0x58')][_0x6aa7('0x59')],'action':_0x56e935[_0x6aa7('0x58')]['action'],'actionIncomplete':_0x56e935['result'][_0x6aa7('0x5a')],'speech':_0x56e935['result'][_0x6aa7('0x5b')]['speech'],'score':_0x56e935[_0x6aa7('0x58')][_0x6aa7('0x5c')],'statusCode':_0x56e935[_0x6aa7('0x5d')][_0x6aa7('0x5e')],'endConversation':_0x56e935[_0x6aa7('0x58')]['metadata'][_0x6aa7('0x5f')]||![],'isFallbackIntent':_0x56e935['result'][_0x6aa7('0x60')]['isFallbackIntent']};});};exports[_0x6aa7('0x61')]=function(_0x3a86d3,_0x2d3d12,_0x16c440,_0x56bdc5,_0x3bd831,_0x2aadfb){var _0x24b48a=_0x56bdc5[_0x6aa7('0x62')](/\\n/g,'\x0a');var _0x4780dd={'credentials':{'private_key':_0x24b48a,'client_email':_0x16c440}};var _0x58fd16=new dialogflow[(_0x6aa7('0x63'))](_0x4780dd);var _0x27c4ef=_0x58fd16['sessionPath'](_0x2d3d12,md5(_0x3a86d3));var _0x5ce772={'session':_0x27c4ef,'queryInput':{'text':{'text':_0x3bd831,'languageCode':_0x2aadfb}}};return _0x58fd16['detectIntent'](_0x5ce772)[_0x6aa7('0x2c')](function(_0x2da287){if(_0x2da287&&_0x2da287[_0x6aa7('0x45')]){logger[_0x6aa7('0x1d')](_0x6aa7('0x64'),JSON[_0x6aa7('0x3f')](_0x2da287));var _0x36ee30=_0x2da287[0x0];if(_0x36ee30){var _0x6dc559={'action':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x66')],'allRequiredParamsPresent':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x67')],'endConversation':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x68')]&&_0x36ee30[_0x6aa7('0x65')]['diagnosticInfo'][_0x6aa7('0x69')]?_0x36ee30['queryResult']['diagnosticInfo'][_0x6aa7('0x69')][_0x6aa7('0x6a')][_0x6aa7('0x6b')]:![],'fulfillmentText':_0x36ee30[_0x6aa7('0x65')]['fulfillmentText'],'intentName':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x6c')][_0x6aa7('0x55')],'intentDisplayName':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x6c')][_0x6aa7('0x6d')],'isFallbackIntent':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x6c')][_0x6aa7('0x6e')],'languageCode':_0x36ee30['queryResult']['languageCode'],'queryText':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x6f')],'responseId':_0x36ee30[_0x6aa7('0x70')],'score':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x71')],'speech':_0x36ee30[_0x6aa7('0x65')][_0x6aa7('0x72')],'providerResponse':JSON[_0x6aa7('0x3f')](_0x2da287)};return _0x6dc559;}}});};exports['tildeASR']=function(_0x440e3f,_0x5155c5,_0x2075b5,_0x54ff87){return tilde[_0x6aa7('0x4a')](_0x440e3f,_0x5155c5,_0x2075b5,_0x54ff87)['then'](function(_0x422f9d){try{fs[_0x6aa7('0x1f')](_0x440e3f);}catch(_0xdc1fbb){logger[_0x6aa7('0x16')](_0xdc1fbb);}logger[_0x6aa7('0x1d')](_0x6aa7('0x73'),_0x422f9d[_0x6aa7('0x4f')]);logger['info'](_0x6aa7('0x74'),_0x422f9d[_0x6aa7('0x51')]);return _0x422f9d;});};exports['awsPolly']=function(_0x358071,_0x59fe35,_0x5c24fb,_0x40cf8d,_0x32b8f8,_0xe86446){var _0x2929d3=path['resolve'](__dirname,_0x6aa7('0x28'),rs[_0x6aa7('0x29')](0x4)+'.mp3');var _0x2d027d;return aws[_0x6aa7('0x75')](_0x358071,_0x59fe35,_0x5c24fb,_0x40cf8d,_0x32b8f8,_0xe86446,_0x2929d3)[_0x6aa7('0x2c')](function(){_0x2d027d=path[_0x6aa7('0x27')](__dirname,_0x6aa7('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x2929d3,_0x2d027d);})[_0x6aa7('0x2c')](function(){try{fs[_0x6aa7('0x1f')](_0x2929d3);fs[_0x6aa7('0x2d')](_0x2d027d,_0x6aa7('0x38'));}catch(_0x4bcae7){logger[_0x6aa7('0x16')](_0x4bcae7);}return _0x2d027d[_0x6aa7('0x2e')]('.')[0x0];});};exports[_0x6aa7('0x76')]=function(_0x65e79c,_0x399752,_0x39a4c5,_0x568048,_0x3fbcc2,_0xebc307){return aws[_0x6aa7('0x77')](_0x65e79c,_0x399752,_0x39a4c5,_0x568048,_0x3fbcc2,_0xebc307)[_0x6aa7('0x2c')](function(_0x584bce){logger[_0x6aa7('0x1d')](JSON[_0x6aa7('0x3f')](_0x584bce));return _0x584bce;});};exports['ispeechTTS']=function(_0x5d247e,_0x5b3f7d,_0x4b8291,_0x49ca87){var _0x1d18fb=util[_0x6aa7('0x78')](_0x6aa7('0x79'),ISPEECH_API,_0x5d247e,encodeURIComponent(_0x5b3f7d),_0x4b8291,_0x49ca87);var _0x52eed2=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x6aa7('0x34'));var _0x4d868b;return downloadFile(_0x1d18fb,_0x52eed2)[_0x6aa7('0x2c')](function(){_0x4d868b=path[_0x6aa7('0x27')](__dirname,_0x6aa7('0x28'),rs[_0x6aa7('0x29')](0x4)+'.wav');return convertFile(_0x52eed2,_0x4d868b);})[_0x6aa7('0x2c')](function(){try{fs['unlink'](_0x52eed2);fs[_0x6aa7('0x2d')](_0x4d868b,'777');}catch(_0x101098){logger['error'](_0x101098);}return _0x4d868b[_0x6aa7('0x2e')]('.')[0x0];});};exports['ispeechASR']=function(_0x37021b,_0x758ad1,_0x2b7ef3,_0x3647a9){var _0x463773=util[_0x6aa7('0x78')](_0x6aa7('0x7a'),ISPEECH_API,_0x758ad1,_0x2b7ef3,base64Encode(_0x37021b),_0x3647a9?util[_0x6aa7('0x78')](_0x6aa7('0x7b'),encodeURIComponent(_0x3647a9)):_0x6aa7('0x7c'));return uploadFile(_0x463773)['then'](function(_0x41a367){return querystring[_0x6aa7('0x7d')](_0x41a367);});};exports[_0x6aa7('0x7e')]=function(_0x2e68be,_0x1776b8){return sestek['nda'](_0x2e68be,_0x1776b8)[_0x6aa7('0x2c')](function(_0x35cab9){logger['info'](JSON[_0x6aa7('0x3f')](_0x35cab9));var _0x5d9b1f={'speech':_0x35cab9['text'],'action':_0x35cab9[_0x6aa7('0x7f')]?_0x35cab9[_0x6aa7('0x7f')][_0x6aa7('0x80')]:undefined,'actiondata':_0x35cab9[_0x6aa7('0x7f')]?_0x35cab9[_0x6aa7('0x7f')]['CustomActionData']:undefined};if(_0x35cab9[_0x6aa7('0x7f')]&&_0x35cab9[_0x6aa7('0x7f')][_0x6aa7('0x81')]){return base64Decode(_0x35cab9[_0x6aa7('0x7f')][_0x6aa7('0x81')][_0x6aa7('0x82')],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x6aa7('0x39')))['then'](function(_0x5ca3d4){_0x5d9b1f['audiofile']=_0x5ca3d4;return _0x5d9b1f;});}return _0x5d9b1f;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x585d=['isFallbackIntent','googleDialogflowV2','replace','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','wav','error\x20convert','resolve','tmp','generate','.wav','base64','then','chmodSync','777','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','score','code','metadata'];(function(_0x5d2df1,_0x3e9282){var _0x349ae3=function(_0x4ca58e){while(--_0x4ca58e){_0x5d2df1['push'](_0x5d2df1['shift']());}};_0x349ae3(++_0x3e9282);}(_0x585d,0x138));var _0xd585=function(_0x271ebd,_0x1c24ac){_0x271ebd=_0x271ebd-0x0;var _0x313e1d=_0x585d[_0x271ebd];return _0x313e1d;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd585('0x0'));var dialogflow=require(_0xd585('0x1'));var fs=require('fs');var http=require(_0xd585('0x2'));var https=require(_0xd585('0x3'));var md5=require(_0xd585('0x4'));var path=require(_0xd585('0x5'));var querystring=require(_0xd585('0x6'));var rp=require(_0xd585('0x7'));var rs=require(_0xd585('0x8'));var sox=require(_0xd585('0x9'));var tts=require(_0xd585('0xa'));var urlParse=require('url')[_0xd585('0xb')];var util=require(_0xd585('0xc'));var aws=require(_0xd585('0xd'));var google=require(_0xd585('0xe'));var sestek=require(_0xd585('0xf'));var tilde=require(_0xd585('0x10'));var logger=require(_0xd585('0x11'))(_0xd585('0x12'));var ISPEECH_API=_0xd585('0x13');function downloadFile(_0x24c670,_0x41e8d0){return new BPromise(function(_0x27a760,_0x1d5e91){var _0x535935=urlParse(_0x24c670);var _0x2696f9=_0x535935[_0xd585('0x14')]===_0xd585('0x15')?https:http;var _0x5b824f={'host':_0x535935[_0xd585('0x16')],'path':_0x535935['path'],'headers':{'user-agent':_0xd585('0x17')}};_0x2696f9[_0xd585('0x18')](_0x5b824f,function(_0x180394){if(_0x180394[_0xd585('0x19')]!==0xc8){logger[_0xd585('0x1a')](_0xd585('0x1b')+_0x24c670+_0xd585('0x1c')+_0x180394[_0xd585('0x19')]+'\x20('+_0x180394[_0xd585('0x1d')]+')');_0x1d5e91(new Error('request\x20to\x20'+_0x24c670+'\x20failed,\x20status\x20code\x20=\x20'+_0x180394[_0xd585('0x19')]+'\x20('+_0x180394[_0xd585('0x1d')]+')'));return;}var _0x264765=fs[_0xd585('0x1e')](_0x41e8d0);_0x264765['on'](_0xd585('0x1f'),function(){logger[_0xd585('0x20')](_0xd585('0x21'));_0x264765[_0xd585('0x22')](_0x27a760);});_0x264765['on'](_0xd585('0x1a'),function(_0x519b7a){fs[_0xd585('0x23')](_0x41e8d0);logger[_0xd585('0x1a')](_0xd585('0x24'),_0x519b7a);_0x1d5e91(_0x519b7a);});_0x180394[_0xd585('0x25')](_0x264765);})['on'](_0xd585('0x1a'),function(_0x3c7708){logger[_0xd585('0x1a')](_0x3c7708);_0x1d5e91(_0x3c7708);})[_0xd585('0x26')]();});}function uploadFile(_0x10daaa){return new BPromise(function(_0x2c73b1,_0x3eeb11){var _0xc32a11=urlParse(_0x10daaa);var _0x209fcf=_0xc32a11[_0xd585('0x14')]===_0xd585('0x15')?https:http;var _0x1bceeb={'host':_0xc32a11[_0xd585('0x16')],'path':_0xc32a11[_0xd585('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x209fcf['get'](_0x1bceeb,function(_0x18ea7d){if(_0x18ea7d[_0xd585('0x19')]!==0xc8){_0x3eeb11(new Error(_0xd585('0x1b')+_0x10daaa+'\x20failed,\x20status\x20code\x20=\x20'+_0x18ea7d[_0xd585('0x19')]+'\x20('+_0x18ea7d[_0xd585('0x1d')]+')'));return;}var _0x6aa165='';_0x18ea7d['on'](_0xd585('0x27'),function(_0x588edf){_0x6aa165+=_0x588edf;});_0x18ea7d['on'](_0xd585('0x26'),function(){_0x2c73b1(_0x6aa165);});})['on'](_0xd585('0x1a'),function(_0x502877){_0x3eeb11(_0x502877);})[_0xd585('0x26')]();});}function convertFile(_0x545adf,_0x5e49f6){return new BPromise(function(_0x1eee99,_0x2a3c22){var _0x1b36ca=sox['transcode'](_0x545adf,_0x5e49f6,{'sampleRate':0x1f40,'format':_0xd585('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b36ca['on']('error',function(_0x566ed2){logger[_0xd585('0x1a')](_0xd585('0x29'),_0x566ed2);_0x2a3c22(_0x566ed2);});_0x1b36ca['on']('end',function(){logger[_0xd585('0x20')]('finish\x20to\x20convert');_0x1eee99();});_0x1b36ca['start']();});}function base64Decode(_0x4b8de0,_0x443502){var _0x4a1ca9=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));fs['writeFileSync'](_0x4a1ca9,_0x4b8de0,_0xd585('0x2e'));return convertFile(_0x4a1ca9,_0x443502)[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x4a1ca9);fs[_0xd585('0x30')](_0x443502,_0xd585('0x31'));}catch(_0x4623fb){logger[_0xd585('0x1a')](_0x4623fb);}return _0x443502['split']('.')[0x0];});}function base64Encode(_0x3425f4){var _0x39a5aa=fs['readFileSync'](_0x3425f4);return new Buffer(_0x39a5aa)[_0xd585('0x32')]('base64');}exports[_0xd585('0x33')]=function(_0x1dd30e,_0x3f3f4e,_0x441708,_0xb53abd,_0x3a606a,_0x378208){var _0xdab588,_0x3f578d;var _0x3c2f6c=_0xd585('0x34');var _0x335029=_0xd585('0x35')+_0x1dd30e;var _0x33b318={};if(_0x3f3f4e===_0xd585('0x36')){_0x33b318[_0xd585('0x37')]={'ssml':_0x441708};}else{_0x33b318[_0xd585('0x37')]={'text':_0x441708};};_0x33b318[_0xd585('0x38')]={'languageCode':_0xb53abd,'ssmlGender':_0x3a606a};_0x33b318[_0xd585('0x39')]={'audioEncoding':_0xd585('0x3a'),'sampleRateHertz':0x1f40};var _0x462420={'url':_0x3c2f6c+'text:synthesize'+_0x335029,'method':_0xd585('0x3b'),'json':!![],'body':_0x33b318};return rp(_0x462420)[_0xd585('0x2f')](function(_0x17235f){return new BPromise(function(_0x40b19c,_0x2e05c9){_0xdab588=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs['generate'](0x4)+_0xd585('0x3c'));var _0x5e220b=Buffer[_0xd585('0x3d')](_0x17235f[_0xd585('0x3e')],_0xd585('0x2e'));return fs[_0xd585('0x3f')](_0xdab588,_0x5e220b,function(_0x186642){_0x2e05c9(_0x186642);},function(_0x5ecc24){fs[_0xd585('0x30')](_0xdab588,_0xd585('0x31'));_0x40b19c(_0x5ecc24);});});})[_0xd585('0x2f')](function(_0x5179c0){_0x3f578d=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0xdab588,_0x3f578d);})['then'](function(){try{fs[_0xd585('0x23')](_0xdab588);fs[_0xd585('0x30')](_0x3f578d,_0xd585('0x31'));}catch(_0x1b0e05){logger[_0xd585('0x1a')](_0x1b0e05);}logger[_0xd585('0x20')](_0xd585('0x40'),_0x3f578d[_0xd585('0x41')]('.')[0x0]);return _0x3f578d['split']('.')[0x0];});};exports[_0xd585('0x42')]=function(_0x4011fa,_0x4c9b59){var _0x28ebb4=_0xd585('0x43');var _0x1f77fc,_0xfa9d68;var _0x5161fc;var _0x509d2e={'encoding':_0xd585('0x44'),'method':_0xd585('0x3b'),'timeout':0x2710,'url':_0x28ebb4,'headers':{'Content-Type':_0xd585('0x45')},'body':_0xd585('0x46')+encodeURIComponent(JSON[_0xd585('0x47')]([[[_0xd585('0x48'),JSON[_0xd585('0x47')]([_0x4011fa,_0x4c9b59||'en',![],_0xd585('0x49')]),null,'generic']]]))};return rp(_0x509d2e)[_0xd585('0x2f')](function(_0x214e2b){try{_0x5161fc=eval(_0x214e2b[_0xd585('0x4a')](0x5))[0x0][0x2];}catch(_0x5ae52f){throw new Error('parse\x20response\x20failed:\x0a'+_0x214e2b[_0xd585('0x27')]);}if(!_0x5161fc){if(_0x4011fa['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x4c9b59+_0xd585('0x4b'));}}try{_0x5161fc=eval(_0x5161fc)[0x0];}catch(_0x3f43a1){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xd585('0x27')]);}const _0x3260d3=_0x5161fc;_0x1f77fc=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));fs['writeFileSync'](_0x1f77fc,_0x5161fc,{'encoding':_0xd585('0x2e')});_0xfa9d68=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0x1f77fc,_0xfa9d68);})[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x1f77fc);fs['chmodSync'](_0xfa9d68,_0xd585('0x31'));}catch(_0x41d473){logger['error'](_0x41d473);}logger[_0xd585('0x20')](_0xd585('0x4c'),_0xfa9d68[_0xd585('0x41')]('.')[0x0]);return _0xfa9d68['split']('.')[0x0];});};exports[_0xd585('0x4d')]=function(_0x5e262b,_0x23e47d,_0x18ff55){return google[_0xd585('0x4e')](_0x5e262b,_0x23e47d,_0x18ff55)[_0xd585('0x2f')](function(_0x1b972a){logger[_0xd585('0x20')](_0x1b972a['uri']);return rp(_0x1b972a);})[_0xd585('0x2f')](function(_0x496135){var _0x3085d1='';var _0x1ce46b=0x0;try{fs[_0xd585('0x23')](_0x5e262b);}catch(_0x40497f){logger['error'](_0x40497f);}if(_0x496135&&_0x496135[_0xd585('0x4f')]){_0x3085d1=_0x496135[_0xd585('0x4f')]['map'](function(_0x3c1519){return _0x3c1519&&_0x3c1519[_0xd585('0x50')][0x0]&&_0x3c1519['alternatives'][0x0][_0xd585('0x51')]?_0x3c1519[_0xd585('0x50')][0x0][_0xd585('0x51')]:'';})[_0xd585('0x52')]('\x0a');_0x1ce46b=_0x496135[_0xd585('0x4f')][_0xd585('0x53')](function(_0x3ae23a){return _0x3ae23a&&_0x3ae23a[_0xd585('0x50')][0x0]&&_0x3ae23a['alternatives'][0x0]['confidence']?_0x3ae23a[_0xd585('0x50')][0x0][_0xd585('0x54')]:0x0;})[_0xd585('0x52')]('\x0a');}logger['info'](_0xd585('0x55'),_0x3085d1);logger['info'](_0xd585('0x56'),_0x1ce46b);return{'transcript':_0x3085d1,'confidence':_0x1ce46b};})['catch'](function(_0x14f83b){logger[_0xd585('0x1a')]('[%s]\x20%s:%s',_0x14f83b['statusCode'],_0x14f83b['name'],_0x14f83b[_0xd585('0x57')]);});};exports[_0xd585('0x58')]=function(_0x52f360,_0x1ea78e,_0x3202a0,_0x269e14){var _0x719b9e=apiai(_0x1ea78e,{'language':_0x269e14||'en'});return _0x719b9e[_0xd585('0x59')](_0x3202a0,{'sessionId':md5(_0x52f360)})[_0xd585('0x2f')](function(_0x45a912){logger[_0xd585('0x20')](JSON[_0xd585('0x47')](_0x45a912));return{'source':_0x45a912[_0xd585('0x5a')][_0xd585('0x5b')],'resolvedQuery':_0x45a912['result'][_0xd585('0x5c')],'action':_0x45a912[_0xd585('0x5a')][_0xd585('0x5d')],'actionIncomplete':_0x45a912[_0xd585('0x5a')][_0xd585('0x5e')],'speech':_0x45a912['result']['fulfillment'][_0xd585('0x5f')],'score':_0x45a912[_0xd585('0x5a')][_0xd585('0x60')],'statusCode':_0x45a912['status'][_0xd585('0x61')],'endConversation':_0x45a912[_0xd585('0x5a')][_0xd585('0x62')]['endConversation']||![],'isFallbackIntent':_0x45a912[_0xd585('0x5a')]['metadata'][_0xd585('0x63')]};});};exports[_0xd585('0x64')]=function(_0x3a7fe2,_0x3ad33b,_0x398f79,_0x123376,_0x20f596,_0x11facb){var _0x499723=_0x123376[_0xd585('0x65')](/\\n/g,'\x0a');var _0x4fee2c={'credentials':{'private_key':_0x499723,'client_email':_0x398f79}};var _0x32adf7=new dialogflow['SessionsClient'](_0x4fee2c);var _0xa44998=_0x32adf7[_0xd585('0x66')](_0x3ad33b,md5(_0x3a7fe2));var _0x4926ad={'session':_0xa44998,'queryInput':{'text':{'text':_0x20f596,'languageCode':_0x11facb}}};return _0x32adf7['detectIntent'](_0x4926ad)['then'](function(_0x276d97){if(_0x276d97&&_0x276d97[_0xd585('0x67')]){logger[_0xd585('0x20')](_0xd585('0x68'),JSON['stringify'](_0x276d97));var _0x37ccc4=_0x276d97[0x0];if(_0x37ccc4){var _0x3f8b6a={'action':_0x37ccc4[_0xd585('0x69')]['action'],'allRequiredParamsPresent':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6a')],'endConversation':_0x37ccc4['queryResult'][_0xd585('0x6b')]&&_0x37ccc4[_0xd585('0x69')]['diagnosticInfo']['fields']?_0x37ccc4[_0xd585('0x69')][_0xd585('0x6b')][_0xd585('0x6c')][_0xd585('0x6d')][_0xd585('0x6e')]:![],'fulfillmentText':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6f')],'intentName':_0x37ccc4[_0xd585('0x69')][_0xd585('0x70')][_0xd585('0x71')],'intentDisplayName':_0x37ccc4[_0xd585('0x69')]['intent'][_0xd585('0x72')],'isFallbackIntent':_0x37ccc4['queryResult'][_0xd585('0x70')]['isFallback'],'languageCode':_0x37ccc4[_0xd585('0x69')][_0xd585('0x73')],'queryText':_0x37ccc4[_0xd585('0x69')][_0xd585('0x74')],'responseId':_0x37ccc4[_0xd585('0x75')],'score':_0x37ccc4['queryResult'][_0xd585('0x76')],'speech':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6f')],'providerResponse':JSON['stringify'](_0x276d97)};return _0x3f8b6a;}}});};exports[_0xd585('0x77')]=function(_0x4b4964,_0x4dff74,_0x45a5d3,_0x88ec12){return tilde[_0xd585('0x4e')](_0x4b4964,_0x4dff74,_0x45a5d3,_0x88ec12)[_0xd585('0x2f')](function(_0x1ca960){try{fs[_0xd585('0x23')](_0x4b4964);}catch(_0x1f242d){logger[_0xd585('0x1a')](_0x1f242d);}logger[_0xd585('0x20')]('Tilde\x20ASR\x20transcription',_0x1ca960['transcript']);logger[_0xd585('0x20')](_0xd585('0x78'),_0x1ca960[_0xd585('0x54')]);return _0x1ca960;});};exports[_0xd585('0x79')]=function(_0x3a5be2,_0x149a87,_0x5efda7,_0x423ef8,_0x44f530,_0x80f0d4){var _0x12a1e7=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));var _0x5a9bac;return aws[_0xd585('0x7a')](_0x3a5be2,_0x149a87,_0x5efda7,_0x423ef8,_0x44f530,_0x80f0d4,_0x12a1e7)[_0xd585('0x2f')](function(){_0x5a9bac=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0x12a1e7,_0x5a9bac);})['then'](function(){try{fs[_0xd585('0x23')](_0x12a1e7);fs['chmodSync'](_0x5a9bac,_0xd585('0x31'));}catch(_0x490b3f){logger['error'](_0x490b3f);}return _0x5a9bac['split']('.')[0x0];});};exports['awsLex']=function(_0x504824,_0x5683e6,_0x4cd0c6,_0x1e8557,_0x335fc8,_0x4335cb){return aws[_0xd585('0x7b')](_0x504824,_0x5683e6,_0x4cd0c6,_0x1e8557,_0x335fc8,_0x4335cb)[_0xd585('0x2f')](function(_0x49c429){logger[_0xd585('0x20')](JSON['stringify'](_0x49c429));return _0x49c429;});};exports['ispeechTTS']=function(_0x22d96d,_0x1eddf1,_0x185aa9,_0x7b0f12){var _0x33798f=util[_0xd585('0x7c')](_0xd585('0x7d'),ISPEECH_API,_0x22d96d,encodeURIComponent(_0x1eddf1),_0x185aa9,_0x7b0f12);var _0x466dae=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));var _0x362614;return downloadFile(_0x33798f,_0x466dae)[_0xd585('0x2f')](function(){_0x362614=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs['generate'](0x4)+_0xd585('0x2d'));return convertFile(_0x466dae,_0x362614);})[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x466dae);fs[_0xd585('0x30')](_0x362614,'777');}catch(_0x3fc0e3){logger['error'](_0x3fc0e3);}return _0x362614[_0xd585('0x41')]('.')[0x0];});};exports['ispeechASR']=function(_0x534e4a,_0x31dc83,_0x3b8374,_0x19e969){var _0x5467d1=util[_0xd585('0x7c')](_0xd585('0x7e'),ISPEECH_API,_0x31dc83,_0x3b8374,base64Encode(_0x534e4a),_0x19e969?util[_0xd585('0x7c')](_0xd585('0x7f'),encodeURIComponent(_0x19e969)):_0xd585('0x80'));return uploadFile(_0x5467d1)[_0xd585('0x2f')](function(_0x373270){return querystring[_0xd585('0xb')](_0x373270);});};exports[_0xd585('0x81')]=function(_0x301d50,_0x63edab){return sestek[_0xd585('0x82')](_0x301d50,_0x63edab)[_0xd585('0x2f')](function(_0x243e25){logger[_0xd585('0x20')](JSON[_0xd585('0x47')](_0x243e25));var _0x1e5f00={'speech':_0x243e25[_0xd585('0x83')],'action':_0x243e25[_0xd585('0x84')]?_0x243e25[_0xd585('0x84')]['CustomAction']:undefined,'actiondata':_0x243e25[_0xd585('0x84')]?_0x243e25[_0xd585('0x84')][_0xd585('0x85')]:undefined};if(_0x243e25[_0xd585('0x84')]&&_0x243e25[_0xd585('0x84')][_0xd585('0x86')]){return base64Decode(_0x243e25['channelData']['AudioFromTts'][_0xd585('0x87')],path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+'.wav'))[_0xd585('0x2f')](function(_0x369a49){_0x1e5f00['audiofile']=_0x369a49;return _0x1e5f00;});}return _0x1e5f00;});};exports[_0xd585('0x88')]=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 aaf1999..ba2aa6c 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 _0x1b28=['exports','./nda'];(function(_0x481590,_0x167746){var _0x447376=function(_0x4b63b8){while(--_0x4b63b8){_0x481590['push'](_0x481590['shift']());}};_0x447376(++_0x167746);}(_0x1b28,0x185));var _0x81b2=function(_0x454d72,_0x4e48aa){_0x454d72=_0x454d72-0x0;var _0x4f7f73=_0x1b28[_0x454d72];return _0x4f7f73;};var nda=require(_0x81b2('0x0'));module[_0x81b2('0x1')]={'nda':nda}; \ No newline at end of file +var _0x3d2a=['exports','./nda'];(function(_0x601aba,_0x10ed80){var _0x125591=function(_0x8f41d){while(--_0x8f41d){_0x601aba['push'](_0x601aba['shift']());}};_0x125591(++_0x10ed80);}(_0x3d2a,0x99));var _0xa3d2=function(_0x1cc6c9,_0x1be68d){_0x1cc6c9=_0x1cc6c9-0x0;var _0x22c4e2=_0x3d2a[_0x1cc6c9];return _0x22c4e2;};var nda=require(_0xa3d2('0x0'));module[_0xa3d2('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 0789d2d..f6830f9 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 _0x2182=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','then'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x2182,0xea));var _0x2218=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2182[_0x3bf83f];return _0x22c4a9;};'use strict';var rp=require(_0x2218('0x0'));var url=require(_0x2218('0x1'));var logger=require(_0x2218('0x2'))(_0x2218('0x3'));module['exports']=function(_0x41395e,_0x591036){var _0x2fdb57={'method':_0x2218('0x4'),'uri':url[_0x2218('0x5')](_0x591036[_0x2218('0x6')],_0x2218('0x7')),'form':{'grant_type':_0x2218('0x8'),'username':_0x591036[_0x2218('0x9')],'password':_0x591036[_0x2218('0x8')]},'json':!![]};return rp(_0x2fdb57)[_0x2218('0xa')](function(_0x29e762){var _0x4b3bd1={'method':_0x2218('0x4'),'uri':url[_0x2218('0x5')](_0x591036[_0x2218('0xb')],_0x2218('0xc')),'body':{'type':_0x591036['ndaactivity_type']||_0x2218('0xd'),'channelId':_0x2218('0xe'),'conversation':{'id':_0x41395e[_0x2218('0xf')]},'from':{'id':_0x41395e[_0x2218('0x10')],'name':_0x41395e['calleridname']},'recipient':{'id':_0x41395e[_0x2218('0x11')],'name':_0x41395e[_0x2218('0x12')]},'text':_0x591036[_0x2218('0x13')],'channelData':{}},'headers':{'Authorization':_0x2218('0x14')+_0x29e762[_0x2218('0x15')]},'json':!![]};if(_0x591036['project']){_0x4b3bd1[_0x2218('0x16')]['channelData'][_0x2218('0x17')]=_0x591036[_0x2218('0x18')];}if(_0x591036[_0x2218('0x19')]=='1'){_0x4b3bd1[_0x2218('0x16')][_0x2218('0x1a')][_0x2218('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2218('0x1c')};}if(_0x591036[_0x2218('0x1d')]){_0x4b3bd1[_0x2218('0x16')][_0x2218('0x1a')][_0x2218('0x1e')]=_0x591036[_0x2218('0x1d')];if(_0x591036[_0x2218('0x1f')]){_0x4b3bd1[_0x2218('0x16')][_0x2218('0x1a')][_0x2218('0x20')]=_0x591036[_0x2218('0x1f')];}}logger[_0x2218('0x21')](JSON[_0x2218('0x22')](_0x4b3bd1));return rp(_0x4b3bd1);});}; \ No newline at end of file +var _0xd5b6=['text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd5b6,0x73));var _0x6d5b=function(_0x4cdf7f,_0x409332){_0x4cdf7f=_0x4cdf7f-0x0;var _0x1bcbeb=_0xd5b6[_0x4cdf7f];return _0x1bcbeb;};'use strict';var rp=require(_0x6d5b('0x0'));var url=require(_0x6d5b('0x1'));var logger=require(_0x6d5b('0x2'))(_0x6d5b('0x3'));module[_0x6d5b('0x4')]=function(_0x3d9bc9,_0x162442){var _0x3fb583={'method':'POST','uri':url[_0x6d5b('0x5')](_0x162442[_0x6d5b('0x6')],_0x6d5b('0x7')),'form':{'grant_type':'password','username':_0x162442[_0x6d5b('0x8')],'password':_0x162442[_0x6d5b('0x9')]},'json':!![]};return rp(_0x3fb583)[_0x6d5b('0xa')](function(_0x3cdc91){var _0x5b57cb={'method':'POST','uri':url[_0x6d5b('0x5')](_0x162442[_0x6d5b('0xb')],_0x6d5b('0xc')),'body':{'type':_0x162442[_0x6d5b('0xd')]||_0x6d5b('0xe'),'channelId':_0x6d5b('0xf'),'conversation':{'id':_0x3d9bc9[_0x6d5b('0x10')]},'from':{'id':_0x3d9bc9[_0x6d5b('0x11')],'name':_0x3d9bc9[_0x6d5b('0x12')]},'recipient':{'id':_0x3d9bc9[_0x6d5b('0x13')],'name':_0x3d9bc9[_0x6d5b('0x14')]},'text':_0x162442[_0x6d5b('0x15')],'channelData':{}},'headers':{'Authorization':_0x6d5b('0x16')+_0x3cdc91[_0x6d5b('0x17')]},'json':!![]};if(_0x162442[_0x6d5b('0x18')]){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')][_0x6d5b('0x1b')]=_0x162442['project'];}if(_0x162442[_0x6d5b('0x1c')]=='1'){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')][_0x6d5b('0x1d')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6d5b('0x1e')};}if(_0x162442['custom_action']){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')]['CustomAction']=_0x162442[_0x6d5b('0x1f')];if(_0x162442['custom_action_data']){_0x5b57cb[_0x6d5b('0x19')]['channelData']['CustomActionData']=_0x162442['custom_action_data'];}}logger[_0x6d5b('0x20')](JSON[_0x6d5b('0x21')](_0x5b57cb));return rp(_0x5b57cb);});}; \ 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 8bd2159..1e76b7c 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x15382b,_0x5c36b7,_0x2dc662,_0x1d9fa1){return asr(_0x15382b,_0x5c36b7,_0x2dc662,_0x1d9fa1);}; \ No newline at end of file +var _0x786e=['exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x786e,0x11a));var _0xe786=function(_0x3a3afe,_0x15da25){_0x3a3afe=_0x3a3afe-0x0;var _0x262dab=_0x786e[_0x3a3afe];return _0x262dab;};'use strict';var asr=require('./lib/api');module[_0xe786('0x0')]=function(_0x1238f5,_0x39a132,_0x510768,_0x5254b5){return asr(_0x1238f5,_0x39a132,_0x510768,_0x5254b5);}; \ 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 bdd554e..47e9f8c 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 _0xdc3e=['hypotheses','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','update','hex','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses'];(function(_0x3c6b18,_0x18fb13){var _0x3a23b1=function(_0x1936f7){while(--_0x1936f7){_0x3c6b18['push'](_0x3c6b18['shift']());}};_0x3a23b1(++_0x18fb13);}(_0xdc3e,0xa9));var _0xedc3=function(_0x2632c5,_0x2cc469){_0x2632c5=_0x2632c5-0x0;var _0x225fdc=_0xdc3e[_0x2632c5];return _0x225fdc;};'use strict';var BPromise=require(_0xedc3('0x0'));var _=require(_0xedc3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xedc3('0x2'));var crypto=require(_0xedc3('0x3'));var logger=require(_0xedc3('0x4'))(_0xedc3('0x5'));module[_0xedc3('0x6')]=function(_0x206c08,_0x528a65,_0x25612a,_0xec8b4e){return new BPromise(function(_0xdd8be0,_0xbd6e35){logger[_0xedc3('0x7')]('Tilde\x20URI',_0xec8b4e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xa0bd22=new WebSocket(_0xec8b4e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3e8b56='';var _0x175964='0';var _0x26f77a='1';var _0x4ba2ea='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4ae783(_0x50482a){var _0x3f57ef=crypto['createHash']('sha1');_0x3f57ef[_0xedc3('0x8')](_0x50482a);return _0x3f57ef['digest'](_0xedc3('0x9'));}function _0x355f13(){try{logger[_0xedc3('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x3a8b73=moment()['unix']();var _0x2a251f=_0x4ae783(_0x3a8b73+_0x528a65+_0x25612a);_0xa0bd22[_0xedc3('0xa')](JSON[_0xedc3('0xb')]({'appID':_0x528a65,'timestamp':_0x3a8b73,'appKey':_0x2a251f}));var _0x530903=fs[_0xedc3('0xc')](_0x206c08);_0x530903['on'](_0xedc3('0xd'),function(_0x3916ea){_0xa0bd22[_0xedc3('0xa')](_0x3916ea);});_0x530903['on'](_0xedc3('0xe'),function(){_0xa0bd22['send'](_0xedc3('0xf'));});}catch(_0x4be2f8){logger[_0xedc3('0x10')](_0xedc3('0x11'),JSON[_0xedc3('0xb')](_0x4be2f8));_0xa0bd22[_0xedc3('0x12')]();}}function _0x2a350e(_0x1f225c){try{if(_0x1f225c){var _0x4a9e29=JSON[_0xedc3('0x13')](_0x1f225c);switch(_0x4a9e29[_0xedc3('0x14')]){case 0x0:if(_0x4a9e29[_0xedc3('0x15')]){if(_0x4a9e29[_0xedc3('0x15')]['final']){logger[_0xedc3('0x7')](_0xedc3('0x16'),JSON['stringify'](_0x4a9e29[_0xedc3('0x15')][_0xedc3('0x17')]));_0x3e8b56=_0x4a9e29['result'][_0xedc3('0x17')][0x0]['transcript'];_0x175964=_0x4a9e29['result'][_0xedc3('0x17')][0x0]['likelihood'];_0x26f77a='0';_0x4ba2ea='Success.';_0xa0bd22[_0xedc3('0x12')]();}}break;case 0x1:logger['info'](_0xedc3('0x18'));_0x26f77a='1';_0x4ba2ea=_0xedc3('0x18');break;case 0x2:logger[_0xedc3('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x26f77a='2';_0x4ba2ea=_0xedc3('0x19');break;case 0x9:logger[_0xedc3('0x7')](_0xedc3('0x1a'));_0x26f77a='9';_0x4ba2ea=_0xedc3('0x1a');break;case 0xa:logger[_0xedc3('0x7')]('Authentication\x20failed.');_0x26f77a='10';_0x4ba2ea='Authentication\x20failed.';break;case 0xb:logger[_0xedc3('0x7')](_0xedc3('0x1b'));_0x26f77a='11';_0x4ba2ea=_0xedc3('0x1b');}}}catch(_0xa86b6a){logger[_0xedc3('0x10')](_0xedc3('0x1c'),JSON[_0xedc3('0xb')](_0xa86b6a));_0xa0bd22[_0xedc3('0x12')]();}}function _0x18b6a3(){logger[_0xedc3('0x7')](_0xedc3('0x1d'));_0xdd8be0({'transcript':_0x3e8b56,'confidence':_0x175964,'status':_0x26f77a,'status_message':_0x4ba2ea});}function _0x5b005d(_0x2afbd2){logger[_0xedc3('0x10')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x2afbd2)){logger['error'](_[_0xedc3('0x1e')](_0x2afbd2)?JSON[_0xedc3('0xb')](_0x2afbd2):_0x2afbd2);}}_0xa0bd22['on']('open',_0x355f13);_0xa0bd22['on'](_0xedc3('0x1f'),_0x2a350e);_0xa0bd22['on']('close',_0x18b6a3);_0xa0bd22['on']('error',_0x5b005d);});}; \ No newline at end of file +var _0x0083=['close','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','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','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','isNil','isObject','open','message'];(function(_0xd637a3,_0x19b904){var _0x180a84=function(_0x2fc05a){while(--_0x2fc05a){_0xd637a3['push'](_0xd637a3['shift']());}};_0x180a84(++_0x19b904);}(_0x0083,0xba));var _0x3008=function(_0x4bf029,_0x3e24f6){_0x4bf029=_0x4bf029-0x0;var _0x359cf3=_0x0083[_0x4bf029];return _0x359cf3;};'use strict';var BPromise=require('bluebird');var _=require(_0x3008('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3008('0x1'));var crypto=require(_0x3008('0x2'));var logger=require('../../../../../../config/logger')(_0x3008('0x3'));module[_0x3008('0x4')]=function(_0xef9353,_0x2e0f18,_0x438eb8,_0x438ded){return new BPromise(function(_0x365f26,_0xc745d2){logger[_0x3008('0x5')](_0x3008('0x6'),_0x438ded||_0x3008('0x7'));var _0x1c643a=new WebSocket(_0x438ded||_0x3008('0x7'),{'perMessageDeflate':![]});var _0x51bddf='';var _0x2b6189='0';var _0x10fac4='1';var _0x208a39=_0x3008('0x8');function _0x37fdb1(_0x3022b7){var _0x146ac7=crypto['createHash'](_0x3008('0x9'));_0x146ac7[_0x3008('0xa')](_0x3022b7);return _0x146ac7[_0x3008('0xb')]('hex');}function _0xf9afb7(){try{logger[_0x3008('0x5')](_0x3008('0xc'));var _0x5e2033=moment()['unix']();var _0x80b538=_0x37fdb1(_0x5e2033+_0x2e0f18+_0x438eb8);_0x1c643a[_0x3008('0xd')](JSON[_0x3008('0xe')]({'appID':_0x2e0f18,'timestamp':_0x5e2033,'appKey':_0x80b538}));var _0x25a0b9=fs[_0x3008('0xf')](_0xef9353);_0x25a0b9['on']('data',function(_0x182194){_0x1c643a['send'](_0x182194);});_0x25a0b9['on']('close',function(){_0x1c643a['send'](_0x3008('0x10'));});}catch(_0x5265b0){logger[_0x3008('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0x3008('0xe')](_0x5265b0));_0x1c643a[_0x3008('0x12')]();}}function _0x25fda8(_0x350463){try{if(_0x350463){var _0x2e3c99=JSON[_0x3008('0x13')](_0x350463);switch(_0x2e3c99[_0x3008('0x14')]){case 0x0:if(_0x2e3c99[_0x3008('0x15')]){if(_0x2e3c99['result'][_0x3008('0x16')]){logger['info'](_0x3008('0x17'),JSON['stringify'](_0x2e3c99['result'][_0x3008('0x18')]));_0x51bddf=_0x2e3c99[_0x3008('0x15')]['hypotheses'][0x0]['transcript'];_0x2b6189=_0x2e3c99[_0x3008('0x15')]['hypotheses'][0x0][_0x3008('0x19')];_0x10fac4='0';_0x208a39=_0x3008('0x1a');_0x1c643a[_0x3008('0x12')]();}}break;case 0x1:logger[_0x3008('0x5')](_0x3008('0x8'));_0x10fac4='1';_0x208a39=_0x3008('0x8');break;case 0x2:logger[_0x3008('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x10fac4='2';_0x208a39=_0x3008('0x1b');break;case 0x9:logger[_0x3008('0x5')](_0x3008('0x1c'));_0x10fac4='9';_0x208a39=_0x3008('0x1c');break;case 0xa:logger[_0x3008('0x5')](_0x3008('0x1d'));_0x10fac4='10';_0x208a39='Authentication\x20failed.';break;case 0xb:logger[_0x3008('0x5')](_0x3008('0x1e'));_0x10fac4='11';_0x208a39=_0x3008('0x1e');}}}catch(_0x30c7ec){logger[_0x3008('0x11')](_0x3008('0x1f'),JSON[_0x3008('0xe')](_0x30c7ec));_0x1c643a['terminate']();}}function _0x1309c4(){logger[_0x3008('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x365f26({'transcript':_0x51bddf,'confidence':_0x2b6189,'status':_0x10fac4,'status_message':_0x208a39});}function _0x26df97(_0x3f66e9){logger[_0x3008('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3008('0x20')](_0x3f66e9)){logger[_0x3008('0x11')](_[_0x3008('0x21')](_0x3f66e9)?JSON['stringify'](_0x3f66e9):_0x3f66e9);}}_0x1c643a['on'](_0x3008('0x22'),_0xf9afb7);_0x1c643a['on'](_0x3008('0x23'),_0x25fda8);_0x1c643a['on'](_0x3008('0x24'),_0x1309c4);_0x1c643a['on'](_0x3008('0x11'),_0x26df97);});}; \ 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 c809249..0e978ad 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 _0x9d87=['./asr'];(function(_0x316915,_0x7e0317){var _0x140d30=function(_0x5c85be){while(--_0x5c85be){_0x316915['push'](_0x316915['shift']());}};_0x140d30(++_0x7e0317);}(_0x9d87,0x125));var _0x79d8=function(_0x422ffa,_0x52dfec){_0x422ffa=_0x422ffa-0x0;var _0x225065=_0x9d87[_0x422ffa];return _0x225065;};var asr=require(_0x79d8('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xf464=['./asr','exports'];(function(_0x22356f,_0x63767e){var _0x567c09=function(_0x3f206d){while(--_0x3f206d){_0x22356f['push'](_0x22356f['shift']());}};_0x567c09(++_0x63767e);}(_0xf464,0xb2));var _0x4f46=function(_0x90ff4,_0x468229){_0x90ff4=_0x90ff4-0x0;var _0x4eb7db=_0xf464[_0x90ff4];return _0x4eb7db;};var asr=require(_0x4f46('0x0'));module[_0x4f46('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c238ef7..c958a1f 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(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 74c4017..58bc4f5 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 _0xa887=['continueAt','gotoif','condition','no\x20condition\x20configured','true','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','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','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','Smtp','user','bcc','subject','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','dsn','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervalById','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','number','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','render','stringify','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clear','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','isEmpty','%s.%s','setVariable','split','replaceAll','extra','toString','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','getAndSetVariable','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','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','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','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','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block'];(function(_0x358b12,_0x5ae5f4){var _0x2fd163=function(_0x4b2fbf){while(--_0x4b2fbf){_0x358b12['push'](_0x358b12['shift']());}};_0x2fd163(++_0x5ae5f4);}(_0xa887,0x89));var _0x7a88=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa887[_0x2cfb58];return _0xd99951;};'use strict';var fs=require('fs');var util=require(_0x7a88('0x0'));var _=require('lodash');var sh=require(_0x7a88('0x1'));var odbc=require(_0x7a88('0x2'))();var rs=require('randomstring');var moment=require(_0x7a88('0x3'));var Mustache=require(_0x7a88('0x4'));var rp=require(_0x7a88('0x5'));var logger=require(_0x7a88('0x6'))(_0x7a88('0x7'));var config=require(_0x7a88('0x8'));var shared=require(_0x7a88('0x9'));var scripts=require(_0x7a88('0xa'));var FILES_PATH=_0x7a88('0xb');var recursiveMapAttributes=['rawHeaders',_0x7a88('0xc')];var verticesWithRetry=[_0x7a88('0xd'),'getdigits',_0x7a88('0xe')];var AGIVertices=function(_0x5110f0,_0x331b03,_0x179388){this[_0x7a88('0xf')]=_0x5110f0;this['rpc']=_0x331b03;this['mailRpc']=_0x179388;};AGIVertices[_0x7a88('0x10')][_0x7a88('0x11')]=function(_0x29793d,_0x3cf197){this[_0x7a88('0x12')][_0x7a88('0x13')](_0x29793d)[_0x7a88('0x14')](function(_0x1e0272){_0x3cf197(null,_0x1e0272?_0x1e0272['name']:![]);})[_0x7a88('0x15')](function(_0x53f6f2){_0x3cf197(_0x53f6f2);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x16')]=function(_0x2034d4,_0xc4a939){this['rpc'][_0x7a88('0x17')](_0x2034d4)['then'](function(_0x15c431){_0xc4a939(null,_0x15c431?_0x15c431['name']:![]);})['catch'](function(_0x59b30a){_0xc4a939(_0x59b30a);});};AGIVertices[_0x7a88('0x10')]['getSquareProject']=function(_0x267e3b,_0x71c7b9){this[_0x7a88('0x12')][_0x7a88('0x18')](_0x267e3b)[_0x7a88('0x14')](function(_0x592e18){_0x71c7b9(null,_0x592e18?_0x592e18[_0x7a88('0x19')]:![]);})['catch'](function(_0x5d6fce){_0x71c7b9(_0x5d6fce);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1a')]=function(_0x232a0e,_0x3d684a){this[_0x7a88('0x12')][_0x7a88('0x1b')](_0x232a0e)[_0x7a88('0x14')](function(_0x9d9d08){_0x3d684a(null,_0x9d9d08?_0x9d9d08[_0x7a88('0x1c')]:![]);})[_0x7a88('0x15')](function(_0x176ca9){_0x3d684a(_0x176ca9);});};AGIVertices[_0x7a88('0x10')]['getUser']=function(_0x505264,_0x41708d){this[_0x7a88('0x12')]['getUserById'](_0x505264)['then'](function(_0x32f6da){_0x41708d(null,_0x32f6da?_0x32f6da[_0x7a88('0x19')]:![]);})[_0x7a88('0x15')](function(_0x26e424){_0x41708d(_0x26e424);});};AGIVertices['prototype'][_0x7a88('0x1d')]=function(_0x3aff3b,_0x3d1801){this[_0x7a88('0x12')]['getTrunkById'](_0x3aff3b)['then'](function(_0x30323){_0x3d1801(null,_0x30323?_0x30323['name']:![]);})[_0x7a88('0x15')](function(_0x4a441d){_0x3d1801(_0x4a441d);});};AGIVertices['prototype'][_0x7a88('0x1e')]=function(_0x1e01dd,_0x157176){var _0xf6e9a4=this;this[_0x7a88('0x12')]['getSoundById'](_0x1e01dd)['then'](function(_0x38ada5){_0x157176(null,_0x38ada5?_0xf6e9a4[_0x7a88('0x1f')](_0x38ada5[_0x7a88('0x20')]):![]);})[_0x7a88('0x15')](function(_0x8c91c6){_0x157176(_0x8c91c6);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x21')]=function(_0x46643c,_0x59b332){this[_0x7a88('0x12')][_0x7a88('0x22')](_0x46643c)[_0x7a88('0x14')](function(_0x354e9f){_0x59b332(null,_0x354e9f?_0x354e9f:![]);})[_0x7a88('0x15')](function(_0x622483){_0x59b332(_0x622483);});};AGIVertices[_0x7a88('0x10')]['sendMailMessage']=function(_0x1b77e3,_0x450fbd,_0x174215){this[_0x7a88('0x23')][_0x7a88('0x24')](_0x1b77e3,_0x450fbd)[_0x7a88('0x14')](function(){_0x174215(null);})[_0x7a88('0x15')](function(_0xf8c259){_0x174215(_0xf8c259);});};AGIVertices['prototype']['getIntervals']=function(_0x2227f1,_0x51b4ae){this[_0x7a88('0x12')][_0x7a88('0x25')](_0x2227f1)[_0x7a88('0x14')](function(_0x402092){if(_0x402092){if(_0x402092['IntervalId']){_0x51b4ae(null,[_0x402092[_0x7a88('0x26')]]);}else{_0x51b4ae(null,_['map'](_0x402092[_0x7a88('0x27')],_0x7a88('0x26')));}}else{_0x51b4ae(null,![]);}})[_0x7a88('0x15')](function(_0x543ee0){_0x51b4ae(_0x543ee0);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1f')]=function(_0x2a6d76){return util['format'](_0x7a88('0x28'),FILES_PATH,_0x2a6d76);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x29')]=function(_0x29d55f,_0x4a3789,_0x2085af){odbc[_0x7a88('0x2a')](_0x29d55f,function(_0xf33043){if(_0xf33043){logger[_0x7a88('0x2b')](_0x7a88('0x2c'),_0xf33043);_0x2085af(_0xf33043);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x4a3789,function(_0x101403,_0x5a72d3){if(_0x101403){logger[_0x7a88('0x2d')](_0x7a88('0x2e'),_0x4a3789);_0x2085af(_0x101403);}else{logger[_0x7a88('0x2d')](_0x7a88('0x2f'),_0x4a3789);odbc[_0x7a88('0x30')](function(_0x28bcf8){if(_0x28bcf8){logger[_0x7a88('0x2b')](_0x7a88('0x31'),_0x28bcf8);}_0x2085af(null,_0x5a72d3);});}});}});};AGIVertices['prototype'][_0x7a88('0x32')]=function(_0x3d068c,_0xeb3c7b){this[_0x7a88('0x12')]['getSmsAccountById'](_0x3d068c)[_0x7a88('0x14')](function(_0x4f19b8){_0xeb3c7b(null,_0x4f19b8?_0x4f19b8:![]);})['catch'](function(_0x5dd8ac){_0xeb3c7b(_0x5dd8ac);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x33')]=function(_0x10d1df,_0x593ecb){this[_0x7a88('0x12')][_0x7a88('0x33')](_0x10d1df)[_0x7a88('0x14')](function(_0x158259){_0x593ecb(null,_0x158259);})[_0x7a88('0x15')](function(_0x22e18f){_0x593ecb(_0x22e18f);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x34')]=function(_0x290a71,_0x2aa42a,_0x30e764){this[_0x7a88('0x12')]['createSquareDetailsReport']({'uniqueid':this[_0x7a88('0xf')][_0x7a88('0x35')],'node':_0x290a71[_0x7a88('0x36')],'application':_0x290a71[_0x7a88('0x37')],'data':_0x2aa42a||null,'project_name':this['channel']['arg_1'],'callerid':this['channel'][_0x7a88('0x38')]})[_0x7a88('0x14')](function(_0x8d00a5){if(_0x30e764){_0x30e764(null,_0x8d00a5);}})[_0x7a88('0x15')](function(_0x5f17bf){if(_0x30e764){_0x30e764(_0x5f17bf);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x2beea5,_0x1f8588,_0x4108c0,_0x2b1014){this[_0x7a88('0x12')][_0x7a88('0x39')]({'uniqueid':this[_0x7a88('0xf')]['uniqueid'],'callerid':this['channel'][_0x7a88('0x38')],'calleridname':this[_0x7a88('0xf')]['calleridname'],'context':this[_0x7a88('0xf')][_0x7a88('0x3a')],'extension':this[_0x7a88('0xf')][_0x7a88('0x3b')],'priority':this[_0x7a88('0xf')][_0x7a88('0x3c')],'accountcode':this['channel'][_0x7a88('0x3d')],'dnid':this[_0x7a88('0xf')][_0x7a88('0x3e')],'projectName':this[_0x7a88('0xf')]['arg_1'],'saveName':_0x1f8588,'filename':_0x2beea5[_0x7a88('0x3f')]||_0x1f8588,'savePath':_0x4108c0})['then'](function(_0x1eb249){_0x2b1014(null,_0x1eb249);})[_0x7a88('0x15')](function(_0x237505){_0x2b1014(_0x237505);});};AGIVertices['prototype']['createSquareMessage']=function(_0x33e32f,_0x24ca0a,_0x4d9bdf,_0x2260ad,_0x318c93){this['rpc'][_0x7a88('0x40')]({'uniqueid':this[_0x7a88('0xf')][_0x7a88('0x35')],'body':_0x33e32f,'direction':_0x24ca0a,'providerName':_0x4d9bdf,'providerResponse':_0x2260ad})[_0x7a88('0x14')](function(_0x2a685b){if(_0x318c93){_0x318c93(null,_0x2a685b);}})['catch'](function(_0x116ff3){if(_0x318c93){_0x318c93(_0x116ff3);}});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x41')]=function(_0x2bb1db,_0x4d99e8){this[_0x7a88('0x12')][_0x7a88('0x41')]({'firstName':_['isEmpty'](_0x2bb1db['name'])||_['isNil'](_0x2bb1db[_0x7a88('0x19')])?'callback_'+Math[_0x7a88('0x42')]():_0x2bb1db[_0x7a88('0x19')],'lastName':_['isEmpty'](_0x2bb1db[_0x7a88('0x43')])||_['isNil'](_0x2bb1db[_0x7a88('0x43')])?null:_0x2bb1db['lastName'],'phone':_0x2bb1db[_0x7a88('0x44')],'ListId':_0x2bb1db[_0x7a88('0x45')],'scheduledat':_0x2bb1db['scheduledAt'],'callbackUniqueid':this[_0x7a88('0xf')][_0x7a88('0x35')],'tags':_0x7a88('0x46'),'description':_0x7a88('0x47')+_0x2bb1db[_0x7a88('0x48')]['toString'](),'priority':_0x2bb1db[_0x7a88('0x49')]})[_0x7a88('0x14')](function(_0x3bb5d6){_0x4d99e8(null,_0x3bb5d6);})['catch'](function(_0x3ec53e){_0x4d99e8(_0x3ec53e);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x4a')]=function(_0x1db58f,_0x4a7b98){this[_0x7a88('0x12')][_0x7a88('0x4b')](_0x1db58f)['then'](function(_0x18838e){_0x4a7b98(null,_0x18838e?_0x18838e[_0x7a88('0x19')]:![]);})['catch'](function(_0x425f5c){_0x4a7b98(_0x425f5c);});};AGIVertices['prototype'][_0x7a88('0x4c')]=function(_0x45bbc8,_0x34291a,_0x24d334){var _0x21c83d={'role':_0x7a88('0x4d')};_0x21c83d[_0x45bbc8]=this['channel']['callerid'];this[_0x7a88('0x12')][_0x7a88('0x4c')](_0x21c83d,_0x34291a,this[_0x7a88('0xf')][_0x7a88('0x35')])['then'](function(_0xd1f171){_0x24d334(null,_[_0x7a88('0x4e')](_0xd1f171)?![]:!![]);})[_0x7a88('0x15')](function(_0x450145){logger[_0x7a88('0x2b')](_0x450145);_0x24d334(null,![]);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x4f')]=function(_0x3932eb,_0x519559){var _0x272ecb={'role':_0x7a88('0x4d')};_0x272ecb[_0x3932eb]=this[_0x7a88('0xf')][_0x7a88('0x38')];this[_0x7a88('0x12')][_0x7a88('0x4f')](_0x272ecb)[_0x7a88('0x14')](function(_0x3a8183){_0x519559(null,_[_0x7a88('0x4e')](_0x3a8183)?![]:!![]);})[_0x7a88('0x15')](function(_0xb65766){logger[_0x7a88('0x2b')](_0xb65766);_0x519559(null,![]);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x50')]=function(_0x190cb7,_0x2b7d03){var _0xf114ae={'role':'agent'};_0xf114ae[_0x190cb7]=this['channel'][_0x7a88('0x38')];this[_0x7a88('0x12')][_0x7a88('0x50')](_0xf114ae)[_0x7a88('0x14')](function(_0x46ce0f){_0x2b7d03(null,_[_0x7a88('0x4e')](_0x46ce0f)?![]:!![]);})[_0x7a88('0x15')](function(_0x211e7c){logger[_0x7a88('0x2b')](_0x211e7c);_0x2b7d03(null,![]);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x51')]=function(_0x5a7566,_0x368802){var _0x17d89c={'role':_0x7a88('0x4d')};_0x17d89c[_0x5a7566]=this[_0x7a88('0xf')]['callerid'];var _0x44e8d4=_0x5a7566!='internal'?util[_0x7a88('0x52')](_0x7a88('0x53'),_0x7a88('0x54'),this[_0x7a88('0xf')][_0x7a88('0x38')]):undefined;this[_0x7a88('0x12')][_0x7a88('0x51')](_0x17d89c,_0x44e8d4)['then'](function(_0x1aec42){_0x368802(null,_[_0x7a88('0x4e')](_0x1aec42)?![]:!![]);})[_0x7a88('0x15')](function(_0x5580a1){logger[_0x7a88('0x2b')](_0x5580a1);_0x368802(null,![]);});};AGIVertices['prototype'][_0x7a88('0x55')]=function(_0x4a5b8f,_0x8f4378){sh[_0x7a88('0x56')](_[_0x7a88('0x57')](_0x4a5b8f),function(_0x171d14,_0x296c37){var _0x2a59b9=_0x296c37['replace'](/(\r\n|\n|\r)/gm,'');_0x8f4378(null,_0x2a59b9);});};AGIVertices['prototype'][_0x7a88('0x58')]=function(_0x16b574,_0x59a4f0){scripts[_0x7a88('0x58')](_0x16b574[_0x7a88('0x59')],_0x16b574['google_cloud_tts_text_type']||_0x7a88('0x5a'),_0x16b574['text'],_0x16b574[_0x7a88('0x5b')]||'en-US',_0x16b574['ssmlGender']||_0x7a88('0x5c'),_0x16b574[_0x7a88('0x5d')]||_0x7a88('0x5e'))[_0x7a88('0x14')](function(_0x243c4f){_0x59a4f0(null,_0x243c4f);})[_0x7a88('0x15')](function(_0x3a16b9){_0x59a4f0(_0x3a16b9);});};AGIVertices['prototype'][_0x7a88('0x5f')]=function(_0x500461,_0x2bd1ea){scripts[_0x7a88('0x5f')](_0x500461[_0x7a88('0x5a')],_0x500461[_0x7a88('0x60')]||'en',0x1)[_0x7a88('0x14')](function(_0x9bbf2a){_0x2bd1ea(null,_0x9bbf2a);})['catch'](function(_0x3bb500){_0x2bd1ea(_0x3bb500);});};AGIVertices['prototype']['restAPI']=function(_0x1744bc,_0x75c153){var _0x5271b4={'uri':_0x1744bc[_0x7a88('0x61')],'method':_0x1744bc[_0x7a88('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1744bc['timeout'])===_0x7a88('0x63')&&parseInt(_0x1744bc[_0x7a88('0x64')])>=0x1?parseInt(_0x1744bc[_0x7a88('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x7a88('0x65')]([_0x7a88('0x66'),_0x7a88('0x67')],_0x5271b4[_0x7a88('0x62')]['toUpperCase']())){try{_0x5271b4[_0x7a88('0x68')]=_0x1744bc[_0x7a88('0xc')]?JSON[_0x7a88('0x69')](_0x1744bc[_0x7a88('0xc')]):{};}catch(_0xea307c){logger[_0x7a88('0x2b')](_0x7a88('0x6a'),_0xea307c);}}try{_0x5271b4[_0x7a88('0x6b')]=_0x1744bc['rawHeaders']?JSON['parse'](_0x1744bc[_0x7a88('0x6c')]):{};}catch(_0x2b38f0){logger[_0x7a88('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2b38f0);}if(_0x1744bc[_0x7a88('0x6d')]){try{var _0x327b36=require(_0x1744bc[_0x7a88('0x6d')])['sync'](this,_0x5271b4);_0x5271b4['uri']=Mustache['render'](_0x1744bc['url'],_0x327b36,{},['$$','$$']);if(_0x5271b4[_0x7a88('0x6b')]){_0x5271b4[_0x7a88('0x6b')]=JSON[_0x7a88('0x69')](Mustache[_0x7a88('0x6e')](JSON[_0x7a88('0x6f')](_0x5271b4[_0x7a88('0x6b')]),_0x327b36,{},['$$','$$']));}if(_0x5271b4['body']){_0x5271b4[_0x7a88('0x68')]=JSON[_0x7a88('0x69')](Mustache[_0x7a88('0x6e')](JSON[_0x7a88('0x6f')](_0x5271b4['body']),_0x327b36,{},['$$','$$']));}}catch(_0x117415){logger[_0x7a88('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x117415);}}rp(_0x5271b4)[_0x7a88('0x14')](function(_0x24f9e0){var _0x4c3b64={'statusCode':_0x24f9e0['statusCode']||0xc8,'statusMessage':_0x24f9e0[_0x7a88('0x70')]||'OK','headers':_0x24f9e0['headers']||{},'body':_0x24f9e0[_0x7a88('0x68')]||{}};_0x75c153(null,_0x4c3b64);})[_0x7a88('0x15')](function(_0x5f36f7){var _0x3ca0ce={'statusCode':_0x5f36f7[_0x7a88('0x71')]||0x1f4,'statusMessage':_0x5f36f7[_0x7a88('0x72')]||_0x7a88('0x73'),'headers':_0x5f36f7[_0x7a88('0x74')][_0x7a88('0x6b')]||{},'body':_0x5f36f7[_0x7a88('0x74')][_0x7a88('0x68')]||{}};_0x75c153(null,_0x3ca0ce);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x75')]=function(_0x5d4b5e,_0xcdb689){scripts['googleDialogflow'](this[_0x7a88('0xf')][_0x7a88('0x35')],_0x5d4b5e[_0x7a88('0x76')],_0x5d4b5e[_0x7a88('0x5a')],_0x5d4b5e[_0x7a88('0x77')]||'en')[_0x7a88('0x14')](function(_0x5209fa){_0xcdb689(null,_0x5209fa);})[_0x7a88('0x15')](function(_0x297e83){_0xcdb689(_0x297e83);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x1028a3,_0x1fbd4b){scripts[_0x7a88('0x78')](this[_0x7a88('0xf')][_0x7a88('0x35')],_0x1028a3['dialogflowV2_project_id'],_0x1028a3[_0x7a88('0x79')],_0x1028a3[_0x7a88('0x7a')],_0x1028a3[_0x7a88('0x5a')],_0x1028a3[_0x7a88('0x7b')]||'en')[_0x7a88('0x14')](function(_0x3ce977){_0x1fbd4b(null,_0x3ce977);})['catch'](function(_0x1711f9){_0x1fbd4b(_0x1711f9);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x7c')]=function(_0x125dbb,_0x16fb8c){scripts[_0x7a88('0x7c')](this[_0x7a88('0xf')],_0x125dbb)[_0x7a88('0x14')](function(_0x55031c){_0x16fb8c(null,_0x55031c);})[_0x7a88('0x15')](function(_0x20348d){_0x16fb8c(_0x20348d);});};AGIVertices['prototype'][_0x7a88('0x7d')]=function(_0x2e8fab,_0x40b13d){scripts[_0x7a88('0x7d')](_0x2e8fab['key'],_0x2e8fab[_0x7a88('0x5a')],_0x2e8fab['ispeech_tts_language']||'en-US',_0x2e8fab[_0x7a88('0x7e')])[_0x7a88('0x14')](function(_0x5ac1d6){_0x40b13d(null,_0x5ac1d6);})['catch'](function(_0x31fd7c){_0x40b13d(_0x31fd7c);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x7f')]=function(_0x7ca0c6,_0x520ef0,_0xb09d14){scripts[_0x7a88('0x7f')](_0x520ef0,_0x7ca0c6[_0x7a88('0x76')],_0x7ca0c6[_0x7a88('0x80')]||_0x7a88('0x81'),this[_0x7a88('0x82')](_0x7ca0c6[_0x7a88('0x83')])?_0x7ca0c6['model']:undefined)['then'](function(_0x597d44){_0xb09d14(null,_0x597d44);})[_0x7a88('0x15')](function(_0xf31b05){_0xb09d14(_0xf31b05);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x84')]=function(_0x5a41a7,_0xcbcad7){scripts['awsPolly'](_0x5a41a7[_0x7a88('0x85')],_0x5a41a7[_0x7a88('0x86')],_0x5a41a7[_0x7a88('0x87')],_0x5a41a7['aws_polly_voice']||_0x7a88('0x88'),_0x5a41a7[_0x7a88('0x5a')],_0x5a41a7[_0x7a88('0x89')]||_0x7a88('0x5a'))['then'](function(_0x5d4aee){_0xcbcad7(null,_0x5d4aee);})[_0x7a88('0x15')](function(_0x110e15){_0xcbcad7(_0x110e15);});};AGIVertices[_0x7a88('0x10')][_0x7a88('0x8a')]=function(_0x2e2c3d,_0x1c9bb1){scripts[_0x7a88('0x8a')](this['channel'][_0x7a88('0x35')],_0x2e2c3d['aws_access_key_id'],_0x2e2c3d[_0x7a88('0x86')],_0x2e2c3d[_0x7a88('0x8b')],_0x2e2c3d[_0x7a88('0x5a')],_0x2e2c3d[_0x7a88('0x8c')])[_0x7a88('0x14')](function(_0x3eb908){_0x1c9bb1(null,_0x3eb908);})[_0x7a88('0x15')](function(_0x560a0d){_0x1c9bb1(_0x560a0d);});};AGIVertices[_0x7a88('0x10')]['googleASR']=function(_0x416d3f,_0x4d2f1e,_0x18abee){scripts[_0x7a88('0x8d')](_0x4d2f1e,_0x416d3f[_0x7a88('0x76')],_0x416d3f[_0x7a88('0x8e')]||_0x7a88('0x81'))[_0x7a88('0x14')](function(_0x1ac945){_0x18abee(null,_0x1ac945);})['catch'](function(_0x5e346a){_0x18abee(_0x5e346a);});};AGIVertices['prototype'][_0x7a88('0x8f')]=function(_0x5be36b,_0x5a06eb,_0x1e61a6){scripts[_0x7a88('0x8f')](_0x5a06eb,_0x5be36b[_0x7a88('0x90')],_0x5be36b['appsecret'],_0x5be36b[_0x7a88('0x91')])[_0x7a88('0x14')](function(_0x2baba9){_0x1e61a6(null,_0x2baba9);})[_0x7a88('0x15')](function(_0xfe7860){_0x1e61a6(_0xfe7860);});};AGIVertices['prototype'][_0x7a88('0x92')]=function(_0xf6b9be){var _0x326b4c=_[_0x7a88('0x65')](verticesWithRetry,_0xf6b9be[_0x7a88('0x37')])?_0xf6b9be:_['clone'](_0xf6b9be);for(var _0x9eb02c in _0x326b4c){if(_0x326b4c[_0x7a88('0x93')](_0x9eb02c)){if(_0x326b4c[_0x9eb02c]&&_[_0x7a88('0x94')](_0x326b4c[_0x9eb02c])){if(_[_0x7a88('0x65')](recursiveMapAttributes,_0x9eb02c)){_0x326b4c[_0x9eb02c]=this[_0x7a88('0x95')](_0x326b4c[_0x9eb02c]);}else{_0x326b4c[_0x9eb02c]=this['replaceAllVariables'](_0x326b4c[_0x9eb02c]);}}}}return _0x326b4c;};AGIVertices[_0x7a88('0x10')]['recursiveNodeIndex']=function(_0x3390d0){for(var _0x1e8860 in _0x3390d0){if(_0x3390d0['hasOwnProperty'](_0x1e8860)){if(_['isPlainObject'](_0x3390d0[_0x1e8860])){this[_0x7a88('0x96')](_0x3390d0[_0x1e8860]);}else if(_[_0x7a88('0x97')](_0x3390d0[_0x1e8860])){for(var _0x5f3220=0x0;_0x5f3220<_0x3390d0[_0x1e8860][_0x7a88('0x98')];_0x5f3220++){this[_0x7a88('0x96')](_0x3390d0[_0x1e8860][_0x5f3220]);}}else if(_[_0x7a88('0x94')](_0x3390d0[_0x1e8860])){_0x3390d0[_0x1e8860]=this[_0x7a88('0x99')](_0x3390d0[_0x1e8860]);}}}};AGIVertices['prototype'][_0x7a88('0x9a')]=function(_0x18fdac,_0x281867){for(var _0x1f56cc in _0x18fdac){if(_0x18fdac[_0x7a88('0x93')](_0x1f56cc)){if(_['isPlainObject'](_0x18fdac[_0x1f56cc])){if(!_[_0x7a88('0x9b')](_0x18fdac[_0x1f56cc])){this[_0x7a88('0x9a')](_0x18fdac[_0x1f56cc],util[_0x7a88('0x52')](_0x7a88('0x9c'),_0x281867,_0x1f56cc));}}else if(_['isArray'](_0x18fdac[_0x1f56cc])){for(var _0xcc0f2d=0x0;_0xcc0f2d<_0x18fdac[_0x1f56cc]['length'];_0xcc0f2d++){this['saveRestApiResult'](_0x18fdac[_0x1f56cc][_0xcc0f2d],util[_0x7a88('0x52')](_0x7a88('0x9c'),_0x281867,_0x1f56cc+'['+_0xcc0f2d+']'));}}else{if(!_['isNil'](_0x18fdac[_0x1f56cc])){this[_0x7a88('0xf')][_0x7a88('0x9d')](util[_0x7a88('0x52')]('%s.%s',_0x281867,_0x1f56cc),_0x18fdac[_0x1f56cc]);}}}}};AGIVertices[_0x7a88('0x10')][_0x7a88('0x95')]=function(_0x39bac4){try{var _0x24d4bf=JSON[_0x7a88('0x69')](_0x39bac4);this['recursiveNodeIndex'](_0x24d4bf);return JSON[_0x7a88('0x6f')](_0x24d4bf);}catch(_0x51cee1){return this['replaceAllVariables'](_0x39bac4);}};AGIVertices['prototype'][_0x7a88('0x99')]=function(_0x302543){var _0x32c238=_0x302543[_0x7a88('0x9e')]('{');for(var _0x1c47c7=0x1;_0x1c47c7<_0x32c238[_0x7a88('0x98')];_0x1c47c7+=0x1){var _0x52f1a5=_0x32c238[_0x1c47c7]['split']('}');if(_0x52f1a5['length']>0x1){_0x302543=_0x302543[_0x7a88('0x9f')]('{'+_0x52f1a5[0x0]+'}',this[_0x7a88('0xf')][_0x7a88('0x11')](_0x52f1a5[0x0])[_0x7a88('0xa0')]||_0x52f1a5[0x0]);}}if(_0x32c238[_0x7a88('0x98')]===0x1){return _0x302543[_0x7a88('0xa1')]();}return this[_0x7a88('0x99')](_0x302543);};AGIVertices['prototype']['getAndSetVariable']=function(_0x3e49d9,_0x451186){var _0x31dca2=this[_0x7a88('0xf')][_0x7a88('0x11')](_0x3e49d9);if(_0x31dca2[_0x7a88('0xa2')]===-0x1){return _0x31dca2;}logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xa3'),_0x451186,_0x31dca2[_0x7a88('0xa0')]));return this['channel'][_0x7a88('0x9d')](_0x451186,_0x31dca2[_0x7a88('0xa0')]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x82')]=function(_0x30529f){return _0x30529f&&_0x30529f!=='0'&&_0x30529f!=='-1'&&_0x30529f!=='';};AGIVertices[_0x7a88('0x10')][_0x7a88('0xa4')]=function(_0x1fc7fc){this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x1fc7fc,'-');_0x1fc7fc[_0x7a88('0xa6')]=_0x1fc7fc['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x1180e9){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0xa7'),_0x1180e9['label']));if(!this[_0x7a88('0x82')](_0x1180e9['text'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xa9'));}var _0xf9ddae='\x22'+_0x1180e9['text']+'\x22';if(this[_0x7a88('0x82')](_0x1180e9[_0x7a88('0x74')])){_0xf9ddae+=','+_0x1180e9[_0x7a88('0x74')];}var _0xbff297=this[_0x7a88('0xf')]['exec']('MRCPSynth',_0xf9ddae);if(_0xbff297['result']===-0x1){return _0xbff297;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xaa'),_0xf9ddae));};AGIVertices['prototype'][_0x7a88('0xab')]=function(_0x510041){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x510041[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x510041[_0x7a88('0xac')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20grammar\x20configured');}var _0x2ff405=_0x510041[_0x7a88('0xac')];if(this[_0x7a88('0x82')](_0x510041[_0x7a88('0x74')])){_0x2ff405+=','+_0x510041[_0x7a88('0x74')];}var _0x57896d=this['channel'][_0x7a88('0x56')](_0x7a88('0xad'),_0x2ff405);if(_0x57896d[_0x7a88('0xa2')]===-0x1){return _0x57896d;}var _0x3db2ef=this[_0x7a88('0xae')](_0x7a88('0xaf'),_0x7a88('0xb0'));if(_0x3db2ef['result']===-0x1){return _0x3db2ef;}var _0x4cf56a=this[_0x7a88('0xae')](_0x7a88('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x4cf56a[_0x7a88('0xa2')]===-0x1){return _0x4cf56a;}var _0x327a70=this[_0x7a88('0xae')](_0x7a88('0xb2'),_0x7a88('0xb3'));if(_0x327a70[_0x7a88('0xa2')]===-0x1){return _0x327a70;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0xb4'),_0x2ff405));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x7')]=function(_0x2bfcb5){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xb5'),_0x2bfcb5[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0x7')]([_0x2bfcb5[_0x7a88('0xb6')],_0x2bfcb5[_0x7a88('0xb7')]]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0xb8')]=function(_0x4d91a0){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xb9'),_0x4d91a0[_0x7a88('0x36')]));if(this[_0x7a88('0x82')](_0x4d91a0[_0x7a88('0x64')])){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xba'),_0x4d91a0['timeout']));var _0x4cfe9c=this[_0x7a88('0xf')][_0x7a88('0xbb')](_0x4d91a0[_0x7a88('0x64')]);if(_0x4cfe9c[_0x7a88('0xa2')]===-0x1){return _0x4cfe9c;}}return this['channel']['answer']();};AGIVertices[_0x7a88('0x10')][_0x7a88('0x46')]=function(_0x1c8c16){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xbc'),_0x1c8c16[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x1c8c16['list_id'])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x1c8c16,_0x7a88('0xbd'));}_0x1c8c16[_0x7a88('0x48')]=moment();if(this['isConfigured'](_0x1c8c16[_0x7a88('0xbe')])){_0x1c8c16[_0x7a88('0x48')]=moment()[_0x7a88('0xbf')](_0x1c8c16[_0x7a88('0xbe')],_0x7a88('0xc0'));}if(!this['isConfigured'](_0x1c8c16[_0x7a88('0x49')])){_0x1c8c16[_0x7a88('0x49')]=0x2;}this['createCmContact'][_0x7a88('0xa5')](this,_0x1c8c16);return this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0xc1'),_0x1c8c16[_0x7a88('0x44')],_0x1c8c16['list_id'],_0x1c8c16[_0x7a88('0x48')]));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xc2')]=function(_0x1469a7){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1469a7[_0x7a88('0x36')]));var _0x17dcd4=this[_0x7a88('0xf')]['exec'](_0x1469a7[_0x7a88('0xc3')],_0x1469a7[_0x7a88('0x74')]);if(_0x17dcd4[_0x7a88('0xa2')]===-0x1){return _0x17dcd4;}return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xc4'),_0x1469a7[_0x7a88('0xc3')],_0x1469a7[_0x7a88('0x74')]));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xc5')]=function(_0x1253c7){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xc6'),_0x1253c7[_0x7a88('0x36')]));if(!this['isConfigured'](_0x1253c7[_0x7a88('0x5a')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xa9'));}var _0x369aa9='\x22'+_0x1253c7[_0x7a88('0x5a')]+'\x22';if(this['isConfigured'](_0x1253c7[_0x7a88('0x74')])){_0x369aa9+=','+_0x1253c7['options'];}var _0x1c67cb=this['channel']['exec']('MRCPSynth',_0x369aa9);if(_0x1c67cb[_0x7a88('0xa2')]===-0x1){return _0x1c67cb;}return this[_0x7a88('0xf')]['noop'](util['format'](_0x7a88('0xaa'),_0x369aa9));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xc7')]=function(_0x16ffae){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0xc8'),_0x16ffae[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x16ffae[_0x7a88('0x5a')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20text\x20configured');}var _0x506eff='\x22'+_0x16ffae[_0x7a88('0x5a')]+'\x22';if(this[_0x7a88('0x82')](_0x16ffae[_0x7a88('0x74')])){_0x506eff+=','+_0x16ffae[_0x7a88('0x74')];}var _0x427205=this[_0x7a88('0xf')][_0x7a88('0x56')](_0x7a88('0xc9'),_0x506eff);if(_0x427205['result']===-0x1){return _0x427205;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Executed\x20command\x20MRCPSynth\x20%s',_0x506eff));};AGIVertices[_0x7a88('0x10')]['lumenvoxasr']=function(_0xee1f7){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xca'),_0xee1f7[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0xee1f7['grammar'])){return this['channel']['noop'](_0x7a88('0xcb'));}var _0x5d7088=_0xee1f7[_0x7a88('0xac')];if(this[_0x7a88('0x82')](_0xee1f7['options'])){_0x5d7088+=','+_0xee1f7[_0x7a88('0x74')];}var _0xd0bb69=this[_0x7a88('0xf')][_0x7a88('0x56')](_0x7a88('0xad'),_0x5d7088);if(_0xd0bb69[_0x7a88('0xa2')]===-0x1){return _0xd0bb69;}var _0x2e3916=this['getAndSetVariable'](_0x7a88('0xaf'),_0x7a88('0xcc'));if(_0x2e3916[_0x7a88('0xa2')]===-0x1){return _0x2e3916;}var _0x449d77=this['getAndSetVariable']('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x449d77[_0x7a88('0xa2')]===-0x1){return _0x449d77;}var _0x3dc542=this[_0x7a88('0xae')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x3dc542['result']===-0x1){return _0x3dc542;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xb4'),_0x5d7088));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xcd')]=function(_0x18812c){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0xce'),_0x18812c['label']));if(!this['isConfigured'](_0x18812c[_0x7a88('0xac')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xcb'));}var _0x543fa3=_0x18812c[_0x7a88('0xac')];if(this[_0x7a88('0x82')](_0x18812c[_0x7a88('0x74')])){_0x543fa3+=','+_0x18812c['options'];}var _0x12fad2=this[_0x7a88('0xf')][_0x7a88('0x56')](_0x7a88('0xad'),_0x543fa3);if(_0x12fad2[_0x7a88('0xa2')]===-0x1){return _0x12fad2;}var _0x4b9169=this[_0x7a88('0xae')](_0x7a88('0xaf'),_0x7a88('0xcf'));if(_0x4b9169['result']===-0x1){return _0x4b9169;}var _0x311851=this[_0x7a88('0xae')]('RECOG_INPUT()',_0x7a88('0xd0'));if(_0x311851[_0x7a88('0xa2')]===-0x1){return _0x311851;}var _0x165892=this['getAndSetVariable']('RECOG_INSTANCE()',_0x7a88('0xd1'));if(_0x165892['result']===-0x1){return _0x165892;}return this[_0x7a88('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x543fa3));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xd2')]=function(_0x55ea43){logger[_0x7a88('0x2d')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x55ea43[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x55ea43[_0x7a88('0xd3')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x55ea43,_0x7a88('0xd4'));}var _0x1d9f90=this[_0x7a88('0x1a')][_0x7a88('0xa5')](this,_0x55ea43[_0x7a88('0xd3')]);if(!_0x1d9f90){return this['channel'][_0x7a88('0x2b')](_0x55ea43,_0x7a88('0xd5'));}if(!this[_0x7a88('0x82')](_0x55ea43[_0x7a88('0xd6')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x55ea43,_0x7a88('0xd7'));}var _0x327bc1=_0x55ea43[_0x7a88('0xd6')][_0x7a88('0xd8')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7a88('0xf')]['noop'](util[_0x7a88('0x52')](_0x7a88('0xd9'),_0x327bc1));var _0xfd4f49=this[_0x7a88('0x29')][_0x7a88('0xa5')](this,_0x1d9f90,_0x327bc1);this[_0x7a88('0x34')]['sync'](this,_0x55ea43,_0x327bc1);if(!this[_0x7a88('0x82')](_0x55ea43[_0x7a88('0xda')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xdb'));}var _0x584436=this[_0x7a88('0x11')]['sync'](this,_0x55ea43[_0x7a88('0xda')]);if(!_0x584436){return this[_0x7a88('0xf')]['error'](_0x55ea43,_0x7a88('0xdc'));}var _0x531f36=this;_0xfd4f49[_0x7a88('0xdd')](function(_0x54d372,_0x3bf220){Object[_0x7a88('0xde')](_0x54d372)['forEach'](function(_0x144bb9){_0x531f36[_0x7a88('0xf')][_0x7a88('0x9d')](util[_0x7a88('0x52')](_0x7a88('0xdf'),_0x584436,_0x3bf220,_0x144bb9),_0x54d372[_0x144bb9]);});});this[_0x7a88('0xf')]['setVariable'](util[_0x7a88('0x52')](_0x7a88('0xe0'),_0x584436),_0xfd4f49[_0x7a88('0x98')]);return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('variable\x20%s\x20set',_0x584436));};AGIVertices['prototype']['dial']=function(_0x17e097){logger[_0x7a88('0xe1')](util[_0x7a88('0x52')](_0x7a88('0xe2'),_0x17e097[_0x7a88('0x36')]));if(!this['isConfigured'](_0x17e097[_0x7a88('0xe3')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x17e097,'no\x20user\x20selected');}var _0x275684=this[_0x7a88('0xe4')]['sync'](this,_0x17e097[_0x7a88('0xe3')]);if(!_0x275684){return this['channel']['error'](_0x17e097,_0x7a88('0xe5'));}var _0x2b54d8=this['channel'][_0x7a88('0x56')](_0x7a88('0xe6'),[util[_0x7a88('0x52')]('SIP/%s',_0x275684),_0x17e097[_0x7a88('0x64')],_0x17e097[_0x7a88('0xe7')],_0x17e097[_0x7a88('0x61')]]);if(_0x2b54d8['result']===-0x1){return _0x2b54d8;}return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Executed\x20command\x20%s',_0x7a88('0xe6')));};AGIVertices['prototype'][_0x7a88('0xe8')]=function(_0x22c774){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xe9'),_0x22c774[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x22c774['key'])){return this[_0x7a88('0xf')]['noop'](_0x7a88('0xea'));}if(!this[_0x7a88('0x82')](_0x22c774[_0x7a88('0x5a')])){return this[_0x7a88('0xf')]['noop'](_0x7a88('0xa9'));}this[_0x7a88('0xf')][_0x7a88('0xeb')]=!![];this[_0x7a88('0x34')](_0x22c774);this['createSquareMessage'](_0x22c774[_0x7a88('0x5a')],'in','','');this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xec'),_0x22c774[_0x7a88('0x5a')]));var _0x16659c=this['googleDialogflow'][_0x7a88('0xa5')](this,_0x22c774);if(_0x16659c){for(var _0x555eb2 in _0x16659c){if(_0x16659c[_0x7a88('0x93')](_0x555eb2)){this['channel']['setVariable'](util[_0x7a88('0x52')](_0x7a88('0xed'),_0x555eb2[_0x7a88('0xee')]()),_0x16659c[_0x555eb2]);}}this[_0x7a88('0x40')](_0x16659c[_0x7a88('0xef')],_0x7a88('0xf0'),'dialogflow','');return this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0xf1'),_0x16659c['speech']));}return this[_0x7a88('0xf')]['error'](_0x22c774,_0x7a88('0xf2'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0xf3')]=function(_0x2282ac){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xf4'),_0x2282ac[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x2282ac[_0x7a88('0xf5')])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0xf6'));}if(!this[_0x7a88('0x82')](_0x2282ac[_0x7a88('0x79')])){return this['channel']['noop'](_0x7a88('0xf7'));}if(!this[_0x7a88('0x82')](_0x2282ac[_0x7a88('0x7a')])){return this[_0x7a88('0xf')]['noop']('no\x20private_key\x20configured');}if(!this[_0x7a88('0x82')](_0x2282ac[_0x7a88('0x7b')])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0xf8'));}if(!this['isConfigured'](_0x2282ac['text'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20text\x20configured');}this[_0x7a88('0xf')][_0x7a88('0xeb')]=!![];this[_0x7a88('0x34')](_0x2282ac);this[_0x7a88('0x40')](_0x2282ac['text'],'in','','');this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Trying\x20DialogflowV2:\x20%s',_0x2282ac[_0x7a88('0x5a')]));var _0x307f58=this[_0x7a88('0x78')][_0x7a88('0xa5')](this,_0x2282ac);if(_0x307f58){for(var _0x37cbd3 in _0x307f58){if(_0x307f58[_0x7a88('0x93')](_0x37cbd3)){if(_0x37cbd3!==_0x7a88('0xf9')){this['channel'][_0x7a88('0x9d')](util['format']('DIALOGFLOW_%s',_0x37cbd3[_0x7a88('0xee')]()),_0x307f58[_0x37cbd3]);}}}this['createSquareMessage'](_0x307f58[_0x7a88('0xef')],'out','dialogflowV2',_0x307f58[_0x7a88('0xf9')]);return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xfa'),_0x307f58[_0x7a88('0xef')]));}return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2282ac,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x7a88('0x10')][_0x7a88('0xfb')]=function(_0x317167){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0xfc'),_0x317167[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x317167[_0x7a88('0xfd')])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0xfe'));}if(!this[_0x7a88('0x82')](_0x317167['username'])){return this['channel'][_0x7a88('0xa8')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x317167['password'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xff'));}if(!this[_0x7a88('0x82')](_0x317167['ndassistant_url'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xa9'));}this[_0x7a88('0xf')]['bot']=!![];this[_0x7a88('0x34')](_0x317167);this[_0x7a88('0x40')](_0x317167[_0x7a88('0x5a')],'in','','');this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x100'),_0x317167[_0x7a88('0x5a')]));var _0x1111fe=this['sestekNDA'][_0x7a88('0xa5')](this,_0x317167);if(_0x1111fe){for(var _0x21b8c9 in _0x1111fe){if(_0x1111fe[_0x7a88('0x93')](_0x21b8c9)){this[_0x7a88('0xf')]['setVariable'](util[_0x7a88('0x52')](_0x7a88('0x101'),_0x21b8c9['toUpperCase']()),_0x1111fe[_0x21b8c9]);}}this['createSquareMessage'](_0x1111fe[_0x7a88('0xef')],_0x7a88('0xf0'),'sesteknda','');if(_0x1111fe[_0x7a88('0x102')]){this['channel'][_0x7a88('0xa8')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x1111fe['audiofile']));var _0x347044=this[_0x7a88('0xf')][_0x7a88('0x103')](_0x1111fe['audiofile']);try{fs[_0x7a88('0x104')](_0x1111fe[_0x7a88('0x102')]+_0x7a88('0x105'));}catch(_0x2a9669){logger[_0x7a88('0x2b')](_0x2a9669);}return _0x347044;}else{return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('SestekNDA\x20Result\x20%s',_0x1111fe[_0x7a88('0xef')]));}}return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x317167,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x7a88('0x10')][_0x7a88('0x106')]=function(_0x141c19){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x107'),_0x141c19[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0xa8')]('end');};AGIVertices[_0x7a88('0x10')][_0x7a88('0x108')]=function(_0xaa2d0){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x109'),_0xaa2d0['label']));var _0x3299a8='';if(_0xaa2d0['trunk_id']){if(!this[_0x7a88('0x82')](_0xaa2d0[_0x7a88('0x10a')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0xaa2d0,'no\x20trunk\x20selected');}else{var _0x588528=parseInt(_0xaa2d0[_0x7a88('0x10a')],0xa);if(isNaN(_0x588528)){_0x3299a8=_0xaa2d0['trunk_id'];}else{_0x3299a8=this[_0x7a88('0x1d')][_0x7a88('0xa5')](this,_0xaa2d0[_0x7a88('0x10a')]);if(!_0x3299a8){return this['channel'][_0x7a88('0x2b')](_0xaa2d0,_0x7a88('0x10b'));}}}}else if(_0xaa2d0[_0x7a88('0x10c')]){_0x3299a8=_0xaa2d0[_0x7a88('0x10c')];}else{return this[_0x7a88('0xf')]['error'](_0xaa2d0,_0x7a88('0x10d'));}var _0x1b89e1=this[_0x7a88('0xf')][_0x7a88('0x56')](_0x7a88('0xe6'),[util['format'](_0x7a88('0x10e'),_0x3299a8,_0xaa2d0[_0x7a88('0x44')]),_0xaa2d0[_0x7a88('0x64')],_0xaa2d0[_0x7a88('0xe7')],_0xaa2d0[_0x7a88('0x61')]]);if(_0x1b89e1[_0x7a88('0xa2')]===-0x1){return _0x1b89e1;}return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x10f'),_0x7a88('0xe6')));};AGIVertices['prototype']['finally']=function(_0x5766f3){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5766f3[_0x7a88('0x36')]));return this['channel'][_0x7a88('0xa8')](_0x7a88('0x110'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x111')]=function(_0x2919ac){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x112'),_0x2919ac['label']));if(_0x2919ac['retry']===0x0){return this[_0x7a88('0xa4')](_0x2919ac);}_0x2919ac[_0x7a88('0xa6')]-=0x1;if(!this[_0x7a88('0x82')](_0x2919ac[_0x7a88('0x113')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2919ac,'no\x20file\x20audio\x20selected');}var _0x19fcc6=this[_0x7a88('0x1e')][_0x7a88('0xa5')](this,_0x2919ac[_0x7a88('0x113')]);if(!_0x19fcc6){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2919ac,'no\x20file\x20audio\x20found');}if(!this[_0x7a88('0x82')](_0x2919ac[_0x7a88('0xda')])){return this[_0x7a88('0xf')]['error'](_0x7a88('0xdb'));}var _0x181a62=this[_0x7a88('0xf')][_0x7a88('0x114')](_0x19fcc6,_0x2919ac[_0x7a88('0x115')],_0x2919ac[_0x7a88('0x116')]);var _0x241d59=_0x181a62['result']?_0x181a62['result'][_0x7a88('0xa1')]():'';logger[_0x7a88('0x2d')](_0x7a88('0x117'),JSON[_0x7a88('0x6f')](_0x181a62));if(_0x181a62[_0x7a88('0xa2')]===-0x1){this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x2919ac,_0x241d59);return _0x181a62;}else if(_0x181a62[_0x7a88('0xa0')]===_0x7a88('0x64')){_0x181a62[_0x7a88('0xa2')]=_0x241d59[_0x7a88('0x98')]>=parseInt(_0x2919ac[_0x7a88('0x118')])?'x':'i';}else{_0x181a62['result']=_0x241d59['length']>=parseInt(_0x2919ac['mindigit'])&&_0x241d59[_0x7a88('0x98')]<=parseInt(_0x2919ac[_0x7a88('0x116')])?'x':'i';}var _0x1ef862=this['getVariable'][_0x7a88('0xa5')](this,_0x2919ac[_0x7a88('0xda')]);if(!_0x1ef862){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2919ac,_0x7a88('0xdc'));}this[_0x7a88('0xf')][_0x7a88('0x9d')](_0x1ef862,_0x241d59);if(this[_0x7a88('0x82')](_0x2919ac[_0x7a88('0x119')])){var _0x4036c0=parseInt(_0x2919ac[_0x7a88('0x119')],0xa);var _0x4a3396=rs['generate']({'charset':'*','length':_0x4036c0});var _0x551eb0=_0x241d59[_0x7a88('0x98')];if(_0x551eb0>0x0){if(_0x551eb0>_0x4036c0){this['createSquareDetailsReport'][_0x7a88('0xa5')](this,_0x2919ac,_0x2919ac[_0x7a88('0x11a')]===_0x7a88('0x11b')?_0x4a3396+_0x241d59['substr'](_0x4036c0):_0x241d59[_0x7a88('0x11c')](0x0,_0x551eb0-_0x4036c0)+_0x4a3396);}else{this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x2919ac,rs[_0x7a88('0x11d')]({'charset':'*','length':_0x551eb0}));}}else{this[_0x7a88('0x34')]['sync'](this,_0x2919ac,'');}}else{this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x2919ac,_0x241d59);}return _0x181a62;};AGIVertices[_0x7a88('0x10')][_0x7a88('0xe')]=function(_0x407e5a){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x11e'),_0x407e5a['label']));return this[_0x7a88('0x111')](_0x407e5a);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x11f')]=function(_0x27bffa){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x27bffa[_0x7a88('0x36')]));this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x27bffa,_0x27bffa[_0x7a88('0x120')]);return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('GOAL\x20%s',_0x27bffa[_0x7a88('0x120')]));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x121')]=function(_0x28c8a1){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x28c8a1[_0x7a88('0x36')]));if(!this['isConfigured'](_0x28c8a1[_0x7a88('0x85')])||!this[_0x7a88('0x82')](_0x28c8a1[_0x7a88('0x86')])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0x122'));}if(!this[_0x7a88('0x82')](_0x28c8a1[_0x7a88('0x5a')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xa9'));}this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x123'),_0x28c8a1[_0x7a88('0x5a')]));var _0x1012e7=this['awsPolly'][_0x7a88('0xa5')](this,_0x28c8a1);if(_0x1012e7){this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x124'),_0x1012e7));var _0x371d3b=this[_0x7a88('0xf')][_0x7a88('0x103')](_0x1012e7);try{fs['unlink'](_0x1012e7+_0x7a88('0x105'));}catch(_0x7e7792){logger[_0x7a88('0x2b')](_0x7e7792);}return _0x371d3b;}return this['channel']['error'](_0x28c8a1,_0x7a88('0x125'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x126')]=function(_0x2a409e){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x127'),_0x2a409e[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x2a409e['aws_access_key_id'])||!this[_0x7a88('0x82')](_0x2a409e[_0x7a88('0x86')])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0x122'));}if(!this[_0x7a88('0x82')](_0x2a409e[_0x7a88('0x8c')])){return this['channel'][_0x7a88('0xa8')]('no\x20bot\x20name\x20configured');}if(!this[_0x7a88('0x82')](_0x2a409e[_0x7a88('0x5a')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xa9'));}this['channel'][_0x7a88('0xeb')]=!![];this[_0x7a88('0x34')](_0x2a409e);this[_0x7a88('0x40')](_0x2a409e[_0x7a88('0x5a')],'in','','');this['channel']['noop'](util[_0x7a88('0x52')](_0x7a88('0x128'),_0x2a409e[_0x7a88('0x5a')]));var _0x41a70e=this[_0x7a88('0x8a')][_0x7a88('0xa5')](this,_0x2a409e);if(_0x41a70e){for(var _0x41125c in _0x41a70e){if(_0x41a70e[_0x7a88('0x93')](_0x41125c)&&_[_0x7a88('0x94')](_0x41a70e[_0x41125c])){this[_0x7a88('0xf')]['setVariable'](util[_0x7a88('0x52')]('AWS_LEX_%s',_0x41125c[_0x7a88('0xee')]()),_0x41a70e[_0x41125c]);}}if(_[_0x7a88('0x4e')](_0x41a70e[_0x7a88('0x72')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x129'));}else{this[_0x7a88('0x40')](_0x41a70e[_0x7a88('0x72')],_0x7a88('0xf0'),_0x7a88('0x12a'),'');return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Amazon\x20Lex\x20Result\x20%s',_0x41a70e[_0x7a88('0x72')]));}}return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2a409e,_0x7a88('0x12b'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x12c')]=function(_0x4e3da8){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x4e3da8[_0x7a88('0x36')],_0x4e3da8[_0x7a88('0x64')]));if(!this[_0x7a88('0x82')](_0x4e3da8[_0x7a88('0x76')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20key\x20configured');}var _0x3acab7=_0x7a88('0x12d');var _0x26a6bd=util[_0x7a88('0x52')](_0x7a88('0x12e'),FILES_PATH,rs[_0x7a88('0x11d')](0x4));var _0x1bf297=util[_0x7a88('0x52')](_0x7a88('0x9c'),_0x26a6bd,_0x3acab7);var _0x2ac908=!![];if(_0x4e3da8[_0x7a88('0x12f')]===_0x7a88('0x130')){_0x2ac908=![];}var _0x56131b=this[_0x7a88('0xf')][_0x7a88('0x131')](_0x26a6bd,_0x3acab7,_0x4e3da8[_0x7a88('0x132')],_0x4e3da8[_0x7a88('0x64')],undefined,_0x2ac908);if(_0x56131b['result']!==-0x1){this['channel'][_0x7a88('0xa8')](util['format'](_0x7a88('0x133'),_0x1bf297));var _0xc8e836=this[_0x7a88('0x8d')][_0x7a88('0xa5')](this,_0x4e3da8,_0x1bf297);if(_0xc8e836){for(var _0x3ec1ad in _0xc8e836){if(_0xc8e836[_0x7a88('0x93')](_0x3ec1ad)){this['channel'][_0x7a88('0x9d')](util[_0x7a88('0x52')](_0x7a88('0x134'),_0x3ec1ad[_0x7a88('0xee')]()),_0xc8e836[_0x3ec1ad]);}}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x135'),JSON[_0x7a88('0x6f')](_0xc8e836)));}}return _0x56131b;};AGIVertices['prototype']['tildeasr']=function(_0x37c997){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x37c997[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x37c997['appid'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20appid\x20configured');}if(!this[_0x7a88('0x82')](_0x37c997[_0x7a88('0x136')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20appsecret\x20configured');}var _0x2c2a1b=_0x7a88('0x12d');var _0x3bf105=util['format'](_0x7a88('0x12e'),FILES_PATH,rs[_0x7a88('0x11d')](0x4));var _0x30b7a0=util[_0x7a88('0x52')](_0x7a88('0x9c'),_0x3bf105,_0x2c2a1b);var _0x3ffa9f=!![];if(_0x37c997[_0x7a88('0x12f')]===_0x7a88('0x130')){_0x3ffa9f=![];}var _0x54fb44=this[_0x7a88('0xf')]['recordFile'](_0x3bf105,_0x2c2a1b,_0x37c997[_0x7a88('0x132')],_0x37c997[_0x7a88('0x64')],undefined,_0x3ffa9f);if(_0x54fb44['result']!==-0x1){this['channel'][_0x7a88('0xa8')](util['format'](_0x7a88('0x137'),_0x30b7a0));var _0x89dd23=this[_0x7a88('0x8f')]['sync'](this,_0x37c997,_0x30b7a0);if(_0x89dd23){for(var _0x370a79 in _0x89dd23){if(_0x89dd23[_0x7a88('0x93')](_0x370a79)){this['channel'][_0x7a88('0x9d')](util[_0x7a88('0x52')](_0x7a88('0x138'),_0x370a79['toUpperCase']()),_0x89dd23[_0x370a79]);}}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('TildeASR\x20Result\x20%s',JSON[_0x7a88('0x6f')](_0x89dd23)));}}return _0x54fb44;};AGIVertices[_0x7a88('0x10')][_0x7a88('0x139')]=function(_0x489e8f){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x13a'),_0x489e8f[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0x13b')](_0x489e8f[_0x7a88('0x3a')],_0x489e8f[_0x7a88('0x3b')],_0x489e8f[_0x7a88('0x3c')]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x13c')]=function(_0x91a117){logger[_0x7a88('0x2d')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x91a117[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x91a117[_0x7a88('0x13d')])){return this[_0x7a88('0xf')]['error'](_0x91a117,_0x7a88('0x13e'));}try{var _0x37d915=eval(_0x91a117[_0x7a88('0x13d')])?_0x7a88('0x13f'):'false';this[_0x7a88('0xf')]['noop'](util[_0x7a88('0x52')]('EVAL\x20CONDITION\x20%s\x20%s',_0x91a117['condition'],_0x37d915));return{'code':0xc8,'result':_0x37d915};}catch(_0x37df7a){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7a88('0x10')][_0x7a88('0x140')]=function(_0x1f1e75){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x141'),_0x1f1e75[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x1f1e75[_0x7a88('0x142')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x1f1e75,_0x7a88('0x143'));}var _0x5c2fe8=this[_0x7a88('0x144')][_0x7a88('0xa5')](this,_0x1f1e75[_0x7a88('0x142')]);if(!_0x5c2fe8){return this['channel'][_0x7a88('0x2b')](_0x1f1e75,_0x7a88('0x145'));}for(var _0x3e1d5a=0x0;_0x3e1d5a<_0x5c2fe8[_0x7a88('0x98')];_0x3e1d5a+=0x1){var _0x4c1814=this[_0x7a88('0xf')][_0x7a88('0x11')](util['format'](_0x7a88('0x146'),_0x5c2fe8[_0x3e1d5a]));if(_0x4c1814[_0x7a88('0xa2')]===-0x1){return _0x4c1814;}logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('IFTIME\x20%s\x20%s',_0x5c2fe8[_0x3e1d5a],_0x4c1814[_0x7a88('0xa0')]));if(_0x4c1814[_0x7a88('0xa0')]==='true'){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x147'),_0x5c2fe8[_0x3e1d5a],'true'));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x147'),_0x5c2fe8[_0x3e1d5a],_0x7a88('0x13f')));return{'code':0xc8,'result':'true'};}else{logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x147'),_0x5c2fe8[_0x3e1d5a],'false'));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x147'),_0x5c2fe8[_0x3e1d5a],_0x7a88('0x148')));}}return{'code':0xc8,'result':_0x7a88('0x148')};};AGIVertices[_0x7a88('0x10')][_0x7a88('0x149')]=function(_0x54d460){logger['info'](util['format'](_0x7a88('0x14a'),_0x54d460[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0x149')]();};AGIVertices[_0x7a88('0x10')]['ispeechasr']=function(_0x5aec07){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x14b'),_0x5aec07['label']));if(!this[_0x7a88('0x82')](_0x5aec07[_0x7a88('0x76')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xea'));}var _0xbb661b=_0x7a88('0x12d');var _0x412b3e=util[_0x7a88('0x52')](_0x7a88('0x12e'),FILES_PATH,rs[_0x7a88('0x11d')](0x4));var _0x141771=util[_0x7a88('0x52')](_0x7a88('0x9c'),_0x412b3e,_0xbb661b);var _0x5215a1=!![];if(_0x5aec07[_0x7a88('0x12f')]===_0x7a88('0x130')){_0x5215a1=![];}var _0x3e0282=this[_0x7a88('0xf')][_0x7a88('0x131')](_0x412b3e,_0xbb661b,_0x5aec07['intKey'],_0x5aec07[_0x7a88('0x64')],undefined,_0x5215a1);if(_0x3e0282[_0x7a88('0xa2')]!==-0x1){this[_0x7a88('0xf')]['noop'](util[_0x7a88('0x52')](_0x7a88('0x14c'),_0x141771));var _0x2917ff=this['ispeechASR'][_0x7a88('0xa5')](this,_0x5aec07,_0x141771);if(_0x2917ff){for(var _0x291b51 in _0x2917ff){if(_0x2917ff[_0x7a88('0x93')](_0x291b51)){this[_0x7a88('0xf')][_0x7a88('0x9d')](util[_0x7a88('0x52')](_0x7a88('0x14d'),_0x291b51[_0x7a88('0xee')]()),_0x2917ff[_0x291b51]);}}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0x7a88('0x6f')](_0x2917ff)));}}return _0x3e0282;};AGIVertices[_0x7a88('0x10')][_0x7a88('0x14e')]=function(_0x3d9f65){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x14f'),_0x3d9f65[_0x7a88('0x36')]));if(!this['isConfigured'](_0x3d9f65['key'])){return this['channel'][_0x7a88('0xa8')](_0x7a88('0xea'));}if(!this[_0x7a88('0x82')](_0x3d9f65['text'])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20text\x20configured');}this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Trying\x20ispeech\x20TTS\x20%s',_0x3d9f65[_0x7a88('0x5a')]));var _0x479db7=this[_0x7a88('0x7d')]['sync'](this,_0x3d9f65);if(_0x479db7){this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x14c'),_0x479db7));var _0x377b46=this[_0x7a88('0xf')][_0x7a88('0x103')](_0x479db7,_0x3d9f65[_0x7a88('0x132')]);try{fs[_0x7a88('0x104')](_0x479db7+_0x7a88('0x105'));}catch(_0x42af7b){logger[_0x7a88('0x2b')](_0x42af7b);}return _0x377b46;}return this['channel']['error'](_0x3d9f65,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7a88('0x150')]=function(_0x4101f2){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x4101f2[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x4101f2[_0x7a88('0x151')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x4101f2,_0x7a88('0x152'));}logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x153'),this['channel'][_0x7a88('0x38')],_0x4101f2[_0x7a88('0x151')]));var _0x3b441b=this[_0x7a88('0x51')][_0x7a88('0xa5')](this,_0x4101f2[_0x7a88('0x151')]);if(_0x3b441b){logger[_0x7a88('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4101f2['findBy']));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x154'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4101f2[_0x7a88('0x151')]));return{'code':0xc8,'result':_0x7a88('0x155')};}else{logger[_0x7a88('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4101f2[_0x7a88('0x151')]));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x156'),this['channel'][_0x7a88('0x38')],_0x4101f2[_0x7a88('0x151')]));return{'code':0xc8,'result':_0x7a88('0x157')};}};AGIVertices['prototype'][_0x7a88('0x158')]=function(_0x4a3b39){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x159'),_0x4a3b39[_0x7a88('0x36')]));if(!this['isConfigured'](_0x4a3b39[_0x7a88('0x151')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x4a3b39,_0x7a88('0x152'));}logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4a3b39[_0x7a88('0x151')]));var _0x1c8956=this[_0x7a88('0x50')][_0x7a88('0xa5')](this,_0x4a3b39['findBy']);if(_0x1c8956){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x154'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4a3b39[_0x7a88('0x151')]));this['channel']['noop'](util[_0x7a88('0x52')](_0x7a88('0x154'),this['channel'][_0x7a88('0x38')],_0x4a3b39[_0x7a88('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x156'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x4a3b39[_0x7a88('0x151')]));this['channel'][_0x7a88('0xa8')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x4a3b39['findBy']));return{'code':0xc8,'result':_0x7a88('0x157')};}};AGIVertices[_0x7a88('0x10')]['math']=function(_0xf721cc){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x15a'),_0xf721cc['label']));if(!this['isConfigured'](_0xf721cc[_0x7a88('0x15b')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0xf721cc,_0x7a88('0x15c'));}this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x15d'),_0xf721cc[_0x7a88('0x15b')]));var _0x2166f1=eval(_0xf721cc[_0x7a88('0x15b')]);if(!this[_0x7a88('0x82')](_0xf721cc[_0x7a88('0xda')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0xdb'));}var _0x1a09cc=this['getVariable']['sync'](this,_0xf721cc['variable_id']);if(!_0x1a09cc){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0xf721cc,_0x7a88('0xdc'));}if(_[_0x7a88('0x97')](_0x2166f1)){var _0x599582=this;_0x2166f1[_0x7a88('0xdd')](function(_0x137ba3,_0x1fdd77){_0x599582[_0x7a88('0xf')][_0x7a88('0x9d')](util['format'](_0x7a88('0x15e'),_0x1a09cc,_0x1fdd77),_0x137ba3);});return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x15f'),_0x1a09cc));}else{return this['channel'][_0x7a88('0x9d')](_0x1a09cc,_0x2166f1);}};AGIVertices['prototype']['menu']=function(_0x5ba7ea){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x160'),_0x5ba7ea[_0x7a88('0x36')]));if(_0x5ba7ea[_0x7a88('0xa6')]===0x0){return this[_0x7a88('0xa4')](_0x5ba7ea);}_0x5ba7ea[_0x7a88('0xa6')]-=0x1;if(!this[_0x7a88('0x82')](_0x5ba7ea[_0x7a88('0x113')])){return this['channel'][_0x7a88('0x2b')](_0x5ba7ea,'no\x20file\x20audio\x20selected');}var _0x509f3e=this[_0x7a88('0x1e')][_0x7a88('0xa5')](this,_0x5ba7ea['file_id']);if(!_0x509f3e){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x5ba7ea,_0x7a88('0x161'));}var _0x2d57d3=this['channel']['getData'](_0x509f3e,_0x5ba7ea[_0x7a88('0x115')],_0x5ba7ea[_0x7a88('0x162')]);var _0x4b1994=_0x2d57d3[_0x7a88('0xa2')];if(_0x2d57d3[_0x7a88('0xa2')]===-0x1){this['createSquareDetailsReport'][_0x7a88('0xa5')](this,_0x5ba7ea,'-1');return _0x2d57d3;}else if(_0x2d57d3[_0x7a88('0xa0')]==='timeout'){_0x2d57d3[_0x7a88('0xa2')]=_0x2d57d3['result']['length']>0x0?_0x2d57d3[_0x7a88('0xa2')]:'t';}else if(_[_0x7a88('0x9b')](_0x2d57d3[_0x7a88('0xa2')])){_0x2d57d3[_0x7a88('0xa2')]='#';_0x4b1994='#';}if(!this[_0x7a88('0x82')](_0x5ba7ea[_0x7a88('0xda')])){this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2c3874=this['getVariable']['sync'](this,_0x5ba7ea[_0x7a88('0xda')]);if(!_0x2c3874){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x5ba7ea,_0x7a88('0xdc'));}this[_0x7a88('0xf')]['setVariable'](_0x2c3874,_0x4b1994);}this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x5ba7ea,_0x4b1994);return _0x2d57d3;};AGIVertices['prototype'][_0x7a88('0xa8')]=function(_0x4e0495){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x163'),_0x4e0495[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x4e0495['output']||_0x4e0495[_0x7a88('0x36')]);};AGIVertices['prototype'][_0x7a88('0x164')]=function(_0x3b17e3){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x165'),_0x3b17e3[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x3b17e3[_0x7a88('0x151')])){return this['channel'][_0x7a88('0x2b')](_0x3b17e3,_0x7a88('0x152'));}logger[_0x7a88('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7a88('0xf')][_0x7a88('0x38')],_0x3b17e3[_0x7a88('0x151')]));var _0x444c5d=this['getPause'][_0x7a88('0xa5')](this,_0x3b17e3['pause_id']);var _0x4505b5=this[_0x7a88('0x4c')][_0x7a88('0xa5')](this,_0x3b17e3[_0x7a88('0x151')],_0x444c5d);if(_0x4505b5){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x154'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x3b17e3[_0x7a88('0x151')]));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x154'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x3b17e3['findBy']));return{'code':0xc8,'result':_0x7a88('0x155')};}else{logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x156'),this[_0x7a88('0xf')]['callerid'],_0x3b17e3[_0x7a88('0x151')]));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7a88('0xf')]['callerid'],_0x3b17e3['findBy']));return{'code':0xc8,'result':_0x7a88('0x157')};}};AGIVertices['prototype'][_0x7a88('0x166')]=function(_0x31a68a){logger[_0x7a88('0x2d')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x31a68a[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x31a68a[_0x7a88('0x113')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x31a68a,_0x7a88('0x167'));}var _0x282736=this[_0x7a88('0x1e')][_0x7a88('0xa5')](this,_0x31a68a[_0x7a88('0x113')]);if(!_0x282736){return this['channel'][_0x7a88('0x2b')](_0x31a68a,_0x7a88('0x161'));}var _0x5dd11c=this[_0x7a88('0xf')]['exec'](_0x7a88('0x168'),[_0x282736,_0x31a68a[_0x7a88('0xe7')]]);if(_0x5dd11c[_0x7a88('0xa2')]===-0x1){return _0x5dd11c;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0xc4'),'PLAYBACK',_0x282736));};AGIVertices['prototype'][_0x7a88('0x169')]=function(_0x2d07e0){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x16a'),_0x2d07e0[_0x7a88('0x36')]));if(!this['isConfigured'](_0x2d07e0['queue_id'])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x2d07e0,'no\x20queue\x20selected');}var _0x3c52e7='';var _0x459c3f=parseInt(_0x2d07e0['queue_id'],0xa);if(isNaN(_0x459c3f)){_0x3c52e7=_0x2d07e0[_0x7a88('0x16b')];}else{_0x3c52e7=this[_0x7a88('0x16')][_0x7a88('0xa5')](this,_0x2d07e0['queue_id']);if(!_0x3c52e7){return this[_0x7a88('0xf')]['error'](_0x2d07e0,_0x7a88('0x16c'));}}var _0x2aa5ca='';if(this[_0x7a88('0x82')](_0x2d07e0['file_id'])){var _0x16f1b5=this[_0x7a88('0x1e')][_0x7a88('0xa5')](this,_0x2d07e0['file_id']);if(_0x16f1b5){_0x2aa5ca=_0x16f1b5;}}this['createSquareDetailsReport'][_0x7a88('0xa5')](this,_0x2d07e0,_0x3c52e7);if(_0x2d07e0[_0x7a88('0xe7')][_0x7a88('0x16d')]('x')<0x0){_0x2d07e0[_0x7a88('0xe7')]+='x';}if(_0x2d07e0['opts'][_0x7a88('0x16d')]('X')<0x0){_0x2d07e0[_0x7a88('0xe7')]+='X';}this['channel'][_0x7a88('0x9d')](_0x7a88('0x16e'),_0x3c52e7?_0x3c52e7['toLowerCase']():'');var _0x52bb32=this[_0x7a88('0xf')][_0x7a88('0x56')](_0x7a88('0x16f'),[_0x3c52e7,_0x2d07e0['opts'],_0x2d07e0[_0x7a88('0x61')],_0x2aa5ca,_0x2d07e0[_0x7a88('0x64')],_0x2d07e0[_0x7a88('0x7')],_0x2d07e0['macro'],_0x2d07e0['gosub'],'',_0x2d07e0[_0x7a88('0x170')]]);if(_0x52bb32[_0x7a88('0xa2')]===-0x1){return _0x52bb32;}return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xc4'),_0x7a88('0x16f'),_0x3c52e7));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x171')]=function(_0x10406d){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x172'),_0x10406d[_0x7a88('0x36')]));var _0x31a021=_0x10406d[_0x7a88('0x173')]||_0x7a88('0x12d');var _0x41a2b6=util[_0x7a88('0x52')](_0x7a88('0x174'),this[_0x7a88('0xf')][_0x7a88('0x35')],rs[_0x7a88('0x11d')](0x5));var _0x437aec=util[_0x7a88('0x52')]('%s/recordings/%s.%s',FILES_PATH,_0x41a2b6,_0x31a021);var _0x2eb0ae=util[_0x7a88('0x52')](_0x7a88('0x12e'),FILES_PATH,_0x41a2b6);this[_0x7a88('0x39')][_0x7a88('0xa5')](this,_0x10406d,_0x41a2b6,_0x437aec);this['channel'][_0x7a88('0x9d')](_0x7a88('0x175'),_0x41a2b6);logger[_0x7a88('0x2d')](_0x7a88('0x176'),_0x2eb0ae,_0x31a021,_0x10406d['escape_digits'],_0x10406d[_0x7a88('0x64')]);return this[_0x7a88('0xf')][_0x7a88('0x131')](_0x2eb0ae,_0x31a021,_0x10406d[_0x7a88('0x177')],_0x10406d[_0x7a88('0x64')],undefined,!![]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x178')]=function(_0x3a5ad5){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x179'),_0x3a5ad5[_0x7a88('0x36')]));if(!this['isConfigured'](_0x3a5ad5[_0x7a88('0x61')])){return this[_0x7a88('0xf')]['noop'](_0x7a88('0x17a'));}var _0x45823f=this[_0x7a88('0x17b')]['sync'](this,_0x3a5ad5);logger[_0x7a88('0x2d')](util[_0x7a88('0x52')]('Response:',util[_0x7a88('0x17c')](_0x45823f,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3a5ad5[_0x7a88('0xda')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x17d'));}var _0x5cac3f=this[_0x7a88('0x11')]['sync'](this,_0x3a5ad5[_0x7a88('0xda')]);if(!_0x5cac3f){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x3a5ad5,_0x7a88('0xdc'));}this[_0x7a88('0xf')][_0x7a88('0x9d')](util[_0x7a88('0x52')](_0x7a88('0x17e'),_0x5cac3f),_0x45823f['statusCode']?_0x45823f[_0x7a88('0x71')]:'200');this['channel']['setVariable'](util[_0x7a88('0x52')](_0x7a88('0x17f'),_0x5cac3f),_0x45823f[_0x7a88('0x70')]?_0x45823f[_0x7a88('0x70')]:'OK');if(_0x45823f['body']){try{this['saveRestApiResult'](_0x45823f[_0x7a88('0x68')],_0x5cac3f);}catch(_0x2b9031){logger[_0x7a88('0x2b')](util['format'](_0x7a88('0x180'),_0x5cac3f));}}return this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x181'),_0x5cac3f));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x182')]=function(_0x5a0b36){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x183'),_0x5a0b36[_0x7a88('0x36')]));return this[_0x7a88('0xf')]['sayDigits'](_0x5a0b36['digits']['replace'](/\s+/g,''),_0x5a0b36[_0x7a88('0x177')]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x184')]=function(_0x557719){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x185'),_0x557719[_0x7a88('0x36')]));return this['channel']['sayNumber'](_0x557719['number'][_0x7a88('0xd8')](/\s+/g,''),_0x557719['escape_digits']);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x186')]=function(_0x12c196){logger['info'](util[_0x7a88('0x52')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x12c196[_0x7a88('0x36')]));return this[_0x7a88('0xf')]['sayPhonetic'](_0x12c196[_0x7a88('0x5a')],_0x12c196['escape_digits']);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x187')]=function(_0x5a2f5f){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x188'),_0x5a2f5f[_0x7a88('0x36')]));if(!this[_0x7a88('0x82')](_0x5a2f5f[_0x7a88('0x189')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x18a'));}var _0x3e62c4=this[_0x7a88('0x21')][_0x7a88('0xa5')](this,_0x5a2f5f[_0x7a88('0x189')]);if(!_0x3e62c4||!_0x3e62c4['Smtp']){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x5a2f5f,_0x7a88('0x18b'));}var _0x3a9392={'from':util[_0x7a88('0x52')](_0x7a88('0x18c'),_0x3e62c4[_0x7a88('0x19')],_0x3e62c4['email']||_0x3e62c4[_0x7a88('0x18d')][_0x7a88('0x18e')]),'to':_0x5a2f5f['to']||'','cc':_0x5a2f5f['cc']||'','bcc':_0x5a2f5f[_0x7a88('0x18f')]||'','subject':_0x5a2f5f[_0x7a88('0x190')],'html':_0x5a2f5f[_0x7a88('0x5a')],'text':_0x5a2f5f[_0x7a88('0x5a')]};if(this['isConfigured'](_0x5a2f5f['template_id'])){}logger['debug'](_0x7a88('0x191'),JSON[_0x7a88('0x6f')](_0x3a9392));this['createSquareDetailsReport'][_0x7a88('0xa5')](this,_0x5a2f5f,_0x5a2f5f['account_id']);this['channel']['noop'](util[_0x7a88('0x52')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3e62c4[_0x7a88('0x19')]));this[_0x7a88('0x24')]['sync'](this,_0x3e62c4[_0x7a88('0x192')],_0x3a9392);return this['channel'][_0x7a88('0xa8')](_0x7a88('0x193'));};AGIVertices['prototype']['sendFax']=function(_0x3cc463){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x194'),_0x3cc463[_0x7a88('0x36')]));return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x195'));};AGIVertices['prototype']['sendSMS']=function(_0x20407e){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x196'),_0x20407e['label']));if(!this[_0x7a88('0x82')](_0x20407e[_0x7a88('0x197')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')]('no\x20sms\x20account\x20configured');}var _0x29d73d=this[_0x7a88('0x32')][_0x7a88('0xa5')](this,_0x20407e[_0x7a88('0x197')]);if(!_0x29d73d){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x20407e,_0x7a88('0x198'));}var _0x349d50={'body':_0x20407e[_0x7a88('0x199')],'phone':_0x20407e['to']||'','SmsAccountId':_0x29d73d['id']};logger[_0x7a88('0xe1')](_0x7a88('0x19a'),JSON[_0x7a88('0x6f')](_0x349d50));this[_0x7a88('0x34')][_0x7a88('0xa5')](this,_0x20407e,_0x20407e[_0x7a88('0x197')]);this['channel']['noop'](util[_0x7a88('0x52')](_0x7a88('0x19b'),_0x29d73d[_0x7a88('0x19')]));this[_0x7a88('0x33')]['sync'](this,_0x349d50);return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x19c'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x19d')]=function(_0x499035){logger['info'](util[_0x7a88('0x52')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x499035['label']));if(!this[_0x7a88('0x82')](_0x499035[_0x7a88('0xda')])){return this['channel'][_0x7a88('0x2b')](_0x499035,_0x7a88('0x19e'));}var _0x591467=this[_0x7a88('0x11')][_0x7a88('0xa5')](this,_0x499035[_0x7a88('0xda')]);if(!_0x591467){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x499035,'no\x20variable\x20found');}return this[_0x7a88('0xf')][_0x7a88('0x9d')](_0x591467,_0x499035[_0x7a88('0x19f')]);};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1a0')]=function(_0x42fa83){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x1a1'),_0x42fa83[_0x7a88('0x36')]));this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x1a2'));if(_0x42fa83[_0x7a88('0xb8')]===_0x7a88('0x1a3')){this['channel'][_0x7a88('0xa8')]('Answer');return this[_0x7a88('0xf')]['answer']();}return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x1a4'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1a5')]=function(_0x5b346d){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x1a6'),_0x5b346d['label']));if(!this[_0x7a88('0x82')](_0x5b346d[_0x7a88('0x1a7')])){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x5b346d,_0x7a88('0x1a8'));}var _0x1563d6=this[_0x7a88('0x1a9')][_0x7a88('0xa5')](this,_0x5b346d[_0x7a88('0x1a7')]);if(!this[_0x7a88('0x82')](_0x1563d6)){return this['channel'][_0x7a88('0x2b')](_0x5b346d,util['format'](_0x7a88('0x1aa'),_0x5b346d[_0x7a88('0x1a7')]));}if(_0x1563d6===this[_0x7a88('0xf')][_0x7a88('0x1ab')]){return this[_0x7a88('0xf')]['error'](_0x5b346d,_0x7a88('0x1ac'));}this['createSquareDetailsReport']['sync'](this,_0x5b346d,_0x1563d6);var _0x1eb45d=this[_0x7a88('0xf')][_0x7a88('0x56')]('AGI',util[_0x7a88('0x52')](_0x7a88('0x1ad'),config[_0x7a88('0x7')]['host']||'127.0.0.1',_0x1563d6,this[_0x7a88('0xf')][_0x7a88('0x1ab')]));if(_0x1eb45d[_0x7a88('0xa2')]===-0x1){return _0x1eb45d;}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0xc4'),_0x7a88('0x1ae'),_0x1563d6));};AGIVertices[_0x7a88('0x10')]['system']=function(_0x5837fa){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x1af'),_0x5837fa[_0x7a88('0x36')]));var _0x47f1e3=this[_0x7a88('0x55')]['sync'](this,_0x5837fa['command']);this[_0x7a88('0x34')]['sync'](this,_0x5837fa,_0x5837fa[_0x7a88('0xb6')]);if(this[_0x7a88('0x82')](_0x5837fa[_0x7a88('0xda')])){var _0x1a61d6=this['getVariable'][_0x7a88('0xa5')](this,_0x5837fa[_0x7a88('0xda')]);if(_0x1a61d6){this[_0x7a88('0xf')][_0x7a88('0x9d')](_0x1a61d6,_0x47f1e3);return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x1b0'),_0x5837fa[_0x7a88('0xb6')],_0x1a61d6));}}return this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x1b1'),_0x5837fa[_0x7a88('0xb6')]));};AGIVertices['prototype'][_0x7a88('0x1b2')]=function(_0x5439a1){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x1b3'),_0x5439a1['label']));_0x5439a1[_0x7a88('0x5a')]=_0x5439a1[_0x7a88('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7a88('0x82')](_0x5439a1[_0x7a88('0x59')])){return this[_0x7a88('0xf')][_0x7a88('0xa8')](_0x7a88('0x1b4'));}if(!this[_0x7a88('0x82')](_0x5439a1['text'])){return this[_0x7a88('0xf')]['noop'](_0x7a88('0xa9'));}this[_0x7a88('0xf')]['noop'](util[_0x7a88('0x52')](_0x7a88('0x1b5'),_0x5439a1[_0x7a88('0x5a')]));var _0x45be6d=this[_0x7a88('0x58')][_0x7a88('0xa5')](this,_0x5439a1);if(_0x45be6d){this[_0x7a88('0xf')]['noop'](util['format'](_0x7a88('0x1b6'),_0x45be6d));var _0xe4928=this['channel'][_0x7a88('0x103')](_0x45be6d);try{fs['unlink'](_0x45be6d+_0x7a88('0x105'));}catch(_0x39e1e5){logger['error'](_0x39e1e5);}return _0xe4928;}return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x5439a1,_0x7a88('0x1b7'));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1b8')]=function(_0x34c21e){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x1b9'),_0x34c21e[_0x7a88('0x36')]));_0x34c21e[_0x7a88('0x5a')]=_0x34c21e[_0x7a88('0x5a')][_0x7a88('0xd8')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7a88('0x82')](_0x34c21e['text'])){return this[_0x7a88('0xf')]['noop'](_0x7a88('0xa9'));}this[_0x7a88('0xf')][_0x7a88('0xa8')](util['format'](_0x7a88('0x1ba'),_0x34c21e[_0x7a88('0x5a')]));var _0x20cc31=this[_0x7a88('0x5f')][_0x7a88('0xa5')](this,_0x34c21e);if(_0x20cc31){this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')]('Google\x20TTS\x20%s\x20file\x20created',_0x20cc31));var _0x29a557=this['channel']['streamFile'](_0x20cc31);try{fs[_0x7a88('0x104')](_0x20cc31+'.wav');}catch(_0x29c53a){logger[_0x7a88('0x2b')](_0x29c53a);}return _0x29a557;}return this['channel'][_0x7a88('0x2b')](_0x34c21e,_0x7a88('0x1bb'));};AGIVertices[_0x7a88('0x10')]['unpause']=function(_0x344465){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x1bc'),_0x344465['label']));if(!this['isConfigured'](_0x344465[_0x7a88('0x151')])){return this[_0x7a88('0xf')]['error'](_0x344465,_0x7a88('0x152'));}logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x153'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x344465[_0x7a88('0x151')]));var _0x530aea=this[_0x7a88('0x4f')][_0x7a88('0xa5')](this,_0x344465[_0x7a88('0x151')]);if(_0x530aea){logger['info'](util[_0x7a88('0x52')](_0x7a88('0x154'),this[_0x7a88('0xf')]['callerid'],_0x344465[_0x7a88('0x151')]));this['channel'][_0x7a88('0xa8')](util[_0x7a88('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7a88('0xf')][_0x7a88('0x38')],_0x344465['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x156'),this[_0x7a88('0xf')]['callerid'],_0x344465[_0x7a88('0x151')]));this[_0x7a88('0xf')][_0x7a88('0xa8')](util[_0x7a88('0x52')](_0x7a88('0x156'),this[_0x7a88('0xf')][_0x7a88('0x38')],_0x344465[_0x7a88('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x7a88('0x1bd')]=function(_0x224574){logger[_0x7a88('0x2d')](util[_0x7a88('0x52')](_0x7a88('0x1be'),_0x224574[_0x7a88('0x36')]));var _0x5a2ccc=this['channel'][_0x7a88('0x56')](_0x7a88('0x1bf'),[_0x224574[_0x7a88('0x1c0')],_0x224574['options']]);if(_0x5a2ccc['result']===-0x1){return _0x5a2ccc;}return this[_0x7a88('0xf')]['noop'](util[_0x7a88('0x52')](_0x7a88('0xc4'),'VOICEMAIL',_0x224574[_0x7a88('0x1c0')]));};AGIVertices[_0x7a88('0x10')][_0x7a88('0x1c1')]=function(_0x4bca21){logger[_0x7a88('0x2d')](util['format'](_0x7a88('0x1c2'),_0x4bca21['label']));if(!this['isConfigured'](_0x4bca21[_0x7a88('0xda')])){return this[_0x7a88('0xf')]['error'](_0x4bca21,_0x7a88('0x19e'));}var _0x72b1d9=this[_0x7a88('0x11')][_0x7a88('0xa5')](this,_0x4bca21[_0x7a88('0xda')]);if(!_0x72b1d9){return this[_0x7a88('0xf')][_0x7a88('0x2b')](_0x4bca21,_0x7a88('0xdc'));}var _0x38bf7c=this[_0x7a88('0xf')]['getVariable'](_0x72b1d9);return{'code':0xc8,'result':_0x38bf7c[_0x7a88('0xa0')]?_0x38bf7c[_0x7a88('0xa0')]:'-'};};String[_0x7a88('0x10')]['replaceAll']=function(_0xca8c8d,_0x5de357){return this[_0x7a88('0x9e')](_0xca8c8d)['join'](_0x5de357);};module[_0x7a88('0x1c3')]=AGIVertices; \ No newline at end of file +var _0x8ce8=['Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','intKey','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','calleridname','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agent','agentPause','agentLogout','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','google_tts_language','restAPI','url','method','timeout','includes','POST','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','stringify','render','statusMessage','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_region','aws_polly_voice','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','agicommand','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','mrcpsynth','isConfigured','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','custom_app','application','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured'];(function(_0x55dd0f,_0x5c8322){var _0x52ad28=function(_0x21e056){while(--_0x21e056){_0x55dd0f['push'](_0x55dd0f['shift']());}};_0x52ad28(++_0x5c8322);}(_0x8ce8,0xd3));var _0x88ce=function(_0x3b54e,_0x9d119){_0x3b54e=_0x3b54e-0x0;var _0x69ebae=_0x8ce8[_0x3b54e];return _0x69ebae;};'use strict';var fs=require('fs');var util=require(_0x88ce('0x0'));var _=require('lodash');var sh=require(_0x88ce('0x1'));var odbc=require(_0x88ce('0x2'))();var rs=require(_0x88ce('0x3'));var moment=require(_0x88ce('0x4'));var Mustache=require(_0x88ce('0x5'));var rp=require(_0x88ce('0x6'));var logger=require(_0x88ce('0x7'))(_0x88ce('0x8'));var config=require(_0x88ce('0x9'));var shared=require(_0x88ce('0xa'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x88ce('0xb'),_0x88ce('0xc')];var verticesWithRetry=[_0x88ce('0xd'),_0x88ce('0xe'),_0x88ce('0xf')];var AGIVertices=function(_0x5eea92,_0x48c190,_0x56d343){this[_0x88ce('0x10')]=_0x5eea92;this[_0x88ce('0x11')]=_0x48c190;this[_0x88ce('0x12')]=_0x56d343;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x14')]=function(_0x3d8ad6,_0x3e0e28){this[_0x88ce('0x11')]['getVariableById'](_0x3d8ad6)[_0x88ce('0x15')](function(_0x4cd1c0){_0x3e0e28(null,_0x4cd1c0?_0x4cd1c0[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x50b088){_0x3e0e28(_0x50b088);});};AGIVertices['prototype'][_0x88ce('0x18')]=function(_0xbc1936,_0x12e8af){this[_0x88ce('0x11')][_0x88ce('0x19')](_0xbc1936)[_0x88ce('0x15')](function(_0x242265){_0x12e8af(null,_0x242265?_0x242265['name']:![]);})[_0x88ce('0x17')](function(_0x5bcd5a){_0x12e8af(_0x5bcd5a);});};AGIVertices[_0x88ce('0x13')]['getSquareProject']=function(_0x429230,_0x2a5a86){this[_0x88ce('0x11')][_0x88ce('0x1a')](_0x429230)['then'](function(_0x50c9df){_0x2a5a86(null,_0x50c9df?_0x50c9df[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x404df9){_0x2a5a86(_0x404df9);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b')]=function(_0x37f31,_0x461a8a){this[_0x88ce('0x11')][_0x88ce('0x1c')](_0x37f31)[_0x88ce('0x15')](function(_0x106e59){_0x461a8a(null,_0x106e59?_0x106e59[_0x88ce('0x1d')]:![]);})[_0x88ce('0x17')](function(_0x397ee5){_0x461a8a(_0x397ee5);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1e')]=function(_0x4daac4,_0x356d7d){this[_0x88ce('0x11')][_0x88ce('0x1f')](_0x4daac4)[_0x88ce('0x15')](function(_0x33711e){_0x356d7d(null,_0x33711e?_0x33711e['name']:![]);})['catch'](function(_0x4dcdc4){_0x356d7d(_0x4dcdc4);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x20')]=function(_0x424b66,_0x51a894){this['rpc'][_0x88ce('0x21')](_0x424b66)[_0x88ce('0x15')](function(_0x1b9d39){_0x51a894(null,_0x1b9d39?_0x1b9d39[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x1efcea){_0x51a894(_0x1efcea);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x22')]=function(_0x19c87f,_0x40aa83){var _0x4209bc=this;this[_0x88ce('0x11')][_0x88ce('0x23')](_0x19c87f)[_0x88ce('0x15')](function(_0x12b9a1){_0x40aa83(null,_0x12b9a1?_0x4209bc[_0x88ce('0x24')](_0x12b9a1['save_name']):![]);})[_0x88ce('0x17')](function(_0x5ceb03){_0x40aa83(_0x5ceb03);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x25')]=function(_0x6ea7e0,_0x2fe609){this['rpc'][_0x88ce('0x26')](_0x6ea7e0)[_0x88ce('0x15')](function(_0x326ebe){_0x2fe609(null,_0x326ebe?_0x326ebe:![]);})[_0x88ce('0x17')](function(_0x400096){_0x2fe609(_0x400096);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x27')]=function(_0x554cff,_0x1280be,_0x34b5c4){this['mailRpc'][_0x88ce('0x27')](_0x554cff,_0x1280be)[_0x88ce('0x15')](function(){_0x34b5c4(null);})[_0x88ce('0x17')](function(_0x24fbbe){_0x34b5c4(_0x24fbbe);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x28')]=function(_0x21e585,_0x12bcfa){this[_0x88ce('0x11')]['getIntervalById'](_0x21e585)[_0x88ce('0x15')](function(_0x1da20a){if(_0x1da20a){if(_0x1da20a[_0x88ce('0x29')]){_0x12bcfa(null,[_0x1da20a['interval']]);}else{_0x12bcfa(null,_[_0x88ce('0x2a')](_0x1da20a[_0x88ce('0x2b')],'interval'));}}else{_0x12bcfa(null,![]);}})['catch'](function(_0x238142){_0x12bcfa(_0x238142);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x24')]=function(_0x1e25ca){return util[_0x88ce('0x2c')](_0x88ce('0x2d'),FILES_PATH,_0x1e25ca);};AGIVertices['prototype'][_0x88ce('0x2e')]=function(_0x94a27,_0x500ed1,_0x35c773){odbc[_0x88ce('0x2f')](_0x94a27,function(_0x55e1c4){if(_0x55e1c4){logger[_0x88ce('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x55e1c4);_0x35c773(_0x55e1c4);}else{logger[_0x88ce('0x31')](_0x88ce('0x32'));odbc[_0x88ce('0x33')](_0x500ed1,function(_0x2c2ec1,_0x378436){if(_0x2c2ec1){logger[_0x88ce('0x31')]('Error\x20executing\x20query\x20%s',_0x500ed1);_0x35c773(_0x2c2ec1);}else{logger[_0x88ce('0x31')](_0x88ce('0x34'),_0x500ed1);odbc[_0x88ce('0x35')](function(_0x24f5fa){if(_0x24f5fa){logger['error'](_0x88ce('0x36'),_0x24f5fa);}_0x35c773(null,_0x378436);});}});}});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x37')]=function(_0x4cc1c2,_0x596d4c){this[_0x88ce('0x11')][_0x88ce('0x38')](_0x4cc1c2)[_0x88ce('0x15')](function(_0x512e49){_0x596d4c(null,_0x512e49?_0x512e49:![]);})[_0x88ce('0x17')](function(_0x3f7dce){_0x596d4c(_0x3f7dce);});};AGIVertices['prototype'][_0x88ce('0x39')]=function(_0x1b99a8,_0x4709c4){this[_0x88ce('0x11')][_0x88ce('0x39')](_0x1b99a8)['then'](function(_0x14e61a){_0x4709c4(null,_0x14e61a);})[_0x88ce('0x17')](function(_0x388926){_0x4709c4(_0x388926);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x3a')]=function(_0x29d440,_0x39bfb8,_0x5ae3f9){this[_0x88ce('0x11')][_0x88ce('0x3a')]({'uniqueid':this['channel'][_0x88ce('0x3b')],'node':_0x29d440[_0x88ce('0x3c')],'application':_0x29d440['agicommand'],'data':_0x39bfb8||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')]})[_0x88ce('0x15')](function(_0x35cbf8){if(_0x5ae3f9){_0x5ae3f9(null,_0x35cbf8);}})[_0x88ce('0x17')](function(_0x20db25){if(_0x5ae3f9){_0x5ae3f9(_0x20db25);}});};AGIVertices[_0x88ce('0x13')]['createSquareRecording']=function(_0x160a6c,_0x535061,_0x2406b2,_0x10c963){this[_0x88ce('0x11')]['createSquareRecording']({'uniqueid':this[_0x88ce('0x10')]['uniqueid'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')],'calleridname':this[_0x88ce('0x10')][_0x88ce('0x3e')],'context':this[_0x88ce('0x10')][_0x88ce('0x3f')],'extension':this[_0x88ce('0x10')]['extension'],'priority':this[_0x88ce('0x10')][_0x88ce('0x40')],'accountcode':this[_0x88ce('0x10')][_0x88ce('0x41')],'dnid':this['channel']['dnid'],'projectName':this[_0x88ce('0x10')][_0x88ce('0x42')],'saveName':_0x535061,'filename':_0x160a6c[_0x88ce('0x43')]||_0x535061,'savePath':_0x2406b2})[_0x88ce('0x15')](function(_0x23967c){_0x10c963(null,_0x23967c);})[_0x88ce('0x17')](function(_0x4e4933){_0x10c963(_0x4e4933);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3471ae,_0x55cd0e,_0x5c2231,_0x47d0c7,_0x13e84f){this['rpc'][_0x88ce('0x44')]({'uniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'body':_0x3471ae,'direction':_0x55cd0e,'providerName':_0x5c2231,'providerResponse':_0x47d0c7})[_0x88ce('0x15')](function(_0x23be64){if(_0x13e84f){_0x13e84f(null,_0x23be64);}})[_0x88ce('0x17')](function(_0x5a598b){if(_0x13e84f){_0x13e84f(_0x5a598b);}});};AGIVertices['prototype'][_0x88ce('0x45')]=function(_0x39a801,_0x1c9e37){this[_0x88ce('0x11')]['createCmContact']({'firstName':_['isEmpty'](_0x39a801[_0x88ce('0x16')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x16')])?_0x88ce('0x47')+Math[_0x88ce('0x48')]():_0x39a801[_0x88ce('0x16')],'lastName':_[_0x88ce('0x49')](_0x39a801[_0x88ce('0x4a')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x4a')])?null:_0x39a801[_0x88ce('0x4a')],'phone':_0x39a801[_0x88ce('0x4b')],'ListId':_0x39a801[_0x88ce('0x4c')],'scheduledat':_0x39a801['scheduledAt'],'callbackUniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'tags':_0x88ce('0x4d'),'description':_0x88ce('0x4e')+_0x39a801[_0x88ce('0x4f')][_0x88ce('0x50')](),'priority':_0x39a801['callback_priority']})[_0x88ce('0x15')](function(_0x564f37){_0x1c9e37(null,_0x564f37);})[_0x88ce('0x17')](function(_0x3ee72d){_0x1c9e37(_0x3ee72d);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x51')]=function(_0x16778f,_0x4ab8da){this[_0x88ce('0x11')][_0x88ce('0x52')](_0x16778f)['then'](function(_0x42963f){_0x4ab8da(null,_0x42963f?_0x42963f['name']:![]);})[_0x88ce('0x17')](function(_0x3d05f3){_0x4ab8da(_0x3d05f3);});};AGIVertices[_0x88ce('0x13')]['agentPause']=function(_0x1e45cc,_0x2cc506,_0x27c25d){var _0x1988ab={'role':_0x88ce('0x53')};_0x1988ab[_0x1e45cc]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')][_0x88ce('0x54')](_0x1988ab,_0x2cc506,this['channel']['uniqueid'])[_0x88ce('0x15')](function(_0x1d213d){_0x27c25d(null,_[_0x88ce('0x46')](_0x1d213d)?![]:!![]);})['catch'](function(_0x232cc1){logger['error'](_0x232cc1);_0x27c25d(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x114888,_0x50b887){var _0xaf4625={'role':_0x88ce('0x53')};_0xaf4625[_0x114888]=this[_0x88ce('0x10')]['callerid'];this[_0x88ce('0x11')]['agentUnpause'](_0xaf4625)[_0x88ce('0x15')](function(_0x1a1af4){_0x50b887(null,_[_0x88ce('0x46')](_0x1a1af4)?![]:!![]);})[_0x88ce('0x17')](function(_0x5c6c24){logger[_0x88ce('0x30')](_0x5c6c24);_0x50b887(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x55')]=function(_0x563439,_0x590d79){var _0x5cddfd={'role':_0x88ce('0x53')};_0x5cddfd[_0x563439]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')]['agentLogout'](_0x5cddfd)['then'](function(_0x55570f){_0x590d79(null,_[_0x88ce('0x46')](_0x55570f)?![]:!![]);})[_0x88ce('0x17')](function(_0x13f59a){logger[_0x88ce('0x30')](_0x13f59a);_0x590d79(null,![]);});};AGIVertices[_0x88ce('0x13')]['agentLogin']=function(_0x495ac2,_0x2aafcc){var _0x2d360b={'role':_0x88ce('0x53')};_0x2d360b[_0x495ac2]=this[_0x88ce('0x10')][_0x88ce('0x3d')];var _0x546248=_0x495ac2!='internal'?util[_0x88ce('0x2c')](_0x88ce('0x56'),_0x88ce('0x57'),this[_0x88ce('0x10')]['callerid']):undefined;this[_0x88ce('0x11')]['agentLogin'](_0x2d360b,_0x546248)['then'](function(_0x15df5a){_0x2aafcc(null,_[_0x88ce('0x46')](_0x15df5a)?![]:!![]);})[_0x88ce('0x17')](function(_0x3b4732){logger[_0x88ce('0x30')](_0x3b4732);_0x2aafcc(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x58')]=function(_0x1f34d1,_0x41fc76){sh[_0x88ce('0x59')](_[_0x88ce('0x5a')](_0x1f34d1),function(_0x43133b,_0x19c2b2){var _0x21b65e=_0x19c2b2[_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'');_0x41fc76(null,_0x21b65e);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x5c')]=function(_0x458343,_0x13a3f6){scripts['googleCloudTTS'](_0x458343['apiKey'],_0x458343[_0x88ce('0x5d')]||_0x88ce('0x5e'),_0x458343[_0x88ce('0x5e')],_0x458343['languageCode']||_0x88ce('0x5f'),_0x458343['ssmlGender']||_0x88ce('0x60'),_0x458343[_0x88ce('0x61')]||_0x88ce('0x62'))['then'](function(_0x505097){_0x13a3f6(null,_0x505097);})['catch'](function(_0x57c372){_0x13a3f6(_0x57c372);});};AGIVertices['prototype']['googleTTS']=function(_0x3359ea,_0x28826e){scripts['googleTTS'](_0x3359ea[_0x88ce('0x5e')],_0x3359ea[_0x88ce('0x63')]||'en',0x1)[_0x88ce('0x15')](function(_0x13092e){_0x28826e(null,_0x13092e);})[_0x88ce('0x17')](function(_0x363992){_0x28826e(_0x363992);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x64')]=function(_0x1ffa58,_0x140b6e){var _0x168fd9={'uri':_0x1ffa58[_0x88ce('0x65')],'method':_0x1ffa58[_0x88ce('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1ffa58['timeout'])==='number'&&parseInt(_0x1ffa58[_0x88ce('0x67')])>=0x1?parseInt(_0x1ffa58[_0x88ce('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x88ce('0x68')]([_0x88ce('0x69'),'PUT'],_0x168fd9[_0x88ce('0x66')][_0x88ce('0x6a')]())){try{_0x168fd9[_0x88ce('0x6b')]=_0x1ffa58['rawBody']?JSON['parse'](_0x1ffa58[_0x88ce('0xc')]):{};}catch(_0x222480){logger[_0x88ce('0x30')](_0x88ce('0x6c'),_0x222480);}}try{_0x168fd9['headers']=_0x1ffa58[_0x88ce('0xb')]?JSON[_0x88ce('0x6d')](_0x1ffa58[_0x88ce('0xb')]):{};}catch(_0x9f1a8c){logger[_0x88ce('0x30')](_0x88ce('0x6e'),_0x9f1a8c);}if(_0x1ffa58[_0x88ce('0x6f')]){try{var _0x2ed8c9=require(_0x1ffa58[_0x88ce('0x6f')])[_0x88ce('0x70')](this,_0x168fd9);_0x168fd9[_0x88ce('0x71')]=Mustache['render'](_0x1ffa58[_0x88ce('0x65')],_0x2ed8c9,{},['$$','$$']);if(_0x168fd9[_0x88ce('0x72')]){_0x168fd9[_0x88ce('0x72')]=JSON[_0x88ce('0x6d')](Mustache['render'](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x72')]),_0x2ed8c9,{},['$$','$$']));}if(_0x168fd9['body']){_0x168fd9[_0x88ce('0x6b')]=JSON[_0x88ce('0x6d')](Mustache[_0x88ce('0x74')](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x6b')]),_0x2ed8c9,{},['$$','$$']));}}catch(_0x38fee5){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x38fee5);}}rp(_0x168fd9)[_0x88ce('0x15')](function(_0x11e364){var _0x49ebf5={'statusCode':_0x11e364['statusCode']||0xc8,'statusMessage':_0x11e364[_0x88ce('0x75')]||'OK','headers':_0x11e364[_0x88ce('0x72')]||{},'body':_0x11e364[_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x49ebf5);})[_0x88ce('0x17')](function(_0x226b7e){var _0x113b25={'statusCode':_0x226b7e[_0x88ce('0x76')]||0x1f4,'statusMessage':_0x226b7e[_0x88ce('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x72')]||{},'body':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x113b25);});};AGIVertices[_0x88ce('0x13')]['googleDialogflow']=function(_0x2c471c,_0x305179){scripts[_0x88ce('0x79')](this[_0x88ce('0x10')]['uniqueid'],_0x2c471c['key'],_0x2c471c[_0x88ce('0x5e')],_0x2c471c[_0x88ce('0x7a')]||'en')[_0x88ce('0x15')](function(_0x137505){_0x305179(null,_0x137505);})[_0x88ce('0x17')](function(_0x35f619){_0x305179(_0x35f619);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x7b')]=function(_0x557c55,_0x2e2e71){scripts[_0x88ce('0x7b')](this['channel']['uniqueid'],_0x557c55[_0x88ce('0x7c')],_0x557c55[_0x88ce('0x7d')],_0x557c55['private_key'],_0x557c55['text'],_0x557c55['dialogflowV2_language']||'en')[_0x88ce('0x15')](function(_0x58fdf4){_0x2e2e71(null,_0x58fdf4);})['catch'](function(_0x3e24d5){_0x2e2e71(_0x3e24d5);});};AGIVertices['prototype'][_0x88ce('0x7e')]=function(_0x466e56,_0x3ea030){scripts[_0x88ce('0x7e')](this[_0x88ce('0x10')],_0x466e56)[_0x88ce('0x15')](function(_0x2f2d2e){_0x3ea030(null,_0x2f2d2e);})['catch'](function(_0x46777b){_0x3ea030(_0x46777b);});};AGIVertices[_0x88ce('0x13')]['ispeechTTS']=function(_0xf1a87e,_0x328928){scripts[_0x88ce('0x7f')](_0xf1a87e[_0x88ce('0x80')],_0xf1a87e[_0x88ce('0x5e')],_0xf1a87e[_0x88ce('0x81')]||_0x88ce('0x5f'),_0xf1a87e['speed'])[_0x88ce('0x15')](function(_0x45f901){_0x328928(null,_0x45f901);})[_0x88ce('0x17')](function(_0x2b5f7c){_0x328928(_0x2b5f7c);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x82')]=function(_0x3d653f,_0x41a8e3,_0x567493){scripts[_0x88ce('0x82')](_0x41a8e3,_0x3d653f[_0x88ce('0x80')],_0x3d653f[_0x88ce('0x83')]||_0x88ce('0x5f'),this['isConfigured'](_0x3d653f[_0x88ce('0x84')])?_0x3d653f[_0x88ce('0x84')]:undefined)['then'](function(_0x1a7d38){_0x567493(null,_0x1a7d38);})[_0x88ce('0x17')](function(_0x1f6c73){_0x567493(_0x1f6c73);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x85')]=function(_0x59475e,_0x38a64f){scripts['awsPolly'](_0x59475e['aws_access_key_id'],_0x59475e['aws_secret_access_key'],_0x59475e[_0x88ce('0x86')],_0x59475e[_0x88ce('0x87')]||'Amy',_0x59475e[_0x88ce('0x5e')],_0x59475e['aws_text_type']||_0x88ce('0x5e'))[_0x88ce('0x15')](function(_0x8319ab){_0x38a64f(null,_0x8319ab);})[_0x88ce('0x17')](function(_0x3c4e6a){_0x38a64f(_0x3c4e6a);});};AGIVertices[_0x88ce('0x13')]['awsLex']=function(_0x44b850,_0x360e39){scripts[_0x88ce('0x88')](this['channel'][_0x88ce('0x3b')],_0x44b850['aws_access_key_id'],_0x44b850[_0x88ce('0x89')],_0x44b850[_0x88ce('0x8a')],_0x44b850[_0x88ce('0x5e')],_0x44b850[_0x88ce('0x8b')])['then'](function(_0x54a51e){_0x360e39(null,_0x54a51e);})[_0x88ce('0x17')](function(_0x336e97){_0x360e39(_0x336e97);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8c')]=function(_0x3bb1b4,_0x5b7155,_0x28152e){scripts[_0x88ce('0x8c')](_0x5b7155,_0x3bb1b4['key'],_0x3bb1b4[_0x88ce('0x8d')]||'en-US')[_0x88ce('0x15')](function(_0x30aa06){_0x28152e(null,_0x30aa06);})['catch'](function(_0x5681){_0x28152e(_0x5681);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8e')]=function(_0x1704bb,_0xda259b,_0x55d86c){scripts['tildeASR'](_0xda259b,_0x1704bb['appid'],_0x1704bb['appsecret'],_0x1704bb[_0x88ce('0x71')])['then'](function(_0x15bab7){_0x55d86c(null,_0x15bab7);})[_0x88ce('0x17')](function(_0x3911d8){_0x55d86c(_0x3911d8);});};AGIVertices['prototype']['clear']=function(_0x3ea399){var _0x4f9012=_[_0x88ce('0x68')](verticesWithRetry,_0x3ea399[_0x88ce('0x8f')])?_0x3ea399:_[_0x88ce('0x90')](_0x3ea399);for(var _0x50f74e in _0x4f9012){if(_0x4f9012['hasOwnProperty'](_0x50f74e)){if(_0x4f9012[_0x50f74e]&&_[_0x88ce('0x91')](_0x4f9012[_0x50f74e])){if(_['includes'](recursiveMapAttributes,_0x50f74e)){_0x4f9012[_0x50f74e]=this[_0x88ce('0x92')](_0x4f9012[_0x50f74e]);}else{_0x4f9012[_0x50f74e]=this[_0x88ce('0x93')](_0x4f9012[_0x50f74e]);}}}}return _0x4f9012;};AGIVertices['prototype'][_0x88ce('0x94')]=function(_0x14fc54){for(var _0x3b7b4c in _0x14fc54){if(_0x14fc54[_0x88ce('0x95')](_0x3b7b4c)){if(_[_0x88ce('0x96')](_0x14fc54[_0x3b7b4c])){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c]);}else if(_[_0x88ce('0x97')](_0x14fc54[_0x3b7b4c])){for(var _0x1c13e3=0x0;_0x1c13e3<_0x14fc54[_0x3b7b4c][_0x88ce('0x98')];_0x1c13e3++){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c][_0x1c13e3]);}}else if(_[_0x88ce('0x91')](_0x14fc54[_0x3b7b4c])){_0x14fc54[_0x3b7b4c]=this[_0x88ce('0x93')](_0x14fc54[_0x3b7b4c]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x24e70b,_0x5b1a7b){for(var _0x12de3a in _0x24e70b){if(_0x24e70b[_0x88ce('0x95')](_0x12de3a)){if(_['isPlainObject'](_0x24e70b[_0x12de3a])){if(!_['isEmpty'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a],util[_0x88ce('0x2c')](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a));}}else if(_[_0x88ce('0x97')](_0x24e70b[_0x12de3a])){for(var _0x17da67=0x0;_0x17da67<_0x24e70b[_0x12de3a][_0x88ce('0x98')];_0x17da67++){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a][_0x17da67],util['format']('%s.%s',_0x5b1a7b,_0x12de3a+'['+_0x17da67+']'));}}else{if(!_['isNil'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a),_0x24e70b[_0x12de3a]);}}}}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x92')]=function(_0x2fe52a){try{var _0x3f5878=JSON[_0x88ce('0x6d')](_0x2fe52a);this[_0x88ce('0x94')](_0x3f5878);return JSON[_0x88ce('0x73')](_0x3f5878);}catch(_0x4d85b1){return this['replaceAllVariables'](_0x2fe52a);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x93')]=function(_0xdf371b){var _0x25e4f4=_0xdf371b[_0x88ce('0x9b')]('{');for(var _0x25f0f3=0x1;_0x25f0f3<_0x25e4f4[_0x88ce('0x98')];_0x25f0f3+=0x1){var _0x4f86e1=_0x25e4f4[_0x25f0f3][_0x88ce('0x9b')]('}');if(_0x4f86e1[_0x88ce('0x98')]>0x1){_0xdf371b=_0xdf371b[_0x88ce('0x9c')]('{'+_0x4f86e1[0x0]+'}',this['channel'][_0x88ce('0x14')](_0x4f86e1[0x0])[_0x88ce('0x9d')]||_0x4f86e1[0x0]);}}if(_0x25e4f4[_0x88ce('0x98')]===0x1){return _0xdf371b[_0x88ce('0x50')]();}return this[_0x88ce('0x93')](_0xdf371b);};AGIVertices['prototype']['getAndSetVariable']=function(_0x357229,_0x2c4e01){var _0x14abcb=this[_0x88ce('0x10')]['getVariable'](_0x357229);if(_0x14abcb[_0x88ce('0x9e')]===-0x1){return _0x14abcb;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x9f'),_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]));return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]);};AGIVertices[_0x88ce('0x13')]['isConfigured']=function(_0x3de8dc){return _0x3de8dc&&_0x3de8dc!=='0'&&_0x3de8dc!=='-1'&&_0x3de8dc!=='';};AGIVertices[_0x88ce('0x13')]['maxRetry']=function(_0xa8b8e1){this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0xa8b8e1,'-');_0xa8b8e1[_0x88ce('0xa1')]=_0xa8b8e1[_0x88ce('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x88ce('0xa3')]=function(_0x23564f){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x23564f[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}var _0x189a4f='\x22'+_0x23564f[_0x88ce('0x5e')]+'\x22';if(this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x78')])){_0x189a4f+=','+_0x23564f[_0x88ce('0x78')];}var _0x261a9c=this[_0x88ce('0x10')]['exec'](_0x88ce('0xa6'),_0x189a4f);if(_0x261a9c[_0x88ce('0x9e')]===-0x1){return _0x261a9c;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x189a4f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xa7')]=function(_0x5dc0bb){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xa8'),_0x5dc0bb[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5dc0bb[_0x88ce('0xa9')])){return this['channel'][_0x88ce('0xaa')]('no\x20grammar\x20configured');}var _0xb07cef=_0x5dc0bb['grammar'];if(this['isConfigured'](_0x5dc0bb[_0x88ce('0x78')])){_0xb07cef+=','+_0x5dc0bb[_0x88ce('0x78')];}var _0xe30a6b=this[_0x88ce('0x10')][_0x88ce('0x59')]('MRCPRecog',_0xb07cef);if(_0xe30a6b[_0x88ce('0x9e')]===-0x1){return _0xe30a6b;}var _0x3195a5=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xac'));if(_0x3195a5[_0x88ce('0x9e')]===-0x1){return _0x3195a5;}var _0x3ce8af=this[_0x88ce('0xab')](_0x88ce('0xad'),'MRCP_RECOG_TRANSCRIPT');if(_0x3ce8af[_0x88ce('0x9e')]===-0x1){return _0x3ce8af;}var _0x3612f4=this['getAndSetVariable'](_0x88ce('0xae'),_0x88ce('0xaf'));if(_0x3612f4['result']===-0x1){return _0x3612f4;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0xb07cef));};AGIVertices['prototype'][_0x88ce('0x8')]=function(_0x4f5d25){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb1'),_0x4f5d25['label']));return this[_0x88ce('0x10')]['agi']([_0x4f5d25['command'],_0x4f5d25[_0x88ce('0xb2')]]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0xb3')]=function(_0x4fd795){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb4'),_0x4fd795['label']));if(this[_0x88ce('0xa4')](_0x4fd795[_0x88ce('0x67')])){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb5'),_0x4fd795[_0x88ce('0x67')]));var _0x1cda82=this[_0x88ce('0x10')][_0x88ce('0xb6')](_0x4fd795['timeout']);if(_0x1cda82['result']===-0x1){return _0x1cda82;}}return this[_0x88ce('0x10')][_0x88ce('0xb3')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x4d')]=function(_0x38d8a6){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xb7'),_0x38d8a6['label']));if(!this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0x4c')])){return this['channel'][_0x88ce('0x30')](_0x38d8a6,'no\x20list\x20selected');}_0x38d8a6['scheduledAt']=moment();if(this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0xb8')])){_0x38d8a6[_0x88ce('0x4f')]=moment()[_0x88ce('0xb9')](_0x38d8a6[_0x88ce('0xb8')],_0x88ce('0xba'));}if(!this[_0x88ce('0xa4')](_0x38d8a6['callback_priority'])){_0x38d8a6['callback_priority']=0x2;}this[_0x88ce('0x45')]['sync'](this,_0x38d8a6);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x38d8a6[_0x88ce('0x4b')],_0x38d8a6['list_id'],_0x38d8a6[_0x88ce('0x4f')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xbb')]=function(_0x192ea7){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x192ea7[_0x88ce('0x3c')]));var _0xa3b0aa=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x192ea7[_0x88ce('0xbc')],_0x192ea7[_0x88ce('0x78')]);if(_0xa3b0aa[_0x88ce('0x9e')]===-0x1){return _0xa3b0aa;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x192ea7['application'],_0x192ea7['options']));};AGIVertices['prototype'][_0x88ce('0xbd')]=function(_0x1e176d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1e176d['label']));if(!this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0xdfc61b='\x22'+_0x1e176d['text']+'\x22';if(this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x78')])){_0xdfc61b+=','+_0x1e176d[_0x88ce('0x78')];}var _0x21de38=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xa6'),_0xdfc61b);if(_0x21de38[_0x88ce('0x9e')]===-0x1){return _0x21de38;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0xdfc61b));};AGIVertices[_0x88ce('0x13')]['sestektts']=function(_0x309ab0){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xbe'),_0x309ab0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x309ab0[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0x44805b='\x22'+_0x309ab0['text']+'\x22';if(this['isConfigured'](_0x309ab0['options'])){_0x44805b+=','+_0x309ab0['options'];}var _0x2cdcc0=this[_0x88ce('0x10')]['exec']('MRCPSynth',_0x44805b);if(_0x2cdcc0[_0x88ce('0x9e')]===-0x1){return _0x2cdcc0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xbf'),_0x44805b));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc0')]=function(_0x323018){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xc1'),_0x323018['label']));if(!this[_0x88ce('0xa4')](_0x323018[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x41a612=_0x323018[_0x88ce('0xa9')];if(this['isConfigured'](_0x323018[_0x88ce('0x78')])){_0x41a612+=','+_0x323018[_0x88ce('0x78')];}var _0xd75991=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xc3'),_0x41a612);if(_0xd75991[_0x88ce('0x9e')]===-0x1){return _0xd75991;}var _0x4aaa23=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xc4'));if(_0x4aaa23[_0x88ce('0x9e')]===-0x1){return _0x4aaa23;}var _0x2e1e5a=this['getAndSetVariable'](_0x88ce('0xad'),_0x88ce('0xc5'));if(_0x2e1e5a[_0x88ce('0x9e')]===-0x1){return _0x2e1e5a;}var _0xb537f3=this[_0x88ce('0xab')](_0x88ce('0xae'),_0x88ce('0xc6'));if(_0xb537f3['result']===-0x1){return _0xb537f3;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x41a612));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc7')]=function(_0x1a9c69){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xc8'),_0x1a9c69[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1a9c69[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x4755bb=_0x1a9c69[_0x88ce('0xa9')];if(this[_0x88ce('0xa4')](_0x1a9c69['options'])){_0x4755bb+=','+_0x1a9c69[_0x88ce('0x78')];}var _0x59e549=this['channel'][_0x88ce('0x59')](_0x88ce('0xc3'),_0x4755bb);if(_0x59e549['result']===-0x1){return _0x59e549;}var _0x31041e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x88ce('0xc9'));if(_0x31041e['result']===-0x1){return _0x31041e;}var _0x705aa3=this[_0x88ce('0xab')](_0x88ce('0xad'),'SESTEK_ASR_TRANSCRIPT');if(_0x705aa3[_0x88ce('0x9e')]===-0x1){return _0x705aa3;}var _0x330326=this[_0x88ce('0xab')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x330326[_0x88ce('0x9e')]===-0x1){return _0x330326;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x4755bb));};AGIVertices['prototype']['database']=function(_0x487ec5){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xca'),_0x487ec5[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x487ec5[_0x88ce('0xcb')])){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcc'));}var _0x5275da=this[_0x88ce('0x1b')][_0x88ce('0x70')](this,_0x487ec5['odbc_id']);if(!_0x5275da){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcd'));}if(!this['isConfigured'](_0x487ec5[_0x88ce('0x33')])){return this['channel']['error'](_0x487ec5,_0x88ce('0xce'));}var _0x502487=_0x487ec5[_0x88ce('0x33')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('query:\x20%s',_0x502487));var _0x1ee1bc=this['getQueryOdbc'][_0x88ce('0x70')](this,_0x5275da,_0x502487);this['createSquareDetailsReport']['sync'](this,_0x487ec5,_0x502487);if(!this[_0x88ce('0xa4')](_0x487ec5['variable_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2c1a3f=this['getVariable'][_0x88ce('0x70')](this,_0x487ec5[_0x88ce('0xcf')]);if(!_0x2c1a3f){return this[_0x88ce('0x10')]['error'](_0x487ec5,'no\x20variable\x20found');}var _0x2bce67=this;_0x1ee1bc['forEach'](function(_0x95387d,_0xc06dd0){Object[_0x88ce('0xd0')](_0x95387d)['forEach'](function(_0x1f7194){_0x2bce67[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0xd1'),_0x2c1a3f,_0xc06dd0,_0x1f7194),_0x95387d[_0x1f7194]);});});this['channel'][_0x88ce('0xa0')](util['format']('%s_ROWS_COUNT',_0x2c1a3f),_0x1ee1bc[_0x88ce('0x98')]);return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xd2'),_0x2c1a3f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd3')]=function(_0x31f880){logger[_0x88ce('0xd4')](util[_0x88ce('0x2c')](_0x88ce('0xd5'),_0x31f880[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x31f880[_0x88ce('0xd6')])){return this['channel'][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd7'));}var _0x25dee6=this[_0x88ce('0x1e')][_0x88ce('0x70')](this,_0x31f880[_0x88ce('0xd6')]);if(!_0x25dee6){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd8'));}var _0x23e1d0=this['channel'][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')](_0x88ce('0xda'),_0x25dee6),_0x31f880[_0x88ce('0x67')],_0x31f880[_0x88ce('0xdb')],_0x31f880['url']]);if(_0x23e1d0[_0x88ce('0x9e')]===-0x1){return _0x23e1d0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xdc'),_0x88ce('0xd9')));};AGIVertices['prototype'][_0x88ce('0xdd')]=function(_0x3bd15e){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xde'),_0x3bd15e[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20text\x20configured');}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3bd15e);this[_0x88ce('0x44')](_0x3bd15e['text'],'in','','');this['channel'][_0x88ce('0xaa')](util['format']('Trying\x20Dialogflow:\x20%s',_0x3bd15e['text']));var _0x4511b0=this[_0x88ce('0x79')][_0x88ce('0x70')](this,_0x3bd15e);if(_0x4511b0){for(var _0xaf561c in _0x4511b0){if(_0x4511b0[_0x88ce('0x95')](_0xaf561c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format']('DIALOGFLOW_%s',_0xaf561c[_0x88ce('0x6a')]()),_0x4511b0[_0xaf561c]);}}this['createSquareMessage'](_0x4511b0[_0x88ce('0xe1')],'out',_0x88ce('0xdd'),'');return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe2'),_0x4511b0['speech']));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3bd15e,_0x88ce('0xe3'));};AGIVertices['prototype'][_0x88ce('0xe4')]=function(_0x3623be){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3623be[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7c')])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7d')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe5'));}if(!this[_0x88ce('0xa4')](_0x3623be['private_key'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe6'));}if(!this[_0x88ce('0xa4')](_0x3623be['dialogflowV2_language'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe7'));}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this['channel'][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3623be);this[_0x88ce('0x44')](_0x3623be[_0x88ce('0x5e')],'in','','');this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe8'),_0x3623be['text']));var _0x186327=this[_0x88ce('0x7b')][_0x88ce('0x70')](this,_0x3623be);if(_0x186327){for(var _0x2bc003 in _0x186327){if(_0x186327['hasOwnProperty'](_0x2bc003)){if(_0x2bc003!=='providerResponse'){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')](_0x88ce('0xe9'),_0x2bc003['toUpperCase']()),_0x186327[_0x2bc003]);}}}this[_0x88ce('0x44')](_0x186327[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xe4'),_0x186327[_0x88ce('0xeb')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xec'),_0x186327[_0x88ce('0xe1')]));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3623be,_0x88ce('0xed'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xee')]=function(_0x191d41){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xef'),_0x191d41[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf0')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xf1'));}if(!this['isConfigured'](_0x191d41['username'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xf2'));}if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf3')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x191d41['ndassistant_url'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x191d41);this[_0x88ce('0x44')](_0x191d41[_0x88ce('0x5e')],'in','','');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf4'),_0x191d41[_0x88ce('0x5e')]));var _0x2eaa64=this[_0x88ce('0x7e')][_0x88ce('0x70')](this,_0x191d41);if(_0x2eaa64){for(var _0x45b8e8 in _0x2eaa64){if(_0x2eaa64[_0x88ce('0x95')](_0x45b8e8)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0xf5'),_0x45b8e8['toUpperCase']()),_0x2eaa64[_0x45b8e8]);}}this[_0x88ce('0x44')](_0x2eaa64[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xee'),'');if(_0x2eaa64['audiofile']){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf6'),_0x2eaa64[_0x88ce('0xf7')]));var _0x969d32=this[_0x88ce('0x10')][_0x88ce('0xf8')](_0x2eaa64[_0x88ce('0xf7')]);try{fs[_0x88ce('0xf9')](_0x2eaa64[_0x88ce('0xf7')]+_0x88ce('0xfa'));}catch(_0xeecc16){logger[_0x88ce('0x30')](_0xeecc16);}return _0x969d32;}else{return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xfb'),_0x2eaa64['speech']));}}return this['channel'][_0x88ce('0x30')](_0x191d41,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfc')]=function(_0x40cf93){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x40cf93['label']));return this['channel'][_0x88ce('0xaa')](_0x88ce('0xfc'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfd')]=function(_0x181d7a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xfe'),_0x181d7a[_0x88ce('0x3c')]));var _0x2e041b='';if(_0x181d7a[_0x88ce('0xff')]){if(!this['isConfigured'](_0x181d7a['trunk_id'])){return this[_0x88ce('0x10')]['error'](_0x181d7a,_0x88ce('0x100'));}else{var _0x1d5553=parseInt(_0x181d7a[_0x88ce('0xff')],0xa);if(isNaN(_0x1d5553)){_0x2e041b=_0x181d7a[_0x88ce('0xff')];}else{_0x2e041b=this['getTrunk'][_0x88ce('0x70')](this,_0x181d7a[_0x88ce('0xff')]);if(!_0x2e041b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x101'));}}}}else if(_0x181d7a[_0x88ce('0x102')]){_0x2e041b=_0x181d7a[_0x88ce('0x102')];}else{return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x100'));}var _0x31e5b2=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')]('SIP/%s/%s',_0x2e041b,_0x181d7a[_0x88ce('0x4b')]),_0x181d7a[_0x88ce('0x67')],_0x181d7a[_0x88ce('0xdb')],_0x181d7a[_0x88ce('0x65')]]);if(_0x31e5b2[_0x88ce('0x9e')]===-0x1){return _0x31e5b2;}return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xdc'),'DIAL'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x103')]=function(_0x5b08a6){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x104'),_0x5b08a6[_0x88ce('0x3c')]));return this[_0x88ce('0x10')]['noop'](_0x88ce('0x103'));};AGIVertices['prototype'][_0x88ce('0xe')]=function(_0x258fcf){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x105'),_0x258fcf[_0x88ce('0x3c')]));if(_0x258fcf[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x258fcf);}_0x258fcf[_0x88ce('0xa1')]-=0x1;if(!this[_0x88ce('0xa4')](_0x258fcf['file_id'])){return this[_0x88ce('0x10')]['error'](_0x258fcf,_0x88ce('0x106'));}var _0x2e5d2c=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0x107')]);if(!_0x2e5d2c){return this[_0x88ce('0x10')]['error'](_0x258fcf,'no\x20file\x20audio\x20found');}if(!this[_0x88ce('0xa4')](_0x258fcf[_0x88ce('0xcf')])){return this[_0x88ce('0x10')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2b3edc=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x2e5d2c,_0x258fcf['response'],_0x258fcf[_0x88ce('0x109')]);var _0x1825ea=_0x2b3edc['result']?_0x2b3edc[_0x88ce('0x9e')]['toString']():'';logger['info'](_0x88ce('0x10a'),JSON['stringify'](_0x2b3edc));if(_0x2b3edc[_0x88ce('0x9e')]===-0x1){this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,_0x1825ea);return _0x2b3edc;}else if(_0x2b3edc[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea['length']>=parseInt(_0x258fcf['mindigit'])?'x':'i';}else{_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea[_0x88ce('0x98')]>=parseInt(_0x258fcf[_0x88ce('0x10b')])&&_0x1825ea[_0x88ce('0x98')]<=parseInt(_0x258fcf[_0x88ce('0x109')])?'x':'i';}var _0x2c6d44=this['getVariable'][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0xcf')]);if(!_0x2c6d44){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x258fcf,_0x88ce('0x10c'));}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c6d44,_0x1825ea);if(this['isConfigured'](_0x258fcf[_0x88ce('0x10d')])){var _0x2a9391=parseInt(_0x258fcf[_0x88ce('0x10d')],0xa);var _0x22a46f=rs[_0x88ce('0x10e')]({'charset':'*','length':_0x2a9391});var _0x3ade53=_0x1825ea['length'];if(_0x3ade53>0x0){if(_0x3ade53>_0x2a9391){this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x258fcf,_0x258fcf['hiddendigitspos']===_0x88ce('0x10f')?_0x22a46f+_0x1825ea[_0x88ce('0x110')](_0x2a9391):_0x1825ea['substr'](0x0,_0x3ade53-_0x2a9391)+_0x22a46f);}else{this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,rs[_0x88ce('0x10e')]({'charset':'*','length':_0x3ade53}));}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,'');}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,_0x1825ea);}return _0x2b3edc;};AGIVertices[_0x88ce('0x13')][_0x88ce('0xf')]=function(_0x1e749e){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x111'),_0x1e749e[_0x88ce('0x3c')]));return this['getdigits'](_0x1e749e);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x112')]=function(_0x576a33){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x576a33['label']));this['createSquareDetailsReport']['sync'](this,_0x576a33,_0x576a33[_0x88ce('0x113')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x114'),_0x576a33['goalname']));};AGIVertices['prototype'][_0x88ce('0x115')]=function(_0x5ee649){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5ee649['label']));if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x89')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x118'),_0x5ee649[_0x88ce('0x5e')]));var _0x501a5b=this['awsPolly']['sync'](this,_0x5ee649);if(_0x501a5b){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x501a5b));var _0x315805=this[_0x88ce('0x10')]['streamFile'](_0x501a5b);try{fs[_0x88ce('0xf9')](_0x501a5b+_0x88ce('0xfa'));}catch(_0x1991ff){logger[_0x88ce('0x30')](_0x1991ff);}return _0x315805;}return this['channel'][_0x88ce('0x30')](_0x5ee649,_0x88ce('0x119'));};AGIVertices[_0x88ce('0x13')]['awslex']=function(_0x59f336){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x11a'),_0x59f336['label']));if(!this['isConfigured'](_0x59f336[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x89')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x59f336['aws_bot_name'])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0x11b'));}if(!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x59f336);this[_0x88ce('0x44')](_0x59f336['text'],'in','','');this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x11c'),_0x59f336[_0x88ce('0x5e')]));var _0x5b5e08=this['awsLex'][_0x88ce('0x70')](this,_0x59f336);if(_0x5b5e08){for(var _0x34fdce in _0x5b5e08){if(_0x5b5e08[_0x88ce('0x95')](_0x34fdce)&&_[_0x88ce('0x91')](_0x5b5e08[_0x34fdce])){this['channel']['setVariable'](util['format'](_0x88ce('0x11d'),_0x34fdce[_0x88ce('0x6a')]()),_0x5b5e08[_0x34fdce]);}}if(_['isNil'](_0x5b5e08[_0x88ce('0x77')])){return this['channel'][_0x88ce('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x88ce('0x44')](_0x5b5e08['message'],_0x88ce('0xea'),_0x88ce('0x11e'),'');return this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x11f'),_0x5b5e08[_0x88ce('0x77')]));}}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x59f336,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x120')]=function(_0x5ea773){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x121'),_0x5ea773['label'],_0x5ea773[_0x88ce('0x67')]));if(!this[_0x88ce('0xa4')](_0x5ea773[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}var _0x4b2cde=_0x88ce('0x122');var _0x53e3ee=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x2ef082=util[_0x88ce('0x2c')]('%s.%s',_0x53e3ee,_0x4b2cde);var _0x4ac48b=!![];if(_0x5ea773['beep']==='NOBEEP'){_0x4ac48b=![];}var _0x2dcf45=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x53e3ee,_0x4b2cde,_0x5ea773['intKey'],_0x5ea773[_0x88ce('0x67')],undefined,_0x4ac48b);if(_0x2dcf45[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x125'),_0x2ef082));var _0x34a5bf=this[_0x88ce('0x8c')]['sync'](this,_0x5ea773,_0x2ef082);if(_0x34a5bf){for(var _0x276ae3 in _0x34a5bf){if(_0x34a5bf[_0x88ce('0x95')](_0x276ae3)){this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')]('GOOGLE_ASR_%s',_0x276ae3[_0x88ce('0x6a')]()),_0x34a5bf[_0x276ae3]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x126'),JSON[_0x88ce('0x73')](_0x34a5bf)));}}return _0x2dcf45;};AGIVertices['prototype'][_0x88ce('0x127')]=function(_0xd309b7){logger['info'](util['format'](_0x88ce('0x128'),_0xd309b7['label']));if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x129')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12a'));}if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x12b')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12c'));}var _0x407843=_0x88ce('0x122');var _0x2253f7=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x3138cb=util['format'](_0x88ce('0x9a'),_0x2253f7,_0x407843);var _0x49f19a=!![];if(_0xd309b7[_0x88ce('0x12d')]===_0x88ce('0x12e')){_0x49f19a=![];}var _0x3142b0=this['channel'][_0x88ce('0x124')](_0x2253f7,_0x407843,_0xd309b7[_0x88ce('0x12f')],_0xd309b7[_0x88ce('0x67')],undefined,_0x49f19a);if(_0x3142b0[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('tilde\x20%s\x20file\x20created',_0x3138cb));var _0x172225=this[_0x88ce('0x8e')][_0x88ce('0x70')](this,_0xd309b7,_0x3138cb);if(_0x172225){for(var _0x3bf56c in _0x172225){if(_0x172225['hasOwnProperty'](_0x3bf56c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('TILDE_ASR_%s',_0x3bf56c[_0x88ce('0x6a')]()),_0x172225[_0x3bf56c]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x88ce('0x73')](_0x172225)));}}return _0x3142b0;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x130')]=function(_0x10be63){logger['info'](util['format'](_0x88ce('0x131'),_0x10be63['label']));return this['channel'][_0x88ce('0x132')](_0x10be63[_0x88ce('0x3f')],_0x10be63[_0x88ce('0x133')],_0x10be63[_0x88ce('0x40')]);};AGIVertices[_0x88ce('0x13')]['gotoif']=function(_0x55e884){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x134'),_0x55e884['label']));if(!this[_0x88ce('0xa4')](_0x55e884['condition'])){return this['channel']['error'](_0x55e884,_0x88ce('0x135'));}try{var _0x17be65=eval(_0x55e884[_0x88ce('0x136')])?_0x88ce('0x137'):'false';this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x138'),_0x55e884[_0x88ce('0x136')],_0x17be65));return{'code':0xc8,'result':_0x17be65};}catch(_0x15bbde){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x139')]=function(_0x18b256){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x13a'),_0x18b256[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x18b256[_0x88ce('0x13b')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13c'));}var _0x1658a5=this[_0x88ce('0x28')]['sync'](this,_0x18b256[_0x88ce('0x13b')]);if(!_0x1658a5){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13d'));}for(var _0x38b7fb=0x0;_0x38b7fb<_0x1658a5[_0x88ce('0x98')];_0x38b7fb+=0x1){var _0x61078b=this[_0x88ce('0x10')][_0x88ce('0x14')](util[_0x88ce('0x2c')]('IFTIME(%s?true:false)',_0x1658a5[_0x38b7fb]));if(_0x61078b[_0x88ce('0x9e')]===-0x1){return _0x61078b;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x61078b[_0x88ce('0x9d')]));if(_0x61078b[_0x88ce('0x9d')]==='true'){logger[_0x88ce('0x31')](util['format']('IFTIME\x20%s\x20%s',_0x1658a5[_0x38b7fb],_0x88ce('0x137')));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x137')));return{'code':0xc8,'result':_0x88ce('0x137')};}else{logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));this['channel']['noop'](util['format'](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));}}return{'code':0xc8,'result':_0x88ce('0x13f')};};AGIVertices[_0x88ce('0x13')][_0x88ce('0x140')]=function(_0x56e8be){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x56e8be['label']));return this[_0x88ce('0x10')][_0x88ce('0x140')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x141')]=function(_0x5b2b86){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x142'),_0x5b2b86['label']));if(!this['isConfigured'](_0x5b2b86[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}var _0x3d026d=_0x88ce('0x122');var _0x13cfd3=util['format'](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0xd67fd3=util['format']('%s.%s',_0x13cfd3,_0x3d026d);var _0x1a61f7=!![];if(_0x5b2b86['beep']===_0x88ce('0x12e')){_0x1a61f7=![];}var _0xfcc57a=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x13cfd3,_0x3d026d,_0x5b2b86[_0x88ce('0x12f')],_0x5b2b86[_0x88ce('0x67')],undefined,_0x1a61f7);if(_0xfcc57a[_0x88ce('0x9e')]!==-0x1){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x143'),_0xd67fd3));var _0x2f3a0e=this[_0x88ce('0x82')]['sync'](this,_0x5b2b86,_0xd67fd3);if(_0x2f3a0e){for(var _0xcfa5dc in _0x2f3a0e){if(_0x2f3a0e[_0x88ce('0x95')](_0xcfa5dc)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0x144'),_0xcfa5dc[_0x88ce('0x6a')]()),_0x2f3a0e[_0xcfa5dc]);}}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x145'),JSON[_0x88ce('0x73')](_0x2f3a0e)));}}return _0xfcc57a;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x146')]=function(_0x5c0861){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x147'),_0x5c0861[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5c0861[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}if(!this[_0x88ce('0xa4')](_0x5c0861[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x148'),_0x5c0861[_0x88ce('0x5e')]));var _0x307c7e=this['ispeechTTS'][_0x88ce('0x70')](this,_0x5c0861);if(_0x307c7e){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x143'),_0x307c7e));var _0x44cb27=this['channel'][_0x88ce('0xf8')](_0x307c7e,_0x5c0861[_0x88ce('0x12f')]);try{fs[_0x88ce('0xf9')](_0x307c7e+_0x88ce('0xfa'));}catch(_0xa4ea0b){logger['error'](_0xa4ea0b);}return _0x44cb27;}return this['channel'][_0x88ce('0x30')](_0x5c0861,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0xcac372){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x149'),_0xcac372[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0xcac372[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0xcac372,_0x88ce('0x14b'));}logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));var _0x5b91a1=this[_0x88ce('0x14d')][_0x88ce('0x70')](this,_0xcac372[_0x88ce('0x14a')]);if(_0x5b91a1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this['channel'][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this['channel']['callerid'],_0xcac372[_0x88ce('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')]['callerid'],_0xcac372['findBy']));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x151')]=function(_0x3cb22a){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x152'),_0x3cb22a[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3cb22a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x3cb22a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));var _0x5cff82=this[_0x88ce('0x55')][_0x88ce('0x70')](this,_0x3cb22a['findBy']);if(_0x5cff82){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel']['callerid'],_0x3cb22a[_0x88ce('0x14a')]));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x153')]=function(_0x5ef9f0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x154'),_0x5ef9f0[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5ef9f0[_0x88ce('0x155')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x5ef9f0,_0x88ce('0x156'));}this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('math\x20%s',_0x5ef9f0[_0x88ce('0x155')]));var _0x5c18c9=eval(_0x5ef9f0[_0x88ce('0x155')]);if(!this[_0x88ce('0xa4')](_0x5ef9f0[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}var _0x389614=this['getVariable']['sync'](this,_0x5ef9f0[_0x88ce('0xcf')]);if(!_0x389614){return this['channel']['error'](_0x5ef9f0,_0x88ce('0x10c'));}if(_['isArray'](_0x5c18c9)){var _0x3dd6a7=this;_0x5c18c9['forEach'](function(_0xde52bb,_0x4f35c0){_0x3dd6a7[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x158'),_0x389614,_0x4f35c0),_0xde52bb);});return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('variable\x20%s[key]\x20set',_0x389614));}else{return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x389614,_0x5c18c9);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd')]=function(_0x17b32b){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x159'),_0x17b32b[_0x88ce('0x3c')]));if(_0x17b32b[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x17b32b);}_0x17b32b['retry']-=0x1;if(!this['isConfigured'](_0x17b32b[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x17b32b,'no\x20file\x20audio\x20selected');}var _0x48c3bd=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x17b32b['file_id']);if(!_0x48c3bd){return this['channel'][_0x88ce('0x30')](_0x17b32b,_0x88ce('0x15a'));}var _0x287b54=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x48c3bd,_0x17b32b[_0x88ce('0x15b')],_0x17b32b[_0x88ce('0x15c')]);var _0x1c4968=_0x287b54[_0x88ce('0x9e')];if(_0x287b54[_0x88ce('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x17b32b,'-1');return _0x287b54;}else if(_0x287b54[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x287b54[_0x88ce('0x9e')]=_0x287b54[_0x88ce('0x9e')][_0x88ce('0x98')]>0x0?_0x287b54['result']:'t';}else if(_[_0x88ce('0x49')](_0x287b54[_0x88ce('0x9e')])){_0x287b54['result']='#';_0x1c4968='#';}if(!this['isConfigured'](_0x17b32b[_0x88ce('0xcf')])){this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}else{var _0x1d97c5=this['getVariable'][_0x88ce('0x70')](this,_0x17b32b[_0x88ce('0xcf')]);if(!_0x1d97c5){return this[_0x88ce('0x10')]['error'](_0x17b32b,'no\x20variable\x20found');}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x1d97c5,_0x1c4968);}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x17b32b,_0x1c4968);return _0x287b54;};AGIVertices['prototype'][_0x88ce('0xaa')]=function(_0x1957b8){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x15d'),_0x1957b8[_0x88ce('0x3c')]));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x1957b8[_0x88ce('0x15e')]||_0x1957b8['label']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x15f')]=function(_0x28bc1a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x160'),_0x28bc1a['label']));if(!this[_0x88ce('0xa4')](_0x28bc1a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x28bc1a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));var _0x2229c0=this['getPause'][_0x88ce('0x70')](this,_0x28bc1a[_0x88ce('0x161')]);var _0x5b7617=this['agentPause'][_0x88ce('0x70')](this,_0x28bc1a['findBy'],_0x2229c0);if(_0x5b7617){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel'][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x163')]=function(_0x1cdc31){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1cdc31[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1cdc31[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1cdc31,_0x88ce('0x106'));}var _0x4a0b2a=this['getSound'][_0x88ce('0x70')](this,_0x1cdc31[_0x88ce('0x107')]);if(!_0x4a0b2a){return this[_0x88ce('0x10')]['error'](_0x1cdc31,_0x88ce('0x15a'));}var _0x7c3e20=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x164'),[_0x4a0b2a,_0x1cdc31[_0x88ce('0xdb')]]);if(_0x7c3e20[_0x88ce('0x9e')]===-0x1){return _0x7c3e20;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),_0x88ce('0x164'),_0x4a0b2a));};AGIVertices['prototype'][_0x88ce('0x166')]=function(_0x183354){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x183354[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x183354[_0x88ce('0x167')])){return this[_0x88ce('0x10')]['error'](_0x183354,_0x88ce('0x168'));}var _0x575b0b='';var _0x50c693=parseInt(_0x183354[_0x88ce('0x167')],0xa);if(isNaN(_0x50c693)){_0x575b0b=_0x183354[_0x88ce('0x167')];}else{_0x575b0b=this[_0x88ce('0x18')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x167')]);if(!_0x575b0b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x183354,'no\x20queue\x20found');}}var _0x2e409d='';if(this[_0x88ce('0xa4')](_0x183354[_0x88ce('0x107')])){var _0x2b8854=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x107')]);if(_0x2b8854){_0x2e409d=_0x2b8854;}}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x183354,_0x575b0b);if(_0x183354['opts'][_0x88ce('0x169')]('x')<0x0){_0x183354[_0x88ce('0xdb')]+='x';}if(_0x183354[_0x88ce('0xdb')][_0x88ce('0x169')]('X')<0x0){_0x183354[_0x88ce('0xdb')]+='X';}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x88ce('0x16a'),_0x575b0b?_0x575b0b['toLowerCase']():'');var _0x55ad01=this[_0x88ce('0x10')]['exec'](_0x88ce('0x16b'),[_0x575b0b,_0x183354[_0x88ce('0xdb')],_0x183354['url'],_0x2e409d,_0x183354[_0x88ce('0x67')],_0x183354[_0x88ce('0x8')],_0x183354[_0x88ce('0x16c')],_0x183354[_0x88ce('0x16d')],'',_0x183354['position']]);if(_0x55ad01[_0x88ce('0x9e')]===-0x1){return _0x55ad01;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x16b'),_0x575b0b));};AGIVertices[_0x88ce('0x13')]['record']=function(_0x48ea5d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x16e'),_0x48ea5d['label']));var _0x4791d1=_0x48ea5d[_0x88ce('0x16f')]||_0x88ce('0x122');var _0xe2a229=util[_0x88ce('0x2c')](_0x88ce('0x170'),this[_0x88ce('0x10')][_0x88ce('0x3b')],rs[_0x88ce('0x10e')](0x5));var _0x2f04c8=util['format'](_0x88ce('0x171'),FILES_PATH,_0xe2a229,_0x4791d1);var _0x7d7c24=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,_0xe2a229);this[_0x88ce('0x172')][_0x88ce('0x70')](this,_0x48ea5d,_0xe2a229,_0x2f04c8);this['channel'][_0x88ce('0xa0')](_0x88ce('0x173'),_0xe2a229);logger[_0x88ce('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x7d7c24,_0x4791d1,_0x48ea5d[_0x88ce('0x174')],_0x48ea5d['timeout']);return this[_0x88ce('0x10')][_0x88ce('0x124')](_0x7d7c24,_0x4791d1,_0x48ea5d['escape_digits'],_0x48ea5d['timeout'],undefined,!![]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x175')]=function(_0x1ec495){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x176'),_0x1ec495['label']));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0x65')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x177'));}var _0x5edea0=this[_0x88ce('0x64')][_0x88ce('0x70')](this,_0x1ec495);logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x178'),util[_0x88ce('0x179')](_0x5edea0,{'showHidden':![],'depth':null})));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x17a'));}var _0x313a35=this[_0x88ce('0x14')]['sync'](this,_0x1ec495[_0x88ce('0xcf')]);if(!_0x313a35){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1ec495,_0x88ce('0x10c'));}this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x17b'),_0x313a35),_0x5edea0[_0x88ce('0x76')]?_0x5edea0[_0x88ce('0x76')]:_0x88ce('0x17c'));this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('%s_STATUS_MESSAGE',_0x313a35),_0x5edea0[_0x88ce('0x75')]?_0x5edea0['statusMessage']:'OK');if(_0x5edea0[_0x88ce('0x6b')]){try{this[_0x88ce('0x99')](_0x5edea0[_0x88ce('0x6b')],_0x313a35);}catch(_0x582b56){logger[_0x88ce('0x30')](util[_0x88ce('0x2c')](_0x88ce('0x17d'),_0x313a35));}}return this['channel'][_0x88ce('0xaa')](util['format']('variable\x20%s\x20set',_0x313a35));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x17e')]=function(_0x128a56){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x128a56[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x17f')](_0x128a56[_0x88ce('0x180')][_0x88ce('0x5b')](/\s+/g,''),_0x128a56[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x181')]=function(_0xddac71){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x182'),_0xddac71['label']));return this['channel']['sayNumber'](_0xddac71[_0x88ce('0x183')]['replace'](/\s+/g,''),_0xddac71[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x184')]=function(_0x4b55af){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4b55af[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x185')](_0x4b55af[_0x88ce('0x5e')],_0x4b55af['escape_digits']);};AGIVertices['prototype'][_0x88ce('0x186')]=function(_0x5c73a0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x187'),_0x5c73a0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5c73a0['account_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x188'));}var _0x44af47=this['getMailAccount'][_0x88ce('0x70')](this,_0x5c73a0['account_id']);if(!_0x44af47||!_0x44af47[_0x88ce('0x189')]){return this[_0x88ce('0x10')]['error'](_0x5c73a0,_0x88ce('0x18a'));}var _0x331d0d={'from':util[_0x88ce('0x2c')](_0x88ce('0x18b'),_0x44af47[_0x88ce('0x16')],_0x44af47[_0x88ce('0x18c')]||_0x44af47['Smtp']['user']),'to':_0x5c73a0['to']||'','cc':_0x5c73a0['cc']||'','bcc':_0x5c73a0['bcc']||'','subject':_0x5c73a0['subject'],'html':_0x5c73a0[_0x88ce('0x5e')],'text':_0x5c73a0['text']};if(this[_0x88ce('0xa4')](_0x5c73a0[_0x88ce('0x18d')])){}logger[_0x88ce('0xd4')]('sendMail\x20message',JSON[_0x88ce('0x73')](_0x331d0d));this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x5c73a0,_0x5c73a0['account_id']);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x44af47[_0x88ce('0x16')]));this[_0x88ce('0x27')][_0x88ce('0x70')](this,_0x44af47[_0x88ce('0x18e')],_0x331d0d);return this['channel'][_0x88ce('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x18f')]=function(_0x26430a){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x26430a['label']));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x190'));};AGIVertices[_0x88ce('0x13')]['sendSMS']=function(_0x187a27){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x191'),_0x187a27['label']));if(!this[_0x88ce('0xa4')](_0x187a27[_0x88ce('0x192')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x193'));}var _0x12589e=this[_0x88ce('0x37')][_0x88ce('0x70')](this,_0x187a27['sms_account_id']);if(!_0x12589e){return this['channel']['error'](_0x187a27,'no\x20sms\x20account\x20found');}var _0xf8e6d3={'body':_0x187a27['sms_text'],'phone':_0x187a27['to']||'','SmsAccountId':_0x12589e['id']};logger[_0x88ce('0xd4')]('sendSMS\x20message',JSON[_0x88ce('0x73')](_0xf8e6d3));this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x187a27,_0x187a27[_0x88ce('0x192')]);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x194'),_0x12589e['name']));this[_0x88ce('0x39')][_0x88ce('0x70')](this,_0xf8e6d3);return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x195'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x196')]=function(_0x112e14){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x197'),_0x112e14[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x112e14[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x112e14,_0x88ce('0x198'));}var _0x15ce28=this[_0x88ce('0x14')]['sync'](this,_0x112e14['variable_id']);if(!_0x15ce28){return this[_0x88ce('0x10')]['error'](_0x112e14,_0x88ce('0x10c'));}return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x15ce28,_0x112e14['variable_value']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x199')]=function(_0x1a9e50){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x19a'),_0x1a9e50[_0x88ce('0x3c')]));this[_0x88ce('0x10')][_0x88ce('0xaa')]('START\x20CALLY\x20SQUARE');if(_0x1a9e50[_0x88ce('0xb3')]===_0x88ce('0x19b')){this[_0x88ce('0x10')]['noop']('Answer');return this[_0x88ce('0x10')][_0x88ce('0xb3')]();}return this[_0x88ce('0x10')]['noop'](_0x88ce('0x19c'));};AGIVertices[_0x88ce('0x13')]['subproject']=function(_0x274568){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x274568[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x274568[_0x88ce('0x19d')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x274568,_0x88ce('0x19e'));}var _0x245ab6=this[_0x88ce('0x19f')]['sync'](this,_0x274568[_0x88ce('0x19d')]);if(!this[_0x88ce('0xa4')](_0x245ab6)){return this[_0x88ce('0x10')]['error'](_0x274568,util[_0x88ce('0x2c')](_0x88ce('0x1a0'),_0x274568[_0x88ce('0x19d')]));}if(_0x245ab6===this['channel'][_0x88ce('0x42')]){return this['channel'][_0x88ce('0x30')](_0x274568,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x88ce('0x3a')]['sync'](this,_0x274568,_0x245ab6);var _0x937ca8=this[_0x88ce('0x10')]['exec'](_0x88ce('0x1a1'),util[_0x88ce('0x2c')](_0x88ce('0x1a2'),config[_0x88ce('0x8')][_0x88ce('0x1a3')]||_0x88ce('0x1a4'),_0x245ab6,this[_0x88ce('0x10')][_0x88ce('0x42')]));if(_0x937ca8[_0x88ce('0x9e')]===-0x1){return _0x937ca8;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x1a1'),_0x245ab6));};AGIVertices[_0x88ce('0x13')]['system']=function(_0x522655){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1a5'),_0x522655[_0x88ce('0x3c')]));var _0x88788f=this[_0x88ce('0x58')]['sync'](this,_0x522655['command']);this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x522655,_0x522655['command']);if(this[_0x88ce('0xa4')](_0x522655[_0x88ce('0xcf')])){var _0x663a5a=this[_0x88ce('0x14')]['sync'](this,_0x522655['variable_id']);if(_0x663a5a){this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x663a5a,_0x88788f);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x1a6'),_0x522655[_0x88ce('0x1a7')],_0x663a5a));}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1a8'),_0x522655['command']));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1a9')]=function(_0x47e183){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x47e183[_0x88ce('0x3c')]));_0x47e183['text']=_0x47e183[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x47e183[_0x88ce('0x1aa')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x1ab'));}if(!this[_0x88ce('0xa4')](_0x47e183[_0x88ce('0x5e')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x47e183['text']));var _0x54e2dc=this[_0x88ce('0x5c')][_0x88ce('0x70')](this,_0x47e183);if(_0x54e2dc){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x54e2dc));var _0x27774c=this['channel']['streamFile'](_0x54e2dc);try{fs['unlink'](_0x54e2dc+_0x88ce('0xfa'));}catch(_0x52cde4){logger[_0x88ce('0x30')](_0x52cde4);}return _0x27774c;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x47e183,_0x88ce('0x1ac'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1ad')]=function(_0x178ae3){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x178ae3[_0x88ce('0x3c')]));_0x178ae3[_0x88ce('0x5e')]=_0x178ae3[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x88ce('0xa4')](_0x178ae3[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1ae'),_0x178ae3['text']));var _0x404dba=this[_0x88ce('0x1af')]['sync'](this,_0x178ae3);if(_0x404dba){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x1b0'),_0x404dba));var _0x48dcef=this[_0x88ce('0x10')]['streamFile'](_0x404dba);try{fs[_0x88ce('0xf9')](_0x404dba+'.wav');}catch(_0x18f2bb){logger[_0x88ce('0x30')](_0x18f2bb);}return _0x48dcef;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x178ae3,_0x88ce('0x1b1'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b2')]=function(_0x444f24){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b3'),_0x444f24[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x444f24[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x444f24,'no\x20find\x20by\x20configured');}logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));var _0x1f9fa1=this['agentUnpause'][_0x88ce('0x70')](this,_0x444f24[_0x88ce('0x14a')]);if(_0x1f9fa1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this['channel'][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger['info'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices['prototype'][_0x88ce('0x1b4')]=function(_0x3caf95){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1b5'),_0x3caf95['label']));var _0x6f1b73=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x1b6'),[_0x3caf95['mailbox'],_0x3caf95[_0x88ce('0x78')]]);if(_0x6f1b73[_0x88ce('0x9e')]===-0x1){return _0x6f1b73;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),'VOICEMAIL',_0x3caf95[_0x88ce('0x1b7')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b8')]=function(_0x33382c){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b9'),_0x33382c[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x33382c[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x33382c,_0x88ce('0x198'));}var _0x504ee1=this[_0x88ce('0x14')][_0x88ce('0x70')](this,_0x33382c[_0x88ce('0xcf')]);if(!_0x504ee1){return this['channel'][_0x88ce('0x30')](_0x33382c,_0x88ce('0x10c'));}var _0x456973=this[_0x88ce('0x10')][_0x88ce('0x14')](_0x504ee1);return{'code':0xc8,'result':_0x456973[_0x88ce('0x9d')]?_0x456973['extra']:'-'};};String[_0x88ce('0x13')]['replaceAll']=function(_0x3a6788,_0x3f9185){return this[_0x88ce('0x9b')](_0x3a6788)[_0x88ce('0x1ba')](_0x3f9185);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4556a15..585f554 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 _0x7dd2=['lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw'];(function(_0x249227,_0x3fe6ef){var _0x29c40f=function(_0x57bf0c){while(--_0x57bf0c){_0x249227['push'](_0x249227['shift']());}};_0x29c40f(++_0x3fe6ef);}(_0x7dd2,0xd6));var _0x27dd=function(_0x3c8c63,_0x1ab21d){_0x3c8c63=_0x3c8c63-0x0;var _0x182171=_0x7dd2[_0x3c8c63];return _0x182171;};'use strict';var util=require(_0x27dd('0x0'));var _=require(_0x27dd('0x1'));var moment=require(_0x27dd('0x2'));var ami=require('../ami');var logger=require(_0x27dd('0x3'))(_0x27dd('0x4'));var RpcUser=require(_0x27dd('0x5'));var RpcVoiceAgentReport=require(_0x27dd('0x6'));function Acw(_0x3a93bb){this[_0x27dd('0x7')]=_0x3a93bb['voiceQueues'];this[_0x27dd('0x8')]=_0x3a93bb['agents'];this[_0x27dd('0x9')]=_0x3a93bb[_0x27dd('0x9')];this[_0x27dd('0xa')]={};ami['on']('agentconnect',this[_0x27dd('0xb')][_0x27dd('0xc')](this));ami['on'](_0x27dd('0xd'),this[_0x27dd('0xe')]['bind'](this));ami['on']('hangup',this[_0x27dd('0xf')][_0x27dd('0xc')](this));ami['on'](_0x27dd('0x10'),this[_0x27dd('0x11')]['bind'](this));ami['on'](_0x27dd('0x12'),this[_0x27dd('0x13')][_0x27dd('0xc')](this));ami['on'](_0x27dd('0x14'),this[_0x27dd('0x15')][_0x27dd('0xc')](this));ami['on'](_0x27dd('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x56d23c){var _0xc505ca=moment()['milliseconds'](0x0);var _0x31b5dc=moment(_0x56d23c)['milliseconds'](0x0);return _0xc505ca[_0x27dd('0x17')](_0x31b5dc,_0x27dd('0x18'));}Acw[_0x27dd('0x19')][_0x27dd('0x1a')]=function(_0x68a98f){try{var _0x282665=this;var _0x57594c=this[_0x27dd('0xa')][_0x68a98f][_0x27dd('0x1b')];var _0x2fed2a=this['channels'][_0x68a98f][_0x27dd('0x1c')];var _0x2e2f4c=this[_0x27dd('0x7')][_0x2fed2a];var _0x4e9a30=![];var _0x176d19=_0x27dd('0x1d');if(_0x2e2f4c['mandatoryDisposition']){if(_0x2e2f4c['mandatoryDispositionPause']['name']){_0x4e9a30=!![];_0x176d19=_0x2e2f4c[_0x27dd('0x1e')][_0x27dd('0x1f')];}}ami['Action']({'action':'QueuePause','interface':_0x57594c,'paused':!![],'reason':_0x176d19})[_0x27dd('0x20')](function(_0x12d72c){if(_0x282665[_0x27dd('0x8')][_0x57594c]){return RpcUser[_0x27dd('0x21')](_0x282665['agents'][_0x57594c]['id'])[_0x27dd('0x20')](function(_0x152528){if(_0x152528&&!_0x152528[_0x27dd('0x22')]){logger[_0x27dd('0x23')](_0x27dd('0x24'),_0x68a98f,_0x57594c,_0x2fed2a);var _0x7277bd=_0x282665[_0x27dd('0xa')][_0x68a98f][_0x27dd('0x25')]&&_0x282665['channels'][_0x68a98f][_0x27dd('0x26')]?_0x282665['channels'][_0x68a98f]['destlinkedid']:_0x68a98f;return RpcUser[_0x27dd('0x27')](_0x282665[_0x27dd('0x8')][_0x57594c],_0x176d19,_0x7277bd)[_0x27dd('0x20')](function(_0x39837b){if(!_0x4e9a30){_0x282665[_0x27dd('0x9')][_0x57594c]={};logger[_0x27dd('0x23')](_0x27dd('0x28'),_0x68a98f,_0x282665['voiceQueues'][_0x2fed2a][_0x27dd('0x29')],_0x57594c,_0x2fed2a);_0x282665[_0x27dd('0x9')][_0x57594c][_0x27dd('0x2a')]=setTimeout(_0x282665[_0x27dd('0x2b')][_0x27dd('0xc')](_0x282665,_0x57594c),_0x282665['voiceQueues'][_0x2fed2a][_0x27dd('0x29')]*0x3e8);_0x282665['timers'][_0x57594c][_0x27dd('0x2c')]=moment()[_0x27dd('0x2d')](_0x27dd('0x2e'));_0x282665[_0x27dd('0x9')][_0x57594c][_0x27dd('0x2f')]=_0x68a98f;_0x282665[_0x27dd('0x9')][_0x57594c][_0x27dd('0x1c')]=_0x2fed2a;_0x282665['timers'][_0x57594c][_0x27dd('0x30')]=function(){var _0x2815c2=getDiff(_0x282665[_0x27dd('0x9')][_0x57594c][_0x27dd('0x2c')]);clearTimeout(_0x282665['timers'][_0x57594c][_0x27dd('0x2a')]);_0x282665['timers'][_0x57594c]['timer']=![];RpcVoiceAgentReport[_0x27dd('0x31')]({'acwtime':_0x2815c2},_0x282665[_0x27dd('0x9')][_0x57594c]['uniqueid'],_0x57594c)[_0x27dd('0x20')](function(_0x14e1cb){logger['info'](_0x27dd('0x32'),_0x68a98f,_0x2815c2,_0x14e1cb);})[_0x27dd('0x33')](function(_0x4a253c){logger['error'](_0x27dd('0x34'),_0x68a98f,_0x4a253c);});delete _0x282665[_0x27dd('0x9')][_0x57594c];};}});}else{logger['info'](_0x27dd('0x35'),_0x68a98f,_0x57594c,_0x2fed2a);}});}})['catch'](function(_0x14d361){logger['error'](_0x27dd('0x28'),_0x68a98f,_0x282665['voiceQueues'][_0x2fed2a]['acwTimeout'],_0x57594c,_0x2fed2a);})[_0x27dd('0x36')](function(){delete _0x282665[_0x27dd('0xa')][_0x68a98f];});}catch(_0x3e5bf8){logger[_0x27dd('0x37')](_0x27dd('0x38'),_0x3e5bf8[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0x2b')]=function(_0x52e5a6){try{var _0x36fdf7=this;if(_0x36fdf7[_0x27dd('0x9')][_0x52e5a6]){_0x36fdf7[_0x27dd('0x9')][_0x52e5a6]['timer']=![];var _0x5571fd=_0x36fdf7[_0x27dd('0x9')][_0x52e5a6][_0x27dd('0x2f')];var _0x30924d=_0x36fdf7[_0x27dd('0x9')][_0x52e5a6]['queue'];var _0x482702=_0x36fdf7[_0x27dd('0x7')][_0x30924d][_0x27dd('0x29')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x5571fd,_0x52e5a6);RpcUser['saveUnpause'](this[_0x27dd('0x8')][_0x52e5a6]);RpcVoiceAgentReport[_0x27dd('0x31')]({'acwtime':_0x482702,'agentacw':!![]},_0x5571fd,_0x52e5a6)[_0x27dd('0x20')](function(_0x24ffe9){logger[_0x27dd('0x23')](_0x27dd('0x32'),_0x5571fd,_0x482702,_0x24ffe9);})[_0x27dd('0x33')](function(_0x50edb3){logger[_0x27dd('0x37')]('[%s][UPDATE][ERRORS:%s]',_0x5571fd,_0x50edb3);});}else{logger[_0x27dd('0x37')](_0x27dd('0x3a'),_0x52e5a6);if(_0x36fdf7['timers']){logger[_0x27dd('0x23')](_0x27dd('0x3b'),JSON[_0x27dd('0x3c')](_0x36fdf7[_0x27dd('0x9')]));}}}catch(_0x360f9e){logger[_0x27dd('0x37')](_0x27dd('0x3d'),_0x360f9e['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x1ab9bb){try{if(this[_0x27dd('0x7')][_0x1ab9bb[_0x27dd('0x1c')]]&&(this[_0x27dd('0x7')][_0x1ab9bb[_0x27dd('0x1c')]][_0x27dd('0x4')]||this[_0x27dd('0x7')][_0x1ab9bb['queue']][_0x27dd('0x3e')])){if(this[_0x27dd('0x8')][_0x1ab9bb['interface']]){this[_0x27dd('0xa')][_0x1ab9bb[_0x27dd('0x2f')]]={'queue':_0x1ab9bb['queue'],'interface':_0x1ab9bb['interface'],'destlinkedid':_0x1ab9bb[_0x27dd('0x26')]};}}}catch(_0x14ca54){logger[_0x27dd('0x37')](_0x27dd('0x3f'),_0x14ca54[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0x40')]=function(_0x1ae448){try{if(this['voiceQueues'][_0x1ae448['queue']]&&(this[_0x27dd('0x7')][_0x1ae448['queue']]['acw']||this[_0x27dd('0x7')][_0x1ae448[_0x27dd('0x1c')]][_0x27dd('0x3e')])){if(this[_0x27dd('0x8')][_0x1ae448[_0x27dd('0x1b')]]){this[_0x27dd('0xa')][_0x1ae448[_0x27dd('0x2f')]]={'queue':_0x1ae448[_0x27dd('0x1c')],'interface':_0x1ae448[_0x27dd('0x1b')]};}}}catch(_0x2cb136){logger[_0x27dd('0x37')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2cb136[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0xe')]=function(_0xf82ed0){try{if(this[_0x27dd('0xa')][_0xf82ed0[_0x27dd('0x2f')]]&&_[_0x27dd('0x41')](this[_0x27dd('0xa')][_0xf82ed0[_0x27dd('0x2f')]]['attended'])){logger[_0x27dd('0x23')]('[%s][HANGUP:UNIQUEID]',_0xf82ed0[_0x27dd('0x2f')]);this['startAcw'](_0xf82ed0[_0x27dd('0x2f')]);}else if(this[_0x27dd('0xa')][_0xf82ed0[_0x27dd('0x42')]]&&_['isUndefined'](this[_0x27dd('0xa')][_0xf82ed0['linkedid']][_0x27dd('0x25')])){logger[_0x27dd('0x23')](_0x27dd('0x43'),_0xf82ed0[_0x27dd('0x42')]);this[_0x27dd('0x1a')](_0xf82ed0[_0x27dd('0x42')]);}}catch(_0x290b31){logger[_0x27dd('0x37')](_0x27dd('0x44'),_0x290b31[_0x27dd('0x39')]);}};Acw['prototype']['syncHangup']=function(_0x13af11){try{if(this[_0x27dd('0xa')][_0x13af11['uniqueid']]&&this['channels'][_0x13af11[_0x27dd('0x2f')]][_0x27dd('0x25')]){logger[_0x27dd('0x23')](_0x27dd('0x45'),_0x13af11[_0x27dd('0x2f')]);this['startAcw'](_0x13af11[_0x27dd('0x2f')]);}else if(this['channels'][_0x13af11[_0x27dd('0x42')]]&&this[_0x27dd('0xa')][_0x13af11[_0x27dd('0x42')]]['attended']){logger[_0x27dd('0x23')](_0x27dd('0x46'),_0x13af11[_0x27dd('0x42')]);this[_0x27dd('0x1a')](_0x13af11[_0x27dd('0x42')]);}}catch(_0x592814){logger[_0x27dd('0x37')](_0x27dd('0x47'),_0x592814[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0x13')]=function(_0xe4bb06){try{if(!_[_0x27dd('0x48')](this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x49')]])){this[_0x27dd('0x1a')](_0xe4bb06['transfereeuniqueid']);if(this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4a')]]){this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4a')]][_0x27dd('0x25')]=!![];this['channels'][_0xe4bb06[_0x27dd('0x4b')]]=this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4a')]];delete this[_0x27dd('0xa')][_0xe4bb06['secondtransfereruniqueid']];}}else if(!_[_0x27dd('0x48')](this[_0x27dd('0xa')][_0xe4bb06['transfertargetuniqueid']])){this[_0x27dd('0x1a')](_0xe4bb06[_0x27dd('0x4b')]);if(this['channels'][_0xe4bb06['origtransfereruniqueid']]){this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4c')]][_0x27dd('0x25')]=!![];this['channels'][_0xe4bb06[_0x27dd('0x49')]]=this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4c')]];delete this[_0x27dd('0xa')][_0xe4bb06[_0x27dd('0x4c')]];}}}catch(_0xa3b85b){logger[_0x27dd('0x37')](_0x27dd('0x4d'),_0xa3b85b[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0x15')]=function(_0x48a9f7){try{if(this[_0x27dd('0xa')][_0x48a9f7[_0x27dd('0x4e')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x27dd('0x3c')](_0x48a9f7[_0x27dd('0x4e')]));this[_0x27dd('0x1a')](_0x48a9f7[_0x27dd('0x4e')]);}else if(this['channels'][_0x48a9f7[_0x27dd('0x4f')]]){logger[_0x27dd('0x23')](_0x27dd('0x50'),JSON['stringify'](_0x48a9f7['transfererlinkedid']));this[_0x27dd('0x1a')](_0x48a9f7[_0x27dd('0x4f')]);}}catch(_0x1ec578){logger['error'](_0x27dd('0x51'),_0x1ec578[_0x27dd('0x39')]);}};Acw['prototype'][_0x27dd('0x11')]=function(_0x4e9b89){try{if(this[_0x27dd('0x7')][_0x4e9b89['queue']]&&this[_0x27dd('0x7')][_0x4e9b89[_0x27dd('0x1c')]]['autopause']===_0x27dd('0x52')){if(this[_0x27dd('0x8')][_0x4e9b89[_0x27dd('0x1b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4e9b89['uniqueid'],_0x4e9b89[_0x27dd('0x1b')],_0x4e9b89[_0x27dd('0x1c')]);return RpcUser[_0x27dd('0x27')](this['agents'][_0x4e9b89[_0x27dd('0x1b')]],_0x27dd('0x53'),_0x4e9b89[_0x27dd('0x2f')]);}}}catch(_0x398ac8){logger[_0x27dd('0x37')](_0x27dd('0x54'),_0x398ac8[_0x27dd('0x39')]);}};module[_0x27dd('0x55')]=Acw; \ No newline at end of file +var _0x93f5=['queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','uniqueid','[%s][TIMER][STOP][AGENT:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','linkedid','isUndefined','attended','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','interface'];(function(_0x2e1cbe,_0x19aee7){var _0x2f77bc=function(_0x2478e7){while(--_0x2478e7){_0x2e1cbe['push'](_0x2e1cbe['shift']());}};_0x2f77bc(++_0x19aee7);}(_0x93f5,0x180));var _0x593f=function(_0x2fa5fa,_0x4f7d6e){_0x2fa5fa=_0x2fa5fa-0x0;var _0x31b95c=_0x93f5[_0x2fa5fa];return _0x31b95c;};'use strict';var util=require(_0x593f('0x0'));var _=require(_0x593f('0x1'));var moment=require('moment');var ami=require(_0x593f('0x2'));var logger=require(_0x593f('0x3'))(_0x593f('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x593f('0x5'));function Acw(_0xd70635){this[_0x593f('0x6')]=_0xd70635[_0x593f('0x6')];this[_0x593f('0x7')]=_0xd70635[_0x593f('0x7')];this[_0x593f('0x8')]=_0xd70635[_0x593f('0x8')];this[_0x593f('0x9')]={};ami['on'](_0x593f('0xa'),this[_0x593f('0xb')][_0x593f('0xc')](this));ami['on'](_0x593f('0xd'),this[_0x593f('0xe')]['bind'](this));ami['on']('hangup',this[_0x593f('0xf')][_0x593f('0xc')](this));ami['on'](_0x593f('0x10'),this['syncAgentRingNoAnswer'][_0x593f('0xc')](this));ami['on'](_0x593f('0x11'),this['syncAttendedTransfer'][_0x593f('0xc')](this));ami['on'](_0x593f('0x12'),this[_0x593f('0x13')][_0x593f('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0x593f('0x14')][_0x593f('0xc')](this));}function getDiff(_0x28f14d){var _0x5600bc=moment()[_0x593f('0x15')](0x0);var _0x353a8d=moment(_0x28f14d)[_0x593f('0x15')](0x0);return _0x5600bc[_0x593f('0x16')](_0x353a8d,'seconds');}Acw[_0x593f('0x17')][_0x593f('0x18')]=function(_0x2a2a0b){try{var _0x39a3b7=this;var _0x1ab659=this[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x19')];var _0x331615=this[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x1a')];var _0x40bfe0=this['voiceQueues'][_0x331615];var _0x5e00b6=![];var _0x277fc9=_0x593f('0x1b');if(_0x40bfe0[_0x593f('0x1c')]){if(_0x40bfe0[_0x593f('0x1d')][_0x593f('0x1e')]){_0x5e00b6=!![];_0x277fc9=_0x40bfe0['mandatoryDispositionPause']['name'];}}ami[_0x593f('0x1f')]({'action':_0x593f('0x20'),'interface':_0x1ab659,'paused':!![],'reason':_0x277fc9})[_0x593f('0x21')](function(_0x346fcd){if(_0x39a3b7['agents'][_0x1ab659]){return RpcUser['getAgent'](_0x39a3b7['agents'][_0x1ab659]['id'])[_0x593f('0x21')](function(_0x447998){if(_0x447998&&!_0x447998[_0x593f('0x22')]){logger[_0x593f('0x23')](_0x593f('0x24'),_0x2a2a0b,_0x1ab659,_0x331615);var _0x3dc45f=_0x39a3b7['channels'][_0x2a2a0b]['attended']&&_0x39a3b7[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x25')]?_0x39a3b7[_0x593f('0x9')][_0x2a2a0b]['destlinkedid']:_0x2a2a0b;return RpcUser['savePause'](_0x39a3b7[_0x593f('0x7')][_0x1ab659],_0x277fc9,_0x3dc45f)[_0x593f('0x21')](function(_0x1b09ab){if(!_0x5e00b6){_0x39a3b7[_0x593f('0x8')][_0x1ab659]={};logger[_0x593f('0x23')](_0x593f('0x26'),_0x2a2a0b,_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')],_0x1ab659,_0x331615);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x28')]=setTimeout(_0x39a3b7[_0x593f('0x29')]['bind'](_0x39a3b7,_0x1ab659),_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')]*0x3e8);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x2a')]=moment()[_0x593f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a3b7['timers'][_0x1ab659]['uniqueid']=_0x2a2a0b;_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x1a')]=_0x331615;_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x2c')]=function(){var _0x1f39d2=getDiff(_0x39a3b7['timers'][_0x1ab659][_0x593f('0x2a')]);clearTimeout(_0x39a3b7['timers'][_0x1ab659]['timer']);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x28')]=![];RpcVoiceAgentReport[_0x593f('0x2d')]({'acwtime':_0x1f39d2},_0x39a3b7[_0x593f('0x8')][_0x1ab659]['uniqueid'],_0x1ab659)['then'](function(_0x200c89){logger[_0x593f('0x23')](_0x593f('0x2e'),_0x2a2a0b,_0x1f39d2,_0x200c89);})[_0x593f('0x2f')](function(_0x177def){logger[_0x593f('0x30')](_0x593f('0x31'),_0x2a2a0b,_0x177def);});delete _0x39a3b7[_0x593f('0x8')][_0x1ab659];};}});}else{logger[_0x593f('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a2a0b,_0x1ab659,_0x331615);}});}})[_0x593f('0x2f')](function(_0x30eac5){logger[_0x593f('0x30')](_0x593f('0x26'),_0x2a2a0b,_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')],_0x1ab659,_0x331615);})[_0x593f('0x32')](function(){delete _0x39a3b7[_0x593f('0x9')][_0x2a2a0b];});}catch(_0x352ae6){logger['error'](_0x593f('0x33'),_0x352ae6[_0x593f('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x397062){try{var _0x2f0b0b=this;if(_0x2f0b0b['timers'][_0x397062]){_0x2f0b0b[_0x593f('0x8')][_0x397062][_0x593f('0x28')]=![];var _0x1cfc75=_0x2f0b0b['timers'][_0x397062][_0x593f('0x35')];var _0x150f97=_0x2f0b0b[_0x593f('0x8')][_0x397062][_0x593f('0x1a')];var _0x402741=_0x2f0b0b['voiceQueues'][_0x150f97][_0x593f('0x27')];logger[_0x593f('0x23')](_0x593f('0x36'),_0x1cfc75,_0x397062);RpcUser['saveUnpause'](this[_0x593f('0x7')][_0x397062]);RpcVoiceAgentReport['update']({'acwtime':_0x402741,'agentacw':!![]},_0x1cfc75,_0x397062)[_0x593f('0x21')](function(_0x31edfc){logger[_0x593f('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1cfc75,_0x402741,_0x31edfc);})[_0x593f('0x2f')](function(_0x5390eb){logger[_0x593f('0x30')](_0x593f('0x31'),_0x1cfc75,_0x5390eb);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x397062);if(_0x2f0b0b['timers']){logger[_0x593f('0x23')](_0x593f('0x37'),JSON['stringify'](_0x2f0b0b[_0x593f('0x8')]));}}}catch(_0x22ff47){logger[_0x593f('0x30')](_0x593f('0x38'),_0x22ff47[_0x593f('0x34')]);}};Acw[_0x593f('0x17')][_0x593f('0xb')]=function(_0x5428cf){try{if(this['voiceQueues'][_0x5428cf[_0x593f('0x1a')]]&&(this['voiceQueues'][_0x5428cf[_0x593f('0x1a')]]['acw']||this[_0x593f('0x6')][_0x5428cf[_0x593f('0x1a')]][_0x593f('0x1c')])){if(this[_0x593f('0x7')][_0x5428cf[_0x593f('0x19')]]){this['channels'][_0x5428cf[_0x593f('0x35')]]={'queue':_0x5428cf[_0x593f('0x1a')],'interface':_0x5428cf['interface'],'destlinkedid':_0x5428cf[_0x593f('0x25')]};}}}catch(_0x134cc3){logger[_0x593f('0x30')](_0x593f('0x39'),_0x134cc3[_0x593f('0x34')]);}};Acw[_0x593f('0x17')]['syncAgentConnectPreview']=function(_0x5ce4b6){try{if(this['voiceQueues'][_0x5ce4b6[_0x593f('0x1a')]]&&(this[_0x593f('0x6')][_0x5ce4b6[_0x593f('0x1a')]][_0x593f('0x4')]||this[_0x593f('0x6')][_0x5ce4b6[_0x593f('0x1a')]][_0x593f('0x1c')])){if(this['agents'][_0x5ce4b6[_0x593f('0x19')]]){this[_0x593f('0x9')][_0x5ce4b6[_0x593f('0x35')]]={'queue':_0x5ce4b6[_0x593f('0x1a')],'interface':_0x5ce4b6['interface']};}}}catch(_0x2cf030){logger[_0x593f('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2cf030[_0x593f('0x34')]);}};Acw['prototype'][_0x593f('0xe')]=function(_0x360447){try{if(this['channels'][_0x360447[_0x593f('0x35')]]&&_['isUndefined'](this[_0x593f('0x9')][_0x360447[_0x593f('0x35')]]['attended'])){logger[_0x593f('0x23')]('[%s][HANGUP:UNIQUEID]',_0x360447['uniqueid']);this[_0x593f('0x18')](_0x360447[_0x593f('0x35')]);}else if(this[_0x593f('0x9')][_0x360447[_0x593f('0x3a')]]&&_[_0x593f('0x3b')](this[_0x593f('0x9')][_0x360447[_0x593f('0x3a')]][_0x593f('0x3c')])){logger[_0x593f('0x23')]('[%s][HANGUP:LINKEDID]',_0x360447[_0x593f('0x3a')]);this[_0x593f('0x18')](_0x360447[_0x593f('0x3a')]);}}catch(_0x4eae79){logger[_0x593f('0x30')](_0x593f('0x3d'),_0x4eae79[_0x593f('0x34')]);}};Acw[_0x593f('0x17')][_0x593f('0xf')]=function(_0xeb4e5e){try{if(this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x35')]]&&this['channels'][_0xeb4e5e[_0x593f('0x35')]][_0x593f('0x3c')]){logger[_0x593f('0x23')](_0x593f('0x3e'),_0xeb4e5e[_0x593f('0x35')]);this[_0x593f('0x18')](_0xeb4e5e[_0x593f('0x35')]);}else if(this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x3a')]]&&this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x3a')]][_0x593f('0x3c')]){logger[_0x593f('0x23')](_0x593f('0x3f'),_0xeb4e5e[_0x593f('0x3a')]);this[_0x593f('0x18')](_0xeb4e5e[_0x593f('0x3a')]);}}catch(_0x217aec){logger[_0x593f('0x30')](_0x593f('0x40'),_0x217aec['message']);}};Acw['prototype'][_0x593f('0x41')]=function(_0x5450bd){try{if(!_[_0x593f('0x42')](this['channels'][_0x5450bd['transfereeuniqueid']])){this[_0x593f('0x18')](_0x5450bd['transfereeuniqueid']);if(this[_0x593f('0x9')][_0x5450bd['secondtransfereruniqueid']]){this['channels'][_0x5450bd[_0x593f('0x43')]][_0x593f('0x3c')]=!![];this[_0x593f('0x9')][_0x5450bd[_0x593f('0x44')]]=this[_0x593f('0x9')][_0x5450bd[_0x593f('0x43')]];delete this[_0x593f('0x9')][_0x5450bd[_0x593f('0x43')]];}}else if(!_['isNil'](this[_0x593f('0x9')][_0x5450bd[_0x593f('0x44')]])){this[_0x593f('0x18')](_0x5450bd[_0x593f('0x44')]);if(this[_0x593f('0x9')][_0x5450bd[_0x593f('0x45')]]){this[_0x593f('0x9')][_0x5450bd[_0x593f('0x45')]][_0x593f('0x3c')]=!![];this[_0x593f('0x9')][_0x5450bd['transfereeuniqueid']]=this['channels'][_0x5450bd[_0x593f('0x45')]];delete this['channels'][_0x5450bd['origtransfereruniqueid']];}}}catch(_0x21652f){logger[_0x593f('0x30')](_0x593f('0x46'),_0x21652f['message']);}};Acw[_0x593f('0x17')][_0x593f('0x13')]=function(_0x243609){try{if(this['channels'][_0x243609[_0x593f('0x47')]]){logger['info'](_0x593f('0x48'),JSON['stringify'](_0x243609['transfereruniqueid']));this[_0x593f('0x18')](_0x243609['transfereruniqueid']);}else if(this[_0x593f('0x9')][_0x243609[_0x593f('0x49')]]){logger[_0x593f('0x23')](_0x593f('0x4a'),JSON[_0x593f('0x4b')](_0x243609[_0x593f('0x49')]));this[_0x593f('0x18')](_0x243609[_0x593f('0x49')]);}}catch(_0x4639ce){logger[_0x593f('0x30')](_0x593f('0x4c'),_0x4639ce[_0x593f('0x34')]);}};Acw[_0x593f('0x17')]['syncAgentRingNoAnswer']=function(_0x4cd8bc){try{if(this[_0x593f('0x6')][_0x4cd8bc[_0x593f('0x1a')]]&&this[_0x593f('0x6')][_0x4cd8bc[_0x593f('0x1a')]][_0x593f('0x4d')]===_0x593f('0x4e')){if(this[_0x593f('0x7')][_0x4cd8bc[_0x593f('0x19')]]){logger[_0x593f('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4cd8bc[_0x593f('0x35')],_0x4cd8bc[_0x593f('0x19')],_0x4cd8bc[_0x593f('0x1a')]);return RpcUser[_0x593f('0x4f')](this['agents'][_0x4cd8bc[_0x593f('0x19')]],'Auto-Pause',_0x4cd8bc[_0x593f('0x35')]);}}}catch(_0x52f5ea){logger[_0x593f('0x30')](_0x593f('0x50'),_0x52f5ea[_0x593f('0x34')]);}};module[_0x593f('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3edeb40..c89390c 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x2228af,_0x266461){var _0x1746de=function(_0x5db8bd){while(--_0x5db8bd){_0x2228af['push'](_0x2228af['shift']());}};_0x1746de(++_0x266461);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xb7e7[_0x4243a3];return _0x1b2a33;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x49b3be,_0x4e68b9){var _0x1081ea=function(_0x2f0e6c){while(--_0x2f0e6c){_0x49b3be['push'](_0x49b3be['shift']());}};_0x1081ea(++_0x4e68b9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2ad03a2..3af7f41 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0xfb4fb7,_0x266515){var _0x57b6b6=function(_0x1554bd){while(--_0x1554bd){_0xfb4fb7['push'](_0xfb4fb7['shift']());}};_0x57b6b6(++_0x266515);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x426897,_0x5bd64c){_0x426897=_0x426897-0x0;var _0x51a632=_0x9ffd[_0x426897];return _0x51a632;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb7e7[_0x4e6ae6];return _0x23c108;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 2660c33..df394e5 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x004e=['idHopper','ContactFirstName','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','getQueue','exports','util','isNil','string','uniqueid','name','phone','Contact','lastName','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x3713b1,_0x4a406d){var _0x4b57e3=function(_0x5c4815){while(--_0x5c4815){_0x3713b1['push'](_0x3713b1['shift']());}};_0x4b57e3(++_0x4a406d);}(_0x004e,0x1eb));var _0xe004=function(_0x13504c,_0x3410dd){_0x13504c=_0x13504c-0x0;var _0x46bbe5=_0x004e[_0x13504c];return _0x46bbe5;};'use strict';var util=require(_0xe004('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3d4d65,_0x57d31e,_0x3de6d3){var _0x2d7f4d='';if(!_[_0xe004('0x1')](_0x57d31e)&&_0xe004('0x2')===typeof _0x57d31e){_0x2d7f4d+=_0x57d31e;}if(!_['isNil'](_0x3de6d3)&&_0xe004('0x2')===typeof _0x3de6d3){_0x2d7f4d+='\x20'+_0x3de6d3;}if(_0x2d7f4d!==''){return _0x2d7f4d;}return _0x3d4d65;}function Action(_0x48f27e,_0x2a00c3,_0x33881a){this['voiceQueue']=_0x48f27e;this[_0xe004('0x3')]=_0x33881a||undefined;this[_0xe004('0x4')]=checkNameSurname(_0x2a00c3['Contact'][_0xe004('0x5')],_0x2a00c3[_0xe004('0x6')]['firstName'],_0x2a00c3[_0xe004('0x6')][_0xe004('0x7')]);this['number']=_0x2a00c3[_0xe004('0x5')];this[_0xe004('0x8')]=_0x48f27e[_0xe004('0x4')];this['active']=_0x2a00c3[_0xe004('0x9')]||![];this[_0xe004('0xa')]=_0x48f27e[_0xe004('0xa')];this['dialQueueTimeout']=_0x48f27e[_0xe004('0xb')]||0x3;this[_0xe004('0xc')]=_0x2a00c3[_0xe004('0xc')];this['countbusyretry']=_0x2a00c3['countbusyretry'];this['countcongestionretry']=_0x2a00c3[_0xe004('0xd')];this[_0xe004('0xe')]=_0x2a00c3[_0xe004('0xe')];this[_0xe004('0xf')]=_0x2a00c3[_0xe004('0xf')];this[_0xe004('0x10')]=_0x2a00c3[_0xe004('0x10')];this['countabandonedretry']=_0x2a00c3[_0xe004('0x11')];this['countmachineretry']=_0x2a00c3[_0xe004('0x12')];this['countagentrejectretry']=_0x2a00c3[_0xe004('0x13')];this[_0xe004('0x14')]=_0x2a00c3['ContactId'];this['ListId']=_0x2a00c3[_0xe004('0x15')];this['UserId']=_0x2a00c3[_0xe004('0x16')];this['VoiceQueueId']=_0x2a00c3[_0xe004('0x17')];this[_0xe004('0x18')]=_0x2a00c3['CampaignId'];this[_0xe004('0x19')]=_0x2a00c3['id'];this[_0xe004('0x1a')]=_0x2a00c3[_0xe004('0x6')][_0xe004('0x1b')]||'';this[_0xe004('0x1c')]=moment()[_0xe004('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe004('0x1e')]=_0x2a00c3['callback'];this['callbackuniqueid']=_0x2a00c3[_0xe004('0x1f')];this['callbackat']=_0x2a00c3[_0xe004('0x20')];this[_0xe004('0x21')]=_0x2a00c3[_0xe004('0x21')];this[_0xe004('0x22')]='';this[_0xe004('0x23')]='';}Action['prototype'][_0xe004('0x24')]=function(){return util[_0xe004('0x1d')](_0xe004('0x25'),this[_0xe004('0x4')],this[_0xe004('0x26')][_0xe004('0x27')]>0x0?this[_0xe004('0x28')]['substring'](this[_0xe004('0x26')][_0xe004('0x27')]):this[_0xe004('0x28')]);};Action['prototype'][_0xe004('0x29')]=function(){return this['queue'];};module[_0xe004('0x2a')]=Action; \ No newline at end of file +var _0x611a=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','queue','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x1ff385,_0x2f30bb){var _0x563380=function(_0x1022dc){while(--_0x1022dc){_0x1ff385['push'](_0x1ff385['shift']());}};_0x563380(++_0x2f30bb);}(_0x611a,0x1ed));var _0xa611=function(_0x2738c3,_0x3487f1){_0x2738c3=_0x2738c3-0x0;var _0x4e6018=_0x611a[_0x2738c3];return _0x4e6018;};'use strict';var util=require(_0xa611('0x0'));var _=require('lodash');var moment=require(_0xa611('0x1'));function checkNameSurname(_0x4937d1,_0x24b937,_0x17a083){var _0x580604='';if(!_[_0xa611('0x2')](_0x24b937)&&_0xa611('0x3')===typeof _0x24b937){_0x580604+=_0x24b937;}if(!_[_0xa611('0x2')](_0x17a083)&&_0xa611('0x3')===typeof _0x17a083){_0x580604+='\x20'+_0x17a083;}if(_0x580604!==''){return _0x580604;}return _0x4937d1;}function Action(_0x3e9384,_0x3a5e01,_0x7cbf96){this[_0xa611('0x4')]=_0x3e9384;this[_0xa611('0x5')]=_0x7cbf96||undefined;this[_0xa611('0x6')]=checkNameSurname(_0x3a5e01[_0xa611('0x7')][_0xa611('0x8')],_0x3a5e01[_0xa611('0x7')][_0xa611('0x9')],_0x3a5e01[_0xa611('0x7')]['lastName']);this[_0xa611('0xa')]=_0x3a5e01['phone'];this['queue']=_0x3e9384['name'];this[_0xa611('0xb')]=_0x3a5e01['active']||![];this[_0xa611('0xc')]=_0x3e9384['type'];this[_0xa611('0xd')]=_0x3e9384[_0xa611('0xd')]||0x3;this[_0xa611('0xe')]=_0x3a5e01[_0xa611('0xe')];this['countbusyretry']=_0x3a5e01[_0xa611('0xf')];this[_0xa611('0x10')]=_0x3a5e01[_0xa611('0x10')];this[_0xa611('0x11')]=_0x3a5e01[_0xa611('0x11')];this['countnosuchnumberretry']=_0x3a5e01[_0xa611('0x12')];this['countdropretry']=_0x3a5e01['countdropretry'];this['countabandonedretry']=_0x3a5e01['countabandonedretry'];this[_0xa611('0x13')]=_0x3a5e01[_0xa611('0x13')];this[_0xa611('0x14')]=_0x3a5e01[_0xa611('0x14')];this['ContactId']=_0x3a5e01[_0xa611('0x15')];this['ListId']=_0x3a5e01[_0xa611('0x16')];this['UserId']=_0x3a5e01[_0xa611('0x17')];this[_0xa611('0x18')]=_0x3a5e01[_0xa611('0x18')];this[_0xa611('0x19')]=_0x3a5e01[_0xa611('0x19')];this[_0xa611('0x1a')]=_0x3a5e01['id'];this[_0xa611('0x1b')]=_0x3a5e01[_0xa611('0x7')]['firstName']||'';this[_0xa611('0x1c')]=moment()[_0xa611('0x1d')](_0xa611('0x1e'));this['callback']=_0x3a5e01[_0xa611('0x1f')];this[_0xa611('0x20')]=_0x3a5e01[_0xa611('0x20')];this[_0xa611('0x21')]=_0x3a5e01['callbackat'];this[_0xa611('0x22')]=_0x3a5e01[_0xa611('0x22')];this[_0xa611('0x23')]='';this[_0xa611('0x24')]='';}Action['prototype'][_0xa611('0x25')]=function(){return util['format'](_0xa611('0x26'),this[_0xa611('0x6')],this['voiceQueue'][_0xa611('0x27')]>0x0?this[_0xa611('0xa')][_0xa611('0x28')](this['voiceQueue'][_0xa611('0x27')]):this[_0xa611('0xa')]);};Action[_0xa611('0x29')]['getQueue']=function(){return this[_0xa611('0x2a')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f4690e6..9b2a21c 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4260=['responsetime','answertime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4260,0x98));var _0x0426=function(_0x2beb3a,_0x556859){_0x2beb3a=_0x2beb3a-0x0;var _0x2b1c90=_0x4260[_0x2beb3a];return _0x2b1c90;};'use strict';var util=require(_0x0426('0x0'));var _=require(_0x0426('0x1'));var moment=require(_0x0426('0x2'));function getSeconds(_0x3fa3d8,_0x376ca8){var _0x15d269=moment(_0x3fa3d8)[_0x0426('0x3')](0x0);var _0x4b3b7d=moment(_0x376ca8)[_0x0426('0x3')](0x0);return _0x15d269[_0x0426('0x4')](_0x4b3b7d,'seconds');}function AgentComplete(_0x66df95,_0x8f2e0b){this['state']=0x4;this[_0x0426('0x5')]='Answer';this[_0x0426('0x6')]=_0x66df95[_0x0426('0x6')];this[_0x0426('0x7')]=_0x66df95[_0x0426('0x7')];this[_0x0426('0x8')]=_0x66df95[_0x0426('0x7')]===_0x0426('0x9')?_0x0426('0xa'):_0x66df95[_0x0426('0x7')];this['countbusyretry']=_0x66df95[_0x0426('0xb')];this['countcongestionretry']=_0x66df95[_0x0426('0xc')];this[_0x0426('0xd')]=_0x66df95['countnoanswerretry'];this['countglobal']=_0x66df95[_0x0426('0xb')]+_0x66df95[_0x0426('0xc')]+_0x66df95[_0x0426('0xd')]+_0x66df95[_0x0426('0xe')]+_0x66df95[_0x0426('0xf')]+_0x66df95[_0x0426('0x10')]+_0x66df95[_0x0426('0x11')]+_0x66df95['countagentrejectretry'];this[_0x0426('0xe')]=_0x66df95[_0x0426('0xe')];this['countdropretry']=_0x66df95['countdropretry'];this[_0x0426('0x10')]=_0x66df95['countabandonedretry'];this[_0x0426('0x11')]=_0x66df95[_0x0426('0x11')];this[_0x0426('0x12')]=_0x66df95[_0x0426('0x12')];this[_0x0426('0x13')]=_0x8f2e0b['uniqueid'];this[_0x0426('0x14')]=_0x66df95['name'];this[_0x0426('0x15')]=_0x66df95[_0x0426('0x16')];this[_0x0426('0x17')]=_0x66df95[_0x0426('0x17')];this[_0x0426('0x18')]=_0x66df95[_0x0426('0x18')];this['answertime']=_0x66df95[_0x0426('0x19')];this[_0x0426('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0426('0x1b')]=getSeconds(_0x66df95[_0x0426('0x18')],_0x66df95[_0x0426('0x17')]);this[_0x0426('0x1c')]=getSeconds(_0x66df95[_0x0426('0x19')],_0x66df95[_0x0426('0x18')]);this[_0x0426('0x1d')]=getSeconds(this[_0x0426('0x1a')],_0x66df95[_0x0426('0x19')]);this[_0x0426('0xa')]=_0x8f2e0b[_0x0426('0xa')];this[_0x0426('0x1e')]=_0x8f2e0b[_0x0426('0x1e')];this[_0x0426('0x1f')]=_0x8f2e0b[_0x0426('0x1f')];this[_0x0426('0x20')]=_0x66df95[_0x0426('0x20')];this['callbackuniqueid']=_0x66df95[_0x0426('0x21')];this[_0x0426('0x22')]=_0x66df95[_0x0426('0x22')];this[_0x0426('0x23')]=_0x66df95[_0x0426('0x23')];this['ContactId']=_0x66df95[_0x0426('0x24')];this['ListId']=_0x66df95[_0x0426('0x25')];this[_0x0426('0x26')]=_0x66df95[_0x0426('0x26')];this['VoiceQueueId']=_0x66df95[_0x0426('0x27')];this[_0x0426('0x28')]=_0x66df95[_0x0426('0x28')];this[_0x0426('0x29')]=_0x66df95[_0x0426('0x29')]||'';this[_0x0426('0x2a')]=_0x66df95[_0x0426('0x2a')]||'';}module[_0x0426('0x2b')]=AgentComplete; \ No newline at end of file +var _0xbba7=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x59bd3b,_0x53eff9){var _0x586c53=function(_0xee0b0b){while(--_0xee0b0b){_0x59bd3b['push'](_0x59bd3b['shift']());}};_0x586c53(++_0x53eff9);}(_0xbba7,0x93));var _0x7bba=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0xbba7[_0x47df54];return _0x261b87;};'use strict';var util=require(_0x7bba('0x0'));var _=require(_0x7bba('0x1'));var moment=require(_0x7bba('0x2'));function getSeconds(_0x220702,_0xbcb710){var _0x334e6f=moment(_0x220702)[_0x7bba('0x3')](0x0);var _0x33407c=moment(_0xbcb710)['milliseconds'](0x0);return _0x334e6f[_0x7bba('0x4')](_0x33407c,_0x7bba('0x5'));}function AgentComplete(_0x39016a,_0x16b08a){this['state']=0x4;this[_0x7bba('0x6')]=_0x7bba('0x7');this[_0x7bba('0x8')]=_0x39016a[_0x7bba('0x8')];this['type']=_0x39016a[_0x7bba('0x9')];this[_0x7bba('0xa')]=_0x39016a[_0x7bba('0x9')]===_0x7bba('0xb')?_0x7bba('0xc'):_0x39016a[_0x7bba('0x9')];this['countbusyretry']=_0x39016a['countbusyretry'];this['countcongestionretry']=_0x39016a[_0x7bba('0xd')];this[_0x7bba('0xe')]=_0x39016a[_0x7bba('0xe')];this['countglobal']=_0x39016a[_0x7bba('0xf')]+_0x39016a[_0x7bba('0xd')]+_0x39016a[_0x7bba('0xe')]+_0x39016a['countnosuchnumberretry']+_0x39016a[_0x7bba('0x10')]+_0x39016a[_0x7bba('0x11')]+_0x39016a[_0x7bba('0x12')]+_0x39016a[_0x7bba('0x13')];this['countnosuchnumberretry']=_0x39016a[_0x7bba('0x14')];this['countdropretry']=_0x39016a[_0x7bba('0x10')];this[_0x7bba('0x11')]=_0x39016a[_0x7bba('0x11')];this[_0x7bba('0x12')]=_0x39016a[_0x7bba('0x12')];this[_0x7bba('0x13')]=_0x39016a[_0x7bba('0x13')];this[_0x7bba('0x15')]=_0x16b08a[_0x7bba('0x15')];this[_0x7bba('0x16')]=_0x39016a[_0x7bba('0x17')];this[_0x7bba('0x18')]=_0x39016a[_0x7bba('0x19')];this[_0x7bba('0x1a')]=_0x39016a[_0x7bba('0x1a')];this[_0x7bba('0x1b')]=_0x39016a[_0x7bba('0x1b')];this[_0x7bba('0x1c')]=_0x39016a[_0x7bba('0x1c')];this[_0x7bba('0x1d')]=moment()[_0x7bba('0x1e')](_0x7bba('0x1f'));this['ringtime']=getSeconds(_0x39016a[_0x7bba('0x1b')],_0x39016a[_0x7bba('0x1a')]);this[_0x7bba('0x20')]=getSeconds(_0x39016a[_0x7bba('0x1c')],_0x39016a[_0x7bba('0x1b')]);this['talktime']=getSeconds(this['endtime'],_0x39016a[_0x7bba('0x1c')]);this[_0x7bba('0xc')]=_0x16b08a[_0x7bba('0xc')];this[_0x7bba('0x21')]=_0x16b08a[_0x7bba('0x21')];this[_0x7bba('0x22')]=_0x16b08a['reason'];this['callback']=_0x39016a[_0x7bba('0x23')];this['callbackuniqueid']=_0x39016a[_0x7bba('0x24')];this[_0x7bba('0x25')]=_0x39016a['callbackat'];this[_0x7bba('0x26')]=_0x39016a[_0x7bba('0x26')];this['ContactId']=_0x39016a[_0x7bba('0x27')];this['ListId']=_0x39016a[_0x7bba('0x28')];this[_0x7bba('0x29')]=_0x39016a[_0x7bba('0x29')];this[_0x7bba('0x2a')]=_0x39016a[_0x7bba('0x2a')];this[_0x7bba('0x2b')]=_0x39016a[_0x7bba('0x2b')];this[_0x7bba('0x2c')]=_0x39016a[_0x7bba('0x2c')]||'';this['originatecalleridname']=_0x39016a[_0x7bba('0x2d')]||'';}module[_0x7bba('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index cc49098..25b322d 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x41b49d,_0x2379c4){var _0x158c70=function(_0xb94449){while(--_0xb94449){_0x41b49d['push'](_0x41b49d['shift']());}};_0x158c70(++_0x2379c4);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Final(_0x1a36d8){this[_0x7995('0x5')]=_0x1a36d8[_0x7995('0x5')];this[_0x7995('0x6')]=_0x1a36d8[_0x7995('0x6')];this['type']=_0x1a36d8[_0x7995('0x7')];this[_0x7995('0x8')]=_0x1a36d8['type']===_0x7995('0x9')?_0x7995('0xa'):_0x1a36d8[_0x7995('0x7')];this[_0x7995('0xb')]=_0x1a36d8[_0x7995('0xb')];this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['countnoanswerretry']=_0x1a36d8[_0x7995('0xd')];this[_0x7995('0xe')]=_0x1a36d8['countbusyretry']+_0x1a36d8[_0x7995('0xc')]+_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xf')]+_0x1a36d8[_0x7995('0x10')]+_0x1a36d8[_0x7995('0x11')]+_0x1a36d8[_0x7995('0x12')]+_0x1a36d8[_0x7995('0x13')];this['countnosuchnumberretry']=_0x1a36d8['countnosuchnumberretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0x10')];this[_0x7995('0x11')]=_0x1a36d8[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8[_0x7995('0x12')];this[_0x7995('0x13')]=_0x1a36d8[_0x7995('0x13')];this['queue']=_0x1a36d8[_0x7995('0xa')];this['calleridname']=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=_0x1a36d8[_0x7995('0x16')];this[_0x7995('0x17')]=_0x1a36d8['responsetime'];this['endtime']=_0x1a36d8[_0x7995('0x17')];this['ringtime']=_0x1a36d8['ringtime']||0x0;this[_0x7995('0x18')]=_0x1a36d8[_0x7995('0x18')]||0x0;this['talktime']=_0x1a36d8[_0x7995('0x19')]||0x0;this['callback']=_0x1a36d8['callback'];this[_0x7995('0x1a')]=_0x1a36d8[_0x7995('0x1a')];this[_0x7995('0x1b')]=_0x1a36d8[_0x7995('0x1b')];this[_0x7995('0x1c')]=_0x1a36d8[_0x7995('0x1c')];this['ContactId']=_0x1a36d8[_0x7995('0x1d')];this[_0x7995('0x1e')]=_0x1a36d8[_0x7995('0x1e')];this[_0x7995('0x1f')]=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8['CampaignId'];this[_0x7995('0x22')]=_0x1a36d8[_0x7995('0x22')]||'';this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')]||'';}module[_0x7995('0x24')]=Final; \ No newline at end of file +var _0xe0c3=['util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x1c125f,_0x17869a){var _0x43e0b2=function(_0x44da96){while(--_0x44da96){_0x1c125f['push'](_0x1c125f['shift']());}};_0x43e0b2(++_0x17869a);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3e0c('0x0'));var _=require('lodash');var moment=require(_0x3e0c('0x1'));function getSeconds(_0x172593,_0x3bb243){var _0x41c0bf=moment(_0x172593)[_0x3e0c('0x2')](0x0);var _0x410ec4=moment(_0x3bb243)[_0x3e0c('0x2')](0x0);return _0x41c0bf[_0x3e0c('0x3')](_0x410ec4,_0x3e0c('0x4'));}function Final(_0x511cfa){this['uniqueid']=_0x511cfa[_0x3e0c('0x5')];this[_0x3e0c('0x6')]=_0x511cfa[_0x3e0c('0x6')];this[_0x3e0c('0x7')]=_0x511cfa[_0x3e0c('0x7')];this[_0x3e0c('0x8')]=_0x511cfa[_0x3e0c('0x7')]===_0x3e0c('0x9')?_0x3e0c('0xa'):_0x511cfa[_0x3e0c('0x7')];this[_0x3e0c('0xb')]=_0x511cfa['countbusyretry'];this['countcongestionretry']=_0x511cfa[_0x3e0c('0xc')];this[_0x3e0c('0xd')]=_0x511cfa[_0x3e0c('0xd')];this[_0x3e0c('0xe')]=_0x511cfa[_0x3e0c('0xb')]+_0x511cfa[_0x3e0c('0xc')]+_0x511cfa[_0x3e0c('0xd')]+_0x511cfa['countnosuchnumberretry']+_0x511cfa[_0x3e0c('0xf')]+_0x511cfa['countabandonedretry']+_0x511cfa[_0x3e0c('0x10')]+_0x511cfa[_0x3e0c('0x11')];this['countnosuchnumberretry']=_0x511cfa[_0x3e0c('0x12')];this[_0x3e0c('0xf')]=_0x511cfa[_0x3e0c('0xf')];this[_0x3e0c('0x13')]=_0x511cfa[_0x3e0c('0x13')];this[_0x3e0c('0x10')]=_0x511cfa[_0x3e0c('0x10')];this[_0x3e0c('0x11')]=_0x511cfa[_0x3e0c('0x11')];this[_0x3e0c('0xa')]=_0x511cfa[_0x3e0c('0xa')];this[_0x3e0c('0x14')]=_0x511cfa['calleridname'];this['calleridnum']=_0x511cfa[_0x3e0c('0x15')];this[_0x3e0c('0x16')]=_0x511cfa[_0x3e0c('0x16')];this[_0x3e0c('0x17')]=_0x511cfa[_0x3e0c('0x17')];this[_0x3e0c('0x18')]=_0x511cfa['responsetime'];this[_0x3e0c('0x19')]=_0x511cfa[_0x3e0c('0x19')]||0x0;this[_0x3e0c('0x1a')]=_0x511cfa['holdtime']||0x0;this[_0x3e0c('0x1b')]=_0x511cfa['talktime']||0x0;this['callback']=_0x511cfa[_0x3e0c('0x1c')];this[_0x3e0c('0x1d')]=_0x511cfa[_0x3e0c('0x1d')];this[_0x3e0c('0x1e')]=_0x511cfa['callbackat'];this['recallme']=_0x511cfa[_0x3e0c('0x1f')];this['ContactId']=_0x511cfa['ContactId'];this[_0x3e0c('0x20')]=_0x511cfa[_0x3e0c('0x20')];this[_0x3e0c('0x21')]=_0x511cfa['UserId'];this[_0x3e0c('0x22')]=_0x511cfa[_0x3e0c('0x22')];this['CampaignId']=_0x511cfa[_0x3e0c('0x23')];this[_0x3e0c('0x24')]=_0x511cfa[_0x3e0c('0x24')]||'';this[_0x3e0c('0x25')]=_0x511cfa['originatecalleridname']||'';}module[_0x3e0c('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 530f28f..3c3314f 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53e1=['uniqueid','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x53e1,0xc3));var _0x153e=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x53e1[_0x43f489];return _0x4134b4;};'use strict';var util=require('util');var _=require(_0x153e('0x0'));var moment=require(_0x153e('0x1'));function getSeconds(_0x5494ae,_0x2d5175){var _0x4c82f9=moment(_0x5494ae)[_0x153e('0x2')](0x0);var _0x3dfc96=moment(_0x2d5175)['milliseconds'](0x0);return _0x4c82f9[_0x153e('0x3')](_0x3dfc96,_0x153e('0x4'));}function Hangup(_0x3751b6,_0x3ef54d){this[_0x153e('0x5')]=0x4;this[_0x153e('0x6')]=_0x153e('0x7');this[_0x153e('0x8')]=_0x3751b6[_0x153e('0x8')];this[_0x153e('0x9')]=_0x3751b6['type'];this['campaigntype']=_0x3751b6[_0x153e('0x9')]===_0x153e('0xa')?_0x153e('0xb'):_0x3751b6[_0x153e('0x9')];this[_0x153e('0xc')]=_0x3751b6[_0x153e('0xc')];this['countcongestionretry']=_0x3751b6['countcongestionretry'];this[_0x153e('0xd')]=_0x3751b6[_0x153e('0xd')];this['countglobal']=_0x3751b6[_0x153e('0xc')]+_0x3751b6[_0x153e('0xe')]+_0x3751b6['countnoanswerretry']+_0x3751b6[_0x153e('0xf')]+_0x3751b6[_0x153e('0x10')]+_0x3751b6['countabandonedretry']+_0x3751b6['countmachineretry']+_0x3751b6[_0x153e('0x11')];this['countnosuchnumberretry']=_0x3751b6[_0x153e('0xf')];this[_0x153e('0x10')]=_0x3751b6[_0x153e('0x10')];this['countabandonedretry']=_0x3751b6[_0x153e('0x12')];this[_0x153e('0x13')]=_0x3751b6[_0x153e('0x13')];this[_0x153e('0x11')]=_0x3751b6[_0x153e('0x11')];this[_0x153e('0x14')]=_0x3ef54d[_0x153e('0x14')];this['calleridname']=_0x3751b6[_0x153e('0x15')];this[_0x153e('0x16')]=_0x3751b6['number'];this['starttime']=_0x3751b6[_0x153e('0x17')];this[_0x153e('0x18')]=_0x3751b6[_0x153e('0x18')];this[_0x153e('0x19')]=moment()[_0x153e('0x1a')](_0x153e('0x1b'));this[_0x153e('0x1c')]=getSeconds(_0x3751b6[_0x153e('0x18')],_0x3751b6[_0x153e('0x17')]);this['holdtime']=0x0;this[_0x153e('0x1d')]=getSeconds(this[_0x153e('0x19')],_0x3751b6[_0x153e('0x18')]);this[_0x153e('0xb')]=_0x3751b6['queue'];this[_0x153e('0x1e')]=_0x153e('0x1f');this['reason']=_0x3ef54d[_0x153e('0x20')];this[_0x153e('0x21')]=_0x3751b6[_0x153e('0x21')];this[_0x153e('0x22')]=_0x3751b6['callbackuniqueid'];this[_0x153e('0x23')]=_0x3751b6['callbackat'];this[_0x153e('0x24')]=_0x3751b6[_0x153e('0x24')];this['ContactId']=_0x3751b6[_0x153e('0x25')];this[_0x153e('0x26')]=_0x3751b6[_0x153e('0x26')];this[_0x153e('0x27')]=_0x3751b6['UserId'];this[_0x153e('0x28')]=_0x3751b6['VoiceQueueId'];this['CampaignId']=_0x3751b6[_0x153e('0x29')];}module[_0x153e('0x2a')]=Hangup; \ No newline at end of file +var _0x4098=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime'];(function(_0x51fc49,_0xba76ea){var _0x29749c=function(_0x5ce79f){while(--_0x5ce79f){_0x51fc49['push'](_0x51fc49['shift']());}};_0x29749c(++_0xba76ea);}(_0x4098,0x1bf));var _0x8409=function(_0x58c9f4,_0x57b328){_0x58c9f4=_0x58c9f4-0x0;var _0x2dca0e=_0x4098[_0x58c9f4];return _0x2dca0e;};'use strict';var util=require(_0x8409('0x0'));var _=require(_0x8409('0x1'));var moment=require(_0x8409('0x2'));function getSeconds(_0x328104,_0x25e2dd){var _0x8efe78=moment(_0x328104)[_0x8409('0x3')](0x0);var _0x4ff96f=moment(_0x25e2dd)[_0x8409('0x3')](0x0);return _0x8efe78[_0x8409('0x4')](_0x4ff96f,_0x8409('0x5'));}function Hangup(_0x2a7469,_0x443396){this[_0x8409('0x6')]=0x4;this[_0x8409('0x7')]='Answer';this[_0x8409('0x8')]=_0x2a7469[_0x8409('0x8')];this[_0x8409('0x9')]=_0x2a7469[_0x8409('0x9')];this['campaigntype']=_0x2a7469[_0x8409('0x9')]===_0x8409('0xa')?_0x8409('0xb'):_0x2a7469[_0x8409('0x9')];this[_0x8409('0xc')]=_0x2a7469[_0x8409('0xc')];this[_0x8409('0xd')]=_0x2a7469[_0x8409('0xd')];this['countnoanswerretry']=_0x2a7469[_0x8409('0xe')];this[_0x8409('0xf')]=_0x2a7469[_0x8409('0xc')]+_0x2a7469[_0x8409('0xd')]+_0x2a7469['countnoanswerretry']+_0x2a7469[_0x8409('0x10')]+_0x2a7469[_0x8409('0x11')]+_0x2a7469[_0x8409('0x12')]+_0x2a7469[_0x8409('0x13')]+_0x2a7469[_0x8409('0x14')];this[_0x8409('0x10')]=_0x2a7469[_0x8409('0x10')];this[_0x8409('0x11')]=_0x2a7469[_0x8409('0x11')];this[_0x8409('0x12')]=_0x2a7469[_0x8409('0x12')];this['countmachineretry']=_0x2a7469['countmachineretry'];this[_0x8409('0x14')]=_0x2a7469[_0x8409('0x14')];this[_0x8409('0x15')]=_0x443396['uniqueid'];this[_0x8409('0x16')]=_0x2a7469[_0x8409('0x17')];this['calleridnum']=_0x2a7469['number'];this[_0x8409('0x18')]=_0x2a7469[_0x8409('0x18')];this[_0x8409('0x19')]=_0x2a7469['responsetime'];this[_0x8409('0x1a')]=moment()[_0x8409('0x1b')](_0x8409('0x1c'));this[_0x8409('0x1d')]=getSeconds(_0x2a7469[_0x8409('0x19')],_0x2a7469[_0x8409('0x18')]);this[_0x8409('0x1e')]=0x0;this[_0x8409('0x1f')]=getSeconds(this[_0x8409('0x1a')],_0x2a7469[_0x8409('0x19')]);this[_0x8409('0xb')]=_0x2a7469['queue'];this[_0x8409('0x20')]=_0x8409('0x21');this['reason']=_0x443396['cause-txt'];this[_0x8409('0x22')]=_0x2a7469[_0x8409('0x22')];this[_0x8409('0x23')]=_0x2a7469[_0x8409('0x23')];this[_0x8409('0x24')]=_0x2a7469[_0x8409('0x24')];this[_0x8409('0x25')]=_0x2a7469[_0x8409('0x25')];this[_0x8409('0x26')]=_0x2a7469[_0x8409('0x26')];this[_0x8409('0x27')]=_0x2a7469[_0x8409('0x27')];this[_0x8409('0x28')]=_0x2a7469[_0x8409('0x28')];this['VoiceQueueId']=_0x2a7469[_0x8409('0x29')];this[_0x8409('0x2a')]=_0x2a7469[_0x8409('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b7cad9f..23f738c 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b2d=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','name','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry'];(function(_0x55b2c2,_0x4984e3){var _0x174577=function(_0x23ed0b){while(--_0x23ed0b){_0x55b2c2['push'](_0x55b2c2['shift']());}};_0x174577(++_0x4984e3);}(_0x8b2d,0xe4));var _0xd8b2=function(_0x6c6d75,_0xef7deb){_0x6c6d75=_0x6c6d75-0x0;var _0x48a161=_0x8b2d[_0x6c6d75];return _0x48a161;};'use strict';var util=require(_0xd8b2('0x0'));var _=require(_0xd8b2('0x1'));var moment=require(_0xd8b2('0x2'));function getSeconds(_0x44a1f1,_0x442eaf){var _0x4409b2=moment(_0x44a1f1)['milliseconds'](0x0);var _0x364b3e=moment(_0x442eaf)[_0xd8b2('0x3')](0x0);return _0x4409b2[_0xd8b2('0x4')](_0x364b3e,_0xd8b2('0x5'));}function History(_0x383d02){this['uniqueid']=_0x383d02[_0xd8b2('0x6')];this[_0xd8b2('0x7')]=_0x383d02[_0xd8b2('0x7')]||undefined;this[_0xd8b2('0x8')]=_0x383d02[_0xd8b2('0x8')];this[_0xd8b2('0x9')]=_0x383d02[_0xd8b2('0x8')]===_0xd8b2('0xa')?'queue':_0x383d02[_0xd8b2('0x8')];this['countbusyretry']=_0x383d02[_0xd8b2('0xb')];this[_0xd8b2('0xc')]=_0x383d02['countcongestionretry'];this[_0xd8b2('0xd')]=_0x383d02[_0xd8b2('0xd')];this[_0xd8b2('0xe')]=_0x383d02[_0xd8b2('0xb')]+_0x383d02[_0xd8b2('0xc')]+_0x383d02[_0xd8b2('0xd')]+_0x383d02[_0xd8b2('0xf')]+_0x383d02[_0xd8b2('0x10')]+_0x383d02['countabandonedretry']+_0x383d02[_0xd8b2('0x11')]+_0x383d02[_0xd8b2('0x12')];this[_0xd8b2('0xf')]=_0x383d02[_0xd8b2('0xf')];this[_0xd8b2('0x10')]=_0x383d02[_0xd8b2('0x10')];this[_0xd8b2('0x13')]=_0x383d02[_0xd8b2('0x13')];this[_0xd8b2('0x11')]=_0x383d02[_0xd8b2('0x11')];this[_0xd8b2('0x12')]=_0x383d02[_0xd8b2('0x12')];this[_0xd8b2('0x14')]=_0x383d02[_0xd8b2('0x14')];this['calleridname']=_0x383d02[_0xd8b2('0x15')];this['calleridnum']=_0x383d02[_0xd8b2('0x16')];this[_0xd8b2('0x17')]=_0x383d02[_0xd8b2('0x17')];this[_0xd8b2('0x18')]=_0x383d02['responsetime'];this['endtime']=_0x383d02[_0xd8b2('0x18')];this[_0xd8b2('0x19')]=getSeconds(_0x383d02[_0xd8b2('0x18')],_0x383d02[_0xd8b2('0x17')]);this[_0xd8b2('0x1a')]=0x0;this[_0xd8b2('0x1b')]=0x0;this['callback']=_0x383d02[_0xd8b2('0x1c')];this[_0xd8b2('0x1d')]=_0x383d02[_0xd8b2('0x1d')];this[_0xd8b2('0x1e')]=_0x383d02['callbackat'];this['recallme']=_0x383d02[_0xd8b2('0x1f')];this[_0xd8b2('0x20')]=_0x383d02[_0xd8b2('0x20')];this[_0xd8b2('0x21')]=_0x383d02['ListId'];this['UserId']=_0x383d02[_0xd8b2('0x22')];this[_0xd8b2('0x23')]=_0x383d02[_0xd8b2('0x23')];this[_0xd8b2('0x24')]=_0x383d02[_0xd8b2('0x24')];this['originatecalleridnum']=_0x383d02[_0xd8b2('0x25')]||'';this['originatecalleridname']=_0x383d02[_0xd8b2('0x26')]||'';}module[_0xd8b2('0x27')]=History; \ No newline at end of file +var _0x1bb2=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x148783,_0x1ac458){var _0x85329a=function(_0x52afd8){while(--_0x52afd8){_0x148783['push'](_0x148783['shift']());}};_0x85329a(++_0x1ac458);}(_0x1bb2,0x12f));var _0x21bb=function(_0x4effa0,_0x166f42){_0x4effa0=_0x4effa0-0x0;var _0x341f71=_0x1bb2[_0x4effa0];return _0x341f71;};'use strict';var util=require(_0x21bb('0x0'));var _=require('lodash');var moment=require(_0x21bb('0x1'));function getSeconds(_0x2a50fa,_0x269c07){var _0x57818b=moment(_0x2a50fa)[_0x21bb('0x2')](0x0);var _0x1c5d49=moment(_0x269c07)['milliseconds'](0x0);return _0x57818b[_0x21bb('0x3')](_0x1c5d49,_0x21bb('0x4'));}function History(_0x378ff8){this['uniqueid']=_0x378ff8[_0x21bb('0x5')];this[_0x21bb('0x6')]=_0x378ff8[_0x21bb('0x6')]||undefined;this[_0x21bb('0x7')]=_0x378ff8[_0x21bb('0x7')];this['campaigntype']=_0x378ff8[_0x21bb('0x7')]===_0x21bb('0x8')?_0x21bb('0x9'):_0x378ff8['type'];this[_0x21bb('0xa')]=_0x378ff8['countbusyretry'];this[_0x21bb('0xb')]=_0x378ff8['countcongestionretry'];this[_0x21bb('0xc')]=_0x378ff8[_0x21bb('0xc')];this['countglobal']=_0x378ff8[_0x21bb('0xa')]+_0x378ff8[_0x21bb('0xb')]+_0x378ff8[_0x21bb('0xc')]+_0x378ff8[_0x21bb('0xd')]+_0x378ff8['countdropretry']+_0x378ff8['countabandonedretry']+_0x378ff8[_0x21bb('0xe')]+_0x378ff8['countagentrejectretry'];this[_0x21bb('0xd')]=_0x378ff8['countnosuchnumberretry'];this['countdropretry']=_0x378ff8[_0x21bb('0xf')];this[_0x21bb('0x10')]=_0x378ff8[_0x21bb('0x10')];this[_0x21bb('0xe')]=_0x378ff8['countmachineretry'];this[_0x21bb('0x11')]=_0x378ff8[_0x21bb('0x11')];this[_0x21bb('0x9')]=_0x378ff8[_0x21bb('0x9')];this[_0x21bb('0x12')]=_0x378ff8[_0x21bb('0x13')];this[_0x21bb('0x14')]=_0x378ff8[_0x21bb('0x15')];this[_0x21bb('0x16')]=_0x378ff8[_0x21bb('0x16')];this[_0x21bb('0x17')]=_0x378ff8[_0x21bb('0x17')];this[_0x21bb('0x18')]=_0x378ff8[_0x21bb('0x17')];this[_0x21bb('0x19')]=getSeconds(_0x378ff8['responsetime'],_0x378ff8['starttime']);this[_0x21bb('0x1a')]=0x0;this['talktime']=0x0;this['callback']=_0x378ff8[_0x21bb('0x1b')];this[_0x21bb('0x1c')]=_0x378ff8[_0x21bb('0x1c')];this['callbackat']=_0x378ff8[_0x21bb('0x1d')];this['recallme']=_0x378ff8['recallme'];this[_0x21bb('0x1e')]=_0x378ff8[_0x21bb('0x1e')];this['ListId']=_0x378ff8[_0x21bb('0x1f')];this[_0x21bb('0x20')]=_0x378ff8[_0x21bb('0x20')];this[_0x21bb('0x21')]=_0x378ff8[_0x21bb('0x21')];this['CampaignId']=_0x378ff8[_0x21bb('0x22')];this[_0x21bb('0x23')]=_0x378ff8['originatecalleridnum']||'';this['originatecalleridname']=_0x378ff8[_0x21bb('0x24')]||'';}module[_0x21bb('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c225b29..1db5a56 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 _0xfb27=['erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','debug','inspect','error','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','loopClearZombieChannels','clearZombieChannels','uniqueId','[uniqueid]','isNil','Action','status','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','ContactId','UserId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','reachable','SIP/%s','saveInDb','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD]','MACHINE','Machine','membername','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','HANGUP','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countglobal','reason19\x20machine....','minutes','[rescheduleContact][Machine]','[syncHangupIvr]','dialQueueProject','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','channel','roundrobin','actionid','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','dialMethod','progressive','handlePower','dialPowerLevel','predictive','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','handleIvr','checkIsTrunkReachable','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','map','Agent','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','originate','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','phone','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','responsetime','getQueue','response','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','Success','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','AVAILABLE_CONTACTS_FINISHED','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','countReScheduled','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','booked','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./history','./final','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','name','[ifTime][Action]','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\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','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfb27,0x1a4));var _0x7fb2=function(_0x1a2973,_0x1c87f2){_0x1a2973=_0x1a2973-0x0;var _0x318b2e=_0xfb27[_0x1a2973];return _0x318b2e;};'use strict';var util=require(_0x7fb2('0x0'));var _=require(_0x7fb2('0x1'));var uuid=require(_0x7fb2('0x2'));var moment=require(_0x7fb2('0x3'));var rr=require('rr');var md5=require(_0x7fb2('0x4'));var Redis=require(_0x7fb2('0x5'));var ut=require(_0x7fb2('0x6'));var config=require(_0x7fb2('0x7'));var logger=require('../../../config/logger')(_0x7fb2('0x8'));var loggerBooked=require('../../../config/logger')(_0x7fb2('0x9'));var loggerPredictive=require(_0x7fb2('0xa'))('predictive');var loggerPredictiveCalls=require(_0x7fb2('0xa'))(_0x7fb2('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x7fb2('0xc'));var ami=require(_0x7fb2('0xd'));config['redis']=_[_0x7fb2('0xe')](config['redis'],{'host':_0x7fb2('0xf'),'port':0x18eb});var io=require(_0x7fb2('0x10'))(new Redis(config[_0x7fb2('0x11')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x7fb2('0x12'));var cmHopperAdditionalPhone=require(_0x7fb2('0x13'));var cmHopperBlack=require(_0x7fb2('0x14'));var voiceQueueRt=require(_0x7fb2('0x15'));var RpcSetting=require(_0x7fb2('0x16'));var Action=require('./action');var History=require(_0x7fb2('0x17'));var Final=require(_0x7fb2('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x7fb2('0x19'));var Hangup=require(_0x7fb2('0x1a'));var ipAgi=process[_0x7fb2('0x1b')]['XCALLY_IP_AGI']||_0x7fb2('0x1c');var strategy={'rrmemory':_0x7fb2('0x1d'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x7fb2('0x1e')][_0x7fb2('0x1f')]=function(_0x3fa4be){this[_0x7fb2('0x20')]=this[_0x7fb2('0x20')]?this[_0x7fb2('0x20')][_0x7fb2('0x21')](_0x3fa4be):_0x3fa4be();};function Dialer(_0x10d1a2,_0x240a80){this[_0x7fb2('0x22')]=new Sequence();this[_0x7fb2('0x23')]=_0x240a80;this['voiceQueues']=_0x10d1a2[_0x7fb2('0x24')];this[_0x7fb2('0x25')]=_0x10d1a2[_0x7fb2('0x25')];this[_0x7fb2('0x26')]=_0x10d1a2['agents'];this[_0x7fb2('0x27')]=_0x10d1a2['trunks'];this[_0x7fb2('0x28')]=config[_0x7fb2('0x28')]||0x2;this[_0x7fb2('0x29')]={};this[_0x7fb2('0x2a')]={};this['contactsId']={};this['uniqueId']={};this[_0x7fb2('0x2b')]={};this['startPredictive']={};this[_0x7fb2('0x2c')]={};this[_0x7fb2('0x2d')]={};this[_0x7fb2('0x2e')]={};this['queueBookedRR']={};ami['on'](_0x7fb2('0x2f'),this[_0x7fb2('0x30')][_0x7fb2('0x31')](this));ami['on']('queuecallerabandon',this[_0x7fb2('0x32')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x33'),this[_0x7fb2('0x34')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x35'),this[_0x7fb2('0x36')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x37'),this[_0x7fb2('0xc')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x38'),this[_0x7fb2('0x39')][_0x7fb2('0x31')](this));ami['on']('hangup',this[_0x7fb2('0x3a')]['bind'](this));ami['on']('newexten',this[_0x7fb2('0x3b')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x3c'),this[_0x7fb2('0x3d')][_0x7fb2('0x31')](this));ami['on']('queuemember',this[_0x7fb2('0x3e')][_0x7fb2('0x31')](this));ami['on'](_0x7fb2('0x3f'),this[_0x7fb2('0x40')][_0x7fb2('0x31')](this));this[_0x7fb2('0x41')]();this['loopClearZombieChannels']();RpcSetting[_0x7fb2('0x42')]()[_0x7fb2('0x43')](function(_0x1ff578){previewRecallmeReminderInterval=_0x1ff578[_0x7fb2('0x44')];});}function isNotNull(_0x2af010){return _0x2af010!==null&&!_['isUndefined'](_0x2af010);}function checkIsLoggedIn(_0x6f244,_0x2ef983){return function(){if(_0x2ef983<=0x0){_0x6f244[_0x7fb2('0x45')]='AGENTS_NOT_LOGGED';throw _0x6f244['name']+_0x7fb2('0x46');}};}function isActive(_0x56c390){return _0x56c390;}function checkIsActive(_0x115596,_0x52d1af){return function(){if(!isActive(_0x52d1af)){_0x115596[_0x7fb2('0x45')]=_0x7fb2('0x47');throw _0x115596['name']+_0x7fb2('0x48');}};}function checkInterval(_0x3bc034){return function(){if(!isNotNull(_0x3bc034[_0x7fb2('0x49')])){_0x3bc034['message']=_0x7fb2('0x4a');throw _0x3bc034['name']+_0x7fb2('0x4b');}if(!isNotNull(_0x3bc034[_0x7fb2('0x49')][_0x7fb2('0x4c')])){_0x3bc034['message']=_0x7fb2('0x4a');throw _0x3bc034['name']+_0x7fb2('0x4b');}if(!isNotNull(_[_0x7fb2('0x4d')](_0x3bc034[_0x7fb2('0x49')][_0x7fb2('0x4c')]))){_0x3bc034[_0x7fb2('0x45')]=_0x7fb2('0x4a');throw _0x3bc034[_0x7fb2('0x4e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x40366f,_0x43e1ce,_0x1195bf){return{'action':_0x40366f,'response':_0x43e1ce,'message':_0x1195bf,'stack':_0x1195bf};}function myreject(_0x13a622){return function(_0x4fe838){return _0x13a622(msgResponse(_0x7fb2('0x4f'),'Error',JSON[_0x7fb2('0x50')](_0x4fe838)));};}function getSeconds(_0x456299,_0xee3581){var _0xdd1f79=moment(_0x456299)[_0x7fb2('0x51')](0x0);var _0x1368bf=moment(_0xee3581)[_0x7fb2('0x51')](0x0);return _0xdd1f79[_0x7fb2('0x52')](_0x1368bf,'seconds');}function emit(_0x16a3b7,_0x3de78f,_0x3439e8){io['to'](_0x16a3b7)[_0x7fb2('0x53')](_0x3de78f,_0x3439e8);}function emitVoiceQueueSummary(_0x442faf){if(_0x442faf[_0x7fb2('0x54')]===_0x7fb2('0x55')){var _0x1e2686={'id':_0x442faf['id'],'name':_0x442faf['name'],'strategy':_0x442faf[_0x7fb2('0x56')],'answered':_0x442faf[_0x7fb2('0x57')],'available':_0x442faf['available'],'loggedIn':_0x442faf[_0x7fb2('0x58')],'pTalking':_0x442faf[_0x7fb2('0x59')],'sumBillable':_0x442faf[_0x7fb2('0x5a')],'sumDuration':_0x442faf[_0x7fb2('0x5b')],'sumHoldTime':_0x442faf[_0x7fb2('0x5c')]||0x0,'talking':_0x442faf['talking'],'total':_0x442faf[_0x7fb2('0x5d')],'type':_0x442faf[_0x7fb2('0x54')],'unmanaged':_0x442faf['unmanaged'],'abandoned':_0x442faf[_0x7fb2('0x5e')],'waiting':_0x442faf[_0x7fb2('0x5f')],'loggedInDb':_0x442faf[_0x7fb2('0x60')],'dialActive':_0x442faf[_0x7fb2('0x61')],'dialMethod':_0x442faf['dialMethod'],'dialOriginateCallerIdName':_0x442faf['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x442faf[_0x7fb2('0x62')],'dialOriginateTimeout':_0x442faf[_0x7fb2('0x63')],'dialPrefix':_0x442faf[_0x7fb2('0x64')],'outboundAnswerAgiCallsDay':_0x442faf['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x442faf[_0x7fb2('0x65')],'outboundBlacklistCallsDay':_0x442faf[_0x7fb2('0x66')],'outboundBusyCallsDay':_0x442faf[_0x7fb2('0x67')],'outboundCongestionCallsDay':_0x442faf['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x442faf[_0x7fb2('0x68')],'outboundDropCallsDayCallersExit':_0x442faf[_0x7fb2('0x69')],'outboundDropCallsDayTimeout':_0x442faf['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x442faf[_0x7fb2('0x6a')],'outboundNoSuchCallsDay':_0x442faf[_0x7fb2('0x6b')],'outboundOriginateFailureCallsDay':_0x442faf[_0x7fb2('0x6c')],'outboundReCallsDay':_0x442faf['outboundReCallsDay'],'outboundRejectCallsDay':_0x442faf['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x442faf['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x442faf[_0x7fb2('0x6d')],'predictiveIntervalAvgHoldtime':_0x442faf[_0x7fb2('0x6e')],'predictiveIntervalAvgTalktime':_0x442faf[_0x7fb2('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x442faf[_0x7fb2('0x70')],'predictiveIntervalDroppedCallsTimeout':_0x442faf[_0x7fb2('0x71')],'predictiveIntervalErlangCalls':_0x442faf[_0x7fb2('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x442faf[_0x7fb2('0x73')],'predictiveIntervalHitRate':_0x442faf['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x442faf['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x442faf[_0x7fb2('0x74')],'predictiveIntervalAvailable':_0x442faf[_0x7fb2('0x75')],'predictiveIntervalTotalCalls':_0x442faf[_0x7fb2('0x76')],'message':_0x442faf[_0x7fb2('0x45')],'originated':_0x442faf[_0x7fb2('0x77')],'erlangCalls':_0x442faf[_0x7fb2('0x78')],'erlangCallToSecond':_0x442faf[_0x7fb2('0x79')],'erlangAbandonmentRate':_0x442faf['erlangAbandonmentRate'],'erlangBusyFactor':_0x442faf['erlangBusyFactor'],'startPredictive':_0x442faf[_0x7fb2('0x7a')],'startProgressive':_0x442faf[_0x7fb2('0x2c')]};if(_0x442faf['Trunk']){_0x1e2686['Trunk']={'id':_0x442faf[_0x7fb2('0x7b')]['id'],'name':_0x442faf[_0x7fb2('0x7b')][_0x7fb2('0x4e')],'active':_0x442faf[_0x7fb2('0x7b')][_0x7fb2('0x7c')],'callerid':_0x442faf['Trunk'][_0x7fb2('0x7d')]};}if(_0x442faf['Interval']){_0x1e2686[_0x7fb2('0x49')]={'id':_0x442faf[_0x7fb2('0x49')]['id'],'name':_0x442faf['Interval'][_0x7fb2('0x4e')]};}var _0x30c43e=md5(JSON['stringify'](_0x1e2686));if(_0x442faf[_0x7fb2('0x4')]!==_0x30c43e){_0x442faf[_0x7fb2('0x4')]=_0x30c43e;emit(util[_0x7fb2('0x7e')](_0x7fb2('0x7f'),_0x1e2686[_0x7fb2('0x4e')]),_0x7fb2('0x80'),_0x1e2686);}}}function emitCampaignSummary(_0x41acf3){if(_0x41acf3[_0x7fb2('0x54')]===_0x7fb2('0x81')){emit(util[_0x7fb2('0x7e')]('campaign:ivr:%s',_0x41acf3[_0x7fb2('0x4e')]),_0x7fb2('0x82'),_0x41acf3);}}function checkGetDataPredictive(_0x145ec5){if(isNotNull(_0x145ec5)&&!_[_0x7fb2('0x4d')](_0x145ec5)){loggerPredictive['info'](_0x7fb2('0x83'));loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x85'),_0x145ec5[_0x7fb2('0x76')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x86'),_0x145ec5[_0x7fb2('0x6d')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x87'),_0x145ec5[_0x7fb2('0x71')]);loggerPredictive['info'](_0x7fb2('0x88'),_0x145ec5[_0x7fb2('0x70')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x89'),_0x145ec5[_0x7fb2('0x6e')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x8a'),_0x145ec5[_0x7fb2('0x6f')]);loggerPredictive[_0x7fb2('0x84')]('---------------------------');if(_0x145ec5[_0x7fb2('0x76')]>0x0){if(!_[_0x7fb2('0x8b')](_0x145ec5['predictiveIntervalAvgTalktime'])&&_0x145ec5[_0x7fb2('0x6f')]>0x0){return!![];}loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x8c'));if(!_['isUndefined'](_0x145ec5[_0x7fb2('0x6e')])&&_0x145ec5[_0x7fb2('0x6e')]>0x0){return!![];}loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x8d'));}else{loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x8e'));}}else{loggerPredictive[_0x7fb2('0x84')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x290f4d){return function(_0x3cf83c){loggerPredictive[_0x7fb2('0x84')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x7fb2('0x84')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3cf83c[_0x7fb2('0x78')]);loggerPredictive['info'](_0x7fb2('0x8f'),_0x3cf83c[_0x7fb2('0x79')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x90'),_0x3cf83c[_0x7fb2('0x91')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x92'),_0x3cf83c[_0x7fb2('0x93')]);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x90'),_0x3cf83c['erlangAbandonmentRate']);loggerPredictive[_0x7fb2('0x84')]('---------------------------');_[_0x7fb2('0x94')](_0x290f4d,_0x3cf83c);};}function getDiff(_0x594325){var _0x525543=moment()[_0x7fb2('0x51')](0x0);var _0x3f0030=moment(_0x594325)[_0x7fb2('0x51')](0x0);return _0x525543['diff'](_0x3f0030,_0x7fb2('0x95'));}function ifInterval(_0x5cd527,_0x54631d){if(_[_0x7fb2('0x8b')](_0x54631d)){return![];}return getDiff(_0x54631d)<_0x5cd527*0x3c;}function freeVariablesPredictive(_0x11115d){if(isNotNull(_0x11115d)){if(!_['isUndefined'](_0x11115d['startProgressive'])){_0x11115d['startProgressive']=undefined;loggerPredictive[_0x7fb2('0x84')](_0x11115d[_0x7fb2('0x4e')],_0x7fb2('0x96'));}if(!_[_0x7fb2('0x8b')](_0x11115d['startPredictive'])){_0x11115d[_0x7fb2('0x7a')]=undefined;loggerPredictive[_0x7fb2('0x84')](_0x11115d[_0x7fb2('0x4e')],_0x7fb2('0x97'));}if(!_[_0x7fb2('0x8b')](_0x11115d['handlePredictive'])){clearInterval(_0x11115d[_0x7fb2('0x98')]);_0x11115d['handlePredictive']=undefined;loggerPredictive[_0x7fb2('0x84')](_0x11115d[_0x7fb2('0x4e')],_0x7fb2('0x99'));}}}function erlangb(_0x58a193,_0x4f133e){if(_0x4f133e===0x0){return 0x0;}var _0x3d906b=0x1;for(var _0x3a4492=0x1;_0x3a4492<=_0x4f133e;_0x3a4492+=0x1){_0x3d906b=0x1+_0x3d906b*_0x3a4492/_0x58a193;}return 0x1/_0x3d906b;}function isVoiceQueueOutbound(_0xd5f8da){return _0xd5f8da===_0x7fb2('0x55');}function isNotPreview(_0xac33e0){return _0xac33e0!=='preview';}function isCampaignIvr(_0x4d1e32){return _0x4d1e32===_0x7fb2('0x81');}function getCallerId(_0x200dab,_0x93516f,_0x2c5461){if(!_[_0x7fb2('0x8b')](_0x2c5461)&&typeof _0x2c5461==='string'&&!_[_0x7fb2('0x4d')](_0x2c5461)){if(!_[_0x7fb2('0x8b')](_0x93516f)&&typeof _0x93516f==='string'&&!_['isEmpty'](_0x93516f)){return util[_0x7fb2('0x7e')]('\x22%s\x22\x20<%s>',_0x93516f,_0x2c5461);}return util['format'](_0x7fb2('0x9a'),_0x2c5461,_0x2c5461);}if(!_[_0x7fb2('0x8b')](_0x200dab)&&typeof _0x200dab===_0x7fb2('0x9b')&&!_[_0x7fb2('0x4d')](_0x200dab)){return _0x200dab;}return _0x7fb2('0x9c');}function loggerCatchQueueSummary(_0x1232a3,_0x45b5a9){return function(_0x428cab){freeVariablesPredictive(_0x45b5a9);emitVoiceQueueSummary(_0x45b5a9);emitCampaignSummary(_0x45b5a9);loggerSyncQueueSummary[_0x7fb2('0x9d')](_0x1232a3,util[_0x7fb2('0x9e')](_0x428cab,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x410828,_0x2ec705){return function(_0x418e2d){loggerPredictive['error'](_0x2ec705[_0x7fb2('0x4e')],_0x410828);loggerPredictive[_0x7fb2('0x9f')](_0x418e2d[_0x7fb2('0xa0')]);freeVariablesPredictive(_0x2ec705);};}function loggerCatch(_0x965c60){return function(_0xb76718){logger[_0x7fb2('0x9f')](_0x965c60,util[_0x7fb2('0x9e')](_0xb76718,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x38767e){return _0x38767e&&!_[_0x7fb2('0x8b')](_0x38767e)&&_0x38767e[_0x7fb2('0xa1')]>0x0;}function decremetOriginate(_0x2ac420){if(!_[_0x7fb2('0x8b')](_0x2ac420)&&_0x2ac420!==null){if(typeof _0x2ac420[_0x7fb2('0x77')]!=='undefined'){if(_0x2ac420[_0x7fb2('0x77')]>0x0){_0x2ac420[_0x7fb2('0x77')]-=0x1;}else{logger[_0x7fb2('0x9f')](_0x7fb2('0xa2'));}}}else{logger[_0x7fb2('0x9f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x31f50c,_0x14befa,_0x1c79c4){if(_0x14befa>_0x1c79c4){for(var _0x137bb0=0x0;_0x137bb0<_0x14befa-_0x1c79c4;_0x137bb0+=0x1){decremetOriginate(_0x31f50c);}}}function loggerGetContactDialer(_0x1f5812,_0x1d0231,_0x597ad6){return function(_0x1f52c7){checkContactLowerLimitOriginate(_0x1d0231,_0x597ad6,0x0);logger[_0x7fb2('0x9f')](_0x1f5812,util['inspect'](_0x1f52c7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2bc17a){return function(_0x4b9157){if(isNotNull(_0x4b9157)&&isNotNull(_0x4b9157[0x0])){if(_0x4b9157[0x0][_0x7fb2('0xa3')]>0x0){_0x2bc17a[_0x7fb2('0x45')]=_0x7fb2('0xa4');logger[_0x7fb2('0x84')](_0x7fb2('0xa5')+_0x2bc17a[_0x7fb2('0x4e')],_0x4b9157[0x0]['contactsRescheduled'],_0x7fb2('0xa6'));}else{_0x2bc17a[_0x7fb2('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x7fb2('0x84')](_0x7fb2('0xa7')+_0x2bc17a[_0x7fb2('0x4e')]);}}};}function notSendMessagesQueue(_0x5b1b75){if(_0x5b1b75[_0x7fb2('0xa8')]){freeVariablesPredictive(_0x5b1b75);if(_0x5b1b75[_0x7fb2('0x77')]===0x0&&_0x5b1b75[_0x7fb2('0xa9')]===0x0&&_0x5b1b75['waiting']===0x0&&(_0x5b1b75[_0x7fb2('0x59')]||0x0)===0x0){_0x5b1b75[_0x7fb2('0xa8')]=![];_0x5b1b75[_0x7fb2('0xaa')]=0x0;_0x5b1b75[_0x7fb2('0x45')]=_0x7fb2('0x47');loggerSyncQueueSummary[_0x7fb2('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5b1b75[_0x7fb2('0x4e')],_0x7fb2('0xab'));}else{_0x5b1b75[_0x7fb2('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x7fb2('0x9d')](_0x7fb2('0xac'),_0x5b1b75['name'],_0x7fb2('0xad'));}emitVoiceQueueSummary(_0x5b1b75);}}function notSendMessagesCampaign(_0x1b613b){if(_0x1b613b['sendMessageOneNotActive']){if(_0x1b613b['originated']===0x0){_0x1b613b[_0x7fb2('0xa8')]=![];_0x1b613b['message']='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0x7fb2('0xae'),_0x1b613b[_0x7fb2('0x4e')],_0x7fb2('0xab'));}else{_0x1b613b[_0x7fb2('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x7fb2('0x9d')](_0x7fb2('0xae'),_0x1b613b[_0x7fb2('0x4e')],'is\x20disactive');}emitCampaignSummary(_0x1b613b);}}function createObjHistory(_0x5b2817,_0x443d63,_0x5e15cc,_0x1e9a28,_0x4d23fd){_0x5b2817[_0x7fb2('0x45')]=_0x5e15cc;var _0x4e4621=new Action(_0x5b2817,_0x443d63);var _0x417d10=new History(_0x4e4621);_0x417d10[_0x7fb2('0xaf')]=_0x1e9a28;_0x417d10[_0x7fb2('0xb0')]=_0x4d23fd;_0x417d10['endtime']=_0x4e4621['starttime'];return _0x417d10;}Dialer[_0x7fb2('0x1e')][_0x7fb2('0xb1')]=function(){var _0x4597ee=this;setInterval(function(){_0x4597ee[_0x7fb2('0xb2')](_0x4597ee[_0x7fb2('0xb3')],_0x7fb2('0xb4'));_0x4597ee[_0x7fb2('0xb2')](_0x4597ee[_0x7fb2('0x2a')],'[actions]');},0x32c8);};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xb2')]=function(_0x4c37ad,_0x428781){var _0x4d34ce=this;for(var _0x774bcf in _0x4c37ad){if(typeof _0x4c37ad[_0x774bcf]!=='undefined'){this['sequence'][_0x7fb2('0x1f')](function(){if(!_[_0x7fb2('0xb5')](_0x4c37ad[_0x774bcf])){return ami[_0x7fb2('0xb6')]({'action':_0x7fb2('0xb7'),'channel':_0x4c37ad[_0x774bcf]['channel']})['catch'](function(_0x5a4aa6){if(_0x5a4aa6[_0x7fb2('0x45')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4c37ad[_0x774bcf]&&_0x4c37ad[_0x774bcf]['type']!==_0x7fb2('0x81')){_0x4d34ce['updateOriginated'](_0x4d34ce['voiceQueues'][_0x4c37ad[_0x774bcf]['queue']]);logger['error'](_0x7fb2('0xb8'),_0x428781,_0x774bcf,_0x4c37ad[_0x774bcf][_0x7fb2('0xb9')]);delete _0x4c37ad[_0x774bcf];}if(_0x4c37ad[_0x774bcf]&&_0x4c37ad[_0x774bcf][_0x7fb2('0x54')]===_0x7fb2('0x81')){_0x4d34ce[_0x7fb2('0xba')](_0x4d34ce[_0x7fb2('0x25')][_0x4c37ad[_0x774bcf]['queue']]);logger[_0x7fb2('0x9f')](_0x7fb2('0xbb'),_0x428781,_0x774bcf,_0x4c37ad[_0x774bcf][_0x7fb2('0xb9')]);delete _0x4c37ad[_0x774bcf];}},0x2328);}});}});}}};Dialer[_0x7fb2('0x1e')]['countReScheduled']=function(_0xa5cb61){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper['countReScheduled'](_0xa5cb61))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xbe')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xbf')]=function(_0x9fbf4){return Promise['resolve']()['then'](cmHopperBlack[_0x7fb2('0xbf')](_0x9fbf4))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xc0')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc1')]=function(_0x11afa3,_0x41051f,_0x2c4b7d){return Promise['resolve']()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x11afa3,_0x41051f,_0x2c4b7d))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xc2')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc3')]=function(_0x1579d5,_0x122cd1,_0x1d8649){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopperAdditionalPhone[_0x7fb2('0xc3')](_0x1579d5,_0x122cd1,_0x1d8649))['catch'](loggerCatch(_0x7fb2('0xc4')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc5')]=function(_0x4fccbe){return Promise['resolve']()[_0x7fb2('0x43')](cmHopperBlack[_0x7fb2('0xc5')](_0x4fccbe))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc6')]=function(_0x5e2c75){return Promise[_0x7fb2('0xbc')]()['then'](cmHopperHistory[_0x7fb2('0xc7')](_0x5e2c75))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xc8')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc9')]=function(_0x34b1d2){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper[_0x7fb2('0xc9')](_0x34b1d2))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xca')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xcb')]=function(_0x2ce637,_0x3d46db,_0x4d99d8){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper[_0x7fb2('0xcb')](_0x2ce637,_0x3d46db,_0x4d99d8))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xcc')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xcd')]=function(_0x22592d,_0x28b6d3,_0x2f23e6,_0x1620f3,_0x301bea){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper[_0x7fb2('0xcd')](_0x22592d,_0x28b6d3,_0x2f23e6,_0x1620f3))[_0x7fb2('0xbd')](function(_0x4efb50){_0x301bea[_0x7fb2('0xce')]-=_0x2f23e6;_0x301bea[_0x7fb2('0xce')]=_0x301bea[_0x7fb2('0xce')]>0x0?_0x301bea[_0x7fb2('0xce')]:0x0;loggerCatch(_0x7fb2('0xcf'))(_0x4efb50);});};Dialer[_0x7fb2('0x1e')]['getContactDialerIvr']=function(_0x3c7bff,_0x2ae404,_0x3800a4,_0x55645c){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper[_0x7fb2('0xd0')](_0x3c7bff,_0x2ae404,_0x3800a4))['catch'](function(_0x4ae63a){_0x55645c[_0x7fb2('0xce')]-=_0x2ae404;_0x55645c[_0x7fb2('0xce')]=_0x55645c[_0x7fb2('0xce')]>0x0?_0x55645c[_0x7fb2('0xce')]:0x0;loggerCatch(_0x7fb2('0xd1'))(_0x4ae63a);});};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xd2')]=function(_0x1fdc6b){return Promise['resolve']()[_0x7fb2('0x43')](voiceQueueRt[_0x7fb2('0xd2')](_0x1fdc6b))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xd3')));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xd4')]=function(_0x248631){return Promise[_0x7fb2('0xbc')]()['then'](cmHopper['moveContactManagedDialer'](_0x248631))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xd5')));};Dialer['prototype'][_0x7fb2('0xd6')]=function(_0xca98a){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopperHistory[_0x7fb2('0xd6')](_0xca98a))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xd7')));};Dialer[_0x7fb2('0x1e')]['updateOriginated']=function(_0x191efa){if(!_[_0x7fb2('0x8b')](_0x191efa)&&_0x191efa!==null){if(typeof _0x191efa['originated']!==_0x7fb2('0xd8')){if(_0x191efa['originated']>0x0){_0x191efa['originated']-=0x1;}else{logger['error'](_0x7fb2('0xd9'));}}}else{logger['error'](_0x7fb2('0xda'));}};Dialer[_0x7fb2('0x1e')]['loggerHandler']=function(_0xfe4759,_0x2c280e){var _0x46ab52=this;return function(_0x359f87){_0x46ab52[_0x7fb2('0xba')](_0x2c280e);logger[_0x7fb2('0x9f')](_0xfe4759,util[_0x7fb2('0x9e')](_0x359f87,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x7fb2('0xdb')]=function(_0xb23bd,_0xb9e50e,_0x224869){var _0x35eef3={'state':0x19,'statedesc':'notFound'};this[_0x7fb2('0xba')](_0xb9e50e);this['saveInDb'](_[_0x7fb2('0x94')](_0x35eef3,_['pick'](_0x224869,[_0x7fb2('0xdc'),'ListId',_0x7fb2('0xdd'),'VoiceQueueId',_0x7fb2('0xde')])),_0x7fb2('0xdf'),'[emptyContact]');logger[_0x7fb2('0x9f')](_0xb23bd);};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xe0')]=function(_0x135896){return _0x135896==='Success';};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xe1')]=function(_0x527b84){return!_[_0x7fb2('0x8b')](_0x527b84)&&_0x527b84&&!_[_0x7fb2('0x8b')](_0x527b84[_0x7fb2('0x4e')])&&!_[_0x7fb2('0x8b')](_0x527b84[_0x7fb2('0x7c')])&&_0x527b84[_0x7fb2('0x7c')]&&(this['trunks'][util[_0x7fb2('0x7e')]('SIP/%s',_0x527b84['name'])]['status']===_0x7fb2('0xe2')||this[_0x7fb2('0x27')][util[_0x7fb2('0x7e')](_0x7fb2('0xe3'),_0x527b84['name'])][_0x7fb2('0xb7')]==='unmonitored');};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xe4')]=function(_0x56f8fc,_0x3b0fc0,_0x586ae3){this['createHistory'](_0x56f8fc)[_0x7fb2('0xbd')](loggerCatch(_0x3b0fc0));this['moveContactManagedDialer'](_0x56f8fc)['catch'](loggerCatch(_0x586ae3));};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x3d')]=function(_0x39969b){var _0x62acf6=this;var _0x37ff1e=this[_0x7fb2('0xb3')][_0x39969b['uniqueid']];var _0x40127c;if(!_[_0x7fb2('0xb5')](_0x39969b)&&!_[_0x7fb2('0xb5')](_0x39969b[_0x7fb2('0xe5')])&&!_['isNil'](_0x39969b['variable'][_0x7fb2('0xe6')])&&_0x39969b[_0x7fb2('0xe7')]===_0x7fb2('0xe8')&&_0x37ff1e){if(_0x37ff1e['type']!=='ivr'&&this[_0x7fb2('0x24')][_0x37ff1e[_0x7fb2('0xb9')]][_0x7fb2('0xe9')]&&_0x39969b[_0x7fb2('0xea')]==='HANGUP'){delete this[_0x7fb2('0xb3')][_0x39969b[_0x7fb2('0xeb')]];this[_0x7fb2('0xba')](this['voiceQueues'][_0x37ff1e[_0x7fb2('0xb9')]]);this[_0x7fb2('0x24')][_0x37ff1e['queue']][_0x7fb2('0x65')]+=0x1;this[_0x7fb2('0x24')][_0x37ff1e[_0x7fb2('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x40127c=new Hangup(_0x37ff1e,_0x39969b);_0x40127c[_0x7fb2('0xaf')]=0x12;_0x40127c['statedesc']=_0x7fb2('0xec');_0x40127c['membername']=_0x7fb2('0xed');ami['emit'](_0x7fb2('0xee'),ut['buildObj'](_0x40127c,_0x7fb2('0xef')));this[_0x7fb2('0xe4')](_0x40127c,'[syncHangupInAMD][createHistory]',_0x7fb2('0xf0'));}if(_0x37ff1e['type']!==_0x7fb2('0x81')&&this['voiceQueues'][_0x37ff1e['queue']][_0x7fb2('0xe9')]&&_0x39969b[_0x7fb2('0xea')]===_0x7fb2('0xf1')){return new Promise(function(_0xc420c5,_0x1c7be3){delete _0x62acf6[_0x7fb2('0xb3')][_0x39969b[_0x7fb2('0xeb')]];_0x62acf6[_0x7fb2('0xba')](_0x62acf6['voiceQueues'][_0x37ff1e[_0x7fb2('0xb9')]]);_0x62acf6[_0x7fb2('0x24')][_0x37ff1e[_0x7fb2('0xb9')]][_0x7fb2('0x65')]+=0x1;_0x62acf6[_0x7fb2('0x24')][_0x37ff1e[_0x7fb2('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x75b0aa=_0x62acf6[_0x7fb2('0x24')][_0x37ff1e[_0x7fb2('0xb9')]];var _0x4f4cd7=new Hangup(_0x37ff1e,_0x39969b);_0x4f4cd7[_0x7fb2('0xaf')]=0x13;_0x4f4cd7['statedesc']=_0x7fb2('0xf2');_0x4f4cd7[_0x7fb2('0xf3')]=_0x7fb2('0xed');_0x4f4cd7['countmachineretry']+=0x1;_0x4f4cd7['countglobal']+=0x1;_0x4f4cd7[_0x7fb2('0xef')]=!![];ami[_0x7fb2('0x53')](_0x7fb2('0xee'),ut['buildObj'](_0x4f4cd7,_0x7fb2('0xef')));_0x62acf6[_0x7fb2('0xd6')](_0x4f4cd7)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xf4')));if(_0x4f4cd7[_0x7fb2('0xf5')]+_0x4f4cd7[_0x7fb2('0xf6')]+_0x4f4cd7[_0x7fb2('0xf7')]+_0x4f4cd7[_0x7fb2('0xf8')]+_0x4f4cd7[_0x7fb2('0xf9')]+_0x4f4cd7[_0x7fb2('0xfa')]+_0x4f4cd7[_0x7fb2('0xfb')]+_0x4f4cd7[_0x7fb2('0xfc')]>=_0x75b0aa[_0x7fb2('0xfd')]){_0x62acf6[_0x7fb2('0xfe')](_0x4f4cd7,_0xc420c5,_0x1c7be3,'reason19\x20machine....');}else{if(_0x4f4cd7[_0x7fb2('0xfb')]>=_0x75b0aa[_0x7fb2('0xff')]){_0x62acf6['createStateFinal'](_0x4f4cd7,_0xc420c5,_0x1c7be3,_0x7fb2('0x100'));}else{_0x62acf6['rescheduleContact']({'active':![],'countmachineretry':_0x4f4cd7[_0x7fb2('0xfb')],'scheduledat':moment()[_0x7fb2('0x101')](_0x75b0aa[_0x7fb2('0x102')],'minutes')['format'](_0x7fb2('0x103')),'ContactId':_0x4f4cd7[_0x7fb2('0xdc')],'ListId':_0x4f4cd7[_0x7fb2('0x104')],'VoiceQueueId':_0x4f4cd7[_0x7fb2('0x105')]||undefined,'CampaignId':_0x4f4cd7[_0x7fb2('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0xc420c5({'reschedule':0x1});}}});}if(_0x37ff1e['type']===_0x7fb2('0x81')&&this[_0x7fb2('0x25')][_0x37ff1e[_0x7fb2('0xb9')]][_0x7fb2('0xe9')]&&_0x39969b['value']===_0x7fb2('0x106')){delete this[_0x7fb2('0xb3')][_0x39969b[_0x7fb2('0xeb')]];this['updateOriginated'](this[_0x7fb2('0x25')][_0x37ff1e[_0x7fb2('0xb9')]]);_0x40127c=new Hangup(_0x37ff1e,_0x39969b);_0x40127c['state']=0x12;_0x40127c[_0x7fb2('0xb0')]=_0x7fb2('0xec');_0x40127c[_0x7fb2('0xf3')]=_0x7fb2('0xed');ami['emit'](_0x7fb2('0xee'),ut[_0x7fb2('0x107')](_0x40127c,_0x7fb2('0xef')));this['saveInDb'](_0x40127c,_0x7fb2('0x108'),_0x7fb2('0x109'));}if(_0x37ff1e['type']==='ivr'&&this['campaigns'][_0x37ff1e[_0x7fb2('0xb9')]]['dialAMDActive']&&_0x39969b[_0x7fb2('0xea')]===_0x7fb2('0xf1')){return new Promise(function(_0x503993,_0x2068f1){delete _0x62acf6[_0x7fb2('0xb3')][_0x39969b[_0x7fb2('0xeb')]];_0x62acf6[_0x7fb2('0xba')](_0x62acf6[_0x7fb2('0x25')][_0x37ff1e[_0x7fb2('0xb9')]]);_0x62acf6[_0x7fb2('0x25')][_0x37ff1e['queue']][_0x7fb2('0x65')]+=0x1;_0x62acf6[_0x7fb2('0x25')][_0x37ff1e['queue']][_0x7fb2('0x10a')]+=0x1;var _0x3bd714=_0x62acf6['campaigns'][_0x37ff1e['queue']];var _0x5ebcea=new Hangup(_0x37ff1e,_0x39969b);_0x5ebcea[_0x7fb2('0xaf')]=0x13;_0x5ebcea['statedesc']=_0x7fb2('0xf2');_0x5ebcea[_0x7fb2('0xf3')]=_0x7fb2('0xed');_0x5ebcea[_0x7fb2('0xfb')]+=0x1;_0x5ebcea[_0x7fb2('0x10b')]+=0x1;_0x5ebcea['amd']=!![];ami[_0x7fb2('0x53')](_0x7fb2('0xee'),ut[_0x7fb2('0x107')](_0x5ebcea,_0x7fb2('0xef')));_0x62acf6['createHistory'](_0x5ebcea)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5ebcea['countbusyretry']+_0x5ebcea['countcongestionretry']+_0x5ebcea[_0x7fb2('0xf7')]+_0x5ebcea[_0x7fb2('0xf8')]+_0x5ebcea[_0x7fb2('0xf9')]+_0x5ebcea[_0x7fb2('0xfa')]+_0x5ebcea[_0x7fb2('0xfb')]+_0x5ebcea['countagentrejectretry']>=_0x3bd714[_0x7fb2('0xfd')]){_0x62acf6['stateGlobal'](_0x5ebcea,_0x503993,_0x2068f1,_0x7fb2('0x10c'));}else{if(_0x5ebcea['countmachineretry']>=_0x3bd714[_0x7fb2('0xff')]){_0x62acf6['createStateFinal'](_0x5ebcea,_0x503993,_0x2068f1,_0x7fb2('0x100'));}else{_0x62acf6[_0x7fb2('0xc9')]({'active':![],'countmachineretry':_0x5ebcea[_0x7fb2('0xfb')],'scheduledat':moment()[_0x7fb2('0x101')](_0x3bd714['dialMachineRetryFrequency'],_0x7fb2('0x10d'))['format'](_0x7fb2('0x103')),'ContactId':_0x5ebcea[_0x7fb2('0xdc')],'ListId':_0x5ebcea[_0x7fb2('0x104')],'VoiceQueueId':_0x5ebcea[_0x7fb2('0x105')]||undefined,'CampaignId':_0x5ebcea[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x10e')));_0x503993({'reschedule':0x1});}}});}}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x3a')]=function(_0x889744){var _0x28300b=this[_0x7fb2('0xb3')][_0x889744[_0x7fb2('0xeb')]];var _0x303530;if(_0x28300b&&_0x28300b[_0x7fb2('0x54')]===_0x7fb2('0x81')){delete this[_0x7fb2('0xb3')][_0x889744['uniqueid']];this[_0x7fb2('0xba')](this['campaigns'][_0x28300b['queue']]);this[_0x7fb2('0x25')][_0x28300b[_0x7fb2('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x303530=new Hangup(_0x28300b,_0x889744);this[_0x7fb2('0xd6')](_0x303530)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7fb2('0xd4')](_0x303530)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x10f')));}if(_0x28300b&&_0x28300b['type']!==_0x7fb2('0x81')&&isNotNull(this[_0x7fb2('0x24')][_0x28300b['queue']][_0x7fb2('0x110')])){delete this[_0x7fb2('0xb3')][_0x889744[_0x7fb2('0xeb')]];this['updateOriginated'](this[_0x7fb2('0x24')][_0x28300b['queue']]);this[_0x7fb2('0x24')][_0x28300b[_0x7fb2('0xb9')]][_0x7fb2('0x65')]+=0x1;this[_0x7fb2('0x24')][_0x28300b[_0x7fb2('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x303530=new Hangup(_0x28300b,_0x889744);_0x303530[_0x7fb2('0xaf')]=0x10;_0x303530['statedesc']='AnswerAGI';_0x303530[_0x7fb2('0xf3')]='AGI';this[_0x7fb2('0xd6')](_0x303530)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x111')));this[_0x7fb2('0xd4')](_0x303530)[_0x7fb2('0xbd')](loggerCatch('[syncHangupIvr]'));}if(_0x28300b&&_0x28300b['type']!=='ivr'&&!isNotNull(this[_0x7fb2('0x24')][_0x28300b['queue']]['dialQueueProject'])){delete this[_0x7fb2('0xb3')][_0x889744[_0x7fb2('0xeb')]];this[_0x7fb2('0xba')](this[_0x7fb2('0x24')][_0x28300b['queue']]);this[_0x7fb2('0x24')][_0x28300b[_0x7fb2('0xb9')]][_0x7fb2('0x112')]+=0x1;_0x303530=new Hangup(_0x28300b,_0x889744);_0x303530[_0x7fb2('0xaf')]=0xc;_0x303530['statedesc']=_0x889744['cause-txt'];_0x303530['membername']=_0x7fb2('0x113');this['createHistory'](_0x303530)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x111')));this[_0x7fb2('0xd4')](_0x303530)[_0x7fb2('0xbd')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x7fb2('0x1e')]['syncAgentComplete']=function(_0x27ada7){var _0x19bf9d=this[_0x7fb2('0xb3')][_0x27ada7[_0x7fb2('0xeb')]];if(this[_0x7fb2('0x24')][_0x27ada7[_0x7fb2('0xb9')]]){if(_0x19bf9d&&_0x19bf9d[_0x7fb2('0x54')]!==_0x7fb2('0x81')){delete this[_0x7fb2('0xb3')][_0x27ada7[_0x7fb2('0xeb')]];this[_0x7fb2('0x24')][_0x27ada7[_0x7fb2('0xb9')]][_0x7fb2('0x65')]+=0x1;var _0x4c42c5=new AgentComplete(_0x19bf9d,_0x27ada7);if(_0x27ada7[_0x7fb2('0x114')]===_0x7fb2('0x115')){_0x4c42c5[_0x7fb2('0x116')]=this[_0x7fb2('0x24')][_0x27ada7[_0x7fb2('0xb9')]]['dialQueueProject2']&&this[_0x7fb2('0x24')][_0x27ada7[_0x7fb2('0xb9')]][_0x7fb2('0x117')]?moment()[_0x7fb2('0x7e')](_0x7fb2('0x103')):undefined;}this[_0x7fb2('0xd6')](_0x4c42c5)[_0x7fb2('0xbd')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7fb2('0xd4')](_0x4c42c5)['catch'](loggerCatch(_0x7fb2('0x118')));}}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x30')]=function(_0xeb9646){if(this[_0x7fb2('0x24')][_0xeb9646['queue']]){if(this[_0x7fb2('0xb3')][_0xeb9646[_0x7fb2('0xeb')]]&&this[_0x7fb2('0xb3')][_0xeb9646['uniqueid']]['type']!==_0x7fb2('0x81')){this['updateOriginated'](this[_0x7fb2('0x24')][_0xeb9646[_0x7fb2('0xb9')]]);this[_0x7fb2('0xb3')][_0xeb9646[_0x7fb2('0xeb')]][_0x7fb2('0x119')]=moment()[_0x7fb2('0x7e')](_0x7fb2('0x103'));}}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x11a')]=function(_0x4d34be,_0x556351){this[_0x7fb2('0xd6')](_0x4d34be)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x11b')));if(_0x556351==0x0){this[_0x7fb2('0xd4')](_0x4d34be)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x11c')));}};Dialer['prototype'][_0x7fb2('0x32')]=function(_0x4375c3){var _0x440342=this[_0x7fb2('0xb3')][_0x4375c3[_0x7fb2('0xeb')]];var _0x545d51=this;var _0x1169dd=![];var _0x2cc527;var _0x4ac657;if(this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]]){if(_0x440342&&_0x440342[_0x7fb2('0x54')]!=='ivr'){delete this[_0x7fb2('0xb3')][_0x4375c3[_0x7fb2('0xeb')]];this[_0x7fb2('0xba')](this[_0x7fb2('0x24')][_0x4375c3['queue']]);_0x440342['droptime']=moment()['format'](_0x7fb2('0x103'));var _0x4b566f=new QueueCallerAbandon(_0x440342,_0x4375c3);if(getSeconds(_0x440342[_0x7fb2('0x11d')],_0x440342['responsetime'])>=_0x440342[_0x7fb2('0x11e')]){this['voiceQueues'][_0x4375c3[_0x7fb2('0xb9')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x4375c3['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x73')]+=0x1;_0x4b566f[_0x7fb2('0xaf')]=0xa;_0x4b566f['statedesc']=_0x7fb2('0x11f');_0x4b566f[_0x7fb2('0x120')]=_0x7fb2('0x121');_0x4b566f[_0x7fb2('0x116')]=this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x122')]?moment()[_0x7fb2('0x7e')](_0x7fb2('0x103')):undefined;_0x4b566f[_0x7fb2('0xf9')]+=0x1;_0x4b566f[_0x7fb2('0x10b')]+=0x1;_0x2cc527=this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x123')];_0x4ac657=this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x124')];_0x545d51['verifyAdditionalPhones'](_0x4b566f,_0x4b566f[_0x7fb2('0xaf')],_0x440342[_0x7fb2('0x125')])[_0x7fb2('0x43')](function(_0x26e023){_0x1169dd=_0x26e023[_0x7fb2('0x126')]==0x1;if(_0x4b566f[_0x7fb2('0xf9')]>=_0x545d51[_0x7fb2('0x24')][_0x4375c3['queue']][_0x7fb2('0x127')]){_0x545d51[_0x7fb2('0x11a')](_0x4b566f,_0x26e023[_0x7fb2('0x126')]);}else{_0x545d51['rescheduleContact']({'active':![],'countdropretry':_0x4b566f[_0x7fb2('0xf9')],'scheduledat':moment()[_0x7fb2('0x101')](_0x545d51[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x123')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x440342['ContactId'],'ListId':_0x440342[_0x7fb2('0x104')],'VoiceQueueId':_0x440342[_0x7fb2('0x105')]||undefined,'CampaignId':_0x440342[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x128')));var _0x131818=new History(_0x4b566f);_0x131818[_0x7fb2('0xaf')]=0xa;_0x131818[_0x7fb2('0xb0')]=_0x7fb2('0x11f');_0x131818[_0x7fb2('0x129')]=moment()['format'](_0x7fb2('0x103'));_0x131818['endtime']=_0x131818[_0x7fb2('0x129')];_0x131818[_0x7fb2('0x12a')]=_0x4b566f[_0x7fb2('0x12a')];_0x131818[_0x7fb2('0x12b')]=_0x4b566f[_0x7fb2('0x12b')];_0x545d51[_0x7fb2('0xd6')](_0x131818)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x12c')));}})[_0x7fb2('0x43')](function(){if(_0x1169dd)_0x545d51[_0x7fb2('0xc3')](_0x4b566f,_0x2cc527,_0x4ac657)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x70')]+=0x1;this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x69')]+=0x1;_0x4b566f[_0x7fb2('0xaf')]=0xb;_0x4b566f[_0x7fb2('0xb0')]=_0x7fb2('0x12d');_0x4b566f['dropreason']=_0x7fb2('0x12e');_0x4b566f['countabandonedretry']+=0x1;_0x4b566f[_0x7fb2('0x10b')]+=0x1;_0x2cc527=this[_0x7fb2('0x24')][_0x4375c3['queue']][_0x7fb2('0x12f')];_0x4ac657=this[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x124')];_0x545d51[_0x7fb2('0xc1')](_0x4b566f,_0x4b566f[_0x7fb2('0xaf')],_0x440342[_0x7fb2('0x125')])[_0x7fb2('0x43')](function(_0x5fd9){if(_0x4b566f[_0x7fb2('0xfa')]>=_0x545d51[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]][_0x7fb2('0x130')]){_0x545d51[_0x7fb2('0x11a')](_0x4b566f,_0x5fd9[_0x7fb2('0x126')]);}else{_0x545d51[_0x7fb2('0xc9')]({'active':![],'countabandonedretry':_0x4b566f[_0x7fb2('0xfa')],'scheduledat':moment()[_0x7fb2('0x101')](_0x545d51[_0x7fb2('0x24')][_0x4375c3[_0x7fb2('0xb9')]]['dialAbandonedRetryFrequency'],'minutes')[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x440342[_0x7fb2('0xdc')],'ListId':_0x440342[_0x7fb2('0x104')],'VoiceQueueId':_0x440342[_0x7fb2('0x105')]||undefined,'CampaignId':_0x440342[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x116d98=new History(_0x4b566f);_0x116d98[_0x7fb2('0xaf')]=0xb;_0x116d98[_0x7fb2('0xb0')]=_0x7fb2('0x12d');_0x116d98[_0x7fb2('0x129')]=moment()[_0x7fb2('0x7e')](_0x7fb2('0x103'));_0x116d98['endtime']=_0x116d98[_0x7fb2('0x129')];_0x116d98[_0x7fb2('0x12a')]=_0x4b566f['calleridname'];_0x116d98[_0x7fb2('0x12b')]=_0x4b566f[_0x7fb2('0x12b')];_0x545d51[_0x7fb2('0xd6')](_0x116d98)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x131')));}})['then'](function(){if(_0x1169dd)_0x545d51[_0x7fb2('0xc3')](_0x4b566f,_0x2cc527,_0x4ac657)[_0x7fb2('0x43')](function(){return 0x1;});});}}}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x3b')]=function(_0x57329b){if(this[_0x7fb2('0x2a')][_0x57329b[_0x7fb2('0xeb')]]){this['actions'][_0x57329b[_0x7fb2('0xeb')]][_0x7fb2('0x132')]=_0x57329b[_0x7fb2('0x132')];}if(this[_0x7fb2('0xb3')][_0x57329b[_0x7fb2('0xeb')]]){this[_0x7fb2('0xb3')][_0x57329b[_0x7fb2('0xeb')]][_0x7fb2('0x132')]=_0x57329b['channel'];}};Dialer[_0x7fb2('0x1e')]['syncQueueMember']=function(_0x2d975d){if(strategy[this[_0x7fb2('0x24')][this[_0x7fb2('0x2a')][_0x2d975d['actionid']]['queue']]['strategy']]===_0x7fb2('0x133')){if(this[_0x7fb2('0x2a')][_0x2d975d['actionid']]&&_[_0x7fb2('0xb5')](this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]][_0x7fb2('0x135')])&&_0x2d975d[_0x7fb2('0xb7')]==='1'&&_0x2d975d[_0x7fb2('0x136')]==='0'){if(this['agents'][_0x2d975d[_0x7fb2('0x137')]]){if(!this['agents'][_0x2d975d[_0x7fb2('0x137')]]['locked']){this[_0x7fb2('0x26')][_0x2d975d[_0x7fb2('0x137')]][_0x7fb2('0x135')]=!![];this[_0x7fb2('0x2a')][_0x2d975d['actionid']][_0x7fb2('0x135')]=!![];this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]]['stateinterface']=_0x2d975d[_0x7fb2('0x137')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x2d975d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]['strategy']]||_0x7fb2('0x1d'))===_0x7fb2('0x1d')){if(this['actions'][_0x2d975d[_0x7fb2('0x134')]]){if(this[_0x7fb2('0x26')][_0x2d975d[_0x7fb2('0x137')]]){this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]]['stateinterface']=_0x2d975d[_0x7fb2('0x137')];if(_['isNil'](this['queueBooked'][this[_0x7fb2('0x2a')][_0x2d975d['actionid']][_0x7fb2('0xb9')]])){this[_0x7fb2('0x2e')][this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]=[];}this[_0x7fb2('0x2e')][this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]][_0x7fb2('0x138')](_[_0x7fb2('0x94')](_[_0x7fb2('0x139')](this[_0x7fb2('0x2a')][_0x2d975d[_0x7fb2('0x134')]],[_0x7fb2('0x13a'),'stateinterface']),{'status':_0x2d975d['status'],'paused':_0x2d975d[_0x7fb2('0x136')]}));}}}};function unlockQueueStatus(_0x1aae45,_0xe949ff){setTimeout(function(){if(_[_0x7fb2('0x8b')](_0x1aae45[_0x7fb2('0x13b')])){loggerBooked[_0x7fb2('0x9f')]('[unlockQueueStatus][undefined]',_0xe949ff);}_0x1aae45[_0x7fb2('0x13b')]=!![];loggerBooked[_0x7fb2('0x84')](_0x7fb2('0x13c'),_0xe949ff,JSON[_0x7fb2('0x50')](_['pick'](_0x1aae45,[_0x7fb2('0x4e'),_0x7fb2('0x13b')])));},0x1f3);}Dialer[_0x7fb2('0x1e')][_0x7fb2('0x40')]=function(_0x4ea06d){var _0xbe8ab3=this;var _0x3e8dfb=_0xbe8ab3[_0x7fb2('0x24')][_0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]];if(strategy[this[_0x7fb2('0x24')][this[_0x7fb2('0x2a')][_0x4ea06d['actionid']]['queue']][_0x7fb2('0x56')]]===_0x7fb2('0x133')){if(this[_0x7fb2('0x2a')][_0x4ea06d['actionid']]&&this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0x137')]){this[_0x7fb2('0x23')][_0x7fb2('0x13d')](this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]]['idHopper'],this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0x137')])[_0x7fb2('0xbd')](function(_0x2a1360){logger[_0x7fb2('0x9f')](_0x7fb2('0x13e'),util[_0x7fb2('0x9e')](_0x2a1360,{'showHidden':![],'depth':null}));})[_0x7fb2('0x21')](function(){_0xbe8ab3['updateOriginated'](_0xbe8ab3[_0x7fb2('0x24')][_0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]);_0xbe8ab3[_0x7fb2('0x26')][_0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0x137')]][_0x7fb2('0x135')]=![];delete _0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]];unlockQueueStatus(_0x3e8dfb);});}else{this[_0x7fb2('0xba')](this[_0x7fb2('0x24')][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xdc')],'ListId':this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0x104')],'VoiceQueueId':this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x7fb2('0x2a')][_0x4ea06d['actionid']]['CampaignId']||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x13f')));delete this['actions'][_0x4ea06d[_0x7fb2('0x134')]];unlockQueueStatus(_0x3e8dfb);}}else if((strategy[this['voiceQueues'][this[_0x7fb2('0x2a')][_0x4ea06d['actionid']][_0x7fb2('0xb9')]][_0x7fb2('0x56')]]||'rrmemory')===_0x7fb2('0x1d')){var _0x4e1d46;if(this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]]&&!_[_0x7fb2('0x4d')](this['queueBooked'][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]]['queue']])){if(this[_0x7fb2('0x140')][_0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d['actionid']][_0x7fb2('0xb9')]]){this[_0x7fb2('0x140')][_0xbe8ab3[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]=this[_0x7fb2('0x140')][this['actions'][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]]?this['queueBookedRR'][this['actions'][_0x4ea06d['actionid']][_0x7fb2('0xb9')]]:this[_0x7fb2('0x2e')][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]]['queue']]?this[_0x7fb2('0x2e')][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]][_0x7fb2('0x141')]||0x0:0x0;}this[_0x7fb2('0x2e')][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]][_0x7fb2('0x141')]=this[_0x7fb2('0x140')][this[_0x7fb2('0x2a')][_0x4ea06d[_0x7fb2('0x134')]][_0x7fb2('0xb9')]];for(var _0x516e84=0x0;_0x516e84=0x0;})[_0x7fb2('0xbd')](myreject(_0xbe28e)));}}else{_0xfd773f[_0x7fb2('0x138')](ami[_0x7fb2('0xb6')]({'action':_0x7fb2('0x157'),'command':util['format'](_0x7fb2('0x158'),_0x24c28c,!_['isUndefined'](config[_0x7fb2('0x154')][_0x27e559])?_0x27e559:'')})[_0x7fb2('0x43')](function(_0x2ea022){return _0x2ea022[_0x7fb2('0x15a')]['indexOf'](_0x7fb2('0x15c'))>=0x0;})['catch'](myreject(_0xbe28e)));}Promise[_0x7fb2('0x15d')](_0xfd773f)[_0x7fb2('0x43')](function(_0x319a43){var _0x53fedf=_[_0x7fb2('0x15e')](_0x319a43);if(_0x53fedf){return _0x48f83f(_0x53fedf);}else{_0x463cf4[_0x7fb2('0x45')]=_0x6388fc?_0x7fb2('0x15f'):_0x7fb2('0x160');return _0xbe28e(msgResponse(_0x7fb2('0x161'),_0x7fb2('0x151'),_0x7fb2('0x162')+_0x6388fc+'\x20'+_0x2320f1+_0x7fb2('0x163')+util[_0x7fb2('0x9e')](_0x24c28c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x27e559));}})[_0x7fb2('0xbd')](function(_0x27c623){return _0xbe28e(msgResponse(_0x7fb2('0x14f'),_0x7fb2('0x151'),JSON[_0x7fb2('0x50')](_0x27c623)));});});};Dialer['prototype']['checkDialMethod']=function(_0x977f41){var _0x2b337c=this;return function(){switch(_0x977f41[_0x7fb2('0x164')]){case _0x7fb2('0x165'):freeVariablesPredictive(_0x977f41);_0x2b337c[_0x7fb2('0x166')](_0x977f41,0x1);break;case'power':freeVariablesPredictive(_0x977f41);_0x2b337c[_0x7fb2('0x166')](_0x977f41,_0x977f41[_0x7fb2('0x167')]);break;case _0x7fb2('0x168'):_0x2b337c[_0x7fb2('0x168')](_0x977f41);break;case _0x7fb2('0x9'):freeVariablesPredictive(_0x977f41);_0x2b337c[_0x7fb2('0x166')](_0x977f41,0x1);break;default:freeVariablesPredictive(_0x977f41);logger[_0x7fb2('0x9f')]('Queue',_0x977f41[_0x7fb2('0x4e')],_0x7fb2('0x169'));}};};Dialer['prototype'][_0x7fb2('0x16a')]=function(_0x1fb022){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper[_0x7fb2('0x16b')](_0x1fb022['id'],previewRecallmeReminderInterval))['then'](function(_0x3d56b4){for(var _0x247ff6=0x0;_0x247ff6<_0x3d56b4['length'];_0x247ff6++){var _0x259697=_0x3d56b4[_0x247ff6]['Agent']['name'];if(_0x259697)io['to'](util[_0x7fb2('0x7e')](_0x7fb2('0x16c'),_0x259697))[_0x7fb2('0x53')](_0x7fb2('0x16d'),{'hopper':_0x3d56b4[_0x247ff6]});}})['catch'](function(){});};Dialer[_0x7fb2('0x1e')]['launchHandleIvr']=function(_0x5f0c6a){var _0x79858=this;return function(){_0x79858[_0x7fb2('0x16e')](_0x5f0c6a);};};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xc')]=function(_0x299a53){var _0x48520c=this;if(isNotPreview(_0x299a53[_0x7fb2('0x164')])){if(isVoiceQueueOutbound(_0x299a53[_0x7fb2('0x54')])&&isActive(_0x299a53[_0x7fb2('0x61')])){_0x299a53[_0x7fb2('0xa8')]=!![];Promise['resolve']()['then'](checkIsLoggedIn(_0x299a53,_0x299a53['loggedIn']))[_0x7fb2('0x43')](checkIsActive(_0x299a53,_0x299a53[_0x7fb2('0x61')]))[_0x7fb2('0x43')](checkInterval(_0x299a53))[_0x7fb2('0x43')](_0x48520c[_0x7fb2('0x16f')](_0x299a53))[_0x7fb2('0x43')](_0x48520c[_0x7fb2('0x14e')](_0x299a53['dialGlobalInterval'],_0x299a53[_0x7fb2('0x170')],_0x299a53[_0x7fb2('0x4e')],_0x299a53))[_0x7fb2('0x43')](_0x48520c[_0x7fb2('0x150')](_0x299a53['Interval'],_0x299a53[_0x7fb2('0x170')],_0x299a53[_0x7fb2('0x4e')],_0x299a53))[_0x7fb2('0x43')](_0x48520c['checkDialMethod'](_0x299a53))[_0x7fb2('0xbd')](loggerCatchQueueSummary(_0x7fb2('0x171'),_0x299a53));}else{notSendMessagesQueue(_0x299a53);}}else{freeVariablesPredictive(_0x299a53);}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x39')]=_[_0x7fb2('0x172')](function(){var _0x26e0ea=_['filter'](this['voiceQueues'],function(_0x3708ad){return _0x3708ad[_0x7fb2('0x173')];});var _0x183b17=_[_0x7fb2('0x174')](this[_0x7fb2('0x26')],function(_0x371d12){return _0x371d12[_0x7fb2('0x175')]&&_0x371d12[_0x7fb2('0xb7')]===_0x7fb2('0xe2');});if(_0x26e0ea[_0x7fb2('0xa1')]>0x0&&_0x183b17[_0x7fb2('0xa1')]>0x0){return Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x26e0ea,'id'),previewRecallmeReminderInterval,_[_0x7fb2('0x176')](_0x183b17,'id')))[_0x7fb2('0x43')](function(_0x5cf8f9){for(var _0x95e96f=0x0;_0x95e96f<_0x5cf8f9['length'];_0x95e96f++){var _0x33e5d8=_0x5cf8f9[_0x95e96f][_0x7fb2('0x177')][_0x7fb2('0x4e')];if(_0x33e5d8)io['to'](util[_0x7fb2('0x7e')](_0x7fb2('0x16c'),_0x33e5d8))[_0x7fb2('0x53')](_0x7fb2('0x16d'),{'hopper':_0x5cf8f9[_0x95e96f]});}})[_0x7fb2('0xbd')](function(_0x4657af){logger['error']('checkPreviewRecallReminder',_0x4657af);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x7fb2('0x1e')][_0x7fb2('0x178')]=function(){var _0x68732e=this;var _0xfc3771;for(var _0x537be6 in this['campaigns']){if(typeof this['campaigns'][_0x537be6]!==_0x7fb2('0xd8')){_0xfc3771=this[_0x7fb2('0x25')][_0x537be6];if(isCampaignIvr(_0xfc3771['type'])&&isActive(_0xfc3771[_0x7fb2('0x7c')])){_0xfc3771[_0x7fb2('0xa8')]=!![];Promise[_0x7fb2('0xbc')]()[_0x7fb2('0x43')](checkIsActive(_0xfc3771,_0xfc3771[_0x7fb2('0x7c')]))[_0x7fb2('0x43')](checkInterval(_0xfc3771))['then'](_0x68732e['checkIsTrunkReachable'](_0xfc3771))[_0x7fb2('0x43')](_0x68732e[_0x7fb2('0x14e')](_0xfc3771['dialGlobalInterval'],_0xfc3771['dialTimezone'],_0xfc3771['name'],_0xfc3771))[_0x7fb2('0x43')](_0x68732e[_0x7fb2('0x150')](_0xfc3771['Interval'],_0xfc3771[_0x7fb2('0x170')],_0xfc3771['name'],_0xfc3771))[_0x7fb2('0x43')](_0x68732e[_0x7fb2('0x179')](_0xfc3771))[_0x7fb2('0xbd')](loggerCatchQueueSummary(_0x7fb2('0x17a'),_0xfc3771));}else{notSendMessagesCampaign(_0xfc3771);}}}};function getCallerIdRandom(_0x1e1c34,_0x9020ce){var _0x9e6fa8;var _0x322d91;var _0xb2373f;if(_0x9020ce<=0x0){_0x9020ce=0x1;}_0x9e6fa8=new RegExp(_0x7fb2('0x17b')+_0x9020ce+'}$');_0x322d91=Math['pow'](0xa,_0x9020ce-0x1);_0xb2373f=Math[_0x7fb2('0x17c')](0xa,_0x9020ce)-0x1;return util[_0x7fb2('0x7e')]('%s',_[_0x7fb2('0x17d')](_0x1e1c34,_0x9e6fa8,_[_0x7fb2('0x17e')](_0x322d91,_0xb2373f)));}function extractCalleridName(_0x14d612){var _0x1c39e3=_0x14d612[_0x7fb2('0x17f')](/"(.*?)"/);return _0x1c39e3?_0x1c39e3[0x1]:_0x14d612;}Dialer[_0x7fb2('0x1e')]['actionOriginate']=function(_0x993bbd,_0x45f7a5){var _0x204617=this;var _0x326ddd=uuid['v4']();this['actions'][_0x326ddd]=new Action(_0x993bbd,_0x45f7a5,_0x326ddd);return new Promise(function(_0x1a5e38,_0x2acf7f){if(_[_0x7fb2('0x8b')](_0x993bbd)&&typeof _0x993bbd!==_0x7fb2('0x180')){return _0x2acf7f(msgResponse('originate',_0x7fb2('0x151'),_0x7fb2('0x181')));}if(_[_0x7fb2('0x8b')](_0x45f7a5['phone'])||_0x45f7a5['phone']===null){return _0x2acf7f(msgResponse(_0x7fb2('0x182'),'Failure','contact\x20is\x20undefine'));}var _0x2ea7dd={'XMD-CALLERID':_0x204617['actions'][_0x326ddd][_0x7fb2('0x183')](),'XMD-AGI':_0x993bbd[_0x7fb2('0x110')]?util[_0x7fb2('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x993bbd[_0x7fb2('0x110')]):_0x7fb2('0x184'),'XMD-AGIAFTER':_0x993bbd[_0x7fb2('0x122')]?util[_0x7fb2('0x7e')](_0x7fb2('0x185'),ipAgi,_0x993bbd[_0x7fb2('0x122')]):_0x7fb2('0x184'),'XMD-QUEUE':_0x993bbd[_0x7fb2('0x54')]===_0x7fb2('0x55')?util[_0x7fb2('0x7e')]('\x22%s,%s%s,,,%s\x22',_0x993bbd[_0x7fb2('0x4e')],_0x993bbd[_0x7fb2('0x186')]||'',_0x993bbd['dialAgiAfterHangupAgent']?'c':'',_0x993bbd['dialQueueTimeout']||0x3):_0x7fb2('0x184'),'XMD-CONTACTID':_0x45f7a5[_0x7fb2('0xdc')],'XMD-CDRTYPE':_0x7fb2('0x8'),'CALLERID(all)':_0x204617[_0x7fb2('0x2a')][_0x326ddd][_0x7fb2('0x183')](),'XMD-AMD':_0x993bbd[_0x7fb2('0xe9')]?'ACTIVE':_0x7fb2('0x184'),'XMD-DESTINATION':_0x7fb2('0xe8')};if(_0x993bbd[_0x7fb2('0xe9')]){_0x2ea7dd[_0x7fb2('0x187')]=_0x993bbd[_0x7fb2('0x188')]||0x9c4;_0x2ea7dd[_0x7fb2('0x189')]=_0x993bbd['dialAMDGreeting']||0x5dc;_0x2ea7dd[_0x7fb2('0x18a')]=_0x993bbd[_0x7fb2('0x18b')]||0x320;_0x2ea7dd[_0x7fb2('0x18c')]=_0x993bbd['dialAMDTotalAnalysisTime']||0x1388;_0x2ea7dd[_0x7fb2('0x18d')]=_0x993bbd[_0x7fb2('0x18e')]||0x64;_0x2ea7dd[_0x7fb2('0x18f')]=_0x993bbd[_0x7fb2('0x190')]||0x32;_0x2ea7dd[_0x7fb2('0x191')]=_0x993bbd[_0x7fb2('0x192')]||0x3;_0x2ea7dd[_0x7fb2('0x193')]=_0x993bbd[_0x7fb2('0x194')]||0x100;_0x2ea7dd['XMD-AMDMAXIMUMWORDLENGTH']=_0x993bbd[_0x7fb2('0x195')]||0x1388;}if(_0x993bbd[_0x7fb2('0x54')]===_0x7fb2('0x55')){_0x2ea7dd['XMD-VOICEQUEUEID']=_0x45f7a5[_0x7fb2('0x105')];}else{_0x2ea7dd['XMD-CAMPAIGNID']=_0x45f7a5[_0x7fb2('0xde')];}for(var _0x1fce87 in _0x45f7a5[_0x7fb2('0x196')]){if(typeof _0x45f7a5[_0x7fb2('0x196')][_0x1fce87]!==_0x7fb2('0xd8')){if(isNotNull(_0x45f7a5[_0x7fb2('0x196')][_0x1fce87])&&_0x1fce87!=='id'&&_0x1fce87!==_0x7fb2('0x197')&&_0x1fce87!==_0x7fb2('0x198')&&_0x1fce87!==_0x7fb2('0x199')){_0x2ea7dd[util[_0x7fb2('0x7e')](_0x7fb2('0x19a'),'XMD-',_[_0x7fb2('0x19b')](_0x1fce87))]=_0x45f7a5[_0x7fb2('0x196')][_0x1fce87];}}}var _0x558407=_0x204617[_0x7fb2('0xe1')](_0x993bbd['Trunk'])?getCallerId(_0x993bbd[_0x7fb2('0x7b')][_0x7fb2('0x7d')],_0x993bbd[_0x7fb2('0x19c')],_0x993bbd[_0x7fb2('0x19d')]>0x0?getCallerIdRandom(_0x993bbd[_0x7fb2('0x62')],_0x993bbd[_0x7fb2('0x19d')]):_0x993bbd[_0x7fb2('0x62')]):getCallerId(_[_0x7fb2('0xb5')](_0x993bbd['TrunkBackup'])?_0x993bbd[_0x7fb2('0x7b')][_0x7fb2('0x7d')]:_0x993bbd[_0x7fb2('0x14b')]['callerid'],_0x993bbd[_0x7fb2('0x19c')],_0x993bbd[_0x7fb2('0x19d')]>0x0?getCallerIdRandom(_0x993bbd['dialOriginateCallerIdNumber'],_0x993bbd[_0x7fb2('0x19d')]):_0x993bbd[_0x7fb2('0x62')]);if(_0x558407){_0x2ea7dd[_0x7fb2('0x19e')]=_0x204617[_0x7fb2('0x2a')][_0x326ddd][_0x7fb2('0x19f')]=extractCalleridName(_0x558407);_0x2ea7dd[_0x7fb2('0x1a0')]=_0x45f7a5[_0x7fb2('0x1a1')];}_0x993bbd['variables']=_0x2ea7dd;return ami[_0x7fb2('0xb6')]({'actionid':_0x326ddd,'action':_0x7fb2('0x182'),'channel':_0x204617[_0x7fb2('0xe1')](_0x993bbd[_0x7fb2('0x7b')])?util[_0x7fb2('0x7e')]('SIP/%s/%s%s',_0x993bbd[_0x7fb2('0x7b')]['name'],isNotNull(_0x993bbd[_0x7fb2('0x64')])?_0x993bbd[_0x7fb2('0x64')][_0x7fb2('0x1a2')]()||'':'',_0x993bbd['dialCutDigit']>0x0?_0x45f7a5[_0x7fb2('0x1a1')]['substring'](_0x993bbd[_0x7fb2('0x1a3')]):_0x45f7a5['phone']):util[_0x7fb2('0x7e')](_0x7fb2('0x1a4'),_[_0x7fb2('0xb5')](_0x993bbd['TrunkBackup'])?_0x993bbd[_0x7fb2('0x7b')][_0x7fb2('0x4e')]:_0x993bbd[_0x7fb2('0x14b')][_0x7fb2('0x4e')],isNotNull(_0x993bbd[_0x7fb2('0x64')])?_0x993bbd[_0x7fb2('0x64')]['trim']()||'':'',_0x993bbd[_0x7fb2('0x1a3')]>0x0?_0x45f7a5[_0x7fb2('0x1a1')][_0x7fb2('0x1a5')](_0x993bbd[_0x7fb2('0x1a3')]):_0x45f7a5['phone']),'callerid':_0x558407,'Exten':_0x7fb2('0xe8'),'Context':_0x7fb2('0x1a6'),'Priority':'1','variable':_0x2ea7dd,'timeout':(_0x993bbd[_0x7fb2('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x326ddd})['then'](function(_0xabb13c){return _0x1a5e38(_0xabb13c);})[_0x7fb2('0xbd')](function(_0xac038a){_0x993bbd[_0x7fb2('0x6c')]+=0x1;var _0x47b117=new History(_0x204617['actions'][_0x326ddd]);logger[_0x7fb2('0x9f')](util[_0x7fb2('0x7e')](_0x7fb2('0x1a7'),JSON[_0x7fb2('0x50')](_0xac038a)));_0x47b117[_0x7fb2('0xaf')]=0xe;_0x47b117[_0x7fb2('0xb0')]=_0x7fb2('0x1a8');_0x47b117[_0x7fb2('0x129')]=moment()[_0x7fb2('0x7e')](_0x7fb2('0x103'));_0x47b117['endtime']=_0x47b117[_0x7fb2('0x129')];_0x204617[_0x7fb2('0xd6')](_0x47b117)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1a9')));_0x204617[_0x7fb2('0xd4')](_0x47b117)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1a9')))[_0x7fb2('0x21')](function(){delete _0x204617['actions'][_0x326ddd];return _0x2acf7f(msgResponse(_0x7fb2('0x182'),_0x7fb2('0x1aa'),'originate\x20action\x20Error'));});});});};Dialer[_0x7fb2('0x1e')]['syncOriginateResponse']=function(_0x206326){var _0x5dd56b=this['actions'][_0x206326[_0x7fb2('0x134')]];if(_0x5dd56b){delete this[_0x7fb2('0x2a')][_0x206326[_0x7fb2('0x134')]];_0x5dd56b[_0x7fb2('0x1ab')]=moment()['format'](_0x7fb2('0x103'));var _0x4f5ee1=_0x5dd56b['type']===_0x7fb2('0x81')?this['campaigns'][_0x5dd56b[_0x7fb2('0xb9')]]:this[_0x7fb2('0x24')][_0x5dd56b[_0x7fb2('0x1ac')]()];if(!this[_0x7fb2('0xe0')](_0x206326[_0x7fb2('0x1ad')])){this[_0x7fb2('0xba')](_0x4f5ee1);return this['callProgressDetecting'](_0x5dd56b,_0x4f5ee1,_0x206326)[_0x7fb2('0xbd')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x7fb2('0xb3')][_0x206326[_0x7fb2('0xeb')]]=_0x5dd56b;}};Dialer[_0x7fb2('0x1e')]['checkRetriveMax']=function(_0x372a8c,_0x55a4ab,_0x32b93b){var _0x1fa823=new History(_0x55a4ab);if(_0x1fa823[_0x7fb2('0xf5')]+_0x1fa823[_0x7fb2('0xf6')]+_0x1fa823[_0x7fb2('0xf7')]+_0x1fa823[_0x7fb2('0xf8')]+_0x1fa823[_0x7fb2('0xf9')]+_0x1fa823['countabandonedretry']+_0x1fa823[_0x7fb2('0xfb')]+_0x1fa823[_0x7fb2('0xfc')]>=_0x32b93b['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x372a8c){case 0x3:if(_0x1fa823[_0x7fb2('0xf7')]>=_0x32b93b[_0x7fb2('0x1ae')]-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countnoanswerretry':_0x1fa823[_0x7fb2('0xf7')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x1af')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1b0')));break;case 0x5:if(_0x1fa823['countbusyretry']>=_0x32b93b['dialBusyMaxRetry']-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countbusyretry':_0x1fa823['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x32b93b[_0x7fb2('0x1b1')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823['VoiceQueueId']||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1b2')));break;case 0x8:if(_0x1fa823[_0x7fb2('0xf6')]>=_0x32b93b['dialCongestionMaxRetry']-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countcongestionretry':_0x1fa823[_0x7fb2('0xf6')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x1b3')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823['CampaignId']||undefined})['catch'](loggerCatch(_0x7fb2('0x1b4')));break;case 0x0:if(_0x1fa823[_0x7fb2('0xf8')]>=_0x32b93b['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x7fb2('0xc9')]({'active':![],'countnosuchnumberretry':_0x1fa823[_0x7fb2('0xf8')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x1b5')],'minutes')['format'](_0x7fb2('0x103')),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1fa823[_0x7fb2('0xf9')]>=_0x32b93b[_0x7fb2('0x127')]-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countdropretry':_0x1fa823[_0x7fb2('0xf9')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b['dialDropRetryFrequency'],_0x7fb2('0x10d'))[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823['ListId'],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x128')));break;case 0xb:if(_0x1fa823[_0x7fb2('0xfa')]>=_0x32b93b[_0x7fb2('0x130')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1fa823[_0x7fb2('0xfa')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x12f')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1b6')));break;case 0x13:if(_0x1fa823[_0x7fb2('0xfb')]>=_0x32b93b[_0x7fb2('0xff')]-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countmachineretry':_0x1fa823[_0x7fb2('0xfb')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x102')],_0x7fb2('0x10d'))[_0x7fb2('0x7e')](_0x7fb2('0x103')),'ContactId':_0x1fa823['ContactId'],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})['catch'](loggerCatch(_0x7fb2('0x10e')));break;case 0x14:if(_0x1fa823[_0x7fb2('0xfc')]>=_0x32b93b[_0x7fb2('0x1b7')]-0x1){return!![];}this[_0x7fb2('0xc9')]({'active':![],'countagentrejectretry':_0x1fa823[_0x7fb2('0xfc')]+=0x1,'scheduledat':moment()[_0x7fb2('0x101')](_0x32b93b[_0x7fb2('0x1b8')],_0x7fb2('0x10d'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1fa823[_0x7fb2('0xdc')],'ListId':_0x1fa823[_0x7fb2('0x104')],'VoiceQueueId':_0x1fa823[_0x7fb2('0x105')]||undefined,'CampaignId':_0x1fa823[_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1b9')));break;default:return!![];}};Dialer['prototype'][_0x7fb2('0x1ba')]=function(_0xbba0ac,_0x5d8d88,_0x43315c){var _0x45bb59=this;var _0x2be667=new History(_0xbba0ac);var _0x102ac1=![];var _0xa4edb9;var _0x56c5dd;return new Promise(function(_0x1f1898,_0x380a90){if(_[_0x7fb2('0x8b')](_0x5d8d88)&&typeof _0x5d8d88!==_0x7fb2('0x180')){return _0x380a90(msgResponse(_0x7fb2('0x1bb'),'Failure',_0x7fb2('0x1bc')));}if(_[_0x7fb2('0x8b')](_0x43315c)&&typeof _0x43315c!=='object'){return _0x380a90(msgResponse('[callProgressDetecting]',_0x7fb2('0x151'),_0x7fb2('0x1bd')));}_0x45bb59[_0x7fb2('0xc1')](_0x2be667,_0x43315c[_0x7fb2('0x114')],_0x5d8d88)[_0x7fb2('0x43')](function(_0x1b0912){if(_0x1b0912[_0x7fb2('0x126')]==0x1)_0x102ac1=!![];switch(_0x43315c['reason']){case'0':_0x5d8d88[_0x7fb2('0x6b')]+=0x1;_0x2be667['state']=0x0;_0x2be667['statedesc']=_0x7fb2('0x1be');_0x2be667[_0x7fb2('0xf8')]+=0x1;_0x2be667['countglobal']+=0x1;ami[_0x7fb2('0x53')]('custom:agentnosuchnumber',ut['buildObj'](_0xbba0ac,_0x7fb2('0x1bf')));_0xa4edb9=_0x5d8d88[_0x7fb2('0x1b5')];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];_0x45bb59['createHistory'](_0x2be667)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xf4')));if(_0x45bb59[_0x7fb2('0x1c0')](0x0,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667[_0x7fb2('0xf8')]>=_0x5d8d88[_0x7fb2('0x1c1')]){_0x45bb59[_0x7fb2('0x1c2')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1c3'));}else{_0x45bb59['stateGlobal'](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1c3'));}}break;case'3':_0x5d8d88['outboundNoAnswerCallsDay']+=0x1;_0x2be667['state']=0x3;_0x2be667['statedesc']=_0x7fb2('0x1c4');_0x2be667[_0x7fb2('0xf7')]+=0x1;_0x2be667[_0x7fb2('0x10b')]+=0x1;var _0x2ef003=ut[_0x7fb2('0x1c5')](_0xbba0ac,_0x5d8d88);ami[_0x7fb2('0x53')]('custom:agentnoanswer',_0x2ef003);_0xa4edb9=_0x5d8d88[_0x7fb2('0x1af')];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];_0x45bb59['createHistory'](_0x2be667)[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x1c6')));if(_0x45bb59[_0x7fb2('0x1c0')](0x3,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667[_0x7fb2('0xf7')]>=_0x5d8d88['dialNoAnswerMaxRetry']){_0x45bb59['createStateFinal'](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1c7'));}else{_0x45bb59[_0x7fb2('0xfe')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1c7'));}}break;case'5':_0x5d8d88[_0x7fb2('0x67')]+=0x1;_0x2be667[_0x7fb2('0xaf')]=0x5;_0x2be667[_0x7fb2('0xb0')]=_0x7fb2('0x1c8');_0x2be667['countbusyretry']+=0x1;_0x2be667[_0x7fb2('0x10b')]+=0x1;ami[_0x7fb2('0x53')](_0x7fb2('0x1c9'),ut[_0x7fb2('0x107')](_0xbba0ac,_0x7fb2('0x1ca')));_0xa4edb9=_0x5d8d88['dialBusyRetryFrequency'];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];_0x45bb59['createHistory'](_0x2be667)[_0x7fb2('0xbd')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x45bb59[_0x7fb2('0x1c0')](0x5,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667[_0x7fb2('0xf5')]>=_0x5d8d88[_0x7fb2('0x1cb')]){_0x45bb59[_0x7fb2('0x1c2')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1cc'));}else{_0x45bb59[_0x7fb2('0xfe')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1cc'));}}break;case'8':_0x5d8d88[_0x7fb2('0x1cd')]+=0x1;_0x2be667['state']=0x8;_0x2be667[_0x7fb2('0xb0')]=_0x7fb2('0x1ce');_0x2be667[_0x7fb2('0xf6')]+=0x1;_0x2be667[_0x7fb2('0x10b')]+=0x1;_0xa4edb9=_0x5d8d88[_0x7fb2('0x1b3')];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];ami[_0x7fb2('0x53')]('custom:agentcongestion',ut[_0x7fb2('0x107')](_0xbba0ac,'congestion'));_0x45bb59['createHistory'](_0x2be667)['catch'](loggerCatch(_0x7fb2('0x1cf')));if(_0x45bb59[_0x7fb2('0x1c0')](0x8,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667['countcongestionretry']>=_0x5d8d88[_0x7fb2('0x1d0')]){_0x45bb59[_0x7fb2('0x1c2')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d1'));}else{_0x45bb59[_0x7fb2('0xfe')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d1'));}}break;case'11':_0x5d8d88['outboundAbandonedCallsDay']+=0x1;_0x2be667['state']=0xb;_0x2be667[_0x7fb2('0xb0')]=_0x7fb2('0x12d');_0x2be667[_0x7fb2('0xfa')]+=0x1;_0x2be667[_0x7fb2('0x10b')]+=0x1;_0xa4edb9=_0x5d8d88['dialAbandonedRetryFrequency'];_0x56c5dd=_0x5d8d88['callAdditionalPhoneAfterMin'];_0x45bb59[_0x7fb2('0xd6')](_0x2be667)['catch'](loggerCatch(_0x7fb2('0x131')));if(_0x45bb59[_0x7fb2('0x1c0')](0xb,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667[_0x7fb2('0xfa')]>=_0x5d8d88[_0x7fb2('0x130')]){_0x45bb59[_0x7fb2('0x1c2')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d2'));}else{_0x45bb59[_0x7fb2('0xfe')](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d2'));}}break;case'20':_0x5d8d88[_0x7fb2('0x1d3')]+=0x1;_0x2be667[_0x7fb2('0xaf')]=0x14;_0x2be667[_0x7fb2('0xb0')]='AgentReject';_0x2be667[_0x7fb2('0xfc')]+=0x1;_0x2be667[_0x7fb2('0x10b')]+=0x1;_0xa4edb9=_0x5d8d88[_0x7fb2('0x1b8')];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];ami['emit'](_0x7fb2('0x1d4'),ut['buildObj'](_0xbba0ac,_0x7fb2('0x1d5')));_0x45bb59[_0x7fb2('0xd6')](_0x2be667)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x45bb59[_0x7fb2('0x1c0')](0x14,_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667['countagentrejectretry']>=_0x5d8d88['dialAgentRejectMaxRetry']){_0x45bb59['createStateFinal'](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d6'));}else{_0x45bb59['stateGlobal'](_0x2be667,_0x1f1898,_0x380a90,_0x7fb2('0x1d6'));}}break;default:_0x5d8d88[_0x7fb2('0x112')]+=0x1;_0x2be667[_0x7fb2('0xaf')]=0xc;_0x2be667['statedesc']=_0x43315c['reason'];_0xa4edb9=_0x5d8d88[_0x7fb2('0x1b8')];_0x56c5dd=_0x5d8d88[_0x7fb2('0x124')];_0x45bb59['createHistory'](_0x2be667)[_0x7fb2('0xbd')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x45bb59[_0x7fb2('0x1c0')](_0x43315c[_0x7fb2('0x114')],_0xbba0ac,_0x5d8d88)&&!_0x102ac1){if(_0x2be667[_0x7fb2('0xf5')]+_0x2be667['countcongestionretry']+_0x2be667[_0x7fb2('0xf7')]+_0x2be667[_0x7fb2('0xf8')]+_0x2be667['countdropretry']+_0x2be667[_0x7fb2('0xfa')]+_0x2be667[_0x7fb2('0xfb')]+_0x2be667[_0x7fb2('0xfc')]>=_0x5d8d88[_0x7fb2('0xfd')]){_0x45bb59[_0x7fb2('0xfe')](_0x2be667,_0x1f1898,_0x380a90,_0x43315c[_0x7fb2('0x114')]);}else{_0x45bb59[_0x7fb2('0x1c2')](_0x2be667,_0x1f1898,_0x380a90,_0x43315c['reason']);}}}})[_0x7fb2('0x43')](function(){if(_0x102ac1){_0x45bb59[_0x7fb2('0xc3')](_0x2be667,_0xa4edb9,_0x56c5dd)[_0x7fb2('0x43')](function(){return _0x1f1898(0x1);});}});});};Dialer[_0x7fb2('0x1e')][_0x7fb2('0xfe')]=function(_0x58b201,_0x338b9f,_0x565bbf,_0x4ed637){var _0x12f947=new Final(_0x58b201);_0x12f947[_0x7fb2('0xaf')]=0xf;_0x12f947[_0x7fb2('0xb0')]=_0x7fb2('0x1d7');this['createStateFinal'](_0x12f947,_0x338b9f,_0x565bbf,_0x4ed637);};Dialer['prototype'][_0x7fb2('0x1c2')]=function(_0x53b93c,_0x46c01f,_0x441763,_0x2a5506){this[_0x7fb2('0xd4')](_0x53b93c)[_0x7fb2('0x43')](function(){return _0x46c01f(msgResponse(_0x7fb2('0x1bb'),_0x7fb2('0x1d8'),_0x2a5506));})['catch'](function(){return _0x441763(msgResponse('[moveContactManagedDialer][0]',_0x7fb2('0x151'),'contact\x20not\x20moved'));});};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x168')]=function(_0x18c6dd){var _0x478ff7=_0x18c6dd['dialPredictiveOptimizationPercentage']/0x64;var _0x426709=_0x18c6dd[_0x7fb2('0x1d9')]/(_0x18c6dd[_0x7fb2('0x1d9')]+_0x18c6dd[_0x7fb2('0x65')]);var _0x44826d=Math[_0x7fb2('0x1da')](_0x18c6dd['predictiveIntervalAvailable']*(_0x18c6dd[_0x7fb2('0x1db')]/0x64));var _0x4af29f=Math[_0x7fb2('0x1da')](_0x18c6dd[_0x7fb2('0x75')]*(_0x18c6dd[_0x7fb2('0x1dc')]/0x64));var _0x8677aa=_0x18c6dd[_0x7fb2('0xaa')]+_0x18c6dd['talking'];var _0x2621e4=Math['floor'](_0x18c6dd[_0x7fb2('0x78')]*_0x18c6dd[_0x7fb2('0x91')]*_0x18c6dd['predictiveIntervalHitRate']*_0x18c6dd[_0x7fb2('0x1dd')]);if(_[_0x7fb2('0x8b')](_0x18c6dd['startProgressive'])){if(!_[_0x7fb2('0x8b')](_0x18c6dd[_0x7fb2('0x7a')])){_0x18c6dd[_0x7fb2('0x7a')]=undefined;loggerPredictive[_0x7fb2('0x9f')](_0x7fb2('0x1de'),_0x7fb2('0x1df'));}if(!_[_0x7fb2('0x8b')](_0x18c6dd['handlePredictive'])){loggerPredictive[_0x7fb2('0x9f')](_0x7fb2('0x1de'),_0x7fb2('0x1e0'));clearInterval(_0x18c6dd['handlePredictive']);_0x18c6dd['handlePredictive']=undefined;}_0x18c6dd[_0x7fb2('0x2c')]=moment()['format'](_0x7fb2('0x103'));loggerPredictive[_0x7fb2('0x84')](_0x18c6dd['name'],_0x7fb2('0x1e1'),_0x18c6dd[_0x7fb2('0x2c')]);this[_0x7fb2('0x166')](_0x18c6dd,0x1);}else if(ifInterval(_0x18c6dd['dialPredictiveInterval'],_0x18c6dd[_0x7fb2('0x2c')])){this['handlePower'](_0x18c6dd,0x1);loggerPredictiveCalls[_0x7fb2('0x84')](_0x7fb2('0x1e2'),_0x18c6dd['startProgressive'],_0x18c6dd['name']);_0x18c6dd['erlangCalls']=0x0;_0x18c6dd[_0x7fb2('0x73')]=0x0;}else if(_0x478ff7<_0x426709&&_0x18c6dd[_0x7fb2('0x1e3')]===_0x7fb2('0x1e4')){freeVariablesPredictive(_0x18c6dd);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x1e5'),_0x7fb2('0x1e6'),_0x426709,_0x7fb2('0x2c'),_0x18c6dd[_0x7fb2('0x4e')]);}else if(_0x2621e4<_0x18c6dd[_0x7fb2('0x73')]&&_0x18c6dd['dialPredictiveOptimization']===_0x7fb2('0x1e4')){freeVariablesPredictive(_0x18c6dd);loggerPredictive[_0x7fb2('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x7fb2('0x1e7'),_0x2621e4,_0x7fb2('0x1e8'),_0x18c6dd[_0x7fb2('0x73')],_0x7fb2('0x2c'),_0x18c6dd[_0x7fb2('0x4e')]);}else if(!ifInterval(_0x18c6dd[_0x7fb2('0x1e9')],_0x18c6dd[_0x7fb2('0x2c')])&&_[_0x7fb2('0x8b')](_0x18c6dd[_0x7fb2('0x7a')])&&!_[_0x7fb2('0x8b')](_0x18c6dd['startProgressive'])){_0x18c6dd[_0x7fb2('0x7a')]=moment()[_0x7fb2('0x7e')](_0x7fb2('0x103'));loggerPredictive['info'](_0x18c6dd['name'],'started\x20in\x20predictive\x20at',_0x18c6dd[_0x7fb2('0x7a')]);this[_0x7fb2('0xc6')](_0x18c6dd['dialPredictiveInterval'])[_0x7fb2('0x43')](this[_0x7fb2('0x1ea')](_0x18c6dd))['then'](mergeDataErlangB(_0x18c6dd))[_0x7fb2('0x43')](this[_0x7fb2('0x1eb')](_0x18c6dd))[_0x7fb2('0xbd')](loggerCatchPredictive(_0x7fb2('0x1ec'),_0x18c6dd));}else if(!ifInterval(_0x18c6dd[_0x7fb2('0x1e9')],_0x18c6dd['startPredictive'])){_0x18c6dd['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x18c6dd[_0x7fb2('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7fb2('0x84')](_0x18c6dd[_0x7fb2('0x4e')],'recalculate\x20predictive\x20at',_0x18c6dd[_0x7fb2('0x7a')]);clearInterval(_0x18c6dd[_0x7fb2('0x98')]);_0x18c6dd[_0x7fb2('0x98')]=undefined;this['averageHandleTime'](_0x18c6dd[_0x7fb2('0x1e9')])['then'](this[_0x7fb2('0x1ea')](_0x18c6dd))[_0x7fb2('0x43')](mergeDataErlangB(_0x18c6dd))[_0x7fb2('0x43')](this[_0x7fb2('0x1eb')](_0x18c6dd))[_0x7fb2('0xbd')](loggerCatchPredictive(_0x7fb2('0x1ed'),_0x18c6dd));}else if(_0x18c6dd[_0x7fb2('0x75')]&&_0x8677aa<_0x18c6dd[_0x7fb2('0x75')]-_0x4af29f){freeVariablesPredictive(_0x18c6dd);loggerPredictive['info'](_0x18c6dd['name'],_0x7fb2('0x1ee'),_0x8677aa,')\x20are\x20less\x20than\x20threshold\x20(',_0x18c6dd['predictiveIntervalAvailable'],'-',_0x4af29f,'=',_0x18c6dd[_0x7fb2('0x75')]-_0x4af29f,')');}else if(_0x18c6dd[_0x7fb2('0x75')]&&_0x8677aa>_0x18c6dd[_0x7fb2('0x75')]+_0x44826d){freeVariablesPredictive(_0x18c6dd);loggerPredictive['info'](_0x18c6dd[_0x7fb2('0x4e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x8677aa,_0x7fb2('0x1ef'),_0x18c6dd['predictiveIntervalAvailable'],'+',_0x44826d,'=',_0x18c6dd[_0x7fb2('0x75')]+_0x44826d,')');}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x1ea')]=function(_0xe00148){var _0x5319a4=this;return function(_0x3f704a){return new Promise(function(_0x2f7d38,_0x55e946){_[_0x7fb2('0x94')](_0xe00148,_0x3f704a[0x0]);if(checkGetDataPredictive(_0x3f704a[0x0])){var _0x3cfc8e=_0xe00148[_0x7fb2('0x75')]=_0xe00148[_0x7fb2('0xa9')]+_0xe00148[_0x7fb2('0xaa')];var _0x2d9bed=_0xe00148[_0x7fb2('0x1e9')]*0x3c;var _0x36bd23=_0x3f704a[0x0]['predictiveIntervalAvgTalktime']+_0x3f704a[0x0][_0x7fb2('0x6e')];var _0x5e02bb=(_0x3f704a[0x0]['predictiveIntervalAnsweredCalls']+_0x3f704a[0x0][_0x7fb2('0x71')]+_0x3f704a[0x0][_0x7fb2('0x70')])/_0x3f704a[0x0]['predictiveIntervalTotalCalls'];_0xe00148[_0x7fb2('0x1f0')]=_0x5e02bb>0x0?_0x5e02bb:0x1;switch(_0xe00148[_0x7fb2('0x1e3')]){case'dropRate':var _0x276924=_0xe00148[_0x7fb2('0x1f1')]/0x64;return _0x5319a4[_0x7fb2('0x1f2')](_0x3cfc8e,_0x2d9bed,_0x36bd23,_0x5e02bb,_0x276924)[_0x7fb2('0x43')](function(_0x444c5c){return _0x2f7d38(_0x444c5c);});case _0x7fb2('0x1f3'):var _0x124ffd=_0xe00148[_0x7fb2('0x1f1')]/0x64;return _0x5319a4[_0x7fb2('0x1f4')](_0x3cfc8e,_0x2d9bed,_0x36bd23,_0x5e02bb,_0x124ffd)['then'](function(_0x17b63c){return _0x2f7d38(_0x17b63c);});default:return _0x55e946(msgResponse('[getDataPredictive]','Failure',_0x7fb2('0x1f5')));}}else{return _0x55e946(msgResponse(_0x7fb2('0x1f6'),'Failure',_0x7fb2('0x1f7')));}});};};Dialer[_0x7fb2('0x1e')]['getDataPredictiveOld']=function(_0x4848c4){var _0x553193=this;return function(_0x470f11){return new Promise(function(_0x5e66e4,_0x34f93b){_[_0x7fb2('0x94')](_0x4848c4,_0x470f11[0x0]);if(checkGetDataPredictive(_0x470f11[0x0])){loggerPredictive[_0x7fb2('0x84')](JSON['stringify'](_0x470f11[0x0]));if(_0x4848c4[_0x7fb2('0x1e3')]==='dropRate'){return _0x553193[_0x7fb2('0xd2')](_0x4848c4['id'])[_0x7fb2('0x43')](function(_0x15930d){var _0x512ba5=_0x4848c4[_0x7fb2('0x58')]-_0x15930d[0x0][_0x7fb2('0x1f8')];var _0x1212cb=_0x4848c4[_0x7fb2('0x1e9')]*0x3c;var _0x8c4395=_0x470f11[0x0][_0x7fb2('0x6f')]+_0x470f11[0x0][_0x7fb2('0x6e')];var _0x459964=(_0x470f11[0x0][_0x7fb2('0x6d')]+_0x470f11[0x0][_0x7fb2('0x71')]+_0x470f11[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x470f11[0x0][_0x7fb2('0x76')];var _0x301e38=_0x4848c4['dialPredictiveOptimizationPercentage']/0x64;_0x4848c4[_0x7fb2('0x74')]=_0x15930d[0x0]['outboundQueuePauses']||0x0;_0x4848c4['predictiveIntervalHitRate']=_0x459964>0x0?_0x459964:0x1;return _0x553193[_0x7fb2('0x1f2')](_0x512ba5,_0x1212cb,_0x8c4395,_0x459964,_0x301e38);})[_0x7fb2('0x43')](function(_0x2a4009){return _0x5e66e4(_0x2a4009);})[_0x7fb2('0xbd')](function(_0x8b3028){return _0x34f93b(msgResponse(_0x7fb2('0x1f9'),_0x7fb2('0x151'),JSON['stringify'](_0x8b3028)));});}if(_0x4848c4[_0x7fb2('0x1e3')]===_0x7fb2('0x1f3')){return _0x553193[_0x7fb2('0xd2')](_0x4848c4['id'])['then'](function(_0x5a840a){var _0x5cafe5=_0x4848c4[_0x7fb2('0x58')]-_0x5a840a[0x0][_0x7fb2('0x1f8')];var _0x178d5b=_0x4848c4[_0x7fb2('0x1e9')]*0x3c;var _0x34063f=_0x470f11[0x0][_0x7fb2('0x6f')]+_0x470f11[0x0][_0x7fb2('0x6e')];var _0x8bc441=(_0x470f11[0x0][_0x7fb2('0x6d')]+_0x470f11[0x0][_0x7fb2('0x71')]+_0x470f11[0x0][_0x7fb2('0x70')])/_0x470f11[0x0]['predictiveIntervalTotalCalls'];var _0x5117b0=_0x4848c4['dialPredictiveOptimizationPercentage']/0x64;_0x4848c4[_0x7fb2('0x74')]=_0x5a840a[0x0]['outboundQueuePauses']||0x0;_0x4848c4[_0x7fb2('0x1f0')]=_0x8bc441>0x0?_0x8bc441:0x1;return _0x553193[_0x7fb2('0x1f4')](_0x5cafe5,_0x178d5b,_0x34063f,_0x8bc441,_0x5117b0);})[_0x7fb2('0x43')](function(_0x2213cb){return _0x5e66e4(_0x2213cb);})['catch'](function(_0x1487d9){return _0x34f93b(msgResponse(_0x7fb2('0x1f9'),_0x7fb2('0x151'),JSON[_0x7fb2('0x50')](_0x1487d9)));});}}else{return _0x34f93b(msgResponse(_0x7fb2('0x1f6'),_0x7fb2('0x151'),_0x7fb2('0x1f7')));}});};};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x1eb')]=function(_0x2ee531){var _0x167eea=this;return function(){var _0x405947=0x0;var _0x359727=Math[_0x7fb2('0x1fa')](_0x2ee531['erlangCallToSecond']*0x3e8);if(_0x359727>0x0){_0x359727=_0x359727<0x64?0x64:_0x359727;loggerPredictive[_0x7fb2('0x84')](_0x2ee531[_0x7fb2('0x4e')],_0x7fb2('0x1fb'),_0x359727,'milliseconds');_0x2ee531[_0x7fb2('0x98')]=setInterval(function(){_0x167eea['handlePredictive'](_0x2ee531);loggerPredictiveCalls['info'](_0x7fb2('0x1fc'),_0x405947+=0x1);},_0x359727);}else{loggerPredictive[_0x7fb2('0x84')](_0x2ee531[_0x7fb2('0x4e')],_0x7fb2('0x1fd'));}};};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x1fe')]=function(_0x4c63e9,_0x4f76bc){var _0x9fb7fb=this;return function(_0x185edb){if(_[_0x7fb2('0x4d')](_0x185edb)){if(_[_0x7fb2('0xb5')](_0x4f76bc[_0x7fb2('0xdd')])||!_0x4f76bc[_0x7fb2('0x1ff')]){if(_0x4c63e9[_0x7fb2('0x164')]==='booked'){_0x4c63e9[_0x7fb2('0x13b')]=_[_0x7fb2('0x8b')](_0x4c63e9[_0x7fb2('0x13b')])?!![]:_0x4c63e9[_0x7fb2('0x13b')];var _0x247ba7=uuid['v4']();_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7]=new Action(_0x4c63e9,_0x4f76bc,_0x247ba7);loggerBooked['info'](_0x7fb2('0x200'),_0x247ba7,_0x7fb2('0x201'),JSON[_0x7fb2('0x50')](_0x4c63e9[_0x7fb2('0x13b')]),_0x7fb2('0x202'),_0x4c63e9[_0x7fb2('0x4e')]);if(_0x4c63e9[_0x7fb2('0x13b')]){_0x4c63e9['queueStatusComplete']=![];_0x9fb7fb[_0x7fb2('0x2e')][_0x9fb7fb['actions'][_0x247ba7]['queue']]=[];ami[_0x7fb2('0xb6')]({'actionid':_0x247ba7,'action':'queuestatus','queue':_0x4c63e9[_0x7fb2('0x4e')]})[_0x7fb2('0xbd')](function(){_0x9fb7fb[_0x7fb2('0xba')](_0x4c63e9);_0x9fb7fb['rescheduleContact']({'active':![],'ContactId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0xdc')],'ListId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0x104')],'VoiceQueueId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0x105')]||undefined,'CampaignId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x203')));delete _0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7];});}else{loggerBooked[_0x7fb2('0x84')](_0x7fb2('0x204'),JSON[_0x7fb2('0x50')](_0x4c63e9[_0x7fb2('0x13b')]),_0x7fb2('0x202'),_0x4c63e9[_0x7fb2('0x4e')]);_0x9fb7fb[_0x7fb2('0xba')](_0x4c63e9);_0x9fb7fb[_0x7fb2('0xc9')]({'active':![],'ContactId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0xdc')],'ListId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0x104')],'VoiceQueueId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0x105')]||undefined,'CampaignId':_0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7][_0x7fb2('0xde')]||undefined})[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x203')));delete _0x9fb7fb[_0x7fb2('0x2a')][_0x247ba7];}}else{return _0x9fb7fb[_0x7fb2('0x205')](_0x4c63e9,_0x4f76bc);}}else{if(getDiff(_0x4f76bc[_0x7fb2('0x206')])<_0x4c63e9[_0x7fb2('0x207')]*0x3c){if(_0x4f76bc[_0x7fb2('0x177')]&&!_0x4f76bc[_0x7fb2('0x177')][_0x7fb2('0x208')]){_0x9fb7fb['preview'][_0x7fb2('0x13d')](_0x4f76bc['id'])['finally'](function(){_0x9fb7fb[_0x7fb2('0xba')](_0x4c63e9);});}else{_0x9fb7fb[_0x7fb2('0xcb')]({'active':![]},_0x4f76bc['id'],0x1)['finally'](function(){_0x9fb7fb[_0x7fb2('0xba')](_0x4c63e9);});}}else{_0x4c63e9[_0x7fb2('0x209')]+=0x1;_0x9fb7fb['updateOriginated'](_0x4c63e9);if(_0x4c63e9[_0x7fb2('0x20a')]){_0x9fb7fb['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4f76bc[_0x7fb2('0xdc')],'ListId':_0x4f76bc[_0x7fb2('0x104')],'VoiceQueueId':_0x4f76bc[_0x7fb2('0x105')]||undefined,'CampaignId':_0x4f76bc['CampaignId']||undefined})['catch'](loggerCatch(_0x7fb2('0x20b')));_0x9fb7fb['createHistory'](createObjHistory(_0x4c63e9,_0x4f76bc,_0x7fb2('0x20c'),0x17,'RecallInQueue'))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0x20d')));}else{_0x9fb7fb['saveInDb'](createObjHistory(_0x4c63e9,_0x4f76bc,_0x7fb2('0x20e'),0x16,'RecallFailedTimeout'),_0x7fb2('0x20f'),_0x7fb2('0x210'));}}}}else{_0x4c63e9[_0x7fb2('0x66')]+=0x1;_0x9fb7fb[_0x7fb2('0xe4')](createObjHistory(_0x4c63e9,_0x4f76bc,_0x7fb2('0x211'),0xd,'Blacklist'),_0x7fb2('0x212'),_0x7fb2('0x213'));throw _0x7fb2('0x214');}};};Dialer[_0x7fb2('0x1e')]['handleIvr']=function(_0x24f7b5){var _0x585604=this;var _0x338572=_0x24f7b5[_0x7fb2('0x215')]-_0x24f7b5[_0x7fb2('0x77')]-_0x24f7b5['temp'];emitCampaignSummary(_0x24f7b5);if(_0x338572>0x0){if(_0x338572>this[_0x7fb2('0x28')]){_0x338572=this[_0x7fb2('0x28')];}_0x24f7b5[_0x7fb2('0xce')]+=_0x338572;this[_0x7fb2('0xd0')](_0x24f7b5['id'],_0x338572,_0x24f7b5['dialOrderByScheduledAt'],_0x24f7b5)[_0x7fb2('0x43')](function(_0x2847d7){_0x24f7b5['temp']-=_0x338572;_0x24f7b5['temp']=_0x24f7b5['temp']>0x0?_0x24f7b5[_0x7fb2('0xce')]:0x0;if(!checkContactEmpty(_0x2847d7)){_0x24f7b5['message']=_0x7fb2('0x216');logger[_0x7fb2('0x84')]('[getContactCampaign2][Empty]'+_0x24f7b5[_0x7fb2('0x4e')]);}else{_0x24f7b5[_0x7fb2('0x77')]+=_0x2847d7[_0x7fb2('0xa1')];_0x24f7b5[_0x7fb2('0x45')]='RUNNING';for(var _0x1bab6a=0x0;_0x1bab6a<_0x2847d7[_0x7fb2('0xa1')];_0x1bab6a+=0x1){_0x24f7b5[_0x7fb2('0x217')]+=0x1;if(_[_0x7fb2('0xb5')](_0x2847d7[_0x1bab6a])||_[_0x7fb2('0xb5')](_0x2847d7[_0x1bab6a][_0x7fb2('0x196')])||_[_0x7fb2('0xb5')](_0x2847d7[_0x1bab6a][_0x7fb2('0x1a1')])){_0x585604['emptyContact'](_0x7fb2('0x218'),_0x24f7b5,_0x2847d7[_0x1bab6a]);}else{_0x585604[_0x7fb2('0xc5')](_[_0x7fb2('0x139')](_0x2847d7[_0x1bab6a],[_0x7fb2('0xde'),'phone']))[_0x7fb2('0x43')](_0x585604['checkContactBlack'](_0x24f7b5,_0x2847d7[_0x1bab6a]))[_0x7fb2('0xbd')](_0x585604[_0x7fb2('0x219')]('[actionOriginateIvr]\x20',_0x24f7b5));}}}})['catch'](loggerGetContactDialer(_0x7fb2('0x21a'),_0x24f7b5,_0x338572));}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x166')]=function(_0x2845b5,_0x2319c9){var _0x268f18=this;var _0x190ea6=[];var _0x3714da=_0x2319c9>=0x1?_0x2319c9:0x1;if(_0x2845b5[_0x7fb2('0x164')]===_0x7fb2('0x9')){_0x3714da=0x1;}var _0x2f6d8f=Math[_0x7fb2('0x1fa')](_0x2845b5[_0x7fb2('0xaa')]*_0x3714da)-_0x2845b5[_0x7fb2('0x77')]-_0x2845b5[_0x7fb2('0xce')];emitVoiceQueueSummary(_0x2845b5);if(_0x2845b5[_0x7fb2('0x21b')]>0x0){var _0x4668e0=_0x2845b5[_0x7fb2('0x21b')]-_0x2845b5[_0x7fb2('0x77')]-_0x2845b5['talking']-_0x2845b5[_0x7fb2('0xce')]-_0x2845b5['pTalking'];if(_0x2f6d8f>_0x4668e0){_0x2f6d8f=_0x4668e0;}}if(_0x2f6d8f>0x0){if(_0x2845b5['dialMethod']==='booked'){_0x2f6d8f=0x1;}if(_0x2f6d8f>this[_0x7fb2('0x28')]){_0x2f6d8f=this[_0x7fb2('0x28')];}_0x2845b5[_0x7fb2('0xce')]+=_0x2f6d8f;for(var _0x3f8c1c in this[_0x7fb2('0x26')]){if(typeof this['agents'][_0x3f8c1c]!==_0x7fb2('0xd8')){if(this[_0x7fb2('0x26')][_0x3f8c1c]['state']===_0x7fb2('0x21c')&&this[_0x7fb2('0x26')][_0x3f8c1c][_0x7fb2('0xb7')]===_0x7fb2('0xe2')){_0x190ea6[_0x7fb2('0x138')](this['agents'][_0x3f8c1c]['id']);}}}this[_0x7fb2('0xcd')](_0x2845b5['id'],_0x190ea6,_0x2f6d8f,_0x2845b5[_0x7fb2('0x21d')],_0x2845b5)[_0x7fb2('0x43')](function(_0x17596b){_0x2845b5[_0x7fb2('0xce')]-=_0x2f6d8f;_0x2845b5[_0x7fb2('0xce')]=_0x2845b5['temp']>0x0?_0x2845b5['temp']:0x0;if(!checkContactEmpty(_0x17596b)){_0x268f18['countReScheduled'](_0x2845b5)[_0x7fb2('0x43')](sendMessageReschedule(_0x2845b5))[_0x7fb2('0xbd')](loggerCatch(_0x7fb2('0xbe')));}else{_0x2845b5[_0x7fb2('0x77')]+=_0x17596b['length'];_0x2845b5[_0x7fb2('0x45')]=_0x2845b5[_0x7fb2('0x164')]==='booked'?'ACTIVE':'RUNNING';for(var _0x134982=0x0;_0x134982<_0x17596b[_0x7fb2('0xa1')];_0x134982+=0x1){if(_[_0x7fb2('0xb5')](_0x17596b[_0x134982])||_[_0x7fb2('0xb5')](_0x17596b[_0x134982][_0x7fb2('0x196')])||_[_0x7fb2('0xb5')](_0x17596b[_0x134982][_0x7fb2('0x1a1')])){_0x268f18[_0x7fb2('0xdb')](_0x7fb2('0x218'),_0x2845b5,_0x17596b[_0x134982]);}else{_0x268f18[_0x7fb2('0xbf')](_[_0x7fb2('0x139')](_0x17596b[_0x134982],[_0x7fb2('0x105'),_0x7fb2('0x1a1')]))[_0x7fb2('0x43')](_0x268f18[_0x7fb2('0x1fe')](_0x2845b5,_0x17596b[_0x134982]))[_0x7fb2('0xbd')](_0x268f18['loggerHandler']('[actionOriginate]\x20',_0x2845b5));}}}})[_0x7fb2('0xbd')](loggerGetContactDialer(_0x7fb2('0x21e'),_0x2845b5,_0x2f6d8f));}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x98')]=function(_0x1f5552){if(_0x1f5552[_0x7fb2('0x21b')]>0x0){var _0x2bda1c=_0x1f5552[_0x7fb2('0x21b')]-_0x1f5552[_0x7fb2('0x77')]-_0x1f5552[_0x7fb2('0xa9')];if(_0x2bda1c>0x0){this[_0x7fb2('0x21f')](_0x1f5552);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x7fb2('0x21f')](_0x1f5552);}};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x21f')]=function(_0x10fe25){var _0xd7160c=this;var _0x10b016=[];_0x10fe25[_0x7fb2('0x77')]+=0x1;for(var _0x5217d6 in this[_0x7fb2('0x26')]){if(typeof this[_0x7fb2('0x26')][_0x5217d6]!==_0x7fb2('0xd8')){if(this['agents'][_0x5217d6][_0x7fb2('0xaf')]===_0x7fb2('0x21c')&&this[_0x7fb2('0x26')][_0x5217d6][_0x7fb2('0xb7')]==='reachable'){_0x10b016[_0x7fb2('0x138')](this[_0x7fb2('0x26')][_0x5217d6]['id']);}}}this[_0x7fb2('0xcd')](_0x10fe25['id'],_0x10b016,0x1,_0x10fe25[_0x7fb2('0x21d')],_0x10fe25)[_0x7fb2('0x43')](function(_0xe6df00){if(!checkContactEmpty(_0xe6df00)){checkContactLowerLimitOriginate(_0x10fe25,0x1,0x0);_0xd7160c[_0x7fb2('0x220')](_0x10fe25)[_0x7fb2('0x43')](sendMessageReschedule(_0x10fe25))[_0x7fb2('0xbd')](loggerCatch('[countReScheduled]\x20'));}else{_0x10fe25[_0x7fb2('0x45')]=_0x7fb2('0x221');if(_[_0x7fb2('0xb5')](_0xe6df00[0x0])||_['isNil'](_0xe6df00[0x0][_0x7fb2('0x196')])||_['isNil'](_0xe6df00[0x0][_0x7fb2('0x1a1')])){_0xd7160c['emptyContact'](_0x7fb2('0x218'),_0x10fe25,_0xe6df00[0x0]);}else{_0xd7160c[_0x7fb2('0xbf')](_[_0x7fb2('0x139')](_0xe6df00[0x0],[_0x7fb2('0x105'),_0x7fb2('0x1a1')]))[_0x7fb2('0x43')](_0xd7160c[_0x7fb2('0x1fe')](_0x10fe25,_0xe6df00[0x0]))[_0x7fb2('0xbd')](_0xd7160c[_0x7fb2('0x219')](_0x7fb2('0x222'),_0x10fe25));}}})['catch'](loggerGetContactDialer(_0x7fb2('0x223'),_0x10fe25,0x1));emitVoiceQueueSummary(_0x10fe25);};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x1f2')]=function(_0x4bc769,_0x47fa81,_0x328ccb,_0x5261dd,_0x471755,_0x437d00){loggerPredictive['info'](_0x7fb2('0x224'));loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x225'),_0x4bc769);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x226'),_0x47fa81);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x227'),_0x328ccb);loggerPredictive['info'](_0x7fb2('0x228'),_0x5261dd);loggerPredictive['info'](_0x7fb2('0x229'),_0x471755);loggerPredictive['info'](_0x7fb2('0x22a'));return new Promise(function(_0x2f1a53,_0x27dd5f){if(_0x4bc769<=0x0||isNaN(_0x4bc769)){return _0x27dd5f(msgResponse('[abandonmentRate]',_0x7fb2('0x1aa'),'m\x20=\x20'+_0x4bc769));}if(_0x328ccb<=0x0||isNaN(_0x328ccb)){return _0x27dd5f(msgResponse(_0x7fb2('0x22b'),'Error',_0x7fb2('0x22c')+_0x328ccb));}if(_0x5261dd<=0x0||isNaN(_0x5261dd)){return _0x27dd5f(msgResponse(_0x7fb2('0x22b'),_0x7fb2('0x1aa'),'p\x20=\x20'+_0x5261dd));}if(_0x47fa81<=0x0||isNaN(_0x47fa81)){return _0x27dd5f(msgResponse(_0x7fb2('0x22b'),_0x7fb2('0x1aa'),'interval\x20=\x20'+_0x47fa81));}if(_0x471755<=0x0||isNaN(_0x471755)){return _0x27dd5f(msgResponse(_0x7fb2('0x22b'),_0x7fb2('0x1aa'),_0x7fb2('0x22d')+_0x471755));}_0x437d00=_0x437d00||0x0;var _0x5d1a98=0x1/_0x328ccb;var _0x2a8079=0x0;var _0x1dee71=0x0;var _0x5a0c29=0x0;var _0x3acd6f=0x0;for(var _0x4ccd69=0x0;_0x5a0c29<_0x471755;_0x4ccd69+=0x1){_0x1dee71=_0x4ccd69/_0x47fa81;_0x2a8079=(_0x5261dd*_0x1dee71+_0x437d00)/_0x5d1a98;_0x5a0c29=erlangb(_0x2a8079,_0x4bc769);_0x3acd6f=_0x2a8079/_0x4bc769*(0x1-erlangb(_0x2a8079,_0x4bc769));}return _0x2f1a53({'erlangCalls':_0x4ccd69,'erlangCallToSecond':_0x47fa81/_0x4ccd69,'erlangAbandonmentRate':_0x5a0c29,'erlangBusyFactor':_0x3acd6f});});};Dialer[_0x7fb2('0x1e')][_0x7fb2('0x1f4')]=function(_0x3e3294,_0x2741ea,_0x583cda,_0x70c26a,_0x5a799d,_0x4dbc2c){loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x22e'));loggerPredictive['info'](_0x7fb2('0x225'),_0x3e3294);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x226'),_0x2741ea);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x227'),_0x583cda);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x228'),_0x70c26a);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x22f'),_0x5a799d);loggerPredictive[_0x7fb2('0x84')](_0x7fb2('0x22a'));return new Promise(function(_0x36f78d,_0x16e63c){if(_0x3e3294<=0x0||isNaN(_0x3e3294)){return _0x16e63c(msgResponse(_0x7fb2('0x230'),'Error',_0x7fb2('0x231')+_0x3e3294));}if(_0x583cda<=0x0||isNaN(_0x583cda)){return _0x16e63c(msgResponse(_0x7fb2('0x230'),_0x7fb2('0x1aa'),_0x7fb2('0x22c')+_0x583cda));}if(_0x70c26a<=0x0||isNaN(_0x70c26a)){return _0x16e63c(msgResponse(_0x7fb2('0x230'),_0x7fb2('0x1aa'),_0x7fb2('0x232')+_0x70c26a));}if(_0x2741ea<=0x0||isNaN(_0x2741ea)){return _0x16e63c(msgResponse('[busyFactor]',_0x7fb2('0x1aa'),_0x7fb2('0x233')+_0x2741ea));}if(_0x5a799d<=0x0||isNaN(_0x5a799d)){return _0x16e63c(msgResponse('[busyFactor]',_0x7fb2('0x1aa'),'Umin\x20=\x20'+_0x5a799d));}_0x4dbc2c=_0x4dbc2c||0x0;var _0x3c261d=0x1/_0x583cda;var _0x3fb2c1=0x0;var _0x240ad6=0x0;var _0x89127=0x0;var _0x59a119=0x0;for(var _0x38f051=0x0;_0x59a119<_0x5a799d;_0x38f051+=0x1){_0x240ad6=_0x38f051/_0x2741ea;_0x3fb2c1=(_0x70c26a*_0x240ad6+_0x4dbc2c)/_0x3c261d;_0x89127=erlangb(_0x3fb2c1,_0x3e3294);_0x59a119=_0x3fb2c1/_0x3e3294*(0x1-erlangb(_0x3fb2c1,_0x3e3294));}return _0x36f78d({'erlangCalls':_0x38f051,'erlangCallToSecond':_0x2741ea/_0x38f051,'erlangAbandonmentRate':_0x89127,'erlangBusyFactor':_0x59a119});});};module[_0x7fb2('0x234')]=Dialer; \ No newline at end of file +var _0x7a1b=['[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','SIP/%s','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','state','statedesc','HangupInAMD','membername','emit','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','AMD','countglobal','amd','countbusyretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','reason19\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','iftime\x20%s,%s','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','power','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','map','user:%s','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','[originate][error]','originate','Error','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','reachable','[countReScheduled]\x20','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','stringify','milliseconds','diff','seconds','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','[uniqueid]','actions','undefined','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x7a1b,0x166));var _0xb7a1=function(_0xc90e97,_0x11af46){_0xc90e97=_0xc90e97-0x0;var _0x597e2b=_0x7a1b[_0xc90e97];return _0x597e2b;};'use strict';var util=require(_0xb7a1('0x0'));var _=require(_0xb7a1('0x1'));var uuid=require(_0xb7a1('0x2'));var moment=require(_0xb7a1('0x3'));var rr=require('rr');var md5=require(_0xb7a1('0x4'));var Redis=require(_0xb7a1('0x5'));var ut=require(_0xb7a1('0x6'));var config=require('../../../config/environment/');var logger=require(_0xb7a1('0x7'))(_0xb7a1('0x8'));var loggerBooked=require('../../../config/logger')(_0xb7a1('0x9'));var loggerPredictive=require(_0xb7a1('0x7'))(_0xb7a1('0xa'));var loggerPredictiveCalls=require(_0xb7a1('0x7'))(_0xb7a1('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xb7a1('0xc'));var ami=require(_0xb7a1('0xd'));config[_0xb7a1('0xe')]=_[_0xb7a1('0xf')](config[_0xb7a1('0xe')],{'host':_0xb7a1('0x10'),'port':0x18eb});var io=require(_0xb7a1('0x11'))(new Redis(config[_0xb7a1('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb7a1('0x12'));var cmHopperAdditionalPhone=require(_0xb7a1('0x13'));var cmHopperBlack=require(_0xb7a1('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xb7a1('0x15'));var Action=require('./action');var History=require(_0xb7a1('0x16'));var Final=require(_0xb7a1('0x17'));var AgentComplete=require(_0xb7a1('0x18'));var QueueCallerAbandon=require(_0xb7a1('0x19'));var Hangup=require('./hangup');var ipAgi=process[_0xb7a1('0x1a')][_0xb7a1('0x1b')]||_0xb7a1('0x1c');var strategy={'rrmemory':_0xb7a1('0x1d'),'roundrobin':_0xb7a1('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb7a1('0x1f')]['enqueue']=function(_0x3597ae){this[_0xb7a1('0x20')]=this[_0xb7a1('0x20')]?this[_0xb7a1('0x20')][_0xb7a1('0x21')](_0x3597ae):_0x3597ae();};function Dialer(_0x5ebc4c,_0x21a195){this['sequence']=new Sequence();this['preview']=_0x21a195;this[_0xb7a1('0x22')]=_0x5ebc4c[_0xb7a1('0x22')];this['campaigns']=_0x5ebc4c[_0xb7a1('0x23')];this['agents']=_0x5ebc4c[_0xb7a1('0x24')];this[_0xb7a1('0x25')]=_0x5ebc4c['trunks'];this[_0xb7a1('0x26')]=config[_0xb7a1('0x26')]||0x2;this[_0xb7a1('0x27')]={};this['actions']={};this[_0xb7a1('0x28')]={};this[_0xb7a1('0x29')]={};this[_0xb7a1('0x2a')]={};this[_0xb7a1('0x2b')]={};this[_0xb7a1('0x2c')]={};this[_0xb7a1('0x2d')]={};this[_0xb7a1('0x2e')]={};this['queueBookedRR']={};ami['on'](_0xb7a1('0x2f'),this[_0xb7a1('0x30')]['bind'](this));ami['on'](_0xb7a1('0x31'),this['syncQueueCallerAbandon'][_0xb7a1('0x32')](this));ami['on']('originateresponse',this[_0xb7a1('0x33')][_0xb7a1('0x32')](this));ami['on']('agentcomplete',this[_0xb7a1('0x34')]['bind'](this));ami['on'](_0xb7a1('0x35'),this[_0xb7a1('0xc')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x36'),this[_0xb7a1('0x37')][_0xb7a1('0x32')](this));ami['on']('hangup',this[_0xb7a1('0x38')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x39'),this[_0xb7a1('0x3a')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x3b'),this[_0xb7a1('0x3c')]['bind'](this));ami['on'](_0xb7a1('0x3d'),this[_0xb7a1('0x3e')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x3f'),this[_0xb7a1('0x40')][_0xb7a1('0x32')](this));this['loopCampaigns']();this[_0xb7a1('0x41')]();RpcSetting['getSettings']()['then'](function(_0x5349b9){previewRecallmeReminderInterval=_0x5349b9[_0xb7a1('0x42')];});}function isNotNull(_0x55eacf){return _0x55eacf!==null&&!_[_0xb7a1('0x43')](_0x55eacf);}function checkIsLoggedIn(_0x121be7,_0x45a867){return function(){if(_0x45a867<=0x0){_0x121be7[_0xb7a1('0x44')]='AGENTS_NOT_LOGGED';throw _0x121be7[_0xb7a1('0x45')]+_0xb7a1('0x46');}};}function isActive(_0x17add4){return _0x17add4;}function checkIsActive(_0x12c496,_0x869bee){return function(){if(!isActive(_0x869bee)){_0x12c496[_0xb7a1('0x44')]=_0xb7a1('0x47');throw _0x12c496[_0xb7a1('0x45')]+_0xb7a1('0x48');}};}function checkInterval(_0x5406ae){return function(){if(!isNotNull(_0x5406ae['Interval'])){_0x5406ae[_0xb7a1('0x44')]=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}if(!isNotNull(_0x5406ae[_0xb7a1('0x4b')][_0xb7a1('0x4c')])){_0x5406ae[_0xb7a1('0x44')]=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}if(!isNotNull(_['isEmpty'](_0x5406ae[_0xb7a1('0x4b')][_0xb7a1('0x4c')]))){_0x5406ae['message']=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}};}function msgResponse(_0xe2ead4,_0x4f313a,_0x24b7b7){return{'action':_0xe2ead4,'response':_0x4f313a,'message':_0x24b7b7,'stack':_0x24b7b7};}function myreject(_0x12dcd1){return function(_0x135238){return _0x12dcd1(msgResponse('[ifTime][Action]','Error',JSON[_0xb7a1('0x4d')](_0x135238)));};}function getSeconds(_0x5c6cca,_0x4e2baa){var _0x5959f8=moment(_0x5c6cca)[_0xb7a1('0x4e')](0x0);var _0x26f253=moment(_0x4e2baa)[_0xb7a1('0x4e')](0x0);return _0x5959f8[_0xb7a1('0x4f')](_0x26f253,_0xb7a1('0x50'));}function emit(_0x14d436,_0x152efd,_0x36ece3){io['to'](_0x14d436)['emit'](_0x152efd,_0x36ece3);}function emitVoiceQueueSummary(_0x14d5fb){if(_0x14d5fb['type']===_0xb7a1('0x51')){var _0x498c46={'id':_0x14d5fb['id'],'name':_0x14d5fb[_0xb7a1('0x45')],'strategy':_0x14d5fb[_0xb7a1('0x52')],'answered':_0x14d5fb[_0xb7a1('0x53')],'available':_0x14d5fb[_0xb7a1('0x54')],'loggedIn':_0x14d5fb[_0xb7a1('0x55')],'pTalking':_0x14d5fb[_0xb7a1('0x56')],'sumBillable':_0x14d5fb[_0xb7a1('0x57')],'sumDuration':_0x14d5fb[_0xb7a1('0x58')],'sumHoldTime':_0x14d5fb['sumHoldTime']||0x0,'talking':_0x14d5fb[_0xb7a1('0x59')],'total':_0x14d5fb[_0xb7a1('0x5a')],'type':_0x14d5fb[_0xb7a1('0x5b')],'unmanaged':_0x14d5fb[_0xb7a1('0x5c')],'abandoned':_0x14d5fb[_0xb7a1('0x5d')],'waiting':_0x14d5fb[_0xb7a1('0x5e')],'loggedInDb':_0x14d5fb[_0xb7a1('0x5f')],'dialActive':_0x14d5fb[_0xb7a1('0x60')],'dialMethod':_0x14d5fb[_0xb7a1('0x61')],'dialOriginateCallerIdName':_0x14d5fb[_0xb7a1('0x62')],'dialOriginateCallerIdNumber':_0x14d5fb[_0xb7a1('0x63')],'dialOriginateTimeout':_0x14d5fb[_0xb7a1('0x64')],'dialPrefix':_0x14d5fb['dialPrefix'],'outboundAnswerAgiCallsDay':_0x14d5fb[_0xb7a1('0x65')],'outboundAnswerCallsDay':_0x14d5fb[_0xb7a1('0x66')],'outboundBlacklistCallsDay':_0x14d5fb['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x14d5fb[_0xb7a1('0x67')],'outboundCongestionCallsDay':_0x14d5fb['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x14d5fb[_0xb7a1('0x68')],'outboundDropCallsDayCallersExit':_0x14d5fb['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x14d5fb['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x14d5fb[_0xb7a1('0x69')],'outboundNoSuchCallsDay':_0x14d5fb[_0xb7a1('0x6a')],'outboundOriginateFailureCallsDay':_0x14d5fb[_0xb7a1('0x6b')],'outboundReCallsDay':_0x14d5fb[_0xb7a1('0x6c')],'outboundRejectCallsDay':_0x14d5fb['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x14d5fb[_0xb7a1('0x6d')],'predictiveIntervalAnsweredCalls':_0x14d5fb[_0xb7a1('0x6e')],'predictiveIntervalAvgHoldtime':_0x14d5fb['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x14d5fb[_0xb7a1('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x14d5fb['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x14d5fb['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x14d5fb['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x14d5fb[_0xb7a1('0x70')],'predictiveIntervalHitRate':_0x14d5fb[_0xb7a1('0x71')],'predictiveIntervalMultiplicativeFactor':_0x14d5fb[_0xb7a1('0x72')],'predictiveIntervalPauses':_0x14d5fb[_0xb7a1('0x73')],'predictiveIntervalAvailable':_0x14d5fb[_0xb7a1('0x74')],'predictiveIntervalTotalCalls':_0x14d5fb['predictiveIntervalTotalCalls'],'message':_0x14d5fb['message'],'originated':_0x14d5fb[_0xb7a1('0x75')],'erlangCalls':_0x14d5fb[_0xb7a1('0x76')],'erlangCallToSecond':_0x14d5fb['erlangCallToSecond'],'erlangAbandonmentRate':_0x14d5fb[_0xb7a1('0x77')],'erlangBusyFactor':_0x14d5fb[_0xb7a1('0x78')],'startPredictive':_0x14d5fb[_0xb7a1('0x2b')],'startProgressive':_0x14d5fb[_0xb7a1('0x2c')]};if(_0x14d5fb[_0xb7a1('0x79')]){_0x498c46[_0xb7a1('0x79')]={'id':_0x14d5fb['Trunk']['id'],'name':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x45')],'active':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x7a')],'callerid':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x7b')]};}if(_0x14d5fb[_0xb7a1('0x4b')]){_0x498c46['Interval']={'id':_0x14d5fb[_0xb7a1('0x4b')]['id'],'name':_0x14d5fb[_0xb7a1('0x4b')][_0xb7a1('0x45')]};}var _0xe0be85=md5(JSON[_0xb7a1('0x4d')](_0x498c46));if(_0x14d5fb[_0xb7a1('0x4')]!==_0xe0be85){_0x14d5fb['md5']=_0xe0be85;emit(util[_0xb7a1('0x7c')]('voice:queue:%s',_0x498c46['name']),_0xb7a1('0x7d'),_0x498c46);}}}function emitCampaignSummary(_0x3e5f9f){if(_0x3e5f9f[_0xb7a1('0x5b')]===_0xb7a1('0x7e')){emit(util['format'](_0xb7a1('0x7f'),_0x3e5f9f[_0xb7a1('0x45')]),_0xb7a1('0x80'),_0x3e5f9f);}}function checkGetDataPredictive(_0x246f54){if(isNotNull(_0x246f54)&&!_[_0xb7a1('0x81')](_0x246f54)){loggerPredictive['info'](_0xb7a1('0x82'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x84'),_0x246f54[_0xb7a1('0x85')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246f54[_0xb7a1('0x6e')]);loggerPredictive[_0xb7a1('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246f54[_0xb7a1('0x86')]);loggerPredictive['info'](_0xb7a1('0x87'),_0x246f54[_0xb7a1('0x88')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x89'),_0x246f54[_0xb7a1('0x8a')]);loggerPredictive['info'](_0xb7a1('0x8b'),_0x246f54[_0xb7a1('0x6f')]);loggerPredictive['info'](_0xb7a1('0x8c'));if(_0x246f54[_0xb7a1('0x85')]>0x0){if(!_[_0xb7a1('0x43')](_0x246f54['predictiveIntervalAvgTalktime'])&&_0x246f54['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0xb7a1('0x8d'));if(!_['isUndefined'](_0x246f54['predictiveIntervalAvgHoldtime'])&&_0x246f54['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8e'));}}else{loggerPredictive[_0xb7a1('0x83')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2dabf8){return function(_0x37e2e3){loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8f'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x90'),_0x37e2e3['erlangCalls']);loggerPredictive['info'](_0xb7a1('0x91'),_0x37e2e3['erlangCallToSecond']);loggerPredictive['info'](_0xb7a1('0x92'),_0x37e2e3[_0xb7a1('0x77')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x93'),_0x37e2e3[_0xb7a1('0x78')]);loggerPredictive['info'](_0xb7a1('0x92'),_0x37e2e3[_0xb7a1('0x77')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8c'));_[_0xb7a1('0x94')](_0x2dabf8,_0x37e2e3);};}function getDiff(_0xd6989d){var _0x2f953e=moment()[_0xb7a1('0x4e')](0x0);var _0x276bf0=moment(_0xd6989d)[_0xb7a1('0x4e')](0x0);return _0x2f953e[_0xb7a1('0x4f')](_0x276bf0,'seconds');}function ifInterval(_0x3c8c56,_0x193d0d){if(_['isUndefined'](_0x193d0d)){return![];}return getDiff(_0x193d0d)<_0x3c8c56*0x3c;}function freeVariablesPredictive(_0x14ec69){if(isNotNull(_0x14ec69)){if(!_[_0xb7a1('0x43')](_0x14ec69[_0xb7a1('0x2c')])){_0x14ec69[_0xb7a1('0x2c')]=undefined;loggerPredictive[_0xb7a1('0x83')](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x95'));}if(!_['isUndefined'](_0x14ec69[_0xb7a1('0x2b')])){_0x14ec69[_0xb7a1('0x2b')]=undefined;loggerPredictive[_0xb7a1('0x83')](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x96'));}if(!_['isUndefined'](_0x14ec69[_0xb7a1('0x97')])){clearInterval(_0x14ec69[_0xb7a1('0x97')]);_0x14ec69[_0xb7a1('0x97')]=undefined;loggerPredictive['info'](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x98'));}}}function erlangb(_0x2bc7f5,_0x3b1f86){if(_0x3b1f86===0x0){return 0x0;}var _0x598a3b=0x1;for(var _0x74ad46=0x1;_0x74ad46<=_0x3b1f86;_0x74ad46+=0x1){_0x598a3b=0x1+_0x598a3b*_0x74ad46/_0x2bc7f5;}return 0x1/_0x598a3b;}function isVoiceQueueOutbound(_0x2dadde){return _0x2dadde==='outbound';}function isNotPreview(_0x257edc){return _0x257edc!==_0xb7a1('0x99');}function isCampaignIvr(_0x5cc589){return _0x5cc589===_0xb7a1('0x7e');}function getCallerId(_0xe2a478,_0x234ddc,_0xf9e8e0){if(!_[_0xb7a1('0x43')](_0xf9e8e0)&&typeof _0xf9e8e0===_0xb7a1('0x9a')&&!_[_0xb7a1('0x81')](_0xf9e8e0)){if(!_[_0xb7a1('0x43')](_0x234ddc)&&typeof _0x234ddc===_0xb7a1('0x9a')&&!_[_0xb7a1('0x81')](_0x234ddc)){return util['format']('\x22%s\x22\x20<%s>',_0x234ddc,_0xf9e8e0);}return util['format'](_0xb7a1('0x9b'),_0xf9e8e0,_0xf9e8e0);}if(!_[_0xb7a1('0x43')](_0xe2a478)&&typeof _0xe2a478===_0xb7a1('0x9a')&&!_['isEmpty'](_0xe2a478)){return _0xe2a478;}return _0xb7a1('0x9c');}function loggerCatchQueueSummary(_0x14571d,_0x2dbb84){return function(_0x41597f){freeVariablesPredictive(_0x2dbb84);emitVoiceQueueSummary(_0x2dbb84);emitCampaignSummary(_0x2dbb84);loggerSyncQueueSummary[_0xb7a1('0x9d')](_0x14571d,util[_0xb7a1('0x9e')](_0x41597f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4dcea3,_0x54d55f){return function(_0x766226){loggerPredictive[_0xb7a1('0x9f')](_0x54d55f['name'],_0x4dcea3);loggerPredictive[_0xb7a1('0x9f')](_0x766226['stack']);freeVariablesPredictive(_0x54d55f);};}function loggerCatch(_0x164c23){return function(_0x5157eb){logger['error'](_0x164c23,util[_0xb7a1('0x9e')](_0x5157eb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x26f78a){return _0x26f78a&&!_[_0xb7a1('0x43')](_0x26f78a)&&_0x26f78a[_0xb7a1('0xa0')]>0x0;}function decremetOriginate(_0x9cdd0d){if(!_['isUndefined'](_0x9cdd0d)&&_0x9cdd0d!==null){if(typeof _0x9cdd0d[_0xb7a1('0x75')]!=='undefined'){if(_0x9cdd0d[_0xb7a1('0x75')]>0x0){_0x9cdd0d[_0xb7a1('0x75')]-=0x1;}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xa1'));}}}else{logger[_0xb7a1('0x9f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x12df9a,_0x265261,_0x2deeeb){if(_0x265261>_0x2deeeb){for(var _0x2140fc=0x0;_0x2140fc<_0x265261-_0x2deeeb;_0x2140fc+=0x1){decremetOriginate(_0x12df9a);}}}function loggerGetContactDialer(_0x43de3e,_0x230d22,_0x3d9a3e){return function(_0x2842a5){checkContactLowerLimitOriginate(_0x230d22,_0x3d9a3e,0x0);logger[_0xb7a1('0x9f')](_0x43de3e,util[_0xb7a1('0x9e')](_0x2842a5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1690d9){return function(_0x32270d){if(isNotNull(_0x32270d)&&isNotNull(_0x32270d[0x0])){if(_0x32270d[0x0][_0xb7a1('0xa2')]>0x0){_0x1690d9[_0xb7a1('0x44')]=_0xb7a1('0xa3');logger[_0xb7a1('0x83')](_0xb7a1('0xa4')+_0x1690d9[_0xb7a1('0x45')],_0x32270d[0x0]['contactsRescheduled'],'contacts');}else{_0x1690d9[_0xb7a1('0x44')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xb7a1('0x83')](_0xb7a1('0xa5')+_0x1690d9[_0xb7a1('0x45')]);}}};}function notSendMessagesQueue(_0x55ec05){if(_0x55ec05[_0xb7a1('0xa6')]){freeVariablesPredictive(_0x55ec05);if(_0x55ec05[_0xb7a1('0x75')]===0x0&&_0x55ec05[_0xb7a1('0x59')]===0x0&&_0x55ec05['waiting']===0x0&&(_0x55ec05[_0xb7a1('0x56')]||0x0)===0x0){_0x55ec05[_0xb7a1('0xa6')]=![];_0x55ec05[_0xb7a1('0x54')]=0x0;_0x55ec05[_0xb7a1('0x44')]=_0xb7a1('0x47');loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xa7'),_0x55ec05[_0xb7a1('0x45')],_0xb7a1('0xa8'));}else{_0x55ec05[_0xb7a1('0x44')]=_0xb7a1('0xa9');loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xa7'),_0x55ec05[_0xb7a1('0x45')],_0xb7a1('0xaa'));}emitVoiceQueueSummary(_0x55ec05);}}function notSendMessagesCampaign(_0xb758d4){if(_0xb758d4['sendMessageOneNotActive']){if(_0xb758d4['originated']===0x0){_0xb758d4['sendMessageOneNotActive']=![];_0xb758d4[_0xb7a1('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xab'),_0xb758d4[_0xb7a1('0x45')],_0xb7a1('0xa8'));}else{_0xb758d4[_0xb7a1('0x44')]=_0xb7a1('0xa9');loggerSyncQueueSummary['debug'](_0xb7a1('0xab'),_0xb758d4['name'],'is\x20disactive');}emitCampaignSummary(_0xb758d4);}}function createObjHistory(_0x3cedd1,_0x46404e,_0x5b9f3b,_0x2b79f7,_0x3160bd){_0x3cedd1['message']=_0x5b9f3b;var _0x5b6884=new Action(_0x3cedd1,_0x46404e);var _0x17db6e=new History(_0x5b6884);_0x17db6e['state']=_0x2b79f7;_0x17db6e['statedesc']=_0x3160bd;_0x17db6e[_0xb7a1('0xac')]=_0x5b6884[_0xb7a1('0xad')];return _0x17db6e;}Dialer[_0xb7a1('0x1f')][_0xb7a1('0x41')]=function(){var _0x30f93=this;setInterval(function(){_0x30f93[_0xb7a1('0xae')](_0x30f93[_0xb7a1('0x29')],_0xb7a1('0xaf'));_0x30f93[_0xb7a1('0xae')](_0x30f93[_0xb7a1('0xb0')],'[actions]');},0x32c8);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xae')]=function(_0x4b2b8b,_0x1791ec){var _0x913fc=this;for(var _0xab7da5 in _0x4b2b8b){if(typeof _0x4b2b8b[_0xab7da5]!==_0xb7a1('0xb1')){this[_0xb7a1('0xb2')][_0xb7a1('0xb3')](function(){if(!_[_0xb7a1('0xb4')](_0x4b2b8b[_0xab7da5])){return ami[_0xb7a1('0xb5')]({'action':_0xb7a1('0xb6'),'channel':_0x4b2b8b[_0xab7da5][_0xb7a1('0xb7')]})[_0xb7a1('0xb8')](function(_0x1e8524){if(_0x1e8524['message']===_0xb7a1('0xb9')){setTimeout(function(){if(_0x4b2b8b[_0xab7da5]&&_0x4b2b8b[_0xab7da5][_0xb7a1('0x5b')]!=='ivr'){_0x913fc[_0xb7a1('0xba')](_0x913fc[_0xb7a1('0x22')][_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]]);logger['error'](_0xb7a1('0xbc'),_0x1791ec,_0xab7da5,_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]);delete _0x4b2b8b[_0xab7da5];}if(_0x4b2b8b[_0xab7da5]&&_0x4b2b8b[_0xab7da5]['type']==='ivr'){_0x913fc[_0xb7a1('0xba')](_0x913fc['campaigns'][_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]]);logger[_0xb7a1('0x9f')]('[Dialer][checkChannel][ivr]',_0x1791ec,_0xab7da5,_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]);delete _0x4b2b8b[_0xab7da5];}},0x2328);}});}});}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xbd')]=function(_0x5b8d9b){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xbd')](_0x5b8d9b))[_0xb7a1('0xb8')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xc0')]=function(_0x332775){return Promise[_0xb7a1('0xbe')]()['then'](cmHopperBlack['checkIsBlackList'](_0x332775))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc1')));};Dialer[_0xb7a1('0x1f')]['verifyAdditionalPhones']=function(_0x2f3b85,_0x1826ed,_0x288cb0){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperAdditionalPhone[_0xb7a1('0xc2')](_0x2f3b85,_0x1826ed,_0x288cb0))['catch'](loggerCatch(_0xb7a1('0xc3')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xc4')]=function(_0xb212dd,_0x604d56,_0x3067b4){return Promise[_0xb7a1('0xbe')]()['then'](cmHopperAdditionalPhone[_0xb7a1('0xc4')](_0xb212dd,_0x604d56,_0x3067b4))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc5')));};Dialer['prototype'][_0xb7a1('0xc6')]=function(_0x115d5e){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperBlack[_0xb7a1('0xc6')](_0x115d5e))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc7')));};Dialer['prototype'][_0xb7a1('0xc8')]=function(_0x5c307e){return Promise['resolve']()['then'](cmHopperHistory[_0xb7a1('0xc9')](_0x5c307e))[_0xb7a1('0xb8')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xb7a1('0x1f')]['rescheduleContact']=function(_0xa644b2){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xca')](_0xa644b2))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xcb')));};Dialer['prototype'][_0xb7a1('0xcc')]=function(_0x27f306,_0x30703b,_0x28e18e){return Promise['resolve']()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xcc')](_0x27f306,_0x30703b,_0x28e18e))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xcd')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xce')]=function(_0x3c7621,_0x29d8cb,_0x3d9eb6,_0x47ed97,_0x50f312){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper['getContactDialer'](_0x3c7621,_0x29d8cb,_0x3d9eb6,_0x47ed97))[_0xb7a1('0xb8')](function(_0x25a2bc){_0x50f312[_0xb7a1('0xcf')]-=_0x3d9eb6;_0x50f312[_0xb7a1('0xcf')]=_0x50f312[_0xb7a1('0xcf')]>0x0?_0x50f312[_0xb7a1('0xcf')]:0x0;loggerCatch(_0xb7a1('0xd0'))(_0x25a2bc);});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd1')]=function(_0x1ef592,_0x3181f8,_0x41097a,_0x290e91){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xd1')](_0x1ef592,_0x3181f8,_0x41097a))[_0xb7a1('0xb8')](function(_0x160714){_0x290e91['temp']-=_0x3181f8;_0x290e91[_0xb7a1('0xcf')]=_0x290e91[_0xb7a1('0xcf')]>0x0?_0x290e91[_0xb7a1('0xcf')]:0x0;loggerCatch(_0xb7a1('0xd2'))(_0x160714);});};Dialer[_0xb7a1('0x1f')]['getVoiceQueueRtPauses']=function(_0x5e49d4){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](voiceQueueRt[_0xb7a1('0xd3')](_0x5e49d4))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xd4')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd5')]=function(_0x34f741){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper['moveContactManagedDialer'](_0x34f741))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xd6')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd7')]=function(_0xa80f58){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperHistory['createHistory'](_0xa80f58))['catch'](loggerCatch(_0xb7a1('0xd8')));};Dialer['prototype'][_0xb7a1('0xba')]=function(_0x1d6878){if(!_[_0xb7a1('0x43')](_0x1d6878)&&_0x1d6878!==null){if(typeof _0x1d6878[_0xb7a1('0x75')]!==_0xb7a1('0xb1')){if(_0x1d6878[_0xb7a1('0x75')]>0x0){_0x1d6878[_0xb7a1('0x75')]-=0x1;}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xd9'));}}}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xda'));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xdb')]=function(_0xe873fd,_0x563b4b){var _0x394c61=this;return function(_0x55c4b4){_0x394c61[_0xb7a1('0xba')](_0x563b4b);logger[_0xb7a1('0x9f')](_0xe873fd,util[_0xb7a1('0x9e')](_0x55c4b4,{'showHidden':![],'depth':null}));};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xdc')]=function(_0x43aa78,_0x1e67ed,_0xb107d4){var _0x507508={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x1e67ed);this['saveInDb'](_[_0xb7a1('0x94')](_0x507508,_[_0xb7a1('0xdd')](_0xb107d4,[_0xb7a1('0xde'),_0xb7a1('0xdf'),_0xb7a1('0xe0'),_0xb7a1('0xe1'),_0xb7a1('0xe2')])),_0xb7a1('0xe3'),'[emptyContact]');logger[_0xb7a1('0x9f')](_0x43aa78);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xe4')]=function(_0x1202fc){return _0x1202fc===_0xb7a1('0xe5');};Dialer['prototype']['isTrunkReachable']=function(_0x17db16){return!_[_0xb7a1('0x43')](_0x17db16)&&_0x17db16&&!_[_0xb7a1('0x43')](_0x17db16[_0xb7a1('0x45')])&&!_['isUndefined'](_0x17db16[_0xb7a1('0x7a')])&&_0x17db16[_0xb7a1('0x7a')]&&(this[_0xb7a1('0x25')][util[_0xb7a1('0x7c')](_0xb7a1('0xe6'),_0x17db16[_0xb7a1('0x45')])]['status']==='reachable'||this[_0xb7a1('0x25')][util[_0xb7a1('0x7c')]('SIP/%s',_0x17db16['name'])][_0xb7a1('0xb6')]===_0xb7a1('0xe7'));};Dialer['prototype'][_0xb7a1('0xe8')]=function(_0x3a5d52,_0x518865,_0x919813){this[_0xb7a1('0xd7')](_0x3a5d52)['catch'](loggerCatch(_0x518865));this['moveContactManagedDialer'](_0x3a5d52)[_0xb7a1('0xb8')](loggerCatch(_0x919813));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x3c')]=function(_0x5b97e2){var _0x281a96=this;var _0x12afb0=this[_0xb7a1('0x29')][_0x5b97e2[_0xb7a1('0xe9')]];var _0x45445d;if(!_[_0xb7a1('0xb4')](_0x5b97e2)&&!_[_0xb7a1('0xb4')](_0x5b97e2[_0xb7a1('0xea')])&&!_[_0xb7a1('0xb4')](_0x5b97e2[_0xb7a1('0xea')][_0xb7a1('0xeb')])&&_0x5b97e2[_0xb7a1('0xec')]===_0xb7a1('0xed')&&_0x12afb0){if(_0x12afb0[_0xb7a1('0x5b')]!=='ivr'&&this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]]['dialAMDActive']&&_0x5b97e2[_0xb7a1('0xee')]===_0xb7a1('0xef')){delete this[_0xb7a1('0x29')][_0x5b97e2['uniqueid']];this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x12afb0['queue']]);this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;this[_0xb7a1('0x22')][_0x12afb0['queue']][_0xb7a1('0x65')]+=0x1;_0x45445d=new Hangup(_0x12afb0,_0x5b97e2);_0x45445d[_0xb7a1('0xf0')]=0x12;_0x45445d[_0xb7a1('0xf1')]=_0xb7a1('0xf2');_0x45445d[_0xb7a1('0xf3')]='AMD';ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x45445d,'amd'));this[_0xb7a1('0xe8')](_0x45445d,_0xb7a1('0xf7'),_0xb7a1('0xf8'));}if(_0x12afb0[_0xb7a1('0x5b')]!=='ivr'&&this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0xf9')]&&_0x5b97e2[_0xb7a1('0xee')]===_0xb7a1('0xfa')){return new Promise(function(_0x5c8eb0,_0x5aff83){delete _0x281a96[_0xb7a1('0x29')][_0x5b97e2[_0xb7a1('0xe9')]];_0x281a96[_0xb7a1('0xba')](_0x281a96[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]]);_0x281a96[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;_0x281a96[_0xb7a1('0x22')][_0x12afb0['queue']][_0xb7a1('0x65')]+=0x1;var _0x44ede4=_0x281a96['voiceQueues'][_0x12afb0['queue']];var _0x6356a8=new Hangup(_0x12afb0,_0x5b97e2);_0x6356a8['state']=0x13;_0x6356a8[_0xb7a1('0xf1')]=_0xb7a1('0xfb');_0x6356a8[_0xb7a1('0xf3')]=_0xb7a1('0xfc');_0x6356a8['countmachineretry']+=0x1;_0x6356a8[_0xb7a1('0xfd')]+=0x1;_0x6356a8[_0xb7a1('0xfe')]=!![];ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x6356a8,_0xb7a1('0xfe')));_0x281a96[_0xb7a1('0xd7')](_0x6356a8)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x6356a8[_0xb7a1('0xff')]+_0x6356a8['countcongestionretry']+_0x6356a8['countnoanswerretry']+_0x6356a8[_0xb7a1('0x100')]+_0x6356a8['countdropretry']+_0x6356a8[_0xb7a1('0x101')]+_0x6356a8['countmachineretry']+_0x6356a8[_0xb7a1('0x102')]>=_0x44ede4[_0xb7a1('0x103')]){_0x281a96[_0xb7a1('0x104')](_0x6356a8,_0x5c8eb0,_0x5aff83,'reason19\x20machine....');}else{if(_0x6356a8[_0xb7a1('0x105')]>=_0x44ede4[_0xb7a1('0x106')]){_0x281a96[_0xb7a1('0x107')](_0x6356a8,_0x5c8eb0,_0x5aff83,_0xb7a1('0x108'));}else{_0x281a96['rescheduleContact']({'active':![],'countmachineretry':_0x6356a8[_0xb7a1('0x105')],'scheduledat':moment()[_0xb7a1('0x109')](_0x44ede4[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x6356a8[_0xb7a1('0xde')],'ListId':_0x6356a8[_0xb7a1('0xdf')],'VoiceQueueId':_0x6356a8[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x6356a8[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10d')));_0x5c8eb0({'reschedule':0x1});}}});}if(_0x12afb0[_0xb7a1('0x5b')]===_0xb7a1('0x7e')&&this[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0xf9')]&&_0x5b97e2['value']===_0xb7a1('0xef')){delete this[_0xb7a1('0x29')][_0x5b97e2['uniqueid']];this[_0xb7a1('0xba')](this['campaigns'][_0x12afb0[_0xb7a1('0xbb')]]);_0x45445d=new Hangup(_0x12afb0,_0x5b97e2);_0x45445d[_0xb7a1('0xf0')]=0x12;_0x45445d['statedesc']='HangupInAMD';_0x45445d[_0xb7a1('0xf3')]=_0xb7a1('0xfc');ami[_0xb7a1('0xf4')]('custom:amd',ut[_0xb7a1('0xf6')](_0x45445d,'amd'));this[_0xb7a1('0xe8')](_0x45445d,_0xb7a1('0x10e'),'[syncHangupInAMDIvr]');}if(_0x12afb0[_0xb7a1('0x5b')]===_0xb7a1('0x7e')&&this[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]]['dialAMDActive']&&_0x5b97e2['value']==='MACHINE'){return new Promise(function(_0x1afadd,_0x4e8df1){delete _0x281a96['uniqueId'][_0x5b97e2[_0xb7a1('0xe9')]];_0x281a96['updateOriginated'](_0x281a96[_0xb7a1('0x23')][_0x12afb0['queue']]);_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x65')]+=0x1;var _0x5569be=_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]];var _0x400ef8=new Hangup(_0x12afb0,_0x5b97e2);_0x400ef8[_0xb7a1('0xf0')]=0x13;_0x400ef8[_0xb7a1('0xf1')]=_0xb7a1('0xfb');_0x400ef8['membername']=_0xb7a1('0xfc');_0x400ef8[_0xb7a1('0x105')]+=0x1;_0x400ef8[_0xb7a1('0xfd')]+=0x1;_0x400ef8['amd']=!![];ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x400ef8,'amd'));_0x281a96[_0xb7a1('0xd7')](_0x400ef8)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10f')));if(_0x400ef8[_0xb7a1('0xff')]+_0x400ef8[_0xb7a1('0x110')]+_0x400ef8['countnoanswerretry']+_0x400ef8['countnosuchnumberretry']+_0x400ef8[_0xb7a1('0x111')]+_0x400ef8['countabandonedretry']+_0x400ef8[_0xb7a1('0x105')]+_0x400ef8[_0xb7a1('0x102')]>=_0x5569be[_0xb7a1('0x103')]){_0x281a96['stateGlobal'](_0x400ef8,_0x1afadd,_0x4e8df1,_0xb7a1('0x112'));}else{if(_0x400ef8[_0xb7a1('0x105')]>=_0x5569be[_0xb7a1('0x106')]){_0x281a96[_0xb7a1('0x107')](_0x400ef8,_0x1afadd,_0x4e8df1,_0xb7a1('0x108'));}else{_0x281a96[_0xb7a1('0xca')]({'active':![],'countmachineretry':_0x400ef8[_0xb7a1('0x105')],'scheduledat':moment()[_0xb7a1('0x109')](_0x5569be[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x400ef8[_0xb7a1('0xde')],'ListId':_0x400ef8['ListId'],'VoiceQueueId':_0x400ef8[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x400ef8[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10d')));_0x1afadd({'reschedule':0x1});}}});}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x38')]=function(_0x2138dc){var _0x22f11e=this['uniqueId'][_0x2138dc[_0xb7a1('0xe9')]];var _0x3df34f;if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]===_0xb7a1('0x7e')){delete this['uniqueId'][_0x2138dc[_0xb7a1('0xe9')]];this['updateOriginated'](this[_0xb7a1('0x23')][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x23')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x113')]+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);this['createHistory'](_0x3df34f)['catch'](loggerCatch(_0xb7a1('0x114')));this[_0xb7a1('0xd5')](_0x3df34f)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')&&isNotNull(this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x115')])){delete this[_0xb7a1('0x29')][_0x2138dc[_0xb7a1('0xe9')]];this['updateOriginated'](this['voiceQueues'][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;this['voiceQueues'][_0x22f11e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);_0x3df34f[_0xb7a1('0xf0')]=0x10;_0x3df34f['statedesc']=_0xb7a1('0x116');_0x3df34f['membername']=_0xb7a1('0x117');this[_0xb7a1('0xd7')](_0x3df34f)['catch'](loggerCatch(_0xb7a1('0x114')));this['moveContactManagedDialer'](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x118')));}if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')&&!isNotNull(this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x115')])){delete this[_0xb7a1('0x29')][_0x2138dc[_0xb7a1('0xe9')]];this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x6d')]+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);_0x3df34f['state']=0xc;_0x3df34f[_0xb7a1('0xf1')]=_0x2138dc[_0xb7a1('0x119')];_0x3df34f[_0xb7a1('0xf3')]=_0xb7a1('0x11a');this[_0xb7a1('0xd7')](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x118')));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x34')]=function(_0x406e37){var _0x28f137=this[_0xb7a1('0x29')][_0x406e37[_0xb7a1('0xe9')]];if(this[_0xb7a1('0x22')][_0x406e37[_0xb7a1('0xbb')]]){if(_0x28f137&&_0x28f137[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')){delete this[_0xb7a1('0x29')][_0x406e37[_0xb7a1('0xe9')]];this['voiceQueues'][_0x406e37[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;var _0x226282=new AgentComplete(_0x28f137,_0x406e37);if(_0x406e37[_0xb7a1('0x11b')]===_0xb7a1('0x11c')){_0x226282[_0xb7a1('0x11d')]=this['voiceQueues'][_0x406e37[_0xb7a1('0xbb')]][_0xb7a1('0x11e')]&&this[_0xb7a1('0x22')][_0x406e37['queue']][_0xb7a1('0x11f')]?moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c')):undefined;}this[_0xb7a1('0xd7')](_0x226282)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x120')));this[_0xb7a1('0xd5')](_0x226282)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x30')]=function(_0x2bce42){if(this[_0xb7a1('0x22')][_0x2bce42[_0xb7a1('0xbb')]]){if(this[_0xb7a1('0x29')][_0x2bce42[_0xb7a1('0xe9')]]&&this[_0xb7a1('0x29')][_0x2bce42['uniqueid']][_0xb7a1('0x5b')]!=='ivr'){this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x2bce42[_0xb7a1('0xbb')]]);this[_0xb7a1('0x29')][_0x2bce42['uniqueid']][_0xb7a1('0x121')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x122')]=function(_0x30b8b5,_0x1504a9){this[_0xb7a1('0xd7')](_0x30b8b5)['catch'](loggerCatch(_0xb7a1('0x120')));if(_0x1504a9==0x0){this[_0xb7a1('0xd5')](_0x30b8b5)[_0xb7a1('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xb7a1('0x1f')]['syncQueueCallerAbandon']=function(_0x65189c){var _0xb7588f=this[_0xb7a1('0x29')][_0x65189c['uniqueid']];var _0x6cac1f=this;var _0x5d7dbe=![];var _0x14788d;var _0x4b1fb6;if(this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]){if(_0xb7588f&&_0xb7588f[_0xb7a1('0x5b')]!=='ivr'){delete this['uniqueId'][_0x65189c[_0xb7a1('0xe9')]];this['updateOriginated'](this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]);_0xb7588f['droptime']=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));var _0x1c2d11=new QueueCallerAbandon(_0xb7588f,_0x65189c);if(getSeconds(_0xb7588f[_0xb7a1('0x123')],_0xb7588f[_0xb7a1('0x124')])>=_0xb7588f[_0xb7a1('0x125')]){this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x86')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x126')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x70')]+=0x1;_0x1c2d11[_0xb7a1('0xf0')]=0xa;_0x1c2d11['statedesc']=_0xb7a1('0x127');_0x1c2d11['dropreason']=_0xb7a1('0x128');_0x1c2d11[_0xb7a1('0x11d')]=this[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x11e')]?moment()[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1c2d11[_0xb7a1('0x111')]+=0x1;_0x1c2d11[_0xb7a1('0xfd')]+=0x1;_0x14788d=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x129')];_0x4b1fb6=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x12a')];_0x6cac1f[_0xb7a1('0xc2')](_0x1c2d11,_0x1c2d11[_0xb7a1('0xf0')],_0xb7588f['voiceQueue'])[_0xb7a1('0xbf')](function(_0x50625c){_0x5d7dbe=_0x50625c['additional']==0x1;if(_0x1c2d11[_0xb7a1('0x111')]>=_0x6cac1f['voiceQueues'][_0x65189c[_0xb7a1('0xbb')]]['dialDropMaxRetry']){_0x6cac1f['queueCallerAbandonCreateState'](_0x1c2d11,_0x50625c[_0xb7a1('0x12b')]);}else{_0x6cac1f[_0xb7a1('0xca')]({'active':![],'countdropretry':_0x1c2d11['countdropretry'],'scheduledat':moment()[_0xb7a1('0x109')](_0x6cac1f['voiceQueues'][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x129')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0xb7588f['ContactId'],'ListId':_0xb7588f[_0xb7a1('0xdf')],'VoiceQueueId':_0xb7588f[_0xb7a1('0xe1')]||undefined,'CampaignId':_0xb7588f[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x12c')));var _0x2b79fd=new History(_0x1c2d11);_0x2b79fd[_0xb7a1('0xf0')]=0xa;_0x2b79fd[_0xb7a1('0xf1')]=_0xb7a1('0x127');_0x2b79fd[_0xb7a1('0xad')]=moment()[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b79fd['endtime']=_0x2b79fd[_0xb7a1('0xad')];_0x2b79fd[_0xb7a1('0x12d')]=_0x1c2d11['calleridname'];_0x2b79fd[_0xb7a1('0x12e')]=_0x1c2d11[_0xb7a1('0x12e')];_0x6cac1f[_0xb7a1('0xd7')](_0x2b79fd)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x5d7dbe)_0x6cac1f[_0xb7a1('0xc4')](_0x1c2d11,_0x14788d,_0x4b1fb6)[_0xb7a1('0xbf')](function(){return 0x1;});});}else{this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x88')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x12f')]+=0x1;_0x1c2d11[_0xb7a1('0xf0')]=0xb;_0x1c2d11[_0xb7a1('0xf1')]='Abandoned';_0x1c2d11[_0xb7a1('0x130')]=_0xb7a1('0x131');_0x1c2d11['countabandonedretry']+=0x1;_0x1c2d11[_0xb7a1('0xfd')]+=0x1;_0x14788d=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]['dialAbandonedRetryFrequency'];_0x4b1fb6=this[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x12a')];_0x6cac1f[_0xb7a1('0xc2')](_0x1c2d11,_0x1c2d11[_0xb7a1('0xf0')],_0xb7588f['voiceQueue'])[_0xb7a1('0xbf')](function(_0x5aa989){if(_0x1c2d11['countabandonedretry']>=_0x6cac1f[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x132')]){_0x6cac1f[_0xb7a1('0x122')](_0x1c2d11,_0x5aa989[_0xb7a1('0x12b')]);}else{_0x6cac1f[_0xb7a1('0xca')]({'active':![],'countabandonedretry':_0x1c2d11[_0xb7a1('0x101')],'scheduledat':moment()[_0xb7a1('0x109')](_0x6cac1f[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x133')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0xb7588f[_0xb7a1('0xde')],'ListId':_0xb7588f[_0xb7a1('0xdf')],'VoiceQueueId':_0xb7588f[_0xb7a1('0xe1')]||undefined,'CampaignId':_0xb7588f[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x134')));var _0x594af6=new History(_0x1c2d11);_0x594af6['state']=0xb;_0x594af6[_0xb7a1('0xf1')]=_0xb7a1('0x135');_0x594af6[_0xb7a1('0xad')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x594af6[_0xb7a1('0xac')]=_0x594af6['starttime'];_0x594af6[_0xb7a1('0x12d')]=_0x1c2d11[_0xb7a1('0x12d')];_0x594af6[_0xb7a1('0x12e')]=_0x1c2d11[_0xb7a1('0x12e')];_0x6cac1f[_0xb7a1('0xd7')](_0x594af6)['catch'](loggerCatch(_0xb7a1('0x136')));}})[_0xb7a1('0xbf')](function(){if(_0x5d7dbe)_0x6cac1f[_0xb7a1('0xc4')](_0x1c2d11,_0x14788d,_0x4b1fb6)['then'](function(){return 0x1;});});}}}};Dialer[_0xb7a1('0x1f')]['syncNewExten']=function(_0x2ba43a){if(this['actions'][_0x2ba43a[_0xb7a1('0xe9')]]){this[_0xb7a1('0xb0')][_0x2ba43a[_0xb7a1('0xe9')]][_0xb7a1('0xb7')]=_0x2ba43a[_0xb7a1('0xb7')];}if(this[_0xb7a1('0x29')][_0x2ba43a['uniqueid']]){this['uniqueId'][_0x2ba43a[_0xb7a1('0xe9')]]['channel']=_0x2ba43a[_0xb7a1('0xb7')];}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x3e')]=function(_0x526201){if(strategy[this[_0xb7a1('0x22')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x52')]]===_0xb7a1('0x1e')){if(this[_0xb7a1('0xb0')][_0x526201['actionid']]&&_['isNil'](this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0x138')])&&_0x526201[_0xb7a1('0xb6')]==='1'&&_0x526201['paused']==='0'){if(this['agents'][_0x526201[_0xb7a1('0x139')]]){if(!this['agents'][_0x526201[_0xb7a1('0x139')]]['locked']){this[_0xb7a1('0x24')][_0x526201[_0xb7a1('0x139')]][_0xb7a1('0x138')]=!![];this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0x138')]=!![];this['actions'][_0x526201[_0xb7a1('0x137')]]['stateinterface']=_0x526201['stateinterface'];}}}}else if((strategy[this[_0xb7a1('0x22')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]['queue']][_0xb7a1('0x52')]]||_0xb7a1('0x1d'))===_0xb7a1('0x1d')){if(this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]){if(this[_0xb7a1('0x24')][_0x526201[_0xb7a1('0x139')]]){this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0x139')]=_0x526201[_0xb7a1('0x139')];if(_[_0xb7a1('0xb4')](this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]['queue']])){this['queueBooked'][this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0xbb')]]=[];}this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0xbb')]][_0xb7a1('0x13a')](_[_0xb7a1('0x94')](_['pick'](this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]],['idHopper','stateinterface']),{'status':_0x526201['status'],'paused':_0x526201[_0xb7a1('0x13b')]}));}}}};function unlockQueueStatus(_0x4f6ead,_0x45507a){setTimeout(function(){if(_[_0xb7a1('0x43')](_0x4f6ead[_0xb7a1('0x13c')])){loggerBooked[_0xb7a1('0x9f')](_0xb7a1('0x13d'),_0x45507a);}_0x4f6ead[_0xb7a1('0x13c')]=!![];loggerBooked[_0xb7a1('0x83')]('[booked][unlockQueueStatus]',_0x45507a,JSON[_0xb7a1('0x4d')](_['pick'](_0x4f6ead,['name',_0xb7a1('0x13c')])));},0x1f3);}Dialer[_0xb7a1('0x1f')]['syncQueueStatusComplete']=function(_0x4e4aad){var _0x2733fc=this;var _0x17b879=_0x2733fc[_0xb7a1('0x22')][_0x2733fc['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]];if(strategy[this['voiceQueues'][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]['strategy']]==='roundrobin'){if(this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]&&this['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')]){this[_0xb7a1('0x99')]['run'](this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x13e')],this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')])[_0xb7a1('0xb8')](function(_0x4cae27){logger[_0xb7a1('0x9f')](_0xb7a1('0x13f'),util[_0xb7a1('0x9e')](_0x4cae27,{'showHidden':![],'depth':null}));})[_0xb7a1('0x21')](function(){_0x2733fc['updateOriginated'](_0x2733fc[_0xb7a1('0x22')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']]['queue']]);_0x2733fc[_0xb7a1('0x24')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')]][_0xb7a1('0x138')]=![];delete _0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']];unlockQueueStatus(_0x17b879);});}else{this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][this['actions'][_0x4e4aad['actionid']][_0xb7a1('0xbb')]]);this[_0xb7a1('0xca')]({'active':![],'ContactId':this[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xde')],'ListId':this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xdf')],'VoiceQueueId':this['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xe1')]||undefined,'CampaignId':this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x4e4aad['actionid']];unlockQueueStatus(_0x17b879);}}else if((strategy[this['voiceQueues'][this[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xbb')]][_0xb7a1('0x52')]]||_0xb7a1('0x1d'))===_0xb7a1('0x1d')){var _0x3c2988;if(this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]&&!_[_0xb7a1('0x81')](this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]['queue']])){if(this[_0xb7a1('0x140')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xbb')]]){this['queueBookedRR'][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]=this[_0xb7a1('0x140')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]?this[_0xb7a1('0x140')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]['queue']]:this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]?this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x141')]||0x0:0x0;}this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x141')]=this['queueBookedRR'][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]];for(var _0xadb38a=0x0;_0xadb38a=0x0;})[_0xb7a1('0xb8')](myreject(_0x181fd)));}}else{_0x5b3628[_0xb7a1('0x13a')](ami[_0xb7a1('0xb5')]({'action':'command','command':util['format'](_0xb7a1('0x15f'),_0x4f720b,!_[_0xb7a1('0x43')](config[_0xb7a1('0x156')][_0x4096da])?_0x4096da:'')})[_0xb7a1('0xbf')](function(_0x51b6fd){return _0x51b6fd[_0xb7a1('0x15c')][_0xb7a1('0x15d')](_0xb7a1('0x15e'))>=0x0;})[_0xb7a1('0xb8')](myreject(_0x181fd)));}Promise['all'](_0x5b3628)[_0xb7a1('0xbf')](function(_0x162d84){var _0x15abcd=_['some'](_0x162d84);if(_0x15abcd){return _0x784e9b(_0x15abcd);}else{_0x3184a4[_0xb7a1('0x44')]=_0x17efd1?_0xb7a1('0x160'):'INTERVAL_IS_OVERTIME';return _0x181fd(msgResponse('[ifTime][promiseAll]',_0xb7a1('0x154'),_0xb7a1('0x161')+_0x17efd1+'\x20'+_0x25ee68+_0xb7a1('0x162')+util[_0xb7a1('0x9e')](_0x4f720b,{'showHidden':![],'depth':null})+_0xb7a1('0x163')+_0x4096da));}})[_0xb7a1('0xb8')](function(_0x5735eb){return _0x181fd(msgResponse(_0xb7a1('0x152'),'Failure',JSON['stringify'](_0x5735eb)));});});};Dialer[_0xb7a1('0x1f')]['checkDialMethod']=function(_0x4c7a76){var _0x110ba1=this;return function(){switch(_0x4c7a76['dialMethod']){case'progressive':freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,0x1);break;case _0xb7a1('0x165'):freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,_0x4c7a76['dialPowerLevel']);break;case _0xb7a1('0xa'):_0x110ba1['predictive'](_0x4c7a76);break;case _0xb7a1('0x9'):freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,0x1);break;default:freeVariablesPredictive(_0x4c7a76);logger['error'](_0xb7a1('0x166'),_0x4c7a76['name'],'method\x20not\x20recognized');}};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x167')]=function(_0x546fa2){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper[_0xb7a1('0x168')](_0x546fa2['id'],previewRecallmeReminderInterval))['then'](function(_0x3fdda7){for(var _0xdc6908=0x0;_0xdc6908<_0x3fdda7[_0xb7a1('0xa0')];_0xdc6908++){var _0x5ade7b=_0x3fdda7[_0xdc6908][_0xb7a1('0x169')][_0xb7a1('0x45')];if(_0x5ade7b)io['to'](util[_0xb7a1('0x7c')]('user:%s',_0x5ade7b))[_0xb7a1('0xf4')](_0xb7a1('0x16a'),{'hopper':_0x3fdda7[_0xdc6908]});}})['catch'](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x463341){var _0x482e7d=this;return function(){_0x482e7d['handleIvr'](_0x463341);};};Dialer[_0xb7a1('0x1f')]['syncQueueSummary']=function(_0x3e2309){var _0x36fbb3=this;if(isNotPreview(_0x3e2309[_0xb7a1('0x61')])){if(isVoiceQueueOutbound(_0x3e2309[_0xb7a1('0x5b')])&&isActive(_0x3e2309['dialActive'])){_0x3e2309[_0xb7a1('0xa6')]=!![];Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](checkIsLoggedIn(_0x3e2309,_0x3e2309['loggedIn']))[_0xb7a1('0xbf')](checkIsActive(_0x3e2309,_0x3e2309[_0xb7a1('0x60')]))['then'](checkInterval(_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x16b')](_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x151')](_0x3e2309[_0xb7a1('0x16c')],_0x3e2309[_0xb7a1('0x16d')],_0x3e2309[_0xb7a1('0x45')],_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x153')](_0x3e2309[_0xb7a1('0x4b')],_0x3e2309[_0xb7a1('0x16d')],_0x3e2309['name'],_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x16e')](_0x3e2309))[_0xb7a1('0xb8')](loggerCatchQueueSummary(_0xb7a1('0x16f'),_0x3e2309));}else{notSendMessagesQueue(_0x3e2309);}}else{freeVariablesPredictive(_0x3e2309);}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x37')]=_[_0xb7a1('0x170')](function(){var _0x349d60=_[_0xb7a1('0x171')](this['voiceQueues'],function(_0x114671){return _0x114671[_0xb7a1('0x172')];});var _0xaa6d27=_[_0xb7a1('0x171')](this[_0xb7a1('0x24')],function(_0x567944){return _0x567944['online']&&_0x567944[_0xb7a1('0xb6')]==='reachable';});if(_0x349d60[_0xb7a1('0xa0')]>0x0&&_0xaa6d27[_0xb7a1('0xa0')]>0x0){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper[_0xb7a1('0x168')](_[_0xb7a1('0x173')](_0x349d60,'id'),previewRecallmeReminderInterval,_['map'](_0xaa6d27,'id')))['then'](function(_0x7c2d7c){for(var _0x285e81=0x0;_0x285e81<_0x7c2d7c[_0xb7a1('0xa0')];_0x285e81++){var _0x4e86b4=_0x7c2d7c[_0x285e81][_0xb7a1('0x169')][_0xb7a1('0x45')];if(_0x4e86b4)io['to'](util[_0xb7a1('0x7c')](_0xb7a1('0x174'),_0x4e86b4))['emit'](_0xb7a1('0x16a'),{'hopper':_0x7c2d7c[_0x285e81]});}})[_0xb7a1('0xb8')](function(_0x276898){logger[_0xb7a1('0x9f')]('checkPreviewRecallReminder',_0x276898);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xb7a1('0x1f')]['syncCampaigns']=function(){var _0x549bcb=this;var _0x3360e6;for(var _0xce845b in this[_0xb7a1('0x23')]){if(typeof this['campaigns'][_0xce845b]!==_0xb7a1('0xb1')){_0x3360e6=this['campaigns'][_0xce845b];if(isCampaignIvr(_0x3360e6[_0xb7a1('0x5b')])&&isActive(_0x3360e6[_0xb7a1('0x7a')])){_0x3360e6['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xb7a1('0xbf')](checkIsActive(_0x3360e6,_0x3360e6['active']))[_0xb7a1('0xbf')](checkInterval(_0x3360e6))['then'](_0x549bcb['checkIsTrunkReachable'](_0x3360e6))[_0xb7a1('0xbf')](_0x549bcb[_0xb7a1('0x151')](_0x3360e6[_0xb7a1('0x16c')],_0x3360e6[_0xb7a1('0x16d')],_0x3360e6[_0xb7a1('0x45')],_0x3360e6))[_0xb7a1('0xbf')](_0x549bcb[_0xb7a1('0x153')](_0x3360e6[_0xb7a1('0x4b')],_0x3360e6[_0xb7a1('0x16d')],_0x3360e6[_0xb7a1('0x45')],_0x3360e6))['then'](_0x549bcb[_0xb7a1('0x175')](_0x3360e6))[_0xb7a1('0xb8')](loggerCatchQueueSummary(_0xb7a1('0x176'),_0x3360e6));}else{notSendMessagesCampaign(_0x3360e6);}}}};function getCallerIdRandom(_0x1f7f68,_0xeca4ee){var _0x27115e;var _0x219c7a;var _0x4b402b;if(_0xeca4ee<=0x0){_0xeca4ee=0x1;}_0x27115e=new RegExp(_0xb7a1('0x177')+_0xeca4ee+'}$');_0x219c7a=Math[_0xb7a1('0x178')](0xa,_0xeca4ee-0x1);_0x4b402b=Math[_0xb7a1('0x178')](0xa,_0xeca4ee)-0x1;return util[_0xb7a1('0x7c')]('%s',_[_0xb7a1('0x179')](_0x1f7f68,_0x27115e,_[_0xb7a1('0x17a')](_0x219c7a,_0x4b402b)));}function extractCalleridName(_0x1623f9){var _0x17ca43=_0x1623f9[_0xb7a1('0x17b')](/"(.*?)"/);return _0x17ca43?_0x17ca43[0x1]:_0x1623f9;}Dialer[_0xb7a1('0x1f')][_0xb7a1('0x17c')]=function(_0x210eff,_0x3b5ca0){var _0x33bf32=this;var _0x2c6545=uuid['v4']();this['actions'][_0x2c6545]=new Action(_0x210eff,_0x3b5ca0,_0x2c6545);return new Promise(function(_0x130cd0,_0x1d608a){if(_[_0xb7a1('0x43')](_0x210eff)&&typeof _0x210eff!==_0xb7a1('0x17d')){return _0x1d608a(msgResponse('originate',_0xb7a1('0x154'),_0xb7a1('0x17e')));}if(_[_0xb7a1('0x43')](_0x3b5ca0['phone'])||_0x3b5ca0[_0xb7a1('0x17f')]===null){return _0x1d608a(msgResponse('originate',_0xb7a1('0x154'),_0xb7a1('0x180')));}var _0x2dfc3d={'XMD-CALLERID':_0x33bf32[_0xb7a1('0xb0')][_0x2c6545][_0xb7a1('0x181')](),'XMD-AGI':_0x210eff[_0xb7a1('0x115')]?util[_0xb7a1('0x7c')](_0xb7a1('0x182'),ipAgi,_0x210eff[_0xb7a1('0x115')]):'NONE','XMD-AGIAFTER':_0x210eff['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x210eff[_0xb7a1('0x11e')]):'NONE','XMD-QUEUE':_0x210eff['type']===_0xb7a1('0x51')?util[_0xb7a1('0x7c')](_0xb7a1('0x183'),_0x210eff['name'],_0x210eff['dialQueueOptions']||'',_0x210eff[_0xb7a1('0x11f')]?'c':'',_0x210eff[_0xb7a1('0x125')]||0x3):_0xb7a1('0x184'),'XMD-CONTACTID':_0x3b5ca0[_0xb7a1('0xde')],'XMD-CDRTYPE':_0xb7a1('0x8'),'CALLERID(all)':_0x33bf32['actions'][_0x2c6545][_0xb7a1('0x181')](),'XMD-AMD':_0x210eff[_0xb7a1('0xf9')]?_0xb7a1('0x185'):_0xb7a1('0x184'),'XMD-DESTINATION':_0xb7a1('0xed')};if(_0x210eff[_0xb7a1('0xf9')]){_0x2dfc3d[_0xb7a1('0x186')]=_0x210eff['dialAMDInitialSilence']||0x9c4;_0x2dfc3d['XMD-AMDGREETING']=_0x210eff[_0xb7a1('0x187')]||0x5dc;_0x2dfc3d[_0xb7a1('0x188')]=_0x210eff[_0xb7a1('0x189')]||0x320;_0x2dfc3d[_0xb7a1('0x18a')]=_0x210eff[_0xb7a1('0x18b')]||0x1388;_0x2dfc3d[_0xb7a1('0x18c')]=_0x210eff['dialAMDMinWordLength']||0x64;_0x2dfc3d[_0xb7a1('0x18d')]=_0x210eff[_0xb7a1('0x18e')]||0x32;_0x2dfc3d[_0xb7a1('0x18f')]=_0x210eff[_0xb7a1('0x190')]||0x3;_0x2dfc3d[_0xb7a1('0x191')]=_0x210eff[_0xb7a1('0x192')]||0x100;_0x2dfc3d['XMD-AMDMAXIMUMWORDLENGTH']=_0x210eff[_0xb7a1('0x193')]||0x1388;}if(_0x210eff[_0xb7a1('0x5b')]==='outbound'){_0x2dfc3d[_0xb7a1('0x194')]=_0x3b5ca0['VoiceQueueId'];}else{_0x2dfc3d[_0xb7a1('0x195')]=_0x3b5ca0['CampaignId'];}for(var _0x55b64e in _0x3b5ca0[_0xb7a1('0x196')]){if(typeof _0x3b5ca0[_0xb7a1('0x196')][_0x55b64e]!==_0xb7a1('0xb1')){if(isNotNull(_0x3b5ca0['Contact'][_0x55b64e])&&_0x55b64e!=='id'&&_0x55b64e!==_0xb7a1('0x197')&&_0x55b64e!==_0xb7a1('0x198')&&_0x55b64e!==_0xb7a1('0x199')){_0x2dfc3d[util['format'](_0xb7a1('0x19a'),_0xb7a1('0x19b'),_[_0xb7a1('0x19c')](_0x55b64e))]=_0x3b5ca0['Contact'][_0x55b64e];}}}var _0x1bf5eb=_0x33bf32['isTrunkReachable'](_0x210eff['Trunk'])?getCallerId(_0x210eff[_0xb7a1('0x79')]['callerid'],_0x210eff[_0xb7a1('0x62')],_0x210eff[_0xb7a1('0x19d')]>0x0?getCallerIdRandom(_0x210eff[_0xb7a1('0x63')],_0x210eff['dialRandomLastDigitCallerIdNumber']):_0x210eff[_0xb7a1('0x63')]):getCallerId(_[_0xb7a1('0xb4')](_0x210eff[_0xb7a1('0x14e')])?_0x210eff[_0xb7a1('0x79')]['callerid']:_0x210eff[_0xb7a1('0x14e')][_0xb7a1('0x7b')],_0x210eff[_0xb7a1('0x62')],_0x210eff[_0xb7a1('0x19d')]>0x0?getCallerIdRandom(_0x210eff['dialOriginateCallerIdNumber'],_0x210eff[_0xb7a1('0x19d')]):_0x210eff[_0xb7a1('0x63')]);if(_0x1bf5eb){_0x2dfc3d[_0xb7a1('0x19e')]=_0x33bf32[_0xb7a1('0xb0')][_0x2c6545]['originatecalleridname']=extractCalleridName(_0x1bf5eb);_0x2dfc3d[_0xb7a1('0x19f')]=_0x3b5ca0[_0xb7a1('0x17f')];}_0x210eff[_0xb7a1('0x1a0')]=_0x2dfc3d;return ami[_0xb7a1('0xb5')]({'actionid':_0x2c6545,'action':'originate','channel':_0x33bf32['isTrunkReachable'](_0x210eff[_0xb7a1('0x79')])?util[_0xb7a1('0x7c')]('SIP/%s/%s%s',_0x210eff[_0xb7a1('0x79')][_0xb7a1('0x45')],isNotNull(_0x210eff[_0xb7a1('0x1a1')])?_0x210eff[_0xb7a1('0x1a1')][_0xb7a1('0x1a2')]()||'':'',_0x210eff['dialCutDigit']>0x0?_0x3b5ca0[_0xb7a1('0x17f')][_0xb7a1('0x1a3')](_0x210eff[_0xb7a1('0x1a4')]):_0x3b5ca0['phone']):util[_0xb7a1('0x7c')](_0xb7a1('0x1a5'),_[_0xb7a1('0xb4')](_0x210eff[_0xb7a1('0x14e')])?_0x210eff['Trunk'][_0xb7a1('0x45')]:_0x210eff[_0xb7a1('0x14e')]['name'],isNotNull(_0x210eff['dialPrefix'])?_0x210eff[_0xb7a1('0x1a1')][_0xb7a1('0x1a2')]()||'':'',_0x210eff[_0xb7a1('0x1a4')]>0x0?_0x3b5ca0[_0xb7a1('0x17f')][_0xb7a1('0x1a3')](_0x210eff[_0xb7a1('0x1a4')]):_0x3b5ca0[_0xb7a1('0x17f')]),'callerid':_0x1bf5eb,'Exten':_0xb7a1('0xed'),'Context':_0xb7a1('0x1a6'),'Priority':'1','variable':_0x2dfc3d,'timeout':(_0x210eff[_0xb7a1('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c6545})[_0xb7a1('0xbf')](function(_0x255b91){return _0x130cd0(_0x255b91);})[_0xb7a1('0xb8')](function(_0x41e859){_0x210eff[_0xb7a1('0x6b')]+=0x1;var _0x8849a6=new History(_0x33bf32[_0xb7a1('0xb0')][_0x2c6545]);logger[_0xb7a1('0x9f')](util[_0xb7a1('0x7c')](_0xb7a1('0x1a7'),JSON[_0xb7a1('0x4d')](_0x41e859)));_0x8849a6[_0xb7a1('0xf0')]=0xe;_0x8849a6[_0xb7a1('0xf1')]='OriginateError';_0x8849a6[_0xb7a1('0xad')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));_0x8849a6[_0xb7a1('0xac')]=_0x8849a6[_0xb7a1('0xad')];_0x33bf32[_0xb7a1('0xd7')](_0x8849a6)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1a8')));_0x33bf32[_0xb7a1('0xd5')](_0x8849a6)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1a8')))[_0xb7a1('0x21')](function(){delete _0x33bf32['actions'][_0x2c6545];return _0x1d608a(msgResponse(_0xb7a1('0x1a9'),_0xb7a1('0x1aa'),_0xb7a1('0x1ab')));});});});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x33')]=function(_0x3e65b2){var _0x355023=this[_0xb7a1('0xb0')][_0x3e65b2[_0xb7a1('0x137')]];if(_0x355023){delete this['actions'][_0x3e65b2[_0xb7a1('0x137')]];_0x355023[_0xb7a1('0x124')]=moment()['format'](_0xb7a1('0x10c'));var _0x54acf2=_0x355023[_0xb7a1('0x5b')]===_0xb7a1('0x7e')?this[_0xb7a1('0x23')][_0x355023['queue']]:this[_0xb7a1('0x22')][_0x355023[_0xb7a1('0x1ac')]()];if(!this[_0xb7a1('0xe4')](_0x3e65b2[_0xb7a1('0x1ad')])){this['updateOriginated'](_0x54acf2);return this['callProgressDetecting'](_0x355023,_0x54acf2,_0x3e65b2)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1ae')));}this[_0xb7a1('0x29')][_0x3e65b2[_0xb7a1('0xe9')]]=_0x355023;}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1af')]=function(_0x1bc58b,_0x552f2e,_0x1cc41b){var _0x2afacf=new History(_0x552f2e);if(_0x2afacf['countbusyretry']+_0x2afacf['countcongestionretry']+_0x2afacf[_0xb7a1('0x1b0')]+_0x2afacf[_0xb7a1('0x100')]+_0x2afacf[_0xb7a1('0x111')]+_0x2afacf[_0xb7a1('0x101')]+_0x2afacf[_0xb7a1('0x105')]+_0x2afacf[_0xb7a1('0x102')]>=_0x1cc41b[_0xb7a1('0x103')]-0x1){return!![];}switch(_0x1bc58b){case 0x3:if(_0x2afacf[_0xb7a1('0x1b0')]>=_0x1cc41b['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2afacf[_0xb7a1('0x1b0')]+=0x1,'scheduledat':moment()['add'](_0x1cc41b[_0xb7a1('0x1b1')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2afacf[_0xb7a1('0xff')]>=_0x1cc41b[_0xb7a1('0x1b2')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countbusyretry':_0x2afacf['countbusyretry']+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b3')],_0xb7a1('0x10b'))['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x1b4')));break;case 0x8:if(_0x2afacf['countcongestionretry']>=_0x1cc41b[_0xb7a1('0x1b5')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countcongestionretry':_0x2afacf[_0xb7a1('0x110')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b6')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf['CampaignId']||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1b7')));break;case 0x0:if(_0x2afacf[_0xb7a1('0x100')]>=_0x1cc41b[_0xb7a1('0x1b8')]-0x1){return!![];}else{this[_0xb7a1('0xca')]({'active':![],'countnosuchnumberretry':_0x2afacf['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b9')],'minutes')['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf['VoiceQueueId']||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1ba')));}break;case 0xa:if(_0x2afacf['countdropretry']>=_0x1cc41b['dialDropMaxRetry']-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countdropretry':_0x2afacf[_0xb7a1('0x111')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x129')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x12c')));break;case 0xb:if(_0x2afacf['countabandonedretry']>=_0x1cc41b[_0xb7a1('0x132')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countabandonedretry':_0x2afacf[_0xb7a1('0x101')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x133')],_0xb7a1('0x10b'))['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x134')));break;case 0x13:if(_0x2afacf[_0xb7a1('0x105')]>=_0x1cc41b[_0xb7a1('0x106')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countmachineretry':_0x2afacf[_0xb7a1('0x105')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x10d')));break;case 0x14:if(_0x2afacf[_0xb7a1('0x102')]>=_0x1cc41b['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countagentrejectretry':_0x2afacf[_0xb7a1('0x102')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1bb')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1bc')]=function(_0x353a51,_0x28bc7c,_0x5b3e53){var _0x253ef1=this;var _0x10af47=new History(_0x353a51);var _0x14bda9=![];var _0x42bd07;var _0x37bade;return new Promise(function(_0x5697de,_0x2a531f){if(_[_0xb7a1('0x43')](_0x28bc7c)&&typeof _0x28bc7c!==_0xb7a1('0x17d')){return _0x2a531f(msgResponse(_0xb7a1('0x1bd'),_0xb7a1('0x154'),_0xb7a1('0x1be')));}if(_['isUndefined'](_0x5b3e53)&&typeof _0x5b3e53!==_0xb7a1('0x17d')){return _0x2a531f(msgResponse(_0xb7a1('0x1bd'),_0xb7a1('0x154'),'evt\x20is\x20undefine'));}_0x253ef1[_0xb7a1('0xc2')](_0x10af47,_0x5b3e53[_0xb7a1('0x11b')],_0x28bc7c)['then'](function(_0x198104){if(_0x198104[_0xb7a1('0x12b')]==0x1)_0x14bda9=!![];switch(_0x5b3e53[_0xb7a1('0x11b')]){case'0':_0x28bc7c[_0xb7a1('0x6a')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x0;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1bf');_0x10af47['countnosuchnumberretry']+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;ami[_0xb7a1('0xf4')](_0xb7a1('0x1c0'),ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1c1')));_0x42bd07=_0x28bc7c[_0xb7a1('0x1b9')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10f')));if(_0x253ef1[_0xb7a1('0x1af')](0x0,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x100')]>=_0x28bc7c[_0xb7a1('0x1b8')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,'reason\x200\x20no\x20such\x20number....');}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1c2'));}}break;case'3':_0x28bc7c[_0xb7a1('0x69')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x3;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1c3');_0x10af47[_0xb7a1('0x1b0')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;var _0x22ed66=ut[_0xb7a1('0x1c4')](_0x353a51,_0x28bc7c);ami[_0xb7a1('0xf4')](_0xb7a1('0x1c5'),_0x22ed66);_0x42bd07=_0x28bc7c[_0xb7a1('0x1b1')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1['createHistory'](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1c6')));if(_0x253ef1[_0xb7a1('0x1af')](0x3,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x1b0')]>=_0x28bc7c[_0xb7a1('0x1c7')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1c8'));}else{_0x253ef1['stateGlobal'](_0x10af47,_0x5697de,_0x2a531f,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x28bc7c['outboundBusyCallsDay']+=0x1;_0x10af47['state']=0x5;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1c9');_0x10af47[_0xb7a1('0xff')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;ami[_0xb7a1('0xf4')]('custom:agentbusy',ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1ca')));_0x42bd07=_0x28bc7c[_0xb7a1('0x1b3')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1cb')));if(_0x253ef1[_0xb7a1('0x1af')](0x5,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0xff')]>=_0x28bc7c[_0xb7a1('0x1b2')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1cc'));}else{_0x253ef1['stateGlobal'](_0x10af47,_0x5697de,_0x2a531f,'reason\x205\x20busy');}}break;case'8':_0x28bc7c[_0xb7a1('0x1cd')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x8;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1ce');_0x10af47['countcongestionretry']+=0x1;_0x10af47['countglobal']+=0x1;_0x42bd07=_0x28bc7c[_0xb7a1('0x1b6')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];ami['emit']('custom:agentcongestion',ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1cf')));_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1d0')));if(_0x253ef1['checkRetriveMax'](0x8,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x110')]>=_0x28bc7c[_0xb7a1('0x1b5')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,'reason\x208\x20congestion');}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d1'));}}break;case'11':_0x28bc7c[_0xb7a1('0x1d2')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0xb;_0x10af47[_0xb7a1('0xf1')]='Abandoned';_0x10af47[_0xb7a1('0x101')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;_0x42bd07=_0x28bc7c[_0xb7a1('0x133')];_0x37bade=_0x28bc7c['callAdditionalPhoneAfterMin'];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x253ef1[_0xb7a1('0x1af')](0xb,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47['countabandonedretry']>=_0x28bc7c[_0xb7a1('0x132')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d3'));}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d3'));}}break;case'20':_0x28bc7c['outboundRejectCallsDay']+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x14;_0x10af47['statedesc']='AgentReject';_0x10af47['countagentrejectretry']+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;_0x42bd07=_0x28bc7c['dialAgentRejectRetryFrequency'];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];ami['emit'](_0xb7a1('0x1d4'),ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1d5')));_0x253ef1[_0xb7a1('0xd7')](_0x10af47)['catch'](loggerCatch(_0xb7a1('0x1d6')));if(_0x253ef1['checkRetriveMax'](0x14,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x102')]>=_0x28bc7c['dialAgentRejectMaxRetry']){_0x253ef1['createStateFinal'](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d7'));}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d7'));}}break;default:_0x28bc7c['outboundUnknownCallsDay']+=0x1;_0x10af47[_0xb7a1('0xf0')]=0xc;_0x10af47['statedesc']=_0x5b3e53[_0xb7a1('0x11b')];_0x42bd07=_0x28bc7c['dialAgentRejectRetryFrequency'];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1d8')));if(_0x253ef1[_0xb7a1('0x1af')](_0x5b3e53[_0xb7a1('0x11b')],_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47['countbusyretry']+_0x10af47['countcongestionretry']+_0x10af47[_0xb7a1('0x1b0')]+_0x10af47[_0xb7a1('0x100')]+_0x10af47[_0xb7a1('0x111')]+_0x10af47[_0xb7a1('0x101')]+_0x10af47[_0xb7a1('0x105')]+_0x10af47[_0xb7a1('0x102')]>=_0x28bc7c[_0xb7a1('0x103')]){_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0x5b3e53[_0xb7a1('0x11b')]);}else{_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0x5b3e53['reason']);}}}})[_0xb7a1('0xbf')](function(){if(_0x14bda9){_0x253ef1[_0xb7a1('0xc4')](_0x10af47,_0x42bd07,_0x37bade)[_0xb7a1('0xbf')](function(){return _0x5697de(0x1);});}});});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x104')]=function(_0x21aa36,_0x28ec83,_0x3ad132,_0x5237db){var _0x255821=new Final(_0x21aa36);_0x255821[_0xb7a1('0xf0')]=0xf;_0x255821[_0xb7a1('0xf1')]=_0xb7a1('0x1d9');this['createStateFinal'](_0x255821,_0x28ec83,_0x3ad132,_0x5237db);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x107')]=function(_0x52a01d,_0x47a339,_0xbf8428,_0x4b57bf){this['moveContactManagedDialer'](_0x52a01d)[_0xb7a1('0xbf')](function(){return _0x47a339(msgResponse('[callProgressDetecting]',_0xb7a1('0xe5'),_0x4b57bf));})[_0xb7a1('0xb8')](function(){return _0xbf8428(msgResponse(_0xb7a1('0x1da'),_0xb7a1('0x154'),_0xb7a1('0x1db')));});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xa')]=function(_0x21928f){var _0x1cde4c=_0x21928f[_0xb7a1('0x1dc')]/0x64;var _0xabb35b=_0x21928f['outboundDropCallsDayTimeout']/(_0x21928f[_0xb7a1('0x126')]+_0x21928f[_0xb7a1('0x66')]);var _0x235d95=Math['round'](_0x21928f[_0xb7a1('0x74')]*(_0x21928f[_0xb7a1('0x1dd')]/0x64));var _0x31f83d=Math[_0xb7a1('0x1de')](_0x21928f[_0xb7a1('0x74')]*(_0x21928f[_0xb7a1('0x1df')]/0x64));var _0x3769d7=_0x21928f[_0xb7a1('0x54')]+_0x21928f['talking'];var _0x4ebf46=Math[_0xb7a1('0x1e0')](_0x21928f[_0xb7a1('0x76')]*_0x21928f[_0xb7a1('0x77')]*_0x21928f[_0xb7a1('0x71')]*_0x21928f[_0xb7a1('0x72')]);if(_[_0xb7a1('0x43')](_0x21928f[_0xb7a1('0x2c')])){if(!_['isUndefined'](_0x21928f[_0xb7a1('0x2b')])){_0x21928f['startPredictive']=undefined;loggerPredictive[_0xb7a1('0x9f')](_0xb7a1('0x1e1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x21928f[_0xb7a1('0x97')])){loggerPredictive[_0xb7a1('0x9f')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x21928f[_0xb7a1('0x97')]);_0x21928f[_0xb7a1('0x97')]=undefined;}_0x21928f[_0xb7a1('0x2c')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],_0xb7a1('0x1e2'),_0x21928f[_0xb7a1('0x2c')]);this[_0xb7a1('0x164')](_0x21928f,0x1);}else if(ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2c')])){this[_0xb7a1('0x164')](_0x21928f,0x1);loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x1e3'),_0x21928f[_0xb7a1('0x2c')],_0x21928f[_0xb7a1('0x45')]);_0x21928f['erlangCalls']=0x0;_0x21928f[_0xb7a1('0x70')]=0x0;}else if(_0x1cde4c<_0xabb35b&&_0x21928f['dialPredictiveOptimization']===_0xb7a1('0x1e4')){freeVariablesPredictive(_0x21928f);loggerPredictive['info'](_0xb7a1('0x1e5'),_0xb7a1('0x1e6'),_0xabb35b,_0xb7a1('0x2c'),_0x21928f[_0xb7a1('0x45')]);}else if(_0x4ebf46<_0x21928f['predictiveIntervalErlangCallsDroppedCalls']&&_0x21928f[_0xb7a1('0x1e7')]===_0xb7a1('0x1e4')){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x1e8'),_0xb7a1('0x1e9'),_0x4ebf46,_0xb7a1('0x1ea'),_0x21928f['predictiveIntervalErlangCallsDroppedCalls'],_0xb7a1('0x2c'),_0x21928f[_0xb7a1('0x45')]);}else if(!ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2c')])&&_[_0xb7a1('0x43')](_0x21928f[_0xb7a1('0x2b')])&&!_['isUndefined'](_0x21928f[_0xb7a1('0x2c')])){_0x21928f[_0xb7a1('0x2b')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],_0xb7a1('0x1eb'),_0x21928f[_0xb7a1('0x2b')]);this[_0xb7a1('0xc8')](_0x21928f[_0xb7a1('0x1ec')])[_0xb7a1('0xbf')](this[_0xb7a1('0x1ed')](_0x21928f))[_0xb7a1('0xbf')](mergeDataErlangB(_0x21928f))['then'](this[_0xb7a1('0x1ee')](_0x21928f))['catch'](loggerCatchPredictive(_0xb7a1('0x1ef'),_0x21928f));}else if(!ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2b')])){_0x21928f[_0xb7a1('0x70')]=0x0;_0x21928f['startPredictive']=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],'recalculate\x20predictive\x20at',_0x21928f[_0xb7a1('0x2b')]);clearInterval(_0x21928f['handlePredictive']);_0x21928f[_0xb7a1('0x97')]=undefined;this[_0xb7a1('0xc8')](_0x21928f[_0xb7a1('0x1ec')])[_0xb7a1('0xbf')](this['getDataPredictive'](_0x21928f))[_0xb7a1('0xbf')](mergeDataErlangB(_0x21928f))[_0xb7a1('0xbf')](this[_0xb7a1('0x1ee')](_0x21928f))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x21928f));}else if(_0x21928f[_0xb7a1('0x74')]&&_0x3769d7<_0x21928f[_0xb7a1('0x74')]-_0x31f83d){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0x21928f['name'],_0xb7a1('0x1f0'),_0x3769d7,_0xb7a1('0x1f1'),_0x21928f[_0xb7a1('0x74')],'-',_0x31f83d,'=',_0x21928f['predictiveIntervalAvailable']-_0x31f83d,')');}else if(_0x21928f['predictiveIntervalAvailable']&&_0x3769d7>_0x21928f[_0xb7a1('0x74')]+_0x235d95){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0x21928f['name'],_0xb7a1('0x1f0'),_0x3769d7,_0xb7a1('0x1f2'),_0x21928f['predictiveIntervalAvailable'],'+',_0x235d95,'=',_0x21928f[_0xb7a1('0x74')]+_0x235d95,')');}};Dialer[_0xb7a1('0x1f')]['getDataPredictive']=function(_0x57d7dd){var _0xcc9d27=this;return function(_0x55b003){return new Promise(function(_0x46b842,_0x36c3e3){_[_0xb7a1('0x94')](_0x57d7dd,_0x55b003[0x0]);if(checkGetDataPredictive(_0x55b003[0x0])){var _0x1f2657=_0x57d7dd[_0xb7a1('0x74')]=_0x57d7dd[_0xb7a1('0x59')]+_0x57d7dd[_0xb7a1('0x54')];var _0x2472c6=_0x57d7dd[_0xb7a1('0x1ec')]*0x3c;var _0x53c412=_0x55b003[0x0]['predictiveIntervalAvgTalktime']+_0x55b003[0x0][_0xb7a1('0x8a')];var _0x16bdbf=(_0x55b003[0x0][_0xb7a1('0x6e')]+_0x55b003[0x0][_0xb7a1('0x86')]+_0x55b003[0x0][_0xb7a1('0x88')])/_0x55b003[0x0][_0xb7a1('0x85')];_0x57d7dd['predictiveIntervalHitRate']=_0x16bdbf>0x0?_0x16bdbf:0x1;switch(_0x57d7dd[_0xb7a1('0x1e7')]){case _0xb7a1('0x1e4'):var _0xca79e0=_0x57d7dd[_0xb7a1('0x1dc')]/0x64;return _0xcc9d27[_0xb7a1('0x1f3')](_0x1f2657,_0x2472c6,_0x53c412,_0x16bdbf,_0xca79e0)[_0xb7a1('0xbf')](function(_0x32950d){return _0x46b842(_0x32950d);});case _0xb7a1('0x1f4'):var _0x1312d1=_0x57d7dd['dialPredictiveOptimizationPercentage']/0x64;return _0xcc9d27[_0xb7a1('0x1f5')](_0x1f2657,_0x2472c6,_0x53c412,_0x16bdbf,_0x1312d1)[_0xb7a1('0xbf')](function(_0x2ff5fb){return _0x46b842(_0x2ff5fb);});default:return _0x36c3e3(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),'Unknown\x20Predictive'));}}else{return _0x36c3e3(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),_0xb7a1('0x1f7')));}});};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1f8')]=function(_0x212720){var _0x450a75=this;return function(_0x2db7dc){return new Promise(function(_0x477e71,_0x20b952){_[_0xb7a1('0x94')](_0x212720,_0x2db7dc[0x0]);if(checkGetDataPredictive(_0x2db7dc[0x0])){loggerPredictive[_0xb7a1('0x83')](JSON[_0xb7a1('0x4d')](_0x2db7dc[0x0]));if(_0x212720['dialPredictiveOptimization']==='dropRate'){return _0x450a75['getVoiceQueueRtPauses'](_0x212720['id'])[_0xb7a1('0xbf')](function(_0x1c5cc2){var _0x217d5b=_0x212720['loggedIn']-_0x1c5cc2[0x0][_0xb7a1('0x1f9')];var _0x24b547=_0x212720['dialPredictiveInterval']*0x3c;var _0x5aec4f=_0x2db7dc[0x0][_0xb7a1('0x6f')]+_0x2db7dc[0x0]['predictiveIntervalAvgHoldtime'];var _0x266ee3=(_0x2db7dc[0x0][_0xb7a1('0x6e')]+_0x2db7dc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2db7dc[0x0][_0xb7a1('0x88')])/_0x2db7dc[0x0][_0xb7a1('0x85')];var _0x382dad=_0x212720[_0xb7a1('0x1dc')]/0x64;_0x212720[_0xb7a1('0x73')]=_0x1c5cc2[0x0][_0xb7a1('0x1f9')]||0x0;_0x212720[_0xb7a1('0x71')]=_0x266ee3>0x0?_0x266ee3:0x1;return _0x450a75[_0xb7a1('0x1f3')](_0x217d5b,_0x24b547,_0x5aec4f,_0x266ee3,_0x382dad);})[_0xb7a1('0xbf')](function(_0x2ccfc8){return _0x477e71(_0x2ccfc8);})[_0xb7a1('0xb8')](function(_0x2d4e29){return _0x20b952(msgResponse(_0xb7a1('0x1fa'),_0xb7a1('0x154'),JSON[_0xb7a1('0x4d')](_0x2d4e29)));});}if(_0x212720['dialPredictiveOptimization']===_0xb7a1('0x1f4')){return _0x450a75['getVoiceQueueRtPauses'](_0x212720['id'])[_0xb7a1('0xbf')](function(_0x226988){var _0x1523e8=_0x212720['loggedIn']-_0x226988[0x0]['outboundQueuePauses'];var _0x4ceb7e=_0x212720[_0xb7a1('0x1ec')]*0x3c;var _0x4a81b3=_0x2db7dc[0x0][_0xb7a1('0x6f')]+_0x2db7dc[0x0]['predictiveIntervalAvgHoldtime'];var _0x47edf0=(_0x2db7dc[0x0][_0xb7a1('0x6e')]+_0x2db7dc[0x0][_0xb7a1('0x86')]+_0x2db7dc[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2db7dc[0x0][_0xb7a1('0x85')];var _0x3c096d=_0x212720[_0xb7a1('0x1dc')]/0x64;_0x212720['predictiveIntervalPauses']=_0x226988[0x0][_0xb7a1('0x1f9')]||0x0;_0x212720[_0xb7a1('0x71')]=_0x47edf0>0x0?_0x47edf0:0x1;return _0x450a75[_0xb7a1('0x1f5')](_0x1523e8,_0x4ceb7e,_0x4a81b3,_0x47edf0,_0x3c096d);})[_0xb7a1('0xbf')](function(_0x15cf6e){return _0x477e71(_0x15cf6e);})[_0xb7a1('0xb8')](function(_0x3abbc2){return _0x20b952(msgResponse(_0xb7a1('0x1fa'),_0xb7a1('0x154'),JSON[_0xb7a1('0x4d')](_0x3abbc2)));});}}else{return _0x20b952(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),_0xb7a1('0x1f7')));}});};};Dialer[_0xb7a1('0x1f')]['startMethodPredictive']=function(_0xe5a97){var _0x374469=this;return function(){var _0x1007a4=0x0;var _0x1a5613=Math[_0xb7a1('0x1e0')](_0xe5a97[_0xb7a1('0x1fb')]*0x3e8);if(_0x1a5613>0x0){_0x1a5613=_0x1a5613<0x64?0x64:_0x1a5613;loggerPredictive['info'](_0xe5a97['name'],_0xb7a1('0x1fc'),_0x1a5613,_0xb7a1('0x4e'));_0xe5a97['handlePredictive']=setInterval(function(){_0x374469['handlePredictive'](_0xe5a97);loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x1fd'),_0x1007a4+=0x1);},_0x1a5613);}else{loggerPredictive[_0xb7a1('0x83')](_0xe5a97[_0xb7a1('0x45')],_0xb7a1('0x1fe'));}};};Dialer['prototype']['checkContactBlack']=function(_0x5894e2,_0x2ff417){var _0x2bcc28=this;return function(_0x2db6f3){if(_[_0xb7a1('0x81')](_0x2db6f3)){if(_[_0xb7a1('0xb4')](_0x2ff417[_0xb7a1('0xe0')])||!_0x2ff417['recallme']){if(_0x5894e2[_0xb7a1('0x61')]==='booked'){_0x5894e2[_0xb7a1('0x13c')]=_['isUndefined'](_0x5894e2[_0xb7a1('0x13c')])?!![]:_0x5894e2[_0xb7a1('0x13c')];var _0x512e54=uuid['v4']();_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]=new Action(_0x5894e2,_0x2ff417,_0x512e54);loggerBooked[_0xb7a1('0x83')](_0xb7a1('0x1ff'),_0x512e54,_0xb7a1('0x200'),JSON[_0xb7a1('0x4d')](_0x5894e2['queueStatusComplete']),_0xb7a1('0x201'),_0x5894e2[_0xb7a1('0x45')]);if(_0x5894e2['queueStatusComplete']){_0x5894e2[_0xb7a1('0x13c')]=![];_0x2bcc28[_0xb7a1('0x2e')][_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xbb')]]=[];ami[_0xb7a1('0xb5')]({'actionid':_0x512e54,'action':_0xb7a1('0x202'),'queue':_0x5894e2[_0xb7a1('0x45')]})[_0xb7a1('0xb8')](function(){_0x2bcc28['updateOriginated'](_0x5894e2);_0x2bcc28[_0xb7a1('0xca')]({'active':![],'ContactId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]['ContactId'],'ListId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]['ListId'],'VoiceQueueId':_0x2bcc28['actions'][_0x512e54][_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x203')));delete _0x2bcc28['actions'][_0x512e54];});}else{loggerBooked[_0xb7a1('0x83')](_0xb7a1('0x204'),JSON['stringify'](_0x5894e2['queueStatusComplete']),_0xb7a1('0x201'),_0x5894e2[_0xb7a1('0x45')]);_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);_0x2bcc28[_0xb7a1('0xca')]({'active':![],'ContactId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xde')],'ListId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xdf')],'VoiceQueueId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2bcc28['actions'][_0x512e54][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2bcc28[_0xb7a1('0xb0')][_0x512e54];}}else{return _0x2bcc28[_0xb7a1('0x17c')](_0x5894e2,_0x2ff417);}}else{if(getDiff(_0x2ff417[_0xb7a1('0x205')])<_0x5894e2[_0xb7a1('0x206')]*0x3c){if(_0x2ff417[_0xb7a1('0x169')]&&!_0x2ff417['Agent']['voicePause']){_0x2bcc28['preview'][_0xb7a1('0x207')](_0x2ff417['id'])[_0xb7a1('0x21')](function(){_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);});}else{_0x2bcc28[_0xb7a1('0xcc')]({'active':![]},_0x2ff417['id'],0x1)[_0xb7a1('0x21')](function(){_0x2bcc28['updateOriginated'](_0x5894e2);});}}else{_0x5894e2[_0xb7a1('0x6c')]+=0x1;_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);if(_0x5894e2[_0xb7a1('0x208')]){_0x2bcc28[_0xb7a1('0xca')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ff417[_0xb7a1('0xde')],'ListId':_0x2ff417['ListId'],'VoiceQueueId':_0x2ff417[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2ff417[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x209')));_0x2bcc28['createHistory'](createObjHistory(_0x5894e2,_0x2ff417,_0xb7a1('0x20a'),0x17,_0xb7a1('0x20b')))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x20c')));}else{_0x2bcc28[_0xb7a1('0xe8')](createObjHistory(_0x5894e2,_0x2ff417,_0xb7a1('0x20d'),0x16,_0xb7a1('0x20e')),_0xb7a1('0x20f'),_0xb7a1('0x210'));}}}}else{_0x5894e2[_0xb7a1('0x211')]+=0x1;_0x2bcc28[_0xb7a1('0xe8')](createObjHistory(_0x5894e2,_0x2ff417,'BLACKLIST',0xd,'Blacklist'),_0xb7a1('0x212'),'[Originate][MoveBlacklist]');throw _0xb7a1('0x213');}};};Dialer[_0xb7a1('0x1f')]['handleIvr']=function(_0x3db7d3){var _0x2b9a3c=this;var _0x1dbc97=_0x3db7d3[_0xb7a1('0x214')]-_0x3db7d3[_0xb7a1('0x75')]-_0x3db7d3[_0xb7a1('0xcf')];emitCampaignSummary(_0x3db7d3);if(_0x1dbc97>0x0){if(_0x1dbc97>this[_0xb7a1('0x26')]){_0x1dbc97=this[_0xb7a1('0x26')];}_0x3db7d3[_0xb7a1('0xcf')]+=_0x1dbc97;this['getContactDialerIvr'](_0x3db7d3['id'],_0x1dbc97,_0x3db7d3[_0xb7a1('0x215')],_0x3db7d3)[_0xb7a1('0xbf')](function(_0x58f272){_0x3db7d3[_0xb7a1('0xcf')]-=_0x1dbc97;_0x3db7d3[_0xb7a1('0xcf')]=_0x3db7d3[_0xb7a1('0xcf')]>0x0?_0x3db7d3['temp']:0x0;if(!checkContactEmpty(_0x58f272)){_0x3db7d3[_0xb7a1('0x44')]=_0xb7a1('0x216');logger[_0xb7a1('0x83')](_0xb7a1('0x217')+_0x3db7d3['name']);}else{_0x3db7d3[_0xb7a1('0x75')]+=_0x58f272[_0xb7a1('0xa0')];_0x3db7d3[_0xb7a1('0x44')]=_0xb7a1('0x218');for(var _0x552ce2=0x0;_0x552ce2<_0x58f272['length'];_0x552ce2+=0x1){_0x3db7d3['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x58f272[_0x552ce2])||_[_0xb7a1('0xb4')](_0x58f272[_0x552ce2][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x58f272[_0x552ce2]['phone'])){_0x2b9a3c[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x3db7d3,_0x58f272[_0x552ce2]);}else{_0x2b9a3c[_0xb7a1('0xc6')](_[_0xb7a1('0xdd')](_0x58f272[_0x552ce2],[_0xb7a1('0xe2'),'phone']))[_0xb7a1('0xbf')](_0x2b9a3c[_0xb7a1('0x21a')](_0x3db7d3,_0x58f272[_0x552ce2]))['catch'](_0x2b9a3c[_0xb7a1('0xdb')](_0xb7a1('0x21b'),_0x3db7d3));}}}})[_0xb7a1('0xb8')](loggerGetContactDialer(_0xb7a1('0x21c'),_0x3db7d3,_0x1dbc97));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x164')]=function(_0x1ca7a1,_0x458806){var _0x530058=this;var _0x26cadd=[];var _0x312086=_0x458806>=0x1?_0x458806:0x1;if(_0x1ca7a1[_0xb7a1('0x61')]===_0xb7a1('0x9')){_0x312086=0x1;}var _0x546424=Math[_0xb7a1('0x1e0')](_0x1ca7a1[_0xb7a1('0x54')]*_0x312086)-_0x1ca7a1[_0xb7a1('0x75')]-_0x1ca7a1[_0xb7a1('0xcf')];emitVoiceQueueSummary(_0x1ca7a1);if(_0x1ca7a1['dialLimitQueue']>0x0){var _0x2b9155=_0x1ca7a1['dialLimitQueue']-_0x1ca7a1[_0xb7a1('0x75')]-_0x1ca7a1[_0xb7a1('0x59')]-_0x1ca7a1[_0xb7a1('0xcf')]-_0x1ca7a1[_0xb7a1('0x56')];if(_0x546424>_0x2b9155){_0x546424=_0x2b9155;}}if(_0x546424>0x0){if(_0x1ca7a1[_0xb7a1('0x61')]===_0xb7a1('0x9')){_0x546424=0x1;}if(_0x546424>this[_0xb7a1('0x26')]){_0x546424=this[_0xb7a1('0x26')];}_0x1ca7a1[_0xb7a1('0xcf')]+=_0x546424;for(var _0x862cf3 in this[_0xb7a1('0x24')]){if(typeof this[_0xb7a1('0x24')][_0x862cf3]!==_0xb7a1('0xb1')){if(this['agents'][_0x862cf3]['state']===_0xb7a1('0x21d')&&this[_0xb7a1('0x24')][_0x862cf3][_0xb7a1('0xb6')]===_0xb7a1('0x21e')){_0x26cadd[_0xb7a1('0x13a')](this[_0xb7a1('0x24')][_0x862cf3]['id']);}}}this[_0xb7a1('0xce')](_0x1ca7a1['id'],_0x26cadd,_0x546424,_0x1ca7a1[_0xb7a1('0x215')],_0x1ca7a1)[_0xb7a1('0xbf')](function(_0x5443d7){_0x1ca7a1[_0xb7a1('0xcf')]-=_0x546424;_0x1ca7a1[_0xb7a1('0xcf')]=_0x1ca7a1['temp']>0x0?_0x1ca7a1[_0xb7a1('0xcf')]:0x0;if(!checkContactEmpty(_0x5443d7)){_0x530058[_0xb7a1('0xbd')](_0x1ca7a1)[_0xb7a1('0xbf')](sendMessageReschedule(_0x1ca7a1))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x21f')));}else{_0x1ca7a1[_0xb7a1('0x75')]+=_0x5443d7[_0xb7a1('0xa0')];_0x1ca7a1[_0xb7a1('0x44')]=_0x1ca7a1[_0xb7a1('0x61')]==='booked'?_0xb7a1('0x185'):_0xb7a1('0x218');for(var _0x413c6f=0x0;_0x413c6f<_0x5443d7[_0xb7a1('0xa0')];_0x413c6f+=0x1){if(_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f])||_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f]['phone'])){_0x530058[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x1ca7a1,_0x5443d7[_0x413c6f]);}else{_0x530058[_0xb7a1('0xc0')](_[_0xb7a1('0xdd')](_0x5443d7[_0x413c6f],[_0xb7a1('0xe1'),_0xb7a1('0x17f')]))[_0xb7a1('0xbf')](_0x530058['checkContactBlack'](_0x1ca7a1,_0x5443d7[_0x413c6f]))[_0xb7a1('0xb8')](_0x530058['loggerHandler'](_0xb7a1('0x219'),_0x1ca7a1));}}}})[_0xb7a1('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x1ca7a1,_0x546424));}};Dialer['prototype'][_0xb7a1('0x97')]=function(_0x139689){if(_0x139689[_0xb7a1('0x220')]>0x0){var _0x152cd3=_0x139689[_0xb7a1('0x220')]-_0x139689['originated']-_0x139689[_0xb7a1('0x59')];if(_0x152cd3>0x0){this[_0xb7a1('0x221')](_0x139689);}else{loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x222'));}}else{this[_0xb7a1('0x221')](_0x139689);}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x221')]=function(_0x2ef3ca){var _0x54cfcc=this;var _0x3818d6=[];_0x2ef3ca[_0xb7a1('0x75')]+=0x1;for(var _0x62ffa in this[_0xb7a1('0x24')]){if(typeof this[_0xb7a1('0x24')][_0x62ffa]!==_0xb7a1('0xb1')){if(this['agents'][_0x62ffa][_0xb7a1('0xf0')]===_0xb7a1('0x21d')&&this[_0xb7a1('0x24')][_0x62ffa][_0xb7a1('0xb6')]===_0xb7a1('0x21e')){_0x3818d6[_0xb7a1('0x13a')](this[_0xb7a1('0x24')][_0x62ffa]['id']);}}}this['getContactDialer'](_0x2ef3ca['id'],_0x3818d6,0x1,_0x2ef3ca[_0xb7a1('0x215')],_0x2ef3ca)[_0xb7a1('0xbf')](function(_0x20a7fc){if(!checkContactEmpty(_0x20a7fc)){checkContactLowerLimitOriginate(_0x2ef3ca,0x1,0x0);_0x54cfcc[_0xb7a1('0xbd')](_0x2ef3ca)[_0xb7a1('0xbf')](sendMessageReschedule(_0x2ef3ca))['catch'](loggerCatch(_0xb7a1('0x21f')));}else{_0x2ef3ca[_0xb7a1('0x44')]=_0xb7a1('0x218');if(_[_0xb7a1('0xb4')](_0x20a7fc[0x0])||_['isNil'](_0x20a7fc[0x0][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x20a7fc[0x0][_0xb7a1('0x17f')])){_0x54cfcc[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x2ef3ca,_0x20a7fc[0x0]);}else{_0x54cfcc[_0xb7a1('0xc0')](_[_0xb7a1('0xdd')](_0x20a7fc[0x0],[_0xb7a1('0xe1'),'phone']))[_0xb7a1('0xbf')](_0x54cfcc[_0xb7a1('0x21a')](_0x2ef3ca,_0x20a7fc[0x0]))['catch'](_0x54cfcc[_0xb7a1('0xdb')]('[actionOriginatePredictive]\x20',_0x2ef3ca));}}})[_0xb7a1('0xb8')](loggerGetContactDialer(_0xb7a1('0x223'),_0x2ef3ca,0x1));emitVoiceQueueSummary(_0x2ef3ca);};Dialer['prototype'][_0xb7a1('0x1f3')]=function(_0x2c4121,_0x4b75ed,_0x306c51,_0x3ede03,_0x4eb1ae,_0x418968){loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x224'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x225'),_0x2c4121);loggerPredictive[_0xb7a1('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b75ed);loggerPredictive[_0xb7a1('0x83')]('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',_0x306c51);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x226'),_0x3ede03);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x227'),_0x4eb1ae);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8c'));return new Promise(function(_0x2f2669,_0x3cf95a){if(_0x2c4121<=0x0||isNaN(_0x2c4121)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),'m\x20=\x20'+_0x2c4121));}if(_0x306c51<=0x0||isNaN(_0x306c51)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),'Error','Ts\x20=\x20'+_0x306c51));}if(_0x3ede03<=0x0||isNaN(_0x3ede03)){return _0x3cf95a(msgResponse('[abandonmentRate]',_0xb7a1('0x1aa'),_0xb7a1('0x229')+_0x3ede03));}if(_0x4b75ed<=0x0||isNaN(_0x4b75ed)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),_0xb7a1('0x22a')+_0x4b75ed));}if(_0x4eb1ae<=0x0||isNaN(_0x4eb1ae)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),_0xb7a1('0x22b')+_0x4eb1ae));}_0x418968=_0x418968||0x0;var _0x54aedd=0x1/_0x306c51;var _0x32ed43=0x0;var _0x7ca0c4=0x0;var _0x380dd0=0x0;var _0x3798dd=0x0;for(var _0x4c709b=0x0;_0x380dd0<_0x4eb1ae;_0x4c709b+=0x1){_0x7ca0c4=_0x4c709b/_0x4b75ed;_0x32ed43=(_0x3ede03*_0x7ca0c4+_0x418968)/_0x54aedd;_0x380dd0=erlangb(_0x32ed43,_0x2c4121);_0x3798dd=_0x32ed43/_0x2c4121*(0x1-erlangb(_0x32ed43,_0x2c4121));}return _0x2f2669({'erlangCalls':_0x4c709b,'erlangCallToSecond':_0x4b75ed/_0x4c709b,'erlangAbandonmentRate':_0x380dd0,'erlangBusyFactor':_0x3798dd});});};Dialer['prototype'][_0xb7a1('0x1f5')]=function(_0x384573,_0x1ee848,_0x2ec20b,_0x4e2c12,_0xeb4a53,_0x6332fe){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xb7a1('0x225'),_0x384573);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22c'),_0x1ee848);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22d'),_0x2ec20b);loggerPredictive[_0xb7a1('0x83')]('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',_0x4e2c12);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22e'),_0xeb4a53);loggerPredictive[_0xb7a1('0x83')]('---------------------------');return new Promise(function(_0x18424d,_0x55b03a){if(_0x384573<=0x0||isNaN(_0x384573)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),_0xb7a1('0x1aa'),_0xb7a1('0x230')+_0x384573));}if(_0x2ec20b<=0x0||isNaN(_0x2ec20b)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),'Error',_0xb7a1('0x231')+_0x2ec20b));}if(_0x4e2c12<=0x0||isNaN(_0x4e2c12)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),_0xb7a1('0x1aa'),_0xb7a1('0x229')+_0x4e2c12));}if(_0x1ee848<=0x0||isNaN(_0x1ee848)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),'Error',_0xb7a1('0x22a')+_0x1ee848));}if(_0xeb4a53<=0x0||isNaN(_0xeb4a53)){return _0x55b03a(msgResponse('[busyFactor]',_0xb7a1('0x1aa'),'Umin\x20=\x20'+_0xeb4a53));}_0x6332fe=_0x6332fe||0x0;var _0x4aedec=0x1/_0x2ec20b;var _0xa82270=0x0;var _0xf87a5b=0x0;var _0x2e6fae=0x0;var _0x1ff26b=0x0;for(var _0x5c6ead=0x0;_0x1ff26b<_0xeb4a53;_0x5c6ead+=0x1){_0xf87a5b=_0x5c6ead/_0x1ee848;_0xa82270=(_0x4e2c12*_0xf87a5b+_0x6332fe)/_0x4aedec;_0x2e6fae=erlangb(_0xa82270,_0x384573);_0x1ff26b=_0xa82270/_0x384573*(0x1-erlangb(_0xa82270,_0x384573));}return _0x18424d({'erlangCalls':_0x5c6ead,'erlangCallToSecond':_0x1ee848/_0x5c6ead,'erlangAbandonmentRate':_0x2e6fae,'erlangBusyFactor':_0x1ff26b});});};module[_0xb7a1('0x232')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 2f94ddb..b217e79 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe0b=['countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','responsetime','droptime','endtime','starttime','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry'];(function(_0x2913f9,_0x1f9165){var _0x3e9c0d=function(_0x25268c){while(--_0x25268c){_0x2913f9['push'](_0x2913f9['shift']());}};_0x3e9c0d(++_0x1f9165);}(_0xfe0b,0x122));var _0xbfe0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfe0b[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0xbfe0('0x0'));var _=require(_0xbfe0('0x1'));var moment=require(_0xbfe0('0x2'));function getSeconds(_0x297ccc,_0x76d55e){var _0x411e4f=moment(_0x297ccc)['milliseconds'](0x0);var _0x1be79b=moment(_0x76d55e)['milliseconds'](0x0);return _0x411e4f[_0xbfe0('0x3')](_0x1be79b,_0xbfe0('0x4'));}function QueueCallerAbandon(_0x14f00d,_0x382f01){this['scheduledat']=_0x14f00d[_0xbfe0('0x5')];this['type']=_0x14f00d['type'];this[_0xbfe0('0x6')]=_0x14f00d[_0xbfe0('0x7')]===_0xbfe0('0x8')?'queue':_0x14f00d[_0xbfe0('0x7')];this[_0xbfe0('0x9')]=_0x14f00d['countbusyretry'];this[_0xbfe0('0xa')]=_0x14f00d[_0xbfe0('0xa')];this['countnoanswerretry']=_0x14f00d[_0xbfe0('0xb')];this[_0xbfe0('0xc')]=_0x14f00d[_0xbfe0('0x9')]+_0x14f00d[_0xbfe0('0xa')]+_0x14f00d['countnoanswerretry']+_0x14f00d['countnosuchnumberretry']+_0x14f00d[_0xbfe0('0xd')]+_0x14f00d[_0xbfe0('0xe')]+_0x14f00d[_0xbfe0('0xf')]+_0x14f00d['countagentrejectretry'];this[_0xbfe0('0x10')]=_0x14f00d['countnosuchnumberretry'];this['countdropretry']=_0x14f00d['countdropretry'];this[_0xbfe0('0xe')]=_0x14f00d[_0xbfe0('0xe')];this[_0xbfe0('0xf')]=_0x14f00d[_0xbfe0('0xf')];this[_0xbfe0('0x11')]=_0x14f00d[_0xbfe0('0x11')];this[_0xbfe0('0x12')]=_0x382f01[_0xbfe0('0x12')];this[_0xbfe0('0x13')]=_0x14f00d['name'];this[_0xbfe0('0x14')]=_0x14f00d[_0xbfe0('0x15')];this['starttime']=_0x14f00d['starttime'];this['responsetime']=_0x14f00d[_0xbfe0('0x16')];this[_0xbfe0('0x17')]=_0x14f00d[_0xbfe0('0x17')];this[_0xbfe0('0x18')]=this[_0xbfe0('0x17')];this['ringtime']=getSeconds(_0x14f00d[_0xbfe0('0x16')],_0x14f00d[_0xbfe0('0x19')]);this[_0xbfe0('0x1a')]=getSeconds(this[_0xbfe0('0x17')],_0x14f00d['responsetime']);this[_0xbfe0('0x1b')]=0x0;this[_0xbfe0('0x1c')]=_0x382f01[_0xbfe0('0x1c')];this['membername']=_0x382f01[_0xbfe0('0x1d')];this[_0xbfe0('0x1e')]=_0x382f01[_0xbfe0('0x1e')];this[_0xbfe0('0x1f')]=_0x14f00d[_0xbfe0('0x1f')];this[_0xbfe0('0x20')]=_0x14f00d[_0xbfe0('0x20')];this[_0xbfe0('0x21')]=_0x14f00d['callbackat'];this[_0xbfe0('0x22')]=_0x14f00d[_0xbfe0('0x22')];this[_0xbfe0('0x23')]=_0x14f00d['ContactId'];this[_0xbfe0('0x24')]=_0x14f00d[_0xbfe0('0x24')];this[_0xbfe0('0x25')]=_0x14f00d['UserId'];this[_0xbfe0('0x26')]=_0x14f00d[_0xbfe0('0x26')];this[_0xbfe0('0x27')]=_0x14f00d[_0xbfe0('0x27')];this['originatecalleridnum']=_0x14f00d[_0xbfe0('0x28')]||'';this[_0xbfe0('0x29')]=_0x14f00d[_0xbfe0('0x29')]||'';}module[_0xbfe0('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x4475=['uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry'];(function(_0x3ae28c,_0x27078e){var _0x3b079c=function(_0x27a524){while(--_0x27a524){_0x3ae28c['push'](_0x3ae28c['shift']());}};_0x3b079c(++_0x27078e);}(_0x4475,0x6c));var _0x5447=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4475[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x5447('0x0'));var _=require(_0x5447('0x1'));var moment=require(_0x5447('0x2'));function getSeconds(_0x509c5c,_0x2ea145){var _0x514373=moment(_0x509c5c)[_0x5447('0x3')](0x0);var _0xba6367=moment(_0x2ea145)['milliseconds'](0x0);return _0x514373['diff'](_0xba6367,_0x5447('0x4'));}function QueueCallerAbandon(_0x4b7d8e,_0x12200d){this[_0x5447('0x5')]=_0x4b7d8e[_0x5447('0x5')];this[_0x5447('0x6')]=_0x4b7d8e[_0x5447('0x6')];this[_0x5447('0x7')]=_0x4b7d8e['type']===_0x5447('0x8')?_0x5447('0x9'):_0x4b7d8e[_0x5447('0x6')];this[_0x5447('0xa')]=_0x4b7d8e['countbusyretry'];this[_0x5447('0xb')]=_0x4b7d8e[_0x5447('0xb')];this[_0x5447('0xc')]=_0x4b7d8e[_0x5447('0xc')];this[_0x5447('0xd')]=_0x4b7d8e[_0x5447('0xa')]+_0x4b7d8e[_0x5447('0xb')]+_0x4b7d8e[_0x5447('0xc')]+_0x4b7d8e[_0x5447('0xe')]+_0x4b7d8e[_0x5447('0xf')]+_0x4b7d8e['countabandonedretry']+_0x4b7d8e[_0x5447('0x10')]+_0x4b7d8e['countagentrejectretry'];this['countnosuchnumberretry']=_0x4b7d8e['countnosuchnumberretry'];this[_0x5447('0xf')]=_0x4b7d8e[_0x5447('0xf')];this['countabandonedretry']=_0x4b7d8e[_0x5447('0x11')];this[_0x5447('0x10')]=_0x4b7d8e[_0x5447('0x10')];this['countagentrejectretry']=_0x4b7d8e['countagentrejectretry'];this[_0x5447('0x12')]=_0x12200d[_0x5447('0x12')];this[_0x5447('0x13')]=_0x4b7d8e[_0x5447('0x14')];this['calleridnum']=_0x4b7d8e[_0x5447('0x15')];this[_0x5447('0x16')]=_0x4b7d8e[_0x5447('0x16')];this[_0x5447('0x17')]=_0x4b7d8e[_0x5447('0x17')];this[_0x5447('0x18')]=_0x4b7d8e[_0x5447('0x18')];this[_0x5447('0x19')]=this[_0x5447('0x18')];this['ringtime']=getSeconds(_0x4b7d8e[_0x5447('0x17')],_0x4b7d8e['starttime']);this[_0x5447('0x1a')]=getSeconds(this[_0x5447('0x18')],_0x4b7d8e[_0x5447('0x17')]);this[_0x5447('0x1b')]=0x0;this[_0x5447('0x9')]=_0x12200d[_0x5447('0x9')];this[_0x5447('0x1c')]=_0x12200d[_0x5447('0x1d')];this[_0x5447('0x1e')]=_0x12200d[_0x5447('0x1e')];this[_0x5447('0x1f')]=_0x4b7d8e[_0x5447('0x1f')];this[_0x5447('0x20')]=_0x4b7d8e[_0x5447('0x20')];this['callbackat']=_0x4b7d8e[_0x5447('0x21')];this[_0x5447('0x22')]=_0x4b7d8e[_0x5447('0x22')];this[_0x5447('0x23')]=_0x4b7d8e[_0x5447('0x23')];this[_0x5447('0x24')]=_0x4b7d8e[_0x5447('0x24')];this[_0x5447('0x25')]=_0x4b7d8e[_0x5447('0x25')];this[_0x5447('0x26')]=_0x4b7d8e['VoiceQueueId'];this[_0x5447('0x27')]=_0x4b7d8e[_0x5447('0x27')];this['originatecalleridnum']=_0x4b7d8e[_0x5447('0x28')]||'';this['originatecalleridname']=_0x4b7d8e['originatecalleridname']||'';}module[_0x5447('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 32b15fe..e7c404f 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(_0x38595f,_0x277fea){var _0x3f0c90=function(_0x34ea9d){while(--_0x34ea9d){_0x38595f['push'](_0x38595f['shift']());}};_0x3f0c90(++_0x277fea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x59a40b,_0x1fd7c0){var _0x593bc5=function(_0x34c8dd){while(--_0x34c8dd){_0x59a40b['push'](_0x59a40b['shift']());}};_0x593bc5(++_0x1fd7c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 f5ee742..1a67f4d 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 _0x4cac=['addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','faxAccounts','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','.pdf','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate'];(function(_0x4f7c6e,_0x122153){var _0x217e91=function(_0x4d88){while(--_0x4d88){_0x4f7c6e['push'](_0x4f7c6e['shift']());}};_0x217e91(++_0x122153);}(_0x4cac,0x16a));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xc4ca('0x0'));var _=require(_0xc4ca('0x1'));var BPromise=require(_0xc4ca('0x2'));var uuid=require('uuid');var moment=require(_0xc4ca('0x3'));var path=require(_0xc4ca('0x4'));var tiff2pdf=require(_0xc4ca('0x5'));var gs=require(_0xc4ca('0x6'));var logger=require('../../../config/logger')(_0xc4ca('0x7'));var ami=require(_0xc4ca('0x8'));var rpcDb=require(_0xc4ca('0x9'));var Channel=require(_0xc4ca('0xa'));var ut=require(_0xc4ca('0xb'));var Action=require(_0xc4ca('0xc'));var faxAccount=require(_0xc4ca('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xc4ca('0xe'));function Fax(_0x407b68){this[_0xc4ca('0xf')]={};this['faxAccounts']=_0x407b68['faxAccounts'];this[_0xc4ca('0x10')]=_0x407b68[_0xc4ca('0x10')];this[_0xc4ca('0x11')]={};ami['on'](_0xc4ca('0x12'),this[_0xc4ca('0x13')][_0xc4ca('0x14')](this));ami['on'](_0xc4ca('0x15'),this[_0xc4ca('0x16')][_0xc4ca('0x14')](this));ami['on'](_0xc4ca('0x17'),this['syncNewState'][_0xc4ca('0x14')](this));ami['on'](_0xc4ca('0x18'),this[_0xc4ca('0x19')][_0xc4ca('0x14')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0xc4ca('0x1a'),this[_0xc4ca('0x1b')][_0xc4ca('0x14')](this));ami['on'](_0xc4ca('0x1c'),this[_0xc4ca('0x1d')][_0xc4ca('0x14')](this));ami['on'](_0xc4ca('0x1e'),this[_0xc4ca('0x1f')][_0xc4ca('0x14')](this));}Fax[_0xc4ca('0x20')][_0xc4ca('0x13')]=function(_0x46aa48){if(_0x46aa48[_0xc4ca('0x21')]==='from-voip-provider'){for(var _0x2ff80d in this[_0xc4ca('0x22')]){if(this[_0xc4ca('0x22')][_0xc4ca('0x23')](_0x2ff80d)){if(_0x46aa48[_0xc4ca('0x24')]===this[_0xc4ca('0x22')][_0x2ff80d]['localstationid']){this[_0xc4ca('0xf')][_0x46aa48[_0xc4ca('0x25')]]={};this[_0xc4ca('0xf')][_0x46aa48[_0xc4ca('0x25')]][_0xc4ca('0x26')]=_0x46aa48[_0xc4ca('0x26')];this['channels'][_0x46aa48[_0xc4ca('0x25')]]['id']=this[_0xc4ca('0x22')][_0x2ff80d]['id'];this[_0xc4ca('0xf')][_0x46aa48[_0xc4ca('0x25')]][_0xc4ca('0x27')]=this[_0xc4ca('0x22')][_0x2ff80d][_0xc4ca('0x27')];logger[_0xc4ca('0x28')](_0x46aa48[_0xc4ca('0x25')],_0xc4ca('0x29'));}}}}if(this[_0xc4ca('0x11')][_0x46aa48[_0xc4ca('0x25')]]){this['channels'][_0x46aa48[_0xc4ca('0x25')]]={};this['channels'][_0x46aa48[_0xc4ca('0x25')]][_0xc4ca('0x26')]=_0x46aa48[_0xc4ca('0x26')];logger[_0xc4ca('0x28')](_0x46aa48[_0xc4ca('0x25')],_0xc4ca('0x29'));}};Fax[_0xc4ca('0x20')][_0xc4ca('0x16')]=function(_0x595803){if(this[_0xc4ca('0xf')][_0x595803[_0xc4ca('0x25')]]){for(var _0x2d88be in _0x595803[_0xc4ca('0x2a')]){if(_0x595803[_0xc4ca('0x2a')][_0xc4ca('0x23')](_0x2d88be)){this['channels'][_0x595803['uniqueid']][_0x2d88be]=_0x595803[_0xc4ca('0x2b')];}}}};Fax['prototype'][_0xc4ca('0x2c')]=function(_0x141cdf){if(this[_0xc4ca('0xf')][_0x141cdf[_0xc4ca('0x25')]]){this[_0xc4ca('0xf')][_0x141cdf[_0xc4ca('0x25')]][_0xc4ca('0x2d')]=_0x141cdf[_0xc4ca('0x2d')];this[_0xc4ca('0xf')][_0x141cdf[_0xc4ca('0x25')]][_0xc4ca('0x2e')]=_0x141cdf['channelstatedesc'];}};Fax['prototype'][_0xc4ca('0x19')]=function(_0x55da26){if(this['channels'][_0x55da26[_0xc4ca('0x25')]]){for(var _0xeab8c1 in _0x55da26[_0xc4ca('0x2a')]){if(_0x55da26[_0xc4ca('0x2a')][_0xc4ca('0x23')](_0xeab8c1)){this[_0xc4ca('0xf')][_0x55da26[_0xc4ca('0x25')]][_0xeab8c1]=_0x55da26['value'];}}}};Fax[_0xc4ca('0x20')][_0xc4ca('0x2f')]=function(_0x23fb38){if(this[_0xc4ca('0xf')][_0x23fb38['uniqueid']]){this[_0xc4ca('0xf')][_0x23fb38[_0xc4ca('0x25')]]['operation']=_0x23fb38[_0xc4ca('0x30')];this[_0xc4ca('0xf')][_0x23fb38[_0xc4ca('0x25')]][_0xc4ca('0x31')]=_0x23fb38[_0xc4ca('0x31')];this['channels'][_0x23fb38[_0xc4ca('0x25')]]['localstationid']=_0x23fb38[_0xc4ca('0x32')];this['channels'][_0x23fb38[_0xc4ca('0x25')]][_0xc4ca('0x33')]=_0x23fb38[_0xc4ca('0x33')];logger[_0xc4ca('0x28')](_0x23fb38[_0xc4ca('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0xc4ca('0x20')]['syncReceiveFax']=function(_0xdc32de){var _0x26ea74=this;if(this['channels'][_0xdc32de[_0xc4ca('0x25')]]){var _0x428c8e=this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]]['id'];this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]]['remotestationid']=_0xdc32de[_0xc4ca('0x34')];this[_0xc4ca('0xf')][_0xdc32de['uniqueid']][_0xc4ca('0x35')]=_0xdc32de[_0xc4ca('0x35')];this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]][_0xc4ca('0x32')]=_0xdc32de[_0xc4ca('0x32')];this[_0xc4ca('0xf')][_0xdc32de['uniqueid']][_0xc4ca('0x36')]=_0xdc32de[_0xc4ca('0x36')];this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]][_0xc4ca('0x37')]=_0xdc32de[_0xc4ca('0x37')];this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]]['filename']=_0xdc32de['filename'];this[_0xc4ca('0xf')][_0xdc32de['uniqueid']][_0xc4ca('0x38')]=_0xdc32de[_0xc4ca('0x38')];if(this[_0xc4ca('0xf')][_0xdc32de[_0xc4ca('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0xdc32de[_0xc4ca('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x5bc7c3){logger['info'](_0xdc32de[_0xc4ca('0x25')],'\x20result\x20conversion\x20file\x20',_0x5bc7c3[_0xc4ca('0x39')]);attachment[_0xc4ca('0x3a')]({'name':path['parse'](_0xdc32de[_0xc4ca('0x33')])[_0xc4ca('0x27')],'basename':path[_0xc4ca('0x3b')](_0xdc32de[_0xc4ca('0x33')])[_0xc4ca('0x27')]+_0xc4ca('0x3c'),'type':'application/pdf'})['then'](function(_0x5e513a){faxAccount['notify'](_0x428c8e,{'from':_0xdc32de[_0xc4ca('0x38')],'mapKey':_0xc4ca('0x7'),'body':path[_0xc4ca('0x3b')](_0xdc32de[_0xc4ca('0x33')])[_0xc4ca('0x27')]+'.pdf','AttachmentId':_0x5e513a['id']})['catch'](function(_0x58afc4){logger[_0xc4ca('0x3d')](_0xdc32de[_0xc4ca('0x25')],'\x20notify\x20',JSON[_0xc4ca('0x3e')](_0x58afc4));});})[_0xc4ca('0x3f')](function(_0x2dcafb){logger[_0xc4ca('0x3d')](_0xdc32de[_0xc4ca('0x25')],_0xc4ca('0x40'),JSON[_0xc4ca('0x3e')](_0x2dcafb));});});}logger[_0xc4ca('0x28')](_0xdc32de[_0xc4ca('0x25')],'\x20receiveFax\x20');}};Fax[_0xc4ca('0x20')][_0xc4ca('0x1f')]=function(_0x5cb008){if(this['actions'][_0x5cb008[_0xc4ca('0x25')]]){_[_0xc4ca('0x41')](this[_0xc4ca('0xf')][_0x5cb008[_0xc4ca('0x25')]],_[_0xc4ca('0x42')](_0x5cb008,[_0xc4ca('0x43'),_0xc4ca('0x44')]));}};function updateStatus(_0x30addf){if(_0x30addf[_0xc4ca('0x45')]){faxMessage['update'](_0x30addf[_0xc4ca('0x45')],{'failMessage':_0xc4ca('0x46')})[_0xc4ca('0x47')](function(_0x385a41){ut[_0xc4ca('0x48')](_0xc4ca('0x49'),_0x385a41);})[_0xc4ca('0x3f')](function(_0x25c50c){ut['logger'](_0xc4ca('0x4a'),_0x25c50c);});}else{ut['logger'](_0xc4ca('0x4b'));}}Fax[_0xc4ca('0x20')][_0xc4ca('0x4c')]=function(_0x37cb55,_0x578b04,_0x4412b0){var _0x2fbe0e=this;var _0x1b2863={};if(_0x578b04){_0x1b2863={'read':_0x578b04};}else{_0x1b2863={'failMessage':_0x4412b0};}if(this['actions'][_0x37cb55]['AttachmentId']){faxMessage[_0xc4ca('0x4d')](this[_0xc4ca('0x11')][_0x37cb55][_0xc4ca('0x45')],_0x1b2863)['then'](function(_0x578de3){ut[_0xc4ca('0x48')]('[Fax][Message][Updated]',_0x578de3);})[_0xc4ca('0x3f')](function(_0x2d1045){ut[_0xc4ca('0x48')]('[Fax][Message][NoUpdate1]',_0x2d1045);})[_0xc4ca('0x4e')](function(){delete _0x2fbe0e[_0xc4ca('0xf')][_0x37cb55];delete _0x2fbe0e[_0xc4ca('0x11')][_0x37cb55];});}else{ut[_0xc4ca('0x48')](_0xc4ca('0x4f'));delete this['channels'][_0x37cb55];delete this[_0xc4ca('0x11')][_0x37cb55];}};Fax[_0xc4ca('0x20')][_0xc4ca('0x1d')]=function(_0x3ea5c7){var _0x3a331c=this;if(this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]]){if(this[_0xc4ca('0x11')][_0x3ea5c7[_0xc4ca('0x25')]]){this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]]['id']=this['actions'][_0x3ea5c7[_0xc4ca('0x25')]]['id'];this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]][_0xc4ca('0x27')]=this[_0xc4ca('0x11')][_0x3ea5c7[_0xc4ca('0x25')]][_0xc4ca('0x27')];}logger[_0xc4ca('0x28')](_0x3ea5c7['uniqueid'],this['actions'][_0x3ea5c7[_0xc4ca('0x25')]]?_0xc4ca('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0xc4ca('0x3e')](this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]]));if(this[_0xc4ca('0x11')][_0x3ea5c7[_0xc4ca('0x25')]]){if(this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]]['faxpages']>0x0&&this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]][_0xc4ca('0x51')]==='SUCCESS'){this['updateStatus'](_0x3ea5c7[_0xc4ca('0x25')],!![]);}else{this[_0xc4ca('0x4c')](_0x3ea5c7['uniqueid'],![],this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]][_0xc4ca('0x52')]?_0xc4ca('0x53')+this[_0xc4ca('0xf')][_0x3ea5c7[_0xc4ca('0x25')]][_0xc4ca('0x52')]:_0xc4ca('0x54'));}}}};Fax['prototype'][_0xc4ca('0x55')]=function(_0x5bfa44){var _0x1714a1=this;return new BPromise(function(_0x29b9d2,_0x5b146a){_0x1714a1['execOriginate'](_0x5bfa44,_0x1714a1[_0xc4ca('0x22')][_0x5bfa44['FaxAccountId']])[_0xc4ca('0x47')](function(_0x31a5ab){ut[_0xc4ca('0x48')]('[Fax][execOriginate][success]',_0x31a5ab);_0x29b9d2(ut[_0xc4ca('0x39')](_0xc4ca('0x56')));})[_0xc4ca('0x3f')](function(_0x289945){ut[_0xc4ca('0x48')](_0xc4ca('0x57'),_0x289945);updateStatus(_0x5bfa44);_0x5b146a(ut[_0xc4ca('0x39')](_0xc4ca('0x58')));});});};Fax[_0xc4ca('0x20')]['checkAfterSend']=function(_0x5c0cfe){var _0x358ded=this;return new BPromise(function(_0x353c83,_0x37521a){var _0x4d3edf=_0x358ded['checkTrunk'](_0x358ded[_0xc4ca('0x22')][_0x5c0cfe['FaxAccountId']][_0xc4ca('0x59')],_0x5c0cfe);if(_0x4d3edf[_0xc4ca('0x5a')]){_0x353c83(ut[_0xc4ca('0x39')](_0xc4ca('0x5b')));}else{_0x37521a(ut['message'](_0x4d3edf[_0xc4ca('0x39')]));}});};function originate(_0x114cd1,_0x282377,_0x3b18bb){return new BPromise(function(_0x3e95e4,_0xa0112b){if(_0x3b18bb){var _0x3c648b=util['format'](_0xc4ca('0x5c'),path[_0xc4ca('0x3b')](_0x114cd1['path'])[_0xc4ca('0x27')],_0x114cd1['path']);gs[_0xc4ca('0x5d')](_0x3c648b)['then'](function(){_0x114cd1[_0xc4ca('0x4')]=util[_0xc4ca('0x5e')](_0xc4ca('0x5f'),path[_0xc4ca('0x3b')](_0x114cd1['path'])[_0xc4ca('0x60')],path[_0xc4ca('0x3b')](_0x114cd1[_0xc4ca('0x4')])[_0xc4ca('0x27')]);_0x282377[_0xc4ca('0x61')]=_0x114cd1[_0xc4ca('0x4')];ut[_0xc4ca('0x48')](_0xc4ca('0x62'),'');ami[_0xc4ca('0x63')](ut[_0xc4ca('0x64')](_0x114cd1,_0x282377))[_0xc4ca('0x47')](function(_0x56dd6c){_0x3e95e4(_0x56dd6c);})[_0xc4ca('0x3f')](function(_0x438f2b){_0xa0112b(_0x438f2b);});})[_0xc4ca('0x3f')](function(_0x3bc13b){_0xa0112b(_0x3bc13b);});}else{ami[_0xc4ca('0x63')](ut[_0xc4ca('0x64')](_0x114cd1,_0x282377))[_0xc4ca('0x47')](function(_0x3a0e84){_0x3e95e4(_0x3a0e84);})[_0xc4ca('0x3f')](function(_0xfca010){_0xa0112b(_0xfca010);});}});}Fax[_0xc4ca('0x20')][_0xc4ca('0x65')]=function(_0x2da50b,_0x2d3e79){var _0x454a7b=this;return new BPromise(function(_0x2c74fb,_0x487a98){var _0x1129f3=uuid['v4']();var _0x2edf40=ut[_0xc4ca('0x66')](_0x2da50b,_0x2d3e79);_0x454a7b[_0xc4ca('0x11')][_0x1129f3]=new Action(_0x1129f3,_0x2d3e79,_0x2da50b);var _0x2a6e36=_0x454a7b['actions'][_0x1129f3];if(path[_0xc4ca('0x3b')](_0x2da50b[_0xc4ca('0x4')])[_0xc4ca('0x67')]===_0xc4ca('0x3c')){originate(_0x2a6e36,_0x2edf40,!![])['then'](function(_0x30af2d){_0x2c74fb(_0x30af2d);})[_0xc4ca('0x3f')](function(_0x3a1778){_0x487a98(_0x3a1778);});}else{originate(_0x2a6e36,_0x2edf40,![])[_0xc4ca('0x47')](function(_0x3174cb){_0x2c74fb(_0x3174cb);})['catch'](function(_0x34f921){_0x487a98(_0x34f921);});}});};Fax[_0xc4ca('0x20')][_0xc4ca('0x68')]=function(_0x2c7061){return!_[_0xc4ca('0x69')](_0x2c7061)&&!_[_0xc4ca('0x69')](_0x2c7061[_0xc4ca('0x27')])&&!_[_0xc4ca('0x69')](_0x2c7061[_0xc4ca('0x6a')])&&_0x2c7061[_0xc4ca('0x6a')]&&!_[_0xc4ca('0x69')](this['trunks'][util[_0xc4ca('0x5e')]('SIP/%s',_0x2c7061[_0xc4ca('0x27')])])&&!_[_0xc4ca('0x69')](this['trunks'][util['format'](_0xc4ca('0x6b'),_0x2c7061[_0xc4ca('0x27')])]['status'])&&(this[_0xc4ca('0x10')][util['format'](_0xc4ca('0x6b'),_0x2c7061[_0xc4ca('0x27')])]['status']==='reachable'||this[_0xc4ca('0x10')][util[_0xc4ca('0x5e')]('SIP/%s',_0x2c7061[_0xc4ca('0x27')])]['status']==='unmonitored');};Fax[_0xc4ca('0x20')][_0xc4ca('0x6c')]=function(_0xd1af21,_0x2db37f){if(!this[_0xc4ca('0x68')](_0xd1af21)){ut[_0xc4ca('0x48')](_0xc4ca('0x6d'),_[_0xc4ca('0x69')](_0xd1af21)?'':_0xd1af21[_0xc4ca('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xc4ca('0x6e')};}if(_[_0xc4ca('0x69')](_0x2db37f[_0xc4ca('0x7')])){ut[_0xc4ca('0x48')](_0xc4ca('0x6f'),JSON[_0xc4ca('0x3e')](_0x2db37f));return{'isValid':![],'message':_0xc4ca('0x70')};}if(_[_0xc4ca('0x69')](_0x2db37f[_0xc4ca('0x4')])){ut[_0xc4ca('0x48')](_0xc4ca('0x71'),JSON['stringify'](_0x2db37f));return{'isValid':![],'message':_0xc4ca('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xc4ca('0x73')]=Fax; \ No newline at end of file +var _0x1d0d=['ext','isTrunkReachable','active','SIP/%s','isNil','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','localstationid','info','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','resolution','transferrate','filename','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','application/pdf','then','notify','fax','.pdf','\x20notify\x20','catch','error','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables'];(function(_0x5f1c8c,_0x4d66e9){var _0x499b8a=function(_0x1b8610){while(--_0x1b8610){_0x5f1c8c['push'](_0x5f1c8c['shift']());}};_0x499b8a(++_0x4d66e9);}(_0x1d0d,0x8e));var _0xd1d0=function(_0x24122c,_0x5a6b1e){_0x24122c=_0x24122c-0x0;var _0x3acdf7=_0x1d0d[_0x24122c];return _0x3acdf7;};'use strict';var util=require('util');var _=require(_0xd1d0('0x0'));var BPromise=require(_0xd1d0('0x1'));var uuid=require('uuid');var moment=require(_0xd1d0('0x2'));var path=require(_0xd1d0('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xd1d0('0x4'))('fax');var ami=require(_0xd1d0('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0xd1d0('0x6'));var ut=require(_0xd1d0('0x7'));var Action=require(_0xd1d0('0x8'));var faxAccount=require(_0xd1d0('0x9'));var attachment=require(_0xd1d0('0xa'));var faxMessage=require(_0xd1d0('0xb'));function Fax(_0x2fa04f){this[_0xd1d0('0xc')]={};this['faxAccounts']=_0x2fa04f[_0xd1d0('0xd')];this[_0xd1d0('0xe')]=_0x2fa04f[_0xd1d0('0xe')];this[_0xd1d0('0xf')]={};ami['on'](_0xd1d0('0x10'),this[_0xd1d0('0x11')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x13'),this[_0xd1d0('0x14')]['bind'](this));ami['on']('newstate',this[_0xd1d0('0x15')]['bind'](this));ami['on'](_0xd1d0('0x16'),this[_0xd1d0('0x17')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x18'),this[_0xd1d0('0x19')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x1a'),this['syncReceiveFax'][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x1b'),this['syncHangup'][_0xd1d0('0x12')](this));ami['on']('originateresponse',this[_0xd1d0('0x1c')]['bind'](this));}Fax[_0xd1d0('0x1d')][_0xd1d0('0x11')]=function(_0xd5f6a5){if(_0xd5f6a5[_0xd1d0('0x1e')]===_0xd1d0('0x1f')){for(var _0x502eed in this[_0xd1d0('0xd')]){if(this[_0xd1d0('0xd')][_0xd1d0('0x20')](_0x502eed)){if(_0xd5f6a5[_0xd1d0('0x21')]===this[_0xd1d0('0xd')][_0x502eed]['localstationid']){this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]={};this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]][_0xd1d0('0x23')]=_0xd5f6a5[_0xd1d0('0x23')];this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]['id']=this[_0xd1d0('0xd')][_0x502eed]['id'];this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]['name']=this[_0xd1d0('0xd')][_0x502eed]['name'];logger['info'](_0xd5f6a5[_0xd1d0('0x22')],_0xd1d0('0x24'));}}}}if(this[_0xd1d0('0xf')][_0xd5f6a5[_0xd1d0('0x22')]]){this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]={};this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]][_0xd1d0('0x23')]=_0xd5f6a5[_0xd1d0('0x23')];logger['info'](_0xd5f6a5[_0xd1d0('0x22')],_0xd1d0('0x24'));}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x14')]=function(_0x48401e){if(this[_0xd1d0('0xc')][_0x48401e[_0xd1d0('0x22')]]){for(var _0x4787f7 in _0x48401e[_0xd1d0('0x25')]){if(_0x48401e[_0xd1d0('0x25')][_0xd1d0('0x20')](_0x4787f7)){this['channels'][_0x48401e[_0xd1d0('0x22')]][_0x4787f7]=_0x48401e['value'];}}}};Fax['prototype'][_0xd1d0('0x15')]=function(_0x57703e){if(this[_0xd1d0('0xc')][_0x57703e['uniqueid']]){this[_0xd1d0('0xc')][_0x57703e['uniqueid']][_0xd1d0('0x26')]=_0x57703e[_0xd1d0('0x26')];this[_0xd1d0('0xc')][_0x57703e[_0xd1d0('0x22')]][_0xd1d0('0x27')]=_0x57703e['channelstatedesc'];}};Fax['prototype'][_0xd1d0('0x17')]=function(_0x1744c1){if(this[_0xd1d0('0xc')][_0x1744c1[_0xd1d0('0x22')]]){for(var _0x1f60d3 in _0x1744c1[_0xd1d0('0x25')]){if(_0x1744c1['variable'][_0xd1d0('0x20')](_0x1f60d3)){this[_0xd1d0('0xc')][_0x1744c1[_0xd1d0('0x22')]][_0x1f60d3]=_0x1744c1[_0xd1d0('0x28')];}}}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x19')]=function(_0x543e9e){if(this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]]){this['channels'][_0x543e9e[_0xd1d0('0x22')]][_0xd1d0('0x29')]=_0x543e9e['operation'];this[_0xd1d0('0xc')][_0x543e9e['uniqueid']][_0xd1d0('0x2a')]=_0x543e9e[_0xd1d0('0x2a')];this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]][_0xd1d0('0x2b')]=_0x543e9e['localstationid'];this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]]['filename']=_0x543e9e['filename'];logger[_0xd1d0('0x2c')](_0x543e9e['uniqueid'],_0xd1d0('0x2d'));}};Fax['prototype'][_0xd1d0('0x2e')]=function(_0x5d05aa){var _0x2bbcea=this;if(this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]){var _0x11f203=this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['id'];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]][_0xd1d0('0x2f')]=_0x5d05aa[_0xd1d0('0x2f')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['pagestransferred']=_0x5d05aa['pagestransferred'];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['localstationid']=_0x5d05aa[_0xd1d0('0x2b')];this['channels'][_0x5d05aa[_0xd1d0('0x22')]]['resolution']=_0x5d05aa[_0xd1d0('0x30')];this[_0xd1d0('0xc')][_0x5d05aa['uniqueid']][_0xd1d0('0x31')]=_0x5d05aa[_0xd1d0('0x31')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]][_0xd1d0('0x32')]=_0x5d05aa[_0xd1d0('0x32')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['calleridnum']=_0x5d05aa[_0xd1d0('0x33')];if(this['channels'][_0x5d05aa['uniqueid']][_0xd1d0('0x34')]>0x0){tiff2pdf(_0x5d05aa[_0xd1d0('0x32')],_0xd1d0('0x35'),function(_0x4e5a97){logger[_0xd1d0('0x2c')](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x36'),_0x4e5a97[_0xd1d0('0x37')]);attachment[_0xd1d0('0x38')]({'name':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])[_0xd1d0('0x3a')],'basename':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])['name']+'.pdf','type':_0xd1d0('0x3b')})[_0xd1d0('0x3c')](function(_0x4dfdc5){faxAccount[_0xd1d0('0x3d')](_0x11f203,{'from':_0x5d05aa['calleridnum'],'mapKey':_0xd1d0('0x3e'),'body':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])[_0xd1d0('0x3a')]+_0xd1d0('0x3f'),'AttachmentId':_0x4dfdc5['id']})['catch'](function(_0x128288){logger['error'](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x40'),JSON['stringify'](_0x128288));});})[_0xd1d0('0x41')](function(_0x3d6348){logger[_0xd1d0('0x42')](_0x5d05aa['uniqueid'],_0xd1d0('0x43'),JSON['stringify'](_0x3d6348));});});}logger[_0xd1d0('0x2c')](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x43'));}};Fax['prototype'][_0xd1d0('0x1c')]=function(_0x368e30){if(this[_0xd1d0('0xf')][_0x368e30[_0xd1d0('0x22')]]){_[_0xd1d0('0x44')](this[_0xd1d0('0xc')][_0x368e30[_0xd1d0('0x22')]],_[_0xd1d0('0x45')](_0x368e30,[_0xd1d0('0x46'),'reason']));}};function updateStatus(_0x36bafe){if(_0x36bafe[_0xd1d0('0x47')]){faxMessage[_0xd1d0('0x48')](_0x36bafe[_0xd1d0('0x47')],{'failMessage':_0xd1d0('0x49')})[_0xd1d0('0x3c')](function(_0x47c507){ut[_0xd1d0('0x4a')](_0xd1d0('0x4b'),_0x47c507);})[_0xd1d0('0x41')](function(_0x54b051){ut[_0xd1d0('0x4a')](_0xd1d0('0x4c'),_0x54b051);});}else{ut[_0xd1d0('0x4a')](_0xd1d0('0x4d'));}}Fax[_0xd1d0('0x1d')][_0xd1d0('0x4e')]=function(_0x4e466e,_0x3ce514,_0x48e682){var _0x53447f=this;var _0xfac809={};if(_0x3ce514){_0xfac809={'read':_0x3ce514};}else{_0xfac809={'failMessage':_0x48e682};}if(this[_0xd1d0('0xf')][_0x4e466e][_0xd1d0('0x47')]){faxMessage['update'](this['actions'][_0x4e466e][_0xd1d0('0x47')],_0xfac809)['then'](function(_0x21a5af){ut[_0xd1d0('0x4a')](_0xd1d0('0x4f'),_0x21a5af);})[_0xd1d0('0x41')](function(_0x50570e){ut['logger'](_0xd1d0('0x50'),_0x50570e);})[_0xd1d0('0x51')](function(){delete _0x53447f[_0xd1d0('0xc')][_0x4e466e];delete _0x53447f[_0xd1d0('0xf')][_0x4e466e];});}else{ut[_0xd1d0('0x4a')](_0xd1d0('0x52'));delete this['channels'][_0x4e466e];delete this[_0xd1d0('0xf')][_0x4e466e];}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x53')]=function(_0xed88bb){var _0x2c2dd5=this;if(this['channels'][_0xed88bb['uniqueid']]){if(this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]){this[_0xd1d0('0xc')][_0xed88bb['uniqueid']]['id']=this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]['id'];this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x3a')]=this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]['name'];}logger[_0xd1d0('0x2c')](_0xed88bb[_0xd1d0('0x22')],this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]?_0xd1d0('0x54'):_0xd1d0('0x55'),JSON[_0xd1d0('0x56')](this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]]));if(this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]){if(this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x57')]>0x0&&this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x18')]===_0xd1d0('0x58')){this[_0xd1d0('0x4e')](_0xed88bb[_0xd1d0('0x22')],!![]);}else{this[_0xd1d0('0x4e')](_0xed88bb[_0xd1d0('0x22')],![],this[_0xd1d0('0xc')][_0xed88bb['uniqueid']][_0xd1d0('0x59')]?_0xd1d0('0x5a')+this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x59')]:_0xd1d0('0x5b'));}}}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x5c')]=function(_0x3bc488){var _0xcd26ac=this;return new BPromise(function(_0x328881,_0x54e62a){_0xcd26ac[_0xd1d0('0x5d')](_0x3bc488,_0xcd26ac[_0xd1d0('0xd')][_0x3bc488['FaxAccountId']])[_0xd1d0('0x3c')](function(_0x236396){ut[_0xd1d0('0x4a')](_0xd1d0('0x5e'),_0x236396);_0x328881(ut[_0xd1d0('0x37')](_0xd1d0('0x5f')));})[_0xd1d0('0x41')](function(_0x2ee0d6){ut[_0xd1d0('0x4a')](_0xd1d0('0x60'),_0x2ee0d6);updateStatus(_0x3bc488);_0x54e62a(ut[_0xd1d0('0x37')](_0xd1d0('0x61')));});});};Fax[_0xd1d0('0x1d')][_0xd1d0('0x62')]=function(_0xe202ff){var _0x32df24=this;return new BPromise(function(_0x147732,_0xebef88){var _0x3a958c=_0x32df24['checkTrunk'](_0x32df24[_0xd1d0('0xd')][_0xe202ff[_0xd1d0('0x63')]]['Trunk'],_0xe202ff);if(_0x3a958c['isValid']){_0x147732(ut['message'](_0xd1d0('0x64')));}else{_0xebef88(ut['message'](_0x3a958c[_0xd1d0('0x37')]));}});};function originate(_0x2d185f,_0x213b83,_0x36139b){return new BPromise(function(_0x29e301,_0x660c8f){if(_0x36139b){var _0xf0ffb3=util[_0xd1d0('0x65')]('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['parse'](_0x2d185f['path'])[_0xd1d0('0x3a')],_0x2d185f['path']);gs[_0xd1d0('0x66')](_0xf0ffb3)['then'](function(){_0x2d185f['path']=util['format'](_0xd1d0('0x67'),path[_0xd1d0('0x39')](_0x2d185f[_0xd1d0('0x3')])[_0xd1d0('0x68')],path[_0xd1d0('0x39')](_0x2d185f[_0xd1d0('0x3')])['name']);_0x213b83[_0xd1d0('0x69')]=_0x2d185f[_0xd1d0('0x3')];ut[_0xd1d0('0x4a')](_0xd1d0('0x6a'),'');ami[_0xd1d0('0x6b')](ut[_0xd1d0('0x6c')](_0x2d185f,_0x213b83))['then'](function(_0x5ec832){_0x29e301(_0x5ec832);})[_0xd1d0('0x41')](function(_0x1316e0){_0x660c8f(_0x1316e0);});})[_0xd1d0('0x41')](function(_0x4b97c8){_0x660c8f(_0x4b97c8);});}else{ami['Action'](ut['variablesAction'](_0x2d185f,_0x213b83))[_0xd1d0('0x3c')](function(_0x123424){_0x29e301(_0x123424);})[_0xd1d0('0x41')](function(_0x149e92){_0x660c8f(_0x149e92);});}});}Fax[_0xd1d0('0x1d')][_0xd1d0('0x5d')]=function(_0x547a2e,_0xb1a8d3){var _0xca8d60=this;return new BPromise(function(_0x413460,_0x1c78a1){var _0x540453=uuid['v4']();var _0x418a7e=ut[_0xd1d0('0x6d')](_0x547a2e,_0xb1a8d3);_0xca8d60[_0xd1d0('0xf')][_0x540453]=new Action(_0x540453,_0xb1a8d3,_0x547a2e);var _0x511eb9=_0xca8d60[_0xd1d0('0xf')][_0x540453];if(path[_0xd1d0('0x39')](_0x547a2e[_0xd1d0('0x3')])[_0xd1d0('0x6e')]===_0xd1d0('0x3f')){originate(_0x511eb9,_0x418a7e,!![])['then'](function(_0x1bb69e){_0x413460(_0x1bb69e);})['catch'](function(_0x5d6ddc){_0x1c78a1(_0x5d6ddc);});}else{originate(_0x511eb9,_0x418a7e,![])[_0xd1d0('0x3c')](function(_0x290b55){_0x413460(_0x290b55);})[_0xd1d0('0x41')](function(_0x4a80e9){_0x1c78a1(_0x4a80e9);});}});};Fax[_0xd1d0('0x1d')][_0xd1d0('0x6f')]=function(_0x16fb6f){return!_['isNil'](_0x16fb6f)&&!_['isNil'](_0x16fb6f[_0xd1d0('0x3a')])&&!_['isNil'](_0x16fb6f['active'])&&_0x16fb6f[_0xd1d0('0x70')]&&!_['isNil'](this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])])&&!_[_0xd1d0('0x72')](this['trunks'][util[_0xd1d0('0x65')]('SIP/%s',_0x16fb6f[_0xd1d0('0x3a')])]['status'])&&(this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])][_0xd1d0('0x2a')]===_0xd1d0('0x73')||this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])][_0xd1d0('0x2a')]===_0xd1d0('0x74'));};Fax[_0xd1d0('0x1d')][_0xd1d0('0x75')]=function(_0x12e801,_0x2091c2){if(!this['isTrunkReachable'](_0x12e801)){ut[_0xd1d0('0x4a')](_0xd1d0('0x76'),_['isNil'](_0x12e801)?'':_0x12e801[_0xd1d0('0x3a')]+_0xd1d0('0x77'));return{'isValid':![],'message':_0xd1d0('0x78')};}if(_[_0xd1d0('0x72')](_0x2091c2[_0xd1d0('0x3e')])){ut['logger'](_0xd1d0('0x79'),JSON[_0xd1d0('0x56')](_0x2091c2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xd1d0('0x72')](_0x2091c2['path'])){ut[_0xd1d0('0x4a')](_0xd1d0('0x7a'),JSON['stringify'](_0x2091c2));return{'isValid':![],'message':_0xd1d0('0x7b')};}return{'isValid':!![],'message':_0xd1d0('0x7c')};};module[_0xd1d0('0x7d')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 450fc00..36b0a91 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 _0x8a4b=['../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20','bluebird','preview','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a4b,0x93));var _0xb8a4=function(_0x54e82e,_0x5ab810){_0x54e82e=_0x54e82e-0x0;var _0x763e1c=_0x8a4b[_0x54e82e];return _0x763e1c;};'use strict';var util=require('util');var BPromise=require(_0xb8a4('0x0'));var logger=require('../../../config/logger')(_0xb8a4('0x1'));var _=require(_0xb8a4('0x2'));var faxAccount=require(_0xb8a4('0x3'));function loggerCatch(_0x2cdac0){return function(_0x3ff0f4){logger[_0xb8a4('0x4')](_0x2cdac0,util[_0xb8a4('0x5')](_0x3ff0f4,{'showHidden':![],'depth':null}));};}exports[_0xb8a4('0x6')]=function(_0xbb86a5,_0x2abdc3){return BPromise[_0xb8a4('0x7')]()['then'](faxAccount['notify'](_0xbb86a5,_0x2abdc3))[_0xb8a4('0x8')](loggerCatch(_0xb8a4('0x9')));}; \ No newline at end of file +var _0x9a9b=['preview','../rpc/faxAccount','error','inspect','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x27250c,_0x3e6637){var _0x7e3095=function(_0x1bbce7){while(--_0x1bbce7){_0x27250c['push'](_0x27250c['shift']());}};_0x7e3095(++_0x3e6637);}(_0x9a9b,0x184));var _0xb9a9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x9a9b[_0x2ae2ad];return _0x26dbd7;};'use strict';var util=require('util');var BPromise=require(_0xb9a9('0x0'));var logger=require(_0xb9a9('0x1'))(_0xb9a9('0x2'));var _=require('lodash');var faxAccount=require(_0xb9a9('0x3'));function loggerCatch(_0x2a4b2c){return function(_0x4ab825){logger[_0xb9a9('0x4')](_0x2a4b2c,util[_0xb9a9('0x5')](_0x4ab825,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x20a232,_0x53a122){return BPromise[_0xb9a9('0x6')]()[_0xb9a9('0x7')](faxAccount['notify'](_0x20a232,_0x53a122))[_0xb9a9('0x8')](loggerCatch(_0xb9a9('0x9')));}; \ 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 7cf8ec4..53f7eba 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 _0xead0=['fax','child_process','execute','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xead0,0x102));var _0x0ead=function(_0x899a7b,_0x47f3fe){_0x899a7b=_0x899a7b-0x0;var _0x501574=_0xead0[_0x899a7b];return _0x501574;};'use strict';var util=require('util');var logger=require(_0x0ead('0x0'))(_0x0ead('0x1'));var BPromise=require('bluebird');var exec=require(_0x0ead('0x2'))['exec'];exports[_0x0ead('0x3')]=function(_0x58e4f0){return new BPromise(function(_0x7813ce,_0x185d07){exec(_0x58e4f0,function(_0xbc9567,_0x3c2208,_0x41ffeb){logger['info'](_0x0ead('0x4'),_0x3c2208);if(_0xbc9567){logger['info'](_0x0ead('0x4'),_0x0ead('0x5'),util[_0x0ead('0x6')](_0xbc9567,{'showHidden':![],'depth':null}),_0x3c2208,_0x41ffeb);_0x185d07(_0xbc9567);}_0x7813ce(_0x3c2208);});});}; \ No newline at end of file +var _0x3ef7=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x3ef7,0x159));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x73ef('0x0'));var logger=require(_0x73ef('0x1'))(_0x73ef('0x2'));var BPromise=require(_0x73ef('0x3'));var exec=require(_0x73ef('0x4'))[_0x73ef('0x5')];exports[_0x73ef('0x6')]=function(_0x28ab64){return new BPromise(function(_0x105e14,_0x457cf6){exec(_0x28ab64,function(_0x28aae0,_0x49403a,_0x17a8ae){logger[_0x73ef('0x7')](_0x73ef('0x8'),_0x49403a);if(_0x28aae0){logger[_0x73ef('0x7')](_0x73ef('0x8'),_0x73ef('0x9'),util[_0x73ef('0xa')](_0x28aae0,{'showHidden':![],'depth':null}),_0x49403a,_0x17a8ae);_0x457cf6(_0x28aae0);}_0x105e14(_0x49403a);});});}; \ 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 4d1941c..249d80f 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 _0x2b1e=['originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','message','info','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid'];(function(_0x2d6fa0,_0x1307de){var _0x2c6bdd=function(_0x33c62c){while(--_0x33c62c){_0x2d6fa0['push'](_0x2d6fa0['shift']());}};_0x2c6bdd(++_0x1307de);}(_0x2b1e,0x10c));var _0xe2b1=function(_0x28f236,_0x5e0380){_0x28f236=_0x28f236-0x0;var _0x682cde=_0x2b1e[_0x28f236];return _0x682cde;};'use strict';var util=require(_0xe2b1('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')('fax');exports[_0xe2b1('0x1')]=function(_0x4f0f48){return{'message':_0x4f0f48};};exports['logger']=function(_0x299059,_0x5a2bc5){logger[_0xe2b1('0x2')](_0x299059,util['inspect'](_0x5a2bc5,{'showHidden':![],'depth':null}));};exports[_0xe2b1('0x3')]=function(_0x11c28b,_0x30cffa){var _0x49b312={'XMF-ECM':_0x30cffa[_0xe2b1('0x4')],'XMF-HEADERINFO':_0x30cffa[_0xe2b1('0x5')],'XMF-MINRATE':_0x30cffa[_0xe2b1('0x6')],'XMF-MAXRATE':_0x30cffa[_0xe2b1('0x7')],'XMF-MODEM':util[_0xe2b1('0x8')](_0xe2b1('0x9'),_0x30cffa[_0xe2b1('0xa')]),'XMF-GATEWAY':_0x30cffa[_0xe2b1('0xb')],'XMF-FAXDETECT':_0x30cffa[_0xe2b1('0xc')],'XMF-T38TIMEOUT':_0x30cffa[_0xe2b1('0xd')],'XMF-LOCALSTATIONID':_0x30cffa[_0xe2b1('0xe')],'XMF-PATH':_0x11c28b[_0xe2b1('0xf')]};return _0x49b312;};exports[_0xe2b1('0x10')]=function(_0x523767,_0x3d94fd){return{'actionid':_0x523767[_0xe2b1('0x11')],'action':_0xe2b1('0x12'),'channel':_0x523767[_0xe2b1('0x13')],'Exten':_0xe2b1('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0xe2b1('0x8')](_0xe2b1('0x15'),_0x523767['headerinfo']?_0x523767[_0xe2b1('0x5')]:'',_0x523767[_0xe2b1('0xe')]),'variable':_0x3d94fd,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x523767[_0xe2b1('0x11')]};}; \ No newline at end of file +var _0x4957=['gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','headerinfo','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','minrate','\x22%s\x22'];(function(_0x13a4f4,_0x4237c8){var _0x50fd03=function(_0x2da982){while(--_0x2da982){_0x13a4f4['push'](_0x13a4f4['shift']());}};_0x50fd03(++_0x4237c8);}(_0x4957,0x95));var _0x7495=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x4957[_0x500419];return _0x241c1a;};'use strict';var util=require('util');var _=require(_0x7495('0x0'));var moment=require(_0x7495('0x1'));var logger=require(_0x7495('0x2'))('fax');exports[_0x7495('0x3')]=function(_0x3de5e5){return{'message':_0x3de5e5};};exports[_0x7495('0x4')]=function(_0x5baf3c,_0x1f95bf){logger[_0x7495('0x5')](_0x5baf3c,util[_0x7495('0x6')](_0x1f95bf,{'showHidden':![],'depth':null}));};exports[_0x7495('0x7')]=function(_0x449775,_0x1385c0){var _0x3f0be9={'XMF-ECM':_0x1385c0[_0x7495('0x8')],'XMF-HEADERINFO':_0x1385c0['headerinfo'],'XMF-MINRATE':_0x1385c0[_0x7495('0x9')],'XMF-MAXRATE':_0x1385c0['maxrate'],'XMF-MODEM':util['format'](_0x7495('0xa'),_0x1385c0['modem']),'XMF-GATEWAY':_0x1385c0[_0x7495('0xb')],'XMF-FAXDETECT':_0x1385c0['faxdetect'],'XMF-T38TIMEOUT':_0x1385c0[_0x7495('0xc')],'XMF-LOCALSTATIONID':_0x1385c0[_0x7495('0xd')],'XMF-PATH':_0x449775[_0x7495('0xe')]};return _0x3f0be9;};exports[_0x7495('0xf')]=function(_0x140324,_0x3671f5){return{'actionid':_0x140324[_0x7495('0x10')],'action':_0x7495('0x11'),'channel':_0x140324[_0x7495('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x140324[_0x7495('0x13')]?_0x140324['headerinfo']:'',_0x140324[_0x7495('0xd')]),'variable':_0x3671f5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x140324[_0x7495('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f76a89b..51c83c8 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 _0xb758=['initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','listen','catch','[index.js][main]','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb758,0x137));var _0x8b75=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xb758[_0x4ff09b];return _0x3f5c2e;};'use strict';var BPromise=require(_0x8b75('0x0'));var util=require('util');var moment=require(_0x8b75('0x1'));var server=require(_0x8b75('0x2'));var Realtime=require(_0x8b75('0x3'));var Report=require(_0x8b75('0x4'));var Acw=require(_0x8b75('0x5'));var Trigger=require(_0x8b75('0x6'));var Dialer=require(_0x8b75('0x7'));var Preview=require(_0x8b75('0x8'));var Fax=require('./fax');var user=require(_0x8b75('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x8b75('0xa'));var voiceCallReport=require(_0x8b75('0xb'));var trunk=require(_0x8b75('0xc'));var trigger=require(_0x8b75('0xd'));var template=require(_0x8b75('0xe'));var cmHopperHistory=require(_0x8b75('0xf'));var campaign=require(_0x8b75('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x8b75('0x11'));var zendesk=require(_0x8b75('0x12'));var salesforce=require(_0x8b75('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8b75('0x14'));var zoho=require(_0x8b75('0x15'));var vtiger=require(_0x8b75('0x16'));var freshsales=require(_0x8b75('0x17'));var servicenow=require(_0x8b75('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x8b75('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8b75('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8b75('0x1a')](_0x8b75('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8b75('0x1c')]()['then'](user[_0x8b75('0x1d')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x1f')]())[_0x8b75('0x1e')](user[_0x8b75('0x20')]())['then'](realtime[_0x8b75('0x21')]())[_0x8b75('0x1e')](trunk[_0x8b75('0x22')]())['then'](realtime[_0x8b75('0x23')]())['then'](voiceQueue[_0x8b75('0x24')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x25')]())[_0x8b75('0x1e')](trigger['getTriggers']())[_0x8b75('0x1e')](realtime[_0x8b75('0x26')]())['then'](template[_0x8b75('0x27')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x28')]())[_0x8b75('0x1e')](zendesk['getZendeskAccounts']())[_0x8b75('0x1e')](realtime[_0x8b75('0x29')]())['then'](salesforce[_0x8b75('0x2a')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x2b')]())[_0x8b75('0x1e')](sugarcrm[_0x8b75('0x2c')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x2d')]())[_0x8b75('0x1e')](freshdesk[_0x8b75('0x2e')]())['then'](realtime[_0x8b75('0x2f')]())[_0x8b75('0x1e')](desk[_0x8b75('0x30')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x31')]())[_0x8b75('0x1e')](zoho[_0x8b75('0x32')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x33')]())[_0x8b75('0x1e')](vtiger[_0x8b75('0x34')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x35')]())[_0x8b75('0x1e')](freshsales[_0x8b75('0x36')]())['then'](realtime['initFreshsalesAccounts']())[_0x8b75('0x1e')](servicenow['getServicenowAccounts']())[_0x8b75('0x1e')](realtime[_0x8b75('0x37')]())[_0x8b75('0x1e')](dynamics365['getDynamics365Accounts']())[_0x8b75('0x1e')](realtime[_0x8b75('0x38')]())[_0x8b75('0x1e')](campaign['getCampaigns']())[_0x8b75('0x1e')](realtime[_0x8b75('0x39')]())['then'](voiceExtension[_0x8b75('0x3a')]())[_0x8b75('0x1e')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x8b75('0x3b')]())[_0x8b75('0x1e')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x8b75('0x1c')]()[_0x8b75('0x1e')](voiceQueueReport[_0x8b75('0x3c')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x3d')]())[_0x8b75('0x1e')](cmHopperHistory[_0x8b75('0x3e')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x3f')]())[_0x8b75('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0x8b75('0x1e')](realtime[_0x8b75('0x40')]())['then'](voiceCallReport[_0x8b75('0x41')]())[_0x8b75('0x1e')](realtime[_0x8b75('0x42')]())['catch'](function(_0x507dd5){logger[_0x8b75('0x43')]('[index.js][initParams]',util[_0x8b75('0x44')](_0x507dd5,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8b75('0x45')](realtime,preview,fax)[_0x8b75('0x1e')](function(_0x583be5){return initRealtime();})[_0x8b75('0x1e')](function(){return initParams();})[_0x8b75('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8b75('0x46')](function(_0x248c84){logger[_0x8b75('0x43')](_0x8b75('0x47'),util['inspect'](_0x248c84,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x69d1=['resolve','then','getAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','catch','[index.js][main]','inspect','bluebird','moment','./realtime','./report','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69d1,0x1b5));var _0x169d=function(_0x34226f,_0x1cd113){_0x34226f=_0x34226f-0x0;var _0x1bf7dc=_0x69d1[_0x34226f];return _0x1bf7dc;};'use strict';var BPromise=require(_0x169d('0x0'));var util=require('util');var moment=require(_0x169d('0x1'));var server=require('./server');var Realtime=require(_0x169d('0x2'));var Report=require(_0x169d('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x169d('0x4'));var Fax=require('./fax');var user=require(_0x169d('0x5'));var voiceQueue=require(_0x169d('0x6'));var voiceQueueReport=require(_0x169d('0x7'));var voiceCallReport=require(_0x169d('0x8'));var trunk=require(_0x169d('0x9'));var trigger=require(_0x169d('0xa'));var template=require(_0x169d('0xb'));var cmHopperHistory=require(_0x169d('0xc'));var campaign=require(_0x169d('0xd'));var voiceExtension=require(_0x169d('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x169d('0xf'));var salesforce=require(_0x169d('0x10'));var sugarcrm=require(_0x169d('0x11'));var freshdesk=require(_0x169d('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x169d('0x13'));var freshsales=require(_0x169d('0x14'));var servicenow=require(_0x169d('0x15'));var dynamics365=require(_0x169d('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x169d('0x17')](_0x169d('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x169d('0x17')](_0x169d('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x169d('0x19')]()[_0x169d('0x1a')](user[_0x169d('0x1b')]())[_0x169d('0x1a')](realtime['initAgents']())[_0x169d('0x1a')](user[_0x169d('0x1c')]())[_0x169d('0x1a')](realtime[_0x169d('0x1d')]())['then'](trunk[_0x169d('0x1e')]())[_0x169d('0x1a')](realtime['initTrunks']())[_0x169d('0x1a')](voiceQueue[_0x169d('0x1f')]())[_0x169d('0x1a')](realtime[_0x169d('0x20')]())[_0x169d('0x1a')](trigger[_0x169d('0x21')]())[_0x169d('0x1a')](realtime[_0x169d('0x22')]())[_0x169d('0x1a')](template['getTemplates']())[_0x169d('0x1a')](realtime[_0x169d('0x23')]())[_0x169d('0x1a')](zendesk[_0x169d('0x24')]())[_0x169d('0x1a')](realtime['initZendeskAccounts']())[_0x169d('0x1a')](salesforce[_0x169d('0x25')]())[_0x169d('0x1a')](realtime['initSalesforceAccounts']())[_0x169d('0x1a')](sugarcrm[_0x169d('0x26')]())[_0x169d('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x169d('0x1a')](realtime[_0x169d('0x27')]())[_0x169d('0x1a')](desk['getDeskAccounts']())[_0x169d('0x1a')](realtime[_0x169d('0x28')]())['then'](zoho[_0x169d('0x29')]())[_0x169d('0x1a')](realtime[_0x169d('0x2a')]())[_0x169d('0x1a')](vtiger[_0x169d('0x2b')]())[_0x169d('0x1a')](realtime[_0x169d('0x2c')]())[_0x169d('0x1a')](freshsales[_0x169d('0x2d')]())[_0x169d('0x1a')](realtime['initFreshsalesAccounts']())[_0x169d('0x1a')](servicenow[_0x169d('0x2e')]())['then'](realtime['initServicenowAccounts']())[_0x169d('0x1a')](dynamics365[_0x169d('0x2f')]())[_0x169d('0x1a')](realtime[_0x169d('0x30')]())[_0x169d('0x1a')](campaign[_0x169d('0x31')]())['then'](realtime[_0x169d('0x32')]())[_0x169d('0x1a')](voiceExtension[_0x169d('0x33')]())[_0x169d('0x1a')](realtime[_0x169d('0x34')]())['then'](faxAccount[_0x169d('0x35')]())[_0x169d('0x1a')](realtime[_0x169d('0x36')]())[_0x169d('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x169d('0x19')]()[_0x169d('0x1a')](voiceQueueReport[_0x169d('0x37')]())['then'](realtime[_0x169d('0x38')]())[_0x169d('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x169d('0x1a')](realtime[_0x169d('0x39')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x169d('0x1a')](realtime[_0x169d('0x3a')]())[_0x169d('0x1a')](voiceCallReport[_0x169d('0x3b')]())[_0x169d('0x1a')](realtime[_0x169d('0x3c')]())['catch'](function(_0x4a7968){logger[_0x169d('0x3d')](_0x169d('0x3e'),util['inspect'](_0x4a7968,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x169d('0x1a')](function(_0x444a18){return initRealtime();})['then'](function(){return initParams();})[_0x169d('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x169d('0x3f')](function(_0x149cef){logger[_0x169d('0x3d')](_0x169d('0x40'),util[_0x169d('0x41')](_0x149cef,{'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 cdc6b35..7719a7a 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x4be0e6,_0x585888){var _0xaca2ba=function(_0x24fcaf){while(--_0x24fcaf){_0x4be0e6['push'](_0x4be0e6['shift']());}};_0xaca2ba(++_0x585888);}(_0x70e0,0x17b));var _0x070e=function(_0x28c91e,_0xe95306){_0x28c91e=_0x28c91e-0x0;var _0x3210ae=_0x70e0[_0x28c91e];return _0x3210ae;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xedd9,0xfc));var _0x9edd=function(_0x61c029,_0x1d02eb){_0x61c029=_0x61c029-0x0;var _0x3f4074=_0xedd9[_0x61c029];return _0x3f4074;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 5e3df6c..ec96fa6 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 _0x2fc2=['campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type'];(function(_0x124cab,_0x149beb){var _0xa94195=function(_0x8d15bb){while(--_0x8d15bb){_0x124cab['push'](_0x124cab['shift']());}};_0xa94195(++_0x149beb);}(_0x2fc2,0x12a));var _0x22fc=function(_0x2d0f6d,_0x4a1fad){_0x2d0f6d=_0x2d0f6d-0x0;var _0xc412a7=_0x2fc2[_0x2d0f6d];return _0xc412a7;};'use strict';function Campaign(_0x561fae){this['id']=_0x561fae['id']||0x0;this[_0x22fc('0x0')]=_0x561fae[_0x22fc('0x0')]||'';this[_0x22fc('0x1')]=_0x561fae['type']||_0x22fc('0x2');this[_0x22fc('0x3')]=0x0;this[_0x22fc('0x4')]=0x0;this[_0x22fc('0x5')]=0x0;this[_0x22fc('0x6')]=0x0;this[_0x22fc('0x7')]='';this[_0x22fc('0x8')]=!![];this[_0x22fc('0x9')]=_0x561fae[_0x22fc('0x9')];this[_0x22fc('0xa')]=_0x561fae['limitCalls'];this['dialTimezone']=_0x561fae['dialTimezone']||null;this[_0x22fc('0xb')]=_0x561fae[_0x22fc('0xb')]?_0x561fae['dialGlobalInterval']:null;this[_0x22fc('0xc')]=_0x561fae[_0x22fc('0xc')];this['dialOriginateCallerIdNumber']=_0x561fae[_0x22fc('0xd')];this[_0x22fc('0xe')]=_0x561fae[_0x22fc('0xe')]||0x1e;this[_0x22fc('0xf')]=_0x561fae[_0x22fc('0xf')];this['dialCongestionRetryFrequency']=_0x561fae[_0x22fc('0x10')];this[_0x22fc('0x11')]=_0x561fae[_0x22fc('0x11')];this[_0x22fc('0x12')]=_0x561fae['dialBusyRetryFrequency'];this[_0x22fc('0x13')]=_0x561fae['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x561fae[_0x22fc('0x14')];this['dialGlobalMaxRetry']=_0x561fae['dialGlobalMaxRetry'];this[_0x22fc('0x15')]=_0x561fae[_0x22fc('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x561fae[_0x22fc('0x16')]||0x96;this[_0x22fc('0x17')]=_0x561fae[_0x22fc('0x17')]||0x3;this[_0x22fc('0x18')]=_0x561fae['dialDropRetryFrequency']||0x96;this[_0x22fc('0x19')]=_0x561fae[_0x22fc('0x19')]||0x3;this[_0x22fc('0x1a')]=_0x561fae[_0x22fc('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x561fae[_0x22fc('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x561fae[_0x22fc('0x1c')]||0x96;this[_0x22fc('0x1d')]=_0x561fae['dialAgentRejectMaxRetry']||0x3;this[_0x22fc('0x1e')]=_0x561fae[_0x22fc('0x1e')]||0x96;this[_0x22fc('0x1f')]=_0x561fae[_0x22fc('0x1f')]||_0x22fc('0x20');this[_0x22fc('0x21')]=_0x561fae[_0x22fc('0x21')]||undefined;this[_0x22fc('0x22')]=_0x561fae['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x561fae[_0x22fc('0x23')]||undefined;this[_0x22fc('0x24')]=_0x561fae['TrunkBackup']?_0x561fae['TrunkBackup']:undefined;this[_0x22fc('0x25')]=_0x561fae[_0x22fc('0x25')]?_0x561fae[_0x22fc('0x25')]:undefined;this['Interval']=_0x561fae['Interval']?_0x561fae['Interval']:undefined;this[_0x22fc('0x26')]=_0x561fae[_0x22fc('0x26')]?_0x561fae['SquareProject']:undefined;this[_0x22fc('0x27')]=_0x561fae['SquareProject']?_0x561fae[_0x22fc('0x26')][_0x22fc('0x0')]:undefined;this[_0x22fc('0x28')]=_0x561fae[_0x22fc('0x28')]||![];this[_0x22fc('0x29')]=_0x561fae[_0x22fc('0x29')];this[_0x22fc('0x2a')]=_0x561fae[_0x22fc('0x2a')];this[_0x22fc('0x2b')]=_0x561fae[_0x22fc('0x2b')];this[_0x22fc('0x2c')]=_0x561fae[_0x22fc('0x2c')];this[_0x22fc('0x2d')]=_0x561fae[_0x22fc('0x2d')];this[_0x22fc('0x2e')]=_0x561fae[_0x22fc('0x2e')];this[_0x22fc('0x2f')]=_0x561fae[_0x22fc('0x2f')];this['dialAMDSilenceThreshold']=_0x561fae['dialAMDSilenceThreshold'];this[_0x22fc('0x30')]=_0x561fae['dialAMDMaximumWordLength'];}module[_0x22fc('0x31')]=Campaign; \ No newline at end of file +var _0xd297=['dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x33ae52,_0x56b011){var _0x7fa8d5=function(_0x59f2d4){while(--_0x59f2d4){_0x33ae52['push'](_0x33ae52['shift']());}};_0x7fa8d5(++_0x56b011);}(_0xd297,0x166));var _0x7d29=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd297[_0x27af45];return _0x18df21;};'use strict';function Campaign(_0x547da4){this['id']=_0x547da4['id']||0x0;this[_0x7d29('0x0')]=_0x547da4[_0x7d29('0x0')]||'';this[_0x7d29('0x1')]=_0x547da4[_0x7d29('0x1')]||_0x7d29('0x2');this['originated']=0x0;this[_0x7d29('0x3')]=0x0;this[_0x7d29('0x4')]=0x0;this[_0x7d29('0x5')]=0x0;this[_0x7d29('0x6')]='';this[_0x7d29('0x7')]=!![];this[_0x7d29('0x8')]=_0x547da4['active'];this[_0x7d29('0x9')]=_0x547da4[_0x7d29('0x9')];this[_0x7d29('0xa')]=_0x547da4['dialTimezone']||null;this['dialGlobalInterval']=_0x547da4[_0x7d29('0xb')]?_0x547da4[_0x7d29('0xb')]:null;this['dialOriginateCallerIdName']=_0x547da4[_0x7d29('0xc')];this[_0x7d29('0xd')]=_0x547da4[_0x7d29('0xd')];this['dialOriginateTimeout']=_0x547da4[_0x7d29('0xe')]||0x1e;this[_0x7d29('0xf')]=_0x547da4[_0x7d29('0xf')];this[_0x7d29('0x10')]=_0x547da4[_0x7d29('0x10')];this[_0x7d29('0x11')]=_0x547da4[_0x7d29('0x11')];this[_0x7d29('0x12')]=_0x547da4[_0x7d29('0x12')];this[_0x7d29('0x13')]=_0x547da4[_0x7d29('0x13')];this[_0x7d29('0x14')]=_0x547da4[_0x7d29('0x14')];this['dialGlobalMaxRetry']=_0x547da4[_0x7d29('0x15')];this['dialNoSuchNumberMaxRetry']=_0x547da4[_0x7d29('0x16')]||0x3;this[_0x7d29('0x17')]=_0x547da4['dialNoSuchNumberRetryFrequency']||0x96;this[_0x7d29('0x18')]=_0x547da4[_0x7d29('0x18')]||0x3;this[_0x7d29('0x19')]=_0x547da4[_0x7d29('0x19')]||0x96;this[_0x7d29('0x1a')]=_0x547da4[_0x7d29('0x1a')]||0x3;this[_0x7d29('0x1b')]=_0x547da4[_0x7d29('0x1b')]||0x96;this[_0x7d29('0x1c')]=_0x547da4[_0x7d29('0x1c')]||0x3;this[_0x7d29('0x1d')]=_0x547da4[_0x7d29('0x1d')]||0x96;this[_0x7d29('0x1e')]=_0x547da4['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x547da4[_0x7d29('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x547da4['dialOrderByScheduledAt']||_0x7d29('0x20');this[_0x7d29('0x21')]=_0x547da4[_0x7d29('0x21')]||undefined;this[_0x7d29('0x22')]=_0x547da4[_0x7d29('0x22')]||undefined;this['dialCutDigit']=_0x547da4[_0x7d29('0x23')]||undefined;this[_0x7d29('0x24')]=_0x547da4[_0x7d29('0x24')]?_0x547da4[_0x7d29('0x24')]:undefined;this[_0x7d29('0x25')]=_0x547da4[_0x7d29('0x25')]?_0x547da4[_0x7d29('0x25')]:undefined;this['Interval']=_0x547da4[_0x7d29('0x26')]?_0x547da4['Interval']:undefined;this['SquareProject']=_0x547da4['SquareProject']?_0x547da4['SquareProject']:undefined;this['dialQueueProject']=_0x547da4[_0x7d29('0x27')]?_0x547da4[_0x7d29('0x27')][_0x7d29('0x0')]:undefined;this[_0x7d29('0x28')]=_0x547da4[_0x7d29('0x28')]||![];this[_0x7d29('0x29')]=_0x547da4[_0x7d29('0x29')];this[_0x7d29('0x2a')]=_0x547da4[_0x7d29('0x2a')];this['dialAMDAfterGreetingSilence']=_0x547da4['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x547da4[_0x7d29('0x2b')];this['dialAMDMinWordLength']=_0x547da4[_0x7d29('0x2c')];this['dialAMDBetweenWordsSilence']=_0x547da4[_0x7d29('0x2d')];this[_0x7d29('0x2e')]=_0x547da4[_0x7d29('0x2e')];this['dialAMDSilenceThreshold']=_0x547da4[_0x7d29('0x2f')];this[_0x7d29('0x30')]=_0x547da4[_0x7d29('0x30')];}module[_0x7d29('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7174456..a480eaf 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 _0x85ed=['queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','endtime','unmanaged','abandoned','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename'];(function(_0x2a1d17,_0x486ef4){var _0x18ca01=function(_0x322245){while(--_0x322245){_0x2a1d17['push'](_0x2a1d17['shift']());}};_0x18ca01(++_0x486ef4);}(_0x85ed,0x1e7));var _0xd85e=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x85ed[_0x1beef3];return _0x5af964;};'use strict';function Channel(){this[_0xd85e('0x0')]=null;this['channel']='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xd85e('0x1')]='';this[_0xd85e('0x2')]=undefined;this[_0xd85e('0x3')]=undefined;this[_0xd85e('0x4')]=0x0;this[_0xd85e('0x5')]='';this['uniqueid']=0x0;this[_0xd85e('0x6')]=0x0;this['exten']=0x0;this['answered']=![];this['answertime']=null;this[_0xd85e('0x7')]=null;this[_0xd85e('0x8')]=![];this[_0xd85e('0x9')]=![];this['lastapplication']='';this['lastdata']='';this[_0xd85e('0xa')]=0x0;this[_0xd85e('0xb')]=0x0;this[_0xd85e('0xc')]=0x0;this[_0xd85e('0xd')]=null;this['tag']=null;this[_0xd85e('0xe')]=null;this[_0xd85e('0xf')]=![];this[_0xd85e('0x10')]=null;this[_0xd85e('0x11')]=null;this[_0xd85e('0x12')]=[];this[_0xd85e('0x13')]=undefined;this[_0xd85e('0x14')]=undefined;this[_0xd85e('0x15')]=undefined;this[_0xd85e('0x16')]=0x0;}module[_0xd85e('0x17')]=Channel; \ No newline at end of file +var _0x36e0=['unmanaged','abandoned','duration','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','exten','answered','answertime','endtime'];(function(_0x54a720,_0xd2abf8){var _0x219688=function(_0x2e8b8a){while(--_0x2e8b8a){_0x54a720['push'](_0x54a720['shift']());}};_0x219688(++_0xd2abf8);}(_0x36e0,0x15c));var _0x036e=function(_0xa36030,_0x1667ba){_0xa36030=_0xa36030-0x0;var _0x5154d2=_0x36e0[_0xa36030];return _0x5154d2;};'use strict';function Channel(){this[_0x036e('0x0')]=null;this[_0x036e('0x1')]='';this['destinationchannel']='';this[_0x036e('0x2')]=0x0;this[_0x036e('0x3')]='';this[_0x036e('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x036e('0x5')]=0x0;this[_0x036e('0x6')]='';this['uniqueid']=0x0;this[_0x036e('0x7')]=0x0;this[_0x036e('0x8')]=0x0;this[_0x036e('0x9')]=![];this[_0x036e('0xa')]=null;this[_0x036e('0xb')]=null;this[_0x036e('0xc')]=![];this[_0x036e('0xd')]=![];this['lastapplication']='';this['lastdata']='';this[_0x036e('0xe')]=0x0;this[_0x036e('0xf')]=0x0;this[_0x036e('0x10')]=0x0;this[_0x036e('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x036e('0x12')]=null;this[_0x036e('0x13')]=null;this[_0x036e('0x14')]=[];this[_0x036e('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x036e('0x16')]=undefined;this[_0x036e('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 9df84fc..1b1a048 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 _0x717e=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret','type','serverUrl'];(function(_0x472ee2,_0x295444){var _0x18387b=function(_0x320611){while(--_0x320611){_0x472ee2['push'](_0x472ee2['shift']());}};_0x18387b(++_0x295444);}(_0x717e,0x1ca));var _0xe717=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0x717e[_0x216f7d];return _0xc49d7f;};'use strict';function DeskAccount(_0x324f03){this['id']=_0x324f03['id']||0x0;this[_0xe717('0x0')]=_0x324f03[_0xe717('0x0')]||'';this[_0xe717('0x1')]=_0x324f03[_0xe717('0x1')]||'';this[_0xe717('0x2')]=_0x324f03['remoteUri']||'';this[_0xe717('0x3')]=_0x324f03[_0xe717('0x3')]||'';this[_0xe717('0x4')]=_0x324f03[_0xe717('0x4')]||'';this['consumerKey']=_0x324f03[_0xe717('0x5')]||'';this['consumerSecret']=_0x324f03['consumerSecret']||'';this[_0xe717('0x6')]=_0x324f03[_0xe717('0x6')]||'';this[_0xe717('0x7')]=_0x324f03[_0xe717('0x7')]||'';this[_0xe717('0x8')]=_0x324f03[_0xe717('0x8')]||'';this['serverUrl']=_0x324f03[_0xe717('0x9')]||'';this[_0xe717('0xa')]=_0x324f03[_0xe717('0xa')]||{};}module[_0xe717('0xb')]=DeskAccount; \ No newline at end of file +var _0xb5ef=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerSecret','token'];(function(_0x3b3336,_0x37a51b){var _0x7aad22=function(_0x19335e){while(--_0x19335e){_0x3b3336['push'](_0x3b3336['shift']());}};_0x7aad22(++_0x37a51b);}(_0xb5ef,0x1d3));var _0xfb5e=function(_0x159d0b,_0x15fd0a){_0x159d0b=_0x159d0b-0x0;var _0x10f29a=_0xb5ef[_0x159d0b];return _0x10f29a;};'use strict';function DeskAccount(_0x39bb14){this['id']=_0x39bb14['id']||0x0;this['name']=_0x39bb14['name']||'';this[_0xfb5e('0x0')]=_0x39bb14[_0xfb5e('0x0')]||'';this[_0xfb5e('0x1')]=_0x39bb14['remoteUri']||'';this[_0xfb5e('0x2')]=_0x39bb14[_0xfb5e('0x2')]||'';this[_0xfb5e('0x3')]=_0x39bb14[_0xfb5e('0x3')]||'';this['consumerKey']=_0x39bb14['consumerKey']||'';this[_0xfb5e('0x4')]=_0x39bb14['consumerSecret']||'';this[_0xfb5e('0x5')]=_0x39bb14[_0xfb5e('0x5')]||'';this['tokenSecret']=_0x39bb14[_0xfb5e('0x6')]||'';this[_0xfb5e('0x7')]=_0x39bb14[_0xfb5e('0x7')]||'';this[_0xfb5e('0x8')]=_0x39bb14[_0xfb5e('0x8')]||'';this[_0xfb5e('0x9')]=_0x39bb14['Configurations']||{};}module[_0xfb5e('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 229e41c..e4699ec 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 _0x4d20=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x4d54d4,_0x5609b3){var _0x1e62b5=function(_0x5c11b3){while(--_0x5c11b3){_0x4d54d4['push'](_0x4d54d4['shift']());}};_0x1e62b5(++_0x5609b3);}(_0x4d20,0x15d));var _0x04d2=function(_0x2c6bd7,_0x248488){_0x2c6bd7=_0x2c6bd7-0x0;var _0x3a44e8=_0x4d20[_0x2c6bd7];return _0x3a44e8;};'use strict';function Dynamics365Account(_0x552851){this['id']=_0x552851['id']||0x0;this['name']=_0x552851[_0x04d2('0x0')]||'';this['username']=_0x552851[_0x04d2('0x1')]||'';this[_0x04d2('0x2')]=_0x552851[_0x04d2('0x2')]||'';this['remoteUri']=_0x552851[_0x04d2('0x3')]||'';this[_0x04d2('0x4')]=_0x552851['tenantId']||'';this[_0x04d2('0x5')]=_0x552851[_0x04d2('0x5')]||'';this[_0x04d2('0x6')]=_0x552851['clientSecret']||{};this[_0x04d2('0x7')]=_0x552851['serverUrl']||'';this[_0x04d2('0x8')]=_0x552851[_0x04d2('0x8')]||![];this[_0x04d2('0x9')]=_0x552851[_0x04d2('0x9')]||{};this[_0x04d2('0xa')]=_0x552851[_0x04d2('0xa')]||{};}module[_0x04d2('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x31df=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId'];(function(_0x48c1a3,_0x2e4306){var _0x300b54=function(_0xc29931){while(--_0xc29931){_0x48c1a3['push'](_0x48c1a3['shift']());}};_0x300b54(++_0x2e4306);}(_0x31df,0x187));var _0xf31d=function(_0x4df2c4,_0x4ee5e8){_0x4df2c4=_0x4df2c4-0x0;var _0x4ddd49=_0x31df[_0x4df2c4];return _0x4ddd49;};'use strict';function Dynamics365Account(_0xf49ba9){this['id']=_0xf49ba9['id']||0x0;this['name']=_0xf49ba9[_0xf31d('0x0')]||'';this[_0xf31d('0x1')]=_0xf49ba9[_0xf31d('0x1')]||'';this['password']=_0xf49ba9[_0xf31d('0x2')]||'';this[_0xf31d('0x3')]=_0xf49ba9[_0xf31d('0x3')]||'';this[_0xf31d('0x4')]=_0xf49ba9[_0xf31d('0x4')]||'';this[_0xf31d('0x5')]=_0xf49ba9[_0xf31d('0x5')]||'';this[_0xf31d('0x6')]=_0xf49ba9[_0xf31d('0x6')]||{};this[_0xf31d('0x7')]=_0xf49ba9['serverUrl']||'';this['modernAuthentication']=_0xf49ba9[_0xf31d('0x8')]||![];this[_0xf31d('0x9')]=_0xf49ba9['Configurations']||{};this['CloudProvider']=_0xf49ba9[_0xf31d('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9a70c32..2a91f4d 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 _0x8391=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x89ba76,_0x595a3e){var _0x26bcdb=function(_0x3234e1){while(--_0x3234e1){_0x89ba76['push'](_0x89ba76['shift']());}};_0x26bcdb(++_0x595a3e);}(_0x8391,0xd5));var _0x1839=function(_0x283081,_0x25ac13){_0x283081=_0x283081-0x0;var _0x23ddf5=_0x8391[_0x283081];return _0x23ddf5;};'use strict';function FaxAccount(_0x35c582){this['id']=_0x35c582['id']||0x0;this[_0x1839('0x0')]=_0x35c582[_0x1839('0x0')]||'';this[_0x1839('0x1')]=_0x35c582[_0x1839('0x1')];this[_0x1839('0x2')]=_0x35c582[_0x1839('0x2')];this[_0x1839('0x3')]=_0x35c582[_0x1839('0x3')];this['localstationid']=_0x35c582[_0x1839('0x4')];this[_0x1839('0x5')]=_0x35c582[_0x1839('0x5')]||0x960;this[_0x1839('0x6')]=_0x35c582['maxrate']||0x3840;this['modem']=_0x35c582['modem']||_0x1839('0x7');this[_0x1839('0x8')]=_0x35c582[_0x1839('0x8')]||'no';this[_0x1839('0x9')]=_0x35c582['faxdetect']||'no';this[_0x1839('0xa')]=_0x35c582['t38timeout']||0x1388;this['tech']=_0x35c582['tech']||_0x1839('0xb');this[_0x1839('0xc')]=_0x35c582[_0x1839('0xc')]?_0x35c582['Trunk']:undefined;this[_0x1839('0xd')]=_0x35c582['ListId'];this[_0x1839('0xe')]=_0x35c582[_0x1839('0xe')];}module[_0x1839('0xf')]=FaxAccount; \ No newline at end of file +var _0xba91=['t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x73aef5,_0x5b2293){var _0x29be73=function(_0x1c9129){while(--_0x1c9129){_0x73aef5['push'](_0x73aef5['shift']());}};_0x29be73(++_0x5b2293);}(_0xba91,0xf4));var _0x1ba9=function(_0x38a621,_0x404690){_0x38a621=_0x38a621-0x0;var _0x571b6f=_0xba91[_0x38a621];return _0x571b6f;};'use strict';function FaxAccount(_0x49ec81){this['id']=_0x49ec81['id']||0x0;this[_0x1ba9('0x0')]=_0x49ec81[_0x1ba9('0x0')]||'';this[_0x1ba9('0x1')]=_0x49ec81['description'];this[_0x1ba9('0x2')]=_0x49ec81[_0x1ba9('0x2')];this[_0x1ba9('0x3')]=_0x49ec81[_0x1ba9('0x3')];this[_0x1ba9('0x4')]=_0x49ec81['localstationid'];this[_0x1ba9('0x5')]=_0x49ec81[_0x1ba9('0x5')]||0x960;this[_0x1ba9('0x6')]=_0x49ec81['maxrate']||0x3840;this['modem']=_0x49ec81[_0x1ba9('0x7')]||_0x1ba9('0x8');this['gateway']=_0x49ec81[_0x1ba9('0x9')]||'no';this['faxdetect']=_0x49ec81[_0x1ba9('0xa')]||'no';this[_0x1ba9('0xb')]=_0x49ec81[_0x1ba9('0xb')]||0x1388;this[_0x1ba9('0xc')]=_0x49ec81['tech']||'SIP';this[_0x1ba9('0xd')]=_0x49ec81['Trunk']?_0x49ec81['Trunk']:undefined;this['ListId']=_0x49ec81[_0x1ba9('0xe')];this[_0x1ba9('0xf')]=_0x49ec81[_0x1ba9('0xf')];}module[_0x1ba9('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 67ca298..5d91e86 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 _0xe799=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x75aee9,_0x525b03){var _0x55d4e2=function(_0x3d8cd6){while(--_0x3d8cd6){_0x75aee9['push'](_0x75aee9['shift']());}};_0x55d4e2(++_0x525b03);}(_0xe799,0xac));var _0x9e79=function(_0x281694,_0x4c33a6){_0x281694=_0x281694-0x0;var _0x165946=_0xe799[_0x281694];return _0x165946;};'use strict';function FreshdeskAccount(_0x36cf3d){this['id']=_0x36cf3d['id']||0x0;this[_0x9e79('0x0')]=_0x36cf3d['name']||'';this[_0x9e79('0x1')]=_0x36cf3d['username']||'';this['apiKey']=_0x36cf3d[_0x9e79('0x2')]||'';this['remoteUri']=_0x36cf3d[_0x9e79('0x3')]||'';this[_0x9e79('0x4')]=_0x36cf3d[_0x9e79('0x4')]||'';this[_0x9e79('0x5')]=_0x36cf3d[_0x9e79('0x5')]||{};}module[_0x9e79('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xf2ad=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x1bbe2f,_0x69592c){var _0xeed326=function(_0x378ac3){while(--_0x378ac3){_0x1bbe2f['push'](_0x1bbe2f['shift']());}};_0xeed326(++_0x69592c);}(_0xf2ad,0x197));var _0xdf2a=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xf2ad[_0x12ddb2];return _0x10b6dd;};'use strict';function FreshdeskAccount(_0x552b9c){this['id']=_0x552b9c['id']||0x0;this['name']=_0x552b9c[_0xdf2a('0x0')]||'';this[_0xdf2a('0x1')]=_0x552b9c[_0xdf2a('0x1')]||'';this[_0xdf2a('0x2')]=_0x552b9c['token']||'';this[_0xdf2a('0x3')]=_0x552b9c[_0xdf2a('0x3')]||'';this[_0xdf2a('0x4')]=_0x552b9c[_0xdf2a('0x4')]||'';this[_0xdf2a('0x5')]=_0x552b9c[_0xdf2a('0x5')]||{};}module[_0xdf2a('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 e646d62..8df2c89 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 _0xff2a=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x3c951e,_0x5a96af){var _0x1a3b0a=function(_0x36456d){while(--_0x36456d){_0x3c951e['push'](_0x3c951e['shift']());}};_0x1a3b0a(++_0x5a96af);}(_0xff2a,0x93));var _0xaff2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xff2a[_0x1b4b23];return _0x2a325b;};'use strict';function FreshsalesAccount(_0x582b60){this['id']=_0x582b60['id']||0x0;this[_0xaff2('0x0')]=_0x582b60[_0xaff2('0x0')]||'';this['username']=_0x582b60[_0xaff2('0x1')]||'';this[_0xaff2('0x2')]=_0x582b60['token']||'';this[_0xaff2('0x3')]=_0x582b60['remoteUri']||'';this[_0xaff2('0x4')]=_0x582b60[_0xaff2('0x4')]||'';this['Configurations']=_0x582b60[_0xaff2('0x5')]||{};}module[_0xaff2('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x2e65=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x2e65,0x193));var _0x52e6=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x2e65[_0x2d364e];return _0x1b9312;};'use strict';function FreshsalesAccount(_0x5361f6){this['id']=_0x5361f6['id']||0x0;this[_0x52e6('0x0')]=_0x5361f6[_0x52e6('0x0')]||'';this[_0x52e6('0x1')]=_0x5361f6[_0x52e6('0x1')]||'';this[_0x52e6('0x2')]=_0x5361f6[_0x52e6('0x3')]||'';this[_0x52e6('0x4')]=_0x5361f6['remoteUri']||'';this[_0x52e6('0x5')]=_0x5361f6[_0x52e6('0x5')]||'';this[_0x52e6('0x6')]=_0x5361f6[_0x52e6('0x6')]||{};}module[_0x52e6('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 912aacb..61acc43 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 _0xa904=['lastAssignedTo','motionChannel','voice','mohtime','variables','type','calleridnum','calleridname','queuecallerjoinAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned'];(function(_0x428a02,_0x4d7371){var _0xb93e12=function(_0x3de3c1){while(--_0x3de3c1){_0x428a02['push'](_0x428a02['shift']());}};_0xb93e12(++_0x4d7371);}(_0xa904,0xeb));var _0x4a90=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0xa904[_0x38a155];return _0x269403;};'use strict';function QueueReport(){this[_0x4a90('0x0')]='inbound';this['uniqueid']='';this[_0x4a90('0x1')]='';this[_0x4a90('0x2')]='';this['queue']='';this[_0x4a90('0x3')]=null;this['queuecallerleaveAt']=null;this[_0x4a90('0x4')]=0x1;this['count']=0x1;this[_0x4a90('0x5')]=![];this[_0x4a90('0x6')]=null;this[_0x4a90('0x7')]=![];this[_0x4a90('0x8')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x4a90('0x9')]=0x1;this['channel']='';this[_0x4a90('0xa')]='';this[_0x4a90('0xb')]='';this[_0x4a90('0xc')]='';this[_0x4a90('0xd')]='';this[_0x4a90('0xe')]='';this[_0x4a90('0xf')]='';this[_0x4a90('0x10')]=0x0;this[_0x4a90('0x11')]=![];this[_0x4a90('0x12')]='';this[_0x4a90('0x13')]=_0x4a90('0x14');this[_0x4a90('0x15')]=0x0;this[_0x4a90('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xce28=['holdtime','lastAssignedTo','motionChannel','voice','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xce28,0xc3));var _0x8ce2=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xce28[_0x1c8c28];return _0x1f59b4;};'use strict';function QueueReport(){this[_0x8ce2('0x0')]=_0x8ce2('0x1');this[_0x8ce2('0x2')]='';this[_0x8ce2('0x3')]='';this[_0x8ce2('0x4')]='';this[_0x8ce2('0x5')]='';this['queuecallerjoinAt']=null;this[_0x8ce2('0x6')]=null;this[_0x8ce2('0x7')]=0x1;this[_0x8ce2('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x8ce2('0x9')]=null;this[_0x8ce2('0xa')]=![];this[_0x8ce2('0xb')]=null;this[_0x8ce2('0xc')]=![];this[_0x8ce2('0xd')]=null;this['originalposition']=0x1;this[_0x8ce2('0xe')]='';this[_0x8ce2('0xf')]='';this[_0x8ce2('0x10')]='';this[_0x8ce2('0x11')]='';this[_0x8ce2('0x12')]='';this[_0x8ce2('0x13')]='';this[_0x8ce2('0x14')]='';this[_0x8ce2('0x15')]=0x0;this['assigned']=![];this[_0x8ce2('0x16')]='';this[_0x8ce2('0x17')]=_0x8ce2('0x18');this[_0x8ce2('0x19')]=0x0;this['variables']={};}module[_0x8ce2('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a24f0a6..c891e7c 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 _0xa24d=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name'];(function(_0x531b21,_0x497caa){var _0x241f38=function(_0x2d2b46){while(--_0x2d2b46){_0x531b21['push'](_0x531b21['shift']());}};_0x241f38(++_0x497caa);}(_0xa24d,0x1c1));var _0xda24=function(_0x1ad7fc,_0x444145){_0x1ad7fc=_0x1ad7fc-0x0;var _0x3bb433=_0xa24d[_0x1ad7fc];return _0x3bb433;};'use strict';function SalesforceAccount(_0x1da3fe){this['id']=_0x1da3fe['id']||0x0;this[_0xda24('0x0')]=_0x1da3fe[_0xda24('0x0')]||'';this[_0xda24('0x1')]=_0x1da3fe[_0xda24('0x1')]||'';this[_0xda24('0x2')]=_0x1da3fe[_0xda24('0x2')]||'';this['password']=_0x1da3fe[_0xda24('0x3')]||'';this[_0xda24('0x4')]=_0x1da3fe[_0xda24('0x4')]||'';this[_0xda24('0x5')]=_0x1da3fe['clientSecret']||'';this[_0xda24('0x6')]=_0x1da3fe[_0xda24('0x6')]||'';this['type']=_0x1da3fe[_0xda24('0x7')]||'integrationTab';this[_0xda24('0x8')]=_0x1da3fe[_0xda24('0x8')]||'';this[_0xda24('0x9')]=_0x1da3fe[_0xda24('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xc8d7=['integrationTab','serverUrl','Configurations','exports','name','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x373aea,_0xc86cfa){var _0x63a133=function(_0x58a1d8){while(--_0x58a1d8){_0x373aea['push'](_0x373aea['shift']());}};_0x63a133(++_0xc86cfa);}(_0xc8d7,0x122));var _0x7c8d=function(_0x57c428,_0xcd46f3){_0x57c428=_0x57c428-0x0;var _0x5b8332=_0xc8d7[_0x57c428];return _0x5b8332;};'use strict';function SalesforceAccount(_0x2eec01){this['id']=_0x2eec01['id']||0x0;this['name']=_0x2eec01[_0x7c8d('0x0')]||'';this['username']=_0x2eec01['username']||'';this[_0x7c8d('0x1')]=_0x2eec01[_0x7c8d('0x1')]||'';this[_0x7c8d('0x2')]=_0x2eec01[_0x7c8d('0x2')]||'';this[_0x7c8d('0x3')]=_0x2eec01['clientId']||'';this[_0x7c8d('0x4')]=_0x2eec01[_0x7c8d('0x4')]||'';this[_0x7c8d('0x5')]=_0x2eec01[_0x7c8d('0x5')]||'';this[_0x7c8d('0x6')]=_0x2eec01['type']||_0x7c8d('0x7');this[_0x7c8d('0x8')]=_0x2eec01[_0x7c8d('0x8')]||'';this[_0x7c8d('0x9')]=_0x2eec01[_0x7c8d('0x9')]||{};}module[_0x7c8d('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4f7a30c..aab9dde 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 _0x1a83=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x1867e3,_0x5a0067){var _0x2b1faa=function(_0x2e747a){while(--_0x2e747a){_0x1867e3['push'](_0x1867e3['shift']());}};_0x2b1faa(++_0x5a0067);}(_0x1a83,0x196));var _0x31a8=function(_0x2adb79,_0x51601b){_0x2adb79=_0x2adb79-0x0;var _0x15a0a2=_0x1a83[_0x2adb79];return _0x15a0a2;};'use strict';function ServicenowAccount(_0x47919f){this['id']=_0x47919f['id']||0x0;this[_0x31a8('0x0')]=_0x47919f[_0x31a8('0x0')]||'';this[_0x31a8('0x1')]=_0x47919f['username']||'';this['password']=_0x47919f[_0x31a8('0x2')]||'';this[_0x31a8('0x3')]=_0x47919f[_0x31a8('0x3')]||'';this[_0x31a8('0x4')]=_0x47919f[_0x31a8('0x4')]||'';this['Configurations']=_0x47919f[_0x31a8('0x5')]||{};}module[_0x31a8('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xec05=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4a8604,_0x3c28b7){var _0x1944c1=function(_0x48d91c){while(--_0x48d91c){_0x4a8604['push'](_0x4a8604['shift']());}};_0x1944c1(++_0x3c28b7);}(_0xec05,0xee));var _0x5ec0=function(_0x263e30,_0x10213e){_0x263e30=_0x263e30-0x0;var _0x1390b1=_0xec05[_0x263e30];return _0x1390b1;};'use strict';function ServicenowAccount(_0x72437){this['id']=_0x72437['id']||0x0;this[_0x5ec0('0x0')]=_0x72437[_0x5ec0('0x0')]||'';this[_0x5ec0('0x1')]=_0x72437[_0x5ec0('0x1')]||'';this[_0x5ec0('0x2')]=_0x72437[_0x5ec0('0x2')]||'';this[_0x5ec0('0x3')]=_0x72437[_0x5ec0('0x3')]||'';this[_0x5ec0('0x4')]=_0x72437[_0x5ec0('0x4')]||'';this[_0x5ec0('0x5')]=_0x72437[_0x5ec0('0x5')]||{};}module[_0x5ec0('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index a79ddf2..c3e32ed 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 _0x0a9d=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x0a9d,0x192));var _0xd0a9=function(_0x4cc8c3,_0x2550de){_0x4cc8c3=_0x4cc8c3-0x0;var _0x3a32ea=_0x0a9d[_0x4cc8c3];return _0x3a32ea;};'use strict';function SugarcrmAccount(_0x55a45d){this['id']=_0x55a45d['id']||0x0;this[_0xd0a9('0x0')]=_0x55a45d['name']||'';this[_0xd0a9('0x1')]=_0x55a45d[_0xd0a9('0x1')]||'';this[_0xd0a9('0x2')]=_0x55a45d[_0xd0a9('0x2')]||'';this[_0xd0a9('0x3')]=_0x55a45d['remoteUri']||'';this[_0xd0a9('0x4')]=_0x55a45d['serverUrl']||'';this[_0xd0a9('0x5')]=_0x55a45d[_0xd0a9('0x5')]||{};}module[_0xd0a9('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0276=['username','password','remoteUri','Configurations','exports','name'];(function(_0x4fd1c4,_0x3b18d1){var _0x1ce8e2=function(_0x141b74){while(--_0x141b74){_0x4fd1c4['push'](_0x4fd1c4['shift']());}};_0x1ce8e2(++_0x3b18d1);}(_0x0276,0x83));var _0x6027=function(_0x53e6a8,_0x5839ab){_0x53e6a8=_0x53e6a8-0x0;var _0x2b6dcc=_0x0276[_0x53e6a8];return _0x2b6dcc;};'use strict';function SugarcrmAccount(_0xff299f){this['id']=_0xff299f['id']||0x0;this[_0x6027('0x0')]=_0xff299f[_0x6027('0x0')]||'';this[_0x6027('0x1')]=_0xff299f[_0x6027('0x1')]||'';this[_0x6027('0x2')]=_0xff299f[_0x6027('0x2')]||'';this[_0x6027('0x3')]=_0xff299f[_0x6027('0x3')]||'';this['serverUrl']=_0xff299f['serverUrl']||'';this[_0x6027('0x4')]=_0xff299f[_0x6027('0x4')]||{};}module[_0x6027('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 1c3387a..8ffe708 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 _0x983c=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x983c,0xf3));var _0xc983=function(_0x4ea44b,_0x546b89){_0x4ea44b=_0x4ea44b-0x0;var _0x418cc9=_0x983c[_0x4ea44b];return _0x418cc9;};'use strict';function Telephone(_0x45128c){this['id']=_0x45128c['id']||0x0;this[_0xc983('0x0')]=_0x45128c[_0xc983('0x0')]||'';this[_0xc983('0x1')]=_0x45128c[_0xc983('0x1')]||'';this['state']=_0xc983('0x2');this[_0xc983('0x3')]=0x0;this[_0xc983('0x4')]=_0xc983('0x2');this[_0xc983('0x5')]='';}module[_0xc983('0x6')]=Telephone; \ No newline at end of file +var _0xb1ba=['stateTime','address','name','accountcode','state','unknown'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0xb1ba,0x152));var _0xab1b=function(_0x383d66,_0x5a95ce){_0x383d66=_0x383d66-0x0;var _0x4a71d3=_0xb1ba[_0x383d66];return _0x4a71d3;};'use strict';function Telephone(_0x1c008b){this['id']=_0x1c008b['id']||0x0;this['name']=_0x1c008b[_0xab1b('0x0')]||'';this[_0xab1b('0x1')]=_0x1c008b[_0xab1b('0x1')]||'';this[_0xab1b('0x2')]=_0xab1b('0x3');this[_0xab1b('0x4')]=0x0;this['status']='unknown';this[_0xab1b('0x5')]='';}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 685b6a0..799875a 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x1bb083,_0x5d72a3){var _0x380397=function(_0x2c4950){while(--_0x2c4950){_0x1bb083['push'](_0x1bb083['shift']());}};_0x380397(++_0x5d72a3);}(_0xb10b,0x12a));var _0xbb10=function(_0xe01d60,_0x340301){_0xe01d60=_0xe01d60-0x0;var _0x46d858=_0xb10b[_0xe01d60];return _0x46d858;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x26d88d,_0x21d5c7){var _0x3cb6b0=function(_0x2cfabd){while(--_0x2cfabd){_0x26d88d['push'](_0x26d88d['shift']());}};_0x3cb6b0(++_0x21d5c7);}(_0xb10b,0x12a));var _0xbb10=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xb10b[_0x8af54b];return _0x27d8f0;};'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 8205bd5..2d4d3f1 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x0b0e[_0x152aa1];return _0x1bc01a;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8ef9623..6056c14 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 _0xf51d=['defaultuser','exports','name','state','unknown','stateTime','status','registry','indexOf','port','domain','refresh','address'];(function(_0x10ddb9,_0x3b9d7a){var _0x129076=function(_0x5b2b37){while(--_0x5b2b37){_0x10ddb9['push'](_0x10ddb9['shift']());}};_0x129076(++_0x3b9d7a);}(_0xf51d,0x17b));var _0xdf51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf51d[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x1f198d){this['id']=_0x1f198d['id']||0x0;this['active']=_0x1f198d['active']||![];this[_0xdf51('0x0')]=_0x1f198d['name']||'';this[_0xdf51('0x1')]=_0xdf51('0x2');this[_0xdf51('0x3')]=0x0;this[_0xdf51('0x4')]=_0xdf51('0x2');this['registry']=_0x1f198d['registry']&&_0x1f198d[_0xdf51('0x5')][_0xdf51('0x6')](':')?_0x1f198d[_0xdf51('0x5')]['split'](':')[0x0]:'';this['host']='';this[_0xdf51('0x7')]='';this[_0xdf51('0x8')]='';this['domainport']='';this[_0xdf51('0x9')]='';this['stateRegistry']=_0xdf51('0x2');this['registrationtime']='';this[_0xdf51('0xa')]='';this[_0xdf51('0xb')]=_0x1f198d['defaultuser']||'';}module[_0xdf51('0xc')]=Trunk; \ No newline at end of file +var _0x1bb9=['exports','state','unknown','stateTime','status','registry','indexOf','split','host','domain','refresh','registrationtime','address','defaultuser'];(function(_0x48334d,_0x5d7303){var _0x2b5cce=function(_0x212a64){while(--_0x212a64){_0x48334d['push'](_0x48334d['shift']());}};_0x2b5cce(++_0x5d7303);}(_0x1bb9,0x119));var _0x91bb=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x1bb9[_0x5d6e35];return _0x5d7ada;};'use strict';function Trunk(_0x9c0051){this['id']=_0x9c0051['id']||0x0;this['active']=_0x9c0051['active']||![];this['name']=_0x9c0051['name']||'';this[_0x91bb('0x0')]=_0x91bb('0x1');this[_0x91bb('0x2')]=0x0;this[_0x91bb('0x3')]=_0x91bb('0x1');this['registry']=_0x9c0051[_0x91bb('0x4')]&&_0x9c0051['registry'][_0x91bb('0x5')](':')?_0x9c0051[_0x91bb('0x4')][_0x91bb('0x6')](':')[0x0]:'';this[_0x91bb('0x7')]='';this['port']='';this[_0x91bb('0x8')]='';this['domainport']='';this[_0x91bb('0x9')]='';this['stateRegistry']=_0x91bb('0x1');this[_0x91bb('0xa')]='';this[_0x91bb('0xb')]='';this['defaultuser']=_0x9c0051[_0x91bb('0xc')]||'';}module[_0x91bb('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d0fe2a7..7a7f1fc 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 _0x149a=['mandatoryDisposition','exports','exten','none'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x149a,0x1e2));var _0xa149=function(_0x4e3e2c,_0x2a3b42){_0x4e3e2c=_0x4e3e2c-0x0;var _0x6df7dc=_0x149a[_0x4e3e2c];return _0x6df7dc;};'use strict';function voiceExtension(_0x20ff98){this['id']=_0x20ff98['id']||0x0;this['exten']=_0x20ff98[_0xa149('0x0')]||'';this['recordingFormat']=_0x20ff98['recordingFormat']||_0xa149('0x1');this['mandatoryDisposition']=_0x20ff98[_0xa149('0x2')]||![];}module[_0xa149('0x3')]=voiceExtension; \ No newline at end of file +var _0x8f34=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0x8f34,0x1a9));var _0x48f3=function(_0x1844ae,_0x237c00){_0x1844ae=_0x1844ae-0x0;var _0x2f01f0=_0x8f34[_0x1844ae];return _0x2f01f0;};'use strict';function voiceExtension(_0x4e386a){this['id']=_0x4e386a['id']||0x0;this[_0x48f3('0x0')]=_0x4e386a['exten']||'';this[_0x48f3('0x1')]=_0x4e386a[_0x48f3('0x1')]||_0x48f3('0x2');this[_0x48f3('0x3')]=_0x4e386a[_0x48f3('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c92f107..25bc96c 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 _0x92da=['unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','talking','total','answered','sumDuration','sumHoldTime','sumBillable'];(function(_0x50a012,_0x1f14b9){var _0x5531ac=function(_0x59480e){while(--_0x59480e){_0x50a012['push'](_0x50a012['shift']());}};_0x5531ac(++_0x1f14b9);}(_0x92da,0x1dc));var _0xa92d=function(_0xfd7c9f,_0x3e0d8a){_0xfd7c9f=_0xfd7c9f-0x0;var _0x4e713f=_0x92da[_0xfd7c9f];return _0x4e713f;};'use strict';var statusDesc=[_0xa92d('0x0'),_0xa92d('0x1'),'inuse','busy',_0xa92d('0x2'),_0xa92d('0x3'),_0xa92d('0x4'),_0xa92d('0x5'),_0xa92d('0x6')];var monitorFormat={'wav':_0xa92d('0x7'),'wav49':_0xa92d('0x8'),'gsm':_0xa92d('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xa92d('0xa')};function VoiceQueue(_0x11886c){this['id']=_0x11886c['id']||0x0;this[_0xa92d('0xb')]=_0x11886c[_0xa92d('0xb')]||'';this['monitor_format']=_0x11886c[_0xa92d('0xc')]||'';this[_0xa92d('0xd')]=_0x11886c[_0xa92d('0xd')]||'inbound';this['waiting']=0x0;this[_0xa92d('0xe')]=0x0;this[_0xa92d('0xf')]=0x0;this[_0xa92d('0x10')]=0x0;this[_0xa92d('0x11')]=0x0;this[_0xa92d('0x12')]=0x0;this[_0xa92d('0x13')]=0x0;this[_0xa92d('0x14')]=0x0;this[_0xa92d('0x15')]=0x0;this[_0xa92d('0x16')]=0x0;this[_0xa92d('0x17')]=0x0;this[_0xa92d('0x18')]=_0x11886c['acw']||![];this['acwTimeout']=_0x11886c[_0xa92d('0x19')]||0xa;this[_0xa92d('0x1a')]=_0x11886c[_0xa92d('0x1a')]||'no';this[_0xa92d('0x1b')]=!![];this[_0xa92d('0x1c')]='';this['originated']=0x0;this['temp']=0x0;this[_0xa92d('0x1d')]=_0x11886c[_0xa92d('0x1d')]||null;this['dialGlobalInterval']=_0x11886c[_0xa92d('0x1e')]?_0x11886c[_0xa92d('0x1e')]:null;this['dialActive']=_0x11886c[_0xa92d('0x1f')];this[_0xa92d('0x20')]=_0x11886c[_0xa92d('0x20')]||_0xa92d('0x21');this['dialLimitChannel']=_0x11886c['dialLimitChannel']||0x0;this[_0xa92d('0x22')]=_0x11886c['dialLimitQueue']||0x0;this[_0xa92d('0x23')]=_0x11886c[_0xa92d('0x23')]||0x1;this[_0xa92d('0x24')]=_0x11886c[_0xa92d('0x24')]||_0xa92d('0x25');this['dialPredictiveOptimizationPercentage']=_0x11886c[_0xa92d('0x26')]||0.03;this[_0xa92d('0x27')]=_0x11886c[_0xa92d('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x11886c[_0xa92d('0x28')]||_0xa92d('0x29');this[_0xa92d('0x2a')]=_0x11886c[_0xa92d('0x2a')]||_0xa92d('0x29');this[_0xa92d('0x2b')]=_0x11886c[_0xa92d('0x2b')]||0x1e;this['dialQueueOptions']=_0x11886c[_0xa92d('0x2c')]||_0xa92d('0x2d');this[_0xa92d('0x2e')]=_0x11886c[_0xa92d('0x2e')]||0x3;this[_0xa92d('0x2f')]=_0x11886c[_0xa92d('0x2f')]||undefined;this[_0xa92d('0x30')]=_0x11886c[_0xa92d('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x11886c['dialCongestionRetryFrequency']||0x96;this[_0xa92d('0x31')]=_0x11886c['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x11886c[_0xa92d('0x32')]||0x96;this[_0xa92d('0x33')]=_0x11886c[_0xa92d('0x33')]||0x3;this[_0xa92d('0x34')]=_0x11886c[_0xa92d('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x11886c[_0xa92d('0x35')]||0x3;this[_0xa92d('0x36')]=_0x11886c[_0xa92d('0x36')]||0x96;this[_0xa92d('0x37')]=_0x11886c[_0xa92d('0x37')]||0x3;this[_0xa92d('0x38')]=_0x11886c[_0xa92d('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x11886c[_0xa92d('0x39')]||0x3;this[_0xa92d('0x3a')]=_0x11886c['dialAbandonedRetryFrequency']||0x96;this[_0xa92d('0x3b')]=_0x11886c[_0xa92d('0x3b')]||0x3;this[_0xa92d('0x3c')]=_0x11886c['dialMachineRetryFrequency']||0x96;this[_0xa92d('0x3d')]=_0x11886c['dialAgentRejectMaxRetry']||0x3;this[_0xa92d('0x3e')]=_0x11886c[_0xa92d('0x3e')]||0x96;this[_0xa92d('0x3f')]=_0x11886c['callAdditionalPhoneAfterMin']||0x3;this[_0xa92d('0x40')]=_0x11886c[_0xa92d('0x40')]||0x4;this[_0xa92d('0x41')]=_0x11886c[_0xa92d('0x41')]?_0x11886c['Trunk']:undefined;this[_0xa92d('0x42')]=_0x11886c[_0xa92d('0x42')]?_0x11886c[_0xa92d('0x42')]:undefined;this[_0xa92d('0x43')]=_0x11886c[_0xa92d('0x43')]||undefined;this[_0xa92d('0x44')]=_0x11886c[_0xa92d('0x44')]?_0x11886c[_0xa92d('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x11886c[_0xa92d('0x45')]||'DESC';this[_0xa92d('0x46')]=_0x11886c[_0xa92d('0x46')]||undefined;this['dialCutDigit']=_0x11886c[_0xa92d('0x47')]||undefined;this[_0xa92d('0x48')]=strategy[_0x11886c['strategy']]||_0xa92d('0x49');this[_0xa92d('0x4a')]=!![];this[_0xa92d('0x4b')]=_0x11886c[_0xa92d('0x4b')]||![];this[_0xa92d('0x4c')]=_0x11886c['dialAMDInitialSilence'];this[_0xa92d('0x4d')]=_0x11886c[_0xa92d('0x4d')];this[_0xa92d('0x4e')]=_0x11886c[_0xa92d('0x4e')];this[_0xa92d('0x4f')]=_0x11886c[_0xa92d('0x4f')];this[_0xa92d('0x50')]=_0x11886c['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x11886c[_0xa92d('0x51')];this['dialAMDMaximumNumberOfWords']=_0x11886c[_0xa92d('0x52')];this[_0xa92d('0x53')]=_0x11886c[_0xa92d('0x53')];this[_0xa92d('0x54')]=_0x11886c[_0xa92d('0x54')];this[_0xa92d('0x55')]=0x0;this[_0xa92d('0x56')]=0x0;this[_0xa92d('0x57')]=_0x11886c[_0xa92d('0x57')];this[_0xa92d('0x58')]=0x0;this[_0xa92d('0x59')]=0x0;this[_0xa92d('0x5a')]=0x0;this[_0xa92d('0x5b')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa92d('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa92d('0x5d')]=0x0;this[_0xa92d('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xa92d('0x5f')]=0x0;this[_0xa92d('0x60')]=0x0;this[_0xa92d('0x61')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xa92d('0x62')]=undefined;this[_0xa92d('0x63')]=undefined;this[_0xa92d('0x64')]=1.05;this[_0xa92d('0x65')]=0x0;this[_0xa92d('0x66')]=0x0;this[_0xa92d('0x67')]=0x0;this[_0xa92d('0x68')]=0x0;this[_0xa92d('0x69')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa92d('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xa92d('0x6b')]=_0x11886c[_0xa92d('0x6c')]||0x14;this[_0xa92d('0x6d')]=_0x11886c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xa92d('0x6e')]=0x0;this[_0xa92d('0x6f')]=0x0;this[_0xa92d('0x70')]=0x1;this[_0xa92d('0x71')]=0x0;this[_0xa92d('0x72')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa92d('0x73')]=0x0;this[_0xa92d('0x74')]=_0x11886c['dialRecallMeTimeout']||0x1e;this[_0xa92d('0x75')]=_0x11886c[_0xa92d('0x75')]||![];this[_0xa92d('0x76')]=!!_0x11886c[_0xa92d('0x76')]||![];this[_0xa92d('0x77')]=!!_0x11886c[_0xa92d('0x77')]||![];this[_0xa92d('0x78')]=_0x11886c[_0xa92d('0x78')]||undefined;this[_0xa92d('0x79')]=_0x11886c[_0xa92d('0x79')]||![];this['dialAgiAfterHangupAgent']=_0x11886c[_0xa92d('0x7a')]||![];this[_0xa92d('0xc')]=monitorFormat[_0x11886c['monitor_format']]?monitorFormat[_0x11886c[_0xa92d('0xc')]]:undefined;this['mandatoryDisposition']=_0x11886c['mandatoryDisposition']||![];this[_0xa92d('0x7b')]=_0x11886c[_0xa92d('0x7b')]?_0x11886c[_0xa92d('0x7b')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x9ea5=['gsm','roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49'];(function(_0x276167,_0x21086e){var _0x27a866=function(_0xa47f17){while(--_0xa47f17){_0x276167['push'](_0x276167['shift']());}};_0x27a866(++_0x21086e);}(_0x9ea5,0x156));var _0x59ea=function(_0x2817f5,_0x2528ee){_0x2817f5=_0x2817f5-0x0;var _0x5df3b4=_0x9ea5[_0x2817f5];return _0x5df3b4;};'use strict';var statusDesc=[_0x59ea('0x0'),_0x59ea('0x1'),'inuse','busy',_0x59ea('0x2'),_0x59ea('0x3'),_0x59ea('0x4'),_0x59ea('0x5'),_0x59ea('0x6')];var monitorFormat={'wav':_0x59ea('0x7'),'wav49':_0x59ea('0x8'),'gsm':_0x59ea('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x59ea('0xa')};function VoiceQueue(_0x2c6830){this['id']=_0x2c6830['id']||0x0;this[_0x59ea('0xb')]=_0x2c6830[_0x59ea('0xb')]||'';this[_0x59ea('0xc')]=_0x2c6830[_0x59ea('0xc')]||'';this[_0x59ea('0xd')]=_0x2c6830['type']||_0x59ea('0xe');this['waiting']=0x0;this[_0x59ea('0xf')]=0x0;this['total']=0x0;this[_0x59ea('0x10')]=0x0;this[_0x59ea('0x11')]=0x0;this[_0x59ea('0x12')]=0x0;this['sumBillable']=0x0;this[_0x59ea('0x13')]=0x0;this[_0x59ea('0x14')]=0x0;this[_0x59ea('0x15')]=0x0;this['available']=0x0;this['acw']=_0x2c6830[_0x59ea('0x16')]||![];this[_0x59ea('0x17')]=_0x2c6830[_0x59ea('0x17')]||0xa;this['autopause']=_0x2c6830[_0x59ea('0x18')]||'no';this[_0x59ea('0x19')]=!![];this['message']='';this[_0x59ea('0x1a')]=0x0;this[_0x59ea('0x1b')]=0x0;this[_0x59ea('0x1c')]=_0x2c6830[_0x59ea('0x1c')]||null;this['dialGlobalInterval']=_0x2c6830[_0x59ea('0x1d')]?_0x2c6830[_0x59ea('0x1d')]:null;this[_0x59ea('0x1e')]=_0x2c6830['dialActive'];this['dialMethod']=_0x2c6830[_0x59ea('0x1f')]||_0x59ea('0x20');this[_0x59ea('0x21')]=_0x2c6830[_0x59ea('0x21')]||0x0;this[_0x59ea('0x22')]=_0x2c6830['dialLimitQueue']||0x0;this[_0x59ea('0x23')]=_0x2c6830[_0x59ea('0x23')]||0x1;this[_0x59ea('0x24')]=_0x2c6830['dialPredictiveOptimization']||_0x59ea('0x25');this[_0x59ea('0x26')]=_0x2c6830[_0x59ea('0x26')]||0.03;this[_0x59ea('0x27')]=_0x2c6830[_0x59ea('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x2c6830['dialOriginateCallerIdName']||'anonymous';this[_0x59ea('0x28')]=_0x2c6830[_0x59ea('0x28')]||_0x59ea('0x29');this[_0x59ea('0x2a')]=_0x2c6830[_0x59ea('0x2a')]||0x1e;this['dialQueueOptions']=_0x2c6830['dialQueueOptions']||'tTxX';this[_0x59ea('0x2b')]=_0x2c6830[_0x59ea('0x2b')]||0x3;this[_0x59ea('0x2c')]=_0x2c6830[_0x59ea('0x2c')]||undefined;this[_0x59ea('0x2d')]=_0x2c6830[_0x59ea('0x2d')]||0x3;this[_0x59ea('0x2e')]=_0x2c6830[_0x59ea('0x2e')]||0x96;this[_0x59ea('0x2f')]=_0x2c6830[_0x59ea('0x2f')]||0x3;this[_0x59ea('0x30')]=_0x2c6830[_0x59ea('0x30')]||0x96;this[_0x59ea('0x31')]=_0x2c6830['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x2c6830['dialNoAnswerRetryFrequency']||0x96;this[_0x59ea('0x32')]=_0x2c6830[_0x59ea('0x32')]||0x3;this[_0x59ea('0x33')]=_0x2c6830['dialNoSuchNumberRetryFrequency']||0x96;this[_0x59ea('0x34')]=_0x2c6830[_0x59ea('0x34')]||0x3;this[_0x59ea('0x35')]=_0x2c6830[_0x59ea('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x2c6830[_0x59ea('0x36')]||0x3;this['dialAbandonedRetryFrequency']=_0x2c6830[_0x59ea('0x37')]||0x96;this[_0x59ea('0x38')]=_0x2c6830['dialMachineMaxRetry']||0x3;this[_0x59ea('0x39')]=_0x2c6830[_0x59ea('0x39')]||0x96;this['dialAgentRejectMaxRetry']=_0x2c6830[_0x59ea('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2c6830[_0x59ea('0x3b')]||0x96;this['callAdditionalPhoneAfterMin']=_0x2c6830['callAdditionalPhoneAfterMin']||0x3;this[_0x59ea('0x3c')]=_0x2c6830[_0x59ea('0x3c')]||0x4;this[_0x59ea('0x3d')]=_0x2c6830[_0x59ea('0x3d')]?_0x2c6830[_0x59ea('0x3d')]:undefined;this[_0x59ea('0x3e')]=_0x2c6830[_0x59ea('0x3e')]?_0x2c6830[_0x59ea('0x3e')]:undefined;this[_0x59ea('0x3f')]=_0x2c6830[_0x59ea('0x3f')]||undefined;this[_0x59ea('0x40')]=_0x2c6830['Interval']?_0x2c6830['Interval']:undefined;this[_0x59ea('0x41')]=_0x2c6830[_0x59ea('0x41')]||'DESC';this[_0x59ea('0x42')]=_0x2c6830[_0x59ea('0x42')]||undefined;this['dialCutDigit']=_0x2c6830['dialCutDigit']||undefined;this[_0x59ea('0x43')]=strategy[_0x2c6830[_0x59ea('0x43')]]||_0x59ea('0x44');this[_0x59ea('0x45')]=!![];this[_0x59ea('0x46')]=_0x2c6830[_0x59ea('0x46')]||![];this['dialAMDInitialSilence']=_0x2c6830[_0x59ea('0x47')];this[_0x59ea('0x48')]=_0x2c6830[_0x59ea('0x48')];this[_0x59ea('0x49')]=_0x2c6830[_0x59ea('0x49')];this['dialAMDTotalAnalysisTime']=_0x2c6830['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2c6830[_0x59ea('0x4a')];this[_0x59ea('0x4b')]=_0x2c6830['dialAMDBetweenWordsSilence'];this[_0x59ea('0x4c')]=_0x2c6830[_0x59ea('0x4c')];this[_0x59ea('0x4d')]=_0x2c6830['dialAMDSilenceThreshold'];this[_0x59ea('0x4e')]=_0x2c6830[_0x59ea('0x4e')];this[_0x59ea('0x4f')]=0x0;this[_0x59ea('0x50')]=0x0;this[_0x59ea('0x51')]=_0x2c6830[_0x59ea('0x51')];this[_0x59ea('0x52')]=0x0;this[_0x59ea('0x53')]=0x0;this[_0x59ea('0x54')]=0x0;this[_0x59ea('0x55')]=0x0;this[_0x59ea('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x59ea('0x57')]=0x0;this[_0x59ea('0x58')]=0x0;this[_0x59ea('0x59')]=0x0;this[_0x59ea('0x5a')]=0x0;this[_0x59ea('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x59ea('0x5c')]=0x0;this[_0x59ea('0x5d')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x59ea('0x5e')]=1.05;this[_0x59ea('0x5f')]=0x0;this[_0x59ea('0x60')]=0x0;this[_0x59ea('0x61')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x59ea('0x62')]=0x0;this[_0x59ea('0x63')]=0x0;this[_0x59ea('0x64')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2c6830[_0x59ea('0x65')]||0x14;this[_0x59ea('0x66')]=_0x2c6830[_0x59ea('0x65')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x59ea('0x67')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x59ea('0x68')]=0x0;this[_0x59ea('0x69')]=0x0;this[_0x59ea('0x6a')]=0x0;this[_0x59ea('0x6b')]=0x0;this['dialRecallMeTimeout']=_0x2c6830[_0x59ea('0x6c')]||0x1e;this[_0x59ea('0x6d')]=_0x2c6830[_0x59ea('0x6d')]||![];this['dialPreviewAutoRecallMe']=!!_0x2c6830[_0x59ea('0x6e')]||![];this[_0x59ea('0x6f')]=!!_0x2c6830['dialPreviewRecallmeReminder']||![];this[_0x59ea('0x70')]=_0x2c6830[_0x59ea('0x70')]||undefined;this[_0x59ea('0x71')]=_0x2c6830[_0x59ea('0x71')]||![];this[_0x59ea('0x72')]=_0x2c6830['dialAgiAfterHangupAgent']||![];this[_0x59ea('0xc')]=monitorFormat[_0x2c6830[_0x59ea('0xc')]]?monitorFormat[_0x2c6830[_0x59ea('0xc')]]:undefined;this['mandatoryDisposition']=_0x2c6830[_0x59ea('0x73')]||![];this[_0x59ea('0x74')]=_0x2c6830[_0x59ea('0x74')]?_0x2c6830[_0x59ea('0x74')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 161eae3..2b39eb0 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 _0xd557=['exports','name','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x36ec51,_0x5a86d0){var _0x3bde78=function(_0x17d136){while(--_0x17d136){_0x36ec51['push'](_0x36ec51['shift']());}};_0x3bde78(++_0x5a86d0);}(_0xd557,0x109));var _0x7d55=function(_0x48d7e5,_0x5f0419){_0x48d7e5=_0x48d7e5-0x0;var _0x3f2e64=_0xd557[_0x48d7e5];return _0x3f2e64;};'use strict';function VtigerAccount(_0x36adc9){this['id']=_0x36adc9['id']||0x0;this[_0x7d55('0x0')]=_0x36adc9['name']||'';this['username']=_0x36adc9['username']||'';this[_0x7d55('0x1')]=_0x36adc9[_0x7d55('0x1')]||'';this[_0x7d55('0x2')]=_0x36adc9[_0x7d55('0x2')]||'';this['serverUrl']=_0x36adc9[_0x7d55('0x3')]||'';this[_0x7d55('0x4')]=_0x36adc9[_0x7d55('0x4')]||{};}module[_0x7d55('0x5')]=VtigerAccount; \ No newline at end of file +var _0xc8a2=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x4a05c7,_0x4b29e3){var _0x519fe9=function(_0x153374){while(--_0x153374){_0x4a05c7['push'](_0x4a05c7['shift']());}};_0x519fe9(++_0x4b29e3);}(_0xc8a2,0x103));var _0x2c8a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xc8a2[_0xbd08b4];return _0x314f1e;};'use strict';function VtigerAccount(_0x4477f1){this['id']=_0x4477f1['id']||0x0;this[_0x2c8a('0x0')]=_0x4477f1[_0x2c8a('0x0')]||'';this[_0x2c8a('0x1')]=_0x4477f1[_0x2c8a('0x1')]||'';this[_0x2c8a('0x2')]=_0x4477f1[_0x2c8a('0x2')]||'';this[_0x2c8a('0x3')]=_0x4477f1['remoteUri']||'';this[_0x2c8a('0x4')]=_0x4477f1[_0x2c8a('0x4')]||'';this[_0x2c8a('0x5')]=_0x4477f1[_0x2c8a('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 69fe43a..dc108a0 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 _0x1050=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x3f6f78,_0x222d85){var _0x534963=function(_0x42a95b){while(--_0x42a95b){_0x3f6f78['push'](_0x3f6f78['shift']());}};_0x534963(++_0x222d85);}(_0x1050,0x14a));var _0x0105=function(_0x21a244,_0x20b3bd){_0x21a244=_0x21a244-0x0;var _0x2ffb02=_0x1050[_0x21a244];return _0x2ffb02;};'use strict';function ZendeskAccount(_0x234cdb){this['id']=_0x234cdb['id']||0x0;this['name']=_0x234cdb[_0x0105('0x0')]||'';this['username']=_0x234cdb[_0x0105('0x1')]||'';this[_0x0105('0x2')]=_0x234cdb['password']||'';this[_0x0105('0x3')]=_0x234cdb[_0x0105('0x3')]||'';this['remoteUri']=_0x234cdb[_0x0105('0x4')]||'';this[_0x0105('0x5')]=_0x234cdb[_0x0105('0x5')]||'';this[_0x0105('0x6')]=_0x234cdb[_0x0105('0x6')]||_0x0105('0x7');this['serverUrl']=_0x234cdb[_0x0105('0x8')]||'';this[_0x0105('0x9')]=_0x234cdb['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xa449=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','integrationTab'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xa449,0x186));var _0x9a44=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa449[_0x42cae2];return _0x5f256f;};'use strict';function ZendeskAccount(_0x25b33b){this['id']=_0x25b33b['id']||0x0;this[_0x9a44('0x0')]=_0x25b33b['name']||'';this['username']=_0x25b33b[_0x9a44('0x1')]||'';this[_0x9a44('0x2')]=_0x25b33b['password']||'';this['token']=_0x25b33b[_0x9a44('0x3')]||'';this[_0x9a44('0x4')]=_0x25b33b[_0x9a44('0x4')]||'';this['authType']=_0x25b33b['authType']||'';this['type']=_0x25b33b['type']||_0x9a44('0x5');this[_0x9a44('0x6')]=_0x25b33b[_0x9a44('0x6')]||'';this['Configurations']=_0x25b33b[_0x9a44('0x7')]||{};}module[_0x9a44('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 87142ba..bbc9de2 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 _0x2339=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','code'];(function(_0xf34c86,_0x23fe17){var _0x57019b=function(_0x973378){while(--_0x973378){_0xf34c86['push'](_0xf34c86['shift']());}};_0x57019b(++_0x23fe17);}(_0x2339,0x189));var _0x9233=function(_0x3a10b6,_0x3181f0){_0x3a10b6=_0x3a10b6-0x0;var _0x463dc3=_0x2339[_0x3a10b6];return _0x463dc3;};'use strict';function ZohoAccount(_0x20d3e6){this['id']=_0x20d3e6['id']||0x0;this['name']=_0x20d3e6[_0x9233('0x0')]||'';this[_0x9233('0x1')]=_0x20d3e6[_0x9233('0x1')]||'';this[_0x9233('0x2')]=_0x20d3e6[_0x9233('0x2')]||'';this[_0x9233('0x3')]=_0x20d3e6['zone']||'';this[_0x9233('0x4')]=_0x20d3e6['clientId']||'';this[_0x9233('0x5')]=_0x20d3e6[_0x9233('0x5')]||'';this['serverUrl']=_0x20d3e6['serverUrl']||'';this[_0x9233('0x6')]=_0x20d3e6[_0x9233('0x6')]||'';this[_0x9233('0x7')]=_0x20d3e6[_0x9233('0x7')]||'';this[_0x9233('0x8')]=_0x20d3e6['Configurations']||{};}module[_0x9233('0x9')]=ZohoAccount; \ No newline at end of file +var _0x945c=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x945c,0xc6));var _0xc945=function(_0x31e838,_0x2dd056){_0x31e838=_0x31e838-0x0;var _0x3c542b=_0x945c[_0x31e838];return _0x3c542b;};'use strict';function ZohoAccount(_0x2bdf3a){this['id']=_0x2bdf3a['id']||0x0;this[_0xc945('0x0')]=_0x2bdf3a[_0xc945('0x0')]||'';this[_0xc945('0x1')]=_0x2bdf3a['description']||'';this[_0xc945('0x2')]=_0x2bdf3a[_0xc945('0x2')]||'';this['zone']=_0x2bdf3a[_0xc945('0x3')]||'';this[_0xc945('0x4')]=_0x2bdf3a[_0xc945('0x4')]||'';this[_0xc945('0x5')]=_0x2bdf3a[_0xc945('0x5')]||'';this[_0xc945('0x6')]=_0x2bdf3a['serverUrl']||'';this[_0xc945('0x7')]=_0x2bdf3a['code']||'';this[_0xc945('0x8')]=_0x2bdf3a['refreshToken']||'';this[_0xc945('0x9')]=_0x2bdf3a[_0xc945('0x9')]||{};}module[_0xc945('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 feaca55..ec48192 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 _0xe820=['calleridname','Contact','lastName','phone','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','idContact','queue','name','type','dialAnswer','membername','Agent','format','SIP/%s'];(function(_0x183d5b,_0x4ed79d){var _0x413a3c=function(_0x530f29){while(--_0x530f29){_0x183d5b['push'](_0x183d5b['shift']());}};_0x413a3c(++_0x4ed79d);}(_0xe820,0xd2));var _0x0e82=function(_0x23e072,_0x2ae3d9){_0x23e072=_0x23e072-0x0;var _0x1178bc=_0xe820[_0x23e072];return _0x1178bc;};'use strict';var util=require(_0x0e82('0x0'));var _=require('lodash');var moment=require(_0x0e82('0x1'));function checkNameSurname(_0x4e6b50,_0x55bbeb,_0x2d4a09){var _0x7b2e95='';if(!_[_0x0e82('0x2')](_0x55bbeb)&&'string'===typeof _0x55bbeb){_0x7b2e95+=_0x55bbeb;}if(!_[_0x0e82('0x2')](_0x2d4a09)&&'string'===typeof _0x2d4a09){_0x7b2e95+='\x20'+_0x2d4a09;}if(_0x7b2e95!==''){return _0x7b2e95;}return _0x4e6b50;}function Action(_0x2cb88f,_0x105e3c,_0x69e27f,_0x328b32,_0x2a0f9b){this['uniqueid']=_0x69e27f||undefined;this[_0x0e82('0x3')]=_0x2cb88f['id'];this[_0x0e82('0x4')]=_0x105e3c[_0x0e82('0x5')];this[_0x0e82('0x6')]=_0x105e3c[_0x0e82('0x6')];this['campaigntype']=_0x0e82('0x4');this[_0x0e82('0x7')]=![];this[_0x0e82('0x8')]=_[_0x0e82('0x2')](_0x2cb88f[_0x0e82('0x9')])?undefined:_0x2cb88f[_0x0e82('0x9')][_0x0e82('0x5')];this['channelAgent']=this[_0x0e82('0x8')]?util[_0x0e82('0xa')](_0x0e82('0xb'),this[_0x0e82('0x8')]):_0x328b32||undefined;this[_0x0e82('0xc')]=checkNameSurname(_0x2cb88f[_0x0e82('0xd')]['phone'],_0x2cb88f[_0x0e82('0xd')]['firstName'],_0x2cb88f['Contact'][_0x0e82('0xe')]);this['active']=_0x2cb88f['active']||![];this['calleridnum']=_0x2cb88f[_0x0e82('0xf')];this['scheduledat']=_0x2cb88f['scheduledat'];this[_0x0e82('0x10')]=_0x2cb88f['countbusyretry']||0x0;this[_0x0e82('0x11')]=_0x2cb88f[_0x0e82('0x11')]||0x0;this[_0x0e82('0x12')]=_0x2cb88f[_0x0e82('0x12')]||0x0;this['countglobal']=(_0x2cb88f[_0x0e82('0x10')]||0x0)+(_0x2cb88f[_0x0e82('0x11')]||0x0)+(_0x2cb88f[_0x0e82('0x12')]||0x0)+(_0x2cb88f[_0x0e82('0x13')]||0x0)+(_0x2cb88f[_0x0e82('0x14')]||0x0)+(_0x2cb88f[_0x0e82('0x15')]||0x0)+(_0x2cb88f[_0x0e82('0x16')]||0x0)+(_0x2cb88f[_0x0e82('0x17')]||0x0);this[_0x0e82('0x13')]=_0x2cb88f[_0x0e82('0x13')]||0x0;this[_0x0e82('0x14')]=_0x2cb88f['countdropretry']||0x0;this['countabandonedretry']=_0x2cb88f[_0x0e82('0x15')]||0x0;this[_0x0e82('0x16')]=_0x2cb88f[_0x0e82('0x16')]||0x0;this[_0x0e82('0x17')]=_0x2cb88f[_0x0e82('0x17')]||0x0;this[_0x0e82('0x18')]=_0x2cb88f[_0x0e82('0x18')];this[_0x0e82('0x19')]=_0x2cb88f['callbackuniqueid'];this[_0x0e82('0x1a')]=_0x2cb88f[_0x0e82('0x1a')];this[_0x0e82('0x1b')]=_0x2cb88f[_0x0e82('0x1b')];this['ContactId']=_0x2cb88f[_0x0e82('0x1c')];this[_0x0e82('0x1d')]=_0x2cb88f[_0x0e82('0x1d')];this[_0x0e82('0x1e')]=_['isNil'](_0x2cb88f[_0x0e82('0x9')])?_0x2cb88f['UserId']:_0x2cb88f['Agent']['id'];this[_0x0e82('0x1f')]=_0x2cb88f[_0x0e82('0x1f')];this['originatecalleridnum']='';this[_0x0e82('0x20')]='';}Action[_0x0e82('0x21')][_0x0e82('0x22')]=function(){return util['format'](_0x0e82('0x23'),this[_0x0e82('0xc')],this['number']);};module[_0x0e82('0x24')]=Action; \ No newline at end of file +var _0x4137=['string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','firstName','Contact','active','phone','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil'];(function(_0x5634f8,_0xc6600c){var _0x15dcc4=function(_0x4d7ee1){while(--_0x4d7ee1){_0x5634f8['push'](_0x5634f8['shift']());}};_0x15dcc4(++_0xc6600c);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var util=require(_0x7413('0x0'));var _=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));function checkNameSurname(_0x4f372c,_0x392ebc,_0x410971){var _0x2e6df7='';if(!_[_0x7413('0x3')](_0x392ebc)&&_0x7413('0x4')===typeof _0x392ebc){_0x2e6df7+=_0x392ebc;}if(!_[_0x7413('0x3')](_0x410971)&&_0x7413('0x4')===typeof _0x410971){_0x2e6df7+='\x20'+_0x410971;}if(_0x2e6df7!==''){return _0x2e6df7;}return _0x4f372c;}function Action(_0x3bb181,_0x4fbade,_0xc808cd,_0x188d89,_0x5b39ac){this[_0x7413('0x5')]=_0xc808cd||undefined;this['idContact']=_0x3bb181['id'];this[_0x7413('0x6')]=_0x4fbade[_0x7413('0x7')];this['type']=_0x4fbade[_0x7413('0x8')];this[_0x7413('0x9')]='queue';this[_0x7413('0xa')]=![];this[_0x7413('0xb')]=_[_0x7413('0x3')](_0x3bb181[_0x7413('0xc')])?undefined:_0x3bb181[_0x7413('0xc')]['name'];this[_0x7413('0xd')]=this[_0x7413('0xb')]?util['format'](_0x7413('0xe'),this[_0x7413('0xb')]):_0x188d89||undefined;this[_0x7413('0xf')]=checkNameSurname(_0x3bb181['Contact']['phone'],_0x3bb181['Contact'][_0x7413('0x10')],_0x3bb181[_0x7413('0x11')]['lastName']);this[_0x7413('0x12')]=_0x3bb181[_0x7413('0x12')]||![];this['calleridnum']=_0x3bb181[_0x7413('0x13')];this['scheduledat']=_0x3bb181['scheduledat'];this[_0x7413('0x14')]=_0x3bb181['countbusyretry']||0x0;this[_0x7413('0x15')]=_0x3bb181['countcongestionretry']||0x0;this[_0x7413('0x16')]=_0x3bb181[_0x7413('0x16')]||0x0;this[_0x7413('0x17')]=(_0x3bb181[_0x7413('0x14')]||0x0)+(_0x3bb181[_0x7413('0x15')]||0x0)+(_0x3bb181[_0x7413('0x16')]||0x0)+(_0x3bb181['countnosuchnumberretry']||0x0)+(_0x3bb181[_0x7413('0x18')]||0x0)+(_0x3bb181[_0x7413('0x19')]||0x0)+(_0x3bb181[_0x7413('0x1a')]||0x0)+(_0x3bb181[_0x7413('0x1b')]||0x0);this['countnosuchnumberretry']=_0x3bb181[_0x7413('0x1c')]||0x0;this[_0x7413('0x18')]=_0x3bb181[_0x7413('0x18')]||0x0;this[_0x7413('0x19')]=_0x3bb181[_0x7413('0x19')]||0x0;this[_0x7413('0x1a')]=_0x3bb181[_0x7413('0x1a')]||0x0;this[_0x7413('0x1b')]=_0x3bb181['countagentrejectretry']||0x0;this['callback']=_0x3bb181[_0x7413('0x1d')];this['callbackuniqueid']=_0x3bb181[_0x7413('0x1e')];this[_0x7413('0x1f')]=_0x3bb181[_0x7413('0x1f')];this[_0x7413('0x20')]=_0x3bb181[_0x7413('0x20')];this[_0x7413('0x21')]=_0x3bb181[_0x7413('0x21')];this[_0x7413('0x22')]=_0x3bb181[_0x7413('0x22')];this['UserId']=_['isNil'](_0x3bb181[_0x7413('0xc')])?_0x3bb181['UserId']:_0x3bb181[_0x7413('0xc')]['id'];this[_0x7413('0x23')]=_0x3bb181[_0x7413('0x23')];this['originatecalleridnum']='';this[_0x7413('0x24')]='';}Action[_0x7413('0x25')][_0x7413('0x26')]=function(){return util[_0x7413('0x27')](_0x7413('0x28'),this[_0x7413('0xf')],this['number']);};module[_0x7413('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index be16014..91b0978 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 _0x7409=['amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','trunks','SIP/%s','status','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','trim','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','clone','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','syncDialEnd','destuniqueid','addVariable','filterKey','keys','variable','value','[syncVarSet][Preview]','transfererlinkedid','exports','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','localhost','enqueue','finally','sequence','clockClearZombieChannels','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','outbound','name','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','prototype','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','actions','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','agents','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','dialActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','dialAnswer','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x7409,0x6e));var _0x9740=function(_0x37b07c,_0x5941a1){_0x37b07c=_0x37b07c-0x0;var _0x264672=_0x7409[_0x37b07c];return _0x264672;};'use strict';var util=require(_0x9740('0x0'));var _=require(_0x9740('0x1'));var uuid=require('uuid');var moment=require(_0x9740('0x2'));var md5=require(_0x9740('0x3'));var Redis=require(_0x9740('0x4'));var config=require(_0x9740('0x5'));var logger=require(_0x9740('0x6'))(_0x9740('0x7'));var loggerAction=require(_0x9740('0x6'))(_0x9740('0x8'));var ami=require(_0x9740('0x9'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x9740('0xa'));var Action=require(_0x9740('0xb'));var ut=require(_0x9740('0xc'));config['redis']=_[_0x9740('0xd')](config[_0x9740('0xe')],{'host':_0x9740('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9740('0xe')]));var Sequence=function(){};Sequence['prototype'][_0x9740('0x10')]=function(_0xc27c18){this['tail']=this['tail']?this['tail'][_0x9740('0x11')](_0xc27c18):_0xc27c18();};function Preview(_0x3bc357){this[_0x9740('0x12')]=new Sequence();this['campaignsPreview']=_0x3bc357['voiceQueues'];this['trunks']=_0x3bc357['trunks'];this['actions']={};this['agents']=_0x3bc357['agents'];this[_0x9740('0x13')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x9740('0x14')](this));ami['on']('hangup',this[_0x9740('0x15')][_0x9740('0x14')](this));ami['on'](_0x9740('0x16'),this[_0x9740('0x17')]['bind'](this));ami['on'](_0x9740('0x18'),this['syncDialEnd'][_0x9740('0x14')](this));ami['on'](_0x9740('0x19'),this[_0x9740('0x1a')][_0x9740('0x14')](this));ami['on'](_0x9740('0x1b'),this[_0x9740('0x1c')][_0x9740('0x14')](this));ami['on'](_0x9740('0x1d'),this[_0x9740('0x1e')]['bind'](this));ami['on'](_0x9740('0x1f'),this[_0x9740('0x20')][_0x9740('0x14')](this));this[_0x9740('0x21')](this[_0x9740('0x22')]);}function emit(_0xdf62fc,_0x3a785c,_0x146070){io['to'](_0xdf62fc)['emit'](_0x3a785c,_0x146070);}function emitCampaignPreview(_0x351f5c){if(_0x351f5c['type']===_0x9740('0x23')){var _0x46d768={'id':_0x351f5c['id'],'name':_0x351f5c[_0x9740('0x24')],'strategy':_0x351f5c[_0x9740('0x25')],'answered':_0x351f5c[_0x9740('0x26')],'available':_0x351f5c[_0x9740('0x27')],'loggedIn':_0x351f5c['loggedIn'],'pTalking':_0x351f5c[_0x9740('0x28')],'sumBillable':_0x351f5c[_0x9740('0x29')],'sumDuration':_0x351f5c[_0x9740('0x2a')],'sumHoldTime':_0x351f5c[_0x9740('0x2b')]||0x0,'talking':_0x351f5c[_0x9740('0x2c')],'total':_0x351f5c[_0x9740('0x2d')],'type':_0x351f5c[_0x9740('0x2e')],'unmanaged':_0x351f5c[_0x9740('0x2f')],'abandoned':_0x351f5c[_0x9740('0x30')],'waiting':_0x351f5c['waiting'],'loggedInDb':_0x351f5c[_0x9740('0x31')],'dialActive':_0x351f5c['dialActive'],'dialMethod':_0x351f5c['dialMethod'],'dialOriginateCallerIdName':_0x351f5c['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x351f5c['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x351f5c[_0x9740('0x32')],'dialPrefix':_0x351f5c[_0x9740('0x33')],'outboundAnswerAgiCallsDay':_0x351f5c[_0x9740('0x34')],'outboundAnswerCallsDay':_0x351f5c['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x351f5c[_0x9740('0x35')],'outboundBusyCallsDay':_0x351f5c[_0x9740('0x36')],'outboundCongestionCallsDay':_0x351f5c[_0x9740('0x37')],'outboundDropCallsDayACS':_0x351f5c[_0x9740('0x38')],'outboundDropCallsDayCallersExit':_0x351f5c['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x351f5c[_0x9740('0x39')],'outboundNoAnswerCallsDay':_0x351f5c[_0x9740('0x3a')],'outboundNoSuchCallsDay':_0x351f5c[_0x9740('0x3b')],'outboundOriginateFailureCallsDay':_0x351f5c['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x351f5c[_0x9740('0x3c')],'outboundRejectCallsDay':_0x351f5c[_0x9740('0x3d')],'outboundUnknownCallsDay':_0x351f5c[_0x9740('0x3e')],'outboundAbandonedCallsDay':_0x351f5c[_0x9740('0x3f')],'predictiveIntervalAnsweredCalls':_0x351f5c[_0x9740('0x40')],'predictiveIntervalAvgHoldtime':_0x351f5c[_0x9740('0x41')],'predictiveIntervalAvgTalktime':_0x351f5c[_0x9740('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x351f5c[_0x9740('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x351f5c[_0x9740('0x44')],'predictiveIntervalErlangCalls':_0x351f5c[_0x9740('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x351f5c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x351f5c[_0x9740('0x46')],'predictiveIntervalMultiplicativeFactor':_0x351f5c[_0x9740('0x47')],'predictiveIntervalPauses':_0x351f5c[_0x9740('0x48')],'predictiveIntervalAvailable':_0x351f5c[_0x9740('0x49')],'predictiveIntervalTotalCalls':_0x351f5c[_0x9740('0x4a')],'message':_0x351f5c[_0x9740('0x4b')],'originated':_0x351f5c['originated'],'erlangCalls':_0x351f5c[_0x9740('0x4c')],'erlangCallToSecond':_0x351f5c['erlangCallToSecond'],'erlangAbandonmentRate':_0x351f5c['erlangAbandonmentRate'],'erlangBusyFactor':_0x351f5c[_0x9740('0x4d')],'startPredictive':_0x351f5c[_0x9740('0x4e')],'startProgressive':_0x351f5c[_0x9740('0x4f')]};if(_0x351f5c[_0x9740('0x50')]){_0x46d768[_0x9740('0x50')]={'id':_0x351f5c['Trunk']['id'],'name':_0x351f5c[_0x9740('0x50')][_0x9740('0x24')],'active':_0x351f5c[_0x9740('0x50')][_0x9740('0x51')],'callerid':_0x351f5c[_0x9740('0x50')][_0x9740('0x52')]};}if(_0x351f5c[_0x9740('0x53')]){_0x46d768[_0x9740('0x53')]={'id':_0x351f5c[_0x9740('0x53')]['id'],'name':_0x351f5c[_0x9740('0x53')][_0x9740('0x24')]};}var _0x1c4edc=md5(JSON[_0x9740('0x54')](_0x46d768));if(_0x351f5c[_0x9740('0x3')]!==_0x1c4edc){_0x351f5c[_0x9740('0x3')]=_0x1c4edc;emit(util[_0x9740('0x55')](_0x9740('0x56'),_0x46d768[_0x9740('0x24')]),_0x9740('0x57'),_0x46d768);}}}function emitVoiceQueueChannelRemove(_0xb9c606){logger[_0x9740('0x58')](_0x9740('0x59'),JSON['stringify'](_0xb9c606));emit(util[_0x9740('0x55')]('voice:queue:%s',_0xb9c606[_0x9740('0x24')]),_0x9740('0x5a'),_0xb9c606);io[_0x9740('0x5b')](_0x9740('0x5c'),_0xb9c606);}function notSendMessagesQueue(_0x3a4e3b){if(_0x3a4e3b[_0x9740('0x5d')]){if(_0x3a4e3b[_0x9740('0x5e')]===0x0&&_0x3a4e3b['pTalking']===0x0){_0x3a4e3b['sendMessageOneNotActive']=![];_0x3a4e3b['available']=0x0;_0x3a4e3b[_0x9740('0x5f')]=0x0;_0x3a4e3b[_0x9740('0x4b')]=_0x9740('0x60');ut[_0x9740('0x61')](_0x9740('0x62'),_0x3a4e3b['name']+_0x9740('0x63'));}else{_0x3a4e3b[_0x9740('0x4b')]=_0x9740('0x64');ut[_0x9740('0x61')](_0x9740('0x62'),_0x3a4e3b[_0x9740('0x24')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x3a4e3b);}}Preview[_0x9740('0x65')][_0x9740('0x21')]=function(){var _0x967c45=this;setInterval(function(){_0x967c45['syncCampaigns']();},0x7cf);};Preview['prototype'][_0x9740('0x66')]=function(){var _0x199cd3=this[_0x9740('0x22')];this['clockClearZombieChannels']+=0x1;for(var _0x173df4 in _0x199cd3){if(_0x199cd3[_0x9740('0x67')](_0x173df4)&&(_0x199cd3[_0x173df4][_0x9740('0x68')]==='preview'||_0x199cd3[_0x173df4][_0x9740('0x68')]===_0x9740('0x69'))&&_0x199cd3[_0x173df4][_0x9740('0x2e')]===_0x9740('0x23')){if(this[_0x9740('0x13')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x9740('0x6a')]();}}if(_0x199cd3[_0x9740('0x67')](_0x173df4)&&_0x199cd3[_0x173df4][_0x9740('0x68')]==='preview'&&_0x199cd3[_0x173df4][_0x9740('0x2e')]===_0x9740('0x23')){if(_0x199cd3[_0x173df4]['dialActive']){this[_0x9740('0x6b')](_0x199cd3[_0x173df4]);if(_0x199cd3[_0x173df4][_0x9740('0x6c')])this[_0x9740('0x6d')](_0x199cd3[_0x173df4]);}else{notSendMessagesQueue(_0x199cd3[_0x173df4]);}}}};Preview[_0x9740('0x65')]['clearZombieChannel']=function(_0x7ed308){var _0x41af41=this;this[_0x9740('0x12')][_0x9740('0x10')](function(){if(!_[_0x9740('0x6e')](_0x41af41[_0x9740('0x6f')][_0x7ed308])){loggerAction['info'](_0x9740('0x70'),_0x7ed308,_0x9740('0x71'),_0x41af41[_0x9740('0x6f')][_0x7ed308][_0x9740('0x72')],'originated:\x20',JSON[_0x9740('0x54')](_0x41af41[_0x9740('0x22')][_0x41af41['actions'][_0x7ed308][_0x9740('0x72')]][_0x9740('0x5e')]),_0x9740('0x73'),JSON['stringify'](_0x41af41[_0x9740('0x22')][_0x41af41[_0x9740('0x6f')][_0x7ed308][_0x9740('0x72')]][_0x9740('0x28')]),JSON[_0x9740('0x54')](_0x41af41[_0x9740('0x6f')][_0x7ed308]['dialAnswer']),JSON[_0x9740('0x54')](_[_0x9740('0x74')](_0x41af41[_0x9740('0x6f')][_0x7ed308],[_0x9740('0x75'),'UserId',_0x9740('0x76'),_0x9740('0x77')])));return ami[_0x9740('0x78')]({'action':'status','channel':_0x41af41['actions'][_0x7ed308][_0x9740('0x79')]})[_0x9740('0x7a')](function(_0x444800){if(_0x444800['message']===_0x9740('0x7b')){setTimeout(function(){if(_0x41af41['actions'][_0x7ed308]){ut[_0x9740('0x7c')](_0x41af41[_0x9740('0x22')][_0x41af41[_0x9740('0x6f')][_0x7ed308][_0x9740('0x72')]],_0x9740('0x7d'));if(_0x41af41[_0x9740('0x6f')][_0x7ed308]['dialAnswer']===!![]){ut[_0x9740('0x7e')](_0x41af41[_0x9740('0x22')][_0x41af41[_0x9740('0x6f')][_0x7ed308][_0x9740('0x72')]],_0x9740('0x7d'));ut['loggerError'](_0x9740('0x7f')+_0x7ed308,_0x41af41['actions'][_0x7ed308]['queue']);}ut['loggerError'](_0x9740('0x80')+_0x7ed308,_0x41af41[_0x9740('0x6f')][_0x7ed308][_0x9740('0x72')]);delete _0x41af41[_0x9740('0x6f')][_0x7ed308];}},0x2328);}});}});};Preview[_0x9740('0x65')][_0x9740('0x6a')]=function(){var _0x38e2a5=this;loggerAction['info'](_0x9740('0x81'),_[_0x9740('0x82')](this[_0x9740('0x6f')]));for(var _0x24be33 in this[_0x9740('0x6f')]){if(_0x38e2a5[_0x9740('0x6f')][_0x9740('0x67')](_0x24be33)){_0x38e2a5['clearZombieChannel'](_0x24be33);}}};Preview[_0x9740('0x65')][_0x9740('0x6d')]=function(_0x5163f8){var _0x23d1aa=this;rpcDb['getContactRecallMe'](_0x5163f8['id'],ut[_0x9740('0x83')](this[_0x9740('0x84')]))[_0x9740('0x85')](function(_0x369250){if(!_[_0x9740('0x6e')](_0x369250)){for(var _0x5be35a=0x0;_0x5be35a<_0x369250[_0x9740('0x86')];_0x5be35a+=0x1){if(ut[_0x9740('0x87')](_0x369250[_0x5be35a][_0x9740('0x88')])<_0x5163f8[_0x9740('0x89')]*0x3c){if(_0x369250[_0x5be35a][_0x9740('0x8a')]&&!_0x369250[_0x5be35a][_0x9740('0x8a')]['voicePause']){_0x23d1aa[_0x9740('0x8b')](_0x369250[_0x5be35a]['id'])[_0x9740('0x85')](ut[_0x9740('0x8c')](_0x9740('0x8d')))[_0x9740('0x7a')](ut[_0x9740('0x8c')](_0x9740('0x8d')));}else{rpcDb[_0x9740('0x8e')](_0x369250[_0x5be35a]['id']);}}else{var _0x422919=new Action(_0x369250[_0x5be35a],_0x5163f8);_0x422919[_0x9740('0x8f')]=moment()[_0x9740('0x55')](_0x9740('0x90'));_0x5163f8[_0x9740('0x3c')]+=0x1;ut[_0x9740('0x91')](_0x422919,0x17,'RecallInQueue');if(_0x5163f8['dialRecallInQueue']){rpcDb[_0x9740('0x92')](ut[_0x9740('0x93')](_0x369250[_0x5be35a]));rpcDb[_0x9740('0x94')](_0x422919,_0x9740('0x95'));}else{ut[_0x9740('0x91')](_0x422919,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x422919,_0x9740('0x96'));rpcDb[_0x9740('0x97')](_0x422919,'[HistoryRecallClose]');}}}}})[_0x9740('0x7a')](ut[_0x9740('0x8c')](_0x9740('0x98')));};Preview['prototype'][_0x9740('0x6b')]=function(_0x50c860){_0x50c860[_0x9740('0x5d')]=!![];if(ut['IsNotLoggedIn'](_0x50c860[_0x9740('0x99')])){_0x50c860['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x50c860[_0x9740('0x9a')])){_0x50c860[_0x9740('0x4b')]='NOT_ACTIVE';}else if(!this[_0x9740('0x9b')](_0x50c860[_0x9740('0x50')])){if(!this[_0x9740('0x9b')](_0x50c860[_0x9740('0x9c')])){_0x50c860[_0x9740('0x4b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x50c860[_0x9740('0x4b')]=_0x9740('0x9d');}}else{_0x50c860['message']=_0x9740('0x9d');}emitCampaignPreview(_0x50c860);};Preview[_0x9740('0x65')][_0x9740('0x9e')]=function(_0x5a72f3,_0x106cf1,_0x5bb454){var _0x39a574=this;var _0x38bf75=this[_0x9740('0x6f')][_0x106cf1];var _0x1952dd=this[_0x9740('0x22')][_0x38bf75[_0x9740('0x72')]];var _0x3c0128;var _0x5192f3=![];var _0x2e79dd=0x2;var _0x4518fc=0x3;if(_0x1952dd){switch(_0x5bb454){case'1':_0x1952dd[_0x9740('0x3b')]+=0x1;_0x38bf75[_0x9740('0x9f')]+=0x1;_0x38bf75[_0x9740('0xa0')]=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x0,'NoSuchNumber');ami[_0x9740('0x5b')](_0x9740('0xa2'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xa4')));rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xa5'));_0x39a574[_0x9740('0xa6')](_0x38bf75,'0',_0x1952dd)[_0x9740('0x85')](function(_0x539b68){_0x5192f3=_0x539b68[_0x9740('0xa7')]==0x1;_0x2e79dd=_0x1952dd[_0x9740('0xa8')];_0x4518fc=_0x1952dd[_0x9740('0xa9')];if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0xf,'Global');rpcDb[_0x9740('0x97')](_0x3c0128,_0x9740('0xac'));}else{if(_0x38bf75[_0x9740('0x9f')]>=_0x1952dd['dialNoSuchNumberMaxRetry']){rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xac'));}else{rpcDb[_0x9740('0xad')](ut[_0x9740('0xae')](_0x38bf75,'countnosuchnumberretry',_0x1952dd['dialNoSuchNumberRetryFrequency']),_0x38bf75['unlockAgent'],_0x38bf75[_0x9740('0xaf')]);}}delete this['actions'][_0x5a72f3[_0x9740('0xb0')]];}else{_0x38bf75['countnosuchnumberretry']++;logger['info'](_0x9740('0xb1'),_0x38bf75[_0x9740('0x9f')]);logger['info']('id',_0x38bf75[_0x9740('0xb2')]);_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75['idContact'],'field':{'countnosuchnumberretry':_0x38bf75[_0x9740('0x9f')]}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case _0x9740('0xb5'):var _0x120754=moment()[_0x9740('0x55')](_0x9740('0x90'));_0x38bf75[_0x9740('0xb6')]=_0x120754;_0x38bf75['answertime']=_0x120754;_0x38bf75[_0x9740('0xb7')]=!![];_0x1952dd[_0x9740('0x28')]+=0x1;logger[_0x9740('0x58')](_0x9740('0xb8'),_0x38bf75[_0x9740('0xb9')],_0x9740('0xba'),_0x1952dd['name'],_0x9740('0x73'),_0x1952dd[_0x9740('0x28')]);ami[_0x9740('0x5b')](_0x9740('0xbb'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xbc'),this[_0x9740('0x22')][_0x38bf75['queue']]));if(_0x1952dd[_0x9740('0xbd')]){ami[_0x9740('0x5b')](_0x9740('0xbe'),ut['buildAcw'](_0x38bf75));}break;case'16':ami[_0x9740('0x5b')](_0x9740('0xbf'),ut['buildObj'](_0x38bf75,_0x9740('0xc0'),this['campaignsPreview'][_0x38bf75['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x38bf75,_0x9740('0xc0')));_0x1952dd[_0x9740('0xc1')]+=0x1;_0x1952dd[_0x9740('0x2d')]+=0x1;_0x1952dd['answered']+=0x1;ut[_0x9740('0x7e')](_0x1952dd,'[16]');_0x38bf75[_0x9740('0xa0')]=ut['totalGlobal'](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x4,_0x9740('0xc2'));rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xc3'));rpcDb[_0x9740('0x97')](_0x38bf75,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x9740('0xc4')](_0x38bf75);_0x1952dd[_0x9740('0x2a')]+=_0x38bf75['talktime'];_0x1952dd['sumBillable']+=_0x38bf75[_0x9740('0xc5')];logger[_0x9740('0x58')](_0x9740('0xc6'),_0x38bf75[_0x9740('0xb9')],_0x9740('0xba'),_0x1952dd[_0x9740('0x24')],_0x9740('0x73'),_0x1952dd[_0x9740('0x28')]);delete this[_0x9740('0x6f')][_0x5a72f3[_0x9740('0xb0')]];break;case _0x9740('0xc7'):_0x1952dd[_0x9740('0x36')]+=0x1;_0x38bf75[_0x9740('0xc8')]+=0x1;_0x38bf75[_0x9740('0xa0')]=ut['totalGlobal'](_0x38bf75);ut['logCustomer'](_0x38bf75,0x5,_0x9740('0xc9'));_0x2e79dd=_0x1952dd[_0x9740('0xca')];_0x4518fc=_0x1952dd[_0x9740('0xa9')];ami[_0x9740('0x5b')](_0x9740('0xcb'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xcc')));rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xcd'));_0x39a574[_0x9740('0xa6')](_0x38bf75,'5',_0x1952dd)['then'](function(_0x1b2ddd){_0x5192f3=_0x1b2ddd[_0x9740('0xa7')]==0x1;if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x38bf75[_0x9740('0xc8')]>=_0x1952dd[_0x9740('0xcf')]){rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xcd'));}else{rpcDb[_0x9740('0xad')](ut[_0x9740('0xae')](_0x38bf75,'countbusyretry',_0x1952dd['dialBusyRetryFrequency']),_0x38bf75[_0x9740('0xd0')],_0x38bf75[_0x9740('0xaf')]);}}}else{_0x38bf75['countbusyretry']++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75['idContact'],'field':{'countbusyretry':_0x38bf75[_0x9740('0xc8')]}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case _0x9740('0xd1'):_0x1952dd['outboundNoAnswerCallsDay']+=0x1;_0x38bf75[_0x9740('0xd2')]+=0x1;_0x38bf75['countglobal']=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x3,_0x9740('0xd3'));_0x2e79dd=_0x1952dd['dialNoAnswerRetryFrequency'];_0x4518fc=_0x1952dd[_0x9740('0xa9')];var _0x3f65f1=ut['buildNoAnswerEventPayload'](_0x38bf75,_0x1952dd);ami[_0x9740('0x5b')]('custom:agentnoanswer',_0x3f65f1);rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xd4'));_0x39a574['verifyAdditionalPhones'](_0x38bf75,'3',_0x1952dd)['then'](function(_0x41e785){_0x5192f3=_0x41e785[_0x9740('0xa7')]==0x1;if(!_0x5192f3){if(ut['totalGlobal'](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x38bf75[_0x9740('0xd2')]>=_0x1952dd['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x38bf75,_0x9740('0xd4'));}else{rpcDb[_0x9740('0xad')](ut[_0x9740('0xae')](_0x38bf75,'countnoanswerretry',_0x1952dd['dialNoAnswerRetryFrequency']),_0x38bf75[_0x9740('0xd0')],_0x38bf75['activeContact']);}}}else{_0x38bf75[_0x9740('0xd2')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75[_0x9740('0xb2')],'field':{'countnoanswerretry':_0x38bf75[_0x9740('0xd2')]}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case'CONGESTION':_0x1952dd[_0x9740('0x37')]+=0x1;_0x38bf75[_0x9740('0xd5')]+=0x1;_0x38bf75[_0x9740('0xa0')]=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x8,_0x9740('0xd6'));_0x2e79dd=_0x1952dd[_0x9740('0xd7')];_0x4518fc=_0x1952dd[_0x9740('0xa9')];ami[_0x9740('0x5b')](_0x9740('0xd8'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xd9')));rpcDb[_0x9740('0x94')](_0x38bf75,'[callProgressDetectingCustomer][logCongestion]');_0x39a574['verifyAdditionalPhones'](_0x38bf75,'8',_0x1952dd)['then'](function(_0x491fe9){_0x5192f3=_0x491fe9['additional']==0x1;if(!_0x5192f3){if(ut['totalGlobal'](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut['cloneAction'](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x38bf75[_0x9740('0xd5')]>=_0x1952dd['dialCongestionMaxRetry']){rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xda'));}else{rpcDb[_0x9740('0xad')](ut[_0x9740('0xae')](_0x38bf75,_0x9740('0xd5'),_0x1952dd[_0x9740('0xca')]),_0x38bf75[_0x9740('0xd0')],_0x38bf75[_0x9740('0xaf')]);}}}else{_0x38bf75[_0x9740('0xd5')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75[_0x9740('0xb2')],'field':{'countcongestionretry':_0x38bf75['countcongestionretry']}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case _0x9740('0xdb'):_0x1952dd[_0x9740('0x3d')]+=0x1;_0x38bf75['countagentrejectretry']+=0x1;_0x38bf75[_0x9740('0xa0')]=ut['totalGlobal'](_0x38bf75);ut['logCustomer'](_0x38bf75,0x14,'AgentReject');_0x2e79dd=_0x1952dd[_0x9740('0xdc')];_0x4518fc=_0x1952dd[_0x9740('0xa9')];ami['emit'](_0x9740('0xdd'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xde')));rpcDb[_0x9740('0x94')](_0x38bf75,'[syncHangupRequest][logAgentReject]');_0x39a574[_0x9740('0xa6')](_0x38bf75,'20',_0x1952dd)[_0x9740('0x85')](function(_0x58a6db){_0x5192f3=_0x58a6db['additional']==0x1;if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd['dialGlobalMaxRetry']){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0x14,_0x9740('0xdf'));rpcDb['createCustomerFinal'](_0x3c0128,_0x9740('0xe0'));}else{if(_0x38bf75[_0x9740('0xe1')]>=_0x1952dd[_0x9740('0xe2')]){rpcDb[_0x9740('0x97')](_0x38bf75,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x9740('0xad')](ut[_0x9740('0xae')](_0x38bf75,'countagentrejectretry',_0x1952dd[_0x9740('0xdc')]),_0x38bf75[_0x9740('0xd0')],_0x38bf75[_0x9740('0xaf')]);}}}else{_0x38bf75[_0x9740('0xd2')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75['idContact'],'field':{'countnoanswerretry':_0x38bf75[_0x9740('0xd2')]}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case _0x9740('0xe3'):_0x1952dd[_0x9740('0x3f')]+=0x1;_0x38bf75['countabandonedretry']+=0x1;_0x38bf75['countglobal']=ut[_0x9740('0xa1')](_0x38bf75);ut['logCustomer'](_0x38bf75,0xb,_0x9740('0xe4'));rpcDb['createCustomerHistory'](_0x38bf75,_0x9740('0xe5'));_0x39a574[_0x9740('0xa6')](_0x38bf75,'11',_0x1952dd)[_0x9740('0x85')](function(_0x2f5eb8){_0x5192f3=_0x2f5eb8[_0x9740('0xa7')]==0x1;if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,_0x9740('0xe5'));}else{if(_0x38bf75[_0x9740('0xe6')]>=_0x1952dd[_0x9740('0xe7')]){rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xe5'));}else{rpcDb[_0x9740('0xad')](ut['scheduledAt'](_0x38bf75,_0x9740('0xe8'),_0x1952dd[_0x9740('0xe9')]),_0x38bf75[_0x9740('0xd0')],_0x38bf75[_0x9740('0xaf')]);}}}else{_0x38bf75[_0x9740('0xd2')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75['idContact'],'field':{'countnoanswerretry':_0x38bf75[_0x9740('0xd2')]}})[_0x9740('0x85')](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});break;case'18':_0x1952dd[_0x9740('0x3e')]+=0x1;_0x38bf75[_0x9740('0xea')]+=0x1;_0x38bf75[_0x9740('0xa0')]=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x12,_0x5a72f3[_0x9740('0xeb')]||_0x5a72f3[_0x9740('0xec')]);ami[_0x9740('0x5b')](_0x9740('0xed'),ut[_0x9740('0xa3')](_0x38bf75,'amd'));rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xee'));_0x39a574[_0x9740('0xa6')](_0x38bf75,'18',_0x1952dd)['then'](function(_0xda3070){_0x5192f3=_0xda3070[_0x9740('0xa7')]==0x1;if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0x12,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,_0x9740('0xee'));}else{rpcDb['createCustomerFinal'](_0x38bf75,_0x9740('0xee'));}}else{_0x38bf75[_0x9740('0xd2')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75[_0x9740('0xb2')],'field':{'countnoanswerretry':_0x38bf75[_0x9740('0xd2')]}})['then'](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});});}});delete this[_0x9740('0x6f')][_0x5a72f3[_0x9740('0xb0')]];break;case'19':_0x1952dd[_0x9740('0x3e')]+=0x1;_0x38bf75[_0x9740('0xa0')]=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0x13,_0x5a72f3['cause-txt']||_0x5a72f3[_0x9740('0xec')]);ami[_0x9740('0x5b')](_0x9740('0xed'),ut[_0x9740('0xa3')](_0x38bf75,_0x9740('0xef')));rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xf0'));_0x39a574['verifyAdditionalPhones'](_0x38bf75,'18',_0x1952dd)[_0x9740('0x85')](function(_0x2ab384){_0x5192f3=_0x2ab384['additional']==0x1;if(!_0x5192f3){if(ut[_0x9740('0xa1')](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut[_0x9740('0xab')](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,_0x9740('0xf0'));}else{rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xf0'));}}else{_0x38bf75[_0x9740('0xd2')]++;_0x39a574[_0x9740('0xb3')]({'id':_0x38bf75['idContact'],'field':{'countnoanswerretry':_0x38bf75[_0x9740('0xd2')]}})['then'](function(){_0x39a574[_0x9740('0xb4')](_0x38bf75,_0x2e79dd,_0x4518fc)['then'](function(){});});}});delete this[_0x9740('0x6f')][_0x5a72f3[_0x9740('0xb0')]];break;default:if(_0x38bf75['dialAnswer']){ut[_0x9740('0x7e')](_0x1952dd,_0x9740('0xf1'));ut['loggerError'](_0x9740('0xf2')+_0x1952dd[_0x9740('0x24')],_0x5a72f3);}_0x1952dd['outboundUnknownCallsDay']+=0x1;_0x38bf75[_0x9740('0xa0')]=ut[_0x9740('0xa1')](_0x38bf75);ut[_0x9740('0x91')](_0x38bf75,0xc,_0x5a72f3[_0x9740('0xeb')]||_0x5a72f3[_0x9740('0xec')]);_0x2e79dd=_0x1952dd[_0x9740('0xdc')];_0x4518fc=_0x1952dd[_0x9740('0xa9')];rpcDb[_0x9740('0x94')](_0x38bf75,_0x9740('0xf3'));_0x39a574[_0x9740('0xa6')](_0x38bf75,'20',_0x1952dd)[_0x9740('0x85')](function(_0x5e4a0d){_0x5192f3=_0x5e4a0d[_0x9740('0xa7')]==0x1;if(!_0x5192f3){if(ut['totalGlobal'](_0x38bf75)>=_0x1952dd[_0x9740('0xaa')]){_0x3c0128=ut['cloneAction'](_0x38bf75,0xf,_0x9740('0xce'));rpcDb[_0x9740('0x97')](_0x3c0128,_0x9740('0xf4'));}else{rpcDb[_0x9740('0x97')](_0x38bf75,_0x9740('0xf4'));}delete this[_0x9740('0x6f')][_0x5a72f3['linkedid']];}else{_0x39a574['swapAdditionalPhones'](_0x38bf75,_0x2e79dd,_0x4518fc)[_0x9740('0x85')](function(){});}});}if(!(_0x38bf75['dialAnswer']&&_0x5bb454==='16')){ut['updateOriginated'](_0x1952dd,_0x9740('0xf5'));logger[_0x9740('0x58')]('[originated][decrement][callProgressDetectingCustomer]',_0x38bf75[_0x9740('0xb9')],_0x9740('0xba'),_0x1952dd[_0x9740('0x24')],_0x9740('0xf6'),_0x1952dd[_0x9740('0x5e')]);}if(_0x5bb454!==_0x9740('0xb5')){delete this[_0x9740('0x6f')][_0x5a72f3[_0x9740('0xb0')]];delete this[_0x9740('0x6f')][_0x5a72f3[_0x9740('0xf7')]];}}};Preview['prototype'][_0x9740('0xf8')]=function(_0x179681,_0x38848d,_0x1485a9){if(_[_0x9740('0xf9')](_0x38848d)&&_0x9740('0xfa')!==typeof _0x38848d){return;}if(_['isUndefined'](_0x1485a9)&&_0x9740('0xfa')!==typeof _0x1485a9){return;}switch(_0x1485a9[_0x9740('0xfb')]){case'0':ut[_0x9740('0xfc')](_0x179681,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x179681,_0x9740('0xfd'));break;case'3':ut[_0x9740('0xfc')](_0x179681,0x3,'NoAnswer');rpcDb[_0x9740('0xfe')](_0x179681,_0x9740('0xff'));break;case'5':ut[_0x9740('0xfc')](_0x179681,0x5,_0x9740('0xc9'));rpcDb['createAgentHistory'](_0x179681,_0x9740('0x100'));break;case'8':ut[_0x9740('0xfc')](_0x179681,0x8,_0x9740('0xd6'));rpcDb[_0x9740('0xfe')](_0x179681,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x9740('0xfc')](_0x179681,0x16,_0x9740('0x101'));rpcDb[_0x9740('0xfe')](_0x179681,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x9740('0xfc')](_0x179681,0xc,_0x1485a9['reason']);rpcDb[_0x9740('0xfe')](_0x179681,_0x9740('0x102'));}ut['updateOriginated'](_0x38848d,_0x9740('0x103'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x179681['uniqueid'],_0x9740('0xba'),_0x38848d[_0x9740('0x24')],_0x9740('0xf6'),_0x38848d[_0x9740('0x5e')]);delete this['actions'][_0x179681[_0x9740('0xb9')]];};Preview['prototype'][_0x9740('0xa6')]=function(_0x54a98a,_0x2edf57,_0x2b596a){return Promise[_0x9740('0x104')]()[_0x9740('0x85')](cmHopperAdditionalPhone[_0x9740('0xa6')](_0x54a98a,_0x2edf57,_0x2b596a))[_0x9740('0x7a')](logger[_0x9740('0x58')](_0x9740('0x105')));};Preview[_0x9740('0x65')][_0x9740('0xb4')]=function(_0x2feac,_0x1ed792,_0x3f6a5e){return Promise[_0x9740('0x104')]()['then'](cmHopperAdditionalPhone[_0x9740('0xb4')](_0x2feac,_0x1ed792,_0x3f6a5e))['catch'](logger[_0x9740('0x58')](_0x9740('0x106')));};Preview[_0x9740('0x65')]['incrementPreviewCounters']=function(_0x447ece){return Promise[_0x9740('0x104')]()[_0x9740('0x85')](cmHopperAdditionalPhone[_0x9740('0xb3')](_0x447ece))['catch'](logger[_0x9740('0x58')]('[incrementPreviewCounters]\x20'));};Preview[_0x9740('0x65')][_0x9740('0x107')]=function(_0x73e00c,_0x28df3f,_0x3486d8,_0x1b4075,_0x1d5586){var _0x361f1f=this;return new Promise(function(_0x613126,_0x1290d5){if(_[_0x9740('0x6e')](_0x28df3f)||_[_0x9740('0x6e')](_0x28df3f['Contact'])||_[_0x9740('0x6e')](_0x28df3f[_0x9740('0x108')])||_[_0x9740('0x6e')](_0x28df3f[_0x9740('0x76')])){_0x1290d5(ut[_0x9740('0x4b')](_0x9740('0x109'),_0x1b4075,_0x1d5586));return;}var _0x21544d=uuid['v4']();var _0x1698e4=_0x361f1f[_0x9740('0x22')][_0x28df3f[_0x9740('0x71')][_0x9740('0x24')]];var _0x22964b=_0x3486d8?_0x361f1f[_0x9740('0x84')][_0x3486d8]['id']:undefined;_0x361f1f[_0x9740('0x6f')][_0x21544d]=new Action(_0x28df3f,_0x1698e4,_0x21544d,_0x3486d8,_0x22964b);var _0x37ea3e=_0x361f1f[_0x9740('0x6f')][_0x21544d];_0x37ea3e[_0x9740('0xd0')]=_0x1b4075;_0x37ea3e[_0x9740('0xaf')]=_0x1d5586;_0x37ea3e[_0x9740('0x10a')]=_0x3486d8;if(_['isEmpty'](_0x73e00c)){_0x361f1f[_0x9740('0x10b')](_0x37ea3e,_0x1698e4,_0x28df3f,_0x3486d8)[_0x9740('0x85')](function(_0x1c5e5a){logger['info'](_0x9740('0x10c'),_0x9740('0x10d')+_0x37ea3e[_0x9740('0x72')]+_0x9740('0x10e')+_0x37ea3e['idContact'],JSON[_0x9740('0x54')](_0x1c5e5a));ami['emit'](_0x9740('0x10f'),ut[_0x9740('0xa3')](_0x37ea3e,_0x9740('0x110'),_0x361f1f['campaignsPreview'][_0x37ea3e[_0x9740('0x72')]]));_0x613126(ut['message'](_0x9740('0x111')));})[_0x9740('0x7a')](function(_0x1c1c39){ut[_0x9740('0x61')](_0x9740('0x112'),_0x1c1c39);_0x1290d5(ut[_0x9740('0x4b')](_0x9740('0x113'),_0x1b4075,_0x1d5586));});}else{_0x1698e4[_0x9740('0x35')]+=0x1;ut[_0x9740('0x114')](_0x37ea3e);rpcDb[_0x9740('0x115')](_0x37ea3e,_0x9740('0x116'));delete _0x361f1f[_0x9740('0x6f')][_0x21544d];_0x1290d5(ut[_0x9740('0x4b')]('Contact\x20in\x20black\x20List',_0x1b4075,_0x1d5586));}});};Preview['prototype'][_0x9740('0x9b')]=function(_0x431892){return!_[_0x9740('0x6e')](_0x431892)&&!_[_0x9740('0x6e')](_0x431892[_0x9740('0x24')])&&!_['isNil'](_0x431892[_0x9740('0x51')])&&_0x431892[_0x9740('0x51')]&&!_['isNil'](this[_0x9740('0x117')][util[_0x9740('0x55')](_0x9740('0x118'),_0x431892[_0x9740('0x24')])])&&!_['isNil'](this[_0x9740('0x117')][util[_0x9740('0x55')](_0x9740('0x118'),_0x431892[_0x9740('0x24')])][_0x9740('0x119')])&&(this['trunks'][util[_0x9740('0x55')](_0x9740('0x118'),_0x431892[_0x9740('0x24')])][_0x9740('0x119')]===_0x9740('0x11a')||this[_0x9740('0x117')][util['format']('SIP/%s',_0x431892[_0x9740('0x24')])][_0x9740('0x119')]===_0x9740('0x11b'));};Preview[_0x9740('0x65')][_0x9740('0x8b')]=function(_0x10f3f,_0x5d5526){return this['execRun'](_0x10f3f,_0x5d5526)['then'](function(_0x20762f){return _[_0x9740('0x74')](_0x20762f,[_0x9740('0x4b')]);})[_0x9740('0x7a')](function(_0x1bb0ed){if(_0x1bb0ed[_0x9740('0x11c')]){rpcDb[_0x9740('0x11d')](_0x10f3f);}if(_0x1bb0ed[_0x9740('0x51')]){rpcDb[_0x9740('0x8e')](_0x10f3f);}throw _[_0x9740('0x74')](_0x1bb0ed,['message']);});};Preview[_0x9740('0x65')][_0x9740('0x11e')]=function(_0x2e072b,_0x48a499){var _0x1a681d=this;var _0x4d27ea,_0x46269e;return rpcDb[_0x9740('0x11f')](_0x2e072b)[_0x9740('0x85')](function(_0x4e3341){if(!_[_0x9740('0x6e')](_0x4e3341[0x0])){_0x46269e=_0x4e3341[0x0][_0x9740('0x120')]?![]:!![];_0x4d27ea=_0x4e3341[0x0][_0x9740('0x120')]?!![]:![];_0x4d27ea=_0x48a499?!![]:_0x4d27ea;}var _0x2a8d9a=_0x1a681d['validateContact'](_0x4e3341);if(_0x2a8d9a[_0x9740('0x121')]){rpcDb[_0x9740('0x122')](_[_0x9740('0x74')](_0x4e3341[0x0],[_0x9740('0x76'),'phone']))[_0x9740('0x85')](function(_0x502e38){_0x1a681d[_0x9740('0x107')](_0x502e38,_0x4e3341[0x0],_0x48a499,_0x46269e,_0x4d27ea)[_0x9740('0x85')](function(_0x214ad5){return _0x214ad5;})[_0x9740('0x7a')](function(_0x495282){throw _0x495282;});})[_0x9740('0x7a')](function(_0x32409b){ut['logger']('[Preview][checkIsBlackList]',_0x32409b);throw ut[_0x9740('0x4b')](_0x9740('0x123'),_0x46269e,_0x4d27ea);});}else{throw ut[_0x9740('0x4b')](_0x2a8d9a[_0x9740('0x4b')],_0x46269e,_0x4d27ea);}})['catch'](function(_0x54bd29){ut[_0x9740('0x61')](_0x9740('0x124'),_0x54bd29);throw ut[_0x9740('0x4b')]('Call\x20unsuccessful',![],!![]);});};Preview[_0x9740('0x65')]['validateContact']=function(_0x4ee3ab){if(_[_0x9740('0x6e')](_0x4ee3ab)||_[_0x9740('0x125')](_0x4ee3ab)||!_['isNil'](_0x4ee3ab[0x0][_0x9740('0x8a')])&&_['isNil'](_0x4ee3ab[0x0][_0x9740('0x8a')][_0x9740('0x24')])){ut['logger'](_0x9740('0x126'),_0x4ee3ab);return{'isValid':![],'message':_0x9740('0x127')};}var _0x543a4f=this[_0x9740('0x22')][_0x4ee3ab[0x0]['Queue']['name']];_0x543a4f[_0x9740('0x4b')]='ACTIVE';if(_['isNil'](_0x543a4f)){ut[_0x9740('0x61')](_0x9740('0x128'),_0x543a4f);return{'isValid':![],'message':_0x9740('0x129')};}if(!this[_0x9740('0x9b')](_0x543a4f[_0x9740('0x50')])){ut[_0x9740('0x61')](_0x9740('0x12a'),'campaign\x20Name:\x20'+_0x543a4f['name']+_0x9740('0x12b'));if(!this[_0x9740('0x9b')](_0x543a4f[_0x9740('0x9c')])){ut[_0x9740('0x61')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x543a4f[_0x9740('0x24')]+_0x9740('0x12c'));return{'isValid':![],'message':_0x9740('0x12d')};}}if(!ut[_0x9740('0x12e')](_0x543a4f[_0x9740('0x9a')])){ut[_0x9740('0x61')](_0x9740('0x12f'),_0x543a4f[_0x9740('0x24')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x9740('0x130')+_0x543a4f['name']+_0x9740('0x131')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x9740('0x65')][_0x9740('0x10b')]=function(_0x3744ea,_0x1359fa,_0x2b016e,_0x1439b4){var _0x59a090=this;return new Promise(function(_0x495f90,_0x1bebd6){var _0x76b5e2=_0x3744ea['uniqueid'];var _0x47b838=_0x59a090['isTrunkReachable'](_0x1359fa[_0x9740('0x50')])?util[_0x9740('0x55')]('SIP/%s/%s%s',_0x1359fa[_0x9740('0x50')][_0x9740('0x24')],_[_0x9740('0x6e')](_0x1359fa['dialPrefix'])?'':_0x1359fa[_0x9740('0x33')][_0x9740('0x132')]()||'',_0x1359fa['dialCutDigit']>0x0?_0x2b016e[_0x9740('0x108')][_0x9740('0x133')](_0x1359fa[_0x9740('0x134')]):_0x2b016e[_0x9740('0x108')]):util[_0x9740('0x55')](_0x9740('0x135'),_['isNil'](_0x1359fa['TrunkBackup'])?_0x1359fa['Trunk'][_0x9740('0x24')]:_0x1359fa[_0x9740('0x9c')]['name'],_[_0x9740('0x6e')](_0x1359fa['dialPrefix'])?'':_0x1359fa[_0x9740('0x33')][_0x9740('0x132')]()||'',_0x1359fa['dialCutDigit']>0x0?_0x2b016e[_0x9740('0x108')][_0x9740('0x133')](_0x1359fa[_0x9740('0x134')]):_0x2b016e[_0x9740('0x108')]);var _0x9cfd4c=_0x59a090[_0x9740('0x9b')](_0x1359fa['Trunk'])?ut[_0x9740('0x136')](_0x1359fa['Trunk'][_0x9740('0x52')],_0x1359fa[_0x9740('0x137')],_0x1359fa['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1359fa[_0x9740('0x138')],_0x1359fa[_0x9740('0x139')]):_0x1359fa[_0x9740('0x138')]):ut[_0x9740('0x136')](_[_0x9740('0x6e')](_0x1359fa['TrunkBackup'])?_0x1359fa[_0x9740('0x50')]['callerid']:_0x1359fa[_0x9740('0x9c')][_0x9740('0x52')],_0x1359fa[_0x9740('0x137')],_0x1359fa[_0x9740('0x139')]>0x0?ut[_0x9740('0x13a')](_0x1359fa[_0x9740('0x138')],_0x1359fa['dialRandomLastDigitCallerIdNumber']):_0x1359fa[_0x9740('0x138')]);if(_0x9cfd4c){_0x3744ea[_0x9740('0x13b')]=ut[_0x9740('0x13c')](_0x9cfd4c);_0x3744ea[_0x9740('0x13d')]=ut['extractCalleridNumber'](_0x9cfd4c);}var _0x429829=ut[_0x9740('0x13e')](_0x1359fa,_0x2b016e,_0x47b838,_0x9cfd4c,_0x76b5e2,_0x3744ea);_[_0x9740('0x13f')](_0x3744ea,ut[_0x9740('0x140')](_0x429829));_0x3744ea[_0x9740('0x8f')]=moment()['format'](_0x9740('0x90'));_0x1359fa[_0x9740('0x141')]=_0x429829;ami[_0x9740('0x78')](ut[_0x9740('0x142')](_0x3744ea,_0x1359fa,_0x429829,_0x3744ea['activeContact'],_0x1439b4))[_0x9740('0x85')](function(_0x4f1e19){_0x1359fa[_0x9740('0x5e')]+=0x1;logger['info'](_0x9740('0x143'),_0x76b5e2,'\x20Queue',_0x1359fa[_0x9740('0x24')],_0x9740('0xf6'),_0x1359fa[_0x9740('0x5e')]);_0x495f90(_0x4f1e19);})[_0x9740('0x7a')](function(_0x3d35ea){ut[_0x9740('0xfc')](_0x3744ea,0xe,_0x9740('0x144'));rpcDb[_0x9740('0xfe')](_0x3744ea,_0x9740('0x145'));_0x1bebd6(_0x3d35ea);});});};Preview[_0x9740('0x65')][_0x9740('0x1a')]=function(_0x2c497a){if(this[_0x9740('0x6f')][_0x2c497a[_0x9740('0xb0')]]){this[_0x9740('0x6f')][_0x2c497a['linkedid']][_0x9740('0x79')]=_0x2c497a['channel'];}};Preview['prototype'][_0x9740('0x146')]=function(_0x1edb8f){var _0x3eec80=this;var _0x10c410=this['actions'][_0x1edb8f['actionid']];if(_0x10c410){if(_0x10c410['lookAgent']&&this[_0x9740('0x84')][_0x10c410[_0x9740('0x10a')]]){ut['logLookAgent'](_0x10c410,this[_0x9740('0x84')][_0x10c410[_0x9740('0x10a')]]['name'],this[_0x9740('0x84')][_0x10c410['lookAgent']]['id']);}var _0x231126=_[_0x9740('0x147')](_0x10c410);_0x231126[_0x9740('0xb6')]=moment()['format'](_0x9740('0x90'));var _0x2426f5=_0x3eec80[_0x9740('0x22')][_0x10c410[_0x9740('0x72')]];if(ut['isFailure'](_0x1edb8f[_0x9740('0x148')])){if(_0x10c410['unlockAgent']){rpcDb[_0x9740('0x11d')](_0x10c410[_0x9740('0xb2')]);}if(_0x10c410[_0x9740('0xaf')]){rpcDb[_0x9740('0x8e')](_0x10c410['idContact']);}ami['emit'](_0x9740('0x149'),ut[_0x9740('0xa3')](_0x10c410,_0x9740('0x14a'),this[_0x9740('0x22')][_0x10c410['queue']]));this['callProgressDetectingAgent'](_0x231126,_0x2426f5,_0x1edb8f);}else{_0x10c410[_0x9740('0x8f')]=moment()['format'](_0x9740('0x90'));ut[_0x9740('0xfc')](_0x231126,0x4,_0x9740('0xc2'));rpcDb[_0x9740('0xfe')](_0x231126,_0x9740('0x14b'));}}};Preview[_0x9740('0x65')][_0x9740('0x15')]=function(_0x2c9787){var _0x470c2a=this[_0x9740('0x6f')][_0x2c9787['linkedid']];var _0x5785cb;if(_0x470c2a){_0x5785cb=this[_0x9740('0x22')][_0x470c2a['queue']];logger[_0x9740('0x58')](_0x9740('0x14c'),_0x2c9787[_0x9740('0xb0')],'\x20Queue',_0x5785cb[_0x9740('0x24')],_0x9740('0x73'),_0x5785cb[_0x9740('0x28')]);}if(this[_0x9740('0x6f')][_0x2c9787[_0x9740('0xb0')]]&&_0x2c9787[_0x9740('0xb0')]!==_0x2c9787['uniqueid']){if(_0x2c9787[_0x9740('0x14d')]==='16'&&this[_0x9740('0x6f')][_0x2c9787[_0x9740('0xb0')]][_0x9740('0xb7')]){this[_0x9740('0x9e')](_0x2c9787,_0x2c9787[_0x9740('0xb0')],_0x2c9787[_0x9740('0x14d')]);}else if(this['actions'][_0x2c9787[_0x9740('0xb0')]][_0x9740('0xb7')]){logger[_0x9740('0x58')](_0x9740('0x14e'),_0x2c9787[_0x9740('0xb0')],_0x2c9787[_0x9740('0x14d')],'\x20Queue',_0x5785cb[_0x9740('0x24')],_0x9740('0x73'),_0x5785cb[_0x9740('0x28')]);this[_0x9740('0x9e')](_0x2c9787,_0x2c9787[_0x9740('0xb0')],_0x2c9787[_0x9740('0x14d')]);}}else if(_0x470c2a&&_['isNil'](_0x470c2a[_0x9740('0x14f')])&&_0x5785cb[_0x9740('0x150')]&&_0x2c9787[_0x9740('0xb0')]===_0x2c9787[_0x9740('0xb9')]&&_[_0x9740('0x6e')](_0x2c9787[_0x9740('0xfb')])&&_0x2c9787['cause']==='16'&&_0x2c9787[_0x9740('0x151')]==='6'&&_['isUndefined'](_0x470c2a[_0x9740('0x152')])){if(_0x470c2a['unlockAgent']){rpcDb[_0x9740('0x11d')](_0x470c2a['idContact']);}if(_0x470c2a[_0x9740('0xaf')]){rpcDb['disableContact'](_0x470c2a['idContact']);}_0x2c9787[_0x9740('0xfb')]='22';this[_0x9740('0xf8')](_0x470c2a,_0x5785cb,_0x2c9787);}else if(_0x470c2a&&_0x470c2a[_0x9740('0x152')]){if(_0x2c9787[_0x9740('0x14d')]==='16'&&this[_0x9740('0x6f')][_0x2c9787[_0x9740('0xb0')]]['dialAnswer']){logger[_0x9740('0x58')]('[syncHangup][talking][transfer]',_0x2c9787['linkedid'],_0x2c9787[_0x9740('0x14d')],_0x9740('0xba'),_0x5785cb['name'],'pTalking:\x20',_0x5785cb[_0x9740('0x28')]);this['callProgressDetectingCustomer'](_0x2c9787,_0x2c9787[_0x9740('0xb0')],_0x2c9787[_0x9740('0x14d')]);}else if(this['actions'][_0x2c9787['linkedid']][_0x9740('0xb7')]){logger[_0x9740('0x58')](_0x9740('0x14e'),_0x2c9787[_0x9740('0xb0')],_0x2c9787[_0x9740('0x14d')],'\x20Queue',_0x5785cb[_0x9740('0x24')],_0x9740('0x73'),_0x5785cb[_0x9740('0x28')]);this[_0x9740('0x9e')](_0x2c9787,_0x2c9787[_0x9740('0xb0')],_0x2c9787['cause']);}}};Preview[_0x9740('0x65')][_0x9740('0x153')]=function(_0x42596c){if(this[_0x9740('0x6f')][_0x42596c['destlinkedid']]&&_0x42596c[_0x9740('0xf7')]!==_0x42596c[_0x9740('0x154')]){this['callProgressDetectingCustomer'](_0x42596c,_0x42596c[_0x9740('0xf7')],_0x42596c[_0x9740('0xec')]);}};Preview[_0x9740('0x65')][_0x9740('0x17')]=function(_0x52709c){if(this[_0x9740('0x6f')][_0x52709c[_0x9740('0xb0')]]&&_0x52709c['linkedid']!==_0x52709c['uniqueid']&&!this[_0x9740('0x6f')][_0x52709c[_0x9740('0xb0')]][_0x9740('0xb7')]){if(_0x52709c[_0x9740('0x14d')]==='1'){this[_0x9740('0x9e')](_0x52709c,_0x52709c['linkedid'],_0x52709c['cause']);}}};Preview[_0x9740('0x65')][_0x9740('0x155')]=function(_0x21fa82,_0x5c5ce8,_0x248ba6){if(this[_0x9740('0x6f')][_0x21fa82]){if(_[_0x9740('0x6e')](this[_0x9740('0x6f')][_0x21fa82][_0x9740('0x141')])){this[_0x9740('0x6f')][_0x21fa82][_0x9740('0x141')]={};}this[_0x9740('0x6f')][_0x21fa82]['variables'][_0x5c5ce8]=_0x248ba6;}};Preview[_0x9740('0x65')][_0x9740('0x1c')]=function(_0x18b450){try{if(!_[_0x9740('0x6e')](_0x18b450)){if(ut[_0x9740('0x156')](_[_0x9740('0x157')](_0x18b450[_0x9740('0x158')])[0x0])){this[_0x9740('0x155')](_0x18b450[_0x9740('0xb9')],_[_0x9740('0x157')](_0x18b450[_0x9740('0x158')])[0x0],_0x18b450[_0x9740('0x159')]);}}}catch(_0x15ddba){logger['error'](_0x9740('0x15a'),util['inspect'](_0x15ddba,{'showHidden':![],'depth':null}));}};Preview[_0x9740('0x65')][_0x9740('0x1e')]=function(_0x1d8d5b){if(_0x1d8d5b){if(this['actions'][_0x1d8d5b['transfertargetlinkedid']]){this[_0x9740('0x6f')][_0x1d8d5b['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x9740('0x65')][_0x9740('0x20')]=function(_0x5a9bad){if(_0x5a9bad){if(this['actions'][_0x5a9bad[_0x9740('0x15b')]]){this['actions'][_0x5a9bad[_0x9740('0x15b')]][_0x9740('0x152')]=!![];}}};module[_0x9740('0x15c')]=Preview; \ No newline at end of file +var _0x8e3f=['callProgressDetectingCustomer','countnosuchnumberretry','countglobal','emit','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','then','swapAdditionalPhones','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','countnoanswerretry','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','Contact','phone','isNil','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','unlock','unlockContact','execRun','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','merge','toLowerVariables','variables','[originated][increment]','OriginateError','channel','actionid','logLookAgent','clone','isFailure','response','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','destuniqueid','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/environment','preview','../../../config/logger','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','name','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','clearZombieChannels','info','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE'];(function(_0x5408ef,_0x5ce24a){var _0x20aa11=function(_0xe88445){while(--_0xe88445){_0x5408ef['push'](_0x5408ef['shift']());}};_0x20aa11(++_0x5ce24a);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xf8e3('0x0'));var _=require(_0xf8e3('0x1'));var uuid=require(_0xf8e3('0x2'));var moment=require('moment');var md5=require(_0xf8e3('0x3'));var Redis=require(_0xf8e3('0x4'));var config=require(_0xf8e3('0x5'));var logger=require('../../../config/logger')(_0xf8e3('0x6'));var loggerAction=require(_0xf8e3('0x7'))('actionPreview');var ami=require(_0xf8e3('0x8'));var rpcDb=require(_0xf8e3('0x9'));var cmHopperAdditionalPhone=require(_0xf8e3('0xa'));var Action=require(_0xf8e3('0xb'));var ut=require('./util/util');config[_0xf8e3('0xc')]=_[_0xf8e3('0xd')](config[_0xf8e3('0xc')],{'host':_0xf8e3('0xe'),'port':0x18eb});var io=require(_0xf8e3('0xf'))(new Redis(config[_0xf8e3('0xc')]));var Sequence=function(){};Sequence[_0xf8e3('0x10')][_0xf8e3('0x11')]=function(_0x2d914d){this[_0xf8e3('0x12')]=this[_0xf8e3('0x12')]?this[_0xf8e3('0x12')]['finally'](_0x2d914d):_0x2d914d();};function Preview(_0xb7d14f){this[_0xf8e3('0x13')]=new Sequence();this[_0xf8e3('0x14')]=_0xb7d14f['voiceQueues'];this[_0xf8e3('0x15')]=_0xb7d14f[_0xf8e3('0x15')];this[_0xf8e3('0x16')]={};this[_0xf8e3('0x17')]=_0xb7d14f['agents'];this[_0xf8e3('0x18')]=0x0;ami['on'](_0xf8e3('0x19'),this[_0xf8e3('0x1a')]['bind'](this));ami['on'](_0xf8e3('0x1b'),this['syncHangup'][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x1d'),this[_0xf8e3('0x1e')]['bind'](this));ami['on']('dialend',this[_0xf8e3('0x1f')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x20'),this[_0xf8e3('0x21')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x22'),this[_0xf8e3('0x23')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x24'),this[_0xf8e3('0x25')]['bind'](this));ami['on'](_0xf8e3('0x26'),this[_0xf8e3('0x27')][_0xf8e3('0x1c')](this));this[_0xf8e3('0x28')](this[_0xf8e3('0x14')]);}function emit(_0x11c58e,_0x1cae53,_0x3fff85){io['to'](_0x11c58e)['emit'](_0x1cae53,_0x3fff85);}function emitCampaignPreview(_0xe5102b){if(_0xe5102b[_0xf8e3('0x29')]===_0xf8e3('0x2a')){var _0xccbcc0={'id':_0xe5102b['id'],'name':_0xe5102b['name'],'strategy':_0xe5102b[_0xf8e3('0x2b')],'answered':_0xe5102b['answered'],'available':_0xe5102b[_0xf8e3('0x2c')],'loggedIn':_0xe5102b[_0xf8e3('0x2d')],'pTalking':_0xe5102b[_0xf8e3('0x2e')],'sumBillable':_0xe5102b[_0xf8e3('0x2f')],'sumDuration':_0xe5102b[_0xf8e3('0x30')],'sumHoldTime':_0xe5102b[_0xf8e3('0x31')]||0x0,'talking':_0xe5102b['talking'],'total':_0xe5102b[_0xf8e3('0x32')],'type':_0xe5102b[_0xf8e3('0x29')],'unmanaged':_0xe5102b[_0xf8e3('0x33')],'abandoned':_0xe5102b[_0xf8e3('0x34')],'waiting':_0xe5102b[_0xf8e3('0x35')],'loggedInDb':_0xe5102b[_0xf8e3('0x36')],'dialActive':_0xe5102b[_0xf8e3('0x37')],'dialMethod':_0xe5102b[_0xf8e3('0x38')],'dialOriginateCallerIdName':_0xe5102b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xe5102b[_0xf8e3('0x39')],'dialOriginateTimeout':_0xe5102b[_0xf8e3('0x3a')],'dialPrefix':_0xe5102b[_0xf8e3('0x3b')],'outboundAnswerAgiCallsDay':_0xe5102b[_0xf8e3('0x3c')],'outboundAnswerCallsDay':_0xe5102b[_0xf8e3('0x3d')],'outboundBlacklistCallsDay':_0xe5102b[_0xf8e3('0x3e')],'outboundBusyCallsDay':_0xe5102b[_0xf8e3('0x3f')],'outboundCongestionCallsDay':_0xe5102b[_0xf8e3('0x40')],'outboundDropCallsDayACS':_0xe5102b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xe5102b[_0xf8e3('0x41')],'outboundDropCallsDayTimeout':_0xe5102b[_0xf8e3('0x42')],'outboundNoAnswerCallsDay':_0xe5102b[_0xf8e3('0x43')],'outboundNoSuchCallsDay':_0xe5102b[_0xf8e3('0x44')],'outboundOriginateFailureCallsDay':_0xe5102b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xe5102b[_0xf8e3('0x45')],'outboundRejectCallsDay':_0xe5102b[_0xf8e3('0x46')],'outboundUnknownCallsDay':_0xe5102b[_0xf8e3('0x47')],'outboundAbandonedCallsDay':_0xe5102b[_0xf8e3('0x48')],'predictiveIntervalAnsweredCalls':_0xe5102b[_0xf8e3('0x49')],'predictiveIntervalAvgHoldtime':_0xe5102b[_0xf8e3('0x4a')],'predictiveIntervalAvgTalktime':_0xe5102b[_0xf8e3('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0xe5102b[_0xf8e3('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0xe5102b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xe5102b[_0xf8e3('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0xe5102b[_0xf8e3('0x4e')],'predictiveIntervalHitRate':_0xe5102b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xe5102b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xe5102b['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xe5102b[_0xf8e3('0x4f')],'predictiveIntervalTotalCalls':_0xe5102b['predictiveIntervalTotalCalls'],'message':_0xe5102b[_0xf8e3('0x50')],'originated':_0xe5102b[_0xf8e3('0x51')],'erlangCalls':_0xe5102b[_0xf8e3('0x52')],'erlangCallToSecond':_0xe5102b[_0xf8e3('0x53')],'erlangAbandonmentRate':_0xe5102b['erlangAbandonmentRate'],'erlangBusyFactor':_0xe5102b['erlangBusyFactor'],'startPredictive':_0xe5102b[_0xf8e3('0x54')],'startProgressive':_0xe5102b[_0xf8e3('0x55')]};if(_0xe5102b[_0xf8e3('0x56')]){_0xccbcc0[_0xf8e3('0x56')]={'id':_0xe5102b[_0xf8e3('0x56')]['id'],'name':_0xe5102b[_0xf8e3('0x56')]['name'],'active':_0xe5102b[_0xf8e3('0x56')]['active'],'callerid':_0xe5102b['Trunk'][_0xf8e3('0x57')]};}if(_0xe5102b[_0xf8e3('0x58')]){_0xccbcc0[_0xf8e3('0x58')]={'id':_0xe5102b[_0xf8e3('0x58')]['id'],'name':_0xe5102b['Interval']['name']};}var _0x41138f=md5(JSON[_0xf8e3('0x59')](_0xccbcc0));if(_0xe5102b['md5']!==_0x41138f){_0xe5102b[_0xf8e3('0x3')]=_0x41138f;emit(util[_0xf8e3('0x5a')](_0xf8e3('0x5b'),_0xccbcc0[_0xf8e3('0x5c')]),'voice_queue:save',_0xccbcc0);}}}function emitVoiceQueueChannelRemove(_0x53cfea){logger['info'](_0xf8e3('0x5d'),JSON[_0xf8e3('0x59')](_0x53cfea));emit(util[_0xf8e3('0x5a')](_0xf8e3('0x5b'),_0x53cfea['name']),_0xf8e3('0x5e'),_0x53cfea);io['emit'](_0xf8e3('0x5f'),_0x53cfea);}function notSendMessagesQueue(_0x336653){if(_0x336653[_0xf8e3('0x60')]){if(_0x336653[_0xf8e3('0x51')]===0x0&&_0x336653[_0xf8e3('0x2e')]===0x0){_0x336653[_0xf8e3('0x60')]=![];_0x336653[_0xf8e3('0x2c')]=0x0;_0x336653[_0xf8e3('0x61')]=0x0;_0x336653[_0xf8e3('0x50')]='NOT_ACTIVE';ut[_0xf8e3('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x336653[_0xf8e3('0x5c')]+_0xf8e3('0x63'));}else{_0x336653[_0xf8e3('0x50')]=_0xf8e3('0x64');ut[_0xf8e3('0x62')](_0xf8e3('0x65'),_0x336653[_0xf8e3('0x5c')]+_0xf8e3('0x66'));}emitCampaignPreview(_0x336653);}}Preview['prototype'][_0xf8e3('0x28')]=function(){var _0x108b81=this;setInterval(function(){_0x108b81[_0xf8e3('0x67')]();},0x7cf);};Preview[_0xf8e3('0x10')][_0xf8e3('0x67')]=function(){var _0xe7fcb9=this[_0xf8e3('0x14')];this[_0xf8e3('0x18')]+=0x1;for(var _0x5175c0 in _0xe7fcb9){if(_0xe7fcb9['hasOwnProperty'](_0x5175c0)&&(_0xe7fcb9[_0x5175c0]['dialMethod']===_0xf8e3('0x6')||_0xe7fcb9[_0x5175c0][_0xf8e3('0x38')]==='booked')&&_0xe7fcb9[_0x5175c0][_0xf8e3('0x29')]==='outbound'){if(this[_0xf8e3('0x18')]>0x7){this[_0xf8e3('0x18')]=0x0;this['clearZombieChannels']();}}if(_0xe7fcb9[_0xf8e3('0x68')](_0x5175c0)&&_0xe7fcb9[_0x5175c0]['dialMethod']===_0xf8e3('0x6')&&_0xe7fcb9[_0x5175c0][_0xf8e3('0x29')]==='outbound'){if(_0xe7fcb9[_0x5175c0][_0xf8e3('0x37')]){this[_0xf8e3('0x69')](_0xe7fcb9[_0x5175c0]);if(_0xe7fcb9[_0x5175c0][_0xf8e3('0x6a')])this[_0xf8e3('0x6b')](_0xe7fcb9[_0x5175c0]);}else{notSendMessagesQueue(_0xe7fcb9[_0x5175c0]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x59d51e){var _0x299406=this;this[_0xf8e3('0x13')][_0xf8e3('0x11')](function(){if(!_['isNil'](_0x299406[_0xf8e3('0x16')][_0x59d51e])){loggerAction['info'](_0xf8e3('0x6c'),_0x59d51e,_0xf8e3('0x6d'),_0x299406['actions'][_0x59d51e]['queue'],_0xf8e3('0x6e'),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]][_0xf8e3('0x51')]),_0xf8e3('0x70'),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]]['pTalking']),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x71')]),JSON[_0xf8e3('0x59')](_[_0xf8e3('0x72')](_0x299406[_0xf8e3('0x16')][_0x59d51e],['contactId',_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75')])));return ami[_0xf8e3('0x76')]({'action':_0xf8e3('0x77'),'channel':_0x299406[_0xf8e3('0x16')][_0x59d51e]['channel']})[_0xf8e3('0x78')](function(_0x165426){if(_0x165426[_0xf8e3('0x50')]===_0xf8e3('0x79')){setTimeout(function(){if(_0x299406[_0xf8e3('0x16')][_0x59d51e]){ut[_0xf8e3('0x7a')](_0x299406['campaignsPreview'][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]],_0xf8e3('0x7b'));if(_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x71')]===!![]){ut['decrementTalkink'](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]],'[clearZombieChannel]');ut['loggerError'](_0xf8e3('0x7c')+_0x59d51e,_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]);}ut[_0xf8e3('0x7d')]('[Dialer][checkChannel][Preview]'+_0x59d51e,_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]);delete _0x299406['actions'][_0x59d51e];}},0x2328);}});}});};Preview['prototype'][_0xf8e3('0x7e')]=function(){var _0x3067a2=this;loggerAction[_0xf8e3('0x7f')]('[action]',_['size'](this['actions']));for(var _0x182e9b in this[_0xf8e3('0x16')]){if(_0x3067a2['actions']['hasOwnProperty'](_0x182e9b)){_0x3067a2['clearZombieChannel'](_0x182e9b);}}};Preview[_0xf8e3('0x10')][_0xf8e3('0x6b')]=function(_0x5368a8){var _0x3c3775=this;rpcDb[_0xf8e3('0x80')](_0x5368a8['id'],ut[_0xf8e3('0x81')](this['agents']))['then'](function(_0x524fbc){if(!_['isNil'](_0x524fbc)){for(var _0x3390a1=0x0;_0x3390a1<_0x524fbc[_0xf8e3('0x82')];_0x3390a1+=0x1){if(ut[_0xf8e3('0x83')](_0x524fbc[_0x3390a1][_0xf8e3('0x84')])<_0x5368a8[_0xf8e3('0x85')]*0x3c){if(_0x524fbc[_0x3390a1][_0xf8e3('0x86')]&&!_0x524fbc[_0x3390a1][_0xf8e3('0x86')][_0xf8e3('0x87')]){_0x3c3775[_0xf8e3('0x88')](_0x524fbc[_0x3390a1]['id'])['then'](ut['logger2'](_0xf8e3('0x89')))[_0xf8e3('0x78')](ut[_0xf8e3('0x8a')]('[RecallMe]'));}else{rpcDb[_0xf8e3('0x8b')](_0x524fbc[_0x3390a1]['id']);}}else{var _0x131c0b=new Action(_0x524fbc[_0x3390a1],_0x5368a8);_0x131c0b['starttime']=moment()['format'](_0xf8e3('0x8c'));_0x5368a8[_0xf8e3('0x45')]+=0x1;ut[_0xf8e3('0x8d')](_0x131c0b,0x17,_0xf8e3('0x8e'));if(_0x5368a8['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xf8e3('0x8f')](_0x524fbc[_0x3390a1]));rpcDb[_0xf8e3('0x90')](_0x131c0b,_0xf8e3('0x91'));}else{ut[_0xf8e3('0x8d')](_0x131c0b,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x131c0b,_0xf8e3('0x92'));rpcDb[_0xf8e3('0x93')](_0x131c0b,'[HistoryRecallClose]');}}}}})[_0xf8e3('0x78')](ut[_0xf8e3('0x8a')](_0xf8e3('0x94')));};Preview[_0xf8e3('0x10')]['setMessage']=function(_0x11ebb2){_0x11ebb2['sendMessageOneNotActive']=!![];if(ut[_0xf8e3('0x95')](_0x11ebb2[_0xf8e3('0x2d')])){_0x11ebb2['message']=_0xf8e3('0x96');}else if(!ut[_0xf8e3('0x97')](_0x11ebb2['dialActive'])){_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x98');}else if(!this[_0xf8e3('0x99')](_0x11ebb2[_0xf8e3('0x56')])){if(!this['isTrunkReachable'](_0x11ebb2[_0xf8e3('0x9a')])){_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9b');}else{_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9c');}}else{_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9c');}emitCampaignPreview(_0x11ebb2);};Preview[_0xf8e3('0x10')][_0xf8e3('0x9d')]=function(_0x29174f,_0x2f169e,_0x21d922){var _0x520ce0=this;var _0x52d91d=this[_0xf8e3('0x16')][_0x2f169e];var _0x32eaab=this['campaignsPreview'][_0x52d91d[_0xf8e3('0x6f')]];var _0x36cc90;var _0x31c16d=![];var _0x21deec=0x2;var _0x18a810=0x3;if(_0x32eaab){switch(_0x21d922){case'1':_0x32eaab['outboundNoSuchCallsDay']+=0x1;_0x52d91d[_0xf8e3('0x9e')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x0,'NoSuchNumber');ami[_0xf8e3('0xa0')]('custom:agentnosuchnumber',ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xa2')));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xa3'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'0',_0x32eaab)['then'](function(_0x1b03af){_0x31c16d=_0x1b03af[_0xf8e3('0xa5')]==0x1;_0x21deec=_0x32eaab[_0xf8e3('0xa6')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xac'));}else{if(_0x52d91d[_0xf8e3('0x9e')]>=_0x32eaab[_0xf8e3('0xad')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xac'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,'countnosuchnumberretry',_0x32eaab[_0xf8e3('0xa6')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}delete this[_0xf8e3('0x16')][_0x29174f[_0xf8e3('0xb2')]];}else{_0x52d91d[_0xf8e3('0x9e')]++;logger[_0xf8e3('0x7f')](_0xf8e3('0xb3'),_0x52d91d[_0xf8e3('0x9e')]);logger[_0xf8e3('0x7f')]('id',_0x52d91d[_0xf8e3('0xb4')]);_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d['idContact'],'field':{'countnosuchnumberretry':_0x52d91d[_0xf8e3('0x9e')]}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'ANSWER':var _0x4c3316=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));_0x52d91d['responsetime']=_0x4c3316;_0x52d91d['answertime']=_0x4c3316;_0x52d91d[_0xf8e3('0x71')]=!![];_0x32eaab[_0xf8e3('0x2e')]+=0x1;logger['info'](_0xf8e3('0xb8'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x32eaab['pTalking']);ami[_0xf8e3('0xa0')](_0xf8e3('0xbb'),ut['buildObj'](_0x52d91d,'connect',this[_0xf8e3('0x14')][_0x52d91d[_0xf8e3('0x6f')]]));if(_0x32eaab[_0xf8e3('0xbc')]){ami[_0xf8e3('0xa0')](_0xf8e3('0xbd'),ut[_0xf8e3('0xbe')](_0x52d91d));}break;case'16':ami[_0xf8e3('0xa0')](_0xf8e3('0xbf'),ut['buildObj'](_0x52d91d,_0xf8e3('0xc0'),this[_0xf8e3('0x14')][_0x52d91d[_0xf8e3('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xc0')));_0x32eaab[_0xf8e3('0x3d')]+=0x1;_0x32eaab['total']+=0x1;_0x32eaab[_0xf8e3('0xc1')]+=0x1;ut[_0xf8e3('0xc2')](_0x32eaab,_0xf8e3('0xc3'));_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x4,_0xf8e3('0xc4'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xc5'));rpcDb[_0xf8e3('0x93')](_0x52d91d,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf8e3('0xc6')](_0x52d91d);_0x32eaab[_0xf8e3('0x30')]+=_0x52d91d[_0xf8e3('0xc7')];_0x32eaab[_0xf8e3('0x2f')]+=_0x52d91d[_0xf8e3('0xc7')];logger[_0xf8e3('0x7f')](_0xf8e3('0xc8'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab['name'],_0xf8e3('0x70'),_0x32eaab[_0xf8e3('0x2e')]);delete this[_0xf8e3('0x16')][_0x29174f[_0xf8e3('0xb2')]];break;case _0xf8e3('0xc9'):_0x32eaab[_0xf8e3('0x3f')]+=0x1;_0x52d91d[_0xf8e3('0xca')]+=0x1;_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x5,_0xf8e3('0xcb'));_0x21deec=_0x32eaab['dialBusyRetryFrequency'];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami[_0xf8e3('0xa0')](_0xf8e3('0xcc'),ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xcd')));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xce'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'5',_0x32eaab)[_0xf8e3('0xb6')](function(_0x2121f3){_0x31c16d=_0x2121f3[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xcf'));}else{if(_0x52d91d[_0xf8e3('0xca')]>=_0x32eaab[_0xf8e3('0xd0')]){rpcDb['createCustomerFinal'](_0x52d91d,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xf8e3('0xae')](ut['scheduledAt'](_0x52d91d,_0xf8e3('0xca'),_0x32eaab['dialBusyRetryFrequency']),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d[_0xf8e3('0xca')]++;_0x520ce0['incrementPreviewCounters']({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countbusyretry':_0x52d91d[_0xf8e3('0xca')]}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'NOANSWER':_0x32eaab[_0xf8e3('0x43')]+=0x1;_0x52d91d['countnoanswerretry']+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x3,_0xf8e3('0xd1'));_0x21deec=_0x32eaab[_0xf8e3('0xd2')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];var _0x3afc68=ut['buildNoAnswerEventPayload'](_0x52d91d,_0x32eaab);ami[_0xf8e3('0xa0')](_0xf8e3('0xd3'),_0x3afc68);rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xd4'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'3',_0x32eaab)[_0xf8e3('0xb6')](function(_0xb0f5df){_0x31c16d=_0xb0f5df[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x52d91d['countnoanswerretry']>=_0x32eaab[_0xf8e3('0xd5')]){rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xd4'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xd6'),_0x32eaab[_0xf8e3('0xd2')]),_0x52d91d['unlockAgent'],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})[_0xf8e3('0xb6')](function(){_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'CONGESTION':_0x32eaab['outboundCongestionCallsDay']+=0x1;_0x52d91d[_0xf8e3('0xd7')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x8,'Congestion');_0x21deec=_0x32eaab['dialCongestionRetryFrequency'];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami[_0xf8e3('0xa0')]('custom:agentcongestion',ut['buildObj'](_0x52d91d,_0xf8e3('0xd8')));rpcDb[_0xf8e3('0x90')](_0x52d91d,'[callProgressDetectingCustomer][logCongestion]');_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'8',_0x32eaab)[_0xf8e3('0xb6')](function(_0x401f10){_0x31c16d=_0x401f10[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,'Global');rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xd9'));}else{if(_0x52d91d['countcongestionretry']>=_0x32eaab[_0xf8e3('0xda')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xdb'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,'countcongestionretry',_0x32eaab[_0xf8e3('0xdc')]),_0x52d91d['unlockAgent'],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d[_0xf8e3('0xd7')]++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countcongestionretry':_0x52d91d['countcongestionretry']}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case _0xf8e3('0xdd'):_0x32eaab[_0xf8e3('0x46')]+=0x1;_0x52d91d[_0xf8e3('0xde')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x14,_0xf8e3('0xdf'));_0x21deec=_0x32eaab[_0xf8e3('0xe0')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami['emit'](_0xf8e3('0xe1'),ut['buildObj'](_0x52d91d,_0xf8e3('0xe2')));rpcDb[_0xf8e3('0x90')](_0x52d91d,'[syncHangupRequest][logAgentReject]');_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'20',_0x32eaab)['then'](function(_0x1ca413){_0x31c16d=_0x1ca413[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut['totalGlobal'](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0x14,'AgentReject');rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xe3'));}else{if(_0x52d91d[_0xf8e3('0xde')]>=_0x32eaab[_0xf8e3('0xe4')]){rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xe3'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xde'),_0x32eaab[_0xf8e3('0xe0')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case _0xf8e3('0xe5'):_0x32eaab[_0xf8e3('0x48')]+=0x1;_0x52d91d[_0xf8e3('0xe6')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut['logCustomer'](_0x52d91d,0xb,'Abandoned');rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xe7'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'11',_0x32eaab)[_0xf8e3('0xb6')](function(_0x34da70){_0x31c16d=_0x34da70['additional']==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x52d91d[_0xf8e3('0xe8')]>=_0x32eaab[_0xf8e3('0xe9')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xe7'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xe6'),_0x32eaab[_0xf8e3('0xea')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d['countnoanswerretry']}})['then'](function(){_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'18':_0x32eaab[_0xf8e3('0x47')]+=0x1;_0x52d91d[_0xf8e3('0xeb')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x12,_0x29174f[_0xf8e3('0xec')]||_0x29174f['dialstatus']);ami['emit'](_0xf8e3('0xed'),ut['buildObj'](_0x52d91d,'amd'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xee'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'18',_0x32eaab)[_0xf8e3('0xb6')](function(_0x3df75d){_0x31c16d=_0x3df75d[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0x12,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xee'));}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xee'));}}else{_0x52d91d[_0xf8e3('0xd6')]++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});delete this['actions'][_0x29174f[_0xf8e3('0xb2')]];break;case'19':_0x32eaab['outboundUnknownCallsDay']+=0x1;_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x13,_0x29174f[_0xf8e3('0xec')]||_0x29174f['dialstatus']);ami[_0xf8e3('0xa0')](_0xf8e3('0xed'),ut[_0xf8e3('0xa1')](_0x52d91d,'amd'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xef'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'18',_0x32eaab)['then'](function(_0x3308d6){_0x31c16d=_0x3308d6[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab['dialGlobalMaxRetry']){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xef'));}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xef'));}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d['countnoanswerretry']}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});delete this[_0xf8e3('0x16')][_0x29174f['linkedid']];break;default:if(_0x52d91d[_0xf8e3('0x71')]){ut['decrementTalkink'](_0x32eaab,_0xf8e3('0xf0'));ut['loggerError'](_0xf8e3('0xf1')+_0x32eaab[_0xf8e3('0x5c')],_0x29174f);}_0x32eaab['outboundUnknownCallsDay']+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0xc,_0x29174f[_0xf8e3('0xec')]||_0x29174f[_0xf8e3('0xf2')]);_0x21deec=_0x32eaab[_0xf8e3('0xe0')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xf3'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'20',_0x32eaab)[_0xf8e3('0xb6')](function(_0xba6c1a){_0x31c16d=_0xba6c1a[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,'Global');rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xf4'));}delete this['actions'][_0x29174f[_0xf8e3('0xb2')]];}else{_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});}});}if(!(_0x52d91d[_0xf8e3('0x71')]&&_0x21d922==='16')){ut[_0xf8e3('0x7a')](_0x32eaab,_0xf8e3('0xf5'));logger['info'](_0xf8e3('0xf6'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab[_0xf8e3('0x5c')],_0xf8e3('0x6e'),_0x32eaab[_0xf8e3('0x51')]);}if(_0x21d922!=='ANSWER'){delete this[_0xf8e3('0x16')][_0x29174f['linkedid']];delete this['actions'][_0x29174f['destlinkedid']];}}};Preview[_0xf8e3('0x10')]['callProgressDetectingAgent']=function(_0x55b62f,_0x537cf0,_0x17234e){if(_[_0xf8e3('0xf7')](_0x537cf0)&&_0xf8e3('0xf8')!==typeof _0x537cf0){return;}if(_['isUndefined'](_0x17234e)&&_0xf8e3('0xf8')!==typeof _0x17234e){return;}switch(_0x17234e[_0xf8e3('0xf9')]){case'0':ut[_0xf8e3('0xfa')](_0x55b62f,0x0,_0xf8e3('0xfb'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xfd'));break;case'3':ut[_0xf8e3('0xfa')](_0x55b62f,0x3,_0xf8e3('0xd1'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xfe'));break;case'5':ut[_0xf8e3('0xfa')](_0x55b62f,0x5,_0xf8e3('0xcb'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xff'));break;case'8':ut[_0xf8e3('0xfa')](_0x55b62f,0x8,'Congestion');rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0x100'));break;case'22':ut['logAgent'](_0x55b62f,0x16,_0xf8e3('0x101'));rpcDb['createAgentHistory'](_0x55b62f,_0xf8e3('0x102'));break;default:ut[_0xf8e3('0xfa')](_0x55b62f,0xc,_0x17234e['reason']);rpcDb[_0xf8e3('0xfc')](_0x55b62f,'[callProgressDetectingAgent][logCongestion]');}ut[_0xf8e3('0x7a')](_0x537cf0,_0xf8e3('0x103'));logger[_0xf8e3('0x7f')](_0xf8e3('0x104'),_0x55b62f[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x537cf0[_0xf8e3('0x5c')],_0xf8e3('0x6e'),_0x537cf0[_0xf8e3('0x51')]);delete this[_0xf8e3('0x16')][_0x55b62f[_0xf8e3('0xb9')]];};Preview[_0xf8e3('0x10')][_0xf8e3('0xa4')]=function(_0x3ac8da,_0x46a1fb,_0xcbbdc1){return Promise[_0xf8e3('0x105')]()['then'](cmHopperAdditionalPhone[_0xf8e3('0xa4')](_0x3ac8da,_0x46a1fb,_0xcbbdc1))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')](_0xf8e3('0x106')));};Preview[_0xf8e3('0x10')][_0xf8e3('0xb7')]=function(_0x288156,_0x6d719d,_0x167ae0){return Promise[_0xf8e3('0x105')]()[_0xf8e3('0xb6')](cmHopperAdditionalPhone[_0xf8e3('0xb7')](_0x288156,_0x6d719d,_0x167ae0))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')](_0xf8e3('0x107')));};Preview[_0xf8e3('0x10')]['incrementPreviewCounters']=function(_0x3f4924){return Promise[_0xf8e3('0x105')]()['then'](cmHopperAdditionalPhone[_0xf8e3('0xb5')](_0x3f4924))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0xf8e3('0x108')]=function(_0x51f0a2,_0x445091,_0x4e9816,_0x5c146e,_0x31879c){var _0x4b21a6=this;return new Promise(function(_0x40d8aa,_0x39decc){if(_['isNil'](_0x445091)||_['isNil'](_0x445091[_0xf8e3('0x109')])||_['isNil'](_0x445091[_0xf8e3('0x10a')])||_[_0xf8e3('0x10b')](_0x445091[_0xf8e3('0x74')])){_0x39decc(ut['message'](_0xf8e3('0x10c'),_0x5c146e,_0x31879c));return;}var _0x2828d0=uuid['v4']();var _0x33cf45=_0x4b21a6[_0xf8e3('0x14')][_0x445091[_0xf8e3('0x6d')][_0xf8e3('0x5c')]];var _0xe0fb5d=_0x4e9816?_0x4b21a6[_0xf8e3('0x17')][_0x4e9816]['id']:undefined;_0x4b21a6[_0xf8e3('0x16')][_0x2828d0]=new Action(_0x445091,_0x33cf45,_0x2828d0,_0x4e9816,_0xe0fb5d);var _0xe70da7=_0x4b21a6[_0xf8e3('0x16')][_0x2828d0];_0xe70da7[_0xf8e3('0xb0')]=_0x5c146e;_0xe70da7[_0xf8e3('0xb1')]=_0x31879c;_0xe70da7[_0xf8e3('0x10d')]=_0x4e9816;if(_['isEmpty'](_0x51f0a2)){_0x4b21a6['execCall'](_0xe70da7,_0x33cf45,_0x445091,_0x4e9816)[_0xf8e3('0xb6')](function(_0x5aa33b){logger[_0xf8e3('0x7f')](_0xf8e3('0x10e'),'Queue:\x20'+_0xe70da7[_0xf8e3('0x6f')]+_0xf8e3('0x10f')+_0xe70da7[_0xf8e3('0xb4')],JSON[_0xf8e3('0x59')](_0x5aa33b));ami[_0xf8e3('0xa0')](_0xf8e3('0x110'),ut[_0xf8e3('0xa1')](_0xe70da7,_0xf8e3('0x111'),_0x4b21a6[_0xf8e3('0x14')][_0xe70da7['queue']]));_0x40d8aa(ut[_0xf8e3('0x50')](_0xf8e3('0x112')));})['catch'](function(_0x46b4a2){ut[_0xf8e3('0x62')](_0xf8e3('0x113'),_0x46b4a2);_0x39decc(ut['message'](_0xf8e3('0x114'),_0x5c146e,_0x31879c));});}else{_0x33cf45[_0xf8e3('0x3e')]+=0x1;ut[_0xf8e3('0x115')](_0xe70da7);rpcDb[_0xf8e3('0x116')](_0xe70da7,_0xf8e3('0x117'));delete _0x4b21a6['actions'][_0x2828d0];_0x39decc(ut['message'](_0xf8e3('0x118'),_0x5c146e,_0x31879c));}});};Preview['prototype'][_0xf8e3('0x99')]=function(_0x816bd7){return!_[_0xf8e3('0x10b')](_0x816bd7)&&!_['isNil'](_0x816bd7[_0xf8e3('0x5c')])&&!_[_0xf8e3('0x10b')](_0x816bd7[_0xf8e3('0x119')])&&_0x816bd7[_0xf8e3('0x119')]&&!_[_0xf8e3('0x10b')](this['trunks'][util['format'](_0xf8e3('0x11a'),_0x816bd7[_0xf8e3('0x5c')])])&&!_['isNil'](this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')](_0xf8e3('0x11a'),_0x816bd7['name'])][_0xf8e3('0x77')])&&(this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')]('SIP/%s',_0x816bd7['name'])][_0xf8e3('0x77')]==='reachable'||this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')](_0xf8e3('0x11a'),_0x816bd7['name'])]['status']===_0xf8e3('0x11b'));};Preview[_0xf8e3('0x10')][_0xf8e3('0x88')]=function(_0x286e1b,_0x1f9cbf){return this['execRun'](_0x286e1b,_0x1f9cbf)['then'](function(_0x350490){return _[_0xf8e3('0x72')](_0x350490,[_0xf8e3('0x50')]);})['catch'](function(_0x3d76aa){if(_0x3d76aa[_0xf8e3('0x11c')]){rpcDb[_0xf8e3('0x11d')](_0x286e1b);}if(_0x3d76aa['active']){rpcDb[_0xf8e3('0x8b')](_0x286e1b);}throw _[_0xf8e3('0x72')](_0x3d76aa,[_0xf8e3('0x50')]);});};Preview[_0xf8e3('0x10')][_0xf8e3('0x11e')]=function(_0x24a039,_0x5719f5){var _0x4c4aed=this;var _0x5d9e9b,_0x2b9984;return rpcDb['getContactPreview'](_0x24a039)[_0xf8e3('0xb6')](function(_0xc46d04){if(!_[_0xf8e3('0x10b')](_0xc46d04[0x0])){_0x2b9984=_0xc46d04[0x0]['recallme']?![]:!![];_0x5d9e9b=_0xc46d04[0x0]['recallme']?!![]:![];_0x5d9e9b=_0x5719f5?!![]:_0x5d9e9b;}var _0x5c1b30=_0x4c4aed[_0xf8e3('0x11f')](_0xc46d04);if(_0x5c1b30[_0xf8e3('0x120')]){rpcDb[_0xf8e3('0x121')](_['pick'](_0xc46d04[0x0],[_0xf8e3('0x74'),_0xf8e3('0x10a')]))[_0xf8e3('0xb6')](function(_0x1ab9d6){_0x4c4aed[_0xf8e3('0x108')](_0x1ab9d6,_0xc46d04[0x0],_0x5719f5,_0x2b9984,_0x5d9e9b)['then'](function(_0x1d9227){return _0x1d9227;})[_0xf8e3('0x78')](function(_0x26d136){throw _0x26d136;});})[_0xf8e3('0x78')](function(_0x50173c){ut[_0xf8e3('0x62')](_0xf8e3('0x122'),_0x50173c);throw ut['message']('Call\x20unsuccessful',_0x2b9984,_0x5d9e9b);});}else{throw ut[_0xf8e3('0x50')](_0x5c1b30[_0xf8e3('0x50')],_0x2b9984,_0x5d9e9b);}})['catch'](function(_0x157b75){ut[_0xf8e3('0x62')](_0xf8e3('0x123'),_0x157b75);throw ut[_0xf8e3('0x50')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xf8e3('0x10')][_0xf8e3('0x11f')]=function(_0x546ec0){if(_[_0xf8e3('0x10b')](_0x546ec0)||_[_0xf8e3('0x124')](_0x546ec0)||!_[_0xf8e3('0x10b')](_0x546ec0[0x0][_0xf8e3('0x86')])&&_[_0xf8e3('0x10b')](_0x546ec0[0x0][_0xf8e3('0x86')][_0xf8e3('0x5c')])){ut[_0xf8e3('0x62')](_0xf8e3('0x125'),_0x546ec0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x56c21a=this[_0xf8e3('0x14')][_0x546ec0[0x0]['Queue'][_0xf8e3('0x5c')]];_0x56c21a[_0xf8e3('0x50')]=_0xf8e3('0x9c');if(_[_0xf8e3('0x10b')](_0x56c21a)){ut[_0xf8e3('0x62')](_0xf8e3('0x126'),_0x56c21a);return{'isValid':![],'message':_0xf8e3('0x127')};}if(!this[_0xf8e3('0x99')](_0x56c21a[_0xf8e3('0x56')])){ut[_0xf8e3('0x62')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xf8e3('0x128')+_0x56c21a[_0xf8e3('0x5c')]+_0xf8e3('0x129'));if(!this[_0xf8e3('0x99')](_0x56c21a[_0xf8e3('0x9a')])){ut['logger'](_0xf8e3('0x12a'),_0x56c21a[_0xf8e3('0x5c')]+_0xf8e3('0x12b'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xf8e3('0x97')](_0x56c21a[_0xf8e3('0x37')])){ut['logger'](_0xf8e3('0x12c'),_0x56c21a['name']+_0xf8e3('0x12d'));return{'isValid':![],'message':_0xf8e3('0x128')+_0x56c21a['name']+_0xf8e3('0x12d')};}return{'isValid':!![],'message':_0xf8e3('0x12e')};};Preview[_0xf8e3('0x10')][_0xf8e3('0x12f')]=function(_0x381500,_0x72280a,_0x5578db,_0x289ae2){var _0x13d3bf=this;return new Promise(function(_0x4ca370,_0x5162db){var _0x4f4979=_0x381500['uniqueid'];var _0x3ea731=_0x13d3bf['isTrunkReachable'](_0x72280a[_0xf8e3('0x56')])?util[_0xf8e3('0x5a')]('SIP/%s/%s%s',_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x5c')],_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x3b')])?'':_0x72280a[_0xf8e3('0x3b')][_0xf8e3('0x130')]()||'',_0x72280a[_0xf8e3('0x131')]>0x0?_0x5578db[_0xf8e3('0x10a')][_0xf8e3('0x132')](_0x72280a[_0xf8e3('0x131')]):_0x5578db[_0xf8e3('0x10a')]):util[_0xf8e3('0x5a')](_0xf8e3('0x133'),_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x9a')])?_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x5c')]:_0x72280a['TrunkBackup']['name'],_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x3b')])?'':_0x72280a['dialPrefix'][_0xf8e3('0x130')]()||'',_0x72280a[_0xf8e3('0x131')]>0x0?_0x5578db[_0xf8e3('0x10a')]['substring'](_0x72280a[_0xf8e3('0x131')]):_0x5578db[_0xf8e3('0x10a')]);var _0x4242d9=_0x13d3bf[_0xf8e3('0x99')](_0x72280a['Trunk'])?ut[_0xf8e3('0x134')](_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x57')],_0x72280a[_0xf8e3('0x135')],_0x72280a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xf8e3('0x136')](_0x72280a[_0xf8e3('0x39')],_0x72280a[_0xf8e3('0x137')]):_0x72280a[_0xf8e3('0x39')]):ut[_0xf8e3('0x134')](_['isNil'](_0x72280a['TrunkBackup'])?_0x72280a['Trunk']['callerid']:_0x72280a[_0xf8e3('0x9a')]['callerid'],_0x72280a[_0xf8e3('0x135')],_0x72280a[_0xf8e3('0x137')]>0x0?ut['getCallerIdRandom'](_0x72280a[_0xf8e3('0x39')],_0x72280a['dialRandomLastDigitCallerIdNumber']):_0x72280a[_0xf8e3('0x39')]);if(_0x4242d9){_0x381500[_0xf8e3('0x138')]=ut[_0xf8e3('0x139')](_0x4242d9);_0x381500[_0xf8e3('0x13a')]=ut['extractCalleridNumber'](_0x4242d9);}var _0x35659e=ut['addVariables'](_0x72280a,_0x5578db,_0x3ea731,_0x4242d9,_0x4f4979,_0x381500);_[_0xf8e3('0x13b')](_0x381500,ut[_0xf8e3('0x13c')](_0x35659e));_0x381500['starttime']=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));_0x72280a[_0xf8e3('0x13d')]=_0x35659e;ami[_0xf8e3('0x76')](ut['variablesAction'](_0x381500,_0x72280a,_0x35659e,_0x381500[_0xf8e3('0xb1')],_0x289ae2))[_0xf8e3('0xb6')](function(_0x1ead32){_0x72280a[_0xf8e3('0x51')]+=0x1;logger[_0xf8e3('0x7f')](_0xf8e3('0x13e'),_0x4f4979,_0xf8e3('0xba'),_0x72280a['name'],_0xf8e3('0x6e'),_0x72280a['originated']);_0x4ca370(_0x1ead32);})[_0xf8e3('0x78')](function(_0x2fa429){ut[_0xf8e3('0xfa')](_0x381500,0xe,_0xf8e3('0x13f'));rpcDb[_0xf8e3('0xfc')](_0x381500,'[originateFailure][logOriginateFailure]');_0x5162db(_0x2fa429);});});};Preview[_0xf8e3('0x10')][_0xf8e3('0x21')]=function(_0x3eff9c){if(this['actions'][_0x3eff9c[_0xf8e3('0xb2')]]){this[_0xf8e3('0x16')][_0x3eff9c[_0xf8e3('0xb2')]][_0xf8e3('0x140')]=_0x3eff9c[_0xf8e3('0x140')];}};Preview[_0xf8e3('0x10')]['syncOriginateResponse']=function(_0x1fcb2b){var _0x58bc44=this;var _0x40c4f9=this['actions'][_0x1fcb2b[_0xf8e3('0x141')]];if(_0x40c4f9){if(_0x40c4f9[_0xf8e3('0x10d')]&&this['agents'][_0x40c4f9[_0xf8e3('0x10d')]]){ut[_0xf8e3('0x142')](_0x40c4f9,this[_0xf8e3('0x17')][_0x40c4f9['lookAgent']][_0xf8e3('0x5c')],this['agents'][_0x40c4f9['lookAgent']]['id']);}var _0x5cb60d=_[_0xf8e3('0x143')](_0x40c4f9);_0x5cb60d['responsetime']=moment()[_0xf8e3('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4a59a4=_0x58bc44['campaignsPreview'][_0x40c4f9['queue']];if(ut[_0xf8e3('0x144')](_0x1fcb2b[_0xf8e3('0x145')])){if(_0x40c4f9['unlockAgent']){rpcDb[_0xf8e3('0x11d')](_0x40c4f9['idContact']);}if(_0x40c4f9['activeContact']){rpcDb['disableContact'](_0x40c4f9[_0xf8e3('0xb4')]);}ami[_0xf8e3('0xa0')]('custom:agentringnoanswer',ut['buildObj'](_0x40c4f9,'rejected',this['campaignsPreview'][_0x40c4f9[_0xf8e3('0x6f')]]));this[_0xf8e3('0x146')](_0x5cb60d,_0x4a59a4,_0x1fcb2b);}else{_0x40c4f9[_0xf8e3('0x147')]=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));ut[_0xf8e3('0xfa')](_0x5cb60d,0x4,_0xf8e3('0xc4'));rpcDb['createAgentHistory'](_0x5cb60d,_0xf8e3('0x148'));}}};Preview['prototype'][_0xf8e3('0x149')]=function(_0x1b51f5){var _0x3f3b72=this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]];var _0x99b6ef;if(_0x3f3b72){_0x99b6ef=this[_0xf8e3('0x14')][_0x3f3b72[_0xf8e3('0x6f')]];logger[_0xf8e3('0x7f')](_0xf8e3('0x14a'),_0x1b51f5[_0xf8e3('0xb2')],_0xf8e3('0xba'),_0x99b6ef[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);}if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]&&_0x1b51f5[_0xf8e3('0xb2')]!==_0x1b51f5[_0xf8e3('0xb9')]){if(_0x1b51f5[_0xf8e3('0x14b')]==='16'&&this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]['dialAnswer']){this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')]);}else if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){logger[_0xf8e3('0x7f')](_0xf8e3('0x14c'),_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause'],_0xf8e3('0xba'),_0x99b6ef['name'],'pTalking:\x20',_0x99b6ef[_0xf8e3('0x2e')]);this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause']);}}else if(_0x3f3b72&&_[_0xf8e3('0x10b')](_0x3f3b72[_0xf8e3('0x14d')])&&_0x99b6ef[_0xf8e3('0x14e')]&&_0x1b51f5[_0xf8e3('0xb2')]===_0x1b51f5[_0xf8e3('0xb9')]&&_[_0xf8e3('0x10b')](_0x1b51f5['reason'])&&_0x1b51f5[_0xf8e3('0x14b')]==='16'&&_0x1b51f5[_0xf8e3('0x14f')]==='6'&&_[_0xf8e3('0xf7')](_0x3f3b72['transfer'])){if(_0x3f3b72[_0xf8e3('0xb0')]){rpcDb[_0xf8e3('0x11d')](_0x3f3b72[_0xf8e3('0xb4')]);}if(_0x3f3b72[_0xf8e3('0xb1')]){rpcDb[_0xf8e3('0x8b')](_0x3f3b72['idContact']);}_0x1b51f5['reason']='22';this[_0xf8e3('0x146')](_0x3f3b72,_0x99b6ef,_0x1b51f5);}else if(_0x3f3b72&&_0x3f3b72[_0xf8e3('0x150')]){if(_0x1b51f5[_0xf8e3('0x14b')]==='16'&&this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){logger[_0xf8e3('0x7f')]('[syncHangup][talking][transfer]',_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')],_0xf8e3('0xba'),_0x99b6ef['name'],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')]);}else if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]['dialAnswer']){logger[_0xf8e3('0x7f')](_0xf8e3('0x14c'),_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')],_0xf8e3('0xba'),_0x99b6ef[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);this['callProgressDetectingCustomer'](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause']);}}};Preview[_0xf8e3('0x10')][_0xf8e3('0x1f')]=function(_0x13ff28){if(this[_0xf8e3('0x16')][_0x13ff28[_0xf8e3('0x151')]]&&_0x13ff28[_0xf8e3('0x151')]!==_0x13ff28[_0xf8e3('0x152')]){this[_0xf8e3('0x9d')](_0x13ff28,_0x13ff28['destlinkedid'],_0x13ff28[_0xf8e3('0xf2')]);}};Preview['prototype'][_0xf8e3('0x1e')]=function(_0x130164){if(this[_0xf8e3('0x16')][_0x130164[_0xf8e3('0xb2')]]&&_0x130164[_0xf8e3('0xb2')]!==_0x130164[_0xf8e3('0xb9')]&&!this[_0xf8e3('0x16')][_0x130164[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){if(_0x130164['cause']==='1'){this[_0xf8e3('0x9d')](_0x130164,_0x130164[_0xf8e3('0xb2')],_0x130164[_0xf8e3('0x14b')]);}}};Preview[_0xf8e3('0x10')]['addVariable']=function(_0xd9cdda,_0x5c7e32,_0x1cf9bb){if(this[_0xf8e3('0x16')][_0xd9cdda]){if(_[_0xf8e3('0x10b')](this[_0xf8e3('0x16')][_0xd9cdda]['variables'])){this[_0xf8e3('0x16')][_0xd9cdda][_0xf8e3('0x13d')]={};}this['actions'][_0xd9cdda][_0xf8e3('0x13d')][_0x5c7e32]=_0x1cf9bb;}};Preview[_0xf8e3('0x10')][_0xf8e3('0x23')]=function(_0x720431){try{if(!_[_0xf8e3('0x10b')](_0x720431)){if(ut[_0xf8e3('0x153')](_[_0xf8e3('0x154')](_0x720431[_0xf8e3('0x155')])[0x0])){this[_0xf8e3('0x156')](_0x720431['uniqueid'],_[_0xf8e3('0x154')](_0x720431['variable'])[0x0],_0x720431[_0xf8e3('0x157')]);}}}catch(_0x549b0a){logger[_0xf8e3('0x158')](_0xf8e3('0x159'),util[_0xf8e3('0x15a')](_0x549b0a,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xf8e3('0x25')]=function(_0x2891c3){if(_0x2891c3){if(this[_0xf8e3('0x16')][_0x2891c3[_0xf8e3('0x15b')]]){this[_0xf8e3('0x16')][_0x2891c3[_0xf8e3('0x15b')]][_0xf8e3('0x150')]=!![];}}};Preview[_0xf8e3('0x10')]['syncBlindTransfer']=function(_0x5387a0){if(_0x5387a0){if(this[_0xf8e3('0x16')][_0x5387a0['transfererlinkedid']]){this['actions'][_0x5387a0[_0xf8e3('0x15c')]][_0xf8e3('0x150')]=!![];}}};module[_0xf8e3('0x15d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 63b422d..60ffe8d 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 _0x63ac=['calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0x226c64,_0x4608ac){var _0x3bf4c0=function(_0x485820){while(--_0x485820){_0x226c64['push'](_0x226c64['shift']());}};_0x3bf4c0(++_0x4608ac);}(_0x63ac,0x1dd));var _0xc63a=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0x63ac[_0x381bff];return _0x201ab1;};'use strict';var util=require(_0xc63a('0x0'));var BPromise=require(_0xc63a('0x1'));var logger=require('../../../config/logger')(_0xc63a('0x2'));var _=require(_0xc63a('0x3'));var cmHopper=require(_0xc63a('0x4'));var cmHopperFinal=require(_0xc63a('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc63a('0x6'));var voiceQueueRt=require(_0xc63a('0x7'));var agentReportPreview=require(_0xc63a('0x8'));var voiceQueueReport=require(_0xc63a('0x9'));function loggerCatch(_0x36aaf4){return function(_0x34f3b8){logger[_0xc63a('0xa')](_0x36aaf4,util['inspect'](_0x34f3b8,{'showHidden':![],'depth':null}));};}function create(_0x1e31be){return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](cmHopperHistory[_0xc63a('0xd')](_0x1e31be))[_0xc63a('0xe')](loggerCatch(_0xc63a('0xf')));}function createAgent(_0x11794d){return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](agentReportPreview[_0xc63a('0xd')](_0x11794d))[_0xc63a('0xe')](loggerCatch(_0xc63a('0xf')));}function moveContact(_0x210a90){return BPromise['resolve']()['then'](cmHopper[_0xc63a('0x10')](_0x210a90,!![]))[_0xc63a('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x5006d4){return BPromise['resolve']()[_0xc63a('0xc')](cmHopperBlack[_0xc63a('0x11')](_0x5006d4))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x12')));};exports['getContactPreview']=function(_0x490d6b){return BPromise['resolve']()['then'](cmHopper[_0xc63a('0x13')](_0x490d6b))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x14')));};exports[_0xc63a('0xd')]=function(_0x184a92,_0x4846e2){create(_0x184a92)[_0xc63a('0xe')](loggerCatch(_0x4846e2));moveContact(_0x184a92)[_0xc63a('0xe')](loggerCatch(_0x4846e2));};exports[_0xc63a('0x15')]=function(_0x215f3b,_0x3aeea6){createAgent(_0x215f3b)[_0xc63a('0xe')](loggerCatch(_0x3aeea6));};exports[_0xc63a('0x16')]=function(_0x3ac6f0,_0x4bb83d){create(_0x3ac6f0)[_0xc63a('0xe')](loggerCatch(_0x4bb83d));};exports['createCustomerFinal']=function(_0x839b38,_0x24f0ba){moveContact(_0x839b38)['catch'](loggerCatch(_0x24f0ba));};exports['rescheduleContact']=function(_0x2010f9,_0x290b6d,_0xcbab){if(_0x290b6d){_0x2010f9[_0xc63a('0x17')]=null;}if(_0xcbab){_0x2010f9[_0xc63a('0x18')]=![];}return BPromise['resolve']()[_0xc63a('0xc')](cmHopper[_0xc63a('0x19')](_0x2010f9))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x1a')));};exports[_0xc63a('0x1b')]=function(_0x52fc44){return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](cmHopper['countReScheduled'](_0x52fc44))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x1c')));};exports[_0xc63a('0x1d')]=function(_0x350a00){return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](cmHopper[_0xc63a('0x1d')]({'UserId':null},_0x350a00,0x1))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x1e')));};exports[_0xc63a('0x1f')]=function(_0x5a08cf){return BPromise[_0xc63a('0xb')]()['then'](cmHopper[_0xc63a('0x1d')]({'active':![]},_0x5a08cf,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0xc63a('0x20')]=function(_0xf5580a){var _0x53aa0a={};_0x53aa0a[_0xc63a('0x21')]=_0xf5580a[_0xc63a('0x21')];_0x53aa0a['uniqueid']=_0xf5580a[_0xc63a('0x22')];_0x53aa0a[_0xc63a('0x23')]=_0xf5580a[_0xc63a('0x23')];_0x53aa0a['calleridname']=_0xf5580a[_0xc63a('0x24')];_0x53aa0a[_0xc63a('0x25')]=_0xf5580a[_0xc63a('0x25')];_0x53aa0a[_0xc63a('0x26')]=_0xf5580a[_0xc63a('0x27')];_0x53aa0a['queuecallerleaveAt']=_0xf5580a[_0xc63a('0x27')];_0x53aa0a[_0xc63a('0x28')]=0x1;_0x53aa0a[_0xc63a('0x29')]=_0xf5580a[_0xc63a('0x2a')];_0x53aa0a[_0xc63a('0x2b')]=_0xf5580a[_0xc63a('0x2c')];_0x53aa0a[_0xc63a('0x2d')]=_0xc63a('0x2e');_0x53aa0a[_0xc63a('0x2f')]=_0xc63a('0x30');_0x53aa0a[_0xc63a('0x31')]=0x0;_0x53aa0a[_0xc63a('0x32')]=0x1;_0x53aa0a[_0xc63a('0x33')]=_0xf5580a[_0xc63a('0x2c')];_0x53aa0a['queuecallerexitreason']=_0xc63a('0x34');return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](voiceQueueReport[_0xc63a('0x35')](_0x53aa0a))[_0xc63a('0xe')](loggerCatch(_0xc63a('0x36')));};exports['getContactRecallMe']=function(_0x315d9a,_0x4c9c5e){return BPromise[_0xc63a('0xb')]()[_0xc63a('0xc')](cmHopper[_0xc63a('0x37')](_0x315d9a,_0x4c9c5e))[_0xc63a('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x2ee87b){return BPromise['resolve']()[_0xc63a('0xc')](cmHopper[_0xc63a('0x19')](_0x2ee87b,!![],!![]))['catch'](loggerCatch(_0xc63a('0x38')));}; \ No newline at end of file +var _0x807b=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x807b,0x1ac));var _0xb807=function(_0x2f8dc3,_0x5b9109){_0x2f8dc3=_0x2f8dc3-0x0;var _0x531ef2=_0x807b[_0x2f8dc3];return _0x531ef2;};'use strict';var util=require(_0xb807('0x0'));var BPromise=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var _=require('lodash');var cmHopper=require(_0xb807('0x4'));var cmHopperFinal=require(_0xb807('0x5'));var cmHopperHistory=require(_0xb807('0x6'));var cmHopperBlack=require(_0xb807('0x7'));var voiceQueueRt=require(_0xb807('0x8'));var agentReportPreview=require(_0xb807('0x9'));var voiceQueueReport=require(_0xb807('0xa'));function loggerCatch(_0x58ccc8){return function(_0x49ff7f){logger[_0xb807('0xb')](_0x58ccc8,util[_0xb807('0xc')](_0x49ff7f,{'showHidden':![],'depth':null}));};}function create(_0x54965d){return BPromise['resolve']()[_0xb807('0xd')](cmHopperHistory[_0xb807('0xe')](_0x54965d))[_0xb807('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x40ceba){return BPromise['resolve']()[_0xb807('0xd')](agentReportPreview[_0xb807('0xe')](_0x40ceba))[_0xb807('0xf')](loggerCatch(_0xb807('0x10')));}function moveContact(_0x184423){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper[_0xb807('0x12')](_0x184423,!![]))['catch'](loggerCatch(_0xb807('0x13')));}exports[_0xb807('0x14')]=function(_0x1034b0){return BPromise[_0xb807('0x11')]()['then'](cmHopperBlack[_0xb807('0x14')](_0x1034b0))[_0xb807('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1ad707){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper[_0xb807('0x15')](_0x1ad707))[_0xb807('0xf')](loggerCatch(_0xb807('0x16')));};exports[_0xb807('0xe')]=function(_0x318965,_0x4f4cc9){create(_0x318965)[_0xb807('0xf')](loggerCatch(_0x4f4cc9));moveContact(_0x318965)[_0xb807('0xf')](loggerCatch(_0x4f4cc9));};exports['createAgentHistory']=function(_0x419005,_0x2ad31f){createAgent(_0x419005)[_0xb807('0xf')](loggerCatch(_0x2ad31f));};exports['createCustomerHistory']=function(_0x2cac44,_0x5026f6){create(_0x2cac44)['catch'](loggerCatch(_0x5026f6));};exports['createCustomerFinal']=function(_0x1ee621,_0x2a6e6a){moveContact(_0x1ee621)[_0xb807('0xf')](loggerCatch(_0x2a6e6a));};exports[_0xb807('0x17')]=function(_0x75dfeb,_0x59b3a9,_0x99fb51){if(_0x59b3a9){_0x75dfeb['UserId']=null;}if(_0x99fb51){_0x75dfeb[_0xb807('0x18')]=![];}return BPromise[_0xb807('0x11')]()['then'](cmHopper[_0xb807('0x17')](_0x75dfeb))[_0xb807('0xf')](loggerCatch(_0xb807('0x19')));};exports['countReScheduled']=function(_0x2ae18f){return BPromise['resolve']()[_0xb807('0xd')](cmHopper[_0xb807('0x1a')](_0x2ae18f))[_0xb807('0xf')](loggerCatch(_0xb807('0x1b')));};exports['unlockContact']=function(_0x29ac8b){return BPromise['resolve']()['then'](cmHopper[_0xb807('0x1c')]({'UserId':null},_0x29ac8b,0x1))[_0xb807('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xb807('0x1d')]=function(_0xdaae80){return BPromise[_0xb807('0x11')]()['then'](cmHopper[_0xb807('0x1c')]({'active':![]},_0xdaae80,0x1))[_0xb807('0xf')](loggerCatch(_0xb807('0x1e')));};exports[_0xb807('0x1f')]=function(_0x145767){var _0x14891e={};_0x14891e[_0xb807('0x20')]=_0x145767[_0xb807('0x20')];_0x14891e[_0xb807('0x21')]=_0x145767['uniqueid'];_0x14891e[_0xb807('0x22')]=_0x145767[_0xb807('0x22')];_0x14891e[_0xb807('0x23')]=_0x145767[_0xb807('0x23')];_0x14891e[_0xb807('0x24')]=_0x145767[_0xb807('0x24')];_0x14891e[_0xb807('0x25')]=_0x145767[_0xb807('0x26')];_0x14891e[_0xb807('0x27')]=_0x145767[_0xb807('0x26')];_0x14891e[_0xb807('0x28')]=0x1;_0x14891e[_0xb807('0x29')]=_0x145767[_0xb807('0x2a')];_0x14891e[_0xb807('0x2b')]=_0x145767[_0xb807('0x2c')];_0x14891e[_0xb807('0x2d')]=_0xb807('0x2e');_0x14891e[_0xb807('0x2f')]=_0xb807('0x30');_0x14891e['holdtime']=0x0;_0x14891e[_0xb807('0x31')]=0x1;_0x14891e['lastAssignedTo']=_0x145767[_0xb807('0x2c')];_0x14891e[_0xb807('0x32')]=_0xb807('0x33');return BPromise['resolve']()[_0xb807('0xd')](voiceQueueReport[_0xb807('0x34')](_0x14891e))[_0xb807('0xf')](loggerCatch(_0xb807('0x35')));};exports[_0xb807('0x36')]=function(_0x4e7c2b,_0x385e3e){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper['getContactRecallMe'](_0x4e7c2b,_0x385e3e))[_0xb807('0xf')](loggerCatch(_0xb807('0x37')));};exports[_0xb807('0x38')]=function(_0x2e4257){return BPromise['resolve']()[_0xb807('0xd')](cmHopper[_0xb807('0x17')](_0x2e4257,!![],!![]))['catch'](loggerCatch(_0xb807('0x39')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index b080a4b..9f71022 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 _0x4e94=['seconds','createBody','CampaignId','filterKey','idContact','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','hasOwnProperty','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','statedesc','logLookAgent','membername','logCustomer','talktime','answertime','Failure','RECALL','BOOKED','uniqueid','channelAgent','xcally-motion-preview','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff'];(function(_0x324103,_0x571655){var _0x13b15f=function(_0x4fa89b){while(--_0x4fa89b){_0x324103['push'](_0x324103['shift']());}};_0x13b15f(++_0x571655);}(_0x4e94,0xca));var _0x44e9=function(_0x512e72,_0x49ffe1){_0x512e72=_0x512e72-0x0;var _0x143086=_0x4e94[_0x512e72];return _0x143086;};'use strict';var util=require(_0x44e9('0x0'));var _=require(_0x44e9('0x1'));var moment=require(_0x44e9('0x2'));var logger=require(_0x44e9('0x3'))(_0x44e9('0x4'));var ipAgi=process[_0x44e9('0x5')][_0x44e9('0x6')]||_0x44e9('0x7');function getSeconds(_0x3be8d4,_0x5668cb){var _0x3f21d7=moment(_0x3be8d4)[_0x44e9('0x8')](0x0);var _0x35df98=moment(_0x5668cb)['milliseconds'](0x0);return _0x3f21d7[_0x44e9('0x9')](_0x35df98,'seconds');}exports[_0x44e9('0xa')]=function(_0x39688d){return function(_0x1b87d3){logger['error'](_0x39688d,util[_0x44e9('0xb')](_0x1b87d3,{'showHidden':![],'depth':null}));};};exports[_0x44e9('0xc')]=function(_0x529674,_0x5ea0de){logger[_0x44e9('0xd')](_0x529674,util[_0x44e9('0xb')](_0x5ea0de,{'showHidden':![],'depth':null}));};exports[_0x44e9('0xe')]=function(_0x389541,_0x46375a){logger['error'](_0x389541,util[_0x44e9('0xb')](_0x46375a,{'showHidden':![],'depth':null}));};exports[_0x44e9('0xf')]=function(_0x37015a){return function(_0x1bf4c9){logger['info'](_0x37015a,util[_0x44e9('0xb')](_0x1bf4c9,{'showHidden':![],'depth':null}));};};exports[_0x44e9('0x10')]=function(_0x47cb96,_0x3c356c,_0x83cf01){return{'message':_0x47cb96,'unlock':_0x3c356c,'active':_0x83cf01};};exports[_0x44e9('0x11')]=function(_0x173859,_0x190edc,_0x4911ff){if(!_['isUndefined'](_0x4911ff)&&_0x44e9('0x12')===typeof _0x4911ff&&!_[_0x44e9('0x13')](_0x4911ff)){if(!_[_0x44e9('0x14')](_0x190edc)&&_0x44e9('0x12')===typeof _0x190edc&&!_[_0x44e9('0x13')](_0x190edc)){return util[_0x44e9('0x15')](_0x44e9('0x16'),_0x190edc,_0x4911ff);}return util['format'](_0x44e9('0x16'),_0x4911ff,_0x4911ff);}if(!_[_0x44e9('0x14')](_0x173859)&&_0x44e9('0x12')===typeof _0x173859&&!_[_0x44e9('0x13')](_0x173859)){return _0x173859;}return _0x44e9('0x17');};exports[_0x44e9('0x18')]=function(_0x5f3164){if(_[_0x44e9('0x19')](_0x5f3164)){return![];}return _0x5f3164;};exports[_0x44e9('0x1a')]=function(_0xfd6d9e,_0x2839fc,_0x1868c4,_0x1fe80c,_0x1fa8b7,_0x4626af){var _0x460ec3={'XMD-QUEUE':_0x2839fc[_0x44e9('0x1b')]?_0x2839fc[_0x44e9('0x1b')][_0x44e9('0x1c')]:'','XMD-CALLERID':_0x1fe80c,'XMD-CALLERID-PREVIEW':_0x4626af?util[_0x44e9('0x15')]('\x22%s\x22\x20<%s>',_0x4626af[_0x44e9('0x1d')],_0x4626af[_0x44e9('0x1e')]):_0x1fe80c,'XMD-DIALID':_0x1fa8b7,'XMD-CONTACTID':_0x2839fc[_0x44e9('0x1f')],'XMD-CDRTYPE':_0x44e9('0x20'),'CALLERID(all)':_0x1fe80c,'XMD-VOICEQUEUEID':_0x2839fc[_0x44e9('0x21')],'XMD-DIALCHANNEL':_0x1868c4,'XMD-DIALTIMEOUT':_0xfd6d9e[_0x44e9('0x22')]||0x1e,'XMD-DIALOPTIONS':util[_0x44e9('0x15')](_0x44e9('0x23'),_0xfd6d9e['dialQueueProject2']?'g':'',_[_0x44e9('0x13')](_0xfd6d9e[_0x44e9('0x24')])?'':_0x44e9('0x25')),'XMD-DIALURL':_0xfd6d9e[_0x44e9('0x26')]||'','XMD-AGI':_0xfd6d9e[_0x44e9('0x27')]?util[_0x44e9('0x15')](_0x44e9('0x28'),ipAgi,_0xfd6d9e[_0x44e9('0x27')]):'NONE','XMD-AGIAFTER':_0xfd6d9e[_0x44e9('0x29')]?util[_0x44e9('0x15')](_0x44e9('0x28'),ipAgi,_0xfd6d9e[_0x44e9('0x29')]):_0x44e9('0x2a'),'XMD-ORIGINATECALLERIDNUM':_0x4626af?_0x4626af[_0x44e9('0x2b')]:'','XMD-ORIGINATECALLERIDNAME':_0x4626af?_0x4626af[_0x44e9('0x2c')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x44e9('0x2d')};if(!_[_0x44e9('0x13')](_0xfd6d9e[_0x44e9('0x24')])){_0x460ec3[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xfd6d9e['monitor_format'];_0x460ec3[util[_0x44e9('0x15')]('%s',_0x44e9('0x2e'))]=_0x1fa8b7;}if(_0x2839fc&&_0x2839fc[_0x44e9('0x2f')]){for(var _0x597eb0 in _0x2839fc[_0x44e9('0x2f')]){if(_0x2839fc[_0x44e9('0x2f')]['hasOwnProperty'](_0x597eb0)){if(!_[_0x44e9('0x19')](_0x2839fc['Contact'][_0x597eb0])&&_0x597eb0!=='id'&&_0x597eb0!=='tags'&&_0x597eb0!==_0x44e9('0x30')&&_0x597eb0!==_0x44e9('0x31')){_0x460ec3[util['format'](_0x44e9('0x32'),_0x44e9('0x33'),_[_0x44e9('0x34')](_0x597eb0))]=_0x2839fc[_0x44e9('0x2f')][_0x597eb0];}}}}return _0x460ec3;};exports['toLowerVariables']=function(_0x5d5bad){var _0x27cb6f={};for(var _0x1b16f4 in _0x5d5bad){if(_0x5d5bad[_0x44e9('0x35')](_0x1b16f4)){_0x27cb6f[util[_0x44e9('0x15')]('%s',_[_0x44e9('0x36')](_0x1b16f4))]=_0x5d5bad[_0x1b16f4];}}return{'variables':_0x27cb6f};};exports[_0x44e9('0x37')]=function(_0x9d864c,_0x1b9133){if(!_[_0x44e9('0x19')](_0x9d864c)){if(_0x9d864c[_0x44e9('0x35')](_0x44e9('0x38'))){if(_0x9d864c[_0x44e9('0x38')]>0x0){_0x9d864c['originated']-=0x1;}else{logger[_0x44e9('0x39')](_0x44e9('0x3a'),_0x1b9133);}}}else{logger[_0x44e9('0x39')](_0x44e9('0x3b'),_0x1b9133);}};exports[_0x44e9('0x3c')]=function(_0x444190){var _0x2b73ea=moment()[_0x44e9('0x15')](_0x44e9('0x3d'));_0x444190[_0x44e9('0x3e')]=0xd;_0x444190['statedesc']='Blacklist';_0x444190[_0x44e9('0x3f')]=_0x2b73ea;_0x444190[_0x44e9('0x40')]=_0x2b73ea;_0x444190[_0x44e9('0x41')]=_0x2b73ea;};exports['logAgent']=function(_0x1127a3,_0x2549b7,_0x46ba59){var _0x3a47a3=moment()[_0x44e9('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x1127a3[_0x44e9('0x3e')]=_0x2549b7;_0x1127a3[_0x44e9('0x42')]=_0x46ba59;_0x1127a3[_0x44e9('0x40')]=_0x3a47a3;_0x1127a3['ringtime']=getSeconds(_0x1127a3[_0x44e9('0x40')],_0x1127a3[_0x44e9('0x3f')]);};exports[_0x44e9('0x43')]=function(_0x72721,_0x17e2a0,_0x3a7709){_0x72721[_0x44e9('0x44')]=_0x17e2a0;_0x72721['UserId']=_0x3a7709;};exports[_0x44e9('0x45')]=function(_0x2f50de,_0x4cbbd5,_0x531d5b){var _0x3db6f1=moment()[_0x44e9('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f50de['state']=_0x4cbbd5;_0x2f50de[_0x44e9('0x42')]=_0x531d5b;_0x2f50de[_0x44e9('0x40')]=_0x2f50de[_0x44e9('0x40')]?_0x2f50de[_0x44e9('0x40')]:_0x3db6f1;_0x2f50de[_0x44e9('0x41')]=_0x2f50de[_0x44e9('0x41')]?_0x2f50de[_0x44e9('0x41')]:_0x3db6f1;_0x2f50de['ringtime']=getSeconds(_0x2f50de[_0x44e9('0x40')]||0x0,_0x2f50de[_0x44e9('0x3f')]||0x0);_0x2f50de[_0x44e9('0x46')]=_0x2f50de[_0x44e9('0x47')]?getSeconds(_0x2f50de[_0x44e9('0x41')],_0x2f50de[_0x44e9('0x47')]):0x0;};exports['isFailure']=function(_0x5ea6e5){return _0x5ea6e5===_0x44e9('0x48');};exports['variablesAction']=function(_0x2ccc6d,_0x2a3f91,_0x3f8c66,_0x343cf4,_0x3c1e9c){var _0x558b05=_0x343cf4?_0x44e9('0x49'):_0x2ccc6d['calleridname'];_0x558b05=_0x3c1e9c?_0x44e9('0x4a'):_0x558b05;return{'actionid':_0x2ccc6d[_0x44e9('0x4b')],'action':'originate','channel':_0x2ccc6d[_0x44e9('0x4c')],'callerid':util[_0x44e9('0x15')](_0x44e9('0x16'),_0x558b05,_0x2ccc6d[_0x44e9('0x1e')]),'Exten':_0x44e9('0x4d'),'Context':_0x44e9('0x4e'),'Priority':'1','variable':_0x3f8c66,'timeout':(_0x2a3f91['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2ccc6d['uniqueid']};};exports[_0x44e9('0x4f')]=function(_0x3be0ce){return _0x3be0ce[_0x44e9('0x50')]+_0x3be0ce[_0x44e9('0x51')]+_0x3be0ce[_0x44e9('0x52')]+_0x3be0ce['countagentrejectretry']+_0x3be0ce[_0x44e9('0x53')];};exports[_0x44e9('0x54')]=function(_0x55d204){var _0x4972bb=_[_0x44e9('0x55')](_0x55d204);_0x4972bb['state']=0xf;_0x4972bb[_0x44e9('0x42')]=_0x44e9('0x56');return _0x4972bb;};exports[_0x44e9('0x57')]=function(_0x2e526a,_0x34f9b3,_0x6c25a){var _0x324a98={};_0x324a98[_0x34f9b3]=_0x2e526a[_0x34f9b3];_0x324a98[_0x44e9('0x58')]=![];_0x324a98[_0x44e9('0x59')]=moment()[_0x44e9('0x5a')](_0x6c25a,_0x44e9('0x5b'))[_0x44e9('0x15')](_0x44e9('0x3d'));_0x324a98[_0x44e9('0x1f')]=_0x2e526a[_0x44e9('0x1f')];_0x324a98[_0x44e9('0x5c')]=_0x2e526a[_0x44e9('0x5c')];_0x324a98[_0x44e9('0x21')]=_0x2e526a[_0x44e9('0x21')]||undefined;return _0x324a98;};exports[_0x44e9('0x5d')]=function(_0x1a9a38,_0x5d5a11){if(!_[_0x44e9('0x19')](_0x1a9a38)){if(_0x1a9a38[_0x44e9('0x5e')]>0x0){_0x1a9a38[_0x44e9('0x5e')]-=0x1;}else{logger[_0x44e9('0x39')](_0x5d5a11,_0x44e9('0x5f'));}}else{logger[_0x44e9('0x39')](_0x5d5a11,_0x44e9('0x60'));}};exports['IsNotLoggedIn']=function(_0x55dfd7){if(_0x55dfd7<=0x0){return!![];}return![];};function buildObj(_0x4d2e2c,_0x81c157,_0xde4d94){_0x4d2e2c[_0x44e9('0x61')]=_0x81c157;_0x4d2e2c[_0x44e9('0x1c')]=_0x4d2e2c[_0x44e9('0x62')];_0x4d2e2c[_0x44e9('0x63')]=_0x4d2e2c[_0x44e9('0x4c')];_0x4d2e2c[_0x44e9('0x64')]='voice';if(_0xde4d94){_0x4d2e2c[_0x44e9('0x65')]=_0xde4d94[_0x44e9('0x65')];}return _0x4d2e2c;}exports[_0x44e9('0x66')]=buildObj;exports[_0x44e9('0x67')]=function(_0x26509b){var _0x3e1fa1={};_0x3e1fa1[_0x44e9('0x62')]=_0x26509b['queue'];_0x3e1fa1['interface']=_0x26509b['channelAgent'];_0x3e1fa1[_0x44e9('0x4b')]=_0x26509b[_0x44e9('0x4b')];return _0x3e1fa1;};exports[_0x44e9('0x68')]=function(_0x3e3edd){var _0x252dfe=[];for(var _0xb3ae16 in _0x3e3edd){if(_0x3e3edd[_0x44e9('0x35')](_0xb3ae16)){if(!_[_0x44e9('0x19')](_0x3e3edd[_0xb3ae16])&&_0x3e3edd[_0xb3ae16][_0x44e9('0x3e')]===_0x44e9('0x69')&&_0x3e3edd[_0xb3ae16][_0x44e9('0x6a')]===_0x44e9('0x6b')){_0x252dfe[_0x44e9('0x6c')](_0x3e3edd[_0xb3ae16]['id']);}}}return _0x252dfe;};exports[_0x44e9('0x6d')]=function(_0x593daa){var _0x21c111=moment()[_0x44e9('0x8')](0x0);var _0x2fc661=moment(_0x593daa)['milliseconds'](0x0);return _0x21c111[_0x44e9('0x9')](_0x2fc661,_0x44e9('0x6e'));};exports[_0x44e9('0x6f')]=function(_0x5a1e47){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a1e47[_0x44e9('0x1f')],'ListId':_0x5a1e47[_0x44e9('0x5c')],'VoiceQueueId':_0x5a1e47[_0x44e9('0x21')]||undefined,'CampaignId':_0x5a1e47[_0x44e9('0x70')]||undefined};};exports[_0x44e9('0x71')]=function(_0x105b7c){if(_0x105b7c==='uniqueid'||_0x105b7c===_0x44e9('0x72')||_0x105b7c===_0x44e9('0x62')||_0x105b7c==='type'||_0x105b7c===_0x44e9('0x73')||_0x105b7c==='dialAnswer'||_0x105b7c===_0x44e9('0x44')||_0x105b7c===_0x44e9('0x4c')||_0x105b7c===_0x44e9('0x1d')||_0x105b7c==='active'||_0x105b7c===_0x44e9('0x1e')||_0x105b7c===_0x44e9('0x59')||_0x105b7c===_0x44e9('0x50')||_0x105b7c==='countcongestionretry'||_0x105b7c==='countnoanswerretry'||_0x105b7c===_0x44e9('0x74')||_0x105b7c===_0x44e9('0x75')||_0x105b7c===_0x44e9('0x76')||_0x105b7c===_0x44e9('0x77')||_0x105b7c===_0x44e9('0x78')||_0x105b7c===_0x44e9('0x1f')||_0x105b7c==='ListId'||_0x105b7c===_0x44e9('0x79')||_0x105b7c===_0x44e9('0x21')||_0x105b7c===_0x44e9('0x7a')||_0x105b7c===_0x44e9('0x7b')||_0x105b7c===_0x44e9('0x7c')||_0x105b7c===_0x44e9('0x7d')||_0x105b7c===_0x44e9('0x7e')||_0x105b7c===_0x44e9('0x7f')||_0x105b7c===_0x44e9('0x80')||_0x105b7c===_0x44e9('0x81')||_0x105b7c===_0x44e9('0x82')||_0x105b7c==='xmd-dialchannel'||_0x105b7c==='xmd-contactid'||_0x105b7c===_0x44e9('0x83')||_0x105b7c===_0x44e9('0x84')||_0x105b7c==='xmd-agiafter'||_0x105b7c===_0x44e9('0x85')||_0x105b7c===_0x44e9('0x86')||_0x105b7c===_0x44e9('0x87')||_0x105b7c===_0x44e9('0x88')||_0x105b7c===_0x44e9('0x89')||_0x105b7c===_0x44e9('0x8a')||_0x105b7c==='rtpaudioqoslossbridged'||_0x105b7c==='rtpaudioqosrtt'||_0x105b7c===_0x44e9('0x8b')||_0x105b7c===_0x44e9('0x86')||_0x105b7c===_0x44e9('0x87')||_0x105b7c===_0x44e9('0x88')||_0x105b7c==='rtpaudioqosjitterbridged'||_0x105b7c===_0x44e9('0x8a')||_0x105b7c===_0x44e9('0x8c')||_0x105b7c===_0x44e9('0x8d')||_0x105b7c===_0x44e9('0x8b')||_0x105b7c===_0x44e9('0x8e')||_0x105b7c===_0x44e9('0x8f')||_0x105b7c==='state'||_0x105b7c==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x12f0e7,_0x2c7c72){var _0x36e2e6,_0x30dcc7,_0x2fefee;if(_0x2c7c72<=0x0){_0x2c7c72=0x1;}_0x36e2e6=new RegExp(_0x44e9('0x90')+_0x2c7c72+'}$');_0x30dcc7=Math['pow'](0xa,_0x2c7c72-0x1);_0x2fefee=Math[_0x44e9('0x91')](0xa,_0x2c7c72)-0x1;return util['format']('%s',_[_0x44e9('0x92')](_0x12f0e7,_0x36e2e6,_[_0x44e9('0x93')](_0x30dcc7,_0x2fefee)));};exports[_0x44e9('0x94')]=function(_0x49de8b){var _0xafe60b=_0x49de8b[_0x44e9('0x95')](/"(.*?)"/);return _0xafe60b?_0xafe60b[0x1]:_0x49de8b;};exports[_0x44e9('0x96')]=function(_0x31cb64){var _0x144e5b=_0x31cb64['match'](/<(.*?)>/);return _0x144e5b?_0x144e5b[0x1]:_0x31cb64;};function buildNoAnswerEventPayload(_0x27814c,_0x5879e3){var _0x34e27f=buildObj(_0x27814c,_0x44e9('0x97'));if(!_[_0x44e9('0x13')](_0x5879e3[_0x44e9('0x98')])){Object[_0x44e9('0x99')](_0x5879e3[_0x44e9('0x98')])['forEach'](function(_0x2d11f9){_0x34e27f[_0x2d11f9[_0x44e9('0x9a')]()]=_0x5879e3[_0x44e9('0x98')][_0x2d11f9];});}return _0x34e27f;}exports[_0x44e9('0x9b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x21d4=['type','campaigntype','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','logger','info','loggerError','logger2','getCallerId','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','Contact','createdAt','%s%s','toUpper','hasOwnProperty','toLower','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','getDiff','createBody','CampaignId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21d4,0x13b));var _0x421d=function(_0x3ed045,_0x59ed0b){_0x3ed045=_0x3ed045-0x0;var _0x27d89a=_0x21d4[_0x3ed045];return _0x27d89a;};'use strict';var util=require(_0x421d('0x0'));var _=require(_0x421d('0x1'));var moment=require('moment');var logger=require(_0x421d('0x2'))(_0x421d('0x3'));var ipAgi=process[_0x421d('0x4')][_0x421d('0x5')]||_0x421d('0x6');function getSeconds(_0xec58f8,_0x11a206){var _0x2310fe=moment(_0xec58f8)[_0x421d('0x7')](0x0);var _0x35d31d=moment(_0x11a206)[_0x421d('0x7')](0x0);return _0x2310fe[_0x421d('0x8')](_0x35d31d,_0x421d('0x9'));}exports['loggerCatch']=function(_0x402e44){return function(_0x1ae7ee){logger['error'](_0x402e44,util[_0x421d('0xa')](_0x1ae7ee,{'showHidden':![],'depth':null}));};};exports[_0x421d('0xb')]=function(_0xd1f029,_0x5a8a0b){logger[_0x421d('0xc')](_0xd1f029,util[_0x421d('0xa')](_0x5a8a0b,{'showHidden':![],'depth':null}));};exports[_0x421d('0xd')]=function(_0x2c073f,_0x3928d3){logger['error'](_0x2c073f,util[_0x421d('0xa')](_0x3928d3,{'showHidden':![],'depth':null}));};exports[_0x421d('0xe')]=function(_0x5bcc31){return function(_0x43f362){logger['info'](_0x5bcc31,util['inspect'](_0x43f362,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x267366,_0x2e7c2f,_0x9cc8be){return{'message':_0x267366,'unlock':_0x2e7c2f,'active':_0x9cc8be};};exports[_0x421d('0xf')]=function(_0x386fde,_0x26538b,_0x5e9120){if(!_['isUndefined'](_0x5e9120)&&'string'===typeof _0x5e9120&&!_['isEmpty'](_0x5e9120)){if(!_['isUndefined'](_0x26538b)&&'string'===typeof _0x26538b&&!_[_0x421d('0x10')](_0x26538b)){return util[_0x421d('0x11')](_0x421d('0x12'),_0x26538b,_0x5e9120);}return util[_0x421d('0x11')](_0x421d('0x12'),_0x5e9120,_0x5e9120);}if(!_['isUndefined'](_0x386fde)&&'string'===typeof _0x386fde&&!_[_0x421d('0x10')](_0x386fde)){return _0x386fde;}return _0x421d('0x13');};exports[_0x421d('0x14')]=function(_0x379191){if(_[_0x421d('0x15')](_0x379191)){return![];}return _0x379191;};exports[_0x421d('0x16')]=function(_0x5559ab,_0x161f1d,_0xff484e,_0x4d2dc6,_0x16b11a,_0x12353c){var _0x708aed={'XMD-QUEUE':_0x161f1d[_0x421d('0x17')]?_0x161f1d[_0x421d('0x17')]['name']:'','XMD-CALLERID':_0x4d2dc6,'XMD-CALLERID-PREVIEW':_0x12353c?util[_0x421d('0x11')](_0x421d('0x12'),_0x12353c[_0x421d('0x18')],_0x12353c['calleridnum']):_0x4d2dc6,'XMD-DIALID':_0x16b11a,'XMD-CONTACTID':_0x161f1d[_0x421d('0x19')],'XMD-CDRTYPE':_0x421d('0x1a'),'CALLERID(all)':_0x4d2dc6,'XMD-VOICEQUEUEID':_0x161f1d['VoiceQueueId'],'XMD-DIALCHANNEL':_0xff484e,'XMD-DIALTIMEOUT':_0x5559ab[_0x421d('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x421d('0x11')](_0x421d('0x1c'),_0x5559ab['dialQueueProject2']?'g':'',_[_0x421d('0x10')](_0x5559ab[_0x421d('0x1d')])?'':_0x421d('0x1e')),'XMD-DIALURL':_0x5559ab[_0x421d('0x1f')]||'','XMD-AGI':_0x5559ab[_0x421d('0x20')]?util['format'](_0x421d('0x21'),ipAgi,_0x5559ab[_0x421d('0x20')]):_0x421d('0x22'),'XMD-AGIAFTER':_0x5559ab['dialQueueProject2']?util['format'](_0x421d('0x21'),ipAgi,_0x5559ab['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x12353c?_0x12353c[_0x421d('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x12353c?_0x12353c[_0x421d('0x24')]:'','XMD-DESTINATION':_0x421d('0x25'),'SIPADDHEADER':_0x421d('0x26')};if(!_[_0x421d('0x10')](_0x5559ab[_0x421d('0x1d')])){_0x708aed[util[_0x421d('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5559ab[_0x421d('0x1d')];_0x708aed[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x16b11a;}if(_0x161f1d&&_0x161f1d['Contact']){for(var _0x58a529 in _0x161f1d['Contact']){if(_0x161f1d[_0x421d('0x27')]['hasOwnProperty'](_0x58a529)){if(!_['isNil'](_0x161f1d['Contact'][_0x58a529])&&_0x58a529!=='id'&&_0x58a529!=='tags'&&_0x58a529!==_0x421d('0x28')&&_0x58a529!=='updatedAt'){_0x708aed[util['format'](_0x421d('0x29'),'XMD-',_[_0x421d('0x2a')](_0x58a529))]=_0x161f1d[_0x421d('0x27')][_0x58a529];}}}}return _0x708aed;};exports['toLowerVariables']=function(_0x1770ce){var _0x5c5686={};for(var _0x436c1b in _0x1770ce){if(_0x1770ce[_0x421d('0x2b')](_0x436c1b)){_0x5c5686[util[_0x421d('0x11')]('%s',_[_0x421d('0x2c')](_0x436c1b))]=_0x1770ce[_0x436c1b];}}return{'variables':_0x5c5686};};exports['updateOriginated']=function(_0x5dd672,_0x463989){if(!_[_0x421d('0x15')](_0x5dd672)){if(_0x5dd672[_0x421d('0x2b')](_0x421d('0x2d'))){if(_0x5dd672[_0x421d('0x2d')]>0x0){_0x5dd672[_0x421d('0x2d')]-=0x1;}else{logger[_0x421d('0x2e')](_0x421d('0x2f'),_0x463989);}}}else{logger[_0x421d('0x2e')](_0x421d('0x30'),_0x463989);}};exports[_0x421d('0x31')]=function(_0x400437){var _0x48125c=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x400437[_0x421d('0x32')]=0xd;_0x400437[_0x421d('0x33')]=_0x421d('0x34');_0x400437['starttime']=_0x48125c;_0x400437[_0x421d('0x35')]=_0x48125c;_0x400437[_0x421d('0x36')]=_0x48125c;};exports[_0x421d('0x37')]=function(_0x112b44,_0x4db0e6,_0x49821e){var _0x33648f=moment()[_0x421d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x112b44[_0x421d('0x32')]=_0x4db0e6;_0x112b44[_0x421d('0x33')]=_0x49821e;_0x112b44[_0x421d('0x35')]=_0x33648f;_0x112b44[_0x421d('0x38')]=getSeconds(_0x112b44[_0x421d('0x35')],_0x112b44[_0x421d('0x39')]);};exports[_0x421d('0x3a')]=function(_0x5a337a,_0x55a8f1,_0xfbdf06){_0x5a337a[_0x421d('0x3b')]=_0x55a8f1;_0x5a337a[_0x421d('0x3c')]=_0xfbdf06;};exports[_0x421d('0x3d')]=function(_0x3ebbdb,_0x3836d3,_0x257303){var _0x393ae2=moment()[_0x421d('0x11')](_0x421d('0x3e'));_0x3ebbdb[_0x421d('0x32')]=_0x3836d3;_0x3ebbdb[_0x421d('0x33')]=_0x257303;_0x3ebbdb[_0x421d('0x35')]=_0x3ebbdb['responsetime']?_0x3ebbdb[_0x421d('0x35')]:_0x393ae2;_0x3ebbdb['endtime']=_0x3ebbdb['endtime']?_0x3ebbdb[_0x421d('0x36')]:_0x393ae2;_0x3ebbdb[_0x421d('0x38')]=getSeconds(_0x3ebbdb[_0x421d('0x35')]||0x0,_0x3ebbdb[_0x421d('0x39')]||0x0);_0x3ebbdb[_0x421d('0x3f')]=_0x3ebbdb[_0x421d('0x40')]?getSeconds(_0x3ebbdb['endtime'],_0x3ebbdb[_0x421d('0x40')]):0x0;};exports[_0x421d('0x41')]=function(_0x2b812b){return _0x2b812b===_0x421d('0x42');};exports[_0x421d('0x43')]=function(_0x13cb41,_0x599ba6,_0x2b5360,_0x249a09,_0x368e36){var _0x475175=_0x249a09?_0x421d('0x44'):_0x13cb41[_0x421d('0x18')];_0x475175=_0x368e36?_0x421d('0x45'):_0x475175;return{'actionid':_0x13cb41[_0x421d('0x46')],'action':_0x421d('0x47'),'channel':_0x13cb41[_0x421d('0x48')],'callerid':util[_0x421d('0x11')](_0x421d('0x12'),_0x475175,_0x13cb41[_0x421d('0x49')]),'Exten':_0x421d('0x25'),'Context':_0x421d('0x4a'),'Priority':'1','variable':_0x2b5360,'timeout':(_0x599ba6[_0x421d('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x13cb41['uniqueid']};};exports[_0x421d('0x4c')]=function(_0x11244d){return _0x11244d[_0x421d('0x4d')]+_0x11244d[_0x421d('0x4e')]+_0x11244d[_0x421d('0x4f')]+_0x11244d[_0x421d('0x50')]+_0x11244d['countnosuchnumberretry'];};exports[_0x421d('0x51')]=function(_0x5f3ff2){var _0x17136c=_[_0x421d('0x52')](_0x5f3ff2);_0x17136c[_0x421d('0x32')]=0xf;_0x17136c['statedesc']='Global';return _0x17136c;};exports[_0x421d('0x53')]=function(_0x4007b8,_0x1da6e1,_0xad9d35){var _0x5b4abb={};_0x5b4abb[_0x1da6e1]=_0x4007b8[_0x1da6e1];_0x5b4abb[_0x421d('0x54')]=![];_0x5b4abb['scheduledat']=moment()[_0x421d('0x55')](_0xad9d35,'minutes')[_0x421d('0x11')](_0x421d('0x3e'));_0x5b4abb[_0x421d('0x19')]=_0x4007b8[_0x421d('0x19')];_0x5b4abb[_0x421d('0x56')]=_0x4007b8[_0x421d('0x56')];_0x5b4abb[_0x421d('0x57')]=_0x4007b8['VoiceQueueId']||undefined;return _0x5b4abb;};exports['decrementTalkink']=function(_0x4e42a9,_0x9bb291){if(!_[_0x421d('0x15')](_0x4e42a9)){if(_0x4e42a9['pTalking']>0x0){_0x4e42a9[_0x421d('0x58')]-=0x1;}else{logger[_0x421d('0x2e')](_0x9bb291,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x421d('0x2e')](_0x9bb291,_0x421d('0x59'));}};exports[_0x421d('0x5a')]=function(_0x35201f){if(_0x35201f<=0x0){return!![];}return![];};function buildObj(_0x53cbf8,_0x53c386,_0x3f44b6){_0x53cbf8[_0x421d('0x5b')]=_0x53c386;_0x53cbf8[_0x421d('0x5c')]=_0x53cbf8[_0x421d('0x5d')];_0x53cbf8[_0x421d('0x5e')]=_0x53cbf8[_0x421d('0x48')];_0x53cbf8[_0x421d('0x5f')]='voice';if(_0x3f44b6){_0x53cbf8[_0x421d('0x60')]=_0x3f44b6[_0x421d('0x60')];}return _0x53cbf8;}exports[_0x421d('0x61')]=buildObj;exports[_0x421d('0x62')]=function(_0x248b43){var _0x13218f={};_0x13218f[_0x421d('0x5d')]=_0x248b43[_0x421d('0x5d')];_0x13218f[_0x421d('0x5e')]=_0x248b43[_0x421d('0x48')];_0x13218f[_0x421d('0x46')]=_0x248b43['uniqueid'];return _0x13218f;};exports[_0x421d('0x63')]=function(_0x526119){var _0x2b3d97=[];for(var _0x192d18 in _0x526119){if(_0x526119[_0x421d('0x2b')](_0x192d18)){if(!_['isNil'](_0x526119[_0x192d18])&&_0x526119[_0x192d18]['state']==='not_inuse'&&_0x526119[_0x192d18][_0x421d('0x64')]===_0x421d('0x65')){_0x2b3d97['push'](_0x526119[_0x192d18]['id']);}}}return _0x2b3d97;};exports[_0x421d('0x66')]=function(_0x3198d0){var _0x16d3ab=moment()[_0x421d('0x7')](0x0);var _0x1875e8=moment(_0x3198d0)[_0x421d('0x7')](0x0);return _0x16d3ab['diff'](_0x1875e8,_0x421d('0x9'));};exports[_0x421d('0x67')]=function(_0x48076e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x48076e[_0x421d('0x19')],'ListId':_0x48076e[_0x421d('0x56')],'VoiceQueueId':_0x48076e[_0x421d('0x57')]||undefined,'CampaignId':_0x48076e[_0x421d('0x68')]||undefined};};exports['filterKey']=function(_0x2daf11){if(_0x2daf11==='uniqueid'||_0x2daf11==='idContact'||_0x2daf11==='queue'||_0x2daf11===_0x421d('0x69')||_0x2daf11===_0x421d('0x6a')||_0x2daf11==='dialAnswer'||_0x2daf11===_0x421d('0x3b')||_0x2daf11==='channelAgent'||_0x2daf11===_0x421d('0x18')||_0x2daf11===_0x421d('0x54')||_0x2daf11===_0x421d('0x49')||_0x2daf11==='scheduledat'||_0x2daf11===_0x421d('0x4d')||_0x2daf11===_0x421d('0x4e')||_0x2daf11===_0x421d('0x4f')||_0x2daf11==='countglobal'||_0x2daf11===_0x421d('0x6b')||_0x2daf11===_0x421d('0x6c')||_0x2daf11===_0x421d('0x6d')||_0x2daf11===_0x421d('0x6e')||_0x2daf11===_0x421d('0x19')||_0x2daf11===_0x421d('0x56')||_0x2daf11===_0x421d('0x3c')||_0x2daf11==='VoiceQueueId'||_0x2daf11==='sipcallid'||_0x2daf11===_0x421d('0x6f')||_0x2daf11===_0x421d('0x70')||_0x2daf11===_0x421d('0x71')||_0x2daf11==='xmd-listid'||_0x2daf11===_0x421d('0x72')||_0x2daf11==='xmd-dialtimeout'||_0x2daf11===_0x421d('0x73')||_0x2daf11===_0x421d('0x74')||_0x2daf11===_0x421d('0x75')||_0x2daf11===_0x421d('0x76')||_0x2daf11===_0x421d('0x77')||_0x2daf11==='xmd-callerid'||_0x2daf11==='xmd-agiafter'||_0x2daf11===_0x421d('0x78')||_0x2daf11===_0x421d('0x79')||_0x2daf11===_0x421d('0x7a')||_0x2daf11===_0x421d('0x7b')||_0x2daf11===_0x421d('0x7c')||_0x2daf11===_0x421d('0x7d')||_0x2daf11===_0x421d('0x7e')||_0x2daf11===_0x421d('0x7f')||_0x2daf11==='rtpaudioqosrttbridged'||_0x2daf11==='rtpaudioqos'||_0x2daf11==='rtpaudioqosbridged'||_0x2daf11===_0x421d('0x7b')||_0x2daf11==='rtpaudioqosjitterbridged'||_0x2daf11===_0x421d('0x7d')||_0x2daf11===_0x421d('0x7e')||_0x2daf11===_0x421d('0x7f')||_0x2daf11==='rtpaudioqosrttbridged'||_0x2daf11===_0x421d('0x80')||_0x2daf11===_0x421d('0x81')||_0x2daf11===_0x421d('0x32')||_0x2daf11===_0x421d('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2df677,_0x323bb1){var _0x5f10c1,_0x24c24d,_0x31ac73;if(_0x323bb1<=0x0){_0x323bb1=0x1;}_0x5f10c1=new RegExp(_0x421d('0x82')+_0x323bb1+'}$');_0x24c24d=Math['pow'](0xa,_0x323bb1-0x1);_0x31ac73=Math[_0x421d('0x83')](0xa,_0x323bb1)-0x1;return util['format']('%s',_[_0x421d('0x84')](_0x2df677,_0x5f10c1,_['random'](_0x24c24d,_0x31ac73)));};exports[_0x421d('0x85')]=function(_0x24b3e3){var _0x46e3e8=_0x24b3e3[_0x421d('0x86')](/"(.*?)"/);return _0x46e3e8?_0x46e3e8[0x1]:_0x24b3e3;};exports[_0x421d('0x87')]=function(_0x2a9e0e){var _0x5a5826=_0x2a9e0e['match'](/<(.*?)>/);return _0x5a5826?_0x5a5826[0x1]:_0x2a9e0e;};function buildNoAnswerEventPayload(_0x505e93,_0x511654){var _0x70b96c=buildObj(_0x505e93,_0x421d('0x88'));if(!_['isEmpty'](_0x511654['variables'])){Object['keys'](_0x511654['variables'])[_0x421d('0x89')](function(_0x149258){_0x70b96c[_0x149258[_0x421d('0x8a')]()]=_0x511654['variables'][_0x149258];});}return _0x70b96c;}exports[_0x421d('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f85a1f7..eae6797 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 _0x723c=['string','number','boolean','queueremove','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd'];(function(_0x1cdff2,_0x40b29d){var _0x51c9c2=function(_0x1edf98){while(--_0x1edf98){_0x1cdff2['push'](_0x1cdff2['shift']());}};_0x51c9c2(++_0x40b29d);}(_0x723c,0x17b));var _0xc723=function(_0x2b3709,_0x117f22){_0x2b3709=_0x2b3709-0x0;var _0x291538=_0x723c[_0x2b3709];return _0x291538;};'use strict';exports[_0xc723('0x0')]={'queue':{'type':_0xc723('0x1'),'required':!![]},'interface':{'type':_0xc723('0x1'),'required':!![]},'membername':{'type':_0xc723('0x1'),'required':!![]},'penalty':{'type':_0xc723('0x2'),'required':![]},'paused':{'type':_0xc723('0x3'),'required':![]}};exports[_0xc723('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xc723('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xc723('0x3')},'reason':{'type':_0xc723('0x1'),'required':![]}};exports[_0xc723('0x6')]={'module':{'type':_0xc723('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xc723('0x1'),'required':!![]}};exports[_0xc723('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xc723('0x1')},'format':{'type':_0xc723('0x1')},'mixmonitorid':{'type':_0xc723('0x1')}};exports[_0xc723('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xc723('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xc723('0x1')}}; \ No newline at end of file +var _0x0f73=['queueremove','reload','voicechannel','voicequeuechannelhangup','string','number','boolean'];(function(_0x52cbe2,_0x5afefb){var _0x277141=function(_0x271243){while(--_0x271243){_0x52cbe2['push'](_0x52cbe2['shift']());}};_0x277141(++_0x5afefb);}(_0x0f73,0x1bd));var _0x30f7=function(_0x5d18b1,_0x23c13a){_0x5d18b1=_0x5d18b1-0x0;var _0xcee517=_0x0f73[_0x5d18b1];return _0xcee517;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x30f7('0x0'),'required':!![]},'membername':{'type':_0x30f7('0x0'),'required':!![]},'penalty':{'type':_0x30f7('0x1'),'required':![]},'paused':{'type':_0x30f7('0x2'),'required':![]}};exports[_0x30f7('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x30f7('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x30f7('0x2')},'reason':{'type':'string','required':![]}};exports[_0x30f7('0x4')]={'module':{'type':_0x30f7('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]}};exports[_0x30f7('0x5')]={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]},'filename':{'type':_0x30f7('0x0')},'format':{'type':_0x30f7('0x0')},'mixmonitorid':{'type':_0x30f7('0x0')}};exports[_0x30f7('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]},'exten':{'type':_0x30f7('0x0'),'required':!![]},'context':{'type':_0x30f7('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 3928489..70f3b91 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 _0x2dc3=['exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','sumHoldTime','sumBillable','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','initTelephones','isUndefined','telephones','trunks','initTriggers','initTemplates','initZendeskAccounts','initZohoAccounts','deskAccounts','sugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','sumDuration','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts'];(function(_0x387e3a,_0x20b7b3){var _0x346f55=function(_0xb84217){while(--_0xb84217){_0x387e3a['push'](_0x387e3a['shift']());}};_0x346f55(++_0x20b7b3);}(_0x2dc3,0x127));var _0x32dc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2dc3[_0x6c993a];return _0x27f547;};'use strict';var util=require('util');var _=require(_0x32dc('0x0'));var moment=require(_0x32dc('0x1'));var Agent=require(_0x32dc('0x2'));var Telephone=require(_0x32dc('0x3'));var Trunk=require(_0x32dc('0x4'));var VoiceQueue=require(_0x32dc('0x5'));var Trigger=require(_0x32dc('0x6'));var Template=require(_0x32dc('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x32dc('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x32dc('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x32dc('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x32dc('0xb'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x32dc('0xc'));var FaxAccount=require(_0x32dc('0xd'));var Realtime=function(){this[_0x32dc('0xe')]={};this['telephones']={};this['trunks']={};this[_0x32dc('0xf')]={};this[_0x32dc('0x10')]={};this[_0x32dc('0x11')]={};this[_0x32dc('0x12')]={};this[_0x32dc('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x32dc('0x14')]={};this[_0x32dc('0x15')]={};this['queueChannels']={};this[_0x32dc('0x16')]={};this['timers']={};this[_0x32dc('0x17')]={};this[_0x32dc('0x18')]={};this[_0x32dc('0x19')]={};this['sugarcrmAccounts']={};this[_0x32dc('0x1a')]={};this[_0x32dc('0x1b')]={};this['deskAccounts']={};this[_0x32dc('0x1c')]={};this['servicenowAccounts']={};this[_0x32dc('0x1d')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x497b11,_0x2e1a9d,_0x328940){var _0x391c13=_['mapKeys'](_0x497b11,function(_0x284dfe,_0x32d0d1){return _0x284dfe[_0x328940];});for(var _0x38064a in _0x2e1a9d){if(_0x2e1a9d['hasOwnProperty'](_0x38064a)){if(!_0x391c13[_0x38064a]){delete _0x2e1a9d[_0x38064a];}}}}function freeIsNotKeySip(_0x36e287,_0x36389b){var _0x2671b1=_[_0x32dc('0x1e')](_0x36e287,function(_0x5bbd7c,_0x7e27ea){return util[_0x32dc('0x1f')](_0x32dc('0x20'),_0x5bbd7c[_0x32dc('0x21')]);});for(var _0x43b4a3 in _0x36389b){if(_0x36389b[_0x32dc('0x22')](_0x43b4a3)){if(!_0x2671b1[_0x43b4a3]){delete _0x36389b[_0x43b4a3];}}}}function freeIsNotKeyAgent(_0x43b18c,_0x33eae0){var _0x5ed1d9=_[_0x32dc('0x1e')](_0x43b18c,function(_0x37e2d1,_0xd8dd68){var _0x2a4bf9=_['isNil'](_0x37e2d1[_0x32dc('0x23')])?util[_0x32dc('0x1f')](_0x32dc('0x20'),_0x37e2d1[_0x32dc('0x21')]):_0x37e2d1['interface'];return _0x2a4bf9;});for(var _0x36a190 in _0x33eae0){if(_0x33eae0[_0x32dc('0x22')](_0x36a190)){if(!_0x5ed1d9[_0x36a190]){delete _0x33eae0[_0x36a190];}}}}function clearVoiceCallReports(_0x11d7d0){_0x11d7d0['total']=0x0;_0x11d7d0['answered']=0x0;_0x11d7d0[_0x32dc('0x24')]=0x0;_0x11d7d0['sumDuration']=0x0;_0x11d7d0[_0x32dc('0x25')]=0x0;}function clearCampaigns(_0x582651){if(!_['isEmpty'](_0x582651)){for(var _0x50ccf4 in _0x582651){if(_0x582651[_0x32dc('0x22')](_0x50ccf4)){_0x582651[_0x50ccf4]['ivrTotalCallsDays']=0x0;_0x582651[_0x50ccf4][_0x32dc('0x26')]=0x0;}}}}function clearVoiceQueues(_0x26e348){if(!_['isEmpty'](_0x26e348)){for(var _0x2cbe2a in _0x26e348){if(_0x26e348[_0x32dc('0x22')](_0x2cbe2a)){_0x26e348[_0x2cbe2a][_0x32dc('0x27')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x28')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x29')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2a')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x24')]=0x0;_0x26e348[_0x2cbe2a]['sumDuration']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x25')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2b')]=0x0;_0x26e348[_0x2cbe2a]['outboundNoAnswerCallsDay']=0x0;_0x26e348[_0x2cbe2a]['outboundBusyCallsDay']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2c')]=0x0;_0x26e348[_0x2cbe2a]['outboundNoSuchCallsDay']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2d')]=0x0;_0x26e348[_0x2cbe2a]['outboundDropCallsDayTimeout']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2e')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2f')]=0x0;_0x26e348[_0x2cbe2a]['outboundOriginateFailureCallsDay']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x30')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x31')]=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x2b')]=0x0;_0x26e348[_0x2cbe2a]['outboundAnswerCallsDay']=0x0;_0x26e348[_0x2cbe2a][_0x32dc('0x32')]=!![];}}}}Realtime[_0x32dc('0x33')][_0x32dc('0x34')]=function(_0x2d7761,_0x4003ab){for(var _0x38c001 in _0x4003ab){if(_0x2d7761[_0x32dc('0x22')](_0x38c001)){_0x2d7761[_0x38c001]=_0x4003ab[_0x38c001];}}};Realtime[_0x32dc('0x33')][_0x32dc('0x35')]=function(){var _0x1e12d2=this;return function(_0x4846be){if(_0x4846be){freeIsNotKeyAgent(_0x4846be,_0x1e12d2[_0x32dc('0xe')]);for(var _0x27df8c=0x0,_0x1fb80f={},_0x267fc1={};_0x27df8c<_0x4846be[_0x32dc('0x36')];_0x27df8c+=0x1){_0x1fb80f=_0x4846be[_0x27df8c];var _0x56a34c=_[_0x32dc('0x37')](_0x1fb80f['interface'])?util[_0x32dc('0x1f')]('SIP/%s',_0x1fb80f[_0x32dc('0x21')]):_0x1fb80f['interface'];if(_['isUndefined'](_0x1e12d2[_0x32dc('0xe')][_0x56a34c])){_0x1e12d2[_0x32dc('0xe')][_0x56a34c]=new Agent(_0x1fb80f);}else{_0x1e12d2[_0x32dc('0x34')](_0x1e12d2[_0x32dc('0xe')][_0x56a34c],_0x1fb80f);}}}return _0x1e12d2['agents'];};};Realtime[_0x32dc('0x33')][_0x32dc('0x38')]=function(){var _0x62c2cb=this;return function(_0x477004){if(_0x477004){freeIsNotKeySip(_0x477004,_0x62c2cb['telephones']);for(var _0x4410cd=0x0,_0x17a3ee={},_0x333964={};_0x4410cd<_0x477004[_0x32dc('0x36')];_0x4410cd+=0x1){_0x17a3ee=_0x477004[_0x4410cd];if(_[_0x32dc('0x39')](_0x62c2cb['telephones'][util['format']('SIP/%s',_0x17a3ee['name'])])){_0x62c2cb['telephones'][util[_0x32dc('0x1f')](_0x32dc('0x20'),_0x17a3ee['name'])]=new Telephone(_0x17a3ee);}else{_0x62c2cb[_0x32dc('0x34')](_0x62c2cb[_0x32dc('0x3a')][util['format'](_0x32dc('0x20'),_0x17a3ee[_0x32dc('0x21')])],_0x17a3ee);}}}return _0x62c2cb[_0x32dc('0x3a')];};};Realtime['prototype']['initTrunks']=function(){var _0x63b083=this;return function(_0x18e4e8){if(_0x18e4e8){freeIsNotKeySip(_0x18e4e8,_0x63b083[_0x32dc('0x3b')]);for(var _0x405dbc=0x0,_0x202a8c={},_0x1004d7={};_0x405dbc<_0x18e4e8[_0x32dc('0x36')];_0x405dbc+=0x1){_0x202a8c=_0x18e4e8[_0x405dbc];if(_[_0x32dc('0x39')](_0x63b083[_0x32dc('0x3b')][util[_0x32dc('0x1f')](_0x32dc('0x20'),_0x202a8c[_0x32dc('0x21')])])){_0x63b083[_0x32dc('0x3b')][util['format']('SIP/%s',_0x202a8c[_0x32dc('0x21')])]=new Trunk(_0x202a8c);}else{_0x63b083[_0x32dc('0x34')](_0x63b083[_0x32dc('0x3b')][util[_0x32dc('0x1f')]('SIP/%s',_0x202a8c[_0x32dc('0x21')])],_0x202a8c);}}}return _0x63b083[_0x32dc('0x3b')];};};Realtime[_0x32dc('0x33')]['initVoiceQueues']=function(){var _0xa49568=this;return function(_0x4b0509){if(_0x4b0509){freeIsNotKey(_0x4b0509,_0xa49568[_0x32dc('0xf')],_0x32dc('0x21'));for(var _0xd0820=0x0,_0x2c6182={},_0x56f3d4={};_0xd0820<_0x4b0509[_0x32dc('0x36')];_0xd0820+=0x1){_0x2c6182=_0x4b0509[_0xd0820];if(_['isUndefined'](_0xa49568[_0x32dc('0xf')][_0x2c6182['name']])){_0xa49568[_0x32dc('0xf')][_0x2c6182[_0x32dc('0x21')]]=new VoiceQueue(_0x2c6182);}else{_0xa49568[_0x32dc('0x34')](_0xa49568[_0x32dc('0xf')][_0x2c6182[_0x32dc('0x21')]],_0x2c6182);}}}return _0xa49568[_0x32dc('0xf')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x3c')]=function(){var _0x85550=this;return function(_0x1178f8){if(_0x1178f8){freeIsNotKey(_0x1178f8,_0x85550[_0x32dc('0x10')],'id');for(var _0x5a5bdc=0x0,_0x25e1c2={},_0x45e11c={};_0x5a5bdc<_0x1178f8[_0x32dc('0x36')];_0x5a5bdc+=0x1){_0x25e1c2=_0x1178f8[_0x5a5bdc];if(_[_0x32dc('0x39')](_0x85550['triggers'][_0x25e1c2['id']])){_0x85550[_0x32dc('0x10')][_0x25e1c2['id']]=new Trigger(_0x25e1c2);}else{_0x85550['mergeFromDatabase'](_0x85550[_0x32dc('0x10')][_0x25e1c2['id']],_0x25e1c2);}}}return _0x85550['triggers'];};};Realtime['prototype'][_0x32dc('0x3d')]=function(){var _0xdb438c=this;return function(_0x112cca){if(_0x112cca){freeIsNotKey(_0x112cca,_0xdb438c[_0x32dc('0x12')],'id');for(var _0x5b7ad7=0x0,_0x445d3e={},_0x2dcc31={};_0x5b7ad7<_0x112cca[_0x32dc('0x36')];_0x5b7ad7+=0x1){_0x445d3e=_0x112cca[_0x5b7ad7];if(_['isUndefined'](_0xdb438c['templates'][_0x445d3e['id']])){_0xdb438c[_0x32dc('0x12')][_0x445d3e['id']]=new Template(_0x445d3e);}else{_0xdb438c['mergeFromDatabase'](_0xdb438c[_0x32dc('0x12')][_0x445d3e['id']],_0x445d3e);}}}return _0xdb438c['templates'];};};Realtime['prototype'][_0x32dc('0x3e')]=function(){var _0x31323e=this;return function(_0x5d2f39){if(_0x5d2f39){freeIsNotKey(_0x5d2f39,_0x31323e[_0x32dc('0x18')],'id');for(var _0x524f9d=0x0,_0x18b4e7={},_0x4bf386={};_0x524f9d<_0x5d2f39[_0x32dc('0x36')];_0x524f9d+=0x1){_0x18b4e7=_0x5d2f39[_0x524f9d];if(_[_0x32dc('0x39')](_0x31323e[_0x32dc('0x18')][_0x18b4e7['id']])){_0x31323e[_0x32dc('0x18')][_0x18b4e7['id']]=new ZendeskAccount(_0x18b4e7);}else{_0x31323e[_0x32dc('0x34')](_0x31323e['zendeskAccounts'][_0x18b4e7['id']],_0x18b4e7);}}}return _0x31323e['zendeskAccounts'];};};Realtime[_0x32dc('0x33')]['initSalesforceAccounts']=function(){var _0x3dd105=this;return function(_0x1d6f71){if(_0x1d6f71){freeIsNotKey(_0x1d6f71,_0x3dd105[_0x32dc('0x19')],'id');for(var _0x1a528b=0x0,_0x2730f1={},_0x3c18e8={};_0x1a528b<_0x1d6f71[_0x32dc('0x36')];_0x1a528b+=0x1){_0x2730f1=_0x1d6f71[_0x1a528b];if(_[_0x32dc('0x39')](_0x3dd105[_0x32dc('0x19')][_0x2730f1['id']])){_0x3dd105[_0x32dc('0x19')][_0x2730f1['id']]=new SalesforceAccount(_0x2730f1);}else{_0x3dd105[_0x32dc('0x34')](_0x3dd105[_0x32dc('0x19')][_0x2730f1['id']],_0x2730f1);}}}return _0x3dd105[_0x32dc('0x19')];};};Realtime[_0x32dc('0x33')]['initFreshdeskAccounts']=function(){var _0x423337=this;return function(_0x47f457){if(_0x47f457){freeIsNotKey(_0x47f457,_0x423337[_0x32dc('0x1a')],'id');for(var _0x429cbd=0x0,_0x17319a={},_0x491175={};_0x429cbd<_0x47f457[_0x32dc('0x36')];_0x429cbd+=0x1){_0x17319a=_0x47f457[_0x429cbd];if(_[_0x32dc('0x39')](_0x423337[_0x32dc('0x1a')][_0x17319a['id']])){_0x423337[_0x32dc('0x1a')][_0x17319a['id']]=new FreshdeskAccount(_0x17319a);}else{_0x423337[_0x32dc('0x34')](_0x423337[_0x32dc('0x1a')][_0x17319a['id']],_0x17319a);}}}return _0x423337['freshdeskAccounts'];};};Realtime['prototype'][_0x32dc('0x3f')]=function(){var _0x32c973=this;return function(_0x507ba2){if(_0x507ba2){freeIsNotKey(_0x507ba2,_0x32c973[_0x32dc('0x1b')],'id');for(var _0x54f701=0x0,_0x401a9b={},_0x5008e1={};_0x54f701<_0x507ba2[_0x32dc('0x36')];_0x54f701+=0x1){_0x401a9b=_0x507ba2[_0x54f701];if(_[_0x32dc('0x39')](_0x32c973[_0x32dc('0x1b')][_0x401a9b['id']])){_0x32c973[_0x32dc('0x1b')][_0x401a9b['id']]=new ZohoAccount(_0x401a9b);}else{_0x32c973[_0x32dc('0x34')](_0x32c973[_0x32dc('0x1b')][_0x401a9b['id']],_0x401a9b);}}}return _0x32c973['zohoAccounts'];};};Realtime[_0x32dc('0x33')]['initDeskAccounts']=function(){var _0x2df0f8=this;return function(_0x546a34){if(_0x546a34){freeIsNotKey(_0x546a34,_0x2df0f8[_0x32dc('0x40')],'id');for(var _0x281313=0x0,_0x1c8d2a={},_0x30aae1={};_0x281313<_0x546a34[_0x32dc('0x36')];_0x281313+=0x1){_0x1c8d2a=_0x546a34[_0x281313];if(_[_0x32dc('0x39')](_0x2df0f8[_0x32dc('0x40')][_0x1c8d2a['id']])){_0x2df0f8[_0x32dc('0x40')][_0x1c8d2a['id']]=new DeskAccount(_0x1c8d2a);}else{_0x2df0f8[_0x32dc('0x34')](_0x2df0f8['deskAccounts'][_0x1c8d2a['id']],_0x1c8d2a);}}}return _0x2df0f8[_0x32dc('0x40')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x8de2fd=this;return function(_0x3027dc){if(_0x3027dc){freeIsNotKey(_0x3027dc,_0x8de2fd[_0x32dc('0x41')],'id');for(var _0x494dab=0x0,_0x39f939={},_0x432525={};_0x494dab<_0x3027dc[_0x32dc('0x36')];_0x494dab+=0x1){_0x39f939=_0x3027dc[_0x494dab];if(_[_0x32dc('0x39')](_0x8de2fd[_0x32dc('0x41')][_0x39f939['id']])){_0x8de2fd[_0x32dc('0x41')][_0x39f939['id']]=new SugarcrmAccount(_0x39f939);}else{_0x8de2fd['mergeFromDatabase'](_0x8de2fd[_0x32dc('0x41')][_0x39f939['id']],_0x39f939);}}}return _0x8de2fd[_0x32dc('0x41')];};};Realtime[_0x32dc('0x33')]['initVtigerAccounts']=function(){var _0x314563=this;return function(_0x3599e6){if(_0x3599e6){freeIsNotKey(_0x3599e6,_0x314563['vtigerAccounts'],'id');for(var _0x30a6b1=0x0,_0x33800d={},_0x61837e={};_0x30a6b1<_0x3599e6[_0x32dc('0x36')];_0x30a6b1+=0x1){_0x33800d=_0x3599e6[_0x30a6b1];if(_['isUndefined'](_0x314563[_0x32dc('0x1c')][_0x33800d['id']])){_0x314563[_0x32dc('0x1c')][_0x33800d['id']]=new VtigerAccount(_0x33800d);}else{_0x314563[_0x32dc('0x34')](_0x314563[_0x32dc('0x1c')][_0x33800d['id']],_0x33800d);}}}return _0x314563[_0x32dc('0x1c')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x42')]=function(){var _0x3f03ec=this;return function(_0x297a0f){if(_0x297a0f){freeIsNotKey(_0x297a0f,_0x3f03ec['servicenowAccounts'],'id');for(var _0x143c18=0x0,_0x176a01={},_0x14cbf9={};_0x143c18<_0x297a0f[_0x32dc('0x36')];_0x143c18+=0x1){_0x176a01=_0x297a0f[_0x143c18];if(_['isUndefined'](_0x3f03ec[_0x32dc('0x43')][_0x176a01['id']])){_0x3f03ec[_0x32dc('0x43')][_0x176a01['id']]=new ServicenowAccount(_0x176a01);}else{_0x3f03ec[_0x32dc('0x34')](_0x3f03ec[_0x32dc('0x43')][_0x176a01['id']],_0x176a01);}}}return _0x3f03ec[_0x32dc('0x43')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x44')]=function(){var _0x1781fa=this;return function(_0x215b58){if(_0x215b58){freeIsNotKey(_0x215b58,_0x1781fa[_0x32dc('0x1d')],'id');for(var _0x3f480c=0x0,_0xe5a261={},_0x39abcc={};_0x3f480c<_0x215b58[_0x32dc('0x36')];_0x3f480c+=0x1){_0xe5a261=_0x215b58[_0x3f480c];if(_[_0x32dc('0x39')](_0x1781fa[_0x32dc('0x1d')][_0xe5a261['id']])){_0x1781fa[_0x32dc('0x1d')][_0xe5a261['id']]=new Dynamics365Account(_0xe5a261);}else{_0x1781fa[_0x32dc('0x34')](_0x1781fa[_0x32dc('0x1d')][_0xe5a261['id']],_0xe5a261);}}}return _0x1781fa['dynamics365Accounts'];};};Realtime[_0x32dc('0x33')][_0x32dc('0x45')]=function(){var _0x46b242=this;return function(_0x1d91ee){if(_0x1d91ee){freeIsNotKey(_0x1d91ee,_0x46b242['freshsalesAccounts'],'id');for(var _0x42cf43=0x0,_0x406292={},_0x163322={};_0x42cf43<_0x1d91ee[_0x32dc('0x36')];_0x42cf43+=0x1){_0x406292=_0x1d91ee[_0x42cf43];if(_[_0x32dc('0x39')](_0x46b242[_0x32dc('0x46')][_0x406292['id']])){_0x46b242[_0x32dc('0x46')][_0x406292['id']]=new FreshsalesAccount(_0x406292);}else{_0x46b242[_0x32dc('0x34')](_0x46b242[_0x32dc('0x46')][_0x406292['id']],_0x406292);}}}return _0x46b242[_0x32dc('0x46')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x47')]=function(){var _0x51452e=this;return function(_0x1e601f){for(var _0x37d978=0x0;_0x37d978<_0x1e601f['length'];_0x37d978+=0x1){_[_0x32dc('0x48')](_0x51452e[_0x32dc('0xf')][_0x1e601f[_0x37d978][_0x32dc('0x21')]],_0x1e601f[_0x37d978]);}return _0x51452e[_0x32dc('0xf')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x49')]=function(){var _0x41d8be=this;return function(_0x5d289b){clearVoiceQueues(_0x41d8be[_0x32dc('0xf')]);if(_0x5d289b){_0x5d289b=_[_0x32dc('0x4a')](_0x5d289b,_0x32dc('0x4b'));for(var _0x2f84dd in _0x5d289b){if(_0x5d289b[_0x32dc('0x22')](_0x2f84dd)){var _0x17e837={};for(var _0x4f534b=0x0;_0x4f534b<_0x5d289b[_0x2f84dd][_0x32dc('0x36')];_0x4f534b+=0x1){var _0x51a8d2=_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x4c')];if(_0x41d8be[_0x32dc('0xf')][_0x51a8d2]){if(_0x5d289b[_0x2f84dd][_0x4f534b]['queuecallerexit']){_0x41d8be[_0x32dc('0xf')][_0x51a8d2][_0x32dc('0x29')]+=0x1;}if(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x4d')]){_0x41d8be['voiceQueues'][_0x51a8d2][_0x32dc('0x2a')]+=0x1;}_0x41d8be[_0x32dc('0xf')][_0x51a8d2][_0x32dc('0x24')]+=moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x4e')])[_0x32dc('0x4f')](moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x50')]),_0x32dc('0x51'))||0x0;if(_0x4f534b===_0x5d289b[_0x2f84dd]['length']-0x1){_0x41d8be[_0x32dc('0xf')][_0x51a8d2]['sumDuration']+=moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x52')]||_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x53')]||_0x5d289b[_0x2f84dd][_0x4f534b]['queuecallerexitAt'])[_0x32dc('0x4f')](moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x50')]),_0x32dc('0x51'))||0x0;_0x41d8be[_0x32dc('0xf')][_0x51a8d2][_0x32dc('0x27')]+=0x1;if(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x54')]){_0x41d8be[_0x32dc('0xf')][_0x51a8d2]['answered']+=0x1;_0x41d8be[_0x32dc('0xf')][_0x51a8d2]['sumBillable']+=moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x52')])[_0x32dc('0x4f')](moment(_0x5d289b[_0x2f84dd][_0x4f534b][_0x32dc('0x4e')]),_0x32dc('0x51'))||0x0;}}else{_0x41d8be[_0x32dc('0xf')][_0x51a8d2][_0x32dc('0x55')]+=_0x41d8be['voiceQueues'][_0x51a8d2][_0x32dc('0x24')]||0x0;}}}}}}return _0x41d8be[_0x32dc('0xf')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x56')]=function(){var _0x18f3a9=this;return function(_0x46e61c){clearVoiceCallReports(_0x18f3a9[_0x32dc('0x13')]);if(_0x46e61c){for(var _0x33d556=0x0;_0x33d556<_0x46e61c[_0x32dc('0x36')];_0x33d556+=0x1){_0x18f3a9[_0x32dc('0x13')]['total']+=0x1;_0x18f3a9['outbound']['sumDuration']+=_0x46e61c[_0x33d556][_0x32dc('0x57')];if(_0x46e61c[_0x33d556][_0x32dc('0x58')]===_0x32dc('0x59')){_0x18f3a9[_0x32dc('0x13')][_0x32dc('0x28')]+=0x1;_0x18f3a9[_0x32dc('0x13')][_0x32dc('0x24')]+=_0x46e61c[_0x33d556][_0x32dc('0x57')]-_0x46e61c[_0x33d556][_0x32dc('0x5a')]||0x0;_0x18f3a9['outbound'][_0x32dc('0x25')]+=_0x46e61c[_0x33d556][_0x32dc('0x5a')];}}}return _0x18f3a9[_0x32dc('0x13')];};};Realtime[_0x32dc('0x33')]['initCampaigns']=function(){var _0x2932eb=this;return function(_0x3f09d9){if(_0x3f09d9){freeIsNotKey(_0x3f09d9,_0x2932eb[_0x32dc('0x11')],_0x32dc('0x21'));for(var _0x4b0c28=0x0,_0x3c9eaf={};_0x4b0c28<_0x3f09d9[_0x32dc('0x36')];_0x4b0c28+=0x1){_0x3c9eaf=_0x3f09d9[_0x4b0c28];if(_['isUndefined'](_0x2932eb['campaigns'][_0x3c9eaf[_0x32dc('0x21')]])){_0x2932eb['campaigns'][_0x3c9eaf['name']]=new Campaign(_0x3c9eaf);}else{_0x2932eb[_0x32dc('0x34')](_0x2932eb[_0x32dc('0x11')][_0x3c9eaf[_0x32dc('0x21')]],_0x3c9eaf);_0x2932eb[_0x32dc('0x11')][_0x3c9eaf[_0x32dc('0x21')]][_0x32dc('0x5b')]=_0x3c9eaf[_0x32dc('0x5c')]?_0x3c9eaf['SquareProject'][_0x32dc('0x21')]:undefined;}}}return _0x2932eb[_0x32dc('0x11')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x5d')]=function(){var _0x96ddb=this;return function(_0x36add3){if(_0x36add3){freeIsNotKey(_0x36add3,_0x96ddb[_0x32dc('0x14')],'id');for(var _0x57767d=0x0,_0x5c8473={};_0x57767d<_0x36add3['length'];_0x57767d+=0x1){_0x5c8473=_0x36add3[_0x57767d];if(_[_0x32dc('0x39')](_0x96ddb[_0x32dc('0x14')][_0x5c8473['id']])){_0x96ddb[_0x32dc('0x14')][_0x5c8473['id']]=new VoiceExtension(_0x5c8473);}else{_0x96ddb[_0x32dc('0x34')](_0x96ddb[_0x32dc('0x14')][_0x5c8473['id']],_0x5c8473);}}}return _0x96ddb[_0x32dc('0x14')];};};Realtime[_0x32dc('0x33')][_0x32dc('0x5e')]=function(){var _0xe0c689=this;return function(_0xe9818e){clearCampaigns(_0xe0c689[_0x32dc('0x11')]);for(var _0x5df257=0x0;_0x5df257<_0xe9818e[_0x32dc('0x36')];_0x5df257+=0x1){_['merge'](_0xe0c689[_0x32dc('0x11')][_0xe9818e[_0x5df257][_0x32dc('0x21')]],_0xe9818e[_0x5df257]);}return _0xe0c689['campaigns'];};};Realtime[_0x32dc('0x33')][_0x32dc('0x5f')]=function(){var _0x45b2c0=this;return function(_0x2f26ba){if(_0x2f26ba){freeIsNotKey(_0x2f26ba,_0x45b2c0[_0x32dc('0x60')],'id');for(var _0x58c587=0x0,_0x144c16={},_0x4cff96={};_0x58c587<_0x2f26ba[_0x32dc('0x36')];_0x58c587+=0x1){_0x144c16=_0x2f26ba[_0x58c587];if(_['isUndefined'](_0x45b2c0[_0x32dc('0x60')][_0x144c16['id']])){_0x45b2c0[_0x32dc('0x60')][_0x144c16['id']]=new FaxAccount(_0x144c16);}else{_0x45b2c0['mergeFromDatabase'](_0x45b2c0[_0x32dc('0x60')][_0x144c16['id']],_0x144c16);}}}return _0x45b2c0['faxAccounts'];};};module[_0x32dc('0x61')]=Realtime; \ No newline at end of file +var _0x0ef4=['voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','isUndefined','initTelephones','length','initTrunks','trunks','mergeFromDatabase','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','lodash','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','templates'];(function(_0x31065e,_0x14ca0e){var _0x37a1da=function(_0x32e90c){while(--_0x32e90c){_0x31065e['push'](_0x31065e['shift']());}};_0x37a1da(++_0x14ca0e);}(_0x0ef4,0xc7));var _0x40ef=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0x0ef4[_0xb4cc12];return _0x8593b5;};'use strict';var util=require('util');var _=require(_0x40ef('0x0'));var moment=require(_0x40ef('0x1'));var Agent=require(_0x40ef('0x2'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x40ef('0x3'));var Trigger=require(_0x40ef('0x4'));var Template=require(_0x40ef('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x40ef('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x40ef('0x7'));var SugarcrmAccount=require(_0x40ef('0x8'));var ZohoAccount=require(_0x40ef('0x9'));var DeskAccount=require(_0x40ef('0xa'));var VtigerAccount=require(_0x40ef('0xb'));var ServicenowAccount=require(_0x40ef('0xc'));var Dynamics365Account=require(_0x40ef('0xd'));var FreshsalesAccount=require(_0x40ef('0xe'));var FaxAccount=require(_0x40ef('0xf'));var Realtime=function(){this['agents']={};this[_0x40ef('0x10')]={};this['trunks']={};this[_0x40ef('0x11')]={};this[_0x40ef('0x12')]={};this[_0x40ef('0x13')]={};this[_0x40ef('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x40ef('0x15')]={};this[_0x40ef('0x16')]={};this[_0x40ef('0x17')]={};this[_0x40ef('0x18')]={};this[_0x40ef('0x19')]={};this[_0x40ef('0x1a')]={};this[_0x40ef('0x1b')]={};this[_0x40ef('0x1c')]={};this[_0x40ef('0x1d')]={};this[_0x40ef('0x1e')]={};this[_0x40ef('0x1f')]={};this[_0x40ef('0x20')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x40ef('0x21')]={};this['freshsalesAccounts']={};this[_0x40ef('0x22')]={};};function freeIsNotKey(_0xdb24fd,_0x50f637,_0x197eea){var _0xcc40df=_['mapKeys'](_0xdb24fd,function(_0x3ddcf0,_0x598145){return _0x3ddcf0[_0x197eea];});for(var _0x3a3ba2 in _0x50f637){if(_0x50f637[_0x40ef('0x23')](_0x3a3ba2)){if(!_0xcc40df[_0x3a3ba2]){delete _0x50f637[_0x3a3ba2];}}}}function freeIsNotKeySip(_0x3573bd,_0x56c84d){var _0x4e0257=_[_0x40ef('0x24')](_0x3573bd,function(_0x54c35d,_0x47213d){return util['format'](_0x40ef('0x25'),_0x54c35d[_0x40ef('0x26')]);});for(var _0x514263 in _0x56c84d){if(_0x56c84d[_0x40ef('0x23')](_0x514263)){if(!_0x4e0257[_0x514263]){delete _0x56c84d[_0x514263];}}}}function freeIsNotKeyAgent(_0x1ee7b5,_0xa60df3){var _0x4a2cc5=_[_0x40ef('0x24')](_0x1ee7b5,function(_0x4cef12,_0x3fb29c){var _0x5d2d53=_[_0x40ef('0x27')](_0x4cef12[_0x40ef('0x28')])?util[_0x40ef('0x29')](_0x40ef('0x25'),_0x4cef12[_0x40ef('0x26')]):_0x4cef12[_0x40ef('0x28')];return _0x5d2d53;});for(var _0x1809d6 in _0xa60df3){if(_0xa60df3[_0x40ef('0x23')](_0x1809d6)){if(!_0x4a2cc5[_0x1809d6]){delete _0xa60df3[_0x1809d6];}}}}function clearVoiceCallReports(_0xcb7712){_0xcb7712[_0x40ef('0x2a')]=0x0;_0xcb7712[_0x40ef('0x2b')]=0x0;_0xcb7712[_0x40ef('0x2c')]=0x0;_0xcb7712[_0x40ef('0x2d')]=0x0;_0xcb7712[_0x40ef('0x2e')]=0x0;}function clearCampaigns(_0x48cfb0){if(!_[_0x40ef('0x2f')](_0x48cfb0)){for(var _0x336c03 in _0x48cfb0){if(_0x48cfb0['hasOwnProperty'](_0x336c03)){_0x48cfb0[_0x336c03]['ivrTotalCallsDays']=0x0;_0x48cfb0[_0x336c03][_0x40ef('0x30')]=0x0;}}}}function clearVoiceQueues(_0x35c0f0){if(!_['isEmpty'](_0x35c0f0)){for(var _0x5753e6 in _0x35c0f0){if(_0x35c0f0['hasOwnProperty'](_0x5753e6)){_0x35c0f0[_0x5753e6][_0x40ef('0x2a')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2b')]=0x0;_0x35c0f0[_0x5753e6]['unmanaged']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x31')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2c')]=0x0;_0x35c0f0[_0x5753e6]['sumDuration']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2e')]=0x0;_0x35c0f0[_0x5753e6]['outboundAnswerAgiCallsDay']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x32')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x33')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x34')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x35')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x36')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x37')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x38')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x39')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3a')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3b')]=0x0;_0x35c0f0[_0x5753e6]['outboundReCallsDay']=0x0;_0x35c0f0[_0x5753e6]['outboundAnswerAgiCallsDay']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3c')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3d')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x578524,_0x22e415){for(var _0x4a6dbb in _0x22e415){if(_0x578524['hasOwnProperty'](_0x4a6dbb)){_0x578524[_0x4a6dbb]=_0x22e415[_0x4a6dbb];}}};Realtime[_0x40ef('0x3e')][_0x40ef('0x3f')]=function(){var _0x43f343=this;return function(_0x48c327){if(_0x48c327){freeIsNotKeyAgent(_0x48c327,_0x43f343[_0x40ef('0x40')]);for(var _0x211e42=0x0,_0x4483b6={},_0x1e64f1={};_0x211e42<_0x48c327['length'];_0x211e42+=0x1){_0x4483b6=_0x48c327[_0x211e42];var _0x5a78f5=_[_0x40ef('0x27')](_0x4483b6['interface'])?util['format'](_0x40ef('0x25'),_0x4483b6[_0x40ef('0x26')]):_0x4483b6['interface'];if(_[_0x40ef('0x41')](_0x43f343['agents'][_0x5a78f5])){_0x43f343[_0x40ef('0x40')][_0x5a78f5]=new Agent(_0x4483b6);}else{_0x43f343['mergeFromDatabase'](_0x43f343[_0x40ef('0x40')][_0x5a78f5],_0x4483b6);}}}return _0x43f343[_0x40ef('0x40')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x42')]=function(){var _0x4d083f=this;return function(_0x17ee0f){if(_0x17ee0f){freeIsNotKeySip(_0x17ee0f,_0x4d083f['telephones']);for(var _0x1944fd=0x0,_0x56a7e5={},_0x4f7a3e={};_0x1944fd<_0x17ee0f[_0x40ef('0x43')];_0x1944fd+=0x1){_0x56a7e5=_0x17ee0f[_0x1944fd];if(_[_0x40ef('0x41')](_0x4d083f[_0x40ef('0x10')][util['format'](_0x40ef('0x25'),_0x56a7e5['name'])])){_0x4d083f[_0x40ef('0x10')][util[_0x40ef('0x29')]('SIP/%s',_0x56a7e5['name'])]=new Telephone(_0x56a7e5);}else{_0x4d083f['mergeFromDatabase'](_0x4d083f[_0x40ef('0x10')][util[_0x40ef('0x29')](_0x40ef('0x25'),_0x56a7e5[_0x40ef('0x26')])],_0x56a7e5);}}}return _0x4d083f[_0x40ef('0x10')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x44')]=function(){var _0x631122=this;return function(_0x1a15d1){if(_0x1a15d1){freeIsNotKeySip(_0x1a15d1,_0x631122[_0x40ef('0x45')]);for(var _0x13bf68=0x0,_0x22cbcd={},_0x17ac54={};_0x13bf68<_0x1a15d1['length'];_0x13bf68+=0x1){_0x22cbcd=_0x1a15d1[_0x13bf68];if(_['isUndefined'](_0x631122[_0x40ef('0x45')][util[_0x40ef('0x29')](_0x40ef('0x25'),_0x22cbcd[_0x40ef('0x26')])])){_0x631122[_0x40ef('0x45')][util['format'](_0x40ef('0x25'),_0x22cbcd[_0x40ef('0x26')])]=new Trunk(_0x22cbcd);}else{_0x631122[_0x40ef('0x46')](_0x631122[_0x40ef('0x45')][util[_0x40ef('0x29')]('SIP/%s',_0x22cbcd[_0x40ef('0x26')])],_0x22cbcd);}}}return _0x631122[_0x40ef('0x45')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x47')]=function(){var _0x14e04c=this;return function(_0x2e6a19){if(_0x2e6a19){freeIsNotKey(_0x2e6a19,_0x14e04c[_0x40ef('0x11')],_0x40ef('0x26'));for(var _0x4dbf11=0x0,_0x26e2e7={},_0xec326b={};_0x4dbf11<_0x2e6a19[_0x40ef('0x43')];_0x4dbf11+=0x1){_0x26e2e7=_0x2e6a19[_0x4dbf11];if(_['isUndefined'](_0x14e04c[_0x40ef('0x11')][_0x26e2e7[_0x40ef('0x26')]])){_0x14e04c[_0x40ef('0x11')][_0x26e2e7['name']]=new VoiceQueue(_0x26e2e7);}else{_0x14e04c[_0x40ef('0x46')](_0x14e04c[_0x40ef('0x11')][_0x26e2e7['name']],_0x26e2e7);}}}return _0x14e04c[_0x40ef('0x11')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x48')]=function(){var _0x1d34d3=this;return function(_0x4bdf0d){if(_0x4bdf0d){freeIsNotKey(_0x4bdf0d,_0x1d34d3[_0x40ef('0x12')],'id');for(var _0x5981fd=0x0,_0x377732={},_0x253c92={};_0x5981fd<_0x4bdf0d[_0x40ef('0x43')];_0x5981fd+=0x1){_0x377732=_0x4bdf0d[_0x5981fd];if(_[_0x40ef('0x41')](_0x1d34d3[_0x40ef('0x12')][_0x377732['id']])){_0x1d34d3['triggers'][_0x377732['id']]=new Trigger(_0x377732);}else{_0x1d34d3[_0x40ef('0x46')](_0x1d34d3[_0x40ef('0x12')][_0x377732['id']],_0x377732);}}}return _0x1d34d3[_0x40ef('0x12')];};};Realtime['prototype'][_0x40ef('0x49')]=function(){var _0x1e5190=this;return function(_0x40710d){if(_0x40710d){freeIsNotKey(_0x40710d,_0x1e5190[_0x40ef('0x14')],'id');for(var _0x1a4486=0x0,_0x4a7532={},_0x3aae7e={};_0x1a4486<_0x40710d[_0x40ef('0x43')];_0x1a4486+=0x1){_0x4a7532=_0x40710d[_0x1a4486];if(_[_0x40ef('0x41')](_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']])){_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']]=new Template(_0x4a7532);}else{_0x1e5190[_0x40ef('0x46')](_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']],_0x4a7532);}}}return _0x1e5190[_0x40ef('0x14')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4a')]=function(){var _0x48254c=this;return function(_0x4647ce){if(_0x4647ce){freeIsNotKey(_0x4647ce,_0x48254c[_0x40ef('0x1b')],'id');for(var _0x8b6a04=0x0,_0x29a735={},_0x5a8efc={};_0x8b6a04<_0x4647ce[_0x40ef('0x43')];_0x8b6a04+=0x1){_0x29a735=_0x4647ce[_0x8b6a04];if(_[_0x40ef('0x41')](_0x48254c['zendeskAccounts'][_0x29a735['id']])){_0x48254c[_0x40ef('0x1b')][_0x29a735['id']]=new ZendeskAccount(_0x29a735);}else{_0x48254c['mergeFromDatabase'](_0x48254c[_0x40ef('0x1b')][_0x29a735['id']],_0x29a735);}}}return _0x48254c[_0x40ef('0x1b')];};};Realtime[_0x40ef('0x3e')]['initSalesforceAccounts']=function(){var _0x4a0902=this;return function(_0x2cc42b){if(_0x2cc42b){freeIsNotKey(_0x2cc42b,_0x4a0902[_0x40ef('0x1c')],'id');for(var _0x48f022=0x0,_0x5d68bc={},_0x4c7581={};_0x48f022<_0x2cc42b[_0x40ef('0x43')];_0x48f022+=0x1){_0x5d68bc=_0x2cc42b[_0x48f022];if(_['isUndefined'](_0x4a0902[_0x40ef('0x1c')][_0x5d68bc['id']])){_0x4a0902[_0x40ef('0x1c')][_0x5d68bc['id']]=new SalesforceAccount(_0x5d68bc);}else{_0x4a0902[_0x40ef('0x46')](_0x4a0902['salesforceAccounts'][_0x5d68bc['id']],_0x5d68bc);}}}return _0x4a0902[_0x40ef('0x1c')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4b')]=function(){var _0x5e017d=this;return function(_0x176c9f){if(_0x176c9f){freeIsNotKey(_0x176c9f,_0x5e017d[_0x40ef('0x1e')],'id');for(var _0x516417=0x0,_0x43acbd={},_0x3bd8d6={};_0x516417<_0x176c9f['length'];_0x516417+=0x1){_0x43acbd=_0x176c9f[_0x516417];if(_['isUndefined'](_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']])){_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']]=new FreshdeskAccount(_0x43acbd);}else{_0x5e017d[_0x40ef('0x46')](_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']],_0x43acbd);}}}return _0x5e017d[_0x40ef('0x1e')];};};Realtime['prototype'][_0x40ef('0x4c')]=function(){var _0x503a9e=this;return function(_0x466598){if(_0x466598){freeIsNotKey(_0x466598,_0x503a9e[_0x40ef('0x1f')],'id');for(var _0x1e3bd7=0x0,_0x239770={},_0x2d5daf={};_0x1e3bd7<_0x466598[_0x40ef('0x43')];_0x1e3bd7+=0x1){_0x239770=_0x466598[_0x1e3bd7];if(_[_0x40ef('0x41')](_0x503a9e[_0x40ef('0x1f')][_0x239770['id']])){_0x503a9e['zohoAccounts'][_0x239770['id']]=new ZohoAccount(_0x239770);}else{_0x503a9e[_0x40ef('0x46')](_0x503a9e[_0x40ef('0x1f')][_0x239770['id']],_0x239770);}}}return _0x503a9e[_0x40ef('0x1f')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4d')]=function(){var _0x423a55=this;return function(_0xa982fa){if(_0xa982fa){freeIsNotKey(_0xa982fa,_0x423a55[_0x40ef('0x20')],'id');for(var _0x51c1a9=0x0,_0x6e5b10={},_0x23541a={};_0x51c1a9<_0xa982fa[_0x40ef('0x43')];_0x51c1a9+=0x1){_0x6e5b10=_0xa982fa[_0x51c1a9];if(_[_0x40ef('0x41')](_0x423a55[_0x40ef('0x20')][_0x6e5b10['id']])){_0x423a55[_0x40ef('0x20')][_0x6e5b10['id']]=new DeskAccount(_0x6e5b10);}else{_0x423a55[_0x40ef('0x46')](_0x423a55['deskAccounts'][_0x6e5b10['id']],_0x6e5b10);}}}return _0x423a55[_0x40ef('0x20')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4e')]=function(){var _0x1bfce=this;return function(_0x483673){if(_0x483673){freeIsNotKey(_0x483673,_0x1bfce['sugarcrmAccounts'],'id');for(var _0x1d840c=0x0,_0x220b98={},_0x5909d5={};_0x1d840c<_0x483673[_0x40ef('0x43')];_0x1d840c+=0x1){_0x220b98=_0x483673[_0x1d840c];if(_[_0x40ef('0x41')](_0x1bfce[_0x40ef('0x1d')][_0x220b98['id']])){_0x1bfce['sugarcrmAccounts'][_0x220b98['id']]=new SugarcrmAccount(_0x220b98);}else{_0x1bfce[_0x40ef('0x46')](_0x1bfce[_0x40ef('0x1d')][_0x220b98['id']],_0x220b98);}}}return _0x1bfce['sugarcrmAccounts'];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4f')]=function(){var _0x14ae5a=this;return function(_0x240665){if(_0x240665){freeIsNotKey(_0x240665,_0x14ae5a[_0x40ef('0x50')],'id');for(var _0x3e81a0=0x0,_0x4e5d23={},_0x1c7525={};_0x3e81a0<_0x240665[_0x40ef('0x43')];_0x3e81a0+=0x1){_0x4e5d23=_0x240665[_0x3e81a0];if(_[_0x40ef('0x41')](_0x14ae5a['vtigerAccounts'][_0x4e5d23['id']])){_0x14ae5a[_0x40ef('0x50')][_0x4e5d23['id']]=new VtigerAccount(_0x4e5d23);}else{_0x14ae5a['mergeFromDatabase'](_0x14ae5a[_0x40ef('0x50')][_0x4e5d23['id']],_0x4e5d23);}}}return _0x14ae5a[_0x40ef('0x50')];};};Realtime[_0x40ef('0x3e')]['initServicenowAccounts']=function(){var _0x41daac=this;return function(_0x1eae97){if(_0x1eae97){freeIsNotKey(_0x1eae97,_0x41daac['servicenowAccounts'],'id');for(var _0x245b91=0x0,_0x428777={},_0x1835b3={};_0x245b91<_0x1eae97['length'];_0x245b91+=0x1){_0x428777=_0x1eae97[_0x245b91];if(_[_0x40ef('0x41')](_0x41daac[_0x40ef('0x51')][_0x428777['id']])){_0x41daac[_0x40ef('0x51')][_0x428777['id']]=new ServicenowAccount(_0x428777);}else{_0x41daac[_0x40ef('0x46')](_0x41daac[_0x40ef('0x51')][_0x428777['id']],_0x428777);}}}return _0x41daac[_0x40ef('0x51')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x52')]=function(){var _0x1b7b3b=this;return function(_0x4ecd31){if(_0x4ecd31){freeIsNotKey(_0x4ecd31,_0x1b7b3b[_0x40ef('0x21')],'id');for(var _0x1825db=0x0,_0x382513={},_0x45754d={};_0x1825db<_0x4ecd31[_0x40ef('0x43')];_0x1825db+=0x1){_0x382513=_0x4ecd31[_0x1825db];if(_['isUndefined'](_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']])){_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']]=new Dynamics365Account(_0x382513);}else{_0x1b7b3b['mergeFromDatabase'](_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']],_0x382513);}}}return _0x1b7b3b[_0x40ef('0x21')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x53')]=function(){var _0x1d4418=this;return function(_0x5c1f8f){if(_0x5c1f8f){freeIsNotKey(_0x5c1f8f,_0x1d4418[_0x40ef('0x54')],'id');for(var _0x4acff6=0x0,_0x181039={},_0x50ddb3={};_0x4acff6<_0x5c1f8f[_0x40ef('0x43')];_0x4acff6+=0x1){_0x181039=_0x5c1f8f[_0x4acff6];if(_[_0x40ef('0x41')](_0x1d4418[_0x40ef('0x54')][_0x181039['id']])){_0x1d4418['freshsalesAccounts'][_0x181039['id']]=new FreshsalesAccount(_0x181039);}else{_0x1d4418[_0x40ef('0x46')](_0x1d4418['freshsalesAccounts'][_0x181039['id']],_0x181039);}}}return _0x1d4418[_0x40ef('0x54')];};};Realtime['prototype'][_0x40ef('0x55')]=function(){var _0x279804=this;return function(_0x233dfd){for(var _0x349292=0x0;_0x349292<_0x233dfd[_0x40ef('0x43')];_0x349292+=0x1){_[_0x40ef('0x56')](_0x279804[_0x40ef('0x11')][_0x233dfd[_0x349292]['name']],_0x233dfd[_0x349292]);}return _0x279804[_0x40ef('0x11')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x57')]=function(){var _0x25276b=this;return function(_0x1ea879){clearVoiceQueues(_0x25276b['voiceQueues']);if(_0x1ea879){_0x1ea879=_[_0x40ef('0x58')](_0x1ea879,_0x40ef('0x59'));for(var _0x5c429a in _0x1ea879){if(_0x1ea879['hasOwnProperty'](_0x5c429a)){var _0x3d7e95={};for(var _0x3ebb10=0x0;_0x3ebb10<_0x1ea879[_0x5c429a][_0x40ef('0x43')];_0x3ebb10+=0x1){var _0x525865=_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5a')];if(_0x25276b[_0x40ef('0x11')][_0x525865]){if(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5b')]){_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x5c')]+=0x1;}if(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5d')]){_0x25276b[_0x40ef('0x11')][_0x525865]['abandoned']+=0x1;}_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2c')]+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5e')])[_0x40ef('0x5f')](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x60')]),_0x40ef('0x61'))||0x0;if(_0x3ebb10===_0x1ea879[_0x5c429a]['length']-0x1){_0x25276b[_0x40ef('0x11')][_0x525865]['sumDuration']+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x62')]||_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x63')]||_0x1ea879[_0x5c429a][_0x3ebb10]['queuecallerexitAt'])[_0x40ef('0x5f')](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x60')]),_0x40ef('0x61'))||0x0;_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2a')]+=0x1;if(_0x1ea879[_0x5c429a][_0x3ebb10]['queuecallercomplete']){_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2b')]+=0x1;_0x25276b['voiceQueues'][_0x525865][_0x40ef('0x2e')]+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x62')])['diff'](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5e')]),_0x40ef('0x61'))||0x0;}}else{_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2d')]+=_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2c')]||0x0;}}}}}}return _0x25276b[_0x40ef('0x11')];};};Realtime['prototype'][_0x40ef('0x64')]=function(){var _0xe5eb2c=this;return function(_0x14de22){clearVoiceCallReports(_0xe5eb2c[_0x40ef('0x65')]);if(_0x14de22){for(var _0xed2870=0x0;_0xed2870<_0x14de22[_0x40ef('0x43')];_0xed2870+=0x1){_0xe5eb2c['outbound']['total']+=0x1;_0xe5eb2c[_0x40ef('0x65')][_0x40ef('0x2d')]+=_0x14de22[_0xed2870]['duration'];if(_0x14de22[_0xed2870][_0x40ef('0x66')]===_0x40ef('0x67')){_0xe5eb2c[_0x40ef('0x65')][_0x40ef('0x2b')]+=0x1;_0xe5eb2c['outbound']['sumHoldTime']+=_0x14de22[_0xed2870][_0x40ef('0x68')]-_0x14de22[_0xed2870][_0x40ef('0x69')]||0x0;_0xe5eb2c['outbound'][_0x40ef('0x2e')]+=_0x14de22[_0xed2870]['billableseconds'];}}}return _0xe5eb2c[_0x40ef('0x65')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x6a')]=function(){var _0x1a6cea=this;return function(_0x19e355){if(_0x19e355){freeIsNotKey(_0x19e355,_0x1a6cea[_0x40ef('0x13')],_0x40ef('0x26'));for(var _0x55acbd=0x0,_0x50d069={};_0x55acbd<_0x19e355['length'];_0x55acbd+=0x1){_0x50d069=_0x19e355[_0x55acbd];if(_['isUndefined'](_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]])){_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]]=new Campaign(_0x50d069);}else{_0x1a6cea[_0x40ef('0x46')](_0x1a6cea['campaigns'][_0x50d069[_0x40ef('0x26')]],_0x50d069);_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]][_0x40ef('0x6b')]=_0x50d069[_0x40ef('0x6c')]?_0x50d069[_0x40ef('0x6c')][_0x40ef('0x26')]:undefined;}}}return _0x1a6cea[_0x40ef('0x13')];};};Realtime['prototype'][_0x40ef('0x6d')]=function(){var _0x176377=this;return function(_0x391054){if(_0x391054){freeIsNotKey(_0x391054,_0x176377[_0x40ef('0x15')],'id');for(var _0x14d37f=0x0,_0x2553b2={};_0x14d37f<_0x391054[_0x40ef('0x43')];_0x14d37f+=0x1){_0x2553b2=_0x391054[_0x14d37f];if(_[_0x40ef('0x41')](_0x176377[_0x40ef('0x15')][_0x2553b2['id']])){_0x176377[_0x40ef('0x15')][_0x2553b2['id']]=new VoiceExtension(_0x2553b2);}else{_0x176377[_0x40ef('0x46')](_0x176377[_0x40ef('0x15')][_0x2553b2['id']],_0x2553b2);}}}return _0x176377[_0x40ef('0x15')];};};Realtime[_0x40ef('0x3e')]['initCampaignHopperHistory']=function(){var _0x4c7b1a=this;return function(_0x59b347){clearCampaigns(_0x4c7b1a[_0x40ef('0x13')]);for(var _0x43f8e9=0x0;_0x43f8e9<_0x59b347[_0x40ef('0x43')];_0x43f8e9+=0x1){_[_0x40ef('0x56')](_0x4c7b1a[_0x40ef('0x13')][_0x59b347[_0x43f8e9][_0x40ef('0x26')]],_0x59b347[_0x43f8e9]);}return _0x4c7b1a[_0x40ef('0x13')];};};Realtime[_0x40ef('0x3e')]['initFaxAccounts']=function(){var _0x22a17e=this;return function(_0x5261d5){if(_0x5261d5){freeIsNotKey(_0x5261d5,_0x22a17e[_0x40ef('0x22')],'id');for(var _0x2c14ad=0x0,_0x59e77e={},_0x406e27={};_0x2c14ad<_0x5261d5[_0x40ef('0x43')];_0x2c14ad+=0x1){_0x59e77e=_0x5261d5[_0x2c14ad];if(_[_0x40ef('0x41')](_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']])){_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']]=new FaxAccount(_0x59e77e);}else{_0x22a17e[_0x40ef('0x46')](_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']],_0x59e77e);}}}return _0x22a17e['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index be91cbb..0479123 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 _0xfbef=['interface','SIP/%s','length','connectedlinenum','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','split','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','callerid','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','create','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil'];(function(_0x24dc39,_0x3e65b9){var _0x1c8524=function(_0x5e55a6){while(--_0x5e55a6){_0x24dc39['push'](_0x24dc39['shift']());}};_0x1c8524(++_0x3e65b9);}(_0xfbef,0x93));var _0xffbe=function(_0x328282,_0x34705b){_0x328282=_0x328282-0x0;var _0x27f0a6=_0xfbef[_0x328282];return _0x27f0a6;};'use strict';var _=require(_0xffbe('0x0'));var moment=require(_0xffbe('0x1'));var util=require(_0xffbe('0x2'));var config=require(_0xffbe('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xffbe('0x4'));var RpcMemberReport=require(_0xffbe('0x5'));var RpcVoiceQueueReport=require(_0xffbe('0x6'));var RpcVoiceRecording=require(_0xffbe('0x7'));var RpcVoiceTransferReport=require(_0xffbe('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xffbe('0x9'));var VoiceAgentReport=require(_0xffbe('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xffbe('0xb'));function Report(_0x3f38c4){this[_0xffbe('0xc')]=_0x3f38c4;this[_0xffbe('0xd')]=_0x3f38c4[_0xffbe('0xd')];this[_0xffbe('0xe')]=_0x3f38c4['telephones'];}Report[_0xffbe('0xf')][_0xffbe('0x10')]=function(_0x46e5e9){var _0x5ef48f=new VoiceQueueReport(this[_0xffbe('0xc')]);var _0x4f8c69=new VoiceAgentReport(this[_0xffbe('0xc')]);var _0x218a4f=new VoiceDialReport(this['realtime']);var _0x162622=new VoiceCallReport(this[_0xffbe('0xc')]);var _0x23aee8=new UserReport(this['realtime']);if(config[_0xffbe('0x11')]&&config['xdr']['disabled']){ami['on'](_0xffbe('0x12'),this[_0xffbe('0x13')][_0xffbe('0x14')](this));ami['on'](_0xffbe('0x15'),this[_0xffbe('0x16')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xffbe('0x17')][_0xffbe('0x14')](this));ami['on']('custom:voiceDialReport',this[_0xffbe('0x18')][_0xffbe('0x14')](this));ami['on'](_0xffbe('0x19'),this[_0xffbe('0x1a')]['bind'](this));ami['on']('attendedtransfer',this[_0xffbe('0x1b')][_0xffbe('0x14')](this));}};Report[_0xffbe('0xf')][_0xffbe('0x1c')]=function(_0x377d47){var _0x1b3c79;_0x1b3c79=_[_0xffbe('0x1d')](this['agents'],function(_0x1ff0a9){return _0x1ff0a9[_0xffbe('0x1e')]==_0x377d47||_0x1ff0a9[_0xffbe('0x1f')]==_0x377d47;});if(_[_0xffbe('0x20')](_0x1b3c79)){var _0x3e45ec=_[_0xffbe('0x1d')](this[_0xffbe('0xe')],function(_0x1a312e){return _0x1a312e[_0xffbe('0x1e')]==_0x377d47||_0x1a312e[_0xffbe('0x1f')]==_0x377d47;});if(_0x3e45ec){_0x1b3c79=_[_0xffbe('0x1d')](this[_0xffbe('0xd')],function(_0xd34f29){return _0xd34f29[_0xffbe('0x21')]==util['format'](_0xffbe('0x22'),_0x3e45ec['name']);});}}return _0x1b3c79;};Report['prototype'][_0xffbe('0x13')]=function(_0x262b3b){for(var _0x2423b3=0x0;_0x2423b3<_0x262b3b[_0xffbe('0x23')];_0x2423b3+=0x1){var _0x465202=this[_0xffbe('0x1c')](_0x262b3b[_0x2423b3][_0xffbe('0x24')]);if(_0x465202){_0x262b3b[_0x2423b3]['accountcode']=_0x465202[_0xffbe('0x1e')];_0x262b3b[_0x2423b3]['assigned']=!![];_0x262b3b[_0x2423b3][_0xffbe('0x25')]=_0x465202[_0xffbe('0x1f')];_0x262b3b[_0x2423b3][_0xffbe('0x21')]=_[_0xffbe('0x20')](_0x465202[_0xffbe('0x21')])?util[_0xffbe('0x26')](_0xffbe('0x22'),_0x465202['name']):_0x465202['interface'];if(_0x262b3b[_0x2423b3][_0xffbe('0x27')]){_0x262b3b[_0x2423b3][_0xffbe('0x28')]=moment()[_0xffbe('0x26')](_0xffbe('0x29'));}if(_0x262b3b[_0x2423b3][_0xffbe('0x2a')]){_0x262b3b[_0x2423b3]['queuecallerexitAt']=moment()[_0xffbe('0x26')](_0xffbe('0x29'));}RpcMemberReport[_0xffbe('0x13')](_0x262b3b[_0x2423b3]);}RpcVoiceQueueReport['create'](_0x262b3b[_0x2423b3]);}};function extractCalleridNumber(_0x30b7e4){var _0x6a3882=_0x30b7e4[_0xffbe('0x2b')](/<(.*?)>/);return _0x6a3882?_0x6a3882[0x1]:_0x30b7e4;}Report['prototype'][_0xffbe('0x2c')]=function(_0x4b6f56){for(var _0x3472ae=0x0;_0x3472ae/);return _0x42dfda?_0x42dfda[0x1]:_0x46694d;}Report[_0x1a49('0x12')][_0x1a49('0x35')]=function(_0x40712c){for(var _0x3c976a=0x0;_0x3c976a',_0x10550e[_0x1a49('0x4c')],_0x10550e['calleridnum']);}if(RpcVoiceTransferReport[_0x1a49('0x4d')][_0x10550e['linkedid']]){var _0x2a820e=RpcVoiceTransferReport['transfers'][_0x10550e[_0x1a49('0x4e')]];_0x2a820e[_0x1a49('0x4f')]=_0x10550e[_0x1a49('0x50')];RpcVoiceTransferReport['blindTransfer'](_0x2a820e);delete RpcVoiceTransferReport[_0x1a49('0x4d')][_0x10550e['linkedid']];}if(_[_0x1a49('0x26')](_0x10550e['type'])){_0x10550e[_0x1a49('0x3e')]=this[_0x1a49('0x37')](_0x10550e);}if(_[_0x1a49('0x26')](_0x10550e['UserId'])){var _0x13a291=_0x10550e[_0x1a49('0x38')][_0x1a49('0x39')]('-')[0x0];var _0x1b041e=this[_0x1a49('0x27')][_0x13a291];if(!_0x1b041e)_0x1b041e=this['getAgentByInternal'](_0x10550e[_0x1a49('0x24')]);if(_0x1b041e){_0x10550e[_0x1a49('0x51')]=_0x1b041e['id'];_0x10550e[_0x1a49('0x52')]=_0x1b041e[_0x1a49('0x25')];}}RpcVoiceCallReport[_0x1a49('0x33')](_0x10550e);if(_0x10550e[_0x1a49('0x53')]){for(var _0x2d487f=0x0;_0x2d487f<_0x10550e[_0x1a49('0x54')][_0x1a49('0x2b')];_0x2d487f+=0x1){_0x10550e[_0x1a49('0x55')]=_0x10550e[_0x1a49('0x54')][_0x2d487f][_0x1a49('0x56')];_0x10550e[_0x1a49('0x57')]=_0x10550e[_0x1a49('0x54')][_0x2d487f]['createdAt'];if(_0x10550e[_0x1a49('0x58')]=='xcally-motion-preview'){_0x10550e[_0x1a49('0x3a')]=_0x10550e[_0x1a49('0x2c')];_0x10550e[_0x1a49('0x4c')]=_0x10550e[_0x1a49('0x59')];_0x10550e[_0x1a49('0x2c')]=_0x10550e[_0x1a49('0x24')];_0x10550e[_0x1a49('0x59')]=_0x10550e['membername'];_0x10550e['exten']=_0x10550e['originatecalleridnum'];}else if(_0x10550e[_0x1a49('0x58')]==_0x1a49('0x5a')){_0x10550e[_0x1a49('0x3a')]=_0x10550e['destination'];_0x10550e[_0x1a49('0x58')]=_0x10550e['originatecalleridnum'];}RpcVoiceRecording[_0x1a49('0x33')](_0x10550e);}}};Report[_0x1a49('0x12')][_0x1a49('0x1c')]=function(_0x335f4d){if(_[_0x1a49('0x5b')](_0x335f4d)){_0x335f4d['forEach'](function(_0x3f5b02){RpcVoiceAgentReport[_0x1a49('0x33')](_0x3f5b02);});}else{RpcVoiceAgentReport[_0x1a49('0x33')](_0x335f4d);}};Report[_0x1a49('0x12')][_0x1a49('0x5c')]=function(_0x162fe6){RpcVoiceDialReport[_0x1a49('0x33')](_0x162fe6);var _0xffbf00;var _0x589045;var _0x3a64ee=_0x162fe6[_0x1a49('0x38')];if(_[_0x1a49('0x5d')](_0x3a64ee,_0x1a49('0x5e'))){_0x589045=_0x3a64ee[_0x1a49('0x5f')](_0x3a64ee[_0x1a49('0x60')]('/')+0x1,_0x3a64ee['indexOf']('@'));_0xffbf00=_[_0x1a49('0x23')](this[_0x1a49('0x27')],function(_0x1308d9){return _0x1308d9[_0x1a49('0x61')]==_0x589045||_0x1308d9[_0x1a49('0x62')]==_0x589045||_0x1308d9[_0x1a49('0x24')]==_0x589045;});}else{_0x589045=_0x3a64ee[_0x1a49('0x5f')](_0x3a64ee[_0x1a49('0x60')]('/')+0x1,_0x3a64ee[_0x1a49('0x63')]('-'));_0xffbf00=this[_0x1a49('0x22')](_0x589045);}if(_0xffbf00){_0x162fe6['interface']=_['isNil'](_0xffbf00[_0x1a49('0x28')])?util[_0x1a49('0x29')](_0x1a49('0x2a'),_0xffbf00[_0x1a49('0x25')]):_0xffbf00[_0x1a49('0x28')];_0x162fe6['membername']=_0xffbf00['name'];_0x162fe6[_0x1a49('0x24')]=_0xffbf00['accountcode'];RpcMemberReport[_0x1a49('0x5c')](_0x162fe6);}};Report[_0x1a49('0x12')]['blindTransfer']=function(_0x18a416){RpcVoiceTransferReport[_0x1a49('0x4d')][_0x18a416[_0x1a49('0x64')]]=_0x18a416;};Report['prototype']['attendedTransfer']=function(_0xb0a7a1){RpcVoiceTransferReport[_0x1a49('0x21')](_0xb0a7a1);};module[_0x1a49('0x65')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 08a5faf..132a00a 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 _0x44d0=['find','username','stateRegistry','state','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','inuse','local','toLowerCase','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','trunks','stateTime','trunk:%s','startsWith','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:save','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','actionDeviceStateList','[userReport][devicestatelist]','inspect','actionSipPeerStatus','prototype','resolve','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','debug'];(function(_0x3914d8,_0xc9fbcf){var _0x5ca9b3=function(_0x3e032e){while(--_0x3e032e){_0x3914d8['push'](_0x3914d8['shift']());}};_0x5ca9b3(++_0xc9fbcf);}(_0x44d0,0x77));var _0x044d=function(_0x3120a1,_0x1eeb17){_0x3120a1=_0x3120a1-0x0;var _0x32f8ac=_0x44d0[_0x3120a1];return _0x32f8ac;};'use strict';var _=require(_0x044d('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x044d('0x1'));var BPromise=require(_0x044d('0x2'));var config=require(_0x044d('0x3'));var logger=require(_0x044d('0x4'))(_0x044d('0x5'));var ami=require(_0x044d('0x6'));config[_0x044d('0x7')]=_[_0x044d('0x8')](config[_0x044d('0x7')],{'host':_0x044d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x044d('0x7')]));function UserReport(_0x427016){this['trunks']=_0x427016['trunks'];this[_0x044d('0xa')]=_0x427016[_0x044d('0xa')];this[_0x044d('0xb')]=_0x427016['telephones'];ami['on'](_0x044d('0xc'),this[_0x044d('0xd')][_0x044d('0xe')](this));ami['on'](_0x044d('0xf'),this[_0x044d('0xd')]['bind'](this));ami['on']('devicestatechange',this[_0x044d('0x10')][_0x044d('0xe')](this));ami['on'](_0x044d('0x11'),this[_0x044d('0x12')][_0x044d('0xe')](this));return this[_0x044d('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0x044d('0x14')](ami[_0x044d('0x15')]())[_0x044d('0x16')](function(_0xb217bb){logger[_0x044d('0x17')](_0x044d('0x18'),util['inspect'](_0xb217bb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x044d('0x14')](ami[_0x044d('0x19')]())['catch'](function(_0x2fb512){logger['error'](_0x044d('0x1a'),util[_0x044d('0x1b')](_0x2fb512,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x044d('0x14')](ami[_0x044d('0x1c')]())[_0x044d('0x16')](function(_0x347080){logger[_0x044d('0x17')]('[userReport][sippeerstatus]',util[_0x044d('0x1b')](_0x347080,{'showHidden':![],'depth':null}));});}UserReport[_0x044d('0x1d')][_0x044d('0x13')]=function(){setInterval(function(){BPromise[_0x044d('0x1e')]()[_0x044d('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0x044d('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x044d('0x1d')][_0x044d('0x1f')]=function(_0x3a8076){return _0x3a8076!==null&&!_[_0x044d('0x20')](_0x3a8076);};UserReport[_0x044d('0x1d')][_0x044d('0x21')]=function(_0x55a8b8,_0x489fce,_0x361331){io['to'](_0x55a8b8)[_0x044d('0x21')](_0x489fce,_0x361331);};UserReport[_0x044d('0x1d')]['syncRegistry']=function(_0x137e4c){try{if(this[_0x044d('0x1f')](_0x137e4c)){logger[_0x044d('0x22')](_0x044d('0x23'),_0x137e4c['username'],_0x137e4c['state']);logger[_0x044d('0x24')]('[userReport][registry]',util[_0x044d('0x1b')](_0x137e4c,{'showHidden':![],'depth':null}));var _0x17f6e0=_[_0x044d('0x25')](this['trunks'],{'defaultuser':_0x137e4c[_0x044d('0x26')]});if(_0x17f6e0){_0x137e4c[_0x044d('0x27')]=_0x137e4c[_0x044d('0x28')];_['merge'](_0x17f6e0,_[_0x044d('0x29')](_0x137e4c,[_0x044d('0x2a'),_0x044d('0x2b'),_0x044d('0x26'),_0x044d('0x28')]));logger[_0x044d('0x24')](_0x044d('0x2c'),util[_0x044d('0x1b')](_0x17f6e0,{'showHidden':![],'depth':null}));this[_0x044d('0x21')](util[_0x044d('0x2d')]('trunk:%s',_0x17f6e0['name']),'trunk:save',_0x17f6e0);}}}catch(_0x4a373d){logger['error'](_0x044d('0x2e'),util[_0x044d('0x1b')](_0x4a373d,{'showHidden':![],'depth':null}));}};UserReport[_0x044d('0x1d')]['syncDeviceState']=function(_0x38fe82){try{if(this[_0x044d('0x1f')](_0x38fe82)){logger[_0x044d('0x22')](_0x044d('0x2f'),_0x38fe82[_0x044d('0x30')],_0x38fe82[_0x044d('0x28')]);logger[_0x044d('0x24')](_0x044d('0x31'),util['inspect'](_0x38fe82,{'showHidden':![],'depth':null}));if(this[_0x044d('0xa')][_0x38fe82[_0x044d('0x30')]]){if(!this['agents'][_0x38fe82['device']]['local']||_0x38fe82[_0x044d('0x28')]['toLowerCase']()==_0x044d('0x32')){this[_0x044d('0xa')][_0x38fe82['device']][_0x044d('0x33')]=![];if(this[_0x044d('0xa')][_0x38fe82[_0x044d('0x30')]]['state']!==_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]()){this['agents'][_0x38fe82[_0x044d('0x30')]]['stateTime']=_[_0x044d('0x35')](moment()['format']('x'));}this[_0x044d('0xa')][_0x38fe82[_0x044d('0x30')]][_0x044d('0x28')]=_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]();this['agents'][_0x38fe82['device']]['updateStatusRealtime'](_0x38fe82);}}else if(this['telephones'][_0x38fe82[_0x044d('0x30')]]){if(this['telephones'][_0x38fe82[_0x044d('0x30')]][_0x044d('0x28')]!==_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]()){this[_0x044d('0xb')][_0x38fe82['device']]['stateTime']=_[_0x044d('0x35')](moment()[_0x044d('0x2d')]('x'));}this[_0x044d('0xb')][_0x38fe82['device']][_0x044d('0x28')]=_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]();logger['debug'](_0x044d('0x36'),util[_0x044d('0x1b')](this[_0x044d('0xb')][_0x38fe82[_0x044d('0x30')]],{'showHidden':![],'depth':null}));this[_0x044d('0x21')](util[_0x044d('0x2d')](_0x044d('0x37'),this[_0x044d('0xb')][_0x38fe82['device']][_0x044d('0x38')]),_0x044d('0x39'),this[_0x044d('0xb')][_0x38fe82[_0x044d('0x30')]]);}else if(this[_0x044d('0x3a')][_0x38fe82[_0x044d('0x30')]]){if(this[_0x044d('0x3a')][_0x38fe82['device']][_0x044d('0x28')]!==_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]()){this['trunks'][_0x38fe82[_0x044d('0x30')]][_0x044d('0x3b')]=_['toNumber'](moment()['format']('x'));}this[_0x044d('0x3a')][_0x38fe82['device']][_0x044d('0x28')]=_0x38fe82['state']['toLowerCase']();logger[_0x044d('0x24')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x044d('0x1b')](this[_0x044d('0x3a')][_0x38fe82[_0x044d('0x30')]],{'showHidden':![],'depth':null}));this[_0x044d('0x21')](util[_0x044d('0x2d')](_0x044d('0x3c'),this['trunks'][_0x38fe82[_0x044d('0x30')]][_0x044d('0x38')]),'trunk:save',this[_0x044d('0x3a')][_0x38fe82['device']]);}else if(_[_0x044d('0x3d')](_0x38fe82[_0x044d('0x30')],'Local')){var _0x18c9d1=_0x38fe82['device'];var _0xa8f7b4=_0x18c9d1[_0x044d('0x3e')](_0x18c9d1['indexOf']('/')+0x1,_0x18c9d1[_0x044d('0x3f')]('@'));var _0x4dc323=_[_0x044d('0x25')](this['agents'],function(_0x33318a){return _0x33318a[_0x044d('0x40')]==_0xa8f7b4||_0x33318a[_0x044d('0x41')]==_0xa8f7b4||_0x33318a[_0x044d('0x42')]==_0xa8f7b4;});if(_0x4dc323){if(_0x4dc323[_0x044d('0x28')]!==_0x38fe82[_0x044d('0x28')][_0x044d('0x34')]()){_0x4dc323[_0x044d('0x3b')]=_[_0x044d('0x35')](moment()['format']('x'));}_0x4dc323[_0x044d('0x28')]=_0x38fe82[_0x044d('0x28')]['toLowerCase']();_0x4dc323[_0x044d('0x33')]=!![];_0x4dc323[_0x044d('0x43')](_0x38fe82);}}}}catch(_0x39f6e3){logger[_0x044d('0x17')]('[userReport][devicestatechange]',util[_0x044d('0x1b')](_0x39f6e3,{'showHidden':![],'depth':null}));}};UserReport[_0x044d('0x1d')][_0x044d('0x12')]=function(_0x320ef1){try{if(this[_0x044d('0x1f')](_0x320ef1)&&this[_0x044d('0x1f')](_0x320ef1['peerstatus'])){logger[_0x044d('0x22')](_0x044d('0x44'),_0x320ef1[_0x044d('0x45')],_0x320ef1[_0x044d('0x46')],_0x320ef1[_0x044d('0x11')]);logger[_0x044d('0x24')](_0x044d('0x47'),util[_0x044d('0x1b')](_0x320ef1,{'showHidden':![],'depth':null}));if(this[_0x044d('0xa')][_0x320ef1[_0x044d('0x45')]]){if(!this[_0x044d('0xa')][_0x320ef1['peer']][_0x044d('0x33')]||_0x320ef1[_0x044d('0x11')]['toLowerCase']()==_0x044d('0x48')){this[_0x044d('0xa')][_0x320ef1['peer']][_0x044d('0x33')]=![];this['agents'][_0x320ef1[_0x044d('0x45')]][_0x044d('0x49')]=_0x320ef1['peerstatus'][_0x044d('0x34')]();this['agents'][_0x320ef1['peer']][_0x044d('0x46')]=_0x320ef1[_0x044d('0x46')];this[_0x044d('0xa')][_0x320ef1[_0x044d('0x45')]][_0x044d('0x43')](_0x320ef1);}}else if(this[_0x044d('0xb')][_0x320ef1['peer']]){this[_0x044d('0xb')][_0x320ef1[_0x044d('0x45')]][_0x044d('0x49')]=_0x320ef1[_0x044d('0x11')][_0x044d('0x34')]();this['telephones'][_0x320ef1[_0x044d('0x45')]]['address']=_0x320ef1[_0x044d('0x46')];logger[_0x044d('0x24')](_0x044d('0x4a'),util[_0x044d('0x1b')](this[_0x044d('0xb')][_0x320ef1[_0x044d('0x45')]],{'showHidden':![],'depth':null}));this[_0x044d('0x21')](util[_0x044d('0x2d')](_0x044d('0x37'),this[_0x044d('0xb')][_0x320ef1[_0x044d('0x45')]][_0x044d('0x38')]),_0x044d('0x39'),this[_0x044d('0xb')][_0x320ef1[_0x044d('0x45')]]);}else if(this[_0x044d('0x3a')][_0x320ef1[_0x044d('0x45')]]){this['trunks'][_0x320ef1[_0x044d('0x45')]][_0x044d('0x49')]=_0x320ef1[_0x044d('0x11')][_0x044d('0x34')]();this[_0x044d('0x3a')][_0x320ef1[_0x044d('0x45')]]['address']=_0x320ef1[_0x044d('0x46')];logger['debug'](_0x044d('0x4b'),util[_0x044d('0x1b')](this[_0x044d('0x3a')][_0x320ef1[_0x044d('0x45')]],{'showHidden':![],'depth':null}));this[_0x044d('0x21')](util['format']('trunk:%s',this[_0x044d('0x3a')][_0x320ef1[_0x044d('0x45')]]['name']),_0x044d('0x4c'),this[_0x044d('0x3a')][_0x320ef1[_0x044d('0x45')]]);}}}catch(_0x2e23){logger['error'](_0x044d('0x47'),util[_0x044d('0x1b')](_0x2e23,{'showHidden':![],'depth':null}));}};module[_0x044d('0x4d')]=UserReport; \ No newline at end of file +var _0xca86=['name','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','syncPeerStatus','peerstatus','[userReport][peerstatus]','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','trunk:%s','exports','lodash','moment','util','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','resolve','actionDeviceStateList','actionSipPeerStatus','error','[userReport][sippeerstatus]','inspect','prototype','syncRealtimeShow','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:save','[userReport][registry]','device','local','inuse','stateTime','toNumber','format','toLowerCase','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xca86,0xb3));var _0x6ca8=function(_0x2fc0c0,_0x5df78b){_0x2fc0c0=_0x2fc0c0-0x0;var _0x54e049=_0xca86[_0x2fc0c0];return _0x54e049;};'use strict';var _=require(_0x6ca8('0x0'));var moment=require(_0x6ca8('0x1'));var util=require(_0x6ca8('0x2'));var Redis=require('ioredis');var BPromise=require(_0x6ca8('0x3'));var config=require(_0x6ca8('0x4'));var logger=require('../../../config/logger')(_0x6ca8('0x5'));var ami=require(_0x6ca8('0x6'));config[_0x6ca8('0x7')]=_[_0x6ca8('0x8')](config[_0x6ca8('0x7')],{'host':_0x6ca8('0x9'),'port':0x18eb});var io=require(_0x6ca8('0xa'))(new Redis(config[_0x6ca8('0x7')]));function UserReport(_0x43f578){this[_0x6ca8('0xb')]=_0x43f578[_0x6ca8('0xb')];this[_0x6ca8('0xc')]=_0x43f578[_0x6ca8('0xc')];this[_0x6ca8('0xd')]=_0x43f578['telephones'];ami['on'](_0x6ca8('0xe'),this[_0x6ca8('0xf')][_0x6ca8('0x10')](this));ami['on'](_0x6ca8('0x11'),this[_0x6ca8('0xf')][_0x6ca8('0x10')](this));ami['on'](_0x6ca8('0x12'),this[_0x6ca8('0x13')]['bind'](this));ami['on']('peerstatus',this['syncPeerStatus'][_0x6ca8('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0x6ca8('0x14')](ami[_0x6ca8('0x15')]())[_0x6ca8('0x16')](function(_0x23c5eb){logger['error'](_0x6ca8('0x17'),util['inspect'](_0x23c5eb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6ca8('0x18')]()['then'](ami[_0x6ca8('0x19')]())[_0x6ca8('0x16')](function(_0x32e77a){logger['error']('[userReport][devicestatelist]',util['inspect'](_0x32e77a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6ca8('0x18')]()[_0x6ca8('0x14')](ami[_0x6ca8('0x1a')]())[_0x6ca8('0x16')](function(_0x532647){logger[_0x6ca8('0x1b')](_0x6ca8('0x1c'),util[_0x6ca8('0x1d')](_0x532647,{'showHidden':![],'depth':null}));});}UserReport[_0x6ca8('0x1e')][_0x6ca8('0x1f')]=function(){setInterval(function(){BPromise['resolve']()[_0x6ca8('0x14')](showSipRegistrations())[_0x6ca8('0x14')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x6ca8('0x1e')]['isNotNull']=function(_0x270213){return _0x270213!==null&&!_[_0x6ca8('0x20')](_0x270213);};UserReport[_0x6ca8('0x1e')][_0x6ca8('0x21')]=function(_0x2eb3c9,_0x194d0c,_0x2692cb){io['to'](_0x2eb3c9)[_0x6ca8('0x21')](_0x194d0c,_0x2692cb);};UserReport['prototype']['syncRegistry']=function(_0x536693){try{if(this[_0x6ca8('0x22')](_0x536693)){logger[_0x6ca8('0x23')](_0x6ca8('0x24'),_0x536693[_0x6ca8('0x25')],_0x536693[_0x6ca8('0x26')]);logger[_0x6ca8('0x27')]('[userReport][registry]',util[_0x6ca8('0x1d')](_0x536693,{'showHidden':![],'depth':null}));var _0x5e01d6=_[_0x6ca8('0x28')](this[_0x6ca8('0xb')],{'defaultuser':_0x536693['username']});if(_0x5e01d6){_0x536693[_0x6ca8('0x29')]=_0x536693[_0x6ca8('0x26')];_[_0x6ca8('0x2a')](_0x5e01d6,_[_0x6ca8('0x2b')](_0x536693,[_0x6ca8('0x2c'),_0x6ca8('0x2d'),_0x6ca8('0x25'),_0x6ca8('0x26')]));logger[_0x6ca8('0x27')](_0x6ca8('0x2e'),util['inspect'](_0x5e01d6,{'showHidden':![],'depth':null}));this[_0x6ca8('0x21')](util['format']('trunk:%s',_0x5e01d6['name']),_0x6ca8('0x2f'),_0x5e01d6);}}}catch(_0x49744a){logger[_0x6ca8('0x1b')](_0x6ca8('0x30'),util[_0x6ca8('0x1d')](_0x49744a,{'showHidden':![],'depth':null}));}};UserReport[_0x6ca8('0x1e')]['syncDeviceState']=function(_0x1ef9f9){try{if(this[_0x6ca8('0x22')](_0x1ef9f9)){logger[_0x6ca8('0x23')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x1ef9f9[_0x6ca8('0x31')],_0x1ef9f9[_0x6ca8('0x26')]);logger[_0x6ca8('0x27')]('[userReport][devicestatechange]',util[_0x6ca8('0x1d')](_0x1ef9f9,{'showHidden':![],'depth':null}));if(this[_0x6ca8('0xc')][_0x1ef9f9[_0x6ca8('0x31')]]){if(!this[_0x6ca8('0xc')][_0x1ef9f9['device']][_0x6ca8('0x32')]||_0x1ef9f9[_0x6ca8('0x26')]['toLowerCase']()==_0x6ca8('0x33')){this[_0x6ca8('0xc')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x32')]=![];if(this[_0x6ca8('0xc')][_0x1ef9f9['device']]['state']!==_0x1ef9f9[_0x6ca8('0x26')]['toLowerCase']()){this[_0x6ca8('0xc')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x34')]=_[_0x6ca8('0x35')](moment()[_0x6ca8('0x36')]('x'));}this[_0x6ca8('0xc')][_0x1ef9f9['device']][_0x6ca8('0x26')]=_0x1ef9f9[_0x6ca8('0x26')][_0x6ca8('0x37')]();this[_0x6ca8('0xc')][_0x1ef9f9[_0x6ca8('0x31')]]['updateStatusRealtime'](_0x1ef9f9);}}else if(this[_0x6ca8('0xd')][_0x1ef9f9[_0x6ca8('0x31')]]){if(this[_0x6ca8('0xd')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x26')]!==_0x1ef9f9[_0x6ca8('0x26')][_0x6ca8('0x37')]()){this[_0x6ca8('0xd')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x34')]=_[_0x6ca8('0x35')](moment()[_0x6ca8('0x36')]('x'));}this[_0x6ca8('0xd')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x26')]=_0x1ef9f9[_0x6ca8('0x26')]['toLowerCase']();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x6ca8('0x1d')](this['telephones'][_0x1ef9f9[_0x6ca8('0x31')]],{'showHidden':![],'depth':null}));this[_0x6ca8('0x21')](util[_0x6ca8('0x36')]('telephone:%s',this['telephones'][_0x1ef9f9[_0x6ca8('0x31')]]['name']),_0x6ca8('0x38'),this['telephones'][_0x1ef9f9[_0x6ca8('0x31')]]);}else if(this[_0x6ca8('0xb')][_0x1ef9f9['device']]){if(this[_0x6ca8('0xb')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x26')]!==_0x1ef9f9[_0x6ca8('0x26')][_0x6ca8('0x37')]()){this['trunks'][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x34')]=_['toNumber'](moment()[_0x6ca8('0x36')]('x'));}this[_0x6ca8('0xb')][_0x1ef9f9[_0x6ca8('0x31')]]['state']=_0x1ef9f9[_0x6ca8('0x26')][_0x6ca8('0x37')]();logger[_0x6ca8('0x27')](_0x6ca8('0x39'),util[_0x6ca8('0x1d')](this[_0x6ca8('0xb')][_0x1ef9f9[_0x6ca8('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',this[_0x6ca8('0xb')][_0x1ef9f9[_0x6ca8('0x31')]][_0x6ca8('0x3a')]),_0x6ca8('0x2f'),this[_0x6ca8('0xb')][_0x1ef9f9[_0x6ca8('0x31')]]);}else if(_[_0x6ca8('0x3b')](_0x1ef9f9['device'],_0x6ca8('0x3c'))){var _0x2358f3=_0x1ef9f9['device'];var _0x2f045d=_0x2358f3[_0x6ca8('0x3d')](_0x2358f3[_0x6ca8('0x3e')]('/')+0x1,_0x2358f3['indexOf']('@'));var _0x3e041f=_[_0x6ca8('0x28')](this[_0x6ca8('0xc')],function(_0x23c439){return _0x23c439[_0x6ca8('0x3f')]==_0x2f045d||_0x23c439[_0x6ca8('0x40')]==_0x2f045d||_0x23c439[_0x6ca8('0x41')]==_0x2f045d;});if(_0x3e041f){if(_0x3e041f['state']!==_0x1ef9f9[_0x6ca8('0x26')]['toLowerCase']()){_0x3e041f[_0x6ca8('0x34')]=_[_0x6ca8('0x35')](moment()[_0x6ca8('0x36')]('x'));}_0x3e041f[_0x6ca8('0x26')]=_0x1ef9f9[_0x6ca8('0x26')][_0x6ca8('0x37')]();_0x3e041f[_0x6ca8('0x32')]=!![];_0x3e041f[_0x6ca8('0x42')](_0x1ef9f9);}}}}catch(_0x2c84bc){logger[_0x6ca8('0x1b')]('[userReport][devicestatechange]',util[_0x6ca8('0x1d')](_0x2c84bc,{'showHidden':![],'depth':null}));}};UserReport[_0x6ca8('0x1e')][_0x6ca8('0x43')]=function(_0xb67859){try{if(this[_0x6ca8('0x22')](_0xb67859)&&this[_0x6ca8('0x22')](_0xb67859[_0x6ca8('0x44')])){logger[_0x6ca8('0x23')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0xb67859['peer'],_0xb67859['address'],_0xb67859[_0x6ca8('0x44')]);logger[_0x6ca8('0x27')](_0x6ca8('0x45'),util[_0x6ca8('0x1d')](_0xb67859,{'showHidden':![],'depth':null}));if(this[_0x6ca8('0xc')][_0xb67859[_0x6ca8('0x46')]]){if(!this[_0x6ca8('0xc')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x32')]||_0xb67859[_0x6ca8('0x44')][_0x6ca8('0x37')]()==_0x6ca8('0x47')){this[_0x6ca8('0xc')][_0xb67859['peer']][_0x6ca8('0x32')]=![];this[_0x6ca8('0xc')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x48')]=_0xb67859[_0x6ca8('0x44')]['toLowerCase']();this[_0x6ca8('0xc')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x49')]=_0xb67859[_0x6ca8('0x49')];this[_0x6ca8('0xc')][_0xb67859['peer']][_0x6ca8('0x42')](_0xb67859);}}else if(this[_0x6ca8('0xd')][_0xb67859[_0x6ca8('0x46')]]){this[_0x6ca8('0xd')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x48')]=_0xb67859[_0x6ca8('0x44')][_0x6ca8('0x37')]();this[_0x6ca8('0xd')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x49')]=_0xb67859['address'];logger[_0x6ca8('0x27')](_0x6ca8('0x4a'),util[_0x6ca8('0x1d')](this[_0x6ca8('0xd')][_0xb67859['peer']],{'showHidden':![],'depth':null}));this[_0x6ca8('0x21')](util[_0x6ca8('0x36')](_0x6ca8('0x4b'),this['telephones'][_0xb67859['peer']][_0x6ca8('0x3a')]),_0x6ca8('0x38'),this['telephones'][_0xb67859[_0x6ca8('0x46')]]);}else if(this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]]){this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x48')]=_0xb67859[_0x6ca8('0x44')]['toLowerCase']();this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x49')]=_0xb67859['address'];logger[_0x6ca8('0x27')](_0x6ca8('0x4c'),util[_0x6ca8('0x1d')](this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]],{'showHidden':![],'depth':null}));this[_0x6ca8('0x21')](util['format'](_0x6ca8('0x4d'),this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]][_0x6ca8('0x3a')]),'trunk:save',this[_0x6ca8('0xb')][_0xb67859[_0x6ca8('0x46')]]);}}}catch(_0x185e43){logger['error'](_0x6ca8('0x45'),util[_0x6ca8('0x1d')](_0x185e43,{'showHidden':![],'depth':null}));}};module[_0x6ca8('0x4e')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 086b3f1..842bbac 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 _0x7bc1=['destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]','lodash','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','queuecallerabandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','merge','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum'];(function(_0xd6260f,_0x4fca19){var _0x1b5ae4=function(_0x3f9d1b){while(--_0x3f9d1b){_0xd6260f['push'](_0xd6260f['shift']());}};_0x1b5ae4(++_0x4fca19);}(_0x7bc1,0xfa));var _0x17bc=function(_0x2aba17,_0x128a30){_0x2aba17=_0x2aba17-0x0;var _0x5a9599=_0x7bc1[_0x2aba17];return _0x5a9599;};'use strict';var _=require(_0x17bc('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x17bc('0x1'));var config=require(_0x17bc('0x2'));var logger=require(_0x17bc('0x3'))(_0x17bc('0x4'));var ami=require(_0x17bc('0x5'));config[_0x17bc('0x6')]=_[_0x17bc('0x7')](config[_0x17bc('0x6')],{'host':_0x17bc('0x8'),'port':0x18eb});var io=require(_0x17bc('0x9'))(new Redis(config[_0x17bc('0x6')]));function VoiceAgentReport(_0x2e8c8c){this[_0x17bc('0xa')]={};this[_0x17bc('0xb')]=_0x2e8c8c[_0x17bc('0xa')];this['voiceQueues']=_0x2e8c8c[_0x17bc('0xc')];this[_0x17bc('0xd')]=_0x2e8c8c[_0x17bc('0xd')];this[_0x17bc('0xe')]={};ami['on'](_0x17bc('0xf'),this[_0x17bc('0x10')][_0x17bc('0x11')](this));ami['on']('agentconnect',this[_0x17bc('0x12')][_0x17bc('0x11')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x17bc('0x13'),this['syncQueueCallerAbandon'][_0x17bc('0x11')](this));ami['on'](_0x17bc('0x14'),this['syncAgentComplete']['bind'](this));ami['on'](_0x17bc('0x15'),this[_0x17bc('0x16')][_0x17bc('0x11')](this));ami['on'](_0x17bc('0x17'),this[_0x17bc('0x18')]['bind'](this));ami['on'](_0x17bc('0x19'),this[_0x17bc('0x1a')][_0x17bc('0x11')](this));ami['on'](_0x17bc('0x1b'),this[_0x17bc('0x1c')][_0x17bc('0x11')](this));ami['on']('attendedtransfer',this[_0x17bc('0x1d')][_0x17bc('0x11')](this));ami['on'](_0x17bc('0x1e'),this[_0x17bc('0x1f')][_0x17bc('0x11')](this));}VoiceAgentReport['prototype'][_0x17bc('0x20')]=function(_0x21b9da,_0x5173f9,_0x5e6e3e){io['to'](_0x21b9da)[_0x17bc('0x20')](_0x5173f9,_0x5e6e3e);};VoiceAgentReport[_0x17bc('0x21')][_0x17bc('0x22')]=function(_0x1989a8){return _0x1989a8!==null&&!_['isUndefined'](_0x1989a8);};VoiceAgentReport[_0x17bc('0x21')]['syncAgentCalled']=function(_0x178609){try{if(this['isNotNull'](_0x178609)){logger['info'](_0x17bc('0x23'),_0x178609[_0x17bc('0x24')],_0x178609[_0x17bc('0x25')],_0x178609[_0x17bc('0x26')]);logger['debug'](_0x17bc('0x27'),_0x178609['uniqueid'],util[_0x17bc('0x28')](_0x178609,{'showHidden':![],'depth':null}));if(_[_0x17bc('0x29')](this['channels'][_0x178609[_0x17bc('0x24')]])){this[_0x17bc('0xa')][_0x178609['uniqueid']]={};}if(_['isUndefined'](this[_0x17bc('0xa')][_0x178609[_0x17bc('0x24')]][_0x178609['destuniqueid']])){this[_0x17bc('0xa')][_0x178609[_0x17bc('0x24')]][_0x178609['destuniqueid']]={'agentcalledAt':moment()[_0x17bc('0x2a')](_0x17bc('0x2b')),'lastevent':_0x17bc('0x2c'),'mandatoryDisposition':this[_0x17bc('0xc')][_0x178609[_0x17bc('0x2d')]]?this[_0x17bc('0xc')][_0x178609[_0x17bc('0x2d')]][_0x17bc('0x2e')]||![]:![],'type':this[_0x17bc('0xc')][_0x178609[_0x17bc('0x2d')]]?this['voiceQueues'][_0x178609[_0x17bc('0x2d')]]['type']||_0x17bc('0x2f'):'inbound','variables':this['variables'][_0x178609['uniqueid']],'motionChannel':'voice'};}_[_0x17bc('0x30')](this[_0x17bc('0xa')][_0x178609[_0x17bc('0x24')]][_0x178609[_0x17bc('0x26')]],_[_0x17bc('0x31')](_0x178609,[_0x17bc('0x32'),_0x17bc('0x33')]));logger[_0x17bc('0x34')](_0x17bc('0x35'),_0x178609['uniqueid'],util[_0x17bc('0x28')](this[_0x17bc('0xa')][_0x178609['uniqueid']][_0x178609[_0x17bc('0x26')]],{'showHidden':![],'depth':null}));ami[_0x17bc('0x20')](_0x17bc('0x36'),this[_0x17bc('0xa')][_0x178609['uniqueid']][_0x178609[_0x17bc('0x26')]]);var _0x391cd2={'id':this[_0x17bc('0xd')][_0x178609[_0x17bc('0x37')]]['id'],'calleridnum':this[_0x17bc('0xa')][_0x178609['uniqueid']][_0x178609[_0x17bc('0x26')]]['calleridnum'],'queue':this[_0x17bc('0xa')][_0x178609[_0x17bc('0x24')]][_0x178609[_0x17bc('0x26')]][_0x17bc('0x2d')],'variables':this[_0x17bc('0xa')][_0x178609['uniqueid']][_0x178609['destuniqueid']][_0x17bc('0xe')]};logger[_0x17bc('0x34')](_0x17bc('0x38'),_0x178609[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x391cd2,{'showHidden':![],'depth':null}));this[_0x17bc('0x20')](util[_0x17bc('0x2a')](_0x17bc('0x39'),_0x178609['membername']),'user:called',_0x391cd2);}}catch(_0x501b63){logger['error'](_0x17bc('0x3a'),_0x178609['uniqueid'],util[_0x17bc('0x28')](_0x501b63,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x17bc('0x12')]=function(_0x1fd46c){try{if(this[_0x17bc('0x22')](_0x1fd46c)){if(this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]]){logger[_0x17bc('0x34')](_0x17bc('0x3b'),_0x1fd46c[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x1fd46c,{'showHidden':![],'depth':null}));for(var _0x5c212e in this['channels'][_0x1fd46c[_0x17bc('0x24')]]){if(this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x17bc('0x3c')](_0x5c212e)){if(_0x1fd46c[_0x17bc('0x26')]===_0x5c212e){logger[_0x17bc('0x3d')](_0x17bc('0x3e'),_0x1fd46c['uniqueid'],_0x1fd46c[_0x17bc('0x25')],_0x1fd46c[_0x17bc('0x26')]);this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x3f')]=moment()['format'](_0x17bc('0x2b'));this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x40')]=_0x1fd46c[_0x17bc('0x40')];this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x41')]=_0x1fd46c[_0x17bc('0x41')];this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x42')]=_0x1fd46c[_0x17bc('0x42')];this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x43')]=_0x1fd46c['destchannelstatedesc'];this[_0x17bc('0xa')][_0x1fd46c['uniqueid']][_0x5c212e][_0x17bc('0x44')]=_0x1fd46c[_0x17bc('0x44')];this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x45')]=_0x17bc('0x46');if(this[_0x17bc('0xb')][this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e]['uniqueid']]){var _0x1a4a6b=this['voiceChannels'][this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x24')]][_0x17bc('0x47')];this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x47')]=_0x1a4a6b;_0x1fd46c[_0x17bc('0x47')]=_0x1a4a6b;}_[_0x17bc('0x30')](this[_0x17bc('0xd')][_0x1fd46c[_0x17bc('0x37')]],_[_0x17bc('0x48')](_0x1fd46c,[_0x17bc('0x2d'),_0x17bc('0x49'),_0x17bc('0x47')]));logger['debug'](_0x17bc('0x4a'),_0x1fd46c['uniqueid'],util[_0x17bc('0x28')](this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x1fd46c[_0x17bc('0x26')]],{'showHidden':![],'depth':null}));ami['emit'](_0x17bc('0x4b'),this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x1fd46c[_0x17bc('0x26')]]);logger[_0x17bc('0x34')](_0x17bc('0x4c'),_0x1fd46c[_0x17bc('0x24')],util[_0x17bc('0x28')](this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x1fd46c[_0x17bc('0x26')]],{'showHidden':![],'depth':null}));this[_0x17bc('0x20')](util['format'](_0x17bc('0x39'),_0x1fd46c['membername']),_0x17bc('0x4d'),this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x1fd46c[_0x17bc('0x26')]]);}else if(!this[_0x17bc('0xa')][_0x1fd46c['uniqueid']][_0x5c212e]['agentringnoanswer']&&!this['channels'][_0x1fd46c['uniqueid']][_0x5c212e][_0x17bc('0x14')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x1fd46c[_0x17bc('0x24')],this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x25')],_0x5c212e);this['channels'][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x4e')]=!![];this[_0x17bc('0xa')][_0x1fd46c['uniqueid']][_0x5c212e][_0x17bc('0x4f')]=moment()[_0x17bc('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x50')]=_0x1fd46c[_0x17bc('0x26')];this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x51')]=_0x1fd46c[_0x17bc('0x25')];this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x45')]=_0x17bc('0x52');this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e][_0x17bc('0x53')]='answered_elsewhere';logger[_0x17bc('0x34')](_0x17bc('0x54'),_0x1fd46c['uniqueid'],util[_0x17bc('0x28')](this[_0x17bc('0xa')][_0x1fd46c[_0x17bc('0x24')]][_0x5c212e],{'showHidden':![],'depth':null}));ami['emit'](_0x17bc('0x55'),this['channels'][_0x1fd46c['uniqueid']][_0x5c212e]);}}}}}}catch(_0x520cb2){logger[_0x17bc('0x56')]('[%s][voiceAgentReport][agentconnect]',_0x1fd46c[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x520cb2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')]['syncAgentRingNoAnswer']=function(_0x2eac1a){try{if(this[_0x17bc('0x22')](_0x2eac1a)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x2eac1a['uniqueid'],util[_0x17bc('0x28')](_0x2eac1a,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x2eac1a['uniqueid']]&&this[_0x17bc('0xa')][_0x2eac1a[_0x17bc('0x24')]][_0x2eac1a[_0x17bc('0x26')]]){logger[_0x17bc('0x3d')](_0x17bc('0x57'),_0x2eac1a[_0x17bc('0x24')],_0x2eac1a[_0x17bc('0x25')],_0x2eac1a[_0x17bc('0x26')]);this[_0x17bc('0xa')][_0x2eac1a[_0x17bc('0x24')]][_0x2eac1a[_0x17bc('0x26')]][_0x17bc('0x4e')]=!![];this[_0x17bc('0xa')][_0x2eac1a[_0x17bc('0x24')]][_0x2eac1a[_0x17bc('0x26')]][_0x17bc('0x4f')]=moment()['format'](_0x17bc('0x2b'));this[_0x17bc('0xa')][_0x2eac1a['uniqueid']][_0x2eac1a[_0x17bc('0x26')]][_0x17bc('0x45')]=_0x17bc('0x58');this[_0x17bc('0xa')][_0x2eac1a[_0x17bc('0x24')]][_0x2eac1a['destuniqueid']]['reason']=_0x17bc('0x58');logger[_0x17bc('0x34')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x2eac1a[_0x17bc('0x24')],util[_0x17bc('0x28')](this[_0x17bc('0xa')][_0x2eac1a['uniqueid']][_0x2eac1a[_0x17bc('0x26')]],{'showHidden':![],'depth':null}));ami['emit'](_0x17bc('0x59'),this['channels'][_0x2eac1a[_0x17bc('0x24')]][_0x2eac1a[_0x17bc('0x26')]]);}}}catch(_0x438ed3){logger[_0x17bc('0x56')](_0x17bc('0x5a'),_0x2eac1a[_0x17bc('0x24')],util['inspect'](_0x438ed3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x17bc('0x5b')]=function(_0x589bcf){try{if(this[_0x17bc('0x22')](_0x589bcf)){logger[_0x17bc('0x34')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x589bcf[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x589bcf,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]]){for(var _0x9c06be in this['channels'][_0x589bcf[_0x17bc('0x24')]]){if(this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]][_0x17bc('0x3c')](_0x9c06be)&&!this['channels'][_0x589bcf[_0x17bc('0x24')]][_0x9c06be]['agentringnoanswer']&&!this['channels'][_0x589bcf['uniqueid']][_0x9c06be][_0x17bc('0x14')]){logger['info'](_0x17bc('0x5c'),_0x589bcf[_0x17bc('0x24')],this['channels'][_0x589bcf['uniqueid']][_0x9c06be][_0x17bc('0x25')],_0x9c06be);this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]][_0x9c06be][_0x17bc('0x4e')]=!![];this['channels'][_0x589bcf[_0x17bc('0x24')]][_0x9c06be][_0x17bc('0x4f')]=moment()[_0x17bc('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]][_0x9c06be]['lastevent']=_0x17bc('0x5d');this[_0x17bc('0xa')][_0x589bcf['uniqueid']][_0x9c06be][_0x17bc('0x53')]='abandoned';logger[_0x17bc('0x34')](_0x17bc('0x5e'),_0x589bcf[_0x17bc('0x24')],util['inspect'](this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]][_0x9c06be],{'showHidden':![],'depth':null}));ami[_0x17bc('0x20')](_0x17bc('0x5f'),this[_0x17bc('0xa')][_0x589bcf[_0x17bc('0x24')]][_0x9c06be]);}}}}}catch(_0x37bbee){logger[_0x17bc('0x56')](_0x17bc('0x60'),_0x589bcf[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x37bbee,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')]['syncAgentComplete']=function(_0x143c0e){try{if(this[_0x17bc('0x22')](_0x143c0e)){logger[_0x17bc('0x34')](_0x17bc('0x61'),_0x143c0e[_0x17bc('0x24')],util['inspect'](_0x143c0e,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x143c0e['uniqueid']]){for(var _0x3a88d7 in this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]]){if(this[_0x17bc('0xa')][_0x143c0e['uniqueid']][_0x17bc('0x3c')](_0x3a88d7)){if(this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x3f')]&&!this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x14')]){logger[_0x17bc('0x3d')](_0x17bc('0x62'),_0x143c0e[_0x17bc('0x24')],this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x25')],_0x3a88d7);this['channels'][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x14')]=!![];this[_0x17bc('0xa')][_0x143c0e['uniqueid']][_0x3a88d7][_0x17bc('0x63')]=moment()[_0x17bc('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x45')]=_0x17bc('0x64');this['channels'][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x53')]=_0x143c0e[_0x17bc('0x53')]==_0x17bc('0x65')?_0x17bc('0x66'):_0x143c0e['reason'];this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x67')]=_0x143c0e['talktime'];if(this[_0x17bc('0xc')][_0x143c0e[_0x17bc('0x2d')]]&&this[_0x17bc('0xc')][_0x143c0e[_0x17bc('0x2d')]][_0x17bc('0x68')]){this[_0x17bc('0xa')][_0x143c0e['uniqueid']][_0x3a88d7][_0x17bc('0x69')]=this[_0x17bc('0xc')][_0x143c0e[_0x17bc('0x2d')]][_0x17bc('0x6a')];this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7][_0x17bc('0x6b')]=!![];}this['agents'][_0x143c0e['interface']]=_[_0x17bc('0x31')](this[_0x17bc('0xd')][_0x143c0e[_0x17bc('0x37')]],['queue',_0x17bc('0x49')]);logger[_0x17bc('0x34')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x143c0e[_0x17bc('0x24')],util[_0x17bc('0x28')](this[_0x17bc('0xa')][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7],{'showHidden':![],'depth':null}));ami[_0x17bc('0x20')](_0x17bc('0x6c'),this['channels'][_0x143c0e[_0x17bc('0x24')]][_0x3a88d7]);logger['debug'](_0x17bc('0x6d'),_0x143c0e[_0x17bc('0x24')],util[_0x17bc('0x28')]({'id':this[_0x17bc('0xd')][_0x143c0e[_0x17bc('0x37')]]['id'],'destaccountcode':_0x143c0e[_0x17bc('0x6e')]},{'showHidden':![],'depth':null}));this[_0x17bc('0x20')](util[_0x17bc('0x2a')]('user:%s',_0x143c0e[_0x17bc('0x25')]),'user:agentcomplete',{'id':this[_0x17bc('0xd')][_0x143c0e[_0x17bc('0x37')]]['id'],'destaccountcode':_0x143c0e[_0x17bc('0x6e')]});}}}}}}catch(_0x334193){logger['error']('[%s][voiceAgentReport][agentcomplete]',_0x143c0e[_0x17bc('0x24')],util['inspect'](_0x334193,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x17bc('0x16')]=function(_0xed3aae){try{if(this[_0x17bc('0x22')](_0xed3aae)){logger[_0x17bc('0x34')](_0x17bc('0x6f'),_0xed3aae['uniqueid'],util['inspect'](_0xed3aae,{'showHidden':![],'depth':null}));this['addVariable'](_0xed3aae[_0x17bc('0x24')],_[_0x17bc('0x70')](_0xed3aae[_0x17bc('0x71')])[0x0],_0xed3aae[_0x17bc('0x72')]);if(this[_0x17bc('0xa')][_0xed3aae[_0x17bc('0x24')]]){for(var _0x288d00 in this[_0x17bc('0xa')][_0xed3aae['uniqueid']]){if(this['channels'][_0xed3aae[_0x17bc('0x24')]]['hasOwnProperty'](_0x288d00)){logger['info']('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0xed3aae[_0x17bc('0x24')],_0x288d00,_['keys'](_0xed3aae[_0x17bc('0x71')])[0x0],_0xed3aae[_0x17bc('0x72')]);if(_['isUndefined'](this[_0x17bc('0xa')][_0xed3aae[_0x17bc('0x24')]][_0x288d00]['variables'])){this['channels'][_0xed3aae[_0x17bc('0x24')]][_0x288d00][_0x17bc('0xe')]={};}this[_0x17bc('0xa')][_0xed3aae[_0x17bc('0x24')]][_0x288d00][_0x17bc('0xe')]=this[_0x17bc('0xe')][_0xed3aae[_0x17bc('0x24')]];}}}}}catch(_0xb73e7e){logger[_0x17bc('0x56')](_0x17bc('0x73'),_0xed3aae[_0x17bc('0x24')],util[_0x17bc('0x28')](_0xb73e7e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x17bc('0x74')]=function(_0x4da89b,_0x1f2634,_0xb57abd){var _0x31ab3a=[_0x17bc('0x75'),_0x17bc('0x76'),_0x17bc('0x77'),_0x17bc('0x78'),_0x17bc('0x79'),_0x17bc('0x7a'),_0x17bc('0x7b'),'rtpaudioqosrttbridged','sipcallid',_0x17bc('0x7c'),_0x17bc('0x7d'),_0x17bc('0x7e'),_0x17bc('0x7f'),'memberdynamic',_0x17bc('0x80'),_0x17bc('0x81'),'membername',_0x17bc('0x82'),_0x17bc('0x83')];if(!_[_0x17bc('0x84')](_0x1f2634)&&!_[_0x17bc('0x85')](_0x31ab3a,_0x1f2634)){if(_[_0x17bc('0x29')](this['variables'][_0x4da89b])){this['variables'][_0x4da89b]={};}this[_0x17bc('0xe')][_0x4da89b][_0x1f2634]=_0xb57abd;}};VoiceAgentReport[_0x17bc('0x21')]['syncHangup']=function(_0x1faa02){try{if(this[_0x17bc('0x22')](_0x1faa02)){logger[_0x17bc('0x34')]('[%s][voiceAgentReport][hangup]\x20event:',_0x1faa02['uniqueid'],util[_0x17bc('0x28')](_0x1faa02,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]]){for(var _0x3d4137 in this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]]){if(this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]][_0x17bc('0x3c')](_0x3d4137)){if(this['channels'][_0x1faa02[_0x17bc('0x24')]][_0x3d4137][_0x17bc('0x53')]==_0x17bc('0x65')&&this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]][_0x3d4137][_0x17bc('0x14')]){logger[_0x17bc('0x3d')](_0x17bc('0x86'),_0x1faa02['uniqueid'],_0x3d4137);this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]][_0x3d4137][_0x17bc('0x63')]=moment()[_0x17bc('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x17bc('0x34')](_0x17bc('0x87'),_0x1faa02[_0x17bc('0x24')],util[_0x17bc('0x28')](_[_0x17bc('0x88')](this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]]),{'showHidden':![],'depth':null}));ami[_0x17bc('0x20')](_0x17bc('0x89'),_[_0x17bc('0x88')](this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]]));delete this[_0x17bc('0xa')][_0x1faa02[_0x17bc('0x24')]];}if(this[_0x17bc('0xe')][_0x1faa02[_0x17bc('0x24')]]){delete this['variables'][_0x1faa02[_0x17bc('0x24')]];}}}catch(_0x41ef37){logger['error']('[%s][voiceAgentReport][hangup]',_0x1faa02[_0x17bc('0x24')],util['inspect'](_0x41ef37,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')][_0x17bc('0x1d')]=function(_0x266391){try{if(this[_0x17bc('0x22')](_0x266391)){logger[_0x17bc('0x34')](_0x17bc('0x8a'),_0x266391[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x266391,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]]){for(var _0x1da79f in this['channels'][_0x266391[_0x17bc('0x8b')]]){if(this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x17bc('0x3c')](_0x1da79f)){if(_0x266391[_0x17bc('0x8c')]===_0x1da79f){logger[_0x17bc('0x3d')](_0x17bc('0x8d'),_0x266391['uniqueid'],this[_0x17bc('0xa')][_0x266391['transfereeuniqueid']][_0x1da79f][_0x17bc('0x25')],_0x1da79f);var _0x536d0a=moment();this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x1da79f][_0x17bc('0x14')]=!![];this[_0x17bc('0xa')][_0x266391['transfereeuniqueid']][_0x1da79f][_0x17bc('0x63')]=moment()[_0x17bc('0x2a')](_0x17bc('0x2b'));this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x1da79f][_0x17bc('0x45')]=_0x17bc('0x64');this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x1da79f][_0x17bc('0x53')]=_0x17bc('0x65');this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x1da79f][_0x17bc('0x67')]=_0x536d0a[_0x17bc('0x8e')](this[_0x17bc('0xa')][_0x266391[_0x17bc('0x8b')]][_0x1da79f][_0x17bc('0x3f')],_0x17bc('0x8f'));}}}}if(this['channels'][_0x266391[_0x17bc('0x90')]]){var _0x46defd=this['channels'][_0x266391['secondtransfereruniqueid']];this[_0x17bc('0xa')][_0x266391[_0x17bc('0x90')]]=this['channels'][_0x266391['transfereeuniqueid']];this[_0x17bc('0xa')][_0x266391['transfereeuniqueid']]=_0x46defd;}}}catch(_0x2c6dd1){logger[_0x17bc('0x56')](_0x17bc('0x91'),_0x266391[_0x17bc('0x24')],util['inspect'](_0x2c6dd1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')][_0x17bc('0x1f')]=function(_0x6c73a0){try{if(this['isNotNull'](_0x6c73a0)){logger[_0x17bc('0x34')](_0x17bc('0x92'),_0x6c73a0[_0x17bc('0x24')],util['inspect'](_0x6c73a0,{'showHidden':![],'depth':null}));if(this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]]){for(var _0xdc6a08 in this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]]){if(this['channels'][_0x6c73a0[_0x17bc('0x8b')]]['hasOwnProperty'](_0xdc6a08)){if(_0x6c73a0[_0x17bc('0x93')]===_0xdc6a08){logger[_0x17bc('0x3d')](_0x17bc('0x94'),_0x6c73a0[_0x17bc('0x24')],this[_0x17bc('0xa')][_0x6c73a0['transfereeuniqueid']][_0xdc6a08][_0x17bc('0x25')],_0xdc6a08);var _0x1dd903=moment();this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]][_0xdc6a08]['agentcomplete']=!![];this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]][_0xdc6a08][_0x17bc('0x63')]=_0x1dd903;this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]][_0xdc6a08][_0x17bc('0x45')]=_0x17bc('0x64');this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]][_0xdc6a08][_0x17bc('0x53')]='transfer';this[_0x17bc('0xa')][_0x6c73a0[_0x17bc('0x8b')]][_0xdc6a08][_0x17bc('0x67')]=_0x1dd903['diff'](this['channels'][_0x6c73a0['transfereeuniqueid']][_0xdc6a08][_0x17bc('0x3f')],'seconds');}}}}}}catch(_0x2bda77){logger[_0x17bc('0x56')](_0x17bc('0x95'),_0x6c73a0[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x2bda77,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')][_0x17bc('0x1a')]=function(_0x1bce4a){var _0x6b6dcd='';try{if(this[_0x17bc('0x22')](_0x1bce4a)){logger['debug'](_0x17bc('0x96'),_0x1bce4a['uniqueid'],util[_0x17bc('0x28')](_0x1bce4a,{'showHidden':![],'depth':null}));if(_0x1bce4a[_0x17bc('0x97')]){_0x6b6dcd=_0x1bce4a[_0x17bc('0x97')]['substring'](0x0,_0x1bce4a['channel']['lastIndexOf']('-'));if(this[_0x17bc('0xd')][_0x6b6dcd]){logger['info'](_0x17bc('0x98'),_0x1bce4a[_0x17bc('0x24')],_0x6b6dcd);this[_0x17bc('0xd')][_0x6b6dcd][_0x17bc('0x99')]=!![];}}}}catch(_0x5ed3b5){logger[_0x17bc('0x56')](_0x17bc('0x9a'),_0x1bce4a[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x5ed3b5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x17bc('0x21')][_0x17bc('0x1c')]=function(_0x193c35){var _0x26d44c='';try{if(this[_0x17bc('0x22')](_0x193c35)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x193c35[_0x17bc('0x24')],util[_0x17bc('0x28')](_0x193c35,{'showHidden':![],'depth':null}));if(_0x193c35[_0x17bc('0x97')]){_0x26d44c=_0x193c35['channel'][_0x17bc('0x9b')](0x0,_0x193c35['channel'][_0x17bc('0x9c')]('-'));if(this[_0x17bc('0xd')][_0x26d44c]){logger[_0x17bc('0x3d')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x193c35[_0x17bc('0x24')],_0x26d44c);this[_0x17bc('0xd')][_0x26d44c][_0x17bc('0x99')]=![];}}}}catch(_0x347b10){logger[_0x17bc('0x56')](_0x17bc('0x9d'),_0x193c35['uniqueid'],util[_0x17bc('0x28')](_0x347b10,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x4f63=['redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','variables','merge','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../ami'];(function(_0x389358,_0x174698){var _0x47f379=function(_0x57a10e){while(--_0x57a10e){_0x389358['push'](_0x389358['shift']());}};_0x47f379(++_0x174698);}(_0x4f63,0x1cb));var _0x34f6=function(_0x3e2e82,_0x369bbe){_0x3e2e82=_0x3e2e82-0x0;var _0xba15aa=_0x4f63[_0x3e2e82];return _0xba15aa;};'use strict';var _=require(_0x34f6('0x0'));var moment=require(_0x34f6('0x1'));var util=require(_0x34f6('0x2'));var Redis=require(_0x34f6('0x3'));var config=require(_0x34f6('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x34f6('0x5'));config[_0x34f6('0x6')]=_[_0x34f6('0x7')](config[_0x34f6('0x6')],{'host':_0x34f6('0x8'),'port':0x18eb});var io=require(_0x34f6('0x9'))(new Redis(config[_0x34f6('0x6')]));function VoiceAgentReport(_0x4fd38f){this[_0x34f6('0xa')]={};this[_0x34f6('0xb')]=_0x4fd38f['channels'];this[_0x34f6('0xc')]=_0x4fd38f['voiceQueues'];this[_0x34f6('0xd')]=_0x4fd38f[_0x34f6('0xd')];this['variables']={};ami['on']('agentcalled',this[_0x34f6('0xe')][_0x34f6('0xf')](this));ami['on'](_0x34f6('0x10'),this[_0x34f6('0x11')]['bind'](this));ami['on'](_0x34f6('0x12'),this[_0x34f6('0x13')][_0x34f6('0xf')](this));ami['on'](_0x34f6('0x14'),this['syncQueueCallerAbandon'][_0x34f6('0xf')](this));ami['on'](_0x34f6('0x15'),this[_0x34f6('0x16')][_0x34f6('0xf')](this));ami['on'](_0x34f6('0x17'),this[_0x34f6('0x18')][_0x34f6('0xf')](this));ami['on'](_0x34f6('0x19'),this[_0x34f6('0x1a')]['bind'](this));ami['on'](_0x34f6('0x1b'),this[_0x34f6('0x1c')][_0x34f6('0xf')](this));ami['on']('musiconholdstop',this[_0x34f6('0x1d')][_0x34f6('0xf')](this));ami['on']('attendedtransfer',this[_0x34f6('0x1e')]['bind'](this));ami['on']('blindtransfer',this[_0x34f6('0x1f')][_0x34f6('0xf')](this));}VoiceAgentReport['prototype'][_0x34f6('0x20')]=function(_0x5d8489,_0x43fc4a,_0x43f149){io['to'](_0x5d8489)['emit'](_0x43fc4a,_0x43f149);};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x22')]=function(_0x5b2e83){return _0x5b2e83!==null&&!_[_0x34f6('0x23')](_0x5b2e83);};VoiceAgentReport['prototype'][_0x34f6('0xe')]=function(_0x3a95cc){try{if(this['isNotNull'](_0x3a95cc)){logger[_0x34f6('0x24')](_0x34f6('0x25'),_0x3a95cc[_0x34f6('0x26')],_0x3a95cc['membername'],_0x3a95cc[_0x34f6('0x27')]);logger['debug'](_0x34f6('0x28'),_0x3a95cc[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x3a95cc,{'showHidden':![],'depth':null}));if(_[_0x34f6('0x23')](this[_0x34f6('0xa')][_0x3a95cc[_0x34f6('0x26')]])){this['channels'][_0x3a95cc[_0x34f6('0x26')]]={};}if(_['isUndefined'](this[_0x34f6('0xa')][_0x3a95cc['uniqueid']][_0x3a95cc[_0x34f6('0x27')]])){this['channels'][_0x3a95cc['uniqueid']][_0x3a95cc[_0x34f6('0x27')]]={'agentcalledAt':moment()[_0x34f6('0x2a')](_0x34f6('0x2b')),'lastevent':_0x34f6('0x2c'),'mandatoryDisposition':this[_0x34f6('0xc')][_0x3a95cc['queue']]?this[_0x34f6('0xc')][_0x3a95cc[_0x34f6('0x2d')]][_0x34f6('0x2e')]||![]:![],'type':this['voiceQueues'][_0x3a95cc['queue']]?this[_0x34f6('0xc')][_0x3a95cc[_0x34f6('0x2d')]][_0x34f6('0x2f')]||'inbound':'inbound','variables':this[_0x34f6('0x30')][_0x3a95cc[_0x34f6('0x26')]],'motionChannel':'voice'};}_[_0x34f6('0x31')](this[_0x34f6('0xa')][_0x3a95cc[_0x34f6('0x26')]][_0x3a95cc[_0x34f6('0x27')]],_[_0x34f6('0x32')](_0x3a95cc,[_0x34f6('0x33'),_0x34f6('0x34')]));logger[_0x34f6('0x35')](_0x34f6('0x36'),_0x3a95cc[_0x34f6('0x26')],util['inspect'](this[_0x34f6('0xa')][_0x3a95cc[_0x34f6('0x26')]][_0x3a95cc['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x37'),this['channels'][_0x3a95cc[_0x34f6('0x26')]][_0x3a95cc[_0x34f6('0x27')]]);var _0x27e9eb={'id':this['agents'][_0x3a95cc[_0x34f6('0x38')]]['id'],'calleridnum':this[_0x34f6('0xa')][_0x3a95cc[_0x34f6('0x26')]][_0x3a95cc[_0x34f6('0x27')]][_0x34f6('0x39')],'queue':this[_0x34f6('0xa')][_0x3a95cc['uniqueid']][_0x3a95cc[_0x34f6('0x27')]][_0x34f6('0x2d')],'variables':this[_0x34f6('0xa')][_0x3a95cc[_0x34f6('0x26')]][_0x3a95cc[_0x34f6('0x27')]]['variables']};logger[_0x34f6('0x35')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x3a95cc[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x27e9eb,{'showHidden':![],'depth':null}));this[_0x34f6('0x20')](util[_0x34f6('0x2a')](_0x34f6('0x3a'),_0x3a95cc['membername']),_0x34f6('0x3b'),_0x27e9eb);}}catch(_0x5a8210){logger[_0x34f6('0x3c')]('[%s][voiceAgentReport][agentcalled]',_0x3a95cc[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x5a8210,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x11')]=function(_0x18844b){try{if(this[_0x34f6('0x22')](_0x18844b)){if(this['channels'][_0x18844b[_0x34f6('0x26')]]){logger['debug'](_0x34f6('0x3d'),_0x18844b[_0x34f6('0x26')],util['inspect'](_0x18844b,{'showHidden':![],'depth':null}));for(var _0x55ab22 in this[_0x34f6('0xa')][_0x18844b['uniqueid']]){if(this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x34f6('0x3e')](_0x55ab22)){if(_0x18844b['destuniqueid']===_0x55ab22){logger[_0x34f6('0x24')](_0x34f6('0x3f'),_0x18844b['uniqueid'],_0x18844b[_0x34f6('0x40')],_0x18844b[_0x34f6('0x27')]);this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x41')]=moment()[_0x34f6('0x2a')](_0x34f6('0x2b'));this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22]['connectedlinename']=_0x18844b[_0x34f6('0x42')];this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x43')]=_0x18844b[_0x34f6('0x43')];this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x44')]=_0x18844b[_0x34f6('0x44')];this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x45')]=_0x18844b[_0x34f6('0x45')];this['channels'][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x46')]=_0x18844b['holdtime'];this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x47')]=_0x34f6('0x48');if(this[_0x34f6('0xb')][this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22]['uniqueid']]){var _0x312d8c=this[_0x34f6('0xb')][this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x26')]][_0x34f6('0x49')];this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x49')]=_0x312d8c;_0x18844b[_0x34f6('0x49')]=_0x312d8c;}_[_0x34f6('0x31')](this[_0x34f6('0xd')][_0x18844b[_0x34f6('0x38')]],_['pick'](_0x18844b,[_0x34f6('0x2d'),_0x34f6('0x4a'),'routealias']));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x18844b[_0x34f6('0x26')],util[_0x34f6('0x29')](this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x18844b[_0x34f6('0x27')]],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x4b'),this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x18844b['destuniqueid']]);logger[_0x34f6('0x35')](_0x34f6('0x4c'),_0x18844b['uniqueid'],util[_0x34f6('0x29')](this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x18844b['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x34f6('0x2a')](_0x34f6('0x3a'),_0x18844b[_0x34f6('0x40')]),_0x34f6('0x4d'),this['channels'][_0x18844b['uniqueid']][_0x18844b[_0x34f6('0x27')]]);}else if(!this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x12')]&&!this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22]['agentcomplete']){logger[_0x34f6('0x24')](_0x34f6('0x4e'),_0x18844b[_0x34f6('0x26')],this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22]['membername'],_0x55ab22);this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x12')]=!![];this['channels'][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x4f')]=moment()[_0x34f6('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x50')]=_0x18844b['destuniqueid'];this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x51')]=_0x18844b[_0x34f6('0x40')];this['channels'][_0x18844b[_0x34f6('0x26')]][_0x55ab22][_0x34f6('0x47')]=_0x34f6('0x52');this[_0x34f6('0xa')][_0x18844b['uniqueid']][_0x55ab22][_0x34f6('0x53')]=_0x34f6('0x52');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x18844b['uniqueid'],util[_0x34f6('0x29')](this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x54'),this[_0x34f6('0xa')][_0x18844b[_0x34f6('0x26')]][_0x55ab22]);}}}}}}catch(_0x279734){logger[_0x34f6('0x3c')](_0x34f6('0x55'),_0x18844b['uniqueid'],util[_0x34f6('0x29')](_0x279734,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x13')]=function(_0x48729e){try{if(this[_0x34f6('0x22')](_0x48729e)){logger['debug'](_0x34f6('0x56'),_0x48729e[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x48729e,{'showHidden':![],'depth':null}));if(this['channels'][_0x48729e[_0x34f6('0x26')]]&&this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e['destuniqueid']]){logger['info'](_0x34f6('0x57'),_0x48729e['uniqueid'],_0x48729e[_0x34f6('0x40')],_0x48729e[_0x34f6('0x27')]);this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e['destuniqueid']][_0x34f6('0x12')]=!![];this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e['destuniqueid']][_0x34f6('0x4f')]=moment()['format'](_0x34f6('0x2b'));this['channels'][_0x48729e[_0x34f6('0x26')]][_0x48729e[_0x34f6('0x27')]][_0x34f6('0x47')]='rejected';this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e[_0x34f6('0x27')]][_0x34f6('0x53')]=_0x34f6('0x58');logger[_0x34f6('0x35')](_0x34f6('0x59'),_0x48729e[_0x34f6('0x26')],util['inspect'](this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')]('custom:agentringnoanswer',this[_0x34f6('0xa')][_0x48729e[_0x34f6('0x26')]][_0x48729e[_0x34f6('0x27')]]);}}}catch(_0x5a9796){logger[_0x34f6('0x3c')](_0x34f6('0x5a'),_0x48729e['uniqueid'],util[_0x34f6('0x29')](_0x5a9796,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x5b')]=function(_0x57af39){try{if(this[_0x34f6('0x22')](_0x57af39)){logger[_0x34f6('0x35')](_0x34f6('0x5c'),_0x57af39[_0x34f6('0x26')],util['inspect'](_0x57af39,{'showHidden':![],'depth':null}));if(this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]]){for(var _0x2ee530 in this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]]){if(this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]]['hasOwnProperty'](_0x2ee530)&&!this[_0x34f6('0xa')][_0x57af39['uniqueid']][_0x2ee530][_0x34f6('0x12')]&&!this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530][_0x34f6('0x15')]){logger['info'](_0x34f6('0x5d'),_0x57af39[_0x34f6('0x26')],this[_0x34f6('0xa')][_0x57af39['uniqueid']][_0x2ee530]['membername'],_0x2ee530);this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530]['agentringnoanswer']=!![];this[_0x34f6('0xa')][_0x57af39['uniqueid']][_0x2ee530][_0x34f6('0x4f')]=moment()['format'](_0x34f6('0x2b'));this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530][_0x34f6('0x47')]='abandoned';this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530][_0x34f6('0x53')]=_0x34f6('0x5e');logger[_0x34f6('0x35')](_0x34f6('0x5f'),_0x57af39[_0x34f6('0x26')],util[_0x34f6('0x29')](this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x60'),this[_0x34f6('0xa')][_0x57af39[_0x34f6('0x26')]][_0x2ee530]);}}}}}catch(_0x4f9e28){logger[_0x34f6('0x3c')](_0x34f6('0x61'),_0x57af39[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x4f9e28,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')]['syncAgentComplete']=function(_0x4bc63d){try{if(this[_0x34f6('0x22')](_0x4bc63d)){logger[_0x34f6('0x35')](_0x34f6('0x62'),_0x4bc63d[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x4bc63d,{'showHidden':![],'depth':null}));if(this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]]){for(var _0x33fad7 in this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]]){if(this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x34f6('0x3e')](_0x33fad7)){if(this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x41')]&&!this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x15')]){logger[_0x34f6('0x24')](_0x34f6('0x63'),_0x4bc63d['uniqueid'],this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x40')],_0x33fad7);this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x33fad7][_0x34f6('0x15')]=!![];this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x33fad7][_0x34f6('0x64')]=moment()[_0x34f6('0x2a')](_0x34f6('0x2b'));this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x33fad7]['lastevent']=_0x34f6('0x65');this['channels'][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x53')]=_0x4bc63d[_0x34f6('0x53')]==_0x34f6('0x66')?_0x34f6('0x67'):_0x4bc63d[_0x34f6('0x53')];this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x68')]=_0x4bc63d[_0x34f6('0x68')];if(this[_0x34f6('0xc')][_0x4bc63d[_0x34f6('0x2d')]]&&this[_0x34f6('0xc')][_0x4bc63d[_0x34f6('0x2d')]][_0x34f6('0x69')]){this['channels'][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7][_0x34f6('0x6a')]=this[_0x34f6('0xc')][_0x4bc63d[_0x34f6('0x2d')]][_0x34f6('0x6b')];this[_0x34f6('0xa')][_0x4bc63d[_0x34f6('0x26')]][_0x33fad7]['agentacw']=!![];}this[_0x34f6('0xd')][_0x4bc63d[_0x34f6('0x38')]]=_[_0x34f6('0x32')](this[_0x34f6('0xd')][_0x4bc63d[_0x34f6('0x38')]],[_0x34f6('0x2d'),'destconnectedlinenum']);logger[_0x34f6('0x35')](_0x34f6('0x6c'),_0x4bc63d[_0x34f6('0x26')],util[_0x34f6('0x29')](this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x33fad7],{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x6d'),this[_0x34f6('0xa')][_0x4bc63d['uniqueid']][_0x33fad7]);logger[_0x34f6('0x35')](_0x34f6('0x6e'),_0x4bc63d[_0x34f6('0x26')],util[_0x34f6('0x29')]({'id':this['agents'][_0x4bc63d[_0x34f6('0x38')]]['id'],'destaccountcode':_0x4bc63d[_0x34f6('0x6f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x34f6('0x2a')]('user:%s',_0x4bc63d[_0x34f6('0x40')]),_0x34f6('0x70'),{'id':this[_0x34f6('0xd')][_0x4bc63d[_0x34f6('0x38')]]['id'],'destaccountcode':_0x4bc63d[_0x34f6('0x6f')]});}}}}}}catch(_0x4d171a){logger[_0x34f6('0x3c')](_0x34f6('0x71'),_0x4bc63d['uniqueid'],util[_0x34f6('0x29')](_0x4d171a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x18')]=function(_0x555a10){try{if(this['isNotNull'](_0x555a10)){logger[_0x34f6('0x35')](_0x34f6('0x72'),_0x555a10['uniqueid'],util['inspect'](_0x555a10,{'showHidden':![],'depth':null}));this[_0x34f6('0x73')](_0x555a10[_0x34f6('0x26')],_['keys'](_0x555a10[_0x34f6('0x74')])[0x0],_0x555a10[_0x34f6('0x75')]);if(this[_0x34f6('0xa')][_0x555a10[_0x34f6('0x26')]]){for(var _0x328eb3 in this['channels'][_0x555a10['uniqueid']]){if(this[_0x34f6('0xa')][_0x555a10['uniqueid']]['hasOwnProperty'](_0x328eb3)){logger[_0x34f6('0x24')](_0x34f6('0x76'),_0x555a10['uniqueid'],_0x328eb3,_['keys'](_0x555a10['variable'])[0x0],_0x555a10['value']);if(_[_0x34f6('0x23')](this[_0x34f6('0xa')][_0x555a10[_0x34f6('0x26')]][_0x328eb3][_0x34f6('0x30')])){this[_0x34f6('0xa')][_0x555a10['uniqueid']][_0x328eb3][_0x34f6('0x30')]={};}this[_0x34f6('0xa')][_0x555a10[_0x34f6('0x26')]][_0x328eb3]['variables']=this[_0x34f6('0x30')][_0x555a10[_0x34f6('0x26')]];}}}}}catch(_0x56163b){logger[_0x34f6('0x3c')]('[%s][voiceAgentReport][varset]',_0x555a10[_0x34f6('0x26')],util['inspect'](_0x56163b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0xb01c99,_0x37b888,_0x1d0d61){var _0x535508=[_0x34f6('0x77'),_0x34f6('0x78'),_0x34f6('0x79'),'rtpaudioqosjitterbridged',_0x34f6('0x7a'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x34f6('0x7b'),'sipcallid',_0x34f6('0x7c'),_0x34f6('0x7d'),_0x34f6('0x7e'),'membercalls',_0x34f6('0x7f'),_0x34f6('0x80'),_0x34f6('0x81'),_0x34f6('0x40'),'memberpenalty',_0x34f6('0x82')];if(!_[_0x34f6('0x83')](_0x37b888)&&!_[_0x34f6('0x84')](_0x535508,_0x37b888)){if(_[_0x34f6('0x23')](this[_0x34f6('0x30')][_0xb01c99])){this['variables'][_0xb01c99]={};}this[_0x34f6('0x30')][_0xb01c99][_0x37b888]=_0x1d0d61;}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x1a')]=function(_0x488875){try{if(this['isNotNull'](_0x488875)){logger[_0x34f6('0x35')](_0x34f6('0x85'),_0x488875[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x488875,{'showHidden':![],'depth':null}));if(this[_0x34f6('0xa')][_0x488875[_0x34f6('0x26')]]){for(var _0x53afde in this[_0x34f6('0xa')][_0x488875[_0x34f6('0x26')]]){if(this['channels'][_0x488875[_0x34f6('0x26')]][_0x34f6('0x3e')](_0x53afde)){if(this[_0x34f6('0xa')][_0x488875[_0x34f6('0x26')]][_0x53afde]['reason']==_0x34f6('0x66')&&this['channels'][_0x488875[_0x34f6('0x26')]][_0x53afde][_0x34f6('0x15')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x488875['uniqueid'],_0x53afde);this['channels'][_0x488875[_0x34f6('0x26')]][_0x53afde][_0x34f6('0x64')]=moment()['format'](_0x34f6('0x2b'));}}}logger['debug'](_0x34f6('0x86'),_0x488875[_0x34f6('0x26')],util['inspect'](_['values'](this['channels'][_0x488875[_0x34f6('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x34f6('0x20')](_0x34f6('0x87'),_['values'](this[_0x34f6('0xa')][_0x488875[_0x34f6('0x26')]]));delete this['channels'][_0x488875[_0x34f6('0x26')]];}if(this[_0x34f6('0x30')][_0x488875[_0x34f6('0x26')]]){delete this[_0x34f6('0x30')][_0x488875[_0x34f6('0x26')]];}}}catch(_0x208aac){logger['error'](_0x34f6('0x88'),_0x488875['uniqueid'],util[_0x34f6('0x29')](_0x208aac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x1e')]=function(_0x48dea3){try{if(this[_0x34f6('0x22')](_0x48dea3)){logger[_0x34f6('0x35')](_0x34f6('0x89'),_0x48dea3[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x48dea3,{'showHidden':![],'depth':null}));if(this[_0x34f6('0xa')][_0x48dea3['transfereeuniqueid']]){for(var _0x29a061 in this['channels'][_0x48dea3['transfereeuniqueid']]){if(this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]][_0x34f6('0x3e')](_0x29a061)){if(_0x48dea3[_0x34f6('0x8b')]===_0x29a061){logger[_0x34f6('0x24')](_0x34f6('0x8c'),_0x48dea3['uniqueid'],this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]][_0x29a061]['membername'],_0x29a061);var _0x4daf10=moment();this['channels'][_0x48dea3['transfereeuniqueid']][_0x29a061][_0x34f6('0x15')]=!![];this['channels'][_0x48dea3['transfereeuniqueid']][_0x29a061][_0x34f6('0x64')]=moment()[_0x34f6('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x34f6('0xa')][_0x48dea3['transfereeuniqueid']][_0x29a061][_0x34f6('0x47')]='complete';this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]][_0x29a061][_0x34f6('0x53')]=_0x34f6('0x66');this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]][_0x29a061][_0x34f6('0x68')]=_0x4daf10['diff'](this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]][_0x29a061][_0x34f6('0x41')],_0x34f6('0x8d'));}}}}if(this[_0x34f6('0xa')][_0x48dea3['secondtransfereruniqueid']]){var _0x11e5dd=this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8e')]];this[_0x34f6('0xa')][_0x48dea3['secondtransfereruniqueid']]=this['channels'][_0x48dea3[_0x34f6('0x8a')]];this[_0x34f6('0xa')][_0x48dea3[_0x34f6('0x8a')]]=_0x11e5dd;}}}catch(_0x47e68e){logger[_0x34f6('0x3c')]('[%s][voiceAgentReport][attendedtransfer]',_0x48dea3['uniqueid'],util[_0x34f6('0x29')](_0x47e68e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x1f')]=function(_0x3a9b92){try{if(this[_0x34f6('0x22')](_0x3a9b92)){logger['debug'](_0x34f6('0x8f'),_0x3a9b92['uniqueid'],util['inspect'](_0x3a9b92,{'showHidden':![],'depth':null}));if(this['channels'][_0x3a9b92[_0x34f6('0x8a')]]){for(var _0x38266a in this['channels'][_0x3a9b92['transfereeuniqueid']]){if(this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x34f6('0x3e')](_0x38266a)){if(_0x3a9b92[_0x34f6('0x90')]===_0x38266a){logger[_0x34f6('0x24')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3a9b92[_0x34f6('0x26')],this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x38266a]['membername'],_0x38266a);var _0x2acdfc=moment();this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x38266a]['agentcomplete']=!![];this[_0x34f6('0xa')][_0x3a9b92['transfereeuniqueid']][_0x38266a]['agentcompleteAt']=_0x2acdfc;this['channels'][_0x3a9b92['transfereeuniqueid']][_0x38266a][_0x34f6('0x47')]='complete';this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x38266a][_0x34f6('0x53')]=_0x34f6('0x66');this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x38266a][_0x34f6('0x68')]=_0x2acdfc['diff'](this[_0x34f6('0xa')][_0x3a9b92[_0x34f6('0x8a')]][_0x38266a][_0x34f6('0x41')],'seconds');}}}}}}catch(_0x3c0787){logger[_0x34f6('0x3c')](_0x34f6('0x91'),_0x3a9b92['uniqueid'],util['inspect'](_0x3c0787,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')]['syncMusicOnHoldStart']=function(_0x3cdad7){var _0x2b8fa8='';try{if(this[_0x34f6('0x22')](_0x3cdad7)){logger['debug'](_0x34f6('0x92'),_0x3cdad7[_0x34f6('0x26')],util['inspect'](_0x3cdad7,{'showHidden':![],'depth':null}));if(_0x3cdad7['channel']){_0x2b8fa8=_0x3cdad7['channel'][_0x34f6('0x93')](0x0,_0x3cdad7[_0x34f6('0x94')]['lastIndexOf']('-'));if(this[_0x34f6('0xd')][_0x2b8fa8]){logger[_0x34f6('0x24')](_0x34f6('0x95'),_0x3cdad7['uniqueid'],_0x2b8fa8);this['agents'][_0x2b8fa8][_0x34f6('0x96')]=!![];}}}}catch(_0x85aeab){logger[_0x34f6('0x3c')]('[%s][voiceAgentReport][musiconholdstart]',_0x3cdad7[_0x34f6('0x26')],util['inspect'](_0x85aeab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x34f6('0x21')][_0x34f6('0x1d')]=function(_0x2a8d56){var _0xfa4d1b='';try{if(this[_0x34f6('0x22')](_0x2a8d56)){logger['debug'](_0x34f6('0x97'),_0x2a8d56[_0x34f6('0x26')],util[_0x34f6('0x29')](_0x2a8d56,{'showHidden':![],'depth':null}));if(_0x2a8d56['channel']){_0xfa4d1b=_0x2a8d56[_0x34f6('0x94')]['substring'](0x0,_0x2a8d56['channel']['lastIndexOf']('-'));if(this[_0x34f6('0xd')][_0xfa4d1b]){logger['info'](_0x34f6('0x98'),_0x2a8d56[_0x34f6('0x26')],_0xfa4d1b);this[_0x34f6('0xd')][_0xfa4d1b][_0x34f6('0x96')]=![];}}}}catch(_0x264851){logger['error'](_0x34f6('0x99'),_0x2a8d56['uniqueid'],util[_0x34f6('0x29')](_0x264851,{'showHidden':![],'depth':null}));}};module[_0x34f6('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 817f9a9..eef607b 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 _0x249d=['xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transferType','ATTENDED','origtransfererlinkedid','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','syncHangup','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','util','ioredis','../../../config/environment','../../../config/logger','../ami','set','queue','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','newexten','syncNewExten','newchannel','bind','newstate','varset','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','name','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','subtract','duration','seconds','includes','lastapplication','lastdata','match','type','isNil','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','format','holdtime','diff','destinationchannel','UserId','membername','connectedlinename','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x249d,0x10f));var _0xd249=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x249d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xd249('0x0'));var path=require('path');var Redis=require(_0xd249('0x1'));var config=require(_0xd249('0x2'));var logger=require(_0xd249('0x3'))('ami');var ami=require(_0xd249('0x4'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var applications=[_0xd249('0x5'),_0xd249('0x6'),'agi','dial','playback',_0xd249('0x7')];var dispositions=[_0xd249('0x8'),_0xd249('0x9'),'FAILED',_0xd249('0x8'),_0xd249('0x8'),_0xd249('0x8'),_0xd249('0xa'),_0xd249('0xb'),_0xd249('0x9'),_0xd249('0x9'),_0xd249('0x9')];config[_0xd249('0xc')]=_[_0xd249('0xd')](config[_0xd249('0xc')],{'host':_0xd249('0xe'),'port':0x18eb});var io=require(_0xd249('0xf'))(new Redis(config[_0xd249('0xc')]));function VoiceCallReport(_0x1726a4){this[_0xd249('0x10')]=_0x1726a4['channels'];this[_0xd249('0x11')]=_0x1726a4[_0xd249('0x11')];this[_0xd249('0x12')]={};ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on'](_0xd249('0x13'),this[_0xd249('0x14')]['bind'](this));ami['on'](_0xd249('0x15'),this['syncNewChannel'][_0xd249('0x16')](this));ami['on'](_0xd249('0x17'),this['syncNewState']['bind'](this));ami['on'](_0xd249('0x18'),this['syncVarSet'][_0xd249('0x16')](this));ami['on'](_0xd249('0x19'),this['syncHangup']['bind'](this));ami['on'](_0xd249('0x1a'),this[_0xd249('0x1b')][_0xd249('0x16')](this));ami['on']('attendedtransfer',this[_0xd249('0x1c')][_0xd249('0x16')](this));ami['on']('blindtransfer',this[_0xd249('0x1d')][_0xd249('0x16')](this));ami['on'](_0xd249('0x1e'),this[_0xd249('0x1f')][_0xd249('0x16')](this));ami['on'](_0xd249('0x20'),this[_0xd249('0x21')][_0xd249('0x16')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0xd249('0x22')]();}catch(_0x2242a7){logger[_0xd249('0x23')]('[voiceCallReport][coreshowchannels]',util[_0xd249('0x24')](_0x2242a7,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xd249('0x25')][_0xd249('0x26')]=function(_0x15e9d4){return _0x15e9d4!==null&&!_[_0xd249('0x27')](_0x15e9d4);};VoiceCallReport[_0xd249('0x25')][_0xd249('0x28')]=function(_0x3b3cbe,_0x577762,_0x447748){io['to'](_0x3b3cbe)[_0xd249('0x28')](_0x577762,_0x447748);};VoiceCallReport[_0xd249('0x25')]['syncNewCallerId']=function(_0x7f511b){try{if(this[_0xd249('0x26')](_0x7f511b)){logger[_0xd249('0x29')](_0xd249('0x2a'),_0x7f511b[_0xd249('0x2b')],_0x7f511b[_0xd249('0x2c')],_0x7f511b[_0xd249('0x2d')]);logger['debug'](_0xd249('0x2e'),_0x7f511b[_0xd249('0x2b')],util[_0xd249('0x24')](_0x7f511b,{'showHidden':![],'depth':null}));if(_0x7f511b[_0xd249('0x2b')]===_0x7f511b[_0xd249('0x2f')]){if(!_[_0xd249('0x27')](this[_0xd249('0x10')][_0x7f511b[_0xd249('0x2b')]])){_[_0xd249('0x30')](this[_0xd249('0x10')][_0x7f511b['uniqueid']],_[_0xd249('0x31')](_0x7f511b,_[_0xd249('0x32')](this[_0xd249('0x10')][_0x7f511b[_0xd249('0x2b')]])));}}if(_0x7f511b[_0xd249('0x33')]===_0xd249('0x34')){if(this[_0xd249('0x11')][_0x7f511b[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]){if(_0x7f511b[_0xd249('0x37')]==_0xd249('0x38')){this[_0xd249('0x11')][_0x7f511b[_0xd249('0x35')]['split']('-')[0x0]][_0xd249('0x39')]=_0x7f511b[_0xd249('0x3a')];this[_0xd249('0x28')](util['format']('user:%s',this[_0xd249('0x11')][_0x7f511b[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3b')]),'user:agentconnect',{'destaccountcode':this[_0xd249('0x11')][_0x7f511b[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3c')],'destconnectedlinenum':_0x7f511b[_0xd249('0x3a')]});}}}}}catch(_0xefa401){logger[_0xd249('0x23')](_0xd249('0x3d'),_0x7f511b[_0xd249('0x2b')],util[_0xd249('0x24')](_0xefa401,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd249('0x3e')]=function(_0x336b50){try{if(this[_0xd249('0x26')](_0x336b50)){logger[_0xd249('0x3f')](_0xd249('0x40'),_0x336b50['uniqueid'],util[_0xd249('0x24')](_0x336b50,{'showHidden':![],'depth':null}));if(this['channels'][_0x336b50[_0xd249('0x2b')]])return;if(_0x336b50['channel']===_0xd249('0x41'))return;if(_0x336b50[_0xd249('0x2b')]!==_0x336b50['linkedid']&&!this[_0xd249('0x12')][_0x336b50[_0xd249('0x2f')]])return;logger[_0xd249('0x29')](_0xd249('0x42'),_0x336b50[_0xd249('0x2b')],_0x336b50[_0xd249('0x33')],_0x336b50[_0xd249('0x37')]);this[_0xd249('0x10')][_0x336b50['uniqueid']]=new Channel();this['channels'][_0x336b50[_0xd249('0x2b')]]['starttime']=moment()['format'](_0xd249('0x43'));this['channels'][_0x336b50[_0xd249('0x2b')]][_0xd249('0x44')]=dispositions[_[_0xd249('0x45')](_0x336b50[_0xd249('0x46')])];_[_0xd249('0x30')](this[_0xd249('0x10')][_0x336b50['uniqueid']],_[_0xd249('0x31')](_0x336b50,_['keys'](this[_0xd249('0x10')][_0x336b50[_0xd249('0x2b')]])));if(_0x336b50['context']===_0xd249('0x34')){if(this['agents'][_0x336b50['channel'][_0xd249('0x36')]('-')[0x0]]){if(_[_0xd249('0x27')](this[_0xd249('0x11')][_0x336b50['channel'][_0xd249('0x36')]('-')[0x0]][_0xd249('0x39')])){this[_0xd249('0x11')][_0x336b50['channel']['split']('-')[0x0]][_0xd249('0x39')]=_0x336b50[_0xd249('0x37')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x336b50[_0xd249('0x2b')],util[_0xd249('0x24')]({'id':this[_0xd249('0x11')][_0x336b50[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0xd249('0x11')][_0x336b50[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x336b50['exten']},{'showHidden':![],'depth':null}));this[_0xd249('0x28')](util['format'](_0xd249('0x47'),this[_0xd249('0x11')][_0x336b50[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['name']),_0xd249('0x48'),{'id':this['agents'][_0x336b50[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0xd249('0x11')][_0x336b50[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3c')],'destconnectedlinenum':_0x336b50[_0xd249('0x37')]});}}}}}catch(_0x5f5bea){logger[_0xd249('0x23')](_0xd249('0x49'),_0x336b50[_0xd249('0x2b')],util['inspect'](_0x5f5bea,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd249('0x25')][_0xd249('0x14')]=function(_0x4f20f4){try{if(this['isNotNull'](_0x4f20f4)){logger[_0xd249('0x3f')](_0xd249('0x4a'),_0x4f20f4[_0xd249('0x2b')],util[_0xd249('0x24')](_0x4f20f4,{'showHidden':![],'depth':null}));if(_0x4f20f4['channel']==='OutgoingSpoolFailed'||_0x4f20f4[_0xd249('0x37')]==='h')return;if(_0x4f20f4[_0xd249('0x2b')]===_0x4f20f4[_0xd249('0x2f')]||this[_0xd249('0x12')][_0x4f20f4[_0xd249('0x2f')]]){_0x4f20f4['application']=_0x4f20f4[_0xd249('0x4b')][_0xd249('0x4c')]();_0x4f20f4[_0xd249('0x4d')]=_0x4f20f4[_0xd249('0x4e')]||_0x4f20f4[_0xd249('0x4d')];if(_0x4f20f4[_0xd249('0x4e')]&&!_0x4f20f4[_0xd249('0x4e')][_0xd249('0x4f')](_0xd249('0x50'))&&_0x4f20f4[_0xd249('0x4b')]!==_0xd249('0x6')){_0x4f20f4[_0xd249('0x4d')]=_0x4f20f4['applicationdata'][_0xd249('0x4c')]();}logger[_0xd249('0x29')](_0xd249('0x51'),_0x4f20f4[_0xd249('0x2b')],_0x4f20f4[_0xd249('0x4b')],_0x4f20f4[_0xd249('0x4d')]);if(_[_0xd249('0x27')](this[_0xd249('0x10')][_0x4f20f4[_0xd249('0x2b')]])){this[_0xd249('0x10')][_0x4f20f4[_0xd249('0x2b')]]=new Channel();this['channels'][_0x4f20f4[_0xd249('0x2b')]][_0xd249('0x52')]=_0x4f20f4['duration']?moment()[_0xd249('0x53')](moment[_0xd249('0x54')](_0x4f20f4[_0xd249('0x54')])[_0xd249('0x55')](),_0xd249('0x55'))['format'](_0xd249('0x43')):moment()['format'](_0xd249('0x43'));this['channels'][_0x4f20f4[_0xd249('0x2b')]][_0xd249('0x44')]=_0xd249('0x8');}_[_0xd249('0x30')](this[_0xd249('0x10')][_0x4f20f4[_0xd249('0x2b')]],_[_0xd249('0x31')](_0x4f20f4,_[_0xd249('0x32')](this['channels'][_0x4f20f4[_0xd249('0x2b')]])));if(_[_0xd249('0x56')](applications,_0x4f20f4[_0xd249('0x4b')])){this[_0xd249('0x10')][_0x4f20f4[_0xd249('0x2b')]][_0xd249('0x57')]=_0x4f20f4[_0xd249('0x4b')];this['channels'][_0x4f20f4['uniqueid']][_0xd249('0x58')]=_0x4f20f4[_0xd249('0x4d')];if(_0x4f20f4[_0xd249('0x4b')]==='set'&&_[_0xd249('0x4f')](_0x4f20f4[_0xd249('0x4d')][_0xd249('0x4c')](),'cdr(')){var _0x59f4ce=_0x4f20f4['applicationdata'][_0xd249('0x36')]('=');var _0x52170f=_0x59f4ce[0x0]['toLowerCase']()[_0xd249('0x59')](/cdr\((.*)\)/);if(_0x52170f){if(_0x52170f[0x1]===_0xd249('0x5a')&&!_[_0xd249('0x5b')](this['channels'][_0x4f20f4[_0xd249('0x2b')]][_0x52170f[0x1]]))return;this[_0xd249('0x10')][_0x4f20f4[_0xd249('0x2b')]][_0x52170f[0x1]]=_0x59f4ce[0x1];}}else if(_0x4f20f4[_0xd249('0x4b')]===_0xd249('0x6')){this[_0xd249('0x10')][_0x4f20f4['uniqueid']][_0xd249('0x6')]=_0x4f20f4[_0xd249('0x4d')][_0xd249('0x36')](',')[0x0];}}}}}catch(_0x43074c){logger[_0xd249('0x23')](_0xd249('0x5c'),_0x4f20f4[_0xd249('0x2b')],util[_0xd249('0x24')](_0x43074c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd249('0x25')][_0xd249('0x5d')]=function(_0x45e01e){try{if(this[_0xd249('0x26')](_0x45e01e)){logger[_0xd249('0x29')](_0xd249('0x5e'),_0x45e01e[_0xd249('0x2b')],_0x45e01e[_0xd249('0x2f')],_0x45e01e['calleridname'],_0x45e01e['calleridnum']);logger[_0xd249('0x3f')]('[%s][voiceCallReport][newstate]\x20event:',_0x45e01e['uniqueid'],util[_0xd249('0x24')](_0x45e01e,{'showHidden':![],'depth':null}));if(_0x45e01e[_0xd249('0x46')]!=='6')return;if(_0x45e01e[_0xd249('0x2b')]!==_0x45e01e['linkedid']){var _0x40787e=moment();if(this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]]){if(!this[_0xd249('0x10')][_0x45e01e['linkedid']][_0xd249('0x5f')]){this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x5f')]=!![];this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x60')]=_0x40787e[_0xd249('0x61')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x52')]){this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x62')]=_0x40787e[_0xd249('0x63')](this['channels'][_0x45e01e[_0xd249('0x2f')]]['starttime'],_0xd249('0x55'));}}this[_0xd249('0x10')][_0x45e01e['linkedid']][_0xd249('0x2f')]=_0x45e01e[_0xd249('0x2b')];if(_0x45e01e[_0xd249('0x2d')]!==_0xd249('0x38')){this['channels'][_0x45e01e['linkedid']]['connectedlinenum']=_0x45e01e['calleridnum'];}this[_0xd249('0x10')][_0x45e01e['linkedid']]['connectedlinename']=_0x45e01e[_0xd249('0x2c')];this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x64')]=_0x45e01e[_0xd249('0x35')];this[_0xd249('0x10')][_0x45e01e['linkedid']][_0xd249('0x44')]=dispositions[_[_0xd249('0x45')](_0x45e01e['channelstate'])];if(this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]){this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x65')]=this[_0xd249('0x11')][_0x45e01e['channel']['split']('-')[0x0]]['id'];this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x66')]=this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')]['split']('-')[0x0]][_0xd249('0x3b')];}}if(this[_0xd249('0x10')][_0x45e01e['uniqueid']]){if(!this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]]['answered']){this['channels'][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x5f')]=!![];this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x60')]=_0x40787e[_0xd249('0x61')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x45e01e[_0xd249('0x2b')]]['starttime']){this['channels'][_0x45e01e[_0xd249('0x2b')]]['holdtime']=_0x40787e[_0xd249('0x63')](this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]]['starttime'],_0xd249('0x55'));}}if(_0x45e01e['calleridnum']!==_0xd249('0x38')){this['channels'][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x3a')]=_0x45e01e['calleridnum'];}this[_0xd249('0x10')][_0x45e01e['uniqueid']][_0xd249('0x67')]=_0x45e01e[_0xd249('0x2c')];this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x64')]=_0x45e01e['channel'];this[_0xd249('0x10')][_0x45e01e['uniqueid']][_0xd249('0x44')]=dispositions[_[_0xd249('0x45')](_0x45e01e[_0xd249('0x46')])];}}else{if(this['channels'][_0x45e01e[_0xd249('0x2b')]]){if(this[_0xd249('0x11')][_0x45e01e['channel'][_0xd249('0x36')]('-')[0x0]]){this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x65')]=this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')]['split']('-')[0x0]]['id'];this[_0xd249('0x10')][_0x45e01e['uniqueid']][_0xd249('0x66')]=this['agents'][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3b')];}}}if(_0x45e01e[_0xd249('0x33')]==='from-sip'){if(this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]){this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x39')]=_0x45e01e[_0xd249('0x37')];var _0x4ea910,_0x36fd18;if(this[_0xd249('0x10')][_0x45e01e[_0xd249('0x2b')]]){_0x4ea910=this['channels'][_0x45e01e[_0xd249('0x2b')]][_0xd249('0x68')];_0x36fd18=this['channels'][_0x45e01e['uniqueid']][_0xd249('0x6')];}else if(this[_0xd249('0x10')][_0x45e01e['linkedid']]){_0x4ea910=this['channels'][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x68')];_0x36fd18=this['channels'][_0x45e01e[_0xd249('0x2f')]][_0xd249('0x6')];}this[_0xd249('0x11')][_0x45e01e['channel'][_0xd249('0x36')]('-')[0x0]][_0xd249('0x6')]=_0x36fd18;this[_0xd249('0x11')][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x68')]=_0x4ea910;logger[_0xd249('0x3f')](_0xd249('0x69'),_0x45e01e['uniqueid'],util[_0xd249('0x24')]({'id':this['agents'][_0x45e01e[_0xd249('0x35')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x45e01e['exten'],'routealias':_0x4ea910,'queue':_0x36fd18||undefined},{'showHidden':![],'depth':null}));this[_0xd249('0x28')](util['format']('user:%s',this['agents'][_0x45e01e[_0xd249('0x35')]['split']('-')[0x0]][_0xd249('0x3b')]),_0xd249('0x48'),{'id':this[_0xd249('0x11')][_0x45e01e['channel']['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x45e01e[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x45e01e[_0xd249('0x37')],'routealias':_0x4ea910,'queue':_0x36fd18||undefined});}}}}catch(_0x29cf1a){logger[_0xd249('0x23')]('[%s][voiceCallReport][newstate]',_0x45e01e['uniqueid'],util[_0xd249('0x24')](_0x29cf1a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd249('0x25')][_0xd249('0x6a')]=function(_0x484a3a,_0x5a9011){try{if(this[_0xd249('0x10')][_0x484a3a]){logger[_0xd249('0x29')](_0xd249('0x6b'),_0x484a3a,_0x5a9011);this[_0xd249('0x10')][_0x484a3a][_0xd249('0x6c')]=!![];if(_[_0xd249('0x6d')](_0x5a9011,_0xd249('0x6e'))){_0x5a9011=_0x5a9011['replace']('.wav49',_0xd249('0x6f'));}this[_0xd249('0x10')][_0x484a3a]['monitorFilename']=_0x5a9011;var _0x243719=_['find'](this[_0xd249('0x10')][_0x484a3a][_0xd249('0x70')],{'filename':_0x5a9011});if(_['isNil'](_0x243719)){this[_0xd249('0x10')][_0x484a3a]['monitors'][_0xd249('0x71')]({'filename':_0x5a9011,'createdAt':moment()[_0xd249('0x61')](_0xd249('0x43')),'mixmonitorid':'','status':'rec'});}}}catch(_0x5b589f){logger[_0xd249('0x23')](_0xd249('0x72'),_0x484a3a,util[_0xd249('0x24')](_0x5b589f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd249('0x25')][_0xd249('0x73')]=function(_0x1651a8){try{if(this[_0xd249('0x26')](_0x1651a8)){logger[_0xd249('0x3f')](_0xd249('0x74'),_0x1651a8[_0xd249('0x2b')],util['inspect'](_0x1651a8,{'showHidden':![],'depth':null}));if(this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2b')]]&&_0x1651a8[_0xd249('0x35')]!=_0xd249('0x41')){if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')])){if(this[_0xd249('0x26')](_0x1651a8['variable']['mixmonitor_filename'])){logger[_0xd249('0x29')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this[_0xd249('0x6a')](_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);}else if(this['isNotNull'](_0x1651a8[_0xd249('0x75')][_0xd249('0x77')])){logger[_0xd249('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2b')]][_0xd249('0x2d')]=_0x1651a8['value'];}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')][_0xd249('0x78')])){logger['info'](_0xd249('0x79'),_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this['channels'][_0x1651a8['uniqueid']][_0xd249('0x7a')]=_0x1651a8[_0xd249('0x76')];}else if(this['isNotNull'](_0x1651a8[_0xd249('0x75')][_0xd249('0x7b')])){logger[_0xd249('0x29')](_0xd249('0x7c'),_0x1651a8[_0xd249('0x2b')],_0x1651a8['value']);this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2b')]][_0xd249('0x5a')]=_0x1651a8[_0xd249('0x76')];}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')]['xmd-queue'])){logger[_0xd249('0x29')](_0xd249('0x7d'),_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]['split'](',')[0x0]);this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2b')]]['queue']=_0x1651a8[_0xd249('0x76')][_0xd249('0x36')](',')[0x0];}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')][_0xd249('0x7e')])){logger[_0xd249('0x29')](_0xd249('0x7f'),_0x1651a8[_0xd249('0x2b')],_0x1651a8['value']);this['channels'][_0x1651a8['uniqueid']]['originatecalleridnum']=_0x1651a8[_0xd249('0x76')];}else if(this['isNotNull'](_0x1651a8[_0xd249('0x75')][_0xd249('0x80')])){logger[_0xd249('0x29')](_0xd249('0x81'),_0x1651a8[_0xd249('0x2b')],_0x1651a8['value']);this['channels'][_0x1651a8[_0xd249('0x2b')]][_0xd249('0x82')]=_0x1651a8[_0xd249('0x76')];}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')]['xmd-callerid-preview'])){logger[_0xd249('0x29')](_0xd249('0x83'),_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this[_0xd249('0x10')][_0x1651a8['uniqueid']][_0xd249('0x84')]=_0x1651a8['value'];}else if(this['isNotNull'](_0x1651a8[_0xd249('0x75')][_0xd249('0x85')])){logger['info'](_0xd249('0x86'),_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this['channels'][_0x1651a8[_0xd249('0x2b')]][_0xd249('0x6')]=_0x1651a8[_0xd249('0x76')];}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')][_0xd249('0x87')])){logger[_0xd249('0x29')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1651a8[_0xd249('0x2b')],_0x1651a8[_0xd249('0x76')]);this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2b')]]['sipcalluniqueid']=_0x1651a8['value'];}}}else if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')][_0xd249('0x88')])){if(_0x1651a8[_0xd249('0x76')]){var _0x436dea=path[_0xd249('0x89')](_0x1651a8['value'])[_0xd249('0x3b')];logger['info'](_0xd249('0x8a'),_0x436dea,_0x1651a8[_0xd249('0x76')]);this['syncMixMonitorFilename'](_0x436dea,_0x1651a8[_0xd249('0x76')]);}}else if(this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2f')]]){if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')])){if(this[_0xd249('0x26')](_0x1651a8[_0xd249('0x75')][_0xd249('0x87')])){logger[_0xd249('0x29')](_0xd249('0x8b'),_0x1651a8[_0xd249('0x2f')],_0x1651a8[_0xd249('0x76')]);this[_0xd249('0x10')][_0x1651a8[_0xd249('0x2f')]][_0xd249('0x8c')]=_0x1651a8[_0xd249('0x76')];}}}}}catch(_0x2174ce){logger[_0xd249('0x23')](_0xd249('0x8d'),_0x1651a8[_0xd249('0x2b')],util[_0xd249('0x24')](_0x2174ce,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x297048){try{if(this[_0xd249('0x26')](_0x297048)){logger[_0xd249('0x3f')](_0xd249('0x8e'),_0x297048[_0xd249('0x2b')],util[_0xd249('0x24')](_0x297048,{'showHidden':![],'depth':null}));if(this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]]){if(this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2f')]]){this['channels'][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]][_0xd249('0x2f')]][_0xd249('0x2b')]=_0x297048[_0xd249('0x2b')];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2f')]][_0xd249('0x5f')]=this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x5f')];this['channels'][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]][_0xd249('0x2f')]][_0xd249('0x60')]=this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]]['answertime'];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]]['linkedid']][_0xd249('0x64')]=this[_0xd249('0x10')][this['blindTransfers'][_0x297048[_0xd249('0x2f')]][_0xd249('0x2f')]][_0xd249('0x35')];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]][_0xd249('0x2f')]][_0xd249('0x44')]=this['channels'][_0x297048[_0xd249('0x2b')]][_0xd249('0x44')];this['channels'][_0x297048[_0xd249('0x2b')]]=this[_0xd249('0x10')][this['blindTransfers'][_0x297048[_0xd249('0x2f')]]['linkedid']];delete this['channels'][this['blindTransfers'][_0x297048[_0xd249('0x2f')]][_0xd249('0x2f')]];}else if(this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2b')]]){this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']]['uniqueid']][_0xd249('0x2b')]=[this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]][_0xd249('0x2b')]]['linkedid'],this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']]['uniqueid']]['linkedid']=this[_0xd249('0x10')][this['blindTransfers'][_0x297048['linkedid']][_0xd249('0x2b')]]['uniqueid']][0x0];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2b')]][_0xd249('0x5f')]=this[_0xd249('0x10')][_0x297048['uniqueid']]['answered'];this['channels'][this[_0xd249('0x12')][_0x297048['linkedid']]['uniqueid']][_0xd249('0x60')]=this['channels'][_0x297048[_0xd249('0x2b')]][_0xd249('0x60')];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2b')]][_0xd249('0x64')]=this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2b')]][_0xd249('0x35')];this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048['linkedid']][_0xd249('0x2b')]]['disposition']=this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x44')];this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]]=this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]][_0xd249('0x2b')]];delete this[_0xd249('0x10')][this[_0xd249('0x12')][_0x297048[_0xd249('0x2f')]]['uniqueid']];}}if(this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]]){logger[_0xd249('0x29')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x297048[_0xd249('0x2b')],_0x297048[_0xd249('0x8f')]);var _0x5925ea=moment();this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x90')]=_0x5925ea[_0xd249('0x61')](_0xd249('0x43'));this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x54')]=_0x5925ea[_0xd249('0x63')](this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]]['starttime'],'seconds');if(this[_0xd249('0x10')][_0x297048['uniqueid']][_0xd249('0x5f')]){this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x91')]=_0x5925ea[_0xd249('0x63')](this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x60')],_0xd249('0x55'));this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x62')]=this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x54')]-this[_0xd249('0x10')][_0x297048[_0xd249('0x2b')]][_0xd249('0x91')];}if(_0x297048[_0xd249('0x33')]===_0xd249('0x34')){if(this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]){this['agents'][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]=_[_0xd249('0x92')](this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]],[_0xd249('0x39')]);logger[_0xd249('0x3f')](_0xd249('0x93'),_0x297048[_0xd249('0x2b')],util[_0xd249('0x24')]({'id':this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xd249('0x28')](util[_0xd249('0x61')](_0xd249('0x47'),this[_0xd249('0x11')][_0x297048['channel'][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3b')]),'user:agentcomplete',{'id':this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]]['id'],'destaccountcode':this[_0xd249('0x11')][_0x297048[_0xd249('0x35')][_0xd249('0x36')]('-')[0x0]][_0xd249('0x3c')]});for(var _0xa4d6c9=0x0;_0xa4d6c90x0?_0x236496:0x0;this[_0xe96a('0x42')][_0x65fd78[_0xe96a('0x6a')]]['talking']=this[_0xe96a('0x42')][_0x65fd78[_0xe96a('0x6a')]][_0xe96a('0x34')]>_[_0xe96a('0x6f')](_0x65fd78['loggedin'])?_[_0xe96a('0x6f')](_0x65fd78['loggedin']):this['voiceQueues'][_0x65fd78[_0xe96a('0x6a')]]['talking'];this['emitVoiceQueueSummary'](this[_0xe96a('0x42')][_0x65fd78[_0xe96a('0x6a')]],'queuesummary');}logger[_0xe96a('0x4c')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xe96a('0x42')][_0x65fd78['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xe96a('0x71'),this[_0xe96a('0x42')][_0x65fd78['queue']]);}}}catch(_0x4ea08d){logger[_0xe96a('0x3d')]('[voiceQueueReport][queuesummary]',util[_0xe96a('0x3f')](_0x4ea08d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0x19')]=function(_0x23f5b1){logger['debug'](_0xe96a('0x72'),util[_0xe96a('0x3f')](_0x23f5b1,{'showHidden':![],'depth':null}));ami[_0xe96a('0x45')](_0xe96a('0x73'),{});this[_0xe96a('0x13')]=!![];};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0x1a')]=function(_0x549fc2){try{if(this[_0xe96a('0x63')](_0x549fc2)){logger[_0xe96a('0x4c')](_0xe96a('0x74'),_0x549fc2[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x549fc2,{'showHidden':![],'depth':null}));if(_[_0xe96a('0x64')](this['queueReports'][_0x549fc2[_0xe96a('0x47')]]))this['queueReports'][_0x549fc2[_0xe96a('0x47')]]=[];if(_[_0xe96a('0x64')](this['channels'][_0x549fc2[_0xe96a('0x47')]]))this[_0xe96a('0x11')][_0x549fc2['uniqueid']]={};var _0x4870fe=new QueueReport();_0x4870fe['name']=_0x549fc2[_0xe96a('0x6a')];_0x4870fe['type']=this[_0xe96a('0x42')][_0x4870fe[_0xe96a('0x49')]]&&this['voiceQueues'][_0x4870fe['name']][_0xe96a('0x53')]?this[_0xe96a('0x42')][_0x4870fe[_0xe96a('0x49')]][_0xe96a('0x53')]||_0xe96a('0x75'):'inbound';_0x4870fe[_0xe96a('0x6a')]=_0x549fc2[_0xe96a('0x6a')];_0x4870fe[_0xe96a('0x76')]=moment()['format'](_0xe96a('0x77'));_0x4870fe[_0xe96a('0x78')]=_0x549fc2['position'];_0x4870fe['count']=_0x549fc2['count'];_0x4870fe['uniqueid']=_0x549fc2[_0xe96a('0x47')];_0x4870fe[_0xe96a('0x79')]=this[_0xe96a('0x11')][_0x549fc2['uniqueid']][_0xe96a('0x79')];logger['info'](_0xe96a('0x7a'),_0x4870fe[_0xe96a('0x49')],_0x4870fe[_0xe96a('0x53')]);_[_0xe96a('0x7b')](_0x4870fe,_['pick'](_0x549fc2,_[_0xe96a('0x7c')](_0x4870fe)));this['queueReports'][_0x549fc2[_0xe96a('0x47')]][_0xe96a('0x7d')](_0x4870fe);this[_0xe96a('0x11')][_0x549fc2[_0xe96a('0x47')]]=_0x4870fe;this['emitVoiceQueueChannelSave'](_0x4870fe,'queuecallerjoin');}}catch(_0x1121f6){logger[_0xe96a('0x3d')](_0xe96a('0x74'),_0x549fc2[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x1121f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe96a('0x1c')]=function(_0x4ec1db){try{if(this['isNotNull'](_0x4ec1db)){logger[_0xe96a('0x4c')](_0xe96a('0x7e'),_0x4ec1db['uniqueid'],util['inspect'](_0x4ec1db,{'showHidden':![],'depth':null}));if(this[_0xe96a('0xf')][_0x4ec1db['uniqueid']]){var _0x334836=_['last'](this[_0xe96a('0xf')][_0x4ec1db['uniqueid']]);_0x334836[_0xe96a('0x7f')]=![];_0x334836[_0xe96a('0x80')]=null;_0x334836['holdtime']=_0x4ec1db[_0xe96a('0x81')];_0x334836[_0xe96a('0x82')]=_0x4ec1db[_0xe96a('0x82')];_0x334836[_0xe96a('0x1b')]=!![];_0x334836[_0xe96a('0x83')]=moment()['format'](_0xe96a('0x77'));_0x334836[_0xe96a('0x4e')]=_0xe96a('0x84');_0x334836[_0xe96a('0x85')]=null;logger[_0xe96a('0x6c')](_0xe96a('0x86'),_0x334836[_0xe96a('0x49')],_0x334836['type']);this[_0xe96a('0x11')][_0x4ec1db[_0xe96a('0x47')]]=_0x334836;this['emitVoiceQueueChannelRemove'](_0x334836,_0xe96a('0x1b'));}}}catch(_0x1f28ee){logger['error'](_0xe96a('0x7e'),_0x4ec1db[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x1f28ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0x1d')]=function(_0x20b3d2){try{if(this[_0xe96a('0x63')](_0x20b3d2)){logger[_0xe96a('0x4c')]('[%s][voiceQueueReport][queuecallerleave]',_0x20b3d2[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x20b3d2,{'showHidden':![],'depth':null}));if(this[_0xe96a('0xf')][_0x20b3d2[_0xe96a('0x47')]]){var _0x1249a1=_[_0xe96a('0x87')](this[_0xe96a('0xf')][_0x20b3d2[_0xe96a('0x47')]]);_0x1249a1[_0xe96a('0x88')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));_0x1249a1[_0xe96a('0x89')]=_0x20b3d2[_0xe96a('0x89')];_0x1249a1[_0xe96a('0x8a')]=_0x20b3d2[_0xe96a('0x8a')];logger['info'](_0xe96a('0x8b'),_0x1249a1[_0xe96a('0x49')],_0x1249a1[_0xe96a('0x53')],_0x20b3d2['connectedlinenum'],_0x20b3d2[_0xe96a('0x8a')]);this['channels'][_0x20b3d2[_0xe96a('0x47')]]=_0x1249a1;this[_0xe96a('0x8c')](_0x1249a1,_0xe96a('0x8d'));}}}catch(_0x3e5323){logger[_0xe96a('0x3d')](_0xe96a('0x8e'),_0x20b3d2[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x3e5323,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')]['syncAgentConnect']=function(_0x11f01c){try{if(this['isNotNull'](_0x11f01c)){logger[_0xe96a('0x4c')](_0xe96a('0x8f'),_0x11f01c[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x11f01c,{'showHidden':![],'depth':null}));if(this[_0xe96a('0xf')][_0x11f01c[_0xe96a('0x47')]]){var _0x4db885=_['last'](this[_0xe96a('0xf')][_0x11f01c['uniqueid']]);_0x4db885[_0xe96a('0x7f')]=!![];_0x4db885[_0xe96a('0x4e')]=_0xe96a('0x90');logger[_0xe96a('0x6c')](_0xe96a('0x91'),_0x4db885['name'],_0x4db885[_0xe96a('0x53')]);}}}catch(_0xc1cc58){logger['error'](_0xe96a('0x8f'),_0x11f01c[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0xc1cc58,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0x1f')]=function(_0x4c2e82){try{if(this['isNotNull'](_0x4c2e82)){logger[_0xe96a('0x4c')](_0xe96a('0x92'),_0x4c2e82[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x4c2e82,{'showHidden':![],'depth':null}));if(this[_0xe96a('0xf')][_0x4c2e82[_0xe96a('0x47')]]){var _0x14a8a8=_['last'](this['queueReports'][_0x4c2e82[_0xe96a('0x47')]]);_0x14a8a8[_0xe96a('0x1b')]=![];_0x14a8a8[_0xe96a('0x83')]=null;_0x14a8a8[_0xe96a('0x93')]=!![];_0x14a8a8[_0xe96a('0x85')]=_0x4c2e82[_0xe96a('0x94')];_0x14a8a8[_0xe96a('0x81')]=_0x4c2e82[_0xe96a('0x81')];_0x14a8a8['queuecallercomplete']=!![];_0x14a8a8['queuecallerexit']=![];_0x14a8a8[_0xe96a('0x95')]=null;if(!_0x14a8a8[_0xe96a('0x96')]){if(_0x4c2e82[_0xe96a('0x97')]==_0xe96a('0x96')){_0x14a8a8[_0xe96a('0x4e')]=_0xe96a('0x98');logger[_0xe96a('0x6c')](_0xe96a('0x99'),_0x14a8a8[_0xe96a('0x49')],_0x14a8a8[_0xe96a('0x53')]);}else{if(_[_0xe96a('0x9a')](_0x4c2e82[_0xe96a('0x39')][_0xe96a('0x9b')](),'local/')){if(this[_0xe96a('0xf')][_0x4c2e82[_0xe96a('0x9c')]]){var _0x467d32=_[_0xe96a('0x87')](this[_0xe96a('0xf')][_0x4c2e82[_0xe96a('0x9c')]]);_0x467d32[_0xe96a('0x7f')]=![];_0x467d32['queuecallerexit']=!![];_0x467d32[_0xe96a('0x95')]=moment(_0x14a8a8[_0xe96a('0x76')])[_0xe96a('0x9d')](_0x4c2e82[_0xe96a('0x81')],'seconds')[_0xe96a('0x48')](_0xe96a('0x77'));_0x467d32[_0xe96a('0x4e')]='FORWARDTRANSFER';_0x467d32[_0xe96a('0x96')]=!![];_0x467d32['transfertype']=_0xe96a('0x9e');_0x467d32[_0xe96a('0x9f')]=_0x4c2e82[_0xe96a('0xa0')];_0x467d32[_0xe96a('0xa1')]=_0x4c2e82[_0xe96a('0x47')];logger[_0xe96a('0x6c')](_0xe96a('0xa2'),_0x467d32[_0xe96a('0x49')],_0x467d32[_0xe96a('0x53')]);var _0x2aa221=this['queueReports'][_0x4c2e82[_0xe96a('0x9c')]];this[_0xe96a('0xf')][_0x4c2e82[_0xe96a('0x9c')]]=this[_0xe96a('0xf')][_0x4c2e82[_0xe96a('0x47')]];this['queueReports'][_0x4c2e82[_0xe96a('0x47')]]=_0x2aa221;}}else{_0x14a8a8[_0xe96a('0x4e')]=_0xe96a('0xa3')+_0x4c2e82['reason'][_0xe96a('0xa4')]();logger[_0xe96a('0x6c')](_0xe96a('0xa5'),_0x14a8a8[_0xe96a('0x49')],_0x14a8a8['type'],_0x14a8a8['queuecallerexitreason']);}}}this[_0xe96a('0x11')][_0x4c2e82[_0xe96a('0x47')]]=_0x14a8a8;this['emitVoiceQueueChannelRemove'](_0x14a8a8,_0xe96a('0x1e'));}}}catch(_0x410d6f){logger[_0xe96a('0x3d')](_0xe96a('0x92'),_0x4c2e82[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x410d6f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0x23')]=function(_0x4b9b93){try{if(this[_0xe96a('0x63')](_0x4b9b93)){logger[_0xe96a('0x4c')](_0xe96a('0xa6'),_0x4b9b93[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0x4b9b93,{'showHidden':![],'depth':null}));this['addVariable'](_0x4b9b93[_0xe96a('0x47')],_[_0xe96a('0x7c')](_0x4b9b93[_0xe96a('0xa7')])[0x0],_0x4b9b93[_0xe96a('0xa8')]);if(this[_0xe96a('0xf')][_0x4b9b93[_0xe96a('0x47')]]){var _0xfa6896=_[_0xe96a('0x87')](this[_0xe96a('0xf')][_0x4b9b93[_0xe96a('0x47')]]);if(_0xfa6896){if(this[_0xe96a('0x63')](_0x4b9b93[_0xe96a('0xa7')])&&this[_0xe96a('0x63')](_0x4b9b93['variable'][_0xe96a('0xa9')])){switch(_0x4b9b93[_0xe96a('0xa8')]){case _0xe96a('0xaa'):_0xfa6896[_0xe96a('0xab')]=![];_0xfa6896[_0xe96a('0x95')]=null;break;case _0xe96a('0xac'):_0xfa6896[_0xe96a('0xad')]=_0xe96a('0xae');_0xfa6896[_0xe96a('0xab')]=!![];_0xfa6896['queuecallerexitAt']=moment()['format'](_0xe96a('0x77'));_0xfa6896[_0xe96a('0x88')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));logger[_0xe96a('0x4c')](_0xe96a('0xaf'),_0x4b9b93[_0xe96a('0x47')],util[_0xe96a('0x3f')](_0xfa6896,{'showHidden':![],'depth':null}));ami[_0xe96a('0x45')](_0xe96a('0xb0'),_0xfa6896);break;default:_0xfa6896[_0xe96a('0xab')]=!![];_0xfa6896[_0xe96a('0x95')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));_0xfa6896[_0xe96a('0x88')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));}_0xfa6896[_0xe96a('0x1b')]=![];_0xfa6896[_0xe96a('0x83')]=null;_0xfa6896[_0xe96a('0x4e')]=_0x4b9b93['value'];this['channels'][_0x4b9b93[_0xe96a('0x47')]]=_0xfa6896;this[_0xe96a('0x43')](_0xfa6896,'varset');}else if(this[_0xe96a('0x63')](_0x4b9b93[_0xe96a('0xa7')])&&this[_0xe96a('0x63')](_0x4b9b93[_0xe96a('0xa7')][_0xe96a('0xb1')])){if(!_0xfa6896[_0xe96a('0x1b')]){_0xfa6896[_0xe96a('0xab')]=!![];_0xfa6896[_0xe96a('0x95')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));_0xfa6896[_0xe96a('0x4e')]=_0xe96a('0xb2');_0xfa6896[_0xe96a('0x88')]=moment()[_0xe96a('0x48')](_0xe96a('0x77'));this['channels'][_0x4b9b93[_0xe96a('0x47')]]=_0xfa6896;}}logger[_0xe96a('0x6c')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4b9b93['uniqueid'],_0xfa6896[_0xe96a('0x49')],_0xfa6896[_0xe96a('0x53')],_[_0xe96a('0x7c')](_0x4b9b93[_0xe96a('0xa7')])[0x0],_0x4b9b93['value']);_0xfa6896[_0xe96a('0x15')]=this['variables'][_0x4b9b93[_0xe96a('0x47')]];}}}}catch(_0x2947b0){logger[_0xe96a('0x3d')](_0xe96a('0xa6'),_0x4b9b93['uniqueid'],util[_0xe96a('0x3f')](_0x2947b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe96a('0xa')][_0xe96a('0xb3')]=function(_0x360472,_0x1398c8,_0x3d80fc){var _0x408501=[_0xe96a('0xb4'),_0xe96a('0xb5'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0xe96a('0xb6'),_0xe96a('0xb7'),_0xe96a('0xb8'),'sipcallid',_0xe96a('0xb9'),_0xe96a('0xba'),_0xe96a('0xbb'),_0xe96a('0xbc'),_0xe96a('0xbd'),_0xe96a('0xbe'),'memberlastcall','membername',_0xe96a('0xbf'),_0xe96a('0xc0')];if(!_[_0xe96a('0xc1')](_0x1398c8)&&!_[_0xe96a('0xc2')](_0x408501,_0x1398c8)){if(_[_0xe96a('0x64')](this[_0xe96a('0x15')][_0x360472])){this[_0xe96a('0x15')][_0x360472]={};}this[_0xe96a('0x15')][_0x360472][_0x1398c8]=_0x3d80fc;}};VoiceQueueReport[_0xe96a('0xa')]['handleHangup']=function(_0x1dbce1,_0x265585,_0x452a3a){var _0x3854de={};for(var _0x53c601=0x0;_0x53c6010x0?_0x1c7ccb:0x0;this[_0x9573('0x10')][_0x5c65a1['queue']]['talking']=this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]]['talking']>_[_0x9573('0x6b')](_0x5c65a1['loggedin'])?_[_0x9573('0x6b')](_0x5c65a1[_0x9573('0x6c')]):this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]][_0x9573('0x2b')];this['emitVoiceQueueSummary'](this[_0x9573('0x10')][_0x5c65a1[_0x9573('0x66')]],'queuesummary');}logger[_0x9573('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x9573('0x39')](this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]],{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')]('custom:queuesummary',this[_0x9573('0x10')][_0x5c65a1[_0x9573('0x66')]]);}}}catch(_0x1600fc){logger[_0x9573('0x37')](_0x9573('0x65'),util['inspect'](_0x1600fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x18')]=function(_0x3bd032){logger['debug'](_0x9573('0x6d'),util[_0x9573('0x39')](_0x3bd032,{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')](_0x9573('0x6e'),{});this[_0x9573('0x11')]=!![];};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x6f')]=function(_0x5d6ae4){try{if(this[_0x9573('0x61')](_0x5d6ae4)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x5d6ae4[_0x9573('0x44')],util[_0x9573('0x39')](_0x5d6ae4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]]))this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]]=[];if(_[_0x9573('0x62')](this[_0x9573('0x32')][_0x5d6ae4['uniqueid']]))this['channels'][_0x5d6ae4['uniqueid']]={};var _0x1290f7=new QueueReport();_0x1290f7[_0x9573('0x46')]=_0x5d6ae4[_0x9573('0x66')];_0x1290f7[_0x9573('0x4e')]=this['voiceQueues'][_0x1290f7[_0x9573('0x46')]]&&this['voiceQueues'][_0x1290f7['name']]['type']?this[_0x9573('0x10')][_0x1290f7[_0x9573('0x46')]][_0x9573('0x4e')]||_0x9573('0x4f'):_0x9573('0x4f');_0x1290f7[_0x9573('0x66')]=_0x5d6ae4[_0x9573('0x66')];_0x1290f7[_0x9573('0x70')]=moment()['format'](_0x9573('0x71'));_0x1290f7[_0x9573('0x72')]=_0x5d6ae4[_0x9573('0x72')];_0x1290f7['count']=_0x5d6ae4['count'];_0x1290f7['uniqueid']=_0x5d6ae4[_0x9573('0x44')];_0x1290f7[_0x9573('0x73')]=this[_0x9573('0x32')][_0x5d6ae4['uniqueid']][_0x9573('0x73')];logger[_0x9573('0x68')](_0x9573('0x74'),_0x1290f7['name'],_0x1290f7[_0x9573('0x4e')]);_['merge'](_0x1290f7,_[_0x9573('0x75')](_0x5d6ae4,_[_0x9573('0x76')](_0x1290f7)));this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]][_0x9573('0x77')](_0x1290f7);this[_0x9573('0x32')][_0x5d6ae4['uniqueid']]=_0x1290f7;this[_0x9573('0x40')](_0x1290f7,'queuecallerjoin');}}catch(_0xb39bfc){logger[_0x9573('0x37')](_0x9573('0x78'),_0x5d6ae4[_0x9573('0x44')],util['inspect'](_0xb39bfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x1b')]=function(_0x434618){try{if(this[_0x9573('0x61')](_0x434618)){logger['debug'](_0x9573('0x79'),_0x434618[_0x9573('0x44')],util[_0x9573('0x39')](_0x434618,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x434618['uniqueid']]){var _0x4fe47c=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x434618[_0x9573('0x44')]]);_0x4fe47c[_0x9573('0x7b')]=![];_0x4fe47c[_0x9573('0x7c')]=null;_0x4fe47c[_0x9573('0x7d')]=_0x434618[_0x9573('0x7d')];_0x4fe47c[_0x9573('0x7e')]=_0x434618[_0x9573('0x7e')];_0x4fe47c[_0x9573('0x1a')]=!![];_0x4fe47c[_0x9573('0x7f')]=moment()['format'](_0x9573('0x71'));_0x4fe47c[_0x9573('0x49')]=_0x9573('0x80');_0x4fe47c[_0x9573('0x81')]=null;logger[_0x9573('0x68')](_0x9573('0x82'),_0x4fe47c['name'],_0x4fe47c[_0x9573('0x4e')]);this['channels'][_0x434618[_0x9573('0x44')]]=_0x4fe47c;this[_0x9573('0x83')](_0x4fe47c,_0x9573('0x1a'));}}}catch(_0x38bfcc){logger[_0x9573('0x37')](_0x9573('0x79'),_0x434618[_0x9573('0x44')],util['inspect'](_0x38bfcc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x84')]=function(_0x46b8fa){try{if(this[_0x9573('0x61')](_0x46b8fa)){logger[_0x9573('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x46b8fa['uniqueid'],util['inspect'](_0x46b8fa,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x46b8fa['uniqueid']]){var _0xf566d6=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x46b8fa[_0x9573('0x44')]]);_0xf566d6[_0x9573('0x85')]=moment()['format'](_0x9573('0x71'));_0xf566d6[_0x9573('0x86')]=_0x46b8fa[_0x9573('0x86')];_0xf566d6['connectedlinename']=_0x46b8fa[_0x9573('0x87')];logger[_0x9573('0x68')](_0x9573('0x88'),_0xf566d6[_0x9573('0x46')],_0xf566d6[_0x9573('0x4e')],_0x46b8fa['connectedlinenum'],_0x46b8fa[_0x9573('0x87')]);this[_0x9573('0x32')][_0x46b8fa['uniqueid']]=_0xf566d6;this[_0x9573('0x40')](_0xf566d6,_0x9573('0x1c'));}}}catch(_0x23f0b2){logger[_0x9573('0x37')]('[%s][voiceQueueReport][queuecallerleave]',_0x46b8fa['uniqueid'],util[_0x9573('0x39')](_0x23f0b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x20')]=function(_0x1e912c){try{if(this['isNotNull'](_0x1e912c)){logger[_0x9573('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x1e912c[_0x9573('0x44')],util[_0x9573('0x39')](_0x1e912c,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x1e912c['uniqueid']]){var _0xe5d263=_[_0x9573('0x7a')](this['queueReports'][_0x1e912c['uniqueid']]);_0xe5d263['queuecallercomplete']=!![];_0xe5d263[_0x9573('0x49')]=_0x9573('0x89');logger[_0x9573('0x68')](_0x9573('0x8a'),_0xe5d263[_0x9573('0x46')],_0xe5d263[_0x9573('0x4e')]);}}}catch(_0x2e7185){logger[_0x9573('0x37')](_0x9573('0x8b'),_0x1e912c['uniqueid'],util[_0x9573('0x39')](_0x2e7185,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9573('0x1e')]=function(_0x42646c){try{if(this[_0x9573('0x61')](_0x42646c)){logger[_0x9573('0x41')](_0x9573('0x8c'),_0x42646c['uniqueid'],util[_0x9573('0x39')](_0x42646c,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x42646c[_0x9573('0x44')]]){var _0xabbf9=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x42646c['uniqueid']]);_0xabbf9[_0x9573('0x1a')]=![];_0xabbf9[_0x9573('0x7f')]=null;_0xabbf9[_0x9573('0x8d')]=!![];_0xabbf9[_0x9573('0x81')]=_0x42646c[_0x9573('0x8e')];_0xabbf9['holdtime']=_0x42646c[_0x9573('0x7d')];_0xabbf9[_0x9573('0x7b')]=!![];_0xabbf9[_0x9573('0x8f')]=![];_0xabbf9[_0x9573('0x90')]=null;if(!_0xabbf9[_0x9573('0x91')]){if(_0x42646c['reason']==_0x9573('0x91')){_0xabbf9[_0x9573('0x49')]=_0x9573('0x92');logger[_0x9573('0x68')](_0x9573('0x93'),_0xabbf9[_0x9573('0x46')],_0xabbf9['type']);}else{if(_[_0x9573('0x94')](_0x42646c['channel'][_0x9573('0x95')](),_0x9573('0x96'))){if(this[_0x9573('0x3a')][_0x42646c[_0x9573('0x97')]]){var _0x393092=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x42646c[_0x9573('0x97')]]);_0x393092[_0x9573('0x7b')]=![];_0x393092[_0x9573('0x8f')]=!![];_0x393092['queuecallerexitAt']=moment(_0xabbf9[_0x9573('0x70')])[_0x9573('0x98')](_0x42646c[_0x9573('0x7d')],_0x9573('0x99'))[_0x9573('0x4b')](_0x9573('0x71'));_0x393092[_0x9573('0x49')]=_0x9573('0x9a');_0x393092[_0x9573('0x91')]=!![];_0x393092['transfertype']='FORWARD';_0x393092[_0x9573('0x9b')]=_0x42646c[_0x9573('0x9c')];_0x393092['transferuniqueid']=_0x42646c[_0x9573('0x44')];logger[_0x9573('0x68')](_0x9573('0x9d'),_0x393092[_0x9573('0x46')],_0x393092[_0x9573('0x4e')]);var _0xf9f548=this['queueReports'][_0x42646c['linkedid']];this[_0x9573('0x3a')][_0x42646c['linkedid']]=this[_0x9573('0x3a')][_0x42646c[_0x9573('0x44')]];this['queueReports'][_0x42646c[_0x9573('0x44')]]=_0xf9f548;}}else{_0xabbf9[_0x9573('0x49')]='COMPLETEDBY'+_0x42646c['reason'][_0x9573('0x9e')]();logger[_0x9573('0x68')](_0x9573('0x9f'),_0xabbf9[_0x9573('0x46')],_0xabbf9[_0x9573('0x4e')],_0xabbf9[_0x9573('0x49')]);}}}this['channels'][_0x42646c[_0x9573('0x44')]]=_0xabbf9;this['emitVoiceQueueChannelRemove'](_0xabbf9,'agentcomplete');}}}catch(_0x57d9f2){logger['error'](_0x9573('0x8c'),_0x42646c['uniqueid'],util['inspect'](_0x57d9f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')]['syncVarSet']=function(_0x1dccfb){try{if(this[_0x9573('0x61')](_0x1dccfb)){logger['debug'](_0x9573('0xa0'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x1dccfb,{'showHidden':![],'depth':null}));this[_0x9573('0xa1')](_0x1dccfb[_0x9573('0x44')],_['keys'](_0x1dccfb[_0x9573('0xa2')])[0x0],_0x1dccfb[_0x9573('0xa3')]);if(this[_0x9573('0x3a')][_0x1dccfb[_0x9573('0x44')]]){var _0x50115f=_[_0x9573('0x7a')](this['queueReports'][_0x1dccfb['uniqueid']]);if(_0x50115f){if(this[_0x9573('0x61')](_0x1dccfb[_0x9573('0xa2')])&&this[_0x9573('0x61')](_0x1dccfb['variable'][_0x9573('0xa4')])){switch(_0x1dccfb[_0x9573('0xa3')]){case _0x9573('0xa5'):_0x50115f[_0x9573('0x8f')]=![];_0x50115f[_0x9573('0x90')]=null;break;case _0x9573('0xa6'):_0x50115f['lastevent']='timeout';_0x50115f[_0x9573('0x8f')]=!![];_0x50115f[_0x9573('0x90')]=moment()['format'](_0x9573('0x71'));_0x50115f[_0x9573('0x85')]=moment()[_0x9573('0x4b')](_0x9573('0x71'));logger[_0x9573('0x41')](_0x9573('0xa7'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x50115f,{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')](_0x9573('0xa8'),_0x50115f);break;default:_0x50115f['queuecallerexit']=!![];_0x50115f[_0x9573('0x90')]=moment()[_0x9573('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x50115f[_0x9573('0x85')]=moment()[_0x9573('0x4b')](_0x9573('0x71'));}_0x50115f[_0x9573('0x1a')]=![];_0x50115f[_0x9573('0x7f')]=null;_0x50115f[_0x9573('0x49')]=_0x1dccfb[_0x9573('0xa3')];this[_0x9573('0x32')][_0x1dccfb[_0x9573('0x44')]]=_0x50115f;this['emitVoiceQueueChannelRemove'](_0x50115f,_0x9573('0xa9'));}else if(this[_0x9573('0x61')](_0x1dccfb['variable'])&&this[_0x9573('0x61')](_0x1dccfb['variable'][_0x9573('0xaa')])){if(!_0x50115f[_0x9573('0x1a')]){_0x50115f[_0x9573('0x8f')]=!![];_0x50115f['queuecallerexitAt']=moment()['format'](_0x9573('0x71'));_0x50115f[_0x9573('0x49')]=_0x9573('0xab');_0x50115f['queuecallerleaveAt']=moment()[_0x9573('0x4b')](_0x9573('0x71'));this[_0x9573('0x32')][_0x1dccfb[_0x9573('0x44')]]=_0x50115f;}}logger[_0x9573('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1dccfb['uniqueid'],_0x50115f['name'],_0x50115f[_0x9573('0x4e')],_[_0x9573('0x76')](_0x1dccfb['variable'])[0x0],_0x1dccfb['value']);_0x50115f['variables']=this[_0x9573('0x13')][_0x1dccfb[_0x9573('0x44')]];}}}}catch(_0x3ba9fa){logger[_0x9573('0x37')](_0x9573('0xa0'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x3ba9fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0xa1')]=function(_0xc8fe2d,_0x1f0b5b,_0x5ce31f){var _0x57b532=['rtpaudioqos','rtpaudioqosbridged',_0x9573('0xac'),_0x9573('0xad'),_0x9573('0xae'),_0x9573('0xaf'),_0x9573('0xb0'),_0x9573('0xb1'),_0x9573('0xb2'),_0x9573('0xb3'),_0x9573('0xb4'),_0x9573('0xb5'),_0x9573('0xb6'),_0x9573('0xb7'),_0x9573('0xb8'),_0x9573('0xb9'),_0x9573('0x8e'),_0x9573('0xba'),_0x9573('0xbb')];if(!_[_0x9573('0xbc')](_0x1f0b5b)&&!_[_0x9573('0xbd')](_0x57b532,_0x1f0b5b)){if(_[_0x9573('0x62')](this[_0x9573('0x13')][_0xc8fe2d])){this[_0x9573('0x13')][_0xc8fe2d]={};}this['variables'][_0xc8fe2d][_0x1f0b5b]=_0x5ce31f;}};VoiceQueueReport[_0x9573('0xb')]['handleHangup']=function(_0x400c,_0x6eb411,_0x5b3cf4){var _0x30933b={};for(var _0x30192f=0x0;_0x30192f=0x0?moment(_0xb1e189[_0xb519('0x18')])[_0xb519('0xd')](_0xb1e189[_0xb519('0x17')],_0xb519('0xe')):null,'data1':_0xb519('0x19'),'data2':_0xb1e189['accountcode'],'data3':_0xb1e189[_0xb519('0x10')],'data4':_0xb1e189[_0xb519('0x1a')]||null,'role':_0xb519('0x1b'),'internal':_0xb1e189[_0xb519('0x12')]?_['toNumber'](_0xb1e189['accountcode']):undefined,'uniqueid':_0xb1e189[_0xb519('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x5101=['queue','agent','accountcode','toNumber','uniqueid','Request','membername','endtime','starttime','dialstring','moment','util','voiceQueueReport','CreateMemberReport','voice','lastAssignedTo','interface','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten'];(function(_0x4c77ae,_0xb121a8){var _0x3c737d=function(_0x38c83c){while(--_0x38c83c){_0x4c77ae['push'](_0x4c77ae['shift']());}};_0x3c737d(++_0xb121a8);}(_0x5101,0x163));var _0x1510=function(_0x3a1d34,_0x446b82){_0x3a1d34=_0x3a1d34-0x0;var _0x2003f1=_0x5101[_0x3a1d34];return _0x2003f1;};'use strict';var moment=require(_0x1510('0x0'));var _=require('lodash');var util=require(_0x1510('0x1'));var client=require('../client');exports[_0x1510('0x2')]=function(_0x34b420){var _0x198373=_0x34b420['queuecallercompleteAt']||_0x34b420['queuecallerexitAt'];return client['Request'](_0x1510('0x3'),{'body':{'channel':_0x1510('0x4'),'membername':_0x34b420[_0x1510('0x5')],'interface':_['isNil'](_0x34b420[_0x1510('0x6')])?util['format']('SIP/%s',_0x34b420[_0x1510('0x5')]):_0x34b420[_0x1510('0x6')],'type':_0x1510('0x7'),'enterAt':_0x34b420[_0x1510('0x8')],'exitAt':_0x198373,'duration':moment(_0x198373)[_0x1510('0x9')](_0x34b420[_0x1510('0x8')],_0x1510('0xa')),'data1':'inbound','data2':_0x34b420[_0x1510('0xb')],'data3':_0x34b420[_0x1510('0xc')],'data4':null,'data5':_0x34b420[_0x1510('0xd')],'role':_0x1510('0xe'),'internal':_0x34b420[_0x1510('0xf')]?_[_0x1510('0x10')](_0x34b420['accountcode']):undefined,'uniqueid':_0x34b420[_0x1510('0x11')]},'log':_0x1510('0x3')});};exports['voiceDialReport']=function(_0x542f1d){return client[_0x1510('0x12')](_0x1510('0x3'),{'body':{'channel':_0x1510('0x4'),'membername':_0x542f1d[_0x1510('0x13')],'interface':_0x542f1d[_0x1510('0x6')],'type':'TALKING','enterAt':_0x542f1d['starttime'],'exitAt':_0x542f1d[_0x1510('0x14')],'duration':moment(_0x542f1d[_0x1510('0x14')])[_0x1510('0x9')](_0x542f1d[_0x1510('0x15')],'seconds')>=0x0?moment(_0x542f1d['endtime'])['diff'](_0x542f1d[_0x1510('0x15')],_0x1510('0xa')):null,'data1':'outbound','data2':_0x542f1d[_0x1510('0xf')],'data3':_0x542f1d[_0x1510('0xc')],'data4':_0x542f1d[_0x1510('0x16')]||null,'role':_0x1510('0xe'),'internal':_0x542f1d['accountcode']?_[_0x1510('0x10')](_0x542f1d[_0x1510('0xf')]):undefined,'uniqueid':_0x542f1d[_0x1510('0x11')]},'log':_0x1510('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 734af4b..9ae0b92 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 _0xbaf0=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings','Request'];(function(_0x289e85,_0x3543f6){var _0x158800=function(_0x25c826){while(--_0x25c826){_0x289e85['push'](_0x289e85['shift']());}};_0x158800(++_0x3543f6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var client=require('../client');exports[_0x0baf('0x0')]=function(){return client[_0x0baf('0x1')](_0x0baf('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0baf('0x3'),_0x0baf('0x4')]},'log':_0x0baf('0x5')});}; \ No newline at end of file +var _0xb6fa=['../client','ShowSetting','GetSettings'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb6fa[_0x2261ce];return _0x524640;};'use strict';var client=require(_0xab6f('0x0'));exports['getSettings']=function(){return client['Request'](_0xab6f('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0xab6f('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6196ca8..50031c8 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 _0x30cc=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x30cc,0x81));var _0xc30c=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x30cc[_0x164eca];return _0x2ce562;};'use strict';var client=require(_0xc30c('0x0'));exports[_0xc30c('0x1')]=function(_0x4940d6){return function(_0x4cacad){return client[_0xc30c('0x2')](_0xc30c('0x3'),{'options':{'raw':!![],'attributes':['id',_0xc30c('0x4'),_0xc30c('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xc273=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x2f4de8,_0x313395){var _0x4569cb=function(_0x17572f){while(--_0x17572f){_0x2f4de8['push'](_0x2f4de8['shift']());}};_0x4569cb(++_0x313395);}(_0xc273,0x137));var _0x3c27=function(_0x2859f2,_0x1e3102){_0x2859f2=_0x2859f2-0x0;var _0x4974cd=_0xc273[_0x2859f2];return _0x4974cd;};'use strict';var client=require(_0x3c27('0x0'));exports[_0x3c27('0x1')]=function(_0x34ba53){return function(_0x36ab25){return client[_0x3c27('0x2')](_0x3c27('0x3'),{'options':{'raw':!![],'attributes':['id',_0x3c27('0x4'),_0x3c27('0x5')]},'log':_0x3c27('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f55fe1f..c873990 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 _0x5899=['data2','data4','data5','data6','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data1'];(function(_0x26bafe,_0x13e506){var _0x307879=function(_0x5a1548){while(--_0x5a1548){_0x26bafe['push'](_0x26bafe['shift']());}};_0x307879(++_0x13e506);}(_0x5899,0x16c));var _0x9589=function(_0x101d7e,_0x4093f2){_0x101d7e=_0x101d7e-0x0;var _0x42b829=_0x5899[_0x101d7e];return _0x42b829;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x4ad446){return function(_0x3abed1){return client[_0x9589('0x0')](_0x9589('0x1'),{'options':{'raw':![],'attributes':['id',_0x9589('0x2'),_0x9589('0x3'),_0x9589('0x4')],'include':[{'model':_0x9589('0x5'),'as':_0x9589('0x6'),'attributes':['id',_0x9589('0x7'),_0x9589('0x8'),_0x9589('0x9')]},{'model':_0x9589('0x5'),'as':_0x9589('0xa'),'attributes':['id',_0x9589('0x7'),'operator',_0x9589('0x9')]},{'model':'Action','as':_0x9589('0xb'),'attributes':['id',_0x9589('0xc'),_0x9589('0xd'),_0x9589('0xe'),'data3',_0x9589('0xf'),_0x9589('0x10'),_0x9589('0x11'),'data7']}]},'log':_0x9589('0x1')});};}; \ No newline at end of file +var _0x2c08=['data3','data4','data5','data6','GetTrigger','../client','getTriggers','name','Condition','AllConditions','field','operator','value','Action','action','data2'];(function(_0x51c31d,_0x4c885a){var _0x48e7e1=function(_0x16f7e0){while(--_0x16f7e0){_0x51c31d['push'](_0x51c31d['shift']());}};_0x48e7e1(++_0x4c885a);}(_0x2c08,0x105));var _0x82c0=function(_0x53ed3a,_0x1f4cd3){_0x53ed3a=_0x53ed3a-0x0;var _0x30014c=_0x2c08[_0x53ed3a];return _0x30014c;};'use strict';var client=require(_0x82c0('0x0'));exports[_0x82c0('0x1')]=function(_0x516c43){return function(_0x60f827){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x82c0('0x2'),'channel','status'],'include':[{'model':_0x82c0('0x3'),'as':_0x82c0('0x4'),'attributes':['id',_0x82c0('0x5'),_0x82c0('0x6'),'value']},{'model':_0x82c0('0x3'),'as':'AnyConditions','attributes':['id',_0x82c0('0x5'),_0x82c0('0x6'),_0x82c0('0x7')]},{'model':_0x82c0('0x8'),'as':'Actions','attributes':['id',_0x82c0('0x9'),'data1',_0x82c0('0xa'),_0x82c0('0xb'),_0x82c0('0xc'),_0x82c0('0xd'),_0x82c0('0xe'),'data7']}]},'log':_0x82c0('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4523145..ddc84ae 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 _0x47e6=['Request','registry','defaultuser','GetTrunk','getTrunks'];(function(_0x14561f,_0x5f3290){var _0xc61853=function(_0x5ef4c7){while(--_0x5ef4c7){_0x14561f['push'](_0x14561f['shift']());}};_0xc61853(++_0x5f3290);}(_0x47e6,0xe5));var _0x647e=function(_0xae00d3,_0x2c6e51){_0xae00d3=_0xae00d3-0x0;var _0x242fac=_0x47e6[_0xae00d3];return _0x242fac;};'use strict';var client=require('../client');exports[_0x647e('0x0')]=function(_0x513333){return function(_0x587c3c){return client[_0x647e('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x647e('0x2'),_0x647e('0x3')]},'log':_0x647e('0x4')});};}; \ No newline at end of file +var _0x1333=['defaultuser','GetTrunk','../client','getTrunks','Request','name','registry'];(function(_0x10459e,_0x6f5775){var _0x388db6=function(_0xe0b3f5){while(--_0xe0b3f5){_0x10459e['push'](_0x10459e['shift']());}};_0x388db6(++_0x6f5775);}(_0x1333,0x167));var _0x3133=function(_0x41c79a,_0x1e5c8a){_0x41c79a=_0x41c79a-0x0;var _0x4a3947=_0x1333[_0x41c79a];return _0x4a3947;};'use strict';var client=require(_0x3133('0x0'));exports[_0x3133('0x1')]=function(_0x2215c2){return function(_0x456264){return client[_0x3133('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3133('0x3'),_0x3133('0x4'),_0x3133('0x5')]},'log':_0x3133('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7ccd240..bc6cd81 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1f3be5,_0x5ab170){var _0x204662=function(_0x317d04){while(--_0x317d04){_0x1f3be5['push'](_0x1f3be5['shift']());}};_0x204662(++_0x5ab170);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x9d7970,_0x43db95){var _0x19992e=function(_0x22264d){while(--_0x22264d){_0x9d7970['push'](_0x9d7970['shift']());}};_0x19992e(++_0x43db95);}(_0x70e0,0x17b));var _0x070e=function(_0x577529,_0x2c7f85){_0x577529=_0x577529-0x0;var _0x16f47a=_0x70e0[_0x577529];return _0x16f47a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f45871c..6596123 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 _0xf8ca=['../client','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x4ad02b,_0x5b480b){var _0x30d90b=function(_0x59ccb8){while(--_0x59ccb8){_0x4ad02b['push'](_0x4ad02b['shift']());}};_0x30d90b(++_0x5b480b);}(_0xf8ca,0xb0));var _0xaf8c=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xf8ca[_0x1eda20];return _0x31b953;};'use strict';var client=require(_0xaf8c('0x0'));exports['create']=function(_0x3c7bd6){return client[_0xaf8c('0x1')](_0xaf8c('0x2'),{'body':_0x3c7bd6,'log':_0xaf8c('0x2')});};exports['update']=function(_0x2c8547,_0x55b359,_0x2eeb3f){return client['Request'](_0xaf8c('0x3'),{'body':_0x2c8547,'options':{'where':{'uniqueid':_0x55b359,'interface':_0x2eeb3f,'agentcomplete':!![]}},'log':_0xaf8c('0x3')});}; \ No newline at end of file +var _0xffeb=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xffeb,0x1e9));var _0xbffe=function(_0x211c7b,_0x1c03ee){_0x211c7b=_0x211c7b-0x0;var _0x57b12=_0xffeb[_0x211c7b];return _0x57b12;};'use strict';var client=require(_0xbffe('0x0'));exports['create']=function(_0x3bbf6f){return client[_0xbffe('0x1')](_0xbffe('0x2'),{'body':_0x3bbf6f,'log':_0xbffe('0x2')});};exports[_0xbffe('0x3')]=function(_0xaa2aca,_0x3dcbf0,_0x39d578){return client[_0xbffe('0x1')](_0xbffe('0x4'),{'body':_0xaa2aca,'options':{'where':{'uniqueid':_0x3dcbf0,'interface':_0x39d578,'agentcomplete':!![]}},'log':_0xbffe('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 34db7e1..b8a6de9 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 _0xd6b2=['context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xd6b2,0x13c));var _0x2d6b=function(_0x2f90df,_0x377024){_0x2f90df=_0x2f90df-0x0;var _0x525089=_0xd6b2[_0x2f90df];return _0x525089;};'use strict';var moment=require(_0x2d6b('0x0'));var util=require(_0x2d6b('0x1'));var _=require('lodash');var client=require('../client');exports[_0x2d6b('0x2')]=function(_0x5edc65){return client[_0x2d6b('0x3')](_0x2d6b('0x4'),{'body':_[_0x2d6b('0x5')](_0x5edc65,{'source':_0x5edc65[_0x2d6b('0x6')],'destinationcontext':_0x5edc65[_0x2d6b('0x7')],'callerid':_0x5edc65[_0x2d6b('0x8')],'amaflags':_0x2d6b('0x9')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x2d6b('0xa'),{'options':{'where':{'type':[_0x2d6b('0xb')],'createdAt':{'$between':[moment()[_0x2d6b('0xc')]('day')[_0x2d6b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x2d6b('0xd')](_0x2d6b('0xe'))]}},'attributes':[_0x2d6b('0xf'),_0x2d6b('0x10'),_0x2d6b('0x11'),_0x2d6b('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x99d8=['duration','billableseconds','GetVoiceCallReports','moment','util','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x59fdf6,_0x3b45f5){var _0x4c8376=function(_0x3c8835){while(--_0x3c8835){_0x59fdf6['push'](_0x59fdf6['shift']());}};_0x4c8376(++_0x3b45f5);}(_0x99d8,0xa5));var _0x899d=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x99d8[_0x1d80be];return _0xf9a4f3;};'use strict';var moment=require(_0x899d('0x0'));var util=require(_0x899d('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x4d76f6){return client['Request'](_0x899d('0x2'),{'body':_[_0x899d('0x3')](_0x4d76f6,{'source':_0x4d76f6[_0x899d('0x4')],'destinationcontext':_0x4d76f6['context'],'callerid':_0x4d76f6[_0x899d('0x5')],'amaflags':_0x899d('0x6')}),'log':'CreateVoiceCallReport'});};exports[_0x899d('0x7')]=function(){return function(){return client[_0x899d('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x899d('0x9')],'createdAt':{'$between':[moment()['startOf'](_0x899d('0xa'))[_0x899d('0xb')](_0x899d('0xc')),moment()['endOf'](_0x899d('0xa'))[_0x899d('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x899d('0xd'),_0x899d('0xe'),_0x899d('0xf'),_0x899d('0x10')]},'log':_0x899d('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7b0d9a4..bba987a 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 _0xeeb9=['create','Request','CreateVoiceDialReport','../client'];(function(_0x131e16,_0x38a2c8){var _0x4f3268=function(_0x3d445b){while(--_0x3d445b){_0x131e16['push'](_0x131e16['shift']());}};_0x4f3268(++_0x38a2c8);}(_0xeeb9,0x1ef));var _0x9eeb=function(_0xea2a54,_0xf887d1){_0xea2a54=_0xea2a54-0x0;var _0x294381=_0xeeb9[_0xea2a54];return _0x294381;};'use strict';var client=require(_0x9eeb('0x0'));exports[_0x9eeb('0x1')]=function(_0x455e14){return client[_0x9eeb('0x2')]('CreateVoiceDialReport',{'body':_0x455e14,'log':_0x9eeb('0x3')});}; \ No newline at end of file +var _0x5171=['../client','CreateVoiceDialReport'];(function(_0x197b8e,_0xa2c91e){var _0x56c3ec=function(_0x3d5fc5){while(--_0x3d5fc5){_0x197b8e['push'](_0x197b8e['shift']());}};_0x56c3ec(++_0xa2c91e);}(_0x5171,0x74));var _0x1517=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x5171[_0x119cd8];return _0x7072a3;};'use strict';var client=require(_0x1517('0x0'));exports['create']=function(_0x105c3a){return client['Request'](_0x1517('0x1'),{'body':_0x105c3a,'log':_0x1517('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e16415d..c05934c 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 _0x063c=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x1a4c0a,_0x369a9e){var _0x2c8130=function(_0x566357){while(--_0x566357){_0x1a4c0a['push'](_0x1a4c0a['shift']());}};_0x2c8130(++_0x369a9e);}(_0x063c,0xba));var _0xc063=function(_0x23e4b1,_0x5a71dd){_0x23e4b1=_0x23e4b1-0x0;var _0x174327=_0x063c[_0x23e4b1];return _0x174327;};'use strict';var client=require('../client');exports[_0xc063('0x0')]=function(){return function(){return client[_0xc063('0x1')](_0xc063('0x2'),{'options':{'raw':!![],'attributes':['id',_0xc063('0x3'),_0xc063('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xc063('0x0')});};}; \ No newline at end of file +var _0x9567=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9567,0xdc));var _0x7956=function(_0x4737ed,_0x1ccc8b){_0x4737ed=_0x4737ed-0x0;var _0x3429cf=_0x9567[_0x4737ed];return _0x3429cf;};'use strict';var client=require(_0x7956('0x0'));exports[_0x7956('0x1')]=function(){return function(){return client[_0x7956('0x2')](_0x7956('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7956('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 3095c7c..c8906d2 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 _0x7f61=['active','mandatoryDispositionPause','callerid','Interval','interval','../client','getVoiceQueues','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','name'];(function(_0x49b30c,_0x32038e){var _0x4d7f5e=function(_0x24c645){while(--_0x24c645){_0x49b30c['push'](_0x49b30c['shift']());}};_0x4d7f5e(++_0x32038e);}(_0x7f61,0x1d5));var _0x17f6=function(_0x4bc50f,_0x2123fd){_0x4bc50f=_0x4bc50f-0x0;var _0x2f25e4=_0x7f61[_0x4bc50f];return _0x2f25e4;};'use strict';var client=require(_0x17f6('0x0'));exports[_0x17f6('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x17f6('0x2'),_0x17f6('0x3'),_0x17f6('0x4'),_0x17f6('0x5'),'type',_0x17f6('0x6'),_0x17f6('0x7'),'dialLimitChannel',_0x17f6('0x8'),_0x17f6('0x9'),'dialPredictiveOptimization',_0x17f6('0xa'),'dialPredictiveInterval',_0x17f6('0xb'),'dialOriginateCallerIdNumber',_0x17f6('0xc'),_0x17f6('0xd'),_0x17f6('0xe'),'dialQueueProject',_0x17f6('0xf'),_0x17f6('0x10'),_0x17f6('0x11'),_0x17f6('0x12'),_0x17f6('0x13'),_0x17f6('0x14'),'dialGlobalMaxRetry',_0x17f6('0x15'),'dialGlobalInterval',_0x17f6('0x16'),'dialCheckDuplicateType',_0x17f6('0x17'),_0x17f6('0x18'),_0x17f6('0x19'),_0x17f6('0x1a'),_0x17f6('0x1b'),_0x17f6('0x1c'),_0x17f6('0x1d'),'dialAMDMaximumNumberOfWords',_0x17f6('0x1e'),_0x17f6('0x1f'),_0x17f6('0x20'),_0x17f6('0x21'),'dialRecallInQueue',_0x17f6('0x22'),_0x17f6('0x23'),_0x17f6('0x24'),_0x17f6('0x25'),'monitor_format',_0x17f6('0x26'),'dialRandomLastDigitCallerIdNumber',_0x17f6('0x27'),_0x17f6('0x28'),'dialNoSuchNumberRetryFrequency',_0x17f6('0x29'),_0x17f6('0x2a'),_0x17f6('0x2b'),'dialAbandonedRetryFrequency',_0x17f6('0x2c'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x17f6('0x2d'),_0x17f6('0x2e'),_0x17f6('0x2f'),_0x17f6('0x30'),'dialPreviewAutoRecallMe',_0x17f6('0x31'),_0x17f6('0x32')],'include':[{'model':_0x17f6('0x33'),'as':_0x17f6('0x33'),'attributes':['id',_0x17f6('0x34'),'callerid',_0x17f6('0x35')]},{'model':'Pause','as':_0x17f6('0x36'),'attributes':['id',_0x17f6('0x34')]},{'model':_0x17f6('0x33'),'as':'TrunkBackup','attributes':['id',_0x17f6('0x34'),_0x17f6('0x37'),'active']},{'model':_0x17f6('0x38'),'as':_0x17f6('0x38'),'attributes':['id',_0x17f6('0x34')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x17f6('0x34'),_0x17f6('0x39')]}]}]},'log':_0x17f6('0x1')});};}; \ No newline at end of file +var _0x2e5e=['acwTimeout','monitor_format','dialActive','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','name','acw'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2e5e,0x15e));var _0xe2e5=function(_0x30f90d,_0x1bd891){_0x30f90d=_0x30f90d-0x0;var _0x531787=_0x2e5e[_0x30f90d];return _0x531787;};'use strict';var client=require(_0xe2e5('0x0'));exports[_0xe2e5('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x3'),_0xe2e5('0x4'),'autopause',_0xe2e5('0x5'),'type',_0xe2e5('0x6'),'dialMethod','dialLimitChannel',_0xe2e5('0x7'),'dialPowerLevel','dialPredictiveOptimization',_0xe2e5('0x8'),_0xe2e5('0x9'),_0xe2e5('0xa'),_0xe2e5('0xb'),_0xe2e5('0xc'),'dialQueueOptions',_0xe2e5('0xd'),_0xe2e5('0xe'),_0xe2e5('0xf'),'dialCongestionRetryFrequency',_0xe2e5('0x10'),'dialBusyRetryFrequency',_0xe2e5('0x11'),_0xe2e5('0x12'),'dialGlobalMaxRetry',_0xe2e5('0x13'),_0xe2e5('0x14'),_0xe2e5('0x15'),_0xe2e5('0x16'),_0xe2e5('0x17'),_0xe2e5('0x18'),_0xe2e5('0x19'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xe2e5('0x1a'),_0xe2e5('0x1b'),_0xe2e5('0x1c'),_0xe2e5('0x1d'),'dialAMDMaximumWordLength',_0xe2e5('0x1e'),_0xe2e5('0x1f'),_0xe2e5('0x20'),_0xe2e5('0x21'),'dialAgiAfterHangupAgent',_0xe2e5('0x22'),'dialQueueProject2',_0xe2e5('0x5'),'strategy',_0xe2e5('0x23'),_0xe2e5('0x24'),_0xe2e5('0x25'),_0xe2e5('0x26'),_0xe2e5('0x27'),_0xe2e5('0x28'),_0xe2e5('0x29'),_0xe2e5('0x2a'),_0xe2e5('0x2b'),_0xe2e5('0x2c'),_0xe2e5('0x2d'),_0xe2e5('0x2e'),_0xe2e5('0x2f'),'dialPredictiveIntervalMaxThreshold',_0xe2e5('0x30'),_0xe2e5('0x31'),_0xe2e5('0x32'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0xe2e5('0x33'),'as':_0xe2e5('0x33'),'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x34'),_0xe2e5('0x35')]},{'model':_0xe2e5('0x36'),'as':_0xe2e5('0x37'),'attributes':['id',_0xe2e5('0x2')]},{'model':_0xe2e5('0x33'),'as':_0xe2e5('0x38'),'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x34'),_0xe2e5('0x35')]},{'model':_0xe2e5('0x39'),'as':_0xe2e5('0x39'),'attributes':['id',_0xe2e5('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xe2e5('0x3a')]}]}]},'log':_0xe2e5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 69a4dab..a84f4c6 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(_0x142a73,_0x3a2aac){var _0x2da1a4=function(_0x4eb148){while(--_0x4eb148){_0x142a73['push'](_0x142a73['shift']());}};_0x2da1a4(++_0x3a2aac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x2b8d15,_0x6bc740){var _0x42a035=function(_0x2d1772){while(--_0x2d1772){_0x2b8d15['push'](_0x2b8d15['shift']());}};_0x42a035(++_0x6bc740);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 0680dec..5c36092 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 _0xb454=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x18e0f5,_0x1791ff){var _0x4f8873=function(_0x23e4db){while(--_0x23e4db){_0x18e0f5['push'](_0x18e0f5['shift']());}};_0x4f8873(++_0x1791ff);}(_0xb454,0x1ed));var _0x4b45=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xb454[_0x4bd06e];return _0x85ebb;};'use strict';var client=require('../client');exports[_0x4b45('0x0')]=function(_0x3ceb1f){return function(){return client[_0x4b45('0x1')](_0x4b45('0x2'),{'options':{'where':{'VoiceQueueId':_0x3ceb1f,'paused':!![]},'raw':!![]},'log':_0x4b45('0x0')});};}; \ No newline at end of file +var _0xa2fa=['Request','getVoiceQueueRtPauses'];(function(_0x13e9e1,_0x4f07d2){var _0x5d449e=function(_0xe7d108){while(--_0xe7d108){_0x13e9e1['push'](_0x13e9e1['shift']());}};_0x5d449e(++_0x4f07d2);}(_0xa2fa,0x183));var _0xaa2f=function(_0x1b1aee,_0x57c8ed){_0x1b1aee=_0x1b1aee-0x0;var _0x276aa2=_0xa2fa[_0x1b1aee];return _0x276aa2;};'use strict';var client=require('../client');exports[_0xaa2f('0x0')]=function(_0x5e7ffe){return function(){return client[_0xaa2f('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5e7ffe,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 75bf314..db1146f 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(_0x42c368,_0x3453d7){var _0x5e17eb=function(_0x2a991d){while(--_0x2a991d){_0x42c368['push'](_0x42c368['shift']());}};_0x5e17eb(++_0x3453d7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x4ba791,_0x4d43f3){var _0x20338f=function(_0x2c726e){while(--_0x2c726e){_0x4ba791['push'](_0x4ba791['shift']());}};_0x20338f(++_0x4d43f3);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4676,_0x4c299e){_0x4d4676=_0x4d4676-0x0;var _0x2d24fa=_0x7a54[_0x4d4676];return _0x2d24fa;};'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 fe7159c..179b5f0 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 _0x4879=['transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','attended','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename'];(function(_0x340916,_0x2b1417){var _0x489be0=function(_0x43a51a){while(--_0x43a51a){_0x340916['push'](_0x340916['shift']());}};_0x489be0(++_0x2b1417);}(_0x4879,0x17f));var _0x9487=function(_0x3e2f54,_0x3e695d){_0x3e2f54=_0x3e2f54-0x0;var _0x422ac7=_0x4879[_0x3e2f54];return _0x422ac7;};'use strict';var client=require('../client');exports[_0x9487('0x0')]={};exports[_0x9487('0x1')]=function(_0x40aae1){return client['Request'](_0x9487('0x2'),{'body':{'result':_0x40aae1[_0x9487('0x3')],'transfererchannel':_0x40aae1[_0x9487('0x4')],'transferercalleridnum':_0x40aae1[_0x9487('0x5')],'transferercalleridname':_0x40aae1[_0x9487('0x6')],'transfererconnectedlinenum':_0x40aae1['transfererconnectedlinenum'],'transfererconnectedlinename':_0x40aae1['transfererconnectedlinename'],'transfereraccountcode':_0x40aae1[_0x9487('0x7')],'transferercontext':_0x40aae1[_0x9487('0x8')],'transfererexten':_0x40aae1['transfererexten'],'transfererlinkedid':_0x40aae1[_0x9487('0x9')],'transfereechannel':_0x40aae1[_0x9487('0xa')],'transfereecalleridnum':_0x40aae1['transfereecalleridnum'],'transfereecalleridname':_0x40aae1[_0x9487('0xb')],'transfereeconnectedlinenum':_0x40aae1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x40aae1[_0x9487('0xc')],'transfereeaccountcode':_0x40aae1[_0x9487('0xd')],'transfereecontext':_0x40aae1[_0x9487('0xe')],'transfereeexten':_0x40aae1[_0x9487('0xf')],'transfereelinkedid':_0x40aae1[_0x9487('0x10')],'isexternal':_0x40aae1[_0x9487('0x11')],'context':_0x40aae1[_0x9487('0x12')],'extension':_0x40aae1[_0x9487('0x13')],'type':'blind'},'log':_0x9487('0x2')});};exports[_0x9487('0x14')]=function(_0x532308){return client[_0x9487('0x15')](_0x9487('0x2'),{'body':{'result':_0x532308[_0x9487('0x3')],'transfererchannel':_0x532308[_0x9487('0x16')],'transferercalleridnum':_0x532308['origtransferercalleridnum'],'transferercalleridname':_0x532308[_0x9487('0x17')],'transfererconnectedlinenum':_0x532308['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x532308[_0x9487('0x18')],'transfereraccountcode':_0x532308[_0x9487('0x19')],'transferercontext':_0x532308[_0x9487('0x1a')],'transfererexten':_0x532308[_0x9487('0x1b')],'transfererlinkedid':_0x532308['origtransfererlinkedid'],'transfereechannel':_0x532308[_0x9487('0x1c')],'transfereecalleridnum':_0x532308[_0x9487('0x1d')],'transfereecalleridname':_0x532308[_0x9487('0x1e')],'transfereeconnectedlinenum':_0x532308[_0x9487('0x1f')],'transfereeconnectedlinename':_0x532308[_0x9487('0x20')],'transfereeaccountcode':_0x532308['transfertargetaccountcode'],'transfereecontext':_0x532308['transfertargetcontext'],'transfereeexten':_0x532308[_0x9487('0x21')],'transfereelinkedid':_0x532308[_0x9487('0x22')],'isexternal':_0x532308['isexternal'],'context':_0x532308['origtransferercontext'],'extension':_0x532308['origtransfererexten'],'type':_0x9487('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x9eaf=['blindTransfer','Request','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','result','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers'];(function(_0x2b36c7,_0x43df68){var _0x107d7f=function(_0x24fd25){while(--_0x24fd25){_0x2b36c7['push'](_0x2b36c7['shift']());}};_0x107d7f(++_0x43df68);}(_0x9eaf,0x19e));var _0xf9ea=function(_0x53292b,_0x115f47){_0x53292b=_0x53292b-0x0;var _0x45a180=_0x9eaf[_0x53292b];return _0x45a180;};'use strict';var client=require(_0xf9ea('0x0'));exports[_0xf9ea('0x1')]={};exports[_0xf9ea('0x2')]=function(_0x2c4d24){return client[_0xf9ea('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2c4d24['result'],'transfererchannel':_0x2c4d24['transfererchannel'],'transferercalleridnum':_0x2c4d24['transferercalleridnum'],'transferercalleridname':_0x2c4d24['transferercalleridname'],'transfererconnectedlinenum':_0x2c4d24[_0xf9ea('0x4')],'transfererconnectedlinename':_0x2c4d24[_0xf9ea('0x5')],'transfereraccountcode':_0x2c4d24[_0xf9ea('0x6')],'transferercontext':_0x2c4d24['transferercontext'],'transfererexten':_0x2c4d24['transfererexten'],'transfererlinkedid':_0x2c4d24['transfererlinkedid'],'transfereechannel':_0x2c4d24['transfereechannel'],'transfereecalleridnum':_0x2c4d24['transfereecalleridnum'],'transfereecalleridname':_0x2c4d24[_0xf9ea('0x7')],'transfereeconnectedlinenum':_0x2c4d24[_0xf9ea('0x8')],'transfereeconnectedlinename':_0x2c4d24['transfereeconnectedlinename'],'transfereeaccountcode':_0x2c4d24[_0xf9ea('0x9')],'transfereecontext':_0x2c4d24[_0xf9ea('0xa')],'transfereeexten':_0x2c4d24[_0xf9ea('0xb')],'transfereelinkedid':_0x2c4d24[_0xf9ea('0xc')],'isexternal':_0x2c4d24[_0xf9ea('0xd')],'context':_0x2c4d24[_0xf9ea('0xe')],'extension':_0x2c4d24['extension'],'type':_0xf9ea('0xf')},'log':_0xf9ea('0x10')});};exports[_0xf9ea('0x11')]=function(_0x362b79){return client[_0xf9ea('0x3')](_0xf9ea('0x10'),{'body':{'result':_0x362b79[_0xf9ea('0x12')],'transfererchannel':_0x362b79['origtransfererchannel'],'transferercalleridnum':_0x362b79['origtransferercalleridnum'],'transferercalleridname':_0x362b79['origtransferercalleridname'],'transfererconnectedlinenum':_0x362b79[_0xf9ea('0x13')],'transfererconnectedlinename':_0x362b79['secondtransfererconnectedlinename'],'transfereraccountcode':_0x362b79[_0xf9ea('0x14')],'transferercontext':_0x362b79[_0xf9ea('0x15')],'transfererexten':_0x362b79['secondtransfererexten'],'transfererlinkedid':_0x362b79[_0xf9ea('0x16')],'transfereechannel':_0x362b79[_0xf9ea('0x17')],'transfereecalleridnum':_0x362b79[_0xf9ea('0x18')],'transfereecalleridname':_0x362b79['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x362b79[_0xf9ea('0x19')],'transfereeconnectedlinename':_0x362b79[_0xf9ea('0x1a')],'transfereeaccountcode':_0x362b79['transfertargetaccountcode'],'transfereecontext':_0x362b79[_0xf9ea('0x1b')],'transfereeexten':_0x362b79[_0xf9ea('0x1c')],'transfereelinkedid':_0x362b79[_0xf9ea('0x1d')],'isexternal':_0x362b79['isexternal'],'context':_0x362b79[_0xf9ea('0x1e')],'extension':_0x362b79['origtransfererexten'],'type':_0xf9ea('0x1f')},'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 d2c6a1a..bdaad96 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 _0x94d2=['queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','validate','moment','../../../config/environment','../properties','format','%s/%s','SIP','timers','timer','agents','updateStatusRealtime','pause','error','username','ami\x20disconnected','join','pick','module','message','catch','isConnected','asterisk','command','action','Command','Action','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','channel','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','%s.%s','stop'];(function(_0xac9bb8,_0x4c1343){var _0x8c7c24=function(_0x55e70c){while(--_0x55e70c){_0xac9bb8['push'](_0xac9bb8['shift']());}};_0x8c7c24(++_0x4c1343);}(_0x94d2,0x1cd));var _0x294d=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x94d2[_0x622035];return _0x326cf2;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x294d('0x0'));var schema=require(_0x294d('0x1'));var moment=require(_0x294d('0x2'));var config=require(_0x294d('0x3'));var properties=require(_0x294d('0x4'));var ami=require('../ami');exports['listen']=function(_0x2f2fc8,_0x393430,_0xb2c63a){return new Promise(function(_0x234700,_0x279b9b){var _0x5e023f={'QueuePause':function(_0x5c3d7c){return new Promise(function(_0x2cf111){var _0x6653fc=util[_0x294d('0x5')](_0x294d('0x6'),_0x294d('0x7'),_0x5c3d7c['name']);if(_0x2f2fc8[_0x294d('0x8')]&&_0x2f2fc8[_0x294d('0x8')][_0x6653fc]&&_0x2f2fc8['timers'][_0x6653fc][_0x294d('0x9')]){_0x2f2fc8[_0x294d('0x8')][_0x6653fc]['updateAcw']();}if(_0x2f2fc8['agents'][_0x6653fc]){_0x2f2fc8[_0x294d('0xa')][_0x6653fc][_0x294d('0xb')]({'statePause':_0x5c3d7c[_0x294d('0xc')]?!![]:![]});}_0x2cf111({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3d44ba){var _0x3f0f3a=this;return new Promise(function(_0x4119da,_0x28066d){if(ami['isConnected']()==![]){return _0x28066d(_0x3f0f3a[_0x294d('0xd')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x294d('0xe')],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}_0x3d44ba=_[_0x294d('0x11')](_0x3d44ba,_['keys'](properties[_0x294d('0x12')]));_0x3d44ba['action']='Reload';return ami['Action'](_0x3d44ba)['then'](function(_0x113d56){_0x4119da({'code':0xc8,'message':_0x113d56[_0x294d('0x13')]});})[_0x294d('0x14')](function(_0x46d9c5){_0x28066d(_0x3f0f3a[_0x294d('0xd')](0x1f5,_0x46d9c5[_0x294d('0x13')]));});});},'Command':function(_0x199a1a){var _0x9a7c6a=this;return new Promise(function(_0x59f569,_0x3ccc78){if(ami[_0x294d('0x15')]()==![]){return _0x3ccc78(_0x9a7c6a['error'](0x1f4,[config[_0x294d('0x16')]['ip'],config[_0x294d('0x16')][_0x294d('0xe')],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}_0x199a1a=_[_0x294d('0x11')](_0x199a1a,_0x294d('0x17'));_0x199a1a[_0x294d('0x18')]=_0x294d('0x19');return ami[_0x294d('0x1a')](_0x199a1a)[_0x294d('0x1b')](function(_0xff3d5e){_0x59f569({'code':0xc8,'message':_0xff3d5e[_0x294d('0x1c')]});})[_0x294d('0x14')](function(_0x4aa60){_0x3ccc78(_0x9a7c6a['error'](0x1f5,_0x4aa60['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x3795e9){var _0x351c06=[];for(var _0x10fb2e in _0x2f2fc8[_0x294d('0x1d')]){if(_0x2f2fc8[_0x294d('0x1d')][_0x294d('0x1e')](_0x10fb2e)){var _0x4da072=_0x2f2fc8[_0x294d('0x1d')][_0x10fb2e];var _0x5cac01={'id':_0x4da072['id'],'name':_0x4da072[_0x294d('0x1f')],'strategy':_0x4da072[_0x294d('0x20')],'answered':_0x4da072[_0x294d('0x21')],'available':_0x4da072[_0x294d('0x22')],'loggedIn':_0x4da072[_0x294d('0x23')],'pTalking':_0x4da072[_0x294d('0x24')],'sumBillable':_0x4da072[_0x294d('0x25')],'sumDuration':_0x4da072['sumDuration'],'sumHoldTime':_0x4da072[_0x294d('0x26')]||0x0,'talking':_0x4da072[_0x294d('0x27')],'total':_0x4da072[_0x294d('0x28')],'type':_0x4da072[_0x294d('0x29')],'unmanaged':_0x4da072[_0x294d('0x2a')],'abandoned':_0x4da072[_0x294d('0x2b')],'waiting':_0x4da072[_0x294d('0x2c')],'loggedInDb':_0x4da072[_0x294d('0x2d')]};if(_0x4da072['type']===_0x294d('0x2e')){_0x5cac01[_0x294d('0x2f')]=_0x4da072[_0x294d('0x2f')];_0x5cac01[_0x294d('0x30')]=_0x4da072['dialMethod'];_0x5cac01['dialOriginateCallerIdName']=_0x4da072[_0x294d('0x31')];_0x5cac01[_0x294d('0x32')]=_0x4da072[_0x294d('0x32')];_0x5cac01[_0x294d('0x33')]=_0x4da072[_0x294d('0x33')];_0x5cac01[_0x294d('0x34')]=_0x4da072[_0x294d('0x34')];_0x5cac01[_0x294d('0x35')]=_0x4da072[_0x294d('0x35')];_0x5cac01['outboundAnswerAgiCallsDay']=_0x4da072[_0x294d('0x36')];_0x5cac01[_0x294d('0x37')]=_0x4da072[_0x294d('0x37')];_0x5cac01['outboundBlacklistCallsDay']=_0x4da072[_0x294d('0x38')];_0x5cac01[_0x294d('0x39')]=_0x4da072['outboundBusyCallsDay'];_0x5cac01[_0x294d('0x3a')]=_0x4da072[_0x294d('0x3a')];_0x5cac01['outboundDropCallsDayACS']=_0x4da072['outboundDropCallsDayACS'];_0x5cac01[_0x294d('0x3b')]=_0x4da072[_0x294d('0x3b')];_0x5cac01[_0x294d('0x3c')]=_0x4da072['outboundDropCallsDayTimeout'];_0x5cac01[_0x294d('0x3d')]=_0x4da072[_0x294d('0x3d')];_0x5cac01[_0x294d('0x3e')]=_0x4da072[_0x294d('0x3e')];_0x5cac01[_0x294d('0x3f')]=_0x4da072[_0x294d('0x3f')];_0x5cac01[_0x294d('0x40')]=_0x4da072[_0x294d('0x40')];_0x5cac01[_0x294d('0x41')]=_0x4da072[_0x294d('0x41')];_0x5cac01[_0x294d('0x42')]=_0x4da072[_0x294d('0x42')];_0x5cac01['predictiveIntervalAnsweredCalls']=_0x4da072[_0x294d('0x43')];_0x5cac01[_0x294d('0x44')]=_0x4da072[_0x294d('0x44')];_0x5cac01['predictiveIntervalAvgTalktime']=_0x4da072[_0x294d('0x45')];_0x5cac01[_0x294d('0x46')]=_0x4da072[_0x294d('0x46')];_0x5cac01[_0x294d('0x47')]=_0x4da072['predictiveIntervalDroppedCallsTimeout'];_0x5cac01[_0x294d('0x48')]=_0x4da072[_0x294d('0x48')];_0x5cac01[_0x294d('0x49')]=_0x4da072['predictiveIntervalErlangCallsDroppedCalls'];_0x5cac01[_0x294d('0x4a')]=_0x4da072[_0x294d('0x4a')];_0x5cac01[_0x294d('0x4b')]=_0x4da072['predictiveIntervalMultiplicativeFactor'];_0x5cac01[_0x294d('0x4c')]=_0x4da072[_0x294d('0x4c')];_0x5cac01[_0x294d('0x4d')]=_0x4da072[_0x294d('0x4d')];_0x5cac01[_0x294d('0x4e')]=_0x4da072[_0x294d('0x4e')];_0x5cac01[_0x294d('0x13')]=_0x4da072[_0x294d('0x13')];_0x5cac01[_0x294d('0x4f')]=_0x4da072[_0x294d('0x4f')];_0x5cac01[_0x294d('0x50')]=_0x4da072[_0x294d('0x50')];_0x5cac01[_0x294d('0x51')]=_0x4da072[_0x294d('0x51')];_0x5cac01[_0x294d('0x52')]=_0x4da072[_0x294d('0x52')];_0x5cac01[_0x294d('0x53')]=_0x4da072[_0x294d('0x53')];_0x5cac01['startPredictive']=_0x4da072[_0x294d('0x54')];_0x5cac01[_0x294d('0x55')]=_0x4da072[_0x294d('0x55')];}if(_0x4da072['Trunk']){_0x5cac01[_0x294d('0x56')]={'id':_0x4da072[_0x294d('0x56')]['id'],'name':_0x4da072['Trunk'][_0x294d('0x1f')],'active':_0x4da072[_0x294d('0x56')][_0x294d('0x57')],'callerid':_0x4da072['Trunk'][_0x294d('0x58')]};}if(_0x4da072[_0x294d('0x59')]){_0x5cac01[_0x294d('0x59')]={'id':_0x4da072[_0x294d('0x59')]['id'],'name':_0x4da072[_0x294d('0x59')][_0x294d('0x1f')]};}_0x351c06['push'](_0x5cac01);}}_0x3795e9({'count':_0x351c06['length'],'rows':_0x351c06});});},'UpdateVoiceQueue':function(_0x53faab){return new Promise(function(_0x38a2cf,_0x41e64e){var _0x1cfd4c=_[_0x294d('0x5a')](_0x2f2fc8[_0x294d('0x1d')],{'id':parseInt(_0x53faab['id'])});var _0x5334f4=_[_0x294d('0x5b')](_0x53faab,['id']);if(_0x1cfd4c){for(var _0x561a9d in _0x5334f4){if(typeof _0x5334f4[_0x561a9d]!=='undefined'&&typeof _0x1cfd4c[_0x561a9d]!==_0x294d('0x5c')){_0x1cfd4c[_0x561a9d]=_0x5334f4[_0x561a9d];}}_0x38a2cf(_0x1cfd4c);}else{_0x41e64e();}});},'VoiceChannels':function(){return new Promise(function(_0x2c8eec){var _0x28c100=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x5e')]);_0x2c8eec({'count':_0x28c100[_0x294d('0x5f')],'rows':_0x28c100});});},'VoiceChannelMixMonitor':function(_0x1bb8b8){var _0x4f8a92=this;return new Promise(function(_0x56d7ec,_0x4f86c4){if(ami['isConnected']()==![]){return _0x4f86c4(_0x4f8a92[_0x294d('0xd')](0x1f4,[config[_0x294d('0x16')]['ip'],config[_0x294d('0x16')][_0x294d('0xe')],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}var _0x160904=schema(properties[_0x294d('0x60')])[_0x294d('0x1')](_0x1bb8b8);if(_0x160904[_0x294d('0x5f')]>0x0){return _0x4f86c4(_0x4f8a92[_0x294d('0xd')](0x1f4,_['map'](_0x160904,_0x294d('0x13'))[_0x294d('0x10')](',\x20')));}var _0x41c71f=_[_0x294d('0x5a')](_0x2f2fc8[_0x294d('0x5e')],{'uniqueid':_0x1bb8b8['uniqueid']});if(_0x41c71f&&_0x41c71f[_0x294d('0x61')]){var _0x26755d=util[_0x294d('0x5')]('%s.%s',_0x1bb8b8[_0x294d('0x62')]||_0x1bb8b8[_0x294d('0x63')],_0x1bb8b8[_0x294d('0x5')]||_0x294d('0x64'));return ami['Action']({'action':_0x294d('0x65'),'channel':_0x41c71f[_0x294d('0x61')],'file':_0x26755d,'options':_0x294d('0x66')})['then'](function(_0x43486e){var _0x413d50=_['find'](_0x41c71f['monitors'],{'filename':_0x294d('0x67')+_0x26755d[_0x294d('0x68')]()});if(_[_0x294d('0x69')](_0x413d50)){_0x41c71f[_0x294d('0x6a')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x26755d[_0x294d('0x68')](),'createdAt':moment()['format'](_0x294d('0x6b')),'mixmonitorid':_0x43486e[_0x294d('0x6c')],'status':_0x294d('0x6d')});}else{_0x413d50[_0x294d('0x6c')]=_0x43486e[_0x294d('0x6c')];_0x413d50[_0x294d('0x6e')]=_0x294d('0x6d');}_0x56d7ec({'code':0xc8,'message':[_0x1bb8b8['uniqueid'],_0x294d('0x6f'),_0x43486e[_0x294d('0x6c')]][_0x294d('0x10')]('\x20'),'mixmonitorid':_0x43486e[_0x294d('0x6c')]});})[_0x294d('0x14')](function(_0x4c4cf1){_0x4f86c4(_0x4f8a92[_0x294d('0xd')](0x1f5,[_0x1bb8b8['uniqueid'],_0x4c4cf1[_0x294d('0x13')][_0x294d('0x68')]()]['join']('\x20')));});}else{return _0x4f86c4(_0x4f8a92[_0x294d('0xd')](0x1f5,_0x294d('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x467216){var _0x31785c=this;return new Promise(function(_0x395c5a,_0x49780c){if(ami['isConnected']()==![]){return _0x49780c(_0x31785c[_0x294d('0xd')](0x1f4,[config[_0x294d('0x16')]['ip'],config[_0x294d('0x16')][_0x294d('0xe')],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}var _0x33c5ce=schema(properties[_0x294d('0x60')])['validate'](_0x467216);if(_0x33c5ce[_0x294d('0x5f')]>0x0){return _0x49780c(_0x31785c[_0x294d('0xd')](0x1f4,_[_0x294d('0x71')](_0x33c5ce,'message')[_0x294d('0x10')](',\x20')));}var _0x80d297=_[_0x294d('0x5a')](_0x2f2fc8[_0x294d('0x5e')],{'uniqueid':_0x467216['uniqueid']});if(_0x80d297){return Promise[_0x294d('0x72')]()[_0x294d('0x1b')](function(){if(_0x80d297['channel']){return ami[_0x294d('0x1a')]({'action':'StopMixMonitor','channel':_0x80d297['channel'],'mixmonitorid':_0x467216[_0x294d('0x6c')]})['catch'](function(){});}})['then'](function(){if(_0x80d297[_0x294d('0x73')]){return ami['Action']({'action':_0x294d('0x74'),'channel':_0x80d297['destinationchannel'],'mixmonitorid':_0x467216[_0x294d('0x6c')]})[_0x294d('0x14')](function(){});}})[_0x294d('0x1b')](function(){var _0x431543=_[_0x294d('0x5a')](_0x80d297[_0x294d('0x6a')],{'mixmonitorid':_0x467216['mixmonitorid']});if(_0x431543){_0x431543['status']='stop';}})['then'](function(){var _0x5786f8=util[_0x294d('0x5')](_0x294d('0x75'),_0x467216[_0x294d('0x62')]||_0x467216['uniqueid'],_0x467216['format']||'wav');var _0x45fde1=_[_0x294d('0x5a')](_0x80d297[_0x294d('0x6a')],{'filename':_0x294d('0x67')+_0x5786f8[_0x294d('0x68')]()});if(_0x45fde1){_0x45fde1[_0x294d('0x6e')]=_0x294d('0x76');}})[_0x294d('0x1b')](function(){_0x395c5a({'code':0xc8,'message':[_0x467216[_0x294d('0x63')],'StopMixMonitor\x20Success'][_0x294d('0x10')]('\x20')});})[_0x294d('0x14')](function(_0x20abb0){_0x49780c(_0x31785c[_0x294d('0xd')](0x1f5,[_0x467216[_0x294d('0x63')],_0x20abb0[_0x294d('0x13')][_0x294d('0x68')]()][_0x294d('0x10')]('\x20')));});}else{return _0x49780c(_0x31785c[_0x294d('0xd')](0x1f5,_0x294d('0x70')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x5374d3){var _0x21cca3=_['values'](_0x2f2fc8[_0x294d('0x77')]);_0x5374d3({'count':_0x21cca3[_0x294d('0x5f')],'rows':_0x21cca3});});},'VoiceQueuesChannel':function(_0x4f519b){var _0x3f60f0=this;return new Promise(function(_0x1e0d93,_0x5d5981){var _0x49b287=schema(properties[_0x294d('0x78')])['validate'](_0x4f519b);if(_0x49b287['length']>0x0){return _0x5d5981(_0x3f60f0['error'](0x1f4,_[_0x294d('0x71')](_0x49b287,_0x294d('0x13'))[_0x294d('0x10')](',\x20')));}var _0x488a2b=_['find'](_0x2f2fc8['queueChannels'],{'uniqueid':_0x4f519b['uniqueid']});if(_0x488a2b){_0x1e0d93(_0x488a2b);}else{return _0x5d5981(_0x3f60f0[_0x294d('0xd')](0x1f5,_0x294d('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x4070d1){var _0x3b360b=this;return new Promise(function(_0x3af622,_0x4ee8aa){if(ami[_0x294d('0x15')]()==![]){return _0x4ee8aa(_0x3b360b[_0x294d('0xd')](0x1f4,[config[_0x294d('0x16')]['ip'],config[_0x294d('0x16')]['username'],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}var _0x1f64c2=schema(properties[_0x294d('0x79')])[_0x294d('0x1')](_0x4070d1);if(_0x1f64c2[_0x294d('0x5f')]>0x0){return _0x4ee8aa(_0x3b360b[_0x294d('0xd')](0x1f4,_[_0x294d('0x71')](_0x1f64c2,_0x294d('0x13'))[_0x294d('0x10')](',\x20')));}var _0x11b989=_[_0x294d('0x5a')](_0x2f2fc8[_0x294d('0x77')],{'uniqueid':_0x4070d1['uniqueid']});if(_0x11b989&&_0x11b989[_0x294d('0x61')]){return ami[_0x294d('0x1a')]({'action':_0x294d('0x7a'),'channel':_0x11b989['channel']})[_0x294d('0x1b')](function(_0x58713e){_0x3af622({'code':0xc8,'message':[_0x4070d1[_0x294d('0x63')],_0x58713e[_0x294d('0x13')][_0x294d('0x68')]()][_0x294d('0x10')]('\x20')});})['catch'](function(_0x5780cd){_0x4ee8aa(_0x3b360b['error'](0x1f5,[_0x4070d1[_0x294d('0x63')],_0x5780cd['message'][_0x294d('0x68')]()][_0x294d('0x10')]('\x20')));});}else{return _0x4ee8aa(_0x3b360b[_0x294d('0xd')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1a3914){var _0x3d83e6=this;return new Promise(function(_0x2b199e,_0x2da5a7){if(ami[_0x294d('0x15')]()==![]){return _0x2da5a7(_0x3d83e6[_0x294d('0xd')](0x1f4,[config[_0x294d('0x16')]['ip'],config['asterisk'][_0x294d('0xe')],_0x294d('0xf')][_0x294d('0x10')]('\x20')));}var _0x7bb5cf=schema(properties[_0x294d('0x7b')])[_0x294d('0x1')](_0x1a3914);if(_0x7bb5cf[_0x294d('0x5f')]>0x0){return _0x2da5a7(_0x3d83e6[_0x294d('0xd')](0x1f4,_[_0x294d('0x71')](_0x7bb5cf,_0x294d('0x13'))[_0x294d('0x10')](',\x20')));}var _0x40f56a=_[_0x294d('0x5a')](_0x2f2fc8[_0x294d('0x77')],{'uniqueid':_0x1a3914[_0x294d('0x63')]});if(_0x40f56a&&_0x40f56a[_0x294d('0x61')]){return ami[_0x294d('0x1a')]({'action':_0x294d('0x7c'),'channel':_0x40f56a['channel'],'exten':_0x1a3914[_0x294d('0x7d')],'context':_0x1a3914['context']||_0x40f56a[_0x294d('0x7e')],'priority':0x1})[_0x294d('0x1b')](function(_0x2a6ca6){_0x2b199e({'code':0xc8,'message':[_0x1a3914['uniqueid'],_0x2a6ca6[_0x294d('0x13')]['toLowerCase']()][_0x294d('0x10')]('\x20')});})['catch'](function(_0x2de50e){_0x2da5a7(_0x3d83e6['error'](0x1f5,[_0x1a3914[_0x294d('0x63')],_0x2de50e[_0x294d('0x13')][_0x294d('0x68')]()]['join']('\x20')));});}else{return _0x2da5a7(_0x3d83e6[_0x294d('0xd')](0x1f5,_0x294d('0x70')));}});},'Agents':function(_0x24cedc){return new Promise(function(_0x587d3a){var _0x2a1e7f=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0xa')]);if(_0x24cedc&&_0x24cedc['id']){var _0x3ac734=_['find'](_0x2a1e7f,function(_0x2695e0){return _0x2695e0['id']===_0x24cedc['id'];});_0x587d3a(_0x3ac734);}else{_0x587d3a({'count':_0x2a1e7f[_0x294d('0x5f')],'rows':_0x2a1e7f});}});},'Telephones':function(){return new Promise(function(_0x28783e){var _0x318539=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x7f')]);_0x28783e({'count':_0x318539['length'],'rows':_0x318539});});},'Trunks':function(){return new Promise(function(_0x5ae6f9){var _0x541025=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x80')]);_0x5ae6f9({'count':_0x541025[_0x294d('0x5f')],'rows':_0x541025});});},'OutboundChannels':function(){return new Promise(function(_0x4e3742){var _0x191eaf=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x81')]);_0x4e3742({'count':_0x191eaf[_0x294d('0x5f')],'rows':_0x191eaf});});},'Outbound':function(){return new Promise(function(_0x56a965){_0x56a965(_0x2f2fc8[_0x294d('0x2e')]);});},'Campaigns':function(){return new Promise(function(_0x51f8e6){var _0x2684fa=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x82')]);_0x51f8e6({'count':_0x2684fa['length'],'rows':_0x2684fa});});},'VoiceQueuesPreview':function(_0x367f4e){var _0xa275dd=this;return new Promise(function(_0xa0a91c,_0x4c827e){_0x393430[_0x294d('0x83')](_0x367f4e['id'])[_0x294d('0x1b')](function(_0x11b6b9){_0xa0a91c({'code':0xc8,'message':_0x11b6b9[_0x294d('0x13')]});})['catch'](function(_0x56adee){_0x4c827e(_0xa275dd[_0x294d('0xd')](0x1f4,_0x56adee[_0x294d('0x13')]));});});},'EventManager':function(_0x205c17){var _0x203052=this;return new Promise(function(_0x3fd925,_0x303b12){if(!_0x205c17[_0x294d('0x84')]){return _0x303b12(_0x203052[_0x294d('0xd')](0x1f4,_0x294d('0x85')));}ami[_0x294d('0x86')](_0x294d('0x87')+_0x205c17[_0x294d('0x84')],_0x205c17[_0x294d('0x13')]);_0x3fd925({'code':0xc8,'message':_0x205c17});});},'FaxAccounts':function(){return new Promise(function(_0x2d32a9){var _0x479fd1=_[_0x294d('0x5d')](_0x2f2fc8[_0x294d('0x88')]);_0x2d32a9({'count':_0x479fd1[_0x294d('0x5f')],'rows':_0x479fd1});});},'SendFax':function(_0x541c8d){var _0x4819a7=this;return new Promise(function(_0x4d88a4,_0x114010){_0xb2c63a[_0x294d('0x89')](_0x541c8d)[_0x294d('0x1b')](function(_0x2a3267){_0x4d88a4({'code':0xc8,'message':_0x2a3267[_0x294d('0x13')]});})[_0x294d('0x14')](function(_0x56920f){_0x114010(_0x4819a7[_0x294d('0xd')](0x1f4,_0x56920f[_0x294d('0x13')]));});});},'CheckAfterSend':function(_0x453205){var _0x377ae6=this;return new Promise(function(_0x24c5b3,_0x48dfe7){_0xb2c63a[_0x294d('0x8a')](_0x453205)[_0x294d('0x1b')](function(_0x1c01bf){_0x24c5b3({'code':0xc8,'message':_0x1c01bf[_0x294d('0x13')]});})['catch'](function(_0xca9307){_0x48dfe7(_0x377ae6[_0x294d('0xd')](0x1f4,_0xca9307['message']));});});}};var _0x3e253a=jayson[_0x294d('0x8b')](_0x5e023f)[_0x294d('0x8c')]();_0x3e253a['on'](_0x294d('0xd'),function(_0x137384){return _0x279b9b(_0x137384);});_0x3e253a['listen'](0x232a,_0x294d('0x8d'),function(){console[_0x294d('0x8e')](_0x294d('0x8f'),0x232a);return _0x234700(_0x294d('0x90')+0x232a);});});}; \ No newline at end of file +var _0x0c5d=['available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','then','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','../../../config/environment','../properties','../ami','listen','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','catch','error','message','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered'];(function(_0x3178f0,_0x28ae98){var _0x26ddf1=function(_0x25d90e){while(--_0x25d90e){_0x3178f0['push'](_0x3178f0['shift']());}};_0x26ddf1(++_0x28ae98);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x1e33f8,_0x18e3bd){_0x1e33f8=_0x1e33f8-0x0;var _0x346811=_0x0c5d[_0x1e33f8];return _0x346811;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var jayson=require('jayson/promise');var schema=require(_0xd0c5('0x2'));var moment=require('moment');var config=require(_0xd0c5('0x3'));var properties=require(_0xd0c5('0x4'));var ami=require(_0xd0c5('0x5'));exports[_0xd0c5('0x6')]=function(_0x4664bc,_0xc3a9b9,_0x166636){return new Promise(function(_0x121911,_0x569992){var _0x2ef2f6={'QueuePause':function(_0x518801){return new Promise(function(_0x47f0f4){var _0x365e04=util['format']('%s/%s',_0xd0c5('0x7'),_0x518801[_0xd0c5('0x8')]);if(_0x4664bc['timers']&&_0x4664bc[_0xd0c5('0x9')][_0x365e04]&&_0x4664bc[_0xd0c5('0x9')][_0x365e04]['timer']){_0x4664bc[_0xd0c5('0x9')][_0x365e04][_0xd0c5('0xa')]();}if(_0x4664bc[_0xd0c5('0xb')][_0x365e04]){_0x4664bc[_0xd0c5('0xb')][_0x365e04][_0xd0c5('0xc')]({'statePause':_0x518801[_0xd0c5('0xd')]?!![]:![]});}_0x47f0f4({'code':0xc8,'message':_0xd0c5('0xe')});});},'Reload':function(_0x46db00){var _0x1e5ac4=this;return new Promise(function(_0x125470,_0x3c615a){if(ami[_0xd0c5('0xf')]()==![]){return _0x3c615a(_0x1e5ac4['error'](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')]['join']('\x20')));}_0x46db00=_[_0xd0c5('0x13')](_0x46db00,_[_0xd0c5('0x14')](properties[_0xd0c5('0x15')]));_0x46db00[_0xd0c5('0x16')]='Reload';return ami[_0xd0c5('0x17')](_0x46db00)['then'](function(_0x1b58cd){_0x125470({'code':0xc8,'message':_0x1b58cd['message']});})[_0xd0c5('0x18')](function(_0x692aeb){_0x3c615a(_0x1e5ac4[_0xd0c5('0x19')](0x1f5,_0x692aeb[_0xd0c5('0x1a')]));});});},'Command':function(_0xfda75c){var _0x410445=this;return new Promise(function(_0x1f27b9,_0x287961){if(ami['isConnected']()==![]){return _0x287961(_0x410445[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config['asterisk'][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}_0xfda75c=_[_0xd0c5('0x13')](_0xfda75c,_0xd0c5('0x1c'));_0xfda75c[_0xd0c5('0x16')]=_0xd0c5('0x1d');return ami['Action'](_0xfda75c)['then'](function(_0x25fd73){_0x1f27b9({'code':0xc8,'message':_0x25fd73[_0xd0c5('0x1e')]});})[_0xd0c5('0x18')](function(_0x6ce082){_0x287961(_0x410445['error'](0x1f5,_0x6ce082[_0xd0c5('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x54f42c){var _0x54f188=[];for(var _0x3ec4ee in _0x4664bc[_0xd0c5('0x1f')]){if(_0x4664bc[_0xd0c5('0x1f')][_0xd0c5('0x20')](_0x3ec4ee)){var _0x3a5edf=_0x4664bc[_0xd0c5('0x1f')][_0x3ec4ee];var _0xbcef61={'id':_0x3a5edf['id'],'name':_0x3a5edf[_0xd0c5('0x8')],'strategy':_0x3a5edf[_0xd0c5('0x21')],'answered':_0x3a5edf[_0xd0c5('0x22')],'available':_0x3a5edf[_0xd0c5('0x23')],'loggedIn':_0x3a5edf[_0xd0c5('0x24')],'pTalking':_0x3a5edf[_0xd0c5('0x25')],'sumBillable':_0x3a5edf[_0xd0c5('0x26')],'sumDuration':_0x3a5edf[_0xd0c5('0x27')],'sumHoldTime':_0x3a5edf[_0xd0c5('0x28')]||0x0,'talking':_0x3a5edf[_0xd0c5('0x29')],'total':_0x3a5edf['total'],'type':_0x3a5edf[_0xd0c5('0x2a')],'unmanaged':_0x3a5edf[_0xd0c5('0x2b')],'abandoned':_0x3a5edf[_0xd0c5('0x2c')],'waiting':_0x3a5edf[_0xd0c5('0x2d')],'loggedInDb':_0x3a5edf[_0xd0c5('0x2e')]};if(_0x3a5edf[_0xd0c5('0x2a')]===_0xd0c5('0x2f')){_0xbcef61['dialActive']=_0x3a5edf[_0xd0c5('0x30')];_0xbcef61['dialMethod']=_0x3a5edf[_0xd0c5('0x31')];_0xbcef61[_0xd0c5('0x32')]=_0x3a5edf[_0xd0c5('0x32')];_0xbcef61[_0xd0c5('0x33')]=_0x3a5edf[_0xd0c5('0x33')];_0xbcef61[_0xd0c5('0x34')]=_0x3a5edf[_0xd0c5('0x34')];_0xbcef61['dialPrefix']=_0x3a5edf['dialPrefix'];_0xbcef61[_0xd0c5('0x35')]=_0x3a5edf['temp'];_0xbcef61[_0xd0c5('0x36')]=_0x3a5edf[_0xd0c5('0x36')];_0xbcef61[_0xd0c5('0x37')]=_0x3a5edf[_0xd0c5('0x37')];_0xbcef61['outboundBlacklistCallsDay']=_0x3a5edf[_0xd0c5('0x38')];_0xbcef61[_0xd0c5('0x39')]=_0x3a5edf['outboundBusyCallsDay'];_0xbcef61[_0xd0c5('0x3a')]=_0x3a5edf['outboundCongestionCallsDay'];_0xbcef61[_0xd0c5('0x3b')]=_0x3a5edf[_0xd0c5('0x3b')];_0xbcef61[_0xd0c5('0x3c')]=_0x3a5edf['outboundDropCallsDayCallersExit'];_0xbcef61[_0xd0c5('0x3d')]=_0x3a5edf[_0xd0c5('0x3d')];_0xbcef61[_0xd0c5('0x3e')]=_0x3a5edf[_0xd0c5('0x3e')];_0xbcef61[_0xd0c5('0x3f')]=_0x3a5edf[_0xd0c5('0x3f')];_0xbcef61[_0xd0c5('0x40')]=_0x3a5edf[_0xd0c5('0x40')];_0xbcef61[_0xd0c5('0x41')]=_0x3a5edf[_0xd0c5('0x41')];_0xbcef61[_0xd0c5('0x42')]=_0x3a5edf[_0xd0c5('0x42')];_0xbcef61[_0xd0c5('0x43')]=_0x3a5edf['outboundUnknownCallsDay'];_0xbcef61['predictiveIntervalAnsweredCalls']=_0x3a5edf[_0xd0c5('0x44')];_0xbcef61['predictiveIntervalAvgHoldtime']=_0x3a5edf[_0xd0c5('0x45')];_0xbcef61[_0xd0c5('0x46')]=_0x3a5edf['predictiveIntervalAvgTalktime'];_0xbcef61[_0xd0c5('0x47')]=_0x3a5edf[_0xd0c5('0x47')];_0xbcef61['predictiveIntervalDroppedCallsTimeout']=_0x3a5edf[_0xd0c5('0x48')];_0xbcef61[_0xd0c5('0x49')]=_0x3a5edf[_0xd0c5('0x49')];_0xbcef61[_0xd0c5('0x4a')]=_0x3a5edf[_0xd0c5('0x4a')];_0xbcef61[_0xd0c5('0x4b')]=_0x3a5edf[_0xd0c5('0x4b')];_0xbcef61[_0xd0c5('0x4c')]=_0x3a5edf[_0xd0c5('0x4c')];_0xbcef61[_0xd0c5('0x4d')]=_0x3a5edf[_0xd0c5('0x4d')];_0xbcef61[_0xd0c5('0x4e')]=_0x3a5edf[_0xd0c5('0x4e')];_0xbcef61['predictiveIntervalTotalCalls']=_0x3a5edf[_0xd0c5('0x4f')];_0xbcef61[_0xd0c5('0x1a')]=_0x3a5edf[_0xd0c5('0x1a')];_0xbcef61[_0xd0c5('0x50')]=_0x3a5edf[_0xd0c5('0x50')];_0xbcef61['erlangCalls']=_0x3a5edf['erlangCalls'];_0xbcef61[_0xd0c5('0x51')]=_0x3a5edf[_0xd0c5('0x51')];_0xbcef61[_0xd0c5('0x52')]=_0x3a5edf[_0xd0c5('0x52')];_0xbcef61['erlangBusyFactor']=_0x3a5edf[_0xd0c5('0x53')];_0xbcef61[_0xd0c5('0x54')]=_0x3a5edf[_0xd0c5('0x54')];_0xbcef61[_0xd0c5('0x55')]=_0x3a5edf[_0xd0c5('0x55')];}if(_0x3a5edf[_0xd0c5('0x56')]){_0xbcef61[_0xd0c5('0x56')]={'id':_0x3a5edf['Trunk']['id'],'name':_0x3a5edf[_0xd0c5('0x56')][_0xd0c5('0x8')],'active':_0x3a5edf['Trunk'][_0xd0c5('0x57')],'callerid':_0x3a5edf[_0xd0c5('0x56')][_0xd0c5('0x58')]};}if(_0x3a5edf['Interval']){_0xbcef61['Interval']={'id':_0x3a5edf['Interval']['id'],'name':_0x3a5edf['Interval'][_0xd0c5('0x8')]};}_0x54f188['push'](_0xbcef61);}}_0x54f42c({'count':_0x54f188[_0xd0c5('0x59')],'rows':_0x54f188});});},'UpdateVoiceQueue':function(_0x5380b1){return new Promise(function(_0x2c6f9e,_0x5a1857){var _0x28ea20=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x1f')],{'id':parseInt(_0x5380b1['id'])});var _0x2b939e=_[_0xd0c5('0x5b')](_0x5380b1,['id']);if(_0x28ea20){for(var _0x560d35 in _0x2b939e){if(typeof _0x2b939e[_0x560d35]!==_0xd0c5('0x5c')&&typeof _0x28ea20[_0x560d35]!==_0xd0c5('0x5c')){_0x28ea20[_0x560d35]=_0x2b939e[_0x560d35];}}_0x2c6f9e(_0x28ea20);}else{_0x5a1857();}});},'VoiceChannels':function(){return new Promise(function(_0xb240b6){var _0x22923a=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x5e')]);_0xb240b6({'count':_0x22923a['length'],'rows':_0x22923a});});},'VoiceChannelMixMonitor':function(_0x2a346f){var _0x14cba1=this;return new Promise(function(_0xca2e1f,_0x38324c){if(ami['isConnected']()==![]){return _0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}var _0x17d71c=schema(properties[_0xd0c5('0x5f')])[_0xd0c5('0x2')](_0x2a346f);if(_0x17d71c[_0xd0c5('0x59')]>0x0){return _0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x17d71c,'message')['join'](',\x20')));}var _0x4265d7=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x5e')],{'uniqueid':_0x2a346f[_0xd0c5('0x61')]});if(_0x4265d7&&_0x4265d7[_0xd0c5('0x62')]){var _0x24588=util['format'](_0xd0c5('0x63'),_0x2a346f[_0xd0c5('0x64')]||_0x2a346f[_0xd0c5('0x61')],_0x2a346f[_0xd0c5('0x65')]||_0xd0c5('0x66'));return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x67'),'channel':_0x4265d7[_0xd0c5('0x62')],'file':_0x24588,'options':_0xd0c5('0x68')})[_0xd0c5('0x69')](function(_0x25f7cb){var _0xbe0c47=_[_0xd0c5('0x5a')](_0x4265d7['monitors'],{'filename':_0xd0c5('0x6a')+_0x24588[_0xd0c5('0x6b')]()});if(_['isNil'](_0xbe0c47)){_0x4265d7[_0xd0c5('0x6c')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x24588[_0xd0c5('0x6b')](),'createdAt':moment()[_0xd0c5('0x65')](_0xd0c5('0x6d')),'mixmonitorid':_0x25f7cb[_0xd0c5('0x6e')],'status':_0xd0c5('0x6f')});}else{_0xbe0c47[_0xd0c5('0x6e')]=_0x25f7cb[_0xd0c5('0x6e')];_0xbe0c47[_0xd0c5('0x70')]=_0xd0c5('0x6f');}_0xca2e1f({'code':0xc8,'message':[_0x2a346f[_0xd0c5('0x61')],_0xd0c5('0x71'),_0x25f7cb[_0xd0c5('0x6e')]][_0xd0c5('0x1b')]('\x20'),'mixmonitorid':_0x25f7cb[_0xd0c5('0x6e')]});})[_0xd0c5('0x18')](function(_0x225baa){_0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f5,[_0x2a346f['uniqueid'],_0x225baa['message'][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x38324c(_0x14cba1['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3853a8){var _0x245038=this;return new Promise(function(_0x3a5bf9,_0x164646){if(ami[_0xd0c5('0xf')]()==![]){return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],'ami\x20disconnected'][_0xd0c5('0x1b')]('\x20')));}var _0x2141c1=schema(properties['voicechannel'])[_0xd0c5('0x2')](_0x3853a8);if(_0x2141c1['length']>0x0){return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f4,_['map'](_0x2141c1,_0xd0c5('0x1a'))['join'](',\x20')));}var _0x261e81=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x5e')],{'uniqueid':_0x3853a8[_0xd0c5('0x61')]});if(_0x261e81){return Promise[_0xd0c5('0x72')]()[_0xd0c5('0x69')](function(){if(_0x261e81[_0xd0c5('0x62')]){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x73'),'channel':_0x261e81[_0xd0c5('0x62')],'mixmonitorid':_0x3853a8[_0xd0c5('0x6e')]})[_0xd0c5('0x18')](function(){});}})['then'](function(){if(_0x261e81[_0xd0c5('0x74')]){return ami['Action']({'action':_0xd0c5('0x73'),'channel':_0x261e81[_0xd0c5('0x74')],'mixmonitorid':_0x3853a8['mixmonitorid']})[_0xd0c5('0x18')](function(){});}})[_0xd0c5('0x69')](function(){var _0x7689a3=_[_0xd0c5('0x5a')](_0x261e81[_0xd0c5('0x6c')],{'mixmonitorid':_0x3853a8[_0xd0c5('0x6e')]});if(_0x7689a3){_0x7689a3['status']=_0xd0c5('0x75');}})[_0xd0c5('0x69')](function(){var _0x12f8ad=util[_0xd0c5('0x65')]('%s.%s',_0x3853a8[_0xd0c5('0x64')]||_0x3853a8[_0xd0c5('0x61')],_0x3853a8[_0xd0c5('0x65')]||_0xd0c5('0x66'));var _0x19b799=_[_0xd0c5('0x5a')](_0x261e81[_0xd0c5('0x6c')],{'filename':_0xd0c5('0x6a')+_0x12f8ad[_0xd0c5('0x6b')]()});if(_0x19b799){_0x19b799[_0xd0c5('0x70')]='stop';}})[_0xd0c5('0x69')](function(){_0x3a5bf9({'code':0xc8,'message':[_0x3853a8[_0xd0c5('0x61')],_0xd0c5('0x76')][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0xed6cca){_0x164646(_0x245038['error'](0x1f5,[_0x3853a8[_0xd0c5('0x61')],_0xed6cca['message'][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x14b90f){var _0x5ca677=_['values'](_0x4664bc[_0xd0c5('0x78')]);_0x14b90f({'count':_0x5ca677[_0xd0c5('0x59')],'rows':_0x5ca677});});},'VoiceQueuesChannel':function(_0xfcc4e6){var _0x3b3e9d=this;return new Promise(function(_0x380b07,_0x313a4c){var _0x7d38d7=schema(properties[_0xd0c5('0x79')])[_0xd0c5('0x2')](_0xfcc4e6);if(_0x7d38d7[_0xd0c5('0x59')]>0x0){return _0x313a4c(_0x3b3e9d[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x7d38d7,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0x13249d=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0xfcc4e6['uniqueid']});if(_0x13249d){_0x380b07(_0x13249d);}else{return _0x313a4c(_0x3b3e9d[_0xd0c5('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x32c09f){var _0x39525a=this;return new Promise(function(_0x4e15ab,_0x24f21b){if(ami[_0xd0c5('0xf')]()==![]){return _0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}var _0x33314e=schema(properties['voicequeuechannelhangup'])['validate'](_0x32c09f);if(_0x33314e[_0xd0c5('0x59')]>0x0){return _0x24f21b(_0x39525a['error'](0x1f4,_['map'](_0x33314e,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0xb24e34=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0x32c09f['uniqueid']});if(_0xb24e34&&_0xb24e34['channel']){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x7a'),'channel':_0xb24e34[_0xd0c5('0x62')]})[_0xd0c5('0x69')](function(_0x1eeb74){_0x4e15ab({'code':0xc8,'message':[_0x32c09f[_0xd0c5('0x61')],_0x1eeb74[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0x25e683){_0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f5,[_0x32c09f['uniqueid'],_0x25e683[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'VoiceQueuesChannelRedirect':function(_0x3595f3){var _0x235818=this;return new Promise(function(_0x4c997f,_0x2529b0){if(ami[_0xd0c5('0xf')]()==![]){return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],'ami\x20disconnected'][_0xd0c5('0x1b')]('\x20')));}var _0x4d216c=schema(properties[_0xd0c5('0x7b')])[_0xd0c5('0x2')](_0x3595f3);if(_0x4d216c[_0xd0c5('0x59')]>0x0){return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x4d216c,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0x1d6ffe=_['find'](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0x3595f3['uniqueid']});if(_0x1d6ffe&&_0x1d6ffe[_0xd0c5('0x62')]){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x7c'),'channel':_0x1d6ffe[_0xd0c5('0x62')],'exten':_0x3595f3[_0xd0c5('0x7d')],'context':_0x3595f3[_0xd0c5('0x7e')]||_0x1d6ffe[_0xd0c5('0x7e')],'priority':0x1})[_0xd0c5('0x69')](function(_0x306c81){_0x4c997f({'code':0xc8,'message':[_0x3595f3['uniqueid'],_0x306c81[_0xd0c5('0x1a')][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0x411bae){_0x2529b0(_0x235818['error'](0x1f5,[_0x3595f3[_0xd0c5('0x61')],_0x411bae[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'Agents':function(_0xd5d115){return new Promise(function(_0x288b3d){var _0x23b5ca=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0xb')]);if(_0xd5d115&&_0xd5d115['id']){var _0x416a91=_[_0xd0c5('0x5a')](_0x23b5ca,function(_0xa107a6){return _0xa107a6['id']===_0xd5d115['id'];});_0x288b3d(_0x416a91);}else{_0x288b3d({'count':_0x23b5ca[_0xd0c5('0x59')],'rows':_0x23b5ca});}});},'Telephones':function(){return new Promise(function(_0x56c491){var _0xd0c69e=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x7f')]);_0x56c491({'count':_0xd0c69e[_0xd0c5('0x59')],'rows':_0xd0c69e});});},'Trunks':function(){return new Promise(function(_0x36e6f0){var _0x2ee055=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x80')]);_0x36e6f0({'count':_0x2ee055[_0xd0c5('0x59')],'rows':_0x2ee055});});},'OutboundChannels':function(){return new Promise(function(_0x1ad7db){var _0x4c2606=_[_0xd0c5('0x5d')](_0x4664bc['outboundChannels']);_0x1ad7db({'count':_0x4c2606[_0xd0c5('0x59')],'rows':_0x4c2606});});},'Outbound':function(){return new Promise(function(_0x233bde){_0x233bde(_0x4664bc[_0xd0c5('0x2f')]);});},'Campaigns':function(){return new Promise(function(_0x3cfa46){var _0x2c7d32=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x81')]);_0x3cfa46({'count':_0x2c7d32[_0xd0c5('0x59')],'rows':_0x2c7d32});});},'VoiceQueuesPreview':function(_0x24ab98){var _0x5edceb=this;return new Promise(function(_0x485662,_0x57b0c8){_0xc3a9b9[_0xd0c5('0x82')](_0x24ab98['id'])[_0xd0c5('0x69')](function(_0x37da46){_0x485662({'code':0xc8,'message':_0x37da46[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0x538155){_0x57b0c8(_0x5edceb[_0xd0c5('0x19')](0x1f4,_0x538155[_0xd0c5('0x1a')]));});});},'EventManager':function(_0x5acaca){var _0x254623=this;return new Promise(function(_0x2c3ae8,_0x4d2147){if(!_0x5acaca['event']){return _0x4d2147(_0x254623[_0xd0c5('0x19')](0x1f4,_0xd0c5('0x83')));}ami[_0xd0c5('0x84')](_0xd0c5('0x85')+_0x5acaca[_0xd0c5('0x86')],_0x5acaca[_0xd0c5('0x1a')]);_0x2c3ae8({'code':0xc8,'message':_0x5acaca});});},'FaxAccounts':function(){return new Promise(function(_0x33ee08){var _0x32b331=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x87')]);_0x33ee08({'count':_0x32b331['length'],'rows':_0x32b331});});},'SendFax':function(_0x48d11f){var _0x133aae=this;return new Promise(function(_0x2aed0e,_0x3046e6){_0x166636[_0xd0c5('0x88')](_0x48d11f)[_0xd0c5('0x69')](function(_0x3b95c9){_0x2aed0e({'code':0xc8,'message':_0x3b95c9[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0x3f882b){_0x3046e6(_0x133aae[_0xd0c5('0x19')](0x1f4,_0x3f882b['message']));});});},'CheckAfterSend':function(_0x23f5ad){var _0x2a24c6=this;return new Promise(function(_0x5985cd,_0x468bc3){_0x166636[_0xd0c5('0x89')](_0x23f5ad)[_0xd0c5('0x69')](function(_0x2e89cf){_0x5985cd({'code':0xc8,'message':_0x2e89cf[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0xef9d6d){_0x468bc3(_0x2a24c6[_0xd0c5('0x19')](0x1f4,_0xef9d6d[_0xd0c5('0x1a')]));});});}};var _0x54973f=jayson[_0xd0c5('0x8a')](_0x2ef2f6)[_0xd0c5('0x8b')]();_0x54973f['on'](_0xd0c5('0x19'),function(_0x5819f4){return _0x569992(_0x5819f4);});_0x54973f[_0xd0c5('0x6')](0x232a,_0xd0c5('0x8c'),function(){console[_0xd0c5('0x8d')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x121911(_0xd0c5('0x8e')+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 9c6d4ab..287cb75 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 _0xbdee=['fax','ListId','createdAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','toLowerCase','merge','lodash','ioredis','util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','info','emit','exec','data1','data2','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile'];(function(_0x609be7,_0x1f74bd){var _0x4b1da1=function(_0x1cd52a){while(--_0x1cd52a){_0x609be7['push'](_0x609be7['shift']());}};_0x4b1da1(++_0x1f74bd);}(_0xbdee,0x1d6));var _0xebde=function(_0x499d88,_0x5b8e1f){_0x499d88=_0x499d88-0x0;var _0x3c82ee=_0xbdee[_0x499d88];return _0x3c82ee;};'use strict';var _=require(_0xebde('0x0'));var BPromise=require('bluebird');var Redis=require(_0xebde('0x1'));var util=require(_0xebde('0x2'));var config=require('../../../../config/environment');var logger=require(_0xebde('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xebde('0x4')]=_[_0xebde('0x5')](config['redis'],{'host':_0xebde('0x6'),'port':0x18eb});var io=require(_0xebde('0x7'))(new Redis(config['redis']));function emit(_0x473c6e,_0x9bb4b1,_0x105c1c,_0x41a9e7,_0x4bf661){logger[_0xebde('0x8')]('[CM][%s][%s]',_0x473c6e,_0x9bb4b1['id'],_0x105c1c,_0x41a9e7,JSON['stringify'](_0x4bf661));io['to'](_0x105c1c)[_0xebde('0x9')](_0x41a9e7,_0x4bf661);}exports[_0xebde('0xa')]=function(_0x5611d5,_0x4034fe,_0x149a41,_0x2058fe){var _0x27066,_0x5f4f3f;var _0x2508ec={};var _0x2f5fec;var _0x231658=Number(_0x149a41[_0xebde('0xb')]);var _0x2a25ee=_0x149a41[_0xebde('0xc')]?Boolean(Number(_0x149a41[_0xebde('0xc')])):![];var _0x59f0ad;var _0x4d1f90=![];if(!_['isNil'](_0x149a41[_0xebde('0xd')])){if(_0x149a41[_0xebde('0xd')]=='1')_0x4d1f90=!![];}if(!_0x4d1f90){if(_0x2058fe[_0xebde('0xe')]){_0x2508ec['id']=_0x2058fe[_0xebde('0xe')];}}if(!_0x2508ec['id']){_0x2508ec['ListId']=_0x231658;_0x59f0ad=_0x149a41[_0xebde('0xf')]&&_0x149a41[_0xebde('0xf')]!=='0'?_0x149a41[_0xebde('0xf')][_0xebde('0x10')](','):[_0xebde('0x11')];_0x2508ec[_0xebde('0x12')]=_[_0xebde('0x13')](_0x59f0ad,function(_0x382759){var _0x429f8b={};_0x429f8b[_0x382759]=_0x2058fe[_0xebde('0x14')]?_0x2058fe[_0xebde('0x15')]:_0x2058fe[_0xebde('0x16')];return _0x429f8b;});_0x2f5fec=_0x2058fe[_0xebde('0x14')]?_0x2058fe[_0xebde('0x15')]:_0x2058fe['calleridnum'];}var _0x31fcf4=['id','firstName',_0xebde('0x17'),_0xebde('0x11'),_0xebde('0x18'),_0xebde('0x19'),_0xebde('0x1a'),_0xebde('0x1b'),'scheduledAt','updatedAt'];var _0x5b1214=_[_0xebde('0x1c')](_0x31fcf4,_0x59f0ad);BPromise[_0xebde('0x1d')]()[_0xebde('0x1e')](cmContactRpc[_0xebde('0x1f')]({'attributes':_0x5b1214,'where':_0x2508ec,'phone':_0x2f5fec}))[_0xebde('0x1e')](function(_0x497182){_0x5f4f3f=_0x497182;if(!_[_0xebde('0x20')](_0x5f4f3f)){if(_0x5f4f3f[_0xebde('0x21')]===0x1){_0x27066=_0x5f4f3f[0x0];logger[_0xebde('0x8')](_0xebde('0x22'),_0x2058fe[_0xebde('0x23')],_0x4034fe['id'],_0x27066['id']);}else{logger[_0xebde('0x8')](_0xebde('0x24'),_0x2058fe[_0xebde('0x23')],_0x4034fe['id'],_[_0xebde('0x13')](_0x5f4f3f,'id')[_0xebde('0x25')](','));}return;}else{logger['info'](_0xebde('0x26'),_0x2058fe[_0xebde('0x23')],_0x4034fe['id']);var _0x4b6849={'ListId':_0x231658};var _0x388182=_0x149a41[_0xebde('0x27')]&&_0x149a41['data4']!=='0'?_0x149a41['data4']:_0xebde('0x11');if(_0x2a25ee){logger[_0xebde('0x8')](_0xebde('0x28'),_0x2058fe['uniqueid'],_0x4034fe['id']);_0x4b6849[_0x388182]=_['isNil'](_0x2058fe[_0xebde('0x14')])?_0x2058fe[_0xebde('0x16')]:_0x2058fe['destcalleridnum'];if(_[_0xebde('0x29')](_0x2058fe[_0xebde('0x14')])){_0x4b6849[_0xebde('0x2a')]=_0x2058fe[_0xebde('0x2b')]&&_0x2058fe[_0xebde('0x2b')]!==''?_0x2058fe['calleridname']:_0xebde('0x2c');}else{_0x4b6849[_0xebde('0x2a')]=_0x2058fe[_0xebde('0x2d')]&&_0x2058fe[_0xebde('0x2d')]!==_0xebde('0x2e')?_0x2058fe[_0xebde('0x2d')]:_0xebde('0x2c');}return BPromise[_0xebde('0x1d')]()['then'](cmContactRpc[_0xebde('0x2f')](_0x4b6849))['then'](function(_0xb91b56){_0x27066=_0xb91b56;_0x5f4f3f[_0xebde('0x30')](_0xb91b56);if(_0x27066){logger['info'](_0xebde('0x31'),_0x2058fe[_0xebde('0x23')],_0x4034fe['id'],_0x27066['id']);}return;});}else{logger[_0xebde('0x8')](_0xebde('0x32'),_0x2058fe['uniqueid'],_0x4034fe['id']);_0x4b6849[_0x388182]=_['isNil'](_0x2058fe[_0xebde('0x14')])?_0x2058fe['calleridnum']:_0x2058fe[_0xebde('0x15')];if(_[_0xebde('0x29')](_0x2058fe[_0xebde('0x14')])){_0x4b6849[_0xebde('0x2a')]=_0x2058fe['calleridname']&&_0x2058fe['calleridname']!==_0xebde('0x2e')?_0x2058fe[_0xebde('0x2b')]:_0xebde('0x2c');}else{_0x4b6849[_0xebde('0x2a')]=_0x2058fe[_0xebde('0x2d')]&&_0x2058fe[_0xebde('0x2d')]!==_0xebde('0x2e')?_0x2058fe[_0xebde('0x2d')]:'Unknown';}_0x27066=_0x4b6849;_0x5f4f3f[_0xebde('0x30')](_0x4b6849);return;}}})[_0xebde('0x1e')](function(){if(_0x5611d5){emit(_0x2058fe[_0xebde('0x23')],_0x4034fe,util['format']('user:%s',_0x5611d5['name']),util[_0xebde('0x33')](_0xebde('0x34'),_0x149a41['action'][_0xebde('0x35')]()),{'evt':_[_0xebde('0x36')](_0x2058fe,{'autoCreate':_0x2a25ee}),'contact':_0x27066===undefined?{}:_0x27066,'contacts':_0x5f4f3f[_0xebde('0x21')]===0x0?undefined:_0x5f4f3f});}});}; \ No newline at end of file +var _0x4153=['scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt'];(function(_0x5d0cc4,_0xcd0a56){var _0x1f5007=function(_0x7340d6){while(--_0x7340d6){_0x5d0cc4['push'](_0x5d0cc4['shift']());}};_0x1f5007(++_0xcd0a56);}(_0x4153,0x8a));var _0x3415=function(_0x154de5,_0x382afa){_0x154de5=_0x154de5-0x0;var _0x189850=_0x4153[_0x154de5];return _0x189850;};'use strict';var _=require(_0x3415('0x0'));var BPromise=require(_0x3415('0x1'));var Redis=require(_0x3415('0x2'));var util=require(_0x3415('0x3'));var config=require(_0x3415('0x4'));var logger=require(_0x3415('0x5'))(_0x3415('0x6'));var cmContactRpc=require(_0x3415('0x7'));config[_0x3415('0x8')]=_[_0x3415('0x9')](config[_0x3415('0x8')],{'host':_0x3415('0xa'),'port':0x18eb});var io=require(_0x3415('0xb'))(new Redis(config[_0x3415('0x8')]));function emit(_0x25b4c0,_0x5bd446,_0x3875c4,_0x35339c,_0x3cadac){logger[_0x3415('0xc')](_0x3415('0xd'),_0x25b4c0,_0x5bd446['id'],_0x3875c4,_0x35339c,JSON[_0x3415('0xe')](_0x3cadac));io['to'](_0x3875c4)[_0x3415('0xf')](_0x35339c,_0x3cadac);}exports[_0x3415('0x10')]=function(_0x1ea535,_0x39fd69,_0x56737c,_0xe8de40){var _0x3a404a,_0xb3f794;var _0x4a9264={};var _0x13a64d;var _0x312795=Number(_0x56737c[_0x3415('0x11')]);var _0x474ba4=_0x56737c[_0x3415('0x12')]?Boolean(Number(_0x56737c[_0x3415('0x12')])):![];var _0x510474;var _0x149ce0=![];if(!_[_0x3415('0x13')](_0x56737c[_0x3415('0x14')])){if(_0x56737c['data5']=='1')_0x149ce0=!![];}if(!_0x149ce0){if(_0xe8de40[_0x3415('0x15')]){_0x4a9264['id']=_0xe8de40[_0x3415('0x15')];}}if(!_0x4a9264['id']){_0x4a9264[_0x3415('0x16')]=_0x312795;_0x510474=_0x56737c[_0x3415('0x17')]&&_0x56737c[_0x3415('0x17')]!=='0'?_0x56737c[_0x3415('0x17')][_0x3415('0x18')](','):[_0x3415('0x19')];_0x4a9264[_0x3415('0x1a')]=_[_0x3415('0x1b')](_0x510474,function(_0x391dfd){var _0x467916={};_0x467916[_0x391dfd]=_0xe8de40[_0x3415('0x1c')]?_0xe8de40[_0x3415('0x1d')]:_0xe8de40[_0x3415('0x1e')];return _0x467916;});_0x13a64d=_0xe8de40[_0x3415('0x1c')]?_0xe8de40[_0x3415('0x1d')]:_0xe8de40['calleridnum'];}var _0x1bcb70=['id',_0x3415('0x1f'),_0x3415('0x20'),'phone',_0x3415('0x21'),_0x3415('0x22'),_0x3415('0x16'),_0x3415('0x23'),_0x3415('0x24'),_0x3415('0x25')];var _0x3bd5ed=_[_0x3415('0x26')](_0x1bcb70,_0x510474);BPromise[_0x3415('0x27')]()[_0x3415('0x28')](cmContactRpc['getContacts']({'attributes':_0x3bd5ed,'where':_0x4a9264,'phone':_0x13a64d}))[_0x3415('0x28')](function(_0x286ab4){_0xb3f794=_0x286ab4;if(!_['isEmpty'](_0xb3f794)){if(_0xb3f794[_0x3415('0x29')]===0x1){_0x3a404a=_0xb3f794[0x0];logger['info'](_0x3415('0x2a'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_0x3a404a['id']);}else{logger[_0x3415('0xc')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_[_0x3415('0x1b')](_0xb3f794,'id')[_0x3415('0x2c')](','));}return;}else{logger[_0x3415('0xc')](_0x3415('0x2d'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);var _0xbf6edd={'ListId':_0x312795};var _0x419fb2=_0x56737c['data4']&&_0x56737c[_0x3415('0x2e')]!=='0'?_0x56737c[_0x3415('0x2e')]:_0x3415('0x19');if(_0x474ba4){logger[_0x3415('0xc')](_0x3415('0x2f'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);_0xbf6edd[_0x419fb2]=_[_0x3415('0x13')](_0xe8de40[_0x3415('0x1c')])?_0xe8de40['calleridnum']:_0xe8de40[_0x3415('0x1d')];if(_[_0x3415('0x13')](_0xe8de40['routeId'])){_0xbf6edd[_0x3415('0x1f')]=_0xe8de40[_0x3415('0x30')]&&_0xe8de40[_0x3415('0x30')]!==_0x3415('0x31')?_0xe8de40['calleridname']:_0x3415('0x32');}else{_0xbf6edd['firstName']=_0xe8de40[_0x3415('0x33')]&&_0xe8de40[_0x3415('0x33')]!==''?_0xe8de40['destcalleridname']:_0x3415('0x32');}return BPromise[_0x3415('0x27')]()[_0x3415('0x28')](cmContactRpc[_0x3415('0x34')](_0xbf6edd))['then'](function(_0x504373){_0x3a404a=_0x504373;_0xb3f794['push'](_0x504373);if(_0x3a404a){logger[_0x3415('0xc')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_0x3a404a['id']);}return;});}else{logger['info'](_0x3415('0x35'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);_0xbf6edd[_0x419fb2]=_['isNil'](_0xe8de40[_0x3415('0x1c')])?_0xe8de40[_0x3415('0x1e')]:_0xe8de40[_0x3415('0x1d')];if(_['isNil'](_0xe8de40[_0x3415('0x1c')])){_0xbf6edd[_0x3415('0x1f')]=_0xe8de40[_0x3415('0x30')]&&_0xe8de40['calleridname']!==_0x3415('0x31')?_0xe8de40[_0x3415('0x30')]:_0x3415('0x32');}else{_0xbf6edd[_0x3415('0x1f')]=_0xe8de40['destcalleridname']&&_0xe8de40[_0x3415('0x33')]!==_0x3415('0x31')?_0xe8de40['destcalleridname']:_0x3415('0x32');}_0x3a404a=_0xbf6edd;_0xb3f794['push'](_0xbf6edd);return;}}})['then'](function(){if(_0x1ea535){emit(_0xe8de40[_0x3415('0x2b')],_0x39fd69,util[_0x3415('0x36')](_0x3415('0x37'),_0x1ea535[_0x3415('0x38')]),util['format'](_0x3415('0x39'),_0x56737c['action']['toLowerCase']()),{'evt':_['merge'](_0xe8de40,{'autoCreate':_0x474ba4}),'contact':_0x3a404a===undefined?{}:_0x3a404a,'contacts':_0xb3f794[_0x3415('0x29')]===0x0?undefined:_0xb3f794});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index cf0d7a0..e9e1886 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 _0xed0b=['redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','deskAccounts','bind','custom:agentconnect','syncCustomEvent','custom:agentcomplete','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','checkTriggers','status','checkTrigger','merge','Actions','length','interface','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','data6','winApplication','render','user:%s','format','trigger:%s:%s','action','jscripty','name','trigger:%s','contactmanager','exec','integration','accounts','routeId','script','parse','query','replace','channel','AllConditions','checkConditions','AnyConditions','account','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','util','url','mustache','ioredis','./script','../../../config/logger'];(function(_0xf4bb0a,_0x1f7289){var _0x5159bd=function(_0x261a12){while(--_0x261a12){_0xf4bb0a['push'](_0xf4bb0a['shift']());}};_0x5159bd(++_0x1f7289);}(_0xed0b,0x15f));var _0xbed0=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xed0b[_0x3b0731];return _0x4204d7;};'use strict';var util=require(_0xbed0('0x0'));var _=require('lodash');var url=require(_0xbed0('0x1'));var Mustache=require(_0xbed0('0x2'));var Redis=require(_0xbed0('0x3'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xbed0('0x4'));var config=require('../../../config/environment');var logger=require(_0xbed0('0x5'))('trigger');var ami=require('../ami');config[_0xbed0('0x6')]=_[_0xbed0('0x7')](config[_0xbed0('0x6')],{'host':_0xbed0('0x8'),'port':0x18eb});var io=require(_0xbed0('0x9'))(new Redis(config['redis']));var operators={'equals':function(_0x23398d,_0x1c48c7){return _0x23398d==_0x1c48c7;},'not_equals':function(_0x34cc5e,_0x1d7f7d){return _0x34cc5e!=_0x1d7f7d;}};var barAndWebActions=[_0xbed0('0xa'),'url',_0xbed0('0xb')];function Trigger(_0x205cdd){this[_0xbed0('0xc')]=_0x205cdd['triggers'];this[_0xbed0('0xd')]=_0x205cdd['agents'];this[_0xbed0('0xe')]=_0x205cdd[_0xbed0('0xe')];this[_0xbed0('0xf')]=_0x205cdd[_0xbed0('0xf')];this[_0xbed0('0x10')]=_0x205cdd[_0xbed0('0x10')];this['zendeskAccounts']=_0x205cdd[_0xbed0('0x11')];this[_0xbed0('0x12')]=_0x205cdd['freshdeskAccounts'];this[_0xbed0('0x13')]=_0x205cdd[_0xbed0('0x13')];this[_0xbed0('0x14')]=_0x205cdd['sugarcrmAccounts'];this['zohoAccounts']=_0x205cdd[_0xbed0('0x15')];this['deskAccounts']=_0x205cdd['deskAccounts'];this['vtigerAccounts']=_0x205cdd[_0xbed0('0x16')];this[_0xbed0('0x17')]=_0x205cdd['servicenowAccounts'];this[_0xbed0('0x18')]=_0x205cdd['dynamics365Accounts'];this[_0xbed0('0x19')]=_0x205cdd[_0xbed0('0x19')];this['accounts']={'zendesk':this[_0xbed0('0x11')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xbed0('0x12')],'sugarcrm':this[_0xbed0('0x14')],'zoho':this[_0xbed0('0x15')],'desk':this[_0xbed0('0x1a')],'vtiger':this[_0xbed0('0x16')],'dynamics365':this[_0xbed0('0x18')],'freshsales':this[_0xbed0('0x19')],'servicenow':this[_0xbed0('0x17')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x1c'),this['syncCustomEvent'][_0xbed0('0x1b')](this));ami['on']('custom:agentringnoanswer',this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x1e'),this['syncCustomEvent'][_0xbed0('0x1b')](this));ami['on']('custom:agentnosuchnumber',this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on']('custom:agentnoanswer',this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x1f'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x20'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on']('custom:agentreject',this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x21'),this['syncCustomEvent'][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x22'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x23'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x24'),this[_0xbed0('0x25')]['bind'](this));ami['on'](_0xbed0('0x26'),this[_0xbed0('0x25')][_0xbed0('0x1b')](this));ami['on']('custom:dialend',this['syncAgentDial']['bind'](this));ami['on'](_0xbed0('0x27'),this[_0xbed0('0x1d')]['bind'](this));ami['on'](_0xbed0('0x28'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x29'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x2a'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));ami['on'](_0xbed0('0x2b'),this[_0xbed0('0x1d')]['bind'](this));ami['on'](_0xbed0('0x2c'),this[_0xbed0('0x1d')]['bind'](this));ami['on'](_0xbed0('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0xbed0('0x2e'),this[_0xbed0('0x1d')][_0xbed0('0x1b')](this));}Trigger[_0xbed0('0x2f')][_0xbed0('0x30')]=function(_0x202a2a,_0xa47bf6,_0x24fbdf){logger[_0xbed0('0x31')](_0x202a2a,_0xa47bf6,JSON[_0xbed0('0x32')](_0x24fbdf));io['to'](_0x202a2a)[_0xbed0('0x30')](_0xa47bf6,_0x24fbdf);};Trigger[_0xbed0('0x2f')][_0xbed0('0x1d')]=function(_0x43c76c){var _0x12f5a8=_[_0xbed0('0x33')](_0x43c76c);if(typeof _0x12f5a8[_0xbed0('0x34')]===_0xbed0('0x35')){_0x12f5a8[_0xbed0('0x34')]='voice';}this[_0xbed0('0x36')](_0x12f5a8);};Trigger[_0xbed0('0x2f')][_0xbed0('0x25')]=function(_0x3bcd56){if(this[_0xbed0('0xd')][_0x3bcd56['interface']]){this[_0xbed0('0x1d')](_0x3bcd56);}};Trigger[_0xbed0('0x2f')]['checkTriggers']=function(_0x5c7955){var _0x9bdc6a;for(var _0x18c8ca in this[_0xbed0('0xc')]){if(this[_0xbed0('0xc')]['hasOwnProperty'](_0x18c8ca)){if(this[_0xbed0('0xc')][_0x18c8ca][_0xbed0('0x37')]){_0x9bdc6a=this[_0xbed0('0x38')](this[_0xbed0('0xc')][_0x18c8ca],_0x5c7955);if(_0x9bdc6a){_[_0xbed0('0x39')](_0x5c7955,_0x5c7955['variables']);for(var _0x401391=0x0,_0x498d08,_0x1d468b,_0x3d0362;_0x4013910x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x3d934a,_0x92a883){var _0x34cafa=function(_0x4f27e7){while(--_0x4f27e7){_0x3d934a['push'](_0x3d934a['shift']());}};_0x34cafa(++_0x92a883);}(_0x3e74,0x175));var _0x43e7=function(_0x47845e,_0x20bdb6){_0x47845e=_0x47845e-0x0;var _0xf6b4e7=_0x3e74[_0x47845e];return _0xf6b4e7;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ 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 fd1f39b..ab12a50 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 _0x28ff=['internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','catch','toLowerCase','outbound','calleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','destcalleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20created!','picklist','indexOf','substring','ticketType','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','modernAuthentication','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','data2','resolve','data5','POST','clientId','password','then','error',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','email','userEmail','length'];(function(_0x495ebf,_0x27df21){var _0x5841ef=function(_0x35bdfd){while(--_0x35bdfd){_0x495ebf['push'](_0x495ebf['shift']());}};_0x5841ef(++_0x27df21);}(_0x28ff,0x17f));var _0xf28f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x28ff[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var rp=require(_0xf28f('0x0'));var util=require(_0xf28f('0x1'));var intUtil=require(_0xf28f('0x2'));var md5=require(_0xf28f('0x3'));var Redis=require(_0xf28f('0x4'));var logger=require(_0xf28f('0x5'))(_0xf28f('0x6'));var config=require(_0xf28f('0x7'));config[_0xf28f('0x8')]=_[_0xf28f('0x9')](config['redis'],{'host':_0xf28f('0xa'),'port':0x18eb});var io=require(_0xf28f('0xb'))(new Redis(config[_0xf28f('0x8')]));function getAuthToken(_0x16cf03,_0x185509,_0xf98be5){if(_0x16cf03['modernAuthentication']){_0x16cf03[_0xf28f('0xc')]=_0x16cf03[_0xf28f('0xd')][_0xf28f('0xe')];_0x16cf03['tenantId']=_0x16cf03[_0xf28f('0xd')][_0xf28f('0xf')];return Promise[_0xf28f('0x10')](_0x16cf03['CloudProvider'][_0xf28f('0x11')]);}var _0x2c9c9d={'method':_0xf28f('0x12'),'uri':_0x185509,'form':{'client_id':_0x16cf03[_0xf28f('0x13')],'resource':_0x16cf03[_0xf28f('0xc')],'username':_0x16cf03['username'],'password':_0x16cf03[_0xf28f('0x14')],'grant_type':_0xf28f('0x14'),'client_secret':_0x16cf03['clientSecret']},'json':!![]};return rp(_0x2c9c9d)[_0xf28f('0x15')](function(_0x4ce336){return _0x4ce336['access_token'];})['catch'](function(_0x3d93d7){logger[_0xf28f('0x16')]('['+[_0xf98be5['toUpperCase']()]+_0xf28f('0x17'));return _0x3d93d7[_0xf28f('0x18')];});}function getUser(_0x2e0a4c,_0x716cc2,_0x148e45,_0x337b78,_0x11eccf,_0x2e7fd5){return new Promise(function(_0x430d7f,_0x185130){return getAuthToken(_0x716cc2,_0x337b78,_0x2e7fd5)[_0xf28f('0x15')](function(_0x171fd7){var _0xa0de46={'method':_0xf28f('0x19'),'uri':_0x11eccf+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xf28f('0x1a')+_0x171fd7,'OData-Version':_0xf28f('0x1b')},'json':!![]};return rp(_0xa0de46);})['then'](function(_0x50e9c4){var _0x2813b1=_0x50e9c4[_0xf28f('0x1c')];var _0xbaf06=![];var _0x22d3e5=null;if(!_[_0xf28f('0x1d')](_0x148e45)){if(intUtil['validateEmail'](_0x148e45[_0xf28f('0x1e')])){_0x2e0a4c[_0xf28f('0x1f')]=_0x148e45[_0xf28f('0x1e')];for(_0x22d3e5=0x0;_0x22d3e5<_0x2813b1[_0xf28f('0x20')];_0x22d3e5++){if(_0x2813b1[_0x22d3e5][_0xf28f('0x21')]===_0x148e45['email']&&!_0x2813b1[_0x22d3e5]['isdisabled']){_0xbaf06=!![];logger['info']('['+[_0x2e7fd5[_0xf28f('0x22')]()]+_0xf28f('0x23')+_0x2813b1[_0x22d3e5][_0xf28f('0x24')]+'!');_0x2e0a4c['userId']=_0x2813b1[_0x22d3e5]['systemuserid'];}}}}if(!_0xbaf06){logger[_0xf28f('0x25')]('['+[_0x2e7fd5[_0xf28f('0x22')]()]+_0xf28f('0x26'));_0x2e0a4c[_0xf28f('0x1f')]=_0x716cc2[_0xf28f('0x27')];for(_0x22d3e5=0x0;_0x22d3e5<_0x2813b1[_0xf28f('0x20')];_0x22d3e5++){if(_0x2813b1[_0x22d3e5]['internalemailaddress']===_0x716cc2[_0xf28f('0x27')]){_0x2e0a4c[_0xf28f('0x28')]=_0x2813b1[_0x22d3e5][_0xf28f('0x24')];}}}_0x430d7f(_0x2e0a4c);})[_0xf28f('0x29')](function(_0x384245){_0x185130(_0x384245[_0xf28f('0x18')]);});});}function createEndUser(_0x2f2c3e,_0x24b66d,_0x329a1b,_0x183765,_0x3370dc,_0x221116,_0x33c57f){return new Promise(function(_0x1d360b,_0x4336ce){return getAuthToken(_0x24b66d,_0x329a1b,_0x221116)['then'](function(_0x18e353){var _0x1e3e35=_0x221116[_0xf28f('0x2a')]()===_0xf28f('0x2b')?_0x3370dc['destcalleridnum']:_0x3370dc[_0xf28f('0x2c')];var _0x4237c9={'method':_0xf28f('0x12'),'uri':_0x183765+'contacts','body':{'fullname':_0x1e3e35,'firstname':_0x1e3e35,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf28f('0x2d')+_0x2f2c3e[_0xf28f('0x28')]+')'},'headers':{'Authorization':_0xf28f('0x1a')+_0x18e353,'OData-Version':_0xf28f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x4237c9['body'][_0x33c57f]=_0x1e3e35;return rp(_0x4237c9);})[_0xf28f('0x15')](function(_0x196849){var _0x851dc1=_0x196849[_0xf28f('0x2e')][_0xf28f('0x2f')];var _0x6cf9a1=_0x851dc1['substring'](_0x851dc1[_0xf28f('0x30')]('(')+0x1,_0x851dc1['lastIndexOf'](')'));_0x2f2c3e[_0xf28f('0x31')]=_0x6cf9a1;_0x1d360b(_0x2f2c3e);})[_0xf28f('0x29')](function(_0x5ab928){_0x4336ce(_0x5ab928['message']);});});}function getEndUser(_0x594071,_0x207f28,_0x1de1c1,_0x308a77,_0x599fe5,_0x32e94d,_0x19023e,_0x57f300){var _0x1991f7=_0x32e94d[_0xf28f('0x2a')]()===_0xf28f('0x2b')?_0x599fe5[_0xf28f('0x32')]:_0x599fe5[_0xf28f('0x2c')];return getAuthToken(_0x207f28,_0x1de1c1,_0x32e94d)[_0xf28f('0x15')](function(_0x587a9a){_0x57f300=_0x57f300?_0x57f300:_0xf28f('0x33');var _0x21b681={'method':_0xf28f('0x19'),'uri':_0x308a77+_0xf28f('0x34')+_0x57f300+_0xf28f('0x35')+_0x57f300+_0xf28f('0x36')+_0x1991f7[_0xf28f('0x37')]('+',_0xf28f('0x38'))+'\x27','headers':{'Authorization':_0xf28f('0x1a')+_0x587a9a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x21b681);})[_0xf28f('0x15')](function(_0x2aacbf){var _0x2c17d3=![];if(!_0x2aacbf)return _0x2c17d3;var _0x390c6a=_0x2aacbf[_0xf28f('0x1c')];for(var _0x22e60d=0x0;_0x22e60d<_0x390c6a['length'];_0x22e60d++){if(_0x390c6a[_0x22e60d][_0x57f300]===_0x1991f7){_0x2c17d3=!![];_0x594071[_0xf28f('0x31')]=_0x390c6a[_0x22e60d]['contactid'];}}return _0x2c17d3;})[_0xf28f('0x15')](function(_0x35b987){if(_0x35b987)return _0x594071;if(_0x19023e===_0xf28f('0x39')){logger[_0xf28f('0x25')]('['+[_0x32e94d[_0xf28f('0x22')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x594071;}return createEndUser(_0x594071,_0x207f28,_0x1de1c1,_0x308a77,_0x599fe5,_0x32e94d,_0x57f300)[_0xf28f('0x15')](function(_0x2acf63){logger['info']('['+[_0x32e94d[_0xf28f('0x22')]()]+_0xf28f('0x3a'),_0x2acf63['enduserId']);return _0x2acf63;});});}function getCustomFields(_0x3414ba,_0x2dcb45,_0x3cb6bf){var _0x56b9bc={};if(_0x3414ba[_0xf28f('0x20')]>0x0){_['forEach'](_0x3414ba,function(_0x2586a7){if(_['includes'](['string',_0xf28f('0x3b')],_0x2586a7['type'])&&_0x2586a7['nameField']&&!_0x2586a7['customField']){var _0xb3d1d1=_0x2586a7['idField'][_0xf28f('0x2a')]();var _0x1175d5=_0xb3d1d1['substring'](0x0,_0xb3d1d1[_0xf28f('0x3c')]('_'));var _0x484625=_0xb3d1d1[_0xf28f('0x3d')](_0xb3d1d1[_0xf28f('0x3c')]('_')+0x1);if(_0x1175d5===_0x3cb6bf){_0x56b9bc[_0x484625]=_0x2586a7['content'];}}});}return _0x56b9bc;}function getTicket(_0x4e25b8,_0x328fdd,_0x4d9b68,_0x222847,_0x252288,_0x5ee81d,_0x3373c5){return new Promise(function(_0x2d4fa4,_0x3caaee){var _0x1641e0;return getAuthToken(_0x328fdd,_0x4d9b68,_0x3373c5)[_0xf28f('0x15')](function(_0x4aa3c1){if(_0x5ee81d[_0xf28f('0x3e')]==='incident'){_0x1641e0={'method':_0xf28f('0x12'),'uri':_0x222847+_0xf28f('0x3f'),'body':Object[_0xf28f('0x40')]({},{'title':intUtil[_0xf28f('0x41')](_0x5ee81d[_0xf28f('0x42')],_0x252288,'\x20'),'description':intUtil[_0xf28f('0x41')](_0x5ee81d[_0xf28f('0x43')],_0x252288,'\x0a'),'customerid_contact@odata.bind':_0x4e25b8[_0xf28f('0x31')]?'/contacts('+_0x4e25b8[_0xf28f('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4e25b8[_0xf28f('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x5ee81d[_0xf28f('0x44')],_0x252288,_0x5ee81d['ticketType'])),'headers':{'Authorization':_0xf28f('0x1a')+_0x4aa3c1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5ee81d[_0xf28f('0x3e')]===_0xf28f('0x45')){var _0x5447d7=_0x4e25b8[_0xf28f('0x31')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4e25b8['userId']+')','participationtypemask':_0x4e25b8[_0xf28f('0x46')]===_0xf28f('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xf28f('0x48')+_0x4e25b8[_0xf28f('0x31')]+')','participationtypemask':_0x4e25b8[_0xf28f('0x46')]===_0xf28f('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xf28f('0x2d')+_0x4e25b8[_0xf28f('0x28')]+')','participationtypemask':_0x4e25b8[_0xf28f('0x46')]===_0xf28f('0x47')?0x2:0x1}];_0x1641e0={'method':'POST','uri':_0x222847+_0xf28f('0x49'),'body':Object[_0xf28f('0x40')]({},{'subject':intUtil[_0xf28f('0x41')](_0x5ee81d[_0xf28f('0x42')],_0x252288,'\x20'),'phonenumber':String(_0x252288[_0xf28f('0x2c')]),'description':intUtil['getString'](_0x5ee81d[_0xf28f('0x43')],_0x252288,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4e25b8[_0xf28f('0x31')]?_0xf28f('0x48')+_0x4e25b8[_0xf28f('0x31')]+')':undefined,'ownerid@odata.bind':_0xf28f('0x2d')+_0x4e25b8[_0xf28f('0x28')]+')','directioncode':_0x4e25b8[_0xf28f('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':_0x5447d7},getCustomFields(_0x5ee81d[_0xf28f('0x44')],_0x252288,_0x5ee81d[_0xf28f('0x3e')])),'headers':{'Authorization':_0xf28f('0x1a')+_0x4aa3c1,'OData-Version':_0xf28f('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1641e0);})[_0xf28f('0x15')](function(_0x44873e){var _0x2aab7d=_0x44873e[_0xf28f('0x2e')][_0xf28f('0x2f')];var _0x2d4618=_0x2aab7d[_0xf28f('0x3d')](_0x2aab7d[_0xf28f('0x30')]('(')+0x1,_0x2aab7d[_0xf28f('0x30')](')'));_0x4e25b8['ticketId']=_0x2d4618;_0x2d4fa4(_0x4e25b8);})[_0xf28f('0x29')](function(_0x38fd71){_0x3caaee(_0x38fd71[_0xf28f('0x18')]);});});}function emit(_0x525947,_0x45e535,_0x3e46de,_0x4e3ea7){var _0x51903e={'uri':util['format'](_0xf28f('0x4a'),_0x525947,_0x3e46de,_0x4e3ea7)};io['to'](util[_0xf28f('0x4b')](_0xf28f('0x4c'),_0x45e535))[_0xf28f('0x4d')]('trigger:browser:url',_0x51903e);}exports['cs']=function(_0x4dfcf4,_0x2812bd,_0xfd36fa,_0x10fec2,_0x281d84,_0x1f8cb6,_0x88259d,_0x4d6d5d){var _0x4dbbc4={};_0x1f8cb6[_0xf28f('0xc')]=_0x1f8cb6[_0xf28f('0x4e')]?intUtil[_0xf28f('0x4f')](_0x1f8cb6[_0xf28f('0xd')][_0xf28f('0xe')]):intUtil[_0xf28f('0x4f')](_0x1f8cb6[_0xf28f('0xc')]);_0x1f8cb6[_0xf28f('0x50')]=intUtil[_0xf28f('0x4f')](_0x1f8cb6[_0xf28f('0x50')]);_0x4dbbc4[_0xf28f('0x46')]=_0x4d6d5d==='queue'||_0x4d6d5d==='unmanaged'?_0xf28f('0x47'):_0xf28f('0x2b');var _0x6a274d=_0x1f8cb6[_0xf28f('0x4e')]?util[_0xf28f('0x4b')](_0xf28f('0x51'),_0x1f8cb6[_0xf28f('0xd')][_0xf28f('0xe')]):util[_0xf28f('0x4b')](_0xf28f('0x51'),_0x1f8cb6[_0xf28f('0xc')]);var _0x233bae=util[_0xf28f('0x4b')](_0xf28f('0x52'),_0x1f8cb6[_0xf28f('0x53')]);var _0x572866=util[_0xf28f('0x4b')](_0xf28f('0x54'),_0x1f8cb6[_0xf28f('0x50')],_0x2812bd[_0xf28f('0x55')],md5(_0x2812bd[_0xf28f('0x55')]));if(_0x281d84&&_0x281d84[_0xf28f('0x56')]){logger[_0xf28f('0x25')](_0xf28f('0x57'),_0xf28f('0x58'));_0x2812bd[_0xf28f('0x59')]=_0x572866;}else if(_0x88259d&&_0x88259d[_0xf28f('0x5a')]&&_0x88259d[_0xf28f('0x5a')]!==_0xf28f('0x5b')){logger['info'](_0xf28f('0x5c'),_0xf28f('0x58'));_0x2812bd['recordingURL']=_0x572866;}else{_0x2812bd[_0xf28f('0x59')]='';}return getUser(_0x4dbbc4,_0x1f8cb6,_0x10fec2,_0x233bae,_0x6a274d,_0x4d6d5d)[_0xf28f('0x15')](function(_0x3da7bb){logger[_0xf28f('0x25')]('['+_0x4d6d5d['toUpperCase']()+_0xf28f('0x5d'),_0x3da7bb['userId']);logger['info']('['+_0x4d6d5d['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x3da7bb['userEmail']);return getEndUser(_0x3da7bb,_0x1f8cb6,_0x233bae,_0x6a274d,_0x2812bd,_0x4d6d5d,_0xfd36fa[_0xf28f('0x5e')],_0xfd36fa[_0xf28f('0x5f')]);})[_0xf28f('0x15')](function(_0x231673){logger[_0xf28f('0x25')]('['+_0x4d6d5d[_0xf28f('0x22')]()+_0xf28f('0x60'),_0x231673['enduserId']);logger[_0xf28f('0x25')]('['+_0x4d6d5d['toUpperCase']()+_0xf28f('0x61'),_0x2812bd['calleridnum']);return getTicket(_0x231673,_0x1f8cb6,_0x233bae,_0x6a274d,_0x2812bd,_0xfd36fa,_0x4d6d5d);})[_0xf28f('0x15')](function(_0xa65651){logger['info'](util[_0xf28f('0x4b')]('['+_0x4d6d5d[_0xf28f('0x22')]()+_0xf28f('0x62'),_0xfd36fa[_0xf28f('0x3e')],_0xa65651[_0xf28f('0x63')]));logger[_0xf28f('0x25')](util[_0xf28f('0x4b')]('['+_0x4d6d5d[_0xf28f('0x22')]()+_0xf28f('0x64'),_0x4d6d5d));if(_0x4d6d5d!==_0xf28f('0x65')&&_0xfd36fa[_0xf28f('0x66')]){logger[_0xf28f('0x25')]('['+_0x4d6d5d[_0xf28f('0x22')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1f8cb6[_0xf28f('0xc')],_0x10fec2[_0xf28f('0x67')],_0xfd36fa[_0xf28f('0x3e')],_0xa65651[_0xf28f('0x63')]);}})[_0xf28f('0x29')](function(_0x1f3843){logger[_0xf28f('0x16')]('['+_0x4d6d5d[_0xf28f('0x22')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x1f3843[_0xf28f('0x18')]);console[_0xf28f('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x1f3843);});}; \ No newline at end of file +var _0xc094=['recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','callDirection','queue','phonecalls','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x2b866a,_0x1c438){var _0xe61447=function(_0x347ce7){while(--_0x347ce7){_0x2b866a['push'](_0x2b866a['shift']());}};_0xe61447(++_0x1c438);}(_0xc094,0x80));var _0x4c09=function(_0x58a643,_0xcc629a){_0x58a643=_0x58a643-0x0;var _0x15cb46=_0xc094[_0x58a643];return _0x15cb46;};'use strict';var _=require(_0x4c09('0x0'));var rp=require(_0x4c09('0x1'));var util=require(_0x4c09('0x2'));var intUtil=require(_0x4c09('0x3'));var md5=require(_0x4c09('0x4'));var Redis=require(_0x4c09('0x5'));var logger=require(_0x4c09('0x6'))(_0x4c09('0x7'));var config=require(_0x4c09('0x8'));config[_0x4c09('0x9')]=_[_0x4c09('0xa')](config[_0x4c09('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4c09('0xb'))(new Redis(config[_0x4c09('0x9')]));function getAuthToken(_0x5958c3,_0x1480c0,_0x668986){if(_0x5958c3['modernAuthentication']){_0x5958c3['remoteUri']=_0x5958c3[_0x4c09('0xc')][_0x4c09('0xd')];_0x5958c3[_0x4c09('0xe')]=_0x5958c3['CloudProvider'][_0x4c09('0xf')];return Promise[_0x4c09('0x10')](_0x5958c3[_0x4c09('0xc')][_0x4c09('0x11')]);}var _0x599c4d={'method':_0x4c09('0x12'),'uri':_0x1480c0,'form':{'client_id':_0x5958c3[_0x4c09('0x13')],'resource':_0x5958c3[_0x4c09('0x14')],'username':_0x5958c3['username'],'password':_0x5958c3[_0x4c09('0x15')],'grant_type':_0x4c09('0x15'),'client_secret':_0x5958c3[_0x4c09('0x16')]},'json':!![]};return rp(_0x599c4d)['then'](function(_0x425edf){return _0x425edf[_0x4c09('0x17')];})[_0x4c09('0x18')](function(_0x578a07){logger[_0x4c09('0x19')]('['+[_0x668986[_0x4c09('0x1a')]()]+_0x4c09('0x1b'));return _0x578a07[_0x4c09('0x1c')];});}function getUser(_0x5c715d,_0x53f8b4,_0x3a79f3,_0xb1ecc1,_0x3676b9,_0x52c084){return new Promise(function(_0x45a540,_0x1aef18){return getAuthToken(_0x53f8b4,_0xb1ecc1,_0x52c084)[_0x4c09('0x1d')](function(_0x5bada6){var _0x262cc2={'method':_0x4c09('0x1e'),'uri':_0x3676b9+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4c09('0x1f')+_0x5bada6,'OData-Version':_0x4c09('0x20')},'json':!![]};return rp(_0x262cc2);})[_0x4c09('0x1d')](function(_0x33c3b4){var _0x2289c0=_0x33c3b4[_0x4c09('0x21')];var _0x2c70d4=![];var _0x234349=null;if(!_[_0x4c09('0x22')](_0x3a79f3)){if(intUtil[_0x4c09('0x23')](_0x3a79f3[_0x4c09('0x24')])){_0x5c715d['userEmail']=_0x3a79f3[_0x4c09('0x24')];for(_0x234349=0x0;_0x234349<_0x2289c0[_0x4c09('0x25')];_0x234349++){if(_0x2289c0[_0x234349][_0x4c09('0x26')]===_0x3a79f3[_0x4c09('0x24')]&&!_0x2289c0[_0x234349][_0x4c09('0x27')]){_0x2c70d4=!![];logger['info']('['+[_0x52c084[_0x4c09('0x1a')]()]+_0x4c09('0x28')+_0x2289c0[_0x234349][_0x4c09('0x29')]+'!');_0x5c715d['userId']=_0x2289c0[_0x234349][_0x4c09('0x29')];}}}}if(!_0x2c70d4){logger[_0x4c09('0x2a')]('['+[_0x52c084[_0x4c09('0x1a')]()]+_0x4c09('0x2b'));_0x5c715d[_0x4c09('0x2c')]=_0x53f8b4[_0x4c09('0x2d')];for(_0x234349=0x0;_0x234349<_0x2289c0[_0x4c09('0x25')];_0x234349++){if(_0x2289c0[_0x234349][_0x4c09('0x26')]===_0x53f8b4[_0x4c09('0x2d')]){_0x5c715d[_0x4c09('0x2e')]=_0x2289c0[_0x234349]['systemuserid'];}}}_0x45a540(_0x5c715d);})['catch'](function(_0x200942){_0x1aef18(_0x200942[_0x4c09('0x1c')]);});});}function createEndUser(_0x5c5d03,_0x6be54f,_0x3f301b,_0x28d8a1,_0x487787,_0x34bf5e,_0x3c9a68){return new Promise(function(_0x32460d,_0x26eb01){return getAuthToken(_0x6be54f,_0x3f301b,_0x34bf5e)[_0x4c09('0x1d')](function(_0x3ec048){var _0x3bfeba=_0x34bf5e[_0x4c09('0x2f')]()===_0x4c09('0x30')?_0x487787[_0x4c09('0x31')]:_0x487787[_0x4c09('0x32')];var _0x12b5db={'method':_0x4c09('0x12'),'uri':_0x28d8a1+_0x4c09('0x33'),'body':{'fullname':_0x3bfeba,'firstname':_0x3bfeba,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5c5d03[_0x4c09('0x2e')]+')'},'headers':{'Authorization':_0x4c09('0x1f')+_0x3ec048,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x12b5db[_0x4c09('0x34')][_0x3c9a68]=_0x3bfeba;return rp(_0x12b5db);})[_0x4c09('0x1d')](function(_0x470337){var _0x3e068b=_0x470337[_0x4c09('0x35')]['odata-entityid'];var _0x1fada6=_0x3e068b['substring'](_0x3e068b[_0x4c09('0x36')]('(')+0x1,_0x3e068b['lastIndexOf'](')'));_0x5c5d03[_0x4c09('0x37')]=_0x1fada6;_0x32460d(_0x5c5d03);})[_0x4c09('0x18')](function(_0x3b687d){_0x26eb01(_0x3b687d[_0x4c09('0x1c')]);});});}function getEndUser(_0x1d61c8,_0x40febe,_0xa46c1a,_0xa63cca,_0x51d0f1,_0x738c03,_0x78d7f9,_0xa5ee93){var _0x2a1008=_0x738c03[_0x4c09('0x2f')]()===_0x4c09('0x30')?_0x51d0f1[_0x4c09('0x31')]:_0x51d0f1['calleridnum'];return getAuthToken(_0x40febe,_0xa46c1a,_0x738c03)[_0x4c09('0x1d')](function(_0x1521ad){_0xa5ee93=_0xa5ee93?_0xa5ee93:_0x4c09('0x38');var _0x545fc4={'method':_0x4c09('0x1e'),'uri':_0xa63cca+_0x4c09('0x39')+_0xa5ee93+_0x4c09('0x3a')+_0xa5ee93+'\x20eq\x20\x27'+_0x2a1008[_0x4c09('0x3b')]('+','%2b')+'\x27','headers':{'Authorization':_0x4c09('0x1f')+_0x1521ad,'If-None-Match':null,'OData-Version':_0x4c09('0x20')},'json':!![]};return rp(_0x545fc4);})['then'](function(_0x4bff2f){var _0x3fa5f7=![];if(!_0x4bff2f)return _0x3fa5f7;var _0x727203=_0x4bff2f[_0x4c09('0x21')];for(var _0x469453=0x0;_0x469453<_0x727203[_0x4c09('0x25')];_0x469453++){if(_0x727203[_0x469453][_0xa5ee93]===_0x2a1008){_0x3fa5f7=!![];_0x1d61c8[_0x4c09('0x37')]=_0x727203[_0x469453][_0x4c09('0x3c')];}}return _0x3fa5f7;})['then'](function(_0x15850e){if(_0x15850e)return _0x1d61c8;if(_0x78d7f9==='nothing'){logger[_0x4c09('0x2a')]('['+[_0x738c03['toUpperCase']()]+_0x4c09('0x3d'));return _0x1d61c8;}return createEndUser(_0x1d61c8,_0x40febe,_0xa46c1a,_0xa63cca,_0x51d0f1,_0x738c03,_0xa5ee93)['then'](function(_0x4d04fe){logger[_0x4c09('0x2a')]('['+[_0x738c03['toUpperCase']()]+_0x4c09('0x3e'),_0x4d04fe[_0x4c09('0x37')]);return _0x4d04fe;});});}function getCustomFields(_0x4e0168,_0x1e6b55,_0x235709){var _0x1d7bca={};if(_0x4e0168[_0x4c09('0x25')]>0x0){_[_0x4c09('0x3f')](_0x4e0168,function(_0x3a5dc1){if(_[_0x4c09('0x40')]([_0x4c09('0x41'),_0x4c09('0x42')],_0x3a5dc1[_0x4c09('0x43')])&&_0x3a5dc1['nameField']&&!_0x3a5dc1[_0x4c09('0x44')]){var _0x28b163=_0x3a5dc1[_0x4c09('0x45')][_0x4c09('0x2f')]();var _0xb577cc=_0x28b163[_0x4c09('0x46')](0x0,_0x28b163['indexOf']('_'));var _0x14b078=_0x28b163['substring'](_0x28b163[_0x4c09('0x47')]('_')+0x1);if(_0xb577cc===_0x235709){_0x1d7bca[_0x14b078]=_0x3a5dc1[_0x4c09('0x48')];}}});}return _0x1d7bca;}function getTicket(_0x4f1166,_0x4eae00,_0x216205,_0x5e21a2,_0x2484f1,_0x4bc052,_0x587ef8){return new Promise(function(_0x4ccbbd,_0x45f1a8){var _0x48d826;return getAuthToken(_0x4eae00,_0x216205,_0x587ef8)[_0x4c09('0x1d')](function(_0x5ba123){if(_0x4bc052[_0x4c09('0x49')]===_0x4c09('0x4a')){_0x48d826={'method':'POST','uri':_0x5e21a2+_0x4c09('0x4b'),'body':Object[_0x4c09('0x4c')]({},{'title':intUtil[_0x4c09('0x4d')](_0x4bc052[_0x4c09('0x4e')],_0x2484f1,'\x20'),'description':intUtil['getString'](_0x4bc052[_0x4c09('0x4f')],_0x2484f1,'\x0a'),'customerid_contact@odata.bind':_0x4f1166[_0x4c09('0x37')]?_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')':undefined,'ownerid@odata.bind':_0x4c09('0x51')+_0x4f1166['userId']+')','caseorigincode':'1'},getCustomFields(_0x4bc052['Fields'],_0x2484f1,_0x4bc052['ticketType'])),'headers':{'Authorization':_0x4c09('0x1f')+_0x5ba123,'OData-Version':_0x4c09('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4bc052['ticketType']==='phonecall'){var _0x169c1a=_0x4f1166[_0x4c09('0x37')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4f1166['userId']+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]===_0x4c09('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x4c09('0x51')+_0x4f1166[_0x4c09('0x2e')]+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]==='queue'?0x2:0x1}];_0x48d826={'method':_0x4c09('0x12'),'uri':_0x5e21a2+_0x4c09('0x54'),'body':Object[_0x4c09('0x4c')]({},{'subject':intUtil[_0x4c09('0x4d')](_0x4bc052['Subjects'],_0x2484f1,'\x20'),'phonenumber':String(_0x2484f1[_0x4c09('0x32')]),'description':intUtil[_0x4c09('0x4d')](_0x4bc052['Descriptions'],_0x2484f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4f1166[_0x4c09('0x37')]?_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')':undefined,'ownerid@odata.bind':_0x4c09('0x51')+_0x4f1166['userId']+')','directioncode':_0x4f1166[_0x4c09('0x52')]===_0x4c09('0x53')?![]:!![],'phonecall_activity_parties':_0x169c1a},getCustomFields(_0x4bc052[_0x4c09('0x55')],_0x2484f1,_0x4bc052[_0x4c09('0x49')])),'headers':{'Authorization':_0x4c09('0x1f')+_0x5ba123,'OData-Version':_0x4c09('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x48d826);})[_0x4c09('0x1d')](function(_0x542eb5){var _0xa36779=_0x542eb5[_0x4c09('0x35')]['odata-entityid'];var _0x3cab74=_0xa36779[_0x4c09('0x46')](_0xa36779[_0x4c09('0x36')]('(')+0x1,_0xa36779[_0x4c09('0x36')](')'));_0x4f1166[_0x4c09('0x56')]=_0x3cab74;_0x4ccbbd(_0x4f1166);})[_0x4c09('0x18')](function(_0x4d486b){_0x45f1a8(_0x4d486b[_0x4c09('0x1c')]);});});}function emit(_0x55dfb8,_0x32cd4d,_0x3659c5,_0x418aae){var _0x188c60={'uri':util[_0x4c09('0x57')](_0x4c09('0x58'),_0x55dfb8,_0x3659c5,_0x418aae)};io['to'](util['format'](_0x4c09('0x59'),_0x32cd4d))[_0x4c09('0x5a')](_0x4c09('0x5b'),_0x188c60);}exports['cs']=function(_0x40c4c8,_0x25d9a5,_0x49f256,_0x276029,_0x4e152f,_0x48b680,_0x4018a7,_0x7b9ff1){var _0x54d26f={};_0x48b680[_0x4c09('0x14')]=_0x48b680[_0x4c09('0x5c')]?intUtil[_0x4c09('0x5d')](_0x48b680['CloudProvider'][_0x4c09('0xd')]):intUtil[_0x4c09('0x5d')](_0x48b680[_0x4c09('0x14')]);_0x48b680['serverUrl']=intUtil[_0x4c09('0x5d')](_0x48b680[_0x4c09('0x5e')]);_0x54d26f[_0x4c09('0x52')]=_0x7b9ff1===_0x4c09('0x53')||_0x7b9ff1===_0x4c09('0x5f')?_0x4c09('0x53'):'outbound';var _0x12f5fb=_0x48b680[_0x4c09('0x5c')]?util['format'](_0x4c09('0x60'),_0x48b680[_0x4c09('0xc')][_0x4c09('0xd')]):util[_0x4c09('0x57')](_0x4c09('0x60'),_0x48b680[_0x4c09('0x14')]);var _0xb449c4=util[_0x4c09('0x57')](_0x4c09('0x61'),_0x48b680[_0x4c09('0xe')]);var _0xe774e6=util[_0x4c09('0x57')](_0x4c09('0x62'),_0x48b680[_0x4c09('0x5e')],_0x25d9a5[_0x4c09('0x63')],md5(_0x25d9a5[_0x4c09('0x63')]));if(_0x4e152f&&_0x4e152f['monitor_format']){logger[_0x4c09('0x2a')](_0x4c09('0x64'),_0x4c09('0x65'));_0x25d9a5[_0x4c09('0x66')]=_0xe774e6;}else if(_0x4018a7&&_0x4018a7[_0x4c09('0x67')]&&_0x4018a7[_0x4c09('0x67')]!=='none'){logger['info'](_0x4c09('0x68'),_0x4c09('0x65'));_0x25d9a5[_0x4c09('0x66')]=_0xe774e6;}else{_0x25d9a5[_0x4c09('0x66')]='';}return getUser(_0x54d26f,_0x48b680,_0x276029,_0xb449c4,_0x12f5fb,_0x7b9ff1)[_0x4c09('0x1d')](function(_0x19c4de){logger[_0x4c09('0x2a')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x69'),_0x19c4de[_0x4c09('0x2e')]);logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6a'),_0x19c4de['userEmail']);return getEndUser(_0x19c4de,_0x48b680,_0xb449c4,_0x12f5fb,_0x25d9a5,_0x7b9ff1,_0x49f256[_0x4c09('0x6b')],_0x49f256[_0x4c09('0x6c')]);})[_0x4c09('0x1d')](function(_0x62be3){logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x62be3[_0x4c09('0x37')]);logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6d'),_0x25d9a5[_0x4c09('0x32')]);return getTicket(_0x62be3,_0x48b680,_0xb449c4,_0x12f5fb,_0x25d9a5,_0x49f256,_0x7b9ff1);})[_0x4c09('0x1d')](function(_0xa875c5){logger['info'](util[_0x4c09('0x57')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6e'),_0x49f256[_0x4c09('0x49')],_0xa875c5[_0x4c09('0x56')]));logger[_0x4c09('0x2a')](util[_0x4c09('0x57')]('['+_0x7b9ff1['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x7b9ff1));if(_0x7b9ff1!==_0x4c09('0x5f')&&_0x49f256[_0x4c09('0x6f')]){logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+']',_0x4c09('0x70'));emit(_0x48b680['remoteUri'],_0x276029[_0x4c09('0x71')],_0x49f256[_0x4c09('0x49')],_0xa875c5[_0x4c09('0x56')]);}})[_0x4c09('0x18')](function(_0x23c197){logger[_0x4c09('0x19')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x72'),_0x23c197[_0x4c09('0x1c')]);console[_0x4c09('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x23c197);});}; \ 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 5b20346..600e76d 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 _0x48e6=['stringify','GET','map','includes','string','nameField','content','picklist','type','push','idField','variableName','customVariable','Variable','customField','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','uniqueid','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','[OUTBOUND]','monitor_format','lastevent','toUpperCase','calleridname','lodash','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]'];(function(_0x5e6bc0,_0x4099f4){var _0x3a9166=function(_0x13629f){while(--_0x13629f){_0x5e6bc0['push'](_0x5e6bc0['shift']());}};_0x3a9166(++_0x4099f4);}(_0x48e6,0xe3));var _0x648e=function(_0x45a6c8,_0x5c75ad){_0x45a6c8=_0x45a6c8-0x0;var _0x48e263=_0x48e6[_0x45a6c8];return _0x48e263;};'use strict';var _=require(_0x648e('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0x648e('0x1'));var intUtil=require(_0x648e('0x2'));var config=require(_0x648e('0x3'));var logger=require(_0x648e('0x4'))('freshdesk');config['redis']=_[_0x648e('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x648e('0x6'))(new Redis(config['redis']));var headers={'Content-Type':_0x648e('0x7'),'Accept':_0x648e('0x7')};function emit(_0x35d880,_0x17c6d0,_0x3e6702){io['to'](_0x35d880)[_0x648e('0x8')](_0x17c6d0,_0x3e6702);}function getTicket(_0x36e7bb,_0x3e4085,_0xbfd09f,_0x520c2c,_0x482464){logger[_0x648e('0x9')]('Creating\x20new\x20ticket...');var _0x47ae21=_[_0x648e('0xa')]({'responder_id':_0x3e4085['id'],'requester_id':_0xbfd09f['id'],'name':util[_0x648e('0xb')](_0x648e('0xc'),_0x482464['calleridname']),'phone':_0x482464[_0x648e('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x648e('0xe')](_0x520c2c[_0x648e('0xf')],_0x482464,'\x20'),'description':intUtil['getString'](_0x520c2c[_0x648e('0x10')],_0x482464,_0x648e('0x11')),'tags':getTags(_0x520c2c[_0x648e('0x12')],_0x648e('0x13'))},getCustomFields(_0x520c2c[_0x648e('0x14')],_0x482464));_0x47ae21[_0x648e('0x15')]=_[_0x648e('0x16')](_[_0x648e('0x17')](_0x47ae21[_0x648e('0x15')],'id'),_0x648e('0x18'));return request({'uri':util[_0x648e('0xb')](_0x648e('0x19'),_0x36e7bb['remoteUri']),'method':_0x648e('0x1a'),'body':_0x47ae21})[_0x648e('0x1b')](function(_0x24a0d5){logger[_0x648e('0x9')](_0x648e('0x1c'));return _0x24a0d5;});}function getUser(_0x177ef6,_0x4a4ebb){if(intUtil['validateEmail'](_0x4a4ebb)){return request({'uri':util['format'](_0x648e('0x1d'),_0x177ef6[_0x648e('0x1e')]),'qs':{'email':_0x4a4ebb}})[_0x648e('0x1b')](function(_0xaf14b3){if(_0xaf14b3['length']){logger['info'](_0x648e('0x1f'));return _[_0x648e('0x20')](_0xaf14b3,function(_0x67e83b){return _0x67e83b[_0x648e('0x21')][_0x648e('0x22')]===_0x4a4ebb;});}else{logger['info'](_0x648e('0x23'));return request({'uri':util[_0x648e('0xb')](_0x648e('0x24'),_0x177ef6['remoteUri'])})[_0x648e('0x1b')](function(_0x2a1644){logger['info'](_0x648e('0x25'));return _0x2a1644;});}});}else{logger['info'](_0x648e('0x26'));return request({'uri':util[_0x648e('0xb')]('%s/api/v2/agents/me',_0x177ef6[_0x648e('0x1e')])})[_0x648e('0x1b')](function(_0x1adf4b){logger[_0x648e('0x9')](_0x648e('0x25'));return _0x1adf4b;});}}function getEndUser(_0x11d0d5,_0x6566de,_0x19d291){logger[_0x648e('0x9')](_0x648e('0x27'),_0x19d291);return request({'uri':util[_0x648e('0xb')]('%s/api/v2/contacts',_0x11d0d5[_0x648e('0x1e')]),'qs':{'phone':_0x19d291}})[_0x648e('0x1b')](function(_0x586629){if(_0x586629[_0x648e('0x28')]){logger[_0x648e('0x9')](_0x648e('0x29'));return _['find'](_0x586629,{'phone':_0x19d291});}else{logger[_0x648e('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x648e('0xb')](_0x648e('0x2a'),_0x11d0d5[_0x648e('0x1e')]),'method':_0x648e('0x1a'),'body':{'name':_0x6566de,'phone':_0x19d291}})[_0x648e('0x1b')](function(_0x2aabfb){logger[_0x648e('0x9')](_0x648e('0x2b'));return _0x2aabfb;});}});}function getAuth(_0x4e6506){return util['format'](_0x648e('0x2c'),new Buffer(_0x4e6506[_0x648e('0x2d')]+':X')[_0x648e('0x2e')]('base64'));}function request(_0x2abca7){logger[_0x648e('0x2f')](_0x648e('0x30'),JSON[_0x648e('0x31')](_0x2abca7));return rp(_['defaults'](_0x2abca7,{'method':_0x648e('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2d849b,_0x403058){var _0x3ff1d3=[];if(_0x2d849b&&_0x2d849b['length']>0x0){_0x3ff1d3=_[_0x648e('0x33')](_0x2d849b,_0x403058);}return _0x3ff1d3;}function getCustomFields(_0x5648e5,_0x54bbbe){var _0x2589ab=[];var _0x30d324={'custom_fields':[]};if(_0x5648e5[_0x648e('0x28')]>0x0){_['forEach'](_0x5648e5,function(_0x1058d1){if(_[_0x648e('0x34')]([_0x648e('0x35'),'picklist'],_0x1058d1['type'])&&_0x1058d1[_0x648e('0x36')]&&!_0x1058d1['customField']){_0x30d324[_0x1058d1[_0x648e('0x36')]['toLowerCase']()]=_0x1058d1[_0x648e('0x37')][_0x648e('0x2e')]();}else if(_['includes']([_0x648e('0x35'),_0x648e('0x38')],_0x1058d1[_0x648e('0x39')])&&_0x1058d1['idField']&&_0x1058d1['customField']){_0x30d324[_0x648e('0x15')][_0x648e('0x3a')]({'id':_0x1058d1[_0x648e('0x3b')],'value':_0x1058d1[_0x648e('0x37')][_0x648e('0x2e')]()});}else if(_0x1058d1[_0x648e('0x39')]==='variable'&&_0x1058d1[_0x648e('0x3c')]&&_0x1058d1[_0x648e('0x3b')]&&_0x1058d1['customField']){_0x54bbbe[_0x1058d1[_0x648e('0x3c')]]&&_0x30d324['custom_fields'][_0x648e('0x3a')]({'id':_0x1058d1['idField'],'value':_0x54bbbe[_0x1058d1[_0x648e('0x3c')]][_0x648e('0x2e')]()});}else if(_0x1058d1['type']===_0x648e('0x3d')&&_0x1058d1[_0x648e('0x3e')]&&_0x1058d1[_0x648e('0x3e')][_0x648e('0x13')]&&_0x1058d1[_0x648e('0x3b')]&&_0x1058d1[_0x648e('0x3f')]){_0x54bbbe[_0x1058d1[_0x648e('0x3e')][_0x648e('0x13')]['toLowerCase']()]&&_0x30d324['custom_fields'][_0x648e('0x3a')]({'id':_0x1058d1[_0x648e('0x3b')],'value':_0x54bbbe[_0x1058d1[_0x648e('0x3e')][_0x648e('0x13')][_0x648e('0x40')]()][_0x648e('0x2e')]()});}});}return _0x30d324;}exports[_0x648e('0x41')]=function(_0x557913,_0xdf1ae4,_0x11049d,_0xc3ba4a,_0xab9224,_0xe48c4b){var _0x10f041,_0x2be6ab;_0xe48c4b['remoteUri']=intUtil[_0x648e('0x42')](_0xe48c4b[_0x648e('0x1e')]);_0xe48c4b[_0x648e('0x43')]=intUtil[_0x648e('0x42')](_0xe48c4b[_0x648e('0x43')]);if(_0xab9224&&_0xab9224['monitor_format']){logger['info'](_0x648e('0x44'),_0x648e('0x45'));_0xdf1ae4[_0x648e('0x46')]=util[_0x648e('0xb')](_0x648e('0x47'),_0xe48c4b['serverUrl'],_0xdf1ae4['uniqueid'],md5(_0xdf1ae4['uniqueid']));}else{_0xdf1ae4[_0x648e('0x46')]='';}headers[_0x648e('0x48')]=getAuth(_0xe48c4b);return getUser(_0xe48c4b,_0xc3ba4a[_0x648e('0x22')])['then'](function(_0x489d81){_0x10f041=_0x489d81;logger['info'](_0x648e('0x49'),_0x10f041['id']);return getEndUser(_0xe48c4b,_0xdf1ae4['calleridname'],_0xdf1ae4['calleridnum']);})['then'](function(_0x3335fc){_0x2be6ab=_0x3335fc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2be6ab['id']);return getTicket(_0xe48c4b,_0x10f041,_0x2be6ab,_0x11049d,_0xdf1ae4);})[_0x648e('0x1b')](function(_0x336bc8){if(_0x336bc8&&_0x336bc8['id']){logger[_0x648e('0x9')](_0x648e('0x1c'));logger[_0x648e('0x9')](_0x648e('0x4a'),_0x336bc8['id']);logger[_0x648e('0x9')](_0x648e('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x648e('0xb')](_0x648e('0x4b'),_0xc3ba4a['name']),'trigger:browser:url',{'uri':util[_0x648e('0xb')](_0x648e('0x4c'),_0xe48c4b['remoteUri'],_0x336bc8['id'])});}})[_0x648e('0x4d')](function(_0xf5201a){logger[_0x648e('0x4e')]('[QUEUE]',JSON[_0x648e('0x31')](_0xf5201a));});};exports[_0x648e('0x4f')]=function(_0x13ba46,_0x4b049e,_0x2c4060,_0x2bc876,_0x1b0e49,_0x30ba00,_0xea5c2a){var _0x25e7af,_0x4d15cf;_0x30ba00['remoteUri']=intUtil[_0x648e('0x42')](_0x30ba00[_0x648e('0x1e')]);_0x30ba00['serverUrl']=intUtil[_0x648e('0x42')](_0x30ba00['serverUrl']);if(_0xea5c2a&&_0xea5c2a['recordingFormat']&&_0xea5c2a[_0x648e('0x50')]!==_0x648e('0x51')){logger['info']('[OUTBOUND]',_0x648e('0x45'));_0x4b049e[_0x648e('0x46')]=util[_0x648e('0xb')](_0x648e('0x47'),_0x30ba00[_0x648e('0x43')],_0x4b049e[_0x648e('0x52')],md5(_0x4b049e[_0x648e('0x52')]));}headers[_0x648e('0x48')]=getAuth(_0x30ba00);return getUser(_0x30ba00,_0x2bc876[_0x648e('0x22')])[_0x648e('0x1b')](function(_0xa9b7cf){_0x25e7af=_0xa9b7cf;logger[_0x648e('0x9')](_0x648e('0x49'),_0x25e7af['id']);return getEndUser(_0x30ba00,_0x4b049e[_0x648e('0x53')],_0x4b049e['destcalleridnum']);})[_0x648e('0x1b')](function(_0x1c4e0a){_0x4d15cf=_0x1c4e0a;logger['info'](_0x648e('0x54'),_0x4d15cf['id']);return getTicket(_0x30ba00,_0x25e7af,_0x4d15cf,_0x2c4060,_0x4b049e);})[_0x648e('0x1b')](function(_0x42a2e9){if(_0x42a2e9&&_0x42a2e9['id']){logger['info']('Ticket\x20created!');logger[_0x648e('0x9')]('The\x20Ticket\x20ID\x20is:',_0x42a2e9['id']);logger[_0x648e('0x9')]('[OUTBOUND]',_0x648e('0x55'));emit(util['format'](_0x648e('0x4b'),_0x2bc876[_0x648e('0x13')]),_0x648e('0x56'),{'uri':util[_0x648e('0xb')](_0x648e('0x4c'),_0x30ba00['remoteUri'],_0x42a2e9['id'])});}})[_0x648e('0x4d')](function(_0x56635a){logger[_0x648e('0x4e')](_0x648e('0x57'),JSON[_0x648e('0x31')](_0x56635a));});};exports['unmanaged']=function(_0x3d18c8,_0x5b8551,_0x44ddaa,_0x4cfc22,_0x2cae0f,_0xb3e72c){var _0x1756c8,_0x573371;_0xb3e72c[_0x648e('0x1e')]=intUtil[_0x648e('0x42')](_0xb3e72c[_0x648e('0x1e')]);_0xb3e72c[_0x648e('0x43')]=intUtil[_0x648e('0x42')](_0xb3e72c[_0x648e('0x43')]);if(_0x2cae0f&&_0x2cae0f[_0x648e('0x58')]){logger[_0x648e('0x9')]('['+_0x5b8551[_0x648e('0x59')][_0x648e('0x5a')]()+']','Recording\x20is\x20enabled!');_0x5b8551['recordingURL']=util['format'](_0x648e('0x47'),_0xb3e72c[_0x648e('0x43')],_0x5b8551['uniqueid'],md5(_0x5b8551[_0x648e('0x52')]));}else{_0x5b8551['recordingURL']='';}headers[_0x648e('0x48')]=getAuth(_0xb3e72c);return getUser(_0xb3e72c,'')['then'](function(_0x49ae77){_0x1756c8=_0x49ae77;logger[_0x648e('0x9')](_0x648e('0x49'),_0x1756c8['id']);return getEndUser(_0xb3e72c,_0x5b8551[_0x648e('0x5b')],_0x5b8551[_0x648e('0xd')]);})[_0x648e('0x1b')](function(_0x2f1758){_0x573371=_0x2f1758;logger[_0x648e('0x9')]('The\x20Enduser\x20ID\x20is:',_0x573371['id']);return getTicket(_0xb3e72c,_0x1756c8,_0x573371,_0x44ddaa,_0x5b8551);})['then'](function(_0x404770){if(_0x404770){logger['info'](_0x648e('0x1c'));logger[_0x648e('0x9')]('The\x20Ticket\x20ID\x20is:',_0x404770['id']);}})['catch'](function(_0xba5c98){logger[_0x648e('0x4e')]('['+_0x5b8551[_0x648e('0x59')]['toUpperCase']()+']',JSON[_0x648e('0x31')](_0xba5c98));});}; \ No newline at end of file +var _0x0d53=['Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','map','string','picklist','nameField','customField','content','includes','idField','push','variable','variableName','customVariable'];(function(_0x26376c,_0x34b0aa){var _0x468bbf=function(_0x467113){while(--_0x467113){_0x26376c['push'](_0x26376c['shift']());}};_0x468bbf(++_0x34b0aa);}(_0x0d53,0xd4));var _0x30d5=function(_0xad23ac,_0x5df7e6){_0xad23ac=_0xad23ac-0x0;var _0x2f4fc2=_0x0d53[_0xad23ac];return _0x2f4fc2;};'use strict';var _=require(_0x30d5('0x0'));var rp=require('request-promise');var md5=require(_0x30d5('0x1'));var util=require('util');var Redis=require(_0x30d5('0x2'));var intUtil=require(_0x30d5('0x3'));var config=require(_0x30d5('0x4'));var logger=require('../../../../config/logger')(_0x30d5('0x5'));config[_0x30d5('0x6')]=_[_0x30d5('0x7')](config['redis'],{'host':_0x30d5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x30d5('0x9'),'Accept':_0x30d5('0x9')};function emit(_0x5205d4,_0x17691c,_0x5e1ab7){io['to'](_0x5205d4)[_0x30d5('0xa')](_0x17691c,_0x5e1ab7);}function getTicket(_0x1ad8a4,_0x4a730e,_0x33f979,_0x4c0695,_0x532c08){logger[_0x30d5('0xb')](_0x30d5('0xc'));var _0x324976=_[_0x30d5('0xd')]({'responder_id':_0x4a730e['id'],'requester_id':_0x33f979['id'],'name':util[_0x30d5('0xe')](_0x30d5('0xf'),_0x532c08[_0x30d5('0x10')]),'phone':_0x532c08[_0x30d5('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x30d5('0x12')](_0x4c0695[_0x30d5('0x13')],_0x532c08,'\x20'),'description':intUtil['getString'](_0x4c0695[_0x30d5('0x14')],_0x532c08,_0x30d5('0x15')),'tags':getTags(_0x4c0695['Tags'],'name')},getCustomFields(_0x4c0695[_0x30d5('0x16')],_0x532c08));_0x324976[_0x30d5('0x17')]=_[_0x30d5('0x18')](_[_0x30d5('0x19')](_0x324976['custom_fields'],'id'),_0x30d5('0x1a'));return request({'uri':util[_0x30d5('0xe')](_0x30d5('0x1b'),_0x1ad8a4[_0x30d5('0x1c')]),'method':_0x30d5('0x1d'),'body':_0x324976})[_0x30d5('0x1e')](function(_0x326dfb){logger[_0x30d5('0xb')](_0x30d5('0x1f'));return _0x326dfb;});}function getUser(_0x3a2093,_0x3f2909){if(intUtil[_0x30d5('0x20')](_0x3f2909)){return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents',_0x3a2093[_0x30d5('0x1c')]),'qs':{'email':_0x3f2909}})['then'](function(_0x44a6e0){if(_0x44a6e0['length']){logger['info']('Agent\x20found!');return _[_0x30d5('0x21')](_0x44a6e0,function(_0x79ddef){return _0x79ddef[_0x30d5('0x22')][_0x30d5('0x23')]===_0x3f2909;});}else{logger[_0x30d5('0xb')](_0x30d5('0x24'));return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents/me',_0x3a2093[_0x30d5('0x1c')])})[_0x30d5('0x1e')](function(_0x129490){logger[_0x30d5('0xb')](_0x30d5('0x25'));return _0x129490;});}});}else{logger['info'](_0x30d5('0x26'));return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents/me',_0x3a2093[_0x30d5('0x1c')])})[_0x30d5('0x1e')](function(_0x3aa2a3){logger[_0x30d5('0xb')](_0x30d5('0x25'));return _0x3aa2a3;});}}function getEndUser(_0x6ad8c3,_0x5c343a,_0x5481a0){logger['info']('Searching\x20enduser\x20with\x20phone',_0x5481a0);return request({'uri':util['format']('%s/api/v2/contacts',_0x6ad8c3[_0x30d5('0x1c')]),'qs':{'phone':_0x5481a0}})[_0x30d5('0x1e')](function(_0x3bdf3d){if(_0x3bdf3d[_0x30d5('0x27')]){logger['info']('Enduser\x20found!');return _[_0x30d5('0x21')](_0x3bdf3d,{'phone':_0x5481a0});}else{logger[_0x30d5('0xb')](_0x30d5('0x28'));return request({'uri':util[_0x30d5('0xe')](_0x30d5('0x29'),_0x6ad8c3[_0x30d5('0x1c')]),'method':_0x30d5('0x1d'),'body':{'name':_0x5c343a,'phone':_0x5481a0}})[_0x30d5('0x1e')](function(_0x2a0786){logger[_0x30d5('0xb')](_0x30d5('0x2a'));return _0x2a0786;});}});}function getAuth(_0x296fc0){return util[_0x30d5('0xe')](_0x30d5('0x2b'),new Buffer(_0x296fc0[_0x30d5('0x2c')]+':X')[_0x30d5('0x2d')]('base64'));}function request(_0x41f8c2){logger[_0x30d5('0x2e')](_0x30d5('0x2f'),JSON[_0x30d5('0x30')](_0x41f8c2));return rp(_['defaults'](_0x41f8c2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x160322,_0x58248b){var _0x45e695=[];if(_0x160322&&_0x160322[_0x30d5('0x27')]>0x0){_0x45e695=_[_0x30d5('0x31')](_0x160322,_0x58248b);}return _0x45e695;}function getCustomFields(_0x9ebb6d,_0x6565e0){var _0x5f0323=[];var _0xb88eb4={'custom_fields':[]};if(_0x9ebb6d[_0x30d5('0x27')]>0x0){_['forEach'](_0x9ebb6d,function(_0x6a1689){if(_['includes']([_0x30d5('0x32'),_0x30d5('0x33')],_0x6a1689['type'])&&_0x6a1689[_0x30d5('0x34')]&&!_0x6a1689[_0x30d5('0x35')]){_0xb88eb4[_0x6a1689[_0x30d5('0x34')]['toLowerCase']()]=_0x6a1689[_0x30d5('0x36')][_0x30d5('0x2d')]();}else if(_[_0x30d5('0x37')]([_0x30d5('0x32'),'picklist'],_0x6a1689['type'])&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689[_0x30d5('0x35')]){_0xb88eb4[_0x30d5('0x17')][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6a1689[_0x30d5('0x36')][_0x30d5('0x2d')]()});}else if(_0x6a1689['type']===_0x30d5('0x3a')&&_0x6a1689[_0x30d5('0x3b')]&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689[_0x30d5('0x35')]){_0x6565e0[_0x6a1689[_0x30d5('0x3b')]]&&_0xb88eb4[_0x30d5('0x17')][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6565e0[_0x6a1689[_0x30d5('0x3b')]][_0x30d5('0x2d')]()});}else if(_0x6a1689['type']===_0x30d5('0x3c')&&_0x6a1689['Variable']&&_0x6a1689[_0x30d5('0x3d')][_0x30d5('0x3e')]&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689['customField']){_0x6565e0[_0x6a1689[_0x30d5('0x3d')][_0x30d5('0x3e')][_0x30d5('0x3f')]()]&&_0xb88eb4['custom_fields'][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6565e0[_0x6a1689['Variable']['name'][_0x30d5('0x3f')]()][_0x30d5('0x2d')]()});}});}return _0xb88eb4;}exports[_0x30d5('0x40')]=function(_0x4e5b61,_0x54d61a,_0x5a7895,_0x1f04b5,_0xf0ae5c,_0x36d37d){var _0x2c0860,_0x398a62;_0x36d37d[_0x30d5('0x1c')]=intUtil[_0x30d5('0x41')](_0x36d37d['remoteUri']);_0x36d37d[_0x30d5('0x42')]=intUtil[_0x30d5('0x41')](_0x36d37d[_0x30d5('0x42')]);if(_0xf0ae5c&&_0xf0ae5c[_0x30d5('0x43')]){logger[_0x30d5('0xb')](_0x30d5('0x44'),_0x30d5('0x45'));_0x54d61a[_0x30d5('0x46')]=util[_0x30d5('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36d37d['serverUrl'],_0x54d61a[_0x30d5('0x47')],md5(_0x54d61a[_0x30d5('0x47')]));}else{_0x54d61a[_0x30d5('0x46')]='';}headers['Authorization']=getAuth(_0x36d37d);return getUser(_0x36d37d,_0x1f04b5['email'])[_0x30d5('0x1e')](function(_0x33fbad){_0x2c0860=_0x33fbad;logger[_0x30d5('0xb')](_0x30d5('0x48'),_0x2c0860['id']);return getEndUser(_0x36d37d,_0x54d61a[_0x30d5('0x10')],_0x54d61a['calleridnum']);})[_0x30d5('0x1e')](function(_0xa716dc){_0x398a62=_0xa716dc;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x398a62['id']);return getTicket(_0x36d37d,_0x2c0860,_0x398a62,_0x5a7895,_0x54d61a);})[_0x30d5('0x1e')](function(_0x5ed66a){if(_0x5ed66a&&_0x5ed66a['id']){logger[_0x30d5('0xb')](_0x30d5('0x1f'));logger[_0x30d5('0xb')](_0x30d5('0x4a'),_0x5ed66a['id']);logger[_0x30d5('0xb')](_0x30d5('0x44'),_0x30d5('0x4b'));emit(util['format'](_0x30d5('0x4c'),_0x1f04b5[_0x30d5('0x3e')]),_0x30d5('0x4d'),{'uri':util[_0x30d5('0xe')](_0x30d5('0x4e'),_0x36d37d[_0x30d5('0x1c')],_0x5ed66a['id'])});}})[_0x30d5('0x4f')](function(_0x2e367d){logger[_0x30d5('0x50')](_0x30d5('0x44'),JSON[_0x30d5('0x30')](_0x2e367d));});};exports['outbound']=function(_0x67ba29,_0x3ffa02,_0x4b1979,_0x5137d2,_0x421900,_0x3c55e1,_0x4ad952){var _0x2f44c8,_0x3ca674;_0x3c55e1['remoteUri']=intUtil[_0x30d5('0x41')](_0x3c55e1[_0x30d5('0x1c')]);_0x3c55e1[_0x30d5('0x42')]=intUtil[_0x30d5('0x41')](_0x3c55e1['serverUrl']);if(_0x4ad952&&_0x4ad952['recordingFormat']&&_0x4ad952[_0x30d5('0x51')]!==_0x30d5('0x52')){logger[_0x30d5('0xb')](_0x30d5('0x53'),'Recording\x20is\x20enabled!');_0x3ffa02[_0x30d5('0x46')]=util[_0x30d5('0xe')](_0x30d5('0x54'),_0x3c55e1[_0x30d5('0x42')],_0x3ffa02[_0x30d5('0x47')],md5(_0x3ffa02[_0x30d5('0x47')]));}headers[_0x30d5('0x55')]=getAuth(_0x3c55e1);return getUser(_0x3c55e1,_0x5137d2[_0x30d5('0x23')])[_0x30d5('0x1e')](function(_0x565709){_0x2f44c8=_0x565709;logger[_0x30d5('0xb')](_0x30d5('0x48'),_0x2f44c8['id']);return getEndUser(_0x3c55e1,_0x3ffa02[_0x30d5('0x56')],_0x3ffa02[_0x30d5('0x57')]);})[_0x30d5('0x1e')](function(_0x2c8a8d){_0x3ca674=_0x2c8a8d;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x3ca674['id']);return getTicket(_0x3c55e1,_0x2f44c8,_0x3ca674,_0x4b1979,_0x3ffa02);})[_0x30d5('0x1e')](function(_0x1b16ef){if(_0x1b16ef&&_0x1b16ef['id']){logger[_0x30d5('0xb')](_0x30d5('0x1f'));logger[_0x30d5('0xb')](_0x30d5('0x4a'),_0x1b16ef['id']);logger[_0x30d5('0xb')]('[OUTBOUND]',_0x30d5('0x4b'));emit(util[_0x30d5('0xe')](_0x30d5('0x4c'),_0x5137d2[_0x30d5('0x3e')]),_0x30d5('0x4d'),{'uri':util[_0x30d5('0xe')](_0x30d5('0x4e'),_0x3c55e1[_0x30d5('0x1c')],_0x1b16ef['id'])});}})[_0x30d5('0x4f')](function(_0x34dcbb){logger[_0x30d5('0x50')]('[OUTBOUND]',JSON['stringify'](_0x34dcbb));});};exports[_0x30d5('0x58')]=function(_0x251078,_0x513d52,_0x50891d,_0x49239b,_0x25b21d,_0x2b28af){var _0x507e2a,_0x5070c0;_0x2b28af['remoteUri']=intUtil['stripTrailingSlash'](_0x2b28af[_0x30d5('0x1c')]);_0x2b28af[_0x30d5('0x42')]=intUtil['stripTrailingSlash'](_0x2b28af['serverUrl']);if(_0x25b21d&&_0x25b21d[_0x30d5('0x43')]){logger[_0x30d5('0xb')]('['+_0x513d52[_0x30d5('0x59')][_0x30d5('0x5a')]()+']','Recording\x20is\x20enabled!');_0x513d52[_0x30d5('0x46')]=util['format'](_0x30d5('0x54'),_0x2b28af[_0x30d5('0x42')],_0x513d52['uniqueid'],md5(_0x513d52[_0x30d5('0x47')]));}else{_0x513d52[_0x30d5('0x46')]='';}headers['Authorization']=getAuth(_0x2b28af);return getUser(_0x2b28af,'')[_0x30d5('0x1e')](function(_0x3258db){_0x507e2a=_0x3258db;logger['info']('The\x20User\x20ID\x20is:',_0x507e2a['id']);return getEndUser(_0x2b28af,_0x513d52['calleridname'],_0x513d52[_0x30d5('0x11')]);})[_0x30d5('0x1e')](function(_0x48353b){_0x5070c0=_0x48353b;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x5070c0['id']);return getTicket(_0x2b28af,_0x507e2a,_0x5070c0,_0x50891d,_0x513d52);})[_0x30d5('0x1e')](function(_0x56b1aa){if(_0x56b1aa){logger[_0x30d5('0xb')]('Ticket\x20created!');logger['info'](_0x30d5('0x4a'),_0x56b1aa['id']);}})['catch'](function(_0x125acb){logger[_0x30d5('0x50')]('['+_0x513d52[_0x30d5('0x59')][_0x30d5('0x5a')]()+']',JSON['stringify'](_0x125acb));});}; \ 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 08377e5..d261a00 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 _0x2199=['headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','email','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:'];(function(_0x2d4e16,_0x179060){var _0x236fcc=function(_0x5117d0){while(--_0x5117d0){_0x2d4e16['push'](_0x2d4e16['shift']());}};_0x236fcc(++_0x179060);}(_0x2199,0xd6));var _0x9219=function(_0x58265b,_0x325922){_0x58265b=_0x58265b-0x0;var _0x47f9c4=_0x2199[_0x58265b];return _0x47f9c4;};'use strict';var _=require(_0x9219('0x0'));var rp=require(_0x9219('0x1'));var md5=require(_0x9219('0x2'));var util=require(_0x9219('0x3'));var moment=require(_0x9219('0x4'));var Promise=require(_0x9219('0x5'));var Redis=require('ioredis');var intUtil=require(_0x9219('0x6'));var config=require(_0x9219('0x7'));var logger=require(_0x9219('0x8'))(_0x9219('0x9'));config[_0x9219('0xa')]=_[_0x9219('0xb')](config[_0x9219('0xa')],{'host':_0x9219('0xc'),'port':0x18eb});var io=require(_0x9219('0xd'))(new Redis(config['redis']));function getAdminId(_0x15c678,_0x3b2da7,_0x20d03c,_0x375cde){return new Promise(function(_0x5688d6,_0x5ed566){var _0x4fb241=![];var _0x2f3727={'method':_0x9219('0xe'),'uri':_0x375cde+'/api/selector/owners','json':!![]};_0x2f3727['headers']=_0x20d03c;logger[_0x9219('0xf')](_0x9219('0x10'));return rp(_0x2f3727)[_0x9219('0x11')](function(_0x244021){if(_0x244021){var _0x295133=_0x244021['users'];var _0x30a1e0=null;for(_0x30a1e0=0x0;_0x30a1e0<_0x295133['length'];_0x30a1e0++){if(_0x295133[_0x30a1e0]['email']===_0x15c678[_0x9219('0x12')]){_0x15c678[_0x9219('0x13')]=_0x295133[_0x30a1e0]['id'];_0x4fb241=!![];}}if(_0x4fb241){logger['info'](_0x9219('0x14'),_0x15c678[_0x9219('0x13')]);_0x5688d6(_0x15c678);}else{_0x5ed566({'statusCode':0x194,'message':_0x9219('0x15')});}}else{_0x5ed566({'statusCode':0x194,'message':_0x9219('0x15')});}})[_0x9219('0x16')](function(_0x11fd75){logger[_0x9219('0x17')]('['+[_0x3b2da7[_0x9219('0x18')]()]+']',_0x11fd75[_0x9219('0x19')]);_0x5ed566(_0x11fd75);});});}function getUser(_0x28aed8,_0x573287,_0x28962a){return function(_0x37eb15){return new Promise(function(_0x581789,_0x550575){var _0x29bb90={'method':_0x9219('0xe'),'uri':_0x28962a+_0x9219('0x1a'),'json':!![]};_0x29bb90['headers']=_0x573287;logger['info'](_0x9219('0x1b'));return rp(_0x29bb90)['then'](function(_0x5375c8){if(_0x5375c8){var _0x442bf7=_0x5375c8[_0x9219('0x1c')];var _0xf7d6e6=![];var _0x57188c=null;if(_0x37eb15[_0x9219('0x1d')]!==null){logger['info'](_0x9219('0x1e'),_0x37eb15['agentEmail']);_0x37eb15['userEmail']=_0x37eb15[_0x9219('0x1d')];for(_0x57188c=0x0;_0x57188c<_0x442bf7['length'];_0x57188c++){if(_0x442bf7[_0x57188c][_0x9219('0x1f')]===_0x37eb15[_0x9219('0x1d')]){_0xf7d6e6=!![];_0x37eb15[_0x9219('0x20')]=_0x442bf7[_0x57188c]['id'];logger[_0x9219('0xf')](_0x9219('0x21'),_0x37eb15[_0x9219('0x20')]);}}}if(!_0xf7d6e6){logger[_0x9219('0xf')](_0x9219('0x22'));_0x37eb15['userEmail']=_0x37eb15[_0x9219('0x12')];_0x37eb15[_0x9219('0x20')]=_0x37eb15[_0x9219('0x13')];_0xf7d6e6=!![];}if(_0xf7d6e6){_0x581789(_0x37eb15);}else{_0x550575({'statusCode':0x194,'message':_0x9219('0x15')});}}else{_0x550575({'statusCode':0x194,'message':_0x9219('0x15')});}})['catch'](function(_0x5e5073){logger[_0x9219('0x17')]('['+[_0x28aed8[_0x9219('0x18')]()]+']',_0x5e5073[_0x9219('0x19')]);_0x550575(_0x5e5073);});});};}function searchContact(_0xaeabea,_0x4931e0,_0x39b8d2,_0x1beb48){return new Promise(function(_0x31e29d,_0x1328d0){var _0x265364={'method':_0x9219('0xe'),'headers':_0x4931e0,'uri':_0xaeabea+'/api/lookup?q='+_0x1beb48+_0x9219('0x23')+_0x39b8d2+_0x9219('0x24'),'json':!![]};rp(_0x265364)[_0x9219('0x11')](function(_0x1074b1){var _0x5d08b9=_[_0x9219('0x25')](_0x1074b1[_0x9219('0x26')][_0x9219('0x26')],[_0x39b8d2,_0x1beb48]);_0x31e29d(_0x5d08b9);})[_0x9219('0x16')](function(_0x5a6d52){_0x1328d0(_0x5a6d52);});});}function getEndUser(_0x15242,_0x5752b0,_0x52e9de){return function(_0x22a799){return new Promise(function(_0x1830f5,_0x18b4fc){logger[_0x9219('0xf')](util[_0x9219('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x22a799['contactNumber']));searchContact(_0x52e9de,_0x5752b0,_0x9219('0x28'),_0x22a799[_0x9219('0x29')])[_0x9219('0x11')](function(_0x4e8bce){if(_0x4e8bce){_0x22a799[_0x9219('0x2a')]=_0x4e8bce['id'];logger[_0x9219('0xf')](_0x9219('0x2b'),_0x22a799[_0x9219('0x2a')]);return _0x1830f5(_0x22a799);}searchContact(_0x52e9de,_0x5752b0,_0x9219('0x2c'),_0x22a799['contactNumber'])[_0x9219('0x11')](function(_0xaf4e22){if(_0xaf4e22){_0x22a799[_0x9219('0x2a')]=_0xaf4e22['id'];logger[_0x9219('0xf')](_0x9219('0x2d'),_0x22a799[_0x9219('0x2a')]);return _0x1830f5(_0x22a799);}createEndUser(_0x22a799,_0x15242,_0x5752b0,_0x52e9de)[_0x9219('0x11')](function(_0x1f3bec){logger[_0x9219('0xf')](_0x9219('0x2e'),_0x1f3bec['endUserId']);return _0x1830f5(_0x1f3bec);});});})[_0x9219('0x16')](function(_0x1cfbd7){_0x18b4fc(_0x1cfbd7);});});};}function createEndUser(_0x4d9312,_0x4fb80c,_0x3cef4a,_0x106276){return new Promise(function(_0x3f56c8,_0x5e64f7){var _0x4c7aad=moment();var _0x41e9cc={'method':'POST','uri':_0x106276+'/api/contacts','body':{'contact':{'last_name':_0x4d9312[_0x9219('0x29')],'work_number':_0x4d9312[_0x9219('0x29')],'mobile_number':_0x4d9312[_0x9219('0x29')],'owner_id':_0x4d9312['userId'],'created_at':_0x4c7aad[_0x9219('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x41e9cc[_0x9219('0x2f')]=_0x3cef4a;logger[_0x9219('0xf')](_0x9219('0x30'));return rp(_0x41e9cc)[_0x9219('0x11')](function(_0x18f060){_0x4d9312[_0x9219('0x2a')]=_0x18f060[_0x9219('0x31')]['id'];_0x3f56c8(_0x4d9312);})['catch'](function(_0x8af5dc){logger[_0x9219('0x17')]('['+[_0x4fb80c[_0x9219('0x18')]()]+']',_0x8af5dc[_0x9219('0x19')]);_0x5e64f7(_0x8af5dc[_0x9219('0x19')]);});});}function getTicket(_0x50f386,_0xbea180,_0x2a433a,_0x2f2616,_0x29d3cc){return function(_0x3a1338){logger[_0x9219('0xf')](_0x9219('0x32'));return new Promise(function(_0x351975,_0x4598dc){var _0x4719f1=moment();var _0x462d38={'method':_0x9219('0x33'),'uri':_0x2a433a+_0x9219('0x34'),'body':{'title':intUtil['getString'](_0x2f2616['Subjects'],_0x29d3cc,'\x20'),'description':intUtil[_0x9219('0x35')](_0x2f2616[_0x9219('0x36')],_0x29d3cc,'\x0a'),'owner_id':_0x3a1338[_0x9219('0x20')],'creater_id':_0x3a1338[_0x9219('0x13')],'targetable_id':_0x3a1338['endUserId'],'targetable_type':_0x9219('0x37'),'created_at':_0x4719f1[_0x9219('0x27')](_0x9219('0x38')),'due_date':_0x4719f1[_0x9219('0x39')](0x1e,'m')['format'](_0x9219('0x38'))},'json':!![]};_0x462d38['headers']=_0xbea180;return rp(_0x462d38)['then'](function(_0x235ecd){_0x3a1338[_0x9219('0x3a')]=_0x235ecd[_0x9219('0x3b')]['id'];logger['info'](_0x9219('0x3c'),_0x3a1338[_0x9219('0x3a')]);_0x351975(_0x3a1338);})[_0x9219('0x16')](function(_0x414857){logger[_0x9219('0x17')]('['+[_0x50f386[_0x9219('0x18')]()]+']',_0x414857['message']);_0x4598dc(_0x414857[_0x9219('0x19')]);});});};}function emit(_0x216e8e,_0x3ca5c3,_0x140742){var _0x28e61f={'uri':_0x216e8e+_0x9219('0x3d')+_0x140742};io['to'](util[_0x9219('0x27')](_0x9219('0x3e'),_0x3ca5c3))['emit'](_0x9219('0x3f'),_0x28e61f);}exports['cs']=function(_0x7a6826,_0x167ecc,_0x56afde,_0x8ce4f,_0x4cf15f,_0x4c4c41,_0x25e1e3,_0x5ab5ae){var _0x23d9de={};var _0x5c3010={'Authorization':_0x9219('0x40')+_0x4c4c41[_0x9219('0x41')]};_0x4c4c41['remoteUri']=intUtil[_0x9219('0x42')](_0x4c4c41[_0x9219('0x43')]);_0x4c4c41[_0x9219('0x44')]=intUtil['stripTrailingSlash'](_0x4c4c41['serverUrl']);var _0x56c78f=_0x4c4c41['remoteUri'];_0x23d9de[_0x9219('0x12')]=_0x4c4c41['username'];_0x23d9de['contactNumber']=_0x5ab5ae[_0x9219('0x45')]()===_0x9219('0x46')?_0x167ecc[_0x9219('0x47')]:_0x167ecc[_0x9219('0x48')];_0x23d9de[_0x9219('0x49')]=_0x5ab5ae===_0x9219('0x4a')||_0x5ab5ae===_0x9219('0x4b')?_0x9219('0x4a'):_0x9219('0x46');if(_0x8ce4f){_0x23d9de['agentEmail']=_0x8ce4f['email'];}var _0x94d0a4=util[_0x9219('0x27')](_0x9219('0x4c'),_0x4c4c41['serverUrl'],_0x167ecc[_0x9219('0x4d')],md5(_0x167ecc[_0x9219('0x4d')]));if(_0x4cf15f&&_0x4cf15f[_0x9219('0x4e')]){logger[_0x9219('0xf')]('[QUEUE]',_0x9219('0x4f'));_0x167ecc['recordingURL']=_0x94d0a4;}else if(_0x25e1e3&&_0x25e1e3[_0x9219('0x50')]&&_0x25e1e3[_0x9219('0x50')]!=='none'){logger[_0x9219('0xf')](_0x9219('0x51'),_0x9219('0x4f'));_0x167ecc['recordingURL']=_0x94d0a4;}else{_0x167ecc[_0x9219('0x52')]='';}return getAdminId(_0x23d9de,_0x5ab5ae,_0x5c3010,_0x56c78f)[_0x9219('0x11')](getUser(_0x5ab5ae,_0x5c3010,_0x56c78f))[_0x9219('0x11')](getEndUser(_0x5ab5ae,_0x5c3010,_0x56c78f))[_0x9219('0x11')](getTicket(_0x5ab5ae,_0x5c3010,_0x56c78f,_0x56afde,_0x167ecc))[_0x9219('0x11')](function(_0x50d986){logger['info'](util[_0x9219('0x27')](_0x9219('0x53'),_0x50d986['ticketId']));if(_0x5ab5ae!=='unmanaged'){logger[_0x9219('0xf')]('['+[_0x5ab5ae[_0x9219('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x56c78f,_0x8ce4f[_0x9219('0x54')],_0x50d986[_0x9219('0x2a')]);}})[_0x9219('0x16')](function(_0x264acf){logger[_0x9219('0x17')]('['+[_0x5ab5ae[_0x9219('0x18')]()]+_0x9219('0x55'),util[_0x9219('0x56')](_0x264acf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xaf7d=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','agentEmail','info','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','userEmail','message','/api/lookup?q=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]'];(function(_0x395cf4,_0x5c2e80){var _0x33ae78=function(_0x2bc346){while(--_0x2bc346){_0x395cf4['push'](_0x395cf4['shift']());}};_0x33ae78(++_0x5c2e80);}(_0xaf7d,0x1a7));var _0xdaf7=function(_0x45589c,_0x18f1ca){_0x45589c=_0x45589c-0x0;var _0x5745a0=_0xaf7d[_0x45589c];return _0x5745a0;};'use strict';var _=require(_0xdaf7('0x0'));var rp=require(_0xdaf7('0x1'));var md5=require(_0xdaf7('0x2'));var util=require(_0xdaf7('0x3'));var moment=require('moment');var Promise=require(_0xdaf7('0x4'));var Redis=require(_0xdaf7('0x5'));var intUtil=require(_0xdaf7('0x6'));var config=require(_0xdaf7('0x7'));var logger=require(_0xdaf7('0x8'))(_0xdaf7('0x9'));config[_0xdaf7('0xa')]=_[_0xdaf7('0xb')](config['redis'],{'host':_0xdaf7('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x1a7bba,_0x4fd6fd,_0x5e30f1,_0x448cf7){return new Promise(function(_0x4da195,_0x27b13b){var _0x4f6a8f=![];var _0x2d575c={'method':_0xdaf7('0xd'),'uri':_0x448cf7+_0xdaf7('0xe'),'json':!![]};_0x2d575c[_0xdaf7('0xf')]=_0x5e30f1;logger['info']('Getting\x20admin\x20information');return rp(_0x2d575c)[_0xdaf7('0x10')](function(_0x2c8ab8){if(_0x2c8ab8){var _0x34fb7f=_0x2c8ab8[_0xdaf7('0x11')];var _0x1f262e=null;for(_0x1f262e=0x0;_0x1f262e<_0x34fb7f['length'];_0x1f262e++){if(_0x34fb7f[_0x1f262e][_0xdaf7('0x12')]===_0x1a7bba[_0xdaf7('0x13')]){_0x1a7bba[_0xdaf7('0x14')]=_0x34fb7f[_0x1f262e]['id'];_0x4f6a8f=!![];}}if(_0x4f6a8f){logger['info'](_0xdaf7('0x15'),_0x1a7bba[_0xdaf7('0x14')]);_0x4da195(_0x1a7bba);}else{_0x27b13b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x27b13b({'statusCode':0x194,'message':_0xdaf7('0x16')});}})[_0xdaf7('0x17')](function(_0x2b385e){logger[_0xdaf7('0x18')]('['+[_0x4fd6fd[_0xdaf7('0x19')]()]+']',_0x2b385e['message']);_0x27b13b(_0x2b385e);});});}function getUser(_0x41e48f,_0x284fd7,_0x48ea5e){return function(_0x52987c){return new Promise(function(_0x356245,_0x12672c){var _0x4bc13e={'method':'GET','uri':_0x48ea5e+'/api/selector/owners','json':!![]};_0x4bc13e['headers']=_0x284fd7;logger['info']('Getting\x20user\x20list');return rp(_0x4bc13e)[_0xdaf7('0x10')](function(_0x35c8e4){if(_0x35c8e4){var _0x499dc9=_0x35c8e4['users'];var _0x58f902=![];var _0x3a30fb=null;if(_0x52987c[_0xdaf7('0x1a')]!==null){logger[_0xdaf7('0x1b')](_0xdaf7('0x1c'),_0x52987c[_0xdaf7('0x1a')]);_0x52987c['userEmail']=_0x52987c[_0xdaf7('0x1a')];for(_0x3a30fb=0x0;_0x3a30fb<_0x499dc9[_0xdaf7('0x1d')];_0x3a30fb++){if(_0x499dc9[_0x3a30fb][_0xdaf7('0x12')]===_0x52987c[_0xdaf7('0x1a')]){_0x58f902=!![];_0x52987c[_0xdaf7('0x1e')]=_0x499dc9[_0x3a30fb]['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x1f'),_0x52987c['userId']);}}}if(!_0x58f902){logger[_0xdaf7('0x1b')](_0xdaf7('0x20'));_0x52987c[_0xdaf7('0x21')]=_0x52987c[_0xdaf7('0x13')];_0x52987c[_0xdaf7('0x1e')]=_0x52987c[_0xdaf7('0x14')];_0x58f902=!![];}if(_0x58f902){_0x356245(_0x52987c);}else{_0x12672c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x12672c({'statusCode':0x194,'message':_0xdaf7('0x16')});}})['catch'](function(_0x4ae136){logger['error']('['+[_0x41e48f['toUpperCase']()]+']',_0x4ae136[_0xdaf7('0x22')]);_0x12672c(_0x4ae136);});});};}function searchContact(_0xb41c9f,_0x31871d,_0x2f72f4,_0x1115f0){return new Promise(function(_0x10debb,_0x54021e){var _0x1bffec={'method':_0xdaf7('0xd'),'headers':_0x31871d,'uri':_0xb41c9f+_0xdaf7('0x23')+_0x1115f0+'&f='+_0x2f72f4+'&entities=contact','json':!![]};rp(_0x1bffec)[_0xdaf7('0x10')](function(_0x512ec6){var _0x1a1ea0=_['find'](_0x512ec6[_0xdaf7('0x24')][_0xdaf7('0x24')],[_0x2f72f4,_0x1115f0]);_0x10debb(_0x1a1ea0);})['catch'](function(_0x1caaf9){_0x54021e(_0x1caaf9);});});}function getEndUser(_0x6eb42f,_0x36a41e,_0x89fcd2){return function(_0xc130bf){return new Promise(function(_0x14c26c,_0xcad84a){logger[_0xdaf7('0x1b')](util[_0xdaf7('0x25')](_0xdaf7('0x26'),_0xc130bf[_0xdaf7('0x27')]));searchContact(_0x89fcd2,_0x36a41e,_0xdaf7('0x28'),_0xc130bf[_0xdaf7('0x27')])[_0xdaf7('0x10')](function(_0x2ade91){if(_0x2ade91){_0xc130bf[_0xdaf7('0x29')]=_0x2ade91['id'];logger['info'](_0xdaf7('0x2a'),_0xc130bf[_0xdaf7('0x29')]);return _0x14c26c(_0xc130bf);}searchContact(_0x89fcd2,_0x36a41e,_0xdaf7('0x2b'),_0xc130bf[_0xdaf7('0x27')])['then'](function(_0x133a34){if(_0x133a34){_0xc130bf[_0xdaf7('0x29')]=_0x133a34['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x2c'),_0xc130bf[_0xdaf7('0x29')]);return _0x14c26c(_0xc130bf);}createEndUser(_0xc130bf,_0x6eb42f,_0x36a41e,_0x89fcd2)[_0xdaf7('0x10')](function(_0x1f8bc1){logger['info'](_0xdaf7('0x2d'),_0x1f8bc1['endUserId']);return _0x14c26c(_0x1f8bc1);});});})[_0xdaf7('0x17')](function(_0x2939a3){_0xcad84a(_0x2939a3);});});};}function createEndUser(_0x3562f0,_0x51ee4d,_0x423a56,_0x567328){return new Promise(function(_0x42c895,_0x3c8727){var _0x2516c3=moment();var _0x243268={'method':'POST','uri':_0x567328+_0xdaf7('0x2e'),'body':{'contact':{'last_name':_0x3562f0[_0xdaf7('0x27')],'work_number':_0x3562f0[_0xdaf7('0x27')],'mobile_number':_0x3562f0[_0xdaf7('0x27')],'owner_id':_0x3562f0['userId'],'created_at':_0x2516c3[_0xdaf7('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x243268['headers']=_0x423a56;logger[_0xdaf7('0x1b')](_0xdaf7('0x2f'));return rp(_0x243268)[_0xdaf7('0x10')](function(_0x2a1ae9){_0x3562f0['endUserId']=_0x2a1ae9[_0xdaf7('0x30')]['id'];_0x42c895(_0x3562f0);})[_0xdaf7('0x17')](function(_0x9dc283){logger['error']('['+[_0x51ee4d[_0xdaf7('0x19')]()]+']',_0x9dc283[_0xdaf7('0x22')]);_0x3c8727(_0x9dc283[_0xdaf7('0x22')]);});});}function getTicket(_0x28216a,_0x3c7356,_0x1b39d1,_0xf6965e,_0x567df5){return function(_0x2baccf){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x39fc34,_0x485acd){var _0x39e772=moment();var _0x1abdef={'method':_0xdaf7('0x31'),'uri':_0x1b39d1+_0xdaf7('0x32'),'body':{'title':intUtil[_0xdaf7('0x33')](_0xf6965e[_0xdaf7('0x34')],_0x567df5,'\x20'),'description':intUtil[_0xdaf7('0x33')](_0xf6965e[_0xdaf7('0x35')],_0x567df5,'\x0a'),'owner_id':_0x2baccf[_0xdaf7('0x1e')],'creater_id':_0x2baccf[_0xdaf7('0x14')],'targetable_id':_0x2baccf[_0xdaf7('0x29')],'targetable_type':'Contact','created_at':_0x39e772[_0xdaf7('0x25')](_0xdaf7('0x36')),'due_date':_0x39e772[_0xdaf7('0x37')](0x1e,'m')[_0xdaf7('0x25')](_0xdaf7('0x36'))},'json':!![]};_0x1abdef[_0xdaf7('0xf')]=_0x3c7356;return rp(_0x1abdef)['then'](function(_0x2e4e73){_0x2baccf[_0xdaf7('0x38')]=_0x2e4e73[_0xdaf7('0x39')]['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x3a'),_0x2baccf[_0xdaf7('0x38')]);_0x39fc34(_0x2baccf);})[_0xdaf7('0x17')](function(_0x3877f5){logger[_0xdaf7('0x18')]('['+[_0x28216a[_0xdaf7('0x19')]()]+']',_0x3877f5['message']);_0x485acd(_0x3877f5[_0xdaf7('0x22')]);});});};}function emit(_0x114bf3,_0x5e0f45,_0x523208){var _0x3e935a={'uri':_0x114bf3+_0xdaf7('0x3b')+_0x523208};io['to'](util['format'](_0xdaf7('0x3c'),_0x5e0f45))[_0xdaf7('0x3d')]('trigger:browser:url',_0x3e935a);}exports['cs']=function(_0x3a36ef,_0x307dc0,_0x282cfe,_0x23f733,_0x50f1d3,_0x40c1fe,_0x5667bd,_0xd38bb5){var _0x4497cd={};var _0x2d2b94={'Authorization':_0xdaf7('0x3e')+_0x40c1fe['apiKey']};_0x40c1fe['remoteUri']=intUtil['stripTrailingSlash'](_0x40c1fe[_0xdaf7('0x3f')]);_0x40c1fe[_0xdaf7('0x40')]=intUtil['stripTrailingSlash'](_0x40c1fe[_0xdaf7('0x40')]);var _0xdad4c=_0x40c1fe[_0xdaf7('0x3f')];_0x4497cd[_0xdaf7('0x13')]=_0x40c1fe[_0xdaf7('0x41')];_0x4497cd[_0xdaf7('0x27')]=_0xd38bb5[_0xdaf7('0x42')]()===_0xdaf7('0x43')?_0x307dc0[_0xdaf7('0x44')]:_0x307dc0['calleridnum'];_0x4497cd['callDirection']=_0xd38bb5===_0xdaf7('0x45')||_0xd38bb5===_0xdaf7('0x46')?_0xdaf7('0x45'):'outbound';if(_0x23f733){_0x4497cd[_0xdaf7('0x1a')]=_0x23f733[_0xdaf7('0x12')];}var _0x422204=util['format'](_0xdaf7('0x47'),_0x40c1fe['serverUrl'],_0x307dc0[_0xdaf7('0x48')],md5(_0x307dc0[_0xdaf7('0x48')]));if(_0x50f1d3&&_0x50f1d3[_0xdaf7('0x49')]){logger[_0xdaf7('0x1b')](_0xdaf7('0x4a'),_0xdaf7('0x4b'));_0x307dc0[_0xdaf7('0x4c')]=_0x422204;}else if(_0x5667bd&&_0x5667bd[_0xdaf7('0x4d')]&&_0x5667bd[_0xdaf7('0x4d')]!=='none'){logger[_0xdaf7('0x1b')](_0xdaf7('0x4e'),'Recording\x20is\x20enabled!');_0x307dc0[_0xdaf7('0x4c')]=_0x422204;}else{_0x307dc0[_0xdaf7('0x4c')]='';}return getAdminId(_0x4497cd,_0xd38bb5,_0x2d2b94,_0xdad4c)['then'](getUser(_0xd38bb5,_0x2d2b94,_0xdad4c))[_0xdaf7('0x10')](getEndUser(_0xd38bb5,_0x2d2b94,_0xdad4c))[_0xdaf7('0x10')](getTicket(_0xd38bb5,_0x2d2b94,_0xdad4c,_0x282cfe,_0x307dc0))[_0xdaf7('0x10')](function(_0xc80958){logger[_0xdaf7('0x1b')](util[_0xdaf7('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0xc80958[_0xdaf7('0x38')]));if(_0xd38bb5!==_0xdaf7('0x46')){logger[_0xdaf7('0x1b')]('['+[_0xd38bb5['toUpperCase']()]+']',_0xdaf7('0x4f'));emit(_0xdad4c,_0x23f733[_0xdaf7('0x50')],_0xc80958[_0xdaf7('0x29')]);}})[_0xdaf7('0x17')](function(_0x191508){logger[_0xdaf7('0x18')]('['+[_0xd38bb5[_0xdaf7('0x19')]()]+_0xdaf7('0x51'),util[_0xdaf7('0x52')](_0x191508,{'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 842403d..8508cd5 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 _0x2abf=['routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','error','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data1','Configurations','data3'];(function(_0x5aeece,_0x2c3431){var _0xf512f4=function(_0xad7511){while(--_0xad7511){_0x5aeece['push'](_0x5aeece['shift']());}};_0xf512f4(++_0x2c3431);}(_0x2abf,0x1bb));var _0xf2ab=function(_0x28b9e5,_0x2574d0){_0x28b9e5=_0x28b9e5-0x0;var _0x261165=_0x2abf[_0x28b9e5];return _0x261165;};'use strict';var _=require('lodash');var util=require(_0xf2ab('0x0'));var zendesk=require(_0xf2ab('0x1'));var salesforce=require(_0xf2ab('0x2'));var sugarcrm=require(_0xf2ab('0x3'));var freshdesk=require(_0xf2ab('0x4'));var zoho=require(_0xf2ab('0x5'));var desk=require(_0xf2ab('0x6'));var vtiger=require(_0xf2ab('0x7'));var servicenow=require(_0xf2ab('0x8'));var dynamics365=require(_0xf2ab('0x9'));var freshsales=require(_0xf2ab('0xa'));var integrations=[_0xf2ab('0xb'),_0xf2ab('0xc'),_0xf2ab('0xd'),_0xf2ab('0xe'),'zoho',_0xf2ab('0xf'),_0xf2ab('0x10'),_0xf2ab('0x11'),_0xf2ab('0x12'),_0xf2ab('0x13')];exports[_0xf2ab('0x14')]=function(_0x479af3,_0x3c64f7,_0x5800ad,_0x3b35db,_0x5cf6b1,_0x19b6bf){if(_0x5800ad){if(_['includes'](integrations,_0x479af3['data1'][_0xf2ab('0x15')]())){try{var _0x2695f4=null;var _0x2f2568='';var _0x1fb98c=_0x5800ad[_0x479af3[_0xf2ab('0x16')][_0xf2ab('0x15')]()];if(_0x1fb98c){var _0x1e7033=_0x1fb98c[_0x479af3['data2']];if(_0x1e7033){var _0x4a9525=_['find'](_0x1e7033[_0xf2ab('0x17')],{'id':parseInt(_0x479af3[_0xf2ab('0x18')],0xa)});if(_0x4a9525){if(_0x3b35db){if(_0x5cf6b1&&_0x3c64f7['queue']){_0x2f2568='queue';}else if(_0x3c64f7[_0xf2ab('0x19')]){_0x2f2568=_0xf2ab('0x1a');}else{console[_0xf2ab('0x1b')](_0xf2ab('0x1c'),_0x3c64f7);}}else{_0x2f2568=_0xf2ab('0x1d');}switch(_0x479af3[_0xf2ab('0x16')][_0xf2ab('0x15')]()){case _0xf2ab('0xb'):zendesk[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case'salesforce':salesforce[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0xd'):sugarcrm[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0xe'):freshdesk[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0x1e'):zoho[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0xf'):desk[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0x10'):vtiger[_0x2f2568](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf);break;case _0xf2ab('0x12'):freshsales['cs'](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf,_0x2f2568);break;case _0xf2ab('0x13'):servicenow['cs'](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf,_0x2f2568);break;case _0xf2ab('0x11'):dynamics365['cs'](_0x479af3,_0x3c64f7,_0x4a9525,_0x3b35db,_0x5cf6b1,_0x1e7033,_0x19b6bf,_0x2f2568);break;default:console[_0xf2ab('0x1b')](_0xf2ab('0x1f'));}}else{_0x2695f4=require(_0xf2ab('0x20'))(_0x479af3[_0xf2ab('0x16')][_0xf2ab('0x15')]());_0x2695f4['error'](_0xf2ab('0x21'),util[_0xf2ab('0x22')](_0xf2ab('0x23'),_0x479af3['data1'][_0xf2ab('0x15')](),_0x479af3[_0xf2ab('0x18')]));}}else{_0x2695f4=require(_0xf2ab('0x20'))(_0x479af3[_0xf2ab('0x16')]['toLowerCase']());_0x2695f4['error'](_0xf2ab('0x21'),util[_0xf2ab('0x22')](_0xf2ab('0x24'),_0x479af3[_0xf2ab('0x16')]['toLowerCase'](),_0x479af3[_0xf2ab('0x25')]));}}else{}}catch(_0x3ff60d){console[_0xf2ab('0x26')](_0x3ff60d);}}}}; \ No newline at end of file +var _0x169c=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','vtiger','unknown\x20integration','../../../../config/logger','error'];(function(_0x5091e6,_0x375dd4){var _0x101c24=function(_0x3d83f7){while(--_0x3d83f7){_0x5091e6['push'](_0x5091e6['shift']());}};_0x101c24(++_0x375dd4);}(_0x169c,0xe3));var _0xc169=function(_0x11500e,_0x457be0){_0x11500e=_0x11500e-0x0;var _0x135e1a=_0x169c[_0x11500e];return _0x135e1a;};'use strict';var _=require(_0xc169('0x0'));var util=require(_0xc169('0x1'));var zendesk=require(_0xc169('0x2'));var salesforce=require(_0xc169('0x3'));var sugarcrm=require(_0xc169('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xc169('0x5'));var desk=require('./desk');var vtiger=require(_0xc169('0x6'));var servicenow=require(_0xc169('0x7'));var dynamics365=require(_0xc169('0x8'));var freshsales=require('./freshsales');var integrations=[_0xc169('0x9'),_0xc169('0xa'),_0xc169('0xb'),'freshdesk',_0xc169('0xc'),_0xc169('0xd'),'vtiger',_0xc169('0xe'),_0xc169('0xf'),_0xc169('0x10')];exports[_0xc169('0x11')]=function(_0x59718a,_0x36d327,_0xbe503d,_0x2e10e1,_0x3034d8,_0x5d006b){if(_0xbe503d){if(_[_0xc169('0x12')](integrations,_0x59718a[_0xc169('0x13')][_0xc169('0x14')]())){try{var _0x267fdb=null;var _0x502a80='';var _0x59f46d=_0xbe503d[_0x59718a[_0xc169('0x13')][_0xc169('0x14')]()];if(_0x59f46d){var _0x1da616=_0x59f46d[_0x59718a['data2']];if(_0x1da616){var _0x2ec13d=_[_0xc169('0x15')](_0x1da616[_0xc169('0x16')],{'id':parseInt(_0x59718a[_0xc169('0x17')],0xa)});if(_0x2ec13d){if(_0x2e10e1){if(_0x3034d8&&_0x36d327['queue']){_0x502a80='queue';}else if(_0x36d327['routeId']){_0x502a80='outbound';}else{console[_0xc169('0x18')](_0xc169('0x19'),_0x36d327);}}else{_0x502a80=_0xc169('0x1a');}switch(_0x59718a[_0xc169('0x13')]['toLowerCase']()){case _0xc169('0x9'):zendesk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0xa'):salesforce[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'sugarcrm':sugarcrm[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0x1b'):freshdesk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'zoho':zoho[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'desk':desk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0x1c'):vtiger[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0xf'):freshsales['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;case _0xc169('0x10'):servicenow['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;case _0xc169('0xe'):dynamics365['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;default:console[_0xc169('0x18')](_0xc169('0x1d'));}}else{_0x267fdb=require(_0xc169('0x1e'))(_0x59718a[_0xc169('0x13')][_0xc169('0x14')]());_0x267fdb[_0xc169('0x1f')](_0xc169('0x20'),util[_0xc169('0x21')](_0xc169('0x22'),_0x59718a[_0xc169('0x13')][_0xc169('0x14')](),_0x59718a[_0xc169('0x17')]));}}else{_0x267fdb=require(_0xc169('0x1e'))(_0x59718a[_0xc169('0x13')][_0xc169('0x14')]());_0x267fdb[_0xc169('0x1f')]('[EXEC]',util[_0xc169('0x21')](_0xc169('0x23'),_0x59718a[_0xc169('0x13')][_0xc169('0x14')](),_0x59718a[_0xc169('0x24')]));}}else{}}catch(_0x2fcdaf){console[_0xc169('0x1f')](_0x2fcdaf);}}}}; \ 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 d74d06c..bbea429 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 _0x752d=['assign','getString','Subjects','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','additionalSearchContact','$or','Contact','execute','cloneDeep','merge','Lead','account_contact_lead','additionalSearchAccount','additionalSearchLead','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','idField','content','variable','variableName','toString','customVariable','Variable','name','password','securityToken','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','defaults','socket.io-emitter','redis','emit'];(function(_0x8506d6,_0x2e3dc5){var _0x6c3b79=function(_0x2f1b39){while(--_0x2f1b39){_0x8506d6['push'](_0x8506d6['shift']());}};_0x6c3b79(++_0x2e3dc5);}(_0x752d,0x70));var _0xd752=function(_0x57088a,_0x1581b4){_0x57088a=_0x57088a-0x0;var _0x67c396=_0x752d[_0x57088a];return _0x67c396;};'use strict';var _=require(_0xd752('0x0'));var rp=require(_0xd752('0x1'));var moment=require(_0xd752('0x2'));var BPromise=require(_0xd752('0x3'));var md5=require(_0xd752('0x4'));var jsforce=require(_0xd752('0x5'));var util=require(_0xd752('0x6'));var Redis=require(_0xd752('0x7'));var intUtil=require(_0xd752('0x8'));var config=require(_0xd752('0x9'));var logger=require('../../../../config/logger')(_0xd752('0xa'));config['redis']=_[_0xd752('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd752('0xc'))(new Redis(config[_0xd752('0xd')]));function emit(_0x501988,_0x22216a,_0x2508ec){io['to'](_0x501988)[_0xd752('0xe')](_0x22216a,_0x2508ec);}function getTicket(_0x460884,_0x2229dc,_0x57a38e,_0x4d0406,_0x5e57ab,_0x252101,_0x1cd8c6,_0x51c525){var _0x1af2ae=Object[_0xd752('0xf')]({},{'OwnerId':_0x2229dc['id'],'Subject':intUtil[_0xd752('0x10')](_0x4d0406[_0xd752('0x11')],_0x5e57ab,'\x20'),'Description':intUtil['getString'](_0x4d0406['Descriptions'],_0x5e57ab,'\x0a')},getCustomFields(_0x252101,_0x5e57ab));if(_0x57a38e){if(_0x4d0406['ticketType']===_0xd752('0x12')){_0x1af2ae[_0xd752('0x13')]=moment[_0xd752('0x14')]();_0x1af2ae['IsReminderSet']=![];_0x1af2ae[_0xd752('0x15')]=![];if(_0x57a38e[_0xd752('0x16')]===_0xd752('0x17')||_0x57a38e[_0xd752('0x16')]===_0xd752('0x18')){_0x1af2ae[_0xd752('0x19')]=_0x57a38e['id'];}else if(_0x57a38e[_0xd752('0x16')]===_0xd752('0x1a')){_0x1af2ae[_0xd752('0x1b')]=_0x57a38e['id'];}}else if(_0x4d0406[_0xd752('0x1c')]===_0xd752('0x1d')){if(_0x57a38e[_0xd752('0x16')]===_0xd752('0x17')){_0x1af2ae[_0xd752('0x1e')]=_0x57a38e['id'];}else if(_0x57a38e['endUserType']==='account'){_0x1af2ae['AccountId']=_0x57a38e['id'];}else if(_0x57a38e['endUserType']===_0xd752('0x18')&&_0x4d0406[_0xd752('0x1f')]){_0x1af2ae[_0x4d0406[_0xd752('0x1f')]]=_0x57a38e['id'];}else{logger['info'](_0xd752('0x20'));}}}return _0x1cd8c6['sobject'](_0x4d0406[_0xd752('0x1c')])[_0xd752('0x21')](_0x1af2ae);}function getUser(_0x550ab8,_0x4455a5,_0x273a7c){if(!_[_0xd752('0x22')](_0x4455a5)&&intUtil[_0xd752('0x23')](_0x4455a5)){var _0x6a6957={'Email':_0x4455a5};var _0x26f68e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x273a7c[_0xd752('0x24')]('User')[_0xd752('0x25')](_0x6a6957,_0x26f68e)['execute']()[_0xd752('0x26')](function(_0x549b74){if(_0x549b74[_0xd752('0x27')]){var _0x7027d3=_[_0xd752('0x25')](_0x549b74,function(_0x446d18){return _0x446d18[_0xd752('0x28')]===_0x4455a5;});if(_0x7027d3){logger['info'](_0xd752('0x29'),_0x4455a5);return BPromise[_0xd752('0x2a')]({'id':_0x7027d3['Id'],'name':_0x7027d3[_0xd752('0x2b')]});}}else{logger[_0xd752('0x2c')](_0xd752('0x2d'),_0x4455a5);return _0x273a7c[_0xd752('0x2e')]()[_0xd752('0x26')](function(_0x41647a){return BPromise[_0xd752('0x2a')]({'id':_0x41647a['user_id'],'name':_0x41647a[_0xd752('0x2f')]});});}});}else{logger['info'](_0xd752('0x2d'),_0x4455a5);return _0x273a7c[_0xd752('0x2e')]()[_0xd752('0x26')](function(_0x339a6c){return BPromise['resolve']({'id':_0x339a6c[_0xd752('0x30')],'name':_0x339a6c[_0xd752('0x2f')]});});}}function getEndUser(_0xe4cd97,_0x2af574,_0x8ebdb7,_0x257da8,_0x5d9457){var _0x1b99ca={'$or':{'Phone':_0x257da8}};var _0x4bc003={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xd752('0x2c')](_0xd752('0x31'),_0x257da8,_0x2af574['moduleSearch']);switch(_0x2af574['moduleSearch']){case _0xd752('0x32'):var _0x4bb7ca=_['cloneDeep'](_0x1b99ca);if(_0x2af574['additionalSearchContact']){var _0x13b1e4={};_0x13b1e4[_0x2af574[_0xd752('0x33')]]=_0x257da8;_['merge'](_0x4bb7ca[_0xd752('0x34')],_0x13b1e4);}return _0x5d9457[_0xd752('0x24')](_0xd752('0x35'))[_0xd752('0x25')](_0x4bb7ca,_0x4bc003)[_0xd752('0x36')]()[_0xd752('0x26')](function(_0x127ddc){if(_0x127ddc&&_0x127ddc['length']){return _0x127ddc;}else{var _0x1bf5ed=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574['additionalSearchLead']){var _0x5d0add={};_0x5d0add[_0x2af574['additionalSearchLead']]=_0x257da8;_[_0xd752('0x38')](_0x1bf5ed[_0xd752('0x34')],_0x5d0add);}return _0x5d9457['sobject'](_0xd752('0x39'))[_0xd752('0x25')](_0x1bf5ed,_0x4bc003);}});case _0xd752('0x3a'):var _0x3d7050=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574[_0xd752('0x3b')]){var _0x13b1e4={};_0x13b1e4[_0x2af574[_0xd752('0x3b')]]=_0x257da8;_['merge'](_0x3d7050[_0xd752('0x34')],_0x13b1e4);}return _0x5d9457[_0xd752('0x24')]('Account')[_0xd752('0x25')](_0x3d7050,_0x4bc003)[_0xd752('0x36')]()[_0xd752('0x26')](function(_0x24e607){if(_0x24e607&&_0x24e607[_0xd752('0x27')]){return _0x24e607;}else{var _0x336280=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574['additionalSearchContact']){var _0x56049e={};_0x56049e[_0x2af574[_0xd752('0x33')]]=_0x257da8;_[_0xd752('0x38')](_0x336280['$or'],_0x56049e);}return _0x5d9457['sobject'](_0xd752('0x35'))[_0xd752('0x25')](_0x336280,_0x4bc003)[_0xd752('0x26')](function(_0x54cbd4){if(_0x54cbd4&&_0x54cbd4[_0xd752('0x27')]){return _0x54cbd4;}else{var _0x2e1b4b=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574[_0xd752('0x3c')]){var _0x38dc5e={};_0x38dc5e[_0x2af574[_0xd752('0x3c')]]=_0x257da8;_[_0xd752('0x38')](_0x2e1b4b[_0xd752('0x34')],_0x38dc5e);}return _0x5d9457[_0xd752('0x24')](_0xd752('0x39'))[_0xd752('0x25')](_0x2e1b4b,_0x4bc003);}});}});case _0xd752('0x17'):var _0x4bb7ca=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574[_0xd752('0x33')]){var _0x13b1e4={};_0x13b1e4[_0x2af574[_0xd752('0x33')]]=_0x257da8;_[_0xd752('0x38')](_0x4bb7ca[_0xd752('0x34')],_0x13b1e4);}return _0x5d9457[_0xd752('0x24')](_0xd752('0x35'))[_0xd752('0x25')](_0x4bb7ca,_0x4bc003)[_0xd752('0x36')]();case _0xd752('0x18'):var _0x4aed79=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574['additionalSearchLead']){var _0x13b1e4={};_0x13b1e4[_0x2af574[_0xd752('0x3c')]]=_0x257da8;_['merge'](_0x4aed79['$or'],_0x13b1e4);}return _0x5d9457[_0xd752('0x24')]('Lead')[_0xd752('0x25')](_0x4aed79,_0x4bc003);case _0xd752('0x1a'):var _0x3d7050=_[_0xd752('0x37')](_0x1b99ca);if(_0x2af574['additionalSearchAccount']){var _0x13b1e4={};_0x13b1e4[_0x2af574[_0xd752('0x3b')]]=_0x257da8;_[_0xd752('0x38')](_0x3d7050[_0xd752('0x34')],_0x13b1e4);}return _0x5d9457['sobject']('Account')[_0xd752('0x25')](_0x3d7050,_0x4bc003);default:return null;}})[_0xd752('0x26')](function(_0x488933){if(_0x488933&&_0x488933[_0xd752('0x27')]){var _0x26814e=_[_0xd752('0x3d')](_0x488933);if(_0x26814e){return BPromise[_0xd752('0x2a')]({'id':_0x26814e['Id'],'name':_0x26814e[_0xd752('0x2b')],'phone':_0x26814e[_0xd752('0x3e')],'endUserType':_0x26814e[_0xd752('0x3f')][_0xd752('0x40')][_0xd752('0x41')]()});}}})[_0xd752('0x26')](function(_0x56eb72){if(_0x56eb72){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x56eb72[_0xd752('0x16')],_0x257da8);return BPromise[_0xd752('0x2a')](_0x56eb72);}else{logger['info'](_0xd752('0x42'),_0x257da8);var _0x5499df={'Phone':_0x257da8};if(_0x2af574[_0xd752('0x43')]){if(_0x2af574[_0xd752('0x43')]===_0xd752('0x17')){logger[_0xd752('0x2c')](_0xd752('0x44'),_0x257da8,_0x2af574[_0xd752('0x43')]);_0x5499df[_0xd752('0x45')]=_0x8ebdb7!==_0xd752('0x46')?_0x8ebdb7:util[_0xd752('0x47')]('Caller\x20-\x20%s',_0x257da8);}else if(_0x2af574[_0xd752('0x43')]===_0xd752('0x18')){logger[_0xd752('0x2c')](_0xd752('0x44'),_0x257da8,_0x2af574[_0xd752('0x43')]);_0x5499df['LastName']=_0x8ebdb7!==_0xd752('0x46')?_0x8ebdb7:util[_0xd752('0x47')](_0xd752('0x48'),_0x257da8);_0x5499df[_0xd752('0x49')]=_0xd752('0x4a');}else if(_0x2af574[_0xd752('0x43')]==='account'){logger[_0xd752('0x2c')](_0xd752('0x44'),_0x257da8,_0x2af574[_0xd752('0x43')]);_0x5499df[_0xd752('0x2b')]=_0x8ebdb7!==_0xd752('0x46')?_0x8ebdb7:util[_0xd752('0x47')]('Caller\x20-\x20%s',_0x257da8);}else{return null;}}return _0x5d9457[_0xd752('0x24')](_[_0xd752('0x4b')](_0x2af574[_0xd752('0x43')]))['create'](_0x5499df)[_0xd752('0x26')](function(_0x2939d1){return BPromise[_0xd752('0x2a')]({'id':_0x2939d1['id'],'endUserType':_0x2af574[_0xd752('0x43')]});});}});}function getCustomFields(_0x5407b7,_0x3372df){var _0x295f6f={};if(_0x5407b7['length']>0x0){_[_0xd752('0x4c')](_0x5407b7,function(_0xcb87f2){if(_[_0xd752('0x4d')](['string','picklist'],_0xcb87f2[_0xd752('0x40')])&&_0xcb87f2[_0xd752('0x4e')]){_0x295f6f[_0xcb87f2[_0xd752('0x4e')]]=_0xcb87f2[_0xd752('0x4f')]['toString']();}else if(_0xcb87f2[_0xd752('0x40')]===_0xd752('0x50')&&_0xcb87f2[_0xd752('0x51')]&&_0xcb87f2['idField']){_0x3372df[_0xcb87f2[_0xd752('0x51')]]&&(_0x295f6f[_0xcb87f2[_0xd752('0x4e')]]=_0x3372df[_0xcb87f2[_0xd752('0x51')]][_0xd752('0x52')]());}else if(_0xcb87f2['type']===_0xd752('0x53')&&_0xcb87f2[_0xd752('0x54')]&&_0xcb87f2[_0xd752('0x54')]['name']&&_0xcb87f2[_0xd752('0x4e')]){_0x3372df[_0xcb87f2[_0xd752('0x54')]['name'][_0xd752('0x41')]()]&&(_0x295f6f[_0xcb87f2[_0xd752('0x4e')]]=_0x3372df[_0xcb87f2[_0xd752('0x54')][_0xd752('0x55')][_0xd752('0x41')]()][_0xd752('0x52')]());}});}return _0x295f6f;}function getConnection(_0x529562){var _0x115a53=_0x529562[_0xd752('0x56')]['concat'](_0x529562[_0xd752('0x57')]);var _0x51f529=new jsforce['Connection']({'oauth2':{'loginUrl':_0x529562[_0xd752('0x58')]||_0xd752('0x59'),'clientId':_0x529562[_0xd752('0x5a')],'clientSecret':_0x529562['clientSecret']}});return _0x51f529[_0xd752('0x5b')](_0x529562[_0xd752('0x5c')],_0x115a53)[_0xd752('0x26')](function(){logger[_0xd752('0x2c')](_0xd752('0x5d'));return _0x51f529;});}exports[_0xd752('0x5e')]=function(_0x301cdd,_0x53aa49,_0x2ebf32,_0x209a06,_0x4e194c,_0x317002){var _0x355229,_0x320a65,_0xf9a10f,_0x4e19b0;_0x317002[_0xd752('0x5f')]=intUtil[_0xd752('0x60')](_0x317002[_0xd752('0x5f')]);_0x317002['remoteUri']=intUtil[_0xd752('0x60')](_0x317002[_0xd752('0x58')]);if(_0x4e194c&&_0x4e194c[_0xd752('0x61')]){logger[_0xd752('0x2c')](_0xd752('0x62'),_0xd752('0x63'));_0x53aa49['recordingURL']=util[_0xd752('0x47')](_0xd752('0x64'),_0x317002[_0xd752('0x5f')],_0x53aa49[_0xd752('0x65')],md5(_0x53aa49['uniqueid']));}else{_0x53aa49['recordingURL']='';}return getConnection(_0x317002)[_0xd752('0x26')](function(_0xe56dfa){_0x4e19b0=_0xe56dfa;return getUser(_0x317002,_0x209a06[_0xd752('0x66')],_0x4e19b0);})[_0xd752('0x26')](function(_0x500bc2){_0x355229=_0x500bc2;return getEndUser(_0x317002,_0x2ebf32,_0x53aa49[_0xd752('0x67')],_0x53aa49[_0xd752('0x68')],_0x4e19b0);})[_0xd752('0x26')](function(_0x847359){_0x320a65=_0x847359;return getTicket(_0x317002,_0x355229,_0x320a65,_0x2ebf32,_0x53aa49,_0x2ebf32[_0xd752('0x69')],_0x4e19b0,_0xd752('0x5e'));})[_0xd752('0x26')](function(_0x15bcc7){_0xf9a10f=_0x15bcc7;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0xf9a10f['id']);logger[_0xd752('0x2c')](_0xd752('0x6a'),_0xf9a10f['id'],_0x209a06[_0xd752('0x55')],_0x317002['type']);switch(_0x317002[_0xd752('0x40')]){case _0xd752('0x6b'):emit(util[_0xd752('0x47')](_0xd752('0x6c'),_0x209a06[_0xd752('0x55')]),'trigger:salesforce:display',{'recordId':_0xf9a10f['id']});break;case'newTab':emit(util[_0xd752('0x47')](_0xd752('0x6c'),_0x209a06[_0xd752('0x55')]),_0xd752('0x6d'),{'uri':util[_0xd752('0x47')](_0xd752('0x6e'),_0x4e19b0[_0xd752('0x6f')],_0xf9a10f['id'])});break;default:logger[_0xd752('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xd752('0x71')](function(_0x4fb22b){logger['error'](_0xd752('0x62'),_0x4fb22b);});};exports[_0xd752('0x72')]=function(_0x15b8d3,_0x25f200,_0x9517ff,_0x4f581b,_0x261b9b,_0x16a5f4,_0x507983){var _0xb86016,_0x751191,_0x24375a,_0x22b26e;_0x16a5f4[_0xd752('0x5f')]=intUtil[_0xd752('0x60')](_0x16a5f4[_0xd752('0x5f')]);_0x16a5f4[_0xd752('0x58')]=intUtil[_0xd752('0x60')](_0x16a5f4[_0xd752('0x58')]);if(_0x507983&&_0x507983['recordingFormat']&&_0x507983[_0xd752('0x73')]!==_0xd752('0x74')){logger[_0xd752('0x2c')](_0xd752('0x75'),_0xd752('0x63'));_0x25f200['recordingURL']=util[_0xd752('0x47')](_0xd752('0x64'),_0x16a5f4[_0xd752('0x5f')],_0x25f200[_0xd752('0x65')],md5(_0x25f200[_0xd752('0x65')]));}return getConnection(_0x16a5f4)[_0xd752('0x26')](function(_0x799714){_0x22b26e=_0x799714;return getUser(_0x16a5f4,_0x4f581b['email'],_0x22b26e);})[_0xd752('0x26')](function(_0x1fb712){_0xb86016=_0x1fb712;return getEndUser(_0x16a5f4,_0x9517ff,_0x25f200[_0xd752('0x76')],_0x25f200[_0xd752('0x77')],_0x22b26e);})[_0xd752('0x26')](function(_0x1d6aef){_0x751191=_0x1d6aef;return getTicket(_0x16a5f4,_0xb86016,_0x751191,_0x9517ff,_0x25f200,_0x9517ff['Fields'],_0x22b26e,'outbound');})[_0xd752('0x26')](function(_0x26a05e){_0x24375a=_0x26a05e;logger[_0xd752('0x2c')](_0xd752('0x78'),_0x24375a['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x24375a['id'],_0x4f581b[_0xd752('0x55')],_0x16a5f4[_0xd752('0x40')]);switch(_0x16a5f4['type']){case _0xd752('0x6b'):emit(util[_0xd752('0x47')]('user:%s',_0x4f581b[_0xd752('0x55')]),'trigger:salesforce:display',{'recordId':_0x24375a['id']});break;case _0xd752('0x79'):emit(util['format'](_0xd752('0x6c'),_0x4f581b[_0xd752('0x55')]),_0xd752('0x6d'),{'uri':util[_0xd752('0x47')](_0xd752('0x6e'),_0x22b26e[_0xd752('0x6f')],_0x24375a['id'])});break;default:logger[_0xd752('0x70')](_0xd752('0x75'),_0xd752('0x7a'));}})[_0xd752('0x71')](function(_0x2a0530){logger['error'](_0xd752('0x75'),_0x2a0530);});};exports[_0xd752('0x7b')]=function(_0xa177df,_0x12ca34,_0x3025b2,_0x1433e5,_0x5e1177,_0x1f4efb){var _0x275ccc,_0x2172f0,_0x1c06fd,_0x414c24;_0x1f4efb['serverUrl']=intUtil['stripTrailingSlash'](_0x1f4efb[_0xd752('0x5f')]);_0x1f4efb['remoteUri']=intUtil[_0xd752('0x60')](_0x1f4efb[_0xd752('0x58')]);if(_0x5e1177&&_0x5e1177[_0xd752('0x61')]){logger[_0xd752('0x2c')]('['+_0x12ca34[_0xd752('0x7c')][_0xd752('0x7d')]()+']',_0xd752('0x63'));_0x12ca34['recordingURL']=util[_0xd752('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f4efb[_0xd752('0x5f')],_0x12ca34[_0xd752('0x65')],md5(_0x12ca34['uniqueid']));}else{_0x12ca34['recordingURL']='';}return getConnection(_0x1f4efb)[_0xd752('0x26')](function(_0xc06a4e){_0x414c24=_0xc06a4e;if(!_[_0xd752('0x22')](_0x1433e5)){return getUser(_0x1f4efb,_0x1433e5['name'],_0x414c24);}else{return getUser(_0x1f4efb,null,_0x414c24);}})[_0xd752('0x26')](function(_0x3a0c72){_0x275ccc=_0x3a0c72;return getEndUser(_0x1f4efb,_0x3025b2,_0x12ca34[_0xd752('0x67')],_0x12ca34[_0xd752('0x68')],_0x414c24);})[_0xd752('0x26')](function(_0x466485){_0x2172f0=_0x466485;return getTicket(_0x1f4efb,_0x275ccc,_0x2172f0,_0x3025b2,_0x12ca34,_0x3025b2[_0xd752('0x69')],_0x414c24);})[_0xd752('0x26')](function(_0x24ddae){_0x1c06fd=_0x24ddae;logger[_0xd752('0x2c')]('['+_0x12ca34[_0xd752('0x7c')][_0xd752('0x7d')]()+_0xd752('0x7e'),_0x1c06fd['id']);logger[_0xd752('0x2c')]('['+_0x12ca34[_0xd752('0x7c')][_0xd752('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1f4efb[_0xd752('0x40')]);})[_0xd752('0x71')](function(_0x447c00){logger[_0xd752('0x70')]('['+_0x12ca34['lastevent'][_0xd752('0x7d')]()+']',_0x447c00);});}; \ No newline at end of file +var _0xd3c9=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','IsReminderSet','contact','endUserType','lead','WhoId','WhatId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','forEach','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xd3c9,0x192));var _0x9d3c=function(_0x4beadb,_0x142d5d){_0x4beadb=_0x4beadb-0x0;var _0x10b3dd=_0xd3c9[_0x4beadb];return _0x10b3dd;};'use strict';var _=require('lodash');var rp=require(_0x9d3c('0x0'));var moment=require(_0x9d3c('0x1'));var BPromise=require(_0x9d3c('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x9d3c('0x3'));var Redis=require(_0x9d3c('0x4'));var intUtil=require(_0x9d3c('0x5'));var config=require(_0x9d3c('0x6'));var logger=require(_0x9d3c('0x7'))('salesforce');config[_0x9d3c('0x8')]=_[_0x9d3c('0x9')](config[_0x9d3c('0x8')],{'host':_0x9d3c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9d3c('0x8')]));function emit(_0x4fed7f,_0x5d644d,_0x47df9b){io['to'](_0x4fed7f)[_0x9d3c('0xb')](_0x5d644d,_0x47df9b);}function getTicket(_0x41d8b9,_0x264d9a,_0x44c1f8,_0x2a8d14,_0x5d5a95,_0x24a9af,_0x272e3e,_0x5b63ba){var _0x3b9f73=Object[_0x9d3c('0xc')]({},{'OwnerId':_0x264d9a['id'],'Subject':intUtil['getString'](_0x2a8d14[_0x9d3c('0xd')],_0x5d5a95,'\x20'),'Description':intUtil[_0x9d3c('0xe')](_0x2a8d14['Descriptions'],_0x5d5a95,'\x0a')},getCustomFields(_0x24a9af,_0x5d5a95));if(_0x44c1f8){if(_0x2a8d14[_0x9d3c('0xf')]===_0x9d3c('0x10')){_0x3b9f73[_0x9d3c('0x11')]=moment['utc']();_0x3b9f73[_0x9d3c('0x12')]=![];_0x3b9f73['IsRecurrence']=![];if(_0x44c1f8['endUserType']===_0x9d3c('0x13')||_0x44c1f8[_0x9d3c('0x14')]===_0x9d3c('0x15')){_0x3b9f73[_0x9d3c('0x16')]=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]==='account'){_0x3b9f73[_0x9d3c('0x17')]=_0x44c1f8['id'];}}else if(_0x2a8d14['ticketType']==='Case'){if(_0x44c1f8[_0x9d3c('0x14')]==='contact'){_0x3b9f73['ContactId']=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]===_0x9d3c('0x18')){_0x3b9f73[_0x9d3c('0x19')]=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]==='lead'&&_0x2a8d14[_0x9d3c('0x1a')]){_0x3b9f73[_0x2a8d14[_0x9d3c('0x1a')]]=_0x44c1f8['id'];}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x1c'));}}}return _0x272e3e[_0x9d3c('0x1d')](_0x2a8d14[_0x9d3c('0xf')])[_0x9d3c('0x1e')](_0x3b9f73);}function getUser(_0x4b7a65,_0x31b40a,_0x1237f4){if(!_['isNil'](_0x31b40a)&&intUtil['validateEmail'](_0x31b40a)){var _0x197dae={'Email':_0x31b40a};var _0x564773={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1237f4[_0x9d3c('0x1d')](_0x9d3c('0x1f'))[_0x9d3c('0x20')](_0x197dae,_0x564773)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x2c2a9d){if(_0x2c2a9d[_0x9d3c('0x23')]){var _0x994041=_[_0x9d3c('0x20')](_0x2c2a9d,function(_0x18f2ed){return _0x18f2ed['Email']===_0x31b40a;});if(_0x994041){logger[_0x9d3c('0x1b')](_0x9d3c('0x24'),_0x31b40a);return BPromise[_0x9d3c('0x25')]({'id':_0x994041['Id'],'name':_0x994041[_0x9d3c('0x26')]});}}else{logger['info'](_0x9d3c('0x27'),_0x31b40a);return _0x1237f4[_0x9d3c('0x28')]()['then'](function(_0x5dcee7){return BPromise['resolve']({'id':_0x5dcee7[_0x9d3c('0x29')],'name':_0x5dcee7[_0x9d3c('0x2a')]});});}});}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x27'),_0x31b40a);return _0x1237f4[_0x9d3c('0x28')]()[_0x9d3c('0x22')](function(_0x2d7f47){return BPromise[_0x9d3c('0x25')]({'id':_0x2d7f47[_0x9d3c('0x29')],'name':_0x2d7f47['display_name']});});}}function getEndUser(_0x18274a,_0x1aa208,_0x4c372d,_0x420098,_0x3602a1){var _0x89d4fc={'$or':{'Phone':_0x420098}};var _0x3e6f0a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9d3c('0x25')]()[_0x9d3c('0x22')](function(){logger['info'](_0x9d3c('0x2b'),_0x420098,_0x1aa208[_0x9d3c('0x2c')]);switch(_0x1aa208[_0x9d3c('0x2c')]){case _0x9d3c('0x2d'):var _0x7507ba=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchContact']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x2f')]]=_0x420098;_[_0x9d3c('0x30')](_0x7507ba['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x31'))[_0x9d3c('0x20')](_0x7507ba,_0x3e6f0a)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x24af1a){if(_0x24af1a&&_0x24af1a[_0x9d3c('0x23')]){return _0x24af1a;}else{var _0x2b9734=_['cloneDeep'](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x32')]){var _0x1d75b2={};_0x1d75b2[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_['merge'](_0x2b9734[_0x9d3c('0x33')],_0x1d75b2);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))[_0x9d3c('0x20')](_0x2b9734,_0x3e6f0a);}});case _0x9d3c('0x35'):var _0x1ac20d=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x36')]){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x36')]]=_0x420098;_[_0x9d3c('0x30')](_0x1ac20d['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x37'))[_0x9d3c('0x20')](_0x1ac20d,_0x3e6f0a)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x273c82){if(_0x273c82&&_0x273c82[_0x9d3c('0x23')]){return _0x273c82;}else{var _0x158399=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchContact']){var _0x41f736={};_0x41f736[_0x1aa208[_0x9d3c('0x2f')]]=_0x420098;_['merge'](_0x158399[_0x9d3c('0x33')],_0x41f736);}return _0x3602a1[_0x9d3c('0x1d')]('Contact')[_0x9d3c('0x20')](_0x158399,_0x3e6f0a)[_0x9d3c('0x22')](function(_0x54bf01){if(_0x54bf01&&_0x54bf01['length']){return _0x54bf01;}else{var _0xb146ee=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x32')]){var _0x13e25b={};_0x13e25b[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_[_0x9d3c('0x30')](_0xb146ee[_0x9d3c('0x33')],_0x13e25b);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))['find'](_0xb146ee,_0x3e6f0a);}});}});case'contact':var _0x7507ba=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x2f')]){var _0x2251dc={};_0x2251dc[_0x1aa208['additionalSearchContact']]=_0x420098;_[_0x9d3c('0x30')](_0x7507ba['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x31'))[_0x9d3c('0x20')](_0x7507ba,_0x3e6f0a)[_0x9d3c('0x21')]();case _0x9d3c('0x15'):var _0xe3ce82=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchLead']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_[_0x9d3c('0x30')](_0xe3ce82[_0x9d3c('0x33')],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))[_0x9d3c('0x20')](_0xe3ce82,_0x3e6f0a);case'account':var _0x1ac20d=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchAccount']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x36')]]=_0x420098;_[_0x9d3c('0x30')](_0x1ac20d[_0x9d3c('0x33')],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')]('Account')['find'](_0x1ac20d,_0x3e6f0a);default:return null;}})[_0x9d3c('0x22')](function(_0x437fd5){if(_0x437fd5&&_0x437fd5[_0x9d3c('0x23')]){var _0x58d31e=_[_0x9d3c('0x38')](_0x437fd5);if(_0x58d31e){return BPromise['resolve']({'id':_0x58d31e['Id'],'name':_0x58d31e[_0x9d3c('0x26')],'phone':_0x58d31e['Phone'],'endUserType':_0x58d31e[_0x9d3c('0x39')][_0x9d3c('0x3a')][_0x9d3c('0x3b')]()});}}})[_0x9d3c('0x22')](function(_0x433863){if(_0x433863){logger[_0x9d3c('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x433863[_0x9d3c('0x14')],_0x420098);return BPromise[_0x9d3c('0x25')](_0x433863);}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x3c'),_0x420098);var _0xa03392={'Phone':_0x420098};if(_0x1aa208['moduleCreate']){if(_0x1aa208[_0x9d3c('0x3d')]===_0x9d3c('0x13')){logger[_0x9d3c('0x1b')](_0x9d3c('0x3e'),_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392['LastName']=_0x4c372d!==_0x9d3c('0x3f')?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);}else if(_0x1aa208['moduleCreate']==='lead'){logger[_0x9d3c('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392[_0x9d3c('0x42')]=_0x4c372d!==''?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);_0xa03392[_0x9d3c('0x43')]=_0x9d3c('0x44');}else if(_0x1aa208[_0x9d3c('0x3d')]===_0x9d3c('0x18')){logger[_0x9d3c('0x1b')](_0x9d3c('0x3e'),_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392[_0x9d3c('0x26')]=_0x4c372d!==_0x9d3c('0x3f')?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);}else{return null;}}return _0x3602a1[_0x9d3c('0x1d')](_['upperFirst'](_0x1aa208[_0x9d3c('0x3d')]))[_0x9d3c('0x1e')](_0xa03392)[_0x9d3c('0x22')](function(_0x3f8d46){return BPromise['resolve']({'id':_0x3f8d46['id'],'endUserType':_0x1aa208[_0x9d3c('0x3d')]});});}});}function getCustomFields(_0x55d80e,_0x3e9075){var _0x45e408={};if(_0x55d80e[_0x9d3c('0x23')]>0x0){_[_0x9d3c('0x45')](_0x55d80e,function(_0x5df3c6){if(_['includes']([_0x9d3c('0x46'),_0x9d3c('0x47')],_0x5df3c6['type'])&&_0x5df3c6[_0x9d3c('0x48')]){_0x45e408[_0x5df3c6['idField']]=_0x5df3c6[_0x9d3c('0x49')]['toString']();}else if(_0x5df3c6[_0x9d3c('0x3a')]==='variable'&&_0x5df3c6[_0x9d3c('0x4a')]&&_0x5df3c6[_0x9d3c('0x48')]){_0x3e9075[_0x5df3c6[_0x9d3c('0x4a')]]&&(_0x45e408[_0x5df3c6['idField']]=_0x3e9075[_0x5df3c6['variableName']][_0x9d3c('0x4b')]());}else if(_0x5df3c6['type']===_0x9d3c('0x4c')&&_0x5df3c6['Variable']&&_0x5df3c6[_0x9d3c('0x4d')][_0x9d3c('0x4e')]&&_0x5df3c6['idField']){_0x3e9075[_0x5df3c6[_0x9d3c('0x4d')][_0x9d3c('0x4e')][_0x9d3c('0x3b')]()]&&(_0x45e408[_0x5df3c6[_0x9d3c('0x48')]]=_0x3e9075[_0x5df3c6[_0x9d3c('0x4d')]['name'][_0x9d3c('0x3b')]()][_0x9d3c('0x4b')]());}});}return _0x45e408;}function getConnection(_0x563cf4){var _0x2e9816=_0x563cf4['password'][_0x9d3c('0x4f')](_0x563cf4[_0x9d3c('0x50')]);var _0x8addf1=new jsforce[(_0x9d3c('0x51'))]({'oauth2':{'loginUrl':_0x563cf4[_0x9d3c('0x52')]||_0x9d3c('0x53'),'clientId':_0x563cf4[_0x9d3c('0x54')],'clientSecret':_0x563cf4[_0x9d3c('0x55')]}});return _0x8addf1[_0x9d3c('0x56')](_0x563cf4[_0x9d3c('0x57')],_0x2e9816)[_0x9d3c('0x22')](function(){logger[_0x9d3c('0x1b')](_0x9d3c('0x58'));return _0x8addf1;});}exports[_0x9d3c('0x59')]=function(_0x49fd94,_0x65910d,_0x4a43a5,_0x52f01c,_0x357965,_0x39705f){var _0x2511f1,_0x26502b,_0x21eacb,_0xbec065;_0x39705f[_0x9d3c('0x5a')]=intUtil[_0x9d3c('0x5b')](_0x39705f[_0x9d3c('0x5a')]);_0x39705f[_0x9d3c('0x52')]=intUtil[_0x9d3c('0x5b')](_0x39705f['remoteUri']);if(_0x357965&&_0x357965[_0x9d3c('0x5c')]){logger[_0x9d3c('0x1b')](_0x9d3c('0x5d'),_0x9d3c('0x5e'));_0x65910d[_0x9d3c('0x5f')]=util['format'](_0x9d3c('0x60'),_0x39705f[_0x9d3c('0x5a')],_0x65910d[_0x9d3c('0x61')],md5(_0x65910d[_0x9d3c('0x61')]));}else{_0x65910d[_0x9d3c('0x5f')]='';}return getConnection(_0x39705f)[_0x9d3c('0x22')](function(_0x366cbe){_0xbec065=_0x366cbe;return getUser(_0x39705f,_0x52f01c[_0x9d3c('0x62')],_0xbec065);})[_0x9d3c('0x22')](function(_0x8ad520){_0x2511f1=_0x8ad520;return getEndUser(_0x39705f,_0x4a43a5,_0x65910d['calleridname'],_0x65910d[_0x9d3c('0x63')],_0xbec065);})['then'](function(_0x5c8a45){_0x26502b=_0x5c8a45;return getTicket(_0x39705f,_0x2511f1,_0x26502b,_0x4a43a5,_0x65910d,_0x4a43a5[_0x9d3c('0x64')],_0xbec065,'queue');})[_0x9d3c('0x22')](function(_0x5269af){_0x21eacb=_0x5269af;logger[_0x9d3c('0x1b')](_0x9d3c('0x65'),_0x21eacb['id']);logger['info'](_0x9d3c('0x66'),_0x21eacb['id'],_0x52f01c['name'],_0x39705f[_0x9d3c('0x3a')]);switch(_0x39705f[_0x9d3c('0x3a')]){case'integrationTab':emit(util['format'](_0x9d3c('0x67'),_0x52f01c[_0x9d3c('0x4e')]),'trigger:salesforce:display',{'recordId':_0x21eacb['id']});break;case _0x9d3c('0x68'):emit(util['format'](_0x9d3c('0x67'),_0x52f01c[_0x9d3c('0x4e')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0xbec065[_0x9d3c('0x69')],_0x21eacb['id'])});break;default:logger['error'](_0x9d3c('0x6a'));}})[_0x9d3c('0x6b')](function(_0x27ccdd){logger[_0x9d3c('0x6c')](_0x9d3c('0x5d'),_0x27ccdd);});};exports['outbound']=function(_0x17dfff,_0x1fc63d,_0x25020c,_0x2197bc,_0x38c3ce,_0x5ddbfc,_0x228b6c){var _0x5ca79a,_0x401a51,_0x1a51c0,_0x321f50;_0x5ddbfc['serverUrl']=intUtil[_0x9d3c('0x5b')](_0x5ddbfc['serverUrl']);_0x5ddbfc[_0x9d3c('0x52')]=intUtil['stripTrailingSlash'](_0x5ddbfc[_0x9d3c('0x52')]);if(_0x228b6c&&_0x228b6c['recordingFormat']&&_0x228b6c[_0x9d3c('0x6d')]!==_0x9d3c('0x6e')){logger['info'](_0x9d3c('0x6f'),_0x9d3c('0x5e'));_0x1fc63d['recordingURL']=util[_0x9d3c('0x40')](_0x9d3c('0x60'),_0x5ddbfc['serverUrl'],_0x1fc63d[_0x9d3c('0x61')],md5(_0x1fc63d[_0x9d3c('0x61')]));}return getConnection(_0x5ddbfc)[_0x9d3c('0x22')](function(_0x5b9140){_0x321f50=_0x5b9140;return getUser(_0x5ddbfc,_0x2197bc[_0x9d3c('0x62')],_0x321f50);})['then'](function(_0x2d339a){_0x5ca79a=_0x2d339a;return getEndUser(_0x5ddbfc,_0x25020c,_0x1fc63d[_0x9d3c('0x70')],_0x1fc63d[_0x9d3c('0x71')],_0x321f50);})['then'](function(_0xbf790f){_0x401a51=_0xbf790f;return getTicket(_0x5ddbfc,_0x5ca79a,_0x401a51,_0x25020c,_0x1fc63d,_0x25020c[_0x9d3c('0x64')],_0x321f50,_0x9d3c('0x72'));})[_0x9d3c('0x22')](function(_0x5e6fb4){_0x1a51c0=_0x5e6fb4;logger[_0x9d3c('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1a51c0['id']);logger[_0x9d3c('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1a51c0['id'],_0x2197bc[_0x9d3c('0x4e')],_0x5ddbfc[_0x9d3c('0x3a')]);switch(_0x5ddbfc['type']){case _0x9d3c('0x73'):emit(util[_0x9d3c('0x40')]('user:%s',_0x2197bc[_0x9d3c('0x4e')]),'trigger:salesforce:display',{'recordId':_0x1a51c0['id']});break;case'newTab':emit(util['format'](_0x9d3c('0x67'),_0x2197bc['name']),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x321f50[_0x9d3c('0x69')],_0x1a51c0['id'])});break;default:logger[_0x9d3c('0x6c')](_0x9d3c('0x6f'),_0x9d3c('0x74'));}})[_0x9d3c('0x6b')](function(_0x121b6d){logger[_0x9d3c('0x6c')](_0x9d3c('0x6f'),_0x121b6d);});};exports[_0x9d3c('0x75')]=function(_0x286efc,_0x2d919f,_0x2b59f4,_0x2d3743,_0x2cc665,_0x3c7387){var _0x225588,_0x33b1d0,_0x4315e4,_0x29a200;_0x3c7387['serverUrl']=intUtil[_0x9d3c('0x5b')](_0x3c7387[_0x9d3c('0x5a')]);_0x3c7387['remoteUri']=intUtil[_0x9d3c('0x5b')](_0x3c7387[_0x9d3c('0x52')]);if(_0x2cc665&&_0x2cc665['monitor_format']){logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+']','Recording\x20is\x20enabled!');_0x2d919f['recordingURL']=util[_0x9d3c('0x40')](_0x9d3c('0x60'),_0x3c7387[_0x9d3c('0x5a')],_0x2d919f[_0x9d3c('0x61')],md5(_0x2d919f[_0x9d3c('0x61')]));}else{_0x2d919f[_0x9d3c('0x5f')]='';}return getConnection(_0x3c7387)[_0x9d3c('0x22')](function(_0x43edbf){_0x29a200=_0x43edbf;if(!_[_0x9d3c('0x78')](_0x2d3743)){return getUser(_0x3c7387,_0x2d3743[_0x9d3c('0x4e')],_0x29a200);}else{return getUser(_0x3c7387,null,_0x29a200);}})[_0x9d3c('0x22')](function(_0x2bc85d){_0x225588=_0x2bc85d;return getEndUser(_0x3c7387,_0x2b59f4,_0x2d919f[_0x9d3c('0x79')],_0x2d919f[_0x9d3c('0x63')],_0x29a200);})[_0x9d3c('0x22')](function(_0x3d56e2){_0x33b1d0=_0x3d56e2;return getTicket(_0x3c7387,_0x225588,_0x33b1d0,_0x2b59f4,_0x2d919f,_0x2b59f4['Fields'],_0x29a200);})['then'](function(_0x156ed2){_0x4315e4=_0x156ed2;logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+_0x9d3c('0x7a'),_0x4315e4['id']);logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')]['toUpperCase']()+_0x9d3c('0x7b'),_0x3c7387[_0x9d3c('0x3a')]);})['catch'](function(_0xbf7350){logger[_0x9d3c('0x6c')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+']',_0xbf7350);});}; \ 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 fe24051..d5f36a2 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 _0x1d0f=['type','idField','customField','variable','customVariable','Variable','name','outbound','userId','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','sys_id','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','nameField','toLowerCase','content','toString'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1d0f,0x1d3));var _0xf1d0=function(_0x526889,_0x208f88){_0x526889=_0x526889-0x0;var _0x355eac=_0x1d0f[_0x526889];return _0x355eac;};'use strict';var _=require(_0xf1d0('0x0'));var Promise=require(_0xf1d0('0x1'));var rp=require(_0xf1d0('0x2'));var util=require(_0xf1d0('0x3'));var md5=require(_0xf1d0('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xf1d0('0x5'));var logger=require(_0xf1d0('0x6'))(_0xf1d0('0x7'));config[_0xf1d0('0x8')]=_[_0xf1d0('0x9')](config[_0xf1d0('0x8')],{'host':_0xf1d0('0xa'),'port':0x18eb});var io=require(_0xf1d0('0xb'))(new Redis(config['redis']));function getAdminUser(_0x1a01a8,_0x34b32b,_0x169ecd,_0x4e6034,_0x421a36,_0x3635c4){return new Promise(function(_0x94a29e,_0x4f7fae){var _0x476d91={'method':_0xf1d0('0xc'),'uri':_0x4e6034+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x421a36+'&'+_0x3635c4,'auth':_0x34b32b,'json':!![]};return rp(_0x476d91)[_0xf1d0('0xd')](function(_0x3686d6){if(_0x3686d6[_0xf1d0('0xe')][_0xf1d0('0xf')]>0x0){_0x169ecd[_0xf1d0('0x10')]=_0x3686d6[_0xf1d0('0xe')][0x0]['sys_id'];}logger[_0xf1d0('0x11')]('['+[_0x1a01a8[_0xf1d0('0x12')]()]+_0xf1d0('0x13'),_0x169ecd);_0x94a29e(_0x169ecd);})[_0xf1d0('0x14')](function(_0x5194ae){logger[_0xf1d0('0x15')]('['+[_0x1a01a8[_0xf1d0('0x12')]()]+']',_0x5194ae['message']);_0x4f7fae(_0x5194ae[_0xf1d0('0x16')]);});});}function getUser(_0x1d016e,_0x460a8b,_0x30d20d,_0x4e44ce,_0x19d728){return function(_0x230505){logger[_0xf1d0('0x11')]('['+[_0x1d016e[_0xf1d0('0x12')]()]+_0xf1d0('0x17'),_0x230505);return new Promise(function(_0x182388,_0x345e5f){if(intUtil['validateEmail'](_0x230505[_0xf1d0('0x18')])){var _0x459fd5={'method':_0xf1d0('0xc'),'uri':_0x30d20d+_0xf1d0('0x19')+_0x230505[_0xf1d0('0x18')]+'&'+_0x4e44ce+'&'+_0x19d728,'auth':_0x460a8b,'json':!![]};logger[_0xf1d0('0x11')]('['+[_0x1d016e['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x459fd5);return rp(_0x459fd5)['then'](function(_0x582475){logger['info']('['+[_0x1d016e[_0xf1d0('0x12')]()]+_0xf1d0('0x1a'),_0x582475);if(_0x582475[_0xf1d0('0xe')][_0xf1d0('0xf')]>0x0&&String(_0x582475[_0xf1d0('0xe')][0x0][_0xf1d0('0x1b')])==='true'){_0x230505['userId']=_0x582475[_0xf1d0('0xe')][0x0][_0xf1d0('0x1c')];}else{_0x230505['userId']=_0x230505[_0xf1d0('0x10')];_0x230505[_0xf1d0('0x18')]=_0x230505[_0xf1d0('0x1d')];}logger[_0xf1d0('0x11')]('['+[_0x1d016e['toUpperCase']()]+'],\x20getUser\x20crm',_0x230505);_0x182388(_0x230505);})['catch'](function(_0x485c88){logger[_0xf1d0('0x15')]('['+[_0x1d016e[_0xf1d0('0x12')]()]+']',_0x485c88[_0xf1d0('0x16')]);_0x345e5f(_0x485c88[_0xf1d0('0x16')]);});}else{logger['info']('['+[_0x1d016e[_0xf1d0('0x12')]()]+_0xf1d0('0x1e'));_0x230505['userId']=_0x230505[_0xf1d0('0x10')];_0x230505[_0xf1d0('0x18')]=_0x230505[_0xf1d0('0x1d')];_0x182388(_0x230505);}});};}function createEndUser(_0x22f0e8,_0x21a30d,_0x46c4c9,_0x97a4de,_0x156914){logger[_0xf1d0('0x11')]('['+[_0x22f0e8[_0xf1d0('0x12')]()]+_0xf1d0('0x1f'),_0x46c4c9);return new Promise(function(_0x5f43e8,_0x30970c){var _0x409c0e={'method':_0xf1d0('0x20'),'uri':_0x97a4de+'sys_user?'+_0x156914,'body':{'user_name':_0x46c4c9[_0xf1d0('0x21')],'roles':_0xf1d0('0x22'),'first_name':_0x46c4c9[_0xf1d0('0x21')],'active':_0xf1d0('0x23'),'date_format':'System','phone':_0x46c4c9[_0xf1d0('0x21')]},'auth':_0x21a30d,'json':!![]};return rp(_0x409c0e)['then'](function(_0x2eb644){logger[_0xf1d0('0x11')]('['+[_0x22f0e8['toUpperCase']()]+_0xf1d0('0x24'),_0x2eb644[_0xf1d0('0xe')]);_0x46c4c9[_0xf1d0('0x25')]=_0x2eb644[_0xf1d0('0xe')][_0xf1d0('0x1c')];_0x5f43e8(_0x46c4c9);})[_0xf1d0('0x14')](function(_0x2fa747){logger[_0xf1d0('0x15')]('['+[_0x22f0e8[_0xf1d0('0x12')]()]+']',_0x2fa747[_0xf1d0('0x16')]);_0x30970c(_0x2fa747[_0xf1d0('0x16')]);});});}function getEndUser(_0x27453c,_0x1f6115,_0x1ed26c,_0xcbbcaf,_0xb55b94){return function(_0x22df5c){logger[_0xf1d0('0x11')]('['+[_0x27453c[_0xf1d0('0x12')]()]+_0xf1d0('0x26'),_0x22df5c);return new Promise(function(_0x1fa52e,_0x5eb27f){var _0x53469f={'method':_0xf1d0('0xc'),'uri':_0x1ed26c+_0xf1d0('0x27')+_0x22df5c[_0xf1d0('0x21')]+'&'+_0xcbbcaf+'&'+_0xb55b94,'auth':_0x1f6115,'json':!![]};return rp(_0x53469f)[_0xf1d0('0xd')](function(_0x470236){if(_0x470236[_0xf1d0('0xe')][_0xf1d0('0xf')]>0x0){_0x22df5c['endUserId']=_0x470236[_0xf1d0('0xe')][0x0]['sys_id'];logger['info']('['+[_0x27453c[_0xf1d0('0x12')]()]+_0xf1d0('0x28'),_0x22df5c);_0x1fa52e(_0x22df5c);}else{return createEndUser(_0x27453c,_0x1f6115,_0x22df5c,_0x1ed26c,_0xcbbcaf)[_0xf1d0('0xd')](function(_0x466732){logger['info']('['+[_0x27453c[_0xf1d0('0x12')]()]+_0xf1d0('0x29'),_0x466732);_0x1fa52e(_0x466732);});}})[_0xf1d0('0x14')](function(_0x30cffb){logger['error']('['+[_0x27453c[_0xf1d0('0x12')]()]+']',_0x30cffb[_0xf1d0('0x16')]);_0x5eb27f(_0x30cffb['message']);});});};}function getCustomFields(_0x2a19f7,_0x337291){var _0x50859f={};if(_0x2a19f7[_0xf1d0('0xf')]>0x0){_['forEach'](_0x2a19f7,function(_0xc8c949){if(_[_0xf1d0('0x2a')]([_0xf1d0('0x2b'),'picklist'],_0xc8c949['type'])&&_0xc8c949[_0xf1d0('0x2c')]&&!_0xc8c949['customField']){_0x50859f[_0xc8c949[_0xf1d0('0x2c')][_0xf1d0('0x2d')]()]=_0xc8c949[_0xf1d0('0x2e')][_0xf1d0('0x2f')]();}else if(_[_0xf1d0('0x2a')]([_0xf1d0('0x2b'),'picklist'],_0xc8c949[_0xf1d0('0x30')])&&_0xc8c949[_0xf1d0('0x31')]&&_0xc8c949[_0xf1d0('0x32')]){_0x50859f[_0xc8c949[_0xf1d0('0x31')]['toLowerCase']()]=_0xc8c949[_0xf1d0('0x2e')][_0xf1d0('0x2f')]();}else if(_0xc8c949[_0xf1d0('0x30')]===_0xf1d0('0x33')&&_0xc8c949['variableName']&&_0xc8c949[_0xf1d0('0x31')]&&_0xc8c949[_0xf1d0('0x32')]){_0x50859f[_0xc8c949[_0xf1d0('0x31')][_0xf1d0('0x2d')]()]=_0x337291[_0xc8c949['variableName']]['toString']();}else if(_0xc8c949[_0xf1d0('0x30')]===_0xf1d0('0x34')&&_0xc8c949['Variable']&&_0xc8c949[_0xf1d0('0x35')][_0xf1d0('0x36')]&&_0xc8c949['idField']&&_0xc8c949[_0xf1d0('0x32')]){_0x50859f[_0xc8c949[_0xf1d0('0x31')][_0xf1d0('0x2d')]()]=_0x337291[_0xc8c949['Variable'][_0xf1d0('0x36')][_0xf1d0('0x2d')]()][_0xf1d0('0x2f')]();}});}return _0x50859f;}function getTicket(_0x388000,_0x57ae9c,_0x17fe24,_0x5499bf,_0x46f17d,_0x55ced3){return function(_0x365a17){logger[_0xf1d0('0x11')]('['+[_0x388000[_0xf1d0('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x365a17);return new Promise(function(_0x2c705e,_0x173fa3){var _0x33ca58=_0x388000['toLowerCase']()===_0xf1d0('0x37')?_0x365a17[_0xf1d0('0x38')]:_0x365a17[_0xf1d0('0x25')];var _0x33b1c2={'method':_0xf1d0('0x20'),'uri':_0x17fe24+_0xf1d0('0x39')+'?'+_0x55ced3,'body':Object[_0xf1d0('0x3a')]({},{'active':_0xf1d0('0x23'),'caller_id':_0x33ca58,'assigned_to':_0x365a17[_0xf1d0('0x38')],'short_description':intUtil[_0xf1d0('0x3b')](_0x5499bf[_0xf1d0('0x3c')],_0x46f17d,'\x20'),'description':intUtil[_0xf1d0('0x3b')](_0x5499bf[_0xf1d0('0x3d')],_0x46f17d,'\x0a')},getCustomFields(_0x5499bf[_0xf1d0('0x3e')],_0x46f17d)),'auth':_0x57ae9c,'json':!![]};return rp(_0x33b1c2)[_0xf1d0('0xd')](function(_0x497726){logger[_0xf1d0('0x11')]('['+[_0x388000[_0xf1d0('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x497726['result']);_0x365a17[_0xf1d0('0x3f')]=_0x497726[_0xf1d0('0xe')][_0xf1d0('0x1c')];_0x365a17[_0xf1d0('0x40')]=_0x497726[_0xf1d0('0xe')][_0xf1d0('0x41')];logger[_0xf1d0('0x11')]('['+[_0x388000[_0xf1d0('0x12')]()]+_0xf1d0('0x42'),_0x365a17);_0x2c705e(_0x365a17);})[_0xf1d0('0x14')](function(_0x37bd69){logger['error']('['+[_0x388000['toUpperCase']()]+']',_0x37bd69[_0xf1d0('0x16')]);_0x173fa3(_0x37bd69[_0xf1d0('0x16')]);});});};}function createRemoteTag(_0x9ecc80,_0x52d55f,_0x316776,_0x42e920){return new Promise(function(_0x2f5d77,_0xad5dc4){var _0x1e9baf={'method':_0xf1d0('0x20'),'uri':_0x316776+'label'+'?'+_0x42e920,'body':{'short_description':_0x9ecc80,'global':!![],'active':!![],'name':_0x9ecc80},'auth':_0x52d55f,'json':!![]};return rp(_0x1e9baf)['then'](function(_0x3d8968){var _0x482513=_0x3d8968[_0xf1d0('0xe')][_0xf1d0('0x1c')];_0x2f5d77(_0x482513);});});}function getRemoteTag(_0x43cad0,_0x1337d9,_0xccb779,_0x31a371,_0x1115e7){return new Promise(function(_0x433320,_0x13e0d4){var _0x4e0cb9={'method':_0xf1d0('0xc'),'uri':_0xccb779+'label'+_0xf1d0('0x43')+_0x43cad0+'&'+_0x31a371,'auth':_0x1337d9,'json':!![]};return rp(_0x4e0cb9)['then'](function(_0x618cbe){if(_0x618cbe[_0xf1d0('0xe')]['length']>0x0){var _0x53f4d9=_0x618cbe['result'][0x0][_0xf1d0('0x1c')];_0x433320(_0x53f4d9);}else{return createRemoteTag(_0x43cad0,_0x1337d9,_0xccb779,_0x31a371)[_0xf1d0('0xd')](function(_0xe25a06){_0x433320(_0xe25a06);});}});});}function assignTagToIncident(_0x4194dd,_0x1fb802,_0x299834,_0x141aa7,_0x48a1aa){return new Promise(function(_0x4f5a56,_0x5ab827){var _0x1ffb63={'method':_0xf1d0('0x20'),'uri':_0x299834+'label_entry'+'?'+_0x48a1aa,'body':{'label':_0x4194dd,'table':_0xf1d0('0x39'),'id_type':'Incident','table_key':_0x141aa7['ticketId'],'title':'Incident\x20-\x20'+_0x141aa7['ticketNumber'],'id_display':_0x141aa7[_0xf1d0('0x40')]},'auth':_0x1fb802,'json':!![]};return rp(_0x1ffb63)[_0xf1d0('0xd')](function(_0x5536e2){_0x4f5a56();})[_0xf1d0('0x14')](function(){_0x4f5a56();});});}function manageTags(_0x2bbeaa,_0x16269a,_0x224cd6,_0x145d38,_0x4bc06c,_0x3453db,_0x52fb3c){return new Promise(function(_0x194450,_0x4a08d3){var _0x4fe848=[];_0x16269a[_0xf1d0('0x44')](function(_0x23eaff){_0x4fe848[_0xf1d0('0x45')](getRemoteTag(_0x23eaff,_0x224cd6,_0x145d38,_0x3453db,_0x52fb3c));});return Promise[_0xf1d0('0x46')](_0x4fe848)['then'](function(_0x542c81){if(_0x542c81[_0xf1d0('0xf')]){logger[_0xf1d0('0x11')]('['+[_0x2bbeaa[_0xf1d0('0x12')]()]+_0xf1d0('0x47'),_0x542c81);var _0x26e619=[];_0x542c81[_0xf1d0('0x44')](function(_0x5a3b6d){_0x26e619[_0xf1d0('0x45')](assignTagToIncident(_0x5a3b6d,_0x224cd6,_0x145d38,_0x4bc06c,_0x3453db));});return Promise['all'](_0x26e619)['then'](function(){_0x194450();})['catch'](function(){_0x194450();});}else{_0x194450();}});});}function getTags(_0x40efbb,_0x545109,_0xf9d50a,_0x6adbeb,_0x1a0bfa,_0x4ec24b){return function(_0x4257a7){return new Promise(function(_0x469040,_0x62b4e1){var _0xaafa6f=[];var _0x5a3d3e=_0x6adbeb[_0xf1d0('0x48')];if(_0x5a3d3e&&_0x5a3d3e['length']>0x0){_0xaafa6f=_[_0xf1d0('0x49')](_0x5a3d3e,'name');}if(_0xaafa6f[_0xf1d0('0xf')]>0x0){return manageTags(_0x40efbb,_0xaafa6f,_0x545109,_0xf9d50a,_0x4257a7,_0x1a0bfa,_0x4ec24b)[_0xf1d0('0xd')](function(){_0x469040(_0x4257a7);});}else{_0x469040(_0x4257a7);}});};}function emit(_0x1950b4,_0x46fda6,_0x44725b){var _0x9597df='%26sysparm_record_target%3Dincident'+_0xf1d0('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf1d0('0x4b');var _0x50234b={'uri':_0x1950b4+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x44725b+_0x9597df};io['to'](util[_0xf1d0('0x4c')](_0xf1d0('0x4d'),_0x46fda6))[_0xf1d0('0x4e')](_0xf1d0('0x4f'),_0x50234b);}exports['cs']=function(_0x35e62e,_0x332659,_0x59bbb7,_0x424c40,_0x454b6b,_0x1f40d8,_0x320ce5,_0x107d5d){var _0x50400e={};var _0x428536={'user':_0x1f40d8[_0xf1d0('0x50')],'pass':_0x1f40d8[_0xf1d0('0x51')]};var _0x5de0a9=_0xf1d0('0x52');var _0x2644b4=_0xf1d0('0x53');_0x1f40d8[_0xf1d0('0x54')]=intUtil[_0xf1d0('0x55')](_0x1f40d8['remoteUri']);_0x1f40d8['serverUrl']=intUtil['stripTrailingSlash'](_0x1f40d8[_0xf1d0('0x56')]);var _0x17ce1c=util[_0xf1d0('0x4c')](_0xf1d0('0x57'),_0x1f40d8[_0xf1d0('0x54')]);_0x50400e['userEmail']=!_[_0xf1d0('0x58')](_0x424c40)?_0x424c40['email']:null;_0x50400e[_0xf1d0('0x1d')]=_0x1f40d8[_0xf1d0('0x59')];_0x50400e['endUserNumber']=_0x107d5d[_0xf1d0('0x2d')]()===_0xf1d0('0x37')?_0x332659['destcalleridnum']:_0x332659['calleridnum'];_0x50400e[_0xf1d0('0x5a')]=_0x107d5d===_0xf1d0('0x5b')||_0x107d5d===_0xf1d0('0x5c')?_0xf1d0('0x5b'):'outbound';var _0xcce1a3=util[_0xf1d0('0x4c')](_0xf1d0('0x5d'),_0x1f40d8[_0xf1d0('0x56')],_0x332659[_0xf1d0('0x5e')],md5(_0x332659[_0xf1d0('0x5e')]));if(_0x454b6b&&_0x454b6b[_0xf1d0('0x5f')]){logger[_0xf1d0('0x11')]('[QUEUE]',_0xf1d0('0x60'));_0x332659[_0xf1d0('0x61')]=_0xcce1a3;}else if(_0x320ce5&&_0x320ce5[_0xf1d0('0x62')]&&_0x320ce5[_0xf1d0('0x62')]!==_0xf1d0('0x63')){logger[_0xf1d0('0x11')](_0xf1d0('0x64'),_0xf1d0('0x60'));_0x332659['recordingURL']=_0xcce1a3;}else{_0x332659[_0xf1d0('0x61')]='';}return getAdminUser(_0x107d5d,_0x428536,_0x50400e,_0x17ce1c,_0x2644b4,_0x5de0a9)['then'](getUser(_0x107d5d,_0x428536,_0x17ce1c,_0x2644b4,_0x5de0a9))[_0xf1d0('0xd')](getEndUser(_0x107d5d,_0x428536,_0x17ce1c,_0x2644b4,_0x5de0a9))[_0xf1d0('0xd')](getTicket(_0x107d5d,_0x428536,_0x17ce1c,_0x59bbb7,_0x332659,_0x2644b4))[_0xf1d0('0xd')](function(_0x4e83f9){logger[_0xf1d0('0x11')](util[_0xf1d0('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4e83f9[_0xf1d0('0x3f')]));logger[_0xf1d0('0x11')](util[_0xf1d0('0x4c')](_0xf1d0('0x65'),_0x107d5d));if(_0x107d5d!=='unmanaged'){logger[_0xf1d0('0x11')]('['+[_0x107d5d['toUpperCase']()]+']',_0xf1d0('0x66'));emit(_0x1f40d8[_0xf1d0('0x54')],_0x424c40[_0xf1d0('0x36')],_0x4e83f9[_0xf1d0('0x3f')]);}})[_0xf1d0('0x14')](function(_0x260969){logger[_0xf1d0('0x15')]('['+[_0x107d5d[_0xf1d0('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x260969,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x662e=['nameField','toLowerCase','content','toString','picklist','type','idField','customField','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','userId','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all','push','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','calleridnum','queue','format','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','adminId','],\x20createEndUser\x20input\x20crm','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string'];(function(_0x59fba7,_0x2c340c){var _0x40d69e=function(_0x1a5507){while(--_0x1a5507){_0x59fba7['push'](_0x59fba7['shift']());}};_0x40d69e(++_0x2c340c);}(_0x662e,0x1f2));var _0xe662=function(_0x1b4c66,_0xfdb5d7){_0x1b4c66=_0x1b4c66-0x0;var _0x2883d5=_0x662e[_0x1b4c66];return _0x2883d5;};'use strict';var _=require('lodash');var Promise=require(_0xe662('0x0'));var rp=require(_0xe662('0x1'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xe662('0x2'));var config=require(_0xe662('0x3'));var logger=require(_0xe662('0x4'))(_0xe662('0x5'));config['redis']=_['defaults'](config[_0xe662('0x6')],{'host':_0xe662('0x7'),'port':0x18eb});var io=require(_0xe662('0x8'))(new Redis(config[_0xe662('0x6')]));function getAdminUser(_0x4e3416,_0x520221,_0x47345a,_0x361e15,_0x51d4eb,_0x502617){return new Promise(function(_0x24d14c,_0x4ef245){var _0x2882b9={'method':_0xe662('0x9'),'uri':_0x361e15+_0xe662('0xa')+'&'+_0x51d4eb+'&'+_0x502617,'auth':_0x520221,'json':!![]};return rp(_0x2882b9)[_0xe662('0xb')](function(_0xc6926d){if(_0xc6926d[_0xe662('0xc')]['length']>0x0){_0x47345a['adminId']=_0xc6926d[_0xe662('0xc')][0x0][_0xe662('0xd')];}logger[_0xe662('0xe')]('['+[_0x4e3416['toUpperCase']()]+_0xe662('0xf'),_0x47345a);_0x24d14c(_0x47345a);})[_0xe662('0x10')](function(_0x45198b){logger[_0xe662('0x11')]('['+[_0x4e3416[_0xe662('0x12')]()]+']',_0x45198b[_0xe662('0x13')]);_0x4ef245(_0x45198b[_0xe662('0x13')]);});});}function getUser(_0x4835d6,_0x2a8570,_0x13de32,_0x1f9926,_0x206dbf){return function(_0x1ac67a){logger['info']('['+[_0x4835d6['toUpperCase']()]+_0xe662('0x14'),_0x1ac67a);return new Promise(function(_0x56c866,_0x49312d){if(intUtil[_0xe662('0x15')](_0x1ac67a[_0xe662('0x16')])){var _0x3716c1={'method':'GET','uri':_0x13de32+_0xe662('0x17')+_0x1ac67a[_0xe662('0x16')]+'&'+_0x1f9926+'&'+_0x206dbf,'auth':_0x2a8570,'json':!![]};logger['info']('['+[_0x4835d6[_0xe662('0x12')]()]+_0xe662('0x18'),_0x3716c1);return rp(_0x3716c1)[_0xe662('0xb')](function(_0x51a265){logger[_0xe662('0xe')]('['+[_0x4835d6['toUpperCase']()]+_0xe662('0x19'),_0x51a265);if(_0x51a265['result'][_0xe662('0x1a')]>0x0&&String(_0x51a265[_0xe662('0xc')][0x0][_0xe662('0x1b')])==='true'){_0x1ac67a['userId']=_0x51a265[_0xe662('0xc')][0x0][_0xe662('0xd')];}else{_0x1ac67a['userId']=_0x1ac67a['adminId'];_0x1ac67a['userEmail']=_0x1ac67a['adminEmail'];}logger['info']('['+[_0x4835d6[_0xe662('0x12')]()]+'],\x20getUser\x20crm',_0x1ac67a);_0x56c866(_0x1ac67a);})[_0xe662('0x10')](function(_0x339161){logger['error']('['+[_0x4835d6[_0xe662('0x12')]()]+']',_0x339161[_0xe662('0x13')]);_0x49312d(_0x339161[_0xe662('0x13')]);});}else{logger[_0xe662('0xe')]('['+[_0x4835d6[_0xe662('0x12')]()]+']\x20using\x20admin\x20profile');_0x1ac67a['userId']=_0x1ac67a[_0xe662('0x1c')];_0x1ac67a[_0xe662('0x16')]=_0x1ac67a['adminEmail'];_0x56c866(_0x1ac67a);}});};}function createEndUser(_0x1f240f,_0x262c26,_0x32ffeb,_0xd21b94,_0x5b747c){logger['info']('['+[_0x1f240f[_0xe662('0x12')]()]+_0xe662('0x1d'),_0x32ffeb);return new Promise(function(_0x2e1b22,_0x1c1757){var _0x143bed={'method':'POST','uri':_0xd21b94+'sys_user?'+_0x5b747c,'body':{'user_name':_0x32ffeb[_0xe662('0x1e')],'roles':_0xe662('0x1f'),'first_name':_0x32ffeb[_0xe662('0x1e')],'active':_0xe662('0x20'),'date_format':_0xe662('0x21'),'phone':_0x32ffeb[_0xe662('0x1e')]},'auth':_0x262c26,'json':!![]};return rp(_0x143bed)[_0xe662('0xb')](function(_0x1665df){logger[_0xe662('0xe')]('['+[_0x1f240f['toUpperCase']()]+_0xe662('0x22'),_0x1665df[_0xe662('0xc')]);_0x32ffeb[_0xe662('0x23')]=_0x1665df[_0xe662('0xc')][_0xe662('0xd')];_0x2e1b22(_0x32ffeb);})[_0xe662('0x10')](function(_0x369057){logger[_0xe662('0x11')]('['+[_0x1f240f['toUpperCase']()]+']',_0x369057[_0xe662('0x13')]);_0x1c1757(_0x369057[_0xe662('0x13')]);});});}function getEndUser(_0x234c53,_0x25683f,_0x430834,_0x4256b4,_0x1e4bb7){return function(_0x105c15){logger['info']('['+[_0x234c53['toUpperCase']()]+_0xe662('0x24'),_0x105c15);return new Promise(function(_0x3a86f5,_0x4d3a5b){var _0x57588a={'method':_0xe662('0x9'),'uri':_0x430834+_0xe662('0x25')+_0x105c15[_0xe662('0x1e')]+'&'+_0x4256b4+'&'+_0x1e4bb7,'auth':_0x25683f,'json':!![]};return rp(_0x57588a)['then'](function(_0x13434d){if(_0x13434d['result'][_0xe662('0x1a')]>0x0){_0x105c15[_0xe662('0x23')]=_0x13434d['result'][0x0][_0xe662('0xd')];logger[_0xe662('0xe')]('['+[_0x234c53[_0xe662('0x12')]()]+'],\x20getEndUser\x20crm',_0x105c15);_0x3a86f5(_0x105c15);}else{return createEndUser(_0x234c53,_0x25683f,_0x105c15,_0x430834,_0x4256b4)[_0xe662('0xb')](function(_0x3280fd){logger[_0xe662('0xe')]('['+[_0x234c53[_0xe662('0x12')]()]+_0xe662('0x26'),_0x3280fd);_0x3a86f5(_0x3280fd);});}})[_0xe662('0x10')](function(_0x319b9c){logger[_0xe662('0x11')]('['+[_0x234c53[_0xe662('0x12')]()]+']',_0x319b9c[_0xe662('0x13')]);_0x4d3a5b(_0x319b9c[_0xe662('0x13')]);});});};}function getCustomFields(_0x5aad6f,_0x1bd66c){var _0x53c4b4={};if(_0x5aad6f['length']>0x0){_[_0xe662('0x27')](_0x5aad6f,function(_0x4cb554){if(_[_0xe662('0x28')]([_0xe662('0x29'),'picklist'],_0x4cb554['type'])&&_0x4cb554['nameField']&&!_0x4cb554['customField']){_0x53c4b4[_0x4cb554[_0xe662('0x2a')][_0xe662('0x2b')]()]=_0x4cb554[_0xe662('0x2c')][_0xe662('0x2d')]();}else if(_[_0xe662('0x28')]([_0xe662('0x29'),_0xe662('0x2e')],_0x4cb554[_0xe662('0x2f')])&&_0x4cb554[_0xe662('0x30')]&&_0x4cb554[_0xe662('0x31')]){_0x53c4b4[_0x4cb554['idField'][_0xe662('0x2b')]()]=_0x4cb554['content']['toString']();}else if(_0x4cb554['type']===_0xe662('0x32')&&_0x4cb554[_0xe662('0x33')]&&_0x4cb554['idField']&&_0x4cb554['customField']){_0x53c4b4[_0x4cb554['idField'][_0xe662('0x2b')]()]=_0x1bd66c[_0x4cb554['variableName']][_0xe662('0x2d')]();}else if(_0x4cb554[_0xe662('0x2f')]===_0xe662('0x34')&&_0x4cb554['Variable']&&_0x4cb554['Variable'][_0xe662('0x35')]&&_0x4cb554[_0xe662('0x30')]&&_0x4cb554['customField']){_0x53c4b4[_0x4cb554[_0xe662('0x30')][_0xe662('0x2b')]()]=_0x1bd66c[_0x4cb554[_0xe662('0x36')][_0xe662('0x35')]['toLowerCase']()][_0xe662('0x2d')]();}});}return _0x53c4b4;}function getTicket(_0x219598,_0x403bdc,_0xee5d7e,_0x30fa68,_0x5d73f6,_0x1b67ee){return function(_0x408c27){logger['info']('['+[_0x219598['toUpperCase']()]+_0xe662('0x37'),_0x408c27);return new Promise(function(_0x1c253e,_0x5ece69){var _0x2081a9=_0x219598[_0xe662('0x2b')]()===_0xe662('0x38')?_0x408c27['userId']:_0x408c27[_0xe662('0x23')];var _0x15ae79={'method':_0xe662('0x39'),'uri':_0xee5d7e+_0xe662('0x3a')+'?'+_0x1b67ee,'body':Object['assign']({},{'active':'true','caller_id':_0x2081a9,'assigned_to':_0x408c27[_0xe662('0x3b')],'short_description':intUtil[_0xe662('0x3c')](_0x30fa68['Subjects'],_0x5d73f6,'\x20'),'description':intUtil['getString'](_0x30fa68[_0xe662('0x3d')],_0x5d73f6,'\x0a')},getCustomFields(_0x30fa68[_0xe662('0x3e')],_0x5d73f6)),'auth':_0x403bdc,'json':!![]};return rp(_0x15ae79)[_0xe662('0xb')](function(_0x53ef59){logger[_0xe662('0xe')]('['+[_0x219598[_0xe662('0x12')]()]+_0xe662('0x3f'),_0x53ef59[_0xe662('0xc')]);_0x408c27[_0xe662('0x40')]=_0x53ef59[_0xe662('0xc')][_0xe662('0xd')];_0x408c27[_0xe662('0x41')]=_0x53ef59[_0xe662('0xc')][_0xe662('0x42')];logger[_0xe662('0xe')]('['+[_0x219598[_0xe662('0x12')]()]+']\x20getTicket\x20crm',_0x408c27);_0x1c253e(_0x408c27);})['catch'](function(_0xa12959){logger[_0xe662('0x11')]('['+[_0x219598[_0xe662('0x12')]()]+']',_0xa12959[_0xe662('0x13')]);_0x5ece69(_0xa12959[_0xe662('0x13')]);});});};}function createRemoteTag(_0x23f300,_0x1342a6,_0x540823,_0x52b6fd){return new Promise(function(_0x2f4bf4,_0x2d64db){var _0x3808ae={'method':_0xe662('0x39'),'uri':_0x540823+_0xe662('0x43')+'?'+_0x52b6fd,'body':{'short_description':_0x23f300,'global':!![],'active':!![],'name':_0x23f300},'auth':_0x1342a6,'json':!![]};return rp(_0x3808ae)[_0xe662('0xb')](function(_0x40c148){var _0x1cb4e8=_0x40c148['result'][_0xe662('0xd')];_0x2f4bf4(_0x1cb4e8);});});}function getRemoteTag(_0x3565c8,_0xa71210,_0x5bfafc,_0x1946f7,_0x5cf498){return new Promise(function(_0x4adb03,_0x3647c5){var _0x27c611={'method':_0xe662('0x9'),'uri':_0x5bfafc+_0xe662('0x43')+_0xe662('0x44')+_0x3565c8+'&'+_0x1946f7,'auth':_0xa71210,'json':!![]};return rp(_0x27c611)[_0xe662('0xb')](function(_0x3adb64){if(_0x3adb64['result'][_0xe662('0x1a')]>0x0){var _0x50fdc1=_0x3adb64[_0xe662('0xc')][0x0][_0xe662('0xd')];_0x4adb03(_0x50fdc1);}else{return createRemoteTag(_0x3565c8,_0xa71210,_0x5bfafc,_0x1946f7)[_0xe662('0xb')](function(_0x494b39){_0x4adb03(_0x494b39);});}});});}function assignTagToIncident(_0x38064f,_0x59ca12,_0x71d57d,_0x1086d2,_0x30eab6){return new Promise(function(_0x42fd2d,_0x2c5dbe){var _0x329f10={'method':_0xe662('0x39'),'uri':_0x71d57d+_0xe662('0x45')+'?'+_0x30eab6,'body':{'label':_0x38064f,'table':'incident','id_type':_0xe662('0x46'),'table_key':_0x1086d2[_0xe662('0x40')],'title':_0xe662('0x47')+_0x1086d2['ticketNumber'],'id_display':_0x1086d2[_0xe662('0x41')]},'auth':_0x59ca12,'json':!![]};return rp(_0x329f10)[_0xe662('0xb')](function(_0x4218bc){_0x42fd2d();})['catch'](function(){_0x42fd2d();});});}function manageTags(_0x4b98c8,_0x4a65ba,_0x50205d,_0x4008ad,_0x35d6bf,_0x263c86,_0x52d2b0){return new Promise(function(_0x310458,_0x2c7a50){var _0x1972cf=[];_0x4a65ba[_0xe662('0x27')](function(_0x22eec4){_0x1972cf['push'](getRemoteTag(_0x22eec4,_0x50205d,_0x4008ad,_0x263c86,_0x52d2b0));});return Promise[_0xe662('0x48')](_0x1972cf)['then'](function(_0xbc2a1c){if(_0xbc2a1c[_0xe662('0x1a')]){logger[_0xe662('0xe')]('['+[_0x4b98c8[_0xe662('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xbc2a1c);var _0x5a3a95=[];_0xbc2a1c[_0xe662('0x27')](function(_0x3937f2){_0x5a3a95[_0xe662('0x49')](assignTagToIncident(_0x3937f2,_0x50205d,_0x4008ad,_0x35d6bf,_0x263c86));});return Promise[_0xe662('0x48')](_0x5a3a95)[_0xe662('0xb')](function(){_0x310458();})[_0xe662('0x10')](function(){_0x310458();});}else{_0x310458();}});});}function getTags(_0x3b84f9,_0x1b0ebd,_0x3b5a62,_0x424dfa,_0x126237,_0x113618){return function(_0x3262db){return new Promise(function(_0x21987a,_0x278a16){var _0x1e8b2c=[];var _0x5a784d=_0x424dfa['Tags'];if(_0x5a784d&&_0x5a784d[_0xe662('0x1a')]>0x0){_0x1e8b2c=_[_0xe662('0x4a')](_0x5a784d,_0xe662('0x35'));}if(_0x1e8b2c[_0xe662('0x1a')]>0x0){return manageTags(_0x3b84f9,_0x1e8b2c,_0x1b0ebd,_0x3b5a62,_0x3262db,_0x126237,_0x113618)[_0xe662('0xb')](function(){_0x21987a(_0x3262db);});}else{_0x21987a(_0x3262db);}});};}function emit(_0x3a205c,_0x29c34e,_0x30ef8d){var _0x9fa6c9=_0xe662('0x4b')+_0xe662('0x4c')+_0xe662('0x4d')+'%255EORDERBYDESCnumber';var _0x1b4785={'uri':_0x3a205c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x30ef8d+_0x9fa6c9};io['to'](util['format'](_0xe662('0x4e'),_0x29c34e))[_0xe662('0x4f')](_0xe662('0x50'),_0x1b4785);}exports['cs']=function(_0x499719,_0x10313f,_0x5a7ab9,_0x161a62,_0x23da2a,_0x3803bb,_0x81410e,_0x2328d2){var _0x2ca598={};var _0x294f59={'user':_0x3803bb[_0xe662('0x51')],'pass':_0x3803bb[_0xe662('0x52')]};var _0x49547c=_0xe662('0x53');var _0x194f4d=_0xe662('0x54');_0x3803bb['remoteUri']=intUtil[_0xe662('0x55')](_0x3803bb[_0xe662('0x56')]);_0x3803bb[_0xe662('0x57')]=intUtil[_0xe662('0x55')](_0x3803bb['serverUrl']);var _0x3d0f45=util['format'](_0xe662('0x58'),_0x3803bb[_0xe662('0x56')]);_0x2ca598['userEmail']=!_[_0xe662('0x59')](_0x161a62)?_0x161a62[_0xe662('0x5a')]:null;_0x2ca598[_0xe662('0x5b')]=_0x3803bb['email'];_0x2ca598[_0xe662('0x1e')]=_0x2328d2[_0xe662('0x2b')]()==='outbound'?_0x10313f[_0xe662('0x5c')]:_0x10313f[_0xe662('0x5d')];_0x2ca598['callDirection']=_0x2328d2===_0xe662('0x5e')||_0x2328d2==='unmanaged'?_0xe662('0x5e'):_0xe662('0x38');var _0x53c91b=util[_0xe662('0x5f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3803bb['serverUrl'],_0x10313f[_0xe662('0x60')],md5(_0x10313f[_0xe662('0x60')]));if(_0x23da2a&&_0x23da2a[_0xe662('0x61')]){logger[_0xe662('0xe')](_0xe662('0x62'),'Recording\x20is\x20enabled!');_0x10313f[_0xe662('0x63')]=_0x53c91b;}else if(_0x81410e&&_0x81410e['recordingFormat']&&_0x81410e[_0xe662('0x64')]!==_0xe662('0x65')){logger['info'](_0xe662('0x66'),_0xe662('0x67'));_0x10313f[_0xe662('0x63')]=_0x53c91b;}else{_0x10313f[_0xe662('0x63')]='';}return getAdminUser(_0x2328d2,_0x294f59,_0x2ca598,_0x3d0f45,_0x194f4d,_0x49547c)[_0xe662('0xb')](getUser(_0x2328d2,_0x294f59,_0x3d0f45,_0x194f4d,_0x49547c))[_0xe662('0xb')](getEndUser(_0x2328d2,_0x294f59,_0x3d0f45,_0x194f4d,_0x49547c))['then'](getTicket(_0x2328d2,_0x294f59,_0x3d0f45,_0x5a7ab9,_0x10313f,_0x194f4d))['then'](function(_0x1d9626){logger['info'](util[_0xe662('0x5f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1d9626[_0xe662('0x40')]));logger[_0xe662('0xe')](util[_0xe662('0x5f')](_0xe662('0x68'),_0x2328d2));if(_0x2328d2!==_0xe662('0x69')){logger[_0xe662('0xe')]('['+[_0x2328d2[_0xe662('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3803bb['remoteUri'],_0x161a62[_0xe662('0x35')],_0x1d9626[_0xe662('0x40')]);}})[_0xe662('0x10')](function(_0x4466f6){logger[_0xe662('0x11')]('['+[_0x2328d2[_0xe662('0x12')]()]+_0xe662('0x6a'),util[_0xe662('0x6b')](_0x4466f6,{'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 30ada44..2c4aa7d 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 _0x7e39=['calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','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','user:%s','trigger:browser:url','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','charAt','[OUTBOUND]','error','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','catch','lodash','request-promise','md5','ioredis','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','find','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','customField','toLowerCase','content','type','custom_fields','push','variable','customVariable','Variable','POST','login','username','password','PLAIN','sessionID','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname'];(function(_0x4153f4,_0x490d44){var _0x520c3d=function(_0x4363f8){while(--_0x4363f8){_0x4153f4['push'](_0x4153f4['shift']());}};_0x520c3d(++_0x490d44);}(_0x7e39,0x10a));var _0x97e3=function(_0x7388c4,_0x38cd6a){_0x7388c4=_0x7388c4-0x0;var _0x30cc85=_0x7e39[_0x7388c4];return _0x30cc85;};'use strict';var _=require(_0x97e3('0x0'));var rp=require(_0x97e3('0x1'));var BPromise=require('bluebird');var md5=require(_0x97e3('0x2'));var util=require('util');var Redis=require(_0x97e3('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x97e3('0x4'))(_0x97e3('0x5'));config[_0x97e3('0x6')]=_[_0x97e3('0x7')](config[_0x97e3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x97e3('0x8'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x5629a0,_0x179c7d,_0x2bb566){io['to'](_0x5629a0)['emit'](_0x179c7d,_0x2bb566);}function getTicket(_0x5610fb,_0x346fbb,_0x12e357,_0x2b7855,_0x1a2f7d,_0x5cc35c,_0x5c8ac7,_0x5e15bf){logger[_0x97e3('0x9')](_0x97e3('0xa'));var _0x4076b7=new Date();var _0x329efd=[{'name':_0x97e3('0xb'),'value':intUtil[_0x97e3('0xc')](_0x2b7855[_0x97e3('0xd')],_0x1a2f7d,'\x20')},{'name':_0x97e3('0xe'),'value':_0x346fbb['id']},{'name':'created_by','value':_0x346fbb['id']},{'name':'description','value':intUtil[_0x97e3('0xc')](_0x2b7855[_0x97e3('0xf')],_0x1a2f7d,'\x0a')},{'name':_0x97e3('0x10'),'value':_0x4076b7[_0x97e3('0x11')]()[_0x97e3('0x12')](0x0,0x13)[_0x97e3('0x13')]('T','\x20')},{'name':_0x97e3('0x14'),'value':'0'},{'name':_0x97e3('0x15'),'value':'15'},{'name':_0x97e3('0x16'),'value':_0x12e357['id']},{'name':_0x97e3('0x17'),'value':'Contacts'},{'name':_0x97e3('0x18'),'value':_0x12e357[_0x97e3('0xb')]},{'name':_0x97e3('0x19'),'value':_0x5e15bf}];if(_0x5cc35c[_0x97e3('0x1a')]){_[_0x97e3('0x1b')](_0x5cc35c,function(_0x1174ca){if(_0x1a2f7d[_0x1174ca[_0x97e3('0x1c')]]){_0x329efd['push']({'name':_0x1174ca[_0x97e3('0x1d')],'value':_0x1a2f7d[_0x1174ca[_0x97e3('0x1c')]]});}});}return request({'form':{'method':_0x97e3('0x1e'),'input_type':_0x97e3('0x1f'),'response_type':'JSON','rest_data':JSON[_0x97e3('0x20')]({'session':_0x5c8ac7['id'],'module_name':_0x97e3('0x21'),'name_value_list':_0x329efd})}});}function getAuth(_0x4deed3){return util[_0x97e3('0x22')](_0x97e3('0x23'),new Buffer(_0x4deed3[_0x97e3('0x24')]+':X')[_0x97e3('0x25')]('base64'));}function getServerInfo(_0x1e1de6){return request({'form':{'method':_0x97e3('0x26'),'input_type':_0x97e3('0x1f'),'response_type':'JSON','rest_data':JSON[_0x97e3('0x20')]({'session':_0x1e1de6['id']})}});}function getUser(_0x517448,_0x24ec9b,_0x34f341){if(!_[_0x97e3('0x27')](_0x24ec9b)){logger[_0x97e3('0x9')](_0x97e3('0x28'),_0x24ec9b);return request({'form':{'method':_0x97e3('0x29'),'input_type':_0x97e3('0x1f'),'response_type':_0x97e3('0x1f'),'rest_data':JSON[_0x97e3('0x20')]({'session':_0x34f341['id'],'module_name':_0x97e3('0x2a'),'query':util['format'](_0x97e3('0x2b'),_0x24ec9b),'order_by':'','offset':'0','select_fields':['id',_0x97e3('0xb'),_0x97e3('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x97e3('0x2d')](function(_0x42c5fc){if(_0x42c5fc[_0x97e3('0x2e')]['length']){var _0x4df5fe=_['find'](_0x42c5fc[_0x97e3('0x2e')],function(_0x4c70f6){return _0x4c70f6['name_value_list'][_0x97e3('0x2c')][_0x97e3('0x2f')]===_0x24ec9b;});if(_0x4df5fe){logger[_0x97e3('0x9')](_0x97e3('0x30'));return BPromise[_0x97e3('0x31')]({'id':_0x4df5fe[_0x97e3('0x32')]['id'][_0x97e3('0x2f')],'name':_0x4df5fe[_0x97e3('0x32')]['name'][_0x97e3('0x2f')]});}}logger[_0x97e3('0x9')](_0x97e3('0x33'));return BPromise[_0x97e3('0x31')]({'id':_0x34f341['name_value_list'][_0x97e3('0x34')]['value'],'name':_0x34f341[_0x97e3('0x32')][_0x97e3('0x2c')]['value']});});}else{logger[_0x97e3('0x9')](_0x97e3('0x35'));return BPromise[_0x97e3('0x31')]({'id':_0x34f341['name_value_list'][_0x97e3('0x34')][_0x97e3('0x2f')],'name':_0x34f341[_0x97e3('0x32')][_0x97e3('0x2c')][_0x97e3('0x2f')]});}}function getEndUser(_0x5313d4,_0x5103ea,_0x198f46,_0xbcfaab){logger[_0x97e3('0x9')]('Searching\x20enduser\x20with\x20phone',_0x198f46);return request({'form':{'method':_0x97e3('0x29'),'input_type':_0x97e3('0x1f'),'response_type':_0x97e3('0x1f'),'rest_data':JSON['stringify']({'session':_0xbcfaab['id'],'module_name':_0x97e3('0x36'),'query':util[_0x97e3('0x22')](_0x97e3('0x37'),_0x198f46),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x97e3('0x2d')](function(_0x5e4e61){if(_0x5e4e61[_0x97e3('0x2e')][_0x97e3('0x1a')]){var _0x13f900=_[_0x97e3('0x38')](_0x5e4e61[_0x97e3('0x2e')],function(_0x1a73b2){return _0x1a73b2[_0x97e3('0x32')]['phone_home'][_0x97e3('0x2f')]===_0x198f46;});if(_0x13f900){logger['info'](_0x97e3('0x39'));return BPromise['resolve']({'id':_0x13f900[_0x97e3('0x32')]['id'][_0x97e3('0x2f')],'name':_0x13f900[_0x97e3('0x32')]['name'][_0x97e3('0x2f')],'phone':_0x13f900[_0x97e3('0x32')]['phone_home'][_0x97e3('0x2f')]});}}else{logger[_0x97e3('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x97e3('0x1f'),'rest_data':JSON[_0x97e3('0x20')]({'session':_0xbcfaab['id'],'module_name':_0x97e3('0x36'),'name_value_list':[{'name':_0x97e3('0x3a'),'value':_0x5103ea!==_0x97e3('0x3b')?_0x5103ea:util['format'](_0x97e3('0x3c'),_0x198f46)},{'name':'phone_home','value':_0x198f46}]})}})[_0x97e3('0x2d')](function(_0x7b785e){logger[_0x97e3('0x9')](_0x97e3('0x3d'));return BPromise[_0x97e3('0x31')]({'id':_0x7b785e['id'],'name':_0x7b785e[_0x97e3('0x2e')][_0x97e3('0x3a')][_0x97e3('0x2f')],'phone':_0x7b785e[_0x97e3('0x2e')]['phone_home'][_0x97e3('0x2f')]});});}});}function request(_0x19a824){logger[_0x97e3('0x3e')]('[HTTP]',JSON[_0x97e3('0x20')](_0x19a824));return rp(_[_0x97e3('0x3f')](def,_0x19a824));}function getTags(_0x1741ef,_0x17e71d){var _0x34a1fc=[];if(_0x1741ef&&_0x1741ef['length']>0x0){_0x34a1fc=_[_0x97e3('0x40')](_0x1741ef,_0x17e71d);}return _0x34a1fc;}function getCustomFields(_0x378bc1,_0x44a887){var _0x155af6=[];var _0xe195d2={'custom_fields':[]};if(_0x378bc1[_0x97e3('0x1a')]>0x0){_[_0x97e3('0x1b')](_0x378bc1,function(_0x1ca8c2){if(_0x1ca8c2['type']===_0x97e3('0x41')&&_0x1ca8c2['nameField']&&!_0x1ca8c2[_0x97e3('0x42')]){_0xe195d2[_0x1ca8c2['nameField'][_0x97e3('0x43')]()]=_0x1ca8c2[_0x97e3('0x44')][_0x97e3('0x25')]();}else if(_0x1ca8c2[_0x97e3('0x45')]==='string'&&_0x1ca8c2['idField']&&_0x1ca8c2['customField']){_0xe195d2[_0x97e3('0x46')][_0x97e3('0x47')]({'id':_0x1ca8c2[_0x97e3('0x1d')],'value':_0x1ca8c2[_0x97e3('0x44')][_0x97e3('0x25')]()});}else if(_0x1ca8c2[_0x97e3('0x45')]===_0x97e3('0x48')&&_0x1ca8c2[_0x97e3('0x1c')]&&_0x1ca8c2[_0x97e3('0x1d')]&&_0x1ca8c2['customField']){_0x44a887[_0x1ca8c2['variableName']]&&_0xe195d2[_0x97e3('0x46')][_0x97e3('0x47')]({'id':_0x1ca8c2[_0x97e3('0x1d')],'value':_0x44a887[_0x1ca8c2[_0x97e3('0x1c')]]['toString']()});}else if(_0x1ca8c2[_0x97e3('0x45')]===_0x97e3('0x49')&&_0x1ca8c2['Variable']&&_0x1ca8c2[_0x97e3('0x4a')][_0x97e3('0xb')]&&_0x1ca8c2[_0x97e3('0x1d')]&&_0x1ca8c2[_0x97e3('0x42')]){_0x44a887[_0x1ca8c2[_0x97e3('0x4a')]['name'][_0x97e3('0x43')]()]&&_0xe195d2['custom_fields'][_0x97e3('0x47')]({'id':_0x1ca8c2['idField'],'value':_0x44a887[_0x1ca8c2[_0x97e3('0x4a')]['name'][_0x97e3('0x43')]()][_0x97e3('0x25')]()});}});}return _0xe195d2;}function getConnection(_0x138fa1){return request({'method':_0x97e3('0x4b'),'form':{'method':_0x97e3('0x4c'),'input_type':_0x97e3('0x1f'),'response_type':_0x97e3('0x1f'),'rest_data':JSON[_0x97e3('0x20')]({'user_auth':{'user_name':_0x138fa1[_0x97e3('0x4d')],'password':_0x138fa1[_0x97e3('0x4e')],'encryption':_0x97e3('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x97e3('0x2d')](function(_0x559613){var _0x4bf65c=_0x559613;if(_0x4bf65c['id']){def[_0x97e3('0x50')]=_0x4bf65c['id'];return BPromise[_0x97e3('0x31')](_0x4bf65c);}else{throw new Error(util[_0x97e3('0x22')]('Account\x20%d\x20is\x20not\x20valid',_0x138fa1['id']));}});}function setRelationship(_0x1b6369,_0x4f5df9,_0x5b31a1,_0x89e105){return request({'form':{'method':'set_relationship','input_type':_0x97e3('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1b6369['id'],'module_name':_0x97e3('0x21'),'module_id':_0x5b31a1['id'],'link_field_name':_0x89e105,'related_ids':[_0x4f5df9['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x97e3('0x51')]=function(_0x4145d9,_0x233861,_0x43ae56,_0x5d236,_0x4071dc,_0x4727ae){var _0x3ea553,_0x55fb92,_0x17f79f,_0x58f34c;_0x4727ae['remoteUri']=intUtil[_0x97e3('0x52')](_0x4727ae[_0x97e3('0x53')]);_0x4727ae[_0x97e3('0x54')]=intUtil['stripTrailingSlash'](_0x4727ae[_0x97e3('0x54')]);def[_0x97e3('0x55')]=util[_0x97e3('0x22')](_0x97e3('0x56'),_0x4727ae['remoteUri']);if(_0x4071dc&&_0x4071dc[_0x97e3('0x57')]){logger[_0x97e3('0x9')](_0x97e3('0x58'),_0x97e3('0x59'));_0x233861[_0x97e3('0x5a')]=util['format'](_0x97e3('0x5b'),_0x4727ae['serverUrl'],_0x233861[_0x97e3('0x5c')],md5(_0x233861[_0x97e3('0x5c')]));}else{_0x233861[_0x97e3('0x5a')]='';}return getConnection(_0x4727ae)['then'](function(_0x5397b4){_0x58f34c=_0x5397b4;return getUser(_0x4727ae,_0x5d236[_0x97e3('0xb')],_0x58f34c);})[_0x97e3('0x2d')](function(_0x185e1f){_0x3ea553=_0x185e1f;logger[_0x97e3('0x9')]('The\x20User\x20ID\x20is:',_0x3ea553['id']);return getEndUser(_0x4727ae,_0x233861[_0x97e3('0x5d')],_0x233861[_0x97e3('0x5e')],_0x58f34c);})[_0x97e3('0x2d')](function(_0x617a5){_0x55fb92=_0x617a5;logger['info'](_0x97e3('0x5f'),_0x55fb92['id']);return getTicket(_0x4727ae,_0x3ea553,_0x55fb92,_0x43ae56,_0x233861,_0x43ae56[_0x97e3('0x60')],_0x58f34c,_0x97e3('0x61'));})[_0x97e3('0x2d')](function(_0x381d9c){_0x17f79f=_0x381d9c;logger[_0x97e3('0x9')](_0x97e3('0x62'));logger[_0x97e3('0x9')]('The\x20Ticket\x20ID\x20is:',_0x17f79f['id']);return setRelationship(_0x58f34c,_0x3ea553,_0x17f79f,_0x97e3('0x63'));})[_0x97e3('0x2d')](function(){return setRelationship(_0x58f34c,_0x55fb92,_0x17f79f,_0x97e3('0x64'));})[_0x97e3('0x2d')](function(){return getServerInfo(_0x58f34c);})[_0x97e3('0x2d')](function(_0x3fe0e7){var _0x3feb12=parseInt(_0x3fe0e7[_0x97e3('0x65')]['charAt'](0x0));var _0x449fb6=util[_0x97e3('0x22')](_0x97e3('0x66'),_0x4727ae[_0x97e3('0x53')],_0x17f79f['id']);if(_0x3feb12>0x6){_0x449fb6=util[_0x97e3('0x22')](_0x97e3('0x67'),_0x4727ae['remoteUri'],_0x17f79f['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x97e3('0x68'),_0x5d236[_0x97e3('0xb')]),_0x97e3('0x69'),{'uri':_0x449fb6});})['catch'](function(_0x30bcd7){logger['error'](_0x97e3('0x58'),JSON[_0x97e3('0x20')](_0x30bcd7));});};exports[_0x97e3('0x6a')]=function(_0x3f851e,_0x5405c3,_0x31961f,_0x24cd98,_0x9e3a1,_0x2c9911,_0x27427d){var _0x198713,_0x18a9da,_0x115008,_0x3c45a7;_0x2c9911['remoteUri']=intUtil[_0x97e3('0x52')](_0x2c9911['remoteUri']);_0x2c9911[_0x97e3('0x54')]=intUtil['stripTrailingSlash'](_0x2c9911['serverUrl']);def[_0x97e3('0x55')]=util[_0x97e3('0x22')](_0x97e3('0x56'),_0x2c9911[_0x97e3('0x53')]);if(_0x27427d&&_0x27427d[_0x97e3('0x6b')]&&_0x27427d[_0x97e3('0x6b')]!==_0x97e3('0x6c')){logger[_0x97e3('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5405c3['recordingURL']=util[_0x97e3('0x22')](_0x97e3('0x5b'),_0x2c9911[_0x97e3('0x54')],_0x5405c3[_0x97e3('0x5c')],md5(_0x5405c3[_0x97e3('0x5c')]));}return getConnection(_0x2c9911)[_0x97e3('0x2d')](function(_0x6c33f8){_0x3c45a7=_0x6c33f8;return getUser(_0x2c9911,_0x24cd98['name'],_0x3c45a7);})['then'](function(_0x1101ac){_0x198713=_0x1101ac;logger['info']('The\x20User\x20ID\x20is:',_0x198713['id']);return getEndUser(_0x2c9911,_0x5405c3[_0x97e3('0x6d')],_0x5405c3[_0x97e3('0x6e')],_0x3c45a7);})[_0x97e3('0x2d')](function(_0x15782b){_0x18a9da=_0x15782b;logger[_0x97e3('0x9')](_0x97e3('0x5f'),_0x18a9da['id']);return getTicket(_0x2c9911,_0x198713,_0x18a9da,_0x31961f,_0x5405c3,_0x31961f[_0x97e3('0x60')],_0x3c45a7,_0x97e3('0x6f'));})[_0x97e3('0x2d')](function(_0x47f36f){_0x115008=_0x47f36f;logger[_0x97e3('0x9')](_0x97e3('0x62'));logger[_0x97e3('0x9')](_0x97e3('0x70'),_0x115008['id']);return setRelationship(_0x3c45a7,_0x198713,_0x115008,'users');})[_0x97e3('0x2d')](function(){return setRelationship(_0x3c45a7,_0x18a9da,_0x115008,_0x97e3('0x64'));})[_0x97e3('0x2d')](function(){return getServerInfo(_0x3c45a7);})[_0x97e3('0x2d')](function(_0x8f5df5){var _0x4514f3=parseInt(_0x8f5df5['version'][_0x97e3('0x71')](0x0));var _0x5b1170=util[_0x97e3('0x22')](_0x97e3('0x66'),_0x2c9911[_0x97e3('0x53')],_0x115008['id']);if(_0x4514f3>0x6){_0x5b1170=util[_0x97e3('0x22')](_0x97e3('0x67'),_0x2c9911[_0x97e3('0x53')],_0x115008['id']);}logger['info'](_0x97e3('0x72'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x24cd98['name']),_0x97e3('0x69'),{'uri':_0x5b1170});})['catch'](function(_0x4cc629){logger[_0x97e3('0x73')](_0x97e3('0x72'),JSON['stringify'](_0x4cc629));});};exports[_0x97e3('0x74')]=function(_0x1d458f,_0x3c79b8,_0x4ba050,_0x4cfad7,_0x52ecbe,_0x2ed412){var _0x590bcb,_0x54d45c,_0x28c526,_0x55abf7;_0x2ed412[_0x97e3('0x53')]=intUtil['stripTrailingSlash'](_0x2ed412[_0x97e3('0x53')]);_0x2ed412[_0x97e3('0x54')]=intUtil[_0x97e3('0x52')](_0x2ed412[_0x97e3('0x54')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x2ed412[_0x97e3('0x53')]);if(_0x52ecbe&&_0x52ecbe['monitor_format']){logger[_0x97e3('0x9')]('['+_0x3c79b8['lastevent'][_0x97e3('0x75')]()+']',_0x97e3('0x59'));_0x3c79b8[_0x97e3('0x5a')]=util[_0x97e3('0x22')](_0x97e3('0x5b'),_0x2ed412[_0x97e3('0x54')],_0x3c79b8[_0x97e3('0x5c')],md5(_0x3c79b8[_0x97e3('0x5c')]));}else{_0x3c79b8[_0x97e3('0x5a')]='';}return getConnection(_0x2ed412)[_0x97e3('0x2d')](function(_0x39a6cc){_0x55abf7=_0x39a6cc;if(!_[_0x97e3('0x27')](_0x4cfad7)){return getUser(_0x2ed412,_0x4cfad7[_0x97e3('0xb')],_0x55abf7);}else{return getUser(_0x2ed412,null,_0x55abf7);}})[_0x97e3('0x2d')](function(_0x28041e){_0x590bcb=_0x28041e;logger['info'](_0x97e3('0x76'),_0x590bcb['id']);return getEndUser(_0x2ed412,_0x3c79b8['calleridname'],_0x3c79b8[_0x97e3('0x5e')],_0x55abf7);})['then'](function(_0x3d9eb3){_0x54d45c=_0x3d9eb3;logger[_0x97e3('0x9')](_0x97e3('0x5f'),_0x54d45c['id']);return getTicket(_0x2ed412,_0x590bcb,_0x54d45c,_0x4ba050,_0x3c79b8,_0x4ba050[_0x97e3('0x60')],_0x55abf7,_0x97e3('0x61'));})[_0x97e3('0x2d')](function(_0x395a7f){_0x28c526=_0x395a7f;logger[_0x97e3('0x9')](_0x97e3('0x62'));logger[_0x97e3('0x9')]('The\x20Ticket\x20ID\x20is:',_0x28c526['id']);return setRelationship(_0x55abf7,_0x590bcb,_0x28c526,_0x97e3('0x63'));})[_0x97e3('0x2d')](function(){return setRelationship(_0x55abf7,_0x54d45c,_0x28c526,_0x97e3('0x64'));})[_0x97e3('0x2d')](function(){return getServerInfo(_0x55abf7);})[_0x97e3('0x77')](function(_0xe8bc7){logger[_0x97e3('0x73')]('['+_0x3c79b8['lastevent']['toUpperCase']()+']',JSON[_0x97e3('0x20')](_0xe8bc7));});}; \ No newline at end of file +var _0x3c23=['get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','format','Basic\x20%s','apiKey','toString'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x3c23,0xd2));var _0x33c2=function(_0x222cff,_0x493c92){_0x222cff=_0x222cff-0x0;var _0x5c931b=_0x3c23[_0x222cff];return _0x5c931b;};'use strict';var _=require(_0x33c2('0x0'));var rp=require(_0x33c2('0x1'));var BPromise=require(_0x33c2('0x2'));var md5=require(_0x33c2('0x3'));var util=require(_0x33c2('0x4'));var Redis=require(_0x33c2('0x5'));var intUtil=require(_0x33c2('0x6'));var config=require(_0x33c2('0x7'));var logger=require(_0x33c2('0x8'))(_0x33c2('0x9'));config['redis']=_['defaults'](config[_0x33c2('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x33c2('0xb'))(new Redis(config[_0x33c2('0xa')]));var def={'method':_0x33c2('0xc'),'json':!![]};function emit(_0x264ac7,_0x32df62,_0x1870a5){io['to'](_0x264ac7)[_0x33c2('0xd')](_0x32df62,_0x1870a5);}function getTicket(_0x3aa743,_0x4e60f0,_0x5a3fc9,_0xaf12e3,_0x570fd7,_0x582c62,_0x3f481e,_0x3986f1){logger[_0x33c2('0xe')](_0x33c2('0xf'));var _0x5de381=new Date();var _0x2fb2af=[{'name':_0x33c2('0x10'),'value':intUtil[_0x33c2('0x11')](_0xaf12e3[_0x33c2('0x12')],_0x570fd7,'\x20')},{'name':_0x33c2('0x13'),'value':_0x4e60f0['id']},{'name':_0x33c2('0x14'),'value':_0x4e60f0['id']},{'name':_0x33c2('0x15'),'value':intUtil['getString'](_0xaf12e3[_0x33c2('0x16')],_0x570fd7,'\x0a')},{'name':_0x33c2('0x17'),'value':_0x5de381[_0x33c2('0x18')]()[_0x33c2('0x19')](0x0,0x13)[_0x33c2('0x1a')]('T','\x20')},{'name':_0x33c2('0x1b'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x33c2('0x1c'),'value':_0x5a3fc9['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x33c2('0x1d'),'value':_0x5a3fc9[_0x33c2('0x10')]},{'name':_0x33c2('0x1e'),'value':_0x3986f1}];if(_0x582c62[_0x33c2('0x1f')]){_[_0x33c2('0x20')](_0x582c62,function(_0x8a1e90){if(_0x570fd7[_0x8a1e90[_0x33c2('0x21')]]){_0x2fb2af[_0x33c2('0x22')]({'name':_0x8a1e90[_0x33c2('0x23')],'value':_0x570fd7[_0x8a1e90[_0x33c2('0x21')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON[_0x33c2('0x25')]({'session':_0x3f481e['id'],'module_name':'Calls','name_value_list':_0x2fb2af})}});}function getAuth(_0xbc043a){return util[_0x33c2('0x26')](_0x33c2('0x27'),new Buffer(_0xbc043a[_0x33c2('0x28')]+':X')[_0x33c2('0x29')]('base64'));}function getServerInfo(_0x595b6b){return request({'form':{'method':_0x33c2('0x2a'),'input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON['stringify']({'session':_0x595b6b['id']})}});}function getUser(_0x1e33dc,_0x161c1f,_0x59ba32){if(!_[_0x33c2('0x2b')](_0x161c1f)){logger['info'](_0x33c2('0x2c'),_0x161c1f);return request({'form':{'method':_0x33c2('0x2d'),'input_type':_0x33c2('0x24'),'response_type':'JSON','rest_data':JSON[_0x33c2('0x25')]({'session':_0x59ba32['id'],'module_name':_0x33c2('0x2e'),'query':util[_0x33c2('0x26')](_0x33c2('0x2f'),_0x161c1f),'order_by':'','offset':'0','select_fields':['id',_0x33c2('0x10'),_0x33c2('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33c2('0x31')](function(_0x2e5402){if(_0x2e5402[_0x33c2('0x32')][_0x33c2('0x1f')]){var _0x27983f=_[_0x33c2('0x33')](_0x2e5402[_0x33c2('0x32')],function(_0x23e0f3){return _0x23e0f3[_0x33c2('0x34')][_0x33c2('0x30')]['value']===_0x161c1f;});if(_0x27983f){logger[_0x33c2('0xe')]('Agent\x20found!');return BPromise[_0x33c2('0x35')]({'id':_0x27983f[_0x33c2('0x34')]['id'][_0x33c2('0x36')],'name':_0x27983f[_0x33c2('0x34')]['name'][_0x33c2('0x36')]});}}logger[_0x33c2('0xe')](_0x33c2('0x37'));return BPromise[_0x33c2('0x35')]({'id':_0x59ba32[_0x33c2('0x34')]['user_id'][_0x33c2('0x36')],'name':_0x59ba32[_0x33c2('0x34')][_0x33c2('0x30')][_0x33c2('0x36')]});});}else{logger[_0x33c2('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x59ba32[_0x33c2('0x34')]['user_id']['value'],'name':_0x59ba32[_0x33c2('0x34')][_0x33c2('0x30')][_0x33c2('0x36')]});}}function getEndUser(_0x4d8161,_0x43a9c5,_0x3ca1ab,_0x28ea58){logger[_0x33c2('0xe')](_0x33c2('0x38'),_0x3ca1ab);return request({'form':{'method':_0x33c2('0x2d'),'input_type':_0x33c2('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x28ea58['id'],'module_name':_0x33c2('0x39'),'query':util['format'](_0x33c2('0x3a'),_0x3ca1ab),'order_by':'','offset':'0','select_fields':['id',_0x33c2('0x10'),_0x33c2('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x169566){if(_0x169566[_0x33c2('0x32')][_0x33c2('0x1f')]){var _0xdb62fc=_[_0x33c2('0x33')](_0x169566[_0x33c2('0x32')],function(_0xc6a102){return _0xc6a102[_0x33c2('0x34')]['phone_home'][_0x33c2('0x36')]===_0x3ca1ab;});if(_0xdb62fc){logger[_0x33c2('0xe')](_0x33c2('0x3c'));return BPromise[_0x33c2('0x35')]({'id':_0xdb62fc[_0x33c2('0x34')]['id'][_0x33c2('0x36')],'name':_0xdb62fc[_0x33c2('0x34')][_0x33c2('0x10')][_0x33c2('0x36')],'phone':_0xdb62fc['name_value_list'][_0x33c2('0x3b')][_0x33c2('0x36')]});}}else{logger[_0x33c2('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x33c2('0x3d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x28ea58['id'],'module_name':_0x33c2('0x39'),'name_value_list':[{'name':_0x33c2('0x3e'),'value':_0x43a9c5!==_0x33c2('0x3f')?_0x43a9c5:util['format'](_0x33c2('0x40'),_0x3ca1ab)},{'name':_0x33c2('0x3b'),'value':_0x3ca1ab}]})}})['then'](function(_0x4e19fc){logger[_0x33c2('0xe')](_0x33c2('0x41'));return BPromise[_0x33c2('0x35')]({'id':_0x4e19fc['id'],'name':_0x4e19fc['entry_list'][_0x33c2('0x3e')][_0x33c2('0x36')],'phone':_0x4e19fc['entry_list'][_0x33c2('0x3b')][_0x33c2('0x36')]});});}});}function request(_0x34a0ab){logger[_0x33c2('0x42')]('[HTTP]',JSON[_0x33c2('0x25')](_0x34a0ab));return rp(_[_0x33c2('0x43')](def,_0x34a0ab));}function getTags(_0x268b91,_0x495084){var _0x4b7e3a=[];if(_0x268b91&&_0x268b91[_0x33c2('0x1f')]>0x0){_0x4b7e3a=_[_0x33c2('0x44')](_0x268b91,_0x495084);}return _0x4b7e3a;}function getCustomFields(_0x2f9caa,_0x3555e7){var _0xfad62d=[];var _0x27a11a={'custom_fields':[]};if(_0x2f9caa[_0x33c2('0x1f')]>0x0){_['forEach'](_0x2f9caa,function(_0x1bf245){if(_0x1bf245[_0x33c2('0x45')]===_0x33c2('0x46')&&_0x1bf245[_0x33c2('0x47')]&&!_0x1bf245[_0x33c2('0x48')]){_0x27a11a[_0x1bf245[_0x33c2('0x47')][_0x33c2('0x49')]()]=_0x1bf245[_0x33c2('0x4a')][_0x33c2('0x29')]();}else if(_0x1bf245[_0x33c2('0x45')]==='string'&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x27a11a[_0x33c2('0x4b')]['push']({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x1bf245[_0x33c2('0x4a')][_0x33c2('0x29')]()});}else if(_0x1bf245['type']===_0x33c2('0x4c')&&_0x1bf245[_0x33c2('0x21')]&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x3555e7[_0x1bf245[_0x33c2('0x21')]]&&_0x27a11a[_0x33c2('0x4b')][_0x33c2('0x22')]({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x3555e7[_0x1bf245[_0x33c2('0x21')]][_0x33c2('0x29')]()});}else if(_0x1bf245['type']===_0x33c2('0x4d')&&_0x1bf245[_0x33c2('0x4e')]&&_0x1bf245[_0x33c2('0x4e')][_0x33c2('0x10')]&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x3555e7[_0x1bf245['Variable'][_0x33c2('0x10')][_0x33c2('0x49')]()]&&_0x27a11a[_0x33c2('0x4b')][_0x33c2('0x22')]({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x3555e7[_0x1bf245[_0x33c2('0x4e')][_0x33c2('0x10')][_0x33c2('0x49')]()][_0x33c2('0x29')]()});}});}return _0x27a11a;}function getConnection(_0x1b8c6b){return request({'method':'POST','form':{'method':'login','input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON[_0x33c2('0x25')]({'user_auth':{'user_name':_0x1b8c6b[_0x33c2('0x4f')],'password':_0x1b8c6b[_0x33c2('0x50')],'encryption':_0x33c2('0x51')},'application':_0x33c2('0x52')})}})['then'](function(_0xf9af7e){var _0x5a8e92=_0xf9af7e;if(_0x5a8e92['id']){def[_0x33c2('0x53')]=_0x5a8e92['id'];return BPromise['resolve'](_0x5a8e92);}else{throw new Error(util[_0x33c2('0x26')](_0x33c2('0x54'),_0x1b8c6b['id']));}});}function setRelationship(_0xbc2eae,_0x503399,_0x5579b7,_0x174f15){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x33c2('0x24'),'rest_data':JSON['stringify']({'session':_0xbc2eae['id'],'module_name':_0x33c2('0x55'),'module_id':_0x5579b7['id'],'link_field_name':_0x174f15,'related_ids':[_0x503399['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x33c2('0x56')]=function(_0x974219,_0x234f14,_0x2324b8,_0xdf5559,_0x2b1579,_0x43086a){var _0x59e94b,_0x148852,_0x1a0d36,_0x5eca47;_0x43086a[_0x33c2('0x57')]=intUtil['stripTrailingSlash'](_0x43086a['remoteUri']);_0x43086a[_0x33c2('0x58')]=intUtil[_0x33c2('0x59')](_0x43086a['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')](_0x33c2('0x5b'),_0x43086a[_0x33c2('0x57')]);if(_0x2b1579&&_0x2b1579['monitor_format']){logger[_0x33c2('0xe')]('[QUEUE]',_0x33c2('0x5c'));_0x234f14[_0x33c2('0x5d')]=util['format'](_0x33c2('0x5e'),_0x43086a['serverUrl'],_0x234f14[_0x33c2('0x5f')],md5(_0x234f14['uniqueid']));}else{_0x234f14[_0x33c2('0x5d')]='';}return getConnection(_0x43086a)['then'](function(_0x39307f){_0x5eca47=_0x39307f;return getUser(_0x43086a,_0xdf5559[_0x33c2('0x10')],_0x5eca47);})[_0x33c2('0x31')](function(_0x49a2fc){_0x59e94b=_0x49a2fc;logger[_0x33c2('0xe')](_0x33c2('0x60'),_0x59e94b['id']);return getEndUser(_0x43086a,_0x234f14[_0x33c2('0x61')],_0x234f14[_0x33c2('0x62')],_0x5eca47);})[_0x33c2('0x31')](function(_0x5443db){_0x148852=_0x5443db;logger[_0x33c2('0xe')](_0x33c2('0x63'),_0x148852['id']);return getTicket(_0x43086a,_0x59e94b,_0x148852,_0x2324b8,_0x234f14,_0x2324b8[_0x33c2('0x64')],_0x5eca47,_0x33c2('0x65'));})[_0x33c2('0x31')](function(_0x3a7cf2){_0x1a0d36=_0x3a7cf2;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0x1a0d36['id']);return setRelationship(_0x5eca47,_0x59e94b,_0x1a0d36,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x5eca47,_0x148852,_0x1a0d36,'contacts');})[_0x33c2('0x31')](function(){return getServerInfo(_0x5eca47);})[_0x33c2('0x31')](function(_0x4ab69b){var _0x50700f=parseInt(_0x4ab69b[_0x33c2('0x69')][_0x33c2('0x6a')](0x0));var _0x3422bb=util[_0x33c2('0x26')](_0x33c2('0x6b'),_0x43086a[_0x33c2('0x57')],_0x1a0d36['id']);if(_0x50700f>0x6){_0x3422bb=util[_0x33c2('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x43086a[_0x33c2('0x57')],_0x1a0d36['id']);}logger[_0x33c2('0xe')](_0x33c2('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33c2('0x26')](_0x33c2('0x6d'),_0xdf5559['name']),_0x33c2('0x6e'),{'uri':_0x3422bb});})[_0x33c2('0x6f')](function(_0x500229){logger[_0x33c2('0x70')](_0x33c2('0x6c'),JSON[_0x33c2('0x25')](_0x500229));});};exports['outbound']=function(_0x34a2ec,_0x1e673f,_0x20b25e,_0x4f45a6,_0x40db11,_0x4c374d,_0x7b46c8){var _0x39e71a,_0x39f54d,_0xd2b2c5,_0x2f37e7;_0x4c374d[_0x33c2('0x57')]=intUtil[_0x33c2('0x59')](_0x4c374d['remoteUri']);_0x4c374d[_0x33c2('0x58')]=intUtil[_0x33c2('0x59')](_0x4c374d['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')]('%s/service/v4_1/rest.php',_0x4c374d['remoteUri']);if(_0x7b46c8&&_0x7b46c8[_0x33c2('0x71')]&&_0x7b46c8['recordingFormat']!==_0x33c2('0x72')){logger[_0x33c2('0xe')](_0x33c2('0x73'),'Recording\x20is\x20enabled!');_0x1e673f[_0x33c2('0x5d')]=util['format'](_0x33c2('0x5e'),_0x4c374d['serverUrl'],_0x1e673f[_0x33c2('0x5f')],md5(_0x1e673f[_0x33c2('0x5f')]));}return getConnection(_0x4c374d)['then'](function(_0x27344a){_0x2f37e7=_0x27344a;return getUser(_0x4c374d,_0x4f45a6['name'],_0x2f37e7);})[_0x33c2('0x31')](function(_0x14128c){_0x39e71a=_0x14128c;logger[_0x33c2('0xe')](_0x33c2('0x60'),_0x39e71a['id']);return getEndUser(_0x4c374d,_0x1e673f[_0x33c2('0x74')],_0x1e673f[_0x33c2('0x75')],_0x2f37e7);})[_0x33c2('0x31')](function(_0x39039f){_0x39f54d=_0x39039f;logger[_0x33c2('0xe')]('The\x20Enduser\x20ID\x20is:',_0x39f54d['id']);return getTicket(_0x4c374d,_0x39e71a,_0x39f54d,_0x20b25e,_0x1e673f,_0x20b25e[_0x33c2('0x64')],_0x2f37e7,_0x33c2('0x76'));})[_0x33c2('0x31')](function(_0x316722){_0xd2b2c5=_0x316722;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0xd2b2c5['id']);return setRelationship(_0x2f37e7,_0x39e71a,_0xd2b2c5,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x2f37e7,_0x39f54d,_0xd2b2c5,_0x33c2('0x77'));})[_0x33c2('0x31')](function(){return getServerInfo(_0x2f37e7);})[_0x33c2('0x31')](function(_0x5e434d){var _0x5cb9d4=parseInt(_0x5e434d[_0x33c2('0x69')][_0x33c2('0x6a')](0x0));var _0x54f943=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4c374d[_0x33c2('0x57')],_0xd2b2c5['id']);if(_0x5cb9d4>0x6){_0x54f943=util[_0x33c2('0x26')](_0x33c2('0x78'),_0x4c374d[_0x33c2('0x57')],_0xd2b2c5['id']);}logger[_0x33c2('0xe')]('[OUTBOUND]',_0x33c2('0x79'));emit(util['format'](_0x33c2('0x6d'),_0x4f45a6[_0x33c2('0x10')]),_0x33c2('0x6e'),{'uri':_0x54f943});})[_0x33c2('0x6f')](function(_0x399597){logger[_0x33c2('0x70')](_0x33c2('0x73'),JSON[_0x33c2('0x25')](_0x399597));});};exports[_0x33c2('0x7a')]=function(_0x2f4b94,_0x3baaa9,_0x3bc5ed,_0x1411e6,_0x25ab5b,_0x26fd01){var _0x2719d0,_0x2d7503,_0x73b13e,_0x51ab64;_0x26fd01[_0x33c2('0x57')]=intUtil[_0x33c2('0x59')](_0x26fd01[_0x33c2('0x57')]);_0x26fd01[_0x33c2('0x58')]=intUtil['stripTrailingSlash'](_0x26fd01['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')](_0x33c2('0x5b'),_0x26fd01[_0x33c2('0x57')]);if(_0x25ab5b&&_0x25ab5b[_0x33c2('0x7b')]){logger[_0x33c2('0xe')]('['+_0x3baaa9['lastevent'][_0x33c2('0x7c')]()+']','Recording\x20is\x20enabled!');_0x3baaa9[_0x33c2('0x5d')]=util[_0x33c2('0x26')](_0x33c2('0x5e'),_0x26fd01['serverUrl'],_0x3baaa9[_0x33c2('0x5f')],md5(_0x3baaa9['uniqueid']));}else{_0x3baaa9[_0x33c2('0x5d')]='';}return getConnection(_0x26fd01)['then'](function(_0x82a9d0){_0x51ab64=_0x82a9d0;if(!_[_0x33c2('0x2b')](_0x1411e6)){return getUser(_0x26fd01,_0x1411e6[_0x33c2('0x10')],_0x51ab64);}else{return getUser(_0x26fd01,null,_0x51ab64);}})[_0x33c2('0x31')](function(_0x39bb32){_0x2719d0=_0x39bb32;logger['info'](_0x33c2('0x60'),_0x2719d0['id']);return getEndUser(_0x26fd01,_0x3baaa9[_0x33c2('0x61')],_0x3baaa9['calleridnum'],_0x51ab64);})['then'](function(_0x2ad906){_0x2d7503=_0x2ad906;logger[_0x33c2('0xe')](_0x33c2('0x63'),_0x2d7503['id']);return getTicket(_0x26fd01,_0x2719d0,_0x2d7503,_0x3bc5ed,_0x3baaa9,_0x3bc5ed[_0x33c2('0x64')],_0x51ab64,_0x33c2('0x65'));})[_0x33c2('0x31')](function(_0x343a18){_0x73b13e=_0x343a18;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0x73b13e['id']);return setRelationship(_0x51ab64,_0x2719d0,_0x73b13e,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x51ab64,_0x2d7503,_0x73b13e,_0x33c2('0x77'));})[_0x33c2('0x31')](function(){return getServerInfo(_0x51ab64);})[_0x33c2('0x6f')](function(_0x1a862c){logger[_0x33c2('0x70')]('['+_0x3baaa9[_0x33c2('0x7d')][_0x33c2('0x7c')]()+']',JSON[_0x33c2('0x25')](_0x1a862c));});}; \ 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 a4c324d..f43a114 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 _0x2e6b=['getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util'];(function(_0x59eeed,_0x13778f){var _0x22ee92=function(_0x187dd3){while(--_0x187dd3){_0x59eeed['push'](_0x59eeed['shift']());}};_0x22ee92(++_0x13778f);}(_0x2e6b,0x8a));var _0xb2e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2e6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb2e6('0x0'));var util=require(_0xb2e6('0x1'));exports[_0xb2e6('0x2')]=function(_0xfdc793,_0x5dcb6e,_0x15cb40){var _0xca10b=[];if(_0xfdc793[_0xb2e6('0x3')]>0x0){var _0x2c137b=_[_0xb2e6('0x4')](_0xfdc793,['id']);for(var _0x60619b=0x0;_0x60619b<_0x2c137b[_0xb2e6('0x3')];_0x60619b++){var _0x198aa0=_0x2c137b[_0x60619b];if(_0x198aa0[_0xb2e6('0x5')]===_0xb2e6('0x6')){_0xca10b[_0xb2e6('0x7')](_0x198aa0[_0xb2e6('0x8')]);}else if(_0x198aa0[_0xb2e6('0x5')]===_0xb2e6('0x9')&&_0x198aa0[_0xb2e6('0xa')]){_0x5dcb6e[_0x198aa0[_0xb2e6('0xa')]]&&_0xca10b[_0xb2e6('0x7')](_0x5dcb6e[_0x198aa0['variableName']]['toString']());}else if(_0x198aa0[_0xb2e6('0x5')]===_0xb2e6('0xb')&&_0x198aa0[_0xb2e6('0xc')]&&_0x198aa0[_0xb2e6('0xc')][_0xb2e6('0xd')]){_0x5dcb6e[_0x198aa0[_0xb2e6('0xc')]['name']['toLowerCase']()]&&_0xca10b[_0xb2e6('0x7')](_0x5dcb6e[_0x198aa0[_0xb2e6('0xc')][_0xb2e6('0xd')][_0xb2e6('0xe')]()][_0xb2e6('0xf')]());}else if(_0x198aa0[_0xb2e6('0x5')]===_0xb2e6('0x10')){if(_0x198aa0[_0xb2e6('0x11')]==='string'&&_0x198aa0[_0xb2e6('0x12')]){_0xca10b[_0xb2e6('0x7')](util['format'](_0xb2e6('0x13'),_0x198aa0['key'],_0x198aa0[_0xb2e6('0x14')]));}else if(_0x198aa0[_0xb2e6('0x11')]===_0xb2e6('0x9')&&_0x198aa0[_0xb2e6('0xa')]&&_0x198aa0[_0xb2e6('0x12')]){_0x5dcb6e[_0x198aa0['variableName']]&&_0xca10b[_0xb2e6('0x7')](util[_0xb2e6('0x15')]('%s:\x20%s',_0x198aa0[_0xb2e6('0x12')],_0x5dcb6e[_0x198aa0[_0xb2e6('0xa')]]));}else if(_0x198aa0[_0xb2e6('0x11')]===_0xb2e6('0xb')&&_0x198aa0[_0xb2e6('0xc')]&&_0x198aa0[_0xb2e6('0xc')][_0xb2e6('0xd')]&&_0x198aa0['key']){_0x5dcb6e[_0x198aa0[_0xb2e6('0xc')]['name']['toLowerCase']()]&&_0xca10b['push'](util[_0xb2e6('0x15')](_0xb2e6('0x13'),_0x198aa0[_0xb2e6('0x12')],_0x5dcb6e[_0x198aa0[_0xb2e6('0xc')][_0xb2e6('0xd')]['toLowerCase']()]));}}}}return _0xca10b[_0xb2e6('0x16')](_0x15cb40);};exports[_0xb2e6('0x17')]=function(_0x3e9ae3){var _0x14beba=_0x3e9ae3['slice'](-0x1);if(_0x14beba==='/'){_0x3e9ae3=_0x3e9ae3[_0xb2e6('0x18')](0x0,_0x3e9ae3[_0xb2e6('0x19')](_0x14beba));}return _0x3e9ae3;};exports['validateEmail']=function(_0x12f504){if(!_[_0xb2e6('0x1a')](_0x12f504)&&_0x12f504!==''){var _0x5e0376=/^(([^<>()\[\]\\.,;:\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 _0x5e0376[_0xb2e6('0x1b')](String(_0x12f504)[_0xb2e6('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x764e=['key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType'];(function(_0x58d5d9,_0x5d104e){var _0x23d483=function(_0x3f627e){while(--_0x3f627e){_0x58d5d9['push'](_0x58d5d9['shift']());}};_0x23d483(++_0x5d104e);}(_0x764e,0xb3));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe764('0x0'));var util=require(_0xe764('0x1'));exports[_0xe764('0x2')]=function(_0x38a112,_0x506719,_0x157192){var _0x1c09e0=[];if(_0x38a112[_0xe764('0x3')]>0x0){var _0x35734d=_[_0xe764('0x4')](_0x38a112,['id']);for(var _0x43e655=0x0;_0x43e655<_0x35734d[_0xe764('0x3')];_0x43e655++){var _0x449ff8=_0x35734d[_0x43e655];if(_0x449ff8[_0xe764('0x5')]===_0xe764('0x6')){_0x1c09e0[_0xe764('0x7')](_0x449ff8[_0xe764('0x8')]);}else if(_0x449ff8[_0xe764('0x5')]===_0xe764('0x9')&&_0x449ff8['variableName']){_0x506719[_0x449ff8[_0xe764('0xa')]]&&_0x1c09e0['push'](_0x506719[_0x449ff8[_0xe764('0xa')]][_0xe764('0xb')]());}else if(_0x449ff8['type']===_0xe764('0xc')&&_0x449ff8[_0xe764('0xd')]&&_0x449ff8[_0xe764('0xd')][_0xe764('0xe')]){_0x506719[_0x449ff8[_0xe764('0xd')]['name'][_0xe764('0xf')]()]&&_0x1c09e0[_0xe764('0x7')](_0x506719[_0x449ff8[_0xe764('0xd')][_0xe764('0xe')][_0xe764('0xf')]()][_0xe764('0xb')]());}else if(_0x449ff8[_0xe764('0x5')]==='keyValue'){if(_0x449ff8[_0xe764('0x10')]===_0xe764('0x6')&&_0x449ff8[_0xe764('0x11')]){_0x1c09e0[_0xe764('0x7')](util[_0xe764('0x12')](_0xe764('0x13'),_0x449ff8['key'],_0x449ff8['keyContent']));}else if(_0x449ff8[_0xe764('0x10')]===_0xe764('0x9')&&_0x449ff8[_0xe764('0xa')]&&_0x449ff8['key']){_0x506719[_0x449ff8[_0xe764('0xa')]]&&_0x1c09e0[_0xe764('0x7')](util[_0xe764('0x12')](_0xe764('0x13'),_0x449ff8[_0xe764('0x11')],_0x506719[_0x449ff8[_0xe764('0xa')]]));}else if(_0x449ff8['keyType']===_0xe764('0xc')&&_0x449ff8[_0xe764('0xd')]&&_0x449ff8[_0xe764('0xd')][_0xe764('0xe')]&&_0x449ff8[_0xe764('0x11')]){_0x506719[_0x449ff8['Variable'][_0xe764('0xe')][_0xe764('0xf')]()]&&_0x1c09e0[_0xe764('0x7')](util['format'](_0xe764('0x13'),_0x449ff8['key'],_0x506719[_0x449ff8[_0xe764('0xd')]['name'][_0xe764('0xf')]()]));}}}}return _0x1c09e0[_0xe764('0x14')](_0x157192);};exports[_0xe764('0x15')]=function(_0x253a2f){var _0x265ea5=_0x253a2f[_0xe764('0x16')](-0x1);if(_0x265ea5==='/'){_0x253a2f=_0x253a2f[_0xe764('0x17')](0x0,_0x253a2f[_0xe764('0x18')](_0x265ea5));}return _0x253a2f;};exports[_0xe764('0x19')]=function(_0x135f5f){if(!_[_0xe764('0x1a')](_0x135f5f)&&_0x135f5f!==''){var _0x5ddde7=/^(([^<>()\[\]\\.,;:\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 _0x5ddde7[_0xe764('0x1b')](String(_0x135f5f)['toLowerCase']());}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 1060f34..aa6da6c 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0xf1710f,_0x1d6cb1){var _0x2abf77=function(_0x4274a1){while(--_0x4274a1){_0xf1710f['push'](_0xf1710f['shift']());}};_0x2abf77(++_0x1d6cb1);}(_0xe706,0xa3));var _0x6e70=function(_0x5562fe,_0x4e809c){_0x5562fe=_0x5562fe-0x0;var _0x1829c7=_0xe706[_0x5562fe];return _0x1829c7;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 63304f2..dc58f8d 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 _0xf490=['recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','inspect','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','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.','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','%s:%s','username','token','Basic\x20%s','toString','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x3a2baf,_0x6d0d92){var _0x2faeec=function(_0x2d0228){while(--_0x2d0228){_0x3a2baf['push'](_0x3a2baf['shift']());}};_0x2faeec(++_0x6d0d92);}(_0xf490,0x174));var _0x0f49=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xf490[_0x211087];return _0x2a581f;};'use strict';var _=require('lodash');var rp=require(_0x0f49('0x0'));var md5=require(_0x0f49('0x1'));var util=require(_0x0f49('0x2'));var Redis=require(_0x0f49('0x3'));var intUtil=require(_0x0f49('0x4'));var config=require('../../../../config/environment');var logger=require(_0x0f49('0x5'))(_0x0f49('0x6'));config[_0x0f49('0x7')]=_[_0x0f49('0x8')](config[_0x0f49('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x0f49('0x9'))(new Redis(config[_0x0f49('0x7')]));function emit(_0x3360a2,_0x686495,_0x52e6f5){io['to'](_0x3360a2)[_0x0f49('0xa')](_0x686495,_0x52e6f5);}var headers={'Content-Type':_0x0f49('0xb'),'Accept':_0x0f49('0xb')};function getTicket(_0x360989,_0x4438bb,_0x256836,_0x5972da,_0x8a8b5c){logger[_0x0f49('0xc')](_0x0f49('0xd'));return request({'uri':util['format'](_0x0f49('0xe'),_0x360989[_0x0f49('0xf')]),'method':_0x0f49('0x10'),'body':{'ticket':_[_0x0f49('0x11')]({'requester_id':_0x256836['id'],'submitter_id':_0x4438bb?_0x4438bb['id']:undefined,'assignee_id':_0x4438bb?_0x4438bb['id']:undefined,'tags':getTags(_0x5972da['Tags'],_0x0f49('0x12')),'subject':intUtil[_0x0f49('0x13')](_0x5972da[_0x0f49('0x14')],_0x8a8b5c,'\x20'),'description':intUtil['getString'](_0x5972da[_0x0f49('0x15')],_0x8a8b5c,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5972da['Descriptions'],_0x8a8b5c,'\x0a')}},getCustomFields(_0x5972da[_0x0f49('0x16')],_0x8a8b5c))}})[_0x0f49('0x17')](function(_0xb27f82){logger[_0x0f49('0xc')](_0x0f49('0x18'));return _0xb27f82[_0x0f49('0x19')];});}function getUser(_0x8bc296,_0x8de7db){if(intUtil[_0x0f49('0x1a')](_0x8de7db)){logger[_0x0f49('0xc')](_0x0f49('0x1b'),_0x8de7db);return request({'uri':util[_0x0f49('0x1c')](_0x0f49('0x1d'),_0x8bc296[_0x0f49('0xf')]),'qs':{'query':util[_0x0f49('0x1c')](_0x0f49('0x1e'),_0x8de7db)}})[_0x0f49('0x17')](function(_0x2c9bb1){if(_0x2c9bb1[_0x0f49('0x1f')]){logger[_0x0f49('0xc')](_0x0f49('0x20'));return _['find'](_0x2c9bb1[_0x0f49('0x21')],{'email':_0x8de7db,'role':_0x0f49('0x22')});}else{logger['info'](_0x0f49('0x23'));return request({'uri':util[_0x0f49('0x1c')](_0x0f49('0x24'),_0x8bc296[_0x0f49('0xf')])})[_0x0f49('0x17')](function(_0x4f5c63){logger[_0x0f49('0xc')](_0x0f49('0x25'));return _0x4f5c63['user'];});}});}else{logger['info'](_0x0f49('0x23'));return request({'uri':util[_0x0f49('0x1c')](_0x0f49('0x24'),_0x8bc296[_0x0f49('0xf')])})[_0x0f49('0x17')](function(_0x5dcfe8){logger['info']('Admin\x20account\x20selected.');return _0x5dcfe8['user'];});}}function getEndUser(_0x5d25de,_0x135d50,_0x1b90c5){logger[_0x0f49('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1b90c5);return request({'uri':util[_0x0f49('0x1c')]('%s/search.json',_0x5d25de[_0x0f49('0xf')]),'qs':{'query':util['format'](_0x0f49('0x26'),_0x1b90c5)}})['then'](function(_0x38d742){var _0x2a8da2;if(_0x38d742['results'][_0x0f49('0x27')]){_0x38d742[_0x0f49('0x21')]=_['filter'](_0x38d742[_0x0f49('0x21')],{'suspended':![],'role':'end-user'});if(_0x38d742[_0x0f49('0x21')][_0x0f49('0x27')]){_0x2a8da2=_[_0x0f49('0x28')](_0x38d742['results']);}}if(_0x2a8da2){logger[_0x0f49('0xc')](_0x0f49('0x29'));return _0x2a8da2;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x0f49('0x1c')]('%s/users.json',_0x5d25de['remoteUri']),'method':_0x0f49('0x10'),'body':{'user':{'role':_0x0f49('0x2a'),'name':util['format'](_0x0f49('0x2b'),_0x135d50||_0x1b90c5),'phone':_0x1b90c5}}})[_0x0f49('0x17')](function(_0x3dd92f){logger['info'](_0x0f49('0x2c'));return _0x3dd92f[_0x0f49('0x2d')];});}});}function getAuth(_0x2d9cab){var _0x3586c7;if(_0x2d9cab[_0x0f49('0x2e')]===_0x0f49('0x2f')){_0x3586c7=util[_0x0f49('0x1c')](_0x0f49('0x30'),_0x2d9cab[_0x0f49('0x31')],_0x2d9cab['password']);}else if(_0x2d9cab[_0x0f49('0x2e')]===_0x0f49('0x32')){_0x3586c7=util[_0x0f49('0x1c')]('%s/token:%s',_0x2d9cab[_0x0f49('0x31')],_0x2d9cab[_0x0f49('0x32')]);}return util[_0x0f49('0x1c')](_0x0f49('0x33'),new Buffer(_0x3586c7)[_0x0f49('0x34')]('base64'));}function request(_0x5d2a26){logger[_0x0f49('0x35')]('[HTTP]',JSON[_0x0f49('0x36')](_0x5d2a26));return rp(_[_0x0f49('0x8')](_0x5d2a26,{'method':_0x0f49('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x402f6f,_0x1a782c){var _0x23d17a=[];if(_0x402f6f&&_0x402f6f['length']>0x0){_0x23d17a=_['map'](_0x402f6f,_0x1a782c);}return _0x23d17a;}function getCustomFields(_0x50ab03,_0x43af4a){var _0x5f6cf2=[];var _0x265db5={'custom_fields':[]};if(_0x50ab03['length']>0x0){_[_0x0f49('0x38')](_0x50ab03,function(_0x4bd5e1){if(_[_0x0f49('0x39')]([_0x0f49('0x3a'),_0x0f49('0x3b')],_0x4bd5e1[_0x0f49('0x3c')])&&_0x4bd5e1[_0x0f49('0x3d')]&&!_0x4bd5e1[_0x0f49('0x3e')]){_0x265db5[_0x4bd5e1[_0x0f49('0x3d')][_0x0f49('0x3f')]()]=_0x4bd5e1[_0x0f49('0x40')][_0x0f49('0x34')]();}else if(_[_0x0f49('0x39')]([_0x0f49('0x3a'),_0x0f49('0x3b')],_0x4bd5e1['type'])&&_0x4bd5e1[_0x0f49('0x41')]&&_0x4bd5e1[_0x0f49('0x3e')]){_0x265db5['custom_fields'][_0x0f49('0x42')]({'id':_0x4bd5e1[_0x0f49('0x41')],'value':_0x4bd5e1[_0x0f49('0x40')][_0x0f49('0x34')]()});}else if(_0x4bd5e1['type']===_0x0f49('0x43')&&_0x4bd5e1[_0x0f49('0x44')]&&_0x4bd5e1['idField']&&_0x4bd5e1[_0x0f49('0x3e')]){_0x43af4a[_0x4bd5e1[_0x0f49('0x44')]]&&_0x265db5['custom_fields'][_0x0f49('0x42')]({'id':_0x4bd5e1['idField'],'value':_0x43af4a[_0x4bd5e1[_0x0f49('0x44')]][_0x0f49('0x34')]()});}else if(_0x4bd5e1[_0x0f49('0x3c')]===_0x0f49('0x45')&&_0x4bd5e1['Variable']&&_0x4bd5e1[_0x0f49('0x46')]['name']&&_0x4bd5e1[_0x0f49('0x41')]&&_0x4bd5e1[_0x0f49('0x3e')]){_0x43af4a[_0x4bd5e1[_0x0f49('0x46')][_0x0f49('0x12')]['toLowerCase']()]&&_0x265db5['custom_fields']['push']({'id':_0x4bd5e1[_0x0f49('0x41')],'value':_0x43af4a[_0x4bd5e1['Variable'][_0x0f49('0x12')][_0x0f49('0x3f')]()][_0x0f49('0x34')]()});}});}return _0x265db5;}exports[_0x0f49('0x47')]=function(_0x2712bd,_0x25ac27,_0x3c9bcd,_0x6fc0e6,_0x2c97e0,_0x12f235){var _0x4660c2,_0x55f0f9;_0x12f235[_0x0f49('0xf')]=intUtil[_0x0f49('0x48')](_0x12f235[_0x0f49('0xf')]);_0x12f235[_0x0f49('0x49')]=intUtil[_0x0f49('0x48')](_0x12f235[_0x0f49('0x49')]);if(_0x2c97e0&&_0x2c97e0['monitor_format']){logger[_0x0f49('0xc')](_0x0f49('0x4a'),_0x0f49('0x4b'));_0x25ac27[_0x0f49('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12f235[_0x0f49('0x49')],_0x25ac27['uniqueid'],md5(_0x25ac27[_0x0f49('0x4d')]));}else{_0x25ac27[_0x0f49('0x4c')]='';}headers[_0x0f49('0x4e')]=getAuth(_0x12f235);return getUser(_0x12f235,_0x6fc0e6[_0x0f49('0x4f')])[_0x0f49('0x17')](function(_0x5e5583){_0x4660c2=_0x5e5583;logger[_0x0f49('0xc')]('The\x20User\x20ID\x20is:',_0x4660c2['id']);return getEndUser(_0x12f235,_0x25ac27[_0x0f49('0x50')],_0x25ac27[_0x0f49('0x51')]);})[_0x0f49('0x17')](function(_0xc63cf2){_0x55f0f9=_0xc63cf2;logger[_0x0f49('0xc')](_0x0f49('0x52'),_0x55f0f9['id']);return getTicket(_0x12f235,_0x4660c2,_0x55f0f9,_0x3c9bcd,_0x25ac27);})[_0x0f49('0x17')](function(_0x44099c){if(_0x44099c){logger['info']('The\x20Ticket\x20ID\x20is:',_0x44099c['id']);switch(_0x12f235[_0x0f49('0x3c')]){case _0x0f49('0x53'):logger[_0x0f49('0xc')](_0x0f49('0x4a'),_0x0f49('0x54'));return request({'uri':util[_0x0f49('0x1c')](_0x0f49('0x55'),_0x12f235[_0x0f49('0xf')],_0x4660c2['id'],_0x44099c['id']),'method':'POST'});case _0x0f49('0x56'):logger[_0x0f49('0xc')](_0x0f49('0x4a'),_0x0f49('0x57'));emit(util[_0x0f49('0x1c')]('user:%s',_0x6fc0e6[_0x0f49('0x12')]),_0x0f49('0x58'),{'uri':util[_0x0f49('0x1c')](_0x0f49('0x59'),_0x12f235['remoteUri'][_0x0f49('0x5a')](_0x0f49('0x5b'),''),_0x44099c['id'])});break;default:logger[_0x0f49('0x5c')](_0x0f49('0x4a'),_0x0f49('0x5d'));}}})[_0x0f49('0x5e')](function(_0x42cffa){logger[_0x0f49('0x5c')](_0x0f49('0x5f'),util['inspect'](_0x42cffa,{'showHidden':!![],'depth':null}));});};exports[_0x0f49('0x60')]=function(_0xe4963f,_0x24f910,_0x2a0fc3,_0xcdb4db,_0x2e7abf,_0xab8309,_0x56c50a){var _0x5401c3,_0x4708d0;_0xab8309[_0x0f49('0xf')]=intUtil['stripTrailingSlash'](_0xab8309[_0x0f49('0xf')]);_0xab8309['serverUrl']=intUtil[_0x0f49('0x48')](_0xab8309[_0x0f49('0x49')]);if(_0x56c50a&&_0x56c50a[_0x0f49('0x61')]&&_0x56c50a['recordingFormat']!==_0x0f49('0x62')){logger[_0x0f49('0xc')](_0x0f49('0x63'),_0x0f49('0x4b'));_0x24f910['recordingURL']=util[_0x0f49('0x1c')](_0x0f49('0x64'),_0xab8309['serverUrl'],_0x24f910[_0x0f49('0x4d')],md5(_0x24f910[_0x0f49('0x4d')]));}headers['Authorization']=getAuth(_0xab8309);return getUser(_0xab8309,_0xcdb4db[_0x0f49('0x4f')])[_0x0f49('0x17')](function(_0xe5f0ed){_0x5401c3=_0xe5f0ed;logger[_0x0f49('0xc')](_0x0f49('0x65'),_0x5401c3['id']);return getEndUser(_0xab8309,_0x24f910[_0x0f49('0x66')],_0x24f910[_0x0f49('0x67')]);})[_0x0f49('0x17')](function(_0x5dac33){_0x4708d0=_0x5dac33;logger[_0x0f49('0xc')](_0x0f49('0x52'),_0x4708d0['id']);return getTicket(_0xab8309,_0x5401c3,_0x4708d0,_0x2a0fc3,_0x24f910);})[_0x0f49('0x17')](function(_0x1a0fd9){if(_0x1a0fd9){logger[_0x0f49('0xc')](_0x0f49('0x68'),_0x1a0fd9['id']);switch(_0xab8309[_0x0f49('0x3c')]){case _0x0f49('0x53'):logger[_0x0f49('0xc')]('[OUTBOUND]',_0x0f49('0x54'));return request({'uri':util[_0x0f49('0x1c')](_0x0f49('0x55'),_0xab8309['remoteUri'],_0x5401c3['id'],_0x1a0fd9['id']),'method':_0x0f49('0x10')});case'newTab':logger[_0x0f49('0xc')](_0x0f49('0x63'),_0x0f49('0x57'));emit(util[_0x0f49('0x1c')](_0x0f49('0x69'),_0xcdb4db[_0x0f49('0x12')]),_0x0f49('0x58'),{'uri':util['format'](_0x0f49('0x59'),_0xab8309[_0x0f49('0xf')][_0x0f49('0x5a')]('/api/v2',''),_0x1a0fd9['id'])});break;default:logger[_0x0f49('0x5c')](_0x0f49('0x63'),_0x0f49('0x5d'));}}})['catch'](function(_0x5c912b){logger[_0x0f49('0x5c')](_0x0f49('0x6a'),util['inspect'](_0x5c912b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2fddb9,_0xedf713,_0x4737da,_0x2bca13,_0x308a8c,_0x19f82f){var _0x31cba5,_0x3b5ee0;_0x19f82f[_0x0f49('0xf')]=intUtil[_0x0f49('0x48')](_0x19f82f['remoteUri']);_0x19f82f[_0x0f49('0x49')]=intUtil[_0x0f49('0x48')](_0x19f82f['serverUrl']);if(_0x308a8c&&_0x308a8c[_0x0f49('0x6b')]){logger[_0x0f49('0xc')]('['+_0xedf713[_0x0f49('0x6c')][_0x0f49('0x6d')]()+']',_0x0f49('0x4b'));_0xedf713[_0x0f49('0x4c')]=util[_0x0f49('0x1c')](_0x0f49('0x64'),_0x19f82f[_0x0f49('0x49')],_0xedf713[_0x0f49('0x4d')],md5(_0xedf713[_0x0f49('0x4d')]));}else{_0xedf713[_0x0f49('0x4c')]='';}headers[_0x0f49('0x4e')]=getAuth(_0x19f82f);return getUser(_0x19f82f)[_0x0f49('0x17')](function(_0x4aef6b){_0x31cba5=_0x4aef6b;logger[_0x0f49('0xc')](_0x0f49('0x65'),_0x31cba5['id']);return getEndUser(_0x19f82f,_0xedf713[_0x0f49('0x50')],_0xedf713['calleridnum']);})[_0x0f49('0x17')](function(_0x5a4b6f){_0x3b5ee0=_0x5a4b6f;logger[_0x0f49('0xc')](_0x0f49('0x52'),_0x3b5ee0['id']);return getTicket(_0x19f82f,_0x31cba5,_0x3b5ee0,_0x4737da,_0xedf713);})['then'](function(_0x3e252b){if(_0x3e252b){logger[_0x0f49('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3e252b['id']);}})[_0x0f49('0x5e')](function(_0x5ce807){logger[_0x0f49('0x5c')]('['+_0xedf713['lastevent'][_0x0f49('0x6d')]()+']'+_0x0f49('0x6e'),util[_0x0f49('0x6f')](_0x5ce807,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xee7d=['email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','error','inspect','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:browser:url','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','count','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','picklist','type','customField','nameField','toLowerCase','content','toString','includes','string','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization'];(function(_0x44ede2,_0x44e614){var _0x4e5164=function(_0x392532){while(--_0x392532){_0x44ede2['push'](_0x44ede2['shift']());}};_0x4e5164(++_0x44e614);}(_0xee7d,0x16b));var _0xdee7=function(_0x5d64f3,_0x9f069c){_0x5d64f3=_0x5d64f3-0x0;var _0x26ca1d=_0xee7d[_0x5d64f3];return _0x26ca1d;};'use strict';var _=require(_0xdee7('0x0'));var rp=require(_0xdee7('0x1'));var md5=require('md5');var util=require(_0xdee7('0x2'));var Redis=require('ioredis');var intUtil=require(_0xdee7('0x3'));var config=require(_0xdee7('0x4'));var logger=require(_0xdee7('0x5'))(_0xdee7('0x6'));config[_0xdee7('0x7')]=_[_0xdee7('0x8')](config[_0xdee7('0x7')],{'host':_0xdee7('0x9'),'port':0x18eb});var io=require(_0xdee7('0xa'))(new Redis(config[_0xdee7('0x7')]));function emit(_0x5768c4,_0x31876d,_0x5ccd9a){io['to'](_0x5768c4)[_0xdee7('0xb')](_0x31876d,_0x5ccd9a);}var headers={'Content-Type':_0xdee7('0xc'),'Accept':_0xdee7('0xc')};function getTicket(_0x13f9d4,_0x30f8e2,_0x1ac4ee,_0x32c402,_0x2ced78){logger[_0xdee7('0xd')](_0xdee7('0xe'));return request({'uri':util[_0xdee7('0xf')]('%s/tickets.json',_0x13f9d4[_0xdee7('0x10')]),'method':_0xdee7('0x11'),'body':{'ticket':_[_0xdee7('0x12')]({'requester_id':_0x1ac4ee['id'],'submitter_id':_0x30f8e2?_0x30f8e2['id']:undefined,'assignee_id':_0x30f8e2?_0x30f8e2['id']:undefined,'tags':getTags(_0x32c402['Tags'],_0xdee7('0x13')),'subject':intUtil[_0xdee7('0x14')](_0x32c402[_0xdee7('0x15')],_0x2ced78,'\x20'),'description':intUtil[_0xdee7('0x14')](_0x32c402['Descriptions'],_0x2ced78,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdee7('0x14')](_0x32c402[_0xdee7('0x16')],_0x2ced78,'\x0a')}},getCustomFields(_0x32c402[_0xdee7('0x17')],_0x2ced78))}})[_0xdee7('0x18')](function(_0xfb0890){logger[_0xdee7('0xd')](_0xdee7('0x19'));return _0xfb0890[_0xdee7('0x1a')];});}function getUser(_0x17be24,_0x1580d4){if(intUtil['validateEmail'](_0x1580d4)){logger['info'](_0xdee7('0x1b'),_0x1580d4);return request({'uri':util[_0xdee7('0xf')]('%s/search.json',_0x17be24[_0xdee7('0x10')]),'qs':{'query':util[_0xdee7('0xf')]('type:user\x20role:agent\x20email:%s',_0x1580d4)}})['then'](function(_0x4e756a){if(_0x4e756a[_0xdee7('0x1c')]){logger[_0xdee7('0xd')]('Agent\x20found!');return _[_0xdee7('0x1d')](_0x4e756a['results'],{'email':_0x1580d4,'role':'agent'});}else{logger[_0xdee7('0xd')](_0xdee7('0x1e'));return request({'uri':util['format']('%s/users/me.json',_0x17be24[_0xdee7('0x10')])})[_0xdee7('0x18')](function(_0x4902dc){logger[_0xdee7('0xd')](_0xdee7('0x1f'));return _0x4902dc[_0xdee7('0x20')];});}});}else{logger[_0xdee7('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x21'),_0x17be24[_0xdee7('0x10')])})[_0xdee7('0x18')](function(_0x5222d6){logger['info']('Admin\x20account\x20selected.');return _0x5222d6[_0xdee7('0x20')];});}}function getEndUser(_0x1697b3,_0x2aebef,_0xa58e8){logger[_0xdee7('0xd')]('Searching\x20enduser\x20with\x20phone',_0xa58e8);return request({'uri':util['format'](_0xdee7('0x22'),_0x1697b3[_0xdee7('0x10')]),'qs':{'query':util[_0xdee7('0xf')](_0xdee7('0x23'),_0xa58e8)}})['then'](function(_0x574120){var _0x4f9512;if(_0x574120[_0xdee7('0x24')]['length']){_0x574120['results']=_['filter'](_0x574120[_0xdee7('0x24')],{'suspended':![],'role':_0xdee7('0x25')});if(_0x574120[_0xdee7('0x24')][_0xdee7('0x26')]){_0x4f9512=_[_0xdee7('0x27')](_0x574120[_0xdee7('0x24')]);}}if(_0x4f9512){logger[_0xdee7('0xd')](_0xdee7('0x28'));return _0x4f9512;}else{logger[_0xdee7('0xd')](_0xdee7('0x29'));return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x2a'),_0x1697b3[_0xdee7('0x10')]),'method':_0xdee7('0x11'),'body':{'user':{'role':_0xdee7('0x25'),'name':util[_0xdee7('0xf')](_0xdee7('0x2b'),_0x2aebef||_0xa58e8),'phone':_0xa58e8}}})['then'](function(_0x2116ff){logger[_0xdee7('0xd')](_0xdee7('0x2c'));return _0x2116ff['user'];});}});}function getAuth(_0x5b2dd3){var _0x2bb8ce;if(_0x5b2dd3[_0xdee7('0x2d')]==='password'){_0x2bb8ce=util[_0xdee7('0xf')](_0xdee7('0x2e'),_0x5b2dd3[_0xdee7('0x2f')],_0x5b2dd3['password']);}else if(_0x5b2dd3[_0xdee7('0x2d')]==='token'){_0x2bb8ce=util[_0xdee7('0xf')]('%s/token:%s',_0x5b2dd3[_0xdee7('0x2f')],_0x5b2dd3[_0xdee7('0x30')]);}return util[_0xdee7('0xf')](_0xdee7('0x31'),new Buffer(_0x2bb8ce)['toString'](_0xdee7('0x32')));}function request(_0x25b0bd){logger[_0xdee7('0x33')](_0xdee7('0x34'),JSON['stringify'](_0x25b0bd));return rp(_['defaults'](_0x25b0bd,{'method':_0xdee7('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x47c086,_0x6c1510){var _0x505e09=[];if(_0x47c086&&_0x47c086[_0xdee7('0x26')]>0x0){_0x505e09=_[_0xdee7('0x36')](_0x47c086,_0x6c1510);}return _0x505e09;}function getCustomFields(_0x342a68,_0x1c77d0){var _0x21a9af=[];var _0xb1119a={'custom_fields':[]};if(_0x342a68[_0xdee7('0x26')]>0x0){_[_0xdee7('0x37')](_0x342a68,function(_0x41d646){if(_['includes'](['string',_0xdee7('0x38')],_0x41d646[_0xdee7('0x39')])&&_0x41d646['nameField']&&!_0x41d646[_0xdee7('0x3a')]){_0xb1119a[_0x41d646[_0xdee7('0x3b')][_0xdee7('0x3c')]()]=_0x41d646[_0xdee7('0x3d')][_0xdee7('0x3e')]();}else if(_[_0xdee7('0x3f')]([_0xdee7('0x40'),_0xdee7('0x38')],_0x41d646[_0xdee7('0x39')])&&_0x41d646['idField']&&_0x41d646[_0xdee7('0x3a')]){_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646[_0xdee7('0x43')],'value':_0x41d646['content'][_0xdee7('0x3e')]()});}else if(_0x41d646[_0xdee7('0x39')]===_0xdee7('0x44')&&_0x41d646[_0xdee7('0x45')]&&_0x41d646[_0xdee7('0x43')]&&_0x41d646[_0xdee7('0x3a')]){_0x1c77d0[_0x41d646[_0xdee7('0x45')]]&&_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646['idField'],'value':_0x1c77d0[_0x41d646['variableName']][_0xdee7('0x3e')]()});}else if(_0x41d646[_0xdee7('0x39')]===_0xdee7('0x46')&&_0x41d646[_0xdee7('0x47')]&&_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')]&&_0x41d646[_0xdee7('0x43')]&&_0x41d646[_0xdee7('0x3a')]){_0x1c77d0[_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')][_0xdee7('0x3c')]()]&&_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646[_0xdee7('0x43')],'value':_0x1c77d0[_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')][_0xdee7('0x3c')]()][_0xdee7('0x3e')]()});}});}return _0xb1119a;}exports[_0xdee7('0x48')]=function(_0x25635c,_0x563540,_0x4e2e7b,_0x222867,_0x2aacfb,_0xe430b7){var _0x5952c6,_0x473807;_0xe430b7['remoteUri']=intUtil[_0xdee7('0x49')](_0xe430b7['remoteUri']);_0xe430b7[_0xdee7('0x4a')]=intUtil[_0xdee7('0x49')](_0xe430b7[_0xdee7('0x4a')]);if(_0x2aacfb&&_0x2aacfb[_0xdee7('0x4b')]){logger['info'](_0xdee7('0x4c'),_0xdee7('0x4d'));_0x563540[_0xdee7('0x4e')]=util[_0xdee7('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe430b7[_0xdee7('0x4a')],_0x563540[_0xdee7('0x4f')],md5(_0x563540[_0xdee7('0x4f')]));}else{_0x563540[_0xdee7('0x4e')]='';}headers[_0xdee7('0x50')]=getAuth(_0xe430b7);return getUser(_0xe430b7,_0x222867[_0xdee7('0x51')])[_0xdee7('0x18')](function(_0x1dad5c){_0x5952c6=_0x1dad5c;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x5952c6['id']);return getEndUser(_0xe430b7,_0x563540[_0xdee7('0x53')],_0x563540[_0xdee7('0x54')]);})[_0xdee7('0x18')](function(_0x801edb){_0x473807=_0x801edb;logger[_0xdee7('0xd')](_0xdee7('0x55'),_0x473807['id']);return getTicket(_0xe430b7,_0x5952c6,_0x473807,_0x4e2e7b,_0x563540);})['then'](function(_0x1afa9a){if(_0x1afa9a){logger[_0xdee7('0xd')](_0xdee7('0x56'),_0x1afa9a['id']);switch(_0xe430b7[_0xdee7('0x39')]){case _0xdee7('0x57'):logger['info'](_0xdee7('0x4c'),_0xdee7('0x58'));return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x59'),_0xe430b7[_0xdee7('0x10')],_0x5952c6['id'],_0x1afa9a['id']),'method':_0xdee7('0x11')});case _0xdee7('0x5a'):logger[_0xdee7('0xd')](_0xdee7('0x4c'),_0xdee7('0x5b'));emit(util['format'](_0xdee7('0x5c'),_0x222867[_0xdee7('0x13')]),'trigger:browser:url',{'uri':util[_0xdee7('0xf')](_0xdee7('0x5d'),_0xe430b7[_0xdee7('0x10')]['replace'](_0xdee7('0x5e'),''),_0x1afa9a['id'])});break;default:logger['error'](_0xdee7('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x11e22c){logger[_0xdee7('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xdee7('0x60')](_0x11e22c,{'showHidden':!![],'depth':null}));});};exports[_0xdee7('0x61')]=function(_0x4aa983,_0x4ae3f8,_0x274a51,_0x41e904,_0x32f438,_0xc48710,_0x3b013e){var _0x3f7ef2,_0x188864;_0xc48710[_0xdee7('0x10')]=intUtil[_0xdee7('0x49')](_0xc48710[_0xdee7('0x10')]);_0xc48710[_0xdee7('0x4a')]=intUtil['stripTrailingSlash'](_0xc48710[_0xdee7('0x4a')]);if(_0x3b013e&&_0x3b013e[_0xdee7('0x62')]&&_0x3b013e[_0xdee7('0x62')]!=='none'){logger[_0xdee7('0xd')](_0xdee7('0x63'),'Recording\x20is\x20enabled!');_0x4ae3f8[_0xdee7('0x4e')]=util[_0xdee7('0xf')](_0xdee7('0x64'),_0xc48710[_0xdee7('0x4a')],_0x4ae3f8['uniqueid'],md5(_0x4ae3f8[_0xdee7('0x4f')]));}headers[_0xdee7('0x50')]=getAuth(_0xc48710);return getUser(_0xc48710,_0x41e904['email'])[_0xdee7('0x18')](function(_0x5e5d42){_0x3f7ef2=_0x5e5d42;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x3f7ef2['id']);return getEndUser(_0xc48710,_0x4ae3f8[_0xdee7('0x65')],_0x4ae3f8[_0xdee7('0x66')]);})[_0xdee7('0x18')](function(_0x575e3a){_0x188864=_0x575e3a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x188864['id']);return getTicket(_0xc48710,_0x3f7ef2,_0x188864,_0x274a51,_0x4ae3f8);})[_0xdee7('0x18')](function(_0x56c29a){if(_0x56c29a){logger['info']('The\x20Ticket\x20ID\x20is:',_0x56c29a['id']);switch(_0xc48710[_0xdee7('0x39')]){case'integrationTab':logger[_0xdee7('0xd')](_0xdee7('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x59'),_0xc48710[_0xdee7('0x10')],_0x3f7ef2['id'],_0x56c29a['id']),'method':_0xdee7('0x11')});case _0xdee7('0x5a'):logger[_0xdee7('0xd')](_0xdee7('0x63'),_0xdee7('0x5b'));emit(util['format'](_0xdee7('0x5c'),_0x41e904['name']),_0xdee7('0x67'),{'uri':util[_0xdee7('0xf')](_0xdee7('0x5d'),_0xc48710['remoteUri'][_0xdee7('0x68')]('/api/v2',''),_0x56c29a['id'])});break;default:logger['error']('[OUTBOUND]',_0xdee7('0x69'));}}})[_0xdee7('0x6a')](function(_0x202902){logger[_0xdee7('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x202902,{'showHidden':!![],'depth':null}));});};exports[_0xdee7('0x6b')]=function(_0x4e0647,_0x4e6aab,_0x18784d,_0x302299,_0x38e495,_0x56a67f){var _0x48c359,_0x5340f1;_0x56a67f['remoteUri']=intUtil[_0xdee7('0x49')](_0x56a67f[_0xdee7('0x10')]);_0x56a67f[_0xdee7('0x4a')]=intUtil[_0xdee7('0x49')](_0x56a67f[_0xdee7('0x4a')]);if(_0x38e495&&_0x38e495[_0xdee7('0x4b')]){logger[_0xdee7('0xd')]('['+_0x4e6aab[_0xdee7('0x6c')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4e6aab['recordingURL']=util[_0xdee7('0xf')](_0xdee7('0x64'),_0x56a67f[_0xdee7('0x4a')],_0x4e6aab[_0xdee7('0x4f')],md5(_0x4e6aab[_0xdee7('0x4f')]));}else{_0x4e6aab[_0xdee7('0x4e')]='';}headers[_0xdee7('0x50')]=getAuth(_0x56a67f);return getUser(_0x56a67f)[_0xdee7('0x18')](function(_0x5534cf){_0x48c359=_0x5534cf;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x48c359['id']);return getEndUser(_0x56a67f,_0x4e6aab[_0xdee7('0x53')],_0x4e6aab[_0xdee7('0x54')]);})['then'](function(_0x41eb0d){_0x5340f1=_0x41eb0d;logger[_0xdee7('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5340f1['id']);return getTicket(_0x56a67f,_0x48c359,_0x5340f1,_0x18784d,_0x4e6aab);})[_0xdee7('0x18')](function(_0x175fff){if(_0x175fff){logger[_0xdee7('0xd')]('The\x20Ticket\x20ID\x20is:',_0x175fff['id']);}})[_0xdee7('0x6a')](function(_0x5ba0e1){logger['error']('['+_0x4e6aab[_0xdee7('0x6c')][_0xdee7('0x6d')]()+']'+_0xdee7('0x6e'),util['inspect'](_0x5ba0e1,{'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 d4eb37b..0231ed9 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 _0xe347=['com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','format','lastevent','called','Called','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','outbound','agentcalledAt','Inbound','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token='];(function(_0x2ae10b,_0x4b48b0){var _0x2d4486=function(_0x489b49){while(--_0x489b49){_0x2ae10b['push'](_0x2ae10b['shift']());}};_0x2d4486(++_0x4b48b0);}(_0xe347,0xac));var _0x7e34=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0xe347[_0x3d7fb5];return _0x3a9642;};'use strict';var _=require(_0x7e34('0x0'));var rp=require('request-promise');var md5=require(_0x7e34('0x1'));var util=require('util');var intUtil=require(_0x7e34('0x2'));var moment=require(_0x7e34('0x3'));var Redis=require(_0x7e34('0x4'));var BPromise=require(_0x7e34('0x5'));var config=require(_0x7e34('0x6'));var logger=require(_0x7e34('0x7'))(_0x7e34('0x8'));config[_0x7e34('0x9')]=_[_0x7e34('0xa')](config[_0x7e34('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x7e34('0xb'))(new Redis(config[_0x7e34('0x9')]));function emit(_0x4bd394,_0x37661d,_0x3c1b9b){io['to'](_0x4bd394)[_0x7e34('0xc')](_0x37661d,_0x3c1b9b);}function request(_0x4760cf){logger[_0x7e34('0xd')]('[HTTP]',JSON[_0x7e34('0xe')](_0x4760cf));return rp(_0x4760cf);}function getCustomFields(_0xe9525f,_0x26c93d){var _0x3090c4={};if(_0xe9525f[_0x7e34('0xf')]>0x0){_[_0x7e34('0x10')](_0xe9525f,function(_0x1d5d88){if(_[_0x7e34('0x11')]([_0x7e34('0x12'),_0x7e34('0x13')],_0x1d5d88[_0x7e34('0x14')])&&_0x1d5d88[_0x7e34('0x15')]){_0x3090c4[_0x1d5d88[_0x7e34('0x15')]]=_0x1d5d88['content'][_0x7e34('0x16')]();}else if(_0x1d5d88[_0x7e34('0x14')]===_0x7e34('0x17')&&_0x1d5d88[_0x7e34('0x18')]&&_0x1d5d88[_0x7e34('0x15')]&&_0x26c93d[_0x1d5d88[_0x7e34('0x18')]]){_0x3090c4[_0x1d5d88[_0x7e34('0x15')]]=_0x26c93d[_0x1d5d88['variableName']][_0x7e34('0x16')]();}else if(_0x1d5d88[_0x7e34('0x14')]==='customVariable'&&_0x1d5d88[_0x7e34('0x19')]&&_0x1d5d88[_0x7e34('0x19')]['name']&&_0x1d5d88[_0x7e34('0x15')]&&_0x26c93d[_0x1d5d88[_0x7e34('0x19')][_0x7e34('0x1a')][_0x7e34('0x1b')]()]){_0x3090c4[_0x1d5d88[_0x7e34('0x15')]]=_0x26c93d[_0x1d5d88[_0x7e34('0x19')]['name']['toLowerCase']()][_0x7e34('0x16')]();}});}return _0x3090c4;}function getName(_0x27afb9){if(_0x27afb9[_0x7e34('0x1c')]('\x20')>0x0){var _0x2f1dad=_0x27afb9[_0x7e34('0x1d')](/ (.+)/);if(_0x2f1dad[0x1]){return _0x2f1dad;}}return[_0x27afb9,_0x27afb9];}var accountsTokens={};function getAccessToken(_0x24c67a){return new Promise(function(_0x265b95,_0xf093a4){if(!_[_0x7e34('0x1e')](accountsTokens[_0x24c67a['id']])&&!_[_0x7e34('0x1e')](accountsTokens[_0x24c67a['id']][_0x7e34('0x1f')])){if(moment()[_0x7e34('0x20')](accountsTokens[_0x24c67a['id']][_0x7e34('0x21')])){_0x265b95(accountsTokens[_0x24c67a['id']][_0x7e34('0x1f')]);}}var _0x28d070;switch(_0x24c67a['zone']){case'US':_0x28d070=_0x7e34('0x22');break;case'AU':_0x28d070='https://accounts.zoho.com.au';break;case'EU':_0x28d070=_0x7e34('0x23');break;case'IN':_0x28d070='https://accounts.zoho.in';break;case'CN':_0x28d070='https://accounts.zoho.com.cn';break;default:_0x28d070=_0x7e34('0x23');break;}var _0x379c9b={'method':_0x7e34('0x24'),'uri':_0x28d070+_0x7e34('0x25'),'qs':{'refresh_token':_0x24c67a['refreshToken'],'client_id':_0x24c67a['clientId'],'client_secret':_0x24c67a[_0x7e34('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x379c9b)[_0x7e34('0x27')](function(_0x56ecdf){accountsTokens[_0x24c67a['id']]={'access_token':_0x56ecdf[_0x7e34('0x1f')],'expires_in':moment()[_0x7e34('0x28')](_0x56ecdf[_0x7e34('0x21')],_0x7e34('0x29'))};_0x265b95(_0x56ecdf[_0x7e34('0x1f')]);})[_0x7e34('0x2a')](function(_0x245b4a){logger[_0x7e34('0x2b')](_0x7e34('0x2c'),_0x245b4a[_0x7e34('0x2d')]);_0xf093a4(_0x245b4a);});});}function getUser(_0x2d21e2,_0x22dcf7,_0x3f1afe,_0x597eaa){logger[_0x7e34('0x2e')](_0x7e34('0x2f'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x22dcf7),'qs':{'type':_0x7e34('0x30')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2d21e2},'json':!![]})['then'](function(_0x408b40){if(_0x408b40[_0x7e34('0x31')]){var _0x4ec73c=-0x1;if(_[_0x7e34('0x32')](_0x408b40[_0x7e34('0x31')])){if(!_[_0x7e34('0x1e')](_0x597eaa)){_0x4ec73c=_[_0x7e34('0x33')](_0x408b40[_0x7e34('0x31')],function(_0x5063c8){return _0x5063c8[_0x7e34('0x34')]===_0x597eaa;});}if(_0x4ec73c>=0x0){logger[_0x7e34('0x2e')](_0x7e34('0x35'));}else{logger[_0x7e34('0x2e')](_0x7e34('0x36'));_0x4ec73c=_[_0x7e34('0x33')](_0x408b40[_0x7e34('0x31')],function(_0x53bb0e){return _0x53bb0e[_0x7e34('0x37')][_0x7e34('0x1a')]==='Administrator';});}return _0x408b40[_0x7e34('0x31')][_0x4ec73c];}else{if(_0x408b40['user'][_0x7e34('0x37')]['name']==='Administrator'){logger[_0x7e34('0x2e')]('Using\x20the\x20admin\x20account!');user=_0x408b40[_0x7e34('0x38')];return user;}else{logger['error'](_0x7e34('0x39'),JSON['stringify'](_0x408b40));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7e34('0xe')](_0x408b40));}}}else{logger[_0x7e34('0x2b')]('The\x20failing\x20result\x20is',JSON[_0x7e34('0xe')](_0x408b40));throw new Error(_0x7e34('0x3a')+JSON[_0x7e34('0xe')](_0x408b40));}})[_0x7e34('0x2a')](function(_0x97439a){console['error'](_0x97439a);});}function getZohoUser(_0x2bb8ca,_0x11e88b){return new BPromise(function(_0x1fef62,_0x50dbe){request(_0x2bb8ca)[_0x7e34('0x27')](function(_0x214700){var _0x228b1b=null;if(_0x214700){_0x228b1b=_0x214700[_0x7e34('0x3b')][0x0];_0x228b1b[_0x7e34('0x3c')]=_0x11e88b;}_0x1fef62(_0x228b1b);})[_0x7e34('0x2a')](function(_0x3c2cc2){_0x50dbe(_0x3c2cc2);});});}function createEndUser(_0x3c1aee,_0x12fc88,_0x35a414,_0x1a1d4b,_0x2f020b,_0x2edf43){var _0x35a414=getName(_0x35a414);return request({'method':'POST','uri':_0x7e34('0x3d')+_0x12fc88+_0x7e34('0x3e')+_[_0x7e34('0x3f')](_0x2edf43[_0x7e34('0x40')])+'s','body':{'data':[{'Last_Name':_0x35a414[0x1],'First_Name':_0x35a414[0x0],'Phone':_0x1a1d4b,'Owner':{'name':!_[_0x7e34('0x1e')](_0x2f020b[_0x7e34('0x41')][_0x7e34('0x1a')])?_0x2f020b[_0x7e34('0x41')]['name']:!_['isNil'](_0x2f020b[_0x7e34('0x42')])?_0x2f020b['first_name']+'\x20'+_0x2f020b[_0x7e34('0x43')]:_0x2f020b[_0x7e34('0x43')],'id':_0x2f020b['id']}}]},'headers':{'Authorization':_0x7e34('0x44')+_0x3c1aee},'json':!![]})[_0x7e34('0x27')](function(_0x1b9374){if(_0x1b9374&&_0x1b9374['data'][0x0][_0x7e34('0x45')]===_0x7e34('0x46')){var _0x21fdf4=_0x1b9374['data'][0x0]['details'];_0x21fdf4[_0x7e34('0x3c')]=_[_0x7e34('0x3f')](_0x2edf43[_0x7e34('0x40')])+'s';return _0x21fdf4;}logger['error'](_0x7e34('0x39'),JSON[_0x7e34('0xe')](data));throw new Error(_0x7e34('0x47')+JSON[_0x7e34('0xe')](data));})['catch'](function(_0x3596d5){console[_0x7e34('0x48')](_0x7e34('0x49'),_0x3596d5);});}function getEndUser(_0x1ed398,_0x21db86,_0xd23022,_0x34a1ec,_0x548f0a,_0x29c9f1,_0x2d6b6b){var _0xf2d096={'method':_0x7e34('0x4a'),'uri':'','headers':{'Authorization':_0x7e34('0x44')+_0x1ed398},'json':!![]};switch(_0x2d6b6b[_0x7e34('0x4b')]){case _0x7e34('0x4c'):_0xf2d096['uri']='https://www.zohoapis.'+_0x21db86+_0x7e34('0x4d')+_0x548f0a+'))';return getZohoUser(_0xf2d096,_0x7e34('0x4e'))[_0x7e34('0x27')](function(_0x9262dd){if(_0x9262dd)return _0x9262dd;_0xf2d096[_0x7e34('0x4f')]=_0x7e34('0x3d')+_0x21db86+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x548f0a+'))';return getZohoUser(_0xf2d096,_0x7e34('0x50'))[_0x7e34('0x27')](function(_0x208666){if(_0x208666)return _0x208666;if(_0x2d6b6b[_0x7e34('0x40')]!=_0x7e34('0x51')){return createEndUser(_0x1ed398,_0x21db86,_0x34a1ec,_0x548f0a,_0x29c9f1,_0x2d6b6b);}else{return{};}});});break;case _0x7e34('0x52'):_0xf2d096['uri']='https://www.zohoapis.'+_0x21db86+_0x7e34('0x4d')+_0x548f0a+'))';return getZohoUser(_0xf2d096,_0x7e34('0x4e'))[_0x7e34('0x27')](function(_0x417e7c){if(_0x417e7c)return _0x417e7c;if(_0x2d6b6b['moduleCreate']!='nothing'){return createEndUser(_0x1ed398,_0x21db86,_0x34a1ec,_0x548f0a,_0x29c9f1,_0x2d6b6b);}else{return{};}});break;case'lead':_0xf2d096[_0x7e34('0x4f')]=_0x7e34('0x3d')+_0x21db86+_0x7e34('0x53')+_0x548f0a+'))';return getZohoUser(_0xf2d096,'Leads')['then'](function(_0x5ab170){if(_0x5ab170)return _0x5ab170;if(_0x2d6b6b[_0x7e34('0x40')]!=_0x7e34('0x51')){return createEndUser(_0x1ed398,_0x21db86,_0x34a1ec,_0x548f0a,_0x29c9f1,_0x2d6b6b);}else{return{};}});break;}}function getCall(_0x2ac02e,_0x29e0df,_0x17dc0e,_0x4ce4c8,_0x3860f8,_0x160b40,_0x402947,_0x286a62){logger[_0x7e34('0x2e')]('Creating\x20new\x20call...');var _0x2b66eb={};_0x2b66eb[_0x7e34('0x54')]={'name':!_[_0x7e34('0x1e')](_0x4ce4c8['role'][_0x7e34('0x1a')])&&!_[_0x7e34('0x1e')](_0x4ce4c8['profile']['name'])&&_0x4ce4c8[_0x7e34('0x37')][_0x7e34('0x1a')]==='administrator'?_0x4ce4c8[_0x7e34('0x41')]['name']:!_[_0x7e34('0x1e')](_0x4ce4c8[_0x7e34('0x42')])?_0x4ce4c8[_0x7e34('0x42')]+'\x20'+_0x4ce4c8['last_name']:_0x4ce4c8['last_name'],'id':_0x4ce4c8['id']};_0x2b66eb[_0x7e34('0x55')]=intUtil[_0x7e34('0x56')](_0x160b40[_0x7e34('0x57')],_0x402947,'\x20');_0x2b66eb[_0x7e34('0x58')]=intUtil[_0x7e34('0x56')](_0x160b40['Descriptions'],_0x402947,'\x0a');if(_0x3860f8[_0x7e34('0x3c')]===_0x7e34('0x4e')){_0x2b66eb[_0x7e34('0x59')]={'name':!_[_0x7e34('0x1e')](_0x3860f8[_0x7e34('0x5a')])?_0x3860f8[_0x7e34('0x5a')]:!_['isNil'](_0x3860f8[_0x7e34('0x5b')])?_0x3860f8[_0x7e34('0x5b')]+'\x20'+_0x3860f8[_0x7e34('0x5c')]:_0x3860f8[_0x7e34('0x5c')],'id':_0x3860f8['id']};}if(_0x3860f8[_0x7e34('0x3c')]===_0x7e34('0x50')){_0x2b66eb['What_Id']={'name':!_['isNil'](_0x3860f8[_0x7e34('0x5a')])?_0x3860f8['Full_Name']:!_[_0x7e34('0x1e')](_0x3860f8[_0x7e34('0x5b')])?_0x3860f8['First_Name']+'\x20'+_0x3860f8[_0x7e34('0x5c')]:_0x3860f8['Last_Name'],'id':_0x3860f8['id']};_0x2b66eb[_0x7e34('0x5d')]=_[_0x7e34('0x3f')](_0x3860f8[_0x7e34('0x3c')]);}if(_0x402947[_0x7e34('0x5e')]){_0x2b66eb[_0x7e34('0x5f')]=moment[_0x7e34('0x60')](parseInt(_0x402947[_0x7e34('0x5e')])*0x3e8)['format'](_0x7e34('0x61'));}else if(_0x402947[_0x7e34('0x62')]&&_0x402947[_0x7e34('0x63')]){_0x2b66eb['Call_Duration']=moment[_0x7e34('0x60')](moment(_0x402947[_0x7e34('0x63')],'YYYY-MM-DDTHH:mm:ss')[_0x7e34('0x64')](moment(_0x402947[_0x7e34('0x65')],_0x7e34('0x66'))))[_0x7e34('0x67')](_0x7e34('0x61'));}switch(_0x402947[_0x7e34('0x68')]){case _0x7e34('0x69'):_0x2b66eb['Call_Result']=_0x7e34('0x6a');break;case'complete':case _0x7e34('0x6b'):_0x2b66eb[_0x7e34('0x6c')]=_0x7e34('0x6d');break;case _0x7e34('0x6e'):_0x2b66eb[_0x7e34('0x6c')]=_0x7e34('0x6f');break;case _0x7e34('0x70'):_0x2b66eb[_0x7e34('0x6c')]=_0x7e34('0x71');break;case'timeout':_0x2b66eb[_0x7e34('0x6c')]=_0x7e34('0x72');default:}_0x2b66eb['Call_Start_Time']=(_0x286a62===_0x7e34('0x73')?moment(_0x402947[_0x7e34('0x65')])[_0x7e34('0x67')](_0x7e34('0x66')):moment(_0x402947[_0x7e34('0x74')])[_0x7e34('0x67')](_0x7e34('0x66')))||moment()[_0x7e34('0x67')](_0x7e34('0x66'));_0x2b66eb['Call_Type']=_0x286a62||_0x7e34('0x75');_0x2b66eb=_['merge'](_0x2b66eb,getCustomFields(_0x160b40[_0x7e34('0x76')],_0x402947));return request({'method':'POST','uri':_0x7e34('0x3d')+_0x29e0df+'/crm/v2/Calls','headers':{'Authorization':_0x7e34('0x44')+_0x2ac02e},'body':{'data':[_0x2b66eb]},'json':!![]})[_0x7e34('0x27')](function(_0x198295){if(_0x198295&&_0x198295['data'][0x0][_0x7e34('0x45')]===_0x7e34('0x46')){logger[_0x7e34('0x2e')](_0x7e34('0x77'));return{'id':_0x198295[_0x7e34('0x3b')][0x0][_0x7e34('0x78')]['id']};}})[_0x7e34('0x2a')](function(_0x48453b){logger[_0x7e34('0x2e')](_0x7e34('0x79'),_0x48453b[_0x7e34('0x2d')]);console[_0x7e34('0x48')](_0x7e34('0x79'),_0x48453b);});}exports[_0x7e34('0x7a')]=function(_0x519778,_0x340e8c,_0xd2aa3a,_0x16bc34,_0x308bd3,_0x35211c){var _0xd37fb1,_0x6e8505,_0x4ef430;_0x35211c[_0x7e34('0x7b')]=intUtil[_0x7e34('0x7c')](_0x35211c[_0x7e34('0x7b')]);_0x35211c[_0x7e34('0x7d')]=intUtil[_0x7e34('0x7c')](_0x35211c['serverUrl']);if(_0x308bd3&&_0x308bd3[_0x7e34('0x7e')]){logger[_0x7e34('0x2e')](_0x7e34('0x7f'),_0x7e34('0x80'));_0x340e8c[_0x7e34('0x81')]=_0x35211c[_0x7e34('0x7d')]+'/api/voice/recordings/'+_0x340e8c[_0x7e34('0x82')]+_0x7e34('0x83')+md5(_0x340e8c[_0x7e34('0x82')]);}else{_0x340e8c[_0x7e34('0x81')]='';}var _0x35822f=_0x35211c[_0x7e34('0x7b')]==='zoho.eu'?'eu':_0x7e34('0x84');return getAccessToken(_0x35211c)[_0x7e34('0x27')](function(_0x21e6cc){_0x4ef430=_0x21e6cc;return getUser(_0x4ef430,_0x35822f,_0x35211c,_0x16bc34[_0x7e34('0x34')]);})[_0x7e34('0x27')](function(_0x5e3e3c){_0xd37fb1=_0x5e3e3c;logger[_0x7e34('0x2e')](_0x7e34('0x85'),_0xd37fb1['id']);return getEndUser(_0x4ef430,_0x35822f,_0x35211c,_0x340e8c[_0x7e34('0x86')],_0x340e8c[_0x7e34('0x87')],_0xd37fb1,_0xd2aa3a);})[_0x7e34('0x27')](function(_0x8e02f6){_0x6e8505=_0x8e02f6;return getCall(_0x4ef430,_0x35822f,_0x35211c,_0xd37fb1,_0x6e8505,_0xd2aa3a,_0x340e8c,_0x7e34('0x75'));})[_0x7e34('0x27')](function(_0x546647){if(_0x546647){logger[_0x7e34('0x2e')](_0x7e34('0x88'),_0x546647['id']);logger[_0x7e34('0x2e')](_0x7e34('0x7f'),_0x7e34('0x89'));emit(util[_0x7e34('0x67')](_0x7e34('0x8a'),_0x16bc34[_0x7e34('0x1a')]),_0x7e34('0x8b'),{'uri':'https://crm.'+_0x35211c['host']+_0x7e34('0x8c')+_0x546647['id']});}})['catch'](function(_0x32131b){logger[_0x7e34('0x2b')]('[QUEUE]',JSON['stringify'](_0x32131b));});};exports['outbound']=function(_0x5a8ce2,_0x54630b,_0x1720ad,_0x5cf4f5,_0x3eafc7,_0x203e05,_0x21f5ad){var _0x27d12f,_0x4181b9,_0x8d0792;_0x203e05[_0x7e34('0x7b')]=intUtil[_0x7e34('0x7c')](_0x203e05[_0x7e34('0x7b')]);_0x203e05[_0x7e34('0x7d')]=intUtil[_0x7e34('0x7c')](_0x203e05['serverUrl']);if(_0x21f5ad&&_0x21f5ad[_0x7e34('0x8d')]&&_0x21f5ad[_0x7e34('0x8d')]!==_0x7e34('0x8e')){logger[_0x7e34('0x2e')](_0x7e34('0x8f'),_0x7e34('0x80'));_0x54630b[_0x7e34('0x81')]=_0x203e05[_0x7e34('0x7d')]+_0x7e34('0x90')+_0x54630b[_0x7e34('0x82')]+_0x7e34('0x83')+md5(_0x54630b[_0x7e34('0x82')]);}var _0x14abc1=_0x203e05[_0x7e34('0x7b')]===_0x7e34('0x91')?'eu':'com';return getAccessToken(_0x203e05)[_0x7e34('0x27')](function(_0x41bbbc){_0x8d0792=_0x41bbbc;return getUser(_0x8d0792,_0x14abc1,_0x203e05,_0x5cf4f5[_0x7e34('0x34')]);})[_0x7e34('0x27')](function(_0x5aaadb){_0x27d12f=_0x5aaadb;logger[_0x7e34('0x2e')]('The\x20User\x20ID\x20is:',_0x27d12f['id']);return getEndUser(_0x8d0792,_0x14abc1,_0x203e05,_0x54630b[_0x7e34('0x92')],_0x54630b[_0x7e34('0x93')],_0x27d12f,_0x1720ad);})[_0x7e34('0x27')](function(_0x55c2a6){_0x4181b9=_0x55c2a6;return getCall(_0x8d0792,_0x14abc1,_0x203e05,_0x27d12f,_0x4181b9,_0x1720ad,_0x54630b,_0x7e34('0x94'));})[_0x7e34('0x27')](function(_0x416e1f){if(_0x416e1f){logger[_0x7e34('0x2e')](_0x7e34('0x88'),_0x416e1f['id']);logger[_0x7e34('0x2e')]('[OUTBOUND]',_0x7e34('0x89'));emit(util['format'](_0x7e34('0x8a'),_0x5cf4f5[_0x7e34('0x1a')]),'trigger:browser:url',{'uri':_0x7e34('0x95')+_0x203e05['host']+_0x7e34('0x8c')+_0x416e1f['id']});}})[_0x7e34('0x2a')](function(_0x2132cc){logger['error'](_0x7e34('0x8f'),JSON['stringify'](_0x2132cc));});};exports[_0x7e34('0x96')]=function(_0x1480ec,_0x41aa68,_0x2b12ae,_0x5830f0,_0x278589,_0x4b9816){var _0x10d684,_0x344652,_0x4ad855;_0x4b9816[_0x7e34('0x7b')]=intUtil[_0x7e34('0x7c')](_0x4b9816['host']);_0x4b9816['serverUrl']=intUtil[_0x7e34('0x7c')](_0x4b9816['serverUrl']);if(_0x278589&&_0x278589[_0x7e34('0x7e')]){logger[_0x7e34('0x2e')]('['+_0x41aa68['lastevent']['toUpperCase']()+']',_0x7e34('0x80'));_0x41aa68[_0x7e34('0x81')]=_0x4b9816[_0x7e34('0x7d')]+_0x7e34('0x90')+_0x41aa68[_0x7e34('0x82')]+_0x7e34('0x83')+md5(_0x41aa68[_0x7e34('0x82')]);}else{_0x41aa68[_0x7e34('0x81')]='';}var _0x1e8e12=_0x4b9816[_0x7e34('0x7b')]===_0x7e34('0x91')?'eu':_0x7e34('0x84');return getAccessToken(_0x4b9816)['then'](function(_0x32524c){_0x4ad855=_0x32524c;return getUser(_0x4ad855,_0x1e8e12,_0x4b9816);})[_0x7e34('0x27')](function(_0x70b6b0){_0x10d684=_0x70b6b0;logger[_0x7e34('0x2e')]('The\x20User\x20ID\x20is:',_0x10d684['id']);return getEndUser(_0x4ad855,_0x1e8e12,_0x4b9816,_0x41aa68[_0x7e34('0x86')],_0x41aa68['calleridnum'],_0x10d684,_0x2b12ae);})['then'](function(_0x24e779){_0x344652=_0x24e779;return getCall(_0x4ad855,_0x1e8e12,_0x4b9816,_0x10d684,_0x344652,_0x2b12ae,_0x41aa68,_0x7e34('0x75'));})['then'](function(_0x15a2a0){if(_0x15a2a0){logger['info'](_0x7e34('0x88'),_0x15a2a0['id']);}})[_0x7e34('0x2a')](function(_0x5aa4b){logger[_0x7e34('0x2b')]('['+_0x41aa68['lastevent'][_0x7e34('0x97')]()+']',JSON[_0x7e34('0xe')](_0x5aa4b));});}; \ No newline at end of file +var _0xed0b=['redis','defaults','localhost','socket.io-emitter','debug','stringify','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','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','refreshToken','clientSecret','refresh_token','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','ActiveUsers','then','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','enduserType','Error:\x20','catch','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','toUpperCase','calleridnum','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xed0b,0x1c8));var _0xbed0=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xed0b[_0x4c4037];return _0x357862;};'use strict';var _=require(_0xbed0('0x0'));var rp=require('request-promise');var md5=require(_0xbed0('0x1'));var util=require('util');var intUtil=require(_0xbed0('0x2'));var moment=require(_0xbed0('0x3'));var Redis=require(_0xbed0('0x4'));var BPromise=require(_0xbed0('0x5'));var config=require(_0xbed0('0x6'));var logger=require(_0xbed0('0x7'))(_0xbed0('0x8'));config[_0xbed0('0x9')]=_[_0xbed0('0xa')](config[_0xbed0('0x9')],{'host':_0xbed0('0xb'),'port':0x18eb});var io=require(_0xbed0('0xc'))(new Redis(config['redis']));function emit(_0x5f3cbe,_0x18dd6c,_0x29f3b8){io['to'](_0x5f3cbe)['emit'](_0x18dd6c,_0x29f3b8);}function request(_0x53c460){logger[_0xbed0('0xd')]('[HTTP]',JSON[_0xbed0('0xe')](_0x53c460));return rp(_0x53c460);}function getCustomFields(_0x331b52,_0x42b63f){var _0x13dad9={};if(_0x331b52['length']>0x0){_['forEach'](_0x331b52,function(_0x3664fc){if(_[_0xbed0('0xf')]([_0xbed0('0x10'),_0xbed0('0x11')],_0x3664fc['type'])&&_0x3664fc[_0xbed0('0x12')]){_0x13dad9[_0x3664fc['idField']]=_0x3664fc[_0xbed0('0x13')][_0xbed0('0x14')]();}else if(_0x3664fc[_0xbed0('0x15')]===_0xbed0('0x16')&&_0x3664fc[_0xbed0('0x17')]&&_0x3664fc[_0xbed0('0x12')]&&_0x42b63f[_0x3664fc[_0xbed0('0x17')]]){_0x13dad9[_0x3664fc[_0xbed0('0x12')]]=_0x42b63f[_0x3664fc[_0xbed0('0x17')]][_0xbed0('0x14')]();}else if(_0x3664fc['type']===_0xbed0('0x18')&&_0x3664fc[_0xbed0('0x19')]&&_0x3664fc[_0xbed0('0x19')]['name']&&_0x3664fc[_0xbed0('0x12')]&&_0x42b63f[_0x3664fc[_0xbed0('0x19')][_0xbed0('0x1a')]['toLowerCase']()]){_0x13dad9[_0x3664fc[_0xbed0('0x12')]]=_0x42b63f[_0x3664fc['Variable'][_0xbed0('0x1a')][_0xbed0('0x1b')]()][_0xbed0('0x14')]();}});}return _0x13dad9;}function getName(_0x44fd1e){if(_0x44fd1e[_0xbed0('0x1c')]('\x20')>0x0){var _0x4638a6=_0x44fd1e['split'](/ (.+)/);if(_0x4638a6[0x1]){return _0x4638a6;}}return[_0x44fd1e,_0x44fd1e];}var accountsTokens={};function getAccessToken(_0x57f3d0){return new Promise(function(_0x503b01,_0x481936){if(!_['isNil'](accountsTokens[_0x57f3d0['id']])&&!_[_0xbed0('0x1d')](accountsTokens[_0x57f3d0['id']][_0xbed0('0x1e')])){if(moment()[_0xbed0('0x1f')](accountsTokens[_0x57f3d0['id']][_0xbed0('0x20')])){_0x503b01(accountsTokens[_0x57f3d0['id']][_0xbed0('0x1e')]);}}var _0x90791;switch(_0x57f3d0['zone']){case'US':_0x90791=_0xbed0('0x21');break;case'AU':_0x90791=_0xbed0('0x22');break;case'EU':_0x90791='https://accounts.zoho.eu';break;case'IN':_0x90791=_0xbed0('0x23');break;case'CN':_0x90791=_0xbed0('0x24');break;default:_0x90791=_0xbed0('0x25');break;}var _0x55b276={'method':_0xbed0('0x26'),'uri':_0x90791+_0xbed0('0x27'),'qs':{'refresh_token':_0x57f3d0[_0xbed0('0x28')],'client_id':_0x57f3d0['clientId'],'client_secret':_0x57f3d0[_0xbed0('0x29')],'grant_type':_0xbed0('0x2a')},'json':!![]};return rp(_0x55b276)['then'](function(_0x1e46ab){accountsTokens[_0x57f3d0['id']]={'access_token':_0x1e46ab['access_token'],'expires_in':moment()[_0xbed0('0x2b')](_0x1e46ab[_0xbed0('0x20')],_0xbed0('0x2c'))};_0x503b01(_0x1e46ab[_0xbed0('0x1e')]);})['catch'](function(_0x3176df){logger[_0xbed0('0x2d')](_0xbed0('0x2e'),_0x3176df[_0xbed0('0x2f')]);_0x481936(_0x3176df);});});}function getUser(_0x2ad42f,_0x1df843,_0x1d5e92,_0x574705){logger[_0xbed0('0x30')](_0xbed0('0x31'));return request({'method':_0xbed0('0x32'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x1df843),'qs':{'type':_0xbed0('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ad42f},'json':!![]})[_0xbed0('0x34')](function(_0x3e11c0){if(_0x3e11c0[_0xbed0('0x35')]){var _0x433b81=-0x1;if(_[_0xbed0('0x36')](_0x3e11c0[_0xbed0('0x35')])){if(!_['isNil'](_0x574705)){_0x433b81=_['findIndex'](_0x3e11c0['users'],function(_0x22393e){return _0x22393e[_0xbed0('0x37')]===_0x574705;});}if(_0x433b81>=0x0){logger['info'](_0xbed0('0x38'));}else{logger[_0xbed0('0x30')](_0xbed0('0x39'));_0x433b81=_[_0xbed0('0x3a')](_0x3e11c0['users'],function(_0x1b95be){return _0x1b95be['profile'][_0xbed0('0x1a')]===_0xbed0('0x3b');});}return _0x3e11c0[_0xbed0('0x35')][_0x433b81];}else{if(_0x3e11c0[_0xbed0('0x3c')]['profile'][_0xbed0('0x1a')]==='Administrator'){logger[_0xbed0('0x30')](_0xbed0('0x39'));user=_0x3e11c0['user'];return user;}else{logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON['stringify'](_0x3e11c0));throw new Error(_0xbed0('0x3e')+JSON[_0xbed0('0xe')](_0x3e11c0));}}}else{logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON['stringify'](_0x3e11c0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x3e11c0));}})['catch'](function(_0x1d66be){console['error'](_0x1d66be);});}function getZohoUser(_0x2b8e0d,_0x3623f2){return new BPromise(function(_0x4e4ea4,_0x2697a1){request(_0x2b8e0d)[_0xbed0('0x34')](function(_0x59bf75){var _0x420f8=null;if(_0x59bf75){_0x420f8=_0x59bf75[_0xbed0('0x3f')][0x0];_0x420f8['enduserType']=_0x3623f2;}_0x4e4ea4(_0x420f8);})['catch'](function(_0x2089d4){_0x2697a1(_0x2089d4);});});}function createEndUser(_0x311b7c,_0x26a301,_0x1f6473,_0x429fc5,_0x462cb,_0x190627){var _0x1f6473=getName(_0x1f6473);return request({'method':_0xbed0('0x26'),'uri':'https://www.zohoapis.'+_0x26a301+_0xbed0('0x40')+_[_0xbed0('0x41')](_0x190627[_0xbed0('0x42')])+'s','body':{'data':[{'Last_Name':_0x1f6473[0x1],'First_Name':_0x1f6473[0x0],'Phone':_0x429fc5,'Owner':{'name':!_[_0xbed0('0x1d')](_0x462cb['role'][_0xbed0('0x1a')])?_0x462cb[_0xbed0('0x43')][_0xbed0('0x1a')]:!_[_0xbed0('0x1d')](_0x462cb[_0xbed0('0x44')])?_0x462cb[_0xbed0('0x44')]+'\x20'+_0x462cb['last_name']:_0x462cb[_0xbed0('0x45')],'id':_0x462cb['id']}}]},'headers':{'Authorization':_0xbed0('0x46')+_0x311b7c},'json':!![]})[_0xbed0('0x34')](function(_0x3616ec){if(_0x3616ec&&_0x3616ec[_0xbed0('0x3f')][0x0][_0xbed0('0x47')]===_0xbed0('0x48')){var _0x57ee9f=_0x3616ec[_0xbed0('0x3f')][0x0]['details'];_0x57ee9f[_0xbed0('0x49')]=_[_0xbed0('0x41')](_0x190627[_0xbed0('0x42')])+'s';return _0x57ee9f;}logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON[_0xbed0('0xe')](data));throw new Error(_0xbed0('0x4a')+JSON[_0xbed0('0xe')](data));})[_0xbed0('0x4b')](function(_0x2e9148){console[_0xbed0('0x4c')](_0xbed0('0x4d'),_0x2e9148);});}function getEndUser(_0x49ee9e,_0x3adea4,_0x299a60,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8){var _0x1a3e09={'method':_0xbed0('0x32'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x49ee9e},'json':!![]};switch(_0x5f20f8[_0xbed0('0x4e')]){case _0xbed0('0x4f'):_0x1a3e09[_0xbed0('0x50')]=_0xbed0('0x51')+_0x3adea4+_0xbed0('0x52')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x53'))[_0xbed0('0x34')](function(_0x2328b6){if(_0x2328b6)return _0x2328b6;_0x1a3e09[_0xbed0('0x50')]='https://www.zohoapis.'+_0x3adea4+_0xbed0('0x54')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x55'))[_0xbed0('0x34')](function(_0x4b7b10){if(_0x4b7b10)return _0x4b7b10;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});});break;case'contact':_0x1a3e09[_0xbed0('0x50')]=_0xbed0('0x51')+_0x3adea4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,'Contacts')[_0xbed0('0x34')](function(_0x3a6030){if(_0x3a6030)return _0x3a6030;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});break;case _0xbed0('0x57'):_0x1a3e09[_0xbed0('0x50')]='https://www.zohoapis.'+_0x3adea4+_0xbed0('0x54')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x55'))[_0xbed0('0x34')](function(_0x1a5d5e){if(_0x1a5d5e)return _0x1a5d5e;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});break;}}function getCall(_0x4cffda,_0x92e82e,_0x327cf9,_0x362e31,_0x5ef8c3,_0x3dbc2b,_0x52b582,_0x4a20b9){logger['info'](_0xbed0('0x58'));var _0x45c4d1={};_0x45c4d1[_0xbed0('0x59')]={'name':!_['isNil'](_0x362e31['role'][_0xbed0('0x1a')])&&!_[_0xbed0('0x1d')](_0x362e31['profile'][_0xbed0('0x1a')])&&_0x362e31[_0xbed0('0x5a')][_0xbed0('0x1a')]===_0xbed0('0x5b')?_0x362e31['role'][_0xbed0('0x1a')]:!_[_0xbed0('0x1d')](_0x362e31[_0xbed0('0x44')])?_0x362e31['first_name']+'\x20'+_0x362e31[_0xbed0('0x45')]:_0x362e31[_0xbed0('0x45')],'id':_0x362e31['id']};_0x45c4d1[_0xbed0('0x5c')]=intUtil['getString'](_0x3dbc2b[_0xbed0('0x5d')],_0x52b582,'\x20');_0x45c4d1[_0xbed0('0x5e')]=intUtil['getString'](_0x3dbc2b[_0xbed0('0x5f')],_0x52b582,'\x0a');if(_0x5ef8c3[_0xbed0('0x49')]==='Contacts'){_0x45c4d1['Who_Id']={'name':!_['isNil'](_0x5ef8c3['Full_Name'])?_0x5ef8c3[_0xbed0('0x60')]:!_['isNil'](_0x5ef8c3[_0xbed0('0x61')])?_0x5ef8c3['First_Name']+'\x20'+_0x5ef8c3['Last_Name']:_0x5ef8c3[_0xbed0('0x62')],'id':_0x5ef8c3['id']};}if(_0x5ef8c3['enduserType']===_0xbed0('0x55')){_0x45c4d1[_0xbed0('0x63')]={'name':!_[_0xbed0('0x1d')](_0x5ef8c3[_0xbed0('0x60')])?_0x5ef8c3['Full_Name']:!_['isNil'](_0x5ef8c3['First_Name'])?_0x5ef8c3['First_Name']+'\x20'+_0x5ef8c3[_0xbed0('0x62')]:_0x5ef8c3[_0xbed0('0x62')],'id':_0x5ef8c3['id']};_0x45c4d1[_0xbed0('0x64')]=_[_0xbed0('0x41')](_0x5ef8c3[_0xbed0('0x49')]);}if(_0x52b582[_0xbed0('0x65')]){_0x45c4d1[_0xbed0('0x66')]=moment[_0xbed0('0x67')](parseInt(_0x52b582[_0xbed0('0x65')])*0x3e8)[_0xbed0('0x68')](_0xbed0('0x69'));}else if(_0x52b582['answertime']&&_0x52b582[_0xbed0('0x6a')]){_0x45c4d1[_0xbed0('0x66')]=moment[_0xbed0('0x67')](moment(_0x52b582['endtime'],_0xbed0('0x6b'))[_0xbed0('0x6c')](moment(_0x52b582[_0xbed0('0x6d')],_0xbed0('0x6b'))))[_0xbed0('0x68')](_0xbed0('0x69'));}switch(_0x52b582['lastevent']){case'called':_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x6f');break;case _0xbed0('0x70'):case'connect':_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x71');break;case _0xbed0('0x72'):_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x73');break;case _0xbed0('0x74'):_0x45c4d1[_0xbed0('0x6e')]='Abandoned';break;case'timeout':_0x45c4d1[_0xbed0('0x6e')]='Timeout';default:}_0x45c4d1[_0xbed0('0x75')]=(_0x4a20b9===_0xbed0('0x76')?moment(_0x52b582['starttime'])[_0xbed0('0x68')](_0xbed0('0x6b')):moment(_0x52b582[_0xbed0('0x77')])[_0xbed0('0x68')](_0xbed0('0x6b')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x45c4d1[_0xbed0('0x78')]=_0x4a20b9||_0xbed0('0x79');_0x45c4d1=_['merge'](_0x45c4d1,getCustomFields(_0x3dbc2b[_0xbed0('0x7a')],_0x52b582));return request({'method':'POST','uri':_0xbed0('0x51')+_0x92e82e+_0xbed0('0x7b'),'headers':{'Authorization':_0xbed0('0x46')+_0x4cffda},'body':{'data':[_0x45c4d1]},'json':!![]})[_0xbed0('0x34')](function(_0x871233){if(_0x871233&&_0x871233[_0xbed0('0x3f')][0x0][_0xbed0('0x47')]==='SUCCESS'){logger[_0xbed0('0x30')]('Call\x20created!');return{'id':_0x871233['data'][0x0][_0xbed0('0x7c')]['id']};}})['catch'](function(_0x1eb5fd){logger[_0xbed0('0x30')]('err',_0x1eb5fd[_0xbed0('0x2f')]);console[_0xbed0('0x4c')](_0xbed0('0x7d'),_0x1eb5fd);});}exports[_0xbed0('0x7e')]=function(_0x22215d,_0x23a2a1,_0x6b3bfc,_0xa97396,_0x183feb,_0x5ca2b0){var _0xe2d530,_0x3e36d0,_0x2249de;_0x5ca2b0[_0xbed0('0x7f')]=intUtil['stripTrailingSlash'](_0x5ca2b0[_0xbed0('0x7f')]);_0x5ca2b0['serverUrl']=intUtil[_0xbed0('0x80')](_0x5ca2b0[_0xbed0('0x81')]);if(_0x183feb&&_0x183feb[_0xbed0('0x82')]){logger['info'](_0xbed0('0x83'),_0xbed0('0x84'));_0x23a2a1['recordingURL']=_0x5ca2b0[_0xbed0('0x81')]+_0xbed0('0x85')+_0x23a2a1[_0xbed0('0x86')]+_0xbed0('0x87')+md5(_0x23a2a1['uniqueid']);}else{_0x23a2a1[_0xbed0('0x88')]='';}var _0x542271=_0x5ca2b0[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':_0xbed0('0x8a');return getAccessToken(_0x5ca2b0)['then'](function(_0x34142a){_0x2249de=_0x34142a;return getUser(_0x2249de,_0x542271,_0x5ca2b0,_0xa97396[_0xbed0('0x37')]);})['then'](function(_0x392d3a){_0xe2d530=_0x392d3a;logger[_0xbed0('0x30')](_0xbed0('0x8b'),_0xe2d530['id']);return getEndUser(_0x2249de,_0x542271,_0x5ca2b0,_0x23a2a1[_0xbed0('0x8c')],_0x23a2a1['calleridnum'],_0xe2d530,_0x6b3bfc);})[_0xbed0('0x34')](function(_0x551ea5){_0x3e36d0=_0x551ea5;return getCall(_0x2249de,_0x542271,_0x5ca2b0,_0xe2d530,_0x3e36d0,_0x6b3bfc,_0x23a2a1,_0xbed0('0x79'));})['then'](function(_0x66f71f){if(_0x66f71f){logger[_0xbed0('0x30')](_0xbed0('0x8d'),_0x66f71f['id']);logger[_0xbed0('0x30')](_0xbed0('0x83'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbed0('0x68')](_0xbed0('0x8e'),_0xa97396[_0xbed0('0x1a')]),'trigger:browser:url',{'uri':_0xbed0('0x8f')+_0x5ca2b0['host']+_0xbed0('0x90')+_0x66f71f['id']});}})[_0xbed0('0x4b')](function(_0x2517c3){logger[_0xbed0('0x2d')](_0xbed0('0x83'),JSON[_0xbed0('0xe')](_0x2517c3));});};exports[_0xbed0('0x76')]=function(_0x4cc884,_0x3b5062,_0x464870,_0x5b50bb,_0x28b4d5,_0x16de8d,_0x4afde4){var _0x5dc935,_0x3ba27a,_0x12df93;_0x16de8d[_0xbed0('0x7f')]=intUtil['stripTrailingSlash'](_0x16de8d[_0xbed0('0x7f')]);_0x16de8d[_0xbed0('0x81')]=intUtil[_0xbed0('0x80')](_0x16de8d['serverUrl']);if(_0x4afde4&&_0x4afde4['recordingFormat']&&_0x4afde4[_0xbed0('0x91')]!==_0xbed0('0x92')){logger['info'](_0xbed0('0x93'),_0xbed0('0x84'));_0x3b5062[_0xbed0('0x88')]=_0x16de8d[_0xbed0('0x81')]+_0xbed0('0x85')+_0x3b5062[_0xbed0('0x86')]+_0xbed0('0x87')+md5(_0x3b5062['uniqueid']);}var _0x25ebfe=_0x16de8d[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':_0xbed0('0x8a');return getAccessToken(_0x16de8d)[_0xbed0('0x34')](function(_0x24d6e7){_0x12df93=_0x24d6e7;return getUser(_0x12df93,_0x25ebfe,_0x16de8d,_0x5b50bb[_0xbed0('0x37')]);})['then'](function(_0x509b1b){_0x5dc935=_0x509b1b;logger[_0xbed0('0x30')]('The\x20User\x20ID\x20is:',_0x5dc935['id']);return getEndUser(_0x12df93,_0x25ebfe,_0x16de8d,_0x3b5062[_0xbed0('0x94')],_0x3b5062[_0xbed0('0x95')],_0x5dc935,_0x464870);})[_0xbed0('0x34')](function(_0x109bed){_0x3ba27a=_0x109bed;return getCall(_0x12df93,_0x25ebfe,_0x16de8d,_0x5dc935,_0x3ba27a,_0x464870,_0x3b5062,_0xbed0('0x96'));})[_0xbed0('0x34')](function(_0x10cc89){if(_0x10cc89){logger[_0xbed0('0x30')]('The\x20Call\x20ID\x20is:',_0x10cc89['id']);logger[_0xbed0('0x30')](_0xbed0('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbed0('0x68')]('user:%s',_0x5b50bb['name']),_0xbed0('0x97'),{'uri':_0xbed0('0x8f')+_0x16de8d['host']+_0xbed0('0x90')+_0x10cc89['id']});}})[_0xbed0('0x4b')](function(_0x22532b){logger[_0xbed0('0x2d')](_0xbed0('0x93'),JSON[_0xbed0('0xe')](_0x22532b));});};exports[_0xbed0('0x98')]=function(_0x3842ad,_0x139c2e,_0x5d66a5,_0x2204c0,_0x392471,_0x23eb85){var _0xe453a6,_0x1e2135,_0x43fbd7;_0x23eb85[_0xbed0('0x7f')]=intUtil[_0xbed0('0x80')](_0x23eb85['host']);_0x23eb85[_0xbed0('0x81')]=intUtil[_0xbed0('0x80')](_0x23eb85[_0xbed0('0x81')]);if(_0x392471&&_0x392471['monitor_format']){logger['info']('['+_0x139c2e['lastevent'][_0xbed0('0x99')]()+']',_0xbed0('0x84'));_0x139c2e['recordingURL']=_0x23eb85[_0xbed0('0x81')]+_0xbed0('0x85')+_0x139c2e['uniqueid']+_0xbed0('0x87')+md5(_0x139c2e['uniqueid']);}else{_0x139c2e[_0xbed0('0x88')]='';}var _0x1493b0=_0x23eb85[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':'com';return getAccessToken(_0x23eb85)['then'](function(_0x4d8c5b){_0x43fbd7=_0x4d8c5b;return getUser(_0x43fbd7,_0x1493b0,_0x23eb85);})[_0xbed0('0x34')](function(_0x2ec08c){_0xe453a6=_0x2ec08c;logger[_0xbed0('0x30')](_0xbed0('0x8b'),_0xe453a6['id']);return getEndUser(_0x43fbd7,_0x1493b0,_0x23eb85,_0x139c2e['calleridname'],_0x139c2e[_0xbed0('0x9a')],_0xe453a6,_0x5d66a5);})[_0xbed0('0x34')](function(_0x31d155){_0x1e2135=_0x31d155;return getCall(_0x43fbd7,_0x1493b0,_0x23eb85,_0xe453a6,_0x1e2135,_0x5d66a5,_0x139c2e,_0xbed0('0x79'));})[_0xbed0('0x34')](function(_0x43ca20){if(_0x43ca20){logger[_0xbed0('0x30')]('The\x20Call\x20ID\x20is:',_0x43ca20['id']);}})['catch'](function(_0x434548){logger[_0xbed0('0x2d')]('['+_0x139c2e['lastevent'][_0xbed0('0x99')]()+']',JSON[_0xbed0('0xe')](_0x434548));});}; \ 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 6e1181c..05a1939 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 _0x104f=['Script','render','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','data2'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x104f,0x1b9));var _0xf104=function(_0x3cf301,_0x10ca52){_0x3cf301=_0x3cf301-0x0;var _0x2301bc=_0x104f[_0x3cf301];return _0x2301bc;};'use strict';var util=require(_0xf104('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xf104('0x1'))('trigger');exports['exec']=function(_0x2b7ea4,_0x522bda){var _0x192861=_0x2b7ea4[_0xf104('0x2')]?_0x2b7ea4['data2']:_0xf104('0x3');var _0x478b4c=_0x2b7ea4['data3']?Mustache[_0xf104('0x4')](_0x2b7ea4[_0xf104('0x5')],_0x522bda):_0x522bda;sh[_0xf104('0x6')](_0x478b4c,function(_0x160143,_0x2a04a5,_0x2b2f26){if(_0x160143!==0x0){logger[_0xf104('0x7')](util[_0xf104('0x8')](_0xf104('0x9'),_0x192861,_0x478b4c,_0x160143,_0x2b2f26));}else{logger[_0xf104('0xa')](util[_0xf104('0x8')](_0xf104('0xb'),_0x192861,_0x478b4c,_0x2a04a5));}});}; \ No newline at end of file +var _0x3691=['exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger'];(function(_0x3a642f,_0x3ae0d8){var _0x2163a2=function(_0xbda17d){while(--_0xbda17d){_0x3a642f['push'](_0x3a642f['shift']());}};_0x2163a2(++_0x3ae0d8);}(_0x3691,0x128));var _0x1369=function(_0x1f85e8,_0x5d20b1){_0x1f85e8=_0x1f85e8-0x0;var _0x55201a=_0x3691[_0x1f85e8];return _0x55201a;};'use strict';var util=require(_0x1369('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x1369('0x1'))(_0x1369('0x2'));exports[_0x1369('0x3')]=function(_0x9977e0,_0x25e6ea){var _0x210571=_0x9977e0['data2']?_0x9977e0[_0x1369('0x4')]:_0x1369('0x5');var _0x158bbc=_0x9977e0[_0x1369('0x6')]?Mustache[_0x1369('0x7')](_0x9977e0[_0x1369('0x6')],_0x25e6ea):_0x25e6ea;sh[_0x1369('0x3')](_0x158bbc,function(_0x1241eb,_0x42b5a6,_0x1073e7){if(_0x1241eb!==0x0){logger[_0x1369('0x8')](util[_0x1369('0x9')](_0x1369('0xa'),_0x210571,_0x158bbc,_0x1241eb,_0x1073e7));}else{logger[_0x1369('0xb')](util[_0x1369('0x9')](_0x1369('0xc'),_0x210571,_0x158bbc,_0x42b5a6));}});}; \ 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 0883f7a..be5d6ef 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 _0xaa84=['data6','parse','stack','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','data1','stringify','then','isNil','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','mustache','exec','toUpperCase','render','data2','data5','number','headers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaa84,0xab));var _0x4aa8=function(_0x39445c,_0xded558){_0x39445c=_0x39445c-0x0;var _0x370d51=_0xaa84[_0x39445c];return _0x370d51;};'use strict';var rp=require('request-promise');var util=require(_0x4aa8('0x0'));var _=require('lodash');var Mustache=require(_0x4aa8('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x4aa8('0x2')]=function(_0x1a6b11,_0x51d0b8){var _0x50b4f7,_0x5af710;var _0x331e85={'method':_0x1a6b11['data1'][_0x4aa8('0x3')](),'uri':Mustache[_0x4aa8('0x4')](_0x1a6b11[_0x4aa8('0x5')],_0x51d0b8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1a6b11[_0x4aa8('0x6')])===_0x4aa8('0x7')&&parseInt(_0x1a6b11[_0x4aa8('0x6')])>=0x1&&parseInt(_0x1a6b11['data5'])<=0xa?parseInt(_0x1a6b11['data5'])*0x3e8:0x5*0x3e8};try{_0x331e85[_0x4aa8('0x8')]=_0x1a6b11[_0x4aa8('0x9')]?JSON[_0x4aa8('0xa')](Mustache[_0x4aa8('0x4')](_0x1a6b11[_0x4aa8('0x9')],_0x51d0b8)):{};}catch(_0x334566){logger['error'](_0x334566[_0x4aa8('0xb')]);}switch(_0x1a6b11['data1'][_0x4aa8('0x3')]()){case'GET':case'DELETE':_0x50b4f7=null;_0x331e85['qs']=_0x51d0b8;break;case _0x4aa8('0xc'):case _0x4aa8('0xd'):if(_0x1a6b11['data7']){try{_0x50b4f7=JSON['parse'](Mustache[_0x4aa8('0x4')](_0x1a6b11[_0x4aa8('0xe')],_0x51d0b8));_0x331e85[_0x4aa8('0xf')]=_0x50b4f7;}catch(_0x44d184){logger[_0x4aa8('0x10')](_0x44d184[_0x4aa8('0xb')]);logger[_0x4aa8('0x10')](_0x4aa8('0x11'));}}else{_0x50b4f7=_0x51d0b8;_0x331e85['body']=_0x50b4f7;}break;}logger[_0x4aa8('0x12')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1a6b11[_0x4aa8('0x13')],_0x1a6b11[_0x4aa8('0x5')],JSON[_0x4aa8('0x14')](_0x331e85)));rp(_0x331e85)[_0x4aa8('0x15')](function(_0x3accf6){_0x50b4f7=!_[_0x4aa8('0x16')](_0x50b4f7)?',\x20request\x20body:\x20'+_0x50b4f7:'';_0x5af710=typeof _0x3accf6[_0x4aa8('0xf')]==='object'?JSON[_0x4aa8('0x14')](_0x3accf6[_0x4aa8('0xf')]):_0x3accf6[_0x4aa8('0xf')];logger[_0x4aa8('0x12')](util[_0x4aa8('0x17')](_0x4aa8('0x18'),_0x1a6b11[_0x4aa8('0x13')],_0x1a6b11['data2'],_0x3accf6['statusCode'],_0x5af710));})[_0x4aa8('0x19')](function(_0xa2ec55){logger['error'](util['format'](_0x4aa8('0x1a'),_0x1a6b11[_0x4aa8('0x13')],_0x1a6b11[_0x4aa8('0x5')],_0xa2ec55[_0x4aa8('0x1b')],_0xa2ec55[_0x4aa8('0x1c')],_0xa2ec55[_0x4aa8('0x1d')]));});}; \ No newline at end of file +var _0x001a=['message','request-promise','mustache','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','error','stack','GET','DELETE','POST','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x54be74,_0x37c908){var _0x47da47=function(_0x233b4b){while(--_0x233b4b){_0x54be74['push'](_0x54be74['shift']());}};_0x47da47(++_0x37c908);}(_0x001a,0x101));var _0xa001=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x001a[_0x3fe6df];return _0x372a0e;};'use strict';var rp=require(_0xa001('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0xa001('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0xa001('0x2')]=function(_0x6146c,_0xe94910){var _0x427506,_0x48c2ed;var _0x354815={'method':_0x6146c[_0xa001('0x3')][_0xa001('0x4')](),'uri':Mustache['render'](_0x6146c[_0xa001('0x5')],_0xe94910),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x6146c[_0xa001('0x6')])===_0xa001('0x7')&&parseInt(_0x6146c[_0xa001('0x6')])>=0x1&&parseInt(_0x6146c['data5'])<=0xa?parseInt(_0x6146c[_0xa001('0x6')])*0x3e8:0x5*0x3e8};try{_0x354815[_0xa001('0x8')]=_0x6146c[_0xa001('0x9')]?JSON[_0xa001('0xa')](Mustache[_0xa001('0xb')](_0x6146c[_0xa001('0x9')],_0xe94910)):{};}catch(_0x22436d){logger[_0xa001('0xc')](_0x22436d[_0xa001('0xd')]);}switch(_0x6146c[_0xa001('0x3')][_0xa001('0x4')]()){case _0xa001('0xe'):case _0xa001('0xf'):_0x427506=null;_0x354815['qs']=_0xe94910;break;case _0xa001('0x10'):case'PUT':if(_0x6146c['data7']){try{_0x427506=JSON[_0xa001('0xa')](Mustache['render'](_0x6146c['data7'],_0xe94910));_0x354815[_0xa001('0x11')]=_0x427506;}catch(_0x15b4f0){logger[_0xa001('0xc')](_0x15b4f0['stack']);logger[_0xa001('0xc')](_0xa001('0x12'));}}else{_0x427506=_0xe94910;_0x354815[_0xa001('0x11')]=_0x427506;}break;}logger[_0xa001('0x13')](util[_0xa001('0x14')](_0xa001('0x15'),_0x6146c['data1'],_0x6146c[_0xa001('0x5')],JSON[_0xa001('0x16')](_0x354815)));rp(_0x354815)['then'](function(_0x534908){_0x427506=!_[_0xa001('0x17')](_0x427506)?_0xa001('0x18')+_0x427506:'';_0x48c2ed=typeof _0x534908[_0xa001('0x11')]===_0xa001('0x19')?JSON['stringify'](_0x534908['body']):_0x534908['body'];logger[_0xa001('0x13')](util[_0xa001('0x14')](_0xa001('0x1a'),_0x6146c['data1'],_0x6146c['data2'],_0x534908[_0xa001('0x1b')],_0x48c2ed));})[_0xa001('0x1c')](function(_0xf52f6c){logger[_0xa001('0xc')](util[_0xa001('0x14')](_0xa001('0x1d'),_0x6146c[_0xa001('0x3')],_0x6146c[_0xa001('0x5')],_0xf52f6c[_0xa001('0x1b')],_0xf52f6c[_0xa001('0x1e')],_0xf52f6c[_0xa001('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9a72771..81fdb02 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 _0x4db3=['catch','rpc','exports','jayson/promise','../../config/logger','routing','client','http','request','then','debug','error','message','result'];(function(_0x2ee877,_0x517e59){var _0x1aa911=function(_0x17aa90){while(--_0x17aa90){_0x2ee877['push'](_0x2ee877['shift']());}};_0x1aa911(++_0x517e59);}(_0x4db3,0x18b));var _0x34db=function(_0x101bd4,_0x140f40){_0x101bd4=_0x101bd4-0x0;var _0xf60bc3=_0x4db3[_0x101bd4];return _0xf60bc3;};'use strict';var jayson=require(_0x34db('0x0'));var BPromise=require('bluebird');var logger=require(_0x34db('0x1'))(_0x34db('0x2'));var client=jayson[_0x34db('0x3')][_0x34db('0x4')]({'port':0x2329});client['Request']=function(_0x807efe,_0x1759c5){return new BPromise(function(_0x31be32,_0x6ec0d){return client[_0x34db('0x5')](_0x807efe,_0x1759c5)[_0x34db('0x6')](function(_0x1a367f){logger[_0x34db('0x7')]('rpc','routing',_0x807efe,_0x1759c5,_0x1a367f);if(_0x1a367f[_0x34db('0x8')]){logger['error']('rpc',_0x34db('0x2'),_0x807efe,_0x1a367f[_0x34db('0x8')][_0x34db('0x9')],_0x1759c5);return _0x6ec0d(_0x1a367f[_0x34db('0x8')]['message']);}else{return _0x31be32(_0x1a367f[_0x34db('0xa')]);}})[_0x34db('0xb')](function(_0x46a713){logger['error'](_0x34db('0xc'),'routing',_0x807efe,_0x46a713,_0x1759c5);return _0x6ec0d(_0x46a713);});});};module[_0x34db('0xd')]=client; \ No newline at end of file +var _0x13f3=['routing','client','request','debug','rpc','error','message','result','exports','jayson/promise','bluebird'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x13f3,0x111));var _0x313f=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x13f3[_0x1ebc6c];return _0x3a826d;};'use strict';var jayson=require(_0x313f('0x0'));var BPromise=require(_0x313f('0x1'));var logger=require('../../config/logger')(_0x313f('0x2'));var client=jayson[_0x313f('0x3')]['http']({'port':0x2329});client['Request']=function(_0x11b81d,_0xc8503e){return new BPromise(function(_0x3c64b5,_0x2bb34a){return client[_0x313f('0x4')](_0x11b81d,_0xc8503e)['then'](function(_0x48af0d){logger[_0x313f('0x5')](_0x313f('0x6'),'routing',_0x11b81d,_0xc8503e,_0x48af0d);if(_0x48af0d[_0x313f('0x7')]){logger[_0x313f('0x7')]('rpc',_0x313f('0x2'),_0x11b81d,_0x48af0d[_0x313f('0x7')]['message'],_0xc8503e);return _0x2bb34a(_0x48af0d[_0x313f('0x7')][_0x313f('0x8')]);}else{return _0x3c64b5(_0x48af0d[_0x313f('0x9')]);}})['catch'](function(_0x31a8cc){logger[_0x313f('0x7')](_0x313f('0x6'),_0x313f('0x2'),_0x11b81d,_0x31a8cc,_0xc8503e);return _0x2bb34a(_0x31a8cc);});});};module[_0x313f('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 8debbde..56965ac 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 _0xbfd4=['refresh','listen','getSettings','loginMailFrequency','catch','error','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','resolve','then'];(function(_0x2d4e50,_0x3bfea8){var _0x29f481=function(_0x13f0bd){while(--_0x13f0bd){_0x2d4e50['push'](_0x2d4e50['shift']());}};_0x29f481(++_0x3bfea8);}(_0xbfd4,0x158));var _0x4bfd=function(_0x48fbbe,_0x2fc84f){_0x48fbbe=_0x48fbbe-0x0;var _0x2beef3=_0xbfd4[_0x48fbbe];return _0x2beef3;};'use strict';var server=require(_0x4bfd('0x0'));var Realtime=require(_0x4bfd('0x1'));var EmailChannel=require(_0x4bfd('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x4bfd('0x3'));var logger=require(_0x4bfd('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x4bfd('0x5')]()['then'](mailAccount['getMailAccounts']())[_0x4bfd('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0x4bfd('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x4bfd('0x8')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x4bfd('0x9')]();})['then'](function(_0x29e109){return setInterval(initRealtime,_0x29e109[_0x4bfd('0xa')]*0x3e8);})[_0x4bfd('0xb')](function(_0x3f389d){logger[_0x4bfd('0xc')]('Email\x20service\x20initialization',_0x3f389d);});}main(); \ No newline at end of file +var _0xdb42=['./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error'];(function(_0x4c0bfb,_0x34f5fa){var _0x2a8a18=function(_0x5dd0ce){while(--_0x5dd0ce){_0x4c0bfb['push'](_0x4c0bfb['shift']());}};_0x2a8a18(++_0x34f5fa);}(_0xdb42,0x195));var _0x2db4=function(_0xff32a0,_0x5c2abd){_0xff32a0=_0xff32a0-0x0;var _0x28e253=_0xdb42[_0xff32a0];return _0x28e253;};'use strict';var server=require(_0x2db4('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x2db4('0x1'));var mailAccount=require(_0x2db4('0x2'));var setting=require(_0x2db4('0x3'));var logger=require(_0x2db4('0x4'))(_0x2db4('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x2db4('0x6')](mailAccount[_0x2db4('0x7')]())['then'](realtime['initMailAccounts']())[_0x2db4('0x6')](function(){email[_0x2db4('0x8')](realtime[_0x2db4('0x9')]);return realtime;});}function main(){return server[_0x2db4('0xa')](realtime,email)[_0x2db4('0x6')](function(){return initRealtime();})[_0x2db4('0x6')](function(){return setting[_0x2db4('0xb')]();})[_0x2db4('0x6')](function(_0x276e2f){return setInterval(initRealtime,_0x276e2f[_0x2db4('0xc')]*0x3e8);})[_0x2db4('0xd')](function(_0x45eb50){logger[_0x2db4('0xe')]('Email\x20service\x20initialization',_0x45eb50);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 14607a4..e136aaa 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 _0xee01=['hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','disabled','connected','messages','firstName','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verified','catch','verify','lodash','moment','bluebird','md5','../../../config/logger','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','mailAccount:update','refresh','service','provider'];(function(_0x1af11f,_0x1ea9da){var _0x1a1b50=function(_0x3c3d8b){while(--_0x3c3d8b){_0x1af11f['push'](_0x1af11f['shift']());}};_0x1a1b50(++_0x1ea9da);}(_0xee01,0x89));var _0x1ee0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee01[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1ee0('0x0'));var moment=require(_0x1ee0('0x1'));var BPromise=require(_0x1ee0('0x2'));var md5=require(_0x1ee0('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1ee0('0x4'))('email');config[_0x1ee0('0x5')]=_[_0x1ee0('0x6')](config[_0x1ee0('0x5')],{'host':_0x1ee0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x1ee0('0x8'));var EmailSmtp=require(_0x1ee0('0x9'));var mailAccount=require(_0x1ee0('0xa'));var md5Accounts={};function EmailChannel(_0x4111bc){logger[_0x1ee0('0xb')]('start\x20email\x20channel');this[_0x1ee0('0xc')]=_0x4111bc[_0x1ee0('0xc')];this[_0x1ee0('0xd')]={};this[_0x1ee0('0xe')]=new EmailSmtp();}EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x10')]=function(_0x1967fb){var _0x419dad=this[_0x1ee0('0xc')][_0x1967fb];var _0x49c10e={'id':_0x419dad['id'],'name':_0x419dad[_0x1ee0('0x11')],'key':_0x419dad['key'],'active':_0x419dad[_0x1ee0('0x12')],'Imap':{'status':_0x419dad[_0x1ee0('0x13')][_0x1ee0('0x14')],'messageStatus':_0x419dad[_0x1ee0('0x13')][_0x1ee0('0x15')],'total':_0x419dad[_0x1ee0('0x13')][_0x1ee0('0x16')]}};if(_[_0x1ee0('0x17')](md5Accounts[_0x1967fb])){md5Accounts[_0x1967fb]={};}var _0x3520c5=md5(JSON['stringify'](_0x49c10e));if(md5Accounts[_0x1967fb][_0x1ee0('0x3')]!==_0x3520c5){md5Accounts[_0x1967fb]['md5']=_0x3520c5;io[_0x1ee0('0x10')](_0x1ee0('0x18'),_0x49c10e);}};EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x19')]=function(_0x2e356d){for(var _0x5c0020 in _0x2e356d){if(_0x2e356d['hasOwnProperty'](_0x5c0020)){if(_0x2e356d[_0x5c0020][_0x1ee0('0x13')]&&_0x2e356d[_0x5c0020][_0x1ee0('0x12')]){var _0x1737a0=_0x2e356d[_0x5c0020][_0x1ee0('0x13')];if(!_0x1737a0[_0x1ee0('0x1a')]&&_0x2e356d[_0x5c0020][_0x1ee0('0x1b')]!=='custom')_0x1737a0['service']=_0x2e356d[_0x5c0020][_0x1ee0('0x1b')];if(!this[_0x1ee0('0xd')][_0x1ee0('0x1c')](_0x1737a0['id'])){this['imapAccounts'][_0x1737a0['id']]=new EmailImap(_0x1737a0,_0x2e356d[_0x5c0020][_0x1ee0('0x1d')]);this['imapAccounts'][_0x1737a0['id']]['on'](_0x1ee0('0x1e'),this[_0x1ee0('0x1f')][_0x1ee0('0x20')](this,_0x5c0020));this[_0x1ee0('0xd')][_0x1737a0['id']]['on'](_0x1ee0('0x1d'),this[_0x1ee0('0x21')][_0x1ee0('0x20')](this,_0x5c0020));this[_0x1ee0('0xd')][_0x1737a0['id']]['on'](_0x1ee0('0x22'),this[_0x1ee0('0x23')][_0x1ee0('0x20')](this,_0x5c0020));this[_0x1ee0('0xd')][_0x1737a0['id']]['on']('error',this['handleImapError']['bind'](this,_0x5c0020));}}else{if(_[_0x1ee0('0x17')](this['mailAccounts'][_0x5c0020]['Imap'])){this[_0x1ee0('0xc')][_0x5c0020][_0x1ee0('0x13')]={};}this['mailAccounts'][_0x5c0020]['Imap'][_0x1ee0('0x14')]=_0x1ee0('0x24');this[_0x1ee0('0xc')][_0x5c0020][_0x1ee0('0x13')][_0x1ee0('0x15')]='';this['emit'](_0x5c0020);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x35432d,_0x529c17){if(this[_0x1ee0('0xc')][_0x35432d]){this[_0x1ee0('0xc')][_0x35432d][_0x1ee0('0x13')]['status']=_0x1ee0('0x25');this[_0x1ee0('0xc')][_0x35432d][_0x1ee0('0x13')][_0x1ee0('0x15')]=_0x529c17['name'];if(_0x529c17[_0x1ee0('0x26')]){this[_0x1ee0('0xc')][_0x35432d]['Imap'][_0x1ee0('0x16')]=_0x529c17[_0x1ee0('0x26')]['total'];}return this[_0x1ee0('0x10')](_0x35432d);}};EmailChannel['prototype'][_0x1ee0('0x21')]=function(_0x3cba86,_0x5de82a){logger[_0x1ee0('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5de82a[_0x1ee0('0x27')],_0x5de82a['lastName'],_0x5de82a['from'],_0x3cba86);if(this[_0x1ee0('0xc')][_0x3cba86]){return mailAccount[_0x1ee0('0x28')](_0x3cba86,_0x5de82a)[_0x1ee0('0x29')](function(_0x3d849e){if(_0x3d849e){logger['info'](_0x1ee0('0x2a'));}})['catch'](function(_0x159517){logger[_0x1ee0('0x2b')](_0x1ee0('0x2c'),JSON[_0x1ee0('0x2d')](_0x159517));});}};EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x23')]=function(_0x582129){if(this['mailAccounts'][_0x582129]&&this['mailAccounts'][_0x582129][_0x1ee0('0x13')]){if(this[_0x1ee0('0xd')][this[_0x1ee0('0xc')][_0x582129][_0x1ee0('0x13')]['id']]){delete this[_0x1ee0('0xd')][this['mailAccounts'][_0x582129]['Imap']['id']];}this[_0x1ee0('0xc')][_0x582129]['Imap'][_0x1ee0('0x2e')]=moment();this[_0x1ee0('0x10')](_0x582129);}};EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x2f')]=function(_0x448aed,_0x473582){if(this[_0x1ee0('0xc')][_0x448aed]){this[_0x1ee0('0xc')][_0x448aed]['Imap']['status']=_0x1ee0('0x2b');this[_0x1ee0('0xc')][_0x448aed]['Imap'][_0x1ee0('0x15')]=_0x473582;return this[_0x1ee0('0x10')](_0x448aed);}};EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x30')]=function(_0x519344,_0x896a31){return this['smtp'][_0x1ee0('0x31')](_0x519344,_0x896a31);};EmailChannel[_0x1ee0('0xf')][_0x1ee0('0x32')]=function(_0x4c3196){var _0x39c2b5=this;if(this['mailAccounts'][_0x4c3196['id']]){if(_['isNil'](this[_0x1ee0('0xc')][_0x4c3196['id']]['Smtp'])){this['mailAccounts'][_0x4c3196['id']][_0x1ee0('0x33')]={};}this['mailAccounts'][_0x4c3196['id']][_0x1ee0('0x33')][_0x1ee0('0x2e')]=moment();return new BPromise(function(_0x48a6a8,_0x429566){return _0x39c2b5[_0x1ee0('0xe')]['verify'](_0x4c3196)['then'](function(_0x5e27ec){_0x39c2b5[_0x1ee0('0xc')][_0x4c3196['id']][_0x1ee0('0x33')][_0x1ee0('0x14')]=_0x1ee0('0x34');_0x39c2b5['mailAccounts'][_0x4c3196['id']][_0x1ee0('0x33')]['messageStatus']='';_0x39c2b5['emit'](_0x4c3196['id']);_0x48a6a8(_0x5e27ec);})[_0x1ee0('0x35')](function(_0x44780b){_0x39c2b5[_0x1ee0('0xc')][_0x4c3196['id']][_0x1ee0('0x33')][_0x1ee0('0x14')]='error';_0x39c2b5[_0x1ee0('0xc')][_0x4c3196['id']]['Smtp']['messageStatus']=_0x44780b;_0x39c2b5[_0x1ee0('0x10')](_0x4c3196['id']);_0x429566(_0x44780b);});});}return this[_0x1ee0('0xe')][_0x1ee0('0x36')](_0x4c3196);};module['exports']=EmailChannel; \ No newline at end of file +var _0x6ca0=['moment','bluebird','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','emit','active','Imap','status','total','isNil','md5','mailAccount:update','prototype','refresh','service','provider','imapAccounts','box','bind','handleImapEmail','handleImapError','disabled','handleImapBox','name','messages','lastName','from','notify','then','info','Mail\x20accepted\x20from\x20routing','error','handleImapEnd','messageStatus','send','Smtp','lastSync','verify','verified','catch','exports','lodash'];(function(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x6ca0,0x67));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var moment=require(_0x06ca('0x1'));var BPromise=require(_0x06ca('0x2'));var md5=require('md5');var Redis=require(_0x06ca('0x3'));var config=require('../../../config/environment');var logger=require(_0x06ca('0x4'))(_0x06ca('0x5'));config['redis']=_[_0x06ca('0x6')](config[_0x06ca('0x7')],{'host':_0x06ca('0x8'),'port':0x18eb});var io=require(_0x06ca('0x9'))(new Redis(config[_0x06ca('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x06ca('0xa'));var mailAccount=require(_0x06ca('0xb'));var md5Accounts={};function EmailChannel(_0x5034c0){logger['info'](_0x06ca('0xc'));this[_0x06ca('0xd')]=_0x5034c0[_0x06ca('0xd')];this['imapAccounts']={};this[_0x06ca('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x06ca('0xf')]=function(_0x5d1354){var _0x5ce498=this[_0x06ca('0xd')][_0x5d1354];var _0x5c7f83={'id':_0x5ce498['id'],'name':_0x5ce498['name'],'key':_0x5ce498['key'],'active':_0x5ce498[_0x06ca('0x10')],'Imap':{'status':_0x5ce498[_0x06ca('0x11')][_0x06ca('0x12')],'messageStatus':_0x5ce498[_0x06ca('0x11')]['messageStatus'],'total':_0x5ce498[_0x06ca('0x11')][_0x06ca('0x13')]}};if(_[_0x06ca('0x14')](md5Accounts[_0x5d1354])){md5Accounts[_0x5d1354]={};}var _0x265691=md5(JSON['stringify'](_0x5c7f83));if(md5Accounts[_0x5d1354][_0x06ca('0x15')]!==_0x265691){md5Accounts[_0x5d1354]['md5']=_0x265691;io[_0x06ca('0xf')](_0x06ca('0x16'),_0x5c7f83);}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x18')]=function(_0x3401d5){for(var _0xb75a7c in _0x3401d5){if(_0x3401d5['hasOwnProperty'](_0xb75a7c)){if(_0x3401d5[_0xb75a7c]['Imap']&&_0x3401d5[_0xb75a7c][_0x06ca('0x10')]){var _0x3571c8=_0x3401d5[_0xb75a7c][_0x06ca('0x11')];if(!_0x3571c8[_0x06ca('0x19')]&&_0x3401d5[_0xb75a7c]['provider']!=='custom')_0x3571c8[_0x06ca('0x19')]=_0x3401d5[_0xb75a7c][_0x06ca('0x1a')];if(!this[_0x06ca('0x1b')]['hasOwnProperty'](_0x3571c8['id'])){this[_0x06ca('0x1b')][_0x3571c8['id']]=new EmailImap(_0x3571c8,_0x3401d5[_0xb75a7c][_0x06ca('0x5')]);this[_0x06ca('0x1b')][_0x3571c8['id']]['on'](_0x06ca('0x1c'),this['handleImapBox'][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on'](_0x06ca('0x5'),this[_0x06ca('0x1e')][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on']('end',this['handleImapEnd'][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on']('error',this[_0x06ca('0x1f')][_0x06ca('0x1d')](this,_0xb75a7c));}}else{if(_['isNil'](this['mailAccounts'][_0xb75a7c][_0x06ca('0x11')])){this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')]={};}this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')][_0x06ca('0x12')]=_0x06ca('0x20');this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')]['messageStatus']='';this['emit'](_0xb75a7c);}}}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x21')]=function(_0x500193,_0x237583){if(this[_0x06ca('0xd')][_0x500193]){this[_0x06ca('0xd')][_0x500193][_0x06ca('0x11')][_0x06ca('0x12')]='connected';this[_0x06ca('0xd')][_0x500193]['Imap']['messageStatus']=_0x237583[_0x06ca('0x22')];if(_0x237583[_0x06ca('0x23')]){this[_0x06ca('0xd')][_0x500193][_0x06ca('0x11')][_0x06ca('0x13')]=_0x237583['messages'][_0x06ca('0x13')];}return this[_0x06ca('0xf')](_0x500193);}};EmailChannel[_0x06ca('0x17')]['handleImapEmail']=function(_0x436d19,_0x3b09fc){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3b09fc['firstName'],_0x3b09fc[_0x06ca('0x24')],_0x3b09fc[_0x06ca('0x25')],_0x436d19);if(this[_0x06ca('0xd')][_0x436d19]){return mailAccount[_0x06ca('0x26')](_0x436d19,_0x3b09fc)[_0x06ca('0x27')](function(_0x32b56c){if(_0x32b56c){logger[_0x06ca('0x28')](_0x06ca('0x29'));}})['catch'](function(_0x45e01e){logger[_0x06ca('0x2a')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x45e01e));});}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x2b')]=function(_0x55885e){if(this[_0x06ca('0xd')][_0x55885e]&&this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]){if(this[_0x06ca('0x1b')][this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]['id']]){delete this[_0x06ca('0x1b')][this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]['id']];}this[_0x06ca('0xd')][_0x55885e]['Imap']['lastSync']=moment();this[_0x06ca('0xf')](_0x55885e);}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x1f')]=function(_0x585858,_0x2fc20e){if(this[_0x06ca('0xd')][_0x585858]){this[_0x06ca('0xd')][_0x585858][_0x06ca('0x11')][_0x06ca('0x12')]='error';this[_0x06ca('0xd')][_0x585858][_0x06ca('0x11')][_0x06ca('0x2c')]=_0x2fc20e;return this['emit'](_0x585858);}};EmailChannel[_0x06ca('0x17')]['sendMail']=function(_0x12f5a5,_0x186e04){return this[_0x06ca('0xe')][_0x06ca('0x2d')](_0x12f5a5,_0x186e04);};EmailChannel['prototype']['verifySmtp']=function(_0xe4d359){var _0x455735=this;if(this[_0x06ca('0xd')][_0xe4d359['id']]){if(_[_0x06ca('0x14')](this[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')])){this[_0x06ca('0xd')][_0xe4d359['id']]['Smtp']={};}this['mailAccounts'][_0xe4d359['id']]['Smtp'][_0x06ca('0x2f')]=moment();return new BPromise(function(_0x4795fd,_0x280f70){return _0x455735[_0x06ca('0xe')][_0x06ca('0x30')](_0xe4d359)[_0x06ca('0x27')](function(_0x57125b){_0x455735[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x12')]=_0x06ca('0x31');_0x455735['mailAccounts'][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x2c')]='';_0x455735[_0x06ca('0xf')](_0xe4d359['id']);_0x4795fd(_0x57125b);})[_0x06ca('0x32')](function(_0x267a15){_0x455735[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x12')]=_0x06ca('0x2a');_0x455735['mailAccounts'][_0xe4d359['id']]['Smtp'][_0x06ca('0x2c')]=_0x267a15;_0x455735[_0x06ca('0xf')](_0xe4d359['id']);_0x280f70(_0x267a15);});});}return this[_0x06ca('0xe')][_0x06ca('0x30')](_0xe4d359);};module[_0x06ca('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 03993fa..2a65862 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 _0x0ace=['ready','handleReady','end','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','service','user','xoauth2','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','error','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','handleFetchEnd','handleCloseBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','once'];(function(_0x5841ba,_0x5ebe8e){var _0x259000=function(_0x3c2eef){while(--_0x3c2eef){_0x5841ba['push'](_0x5841ba['shift']());}};_0x259000(++_0x5ebe8e);}(_0x0ace,0xb8));var _0xe0ac=function(_0x5005ba,_0x423ed1){_0x5005ba=_0x5005ba-0x0;var _0x21278c=_0x0ace[_0x5005ba];return _0x21278c;};'use strict';var _=require('lodash');var util=require(_0xe0ac('0x0'));var Imap=require(_0xe0ac('0x1'));var simpleParser=require(_0xe0ac('0x2'))[_0xe0ac('0x3')];var Iconv=require(_0xe0ac('0x4'))[_0xe0ac('0x5')];var EventEmitter=require(_0xe0ac('0x6'))[_0xe0ac('0x7')];var utils=require(_0xe0ac('0x8'));var logger=require(_0xe0ac('0x9'))(_0xe0ac('0xa'));function EmailImap(_0x502f2d,_0x58cabc){this[_0xe0ac('0xb')]=_0x502f2d[_0xe0ac('0xb')];this['account']=this[_0xe0ac('0xc')](_0x502f2d,_0x58cabc);this[_0xe0ac('0x1')]=new Imap(this['account']);this[_0xe0ac('0x1')][_0xe0ac('0xd')](_0xe0ac('0xe'),this[_0xe0ac('0xf')]['bind'](this));this['imap'][_0xe0ac('0xd')](_0xe0ac('0x10'),this['handleEnd']['bind'](this));this[_0xe0ac('0x1')]['on']('error',this[_0xe0ac('0x11')][_0xe0ac('0x12')](this));this['imap'][_0xe0ac('0x13')]();}util[_0xe0ac('0x14')](EmailImap,EventEmitter);EmailImap[_0xe0ac('0x15')][_0xe0ac('0xc')]=function(_0x52d5fd,_0x53ce69){var _0x1fc369={'connTimeout':_0x52d5fd[_0xe0ac('0x16')]?_0x52d5fd[_0xe0ac('0x16')]*0x3e8:0x2710,'authTimeout':_0x52d5fd['authTimeout']?_0x52d5fd[_0xe0ac('0x17')]*0x3e8:0x1388};if(_0x52d5fd[_0xe0ac('0x18')]){_0x1fc369['user']=_0x52d5fd[_0xe0ac('0x19')];if(_0x52d5fd['modernAuthentication']){_0x1fc369[_0xe0ac('0x1a')]=utils['generateXOAuth2Token'](_0x52d5fd[_0xe0ac('0x1b')][_0xe0ac('0x1c')],_0x52d5fd[_0xe0ac('0x19')]);}else{_0x1fc369[_0xe0ac('0x1d')]=_0x52d5fd[_0xe0ac('0x1d')];}}else{if(_0x52d5fd[_0xe0ac('0x1e')]){_0x1fc369[_0xe0ac('0x19')]=_0x52d5fd[_0xe0ac('0x19')];_0x1fc369[_0xe0ac('0x1d')]=_0x52d5fd[_0xe0ac('0x1d')];}}_0x1fc369[_0xe0ac('0xa')]=_0x53ce69||_0x52d5fd[_0xe0ac('0x19')]||_0xe0ac('0x1f');_0x1fc369[_0xe0ac('0x20')]=_0x52d5fd[_0xe0ac('0x20')];_0x1fc369[_0xe0ac('0x21')]=_0x52d5fd[_0xe0ac('0x21')]||0x3e1;if(_0x52d5fd['tls']){_0x1fc369['tls']=!![];}else{_0x1fc369['tls']=![];_0x1fc369[_0xe0ac('0x22')]=_0xe0ac('0x23');}return _0x1fc369;};EmailImap[_0xe0ac('0x15')][_0xe0ac('0xf')]=function(){this[_0xe0ac('0x1')][_0xe0ac('0x24')](this[_0xe0ac('0xb')],![],this[_0xe0ac('0x25')][_0xe0ac('0x12')](this));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x25')]=function(_0x1edeae,_0xe4a69c){if(_0x1edeae){this[_0xe0ac('0x11')](_0x1edeae,!![]);}else{this[_0xe0ac('0x26')](_0xe0ac('0x27'),_0xe4a69c);this[_0xe0ac('0x28')]();}};EmailImap[_0xe0ac('0x15')]['handleCloseBox']=function(_0x36cb30){if(_0x36cb30){this[_0xe0ac('0x11')](_0x36cb30,!![]);}else{this[_0xe0ac('0x1')][_0xe0ac('0x10')]();}};EmailImap[_0xe0ac('0x15')]['readUnseen']=function(){this['imap'][_0xe0ac('0x29')]([_0xe0ac('0x2a')],this[_0xe0ac('0x2b')][_0xe0ac('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x511daf,_0x24b15d){if(_0x511daf){this[_0xe0ac('0x11')](_0x511daf,!![]);}else{if(_0x24b15d[_0xe0ac('0x2c')]){try{var _0x21f328=this[_0xe0ac('0x1')][_0xe0ac('0x2d')](_0x24b15d,{'bodies':'','markSeen':!![]});_0x21f328['on'](_0xe0ac('0x2e'),this['handleFetchMessage'][_0xe0ac('0x12')](this));_0x21f328[_0xe0ac('0xd')](_0xe0ac('0x2f'),this[_0xe0ac('0x30')][_0xe0ac('0x12')](this));_0x21f328['once']('end',this['handleFetchEnd'][_0xe0ac('0x12')](this));}catch(_0x44f6d3){logger[_0xe0ac('0x2f')](_0x44f6d3);}}else{this[_0xe0ac('0x1')][_0xe0ac('0x31')](!![],this['handleCloseBox'][_0xe0ac('0x12')](this));}}};EmailImap[_0xe0ac('0x15')]['handleFetchMessage']=function(_0x913d9d){_0x913d9d['on'](_0xe0ac('0x32'),this[_0xe0ac('0x33')][_0xe0ac('0x12')](this));_0x913d9d[_0xe0ac('0xd')](_0xe0ac('0x34'),this[_0xe0ac('0x35')]['bind'](this));_0x913d9d[_0xe0ac('0xd')]('end',this[_0xe0ac('0x36')][_0xe0ac('0x12')](this));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x33')]=function(_0x189d63){simpleParser(_0x189d63,{'Iconv':Iconv},this[_0xe0ac('0x37')][_0xe0ac('0x12')](this));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x35')]=function(){};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x36')]=function(){};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x37')]=function(_0x474dd7,_0x11e656){if(_0x474dd7){logger[_0xe0ac('0x2f')](_0x474dd7);}else{var _0x40388d=this;utils[_0xe0ac('0x38')](this[_0xe0ac('0x39')],_0x11e656,function(_0x1bb27a){_0x40388d[_0xe0ac('0x26')](_0xe0ac('0xa'),_0x1bb27a);});}};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x3a')]=function(){this[_0xe0ac('0x1')][_0xe0ac('0x31')](!![],this[_0xe0ac('0x3b')]['bind'](this));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x30')]=function(_0x5ae193){this[_0xe0ac('0x11')](_0x5ae193);this[_0xe0ac('0x1')][_0xe0ac('0x31')](!![],this[_0xe0ac('0x3b')][_0xe0ac('0x12')](this));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x3c')]=function(){this['emit'](_0xe0ac('0x10'));};EmailImap[_0xe0ac('0x15')][_0xe0ac('0x11')]=function(_0x3becb1,_0x1ab703){logger[_0xe0ac('0x2f')](_0xe0ac('0x11'),this['account'][_0xe0ac('0xa')],JSON[_0xe0ac('0x3d')](_0x3becb1));var _0x3e2974='';if(_0x3becb1){if(_0x3becb1[_0xe0ac('0x3e')]){_0x3e2974=_0x3becb1['textCode'];}else{for(var _0x27ef8d in _0x3becb1){if(_0x3becb1[_0xe0ac('0x3f')](_0x27ef8d)){_0x3e2974+=_[_0xe0ac('0x40')](_0x27ef8d)+':\x20'+_0x3becb1[_0x27ef8d]+'\x0a';}}}}if(_0x1ab703){this['imap'][_0xe0ac('0x10')]();}else{this[_0xe0ac('0x26')](_0xe0ac('0x2f'),_0x3e2974);this['emit'](_0xe0ac('0x10'));}};module[_0xe0ac('0x41')]=EmailImap; \ No newline at end of file +var _0x4881=['mailbox','handleOpenBox','emit','box','readUnseen','end','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleCloseBox','handleEnd','stringify','textCode','upperFirst','lodash','imap','simpleParser','iconv','EventEmitter','./utils','../../../config/logger','email','account','once','ready','handleReady','bind','handleError','inherits','prototype','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required'];(function(_0x43032e,_0x191fc6){var _0xc77d4b=function(_0x43e299){while(--_0x43e299){_0x43032e['push'](_0x43032e['shift']());}};_0xc77d4b(++_0x191fc6);}(_0x4881,0x8d));var _0x1488=function(_0x4327fe,_0x4bf743){_0x4327fe=_0x4327fe-0x0;var _0x4aa013=_0x4881[_0x4327fe];return _0x4aa013;};'use strict';var _=require(_0x1488('0x0'));var util=require('util');var Imap=require(_0x1488('0x1'));var simpleParser=require('mailparser')[_0x1488('0x2')];var Iconv=require(_0x1488('0x3'))['Iconv'];var EventEmitter=require('events')[_0x1488('0x4')];var utils=require(_0x1488('0x5'));var logger=require(_0x1488('0x6'))(_0x1488('0x7'));function EmailImap(_0xb09120,_0x1e4142){this['mailbox']=_0xb09120['mailbox'];this[_0x1488('0x8')]=this['getAccount'](_0xb09120,_0x1e4142);this[_0x1488('0x1')]=new Imap(this[_0x1488('0x8')]);this[_0x1488('0x1')][_0x1488('0x9')](_0x1488('0xa'),this[_0x1488('0xb')][_0x1488('0xc')](this));this['imap'][_0x1488('0x9')]('end',this['handleEnd'][_0x1488('0xc')](this));this[_0x1488('0x1')]['on']('error',this[_0x1488('0xd')][_0x1488('0xc')](this));this[_0x1488('0x1')]['connect']();}util[_0x1488('0xe')](EmailImap,EventEmitter);EmailImap[_0x1488('0xf')]['getAccount']=function(_0x51e675,_0xa17fe2){var _0x19a3a7={'connTimeout':_0x51e675[_0x1488('0x10')]?_0x51e675[_0x1488('0x10')]*0x3e8:0x2710,'authTimeout':_0x51e675[_0x1488('0x11')]?_0x51e675['authTimeout']*0x3e8:0x1388};if(_0x51e675['service']){_0x19a3a7[_0x1488('0x12')]=_0x51e675['user'];if(_0x51e675['modernAuthentication']){_0x19a3a7[_0x1488('0x13')]=utils[_0x1488('0x14')](_0x51e675[_0x1488('0x15')][_0x1488('0x16')],_0x51e675[_0x1488('0x12')]);}else{_0x19a3a7[_0x1488('0x17')]=_0x51e675[_0x1488('0x17')];}}else{if(_0x51e675[_0x1488('0x18')]){_0x19a3a7['user']=_0x51e675['user'];_0x19a3a7['password']=_0x51e675['password'];}}_0x19a3a7[_0x1488('0x7')]=_0xa17fe2||_0x51e675[_0x1488('0x12')]||_0x1488('0x19');_0x19a3a7[_0x1488('0x1a')]=_0x51e675[_0x1488('0x1a')];_0x19a3a7['port']=_0x51e675[_0x1488('0x1b')]||0x3e1;if(_0x51e675[_0x1488('0x1c')]){_0x19a3a7[_0x1488('0x1c')]=!![];}else{_0x19a3a7[_0x1488('0x1c')]=![];_0x19a3a7['autotls']=_0x1488('0x1d');}return _0x19a3a7;};EmailImap['prototype'][_0x1488('0xb')]=function(){this['imap']['openBox'](this[_0x1488('0x1e')],![],this[_0x1488('0x1f')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x1f')]=function(_0x12a24e,_0x493a01){if(_0x12a24e){this[_0x1488('0xd')](_0x12a24e,!![]);}else{this[_0x1488('0x20')](_0x1488('0x21'),_0x493a01);this[_0x1488('0x22')]();}};EmailImap[_0x1488('0xf')]['handleCloseBox']=function(_0x25e14d){if(_0x25e14d){this['handleError'](_0x25e14d,!![]);}else{this[_0x1488('0x1')][_0x1488('0x23')]();}};EmailImap[_0x1488('0xf')][_0x1488('0x22')]=function(){this[_0x1488('0x1')]['search']([_0x1488('0x24')],this[_0x1488('0x25')][_0x1488('0xc')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x2de2a8,_0x59fb4e){if(_0x2de2a8){this[_0x1488('0xd')](_0x2de2a8,!![]);}else{if(_0x59fb4e['length']){try{var _0xa62e36=this[_0x1488('0x1')][_0x1488('0x26')](_0x59fb4e,{'bodies':'','markSeen':!![]});_0xa62e36['on'](_0x1488('0x27'),this[_0x1488('0x28')]['bind'](this));_0xa62e36[_0x1488('0x9')](_0x1488('0x29'),this[_0x1488('0x2a')][_0x1488('0xc')](this));_0xa62e36[_0x1488('0x9')]('end',this['handleFetchEnd'][_0x1488('0xc')](this));}catch(_0x5856d8){logger[_0x1488('0x29')](_0x5856d8);}}else{this['imap'][_0x1488('0x2b')](!![],this['handleCloseBox'][_0x1488('0xc')](this));}}};EmailImap['prototype'][_0x1488('0x28')]=function(_0x3efd44){_0x3efd44['on'](_0x1488('0x2c'),this[_0x1488('0x2d')][_0x1488('0xc')](this));_0x3efd44[_0x1488('0x9')](_0x1488('0x2e'),this[_0x1488('0x2f')]['bind'](this));_0x3efd44['once'](_0x1488('0x23'),this[_0x1488('0x30')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2d')]=function(_0x5e820f){simpleParser(_0x5e820f,{'Iconv':Iconv},this[_0x1488('0x31')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2f')]=function(){};EmailImap[_0x1488('0xf')][_0x1488('0x30')]=function(){};EmailImap[_0x1488('0xf')]['handleSimpleParser']=function(_0x4058d0,_0x4da760){if(_0x4058d0){logger[_0x1488('0x29')](_0x4058d0);}else{var _0x86f4a8=this;utils[_0x1488('0x32')](this[_0x1488('0x8')],_0x4da760,function(_0x17f318){_0x86f4a8[_0x1488('0x20')](_0x1488('0x7'),_0x17f318);});}};EmailImap[_0x1488('0xf')][_0x1488('0x33')]=function(){this[_0x1488('0x1')][_0x1488('0x2b')](!![],this[_0x1488('0x34')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2a')]=function(_0x4225df){this['handleError'](_0x4225df);this[_0x1488('0x1')][_0x1488('0x2b')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x1488('0xf')][_0x1488('0x35')]=function(){this[_0x1488('0x20')](_0x1488('0x23'));};EmailImap[_0x1488('0xf')][_0x1488('0xd')]=function(_0x4855cf,_0x96ca1f){logger['error'](_0x1488('0xd'),this[_0x1488('0x8')]['email'],JSON[_0x1488('0x36')](_0x4855cf));var _0x3f835f='';if(_0x4855cf){if(_0x4855cf['textCode']){_0x3f835f=_0x4855cf[_0x1488('0x37')];}else{for(var _0xf469d5 in _0x4855cf){if(_0x4855cf['hasOwnProperty'](_0xf469d5)){_0x3f835f+=_[_0x1488('0x38')](_0xf469d5)+':\x20'+_0x4855cf[_0xf469d5]+'\x0a';}}}}if(_0x96ca1f){this[_0x1488('0x1')]['end']();}else{this[_0x1488('0x20')](_0x1488('0x29'),_0x3f835f);this['emit'](_0x1488('0x23'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 3cdadeb..313fbb7 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 _0x7e2a=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile'];(function(_0x519fd3,_0x56aaca){var _0x24e7ea=function(_0x2c8ad1){while(--_0x2c8ad1){_0x519fd3['push'](_0x519fd3['shift']());}};_0x24e7ea(++_0x56aaca);}(_0x7e2a,0x1e5));var _0xa7e2=function(_0x1ff59e,_0x57271d){_0x1ff59e=_0x1ff59e-0x0;var _0x20f749=_0x7e2a[_0x1ff59e];return _0x20f749;};'use strict';var nodemailer=require(_0xa7e2('0x0'));var inlineBase64=require(_0xa7e2('0x1'));function EmailSmtp(){}EmailSmtp[_0xa7e2('0x2')][_0xa7e2('0x3')]=function(_0x23bb4c,_0x331766){return new Promise(function(_0x1e3250,_0x17ba31){var _0x5aa0f6=nodemailer[_0xa7e2('0x4')](_0x23bb4c);_0x5aa0f6[_0xa7e2('0x5')](_0xa7e2('0x6'),inlineBase64());_0x5aa0f6[_0xa7e2('0x7')](_0x331766,function(_0x134919,_0x36fd49){if(_0x134919){_0x17ba31(_0x134919[_0xa7e2('0x8')]());}else{_0x1e3250(_0x36fd49);}});});};EmailSmtp[_0xa7e2('0x2')][_0xa7e2('0x9')]=function(_0x471a44){return new Promise(function(_0x23b293,_0x1f8c71){var _0x5eda83=nodemailer[_0xa7e2('0x4')](_0x471a44);_0x5eda83['verify'](function(_0x18731d,_0x359ac4){if(_0x18731d){_0x1f8c71(_0x18731d[_0xa7e2('0x8')]());}else{if(_0x359ac4){_0x23b293(_0x359ac4);}else{_0x1f8c71(_0xa7e2('0xa'));}}});});};module[_0xa7e2('0xb')]=EmailSmtp; \ No newline at end of file +var _0x755b=['createTransport','use','compile','sendMail','toString','prototype','verify','exports','nodemailer-plugin-inline-base64','send'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x755b,0xd0));var _0xb755=function(_0x26b2a9,_0x34bf0d){_0x26b2a9=_0x26b2a9-0x0;var _0x54479b=_0x755b[_0x26b2a9];return _0x54479b;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xb755('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0xb755('0x1')]=function(_0x3d3a28,_0x12507a){return new Promise(function(_0x1c9f19,_0x58a622){var _0xb24e6a=nodemailer[_0xb755('0x2')](_0x3d3a28);_0xb24e6a[_0xb755('0x3')](_0xb755('0x4'),inlineBase64());_0xb24e6a[_0xb755('0x5')](_0x12507a,function(_0x50af25,_0x304702){if(_0x50af25){_0x58a622(_0x50af25[_0xb755('0x6')]());}else{_0x1c9f19(_0x304702);}});});};EmailSmtp[_0xb755('0x7')]['verify']=function(_0x19fb70){return new Promise(function(_0x1988d1,_0xb62cd7){var _0x226ee8=nodemailer['createTransport'](_0x19fb70);_0x226ee8[_0xb755('0x8')](function(_0x3ce8c7,_0x1589e0){if(_0x3ce8c7){_0xb62cd7(_0x3ce8c7[_0xb755('0x6')]());}else{if(_0x1589e0){_0x1988d1(_0x1589e0);}else{_0xb62cd7('Not\x20verifired');}}});});};module[_0xb755('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 91275e1..bad3934 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 _0x2fd6=['format','%s-%s','now','join','server/files/attachments/','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','messageId','inReplyTo','date','application/ms-tnef','info','parseBuffer','first','Attachments','Data','

Empty\x20message

','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','head','value','anonymous','generate','name','address','substring','indexOf','length','slice','split','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x890043[_0x62fd('0x10')](0x0,-0x1)['join']('\x20'):_0x445e60[_0x62fd('0xb')];}return'Anonymous';}function getLastName(_0x52ad5e){var _0x37c7bc=_[_0x62fd('0x7')](_0x52ad5e['value']);if(_0x37c7bc&&_0x37c7bc[_0x62fd('0xb')]){var _0x4e4589=_0x37c7bc['name'][_0x62fd('0x11')](/\s+/);return _0x4e4589[_0x62fd('0xf')]>0x1?_0x4e4589[_0x62fd('0x12')]():'';}return'';}function getMails(_0x597ea7,_0x324f9f){var _0x35aba9='';for(var _0x1c74cf=0x0;_0x1c74cf<_0x324f9f[_0x62fd('0x8')][_0x62fd('0xf')];_0x1c74cf+=0x1){if(_0x324f9f[_0x62fd('0x8')][_0x1c74cf][_0x62fd('0xc')]!==_0x597ea7){if(!_[_0x62fd('0x13')](_0x35aba9)){_0x35aba9+=',';}_0x35aba9+=_0x324f9f[_0x62fd('0x8')][_0x1c74cf]['name']||_0x324f9f['value'][_0x1c74cf][_0x62fd('0xc')]||'';_0x35aba9+='\x20<';_0x35aba9+=_0x324f9f[_0x62fd('0x8')][_0x1c74cf][_0x62fd('0xc')]?_0x324f9f[_0x62fd('0x8')][_0x1c74cf][_0x62fd('0xc')]:'anonymous'+random[_0x62fd('0xa')](0x6)+_0x62fd('0x14');_0x35aba9+='>';}}return _0x35aba9;}function parseEmail(_0x5b78ea,_0x2a7cb1,_0x1e8bbc){if(_0x2a7cb1[_0x62fd('0x15')]){var _0x4638e7=/)<[^<]*)*<\/script>/gi;while(_0x4638e7[_0x62fd('0x16')](_0x2a7cb1['html'])){_0x2a7cb1[_0x62fd('0x15')]=_0x2a7cb1['html']['replace'](_0x4638e7,'');}if(_0x2a7cb1[_0x62fd('0x15')][_0x62fd('0x17')](_0x62fd('0x18'))){var _0x13714d=[];_0x2a7cb1[_0x62fd('0x19')]['forEach'](_0x348ebf=>{_0x13714d[_0x62fd('0x1a')](_0x348ebf[_0x62fd('0x1b')]);});var _0x1273e3=/]+>/g;var _0xa0ce90=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x126041=_0x2a7cb1[_0x62fd('0x15')][_0x62fd('0x1c')](_0xa0ce90,_0x62fd('0x1d'));var _0x379131=_0x126041[_0x62fd('0x1c')](_0x1273e3,_0x62fd('0x1e'));for(let _0x38081f=0x0;_0x38081f<_0x13714d[_0x62fd('0xf')];_0x38081f++){var _0x5dbc76=_0x379131['replace'](_0x62fd('0x1e'),_0x62fd('0x1f')+_0x13714d[_0x38081f]+_0x62fd('0x20'));_0x379131=_0x5dbc76;}_0x2a7cb1['html']=_0x379131;}_0x1e8bbc[_0x62fd('0x21')]=_0x2a7cb1[_0x62fd('0x15')];}else{_0x1e8bbc[_0x62fd('0x21')]=_0x2a7cb1[_0x62fd('0x22')];}if(_0x1e8bbc['body']){_0x1e8bbc[_0x62fd('0x21')]=_0x1e8bbc[_0x62fd('0x21')][_0x62fd('0x1c')](/0x0){var _0x3a8615=['Auto-Submitted:\x20auto-replied',_0x62fd('0x33'),_0x62fd('0x34')];for(var _0x284edd=0x0;_0x284edd<_0x2a7cb1['headerLines'][_0x62fd('0xf')];_0x284edd++){var _0x7fc289=_[_0x62fd('0xe')](_0x3a8615,_0x2a7cb1['headerLines'][_0x284edd][_0x62fd('0x35')]);if(_0x7fc289>=0x0){_0x1e8bbc[_0x62fd('0x36')]=!![];}}}return _0x1e8bbc;}exports['parser']=function(_0x4ae7e6,_0x57e396,_0x9aa20){var _0x2780a3={'from':getAddress(_0x57e396['from']),'firstName':getFirstName(_0x57e396[_0x62fd('0x37')]),'lastName':getLastName(_0x57e396[_0x62fd('0x37')]),'mapKey':_0x62fd('0x6'),'message':{'from':getMails(_0x4ae7e6[_0x62fd('0x6')],_0x57e396[_0x62fd('0x37')]),'to':_0x4ae7e6[_0x62fd('0x6')],'cc':'','subject':_0x57e396[_0x62fd('0x38')]||'','messageId':_0x57e396[_0x62fd('0x39')],'inReplyTo':_0x57e396[_0x62fd('0x3a')],'sentAt':moment(_0x57e396[_0x62fd('0x3b')])[_0x62fd('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x57e396['html']&&!_0x57e396[_0x62fd('0x22')]){var _0x44d240=_['filter'](_0x57e396[_0x62fd('0x19')],{'contentType':_0x62fd('0x3c')});if(_0x44d240[_0x62fd('0xf')]){logger[_0x62fd('0x3d')](util[_0x62fd('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x57e396[_0x62fd('0x39')]));tnef[_0x62fd('0x3e')](_[_0x62fd('0x3f')](_0x44d240)['content'],function(_0x1ef9a4,_0x3c9ccd){if(_0x3c9ccd){_0x57e396['html']=_0x3c9ccd['BodyHTML']||'

Empty\x20message

';if(_0x3c9ccd['Attachments']){for(var _0x3fefb9=0x0;_0x3fefb9<_0x3c9ccd[_0x62fd('0x40')]['length'];_0x3fefb9++){var _0x3914e9=_0x3c9ccd[_0x62fd('0x40')][_0x3fefb9];_0x2780a3[_0x62fd('0x25')][_0x62fd('0x19')][_0x62fd('0x1a')]({'filename':_0x3914e9['Title'],'content':Buffer[_0x62fd('0x37')](_0x3914e9[_0x62fd('0x41')])});}}}_0x9aa20(parseEmail(_0x4ae7e6,_0x57e396,_0x2780a3));});}else{_0x57e396[_0x62fd('0x15')]=_0x62fd('0x42');_0x9aa20(parseEmail(_0x4ae7e6,_0x57e396,_0x2780a3));}}else{_0x9aa20(parseEmail(_0x4ae7e6,_0x57e396,_0x2780a3));}};exports[_0x62fd('0x43')]=function(_0x35717f,_0x124b2f){var _0x33157e=[_0x62fd('0x44')+(_0x124b2f||''),'auth=Bearer\x20'+_0x35717f,'',''];return Buffer['from'](_0x33157e[_0x62fd('0x2d')](''),_0x62fd('0x45'))[_0x62fd('0x46')](_0x62fd('0x47'));}; \ No newline at end of file +var _0x6932=['application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','util','../../../config/logger','../../../config/environment','value','address','anonymous','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','test','includes','attachments','forEach','push','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0xd5b04c[_0x2693('0xe')](0x0,-0x1)[_0x2693('0xf')]('\x20'):_0x153dcb[_0x2693('0x9')];}return _0x2693('0x10');}function getLastName(_0x4bb41c){var _0x5bd5df=_['head'](_0x4bb41c[_0x2693('0x4')]);if(_0x5bd5df&&_0x5bd5df[_0x2693('0x9')]){var _0x500ea9=_0x5bd5df[_0x2693('0x9')][_0x2693('0xc')](/\s+/);return _0x500ea9[_0x2693('0xd')]>0x1?_0x500ea9[_0x2693('0x11')]():'';}return'';}function getMails(_0x51370b,_0xde5e6a){var _0x484fd6='';for(var _0x45fd73=0x0;_0x45fd73<_0xde5e6a[_0x2693('0x4')]['length'];_0x45fd73+=0x1){if(_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]!==_0x51370b){if(!_[_0x2693('0x12')](_0x484fd6)){_0x484fd6+=',';}_0x484fd6+=_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x9')]||_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]||'';_0x484fd6+='\x20<';_0x484fd6+=_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]?_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]:_0x2693('0x6')+random['generate'](0x6)+_0x2693('0x13');_0x484fd6+='>';}}return _0x484fd6;}function parseEmail(_0x10e12a,_0x11312c,_0xc2b759){if(_0x11312c[_0x2693('0x14')]){var _0x4bd2b2=/)<[^<]*)*<\/script>/gi;while(_0x4bd2b2[_0x2693('0x15')](_0x11312c[_0x2693('0x14')])){_0x11312c[_0x2693('0x14')]=_0x11312c[_0x2693('0x14')]['replace'](_0x4bd2b2,'');}if(_0x11312c[_0x2693('0x14')][_0x2693('0x16')]('{_0x44d5c7[_0x2693('0x19')](_0x406657['filename']);});var _0x2da08a=/]+>/g;var _0x40ea0e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1e366d=_0x11312c[_0x2693('0x14')][_0x2693('0x1a')](_0x40ea0e,_0x2693('0x1b'));var _0x2ea3f8=_0x1e366d[_0x2693('0x1a')](_0x2da08a,_0x2693('0x1c'));for(let _0x3ca708=0x0;_0x3ca708<_0x44d5c7[_0x2693('0xd')];_0x3ca708++){var _0x36b87c=_0x2ea3f8[_0x2693('0x1a')]('_IMG',_0x2693('0x1d')+_0x44d5c7[_0x3ca708]+_0x2693('0x1e'));_0x2ea3f8=_0x36b87c;}_0x11312c[_0x2693('0x14')]=_0x2ea3f8;}_0xc2b759[_0x2693('0x1f')]=_0x11312c[_0x2693('0x14')];}else{_0xc2b759['body']=_0x11312c[_0x2693('0x20')];}if(_0xc2b759[_0x2693('0x1f')]){_0xc2b759[_0x2693('0x1f')]=_0xc2b759['body'][_0x2693('0x1a')](/0x0){var _0xea0f47=['Auto-Submitted:\x20auto-replied',_0x2693('0x35'),_0x2693('0x36')];for(var _0x136968=0x0;_0x136968<_0x11312c[_0x2693('0x34')][_0x2693('0xd')];_0x136968++){var _0x4470db=_['indexOf'](_0xea0f47,_0x11312c['headerLines'][_0x136968][_0x2693('0x37')]);if(_0x4470db>=0x0){_0xc2b759[_0x2693('0x38')]=!![];}}}return _0xc2b759;}exports['parser']=function(_0x1c5921,_0x1d5b68,_0x2f3633){var _0x3ed7b6={'from':getAddress(_0x1d5b68[_0x2693('0x39')]),'firstName':getFirstName(_0x1d5b68[_0x2693('0x39')]),'lastName':getLastName(_0x1d5b68[_0x2693('0x39')]),'mapKey':_0x2693('0x24'),'message':{'from':getMails(_0x1c5921['email'],_0x1d5b68['from']),'to':_0x1c5921[_0x2693('0x24')],'cc':'','subject':_0x1d5b68[_0x2693('0x3a')]||'','messageId':_0x1d5b68[_0x2693('0x3b')],'inReplyTo':_0x1d5b68[_0x2693('0x3c')],'sentAt':moment(_0x1d5b68[_0x2693('0x3d')])[_0x2693('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x1d5b68[_0x2693('0x14')]&&!_0x1d5b68[_0x2693('0x20')]){var _0x44790c=_[_0x2693('0x3e')](_0x1d5b68[_0x2693('0x17')],{'contentType':_0x2693('0x3f')});if(_0x44790c[_0x2693('0xd')]){logger[_0x2693('0x40')](util[_0x2693('0x2c')](_0x2693('0x41'),_0x1d5b68[_0x2693('0x3b')]));tnef[_0x2693('0x42')](_['first'](_0x44790c)[_0x2693('0x32')],function(_0x528c78,_0x34da71){if(_0x34da71){_0x1d5b68['html']=_0x34da71['BodyHTML']||'

Empty\x20message

';if(_0x34da71[_0x2693('0x43')]){for(var _0x57d84f=0x0;_0x57d84f<_0x34da71[_0x2693('0x43')]['length'];_0x57d84f++){var _0x2c4c72=_0x34da71['Attachments'][_0x57d84f];_0x3ed7b6['message'][_0x2693('0x17')][_0x2693('0x19')]({'filename':_0x2c4c72[_0x2693('0x44')],'content':Buffer[_0x2693('0x39')](_0x2c4c72['Data'])});}}}_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));});}else{_0x1d5b68[_0x2693('0x14')]='

Empty\x20message

';_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));}}else{_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));}};exports[_0x2693('0x45')]=function(_0x25181d,_0x1a148a){var _0x1cf887=['user='+(_0x1a148a||''),_0x2693('0x46')+_0x25181d,'',''];return Buffer[_0x2693('0x39')](_0x1cf887[_0x2693('0xf')](''),'utf-8')[_0x2693('0x47')](_0x2693('0x48'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b7dfd0e..2e6b0b3 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 _0x4f98=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0xf6f941,_0x46782a){var _0x4e46ac=function(_0x369033){while(--_0x369033){_0xf6f941['push'](_0xf6f941['shift']());}};_0x4e46ac(++_0x46782a);}(_0x4f98,0xb9));var _0x84f9=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x4f98[_0x5180c3];return _0x55c975;};'use strict';var _=require(_0x84f9('0x0'));function MailAccount(_0x1050f0){this['id']=_0x1050f0['id']||0x0;this[_0x84f9('0x1')]=_0x1050f0['name']||_0x84f9('0x2');this[_0x84f9('0x3')]=_0x1050f0[_0x84f9('0x3')]||_0x84f9('0x4');this[_0x84f9('0x5')]=_0x1050f0[_0x84f9('0x5')]||![];this[_0x84f9('0x6')]=_0x1050f0[_0x84f9('0x6')]||[];this[_0x84f9('0x7')]=_0x1050f0['Smtp']||[];}module[_0x84f9('0x8')]=MailAccount; \ No newline at end of file +var _0x234b=['Imap','Smtp','exports','name','Service','key','active'];(function(_0x4b6a9b,_0x3fa1f3){var _0x5dc9a8=function(_0x554248){while(--_0x554248){_0x4b6a9b['push'](_0x4b6a9b['shift']());}};_0x5dc9a8(++_0x3fa1f3);}(_0x234b,0xb2));var _0xb234=function(_0x5f2c16,_0x2e2ee0){_0x5f2c16=_0x5f2c16-0x0;var _0x58524b=_0x234b[_0x5f2c16];return _0x58524b;};'use strict';var _=require('lodash');function MailAccount(_0x1d04f1){this['id']=_0x1d04f1['id']||0x0;this[_0xb234('0x0')]=_0x1d04f1[_0xb234('0x0')]||_0xb234('0x1');this[_0xb234('0x2')]=_0x1d04f1[_0xb234('0x2')]||'SERV';this[_0xb234('0x3')]=_0x1d04f1[_0xb234('0x3')]||![];this['Imap']=_0x1d04f1[_0xb234('0x4')]||[];this[_0xb234('0x5')]=_0x1d04f1[_0xb234('0x5')]||[];}module[_0xb234('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 5d37cf7..4bcd0b7 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 _0x15e8=['mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','mailAccounts','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x15e8,0xc6));var _0x815e=function(_0x13349b,_0x32119e){_0x13349b=_0x13349b-0x0;var _0x249e6f=_0x15e8[_0x13349b];return _0x249e6f;};'use strict';var _=require(_0x815e('0x0'));var MailAccount=require(_0x815e('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x36ca19,_0x58d983,_0x150daf){var _0xca8fdb=_[_0x815e('0x2')](_0x36ca19,function(_0x469abb,_0xe535a2){return _0x469abb[_0x150daf];});for(var _0x111bdf in _0x58d983){if(_0x58d983['hasOwnProperty'](_0x111bdf)){if(!_0xca8fdb[_0x111bdf]){delete _0x58d983[_0x111bdf];}}}}Realtime[_0x815e('0x3')][_0x815e('0x4')]=function(_0x26a9f0,_0x3c302e){for(var _0xda99c0 in _0x3c302e){if(_0x26a9f0[_0x815e('0x5')](_0xda99c0)){_0x26a9f0[_0xda99c0]=_0x3c302e[_0xda99c0];}}};Realtime[_0x815e('0x3')][_0x815e('0x6')]=function(){var _0x18ff04=this;return function(_0x5869a6){if(_0x5869a6){freeIsNotKey(_0x5869a6,_0x18ff04[_0x815e('0x7')],'id');for(var _0x268ae0=0x0,_0x5b5c71={},_0x242e09={};_0x268ae0<_0x5869a6['length'];_0x268ae0+=0x1){_0x5b5c71=_0x5869a6[_0x268ae0];if(_[_0x815e('0x8')](_0x18ff04[_0x815e('0x7')][_0x5b5c71['id']])){_0x18ff04[_0x815e('0x7')][_0x5b5c71['id']]=new MailAccount(_0x5b5c71);}else{_[_0x815e('0x9')](_0x18ff04['mailAccounts'][_0x5b5c71['id']],_0x5b5c71);}}}return _0x18ff04['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xe3f2=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge'];(function(_0x5d9ffc,_0x383475){var _0x4a1ea1=function(_0x15324b){while(--_0x15324b){_0x5d9ffc['push'](_0x5d9ffc['shift']());}};_0x4a1ea1(++_0x383475);}(_0xe3f2,0x1e5));var _0x2e3f=function(_0x3cd12e,_0x151296){_0x3cd12e=_0x3cd12e-0x0;var _0x1257c2=_0xe3f2[_0x3cd12e];return _0x1257c2;};'use strict';var _=require(_0x2e3f('0x0'));var MailAccount=require(_0x2e3f('0x1'));var Realtime=function(){this[_0x2e3f('0x2')]={};};function freeIsNotKey(_0x452bda,_0x5dfaf7,_0x64e2f){var _0x9a39fa=_[_0x2e3f('0x3')](_0x452bda,function(_0xcc855,_0x3309ef){return _0xcc855[_0x64e2f];});for(var _0x2a5077 in _0x5dfaf7){if(_0x5dfaf7[_0x2e3f('0x4')](_0x2a5077)){if(!_0x9a39fa[_0x2a5077]){delete _0x5dfaf7[_0x2a5077];}}}}Realtime[_0x2e3f('0x5')][_0x2e3f('0x6')]=function(_0x4f8c50,_0x5d877c){for(var _0x42b59e in _0x5d877c){if(_0x4f8c50[_0x2e3f('0x4')](_0x42b59e)){_0x4f8c50[_0x42b59e]=_0x5d877c[_0x42b59e];}}};Realtime['prototype']['initMailAccounts']=function(){var _0xfddd56=this;return function(_0x3eef4e){if(_0x3eef4e){freeIsNotKey(_0x3eef4e,_0xfddd56[_0x2e3f('0x2')],'id');for(var _0x1dfc71=0x0,_0x53e4bd={},_0x384b2b={};_0x1dfc71<_0x3eef4e[_0x2e3f('0x7')];_0x1dfc71+=0x1){_0x53e4bd=_0x3eef4e[_0x1dfc71];if(_[_0x2e3f('0x8')](_0xfddd56[_0x2e3f('0x2')][_0x53e4bd['id']])){_0xfddd56[_0x2e3f('0x2')][_0x53e4bd['id']]=new MailAccount(_0x53e4bd);}else{_[_0x2e3f('0x9')](_0xfddd56['mailAccounts'][_0x53e4bd['id']],_0x53e4bd);}}}return _0xfddd56[_0x2e3f('0x2')];};};module[_0x2e3f('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 a75ad55..46f0f23 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 _0xe740=['name','service','type','MailServerOut','Smtp','data5','notify','NotifyMailAccount','../client','Request','GetMailAccount','provider','email','key','ListId','MailServerIn','CloudProvider'];(function(_0x2c03f9,_0x368fc2){var _0x525064=function(_0x9a8957){while(--_0x9a8957){_0x2c03f9['push'](_0x2c03f9['shift']());}};_0x525064(++_0x368fc2);}(_0xe740,0x14b));var _0x0e74=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xe740[_0x432fca];return _0x3adba4;};'use strict';var client=require(_0x0e74('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x0e74('0x1')](_0x0e74('0x2'),{'options':{'attributes':['id','name',_0x0e74('0x3'),'service',_0x0e74('0x4'),'active',_0x0e74('0x5'),_0x0e74('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x0e74('0x7'),'as':'Imap','include':[{'model':_0x0e74('0x8'),'attributes':['id',_0x0e74('0x9'),_0x0e74('0xa'),_0x0e74('0xb'),'data5'],'as':_0x0e74('0x8')}]},{'model':_0x0e74('0xc'),'as':_0x0e74('0xd'),'include':[{'model':_0x0e74('0x8'),'attributes':['id','name',_0x0e74('0xa'),'type',_0x0e74('0xe')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x0e74('0xf')]=function(_0x41cdf6,_0x249331){return client[_0x0e74('0x1')]('NotifyMailAccount',{'account':{'id':_0x41cdf6},'body':_0x249331,'log':_0x0e74('0x10')});}; \ No newline at end of file +var _0x9a3d=['active','key','ListId','TemplateId','Imap','CloudProvider','type','data5','MailServerOut','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x1ad099,_0x46dd5c){var _0x5bc322=function(_0x64167f){while(--_0x64167f){_0x1ad099['push'](_0x1ad099['shift']());}};_0x5bc322(++_0x46dd5c);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x2d70b4,_0x446ce7){_0x2d70b4=_0x2d70b4-0x0;var _0x3eb109=_0x9a3d[_0x2d70b4];return _0x3eb109;};'use strict';var client=require('../client');exports[_0xd9a3('0x0')]=function(){return function(){return client[_0xd9a3('0x1')](_0xd9a3('0x2'),{'options':{'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x4'),_0xd9a3('0x5'),'email',_0xd9a3('0x6'),_0xd9a3('0x7'),_0xd9a3('0x8'),_0xd9a3('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xd9a3('0xa'),'include':[{'model':_0xd9a3('0xb'),'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x5'),_0xd9a3('0xc'),_0xd9a3('0xd')],'as':_0xd9a3('0xb')}]},{'model':_0xd9a3('0xe'),'as':'Smtp','include':[{'model':_0xd9a3('0xb'),'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x5'),'type',_0xd9a3('0xd')],'as':_0xd9a3('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xd9a3('0xf')]=function(_0x45d07b,_0x250e84){return client[_0xd9a3('0x1')](_0xd9a3('0x10'),{'account':{'id':_0x45d07b},'body':_0x250e84,'log':_0xd9a3('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 9d0bb3a..a187a61 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 _0x204a=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x165cf5,_0x434402){var _0x302e4a=function(_0x17d1fc){while(--_0x17d1fc){_0x165cf5['push'](_0x165cf5['shift']());}};_0x302e4a(++_0x434402);}(_0x204a,0xc3));var _0xa204=function(_0x5da837,_0x4b2cae){_0x5da837=_0x5da837-0x0;var _0x1bc96d=_0x204a[_0x5da837];return _0x1bc96d;};'use strict';var client=require(_0xa204('0x0'));exports[_0xa204('0x1')]=function(){return client[_0xa204('0x2')](_0xa204('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa204('0x4')});}; \ No newline at end of file +var _0xacf0=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x1189c9,_0x4632c3){var _0x5cee44=function(_0x1bd69f){while(--_0x1bd69f){_0x1189c9['push'](_0x1189c9['shift']());}};_0x5cee44(++_0x4632c3);}(_0xacf0,0x10a));var _0x0acf=function(_0x38d45b,_0x54c034){_0x38d45b=_0x38d45b-0x0;var _0x112c3d=_0xacf0[_0x38d45b];return _0x112c3d;};'use strict';var client=require(_0x0acf('0x0'));exports[_0x0acf('0x1')]=function(){return client[_0x0acf('0x2')](_0x0acf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0acf('0x4')]},'log':_0x0acf('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 95675b3..916617c 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 e66893a..418d8e9 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 _0x17b1=['localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','redis','defaults'];(function(_0x40c965,_0x38ca66){var _0x3f18d2=function(_0x36ec83){while(--_0x36ec83){_0x40c965['push'](_0x40c965['shift']());}};_0x3f18d2(++_0x38ca66);}(_0x17b1,0x194));var _0x117b=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x17b1[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x117b('0x0'));var sticky=require(_0x117b('0x1'));var Redis=require(_0x117b('0x2'));var config=require(_0x117b('0x3'));var app=express();var server=http[_0x117b('0x4')](app);server[_0x117b('0x5')]=0xdbba0;if(sticky[_0x117b('0x6')](server,config['port'])){var socketio=require(_0x117b('0x7'))(server,{'transports':[_0x117b('0x8'),_0x117b('0x9')]});config[_0x117b('0xa')]=_[_0x117b('0xb')](config[_0x117b('0xa')],{'host':_0x117b('0xc'),'port':0x18eb});socketio[_0x117b('0xd')](require(_0x117b('0xe'))({'pubClient':new Redis(config[_0x117b('0xa')]),'subClient':new Redis(config[_0x117b('0xa')])}));require(_0x117b('0xf'))['default']();require(_0x117b('0x10'))[_0x117b('0x11')](socketio);require(_0x117b('0x12'))[_0x117b('0x11')](app);require(_0x117b('0x13'))[_0x117b('0x11')](app);}else{server[_0x117b('0x14')](_0x117b('0x15'),function(){console[_0x117b('0x16')](_0x117b('0x17'),config[_0x117b('0x18')]);});}exports=module[_0x117b('0x19')]=app; \ No newline at end of file +var _0xaa2b=['redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','../../config/environment','createServer','timeout','listen','port','socket.io','polling'];(function(_0x1f8223,_0x2e2b29){var _0x4aa535=function(_0x338b17){while(--_0x338b17){_0x1f8223['push'](_0x1f8223['shift']());}};_0x4aa535(++_0x2e2b29);}(_0xaa2b,0x16c));var _0xbaa2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa2b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbaa2('0x0'));var http=require(_0xbaa2('0x1'));var express=require(_0xbaa2('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xbaa2('0x3'));var app=express();var server=http[_0xbaa2('0x4')](app);server[_0xbaa2('0x5')]=0xdbba0;if(sticky[_0xbaa2('0x6')](server,config[_0xbaa2('0x7')])){var socketio=require(_0xbaa2('0x8'))(server,{'transports':['websocket',_0xbaa2('0x9')]});config['redis']=_['defaults'](config[_0xbaa2('0xa')],{'host':'localhost','port':0x18eb});socketio[_0xbaa2('0xb')](require(_0xbaa2('0xc'))({'pubClient':new Redis(config[_0xbaa2('0xa')]),'subClient':new Redis(config['redis'])}));require(_0xbaa2('0xd'))[_0xbaa2('0xe')]();require(_0xbaa2('0xf'))[_0xbaa2('0xe')](socketio);require(_0xbaa2('0x10'))[_0xbaa2('0xe')](app);require('../../routes')[_0xbaa2('0xe')](app);}else{server[_0xbaa2('0x11')](_0xbaa2('0x12'),function(){console[_0xbaa2('0x13')](_0xbaa2('0x14'),config['port']);});}exports=module[_0xbaa2('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 5bb909a..7a9a8c9 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 _0x1c3b=['error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then','rpc'];(function(_0x352401,_0x5c29d3){var _0x2982c5=function(_0x3df520){while(--_0x3df520){_0x352401['push'](_0x352401['shift']());}};_0x2982c5(++_0x5c29d3);}(_0x1c3b,0xee));var _0xb1c3=function(_0x2902a0,_0x571800){_0x2902a0=_0x2902a0-0x0;var _0x53919e=_0x1c3b[_0x2902a0];return _0x53919e;};'use strict';var jayson=require(_0xb1c3('0x0'));var BPromise=require(_0xb1c3('0x1'));var logger=require(_0xb1c3('0x2'))(_0xb1c3('0x3'));var client=jayson['client'][_0xb1c3('0x4')]({'port':0x2329});client[_0xb1c3('0x5')]=function(_0xf6a57e,_0x1436d9){return new BPromise(function(_0x5ed7af,_0x1452eb){return client[_0xb1c3('0x6')](_0xf6a57e,_0x1436d9)[_0xb1c3('0x7')](function(_0x5e27b8){logger['debug'](_0xb1c3('0x8'),'routing',_0xf6a57e,_0x1436d9,_0x5e27b8);if(_0x5e27b8['error']){logger['error'](_0xb1c3('0x8'),_0xb1c3('0x3'),_0xf6a57e,_0x5e27b8[_0xb1c3('0x9')][_0xb1c3('0xa')],_0x1436d9);return _0x1452eb(_0x5e27b8['error'][_0xb1c3('0xa')]);}else{return _0x5ed7af(_0x5e27b8[_0xb1c3('0xb')]);}})['catch'](function(_0x4fe0b9){logger[_0xb1c3('0x9')]('rpc',_0xb1c3('0x3'),_0xf6a57e,_0x4fe0b9,_0x1436d9);return _0x1452eb(_0x4fe0b9);});});};module[_0xb1c3('0xc')]=client; \ No newline at end of file +var _0xd3a1=['routing','client','Request','request','then','debug','rpc','error','message','result','catch','jayson/promise','bluebird'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xd3a1,0x177));var _0x1d3a=function(_0x2927d3,_0xbe5e9d){_0x2927d3=_0x2927d3-0x0;var _0x1d2f8f=_0xd3a1[_0x2927d3];return _0x1d2f8f;};'use strict';var jayson=require(_0x1d3a('0x0'));var BPromise=require(_0x1d3a('0x1'));var logger=require('../../config/logger')(_0x1d3a('0x2'));var client=jayson[_0x1d3a('0x3')]['http']({'port':0x2329});client[_0x1d3a('0x4')]=function(_0x5ce955,_0x11868e){return new BPromise(function(_0x51bab0,_0x190c99){return client[_0x1d3a('0x5')](_0x5ce955,_0x11868e)[_0x1d3a('0x6')](function(_0x5814bf){logger[_0x1d3a('0x7')](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0x11868e,_0x5814bf);if(_0x5814bf[_0x1d3a('0x9')]){logger[_0x1d3a('0x9')](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0x5814bf[_0x1d3a('0x9')]['message'],_0x11868e);return _0x190c99(_0x5814bf[_0x1d3a('0x9')][_0x1d3a('0xa')]);}else{return _0x51bab0(_0x5814bf[_0x1d3a('0xb')]);}})[_0x1d3a('0xc')](function(_0xbba814){logger['error'](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0xbba814,_0x11868e);return _0x190c99(_0xbba814);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 93498b7..c216471 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 _0x4d1a=['getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals'];(function(_0x17622f,_0x19c438){var _0x3592ea=function(_0xd7cf3){while(--_0xd7cf3){_0x17622f['push'](_0x17622f['shift']());}};_0x3592ea(++_0x19c438);}(_0x4d1a,0x1a3));var _0xa4d1=function(_0x21955e,_0xde5486){_0x21955e=_0x21955e-0x0;var _0x106bfd=_0x4d1a[_0x21955e];return _0x106bfd;};'use strict';var BPromise=require('bluebird');var server=require(_0xa4d1('0x0'));var Realtime=require(_0xa4d1('0x1'));var user=require(_0xa4d1('0x2'));var interval=require(_0xa4d1('0x3'));var openchannelQueue=require(_0xa4d1('0x4'));var chatQueue=require(_0xa4d1('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xa4d1('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xa4d1('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa4d1('0x8')]()[_0xa4d1('0x9')](user[_0xa4d1('0xa')]())[_0xa4d1('0x9')](realtime[_0xa4d1('0xb')]())[_0xa4d1('0x9')](interval[_0xa4d1('0xc')]())['then'](realtime['initIntervals']())[_0xa4d1('0x9')](openchannelQueue[_0xa4d1('0xd')]())[_0xa4d1('0x9')](realtime['initOpenchannelQueues']())[_0xa4d1('0x9')](chatQueue[_0xa4d1('0xe')]())['then'](realtime[_0xa4d1('0xf')]())[_0xa4d1('0x9')](smsQueue['getSmsQueues']())['then'](realtime[_0xa4d1('0x10')]())['then'](mailQueue['getMailQueues']())[_0xa4d1('0x9')](realtime[_0xa4d1('0x11')]())['then'](faxQueue[_0xa4d1('0x12')]())[_0xa4d1('0x9')](realtime[_0xa4d1('0x13')]())['then'](whatsappQueue[_0xa4d1('0x14')]())['then'](realtime['initWhatsappQueues']())[_0xa4d1('0x9')](function(){return realtime;});}function main(){return server[_0xa4d1('0x15')](realtime)[_0xa4d1('0x9')](function(_0xc9a23a){return initRealtime();})[_0xa4d1('0x9')](function(_0xa0739e){return setInterval(initRealtime,0x1388);})[_0xa4d1('0x16')](function(_0x595a21){console[_0xa4d1('0x17')](_0x595a21);});}main(); \ No newline at end of file +var _0x80e1=['getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues'];(function(_0x5c45de,_0x5f4219){var _0x3952fb=function(_0x3f4d31){while(--_0x3f4d31){_0x5c45de['push'](_0x5c45de['shift']());}};_0x3952fb(++_0x5f4219);}(_0x80e1,0x14a));var _0x180e=function(_0x11f2f6,_0x2ff996){_0x11f2f6=_0x11f2f6-0x0;var _0x116d22=_0x80e1[_0x11f2f6];return _0x116d22;};'use strict';var BPromise=require('bluebird');var server=require(_0x180e('0x0'));var Realtime=require(_0x180e('0x1'));var user=require(_0x180e('0x2'));var interval=require(_0x180e('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x180e('0x4'));var smsQueue=require(_0x180e('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x180e('0x6'));var whatsappQueue=require(_0x180e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x180e('0x8')](user[_0x180e('0x9')]())[_0x180e('0x8')](realtime[_0x180e('0xa')]())[_0x180e('0x8')](interval[_0x180e('0xb')]())['then'](realtime[_0x180e('0xc')]())[_0x180e('0x8')](openchannelQueue[_0x180e('0xd')]())[_0x180e('0x8')](realtime['initOpenchannelQueues']())[_0x180e('0x8')](chatQueue[_0x180e('0xe')]())['then'](realtime[_0x180e('0xf')]())['then'](smsQueue[_0x180e('0x10')]())[_0x180e('0x8')](realtime['initSmsQueues']())['then'](mailQueue[_0x180e('0x11')]())[_0x180e('0x8')](realtime['initMailQueues']())['then'](faxQueue[_0x180e('0x12')]())[_0x180e('0x8')](realtime[_0x180e('0x13')]())['then'](whatsappQueue[_0x180e('0x14')]())[_0x180e('0x8')](realtime[_0x180e('0x15')]())[_0x180e('0x8')](function(){return realtime;});}function main(){return server[_0x180e('0x16')](realtime)[_0x180e('0x8')](function(_0x47953d){return initRealtime();})[_0x180e('0x8')](function(_0xdfc151){return setInterval(initRealtime,0x1388);})[_0x180e('0x17')](function(_0x46e20e){console[_0x180e('0x18')](_0x46e20e);});}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 d407356..537461e 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x43f2f4,_0x56ca0d){var _0x441f67=function(_0x5cac99){while(--_0x5cac99){_0x43f2f4['push'](_0x43f2f4['shift']());}};_0x441f67(++_0x56ca0d);}(_0x7a54,0x106));var _0x47a5=function(_0x42ed68,_0x4c28fa){_0x42ed68=_0x42ed68-0x0;var _0x2388e5=_0x7a54[_0x42ed68];return _0x2388e5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x1fa6ff,_0xf15124){var _0x1d7b95=function(_0x134e1d){while(--_0x134e1d){_0x1fa6ff['push'](_0x1fa6ff['shift']());}};_0x1d7b95(++_0xf15124);}(_0xe14b,0x93));var _0xbe14=function(_0x6e7432,_0x358bd0){_0x6e7432=_0x6e7432-0x0;var _0x361528=_0xe14b[_0x6e7432];return _0x361528;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 8978b43..2b1bd7d 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 _0xaf66=['client','http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x574159,_0x952110){var _0x5dd226=function(_0x5a32f2){while(--_0x5a32f2){_0x574159['push'](_0x574159['shift']());}};_0x5dd226(++_0x952110);}(_0xaf66,0x1b7));var _0x6af6=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0xaf66[_0x138d06];return _0x1a01eb;};'use strict';var BPromise=require(_0x6af6('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x6af6('0x1')][_0x6af6('0x2')]({'port':0x232b});function request(_0x169df1,_0x5ef8b3){return new BPromise(function(_0x1c2a56,_0x331882){return client[_0x6af6('0x3')](_0x169df1,_0x5ef8b3)[_0x6af6('0x4')](function(_0x4ec852){if(_0x4ec852['error']){return _0x331882(_0x4ec852[_0x6af6('0x5')][_0x6af6('0x6')]);}else{return _0x1c2a56(_0x4ec852[_0x6af6('0x7')]);}})[_0x6af6('0x8')](function(_0x1fe4d6){return _0x331882(_0x1fe4d6);});});}exports[_0x6af6('0x9')]=function(_0x36692d,_0x548164){return request(_0x6af6('0xa'),{'account':_0x36692d,'message':_0x548164});}; \ No newline at end of file +var _0x4fcf=['catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','result'];(function(_0x4f5de4,_0x286cb4){var _0x57b780=function(_0x489554){while(--_0x489554){_0x4f5de4['push'](_0x4f5de4['shift']());}};_0x57b780(++_0x286cb4);}(_0x4fcf,0x70));var _0xf4fc=function(_0x5a84c1,_0x50f737){_0x5a84c1=_0x5a84c1-0x0;var _0x4bf171=_0x4fcf[_0x5a84c1];return _0x4bf171;};'use strict';var BPromise=require(_0xf4fc('0x0'));var jayson=require(_0xf4fc('0x1'));var client=jayson[_0xf4fc('0x2')][_0xf4fc('0x3')]({'port':0x232b});function request(_0x370f61,_0x3b319b){return new BPromise(function(_0x163465,_0x9fcd1a){return client[_0xf4fc('0x4')](_0x370f61,_0x3b319b)[_0xf4fc('0x5')](function(_0x1de570){if(_0x1de570[_0xf4fc('0x6')]){return _0x9fcd1a(_0x1de570['error']['message']);}else{return _0x163465(_0x1de570[_0xf4fc('0x7')]);}})[_0xf4fc('0x8')](function(_0x2e9896){return _0x9fcd1a(_0x2e9896);});});}exports[_0xf4fc('0x9')]=function(_0x10c3c7,_0x5c3ae9){return request('SendMail',{'account':_0x10c3c7,'message':_0x5c3ae9});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 5d94b0c..f83cae6 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 _0xbac2=['user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','StatusTime','toNumber','format','Status','chatStatus','mailCurrentCapacity','smsStatus','whatsappWaitingInteractions','emit'];(function(_0x4e753f,_0x534cde){var _0x1e1960=function(_0x449b51){while(--_0x449b51){_0x4e753f['push'](_0x4e753f['shift']());}};_0x1e1960(++_0x534cde);}(_0xbac2,0x194));var _0x2bac=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xbac2[_0xce9195];return _0x530fe6;};'use strict';var _=require(_0x2bac('0x0'));var moment=require(_0x2bac('0x1'));var md5=require(_0x2bac('0x2'));var Redis=require('ioredis');var config=require(_0x2bac('0x3'));config[_0x2bac('0x4')]=_[_0x2bac('0x5')](config[_0x2bac('0x4')],{'host':_0x2bac('0x6'),'port':0x18eb});var io=require(_0x2bac('0x7'))(new Redis(config['redis']));function Agent(_0x4dc218){this['id']=_0x4dc218['id']||0x0;this[_0x2bac('0x8')]=_0x4dc218['name']||'';this[_0x2bac('0x9')]=_0x4dc218['online']||!![];this[_0x2bac('0xa')]=_0x4dc218['voicePause']||![];this[_0x2bac('0xb')]=_0x4dc218[_0x2bac('0xb')]||![];this[_0x2bac('0xc')]=_0x4dc218['mailPause']||![];this['faxPause']=_0x4dc218[_0x2bac('0xd')]||![];this[_0x2bac('0xe')]=_0x4dc218[_0x2bac('0xe')]||![];this['openchannelPause']=_0x4dc218[_0x2bac('0xf')]||![];this['chatStatus']=_0x2bac('0x10');this[_0x2bac('0x11')]=0x0;this[_0x2bac('0x12')]=_0x4dc218['chatCapacity']||0x0;this[_0x2bac('0x13')]=0x0;this[_0x2bac('0x14')]=_0x2bac('0x10');this[_0x2bac('0x15')]=0x0;this[_0x2bac('0x16')]=_0x4dc218['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x2bac('0x17')]=_0x2bac('0x10');this[_0x2bac('0x18')]=0x0;this[_0x2bac('0x19')]=_0x4dc218[_0x2bac('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0x2bac('0x10');this[_0x2bac('0x1a')]=0x0;this[_0x2bac('0x1b')]=_0x4dc218[_0x2bac('0x1b')]||0x0;this[_0x2bac('0x1c')]=0x0;this[_0x2bac('0x1d')]='unknown';this[_0x2bac('0x1e')]=0x0;this['whatsappCapacity']=_0x4dc218[_0x2bac('0x1f')]||0x0;this[_0x2bac('0x20')]=0x0;this[_0x2bac('0x21')]=_0x2bac('0x10');this[_0x2bac('0x22')]=0x0;this[_0x2bac('0x23')]=_0x4dc218[_0x2bac('0x23')]||0x0;this[_0x2bac('0x24')]=0x0;this[_0x2bac('0x25')]=![];this[_0x2bac('0x26')]=undefined;this['md5']='';this[_0x2bac('0x27')]={};this[_0x2bac('0x28')]={};this[_0x2bac('0x29')]={};this[_0x2bac('0x2a')]={};this[_0x2bac('0x2b')]={};this['whatsappWaitingInteractions']={};this[_0x2bac('0x2c')]();}Agent[_0x2bac('0x2d')][_0x2bac('0x2e')]=function(_0x50232c){if(this[_0x50232c+_0x2bac('0x2f')]>0x0){if(this[_0x50232c+'Capacity']>0x0&&this[_0x50232c+_0x2bac('0x2f')]>=this[_0x50232c+_0x2bac('0x30')]){return _0x2bac('0x31');}else{return _0x2bac('0x32');}}else{return _0x2bac('0x33');}};Agent[_0x2bac('0x2d')]['updateRealtime']=function(){var _0x227605=[_0x2bac('0x34'),_0x2bac('0x35'),'openchannel',_0x2bac('0x36'),_0x2bac('0x37'),'whatsapp'];for(var _0x553ff5=0x0;_0x553ff5<_0x227605['length'];_0x553ff5+=0x1){var _0x4e37e1=this[_0x2bac('0x2e')](_0x227605[_0x553ff5]);if(this[_0x227605[_0x553ff5]+'Status']!==_0x4e37e1){this[_0x227605[_0x553ff5]+_0x2bac('0x38')]=_[_0x2bac('0x39')](moment()[_0x2bac('0x3a')]('x'));}this[_0x227605[_0x553ff5]+_0x2bac('0x3b')]=_0x4e37e1;}var _0x5bf070={'id':this['id'],'name':this[_0x2bac('0x8')],'online':this[_0x2bac('0x9')],'voicePause':this[_0x2bac('0xa')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x2bac('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0x2bac('0xf')],'chatStatus':this[_0x2bac('0x3c')],'chatStatusTime':this[_0x2bac('0x11')],'chatCapacity':this[_0x2bac('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x2bac('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x2bac('0x3d')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x2bac('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x2bac('0x3e')],'smsStatusTime':this[_0x2bac('0x1a')],'smsCapacity':this[_0x2bac('0x1b')],'smsCurrentCapacity':this[_0x2bac('0x1c')],'whatsappStatus':this[_0x2bac('0x1d')],'whatsappStatusTime':this[_0x2bac('0x1e')],'whatsappCapacity':this[_0x2bac('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2bac('0x21')],'openchannelStatusTime':this[_0x2bac('0x22')],'openchannelCapacity':this[_0x2bac('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x2bac('0x27')],'faxWaitingInteractions':this[_0x2bac('0x28')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x2bac('0x2b')],'whatsappWaitingInteractions':this[_0x2bac('0x3f')]};var _0x1e2604=md5(JSON['stringify'](_0x5bf070));if(this[_0x2bac('0x2')]!==_0x1e2604){this['md5']=_0x1e2604;io[_0x2bac('0x40')](_0x2bac('0x41'),_0x5bf070);}};module[_0x2bac('0x42')]=Agent; \ No newline at end of file +var _0x3e03=['localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','openchannel','sms','whatsapp','length','Status','StatusTime','format','chatStatusTime','mailStatus','faxCapacity','whatsappCurrentCapacity','busy','chatWaitingInteractions','stringify','user:save','exports','lodash','moment','../../../config/environment','defaults','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e03,0xf7));var _0x33e0=function(_0x414f67,_0x861aed){_0x414f67=_0x414f67-0x0;var _0x338537=_0x3e03[_0x414f67];return _0x338537;};'use strict';var _=require(_0x33e0('0x0'));var moment=require(_0x33e0('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x33e0('0x2'));config['redis']=_[_0x33e0('0x3')](config[_0x33e0('0x4')],{'host':_0x33e0('0x5'),'port':0x18eb});var io=require(_0x33e0('0x6'))(new Redis(config[_0x33e0('0x4')]));function Agent(_0x16c535){this['id']=_0x16c535['id']||0x0;this[_0x33e0('0x7')]=_0x16c535[_0x33e0('0x7')]||'';this[_0x33e0('0x8')]=_0x16c535['online']||!![];this[_0x33e0('0x9')]=_0x16c535['voicePause']||![];this[_0x33e0('0xa')]=_0x16c535['chatPause']||![];this[_0x33e0('0xb')]=_0x16c535[_0x33e0('0xb')]||![];this[_0x33e0('0xc')]=_0x16c535[_0x33e0('0xc')]||![];this[_0x33e0('0xd')]=_0x16c535[_0x33e0('0xd')]||![];this[_0x33e0('0xe')]=_0x16c535[_0x33e0('0xe')]||![];this[_0x33e0('0xf')]=_0x33e0('0x10');this['chatStatusTime']=0x0;this[_0x33e0('0x11')]=_0x16c535[_0x33e0('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this[_0x33e0('0x12')]=0x0;this[_0x33e0('0x13')]=_0x16c535['mailCapacity']||0x0;this[_0x33e0('0x14')]=0x0;this['faxStatus']=_0x33e0('0x10');this[_0x33e0('0x15')]=0x0;this['faxCapacity']=_0x16c535['faxCapacity']||0x0;this[_0x33e0('0x16')]=0x0;this[_0x33e0('0x17')]=_0x33e0('0x10');this[_0x33e0('0x18')]=0x0;this[_0x33e0('0x19')]=_0x16c535[_0x33e0('0x19')]||0x0;this[_0x33e0('0x1a')]=0x0;this['whatsappStatus']='unknown';this[_0x33e0('0x1b')]=0x0;this['whatsappCapacity']=_0x16c535[_0x33e0('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x33e0('0x1d')]=_0x33e0('0x10');this[_0x33e0('0x1e')]=0x0;this[_0x33e0('0x1f')]=_0x16c535[_0x33e0('0x1f')]||0x0;this[_0x33e0('0x20')]=0x0;this['busy']=![];this[_0x33e0('0x21')]=undefined;this[_0x33e0('0x22')]='';this['chatWaitingInteractions']={};this[_0x33e0('0x23')]={};this[_0x33e0('0x24')]={};this[_0x33e0('0x25')]={};this[_0x33e0('0x26')]={};this[_0x33e0('0x27')]={};this[_0x33e0('0x28')]();}Agent[_0x33e0('0x29')][_0x33e0('0x2a')]=function(_0x8a3e0d){if(this[_0x8a3e0d+_0x33e0('0x2b')]>0x0){if(this[_0x8a3e0d+_0x33e0('0x2c')]>0x0&&this[_0x8a3e0d+_0x33e0('0x2b')]>=this[_0x8a3e0d+_0x33e0('0x2c')]){return _0x33e0('0x2d');}else{return'working';}}else{return _0x33e0('0x2e');}};Agent[_0x33e0('0x29')][_0x33e0('0x28')]=function(){var _0x3abea2=['mail','chat',_0x33e0('0x2f'),'fax',_0x33e0('0x30'),_0x33e0('0x31')];for(var _0x38fa51=0x0;_0x38fa51<_0x3abea2[_0x33e0('0x32')];_0x38fa51+=0x1){var _0xab7110=this[_0x33e0('0x2a')](_0x3abea2[_0x38fa51]);if(this[_0x3abea2[_0x38fa51]+_0x33e0('0x33')]!==_0xab7110){this[_0x3abea2[_0x38fa51]+_0x33e0('0x34')]=_['toNumber'](moment()[_0x33e0('0x35')]('x'));}this[_0x3abea2[_0x38fa51]+_0x33e0('0x33')]=_0xab7110;}var _0x6ba08={'id':this['id'],'name':this[_0x33e0('0x7')],'online':this['online'],'voicePause':this[_0x33e0('0x9')],'chatPause':this[_0x33e0('0xa')],'mailPause':this[_0x33e0('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x33e0('0xc')],'openchannelPause':this[_0x33e0('0xe')],'chatStatus':this[_0x33e0('0xf')],'chatStatusTime':this[_0x33e0('0x36')],'chatCapacity':this[_0x33e0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x33e0('0x37')],'mailStatusTime':this[_0x33e0('0x12')],'mailCapacity':this[_0x33e0('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x33e0('0x38')],'faxCurrentCapacity':this[_0x33e0('0x16')],'smsStatus':this[_0x33e0('0x17')],'smsStatusTime':this[_0x33e0('0x18')],'smsCapacity':this[_0x33e0('0x19')],'smsCurrentCapacity':this[_0x33e0('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x33e0('0x1b')],'whatsappCapacity':this[_0x33e0('0x1c')],'whatsappCurrentCapacity':this[_0x33e0('0x39')],'openchannelStatus':this[_0x33e0('0x1d')],'openchannelStatusTime':this[_0x33e0('0x1e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x33e0('0x3a')],'busyQueue':this[_0x33e0('0x21')],'chatWaitingInteractions':this[_0x33e0('0x3b')],'faxWaitingInteractions':this[_0x33e0('0x23')],'mailWaitingInteractions':this[_0x33e0('0x24')],'openchannelWaitingInteractions':this[_0x33e0('0x25')],'smsWaitingInteractions':this[_0x33e0('0x26')],'whatsappWaitingInteractions':this[_0x33e0('0x27')]};var _0x20e1f9=md5(JSON[_0x33e0('0x3c')](_0x6ba08));if(this['md5']!==_0x20e1f9){this['md5']=_0x20e1f9;io['emit'](_0x33e0('0x3d'),_0x6ba08);}};module[_0x33e0('0x3e')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 807d4a4..bca4178 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 _0x78ed=['available','stringify','format','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','loggedIn','paused','length','online','chatPause'];(function(_0x15bc2f,_0x25e563){var _0x574008=function(_0x220bee){while(--_0x220bee){_0x15bc2f['push'](_0x15bc2f['shift']());}};_0x574008(++_0x25e563);}(_0x78ed,0xdd));var _0xd78e=function(_0x50aad6,_0x35db56){_0x50aad6=_0x50aad6-0x0;var _0xc4c702=_0x78ed[_0x50aad6];return _0xc4c702;};'use strict';var _=require('lodash');var md5=require(_0xd78e('0x0'));var util=require(_0xd78e('0x1'));var Redis=require(_0xd78e('0x2'));var config=require(_0xd78e('0x3'));config[_0xd78e('0x4')]=_[_0xd78e('0x5')](config[_0xd78e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd78e('0x6'))(new Redis(config['redis']));function ChatQueue(_0x558131){this['id']=_0x558131['id']||0x0;this['name']=_0x558131[_0xd78e('0x7')]||'';this[_0xd78e('0x8')]=_0x558131[_0xd78e('0x8')]||0xa;this[_0xd78e('0x9')]=_0x558131['strategy']||'beepall';this[_0xd78e('0xa')]=_0x558131['Agents'];this[_0xd78e('0xb')]={};this[_0xd78e('0xc')]=0x0;this[_0xd78e('0x0')]='';this['updateRouting']();this[_0xd78e('0xd')]();}ChatQueue['prototype'][_0xd78e('0xe')]=function(){var _0xd61876=this[_0xd78e('0xb')][_0xd78e('0xf')];this['mapAgentsId']=_[_0xd78e('0x10')](this['Agents'],'id');this[_0xd78e('0xb')][_0xd78e('0xf')]=_0xd61876;};ChatQueue['prototype'][_0xd78e('0xd')]=function(){this[_0xd78e('0x11')]=0x0;this[_0xd78e('0x12')]=0x0;for(var _0x1091e8=0x0;_0x1091e8=0x0?this[_0xd78e('0x16')]:0x0;var _0x2e63bf={'id':this['id'],'available':this[_0xd78e('0x16')],'loggedIn':this[_0xd78e('0x11')],'name':this[_0xd78e('0x7')],'paused':this['paused'],'waiting':this[_0xd78e('0xc')]};var _0x44751d=md5(JSON[_0xd78e('0x17')](_0x2e63bf));if(this['md5']!==_0x44751d){this[_0xd78e('0x0')]=_0x44751d;io['to'](util[_0xd78e('0x18')]('chat:queue:%s',_0x2e63bf[_0xd78e('0x7')]))['emit'](_0xd78e('0x19'),_0x2e63bf);}};module[_0xd78e('0x1a')]=ChatQueue; \ No newline at end of file +var _0x58b7=['md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','chatPause','paused','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash'];(function(_0x4fee31,_0x6905e3){var _0x27d650=function(_0x583e4e){while(--_0x583e4e){_0x4fee31['push'](_0x4fee31['shift']());}};_0x27d650(++_0x6905e3);}(_0x58b7,0x178));var _0x758b=function(_0x1a2e2e,_0x369a71){_0x1a2e2e=_0x1a2e2e-0x0;var _0x3c38b7=_0x58b7[_0x1a2e2e];return _0x3c38b7;};'use strict';var _=require(_0x758b('0x0'));var md5=require(_0x758b('0x1'));var util=require('util');var Redis=require(_0x758b('0x2'));var config=require(_0x758b('0x3'));config[_0x758b('0x4')]=_[_0x758b('0x5')](config[_0x758b('0x4')],{'host':_0x758b('0x6'),'port':0x18eb});var io=require(_0x758b('0x7'))(new Redis(config[_0x758b('0x4')]));function ChatQueue(_0xf53595){this['id']=_0xf53595['id']||0x0;this['name']=_0xf53595[_0x758b('0x8')]||'';this[_0x758b('0x9')]=_0xf53595[_0x758b('0x9')]||0xa;this[_0x758b('0xa')]=_0xf53595['strategy']||'beepall';this[_0x758b('0xb')]=_0xf53595['Agents'];this[_0x758b('0xc')]={};this[_0x758b('0xd')]=0x0;this[_0x758b('0x1')]='';this[_0x758b('0xe')]();this[_0x758b('0xf')]();}ChatQueue[_0x758b('0x10')][_0x758b('0xe')]=function(){var _0x5b4ffb=this[_0x758b('0xc')][_0x758b('0x11')];this['mapAgentsId']=_[_0x758b('0x12')](this[_0x758b('0xb')],'id');this[_0x758b('0xc')][_0x758b('0x11')]=_0x5b4ffb;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x758b('0x13')]=0x0;this['paused']=0x0;for(var _0xebb875=0x0;_0xebb875=0x0?this[_0x758b('0x17')]:0x0;var _0x20662b={'id':this['id'],'available':this[_0x758b('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x758b('0x8')],'paused':this[_0x758b('0x16')],'waiting':this[_0x758b('0xd')]};var _0x3edede=md5(JSON[_0x758b('0x18')](_0x20662b));if(this[_0x758b('0x1')]!==_0x3edede){this[_0x758b('0x1')]=_0x3edede;io['to'](util[_0x758b('0x19')](_0x758b('0x1a'),_0x20662b[_0x758b('0x8')]))['emit'](_0x758b('0x1b'),_0x20662b);}};module[_0x758b('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 c73df9a..024df1b 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 _0xeba8=['fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','prototype','_rr','map','mapAgentsId','updateRealtime','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','emit'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xeba8,0x110));var _0x8eba=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xeba8[_0x213ed5];return _0x191514;};'use strict';var _=require(_0x8eba('0x0'));var md5=require(_0x8eba('0x1'));var util=require(_0x8eba('0x2'));var Redis=require(_0x8eba('0x3'));var config=require(_0x8eba('0x4'));config[_0x8eba('0x5')]=_[_0x8eba('0x6')](config[_0x8eba('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8eba('0x7'))(new Redis(config[_0x8eba('0x5')]));function FaxQueue(_0x2dc79b){this['id']=_0x2dc79b['id']||0x0;this[_0x8eba('0x8')]=_0x2dc79b[_0x8eba('0x8')]||'';this['timeout']=_0x2dc79b[_0x8eba('0x9')]||0xa;this[_0x8eba('0xa')]=_0x2dc79b[_0x8eba('0xa')]||'beepall';this[_0x8eba('0xb')]=_0x2dc79b['Agents'];this['mapAgentsId']={};this[_0x8eba('0xc')]=0x0;this[_0x8eba('0x1')]='';this[_0x8eba('0xd')]();this['updateRealtime']();}FaxQueue[_0x8eba('0xe')]['updateRouting']=function(){var _0x50c4bd=this['mapAgentsId'][_0x8eba('0xf')];this['mapAgentsId']=_[_0x8eba('0x10')](this[_0x8eba('0xb')],'id');this[_0x8eba('0x11')]['_rr']=_0x50c4bd;};FaxQueue[_0x8eba('0xe')][_0x8eba('0x12')]=function(){this[_0x8eba('0x13')]=0x0;this[_0x8eba('0x14')]=0x0;for(var _0x47b8f6=0x0;_0x47b8f6=0x0?this[_0x8eba('0x17')]:0x0;var _0x4df59a={'id':this['id'],'available':this[_0x8eba('0x17')],'loggedIn':this[_0x8eba('0x13')],'name':this['name'],'paused':this[_0x8eba('0x14')],'waiting':this[_0x8eba('0xc')]};var _0xbb02a3=md5(JSON[_0x8eba('0x18')](_0x4df59a));if(this[_0x8eba('0x1')]!==_0xbb02a3){this[_0x8eba('0x1')]=_0xbb02a3;io['to'](util[_0x8eba('0x19')](_0x8eba('0x1a'),_0x4df59a[_0x8eba('0x8')]))[_0x8eba('0x1b')](_0x8eba('0x1c'),_0x4df59a);}};module[_0x8eba('0x1d')]=FaxQueue; \ No newline at end of file +var _0x3fb5=['md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','_rr','mapAgentsId','map','prototype','loggedIn','paused','online','faxPause','available','fax:queue:%s','emit','fax_queue:save','lodash'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x3fb5,0x81));var _0x53fb=function(_0x3c7be2,_0xf34efd){_0x3c7be2=_0x3c7be2-0x0;var _0x2a1968=_0x3fb5[_0x3c7be2];return _0x2a1968;};'use strict';var _=require(_0x53fb('0x0'));var md5=require(_0x53fb('0x1'));var util=require(_0x53fb('0x2'));var Redis=require('ioredis');var config=require(_0x53fb('0x3'));config['redis']=_[_0x53fb('0x4')](config[_0x53fb('0x5')],{'host':_0x53fb('0x6'),'port':0x18eb});var io=require(_0x53fb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x305f67){this['id']=_0x305f67['id']||0x0;this[_0x53fb('0x8')]=_0x305f67[_0x53fb('0x8')]||'';this['timeout']=_0x305f67['timeout']||0xa;this[_0x53fb('0x9')]=_0x305f67[_0x53fb('0x9')]||_0x53fb('0xa');this[_0x53fb('0xb')]=_0x305f67[_0x53fb('0xb')];this['mapAgentsId']={};this[_0x53fb('0xc')]=0x0;this[_0x53fb('0x1')]='';this[_0x53fb('0xd')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x3cf926=this['mapAgentsId'][_0x53fb('0xe')];this[_0x53fb('0xf')]=_[_0x53fb('0x10')](this[_0x53fb('0xb')],'id');this[_0x53fb('0xf')][_0x53fb('0xe')]=_0x3cf926;};FaxQueue[_0x53fb('0x11')]['updateRealtime']=function(){this[_0x53fb('0x12')]=0x0;this[_0x53fb('0x13')]=0x0;for(var _0x1637e5=0x0;_0x1637e5=0x0?this[_0x53fb('0x16')]:0x0;var _0x522102={'id':this['id'],'available':this[_0x53fb('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x53fb('0x8')],'paused':this[_0x53fb('0x13')],'waiting':this[_0x53fb('0xc')]};var _0x22635a=md5(JSON['stringify'](_0x522102));if(this[_0x53fb('0x1')]!==_0x22635a){this[_0x53fb('0x1')]=_0x22635a;io['to'](util['format'](_0x53fb('0x17'),_0x522102[_0x53fb('0x8')]))[_0x53fb('0x18')](_0x53fb('0x19'),_0x522102);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 49769fe..b2ba9ed 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 _0x0250=['Intervals','exports'];(function(_0x21ce79,_0x216254){var _0x55d519=function(_0x3dbb56){while(--_0x3dbb56){_0x21ce79['push'](_0x21ce79['shift']());}};_0x55d519(++_0x216254);}(_0x0250,0x112));var _0x0025=function(_0x54db7d,_0x2e1f1a){_0x54db7d=_0x54db7d-0x0;var _0x37418b=_0x0250[_0x54db7d];return _0x37418b;};'use strict';function Interval(_0xe3e572){this['id']=_0xe3e572['id']||0x0;this['name']=_0xe3e572['name']||'';this[_0x0025('0x0')]=_0xe3e572[_0x0025('0x0')]||{};}module[_0x0025('0x1')]=Interval; \ No newline at end of file +var _0x3e91=['exports','name','Intervals'];(function(_0x1aa2a3,_0x54ffda){var _0x5c43d0=function(_0x5def83){while(--_0x5def83){_0x1aa2a3['push'](_0x1aa2a3['shift']());}};_0x5c43d0(++_0x54ffda);}(_0x3e91,0x1db));var _0x13e9=function(_0x3a235a,_0x1e593f){_0x3a235a=_0x3a235a-0x0;var _0x1a6e21=_0x3e91[_0x3a235a];return _0x1a6e21;};'use strict';function Interval(_0x4cbcea){this['id']=_0x4cbcea['id']||0x0;this['name']=_0x4cbcea[_0x13e9('0x0')]||'';this['Intervals']=_0x4cbcea[_0x13e9('0x1')]||{};}module[_0x13e9('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 12936df..900cda8 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 _0xee2f=['waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x46a25e,_0x15189c){var _0x576876=function(_0x271328){while(--_0x271328){_0x46a25e['push'](_0x46a25e['shift']());}};_0x576876(++_0x15189c);}(_0xee2f,0x8e));var _0xfee2=function(_0x4186fe,_0x57d234){_0x4186fe=_0x4186fe-0x0;var _0x45d201=_0xee2f[_0x4186fe];return _0x45d201;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xfee2('0x0'));var Redis=require(_0xfee2('0x1'));var config=require(_0xfee2('0x2'));config[_0xfee2('0x3')]=_[_0xfee2('0x4')](config[_0xfee2('0x3')],{'host':_0xfee2('0x5'),'port':0x18eb});var io=require(_0xfee2('0x6'))(new Redis(config[_0xfee2('0x3')]));function MailQueue(_0x4061a6){this['id']=_0x4061a6['id']||0x0;this['name']=_0x4061a6[_0xfee2('0x7')]||'';this[_0xfee2('0x8')]=_0x4061a6[_0xfee2('0x8')]||0xa;this[_0xfee2('0x9')]=_0x4061a6[_0xfee2('0x9')]||_0xfee2('0xa');this[_0xfee2('0xb')]=_0x4061a6[_0xfee2('0xb')];this[_0xfee2('0xc')]={};this[_0xfee2('0xd')]=0x0;this[_0xfee2('0xe')]='';this[_0xfee2('0xf')]();this[_0xfee2('0x10')]();}MailQueue[_0xfee2('0x11')][_0xfee2('0xf')]=function(){var _0x30d62d=this[_0xfee2('0xc')][_0xfee2('0x12')];this[_0xfee2('0xc')]=_[_0xfee2('0x13')](this[_0xfee2('0xb')],'id');this[_0xfee2('0xc')]['_rr']=_0x30d62d;};MailQueue['prototype'][_0xfee2('0x10')]=function(){this[_0xfee2('0x14')]=0x0;this[_0xfee2('0x15')]=0x0;for(var _0x22de04=0x0;_0x22de04=0x0?this['available']:0x0;var _0x467a3e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfee2('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xfee2('0xd')]};var _0x553624=md5(JSON[_0xfee2('0x1a')](_0x467a3e));if(this['md5']!==_0x553624){this[_0xfee2('0xe')]=_0x553624;io['to'](util['format'](_0xfee2('0x1b'),_0x467a3e[_0xfee2('0x7')]))[_0xfee2('0x1c')](_0xfee2('0x1d'),_0x467a3e);}};module[_0xfee2('0x1e')]=MailQueue; \ No newline at end of file +var _0xa9fe=['online','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length'];(function(_0x23e129,_0x48d1cc){var _0xab1ebe=function(_0x431ed1){while(--_0x431ed1){_0x23e129['push'](_0x23e129['shift']());}};_0xab1ebe(++_0x48d1cc);}(_0xa9fe,0x1c9));var _0xea9f=function(_0x385650,_0x19ea51){_0x385650=_0x385650-0x0;var _0x129a00=_0xa9fe[_0x385650];return _0x129a00;};'use strict';var _=require(_0xea9f('0x0'));var md5=require(_0xea9f('0x1'));var util=require(_0xea9f('0x2'));var Redis=require(_0xea9f('0x3'));var config=require(_0xea9f('0x4'));config['redis']=_[_0xea9f('0x5')](config['redis'],{'host':_0xea9f('0x6'),'port':0x18eb});var io=require(_0xea9f('0x7'))(new Redis(config[_0xea9f('0x8')]));function MailQueue(_0x38e841){this['id']=_0x38e841['id']||0x0;this['name']=_0x38e841[_0xea9f('0x9')]||'';this[_0xea9f('0xa')]=_0x38e841['timeout']||0xa;this[_0xea9f('0xb')]=_0x38e841['strategy']||_0xea9f('0xc');this[_0xea9f('0xd')]=_0x38e841[_0xea9f('0xd')];this[_0xea9f('0xe')]={};this['waiting']=0x0;this[_0xea9f('0x1')]='';this[_0xea9f('0xf')]();this[_0xea9f('0x10')]();}MailQueue['prototype']['updateRouting']=function(){var _0x5cea5b=this['mapAgentsId'][_0xea9f('0x11')];this[_0xea9f('0xe')]=_[_0xea9f('0x12')](this[_0xea9f('0xd')],'id');this['mapAgentsId'][_0xea9f('0x11')]=_0x5cea5b;};MailQueue[_0xea9f('0x13')]['updateRealtime']=function(){this[_0xea9f('0x14')]=0x0;this[_0xea9f('0x15')]=0x0;for(var _0x329bd5=0x0;_0x329bd5=0x0?this[_0xea9f('0x18')]:0x0;var _0x4a063b={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xea9f('0x9')],'paused':this[_0xea9f('0x15')],'waiting':this[_0xea9f('0x19')]};var _0x202ea5=md5(JSON[_0xea9f('0x1a')](_0x4a063b));if(this[_0xea9f('0x1')]!==_0x202ea5){this[_0xea9f('0x1')]=_0x202ea5;io['to'](util[_0xea9f('0x1b')](_0xea9f('0x1c'),_0x4a063b['name']))[_0xea9f('0x1d')](_0xea9f('0x1e'),_0x4a063b);}};module[_0xea9f('0x1f')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2447b75..52ad506 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x326f,0xd1));var _0xf326=function(_0x31bac0,_0x29a1e1){_0x31bac0=_0x31bac0-0x0;var _0x59a317=_0x326f[_0x31bac0];return _0x59a317;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x472ec2,_0x283a46){var _0x2b6118=function(_0x8f7318){while(--_0x8f7318){_0x472ec2['push'](_0x472ec2['shift']());}};_0x2b6118(++_0x283a46);}(_0x814b,0x1a2));var _0xb814=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0x814b[_0x17ebb6];return _0x32ec22;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fe70ec1..973c47d 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 _0xf021=['loggedIn','smsPause','available','paused','waiting','format','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','length','online'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf021,0x18f));var _0x1f02=function(_0x390ef6,_0x1d401c){_0x390ef6=_0x390ef6-0x0;var _0x2fdaac=_0xf021[_0x390ef6];return _0x2fdaac;};'use strict';var _=require(_0x1f02('0x0'));var md5=require(_0x1f02('0x1'));var util=require(_0x1f02('0x2'));var Redis=require(_0x1f02('0x3'));var config=require(_0x1f02('0x4'));config['redis']=_[_0x1f02('0x5')](config['redis'],{'host':_0x1f02('0x6'),'port':0x18eb});var io=require(_0x1f02('0x7'))(new Redis(config['redis']));function SmsQueue(_0x532e6d){this['id']=_0x532e6d['id']||0x0;this[_0x1f02('0x8')]=_0x532e6d['name']||'';this[_0x1f02('0x9')]=_0x532e6d[_0x1f02('0x9')]||0xa;this[_0x1f02('0xa')]=_0x532e6d[_0x1f02('0xa')]||_0x1f02('0xb');this['Agents']=_0x532e6d[_0x1f02('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x1f02('0xd')]();this[_0x1f02('0xe')]();}SmsQueue[_0x1f02('0xf')][_0x1f02('0xd')]=function(){var _0x3c2b15=this['mapAgentsId'][_0x1f02('0x10')];this[_0x1f02('0x11')]=_[_0x1f02('0x12')](this['Agents'],'id');this[_0x1f02('0x11')][_0x1f02('0x10')]=_0x3c2b15;};SmsQueue[_0x1f02('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x11ba7e=0x0;_0x11ba7e=0x0?this[_0x1f02('0x17')]:0x0;var _0x2cd7db={'id':this['id'],'available':this[_0x1f02('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x1f02('0x8')],'paused':this[_0x1f02('0x18')],'waiting':this[_0x1f02('0x19')]};var _0x23dfe4=md5(JSON['stringify'](_0x2cd7db));if(this['md5']!==_0x23dfe4){this[_0x1f02('0x1')]=_0x23dfe4;io['to'](util[_0x1f02('0x1a')]('sms:queue:%s',_0x2cd7db['name']))[_0x1f02('0x1b')](_0x1f02('0x1c'),_0x2cd7db);}};module[_0x1f02('0x1d')]=SmsQueue; \ No newline at end of file +var _0x24cd=['beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy'];(function(_0x21e434,_0x553872){var _0x5a5f43=function(_0x2ab1a9){while(--_0x2ab1a9){_0x21e434['push'](_0x21e434['shift']());}};_0x5a5f43(++_0x553872);}(_0x24cd,0x83));var _0xd24c=function(_0x46e849,_0x35d765){_0x46e849=_0x46e849-0x0;var _0x29bea7=_0x24cd[_0x46e849];return _0x29bea7;};'use strict';var _=require(_0xd24c('0x0'));var md5=require(_0xd24c('0x1'));var util=require('util');var Redis=require(_0xd24c('0x2'));var config=require('../../../config/environment');config[_0xd24c('0x3')]=_[_0xd24c('0x4')](config[_0xd24c('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd24c('0x5'))(new Redis(config[_0xd24c('0x3')]));function SmsQueue(_0x47c9ea){this['id']=_0x47c9ea['id']||0x0;this[_0xd24c('0x6')]=_0x47c9ea[_0xd24c('0x6')]||'';this[_0xd24c('0x7')]=_0x47c9ea[_0xd24c('0x7')]||0xa;this[_0xd24c('0x8')]=_0x47c9ea[_0xd24c('0x8')]||_0xd24c('0x9');this[_0xd24c('0xa')]=_0x47c9ea['Agents'];this['mapAgentsId']={};this[_0xd24c('0xb')]=0x0;this[_0xd24c('0x1')]='';this[_0xd24c('0xc')]();this[_0xd24c('0xd')]();}SmsQueue[_0xd24c('0xe')][_0xd24c('0xc')]=function(){var _0x1060a3=this[_0xd24c('0xf')]['_rr'];this[_0xd24c('0xf')]=_[_0xd24c('0x10')](this['Agents'],'id');this[_0xd24c('0xf')][_0xd24c('0x11')]=_0x1060a3;};SmsQueue[_0xd24c('0xe')][_0xd24c('0xd')]=function(){this[_0xd24c('0x12')]=0x0;this[_0xd24c('0x13')]=0x0;for(var _0x2c29c6=0x0;_0x2c29c6=0x0?this[_0xd24c('0x16')]:0x0;var _0x524158={'id':this['id'],'available':this[_0xd24c('0x16')],'loggedIn':this[_0xd24c('0x12')],'name':this[_0xd24c('0x6')],'paused':this[_0xd24c('0x13')],'waiting':this['waiting']};var _0x35de97=md5(JSON['stringify'](_0x524158));if(this[_0xd24c('0x1')]!==_0x35de97){this[_0xd24c('0x1')]=_0x35de97;io['to'](util[_0xd24c('0x17')](_0xd24c('0x18'),_0x524158[_0xd24c('0x6')]))[_0xd24c('0x19')](_0xd24c('0x1a'),_0x524158);}};module[_0xd24c('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9fd9203..87061ea 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 _0x37d9=['format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','updateRealtime','loggedIn','whatsappPause','paused','available','waiting'];(function(_0x132010,_0x587f83){var _0x50a5db=function(_0xc24ad3){while(--_0xc24ad3){_0x132010['push'](_0x132010['shift']());}};_0x50a5db(++_0x587f83);}(_0x37d9,0xee));var _0x937d=function(_0xde3374,_0x5dcdf9){_0xde3374=_0xde3374-0x0;var _0x37042f=_0x37d9[_0xde3374];return _0x37042f;};'use strict';var _=require(_0x937d('0x0'));var md5=require(_0x937d('0x1'));var util=require('util');var Redis=require(_0x937d('0x2'));var config=require(_0x937d('0x3'));config[_0x937d('0x4')]=_['defaults'](config[_0x937d('0x4')],{'host':_0x937d('0x5'),'port':0x18eb});var io=require(_0x937d('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x57d83e){this['id']=_0x57d83e['id']||0x0;this[_0x937d('0x7')]=_0x57d83e[_0x937d('0x7')]||'';this[_0x937d('0x8')]=_0x57d83e[_0x937d('0x8')]||0xa;this[_0x937d('0x9')]=_0x57d83e[_0x937d('0x9')]||_0x937d('0xa');this[_0x937d('0xb')]=_0x57d83e[_0x937d('0xb')];this[_0x937d('0xc')]={};this['waiting']=0x0;this[_0x937d('0x1')]='';this[_0x937d('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x937d('0xe')][_0x937d('0xd')]=function(){var _0x2c9edc=this[_0x937d('0xc')]['_rr'];this[_0x937d('0xc')]=_[_0x937d('0xf')](this[_0x937d('0xb')],'id');this[_0x937d('0xc')]['_rr']=_0x2c9edc;};WhatsappQueue[_0x937d('0xe')][_0x937d('0x10')]=function(){this[_0x937d('0x11')]=0x0;this['paused']=0x0;for(var _0x5b7af2=0x0;_0x5b7af2=0x0?this['available']:0x0;var _0x225b08={'id':this['id'],'available':this[_0x937d('0x14')],'loggedIn':this[_0x937d('0x11')],'name':this[_0x937d('0x7')],'paused':this[_0x937d('0x13')],'waiting':this[_0x937d('0x15')]};var _0x256d0b=md5(JSON['stringify'](_0x225b08));if(this[_0x937d('0x1')]!==_0x256d0b){this['md5']=_0x256d0b;io['to'](util[_0x937d('0x16')](_0x937d('0x17'),_0x225b08[_0x937d('0x7')]))[_0x937d('0x18')](_0x937d('0x19'),_0x225b08);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x0b15=['available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length'];(function(_0x6bd228,_0x1b13d8){var _0xb0d3c9=function(_0x132b93){while(--_0x132b93){_0x6bd228['push'](_0x6bd228['shift']());}};_0xb0d3c9(++_0x1b13d8);}(_0x0b15,0xca));var _0x50b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b15[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50b1('0x0'));var md5=require(_0x50b1('0x1'));var util=require(_0x50b1('0x2'));var Redis=require(_0x50b1('0x3'));var config=require(_0x50b1('0x4'));config[_0x50b1('0x5')]=_[_0x50b1('0x6')](config[_0x50b1('0x5')],{'host':_0x50b1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x50b1('0x5')]));function WhatsappQueue(_0x517e09){this['id']=_0x517e09['id']||0x0;this[_0x50b1('0x8')]=_0x517e09[_0x50b1('0x8')]||'';this[_0x50b1('0x9')]=_0x517e09[_0x50b1('0x9')]||0xa;this[_0x50b1('0xa')]=_0x517e09['strategy']||_0x50b1('0xb');this[_0x50b1('0xc')]=_0x517e09[_0x50b1('0xc')];this[_0x50b1('0xd')]={};this[_0x50b1('0xe')]=0x0;this[_0x50b1('0x1')]='';this[_0x50b1('0xf')]();this[_0x50b1('0x10')]();}WhatsappQueue[_0x50b1('0x11')]['updateRouting']=function(){var _0x5d98e8=this[_0x50b1('0xd')][_0x50b1('0x12')];this[_0x50b1('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x5d98e8;};WhatsappQueue[_0x50b1('0x11')][_0x50b1('0x10')]=function(){this[_0x50b1('0x13')]=0x0;this[_0x50b1('0x14')]=0x0;for(var _0x305b53=0x0;_0x305b53=0x0?this[_0x50b1('0x16')]:0x0;var _0x4dbfd8={'id':this['id'],'available':this[_0x50b1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x50b1('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x410dc5=md5(JSON['stringify'](_0x4dbfd8));if(this[_0x50b1('0x1')]!==_0x410dc5){this['md5']=_0x410dc5;io['to'](util[_0x50b1('0x17')](_0x50b1('0x18'),_0x4dbfd8[_0x50b1('0x8')]))[_0x50b1('0x19')](_0x50b1('0x1a'),_0x4dbfd8);}};module[_0x50b1('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b576f98..ca998ea 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _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(_0x6f8046,_0x226dbc){var _0x42511d=function(_0x49340a){while(--_0x49340a){_0x6f8046['push'](_0x6f8046['shift']());}};_0x42511d(++_0x226dbc);}(_0xb10b,0x12a));var _0xbb10=function(_0x353cd6,_0xc795f6){_0x353cd6=_0x353cd6-0x0;var _0x55712a=_0xb10b[_0x353cd6];return _0x55712a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 53857e8..a5e891f 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 _0x0b5f=['addTagsToChatInteraction','update','Request','updateChatInteraction','addTags'];(function(_0x5398a4,_0x2c6d6b){var _0x38db03=function(_0x31141c){while(--_0x31141c){_0x5398a4['push'](_0x5398a4['shift']());}};_0x38db03(++_0x2c6d6b);}(_0x0b5f,0x88));var _0xf0b5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0b5f[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports[_0xf0b5('0x0')]=function(_0x1b6919,_0xdedb11){return client[_0xf0b5('0x1')]('UpdateChatInteraction',{'body':_0xdedb11,'options':{'where':{'id':_0x1b6919}},'log':_0xf0b5('0x2')});};exports[_0xf0b5('0x3')]=function(_0xa76a9a,_0x12d627){return client['Request']('AddTagsToChatInteraction',{'body':_0x12d627,'options':{'where':{'id':_0xa76a9a}},'log':_0xf0b5('0x4')});}; \ No newline at end of file +var _0xe5bf=['update','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client'];(function(_0x166294,_0x175bc9){var _0x304968=function(_0x119ed1){while(--_0x119ed1){_0x166294['push'](_0x166294['shift']());}};_0x304968(++_0x175bc9);}(_0xe5bf,0x8f));var _0xfe5b=function(_0x2590d9,_0x1c9510){_0x2590d9=_0x2590d9-0x0;var _0x2fe909=_0xe5bf[_0x2590d9];return _0x2fe909;};'use strict';var client=require(_0xfe5b('0x0'));exports[_0xfe5b('0x1')]=function(_0x3b79a4,_0x47381d){return client['Request']('UpdateChatInteraction',{'body':_0x47381d,'options':{'where':{'id':_0x3b79a4}},'log':_0xfe5b('0x2')});};exports[_0xfe5b('0x3')]=function(_0x425f0d,_0x2e5758){return client[_0xfe5b('0x4')](_0xfe5b('0x5'),{'body':_0x2e5758,'options':{'where':{'id':_0x425f0d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0d4aa7a..b6bac27 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 _0x5d3c=['createChatMessage','../client','create'];(function(_0x307fd8,_0x25d8ac){var _0xd3f818=function(_0x2eba75){while(--_0x2eba75){_0x307fd8['push'](_0x307fd8['shift']());}};_0xd3f818(++_0x25d8ac);}(_0x5d3c,0x67));var _0xc5d3=function(_0x36c6ac,_0x15ac4d){_0x36c6ac=_0x36c6ac-0x0;var _0x24c58c=_0x5d3c[_0x36c6ac];return _0x24c58c;};'use strict';var client=require(_0xc5d3('0x0'));exports[_0xc5d3('0x1')]=function(_0xdd9fc){return client['Request']('CreateChatMessage',{'body':_0xdd9fc,'log':_0xc5d3('0x2')});}; \ No newline at end of file +var _0x36e8=['../client','create','Request','createChatMessage'];(function(_0x34f449,_0x296e64){var _0x3dc2a8=function(_0x165037){while(--_0x165037){_0x34f449['push'](_0x34f449['shift']());}};_0x3dc2a8(++_0x296e64);}(_0x36e8,0x174));var _0x836e=function(_0xaee28d,_0x37a9ff){_0xaee28d=_0xaee28d-0x0;var _0x3d6450=_0x36e8[_0xaee28d];return _0x3d6450;};'use strict';var client=require(_0x836e('0x0'));exports[_0x836e('0x1')]=function(_0x13b40c){return client[_0x836e('0x2')]('CreateChatMessage',{'body':_0x13b40c,'log':_0x836e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3ee2c1c..63f0d36 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 _0xdb94=['timeout','strategy','User','Agents','online','getChatQueues','Request','name'];(function(_0x2f405e,_0x1b7f6c){var _0x40ee52=function(_0x120063){while(--_0x120063){_0x2f405e['push'](_0x2f405e['shift']());}};_0x40ee52(++_0x1b7f6c);}(_0xdb94,0xe5));var _0x4db9=function(_0x345458,_0x2b1c17){_0x345458=_0x345458-0x0;var _0x5d814f=_0xdb94[_0x345458];return _0x5d814f;};'use strict';var client=require('../client');exports[_0x4db9('0x0')]=function(){return function(){return client[_0x4db9('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x4db9('0x2'),_0x4db9('0x3'),_0x4db9('0x4')],'include':[{'model':_0x4db9('0x5'),'as':_0x4db9('0x6'),'attributes':['id','name',_0x4db9('0x7'),'chatPause']}]},'log':_0x4db9('0x0')});};}; \ No newline at end of file +var _0xbd50=['Request','name','timeout','strategy','User','Agents','../client','getChatQueues'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0xbd50,0x196));var _0x0bd5=function(_0x16c696,_0x2a7b16){_0x16c696=_0x16c696-0x0;var _0x559265=_0xbd50[_0x16c696];return _0x559265;};'use strict';var client=require(_0x0bd5('0x0'));exports[_0x0bd5('0x1')]=function(){return function(){return client[_0x0bd5('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0bd5('0x3'),_0x0bd5('0x4'),_0x0bd5('0x5')],'include':[{'model':_0x0bd5('0x6'),'as':_0x0bd5('0x7'),'attributes':['id','name','online','chatPause']}]},'log':_0x0bd5('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index fac532c..d4efa8e 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 _0x37a4=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x15a99d,_0x4486ea){var _0x2cb908=function(_0x1243c1){while(--_0x1243c1){_0x15a99d['push'](_0x15a99d['shift']());}};_0x2cb908(++_0x4486ea);}(_0x37a4,0xcb));var _0x437a=function(_0x522df3,_0x26f691){_0x522df3=_0x522df3-0x0;var _0x35f1f3=_0x37a4[_0x522df3];return _0x35f1f3;};'use strict';var client=require(_0x437a('0x0'));exports['create']=function(_0x222222){return client['Request'](_0x437a('0x1'),{'body':_0x222222,'log':_0x437a('0x1')});};exports[_0x437a('0x2')]=function(_0x5bfe6f,_0x5f2883){return client[_0x437a('0x3')](_0x437a('0x4'),{'body':_0x5f2883,'options':{'where':{'uniqueid':_0x5bfe6f},'order':[['id',_0x437a('0x5')]],'limit':0x1},'log':_0x437a('0x4')});}; \ No newline at end of file +var _0xf3dc=['Request','../client','create','CreateChatQueueReport','update'];(function(_0x217542,_0x15cc22){var _0x4bb071=function(_0x5f471b){while(--_0x5f471b){_0x217542['push'](_0x217542['shift']());}};_0x4bb071(++_0x15cc22);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xf3dc[_0x39c734];return _0xb2a2f9;};'use strict';var client=require(_0xcf3d('0x0'));exports[_0xcf3d('0x1')]=function(_0x3a135c){return client['Request'](_0xcf3d('0x2'),{'body':_0x3a135c,'log':_0xcf3d('0x2')});};exports[_0xcf3d('0x3')]=function(_0x226c79,_0x17b83e){return client[_0xcf3d('0x4')]('UpdateChatQueueReport',{'body':_0x17b83e,'options':{'where':{'uniqueid':_0x226c79},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2239021..1aee8a9 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x41b798,_0x18e748){var _0x3ea308=function(_0x54a24e){while(--_0x54a24e){_0x41b798['push'](_0x41b798['shift']());}};_0x3ea308(++_0x18e748);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x7a54,0x106));var _0x47a5=function(_0x120bf6,_0x2c3b69){_0x120bf6=_0x120bf6-0x0;var _0x16aef1=_0x7a54[_0x120bf6];return _0x16aef1;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 5ff33d4..81142cb 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 _0x965d=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x88f2c0,_0x4a7645){var _0x3c58e8=function(_0x4c031a){while(--_0x4c031a){_0x88f2c0['push'](_0x88f2c0['shift']());}};_0x3c58e8(++_0x4a7645);}(_0x965d,0x145));var _0xd965=function(_0x555005,_0xec7cf6){_0x555005=_0x555005-0x0;var _0x1a6c95=_0x965d[_0x555005];return _0x1a6c95;};'use strict';var client=require(_0xd965('0x0'));exports[_0xd965('0x1')]=function(_0x4ec817){return client[_0xd965('0x2')](_0xd965('0x3'),{'body':_0x4ec817,'log':_0xd965('0x4')});}; \ No newline at end of file +var _0xc661=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x424f02,_0x399b71){var _0x11d7f4=function(_0x3ad34d){while(--_0x3ad34d){_0x424f02['push'](_0x424f02['shift']());}};_0x11d7f4(++_0x399b71);}(_0xc661,0xa0));var _0x1c66=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xc661[_0x5834bc];return _0x3e183a;};'use strict';var client=require(_0x1c66('0x0'));exports['create']=function(_0x4e8ef5){return client['Request'](_0x1c66('0x1'),{'body':_0x4e8ef5,'log':_0x1c66('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 093b660..46387c8 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 _0xe470=['strategy','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x1a1d4a,_0x48ef2b){var _0x44fda1=function(_0x1c68b9){while(--_0x1c68b9){_0x1a1d4a['push'](_0x1a1d4a['shift']());}};_0x44fda1(++_0x48ef2b);}(_0xe470,0xff));var _0x0e47=function(_0x4c4257,_0x13d49c){_0x4c4257=_0x4c4257-0x0;var _0x103845=_0xe470[_0x4c4257];return _0x103845;};'use strict';var client=require(_0x0e47('0x0'));exports[_0x0e47('0x1')]=function(){return function(){return client[_0x0e47('0x2')](_0x0e47('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e47('0x4'),_0x0e47('0x5'),_0x0e47('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x0e47('0x7'),_0x0e47('0x8')]}]},'log':_0x0e47('0x1')});};}; \ No newline at end of file +var _0x280a=['User','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0x280a,0x1c5));var _0xa280=function(_0x21771e,_0x5c1be2){_0x21771e=_0x21771e-0x0;var _0x48f8fb=_0x280a[_0x21771e];return _0x48f8fb;};'use strict';var client=require('../client');exports[_0xa280('0x0')]=function(){return function(){return client[_0xa280('0x1')](_0xa280('0x2'),{'options':{'raw':![],'attributes':['id',_0xa280('0x3'),_0xa280('0x4'),_0xa280('0x5')],'include':[{'model':_0xa280('0x6'),'as':'Agents','attributes':['id','name',_0xa280('0x7'),_0xa280('0x8')]}]},'log':_0xa280('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5e452de..dbb3d24 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 _0x3efe=['update','UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x3efe,0x9f));var _0xe3ef=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3efe[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xe3ef('0x0'));exports['create']=function(_0x49f2eb){return client[_0xe3ef('0x1')](_0xe3ef('0x2'),{'body':_0x49f2eb,'log':_0xe3ef('0x2')});};exports[_0xe3ef('0x3')]=function(_0x26095a,_0x8fadb6){return client['Request'](_0xe3ef('0x4'),{'body':_0x8fadb6,'options':{'where':{'uniqueid':_0x26095a},'order':[['id',_0xe3ef('0x5')]],'limit':0x1},'log':_0xe3ef('0x4')});}; \ No newline at end of file +var _0xe2ca=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe2ca,0x10e));var _0xae2c=function(_0x3b4a0f,_0x28e9cd){_0x3b4a0f=_0x3b4a0f-0x0;var _0x537e6e=_0xe2ca[_0x3b4a0f];return _0x537e6e;};'use strict';var client=require(_0xae2c('0x0'));exports[_0xae2c('0x1')]=function(_0x4e35eb){return client[_0xae2c('0x2')](_0xae2c('0x3'),{'body':_0x4e35eb,'log':_0xae2c('0x3')});};exports['update']=function(_0x32e081,_0x192cfd){return client[_0xae2c('0x2')](_0xae2c('0x4'),{'body':_0x192cfd,'options':{'where':{'uniqueid':_0x32e081},'order':[['id','DESC']],'limit':0x1},'log':_0xae2c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 693e59c..dc059f2 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 _0x0263=['../client','getIntervals','name','Interval','Intervals','interval'];(function(_0x2a7d4c,_0x18b58f){var _0x2e3a2b=function(_0x35eaba){while(--_0x35eaba){_0x2a7d4c['push'](_0x2a7d4c['shift']());}};_0x2e3a2b(++_0x18b58f);}(_0x0263,0x8a));var _0x3026=function(_0x1e7a44,_0x1d8bd0){_0x1e7a44=_0x1e7a44-0x0;var _0x10e954=_0x0263[_0x1e7a44];return _0x10e954;};'use strict';var client=require(_0x3026('0x0'));exports[_0x3026('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3026('0x2')],'include':[{'model':_0x3026('0x3'),'as':_0x3026('0x4'),'attributes':['id',_0x3026('0x2'),_0x3026('0x5')]}]},'log':_0x3026('0x1')});};}; \ No newline at end of file +var _0x64e9=['interval','../client','getIntervals','Request','GetInterval','Interval','Intervals','name'];(function(_0x5da96a,_0x1e8099){var _0x42ea71=function(_0x8b6547){while(--_0x8b6547){_0x5da96a['push'](_0x5da96a['shift']());}};_0x42ea71(++_0x1e8099);}(_0x64e9,0xf9));var _0x964e=function(_0x5307ad,_0x4bd48c){_0x5307ad=_0x5307ad-0x0;var _0x20c01d=_0x64e9[_0x5307ad];return _0x20c01d;};'use strict';var client=require(_0x964e('0x0'));exports[_0x964e('0x1')]=function(){return function(){return client[_0x964e('0x2')](_0x964e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x964e('0x4'),'as':_0x964e('0x5'),'attributes':['id',_0x964e('0x6'),_0x964e('0x7')]}]},'log':_0x964e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 928c5ff..e504fb8 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 _0xf61e=['addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xf61e,0x191));var _0xef61=function(_0x38d8ad,_0x35a9b1){_0x38d8ad=_0x38d8ad-0x0;var _0x51aeec=_0xf61e[_0x38d8ad];return _0x51aeec;};'use strict';var client=require(_0xef61('0x0'));exports[_0xef61('0x1')]=function(_0xe535c3,_0xcf15bd){return client[_0xef61('0x2')](_0xef61('0x3'),{'body':_0xcf15bd,'options':{'where':{'id':_0xe535c3}},'log':_0xef61('0x4')});};exports[_0xef61('0x5')]=function(_0x2bd1d0,_0x14122a){return client[_0xef61('0x2')](_0xef61('0x6'),{'body':_0x14122a,'options':{'where':{'id':_0x2bd1d0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x955f=['update','Request','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x57dd90,_0x58ddc4){var _0x34abca=function(_0x166d60){while(--_0x166d60){_0x57dd90['push'](_0x57dd90['shift']());}};_0x34abca(++_0x58ddc4);}(_0x955f,0x1eb));var _0xf955=function(_0x41517b,_0x15a217){_0x41517b=_0x41517b-0x0;var _0x13c599=_0x955f[_0x41517b];return _0x13c599;};'use strict';var client=require(_0xf955('0x0'));exports[_0xf955('0x1')]=function(_0x438668,_0x382225){return client[_0xf955('0x2')]('UpdateMailInteraction',{'body':_0x382225,'options':{'where':{'id':_0x438668}},'log':_0xf955('0x3')});};exports['addTags']=function(_0x5d0c95,_0x1db0dd){return client['Request'](_0xf955('0x4'),{'body':_0x1db0dd,'options':{'where':{'id':_0x5d0c95}},'log':_0xf955('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1d9d1b0..457ec5e 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 _0xbc2d=['create','Request','createMailMessage','../client'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xbc2d,0x18b));var _0xdbc2=function(_0x392d20,_0x64d3c2){_0x392d20=_0x392d20-0x0;var _0x3ed4cf=_0xbc2d[_0x392d20];return _0x3ed4cf;};'use strict';var client=require(_0xdbc2('0x0'));exports[_0xdbc2('0x1')]=function(_0x4c9f47){return client[_0xdbc2('0x2')]('CreateMailMessage',{'body':_0x4c9f47,'log':_0xdbc2('0x3')});}; \ No newline at end of file +var _0xa0de=['../client','create'];(function(_0x40e7c3,_0x56be7a){var _0x539304=function(_0x46011a){while(--_0x46011a){_0x40e7c3['push'](_0x40e7c3['shift']());}};_0x539304(++_0x56be7a);}(_0xa0de,0x9e));var _0xea0d=function(_0x4d4895,_0x42ba2b){_0x4d4895=_0x4d4895-0x0;var _0x18b8f4=_0xa0de[_0x4d4895];return _0x18b8f4;};'use strict';var client=require(_0xea0d('0x0'));exports[_0xea0d('0x1')]=function(_0xdab04){return client['Request']('CreateMailMessage',{'body':_0xdab04,'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 583e76d..7a94887 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 _0x7103=['Request','name','timeout','strategy','User','Agents','mailPause','../client','getMailQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7103,0x1d2));var _0x3710=function(_0x5686f2,_0x3f7989){_0x5686f2=_0x5686f2-0x0;var _0x2b6fac=_0x7103[_0x5686f2];return _0x2b6fac;};'use strict';var client=require(_0x3710('0x0'));exports[_0x3710('0x1')]=function(){return function(){return client[_0x3710('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x3710('0x3'),_0x3710('0x4'),_0x3710('0x5')],'include':[{'model':_0x3710('0x6'),'as':_0x3710('0x7'),'attributes':['id',_0x3710('0x3'),'online',_0x3710('0x8')]}]},'log':_0x3710('0x1')});};}; \ No newline at end of file +var _0xb89d=['strategy','User','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout'];(function(_0x5193f4,_0x330463){var _0x408fd0=function(_0x3a9fd7){while(--_0x3a9fd7){_0x5193f4['push'](_0x5193f4['shift']());}};_0x408fd0(++_0x330463);}(_0xb89d,0x1c6));var _0xdb89=function(_0x342edd,_0x4dba57){_0x342edd=_0x342edd-0x0;var _0xf75dbe=_0xb89d[_0x342edd];return _0xf75dbe;};'use strict';var client=require(_0xdb89('0x0'));exports[_0xdb89('0x1')]=function(){return function(){return client['Request'](_0xdb89('0x2'),{'options':{'raw':![],'attributes':['id',_0xdb89('0x3'),_0xdb89('0x4'),_0xdb89('0x5')],'include':[{'model':_0xdb89('0x6'),'as':'Agents','attributes':['id','name',_0xdb89('0x7'),_0xdb89('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index fdf8255..3e8c225 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 _0x0742=['DESC','../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x448d42,_0xfc8f4e){var _0x54044c=function(_0x301c3e){while(--_0x301c3e){_0x448d42['push'](_0x448d42['shift']());}};_0x54044c(++_0xfc8f4e);}(_0x0742,0xeb));var _0x2074=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x0742[_0x5cc51f];return _0x315a2f;};'use strict';var client=require(_0x2074('0x0'));exports['create']=function(_0x560090){return client[_0x2074('0x1')](_0x2074('0x2'),{'body':_0x560090,'log':_0x2074('0x2')});};exports[_0x2074('0x3')]=function(_0x2bee35,_0x16a421){return client['Request'](_0x2074('0x4'),{'body':_0x16a421,'options':{'where':{'uniqueid':_0x2bee35},'order':[['id',_0x2074('0x5')]],'limit':0x1},'log':_0x2074('0x4')});}; \ No newline at end of file +var _0x7b24=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x1faf34,_0x5a96e7){var _0x294624=function(_0x9679ec){while(--_0x9679ec){_0x1faf34['push'](_0x1faf34['shift']());}};_0x294624(++_0x5a96e7);}(_0x7b24,0x101));var _0x47b2=function(_0x167094,_0x3d4acf){_0x167094=_0x167094-0x0;var _0xe65e33=_0x7b24[_0x167094];return _0xe65e33;};'use strict';var client=require(_0x47b2('0x0'));exports[_0x47b2('0x1')]=function(_0x4dcdd1){return client[_0x47b2('0x2')](_0x47b2('0x3'),{'body':_0x4dcdd1,'log':_0x47b2('0x3')});};exports[_0x47b2('0x4')]=function(_0x105bc7,_0x201957){return client[_0x47b2('0x2')](_0x47b2('0x5'),{'body':_0x201957,'options':{'where':{'uniqueid':_0x105bc7},'order':[['id',_0x47b2('0x6')]],'limit':0x1},'log':_0x47b2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 5e7842d..8e7b15f 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 _0x2a09=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x150599,_0x3bdfb0){var _0x12c65f=function(_0x842f6f){while(--_0x842f6f){_0x150599['push'](_0x150599['shift']());}};_0x12c65f(++_0x3bdfb0);}(_0x2a09,0x17d));var _0x92a0=function(_0x3084ed,_0x4cfeaa){_0x3084ed=_0x3084ed-0x0;var _0x249944=_0x2a09[_0x3084ed];return _0x249944;};'use strict';var client=require(_0x92a0('0x0'));exports[_0x92a0('0x1')]=function(_0x104d4a,_0x645a88){return client[_0x92a0('0x2')](_0x92a0('0x3'),{'body':_0x645a88,'options':{'where':{'id':_0x104d4a}},'log':_0x92a0('0x4')});};exports[_0x92a0('0x5')]=function(_0x37c74a,_0x328fbc){return client['Request'](_0x92a0('0x6'),{'body':_0x328fbc,'options':{'where':{'id':_0x37c74a}},'log':_0x92a0('0x7')});}; \ No newline at end of file +var _0x1065=['Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x2929ea,_0x92555c){var _0x44454c=function(_0x18f727){while(--_0x18f727){_0x2929ea['push'](_0x2929ea['shift']());}};_0x44454c(++_0x92555c);}(_0x1065,0x17b));var _0x5106=function(_0x52c27d,_0xda4996){_0x52c27d=_0x52c27d-0x0;var _0x3e712a=_0x1065[_0x52c27d];return _0x3e712a;};'use strict';var client=require('../client');exports[_0x5106('0x0')]=function(_0x5676a7,_0x468d1f){return client[_0x5106('0x1')](_0x5106('0x2'),{'body':_0x468d1f,'options':{'where':{'id':_0x5676a7}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x243eb7,_0x1f457f){return client[_0x5106('0x1')](_0x5106('0x3'),{'body':_0x1f457f,'options':{'where':{'id':_0x243eb7}},'log':_0x5106('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5dabff8..0e423ec 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 _0xf45e=['createOpenchannelMessage','create','Request','CreateOpenchannelMessage'];(function(_0xa63f5c,_0x45feb9){var _0x5b7032=function(_0x3a63bb){while(--_0x3a63bb){_0xa63f5c['push'](_0xa63f5c['shift']());}};_0x5b7032(++_0x45feb9);}(_0xf45e,0x69));var _0xef45=function(_0x508b68,_0x5cfcd1){_0x508b68=_0x508b68-0x0;var _0x1d0822=_0xf45e[_0x508b68];return _0x1d0822;};'use strict';var client=require('../client');exports[_0xef45('0x0')]=function(_0x32877b){return client[_0xef45('0x1')](_0xef45('0x2'),{'body':_0x32877b,'log':_0xef45('0x3')});}; \ No newline at end of file +var _0x213b=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x213b,0x11d));var _0xb213=function(_0x41d1e8,_0x112fa0){_0x41d1e8=_0x41d1e8-0x0;var _0x33c7bb=_0x213b[_0x41d1e8];return _0x33c7bb;};'use strict';var client=require(_0xb213('0x0'));exports[_0xb213('0x1')]=function(_0x56f9c2){return client[_0xb213('0x2')](_0xb213('0x3'),{'body':_0x56f9c2,'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 902c93b..a8ec755 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 _0x1ee2=['name','strategy','User','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x408733,_0x194dee){var _0x45de14=function(_0x47c01f){while(--_0x47c01f){_0x408733['push'](_0x408733['shift']());}};_0x45de14(++_0x194dee);}(_0x1ee2,0x11c));var _0x21ee=function(_0x512d04,_0x4f2e96){_0x512d04=_0x512d04-0x0;var _0x1af70a=_0x1ee2[_0x512d04];return _0x1af70a;};'use strict';var client=require(_0x21ee('0x0'));exports[_0x21ee('0x1')]=function(){return function(){return client[_0x21ee('0x2')](_0x21ee('0x3'),{'options':{'raw':![],'attributes':['id',_0x21ee('0x4'),'timeout',_0x21ee('0x5')],'include':[{'model':_0x21ee('0x6'),'as':'Agents','attributes':['id','name',_0x21ee('0x7'),_0x21ee('0x8')]}]},'log':_0x21ee('0x1')});};}; \ No newline at end of file +var _0xb98e=['getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1e0203,_0x568b28){var _0x25ff8c=function(_0x3e338c){while(--_0x3e338c){_0x1e0203['push'](_0x1e0203['shift']());}};_0x25ff8c(++_0x568b28);}(_0xb98e,0x155));var _0xeb98=function(_0x71f90,_0xd82feb){_0x71f90=_0x71f90-0x0;var _0x45da99=_0xb98e[_0x71f90];return _0x45da99;};'use strict';var client=require(_0xeb98('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xeb98('0x1')](_0xeb98('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb98('0x3'),_0xeb98('0x4'),_0xeb98('0x5')],'include':[{'model':_0xeb98('0x6'),'as':_0xeb98('0x7'),'attributes':['id',_0xeb98('0x3'),_0xeb98('0x8'),'openchannelPause']}]},'log':_0xeb98('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c2c8aca..b69db19 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 _0x9ebb=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ebb,0x1b4));var _0xb9eb=function(_0x23d7a4,_0xf7c3c4){_0x23d7a4=_0x23d7a4-0x0;var _0x18d69f=_0x9ebb[_0x23d7a4];return _0x18d69f;};'use strict';var client=require(_0xb9eb('0x0'));exports[_0xb9eb('0x1')]=function(_0x409601){return client[_0xb9eb('0x2')](_0xb9eb('0x3'),{'body':_0x409601,'log':_0xb9eb('0x3')});};exports[_0xb9eb('0x4')]=function(_0x351677,_0x5529df){return client[_0xb9eb('0x2')](_0xb9eb('0x5'),{'body':_0x5529df,'options':{'where':{'uniqueid':_0x351677},'order':[['id',_0xb9eb('0x6')]],'limit':0x1},'log':_0xb9eb('0x5')});}; \ No newline at end of file +var _0x6027=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6027,0xc5));var _0x7602=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x6027[_0x53e3de];return _0x7b905b;};'use strict';var client=require(_0x7602('0x0'));exports[_0x7602('0x1')]=function(_0x3f3c84){return client[_0x7602('0x2')](_0x7602('0x3'),{'body':_0x3f3c84,'log':_0x7602('0x3')});};exports['update']=function(_0x484ac7,_0xc3bcb8){return client['Request'](_0x7602('0x4'),{'body':_0xc3bcb8,'options':{'where':{'uniqueid':_0x484ac7},'order':[['id','DESC']],'limit':0x1},'log':_0x7602('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0fd551b..c551946 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 _0xaeab=['UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x578e10,_0x477222){var _0x5bcecd=function(_0x492e10){while(--_0x492e10){_0x578e10['push'](_0x578e10['shift']());}};_0x5bcecd(++_0x477222);}(_0xaeab,0x91));var _0xbaea=function(_0x283313,_0x5c6d7d){_0x283313=_0x283313-0x0;var _0x24f427=_0xaeab[_0x283313];return _0x24f427;};'use strict';var client=require(_0xbaea('0x0'));exports['update']=function(_0x4aa896,_0x5e8f3a){return client[_0xbaea('0x1')](_0xbaea('0x2'),{'body':_0x5e8f3a,'options':{'where':{'id':_0x4aa896}},'log':_0xbaea('0x3')});};exports[_0xbaea('0x4')]=function(_0x36e839,_0xbe1ff5){return client[_0xbaea('0x1')](_0xbaea('0x5'),{'body':_0xbe1ff5,'options':{'where':{'id':_0x36e839}},'log':_0xbaea('0x6')});}; \ No newline at end of file +var _0xc23a=['update','UpdateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xc23a,0xd2));var _0xac23=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xc23a[_0x271060];return _0x40540b;};'use strict';var client=require('../client');exports[_0xac23('0x0')]=function(_0xc17fba,_0xf70a16){return client['Request'](_0xac23('0x1'),{'body':_0xf70a16,'options':{'where':{'id':_0xc17fba}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x35c541,_0x4f104c){return client[_0xac23('0x2')](_0xac23('0x3'),{'body':_0x4f104c,'options':{'where':{'id':_0x35c541}},'log':_0xac23('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9e22dbc..56c95cc 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 _0xf951=['createSmsMessage','Request','CreateSmsMessage'];(function(_0x3b2d91,_0x349484){var _0x11ed36=function(_0x10f66e){while(--_0x10f66e){_0x3b2d91['push'](_0x3b2d91['shift']());}};_0x11ed36(++_0x349484);}(_0xf951,0xf4));var _0x1f95=function(_0x566816,_0x73fea5){_0x566816=_0x566816-0x0;var _0x36719c=_0xf951[_0x566816];return _0x36719c;};'use strict';var client=require('../client');exports['create']=function(_0x4e2141){return client[_0x1f95('0x0')](_0x1f95('0x1'),{'body':_0x4e2141,'log':_0x1f95('0x2')});}; \ No newline at end of file +var _0x8def=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x4d5cee,_0x19efe8){var _0x26d55c=function(_0x309734){while(--_0x309734){_0x4d5cee['push'](_0x4d5cee['shift']());}};_0x26d55c(++_0x19efe8);}(_0x8def,0x10b));var _0xf8de=function(_0x1cfbfa,_0x1b88d1){_0x1cfbfa=_0x1cfbfa-0x0;var _0x5e56b2=_0x8def[_0x1cfbfa];return _0x5e56b2;};'use strict';var client=require(_0xf8de('0x0'));exports['create']=function(_0x28b6bb){return client[_0xf8de('0x1')](_0xf8de('0x2'),{'body':_0x28b6bb,'log':_0xf8de('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b640f7b..6580b02 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x14eaae,_0x18b0b4){var _0x590872=function(_0x4678ad){while(--_0x4678ad){_0x14eaae['push'](_0x14eaae['shift']());}};_0x590872(++_0x18b0b4);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x115f3b,_0x14a0c6){var _0x457156=function(_0x568d68){while(--_0x568d68){_0x115f3b['push'](_0x115f3b['shift']());}};_0x457156(++_0x14a0c6);}(_0xe706,0xa3));var _0x6e70=function(_0x19b56f,_0x4cbbd9){_0x19b56f=_0x19b56f-0x0;var _0x1e69f9=_0xe706[_0x19b56f];return _0x1e69f9;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6440138..3d32729 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0xdb50b2,_0x275284){var _0xb3789f=function(_0x424366){while(--_0x424366){_0xdb50b2['push'](_0xdb50b2['shift']());}};_0xb3789f(++_0x275284);}(_0x34e8,0x12c));var _0x834e=function(_0x396bdd,_0x3421dc){_0x396bdd=_0x396bdd-0x0;var _0x52675c=_0x34e8[_0x396bdd];return _0x52675c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x4b098d,_0x3ba2ee){var _0x273f87=function(_0x25874c){while(--_0x25874c){_0x4b098d['push'](_0x4b098d['shift']());}};_0x273f87(++_0x3ba2ee);}(_0x34e8,0x12c));var _0x834e=function(_0x85c10b,_0x29343f){_0x85c10b=_0x85c10b-0x0;var _0x5100c8=_0x34e8[_0x85c10b];return _0x5100c8;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index c93cae8..3d735d6 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(_0x222f33,_0x55197e){var _0x54c179=function(_0x496297){while(--_0x496297){_0x222f33['push'](_0x222f33['shift']());}};_0x54c179(++_0x55197e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x18ab91,_0x5d114a){var _0x224557=function(_0x3a9488){while(--_0x3a9488){_0x18ab91['push'](_0x18ab91['shift']());}};_0x224557(++_0x5d114a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 61bd08d..5c07d09 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 _0x5496=['updateWhatsappInteraction','../client','update','Request'];(function(_0x3b4b76,_0x35ba3f){var _0x32a7b0=function(_0x4b0fd4){while(--_0x4b0fd4){_0x3b4b76['push'](_0x3b4b76['shift']());}};_0x32a7b0(++_0x35ba3f);}(_0x5496,0x175));var _0x6549=function(_0x14e107,_0x146281){_0x14e107=_0x14e107-0x0;var _0x5b26b8=_0x5496[_0x14e107];return _0x5b26b8;};'use strict';var client=require(_0x6549('0x0'));exports[_0x6549('0x1')]=function(_0x13ae29,_0xb6116e){return client[_0x6549('0x2')]('UpdateWhatsappInteraction',{'body':_0xb6116e,'options':{'where':{'id':_0x13ae29}},'log':_0x6549('0x3')});};exports['addTags']=function(_0x2d2155,_0x8112c5){return client[_0x6549('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x8112c5,'options':{'where':{'id':_0x2d2155}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x4d68=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x4d68,0x1c3));var _0x84d6=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x4d68[_0x9d14e3];return _0x19bf32;};'use strict';var client=require(_0x84d6('0x0'));exports[_0x84d6('0x1')]=function(_0x2e2636,_0xc5c972){return client[_0x84d6('0x2')](_0x84d6('0x3'),{'body':_0xc5c972,'options':{'where':{'id':_0x2e2636}},'log':'updateWhatsappInteraction'});};exports[_0x84d6('0x4')]=function(_0x5ee114,_0x3a2f0b){return client['Request'](_0x84d6('0x5'),{'body':_0x3a2f0b,'options':{'where':{'id':_0x5ee114}},'log':_0x84d6('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index d546f14..5646d9b 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 _0xedc5=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x54a892,_0x1a4eeb){var _0x1f24f1=function(_0x2044d5){while(--_0x2044d5){_0x54a892['push'](_0x54a892['shift']());}};_0x1f24f1(++_0x1a4eeb);}(_0xedc5,0x9c));var _0x5edc=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xedc5[_0x4dab14];return _0xf41aa;};'use strict';var client=require('../client');exports[_0x5edc('0x0')]=function(_0x4285ae){return client[_0x5edc('0x1')](_0x5edc('0x2'),{'body':_0x4285ae,'log':_0x5edc('0x3')});}; \ No newline at end of file +var _0xb0c2=['create','Request','CreateWhatsappMessage'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0xb0c2,0xf3));var _0x2b0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0c2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x2b0c('0x0')]=function(_0x4a81a0){return client[_0x2b0c('0x1')](_0x2b0c('0x2'),{'body':_0x4a81a0,'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 018af94..65433b0 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 _0xaedc=['Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User'];(function(_0x3e86e2,_0xbdc053){var _0x3ff730=function(_0x417d87){while(--_0x417d87){_0x3e86e2['push'](_0x3e86e2['shift']());}};_0x3ff730(++_0xbdc053);}(_0xaedc,0xfd));var _0xcaed=function(_0x39f6a8,_0x47a635){_0x39f6a8=_0x39f6a8-0x0;var _0x26ed2c=_0xaedc[_0x39f6a8];return _0x26ed2c;};'use strict';var client=require(_0xcaed('0x0'));exports[_0xcaed('0x1')]=function(){return function(){return client[_0xcaed('0x2')](_0xcaed('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xcaed('0x4'),_0xcaed('0x5')],'include':[{'model':_0xcaed('0x6'),'as':_0xcaed('0x7'),'attributes':['id','name',_0xcaed('0x8'),_0xcaed('0x9')]}]},'log':_0xcaed('0x1')});};}; \ No newline at end of file +var _0x7df4=['online','whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7df4,0x9c));var _0x47df=function(_0x472f75,_0x98f0e0){_0x472f75=_0x472f75-0x0;var _0x477345=_0x7df4[_0x472f75];return _0x477345;};'use strict';var client=require(_0x47df('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x47df('0x1'),{'options':{'raw':![],'attributes':['id',_0x47df('0x2'),_0x47df('0x3'),_0x47df('0x4')],'include':[{'model':_0x47df('0x5'),'as':'Agents','attributes':['id','name',_0x47df('0x6'),_0x47df('0x7')]}]},'log':_0x47df('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 140f73f..4a81ad2 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 _0x3cd0=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x5f3c49,_0x7352dc){var _0x18b814=function(_0x4a9041){while(--_0x4a9041){_0x5f3c49['push'](_0x5f3c49['shift']());}};_0x18b814(++_0x7352dc);}(_0x3cd0,0x96));var _0x03cd=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x3cd0[_0x3fe042];return _0x7d4a1f;};'use strict';var client=require(_0x03cd('0x0'));exports['create']=function(_0x60de10){return client[_0x03cd('0x1')]('CreateWhatsappQueueReport',{'body':_0x60de10,'log':_0x03cd('0x2')});};exports[_0x03cd('0x3')]=function(_0x2e0c1f,_0x1b4c39){return client[_0x03cd('0x1')](_0x03cd('0x4'),{'body':_0x1b4c39,'options':{'where':{'uniqueid':_0x2e0c1f},'order':[['id',_0x03cd('0x5')]],'limit':0x1},'log':_0x03cd('0x4')});}; \ No newline at end of file +var _0xb1b0=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xb1b0,0xf7));var _0x0b1b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb1b0[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x0b1b('0x0'));exports[_0x0b1b('0x1')]=function(_0x56143a){return client[_0x0b1b('0x2')]('CreateWhatsappQueueReport',{'body':_0x56143a,'log':_0x0b1b('0x3')});};exports[_0x0b1b('0x4')]=function(_0x208f25,_0x4f8410){return client[_0x0b1b('0x2')](_0x0b1b('0x5'),{'body':_0x4f8410,'options':{'where':{'uniqueid':_0x208f25},'order':[['id',_0x0b1b('0x6')]],'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 d09da27..5041c3b 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 _0x5824=['consequence','error','[%s][AGENT]\x20%s','message','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','log','validate','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase'];(function(_0x4a046e,_0xfe96d2){var _0x17b271=function(_0x3d9130){while(--_0x3d9130){_0x4a046e['push'](_0x4a046e['shift']());}};_0x17b271(++_0xfe96d2);}(_0x5824,0xb9));var _0x4582=function(_0x8940b1,_0x89ac31){_0x8940b1=_0x8940b1-0x0;var _0x3a05aa=_0x5824[_0x8940b1];return _0x3a05aa;};'use strict';var schema=require(_0x4582('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x4582('0x1'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x4582('0x2'));var queue=schema({'name':{'type':_0x4582('0x3'),'required':!![],'message':_0x4582('0x4')},'timeout':{'type':_0x4582('0x5'),'message':_0x4582('0x6')}});function writeLog(_0x1e9a63,_0x2b87ec,_0x1f6d59){return logger[_0x4582('0x7')](util[_0x4582('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1e9a63,_0x2b87ec['name'],_0x1f6d59));}function handleFindAgent(_0x37a386){return function(_0x5a4dd6){return _0x5a4dd6[_0x4582('0x9')][_0x4582('0xa')]()===_0x37a386[_0x4582('0xa')]();};}exports[_0x4582('0xb')]=function(_0x209e91,_0xa9374a,_0x2c6734,_0x5d0c01){return function(_0x25ce2b){try{var _0x41466d={'name':_0xa9374a[0x0],'timeout':_0xa9374a[0x1]};var _0x4df967=queue['validate'](_0x41466d,{'typecast':!![]});if(_0x4df967['length']){logger[_0x4582('0xc')](_0x4582('0xd'),_0x209e91,_['map'](_0x4df967,_0x4582('0xe'))['join'](',\x20'));_0x25ce2b[_0x4582('0xf')]();}else{var _0x2d979a=_[_0x4582('0x10')](_0x2c6734[_0x4582('0x11')],handleFindAgent(_0x41466d[_0x4582('0x9')]));if(_0x2d979a){var _0x285236=(_0x41466d[_0x4582('0x12')]||0xa)*0x3e8;var _0x5cd2d3,_0x1b366b;var _0x231fe8=seqqueue['createQueue'](_0x285236);_0x231fe8['id']=_0x209e91;_0x231fe8[_0x4582('0x13')]=_0x285236;_0x231fe8['channel']=_0x5d0c01[_0x4582('0x14')];writeLog(_0x209e91,_0x2d979a,util[_0x4582('0x8')](_0x4582('0x15'),_0x285236));_0x2c6734[_0x4582('0x16')][_0x209e91]['on'](_0x4582('0x17'),function(){logger[_0x4582('0x7')](_0x4582('0x18'),_0x209e91);clearTimeout(_0x1b366b);_0x1b366b=undefined;_0x231fe8['close']();if(_0x2c6734[_0x4582('0x16')][_0x209e91]){delete _0x2c6734[_0x4582('0x16')][_0x209e91];}_0x25ce2b[_0x4582('0xf')]();});_0x2c6734[_0x4582('0x16')][_0x209e91]['on'](_0x4582('0x19'),function(){if(_0x2c6734[_0x4582('0x16')][_0x209e91]){delete _0x2c6734['rules'][_0x209e91];}});_0x1b366b=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x209e91);clearTimeout(_0x1b366b);_0x231fe8[_0x4582('0x1a')]();_0x25ce2b['next']();},_0x285236);strategy['agent'](_0x231fe8,_0x2d979a,_0x2c6734,_0x5d0c01);}else{logger[_0x4582('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x209e91,_0x41466d['name']);_0x25ce2b[_0x4582('0xf')]();}}}catch(_0x2fb6fc){console[_0x4582('0x1b')](_0x2fb6fc);logger[_0x4582('0xc')]('[%s][QUEUE]\x20%s',_0x209e91,_0x2fb6fc['stack']);_0x25ce2b[_0x4582('0xf')]();}};}; \ No newline at end of file +var _0x3495=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','name','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x94ad81,_0x1d6749){var _0x2c89d0=function(_0x1bde7c){while(--_0x1bde7c){_0x94ad81['push'](_0x94ad81['shift']());}};_0x2c89d0(++_0x1d6749);}(_0x3495,0xa2));var _0x5349=function(_0x1ec0bd,_0x12d761){_0x1ec0bd=_0x1ec0bd-0x0;var _0x33fccd=_0x3495[_0x1ec0bd];return _0x33fccd;};'use strict';var schema=require(_0x5349('0x0'));var _=require(_0x5349('0x1'));var util=require(_0x5349('0x2'));var seqqueue=require(_0x5349('0x3'));var logger=require('../../../../config/logger')(_0x5349('0x4'));var strategy=require(_0x5349('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x5349('0x6')},'timeout':{'type':_0x5349('0x7'),'message':_0x5349('0x8')}});function writeLog(_0x201cb2,_0x2f6e99,_0x60a169){return logger[_0x5349('0x9')](util[_0x5349('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x201cb2,_0x2f6e99['name'],_0x60a169));}function handleFindAgent(_0xe54a47){return function(_0x11747c){return _0x11747c['name'][_0x5349('0xb')]()===_0xe54a47[_0x5349('0xb')]();};}exports[_0x5349('0xc')]=function(_0x190949,_0xc6624c,_0x875e23,_0x285ef5){return function(_0x5e0226){try{var _0x45d544={'name':_0xc6624c[0x0],'timeout':_0xc6624c[0x1]};var _0x35360a=queue[_0x5349('0x0')](_0x45d544,{'typecast':!![]});if(_0x35360a['length']){logger[_0x5349('0xd')](_0x5349('0xe'),_0x190949,_[_0x5349('0xf')](_0x35360a,_0x5349('0x10'))['join'](',\x20'));_0x5e0226[_0x5349('0x11')]();}else{var _0xd187a0=_[_0x5349('0x12')](_0x875e23[_0x5349('0x13')],handleFindAgent(_0x45d544['name']));if(_0xd187a0){var _0x525ee1=(_0x45d544[_0x5349('0x14')]||0xa)*0x3e8;var _0x5f2034,_0x2d4866;var _0x1ad606=seqqueue[_0x5349('0x15')](_0x525ee1);_0x1ad606['id']=_0x190949;_0x1ad606[_0x5349('0x16')]=_0x525ee1;_0x1ad606['channel']=_0x285ef5[_0x5349('0x17')];writeLog(_0x190949,_0xd187a0,util[_0x5349('0xa')](_0x5349('0x18'),_0x525ee1));_0x875e23[_0x5349('0x19')][_0x190949]['on'](_0x5349('0x1a'),function(){logger['info'](_0x5349('0x1b'),_0x190949);clearTimeout(_0x2d4866);_0x2d4866=undefined;_0x1ad606[_0x5349('0x1c')]();if(_0x875e23[_0x5349('0x19')][_0x190949]){delete _0x875e23[_0x5349('0x19')][_0x190949];}_0x5e0226[_0x5349('0x11')]();});_0x875e23[_0x5349('0x19')][_0x190949]['on'](_0x5349('0x1d'),function(){if(_0x875e23[_0x5349('0x19')][_0x190949]){delete _0x875e23[_0x5349('0x19')][_0x190949];}});_0x2d4866=setTimeout(function(){logger[_0x5349('0x9')](_0x5349('0x1e'),_0x190949);clearTimeout(_0x2d4866);_0x1ad606[_0x5349('0x1c')]();_0x5e0226['next']();},_0x525ee1);strategy[_0x5349('0x1f')](_0x1ad606,_0xd187a0,_0x875e23,_0x285ef5);}else{logger[_0x5349('0xd')](_0x5349('0x20'),_0x190949,_0x45d544[_0x5349('0x21')]);_0x5e0226['stop']();}}}catch(_0x12fc5b){console[_0x5349('0x22')](_0x12fc5b);logger['error'](_0x5349('0x23'),_0x190949,_0x12fc5b[_0x5349('0x24')]);_0x5e0226[_0x5349('0x11')]();}};}; \ 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 2f6e055..ecf1d5a 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 _0xdef9=['phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','body','postText','error','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp'];(function(_0x510d2f,_0x53e2ab){var _0x300f77=function(_0x26a29c){while(--_0x26a29c){_0x510d2f['push'](_0x510d2f['shift']());}};_0x300f77(++_0x53e2ab);}(_0xdef9,0x81));var _0x9def=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0xdef9[_0x23bcd4];return _0x4cb792;};'use strict';var _=require(_0x9def('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x9def('0x1'));var logger=require(_0x9def('0x2'))(_0x9def('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9def('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9def('0x5')),'whatsappMessage':require(_0x9def('0x6'))};exports[_0x9def('0x7')]=function(_0x3f4615,_0xa48c5f){return function(_0x43a593){try{if(!_['isNil'](this[_0x9def('0x8')]['UserId'])){logger[_0x9def('0x9')]('[%s][AMAZONLEX]\x20%s',_0x3f4615,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x43a593[_0x9def('0xa')]();}var _0x2a3935={'ContactId':this[_0x9def('0xb')]['id'],'sentAt':moment()[_0x9def('0xc')](_0x9def('0xd')),'direction':_0x9def('0xe')};if(this['channel']===_0x9def('0xf')||this[_0x9def('0x10')]===_0x9def('0x11')){_0x2a3935[_0x9def('0x12')]=this[_0x9def('0x8')][_0x9def('0x12')];}var _0x1db5af=this[_0x9def('0x10')];if(_0x1db5af===_0x9def('0x13')){_0x2a3935[_0x9def('0x14')]=this[_0x9def('0x15')]['id'];}else{_0x2a3935[_[_0x9def('0x16')](_0x1db5af)+_0x9def('0x17')]=this['account']['id'];}_0x2a3935[_[_0x9def('0x16')](_0x1db5af)+_0x9def('0x18')]=this[_0x9def('0x8')]['id'];if(this[_0x9def('0x8')][_0x9def('0x19')]){var _0x3c3e1d=_0xa48c5f[0x4];if(!_[_0x9def('0x1a')](_0x3c3e1d)){_0x2a3935['body']=utils[_0x9def('0x1b')](_0x3c3e1d,this);return rpc[_0x1db5af+_0x9def('0x1c')][_0x9def('0x1d')](_0x2a3935)[_0x9def('0x1e')](function(_0x34c1f0){logger['info'](_0x9def('0x1f'),_0x3f4615,_0x2a3935['body']);})[_0x9def('0x20')](function(_0x3b6537){logger['error'](_0x9def('0x1f'),_0x3f4615,JSON[_0x9def('0x21')](_0x3b6537));})[_0x9def('0x22')](function(){logger[_0x9def('0x9')](_0x9def('0x23'),_0x3f4615);_0x43a593[_0x9def('0x24')]();});}else{logger[_0x9def('0x9')](_0x9def('0x25'),_0x3f4615);_0x43a593[_0x9def('0x24')]();}}else{var _0x379547=this;var _0x57ef9b=new AWS[(_0x9def('0x26'))]({'accessKeyId':_0xa48c5f[0x0],'secretAccessKey':_0xa48c5f[0x1],'region':_0xa48c5f[0x2]});var _0x370fc1={'botAlias':_0x9def('0x27'),'botName':_0xa48c5f[0x3],'inputText':this[_0x9def('0x28')][_0x9def('0x29')],'userId':this['channel']+':'+this[_0x9def('0x8')]['id']['toString']()};_0x57ef9b[_0x9def('0x2a')](_0x370fc1,function(_0x16004c,_0x5797be){if(_0x16004c){logger[_0x9def('0x2b')](_0x9def('0x1f'),_0x3f4615,_0x16004c[_0x9def('0x28')]);_0x43a593[_0x9def('0xa')]();}else if(_0x5797be&&_0x5797be[_0x9def('0x28')]){_0x379547[_0x9def('0x29')][_0x9def('0x2c')]=_0x5797be;_0x2a3935[_0x9def('0x29')]=_0x5797be[_0x9def('0x28')];_0x2a3935[_0x9def('0x2d')]='amazonlex';_0x2a3935[_0x9def('0x2e')]=JSON[_0x9def('0x21')](_0x5797be);return rpc[_0x1db5af+_0x9def('0x1c')][_0x9def('0x1d')](_0x2a3935)[_0x9def('0x1e')](function(_0xeaa01f){logger[_0x9def('0x9')](_0x9def('0x1f'),_0x3f4615,_0x2a3935[_0x9def('0x29')]);if(_0x5797be[_0x9def('0x2f')]==_0x9def('0x30')){_0x43a593[_0x9def('0xa')]();}else{_0x43a593[_0x9def('0x24')]();}})[_0x9def('0x20')](function(_0x297068){logger[_0x9def('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x3f4615,JSON['stringify'](_0x297068));_0x43a593[_0x9def('0xa')]();});}else{_0x43a593['next']();}});}}catch(_0x4881de){logger[_0x9def('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x3f4615,JSON[_0x9def('0x21')](_0x4881de));_0x43a593[_0x9def('0x24')]();}};}; \ No newline at end of file +var _0x5157=['channel','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','amazonlex','create','info','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x38e325,_0xf8f2e3){var _0x268273=function(_0x13e487){while(--_0x13e487){_0x38e325['push'](_0x38e325['shift']());}};_0x268273(++_0xf8f2e3);}(_0x5157,0xa1));var _0x7515=function(_0x6fc8a6,_0x502594){_0x6fc8a6=_0x6fc8a6-0x0;var _0x339604=_0x5157[_0x6fc8a6];return _0x339604;};'use strict';var _=require(_0x7515('0x0'));var moment=require(_0x7515('0x1'));var AWS=require(_0x7515('0x2'));var utils=require(_0x7515('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x7515('0x4')),'openchannelMessage':require(_0x7515('0x5')),'mailMessage':require(_0x7515('0x6')),'smsMessage':require(_0x7515('0x7')),'faxMessage':require(_0x7515('0x8')),'whatsappMessage':require(_0x7515('0x9'))};exports[_0x7515('0xa')]=function(_0x34bfe4,_0x1e1082){return function(_0x177b40){try{if(!_['isNil'](this[_0x7515('0xb')][_0x7515('0xc')])){logger['info'](_0x7515('0xd'),_0x34bfe4,_0x7515('0xe'));return _0x177b40[_0x7515('0xf')]();}var _0x258f37={'ContactId':this[_0x7515('0x10')]['id'],'sentAt':moment()[_0x7515('0x11')](_0x7515('0x12')),'direction':'out'};if(this[_0x7515('0x13')]==='sms'||this[_0x7515('0x13')]==='whatsapp'){_0x258f37['phone']=this[_0x7515('0xb')][_0x7515('0x14')];}var _0x4fe51c=this[_0x7515('0x13')];if(_0x4fe51c==='chat'){_0x258f37['ChatWebsiteId']=this[_0x7515('0x15')]['id'];}else{_0x258f37[_[_0x7515('0x16')](_0x4fe51c)+_0x7515('0x17')]=this['account']['id'];}_0x258f37[_[_0x7515('0x16')](_0x4fe51c)+_0x7515('0x18')]=this[_0x7515('0xb')]['id'];if(this[_0x7515('0xb')][_0x7515('0x19')]){var _0x12815d=_0x1e1082[0x4];if(!_[_0x7515('0x1a')](_0x12815d)){_0x258f37[_0x7515('0x1b')]=utils[_0x7515('0x1c')](_0x12815d,this);return rpc[_0x4fe51c+_0x7515('0x1d')]['create'](_0x258f37)[_0x7515('0x1e')](function(_0x22904e){logger['info']('[%s][AMAZONLEX]\x20%s',_0x34bfe4,_0x258f37['body']);})['catch'](function(_0x30c12e){logger[_0x7515('0x1f')](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x30c12e));})[_0x7515('0x21')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x34bfe4);_0x177b40[_0x7515('0x22')]();});}else{logger['info'](_0x7515('0x23'),_0x34bfe4);_0x177b40[_0x7515('0x22')]();}}else{var _0x270776=this;var _0x2c3226=new AWS[(_0x7515('0x24'))]({'accessKeyId':_0x1e1082[0x0],'secretAccessKey':_0x1e1082[0x1],'region':_0x1e1082[0x2]});var _0x261aec={'botAlias':_0x7515('0x25'),'botName':_0x1e1082[0x3],'inputText':this[_0x7515('0x26')]['body'],'userId':this['channel']+':'+this[_0x7515('0xb')]['id']['toString']()};_0x2c3226[_0x7515('0x27')](_0x261aec,function(_0x247d93,_0x1a8796){if(_0x247d93){logger[_0x7515('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x34bfe4,_0x247d93[_0x7515('0x26')]);_0x177b40[_0x7515('0xf')]();}else if(_0x1a8796&&_0x1a8796[_0x7515('0x26')]){_0x270776[_0x7515('0x1b')][_0x7515('0x28')]=_0x1a8796;_0x258f37[_0x7515('0x1b')]=_0x1a8796['message'];_0x258f37['providerName']=_0x7515('0x28');_0x258f37['providerResponse']=JSON['stringify'](_0x1a8796);return rpc[_0x4fe51c+_0x7515('0x1d')][_0x7515('0x29')](_0x258f37)['then'](function(_0x4090f1){logger[_0x7515('0x2a')](_0x7515('0xd'),_0x34bfe4,_0x258f37['body']);if(_0x1a8796[_0x7515('0x2b')]==_0x7515('0x2c')){_0x177b40[_0x7515('0xf')]();}else{_0x177b40[_0x7515('0x22')]();}})['catch'](function(_0x2f808d){logger['error'](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x2f808d));_0x177b40[_0x7515('0xf')]();});}else{_0x177b40['next']();}});}}catch(_0x448678){logger[_0x7515('0x1f')](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x448678));_0x177b40[_0x7515('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 ce71ef3..e5b527e 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 _0x50bb=['mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','replace','','headers','All','sendMailMessage','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','Interaction','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','body','isAutoreply','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x414cf2,_0x2136dd){var _0x27c0dc=function(_0x46062d){while(--_0x46062d){_0x414cf2['push'](_0x414cf2['shift']());}};_0x27c0dc(++_0x2136dd);}(_0x50bb,0x135));var _0xb50b=function(_0xa5214e,_0x17504f){_0xa5214e=_0xa5214e-0x0;var _0x4d70f7=_0x50bb[_0xa5214e];return _0x4d70f7;};'use strict';var _=require(_0xb50b('0x0'));var moment=require(_0xb50b('0x1'));var utils=require(_0xb50b('0x2'));var logger=require(_0xb50b('0x3'))(_0xb50b('0x4'));var rpc={'chatMessage':require(_0xb50b('0x5')),'openchannelMessage':require(_0xb50b('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb50b('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb50b('0x8')),'chatInteraction':require(_0xb50b('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xb50b('0xa')),'faxInteraction':require(_0xb50b('0xb')),'whatsappInteraction':require(_0xb50b('0xc'))};var mailRpc=require(_0xb50b('0xd'));exports['consequence']=function(_0x2acfbb,_0x189c58,_0x7a8e24,_0x42ea0a){return function(_0x4c0012){try{var _0x58cc80=this[_0xb50b('0xe')];if(_0x58cc80==='mail'&&_0x42ea0a[_0xb50b('0xf')][_0xb50b('0x10')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0x2acfbb,_0xb50b('0x11'));return _0x4c0012[_0xb50b('0x12')]();}if(_0x189c58[0x0]==='1'&&(_[_0xb50b('0x13')](this[_0xb50b('0x14')]['created'])||!this[_0xb50b('0x14')][_0xb50b('0x15')])){logger[_0xb50b('0x16')](_0xb50b('0x17'),_0x2acfbb,_0xb50b('0x18'));return _0x4c0012[_0xb50b('0x12')]();}if(_0x189c58[0x0]==='2'&&this[_0xb50b('0x14')][_0xb50b('0x19')]){logger[_0xb50b('0x16')](_0xb50b('0x1a'),_0x2acfbb,'One\x20Time\x20already\x20sent');return _0x4c0012[_0xb50b('0x12')]();}var _0x1c186a={'ContactId':this[_0xb50b('0x1b')]['id'],'sentAt':moment()[_0xb50b('0x1c')](_0xb50b('0x1d')),'direction':_0xb50b('0x1e')};if(this[_0xb50b('0xe')]===_0xb50b('0x1f')){_0x1c186a['body']=utils['getMustacheRender'](_0x189c58[0x2],this);}else{_0x1c186a[_0xb50b('0xf')]=utils[_0xb50b('0x20')](_0x189c58[0x1],this);}if(this['message']){_0x1c186a['to']=this['message']['from']||'';if(this[_0xb50b('0xe')]==='mail'&&_0x189c58[0x1]==='1'){_0x1c186a['cc']=this[_0xb50b('0x21')]['cc']||'';}_0x1c186a[_0xb50b('0x22')]=this[_0xb50b('0x21')]['to']||'';_0x1c186a[_0xb50b('0x23')]=this[_0xb50b('0x21')][_0xb50b('0x23')]||'';_0x1c186a[_0xb50b('0x24')]=!![];if(this[_0xb50b('0x21')]['subject']){_0x1c186a[_0xb50b('0x25')]='';_0x1c186a[_0xb50b('0x25')]+=_[_0xb50b('0x26')](this[_0xb50b('0x21')][_0xb50b('0x25')],_0xb50b('0x27'))?'':_0xb50b('0x28');_0x1c186a['subject']+=this['message'][_0xb50b('0x25')];}}if(this[_0xb50b('0xe')]===_0xb50b('0x29')){_0x1c186a[_0xb50b('0x2a')]=this[_0xb50b('0x2b')]['id'];}else{_0x1c186a[_[_0xb50b('0x2c')](this[_0xb50b('0xe')])+_0xb50b('0x2d')]=this[_0xb50b('0x2b')]['id'];}_0x1c186a[_[_0xb50b('0x2c')](this['channel'])+'InteractionId']=this[_0xb50b('0x14')]['id'];var _0x222833=this['interaction'];if(rpc[this[_0xb50b('0xe')]+_0xb50b('0x2e')]){if(this[_0xb50b('0xe')]===_0xb50b('0x1f')){_0x1c186a[_0xb50b('0x2f')]=this['message'][_0xb50b('0x30')];_0x1c186a[_0xb50b('0x31')]=_0xb50b('0x32')+_[_0xb50b('0x33')](_0x1c186a[_0xb50b('0xf')],'','replace','';_0xd7da8c[_0x8441('0x31')]={'Auto-Submitted':_0x8441('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0x8441('0x33')};return mailRpc[_0x8441('0x34')](this[_0x8441('0x25')][_0x8441('0x35')],_0xd7da8c)[_0x8441('0x36')](function(_0x40b787){logger['info'](_0x8441('0x37'),_0x3841c8);_0xd7da8c[_0x8441('0x2b')]=_0x40b787['message']['messageId'];return rpc[_0x390b1c+'Message'][_0x8441('0x38')](_0xd7da8c);})[_0x8441('0x36')](function(_0x45b145){logger[_0x8441('0xc')]('[%s][AUTOREPLY]\x20%s',_0x3841c8,JSON[_0x8441('0x39')](_0x45b145));})[_0x8441('0x3a')](function(_0x19796e){logger[_0x8441('0x3b')](_0x8441('0x3c'),_0x3841c8,JSON[_0x8441('0x39')](_0x19796e));})['finally'](function(){Promise[_0x8441('0x3d')]()[_0x8441('0x36')](function(){if(_0x488e05[0x0]!=='2'||_0x7422c[_0x8441('0x14')])return;return rpc[_0x390b1c+_0x8441('0x3e')][_0x8441('0x3f')](_0x7422c['id'],{'autoreplyExecuted':!![]})[_0x8441('0x36')](function(_0x3d4a85){logger[_0x8441('0xc')](_0x8441('0x15'),_0x3841c8,JSON[_0x8441('0x39')](_0x3d4a85));})['catch'](function(_0x1c7f76){logger['error'](_0x8441('0x40'),_0x3841c8,JSON[_0x8441('0x39')](_0x1c7f76));});})['then'](function(){_0x5ca8b1[_0x8441('0xe')]();});});}else{return rpc[this[_0x8441('0xa')]+'Message'][_0x8441('0x38')](_0xd7da8c)[_0x8441('0x36')](function(){logger[_0x8441('0xc')](_0x8441('0x12'),_0x3841c8,_0xd7da8c[_0x8441('0xb')]);})['catch'](function(_0x1a7c55){logger[_0x8441('0x3b')](_0x8441('0x12'),_0x3841c8,JSON['stringify'](_0x1a7c55));})['finally'](function(){Promise['resolve']()[_0x8441('0x36')](function(){if(_0x488e05[0x0]!=='2'||_0x7422c[_0x8441('0x14')])return;return rpc[_0x390b1c+_0x8441('0x3e')]['update'](_0x7422c['id'],{'autoreplyExecuted':!![]})[_0x8441('0x36')](function(_0x545acf){logger[_0x8441('0xc')](_0x8441('0x15'),_0x3841c8,JSON[_0x8441('0x39')](_0x545acf));})[_0x8441('0x3a')](function(_0x21c1a1){logger[_0x8441('0x3b')](_0x8441('0x40'),_0x3841c8,JSON[_0x8441('0x39')](_0x21c1a1));});})[_0x8441('0x36')](function(){_0x5ca8b1[_0x8441('0xe')]();});});}}}catch(_0x2f49b1){logger[_0x8441('0x3b')](_0x8441('0x12'),_0x3841c8,JSON[_0x8441('0x39')](_0x2f49b1));_0x5ca8b1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 02d8584..ef24cf8 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ae2=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then'];(function(_0x196d3a,_0x4ccf79){var _0x48ba0a=function(_0x5a3115){while(--_0x5a3115){_0x196d3a['push'](_0x196d3a['shift']());}};_0x48ba0a(++_0x4ccf79);}(_0x8ae2,0x1e7));var _0x28ae=function(_0x32d4aa,_0x4b76e1){_0x32d4aa=_0x32d4aa-0x0;var _0x1c5591=_0x8ae2[_0x32d4aa];return _0x1c5591;};'use strict';var moment=require(_0x28ae('0x0'));var logger=require('../../../../config/logger')(_0x28ae('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x28ae('0x2')),'smsInteraction':require(_0x28ae('0x3')),'mailInteraction':require(_0x28ae('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x28ae('0x5'))};exports[_0x28ae('0x6')]=function(_0x1c43a1,_0x3711ac,_0x4fffa0,_0x52b540){return function(_0x52b71f){try{logger[_0x28ae('0x7')](_0x28ae('0x8'),_0x1c43a1,_0x3711ac[0x0]);var _0x131dd7={'closed':0x1,'closedAt':moment()[_0x28ae('0x9')](_0x28ae('0xa')),'closeReason':_0x28ae('0xb'),'disposition':_0x3711ac[0x0]};if(rpc[_0x52b540[_0x28ae('0xc')]+_0x28ae('0xd')]){rpc[_0x52b540[_0x28ae('0xc')]+_0x28ae('0xd')][_0x28ae('0xe')](_0x52b540[_0x28ae('0xf')]['id'],_0x131dd7)[_0x28ae('0x10')](function(_0x58238b){logger[_0x28ae('0x7')](_0x28ae('0x11'),_0x1c43a1,_0x52b540[_0x28ae('0xf')]['id']);})[_0x28ae('0x12')](function(_0x476135){logger[_0x28ae('0x13')](_0x28ae('0x14'),_0x1c43a1,JSON[_0x28ae('0x15')](_0x476135));})[_0x28ae('0x16')](function(){_0x52b71f[_0x28ae('0x17')]();});}}catch(_0x49289c){logger[_0x28ae('0x13')](_0x28ae('0x14'),_0x1c43a1,JSON[_0x28ae('0x15')](_0x49289c));_0x52b71f[_0x28ae('0x17')]();}};}; \ No newline at end of file +var _0x7d40=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','../../../../config/logger'];(function(_0x358f97,_0x2471e7){var _0x253cf3=function(_0x1bc4ff){while(--_0x1bc4ff){_0x358f97['push'](_0x358f97['shift']());}};_0x253cf3(++_0x2471e7);}(_0x7d40,0xfc));var _0x07d4=function(_0x348c09,_0x539458){_0x348c09=_0x348c09-0x0;var _0x22d339=_0x7d40[_0x348c09];return _0x22d339;};'use strict';var moment=require('moment');var logger=require(_0x07d4('0x0'))(_0x07d4('0x1'));var rpc={'chatInteraction':require(_0x07d4('0x2')),'openchannelInteraction':require(_0x07d4('0x3')),'smsInteraction':require(_0x07d4('0x4')),'mailInteraction':require(_0x07d4('0x5')),'faxInteraction':require(_0x07d4('0x6')),'whatsappInteraction':require(_0x07d4('0x7'))};exports[_0x07d4('0x8')]=function(_0x2ba703,_0xde97da,_0x78ae5,_0x1ca0ca){return function(_0x162ea1){try{logger[_0x07d4('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0x2ba703,_0xde97da[0x0]);var _0x8668a4={'closed':0x1,'closedAt':moment()[_0x07d4('0xa')](_0x07d4('0xb')),'closeReason':_0x07d4('0xc'),'disposition':_0xde97da[0x0]};if(rpc[_0x1ca0ca['channel']+_0x07d4('0xd')]){rpc[_0x1ca0ca['channel']+_0x07d4('0xd')]['update'](_0x1ca0ca[_0x07d4('0xe')]['id'],_0x8668a4)[_0x07d4('0xf')](function(_0x5b454e){logger[_0x07d4('0x9')](_0x07d4('0x10'),_0x2ba703,_0x1ca0ca[_0x07d4('0xe')]['id']);})[_0x07d4('0x11')](function(_0x1731b0){logger[_0x07d4('0x12')](_0x07d4('0x13'),_0x2ba703,JSON['stringify'](_0x1731b0));})[_0x07d4('0x14')](function(){_0x162ea1[_0x07d4('0x15')]();});}}catch(_0x4caadf){logger['error'](_0x07d4('0x13'),_0x2ba703,JSON[_0x07d4('0x16')](_0x4caadf));_0x162ea1[_0x07d4('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index a692c12..c140756 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea4e=['phone','interaction','channel','chat','ChatWebsiteId','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','providerResponse','stringify','metadata','endConversation','error','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xea4e,0x10c));var _0xeea4=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xea4e[_0x3fa7d3];return _0x4c51bd;};'use strict';var _=require(_0xeea4('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xeea4('0x1'));var logger=require('../../../../config/logger')(_0xeea4('0x2'));var rpc={'chatMessage':require(_0xeea4('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xeea4('0x4')),'smsMessage':require(_0xeea4('0x5')),'faxMessage':require(_0xeea4('0x6')),'whatsappMessage':require(_0xeea4('0x7'))};exports[_0xeea4('0x8')]=function(_0x26d41b,_0x1bf7d2){return function(_0x44113d){try{if(!_[_0xeea4('0x9')](this['interaction'][_0xeea4('0xa')])){logger['info'](_0xeea4('0xb'),_0x26d41b,_0xeea4('0xc'));return _0x44113d[_0xeea4('0xd')]();}var _0x367d41={'ContactId':this[_0xeea4('0xe')]['id'],'sentAt':moment()[_0xeea4('0xf')](_0xeea4('0x10')),'direction':_0xeea4('0x11')};if(this['channel']===_0xeea4('0x12')||this['channel']===_0xeea4('0x13')){_0x367d41[_0xeea4('0x14')]=this[_0xeea4('0x15')][_0xeea4('0x14')];}var _0x137086=this[_0xeea4('0x16')];if(_0x137086===_0xeea4('0x17')){_0x367d41[_0xeea4('0x18')]=this['account']['id'];}else{_0x367d41[_[_0xeea4('0x19')](_0x137086)+_0xeea4('0x1a')]=this['account']['id'];}_0x367d41[_[_0xeea4('0x19')](_0x137086)+'InteractionId']=this[_0xeea4('0x15')]['id'];if(this[_0xeea4('0x15')][_0xeea4('0x1b')]){var _0x12f574=_0x1bf7d2[0x2];if(!_[_0xeea4('0x1c')](_0x12f574)){_0x367d41[_0xeea4('0x1d')]=utils[_0xeea4('0x1e')](_0x12f574,this);return rpc[_0x137086+_0xeea4('0x1f')][_0xeea4('0x20')](_0x367d41)[_0xeea4('0x21')](function(_0x4ae372){logger[_0xeea4('0x22')](_0xeea4('0xb'),_0x26d41b,_0x367d41['body']);})[_0xeea4('0x23')](function(_0x472803){logger['error'](_0xeea4('0xb'),_0x26d41b,JSON['stringify'](_0x472803));})[_0xeea4('0x24')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x26d41b);_0x44113d[_0xeea4('0x25')]();});}else{logger['info'](_0xeea4('0x26'),_0x26d41b);_0x44113d[_0xeea4('0x25')]();}}else{var _0x3e162c=this;var _0x19b2a8=apiai(_0x1bf7d2[0x0],{'language':_0x1bf7d2[0x1]||'en'});return _0x19b2a8[_0xeea4('0x27')](this['message'][_0xeea4('0x1d')],{'sessionId':md5(this[_0xeea4('0x15')]['id'])})[_0xeea4('0x21')](function(_0x31dab){_0x3e162c['body'][_0xeea4('0x28')]=_0x31dab;_0x367d41[_0xeea4('0x1d')]=_0x31dab[_0xeea4('0x29')][_0xeea4('0x2a')]['speech'];_0x367d41['providerName']=_0xeea4('0x28');_0x367d41[_0xeea4('0x2b')]=JSON[_0xeea4('0x2c')](_0x31dab);return rpc[_0x137086+_0xeea4('0x1f')][_0xeea4('0x20')](_0x367d41)['then'](function(_0x15aaa4){logger[_0xeea4('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x26d41b,_0x367d41[_0xeea4('0x1d')]);if(_0x31dab['result'][_0xeea4('0x2d')][_0xeea4('0x2e')]){_0x44113d[_0xeea4('0xd')]();}else{_0x44113d[_0xeea4('0x25')]();}})[_0xeea4('0x23')](function(_0x5b651f){logger[_0xeea4('0x2f')]('[%s][DIALOGFLOW]\x20%s',_0x26d41b,JSON[_0xeea4('0x2c')](_0x5b651f));_0x44113d[_0xeea4('0xd')]();});})['catch'](function(_0x48a047){logger['error'](_0xeea4('0xb'),_0x26d41b,_0x48a047['message']);_0x44113d[_0xeea4('0xd')]();});}}catch(_0x5793ed){logger[_0xeea4('0x2f')](_0xeea4('0xb'),_0x26d41b,JSON[_0xeea4('0x2c')](_0x5793ed));_0x44113d['stop']();}};}; \ No newline at end of file +var _0xbc48=['md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','Message','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','result','fulfillment','providerName','create','endConversation','next','error','lodash','moment','apiai-promise'];(function(_0x6b591e,_0x4183d8){var _0x20c433=function(_0x2d2d05){while(--_0x2d2d05){_0x6b591e['push'](_0x6b591e['shift']());}};_0x20c433(++_0x4183d8);}(_0xbc48,0x111));var _0x8bc4=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xbc48[_0x450689];return _0x46ffb0;};'use strict';var _=require(_0x8bc4('0x0'));var moment=require(_0x8bc4('0x1'));var apiai=require(_0x8bc4('0x2'));var md5=require(_0x8bc4('0x3'));var utils=require('./utils');var logger=require(_0x8bc4('0x4'))(_0x8bc4('0x5'));var rpc={'chatMessage':require(_0x8bc4('0x6')),'openchannelMessage':require(_0x8bc4('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8bc4('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xaaff2d,_0x5708fe){return function(_0x58df27){try{if(!_[_0x8bc4('0x9')](this['interaction'][_0x8bc4('0xa')])){logger[_0x8bc4('0xb')](_0x8bc4('0xc'),_0xaaff2d,_0x8bc4('0xd'));return _0x58df27['next']();}var _0x1595b2={'ContactId':this[_0x8bc4('0xe')]['id'],'sentAt':moment()[_0x8bc4('0xf')](_0x8bc4('0x10')),'direction':_0x8bc4('0x11')};if(this[_0x8bc4('0x12')]===_0x8bc4('0x13')||this[_0x8bc4('0x12')]===_0x8bc4('0x14')){_0x1595b2[_0x8bc4('0x15')]=this[_0x8bc4('0x16')][_0x8bc4('0x15')];}var _0x80c304=this[_0x8bc4('0x12')];if(_0x80c304===_0x8bc4('0x17')){_0x1595b2['ChatWebsiteId']=this[_0x8bc4('0x18')]['id'];}else{_0x1595b2[_[_0x8bc4('0x19')](_0x80c304)+_0x8bc4('0x1a')]=this[_0x8bc4('0x18')]['id'];}_0x1595b2[_[_0x8bc4('0x19')](_0x80c304)+_0x8bc4('0x1b')]=this['interaction']['id'];if(this['interaction']['created']){var _0x36714f=_0x5708fe[0x2];if(!_['isEmpty'](_0x36714f)){_0x1595b2[_0x8bc4('0x1c')]=utils[_0x8bc4('0x1d')](_0x36714f,this);return rpc[_0x80c304+_0x8bc4('0x1e')]['create'](_0x1595b2)[_0x8bc4('0x1f')](function(_0x968929){logger['info'](_0x8bc4('0xc'),_0xaaff2d,_0x1595b2['body']);})[_0x8bc4('0x20')](function(_0x54400a){logger['error'](_0x8bc4('0xc'),_0xaaff2d,JSON[_0x8bc4('0x21')](_0x54400a));})[_0x8bc4('0x22')](function(){logger[_0x8bc4('0xb')](_0x8bc4('0x23'),_0xaaff2d);_0x58df27[_0x8bc4('0x24')]();});}else{logger[_0x8bc4('0xb')](_0x8bc4('0x25'),_0xaaff2d);_0x58df27[_0x8bc4('0x24')]();}}else{var _0x3b402f=this;var _0x148fda=apiai(_0x5708fe[0x0],{'language':_0x5708fe[0x1]||'en'});return _0x148fda['textRequest'](this[_0x8bc4('0x26')][_0x8bc4('0x1c')],{'sessionId':md5(this[_0x8bc4('0x16')]['id'])})['then'](function(_0x327e90){_0x3b402f[_0x8bc4('0x1c')]['dialogflow']=_0x327e90;_0x1595b2[_0x8bc4('0x1c')]=_0x327e90[_0x8bc4('0x27')][_0x8bc4('0x28')]['speech'];_0x1595b2[_0x8bc4('0x29')]='dialogflow';_0x1595b2['providerResponse']=JSON[_0x8bc4('0x21')](_0x327e90);return rpc[_0x80c304+_0x8bc4('0x1e')][_0x8bc4('0x2a')](_0x1595b2)[_0x8bc4('0x1f')](function(_0x16c2a8){logger[_0x8bc4('0xb')](_0x8bc4('0xc'),_0xaaff2d,_0x1595b2[_0x8bc4('0x1c')]);if(_0x327e90['result']['metadata'][_0x8bc4('0x2b')]){_0x58df27[_0x8bc4('0x2c')]();}else{_0x58df27[_0x8bc4('0x24')]();}})[_0x8bc4('0x20')](function(_0x134760){logger[_0x8bc4('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0xaaff2d,JSON[_0x8bc4('0x21')](_0x134760));_0x58df27[_0x8bc4('0x2c')]();});})[_0x8bc4('0x20')](function(_0x26452e){logger['error'](_0x8bc4('0xc'),_0xaaff2d,_0x26452e[_0x8bc4('0x26')]);_0x58df27[_0x8bc4('0x2c')]();});}}catch(_0x3af06f){logger[_0x8bc4('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0xaaff2d,JSON[_0x8bc4('0x21')](_0x3af06f));_0x58df27['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 5324d1b..e5c609f 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13f7=['[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x5eb9a1,_0x18c24a){var _0xb7d96=function(_0x4379b5){while(--_0x4379b5){_0x5eb9a1['push'](_0x5eb9a1['shift']());}};_0xb7d96(++_0x18c24a);}(_0x13f7,0x151));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x713f('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x713f('0x1'));var moment=require(_0x713f('0x2'));var Promise=require(_0x713f('0x3'));var logger=require(_0x713f('0x4'))(_0x713f('0x5'));var utils=require(_0x713f('0x6'));var rpc={'chatMessage':require(_0x713f('0x7')),'openchannelMessage':require(_0x713f('0x8')),'mailMessage':require(_0x713f('0x9')),'smsMessage':require(_0x713f('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x713f('0xb'))};function createMessage(_0x482d42,_0x56594c,_0x23288f,_0x30e97d){return new Promise(function(_0x5b57c,_0x531fe4){var _0x49f108=_[_0x713f('0xc')](_0x23288f);_0x49f108['body']=_0x30e97d;return rpc[_0x56594c+'Message'][_0x713f('0xd')](_0x49f108)[_0x713f('0xe')](function(){logger[_0x713f('0xf')](_0x713f('0x10'),_0x482d42,_0x49f108[_0x713f('0x11')]);_0x5b57c();})[_0x713f('0x12')](function(_0xe0828b){logger[_0x713f('0x13')](_0x713f('0x10'),_0x482d42,JSON[_0x713f('0x14')](_0xe0828b));_0x531fe4(_0xe0828b);});});}exports[_0x713f('0x15')]=function(_0x55993b,_0x110010){return function(_0x205d88){try{if(!_[_0x713f('0x16')](this[_0x713f('0x17')][_0x713f('0x18')])){logger['info'](_0x713f('0x10'),_0x55993b,_0x713f('0x19'));return _0x205d88[_0x713f('0x1a')]();}var _0x45e19a={'ContactId':this[_0x713f('0x1b')]['id'],'sentAt':moment()[_0x713f('0x1c')](_0x713f('0x1d')),'direction':'out'};if(this[_0x713f('0x1e')]==='sms'||this[_0x713f('0x1e')]===_0x713f('0x1f')){_0x45e19a[_0x713f('0x20')]=this[_0x713f('0x17')]['phone'];}var _0x211bc1=this['channel'];if(_0x211bc1===_0x713f('0x21')){_0x45e19a[_0x713f('0x22')]=this[_0x713f('0x23')]['id'];}else{_0x45e19a[_[_0x713f('0x24')](_0x211bc1)+_0x713f('0x25')]=this[_0x713f('0x23')]['id'];}_0x45e19a[_[_0x713f('0x24')](_0x211bc1)+_0x713f('0x26')]=this[_0x713f('0x17')]['id'];if(this[_0x713f('0x17')][_0x713f('0x27')]){var _0x33edc8=_0x110010[0x4];if(!_['isEmpty'](_0x33edc8)){_0x45e19a[_0x713f('0x11')]=utils[_0x713f('0x28')](_0x33edc8,this);return rpc[_0x211bc1+'Message'][_0x713f('0xd')](_0x45e19a)[_0x713f('0xe')](function(_0x3688ca){logger['info'](_0x713f('0x10'),_0x55993b,_0x45e19a[_0x713f('0x11')]);})[_0x713f('0x12')](function(_0x14062d){logger[_0x713f('0x13')](_0x713f('0x10'),_0x55993b,JSON[_0x713f('0x14')](_0x14062d));})[_0x713f('0x29')](function(){logger[_0x713f('0xf')](_0x713f('0x2a'),_0x55993b);_0x205d88['stop']();});}else{logger[_0x713f('0xf')](_0x713f('0x2b'),_0x55993b);_0x205d88[_0x713f('0x2c')]();}}else{var _0x3dfc43=this;var _0x37fd7d=_0x110010[0x2]['replace'](/\\n/g,'\x0a');var _0x1bb8af={'credentials':{'private_key':_0x37fd7d,'client_email':_0x110010[0x1]}};var _0x57a113=new dialogflow[(_0x713f('0x2d'))](_0x1bb8af);var _0xb056fe=_0x57a113[_0x713f('0x2e')](_0x110010[0x0],md5(_0x3dfc43[_0x713f('0x17')]['id']));var _0x4e3c24={'session':_0xb056fe,'queryInput':{'text':{'text':_0x3dfc43[_0x713f('0x2f')]['body'],'languageCode':_0x110010[0x3]||'en'}}};return _0x57a113[_0x713f('0x30')](_0x4e3c24)[_0x713f('0xe')](function(_0x45fe91){if(_0x45fe91&&_0x45fe91[_0x713f('0x31')]){_0x3dfc43[_0x713f('0x11')][_0x713f('0x32')]=_0x45fe91;var _0x3d29d7=_0x45fe91[0x0];var _0x18d826=_0x3d29d7['queryResult'][_0x713f('0x33')]&&_0x3d29d7[_0x713f('0x34')][_0x713f('0x33')][_0x713f('0x35')]?_0x3d29d7[_0x713f('0x34')]['diagnosticInfo'][_0x713f('0x35')][_0x713f('0x36')]['boolValue']:![];_0x3dfc43['body'][_0x713f('0x37')]=_0x3d29d7[_0x713f('0x34')][_0x713f('0x38')];_0x3dfc43['body'][_0x713f('0x39')]=_0x3d29d7[_0x713f('0x34')][_0x713f('0x3a')];_0x3dfc43['body'][_0x713f('0x3b')]=_0x3d29d7['queryResult'][_0x713f('0x33')]&&_0x3d29d7[_0x713f('0x34')][_0x713f('0x33')][_0x713f('0x35')]?_0x3d29d7[_0x713f('0x34')][_0x713f('0x33')]['fields'][_0x713f('0x36')][_0x713f('0x3c')]:![];_0x3dfc43[_0x713f('0x11')][_0x713f('0x3d')]=_0x3d29d7[_0x713f('0x34')][_0x713f('0x3e')][_0x713f('0x3f')];_0x3dfc43[_0x713f('0x11')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3d29d7[_0x713f('0x34')][_0x713f('0x3e')][_0x713f('0x40')];_0x3dfc43[_0x713f('0x11')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3d29d7[_0x713f('0x34')][_0x713f('0x3e')][_0x713f('0x41')];_0x3dfc43[_0x713f('0x11')][_0x713f('0x42')]=_0x3d29d7[_0x713f('0x34')][_0x713f('0x43')];_0x3dfc43[_0x713f('0x11')][_0x713f('0x44')]=_0x3d29d7[_0x713f('0x34')][_0x713f('0x45')];_0x3dfc43['body'][_0x713f('0x46')]=_0x3d29d7[_0x713f('0x34')]['intentDetectionConfidence'];_0x45e19a[_0x713f('0x47')]=_0x713f('0x32');_0x45e19a[_0x713f('0x48')]=JSON['stringify'](_0x45fe91);var _0x538590=[];for(var _0x4325f0=0x0;_0x4325f0<_0x45fe91[_0x713f('0x31')];_0x4325f0++){var _0x52c778=_0x45fe91[_0x4325f0];if(_0x52c778&&_0x52c778[_0x713f('0x34')]&&_0x52c778[_0x713f('0x34')][_0x713f('0x49')]){_0x538590[_0x713f('0x4a')](createMessage(_0x55993b,_0x211bc1,_0x45e19a,_0x52c778[_0x713f('0x34')][_0x713f('0x49')]));}}return Promise[_0x713f('0x4b')](_0x538590)[_0x713f('0xe')](function(){if(_0x18d826){_0x205d88['next']();}else{_0x205d88[_0x713f('0x2c')]();}})['catch'](function(_0x4159d5){logger[_0x713f('0x13')](_0x713f('0x10'),_0x55993b,JSON[_0x713f('0x14')](_0x4159d5));_0x205d88[_0x713f('0x1a')]();});}})[_0x713f('0x12')](function(_0x170972){logger[_0x713f('0x13')](_0x713f('0x10'),_0x55993b,_0x170972[_0x713f('0x2f')]);_0x205d88[_0x713f('0x1a')]();});}}catch(_0x1e0aec){logger[_0x713f('0x13')](_0x713f('0x10'),_0x55993b,JSON[_0x713f('0x14')](_0x1e0aec));_0x205d88['stop']();}};}; \ No newline at end of file +var _0x91c7=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','message','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','length','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x4234c2,_0x2c5543){var _0x452263=function(_0x57dfa4){while(--_0x57dfa4){_0x4234c2['push'](_0x4234c2['shift']());}};_0x452263(++_0x2c5543);}(_0x91c7,0x10e));var _0x791c=function(_0xfac6cd,_0x32fb94){_0xfac6cd=_0xfac6cd-0x0;var _0xeb2337=_0x91c7[_0xfac6cd];return _0xeb2337;};'use strict';var _=require(_0x791c('0x0'));var dialogflow=require(_0x791c('0x1'));var md5=require(_0x791c('0x2'));var moment=require(_0x791c('0x3'));var Promise=require(_0x791c('0x4'));var logger=require(_0x791c('0x5'))(_0x791c('0x6'));var utils=require('./utils');var rpc={'chatMessage':require(_0x791c('0x7')),'openchannelMessage':require(_0x791c('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x791c('0x9')),'faxMessage':require(_0x791c('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x9ceea4,_0x3027e4,_0x34a4ab,_0x36ba9c){return new Promise(function(_0x32c2c7,_0x1ae6a5){var _0x4d8cec=_[_0x791c('0xb')](_0x34a4ab);_0x4d8cec[_0x791c('0xc')]=_0x36ba9c;return rpc[_0x3027e4+'Message'][_0x791c('0xd')](_0x4d8cec)[_0x791c('0xe')](function(){logger[_0x791c('0xf')](_0x791c('0x10'),_0x9ceea4,_0x4d8cec[_0x791c('0xc')]);_0x32c2c7();})[_0x791c('0x11')](function(_0x2bfb66){logger[_0x791c('0x12')](_0x791c('0x10'),_0x9ceea4,JSON[_0x791c('0x13')](_0x2bfb66));_0x1ae6a5(_0x2bfb66);});});}exports[_0x791c('0x14')]=function(_0x26783b,_0x40baf6){return function(_0x231e35){try{if(!_[_0x791c('0x15')](this[_0x791c('0x16')][_0x791c('0x17')])){logger[_0x791c('0xf')](_0x791c('0x10'),_0x26783b,_0x791c('0x18'));return _0x231e35[_0x791c('0x19')]();}var _0x1fa70e={'ContactId':this[_0x791c('0x1a')]['id'],'sentAt':moment()[_0x791c('0x1b')](_0x791c('0x1c')),'direction':_0x791c('0x1d')};if(this[_0x791c('0x1e')]==='sms'||this[_0x791c('0x1e')]===_0x791c('0x1f')){_0x1fa70e[_0x791c('0x20')]=this[_0x791c('0x16')][_0x791c('0x20')];}var _0x294707=this['channel'];if(_0x294707===_0x791c('0x21')){_0x1fa70e[_0x791c('0x22')]=this[_0x791c('0x23')]['id'];}else{_0x1fa70e[_[_0x791c('0x24')](_0x294707)+_0x791c('0x25')]=this[_0x791c('0x23')]['id'];}_0x1fa70e[_[_0x791c('0x24')](_0x294707)+_0x791c('0x26')]=this['interaction']['id'];if(this['interaction'][_0x791c('0x27')]){var _0xfc8793=_0x40baf6[0x4];if(!_[_0x791c('0x28')](_0xfc8793)){_0x1fa70e['body']=utils[_0x791c('0x29')](_0xfc8793,this);return rpc[_0x294707+_0x791c('0x2a')]['create'](_0x1fa70e)['then'](function(_0x30e210){logger[_0x791c('0xf')](_0x791c('0x10'),_0x26783b,_0x1fa70e[_0x791c('0xc')]);})[_0x791c('0x11')](function(_0xb32697){logger['error'](_0x791c('0x10'),_0x26783b,JSON['stringify'](_0xb32697));})[_0x791c('0x2b')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x26783b);_0x231e35[_0x791c('0x2c')]();});}else{logger['info'](_0x791c('0x2d'),_0x26783b);_0x231e35[_0x791c('0x2c')]();}}else{var _0xeb5795=this;var _0x33c50c=_0x40baf6[0x2][_0x791c('0x2e')](/\\n/g,'\x0a');var _0x27bd75={'credentials':{'private_key':_0x33c50c,'client_email':_0x40baf6[0x1]}};var _0x30058d=new dialogflow['SessionsClient'](_0x27bd75);var _0x23a97b=_0x30058d['sessionPath'](_0x40baf6[0x0],md5(_0xeb5795[_0x791c('0x16')]['id']));var _0x4507de={'session':_0x23a97b,'queryInput':{'text':{'text':_0xeb5795[_0x791c('0x2f')][_0x791c('0xc')],'languageCode':_0x40baf6[0x3]||'en'}}};return _0x30058d['detectIntent'](_0x4507de)['then'](function(_0x1c352d){if(_0x1c352d&&_0x1c352d['length']){_0xeb5795['body']['dialogflowV2']=_0x1c352d;var _0x15c139=_0x1c352d[0x0];var _0xdc757f=_0x15c139[_0x791c('0x30')]['diagnosticInfo']&&_0x15c139[_0x791c('0x30')][_0x791c('0x31')][_0x791c('0x32')]?_0x15c139[_0x791c('0x30')][_0x791c('0x31')]['fields'][_0x791c('0x33')]['boolValue']:![];_0xeb5795[_0x791c('0xc')][_0x791c('0x34')]=_0x15c139[_0x791c('0x30')][_0x791c('0x35')];_0xeb5795[_0x791c('0xc')][_0x791c('0x36')]=_0x15c139['queryResult'][_0x791c('0x37')];_0xeb5795['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x15c139['queryResult'][_0x791c('0x31')]&&_0x15c139[_0x791c('0x30')][_0x791c('0x31')]['fields']?_0x15c139[_0x791c('0x30')]['diagnosticInfo']['fields'][_0x791c('0x33')][_0x791c('0x38')]:![];_0xeb5795[_0x791c('0xc')][_0x791c('0x39')]=_0x15c139[_0x791c('0x30')][_0x791c('0x3a')][_0x791c('0x3b')];_0xeb5795[_0x791c('0xc')][_0x791c('0x3c')]=_0x15c139[_0x791c('0x30')]['intent'][_0x791c('0x3d')];_0xeb5795[_0x791c('0xc')][_0x791c('0x3e')]=_0x15c139[_0x791c('0x30')]['intent']['isFallback'];_0xeb5795['body'][_0x791c('0x3f')]=_0x15c139[_0x791c('0x30')][_0x791c('0x40')];_0xeb5795['body'][_0x791c('0x41')]=_0x15c139[_0x791c('0x30')][_0x791c('0x42')];_0xeb5795['body'][_0x791c('0x43')]=_0x15c139['queryResult']['intentDetectionConfidence'];_0x1fa70e[_0x791c('0x44')]=_0x791c('0x45');_0x1fa70e[_0x791c('0x46')]=JSON[_0x791c('0x13')](_0x1c352d);var _0x1d22fd=[];for(var _0x242fc5=0x0;_0x242fc5<_0x1c352d[_0x791c('0x47')];_0x242fc5++){var _0x470676=_0x1c352d[_0x242fc5];if(_0x470676&&_0x470676[_0x791c('0x30')]&&_0x470676[_0x791c('0x30')][_0x791c('0x48')]){_0x1d22fd['push'](createMessage(_0x26783b,_0x294707,_0x1fa70e,_0x470676[_0x791c('0x30')][_0x791c('0x48')]));}}return Promise[_0x791c('0x49')](_0x1d22fd)['then'](function(){if(_0xdc757f){_0x231e35[_0x791c('0x19')]();}else{_0x231e35[_0x791c('0x2c')]();}})[_0x791c('0x11')](function(_0x32a338){logger[_0x791c('0x12')](_0x791c('0x10'),_0x26783b,JSON['stringify'](_0x32a338));_0x231e35[_0x791c('0x19')]();});}})['catch'](function(_0x350982){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x26783b,_0x350982[_0x791c('0x2f')]);_0x231e35[_0x791c('0x19')]();});}}catch(_0x4739e8){logger[_0x791c('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x26783b,JSON[_0x791c('0x13')](_0x4739e8));_0x231e35['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index e9c9998..eda74ba 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd96e=['stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd96e,0x108));var _0xed96=function(_0x2c3de7,_0x201de7){_0x2c3de7=_0x2c3de7-0x0;var _0x3869fd=_0xd96e[_0x2c3de7];return _0x3869fd;};'use strict';var schema=require(_0xed96('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xed96('0x1'));var logger=require(_0xed96('0x2'))(_0xed96('0x3'));var gotoif=schema({'condition':{'type':_0xed96('0x4'),'required':!![],'message':_0xed96('0x5')},'priorityTrue':{'type':_0xed96('0x6'),'message':_0xed96('0x7')},'priorityFalse':{'type':_0xed96('0x6'),'message':_0xed96('0x8')}});exports[_0xed96('0x9')]=function(_0x4b4070,_0x5519b9){return function(_0x425ee1){try{var _0x4ca1d5={'condition':htmlToText['fromString'](utils[_0xed96('0xa')](_0x5519b9[0x0],this),{'wordwrap':![]})[_0xed96('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5519b9[0x1],'priorityFalse':_0x5519b9[0x2]};var _0x44bb52=gotoif['validate'](_0x4ca1d5,{'typecast':!![]});if(_0x44bb52[_0xed96('0xc')]){logger[_0xed96('0xd')](_0xed96('0xe'),_0x4b4070,_['map'](_0x44bb52,_0xed96('0xf'))[_0xed96('0x10')](',\x20'));_0x425ee1['stop']();}else{try{var _0x1dfb79=eval('('+_0x4ca1d5[_0xed96('0x11')]+')');var _0x24a1a8=_0x1dfb79?_0x4ca1d5[_0xed96('0x12')]:_0x4ca1d5[_0xed96('0x13')];logger['info'](_0xed96('0x14'),_0x4b4070,_0x4ca1d5[_0xed96('0x11')],_0x1dfb79,_0x24a1a8||_0xed96('0x15'));if(_0x24a1a8){var _0x35cb0f=_[_0xed96('0x16')](_0x425ee1[_0xed96('0x17')](),{'p':_0x24a1a8});if(_0x35cb0f>=0x0){logger[_0xed96('0x18')](_0xed96('0x19'),_0x4b4070,_0x24a1a8||'next',_0x35cb0f);_0x425ee1[_0xed96('0x15')](_0x35cb0f);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4b4070,_0x24a1a8||_0xed96('0x15'));_0x425ee1[_0xed96('0x1a')]();}}else{_0x425ee1['next']();}}catch(_0xc6ed09){logger[_0xed96('0xd')](_0xed96('0x1b'),_0x4b4070,_0xc6ed09[_0xed96('0xf')]);_0x425ee1[_0xed96('0x1a')]();}}}catch(_0x2b5961){logger[_0xed96('0xd')](_0xed96('0xe'),_0x4b4070,JSON[_0xed96('0x1c')](_0x2b5961));_0x425ee1['stop']();}};}; \ No newline at end of file +var _0xf1dc=['replace','validate','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','lodash','html-to-text','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xf1dc,0x82));var _0xcf1d=function(_0x5d0e6d,_0x36d2e4){_0x5d0e6d=_0x5d0e6d-0x0;var _0x5ab5dc=_0xf1dc[_0x5d0e6d];return _0x5ab5dc;};'use strict';var schema=require('validate');var _=require(_0xcf1d('0x0'));var htmlToText=require(_0xcf1d('0x1'));var utils=require('./utils');var logger=require(_0xcf1d('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xcf1d('0x3'),'required':!![],'message':_0xcf1d('0x4')},'priorityTrue':{'type':_0xcf1d('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xcf1d('0x5'),'message':_0xcf1d('0x6')}});exports[_0xcf1d('0x7')]=function(_0x26f33c,_0x3ec9c7){return function(_0x4f48f1){try{var _0x47ab29={'condition':htmlToText[_0xcf1d('0x8')](utils[_0xcf1d('0x9')](_0x3ec9c7[0x0],this),{'wordwrap':![]})[_0xcf1d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3ec9c7[0x1],'priorityFalse':_0x3ec9c7[0x2]};var _0x4dab79=gotoif[_0xcf1d('0xb')](_0x47ab29,{'typecast':!![]});if(_0x4dab79[_0xcf1d('0xc')]){logger[_0xcf1d('0xd')](_0xcf1d('0xe'),_0x26f33c,_[_0xcf1d('0xf')](_0x4dab79,'message')[_0xcf1d('0x10')](',\x20'));_0x4f48f1['stop']();}else{try{var _0x11be80=eval('('+_0x47ab29[_0xcf1d('0x11')]+')');var _0xe6f90e=_0x11be80?_0x47ab29[_0xcf1d('0x12')]:_0x47ab29[_0xcf1d('0x13')];logger[_0xcf1d('0x14')](_0xcf1d('0x15'),_0x26f33c,_0x47ab29['condition'],_0x11be80,_0xe6f90e||_0xcf1d('0x16'));if(_0xe6f90e){var _0x5a4c75=_[_0xcf1d('0x17')](_0x4f48f1['rules'](),{'p':_0xe6f90e});if(_0x5a4c75>=0x0){logger[_0xcf1d('0x14')](_0xcf1d('0x18'),_0x26f33c,_0xe6f90e||_0xcf1d('0x16'),_0x5a4c75);_0x4f48f1['next'](_0x5a4c75);}else{logger[_0xcf1d('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x26f33c,_0xe6f90e||_0xcf1d('0x16'));_0x4f48f1[_0xcf1d('0x19')]();}}else{_0x4f48f1[_0xcf1d('0x16')]();}}catch(_0x470fb0){logger['error'](_0xcf1d('0x1a'),_0x26f33c,_0x470fb0[_0xcf1d('0x1b')]);_0x4f48f1['stop']();}}}catch(_0x31abca){logger[_0xcf1d('0xd')](_0xcf1d('0xe'),_0x26f33c,JSON['stringify'](_0x31abca));_0x4f48f1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index fb1db3b..b349063 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 _0x1f28=['consequence','validate','length','[%s][GOTOP]\x20%s','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','error','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x59b136,_0x2d8ac7){var _0x5a973c=function(_0x49844a){while(--_0x49844a){_0x59b136['push'](_0x59b136['shift']());}};_0x5a973c(++_0x2d8ac7);}(_0x1f28,0x1e9));var _0x81f2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1f28[_0x4b369d];return _0x571a98;};'use strict';var schema=require('validate');var _=require(_0x81f2('0x0'));var logger=require(_0x81f2('0x1'))(_0x81f2('0x2'));var gotop=schema({'priority':{'type':_0x81f2('0x3'),'required':!![],'message':_0x81f2('0x4')}});exports[_0x81f2('0x5')]=function(_0x32b969,_0x4e1e09){return function(_0x4e9b48){try{var _0x4a8e7f={'priority':_0x4e1e09[0x0]};var _0x61a663=gotop[_0x81f2('0x6')](_0x4a8e7f,{'typecast':!![]});if(_0x61a663[_0x81f2('0x7')]){logger['error'](_0x81f2('0x8'),_0x32b969,_['map'](_0x61a663,_0x81f2('0x9'))['join'](',\x20'));_0x4e9b48['stop']();}else{logger[_0x81f2('0xa')](_0x81f2('0xb'),_0x32b969,_0x4a8e7f[_0x81f2('0xc')]);if(_0x4a8e7f['priority']){var _0x4deeb8=_[_0x81f2('0xd')](_0x4e9b48['rules'](),{'p':_0x4a8e7f[_0x81f2('0xc')]});if(_0x4deeb8>=0x0){logger[_0x81f2('0xa')](_0x81f2('0xe'),_0x32b969,_0x4a8e7f[_0x81f2('0xc')]||_0x81f2('0xf'),_0x4deeb8);_0x4e9b48[_0x81f2('0xf')](_0x4deeb8);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x32b969,_0x4a8e7f[_0x81f2('0xc')]||_0x81f2('0xf'));_0x4e9b48[_0x81f2('0x10')]();}}else{_0x4e9b48[_0x81f2('0xf')]();}}}catch(_0x471dbd){logger[_0x81f2('0x11')](_0x81f2('0x8'),_0x32b969,JSON[_0x81f2('0x12')](_0x471dbd));_0x4e9b48[_0x81f2('0x10')]();}};}; \ No newline at end of file +var _0x8fe9=['stop','stringify','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0x8fe9,0x156));var _0x98fe=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x8fe9[_0x534c8f];return _0x5a57f5;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')(_0x98fe('0x0'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x98fe('0x1')}});exports[_0x98fe('0x2')]=function(_0x52d637,_0x33b3bd){return function(_0x1e0ea1){try{var _0x36fc3b={'priority':_0x33b3bd[0x0]};var _0x38dac4=gotop['validate'](_0x36fc3b,{'typecast':!![]});if(_0x38dac4[_0x98fe('0x3')]){logger[_0x98fe('0x4')](_0x98fe('0x5'),_0x52d637,_[_0x98fe('0x6')](_0x38dac4,_0x98fe('0x7'))['join'](',\x20'));_0x1e0ea1['stop']();}else{logger['info'](_0x98fe('0x8'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]);if(_0x36fc3b[_0x98fe('0x9')]){var _0x4e0601=_[_0x98fe('0xa')](_0x1e0ea1[_0x98fe('0xb')](),{'p':_0x36fc3b[_0x98fe('0x9')]});if(_0x4e0601>=0x0){logger['info'](_0x98fe('0xc'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]||'next',_0x4e0601);_0x1e0ea1[_0x98fe('0xd')](_0x4e0601);}else{logger['info'](_0x98fe('0xe'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]||_0x98fe('0xd'));_0x1e0ea1[_0x98fe('0xf')]();}}else{_0x1e0ea1['next']();}}}catch(_0x4886e5){logger['error'](_0x98fe('0x5'),_0x52d637,JSON[_0x98fe('0x10')](_0x4886e5));_0x1e0ea1[_0x98fe('0xf')]();}};}; \ 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 c0cea64..f6c1a86 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 _0x7e6b=['chat','ChatWebsiteId','upperFirst','AccountId','interaction','Message','create','[%s][MESSAGE]\x20%s','body','error','stop','stringify','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel'];(function(_0x5a2ec8,_0x560609){var _0x69efdb=function(_0x948ca){while(--_0x948ca){_0x5a2ec8['push'](_0x5a2ec8['shift']());}};_0x69efdb(++_0x560609);}(_0x7e6b,0x186));var _0xb7e6=function(_0x4084e7,_0x478332){_0x4084e7=_0x4084e7-0x0;var _0x49a6a0=_0x7e6b[_0x4084e7];return _0x49a6a0;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0xb7e6('0x0'))(_0xb7e6('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb7e6('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb7e6('0x3')),'whatsappMessage':require(_0xb7e6('0x4'))};exports[_0xb7e6('0x5')]=function(_0x45f774,_0x2a9286){return function(_0x4c657c){try{var _0x5142ac={'body':utils[_0xb7e6('0x6')](_0x2a9286[0x0],this),'ContactId':this[_0xb7e6('0x7')]['id']};if(this[_0xb7e6('0x8')]===_0xb7e6('0x9')){_0x5142ac[_0xb7e6('0xa')]=this['account']['id'];}else{_0x5142ac[_[_0xb7e6('0xb')](this[_0xb7e6('0x8')])+_0xb7e6('0xc')]=this['account']['id'];}_0x5142ac[_[_0xb7e6('0xb')](this['channel'])+'InteractionId']=this[_0xb7e6('0xd')]['id'];if(rpc[this[_0xb7e6('0x8')]+_0xb7e6('0xe')]){return rpc[this[_0xb7e6('0x8')]+_0xb7e6('0xe')][_0xb7e6('0xf')](_0x5142ac)['then'](function(_0x47d402){logger['info'](_0xb7e6('0x10'),_0x45f774,_0x5142ac[_0xb7e6('0x11')]);_0x4c657c['next']();})['catch'](function(_0x6e6ed2){logger[_0xb7e6('0x12')](_0xb7e6('0x10'),_0x45f774,JSON['stringify'](_0x6e6ed2));_0x4c657c[_0xb7e6('0x13')]();});}}catch(_0x21b28c){logger[_0xb7e6('0x12')]('[%s][MESSAGE]\x20%s',_0x45f774,JSON[_0xb7e6('0x14')](_0x21b28c));_0x4c657c['stop']();}};}; \ No newline at end of file +var _0x48cb=['error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x48cb,0x16f));var _0xb48c=function(_0x3cdebc,_0x45fb74){_0x3cdebc=_0x3cdebc-0x0;var _0x4d7726=_0x48cb[_0x3cdebc];return _0x4d7726;};'use strict';var _=require(_0xb48c('0x0'));var utils=require(_0xb48c('0x1'));var logger=require(_0xb48c('0x2'))(_0xb48c('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb48c('0x4')),'mailMessage':require(_0xb48c('0x5')),'smsMessage':require(_0xb48c('0x6')),'faxMessage':require(_0xb48c('0x7')),'whatsappMessage':require(_0xb48c('0x8'))};exports[_0xb48c('0x9')]=function(_0x2b4bf1,_0x46ed6b){return function(_0x512041){try{var _0x51cec9={'body':utils[_0xb48c('0xa')](_0x46ed6b[0x0],this),'ContactId':this[_0xb48c('0xb')]['id']};if(this[_0xb48c('0xc')]==='chat'){_0x51cec9[_0xb48c('0xd')]=this[_0xb48c('0xe')]['id'];}else{_0x51cec9[_[_0xb48c('0xf')](this['channel'])+_0xb48c('0x10')]=this['account']['id'];}_0x51cec9[_[_0xb48c('0xf')](this[_0xb48c('0xc')])+'InteractionId']=this[_0xb48c('0x11')]['id'];if(rpc[this['channel']+_0xb48c('0x12')]){return rpc[this['channel']+'Message'][_0xb48c('0x13')](_0x51cec9)[_0xb48c('0x14')](function(_0x1be1db){logger[_0xb48c('0x15')](_0xb48c('0x16'),_0x2b4bf1,_0x51cec9[_0xb48c('0x17')]);_0x512041[_0xb48c('0x18')]();})['catch'](function(_0x41aa95){logger[_0xb48c('0x19')](_0xb48c('0x16'),_0x2b4bf1,JSON[_0xb48c('0x1a')](_0x41aa95));_0x512041[_0xb48c('0x1b')]();});}}catch(_0x531269){logger[_0xb48c('0x19')](_0xb48c('0x16'),_0x2b4bf1,JSON[_0xb48c('0x1a')](_0x531269));_0x512041[_0xb48c('0x1b')]();}};}; \ 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 4dd9b28..279d2de 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 _0xf1aa=['[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender','next','error'];(function(_0x4ae86b,_0x58b0ec){var _0x282214=function(_0x5e69a7){while(--_0x5e69a7){_0x4ae86b['push'](_0x4ae86b['shift']());}};_0x282214(++_0x58b0ec);}(_0xf1aa,0x116));var _0xaf1a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf1aa[_0x57b54c];return _0x59cc19;};'use strict';var utils=require(_0xaf1a('0x0'));var logger=require(_0xaf1a('0x1'))(_0xaf1a('0x2'));exports[_0xaf1a('0x3')]=function(_0x5c7084,_0xed28fe){return function(_0x3ed3b2){try{logger[_0xaf1a('0x4')]('[%s][NOOP]\x20%s',_0x5c7084,utils[_0xaf1a('0x5')](_0xed28fe[0x0],this));_0x3ed3b2[_0xaf1a('0x6')]();}catch(_0xf7df31){logger[_0xaf1a('0x7')](_0xaf1a('0x8'),_0x5c7084,JSON[_0xaf1a('0x9')](_0xf7df31));_0x3ed3b2[_0xaf1a('0xa')]();}};}; \ No newline at end of file +var _0x472b=['stringify','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x3d24b1,_0xc79289){var _0x47b56e=function(_0x382ad2){while(--_0x382ad2){_0x3d24b1['push'](_0x3d24b1['shift']());}};_0x47b56e(++_0xc79289);}(_0x472b,0xfc));var _0xb472=function(_0xbad79b,_0x2dbe6a){_0xbad79b=_0xbad79b-0x0;var _0x42eaa6=_0x472b[_0xbad79b];return _0x42eaa6;};'use strict';var utils=require(_0xb472('0x0'));var logger=require('../../../../config/logger')(_0xb472('0x1'));exports[_0xb472('0x2')]=function(_0x44ac47,_0x180770){return function(_0x5e7d17){try{logger[_0xb472('0x3')](_0xb472('0x4'),_0x44ac47,utils[_0xb472('0x5')](_0x180770[0x0],this));_0x5e7d17[_0xb472('0x6')]();}catch(_0xa5c67f){logger[_0xb472('0x7')](_0xb472('0x4'),_0x44ac47,JSON[_0xb472('0x8')](_0xa5c67f));_0x5e7d17[_0xb472('0x9')]();}};}; \ 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 89cf4ac..8927dd2 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 _0xa921=['beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','channel','upperFirst','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','close','next','strategy','rrmemory'];(function(_0x32bf2f,_0x11b473){var _0x3d2133=function(_0x1cdbb9){while(--_0x1cdbb9){_0x32bf2f['push'](_0x32bf2f['shift']());}};_0x3d2133(++_0x11b473);}(_0xa921,0x1dd));var _0x1a92=function(_0x1342b6,_0x633220){_0x1342b6=_0x1342b6-0x0;var _0x44f7ef=_0xa921[_0x1342b6];return _0x44f7ef;};'use strict';var schema=require(_0x1a92('0x0'));var _=require(_0x1a92('0x1'));var util=require(_0x1a92('0x2'));var seqqueue=require(_0x1a92('0x3'));var moment=require(_0x1a92('0x4'));var Redis=require('ioredis');var config=require(_0x1a92('0x5'));var logger=require('../../../../config/logger')(_0x1a92('0x6'));var strategy=require(_0x1a92('0x7'));config['redis']=_[_0x1a92('0x8')](config[_0x1a92('0x9')],{'host':_0x1a92('0xa'),'port':0x18eb});var io=require(_0x1a92('0xb'))(new Redis(config[_0x1a92('0x9')]));var attributes=['id',_0x1a92('0xc'),_0x1a92('0xd'),_0x1a92('0xe'),_0x1a92('0xf'),_0x1a92('0x10')];function emit(_0x4498ce,_0x11b7b5,_0x395644){io['to'](_0x4498ce)[_0x1a92('0x11')](_0x11b7b5,_0x395644);}function emitChannelQueueInteraction(_0x32017c,_0x37c5fd,_0x4b9787,_0x286ab2,_0x398d63,_0x40620c,_0x1d7261,_0x51079f){var _0x160b14=_[_0x1a92('0x12')](_0x4b9787);_0x160b14[_0x1a92('0xc')]=_0x51079f;_0x160b14[_0x1a92('0xe')]=_0x37c5fd;_0x160b14[_0x1a92('0xd')]=_0x286ab2;_0x160b14['id']=_0x398d63;if(_0x40620c){attributes['push'](_[_0x1a92('0x13')](_0x32017c)+_0x1a92('0x14'));_0x1d7261[util[_0x1a92('0x15')](_0x1a92('0x16'),_0x32017c)][_0x398d63]=_[_0x1a92('0x17')](_0x160b14,attributes);}else{delete _0x1d7261[util[_0x1a92('0x15')]('%sQueuesWaitingInteractions',_0x32017c)][_0x398d63];}emit(util['format'](_0x1a92('0x18'),_0x32017c,_0x37c5fd),util['format']('%s_queue_waiting_interaction:%s',_0x32017c,_0x40620c?_0x1a92('0x19'):_0x1a92('0x1a')),_[_0x1a92('0x17')](_0x160b14,attributes));}var rpc={'openchannelQueueReport':require(_0x1a92('0x1b')),'mailQueueReport':require(_0x1a92('0x1c')),'chatQueueReport':require(_0x1a92('0x1d')),'smsQueueReport':require(_0x1a92('0x1e')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1a92('0x1f'))};var queue=schema({'name':{'type':_0x1a92('0x20'),'required':!![],'message':_0x1a92('0x21')},'timeout':{'type':_0x1a92('0x22'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x4fd7af,_0x549864,_0x59d0ce,_0x3e5f9d){if(_0x4fd7af&&_0x549864&&_0x59d0ce){_0x549864['waiting']+=0x1;var _0x5c7f07={'uniqueid':_0x4fd7af,'from':_0x59d0ce[_0x1a92('0x23')]?_0x59d0ce[_0x1a92('0x23')][_0x1a92('0xf')]:'','joinAt':moment()[_0x1a92('0x15')](_0x1a92('0x24')),'ContactId':_0x59d0ce[_0x1a92('0x25')]?_0x59d0ce[_0x1a92('0x25')]['id']:null,'ListId':_0x59d0ce['list']?_0x59d0ce['list']['id']:null};_0x5c7f07[_['upperFirst'](_0x59d0ce[_0x1a92('0x26')])+'QueueId']=_0x549864['id']||null;_0x5c7f07[_[_0x1a92('0x27')](_0x59d0ce['channel'])+'InteractionId']=_0x59d0ce[_0x1a92('0x28')]?_0x59d0ce['interaction']['id']:null;_0x5c7f07[_['upperFirst'](_0x59d0ce[_0x1a92('0x26')])+_0x1a92('0x29')]=_0x59d0ce[_0x1a92('0x2a')]?_0x59d0ce[_0x1a92('0x2a')]['id']:null;_0x5c7f07[_[_0x1a92('0x27')](_0x59d0ce[_0x1a92('0x26')])+(_0x59d0ce[_0x1a92('0x26')]!==_0x1a92('0x2b')?_0x1a92('0x2c'):'WebsiteId')]=_0x59d0ce[_0x1a92('0xd')]?_0x59d0ce[_0x1a92('0xd')]['id']:null;logger[_0x1a92('0x2d')](util[_0x1a92('0x15')](_0x1a92('0x2e'),_0x4fd7af,_0x549864[_0x1a92('0x2f')]));emitChannelQueueInteraction(_0x59d0ce[_0x1a92('0x26')],_0x549864[_0x1a92('0x2f')],_0x5c7f07,_0x59d0ce['account'][_0x1a92('0x2f')],_0x59d0ce[_0x1a92('0x2a')]['id'],!![],_0x3e5f9d,_0x549864['id']);if(rpc[_0x59d0ce[_0x1a92('0x26')]+_0x1a92('0x30')]){return rpc[_0x59d0ce['channel']+'QueueReport'][_0x1a92('0x31')](_0x5c7f07)[_0x1a92('0x32')](function(_0xa10eb8){logger[_0x1a92('0x33')](_0x1a92('0x34'));});}}}function stopRouting(_0x1f68e4,_0xbe9d84,_0x6cccc,_0x5973cc){if(_0x1f68e4&&_0xbe9d84){_0xbe9d84[_0x1a92('0x35')]-=0x1;var _0x51c3cc={'leaveAt':moment()[_0x1a92('0x15')](_0x1a92('0x24')),'acceptAt':moment()[_0x1a92('0x15')](_0x1a92('0x24')),'reason':_0x1a92('0x36')};logger[_0x1a92('0x2d')](util[_0x1a92('0x15')](_0x1a92('0x37'),_0x1f68e4,_0xbe9d84[_0x1a92('0x2f')]));emitChannelQueueInteraction(_0x6cccc[_0x1a92('0x26')],_0xbe9d84[_0x1a92('0x2f')],_0x6cccc[_0x1a92('0x23')],_0x6cccc[_0x1a92('0xd')][_0x1a92('0x2f')],_0x6cccc[_0x1a92('0x2a')]['id'],![],_0x5973cc,_0xbe9d84['id']);if(rpc[_0x6cccc[_0x1a92('0x26')]+'QueueReport']){return rpc[_0x6cccc[_0x1a92('0x26')]+'QueueReport'][_0x1a92('0x38')](_0x1f68e4,_0x51c3cc)['catch'](function(_0x27f2aa){logger[_0x1a92('0x33')](_0x1a92('0x39'));});}}}function endRouting(_0x58c161,_0x51cc24,_0x201192,_0x4690d5){if(_0x58c161&&_0x51cc24){_0x51cc24[_0x1a92('0x35')]-=0x1;var _0x434a53={'leaveAt':moment()[_0x1a92('0x15')](_0x1a92('0x24')),'exitAt':moment()['format'](_0x1a92('0x24')),'reason':_0x1a92('0x3a')};logger[_0x1a92('0x2d')](util[_0x1a92('0x15')](_0x1a92('0x3b'),_0x58c161,_0x51cc24[_0x1a92('0x2f')]));emitChannelQueueInteraction(_0x201192[_0x1a92('0x26')],_0x51cc24[_0x1a92('0x2f')],_0x201192[_0x1a92('0x23')],_0x201192[_0x1a92('0xd')]['name'],_0x201192[_0x1a92('0x2a')]['id'],![],_0x4690d5);if(rpc[_0x201192[_0x1a92('0x26')]+'QueueReport']){return rpc[_0x201192[_0x1a92('0x26')]+'QueueReport'][_0x1a92('0x38')](_0x58c161,_0x434a53)[_0x1a92('0x32')](function(_0x5f0869){logger[_0x1a92('0x33')](_0x1a92('0x39'));});}}}function handleFindQueue(_0x11e8f4){return function(_0x1dc21d){return _0x1dc21d[_0x1a92('0x2f')][_0x1a92('0x3c')]()===_0x11e8f4[_0x1a92('0x3c')]();};}exports[_0x1a92('0x3d')]=function(_0x281c09,_0x15f976,_0x43a326,_0x352bd8){return function(_0x31780a){try{var _0xaa3c96={'name':_0x15f976[0x0],'timeout':_0x15f976[0x1]};var _0x38de88=queue[_0x1a92('0x0')](_0xaa3c96,{'typecast':!![]});if(_0x38de88[_0x1a92('0x3e')]){logger['error'](_0x1a92('0x3f'),_0x281c09,_[_0x1a92('0x40')](_0x38de88,_0x1a92('0x2a'))['join'](',\x20'));_0x31780a[_0x1a92('0x41')]();}else{var _0xba4785=_['find'](_0x43a326[_0x352bd8[_0x1a92('0x26')]+'Queues'],handleFindQueue(_0xaa3c96['name']));if(_0xba4785){startRouting(_0x281c09,_0xba4785,_0x352bd8,_0x43a326);var _0x50e8f2=(_0xba4785['timeout']||0xa)*0x3e8;var _0x55eb20=(_0xaa3c96[_0x1a92('0x3a')]||0x14)*0x3e8;var _0x30018f;if(_0x50e8f2>_0x55eb20){_0x55eb20=_0x50e8f2;}var _0x40388c=seqqueue['createQueue'](_0x50e8f2);_0x40388c['id']=_0x281c09;_0x40388c[_0x1a92('0x42')]=_0x50e8f2;_0x40388c[_0x1a92('0x43')]=_0x55eb20;_0x40388c[_0x1a92('0x26')]=_0x352bd8[_0x1a92('0x26')];_0x43a326[_0x1a92('0x44')][_0x281c09]['on'](_0x1a92('0x45'),function(){logger['info'](_0x1a92('0x46'),_0x281c09);stopRouting(_0x281c09,_0xba4785,_0x352bd8,_0x43a326);clearTimeout(_0x30018f);_0x30018f=undefined;_0x40388c['close'](!![]);if(_0x43a326[_0x1a92('0x44')][_0x281c09]){delete _0x43a326[_0x1a92('0x44')][_0x281c09];}_0x31780a['stop']();});_0x43a326[_0x1a92('0x44')][_0x281c09]['on'](_0x1a92('0x47'),function(){if(_0x43a326[_0x1a92('0x44')][_0x281c09]){delete _0x43a326[_0x1a92('0x44')][_0x281c09];}});_0x30018f=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x281c09);endRouting(_0x281c09,_0xba4785,_0x352bd8,_0x43a326);clearTimeout(_0x30018f);_0x40388c[_0x1a92('0x48')](!![]);_0x31780a[_0x1a92('0x49')]();},_0x55eb20);switch(_0xba4785[_0x1a92('0x4a')]){case _0x1a92('0x4b'):strategy[_0x1a92('0x4b')](_0x40388c,_0xba4785,_0x43a326,_0x352bd8);break;default:strategy[_0x1a92('0x4c')](_0x40388c,_0xba4785,_0x43a326,_0x352bd8);}}else{logger[_0x1a92('0x33')](_0x1a92('0x4d'),_0x281c09,_0xaa3c96[_0x1a92('0x2f')]);_0x31780a[_0x1a92('0x41')]();}}}catch(_0x443c83){console['log'](_0x443c83);logger[_0x1a92('0x33')](_0x1a92('0x3f'),_0x281c09,_0x443c83[_0x1a92('0x4e')]);_0x31780a[_0x1a92('0x41')]();}};}; \ No newline at end of file +var _0xb7b7=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','update','catch','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','toLowerCase','map','join','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s'];(function(_0x3658ce,_0x9fc347){var _0x3afdaf=function(_0x24587c){while(--_0x24587c){_0x3658ce['push'](_0x3658ce['shift']());}};_0x3afdaf(++_0x9fc347);}(_0xb7b7,0xce));var _0x7b7b=function(_0x22dcfe,_0x429156){_0x22dcfe=_0x22dcfe-0x0;var _0x39a0ab=_0xb7b7[_0x22dcfe];return _0x39a0ab;};'use strict';var schema=require(_0x7b7b('0x0'));var _=require(_0x7b7b('0x1'));var util=require(_0x7b7b('0x2'));var seqqueue=require(_0x7b7b('0x3'));var moment=require(_0x7b7b('0x4'));var Redis=require('ioredis');var config=require(_0x7b7b('0x5'));var logger=require(_0x7b7b('0x6'))(_0x7b7b('0x7'));var strategy=require(_0x7b7b('0x8'));config[_0x7b7b('0x9')]=_[_0x7b7b('0xa')](config[_0x7b7b('0x9')],{'host':_0x7b7b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b7b('0x9')]));var attributes=['id',_0x7b7b('0xc'),_0x7b7b('0xd'),_0x7b7b('0xe'),_0x7b7b('0xf'),_0x7b7b('0x10')];function emit(_0x231bde,_0x463f0b,_0x1c1ee2){io['to'](_0x231bde)[_0x7b7b('0x11')](_0x463f0b,_0x1c1ee2);}function emitChannelQueueInteraction(_0x30727a,_0x4f4e93,_0x490bea,_0x49b887,_0x2b567d,_0x2a6d64,_0x256c5f,_0x3b1365){var _0x258a17=_[_0x7b7b('0x12')](_0x490bea);_0x258a17[_0x7b7b('0xc')]=_0x3b1365;_0x258a17[_0x7b7b('0xe')]=_0x4f4e93;_0x258a17[_0x7b7b('0xd')]=_0x49b887;_0x258a17['id']=_0x2b567d;if(_0x2a6d64){attributes['push'](_[_0x7b7b('0x13')](_0x30727a)+'InteractionId');_0x256c5f[util[_0x7b7b('0x14')](_0x7b7b('0x15'),_0x30727a)][_0x2b567d]=_[_0x7b7b('0x16')](_0x258a17,attributes);}else{delete _0x256c5f[util[_0x7b7b('0x14')](_0x7b7b('0x15'),_0x30727a)][_0x2b567d];}emit(util[_0x7b7b('0x14')](_0x7b7b('0x17'),_0x30727a,_0x4f4e93),util[_0x7b7b('0x14')](_0x7b7b('0x18'),_0x30727a,_0x2a6d64?'save':'remove'),_[_0x7b7b('0x16')](_0x258a17,attributes));}var rpc={'openchannelQueueReport':require(_0x7b7b('0x19')),'mailQueueReport':require(_0x7b7b('0x1a')),'chatQueueReport':require(_0x7b7b('0x1b')),'smsQueueReport':require(_0x7b7b('0x1c')),'faxQueueReport':require(_0x7b7b('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7b7b('0x1e')}});function startRouting(_0x36a848,_0x394e5c,_0x56e1a9,_0x7a1f03){if(_0x36a848&&_0x394e5c&&_0x56e1a9){_0x394e5c[_0x7b7b('0x1f')]+=0x1;var _0x5d4e64={'uniqueid':_0x36a848,'from':_0x56e1a9[_0x7b7b('0x20')]?_0x56e1a9[_0x7b7b('0x20')][_0x7b7b('0xf')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56e1a9['contact']?_0x56e1a9[_0x7b7b('0x21')]['id']:null,'ListId':_0x56e1a9[_0x7b7b('0x22')]?_0x56e1a9[_0x7b7b('0x22')]['id']:null};_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+_0x7b7b('0x25')]=_0x394e5c['id']||null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9['channel'])+_0x7b7b('0x26')]=_0x56e1a9[_0x7b7b('0x27')]?_0x56e1a9[_0x7b7b('0x27')]['id']:null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+'MessageId']=_0x56e1a9[_0x7b7b('0x28')]?_0x56e1a9['message']['id']:null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+(_0x56e1a9['channel']!==_0x7b7b('0x29')?_0x7b7b('0x2a'):_0x7b7b('0x2b'))]=_0x56e1a9[_0x7b7b('0xd')]?_0x56e1a9[_0x7b7b('0xd')]['id']:null;logger[_0x7b7b('0x2c')](util[_0x7b7b('0x14')](_0x7b7b('0x2d'),_0x36a848,_0x394e5c[_0x7b7b('0x2e')]));emitChannelQueueInteraction(_0x56e1a9['channel'],_0x394e5c[_0x7b7b('0x2e')],_0x5d4e64,_0x56e1a9[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x56e1a9[_0x7b7b('0x28')]['id'],!![],_0x7a1f03,_0x394e5c['id']);if(rpc[_0x56e1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x56e1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x30')](_0x5d4e64)['catch'](function(_0x40e7fe){logger[_0x7b7b('0x31')](_0x7b7b('0x32'));});}}}function stopRouting(_0x36cea4,_0x4a1a86,_0x38d1a9,_0x3d4c28){if(_0x36cea4&&_0x4a1a86){_0x4a1a86['waiting']-=0x1;var _0x3b6b44={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x7b7b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7b7b('0x33')};logger[_0x7b7b('0x2c')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x36cea4,_0x4a1a86['name']));emitChannelQueueInteraction(_0x38d1a9['channel'],_0x4a1a86[_0x7b7b('0x2e')],_0x38d1a9[_0x7b7b('0x20')],_0x38d1a9[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x38d1a9['message']['id'],![],_0x3d4c28,_0x4a1a86['id']);if(rpc[_0x38d1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x38d1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x34')](_0x36cea4,_0x3b6b44)[_0x7b7b('0x35')](function(_0x5bec76){logger[_0x7b7b('0x31')](_0x7b7b('0x36'));});}}}function endRouting(_0x172f3f,_0x427a10,_0x1f9016,_0x582f11){if(_0x172f3f&&_0x427a10){_0x427a10[_0x7b7b('0x1f')]-=0x1;var _0x248f17={'leaveAt':moment()[_0x7b7b('0x14')](_0x7b7b('0x37')),'exitAt':moment()['format'](_0x7b7b('0x37')),'reason':_0x7b7b('0x38')};logger[_0x7b7b('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x172f3f,_0x427a10[_0x7b7b('0x2e')]));emitChannelQueueInteraction(_0x1f9016[_0x7b7b('0x24')],_0x427a10['name'],_0x1f9016[_0x7b7b('0x20')],_0x1f9016[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x1f9016[_0x7b7b('0x28')]['id'],![],_0x582f11);if(rpc[_0x1f9016[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x1f9016[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x34')](_0x172f3f,_0x248f17)[_0x7b7b('0x35')](function(_0x3424da){logger[_0x7b7b('0x31')](_0x7b7b('0x36'));});}}}function handleFindQueue(_0x353120){return function(_0xedd57a){return _0xedd57a[_0x7b7b('0x2e')][_0x7b7b('0x39')]()===_0x353120[_0x7b7b('0x39')]();};}exports['consequence']=function(_0xd89f28,_0x406c70,_0xfb68bb,_0x452eb7){return function(_0x48d147){try{var _0x1b9e8f={'name':_0x406c70[0x0],'timeout':_0x406c70[0x1]};var _0x37c6d6=queue[_0x7b7b('0x0')](_0x1b9e8f,{'typecast':!![]});if(_0x37c6d6['length']){logger[_0x7b7b('0x31')]('[%s][QUEUE]\x20%s',_0xd89f28,_[_0x7b7b('0x3a')](_0x37c6d6,_0x7b7b('0x28'))[_0x7b7b('0x3b')](',\x20'));_0x48d147['stop']();}else{var _0x3d6f6e=_['find'](_0xfb68bb[_0x452eb7[_0x7b7b('0x24')]+_0x7b7b('0x3c')],handleFindQueue(_0x1b9e8f['name']));if(_0x3d6f6e){startRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);var _0x56b7c5=(_0x3d6f6e[_0x7b7b('0x38')]||0xa)*0x3e8;var _0x4112ef=(_0x1b9e8f[_0x7b7b('0x38')]||0x14)*0x3e8;var _0x53a427;if(_0x56b7c5>_0x4112ef){_0x4112ef=_0x56b7c5;}var _0x393c05=seqqueue[_0x7b7b('0x3d')](_0x56b7c5);_0x393c05['id']=_0xd89f28;_0x393c05[_0x7b7b('0x3e')]=_0x56b7c5;_0x393c05[_0x7b7b('0x3f')]=_0x4112ef;_0x393c05[_0x7b7b('0x24')]=_0x452eb7[_0x7b7b('0x24')];_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]['on'](_0x7b7b('0x41'),function(){logger[_0x7b7b('0x2c')](_0x7b7b('0x42'),_0xd89f28);stopRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);clearTimeout(_0x53a427);_0x53a427=undefined;_0x393c05[_0x7b7b('0x43')](!![]);if(_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]){delete _0xfb68bb[_0x7b7b('0x40')][_0xd89f28];}_0x48d147['stop']();});_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]['on']('complete',function(){if(_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]){delete _0xfb68bb[_0x7b7b('0x40')][_0xd89f28];}});_0x53a427=setTimeout(function(){logger[_0x7b7b('0x2c')](_0x7b7b('0x44'),_0xd89f28);endRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);clearTimeout(_0x53a427);_0x393c05[_0x7b7b('0x43')](!![]);_0x48d147[_0x7b7b('0x45')]();},_0x4112ef);switch(_0x3d6f6e[_0x7b7b('0x46')]){case _0x7b7b('0x47'):strategy[_0x7b7b('0x47')](_0x393c05,_0x3d6f6e,_0xfb68bb,_0x452eb7);break;default:strategy[_0x7b7b('0x48')](_0x393c05,_0x3d6f6e,_0xfb68bb,_0x452eb7);}}else{logger['error'](_0x7b7b('0x49'),_0xd89f28,_0x1b9e8f['name']);_0x48d147[_0x7b7b('0x4a')]();}}}catch(_0x5124ce){console['log'](_0x5124ce);logger['error'](_0x7b7b('0x4b'),_0xd89f28,_0x5124ce[_0x7b7b('0x4c')]);_0x48d147['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index d2c64d0..7b7339b 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 _0x34e8=['busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x34e8,0x12c));var _0x834e=function(_0x4ce4b6,_0x1a759d){_0x4ce4b6=_0x4ce4b6-0x0;var _0x46ee98=_0x34e8[_0x4ce4b6];return _0x46ee98;};'use strict';var _=require(_0x834e('0x0'));var uuid=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var logger=require(_0x834e('0x3'))('routing');var Agent=function(_0x832422,_0x21e2e0,_0x472111,_0x31bf20){this[_0x834e('0x4')]=uuid['v4']();this[_0x834e('0x5')]=_0x832422;this[_0x834e('0x6')]=_0x21e2e0;this['realtime']=_0x472111;this[_0x834e('0x7')]=_0x31bf20;this['squeue'][_0x834e('0x8')](this[_0x834e('0x9')][_0x834e('0xa')](this),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xc'),this[_0x834e('0xb')][_0x834e('0xa')](this));this[_0x834e('0x5')]['on'](_0x834e('0xd'),this[_0x834e('0xe')][_0x834e('0xa')](this));};Agent[_0x834e('0xf')][_0x834e('0x8')]=function(){this[_0x834e('0x5')][_0x834e('0x8')](this['handleRun'][_0x834e('0xa')](this),this[_0x834e('0xb')]['bind'](this));};Agent[_0x834e('0xf')][_0x834e('0xe')]=function(){this[_0x834e('0xb')](!![]);};Agent[_0x834e('0xf')]['handleRun']=function(){logger[_0x834e('0x10')](_0x834e('0x11'),this['squeue']['id'],this[_0x834e('0x6')]['id']);if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']])){logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x834e('0x8')][_0x834e('0xa')](this),0x3e8);}else{if(this[_0x834e('0x7')][_0x834e('0x15')]||util[_0x834e('0x16')](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']],this[_0x834e('0x5')][_0x834e('0x17')],![])){this[_0x834e('0x12')]['agents'][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=!![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util['saveWaitingNotification'](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue'][_0x834e('0x17')]);util[_0x834e('0x1a')](this['notificationId'],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this['agent']['id']],null,this[_0x834e('0x7')]);util[_0x834e('0x1b')](this['squeue']['id'],this['realtime'][_0x834e('0x13')][this['agent']['id']],_0x834e('0x1c')+(this[_0x834e('0x7')][_0x834e('0x15')]?_0x834e('0x1d'):''));}else{logger[_0x834e('0x10')](_0x834e('0x1e'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x834e('0xf')][_0x834e('0xb')]=function(_0x106d6a){if(_['isNil'](this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']])){return logger[_0x834e('0x10')](_0x834e('0x14'),this[_0x834e('0x5')]['id'],this[_0x834e('0x6')]['id']);}else{logger[_0x834e('0x10')](_0x834e('0x1f'),this['squeue']['id'],this[_0x834e('0x6')]['id']);util['hideNotification'](this[_0x834e('0x4')],this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],null,this[_0x834e('0x7')]);this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x18')]=![];this['realtime'][_0x834e('0x13')][this[_0x834e('0x6')]['id']][_0x834e('0x19')]=undefined;util[_0x834e('0x20')](this['realtime'],this[_0x834e('0x7')],this[_0x834e('0x6')],this['squeue']['channel']);util['writeLog'](this[_0x834e('0x5')]['id'],this[_0x834e('0x12')][_0x834e('0x13')][this[_0x834e('0x6')]['id']],_0x106d6a?_0x834e('0x21'):_0x834e('0x22'));}if(!_0x106d6a){setTimeout(this['push'][_0x834e('0xa')](this),0x3e8);}};function agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed){return new Agent(_0x513f36,_0xe103fe,_0x6a3ac,_0x47abed);}module[_0x834e('0x23')]=agent; \ No newline at end of file +var _0xd0bb=['RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','writeLog'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3a4b2a,_0x1d17d2){_0x3a4b2a=_0x3a4b2a-0x0;var _0xe2640e=_0xd0bb[_0x3a4b2a];return _0xe2640e;};'use strict';var _=require(_0xbd0b('0x0'));var uuid=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var logger=require('../../../../../config/logger')(_0xbd0b('0x3'));var Agent=function(_0x4ab08f,_0x39b03a,_0x1f6ec3,_0x53e6ce){this[_0xbd0b('0x4')]=uuid['v4']();this['squeue']=_0x4ab08f;this[_0xbd0b('0x5')]=_0x39b03a;this[_0xbd0b('0x6')]=_0x1f6ec3;this[_0xbd0b('0x3')]=_0x53e6ce;this[_0xbd0b('0x7')][_0xbd0b('0x8')](this['handleRun'][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xb'),this['handleTimeout']['bind'](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xc'),this['handleDrained'][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')]['push']=function(){this[_0xbd0b('0x7')][_0xbd0b('0x8')](this[_0xbd0b('0xe')][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')][_0xbd0b('0xf')]=function(){this[_0xbd0b('0xa')](!![]);};Agent[_0xbd0b('0xd')][_0xbd0b('0xe')]=function(){logger['debug'](_0xbd0b('0x10'),this['squeue']['id'],this['agent']['id']);if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']])){logger[_0xbd0b('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xbd0b('0x5')]['id']);setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}else{if(this[_0xbd0b('0x3')][_0xbd0b('0x14')]||util[_0xbd0b('0x15')](this['squeue']['id'],this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']],this[_0xbd0b('0x7')][_0xbd0b('0x16')],![])){this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=!![];this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']]['busyQueue']=undefined;util[_0xbd0b('0x18')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x19')](this['notificationId'],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],null,this[_0xbd0b('0x3')]);util[_0xbd0b('0x1a')](this['squeue']['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xbd0b('0x1b')+(this[_0xbd0b('0x3')][_0xbd0b('0x14')]?':FORCED':''));}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1c'),this[_0xbd0b('0x7')]['id'],this['agent']['id']);setTimeout(this['push'][_0xbd0b('0x9')](this),0x3e8);}}};Agent[_0xbd0b('0xd')][_0xbd0b('0xa')]=function(_0xf4ba04){if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']])){return logger[_0xbd0b('0x13')](_0xbd0b('0x1d'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1e'),this['squeue']['id'],this[_0xbd0b('0x5')]['id']);util[_0xbd0b('0x1f')](this[_0xbd0b('0x4')],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']],null,this[_0xbd0b('0x3')]);this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=![];this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x20')]=undefined;util[_0xbd0b('0x21')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x1a')](this[_0xbd0b('0x7')]['id'],this['realtime'][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xf4ba04?_0xbd0b('0x22'):_0xbd0b('0x23'));}if(!_0xf4ba04){setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}};function agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098){return new Agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098);}module[_0xbd0b('0x24')]=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 4e3989b..b6103b4 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 _0xda74=['channel','busyQueue','name','saveWaitingNotification','[%s][QUEUE]\x20EMPTY','hideNotification','notificationId','TIMEOUT','busy','removeWaitingNotification','lodash','uuid','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda74,0xe3));var _0x4da7=function(_0x2ad32b,_0x15139a){_0x2ad32b=_0x2ad32b-0x0;var _0x534163=_0xda74[_0x2ad32b];return _0x534163;};'use strict';var _=require(_0x4da7('0x0'));var uuid=require(_0x4da7('0x1'));var util=require('./util');var logger=require(_0x4da7('0x2'))(_0x4da7('0x3'));var Beepall=function(_0x1e50cd,_0xb2b56d,_0x590800,_0x11eff7){this['notificationId']=uuid['v4']();this[_0x4da7('0x4')]=_0x1e50cd;this[_0x4da7('0x5')]=_0xb2b56d;this[_0x4da7('0x6')]=_0x590800;this[_0x4da7('0x3')]=_0x11eff7;this['squeue'][_0x4da7('0x7')](this[_0x4da7('0x8')][_0x4da7('0x9')](this),this[_0x4da7('0xa')][_0x4da7('0x9')](this));this[_0x4da7('0x4')]['on'](_0x4da7('0xb'),this[_0x4da7('0xa')][_0x4da7('0x9')](this));this['squeue']['on']('drained',this[_0x4da7('0xc')][_0x4da7('0x9')](this));};Beepall[_0x4da7('0xd')][_0x4da7('0x7')]=function(){this[_0x4da7('0x4')]['push'](this[_0x4da7('0x8')][_0x4da7('0x9')](this),this[_0x4da7('0xa')][_0x4da7('0x9')](this));};Beepall[_0x4da7('0xd')][_0x4da7('0xc')]=function(){this[_0x4da7('0xa')](!![]);};Beepall[_0x4da7('0xd')][_0x4da7('0x8')]=function(){var _0x18098a=!![];if(!_[_0x4da7('0xe')](this['queue'])&&!_[_0x4da7('0xe')](this[_0x4da7('0x5')][_0x4da7('0xf')])&&this['queue'][_0x4da7('0xf')][_0x4da7('0x10')]>0x0){for(var _0x13ff50=0x0,_0x2a566f;_0x13ff500x0){for(var _0x50821f=0x0,_0x3709e5;_0x50821f0x0&&_0x1287da[_0xecae64+'CurrentCapacity']>=_0x1287da[_0xecae64+_0x333f('0x22')]){writeLog(_0x205e42,_0x1287da,_0xecae64[_0x333f('0x23')]()+_0x333f('0x24'));return![];}}return!![];};exports[_0x333f('0x25')]=function(_0x276245,_0x323f37,_0x5a8d7c,_0x40de67,_0x6ba084){return sendNotification(!![],_0x276245,_0x323f37,_0x5a8d7c,_0x40de67,_0x6ba084);};exports[_0x333f('0x26')]=function(_0x4e35f7,_0xb4a8bd,_0x56e68d,_0x58ba41,_0x2308e8){return sendNotification(![],_0x4e35f7,_0xb4a8bd,_0x56e68d,_0x58ba41,_0x2308e8);};exports[_0x333f('0x27')]=function(_0x572776,_0x59765f,_0x6923f9){var _0x57a993=_0x59765f[_0x333f('0x28')][_0x333f('0x29')];if(!_0x57a993&&_0x6923f9){_0x57a993=_0x6923f9['id'];}var _0xc4fadf=_['some'](_0x572776[_0x59765f['channel']+_0x333f('0x2a')],function(_0x5702d1){var _0x308da4=_[_0x333f('0x2b')](_0x59765f[_0x333f('0x2c')])+_0x333f('0x2d');return _0x5702d1[_0x308da4]===_0x59765f[_0x333f('0x28')]['id'];});if(!_0xc4fadf&&_0x57a993){_0xc4fadf=_[_0x333f('0x2e')](_0x572776['agents'][_0x57a993][_0x59765f[_0x333f('0x2c')]+_0x333f('0x2f')],function(_0x491781){return _0x491781['id']===_0x59765f[_0x333f('0x28')]['id'];});}return _0xc4fadf;};exports[_0x333f('0x30')]=function(_0x4cedcd,_0x50d282,_0x2f3c83,_0x51ea77){_0x4cedcd[_0x333f('0x31')][_0x2f3c83['id']][_0x51ea77+_0x333f('0x2f')][_0x50d282['message']['id']]={'id':_0x50d282['interaction']['id']};};exports[_0x333f('0x32')]=function(_0x385a24,_0x140597,_0x5a0774,_0x2d534e){delete _0x385a24['agents'][_0x5a0774['id']][_0x2d534e+'WaitingInteractions'][_0x140597[_0x333f('0x33')]['id']];};exports[_0x333f('0x34')]=writeLog; \ No newline at end of file +var _0xb499=['BUSY','online','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','checkWaitingNotifications','interaction','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','message','writeLog','lodash','util','../utils','ioredis','defaults','redis','socket.io-emitter','format','user:%s','name','user:save','split','\x20interaction','body','queue','msg','getMustacheRender','account','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','emit','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy'];(function(_0x5ddec9,_0x209a36){var _0x5abb94=function(_0x5816db){while(--_0x5816db){_0x5ddec9['push'](_0x5ddec9['shift']());}};_0x5abb94(++_0x209a36);}(_0xb499,0x10a));var _0x9b49=function(_0x58c361,_0x51e767){_0x58c361=_0x58c361-0x0;var _0x314d82=_0xb499[_0x58c361];return _0x314d82;};'use strict';var _=require(_0x9b49('0x0'));var util=require(_0x9b49('0x1'));var utils=require(_0x9b49('0x2'));var Redis=require(_0x9b49('0x3'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')('routing');config['redis']=_[_0x9b49('0x4')](config[_0x9b49('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9b49('0x6'))(new Redis(config[_0x9b49('0x5')]));function sendNotification(_0x2b9f2,_0x492c5e,_0x1fc335,_0x566333,_0x22ca9e,_0x5a0b8f){io['to'](util[_0x9b49('0x7')](_0x9b49('0x8'),_0x566333[_0x9b49('0x9')]))['emit'](_0x9b49('0xa'),_0x566333);var _0x1d74bb=_0x5a0b8f||{};var _0x695c1b=_0x1fc335[_0x9b49('0xb')]('.');var _0x495840={'uniqueid':_0x492c5e,'channel':_0x695c1b[0x0],'id':_0x695c1b[0x1],'title':_0x695c1b[0x0]+_0x9b49('0xc'),'interactionId':_0x695c1b[0x2],'queue':_0x22ca9e?_0x22ca9e[_0x9b49('0x9')]:null,'sound':_0x1d74bb['account']['notificationSound'],'shake':_0x1d74bb['account']['notificationShake']};try{if(!_0x1d74bb['body']){_0x1d74bb[_0x9b49('0xd')]={};}if(_0x22ca9e){_0x1d74bb[_0x9b49('0xd')]['queue']=_0x22ca9e;}else if(_0x1d74bb[_0x9b49('0xd')][_0x9b49('0xe')]){delete _0x1d74bb[_0x9b49('0xd')]['queue'];}_0x495840[_0x9b49('0xf')]=utils[_0x9b49('0x10')](_0x1d74bb[_0x9b49('0x11')][_0x9b49('0x12')],_0x1d74bb);}catch(_0x3e8e6a){_0x495840[_0x9b49('0xf')]=_0x9b49('0x13');logger[_0x9b49('0x14')](util[_0x9b49('0x7')](_0x9b49('0x15'),_0x492c5e,_0x3e8e6a['message']));}io['to'](util[_0x9b49('0x7')](_0x9b49('0x8'),_0x566333[_0x9b49('0x9')]))[_0x9b49('0x16')](util[_0x9b49('0x7')]('notification:%s',_0x2b9f2?_0x9b49('0x17'):'remove'),_0x495840);}function writeLog(_0x2db174,_0x62833c,_0x1e0bc1){return logger[_0x9b49('0x18')](util[_0x9b49('0x7')](_0x9b49('0x19'),_0x2db174,_0x62833c[_0x9b49('0x9')],_0x1e0bc1));}exports[_0x9b49('0x1a')]=function(_0x54a01d,_0x351c7a,_0x34aef2,_0x278877){if(_0x351c7a[_0x9b49('0x1b')]){writeLog(_0x54a01d,_0x351c7a,_0x9b49('0x1c'));return![];}if(!_0x351c7a[_0x9b49('0x1d')]){writeLog(_0x54a01d,_0x351c7a,_0x9b49('0x1e'));return![];}if(_0x351c7a[_0x34aef2+_0x9b49('0x1f')]){writeLog(_0x54a01d,_0x351c7a,'PAUSE');return![];}if(_0x278877&&_0x351c7a['hasOwnProperty'](_0x34aef2+'Capacity')&&_0x351c7a[_0x9b49('0x20')](_0x34aef2+_0x9b49('0x21'))){if(_0x351c7a[_0x34aef2+'Capacity']>0x0&&_0x351c7a[_0x34aef2+_0x9b49('0x21')]>=_0x351c7a[_0x34aef2+_0x9b49('0x22')]){writeLog(_0x54a01d,_0x351c7a,_0x34aef2[_0x9b49('0x23')]()+_0x9b49('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x296b4d,_0x4d3eaa,_0x5c2289,_0x42d5c0,_0x2c3ece){return sendNotification(!![],_0x296b4d,_0x4d3eaa,_0x5c2289,_0x42d5c0,_0x2c3ece);};exports['hideNotification']=function(_0x45ba98,_0x924b9f,_0x53362d,_0x18a827,_0x1617a9){return sendNotification(![],_0x45ba98,_0x924b9f,_0x53362d,_0x18a827,_0x1617a9);};exports[_0x9b49('0x25')]=function(_0x23606d,_0x4b4d71,_0x2d7c1a){var _0xbfc0bc=_0x4b4d71[_0x9b49('0x26')]['UserId'];if(!_0xbfc0bc&&_0x2d7c1a){_0xbfc0bc=_0x2d7c1a['id'];}var _0x2109b9=_[_0x9b49('0x27')](_0x23606d[_0x4b4d71[_0x9b49('0x28')]+_0x9b49('0x29')],function(_0x39e7bd){var _0x61fca3=_[_0x9b49('0x2a')](_0x4b4d71[_0x9b49('0x28')])+_0x9b49('0x2b');return _0x39e7bd[_0x61fca3]===_0x4b4d71[_0x9b49('0x26')]['id'];});if(!_0x2109b9&&_0xbfc0bc){_0x2109b9=_[_0x9b49('0x27')](_0x23606d[_0x9b49('0x2c')][_0xbfc0bc][_0x4b4d71[_0x9b49('0x28')]+_0x9b49('0x2d')],function(_0x4f098f){return _0x4f098f['id']===_0x4b4d71['interaction']['id'];});}return _0x2109b9;};exports[_0x9b49('0x2e')]=function(_0x17ce9a,_0xc960cf,_0x504bb1,_0x401c72){_0x17ce9a[_0x9b49('0x2c')][_0x504bb1['id']][_0x401c72+'WaitingInteractions'][_0xc960cf[_0x9b49('0x2f')]['id']]={'id':_0xc960cf[_0x9b49('0x26')]['id']};};exports['removeWaitingNotification']=function(_0x234660,_0x5313d9,_0x49188e,_0x3ba7d2){delete _0x234660[_0x9b49('0x2c')][_0x49188e['id']][_0x3ba7d2+'WaitingInteractions'][_0x5313d9['message']['id']];};exports[_0x9b49('0x30')]=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 dc0b84e..90fb528 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 _0x827d=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','isObject','stringify','validate','shelljs'];(function(_0x1392de,_0x10b68e){var _0x45bdef=function(_0x241923){while(--_0x241923){_0x1392de['push'](_0x1392de['shift']());}};_0x45bdef(++_0x10b68e);}(_0x827d,0xdf));var _0xd827=function(_0x1bc179,_0x5c5631){_0x1bc179=_0x1bc179-0x0;var _0x1f6536=_0x827d[_0x1bc179];return _0x1f6536;};'use strict';var schema=require(_0xd827('0x0'));var sh=require(_0xd827('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xd827('0x2'));var system=schema({'command':{'type':_0xd827('0x3'),'required':!![],'message':_0xd827('0x4')}});exports['consequence']=function(_0x408451,_0x50e71e){return function(_0x195812){try{var _0x357c0b={'command':_0x50e71e[0x0]};var _0x105998=system[_0xd827('0x0')](_0x357c0b,{'typecast':!![]});if(_0x105998[_0xd827('0x5')]){logger['error'](_0xd827('0x6'),_0x408451,_['map'](_0x105998,_0xd827('0x7'))[_0xd827('0x8')](',\x20'));logger[_0xd827('0x9')](_0xd827('0xa'),_0x408451);_0x195812[_0xd827('0xb')]();}else{var _0x2aff55=this;var _0x42376d=utils[_0xd827('0xc')](_0x50e71e[0x0],this);logger['info'](_0xd827('0xd'),_0x408451,_0x42376d);sh[_0xd827('0xe')](_['trim'](_0x42376d),function(_0x59255a,_0x116c7f){logger[_0xd827('0x9')](_0xd827('0xf'),_0x408451,_0x59255a);if(_0x59255a==0x0){var _0x48730f=_0x116c7f[_0xd827('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xd827('0x11')](_0x50e71e[0x1])||_[_0xd827('0x12')](_0x50e71e[0x1])){logger[_0xd827('0x9')](_0xd827('0x13'),_0x408451);_0x2aff55['body'][_0x50e71e[0x1]]=_0x48730f;}else{logger['info'](_0xd827('0x14'),_0x408451,_0x50e71e[0x1],_0x48730f);_0x2aff55[_0xd827('0x15')][_0x50e71e[0x1]]=_0x48730f;}}_0x195812[_0xd827('0xb')]();});}}catch(_0x5c16d5){logger[_0xd827('0x16')](_0xd827('0x6'),_0x408451,_[_0xd827('0x17')](_0x5c16d5)?JSON[_0xd827('0x18')](_0x5c16d5):_0x5c16d5);logger[_0xd827('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x408451);_0x195812[_0xd827('0xb')]();}};}; \ No newline at end of file +var _0xa78e=['lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','validate','shelljs'];(function(_0x2095e3,_0x3d165d){var _0x96988c=function(_0x5d172d){while(--_0x5d172d){_0x2095e3['push'](_0x2095e3['shift']());}};_0x96988c(++_0x3d165d);}(_0xa78e,0x1e1));var _0xea78=function(_0x4b31b8,_0x5f3b0b){_0x4b31b8=_0x4b31b8-0x0;var _0x37ce7b=_0xa78e[_0x4b31b8];return _0x37ce7b;};'use strict';var schema=require(_0xea78('0x0'));var sh=require(_0xea78('0x1'));var _=require(_0xea78('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xea78('0x3'));var system=schema({'command':{'type':_0xea78('0x4'),'required':!![],'message':_0xea78('0x5')}});exports['consequence']=function(_0x2dfb13,_0x2dd48e){return function(_0x7672ec){try{var _0x3cb08c={'command':_0x2dd48e[0x0]};var _0x1c5825=system['validate'](_0x3cb08c,{'typecast':!![]});if(_0x1c5825[_0xea78('0x6')]){logger['error'](_0xea78('0x7'),_0x2dfb13,_['map'](_0x1c5825,'message')[_0xea78('0x8')](',\x20'));logger[_0xea78('0x9')](_0xea78('0xa'),_0x2dfb13);_0x7672ec[_0xea78('0xb')]();}else{var _0x1da7d4=this;var _0x2acd33=utils['getMustacheRender'](_0x2dd48e[0x0],this);logger[_0xea78('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x2dfb13,_0x2acd33);sh[_0xea78('0xc')](_[_0xea78('0xd')](_0x2acd33),function(_0x353c67,_0x3bae8c){logger[_0xea78('0x9')](_0xea78('0xe'),_0x2dfb13,_0x353c67);if(_0x353c67==0x0){var _0x41598f=_0x3bae8c['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xea78('0xf')](_0x2dd48e[0x1])||_[_0xea78('0x10')](_0x2dd48e[0x1])){logger[_0xea78('0x9')](_0xea78('0x11'),_0x2dfb13);_0x1da7d4[_0xea78('0x12')][_0x2dd48e[0x1]]=_0x41598f;}else{logger[_0xea78('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2dfb13,_0x2dd48e[0x1],_0x41598f);_0x1da7d4[_0xea78('0x12')][_0x2dd48e[0x1]]=_0x41598f;}}_0x7672ec[_0xea78('0xb')]();});}}catch(_0x457835){logger[_0xea78('0x13')]('[%s][SYSTEM]\x20%s',_0x2dfb13,_[_0xea78('0x14')](_0x457835)?JSON['stringify'](_0x457835):_0x457835);logger['info'](_0xea78('0xa'),_0x2dfb13);_0x7672ec[_0xea78('0xb')]();}};}; \ 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 25bc0f3..e1df27c 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 _0x98bb=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','length','error','[%s][TAG]\x20%s','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','catch','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x47fc89,_0x5b115a){var _0x4d6720=function(_0x2517c8){while(--_0x2517c8){_0x47fc89['push'](_0x47fc89['shift']());}};_0x4d6720(++_0x5b115a);}(_0x98bb,0x104));var _0xb98b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x98bb[_0xa1e3e3];return _0xc980e9;};'use strict';var schema=require(_0xb98b('0x0'));var _=require(_0xb98b('0x1'));var rpc={'chatInteraction':require(_0xb98b('0x2')),'openchannelInteraction':require(_0xb98b('0x3')),'smsInteraction':require(_0xb98b('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xb98b('0x5')),'whatsappInteraction':require(_0xb98b('0x6'))};var logger=require(_0xb98b('0x7'))('routing');var tag=schema({'tag':{'type':_0xb98b('0x8'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x8f47c9,_0x3ad829,_0x19e0c8,_0x185965){return function(_0x43725e){try{var _0x4d0b05={'tag':_0x3ad829[0x0]};var _0x595cae=tag[_0xb98b('0x0')](_0x4d0b05,{'typecast':!![]});if(_0x595cae[_0xb98b('0x9')]){logger[_0xb98b('0xa')](_0xb98b('0xb'),_0x8f47c9,_[_0xb98b('0xc')](_0x595cae,'message')[_0xb98b('0xd')](',\x20'));logger['info'](_0xb98b('0xe'),_0x8f47c9);_0x43725e[_0xb98b('0xf')]();}else{var _0x20b1a5={'ids':[_0x3ad829[0x0]]};if(rpc[_0x185965[_0xb98b('0x10')]+_0xb98b('0x11')]){rpc[_0x185965[_0xb98b('0x10')]+'Interaction']['addTags'](_0x185965[_0xb98b('0x12')]['id'],_0x20b1a5)[_0xb98b('0x13')](function(_0x1d3560){logger[_0xb98b('0x14')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x8f47c9,_0x3ad829[0x1],_0x185965[_0xb98b('0x10')],_0x185965[_0xb98b('0x12')]['id']);})[_0xb98b('0x15')](function(_0x501e2d){logger[_0xb98b('0xa')]('[%s][TAG]\x20%s',_0x8f47c9,JSON['stringify'](_0x501e2d));logger[_0xb98b('0x14')](_0xb98b('0xe'),_0x8f47c9);})[_0xb98b('0x16')](function(){_0x43725e['next']();});}}}catch(_0x383f35){logger[_0xb98b('0xa')](_0xb98b('0xb'),_0x8f47c9,_[_0xb98b('0x17')](_0x383f35)?JSON['stringify'](_0x383f35):_0x383f35);logger[_0xb98b('0x14')](_0xb98b('0xe'),_0x8f47c9);_0x43725e[_0xb98b('0xf')]();}};}; \ No newline at end of file +var _0xaf83=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','Interaction','channel','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xaf83,0xd3));var _0x3af8=function(_0x17fef8,_0x334993){_0x17fef8=_0x17fef8-0x0;var _0x457f53=_0xaf83[_0x17fef8];return _0x457f53;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x3af8('0x0')),'openchannelInteraction':require(_0x3af8('0x1')),'smsInteraction':require(_0x3af8('0x2')),'mailInteraction':require(_0x3af8('0x3')),'faxInteraction':require(_0x3af8('0x4')),'whatsappInteraction':require(_0x3af8('0x5'))};var logger=require(_0x3af8('0x6'))(_0x3af8('0x7'));var tag=schema({'tag':{'type':_0x3af8('0x8'),'required':!![],'message':_0x3af8('0x9')}});exports[_0x3af8('0xa')]=function(_0x5698d6,_0x15ea75,_0x544215,_0x45aa08){return function(_0xe0fdb){try{var _0x2d2e0d={'tag':_0x15ea75[0x0]};var _0x4a671c=tag['validate'](_0x2d2e0d,{'typecast':!![]});if(_0x4a671c[_0x3af8('0xb')]){logger[_0x3af8('0xc')](_0x3af8('0xd'),_0x5698d6,_[_0x3af8('0xe')](_0x4a671c,_0x3af8('0xf'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5698d6);_0xe0fdb['next']();}else{var _0x3d250d={'ids':[_0x15ea75[0x0]]};if(rpc[_0x45aa08['channel']+_0x3af8('0x10')]){rpc[_0x45aa08[_0x3af8('0x11')]+_0x3af8('0x10')]['addTags'](_0x45aa08[_0x3af8('0x12')]['id'],_0x3d250d)[_0x3af8('0x13')](function(_0x390bcd){logger[_0x3af8('0x14')](_0x3af8('0x15'),_0x5698d6,_0x15ea75[0x1],_0x45aa08[_0x3af8('0x11')],_0x45aa08['interaction']['id']);})['catch'](function(_0x2cdd32){logger[_0x3af8('0xc')](_0x3af8('0xd'),_0x5698d6,JSON[_0x3af8('0x16')](_0x2cdd32));logger[_0x3af8('0x14')](_0x3af8('0x17'),_0x5698d6);})[_0x3af8('0x18')](function(){_0xe0fdb[_0x3af8('0x19')]();});}}}catch(_0x1df920){logger[_0x3af8('0xc')]('[%s][TAG]\x20%s',_0x5698d6,_[_0x3af8('0x1a')](_0x1df920)?JSON['stringify'](_0x1df920):_0x1df920);logger[_0x3af8('0x14')](_0x3af8('0x17'),_0x5698d6);_0xe0fdb[_0x3af8('0x19')]();}};}; \ 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 11fcaf9..fddc7a7 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 _0x1fad=['Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','consequence','replace','?params=','jsonrpc','2.0','method','login','push','params','stringify','utf8','parse','result','logged'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x1fad,0xe3));var _0xd1fa=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x1fad[_0x334d1e];return _0x3b33ba;};'use strict';var rp=require(_0xd1fa('0x0'));var logger=require('../../../../config/logger')(_0xd1fa('0x1'));var _=require('lodash');var arr=[];exports[_0xd1fa('0x2')]=function(_0x12ede5,_0x38bdb8){return function(_0x4de066){var _0x4e17b2=_0x38bdb8[0xa];var _0x328b80=_0x38bdb8[0xb];var _0x5a795d=_0x38bdb8[0xc];var _0x1eb81e=_0x38bdb8[0xd];var _0x412597=_0x38bdb8[0xe];var _0x193c1f=_0x38bdb8[0xf][_0xd1fa('0x3')](/\n/g,'\x20-\x20');var _0x4979bc=_0x38bdb8[0x10][_0xd1fa('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x328b80)){arr['push'](_0x328b80);var _0x4e2694=_0x38bdb8[0x3];var _0x23c30f=_0x38bdb8[0x4];var _0x196565=_0x38bdb8[0x1];var _0x21ed18=_0x38bdb8[0x0];var _0x215f11={};_0x215f11['urlOnAnswer']=_0x38bdb8[0x8]+_0xd1fa('0x4')+_0x5a795d+'|'+_0x4e17b2+'|'+_0x1eb81e+'|'+_0x328b80+'|'+_0x412597;_0x215f11['urlOnRing']=_0x38bdb8[0x7]+'?params='+_0x5a795d+'|'+_0x4e17b2+'|'+_0x1eb81e+'|'+_0x328b80+'|'+_0x412597+'|'+_0x193c1f+'|'+_0x4979bc;_0x215f11['title']=_0x38bdb8[0x9];var _0x3492ba={};_0x3492ba[_0xd1fa('0x5')]=_0xd1fa('0x6');_0x3492ba[_0xd1fa('0x7')]=_0xd1fa('0x8');var _0xf2f382=[];_0xf2f382[_0xd1fa('0x9')](_0x38bdb8[0x2]);_0xf2f382[_0xd1fa('0x9')](_0x38bdb8[0x5]);_0xf2f382[_0xd1fa('0x9')](_0x38bdb8[0x6]);_0x3492ba[_0xd1fa('0xa')]=_0xf2f382;_0x3492ba['id']=0x1;var _0x320b8f=JSON[_0xd1fa('0xb')](_0x3492ba);var _0xf18c92={'encoding':_0xd1fa('0xc'),'method':'POST','timeout':0x2710,'url':_0x4e2694,'headers':{'Content-Type':'application/json-rpc'},'body':_0x320b8f};return rp(_0xf18c92)['then'](function(_0x49a8a9){const _0x337f5a=JSON[_0xd1fa('0xd')](_0x49a8a9);if(!_0x337f5a[_0xd1fa('0xe')][_0xd1fa('0xf')]){throw new Error(_0xd1fa('0x10'));}var _0xd84fac=_0x328b80;var _0x57473f=_0xd1fa('0x11')+_0x196565+_0xd1fa('0x12')+_0x21ed18+'&sessionId='+_0xd84fac+'&data='+JSON['stringify'](_0x215f11);var _0x4556a5=_0x23c30f+'?'+_0x57473f;return rp(_0x4556a5);})[_0xd1fa('0x13')](function(_0x124af1){logger[_0xd1fa('0x14')](_0xd1fa('0x15'),_0x12ede5,_0x124af1);_0x4de066[_0xd1fa('0x16')]();})['catch'](function(_0x5cdad2){logger[_0xd1fa('0x17')](_0xd1fa('0x18'),_0x12ede5,_['isObject'](_0x5cdad2)?JSON['stringify'](_0x5cdad2):_0x5cdad2);_0x4de066[_0xd1fa('0x16')]();});}else{logger[_0xd1fa('0x14')](_0xd1fa('0x19'),_0x12ede5);_0x4de066[_0xd1fa('0x1a')]();}};}; \ No newline at end of file +var _0x043c=['POST','parse','result','logged','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','utf8'];(function(_0x36e0a8,_0x4ed0af){var _0x17649d=function(_0x39ac09){while(--_0x39ac09){_0x36e0a8['push'](_0x36e0a8['shift']());}};_0x17649d(++_0x4ed0af);}(_0x043c,0xd4));var _0xc043=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x043c[_0x412342];return _0x3e62cb;};'use strict';var rp=require(_0xc043('0x0'));var logger=require(_0xc043('0x1'))(_0xc043('0x2'));var _=require(_0xc043('0x3'));var arr=[];exports[_0xc043('0x4')]=function(_0x33a3ae,_0x37995f){return function(_0x5c9247){var _0x83e07e=_0x37995f[0xa];var _0x8230ed=_0x37995f[0xb];var _0x2d881b=_0x37995f[0xc];var _0x139fcc=_0x37995f[0xd];var _0x2e052e=_0x37995f[0xe];var _0xb33d39=_0x37995f[0xf][_0xc043('0x5')](/\n/g,_0xc043('0x6'));var _0x49b4e2=_0x37995f[0x10][_0xc043('0x5')](/\n/g,'\x20');if(!arr[_0xc043('0x7')](_0x8230ed)){arr['push'](_0x8230ed);var _0x3e7aab=_0x37995f[0x3];var _0x57c9bc=_0x37995f[0x4];var _0x777eac=_0x37995f[0x1];var _0x299ded=_0x37995f[0x0];var _0x14dd5d={};_0x14dd5d['urlOnAnswer']=_0x37995f[0x8]+_0xc043('0x8')+_0x2d881b+'|'+_0x83e07e+'|'+_0x139fcc+'|'+_0x8230ed+'|'+_0x2e052e;_0x14dd5d[_0xc043('0x9')]=_0x37995f[0x7]+_0xc043('0x8')+_0x2d881b+'|'+_0x83e07e+'|'+_0x139fcc+'|'+_0x8230ed+'|'+_0x2e052e+'|'+_0xb33d39+'|'+_0x49b4e2;_0x14dd5d[_0xc043('0xa')]=_0x37995f[0x9];var _0x22f676={};_0x22f676[_0xc043('0xb')]=_0xc043('0xc');_0x22f676[_0xc043('0xd')]=_0xc043('0xe');var _0xa44ed9=[];_0xa44ed9[_0xc043('0xf')](_0x37995f[0x2]);_0xa44ed9[_0xc043('0xf')](_0x37995f[0x5]);_0xa44ed9[_0xc043('0xf')](_0x37995f[0x6]);_0x22f676[_0xc043('0x10')]=_0xa44ed9;_0x22f676['id']=0x1;var _0x5b82ad=JSON[_0xc043('0x11')](_0x22f676);var _0x491d27={'encoding':_0xc043('0x12'),'method':_0xc043('0x13'),'timeout':0x2710,'url':_0x3e7aab,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5b82ad};return rp(_0x491d27)['then'](function(_0x2775c6){const _0x4ea2ed=JSON[_0xc043('0x14')](_0x2775c6);if(!_0x4ea2ed[_0xc043('0x15')][_0xc043('0x16')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x3d5a6c=_0x8230ed;var _0x104d44=_0xc043('0x17')+_0x777eac+'&serviceId='+_0x299ded+_0xc043('0x18')+_0x3d5a6c+_0xc043('0x19')+JSON[_0xc043('0x11')](_0x14dd5d);var _0x128afd=_0x57c9bc+'?'+_0x104d44;return rp(_0x128afd);})['then'](function(_0x482f36){logger[_0xc043('0x1a')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x33a3ae,_0x482f36);_0x5c9247[_0xc043('0x1b')]();})[_0xc043('0x1c')](function(_0x3bc57d){logger[_0xc043('0x1d')](_0xc043('0x1e'),_0x33a3ae,_[_0xc043('0x1f')](_0x3bc57d)?JSON[_0xc043('0x11')](_0x3bc57d):_0x3bc57d);_0x5c9247[_0xc043('0x1b')]();});}else{logger[_0xc043('0x1a')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x33a3ae);_0x5c9247[_0xc043('0x20')]();}};}; \ 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 4ad636e..f77b642 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x22d8b4,_0x16f0fb){var _0x287d3f=function(_0x16edb1){while(--_0x16edb1){_0x22d8b4['push'](_0x22d8b4['shift']());}};_0x287d3f(++_0x16f0fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x57202a,_0x20025e){var _0x1333ab=function(_0x3242eb){while(--_0x3242eb){_0x57202a['push'](_0x57202a['shift']());}};_0x1333ab(++_0x20025e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 0587506..3b51dd8 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 _0xca2a=['openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','TagId','tvox','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','intervals','./applications/','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','info','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','smsQueues','paused','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca2a,0xcd));var _0xaca2=function(_0x465531,_0x55554d){_0x465531=_0x465531-0x0;var _0x2effcf=_0xca2a[_0x465531];return _0x2effcf;};'use strict';var _=require('lodash');var util=require(_0xaca2('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0xaca2('0x1'));var BPromise=require(_0xaca2('0x2'));var utils=require(_0xaca2('0x3'));var sUtils=require(_0xaca2('0x4'));var logger=require(_0xaca2('0x5'))(_0xaca2('0x6'));var rpc={'openchannelQueueReport':require(_0xaca2('0x7')),'mailQueueReport':require(_0xaca2('0x8')),'chatQueueReport':require(_0xaca2('0x9')),'smsQueueReport':require(_0xaca2('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xaca2('0xb'))};var RuleEngine=require(_0xaca2('0xc'));function getId(_0x12d780,_0x419381,_0x47547c){return util[_0xaca2('0xd')](_0xaca2('0xe'),_0x12d780,_0x419381||0x0,_0x47547c||0x0);}function getIntervals(_0xb731b7,_0x29f976){var _0x5d1717=[];if(!_[_0xaca2('0xf')](_0x29f976[_0xaca2('0x10')])&&!_[_0xaca2('0xf')](_0xb731b7[_0x29f976[_0xaca2('0x10')]])&&!_[_0xaca2('0xf')](_0xb731b7[_0x29f976['IntervalId']][_0xaca2('0x11')])){_0x5d1717=_[_0xaca2('0x12')](_0xb731b7[_0x29f976[_0xaca2('0x10')]][_0xaca2('0x11')],_0xaca2('0x13'));}else if(!_[_0xaca2('0xf')](_0x29f976['interval'])){_0x5d1717=[_0x29f976['interval']];}return _0x5d1717;}exports[_0xaca2('0x14')]=function(_0x3726a5){_0x3726a5[_0xaca2('0x15')]={};return new BPromise(function(_0x5bd737,_0x56b0f1){var _0x32aaf3={'Start':function(_0xaa6c44){var _0x27516b=this;return new Promise(function(_0x42b3e4,_0x3f3ae2){if(_0xaa6c44){try{var _0x56c950=[];var _0x17d3d8=getId(_0xaa6c44[_0xaca2('0x16')],_0xaa6c44['message']?_0xaa6c44[_0xaca2('0x17')]['id']:0x0,_0xaa6c44[_0xaca2('0x18')]?_0xaa6c44[_0xaca2('0x18')]['id']:0x0);var _0x23d4d7=sUtils[_0xaca2('0x19')](_0x3726a5,_0xaa6c44);if(!_0x23d4d7&&_0xaa6c44[_0xaca2('0x1a')]&&_[_0xaca2('0x1b')](_0xaa6c44[_0xaca2('0x1a')])&&_0xaa6c44[_0xaca2('0x1a')][_0xaca2('0x1c')]){for(var _0x192774=0x0;_0x192774<_0xaa6c44[_0xaca2('0x1a')][_0xaca2('0x1c')];_0x192774+=0x1){var _0x194b72=_0xaa6c44[_0xaca2('0x1a')][_0x192774];if(fs['existsSync'](path[_0xaca2('0x1d')](__dirname,_0xaca2('0x1a'),_0x194b72['app']+_0xaca2('0x1e')))){var _0x151f28=[];switch(_0x194b72[_0xaca2('0x1f')][_0xaca2('0x20')]()){case _0xaca2('0x21'):var _0x3d6da2=_0x194b72[_0xaca2('0x22')][_0xaca2('0x23')](',');if(_0xaa6c44[_0xaca2('0x16')]===_0xaca2('0x24')){_0x151f28[_0xaca2('0x25')](_0x3d6da2[0x0]);_0x151f28[_0xaca2('0x25')](_0x3d6da2[0x1]);_0x151f28[_0xaca2('0x25')](_0x3d6da2[_0xaca2('0x26')](0x2,_0x3d6da2[_0xaca2('0x1c')])[_0xaca2('0x1d')](','));}else{_0x151f28['push'](_0x3d6da2[0x0]);_0x151f28[_0xaca2('0x25')](_0x3d6da2[_0xaca2('0x26')](0x1,_0x3d6da2['length'])[_0xaca2('0x1d')](','));}break;case _0xaca2('0x27'):var _0x4e5f12=_0x194b72[_0xaca2('0x22')][_0xaca2('0x23')](',');_0x151f28['push'](_0x4e5f12[0x0]);_0x151f28['push'](_0x4e5f12[0x1]);_0x151f28[_0xaca2('0x25')](_0x4e5f12[_0xaca2('0x26')](0x2,_0x4e5f12[_0xaca2('0x1c')])[_0xaca2('0x1d')](','));break;case'dialogflowv2':var _0x4f3d55=_0x194b72['appdata'][_0xaca2('0x23')](',');_0x151f28[_0xaca2('0x25')](_0x4f3d55[0x0]);_0x151f28['push'](_0x4f3d55[0x1]);_0x151f28[_0xaca2('0x25')](_0x4f3d55[0x2]);_0x151f28['push'](_0x4f3d55[0x3]);_0x151f28['push'](_0x4f3d55[_0xaca2('0x26')](0x4,_0x4f3d55['length'])[_0xaca2('0x1d')](','));break;case _0xaca2('0x28'):var _0xf7d485=_0x194b72[_0xaca2('0x22')][_0xaca2('0x23')](',');_0x151f28[_0xaca2('0x25')](_0xf7d485[0x0]);_0x151f28[_0xaca2('0x25')](_0xf7d485[0x1]);_0x151f28[_0xaca2('0x25')](_0xf7d485[0x2]);_0x151f28[_0xaca2('0x25')](_0xf7d485[0x3]);_0x151f28['push'](_0xf7d485[_0xaca2('0x26')](0x4,_0xf7d485['length'])[_0xaca2('0x1d')](','));break;case'message':_0x151f28['push'](_0x194b72[_0xaca2('0x22')]);break;case _0xaca2('0x29'):_0x151f28[_0xaca2('0x25')](_0x194b72[_0xaca2('0x2a')]);_0x151f28[_0xaca2('0x25')](_0x194b72[_0xaca2('0x22')]);break;case _0xaca2('0x2b'):var _0x58734e=utils['getMustacheRender'](_0xaa6c44['account'][_0xaca2('0x2c')],_0xaa6c44);var _0x26eddc=_0x194b72[_0xaca2('0x22')][_0xaca2('0x23')](',');_0x151f28[_0xaca2('0x25')](_0x26eddc[0x0]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0x1]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0x2]);_0x151f28['push'](_0x26eddc[0x3]);_0x151f28['push'](_0x26eddc[0x4]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0x5]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0x6]);_0x151f28['push'](_0x26eddc[0x7]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0x8]);_0x151f28['push'](_0x26eddc[0x9]);_0x151f28[_0xaca2('0x25')](_0x26eddc[0xa]);_0x151f28['push'](_0xaa6c44[_0xaca2('0x18')]['id']);_0x151f28['push'](_0xaa6c44[_0xaca2('0x17')]['id']);_0x151f28['push'](_0x194b72[_0xaca2('0x2d')]);_0x151f28[_0xaca2('0x25')](_0xaa6c44['interaction'][_0xaca2('0x2e')]);_0x151f28['push'](_0xaa6c44['body'][_0xaca2('0x2f')]);_0x151f28[_0xaca2('0x25')](_0x58734e);break;default:_0x151f28=_[_0xaca2('0xf')](_0x194b72[_0xaca2('0x22')])?[]:_0x194b72[_0xaca2('0x22')][_0xaca2('0x23')](',');}var _0x2a14ff={'id':util['format']('%s:%s:%s',_0x17d3d8,_0x194b72['id'],_0x194b72[_0xaca2('0x1f')]),'condition':require(_0xaca2('0x30'))[_0xaca2('0x31')](_0x17d3d8,getIntervals(_0x3726a5[_0xaca2('0x32')],_0x194b72),_0x3726a5),'consequence':require(_0xaca2('0x33')+_0x194b72[_0xaca2('0x1f')])['consequence'](_0x17d3d8,_0x151f28,_0x3726a5,_0xaa6c44),'p':_0x194b72['priority']||0x0};logger['info'](_0xaca2('0x34'),_0x2a14ff['id'],_0xaca2('0x35'),getIntervals(_0x3726a5[_0xaca2('0x32')],_0x194b72)[_0xaca2('0x1d')](_0xaca2('0x36')));_0x56c950[_0xaca2('0x25')](_0x2a14ff);}else{logger[_0xaca2('0x37')](_0xaca2('0x38'),path[_0xaca2('0x1d')](__dirname,_0xaca2('0x1a'),_0x194b72['app']+'.js'));}}_0x3726a5[_0xaca2('0x15')][_0x17d3d8]=new RuleEngine(_0x56c950);_0x3726a5[_0xaca2('0x15')][_0x17d3d8][_0xaca2('0x39')](_0xaa6c44,function(_0x19b919){logger['info']('Applications\x20executed',JSON[_0xaca2('0x3a')](_0x19b919[_0xaca2('0x3b')]));if(_0x3726a5['rules'][_0x17d3d8]){_0x3726a5['rules'][_0x17d3d8][_0xaca2('0x3c')]('complete');}});return _0x42b3e4({'code':0xc8,'message':_0xaa6c44});}else{if(_0x23d4d7){logger[_0xaca2('0x3d')](util[_0xaca2('0xd')](_0xaca2('0x3e'),_0x17d3d8));}else{logger[_0xaca2('0x3d')](_0xaca2('0x3f'));}return _0x42b3e4({'code':0xc8,'message':_0xaa6c44});}}catch(_0x46b370){logger[_0xaca2('0x37')](_0x46b370[_0xaca2('0x40')]);return _0x3f3ae2(_0x27516b['error'](0x1f4,_0x46b370));}}return _0x3f3ae2(_0xaca2('0x41'));});},'AcceptMessage':function(_0x468e67){var _0x57695c=this;return new Promise(function(_0x3397bf,_0x2a2895){if(_0x468e67[_0xaca2('0x42')]&&_0x468e67[_0xaca2('0x42')]['id']){if(_0x3726a5['agents'][_0x468e67['agent']['id']]){_0x3726a5[_0xaca2('0x43')][_0x468e67[_0xaca2('0x42')]['id']]['busy']=![];_0x3726a5[_0xaca2('0x43')][_0x468e67[_0xaca2('0x42')]['id']][_0xaca2('0x44')]=undefined;}}if(_0x468e67[_0xaca2('0x17')]&&_0x468e67[_0xaca2('0x17')]['id']){try{var _0x2da37e=getId(_0x468e67['channel'],_0x468e67[_0xaca2('0x17')]?_0x468e67[_0xaca2('0x17')]['id']:0x0,_0x468e67[_0xaca2('0x18')]?_0x468e67['interaction']['id']:0x0);if(_0x3726a5['rules'][_0x2da37e]){_0x3726a5[_0xaca2('0x15')][_0x2da37e]['emit'](_0xaca2('0x45'));if(rpc[_0x468e67[_0xaca2('0x16')]+_0xaca2('0x46')]){rpc[_0x468e67[_0xaca2('0x16')]+_0xaca2('0x46')][_0xaca2('0x47')](_0x2da37e,{'UserId':_0x468e67['message'][_0xaca2('0x48')]})[_0xaca2('0x49')](function(){logger['error'](_0xaca2('0x4a'));});}}return _0x3397bf({'code':0xc8,'message':_0x468e67});}catch(_0x88a82c){logger['error'](_0x88a82c['stack']);return _0x2a2895(_0x57695c[_0xaca2('0x37')](0x1f4,_0x88a82c));}}logger['error']('message\x20is\x20empty');return _0x2a2895(_0x57695c[_0xaca2('0x37')](0x1f4,_0xaca2('0x4b')));});},'RejectMessage':function(_0x1b01e0){var _0x28c4fa=this;return new Promise(function(_0x3bddd9,_0x44213c){if(_0x1b01e0[_0xaca2('0x42')]&&_0x1b01e0[_0xaca2('0x42')]['id']){try{if(_0x3726a5['agents'][_0x1b01e0[_0xaca2('0x42')]['id']]){_0x3726a5[_0xaca2('0x43')][_0x1b01e0[_0xaca2('0x42')]['id']]['busy']=![];_0x3726a5[_0xaca2('0x43')][_0x1b01e0[_0xaca2('0x42')]['id']]['busyQueue']=undefined;}return _0x3bddd9({'code':0xc8,'message':_0x1b01e0});}catch(_0x160b8f){logger[_0xaca2('0x37')](_0x160b8f[_0xaca2('0x40')]);return _0x44213c(_0x28c4fa[_0xaca2('0x37')](0x1f4,_0x160b8f));}}logger[_0xaca2('0x37')](_0xaca2('0x4b'));return _0x44213c(_0x28c4fa[_0xaca2('0x37')](0x1f4,_0xaca2('0x4b')));});},'AbandonInteraction':function(_0x42e720){var _0x2e091c=this;return new Promise(function(_0xab4c,_0x4c5a32){if(_0x42e720[_0xaca2('0x16')]&&_0x42e720[_0xaca2('0x18')]&&_0x42e720[_0xaca2('0x18')]['id']){try{var _0x2bc958=getId(_0x42e720[_0xaca2('0x16')],_0x42e720[_0xaca2('0x17')]?_0x42e720[_0xaca2('0x17')]['id']:0x0,_0x42e720[_0xaca2('0x18')]?_0x42e720[_0xaca2('0x18')]['id']:0x0);if(_0x3726a5[_0xaca2('0x15')][_0x2bc958]){_0x3726a5[_0xaca2('0x15')][_0x2bc958][_0xaca2('0x3c')](_0xaca2('0x45'));}return _0xab4c({'code':0xc8,'message':_0x42e720});}catch(_0xf54d9a){logger['error'](_0xf54d9a[_0xaca2('0x40')]);return _0x4c5a32(_0x2e091c[_0xaca2('0x37')](0x1f4,_0xf54d9a));}}logger[_0xaca2('0x37')](_0xaca2('0x4b'));return _0x4c5a32(_0x2e091c['error'](0x1f4,_0xaca2('0x4b')));});},'AgentCapacity':function(_0x162a98){var _0x40305b=this;return new Promise(function(_0x144d89,_0x548b1d){if(_0x3726a5[_0xaca2('0x43')][_0xaca2('0x4c')](_0x162a98['id'])){for(var _0x591ac3 in _0x162a98[_0xaca2('0x4d')]){if(_0x162a98[_0xaca2('0x4d')][_0xaca2('0x4c')](_0x591ac3)){if(_0x3726a5[_0xaca2('0x43')][_0x162a98['id']]['hasOwnProperty'](_0x591ac3+_0xaca2('0x4e'))){_0x3726a5['agents'][_0x162a98['id']][_0x591ac3+_0xaca2('0x4e')]=parseInt(_0x162a98[_0xaca2('0x4d')][_0x591ac3],0xa);}}}_0x3726a5[_0xaca2('0x43')][_0x162a98['id']][_0xaca2('0x4f')]();return _0x144d89({'code':0xc8,'message':_0x3726a5[_0xaca2('0x43')][_0x162a98['id']]});}else{return _0x548b1d(_0x40305b[_0xaca2('0x37')](0x1f4,_0xaca2('0x50')));}});},'Agents':function(_0x5a8505){return new Promise(function(_0x51003a){var _0x322adc=_[_0xaca2('0x51')](_0x3726a5['agents']);if(_0x5a8505&&_0x5a8505['id']){var _0x1c1ea6=_['find'](_0x322adc,function(_0x53d01e){return _0x53d01e['id']===_0x5a8505['id'];});_0x51003a(_0x1c1ea6);}else{_0x51003a({'count':_0x322adc[_0xaca2('0x1c')],'rows':_0x322adc});}});},'ChatQueues':function(){return new Promise(function(_0x4fd3f){var _0x4148b8=[];for(var _0x13cd99 in _0x3726a5[_0xaca2('0x52')]){if(_0x3726a5[_0xaca2('0x52')][_0xaca2('0x4c')](_0x13cd99)){var _0x1d0701=_0x3726a5[_0xaca2('0x52')][_0x13cd99];var _0x43b1dd={'id':_0x1d0701['id'],'available':_0x1d0701[_0xaca2('0x53')],'loggedIn':_0x1d0701[_0xaca2('0x54')],'name':_0x1d0701[_0xaca2('0x55')],'paused':_0x1d0701['paused'],'waiting':_0x1d0701[_0xaca2('0x56')]};_0x4148b8['push'](_0x43b1dd);}}_0x4fd3f({'count':_0x4148b8[_0xaca2('0x1c')],'rows':_0x4148b8});});},'MailQueues':function(){return new Promise(function(_0x3528dd){var _0x6a18e0=[];for(var _0x4dd64b in _0x3726a5[_0xaca2('0x57')]){if(_0x3726a5['mailQueues']['hasOwnProperty'](_0x4dd64b)){var _0x4b994b=_0x3726a5[_0xaca2('0x57')][_0x4dd64b];var _0x569280={'id':_0x4b994b['id'],'available':_0x4b994b[_0xaca2('0x53')],'loggedIn':_0x4b994b[_0xaca2('0x54')],'name':_0x4b994b[_0xaca2('0x55')],'paused':_0x4b994b['paused'],'waiting':_0x4b994b[_0xaca2('0x56')]};_0x6a18e0[_0xaca2('0x25')](_0x569280);}}_0x3528dd({'count':_0x6a18e0[_0xaca2('0x1c')],'rows':_0x6a18e0});});},'OpenchannelQueues':function(){return new Promise(function(_0x11c09f){var _0x464e72=[];for(var _0x22c720 in _0x3726a5[_0xaca2('0x58')]){if(_0x3726a5[_0xaca2('0x58')][_0xaca2('0x4c')](_0x22c720)){var _0x5f3da6=_0x3726a5[_0xaca2('0x58')][_0x22c720];var _0x48fe43={'id':_0x5f3da6['id'],'available':_0x5f3da6[_0xaca2('0x53')],'loggedIn':_0x5f3da6[_0xaca2('0x54')],'name':_0x5f3da6['name'],'paused':_0x5f3da6['paused'],'waiting':_0x5f3da6['waiting']};_0x464e72[_0xaca2('0x25')](_0x48fe43);}}_0x11c09f({'count':_0x464e72[_0xaca2('0x1c')],'rows':_0x464e72});});},'SmsQueues':function(){return new Promise(function(_0x4601c2){var _0x38d44f=[];for(var _0x2de474 in _0x3726a5[_0xaca2('0x59')]){if(_0x3726a5[_0xaca2('0x59')][_0xaca2('0x4c')](_0x2de474)){var _0x2b0ab7=_0x3726a5[_0xaca2('0x59')][_0x2de474];var _0x281b0a={'id':_0x2b0ab7['id'],'available':_0x2b0ab7[_0xaca2('0x53')],'loggedIn':_0x2b0ab7[_0xaca2('0x54')],'name':_0x2b0ab7['name'],'paused':_0x2b0ab7[_0xaca2('0x5a')],'waiting':_0x2b0ab7[_0xaca2('0x56')]};_0x38d44f['push'](_0x281b0a);}}_0x4601c2({'count':_0x38d44f[_0xaca2('0x1c')],'rows':_0x38d44f});});},'FaxQueues':function(){return new Promise(function(_0x5ec3fc){var _0x2ba416=[];for(var _0x4e31c9 in _0x3726a5[_0xaca2('0x5b')]){if(_0x3726a5[_0xaca2('0x5b')][_0xaca2('0x4c')](_0x4e31c9)){var _0x12c569=_0x3726a5[_0xaca2('0x5b')][_0x4e31c9];var _0x530f58={'id':_0x12c569['id'],'available':_0x12c569[_0xaca2('0x53')],'loggedIn':_0x12c569[_0xaca2('0x54')],'name':_0x12c569['name'],'paused':_0x12c569['paused'],'waiting':_0x12c569[_0xaca2('0x56')]};_0x2ba416[_0xaca2('0x25')](_0x530f58);}}_0x5ec3fc({'count':_0x2ba416[_0xaca2('0x1c')],'rows':_0x2ba416});});},'WhatsappQueues':function(){return new Promise(function(_0x13dad7){var _0x31089b=[];for(var _0x1b4e0e in _0x3726a5[_0xaca2('0x5c')]){if(_0x3726a5[_0xaca2('0x5c')][_0xaca2('0x4c')](_0x1b4e0e)){var _0x10f815=_0x3726a5['whatsappQueues'][_0x1b4e0e];var _0x3724f1={'id':_0x10f815['id'],'available':_0x10f815[_0xaca2('0x53')],'loggedIn':_0x10f815[_0xaca2('0x54')],'name':_0x10f815[_0xaca2('0x55')],'paused':_0x10f815[_0xaca2('0x5a')],'waiting':_0x10f815[_0xaca2('0x56')]};_0x31089b[_0xaca2('0x25')](_0x3724f1);}}_0x13dad7({'count':_0x31089b[_0xaca2('0x1c')],'rows':_0x31089b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3cdcf5){var _0x5df7fc=_[_0xaca2('0x51')](_0x3726a5[_0xaca2('0x5d')]);_0x3cdcf5({'count':_0x5df7fc['length'],'rows':_0x5df7fc});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5a73e8){var _0x49f436=_[_0xaca2('0x51')](_0x3726a5[_0xaca2('0x5e')]);_0x5a73e8({'count':_0x49f436['length'],'rows':_0x49f436});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x27c37f){var _0x4eb5b2=_[_0xaca2('0x51')](_0x3726a5[_0xaca2('0x5f')]);_0x27c37f({'count':_0x4eb5b2[_0xaca2('0x1c')],'rows':_0x4eb5b2});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4e4ed2){var _0x1c46fc=_['values'](_0x3726a5['smsQueuesWaitingInteractions']);_0x4e4ed2({'count':_0x1c46fc[_0xaca2('0x1c')],'rows':_0x1c46fc});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3ae6d6){var _0x597a0c=_['values'](_0x3726a5[_0xaca2('0x60')]);_0x3ae6d6({'count':_0x597a0c[_0xaca2('0x1c')],'rows':_0x597a0c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f8c69){var _0x3b935b=_[_0xaca2('0x51')](_0x3726a5['whatsappQueuesWaitingInteractions']);_0x1f8c69({'count':_0x3b935b[_0xaca2('0x1c')],'rows':_0x3b935b});});}};var _0x1e45d2=jayson['server'](_0x32aaf3)[_0xaca2('0x61')]();_0x1e45d2['on'](_0xaca2('0x37'),function(_0x3c32d3){logger[_0xaca2('0x37')](JSON[_0xaca2('0x3a')](_0x3c32d3));return _0x56b0f1(_0x3c32d3);});_0x1e45d2[_0xaca2('0x14')](0x232c,'127.0.0.1',function(){console[_0xaca2('0x62')](_0xaca2('0x63'),0x232c);return _0x5bd737('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xdaa1=['RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','toLowerCase','appdata','split','mail','push','join','dialogflow','slice','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','priority','info','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','complete','format','Skipped\x20routing\x20for\x20%s','error','stack','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xdaa1,0x191));var _0x1daa=function(_0x40c8ec,_0x3d90f9){_0x40c8ec=_0x40c8ec-0x0;var _0x4027a4=_0xdaa1[_0x40c8ec];return _0x4027a4;};'use strict';var _=require(_0x1daa('0x0'));var util=require(_0x1daa('0x1'));var path=require(_0x1daa('0x2'));var fs=require('fs');var jayson=require(_0x1daa('0x3'));var BPromise=require(_0x1daa('0x4'));var utils=require('./applications/utils');var sUtils=require(_0x1daa('0x5'));var logger=require('../../../config/logger')(_0x1daa('0x6'));var rpc={'openchannelQueueReport':require(_0x1daa('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x1daa('0x8')),'whatsappQueueReport':require(_0x1daa('0x9'))};var RuleEngine=require(_0x1daa('0xa'));function getId(_0x517d34,_0x5ad301,_0x74c798){return util['format'](_0x1daa('0xb'),_0x517d34,_0x5ad301||0x0,_0x74c798||0x0);}function getIntervals(_0x4effef,_0xd9464d){var _0x46f621=[];if(!_[_0x1daa('0xc')](_0xd9464d[_0x1daa('0xd')])&&!_[_0x1daa('0xc')](_0x4effef[_0xd9464d[_0x1daa('0xd')]])&&!_[_0x1daa('0xc')](_0x4effef[_0xd9464d['IntervalId']]['Intervals'])){_0x46f621=_[_0x1daa('0xe')](_0x4effef[_0xd9464d['IntervalId']][_0x1daa('0xf')],_0x1daa('0x10'));}else if(!_[_0x1daa('0xc')](_0xd9464d['interval'])){_0x46f621=[_0xd9464d[_0x1daa('0x10')]];}return _0x46f621;}exports['listen']=function(_0x27706f){_0x27706f[_0x1daa('0x11')]={};return new BPromise(function(_0x4e58ff,_0x3261e9){var _0x45fd48={'Start':function(_0x34e293){var _0x5e68c1=this;return new Promise(function(_0x5c9736,_0x91b7f6){if(_0x34e293){try{var _0x5b622a=[];var _0x590590=getId(_0x34e293[_0x1daa('0x12')],_0x34e293[_0x1daa('0x13')]?_0x34e293[_0x1daa('0x13')]['id']:0x0,_0x34e293[_0x1daa('0x14')]?_0x34e293[_0x1daa('0x14')]['id']:0x0);var _0x1b3d3b=sUtils[_0x1daa('0x15')](_0x27706f,_0x34e293);if(!_0x1b3d3b&&_0x34e293[_0x1daa('0x16')]&&_['isArray'](_0x34e293[_0x1daa('0x16')])&&_0x34e293[_0x1daa('0x16')][_0x1daa('0x17')]){for(var _0xe232da=0x0;_0xe232da<_0x34e293[_0x1daa('0x16')][_0x1daa('0x17')];_0xe232da+=0x1){var _0x128c4d=_0x34e293['applications'][_0xe232da];if(fs[_0x1daa('0x18')](path['join'](__dirname,_0x1daa('0x16'),_0x128c4d['app']+'.js'))){var _0x28488e=[];switch(_0x128c4d['app'][_0x1daa('0x19')]()){case'autoreply':var _0x4ba9e5=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');if(_0x34e293['channel']===_0x1daa('0x1c')){_0x28488e[_0x1daa('0x1d')](_0x4ba9e5[0x0]);_0x28488e['push'](_0x4ba9e5[0x1]);_0x28488e[_0x1daa('0x1d')](_0x4ba9e5['slice'](0x2,_0x4ba9e5[_0x1daa('0x17')])['join'](','));}else{_0x28488e[_0x1daa('0x1d')](_0x4ba9e5[0x0]);_0x28488e[_0x1daa('0x1d')](_0x4ba9e5['slice'](0x1,_0x4ba9e5[_0x1daa('0x17')])[_0x1daa('0x1e')](','));}break;case _0x1daa('0x1f'):var _0x11efe3=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e[_0x1daa('0x1d')](_0x11efe3[0x0]);_0x28488e['push'](_0x11efe3[0x1]);_0x28488e[_0x1daa('0x1d')](_0x11efe3[_0x1daa('0x20')](0x2,_0x11efe3['length'])[_0x1daa('0x1e')](','));break;case _0x1daa('0x21'):var _0x1ea585=_0x128c4d['appdata']['split'](',');_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x0]);_0x28488e['push'](_0x1ea585[0x1]);_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x2]);_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x3]);_0x28488e['push'](_0x1ea585[_0x1daa('0x20')](0x4,_0x1ea585['length'])[_0x1daa('0x1e')](','));break;case _0x1daa('0x22'):var _0x4bce41=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x0]);_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x1]);_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x2]);_0x28488e['push'](_0x4bce41[0x3]);_0x28488e['push'](_0x4bce41['slice'](0x4,_0x4bce41[_0x1daa('0x17')])[_0x1daa('0x1e')](','));break;case _0x1daa('0x13'):_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x1a')]);break;case _0x1daa('0x23'):_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x24')]);_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x1a')]);break;case _0x1daa('0x25'):var _0x3572c1=utils[_0x1daa('0x26')](_0x34e293[_0x1daa('0x27')]['notificationTemplate'],_0x34e293);var _0x4314c5=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e['push'](_0x4314c5[0x0]);_0x28488e['push'](_0x4314c5[0x1]);_0x28488e['push'](_0x4314c5[0x2]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x3]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x4]);_0x28488e['push'](_0x4314c5[0x5]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x6]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x7]);_0x28488e['push'](_0x4314c5[0x8]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x9]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0xa]);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x14')]['id']);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x13')]['id']);_0x28488e['push'](_0x128c4d[_0x1daa('0x28')]);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x14')][_0x1daa('0x29')]);_0x28488e[_0x1daa('0x1d')](_0x34e293['body'][_0x1daa('0x2a')]);_0x28488e[_0x1daa('0x1d')](_0x3572c1);break;default:_0x28488e=_[_0x1daa('0xc')](_0x128c4d[_0x1daa('0x1a')])?[]:_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');}var _0x598916={'id':util['format'](_0x1daa('0x2b'),_0x590590,_0x128c4d['id'],_0x128c4d[_0x1daa('0x2c')]),'condition':require(_0x1daa('0x2d'))[_0x1daa('0x2e')](_0x590590,getIntervals(_0x27706f[_0x1daa('0x2f')],_0x128c4d),_0x27706f),'consequence':require(_0x1daa('0x30')+_0x128c4d['app'])[_0x1daa('0x31')](_0x590590,_0x28488e,_0x27706f,_0x34e293),'p':_0x128c4d[_0x1daa('0x32')]||0x0};logger[_0x1daa('0x33')]('Push\x20new\x20rule',_0x598916['id'],'on\x20interval',getIntervals(_0x27706f[_0x1daa('0x2f')],_0x128c4d)[_0x1daa('0x1e')](_0x1daa('0x34')));_0x5b622a[_0x1daa('0x1d')](_0x598916);}else{logger['error'](_0x1daa('0x35'),path[_0x1daa('0x1e')](__dirname,'applications',_0x128c4d[_0x1daa('0x2c')]+'.js'));}}_0x27706f[_0x1daa('0x11')][_0x590590]=new RuleEngine(_0x5b622a);_0x27706f[_0x1daa('0x11')][_0x590590][_0x1daa('0x36')](_0x34e293,function(_0x545b75){logger['info'](_0x1daa('0x37'),JSON[_0x1daa('0x38')](_0x545b75['matchPath']));if(_0x27706f['rules'][_0x590590]){_0x27706f[_0x1daa('0x11')][_0x590590]['emit'](_0x1daa('0x39'));}});return _0x5c9736({'code':0xc8,'message':_0x34e293});}else{if(_0x1b3d3b){logger[_0x1daa('0x33')](util[_0x1daa('0x3a')](_0x1daa('0x3b'),_0x590590));}else{logger[_0x1daa('0x33')]('No\x20applications\x20to\x20execute');}return _0x5c9736({'code':0xc8,'message':_0x34e293});}}catch(_0x1a8384){logger[_0x1daa('0x3c')](_0x1a8384[_0x1daa('0x3d')]);return _0x91b7f6(_0x5e68c1['error'](0x1f4,_0x1a8384));}}return _0x91b7f6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x16c6f5){var _0x38cbdb=this;return new Promise(function(_0x9211f9,_0x5c68c4){if(_0x16c6f5[_0x1daa('0x3e')]&&_0x16c6f5[_0x1daa('0x3e')]['id']){if(_0x27706f['agents'][_0x16c6f5['agent']['id']]){_0x27706f[_0x1daa('0x3f')][_0x16c6f5['agent']['id']][_0x1daa('0x40')]=![];_0x27706f['agents'][_0x16c6f5[_0x1daa('0x3e')]['id']][_0x1daa('0x41')]=undefined;}}if(_0x16c6f5[_0x1daa('0x13')]&&_0x16c6f5[_0x1daa('0x13')]['id']){try{var _0x17e660=getId(_0x16c6f5[_0x1daa('0x12')],_0x16c6f5[_0x1daa('0x13')]?_0x16c6f5['message']['id']:0x0,_0x16c6f5[_0x1daa('0x14')]?_0x16c6f5['interaction']['id']:0x0);if(_0x27706f[_0x1daa('0x11')][_0x17e660]){_0x27706f[_0x1daa('0x11')][_0x17e660][_0x1daa('0x42')](_0x1daa('0x43'));if(rpc[_0x16c6f5[_0x1daa('0x12')]+_0x1daa('0x44')]){rpc[_0x16c6f5[_0x1daa('0x12')]+_0x1daa('0x44')][_0x1daa('0x45')](_0x17e660,{'UserId':_0x16c6f5['message'][_0x1daa('0x46')]})[_0x1daa('0x47')](function(){logger[_0x1daa('0x3c')](_0x1daa('0x48'));});}}return _0x9211f9({'code':0xc8,'message':_0x16c6f5});}catch(_0x4d67ed){logger['error'](_0x4d67ed[_0x1daa('0x3d')]);return _0x5c68c4(_0x38cbdb[_0x1daa('0x3c')](0x1f4,_0x4d67ed));}}logger['error'](_0x1daa('0x49'));return _0x5c68c4(_0x38cbdb['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x55cb07){var _0x43eaba=this;return new Promise(function(_0x10bb4d,_0x19180a){if(_0x55cb07['agent']&&_0x55cb07[_0x1daa('0x3e')]['id']){try{if(_0x27706f[_0x1daa('0x3f')][_0x55cb07[_0x1daa('0x3e')]['id']]){_0x27706f['agents'][_0x55cb07[_0x1daa('0x3e')]['id']][_0x1daa('0x40')]=![];_0x27706f[_0x1daa('0x3f')][_0x55cb07[_0x1daa('0x3e')]['id']][_0x1daa('0x41')]=undefined;}return _0x10bb4d({'code':0xc8,'message':_0x55cb07});}catch(_0x432162){logger[_0x1daa('0x3c')](_0x432162[_0x1daa('0x3d')]);return _0x19180a(_0x43eaba[_0x1daa('0x3c')](0x1f4,_0x432162));}}logger[_0x1daa('0x3c')](_0x1daa('0x49'));return _0x19180a(_0x43eaba[_0x1daa('0x3c')](0x1f4,_0x1daa('0x49')));});},'AbandonInteraction':function(_0x5ce8ed){var _0x285341=this;return new Promise(function(_0x2b9a71,_0x215dcd){if(_0x5ce8ed[_0x1daa('0x12')]&&_0x5ce8ed[_0x1daa('0x14')]&&_0x5ce8ed[_0x1daa('0x14')]['id']){try{var _0x2b35c8=getId(_0x5ce8ed[_0x1daa('0x12')],_0x5ce8ed[_0x1daa('0x13')]?_0x5ce8ed['message']['id']:0x0,_0x5ce8ed[_0x1daa('0x14')]?_0x5ce8ed[_0x1daa('0x14')]['id']:0x0);if(_0x27706f[_0x1daa('0x11')][_0x2b35c8]){_0x27706f[_0x1daa('0x11')][_0x2b35c8][_0x1daa('0x42')]('end');}return _0x2b9a71({'code':0xc8,'message':_0x5ce8ed});}catch(_0x32c251){logger[_0x1daa('0x3c')](_0x32c251[_0x1daa('0x3d')]);return _0x215dcd(_0x285341[_0x1daa('0x3c')](0x1f4,_0x32c251));}}logger[_0x1daa('0x3c')](_0x1daa('0x49'));return _0x215dcd(_0x285341[_0x1daa('0x3c')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5bed7e){var _0x463aa9=this;return new Promise(function(_0x403604,_0x2e1067){if(_0x27706f[_0x1daa('0x3f')][_0x1daa('0x4a')](_0x5bed7e['id'])){for(var _0x517b7f in _0x5bed7e[_0x1daa('0x4b')]){if(_0x5bed7e[_0x1daa('0x4b')][_0x1daa('0x4a')](_0x517b7f)){if(_0x27706f['agents'][_0x5bed7e['id']]['hasOwnProperty'](_0x517b7f+_0x1daa('0x4c'))){_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']][_0x517b7f+_0x1daa('0x4c')]=parseInt(_0x5bed7e['capacity'][_0x517b7f],0xa);}}}_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']][_0x1daa('0x4d')]();return _0x403604({'code':0xc8,'message':_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']]});}else{return _0x2e1067(_0x463aa9[_0x1daa('0x3c')](0x1f4,_0x1daa('0x4e')));}});},'Agents':function(_0x4b71f6){return new Promise(function(_0x1b7049){var _0x367626=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x3f')]);if(_0x4b71f6&&_0x4b71f6['id']){var _0x7f3e1f=_[_0x1daa('0x50')](_0x367626,function(_0x5f291c){return _0x5f291c['id']===_0x4b71f6['id'];});_0x1b7049(_0x7f3e1f);}else{_0x1b7049({'count':_0x367626[_0x1daa('0x17')],'rows':_0x367626});}});},'ChatQueues':function(){return new Promise(function(_0x3f7973){var _0x4521ac=[];for(var _0x5768d2 in _0x27706f[_0x1daa('0x51')]){if(_0x27706f[_0x1daa('0x51')][_0x1daa('0x4a')](_0x5768d2)){var _0x6622d=_0x27706f[_0x1daa('0x51')][_0x5768d2];var _0x2f12d9={'id':_0x6622d['id'],'available':_0x6622d[_0x1daa('0x52')],'loggedIn':_0x6622d[_0x1daa('0x53')],'name':_0x6622d[_0x1daa('0x54')],'paused':_0x6622d[_0x1daa('0x55')],'waiting':_0x6622d[_0x1daa('0x56')]};_0x4521ac['push'](_0x2f12d9);}}_0x3f7973({'count':_0x4521ac[_0x1daa('0x17')],'rows':_0x4521ac});});},'MailQueues':function(){return new Promise(function(_0x36596a){var _0x1181c4=[];for(var _0x1ba14b in _0x27706f[_0x1daa('0x57')]){if(_0x27706f['mailQueues'][_0x1daa('0x4a')](_0x1ba14b)){var _0x448819=_0x27706f[_0x1daa('0x57')][_0x1ba14b];var _0x132dbb={'id':_0x448819['id'],'available':_0x448819[_0x1daa('0x52')],'loggedIn':_0x448819[_0x1daa('0x53')],'name':_0x448819[_0x1daa('0x54')],'paused':_0x448819[_0x1daa('0x55')],'waiting':_0x448819[_0x1daa('0x56')]};_0x1181c4[_0x1daa('0x1d')](_0x132dbb);}}_0x36596a({'count':_0x1181c4[_0x1daa('0x17')],'rows':_0x1181c4});});},'OpenchannelQueues':function(){return new Promise(function(_0x5d7e9e){var _0x58c341=[];for(var _0xb3f118 in _0x27706f[_0x1daa('0x58')]){if(_0x27706f[_0x1daa('0x58')][_0x1daa('0x4a')](_0xb3f118)){var _0x2a3fff=_0x27706f[_0x1daa('0x58')][_0xb3f118];var _0xf1696d={'id':_0x2a3fff['id'],'available':_0x2a3fff[_0x1daa('0x52')],'loggedIn':_0x2a3fff['loggedIn'],'name':_0x2a3fff[_0x1daa('0x54')],'paused':_0x2a3fff[_0x1daa('0x55')],'waiting':_0x2a3fff['waiting']};_0x58c341[_0x1daa('0x1d')](_0xf1696d);}}_0x5d7e9e({'count':_0x58c341[_0x1daa('0x17')],'rows':_0x58c341});});},'SmsQueues':function(){return new Promise(function(_0x5f214){var _0x1c9620=[];for(var _0x23c724 in _0x27706f[_0x1daa('0x59')]){if(_0x27706f['smsQueues']['hasOwnProperty'](_0x23c724)){var _0x373567=_0x27706f['smsQueues'][_0x23c724];var _0x5be592={'id':_0x373567['id'],'available':_0x373567[_0x1daa('0x52')],'loggedIn':_0x373567['loggedIn'],'name':_0x373567[_0x1daa('0x54')],'paused':_0x373567[_0x1daa('0x55')],'waiting':_0x373567[_0x1daa('0x56')]};_0x1c9620[_0x1daa('0x1d')](_0x5be592);}}_0x5f214({'count':_0x1c9620[_0x1daa('0x17')],'rows':_0x1c9620});});},'FaxQueues':function(){return new Promise(function(_0x3992d8){var _0x436562=[];for(var _0x1746ff in _0x27706f[_0x1daa('0x5a')]){if(_0x27706f[_0x1daa('0x5a')][_0x1daa('0x4a')](_0x1746ff)){var _0x516dc2=_0x27706f[_0x1daa('0x5a')][_0x1746ff];var _0x654cb1={'id':_0x516dc2['id'],'available':_0x516dc2[_0x1daa('0x52')],'loggedIn':_0x516dc2[_0x1daa('0x53')],'name':_0x516dc2[_0x1daa('0x54')],'paused':_0x516dc2[_0x1daa('0x55')],'waiting':_0x516dc2['waiting']};_0x436562[_0x1daa('0x1d')](_0x654cb1);}}_0x3992d8({'count':_0x436562[_0x1daa('0x17')],'rows':_0x436562});});},'WhatsappQueues':function(){return new Promise(function(_0x244c9e){var _0x43b715=[];for(var _0x43519e in _0x27706f['whatsappQueues']){if(_0x27706f['whatsappQueues']['hasOwnProperty'](_0x43519e)){var _0x1a35dc=_0x27706f[_0x1daa('0x5b')][_0x43519e];var _0x289b56={'id':_0x1a35dc['id'],'available':_0x1a35dc[_0x1daa('0x52')],'loggedIn':_0x1a35dc[_0x1daa('0x53')],'name':_0x1a35dc[_0x1daa('0x54')],'paused':_0x1a35dc['paused'],'waiting':_0x1a35dc[_0x1daa('0x56')]};_0x43b715['push'](_0x289b56);}}_0x244c9e({'count':_0x43b715[_0x1daa('0x17')],'rows':_0x43b715});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x308e38){var _0x3348d7=_[_0x1daa('0x4f')](_0x27706f['chatQueuesWaitingInteractions']);_0x308e38({'count':_0x3348d7[_0x1daa('0x17')],'rows':_0x3348d7});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3a613d){var _0x29cf1f=_[_0x1daa('0x4f')](_0x27706f['mailQueuesWaitingInteractions']);_0x3a613d({'count':_0x29cf1f[_0x1daa('0x17')],'rows':_0x29cf1f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3fcfb5){var _0x420ef8=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5c')]);_0x3fcfb5({'count':_0x420ef8[_0x1daa('0x17')],'rows':_0x420ef8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x47573f){var _0x154b02=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5d')]);_0x47573f({'count':_0x154b02[_0x1daa('0x17')],'rows':_0x154b02});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1c7a7e){var _0x259234=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5e')]);_0x1c7a7e({'count':_0x259234[_0x1daa('0x17')],'rows':_0x259234});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x44cf24){var _0x179409=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5f')]);_0x44cf24({'count':_0x179409[_0x1daa('0x17')],'rows':_0x179409});});}};var _0x3b226c=jayson['server'](_0x45fd48)[_0x1daa('0x60')]();_0x3b226c['on']('error',function(_0x3d4d98){logger[_0x1daa('0x3c')](JSON[_0x1daa('0x38')](_0x3d4d98));return _0x3261e9(_0x3d4d98);});_0x3b226c[_0x1daa('0x61')](0x232c,'127.0.0.1',function(){console['log'](_0x1daa('0x62'),0x232c);return _0x4e58ff(_0x1daa('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f18cf00..0d41d41 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 _0x6002=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','lodash','routing','client','http','request','then','error','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','iftime\x20%s','message','indexOf','true','all'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6002,0x10c));var _0x2600=function(_0xaa4f3,_0x37be20){_0xaa4f3=_0xaa4f3-0x0;var _0x163cc9=_0x6002[_0xaa4f3];return _0x163cc9;};'use strict';var util=require(_0x2600('0x0'));var BPromise=require(_0x2600('0x1'));var jayson=require('jayson/promise');var _=require(_0x2600('0x2'));var logger=require('../../../config/logger')(_0x2600('0x3'));var client=jayson[_0x2600('0x4')][_0x2600('0x5')]({'port':0x232a});function request(_0x3b83af,_0x23efd5){return new BPromise(function(_0xbc4fae,_0x3885f7){return client[_0x2600('0x6')](_0x3b83af,_0x23efd5)[_0x2600('0x7')](function(_0xe518ff){if(_0xe518ff[_0x2600('0x8')]){return _0x3885f7(_0xe518ff['error']['message']);}else{return _0xbc4fae(_0xe518ff[_0x2600('0x9')]);}})[_0x2600('0xa')](function(_0x3791b2){return _0x3885f7(_0x3791b2);});});}exports['condition']=function(_0x178aa5,_0x2afd11,_0x20ac35){return function(_0x1781f0){if(_0x20ac35[_0x2600('0xb')]&&!_0x20ac35[_0x2600('0xb')][_0x178aa5]){logger[_0x2600('0xc')](_0x2600('0xd'),_0x178aa5);return _0x1781f0['stop']();}var _0x56fa33=[];for(var _0x406d1c=0x0;_0x406d1c<_0x2afd11[_0x2600('0xe')];_0x406d1c+=0x1){_0x56fa33[_0x2600('0xf')](request(_0x2600('0x10'),{'command':util['format'](_0x2600('0x11'),_0x2afd11[_0x406d1c])})[_0x2600('0x7')](function(_0x425b8c){return _0x425b8c&&_0x425b8c[_0x2600('0x12')]&&_0x425b8c[_0x2600('0x12')][_0x2600('0x13')](_0x2600('0x14'))>=0x0?!![]:![];})[_0x2600('0xa')](function(_0x3f0ca7){logger[_0x2600('0x8')]('[%s][INTERVAL]\x20%s',_0x178aa5,_0x2afd11[_0x406d1c]);}));}BPromise[_0x2600('0x15')](_0x56fa33)['then'](function(_0x15a0a4){var _0x139d0c=_['some'](_0x15a0a4);logger[_0x2600('0xc')](_0x2600('0x16'),_0x178aa5,_0x2afd11[_0x2600('0x17')](_0x2600('0x18')),_0x139d0c);_0x1781f0[_0x2600('0x19')](_0x139d0c);})[_0x2600('0xa')](function(_0x1a959a){console[_0x2600('0x1a')](_0x1a959a);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x178aa5,_0x2afd11[_0x2600('0x17')](_0x2600('0x18')),_0x1a959a[_0x2600('0x1b')]);_0x1781f0[_0x2600('0x1c')]();});};}; \ No newline at end of file +var _0x0ffa=['[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','stop','util','bluebird','jayson/promise','../../../config/logger','routing','client','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','then','indexOf','true','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0ffa,0x182));var _0xa0ff=function(_0x10e05a,_0x26374f){_0x10e05a=_0x10e05a-0x0;var _0x1d5361=_0x0ffa[_0x10e05a];return _0x1d5361;};'use strict';var util=require(_0xa0ff('0x0'));var BPromise=require(_0xa0ff('0x1'));var jayson=require(_0xa0ff('0x2'));var _=require('lodash');var logger=require(_0xa0ff('0x3'))(_0xa0ff('0x4'));var client=jayson[_0xa0ff('0x5')]['http']({'port':0x232a});function request(_0x7222ad,_0x36a0f3){return new BPromise(function(_0x253e7c,_0x3bfa41){return client['request'](_0x7222ad,_0x36a0f3)['then'](function(_0x1d3bed){if(_0x1d3bed['error']){return _0x3bfa41(_0x1d3bed['error'][_0xa0ff('0x6')]);}else{return _0x253e7c(_0x1d3bed['result']);}})['catch'](function(_0x128edc){return _0x3bfa41(_0x128edc);});});}exports[_0xa0ff('0x7')]=function(_0x21f06e,_0x56699b,_0x5082ba){return function(_0x1c8d3a){if(_0x5082ba['rules']&&!_0x5082ba[_0xa0ff('0x8')][_0x21f06e]){logger[_0xa0ff('0x9')](_0xa0ff('0xa'),_0x21f06e);return _0x1c8d3a['stop']();}var _0x499976=[];for(var _0x3131e6=0x0;_0x3131e6<_0x56699b['length'];_0x3131e6+=0x1){_0x499976[_0xa0ff('0xb')](request(_0xa0ff('0xc'),{'command':util[_0xa0ff('0xd')](_0xa0ff('0xe'),_0x56699b[_0x3131e6])})[_0xa0ff('0xf')](function(_0x572061){return _0x572061&&_0x572061[_0xa0ff('0x6')]&&_0x572061[_0xa0ff('0x6')][_0xa0ff('0x10')](_0xa0ff('0x11'))>=0x0?!![]:![];})[_0xa0ff('0x12')](function(_0x952c66){logger['error'](_0xa0ff('0x13'),_0x21f06e,_0x56699b[_0x3131e6]);}));}BPromise['all'](_0x499976)[_0xa0ff('0xf')](function(_0x10a644){var _0x2c849c=_[_0xa0ff('0x14')](_0x10a644);logger[_0xa0ff('0x9')](_0xa0ff('0x15'),_0x21f06e,_0x56699b[_0xa0ff('0x16')]('\x20|\x20'),_0x2c849c);_0x1c8d3a[_0xa0ff('0x17')](_0x2c849c);})['catch'](function(_0x41f7f7){console[_0xa0ff('0x18')](_0x41f7f7);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x21f06e,_0x56699b[_0xa0ff('0x16')]('\x20|\x20'),_0x41f7f7[_0xa0ff('0x19')]);_0x1c8d3a[_0xa0ff('0x1a')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 1a8aa4c..d89f7df 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x1bffce,_0x786325){var _0x5029e5=function(_0x3fb5a1){while(--_0x3fb5a1){_0x1bffce['push'](_0x1bffce['shift']());}};_0x5029e5(++_0x786325);}(_0xb9a7,0x112));var _0x7b9a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb9a7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +var _0x1339=['talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','error','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','clone','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime'];(function(_0x3a93b7,_0x658183){var _0x2ed891=function(_0x1a60de){while(--_0x1a60de){_0x3a93b7['push'](_0x3a93b7['shift']());}};_0x2ed891(++_0x658183);}(_0x1339,0x1ed));var _0x9133=function(_0x1a7093,_0x217c0e){_0x1a7093=_0x1a7093-0x0;var _0x22f28a=_0x1339[_0x1a7093];return _0x22f28a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9133('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2a91b2,_0x4611be){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3'),_0x2a91b2[_0x9133('0x4')],_0x2a91b2[_0x9133('0x5')],_0x2a91b2['queue'],_0x2a91b2[_0x9133('0x6')],_0x2a91b2[_0x9133('0x7')],_0x2a91b2[_0x9133('0x8')],_0x2a91b2['connectedlinenum'],_0x2a91b2[_0x9133('0x9')]));if(_0x2a91b2[_0x9133('0xa')]){utils[_0x9133('0xb')](_0x2a91b2[_0x9133('0xa')])[_0x9133('0xc')](function(_0x3a7a80){if(_0x3a7a80){_0x2a91b2[_0x9133('0xd')]=_0x3a7a80[_0x9133('0xd')];_0x2a91b2[_0x9133('0xe')]=_0x2a91b2[_0x9133('0xf')]?_0x3a7a80['acw']:![];_0x2a91b2[_0x9133('0x10')]=_0x2a91b2[_0x9133('0xe')]?_0x3a7a80[_0x9133('0x11')]:0x0;}utils[_0x9133('0x12')](_0x9133('0x13'),_0x2a91b2);});}else{utils[_0x9133('0x12')]('CreateVoiceAgentReport',_0x2a91b2);}if(_0x4611be){delete transfers[_0x2a91b2[_0x9133('0x4')]];}else{delete agents[_0x2a91b2[_0x9133('0x14')]];}}exports['agentcalled']=function(_0x5283a3){try{utils[_0x9133('0x15')](util['format'](_0x9133('0x16'),_0x5283a3[_0x9133('0x4')]),_0x5283a3);agents[_0x5283a3[_0x9133('0x14')]]=_0x5283a3;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();agents[_0x5283a3['destuniqueid']][_0x9133('0x9')]=_0x9133('0x19');agents[_0x5283a3['destuniqueid']][_0x9133('0x1a')]=null;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x1b')]=null;utils[_0x9133('0x1')](util['format'](_0x9133('0x1c'),_0x5283a3['uniqueid'],agents[_0x5283a3[_0x9133('0x14')]]['membername'],_0x5283a3[_0x9133('0x14')]));}catch(_0x1d6d0b){utils['error'](util[_0x9133('0x2')]('[%s][agents][agentcalled]',_0x5283a3[_0x9133('0x4')]),_0x1d6d0b);}};exports['agentringnoanswer']=function(_0x5e4f0c){try{if(!_[_0x9133('0x1d')](agents[_0x5e4f0c['destuniqueid']])){utils[_0x9133('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x5e4f0c['uniqueid']),_0x5e4f0c);utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5e4f0c[_0x9133('0x4')],agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x6')],_0x5e4f0c[_0x9133('0x14')]));agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1e')]=!![];agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1f')]=utils[_0x9133('0x18')]();agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x21')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x22')]=_0x5e4f0c['ringtime']?parseInt(_0x5e4f0c['ringtime'])/0x3e8:0x0;agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x23')]=0x0;unanswered[_0x9133('0x24')](_0x5e4f0c[_0x9133('0x14')]);}}catch(_0x4de894){utils['error'](util[_0x9133('0x2')](_0x9133('0x25'),_0x5e4f0c[_0x9133('0x4')]),_0x4de894);}};exports[_0x9133('0x26')]=function(_0x390f50){try{_[_0x9133('0x27')](agents,function(_0x48c713,_0x58afe0){if(_0x48c713['uniqueid']==_0x390f50[_0x9133('0x4')]&&!_['includes'](unanswered,_0x48c713[_0x9133('0x14')])){utils[_0x9133('0x15')](util['format'](_0x9133('0x28'),_0x390f50['uniqueid']),_0x390f50);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x29'),_0x390f50['uniqueid'],_0x48c713[_0x9133('0x6')],_0x48c713[_0x9133('0x14')]));_0x48c713[_0x9133('0x1e')]=!![];_0x48c713['agentringnoanswerAt']=utils[_0x9133('0x18')]();_0x48c713[_0x9133('0x9')]=_0x9133('0x2a');_0x48c713['reason']=_0x9133('0x2a');_0x48c713[_0x9133('0x22')]=_0x390f50[_0x9133('0x22')];_0x48c713[_0x9133('0x23')]=0x0;writeDB(_0x48c713);}});}catch(_0x5e4d5e){utils[_0x9133('0x2b')](util[_0x9133('0x2')]('[%s][agents][queuecallerabandon]',_0x390f50[_0x9133('0x4')]),_0x5e4d5e);}};exports[_0x9133('0x2c')]=function(_0x593fbe){try{if(agents[_0x593fbe[_0x9133('0x14')]]){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x2d'),_0x593fbe[_0x9133('0x4')]),_0x593fbe);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x2e'),_0x593fbe['uniqueid'],agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x6')],_0x593fbe['destuniqueid']));agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x2f')]=utils[_0x9133('0x18')]();agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x1a')]=_0x593fbe[_0x9133('0x1a')];agents[_0x593fbe['destuniqueid']]['connectedlinename']=_0x593fbe[_0x9133('0x1b')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x22')]=_0x593fbe[_0x9133('0x30')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x31');_[_0x9133('0x27')](agents,function(_0x720048,_0x5a3f73){if(_0x720048[_0x9133('0x14')]!=_0x593fbe[_0x9133('0x14')]&&_0x720048[_0x9133('0x4')]==_0x593fbe[_0x9133('0x4')]){_0x720048[_0x9133('0x23')]=0x0;_0x720048['holdtime']=_0x593fbe[_0x9133('0x30')];_0x720048[_0x9133('0x1e')]=!![];_0x720048[_0x9133('0x1f')]=utils[_0x9133('0x18')]();_0x720048['lastevent']=_0x9133('0x32');_0x720048[_0x9133('0x21')]=_0x9133('0x32');_0x720048[_0x9133('0x33')]=_0x593fbe[_0x9133('0x14')];_0x720048[_0x9133('0x34')]=_0x593fbe[_0x9133('0x6')];writeDB(_0x720048);}});}}catch(_0x4ca1a3){utils[_0x9133('0x2b')](util['format']('[%s][agents][agentconnect]',_0x593fbe[_0x9133('0x4')]),_0x4ca1a3);}};exports[_0x9133('0xf')]=function(_0x46156d){try{if(!_[_0x9133('0x1d')](agents[_0x46156d[_0x9133('0x14')]])){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x46156d);utils['info'](util[_0x9133('0x2')](_0x9133('0x36'),_0x46156d[_0x9133('0x4')],agents[_0x46156d['destuniqueid']]['membername'],_0x46156d[_0x9133('0x14')]));agents[_0x46156d[_0x9133('0x14')]]['agentcomplete']=!![];agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x23')]=utils['diffTime'](agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')],agents[_0x46156d[_0x9133('0x14')]]['agentconnectAt']);agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x21')]=_0x46156d['reason'];agents[_0x46156d['destuniqueid']][_0x9133('0x9')]=_0x9133('0x38');writeDB(agents[_0x46156d[_0x9133('0x14')]]);}}catch(_0x41fea9){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x41fea9);}};exports[_0x9133('0x39')]=function(_0xf07fbb){try{if(!_[_0x9133('0x1d')](agents[_0xf07fbb[_0x9133('0x3a')]])){utils['debug'](util['format'](_0x9133('0x3b'),_0xf07fbb['uniqueid']),_0xf07fbb);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3c'),_0xf07fbb[_0x9133('0x4')],agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x6')],agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x4')]));agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x3d')]=!![];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x3e')]='blind';agents[_0xf07fbb[_0x9133('0x3a')]]['transferexten']=_0xf07fbb[_0x9133('0x3f')];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x40')]=agents[_0xf07fbb[_0x9133('0x3a')]]['uniqueid'];}}catch(_0x4a346c){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x3b'),_0xf07fbb[_0x9133('0x4')]),_0x4a346c);}};exports[_0x9133('0x41')]=function(_0x565920){try{utils['debug'](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920['origtransfereruniqueid']),_0x565920);if(_0x565920[_0x9133('0x43')]==_0x565920[_0x9133('0x44')]){if(!_['isNil'](agents[_0x565920['secondtransfereruniqueid']])){utils['info'](util[_0x9133('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x45')]][_0x9133('0x6')]));agents[_0x565920[_0x9133('0x45')]]['transfer']=!![];agents[_0x565920[_0x9133('0x45')]]['transfertype']=_0x9133('0x46');agents[_0x565920[_0x9133('0x45')]][_0x9133('0x47')]=_0x565920[_0x9133('0x48')];agents[_0x565920[_0x9133('0x45')]][_0x9133('0x40')]=_0x565920['origtransfereruniqueid'];}if(_0x565920['transfereeuniqueid']&&agents[_0x565920['transfereeuniqueid']]){agents[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x49')]]=_['clone'](agents[_0x565920[_0x9133('0x49')]]);transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x45')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x45')]]['calleridname'];transfers[_0x565920[_0x9133('0x49')]]['agentcalledAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']][_0x9133('0x2f')]=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x2;}}else if(_0x565920[_0x9133('0x45')]==_0x565920[_0x9133('0x4c')]){if(!_[_0x9133('0x1d')](agents[_0x565920[_0x9133('0x43')]])){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x4d'),_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x43')]]['membername']));agents[_0x565920[_0x9133('0x43')]]['transfer']=!![];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x3e')]=_0x9133('0x46');agents[_0x565920[_0x9133('0x43')]][_0x9133('0x47')]=_0x565920['secondtransfererexten'];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x40')]=_0x565920[_0x9133('0x45')];}if(_0x565920[_0x9133('0x4e')]&&agents[_0x565920['transfertargetuniqueid']]){agents[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x4e')]]=_[_0x9133('0x4f')](agents[_0x565920['transfertargetuniqueid']]);transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x43')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x43')]]['calleridname'];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();transfers[_0x565920[_0x9133('0x4e')]]['agentconnectAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x22')]=0x0;transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x2;}}}catch(_0x39b46d){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920[_0x9133('0x43')]),_0x39b46d);}};exports['hangup']=function(_0x23bd83){try{utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x50'),_0x23bd83[_0x9133('0x4')]),_0x23bd83);if(agents[_0x23bd83['uniqueid']]&&agents[_0x23bd83['uniqueid']]['reason']===_0x9133('0x20')){if(_0x23bd83[_0x9133('0x51')]==='21'){agents[_0x23bd83[_0x9133('0x4')]]['reason']=_0x9133('0x52');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x52');}utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83[_0x9133('0x4')],agents[_0x23bd83['uniqueid']][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]]['reason'],agents[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);var _0x439352=unanswered[_0x9133('0x54')](_0x23bd83[_0x9133('0x4')]);if(_0x439352>-0x1){unanswered[_0x9133('0x55')](_0x439352,0x1);}}if(transfers[_0x23bd83['uniqueid']]){transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')]=utils['now']();transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x23')]=utils[_0x9133('0x56')](transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')]=_0x9133('0x57');transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83['uniqueid'],transfers[_0x23bd83[_0x9133('0x4')]]['membername'],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(transfers[_0x23bd83[_0x9133('0x4')]],!![]);}if(agents[_0x23bd83[_0x9133('0x4')]]&&agents[_0x23bd83[_0x9133('0x4')]]['agentconnectAt']){agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];agents[_0x23bd83['uniqueid']][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x23bd83[_0x9133('0x4')]]['talktime']=utils[_0x9133('0x56')](agents[_0x23bd83['uniqueid']][_0x9133('0x37')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);agents[_0x23bd83['uniqueid']][_0x9133('0x21')]=agents[_0x23bd83['uniqueid']][_0x9133('0x3d')]?_0x9133('0x3d'):_0x9133('0x57');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x23bd83[_0x9133('0x4')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],agents[_0x23bd83['uniqueid']][_0x9133('0x9')]));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);}}catch(_0x1b66d0){utils[_0x9133('0x2b')](util['format'](_0x9133('0x50'),_0x23bd83['uniqueid']),_0x1b66d0);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index e477d13..34654db 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 _0x631c=['getUserByInternal','UserId','CreateVoiceCallReport','request','blinds','recording','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','noop','execif','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode'];(function(_0x4e5ded,_0x3897b){var _0x1e2999=function(_0x3d7e15){while(--_0x3d7e15){_0x4e5ded['push'](_0x4e5ded['shift']());}};_0x1e2999(++_0x3897b);}(_0x631c,0x1b6));var _0xc631=function(_0x5e3607,_0x3cad38){_0x5e3607=_0x5e3607-0x0;var _0x2a273e=_0x631c[_0x5e3607];return _0x2a273e;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var utils=require('./utils');var transfers=require(_0xc631('0x2'));var dispositions=[_0xc631('0x3'),'FAILED',_0xc631('0x4'),_0xc631('0x3'),_0xc631('0x3'),'NO\x20ANSWER',_0xc631('0x5'),_0xc631('0x6'),'FAILED',_0xc631('0x4'),'FAILED'];var channels={};function writeDB(_0x348b52){var _0x25c5c1;if(transfers['blinds'][_0x348b52['uniqueid']]){_0x25c5c1=_0x348b52['uniqueid'];_0x348b52[_0xc631('0x7')]=transfers['blinds'][_0x348b52[_0xc631('0x7')]][_0xc631('0x8')];}utils[_0xc631('0x9')](util['format'](_0xc631('0xa'),_0x348b52[_0xc631('0x7')],_0x348b52[_0xc631('0xb')],_0x348b52[_0xc631('0xc')],_0x348b52[_0xc631('0xd')],_0x348b52[_0xc631('0xe')],_0x348b52['calleridnum'],_0x348b52[_0xc631('0xf')],_0x348b52[_0xc631('0x10')]));if(_0x348b52[_0xc631('0x11')]){utils[_0xc631('0x12')](_0x348b52[_0xc631('0x11')])['then'](function(_0x241e39){if(_0x241e39){_0x348b52[_0xc631('0x13')]=_0x241e39['id'];}utils['request'](_0xc631('0x14'),_0x348b52);});}else{utils[_0xc631('0x15')](_0xc631('0x14'),_0x348b52);}if(channels[_0x348b52[_0xc631('0x7')]]){delete channels[_0x348b52[_0xc631('0x7')]];}else if(_0x25c5c1&&channels[_0x25c5c1]){if(!transfers[_0xc631('0x16')][_0x25c5c1][_0xc631('0x17')])delete transfers[_0xc631('0x16')][_0x25c5c1];delete channels[_0x25c5c1];}}exports[_0xc631('0x18')]=function(_0x487278){try{utils[_0xc631('0x19')](util['format'](_0xc631('0x1a'),_0x487278['uniqueid']),_0x487278);if(_0x487278[_0xc631('0x7')]==_0x487278['linkedid']&&_0x487278[_0xc631('0xb')]!=_0xc631('0x1b')){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x1d'),_0x487278[_0xc631('0x7')],_0x487278[_0xc631('0x1e')],_0x487278['exten']));channels[_0x487278[_0xc631('0x7')]]={'uniqueid':_0x487278[_0xc631('0x7')],'accountcode':_0x487278['accountcode'],'source':_0x487278[_0xc631('0x1f')],'destination':_0x487278['exten'],'destinationcontext':_0x487278[_0xc631('0x1e')],'channel':_0x487278[_0xc631('0xb')],'starttime':utils[_0xc631('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc631('0x3'),'amaflags':_0xc631('0x21')};}}catch(_0x31f871){utils[_0xc631('0x22')](util[_0xc631('0x1c')]('[%s][calls][newchannel]',_0x487278[_0xc631('0x7')]),_0x31f871);}};exports[_0xc631('0x23')]=function(_0x4c6d5b){try{utils[_0xc631('0x19')](util['format'](_0xc631('0x24'),_0x4c6d5b['uniqueid']),_0x4c6d5b);if(!_[_0xc631('0x25')](channels[_0x4c6d5b[_0xc631('0x7')]])&&_0x4c6d5b['channelstate']==0x6){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x26'),_0x4c6d5b['uniqueid'],_0x4c6d5b['context'],_0x4c6d5b[_0xc631('0xb')]));if(_[_0xc631('0x25')](channels[_0x4c6d5b[_0xc631('0x7')]]['systemanswertime'])){channels[_0x4c6d5b[_0xc631('0x7')]][_0xc631('0x27')]=utils[_0xc631('0x20')]();}}else if(!_[_0xc631('0x25')](channels[_0x4c6d5b[_0xc631('0x28')]])&&_0x4c6d5b['channelstate']==0x6&&_0x4c6d5b[_0xc631('0x1e')]!=_0xc631('0x29')){utils[_0xc631('0x9')](util['format'](_0xc631('0x2a'),_0x4c6d5b[_0xc631('0x7')],_0x4c6d5b['linkedid'],_0x4c6d5b[_0xc631('0x1e')],_0x4c6d5b[_0xc631('0xb')]));channels[_0x4c6d5b[_0xc631('0x28')]][_0xc631('0x11')]=_0x4c6d5b[_0xc631('0x11')];channels[_0x4c6d5b[_0xc631('0x28')]][_0xc631('0x2b')]=_0x4c6d5b[_0xc631('0xb')];if(_[_0xc631('0x25')](channels[_0x4c6d5b[_0xc631('0x28')]][_0xc631('0x2c')])){channels[_0x4c6d5b['linkedid']]['answertime']=utils['now']();}channels[_0x4c6d5b['linkedid']][_0xc631('0x2d')]=dispositions[_[_0xc631('0x2e')](_0x4c6d5b['channelstate'])]||'ANSWERED';}}catch(_0x1fe810){utils[_0xc631('0x22')](util[_0xc631('0x1c')]('[%s][calls][newstate]',_0x4c6d5b[_0xc631('0x7')]),_0x1fe810);}};exports[_0xc631('0x2f')]=function(_0x4f4bbc){try{if(!_[_0xc631('0x25')](channels[_0x4f4bbc[_0xc631('0x7')]])){utils[_0xc631('0x19')](util[_0xc631('0x1c')]('[%s][calls][hangup]',_0x4f4bbc[_0xc631('0x7')]),_0x4f4bbc);if(_[_0xc631('0x25')](channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x30')])){channels[_0x4f4bbc['uniqueid']][_0xc631('0x30')]=_0x4f4bbc[_0xc631('0x31')]+'\x20<'+_0x4f4bbc[_0xc631('0x1f')]+'>';}utils[_0xc631('0x9')](util['format'](_0xc631('0x32'),_0x4f4bbc[_0xc631('0x7')],channels[_0x4f4bbc['uniqueid']][_0xc631('0x30')],_0x4f4bbc[_0xc631('0x33')]));channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x34')]=utils[_0xc631('0x20')]();channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x35')]=utils[_0xc631('0x36')](channels[_0x4f4bbc['uniqueid']][_0xc631('0x34')],channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x37')]);channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x38')]=channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x2c')]?utils[_0xc631('0x36')](channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x34')],channels[_0x4f4bbc[_0xc631('0x7')]][_0xc631('0x2c')]):0x0;writeDB(channels[_0x4f4bbc[_0xc631('0x7')]]);}}catch(_0x4a865e){utils['error'](util['format']('[%s][calls][hangup]',_0x4f4bbc[_0xc631('0x7')]),_0x4a865e);}};exports[_0xc631('0x39')]=function(_0x371432){try{if(!_[_0xc631('0x25')](channels[_0x371432[_0xc631('0x3a')]])){utils[_0xc631('0x19')](util['format']('[%s][calls][attendedtransfer]',_0x371432[_0xc631('0x3b')]),_0x371432);if(channels[_0x371432[_0xc631('0x3a')]][_0xc631('0xb')]==_0x371432[_0xc631('0x3c')]){utils[_0xc631('0x9')](util[_0xc631('0x1c')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x371432['origtransfereruniqueid'],_0x371432['localtwolinkedid'],_0x371432[_0xc631('0x3d')]));channels[_0x371432[_0xc631('0x3a')]]['destinationchannel']=_0x371432[_0xc631('0x3d')];channels[_0x371432[_0xc631('0x3a')]]['userfield']=_0xc631('0x3e');}else if(channels[_0x371432['localtwolinkedid']][_0xc631('0xb')]=_0x371432[_0xc631('0x3f')]){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x40'),_0x371432[_0xc631('0x3b')],_0x371432[_0xc631('0x3a')],_0x371432[_0xc631('0x41')]));channels[_0x371432[_0xc631('0x3a')]][_0xc631('0x2b')]=_0x371432[_0xc631('0x41')];channels[_0x371432[_0xc631('0x3a')]][_0xc631('0x42')]='_attended';}}}catch(_0x1d46b3){utils[_0xc631('0x22')](util[_0xc631('0x1c')](_0xc631('0x43'),_0x371432[_0xc631('0x3b')]),_0x1d46b3);}};exports[_0xc631('0x44')]=function(_0x55d68c){try{if(!_['isNil'](channels[_0x55d68c[_0xc631('0x7')]])){utils[_0xc631('0x19')](util['format']('[%s][calls][musiconholdstart]',_0x55d68c[_0xc631('0x7')]),_0x55d68c);channels[_0x55d68c[_0xc631('0x7')]]['musiconholdstartAt']=utils[_0xc631('0x20')]();utils[_0xc631('0x9')](util['format'](_0xc631('0x45'),_0x55d68c['uniqueid'],channels[_0x55d68c[_0xc631('0x7')]][_0xc631('0x46')]));}}catch(_0x3801ec){utils[_0xc631('0x22')](util[_0xc631('0x1c')](_0xc631('0x47'),_0x55d68c[_0xc631('0x7')]),_0x3801ec);}};exports[_0xc631('0x48')]=function(_0x3e41ce){try{if(!_[_0xc631('0x25')](channels[_0x3e41ce[_0xc631('0x7')]])){utils[_0xc631('0x19')](util[_0xc631('0x1c')]('[%s][calls][musiconholdstop]',_0x3e41ce[_0xc631('0x7')]),_0x3e41ce);if(!_['isNil'](channels[_0x3e41ce[_0xc631('0x7')]][_0xc631('0x46')])){channels[_0x3e41ce[_0xc631('0x7')]][_0xc631('0x49')]+=utils[_0xc631('0x36')](utils[_0xc631('0x20')](),channels[_0x3e41ce[_0xc631('0x7')]][_0xc631('0x46')]);utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x4a'),_0x3e41ce[_0xc631('0x7')],channels[_0x3e41ce['uniqueid']]['mohtime']));delete channels[_0x3e41ce[_0xc631('0x7')]][_0xc631('0x46')];}}}catch(_0x105875){utils[_0xc631('0x22')](util[_0xc631('0x1c')](_0xc631('0x4b'),_0x3e41ce[_0xc631('0x7')]),_0x105875);}};exports['varset']=function(_0x4a9201){try{if(!_[_0xc631('0x25')](channels[_0x4a9201[_0xc631('0x7')]])){utils[_0xc631('0x19')](util[_0xc631('0x1c')]('[%s][calls][varset]',_0x4a9201['uniqueid']),_0x4a9201);if(!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')]['xmd-originatecalleridnum'])){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x4d'),_0x4a9201['uniqueid'],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0x4f')]=_0x4a9201[_0xc631('0x4e')];}if(!_['isNil'](_0x4a9201[_0xc631('0x4c')]['xmd-phone'])){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x50'),_0x4a9201[_0xc631('0x7')],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201['uniqueid']]['destination']=_0x4a9201[_0xc631('0x4e')];channels[_0x4a9201[_0xc631('0x7')]]['callerid']='\x22'+_0x4a9201[_0xc631('0x4e')]+_0xc631('0x51')+_0x4a9201[_0xc631('0x4e')]+'>';}if(!_['isNil'](_0x4a9201[_0xc631('0x4c')][_0xc631('0x52')])||!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')][_0xc631('0x53')])){utils[_0xc631('0x9')](util['format'](_0xc631('0x54'),_0x4a9201[_0xc631('0x7')],!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')][_0xc631('0x52')])?_0xc631('0x52'):'xmd-callerid',_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201['uniqueid']][_0xc631('0x30')]=_0x4a9201[_0xc631('0x4e')];}if(!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')][_0xc631('0x55')])||!_['isNil'](_0x4a9201[_0xc631('0x4c')][_0xc631('0x56')])){utils[_0xc631('0x9')](util[_0xc631('0x1c')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a9201[_0xc631('0x7')],!_[_0xc631('0x25')](_0x4a9201['variable'][_0xc631('0x55')])?_0xc631('0x55'):_0xc631('0x56'),_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0x57')]=_0xc631('0x58');channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0x59')]=_0x4a9201[_0xc631('0x4e')];channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0xc')]=!![];}if(!_['isNil'](_0x4a9201[_0xc631('0x4c')][_0xc631('0x5a')])){utils[_0xc631('0x9')](util[_0xc631('0x1c')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4a9201[_0xc631('0x7')],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0x5b')]=_0x4a9201['value'];}if(!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')][_0xc631('0x5c')])){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x5d'),_0x4a9201['uniqueid'],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]][_0xc631('0x5e')]=_0x4a9201[_0xc631('0x4e')];}if(!_[_0xc631('0x25')](_0x4a9201[_0xc631('0x4c')][_0xc631('0x5f')])){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x60'),_0x4a9201[_0xc631('0x7')],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]]['routeid']=_0x4a9201[_0xc631('0x4e')];}if(!_['isNil'](_0x4a9201['variable'][_0xc631('0x61')])){utils[_0xc631('0x9')](util[_0xc631('0x1c')](_0xc631('0x62'),_0x4a9201['uniqueid'],_0x4a9201[_0xc631('0x4e')]));channels[_0x4a9201[_0xc631('0x7')]]['sipcallid']=_0x4a9201[_0xc631('0x4e')];}}}catch(_0x1bd244){utils[_0xc631('0x22')](util['format'](_0xc631('0x63'),_0x4a9201[_0xc631('0x7')]),_0x1bd244);}};exports[_0xc631('0x64')]=function(_0x4f5a65){try{if(!_[_0xc631('0x25')](channels[_0x4f5a65['uniqueid']])){utils['debug'](util[_0xc631('0x1c')](_0xc631('0x65'),_0x4f5a65[_0xc631('0x7')]),_0x4f5a65);utils[_0xc631('0x9')](util['format'](_0xc631('0x66'),_0x4f5a65['uniqueid'],_0x4f5a65[_0xc631('0x67')],_0x4f5a65['appdata']));if(_0x4f5a65[_0xc631('0x67')][_0xc631('0x68')]()==_0xc631('0x69')&&_[_0xc631('0x6a')](_0x4f5a65['appdata'][_0xc631('0x68')](),_0xc631('0x6b'))){var _0x72fd10=_0x4f5a65[_0xc631('0x6c')][_0xc631('0x6d')]('=');var _0x25bfab=_0x72fd10[0x0]['substring'](_0x72fd10[0x0][_0xc631('0x6e')]('(')+0x1,_0x72fd10[0x0]['lastIndexOf'](')'));var _0x3db3b9=_0x72fd10[0x1];channels[_0x4f5a65['uniqueid']][_0x25bfab]=_0x3db3b9;}if(!_['includes']([_0xc631('0x2f'),_0xc631('0x6f'),_0xc631('0x70'),_0xc631('0x69'),_0xc631('0x71')],_0x4f5a65['application'][_0xc631('0x68')]())){channels[_0x4f5a65[_0xc631('0x7')]][_0xc631('0x57')]=_0x4f5a65['application'];channels[_0x4f5a65[_0xc631('0x7')]]['lastdata']=_0x4f5a65[_0xc631('0x6c')];}}}catch(_0x5a2743){utils[_0xc631('0x22')](util[_0xc631('0x1c')](_0xc631('0x65'),_0x4f5a65[_0xc631('0x7')]),_0x5a2743);}}; \ No newline at end of file +var _0x855f=['toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','noop','gotoif','lastdata','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x855f,0x145));var _0xf855=function(_0x15aae7,_0x5e2e30){_0x15aae7=_0x15aae7-0x0;var _0x2a6b76=_0x855f[_0x15aae7];return _0x2a6b76;};'use strict';var _=require(_0xf855('0x0'));var util=require('util');var utils=require(_0xf855('0x1'));var transfers=require(_0xf855('0x2'));var dispositions=[_0xf855('0x3'),_0xf855('0x4'),_0xf855('0x4'),'NO\x20ANSWER',_0xf855('0x3'),_0xf855('0x3'),'ANSWERED','BUSY',_0xf855('0x4'),_0xf855('0x4'),_0xf855('0x4')];var channels={};function writeDB(_0x35cc05){var _0xe6470d;if(transfers[_0xf855('0x5')][_0x35cc05[_0xf855('0x6')]]){_0xe6470d=_0x35cc05['uniqueid'];_0x35cc05[_0xf855('0x6')]=transfers[_0xf855('0x5')][_0x35cc05[_0xf855('0x6')]][_0xf855('0x7')];}utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0xa'),_0x35cc05[_0xf855('0x6')],_0x35cc05['channel'],_0x35cc05[_0xf855('0xb')],_0x35cc05[_0xf855('0xc')],_0x35cc05[_0xf855('0xd')],_0x35cc05['calleridnum'],_0x35cc05[_0xf855('0xe')],_0x35cc05[_0xf855('0xf')]));if(_0x35cc05[_0xf855('0x10')]){utils[_0xf855('0x11')](_0x35cc05[_0xf855('0x10')])[_0xf855('0x12')](function(_0x5877b){if(_0x5877b){_0x35cc05['UserId']=_0x5877b['id'];}utils[_0xf855('0x13')](_0xf855('0x14'),_0x35cc05);});}else{utils[_0xf855('0x13')](_0xf855('0x14'),_0x35cc05);}if(channels[_0x35cc05[_0xf855('0x6')]]){delete channels[_0x35cc05[_0xf855('0x6')]];}else if(_0xe6470d&&channels[_0xe6470d]){if(!transfers[_0xf855('0x5')][_0xe6470d]['recording'])delete transfers['blinds'][_0xe6470d];delete channels[_0xe6470d];}}exports[_0xf855('0x15')]=function(_0xcd9d5f){try{utils[_0xf855('0x16')](util['format'](_0xf855('0x17'),_0xcd9d5f[_0xf855('0x6')]),_0xcd9d5f);if(_0xcd9d5f['uniqueid']==_0xcd9d5f['linkedid']&&_0xcd9d5f[_0xf855('0x18')]!=_0xf855('0x19')){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x1a'),_0xcd9d5f[_0xf855('0x6')],_0xcd9d5f[_0xf855('0x1b')],_0xcd9d5f[_0xf855('0x1c')]));channels[_0xcd9d5f[_0xf855('0x6')]]={'uniqueid':_0xcd9d5f[_0xf855('0x6')],'accountcode':_0xcd9d5f[_0xf855('0x10')],'source':_0xcd9d5f[_0xf855('0x1d')],'destination':_0xcd9d5f[_0xf855('0x1c')],'destinationcontext':_0xcd9d5f['context'],'channel':_0xcd9d5f[_0xf855('0x18')],'starttime':utils[_0xf855('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf855('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x3b0973){utils['error'](util[_0xf855('0x9')](_0xf855('0x17'),_0xcd9d5f[_0xf855('0x6')]),_0x3b0973);}};exports['newstate']=function(_0x100d1e){try{utils[_0xf855('0x16')](util['format'](_0xf855('0x1f'),_0x100d1e[_0xf855('0x6')]),_0x100d1e);if(!_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x6')]])&&_0x100d1e[_0xf855('0x21')]==0x6){utils['info'](util['format'](_0xf855('0x22'),_0x100d1e[_0xf855('0x6')],_0x100d1e['context'],_0x100d1e[_0xf855('0x18')]));if(_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x6')]][_0xf855('0x23')])){channels[_0x100d1e[_0xf855('0x6')]][_0xf855('0x23')]=utils[_0xf855('0x1e')]();}}else if(!_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x24')]])&&_0x100d1e[_0xf855('0x21')]==0x6&&_0x100d1e[_0xf855('0x1b')]!='transfer'){utils[_0xf855('0x8')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x100d1e['uniqueid'],_0x100d1e[_0xf855('0x24')],_0x100d1e[_0xf855('0x1b')],_0x100d1e[_0xf855('0x18')]));channels[_0x100d1e[_0xf855('0x24')]]['accountcode']=_0x100d1e[_0xf855('0x10')];channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x25')]=_0x100d1e[_0xf855('0x18')];if(_['isNil'](channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x26')])){channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x26')]=utils['now']();}channels[_0x100d1e['linkedid']][_0xf855('0x27')]=dispositions[_[_0xf855('0x28')](_0x100d1e['channelstate'])]||_0xf855('0x29');}}catch(_0x5ab5d6){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x1f'),_0x100d1e[_0xf855('0x6')]),_0x5ab5d6);}};exports[_0xf855('0x2b')]=function(_0x3f1afe){try{if(!_[_0xf855('0x20')](channels[_0x3f1afe[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x2c'),_0x3f1afe[_0xf855('0x6')]),_0x3f1afe);if(_[_0xf855('0x20')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')])){channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')]=_0x3f1afe[_0xf855('0x2e')]+'\x20<'+_0x3f1afe['calleridnum']+'>';}utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x2f'),_0x3f1afe['uniqueid'],channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')],_0x3f1afe[_0xf855('0x30')]));channels[_0x3f1afe['uniqueid']][_0xf855('0x31')]=utils[_0xf855('0x1e')]();channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x32')]=utils[_0xf855('0x33')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x31')],channels[_0x3f1afe['uniqueid']][_0xf855('0x34')]);channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x35')]=channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x26')]?utils[_0xf855('0x33')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x31')],channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x26')]):0x0;writeDB(channels[_0x3f1afe['uniqueid']]);}}catch(_0x402436){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x2c'),_0x3f1afe[_0xf855('0x6')]),_0x402436);}};exports[_0xf855('0x36')]=function(_0x13946c){try{if(!_['isNil'](channels[_0x13946c[_0xf855('0x37')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x38'),_0x13946c[_0xf855('0x39')]),_0x13946c);if(channels[_0x13946c['localtwolinkedid']][_0xf855('0x18')]==_0x13946c['transfereechannel']){utils['info'](util[_0xf855('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x13946c[_0xf855('0x39')],_0x13946c['localtwolinkedid'],_0x13946c[_0xf855('0x3a')]));channels[_0x13946c[_0xf855('0x37')]]['destinationchannel']=_0x13946c[_0xf855('0x3a')];channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x3b')]=_0xf855('0x3c');}else if(channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x18')]=_0x13946c[_0xf855('0x3d')]){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x3e'),_0x13946c[_0xf855('0x39')],_0x13946c['localtwolinkedid'],_0x13946c[_0xf855('0x3f')]));channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x25')]=_0x13946c[_0xf855('0x3f')];channels[_0x13946c[_0xf855('0x37')]]['userfield']=_0xf855('0x3c');}}}catch(_0x50ae67){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x38'),_0x13946c[_0xf855('0x39')]),_0x50ae67);}};exports[_0xf855('0x40')]=function(_0xa5d06b){try{if(!_[_0xf855('0x20')](channels[_0xa5d06b[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x41'),_0xa5d06b[_0xf855('0x6')]),_0xa5d06b);channels[_0xa5d06b[_0xf855('0x6')]]['musiconholdstartAt']=utils[_0xf855('0x1e')]();utils[_0xf855('0x8')](util['format'](_0xf855('0x42'),_0xa5d06b['uniqueid'],channels[_0xa5d06b[_0xf855('0x6')]]['musiconholdstartAt']));}}catch(_0x342377){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][musiconholdstart]',_0xa5d06b[_0xf855('0x6')]),_0x342377);}};exports['musiconholdstop']=function(_0x542a68){try{if(!_[_0xf855('0x20')](channels[_0x542a68[_0xf855('0x6')]])){utils['debug'](util[_0xf855('0x9')]('[%s][calls][musiconholdstop]',_0x542a68['uniqueid']),_0x542a68);if(!_[_0xf855('0x20')](channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')])){channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x44')]+=utils[_0xf855('0x33')](utils[_0xf855('0x1e')](),channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')]);utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x45'),_0x542a68[_0xf855('0x6')],channels[_0x542a68['uniqueid']]['mohtime']));delete channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')];}}}catch(_0x375c3f){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][musiconholdstop]',_0x542a68[_0xf855('0x6')]),_0x375c3f);}};exports[_0xf855('0x46')]=function(_0x5cf401){try{if(!_[_0xf855('0x20')](channels[_0x5cf401[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')]('[%s][calls][varset]',_0x5cf401[_0xf855('0x6')]),_0x5cf401);if(!_[_0xf855('0x20')](_0x5cf401['variable'][_0xf855('0x47')])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x49')]=_0x5cf401['value'];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4b')])){utils['info'](util[_0xf855('0x9')](_0xf855('0x4c'),_0x5cf401['uniqueid'],_0x5cf401['value']));channels[_0x5cf401['uniqueid']][_0xf855('0x4d')]=_0x5cf401[_0xf855('0x48')];channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x2d')]='\x22'+_0x5cf401[_0xf855('0x48')]+'\x22\x20<'+_0x5cf401[_0xf855('0x48')]+'>';}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4e')])||!_['isNil'](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4f')])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5cf401[_0xf855('0x6')],!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4e')])?'xmd-callerid-preview':'xmd-callerid',_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x2d')]=_0x5cf401[_0xf855('0x48')];}if(!_[_0xf855('0x20')](_0x5cf401['variable']['xmd-queue'])||!_[_0xf855('0x20')](_0x5cf401['variable'][_0xf855('0x50')])){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x51'),_0x5cf401[_0xf855('0x6')],!_['isNil'](_0x5cf401[_0xf855('0x4a')]['xmd-queue'])?_0xf855('0x52'):_0xf855('0x50'),_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x53')]=_0xf855('0x54');channels[_0x5cf401[_0xf855('0x6')]]['lastdata']=_0x5cf401[_0xf855('0x48')];channels[_0x5cf401['uniqueid']][_0xf855('0xb')]=!![];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x55')])){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x56'),_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401['uniqueid']]['ContactId']=_0x5cf401['value'];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')]['xmd-cdrtype'])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x57')]=_0x5cf401[_0xf855('0x48')];}if(!_['isNil'](_0x5cf401[_0xf855('0x4a')]['outboundrouteid'])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401['uniqueid']][_0xf855('0x58')]=_0x5cf401[_0xf855('0x48')];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x59')])){utils[_0xf855('0x8')](util['format'](_0xf855('0x5a'),_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]]['sipcallid']=_0x5cf401[_0xf855('0x48')];}}}catch(_0x2c99a8){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x5b'),_0x5cf401['uniqueid']),_0x2c99a8);}};exports['newexten']=function(_0x1492d6){try{if(!_[_0xf855('0x20')](channels[_0x1492d6[_0xf855('0x6')]])){utils['debug'](util['format']('[%s][calls][newexten]',_0x1492d6[_0xf855('0x6')]),_0x1492d6);utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x5c'),_0x1492d6[_0xf855('0x6')],_0x1492d6[_0xf855('0x5d')],_0x1492d6[_0xf855('0x5e')]));if(_0x1492d6['application'][_0xf855('0x5f')]()==_0xf855('0x60')&&_[_0xf855('0x61')](_0x1492d6[_0xf855('0x5e')][_0xf855('0x5f')](),_0xf855('0x62'))){var _0x39b928=_0x1492d6['appdata'][_0xf855('0x63')]('=');var _0x24a6b6=_0x39b928[0x0]['substring'](_0x39b928[0x0][_0xf855('0x64')]('(')+0x1,_0x39b928[0x0][_0xf855('0x64')](')'));var _0xd18241=_0x39b928[0x1];channels[_0x1492d6[_0xf855('0x6')]][_0x24a6b6]=_0xd18241;}if(!_[_0xf855('0x65')]([_0xf855('0x2b'),_0xf855('0x66'),'execif',_0xf855('0x60'),_0xf855('0x67')],_0x1492d6[_0xf855('0x5d')][_0xf855('0x5f')]())){channels[_0x1492d6[_0xf855('0x6')]][_0xf855('0x53')]=_0x1492d6[_0xf855('0x5d')];channels[_0x1492d6[_0xf855('0x6')]][_0xf855('0x68')]=_0x1492d6[_0xf855('0x5e')];}}}catch(_0x311986){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][newexten]',_0x1492d6[_0xf855('0x6')]),_0x311986);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0d4abec..e4eed8f 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 _0x0251=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0xd1c645,_0x259890){var _0x28f449=function(_0x1d2f98){while(--_0x1d2f98){_0xd1c645['push'](_0xd1c645['shift']());}};_0x28f449(++_0x259890);}(_0x0251,0xf9));var _0x1025=function(_0x3c1c93,_0x4a4e99){_0x3c1c93=_0x3c1c93-0x0;var _0x15ce4e=_0x0251[_0x3c1c93];return _0x15ce4e;};'use strict';var utils=require(_0x1025('0x0'));exports[_0x1025('0x1')]=function(){utils[_0x1025('0x2')](_0x1025('0x3'));};exports[_0x1025('0x4')]=function(){utils['info'](_0x1025('0x5'));};exports[_0x1025('0x6')]=function(){utils['info'](_0x1025('0x7'));};exports[_0x1025('0x8')]=function(_0x42428f){utils[_0x1025('0x8')](_0x1025('0x9'),_0x42428f);};exports[_0x1025('0xa')]=function(){utils[_0x1025('0x2')](_0x1025('0xb'));};exports[_0x1025('0xc')]=function(_0x5868b8){}; \ No newline at end of file +var _0xf2dd=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','fullybooted'];(function(_0x3fa04a,_0x1b5d83){var _0x3008bc=function(_0x36686b){while(--_0x36686b){_0x3fa04a['push'](_0x3fa04a['shift']());}};_0x3008bc(++_0x1b5d83);}(_0xf2dd,0x1aa));var _0xdf2d=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0xf2dd[_0x594e11];return _0x5418ad;};'use strict';var utils=require('./utils');exports[_0xdf2d('0x0')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x2'));};exports['shutdown']=function(){utils[_0xdf2d('0x1')]('[core]\x20shutdown');};exports[_0xdf2d('0x3')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x4'));};exports['error']=function(_0x171149){utils[_0xdf2d('0x5')](_0xdf2d('0x6'),_0x171149);};exports[_0xdf2d('0x7')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x8'));};exports[_0xdf2d('0x9')]=function(_0x5b612d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0b7e78a..47ff17f 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 _0x6935=['[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect'];(function(_0x3dacbf,_0x2299b6){var _0x3665f7=function(_0xab84e4){while(--_0xab84e4){_0x3dacbf['push'](_0x3dacbf['shift']());}};_0x3665f7(++_0x2299b6);}(_0x6935,0x6e));var _0x5693=function(_0x1e7f2f,_0x31822e){_0x1e7f2f=_0x1e7f2f-0x0;var _0x2eef07=_0x6935[_0x1e7f2f];return _0x2eef07;};'use strict';var _=require('lodash');var util=require(_0x5693('0x0'));var utils=require(_0x5693('0x1'));var dials={};function writeDB(_0x3837cf){utils[_0x5693('0x2')](util['format'](_0x5693('0x3'),_0x3837cf[_0x5693('0x4')],_0x3837cf[_0x5693('0x5')],_0x3837cf['dialstring'],_0x3837cf[_0x5693('0x6')],_0x3837cf[_0x5693('0x7')],_0x3837cf[_0x5693('0x8')]));utils[_0x5693('0x9')]('CreateVoiceDialReport',_0x3837cf);delete dials[_0x3837cf[_0x5693('0x4')]];}exports[_0x5693('0xa')]=function(_0x26a808){try{utils[_0x5693('0xb')](util['format'](_0x5693('0xc'),_0x26a808[_0x5693('0x4')]),_0x26a808);utils[_0x5693('0x2')](util[_0x5693('0xd')](_0x5693('0xe'),_0x26a808[_0x5693('0x4')],_0x26a808[_0x5693('0xf')],_0x26a808[_0x5693('0x10')]));if(_0x26a808[_0x5693('0xf')]['toLowerCase']()==_0x5693('0x11')&&_[_0x5693('0x12')](_0x26a808['appdata']['toLowerCase'](),_0x5693('0x13'))){var _0xab1e4e=_0x26a808['appdata'][_0x5693('0x14')]('=');dials[_0x26a808[_0x5693('0x4')]]={'routeId':_0xab1e4e[0x1]};}}catch(_0x217e01){utils[_0x5693('0x15')](util[_0x5693('0xd')](_0x5693('0xc'),_0x26a808[_0x5693('0x4')]),_0x217e01);}};exports['varset']=function(_0x25d1a0){try{utils[_0x5693('0xb')](util[_0x5693('0xd')](_0x5693('0x16'),_0x25d1a0[_0x5693('0x4')]),_0x25d1a0);if(!_[_0x5693('0x17')](_0x25d1a0[_0x5693('0x18')][_0x5693('0x19')])){utils[_0x5693('0x2')](util[_0x5693('0xd')](_0x5693('0x1a'),_0x25d1a0[_0x5693('0x4')],_0x25d1a0[_0x5693('0x1b')]));dials[_0x25d1a0[_0x5693('0x4')]]={'routeId':_0x25d1a0[_0x5693('0x1b')]};}}catch(_0x47626f){utils[_0x5693('0x15')](util[_0x5693('0xd')](_0x5693('0x16'),_0x25d1a0[_0x5693('0x4')]),_0x47626f);}};exports[_0x5693('0x1c')]=function(_0x6c11b){try{if(!_[_0x5693('0x17')](dials[_0x6c11b[_0x5693('0x4')]])){utils['debug'](util[_0x5693('0xd')](_0x5693('0x1d'),_0x6c11b[_0x5693('0x4')]),_0x6c11b);dials[_0x6c11b[_0x5693('0x4')]]=_[_0x5693('0x1e')](dials[_0x6c11b[_0x5693('0x4')]],_0x6c11b);dials[_0x6c11b[_0x5693('0x4')]][_0x5693('0x1f')]=utils[_0x5693('0x20')]();dials[_0x6c11b[_0x5693('0x4')]]['lastevent']='called';utils['info'](util[_0x5693('0xd')](_0x5693('0x21'),_0x6c11b[_0x5693('0x4')],dials[_0x6c11b[_0x5693('0x4')]]['starttime']));}}catch(_0x10fa98){utils[_0x5693('0x15')](util[_0x5693('0xd')](_0x5693('0x1d'),_0x6c11b[_0x5693('0x4')]),_0x10fa98);}};exports[_0x5693('0x22')]=function(_0x2a5c81){try{if(!_['isNil'](dials[_0x2a5c81[_0x5693('0x4')]])){utils[_0x5693('0xb')](util[_0x5693('0xd')](_0x5693('0x23'),_0x2a5c81['uniqueid']),_0x2a5c81);dials[_0x2a5c81[_0x5693('0x4')]][_0x5693('0x8')]=_0x2a5c81[_0x5693('0x8')];if(_0x2a5c81['dialstatus']==_0x5693('0x24')){dials[_0x2a5c81[_0x5693('0x4')]]=_[_0x5693('0x1e')](dials[_0x2a5c81['uniqueid']],_0x2a5c81);dials[_0x2a5c81[_0x5693('0x4')]][_0x5693('0x25')]=utils[_0x5693('0x20')]();dials[_0x2a5c81[_0x5693('0x4')]]['lastevent']=_0x5693('0x26');utils['info'](util[_0x5693('0xd')](_0x5693('0x27'),_0x2a5c81[_0x5693('0x4')],_0x2a5c81[_0x5693('0x8')],dials[_0x2a5c81[_0x5693('0x4')]]['answertime']));}else{utils[_0x5693('0x2')](util[_0x5693('0xd')](_0x5693('0x28'),_0x2a5c81[_0x5693('0x4')],_0x2a5c81[_0x5693('0x8')]));}}}catch(_0x112b9c){utils[_0x5693('0x15')](util[_0x5693('0xd')](_0x5693('0x23'),_0x2a5c81[_0x5693('0x4')]),_0x112b9c);}};exports['hangup']=function(_0x17074c){try{if(!_['isNil'](dials[_0x17074c[_0x5693('0x4')]])){utils[_0x5693('0xb')](util[_0x5693('0xd')](_0x5693('0x29'),_0x17074c['uniqueid']),_0x17074c);utils[_0x5693('0x2')](util[_0x5693('0xd')](_0x5693('0x2a'),_0x17074c[_0x5693('0x4')],_0x17074c[_0x5693('0x6')],_0x17074c[_0x5693('0x2b')],_0x17074c[_0x5693('0x2c')]));dials[_0x17074c[_0x5693('0x4')]]=_['assign'](dials[_0x17074c[_0x5693('0x4')]],{'endtime':utils[_0x5693('0x20')](),'lastevent':_0x5693('0x2d')});dials[_0x17074c['uniqueid']][_0x5693('0x2e')]=utils[_0x5693('0x2f')](dials[_0x17074c[_0x5693('0x4')]][_0x5693('0x30')],dials[_0x17074c[_0x5693('0x4')]][_0x5693('0x1f')]);dials[_0x17074c[_0x5693('0x4')]][_0x5693('0x31')]=utils[_0x5693('0x2f')](dials[_0x17074c['uniqueid']]['answertime']||dials[_0x17074c['uniqueid']][_0x5693('0x30')],dials[_0x17074c['uniqueid']][_0x5693('0x1f')]);dials[_0x17074c['uniqueid']]['billableseconds']=dials[_0x17074c['uniqueid']][_0x5693('0x25')]?utils[_0x5693('0x2f')](dials[_0x17074c[_0x5693('0x4')]][_0x5693('0x30')],dials[_0x17074c[_0x5693('0x4')]][_0x5693('0x25')]):0x0;writeDB(dials[_0x17074c[_0x5693('0x4')]]);}}catch(_0x6c8fb9){utils[_0x5693('0x15')](util[_0x5693('0xd')]('[%s][dials][hangup]',_0x17074c[_0x5693('0x4')]),_0x6c8fb9);}}; \ No newline at end of file +var _0x2ee7=['[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','uniqueid','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','error','varset','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','isNil','[%s][dials][dialbegin]','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','now'];(function(_0x1672fb,_0x2ec0db){var _0x31a6e6=function(_0x53585a){while(--_0x53585a){_0x1672fb['push'](_0x1672fb['shift']());}};_0x31a6e6(++_0x2ec0db);}(_0x2ee7,0x10c));var _0x72ee=function(_0x4e1280,_0x3b8e04){_0x4e1280=_0x4e1280-0x0;var _0x59c5f=_0x2ee7[_0x4e1280];return _0x59c5f;};'use strict';var _=require(_0x72ee('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x3aeeab){utils['info'](util['format'](_0x72ee('0x1'),_0x3aeeab['uniqueid'],_0x3aeeab[_0x72ee('0x2')],_0x3aeeab[_0x72ee('0x3')],_0x3aeeab[_0x72ee('0x4')],_0x3aeeab['connectedlinenum'],_0x3aeeab[_0x72ee('0x5')]));utils[_0x72ee('0x6')](_0x72ee('0x7'),_0x3aeeab);delete dials[_0x3aeeab['uniqueid']];}exports['newexten']=function(_0x588e0b){try{utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0xa'),_0x588e0b[_0x72ee('0xb')]),_0x588e0b);utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0xd'),_0x588e0b[_0x72ee('0xb')],_0x588e0b[_0x72ee('0xe')],_0x588e0b[_0x72ee('0xf')]));if(_0x588e0b[_0x72ee('0xe')]['toLowerCase']()=='set'&&_[_0x72ee('0x10')](_0x588e0b[_0x72ee('0xf')][_0x72ee('0x11')](),'cdr(routeid)')){var _0x5af812=_0x588e0b[_0x72ee('0xf')][_0x72ee('0x12')]('=');dials[_0x588e0b[_0x72ee('0xb')]]={'routeId':_0x5af812[0x1]};}}catch(_0x34a673){utils[_0x72ee('0x13')](util[_0x72ee('0x9')](_0x72ee('0xa'),_0x588e0b['uniqueid']),_0x34a673);}};exports[_0x72ee('0x14')]=function(_0x3c3142){try{utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x15'),_0x3c3142['uniqueid']),_0x3c3142);if(!_['isNil'](_0x3c3142['variable']['outboundrouteid'])){utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0x16'),_0x3c3142[_0x72ee('0xb')],_0x3c3142['value']));dials[_0x3c3142[_0x72ee('0xb')]]={'routeId':_0x3c3142['value']};}}catch(_0x45fb8f){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][varset]',_0x3c3142['uniqueid']),_0x45fb8f);}};exports['dialbegin']=function(_0x14d721){try{if(!_[_0x72ee('0x17')](dials[_0x14d721['uniqueid']])){utils['debug'](util[_0x72ee('0x9')](_0x72ee('0x18'),_0x14d721[_0x72ee('0xb')]),_0x14d721);dials[_0x14d721[_0x72ee('0xb')]]=_['assign'](dials[_0x14d721[_0x72ee('0xb')]],_0x14d721);dials[_0x14d721[_0x72ee('0xb')]]['starttime']=utils['now']();dials[_0x14d721[_0x72ee('0xb')]][_0x72ee('0x19')]='called';utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0x1a'),_0x14d721[_0x72ee('0xb')],dials[_0x14d721['uniqueid']]['starttime']));}}catch(_0x52246d){utils[_0x72ee('0x13')](util[_0x72ee('0x9')](_0x72ee('0x18'),_0x14d721[_0x72ee('0xb')]),_0x52246d);}};exports[_0x72ee('0x1b')]=function(_0x31666a){try{if(!_[_0x72ee('0x17')](dials[_0x31666a[_0x72ee('0xb')]])){utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x1c'),_0x31666a[_0x72ee('0xb')]),_0x31666a);dials[_0x31666a[_0x72ee('0xb')]]['dialstatus']=_0x31666a[_0x72ee('0x5')];if(_0x31666a[_0x72ee('0x5')]==_0x72ee('0x1d')){dials[_0x31666a[_0x72ee('0xb')]]=_[_0x72ee('0x1e')](dials[_0x31666a[_0x72ee('0xb')]],_0x31666a);dials[_0x31666a['uniqueid']][_0x72ee('0x1f')]=utils[_0x72ee('0x20')]();dials[_0x31666a[_0x72ee('0xb')]][_0x72ee('0x19')]='connect';utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x31666a[_0x72ee('0xb')],_0x31666a[_0x72ee('0x5')],dials[_0x31666a[_0x72ee('0xb')]][_0x72ee('0x1f')]));}else{utils['info'](util[_0x72ee('0x9')](_0x72ee('0x21'),_0x31666a[_0x72ee('0xb')],_0x31666a[_0x72ee('0x5')]));}}}catch(_0x12c3bd){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][dialend]',_0x31666a[_0x72ee('0xb')]),_0x12c3bd);}};exports['hangup']=function(_0x79848f){try{if(!_[_0x72ee('0x17')](dials[_0x79848f[_0x72ee('0xb')]])){utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x22'),_0x79848f['uniqueid']),_0x79848f);utils[_0x72ee('0xc')](util[_0x72ee('0x9')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x79848f['uniqueid'],_0x79848f[_0x72ee('0x4')],_0x79848f[_0x72ee('0x23')],_0x79848f[_0x72ee('0x24')]));dials[_0x79848f[_0x72ee('0xb')]]=_[_0x72ee('0x1e')](dials[_0x79848f['uniqueid']],{'endtime':utils[_0x72ee('0x20')](),'lastevent':'complete'});dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x25')]=utils[_0x72ee('0x26')](dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x27')],dials[_0x79848f['uniqueid']][_0x72ee('0x28')]);dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x29')]=utils['diffTime'](dials[_0x79848f['uniqueid']][_0x72ee('0x1f')]||dials[_0x79848f['uniqueid']][_0x72ee('0x27')],dials[_0x79848f['uniqueid']][_0x72ee('0x28')]);dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x2a')]=dials[_0x79848f[_0x72ee('0xb')]]['answertime']?utils['diffTime'](dials[_0x79848f['uniqueid']][_0x72ee('0x27')],dials[_0x79848f[_0x72ee('0xb')]]['answertime']):0x0;writeDB(dials[_0x79848f[_0x72ee('0xb')]]);}}catch(_0x36afd3){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][hangup]',_0x79848f[_0x72ee('0xb')]),_0x36afd3);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c4bee48..0ce2d6b 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 _0x3a94=['asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','device','devicestatechange','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','production'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x3a94,0x1a4));var _0x43a9=function(_0x1471bb,_0x2a614f){_0x1471bb=_0x1471bb-0x0;var _0x2a9b7e=_0x3a94[_0x1471bb];return _0x2a9b7e;};var AsteriskManager=require(_0x43a9('0x0'));var config=require(_0x43a9('0x1'));var utils=require(_0x43a9('0x2'));var util=require('util');var isXDREnabled=config[_0x43a9('0x3')]&&config[_0x43a9('0x3')][_0x43a9('0x4')]?!config[_0x43a9('0x3')][_0x43a9('0x4')]:!![];var isProduction=config['env']===_0x43a9('0x5')||![];var isLocalAsterisk=config[_0x43a9('0x3')]&&config[_0x43a9('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x43a9('0x6')][_0x43a9('0x7')],config['asterisk']['ip'],config[_0x43a9('0x6')][_0x43a9('0x8')],config[_0x43a9('0x6')][_0x43a9('0x9')],!![]);ami[_0x43a9('0xa')]();if(!isXDREnabled){utils[_0x43a9('0xb')](_0x43a9('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x43a9('0xd'));}else{var agents=require(_0x43a9('0xe'));var calls=require(_0x43a9('0xf'));var queues=require('./queues.controller');var recordings=require(_0x43a9('0x10'));var members=require(_0x43a9('0x11'));var dials=require(_0x43a9('0x12'));var transfers=require(_0x43a9('0x13'));var core=require(_0x43a9('0x14'));ami['on']('connect',core[_0x43a9('0x15')]);ami['on'](_0x43a9('0x16'),core[_0x43a9('0x16')]);ami['on']('fullybooted',core[_0x43a9('0x17')]);ami['on'](_0x43a9('0x18'),core['error']);ami['on'](_0x43a9('0x19'),core[_0x43a9('0x19')]);ami['on']('managerevent',core[_0x43a9('0x1a')]);ami['on']('devicestatechange',function(_0x336fd6){try{utils['debug'](util[_0x43a9('0x1b')]('[%s][index][devicestatechange]',_0x336fd6[_0x43a9('0x1c')]),_0x336fd6);members[_0x43a9('0x1d')](_0x336fd6);}catch(_0x201d91){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][devicestatechange]',_0x336fd6[_0x43a9('0x1c')]),_0x201d91);}});ami['on'](_0x43a9('0x1e'),function(_0x11d1c4){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')]('[%s][index][agentcalled]',_0x11d1c4['uniqueid']),_0x11d1c4);agents[_0x43a9('0x1e')](_0x11d1c4);}catch(_0x911ac7){utils['error'](util['format'](_0x43a9('0x20'),_0x11d1c4[_0x43a9('0x21')]),_0x911ac7);}});ami['on']('agentringnoanswer',function(_0x1f2913){try{utils[_0x43a9('0x1f')](util['format']('[%s][index][agentringnoanswer]',_0x1f2913[_0x43a9('0x21')]),_0x1f2913);agents[_0x43a9('0x22')](_0x1f2913);}catch(_0x28a8a4){utils[_0x43a9('0x18')](util['format'](_0x43a9('0x23'),_0x1f2913[_0x43a9('0x21')]),_0x28a8a4);}});ami['on'](_0x43a9('0x24'),function(_0x1c229d){try{utils['debug'](util['format'](_0x43a9('0x25'),_0x1c229d[_0x43a9('0x21')]),_0x1c229d);agents[_0x43a9('0x24')](_0x1c229d);queues['agentconnect'](_0x1c229d);}catch(_0x497944){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][agentconnect]',_0x1c229d[_0x43a9('0x21')]),_0x497944);}});ami['on']('agentcomplete',function(_0x306e31){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')]('[%s][index][agentcomplete]',_0x306e31[_0x43a9('0x21')]),_0x306e31);agents[_0x43a9('0x26')](_0x306e31);queues[_0x43a9('0x26')](_0x306e31);members[_0x43a9('0x26')](_0x306e31);}catch(_0x2d39e1){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x27'),_0x306e31[_0x43a9('0x21')]),_0x2d39e1);}});ami['on']('queuecallerabandon',function(_0x275862){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x28'),_0x275862[_0x43a9('0x21')]),_0x275862);agents[_0x43a9('0x29')](_0x275862);queues[_0x43a9('0x29')](_0x275862);}catch(_0x17c757){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][queuecallerabandon]',_0x275862['uniqueid']),_0x17c757);}});ami['on']('queuecallerjoin',function(_0x184569){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x2a'),_0x184569['uniqueid']),_0x184569);queues[_0x43a9('0x2b')](_0x184569);recordings[_0x43a9('0x2b')](_0x184569);}catch(_0x4c0c0b){utils[_0x43a9('0x18')](util['format'](_0x43a9('0x2a'),_0x184569[_0x43a9('0x21')]),_0x4c0c0b);}});ami['on'](_0x43a9('0x2c'),function(_0x184c0d){try{utils['debug'](util['format'](_0x43a9('0x2d'),_0x184c0d[_0x43a9('0x21')]),_0x184c0d);queues['queuecallerleave'](_0x184c0d);}catch(_0x478c63){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x2d'),_0x184c0d[_0x43a9('0x21')]),_0x478c63);}});ami['on'](_0x43a9('0x2e'),function(_0x1e00be){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x2f'),_0x1e00be[_0x43a9('0x21')]),_0x1e00be);queues['musiconholdstart'](_0x1e00be);calls[_0x43a9('0x2e')](_0x1e00be);}catch(_0xb8f2a3){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x2f'),_0x1e00be[_0x43a9('0x21')]),_0xb8f2a3);}});ami['on'](_0x43a9('0x30'),function(_0x553d9e){try{utils[_0x43a9('0x1f')](util['format']('[%s][index][musiconholdstop]',_0x553d9e[_0x43a9('0x21')]),_0x553d9e);queues[_0x43a9('0x30')](_0x553d9e);calls[_0x43a9('0x30')](_0x553d9e);}catch(_0x191448){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x31'),_0x553d9e[_0x43a9('0x21')]),_0x191448);}});ami['on']('newstate',function(_0x467c77){try{utils['debug'](util[_0x43a9('0x1b')]('[%s][index][newstate]',_0x467c77[_0x43a9('0x21')]),_0x467c77);calls[_0x43a9('0x32')](_0x467c77);recordings[_0x43a9('0x32')](_0x467c77);}catch(_0x2842ed){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x33'),_0x467c77[_0x43a9('0x21')]),_0x2842ed);}});ami['on']('hangup',function(_0x163c0f){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x34'),_0x163c0f[_0x43a9('0x21')]),_0x163c0f);calls[_0x43a9('0x35')](_0x163c0f);recordings[_0x43a9('0x35')](_0x163c0f);dials['hangup'](_0x163c0f);agents[_0x43a9('0x35')](_0x163c0f);queues[_0x43a9('0x35')](_0x163c0f);}catch(_0x3cb5f8){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x34'),_0x163c0f['uniqueid']),_0x3cb5f8);}});ami['on'](_0x43a9('0x36'),function(_0xf43426){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')]('[%s][index][cdr]',_0xf43426[_0x43a9('0x21')]),_0xf43426);members['cdr'](_0xf43426);}catch(_0x1d50e7){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][cdr]',_0xf43426[_0x43a9('0x21')]),_0x1d50e7);}});ami['on'](_0x43a9('0x37'),function(_0xb823d1){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x38'),_0xb823d1[_0x43a9('0x21')]),_0xb823d1);queues[_0x43a9('0x37')](_0xb823d1);agents[_0x43a9('0x37')](_0xb823d1);transfers[_0x43a9('0x37')](_0xb823d1);recordings['blindtransfer'](_0xb823d1);}catch(_0x63de72){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x38'),_0xb823d1[_0x43a9('0x21')]),_0x63de72);}});ami['on']('attendedtransfer',function(_0x3eb96e){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x39'),_0x3eb96e[_0x43a9('0x3a')]),_0x3eb96e);queues[_0x43a9('0x3b')](_0x3eb96e);transfers[_0x43a9('0x3b')](_0x3eb96e);agents[_0x43a9('0x3b')](_0x3eb96e);calls[_0x43a9('0x3b')](_0x3eb96e);}catch(_0x31037a){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')](_0x43a9('0x39'),_0x3eb96e['origtransfereruniqueid']),_0x31037a);}});ami['on'](_0x43a9('0x3c'),function(_0x2b6122){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x3d'),_0x2b6122[_0x43a9('0x21')]),_0x2b6122);queues[_0x43a9('0x3c')](_0x2b6122);recordings[_0x43a9('0x3c')](_0x2b6122);calls['varset'](_0x2b6122);dials[_0x43a9('0x3c')](_0x2b6122);}catch(_0x14c6b9){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][varset]',_0x2b6122[_0x43a9('0x21')]),_0x14c6b9);}});ami['on'](_0x43a9('0x3e'),function(_0x27e75c){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x3f'),_0x27e75c[_0x43a9('0x21')]),_0x27e75c);calls[_0x43a9('0x3e')](_0x27e75c);recordings[_0x43a9('0x3e')](_0x27e75c);dials[_0x43a9('0x3e')](_0x27e75c);}catch(_0x9350e6){utils['error'](util['format'](_0x43a9('0x3f'),_0x27e75c['uniqueid']),_0x9350e6);}});ami['on'](_0x43a9('0x40'),function(_0x2789ad){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x41'),_0x2789ad[_0x43a9('0x21')]),_0x2789ad);calls[_0x43a9('0x40')](_0x2789ad);recordings['newchannel'](_0x2789ad);}catch(_0x12d1b8){utils[_0x43a9('0x18')](util[_0x43a9('0x1b')]('[%s][index][newchannel]',_0x2789ad[_0x43a9('0x21')]),_0x12d1b8);}});ami['on']('dialbegin',function(_0x5c94fd){try{utils[_0x43a9('0x1f')](util[_0x43a9('0x1b')](_0x43a9('0x42'),_0x5c94fd[_0x43a9('0x21')]),_0x5c94fd);dials[_0x43a9('0x43')](_0x5c94fd);}catch(_0x4ac9f9){utils['error'](util[_0x43a9('0x1b')](_0x43a9('0x44'),_0x5c94fd[_0x43a9('0x21')]),_0x4ac9f9);}});ami['on'](_0x43a9('0x45'),function(_0x456ec8){try{utils['debug'](util[_0x43a9('0x1b')]('[%s][index][dialend]',_0x456ec8[_0x43a9('0x21')]),_0x456ec8);dials[_0x43a9('0x45')](_0x456ec8);}catch(_0x4c0389){utils[_0x43a9('0x18')](util['format'](_0x43a9('0x46'),_0x456ec8['uniqueid']),_0x4c0389);}});} \ No newline at end of file +var _0xcbd9=['connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','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][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','disabled','env','production','xdr','local','asterisk','port','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller'];(function(_0x47f979,_0x4945fc){var _0x4d09d6=function(_0x323161){while(--_0x323161){_0x47f979['push'](_0x47f979['shift']());}};_0x4d09d6(++_0x4945fc);}(_0xcbd9,0x13a));var _0x9cbd=function(_0x5abd08,_0x198424){_0x5abd08=_0x5abd08-0x0;var _0x3c1dcd=_0xcbd9[_0x5abd08];return _0x3c1dcd;};var AsteriskManager=require(_0x9cbd('0x0'));var config=require('../../config/environment');var utils=require(_0x9cbd('0x1'));var util=require('util');var isXDREnabled=config['xdr']&&config['xdr'][_0x9cbd('0x2')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x9cbd('0x3')]===_0x9cbd('0x4')||![];var isLocalAsterisk=config['xdr']&&config[_0x9cbd('0x5')][_0x9cbd('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x9cbd('0x7')][_0x9cbd('0x8')],config[_0x9cbd('0x7')]['ip'],config[_0x9cbd('0x7')]['username'],config[_0x9cbd('0x7')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x9cbd('0x9')](_0x9cbd('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x9cbd('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x9cbd('0xb'));var queues=require('./queues.controller');var recordings=require(_0x9cbd('0xc'));var members=require(_0x9cbd('0xd'));var dials=require(_0x9cbd('0xe'));var transfers=require(_0x9cbd('0xf'));var core=require('./core.controller');ami['on']('connect',core[_0x9cbd('0x10')]);ami['on'](_0x9cbd('0x11'),core[_0x9cbd('0x11')]);ami['on'](_0x9cbd('0x12'),core[_0x9cbd('0x12')]);ami['on'](_0x9cbd('0x13'),core[_0x9cbd('0x13')]);ami['on']('close',core[_0x9cbd('0x14')]);ami['on'](_0x9cbd('0x15'),core[_0x9cbd('0x15')]);ami['on'](_0x9cbd('0x16'),function(_0x905f2f){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x19'),_0x905f2f['device']),_0x905f2f);members[_0x9cbd('0x16')](_0x905f2f);}catch(_0x20ffcb){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x19'),_0x905f2f[_0x9cbd('0x1a')]),_0x20ffcb);}});ami['on'](_0x9cbd('0x1b'),function(_0x306c50){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][agentcalled]',_0x306c50[_0x9cbd('0x1c')]),_0x306c50);agents[_0x9cbd('0x1b')](_0x306c50);}catch(_0xfc4ae1){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentcalled]',_0x306c50[_0x9cbd('0x1c')]),_0xfc4ae1);}});ami['on'](_0x9cbd('0x1d'),function(_0x3d88da){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x1e'),_0x3d88da[_0x9cbd('0x1c')]),_0x3d88da);agents[_0x9cbd('0x1d')](_0x3d88da);}catch(_0x5bf116){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentringnoanswer]',_0x3d88da[_0x9cbd('0x1c')]),_0x5bf116);}});ami['on'](_0x9cbd('0x1f'),function(_0x1aec3b){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x20'),_0x1aec3b[_0x9cbd('0x1c')]),_0x1aec3b);agents[_0x9cbd('0x1f')](_0x1aec3b);queues['agentconnect'](_0x1aec3b);}catch(_0x4c2259){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x20'),_0x1aec3b[_0x9cbd('0x1c')]),_0x4c2259);}});ami['on'](_0x9cbd('0x21'),function(_0x18f984){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x22'),_0x18f984[_0x9cbd('0x1c')]),_0x18f984);agents[_0x9cbd('0x21')](_0x18f984);queues[_0x9cbd('0x21')](_0x18f984);members[_0x9cbd('0x21')](_0x18f984);}catch(_0x1a48ae){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentcomplete]',_0x18f984[_0x9cbd('0x1c')]),_0x1a48ae);}});ami['on'](_0x9cbd('0x23'),function(_0x2b753d){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x24'),_0x2b753d[_0x9cbd('0x1c')]),_0x2b753d);agents[_0x9cbd('0x23')](_0x2b753d);queues[_0x9cbd('0x23')](_0x2b753d);}catch(_0xeb10af){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x24'),_0x2b753d['uniqueid']),_0xeb10af);}});ami['on']('queuecallerjoin',function(_0x1f25eb){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x25'),_0x1f25eb[_0x9cbd('0x1c')]),_0x1f25eb);queues[_0x9cbd('0x26')](_0x1f25eb);recordings['queuecallerjoin'](_0x1f25eb);}catch(_0x496109){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x25'),_0x1f25eb[_0x9cbd('0x1c')]),_0x496109);}});ami['on'](_0x9cbd('0x27'),function(_0x541f65){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')]('[%s][index][queuecallerleave]',_0x541f65['uniqueid']),_0x541f65);queues[_0x9cbd('0x27')](_0x541f65);}catch(_0x13aae0){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x28'),_0x541f65[_0x9cbd('0x1c')]),_0x13aae0);}});ami['on'](_0x9cbd('0x29'),function(_0x4ca122){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][musiconholdstart]',_0x4ca122[_0x9cbd('0x1c')]),_0x4ca122);queues[_0x9cbd('0x29')](_0x4ca122);calls[_0x9cbd('0x29')](_0x4ca122);}catch(_0x464bdd){utils[_0x9cbd('0x13')](util['format']('[%s][index][musiconholdstart]',_0x4ca122['uniqueid']),_0x464bdd);}});ami['on']('musiconholdstop',function(_0x59ace8){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x2a'),_0x59ace8[_0x9cbd('0x1c')]),_0x59ace8);queues[_0x9cbd('0x2b')](_0x59ace8);calls[_0x9cbd('0x2b')](_0x59ace8);}catch(_0x2e26e6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x2a'),_0x59ace8['uniqueid']),_0x2e26e6);}});ami['on'](_0x9cbd('0x2c'),function(_0x4ce739){try{utils['debug'](util[_0x9cbd('0x18')](_0x9cbd('0x2d'),_0x4ce739[_0x9cbd('0x1c')]),_0x4ce739);calls['newstate'](_0x4ce739);recordings['newstate'](_0x4ce739);}catch(_0x5476b6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x2d'),_0x4ce739[_0x9cbd('0x1c')]),_0x5476b6);}});ami['on']('hangup',function(_0x227f93){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')]('[%s][index][hangup]',_0x227f93[_0x9cbd('0x1c')]),_0x227f93);calls['hangup'](_0x227f93);recordings[_0x9cbd('0x2e')](_0x227f93);dials['hangup'](_0x227f93);agents[_0x9cbd('0x2e')](_0x227f93);queues['hangup'](_0x227f93);}catch(_0x1a550b){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x2f'),_0x227f93['uniqueid']),_0x1a550b);}});ami['on'](_0x9cbd('0x30'),function(_0x1da2ee){try{utils['debug'](util['format'](_0x9cbd('0x31'),_0x1da2ee[_0x9cbd('0x1c')]),_0x1da2ee);members['cdr'](_0x1da2ee);}catch(_0x41abdd){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x31'),_0x1da2ee[_0x9cbd('0x1c')]),_0x41abdd);}});ami['on'](_0x9cbd('0x32'),function(_0x35f31a){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][blindtransfer]',_0x35f31a[_0x9cbd('0x1c')]),_0x35f31a);queues[_0x9cbd('0x32')](_0x35f31a);agents[_0x9cbd('0x32')](_0x35f31a);transfers[_0x9cbd('0x32')](_0x35f31a);recordings['blindtransfer'](_0x35f31a);}catch(_0x96389e){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x33'),_0x35f31a[_0x9cbd('0x1c')]),_0x96389e);}});ami['on'](_0x9cbd('0x34'),function(_0x97dfe9){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x35'),_0x97dfe9[_0x9cbd('0x36')]),_0x97dfe9);queues[_0x9cbd('0x34')](_0x97dfe9);transfers[_0x9cbd('0x34')](_0x97dfe9);agents[_0x9cbd('0x34')](_0x97dfe9);calls['attendedtransfer'](_0x97dfe9);}catch(_0x18f368){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x35'),_0x97dfe9[_0x9cbd('0x36')]),_0x18f368);}});ami['on'](_0x9cbd('0x37'),function(_0x502650){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x38'),_0x502650[_0x9cbd('0x1c')]),_0x502650);queues[_0x9cbd('0x37')](_0x502650);recordings['varset'](_0x502650);calls[_0x9cbd('0x37')](_0x502650);dials[_0x9cbd('0x37')](_0x502650);}catch(_0x6970e2){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x38'),_0x502650[_0x9cbd('0x1c')]),_0x6970e2);}});ami['on'](_0x9cbd('0x39'),function(_0x219e83){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x3a'),_0x219e83[_0x9cbd('0x1c')]),_0x219e83);calls[_0x9cbd('0x39')](_0x219e83);recordings[_0x9cbd('0x39')](_0x219e83);dials[_0x9cbd('0x39')](_0x219e83);}catch(_0x3c6def){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x3a'),_0x219e83[_0x9cbd('0x1c')]),_0x3c6def);}});ami['on'](_0x9cbd('0x3b'),function(_0x2a4c83){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x3c'),_0x2a4c83[_0x9cbd('0x1c')]),_0x2a4c83);calls[_0x9cbd('0x3b')](_0x2a4c83);recordings['newchannel'](_0x2a4c83);}catch(_0x595be6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][newchannel]',_0x2a4c83[_0x9cbd('0x1c')]),_0x595be6);}});ami['on'](_0x9cbd('0x3d'),function(_0xb28067){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x3e'),_0xb28067[_0x9cbd('0x1c')]),_0xb28067);dials['dialbegin'](_0xb28067);}catch(_0x25cfcb){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x3f'),_0xb28067[_0x9cbd('0x1c')]),_0x25cfcb);}});ami['on'](_0x9cbd('0x40'),function(_0x4f3e78){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x41'),_0x4f3e78[_0x9cbd('0x1c')]),_0x4f3e78);dials[_0x9cbd('0x40')](_0x4f3e78);}catch(_0x525392){utils['error'](util['format'](_0x9cbd('0x41'),_0x4f3e78[_0x9cbd('0x1c')]),_0x525392);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 93e4b12..1230260 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 _0x8413=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','destinationchannel','[%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','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','voice','now'];(function(_0x238d5c,_0x3bea15){var _0x491e4c=function(_0x14dafb){while(--_0x14dafb){_0x238d5c['push'](_0x238d5c['shift']());}};_0x491e4c(++_0x3bea15);}(_0x8413,0x7b));var _0x3841=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8413[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3841('0x0'));var util=require(_0x3841('0x1'));var utils=require(_0x3841('0x2'));var members={};var exclude=[_0x3841('0x3'),_0x3841('0x4')];function writeDB(_0x103256){utils[_0x3841('0x5')](util[_0x3841('0x6')](_0x3841('0x7'),_0x103256['uniqueid'],_0x103256[_0x3841('0x8')],_0x103256[_0x3841('0x9')],_0x103256[_0x3841('0xa')],_0x103256[_0x3841('0xb')],_0x103256[_0x3841('0xc')]));if(_0x103256['interface']){utils[_0x3841('0xd')](_0x103256['interface'])[_0x3841('0xe')](function(_0x1bd1b3){if(_0x1bd1b3){_0x103256[_0x3841('0xb')]=_0x1bd1b3[_0x3841('0xf')];_0x103256[_0x3841('0x10')]=_0x1bd1b3['internal'];utils[_0x3841('0x11')](_0x3841('0x12'),_0x103256);}else{utils['getUserByName'](_0x103256[_0x3841('0x8')][_0x3841('0x13')]('/')[0x1])[_0x3841('0xe')](function(_0xca4ef6){if(_0xca4ef6){_0x103256[_0x3841('0xb')]=_0xca4ef6[_0x3841('0xf')];_0x103256['internal']=_0xca4ef6[_0x3841('0x10')];utils[_0x3841('0x11')]('CreateMemberReport',_0x103256);}});}})[_0x3841('0x14')](function(_0x16a67a){utils[_0x3841('0x15')](util[_0x3841('0x6')](_0x3841('0x16'),_0x103256[_0x3841('0x17')]),_0x16a67a);});}delete members[_0x103256['interface']];}function startsWith(_0xb43c98,_0x577cf3){return _[_0x3841('0x18')](_0xb43c98,function(_0x558a05){return _[_0x3841('0x19')](_0x577cf3,_0x558a05);});}exports[_0x3841('0x1a')]=function(_0x52224f){try{utils['debug'](util[_0x3841('0x6')](_0x3841('0x1b'),members[_0x52224f[_0x3841('0x1c')]]?members[_0x52224f[_0x3841('0x1c')]][_0x3841('0x17')]:_0x52224f[_0x3841('0x1c')]),_0x52224f);utils['info'](util[_0x3841('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x52224f[_0x3841('0x1c')]]?members[_0x52224f[_0x3841('0x1c')]]['uniqueid']:_0x52224f['device'],_0x52224f[_0x3841('0x1d')],_0x52224f['device']));switch(_0x52224f[_0x3841('0x1d')]){case _0x3841('0x1e'):case'BUSY':if(!startsWith(exclude,_0x52224f[_0x3841('0x1c')])){members[_0x52224f[_0x3841('0x1c')]]={'channel':_0x3841('0x1f'),'interface':_0x52224f['device'],'type':'TALKING','enterAt':utils[_0x3841('0x20')](),'role':_0x3841('0x21')};}break;case _0x3841('0x22'):if(!_[_0x3841('0x23')](members[_0x52224f[_0x3841('0x1c')]])){members[_0x52224f[_0x3841('0x1c')]][_0x3841('0x24')]=utils[_0x3841('0x20')]();members[_0x52224f['device']][_0x3841('0x25')]=utils[_0x3841('0x26')](members[_0x52224f[_0x3841('0x1c')]][_0x3841('0x24')],members[_0x52224f[_0x3841('0x1c')]]['enterAt']);if(members[_0x52224f[_0x3841('0x1c')]]['uniqueid']){writeDB(members[_0x52224f['device']]);}}break;default:break;}}catch(_0x143519){utils[_0x3841('0x15')](util['format'](_0x3841('0x1b'),members[_0x52224f[_0x3841('0x1c')]]?members[_0x52224f[_0x3841('0x1c')]][_0x3841('0x17')]:_0x52224f[_0x3841('0x1c')]),_0x143519);}};exports['agentcomplete']=function(_0x296cdd){try{if(!_[_0x3841('0x23')](members[_0x296cdd[_0x3841('0x8')]])){utils[_0x3841('0x27')](util[_0x3841('0x6')](_0x3841('0x28'),_0x296cdd[_0x3841('0x17')]),_0x296cdd);utils['info'](util[_0x3841('0x6')](_0x3841('0x29'),_0x296cdd[_0x3841('0x17')],_0x296cdd[_0x3841('0x8')],_0x296cdd[_0x3841('0x2a')]));members[_0x296cdd[_0x3841('0x8')]]=_[_0x3841('0x2b')](members[_0x296cdd['interface']],{'data4':_0x296cdd[_0x3841('0x2a')],'uniqueid':_0x296cdd[_0x3841('0x17')]});}}catch(_0x1896da){utils[_0x3841('0x15')](util['format'](_0x3841('0x28'),_0x296cdd[_0x3841('0x17')]),_0x1896da);}};exports[_0x3841('0x2c')]=function(_0x6197f2){try{utils[_0x3841('0x27')](util[_0x3841('0x6')](_0x3841('0x2d'),_0x6197f2['uniqueid']),_0x6197f2);if(_0x6197f2['channel']){var _0x3adb90=_0x6197f2[_0x3841('0x9')]['split']('-')[0x0];if(!_[_0x3841('0x23')](members[_0x3adb90])){members[_0x3adb90]=_['assign'](members[_0x3adb90],{'data1':members[_0x3adb90][_0x3841('0x2e')]||_0x6197f2[_0x3841('0xc')],'data2':members[_0x3adb90][_0x3841('0xa')]||_0x6197f2[_0x3841('0x2f')],'data3':members[_0x3adb90][_0x3841('0x30')]||_0x6197f2[_0x3841('0x31')],'uniqueid':members[_0x3adb90][_0x3841('0x17')]||_0x6197f2[_0x3841('0x17')]});utils[_0x3841('0x5')](util[_0x3841('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x6197f2[_0x3841('0x17')],members[_0x3adb90][_0x3841('0x2e')],members[_0x3adb90]['data2'],members[_0x3adb90][_0x3841('0x30')]));if(members[_0x3adb90][_0x3841('0x24')]){writeDB(members[_0x3adb90]);}}}if(_0x6197f2['destinationchannel']){var _0x9755aa=_0x6197f2[_0x3841('0x32')][_0x3841('0x13')]('-')[0x0];if(!_[_0x3841('0x23')](members[_0x9755aa])){members[_0x9755aa]=_[_0x3841('0x2b')](members[_0x9755aa],{'data1':members[_0x9755aa][_0x3841('0x2e')]||_0x6197f2[_0x3841('0xc')],'data2':members[_0x9755aa][_0x3841('0xa')]||_0x6197f2[_0x3841('0x2f')],'data3':members[_0x9755aa][_0x3841('0x30')]||_0x6197f2[_0x3841('0x31')],'uniqueid':members[_0x9755aa][_0x3841('0x17')]||_0x6197f2[_0x3841('0x17')]});utils[_0x3841('0x5')](util['format'](_0x3841('0x33'),_0x6197f2[_0x3841('0x17')],members[_0x9755aa]['data1'],members[_0x9755aa]['data2'],members[_0x9755aa][_0x3841('0x30')]));if(members[_0x9755aa][_0x3841('0x24')]){writeDB(members[_0x9755aa]);}}}}catch(_0x135255){utils['error'](util[_0x3841('0x6')]('[%s][members][cdr]',_0x6197f2[_0x3841('0x17')]),_0x135255);}}; \ No newline at end of file +var _0x3452=['some','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','split','data1','type','data2','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','getUserByInterface','then','name','request','internal','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid'];(function(_0x2f9dd9,_0x5f4051){var _0x51e4c8=function(_0x53176e){while(--_0x53176e){_0x2f9dd9['push'](_0x2f9dd9['shift']());}};_0x51e4c8(++_0x5f4051);}(_0x3452,0x183));var _0x2345=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3452[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x2345('0x0'));var util=require(_0x2345('0x1'));var utils=require(_0x2345('0x2'));var members={};var exclude=[_0x2345('0x3'),_0x2345('0x4')];function writeDB(_0x35f24f){utils[_0x2345('0x5')](util[_0x2345('0x6')](_0x2345('0x7'),_0x35f24f['uniqueid'],_0x35f24f[_0x2345('0x8')],_0x35f24f[_0x2345('0x9')],_0x35f24f['data2'],_0x35f24f[_0x2345('0xa')],_0x35f24f['type']));if(_0x35f24f['interface']){utils[_0x2345('0xb')](_0x35f24f[_0x2345('0x8')])[_0x2345('0xc')](function(_0x5709c5){if(_0x5709c5){_0x35f24f[_0x2345('0xa')]=_0x5709c5[_0x2345('0xd')];_0x35f24f['internal']=_0x5709c5['internal'];utils[_0x2345('0xe')]('CreateMemberReport',_0x35f24f);}else{utils['getUserByName'](_0x35f24f['interface']['split']('/')[0x1])[_0x2345('0xc')](function(_0x60a065){if(_0x60a065){_0x35f24f[_0x2345('0xa')]=_0x60a065['name'];_0x35f24f['internal']=_0x60a065[_0x2345('0xf')];utils['request'](_0x2345('0x10'),_0x35f24f);}});}})[_0x2345('0x11')](function(_0x41245d){utils[_0x2345('0x12')](util[_0x2345('0x6')](_0x2345('0x13'),_0x35f24f[_0x2345('0x14')]),_0x41245d);});}delete members[_0x35f24f[_0x2345('0x8')]];}function startsWith(_0x530856,_0x18415b){return _[_0x2345('0x15')](_0x530856,function(_0x2b194a){return _['startsWith'](_0x18415b,_0x2b194a);});}exports[_0x2345('0x16')]=function(_0x532b33){try{utils['debug'](util[_0x2345('0x6')](_0x2345('0x17'),members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33[_0x2345('0x18')]]['uniqueid']:_0x532b33[_0x2345('0x18')]),_0x532b33);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33[_0x2345('0x18')]][_0x2345('0x14')]:_0x532b33['device'],_0x532b33[_0x2345('0x19')],_0x532b33[_0x2345('0x18')]));switch(_0x532b33[_0x2345('0x19')]){case _0x2345('0x1a'):case _0x2345('0x1b'):if(!startsWith(exclude,_0x532b33[_0x2345('0x18')])){members[_0x532b33[_0x2345('0x18')]]={'channel':_0x2345('0x1c'),'interface':_0x532b33[_0x2345('0x18')],'type':'TALKING','enterAt':utils[_0x2345('0x1d')](),'role':'agent'};}break;case _0x2345('0x1e'):if(!_[_0x2345('0x1f')](members[_0x532b33[_0x2345('0x18')]])){members[_0x532b33[_0x2345('0x18')]][_0x2345('0x20')]=utils[_0x2345('0x1d')]();members[_0x532b33[_0x2345('0x18')]][_0x2345('0x21')]=utils[_0x2345('0x22')](members[_0x532b33[_0x2345('0x18')]]['exitAt'],members[_0x532b33['device']]['enterAt']);if(members[_0x532b33[_0x2345('0x18')]][_0x2345('0x14')]){writeDB(members[_0x532b33['device']]);}}break;default:break;}}catch(_0x2b1338){utils[_0x2345('0x12')](util[_0x2345('0x6')](_0x2345('0x17'),members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33['device']][_0x2345('0x14')]:_0x532b33[_0x2345('0x18')]),_0x2b1338);}};exports[_0x2345('0x23')]=function(_0x1ac0b6){try{if(!_[_0x2345('0x1f')](members[_0x1ac0b6[_0x2345('0x8')]])){utils[_0x2345('0x24')](util[_0x2345('0x6')](_0x2345('0x25'),_0x1ac0b6[_0x2345('0x14')]),_0x1ac0b6);utils['info'](util[_0x2345('0x6')](_0x2345('0x26'),_0x1ac0b6['uniqueid'],_0x1ac0b6['interface'],_0x1ac0b6['queue']));members[_0x1ac0b6[_0x2345('0x8')]]=_[_0x2345('0x27')](members[_0x1ac0b6[_0x2345('0x8')]],{'data4':_0x1ac0b6[_0x2345('0x28')],'uniqueid':_0x1ac0b6[_0x2345('0x14')]});}}catch(_0x139802){utils[_0x2345('0x12')](util['format'](_0x2345('0x25'),_0x1ac0b6[_0x2345('0x14')]),_0x139802);}};exports[_0x2345('0x29')]=function(_0x1b90bd){try{utils['debug'](util[_0x2345('0x6')](_0x2345('0x2a'),_0x1b90bd[_0x2345('0x14')]),_0x1b90bd);if(_0x1b90bd['channel']){var _0x5189aa=_0x1b90bd['channel'][_0x2345('0x2b')]('-')[0x0];if(!_['isNil'](members[_0x5189aa])){members[_0x5189aa]=_[_0x2345('0x27')](members[_0x5189aa],{'data1':members[_0x5189aa][_0x2345('0x2c')]||_0x1b90bd[_0x2345('0x2d')],'data2':members[_0x5189aa][_0x2345('0x2e')]||_0x1b90bd[_0x2345('0x2f')],'data3':members[_0x5189aa][_0x2345('0x30')]||_0x1b90bd[_0x2345('0x31')],'uniqueid':members[_0x5189aa][_0x2345('0x14')]||_0x1b90bd['uniqueid']});utils[_0x2345('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1b90bd[_0x2345('0x14')],members[_0x5189aa][_0x2345('0x2c')],members[_0x5189aa][_0x2345('0x2e')],members[_0x5189aa]['data3']));if(members[_0x5189aa][_0x2345('0x20')]){writeDB(members[_0x5189aa]);}}}if(_0x1b90bd[_0x2345('0x32')]){var _0x57f72a=_0x1b90bd[_0x2345('0x32')][_0x2345('0x2b')]('-')[0x0];if(!_[_0x2345('0x1f')](members[_0x57f72a])){members[_0x57f72a]=_[_0x2345('0x27')](members[_0x57f72a],{'data1':members[_0x57f72a][_0x2345('0x2c')]||_0x1b90bd[_0x2345('0x2d')],'data2':members[_0x57f72a][_0x2345('0x2e')]||_0x1b90bd[_0x2345('0x2f')],'data3':members[_0x57f72a][_0x2345('0x30')]||_0x1b90bd[_0x2345('0x31')],'uniqueid':members[_0x57f72a][_0x2345('0x14')]||_0x1b90bd[_0x2345('0x14')]});utils['info'](util[_0x2345('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1b90bd[_0x2345('0x14')],members[_0x57f72a][_0x2345('0x2c')],members[_0x57f72a][_0x2345('0x2e')],members[_0x57f72a][_0x2345('0x30')]));if(members[_0x57f72a][_0x2345('0x20')]){writeDB(members[_0x57f72a]);}}}}catch(_0x59f2e5){utils[_0x2345('0x12')](util[_0x2345('0x6')]('[%s][members][cdr]',_0x1b90bd['uniqueid']),_0x59f2e5);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6e99743..e0b4415 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 _0xa927=['secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','queuecallerexitreason','type','request','CreateVoiceQueueReport','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','info','name','transfereduniqueid','varset','[%s][queues][varset]','queuestatus','value','CONTINUE','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x288f7a,_0x3bfb0e){var _0x4fc058=function(_0x22b7fa){while(--_0x22b7fa){_0x288f7a['push'](_0x288f7a['shift']());}};_0x4fc058(++_0x3bfb0e);}(_0xa927,0x7e));var _0x7a92=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa927[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a92('0x0'));var util=require(_0x7a92('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x315340){utils['info'](util[_0x7a92('0x2')](_0x7a92('0x3'),_0x315340['uniqueid'],_0x315340[_0x7a92('0x4')],_0x315340[_0x7a92('0x5')],_0x315340['lastAssignedTo'],_0x315340['calleridnum'],_0x315340['accountcode'],_0x315340[_0x7a92('0x6')]));if(_0x315340[_0x7a92('0x5')]){utils['getVoiceQueueByName'](_0x315340['queue'])['then'](function(_0x12cd63){if(_0x12cd63){_0x315340[_0x7a92('0x7')]=_0x12cd63[_0x7a92('0x7')];}utils[_0x7a92('0x8')](_0x7a92('0x9'),_0x315340);});}else{utils[_0x7a92('0x8')](_0x7a92('0x9'),_0x315340);}if(_0x315340['transfereduniqueid']){delete queues[_0x315340['transfereduniqueid']];}else{delete queues[_0x315340[_0x7a92('0xa')]];}}exports[_0x7a92('0xb')]=function(_0x5c7ec7){try{utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0xd'),_0x5c7ec7[_0x7a92('0xa')]),_0x5c7ec7);utils['info'](util['format'](_0x7a92('0xe'),_0x5c7ec7[_0x7a92('0xa')],_0x5c7ec7[_0x7a92('0x5')],_0x5c7ec7[_0x7a92('0xf')]));queues[_0x5c7ec7[_0x7a92('0xa')]]=_[_0x7a92('0x10')](_0x5c7ec7,{'originalposition':_0x5c7ec7[_0x7a92('0xf')],'queuecallerjoinAt':utils[_0x7a92('0x11')](),'mohtime':0x0});}catch(_0x31048d){utils[_0x7a92('0x12')](util[_0x7a92('0x2')]('[%s][queues][queuecallerjoin]',_0x5c7ec7[_0x7a92('0xa')]),_0x31048d);}};exports[_0x7a92('0x13')]=function(_0x326081){try{if(!_[_0x7a92('0x14')](queues[_0x326081[_0x7a92('0xa')]])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x15'),_0x326081[_0x7a92('0xa')]),_0x326081);if(queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x16')]){if(!queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x17')]&&!queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x18')]){queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x19')]=!![];queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x1a')]=utils[_0x7a92('0x11')]();queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x6')]='COMPLETEDBYAGENT';}utils[_0x7a92('0x1b')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x326081['uniqueid'],queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x1c')],queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x6')]));writeDB(queues[_0x326081[_0x7a92('0xa')]]);}else if(queues[_0x326081[_0x7a92('0xa')]][_0x7a92('0x1d')]){utils[_0x7a92('0x1b')](util[_0x7a92('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x326081[_0x7a92('0xa')],queues[_0x326081['uniqueid']][_0x7a92('0x1c')],queues[_0x326081['uniqueid']][_0x7a92('0x1d')]));queues[queues[_0x326081[_0x7a92('0xa')]]['transfereduniqueid']]=queues[_0x326081['uniqueid']];queues[queues[_0x326081['uniqueid']][_0x7a92('0x1d')]]['queuecallerenterreason']=0x2;delete queues[_0x326081[_0x7a92('0xa')]];}}}catch(_0x173b93){utils[_0x7a92('0x12')](util[_0x7a92('0x2')]('[%s][queues][hangup]',_0x326081[_0x7a92('0xa')]),_0x173b93);}};exports[_0x7a92('0x1e')]=function(_0x46d60a){try{utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x1f'),_0x46d60a[_0x7a92('0xa')]),_0x46d60a);if(!_[_0x7a92('0x14')](_0x46d60a['variable'][_0x7a92('0x20')])&&_0x46d60a[_0x7a92('0x21')]['toUpperCase']()!==_0x7a92('0x22')){if(!_['isNil'](queues[_0x46d60a[_0x7a92('0xa')]])){queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x17')]=![];queues[_0x46d60a[_0x7a92('0xa')]]['queuecallerabandonAt']=null;queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x18')]=!![];queues[_0x46d60a['uniqueid']][_0x7a92('0x23')]=utils[_0x7a92('0x11')]();queues[_0x46d60a[_0x7a92('0xa')]]['queuecallerexitreason']=_0x46d60a[_0x7a92('0x21')][_0x7a92('0x24')]();utils[_0x7a92('0x1b')](util['format'](_0x7a92('0x25'),_0x46d60a[_0x7a92('0xa')],queues[_0x46d60a['uniqueid']][_0x7a92('0x1c')],_0x46d60a[_0x7a92('0x21')],queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x6')]));writeDB(queues[_0x46d60a['uniqueid']]);}}else if(!_[_0x7a92('0x14')](_0x46d60a['variable'][_0x7a92('0x26')])){if(!_[_0x7a92('0x14')](queues[_0x46d60a[_0x7a92('0xa')]])&&!queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x17')]){queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x17')]=![];queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x27')]=null;queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x18')]=!![];queues[_0x46d60a[_0x7a92('0xa')]][_0x7a92('0x23')]=utils[_0x7a92('0x11')]();queues[_0x46d60a['uniqueid']]['queuecallerexitreason']=_0x7a92('0x28');utils[_0x7a92('0x1b')](util[_0x7a92('0x2')](_0x7a92('0x29'),_0x46d60a[_0x7a92('0xa')],queues[_0x46d60a['uniqueid']][_0x7a92('0x1c')],_0x46d60a[_0x7a92('0x21')],queues[_0x46d60a[_0x7a92('0xa')]]['queuecallerexitreason']));}}}catch(_0x24e0b6){utils['error'](util['format'](_0x7a92('0x1f'),_0x46d60a['uniqueid']),_0x24e0b6);}};exports[_0x7a92('0x17')]=function(_0x122b2c){try{if(!_[_0x7a92('0x14')](queues[_0x122b2c[_0x7a92('0xa')]])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x2a'),_0x122b2c['uniqueid']),_0x122b2c);queues[_0x122b2c[_0x7a92('0xa')]]['queuecallerexit']=![];queues[_0x122b2c[_0x7a92('0xa')]][_0x7a92('0x23')]=null;queues[_0x122b2c[_0x7a92('0xa')]][_0x7a92('0x17')]=!![];queues[_0x122b2c['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x122b2c[_0x7a92('0xa')]][_0x7a92('0x6')]=_0x7a92('0x2b');utils[_0x7a92('0x1b')](util[_0x7a92('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x122b2c[_0x7a92('0xa')],queues[_0x122b2c['uniqueid']][_0x7a92('0x1c')],queues[_0x122b2c[_0x7a92('0xa')]][_0x7a92('0x6')]));}}catch(_0x7d195){utils[_0x7a92('0x12')](util[_0x7a92('0x2')]('[%s][queues][queuecallerabandon]',_0x122b2c[_0x7a92('0xa')]),_0x7d195);}};exports[_0x7a92('0x2c')]=function(_0x2d41a6){try{if(!_['isNil'](queues[_0x2d41a6[_0x7a92('0xa')]])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')]('[%s][queues][queuecallerleave]',_0x2d41a6[_0x7a92('0xa')]),_0x2d41a6);utils[_0x7a92('0x1b')](util[_0x7a92('0x2')](_0x7a92('0x2d'),_0x2d41a6['uniqueid'],queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x1c')],_0x2d41a6[_0x7a92('0x2e')],_0x2d41a6[_0x7a92('0x2f')]));queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x2c')]=!![];queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x16')]=utils[_0x7a92('0x11')]();queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x30')]=utils[_0x7a92('0x31')](queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x16')],queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x32')]);queues[_0x2d41a6['uniqueid']][_0x7a92('0xf')]=_0x2d41a6[_0x7a92('0xf')];queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x33')]=_0x2d41a6[_0x7a92('0x33')];queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x2e')]=_0x2d41a6['connectedlinenum'];queues[_0x2d41a6[_0x7a92('0xa')]][_0x7a92('0x2f')]=_0x2d41a6[_0x7a92('0x2f')];}}catch(_0x5eb6f3){utils['error'](util['format'](_0x7a92('0x34'),_0x2d41a6[_0x7a92('0xa')]),_0x5eb6f3);}};exports['agentconnect']=function(_0x3843e5){try{if(!_[_0x7a92('0x14')](queues[_0x3843e5['uniqueid']])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x35'),_0x3843e5[_0x7a92('0xa')]),_0x3843e5);utils[_0x7a92('0x1b')](util['format'](_0x7a92('0x36'),_0x3843e5[_0x7a92('0xa')],queues[_0x3843e5['uniqueid']][_0x7a92('0x1c')],_0x3843e5['membername'],_0x3843e5[_0x7a92('0x37')]));queues[_0x3843e5[_0x7a92('0xa')]]['queuecallerabandon']=![];queues[_0x3843e5[_0x7a92('0xa')]][_0x7a92('0x17')]=![];queues[_0x3843e5['uniqueid']][_0x7a92('0x27')]=null;queues[_0x3843e5[_0x7a92('0xa')]][_0x7a92('0x18')]=![];queues[_0x3843e5[_0x7a92('0xa')]][_0x7a92('0x6')]=null;queues[_0x3843e5['uniqueid']][_0x7a92('0x23')]=null;queues[_0x3843e5[_0x7a92('0xa')]][_0x7a92('0x38')]=!![];queues[_0x3843e5['uniqueid']]['accountcode']=_0x3843e5[_0x7a92('0x37')];queues[_0x3843e5['uniqueid']][_0x7a92('0x39')]=_0x3843e5[_0x7a92('0x3a')];}}catch(_0x2dcec0){utils[_0x7a92('0x12')](util[_0x7a92('0x2')](_0x7a92('0x35'),_0x3843e5['uniqueid']),_0x2dcec0);}};exports[_0x7a92('0x3b')]=function(_0x496852){try{if(!_[_0x7a92('0x14')](queues[_0x496852['uniqueid']])){if(queues[_0x496852[_0x7a92('0xa')]][_0x7a92('0x16')]){utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x3c'),_0x496852[_0x7a92('0xa')]),_0x496852);queues[_0x496852[_0x7a92('0xa')]]['queuecallerabandon']=![];queues[_0x496852['uniqueid']][_0x7a92('0x17')]=![];queues[_0x496852[_0x7a92('0xa')]]['queuecallerabandonAt']=null;queues[_0x496852[_0x7a92('0xa')]][_0x7a92('0x18')]=![];queues[_0x496852[_0x7a92('0xa')]]['queuecallerexitAt']=null;queues[_0x496852[_0x7a92('0xa')]]['assigned']=!![];queues[_0x496852['uniqueid']][_0x7a92('0x39')]=_0x496852[_0x7a92('0x3a')];queues[_0x496852['uniqueid']][_0x7a92('0x19')]=!![];queues[_0x496852[_0x7a92('0xa')]][_0x7a92('0x1a')]=utils[_0x7a92('0x11')]();if(_0x496852[_0x7a92('0x3d')]=='transfer'){if(!queues[_0x496852[_0x7a92('0xa')]][_0x7a92('0x3e')]){queues[_0x496852['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x496852[_0x7a92('0xa')]][_0x7a92('0x6')]=_0x7a92('0x3f')+_0x496852[_0x7a92('0x3d')][_0x7a92('0x24')]();}utils['info'](util[_0x7a92('0x2')](_0x7a92('0x40'),_0x496852[_0x7a92('0xa')],queues[_0x496852['uniqueid']][_0x7a92('0x1c')],_0x496852[_0x7a92('0x3a')],queues[_0x496852['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x496852['uniqueid']]);}}}catch(_0x354049){utils[_0x7a92('0x12')](util[_0x7a92('0x2')](_0x7a92('0x3c'),_0x496852[_0x7a92('0xa')]),_0x354049);}};exports[_0x7a92('0x41')]=function(_0x238163){try{if(!_[_0x7a92('0x14')](queues[_0x238163['transfereeuniqueid']])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')]('[%s][queues][blindtransfer]',_0x238163[_0x7a92('0xa')]),_0x238163);queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x3e')]=!![];queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x43')]=_0x7a92('0x44');queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x45')]=_0x238163[_0x7a92('0x46')];queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x47')]=_0x238163[_0x7a92('0x42')];queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x6')]=_0x7a92('0x48');utils[_0x7a92('0x1b')](util[_0x7a92('0x2')](_0x7a92('0x49'),_0x238163[_0x7a92('0xa')],queues[_0x238163[_0x7a92('0x42')]][_0x7a92('0x1c')],_0x238163[_0x7a92('0x42')],_0x238163[_0x7a92('0x46')]));}}catch(_0x35c763){utils[_0x7a92('0x12')](util[_0x7a92('0x2')](_0x7a92('0x4a'),_0x238163[_0x7a92('0xa')]),_0x35c763);}};exports[_0x7a92('0x4b')]=function(_0x250519){try{utils[_0x7a92('0xc')](util[_0x7a92('0x2')](_0x7a92('0x4c'),_0x250519[_0x7a92('0x4d')]),_0x250519);if(_0x250519[_0x7a92('0x4d')]==_0x250519['origtransfererlinkedid']){if(!_[_0x7a92('0x14')](queues[_0x250519[_0x7a92('0x4e')]])){utils[_0x7a92('0x1b')](util[_0x7a92('0x2')](_0x7a92('0x4f'),_0x250519['origtransfereruniqueid'],queues[_0x250519[_0x7a92('0x4e')]][_0x7a92('0x1c')],_0x250519[_0x7a92('0x50')]));queues[_0x250519[_0x7a92('0x4e')]]['transfer']=!![];queues[_0x250519[_0x7a92('0x4e')]][_0x7a92('0x43')]='ATTENDED';queues[_0x250519['secondtransfererlinkedid']]['transferexten']=_0x250519[_0x7a92('0x50')];queues[_0x250519[_0x7a92('0x4e')]][_0x7a92('0x47')]=_0x250519['origtransfereruniqueid'];queues[_0x250519['secondtransfererlinkedid']][_0x7a92('0x6')]=_0x7a92('0x51');}if(!_[_0x7a92('0x14')](queues[_0x250519['origtransfererlinkedid']])){if(_0x250519[_0x7a92('0x52')]&&queues[_0x250519[_0x7a92('0x52')]]){queues[_0x250519[_0x7a92('0x52')]][_0x7a92('0x53')]=0x1;queues[_0x250519[_0x7a92('0x42')]]=_[_0x7a92('0x54')](queues[_0x250519['transfereelinkedid']]);queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x1d')]=_0x250519['transfertargetuniqueid'];queues[_0x250519[_0x7a92('0x42')]]['queuecallerenterreason']=0x2;queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x55')]=queues[_0x250519['secondtransfererlinkedid']][_0x7a92('0x55')];queues[_0x250519['transfereeuniqueid']][_0x7a92('0x56')]=queues[_0x250519[_0x7a92('0x4e')]][_0x7a92('0x56')];queues[_0x250519['transfereeuniqueid']][_0x7a92('0x32')]=utils['now']();queues[_0x250519[_0x7a92('0x42')]]['queuecallerleaveAt']=utils[_0x7a92('0x11')]();queues[_0x250519[_0x7a92('0x42')]]['holdtime']=0x0;queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x57')]=0x0;utils['info'](util[_0x7a92('0x2')](_0x7a92('0x58'),_0x250519[_0x7a92('0x4d')],queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x1c')],queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x55')],queues[_0x250519[_0x7a92('0x42')]][_0x7a92('0x56')]));}else{utils[_0x7a92('0x1b')](util['format'](_0x7a92('0x59'),_0x250519[_0x7a92('0x4d')],queues[_0x250519['origtransfererlinkedid']][_0x7a92('0x1c')],_0x250519[_0x7a92('0x4e')]));queues[_0x250519[_0x7a92('0x5a')]]['transfereduniqueid']=_0x250519['secondtransfererlinkedid'];}}}else if(_0x250519[_0x7a92('0x5b')]==_0x250519[_0x7a92('0x4e')]){if(!_['isNil'](queues[_0x250519[_0x7a92('0x5a')]])){utils[_0x7a92('0x1b')](util['format'](_0x7a92('0x5c'),_0x250519[_0x7a92('0x4d')],queues[_0x250519[_0x7a92('0x5a')]][_0x7a92('0x1c')],_0x250519[_0x7a92('0x5b')],_0x250519[_0x7a92('0x5d')]));queues[_0x250519[_0x7a92('0x5a')]]['transfer']=!![];queues[_0x250519[_0x7a92('0x5a')]][_0x7a92('0x43')]=_0x7a92('0x5e');queues[_0x250519[_0x7a92('0x5a')]][_0x7a92('0x45')]=_0x250519[_0x7a92('0x5d')];queues[_0x250519[_0x7a92('0x5a')]][_0x7a92('0x47')]=_0x250519[_0x7a92('0x5b')];queues[_0x250519[_0x7a92('0x5a')]][_0x7a92('0x6')]=_0x7a92('0x51');}if(!_[_0x7a92('0x14')](queues[_0x250519[_0x7a92('0x4e')]])){if(_0x250519['transfertargetlinkedid']&&queues[_0x250519[_0x7a92('0x5f')]]){queues[_0x250519[_0x7a92('0x5f')]][_0x7a92('0x53')]=0x1;queues[_0x250519[_0x7a92('0x60')]]=_[_0x7a92('0x54')](queues[_0x250519[_0x7a92('0x5f')]]);queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x1d')]=_0x250519[_0x7a92('0x60')];queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x53')]=0x2;queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x55')]=queues[_0x250519[_0x7a92('0x5a')]]['calleridnum'];queues[_0x250519['transfertargetuniqueid']][_0x7a92('0x56')]=queues[_0x250519[_0x7a92('0x5a')]]['calleridname'];queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x32')]=utils['now']();queues[_0x250519['transfertargetuniqueid']][_0x7a92('0x16')]=utils['now']();queues[_0x250519['transfertargetuniqueid']][_0x7a92('0x30')]=0x0;queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x57')]=0x0;utils[_0x7a92('0x1b')](util['format'](_0x7a92('0x61'),_0x250519[_0x7a92('0x4d')],queues[_0x250519[_0x7a92('0x60')]][_0x7a92('0x1c')],queues[_0x250519[_0x7a92('0x60')]]['transfereduniqueid'],queues[_0x250519['transfertargetuniqueid']][_0x7a92('0x55')],queues[_0x250519[_0x7a92('0x60')]]['calleridname']));}else{utils['info'](util[_0x7a92('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x250519['origtransfereruniqueid'],queues[_0x250519[_0x7a92('0x4e')]]['name'],_0x250519['origtransfererlinkedid']));queues[_0x250519['secondtransfererlinkedid']]['transfereduniqueid']=_0x250519[_0x7a92('0x5a')];}}}}catch(_0x3ddfe5){utils[_0x7a92('0x12')](util['format'](_0x7a92('0x4c'),_0x250519[_0x7a92('0x4d')]),_0x3ddfe5);}};exports[_0x7a92('0x62')]=function(_0x1a01ed){try{if(!_[_0x7a92('0x14')](queues[_0x1a01ed[_0x7a92('0xa')]])){utils[_0x7a92('0xc')](util[_0x7a92('0x2')]('[%s][queues][musiconholdstart]',_0x1a01ed[_0x7a92('0xa')]),_0x1a01ed);queues[_0x1a01ed[_0x7a92('0xa')]][_0x7a92('0x63')]=utils[_0x7a92('0x11')]();utils[_0x7a92('0x1b')](util[_0x7a92('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1a01ed[_0x7a92('0xa')],queues[_0x1a01ed[_0x7a92('0xa')]]['name'],queues[_0x1a01ed['uniqueid']][_0x7a92('0x63')]));}}catch(_0x33cee9){utils[_0x7a92('0x12')](util[_0x7a92('0x2')]('[%s][queues][musiconholdstart]',_0x1a01ed['uniqueid']),_0x33cee9);}};exports[_0x7a92('0x64')]=function(_0xadfd7){try{if(!_['isNil'](queues[_0xadfd7[_0x7a92('0xa')]])){if(!_[_0x7a92('0x14')](queues[_0xadfd7[_0x7a92('0xa')]][_0x7a92('0x63')])){utils['debug'](util[_0x7a92('0x2')](_0x7a92('0x65'),_0xadfd7[_0x7a92('0xa')]),_0xadfd7);queues[_0xadfd7['uniqueid']][_0x7a92('0x57')]+=utils[_0x7a92('0x31')](utils['now'](),queues[_0xadfd7[_0x7a92('0xa')]]['musiconholdstartAt']);utils['info'](util[_0x7a92('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xadfd7['uniqueid'],queues[_0xadfd7[_0x7a92('0xa')]][_0x7a92('0x1c')],queues[_0xadfd7[_0x7a92('0xa')]]['mohtime']));delete queues[_0xadfd7['uniqueid']][_0x7a92('0x63')];}}}catch(_0x1fe060){utils[_0x7a92('0x12')](util[_0x7a92('0x2')]('[%s][queues][musiconholdstop]',_0xadfd7['uniqueid']),_0x1fe060);}}; \ No newline at end of file +var _0x9745=['queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','membername','[%s][queues][agentconnect]','agentcomplete','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','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','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexit'];(function(_0x22653d,_0x2369b9){var _0x3cf4ba=function(_0x2cf12e){while(--_0x2cf12e){_0x22653d['push'](_0x22653d['shift']());}};_0x3cf4ba(++_0x2369b9);}(_0x9745,0x1e3));var _0x5974=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x9745[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x5974('0x0'));var util=require(_0x5974('0x1'));var utils=require(_0x5974('0x2'));var queues={};function writeDB(_0x568553){utils['info'](util[_0x5974('0x3')](_0x5974('0x4'),_0x568553[_0x5974('0x5')],_0x568553['channel'],_0x568553[_0x5974('0x6')],_0x568553[_0x5974('0x7')],_0x568553[_0x5974('0x8')],_0x568553['accountcode'],_0x568553[_0x5974('0x9')]));if(_0x568553['queue']){utils[_0x5974('0xa')](_0x568553['queue'])[_0x5974('0xb')](function(_0x24d029){if(_0x24d029){_0x568553['type']=_0x24d029[_0x5974('0xc')];}utils['request'](_0x5974('0xd'),_0x568553);});}else{utils[_0x5974('0xe')](_0x5974('0xd'),_0x568553);}if(_0x568553[_0x5974('0xf')]){delete queues[_0x568553[_0x5974('0xf')]];}else{delete queues[_0x568553[_0x5974('0x5')]];}}exports[_0x5974('0x10')]=function(_0x5028c0){try{utils[_0x5974('0x11')](util['format'](_0x5974('0x12'),_0x5028c0[_0x5974('0x5')]),_0x5028c0);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x14'),_0x5028c0['uniqueid'],_0x5028c0[_0x5974('0x6')],_0x5028c0[_0x5974('0x15')]));queues[_0x5028c0[_0x5974('0x5')]]=_[_0x5974('0x16')](_0x5028c0,{'originalposition':_0x5028c0['position'],'queuecallerjoinAt':utils[_0x5974('0x17')](),'mohtime':0x0});}catch(_0x132357){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x12'),_0x5028c0[_0x5974('0x5')]),_0x132357);}};exports[_0x5974('0x19')]=function(_0x294b8e){try{if(!_[_0x5974('0x1a')](queues[_0x294b8e['uniqueid']])){utils[_0x5974('0x11')](util[_0x5974('0x3')](_0x5974('0x1b'),_0x294b8e[_0x5974('0x5')]),_0x294b8e);if(queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1c')]){if(!queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1d')]&&!queues[_0x294b8e[_0x5974('0x5')]]['queuecallerexit']){queues[_0x294b8e[_0x5974('0x5')]]['queuecallercomplete']=!![];queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1e')]=utils[_0x5974('0x17')]();queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x1f');}utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x20'),_0x294b8e[_0x5974('0x5')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x294b8e[_0x5974('0x5')]]);}else if(queues[_0x294b8e['uniqueid']][_0x5974('0xf')]){utils[_0x5974('0x13')](util[_0x5974('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x294b8e['uniqueid'],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0xf')]));queues[queues[_0x294b8e[_0x5974('0x5')]]['transfereduniqueid']]=queues[_0x294b8e[_0x5974('0x5')]];queues[queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0xf')]][_0x5974('0x22')]=0x2;delete queues[_0x294b8e[_0x5974('0x5')]];}}}catch(_0x7c2ada){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x1b'),_0x294b8e[_0x5974('0x5')]),_0x7c2ada);}};exports[_0x5974('0x23')]=function(_0x52d1e2){try{utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][varset]',_0x52d1e2[_0x5974('0x5')]),_0x52d1e2);if(!_['isNil'](_0x52d1e2[_0x5974('0x24')][_0x5974('0x25')])&&_0x52d1e2[_0x5974('0x26')][_0x5974('0x27')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x52d1e2['uniqueid']])){queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]=![];queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x29')]=!![];queues[_0x52d1e2['uniqueid']][_0x5974('0x2a')]=utils[_0x5974('0x17')]();queues[_0x52d1e2['uniqueid']]['queuecallerexitreason']=_0x52d1e2[_0x5974('0x26')][_0x5974('0x27')]();utils['info'](util[_0x5974('0x3')](_0x5974('0x2b'),_0x52d1e2[_0x5974('0x5')],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x21')],_0x52d1e2[_0x5974('0x26')],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x52d1e2['uniqueid']]);}}else if(!_[_0x5974('0x1a')](_0x52d1e2[_0x5974('0x24')][_0x5974('0x2c')])){if(!_[_0x5974('0x1a')](queues[_0x52d1e2[_0x5974('0x5')]])&&!queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]){queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]=![];queues[_0x52d1e2[_0x5974('0x5')]]['queuecallerabandonAt']=null;queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x29')]=!![];queues[_0x52d1e2['uniqueid']][_0x5974('0x2a')]=utils['now']();queues[_0x52d1e2['uniqueid']][_0x5974('0x9')]='EXITWITHKEY';utils[_0x5974('0x13')](util['format'](_0x5974('0x2d'),_0x52d1e2['uniqueid'],queues[_0x52d1e2['uniqueid']][_0x5974('0x21')],_0x52d1e2['value'],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x9')]));}}}catch(_0x1b33ff){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x2e'),_0x52d1e2[_0x5974('0x5')]),_0x1b33ff);}};exports[_0x5974('0x1d')]=function(_0xd46540){try{if(!_[_0x5974('0x1a')](queues[_0xd46540[_0x5974('0x5')]])){utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][queuecallerabandon]',_0xd46540['uniqueid']),_0xd46540);queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x29')]=![];queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x2a')]=null;queues[_0xd46540['uniqueid']][_0x5974('0x1d')]=!![];queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x28')]=utils[_0x5974('0x17')]();queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x2f');utils[_0x5974('0x13')](util[_0x5974('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0xd46540[_0x5974('0x5')],queues[_0xd46540['uniqueid']][_0x5974('0x21')],queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x9')]));}}catch(_0xf2b7f){utils['error'](util[_0x5974('0x3')](_0x5974('0x30'),_0xd46540[_0x5974('0x5')]),_0xf2b7f);}};exports['queuecallerleave']=function(_0x48f32f){try{if(!_['isNil'](queues[_0x48f32f[_0x5974('0x5')]])){utils[_0x5974('0x11')](util['format'](_0x5974('0x31'),_0x48f32f[_0x5974('0x5')]),_0x48f32f);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x32'),_0x48f32f[_0x5974('0x5')],queues[_0x48f32f['uniqueid']][_0x5974('0x21')],_0x48f32f[_0x5974('0x33')],_0x48f32f[_0x5974('0x34')]));queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x35')]=!![];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x1c')]=utils[_0x5974('0x17')]();queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x36')]=utils[_0x5974('0x37')](queues[_0x48f32f[_0x5974('0x5')]]['queuecallerleaveAt'],queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x38')]);queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x15')]=_0x48f32f[_0x5974('0x15')];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x39')]=_0x48f32f['count'];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x33')]=_0x48f32f[_0x5974('0x33')];queues[_0x48f32f['uniqueid']][_0x5974('0x34')]=_0x48f32f[_0x5974('0x34')];}}catch(_0xaee27a){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x31'),_0x48f32f['uniqueid']),_0xaee27a);}};exports[_0x5974('0x3a')]=function(_0x1c29fe){try{if(!_[_0x5974('0x1a')](queues[_0x1c29fe[_0x5974('0x5')]])){utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][agentconnect]',_0x1c29fe['uniqueid']),_0x1c29fe);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x3b'),_0x1c29fe[_0x5974('0x5')],queues[_0x1c29fe[_0x5974('0x5')]]['name'],_0x1c29fe['membername'],_0x1c29fe['destaccountcode']));queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x1d')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x1d')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x29')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x9')]=null;queues[_0x1c29fe['uniqueid']][_0x5974('0x2a')]=null;queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x3c')]=!![];queues[_0x1c29fe[_0x5974('0x5')]]['accountcode']=_0x1c29fe[_0x5974('0x3d')];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x7')]=_0x1c29fe[_0x5974('0x3e')];}}catch(_0x469ef6){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x3f'),_0x1c29fe['uniqueid']),_0x469ef6);}};exports[_0x5974('0x40')]=function(_0x2c9210){try{if(!_[_0x5974('0x1a')](queues[_0x2c9210[_0x5974('0x5')]])){if(queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x1c')]){utils['debug'](util[_0x5974('0x3')]('[%s][queues][agentcomplete]',_0x2c9210[_0x5974('0x5')]),_0x2c9210);queues[_0x2c9210[_0x5974('0x5')]]['queuecallerabandon']=![];queues[_0x2c9210['uniqueid']][_0x5974('0x1d')]=![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x2c9210[_0x5974('0x5')]]['queuecallerexit']=![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x2a')]=null;queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x3c')]=!![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x7')]=_0x2c9210[_0x5974('0x3e')];queues[_0x2c9210['uniqueid']][_0x5974('0x41')]=!![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x1e')]=utils[_0x5974('0x17')]();if(_0x2c9210['reason']==_0x5974('0x42')){if(!queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x42')]){queues[_0x2c9210['uniqueid']][_0x5974('0x9')]=_0x5974('0x43');}}else{queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x44')+_0x2c9210['reason'][_0x5974('0x27')]();}utils[_0x5974('0x13')](util['format'](_0x5974('0x45'),_0x2c9210[_0x5974('0x5')],queues[_0x2c9210['uniqueid']]['name'],_0x2c9210['membername'],queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x2c9210[_0x5974('0x5')]]);}}}catch(_0xbd4f94){utils['error'](util[_0x5974('0x3')](_0x5974('0x46'),_0x2c9210['uniqueid']),_0xbd4f94);}};exports[_0x5974('0x47')]=function(_0x65a5a5){try{if(!_[_0x5974('0x1a')](queues[_0x65a5a5[_0x5974('0x48')]])){utils['debug'](util[_0x5974('0x3')](_0x5974('0x49'),_0x65a5a5[_0x5974('0x5')]),_0x65a5a5);queues[_0x65a5a5[_0x5974('0x48')]]['transfer']=!![];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4a')]=_0x5974('0x4b');queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4c')]=_0x65a5a5[_0x5974('0x4d')];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4e')]=_0x65a5a5[_0x5974('0x48')];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x9')]=_0x5974('0x4f');utils[_0x5974('0x13')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x65a5a5['uniqueid'],queues[_0x65a5a5['transfereeuniqueid']][_0x5974('0x21')],_0x65a5a5[_0x5974('0x48')],_0x65a5a5[_0x5974('0x4d')]));}}catch(_0xb483ae){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x49'),_0x65a5a5['uniqueid']),_0xb483ae);}};exports[_0x5974('0x50')]=function(_0x402544){try{utils[_0x5974('0x11')](util['format']('[%s][queues][attendedtransfer]',_0x402544[_0x5974('0x51')]),_0x402544);if(_0x402544[_0x5974('0x51')]==_0x402544[_0x5974('0x52')]){if(!_[_0x5974('0x1a')](queues[_0x402544['secondtransfererlinkedid']])){utils['info'](util[_0x5974('0x3')](_0x5974('0x53'),_0x402544['origtransfereruniqueid'],queues[_0x402544[_0x5974('0x54')]][_0x5974('0x21')],_0x402544[_0x5974('0x55')]));queues[_0x402544[_0x5974('0x54')]]['transfer']=!![];queues[_0x402544['secondtransfererlinkedid']][_0x5974('0x4a')]=_0x5974('0x56');queues[_0x402544[_0x5974('0x54')]]['transferexten']=_0x402544[_0x5974('0x55')];queues[_0x402544[_0x5974('0x54')]][_0x5974('0x4e')]=_0x402544[_0x5974('0x51')];queues[_0x402544[_0x5974('0x54')]][_0x5974('0x9')]=_0x5974('0x57');}if(!_[_0x5974('0x1a')](queues[_0x402544['origtransfererlinkedid']])){if(_0x402544[_0x5974('0x58')]&&queues[_0x402544[_0x5974('0x58')]]){queues[_0x402544[_0x5974('0x58')]][_0x5974('0x22')]=0x1;queues[_0x402544['transfereeuniqueid']]=_[_0x5974('0x59')](queues[_0x402544[_0x5974('0x58')]]);queues[_0x402544[_0x5974('0x48')]]['transfereduniqueid']=_0x402544[_0x5974('0x5a')];queues[_0x402544[_0x5974('0x48')]][_0x5974('0x22')]=0x2;queues[_0x402544[_0x5974('0x48')]][_0x5974('0x8')]=queues[_0x402544[_0x5974('0x54')]]['calleridnum'];queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5b')]=queues[_0x402544[_0x5974('0x54')]]['calleridname'];queues[_0x402544[_0x5974('0x48')]]['queuecallerjoinAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x48')]]['queuecallerleaveAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x48')]][_0x5974('0x36')]=0x0;queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5c')]=0x0;utils[_0x5974('0x13')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x48')]]['name'],queues[_0x402544['transfereeuniqueid']][_0x5974('0x8')],queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5b')]));}else{utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x5d'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x52')]][_0x5974('0x21')],_0x402544[_0x5974('0x54')]));queues[_0x402544['origtransfererlinkedid']][_0x5974('0xf')]=_0x402544[_0x5974('0x54')];}}}else if(_0x402544[_0x5974('0x5e')]==_0x402544['secondtransfererlinkedid']){if(!_[_0x5974('0x1a')](queues[_0x402544[_0x5974('0x52')]])){utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x5f'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x52')]][_0x5974('0x21')],_0x402544[_0x5974('0x5e')],_0x402544[_0x5974('0x60')]));queues[_0x402544[_0x5974('0x52')]][_0x5974('0x42')]=!![];queues[_0x402544[_0x5974('0x52')]]['transfertype']=_0x5974('0x56');queues[_0x402544['origtransfererlinkedid']][_0x5974('0x4c')]=_0x402544[_0x5974('0x60')];queues[_0x402544['origtransfererlinkedid']][_0x5974('0x4e')]=_0x402544[_0x5974('0x5e')];queues[_0x402544[_0x5974('0x52')]][_0x5974('0x9')]=_0x5974('0x57');}if(!_['isNil'](queues[_0x402544[_0x5974('0x54')]])){if(_0x402544[_0x5974('0x61')]&&queues[_0x402544[_0x5974('0x61')]]){queues[_0x402544[_0x5974('0x61')]][_0x5974('0x22')]=0x1;queues[_0x402544[_0x5974('0x5a')]]=_[_0x5974('0x59')](queues[_0x402544['transfertargetlinkedid']]);queues[_0x402544[_0x5974('0x5a')]][_0x5974('0xf')]=_0x402544[_0x5974('0x5a')];queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x22')]=0x2;queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x8')]=queues[_0x402544[_0x5974('0x52')]][_0x5974('0x8')];queues[_0x402544[_0x5974('0x5a')]]['calleridname']=queues[_0x402544[_0x5974('0x52')]][_0x5974('0x5b')];queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x38')]=utils['now']();queues[_0x402544[_0x5974('0x5a')]]['queuecallerleaveAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x36')]=0x0;queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x5c')]=0x0;utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x62'),_0x402544['origtransfereruniqueid'],queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x21')],queues[_0x402544['transfertargetuniqueid']][_0x5974('0xf')],queues[_0x402544[_0x5974('0x5a')]]['calleridnum'],queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x5b')]));}else{utils['info'](util[_0x5974('0x3')](_0x5974('0x5d'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x54')]][_0x5974('0x21')],_0x402544[_0x5974('0x52')]));queues[_0x402544[_0x5974('0x54')]]['transfereduniqueid']=_0x402544[_0x5974('0x52')];}}}}catch(_0x31449a){utils[_0x5974('0x18')](util[_0x5974('0x3')]('[%s][queues][attendedtransfer]',_0x402544['origtransfereruniqueid']),_0x31449a);}};exports[_0x5974('0x63')]=function(_0x5a702a){try{if(!_['isNil'](queues[_0x5a702a[_0x5974('0x5')]])){utils['debug'](util['format'](_0x5974('0x64'),_0x5a702a[_0x5974('0x5')]),_0x5a702a);queues[_0x5a702a['uniqueid']][_0x5974('0x65')]=utils['now']();utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x66'),_0x5a702a[_0x5974('0x5')],queues[_0x5a702a[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x5a702a[_0x5974('0x5')]]['musiconholdstartAt']));}}catch(_0x1f6647){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x5a702a[_0x5974('0x5')]),_0x1f6647);}};exports[_0x5974('0x67')]=function(_0x8bc0d8){try{if(!_['isNil'](queues[_0x8bc0d8[_0x5974('0x5')]])){if(!_[_0x5974('0x1a')](queues[_0x8bc0d8[_0x5974('0x5')]][_0x5974('0x65')])){utils[_0x5974('0x11')](util['format'](_0x5974('0x68'),_0x8bc0d8['uniqueid']),_0x8bc0d8);queues[_0x8bc0d8[_0x5974('0x5')]]['mohtime']+=utils[_0x5974('0x37')](utils[_0x5974('0x17')](),queues[_0x8bc0d8['uniqueid']][_0x5974('0x65')]);utils['info'](util[_0x5974('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x8bc0d8[_0x5974('0x5')],queues[_0x8bc0d8['uniqueid']][_0x5974('0x21')],queues[_0x8bc0d8[_0x5974('0x5')]]['mohtime']));delete queues[_0x8bc0d8[_0x5974('0x5')]][_0x5974('0x65')];}}}catch(_0x2ff261){utils[_0x5974('0x18')](util['format'](_0x5974('0x68'),_0x8bc0d8[_0x5974('0x5')]),_0x2ff261);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 3931388..8b8c6d5 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 _0x19f7=['accountcode','then','name','UserId','request','CreateVoiceRecording','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newchannel]','newstate','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','appdata','set','toLowerCase','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','./utils','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid'];(function(_0x31692e,_0x255798){var _0x5a6289=function(_0x547178){while(--_0x547178){_0x31692e['push'](_0x31692e['shift']());}};_0x5a6289(++_0x255798);}(_0x19f7,0x152));var _0x719f=function(_0x50c011,_0x2fbc70){_0x50c011=_0x50c011-0x0;var _0x3940d4=_0x19f7[_0x50c011];return _0x3940d4;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x719f('0x0'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x4d8a17){var _0x3abbfc;utils[_0x719f('0x1')](util[_0x719f('0x2')](_0x719f('0x3'),_0x4d8a17[_0x719f('0x4')]));if(transfers[_0x719f('0x5')][_0x4d8a17['uniqueid']]){_0x3abbfc=_0x4d8a17['uniqueid'];_0x4d8a17['uniqueid']=transfers['blinds'][_0x4d8a17[_0x719f('0x4')]][_0x719f('0x6')];}if(_0x4d8a17['accountcode']){utils['getUserByInternal'](_0x4d8a17[_0x719f('0x7')])[_0x719f('0x8')](function(_0x52cd41){if(_0x52cd41){_0x4d8a17['membername']=_0x52cd41[_0x719f('0x9')];_0x4d8a17[_0x719f('0xa')]=_0x52cd41['id'];}utils[_0x719f('0xb')](_0x719f('0xc'),_0x4d8a17);});}else{utils['request'](_0x719f('0xc'),_0x4d8a17);}if(_0x3abbfc)delete transfers[_0x719f('0x5')][_0x3abbfc];}exports['newchannel']=function(_0x24d75e){try{utils[_0x719f('0xd')](util[_0x719f('0x2')]('[%s][recordings][newchannel]',_0x24d75e[_0x719f('0x4')]),_0x24d75e);if(_0x24d75e[_0x719f('0x4')]==_0x24d75e[_0x719f('0xe')]){utils[_0x719f('0x1')](util[_0x719f('0x2')](_0x719f('0xf'),_0x24d75e[_0x719f('0x4')],_0x24d75e[_0x719f('0x10')],_0x24d75e[_0x719f('0x11')]));recordings[_0x24d75e['uniqueid']]={'uniqueid':_0x24d75e['uniqueid'],'accountcode':_0x24d75e[_0x719f('0x7')],'exten':_0x24d75e[_0x719f('0x11')],'context':_0x24d75e[_0x719f('0x10')],'channel':_0x24d75e[_0x719f('0x12')],'monitors':[]};}}catch(_0x413a88){utils[_0x719f('0x13')](util[_0x719f('0x2')](_0x719f('0x14'),_0x24d75e['uniqueid']),_0x413a88);}};exports[_0x719f('0x15')]=function(_0x3582f7){try{utils[_0x719f('0xd')](util[_0x719f('0x2')]('[%s][recordings][newstate]',_0x3582f7['uniqueid']),_0x3582f7);if(!_[_0x719f('0x16')](recordings[_0x3582f7[_0x719f('0x4')]])&&_0x3582f7['channelstate']==0x6){utils['info'](util['format'](_0x719f('0x17'),_0x3582f7[_0x719f('0x4')],_0x3582f7[_0x719f('0x10')],_0x3582f7[_0x719f('0x12')]));}else if(!_[_0x719f('0x16')](recordings[_0x3582f7[_0x719f('0xe')]])&&_0x3582f7[_0x719f('0x18')]==0x6&&_0x3582f7[_0x719f('0x10')]!=_0x719f('0x19')){utils[_0x719f('0x1')](util[_0x719f('0x2')](_0x719f('0x1a'),_0x3582f7[_0x719f('0x4')],_0x3582f7[_0x719f('0xe')],_0x3582f7['context'],_0x3582f7[_0x719f('0x12')]));recordings[_0x3582f7['linkedid']][_0x719f('0x7')]=_0x3582f7[_0x719f('0x7')];}}catch(_0x2544f){utils[_0x719f('0x13')](util[_0x719f('0x2')](_0x719f('0x1b'),_0x3582f7[_0x719f('0x4')]),_0x2544f);}};exports[_0x719f('0x1c')]=function(_0x4af1c5){try{if(!_[_0x719f('0x16')](_0x4af1c5[_0x719f('0x1d')])&&!_['isNil'](_0x4af1c5[_0x719f('0x1d')]['mixmonitor_filename'])){utils[_0x719f('0xd')](util[_0x719f('0x2')](_0x719f('0x1e'),_0x4af1c5[_0x719f('0x4')]),_0x4af1c5);utils[_0x719f('0x1')](util['format'](_0x719f('0x1f'),_0x4af1c5['uniqueid'],_0x4af1c5['variable'],_0x4af1c5[_0x719f('0x20')]));if(_[_0x719f('0x21')](_0x4af1c5[_0x719f('0x20')],'.wav49')){_0x4af1c5[_0x719f('0x20')]=_0x4af1c5[_0x719f('0x20')][_0x719f('0x22')](_0x719f('0x23'),_0x719f('0x24'));}if(recordings[_0x4af1c5['linkedid']]){var _0x3d6081=_[_0x719f('0x25')](recordings[_0x4af1c5[_0x719f('0xe')]][_0x719f('0x26')],{'value':_0x4af1c5[_0x719f('0x20')]});if(_[_0x719f('0x16')](_0x3d6081)){recordings[_0x4af1c5[_0x719f('0xe')]][_0x719f('0x26')][_0x719f('0x27')]({'value':_0x4af1c5['value']});}}}}catch(_0x58e219){utils[_0x719f('0x13')](util['format'](_0x719f('0x1e'),_0x4af1c5[_0x719f('0x4')]),_0x58e219);}};exports[_0x719f('0x28')]=function(_0x3ab29e){try{if(!_[_0x719f('0x16')](recordings[_0x3ab29e[_0x719f('0x4')]])){utils[_0x719f('0xd')](util[_0x719f('0x2')](_0x719f('0x29'),_0x3ab29e[_0x719f('0x4')]),_0x3ab29e);utils[_0x719f('0x1')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3ab29e[_0x719f('0x4')],_0x3ab29e[_0x719f('0x2a')],_0x3ab29e['calleridname'],_0x3ab29e[_0x719f('0x2b')]));recordings[_0x3ab29e[_0x719f('0x4')]]['calleridnum']=_0x3ab29e[_0x719f('0x2a')];recordings[_0x3ab29e[_0x719f('0x4')]]['calleridname']=_0x3ab29e[_0x719f('0x2c')];recordings[_0x3ab29e['uniqueid']][_0x719f('0x2d')]=_0x3ab29e[_0x719f('0x2d')];recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x2e')]=_0x3ab29e[_0x719f('0x2e')];if(recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x2f')]==_0x719f('0x30')&&recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x7')]){recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x2d')]=recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x7')];recordings[_0x3ab29e[_0x719f('0x4')]]['connectedlinename']='';}recordings[_0x3ab29e[_0x719f('0x4')]][_0x719f('0x26')][_0x719f('0x31')](function(_0x2aaa60){var _0x208bc4=_['clone'](recordings[_0x3ab29e[_0x719f('0x4')]]);_0x208bc4[_0x719f('0x20')]=_0x2aaa60[_0x719f('0x20')];writeDB(_0x208bc4);});delete recordings[_0x3ab29e['uniqueid']];}}catch(_0x5cc699){utils['error'](util[_0x719f('0x2')](_0x719f('0x29'),_0x3ab29e[_0x719f('0x4')]),_0x5cc699);}};exports[_0x719f('0x32')]=function(_0x51d38c){try{if(!_[_0x719f('0x16')](recordings[_0x51d38c['uniqueid']])){utils[_0x719f('0xd')](util['format']('[%s][recordings][newexten]',_0x51d38c[_0x719f('0x4')]),_0x51d38c);utils[_0x719f('0x1')](util[_0x719f('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x51d38c[_0x719f('0x4')],_0x51d38c['application'],_0x51d38c[_0x719f('0x33')]));if(_0x51d38c['application']['toLowerCase']()==_0x719f('0x34')&&_['startsWith'](_0x51d38c[_0x719f('0x33')][_0x719f('0x35')](),'cdr')){var _0x46330c=_0x51d38c[_0x719f('0x33')]['split']('=');var _0x37c26b=_0x46330c[0x0][_0x719f('0x36')](_0x46330c[0x0][_0x719f('0x37')]('(')+0x1,_0x46330c[0x0][_0x719f('0x37')](')'));var _0x211378=_0x46330c[0x1];recordings[_0x51d38c['uniqueid']][_0x37c26b]=_0x211378;}}}catch(_0xcc4203){utils[_0x719f('0x13')](util[_0x719f('0x2')](_0x719f('0x38'),_0x51d38c[_0x719f('0x4')]),_0xcc4203);}};exports[_0x719f('0x39')]=function(_0x4b955b){try{if(!_[_0x719f('0x16')](recordings[_0x4b955b['uniqueid']])){utils[_0x719f('0xd')](util[_0x719f('0x2')](_0x719f('0x3a'),_0x4b955b[_0x719f('0x4')]),_0x4b955b);utils[_0x719f('0x1')](util[_0x719f('0x2')](_0x719f('0x3b'),_0x4b955b[_0x719f('0x4')],_0x4b955b[_0x719f('0x3c')]));recordings[_0x4b955b[_0x719f('0x4')]]['queue']=_0x4b955b['queue'];}}catch(_0x2d084d){utils[_0x719f('0x13')](util['format'](_0x719f('0x3a'),_0x4b955b[_0x719f('0x4')]),_0x2d084d);}};exports[_0x719f('0x3d')]=function(_0x13c49b){try{utils['debug'](util[_0x719f('0x2')](_0x719f('0x3e'),_0x13c49b['uniqueid']),_0x13c49b);utils[_0x719f('0x1')](util['format'](_0x719f('0x3f'),_0x13c49b[_0x719f('0x4')],_0x13c49b['transferercalleridnum'],_0x13c49b[_0x719f('0x40')],_0x13c49b[_0x719f('0x41')],_0x13c49b[_0x719f('0x42')]));if(recordings[_0x13c49b['transfereruniqueid']]&&transfers['blinds'][_0x13c49b['transfereruniqueid']]){transfers[_0x719f('0x5')][_0x13c49b[_0x719f('0x43')]][_0x719f('0x44')]=!![];}}catch(_0x182cb4){utils[_0x719f('0x13')](util['format'](_0x719f('0x3e'),_0x13c49b[_0x719f('0x4')]),_0x182cb4);}}; \ No newline at end of file +var _0x0ca8=['push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','context','exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x0ca8,0x16e));var _0x80ca=function(_0x2111b5,_0x4f8465){_0x2111b5=_0x2111b5-0x0;var _0x12fa88=_0x0ca8[_0x2111b5];return _0x12fa88;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x80ca('0x0'));var transfers=require(_0x80ca('0x1'));var recordings={};function writeDB(_0x18d11f){var _0x1fa536;utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x4'),_0x18d11f[_0x80ca('0x5')]));if(transfers[_0x80ca('0x6')][_0x18d11f[_0x80ca('0x5')]]){_0x1fa536=_0x18d11f[_0x80ca('0x5')];_0x18d11f[_0x80ca('0x5')]=transfers[_0x80ca('0x6')][_0x18d11f[_0x80ca('0x5')]][_0x80ca('0x7')];}if(_0x18d11f[_0x80ca('0x8')]){utils['getUserByInternal'](_0x18d11f['accountcode'])['then'](function(_0x432edd){if(_0x432edd){_0x18d11f[_0x80ca('0x9')]=_0x432edd[_0x80ca('0xa')];_0x18d11f[_0x80ca('0xb')]=_0x432edd['id'];}utils[_0x80ca('0xc')](_0x80ca('0xd'),_0x18d11f);});}else{utils[_0x80ca('0xc')](_0x80ca('0xd'),_0x18d11f);}if(_0x1fa536)delete transfers['blinds'][_0x1fa536];}exports[_0x80ca('0xe')]=function(_0x4f4e06){try{utils[_0x80ca('0xf')](util[_0x80ca('0x3')]('[%s][recordings][newchannel]',_0x4f4e06[_0x80ca('0x5')]),_0x4f4e06);if(_0x4f4e06['uniqueid']==_0x4f4e06['linkedid']){utils['info'](util[_0x80ca('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x4f4e06[_0x80ca('0x5')],_0x4f4e06[_0x80ca('0x10')],_0x4f4e06[_0x80ca('0x11')]));recordings[_0x4f4e06['uniqueid']]={'uniqueid':_0x4f4e06[_0x80ca('0x5')],'accountcode':_0x4f4e06['accountcode'],'exten':_0x4f4e06['exten'],'context':_0x4f4e06[_0x80ca('0x10')],'channel':_0x4f4e06[_0x80ca('0x12')],'monitors':[]};}}catch(_0x80da9b){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x14'),_0x4f4e06[_0x80ca('0x5')]),_0x80da9b);}};exports['newstate']=function(_0x5928c8){try{utils['debug'](util['format'](_0x80ca('0x15'),_0x5928c8['uniqueid']),_0x5928c8);if(!_[_0x80ca('0x16')](recordings[_0x5928c8[_0x80ca('0x5')]])&&_0x5928c8[_0x80ca('0x17')]==0x6){utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x18'),_0x5928c8[_0x80ca('0x5')],_0x5928c8[_0x80ca('0x10')],_0x5928c8[_0x80ca('0x12')]));}else if(!_['isNil'](recordings[_0x5928c8[_0x80ca('0x19')]])&&_0x5928c8[_0x80ca('0x17')]==0x6&&_0x5928c8[_0x80ca('0x10')]!='transfer'){utils[_0x80ca('0x2')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5928c8[_0x80ca('0x5')],_0x5928c8[_0x80ca('0x19')],_0x5928c8[_0x80ca('0x10')],_0x5928c8['channel']));recordings[_0x5928c8[_0x80ca('0x19')]][_0x80ca('0x8')]=_0x5928c8[_0x80ca('0x8')];}}catch(_0x18b0b7){utils[_0x80ca('0x13')](util['format'](_0x80ca('0x15'),_0x5928c8[_0x80ca('0x5')]),_0x18b0b7);}};exports[_0x80ca('0x1a')]=function(_0x553fa4){try{if(!_[_0x80ca('0x16')](_0x553fa4[_0x80ca('0x1b')])&&!_[_0x80ca('0x16')](_0x553fa4[_0x80ca('0x1b')][_0x80ca('0x1c')])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x1d'),_0x553fa4[_0x80ca('0x5')]),_0x553fa4);utils[_0x80ca('0x2')](util[_0x80ca('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x553fa4[_0x80ca('0x5')],_0x553fa4[_0x80ca('0x1b')],_0x553fa4[_0x80ca('0x1e')]));if(_[_0x80ca('0x1f')](_0x553fa4[_0x80ca('0x1e')],_0x80ca('0x20'))){_0x553fa4[_0x80ca('0x1e')]=_0x553fa4[_0x80ca('0x1e')]['replace'](_0x80ca('0x20'),_0x80ca('0x21'));}if(recordings[_0x553fa4['linkedid']]){var _0x5220bd=_[_0x80ca('0x22')](recordings[_0x553fa4[_0x80ca('0x19')]][_0x80ca('0x23')],{'value':_0x553fa4[_0x80ca('0x1e')]});if(_[_0x80ca('0x16')](_0x5220bd)){recordings[_0x553fa4['linkedid']][_0x80ca('0x23')][_0x80ca('0x24')]({'value':_0x553fa4[_0x80ca('0x1e')]});}}}}catch(_0xb681fe){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x1d'),_0x553fa4[_0x80ca('0x5')]),_0xb681fe);}};exports[_0x80ca('0x25')]=function(_0x39765b){try{if(!_[_0x80ca('0x16')](recordings[_0x39765b[_0x80ca('0x5')]])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x26'),_0x39765b[_0x80ca('0x5')]),_0x39765b);utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x27'),_0x39765b['uniqueid'],_0x39765b['calleridnum'],_0x39765b[_0x80ca('0x28')],_0x39765b[_0x80ca('0x29')]));recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x2a')]=_0x39765b[_0x80ca('0x2a')];recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x28')]=_0x39765b[_0x80ca('0x28')];recordings[_0x39765b['uniqueid']][_0x80ca('0x2b')]=_0x39765b[_0x80ca('0x2b')];recordings[_0x39765b['uniqueid']][_0x80ca('0x2c')]=_0x39765b['connectedlinename'];if(recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x2d')]==_0x80ca('0x2e')&&recordings[_0x39765b[_0x80ca('0x5')]]['accountcode']){recordings[_0x39765b['uniqueid']]['connectedlinenum']=recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x8')];recordings[_0x39765b[_0x80ca('0x5')]]['connectedlinename']='';}recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x23')]['forEach'](function(_0x46da01){var _0x1df277=_['clone'](recordings[_0x39765b['uniqueid']]);_0x1df277['value']=_0x46da01['value'];writeDB(_0x1df277);});delete recordings[_0x39765b[_0x80ca('0x5')]];}}catch(_0x1c70fc){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x26'),_0x39765b[_0x80ca('0x5')]),_0x1c70fc);}};exports[_0x80ca('0x2f')]=function(_0x32fdec){try{if(!_['isNil'](recordings[_0x32fdec['uniqueid']])){utils['debug'](util[_0x80ca('0x3')]('[%s][recordings][newexten]',_0x32fdec[_0x80ca('0x5')]),_0x32fdec);utils[_0x80ca('0x2')](util['format'](_0x80ca('0x30'),_0x32fdec[_0x80ca('0x5')],_0x32fdec[_0x80ca('0x31')],_0x32fdec[_0x80ca('0x32')]));if(_0x32fdec['application'][_0x80ca('0x33')]()==_0x80ca('0x34')&&_[_0x80ca('0x35')](_0x32fdec[_0x80ca('0x32')]['toLowerCase'](),_0x80ca('0x36'))){var _0x51a438=_0x32fdec[_0x80ca('0x32')][_0x80ca('0x37')]('=');var _0x3fad18=_0x51a438[0x0][_0x80ca('0x38')](_0x51a438[0x0]['lastIndexOf']('(')+0x1,_0x51a438[0x0]['lastIndexOf'](')'));var _0x392322=_0x51a438[0x1];recordings[_0x32fdec[_0x80ca('0x5')]][_0x3fad18]=_0x392322;}}}catch(_0xb20fbe){utils[_0x80ca('0x13')](util['format']('[%s][recordings][newexten]',_0x32fdec[_0x80ca('0x5')]),_0xb20fbe);}};exports[_0x80ca('0x39')]=function(_0x22bbbc){try{if(!_[_0x80ca('0x16')](recordings[_0x22bbbc[_0x80ca('0x5')]])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x3a'),_0x22bbbc[_0x80ca('0x5')]),_0x22bbbc);utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x3b'),_0x22bbbc[_0x80ca('0x5')],_0x22bbbc[_0x80ca('0x3c')]));recordings[_0x22bbbc[_0x80ca('0x5')]][_0x80ca('0x3c')]=_0x22bbbc['queue'];}}catch(_0x38600e){utils[_0x80ca('0x13')](util['format'](_0x80ca('0x3a'),_0x22bbbc[_0x80ca('0x5')]),_0x38600e);}};exports['blindtransfer']=function(_0x486220){try{utils['debug'](util[_0x80ca('0x3')](_0x80ca('0x3d'),_0x486220[_0x80ca('0x5')]),_0x486220);utils[_0x80ca('0x2')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x486220[_0x80ca('0x5')],_0x486220['transferercalleridnum'],_0x486220[_0x80ca('0x3e')],_0x486220[_0x80ca('0x3f')],_0x486220[_0x80ca('0x40')]));if(recordings[_0x486220[_0x80ca('0x41')]]&&transfers['blinds'][_0x486220[_0x80ca('0x41')]]){transfers[_0x80ca('0x6')][_0x486220[_0x80ca('0x41')]][_0x80ca('0x42')]=!![];}}catch(_0xa1a17d){utils['error'](util['format'](_0x80ca('0x3d'),_0x486220[_0x80ca('0x5')]),_0xa1a17d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 1157253..479d8dc 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 _0x8ca3=['isNil','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','origtransferercontext','origtransfererexten'];(function(_0x15a162,_0x1a29bb){var _0x1381d4=function(_0x42b425){while(--_0x42b425){_0x15a162['push'](_0x15a162['shift']());}};_0x1381d4(++_0x1a29bb);}(_0x8ca3,0xa1));var _0x38ca=function(_0x4bc706,_0x2fbaba){_0x4bc706=_0x4bc706-0x0;var _0x23bce4=_0x8ca3[_0x4bc706];return _0x23bce4;};'use strict';var _=require('lodash');var util=require(_0x38ca('0x0'));var utils=require(_0x38ca('0x1'));function writeDB(_0x3457a5){utils['info'](util[_0x38ca('0x2')](_0x38ca('0x3'),_0x3457a5[_0x38ca('0x4')]===_0x38ca('0x5')?_0x3457a5[_0x38ca('0x6')]:_0x3457a5[_0x38ca('0x7')],_0x3457a5['type']));utils[_0x38ca('0x8')]('CreateVoiceTransferReport',_0x3457a5);}exports[_0x38ca('0x9')]={};exports[_0x38ca('0xa')]=function(_0x2c2950){try{utils[_0x38ca('0xb')](util['format'](_0x38ca('0xc'),_0x2c2950[_0x38ca('0x7')]),_0x2c2950);utils[_0x38ca('0xd')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2c2950['uniqueid'],_0x2c2950[_0x38ca('0xe')],_0x2c2950[_0x38ca('0xf')],_0x2c2950[_0x38ca('0x10')],_0x2c2950[_0x38ca('0x11')]));_0x2c2950[_0x38ca('0x4')]=_0x38ca('0x12');exports[_0x38ca('0x9')][_0x2c2950['transfereruniqueid']]=_0x2c2950;writeDB(_0x2c2950);}catch(_0x58d0bb){utils[_0x38ca('0x13')](util[_0x38ca('0x2')](_0x38ca('0xc'),_0x2c2950[_0x38ca('0x7')]),_0x58d0bb);}};exports['attendedtransfer']=function(_0x4089a8){try{utils[_0x38ca('0xb')](util[_0x38ca('0x2')](_0x38ca('0x14'),_0x4089a8[_0x38ca('0x6')]),_0x4089a8);utils[_0x38ca('0xd')](util[_0x38ca('0x2')](_0x38ca('0x15'),_0x4089a8['origtransfereruniqueid'],_0x4089a8['origtransferercalleridnum'],_0x4089a8['origtransferercalleridname'],_0x4089a8[_0x38ca('0x16')],_0x4089a8[_0x38ca('0x17')]));_0x4089a8=_['assign'](_0x4089a8,{'transfererchannel':_0x4089a8[_0x38ca('0x18')],'transferercalleridnum':_0x4089a8[_0x38ca('0x19')],'transferercalleridname':_0x4089a8['origtransferercalleridname'],'transfererconnectedlinenum':_0x4089a8['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4089a8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4089a8[_0x38ca('0x1a')],'transferercontext':_0x4089a8['secondtransferercontext'],'transfererexten':_0x4089a8['secondtransfererexten'],'transfererlinkedid':_0x4089a8['origtransfererlinkedid'],'context':_0x4089a8[_0x38ca('0x1b')],'extension':_0x4089a8[_0x38ca('0x1c')],'type':'attended'});if(_[_0x38ca('0x1d')](_0x4089a8['transfereechannel'])){_0x4089a8=_[_0x38ca('0x1e')](_0x4089a8,{'transfereechannel':_0x4089a8[_0x38ca('0x1f')],'transfereecalleridnum':_0x4089a8[_0x38ca('0x16')],'transfereecalleridname':_0x4089a8[_0x38ca('0x17')],'transfereeconnectedlinenum':_0x4089a8[_0x38ca('0x20')],'transfereeconnectedlinename':_0x4089a8[_0x38ca('0x21')],'transfereeaccountcode':_0x4089a8[_0x38ca('0x22')],'transfereecontext':_0x4089a8[_0x38ca('0x23')],'transfereeexten':_0x4089a8[_0x38ca('0x24')],'transfereelinkedid':_0x4089a8[_0x38ca('0x25')]});}writeDB(_0x4089a8);}catch(_0x167557){utils['error'](util['format'](_0x38ca('0x14'),_0x4089a8['origtransfereruniqueid']),_0x167557);}}; \ No newline at end of file +var _0x62d7=['origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','attended','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type'];(function(_0x1d4c1c,_0x120105){var _0x2e3058=function(_0x3ffe73){while(--_0x3ffe73){_0x1d4c1c['push'](_0x1d4c1c['shift']());}};_0x2e3058(++_0x120105);}(_0x62d7,0x112));var _0x762d=function(_0x1e2143,_0x39294f){_0x1e2143=_0x1e2143-0x0;var _0x35b68c=_0x62d7[_0x1e2143];return _0x35b68c;};'use strict';var _=require(_0x762d('0x0'));var util=require('util');var utils=require(_0x762d('0x1'));function writeDB(_0x16e5a0){utils[_0x762d('0x2')](util[_0x762d('0x3')](_0x762d('0x4'),_0x16e5a0[_0x762d('0x5')]==='attended'?_0x16e5a0[_0x762d('0x6')]:_0x16e5a0[_0x762d('0x7')],_0x16e5a0[_0x762d('0x5')]));utils[_0x762d('0x8')](_0x762d('0x9'),_0x16e5a0);}exports[_0x762d('0xa')]={};exports[_0x762d('0xb')]=function(_0x25a727){try{utils[_0x762d('0xc')](util[_0x762d('0x3')]('[%s][transfers][blindtransfer]',_0x25a727[_0x762d('0x7')]),_0x25a727);utils[_0x762d('0x2')](util[_0x762d('0x3')](_0x762d('0xd'),_0x25a727[_0x762d('0x7')],_0x25a727['transferercalleridnum'],_0x25a727[_0x762d('0xe')],_0x25a727[_0x762d('0xf')],_0x25a727['transfereecalleridname']));_0x25a727[_0x762d('0x5')]=_0x762d('0x10');exports[_0x762d('0xa')][_0x25a727['transfereruniqueid']]=_0x25a727;writeDB(_0x25a727);}catch(_0x55801d){utils[_0x762d('0x11')](util[_0x762d('0x3')](_0x762d('0x12'),_0x25a727[_0x762d('0x7')]),_0x55801d);}};exports[_0x762d('0x13')]=function(_0xf2c205){try{utils[_0x762d('0xc')](util[_0x762d('0x3')](_0x762d('0x14'),_0xf2c205['origtransfereruniqueid']),_0xf2c205);utils['info'](util[_0x762d('0x3')](_0x762d('0x15'),_0xf2c205['origtransfereruniqueid'],_0xf2c205[_0x762d('0x16')],_0xf2c205[_0x762d('0x17')],_0xf2c205[_0x762d('0x18')],_0xf2c205[_0x762d('0x19')]));_0xf2c205=_[_0x762d('0x1a')](_0xf2c205,{'transfererchannel':_0xf2c205[_0x762d('0x1b')],'transferercalleridnum':_0xf2c205[_0x762d('0x16')],'transferercalleridname':_0xf2c205[_0x762d('0x17')],'transfererconnectedlinenum':_0xf2c205['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xf2c205['secondtransfererconnectedlinename'],'transfereraccountcode':_0xf2c205[_0x762d('0x1c')],'transferercontext':_0xf2c205[_0x762d('0x1d')],'transfererexten':_0xf2c205['secondtransfererexten'],'transfererlinkedid':_0xf2c205[_0x762d('0x1e')],'context':_0xf2c205['origtransferercontext'],'extension':_0xf2c205[_0x762d('0x1f')],'type':_0x762d('0x20')});if(_['isNil'](_0xf2c205[_0x762d('0x21')])){_0xf2c205=_['assign'](_0xf2c205,{'transfereechannel':_0xf2c205['transfertargetchannel'],'transfereecalleridnum':_0xf2c205[_0x762d('0x18')],'transfereecalleridname':_0xf2c205[_0x762d('0x19')],'transfereeconnectedlinenum':_0xf2c205[_0x762d('0x22')],'transfereeconnectedlinename':_0xf2c205[_0x762d('0x23')],'transfereeaccountcode':_0xf2c205[_0x762d('0x24')],'transfereecontext':_0xf2c205[_0x762d('0x25')],'transfereeexten':_0xf2c205[_0x762d('0x26')],'transfereelinkedid':_0xf2c205[_0x762d('0x27')]});}writeDB(_0xf2c205);}catch(_0x55ce12){utils['error'](util[_0x762d('0x3')](_0x762d('0x14'),_0xf2c205[_0x762d('0x6')]),_0x55ce12);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index b8d027e..450c7b0 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 _0xe635=['getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','found','[utils][getUserByName]','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','name','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x231632,_0x4f5edc){var _0x3f614c=function(_0x1fd0e5){while(--_0x1fd0e5){_0x231632['push'](_0x231632['shift']());}};_0x3f614c(++_0x4f5edc);}(_0xe635,0xc9));var _0x5e63=function(_0x21384d,_0xca16){_0x21384d=_0x21384d-0x0;var _0x118772=_0xe635[_0x21384d];return _0x118772;};'use strict';var BPromise=require(_0x5e63('0x0'));var jayson=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var util=require(_0x5e63('0x3'));var client=jayson[_0x5e63('0x4')][_0x5e63('0x5')]({'port':0x2329});var logger=require(_0x5e63('0x6'))('xdr');exports[_0x5e63('0x7')]=function(_0x1cbfa5,_0x4f1dec){logger['info'](_0x1cbfa5,_0x4f1dec?util[_0x5e63('0x8')](_0x4f1dec,{'showHidden':![],'depth':null}):'');};exports[_0x5e63('0x9')]=function(_0x525875,_0x293187){logger['debug'](_0x525875,_0x293187?util[_0x5e63('0x8')](_0x293187,{'showHidden':![],'depth':null}):'');};exports[_0x5e63('0xa')]=function(_0x4a89eb,_0x25f2ff){logger[_0x5e63('0xa')](_0x4a89eb,_0x25f2ff?util[_0x5e63('0x8')](_0x25f2ff,{'showHidden':![],'depth':null}):'');};exports[_0x5e63('0xb')]=function(_0x119e6a,_0x3eeeab){return client['request'](_0x119e6a,{'body':_0x3eeeab})[_0x5e63('0xc')](function(_0x3e567d){logger[_0x5e63('0x9')](_0x5e63('0xd'),_0x119e6a,_0x3e567d?util[_0x5e63('0x8')](_0x3e567d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5abb99){logger['error'](_0x5e63('0xd'),_0x119e6a,_0x5abb99?util['inspect'](_0x5abb99,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3fbab9){return client['request'](_0x5e63('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x5e63('0xf'),'interface'],'where':_0x3fbab9,'limit':0x1}})[_0x5e63('0xc')](function(_0x42ea79){logger[_0x5e63('0x9')](_0x5e63('0x10'),JSON[_0x5e63('0x11')](_0x3fbab9),_0x42ea79?util['inspect'](_0x42ea79,{'showHidden':![],'depth':null}):'');return _0x42ea79[_0x5e63('0x12')]['length']?_0x42ea79[_0x5e63('0x12')][0x0]:null;});}exports[_0x5e63('0x13')]=function(_0x36bad5){return new BPromise(function(_0x591638,_0x5b6723){if(_0x36bad5){return getUser({'internal':_0x36bad5})['then'](function(_0x4373f6){logger[_0x5e63('0x7')](_0x5e63('0x14'),_0x36bad5,_0x4373f6?'found':_0x5e63('0x15'));return _0x591638(_0x4373f6);})[_0x5e63('0x16')](function(_0xb8960b){logger[_0x5e63('0xa')](_0x5e63('0x17'),_0xb8960b?util[_0x5e63('0x8')](_0xb8960b,{'showHidden':![],'depth':null}):'');return _0x591638(null);});}return _0x591638(null);});};exports[_0x5e63('0x18')]=function(_0xa6e754){return new BPromise(function(_0x3fdce5,_0x3097ed){if(_0xa6e754){return getUser({'interface':_0xa6e754})[_0x5e63('0xc')](function(_0x38e629){logger[_0x5e63('0x7')](_0x5e63('0x19'),_0xa6e754,_0x38e629?'found':'notfound');return _0x3fdce5(_0x38e629);})[_0x5e63('0x16')](function(_0x3c0f53){logger['error']('[utils][getUserByInterface]',_0x3c0f53?util[_0x5e63('0x8')](_0x3c0f53,{'showHidden':![],'depth':null}):'');return _0x3fdce5(null);});}return _0x3fdce5(null);});};exports[_0x5e63('0x1a')]=function(_0x3901e4){return new BPromise(function(_0x43da17,_0x297421){if(_0x3901e4){return getUser({'name':_0x3901e4})[_0x5e63('0xc')](function(_0x51711a){logger[_0x5e63('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x3901e4,_0x51711a?_0x5e63('0x1b'):_0x5e63('0x15'));return _0x43da17(_0x51711a);})['catch'](function(_0x356798){logger[_0x5e63('0xa')](_0x5e63('0x1c'),_0x356798?util[_0x5e63('0x8')](_0x356798,{'showHidden':![],'depth':null}):'');return _0x43da17(null);});}return _0x43da17(null);});};exports['getVoiceQueueByName']=function(_0x4f3908){return new BPromise(function(_0x33682e,_0x10d975){if(_0x4f3908){return client[_0x5e63('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x5e63('0x1d'),'acw',_0x5e63('0x1e')],'where':{'name':_0x4f3908},'limit':0x1}})['then'](function(_0x565599){logger['debug'](_0x5e63('0x1f'),_0x4f3908,_0x565599?util[_0x5e63('0x8')](_0x565599,{'showHidden':![],'depth':null}):'');logger[_0x5e63('0x7')](_0x5e63('0x20'),_0x4f3908,_0x565599?_0x5e63('0x1b'):_0x5e63('0x15'));return _0x33682e(_0x565599['result'][_0x5e63('0x21')]?_0x565599['result'][0x0]:null);})['catch'](function(_0x2550f1){logger['error']('[utils][getVoiceQueueByName]',_0x2550f1?util[_0x5e63('0x8')](_0x2550f1,{'showHidden':![],'depth':null}):'');return _0x33682e(null);});}return _0x33682e(null);});};exports['addTime']=function(_0x3a2d1b,_0x30120d){return moment(_0x3a2d1b)[_0x5e63('0x22')](_0x30120d,'seconds')[_0x5e63('0x23')](_0x5e63('0x24'));};exports['subtractTime']=function(_0x39f51d,_0x539686){return moment(_0x39f51d)[_0x5e63('0x25')](_0x539686,_0x5e63('0x26'))[_0x5e63('0x23')](_0x5e63('0x24'));};exports[_0x5e63('0x27')]=function(_0x375dfb,_0x32d4a6){return moment(_0x375dfb)[_0x5e63('0x28')](moment(_0x32d4a6),'seconds');};exports['sumTime']=function(_0x43e904,_0x7d187){return parseInt(_0x43e904,0xa)+parseInt(_0x7d187,0xa);};exports[_0x5e63('0x29')]=function(){return moment()[_0x5e63('0x23')](_0x5e63('0x24'));};exports[_0x5e63('0x2a')]=function(_0x1b9d06,_0x2c392e){if(_0x2c392e){return moment(_0x1b9d06)[_0x5e63('0x2a')](_0x2c392e);}return!![];};exports[_0x5e63('0x2b')]=function(_0x227aee,_0x1f7956){if(_0x1f7956){return moment(_0x227aee)[_0x5e63('0x2b')](_0x1f7956);}else if(_0x227aee){return!![];}return![];}; \ No newline at end of file +var _0x3d30=['getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','now','isAfter','isBefore','moment','client','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x3d30,0x6a));var _0x03d3=function(_0x179754,_0x3e39d6){_0x179754=_0x179754-0x0;var _0xc2df79=_0x3d30[_0x179754];return _0xc2df79;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x03d3('0x0'));var util=require('util');var client=jayson[_0x03d3('0x1')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x03d3('0x2'));exports['info']=function(_0xa97495,_0x1c79d0){logger[_0x03d3('0x3')](_0xa97495,_0x1c79d0?util[_0x03d3('0x4')](_0x1c79d0,{'showHidden':![],'depth':null}):'');};exports[_0x03d3('0x5')]=function(_0x306f6d,_0x52cec0){logger[_0x03d3('0x5')](_0x306f6d,_0x52cec0?util[_0x03d3('0x4')](_0x52cec0,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x23b0c1,_0xfbee39){logger[_0x03d3('0x6')](_0x23b0c1,_0xfbee39?util[_0x03d3('0x4')](_0xfbee39,{'showHidden':![],'depth':null}):'');};exports[_0x03d3('0x7')]=function(_0x11f4a3,_0x3679a5){return client[_0x03d3('0x7')](_0x11f4a3,{'body':_0x3679a5})[_0x03d3('0x8')](function(_0x5d62bc){logger['debug']('[utils][request]\x20name:%s',_0x11f4a3,_0x5d62bc?util[_0x03d3('0x4')](_0x5d62bc,{'showHidden':![],'depth':null}):'');})[_0x03d3('0x9')](function(_0x373a23){logger[_0x03d3('0x6')](_0x03d3('0xa'),_0x11f4a3,_0x373a23?util[_0x03d3('0x4')](_0x373a23,{'showHidden':![],'depth':null}):'');});};function getUser(_0x546d20){return client[_0x03d3('0x7')](_0x03d3('0xb'),{'options':{'raw':!![],'attributes':['id',_0x03d3('0xc'),_0x03d3('0xd'),'interface'],'where':_0x546d20,'limit':0x1}})[_0x03d3('0x8')](function(_0x239ff6){logger['debug'](_0x03d3('0xe'),JSON[_0x03d3('0xf')](_0x546d20),_0x239ff6?util[_0x03d3('0x4')](_0x239ff6,{'showHidden':![],'depth':null}):'');return _0x239ff6[_0x03d3('0x10')]['length']?_0x239ff6[_0x03d3('0x10')][0x0]:null;});}exports[_0x03d3('0x11')]=function(_0x43407d){return new BPromise(function(_0x8abc14,_0x4c72fe){if(_0x43407d){return getUser({'internal':_0x43407d})[_0x03d3('0x8')](function(_0x997721){logger['info'](_0x03d3('0x12'),_0x43407d,_0x997721?_0x03d3('0x13'):'notfound');return _0x8abc14(_0x997721);})['catch'](function(_0x313b5c){logger[_0x03d3('0x6')](_0x03d3('0x14'),_0x313b5c?util[_0x03d3('0x4')](_0x313b5c,{'showHidden':![],'depth':null}):'');return _0x8abc14(null);});}return _0x8abc14(null);});};exports[_0x03d3('0x15')]=function(_0x533d74){return new BPromise(function(_0x422070,_0xc20afa){if(_0x533d74){return getUser({'interface':_0x533d74})[_0x03d3('0x8')](function(_0x10060b){logger[_0x03d3('0x3')](_0x03d3('0x16'),_0x533d74,_0x10060b?_0x03d3('0x13'):_0x03d3('0x17'));return _0x422070(_0x10060b);})[_0x03d3('0x9')](function(_0x19446f){logger[_0x03d3('0x6')]('[utils][getUserByInterface]',_0x19446f?util[_0x03d3('0x4')](_0x19446f,{'showHidden':![],'depth':null}):'');return _0x422070(null);});}return _0x422070(null);});};exports[_0x03d3('0x18')]=function(_0xbaefc2){return new BPromise(function(_0x2370ee,_0x2108b4){if(_0xbaefc2){return getUser({'name':_0xbaefc2})[_0x03d3('0x8')](function(_0x439455){logger[_0x03d3('0x3')](_0x03d3('0x19'),_0xbaefc2,_0x439455?_0x03d3('0x13'):_0x03d3('0x17'));return _0x2370ee(_0x439455);})[_0x03d3('0x9')](function(_0x1f768e){logger[_0x03d3('0x6')]('[utils][getUserByName]',_0x1f768e?util[_0x03d3('0x4')](_0x1f768e,{'showHidden':![],'depth':null}):'');return _0x2370ee(null);});}return _0x2370ee(null);});};exports[_0x03d3('0x1a')]=function(_0x380c95){return new BPromise(function(_0x185711,_0x4d1e3f){if(_0x380c95){return client[_0x03d3('0x7')](_0x03d3('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x03d3('0xd'),_0x03d3('0x1c'),_0x03d3('0x1d'),_0x03d3('0x1e')],'where':{'name':_0x380c95},'limit':0x1}})[_0x03d3('0x8')](function(_0x1f71ce){logger[_0x03d3('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x380c95,_0x1f71ce?util[_0x03d3('0x4')](_0x1f71ce,{'showHidden':![],'depth':null}):'');logger[_0x03d3('0x3')](_0x03d3('0x1f'),_0x380c95,_0x1f71ce?_0x03d3('0x13'):_0x03d3('0x17'));return _0x185711(_0x1f71ce[_0x03d3('0x10')][_0x03d3('0x20')]?_0x1f71ce['result'][0x0]:null);})['catch'](function(_0x9f7a44){logger['error'](_0x03d3('0x21'),_0x9f7a44?util[_0x03d3('0x4')](_0x9f7a44,{'showHidden':![],'depth':null}):'');return _0x185711(null);});}return _0x185711(null);});};exports['addTime']=function(_0x17c94c,_0x2c18d6){return moment(_0x17c94c)[_0x03d3('0x22')](_0x2c18d6,_0x03d3('0x23'))[_0x03d3('0x24')](_0x03d3('0x25'));};exports[_0x03d3('0x26')]=function(_0x1d2982,_0x3bb4df){return moment(_0x1d2982)['subtract'](_0x3bb4df,_0x03d3('0x23'))[_0x03d3('0x24')](_0x03d3('0x25'));};exports['diffTime']=function(_0x131284,_0x23fe08){return moment(_0x131284)[_0x03d3('0x27')](moment(_0x23fe08),_0x03d3('0x23'));};exports[_0x03d3('0x28')]=function(_0x3c216c,_0x4b7d95){return parseInt(_0x3c216c,0xa)+parseInt(_0x4b7d95,0xa);};exports[_0x03d3('0x29')]=function(){return moment()[_0x03d3('0x24')](_0x03d3('0x25'));};exports[_0x03d3('0x2a')]=function(_0x85d749,_0x13e657){if(_0x13e657){return moment(_0x85d749)[_0x03d3('0x2a')](_0x13e657);}return!![];};exports[_0x03d3('0x2b')]=function(_0x32c9fd,_0x36bd9a){if(_0x36bd9a){return moment(_0x32c9fd)[_0x03d3('0x2b')](_0x36bd9a);}else if(_0x32c9fd){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 cbe2163..848dac4 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 _0xea44=['lodash','path','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','name','ensureDir','catch','no-user','data','timestamp','auth','set','client-side-logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','role','device','other','agent_id','agent_name','test'];(function(_0x325c53,_0x3d34b9){var _0x385860=function(_0x8a464d){while(--_0x8a464d){_0x325c53['push'](_0x325c53['shift']());}};_0x385860(++_0x3d34b9);}(_0xea44,0x158));var _0x4ea4=function(_0x35a118,_0x5bf11c){_0x35a118=_0x35a118-0x0;var _0x2c016f=_0xea44[_0x35a118];return _0x2c016f;};var fs=require('fs-extra');var _=require(_0x4ea4('0x0'));var ewinston=require('express-winston');var path=require(_0x4ea4('0x1'));var util=require(_0x4ea4('0x2'));var fileLogger=require(_0x4ea4('0x3'))[_0x4ea4('0x4')];var safeTemplate=require('./safe-template')[_0x4ea4('0x5')];var maskSensitiveData=require(_0x4ea4('0x6'))[_0x4ea4('0x7')];function ClientSideLogger(){function _0x54fa24(_0x40f48a){var _0x5ed337=path[_0x4ea4('0x8')]('/var',_0x4ea4('0x9'),_0x4ea4('0xa'));var _0x350b0d=path[_0x4ea4('0x8')](_0x4ea4('0xb'),_0x40f48a['role']+'-'+_0x40f48a[_0x4ea4('0xc')]);return fs[_0x4ea4('0xd')](path[_0x4ea4('0x8')](_0x5ed337,_0x350b0d))['then'](function(){var _0x1ab70d=fileLogger(_0x4ea4('0xb'),path['join'](_0x5ed337,_0x350b0d));return _0x1ab70d;})[_0x4ea4('0xe')](function(_0x314a09){throw _0x314a09;});}this['log']=function(_0x283c89,_0x2156e3,_0x556dcc,_0x45b35a){return _0x54fa24(_0x283c89['user'])['then'](function(_0x4a940d){var _0x18ee82=_0x4a940d[_0x2156e3];return _0x18ee82;})['then'](function(_0x3e6286){var _0x379098=_0x283c89['user']?_0x283c89['user']['id']:_0x4ea4('0xf');var _0x559368=_0x45b35a[_0x4ea4('0x10')];var _0x2cf964=_0x45b35a[_0x4ea4('0x11')];var _0x442da4=new Date(Number(_0x2cf964));return _0x3e6286(_0x379098,_0x442da4,_0x556dcc,_0x559368);})[_0x4ea4('0xe')](function(_0x3af2ce){fileLogger(_0x4ea4('0xb'))['error'](_0x3af2ce);});};}function setupLoggers(_0x479649){return new Promise(function(_0x3f3057){var _0x2b4064=new ClientSideLogger();var _0x4f980c=fileLogger('api');var _0x3b02d8=fileLogger(_0x4ea4('0x12'));_0x479649[_0x4ea4('0x13')](_0x4ea4('0x14'),_0x2b4064);_0x479649['use'](ewinston['logger']({'winstonInstance':_0x4f980c,'meta':![],'statusLevels':!![],'msg':function(_0x2beec2,_0xc0b068){var _0x498c40=_0x4ea4('0x15');if(!_[_0x4ea4('0x16')](_0x2beec2[_0x4ea4('0x17')])){_0x498c40+='\x20body=%s';var _0x1d9148=_0x2beec2[_0x4ea4('0x17')];maskSensitiveData(_0x1d9148);}return safeTemplate(util[_0x4ea4('0x18')](_0x498c40,_0x2beec2['method'],_0x2beec2[_0x4ea4('0x19')][_0x4ea4('0x1a')]?_0x2beec2[_0x4ea4('0x19')]['x-forwarded-for']:_0x2beec2[_0x4ea4('0x1b')][_0x4ea4('0x1c')]||_0x2beec2['ip'],_0x2beec2[_0x4ea4('0x1d')],_0xc0b068[_0x4ea4('0x1e')],_0xc0b068[_0x4ea4('0x1f')],_0x2beec2[_0x4ea4('0x20')]?_0x2beec2['user']['id']:null,_0x2beec2[_0x4ea4('0x20')]?_0x2beec2['user']['name']:null,_0x2beec2[_0x4ea4('0x20')]?_0x2beec2[_0x4ea4('0x20')]['role']:null,_0x1d9148?util[_0x4ea4('0x21')](_0x1d9148,![],null):''));}}));_0x479649['use'](ewinston[_0x4ea4('0x22')]({'winstonInstance':_0x3b02d8,'meta':![],'statusLevels':!![],'msg':function(_0x5a4116,_0x4fe497){var _0x1e0ab9=_0x4ea4('0x23');if(_0x5a4116[_0x4ea4('0x17')]&&_0x5a4116[_0x4ea4('0x17')]['device']&&_0x5a4116['body']['agent_id']){_0x1e0ab9=_0x4ea4('0x24');}return util[_0x4ea4('0x18')](_0x1e0ab9,_0x5a4116['method'],_0x5a4116[_0x4ea4('0x19')]['x-forwarded-for']?_0x5a4116[_0x4ea4('0x19')][_0x4ea4('0x1a')]:_0x5a4116[_0x4ea4('0x1b')]['remoteAddress']||_0x5a4116['ip'],_0x5a4116[_0x4ea4('0x1d')],_0x4fe497[_0x4ea4('0x1e')],_0x4fe497[_0x4ea4('0x1f')],_0x5a4116[_0x4ea4('0x20')]?_0x5a4116[_0x4ea4('0x20')]['id']:null,_0x5a4116[_0x4ea4('0x20')]?_0x5a4116[_0x4ea4('0x20')][_0x4ea4('0xc')]:null,_0x5a4116['user']?_0x5a4116['user'][_0x4ea4('0x25')]:null,_0x5a4116[_0x4ea4('0x17')]&&_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x26')]?_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x26')]:_0x4ea4('0x27'),_0x5a4116[_0x4ea4('0x17')]&&_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x28')]?_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x28')]:'',_0x5a4116[_0x4ea4('0x17')]&&_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x29')]?_0x5a4116[_0x4ea4('0x17')][_0x4ea4('0x29')]:'');},'ignoreRoute':function(_0x2f3279){var _0x535d0e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x535d0e[_0x4ea4('0x2a')](_0x2f3279['url']);}}));return _0x3f3057();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x9807=['device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','statusCode','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','util','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','catch','user','data','timestamp','api','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s'];(function(_0x161da0,_0x58f82a){var _0x50080f=function(_0xa21049){while(--_0xa21049){_0x161da0['push'](_0x161da0['shift']());}};_0x50080f(++_0x58f82a);}(_0x9807,0x19f));var _0x7980=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0x9807[_0x65c597];return _0x1ec368;};var fs=require(_0x7980('0x0'));var _=require(_0x7980('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x7980('0x2'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x7980('0x3'))[_0x7980('0x4')];var maskSensitiveData=require(_0x7980('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x4636a5(_0x347cbe){var _0x4aa054=path[_0x7980('0x6')](_0x7980('0x7'),_0x7980('0x8'),_0x7980('0x9'));var _0x20ff64=path[_0x7980('0x6')](_0x7980('0xa'),_0x347cbe['role']+'-'+_0x347cbe[_0x7980('0xb')]);return fs[_0x7980('0xc')](path[_0x7980('0x6')](_0x4aa054,_0x20ff64))[_0x7980('0xd')](function(){var _0x3a698a=fileLogger(_0x7980('0xa'),path[_0x7980('0x6')](_0x4aa054,_0x20ff64));return _0x3a698a;})[_0x7980('0xe')](function(_0x2420b0){throw _0x2420b0;});}this['log']=function(_0x5ea385,_0x2a92a1,_0x1f3a6c,_0x1000d4){return _0x4636a5(_0x5ea385[_0x7980('0xf')])[_0x7980('0xd')](function(_0x2151d7){var _0xff6df3=_0x2151d7[_0x2a92a1];return _0xff6df3;})[_0x7980('0xd')](function(_0x58295b){var _0x17e6f0=_0x5ea385[_0x7980('0xf')]?_0x5ea385[_0x7980('0xf')]['id']:'no-user';var _0xbe14bb=_0x1000d4[_0x7980('0x10')];var _0x1874b6=_0x1000d4[_0x7980('0x11')];var _0x93b6de=new Date(Number(_0x1874b6));return _0x58295b(_0x17e6f0,_0x93b6de,_0x1f3a6c,_0xbe14bb);})[_0x7980('0xe')](function(_0x54715a){fileLogger(_0x7980('0xa'))['error'](_0x54715a);});};}function setupLoggers(_0x42c594){return new Promise(function(_0x4209eb){var _0x1cd749=new ClientSideLogger();var _0x1e5ad4=fileLogger(_0x7980('0x12'));var _0x96023d=fileLogger(_0x7980('0x13'));_0x42c594[_0x7980('0x14')]('client-side-logger',_0x1cd749);_0x42c594[_0x7980('0x15')](ewinston[_0x7980('0x16')]({'winstonInstance':_0x1e5ad4,'meta':![],'statusLevels':!![],'msg':function(_0x138b68,_0x12fd6b){var _0x4a0a37=_0x7980('0x17');if(!_['isEmpty'](_0x138b68[_0x7980('0x18')])){_0x4a0a37+=_0x7980('0x19');var _0x238df6=_0x138b68[_0x7980('0x18')];maskSensitiveData(_0x238df6);}return safeTemplate(util[_0x7980('0x1a')](_0x4a0a37,_0x138b68[_0x7980('0x1b')],_0x138b68['headers']['x-forwarded-for']?_0x138b68[_0x7980('0x1c')][_0x7980('0x1d')]:_0x138b68[_0x7980('0x1e')][_0x7980('0x1f')]||_0x138b68['ip'],_0x138b68['url'],_0x12fd6b['statusCode'],_0x12fd6b['responseTime'],_0x138b68[_0x7980('0xf')]?_0x138b68[_0x7980('0xf')]['id']:null,_0x138b68[_0x7980('0xf')]?_0x138b68['user'][_0x7980('0xb')]:null,_0x138b68['user']?_0x138b68['user'][_0x7980('0x20')]:null,_0x238df6?util[_0x7980('0x21')](_0x238df6,![],null):''));}}));_0x42c594[_0x7980('0x15')](ewinston[_0x7980('0x16')]({'winstonInstance':_0x96023d,'meta':![],'statusLevels':!![],'msg':function(_0x1b8872,_0x343031){var _0x4a6cb2=_0x7980('0x22');if(_0x1b8872[_0x7980('0x18')]&&_0x1b8872['body'][_0x7980('0x23')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x24')]){_0x4a6cb2=_0x7980('0x25');}return util[_0x7980('0x1a')](_0x4a6cb2,_0x1b8872[_0x7980('0x1b')],_0x1b8872[_0x7980('0x1c')]['x-forwarded-for']?_0x1b8872[_0x7980('0x1c')]['x-forwarded-for']:_0x1b8872[_0x7980('0x1e')][_0x7980('0x1f')]||_0x1b8872['ip'],_0x1b8872[_0x7980('0x26')],_0x343031[_0x7980('0x27')],_0x343031[_0x7980('0x28')],_0x1b8872[_0x7980('0xf')]?_0x1b8872['user']['id']:null,_0x1b8872[_0x7980('0xf')]?_0x1b8872['user'][_0x7980('0xb')]:null,_0x1b8872[_0x7980('0xf')]?_0x1b8872[_0x7980('0xf')]['role']:null,_0x1b8872[_0x7980('0x18')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x23')]?_0x1b8872['body'][_0x7980('0x23')]:_0x7980('0x29'),_0x1b8872[_0x7980('0x18')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x24')]?_0x1b8872['body'][_0x7980('0x24')]:'',_0x1b8872['body']&&_0x1b8872[_0x7980('0x18')][_0x7980('0x2a')]?_0x1b8872[_0x7980('0x18')][_0x7980('0x2a')]:'');},'ignoreRoute':function(_0x185386){var _0x971aa1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x971aa1[_0x7980('0x2b')](_0x185386[_0x7980('0x26')]);}}));return _0x4209eb();});}exports[_0x7980('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 981787b..713a9ce 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53fa=['bold\x20blue','join','format','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','%s-%s','error','consoleLogger','fileLogger','util','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta'];(function(_0x3a6558,_0x2d8063){var _0x3485de=function(_0x41a1bf){while(--_0x41a1bf){_0x3a6558['push'](_0x3a6558['shift']());}};_0x3485de(++_0x2d8063);}(_0x53fa,0x11c));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var util=require(_0xa53f('0x0'));var moment=require('moment');var winston=require(_0xa53f('0x1'));var config=require('../config/environment');var debugLevel=config[_0xa53f('0x2')]?config[_0xa53f('0x2')][_0xa53f('0x3')]():_0xa53f('0x4');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':_0xa53f('0x5'),'error':_0xa53f('0x6'),'warn':_0xa53f('0x7'),'info':_0xa53f('0x8'),'print':_0xa53f('0x9'),'success':_0xa53f('0xa'),'http':'gray','verbose':_0xa53f('0xb'),'debug':_0xa53f('0xc'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3800b0,_0x6bfc83,_0x3d4b78){var _0x827ad2=_0x3800b0||'/var/log/xcally';return path[_0xa53f('0xd')](_0x827ad2,util[_0xa53f('0xe')]('%s-%s.log',_0x6bfc83,_0x3d4b78));}function formatter(_0x2e70ab,_0x56dba8){_0x56dba8[_0xa53f('0xf')]=_0x56dba8[_0xa53f('0xf')][_0xa53f('0x10')](/@@{/g,_0xa53f('0x11'))[_0xa53f('0x10')](/}@@/g,_0xa53f('0x12'))[_0xa53f('0x10')](/@{/g,'{{')[_0xa53f('0x10')](/}@/g,'}}');return util[_0xa53f('0xe')](_0xa53f('0x13'),moment()['format'](_0xa53f('0x14')),_0x56dba8[_0xa53f('0x15')][_0xa53f('0x16')](),_0x2e70ab,_0x56dba8['message']);}function fileFormat(_0x3e8796,_0x5b4f73){_0x5b4f73[_0xa53f('0xf')]=_0x5b4f73[_0xa53f('0xf')][_0xa53f('0x10')](/@@{/g,_0xa53f('0x11'))['replace'](/}@@/g,'}}}')[_0xa53f('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x4cfb7d=_0x5b4f73[_0xa53f('0x17')]&&Object[_0xa53f('0x18')](_0x5b4f73[_0xa53f('0x17')])[_0xa53f('0x19')]?'\x0a\x09'+JSON[_0xa53f('0x1a')](_0x5b4f73[_0xa53f('0x17')]):'';return util[_0xa53f('0xe')](_0xa53f('0x1b'),moment()['format'](_0xa53f('0x14')),_0x5b4f73[_0xa53f('0x15')][_0xa53f('0x16')](),_0x3e8796,_0x5b4f73[_0xa53f('0xf')],_0x4cfb7d);}function consoleLogger(){var _0x55c08c=new winston[(_0xa53f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa53f('0x1d'))][(_0xa53f('0x1e'))]({'level':_0xa53f('0x1f'),'json':![],'formatter':function(_0x5afe1c){return formatter('',_0x5afe1c);}})]});return _0x55c08c;}function fileLogger(_0x1a32c0,_0x4ec679){var _0x1bb6be=new winston[(_0xa53f('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa53f('0x1d'))][(_0xa53f('0x20'))]({'name':util[_0xa53f('0xe')](_0xa53f('0x21'),_0x1a32c0,_0xa53f('0x22')),'filename':getLogFileName(_0x4ec679,_0x1a32c0,_0xa53f('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x167b1c){return fileFormat(_0x1a32c0,_0x167b1c);}}),new winston[(_0xa53f('0x1d'))]['File']({'name':util['format'](_0xa53f('0x21'),_0x1a32c0,debugLevel),'filename':getLogFileName(_0x4ec679,_0x1a32c0,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x71987e){return fileFormat(_0x1a32c0,_0x71987e);}}),new winston['transports'][(_0xa53f('0x1e'))]({'level':_0xa53f('0x1f'),'json':![],'formatter':function(_0x2cc355){return fileFormat(_0x1a32c0,_0x2cc355);}})]});return _0x1bb6be;}exports[_0xa53f('0x23')]=consoleLogger;exports[_0xa53f('0x24')]=fileLogger; \ No newline at end of file +var _0x8963=['transports','Console','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x8963,0x79));var _0x3896=function(_0x1738ac,_0x2f527a){_0x1738ac=_0x1738ac-0x0;var _0x429055=_0x8963[_0x1738ac];return _0x429055;};'use strict';var path=require(_0x3896('0x0'));var util=require(_0x3896('0x1'));var moment=require(_0x3896('0x2'));var winston=require('winston');var config=require(_0x3896('0x3'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x3896('0x4')]():_0x3896('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':_0x3896('0x6'),'error':_0x3896('0x7'),'warn':_0x3896('0x8'),'info':'white','print':_0x3896('0x9'),'success':_0x3896('0xa'),'http':_0x3896('0xb'),'verbose':_0x3896('0xc'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1b0451,_0x3a6e9e,_0x3da1dd){var _0x12a248=_0x1b0451||_0x3896('0xd');return path[_0x3896('0xe')](_0x12a248,util['format'](_0x3896('0xf'),_0x3a6e9e,_0x3da1dd));}function formatter(_0x1c1cb6,_0x3479fe){_0x3479fe['message']=_0x3479fe[_0x3896('0x10')][_0x3896('0x11')](/@@{/g,_0x3896('0x12'))['replace'](/}@@/g,_0x3896('0x13'))[_0x3896('0x11')](/@{/g,'{{')[_0x3896('0x11')](/}@/g,'}}');return util[_0x3896('0x14')](_0x3896('0x15'),moment()[_0x3896('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3479fe[_0x3896('0x16')][_0x3896('0x17')](),_0x1c1cb6,_0x3479fe[_0x3896('0x10')]);}function fileFormat(_0x2f3caa,_0x8114eb){_0x8114eb[_0x3896('0x10')]=_0x8114eb['message']['replace'](/@@{/g,_0x3896('0x12'))[_0x3896('0x11')](/}@@/g,_0x3896('0x13'))[_0x3896('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x8d918b=_0x8114eb['meta']&&Object[_0x3896('0x18')](_0x8114eb[_0x3896('0x19')])[_0x3896('0x1a')]?'\x0a\x09'+JSON[_0x3896('0x1b')](_0x8114eb[_0x3896('0x19')]):'';return util['format'](_0x3896('0x1c'),moment()[_0x3896('0x14')](_0x3896('0x1d')),_0x8114eb[_0x3896('0x16')][_0x3896('0x17')](),_0x2f3caa,_0x8114eb[_0x3896('0x10')],_0x8d918b);}function consoleLogger(){var _0x57b042=new winston[(_0x3896('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3896('0x1f'))][(_0x3896('0x20'))]({'level':'warn','json':![],'formatter':function(_0x2d3c8d){return formatter('',_0x2d3c8d);}})]});return _0x57b042;}function fileLogger(_0x436dc7,_0x5effe7){var _0x33ba7c=new winston[(_0x3896('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3896('0x1f'))]['File']({'name':util[_0x3896('0x14')](_0x3896('0x21'),_0x436dc7,_0x3896('0x22')),'filename':getLogFileName(_0x5effe7,_0x436dc7,_0x3896('0x22')),'level':_0x3896('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x474d16){return fileFormat(_0x436dc7,_0x474d16);}}),new winston['transports']['File']({'name':util[_0x3896('0x14')]('%s-%s',_0x436dc7,debugLevel),'filename':getLogFileName(_0x5effe7,_0x436dc7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4dda96){return fileFormat(_0x436dc7,_0x4dda96);}}),new winston['transports'][(_0x3896('0x20'))]({'level':_0x3896('0x23'),'json':![],'formatter':function(_0x27b6c0){return fileFormat(_0x436dc7,_0x27b6c0);}})]});return _0x33ba7c;}exports[_0x3896('0x24')]=consoleLogger;exports[_0x3896('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 686bfd3..8a2ccab 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 _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x1a85,0x178));var _0x51a8=function(_0x4cacfc,_0x56dfe0){_0x4cacfc=_0x4cacfc-0x0;var _0xffb88c=_0x1a85[_0x4cacfc];return _0xffb88c;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x1967,0x173));var _0x7196=function(_0x52fe2e,_0x418070){_0x52fe2e=_0x52fe2e-0x0;var _0x19deec=_0x1967[_0x52fe2e];return _0x19deec;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index df947f5..7fe2235 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 _0xbaf0=['exports','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce'];(function(_0x5846b8,_0x521492){var _0x43993c=function(_0x1b3a86){while(--_0x1b3a86){_0x5846b8['push'](_0x5846b8['shift']());}};_0x43993c(++_0x521492);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x286ac2){return _0x286ac2==='{{'?_0x0baf('0x0'):_0x0baf('0x1');}function safeTemplate(_0x263f79){var _0x1688bc=_0x263f79;if(typeof _0x263f79===_0x0baf('0x2')){_0x1688bc=_0x263f79['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x0baf('0x3')](_0x263f79)){_0x1688bc=_0x263f79[_0x0baf('0x4')](function(_0x2d3fa5){return safeTemplate(_0x2d3fa5);});}else if(_[_0x0baf('0x5')](_0x263f79)){_0x1688bc=Object[_0x0baf('0x6')](_0x263f79)[_0x0baf('0x7')](function(_0x1a10b1,_0x2dcaac){_0x1a10b1[_0x2dcaac]=safeTemplate(_0x263f79[_0x2dcaac]);return _0x1a10b1;},{});}return _0x1688bc;}module[_0x0baf('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x2807ce,_0x5473c7){var _0x29a3f1=function(_0x2fb400){while(--_0x2fb400){_0x2807ce['push'](_0x2807ce['shift']());}};_0x29a3f1(++_0x5473c7);}(_0xea28,0x13a));var _0x8ea2=function(_0x2ccc38,_0x12733a){_0x2ccc38=_0x2ccc38-0x0;var _0x1ac591=_0xea28[_0x2ccc38];return _0x1ac591;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file